diff --git a/.gitea/workflows/pr.yaml b/.gitea/workflows/pr.yaml new file mode 100644 index 0000000..8c90a3f --- /dev/null +++ b/.gitea/workflows/pr.yaml @@ -0,0 +1,46 @@ +name: PR Checks + +on: + pull_request: + branches: + - main + +jobs: + pr-checks: + runs-on: ubuntu-latest + steps: + - name: Install Node + run: | + apt-get update && apt-get install -y nodejs + - name: Checkout + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + # This _shouldn't_ be necessary, since `node_modules` are checked-in? + # But, adding it because, without it, I get `Cannot find module '/workspace/scubbo/commit-report-sync/node_modules/.../...out/index.js'. + # Please verify that the package.json has a valid "main" entry + # Weird! + - name: Install + run: npm ci + +# Usually I would... +# - name: Super Linter +# uses: super-linter/super-linter@v7.3.0 +# But it's not playing nice with Gitea Actions: +# https://gitea.scubbo.org/scubbo/commit-report-sync/actions/runs/11/jobs/0 +# `failed to create container: 'Error response from daemon: conflicting options: custom host-to-IP mapping and the network mode'` +# So, while getting this working, falling back to ESLint and Prettier. +# +# Also TODO - convert these to actually fix problems, not just report them (mostly pretty easy - `--write` for prettier, +# and I gotta assume there's similar for `eslint` - but, I want to only change one thing at a time!) + - name: ESLint + run: | + npm install eslint + npx eslint . + - name: Prettier + run: | + npm install prettier + npx prettier . diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/self-publish.yml similarity index 96% rename from .gitea/workflows/main.yml rename to .gitea/workflows/self-publish.yml index 3e938d0..eb0aedc 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/self-publish.yml @@ -1,7 +1,10 @@ # I Am A Strange Loop name: Mirror to GitHub run-name: Mirror to GitHub -on: [push] +on: + push: + branches: + - main jobs: build-and-push: diff --git a/dist/index.js b/dist/index.js index fece34a..24a3b32 100644 --- a/dist/index.js +++ b/dist/index.js @@ -25710,8 +25710,6 @@ async function run() { const token_for_target_repo = core.getInput('token_for_target_repo'); // Obviously, don't log this! await (0, main_1.main)({ domain: source_domain, owner: source_owner, name: source_name }, { domain: target_domain, owner: target_owner, name: target_name }, dry_run, token_for_target_repo); - // Set output - core.setOutput('example-output', 'some value'); } catch (error) { if (error instanceof Error) { @@ -25795,8 +25793,8 @@ async function main(sourceRepo, targetRepo, dryRun, tokenForTargetRepo) { // than abandoning the target tree after the insertion point and trusting in later operation to rebuild it - because // the target repo's tree will have representations of commits from _other_ (source)repos too, which we cannot // recreate without their context) - var targetCommitHistory = buildTargetCommitHistory(TARGET_DIR, reversedSourceCommitHistory[0].date); - for (var sourceCommit of reversedSourceCommitHistory) { + let targetCommitHistory = buildTargetCommitHistory(TARGET_DIR, reversedSourceCommitHistory[0].date); + for (const sourceCommit of reversedSourceCommitHistory) { // "(Index of) First Target Commit that is earlier than (or equal to) the source commit" const targetCommitIndex = targetCommitHistory.findIndex(c => c.date <= sourceCommit.date); console.log(`DEBUG - targetCommitIndex: ${targetCommitIndex}. targetCommitHistory: ${JSON.stringify(targetCommitHistory)}`); @@ -25813,7 +25811,7 @@ async function main(sourceRepo, targetRepo, dryRun, tokenForTargetRepo) { } else { console.log(`DEBUG - No match for ${sourceCommit.hash} in ${targetCommit.hash} - inserting.`); - var followOnTargetCommit; + let followOnTargetCommit; if (targetCommitIndex == 0) { // The targetCommit is the latest (in time; first in the array) in the history - i.e. there is nothing to cherry-pick back on top of it followOnTargetCommit = undefined; @@ -25862,6 +25860,10 @@ function buildSourceCommitHistory(path, numCommits) { // If you want to copy this formatting for debugging, it's: // // --pretty=format:'{"hash":"%h","author_name":"%an","author_email":"%ae","date":"%ai","message":"%s"}' + // + // TODO - return to this and figure out if these are _actually_ "useless escapes" or not - got a couple layers + // of string-parsing to consider here, I wouldn't want to bet without testing! + //eslint-disable-next-line no-useless-escape `git log --max-count=${numCommits} --pretty=format:'{\"hash\":\"%h\",\"author_name\":\"%an\",\"author_email\":\"%ae\",\"date\":\"%ai\",\"message\":\"%s\"}'`, { cwd: path }); const logLines = logOutput.toString().split('\n'); for (const line of logLines) { @@ -25877,7 +25879,11 @@ function buildTargetCommitHistory(path, oldestDateInSourceCommitHistory) { const countingLogOutput = (0, child_process_1.execSync)(`git log --since=${oldestDateInSourceCommitHistory.toISOString()} --pretty=oneline`, { cwd: path }); const countedNumber = countingLogOutput.toString().split('\n').length; console.log(`DEBUG - countedNumber (how many commits in target repo since oldest source commit) is: ${countedNumber}`); - const logOutput = (0, child_process_1.execSync)(`git log --max-count=${countedNumber + 1} --pretty=format:'{\"hash\":\"%h\",\"author_name\":\"%an\",\"author_email\":\"%ae\",\"date\":\"%ai\",\"message\":\"%s\"}'`, { cwd: path }); + // TODO - return to this and figure out if these are _actually_ "useless escapes" or not - got a couple layers + // of string-parsing to consider here, I wouldn't want to bet without testing! + const logOutput = (0, child_process_1.execSync)( + //eslint-disable-next-line no-useless-escape + `git log --max-count=${countedNumber + 1} --pretty=format:'{\"hash\":\"%h\",\"author_name\":\"%an\",\"author_email\":\"%ae\",\"date\":\"%ai\",\"message\":\"%s\"}'`, { cwd: path }); const logLines = logOutput.toString().split('\n'); for (const line of logLines) { const commit = parseCommit(path, line); diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..cf6e35e --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,15 @@ +// TODO - this was setup with `npm init @eslint/config@latest`, so has mostly just standard defaults. +// Return to it and tweak 'em (and see if converting to TypeScript has any value!) +import globals from "globals"; +import pluginJs from "@eslint/js"; +import tseslint from "typescript-eslint"; + + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + {files: ["**/*.{js,mjs,cjs,ts}"]}, + {ignores: ["node_modules/", "dist/"]}, + {languageOptions: { globals: globals.browser }}, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, +]; \ No newline at end of file diff --git a/node_modules/@actions/core/package.json b/node_modules/@actions/core/package.json index 6b06b79..6d60010 100644 --- a/node_modules/@actions/core/package.json +++ b/node_modules/@actions/core/package.json @@ -1,41 +1,16 @@ { - "_from": "@actions/core@^1.10.1", - "_id": "@actions/core@1.11.1", - "_inBundle": false, - "_integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", - "_location": "/@actions/core", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@actions/core@^1.10.1", - "name": "@actions/core", - "escapedName": "@actions%2fcore", - "scope": "@actions", - "rawSpec": "^1.10.1", - "saveSpec": null, - "fetchSpec": "^1.10.1" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", - "_shasum": "ae683aac5112438021588030efb53b1adb86f172", - "_spec": "@actions/core@^1.10.1", - "_where": "/Users/scubbo/Code/commit-report-sync", - "bugs": { - "url": "https://github.com/actions/toolkit/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@actions/exec": "^1.1.1", - "@actions/http-client": "^2.0.1" - }, - "deprecated": false, + "name": "@actions/core", + "version": "1.11.1", "description": "Actions core lib", - "devDependencies": { - "@types/node": "^16.18.112" - }, + "keywords": [ + "github", + "actions", + "core" + ], + "homepage": "https://github.com/actions/toolkit/tree/main/packages/core", + "license": "MIT", + "main": "lib/core.js", + "types": "lib/core.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -44,15 +19,6 @@ "lib", "!.DS_Store" ], - "homepage": "https://github.com/actions/toolkit/tree/main/packages/core", - "keywords": [ - "github", - "actions", - "core" - ], - "license": "MIT", - "main": "lib/core.js", - "name": "@actions/core", "publishConfig": { "access": "public" }, @@ -66,6 +32,14 @@ "test": "echo \"Error: run tests from root\" && exit 1", "tsc": "tsc -p tsconfig.json" }, - "types": "lib/core.d.ts", - "version": "1.11.1" -} + "bugs": { + "url": "https://github.com/actions/toolkit/issues" + }, + "dependencies": { + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^16.18.112" + } +} \ No newline at end of file diff --git a/node_modules/@actions/exec/package.json b/node_modules/@actions/exec/package.json index c49a402..bc4d77a 100644 --- a/node_modules/@actions/exec/package.json +++ b/node_modules/@actions/exec/package.json @@ -1,37 +1,16 @@ { - "_from": "@actions/exec@^1.1.1", - "_id": "@actions/exec@1.1.1", - "_inBundle": false, - "_integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", - "_location": "/@actions/exec", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@actions/exec@^1.1.1", - "name": "@actions/exec", - "escapedName": "@actions%2fexec", - "scope": "@actions", - "rawSpec": "^1.1.1", - "saveSpec": null, - "fetchSpec": "^1.1.1" - }, - "_requiredBy": [ - "/@actions/core" - ], - "_resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", - "_shasum": "2e43f28c54022537172819a7cf886c844221a611", - "_spec": "@actions/exec@^1.1.1", - "_where": "/Users/scubbo/Code/commit-report-sync/node_modules/@actions/core", - "bugs": { - "url": "https://github.com/actions/toolkit/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@actions/io": "^1.0.1" - }, - "deprecated": false, + "name": "@actions/exec", + "version": "1.1.1", "description": "Actions exec lib", + "keywords": [ + "github", + "actions", + "exec" + ], + "homepage": "https://github.com/actions/toolkit/tree/main/packages/exec", + "license": "MIT", + "main": "lib/exec.js", + "types": "lib/exec.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -40,15 +19,6 @@ "lib", "!.DS_Store" ], - "homepage": "https://github.com/actions/toolkit/tree/main/packages/exec", - "keywords": [ - "github", - "actions", - "exec" - ], - "license": "MIT", - "main": "lib/exec.js", - "name": "@actions/exec", "publishConfig": { "access": "public" }, @@ -62,6 +32,10 @@ "test": "echo \"Error: run tests from root\" && exit 1", "tsc": "tsc" }, - "types": "lib/exec.d.ts", - "version": "1.1.1" + "bugs": { + "url": "https://github.com/actions/toolkit/issues" + }, + "dependencies": { + "@actions/io": "^1.0.1" + } } diff --git a/node_modules/@actions/http-client/package.json b/node_modules/@actions/http-client/package.json index 44fd0c3..3960a83 100644 --- a/node_modules/@actions/http-client/package.json +++ b/node_modules/@actions/http-client/package.json @@ -1,44 +1,16 @@ { - "_from": "@actions/http-client@^2.0.1", - "_id": "@actions/http-client@2.2.3", - "_inBundle": false, - "_integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", - "_location": "/@actions/http-client", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@actions/http-client@^2.0.1", - "name": "@actions/http-client", - "escapedName": "@actions%2fhttp-client", - "scope": "@actions", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/@actions/core" - ], - "_resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", - "_shasum": "31fc0b25c0e665754ed39a9f19a8611fc6dab674", - "_spec": "@actions/http-client@^2.0.1", - "_where": "/Users/scubbo/Code/commit-report-sync/node_modules/@actions/core", - "bugs": { - "url": "https://github.com/actions/toolkit/issues" - }, - "bundleDependencies": false, - "dependencies": { - "tunnel": "^0.0.6", - "undici": "^5.25.4" - }, - "deprecated": false, + "name": "@actions/http-client", + "version": "2.2.3", "description": "Actions Http Client", - "devDependencies": { - "@types/node": "20.7.1", - "@types/proxy": "^1.0.1", - "@types/tunnel": "0.0.3", - "proxy": "^2.1.1" - }, + "keywords": [ + "github", + "actions", + "http" + ], + "homepage": "https://github.com/actions/toolkit/tree/main/packages/http-client", + "license": "MIT", + "main": "lib/index.js", + "types": "lib/index.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -47,15 +19,6 @@ "lib", "!.DS_Store" ], - "homepage": "https://github.com/actions/toolkit/tree/main/packages/http-client", - "keywords": [ - "github", - "actions", - "http" - ], - "license": "MIT", - "main": "lib/index.js", - "name": "@actions/http-client", "publishConfig": { "access": "public" }, @@ -66,12 +29,23 @@ }, "scripts": { "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", + "test": "echo \"Error: run tests from root\" && exit 1", "build": "tsc", "format": "prettier --write **/*.ts", "format-check": "prettier --check **/*.ts", - "test": "echo \"Error: run tests from root\" && exit 1", "tsc": "tsc" }, - "types": "lib/index.d.ts", - "version": "2.2.3" -} + "bugs": { + "url": "https://github.com/actions/toolkit/issues" + }, + "devDependencies": { + "@types/node": "20.7.1", + "@types/tunnel": "0.0.3", + "proxy": "^2.1.1", + "@types/proxy": "^1.0.1" + }, + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } +} \ No newline at end of file diff --git a/node_modules/@actions/io/package.json b/node_modules/@actions/io/package.json index 25fa526..e8c8d8f 100644 --- a/node_modules/@actions/io/package.json +++ b/node_modules/@actions/io/package.json @@ -1,34 +1,16 @@ { - "_from": "@actions/io@^1.0.1", - "_id": "@actions/io@1.1.3", - "_inBundle": false, - "_integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", - "_location": "/@actions/io", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@actions/io@^1.0.1", - "name": "@actions/io", - "escapedName": "@actions%2fio", - "scope": "@actions", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/@actions/exec" - ], - "_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", - "_shasum": "4cdb6254da7962b07473ff5c335f3da485d94d71", - "_spec": "@actions/io@^1.0.1", - "_where": "/Users/scubbo/Code/commit-report-sync/node_modules/@actions/exec", - "bugs": { - "url": "https://github.com/actions/toolkit/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "@actions/io", + "version": "1.1.3", "description": "Actions io lib", + "keywords": [ + "github", + "actions", + "io" + ], + "homepage": "https://github.com/actions/toolkit/tree/main/packages/io", + "license": "MIT", + "main": "lib/io.js", + "types": "lib/io.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -36,15 +18,6 @@ "files": [ "lib" ], - "homepage": "https://github.com/actions/toolkit/tree/main/packages/io", - "keywords": [ - "github", - "actions", - "io" - ], - "license": "MIT", - "main": "lib/io.js", - "name": "@actions/io", "publishConfig": { "access": "public" }, @@ -58,6 +31,7 @@ "test": "echo \"Error: run tests from root\" && exit 1", "tsc": "tsc" }, - "types": "lib/io.d.ts", - "version": "1.1.3" + "bugs": { + "url": "https://github.com/actions/toolkit/issues" + } } diff --git a/node_modules/@eslint-community/eslint-utils/LICENSE b/node_modules/@eslint-community/eslint-utils/LICENSE new file mode 100644 index 0000000..883ee1f --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Toru Nagashima + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@eslint-community/eslint-utils/README.md b/node_modules/@eslint-community/eslint-utils/README.md new file mode 100644 index 0000000..90552a9 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/README.md @@ -0,0 +1,37 @@ +# @eslint-community/eslint-utils + +[![npm version](https://img.shields.io/npm/v/@eslint-community/eslint-utils.svg)](https://www.npmjs.com/package/@eslint-community/eslint-utils) +[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/eslint-utils.svg)](http://www.npmtrends.com/@eslint-community/eslint-utils) +[![Build Status](https://github.com/eslint-community/eslint-utils/workflows/CI/badge.svg)](https://github.com/eslint-community/eslint-utils/actions) +[![Coverage Status](https://codecov.io/gh/eslint-community/eslint-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/eslint-utils) + +## 🏁 Goal + +This package provides utility functions and classes for make ESLint custom rules. + +For examples: + +- [`getStaticValue`](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) evaluates static value on AST. +- [`ReferenceTracker`](https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. + +## 📖 Usage + +See [documentation](https://eslint-community.github.io/eslint-utils). + +## 📰 Changelog + +See [releases](https://github.com/eslint-community/eslint-utils/releases). + +## ❤️ Contributing + +Welcome contributing! + +Please use GitHub's Issues/PRs. + +### Development Tools + +- `npm test` runs tests and measures coverage. +- `npm run clean` removes the coverage result of `npm test` command. +- `npm run coverage` shows the coverage result of the last `npm test` command. +- `npm run lint` runs ESLint. +- `npm run watch` runs tests on each file change. diff --git a/node_modules/@eslint-community/eslint-utils/index.js b/node_modules/@eslint-community/eslint-utils/index.js new file mode 100644 index 0000000..7221c82 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/index.js @@ -0,0 +1,2059 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var eslintVisitorKeys = require('eslint-visitor-keys'); + +/** + * Get the innermost scope which contains a given location. + * @param {Scope} initialScope The initial scope to search. + * @param {Node} node The location to search. + * @returns {Scope} The innermost scope. + */ +function getInnermostScope(initialScope, node) { + const location = node.range[0]; + + let scope = initialScope; + let found = false; + do { + found = false; + for (const childScope of scope.childScopes) { + const range = childScope.block.range; + + if (range[0] <= location && location < range[1]) { + scope = childScope; + found = true; + break + } + } + } while (found) + + return scope +} + +/** + * Find the variable of a given name. + * @param {Scope} initialScope The scope to start finding. + * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node. + * @returns {Variable|null} The found variable or null. + */ +function findVariable(initialScope, nameOrNode) { + let name = ""; + let scope = initialScope; + + if (typeof nameOrNode === "string") { + name = nameOrNode; + } else { + name = nameOrNode.name; + scope = getInnermostScope(scope, nameOrNode); + } + + while (scope != null) { + const variable = scope.set.get(name); + if (variable != null) { + return variable + } + scope = scope.upper; + } + + return null +} + +/** + * Creates the negate function of the given function. + * @param {function(Token):boolean} f - The function to negate. + * @returns {function(Token):boolean} Negated function. + */ +function negate(f) { + return (token) => !f(token) +} + +/** + * Checks if the given token is a PunctuatorToken with the given value + * @param {Token} token - The token to check. + * @param {string} value - The value to check. + * @returns {boolean} `true` if the token is a PunctuatorToken with the given value. + */ +function isPunctuatorTokenWithValue(token, value) { + return token.type === "Punctuator" && token.value === value +} + +/** + * Checks if the given token is an arrow token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an arrow token. + */ +function isArrowToken(token) { + return isPunctuatorTokenWithValue(token, "=>") +} + +/** + * Checks if the given token is a comma token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comma token. + */ +function isCommaToken(token) { + return isPunctuatorTokenWithValue(token, ",") +} + +/** + * Checks if the given token is a semicolon token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a semicolon token. + */ +function isSemicolonToken(token) { + return isPunctuatorTokenWithValue(token, ";") +} + +/** + * Checks if the given token is a colon token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a colon token. + */ +function isColonToken(token) { + return isPunctuatorTokenWithValue(token, ":") +} + +/** + * Checks if the given token is an opening parenthesis token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening parenthesis token. + */ +function isOpeningParenToken(token) { + return isPunctuatorTokenWithValue(token, "(") +} + +/** + * Checks if the given token is a closing parenthesis token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing parenthesis token. + */ +function isClosingParenToken(token) { + return isPunctuatorTokenWithValue(token, ")") +} + +/** + * Checks if the given token is an opening square bracket token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening square bracket token. + */ +function isOpeningBracketToken(token) { + return isPunctuatorTokenWithValue(token, "[") +} + +/** + * Checks if the given token is a closing square bracket token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing square bracket token. + */ +function isClosingBracketToken(token) { + return isPunctuatorTokenWithValue(token, "]") +} + +/** + * Checks if the given token is an opening brace token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening brace token. + */ +function isOpeningBraceToken(token) { + return isPunctuatorTokenWithValue(token, "{") +} + +/** + * Checks if the given token is a closing brace token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing brace token. + */ +function isClosingBraceToken(token) { + return isPunctuatorTokenWithValue(token, "}") +} + +/** + * Checks if the given token is a comment token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +function isCommentToken(token) { + return ["Block", "Line", "Shebang"].includes(token.type) +} + +const isNotArrowToken = negate(isArrowToken); +const isNotCommaToken = negate(isCommaToken); +const isNotSemicolonToken = negate(isSemicolonToken); +const isNotColonToken = negate(isColonToken); +const isNotOpeningParenToken = negate(isOpeningParenToken); +const isNotClosingParenToken = negate(isClosingParenToken); +const isNotOpeningBracketToken = negate(isOpeningBracketToken); +const isNotClosingBracketToken = negate(isClosingBracketToken); +const isNotOpeningBraceToken = negate(isOpeningBraceToken); +const isNotClosingBraceToken = negate(isClosingBraceToken); +const isNotCommentToken = negate(isCommentToken); + +/** + * Get the `(` token of the given function node. + * @param {Node} node - The function node to get. + * @param {SourceCode} sourceCode - The source code object to get tokens. + * @returns {Token} `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + return node.id + ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) + : sourceCode.getFirstToken(node, isOpeningParenToken) +} + +/** + * Get the location of the given function node for reporting. + * @param {Node} node - The function node to get. + * @param {SourceCode} sourceCode - The source code object to get tokens. + * @returns {string} The location of the function node for reporting. + */ +function getFunctionHeadLocation(node, sourceCode) { + const parent = node.parent; + let start = null; + let end = null; + + if (node.type === "ArrowFunctionExpression") { + const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); + + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } else if ( + parent.type === "Property" || + parent.type === "MethodDefinition" || + parent.type === "PropertyDefinition" + ) { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + + return { + start: { ...start }, + end: { ...end }, + } +} + +/* globals globalThis, global, self, window */ + +const globalObject = + typeof globalThis !== "undefined" + ? globalThis + : typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : typeof global !== "undefined" + ? global + : {}; + +const builtinNames = Object.freeze( + new Set([ + "Array", + "ArrayBuffer", + "BigInt", + "BigInt64Array", + "BigUint64Array", + "Boolean", + "DataView", + "Date", + "decodeURI", + "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + "escape", + "Float32Array", + "Float64Array", + "Function", + "Infinity", + "Int16Array", + "Int32Array", + "Int8Array", + "isFinite", + "isNaN", + "isPrototypeOf", + "JSON", + "Map", + "Math", + "NaN", + "Number", + "Object", + "parseFloat", + "parseInt", + "Promise", + "Proxy", + "Reflect", + "RegExp", + "Set", + "String", + "Symbol", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray", + "undefined", + "unescape", + "WeakMap", + "WeakSet", + ]), +); +const callAllowed = new Set( + [ + Array.isArray, + Array.of, + Array.prototype.at, + Array.prototype.concat, + Array.prototype.entries, + Array.prototype.every, + Array.prototype.filter, + Array.prototype.find, + Array.prototype.findIndex, + Array.prototype.flat, + Array.prototype.includes, + Array.prototype.indexOf, + Array.prototype.join, + Array.prototype.keys, + Array.prototype.lastIndexOf, + Array.prototype.slice, + Array.prototype.some, + Array.prototype.toString, + Array.prototype.values, + typeof BigInt === "function" ? BigInt : undefined, + Boolean, + Date, + Date.parse, + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, + escape, + isFinite, + isNaN, + isPrototypeOf, + Map, + Map.prototype.entries, + Map.prototype.get, + Map.prototype.has, + Map.prototype.keys, + Map.prototype.values, + ...Object.getOwnPropertyNames(Math) + .filter((k) => k !== "random") + .map((k) => Math[k]) + .filter((f) => typeof f === "function"), + Number, + Number.isFinite, + Number.isNaN, + Number.parseFloat, + Number.parseInt, + Number.prototype.toExponential, + Number.prototype.toFixed, + Number.prototype.toPrecision, + Number.prototype.toString, + Object, + Object.entries, + Object.is, + Object.isExtensible, + Object.isFrozen, + Object.isSealed, + Object.keys, + Object.values, + parseFloat, + parseInt, + RegExp, + Set, + Set.prototype.entries, + Set.prototype.has, + Set.prototype.keys, + Set.prototype.values, + String, + String.fromCharCode, + String.fromCodePoint, + String.raw, + String.prototype.at, + String.prototype.charAt, + String.prototype.charCodeAt, + String.prototype.codePointAt, + String.prototype.concat, + String.prototype.endsWith, + String.prototype.includes, + String.prototype.indexOf, + String.prototype.lastIndexOf, + String.prototype.normalize, + String.prototype.padEnd, + String.prototype.padStart, + String.prototype.slice, + String.prototype.startsWith, + String.prototype.substr, + String.prototype.substring, + String.prototype.toLowerCase, + String.prototype.toString, + String.prototype.toUpperCase, + String.prototype.trim, + String.prototype.trimEnd, + String.prototype.trimLeft, + String.prototype.trimRight, + String.prototype.trimStart, + Symbol.for, + Symbol.keyFor, + unescape, + ].filter((f) => typeof f === "function"), +); +const callPassThrough = new Set([ + Object.freeze, + Object.preventExtensions, + Object.seal, +]); + +/** @type {ReadonlyArray]>} */ +const getterAllowed = [ + [Map, new Set(["size"])], + [ + RegExp, + new Set([ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "multiline", + "source", + "sticky", + "unicode", + ]), + ], + [Set, new Set(["size"])], +]; + +/** + * Get the property descriptor. + * @param {object} object The object to get. + * @param {string|number|symbol} name The property name to get. + */ +function getPropertyDescriptor(object, name) { + let x = object; + while ((typeof x === "object" || typeof x === "function") && x !== null) { + const d = Object.getOwnPropertyDescriptor(x, name); + if (d) { + return d + } + x = Object.getPrototypeOf(x); + } + return null +} + +/** + * Check if a property is getter or not. + * @param {object} object The object to check. + * @param {string|number|symbol} name The property name to check. + */ +function isGetter(object, name) { + const d = getPropertyDescriptor(object, name); + return d != null && d.get != null +} + +/** + * Get the element values of a given node list. + * @param {Node[]} nodeList The node list to get values. + * @param {Scope|undefined} initialScope The initial scope to find variables. + * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null. + */ +function getElementValues(nodeList, initialScope) { + const valueList = []; + + for (let i = 0; i < nodeList.length; ++i) { + const elementNode = nodeList[i]; + + if (elementNode == null) { + valueList.length = i + 1; + } else if (elementNode.type === "SpreadElement") { + const argument = getStaticValueR(elementNode.argument, initialScope); + if (argument == null) { + return null + } + valueList.push(...argument.value); + } else { + const element = getStaticValueR(elementNode, initialScope); + if (element == null) { + return null + } + valueList.push(element.value); + } + } + + return valueList +} + +/** + * Returns whether the given variable is never written to after initialization. + * @param {import("eslint").Scope.Variable} variable + * @returns {boolean} + */ +function isEffectivelyConst(variable) { + const refs = variable.references; + + const inits = refs.filter((r) => r.init).length; + const reads = refs.filter((r) => r.isReadOnly()).length; + if (inits === 1 && reads + inits === refs.length) { + // there is only one init and all other references only read + return true + } + return false +} + +const operations = Object.freeze({ + ArrayExpression(node, initialScope) { + const elements = getElementValues(node.elements, initialScope); + return elements != null ? { value: elements } : null + }, + + AssignmentExpression(node, initialScope) { + if (node.operator === "=") { + return getStaticValueR(node.right, initialScope) + } + return null + }, + + //eslint-disable-next-line complexity + BinaryExpression(node, initialScope) { + if (node.operator === "in" || node.operator === "instanceof") { + // Not supported. + return null + } + + const left = getStaticValueR(node.left, initialScope); + const right = getStaticValueR(node.right, initialScope); + if (left != null && right != null) { + switch (node.operator) { + case "==": + return { value: left.value == right.value } //eslint-disable-line eqeqeq + case "!=": + return { value: left.value != right.value } //eslint-disable-line eqeqeq + case "===": + return { value: left.value === right.value } + case "!==": + return { value: left.value !== right.value } + case "<": + return { value: left.value < right.value } + case "<=": + return { value: left.value <= right.value } + case ">": + return { value: left.value > right.value } + case ">=": + return { value: left.value >= right.value } + case "<<": + return { value: left.value << right.value } + case ">>": + return { value: left.value >> right.value } + case ">>>": + return { value: left.value >>> right.value } + case "+": + return { value: left.value + right.value } + case "-": + return { value: left.value - right.value } + case "*": + return { value: left.value * right.value } + case "/": + return { value: left.value / right.value } + case "%": + return { value: left.value % right.value } + case "**": + return { value: left.value ** right.value } + case "|": + return { value: left.value | right.value } + case "^": + return { value: left.value ^ right.value } + case "&": + return { value: left.value & right.value } + + // no default + } + } + + return null + }, + + CallExpression(node, initialScope) { + const calleeNode = node.callee; + const args = getElementValues(node.arguments, initialScope); + + if (args != null) { + if (calleeNode.type === "MemberExpression") { + if (calleeNode.property.type === "PrivateIdentifier") { + return null + } + const object = getStaticValueR(calleeNode.object, initialScope); + if (object != null) { + if ( + object.value == null && + (object.optional || node.optional) + ) { + return { value: undefined, optional: true } + } + const property = getStaticPropertyNameValue( + calleeNode, + initialScope, + ); + + if (property != null) { + const receiver = object.value; + const methodName = property.value; + if (callAllowed.has(receiver[methodName])) { + return { value: receiver[methodName](...args) } + } + if (callPassThrough.has(receiver[methodName])) { + return { value: args[0] } + } + } + } + } else { + const callee = getStaticValueR(calleeNode, initialScope); + if (callee != null) { + if (callee.value == null && node.optional) { + return { value: undefined, optional: true } + } + const func = callee.value; + if (callAllowed.has(func)) { + return { value: func(...args) } + } + if (callPassThrough.has(func)) { + return { value: args[0] } + } + } + } + } + + return null + }, + + ConditionalExpression(node, initialScope) { + const test = getStaticValueR(node.test, initialScope); + if (test != null) { + return test.value + ? getStaticValueR(node.consequent, initialScope) + : getStaticValueR(node.alternate, initialScope) + } + return null + }, + + ExpressionStatement(node, initialScope) { + return getStaticValueR(node.expression, initialScope) + }, + + Identifier(node, initialScope) { + if (initialScope != null) { + const variable = findVariable(initialScope, node); + + // Built-in globals. + if ( + variable != null && + variable.defs.length === 0 && + builtinNames.has(variable.name) && + variable.name in globalObject + ) { + return { value: globalObject[variable.name] } + } + + // Constants. + if (variable != null && variable.defs.length === 1) { + const def = variable.defs[0]; + if ( + def.parent && + def.type === "Variable" && + (def.parent.kind === "const" || + isEffectivelyConst(variable)) && + // TODO(mysticatea): don't support destructuring here. + def.node.id.type === "Identifier" + ) { + return getStaticValueR(def.node.init, initialScope) + } + } + } + return null + }, + + Literal(node) { + //istanbul ignore if : this is implementation-specific behavior. + if ((node.regex != null || node.bigint != null) && node.value == null) { + // It was a RegExp/BigInt literal, but Node.js didn't support it. + return null + } + return { value: node.value } + }, + + LogicalExpression(node, initialScope) { + const left = getStaticValueR(node.left, initialScope); + if (left != null) { + if ( + (node.operator === "||" && Boolean(left.value) === true) || + (node.operator === "&&" && Boolean(left.value) === false) || + (node.operator === "??" && left.value != null) + ) { + return left + } + + const right = getStaticValueR(node.right, initialScope); + if (right != null) { + return right + } + } + + return null + }, + + MemberExpression(node, initialScope) { + if (node.property.type === "PrivateIdentifier") { + return null + } + const object = getStaticValueR(node.object, initialScope); + if (object != null) { + if (object.value == null && (object.optional || node.optional)) { + return { value: undefined, optional: true } + } + const property = getStaticPropertyNameValue(node, initialScope); + + if (property != null) { + if (!isGetter(object.value, property.value)) { + return { value: object.value[property.value] } + } + + for (const [classFn, allowed] of getterAllowed) { + if ( + object.value instanceof classFn && + allowed.has(property.value) + ) { + return { value: object.value[property.value] } + } + } + } + } + return null + }, + + ChainExpression(node, initialScope) { + const expression = getStaticValueR(node.expression, initialScope); + if (expression != null) { + return { value: expression.value } + } + return null + }, + + NewExpression(node, initialScope) { + const callee = getStaticValueR(node.callee, initialScope); + const args = getElementValues(node.arguments, initialScope); + + if (callee != null && args != null) { + const Func = callee.value; + if (callAllowed.has(Func)) { + return { value: new Func(...args) } + } + } + + return null + }, + + ObjectExpression(node, initialScope) { + const object = {}; + + for (const propertyNode of node.properties) { + if (propertyNode.type === "Property") { + if (propertyNode.kind !== "init") { + return null + } + const key = getStaticPropertyNameValue( + propertyNode, + initialScope, + ); + const value = getStaticValueR(propertyNode.value, initialScope); + if (key == null || value == null) { + return null + } + object[key.value] = value.value; + } else if ( + propertyNode.type === "SpreadElement" || + propertyNode.type === "ExperimentalSpreadProperty" + ) { + const argument = getStaticValueR( + propertyNode.argument, + initialScope, + ); + if (argument == null) { + return null + } + Object.assign(object, argument.value); + } else { + return null + } + } + + return { value: object } + }, + + SequenceExpression(node, initialScope) { + const last = node.expressions[node.expressions.length - 1]; + return getStaticValueR(last, initialScope) + }, + + TaggedTemplateExpression(node, initialScope) { + const tag = getStaticValueR(node.tag, initialScope); + const expressions = getElementValues( + node.quasi.expressions, + initialScope, + ); + + if (tag != null && expressions != null) { + const func = tag.value; + const strings = node.quasi.quasis.map((q) => q.value.cooked); + strings.raw = node.quasi.quasis.map((q) => q.value.raw); + + if (func === String.raw) { + return { value: func(strings, ...expressions) } + } + } + + return null + }, + + TemplateLiteral(node, initialScope) { + const expressions = getElementValues(node.expressions, initialScope); + if (expressions != null) { + let value = node.quasis[0].value.cooked; + for (let i = 0; i < expressions.length; ++i) { + value += expressions[i]; + value += node.quasis[i + 1].value.cooked; + } + return { value } + } + return null + }, + + UnaryExpression(node, initialScope) { + if (node.operator === "delete") { + // Not supported. + return null + } + if (node.operator === "void") { + return { value: undefined } + } + + const arg = getStaticValueR(node.argument, initialScope); + if (arg != null) { + switch (node.operator) { + case "-": + return { value: -arg.value } + case "+": + return { value: +arg.value } //eslint-disable-line no-implicit-coercion + case "!": + return { value: !arg.value } + case "~": + return { value: ~arg.value } + case "typeof": + return { value: typeof arg.value } + + // no default + } + } + + return null + }, +}); + +/** + * Get the value of a given node if it's a static value. + * @param {Node} node The node to get. + * @param {Scope|undefined} initialScope The scope to start finding variable. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. + */ +function getStaticValueR(node, initialScope) { + if (node != null && Object.hasOwnProperty.call(operations, node.type)) { + return operations[node.type](node, initialScope) + } + return null +} + +/** + * Get the static value of property name from a MemberExpression node or a Property node. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`. + */ +function getStaticPropertyNameValue(node, initialScope) { + const nameNode = node.type === "Property" ? node.key : node.property; + + if (node.computed) { + return getStaticValueR(nameNode, initialScope) + } + + if (nameNode.type === "Identifier") { + return { value: nameNode.name } + } + + if (nameNode.type === "Literal") { + if (nameNode.bigint) { + return { value: nameNode.bigint } + } + return { value: String(nameNode.value) } + } + + return null +} + +/** + * Get the value of a given node if it's a static value. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. + */ +function getStaticValue(node, initialScope = null) { + try { + return getStaticValueR(node, initialScope) + } catch (_error) { + return null + } +} + +/** + * Get the value of a given node if it's a literal or a template literal. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant. + * @returns {string|null} The value of the node, or `null`. + */ +function getStringIfConstant(node, initialScope = null) { + // Handle the literals that the platform doesn't support natively. + if (node && node.type === "Literal" && node.value === null) { + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}` + } + if (node.bigint) { + return node.bigint + } + } + + const evaluated = getStaticValue(node, initialScope); + return evaluated && String(evaluated.value) +} + +/** + * Get the property name from a MemberExpression node or a Property node. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it. + * @returns {string|null} The property name of the node. + */ +function getPropertyName(node, initialScope) { + switch (node.type) { + case "MemberExpression": + if (node.computed) { + return getStringIfConstant(node.property, initialScope) + } + if (node.property.type === "PrivateIdentifier") { + return null + } + return node.property.name + + case "Property": + case "MethodDefinition": + case "PropertyDefinition": + if (node.computed) { + return getStringIfConstant(node.key, initialScope) + } + if (node.key.type === "Literal") { + return String(node.key.value) + } + if (node.key.type === "PrivateIdentifier") { + return null + } + return node.key.name + + // no default + } + + return null +} + +/** + * Get the name and kind of the given function node. + * @param {ASTNode} node - The function node to get. + * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys. + * @returns {string} The name and kind of the function node. + */ +// eslint-disable-next-line complexity +function getFunctionNameWithKind(node, sourceCode) { + const parent = node.parent; + const tokens = []; + const isObjectMethod = parent.type === "Property" && parent.value === node; + const isClassMethod = + parent.type === "MethodDefinition" && parent.value === node; + const isClassFieldMethod = + parent.type === "PropertyDefinition" && parent.value === node; + + // Modifiers. + if (isClassMethod || isClassFieldMethod) { + if (parent.static) { + tokens.push("static"); + } + if (parent.key.type === "PrivateIdentifier") { + tokens.push("private"); + } + } + if (node.async) { + tokens.push("async"); + } + if (node.generator) { + tokens.push("generator"); + } + + // Kinds. + if (isObjectMethod || isClassMethod) { + if (parent.kind === "constructor") { + return "constructor" + } + if (parent.kind === "get") { + tokens.push("getter"); + } else if (parent.kind === "set") { + tokens.push("setter"); + } else { + tokens.push("method"); + } + } else if (isClassFieldMethod) { + tokens.push("method"); + } else { + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow"); + } + tokens.push("function"); + } + + // Names. + if (isObjectMethod || isClassMethod || isClassFieldMethod) { + if (parent.key.type === "PrivateIdentifier") { + tokens.push(`#${parent.key.name}`); + } else { + const name = getPropertyName(parent); + if (name) { + tokens.push(`'${name}'`); + } else if (sourceCode) { + const keyText = sourceCode.getText(parent.key); + if (!keyText.includes("\n")) { + tokens.push(`[${keyText}]`); + } + } + } + } else if (node.id) { + tokens.push(`'${node.id.name}'`); + } else if ( + parent.type === "VariableDeclarator" && + parent.id && + parent.id.type === "Identifier" + ) { + tokens.push(`'${parent.id.name}'`); + } else if ( + (parent.type === "AssignmentExpression" || + parent.type === "AssignmentPattern") && + parent.left && + parent.left.type === "Identifier" + ) { + tokens.push(`'${parent.left.name}'`); + } else if ( + parent.type === "ExportDefaultDeclaration" && + parent.declaration === node + ) { + tokens.push("'default'"); + } + + return tokens.join(" ") +} + +const typeConversionBinaryOps = Object.freeze( + new Set([ + "==", + "!=", + "<", + "<=", + ">", + ">=", + "<<", + ">>", + ">>>", + "+", + "-", + "*", + "/", + "%", + "|", + "^", + "&", + "in", + ]), +); +const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"])); + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string" +} + +const visitor = Object.freeze( + Object.assign(Object.create(null), { + $visit(node, options, visitorKeys) { + const { type } = node; + + if (typeof this[type] === "function") { + return this[type](node, options, visitorKeys) + } + + return this.$visitChildren(node, options, visitorKeys) + }, + + $visitChildren(node, options, visitorKeys) { + const { type } = node; + + for (const key of visitorKeys[type] || eslintVisitorKeys.getKeys(node)) { + const value = node[key]; + + if (Array.isArray(value)) { + for (const element of value) { + if ( + isNode(element) && + this.$visit(element, options, visitorKeys) + ) { + return true + } + } + } else if ( + isNode(value) && + this.$visit(value, options, visitorKeys) + ) { + return true + } + } + + return false + }, + + ArrowFunctionExpression() { + return false + }, + AssignmentExpression() { + return true + }, + AwaitExpression() { + return true + }, + BinaryExpression(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + typeConversionBinaryOps.has(node.operator) && + (node.left.type !== "Literal" || node.right.type !== "Literal") + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + CallExpression() { + return true + }, + FunctionExpression() { + return false + }, + ImportExpression() { + return true + }, + MemberExpression(node, options, visitorKeys) { + if (options.considerGetters) { + return true + } + if ( + options.considerImplicitTypeConversion && + node.computed && + node.property.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + MethodDefinition(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + NewExpression() { + return true + }, + Property(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + PropertyDefinition(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + UnaryExpression(node, options, visitorKeys) { + if (node.operator === "delete") { + return true + } + if ( + options.considerImplicitTypeConversion && + typeConversionUnaryOps.has(node.operator) && + node.argument.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + UpdateExpression() { + return true + }, + YieldExpression() { + return true + }, + }), +); + +/** + * Check whether a given node has any side effect or not. + * @param {Node} node The node to get. + * @param {SourceCode} sourceCode The source code object. + * @param {object} [options] The option object. + * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects. + * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects. + * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`. + * @returns {boolean} `true` if the node has a certain side effect. + */ +function hasSideEffect( + node, + sourceCode, + { considerGetters = false, considerImplicitTypeConversion = false } = {}, +) { + return visitor.$visit( + node, + { considerGetters, considerImplicitTypeConversion }, + sourceCode.visitorKeys || eslintVisitorKeys.KEYS, + ) +} + +/** + * Get the left parenthesis of the parent node syntax if it exists. + * E.g., `if (a) {}` then the `(`. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token|null} The left parenthesis of the parent node syntax + */ +function getParentSyntaxParen(node, sourceCode) { + const parent = node.parent; + + switch (parent.type) { + case "CallExpression": + case "NewExpression": + if (parent.arguments.length === 1 && parent.arguments[0] === node) { + return sourceCode.getTokenAfter( + parent.callee, + isOpeningParenToken, + ) + } + return null + + case "DoWhileStatement": + if (parent.test === node) { + return sourceCode.getTokenAfter( + parent.body, + isOpeningParenToken, + ) + } + return null + + case "IfStatement": + case "WhileStatement": + if (parent.test === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "ImportExpression": + if (parent.source === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "SwitchStatement": + if (parent.discriminant === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "WithStatement": + if (parent.object === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + default: + return null + } +} + +/** + * Check whether a given node is parenthesized or not. + * @param {number} times The number of parantheses. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is parenthesized the given times. + */ +/** + * Check whether a given node is parenthesized or not. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is parenthesized. + */ +function isParenthesized( + timesOrNode, + nodeOrSourceCode, + optionalSourceCode, +) { + let times, node, sourceCode, maybeLeftParen, maybeRightParen; + if (typeof timesOrNode === "number") { + times = timesOrNode | 0; + node = nodeOrSourceCode; + sourceCode = optionalSourceCode; + if (!(times >= 1)) { + throw new TypeError("'times' should be a positive integer.") + } + } else { + times = 1; + node = timesOrNode; + sourceCode = nodeOrSourceCode; + } + + if ( + node == null || + // `Program` can't be parenthesized + node.parent == null || + // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}` + (node.parent.type === "CatchClause" && node.parent.param === node) + ) { + return false + } + + maybeLeftParen = maybeRightParen = node; + do { + maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen); + maybeRightParen = sourceCode.getTokenAfter(maybeRightParen); + } while ( + maybeLeftParen != null && + maybeRightParen != null && + isOpeningParenToken(maybeLeftParen) && + isClosingParenToken(maybeRightParen) && + // Avoid false positive such as `if (a) {}` + maybeLeftParen !== getParentSyntaxParen(node, sourceCode) && + --times > 0 + ) + + return times === 0 +} + +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ + +const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu; + +/** @type {WeakMap} */ +const internal = new WeakMap(); + +/** + * Check whether a given character is escaped or not. + * @param {string} str The string to check. + * @param {number} index The location of the character to check. + * @returns {boolean} `true` if the character is escaped. + */ +function isEscaped(str, index) { + let escaped = false; + for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) { + escaped = !escaped; + } + return escaped +} + +/** + * Replace a given string by a given matcher. + * @param {PatternMatcher} matcher The pattern matcher. + * @param {string} str The string to be replaced. + * @param {string} replacement The new substring to replace each matched part. + * @returns {string} The replaced string. + */ +function replaceS(matcher, str, replacement) { + const chunks = []; + let index = 0; + + /** @type {RegExpExecArray} */ + let match = null; + + /** + * @param {string} key The placeholder. + * @returns {string} The replaced string. + */ + function replacer(key) { + switch (key) { + case "$$": + return "$" + case "$&": + return match[0] + case "$`": + return str.slice(0, match.index) + case "$'": + return str.slice(match.index + match[0].length) + default: { + const i = key.slice(1); + if (i in match) { + return match[i] + } + return key + } + } + } + + for (match of matcher.execAll(str)) { + chunks.push(str.slice(index, match.index)); + chunks.push(replacement.replace(placeholder, replacer)); + index = match.index + match[0].length; + } + chunks.push(str.slice(index)); + + return chunks.join("") +} + +/** + * Replace a given string by a given matcher. + * @param {PatternMatcher} matcher The pattern matcher. + * @param {string} str The string to be replaced. + * @param {(...strs[])=>string} replace The function to replace each matched part. + * @returns {string} The replaced string. + */ +function replaceF(matcher, str, replace) { + const chunks = []; + let index = 0; + + for (const match of matcher.execAll(str)) { + chunks.push(str.slice(index, match.index)); + chunks.push(String(replace(...match, match.index, match.input))); + index = match.index + match[0].length; + } + chunks.push(str.slice(index)); + + return chunks.join("") +} + +/** + * The class to find patterns as considering escape sequences. + */ +class PatternMatcher { + /** + * Initialize this matcher. + * @param {RegExp} pattern The pattern to match. + * @param {{escaped:boolean}} options The options. + */ + constructor(pattern, { escaped = false } = {}) { + if (!(pattern instanceof RegExp)) { + throw new TypeError("'pattern' should be a RegExp instance.") + } + if (!pattern.flags.includes("g")) { + throw new Error("'pattern' should contains 'g' flag.") + } + + internal.set(this, { + pattern: new RegExp(pattern.source, pattern.flags), + escaped: Boolean(escaped), + }); + } + + /** + * Find the pattern in a given string. + * @param {string} str The string to find. + * @returns {IterableIterator} The iterator which iterate the matched information. + */ + *execAll(str) { + const { pattern, escaped } = internal.get(this); + let match = null; + let lastIndex = 0; + + pattern.lastIndex = 0; + while ((match = pattern.exec(str)) != null) { + if (escaped || !isEscaped(str, match.index)) { + lastIndex = pattern.lastIndex; + yield match; + pattern.lastIndex = lastIndex; + } + } + } + + /** + * Check whether the pattern is found in a given string. + * @param {string} str The string to check. + * @returns {boolean} `true` if the pattern was found in the string. + */ + test(str) { + const it = this.execAll(str); + const ret = it.next(); + return !ret.done + } + + /** + * Replace a given string. + * @param {string} str The string to be replaced. + * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`. + * @returns {string} The replaced string. + */ + [Symbol.replace](str, replacer) { + return typeof replacer === "function" + ? replaceF(this, String(str), replacer) + : replaceS(this, String(str), String(replacer)) + } +} + +const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u; +const has = Function.call.bind(Object.hasOwnProperty); + +const READ = Symbol("read"); +const CALL = Symbol("call"); +const CONSTRUCT = Symbol("construct"); +const ESM = Symbol("esm"); + +const requireCall = { require: { [CALL]: true } }; + +/** + * Check whether a given variable is modified or not. + * @param {Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is modified. + */ +function isModifiedGlobal(variable) { + return ( + variable == null || + variable.defs.length !== 0 || + variable.references.some((r) => r.isWrite()) + ) +} + +/** + * Check if the value of a given node is passed through to the parent syntax as-is. + * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is passed through. + */ +function isPassThrough(node) { + const parent = node.parent; + + switch (parent && parent.type) { + case "ConditionalExpression": + return parent.consequent === node || parent.alternate === node + case "LogicalExpression": + return true + case "SequenceExpression": + return parent.expressions[parent.expressions.length - 1] === node + case "ChainExpression": + return true + + default: + return false + } +} + +/** + * The reference tracker. + */ +class ReferenceTracker { + /** + * Initialize this tracker. + * @param {Scope} globalScope The global scope. + * @param {object} [options] The options. + * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules. + * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object. + */ + constructor( + globalScope, + { + mode = "strict", + globalObjectNames = ["global", "globalThis", "self", "window"], + } = {}, + ) { + this.variableStack = []; + this.globalScope = globalScope; + this.mode = mode; + this.globalObjectNames = globalObjectNames.slice(0); + } + + /** + * Iterate the references of global variables. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateGlobalReferences(traceMap) { + for (const key of Object.keys(traceMap)) { + const nextTraceMap = traceMap[key]; + const path = [key]; + const variable = this.globalScope.set.get(key); + + if (isModifiedGlobal(variable)) { + continue + } + + yield* this._iterateVariableReferences( + variable, + path, + nextTraceMap, + true, + ); + } + + for (const key of this.globalObjectNames) { + const path = []; + const variable = this.globalScope.set.get(key); + + if (isModifiedGlobal(variable)) { + continue + } + + yield* this._iterateVariableReferences( + variable, + path, + traceMap, + false, + ); + } + } + + /** + * Iterate the references of CommonJS modules. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateCjsReferences(traceMap) { + for (const { node } of this.iterateGlobalReferences(requireCall)) { + const key = getStringIfConstant(node.arguments[0]); + if (key == null || !has(traceMap, key)) { + continue + } + + const nextTraceMap = traceMap[key]; + const path = [key]; + + if (nextTraceMap[READ]) { + yield { + node, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iteratePropertyReferences(node, path, nextTraceMap); + } + } + + /** + * Iterate the references of ES modules. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateEsmReferences(traceMap) { + const programNode = this.globalScope.block; + + for (const node of programNode.body) { + if (!IMPORT_TYPE.test(node.type) || node.source == null) { + continue + } + const moduleId = node.source.value; + + if (!has(traceMap, moduleId)) { + continue + } + const nextTraceMap = traceMap[moduleId]; + const path = [moduleId]; + + if (nextTraceMap[READ]) { + yield { node, path, type: READ, info: nextTraceMap[READ] }; + } + + if (node.type === "ExportAllDeclaration") { + for (const key of Object.keys(nextTraceMap)) { + const exportTraceMap = nextTraceMap[key]; + if (exportTraceMap[READ]) { + yield { + node, + path: path.concat(key), + type: READ, + info: exportTraceMap[READ], + }; + } + } + } else { + for (const specifier of node.specifiers) { + const esm = has(nextTraceMap, ESM); + const it = this._iterateImportReferences( + specifier, + path, + esm + ? nextTraceMap + : this.mode === "legacy" + ? { default: nextTraceMap, ...nextTraceMap } + : { default: nextTraceMap }, + ); + + if (esm) { + yield* it; + } else { + for (const report of it) { + report.path = report.path.filter(exceptDefault); + if ( + report.path.length >= 2 || + report.type !== READ + ) { + yield report; + } + } + } + } + } + } + } + + /** + * Iterate the references for a given variable. + * @param {Variable} variable The variable to iterate that references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @param {boolean} shouldReport = The flag to report those references. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateVariableReferences(variable, path, traceMap, shouldReport) { + if (this.variableStack.includes(variable)) { + return + } + this.variableStack.push(variable); + try { + for (const reference of variable.references) { + if (!reference.isRead()) { + continue + } + const node = reference.identifier; + + if (shouldReport && traceMap[READ]) { + yield { node, path, type: READ, info: traceMap[READ] }; + } + yield* this._iteratePropertyReferences(node, path, traceMap); + } + } finally { + this.variableStack.pop(); + } + } + + /** + * Iterate the references for a given AST node. + * @param rootNode The AST node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + //eslint-disable-next-line complexity + *_iteratePropertyReferences(rootNode, path, traceMap) { + let node = rootNode; + while (isPassThrough(node)) { + node = node.parent; + } + + const parent = node.parent; + if (parent.type === "MemberExpression") { + if (parent.object === node) { + const key = getPropertyName(parent); + if (key == null || !has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: parent, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iteratePropertyReferences( + parent, + path, + nextTraceMap, + ); + } + return + } + if (parent.type === "CallExpression") { + if (parent.callee === node && traceMap[CALL]) { + yield { node: parent, path, type: CALL, info: traceMap[CALL] }; + } + return + } + if (parent.type === "NewExpression") { + if (parent.callee === node && traceMap[CONSTRUCT]) { + yield { + node: parent, + path, + type: CONSTRUCT, + info: traceMap[CONSTRUCT], + }; + } + return + } + if (parent.type === "AssignmentExpression") { + if (parent.right === node) { + yield* this._iterateLhsReferences(parent.left, path, traceMap); + yield* this._iteratePropertyReferences(parent, path, traceMap); + } + return + } + if (parent.type === "AssignmentPattern") { + if (parent.right === node) { + yield* this._iterateLhsReferences(parent.left, path, traceMap); + } + return + } + if (parent.type === "VariableDeclarator") { + if (parent.init === node) { + yield* this._iterateLhsReferences(parent.id, path, traceMap); + } + } + } + + /** + * Iterate the references for a given Pattern node. + * @param {Node} patternNode The Pattern node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateLhsReferences(patternNode, path, traceMap) { + if (patternNode.type === "Identifier") { + const variable = findVariable(this.globalScope, patternNode); + if (variable != null) { + yield* this._iterateVariableReferences( + variable, + path, + traceMap, + false, + ); + } + return + } + if (patternNode.type === "ObjectPattern") { + for (const property of patternNode.properties) { + const key = getPropertyName(property); + + if (key == null || !has(traceMap, key)) { + continue + } + + const nextPath = path.concat(key); + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: property, + path: nextPath, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iterateLhsReferences( + property.value, + nextPath, + nextTraceMap, + ); + } + return + } + if (patternNode.type === "AssignmentPattern") { + yield* this._iterateLhsReferences(patternNode.left, path, traceMap); + } + } + + /** + * Iterate the references for a given ModuleSpecifier node. + * @param {Node} specifierNode The ModuleSpecifier node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateImportReferences(specifierNode, path, traceMap) { + const type = specifierNode.type; + + if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") { + const key = + type === "ImportDefaultSpecifier" + ? "default" + : specifierNode.imported.name; + if (!has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: specifierNode, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iterateVariableReferences( + findVariable(this.globalScope, specifierNode.local), + path, + nextTraceMap, + false, + ); + + return + } + + if (type === "ImportNamespaceSpecifier") { + yield* this._iterateVariableReferences( + findVariable(this.globalScope, specifierNode.local), + path, + traceMap, + false, + ); + return + } + + if (type === "ExportSpecifier") { + const key = specifierNode.local.name; + if (!has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: specifierNode, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + } + } +} + +ReferenceTracker.READ = READ; +ReferenceTracker.CALL = CALL; +ReferenceTracker.CONSTRUCT = CONSTRUCT; +ReferenceTracker.ESM = ESM; + +/** + * This is a predicate function for Array#filter. + * @param {string} name A name part. + * @param {number} index The index of the name. + * @returns {boolean} `false` if it's default. + */ +function exceptDefault(name, index) { + return !(index === 1 && name === "default") +} + +var index = { + CALL, + CONSTRUCT, + ESM, + findVariable, + getFunctionHeadLocation, + getFunctionNameWithKind, + getInnermostScope, + getPropertyName, + getStaticValue, + getStringIfConstant, + hasSideEffect, + isArrowToken, + isClosingBraceToken, + isClosingBracketToken, + isClosingParenToken, + isColonToken, + isCommaToken, + isCommentToken, + isNotArrowToken, + isNotClosingBraceToken, + isNotClosingBracketToken, + isNotClosingParenToken, + isNotColonToken, + isNotCommaToken, + isNotCommentToken, + isNotOpeningBraceToken, + isNotOpeningBracketToken, + isNotOpeningParenToken, + isNotSemicolonToken, + isOpeningBraceToken, + isOpeningBracketToken, + isOpeningParenToken, + isParenthesized, + isSemicolonToken, + PatternMatcher, + READ, + ReferenceTracker, +}; + +exports.CALL = CALL; +exports.CONSTRUCT = CONSTRUCT; +exports.ESM = ESM; +exports.PatternMatcher = PatternMatcher; +exports.READ = READ; +exports.ReferenceTracker = ReferenceTracker; +exports["default"] = index; +exports.findVariable = findVariable; +exports.getFunctionHeadLocation = getFunctionHeadLocation; +exports.getFunctionNameWithKind = getFunctionNameWithKind; +exports.getInnermostScope = getInnermostScope; +exports.getPropertyName = getPropertyName; +exports.getStaticValue = getStaticValue; +exports.getStringIfConstant = getStringIfConstant; +exports.hasSideEffect = hasSideEffect; +exports.isArrowToken = isArrowToken; +exports.isClosingBraceToken = isClosingBraceToken; +exports.isClosingBracketToken = isClosingBracketToken; +exports.isClosingParenToken = isClosingParenToken; +exports.isColonToken = isColonToken; +exports.isCommaToken = isCommaToken; +exports.isCommentToken = isCommentToken; +exports.isNotArrowToken = isNotArrowToken; +exports.isNotClosingBraceToken = isNotClosingBraceToken; +exports.isNotClosingBracketToken = isNotClosingBracketToken; +exports.isNotClosingParenToken = isNotClosingParenToken; +exports.isNotColonToken = isNotColonToken; +exports.isNotCommaToken = isNotCommaToken; +exports.isNotCommentToken = isNotCommentToken; +exports.isNotOpeningBraceToken = isNotOpeningBraceToken; +exports.isNotOpeningBracketToken = isNotOpeningBracketToken; +exports.isNotOpeningParenToken = isNotOpeningParenToken; +exports.isNotSemicolonToken = isNotSemicolonToken; +exports.isOpeningBraceToken = isOpeningBraceToken; +exports.isOpeningBracketToken = isOpeningBracketToken; +exports.isOpeningParenToken = isOpeningParenToken; +exports.isParenthesized = isParenthesized; +exports.isSemicolonToken = isSemicolonToken; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@eslint-community/eslint-utils/index.js.map b/node_modules/@eslint-community/eslint-utils/index.js.map new file mode 100644 index 0000000..7f3d789 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["src/get-innermost-scope.mjs","src/find-variable.mjs","src/token-predicate.mjs","src/get-function-head-location.mjs","src/get-static-value.mjs","src/get-string-if-constant.mjs","src/get-property-name.mjs","src/get-function-name-with-kind.mjs","src/has-side-effect.mjs","src/is-parenthesized.mjs","src/pattern-matcher.mjs","src/reference-tracker.mjs","src/index.mjs"],"sourcesContent":["/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n const location = node.range[0]\n\n let scope = initialScope\n let found = false\n do {\n found = false\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope\n found = true\n break\n }\n }\n } while (found)\n\n return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope.mjs\"\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n let name = \"\"\n let scope = initialScope\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode\n } else {\n name = nameOrNode.name\n scope = getInnermostScope(scope, nameOrNode)\n }\n\n while (scope != null) {\n const variable = scope.set.get(name)\n if (variable != null) {\n return variable\n }\n scope = scope.upper\n }\n\n return null\n}\n","/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return (token) => !f(token)\n}\n\n/**\n * Checks if the given token is a PunctuatorToken with the given value\n * @param {Token} token - The token to check.\n * @param {string} value - The value to check.\n * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.\n */\nfunction isPunctuatorTokenWithValue(token, value) {\n return token.type === \"Punctuator\" && token.value === value\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n return isPunctuatorTokenWithValue(token, \"=>\")\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n return isPunctuatorTokenWithValue(token, \",\")\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n return isPunctuatorTokenWithValue(token, \";\")\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n return isPunctuatorTokenWithValue(token, \":\")\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n return isPunctuatorTokenWithValue(token, \"(\")\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n return isPunctuatorTokenWithValue(token, \")\")\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"[\")\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"]\")\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"{\")\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"}\")\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n return [\"Block\", \"Line\", \"Shebang\"].includes(token.type)\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent\n let start = null\n let end = null\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken)\n\n start = arrowToken.loc.start\n end = arrowToken.loc.end\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\" ||\n parent.type === \"PropertyDefinition\"\n ) {\n start = parent.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n } else {\n start = node.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n }\n\n return {\n start: { ...start },\n end: { ...end },\n }\n}\n","/* globals globalThis, global, self, window */\n\nimport { findVariable } from \"./find-variable.mjs\"\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {}\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ]),\n)\nconst callAllowed = new Set(\n [\n Array.isArray,\n Array.of,\n Array.prototype.at,\n Array.prototype.concat,\n Array.prototype.entries,\n Array.prototype.every,\n Array.prototype.filter,\n Array.prototype.find,\n Array.prototype.findIndex,\n Array.prototype.flat,\n Array.prototype.includes,\n Array.prototype.indexOf,\n Array.prototype.join,\n Array.prototype.keys,\n Array.prototype.lastIndexOf,\n Array.prototype.slice,\n Array.prototype.some,\n Array.prototype.toString,\n Array.prototype.values,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n Map,\n Map.prototype.entries,\n Map.prototype.get,\n Map.prototype.has,\n Map.prototype.keys,\n Map.prototype.values,\n ...Object.getOwnPropertyNames(Math)\n .filter((k) => k !== \"random\")\n .map((k) => Math[k])\n .filter((f) => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Number.prototype.toExponential,\n Number.prototype.toFixed,\n Number.prototype.toPrecision,\n Number.prototype.toString,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n Set,\n Set.prototype.entries,\n Set.prototype.has,\n Set.prototype.keys,\n Set.prototype.values,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n String.prototype.at,\n String.prototype.charAt,\n String.prototype.charCodeAt,\n String.prototype.codePointAt,\n String.prototype.concat,\n String.prototype.endsWith,\n String.prototype.includes,\n String.prototype.indexOf,\n String.prototype.lastIndexOf,\n String.prototype.normalize,\n String.prototype.padEnd,\n String.prototype.padStart,\n String.prototype.slice,\n String.prototype.startsWith,\n String.prototype.substr,\n String.prototype.substring,\n String.prototype.toLowerCase,\n String.prototype.toString,\n String.prototype.toUpperCase,\n String.prototype.trim,\n String.prototype.trimEnd,\n String.prototype.trimLeft,\n String.prototype.trimRight,\n String.prototype.trimStart,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter((f) => typeof f === \"function\"),\n)\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n])\n\n/** @type {ReadonlyArray]>} */\nconst getterAllowed = [\n [Map, new Set([\"size\"])],\n [\n RegExp,\n new Set([\n \"dotAll\",\n \"flags\",\n \"global\",\n \"hasIndices\",\n \"ignoreCase\",\n \"multiline\",\n \"source\",\n \"sticky\",\n \"unicode\",\n ]),\n ],\n [Set, new Set([\"size\"])],\n]\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name)\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x)\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name)\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = []\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i]\n\n if (elementNode == null) {\n valueList.length = i + 1\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope)\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value)\n } else {\n const element = getStaticValueR(elementNode, initialScope)\n if (element == null) {\n return null\n }\n valueList.push(element.value)\n }\n }\n\n return valueList\n}\n\n/**\n * Returns whether the given variable is never written to after initialization.\n * @param {import(\"eslint\").Scope.Variable} variable\n * @returns {boolean}\n */\nfunction isEffectivelyConst(variable) {\n const refs = variable.references\n\n const inits = refs.filter((r) => r.init).length\n const reads = refs.filter((r) => r.isReadOnly()).length\n if (inits === 1 && reads + inits === refs.length) {\n // there is only one init and all other references only read\n return true\n }\n return false\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope)\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope)\n const right = getStaticValueR(node.right, initialScope)\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: left.value ** right.value }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee\n const args = getElementValues(node.arguments, initialScope)\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n if (calleeNode.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(calleeNode.object, initialScope)\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(\n calleeNode,\n initialScope,\n )\n\n if (property != null) {\n const receiver = object.value\n const methodName = property.value\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope)\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope)\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node)\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0]\n if (\n def.parent &&\n def.type === \"Variable\" &&\n (def.parent.kind === \"const\" ||\n isEffectivelyConst(variable)) &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope)\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope)\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(node.object, initialScope)\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(node, initialScope)\n\n if (property != null) {\n if (!isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n\n for (const [classFn, allowed] of getterAllowed) {\n if (\n object.value instanceof classFn &&\n allowed.has(property.value)\n ) {\n return { value: object.value[property.value] }\n }\n }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope)\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope)\n const args = getElementValues(node.arguments, initialScope)\n\n if (callee != null && args != null) {\n const Func = callee.value\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {}\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = getStaticPropertyNameValue(\n propertyNode,\n initialScope,\n )\n const value = getStaticValueR(propertyNode.value, initialScope)\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope,\n )\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value)\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1]\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope)\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope,\n )\n\n if (tag != null && expressions != null) {\n const func = tag.value\n const strings = node.quasi.quasis.map((q) => q.value.cooked)\n strings.raw = node.quasi.quasis.map((q) => q.value.raw)\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope)\n if (expressions != null) {\n let value = node.quasis[0].value.cooked\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i]\n value += node.quasis[i + 1].value.cooked\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope)\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the static value of property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.\n */\nfunction getStaticPropertyNameValue(node, initialScope) {\n const nameNode = node.type === \"Property\" ? node.key : node.property\n\n if (node.computed) {\n return getStaticValueR(nameNode, initialScope)\n }\n\n if (nameNode.type === \"Identifier\") {\n return { value: nameNode.name }\n }\n\n if (nameNode.type === \"Literal\") {\n if (nameNode.bigint) {\n return { value: nameNode.bigint }\n }\n return { value: String(nameNode.value) }\n }\n\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n","import { getStaticValue } from \"./get-static-value.mjs\"\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope)\n return evaluated && String(evaluated.value)\n}\n","import { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n case \"PropertyDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n if (node.key.type === \"PrivateIdentifier\") {\n return null\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n","import { getPropertyName } from \"./get-property-name.mjs\"\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.\n * @returns {string} The name and kind of the function node.\n */\n// eslint-disable-next-line complexity\nexport function getFunctionNameWithKind(node, sourceCode) {\n const parent = node.parent\n const tokens = []\n const isObjectMethod = parent.type === \"Property\" && parent.value === node\n const isClassMethod =\n parent.type === \"MethodDefinition\" && parent.value === node\n const isClassFieldMethod =\n parent.type === \"PropertyDefinition\" && parent.value === node\n\n // Modifiers.\n if (isClassMethod || isClassFieldMethod) {\n if (parent.static) {\n tokens.push(\"static\")\n }\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(\"private\")\n }\n }\n if (node.async) {\n tokens.push(\"async\")\n }\n if (node.generator) {\n tokens.push(\"generator\")\n }\n\n // Kinds.\n if (isObjectMethod || isClassMethod) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\")\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\")\n } else {\n tokens.push(\"method\")\n }\n } else if (isClassFieldMethod) {\n tokens.push(\"method\")\n } else {\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\")\n }\n tokens.push(\"function\")\n }\n\n // Names.\n if (isObjectMethod || isClassMethod || isClassFieldMethod) {\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(`#${parent.key.name}`)\n } else {\n const name = getPropertyName(parent)\n if (name) {\n tokens.push(`'${name}'`)\n } else if (sourceCode) {\n const keyText = sourceCode.getText(parent.key)\n if (!keyText.includes(\"\\n\")) {\n tokens.push(`[${keyText}]`)\n }\n }\n }\n } else if (node.id) {\n tokens.push(`'${node.id.name}'`)\n } else if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`)\n } else if (\n (parent.type === \"AssignmentExpression\" ||\n parent.type === \"AssignmentPattern\") &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`)\n } else if (\n parent.type === \"ExportDefaultDeclaration\" &&\n parent.declaration === node\n ) {\n tokens.push(\"'default'\")\n }\n\n return tokens.join(\" \")\n}\n","import { getKeys, KEYS } from \"eslint-visitor-keys\"\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ]),\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node\n\n for (const key of visitorKeys[type] || getKeys(node)) {\n const value = node[key]\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n PropertyDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n }),\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {},\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || KEYS,\n )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode,\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0\n node = nodeOrSourceCode\n sourceCode = optionalSourceCode\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1\n node = timesOrNode\n sourceCode = nodeOrSourceCode\n }\n\n if (\n node == null ||\n // `Program` can't be parenthesized\n node.parent == null ||\n // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`\n (node.parent.type === \"CatchClause\" && node.parent.param === node)\n ) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = []\n let index = 0\n\n /** @type {RegExpExecArray} */\n let match = null\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1)\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(replacement.replace(placeholder, replacer))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = []\n let index = 0\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(String(replace(...match, match.index, match.input)))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n })\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this)\n let match = null\n let lastIndex = 0\n\n pattern.lastIndex = 0\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex\n yield match\n pattern.lastIndex = lastIndex\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str)\n const ret = it.next()\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\nconst has = Function.call.bind(Object.hasOwnProperty)\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some((r) => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {},\n ) {\n this.variableStack = []\n this.globalScope = globalScope\n this.mode = mode\n this.globalObjectNames = globalObjectNames.slice(0)\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key]\n const path = [key]\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true,\n )\n }\n\n for (const key of this.globalObjectNames) {\n const path = []\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n )\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0])\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key]\n const path = [key]\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap)\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId]\n const path = [moduleId]\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] }\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key]\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n }\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM)\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? { default: nextTraceMap, ...nextTraceMap }\n : { default: nextTraceMap },\n )\n\n if (esm) {\n yield* it\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault)\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable)\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] }\n }\n yield* this._iteratePropertyReferences(node, path, traceMap)\n }\n } finally {\n this.variableStack.pop()\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode\n while (isPassThrough(node)) {\n node = node.parent\n }\n\n const parent = node.parent\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent)\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap,\n )\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n }\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n yield* this._iteratePropertyReferences(parent, path, traceMap)\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap)\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode)\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n )\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property)\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key)\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap,\n )\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false,\n )\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false,\n )\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n }\n }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location.mjs\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind.mjs\"\nimport { getInnermostScope } from \"./get-innermost-scope.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStaticValue } from \"./get-static-value.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\nimport { hasSideEffect } from \"./has-side-effect.mjs\"\nimport { isParenthesized } from \"./is-parenthesized.mjs\"\nimport { PatternMatcher } from \"./pattern-matcher.mjs\"\nimport {\n CALL,\n CONSTRUCT,\n ESM,\n READ,\n ReferenceTracker,\n} from \"./reference-tracker.mjs\"\nimport {\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isSemicolonToken,\n} from \"./token-predicate.mjs\"\n\nexport default {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\nexport {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\n"],"names":["getKeys","KEYS"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@eslint-community/eslint-utils/index.mjs b/node_modules/@eslint-community/eslint-utils/index.mjs new file mode 100644 index 0000000..b96d3c9 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/index.mjs @@ -0,0 +1,2018 @@ +import { getKeys, KEYS } from 'eslint-visitor-keys'; + +/** + * Get the innermost scope which contains a given location. + * @param {Scope} initialScope The initial scope to search. + * @param {Node} node The location to search. + * @returns {Scope} The innermost scope. + */ +function getInnermostScope(initialScope, node) { + const location = node.range[0]; + + let scope = initialScope; + let found = false; + do { + found = false; + for (const childScope of scope.childScopes) { + const range = childScope.block.range; + + if (range[0] <= location && location < range[1]) { + scope = childScope; + found = true; + break + } + } + } while (found) + + return scope +} + +/** + * Find the variable of a given name. + * @param {Scope} initialScope The scope to start finding. + * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node. + * @returns {Variable|null} The found variable or null. + */ +function findVariable(initialScope, nameOrNode) { + let name = ""; + let scope = initialScope; + + if (typeof nameOrNode === "string") { + name = nameOrNode; + } else { + name = nameOrNode.name; + scope = getInnermostScope(scope, nameOrNode); + } + + while (scope != null) { + const variable = scope.set.get(name); + if (variable != null) { + return variable + } + scope = scope.upper; + } + + return null +} + +/** + * Creates the negate function of the given function. + * @param {function(Token):boolean} f - The function to negate. + * @returns {function(Token):boolean} Negated function. + */ +function negate(f) { + return (token) => !f(token) +} + +/** + * Checks if the given token is a PunctuatorToken with the given value + * @param {Token} token - The token to check. + * @param {string} value - The value to check. + * @returns {boolean} `true` if the token is a PunctuatorToken with the given value. + */ +function isPunctuatorTokenWithValue(token, value) { + return token.type === "Punctuator" && token.value === value +} + +/** + * Checks if the given token is an arrow token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an arrow token. + */ +function isArrowToken(token) { + return isPunctuatorTokenWithValue(token, "=>") +} + +/** + * Checks if the given token is a comma token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comma token. + */ +function isCommaToken(token) { + return isPunctuatorTokenWithValue(token, ",") +} + +/** + * Checks if the given token is a semicolon token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a semicolon token. + */ +function isSemicolonToken(token) { + return isPunctuatorTokenWithValue(token, ";") +} + +/** + * Checks if the given token is a colon token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a colon token. + */ +function isColonToken(token) { + return isPunctuatorTokenWithValue(token, ":") +} + +/** + * Checks if the given token is an opening parenthesis token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening parenthesis token. + */ +function isOpeningParenToken(token) { + return isPunctuatorTokenWithValue(token, "(") +} + +/** + * Checks if the given token is a closing parenthesis token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing parenthesis token. + */ +function isClosingParenToken(token) { + return isPunctuatorTokenWithValue(token, ")") +} + +/** + * Checks if the given token is an opening square bracket token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening square bracket token. + */ +function isOpeningBracketToken(token) { + return isPunctuatorTokenWithValue(token, "[") +} + +/** + * Checks if the given token is a closing square bracket token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing square bracket token. + */ +function isClosingBracketToken(token) { + return isPunctuatorTokenWithValue(token, "]") +} + +/** + * Checks if the given token is an opening brace token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening brace token. + */ +function isOpeningBraceToken(token) { + return isPunctuatorTokenWithValue(token, "{") +} + +/** + * Checks if the given token is a closing brace token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing brace token. + */ +function isClosingBraceToken(token) { + return isPunctuatorTokenWithValue(token, "}") +} + +/** + * Checks if the given token is a comment token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +function isCommentToken(token) { + return ["Block", "Line", "Shebang"].includes(token.type) +} + +const isNotArrowToken = negate(isArrowToken); +const isNotCommaToken = negate(isCommaToken); +const isNotSemicolonToken = negate(isSemicolonToken); +const isNotColonToken = negate(isColonToken); +const isNotOpeningParenToken = negate(isOpeningParenToken); +const isNotClosingParenToken = negate(isClosingParenToken); +const isNotOpeningBracketToken = negate(isOpeningBracketToken); +const isNotClosingBracketToken = negate(isClosingBracketToken); +const isNotOpeningBraceToken = negate(isOpeningBraceToken); +const isNotClosingBraceToken = negate(isClosingBraceToken); +const isNotCommentToken = negate(isCommentToken); + +/** + * Get the `(` token of the given function node. + * @param {Node} node - The function node to get. + * @param {SourceCode} sourceCode - The source code object to get tokens. + * @returns {Token} `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + return node.id + ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) + : sourceCode.getFirstToken(node, isOpeningParenToken) +} + +/** + * Get the location of the given function node for reporting. + * @param {Node} node - The function node to get. + * @param {SourceCode} sourceCode - The source code object to get tokens. + * @returns {string} The location of the function node for reporting. + */ +function getFunctionHeadLocation(node, sourceCode) { + const parent = node.parent; + let start = null; + let end = null; + + if (node.type === "ArrowFunctionExpression") { + const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); + + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } else if ( + parent.type === "Property" || + parent.type === "MethodDefinition" || + parent.type === "PropertyDefinition" + ) { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + + return { + start: { ...start }, + end: { ...end }, + } +} + +/* globals globalThis, global, self, window */ + +const globalObject = + typeof globalThis !== "undefined" + ? globalThis + : typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : typeof global !== "undefined" + ? global + : {}; + +const builtinNames = Object.freeze( + new Set([ + "Array", + "ArrayBuffer", + "BigInt", + "BigInt64Array", + "BigUint64Array", + "Boolean", + "DataView", + "Date", + "decodeURI", + "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + "escape", + "Float32Array", + "Float64Array", + "Function", + "Infinity", + "Int16Array", + "Int32Array", + "Int8Array", + "isFinite", + "isNaN", + "isPrototypeOf", + "JSON", + "Map", + "Math", + "NaN", + "Number", + "Object", + "parseFloat", + "parseInt", + "Promise", + "Proxy", + "Reflect", + "RegExp", + "Set", + "String", + "Symbol", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray", + "undefined", + "unescape", + "WeakMap", + "WeakSet", + ]), +); +const callAllowed = new Set( + [ + Array.isArray, + Array.of, + Array.prototype.at, + Array.prototype.concat, + Array.prototype.entries, + Array.prototype.every, + Array.prototype.filter, + Array.prototype.find, + Array.prototype.findIndex, + Array.prototype.flat, + Array.prototype.includes, + Array.prototype.indexOf, + Array.prototype.join, + Array.prototype.keys, + Array.prototype.lastIndexOf, + Array.prototype.slice, + Array.prototype.some, + Array.prototype.toString, + Array.prototype.values, + typeof BigInt === "function" ? BigInt : undefined, + Boolean, + Date, + Date.parse, + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, + escape, + isFinite, + isNaN, + isPrototypeOf, + Map, + Map.prototype.entries, + Map.prototype.get, + Map.prototype.has, + Map.prototype.keys, + Map.prototype.values, + ...Object.getOwnPropertyNames(Math) + .filter((k) => k !== "random") + .map((k) => Math[k]) + .filter((f) => typeof f === "function"), + Number, + Number.isFinite, + Number.isNaN, + Number.parseFloat, + Number.parseInt, + Number.prototype.toExponential, + Number.prototype.toFixed, + Number.prototype.toPrecision, + Number.prototype.toString, + Object, + Object.entries, + Object.is, + Object.isExtensible, + Object.isFrozen, + Object.isSealed, + Object.keys, + Object.values, + parseFloat, + parseInt, + RegExp, + Set, + Set.prototype.entries, + Set.prototype.has, + Set.prototype.keys, + Set.prototype.values, + String, + String.fromCharCode, + String.fromCodePoint, + String.raw, + String.prototype.at, + String.prototype.charAt, + String.prototype.charCodeAt, + String.prototype.codePointAt, + String.prototype.concat, + String.prototype.endsWith, + String.prototype.includes, + String.prototype.indexOf, + String.prototype.lastIndexOf, + String.prototype.normalize, + String.prototype.padEnd, + String.prototype.padStart, + String.prototype.slice, + String.prototype.startsWith, + String.prototype.substr, + String.prototype.substring, + String.prototype.toLowerCase, + String.prototype.toString, + String.prototype.toUpperCase, + String.prototype.trim, + String.prototype.trimEnd, + String.prototype.trimLeft, + String.prototype.trimRight, + String.prototype.trimStart, + Symbol.for, + Symbol.keyFor, + unescape, + ].filter((f) => typeof f === "function"), +); +const callPassThrough = new Set([ + Object.freeze, + Object.preventExtensions, + Object.seal, +]); + +/** @type {ReadonlyArray]>} */ +const getterAllowed = [ + [Map, new Set(["size"])], + [ + RegExp, + new Set([ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "multiline", + "source", + "sticky", + "unicode", + ]), + ], + [Set, new Set(["size"])], +]; + +/** + * Get the property descriptor. + * @param {object} object The object to get. + * @param {string|number|symbol} name The property name to get. + */ +function getPropertyDescriptor(object, name) { + let x = object; + while ((typeof x === "object" || typeof x === "function") && x !== null) { + const d = Object.getOwnPropertyDescriptor(x, name); + if (d) { + return d + } + x = Object.getPrototypeOf(x); + } + return null +} + +/** + * Check if a property is getter or not. + * @param {object} object The object to check. + * @param {string|number|symbol} name The property name to check. + */ +function isGetter(object, name) { + const d = getPropertyDescriptor(object, name); + return d != null && d.get != null +} + +/** + * Get the element values of a given node list. + * @param {Node[]} nodeList The node list to get values. + * @param {Scope|undefined} initialScope The initial scope to find variables. + * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null. + */ +function getElementValues(nodeList, initialScope) { + const valueList = []; + + for (let i = 0; i < nodeList.length; ++i) { + const elementNode = nodeList[i]; + + if (elementNode == null) { + valueList.length = i + 1; + } else if (elementNode.type === "SpreadElement") { + const argument = getStaticValueR(elementNode.argument, initialScope); + if (argument == null) { + return null + } + valueList.push(...argument.value); + } else { + const element = getStaticValueR(elementNode, initialScope); + if (element == null) { + return null + } + valueList.push(element.value); + } + } + + return valueList +} + +/** + * Returns whether the given variable is never written to after initialization. + * @param {import("eslint").Scope.Variable} variable + * @returns {boolean} + */ +function isEffectivelyConst(variable) { + const refs = variable.references; + + const inits = refs.filter((r) => r.init).length; + const reads = refs.filter((r) => r.isReadOnly()).length; + if (inits === 1 && reads + inits === refs.length) { + // there is only one init and all other references only read + return true + } + return false +} + +const operations = Object.freeze({ + ArrayExpression(node, initialScope) { + const elements = getElementValues(node.elements, initialScope); + return elements != null ? { value: elements } : null + }, + + AssignmentExpression(node, initialScope) { + if (node.operator === "=") { + return getStaticValueR(node.right, initialScope) + } + return null + }, + + //eslint-disable-next-line complexity + BinaryExpression(node, initialScope) { + if (node.operator === "in" || node.operator === "instanceof") { + // Not supported. + return null + } + + const left = getStaticValueR(node.left, initialScope); + const right = getStaticValueR(node.right, initialScope); + if (left != null && right != null) { + switch (node.operator) { + case "==": + return { value: left.value == right.value } //eslint-disable-line eqeqeq + case "!=": + return { value: left.value != right.value } //eslint-disable-line eqeqeq + case "===": + return { value: left.value === right.value } + case "!==": + return { value: left.value !== right.value } + case "<": + return { value: left.value < right.value } + case "<=": + return { value: left.value <= right.value } + case ">": + return { value: left.value > right.value } + case ">=": + return { value: left.value >= right.value } + case "<<": + return { value: left.value << right.value } + case ">>": + return { value: left.value >> right.value } + case ">>>": + return { value: left.value >>> right.value } + case "+": + return { value: left.value + right.value } + case "-": + return { value: left.value - right.value } + case "*": + return { value: left.value * right.value } + case "/": + return { value: left.value / right.value } + case "%": + return { value: left.value % right.value } + case "**": + return { value: left.value ** right.value } + case "|": + return { value: left.value | right.value } + case "^": + return { value: left.value ^ right.value } + case "&": + return { value: left.value & right.value } + + // no default + } + } + + return null + }, + + CallExpression(node, initialScope) { + const calleeNode = node.callee; + const args = getElementValues(node.arguments, initialScope); + + if (args != null) { + if (calleeNode.type === "MemberExpression") { + if (calleeNode.property.type === "PrivateIdentifier") { + return null + } + const object = getStaticValueR(calleeNode.object, initialScope); + if (object != null) { + if ( + object.value == null && + (object.optional || node.optional) + ) { + return { value: undefined, optional: true } + } + const property = getStaticPropertyNameValue( + calleeNode, + initialScope, + ); + + if (property != null) { + const receiver = object.value; + const methodName = property.value; + if (callAllowed.has(receiver[methodName])) { + return { value: receiver[methodName](...args) } + } + if (callPassThrough.has(receiver[methodName])) { + return { value: args[0] } + } + } + } + } else { + const callee = getStaticValueR(calleeNode, initialScope); + if (callee != null) { + if (callee.value == null && node.optional) { + return { value: undefined, optional: true } + } + const func = callee.value; + if (callAllowed.has(func)) { + return { value: func(...args) } + } + if (callPassThrough.has(func)) { + return { value: args[0] } + } + } + } + } + + return null + }, + + ConditionalExpression(node, initialScope) { + const test = getStaticValueR(node.test, initialScope); + if (test != null) { + return test.value + ? getStaticValueR(node.consequent, initialScope) + : getStaticValueR(node.alternate, initialScope) + } + return null + }, + + ExpressionStatement(node, initialScope) { + return getStaticValueR(node.expression, initialScope) + }, + + Identifier(node, initialScope) { + if (initialScope != null) { + const variable = findVariable(initialScope, node); + + // Built-in globals. + if ( + variable != null && + variable.defs.length === 0 && + builtinNames.has(variable.name) && + variable.name in globalObject + ) { + return { value: globalObject[variable.name] } + } + + // Constants. + if (variable != null && variable.defs.length === 1) { + const def = variable.defs[0]; + if ( + def.parent && + def.type === "Variable" && + (def.parent.kind === "const" || + isEffectivelyConst(variable)) && + // TODO(mysticatea): don't support destructuring here. + def.node.id.type === "Identifier" + ) { + return getStaticValueR(def.node.init, initialScope) + } + } + } + return null + }, + + Literal(node) { + //istanbul ignore if : this is implementation-specific behavior. + if ((node.regex != null || node.bigint != null) && node.value == null) { + // It was a RegExp/BigInt literal, but Node.js didn't support it. + return null + } + return { value: node.value } + }, + + LogicalExpression(node, initialScope) { + const left = getStaticValueR(node.left, initialScope); + if (left != null) { + if ( + (node.operator === "||" && Boolean(left.value) === true) || + (node.operator === "&&" && Boolean(left.value) === false) || + (node.operator === "??" && left.value != null) + ) { + return left + } + + const right = getStaticValueR(node.right, initialScope); + if (right != null) { + return right + } + } + + return null + }, + + MemberExpression(node, initialScope) { + if (node.property.type === "PrivateIdentifier") { + return null + } + const object = getStaticValueR(node.object, initialScope); + if (object != null) { + if (object.value == null && (object.optional || node.optional)) { + return { value: undefined, optional: true } + } + const property = getStaticPropertyNameValue(node, initialScope); + + if (property != null) { + if (!isGetter(object.value, property.value)) { + return { value: object.value[property.value] } + } + + for (const [classFn, allowed] of getterAllowed) { + if ( + object.value instanceof classFn && + allowed.has(property.value) + ) { + return { value: object.value[property.value] } + } + } + } + } + return null + }, + + ChainExpression(node, initialScope) { + const expression = getStaticValueR(node.expression, initialScope); + if (expression != null) { + return { value: expression.value } + } + return null + }, + + NewExpression(node, initialScope) { + const callee = getStaticValueR(node.callee, initialScope); + const args = getElementValues(node.arguments, initialScope); + + if (callee != null && args != null) { + const Func = callee.value; + if (callAllowed.has(Func)) { + return { value: new Func(...args) } + } + } + + return null + }, + + ObjectExpression(node, initialScope) { + const object = {}; + + for (const propertyNode of node.properties) { + if (propertyNode.type === "Property") { + if (propertyNode.kind !== "init") { + return null + } + const key = getStaticPropertyNameValue( + propertyNode, + initialScope, + ); + const value = getStaticValueR(propertyNode.value, initialScope); + if (key == null || value == null) { + return null + } + object[key.value] = value.value; + } else if ( + propertyNode.type === "SpreadElement" || + propertyNode.type === "ExperimentalSpreadProperty" + ) { + const argument = getStaticValueR( + propertyNode.argument, + initialScope, + ); + if (argument == null) { + return null + } + Object.assign(object, argument.value); + } else { + return null + } + } + + return { value: object } + }, + + SequenceExpression(node, initialScope) { + const last = node.expressions[node.expressions.length - 1]; + return getStaticValueR(last, initialScope) + }, + + TaggedTemplateExpression(node, initialScope) { + const tag = getStaticValueR(node.tag, initialScope); + const expressions = getElementValues( + node.quasi.expressions, + initialScope, + ); + + if (tag != null && expressions != null) { + const func = tag.value; + const strings = node.quasi.quasis.map((q) => q.value.cooked); + strings.raw = node.quasi.quasis.map((q) => q.value.raw); + + if (func === String.raw) { + return { value: func(strings, ...expressions) } + } + } + + return null + }, + + TemplateLiteral(node, initialScope) { + const expressions = getElementValues(node.expressions, initialScope); + if (expressions != null) { + let value = node.quasis[0].value.cooked; + for (let i = 0; i < expressions.length; ++i) { + value += expressions[i]; + value += node.quasis[i + 1].value.cooked; + } + return { value } + } + return null + }, + + UnaryExpression(node, initialScope) { + if (node.operator === "delete") { + // Not supported. + return null + } + if (node.operator === "void") { + return { value: undefined } + } + + const arg = getStaticValueR(node.argument, initialScope); + if (arg != null) { + switch (node.operator) { + case "-": + return { value: -arg.value } + case "+": + return { value: +arg.value } //eslint-disable-line no-implicit-coercion + case "!": + return { value: !arg.value } + case "~": + return { value: ~arg.value } + case "typeof": + return { value: typeof arg.value } + + // no default + } + } + + return null + }, +}); + +/** + * Get the value of a given node if it's a static value. + * @param {Node} node The node to get. + * @param {Scope|undefined} initialScope The scope to start finding variable. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. + */ +function getStaticValueR(node, initialScope) { + if (node != null && Object.hasOwnProperty.call(operations, node.type)) { + return operations[node.type](node, initialScope) + } + return null +} + +/** + * Get the static value of property name from a MemberExpression node or a Property node. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`. + */ +function getStaticPropertyNameValue(node, initialScope) { + const nameNode = node.type === "Property" ? node.key : node.property; + + if (node.computed) { + return getStaticValueR(nameNode, initialScope) + } + + if (nameNode.type === "Identifier") { + return { value: nameNode.name } + } + + if (nameNode.type === "Literal") { + if (nameNode.bigint) { + return { value: nameNode.bigint } + } + return { value: String(nameNode.value) } + } + + return null +} + +/** + * Get the value of a given node if it's a static value. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. + */ +function getStaticValue(node, initialScope = null) { + try { + return getStaticValueR(node, initialScope) + } catch (_error) { + return null + } +} + +/** + * Get the value of a given node if it's a literal or a template literal. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant. + * @returns {string|null} The value of the node, or `null`. + */ +function getStringIfConstant(node, initialScope = null) { + // Handle the literals that the platform doesn't support natively. + if (node && node.type === "Literal" && node.value === null) { + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}` + } + if (node.bigint) { + return node.bigint + } + } + + const evaluated = getStaticValue(node, initialScope); + return evaluated && String(evaluated.value) +} + +/** + * Get the property name from a MemberExpression node or a Property node. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it. + * @returns {string|null} The property name of the node. + */ +function getPropertyName(node, initialScope) { + switch (node.type) { + case "MemberExpression": + if (node.computed) { + return getStringIfConstant(node.property, initialScope) + } + if (node.property.type === "PrivateIdentifier") { + return null + } + return node.property.name + + case "Property": + case "MethodDefinition": + case "PropertyDefinition": + if (node.computed) { + return getStringIfConstant(node.key, initialScope) + } + if (node.key.type === "Literal") { + return String(node.key.value) + } + if (node.key.type === "PrivateIdentifier") { + return null + } + return node.key.name + + // no default + } + + return null +} + +/** + * Get the name and kind of the given function node. + * @param {ASTNode} node - The function node to get. + * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys. + * @returns {string} The name and kind of the function node. + */ +// eslint-disable-next-line complexity +function getFunctionNameWithKind(node, sourceCode) { + const parent = node.parent; + const tokens = []; + const isObjectMethod = parent.type === "Property" && parent.value === node; + const isClassMethod = + parent.type === "MethodDefinition" && parent.value === node; + const isClassFieldMethod = + parent.type === "PropertyDefinition" && parent.value === node; + + // Modifiers. + if (isClassMethod || isClassFieldMethod) { + if (parent.static) { + tokens.push("static"); + } + if (parent.key.type === "PrivateIdentifier") { + tokens.push("private"); + } + } + if (node.async) { + tokens.push("async"); + } + if (node.generator) { + tokens.push("generator"); + } + + // Kinds. + if (isObjectMethod || isClassMethod) { + if (parent.kind === "constructor") { + return "constructor" + } + if (parent.kind === "get") { + tokens.push("getter"); + } else if (parent.kind === "set") { + tokens.push("setter"); + } else { + tokens.push("method"); + } + } else if (isClassFieldMethod) { + tokens.push("method"); + } else { + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow"); + } + tokens.push("function"); + } + + // Names. + if (isObjectMethod || isClassMethod || isClassFieldMethod) { + if (parent.key.type === "PrivateIdentifier") { + tokens.push(`#${parent.key.name}`); + } else { + const name = getPropertyName(parent); + if (name) { + tokens.push(`'${name}'`); + } else if (sourceCode) { + const keyText = sourceCode.getText(parent.key); + if (!keyText.includes("\n")) { + tokens.push(`[${keyText}]`); + } + } + } + } else if (node.id) { + tokens.push(`'${node.id.name}'`); + } else if ( + parent.type === "VariableDeclarator" && + parent.id && + parent.id.type === "Identifier" + ) { + tokens.push(`'${parent.id.name}'`); + } else if ( + (parent.type === "AssignmentExpression" || + parent.type === "AssignmentPattern") && + parent.left && + parent.left.type === "Identifier" + ) { + tokens.push(`'${parent.left.name}'`); + } else if ( + parent.type === "ExportDefaultDeclaration" && + parent.declaration === node + ) { + tokens.push("'default'"); + } + + return tokens.join(" ") +} + +const typeConversionBinaryOps = Object.freeze( + new Set([ + "==", + "!=", + "<", + "<=", + ">", + ">=", + "<<", + ">>", + ">>>", + "+", + "-", + "*", + "/", + "%", + "|", + "^", + "&", + "in", + ]), +); +const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"])); + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string" +} + +const visitor = Object.freeze( + Object.assign(Object.create(null), { + $visit(node, options, visitorKeys) { + const { type } = node; + + if (typeof this[type] === "function") { + return this[type](node, options, visitorKeys) + } + + return this.$visitChildren(node, options, visitorKeys) + }, + + $visitChildren(node, options, visitorKeys) { + const { type } = node; + + for (const key of visitorKeys[type] || getKeys(node)) { + const value = node[key]; + + if (Array.isArray(value)) { + for (const element of value) { + if ( + isNode(element) && + this.$visit(element, options, visitorKeys) + ) { + return true + } + } + } else if ( + isNode(value) && + this.$visit(value, options, visitorKeys) + ) { + return true + } + } + + return false + }, + + ArrowFunctionExpression() { + return false + }, + AssignmentExpression() { + return true + }, + AwaitExpression() { + return true + }, + BinaryExpression(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + typeConversionBinaryOps.has(node.operator) && + (node.left.type !== "Literal" || node.right.type !== "Literal") + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + CallExpression() { + return true + }, + FunctionExpression() { + return false + }, + ImportExpression() { + return true + }, + MemberExpression(node, options, visitorKeys) { + if (options.considerGetters) { + return true + } + if ( + options.considerImplicitTypeConversion && + node.computed && + node.property.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + MethodDefinition(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + NewExpression() { + return true + }, + Property(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + PropertyDefinition(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + UnaryExpression(node, options, visitorKeys) { + if (node.operator === "delete") { + return true + } + if ( + options.considerImplicitTypeConversion && + typeConversionUnaryOps.has(node.operator) && + node.argument.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + UpdateExpression() { + return true + }, + YieldExpression() { + return true + }, + }), +); + +/** + * Check whether a given node has any side effect or not. + * @param {Node} node The node to get. + * @param {SourceCode} sourceCode The source code object. + * @param {object} [options] The option object. + * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects. + * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects. + * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`. + * @returns {boolean} `true` if the node has a certain side effect. + */ +function hasSideEffect( + node, + sourceCode, + { considerGetters = false, considerImplicitTypeConversion = false } = {}, +) { + return visitor.$visit( + node, + { considerGetters, considerImplicitTypeConversion }, + sourceCode.visitorKeys || KEYS, + ) +} + +/** + * Get the left parenthesis of the parent node syntax if it exists. + * E.g., `if (a) {}` then the `(`. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token|null} The left parenthesis of the parent node syntax + */ +function getParentSyntaxParen(node, sourceCode) { + const parent = node.parent; + + switch (parent.type) { + case "CallExpression": + case "NewExpression": + if (parent.arguments.length === 1 && parent.arguments[0] === node) { + return sourceCode.getTokenAfter( + parent.callee, + isOpeningParenToken, + ) + } + return null + + case "DoWhileStatement": + if (parent.test === node) { + return sourceCode.getTokenAfter( + parent.body, + isOpeningParenToken, + ) + } + return null + + case "IfStatement": + case "WhileStatement": + if (parent.test === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "ImportExpression": + if (parent.source === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "SwitchStatement": + if (parent.discriminant === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "WithStatement": + if (parent.object === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + default: + return null + } +} + +/** + * Check whether a given node is parenthesized or not. + * @param {number} times The number of parantheses. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is parenthesized the given times. + */ +/** + * Check whether a given node is parenthesized or not. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is parenthesized. + */ +function isParenthesized( + timesOrNode, + nodeOrSourceCode, + optionalSourceCode, +) { + let times, node, sourceCode, maybeLeftParen, maybeRightParen; + if (typeof timesOrNode === "number") { + times = timesOrNode | 0; + node = nodeOrSourceCode; + sourceCode = optionalSourceCode; + if (!(times >= 1)) { + throw new TypeError("'times' should be a positive integer.") + } + } else { + times = 1; + node = timesOrNode; + sourceCode = nodeOrSourceCode; + } + + if ( + node == null || + // `Program` can't be parenthesized + node.parent == null || + // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}` + (node.parent.type === "CatchClause" && node.parent.param === node) + ) { + return false + } + + maybeLeftParen = maybeRightParen = node; + do { + maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen); + maybeRightParen = sourceCode.getTokenAfter(maybeRightParen); + } while ( + maybeLeftParen != null && + maybeRightParen != null && + isOpeningParenToken(maybeLeftParen) && + isClosingParenToken(maybeRightParen) && + // Avoid false positive such as `if (a) {}` + maybeLeftParen !== getParentSyntaxParen(node, sourceCode) && + --times > 0 + ) + + return times === 0 +} + +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ + +const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu; + +/** @type {WeakMap} */ +const internal = new WeakMap(); + +/** + * Check whether a given character is escaped or not. + * @param {string} str The string to check. + * @param {number} index The location of the character to check. + * @returns {boolean} `true` if the character is escaped. + */ +function isEscaped(str, index) { + let escaped = false; + for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) { + escaped = !escaped; + } + return escaped +} + +/** + * Replace a given string by a given matcher. + * @param {PatternMatcher} matcher The pattern matcher. + * @param {string} str The string to be replaced. + * @param {string} replacement The new substring to replace each matched part. + * @returns {string} The replaced string. + */ +function replaceS(matcher, str, replacement) { + const chunks = []; + let index = 0; + + /** @type {RegExpExecArray} */ + let match = null; + + /** + * @param {string} key The placeholder. + * @returns {string} The replaced string. + */ + function replacer(key) { + switch (key) { + case "$$": + return "$" + case "$&": + return match[0] + case "$`": + return str.slice(0, match.index) + case "$'": + return str.slice(match.index + match[0].length) + default: { + const i = key.slice(1); + if (i in match) { + return match[i] + } + return key + } + } + } + + for (match of matcher.execAll(str)) { + chunks.push(str.slice(index, match.index)); + chunks.push(replacement.replace(placeholder, replacer)); + index = match.index + match[0].length; + } + chunks.push(str.slice(index)); + + return chunks.join("") +} + +/** + * Replace a given string by a given matcher. + * @param {PatternMatcher} matcher The pattern matcher. + * @param {string} str The string to be replaced. + * @param {(...strs[])=>string} replace The function to replace each matched part. + * @returns {string} The replaced string. + */ +function replaceF(matcher, str, replace) { + const chunks = []; + let index = 0; + + for (const match of matcher.execAll(str)) { + chunks.push(str.slice(index, match.index)); + chunks.push(String(replace(...match, match.index, match.input))); + index = match.index + match[0].length; + } + chunks.push(str.slice(index)); + + return chunks.join("") +} + +/** + * The class to find patterns as considering escape sequences. + */ +class PatternMatcher { + /** + * Initialize this matcher. + * @param {RegExp} pattern The pattern to match. + * @param {{escaped:boolean}} options The options. + */ + constructor(pattern, { escaped = false } = {}) { + if (!(pattern instanceof RegExp)) { + throw new TypeError("'pattern' should be a RegExp instance.") + } + if (!pattern.flags.includes("g")) { + throw new Error("'pattern' should contains 'g' flag.") + } + + internal.set(this, { + pattern: new RegExp(pattern.source, pattern.flags), + escaped: Boolean(escaped), + }); + } + + /** + * Find the pattern in a given string. + * @param {string} str The string to find. + * @returns {IterableIterator} The iterator which iterate the matched information. + */ + *execAll(str) { + const { pattern, escaped } = internal.get(this); + let match = null; + let lastIndex = 0; + + pattern.lastIndex = 0; + while ((match = pattern.exec(str)) != null) { + if (escaped || !isEscaped(str, match.index)) { + lastIndex = pattern.lastIndex; + yield match; + pattern.lastIndex = lastIndex; + } + } + } + + /** + * Check whether the pattern is found in a given string. + * @param {string} str The string to check. + * @returns {boolean} `true` if the pattern was found in the string. + */ + test(str) { + const it = this.execAll(str); + const ret = it.next(); + return !ret.done + } + + /** + * Replace a given string. + * @param {string} str The string to be replaced. + * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`. + * @returns {string} The replaced string. + */ + [Symbol.replace](str, replacer) { + return typeof replacer === "function" + ? replaceF(this, String(str), replacer) + : replaceS(this, String(str), String(replacer)) + } +} + +const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u; +const has = Function.call.bind(Object.hasOwnProperty); + +const READ = Symbol("read"); +const CALL = Symbol("call"); +const CONSTRUCT = Symbol("construct"); +const ESM = Symbol("esm"); + +const requireCall = { require: { [CALL]: true } }; + +/** + * Check whether a given variable is modified or not. + * @param {Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is modified. + */ +function isModifiedGlobal(variable) { + return ( + variable == null || + variable.defs.length !== 0 || + variable.references.some((r) => r.isWrite()) + ) +} + +/** + * Check if the value of a given node is passed through to the parent syntax as-is. + * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is passed through. + */ +function isPassThrough(node) { + const parent = node.parent; + + switch (parent && parent.type) { + case "ConditionalExpression": + return parent.consequent === node || parent.alternate === node + case "LogicalExpression": + return true + case "SequenceExpression": + return parent.expressions[parent.expressions.length - 1] === node + case "ChainExpression": + return true + + default: + return false + } +} + +/** + * The reference tracker. + */ +class ReferenceTracker { + /** + * Initialize this tracker. + * @param {Scope} globalScope The global scope. + * @param {object} [options] The options. + * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules. + * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object. + */ + constructor( + globalScope, + { + mode = "strict", + globalObjectNames = ["global", "globalThis", "self", "window"], + } = {}, + ) { + this.variableStack = []; + this.globalScope = globalScope; + this.mode = mode; + this.globalObjectNames = globalObjectNames.slice(0); + } + + /** + * Iterate the references of global variables. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateGlobalReferences(traceMap) { + for (const key of Object.keys(traceMap)) { + const nextTraceMap = traceMap[key]; + const path = [key]; + const variable = this.globalScope.set.get(key); + + if (isModifiedGlobal(variable)) { + continue + } + + yield* this._iterateVariableReferences( + variable, + path, + nextTraceMap, + true, + ); + } + + for (const key of this.globalObjectNames) { + const path = []; + const variable = this.globalScope.set.get(key); + + if (isModifiedGlobal(variable)) { + continue + } + + yield* this._iterateVariableReferences( + variable, + path, + traceMap, + false, + ); + } + } + + /** + * Iterate the references of CommonJS modules. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateCjsReferences(traceMap) { + for (const { node } of this.iterateGlobalReferences(requireCall)) { + const key = getStringIfConstant(node.arguments[0]); + if (key == null || !has(traceMap, key)) { + continue + } + + const nextTraceMap = traceMap[key]; + const path = [key]; + + if (nextTraceMap[READ]) { + yield { + node, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iteratePropertyReferences(node, path, nextTraceMap); + } + } + + /** + * Iterate the references of ES modules. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateEsmReferences(traceMap) { + const programNode = this.globalScope.block; + + for (const node of programNode.body) { + if (!IMPORT_TYPE.test(node.type) || node.source == null) { + continue + } + const moduleId = node.source.value; + + if (!has(traceMap, moduleId)) { + continue + } + const nextTraceMap = traceMap[moduleId]; + const path = [moduleId]; + + if (nextTraceMap[READ]) { + yield { node, path, type: READ, info: nextTraceMap[READ] }; + } + + if (node.type === "ExportAllDeclaration") { + for (const key of Object.keys(nextTraceMap)) { + const exportTraceMap = nextTraceMap[key]; + if (exportTraceMap[READ]) { + yield { + node, + path: path.concat(key), + type: READ, + info: exportTraceMap[READ], + }; + } + } + } else { + for (const specifier of node.specifiers) { + const esm = has(nextTraceMap, ESM); + const it = this._iterateImportReferences( + specifier, + path, + esm + ? nextTraceMap + : this.mode === "legacy" + ? { default: nextTraceMap, ...nextTraceMap } + : { default: nextTraceMap }, + ); + + if (esm) { + yield* it; + } else { + for (const report of it) { + report.path = report.path.filter(exceptDefault); + if ( + report.path.length >= 2 || + report.type !== READ + ) { + yield report; + } + } + } + } + } + } + } + + /** + * Iterate the references for a given variable. + * @param {Variable} variable The variable to iterate that references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @param {boolean} shouldReport = The flag to report those references. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateVariableReferences(variable, path, traceMap, shouldReport) { + if (this.variableStack.includes(variable)) { + return + } + this.variableStack.push(variable); + try { + for (const reference of variable.references) { + if (!reference.isRead()) { + continue + } + const node = reference.identifier; + + if (shouldReport && traceMap[READ]) { + yield { node, path, type: READ, info: traceMap[READ] }; + } + yield* this._iteratePropertyReferences(node, path, traceMap); + } + } finally { + this.variableStack.pop(); + } + } + + /** + * Iterate the references for a given AST node. + * @param rootNode The AST node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + //eslint-disable-next-line complexity + *_iteratePropertyReferences(rootNode, path, traceMap) { + let node = rootNode; + while (isPassThrough(node)) { + node = node.parent; + } + + const parent = node.parent; + if (parent.type === "MemberExpression") { + if (parent.object === node) { + const key = getPropertyName(parent); + if (key == null || !has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: parent, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iteratePropertyReferences( + parent, + path, + nextTraceMap, + ); + } + return + } + if (parent.type === "CallExpression") { + if (parent.callee === node && traceMap[CALL]) { + yield { node: parent, path, type: CALL, info: traceMap[CALL] }; + } + return + } + if (parent.type === "NewExpression") { + if (parent.callee === node && traceMap[CONSTRUCT]) { + yield { + node: parent, + path, + type: CONSTRUCT, + info: traceMap[CONSTRUCT], + }; + } + return + } + if (parent.type === "AssignmentExpression") { + if (parent.right === node) { + yield* this._iterateLhsReferences(parent.left, path, traceMap); + yield* this._iteratePropertyReferences(parent, path, traceMap); + } + return + } + if (parent.type === "AssignmentPattern") { + if (parent.right === node) { + yield* this._iterateLhsReferences(parent.left, path, traceMap); + } + return + } + if (parent.type === "VariableDeclarator") { + if (parent.init === node) { + yield* this._iterateLhsReferences(parent.id, path, traceMap); + } + } + } + + /** + * Iterate the references for a given Pattern node. + * @param {Node} patternNode The Pattern node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateLhsReferences(patternNode, path, traceMap) { + if (patternNode.type === "Identifier") { + const variable = findVariable(this.globalScope, patternNode); + if (variable != null) { + yield* this._iterateVariableReferences( + variable, + path, + traceMap, + false, + ); + } + return + } + if (patternNode.type === "ObjectPattern") { + for (const property of patternNode.properties) { + const key = getPropertyName(property); + + if (key == null || !has(traceMap, key)) { + continue + } + + const nextPath = path.concat(key); + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: property, + path: nextPath, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iterateLhsReferences( + property.value, + nextPath, + nextTraceMap, + ); + } + return + } + if (patternNode.type === "AssignmentPattern") { + yield* this._iterateLhsReferences(patternNode.left, path, traceMap); + } + } + + /** + * Iterate the references for a given ModuleSpecifier node. + * @param {Node} specifierNode The ModuleSpecifier node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateImportReferences(specifierNode, path, traceMap) { + const type = specifierNode.type; + + if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") { + const key = + type === "ImportDefaultSpecifier" + ? "default" + : specifierNode.imported.name; + if (!has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: specifierNode, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iterateVariableReferences( + findVariable(this.globalScope, specifierNode.local), + path, + nextTraceMap, + false, + ); + + return + } + + if (type === "ImportNamespaceSpecifier") { + yield* this._iterateVariableReferences( + findVariable(this.globalScope, specifierNode.local), + path, + traceMap, + false, + ); + return + } + + if (type === "ExportSpecifier") { + const key = specifierNode.local.name; + if (!has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: specifierNode, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + } + } +} + +ReferenceTracker.READ = READ; +ReferenceTracker.CALL = CALL; +ReferenceTracker.CONSTRUCT = CONSTRUCT; +ReferenceTracker.ESM = ESM; + +/** + * This is a predicate function for Array#filter. + * @param {string} name A name part. + * @param {number} index The index of the name. + * @returns {boolean} `false` if it's default. + */ +function exceptDefault(name, index) { + return !(index === 1 && name === "default") +} + +var index = { + CALL, + CONSTRUCT, + ESM, + findVariable, + getFunctionHeadLocation, + getFunctionNameWithKind, + getInnermostScope, + getPropertyName, + getStaticValue, + getStringIfConstant, + hasSideEffect, + isArrowToken, + isClosingBraceToken, + isClosingBracketToken, + isClosingParenToken, + isColonToken, + isCommaToken, + isCommentToken, + isNotArrowToken, + isNotClosingBraceToken, + isNotClosingBracketToken, + isNotClosingParenToken, + isNotColonToken, + isNotCommaToken, + isNotCommentToken, + isNotOpeningBraceToken, + isNotOpeningBracketToken, + isNotOpeningParenToken, + isNotSemicolonToken, + isOpeningBraceToken, + isOpeningBracketToken, + isOpeningParenToken, + isParenthesized, + isSemicolonToken, + PatternMatcher, + READ, + ReferenceTracker, +}; + +export { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, index as default, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@eslint-community/eslint-utils/index.mjs.map b/node_modules/@eslint-community/eslint-utils/index.mjs.map new file mode 100644 index 0000000..8b9cf9a --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["src/get-innermost-scope.mjs","src/find-variable.mjs","src/token-predicate.mjs","src/get-function-head-location.mjs","src/get-static-value.mjs","src/get-string-if-constant.mjs","src/get-property-name.mjs","src/get-function-name-with-kind.mjs","src/has-side-effect.mjs","src/is-parenthesized.mjs","src/pattern-matcher.mjs","src/reference-tracker.mjs","src/index.mjs"],"sourcesContent":["/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n const location = node.range[0]\n\n let scope = initialScope\n let found = false\n do {\n found = false\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope\n found = true\n break\n }\n }\n } while (found)\n\n return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope.mjs\"\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n let name = \"\"\n let scope = initialScope\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode\n } else {\n name = nameOrNode.name\n scope = getInnermostScope(scope, nameOrNode)\n }\n\n while (scope != null) {\n const variable = scope.set.get(name)\n if (variable != null) {\n return variable\n }\n scope = scope.upper\n }\n\n return null\n}\n","/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return (token) => !f(token)\n}\n\n/**\n * Checks if the given token is a PunctuatorToken with the given value\n * @param {Token} token - The token to check.\n * @param {string} value - The value to check.\n * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.\n */\nfunction isPunctuatorTokenWithValue(token, value) {\n return token.type === \"Punctuator\" && token.value === value\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n return isPunctuatorTokenWithValue(token, \"=>\")\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n return isPunctuatorTokenWithValue(token, \",\")\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n return isPunctuatorTokenWithValue(token, \";\")\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n return isPunctuatorTokenWithValue(token, \":\")\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n return isPunctuatorTokenWithValue(token, \"(\")\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n return isPunctuatorTokenWithValue(token, \")\")\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"[\")\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"]\")\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"{\")\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"}\")\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n return [\"Block\", \"Line\", \"Shebang\"].includes(token.type)\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent\n let start = null\n let end = null\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken)\n\n start = arrowToken.loc.start\n end = arrowToken.loc.end\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\" ||\n parent.type === \"PropertyDefinition\"\n ) {\n start = parent.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n } else {\n start = node.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n }\n\n return {\n start: { ...start },\n end: { ...end },\n }\n}\n","/* globals globalThis, global, self, window */\n\nimport { findVariable } from \"./find-variable.mjs\"\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {}\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ]),\n)\nconst callAllowed = new Set(\n [\n Array.isArray,\n Array.of,\n Array.prototype.at,\n Array.prototype.concat,\n Array.prototype.entries,\n Array.prototype.every,\n Array.prototype.filter,\n Array.prototype.find,\n Array.prototype.findIndex,\n Array.prototype.flat,\n Array.prototype.includes,\n Array.prototype.indexOf,\n Array.prototype.join,\n Array.prototype.keys,\n Array.prototype.lastIndexOf,\n Array.prototype.slice,\n Array.prototype.some,\n Array.prototype.toString,\n Array.prototype.values,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n Map,\n Map.prototype.entries,\n Map.prototype.get,\n Map.prototype.has,\n Map.prototype.keys,\n Map.prototype.values,\n ...Object.getOwnPropertyNames(Math)\n .filter((k) => k !== \"random\")\n .map((k) => Math[k])\n .filter((f) => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Number.prototype.toExponential,\n Number.prototype.toFixed,\n Number.prototype.toPrecision,\n Number.prototype.toString,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n Set,\n Set.prototype.entries,\n Set.prototype.has,\n Set.prototype.keys,\n Set.prototype.values,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n String.prototype.at,\n String.prototype.charAt,\n String.prototype.charCodeAt,\n String.prototype.codePointAt,\n String.prototype.concat,\n String.prototype.endsWith,\n String.prototype.includes,\n String.prototype.indexOf,\n String.prototype.lastIndexOf,\n String.prototype.normalize,\n String.prototype.padEnd,\n String.prototype.padStart,\n String.prototype.slice,\n String.prototype.startsWith,\n String.prototype.substr,\n String.prototype.substring,\n String.prototype.toLowerCase,\n String.prototype.toString,\n String.prototype.toUpperCase,\n String.prototype.trim,\n String.prototype.trimEnd,\n String.prototype.trimLeft,\n String.prototype.trimRight,\n String.prototype.trimStart,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter((f) => typeof f === \"function\"),\n)\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n])\n\n/** @type {ReadonlyArray]>} */\nconst getterAllowed = [\n [Map, new Set([\"size\"])],\n [\n RegExp,\n new Set([\n \"dotAll\",\n \"flags\",\n \"global\",\n \"hasIndices\",\n \"ignoreCase\",\n \"multiline\",\n \"source\",\n \"sticky\",\n \"unicode\",\n ]),\n ],\n [Set, new Set([\"size\"])],\n]\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name)\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x)\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name)\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = []\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i]\n\n if (elementNode == null) {\n valueList.length = i + 1\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope)\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value)\n } else {\n const element = getStaticValueR(elementNode, initialScope)\n if (element == null) {\n return null\n }\n valueList.push(element.value)\n }\n }\n\n return valueList\n}\n\n/**\n * Returns whether the given variable is never written to after initialization.\n * @param {import(\"eslint\").Scope.Variable} variable\n * @returns {boolean}\n */\nfunction isEffectivelyConst(variable) {\n const refs = variable.references\n\n const inits = refs.filter((r) => r.init).length\n const reads = refs.filter((r) => r.isReadOnly()).length\n if (inits === 1 && reads + inits === refs.length) {\n // there is only one init and all other references only read\n return true\n }\n return false\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope)\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope)\n const right = getStaticValueR(node.right, initialScope)\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: left.value ** right.value }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee\n const args = getElementValues(node.arguments, initialScope)\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n if (calleeNode.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(calleeNode.object, initialScope)\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(\n calleeNode,\n initialScope,\n )\n\n if (property != null) {\n const receiver = object.value\n const methodName = property.value\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope)\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope)\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node)\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0]\n if (\n def.parent &&\n def.type === \"Variable\" &&\n (def.parent.kind === \"const\" ||\n isEffectivelyConst(variable)) &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope)\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope)\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(node.object, initialScope)\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(node, initialScope)\n\n if (property != null) {\n if (!isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n\n for (const [classFn, allowed] of getterAllowed) {\n if (\n object.value instanceof classFn &&\n allowed.has(property.value)\n ) {\n return { value: object.value[property.value] }\n }\n }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope)\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope)\n const args = getElementValues(node.arguments, initialScope)\n\n if (callee != null && args != null) {\n const Func = callee.value\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {}\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = getStaticPropertyNameValue(\n propertyNode,\n initialScope,\n )\n const value = getStaticValueR(propertyNode.value, initialScope)\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope,\n )\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value)\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1]\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope)\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope,\n )\n\n if (tag != null && expressions != null) {\n const func = tag.value\n const strings = node.quasi.quasis.map((q) => q.value.cooked)\n strings.raw = node.quasi.quasis.map((q) => q.value.raw)\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope)\n if (expressions != null) {\n let value = node.quasis[0].value.cooked\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i]\n value += node.quasis[i + 1].value.cooked\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope)\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the static value of property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.\n */\nfunction getStaticPropertyNameValue(node, initialScope) {\n const nameNode = node.type === \"Property\" ? node.key : node.property\n\n if (node.computed) {\n return getStaticValueR(nameNode, initialScope)\n }\n\n if (nameNode.type === \"Identifier\") {\n return { value: nameNode.name }\n }\n\n if (nameNode.type === \"Literal\") {\n if (nameNode.bigint) {\n return { value: nameNode.bigint }\n }\n return { value: String(nameNode.value) }\n }\n\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n","import { getStaticValue } from \"./get-static-value.mjs\"\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope)\n return evaluated && String(evaluated.value)\n}\n","import { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n case \"PropertyDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n if (node.key.type === \"PrivateIdentifier\") {\n return null\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n","import { getPropertyName } from \"./get-property-name.mjs\"\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.\n * @returns {string} The name and kind of the function node.\n */\n// eslint-disable-next-line complexity\nexport function getFunctionNameWithKind(node, sourceCode) {\n const parent = node.parent\n const tokens = []\n const isObjectMethod = parent.type === \"Property\" && parent.value === node\n const isClassMethod =\n parent.type === \"MethodDefinition\" && parent.value === node\n const isClassFieldMethod =\n parent.type === \"PropertyDefinition\" && parent.value === node\n\n // Modifiers.\n if (isClassMethod || isClassFieldMethod) {\n if (parent.static) {\n tokens.push(\"static\")\n }\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(\"private\")\n }\n }\n if (node.async) {\n tokens.push(\"async\")\n }\n if (node.generator) {\n tokens.push(\"generator\")\n }\n\n // Kinds.\n if (isObjectMethod || isClassMethod) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\")\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\")\n } else {\n tokens.push(\"method\")\n }\n } else if (isClassFieldMethod) {\n tokens.push(\"method\")\n } else {\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\")\n }\n tokens.push(\"function\")\n }\n\n // Names.\n if (isObjectMethod || isClassMethod || isClassFieldMethod) {\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(`#${parent.key.name}`)\n } else {\n const name = getPropertyName(parent)\n if (name) {\n tokens.push(`'${name}'`)\n } else if (sourceCode) {\n const keyText = sourceCode.getText(parent.key)\n if (!keyText.includes(\"\\n\")) {\n tokens.push(`[${keyText}]`)\n }\n }\n }\n } else if (node.id) {\n tokens.push(`'${node.id.name}'`)\n } else if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`)\n } else if (\n (parent.type === \"AssignmentExpression\" ||\n parent.type === \"AssignmentPattern\") &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`)\n } else if (\n parent.type === \"ExportDefaultDeclaration\" &&\n parent.declaration === node\n ) {\n tokens.push(\"'default'\")\n }\n\n return tokens.join(\" \")\n}\n","import { getKeys, KEYS } from \"eslint-visitor-keys\"\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ]),\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node\n\n for (const key of visitorKeys[type] || getKeys(node)) {\n const value = node[key]\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n PropertyDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n }),\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {},\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || KEYS,\n )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode,\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0\n node = nodeOrSourceCode\n sourceCode = optionalSourceCode\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1\n node = timesOrNode\n sourceCode = nodeOrSourceCode\n }\n\n if (\n node == null ||\n // `Program` can't be parenthesized\n node.parent == null ||\n // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`\n (node.parent.type === \"CatchClause\" && node.parent.param === node)\n ) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = []\n let index = 0\n\n /** @type {RegExpExecArray} */\n let match = null\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1)\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(replacement.replace(placeholder, replacer))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = []\n let index = 0\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(String(replace(...match, match.index, match.input)))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n })\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this)\n let match = null\n let lastIndex = 0\n\n pattern.lastIndex = 0\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex\n yield match\n pattern.lastIndex = lastIndex\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str)\n const ret = it.next()\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\nconst has = Function.call.bind(Object.hasOwnProperty)\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some((r) => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {},\n ) {\n this.variableStack = []\n this.globalScope = globalScope\n this.mode = mode\n this.globalObjectNames = globalObjectNames.slice(0)\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key]\n const path = [key]\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true,\n )\n }\n\n for (const key of this.globalObjectNames) {\n const path = []\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n )\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0])\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key]\n const path = [key]\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap)\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId]\n const path = [moduleId]\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] }\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key]\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n }\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM)\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? { default: nextTraceMap, ...nextTraceMap }\n : { default: nextTraceMap },\n )\n\n if (esm) {\n yield* it\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault)\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable)\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] }\n }\n yield* this._iteratePropertyReferences(node, path, traceMap)\n }\n } finally {\n this.variableStack.pop()\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode\n while (isPassThrough(node)) {\n node = node.parent\n }\n\n const parent = node.parent\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent)\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap,\n )\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n }\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n yield* this._iteratePropertyReferences(parent, path, traceMap)\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap)\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode)\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n )\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property)\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key)\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap,\n )\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false,\n )\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false,\n )\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n }\n }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location.mjs\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind.mjs\"\nimport { getInnermostScope } from \"./get-innermost-scope.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStaticValue } from \"./get-static-value.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\nimport { hasSideEffect } from \"./has-side-effect.mjs\"\nimport { isParenthesized } from \"./is-parenthesized.mjs\"\nimport { PatternMatcher } from \"./pattern-matcher.mjs\"\nimport {\n CALL,\n CONSTRUCT,\n ESM,\n READ,\n ReferenceTracker,\n} from \"./reference-tracker.mjs\"\nimport {\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isSemicolonToken,\n} from \"./token-predicate.mjs\"\n\nexport default {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\nexport {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\n"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/LICENSE b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/LICENSE new file mode 100644 index 0000000..17a2553 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md new file mode 100644 index 0000000..cab8103 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md @@ -0,0 +1,105 @@ +# eslint-visitor-keys + +[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) +[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) +[![Build Status](https://github.com/eslint/eslint-visitor-keys/workflows/CI/badge.svg)](https://github.com/eslint/eslint-visitor-keys/actions) + +Constants and utilities about visitor keys to traverse AST. + +## 💿 Installation + +Use [npm] to install. + +```bash +$ npm install eslint-visitor-keys +``` + +### Requirements + +- [Node.js] `^12.22.0`, `^14.17.0`, or `>=16.0.0` + + +## 📖 Usage + +To use in an ESM file: + +```js +import * as evk from "eslint-visitor-keys" +``` + +To use in a CommonJS file: + +```js +const evk = require("eslint-visitor-keys") +``` + +### evk.KEYS + +> type: `{ [type: string]: string[] | undefined }` + +Visitor keys. This keys are frozen. + +This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. + +For example: + +``` +console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] +``` + +### evk.getKeys(node) + +> type: `(node: object) => string[]` + +Get the visitor keys of a given AST node. + +This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. + +This will be used to traverse unknown nodes. + +For example: + +```js +const node = { + type: "AssignmentExpression", + left: { type: "Identifier", name: "foo" }, + right: { type: "Literal", value: 0 } +} +console.log(evk.getKeys(node)) // → ["type", "left", "right"] +``` + +### evk.unionWith(additionalKeys) + +> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` + +Make the union set with `evk.KEYS` and the given keys. + +- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. +- It removes duplicated keys as keeping the first one. + +For example: + +```js +console.log(evk.unionWith({ + MethodDefinition: ["decorators"] +})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } +``` + +## 📰 Change log + +See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). + +## 🍻 Contributing + +Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). + +### Development commands + +- `npm test` runs tests and measures code coverage. +- `npm run lint` checks source codes with ESLint. +- `npm run test:open-coverage` opens the code coverage report of the previous test with your default browser. + + +[npm]: https://www.npmjs.com/ +[Node.js]: https://nodejs.org/ +[ESTree]: https://github.com/estree/estree diff --git a/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs new file mode 100644 index 0000000..00f91bc --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs @@ -0,0 +1,384 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +/** + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + */ + +/** + * @type {VisitorKeys} + */ +const KEYS = { + ArrayExpression: [ + "elements" + ], + ArrayPattern: [ + "elements" + ], + ArrowFunctionExpression: [ + "params", + "body" + ], + AssignmentExpression: [ + "left", + "right" + ], + AssignmentPattern: [ + "left", + "right" + ], + AwaitExpression: [ + "argument" + ], + BinaryExpression: [ + "left", + "right" + ], + BlockStatement: [ + "body" + ], + BreakStatement: [ + "label" + ], + CallExpression: [ + "callee", + "arguments" + ], + CatchClause: [ + "param", + "body" + ], + ChainExpression: [ + "expression" + ], + ClassBody: [ + "body" + ], + ClassDeclaration: [ + "id", + "superClass", + "body" + ], + ClassExpression: [ + "id", + "superClass", + "body" + ], + ConditionalExpression: [ + "test", + "consequent", + "alternate" + ], + ContinueStatement: [ + "label" + ], + DebuggerStatement: [], + DoWhileStatement: [ + "body", + "test" + ], + EmptyStatement: [], + ExperimentalRestProperty: [ + "argument" + ], + ExperimentalSpreadProperty: [ + "argument" + ], + ExportAllDeclaration: [ + "exported", + "source" + ], + ExportDefaultDeclaration: [ + "declaration" + ], + ExportNamedDeclaration: [ + "declaration", + "specifiers", + "source" + ], + ExportSpecifier: [ + "exported", + "local" + ], + ExpressionStatement: [ + "expression" + ], + ForInStatement: [ + "left", + "right", + "body" + ], + ForOfStatement: [ + "left", + "right", + "body" + ], + ForStatement: [ + "init", + "test", + "update", + "body" + ], + FunctionDeclaration: [ + "id", + "params", + "body" + ], + FunctionExpression: [ + "id", + "params", + "body" + ], + Identifier: [], + IfStatement: [ + "test", + "consequent", + "alternate" + ], + ImportDeclaration: [ + "specifiers", + "source" + ], + ImportDefaultSpecifier: [ + "local" + ], + ImportExpression: [ + "source" + ], + ImportNamespaceSpecifier: [ + "local" + ], + ImportSpecifier: [ + "imported", + "local" + ], + JSXAttribute: [ + "name", + "value" + ], + JSXClosingElement: [ + "name" + ], + JSXClosingFragment: [], + JSXElement: [ + "openingElement", + "children", + "closingElement" + ], + JSXEmptyExpression: [], + JSXExpressionContainer: [ + "expression" + ], + JSXFragment: [ + "openingFragment", + "children", + "closingFragment" + ], + JSXIdentifier: [], + JSXMemberExpression: [ + "object", + "property" + ], + JSXNamespacedName: [ + "namespace", + "name" + ], + JSXOpeningElement: [ + "name", + "attributes" + ], + JSXOpeningFragment: [], + JSXSpreadAttribute: [ + "argument" + ], + JSXSpreadChild: [ + "expression" + ], + JSXText: [], + LabeledStatement: [ + "label", + "body" + ], + Literal: [], + LogicalExpression: [ + "left", + "right" + ], + MemberExpression: [ + "object", + "property" + ], + MetaProperty: [ + "meta", + "property" + ], + MethodDefinition: [ + "key", + "value" + ], + NewExpression: [ + "callee", + "arguments" + ], + ObjectExpression: [ + "properties" + ], + ObjectPattern: [ + "properties" + ], + PrivateIdentifier: [], + Program: [ + "body" + ], + Property: [ + "key", + "value" + ], + PropertyDefinition: [ + "key", + "value" + ], + RestElement: [ + "argument" + ], + ReturnStatement: [ + "argument" + ], + SequenceExpression: [ + "expressions" + ], + SpreadElement: [ + "argument" + ], + StaticBlock: [ + "body" + ], + Super: [], + SwitchCase: [ + "test", + "consequent" + ], + SwitchStatement: [ + "discriminant", + "cases" + ], + TaggedTemplateExpression: [ + "tag", + "quasi" + ], + TemplateElement: [], + TemplateLiteral: [ + "quasis", + "expressions" + ], + ThisExpression: [], + ThrowStatement: [ + "argument" + ], + TryStatement: [ + "block", + "handler", + "finalizer" + ], + UnaryExpression: [ + "argument" + ], + UpdateExpression: [ + "argument" + ], + VariableDeclaration: [ + "declarations" + ], + VariableDeclarator: [ + "id", + "init" + ], + WhileStatement: [ + "test", + "body" + ], + WithStatement: [ + "object", + "body" + ], + YieldExpression: [ + "argument" + ] +}; + +// Types. +const NODE_TYPES = Object.keys(KEYS); + +// Freeze the keys. +for (const type of NODE_TYPES) { + Object.freeze(KEYS[type]); +} +Object.freeze(KEYS); + +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ + +/** + * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys + */ + +// List to ignore keys. +const KEY_BLACKLIST = new Set([ + "parent", + "leadingComments", + "trailingComments" +]); + +/** + * Check whether a given key should be used or not. + * @param {string} key The key to check. + * @returns {boolean} `true` if the key should be used. + */ +function filterKey(key) { + return !KEY_BLACKLIST.has(key) && key[0] !== "_"; +} + +/** + * Get visitor keys of a given node. + * @param {object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +function getKeys(node) { + return Object.keys(node).filter(filterKey); +} + +// Disable valid-jsdoc rule because it reports syntax error on the type of @returns. +// eslint-disable-next-line valid-jsdoc +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +function unionWith(additionalKeys) { + const retv = /** @type {{ + [type: string]: ReadonlyArray + }} */ (Object.assign({}, KEYS)); + + for (const type of Object.keys(additionalKeys)) { + if (Object.prototype.hasOwnProperty.call(retv, type)) { + const keys = new Set(additionalKeys[type]); + + for (const key of retv[type]) { + keys.add(key); + } + + retv[type] = Object.freeze(Array.from(keys)); + } else { + retv[type] = Object.freeze(Array.from(additionalKeys[type])); + } + } + + return Object.freeze(retv); +} + +exports.KEYS = KEYS; +exports.getKeys = getKeys; +exports.unionWith = unionWith; diff --git a/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts new file mode 100644 index 0000000..c7c28ed --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts @@ -0,0 +1,27 @@ +type VisitorKeys$1 = { + readonly [type: string]: readonly string[]; +}; +/** + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + */ +/** + * @type {VisitorKeys} + */ +declare const KEYS: VisitorKeys$1; + +/** + * Get visitor keys of a given node. + * @param {object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +declare function getKeys(node: object): readonly string[]; +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +declare function unionWith(additionalKeys: VisitorKeys): VisitorKeys; + +type VisitorKeys = VisitorKeys$1; + +export { KEYS, VisitorKeys, getKeys, unionWith }; diff --git a/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js new file mode 100644 index 0000000..3622816 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js @@ -0,0 +1,65 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +import KEYS from "./visitor-keys.js"; + +/** + * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys + */ + +// List to ignore keys. +const KEY_BLACKLIST = new Set([ + "parent", + "leadingComments", + "trailingComments" +]); + +/** + * Check whether a given key should be used or not. + * @param {string} key The key to check. + * @returns {boolean} `true` if the key should be used. + */ +function filterKey(key) { + return !KEY_BLACKLIST.has(key) && key[0] !== "_"; +} + +/** + * Get visitor keys of a given node. + * @param {object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +export function getKeys(node) { + return Object.keys(node).filter(filterKey); +} + +// Disable valid-jsdoc rule because it reports syntax error on the type of @returns. +// eslint-disable-next-line valid-jsdoc +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +export function unionWith(additionalKeys) { + const retv = /** @type {{ + [type: string]: ReadonlyArray + }} */ (Object.assign({}, KEYS)); + + for (const type of Object.keys(additionalKeys)) { + if (Object.prototype.hasOwnProperty.call(retv, type)) { + const keys = new Set(additionalKeys[type]); + + for (const key of retv[type]) { + keys.add(key); + } + + retv[type] = Object.freeze(Array.from(keys)); + } else { + retv[type] = Object.freeze(Array.from(additionalKeys[type])); + } + } + + return Object.freeze(retv); +} + +export { KEYS }; diff --git a/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.js b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.js new file mode 100644 index 0000000..ccf2b1f --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.js @@ -0,0 +1,315 @@ +/** + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + */ + +/** + * @type {VisitorKeys} + */ +const KEYS = { + ArrayExpression: [ + "elements" + ], + ArrayPattern: [ + "elements" + ], + ArrowFunctionExpression: [ + "params", + "body" + ], + AssignmentExpression: [ + "left", + "right" + ], + AssignmentPattern: [ + "left", + "right" + ], + AwaitExpression: [ + "argument" + ], + BinaryExpression: [ + "left", + "right" + ], + BlockStatement: [ + "body" + ], + BreakStatement: [ + "label" + ], + CallExpression: [ + "callee", + "arguments" + ], + CatchClause: [ + "param", + "body" + ], + ChainExpression: [ + "expression" + ], + ClassBody: [ + "body" + ], + ClassDeclaration: [ + "id", + "superClass", + "body" + ], + ClassExpression: [ + "id", + "superClass", + "body" + ], + ConditionalExpression: [ + "test", + "consequent", + "alternate" + ], + ContinueStatement: [ + "label" + ], + DebuggerStatement: [], + DoWhileStatement: [ + "body", + "test" + ], + EmptyStatement: [], + ExperimentalRestProperty: [ + "argument" + ], + ExperimentalSpreadProperty: [ + "argument" + ], + ExportAllDeclaration: [ + "exported", + "source" + ], + ExportDefaultDeclaration: [ + "declaration" + ], + ExportNamedDeclaration: [ + "declaration", + "specifiers", + "source" + ], + ExportSpecifier: [ + "exported", + "local" + ], + ExpressionStatement: [ + "expression" + ], + ForInStatement: [ + "left", + "right", + "body" + ], + ForOfStatement: [ + "left", + "right", + "body" + ], + ForStatement: [ + "init", + "test", + "update", + "body" + ], + FunctionDeclaration: [ + "id", + "params", + "body" + ], + FunctionExpression: [ + "id", + "params", + "body" + ], + Identifier: [], + IfStatement: [ + "test", + "consequent", + "alternate" + ], + ImportDeclaration: [ + "specifiers", + "source" + ], + ImportDefaultSpecifier: [ + "local" + ], + ImportExpression: [ + "source" + ], + ImportNamespaceSpecifier: [ + "local" + ], + ImportSpecifier: [ + "imported", + "local" + ], + JSXAttribute: [ + "name", + "value" + ], + JSXClosingElement: [ + "name" + ], + JSXClosingFragment: [], + JSXElement: [ + "openingElement", + "children", + "closingElement" + ], + JSXEmptyExpression: [], + JSXExpressionContainer: [ + "expression" + ], + JSXFragment: [ + "openingFragment", + "children", + "closingFragment" + ], + JSXIdentifier: [], + JSXMemberExpression: [ + "object", + "property" + ], + JSXNamespacedName: [ + "namespace", + "name" + ], + JSXOpeningElement: [ + "name", + "attributes" + ], + JSXOpeningFragment: [], + JSXSpreadAttribute: [ + "argument" + ], + JSXSpreadChild: [ + "expression" + ], + JSXText: [], + LabeledStatement: [ + "label", + "body" + ], + Literal: [], + LogicalExpression: [ + "left", + "right" + ], + MemberExpression: [ + "object", + "property" + ], + MetaProperty: [ + "meta", + "property" + ], + MethodDefinition: [ + "key", + "value" + ], + NewExpression: [ + "callee", + "arguments" + ], + ObjectExpression: [ + "properties" + ], + ObjectPattern: [ + "properties" + ], + PrivateIdentifier: [], + Program: [ + "body" + ], + Property: [ + "key", + "value" + ], + PropertyDefinition: [ + "key", + "value" + ], + RestElement: [ + "argument" + ], + ReturnStatement: [ + "argument" + ], + SequenceExpression: [ + "expressions" + ], + SpreadElement: [ + "argument" + ], + StaticBlock: [ + "body" + ], + Super: [], + SwitchCase: [ + "test", + "consequent" + ], + SwitchStatement: [ + "discriminant", + "cases" + ], + TaggedTemplateExpression: [ + "tag", + "quasi" + ], + TemplateElement: [], + TemplateLiteral: [ + "quasis", + "expressions" + ], + ThisExpression: [], + ThrowStatement: [ + "argument" + ], + TryStatement: [ + "block", + "handler", + "finalizer" + ], + UnaryExpression: [ + "argument" + ], + UpdateExpression: [ + "argument" + ], + VariableDeclaration: [ + "declarations" + ], + VariableDeclarator: [ + "id", + "init" + ], + WhileStatement: [ + "test", + "body" + ], + WithStatement: [ + "object", + "body" + ], + YieldExpression: [ + "argument" + ] +}; + +// Types. +const NODE_TYPES = Object.keys(KEYS); + +// Freeze the keys. +for (const type of NODE_TYPES) { + Object.freeze(KEYS[type]); +} +Object.freeze(KEYS); + +export default KEYS; diff --git a/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/package.json b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/package.json new file mode 100644 index 0000000..b9d51ce --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/package.json @@ -0,0 +1,74 @@ +{ + "name": "eslint-visitor-keys", + "version": "3.4.3", + "description": "Constants and utilities about visitor keys to traverse AST.", + "type": "module", + "main": "dist/eslint-visitor-keys.cjs", + "types": "./dist/index.d.ts", + "exports": { + ".": [ + { + "import": "./lib/index.js", + "require": "./dist/eslint-visitor-keys.cjs" + }, + "./dist/eslint-visitor-keys.cjs" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist/index.d.ts", + "dist/visitor-keys.d.ts", + "dist/eslint-visitor-keys.cjs", + "dist/eslint-visitor-keys.d.cts", + "lib" + ], + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "devDependencies": { + "@types/estree": "^0.0.51", + "@types/estree-jsx": "^0.0.1", + "@typescript-eslint/parser": "^5.14.0", + "c8": "^7.11.0", + "chai": "^4.3.6", + "eslint": "^7.29.0", + "eslint-config-eslint": "^7.0.0", + "eslint-plugin-jsdoc": "^35.4.0", + "eslint-plugin-node": "^11.1.0", + "eslint-release": "^3.2.0", + "esquery": "^1.4.0", + "json-diff": "^0.7.3", + "mocha": "^9.2.1", + "opener": "^1.5.2", + "rollup": "^2.70.0", + "rollup-plugin-dts": "^4.2.3", + "tsd": "^0.19.1", + "typescript": "^4.6.2" + }, + "scripts": { + "build": "npm run build:cjs && npm run build:types", + "build:cjs": "rollup -c", + "build:debug": "npm run build:cjs -- -m && npm run build:types", + "build:keys": "node tools/build-keys-from-ts", + "build:types": "tsc", + "lint": "eslint .", + "prepare": "npm run build", + "release:generate:latest": "eslint-generate-release", + "release:generate:alpha": "eslint-generate-prerelease alpha", + "release:generate:beta": "eslint-generate-prerelease beta", + "release:generate:rc": "eslint-generate-prerelease rc", + "release:publish": "eslint-publish-release", + "test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js && npm run test:types", + "test:open-coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html", + "test:types": "tsd" + }, + "repository": "eslint/eslint-visitor-keys", + "funding": "https://opencollective.com/eslint", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" + }, + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" +} diff --git a/node_modules/@eslint-community/eslint-utils/package.json b/node_modules/@eslint-community/eslint-utils/package.json new file mode 100644 index 0000000..1addaa9 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/package.json @@ -0,0 +1,80 @@ +{ + "name": "@eslint-community/eslint-utils", + "version": "4.4.1", + "description": "Utilities for ESLint plugins.", + "keywords": [ + "eslint" + ], + "homepage": "https://github.com/eslint-community/eslint-utils#readme", + "bugs": { + "url": "https://github.com/eslint-community/eslint-utils/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/eslint-community/eslint-utils" + }, + "license": "MIT", + "author": "Toru Nagashima", + "sideEffects": false, + "exports": { + ".": { + "import": "./index.mjs", + "require": "./index.js" + }, + "./package.json": "./package.json" + }, + "main": "index", + "module": "index.mjs", + "files": [ + "index.*" + ], + "scripts": { + "prebuild": "npm run -s clean", + "build": "rollup -c", + "clean": "rimraf .nyc_output coverage index.*", + "coverage": "opener ./coverage/lcov-report/index.html", + "docs:build": "vitepress build docs", + "docs:watch": "vitepress dev docs", + "format": "npm run -s format:prettier -- --write", + "format:prettier": "prettier .", + "format:check": "npm run -s format:prettier -- --check", + "lint:eslint": "eslint .", + "lint:format": "npm run -s format:check", + "lint:installed-check": "installed-check -v -i installed-check -i npm-run-all2 -i knip", + "lint:knip": "knip", + "lint": "run-p lint:*", + "test": "c8 mocha --reporter dot \"test/*.mjs\"", + "preversion": "npm test && npm run -s build", + "postversion": "git push && git push --tags", + "prewatch": "npm run -s clean", + "watch": "warun \"{src,test}/**/*.mjs\" -- npm run -s test:mocha" + }, + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "devDependencies": { + "@eslint-community/eslint-plugin-mysticatea": "^15.6.1", + "c8": "^8.0.1", + "dot-prop": "^7.2.0", + "eslint": "^8.57.1", + "installed-check": "^8.0.1", + "knip": "^5.33.3", + "mocha": "^9.2.2", + "npm-run-all2": "^6.2.3", + "opener": "^1.5.2", + "prettier": "2.8.8", + "rimraf": "^3.0.2", + "rollup": "^2.79.2", + "rollup-plugin-sourcemaps": "^0.6.3", + "semver": "^7.6.3", + "vitepress": "^1.4.1", + "warun": "^1.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": "https://opencollective.com/eslint" +} diff --git a/node_modules/@eslint-community/regexpp/LICENSE b/node_modules/@eslint-community/regexpp/LICENSE new file mode 100644 index 0000000..883ee1f --- /dev/null +++ b/node_modules/@eslint-community/regexpp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Toru Nagashima + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@eslint-community/regexpp/README.md b/node_modules/@eslint-community/regexpp/README.md new file mode 100644 index 0000000..9728af5 --- /dev/null +++ b/node_modules/@eslint-community/regexpp/README.md @@ -0,0 +1,177 @@ +# @eslint-community/regexpp + +[![npm version](https://img.shields.io/npm/v/@eslint-community/regexpp.svg)](https://www.npmjs.com/package/@eslint-community/regexpp) +[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/regexpp.svg)](http://www.npmtrends.com/@eslint-community/regexpp) +[![Build Status](https://github.com/eslint-community/regexpp/workflows/CI/badge.svg)](https://github.com/eslint-community/regexpp/actions) +[![codecov](https://codecov.io/gh/eslint-community/regexpp/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/regexpp) + +A regular expression parser for ECMAScript. + +## 💿 Installation + +```bash +$ npm install @eslint-community/regexpp +``` + +- require Node@^12.0.0 || ^14.0.0 || >=16.0.0. + +## 📖 Usage + +```ts +import { + AST, + RegExpParser, + RegExpValidator, + RegExpVisitor, + parseRegExpLiteral, + validateRegExpLiteral, + visitRegExpAST +} from "@eslint-community/regexpp" +``` + +### parseRegExpLiteral(source, options?) + +Parse a given regular expression literal then make AST object. + +This is equivalent to `new RegExpParser(options).parseLiteral(source)`. + +- **Parameters:** + - `source` (`string | RegExp`) The source code to parse. + - `options?` ([`RegExpParser.Options`]) The options to parse. +- **Return:** + - The AST of the regular expression. + +### validateRegExpLiteral(source, options?) + +Validate a given regular expression literal. + +This is equivalent to `new RegExpValidator(options).validateLiteral(source)`. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `options?` ([`RegExpValidator.Options`]) The options to validate. + +### visitRegExpAST(ast, handlers) + +Visit each node of a given AST. + +This is equivalent to `new RegExpVisitor(handlers).visit(ast)`. + +- **Parameters:** + - `ast` ([`AST.Node`]) The AST to visit. + - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. + +### RegExpParser + +#### new RegExpParser(options?) + +- **Parameters:** + - `options?` ([`RegExpParser.Options`]) The options to parse. + +#### parser.parseLiteral(source, start?, end?) + +Parse a regular expression literal. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"/abc/g"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. +- **Return:** + - The AST of the regular expression. + +#### parser.parsePattern(source, start?, end?, flags?) + +Parse a regular expression pattern. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"abc"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode. +- **Return:** + - The AST of the regular expression pattern. + +#### parser.parseFlags(source, start?, end?) + +Parse a regular expression flags. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"gim"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. +- **Return:** + - The AST of the regular expression flags. + +### RegExpValidator + +#### new RegExpValidator(options) + +- **Parameters:** + - `options` ([`RegExpValidator.Options`]) The options to validate. + +#### validator.validateLiteral(source, start, end) + +Validate a regular expression literal. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + +#### validator.validatePattern(source, start, end, flags) + +Validate a regular expression pattern. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode. + +#### validator.validateFlags(source, start, end) + +Validate a regular expression flags. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + +### RegExpVisitor + +#### new RegExpVisitor(handlers) + +- **Parameters:** + - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. + +#### visitor.visit(ast) + +Validate a regular expression literal. + +- **Parameters:** + - `ast` ([`AST.Node`]) The AST to visit. + +## 📰 Changelog + +- [GitHub Releases](https://github.com/eslint-community/regexpp/releases) + +## 🍻 Contributing + +Welcome contributing! + +Please use GitHub's Issues/PRs. + +### Development Tools + +- `npm test` runs tests and measures coverage. +- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`. +- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`. +- `npm run lint` runs ESLint. +- `npm run update:test` updates test fixtures. +- `npm run update:ids` updates `src/unicode/ids.ts`. +- `npm run watch` runs tests with `--watch` option. + +[`AST.Node`]: src/ast.ts#L4 +[`RegExpParser.Options`]: src/parser.ts#L743 +[`RegExpValidator.Options`]: src/validator.ts#L220 +[`RegExpVisitor.Handlers`]: src/visitor.ts#L291 diff --git a/node_modules/@eslint-community/regexpp/index.js b/node_modules/@eslint-community/regexpp/index.js new file mode 100644 index 0000000..ac5d686 --- /dev/null +++ b/node_modules/@eslint-community/regexpp/index.js @@ -0,0 +1,3037 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var ast = /*#__PURE__*/Object.freeze({ + __proto__: null +}); + +const latestEcmaVersion = 2025; + +let largeIdStartRanges = undefined; +let largeIdContinueRanges = undefined; +function isIdStart(cp) { + if (cp < 0x41) + return false; + if (cp < 0x5b) + return true; + if (cp < 0x61) + return false; + if (cp < 0x7b) + return true; + return isLargeIdStart(cp); +} +function isIdContinue(cp) { + if (cp < 0x30) + return false; + if (cp < 0x3a) + return true; + if (cp < 0x41) + return false; + if (cp < 0x5b) + return true; + if (cp === 0x5f) + return true; + if (cp < 0x61) + return false; + if (cp < 0x7b) + return true; + return isLargeIdStart(cp) || isLargeIdContinue(cp); +} +function isLargeIdStart(cp) { + return isInRange(cp, largeIdStartRanges !== null && largeIdStartRanges !== void 0 ? largeIdStartRanges : (largeIdStartRanges = initLargeIdStartRanges())); +} +function isLargeIdContinue(cp) { + return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges())); +} +function initLargeIdStartRanges() { + return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 3 0 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 w 1 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 a 6 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1u 3 1 2 0 2 7 m f 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 4 1f d 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 13 r a m 6z 15 7 1 h 2 1o s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 v 9 2 0 3 0 2 11 2 0 q 0 2 0 19 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 5k w w 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 q 32y 6 g6 5a2 t 1cz fs 8 u i 26 i t j 1b h 3 w k 6 i c1 18 5w 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 16 9 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r 6d t 3 0 ds 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk g h9 1wj f1 15v 3t6 6 38f"); +} +function initLargeIdContinueRanges() { + return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1o 8 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r el 1 1e 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 2p 0 n51 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 12 0 ig 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 7 9 w 4 8u 1 28 3 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 1w 8 2 0 3 0 2 3 2 4 2 0 f 1 2b h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 7 j 1m e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f 9j 9 1i 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e a 44m 0 7 e 8uh r 1t3 9 2f 9 13 4 1o 6 q 9 ev 9 d2 0 2 1i 8 3 2a 0 c 1 f58 1 382 9 ef 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d 6t 1 2 9 k6 6 32 6 6 9 3o7 9 gvt3 6n"); +} +function isInRange(cp, ranges) { + let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0; + while (l < r) { + i = ((l + r) / 2) | 0; + min = ranges[2 * i]; + max = ranges[2 * i + 1]; + if (cp < min) { + r = i; + } + else if (cp > max) { + l = i + 1; + } + else { + return true; + } + } + return false; +} +function restoreRanges(data) { + let last = 0; + return data.split(" ").map((s) => (last += parseInt(s, 36) | 0)); +} + +class DataSet { + constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024, raw2025) { + this._raw2018 = raw2018; + this._raw2019 = raw2019; + this._raw2020 = raw2020; + this._raw2021 = raw2021; + this._raw2022 = raw2022; + this._raw2023 = raw2023; + this._raw2024 = raw2024; + this._raw2025 = raw2025; + } + get es2018() { + var _a; + return ((_a = this._set2018) !== null && _a !== void 0 ? _a : (this._set2018 = new Set(this._raw2018.split(" ")))); + } + get es2019() { + var _a; + return ((_a = this._set2019) !== null && _a !== void 0 ? _a : (this._set2019 = new Set(this._raw2019.split(" ")))); + } + get es2020() { + var _a; + return ((_a = this._set2020) !== null && _a !== void 0 ? _a : (this._set2020 = new Set(this._raw2020.split(" ")))); + } + get es2021() { + var _a; + return ((_a = this._set2021) !== null && _a !== void 0 ? _a : (this._set2021 = new Set(this._raw2021.split(" ")))); + } + get es2022() { + var _a; + return ((_a = this._set2022) !== null && _a !== void 0 ? _a : (this._set2022 = new Set(this._raw2022.split(" ")))); + } + get es2023() { + var _a; + return ((_a = this._set2023) !== null && _a !== void 0 ? _a : (this._set2023 = new Set(this._raw2023.split(" ")))); + } + get es2024() { + var _a; + return ((_a = this._set2024) !== null && _a !== void 0 ? _a : (this._set2024 = new Set(this._raw2024.split(" ")))); + } + get es2025() { + var _a; + return ((_a = this._set2025) !== null && _a !== void 0 ? _a : (this._set2025 = new Set(this._raw2025.split(" ")))); + } +} +const gcNameSet = new Set(["General_Category", "gc"]); +const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]); +const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "", ""); +const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", "", ""); +const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "", ""); +const binPropertyOfStringsSets = new DataSet("", "", "", "", "", "", "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence", ""); +function isValidUnicodeProperty(version, name, value) { + if (gcNameSet.has(name)) { + return version >= 2018 && gcValueSets.es2018.has(value); + } + if (scNameSet.has(name)) { + return ((version >= 2018 && scValueSets.es2018.has(value)) || + (version >= 2019 && scValueSets.es2019.has(value)) || + (version >= 2020 && scValueSets.es2020.has(value)) || + (version >= 2021 && scValueSets.es2021.has(value)) || + (version >= 2022 && scValueSets.es2022.has(value)) || + (version >= 2023 && scValueSets.es2023.has(value))); + } + return false; +} +function isValidLoneUnicodeProperty(version, value) { + return ((version >= 2018 && binPropertySets.es2018.has(value)) || + (version >= 2019 && binPropertySets.es2019.has(value)) || + (version >= 2021 && binPropertySets.es2021.has(value))); +} +function isValidLoneUnicodePropertyOfString(version, value) { + return version >= 2024 && binPropertyOfStringsSets.es2024.has(value); +} + +const BACKSPACE = 0x08; +const CHARACTER_TABULATION = 0x09; +const LINE_FEED = 0x0a; +const LINE_TABULATION = 0x0b; +const FORM_FEED = 0x0c; +const CARRIAGE_RETURN = 0x0d; +const EXCLAMATION_MARK = 0x21; +const NUMBER_SIGN = 0x23; +const DOLLAR_SIGN = 0x24; +const PERCENT_SIGN = 0x25; +const AMPERSAND = 0x26; +const LEFT_PARENTHESIS = 0x28; +const RIGHT_PARENTHESIS = 0x29; +const ASTERISK = 0x2a; +const PLUS_SIGN = 0x2b; +const COMMA = 0x2c; +const HYPHEN_MINUS = 0x2d; +const FULL_STOP = 0x2e; +const SOLIDUS = 0x2f; +const DIGIT_ZERO = 0x30; +const DIGIT_ONE = 0x31; +const DIGIT_SEVEN = 0x37; +const DIGIT_NINE = 0x39; +const COLON = 0x3a; +const SEMICOLON = 0x3b; +const LESS_THAN_SIGN = 0x3c; +const EQUALS_SIGN = 0x3d; +const GREATER_THAN_SIGN = 0x3e; +const QUESTION_MARK = 0x3f; +const COMMERCIAL_AT = 0x40; +const LATIN_CAPITAL_LETTER_A = 0x41; +const LATIN_CAPITAL_LETTER_B = 0x42; +const LATIN_CAPITAL_LETTER_D = 0x44; +const LATIN_CAPITAL_LETTER_F = 0x46; +const LATIN_CAPITAL_LETTER_P = 0x50; +const LATIN_CAPITAL_LETTER_S = 0x53; +const LATIN_CAPITAL_LETTER_W = 0x57; +const LATIN_CAPITAL_LETTER_Z = 0x5a; +const LOW_LINE = 0x5f; +const LATIN_SMALL_LETTER_A = 0x61; +const LATIN_SMALL_LETTER_B = 0x62; +const LATIN_SMALL_LETTER_C = 0x63; +const LATIN_SMALL_LETTER_D = 0x64; +const LATIN_SMALL_LETTER_F = 0x66; +const LATIN_SMALL_LETTER_G = 0x67; +const LATIN_SMALL_LETTER_I = 0x69; +const LATIN_SMALL_LETTER_K = 0x6b; +const LATIN_SMALL_LETTER_M = 0x6d; +const LATIN_SMALL_LETTER_N = 0x6e; +const LATIN_SMALL_LETTER_P = 0x70; +const LATIN_SMALL_LETTER_Q = 0x71; +const LATIN_SMALL_LETTER_R = 0x72; +const LATIN_SMALL_LETTER_S = 0x73; +const LATIN_SMALL_LETTER_T = 0x74; +const LATIN_SMALL_LETTER_U = 0x75; +const LATIN_SMALL_LETTER_V = 0x76; +const LATIN_SMALL_LETTER_W = 0x77; +const LATIN_SMALL_LETTER_X = 0x78; +const LATIN_SMALL_LETTER_Y = 0x79; +const LATIN_SMALL_LETTER_Z = 0x7a; +const LEFT_SQUARE_BRACKET = 0x5b; +const REVERSE_SOLIDUS = 0x5c; +const RIGHT_SQUARE_BRACKET = 0x5d; +const CIRCUMFLEX_ACCENT = 0x5e; +const GRAVE_ACCENT = 0x60; +const LEFT_CURLY_BRACKET = 0x7b; +const VERTICAL_LINE = 0x7c; +const RIGHT_CURLY_BRACKET = 0x7d; +const TILDE = 0x7e; +const ZERO_WIDTH_NON_JOINER = 0x200c; +const ZERO_WIDTH_JOINER = 0x200d; +const LINE_SEPARATOR = 0x2028; +const PARAGRAPH_SEPARATOR = 0x2029; +const MIN_CODE_POINT = 0x00; +const MAX_CODE_POINT = 0x10ffff; +function isLatinLetter(code) { + return ((code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z) || + (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z)); +} +function isDecimalDigit(code) { + return code >= DIGIT_ZERO && code <= DIGIT_NINE; +} +function isOctalDigit(code) { + return code >= DIGIT_ZERO && code <= DIGIT_SEVEN; +} +function isHexDigit(code) { + return ((code >= DIGIT_ZERO && code <= DIGIT_NINE) || + (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) || + (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F)); +} +function isLineTerminator(code) { + return (code === LINE_FEED || + code === CARRIAGE_RETURN || + code === LINE_SEPARATOR || + code === PARAGRAPH_SEPARATOR); +} +function isValidUnicode(code) { + return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT; +} +function digitToInt(code) { + if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) { + return code - LATIN_SMALL_LETTER_A + 10; + } + if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) { + return code - LATIN_CAPITAL_LETTER_A + 10; + } + return code - DIGIT_ZERO; +} +function isLeadSurrogate(code) { + return code >= 0xd800 && code <= 0xdbff; +} +function isTrailSurrogate(code) { + return code >= 0xdc00 && code <= 0xdfff; +} +function combineSurrogatePair(lead, trail) { + return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; +} + +class GroupSpecifiersAsES2018 { + constructor() { + this.groupName = new Set(); + } + clear() { + this.groupName.clear(); + } + isEmpty() { + return !this.groupName.size; + } + hasInPattern(name) { + return this.groupName.has(name); + } + hasInScope(name) { + return this.hasInPattern(name); + } + addToScope(name) { + this.groupName.add(name); + } + enterDisjunction() { + } + enterAlternative() { + } + leaveDisjunction() { + } +} +class BranchID { + constructor(parent, base) { + this.parent = parent; + this.base = base !== null && base !== void 0 ? base : this; + } + separatedFrom(other) { + var _a, _b; + if (this.base === other.base && this !== other) { + return true; + } + if (other.parent && this.separatedFrom(other.parent)) { + return true; + } + return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.separatedFrom(other)) !== null && _b !== void 0 ? _b : false; + } + child() { + return new BranchID(this, null); + } + sibling() { + return new BranchID(this.parent, this.base); + } +} +class GroupSpecifiersAsES2025 { + constructor() { + this.branchID = new BranchID(null, null); + this.groupNames = new Map(); + } + clear() { + this.branchID = new BranchID(null, null); + this.groupNames.clear(); + } + isEmpty() { + return !this.groupNames.size; + } + enterDisjunction() { + this.branchID = this.branchID.child(); + } + enterAlternative(index) { + if (index === 0) { + return; + } + this.branchID = this.branchID.sibling(); + } + leaveDisjunction() { + this.branchID = this.branchID.parent; + } + hasInPattern(name) { + return this.groupNames.has(name); + } + hasInScope(name) { + const branches = this.groupNames.get(name); + if (!branches) { + return false; + } + for (const branch of branches) { + if (!branch.separatedFrom(this.branchID)) { + return true; + } + } + return false; + } + addToScope(name) { + const branches = this.groupNames.get(name); + if (branches) { + branches.push(this.branchID); + return; + } + this.groupNames.set(name, [this.branchID]); + } +} + +const legacyImpl = { + at(s, end, i) { + return i < end ? s.charCodeAt(i) : -1; + }, + width(c) { + return 1; + }, +}; +const unicodeImpl = { + at(s, end, i) { + return i < end ? s.codePointAt(i) : -1; + }, + width(c) { + return c > 0xffff ? 2 : 1; + }, +}; +class Reader { + constructor() { + this._impl = legacyImpl; + this._s = ""; + this._i = 0; + this._end = 0; + this._cp1 = -1; + this._w1 = 1; + this._cp2 = -1; + this._w2 = 1; + this._cp3 = -1; + this._w3 = 1; + this._cp4 = -1; + } + get source() { + return this._s; + } + get index() { + return this._i; + } + get currentCodePoint() { + return this._cp1; + } + get nextCodePoint() { + return this._cp2; + } + get nextCodePoint2() { + return this._cp3; + } + get nextCodePoint3() { + return this._cp4; + } + reset(source, start, end, uFlag) { + this._impl = uFlag ? unicodeImpl : legacyImpl; + this._s = source; + this._end = end; + this.rewind(start); + } + rewind(index) { + const impl = this._impl; + this._i = index; + this._cp1 = impl.at(this._s, this._end, index); + this._w1 = impl.width(this._cp1); + this._cp2 = impl.at(this._s, this._end, index + this._w1); + this._w2 = impl.width(this._cp2); + this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2); + this._w3 = impl.width(this._cp3); + this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3); + } + advance() { + if (this._cp1 !== -1) { + const impl = this._impl; + this._i += this._w1; + this._cp1 = this._cp2; + this._w1 = this._w2; + this._cp2 = this._cp3; + this._w2 = impl.width(this._cp2); + this._cp3 = this._cp4; + this._w3 = impl.width(this._cp3); + this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3); + } + } + eat(cp) { + if (this._cp1 === cp) { + this.advance(); + return true; + } + return false; + } + eat2(cp1, cp2) { + if (this._cp1 === cp1 && this._cp2 === cp2) { + this.advance(); + this.advance(); + return true; + } + return false; + } + eat3(cp1, cp2, cp3) { + if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) { + this.advance(); + this.advance(); + this.advance(); + return true; + } + return false; + } +} + +class RegExpSyntaxError extends SyntaxError { + constructor(message, index) { + super(message); + this.index = index; + } +} +function newRegExpSyntaxError(srcCtx, flags, index, message) { + let source = ""; + if (srcCtx.kind === "literal") { + const literal = srcCtx.source.slice(srcCtx.start, srcCtx.end); + if (literal) { + source = `: ${literal}`; + } + } + else if (srcCtx.kind === "pattern") { + const pattern = srcCtx.source.slice(srcCtx.start, srcCtx.end); + const flagsText = `${flags.unicode ? "u" : ""}${flags.unicodeSets ? "v" : ""}`; + source = `: /${pattern}/${flagsText}`; + } + return new RegExpSyntaxError(`Invalid regular expression${source}: ${message}`, index); +} + +const SYNTAX_CHARACTER = new Set([ + CIRCUMFLEX_ACCENT, + DOLLAR_SIGN, + REVERSE_SOLIDUS, + FULL_STOP, + ASTERISK, + PLUS_SIGN, + QUESTION_MARK, + LEFT_PARENTHESIS, + RIGHT_PARENTHESIS, + LEFT_SQUARE_BRACKET, + RIGHT_SQUARE_BRACKET, + LEFT_CURLY_BRACKET, + RIGHT_CURLY_BRACKET, + VERTICAL_LINE, +]); +const CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER = new Set([ + AMPERSAND, + EXCLAMATION_MARK, + NUMBER_SIGN, + DOLLAR_SIGN, + PERCENT_SIGN, + ASTERISK, + PLUS_SIGN, + COMMA, + FULL_STOP, + COLON, + SEMICOLON, + LESS_THAN_SIGN, + EQUALS_SIGN, + GREATER_THAN_SIGN, + QUESTION_MARK, + COMMERCIAL_AT, + CIRCUMFLEX_ACCENT, + GRAVE_ACCENT, + TILDE, +]); +const CLASS_SET_SYNTAX_CHARACTER = new Set([ + LEFT_PARENTHESIS, + RIGHT_PARENTHESIS, + LEFT_SQUARE_BRACKET, + RIGHT_SQUARE_BRACKET, + LEFT_CURLY_BRACKET, + RIGHT_CURLY_BRACKET, + SOLIDUS, + HYPHEN_MINUS, + REVERSE_SOLIDUS, + VERTICAL_LINE, +]); +const CLASS_SET_RESERVED_PUNCTUATOR = new Set([ + AMPERSAND, + HYPHEN_MINUS, + EXCLAMATION_MARK, + NUMBER_SIGN, + PERCENT_SIGN, + COMMA, + COLON, + SEMICOLON, + LESS_THAN_SIGN, + EQUALS_SIGN, + GREATER_THAN_SIGN, + COMMERCIAL_AT, + GRAVE_ACCENT, + TILDE, +]); +const FLAG_PROP_TO_CODEPOINT = { + global: LATIN_SMALL_LETTER_G, + ignoreCase: LATIN_SMALL_LETTER_I, + multiline: LATIN_SMALL_LETTER_M, + unicode: LATIN_SMALL_LETTER_U, + sticky: LATIN_SMALL_LETTER_Y, + dotAll: LATIN_SMALL_LETTER_S, + hasIndices: LATIN_SMALL_LETTER_D, + unicodeSets: LATIN_SMALL_LETTER_V, +}; +const FLAG_CODEPOINT_TO_PROP = Object.fromEntries(Object.entries(FLAG_PROP_TO_CODEPOINT).map(([k, v]) => [v, k])); +function isSyntaxCharacter(cp) { + return SYNTAX_CHARACTER.has(cp); +} +function isClassSetReservedDoublePunctuatorCharacter(cp) { + return CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER.has(cp); +} +function isClassSetSyntaxCharacter(cp) { + return CLASS_SET_SYNTAX_CHARACTER.has(cp); +} +function isClassSetReservedPunctuator(cp) { + return CLASS_SET_RESERVED_PUNCTUATOR.has(cp); +} +function isIdentifierStartChar(cp) { + return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE; +} +function isIdentifierPartChar(cp) { + return (isIdContinue(cp) || + cp === DOLLAR_SIGN || + cp === ZERO_WIDTH_NON_JOINER || + cp === ZERO_WIDTH_JOINER); +} +function isUnicodePropertyNameCharacter(cp) { + return isLatinLetter(cp) || cp === LOW_LINE; +} +function isUnicodePropertyValueCharacter(cp) { + return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); +} +function isRegularExpressionModifier(ch) { + return (ch === LATIN_SMALL_LETTER_I || + ch === LATIN_SMALL_LETTER_M || + ch === LATIN_SMALL_LETTER_S); +} +class RegExpValidator { + constructor(options) { + this._reader = new Reader(); + this._unicodeMode = false; + this._unicodeSetsMode = false; + this._nFlag = false; + this._lastIntValue = 0; + this._lastRange = { + min: 0, + max: Number.POSITIVE_INFINITY, + }; + this._lastStrValue = ""; + this._lastAssertionIsQuantifiable = false; + this._numCapturingParens = 0; + this._backreferenceNames = new Set(); + this._srcCtx = null; + this._options = options !== null && options !== void 0 ? options : {}; + this._groupSpecifiers = + this.ecmaVersion >= 2025 + ? new GroupSpecifiersAsES2025() + : new GroupSpecifiersAsES2018(); + } + validateLiteral(source, start = 0, end = source.length) { + this._srcCtx = { source, start, end, kind: "literal" }; + this._unicodeSetsMode = this._unicodeMode = this._nFlag = false; + this.reset(source, start, end); + this.onLiteralEnter(start); + if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) { + const flagStart = this.index; + const unicode = source.includes("u", flagStart); + const unicodeSets = source.includes("v", flagStart); + this.validateFlagsInternal(source, flagStart, end); + this.validatePatternInternal(source, start + 1, flagStart - 1, { + unicode, + unicodeSets, + }); + } + else if (start >= end) { + this.raise("Empty"); + } + else { + const c = String.fromCodePoint(this.currentCodePoint); + this.raise(`Unexpected character '${c}'`); + } + this.onLiteralLeave(start, end); + } + validateFlags(source, start = 0, end = source.length) { + this._srcCtx = { source, start, end, kind: "flags" }; + this.validateFlagsInternal(source, start, end); + } + validatePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) { + this._srcCtx = { source, start, end, kind: "pattern" }; + this.validatePatternInternal(source, start, end, uFlagOrFlags); + } + validatePatternInternal(source, start = 0, end = source.length, uFlagOrFlags = undefined) { + const mode = this._parseFlagsOptionToMode(uFlagOrFlags, end); + this._unicodeMode = mode.unicodeMode; + this._nFlag = mode.nFlag; + this._unicodeSetsMode = mode.unicodeSetsMode; + this.reset(source, start, end); + this.consumePattern(); + if (!this._nFlag && + this.ecmaVersion >= 2018 && + !this._groupSpecifiers.isEmpty()) { + this._nFlag = true; + this.rewind(start); + this.consumePattern(); + } + } + validateFlagsInternal(source, start, end) { + const flags = this.parseFlags(source, start, end); + this.onRegExpFlags(start, end, flags); + } + _parseFlagsOptionToMode(uFlagOrFlags, sourceEnd) { + let unicode = false; + let unicodeSets = false; + if (uFlagOrFlags && this.ecmaVersion >= 2015) { + if (typeof uFlagOrFlags === "object") { + unicode = Boolean(uFlagOrFlags.unicode); + if (this.ecmaVersion >= 2024) { + unicodeSets = Boolean(uFlagOrFlags.unicodeSets); + } + } + else { + unicode = uFlagOrFlags; + } + } + if (unicode && unicodeSets) { + this.raise("Invalid regular expression flags", { + index: sourceEnd + 1, + unicode, + unicodeSets, + }); + } + const unicodeMode = unicode || unicodeSets; + const nFlag = (unicode && this.ecmaVersion >= 2018) || + unicodeSets || + Boolean(this._options.strict && this.ecmaVersion >= 2023); + const unicodeSetsMode = unicodeSets; + return { unicodeMode, nFlag, unicodeSetsMode }; + } + get strict() { + return Boolean(this._options.strict) || this._unicodeMode; + } + get ecmaVersion() { + var _a; + return (_a = this._options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion; + } + onLiteralEnter(start) { + if (this._options.onLiteralEnter) { + this._options.onLiteralEnter(start); + } + } + onLiteralLeave(start, end) { + if (this._options.onLiteralLeave) { + this._options.onLiteralLeave(start, end); + } + } + onRegExpFlags(start, end, flags) { + if (this._options.onRegExpFlags) { + this._options.onRegExpFlags(start, end, flags); + } + if (this._options.onFlags) { + this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices); + } + } + onPatternEnter(start) { + if (this._options.onPatternEnter) { + this._options.onPatternEnter(start); + } + } + onPatternLeave(start, end) { + if (this._options.onPatternLeave) { + this._options.onPatternLeave(start, end); + } + } + onDisjunctionEnter(start) { + if (this._options.onDisjunctionEnter) { + this._options.onDisjunctionEnter(start); + } + } + onDisjunctionLeave(start, end) { + if (this._options.onDisjunctionLeave) { + this._options.onDisjunctionLeave(start, end); + } + } + onAlternativeEnter(start, index) { + if (this._options.onAlternativeEnter) { + this._options.onAlternativeEnter(start, index); + } + } + onAlternativeLeave(start, end, index) { + if (this._options.onAlternativeLeave) { + this._options.onAlternativeLeave(start, end, index); + } + } + onGroupEnter(start) { + if (this._options.onGroupEnter) { + this._options.onGroupEnter(start); + } + } + onGroupLeave(start, end) { + if (this._options.onGroupLeave) { + this._options.onGroupLeave(start, end); + } + } + onModifiersEnter(start) { + if (this._options.onModifiersEnter) { + this._options.onModifiersEnter(start); + } + } + onModifiersLeave(start, end) { + if (this._options.onModifiersLeave) { + this._options.onModifiersLeave(start, end); + } + } + onAddModifiers(start, end, flags) { + if (this._options.onAddModifiers) { + this._options.onAddModifiers(start, end, flags); + } + } + onRemoveModifiers(start, end, flags) { + if (this._options.onRemoveModifiers) { + this._options.onRemoveModifiers(start, end, flags); + } + } + onCapturingGroupEnter(start, name) { + if (this._options.onCapturingGroupEnter) { + this._options.onCapturingGroupEnter(start, name); + } + } + onCapturingGroupLeave(start, end, name) { + if (this._options.onCapturingGroupLeave) { + this._options.onCapturingGroupLeave(start, end, name); + } + } + onQuantifier(start, end, min, max, greedy) { + if (this._options.onQuantifier) { + this._options.onQuantifier(start, end, min, max, greedy); + } + } + onLookaroundAssertionEnter(start, kind, negate) { + if (this._options.onLookaroundAssertionEnter) { + this._options.onLookaroundAssertionEnter(start, kind, negate); + } + } + onLookaroundAssertionLeave(start, end, kind, negate) { + if (this._options.onLookaroundAssertionLeave) { + this._options.onLookaroundAssertionLeave(start, end, kind, negate); + } + } + onEdgeAssertion(start, end, kind) { + if (this._options.onEdgeAssertion) { + this._options.onEdgeAssertion(start, end, kind); + } + } + onWordBoundaryAssertion(start, end, kind, negate) { + if (this._options.onWordBoundaryAssertion) { + this._options.onWordBoundaryAssertion(start, end, kind, negate); + } + } + onAnyCharacterSet(start, end, kind) { + if (this._options.onAnyCharacterSet) { + this._options.onAnyCharacterSet(start, end, kind); + } + } + onEscapeCharacterSet(start, end, kind, negate) { + if (this._options.onEscapeCharacterSet) { + this._options.onEscapeCharacterSet(start, end, kind, negate); + } + } + onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) { + if (this._options.onUnicodePropertyCharacterSet) { + this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings); + } + } + onCharacter(start, end, value) { + if (this._options.onCharacter) { + this._options.onCharacter(start, end, value); + } + } + onBackreference(start, end, ref) { + if (this._options.onBackreference) { + this._options.onBackreference(start, end, ref); + } + } + onCharacterClassEnter(start, negate, unicodeSets) { + if (this._options.onCharacterClassEnter) { + this._options.onCharacterClassEnter(start, negate, unicodeSets); + } + } + onCharacterClassLeave(start, end, negate) { + if (this._options.onCharacterClassLeave) { + this._options.onCharacterClassLeave(start, end, negate); + } + } + onCharacterClassRange(start, end, min, max) { + if (this._options.onCharacterClassRange) { + this._options.onCharacterClassRange(start, end, min, max); + } + } + onClassIntersection(start, end) { + if (this._options.onClassIntersection) { + this._options.onClassIntersection(start, end); + } + } + onClassSubtraction(start, end) { + if (this._options.onClassSubtraction) { + this._options.onClassSubtraction(start, end); + } + } + onClassStringDisjunctionEnter(start) { + if (this._options.onClassStringDisjunctionEnter) { + this._options.onClassStringDisjunctionEnter(start); + } + } + onClassStringDisjunctionLeave(start, end) { + if (this._options.onClassStringDisjunctionLeave) { + this._options.onClassStringDisjunctionLeave(start, end); + } + } + onStringAlternativeEnter(start, index) { + if (this._options.onStringAlternativeEnter) { + this._options.onStringAlternativeEnter(start, index); + } + } + onStringAlternativeLeave(start, end, index) { + if (this._options.onStringAlternativeLeave) { + this._options.onStringAlternativeLeave(start, end, index); + } + } + get index() { + return this._reader.index; + } + get currentCodePoint() { + return this._reader.currentCodePoint; + } + get nextCodePoint() { + return this._reader.nextCodePoint; + } + get nextCodePoint2() { + return this._reader.nextCodePoint2; + } + get nextCodePoint3() { + return this._reader.nextCodePoint3; + } + reset(source, start, end) { + this._reader.reset(source, start, end, this._unicodeMode); + } + rewind(index) { + this._reader.rewind(index); + } + advance() { + this._reader.advance(); + } + eat(cp) { + return this._reader.eat(cp); + } + eat2(cp1, cp2) { + return this._reader.eat2(cp1, cp2); + } + eat3(cp1, cp2, cp3) { + return this._reader.eat3(cp1, cp2, cp3); + } + raise(message, context) { + var _a, _b, _c; + throw newRegExpSyntaxError(this._srcCtx, { + unicode: (_a = context === null || context === void 0 ? void 0 : context.unicode) !== null && _a !== void 0 ? _a : (this._unicodeMode && !this._unicodeSetsMode), + unicodeSets: (_b = context === null || context === void 0 ? void 0 : context.unicodeSets) !== null && _b !== void 0 ? _b : this._unicodeSetsMode, + }, (_c = context === null || context === void 0 ? void 0 : context.index) !== null && _c !== void 0 ? _c : this.index, message); + } + eatRegExpBody() { + const start = this.index; + let inClass = false; + let escaped = false; + for (;;) { + const cp = this.currentCodePoint; + if (cp === -1 || isLineTerminator(cp)) { + const kind = inClass ? "character class" : "regular expression"; + this.raise(`Unterminated ${kind}`); + } + if (escaped) { + escaped = false; + } + else if (cp === REVERSE_SOLIDUS) { + escaped = true; + } + else if (cp === LEFT_SQUARE_BRACKET) { + inClass = true; + } + else if (cp === RIGHT_SQUARE_BRACKET) { + inClass = false; + } + else if ((cp === SOLIDUS && !inClass) || + (cp === ASTERISK && this.index === start)) { + break; + } + this.advance(); + } + return this.index !== start; + } + consumePattern() { + const start = this.index; + this._numCapturingParens = this.countCapturingParens(); + this._groupSpecifiers.clear(); + this._backreferenceNames.clear(); + this.onPatternEnter(start); + this.consumeDisjunction(); + const cp = this.currentCodePoint; + if (this.currentCodePoint !== -1) { + if (cp === RIGHT_PARENTHESIS) { + this.raise("Unmatched ')'"); + } + if (cp === REVERSE_SOLIDUS) { + this.raise("\\ at end of pattern"); + } + if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) { + this.raise("Lone quantifier brackets"); + } + const c = String.fromCodePoint(cp); + this.raise(`Unexpected character '${c}'`); + } + for (const name of this._backreferenceNames) { + if (!this._groupSpecifiers.hasInPattern(name)) { + this.raise("Invalid named capture referenced"); + } + } + this.onPatternLeave(start, this.index); + } + countCapturingParens() { + const start = this.index; + let inClass = false; + let escaped = false; + let count = 0; + let cp = 0; + while ((cp = this.currentCodePoint) !== -1) { + if (escaped) { + escaped = false; + } + else if (cp === REVERSE_SOLIDUS) { + escaped = true; + } + else if (cp === LEFT_SQUARE_BRACKET) { + inClass = true; + } + else if (cp === RIGHT_SQUARE_BRACKET) { + inClass = false; + } + else if (cp === LEFT_PARENTHESIS && + !inClass && + (this.nextCodePoint !== QUESTION_MARK || + (this.nextCodePoint2 === LESS_THAN_SIGN && + this.nextCodePoint3 !== EQUALS_SIGN && + this.nextCodePoint3 !== EXCLAMATION_MARK))) { + count += 1; + } + this.advance(); + } + this.rewind(start); + return count; + } + consumeDisjunction() { + const start = this.index; + let i = 0; + this._groupSpecifiers.enterDisjunction(); + this.onDisjunctionEnter(start); + do { + this.consumeAlternative(i++); + } while (this.eat(VERTICAL_LINE)); + if (this.consumeQuantifier(true)) { + this.raise("Nothing to repeat"); + } + if (this.eat(LEFT_CURLY_BRACKET)) { + this.raise("Lone quantifier brackets"); + } + this.onDisjunctionLeave(start, this.index); + this._groupSpecifiers.leaveDisjunction(); + } + consumeAlternative(i) { + const start = this.index; + this._groupSpecifiers.enterAlternative(i); + this.onAlternativeEnter(start, i); + while (this.currentCodePoint !== -1 && this.consumeTerm()) { + } + this.onAlternativeLeave(start, this.index, i); + } + consumeTerm() { + if (this._unicodeMode || this.strict) { + return (this.consumeAssertion() || + (this.consumeAtom() && this.consumeOptionalQuantifier())); + } + return ((this.consumeAssertion() && + (!this._lastAssertionIsQuantifiable || + this.consumeOptionalQuantifier())) || + (this.consumeExtendedAtom() && this.consumeOptionalQuantifier())); + } + consumeOptionalQuantifier() { + this.consumeQuantifier(); + return true; + } + consumeAssertion() { + const start = this.index; + this._lastAssertionIsQuantifiable = false; + if (this.eat(CIRCUMFLEX_ACCENT)) { + this.onEdgeAssertion(start, this.index, "start"); + return true; + } + if (this.eat(DOLLAR_SIGN)) { + this.onEdgeAssertion(start, this.index, "end"); + return true; + } + if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) { + this.onWordBoundaryAssertion(start, this.index, "word", true); + return true; + } + if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) { + this.onWordBoundaryAssertion(start, this.index, "word", false); + return true; + } + if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) { + const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN); + let negate = false; + if (this.eat(EQUALS_SIGN) || + (negate = this.eat(EXCLAMATION_MARK))) { + const kind = lookbehind ? "lookbehind" : "lookahead"; + this.onLookaroundAssertionEnter(start, kind, negate); + this.consumeDisjunction(); + if (!this.eat(RIGHT_PARENTHESIS)) { + this.raise("Unterminated group"); + } + this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; + this.onLookaroundAssertionLeave(start, this.index, kind, negate); + return true; + } + this.rewind(start); + } + return false; + } + consumeQuantifier(noConsume = false) { + const start = this.index; + let min = 0; + let max = 0; + let greedy = false; + if (this.eat(ASTERISK)) { + min = 0; + max = Number.POSITIVE_INFINITY; + } + else if (this.eat(PLUS_SIGN)) { + min = 1; + max = Number.POSITIVE_INFINITY; + } + else if (this.eat(QUESTION_MARK)) { + min = 0; + max = 1; + } + else if (this.eatBracedQuantifier(noConsume)) { + ({ min, max } = this._lastRange); + } + else { + return false; + } + greedy = !this.eat(QUESTION_MARK); + if (!noConsume) { + this.onQuantifier(start, this.index, min, max, greedy); + } + return true; + } + eatBracedQuantifier(noError) { + const start = this.index; + if (this.eat(LEFT_CURLY_BRACKET)) { + if (this.eatDecimalDigits()) { + const min = this._lastIntValue; + let max = min; + if (this.eat(COMMA)) { + max = this.eatDecimalDigits() + ? this._lastIntValue + : Number.POSITIVE_INFINITY; + } + if (this.eat(RIGHT_CURLY_BRACKET)) { + if (!noError && max < min) { + this.raise("numbers out of order in {} quantifier"); + } + this._lastRange = { min, max }; + return true; + } + } + if (!noError && (this._unicodeMode || this.strict)) { + this.raise("Incomplete quantifier"); + } + this.rewind(start); + } + return false; + } + consumeAtom() { + return (this.consumePatternCharacter() || + this.consumeDot() || + this.consumeReverseSolidusAtomEscape() || + Boolean(this.consumeCharacterClass()) || + this.consumeCapturingGroup() || + this.consumeUncapturingGroup()); + } + consumeDot() { + if (this.eat(FULL_STOP)) { + this.onAnyCharacterSet(this.index - 1, this.index, "any"); + return true; + } + return false; + } + consumeReverseSolidusAtomEscape() { + const start = this.index; + if (this.eat(REVERSE_SOLIDUS)) { + if (this.consumeAtomEscape()) { + return true; + } + this.rewind(start); + } + return false; + } + consumeUncapturingGroup() { + const start = this.index; + if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) { + this.onGroupEnter(start); + if (this.ecmaVersion >= 2025) { + this.consumeModifiers(); + } + if (!this.eat(COLON)) { + this.rewind(start + 1); + this.raise("Invalid group"); + } + this.consumeDisjunction(); + if (!this.eat(RIGHT_PARENTHESIS)) { + this.raise("Unterminated group"); + } + this.onGroupLeave(start, this.index); + return true; + } + return false; + } + consumeModifiers() { + const start = this.index; + const hasAddModifiers = this.eatModifiers(); + const addModifiersEnd = this.index; + const hasHyphen = this.eat(HYPHEN_MINUS); + if (!hasAddModifiers && !hasHyphen) { + return false; + } + this.onModifiersEnter(start); + const addModifiers = this.parseModifiers(start, addModifiersEnd); + this.onAddModifiers(start, addModifiersEnd, addModifiers); + if (hasHyphen) { + const modifiersStart = this.index; + if (!this.eatModifiers() && + !hasAddModifiers && + this.currentCodePoint === COLON) { + this.raise("Invalid empty flags"); + } + const modifiers = this.parseModifiers(modifiersStart, this.index); + for (const [flagName] of Object.entries(modifiers).filter(([, enable]) => enable)) { + if (addModifiers[flagName]) { + this.raise(`Duplicated flag '${String.fromCodePoint(FLAG_PROP_TO_CODEPOINT[flagName])}'`); + } + } + this.onRemoveModifiers(modifiersStart, this.index, modifiers); + } + this.onModifiersLeave(start, this.index); + return true; + } + consumeCapturingGroup() { + const start = this.index; + if (this.eat(LEFT_PARENTHESIS)) { + let name = null; + if (this.ecmaVersion >= 2018) { + if (this.consumeGroupSpecifier()) { + name = this._lastStrValue; + } + else if (this.currentCodePoint === QUESTION_MARK) { + this.rewind(start); + return false; + } + } + else if (this.currentCodePoint === QUESTION_MARK) { + this.rewind(start); + return false; + } + this.onCapturingGroupEnter(start, name); + this.consumeDisjunction(); + if (!this.eat(RIGHT_PARENTHESIS)) { + this.raise("Unterminated group"); + } + this.onCapturingGroupLeave(start, this.index, name); + return true; + } + return false; + } + consumeExtendedAtom() { + return (this.consumeDot() || + this.consumeReverseSolidusAtomEscape() || + this.consumeReverseSolidusFollowedByC() || + Boolean(this.consumeCharacterClass()) || + this.consumeCapturingGroup() || + this.consumeUncapturingGroup() || + this.consumeInvalidBracedQuantifier() || + this.consumeExtendedPatternCharacter()); + } + consumeReverseSolidusFollowedByC() { + const start = this.index; + if (this.currentCodePoint === REVERSE_SOLIDUS && + this.nextCodePoint === LATIN_SMALL_LETTER_C) { + this._lastIntValue = this.currentCodePoint; + this.advance(); + this.onCharacter(start, this.index, REVERSE_SOLIDUS); + return true; + } + return false; + } + consumeInvalidBracedQuantifier() { + if (this.eatBracedQuantifier(true)) { + this.raise("Nothing to repeat"); + } + return false; + } + consumePatternCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && !isSyntaxCharacter(cp)) { + this.advance(); + this.onCharacter(start, this.index, cp); + return true; + } + return false; + } + consumeExtendedPatternCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && + cp !== CIRCUMFLEX_ACCENT && + cp !== DOLLAR_SIGN && + cp !== REVERSE_SOLIDUS && + cp !== FULL_STOP && + cp !== ASTERISK && + cp !== PLUS_SIGN && + cp !== QUESTION_MARK && + cp !== LEFT_PARENTHESIS && + cp !== RIGHT_PARENTHESIS && + cp !== LEFT_SQUARE_BRACKET && + cp !== VERTICAL_LINE) { + this.advance(); + this.onCharacter(start, this.index, cp); + return true; + } + return false; + } + consumeGroupSpecifier() { + const start = this.index; + if (this.eat(QUESTION_MARK)) { + if (this.eatGroupName()) { + if (!this._groupSpecifiers.hasInScope(this._lastStrValue)) { + this._groupSpecifiers.addToScope(this._lastStrValue); + return true; + } + this.raise("Duplicate capture group name"); + } + this.rewind(start); + } + return false; + } + consumeAtomEscape() { + if (this.consumeBackreference() || + this.consumeCharacterClassEscape() || + this.consumeCharacterEscape() || + (this._nFlag && this.consumeKGroupName())) { + return true; + } + if (this.strict || this._unicodeMode) { + this.raise("Invalid escape"); + } + return false; + } + consumeBackreference() { + const start = this.index; + if (this.eatDecimalEscape()) { + const n = this._lastIntValue; + if (n <= this._numCapturingParens) { + this.onBackreference(start - 1, this.index, n); + return true; + } + if (this.strict || this._unicodeMode) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + consumeCharacterClassEscape() { + var _a; + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_D)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "digit", false); + return {}; + } + if (this.eat(LATIN_CAPITAL_LETTER_D)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "digit", true); + return {}; + } + if (this.eat(LATIN_SMALL_LETTER_S)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "space", false); + return {}; + } + if (this.eat(LATIN_CAPITAL_LETTER_S)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "space", true); + return {}; + } + if (this.eat(LATIN_SMALL_LETTER_W)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "word", false); + return {}; + } + if (this.eat(LATIN_CAPITAL_LETTER_W)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "word", true); + return {}; + } + let negate = false; + if (this._unicodeMode && + this.ecmaVersion >= 2018 && + (this.eat(LATIN_SMALL_LETTER_P) || + (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) { + this._lastIntValue = -1; + let result = null; + if (this.eat(LEFT_CURLY_BRACKET) && + (result = this.eatUnicodePropertyValueExpression()) && + this.eat(RIGHT_CURLY_BRACKET)) { + if (negate && result.strings) { + this.raise("Invalid property name"); + } + this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", result.key, result.value, negate, (_a = result.strings) !== null && _a !== void 0 ? _a : false); + return { mayContainStrings: result.strings }; + } + this.raise("Invalid property name"); + } + return null; + } + consumeCharacterEscape() { + const start = this.index; + if (this.eatControlEscape() || + this.eatCControlLetter() || + this.eatZero() || + this.eatHexEscapeSequence() || + this.eatRegExpUnicodeEscapeSequence() || + (!this.strict && + !this._unicodeMode && + this.eatLegacyOctalEscapeSequence()) || + this.eatIdentityEscape()) { + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + return false; + } + consumeKGroupName() { + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_K)) { + if (this.eatGroupName()) { + const groupName = this._lastStrValue; + this._backreferenceNames.add(groupName); + this.onBackreference(start - 1, this.index, groupName); + return true; + } + this.raise("Invalid named reference"); + } + return false; + } + consumeCharacterClass() { + const start = this.index; + if (this.eat(LEFT_SQUARE_BRACKET)) { + const negate = this.eat(CIRCUMFLEX_ACCENT); + this.onCharacterClassEnter(start, negate, this._unicodeSetsMode); + const result = this.consumeClassContents(); + if (!this.eat(RIGHT_SQUARE_BRACKET)) { + if (this.currentCodePoint === -1) { + this.raise("Unterminated character class"); + } + this.raise("Invalid character in character class"); + } + if (negate && result.mayContainStrings) { + this.raise("Negated character class may contain strings"); + } + this.onCharacterClassLeave(start, this.index, negate); + return result; + } + return null; + } + consumeClassContents() { + if (this._unicodeSetsMode) { + if (this.currentCodePoint === RIGHT_SQUARE_BRACKET) { + return {}; + } + const result = this.consumeClassSetExpression(); + return result; + } + const strict = this.strict || this._unicodeMode; + for (;;) { + const rangeStart = this.index; + if (!this.consumeClassAtom()) { + break; + } + const min = this._lastIntValue; + if (!this.eat(HYPHEN_MINUS)) { + continue; + } + this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS); + if (!this.consumeClassAtom()) { + break; + } + const max = this._lastIntValue; + if (min === -1 || max === -1) { + if (strict) { + this.raise("Invalid character class"); + } + continue; + } + if (min > max) { + this.raise("Range out of order in character class"); + } + this.onCharacterClassRange(rangeStart, this.index, min, max); + } + return {}; + } + consumeClassAtom() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && + cp !== REVERSE_SOLIDUS && + cp !== RIGHT_SQUARE_BRACKET) { + this.advance(); + this._lastIntValue = cp; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.eat(REVERSE_SOLIDUS)) { + if (this.consumeClassEscape()) { + return true; + } + if (!this.strict && + this.currentCodePoint === LATIN_SMALL_LETTER_C) { + this._lastIntValue = REVERSE_SOLIDUS; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.strict || this._unicodeMode) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + consumeClassEscape() { + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_B)) { + this._lastIntValue = BACKSPACE; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + if (this._unicodeMode && this.eat(HYPHEN_MINUS)) { + this._lastIntValue = HYPHEN_MINUS; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + let cp = 0; + if (!this.strict && + !this._unicodeMode && + this.currentCodePoint === LATIN_SMALL_LETTER_C && + (isDecimalDigit((cp = this.nextCodePoint)) || cp === LOW_LINE)) { + this.advance(); + this.advance(); + this._lastIntValue = cp % 0x20; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + return (Boolean(this.consumeCharacterClassEscape()) || + this.consumeCharacterEscape()); + } + consumeClassSetExpression() { + const start = this.index; + let mayContainStrings = false; + let result = null; + if (this.consumeClassSetCharacter()) { + if (this.consumeClassSetRangeFromOperator(start)) { + this.consumeClassUnionRight({}); + return {}; + } + mayContainStrings = false; + } + else if ((result = this.consumeClassSetOperand())) { + mayContainStrings = result.mayContainStrings; + } + else { + const cp = this.currentCodePoint; + if (cp === REVERSE_SOLIDUS) { + this.advance(); + this.raise("Invalid escape"); + } + if (cp === this.nextCodePoint && + isClassSetReservedDoublePunctuatorCharacter(cp)) { + this.raise("Invalid set operation in character class"); + } + this.raise("Invalid character in character class"); + } + if (this.eat2(AMPERSAND, AMPERSAND)) { + while (this.currentCodePoint !== AMPERSAND && + (result = this.consumeClassSetOperand())) { + this.onClassIntersection(start, this.index); + if (!result.mayContainStrings) { + mayContainStrings = false; + } + if (this.eat2(AMPERSAND, AMPERSAND)) { + continue; + } + return { mayContainStrings }; + } + this.raise("Invalid character in character class"); + } + if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) { + while (this.consumeClassSetOperand()) { + this.onClassSubtraction(start, this.index); + if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) { + continue; + } + return { mayContainStrings }; + } + this.raise("Invalid character in character class"); + } + return this.consumeClassUnionRight({ mayContainStrings }); + } + consumeClassUnionRight(leftResult) { + let mayContainStrings = leftResult.mayContainStrings; + for (;;) { + const start = this.index; + if (this.consumeClassSetCharacter()) { + this.consumeClassSetRangeFromOperator(start); + continue; + } + const result = this.consumeClassSetOperand(); + if (result) { + if (result.mayContainStrings) { + mayContainStrings = true; + } + continue; + } + break; + } + return { mayContainStrings }; + } + consumeClassSetRangeFromOperator(start) { + const currentStart = this.index; + const min = this._lastIntValue; + if (this.eat(HYPHEN_MINUS)) { + if (this.consumeClassSetCharacter()) { + const max = this._lastIntValue; + if (min === -1 || max === -1) { + this.raise("Invalid character class"); + } + if (min > max) { + this.raise("Range out of order in character class"); + } + this.onCharacterClassRange(start, this.index, min, max); + return true; + } + this.rewind(currentStart); + } + return false; + } + consumeClassSetOperand() { + let result = null; + if ((result = this.consumeNestedClass())) { + return result; + } + if ((result = this.consumeClassStringDisjunction())) { + return result; + } + if (this.consumeClassSetCharacter()) { + return {}; + } + return null; + } + consumeNestedClass() { + const start = this.index; + if (this.eat(LEFT_SQUARE_BRACKET)) { + const negate = this.eat(CIRCUMFLEX_ACCENT); + this.onCharacterClassEnter(start, negate, true); + const result = this.consumeClassContents(); + if (!this.eat(RIGHT_SQUARE_BRACKET)) { + this.raise("Unterminated character class"); + } + if (negate && result.mayContainStrings) { + this.raise("Negated character class may contain strings"); + } + this.onCharacterClassLeave(start, this.index, negate); + return result; + } + if (this.eat(REVERSE_SOLIDUS)) { + const result = this.consumeCharacterClassEscape(); + if (result) { + return result; + } + this.rewind(start); + } + return null; + } + consumeClassStringDisjunction() { + const start = this.index; + if (this.eat3(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_Q, LEFT_CURLY_BRACKET)) { + this.onClassStringDisjunctionEnter(start); + let i = 0; + let mayContainStrings = false; + do { + if (this.consumeClassString(i++).mayContainStrings) { + mayContainStrings = true; + } + } while (this.eat(VERTICAL_LINE)); + if (this.eat(RIGHT_CURLY_BRACKET)) { + this.onClassStringDisjunctionLeave(start, this.index); + return { mayContainStrings }; + } + this.raise("Unterminated class string disjunction"); + } + return null; + } + consumeClassString(i) { + const start = this.index; + let count = 0; + this.onStringAlternativeEnter(start, i); + while (this.currentCodePoint !== -1 && + this.consumeClassSetCharacter()) { + count++; + } + this.onStringAlternativeLeave(start, this.index, i); + return { mayContainStrings: count !== 1 }; + } + consumeClassSetCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== this.nextCodePoint || + !isClassSetReservedDoublePunctuatorCharacter(cp)) { + if (cp !== -1 && !isClassSetSyntaxCharacter(cp)) { + this._lastIntValue = cp; + this.advance(); + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + } + if (this.eat(REVERSE_SOLIDUS)) { + if (this.consumeCharacterEscape()) { + return true; + } + if (isClassSetReservedPunctuator(this.currentCodePoint)) { + this._lastIntValue = this.currentCodePoint; + this.advance(); + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.eat(LATIN_SMALL_LETTER_B)) { + this._lastIntValue = BACKSPACE; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + this.rewind(start); + } + return false; + } + eatGroupName() { + if (this.eat(LESS_THAN_SIGN)) { + if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) { + return true; + } + this.raise("Invalid capture group name"); + } + return false; + } + eatRegExpIdentifierName() { + if (this.eatRegExpIdentifierStart()) { + this._lastStrValue = String.fromCodePoint(this._lastIntValue); + while (this.eatRegExpIdentifierPart()) { + this._lastStrValue += String.fromCodePoint(this._lastIntValue); + } + return true; + } + return false; + } + eatRegExpIdentifierStart() { + const start = this.index; + const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020; + let cp = this.currentCodePoint; + this.advance(); + if (cp === REVERSE_SOLIDUS && + this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { + cp = this._lastIntValue; + } + else if (forceUFlag && + isLeadSurrogate(cp) && + isTrailSurrogate(this.currentCodePoint)) { + cp = combineSurrogatePair(cp, this.currentCodePoint); + this.advance(); + } + if (isIdentifierStartChar(cp)) { + this._lastIntValue = cp; + return true; + } + if (this.index !== start) { + this.rewind(start); + } + return false; + } + eatRegExpIdentifierPart() { + const start = this.index; + const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020; + let cp = this.currentCodePoint; + this.advance(); + if (cp === REVERSE_SOLIDUS && + this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { + cp = this._lastIntValue; + } + else if (forceUFlag && + isLeadSurrogate(cp) && + isTrailSurrogate(this.currentCodePoint)) { + cp = combineSurrogatePair(cp, this.currentCodePoint); + this.advance(); + } + if (isIdentifierPartChar(cp)) { + this._lastIntValue = cp; + return true; + } + if (this.index !== start) { + this.rewind(start); + } + return false; + } + eatCControlLetter() { + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_C)) { + if (this.eatControlLetter()) { + return true; + } + this.rewind(start); + } + return false; + } + eatZero() { + if (this.currentCodePoint === DIGIT_ZERO && + !isDecimalDigit(this.nextCodePoint)) { + this._lastIntValue = 0; + this.advance(); + return true; + } + return false; + } + eatControlEscape() { + if (this.eat(LATIN_SMALL_LETTER_F)) { + this._lastIntValue = FORM_FEED; + return true; + } + if (this.eat(LATIN_SMALL_LETTER_N)) { + this._lastIntValue = LINE_FEED; + return true; + } + if (this.eat(LATIN_SMALL_LETTER_R)) { + this._lastIntValue = CARRIAGE_RETURN; + return true; + } + if (this.eat(LATIN_SMALL_LETTER_T)) { + this._lastIntValue = CHARACTER_TABULATION; + return true; + } + if (this.eat(LATIN_SMALL_LETTER_V)) { + this._lastIntValue = LINE_TABULATION; + return true; + } + return false; + } + eatControlLetter() { + const cp = this.currentCodePoint; + if (isLatinLetter(cp)) { + this.advance(); + this._lastIntValue = cp % 0x20; + return true; + } + return false; + } + eatRegExpUnicodeEscapeSequence(forceUFlag = false) { + const start = this.index; + const uFlag = forceUFlag || this._unicodeMode; + if (this.eat(LATIN_SMALL_LETTER_U)) { + if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || + this.eatFixedHexDigits(4) || + (uFlag && this.eatRegExpUnicodeCodePointEscape())) { + return true; + } + if (this.strict || uFlag) { + this.raise("Invalid unicode escape"); + } + this.rewind(start); + } + return false; + } + eatRegExpUnicodeSurrogatePairEscape() { + const start = this.index; + if (this.eatFixedHexDigits(4)) { + const lead = this._lastIntValue; + if (isLeadSurrogate(lead) && + this.eat(REVERSE_SOLIDUS) && + this.eat(LATIN_SMALL_LETTER_U) && + this.eatFixedHexDigits(4)) { + const trail = this._lastIntValue; + if (isTrailSurrogate(trail)) { + this._lastIntValue = combineSurrogatePair(lead, trail); + return true; + } + } + this.rewind(start); + } + return false; + } + eatRegExpUnicodeCodePointEscape() { + const start = this.index; + if (this.eat(LEFT_CURLY_BRACKET) && + this.eatHexDigits() && + this.eat(RIGHT_CURLY_BRACKET) && + isValidUnicode(this._lastIntValue)) { + return true; + } + this.rewind(start); + return false; + } + eatIdentityEscape() { + const cp = this.currentCodePoint; + if (this.isValidIdentityEscape(cp)) { + this._lastIntValue = cp; + this.advance(); + return true; + } + return false; + } + isValidIdentityEscape(cp) { + if (cp === -1) { + return false; + } + if (this._unicodeMode) { + return isSyntaxCharacter(cp) || cp === SOLIDUS; + } + if (this.strict) { + return !isIdContinue(cp); + } + if (this._nFlag) { + return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K); + } + return cp !== LATIN_SMALL_LETTER_C; + } + eatDecimalEscape() { + this._lastIntValue = 0; + let cp = this.currentCodePoint; + if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) { + do { + this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO); + this.advance(); + } while ((cp = this.currentCodePoint) >= DIGIT_ZERO && + cp <= DIGIT_NINE); + return true; + } + return false; + } + eatUnicodePropertyValueExpression() { + const start = this.index; + if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) { + const key = this._lastStrValue; + if (this.eatUnicodePropertyValue()) { + const value = this._lastStrValue; + if (isValidUnicodeProperty(this.ecmaVersion, key, value)) { + return { + key, + value: value || null, + }; + } + this.raise("Invalid property name"); + } + } + this.rewind(start); + if (this.eatLoneUnicodePropertyNameOrValue()) { + const nameOrValue = this._lastStrValue; + if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) { + return { + key: "General_Category", + value: nameOrValue || null, + }; + } + if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) { + return { + key: nameOrValue, + value: null, + }; + } + if (this._unicodeSetsMode && + isValidLoneUnicodePropertyOfString(this.ecmaVersion, nameOrValue)) { + return { + key: nameOrValue, + value: null, + strings: true, + }; + } + this.raise("Invalid property name"); + } + return null; + } + eatUnicodePropertyName() { + this._lastStrValue = ""; + while (isUnicodePropertyNameCharacter(this.currentCodePoint)) { + this._lastStrValue += String.fromCodePoint(this.currentCodePoint); + this.advance(); + } + return this._lastStrValue !== ""; + } + eatUnicodePropertyValue() { + this._lastStrValue = ""; + while (isUnicodePropertyValueCharacter(this.currentCodePoint)) { + this._lastStrValue += String.fromCodePoint(this.currentCodePoint); + this.advance(); + } + return this._lastStrValue !== ""; + } + eatLoneUnicodePropertyNameOrValue() { + return this.eatUnicodePropertyValue(); + } + eatHexEscapeSequence() { + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_X)) { + if (this.eatFixedHexDigits(2)) { + return true; + } + if (this._unicodeMode || this.strict) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + eatDecimalDigits() { + const start = this.index; + this._lastIntValue = 0; + while (isDecimalDigit(this.currentCodePoint)) { + this._lastIntValue = + 10 * this._lastIntValue + digitToInt(this.currentCodePoint); + this.advance(); + } + return this.index !== start; + } + eatHexDigits() { + const start = this.index; + this._lastIntValue = 0; + while (isHexDigit(this.currentCodePoint)) { + this._lastIntValue = + 16 * this._lastIntValue + digitToInt(this.currentCodePoint); + this.advance(); + } + return this.index !== start; + } + eatLegacyOctalEscapeSequence() { + if (this.eatOctalDigit()) { + const n1 = this._lastIntValue; + if (this.eatOctalDigit()) { + const n2 = this._lastIntValue; + if (n1 <= 3 && this.eatOctalDigit()) { + this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue; + } + else { + this._lastIntValue = n1 * 8 + n2; + } + } + else { + this._lastIntValue = n1; + } + return true; + } + return false; + } + eatOctalDigit() { + const cp = this.currentCodePoint; + if (isOctalDigit(cp)) { + this.advance(); + this._lastIntValue = cp - DIGIT_ZERO; + return true; + } + this._lastIntValue = 0; + return false; + } + eatFixedHexDigits(length) { + const start = this.index; + this._lastIntValue = 0; + for (let i = 0; i < length; ++i) { + const cp = this.currentCodePoint; + if (!isHexDigit(cp)) { + this.rewind(start); + return false; + } + this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp); + this.advance(); + } + return true; + } + eatModifiers() { + let ate = false; + while (isRegularExpressionModifier(this.currentCodePoint)) { + this.advance(); + ate = true; + } + return ate; + } + parseModifiers(start, end) { + const { ignoreCase, multiline, dotAll } = this.parseFlags(this._reader.source, start, end); + return { ignoreCase, multiline, dotAll }; + } + parseFlags(source, start, end) { + const flags = { + global: false, + ignoreCase: false, + multiline: false, + unicode: false, + sticky: false, + dotAll: false, + hasIndices: false, + unicodeSets: false, + }; + const validFlags = new Set(); + validFlags.add(LATIN_SMALL_LETTER_G); + validFlags.add(LATIN_SMALL_LETTER_I); + validFlags.add(LATIN_SMALL_LETTER_M); + if (this.ecmaVersion >= 2015) { + validFlags.add(LATIN_SMALL_LETTER_U); + validFlags.add(LATIN_SMALL_LETTER_Y); + if (this.ecmaVersion >= 2018) { + validFlags.add(LATIN_SMALL_LETTER_S); + if (this.ecmaVersion >= 2022) { + validFlags.add(LATIN_SMALL_LETTER_D); + if (this.ecmaVersion >= 2024) { + validFlags.add(LATIN_SMALL_LETTER_V); + } + } + } + } + for (let i = start; i < end; ++i) { + const flag = source.charCodeAt(i); + if (validFlags.has(flag)) { + const prop = FLAG_CODEPOINT_TO_PROP[flag]; + if (flags[prop]) { + this.raise(`Duplicated flag '${source[i]}'`, { + index: start, + }); + } + flags[prop] = true; + } + else { + this.raise(`Invalid flag '${source[i]}'`, { index: start }); + } + } + return flags; + } +} + +const DUMMY_PATTERN = {}; +const DUMMY_FLAGS = {}; +const DUMMY_CAPTURING_GROUP = {}; +function isClassSetOperand(node) { + return (node.type === "Character" || + node.type === "CharacterSet" || + node.type === "CharacterClass" || + node.type === "ExpressionCharacterClass" || + node.type === "ClassStringDisjunction"); +} +class RegExpParserState { + constructor(options) { + var _a; + this._node = DUMMY_PATTERN; + this._expressionBufferMap = new Map(); + this._flags = DUMMY_FLAGS; + this._backreferences = []; + this._capturingGroups = []; + this.source = ""; + this.strict = Boolean(options === null || options === void 0 ? void 0 : options.strict); + this.ecmaVersion = (_a = options === null || options === void 0 ? void 0 : options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion; + } + get pattern() { + if (this._node.type !== "Pattern") { + throw new Error("UnknownError"); + } + return this._node; + } + get flags() { + if (this._flags.type !== "Flags") { + throw new Error("UnknownError"); + } + return this._flags; + } + onRegExpFlags(start, end, { global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices, unicodeSets, }) { + this._flags = { + type: "Flags", + parent: null, + start, + end, + raw: this.source.slice(start, end), + global, + ignoreCase, + multiline, + unicode, + sticky, + dotAll, + hasIndices, + unicodeSets, + }; + } + onPatternEnter(start) { + this._node = { + type: "Pattern", + parent: null, + start, + end: start, + raw: "", + alternatives: [], + }; + this._backreferences.length = 0; + this._capturingGroups.length = 0; + } + onPatternLeave(start, end) { + this._node.end = end; + this._node.raw = this.source.slice(start, end); + for (const reference of this._backreferences) { + const ref = reference.ref; + const groups = typeof ref === "number" + ? [this._capturingGroups[ref - 1]] + : this._capturingGroups.filter((g) => g.name === ref); + if (groups.length === 1) { + const group = groups[0]; + reference.ambiguous = false; + reference.resolved = group; + } + else { + reference.ambiguous = true; + reference.resolved = groups; + } + for (const group of groups) { + group.references.push(reference); + } + } + } + onAlternativeEnter(start) { + const parent = this._node; + if (parent.type !== "Assertion" && + parent.type !== "CapturingGroup" && + parent.type !== "Group" && + parent.type !== "Pattern") { + throw new Error("UnknownError"); + } + this._node = { + type: "Alternative", + parent, + start, + end: start, + raw: "", + elements: [], + }; + parent.alternatives.push(this._node); + } + onAlternativeLeave(start, end) { + const node = this._node; + if (node.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onGroupEnter(start) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const group = { + type: "Group", + parent, + start, + end: start, + raw: "", + modifiers: null, + alternatives: [], + }; + this._node = group; + parent.elements.push(this._node); + } + onGroupLeave(start, end) { + const node = this._node; + if (node.type !== "Group" || node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onModifiersEnter(start) { + const parent = this._node; + if (parent.type !== "Group") { + throw new Error("UnknownError"); + } + this._node = { + type: "Modifiers", + parent, + start, + end: start, + raw: "", + add: null, + remove: null, + }; + parent.modifiers = this._node; + } + onModifiersLeave(start, end) { + const node = this._node; + if (node.type !== "Modifiers" || node.parent.type !== "Group") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onAddModifiers(start, end, { ignoreCase, multiline, dotAll, }) { + const parent = this._node; + if (parent.type !== "Modifiers") { + throw new Error("UnknownError"); + } + parent.add = { + type: "ModifierFlags", + parent, + start, + end, + raw: this.source.slice(start, end), + ignoreCase, + multiline, + dotAll, + }; + } + onRemoveModifiers(start, end, { ignoreCase, multiline, dotAll, }) { + const parent = this._node; + if (parent.type !== "Modifiers") { + throw new Error("UnknownError"); + } + parent.remove = { + type: "ModifierFlags", + parent, + start, + end, + raw: this.source.slice(start, end), + ignoreCase, + multiline, + dotAll, + }; + } + onCapturingGroupEnter(start, name) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + this._node = { + type: "CapturingGroup", + parent, + start, + end: start, + raw: "", + name, + alternatives: [], + references: [], + }; + parent.elements.push(this._node); + this._capturingGroups.push(this._node); + } + onCapturingGroupLeave(start, end) { + const node = this._node; + if (node.type !== "CapturingGroup" || + node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onQuantifier(start, end, min, max, greedy) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const element = parent.elements.pop(); + if (element == null || + element.type === "Quantifier" || + (element.type === "Assertion" && element.kind !== "lookahead")) { + throw new Error("UnknownError"); + } + const node = { + type: "Quantifier", + parent, + start: element.start, + end, + raw: this.source.slice(element.start, end), + min, + max, + greedy, + element, + }; + parent.elements.push(node); + element.parent = node; + } + onLookaroundAssertionEnter(start, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const node = (this._node = { + type: "Assertion", + parent, + start, + end: start, + raw: "", + kind, + negate, + alternatives: [], + }); + parent.elements.push(node); + } + onLookaroundAssertionLeave(start, end) { + const node = this._node; + if (node.type !== "Assertion" || node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onEdgeAssertion(start, end, kind) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Assertion", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + }); + } + onWordBoundaryAssertion(start, end, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Assertion", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + negate, + }); + } + onAnyCharacterSet(start, end, kind) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + }); + } + onEscapeCharacterSet(start, end, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + negate, + }); + } + onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + const base = { + type: "CharacterSet", + parent: null, + start, + end, + raw: this.source.slice(start, end), + kind, + strings: null, + key, + }; + if (strings) { + if ((parent.type === "CharacterClass" && !parent.unicodeSets) || + negate || + value !== null) { + throw new Error("UnknownError"); + } + parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate })); + } + else { + parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate })); + } + } + onCharacter(start, end, value) { + const parent = this._node; + if (parent.type !== "Alternative" && + parent.type !== "CharacterClass" && + parent.type !== "StringAlternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Character", + parent, + start, + end, + raw: this.source.slice(start, end), + value, + }); + } + onBackreference(start, end, ref) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const node = { + type: "Backreference", + parent, + start, + end, + raw: this.source.slice(start, end), + ref, + ambiguous: false, + resolved: DUMMY_CAPTURING_GROUP, + }; + parent.elements.push(node); + this._backreferences.push(node); + } + onCharacterClassEnter(start, negate, unicodeSets) { + const parent = this._node; + const base = { + type: "CharacterClass", + parent, + start, + end: start, + raw: "", + unicodeSets, + negate, + elements: [], + }; + if (parent.type === "Alternative") { + const node = Object.assign(Object.assign({}, base), { parent }); + this._node = node; + parent.elements.push(node); + } + else if (parent.type === "CharacterClass" && + parent.unicodeSets && + unicodeSets) { + const node = Object.assign(Object.assign({}, base), { parent, + unicodeSets }); + this._node = node; + parent.elements.push(node); + } + else { + throw new Error("UnknownError"); + } + } + onCharacterClassLeave(start, end) { + const node = this._node; + if (node.type !== "CharacterClass" || + (node.parent.type !== "Alternative" && + node.parent.type !== "CharacterClass")) { + throw new Error("UnknownError"); + } + const parent = node.parent; + node.end = end; + node.raw = this.source.slice(start, end); + this._node = parent; + const expression = this._expressionBufferMap.get(node); + if (!expression) { + return; + } + if (node.elements.length > 0) { + throw new Error("UnknownError"); + } + this._expressionBufferMap.delete(node); + const newNode = { + type: "ExpressionCharacterClass", + parent, + start: node.start, + end: node.end, + raw: node.raw, + negate: node.negate, + expression, + }; + expression.parent = newNode; + if (node !== parent.elements.pop()) { + throw new Error("UnknownError"); + } + parent.elements.push(newNode); + } + onCharacterClassRange(start, end) { + const parent = this._node; + if (parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + const elements = parent.elements; + const max = elements.pop(); + if (!max || max.type !== "Character") { + throw new Error("UnknownError"); + } + if (!parent.unicodeSets) { + const hyphen = elements.pop(); + if (!hyphen || + hyphen.type !== "Character" || + hyphen.value !== HYPHEN_MINUS) { + throw new Error("UnknownError"); + } + } + const min = elements.pop(); + if (!min || min.type !== "Character") { + throw new Error("UnknownError"); + } + const node = { + type: "CharacterClassRange", + parent, + start, + end, + raw: this.source.slice(start, end), + min, + max, + }; + min.parent = node; + max.parent = node; + elements.push(node); + } + onClassIntersection(start, end) { + var _a; + const parent = this._node; + if (parent.type !== "CharacterClass" || !parent.unicodeSets) { + throw new Error("UnknownError"); + } + const right = parent.elements.pop(); + const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop(); + if (!left || + !right || + left.type === "ClassSubtraction" || + (left.type !== "ClassIntersection" && !isClassSetOperand(left)) || + !isClassSetOperand(right)) { + throw new Error("UnknownError"); + } + const node = { + type: "ClassIntersection", + parent: parent, + start, + end, + raw: this.source.slice(start, end), + left, + right, + }; + left.parent = node; + right.parent = node; + this._expressionBufferMap.set(parent, node); + } + onClassSubtraction(start, end) { + var _a; + const parent = this._node; + if (parent.type !== "CharacterClass" || !parent.unicodeSets) { + throw new Error("UnknownError"); + } + const right = parent.elements.pop(); + const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop(); + if (!left || + !right || + left.type === "ClassIntersection" || + (left.type !== "ClassSubtraction" && !isClassSetOperand(left)) || + !isClassSetOperand(right)) { + throw new Error("UnknownError"); + } + const node = { + type: "ClassSubtraction", + parent: parent, + start, + end, + raw: this.source.slice(start, end), + left, + right, + }; + left.parent = node; + right.parent = node; + this._expressionBufferMap.set(parent, node); + } + onClassStringDisjunctionEnter(start) { + const parent = this._node; + if (parent.type !== "CharacterClass" || !parent.unicodeSets) { + throw new Error("UnknownError"); + } + this._node = { + type: "ClassStringDisjunction", + parent, + start, + end: start, + raw: "", + alternatives: [], + }; + parent.elements.push(this._node); + } + onClassStringDisjunctionLeave(start, end) { + const node = this._node; + if (node.type !== "ClassStringDisjunction" || + node.parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onStringAlternativeEnter(start) { + const parent = this._node; + if (parent.type !== "ClassStringDisjunction") { + throw new Error("UnknownError"); + } + this._node = { + type: "StringAlternative", + parent, + start, + end: start, + raw: "", + elements: [], + }; + parent.alternatives.push(this._node); + } + onStringAlternativeLeave(start, end) { + const node = this._node; + if (node.type !== "StringAlternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } +} +class RegExpParser { + constructor(options) { + this._state = new RegExpParserState(options); + this._validator = new RegExpValidator(this._state); + } + parseLiteral(source, start = 0, end = source.length) { + this._state.source = source; + this._validator.validateLiteral(source, start, end); + const pattern = this._state.pattern; + const flags = this._state.flags; + const literal = { + type: "RegExpLiteral", + parent: null, + start, + end, + raw: source, + pattern, + flags, + }; + pattern.parent = literal; + flags.parent = literal; + return literal; + } + parseFlags(source, start = 0, end = source.length) { + this._state.source = source; + this._validator.validateFlags(source, start, end); + return this._state.flags; + } + parsePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) { + this._state.source = source; + this._validator.validatePattern(source, start, end, uFlagOrFlags); + return this._state.pattern; + } +} + +class RegExpVisitor { + constructor(handlers) { + this._handlers = handlers; + } + visit(node) { + switch (node.type) { + case "Alternative": + this.visitAlternative(node); + break; + case "Assertion": + this.visitAssertion(node); + break; + case "Backreference": + this.visitBackreference(node); + break; + case "CapturingGroup": + this.visitCapturingGroup(node); + break; + case "Character": + this.visitCharacter(node); + break; + case "CharacterClass": + this.visitCharacterClass(node); + break; + case "CharacterClassRange": + this.visitCharacterClassRange(node); + break; + case "CharacterSet": + this.visitCharacterSet(node); + break; + case "ClassIntersection": + this.visitClassIntersection(node); + break; + case "ClassStringDisjunction": + this.visitClassStringDisjunction(node); + break; + case "ClassSubtraction": + this.visitClassSubtraction(node); + break; + case "ExpressionCharacterClass": + this.visitExpressionCharacterClass(node); + break; + case "Flags": + this.visitFlags(node); + break; + case "Group": + this.visitGroup(node); + break; + case "Modifiers": + this.visitModifiers(node); + break; + case "ModifierFlags": + this.visitModifierFlags(node); + break; + case "Pattern": + this.visitPattern(node); + break; + case "Quantifier": + this.visitQuantifier(node); + break; + case "RegExpLiteral": + this.visitRegExpLiteral(node); + break; + case "StringAlternative": + this.visitStringAlternative(node); + break; + default: + throw new Error(`Unknown type: ${node.type}`); + } + } + visitAlternative(node) { + if (this._handlers.onAlternativeEnter) { + this._handlers.onAlternativeEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onAlternativeLeave) { + this._handlers.onAlternativeLeave(node); + } + } + visitAssertion(node) { + if (this._handlers.onAssertionEnter) { + this._handlers.onAssertionEnter(node); + } + if (node.kind === "lookahead" || node.kind === "lookbehind") { + node.alternatives.forEach(this.visit, this); + } + if (this._handlers.onAssertionLeave) { + this._handlers.onAssertionLeave(node); + } + } + visitBackreference(node) { + if (this._handlers.onBackreferenceEnter) { + this._handlers.onBackreferenceEnter(node); + } + if (this._handlers.onBackreferenceLeave) { + this._handlers.onBackreferenceLeave(node); + } + } + visitCapturingGroup(node) { + if (this._handlers.onCapturingGroupEnter) { + this._handlers.onCapturingGroupEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onCapturingGroupLeave) { + this._handlers.onCapturingGroupLeave(node); + } + } + visitCharacter(node) { + if (this._handlers.onCharacterEnter) { + this._handlers.onCharacterEnter(node); + } + if (this._handlers.onCharacterLeave) { + this._handlers.onCharacterLeave(node); + } + } + visitCharacterClass(node) { + if (this._handlers.onCharacterClassEnter) { + this._handlers.onCharacterClassEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onCharacterClassLeave) { + this._handlers.onCharacterClassLeave(node); + } + } + visitCharacterClassRange(node) { + if (this._handlers.onCharacterClassRangeEnter) { + this._handlers.onCharacterClassRangeEnter(node); + } + this.visitCharacter(node.min); + this.visitCharacter(node.max); + if (this._handlers.onCharacterClassRangeLeave) { + this._handlers.onCharacterClassRangeLeave(node); + } + } + visitCharacterSet(node) { + if (this._handlers.onCharacterSetEnter) { + this._handlers.onCharacterSetEnter(node); + } + if (this._handlers.onCharacterSetLeave) { + this._handlers.onCharacterSetLeave(node); + } + } + visitClassIntersection(node) { + if (this._handlers.onClassIntersectionEnter) { + this._handlers.onClassIntersectionEnter(node); + } + this.visit(node.left); + this.visit(node.right); + if (this._handlers.onClassIntersectionLeave) { + this._handlers.onClassIntersectionLeave(node); + } + } + visitClassStringDisjunction(node) { + if (this._handlers.onClassStringDisjunctionEnter) { + this._handlers.onClassStringDisjunctionEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onClassStringDisjunctionLeave) { + this._handlers.onClassStringDisjunctionLeave(node); + } + } + visitClassSubtraction(node) { + if (this._handlers.onClassSubtractionEnter) { + this._handlers.onClassSubtractionEnter(node); + } + this.visit(node.left); + this.visit(node.right); + if (this._handlers.onClassSubtractionLeave) { + this._handlers.onClassSubtractionLeave(node); + } + } + visitExpressionCharacterClass(node) { + if (this._handlers.onExpressionCharacterClassEnter) { + this._handlers.onExpressionCharacterClassEnter(node); + } + this.visit(node.expression); + if (this._handlers.onExpressionCharacterClassLeave) { + this._handlers.onExpressionCharacterClassLeave(node); + } + } + visitFlags(node) { + if (this._handlers.onFlagsEnter) { + this._handlers.onFlagsEnter(node); + } + if (this._handlers.onFlagsLeave) { + this._handlers.onFlagsLeave(node); + } + } + visitGroup(node) { + if (this._handlers.onGroupEnter) { + this._handlers.onGroupEnter(node); + } + if (node.modifiers) { + this.visit(node.modifiers); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onGroupLeave) { + this._handlers.onGroupLeave(node); + } + } + visitModifiers(node) { + if (this._handlers.onModifiersEnter) { + this._handlers.onModifiersEnter(node); + } + if (node.add) { + this.visit(node.add); + } + if (node.remove) { + this.visit(node.remove); + } + if (this._handlers.onModifiersLeave) { + this._handlers.onModifiersLeave(node); + } + } + visitModifierFlags(node) { + if (this._handlers.onModifierFlagsEnter) { + this._handlers.onModifierFlagsEnter(node); + } + if (this._handlers.onModifierFlagsLeave) { + this._handlers.onModifierFlagsLeave(node); + } + } + visitPattern(node) { + if (this._handlers.onPatternEnter) { + this._handlers.onPatternEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onPatternLeave) { + this._handlers.onPatternLeave(node); + } + } + visitQuantifier(node) { + if (this._handlers.onQuantifierEnter) { + this._handlers.onQuantifierEnter(node); + } + this.visit(node.element); + if (this._handlers.onQuantifierLeave) { + this._handlers.onQuantifierLeave(node); + } + } + visitRegExpLiteral(node) { + if (this._handlers.onRegExpLiteralEnter) { + this._handlers.onRegExpLiteralEnter(node); + } + this.visitPattern(node.pattern); + this.visitFlags(node.flags); + if (this._handlers.onRegExpLiteralLeave) { + this._handlers.onRegExpLiteralLeave(node); + } + } + visitStringAlternative(node) { + if (this._handlers.onStringAlternativeEnter) { + this._handlers.onStringAlternativeEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onStringAlternativeLeave) { + this._handlers.onStringAlternativeLeave(node); + } + } +} + +function parseRegExpLiteral(source, options) { + return new RegExpParser(options).parseLiteral(String(source)); +} +function validateRegExpLiteral(source, options) { + new RegExpValidator(options).validateLiteral(source); +} +function visitRegExpAST(node, handlers) { + new RegExpVisitor(handlers).visit(node); +} + +exports.AST = ast; +exports.RegExpParser = RegExpParser; +exports.RegExpSyntaxError = RegExpSyntaxError; +exports.RegExpValidator = RegExpValidator; +exports.parseRegExpLiteral = parseRegExpLiteral; +exports.validateRegExpLiteral = validateRegExpLiteral; +exports.visitRegExpAST = visitRegExpAST; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@eslint-community/regexpp/index.js.map b/node_modules/@eslint-community/regexpp/index.js.map new file mode 100644 index 0000000..a13b289 --- /dev/null +++ b/node_modules/@eslint-community/regexpp/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js.map","sources":[".temp/src/ecma-versions.ts",".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/group-specifiers.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@eslint-community/regexpp/index.mjs b/node_modules/@eslint-community/regexpp/index.mjs new file mode 100644 index 0000000..7652c62 --- /dev/null +++ b/node_modules/@eslint-community/regexpp/index.mjs @@ -0,0 +1,3027 @@ +var ast = /*#__PURE__*/Object.freeze({ + __proto__: null +}); + +const latestEcmaVersion = 2025; + +let largeIdStartRanges = undefined; +let largeIdContinueRanges = undefined; +function isIdStart(cp) { + if (cp < 0x41) + return false; + if (cp < 0x5b) + return true; + if (cp < 0x61) + return false; + if (cp < 0x7b) + return true; + return isLargeIdStart(cp); +} +function isIdContinue(cp) { + if (cp < 0x30) + return false; + if (cp < 0x3a) + return true; + if (cp < 0x41) + return false; + if (cp < 0x5b) + return true; + if (cp === 0x5f) + return true; + if (cp < 0x61) + return false; + if (cp < 0x7b) + return true; + return isLargeIdStart(cp) || isLargeIdContinue(cp); +} +function isLargeIdStart(cp) { + return isInRange(cp, largeIdStartRanges !== null && largeIdStartRanges !== void 0 ? largeIdStartRanges : (largeIdStartRanges = initLargeIdStartRanges())); +} +function isLargeIdContinue(cp) { + return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges())); +} +function initLargeIdStartRanges() { + return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 3 0 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 w 1 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 a 6 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1u 3 1 2 0 2 7 m f 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 4 1f d 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 13 r a m 6z 15 7 1 h 2 1o s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 v 9 2 0 3 0 2 11 2 0 q 0 2 0 19 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 5k w w 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 q 32y 6 g6 5a2 t 1cz fs 8 u i 26 i t j 1b h 3 w k 6 i c1 18 5w 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 16 9 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r 6d t 3 0 ds 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk g h9 1wj f1 15v 3t6 6 38f"); +} +function initLargeIdContinueRanges() { + return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1o 8 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r el 1 1e 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 2p 0 n51 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 12 0 ig 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 7 9 w 4 8u 1 28 3 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 1w 8 2 0 3 0 2 3 2 4 2 0 f 1 2b h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 7 j 1m e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f 9j 9 1i 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e a 44m 0 7 e 8uh r 1t3 9 2f 9 13 4 1o 6 q 9 ev 9 d2 0 2 1i 8 3 2a 0 c 1 f58 1 382 9 ef 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d 6t 1 2 9 k6 6 32 6 6 9 3o7 9 gvt3 6n"); +} +function isInRange(cp, ranges) { + let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0; + while (l < r) { + i = ((l + r) / 2) | 0; + min = ranges[2 * i]; + max = ranges[2 * i + 1]; + if (cp < min) { + r = i; + } + else if (cp > max) { + l = i + 1; + } + else { + return true; + } + } + return false; +} +function restoreRanges(data) { + let last = 0; + return data.split(" ").map((s) => (last += parseInt(s, 36) | 0)); +} + +class DataSet { + constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024, raw2025) { + this._raw2018 = raw2018; + this._raw2019 = raw2019; + this._raw2020 = raw2020; + this._raw2021 = raw2021; + this._raw2022 = raw2022; + this._raw2023 = raw2023; + this._raw2024 = raw2024; + this._raw2025 = raw2025; + } + get es2018() { + var _a; + return ((_a = this._set2018) !== null && _a !== void 0 ? _a : (this._set2018 = new Set(this._raw2018.split(" ")))); + } + get es2019() { + var _a; + return ((_a = this._set2019) !== null && _a !== void 0 ? _a : (this._set2019 = new Set(this._raw2019.split(" ")))); + } + get es2020() { + var _a; + return ((_a = this._set2020) !== null && _a !== void 0 ? _a : (this._set2020 = new Set(this._raw2020.split(" ")))); + } + get es2021() { + var _a; + return ((_a = this._set2021) !== null && _a !== void 0 ? _a : (this._set2021 = new Set(this._raw2021.split(" ")))); + } + get es2022() { + var _a; + return ((_a = this._set2022) !== null && _a !== void 0 ? _a : (this._set2022 = new Set(this._raw2022.split(" ")))); + } + get es2023() { + var _a; + return ((_a = this._set2023) !== null && _a !== void 0 ? _a : (this._set2023 = new Set(this._raw2023.split(" ")))); + } + get es2024() { + var _a; + return ((_a = this._set2024) !== null && _a !== void 0 ? _a : (this._set2024 = new Set(this._raw2024.split(" ")))); + } + get es2025() { + var _a; + return ((_a = this._set2025) !== null && _a !== void 0 ? _a : (this._set2025 = new Set(this._raw2025.split(" ")))); + } +} +const gcNameSet = new Set(["General_Category", "gc"]); +const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]); +const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "", ""); +const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", "", ""); +const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "", ""); +const binPropertyOfStringsSets = new DataSet("", "", "", "", "", "", "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence", ""); +function isValidUnicodeProperty(version, name, value) { + if (gcNameSet.has(name)) { + return version >= 2018 && gcValueSets.es2018.has(value); + } + if (scNameSet.has(name)) { + return ((version >= 2018 && scValueSets.es2018.has(value)) || + (version >= 2019 && scValueSets.es2019.has(value)) || + (version >= 2020 && scValueSets.es2020.has(value)) || + (version >= 2021 && scValueSets.es2021.has(value)) || + (version >= 2022 && scValueSets.es2022.has(value)) || + (version >= 2023 && scValueSets.es2023.has(value))); + } + return false; +} +function isValidLoneUnicodeProperty(version, value) { + return ((version >= 2018 && binPropertySets.es2018.has(value)) || + (version >= 2019 && binPropertySets.es2019.has(value)) || + (version >= 2021 && binPropertySets.es2021.has(value))); +} +function isValidLoneUnicodePropertyOfString(version, value) { + return version >= 2024 && binPropertyOfStringsSets.es2024.has(value); +} + +const BACKSPACE = 0x08; +const CHARACTER_TABULATION = 0x09; +const LINE_FEED = 0x0a; +const LINE_TABULATION = 0x0b; +const FORM_FEED = 0x0c; +const CARRIAGE_RETURN = 0x0d; +const EXCLAMATION_MARK = 0x21; +const NUMBER_SIGN = 0x23; +const DOLLAR_SIGN = 0x24; +const PERCENT_SIGN = 0x25; +const AMPERSAND = 0x26; +const LEFT_PARENTHESIS = 0x28; +const RIGHT_PARENTHESIS = 0x29; +const ASTERISK = 0x2a; +const PLUS_SIGN = 0x2b; +const COMMA = 0x2c; +const HYPHEN_MINUS = 0x2d; +const FULL_STOP = 0x2e; +const SOLIDUS = 0x2f; +const DIGIT_ZERO = 0x30; +const DIGIT_ONE = 0x31; +const DIGIT_SEVEN = 0x37; +const DIGIT_NINE = 0x39; +const COLON = 0x3a; +const SEMICOLON = 0x3b; +const LESS_THAN_SIGN = 0x3c; +const EQUALS_SIGN = 0x3d; +const GREATER_THAN_SIGN = 0x3e; +const QUESTION_MARK = 0x3f; +const COMMERCIAL_AT = 0x40; +const LATIN_CAPITAL_LETTER_A = 0x41; +const LATIN_CAPITAL_LETTER_B = 0x42; +const LATIN_CAPITAL_LETTER_D = 0x44; +const LATIN_CAPITAL_LETTER_F = 0x46; +const LATIN_CAPITAL_LETTER_P = 0x50; +const LATIN_CAPITAL_LETTER_S = 0x53; +const LATIN_CAPITAL_LETTER_W = 0x57; +const LATIN_CAPITAL_LETTER_Z = 0x5a; +const LOW_LINE = 0x5f; +const LATIN_SMALL_LETTER_A = 0x61; +const LATIN_SMALL_LETTER_B = 0x62; +const LATIN_SMALL_LETTER_C = 0x63; +const LATIN_SMALL_LETTER_D = 0x64; +const LATIN_SMALL_LETTER_F = 0x66; +const LATIN_SMALL_LETTER_G = 0x67; +const LATIN_SMALL_LETTER_I = 0x69; +const LATIN_SMALL_LETTER_K = 0x6b; +const LATIN_SMALL_LETTER_M = 0x6d; +const LATIN_SMALL_LETTER_N = 0x6e; +const LATIN_SMALL_LETTER_P = 0x70; +const LATIN_SMALL_LETTER_Q = 0x71; +const LATIN_SMALL_LETTER_R = 0x72; +const LATIN_SMALL_LETTER_S = 0x73; +const LATIN_SMALL_LETTER_T = 0x74; +const LATIN_SMALL_LETTER_U = 0x75; +const LATIN_SMALL_LETTER_V = 0x76; +const LATIN_SMALL_LETTER_W = 0x77; +const LATIN_SMALL_LETTER_X = 0x78; +const LATIN_SMALL_LETTER_Y = 0x79; +const LATIN_SMALL_LETTER_Z = 0x7a; +const LEFT_SQUARE_BRACKET = 0x5b; +const REVERSE_SOLIDUS = 0x5c; +const RIGHT_SQUARE_BRACKET = 0x5d; +const CIRCUMFLEX_ACCENT = 0x5e; +const GRAVE_ACCENT = 0x60; +const LEFT_CURLY_BRACKET = 0x7b; +const VERTICAL_LINE = 0x7c; +const RIGHT_CURLY_BRACKET = 0x7d; +const TILDE = 0x7e; +const ZERO_WIDTH_NON_JOINER = 0x200c; +const ZERO_WIDTH_JOINER = 0x200d; +const LINE_SEPARATOR = 0x2028; +const PARAGRAPH_SEPARATOR = 0x2029; +const MIN_CODE_POINT = 0x00; +const MAX_CODE_POINT = 0x10ffff; +function isLatinLetter(code) { + return ((code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z) || + (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z)); +} +function isDecimalDigit(code) { + return code >= DIGIT_ZERO && code <= DIGIT_NINE; +} +function isOctalDigit(code) { + return code >= DIGIT_ZERO && code <= DIGIT_SEVEN; +} +function isHexDigit(code) { + return ((code >= DIGIT_ZERO && code <= DIGIT_NINE) || + (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) || + (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F)); +} +function isLineTerminator(code) { + return (code === LINE_FEED || + code === CARRIAGE_RETURN || + code === LINE_SEPARATOR || + code === PARAGRAPH_SEPARATOR); +} +function isValidUnicode(code) { + return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT; +} +function digitToInt(code) { + if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) { + return code - LATIN_SMALL_LETTER_A + 10; + } + if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) { + return code - LATIN_CAPITAL_LETTER_A + 10; + } + return code - DIGIT_ZERO; +} +function isLeadSurrogate(code) { + return code >= 0xd800 && code <= 0xdbff; +} +function isTrailSurrogate(code) { + return code >= 0xdc00 && code <= 0xdfff; +} +function combineSurrogatePair(lead, trail) { + return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; +} + +class GroupSpecifiersAsES2018 { + constructor() { + this.groupName = new Set(); + } + clear() { + this.groupName.clear(); + } + isEmpty() { + return !this.groupName.size; + } + hasInPattern(name) { + return this.groupName.has(name); + } + hasInScope(name) { + return this.hasInPattern(name); + } + addToScope(name) { + this.groupName.add(name); + } + enterDisjunction() { + } + enterAlternative() { + } + leaveDisjunction() { + } +} +class BranchID { + constructor(parent, base) { + this.parent = parent; + this.base = base !== null && base !== void 0 ? base : this; + } + separatedFrom(other) { + var _a, _b; + if (this.base === other.base && this !== other) { + return true; + } + if (other.parent && this.separatedFrom(other.parent)) { + return true; + } + return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.separatedFrom(other)) !== null && _b !== void 0 ? _b : false; + } + child() { + return new BranchID(this, null); + } + sibling() { + return new BranchID(this.parent, this.base); + } +} +class GroupSpecifiersAsES2025 { + constructor() { + this.branchID = new BranchID(null, null); + this.groupNames = new Map(); + } + clear() { + this.branchID = new BranchID(null, null); + this.groupNames.clear(); + } + isEmpty() { + return !this.groupNames.size; + } + enterDisjunction() { + this.branchID = this.branchID.child(); + } + enterAlternative(index) { + if (index === 0) { + return; + } + this.branchID = this.branchID.sibling(); + } + leaveDisjunction() { + this.branchID = this.branchID.parent; + } + hasInPattern(name) { + return this.groupNames.has(name); + } + hasInScope(name) { + const branches = this.groupNames.get(name); + if (!branches) { + return false; + } + for (const branch of branches) { + if (!branch.separatedFrom(this.branchID)) { + return true; + } + } + return false; + } + addToScope(name) { + const branches = this.groupNames.get(name); + if (branches) { + branches.push(this.branchID); + return; + } + this.groupNames.set(name, [this.branchID]); + } +} + +const legacyImpl = { + at(s, end, i) { + return i < end ? s.charCodeAt(i) : -1; + }, + width(c) { + return 1; + }, +}; +const unicodeImpl = { + at(s, end, i) { + return i < end ? s.codePointAt(i) : -1; + }, + width(c) { + return c > 0xffff ? 2 : 1; + }, +}; +class Reader { + constructor() { + this._impl = legacyImpl; + this._s = ""; + this._i = 0; + this._end = 0; + this._cp1 = -1; + this._w1 = 1; + this._cp2 = -1; + this._w2 = 1; + this._cp3 = -1; + this._w3 = 1; + this._cp4 = -1; + } + get source() { + return this._s; + } + get index() { + return this._i; + } + get currentCodePoint() { + return this._cp1; + } + get nextCodePoint() { + return this._cp2; + } + get nextCodePoint2() { + return this._cp3; + } + get nextCodePoint3() { + return this._cp4; + } + reset(source, start, end, uFlag) { + this._impl = uFlag ? unicodeImpl : legacyImpl; + this._s = source; + this._end = end; + this.rewind(start); + } + rewind(index) { + const impl = this._impl; + this._i = index; + this._cp1 = impl.at(this._s, this._end, index); + this._w1 = impl.width(this._cp1); + this._cp2 = impl.at(this._s, this._end, index + this._w1); + this._w2 = impl.width(this._cp2); + this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2); + this._w3 = impl.width(this._cp3); + this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3); + } + advance() { + if (this._cp1 !== -1) { + const impl = this._impl; + this._i += this._w1; + this._cp1 = this._cp2; + this._w1 = this._w2; + this._cp2 = this._cp3; + this._w2 = impl.width(this._cp2); + this._cp3 = this._cp4; + this._w3 = impl.width(this._cp3); + this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3); + } + } + eat(cp) { + if (this._cp1 === cp) { + this.advance(); + return true; + } + return false; + } + eat2(cp1, cp2) { + if (this._cp1 === cp1 && this._cp2 === cp2) { + this.advance(); + this.advance(); + return true; + } + return false; + } + eat3(cp1, cp2, cp3) { + if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) { + this.advance(); + this.advance(); + this.advance(); + return true; + } + return false; + } +} + +class RegExpSyntaxError extends SyntaxError { + constructor(message, index) { + super(message); + this.index = index; + } +} +function newRegExpSyntaxError(srcCtx, flags, index, message) { + let source = ""; + if (srcCtx.kind === "literal") { + const literal = srcCtx.source.slice(srcCtx.start, srcCtx.end); + if (literal) { + source = `: ${literal}`; + } + } + else if (srcCtx.kind === "pattern") { + const pattern = srcCtx.source.slice(srcCtx.start, srcCtx.end); + const flagsText = `${flags.unicode ? "u" : ""}${flags.unicodeSets ? "v" : ""}`; + source = `: /${pattern}/${flagsText}`; + } + return new RegExpSyntaxError(`Invalid regular expression${source}: ${message}`, index); +} + +const SYNTAX_CHARACTER = new Set([ + CIRCUMFLEX_ACCENT, + DOLLAR_SIGN, + REVERSE_SOLIDUS, + FULL_STOP, + ASTERISK, + PLUS_SIGN, + QUESTION_MARK, + LEFT_PARENTHESIS, + RIGHT_PARENTHESIS, + LEFT_SQUARE_BRACKET, + RIGHT_SQUARE_BRACKET, + LEFT_CURLY_BRACKET, + RIGHT_CURLY_BRACKET, + VERTICAL_LINE, +]); +const CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER = new Set([ + AMPERSAND, + EXCLAMATION_MARK, + NUMBER_SIGN, + DOLLAR_SIGN, + PERCENT_SIGN, + ASTERISK, + PLUS_SIGN, + COMMA, + FULL_STOP, + COLON, + SEMICOLON, + LESS_THAN_SIGN, + EQUALS_SIGN, + GREATER_THAN_SIGN, + QUESTION_MARK, + COMMERCIAL_AT, + CIRCUMFLEX_ACCENT, + GRAVE_ACCENT, + TILDE, +]); +const CLASS_SET_SYNTAX_CHARACTER = new Set([ + LEFT_PARENTHESIS, + RIGHT_PARENTHESIS, + LEFT_SQUARE_BRACKET, + RIGHT_SQUARE_BRACKET, + LEFT_CURLY_BRACKET, + RIGHT_CURLY_BRACKET, + SOLIDUS, + HYPHEN_MINUS, + REVERSE_SOLIDUS, + VERTICAL_LINE, +]); +const CLASS_SET_RESERVED_PUNCTUATOR = new Set([ + AMPERSAND, + HYPHEN_MINUS, + EXCLAMATION_MARK, + NUMBER_SIGN, + PERCENT_SIGN, + COMMA, + COLON, + SEMICOLON, + LESS_THAN_SIGN, + EQUALS_SIGN, + GREATER_THAN_SIGN, + COMMERCIAL_AT, + GRAVE_ACCENT, + TILDE, +]); +const FLAG_PROP_TO_CODEPOINT = { + global: LATIN_SMALL_LETTER_G, + ignoreCase: LATIN_SMALL_LETTER_I, + multiline: LATIN_SMALL_LETTER_M, + unicode: LATIN_SMALL_LETTER_U, + sticky: LATIN_SMALL_LETTER_Y, + dotAll: LATIN_SMALL_LETTER_S, + hasIndices: LATIN_SMALL_LETTER_D, + unicodeSets: LATIN_SMALL_LETTER_V, +}; +const FLAG_CODEPOINT_TO_PROP = Object.fromEntries(Object.entries(FLAG_PROP_TO_CODEPOINT).map(([k, v]) => [v, k])); +function isSyntaxCharacter(cp) { + return SYNTAX_CHARACTER.has(cp); +} +function isClassSetReservedDoublePunctuatorCharacter(cp) { + return CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER.has(cp); +} +function isClassSetSyntaxCharacter(cp) { + return CLASS_SET_SYNTAX_CHARACTER.has(cp); +} +function isClassSetReservedPunctuator(cp) { + return CLASS_SET_RESERVED_PUNCTUATOR.has(cp); +} +function isIdentifierStartChar(cp) { + return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE; +} +function isIdentifierPartChar(cp) { + return (isIdContinue(cp) || + cp === DOLLAR_SIGN || + cp === ZERO_WIDTH_NON_JOINER || + cp === ZERO_WIDTH_JOINER); +} +function isUnicodePropertyNameCharacter(cp) { + return isLatinLetter(cp) || cp === LOW_LINE; +} +function isUnicodePropertyValueCharacter(cp) { + return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); +} +function isRegularExpressionModifier(ch) { + return (ch === LATIN_SMALL_LETTER_I || + ch === LATIN_SMALL_LETTER_M || + ch === LATIN_SMALL_LETTER_S); +} +class RegExpValidator { + constructor(options) { + this._reader = new Reader(); + this._unicodeMode = false; + this._unicodeSetsMode = false; + this._nFlag = false; + this._lastIntValue = 0; + this._lastRange = { + min: 0, + max: Number.POSITIVE_INFINITY, + }; + this._lastStrValue = ""; + this._lastAssertionIsQuantifiable = false; + this._numCapturingParens = 0; + this._backreferenceNames = new Set(); + this._srcCtx = null; + this._options = options !== null && options !== void 0 ? options : {}; + this._groupSpecifiers = + this.ecmaVersion >= 2025 + ? new GroupSpecifiersAsES2025() + : new GroupSpecifiersAsES2018(); + } + validateLiteral(source, start = 0, end = source.length) { + this._srcCtx = { source, start, end, kind: "literal" }; + this._unicodeSetsMode = this._unicodeMode = this._nFlag = false; + this.reset(source, start, end); + this.onLiteralEnter(start); + if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) { + const flagStart = this.index; + const unicode = source.includes("u", flagStart); + const unicodeSets = source.includes("v", flagStart); + this.validateFlagsInternal(source, flagStart, end); + this.validatePatternInternal(source, start + 1, flagStart - 1, { + unicode, + unicodeSets, + }); + } + else if (start >= end) { + this.raise("Empty"); + } + else { + const c = String.fromCodePoint(this.currentCodePoint); + this.raise(`Unexpected character '${c}'`); + } + this.onLiteralLeave(start, end); + } + validateFlags(source, start = 0, end = source.length) { + this._srcCtx = { source, start, end, kind: "flags" }; + this.validateFlagsInternal(source, start, end); + } + validatePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) { + this._srcCtx = { source, start, end, kind: "pattern" }; + this.validatePatternInternal(source, start, end, uFlagOrFlags); + } + validatePatternInternal(source, start = 0, end = source.length, uFlagOrFlags = undefined) { + const mode = this._parseFlagsOptionToMode(uFlagOrFlags, end); + this._unicodeMode = mode.unicodeMode; + this._nFlag = mode.nFlag; + this._unicodeSetsMode = mode.unicodeSetsMode; + this.reset(source, start, end); + this.consumePattern(); + if (!this._nFlag && + this.ecmaVersion >= 2018 && + !this._groupSpecifiers.isEmpty()) { + this._nFlag = true; + this.rewind(start); + this.consumePattern(); + } + } + validateFlagsInternal(source, start, end) { + const flags = this.parseFlags(source, start, end); + this.onRegExpFlags(start, end, flags); + } + _parseFlagsOptionToMode(uFlagOrFlags, sourceEnd) { + let unicode = false; + let unicodeSets = false; + if (uFlagOrFlags && this.ecmaVersion >= 2015) { + if (typeof uFlagOrFlags === "object") { + unicode = Boolean(uFlagOrFlags.unicode); + if (this.ecmaVersion >= 2024) { + unicodeSets = Boolean(uFlagOrFlags.unicodeSets); + } + } + else { + unicode = uFlagOrFlags; + } + } + if (unicode && unicodeSets) { + this.raise("Invalid regular expression flags", { + index: sourceEnd + 1, + unicode, + unicodeSets, + }); + } + const unicodeMode = unicode || unicodeSets; + const nFlag = (unicode && this.ecmaVersion >= 2018) || + unicodeSets || + Boolean(this._options.strict && this.ecmaVersion >= 2023); + const unicodeSetsMode = unicodeSets; + return { unicodeMode, nFlag, unicodeSetsMode }; + } + get strict() { + return Boolean(this._options.strict) || this._unicodeMode; + } + get ecmaVersion() { + var _a; + return (_a = this._options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion; + } + onLiteralEnter(start) { + if (this._options.onLiteralEnter) { + this._options.onLiteralEnter(start); + } + } + onLiteralLeave(start, end) { + if (this._options.onLiteralLeave) { + this._options.onLiteralLeave(start, end); + } + } + onRegExpFlags(start, end, flags) { + if (this._options.onRegExpFlags) { + this._options.onRegExpFlags(start, end, flags); + } + if (this._options.onFlags) { + this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices); + } + } + onPatternEnter(start) { + if (this._options.onPatternEnter) { + this._options.onPatternEnter(start); + } + } + onPatternLeave(start, end) { + if (this._options.onPatternLeave) { + this._options.onPatternLeave(start, end); + } + } + onDisjunctionEnter(start) { + if (this._options.onDisjunctionEnter) { + this._options.onDisjunctionEnter(start); + } + } + onDisjunctionLeave(start, end) { + if (this._options.onDisjunctionLeave) { + this._options.onDisjunctionLeave(start, end); + } + } + onAlternativeEnter(start, index) { + if (this._options.onAlternativeEnter) { + this._options.onAlternativeEnter(start, index); + } + } + onAlternativeLeave(start, end, index) { + if (this._options.onAlternativeLeave) { + this._options.onAlternativeLeave(start, end, index); + } + } + onGroupEnter(start) { + if (this._options.onGroupEnter) { + this._options.onGroupEnter(start); + } + } + onGroupLeave(start, end) { + if (this._options.onGroupLeave) { + this._options.onGroupLeave(start, end); + } + } + onModifiersEnter(start) { + if (this._options.onModifiersEnter) { + this._options.onModifiersEnter(start); + } + } + onModifiersLeave(start, end) { + if (this._options.onModifiersLeave) { + this._options.onModifiersLeave(start, end); + } + } + onAddModifiers(start, end, flags) { + if (this._options.onAddModifiers) { + this._options.onAddModifiers(start, end, flags); + } + } + onRemoveModifiers(start, end, flags) { + if (this._options.onRemoveModifiers) { + this._options.onRemoveModifiers(start, end, flags); + } + } + onCapturingGroupEnter(start, name) { + if (this._options.onCapturingGroupEnter) { + this._options.onCapturingGroupEnter(start, name); + } + } + onCapturingGroupLeave(start, end, name) { + if (this._options.onCapturingGroupLeave) { + this._options.onCapturingGroupLeave(start, end, name); + } + } + onQuantifier(start, end, min, max, greedy) { + if (this._options.onQuantifier) { + this._options.onQuantifier(start, end, min, max, greedy); + } + } + onLookaroundAssertionEnter(start, kind, negate) { + if (this._options.onLookaroundAssertionEnter) { + this._options.onLookaroundAssertionEnter(start, kind, negate); + } + } + onLookaroundAssertionLeave(start, end, kind, negate) { + if (this._options.onLookaroundAssertionLeave) { + this._options.onLookaroundAssertionLeave(start, end, kind, negate); + } + } + onEdgeAssertion(start, end, kind) { + if (this._options.onEdgeAssertion) { + this._options.onEdgeAssertion(start, end, kind); + } + } + onWordBoundaryAssertion(start, end, kind, negate) { + if (this._options.onWordBoundaryAssertion) { + this._options.onWordBoundaryAssertion(start, end, kind, negate); + } + } + onAnyCharacterSet(start, end, kind) { + if (this._options.onAnyCharacterSet) { + this._options.onAnyCharacterSet(start, end, kind); + } + } + onEscapeCharacterSet(start, end, kind, negate) { + if (this._options.onEscapeCharacterSet) { + this._options.onEscapeCharacterSet(start, end, kind, negate); + } + } + onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) { + if (this._options.onUnicodePropertyCharacterSet) { + this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings); + } + } + onCharacter(start, end, value) { + if (this._options.onCharacter) { + this._options.onCharacter(start, end, value); + } + } + onBackreference(start, end, ref) { + if (this._options.onBackreference) { + this._options.onBackreference(start, end, ref); + } + } + onCharacterClassEnter(start, negate, unicodeSets) { + if (this._options.onCharacterClassEnter) { + this._options.onCharacterClassEnter(start, negate, unicodeSets); + } + } + onCharacterClassLeave(start, end, negate) { + if (this._options.onCharacterClassLeave) { + this._options.onCharacterClassLeave(start, end, negate); + } + } + onCharacterClassRange(start, end, min, max) { + if (this._options.onCharacterClassRange) { + this._options.onCharacterClassRange(start, end, min, max); + } + } + onClassIntersection(start, end) { + if (this._options.onClassIntersection) { + this._options.onClassIntersection(start, end); + } + } + onClassSubtraction(start, end) { + if (this._options.onClassSubtraction) { + this._options.onClassSubtraction(start, end); + } + } + onClassStringDisjunctionEnter(start) { + if (this._options.onClassStringDisjunctionEnter) { + this._options.onClassStringDisjunctionEnter(start); + } + } + onClassStringDisjunctionLeave(start, end) { + if (this._options.onClassStringDisjunctionLeave) { + this._options.onClassStringDisjunctionLeave(start, end); + } + } + onStringAlternativeEnter(start, index) { + if (this._options.onStringAlternativeEnter) { + this._options.onStringAlternativeEnter(start, index); + } + } + onStringAlternativeLeave(start, end, index) { + if (this._options.onStringAlternativeLeave) { + this._options.onStringAlternativeLeave(start, end, index); + } + } + get index() { + return this._reader.index; + } + get currentCodePoint() { + return this._reader.currentCodePoint; + } + get nextCodePoint() { + return this._reader.nextCodePoint; + } + get nextCodePoint2() { + return this._reader.nextCodePoint2; + } + get nextCodePoint3() { + return this._reader.nextCodePoint3; + } + reset(source, start, end) { + this._reader.reset(source, start, end, this._unicodeMode); + } + rewind(index) { + this._reader.rewind(index); + } + advance() { + this._reader.advance(); + } + eat(cp) { + return this._reader.eat(cp); + } + eat2(cp1, cp2) { + return this._reader.eat2(cp1, cp2); + } + eat3(cp1, cp2, cp3) { + return this._reader.eat3(cp1, cp2, cp3); + } + raise(message, context) { + var _a, _b, _c; + throw newRegExpSyntaxError(this._srcCtx, { + unicode: (_a = context === null || context === void 0 ? void 0 : context.unicode) !== null && _a !== void 0 ? _a : (this._unicodeMode && !this._unicodeSetsMode), + unicodeSets: (_b = context === null || context === void 0 ? void 0 : context.unicodeSets) !== null && _b !== void 0 ? _b : this._unicodeSetsMode, + }, (_c = context === null || context === void 0 ? void 0 : context.index) !== null && _c !== void 0 ? _c : this.index, message); + } + eatRegExpBody() { + const start = this.index; + let inClass = false; + let escaped = false; + for (;;) { + const cp = this.currentCodePoint; + if (cp === -1 || isLineTerminator(cp)) { + const kind = inClass ? "character class" : "regular expression"; + this.raise(`Unterminated ${kind}`); + } + if (escaped) { + escaped = false; + } + else if (cp === REVERSE_SOLIDUS) { + escaped = true; + } + else if (cp === LEFT_SQUARE_BRACKET) { + inClass = true; + } + else if (cp === RIGHT_SQUARE_BRACKET) { + inClass = false; + } + else if ((cp === SOLIDUS && !inClass) || + (cp === ASTERISK && this.index === start)) { + break; + } + this.advance(); + } + return this.index !== start; + } + consumePattern() { + const start = this.index; + this._numCapturingParens = this.countCapturingParens(); + this._groupSpecifiers.clear(); + this._backreferenceNames.clear(); + this.onPatternEnter(start); + this.consumeDisjunction(); + const cp = this.currentCodePoint; + if (this.currentCodePoint !== -1) { + if (cp === RIGHT_PARENTHESIS) { + this.raise("Unmatched ')'"); + } + if (cp === REVERSE_SOLIDUS) { + this.raise("\\ at end of pattern"); + } + if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) { + this.raise("Lone quantifier brackets"); + } + const c = String.fromCodePoint(cp); + this.raise(`Unexpected character '${c}'`); + } + for (const name of this._backreferenceNames) { + if (!this._groupSpecifiers.hasInPattern(name)) { + this.raise("Invalid named capture referenced"); + } + } + this.onPatternLeave(start, this.index); + } + countCapturingParens() { + const start = this.index; + let inClass = false; + let escaped = false; + let count = 0; + let cp = 0; + while ((cp = this.currentCodePoint) !== -1) { + if (escaped) { + escaped = false; + } + else if (cp === REVERSE_SOLIDUS) { + escaped = true; + } + else if (cp === LEFT_SQUARE_BRACKET) { + inClass = true; + } + else if (cp === RIGHT_SQUARE_BRACKET) { + inClass = false; + } + else if (cp === LEFT_PARENTHESIS && + !inClass && + (this.nextCodePoint !== QUESTION_MARK || + (this.nextCodePoint2 === LESS_THAN_SIGN && + this.nextCodePoint3 !== EQUALS_SIGN && + this.nextCodePoint3 !== EXCLAMATION_MARK))) { + count += 1; + } + this.advance(); + } + this.rewind(start); + return count; + } + consumeDisjunction() { + const start = this.index; + let i = 0; + this._groupSpecifiers.enterDisjunction(); + this.onDisjunctionEnter(start); + do { + this.consumeAlternative(i++); + } while (this.eat(VERTICAL_LINE)); + if (this.consumeQuantifier(true)) { + this.raise("Nothing to repeat"); + } + if (this.eat(LEFT_CURLY_BRACKET)) { + this.raise("Lone quantifier brackets"); + } + this.onDisjunctionLeave(start, this.index); + this._groupSpecifiers.leaveDisjunction(); + } + consumeAlternative(i) { + const start = this.index; + this._groupSpecifiers.enterAlternative(i); + this.onAlternativeEnter(start, i); + while (this.currentCodePoint !== -1 && this.consumeTerm()) { + } + this.onAlternativeLeave(start, this.index, i); + } + consumeTerm() { + if (this._unicodeMode || this.strict) { + return (this.consumeAssertion() || + (this.consumeAtom() && this.consumeOptionalQuantifier())); + } + return ((this.consumeAssertion() && + (!this._lastAssertionIsQuantifiable || + this.consumeOptionalQuantifier())) || + (this.consumeExtendedAtom() && this.consumeOptionalQuantifier())); + } + consumeOptionalQuantifier() { + this.consumeQuantifier(); + return true; + } + consumeAssertion() { + const start = this.index; + this._lastAssertionIsQuantifiable = false; + if (this.eat(CIRCUMFLEX_ACCENT)) { + this.onEdgeAssertion(start, this.index, "start"); + return true; + } + if (this.eat(DOLLAR_SIGN)) { + this.onEdgeAssertion(start, this.index, "end"); + return true; + } + if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) { + this.onWordBoundaryAssertion(start, this.index, "word", true); + return true; + } + if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) { + this.onWordBoundaryAssertion(start, this.index, "word", false); + return true; + } + if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) { + const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN); + let negate = false; + if (this.eat(EQUALS_SIGN) || + (negate = this.eat(EXCLAMATION_MARK))) { + const kind = lookbehind ? "lookbehind" : "lookahead"; + this.onLookaroundAssertionEnter(start, kind, negate); + this.consumeDisjunction(); + if (!this.eat(RIGHT_PARENTHESIS)) { + this.raise("Unterminated group"); + } + this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; + this.onLookaroundAssertionLeave(start, this.index, kind, negate); + return true; + } + this.rewind(start); + } + return false; + } + consumeQuantifier(noConsume = false) { + const start = this.index; + let min = 0; + let max = 0; + let greedy = false; + if (this.eat(ASTERISK)) { + min = 0; + max = Number.POSITIVE_INFINITY; + } + else if (this.eat(PLUS_SIGN)) { + min = 1; + max = Number.POSITIVE_INFINITY; + } + else if (this.eat(QUESTION_MARK)) { + min = 0; + max = 1; + } + else if (this.eatBracedQuantifier(noConsume)) { + ({ min, max } = this._lastRange); + } + else { + return false; + } + greedy = !this.eat(QUESTION_MARK); + if (!noConsume) { + this.onQuantifier(start, this.index, min, max, greedy); + } + return true; + } + eatBracedQuantifier(noError) { + const start = this.index; + if (this.eat(LEFT_CURLY_BRACKET)) { + if (this.eatDecimalDigits()) { + const min = this._lastIntValue; + let max = min; + if (this.eat(COMMA)) { + max = this.eatDecimalDigits() + ? this._lastIntValue + : Number.POSITIVE_INFINITY; + } + if (this.eat(RIGHT_CURLY_BRACKET)) { + if (!noError && max < min) { + this.raise("numbers out of order in {} quantifier"); + } + this._lastRange = { min, max }; + return true; + } + } + if (!noError && (this._unicodeMode || this.strict)) { + this.raise("Incomplete quantifier"); + } + this.rewind(start); + } + return false; + } + consumeAtom() { + return (this.consumePatternCharacter() || + this.consumeDot() || + this.consumeReverseSolidusAtomEscape() || + Boolean(this.consumeCharacterClass()) || + this.consumeCapturingGroup() || + this.consumeUncapturingGroup()); + } + consumeDot() { + if (this.eat(FULL_STOP)) { + this.onAnyCharacterSet(this.index - 1, this.index, "any"); + return true; + } + return false; + } + consumeReverseSolidusAtomEscape() { + const start = this.index; + if (this.eat(REVERSE_SOLIDUS)) { + if (this.consumeAtomEscape()) { + return true; + } + this.rewind(start); + } + return false; + } + consumeUncapturingGroup() { + const start = this.index; + if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) { + this.onGroupEnter(start); + if (this.ecmaVersion >= 2025) { + this.consumeModifiers(); + } + if (!this.eat(COLON)) { + this.rewind(start + 1); + this.raise("Invalid group"); + } + this.consumeDisjunction(); + if (!this.eat(RIGHT_PARENTHESIS)) { + this.raise("Unterminated group"); + } + this.onGroupLeave(start, this.index); + return true; + } + return false; + } + consumeModifiers() { + const start = this.index; + const hasAddModifiers = this.eatModifiers(); + const addModifiersEnd = this.index; + const hasHyphen = this.eat(HYPHEN_MINUS); + if (!hasAddModifiers && !hasHyphen) { + return false; + } + this.onModifiersEnter(start); + const addModifiers = this.parseModifiers(start, addModifiersEnd); + this.onAddModifiers(start, addModifiersEnd, addModifiers); + if (hasHyphen) { + const modifiersStart = this.index; + if (!this.eatModifiers() && + !hasAddModifiers && + this.currentCodePoint === COLON) { + this.raise("Invalid empty flags"); + } + const modifiers = this.parseModifiers(modifiersStart, this.index); + for (const [flagName] of Object.entries(modifiers).filter(([, enable]) => enable)) { + if (addModifiers[flagName]) { + this.raise(`Duplicated flag '${String.fromCodePoint(FLAG_PROP_TO_CODEPOINT[flagName])}'`); + } + } + this.onRemoveModifiers(modifiersStart, this.index, modifiers); + } + this.onModifiersLeave(start, this.index); + return true; + } + consumeCapturingGroup() { + const start = this.index; + if (this.eat(LEFT_PARENTHESIS)) { + let name = null; + if (this.ecmaVersion >= 2018) { + if (this.consumeGroupSpecifier()) { + name = this._lastStrValue; + } + else if (this.currentCodePoint === QUESTION_MARK) { + this.rewind(start); + return false; + } + } + else if (this.currentCodePoint === QUESTION_MARK) { + this.rewind(start); + return false; + } + this.onCapturingGroupEnter(start, name); + this.consumeDisjunction(); + if (!this.eat(RIGHT_PARENTHESIS)) { + this.raise("Unterminated group"); + } + this.onCapturingGroupLeave(start, this.index, name); + return true; + } + return false; + } + consumeExtendedAtom() { + return (this.consumeDot() || + this.consumeReverseSolidusAtomEscape() || + this.consumeReverseSolidusFollowedByC() || + Boolean(this.consumeCharacterClass()) || + this.consumeCapturingGroup() || + this.consumeUncapturingGroup() || + this.consumeInvalidBracedQuantifier() || + this.consumeExtendedPatternCharacter()); + } + consumeReverseSolidusFollowedByC() { + const start = this.index; + if (this.currentCodePoint === REVERSE_SOLIDUS && + this.nextCodePoint === LATIN_SMALL_LETTER_C) { + this._lastIntValue = this.currentCodePoint; + this.advance(); + this.onCharacter(start, this.index, REVERSE_SOLIDUS); + return true; + } + return false; + } + consumeInvalidBracedQuantifier() { + if (this.eatBracedQuantifier(true)) { + this.raise("Nothing to repeat"); + } + return false; + } + consumePatternCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && !isSyntaxCharacter(cp)) { + this.advance(); + this.onCharacter(start, this.index, cp); + return true; + } + return false; + } + consumeExtendedPatternCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && + cp !== CIRCUMFLEX_ACCENT && + cp !== DOLLAR_SIGN && + cp !== REVERSE_SOLIDUS && + cp !== FULL_STOP && + cp !== ASTERISK && + cp !== PLUS_SIGN && + cp !== QUESTION_MARK && + cp !== LEFT_PARENTHESIS && + cp !== RIGHT_PARENTHESIS && + cp !== LEFT_SQUARE_BRACKET && + cp !== VERTICAL_LINE) { + this.advance(); + this.onCharacter(start, this.index, cp); + return true; + } + return false; + } + consumeGroupSpecifier() { + const start = this.index; + if (this.eat(QUESTION_MARK)) { + if (this.eatGroupName()) { + if (!this._groupSpecifiers.hasInScope(this._lastStrValue)) { + this._groupSpecifiers.addToScope(this._lastStrValue); + return true; + } + this.raise("Duplicate capture group name"); + } + this.rewind(start); + } + return false; + } + consumeAtomEscape() { + if (this.consumeBackreference() || + this.consumeCharacterClassEscape() || + this.consumeCharacterEscape() || + (this._nFlag && this.consumeKGroupName())) { + return true; + } + if (this.strict || this._unicodeMode) { + this.raise("Invalid escape"); + } + return false; + } + consumeBackreference() { + const start = this.index; + if (this.eatDecimalEscape()) { + const n = this._lastIntValue; + if (n <= this._numCapturingParens) { + this.onBackreference(start - 1, this.index, n); + return true; + } + if (this.strict || this._unicodeMode) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + consumeCharacterClassEscape() { + var _a; + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_D)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "digit", false); + return {}; + } + if (this.eat(LATIN_CAPITAL_LETTER_D)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "digit", true); + return {}; + } + if (this.eat(LATIN_SMALL_LETTER_S)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "space", false); + return {}; + } + if (this.eat(LATIN_CAPITAL_LETTER_S)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "space", true); + return {}; + } + if (this.eat(LATIN_SMALL_LETTER_W)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "word", false); + return {}; + } + if (this.eat(LATIN_CAPITAL_LETTER_W)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "word", true); + return {}; + } + let negate = false; + if (this._unicodeMode && + this.ecmaVersion >= 2018 && + (this.eat(LATIN_SMALL_LETTER_P) || + (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) { + this._lastIntValue = -1; + let result = null; + if (this.eat(LEFT_CURLY_BRACKET) && + (result = this.eatUnicodePropertyValueExpression()) && + this.eat(RIGHT_CURLY_BRACKET)) { + if (negate && result.strings) { + this.raise("Invalid property name"); + } + this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", result.key, result.value, negate, (_a = result.strings) !== null && _a !== void 0 ? _a : false); + return { mayContainStrings: result.strings }; + } + this.raise("Invalid property name"); + } + return null; + } + consumeCharacterEscape() { + const start = this.index; + if (this.eatControlEscape() || + this.eatCControlLetter() || + this.eatZero() || + this.eatHexEscapeSequence() || + this.eatRegExpUnicodeEscapeSequence() || + (!this.strict && + !this._unicodeMode && + this.eatLegacyOctalEscapeSequence()) || + this.eatIdentityEscape()) { + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + return false; + } + consumeKGroupName() { + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_K)) { + if (this.eatGroupName()) { + const groupName = this._lastStrValue; + this._backreferenceNames.add(groupName); + this.onBackreference(start - 1, this.index, groupName); + return true; + } + this.raise("Invalid named reference"); + } + return false; + } + consumeCharacterClass() { + const start = this.index; + if (this.eat(LEFT_SQUARE_BRACKET)) { + const negate = this.eat(CIRCUMFLEX_ACCENT); + this.onCharacterClassEnter(start, negate, this._unicodeSetsMode); + const result = this.consumeClassContents(); + if (!this.eat(RIGHT_SQUARE_BRACKET)) { + if (this.currentCodePoint === -1) { + this.raise("Unterminated character class"); + } + this.raise("Invalid character in character class"); + } + if (negate && result.mayContainStrings) { + this.raise("Negated character class may contain strings"); + } + this.onCharacterClassLeave(start, this.index, negate); + return result; + } + return null; + } + consumeClassContents() { + if (this._unicodeSetsMode) { + if (this.currentCodePoint === RIGHT_SQUARE_BRACKET) { + return {}; + } + const result = this.consumeClassSetExpression(); + return result; + } + const strict = this.strict || this._unicodeMode; + for (;;) { + const rangeStart = this.index; + if (!this.consumeClassAtom()) { + break; + } + const min = this._lastIntValue; + if (!this.eat(HYPHEN_MINUS)) { + continue; + } + this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS); + if (!this.consumeClassAtom()) { + break; + } + const max = this._lastIntValue; + if (min === -1 || max === -1) { + if (strict) { + this.raise("Invalid character class"); + } + continue; + } + if (min > max) { + this.raise("Range out of order in character class"); + } + this.onCharacterClassRange(rangeStart, this.index, min, max); + } + return {}; + } + consumeClassAtom() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && + cp !== REVERSE_SOLIDUS && + cp !== RIGHT_SQUARE_BRACKET) { + this.advance(); + this._lastIntValue = cp; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.eat(REVERSE_SOLIDUS)) { + if (this.consumeClassEscape()) { + return true; + } + if (!this.strict && + this.currentCodePoint === LATIN_SMALL_LETTER_C) { + this._lastIntValue = REVERSE_SOLIDUS; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.strict || this._unicodeMode) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + consumeClassEscape() { + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_B)) { + this._lastIntValue = BACKSPACE; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + if (this._unicodeMode && this.eat(HYPHEN_MINUS)) { + this._lastIntValue = HYPHEN_MINUS; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + let cp = 0; + if (!this.strict && + !this._unicodeMode && + this.currentCodePoint === LATIN_SMALL_LETTER_C && + (isDecimalDigit((cp = this.nextCodePoint)) || cp === LOW_LINE)) { + this.advance(); + this.advance(); + this._lastIntValue = cp % 0x20; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + return (Boolean(this.consumeCharacterClassEscape()) || + this.consumeCharacterEscape()); + } + consumeClassSetExpression() { + const start = this.index; + let mayContainStrings = false; + let result = null; + if (this.consumeClassSetCharacter()) { + if (this.consumeClassSetRangeFromOperator(start)) { + this.consumeClassUnionRight({}); + return {}; + } + mayContainStrings = false; + } + else if ((result = this.consumeClassSetOperand())) { + mayContainStrings = result.mayContainStrings; + } + else { + const cp = this.currentCodePoint; + if (cp === REVERSE_SOLIDUS) { + this.advance(); + this.raise("Invalid escape"); + } + if (cp === this.nextCodePoint && + isClassSetReservedDoublePunctuatorCharacter(cp)) { + this.raise("Invalid set operation in character class"); + } + this.raise("Invalid character in character class"); + } + if (this.eat2(AMPERSAND, AMPERSAND)) { + while (this.currentCodePoint !== AMPERSAND && + (result = this.consumeClassSetOperand())) { + this.onClassIntersection(start, this.index); + if (!result.mayContainStrings) { + mayContainStrings = false; + } + if (this.eat2(AMPERSAND, AMPERSAND)) { + continue; + } + return { mayContainStrings }; + } + this.raise("Invalid character in character class"); + } + if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) { + while (this.consumeClassSetOperand()) { + this.onClassSubtraction(start, this.index); + if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) { + continue; + } + return { mayContainStrings }; + } + this.raise("Invalid character in character class"); + } + return this.consumeClassUnionRight({ mayContainStrings }); + } + consumeClassUnionRight(leftResult) { + let mayContainStrings = leftResult.mayContainStrings; + for (;;) { + const start = this.index; + if (this.consumeClassSetCharacter()) { + this.consumeClassSetRangeFromOperator(start); + continue; + } + const result = this.consumeClassSetOperand(); + if (result) { + if (result.mayContainStrings) { + mayContainStrings = true; + } + continue; + } + break; + } + return { mayContainStrings }; + } + consumeClassSetRangeFromOperator(start) { + const currentStart = this.index; + const min = this._lastIntValue; + if (this.eat(HYPHEN_MINUS)) { + if (this.consumeClassSetCharacter()) { + const max = this._lastIntValue; + if (min === -1 || max === -1) { + this.raise("Invalid character class"); + } + if (min > max) { + this.raise("Range out of order in character class"); + } + this.onCharacterClassRange(start, this.index, min, max); + return true; + } + this.rewind(currentStart); + } + return false; + } + consumeClassSetOperand() { + let result = null; + if ((result = this.consumeNestedClass())) { + return result; + } + if ((result = this.consumeClassStringDisjunction())) { + return result; + } + if (this.consumeClassSetCharacter()) { + return {}; + } + return null; + } + consumeNestedClass() { + const start = this.index; + if (this.eat(LEFT_SQUARE_BRACKET)) { + const negate = this.eat(CIRCUMFLEX_ACCENT); + this.onCharacterClassEnter(start, negate, true); + const result = this.consumeClassContents(); + if (!this.eat(RIGHT_SQUARE_BRACKET)) { + this.raise("Unterminated character class"); + } + if (negate && result.mayContainStrings) { + this.raise("Negated character class may contain strings"); + } + this.onCharacterClassLeave(start, this.index, negate); + return result; + } + if (this.eat(REVERSE_SOLIDUS)) { + const result = this.consumeCharacterClassEscape(); + if (result) { + return result; + } + this.rewind(start); + } + return null; + } + consumeClassStringDisjunction() { + const start = this.index; + if (this.eat3(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_Q, LEFT_CURLY_BRACKET)) { + this.onClassStringDisjunctionEnter(start); + let i = 0; + let mayContainStrings = false; + do { + if (this.consumeClassString(i++).mayContainStrings) { + mayContainStrings = true; + } + } while (this.eat(VERTICAL_LINE)); + if (this.eat(RIGHT_CURLY_BRACKET)) { + this.onClassStringDisjunctionLeave(start, this.index); + return { mayContainStrings }; + } + this.raise("Unterminated class string disjunction"); + } + return null; + } + consumeClassString(i) { + const start = this.index; + let count = 0; + this.onStringAlternativeEnter(start, i); + while (this.currentCodePoint !== -1 && + this.consumeClassSetCharacter()) { + count++; + } + this.onStringAlternativeLeave(start, this.index, i); + return { mayContainStrings: count !== 1 }; + } + consumeClassSetCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== this.nextCodePoint || + !isClassSetReservedDoublePunctuatorCharacter(cp)) { + if (cp !== -1 && !isClassSetSyntaxCharacter(cp)) { + this._lastIntValue = cp; + this.advance(); + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + } + if (this.eat(REVERSE_SOLIDUS)) { + if (this.consumeCharacterEscape()) { + return true; + } + if (isClassSetReservedPunctuator(this.currentCodePoint)) { + this._lastIntValue = this.currentCodePoint; + this.advance(); + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.eat(LATIN_SMALL_LETTER_B)) { + this._lastIntValue = BACKSPACE; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + this.rewind(start); + } + return false; + } + eatGroupName() { + if (this.eat(LESS_THAN_SIGN)) { + if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) { + return true; + } + this.raise("Invalid capture group name"); + } + return false; + } + eatRegExpIdentifierName() { + if (this.eatRegExpIdentifierStart()) { + this._lastStrValue = String.fromCodePoint(this._lastIntValue); + while (this.eatRegExpIdentifierPart()) { + this._lastStrValue += String.fromCodePoint(this._lastIntValue); + } + return true; + } + return false; + } + eatRegExpIdentifierStart() { + const start = this.index; + const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020; + let cp = this.currentCodePoint; + this.advance(); + if (cp === REVERSE_SOLIDUS && + this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { + cp = this._lastIntValue; + } + else if (forceUFlag && + isLeadSurrogate(cp) && + isTrailSurrogate(this.currentCodePoint)) { + cp = combineSurrogatePair(cp, this.currentCodePoint); + this.advance(); + } + if (isIdentifierStartChar(cp)) { + this._lastIntValue = cp; + return true; + } + if (this.index !== start) { + this.rewind(start); + } + return false; + } + eatRegExpIdentifierPart() { + const start = this.index; + const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020; + let cp = this.currentCodePoint; + this.advance(); + if (cp === REVERSE_SOLIDUS && + this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { + cp = this._lastIntValue; + } + else if (forceUFlag && + isLeadSurrogate(cp) && + isTrailSurrogate(this.currentCodePoint)) { + cp = combineSurrogatePair(cp, this.currentCodePoint); + this.advance(); + } + if (isIdentifierPartChar(cp)) { + this._lastIntValue = cp; + return true; + } + if (this.index !== start) { + this.rewind(start); + } + return false; + } + eatCControlLetter() { + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_C)) { + if (this.eatControlLetter()) { + return true; + } + this.rewind(start); + } + return false; + } + eatZero() { + if (this.currentCodePoint === DIGIT_ZERO && + !isDecimalDigit(this.nextCodePoint)) { + this._lastIntValue = 0; + this.advance(); + return true; + } + return false; + } + eatControlEscape() { + if (this.eat(LATIN_SMALL_LETTER_F)) { + this._lastIntValue = FORM_FEED; + return true; + } + if (this.eat(LATIN_SMALL_LETTER_N)) { + this._lastIntValue = LINE_FEED; + return true; + } + if (this.eat(LATIN_SMALL_LETTER_R)) { + this._lastIntValue = CARRIAGE_RETURN; + return true; + } + if (this.eat(LATIN_SMALL_LETTER_T)) { + this._lastIntValue = CHARACTER_TABULATION; + return true; + } + if (this.eat(LATIN_SMALL_LETTER_V)) { + this._lastIntValue = LINE_TABULATION; + return true; + } + return false; + } + eatControlLetter() { + const cp = this.currentCodePoint; + if (isLatinLetter(cp)) { + this.advance(); + this._lastIntValue = cp % 0x20; + return true; + } + return false; + } + eatRegExpUnicodeEscapeSequence(forceUFlag = false) { + const start = this.index; + const uFlag = forceUFlag || this._unicodeMode; + if (this.eat(LATIN_SMALL_LETTER_U)) { + if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || + this.eatFixedHexDigits(4) || + (uFlag && this.eatRegExpUnicodeCodePointEscape())) { + return true; + } + if (this.strict || uFlag) { + this.raise("Invalid unicode escape"); + } + this.rewind(start); + } + return false; + } + eatRegExpUnicodeSurrogatePairEscape() { + const start = this.index; + if (this.eatFixedHexDigits(4)) { + const lead = this._lastIntValue; + if (isLeadSurrogate(lead) && + this.eat(REVERSE_SOLIDUS) && + this.eat(LATIN_SMALL_LETTER_U) && + this.eatFixedHexDigits(4)) { + const trail = this._lastIntValue; + if (isTrailSurrogate(trail)) { + this._lastIntValue = combineSurrogatePair(lead, trail); + return true; + } + } + this.rewind(start); + } + return false; + } + eatRegExpUnicodeCodePointEscape() { + const start = this.index; + if (this.eat(LEFT_CURLY_BRACKET) && + this.eatHexDigits() && + this.eat(RIGHT_CURLY_BRACKET) && + isValidUnicode(this._lastIntValue)) { + return true; + } + this.rewind(start); + return false; + } + eatIdentityEscape() { + const cp = this.currentCodePoint; + if (this.isValidIdentityEscape(cp)) { + this._lastIntValue = cp; + this.advance(); + return true; + } + return false; + } + isValidIdentityEscape(cp) { + if (cp === -1) { + return false; + } + if (this._unicodeMode) { + return isSyntaxCharacter(cp) || cp === SOLIDUS; + } + if (this.strict) { + return !isIdContinue(cp); + } + if (this._nFlag) { + return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K); + } + return cp !== LATIN_SMALL_LETTER_C; + } + eatDecimalEscape() { + this._lastIntValue = 0; + let cp = this.currentCodePoint; + if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) { + do { + this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO); + this.advance(); + } while ((cp = this.currentCodePoint) >= DIGIT_ZERO && + cp <= DIGIT_NINE); + return true; + } + return false; + } + eatUnicodePropertyValueExpression() { + const start = this.index; + if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) { + const key = this._lastStrValue; + if (this.eatUnicodePropertyValue()) { + const value = this._lastStrValue; + if (isValidUnicodeProperty(this.ecmaVersion, key, value)) { + return { + key, + value: value || null, + }; + } + this.raise("Invalid property name"); + } + } + this.rewind(start); + if (this.eatLoneUnicodePropertyNameOrValue()) { + const nameOrValue = this._lastStrValue; + if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) { + return { + key: "General_Category", + value: nameOrValue || null, + }; + } + if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) { + return { + key: nameOrValue, + value: null, + }; + } + if (this._unicodeSetsMode && + isValidLoneUnicodePropertyOfString(this.ecmaVersion, nameOrValue)) { + return { + key: nameOrValue, + value: null, + strings: true, + }; + } + this.raise("Invalid property name"); + } + return null; + } + eatUnicodePropertyName() { + this._lastStrValue = ""; + while (isUnicodePropertyNameCharacter(this.currentCodePoint)) { + this._lastStrValue += String.fromCodePoint(this.currentCodePoint); + this.advance(); + } + return this._lastStrValue !== ""; + } + eatUnicodePropertyValue() { + this._lastStrValue = ""; + while (isUnicodePropertyValueCharacter(this.currentCodePoint)) { + this._lastStrValue += String.fromCodePoint(this.currentCodePoint); + this.advance(); + } + return this._lastStrValue !== ""; + } + eatLoneUnicodePropertyNameOrValue() { + return this.eatUnicodePropertyValue(); + } + eatHexEscapeSequence() { + const start = this.index; + if (this.eat(LATIN_SMALL_LETTER_X)) { + if (this.eatFixedHexDigits(2)) { + return true; + } + if (this._unicodeMode || this.strict) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + eatDecimalDigits() { + const start = this.index; + this._lastIntValue = 0; + while (isDecimalDigit(this.currentCodePoint)) { + this._lastIntValue = + 10 * this._lastIntValue + digitToInt(this.currentCodePoint); + this.advance(); + } + return this.index !== start; + } + eatHexDigits() { + const start = this.index; + this._lastIntValue = 0; + while (isHexDigit(this.currentCodePoint)) { + this._lastIntValue = + 16 * this._lastIntValue + digitToInt(this.currentCodePoint); + this.advance(); + } + return this.index !== start; + } + eatLegacyOctalEscapeSequence() { + if (this.eatOctalDigit()) { + const n1 = this._lastIntValue; + if (this.eatOctalDigit()) { + const n2 = this._lastIntValue; + if (n1 <= 3 && this.eatOctalDigit()) { + this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue; + } + else { + this._lastIntValue = n1 * 8 + n2; + } + } + else { + this._lastIntValue = n1; + } + return true; + } + return false; + } + eatOctalDigit() { + const cp = this.currentCodePoint; + if (isOctalDigit(cp)) { + this.advance(); + this._lastIntValue = cp - DIGIT_ZERO; + return true; + } + this._lastIntValue = 0; + return false; + } + eatFixedHexDigits(length) { + const start = this.index; + this._lastIntValue = 0; + for (let i = 0; i < length; ++i) { + const cp = this.currentCodePoint; + if (!isHexDigit(cp)) { + this.rewind(start); + return false; + } + this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp); + this.advance(); + } + return true; + } + eatModifiers() { + let ate = false; + while (isRegularExpressionModifier(this.currentCodePoint)) { + this.advance(); + ate = true; + } + return ate; + } + parseModifiers(start, end) { + const { ignoreCase, multiline, dotAll } = this.parseFlags(this._reader.source, start, end); + return { ignoreCase, multiline, dotAll }; + } + parseFlags(source, start, end) { + const flags = { + global: false, + ignoreCase: false, + multiline: false, + unicode: false, + sticky: false, + dotAll: false, + hasIndices: false, + unicodeSets: false, + }; + const validFlags = new Set(); + validFlags.add(LATIN_SMALL_LETTER_G); + validFlags.add(LATIN_SMALL_LETTER_I); + validFlags.add(LATIN_SMALL_LETTER_M); + if (this.ecmaVersion >= 2015) { + validFlags.add(LATIN_SMALL_LETTER_U); + validFlags.add(LATIN_SMALL_LETTER_Y); + if (this.ecmaVersion >= 2018) { + validFlags.add(LATIN_SMALL_LETTER_S); + if (this.ecmaVersion >= 2022) { + validFlags.add(LATIN_SMALL_LETTER_D); + if (this.ecmaVersion >= 2024) { + validFlags.add(LATIN_SMALL_LETTER_V); + } + } + } + } + for (let i = start; i < end; ++i) { + const flag = source.charCodeAt(i); + if (validFlags.has(flag)) { + const prop = FLAG_CODEPOINT_TO_PROP[flag]; + if (flags[prop]) { + this.raise(`Duplicated flag '${source[i]}'`, { + index: start, + }); + } + flags[prop] = true; + } + else { + this.raise(`Invalid flag '${source[i]}'`, { index: start }); + } + } + return flags; + } +} + +const DUMMY_PATTERN = {}; +const DUMMY_FLAGS = {}; +const DUMMY_CAPTURING_GROUP = {}; +function isClassSetOperand(node) { + return (node.type === "Character" || + node.type === "CharacterSet" || + node.type === "CharacterClass" || + node.type === "ExpressionCharacterClass" || + node.type === "ClassStringDisjunction"); +} +class RegExpParserState { + constructor(options) { + var _a; + this._node = DUMMY_PATTERN; + this._expressionBufferMap = new Map(); + this._flags = DUMMY_FLAGS; + this._backreferences = []; + this._capturingGroups = []; + this.source = ""; + this.strict = Boolean(options === null || options === void 0 ? void 0 : options.strict); + this.ecmaVersion = (_a = options === null || options === void 0 ? void 0 : options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion; + } + get pattern() { + if (this._node.type !== "Pattern") { + throw new Error("UnknownError"); + } + return this._node; + } + get flags() { + if (this._flags.type !== "Flags") { + throw new Error("UnknownError"); + } + return this._flags; + } + onRegExpFlags(start, end, { global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices, unicodeSets, }) { + this._flags = { + type: "Flags", + parent: null, + start, + end, + raw: this.source.slice(start, end), + global, + ignoreCase, + multiline, + unicode, + sticky, + dotAll, + hasIndices, + unicodeSets, + }; + } + onPatternEnter(start) { + this._node = { + type: "Pattern", + parent: null, + start, + end: start, + raw: "", + alternatives: [], + }; + this._backreferences.length = 0; + this._capturingGroups.length = 0; + } + onPatternLeave(start, end) { + this._node.end = end; + this._node.raw = this.source.slice(start, end); + for (const reference of this._backreferences) { + const ref = reference.ref; + const groups = typeof ref === "number" + ? [this._capturingGroups[ref - 1]] + : this._capturingGroups.filter((g) => g.name === ref); + if (groups.length === 1) { + const group = groups[0]; + reference.ambiguous = false; + reference.resolved = group; + } + else { + reference.ambiguous = true; + reference.resolved = groups; + } + for (const group of groups) { + group.references.push(reference); + } + } + } + onAlternativeEnter(start) { + const parent = this._node; + if (parent.type !== "Assertion" && + parent.type !== "CapturingGroup" && + parent.type !== "Group" && + parent.type !== "Pattern") { + throw new Error("UnknownError"); + } + this._node = { + type: "Alternative", + parent, + start, + end: start, + raw: "", + elements: [], + }; + parent.alternatives.push(this._node); + } + onAlternativeLeave(start, end) { + const node = this._node; + if (node.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onGroupEnter(start) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const group = { + type: "Group", + parent, + start, + end: start, + raw: "", + modifiers: null, + alternatives: [], + }; + this._node = group; + parent.elements.push(this._node); + } + onGroupLeave(start, end) { + const node = this._node; + if (node.type !== "Group" || node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onModifiersEnter(start) { + const parent = this._node; + if (parent.type !== "Group") { + throw new Error("UnknownError"); + } + this._node = { + type: "Modifiers", + parent, + start, + end: start, + raw: "", + add: null, + remove: null, + }; + parent.modifiers = this._node; + } + onModifiersLeave(start, end) { + const node = this._node; + if (node.type !== "Modifiers" || node.parent.type !== "Group") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onAddModifiers(start, end, { ignoreCase, multiline, dotAll, }) { + const parent = this._node; + if (parent.type !== "Modifiers") { + throw new Error("UnknownError"); + } + parent.add = { + type: "ModifierFlags", + parent, + start, + end, + raw: this.source.slice(start, end), + ignoreCase, + multiline, + dotAll, + }; + } + onRemoveModifiers(start, end, { ignoreCase, multiline, dotAll, }) { + const parent = this._node; + if (parent.type !== "Modifiers") { + throw new Error("UnknownError"); + } + parent.remove = { + type: "ModifierFlags", + parent, + start, + end, + raw: this.source.slice(start, end), + ignoreCase, + multiline, + dotAll, + }; + } + onCapturingGroupEnter(start, name) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + this._node = { + type: "CapturingGroup", + parent, + start, + end: start, + raw: "", + name, + alternatives: [], + references: [], + }; + parent.elements.push(this._node); + this._capturingGroups.push(this._node); + } + onCapturingGroupLeave(start, end) { + const node = this._node; + if (node.type !== "CapturingGroup" || + node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onQuantifier(start, end, min, max, greedy) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const element = parent.elements.pop(); + if (element == null || + element.type === "Quantifier" || + (element.type === "Assertion" && element.kind !== "lookahead")) { + throw new Error("UnknownError"); + } + const node = { + type: "Quantifier", + parent, + start: element.start, + end, + raw: this.source.slice(element.start, end), + min, + max, + greedy, + element, + }; + parent.elements.push(node); + element.parent = node; + } + onLookaroundAssertionEnter(start, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const node = (this._node = { + type: "Assertion", + parent, + start, + end: start, + raw: "", + kind, + negate, + alternatives: [], + }); + parent.elements.push(node); + } + onLookaroundAssertionLeave(start, end) { + const node = this._node; + if (node.type !== "Assertion" || node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onEdgeAssertion(start, end, kind) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Assertion", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + }); + } + onWordBoundaryAssertion(start, end, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Assertion", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + negate, + }); + } + onAnyCharacterSet(start, end, kind) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + }); + } + onEscapeCharacterSet(start, end, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + negate, + }); + } + onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + const base = { + type: "CharacterSet", + parent: null, + start, + end, + raw: this.source.slice(start, end), + kind, + strings: null, + key, + }; + if (strings) { + if ((parent.type === "CharacterClass" && !parent.unicodeSets) || + negate || + value !== null) { + throw new Error("UnknownError"); + } + parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate })); + } + else { + parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate })); + } + } + onCharacter(start, end, value) { + const parent = this._node; + if (parent.type !== "Alternative" && + parent.type !== "CharacterClass" && + parent.type !== "StringAlternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Character", + parent, + start, + end, + raw: this.source.slice(start, end), + value, + }); + } + onBackreference(start, end, ref) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const node = { + type: "Backreference", + parent, + start, + end, + raw: this.source.slice(start, end), + ref, + ambiguous: false, + resolved: DUMMY_CAPTURING_GROUP, + }; + parent.elements.push(node); + this._backreferences.push(node); + } + onCharacterClassEnter(start, negate, unicodeSets) { + const parent = this._node; + const base = { + type: "CharacterClass", + parent, + start, + end: start, + raw: "", + unicodeSets, + negate, + elements: [], + }; + if (parent.type === "Alternative") { + const node = Object.assign(Object.assign({}, base), { parent }); + this._node = node; + parent.elements.push(node); + } + else if (parent.type === "CharacterClass" && + parent.unicodeSets && + unicodeSets) { + const node = Object.assign(Object.assign({}, base), { parent, + unicodeSets }); + this._node = node; + parent.elements.push(node); + } + else { + throw new Error("UnknownError"); + } + } + onCharacterClassLeave(start, end) { + const node = this._node; + if (node.type !== "CharacterClass" || + (node.parent.type !== "Alternative" && + node.parent.type !== "CharacterClass")) { + throw new Error("UnknownError"); + } + const parent = node.parent; + node.end = end; + node.raw = this.source.slice(start, end); + this._node = parent; + const expression = this._expressionBufferMap.get(node); + if (!expression) { + return; + } + if (node.elements.length > 0) { + throw new Error("UnknownError"); + } + this._expressionBufferMap.delete(node); + const newNode = { + type: "ExpressionCharacterClass", + parent, + start: node.start, + end: node.end, + raw: node.raw, + negate: node.negate, + expression, + }; + expression.parent = newNode; + if (node !== parent.elements.pop()) { + throw new Error("UnknownError"); + } + parent.elements.push(newNode); + } + onCharacterClassRange(start, end) { + const parent = this._node; + if (parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + const elements = parent.elements; + const max = elements.pop(); + if (!max || max.type !== "Character") { + throw new Error("UnknownError"); + } + if (!parent.unicodeSets) { + const hyphen = elements.pop(); + if (!hyphen || + hyphen.type !== "Character" || + hyphen.value !== HYPHEN_MINUS) { + throw new Error("UnknownError"); + } + } + const min = elements.pop(); + if (!min || min.type !== "Character") { + throw new Error("UnknownError"); + } + const node = { + type: "CharacterClassRange", + parent, + start, + end, + raw: this.source.slice(start, end), + min, + max, + }; + min.parent = node; + max.parent = node; + elements.push(node); + } + onClassIntersection(start, end) { + var _a; + const parent = this._node; + if (parent.type !== "CharacterClass" || !parent.unicodeSets) { + throw new Error("UnknownError"); + } + const right = parent.elements.pop(); + const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop(); + if (!left || + !right || + left.type === "ClassSubtraction" || + (left.type !== "ClassIntersection" && !isClassSetOperand(left)) || + !isClassSetOperand(right)) { + throw new Error("UnknownError"); + } + const node = { + type: "ClassIntersection", + parent: parent, + start, + end, + raw: this.source.slice(start, end), + left, + right, + }; + left.parent = node; + right.parent = node; + this._expressionBufferMap.set(parent, node); + } + onClassSubtraction(start, end) { + var _a; + const parent = this._node; + if (parent.type !== "CharacterClass" || !parent.unicodeSets) { + throw new Error("UnknownError"); + } + const right = parent.elements.pop(); + const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop(); + if (!left || + !right || + left.type === "ClassIntersection" || + (left.type !== "ClassSubtraction" && !isClassSetOperand(left)) || + !isClassSetOperand(right)) { + throw new Error("UnknownError"); + } + const node = { + type: "ClassSubtraction", + parent: parent, + start, + end, + raw: this.source.slice(start, end), + left, + right, + }; + left.parent = node; + right.parent = node; + this._expressionBufferMap.set(parent, node); + } + onClassStringDisjunctionEnter(start) { + const parent = this._node; + if (parent.type !== "CharacterClass" || !parent.unicodeSets) { + throw new Error("UnknownError"); + } + this._node = { + type: "ClassStringDisjunction", + parent, + start, + end: start, + raw: "", + alternatives: [], + }; + parent.elements.push(this._node); + } + onClassStringDisjunctionLeave(start, end) { + const node = this._node; + if (node.type !== "ClassStringDisjunction" || + node.parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onStringAlternativeEnter(start) { + const parent = this._node; + if (parent.type !== "ClassStringDisjunction") { + throw new Error("UnknownError"); + } + this._node = { + type: "StringAlternative", + parent, + start, + end: start, + raw: "", + elements: [], + }; + parent.alternatives.push(this._node); + } + onStringAlternativeLeave(start, end) { + const node = this._node; + if (node.type !== "StringAlternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } +} +class RegExpParser { + constructor(options) { + this._state = new RegExpParserState(options); + this._validator = new RegExpValidator(this._state); + } + parseLiteral(source, start = 0, end = source.length) { + this._state.source = source; + this._validator.validateLiteral(source, start, end); + const pattern = this._state.pattern; + const flags = this._state.flags; + const literal = { + type: "RegExpLiteral", + parent: null, + start, + end, + raw: source, + pattern, + flags, + }; + pattern.parent = literal; + flags.parent = literal; + return literal; + } + parseFlags(source, start = 0, end = source.length) { + this._state.source = source; + this._validator.validateFlags(source, start, end); + return this._state.flags; + } + parsePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) { + this._state.source = source; + this._validator.validatePattern(source, start, end, uFlagOrFlags); + return this._state.pattern; + } +} + +class RegExpVisitor { + constructor(handlers) { + this._handlers = handlers; + } + visit(node) { + switch (node.type) { + case "Alternative": + this.visitAlternative(node); + break; + case "Assertion": + this.visitAssertion(node); + break; + case "Backreference": + this.visitBackreference(node); + break; + case "CapturingGroup": + this.visitCapturingGroup(node); + break; + case "Character": + this.visitCharacter(node); + break; + case "CharacterClass": + this.visitCharacterClass(node); + break; + case "CharacterClassRange": + this.visitCharacterClassRange(node); + break; + case "CharacterSet": + this.visitCharacterSet(node); + break; + case "ClassIntersection": + this.visitClassIntersection(node); + break; + case "ClassStringDisjunction": + this.visitClassStringDisjunction(node); + break; + case "ClassSubtraction": + this.visitClassSubtraction(node); + break; + case "ExpressionCharacterClass": + this.visitExpressionCharacterClass(node); + break; + case "Flags": + this.visitFlags(node); + break; + case "Group": + this.visitGroup(node); + break; + case "Modifiers": + this.visitModifiers(node); + break; + case "ModifierFlags": + this.visitModifierFlags(node); + break; + case "Pattern": + this.visitPattern(node); + break; + case "Quantifier": + this.visitQuantifier(node); + break; + case "RegExpLiteral": + this.visitRegExpLiteral(node); + break; + case "StringAlternative": + this.visitStringAlternative(node); + break; + default: + throw new Error(`Unknown type: ${node.type}`); + } + } + visitAlternative(node) { + if (this._handlers.onAlternativeEnter) { + this._handlers.onAlternativeEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onAlternativeLeave) { + this._handlers.onAlternativeLeave(node); + } + } + visitAssertion(node) { + if (this._handlers.onAssertionEnter) { + this._handlers.onAssertionEnter(node); + } + if (node.kind === "lookahead" || node.kind === "lookbehind") { + node.alternatives.forEach(this.visit, this); + } + if (this._handlers.onAssertionLeave) { + this._handlers.onAssertionLeave(node); + } + } + visitBackreference(node) { + if (this._handlers.onBackreferenceEnter) { + this._handlers.onBackreferenceEnter(node); + } + if (this._handlers.onBackreferenceLeave) { + this._handlers.onBackreferenceLeave(node); + } + } + visitCapturingGroup(node) { + if (this._handlers.onCapturingGroupEnter) { + this._handlers.onCapturingGroupEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onCapturingGroupLeave) { + this._handlers.onCapturingGroupLeave(node); + } + } + visitCharacter(node) { + if (this._handlers.onCharacterEnter) { + this._handlers.onCharacterEnter(node); + } + if (this._handlers.onCharacterLeave) { + this._handlers.onCharacterLeave(node); + } + } + visitCharacterClass(node) { + if (this._handlers.onCharacterClassEnter) { + this._handlers.onCharacterClassEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onCharacterClassLeave) { + this._handlers.onCharacterClassLeave(node); + } + } + visitCharacterClassRange(node) { + if (this._handlers.onCharacterClassRangeEnter) { + this._handlers.onCharacterClassRangeEnter(node); + } + this.visitCharacter(node.min); + this.visitCharacter(node.max); + if (this._handlers.onCharacterClassRangeLeave) { + this._handlers.onCharacterClassRangeLeave(node); + } + } + visitCharacterSet(node) { + if (this._handlers.onCharacterSetEnter) { + this._handlers.onCharacterSetEnter(node); + } + if (this._handlers.onCharacterSetLeave) { + this._handlers.onCharacterSetLeave(node); + } + } + visitClassIntersection(node) { + if (this._handlers.onClassIntersectionEnter) { + this._handlers.onClassIntersectionEnter(node); + } + this.visit(node.left); + this.visit(node.right); + if (this._handlers.onClassIntersectionLeave) { + this._handlers.onClassIntersectionLeave(node); + } + } + visitClassStringDisjunction(node) { + if (this._handlers.onClassStringDisjunctionEnter) { + this._handlers.onClassStringDisjunctionEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onClassStringDisjunctionLeave) { + this._handlers.onClassStringDisjunctionLeave(node); + } + } + visitClassSubtraction(node) { + if (this._handlers.onClassSubtractionEnter) { + this._handlers.onClassSubtractionEnter(node); + } + this.visit(node.left); + this.visit(node.right); + if (this._handlers.onClassSubtractionLeave) { + this._handlers.onClassSubtractionLeave(node); + } + } + visitExpressionCharacterClass(node) { + if (this._handlers.onExpressionCharacterClassEnter) { + this._handlers.onExpressionCharacterClassEnter(node); + } + this.visit(node.expression); + if (this._handlers.onExpressionCharacterClassLeave) { + this._handlers.onExpressionCharacterClassLeave(node); + } + } + visitFlags(node) { + if (this._handlers.onFlagsEnter) { + this._handlers.onFlagsEnter(node); + } + if (this._handlers.onFlagsLeave) { + this._handlers.onFlagsLeave(node); + } + } + visitGroup(node) { + if (this._handlers.onGroupEnter) { + this._handlers.onGroupEnter(node); + } + if (node.modifiers) { + this.visit(node.modifiers); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onGroupLeave) { + this._handlers.onGroupLeave(node); + } + } + visitModifiers(node) { + if (this._handlers.onModifiersEnter) { + this._handlers.onModifiersEnter(node); + } + if (node.add) { + this.visit(node.add); + } + if (node.remove) { + this.visit(node.remove); + } + if (this._handlers.onModifiersLeave) { + this._handlers.onModifiersLeave(node); + } + } + visitModifierFlags(node) { + if (this._handlers.onModifierFlagsEnter) { + this._handlers.onModifierFlagsEnter(node); + } + if (this._handlers.onModifierFlagsLeave) { + this._handlers.onModifierFlagsLeave(node); + } + } + visitPattern(node) { + if (this._handlers.onPatternEnter) { + this._handlers.onPatternEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onPatternLeave) { + this._handlers.onPatternLeave(node); + } + } + visitQuantifier(node) { + if (this._handlers.onQuantifierEnter) { + this._handlers.onQuantifierEnter(node); + } + this.visit(node.element); + if (this._handlers.onQuantifierLeave) { + this._handlers.onQuantifierLeave(node); + } + } + visitRegExpLiteral(node) { + if (this._handlers.onRegExpLiteralEnter) { + this._handlers.onRegExpLiteralEnter(node); + } + this.visitPattern(node.pattern); + this.visitFlags(node.flags); + if (this._handlers.onRegExpLiteralLeave) { + this._handlers.onRegExpLiteralLeave(node); + } + } + visitStringAlternative(node) { + if (this._handlers.onStringAlternativeEnter) { + this._handlers.onStringAlternativeEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onStringAlternativeLeave) { + this._handlers.onStringAlternativeLeave(node); + } + } +} + +function parseRegExpLiteral(source, options) { + return new RegExpParser(options).parseLiteral(String(source)); +} +function validateRegExpLiteral(source, options) { + new RegExpValidator(options).validateLiteral(source); +} +function visitRegExpAST(node, handlers) { + new RegExpVisitor(handlers).visit(node); +} + +export { ast as AST, RegExpParser, RegExpSyntaxError, RegExpValidator, parseRegExpLiteral, validateRegExpLiteral, visitRegExpAST }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@eslint-community/regexpp/index.mjs.map b/node_modules/@eslint-community/regexpp/index.mjs.map new file mode 100644 index 0000000..0d1c5f7 --- /dev/null +++ b/node_modules/@eslint-community/regexpp/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs.map","sources":[".temp/src/ecma-versions.ts",".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/group-specifiers.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@eslint-community/regexpp/package.json b/node_modules/@eslint-community/regexpp/package.json new file mode 100644 index 0000000..39cbfde --- /dev/null +++ b/node_modules/@eslint-community/regexpp/package.json @@ -0,0 +1,91 @@ +{ + "name": "@eslint-community/regexpp", + "version": "4.12.1", + "description": "Regular expression parser for ECMAScript.", + "keywords": [ + "regexp", + "regular", + "expression", + "parser", + "validator", + "ast", + "abstract", + "syntax", + "tree", + "ecmascript", + "es2015", + "es2016", + "es2017", + "es2018", + "es2019", + "es2020", + "es2021", + "annexB" + ], + "homepage": "https://github.com/eslint-community/regexpp#readme", + "bugs": { + "url": "https://github.com/eslint-community/regexpp/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/eslint-community/regexpp" + }, + "license": "MIT", + "author": "Toru Nagashima", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./index.mjs", + "default": "./index.js" + }, + "./package.json": "./package.json" + }, + "main": "index", + "files": [ + "index.*" + ], + "scripts": { + "prebuild": "npm run -s clean", + "build": "run-s build:*", + "build:tsc": "tsc --module es2015", + "build:rollup": "rollup -c", + "build:dts": "npm run -s build:tsc -- --removeComments false && dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts && prettier --write index.d.ts", + "clean": "rimraf .temp index.*", + "lint": "eslint . --ext .ts", + "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", + "debug": "mocha --require ts-node/register/transpile-only \"test/*.ts\" --reporter dot --timeout 10000", + "update:test": "ts-node scripts/update-fixtures.ts", + "update:unicode": "run-s update:unicode:*", + "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", + "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", + "update:test262:extract": "ts-node -T scripts/extract-test262.ts", + "preversion": "npm test && npm run -s build", + "postversion": "git push && git push --tags", + "prewatch": "npm run -s clean", + "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" + }, + "dependencies": {}, + "devDependencies": { + "@eslint-community/eslint-plugin-mysticatea": "^15.5.1", + "@rollup/plugin-node-resolve": "^14.1.0", + "@types/eslint": "^8.44.3", + "@types/jsdom": "^16.2.15", + "@types/mocha": "^9.1.1", + "@types/node": "^12.20.55", + "dts-bundle": "^0.7.3", + "eslint": "^8.50.0", + "js-tokens": "^8.0.2", + "jsdom": "^19.0.0", + "mocha": "^9.2.2", + "npm-run-all2": "^6.2.2", + "nyc": "^14.1.1", + "rimraf": "^3.0.2", + "rollup": "^2.79.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "ts-node": "^10.9.1", + "typescript": "~5.0.2" + }, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } +} diff --git a/node_modules/@eslint/config-array/LICENSE b/node_modules/@eslint/config-array/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@eslint/config-array/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@eslint/config-array/README.md b/node_modules/@eslint/config-array/README.md new file mode 100644 index 0000000..4a2511e --- /dev/null +++ b/node_modules/@eslint/config-array/README.md @@ -0,0 +1,358 @@ +# Config Array + +## Description + +A config array is a way of managing configurations that are based on glob pattern matching of filenames. Each config array contains the information needed to determine the correct configuration for any file based on the filename. + +**Note:** This is a generic package that can be used outside of ESLint. It contains no ESLint-specific functionality. + +## Installation + +For Node.js and compatible runtimes: + +```shell +npm install @eslint/config-array +# or +yarn add @eslint/config-array +# or +pnpm install @eslint/config-array +# or +bun install @eslint/config-array +``` + +For Deno: + +```shell +deno add @eslint/config-array +``` + +## Background + +The basic idea is that all configuration, including overrides, can be represented by a single array where each item in the array is a config object. Config objects appearing later in the array override config objects appearing earlier in the array. You can calculate a config for a given file by traversing all config objects in the array to find the ones that match the filename. Matching is done by specifying glob patterns in `files` and `ignores` properties on each config object. Here's an example: + +```js +export default [ + // match all JSON files + { + name: "JSON Handler", + files: ["**/*.json"], + handler: jsonHandler, + }, + + // match only package.json + { + name: "package.json Handler", + files: ["package.json"], + handler: packageJsonHandler, + }, +]; +``` + +In this example, there are two config objects: the first matches all JSON files in all directories and the second matches just `package.json` in the base path directory (all the globs are evaluated as relative to a base path that can be specified). When you retrieve a configuration for `foo.json`, only the first config object matches so `handler` is equal to `jsonHandler`; when you retrieve a configuration for `package.json`, `handler` is equal to `packageJsonHandler` (because both config objects match, the second one wins). + +## Usage + +First, import the `ConfigArray` constructor: + +```js +import { ConfigArray } from "@eslint/config-array"; + +// or using CommonJS + +const { ConfigArray } = require("@eslint/config-array"); +``` + +When you create a new instance of `ConfigArray`, you must pass in two arguments: an array of configs and an options object. The array of configs is most likely read in from a configuration file, so here's a typical example: + +```js +const configFilename = path.resolve(process.cwd(), "my.config.js"); +const { default: rawConfigs } = await import(configFilename); +const configs = new ConfigArray(rawConfigs, { + // the path to match filenames from + basePath: process.cwd(), + + // additional items in each config + schema: mySchema, +}); +``` + +This example reads in an object or array from `my.config.js` and passes it into the `ConfigArray` constructor as the first argument. The second argument is an object specifying the `basePath` (the directory in which `my.config.js` is found) and a `schema` to define the additional properties of a config object beyond `files`, `ignores`, and `name`. + +### Specifying a Schema + +The `schema` option is required for you to use additional properties in config objects. The schema is an object that follows the format of an [`ObjectSchema`](https://npmjs.com/package/@eslint/object-schema). The schema specifies both validation and merge rules that the `ConfigArray` instance needs to combine configs when there are multiple matches. Here's an example: + +```js +const configFilename = path.resolve(process.cwd(), "my.config.js"); +const { default: rawConfigs } = await import(configFilename); + +const mySchema = { + + // define the handler key in configs + handler: { + required: true, + merge(a, b) { + if (!b) return a; + if (!a) return b; + }, + validate(value) { + if (typeof value !== "function") { + throw new TypeError("Function expected."); + } + } + } +}; + +const configs = new ConfigArray(rawConfigs, { + + // the path to match filenames from + basePath: process.cwd(), + + // additional item schemas in each config + schema: mySchema, + + // additional config types supported (default: []) + extraConfigTypes: ["array", "function"]; +}); +``` + +### Config Arrays + +Config arrays can be multidimensional, so it's possible for a config array to contain another config array when `extraConfigTypes` contains `"array"`, such as: + +```js +export default [ + // JS config + { + files: ["**/*.js"], + handler: jsHandler, + }, + + // JSON configs + [ + // match all JSON files + { + name: "JSON Handler", + files: ["**/*.json"], + handler: jsonHandler, + }, + + // match only package.json + { + name: "package.json Handler", + files: ["package.json"], + handler: packageJsonHandler, + }, + ], + + // filename must match function + { + files: [filePath => filePath.endsWith(".md")], + handler: markdownHandler, + }, + + // filename must match all patterns in subarray + { + files: [["*.test.*", "*.js"]], + handler: jsTestHandler, + }, + + // filename must not match patterns beginning with ! + { + name: "Non-JS files", + files: ["!*.js"], + settings: { + js: false, + }, + }, +]; +``` + +In this example, the array contains both config objects and a config array. When a config array is normalized (see details below), it is flattened so only config objects remain. However, the order of evaluation remains the same. + +If the `files` array contains a function, then that function is called with the path of the file as it was passed in. The function is expected to return `true` if there is a match and `false` if not. (The `ignores` array can also contain functions.) + +If the `files` array contains an item that is an array of strings and functions, then all patterns must match in order for the config to match. In the preceding examples, both `*.test.*` and `*.js` must match in order for the config object to be used. + +If a pattern in the files array begins with `!` then it excludes that pattern. In the preceding example, any filename that doesn't end with `.js` will automatically get a `settings.js` property set to `false`. + +You can also specify an `ignores` key that will force files matching those patterns to not be included. If the `ignores` key is in a config object without any other keys, then those ignores will always be applied; otherwise those ignores act as exclusions. Here's an example: + +```js +export default [ + + // Always ignored + { + ignores: ["**/.git/**", "**/node_modules/**"] + }, + + // .eslintrc.js file is ignored only when .js file matches + { + files: ["**/*.js"], + ignores: [".eslintrc.js"] + handler: jsHandler + } +]; +``` + +You can use negated patterns in `ignores` to exclude a file that was already ignored, such as: + +```js +export default [ + // Ignore all JSON files except tsconfig.json + { + files: ["**/*"], + ignores: ["**/*.json", "!tsconfig.json"], + }, +]; +``` + +### Config Functions + +Config arrays can also include config functions when `extraConfigTypes` contains `"function"`. A config function accepts a single parameter, `context` (defined by you), and must return either a config object or a config array (it cannot return another function). Config functions allow end users to execute code in the creation of appropriate config objects. Here's an example: + +```js +export default [ + // JS config + { + files: ["**/*.js"], + handler: jsHandler, + }, + + // JSON configs + function (context) { + return [ + // match all JSON files + { + name: context.name + " JSON Handler", + files: ["**/*.json"], + handler: jsonHandler, + }, + + // match only package.json + { + name: context.name + " package.json Handler", + files: ["package.json"], + handler: packageJsonHandler, + }, + ]; + }, +]; +``` + +When a config array is normalized, each function is executed and replaced in the config array with the return value. + +**Note:** Config functions can also be async. + +### Normalizing Config Arrays + +Once a config array has been created and loaded with all of the raw config data, it must be normalized before it can be used. The normalization process goes through and flattens the config array as well as executing all config functions to get their final values. + +To normalize a config array, call the `normalize()` method and pass in a context object: + +```js +await configs.normalize({ + name: "MyApp", +}); +``` + +The `normalize()` method returns a promise, so be sure to use the `await` operator. The config array instance is normalized in-place, so you don't need to create a new variable. + +If you want to disallow async config functions, you can call `normalizeSync()` instead. This method is completely synchronous and does not require using the `await` operator as it does not return a promise: + +```js +await configs.normalizeSync({ + name: "MyApp", +}); +``` + +**Important:** Once a `ConfigArray` is normalized, it cannot be changed further. You can, however, create a new `ConfigArray` and pass in the normalized instance to create an unnormalized copy. + +### Getting Config for a File + +To get the config for a file, use the `getConfig()` method on a normalized config array and pass in the filename to get a config for: + +```js +// pass in filename +const fileConfig = configs.getConfig( + path.resolve(process.cwd(), "package.json"), +); +``` + +The config array always returns an object, even if there are no configs matching the given filename. You can then inspect the returned config object to determine how to proceed. + +A few things to keep in mind: + +- If a filename is not an absolute path, it will be resolved relative to the base path directory. +- The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified. +- The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation. +- A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry that is `*` or ends with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches. + +## Determining Ignored Paths + +You can determine if a file is ignored by using the `isFileIgnored()` method and passing in the path of any file, as in this example: + +```js +const ignored = configs.isFileIgnored("/foo/bar/baz.txt"); +``` + +A file is considered ignored if any of the following is true: + +- **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored. +- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored. +- **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. + +For directories, use the `isDirectoryIgnored()` method and pass in the path of any directory, as in this example: + +```js +const ignored = configs.isDirectoryIgnored("/foo/bar/"); +``` + +A directory is considered ignored if any of the following is true: + +- **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored. +- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored. +- **It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. + +**Important:** A pattern such as `foo/**` means that `foo` and `foo/` are _not_ ignored whereas `foo/bar` is ignored. If you want to ignore `foo` and all of its subdirectories, use the pattern `foo` or `foo/` in `ignores`. + +## Caching Mechanisms + +Each `ConfigArray` aggressively caches configuration objects to avoid unnecessary work. This caching occurs in two ways: + +1. **File-based Caching.** For each filename that is passed into a method, the resulting config is cached against that filename so you're always guaranteed to get the same object returned from `getConfig()` whenever you pass the same filename in. +2. **Index-based Caching.** Whenever a config is calculated, the config elements that were used to create the config are also cached. So if a given filename matches elements 1, 5, and 7, the resulting config is cached with a key of `1,5,7`. That way, if another file is passed that matches the same config elements, the result is already known and doesn't have to be recalculated. That means two files that match all the same elements will return the same config from `getConfig()`. + +## Acknowledgements + +The design of this project was influenced by feedback on the ESLint RFC, and incorporates ideas from: + +- Teddy Katz (@not-an-aardvark) +- Toru Nagashima (@mysticatea) +- Kai Cataldo (@kaicataldo) + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io

Silver Sponsors

+

SERP Triumph JetBrains Liftoff American Express

Bronze Sponsors

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/node_modules/@eslint/config-array/dist/cjs/index.cjs b/node_modules/@eslint/config-array/dist/cjs/index.cjs new file mode 100644 index 0000000..cc033c3 --- /dev/null +++ b/node_modules/@eslint/config-array/dist/cjs/index.cjs @@ -0,0 +1,1304 @@ +'use strict'; + +var posixPath = require('./std__path/posix.cjs'); +var windowsPath = require('./std__path/windows.cjs'); +var minimatch = require('minimatch'); +var createDebug = require('debug'); +var objectSchema = require('@eslint/object-schema'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); +} + +var posixPath__namespace = /*#__PURE__*/_interopNamespaceDefault(posixPath); +var windowsPath__namespace = /*#__PURE__*/_interopNamespaceDefault(windowsPath); + +/** + * @fileoverview ConfigSchema + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("@eslint/object-schema").PropertyDefinition} PropertyDefinition */ +/** @typedef {import("@eslint/object-schema").ObjectDefinition} ObjectDefinition */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * A strategy that does nothing. + * @type {PropertyDefinition} + */ +const NOOP_STRATEGY = { + required: false, + merge() { + return undefined; + }, + validate() {}, +}; + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The base schema that every ConfigArray uses. + * @type {ObjectDefinition} + */ +const baseSchema = Object.freeze({ + name: { + required: false, + merge() { + return undefined; + }, + validate(value) { + if (typeof value !== "string") { + throw new TypeError("Property must be a string."); + } + }, + }, + files: NOOP_STRATEGY, + ignores: NOOP_STRATEGY, +}); + +/** + * @fileoverview ConfigSchema + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Asserts that a given value is an array. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array. + */ +function assertIsArray(value) { + if (!Array.isArray(value)) { + throw new TypeError("Expected value to be an array."); + } +} + +/** + * Asserts that a given value is an array containing only strings and functions. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array of strings and functions. + */ +function assertIsArrayOfStringsAndFunctions(value) { + assertIsArray(value); + + if ( + value.some( + item => typeof item !== "string" && typeof item !== "function", + ) + ) { + throw new TypeError( + "Expected array to only contain strings and functions.", + ); + } +} + +/** + * Asserts that a given value is a non-empty array. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array or an empty array. + */ +function assertIsNonEmptyArray(value) { + if (!Array.isArray(value) || value.length === 0) { + throw new TypeError("Expected value to be a non-empty array."); + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The schema for `files` and `ignores` that every ConfigArray uses. + * @type {ObjectDefinition} + */ +const filesAndIgnoresSchema = Object.freeze({ + files: { + required: false, + merge() { + return undefined; + }, + validate(value) { + // first check if it's an array + assertIsNonEmptyArray(value); + + // then check each member + value.forEach(item => { + if (Array.isArray(item)) { + assertIsArrayOfStringsAndFunctions(item); + } else if ( + typeof item !== "string" && + typeof item !== "function" + ) { + throw new TypeError( + "Items must be a string, a function, or an array of strings and functions.", + ); + } + }); + }, + }, + ignores: { + required: false, + merge() { + return undefined; + }, + validate: assertIsArrayOfStringsAndFunctions, + }, +}); + +/** + * @fileoverview ConfigArray + * @author Nicholas C. Zakas + */ + + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("./types.ts").ConfigObject} ConfigObject */ +/** @typedef {import("minimatch").IMinimatchStatic} IMinimatchStatic */ +/** @typedef {import("minimatch").IMinimatch} IMinimatch */ +/** @typedef {import("@jsr/std__path")} PathImpl */ + +/* + * This is a bit of a hack to make TypeScript happy with the Rollup-created + * CommonJS file. Rollup doesn't do object destructuring for imported files + * and instead imports the default via `require()`. This messes up type checking + * for `ObjectSchema`. To work around that, we just import the type manually + * and give it a different name to use in the JSDoc comments. + */ +/** @typedef {import("@eslint/object-schema").ObjectSchema} ObjectSchemaInstance */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const Minimatch = minimatch.Minimatch; +const debug = createDebug("@eslint/config-array"); + +/** + * A cache for minimatch instances. + * @type {Map} + */ +const minimatchCache = new Map(); + +/** + * A cache for negated minimatch instances. + * @type {Map} + */ +const negatedMinimatchCache = new Map(); + +/** + * Options to use with minimatch. + * @type {Object} + */ +const MINIMATCH_OPTIONS = { + // matchBase: true, + dot: true, + allowWindowsEscape: true, +}; + +/** + * The types of config objects that are supported. + * @type {Set} + */ +const CONFIG_TYPES = new Set(["array", "function"]); + +/** + * Fields that are considered metadata and not part of the config object. + * @type {Set} + */ +const META_FIELDS = new Set(["name"]); + +/** + * A schema containing just files and ignores for early validation. + * @type {ObjectSchemaInstance} + */ +const FILES_AND_IGNORES_SCHEMA = new objectSchema.ObjectSchema(filesAndIgnoresSchema); + +// Precomputed constant objects returned by `ConfigArray.getConfigWithStatus`. + +const CONFIG_WITH_STATUS_EXTERNAL = Object.freeze({ status: "external" }); +const CONFIG_WITH_STATUS_IGNORED = Object.freeze({ status: "ignored" }); +const CONFIG_WITH_STATUS_UNCONFIGURED = Object.freeze({ + status: "unconfigured", +}); + +// Match two leading dots followed by a slash or the end of input. +const EXTERNAL_PATH_REGEX = /^\.\.(?:\/|$)/u; + +/** + * Wrapper error for config validation errors that adds a name to the front of the + * error message. + */ +class ConfigError extends Error { + /** + * Creates a new instance. + * @param {string} name The config object name causing the error. + * @param {number} index The index of the config object in the array. + * @param {Object} options The options for the error. + * @param {Error} [options.cause] The error that caused this error. + * @param {string} [options.message] The message to use for the error. + */ + constructor(name, index, { cause, message }) { + const finalMessage = message || cause.message; + + super(`Config ${name}: ${finalMessage}`, { cause }); + + // copy over custom properties that aren't represented + if (cause) { + for (const key of Object.keys(cause)) { + if (!(key in this)) { + this[key] = cause[key]; + } + } + } + + /** + * The name of the error. + * @type {string} + * @readonly + */ + this.name = "ConfigError"; + + /** + * The index of the config object in the array. + * @type {number} + * @readonly + */ + this.index = index; + } +} + +/** + * Gets the name of a config object. + * @param {ConfigObject} config The config object to get the name of. + * @returns {string} The name of the config object. + */ +function getConfigName(config) { + if (config && typeof config.name === "string" && config.name) { + return `"${config.name}"`; + } + + return "(unnamed)"; +} + +/** + * Rethrows a config error with additional information about the config object. + * @param {object} config The config object to get the name of. + * @param {number} index The index of the config object in the array. + * @param {Error} error The error to rethrow. + * @throws {ConfigError} When the error is rethrown for a config. + */ +function rethrowConfigError(config, index, error) { + const configName = getConfigName(config); + throw new ConfigError(configName, index, { cause: error }); +} + +/** + * Shorthand for checking if a value is a string. + * @param {any} value The value to check. + * @returns {boolean} True if a string, false if not. + */ +function isString(value) { + return typeof value === "string"; +} + +/** + * Creates a function that asserts that the config is valid + * during normalization. This checks that the config is not nullish + * and that files and ignores keys of a config object are valid as per base schema. + * @param {Object} config The config object to check. + * @param {number} index The index of the config object in the array. + * @returns {void} + * @throws {ConfigError} If the files and ignores keys of a config object are not valid. + */ +function assertValidBaseConfig(config, index) { + if (config === null) { + throw new ConfigError(getConfigName(config), index, { + message: "Unexpected null config.", + }); + } + + if (config === undefined) { + throw new ConfigError(getConfigName(config), index, { + message: "Unexpected undefined config.", + }); + } + + if (typeof config !== "object") { + throw new ConfigError(getConfigName(config), index, { + message: "Unexpected non-object config.", + }); + } + + const validateConfig = {}; + + if ("files" in config) { + validateConfig.files = config.files; + } + + if ("ignores" in config) { + validateConfig.ignores = config.ignores; + } + + try { + FILES_AND_IGNORES_SCHEMA.validate(validateConfig); + } catch (validationError) { + rethrowConfigError(config, index, validationError); + } +} + +/** + * Wrapper around minimatch that caches minimatch patterns for + * faster matching speed over multiple file path evaluations. + * @param {string} filepath The file path to match. + * @param {string} pattern The glob pattern to match against. + * @param {object} options The minimatch options to use. + * @returns + */ +function doMatch(filepath, pattern, options = {}) { + let cache = minimatchCache; + + if (options.flipNegate) { + cache = negatedMinimatchCache; + } + + let matcher = cache.get(pattern); + + if (!matcher) { + matcher = new Minimatch( + pattern, + Object.assign({}, MINIMATCH_OPTIONS, options), + ); + cache.set(pattern, matcher); + } + + return matcher.match(filepath); +} + +/** + * Normalizes a `ConfigArray` by flattening it and executing any functions + * that are found inside. + * @param {Array} items The items in a `ConfigArray`. + * @param {Object} context The context object to pass into any function + * found. + * @param {Array} extraConfigTypes The config types to check. + * @returns {Promise} A flattened array containing only config objects. + * @throws {TypeError} When a config function returns a function. + */ +async function normalize(items, context, extraConfigTypes) { + const allowFunctions = extraConfigTypes.includes("function"); + const allowArrays = extraConfigTypes.includes("array"); + + async function* flatTraverse(array) { + for (let item of array) { + if (typeof item === "function") { + if (!allowFunctions) { + throw new TypeError("Unexpected function."); + } + + item = item(context); + if (item.then) { + item = await item; + } + } + + if (Array.isArray(item)) { + if (!allowArrays) { + throw new TypeError("Unexpected array."); + } + yield* flatTraverse(item); + } else if (typeof item === "function") { + throw new TypeError( + "A config function can only return an object or array.", + ); + } else { + yield item; + } + } + } + + /* + * Async iterables cannot be used with the spread operator, so we need to manually + * create the array to return. + */ + const asyncIterable = await flatTraverse(items); + const configs = []; + + for await (const config of asyncIterable) { + configs.push(config); + } + + return configs; +} + +/** + * Normalizes a `ConfigArray` by flattening it and executing any functions + * that are found inside. + * @param {Array} items The items in a `ConfigArray`. + * @param {Object} context The context object to pass into any function + * found. + * @param {Array} extraConfigTypes The config types to check. + * @returns {Array} A flattened array containing only config objects. + * @throws {TypeError} When a config function returns a function. + */ +function normalizeSync(items, context, extraConfigTypes) { + const allowFunctions = extraConfigTypes.includes("function"); + const allowArrays = extraConfigTypes.includes("array"); + + function* flatTraverse(array) { + for (let item of array) { + if (typeof item === "function") { + if (!allowFunctions) { + throw new TypeError("Unexpected function."); + } + + item = item(context); + if (item.then) { + throw new TypeError( + "Async config functions are not supported.", + ); + } + } + + if (Array.isArray(item)) { + if (!allowArrays) { + throw new TypeError("Unexpected array."); + } + + yield* flatTraverse(item); + } else if (typeof item === "function") { + throw new TypeError( + "A config function can only return an object or array.", + ); + } else { + yield item; + } + } + } + + return [...flatTraverse(items)]; +} + +/** + * Determines if a given file path should be ignored based on the given + * matcher. + * @param {Array boolean)>} ignores The ignore patterns to check. + * @param {string} filePath The unprocessed file path to check. + * @param {string} relativeFilePath The path of the file to check relative to the base path, + * using forward slash (`"/"`) as a separator. + * @returns {boolean} True if the path should be ignored and false if not. + */ +function shouldIgnorePath(ignores, filePath, relativeFilePath) { + return ignores.reduce((ignored, matcher) => { + if (!ignored) { + if (typeof matcher === "function") { + return matcher(filePath); + } + + // don't check negated patterns because we're not ignored yet + if (!matcher.startsWith("!")) { + return doMatch(relativeFilePath, matcher); + } + + // otherwise we're still not ignored + return false; + } + + // only need to check negated patterns because we're ignored + if (typeof matcher === "string" && matcher.startsWith("!")) { + return !doMatch(relativeFilePath, matcher, { + flipNegate: true, + }); + } + + return ignored; + }, false); +} + +/** + * Determines if a given file path is matched by a config based on + * `ignores` only. + * @param {string} filePath The unprocessed file path to check. + * @param {string} relativeFilePath The path of the file to check relative to the base path, + * using forward slash (`"/"`) as a separator. + * @param {Object} config The config object to check. + * @returns {boolean} True if the file path is matched by the config, + * false if not. + */ +function pathMatchesIgnores(filePath, relativeFilePath, config) { + return ( + Object.keys(config).filter(key => !META_FIELDS.has(key)).length > 1 && + !shouldIgnorePath(config.ignores, filePath, relativeFilePath) + ); +} + +/** + * Determines if a given file path is matched by a config. If the config + * has no `files` field, then it matches; otherwise, if a `files` field + * is present then we match the globs in `files` and exclude any globs in + * `ignores`. + * @param {string} filePath The unprocessed file path to check. + * @param {string} relativeFilePath The path of the file to check relative to the base path, + * using forward slash (`"/"`) as a separator. + * @param {Object} config The config object to check. + * @returns {boolean} True if the file path is matched by the config, + * false if not. + */ +function pathMatches(filePath, relativeFilePath, config) { + // match both strings and functions + function match(pattern) { + if (isString(pattern)) { + return doMatch(relativeFilePath, pattern); + } + + if (typeof pattern === "function") { + return pattern(filePath); + } + + throw new TypeError(`Unexpected matcher type ${pattern}.`); + } + + // check for all matches to config.files + let filePathMatchesPattern = config.files.some(pattern => { + if (Array.isArray(pattern)) { + return pattern.every(match); + } + + return match(pattern); + }); + + /* + * If the file path matches the config.files patterns, then check to see + * if there are any files to ignore. + */ + if (filePathMatchesPattern && config.ignores) { + filePathMatchesPattern = !shouldIgnorePath( + config.ignores, + filePath, + relativeFilePath, + ); + } + + return filePathMatchesPattern; +} + +/** + * Ensures that a ConfigArray has been normalized. + * @param {ConfigArray} configArray The ConfigArray to check. + * @returns {void} + * @throws {Error} When the `ConfigArray` is not normalized. + */ +function assertNormalized(configArray) { + // TODO: Throw more verbose error + if (!configArray.isNormalized()) { + throw new Error( + "ConfigArray must be normalized to perform this operation.", + ); + } +} + +/** + * Ensures that config types are valid. + * @param {Array} extraConfigTypes The config types to check. + * @returns {void} + * @throws {Error} When the config types array is invalid. + */ +function assertExtraConfigTypes(extraConfigTypes) { + if (extraConfigTypes.length > 2) { + throw new TypeError( + "configTypes must be an array with at most two items.", + ); + } + + for (const configType of extraConfigTypes) { + if (!CONFIG_TYPES.has(configType)) { + throw new TypeError( + `Unexpected config type "${configType}" found. Expected one of: "object", "array", "function".`, + ); + } + } +} + +/** + * Returns path-handling implementations for Unix or Windows, depending on a given absolute path. + * @param {string} fileOrDirPath The absolute path to check. + * @returns {PathImpl} Path-handling implementations for the specified path. + * @throws An error is thrown if the specified argument is not an absolute path. + */ +function getPathImpl(fileOrDirPath) { + // Posix absolute paths always start with a slash. + if (fileOrDirPath.startsWith("/")) { + return posixPath__namespace; + } + + // Windows absolute paths start with a letter followed by a colon and at least one backslash, + // or with two backslashes in the case of UNC paths. + // Forward slashed are automatically normalized to backslashes. + if (/^(?:[A-Za-z]:[/\\]|[/\\]{2})/u.test(fileOrDirPath)) { + return windowsPath__namespace; + } + + throw new Error( + `Expected an absolute path but received "${fileOrDirPath}"`, + ); +} + +/** + * Converts a given path to a relative path with all separator characters replaced by forward slashes (`"/"`). + * @param {string} fileOrDirPath The unprocessed path to convert. + * @param {string} namespacedBasePath The namespaced base path of the directory to which the calculated path shall be relative. + * @param {PathImpl} path Path-handling implementations. + * @returns {string} A relative path with all separator characters replaced by forward slashes. + */ +function toRelativePath(fileOrDirPath, namespacedBasePath, path) { + const fullPath = path.resolve(namespacedBasePath, fileOrDirPath); + const namespacedFullPath = path.toNamespacedPath(fullPath); + const relativePath = path.relative(namespacedBasePath, namespacedFullPath); + return relativePath.replaceAll(path.SEPARATOR, "/"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +const ConfigArraySymbol = { + isNormalized: Symbol("isNormalized"), + configCache: Symbol("configCache"), + schema: Symbol("schema"), + finalizeConfig: Symbol("finalizeConfig"), + preprocessConfig: Symbol("preprocessConfig"), +}; + +// used to store calculate data for faster lookup +const dataCache = new WeakMap(); + +/** + * Represents an array of config objects and provides method for working with + * those config objects. + */ +class ConfigArray extends Array { + /** + * The namespaced path of the config file directory. + * @type {string} + */ + #namespacedBasePath; + + /** + * Path-handling implementations. + * @type {PathImpl} + */ + #path; + + /** + * Creates a new instance of ConfigArray. + * @param {Iterable|Function|Object} configs An iterable yielding config + * objects, or a config function, or a config object. + * @param {Object} options The options for the ConfigArray. + * @param {string} [options.basePath="/"] The absolute path of the config file directory. + * Defaults to `"/"`. + * @param {boolean} [options.normalized=false] Flag indicating if the + * configs have already been normalized. + * @param {Object} [options.schema] The additional schema + * definitions to use for the ConfigArray schema. + * @param {Array} [options.extraConfigTypes] List of config types supported. + */ + constructor( + configs, + { + basePath = "/", + normalized = false, + schema: customSchema, + extraConfigTypes = [], + } = {}, + ) { + super(); + + /** + * Tracks if the array has been normalized. + * @property isNormalized + * @type {boolean} + * @private + */ + this[ConfigArraySymbol.isNormalized] = normalized; + + /** + * The schema used for validating and merging configs. + * @property schema + * @type {ObjectSchemaInstance} + * @private + */ + this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema( + Object.assign({}, customSchema, baseSchema), + ); + + if (!isString(basePath) || !basePath) { + throw new TypeError("basePath must be a non-empty string"); + } + + /** + * The path of the config file that this array was loaded from. + * This is used to calculate filename matches. + * @property basePath + * @type {string} + */ + this.basePath = basePath; + + assertExtraConfigTypes(extraConfigTypes); + + /** + * The supported config types. + * @type {Array} + */ + this.extraConfigTypes = [...extraConfigTypes]; + Object.freeze(this.extraConfigTypes); + + /** + * A cache to store calculated configs for faster repeat lookup. + * @property configCache + * @type {Map} + * @private + */ + this[ConfigArraySymbol.configCache] = new Map(); + + // init cache + dataCache.set(this, { + explicitMatches: new Map(), + directoryMatches: new Map(), + files: undefined, + ignores: undefined, + }); + + // load the configs into this array + if (Array.isArray(configs)) { + this.push(...configs); + } else { + this.push(configs); + } + + // select path-handling implementations depending on the base path + this.#path = getPathImpl(basePath); + + // On Windows, `path.relative()` returns an absolute path when given two paths on different drives. + // The namespaced base path is useful to make sure that calculated relative paths are always relative. + // On Unix, it is identical to the base path. + this.#namespacedBasePath = this.#path.toNamespacedPath(basePath); + } + + /** + * Prevent normal array methods from creating a new `ConfigArray` instance. + * This is to ensure that methods such as `slice()` won't try to create a + * new instance of `ConfigArray` behind the scenes as doing so may throw + * an error due to the different constructor signature. + * @type {ArrayConstructor} The `Array` constructor. + */ + static get [Symbol.species]() { + return Array; + } + + /** + * Returns the `files` globs from every config object in the array. + * This can be used to determine which files will be matched by a + * config array or to use as a glob pattern when no patterns are provided + * for a command line interface. + * @returns {Array} An array of matchers. + */ + get files() { + assertNormalized(this); + + // if this data has been cached, retrieve it + const cache = dataCache.get(this); + + if (cache.files) { + return cache.files; + } + + // otherwise calculate it + + const result = []; + + for (const config of this) { + if (config.files) { + config.files.forEach(filePattern => { + result.push(filePattern); + }); + } + } + + // store result + cache.files = result; + dataCache.set(this, cache); + + return result; + } + + /** + * Returns ignore matchers that should always be ignored regardless of + * the matching `files` fields in any configs. This is necessary to mimic + * the behavior of things like .gitignore and .eslintignore, allowing a + * globbing operation to be faster. + * @returns {string[]} An array of string patterns and functions to be ignored. + */ + get ignores() { + assertNormalized(this); + + // if this data has been cached, retrieve it + const cache = dataCache.get(this); + + if (cache.ignores) { + return cache.ignores; + } + + // otherwise calculate it + + const result = []; + + for (const config of this) { + /* + * We only count ignores if there are no other keys in the object. + * In this case, it acts list a globally ignored pattern. If there + * are additional keys, then ignores act like exclusions. + */ + if ( + config.ignores && + Object.keys(config).filter(key => !META_FIELDS.has(key)) + .length === 1 + ) { + result.push(...config.ignores); + } + } + + // store result + cache.ignores = result; + dataCache.set(this, cache); + + return result; + } + + /** + * Indicates if the config array has been normalized. + * @returns {boolean} True if the config array is normalized, false if not. + */ + isNormalized() { + return this[ConfigArraySymbol.isNormalized]; + } + + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {Object} [context] The context object for config functions. + * @returns {Promise} The current ConfigArray instance. + */ + async normalize(context = {}) { + if (!this.isNormalized()) { + const normalizedConfigs = await normalize( + this, + context, + this.extraConfigTypes, + ); + this.length = 0; + this.push( + ...normalizedConfigs.map( + this[ConfigArraySymbol.preprocessConfig].bind(this), + ), + ); + this.forEach(assertValidBaseConfig); + this[ConfigArraySymbol.isNormalized] = true; + + // prevent further changes + Object.freeze(this); + } + + return this; + } + + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {Object} [context] The context object for config functions. + * @returns {ConfigArray} The current ConfigArray instance. + */ + normalizeSync(context = {}) { + if (!this.isNormalized()) { + const normalizedConfigs = normalizeSync( + this, + context, + this.extraConfigTypes, + ); + this.length = 0; + this.push( + ...normalizedConfigs.map( + this[ConfigArraySymbol.preprocessConfig].bind(this), + ), + ); + this.forEach(assertValidBaseConfig); + this[ConfigArraySymbol.isNormalized] = true; + + // prevent further changes + Object.freeze(this); + } + + return this; + } + + /* eslint-disable class-methods-use-this -- Desired as instance methods */ + + /** + * Finalizes the state of a config before being cached and returned by + * `getConfig()`. Does nothing by default but is provided to be + * overridden by subclasses as necessary. + * @param {Object} config The config to finalize. + * @returns {Object} The finalized config. + */ + [ConfigArraySymbol.finalizeConfig](config) { + return config; + } + + /** + * Preprocesses a config during the normalization process. This is the + * method to override if you want to convert an array item before it is + * validated for the first time. For example, if you want to replace a + * string with an object, this is the method to override. + * @param {Object} config The config to preprocess. + * @returns {Object} The config to use in place of the argument. + */ + [ConfigArraySymbol.preprocessConfig](config) { + return config; + } + + /* eslint-enable class-methods-use-this -- Desired as instance methods */ + + /** + * Returns the config object for a given file path and a status that can be used to determine why a file has no config. + * @param {string} filePath The path of a file to get a config for. + * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }} + * An object with an optional property `config` and property `status`. + * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig}, + * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}. + */ + getConfigWithStatus(filePath) { + assertNormalized(this); + + const cache = this[ConfigArraySymbol.configCache]; + + // first check the cache for a filename match to avoid duplicate work + if (cache.has(filePath)) { + return cache.get(filePath); + } + + // check to see if the file is outside the base path + + const relativeFilePath = toRelativePath( + filePath, + this.#namespacedBasePath, + this.#path, + ); + + if (EXTERNAL_PATH_REGEX.test(relativeFilePath)) { + debug(`No config for file ${filePath} outside of base path`); + + // cache and return result + cache.set(filePath, CONFIG_WITH_STATUS_EXTERNAL); + return CONFIG_WITH_STATUS_EXTERNAL; + } + + // next check to see if the file should be ignored + + // check if this should be ignored due to its directory + if (this.isDirectoryIgnored(this.#path.dirname(filePath))) { + debug(`Ignoring ${filePath} based on directory pattern`); + + // cache and return result + cache.set(filePath, CONFIG_WITH_STATUS_IGNORED); + return CONFIG_WITH_STATUS_IGNORED; + } + + if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath} based on file pattern`); + + // cache and return result + cache.set(filePath, CONFIG_WITH_STATUS_IGNORED); + return CONFIG_WITH_STATUS_IGNORED; + } + + // filePath isn't automatically ignored, so try to construct config + + const matchingConfigIndices = []; + let matchFound = false; + const universalPattern = /^\*$|\/\*{1,2}$/u; + + this.forEach((config, index) => { + if (!config.files) { + if (!config.ignores) { + debug(`Universal config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + if (pathMatchesIgnores(filePath, relativeFilePath, config)) { + debug( + `Matching config found for ${filePath} (based on ignores: ${config.ignores})`, + ); + matchingConfigIndices.push(index); + return; + } + + debug( + `Skipped config found for ${filePath} (based on ignores: ${config.ignores})`, + ); + return; + } + + /* + * If a config has a files pattern * or patterns ending in /** or /*, + * and the filePath only matches those patterns, then the config is only + * applied if there is another config where the filePath matches + * a file with a specific extensions such as *.js. + */ + + const universalFiles = config.files.filter(pattern => + universalPattern.test(pattern), + ); + + // universal patterns were found so we need to check the config twice + if (universalFiles.length) { + debug("Universal files patterns found. Checking carefully."); + + const nonUniversalFiles = config.files.filter( + pattern => !universalPattern.test(pattern), + ); + + // check that the config matches without the non-universal files first + if ( + nonUniversalFiles.length && + pathMatches(filePath, relativeFilePath, { + files: nonUniversalFiles, + ignores: config.ignores, + }) + ) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + matchFound = true; + return; + } + + // if there wasn't a match then check if it matches with universal files + if ( + universalFiles.length && + pathMatches(filePath, relativeFilePath, { + files: universalFiles, + ignores: config.ignores, + }) + ) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + // if we make here, then there was no match + return; + } + + // the normal case + if (pathMatches(filePath, relativeFilePath, config)) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + matchFound = true; + } + }); + + // if matching both files and ignores, there will be no config to create + if (!matchFound) { + debug(`No matching configs found for ${filePath}`); + + // cache and return result + cache.set(filePath, CONFIG_WITH_STATUS_UNCONFIGURED); + return CONFIG_WITH_STATUS_UNCONFIGURED; + } + + // check to see if there is a config cached by indices + const indicesKey = matchingConfigIndices.toString(); + let configWithStatus = cache.get(indicesKey); + + if (configWithStatus) { + // also store for filename for faster lookup next time + cache.set(filePath, configWithStatus); + + return configWithStatus; + } + + // otherwise construct the config + + // eslint-disable-next-line array-callback-return, consistent-return -- rethrowConfigError always throws an error + let finalConfig = matchingConfigIndices.reduce((result, index) => { + try { + return this[ConfigArraySymbol.schema].merge( + result, + this[index], + ); + } catch (validationError) { + rethrowConfigError(this[index], index, validationError); + } + }, {}); + + finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig); + + configWithStatus = Object.freeze({ + config: finalConfig, + status: "matched", + }); + cache.set(filePath, configWithStatus); + cache.set(indicesKey, configWithStatus); + + return configWithStatus; + } + + /** + * Returns the config object for a given file path. + * @param {string} filePath The path of a file to get a config for. + * @returns {Object|undefined} The config object for this file or `undefined`. + */ + getConfig(filePath) { + return this.getConfigWithStatus(filePath).config; + } + + /** + * Determines whether a file has a config or why it doesn't. + * @param {string} filePath The path of the file to check. + * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values: + * * `"ignored"`: the file is ignored + * * `"external"`: the file is outside the base path + * * `"unconfigured"`: the file is not matched by any config + * * `"matched"`: the file has a matching config + */ + getConfigStatus(filePath) { + return this.getConfigWithStatus(filePath).status; + } + + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + * @deprecated Use `isFileIgnored` instead. + */ + isIgnored(filePath) { + return this.isFileIgnored(filePath); + } + + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + */ + isFileIgnored(filePath) { + return this.getConfigStatus(filePath) === "ignored"; + } + + /** + * Determines if the given directory is ignored based on the configs. + * This checks only default `ignores` that don't have `files` in the + * same config. A pattern such as `/foo` be considered to ignore the directory + * while a pattern such as `/foo/**` is not considered to ignore the + * directory because it is matching files. + * @param {string} directoryPath The path of a directory to check. + * @returns {boolean} True if the directory is ignored, false if not. Will + * return true for any directory that is not inside of `basePath`. + * @throws {Error} When the `ConfigArray` is not normalized. + */ + isDirectoryIgnored(directoryPath) { + assertNormalized(this); + + const relativeDirectoryPath = toRelativePath( + directoryPath, + this.#namespacedBasePath, + this.#path, + ); + + // basePath directory can never be ignored + if (relativeDirectoryPath === "") { + return false; + } + + if (EXTERNAL_PATH_REGEX.test(relativeDirectoryPath)) { + return true; + } + + // first check the cache + const cache = dataCache.get(this).directoryMatches; + + if (cache.has(relativeDirectoryPath)) { + return cache.get(relativeDirectoryPath); + } + + const directoryParts = relativeDirectoryPath.split("/"); + let relativeDirectoryToCheck = ""; + let result; + + /* + * In order to get the correct gitignore-style ignores, where an + * ignored parent directory cannot have any descendants unignored, + * we need to check every directory starting at the parent all + * the way down to the actual requested directory. + * + * We aggressively cache all of this info to make sure we don't + * have to recalculate everything for every call. + */ + do { + relativeDirectoryToCheck += `${directoryParts.shift()}/`; + + result = shouldIgnorePath( + this.ignores, + this.#path.join(this.basePath, relativeDirectoryToCheck), + relativeDirectoryToCheck, + ); + + cache.set(relativeDirectoryToCheck, result); + } while (!result && directoryParts.length); + + // also cache the result for the requested path + cache.set(relativeDirectoryPath, result); + + return result; + } +} + +Object.defineProperty(exports, "ObjectSchema", { + enumerable: true, + get: function () { return objectSchema.ObjectSchema; } +}); +exports.ConfigArray = ConfigArray; +exports.ConfigArraySymbol = ConfigArraySymbol; diff --git a/node_modules/@eslint/config-array/dist/cjs/index.d.cts b/node_modules/@eslint/config-array/dist/cjs/index.d.cts new file mode 100644 index 0000000..09c3767 --- /dev/null +++ b/node_modules/@eslint/config-array/dist/cjs/index.d.cts @@ -0,0 +1,142 @@ +export { ObjectSchema } from "@eslint/object-schema"; +export type PropertyDefinition = import("@eslint/object-schema").PropertyDefinition; +export type ObjectDefinition = import("@eslint/object-schema").ObjectDefinition; +export type ConfigObject = import("./types.cts").ConfigObject; +export type IMinimatchStatic = import("minimatch").IMinimatchStatic; +export type IMinimatch = import("minimatch").IMinimatch; +export type PathImpl = typeof import("@jsr/std__path"); +export type ObjectSchemaInstance = import("@eslint/object-schema").ObjectSchema; +/** + * Represents an array of config objects and provides method for working with + * those config objects. + */ +export class ConfigArray extends Array { + [x: symbol]: (config: any) => any; + /** + * Creates a new instance of ConfigArray. + * @param {Iterable|Function|Object} configs An iterable yielding config + * objects, or a config function, or a config object. + * @param {Object} options The options for the ConfigArray. + * @param {string} [options.basePath="/"] The absolute path of the config file directory. + * Defaults to `"/"`. + * @param {boolean} [options.normalized=false] Flag indicating if the + * configs have already been normalized. + * @param {Object} [options.schema] The additional schema + * definitions to use for the ConfigArray schema. + * @param {Array} [options.extraConfigTypes] List of config types supported. + */ + constructor(configs: Iterable | Function | any, { basePath, normalized, schema: customSchema, extraConfigTypes, }?: { + basePath?: string; + normalized?: boolean; + schema?: any; + extraConfigTypes?: Array; + }); + /** + * The path of the config file that this array was loaded from. + * This is used to calculate filename matches. + * @property basePath + * @type {string} + */ + basePath: string; + /** + * The supported config types. + * @type {Array} + */ + extraConfigTypes: Array; + /** + * Returns the `files` globs from every config object in the array. + * This can be used to determine which files will be matched by a + * config array or to use as a glob pattern when no patterns are provided + * for a command line interface. + * @returns {Array} An array of matchers. + */ + get files(): Array; + /** + * Returns ignore matchers that should always be ignored regardless of + * the matching `files` fields in any configs. This is necessary to mimic + * the behavior of things like .gitignore and .eslintignore, allowing a + * globbing operation to be faster. + * @returns {string[]} An array of string patterns and functions to be ignored. + */ + get ignores(): string[]; + /** + * Indicates if the config array has been normalized. + * @returns {boolean} True if the config array is normalized, false if not. + */ + isNormalized(): boolean; + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {Object} [context] The context object for config functions. + * @returns {Promise} The current ConfigArray instance. + */ + normalize(context?: any): Promise; + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {Object} [context] The context object for config functions. + * @returns {ConfigArray} The current ConfigArray instance. + */ + normalizeSync(context?: any): ConfigArray; + /** + * Returns the config object for a given file path and a status that can be used to determine why a file has no config. + * @param {string} filePath The path of a file to get a config for. + * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }} + * An object with an optional property `config` and property `status`. + * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig}, + * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}. + */ + getConfigWithStatus(filePath: string): { + config?: any; + status: "ignored" | "external" | "unconfigured" | "matched"; + }; + /** + * Returns the config object for a given file path. + * @param {string} filePath The path of a file to get a config for. + * @returns {Object|undefined} The config object for this file or `undefined`. + */ + getConfig(filePath: string): any | undefined; + /** + * Determines whether a file has a config or why it doesn't. + * @param {string} filePath The path of the file to check. + * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values: + * * `"ignored"`: the file is ignored + * * `"external"`: the file is outside the base path + * * `"unconfigured"`: the file is not matched by any config + * * `"matched"`: the file has a matching config + */ + getConfigStatus(filePath: string): "ignored" | "external" | "unconfigured" | "matched"; + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + * @deprecated Use `isFileIgnored` instead. + */ + isIgnored(filePath: string): boolean; + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + */ + isFileIgnored(filePath: string): boolean; + /** + * Determines if the given directory is ignored based on the configs. + * This checks only default `ignores` that don't have `files` in the + * same config. A pattern such as `/foo` be considered to ignore the directory + * while a pattern such as `/foo/**` is not considered to ignore the + * directory because it is matching files. + * @param {string} directoryPath The path of a directory to check. + * @returns {boolean} True if the directory is ignored, false if not. Will + * return true for any directory that is not inside of `basePath`. + * @throws {Error} When the `ConfigArray` is not normalized. + */ + isDirectoryIgnored(directoryPath: string): boolean; + #private; +} +export namespace ConfigArraySymbol { + let isNormalized: symbol; + let configCache: symbol; + let schema: symbol; + let finalizeConfig: symbol; + let preprocessConfig: symbol; +} diff --git a/node_modules/@eslint/config-array/dist/cjs/std__path/posix.cjs b/node_modules/@eslint/config-array/dist/cjs/std__path/posix.cjs new file mode 100644 index 0000000..efd6825 --- /dev/null +++ b/node_modules/@eslint/config-array/dist/cjs/std__path/posix.cjs @@ -0,0 +1,1324 @@ +'use strict'; + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +function assertPath(path) { + if (typeof path !== "string") { + throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function stripSuffix(name, suffix) { + if (suffix.length >= name.length) { + return name; + } + const lenDiff = name.length - suffix.length; + for(let i = suffix.length - 1; i >= 0; --i){ + if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) { + return name; + } + } + return name.slice(0, -suffix.length); +} +function lastPathSegment(path, isSep, start = 0) { + let matchedNonSeparator = false; + let end = path.length; + for(let i = path.length - 1; i >= start; --i){ + if (isSep(path.charCodeAt(i))) { + if (matchedNonSeparator) { + start = i + 1; + break; + } + } else if (!matchedNonSeparator) { + matchedNonSeparator = true; + end = i + 1; + } + } + return path.slice(start, end); +} +function assertArgs$1(path, suffix) { + assertPath(path); + if (path.length === 0) return path; + if (typeof suffix !== "string") { + throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +function stripTrailingSeparators(segment, isSep) { + if (segment.length <= 1) { + return segment; + } + let end = segment.length; + for(let i = segment.length - 1; i > 0; i--){ + if (isSep(segment.charCodeAt(i))) { + end = i; + } else { + break; + } + } + return segment.slice(0, end); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +// Alphabet chars. +// Non-alphabetic chars. +const CHAR_DOT = 46; /* . */ +const CHAR_FORWARD_SLASH = 47; /* / */ + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +function isPosixPathSeparator(code) { + return code === CHAR_FORWARD_SLASH; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the last portion of a `path`. + * Trailing directory separators are ignored, and optional suffix is removed. + * + * @example Usage + * ```ts + * import { basename } from "@std/path/posix/basename"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(basename("/home/user/Documents/"), "Documents"); + * assertEquals(basename("/home/user/Documents/image.png"), "image.png"); + * assertEquals(basename("/home/user/Documents/image.png", ".png"), "image"); + * ``` + * + * @example Working with URLs + * + * Note: This function doesn't automatically strip hash and query parts from + * URLs. If your URL contains a hash or query, remove them before passing the + * URL to the function. This can be done by passing the URL to `new URL(url)`, + * and setting the `hash` and `search` properties to empty strings. + * + * ```ts + * import { basename } from "@std/path/posix/basename"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(basename("https://deno.land/std/path/mod.ts"), "mod.ts"); + * assertEquals(basename("https://deno.land/std/path/mod.ts", ".ts"), "mod"); + * assertEquals(basename("https://deno.land/std/path/mod.ts?a=b"), "mod.ts?a=b"); + * assertEquals(basename("https://deno.land/std/path/mod.ts#header"), "mod.ts#header"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `basename` from `@std/path/posix/unstable-basename`. + * + * @param path The path to extract the name from. + * @param suffix The suffix to remove from extracted name. + * @returns The extracted name. + */ function basename(path, suffix = "") { + assertArgs$1(path, suffix); + const lastSegment = lastPathSegment(path, isPosixPathSeparator); + const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator); + return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * The character used to separate entries in the PATH environment variable. + */ const DELIMITER = ":"; +/** + * The character used to separate components of a file path. + */ const SEPARATOR = "/"; +/** + * A regular expression that matches one or more path separators. + */ const SEPARATOR_PATTERN = /\/+/; + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg$3(path) { + assertPath(path); + if (path.length === 0) return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the directory path of a `path`. + * + * @example Usage + * ```ts + * import { dirname } from "@std/path/posix/dirname"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(dirname("/home/user/Documents/"), "/home/user"); + * assertEquals(dirname("/home/user/Documents/image.png"), "/home/user/Documents"); + * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path"); + * ``` + * + * @example Working with URLs + * + * ```ts + * import { dirname } from "@std/path/posix/dirname"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path"); + * assertEquals(dirname("https://deno.land/std/path/mod.ts?a=b"), "https://deno.land/std/path"); + * assertEquals(dirname("https://deno.land/std/path/mod.ts#header"), "https://deno.land/std/path"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `dirname` from `@std/path/posix/unstable-dirname`. + * + * @param path The path to get the directory from. + * @returns The directory path. + */ function dirname(path) { + assertArg$3(path); + let end = -1; + let matchedNonSeparator = false; + for(let i = path.length - 1; i >= 1; --i){ + if (isPosixPathSeparator(path.charCodeAt(i))) { + if (matchedNonSeparator) { + end = i; + break; + } + } else { + matchedNonSeparator = true; + } + } + // No matches. Fallback based on provided path: + // + // - leading slashes paths + // "/foo" => "/" + // "///foo" => "/" + // - no slash path + // "foo" => "." + if (end === -1) { + return isPosixPathSeparator(path.charCodeAt(0)) ? "/" : "."; + } + return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the extension of the `path` with leading period. + * + * @example Usage + * ```ts + * import { extname } from "@std/path/posix/extname"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(extname("/home/user/Documents/file.ts"), ".ts"); + * assertEquals(extname("/home/user/Documents/"), ""); + * assertEquals(extname("/home/user/Documents/image.png"), ".png"); + * ``` + * + * @example Working with URLs + * + * Note: This function doesn't automatically strip hash and query parts from + * URLs. If your URL contains a hash or query, remove them before passing the + * URL to the function. This can be done by passing the URL to `new URL(url)`, + * and setting the `hash` and `search` properties to empty strings. + * + * ```ts + * import { extname } from "@std/path/posix/extname"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(extname("https://deno.land/std/path/mod.ts"), ".ts"); + * assertEquals(extname("https://deno.land/std/path/mod.ts?a=b"), ".ts?a=b"); + * assertEquals(extname("https://deno.land/std/path/mod.ts#header"), ".ts#header"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `extname` from `@std/path/posix/unstable-extname`. + * + * @param path The path to get the extension from. + * @returns The extension (ex. for `file.ts` returns `.ts`). + */ function extname(path) { + assertPath(path); + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + let preDotState = 0; + for(let i = path.length - 1; i >= 0; --i){ + const code = path.charCodeAt(i); + if (isPosixPathSeparator(code)) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path.slice(startDot, end); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function _format(sep, pathObject) { + const dir = pathObject.dir || pathObject.root; + const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? ""); + if (!dir) return base; + if (base === sep) return dir; + if (dir === pathObject.root) return dir + base; + return dir + sep + base; +} +function assertArg$2(pathObject) { + if (pathObject === null || typeof pathObject !== "object") { + throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Generate a path from `ParsedPath` object. + * + * @example Usage + * ```ts + * import { format } from "@std/path/posix/format"; + * import { assertEquals } from "@std/assert"; + * + * const path = format({ + * root: "/", + * dir: "/path/dir", + * base: "file.txt", + * ext: ".txt", + * name: "file" + * }); + * assertEquals(path, "/path/dir/file.txt"); + * ``` + * + * @param pathObject The path object to format. + * @returns The formatted path. + */ function format(pathObject) { + assertArg$2(pathObject); + return _format("/", pathObject); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg$1(url) { + url = url instanceof URL ? url : new URL(url); + if (url.protocol !== "file:") { + throw new TypeError(`URL must be a file URL: received "${url.protocol}"`); + } + return url; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a file URL to a path string. + * + * @example Usage + * ```ts + * import { fromFileUrl } from "@std/path/posix/from-file-url"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo"); + * ``` + * + * @param url The file URL to convert. + * @returns The path string. + */ function fromFileUrl(url) { + url = assertArg$1(url); + return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25")); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Verifies whether provided path is absolute. + * + * @example Usage + * ```ts + * import { isAbsolute } from "@std/path/posix/is-absolute"; + * import { assert, assertFalse } from "@std/assert"; + * + * assert(isAbsolute("/home/user/Documents/")); + * assertFalse(isAbsolute("home/user/Documents/")); + * ``` + * + * @param path The path to verify. + * @returns Whether the path is absolute. + */ function isAbsolute(path) { + assertPath(path); + return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0)); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg(path) { + assertPath(path); + if (path.length === 0) return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +// Resolves . and .. elements in a path with directory names +function normalizeString(path, allowAboveRoot, separator, isPathSeparator) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let code; + for(let i = 0; i <= path.length; ++i){ + if (i < path.length) code = path.charCodeAt(i); + else if (isPathSeparator(code)) break; + else code = CHAR_FORWARD_SLASH; + if (isPathSeparator(code)) { + if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf(separator); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); + } + lastSlash = i; + dots = 0; + continue; + } else if (res.length === 2 || res.length === 1) { + res = ""; + lastSegmentLength = 0; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) res += `${separator}..`; + else res = ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) res += separator + path.slice(lastSlash + 1, i); + else res = path.slice(lastSlash + 1, i); + lastSegmentLength = i - lastSlash - 1; + } + lastSlash = i; + dots = 0; + } else if (code === CHAR_DOT && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Normalize the `path`, resolving `'..'` and `'.'` segments. + * Note that resolving these segments does not necessarily mean that all will be eliminated. + * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`. + * + * @example Usage + * ```ts + * import { normalize } from "@std/path/posix/normalize"; + * import { assertEquals } from "@std/assert"; + * + * const path = normalize("/foo/bar//baz/asdf/quux/.."); + * assertEquals(path, "/foo/bar/baz/asdf"); + * ``` + * + * @example Working with URLs + * + * Note: This function will remove the double slashes from a URL's scheme. + * Hence, do not pass a full URL to this function. Instead, pass the pathname of + * the URL. + * + * ```ts + * import { normalize } from "@std/path/posix/normalize"; + * import { assertEquals } from "@std/assert"; + * + * const url = new URL("https://deno.land"); + * url.pathname = normalize("//std//assert//.//mod.ts"); + * assertEquals(url.href, "https://deno.land/std/assert/mod.ts"); + * + * url.pathname = normalize("std/assert/../async/retry.ts"); + * assertEquals(url.href, "https://deno.land/std/async/retry.ts"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `normalize` from `@std/path/posix/unstable-normalize`. + * + * @param path The path to normalize. + * @returns The normalized path. + */ function normalize(path) { + assertArg(path); + const isAbsolute = isPosixPathSeparator(path.charCodeAt(0)); + const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1)); + // Normalize the path + path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator); + if (path.length === 0 && !isAbsolute) path = "."; + if (path.length > 0 && trailingSeparator) path += "/"; + if (isAbsolute) return `/${path}`; + return path; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Join all given a sequence of `paths`,then normalizes the resulting path. + * + * @example Usage + * ```ts + * import { join } from "@std/path/posix/join"; + * import { assertEquals } from "@std/assert"; + * + * const path = join("/foo", "bar", "baz/asdf", "quux", ".."); + * assertEquals(path, "/foo/bar/baz/asdf"); + * ``` + * + * @example Working with URLs + * ```ts + * import { join } from "@std/path/posix/join"; + * import { assertEquals } from "@std/assert"; + * + * const url = new URL("https://deno.land"); + * url.pathname = join("std", "path", "mod.ts"); + * assertEquals(url.href, "https://deno.land/std/path/mod.ts"); + * + * url.pathname = join("//std", "path/", "/mod.ts"); + * assertEquals(url.href, "https://deno.land/std/path/mod.ts"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `join` from `@std/path/posix/unstable-join`. + * + * @param paths The paths to join. + * @returns The joined path. + */ function join(...paths) { + if (paths.length === 0) return "."; + paths.forEach((path)=>assertPath(path)); + const joined = paths.filter((path)=>path.length > 0).join("/"); + return joined === "" ? "." : normalize(joined); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return a `ParsedPath` object of the `path`. + * + * @example Usage + * ```ts + * import { parse } from "@std/path/posix/parse"; + * import { assertEquals } from "@std/assert"; + * + * const path = parse("/home/user/file.txt"); + * assertEquals(path, { + * root: "/", + * dir: "/home/user", + * base: "file.txt", + * ext: ".txt", + * name: "file" + * }); + * ``` + * + * @param path The path to parse. + * @returns The parsed path object. + */ function parse(path) { + assertPath(path); + const ret = { + root: "", + dir: "", + base: "", + ext: "", + name: "" + }; + if (path.length === 0) return ret; + const isAbsolute = isPosixPathSeparator(path.charCodeAt(0)); + let start; + if (isAbsolute) { + ret.root = "/"; + start = 1; + } else { + start = 0; + } + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + let i = path.length - 1; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + let preDotState = 0; + // Get non-dir info + for(; i >= start; --i){ + const code = path.charCodeAt(i); + if (isPosixPathSeparator(code)) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + if (end !== -1) { + if (startPart === 0 && isAbsolute) { + ret.base = ret.name = path.slice(1, end); + } else { + ret.base = ret.name = path.slice(startPart, end); + } + } + // Fallback to '/' in case there is no basename + ret.base = ret.base || "/"; + } else { + if (startPart === 0 && isAbsolute) { + ret.name = path.slice(1, startDot); + ret.base = path.slice(1, end); + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + } + ret.ext = path.slice(startDot, end); + } + if (startPart > 0) { + ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator); + } else if (isAbsolute) ret.dir = "/"; + return ret; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Resolves path segments into a `path`. + * + * @example Usage + * ```ts + * import { resolve } from "@std/path/posix/resolve"; + * import { assertEquals } from "@std/assert"; + * + * const path = resolve("/foo", "bar", "baz/asdf", "quux", ".."); + * assertEquals(path, "/foo/bar/baz/asdf"); + * ``` + * + * @param pathSegments The path segments to resolve. + * @returns The resolved path. + */ function resolve(...pathSegments) { + let resolvedPath = ""; + let resolvedAbsolute = false; + for(let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--){ + let path; + if (i >= 0) path = pathSegments[i]; + else { + // deno-lint-ignore no-explicit-any + const { Deno } = globalThis; + if (typeof Deno?.cwd !== "function") { + throw new TypeError("Resolved a relative path without a current working directory (CWD)"); + } + path = Deno.cwd(); + } + assertPath(path); + // Skip empty entries + if (path.length === 0) { + continue; + } + resolvedPath = `${path}/${resolvedPath}`; + resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0)); + } + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when Deno.cwd() fails) + // Normalize the path + resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator); + if (resolvedAbsolute) { + if (resolvedPath.length > 0) return `/${resolvedPath}`; + else return "/"; + } else if (resolvedPath.length > 0) return resolvedPath; + else return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArgs(from, to) { + assertPath(from); + assertPath(to); + if (from === to) return ""; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the relative path from `from` to `to` based on current working directory. + * + * If `from` and `to` are the same, return an empty string. + * + * @example Usage + * ```ts + * import { relative } from "@std/path/posix/relative"; + * import { assertEquals } from "@std/assert"; + * + * const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb"); + * assertEquals(path, "../../impl/bbb"); + * ``` + * + * @param from The path to start from. + * @param to The path to reach. + * @returns The relative path. + */ function relative(from, to) { + assertArgs(from, to); + from = resolve(from); + to = resolve(to); + if (from === to) return ""; + // Trim any leading backslashes + let fromStart = 1; + const fromEnd = from.length; + for(; fromStart < fromEnd; ++fromStart){ + if (!isPosixPathSeparator(from.charCodeAt(fromStart))) break; + } + const fromLen = fromEnd - fromStart; + // Trim any leading backslashes + let toStart = 1; + const toEnd = to.length; + for(; toStart < toEnd; ++toStart){ + if (!isPosixPathSeparator(to.charCodeAt(toStart))) break; + } + const toLen = toEnd - toStart; + // Compare paths to find the longest common path from root + const length = fromLen < toLen ? fromLen : toLen; + let lastCommonSep = -1; + let i = 0; + for(; i <= length; ++i){ + if (i === length) { + if (toLen > length) { + if (isPosixPathSeparator(to.charCodeAt(toStart + i))) { + // We get here if `from` is the exact base path for `to`. + // For example: from='/foo/bar'; to='/foo/bar/baz' + return to.slice(toStart + i + 1); + } else if (i === 0) { + // We get here if `from` is the root + // For example: from='/'; to='/foo' + return to.slice(toStart + i); + } + } else if (fromLen > length) { + if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) { + // We get here if `to` is the exact base path for `from`. + // For example: from='/foo/bar/baz'; to='/foo/bar' + lastCommonSep = i; + } else if (i === 0) { + // We get here if `to` is the root. + // For example: from='/foo'; to='/' + lastCommonSep = 0; + } + } + break; + } + const fromCode = from.charCodeAt(fromStart + i); + const toCode = to.charCodeAt(toStart + i); + if (fromCode !== toCode) break; + else if (isPosixPathSeparator(fromCode)) lastCommonSep = i; + } + let out = ""; + // Generate the relative path based on the path difference between `to` + // and `from` + for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){ + if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) { + if (out.length === 0) out += ".."; + else out += "/.."; + } + } + // Lastly, append the rest of the destination (`to`) path that comes after + // the common path parts + if (out.length > 0) return out + to.slice(toStart + lastCommonSep); + else { + toStart += lastCommonSep; + if (isPosixPathSeparator(to.charCodeAt(toStart))) ++toStart; + return to.slice(toStart); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +const WHITESPACE_ENCODINGS = { + "\u0009": "%09", + "\u000A": "%0A", + "\u000B": "%0B", + "\u000C": "%0C", + "\u000D": "%0D", + "\u0020": "%20" +}; +function encodeWhitespace(string) { + return string.replaceAll(/[\s]/g, (c)=>{ + return WHITESPACE_ENCODINGS[c] ?? c; + }); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a path string to a file URL. + * + * @example Usage + * ```ts + * import { toFileUrl } from "@std/path/posix/to-file-url"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo")); + * assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar")); + * ``` + * + * @param path The path to convert. + * @returns The file URL. + */ function toFileUrl(path) { + if (!isAbsolute(path)) { + throw new TypeError(`Path must be absolute: received "${path}"`); + } + const url = new URL("file:///"); + url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C")); + return url; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a path to a namespaced path. This function returns the path as is on posix. + * + * @example Usage + * ```ts + * import { toNamespacedPath } from "@std/path/posix/to-namespaced-path"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(toNamespacedPath("/home/foo"), "/home/foo"); + * ``` + * + * @param path The path. + * @returns The namespaced path. + */ function toNamespacedPath(path) { + // Non-op on posix systems + return path; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function common$1(paths, sep) { + const [first = "", ...remaining] = paths; + const parts = first.split(sep); + let endOfPrefix = parts.length; + let append = ""; + for (const path of remaining){ + const compare = path.split(sep); + if (compare.length <= endOfPrefix) { + endOfPrefix = compare.length; + append = ""; + } + for(let i = 0; i < endOfPrefix; i++){ + if (compare[i] !== parts[i]) { + endOfPrefix = i; + append = i === 0 ? "" : sep; + break; + } + } + } + return parts.slice(0, endOfPrefix).join(sep) + append; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** Determines the common path from a set of paths for POSIX systems. + * + * @example Usage + * ```ts + * import { common } from "@std/path/posix/common"; + * import { assertEquals } from "@std/assert"; + * + * const path = common([ + * "./deno/std/path/mod.ts", + * "./deno/std/fs/mod.ts", + * ]); + * assertEquals(path, "./deno/std/"); + * ``` + * + * @param paths The paths to compare. + * @returns The common path. + */ function common(paths) { + return common$1(paths, SEPARATOR); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs}, + * {@linkcode normalizeGlob} and {@linkcode expandGlob}. + */ const REG_EXP_ESCAPE_CHARS = [ + "!", + "$", + "(", + ")", + "*", + "+", + ".", + "=", + "?", + "[", + "\\", + "^", + "{", + "|" +]; +const RANGE_ESCAPE_CHARS = [ + "-", + "\\", + "]" +]; +function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType, +caseInsensitive = false } = {}) { + if (glob === "") { + return /(?!)/; + } + // Remove trailing separators. + let newLength = glob.length; + for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--); + glob = glob.slice(0, newLength); + let regExpString = ""; + // Terminates correctly. Trust that `j` is incremented every iteration. + for(let j = 0; j < glob.length;){ + let segment = ""; + const groupStack = []; + let inRange = false; + let inEscape = false; + let endsWithSep = false; + let i = j; + // Terminates with `i` at the non-inclusive end of the current segment. + for(; i < glob.length && !c.seps.includes(glob[i]); i++){ + if (inEscape) { + inEscape = false; + const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS; + segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i]; + continue; + } + if (glob[i] === c.escapePrefix) { + inEscape = true; + continue; + } + if (glob[i] === "[") { + if (!inRange) { + inRange = true; + segment += "["; + if (glob[i + 1] === "!") { + i++; + segment += "^"; + } else if (glob[i + 1] === "^") { + i++; + segment += "\\^"; + } + continue; + } else if (glob[i + 1] === ":") { + let k = i + 1; + let value = ""; + while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){ + value += glob[k + 1]; + k++; + } + if (glob[k + 1] === ":" && glob[k + 2] === "]") { + i = k + 2; + if (value === "alnum") segment += "\\dA-Za-z"; + else if (value === "alpha") segment += "A-Za-z"; + else if (value === "ascii") segment += "\x00-\x7F"; + else if (value === "blank") segment += "\t "; + else if (value === "cntrl") segment += "\x00-\x1F\x7F"; + else if (value === "digit") segment += "\\d"; + else if (value === "graph") segment += "\x21-\x7E"; + else if (value === "lower") segment += "a-z"; + else if (value === "print") segment += "\x20-\x7E"; + else if (value === "punct") { + segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~"; + } else if (value === "space") segment += "\\s\v"; + else if (value === "upper") segment += "A-Z"; + else if (value === "word") segment += "\\w"; + else if (value === "xdigit") segment += "\\dA-Fa-f"; + continue; + } + } + } + if (glob[i] === "]" && inRange) { + inRange = false; + segment += "]"; + continue; + } + if (inRange) { + segment += glob[i]; + continue; + } + if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") { + segment += ")"; + const type = groupStack.pop(); + if (type === "!") { + segment += c.wildcard; + } else if (type !== "@") { + segment += type; + } + continue; + } + if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") { + segment += "|"; + continue; + } + if (glob[i] === "+" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("+"); + segment += "(?:"; + continue; + } + if (glob[i] === "@" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("@"); + segment += "(?:"; + continue; + } + if (glob[i] === "?") { + if (extended && glob[i + 1] === "(") { + i++; + groupStack.push("?"); + segment += "(?:"; + } else { + segment += "."; + } + continue; + } + if (glob[i] === "!" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("!"); + segment += "(?!"; + continue; + } + if (glob[i] === "{") { + groupStack.push("BRACE"); + segment += "(?:"; + continue; + } + if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") { + groupStack.pop(); + segment += ")"; + continue; + } + if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") { + segment += "|"; + continue; + } + if (glob[i] === "*") { + if (extended && glob[i + 1] === "(") { + i++; + groupStack.push("*"); + segment += "(?:"; + } else { + const prevChar = glob[i - 1]; + let numStars = 1; + while(glob[i + 1] === "*"){ + i++; + numStars++; + } + const nextChar = glob[i + 1]; + if (globstarOption && numStars === 2 && [ + ...c.seps, + undefined + ].includes(prevChar) && [ + ...c.seps, + undefined + ].includes(nextChar)) { + segment += c.globstar; + endsWithSep = true; + } else { + segment += c.wildcard; + } + } + continue; + } + segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i]; + } + // Check for unclosed groups or a dangling backslash. + if (groupStack.length > 0 || inRange || inEscape) { + // Parse failure. Take all characters from this segment literally. + segment = ""; + for (const c of glob.slice(j, i)){ + segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c; + endsWithSep = false; + } + } + regExpString += segment; + if (!endsWithSep) { + regExpString += i < glob.length ? c.sep : c.sepMaybe; + endsWithSep = true; + } + // Terminates with `i` at the start of the next segment. + while(c.seps.includes(glob[i]))i++; + j = i; + } + regExpString = `^${regExpString}$`; + return new RegExp(regExpString, caseInsensitive ? "i" : ""); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +const constants = { + sep: "/+", + sepMaybe: "/*", + seps: [ + "/" + ], + globstar: "(?:[^/]*(?:/|$)+)*", + wildcard: "[^/]*", + escapePrefix: "\\" +}; +/** Convert a glob string to a regular expression. + * + * Tries to match bash glob expansion as closely as possible. + * + * Basic glob syntax: + * - `*` - Matches everything without leaving the path segment. + * - `?` - Matches any single character. + * - `{foo,bar}` - Matches `foo` or `bar`. + * - `[abcd]` - Matches `a`, `b`, `c` or `d`. + * - `[a-d]` - Matches `a`, `b`, `c` or `d`. + * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`. + * - `[[::]]` - Matches any character belonging to ``. + * - `[[:alnum:]]` - Matches any digit or letter. + * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`. + * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes + * for a complete list of supported character classes. + * - `\` - Escapes the next character for an `os` other than `"windows"`. + * - \` - Escapes the next character for `os` set to `"windows"`. + * - `/` - Path separator. + * - `\` - Additional path separator only for `os` set to `"windows"`. + * + * Extended syntax: + * - Requires `{ extended: true }`. + * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`. + * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same. + * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`. + * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`. + * - `!(foo|bar)` - Matches anything other than `{foo,bar}`. + * - See https://www.linuxjournal.com/content/bash-extended-globbing. + * + * Globstar syntax: + * - Requires `{ globstar: true }`. + * - `**` - Matches any number of any path segments. + * - Must comprise its entire path segment in the provided glob. + * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option. + * + * Note the following properties: + * - The generated `RegExp` is anchored at both start and end. + * - Repeating and trailing separators are tolerated. Trailing separators in the + * provided glob have no meaning and are discarded. + * - Absolute globs will only match absolute paths, etc. + * - Empty globs will match nothing. + * - Any special glob syntax must be contained to one path segment. For example, + * `?(foo|bar/baz)` is invalid. The separator will take precedence and the + * first segment ends with an unclosed group. + * - If a path segment ends with unclosed groups or a dangling escape prefix, a + * parse error has occurred. Every character for that segment is taken + * literally in this event. + * + * Limitations: + * - A negative group like `!(foo|bar)` will wrongly be converted to a negative + * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly + * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively, + * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if + * the group occurs not nested at the end of the segment. + * + * @example Usage + * ```ts + * import { globToRegExp } from "@std/path/posix/glob-to-regexp"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(globToRegExp("*.js"), /^[^/]*\.js\/*$/); + * ``` + * + * @param glob Glob string to convert. + * @param options Conversion options. + * @returns The regular expression equivalent to the glob. + */ function globToRegExp(glob, options = {}) { + return _globToRegExp(constants, glob, options); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Test whether the given string is a glob. + * + * @example Usage + * ```ts + * import { isGlob } from "@std/path/is-glob"; + * import { assert } from "@std/assert"; + * + * assert(!isGlob("foo/bar/../baz")); + * assert(isGlob("foo/*ar/../baz")); + * ``` + * + * @param str String to test. + * @returns `true` if the given string is a glob, otherwise `false` + */ function isGlob(str) { + const chars = { + "{": "}", + "(": ")", + "[": "]" + }; + const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; + if (str === "") { + return false; + } + let match; + while(match = regex.exec(str)){ + if (match[2]) return true; + let idx = match.index + match[0].length; + // if an open bracket/brace/paren is escaped, + // set the index to the next closing character + const open = match[1]; + const close = open ? chars[open] : null; + if (open && close) { + const n = str.indexOf(close, idx); + if (n !== -1) { + idx = n + 1; + } + } + str = str.slice(idx); + } + return false; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. + * + * @example Usage + * ```ts + * import { normalizeGlob } from "@std/path/posix/normalize-glob"; + * import { assertEquals } from "@std/assert"; + * + * const path = normalizeGlob("foo/bar/../*", { globstar: true }); + * assertEquals(path, "foo/*"); + * ``` + * + * @param glob The glob to normalize. + * @param options The options to use. + * @returns The normalized path. + */ function normalizeGlob(glob, options = {}) { + const { globstar = false } = options; + if (glob.match(/\0/g)) { + throw new Error(`Glob contains invalid characters: "${glob}"`); + } + if (!globstar) { + return normalize(glob); + } + const s = SEPARATOR_PATTERN.source; + const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g"); + return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, ".."); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Like join(), but doesn't collapse "**\/.." when `globstar` is true. + * + * @example Usage + * ```ts + * import { joinGlobs } from "@std/path/posix/join-globs"; + * import { assertEquals } from "@std/assert"; + * + * const path = joinGlobs(["foo", "bar", "**"], { globstar: true }); + * assertEquals(path, "foo/bar/**"); + * ``` + * + * @param globs The globs to join. + * @param options The options to use. + * @returns The joined path. + */ function joinGlobs(globs, options = {}) { + const { globstar = false } = options; + if (!globstar || globs.length === 0) { + return join(...globs); + } + let joined; + for (const glob of globs){ + const path = glob; + if (path.length > 0) { + if (!joined) joined = path; + else joined += `${SEPARATOR}${path}`; + } + } + if (!joined) return "."; + return normalizeGlob(joined, { + globstar + }); +} + +exports.DELIMITER = DELIMITER; +exports.SEPARATOR = SEPARATOR; +exports.SEPARATOR_PATTERN = SEPARATOR_PATTERN; +exports.basename = basename; +exports.common = common; +exports.dirname = dirname; +exports.extname = extname; +exports.format = format; +exports.fromFileUrl = fromFileUrl; +exports.globToRegExp = globToRegExp; +exports.isAbsolute = isAbsolute; +exports.isGlob = isGlob; +exports.join = join; +exports.joinGlobs = joinGlobs; +exports.normalize = normalize; +exports.normalizeGlob = normalizeGlob; +exports.parse = parse; +exports.relative = relative; +exports.resolve = resolve; +exports.toFileUrl = toFileUrl; +exports.toNamespacedPath = toNamespacedPath; diff --git a/node_modules/@eslint/config-array/dist/cjs/std__path/windows.cjs b/node_modules/@eslint/config-array/dist/cjs/std__path/windows.cjs new file mode 100644 index 0000000..9b9f00a --- /dev/null +++ b/node_modules/@eslint/config-array/dist/cjs/std__path/windows.cjs @@ -0,0 +1,1670 @@ +'use strict'; + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +function assertPath(path) { + if (typeof path !== "string") { + throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function stripSuffix(name, suffix) { + if (suffix.length >= name.length) { + return name; + } + const lenDiff = name.length - suffix.length; + for(let i = suffix.length - 1; i >= 0; --i){ + if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) { + return name; + } + } + return name.slice(0, -suffix.length); +} +function lastPathSegment(path, isSep, start = 0) { + let matchedNonSeparator = false; + let end = path.length; + for(let i = path.length - 1; i >= start; --i){ + if (isSep(path.charCodeAt(i))) { + if (matchedNonSeparator) { + start = i + 1; + break; + } + } else if (!matchedNonSeparator) { + matchedNonSeparator = true; + end = i + 1; + } + } + return path.slice(start, end); +} +function assertArgs$1(path, suffix) { + assertPath(path); + if (path.length === 0) return path; + if (typeof suffix !== "string") { + throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +// Alphabet chars. +const CHAR_UPPERCASE_A = 65; /* A */ +const CHAR_LOWERCASE_A = 97; /* a */ +const CHAR_UPPERCASE_Z = 90; /* Z */ +const CHAR_LOWERCASE_Z = 122; /* z */ +// Non-alphabetic chars. +const CHAR_DOT = 46; /* . */ +const CHAR_FORWARD_SLASH = 47; /* / */ +const CHAR_BACKWARD_SLASH = 92; /* \ */ +const CHAR_COLON = 58; /* : */ +const CHAR_QUESTION_MARK = 63; /* ? */ + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +function stripTrailingSeparators(segment, isSep) { + if (segment.length <= 1) { + return segment; + } + let end = segment.length; + for(let i = segment.length - 1; i > 0; i--){ + if (isSep(segment.charCodeAt(i))) { + end = i; + } else { + break; + } + } + return segment.slice(0, end); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +function isPosixPathSeparator(code) { + return code === CHAR_FORWARD_SLASH; +} +function isPathSeparator(code) { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +} +function isWindowsDeviceRoot(code) { + return code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z || code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the last portion of a `path`. + * Trailing directory separators are ignored, and optional suffix is removed. + * + * @example Usage + * ```ts + * import { basename } from "@std/path/windows/basename"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(basename("C:\\user\\Documents\\"), "Documents"); + * assertEquals(basename("C:\\user\\Documents\\image.png"), "image.png"); + * assertEquals(basename("C:\\user\\Documents\\image.png", ".png"), "image"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `basename` from `@std/path/windows/unstable-basename`. + * + * @param path The path to extract the name from. + * @param suffix The suffix to remove from extracted name. + * @returns The extracted name. + */ function basename(path, suffix = "") { + assertArgs$1(path, suffix); + // Check for a drive letter prefix so as not to mistake the following + // path separator as an extra separator at the end of the path that can be + // disregarded + let start = 0; + if (path.length >= 2) { + const drive = path.charCodeAt(0); + if (isWindowsDeviceRoot(drive)) { + if (path.charCodeAt(1) === CHAR_COLON) start = 2; + } + } + const lastSegment = lastPathSegment(path, isPathSeparator, start); + const strippedSegment = stripTrailingSeparators(lastSegment, isPathSeparator); + return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * The character used to separate entries in the PATH environment variable. + */ const DELIMITER = ";"; +/** + * The character used to separate components of a file path. + */ const SEPARATOR = "\\"; +/** + * A regular expression that matches one or more path separators. + */ const SEPARATOR_PATTERN = /[\\/]+/; + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg$3(path) { + assertPath(path); + if (path.length === 0) return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the directory path of a `path`. + * + * @example Usage + * ```ts + * import { dirname } from "@std/path/windows/dirname"; + * import { assertEquals } from "@std/assert"; + * + * const dir = dirname("C:\\foo\\bar\\baz.ext"); + * assertEquals(dir, "C:\\foo\\bar"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `dirname` from `@std/path/windows/unstable-dirname`. + * + * @param path The path to get the directory from. + * @returns The directory path. + */ function dirname(path) { + assertArg$3(path); + const len = path.length; + let rootEnd = -1; + let end = -1; + let matchedSlash = true; + let offset = 0; + const code = path.charCodeAt(0); + // Try to match a root + if (len > 1) { + if (isPathSeparator(code)) { + // Possible UNC root + rootEnd = offset = 1; + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more path separators + for(; j < len; ++j){ + if (!isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j === len) { + // We matched a UNC root only + return path; + } + if (j !== last) { + // We matched a UNC root with leftovers + // Offset by 1 to include the separator after the UNC root to + // treat it as a "normal root" on top of a (UNC) root + rootEnd = offset = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (path.charCodeAt(1) === CHAR_COLON) { + rootEnd = offset = 2; + if (len > 2) { + if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3; + } + } + } + } else if (isPathSeparator(code)) { + // `path` contains just a path separator, exit early to avoid + // unnecessary work + return path; + } + for(let i = len - 1; i >= offset; --i){ + if (isPathSeparator(path.charCodeAt(i))) { + if (!matchedSlash) { + end = i; + break; + } + } else { + // We saw the first non-path separator + matchedSlash = false; + } + } + if (end === -1) { + if (rootEnd === -1) return "."; + else end = rootEnd; + } + return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the extension of the `path` with leading period. + * + * @example Usage + * ```ts + * import { extname } from "@std/path/windows/extname"; + * import { assertEquals } from "@std/assert"; + * + * const ext = extname("file.ts"); + * assertEquals(ext, ".ts"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `extname` from `@std/path/windows/unstable-extname`. + * + * @param path The path to get the extension from. + * @returns The extension of the `path`. + */ function extname(path) { + assertPath(path); + let start = 0; + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + let preDotState = 0; + // Check for a drive letter prefix so as not to mistake the following + // path separator as an extra separator at the end of the path that can be + // disregarded + if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) { + start = startPart = 2; + } + for(let i = path.length - 1; i >= start; --i){ + const code = path.charCodeAt(i); + if (isPathSeparator(code)) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path.slice(startDot, end); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function _format(sep, pathObject) { + const dir = pathObject.dir || pathObject.root; + const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? ""); + if (!dir) return base; + if (base === sep) return dir; + if (dir === pathObject.root) return dir + base; + return dir + sep + base; +} +function assertArg$2(pathObject) { + if (pathObject === null || typeof pathObject !== "object") { + throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Generate a path from `ParsedPath` object. + * + * @example Usage + * ```ts + * import { format } from "@std/path/windows/format"; + * import { assertEquals } from "@std/assert"; + * + * const path = format({ + * root: "C:\\", + * dir: "C:\\path\\dir", + * base: "file.txt", + * ext: ".txt", + * name: "file" + * }); + * assertEquals(path, "C:\\path\\dir\\file.txt"); + * ``` + * + * @param pathObject The path object to format. + * @returns The formatted path. + */ function format(pathObject) { + assertArg$2(pathObject); + return _format("\\", pathObject); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg$1(url) { + url = url instanceof URL ? url : new URL(url); + if (url.protocol !== "file:") { + throw new TypeError(`URL must be a file URL: received "${url.protocol}"`); + } + return url; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a file URL to a path string. + * + * @example Usage + * ```ts + * import { fromFileUrl } from "@std/path/windows/from-file-url"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo"); + * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo"); + * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo"); + * ``` + * + * @param url The file URL to convert. + * @returns The path string. + */ function fromFileUrl(url) { + url = assertArg$1(url); + let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\"); + if (url.hostname !== "") { + // Note: The `URL` implementation guarantees that the drive letter and + // hostname are mutually exclusive. Otherwise it would not have been valid + // to append the hostname and path like this. + path = `\\\\${url.hostname}${path}`; + } + return path; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Verifies whether provided path is absolute. + * + * @example Usage + * ```ts + * import { isAbsolute } from "@std/path/windows/is-absolute"; + * import { assert, assertFalse } from "@std/assert"; + * + * assert(isAbsolute("C:\\foo\\bar")); + * assertFalse(isAbsolute("..\\baz")); + * ``` + * + * @param path The path to verify. + * @returns `true` if the path is absolute, `false` otherwise. + */ function isAbsolute(path) { + assertPath(path); + const len = path.length; + if (len === 0) return false; + const code = path.charCodeAt(0); + if (isPathSeparator(code)) { + return true; + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (len > 2 && path.charCodeAt(1) === CHAR_COLON) { + if (isPathSeparator(path.charCodeAt(2))) return true; + } + } + return false; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg(path) { + assertPath(path); + if (path.length === 0) return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +// Resolves . and .. elements in a path with directory names +function normalizeString(path, allowAboveRoot, separator, isPathSeparator) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let code; + for(let i = 0; i <= path.length; ++i){ + if (i < path.length) code = path.charCodeAt(i); + else if (isPathSeparator(code)) break; + else code = CHAR_FORWARD_SLASH; + if (isPathSeparator(code)) { + if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf(separator); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); + } + lastSlash = i; + dots = 0; + continue; + } else if (res.length === 2 || res.length === 1) { + res = ""; + lastSegmentLength = 0; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) res += `${separator}..`; + else res = ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) res += separator + path.slice(lastSlash + 1, i); + else res = path.slice(lastSlash + 1, i); + lastSegmentLength = i - lastSlash - 1; + } + lastSlash = i; + dots = 0; + } else if (code === CHAR_DOT && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Normalize the `path`, resolving `'..'` and `'.'` segments. + * Note that resolving these segments does not necessarily mean that all will be eliminated. + * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`. + * + * @example Usage + * ```ts + * import { normalize } from "@std/path/windows/normalize"; + * import { assertEquals } from "@std/assert"; + * + * const normalized = normalize("C:\\foo\\..\\bar"); + * assertEquals(normalized, "C:\\bar"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `normalize` from `@std/path/windows/unstable-normalize`. + * + * @param path The path to normalize + * @returns The normalized path + */ function normalize(path) { + assertArg(path); + const len = path.length; + let rootEnd = 0; + let device; + let isAbsolute = false; + const code = path.charCodeAt(0); + // Try to match a root + if (len > 1) { + if (isPathSeparator(code)) { + // Possible UNC root + // If we started with a separator, we know we at least have an absolute + // path of some kind (UNC or otherwise) + isAbsolute = true; + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + // Matched! + last = j; + // Match 1 or more path separators + for(; j < len; ++j){ + if (!isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j === len) { + // We matched a UNC root only + // Return the normalized version of the UNC root since there + // is nothing left to process + return `\\\\${firstPart}\\${path.slice(last)}\\`; + } else if (j !== last) { + // We matched a UNC root with leftovers + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (path.charCodeAt(1) === CHAR_COLON) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2) { + if (isPathSeparator(path.charCodeAt(2))) { + // Treat separator following drive name as an absolute path + // indicator + isAbsolute = true; + rootEnd = 3; + } + } + } + } + } else if (isPathSeparator(code)) { + // `path` contains just a path separator, exit early to avoid unnecessary + // work + return "\\"; + } + let tail; + if (rootEnd < len) { + tail = normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator); + } else { + tail = ""; + } + if (tail.length === 0 && !isAbsolute) tail = "."; + if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { + tail += "\\"; + } + if (device === undefined) { + if (isAbsolute) { + if (tail.length > 0) return `\\${tail}`; + else return "\\"; + } + return tail; + } else if (isAbsolute) { + if (tail.length > 0) return `${device}\\${tail}`; + else return `${device}\\`; + } + return device + tail; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Join all given a sequence of `paths`,then normalizes the resulting path. + * + * @example Usage + * ```ts + * import { join } from "@std/path/windows/join"; + * import { assertEquals } from "@std/assert"; + * + * const joined = join("C:\\foo", "bar", "baz\\.."); + * assertEquals(joined, "C:\\foo\\bar"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `join` from `@std/path/windows/unstable-join`. + * + * @param paths The paths to join. + * @returns The joined path. + */ function join(...paths) { + paths.forEach((path)=>assertPath(path)); + paths = paths.filter((path)=>path.length > 0); + if (paths.length === 0) return "."; + // Make sure that the joined path doesn't start with two slashes, because + // normalize() will mistake it for an UNC path then. + // + // This step is skipped when it is very clear that the user actually + // intended to point at an UNC path. This is assumed when the first + // non-empty string arguments starts with exactly two slashes followed by + // at least one more non-slash character. + // + // Note that for normalize() to treat a path as an UNC path it needs to + // have at least 2 components, so we don't filter for that here. + // This means that the user can use join to construct UNC paths from + // a server name and a share name; for example: + // path.join('//server', 'share') -> '\\\\server\\share\\' + let needsReplace = true; + let slashCount = 0; + const firstPart = paths[0]; + if (isPathSeparator(firstPart.charCodeAt(0))) { + ++slashCount; + const firstLen = firstPart.length; + if (firstLen > 1) { + if (isPathSeparator(firstPart.charCodeAt(1))) { + ++slashCount; + if (firstLen > 2) { + if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount; + else { + // We matched a UNC path in the first part + needsReplace = false; + } + } + } + } + } + let joined = paths.join("\\"); + if (needsReplace) { + // Find any more consecutive slashes we need to replace + for(; slashCount < joined.length; ++slashCount){ + if (!isPathSeparator(joined.charCodeAt(slashCount))) break; + } + // Replace the slashes if needed + if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`; + } + return normalize(joined); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return a `ParsedPath` object of the `path`. + * + * @example Usage + * ```ts + * import { parse } from "@std/path/windows/parse"; + * import { assertEquals } from "@std/assert"; + * + * const parsed = parse("C:\\foo\\bar\\baz.ext"); + * assertEquals(parsed, { + * root: "C:\\", + * dir: "C:\\foo\\bar", + * base: "baz.ext", + * ext: ".ext", + * name: "baz", + * }); + * ``` + * + * @param path The path to parse. + * @returns The `ParsedPath` object. + */ function parse(path) { + assertPath(path); + const ret = { + root: "", + dir: "", + base: "", + ext: "", + name: "" + }; + const len = path.length; + if (len === 0) return ret; + let rootEnd = 0; + let code = path.charCodeAt(0); + // Try to match a root + if (len > 1) { + if (isPathSeparator(code)) { + // Possible UNC root + rootEnd = 1; + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more path separators + for(; j < len; ++j){ + if (!isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j === len) { + // We matched a UNC root only + rootEnd = j; + } else if (j !== last) { + // We matched a UNC root with leftovers + rootEnd = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (path.charCodeAt(1) === CHAR_COLON) { + rootEnd = 2; + if (len > 2) { + if (isPathSeparator(path.charCodeAt(2))) { + if (len === 3) { + // `path` contains just a drive root, exit early to avoid + // unnecessary work + ret.root = ret.dir = path; + ret.base = "\\"; + return ret; + } + rootEnd = 3; + } + } else { + // `path` contains just a relative drive root, exit early to avoid + // unnecessary work + ret.root = ret.dir = path; + return ret; + } + } + } + } else if (isPathSeparator(code)) { + // `path` contains just a path separator, exit early to avoid + // unnecessary work + ret.root = ret.dir = path; + ret.base = "\\"; + return ret; + } + if (rootEnd > 0) ret.root = path.slice(0, rootEnd); + let startDot = -1; + let startPart = rootEnd; + let end = -1; + let matchedSlash = true; + let i = path.length - 1; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + let preDotState = 0; + // Get non-dir info + for(; i >= rootEnd; --i){ + code = path.charCodeAt(i); + if (isPathSeparator(code)) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + if (end !== -1) { + ret.base = ret.name = path.slice(startPart, end); + } + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + ret.ext = path.slice(startDot, end); + } + // Fallback to '\' in case there is no basename + ret.base = ret.base || "\\"; + // If the directory is the root, use the entire root as the `dir` including + // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the + // trailing slash (`C:\abc\def` -> `C:\abc`). + if (startPart > 0 && startPart !== rootEnd) { + ret.dir = path.slice(0, startPart - 1); + } else ret.dir = ret.root; + return ret; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Resolves path segments into a `path`. + * + * @example Usage + * ```ts + * import { resolve } from "@std/path/windows/resolve"; + * import { assertEquals } from "@std/assert"; + * + * const resolved = resolve("C:\\foo\\bar", "..\\baz"); + * assertEquals(resolved, "C:\\foo\\baz"); + * ``` + * + * @param pathSegments The path segments to process to path + * @returns The resolved path + */ function resolve(...pathSegments) { + let resolvedDevice = ""; + let resolvedTail = ""; + let resolvedAbsolute = false; + for(let i = pathSegments.length - 1; i >= -1; i--){ + let path; + // deno-lint-ignore no-explicit-any + const { Deno } = globalThis; + if (i >= 0) { + path = pathSegments[i]; + } else if (!resolvedDevice) { + if (typeof Deno?.cwd !== "function") { + throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)"); + } + path = Deno.cwd(); + } else { + if (typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function") { + throw new TypeError("Resolved a relative path without a current working directory (CWD)"); + } + path = Deno.cwd(); + // Verify that a cwd was found and that it actually points + // to our drive. If not, default to the drive's root. + if (path === undefined || path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`) { + path = `${resolvedDevice}\\`; + } + } + assertPath(path); + const len = path.length; + // Skip empty entries + if (len === 0) continue; + let rootEnd = 0; + let device = ""; + let isAbsolute = false; + const code = path.charCodeAt(0); + // Try to match a root + if (len > 1) { + if (isPathSeparator(code)) { + // Possible UNC root + // If we started with a separator, we know we at least have an + // absolute path of some kind (UNC or otherwise) + isAbsolute = true; + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + // Matched! + last = j; + // Match 1 or more path separators + for(; j < len; ++j){ + if (!isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j === len) { + // We matched a UNC root only + device = `\\\\${firstPart}\\${path.slice(last)}`; + rootEnd = j; + } else if (j !== last) { + // We matched a UNC root with leftovers + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (path.charCodeAt(1) === CHAR_COLON) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2) { + if (isPathSeparator(path.charCodeAt(2))) { + // Treat separator following drive name as an absolute path + // indicator + isAbsolute = true; + rootEnd = 3; + } + } + } + } + } else if (isPathSeparator(code)) { + // `path` contains just a path separator + rootEnd = 1; + isAbsolute = true; + } + if (device.length > 0 && resolvedDevice.length > 0 && device.toLowerCase() !== resolvedDevice.toLowerCase()) { + continue; + } + if (resolvedDevice.length === 0 && device.length > 0) { + resolvedDevice = device; + } + if (!resolvedAbsolute) { + resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`; + resolvedAbsolute = isAbsolute; + } + if (resolvedAbsolute && resolvedDevice.length > 0) break; + } + // At this point the path should be resolved to a full absolute path, + // but handle relative paths to be safe (might happen when Deno.cwd() + // fails) + // Normalize the tail path + resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator); + return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArgs(from, to) { + assertPath(from); + assertPath(to); + if (from === to) return ""; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the relative path from `from` to `to` based on current working directory. + * + * An example in windws, for instance: + * from = 'C:\\orandea\\test\\aaa' + * to = 'C:\\orandea\\impl\\bbb' + * The output of the function should be: '..\\..\\impl\\bbb' + * + * @example Usage + * ```ts + * import { relative } from "@std/path/windows/relative"; + * import { assertEquals } from "@std/assert"; + * + * const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb"); + * assertEquals(relativePath, "..\\..\\impl\\bbb"); + * ``` + * + * @param from The path from which to calculate the relative path + * @param to The path to which to calculate the relative path + * @returns The relative path from `from` to `to` + */ function relative(from, to) { + assertArgs(from, to); + const fromOrig = resolve(from); + const toOrig = resolve(to); + if (fromOrig === toOrig) return ""; + from = fromOrig.toLowerCase(); + to = toOrig.toLowerCase(); + if (from === to) return ""; + // Trim any leading backslashes + let fromStart = 0; + let fromEnd = from.length; + for(; fromStart < fromEnd; ++fromStart){ + if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break; + } + // Trim trailing backslashes (applicable to UNC paths only) + for(; fromEnd - 1 > fromStart; --fromEnd){ + if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break; + } + const fromLen = fromEnd - fromStart; + // Trim any leading backslashes + let toStart = 0; + let toEnd = to.length; + for(; toStart < toEnd; ++toStart){ + if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break; + } + // Trim trailing backslashes (applicable to UNC paths only) + for(; toEnd - 1 > toStart; --toEnd){ + if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break; + } + const toLen = toEnd - toStart; + // Compare paths to find the longest common path from root + const length = fromLen < toLen ? fromLen : toLen; + let lastCommonSep = -1; + let i = 0; + for(; i <= length; ++i){ + if (i === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) { + // We get here if `from` is the exact base path for `to`. + // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz' + return toOrig.slice(toStart + i + 1); + } else if (i === 2) { + // We get here if `from` is the device root. + // For example: from='C:\\'; to='C:\\foo' + return toOrig.slice(toStart + i); + } + } + if (fromLen > length) { + if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) { + // We get here if `to` is the exact base path for `from`. + // For example: from='C:\\foo\\bar'; to='C:\\foo' + lastCommonSep = i; + } else if (i === 2) { + // We get here if `to` is the device root. + // For example: from='C:\\foo\\bar'; to='C:\\' + lastCommonSep = 3; + } + } + break; + } + const fromCode = from.charCodeAt(fromStart + i); + const toCode = to.charCodeAt(toStart + i); + if (fromCode !== toCode) break; + else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i; + } + // We found a mismatch before the first common path separator was seen, so + // return the original `to`. + if (i !== length && lastCommonSep === -1) { + return toOrig; + } + let out = ""; + if (lastCommonSep === -1) lastCommonSep = 0; + // Generate the relative path based on the path difference between `to` and + // `from` + for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){ + if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) { + if (out.length === 0) out += ".."; + else out += "\\.."; + } + } + // Lastly, append the rest of the destination (`to`) path that comes after + // the common path parts + if (out.length > 0) { + return out + toOrig.slice(toStart + lastCommonSep, toEnd); + } else { + toStart += lastCommonSep; + if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart; + return toOrig.slice(toStart, toEnd); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +const WHITESPACE_ENCODINGS = { + "\u0009": "%09", + "\u000A": "%0A", + "\u000B": "%0B", + "\u000C": "%0C", + "\u000D": "%0D", + "\u0020": "%20" +}; +function encodeWhitespace(string) { + return string.replaceAll(/[\s]/g, (c)=>{ + return WHITESPACE_ENCODINGS[c] ?? c; + }); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a path string to a file URL. + * + * @example Usage + * ```ts + * import { toFileUrl } from "@std/path/windows/to-file-url"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(toFileUrl("\\home\\foo"), new URL("file:///home/foo")); + * assertEquals(toFileUrl("C:\\Users\\foo"), new URL("file:///C:/Users/foo")); + * assertEquals(toFileUrl("\\\\127.0.0.1\\home\\foo"), new URL("file://127.0.0.1/home/foo")); + * ``` + * @param path The path to convert. + * @returns The file URL. + */ function toFileUrl(path) { + if (!isAbsolute(path)) { + throw new TypeError(`Path must be absolute: received "${path}"`); + } + const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/); + const url = new URL("file:///"); + url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25")); + if (hostname !== undefined && hostname !== "localhost") { + url.hostname = hostname; + if (!url.hostname) { + throw new TypeError(`Invalid hostname: "${url.hostname}"`); + } + } + return url; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Resolves path to a namespace path + * + * @example Usage + * ```ts + * import { toNamespacedPath } from "@std/path/windows/to-namespaced-path"; + * import { assertEquals } from "@std/assert"; + * + * const namespaced = toNamespacedPath("C:\\foo\\bar"); + * assertEquals(namespaced, "\\\\?\\C:\\foo\\bar"); + * ``` + * + * @param path The path to resolve to namespaced path + * @returns The resolved namespaced path + */ function toNamespacedPath(path) { + // Note: this will *probably* throw somewhere. + if (typeof path !== "string") return path; + if (path.length === 0) return ""; + const resolvedPath = resolve(path); + if (resolvedPath.length >= 3) { + if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) { + // Possible UNC root + if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) { + const code = resolvedPath.charCodeAt(2); + if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) { + // Matched non-long UNC root, convert the path to a long UNC path + return `\\\\?\\UNC\\${resolvedPath.slice(2)}`; + } + } + } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) { + // Possible device root + if (resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) { + // Matched device root, convert the path to a long UNC path + return `\\\\?\\${resolvedPath}`; + } + } + } + return path; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function common$1(paths, sep) { + const [first = "", ...remaining] = paths; + const parts = first.split(sep); + let endOfPrefix = parts.length; + let append = ""; + for (const path of remaining){ + const compare = path.split(sep); + if (compare.length <= endOfPrefix) { + endOfPrefix = compare.length; + append = ""; + } + for(let i = 0; i < endOfPrefix; i++){ + if (compare[i] !== parts[i]) { + endOfPrefix = i; + append = i === 0 ? "" : sep; + break; + } + } + } + return parts.slice(0, endOfPrefix).join(sep) + append; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Determines the common path from a set of paths for Windows systems. + * + * @example Usage + * ```ts + * import { common } from "@std/path/windows/common"; + * import { assertEquals } from "@std/assert"; + * + * const path = common([ + * "C:\\foo\\bar", + * "C:\\foo\\baz", + * ]); + * assertEquals(path, "C:\\foo\\"); + * ``` + * + * @param paths The paths to compare. + * @returns The common path. + */ function common(paths) { + return common$1(paths, SEPARATOR); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs}, + * {@linkcode normalizeGlob} and {@linkcode expandGlob}. + */ const REG_EXP_ESCAPE_CHARS = [ + "!", + "$", + "(", + ")", + "*", + "+", + ".", + "=", + "?", + "[", + "\\", + "^", + "{", + "|" +]; +const RANGE_ESCAPE_CHARS = [ + "-", + "\\", + "]" +]; +function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType, +caseInsensitive = false } = {}) { + if (glob === "") { + return /(?!)/; + } + // Remove trailing separators. + let newLength = glob.length; + for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--); + glob = glob.slice(0, newLength); + let regExpString = ""; + // Terminates correctly. Trust that `j` is incremented every iteration. + for(let j = 0; j < glob.length;){ + let segment = ""; + const groupStack = []; + let inRange = false; + let inEscape = false; + let endsWithSep = false; + let i = j; + // Terminates with `i` at the non-inclusive end of the current segment. + for(; i < glob.length && !c.seps.includes(glob[i]); i++){ + if (inEscape) { + inEscape = false; + const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS; + segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i]; + continue; + } + if (glob[i] === c.escapePrefix) { + inEscape = true; + continue; + } + if (glob[i] === "[") { + if (!inRange) { + inRange = true; + segment += "["; + if (glob[i + 1] === "!") { + i++; + segment += "^"; + } else if (glob[i + 1] === "^") { + i++; + segment += "\\^"; + } + continue; + } else if (glob[i + 1] === ":") { + let k = i + 1; + let value = ""; + while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){ + value += glob[k + 1]; + k++; + } + if (glob[k + 1] === ":" && glob[k + 2] === "]") { + i = k + 2; + if (value === "alnum") segment += "\\dA-Za-z"; + else if (value === "alpha") segment += "A-Za-z"; + else if (value === "ascii") segment += "\x00-\x7F"; + else if (value === "blank") segment += "\t "; + else if (value === "cntrl") segment += "\x00-\x1F\x7F"; + else if (value === "digit") segment += "\\d"; + else if (value === "graph") segment += "\x21-\x7E"; + else if (value === "lower") segment += "a-z"; + else if (value === "print") segment += "\x20-\x7E"; + else if (value === "punct") { + segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~"; + } else if (value === "space") segment += "\\s\v"; + else if (value === "upper") segment += "A-Z"; + else if (value === "word") segment += "\\w"; + else if (value === "xdigit") segment += "\\dA-Fa-f"; + continue; + } + } + } + if (glob[i] === "]" && inRange) { + inRange = false; + segment += "]"; + continue; + } + if (inRange) { + segment += glob[i]; + continue; + } + if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") { + segment += ")"; + const type = groupStack.pop(); + if (type === "!") { + segment += c.wildcard; + } else if (type !== "@") { + segment += type; + } + continue; + } + if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") { + segment += "|"; + continue; + } + if (glob[i] === "+" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("+"); + segment += "(?:"; + continue; + } + if (glob[i] === "@" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("@"); + segment += "(?:"; + continue; + } + if (glob[i] === "?") { + if (extended && glob[i + 1] === "(") { + i++; + groupStack.push("?"); + segment += "(?:"; + } else { + segment += "."; + } + continue; + } + if (glob[i] === "!" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("!"); + segment += "(?!"; + continue; + } + if (glob[i] === "{") { + groupStack.push("BRACE"); + segment += "(?:"; + continue; + } + if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") { + groupStack.pop(); + segment += ")"; + continue; + } + if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") { + segment += "|"; + continue; + } + if (glob[i] === "*") { + if (extended && glob[i + 1] === "(") { + i++; + groupStack.push("*"); + segment += "(?:"; + } else { + const prevChar = glob[i - 1]; + let numStars = 1; + while(glob[i + 1] === "*"){ + i++; + numStars++; + } + const nextChar = glob[i + 1]; + if (globstarOption && numStars === 2 && [ + ...c.seps, + undefined + ].includes(prevChar) && [ + ...c.seps, + undefined + ].includes(nextChar)) { + segment += c.globstar; + endsWithSep = true; + } else { + segment += c.wildcard; + } + } + continue; + } + segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i]; + } + // Check for unclosed groups or a dangling backslash. + if (groupStack.length > 0 || inRange || inEscape) { + // Parse failure. Take all characters from this segment literally. + segment = ""; + for (const c of glob.slice(j, i)){ + segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c; + endsWithSep = false; + } + } + regExpString += segment; + if (!endsWithSep) { + regExpString += i < glob.length ? c.sep : c.sepMaybe; + endsWithSep = true; + } + // Terminates with `i` at the start of the next segment. + while(c.seps.includes(glob[i]))i++; + j = i; + } + regExpString = `^${regExpString}$`; + return new RegExp(regExpString, caseInsensitive ? "i" : ""); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +const constants = { + sep: "(?:\\\\|/)+", + sepMaybe: "(?:\\\\|/)*", + seps: [ + "\\", + "/" + ], + globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*", + wildcard: "[^\\\\/]*", + escapePrefix: "`" +}; +/** Convert a glob string to a regular expression. + * + * Tries to match bash glob expansion as closely as possible. + * + * Basic glob syntax: + * - `*` - Matches everything without leaving the path segment. + * - `?` - Matches any single character. + * - `{foo,bar}` - Matches `foo` or `bar`. + * - `[abcd]` - Matches `a`, `b`, `c` or `d`. + * - `[a-d]` - Matches `a`, `b`, `c` or `d`. + * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`. + * - `[[::]]` - Matches any character belonging to ``. + * - `[[:alnum:]]` - Matches any digit or letter. + * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`. + * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes + * for a complete list of supported character classes. + * - `\` - Escapes the next character for an `os` other than `"windows"`. + * - \` - Escapes the next character for `os` set to `"windows"`. + * - `/` - Path separator. + * - `\` - Additional path separator only for `os` set to `"windows"`. + * + * Extended syntax: + * - Requires `{ extended: true }`. + * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`. + * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same. + * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`. + * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`. + * - `!(foo|bar)` - Matches anything other than `{foo,bar}`. + * - See https://www.linuxjournal.com/content/bash-extended-globbing. + * + * Globstar syntax: + * - Requires `{ globstar: true }`. + * - `**` - Matches any number of any path segments. + * - Must comprise its entire path segment in the provided glob. + * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option. + * + * Note the following properties: + * - The generated `RegExp` is anchored at both start and end. + * - Repeating and trailing separators are tolerated. Trailing separators in the + * provided glob have no meaning and are discarded. + * - Absolute globs will only match absolute paths, etc. + * - Empty globs will match nothing. + * - Any special glob syntax must be contained to one path segment. For example, + * `?(foo|bar/baz)` is invalid. The separator will take precedence and the + * first segment ends with an unclosed group. + * - If a path segment ends with unclosed groups or a dangling escape prefix, a + * parse error has occurred. Every character for that segment is taken + * literally in this event. + * + * Limitations: + * - A negative group like `!(foo|bar)` will wrongly be converted to a negative + * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly + * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively, + * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if + * the group occurs not nested at the end of the segment. + * + * @example Usage + * ```ts + * import { globToRegExp } from "@std/path/windows/glob-to-regexp"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(globToRegExp("*.js"), /^[^\\/]*\.js(?:\\|\/)*$/); + * ``` + * + * @param glob Glob string to convert. + * @param options Conversion options. + * @returns The regular expression equivalent to the glob. + */ function globToRegExp(glob, options = {}) { + return _globToRegExp(constants, glob, options); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Test whether the given string is a glob. + * + * @example Usage + * ```ts + * import { isGlob } from "@std/path/is-glob"; + * import { assert } from "@std/assert"; + * + * assert(!isGlob("foo/bar/../baz")); + * assert(isGlob("foo/*ar/../baz")); + * ``` + * + * @param str String to test. + * @returns `true` if the given string is a glob, otherwise `false` + */ function isGlob(str) { + const chars = { + "{": "}", + "(": ")", + "[": "]" + }; + const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; + if (str === "") { + return false; + } + let match; + while(match = regex.exec(str)){ + if (match[2]) return true; + let idx = match.index + match[0].length; + // if an open bracket/brace/paren is escaped, + // set the index to the next closing character + const open = match[1]; + const close = open ? chars[open] : null; + if (open && close) { + const n = str.indexOf(close, idx); + if (n !== -1) { + idx = n + 1; + } + } + str = str.slice(idx); + } + return false; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. + * + * @example Usage + * ```ts + * import { normalizeGlob } from "@std/path/windows/normalize-glob"; + * import { assertEquals } from "@std/assert"; + * + * const normalized = normalizeGlob("**\\foo\\..\\bar", { globstar: true }); + * assertEquals(normalized, "**\\bar"); + * ``` + * + * @param glob The glob pattern to normalize. + * @param options The options for glob pattern. + * @returns The normalized glob pattern. + */ function normalizeGlob(glob, options = {}) { + const { globstar = false } = options; + if (glob.match(/\0/g)) { + throw new Error(`Glob contains invalid characters: "${glob}"`); + } + if (!globstar) { + return normalize(glob); + } + const s = SEPARATOR_PATTERN.source; + const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g"); + return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, ".."); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Like join(), but doesn't collapse "**\/.." when `globstar` is true. + * + * @example Usage + * + * ```ts + * import { joinGlobs } from "@std/path/windows/join-globs"; + * import { assertEquals } from "@std/assert"; + * + * const joined = joinGlobs(["foo", "**", "bar"], { globstar: true }); + * assertEquals(joined, "foo\\**\\bar"); + * ``` + * + * @param globs The globs to join. + * @param options The options for glob pattern. + * @returns The joined glob pattern. + */ function joinGlobs(globs, options = {}) { + const { globstar = false } = options; + if (!globstar || globs.length === 0) { + return join(...globs); + } + let joined; + for (const glob of globs){ + const path = glob; + if (path.length > 0) { + if (!joined) joined = path; + else joined += `${SEPARATOR}${path}`; + } + } + if (!joined) return "."; + return normalizeGlob(joined, { + globstar + }); +} + +exports.DELIMITER = DELIMITER; +exports.SEPARATOR = SEPARATOR; +exports.SEPARATOR_PATTERN = SEPARATOR_PATTERN; +exports.basename = basename; +exports.common = common; +exports.dirname = dirname; +exports.extname = extname; +exports.format = format; +exports.fromFileUrl = fromFileUrl; +exports.globToRegExp = globToRegExp; +exports.isAbsolute = isAbsolute; +exports.isGlob = isGlob; +exports.join = join; +exports.joinGlobs = joinGlobs; +exports.normalize = normalize; +exports.normalizeGlob = normalizeGlob; +exports.parse = parse; +exports.relative = relative; +exports.resolve = resolve; +exports.toFileUrl = toFileUrl; +exports.toNamespacedPath = toNamespacedPath; diff --git a/node_modules/@eslint/config-array/dist/cjs/types.ts b/node_modules/@eslint/config-array/dist/cjs/types.ts new file mode 100644 index 0000000..1af4011 --- /dev/null +++ b/node_modules/@eslint/config-array/dist/cjs/types.ts @@ -0,0 +1,24 @@ +/** + * @fileoverview Types for the config-array package. + * @author Nicholas C. Zakas + */ + +export interface ConfigObject { + /** + * The files to include. + */ + files?: string[]; + + /** + * The files to exclude. + */ + ignores?: string[]; + + /** + * The name of the config object. + */ + name?: string; + + // may also have any number of other properties + [key: string]: unknown; +} diff --git a/node_modules/@eslint/config-array/dist/esm/index.js b/node_modules/@eslint/config-array/dist/esm/index.js new file mode 100644 index 0000000..1e68f33 --- /dev/null +++ b/node_modules/@eslint/config-array/dist/esm/index.js @@ -0,0 +1,1279 @@ +// @ts-self-types="./index.d.ts" +import * as posixPath from './std__path/posix.js'; +import * as windowsPath from './std__path/windows.js'; +import minimatch from 'minimatch'; +import createDebug from 'debug'; +import { ObjectSchema } from '@eslint/object-schema'; +export { ObjectSchema } from '@eslint/object-schema'; + +/** + * @fileoverview ConfigSchema + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("@eslint/object-schema").PropertyDefinition} PropertyDefinition */ +/** @typedef {import("@eslint/object-schema").ObjectDefinition} ObjectDefinition */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * A strategy that does nothing. + * @type {PropertyDefinition} + */ +const NOOP_STRATEGY = { + required: false, + merge() { + return undefined; + }, + validate() {}, +}; + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The base schema that every ConfigArray uses. + * @type {ObjectDefinition} + */ +const baseSchema = Object.freeze({ + name: { + required: false, + merge() { + return undefined; + }, + validate(value) { + if (typeof value !== "string") { + throw new TypeError("Property must be a string."); + } + }, + }, + files: NOOP_STRATEGY, + ignores: NOOP_STRATEGY, +}); + +/** + * @fileoverview ConfigSchema + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Asserts that a given value is an array. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array. + */ +function assertIsArray(value) { + if (!Array.isArray(value)) { + throw new TypeError("Expected value to be an array."); + } +} + +/** + * Asserts that a given value is an array containing only strings and functions. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array of strings and functions. + */ +function assertIsArrayOfStringsAndFunctions(value) { + assertIsArray(value); + + if ( + value.some( + item => typeof item !== "string" && typeof item !== "function", + ) + ) { + throw new TypeError( + "Expected array to only contain strings and functions.", + ); + } +} + +/** + * Asserts that a given value is a non-empty array. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array or an empty array. + */ +function assertIsNonEmptyArray(value) { + if (!Array.isArray(value) || value.length === 0) { + throw new TypeError("Expected value to be a non-empty array."); + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The schema for `files` and `ignores` that every ConfigArray uses. + * @type {ObjectDefinition} + */ +const filesAndIgnoresSchema = Object.freeze({ + files: { + required: false, + merge() { + return undefined; + }, + validate(value) { + // first check if it's an array + assertIsNonEmptyArray(value); + + // then check each member + value.forEach(item => { + if (Array.isArray(item)) { + assertIsArrayOfStringsAndFunctions(item); + } else if ( + typeof item !== "string" && + typeof item !== "function" + ) { + throw new TypeError( + "Items must be a string, a function, or an array of strings and functions.", + ); + } + }); + }, + }, + ignores: { + required: false, + merge() { + return undefined; + }, + validate: assertIsArrayOfStringsAndFunctions, + }, +}); + +/** + * @fileoverview ConfigArray + * @author Nicholas C. Zakas + */ + + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("./types.ts").ConfigObject} ConfigObject */ +/** @typedef {import("minimatch").IMinimatchStatic} IMinimatchStatic */ +/** @typedef {import("minimatch").IMinimatch} IMinimatch */ +/** @typedef {import("@jsr/std__path")} PathImpl */ + +/* + * This is a bit of a hack to make TypeScript happy with the Rollup-created + * CommonJS file. Rollup doesn't do object destructuring for imported files + * and instead imports the default via `require()`. This messes up type checking + * for `ObjectSchema`. To work around that, we just import the type manually + * and give it a different name to use in the JSDoc comments. + */ +/** @typedef {import("@eslint/object-schema").ObjectSchema} ObjectSchemaInstance */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const Minimatch = minimatch.Minimatch; +const debug = createDebug("@eslint/config-array"); + +/** + * A cache for minimatch instances. + * @type {Map} + */ +const minimatchCache = new Map(); + +/** + * A cache for negated minimatch instances. + * @type {Map} + */ +const negatedMinimatchCache = new Map(); + +/** + * Options to use with minimatch. + * @type {Object} + */ +const MINIMATCH_OPTIONS = { + // matchBase: true, + dot: true, + allowWindowsEscape: true, +}; + +/** + * The types of config objects that are supported. + * @type {Set} + */ +const CONFIG_TYPES = new Set(["array", "function"]); + +/** + * Fields that are considered metadata and not part of the config object. + * @type {Set} + */ +const META_FIELDS = new Set(["name"]); + +/** + * A schema containing just files and ignores for early validation. + * @type {ObjectSchemaInstance} + */ +const FILES_AND_IGNORES_SCHEMA = new ObjectSchema(filesAndIgnoresSchema); + +// Precomputed constant objects returned by `ConfigArray.getConfigWithStatus`. + +const CONFIG_WITH_STATUS_EXTERNAL = Object.freeze({ status: "external" }); +const CONFIG_WITH_STATUS_IGNORED = Object.freeze({ status: "ignored" }); +const CONFIG_WITH_STATUS_UNCONFIGURED = Object.freeze({ + status: "unconfigured", +}); + +// Match two leading dots followed by a slash or the end of input. +const EXTERNAL_PATH_REGEX = /^\.\.(?:\/|$)/u; + +/** + * Wrapper error for config validation errors that adds a name to the front of the + * error message. + */ +class ConfigError extends Error { + /** + * Creates a new instance. + * @param {string} name The config object name causing the error. + * @param {number} index The index of the config object in the array. + * @param {Object} options The options for the error. + * @param {Error} [options.cause] The error that caused this error. + * @param {string} [options.message] The message to use for the error. + */ + constructor(name, index, { cause, message }) { + const finalMessage = message || cause.message; + + super(`Config ${name}: ${finalMessage}`, { cause }); + + // copy over custom properties that aren't represented + if (cause) { + for (const key of Object.keys(cause)) { + if (!(key in this)) { + this[key] = cause[key]; + } + } + } + + /** + * The name of the error. + * @type {string} + * @readonly + */ + this.name = "ConfigError"; + + /** + * The index of the config object in the array. + * @type {number} + * @readonly + */ + this.index = index; + } +} + +/** + * Gets the name of a config object. + * @param {ConfigObject} config The config object to get the name of. + * @returns {string} The name of the config object. + */ +function getConfigName(config) { + if (config && typeof config.name === "string" && config.name) { + return `"${config.name}"`; + } + + return "(unnamed)"; +} + +/** + * Rethrows a config error with additional information about the config object. + * @param {object} config The config object to get the name of. + * @param {number} index The index of the config object in the array. + * @param {Error} error The error to rethrow. + * @throws {ConfigError} When the error is rethrown for a config. + */ +function rethrowConfigError(config, index, error) { + const configName = getConfigName(config); + throw new ConfigError(configName, index, { cause: error }); +} + +/** + * Shorthand for checking if a value is a string. + * @param {any} value The value to check. + * @returns {boolean} True if a string, false if not. + */ +function isString(value) { + return typeof value === "string"; +} + +/** + * Creates a function that asserts that the config is valid + * during normalization. This checks that the config is not nullish + * and that files and ignores keys of a config object are valid as per base schema. + * @param {Object} config The config object to check. + * @param {number} index The index of the config object in the array. + * @returns {void} + * @throws {ConfigError} If the files and ignores keys of a config object are not valid. + */ +function assertValidBaseConfig(config, index) { + if (config === null) { + throw new ConfigError(getConfigName(config), index, { + message: "Unexpected null config.", + }); + } + + if (config === undefined) { + throw new ConfigError(getConfigName(config), index, { + message: "Unexpected undefined config.", + }); + } + + if (typeof config !== "object") { + throw new ConfigError(getConfigName(config), index, { + message: "Unexpected non-object config.", + }); + } + + const validateConfig = {}; + + if ("files" in config) { + validateConfig.files = config.files; + } + + if ("ignores" in config) { + validateConfig.ignores = config.ignores; + } + + try { + FILES_AND_IGNORES_SCHEMA.validate(validateConfig); + } catch (validationError) { + rethrowConfigError(config, index, validationError); + } +} + +/** + * Wrapper around minimatch that caches minimatch patterns for + * faster matching speed over multiple file path evaluations. + * @param {string} filepath The file path to match. + * @param {string} pattern The glob pattern to match against. + * @param {object} options The minimatch options to use. + * @returns + */ +function doMatch(filepath, pattern, options = {}) { + let cache = minimatchCache; + + if (options.flipNegate) { + cache = negatedMinimatchCache; + } + + let matcher = cache.get(pattern); + + if (!matcher) { + matcher = new Minimatch( + pattern, + Object.assign({}, MINIMATCH_OPTIONS, options), + ); + cache.set(pattern, matcher); + } + + return matcher.match(filepath); +} + +/** + * Normalizes a `ConfigArray` by flattening it and executing any functions + * that are found inside. + * @param {Array} items The items in a `ConfigArray`. + * @param {Object} context The context object to pass into any function + * found. + * @param {Array} extraConfigTypes The config types to check. + * @returns {Promise} A flattened array containing only config objects. + * @throws {TypeError} When a config function returns a function. + */ +async function normalize(items, context, extraConfigTypes) { + const allowFunctions = extraConfigTypes.includes("function"); + const allowArrays = extraConfigTypes.includes("array"); + + async function* flatTraverse(array) { + for (let item of array) { + if (typeof item === "function") { + if (!allowFunctions) { + throw new TypeError("Unexpected function."); + } + + item = item(context); + if (item.then) { + item = await item; + } + } + + if (Array.isArray(item)) { + if (!allowArrays) { + throw new TypeError("Unexpected array."); + } + yield* flatTraverse(item); + } else if (typeof item === "function") { + throw new TypeError( + "A config function can only return an object or array.", + ); + } else { + yield item; + } + } + } + + /* + * Async iterables cannot be used with the spread operator, so we need to manually + * create the array to return. + */ + const asyncIterable = await flatTraverse(items); + const configs = []; + + for await (const config of asyncIterable) { + configs.push(config); + } + + return configs; +} + +/** + * Normalizes a `ConfigArray` by flattening it and executing any functions + * that are found inside. + * @param {Array} items The items in a `ConfigArray`. + * @param {Object} context The context object to pass into any function + * found. + * @param {Array} extraConfigTypes The config types to check. + * @returns {Array} A flattened array containing only config objects. + * @throws {TypeError} When a config function returns a function. + */ +function normalizeSync(items, context, extraConfigTypes) { + const allowFunctions = extraConfigTypes.includes("function"); + const allowArrays = extraConfigTypes.includes("array"); + + function* flatTraverse(array) { + for (let item of array) { + if (typeof item === "function") { + if (!allowFunctions) { + throw new TypeError("Unexpected function."); + } + + item = item(context); + if (item.then) { + throw new TypeError( + "Async config functions are not supported.", + ); + } + } + + if (Array.isArray(item)) { + if (!allowArrays) { + throw new TypeError("Unexpected array."); + } + + yield* flatTraverse(item); + } else if (typeof item === "function") { + throw new TypeError( + "A config function can only return an object or array.", + ); + } else { + yield item; + } + } + } + + return [...flatTraverse(items)]; +} + +/** + * Determines if a given file path should be ignored based on the given + * matcher. + * @param {Array boolean)>} ignores The ignore patterns to check. + * @param {string} filePath The unprocessed file path to check. + * @param {string} relativeFilePath The path of the file to check relative to the base path, + * using forward slash (`"/"`) as a separator. + * @returns {boolean} True if the path should be ignored and false if not. + */ +function shouldIgnorePath(ignores, filePath, relativeFilePath) { + return ignores.reduce((ignored, matcher) => { + if (!ignored) { + if (typeof matcher === "function") { + return matcher(filePath); + } + + // don't check negated patterns because we're not ignored yet + if (!matcher.startsWith("!")) { + return doMatch(relativeFilePath, matcher); + } + + // otherwise we're still not ignored + return false; + } + + // only need to check negated patterns because we're ignored + if (typeof matcher === "string" && matcher.startsWith("!")) { + return !doMatch(relativeFilePath, matcher, { + flipNegate: true, + }); + } + + return ignored; + }, false); +} + +/** + * Determines if a given file path is matched by a config based on + * `ignores` only. + * @param {string} filePath The unprocessed file path to check. + * @param {string} relativeFilePath The path of the file to check relative to the base path, + * using forward slash (`"/"`) as a separator. + * @param {Object} config The config object to check. + * @returns {boolean} True if the file path is matched by the config, + * false if not. + */ +function pathMatchesIgnores(filePath, relativeFilePath, config) { + return ( + Object.keys(config).filter(key => !META_FIELDS.has(key)).length > 1 && + !shouldIgnorePath(config.ignores, filePath, relativeFilePath) + ); +} + +/** + * Determines if a given file path is matched by a config. If the config + * has no `files` field, then it matches; otherwise, if a `files` field + * is present then we match the globs in `files` and exclude any globs in + * `ignores`. + * @param {string} filePath The unprocessed file path to check. + * @param {string} relativeFilePath The path of the file to check relative to the base path, + * using forward slash (`"/"`) as a separator. + * @param {Object} config The config object to check. + * @returns {boolean} True if the file path is matched by the config, + * false if not. + */ +function pathMatches(filePath, relativeFilePath, config) { + // match both strings and functions + function match(pattern) { + if (isString(pattern)) { + return doMatch(relativeFilePath, pattern); + } + + if (typeof pattern === "function") { + return pattern(filePath); + } + + throw new TypeError(`Unexpected matcher type ${pattern}.`); + } + + // check for all matches to config.files + let filePathMatchesPattern = config.files.some(pattern => { + if (Array.isArray(pattern)) { + return pattern.every(match); + } + + return match(pattern); + }); + + /* + * If the file path matches the config.files patterns, then check to see + * if there are any files to ignore. + */ + if (filePathMatchesPattern && config.ignores) { + filePathMatchesPattern = !shouldIgnorePath( + config.ignores, + filePath, + relativeFilePath, + ); + } + + return filePathMatchesPattern; +} + +/** + * Ensures that a ConfigArray has been normalized. + * @param {ConfigArray} configArray The ConfigArray to check. + * @returns {void} + * @throws {Error} When the `ConfigArray` is not normalized. + */ +function assertNormalized(configArray) { + // TODO: Throw more verbose error + if (!configArray.isNormalized()) { + throw new Error( + "ConfigArray must be normalized to perform this operation.", + ); + } +} + +/** + * Ensures that config types are valid. + * @param {Array} extraConfigTypes The config types to check. + * @returns {void} + * @throws {Error} When the config types array is invalid. + */ +function assertExtraConfigTypes(extraConfigTypes) { + if (extraConfigTypes.length > 2) { + throw new TypeError( + "configTypes must be an array with at most two items.", + ); + } + + for (const configType of extraConfigTypes) { + if (!CONFIG_TYPES.has(configType)) { + throw new TypeError( + `Unexpected config type "${configType}" found. Expected one of: "object", "array", "function".`, + ); + } + } +} + +/** + * Returns path-handling implementations for Unix or Windows, depending on a given absolute path. + * @param {string} fileOrDirPath The absolute path to check. + * @returns {PathImpl} Path-handling implementations for the specified path. + * @throws An error is thrown if the specified argument is not an absolute path. + */ +function getPathImpl(fileOrDirPath) { + // Posix absolute paths always start with a slash. + if (fileOrDirPath.startsWith("/")) { + return posixPath; + } + + // Windows absolute paths start with a letter followed by a colon and at least one backslash, + // or with two backslashes in the case of UNC paths. + // Forward slashed are automatically normalized to backslashes. + if (/^(?:[A-Za-z]:[/\\]|[/\\]{2})/u.test(fileOrDirPath)) { + return windowsPath; + } + + throw new Error( + `Expected an absolute path but received "${fileOrDirPath}"`, + ); +} + +/** + * Converts a given path to a relative path with all separator characters replaced by forward slashes (`"/"`). + * @param {string} fileOrDirPath The unprocessed path to convert. + * @param {string} namespacedBasePath The namespaced base path of the directory to which the calculated path shall be relative. + * @param {PathImpl} path Path-handling implementations. + * @returns {string} A relative path with all separator characters replaced by forward slashes. + */ +function toRelativePath(fileOrDirPath, namespacedBasePath, path) { + const fullPath = path.resolve(namespacedBasePath, fileOrDirPath); + const namespacedFullPath = path.toNamespacedPath(fullPath); + const relativePath = path.relative(namespacedBasePath, namespacedFullPath); + return relativePath.replaceAll(path.SEPARATOR, "/"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +const ConfigArraySymbol = { + isNormalized: Symbol("isNormalized"), + configCache: Symbol("configCache"), + schema: Symbol("schema"), + finalizeConfig: Symbol("finalizeConfig"), + preprocessConfig: Symbol("preprocessConfig"), +}; + +// used to store calculate data for faster lookup +const dataCache = new WeakMap(); + +/** + * Represents an array of config objects and provides method for working with + * those config objects. + */ +class ConfigArray extends Array { + /** + * The namespaced path of the config file directory. + * @type {string} + */ + #namespacedBasePath; + + /** + * Path-handling implementations. + * @type {PathImpl} + */ + #path; + + /** + * Creates a new instance of ConfigArray. + * @param {Iterable|Function|Object} configs An iterable yielding config + * objects, or a config function, or a config object. + * @param {Object} options The options for the ConfigArray. + * @param {string} [options.basePath="/"] The absolute path of the config file directory. + * Defaults to `"/"`. + * @param {boolean} [options.normalized=false] Flag indicating if the + * configs have already been normalized. + * @param {Object} [options.schema] The additional schema + * definitions to use for the ConfigArray schema. + * @param {Array} [options.extraConfigTypes] List of config types supported. + */ + constructor( + configs, + { + basePath = "/", + normalized = false, + schema: customSchema, + extraConfigTypes = [], + } = {}, + ) { + super(); + + /** + * Tracks if the array has been normalized. + * @property isNormalized + * @type {boolean} + * @private + */ + this[ConfigArraySymbol.isNormalized] = normalized; + + /** + * The schema used for validating and merging configs. + * @property schema + * @type {ObjectSchemaInstance} + * @private + */ + this[ConfigArraySymbol.schema] = new ObjectSchema( + Object.assign({}, customSchema, baseSchema), + ); + + if (!isString(basePath) || !basePath) { + throw new TypeError("basePath must be a non-empty string"); + } + + /** + * The path of the config file that this array was loaded from. + * This is used to calculate filename matches. + * @property basePath + * @type {string} + */ + this.basePath = basePath; + + assertExtraConfigTypes(extraConfigTypes); + + /** + * The supported config types. + * @type {Array} + */ + this.extraConfigTypes = [...extraConfigTypes]; + Object.freeze(this.extraConfigTypes); + + /** + * A cache to store calculated configs for faster repeat lookup. + * @property configCache + * @type {Map} + * @private + */ + this[ConfigArraySymbol.configCache] = new Map(); + + // init cache + dataCache.set(this, { + explicitMatches: new Map(), + directoryMatches: new Map(), + files: undefined, + ignores: undefined, + }); + + // load the configs into this array + if (Array.isArray(configs)) { + this.push(...configs); + } else { + this.push(configs); + } + + // select path-handling implementations depending on the base path + this.#path = getPathImpl(basePath); + + // On Windows, `path.relative()` returns an absolute path when given two paths on different drives. + // The namespaced base path is useful to make sure that calculated relative paths are always relative. + // On Unix, it is identical to the base path. + this.#namespacedBasePath = this.#path.toNamespacedPath(basePath); + } + + /** + * Prevent normal array methods from creating a new `ConfigArray` instance. + * This is to ensure that methods such as `slice()` won't try to create a + * new instance of `ConfigArray` behind the scenes as doing so may throw + * an error due to the different constructor signature. + * @type {ArrayConstructor} The `Array` constructor. + */ + static get [Symbol.species]() { + return Array; + } + + /** + * Returns the `files` globs from every config object in the array. + * This can be used to determine which files will be matched by a + * config array or to use as a glob pattern when no patterns are provided + * for a command line interface. + * @returns {Array} An array of matchers. + */ + get files() { + assertNormalized(this); + + // if this data has been cached, retrieve it + const cache = dataCache.get(this); + + if (cache.files) { + return cache.files; + } + + // otherwise calculate it + + const result = []; + + for (const config of this) { + if (config.files) { + config.files.forEach(filePattern => { + result.push(filePattern); + }); + } + } + + // store result + cache.files = result; + dataCache.set(this, cache); + + return result; + } + + /** + * Returns ignore matchers that should always be ignored regardless of + * the matching `files` fields in any configs. This is necessary to mimic + * the behavior of things like .gitignore and .eslintignore, allowing a + * globbing operation to be faster. + * @returns {string[]} An array of string patterns and functions to be ignored. + */ + get ignores() { + assertNormalized(this); + + // if this data has been cached, retrieve it + const cache = dataCache.get(this); + + if (cache.ignores) { + return cache.ignores; + } + + // otherwise calculate it + + const result = []; + + for (const config of this) { + /* + * We only count ignores if there are no other keys in the object. + * In this case, it acts list a globally ignored pattern. If there + * are additional keys, then ignores act like exclusions. + */ + if ( + config.ignores && + Object.keys(config).filter(key => !META_FIELDS.has(key)) + .length === 1 + ) { + result.push(...config.ignores); + } + } + + // store result + cache.ignores = result; + dataCache.set(this, cache); + + return result; + } + + /** + * Indicates if the config array has been normalized. + * @returns {boolean} True if the config array is normalized, false if not. + */ + isNormalized() { + return this[ConfigArraySymbol.isNormalized]; + } + + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {Object} [context] The context object for config functions. + * @returns {Promise} The current ConfigArray instance. + */ + async normalize(context = {}) { + if (!this.isNormalized()) { + const normalizedConfigs = await normalize( + this, + context, + this.extraConfigTypes, + ); + this.length = 0; + this.push( + ...normalizedConfigs.map( + this[ConfigArraySymbol.preprocessConfig].bind(this), + ), + ); + this.forEach(assertValidBaseConfig); + this[ConfigArraySymbol.isNormalized] = true; + + // prevent further changes + Object.freeze(this); + } + + return this; + } + + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {Object} [context] The context object for config functions. + * @returns {ConfigArray} The current ConfigArray instance. + */ + normalizeSync(context = {}) { + if (!this.isNormalized()) { + const normalizedConfigs = normalizeSync( + this, + context, + this.extraConfigTypes, + ); + this.length = 0; + this.push( + ...normalizedConfigs.map( + this[ConfigArraySymbol.preprocessConfig].bind(this), + ), + ); + this.forEach(assertValidBaseConfig); + this[ConfigArraySymbol.isNormalized] = true; + + // prevent further changes + Object.freeze(this); + } + + return this; + } + + /* eslint-disable class-methods-use-this -- Desired as instance methods */ + + /** + * Finalizes the state of a config before being cached and returned by + * `getConfig()`. Does nothing by default but is provided to be + * overridden by subclasses as necessary. + * @param {Object} config The config to finalize. + * @returns {Object} The finalized config. + */ + [ConfigArraySymbol.finalizeConfig](config) { + return config; + } + + /** + * Preprocesses a config during the normalization process. This is the + * method to override if you want to convert an array item before it is + * validated for the first time. For example, if you want to replace a + * string with an object, this is the method to override. + * @param {Object} config The config to preprocess. + * @returns {Object} The config to use in place of the argument. + */ + [ConfigArraySymbol.preprocessConfig](config) { + return config; + } + + /* eslint-enable class-methods-use-this -- Desired as instance methods */ + + /** + * Returns the config object for a given file path and a status that can be used to determine why a file has no config. + * @param {string} filePath The path of a file to get a config for. + * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }} + * An object with an optional property `config` and property `status`. + * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig}, + * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}. + */ + getConfigWithStatus(filePath) { + assertNormalized(this); + + const cache = this[ConfigArraySymbol.configCache]; + + // first check the cache for a filename match to avoid duplicate work + if (cache.has(filePath)) { + return cache.get(filePath); + } + + // check to see if the file is outside the base path + + const relativeFilePath = toRelativePath( + filePath, + this.#namespacedBasePath, + this.#path, + ); + + if (EXTERNAL_PATH_REGEX.test(relativeFilePath)) { + debug(`No config for file ${filePath} outside of base path`); + + // cache and return result + cache.set(filePath, CONFIG_WITH_STATUS_EXTERNAL); + return CONFIG_WITH_STATUS_EXTERNAL; + } + + // next check to see if the file should be ignored + + // check if this should be ignored due to its directory + if (this.isDirectoryIgnored(this.#path.dirname(filePath))) { + debug(`Ignoring ${filePath} based on directory pattern`); + + // cache and return result + cache.set(filePath, CONFIG_WITH_STATUS_IGNORED); + return CONFIG_WITH_STATUS_IGNORED; + } + + if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath} based on file pattern`); + + // cache and return result + cache.set(filePath, CONFIG_WITH_STATUS_IGNORED); + return CONFIG_WITH_STATUS_IGNORED; + } + + // filePath isn't automatically ignored, so try to construct config + + const matchingConfigIndices = []; + let matchFound = false; + const universalPattern = /^\*$|\/\*{1,2}$/u; + + this.forEach((config, index) => { + if (!config.files) { + if (!config.ignores) { + debug(`Universal config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + if (pathMatchesIgnores(filePath, relativeFilePath, config)) { + debug( + `Matching config found for ${filePath} (based on ignores: ${config.ignores})`, + ); + matchingConfigIndices.push(index); + return; + } + + debug( + `Skipped config found for ${filePath} (based on ignores: ${config.ignores})`, + ); + return; + } + + /* + * If a config has a files pattern * or patterns ending in /** or /*, + * and the filePath only matches those patterns, then the config is only + * applied if there is another config where the filePath matches + * a file with a specific extensions such as *.js. + */ + + const universalFiles = config.files.filter(pattern => + universalPattern.test(pattern), + ); + + // universal patterns were found so we need to check the config twice + if (universalFiles.length) { + debug("Universal files patterns found. Checking carefully."); + + const nonUniversalFiles = config.files.filter( + pattern => !universalPattern.test(pattern), + ); + + // check that the config matches without the non-universal files first + if ( + nonUniversalFiles.length && + pathMatches(filePath, relativeFilePath, { + files: nonUniversalFiles, + ignores: config.ignores, + }) + ) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + matchFound = true; + return; + } + + // if there wasn't a match then check if it matches with universal files + if ( + universalFiles.length && + pathMatches(filePath, relativeFilePath, { + files: universalFiles, + ignores: config.ignores, + }) + ) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + // if we make here, then there was no match + return; + } + + // the normal case + if (pathMatches(filePath, relativeFilePath, config)) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + matchFound = true; + } + }); + + // if matching both files and ignores, there will be no config to create + if (!matchFound) { + debug(`No matching configs found for ${filePath}`); + + // cache and return result + cache.set(filePath, CONFIG_WITH_STATUS_UNCONFIGURED); + return CONFIG_WITH_STATUS_UNCONFIGURED; + } + + // check to see if there is a config cached by indices + const indicesKey = matchingConfigIndices.toString(); + let configWithStatus = cache.get(indicesKey); + + if (configWithStatus) { + // also store for filename for faster lookup next time + cache.set(filePath, configWithStatus); + + return configWithStatus; + } + + // otherwise construct the config + + // eslint-disable-next-line array-callback-return, consistent-return -- rethrowConfigError always throws an error + let finalConfig = matchingConfigIndices.reduce((result, index) => { + try { + return this[ConfigArraySymbol.schema].merge( + result, + this[index], + ); + } catch (validationError) { + rethrowConfigError(this[index], index, validationError); + } + }, {}); + + finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig); + + configWithStatus = Object.freeze({ + config: finalConfig, + status: "matched", + }); + cache.set(filePath, configWithStatus); + cache.set(indicesKey, configWithStatus); + + return configWithStatus; + } + + /** + * Returns the config object for a given file path. + * @param {string} filePath The path of a file to get a config for. + * @returns {Object|undefined} The config object for this file or `undefined`. + */ + getConfig(filePath) { + return this.getConfigWithStatus(filePath).config; + } + + /** + * Determines whether a file has a config or why it doesn't. + * @param {string} filePath The path of the file to check. + * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values: + * * `"ignored"`: the file is ignored + * * `"external"`: the file is outside the base path + * * `"unconfigured"`: the file is not matched by any config + * * `"matched"`: the file has a matching config + */ + getConfigStatus(filePath) { + return this.getConfigWithStatus(filePath).status; + } + + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + * @deprecated Use `isFileIgnored` instead. + */ + isIgnored(filePath) { + return this.isFileIgnored(filePath); + } + + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + */ + isFileIgnored(filePath) { + return this.getConfigStatus(filePath) === "ignored"; + } + + /** + * Determines if the given directory is ignored based on the configs. + * This checks only default `ignores` that don't have `files` in the + * same config. A pattern such as `/foo` be considered to ignore the directory + * while a pattern such as `/foo/**` is not considered to ignore the + * directory because it is matching files. + * @param {string} directoryPath The path of a directory to check. + * @returns {boolean} True if the directory is ignored, false if not. Will + * return true for any directory that is not inside of `basePath`. + * @throws {Error} When the `ConfigArray` is not normalized. + */ + isDirectoryIgnored(directoryPath) { + assertNormalized(this); + + const relativeDirectoryPath = toRelativePath( + directoryPath, + this.#namespacedBasePath, + this.#path, + ); + + // basePath directory can never be ignored + if (relativeDirectoryPath === "") { + return false; + } + + if (EXTERNAL_PATH_REGEX.test(relativeDirectoryPath)) { + return true; + } + + // first check the cache + const cache = dataCache.get(this).directoryMatches; + + if (cache.has(relativeDirectoryPath)) { + return cache.get(relativeDirectoryPath); + } + + const directoryParts = relativeDirectoryPath.split("/"); + let relativeDirectoryToCheck = ""; + let result; + + /* + * In order to get the correct gitignore-style ignores, where an + * ignored parent directory cannot have any descendants unignored, + * we need to check every directory starting at the parent all + * the way down to the actual requested directory. + * + * We aggressively cache all of this info to make sure we don't + * have to recalculate everything for every call. + */ + do { + relativeDirectoryToCheck += `${directoryParts.shift()}/`; + + result = shouldIgnorePath( + this.ignores, + this.#path.join(this.basePath, relativeDirectoryToCheck), + relativeDirectoryToCheck, + ); + + cache.set(relativeDirectoryToCheck, result); + } while (!result && directoryParts.length); + + // also cache the result for the requested path + cache.set(relativeDirectoryPath, result); + + return result; + } +} + +export { ConfigArray, ConfigArraySymbol }; diff --git a/node_modules/@eslint/config-array/dist/esm/std__path/posix.js b/node_modules/@eslint/config-array/dist/esm/std__path/posix.js new file mode 100644 index 0000000..bbfd22a --- /dev/null +++ b/node_modules/@eslint/config-array/dist/esm/std__path/posix.js @@ -0,0 +1,1302 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +function assertPath(path) { + if (typeof path !== "string") { + throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function stripSuffix(name, suffix) { + if (suffix.length >= name.length) { + return name; + } + const lenDiff = name.length - suffix.length; + for(let i = suffix.length - 1; i >= 0; --i){ + if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) { + return name; + } + } + return name.slice(0, -suffix.length); +} +function lastPathSegment(path, isSep, start = 0) { + let matchedNonSeparator = false; + let end = path.length; + for(let i = path.length - 1; i >= start; --i){ + if (isSep(path.charCodeAt(i))) { + if (matchedNonSeparator) { + start = i + 1; + break; + } + } else if (!matchedNonSeparator) { + matchedNonSeparator = true; + end = i + 1; + } + } + return path.slice(start, end); +} +function assertArgs$1(path, suffix) { + assertPath(path); + if (path.length === 0) return path; + if (typeof suffix !== "string") { + throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +function stripTrailingSeparators(segment, isSep) { + if (segment.length <= 1) { + return segment; + } + let end = segment.length; + for(let i = segment.length - 1; i > 0; i--){ + if (isSep(segment.charCodeAt(i))) { + end = i; + } else { + break; + } + } + return segment.slice(0, end); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +// Alphabet chars. +// Non-alphabetic chars. +const CHAR_DOT = 46; /* . */ +const CHAR_FORWARD_SLASH = 47; /* / */ + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +function isPosixPathSeparator(code) { + return code === CHAR_FORWARD_SLASH; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the last portion of a `path`. + * Trailing directory separators are ignored, and optional suffix is removed. + * + * @example Usage + * ```ts + * import { basename } from "@std/path/posix/basename"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(basename("/home/user/Documents/"), "Documents"); + * assertEquals(basename("/home/user/Documents/image.png"), "image.png"); + * assertEquals(basename("/home/user/Documents/image.png", ".png"), "image"); + * ``` + * + * @example Working with URLs + * + * Note: This function doesn't automatically strip hash and query parts from + * URLs. If your URL contains a hash or query, remove them before passing the + * URL to the function. This can be done by passing the URL to `new URL(url)`, + * and setting the `hash` and `search` properties to empty strings. + * + * ```ts + * import { basename } from "@std/path/posix/basename"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(basename("https://deno.land/std/path/mod.ts"), "mod.ts"); + * assertEquals(basename("https://deno.land/std/path/mod.ts", ".ts"), "mod"); + * assertEquals(basename("https://deno.land/std/path/mod.ts?a=b"), "mod.ts?a=b"); + * assertEquals(basename("https://deno.land/std/path/mod.ts#header"), "mod.ts#header"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `basename` from `@std/path/posix/unstable-basename`. + * + * @param path The path to extract the name from. + * @param suffix The suffix to remove from extracted name. + * @returns The extracted name. + */ function basename(path, suffix = "") { + assertArgs$1(path, suffix); + const lastSegment = lastPathSegment(path, isPosixPathSeparator); + const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator); + return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * The character used to separate entries in the PATH environment variable. + */ const DELIMITER = ":"; +/** + * The character used to separate components of a file path. + */ const SEPARATOR = "/"; +/** + * A regular expression that matches one or more path separators. + */ const SEPARATOR_PATTERN = /\/+/; + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg$3(path) { + assertPath(path); + if (path.length === 0) return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the directory path of a `path`. + * + * @example Usage + * ```ts + * import { dirname } from "@std/path/posix/dirname"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(dirname("/home/user/Documents/"), "/home/user"); + * assertEquals(dirname("/home/user/Documents/image.png"), "/home/user/Documents"); + * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path"); + * ``` + * + * @example Working with URLs + * + * ```ts + * import { dirname } from "@std/path/posix/dirname"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path"); + * assertEquals(dirname("https://deno.land/std/path/mod.ts?a=b"), "https://deno.land/std/path"); + * assertEquals(dirname("https://deno.land/std/path/mod.ts#header"), "https://deno.land/std/path"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `dirname` from `@std/path/posix/unstable-dirname`. + * + * @param path The path to get the directory from. + * @returns The directory path. + */ function dirname(path) { + assertArg$3(path); + let end = -1; + let matchedNonSeparator = false; + for(let i = path.length - 1; i >= 1; --i){ + if (isPosixPathSeparator(path.charCodeAt(i))) { + if (matchedNonSeparator) { + end = i; + break; + } + } else { + matchedNonSeparator = true; + } + } + // No matches. Fallback based on provided path: + // + // - leading slashes paths + // "/foo" => "/" + // "///foo" => "/" + // - no slash path + // "foo" => "." + if (end === -1) { + return isPosixPathSeparator(path.charCodeAt(0)) ? "/" : "."; + } + return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the extension of the `path` with leading period. + * + * @example Usage + * ```ts + * import { extname } from "@std/path/posix/extname"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(extname("/home/user/Documents/file.ts"), ".ts"); + * assertEquals(extname("/home/user/Documents/"), ""); + * assertEquals(extname("/home/user/Documents/image.png"), ".png"); + * ``` + * + * @example Working with URLs + * + * Note: This function doesn't automatically strip hash and query parts from + * URLs. If your URL contains a hash or query, remove them before passing the + * URL to the function. This can be done by passing the URL to `new URL(url)`, + * and setting the `hash` and `search` properties to empty strings. + * + * ```ts + * import { extname } from "@std/path/posix/extname"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(extname("https://deno.land/std/path/mod.ts"), ".ts"); + * assertEquals(extname("https://deno.land/std/path/mod.ts?a=b"), ".ts?a=b"); + * assertEquals(extname("https://deno.land/std/path/mod.ts#header"), ".ts#header"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `extname` from `@std/path/posix/unstable-extname`. + * + * @param path The path to get the extension from. + * @returns The extension (ex. for `file.ts` returns `.ts`). + */ function extname(path) { + assertPath(path); + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + let preDotState = 0; + for(let i = path.length - 1; i >= 0; --i){ + const code = path.charCodeAt(i); + if (isPosixPathSeparator(code)) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path.slice(startDot, end); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function _format(sep, pathObject) { + const dir = pathObject.dir || pathObject.root; + const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? ""); + if (!dir) return base; + if (base === sep) return dir; + if (dir === pathObject.root) return dir + base; + return dir + sep + base; +} +function assertArg$2(pathObject) { + if (pathObject === null || typeof pathObject !== "object") { + throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Generate a path from `ParsedPath` object. + * + * @example Usage + * ```ts + * import { format } from "@std/path/posix/format"; + * import { assertEquals } from "@std/assert"; + * + * const path = format({ + * root: "/", + * dir: "/path/dir", + * base: "file.txt", + * ext: ".txt", + * name: "file" + * }); + * assertEquals(path, "/path/dir/file.txt"); + * ``` + * + * @param pathObject The path object to format. + * @returns The formatted path. + */ function format(pathObject) { + assertArg$2(pathObject); + return _format("/", pathObject); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg$1(url) { + url = url instanceof URL ? url : new URL(url); + if (url.protocol !== "file:") { + throw new TypeError(`URL must be a file URL: received "${url.protocol}"`); + } + return url; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a file URL to a path string. + * + * @example Usage + * ```ts + * import { fromFileUrl } from "@std/path/posix/from-file-url"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo"); + * ``` + * + * @param url The file URL to convert. + * @returns The path string. + */ function fromFileUrl(url) { + url = assertArg$1(url); + return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25")); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Verifies whether provided path is absolute. + * + * @example Usage + * ```ts + * import { isAbsolute } from "@std/path/posix/is-absolute"; + * import { assert, assertFalse } from "@std/assert"; + * + * assert(isAbsolute("/home/user/Documents/")); + * assertFalse(isAbsolute("home/user/Documents/")); + * ``` + * + * @param path The path to verify. + * @returns Whether the path is absolute. + */ function isAbsolute(path) { + assertPath(path); + return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0)); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg(path) { + assertPath(path); + if (path.length === 0) return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +// Resolves . and .. elements in a path with directory names +function normalizeString(path, allowAboveRoot, separator, isPathSeparator) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let code; + for(let i = 0; i <= path.length; ++i){ + if (i < path.length) code = path.charCodeAt(i); + else if (isPathSeparator(code)) break; + else code = CHAR_FORWARD_SLASH; + if (isPathSeparator(code)) { + if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf(separator); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); + } + lastSlash = i; + dots = 0; + continue; + } else if (res.length === 2 || res.length === 1) { + res = ""; + lastSegmentLength = 0; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) res += `${separator}..`; + else res = ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) res += separator + path.slice(lastSlash + 1, i); + else res = path.slice(lastSlash + 1, i); + lastSegmentLength = i - lastSlash - 1; + } + lastSlash = i; + dots = 0; + } else if (code === CHAR_DOT && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Normalize the `path`, resolving `'..'` and `'.'` segments. + * Note that resolving these segments does not necessarily mean that all will be eliminated. + * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`. + * + * @example Usage + * ```ts + * import { normalize } from "@std/path/posix/normalize"; + * import { assertEquals } from "@std/assert"; + * + * const path = normalize("/foo/bar//baz/asdf/quux/.."); + * assertEquals(path, "/foo/bar/baz/asdf"); + * ``` + * + * @example Working with URLs + * + * Note: This function will remove the double slashes from a URL's scheme. + * Hence, do not pass a full URL to this function. Instead, pass the pathname of + * the URL. + * + * ```ts + * import { normalize } from "@std/path/posix/normalize"; + * import { assertEquals } from "@std/assert"; + * + * const url = new URL("https://deno.land"); + * url.pathname = normalize("//std//assert//.//mod.ts"); + * assertEquals(url.href, "https://deno.land/std/assert/mod.ts"); + * + * url.pathname = normalize("std/assert/../async/retry.ts"); + * assertEquals(url.href, "https://deno.land/std/async/retry.ts"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `normalize` from `@std/path/posix/unstable-normalize`. + * + * @param path The path to normalize. + * @returns The normalized path. + */ function normalize(path) { + assertArg(path); + const isAbsolute = isPosixPathSeparator(path.charCodeAt(0)); + const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1)); + // Normalize the path + path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator); + if (path.length === 0 && !isAbsolute) path = "."; + if (path.length > 0 && trailingSeparator) path += "/"; + if (isAbsolute) return `/${path}`; + return path; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Join all given a sequence of `paths`,then normalizes the resulting path. + * + * @example Usage + * ```ts + * import { join } from "@std/path/posix/join"; + * import { assertEquals } from "@std/assert"; + * + * const path = join("/foo", "bar", "baz/asdf", "quux", ".."); + * assertEquals(path, "/foo/bar/baz/asdf"); + * ``` + * + * @example Working with URLs + * ```ts + * import { join } from "@std/path/posix/join"; + * import { assertEquals } from "@std/assert"; + * + * const url = new URL("https://deno.land"); + * url.pathname = join("std", "path", "mod.ts"); + * assertEquals(url.href, "https://deno.land/std/path/mod.ts"); + * + * url.pathname = join("//std", "path/", "/mod.ts"); + * assertEquals(url.href, "https://deno.land/std/path/mod.ts"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `join` from `@std/path/posix/unstable-join`. + * + * @param paths The paths to join. + * @returns The joined path. + */ function join(...paths) { + if (paths.length === 0) return "."; + paths.forEach((path)=>assertPath(path)); + const joined = paths.filter((path)=>path.length > 0).join("/"); + return joined === "" ? "." : normalize(joined); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return a `ParsedPath` object of the `path`. + * + * @example Usage + * ```ts + * import { parse } from "@std/path/posix/parse"; + * import { assertEquals } from "@std/assert"; + * + * const path = parse("/home/user/file.txt"); + * assertEquals(path, { + * root: "/", + * dir: "/home/user", + * base: "file.txt", + * ext: ".txt", + * name: "file" + * }); + * ``` + * + * @param path The path to parse. + * @returns The parsed path object. + */ function parse(path) { + assertPath(path); + const ret = { + root: "", + dir: "", + base: "", + ext: "", + name: "" + }; + if (path.length === 0) return ret; + const isAbsolute = isPosixPathSeparator(path.charCodeAt(0)); + let start; + if (isAbsolute) { + ret.root = "/"; + start = 1; + } else { + start = 0; + } + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + let i = path.length - 1; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + let preDotState = 0; + // Get non-dir info + for(; i >= start; --i){ + const code = path.charCodeAt(i); + if (isPosixPathSeparator(code)) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + if (end !== -1) { + if (startPart === 0 && isAbsolute) { + ret.base = ret.name = path.slice(1, end); + } else { + ret.base = ret.name = path.slice(startPart, end); + } + } + // Fallback to '/' in case there is no basename + ret.base = ret.base || "/"; + } else { + if (startPart === 0 && isAbsolute) { + ret.name = path.slice(1, startDot); + ret.base = path.slice(1, end); + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + } + ret.ext = path.slice(startDot, end); + } + if (startPart > 0) { + ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator); + } else if (isAbsolute) ret.dir = "/"; + return ret; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Resolves path segments into a `path`. + * + * @example Usage + * ```ts + * import { resolve } from "@std/path/posix/resolve"; + * import { assertEquals } from "@std/assert"; + * + * const path = resolve("/foo", "bar", "baz/asdf", "quux", ".."); + * assertEquals(path, "/foo/bar/baz/asdf"); + * ``` + * + * @param pathSegments The path segments to resolve. + * @returns The resolved path. + */ function resolve(...pathSegments) { + let resolvedPath = ""; + let resolvedAbsolute = false; + for(let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--){ + let path; + if (i >= 0) path = pathSegments[i]; + else { + // deno-lint-ignore no-explicit-any + const { Deno } = globalThis; + if (typeof Deno?.cwd !== "function") { + throw new TypeError("Resolved a relative path without a current working directory (CWD)"); + } + path = Deno.cwd(); + } + assertPath(path); + // Skip empty entries + if (path.length === 0) { + continue; + } + resolvedPath = `${path}/${resolvedPath}`; + resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0)); + } + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when Deno.cwd() fails) + // Normalize the path + resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator); + if (resolvedAbsolute) { + if (resolvedPath.length > 0) return `/${resolvedPath}`; + else return "/"; + } else if (resolvedPath.length > 0) return resolvedPath; + else return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArgs(from, to) { + assertPath(from); + assertPath(to); + if (from === to) return ""; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the relative path from `from` to `to` based on current working directory. + * + * If `from` and `to` are the same, return an empty string. + * + * @example Usage + * ```ts + * import { relative } from "@std/path/posix/relative"; + * import { assertEquals } from "@std/assert"; + * + * const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb"); + * assertEquals(path, "../../impl/bbb"); + * ``` + * + * @param from The path to start from. + * @param to The path to reach. + * @returns The relative path. + */ function relative(from, to) { + assertArgs(from, to); + from = resolve(from); + to = resolve(to); + if (from === to) return ""; + // Trim any leading backslashes + let fromStart = 1; + const fromEnd = from.length; + for(; fromStart < fromEnd; ++fromStart){ + if (!isPosixPathSeparator(from.charCodeAt(fromStart))) break; + } + const fromLen = fromEnd - fromStart; + // Trim any leading backslashes + let toStart = 1; + const toEnd = to.length; + for(; toStart < toEnd; ++toStart){ + if (!isPosixPathSeparator(to.charCodeAt(toStart))) break; + } + const toLen = toEnd - toStart; + // Compare paths to find the longest common path from root + const length = fromLen < toLen ? fromLen : toLen; + let lastCommonSep = -1; + let i = 0; + for(; i <= length; ++i){ + if (i === length) { + if (toLen > length) { + if (isPosixPathSeparator(to.charCodeAt(toStart + i))) { + // We get here if `from` is the exact base path for `to`. + // For example: from='/foo/bar'; to='/foo/bar/baz' + return to.slice(toStart + i + 1); + } else if (i === 0) { + // We get here if `from` is the root + // For example: from='/'; to='/foo' + return to.slice(toStart + i); + } + } else if (fromLen > length) { + if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) { + // We get here if `to` is the exact base path for `from`. + // For example: from='/foo/bar/baz'; to='/foo/bar' + lastCommonSep = i; + } else if (i === 0) { + // We get here if `to` is the root. + // For example: from='/foo'; to='/' + lastCommonSep = 0; + } + } + break; + } + const fromCode = from.charCodeAt(fromStart + i); + const toCode = to.charCodeAt(toStart + i); + if (fromCode !== toCode) break; + else if (isPosixPathSeparator(fromCode)) lastCommonSep = i; + } + let out = ""; + // Generate the relative path based on the path difference between `to` + // and `from` + for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){ + if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) { + if (out.length === 0) out += ".."; + else out += "/.."; + } + } + // Lastly, append the rest of the destination (`to`) path that comes after + // the common path parts + if (out.length > 0) return out + to.slice(toStart + lastCommonSep); + else { + toStart += lastCommonSep; + if (isPosixPathSeparator(to.charCodeAt(toStart))) ++toStart; + return to.slice(toStart); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +const WHITESPACE_ENCODINGS = { + "\u0009": "%09", + "\u000A": "%0A", + "\u000B": "%0B", + "\u000C": "%0C", + "\u000D": "%0D", + "\u0020": "%20" +}; +function encodeWhitespace(string) { + return string.replaceAll(/[\s]/g, (c)=>{ + return WHITESPACE_ENCODINGS[c] ?? c; + }); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a path string to a file URL. + * + * @example Usage + * ```ts + * import { toFileUrl } from "@std/path/posix/to-file-url"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo")); + * assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar")); + * ``` + * + * @param path The path to convert. + * @returns The file URL. + */ function toFileUrl(path) { + if (!isAbsolute(path)) { + throw new TypeError(`Path must be absolute: received "${path}"`); + } + const url = new URL("file:///"); + url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C")); + return url; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a path to a namespaced path. This function returns the path as is on posix. + * + * @example Usage + * ```ts + * import { toNamespacedPath } from "@std/path/posix/to-namespaced-path"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(toNamespacedPath("/home/foo"), "/home/foo"); + * ``` + * + * @param path The path. + * @returns The namespaced path. + */ function toNamespacedPath(path) { + // Non-op on posix systems + return path; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function common$1(paths, sep) { + const [first = "", ...remaining] = paths; + const parts = first.split(sep); + let endOfPrefix = parts.length; + let append = ""; + for (const path of remaining){ + const compare = path.split(sep); + if (compare.length <= endOfPrefix) { + endOfPrefix = compare.length; + append = ""; + } + for(let i = 0; i < endOfPrefix; i++){ + if (compare[i] !== parts[i]) { + endOfPrefix = i; + append = i === 0 ? "" : sep; + break; + } + } + } + return parts.slice(0, endOfPrefix).join(sep) + append; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** Determines the common path from a set of paths for POSIX systems. + * + * @example Usage + * ```ts + * import { common } from "@std/path/posix/common"; + * import { assertEquals } from "@std/assert"; + * + * const path = common([ + * "./deno/std/path/mod.ts", + * "./deno/std/fs/mod.ts", + * ]); + * assertEquals(path, "./deno/std/"); + * ``` + * + * @param paths The paths to compare. + * @returns The common path. + */ function common(paths) { + return common$1(paths, SEPARATOR); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs}, + * {@linkcode normalizeGlob} and {@linkcode expandGlob}. + */ const REG_EXP_ESCAPE_CHARS = [ + "!", + "$", + "(", + ")", + "*", + "+", + ".", + "=", + "?", + "[", + "\\", + "^", + "{", + "|" +]; +const RANGE_ESCAPE_CHARS = [ + "-", + "\\", + "]" +]; +function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType, +caseInsensitive = false } = {}) { + if (glob === "") { + return /(?!)/; + } + // Remove trailing separators. + let newLength = glob.length; + for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--); + glob = glob.slice(0, newLength); + let regExpString = ""; + // Terminates correctly. Trust that `j` is incremented every iteration. + for(let j = 0; j < glob.length;){ + let segment = ""; + const groupStack = []; + let inRange = false; + let inEscape = false; + let endsWithSep = false; + let i = j; + // Terminates with `i` at the non-inclusive end of the current segment. + for(; i < glob.length && !c.seps.includes(glob[i]); i++){ + if (inEscape) { + inEscape = false; + const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS; + segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i]; + continue; + } + if (glob[i] === c.escapePrefix) { + inEscape = true; + continue; + } + if (glob[i] === "[") { + if (!inRange) { + inRange = true; + segment += "["; + if (glob[i + 1] === "!") { + i++; + segment += "^"; + } else if (glob[i + 1] === "^") { + i++; + segment += "\\^"; + } + continue; + } else if (glob[i + 1] === ":") { + let k = i + 1; + let value = ""; + while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){ + value += glob[k + 1]; + k++; + } + if (glob[k + 1] === ":" && glob[k + 2] === "]") { + i = k + 2; + if (value === "alnum") segment += "\\dA-Za-z"; + else if (value === "alpha") segment += "A-Za-z"; + else if (value === "ascii") segment += "\x00-\x7F"; + else if (value === "blank") segment += "\t "; + else if (value === "cntrl") segment += "\x00-\x1F\x7F"; + else if (value === "digit") segment += "\\d"; + else if (value === "graph") segment += "\x21-\x7E"; + else if (value === "lower") segment += "a-z"; + else if (value === "print") segment += "\x20-\x7E"; + else if (value === "punct") { + segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~"; + } else if (value === "space") segment += "\\s\v"; + else if (value === "upper") segment += "A-Z"; + else if (value === "word") segment += "\\w"; + else if (value === "xdigit") segment += "\\dA-Fa-f"; + continue; + } + } + } + if (glob[i] === "]" && inRange) { + inRange = false; + segment += "]"; + continue; + } + if (inRange) { + segment += glob[i]; + continue; + } + if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") { + segment += ")"; + const type = groupStack.pop(); + if (type === "!") { + segment += c.wildcard; + } else if (type !== "@") { + segment += type; + } + continue; + } + if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") { + segment += "|"; + continue; + } + if (glob[i] === "+" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("+"); + segment += "(?:"; + continue; + } + if (glob[i] === "@" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("@"); + segment += "(?:"; + continue; + } + if (glob[i] === "?") { + if (extended && glob[i + 1] === "(") { + i++; + groupStack.push("?"); + segment += "(?:"; + } else { + segment += "."; + } + continue; + } + if (glob[i] === "!" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("!"); + segment += "(?!"; + continue; + } + if (glob[i] === "{") { + groupStack.push("BRACE"); + segment += "(?:"; + continue; + } + if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") { + groupStack.pop(); + segment += ")"; + continue; + } + if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") { + segment += "|"; + continue; + } + if (glob[i] === "*") { + if (extended && glob[i + 1] === "(") { + i++; + groupStack.push("*"); + segment += "(?:"; + } else { + const prevChar = glob[i - 1]; + let numStars = 1; + while(glob[i + 1] === "*"){ + i++; + numStars++; + } + const nextChar = glob[i + 1]; + if (globstarOption && numStars === 2 && [ + ...c.seps, + undefined + ].includes(prevChar) && [ + ...c.seps, + undefined + ].includes(nextChar)) { + segment += c.globstar; + endsWithSep = true; + } else { + segment += c.wildcard; + } + } + continue; + } + segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i]; + } + // Check for unclosed groups or a dangling backslash. + if (groupStack.length > 0 || inRange || inEscape) { + // Parse failure. Take all characters from this segment literally. + segment = ""; + for (const c of glob.slice(j, i)){ + segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c; + endsWithSep = false; + } + } + regExpString += segment; + if (!endsWithSep) { + regExpString += i < glob.length ? c.sep : c.sepMaybe; + endsWithSep = true; + } + // Terminates with `i` at the start of the next segment. + while(c.seps.includes(glob[i]))i++; + j = i; + } + regExpString = `^${regExpString}$`; + return new RegExp(regExpString, caseInsensitive ? "i" : ""); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +const constants = { + sep: "/+", + sepMaybe: "/*", + seps: [ + "/" + ], + globstar: "(?:[^/]*(?:/|$)+)*", + wildcard: "[^/]*", + escapePrefix: "\\" +}; +/** Convert a glob string to a regular expression. + * + * Tries to match bash glob expansion as closely as possible. + * + * Basic glob syntax: + * - `*` - Matches everything without leaving the path segment. + * - `?` - Matches any single character. + * - `{foo,bar}` - Matches `foo` or `bar`. + * - `[abcd]` - Matches `a`, `b`, `c` or `d`. + * - `[a-d]` - Matches `a`, `b`, `c` or `d`. + * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`. + * - `[[::]]` - Matches any character belonging to ``. + * - `[[:alnum:]]` - Matches any digit or letter. + * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`. + * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes + * for a complete list of supported character classes. + * - `\` - Escapes the next character for an `os` other than `"windows"`. + * - \` - Escapes the next character for `os` set to `"windows"`. + * - `/` - Path separator. + * - `\` - Additional path separator only for `os` set to `"windows"`. + * + * Extended syntax: + * - Requires `{ extended: true }`. + * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`. + * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same. + * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`. + * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`. + * - `!(foo|bar)` - Matches anything other than `{foo,bar}`. + * - See https://www.linuxjournal.com/content/bash-extended-globbing. + * + * Globstar syntax: + * - Requires `{ globstar: true }`. + * - `**` - Matches any number of any path segments. + * - Must comprise its entire path segment in the provided glob. + * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option. + * + * Note the following properties: + * - The generated `RegExp` is anchored at both start and end. + * - Repeating and trailing separators are tolerated. Trailing separators in the + * provided glob have no meaning and are discarded. + * - Absolute globs will only match absolute paths, etc. + * - Empty globs will match nothing. + * - Any special glob syntax must be contained to one path segment. For example, + * `?(foo|bar/baz)` is invalid. The separator will take precedence and the + * first segment ends with an unclosed group. + * - If a path segment ends with unclosed groups or a dangling escape prefix, a + * parse error has occurred. Every character for that segment is taken + * literally in this event. + * + * Limitations: + * - A negative group like `!(foo|bar)` will wrongly be converted to a negative + * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly + * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively, + * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if + * the group occurs not nested at the end of the segment. + * + * @example Usage + * ```ts + * import { globToRegExp } from "@std/path/posix/glob-to-regexp"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(globToRegExp("*.js"), /^[^/]*\.js\/*$/); + * ``` + * + * @param glob Glob string to convert. + * @param options Conversion options. + * @returns The regular expression equivalent to the glob. + */ function globToRegExp(glob, options = {}) { + return _globToRegExp(constants, glob, options); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Test whether the given string is a glob. + * + * @example Usage + * ```ts + * import { isGlob } from "@std/path/is-glob"; + * import { assert } from "@std/assert"; + * + * assert(!isGlob("foo/bar/../baz")); + * assert(isGlob("foo/*ar/../baz")); + * ``` + * + * @param str String to test. + * @returns `true` if the given string is a glob, otherwise `false` + */ function isGlob(str) { + const chars = { + "{": "}", + "(": ")", + "[": "]" + }; + const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; + if (str === "") { + return false; + } + let match; + while(match = regex.exec(str)){ + if (match[2]) return true; + let idx = match.index + match[0].length; + // if an open bracket/brace/paren is escaped, + // set the index to the next closing character + const open = match[1]; + const close = open ? chars[open] : null; + if (open && close) { + const n = str.indexOf(close, idx); + if (n !== -1) { + idx = n + 1; + } + } + str = str.slice(idx); + } + return false; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. + * + * @example Usage + * ```ts + * import { normalizeGlob } from "@std/path/posix/normalize-glob"; + * import { assertEquals } from "@std/assert"; + * + * const path = normalizeGlob("foo/bar/../*", { globstar: true }); + * assertEquals(path, "foo/*"); + * ``` + * + * @param glob The glob to normalize. + * @param options The options to use. + * @returns The normalized path. + */ function normalizeGlob(glob, options = {}) { + const { globstar = false } = options; + if (glob.match(/\0/g)) { + throw new Error(`Glob contains invalid characters: "${glob}"`); + } + if (!globstar) { + return normalize(glob); + } + const s = SEPARATOR_PATTERN.source; + const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g"); + return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, ".."); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Like join(), but doesn't collapse "**\/.." when `globstar` is true. + * + * @example Usage + * ```ts + * import { joinGlobs } from "@std/path/posix/join-globs"; + * import { assertEquals } from "@std/assert"; + * + * const path = joinGlobs(["foo", "bar", "**"], { globstar: true }); + * assertEquals(path, "foo/bar/**"); + * ``` + * + * @param globs The globs to join. + * @param options The options to use. + * @returns The joined path. + */ function joinGlobs(globs, options = {}) { + const { globstar = false } = options; + if (!globstar || globs.length === 0) { + return join(...globs); + } + let joined; + for (const glob of globs){ + const path = glob; + if (path.length > 0) { + if (!joined) joined = path; + else joined += `${SEPARATOR}${path}`; + } + } + if (!joined) return "."; + return normalizeGlob(joined, { + globstar + }); +} + +export { DELIMITER, SEPARATOR, SEPARATOR_PATTERN, basename, common, dirname, extname, format, fromFileUrl, globToRegExp, isAbsolute, isGlob, join, joinGlobs, normalize, normalizeGlob, parse, relative, resolve, toFileUrl, toNamespacedPath }; diff --git a/node_modules/@eslint/config-array/dist/esm/std__path/windows.js b/node_modules/@eslint/config-array/dist/esm/std__path/windows.js new file mode 100644 index 0000000..44ed129 --- /dev/null +++ b/node_modules/@eslint/config-array/dist/esm/std__path/windows.js @@ -0,0 +1,1648 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +function assertPath(path) { + if (typeof path !== "string") { + throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function stripSuffix(name, suffix) { + if (suffix.length >= name.length) { + return name; + } + const lenDiff = name.length - suffix.length; + for(let i = suffix.length - 1; i >= 0; --i){ + if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) { + return name; + } + } + return name.slice(0, -suffix.length); +} +function lastPathSegment(path, isSep, start = 0) { + let matchedNonSeparator = false; + let end = path.length; + for(let i = path.length - 1; i >= start; --i){ + if (isSep(path.charCodeAt(i))) { + if (matchedNonSeparator) { + start = i + 1; + break; + } + } else if (!matchedNonSeparator) { + matchedNonSeparator = true; + end = i + 1; + } + } + return path.slice(start, end); +} +function assertArgs$1(path, suffix) { + assertPath(path); + if (path.length === 0) return path; + if (typeof suffix !== "string") { + throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +// Alphabet chars. +const CHAR_UPPERCASE_A = 65; /* A */ +const CHAR_LOWERCASE_A = 97; /* a */ +const CHAR_UPPERCASE_Z = 90; /* Z */ +const CHAR_LOWERCASE_Z = 122; /* z */ +// Non-alphabetic chars. +const CHAR_DOT = 46; /* . */ +const CHAR_FORWARD_SLASH = 47; /* / */ +const CHAR_BACKWARD_SLASH = 92; /* \ */ +const CHAR_COLON = 58; /* : */ +const CHAR_QUESTION_MARK = 63; /* ? */ + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +function stripTrailingSeparators(segment, isSep) { + if (segment.length <= 1) { + return segment; + } + let end = segment.length; + for(let i = segment.length - 1; i > 0; i--){ + if (isSep(segment.charCodeAt(i))) { + end = i; + } else { + break; + } + } + return segment.slice(0, end); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +function isPosixPathSeparator(code) { + return code === CHAR_FORWARD_SLASH; +} +function isPathSeparator(code) { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +} +function isWindowsDeviceRoot(code) { + return code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z || code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the last portion of a `path`. + * Trailing directory separators are ignored, and optional suffix is removed. + * + * @example Usage + * ```ts + * import { basename } from "@std/path/windows/basename"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(basename("C:\\user\\Documents\\"), "Documents"); + * assertEquals(basename("C:\\user\\Documents\\image.png"), "image.png"); + * assertEquals(basename("C:\\user\\Documents\\image.png", ".png"), "image"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `basename` from `@std/path/windows/unstable-basename`. + * + * @param path The path to extract the name from. + * @param suffix The suffix to remove from extracted name. + * @returns The extracted name. + */ function basename(path, suffix = "") { + assertArgs$1(path, suffix); + // Check for a drive letter prefix so as not to mistake the following + // path separator as an extra separator at the end of the path that can be + // disregarded + let start = 0; + if (path.length >= 2) { + const drive = path.charCodeAt(0); + if (isWindowsDeviceRoot(drive)) { + if (path.charCodeAt(1) === CHAR_COLON) start = 2; + } + } + const lastSegment = lastPathSegment(path, isPathSeparator, start); + const strippedSegment = stripTrailingSeparators(lastSegment, isPathSeparator); + return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * The character used to separate entries in the PATH environment variable. + */ const DELIMITER = ";"; +/** + * The character used to separate components of a file path. + */ const SEPARATOR = "\\"; +/** + * A regular expression that matches one or more path separators. + */ const SEPARATOR_PATTERN = /[\\/]+/; + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg$3(path) { + assertPath(path); + if (path.length === 0) return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the directory path of a `path`. + * + * @example Usage + * ```ts + * import { dirname } from "@std/path/windows/dirname"; + * import { assertEquals } from "@std/assert"; + * + * const dir = dirname("C:\\foo\\bar\\baz.ext"); + * assertEquals(dir, "C:\\foo\\bar"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `dirname` from `@std/path/windows/unstable-dirname`. + * + * @param path The path to get the directory from. + * @returns The directory path. + */ function dirname(path) { + assertArg$3(path); + const len = path.length; + let rootEnd = -1; + let end = -1; + let matchedSlash = true; + let offset = 0; + const code = path.charCodeAt(0); + // Try to match a root + if (len > 1) { + if (isPathSeparator(code)) { + // Possible UNC root + rootEnd = offset = 1; + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more path separators + for(; j < len; ++j){ + if (!isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j === len) { + // We matched a UNC root only + return path; + } + if (j !== last) { + // We matched a UNC root with leftovers + // Offset by 1 to include the separator after the UNC root to + // treat it as a "normal root" on top of a (UNC) root + rootEnd = offset = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (path.charCodeAt(1) === CHAR_COLON) { + rootEnd = offset = 2; + if (len > 2) { + if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3; + } + } + } + } else if (isPathSeparator(code)) { + // `path` contains just a path separator, exit early to avoid + // unnecessary work + return path; + } + for(let i = len - 1; i >= offset; --i){ + if (isPathSeparator(path.charCodeAt(i))) { + if (!matchedSlash) { + end = i; + break; + } + } else { + // We saw the first non-path separator + matchedSlash = false; + } + } + if (end === -1) { + if (rootEnd === -1) return "."; + else end = rootEnd; + } + return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the extension of the `path` with leading period. + * + * @example Usage + * ```ts + * import { extname } from "@std/path/windows/extname"; + * import { assertEquals } from "@std/assert"; + * + * const ext = extname("file.ts"); + * assertEquals(ext, ".ts"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `extname` from `@std/path/windows/unstable-extname`. + * + * @param path The path to get the extension from. + * @returns The extension of the `path`. + */ function extname(path) { + assertPath(path); + let start = 0; + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + let preDotState = 0; + // Check for a drive letter prefix so as not to mistake the following + // path separator as an extra separator at the end of the path that can be + // disregarded + if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) { + start = startPart = 2; + } + for(let i = path.length - 1; i >= start; --i){ + const code = path.charCodeAt(i); + if (isPathSeparator(code)) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path.slice(startDot, end); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function _format(sep, pathObject) { + const dir = pathObject.dir || pathObject.root; + const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? ""); + if (!dir) return base; + if (base === sep) return dir; + if (dir === pathObject.root) return dir + base; + return dir + sep + base; +} +function assertArg$2(pathObject) { + if (pathObject === null || typeof pathObject !== "object") { + throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Generate a path from `ParsedPath` object. + * + * @example Usage + * ```ts + * import { format } from "@std/path/windows/format"; + * import { assertEquals } from "@std/assert"; + * + * const path = format({ + * root: "C:\\", + * dir: "C:\\path\\dir", + * base: "file.txt", + * ext: ".txt", + * name: "file" + * }); + * assertEquals(path, "C:\\path\\dir\\file.txt"); + * ``` + * + * @param pathObject The path object to format. + * @returns The formatted path. + */ function format(pathObject) { + assertArg$2(pathObject); + return _format("\\", pathObject); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg$1(url) { + url = url instanceof URL ? url : new URL(url); + if (url.protocol !== "file:") { + throw new TypeError(`URL must be a file URL: received "${url.protocol}"`); + } + return url; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a file URL to a path string. + * + * @example Usage + * ```ts + * import { fromFileUrl } from "@std/path/windows/from-file-url"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo"); + * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo"); + * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo"); + * ``` + * + * @param url The file URL to convert. + * @returns The path string. + */ function fromFileUrl(url) { + url = assertArg$1(url); + let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\"); + if (url.hostname !== "") { + // Note: The `URL` implementation guarantees that the drive letter and + // hostname are mutually exclusive. Otherwise it would not have been valid + // to append the hostname and path like this. + path = `\\\\${url.hostname}${path}`; + } + return path; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Verifies whether provided path is absolute. + * + * @example Usage + * ```ts + * import { isAbsolute } from "@std/path/windows/is-absolute"; + * import { assert, assertFalse } from "@std/assert"; + * + * assert(isAbsolute("C:\\foo\\bar")); + * assertFalse(isAbsolute("..\\baz")); + * ``` + * + * @param path The path to verify. + * @returns `true` if the path is absolute, `false` otherwise. + */ function isAbsolute(path) { + assertPath(path); + const len = path.length; + if (len === 0) return false; + const code = path.charCodeAt(0); + if (isPathSeparator(code)) { + return true; + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (len > 2 && path.charCodeAt(1) === CHAR_COLON) { + if (isPathSeparator(path.charCodeAt(2))) return true; + } + } + return false; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArg(path) { + assertPath(path); + if (path.length === 0) return "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright the Browserify authors. MIT License. +// Ported from https://github.com/browserify/path-browserify/ +// This module is browser compatible. +// Resolves . and .. elements in a path with directory names +function normalizeString(path, allowAboveRoot, separator, isPathSeparator) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let code; + for(let i = 0; i <= path.length; ++i){ + if (i < path.length) code = path.charCodeAt(i); + else if (isPathSeparator(code)) break; + else code = CHAR_FORWARD_SLASH; + if (isPathSeparator(code)) { + if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf(separator); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); + } + lastSlash = i; + dots = 0; + continue; + } else if (res.length === 2 || res.length === 1) { + res = ""; + lastSegmentLength = 0; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) res += `${separator}..`; + else res = ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) res += separator + path.slice(lastSlash + 1, i); + else res = path.slice(lastSlash + 1, i); + lastSegmentLength = i - lastSlash - 1; + } + lastSlash = i; + dots = 0; + } else if (code === CHAR_DOT && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Normalize the `path`, resolving `'..'` and `'.'` segments. + * Note that resolving these segments does not necessarily mean that all will be eliminated. + * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`. + * + * @example Usage + * ```ts + * import { normalize } from "@std/path/windows/normalize"; + * import { assertEquals } from "@std/assert"; + * + * const normalized = normalize("C:\\foo\\..\\bar"); + * assertEquals(normalized, "C:\\bar"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `normalize` from `@std/path/windows/unstable-normalize`. + * + * @param path The path to normalize + * @returns The normalized path + */ function normalize(path) { + assertArg(path); + const len = path.length; + let rootEnd = 0; + let device; + let isAbsolute = false; + const code = path.charCodeAt(0); + // Try to match a root + if (len > 1) { + if (isPathSeparator(code)) { + // Possible UNC root + // If we started with a separator, we know we at least have an absolute + // path of some kind (UNC or otherwise) + isAbsolute = true; + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + // Matched! + last = j; + // Match 1 or more path separators + for(; j < len; ++j){ + if (!isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j === len) { + // We matched a UNC root only + // Return the normalized version of the UNC root since there + // is nothing left to process + return `\\\\${firstPart}\\${path.slice(last)}\\`; + } else if (j !== last) { + // We matched a UNC root with leftovers + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (path.charCodeAt(1) === CHAR_COLON) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2) { + if (isPathSeparator(path.charCodeAt(2))) { + // Treat separator following drive name as an absolute path + // indicator + isAbsolute = true; + rootEnd = 3; + } + } + } + } + } else if (isPathSeparator(code)) { + // `path` contains just a path separator, exit early to avoid unnecessary + // work + return "\\"; + } + let tail; + if (rootEnd < len) { + tail = normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator); + } else { + tail = ""; + } + if (tail.length === 0 && !isAbsolute) tail = "."; + if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { + tail += "\\"; + } + if (device === undefined) { + if (isAbsolute) { + if (tail.length > 0) return `\\${tail}`; + else return "\\"; + } + return tail; + } else if (isAbsolute) { + if (tail.length > 0) return `${device}\\${tail}`; + else return `${device}\\`; + } + return device + tail; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Join all given a sequence of `paths`,then normalizes the resulting path. + * + * @example Usage + * ```ts + * import { join } from "@std/path/windows/join"; + * import { assertEquals } from "@std/assert"; + * + * const joined = join("C:\\foo", "bar", "baz\\.."); + * assertEquals(joined, "C:\\foo\\bar"); + * ``` + * + * Note: If you are working with file URLs, + * use the new version of `join` from `@std/path/windows/unstable-join`. + * + * @param paths The paths to join. + * @returns The joined path. + */ function join(...paths) { + paths.forEach((path)=>assertPath(path)); + paths = paths.filter((path)=>path.length > 0); + if (paths.length === 0) return "."; + // Make sure that the joined path doesn't start with two slashes, because + // normalize() will mistake it for an UNC path then. + // + // This step is skipped when it is very clear that the user actually + // intended to point at an UNC path. This is assumed when the first + // non-empty string arguments starts with exactly two slashes followed by + // at least one more non-slash character. + // + // Note that for normalize() to treat a path as an UNC path it needs to + // have at least 2 components, so we don't filter for that here. + // This means that the user can use join to construct UNC paths from + // a server name and a share name; for example: + // path.join('//server', 'share') -> '\\\\server\\share\\' + let needsReplace = true; + let slashCount = 0; + const firstPart = paths[0]; + if (isPathSeparator(firstPart.charCodeAt(0))) { + ++slashCount; + const firstLen = firstPart.length; + if (firstLen > 1) { + if (isPathSeparator(firstPart.charCodeAt(1))) { + ++slashCount; + if (firstLen > 2) { + if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount; + else { + // We matched a UNC path in the first part + needsReplace = false; + } + } + } + } + } + let joined = paths.join("\\"); + if (needsReplace) { + // Find any more consecutive slashes we need to replace + for(; slashCount < joined.length; ++slashCount){ + if (!isPathSeparator(joined.charCodeAt(slashCount))) break; + } + // Replace the slashes if needed + if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`; + } + return normalize(joined); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return a `ParsedPath` object of the `path`. + * + * @example Usage + * ```ts + * import { parse } from "@std/path/windows/parse"; + * import { assertEquals } from "@std/assert"; + * + * const parsed = parse("C:\\foo\\bar\\baz.ext"); + * assertEquals(parsed, { + * root: "C:\\", + * dir: "C:\\foo\\bar", + * base: "baz.ext", + * ext: ".ext", + * name: "baz", + * }); + * ``` + * + * @param path The path to parse. + * @returns The `ParsedPath` object. + */ function parse(path) { + assertPath(path); + const ret = { + root: "", + dir: "", + base: "", + ext: "", + name: "" + }; + const len = path.length; + if (len === 0) return ret; + let rootEnd = 0; + let code = path.charCodeAt(0); + // Try to match a root + if (len > 1) { + if (isPathSeparator(code)) { + // Possible UNC root + rootEnd = 1; + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more path separators + for(; j < len; ++j){ + if (!isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j === len) { + // We matched a UNC root only + rootEnd = j; + } else if (j !== last) { + // We matched a UNC root with leftovers + rootEnd = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (path.charCodeAt(1) === CHAR_COLON) { + rootEnd = 2; + if (len > 2) { + if (isPathSeparator(path.charCodeAt(2))) { + if (len === 3) { + // `path` contains just a drive root, exit early to avoid + // unnecessary work + ret.root = ret.dir = path; + ret.base = "\\"; + return ret; + } + rootEnd = 3; + } + } else { + // `path` contains just a relative drive root, exit early to avoid + // unnecessary work + ret.root = ret.dir = path; + return ret; + } + } + } + } else if (isPathSeparator(code)) { + // `path` contains just a path separator, exit early to avoid + // unnecessary work + ret.root = ret.dir = path; + ret.base = "\\"; + return ret; + } + if (rootEnd > 0) ret.root = path.slice(0, rootEnd); + let startDot = -1; + let startPart = rootEnd; + let end = -1; + let matchedSlash = true; + let i = path.length - 1; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + let preDotState = 0; + // Get non-dir info + for(; i >= rootEnd; --i){ + code = path.charCodeAt(i); + if (isPathSeparator(code)) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + if (end !== -1) { + ret.base = ret.name = path.slice(startPart, end); + } + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + ret.ext = path.slice(startDot, end); + } + // Fallback to '\' in case there is no basename + ret.base = ret.base || "\\"; + // If the directory is the root, use the entire root as the `dir` including + // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the + // trailing slash (`C:\abc\def` -> `C:\abc`). + if (startPart > 0 && startPart !== rootEnd) { + ret.dir = path.slice(0, startPart - 1); + } else ret.dir = ret.root; + return ret; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Resolves path segments into a `path`. + * + * @example Usage + * ```ts + * import { resolve } from "@std/path/windows/resolve"; + * import { assertEquals } from "@std/assert"; + * + * const resolved = resolve("C:\\foo\\bar", "..\\baz"); + * assertEquals(resolved, "C:\\foo\\baz"); + * ``` + * + * @param pathSegments The path segments to process to path + * @returns The resolved path + */ function resolve(...pathSegments) { + let resolvedDevice = ""; + let resolvedTail = ""; + let resolvedAbsolute = false; + for(let i = pathSegments.length - 1; i >= -1; i--){ + let path; + // deno-lint-ignore no-explicit-any + const { Deno } = globalThis; + if (i >= 0) { + path = pathSegments[i]; + } else if (!resolvedDevice) { + if (typeof Deno?.cwd !== "function") { + throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)"); + } + path = Deno.cwd(); + } else { + if (typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function") { + throw new TypeError("Resolved a relative path without a current working directory (CWD)"); + } + path = Deno.cwd(); + // Verify that a cwd was found and that it actually points + // to our drive. If not, default to the drive's root. + if (path === undefined || path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`) { + path = `${resolvedDevice}\\`; + } + } + assertPath(path); + const len = path.length; + // Skip empty entries + if (len === 0) continue; + let rootEnd = 0; + let device = ""; + let isAbsolute = false; + const code = path.charCodeAt(0); + // Try to match a root + if (len > 1) { + if (isPathSeparator(code)) { + // Possible UNC root + // If we started with a separator, we know we at least have an + // absolute path of some kind (UNC or otherwise) + isAbsolute = true; + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + // Matched! + last = j; + // Match 1 or more path separators + for(; j < len; ++j){ + if (!isPathSeparator(path.charCodeAt(j))) break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for(; j < len; ++j){ + if (isPathSeparator(path.charCodeAt(j))) break; + } + if (j === len) { + // We matched a UNC root only + device = `\\\\${firstPart}\\${path.slice(last)}`; + rootEnd = j; + } else if (j !== last) { + // We matched a UNC root with leftovers + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code)) { + // Possible device root + if (path.charCodeAt(1) === CHAR_COLON) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2) { + if (isPathSeparator(path.charCodeAt(2))) { + // Treat separator following drive name as an absolute path + // indicator + isAbsolute = true; + rootEnd = 3; + } + } + } + } + } else if (isPathSeparator(code)) { + // `path` contains just a path separator + rootEnd = 1; + isAbsolute = true; + } + if (device.length > 0 && resolvedDevice.length > 0 && device.toLowerCase() !== resolvedDevice.toLowerCase()) { + continue; + } + if (resolvedDevice.length === 0 && device.length > 0) { + resolvedDevice = device; + } + if (!resolvedAbsolute) { + resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`; + resolvedAbsolute = isAbsolute; + } + if (resolvedAbsolute && resolvedDevice.length > 0) break; + } + // At this point the path should be resolved to a full absolute path, + // but handle relative paths to be safe (might happen when Deno.cwd() + // fails) + // Normalize the tail path + resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator); + return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || "."; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function assertArgs(from, to) { + assertPath(from); + assertPath(to); + if (from === to) return ""; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Return the relative path from `from` to `to` based on current working directory. + * + * An example in windws, for instance: + * from = 'C:\\orandea\\test\\aaa' + * to = 'C:\\orandea\\impl\\bbb' + * The output of the function should be: '..\\..\\impl\\bbb' + * + * @example Usage + * ```ts + * import { relative } from "@std/path/windows/relative"; + * import { assertEquals } from "@std/assert"; + * + * const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb"); + * assertEquals(relativePath, "..\\..\\impl\\bbb"); + * ``` + * + * @param from The path from which to calculate the relative path + * @param to The path to which to calculate the relative path + * @returns The relative path from `from` to `to` + */ function relative(from, to) { + assertArgs(from, to); + const fromOrig = resolve(from); + const toOrig = resolve(to); + if (fromOrig === toOrig) return ""; + from = fromOrig.toLowerCase(); + to = toOrig.toLowerCase(); + if (from === to) return ""; + // Trim any leading backslashes + let fromStart = 0; + let fromEnd = from.length; + for(; fromStart < fromEnd; ++fromStart){ + if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break; + } + // Trim trailing backslashes (applicable to UNC paths only) + for(; fromEnd - 1 > fromStart; --fromEnd){ + if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break; + } + const fromLen = fromEnd - fromStart; + // Trim any leading backslashes + let toStart = 0; + let toEnd = to.length; + for(; toStart < toEnd; ++toStart){ + if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break; + } + // Trim trailing backslashes (applicable to UNC paths only) + for(; toEnd - 1 > toStart; --toEnd){ + if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break; + } + const toLen = toEnd - toStart; + // Compare paths to find the longest common path from root + const length = fromLen < toLen ? fromLen : toLen; + let lastCommonSep = -1; + let i = 0; + for(; i <= length; ++i){ + if (i === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) { + // We get here if `from` is the exact base path for `to`. + // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz' + return toOrig.slice(toStart + i + 1); + } else if (i === 2) { + // We get here if `from` is the device root. + // For example: from='C:\\'; to='C:\\foo' + return toOrig.slice(toStart + i); + } + } + if (fromLen > length) { + if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) { + // We get here if `to` is the exact base path for `from`. + // For example: from='C:\\foo\\bar'; to='C:\\foo' + lastCommonSep = i; + } else if (i === 2) { + // We get here if `to` is the device root. + // For example: from='C:\\foo\\bar'; to='C:\\' + lastCommonSep = 3; + } + } + break; + } + const fromCode = from.charCodeAt(fromStart + i); + const toCode = to.charCodeAt(toStart + i); + if (fromCode !== toCode) break; + else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i; + } + // We found a mismatch before the first common path separator was seen, so + // return the original `to`. + if (i !== length && lastCommonSep === -1) { + return toOrig; + } + let out = ""; + if (lastCommonSep === -1) lastCommonSep = 0; + // Generate the relative path based on the path difference between `to` and + // `from` + for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){ + if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) { + if (out.length === 0) out += ".."; + else out += "\\.."; + } + } + // Lastly, append the rest of the destination (`to`) path that comes after + // the common path parts + if (out.length > 0) { + return out + toOrig.slice(toStart + lastCommonSep, toEnd); + } else { + toStart += lastCommonSep; + if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart; + return toOrig.slice(toStart, toEnd); + } +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +const WHITESPACE_ENCODINGS = { + "\u0009": "%09", + "\u000A": "%0A", + "\u000B": "%0B", + "\u000C": "%0C", + "\u000D": "%0D", + "\u0020": "%20" +}; +function encodeWhitespace(string) { + return string.replaceAll(/[\s]/g, (c)=>{ + return WHITESPACE_ENCODINGS[c] ?? c; + }); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Converts a path string to a file URL. + * + * @example Usage + * ```ts + * import { toFileUrl } from "@std/path/windows/to-file-url"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(toFileUrl("\\home\\foo"), new URL("file:///home/foo")); + * assertEquals(toFileUrl("C:\\Users\\foo"), new URL("file:///C:/Users/foo")); + * assertEquals(toFileUrl("\\\\127.0.0.1\\home\\foo"), new URL("file://127.0.0.1/home/foo")); + * ``` + * @param path The path to convert. + * @returns The file URL. + */ function toFileUrl(path) { + if (!isAbsolute(path)) { + throw new TypeError(`Path must be absolute: received "${path}"`); + } + const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/); + const url = new URL("file:///"); + url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25")); + if (hostname !== undefined && hostname !== "localhost") { + url.hostname = hostname; + if (!url.hostname) { + throw new TypeError(`Invalid hostname: "${url.hostname}"`); + } + } + return url; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Resolves path to a namespace path + * + * @example Usage + * ```ts + * import { toNamespacedPath } from "@std/path/windows/to-namespaced-path"; + * import { assertEquals } from "@std/assert"; + * + * const namespaced = toNamespacedPath("C:\\foo\\bar"); + * assertEquals(namespaced, "\\\\?\\C:\\foo\\bar"); + * ``` + * + * @param path The path to resolve to namespaced path + * @returns The resolved namespaced path + */ function toNamespacedPath(path) { + // Note: this will *probably* throw somewhere. + if (typeof path !== "string") return path; + if (path.length === 0) return ""; + const resolvedPath = resolve(path); + if (resolvedPath.length >= 3) { + if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) { + // Possible UNC root + if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) { + const code = resolvedPath.charCodeAt(2); + if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) { + // Matched non-long UNC root, convert the path to a long UNC path + return `\\\\?\\UNC\\${resolvedPath.slice(2)}`; + } + } + } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) { + // Possible device root + if (resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) { + // Matched device root, convert the path to a long UNC path + return `\\\\?\\${resolvedPath}`; + } + } + } + return path; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +function common$1(paths, sep) { + const [first = "", ...remaining] = paths; + const parts = first.split(sep); + let endOfPrefix = parts.length; + let append = ""; + for (const path of remaining){ + const compare = path.split(sep); + if (compare.length <= endOfPrefix) { + endOfPrefix = compare.length; + append = ""; + } + for(let i = 0; i < endOfPrefix; i++){ + if (compare[i] !== parts[i]) { + endOfPrefix = i; + append = i === 0 ? "" : sep; + break; + } + } + } + return parts.slice(0, endOfPrefix).join(sep) + append; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Determines the common path from a set of paths for Windows systems. + * + * @example Usage + * ```ts + * import { common } from "@std/path/windows/common"; + * import { assertEquals } from "@std/assert"; + * + * const path = common([ + * "C:\\foo\\bar", + * "C:\\foo\\baz", + * ]); + * assertEquals(path, "C:\\foo\\"); + * ``` + * + * @param paths The paths to compare. + * @returns The common path. + */ function common(paths) { + return common$1(paths, SEPARATOR); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs}, + * {@linkcode normalizeGlob} and {@linkcode expandGlob}. + */ const REG_EXP_ESCAPE_CHARS = [ + "!", + "$", + "(", + ")", + "*", + "+", + ".", + "=", + "?", + "[", + "\\", + "^", + "{", + "|" +]; +const RANGE_ESCAPE_CHARS = [ + "-", + "\\", + "]" +]; +function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType, +caseInsensitive = false } = {}) { + if (glob === "") { + return /(?!)/; + } + // Remove trailing separators. + let newLength = glob.length; + for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--); + glob = glob.slice(0, newLength); + let regExpString = ""; + // Terminates correctly. Trust that `j` is incremented every iteration. + for(let j = 0; j < glob.length;){ + let segment = ""; + const groupStack = []; + let inRange = false; + let inEscape = false; + let endsWithSep = false; + let i = j; + // Terminates with `i` at the non-inclusive end of the current segment. + for(; i < glob.length && !c.seps.includes(glob[i]); i++){ + if (inEscape) { + inEscape = false; + const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS; + segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i]; + continue; + } + if (glob[i] === c.escapePrefix) { + inEscape = true; + continue; + } + if (glob[i] === "[") { + if (!inRange) { + inRange = true; + segment += "["; + if (glob[i + 1] === "!") { + i++; + segment += "^"; + } else if (glob[i + 1] === "^") { + i++; + segment += "\\^"; + } + continue; + } else if (glob[i + 1] === ":") { + let k = i + 1; + let value = ""; + while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){ + value += glob[k + 1]; + k++; + } + if (glob[k + 1] === ":" && glob[k + 2] === "]") { + i = k + 2; + if (value === "alnum") segment += "\\dA-Za-z"; + else if (value === "alpha") segment += "A-Za-z"; + else if (value === "ascii") segment += "\x00-\x7F"; + else if (value === "blank") segment += "\t "; + else if (value === "cntrl") segment += "\x00-\x1F\x7F"; + else if (value === "digit") segment += "\\d"; + else if (value === "graph") segment += "\x21-\x7E"; + else if (value === "lower") segment += "a-z"; + else if (value === "print") segment += "\x20-\x7E"; + else if (value === "punct") { + segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~"; + } else if (value === "space") segment += "\\s\v"; + else if (value === "upper") segment += "A-Z"; + else if (value === "word") segment += "\\w"; + else if (value === "xdigit") segment += "\\dA-Fa-f"; + continue; + } + } + } + if (glob[i] === "]" && inRange) { + inRange = false; + segment += "]"; + continue; + } + if (inRange) { + segment += glob[i]; + continue; + } + if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") { + segment += ")"; + const type = groupStack.pop(); + if (type === "!") { + segment += c.wildcard; + } else if (type !== "@") { + segment += type; + } + continue; + } + if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") { + segment += "|"; + continue; + } + if (glob[i] === "+" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("+"); + segment += "(?:"; + continue; + } + if (glob[i] === "@" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("@"); + segment += "(?:"; + continue; + } + if (glob[i] === "?") { + if (extended && glob[i + 1] === "(") { + i++; + groupStack.push("?"); + segment += "(?:"; + } else { + segment += "."; + } + continue; + } + if (glob[i] === "!" && extended && glob[i + 1] === "(") { + i++; + groupStack.push("!"); + segment += "(?!"; + continue; + } + if (glob[i] === "{") { + groupStack.push("BRACE"); + segment += "(?:"; + continue; + } + if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") { + groupStack.pop(); + segment += ")"; + continue; + } + if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") { + segment += "|"; + continue; + } + if (glob[i] === "*") { + if (extended && glob[i + 1] === "(") { + i++; + groupStack.push("*"); + segment += "(?:"; + } else { + const prevChar = glob[i - 1]; + let numStars = 1; + while(glob[i + 1] === "*"){ + i++; + numStars++; + } + const nextChar = glob[i + 1]; + if (globstarOption && numStars === 2 && [ + ...c.seps, + undefined + ].includes(prevChar) && [ + ...c.seps, + undefined + ].includes(nextChar)) { + segment += c.globstar; + endsWithSep = true; + } else { + segment += c.wildcard; + } + } + continue; + } + segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i]; + } + // Check for unclosed groups or a dangling backslash. + if (groupStack.length > 0 || inRange || inEscape) { + // Parse failure. Take all characters from this segment literally. + segment = ""; + for (const c of glob.slice(j, i)){ + segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c; + endsWithSep = false; + } + } + regExpString += segment; + if (!endsWithSep) { + regExpString += i < glob.length ? c.sep : c.sepMaybe; + endsWithSep = true; + } + // Terminates with `i` at the start of the next segment. + while(c.seps.includes(glob[i]))i++; + j = i; + } + regExpString = `^${regExpString}$`; + return new RegExp(regExpString, caseInsensitive ? "i" : ""); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +const constants = { + sep: "(?:\\\\|/)+", + sepMaybe: "(?:\\\\|/)*", + seps: [ + "\\", + "/" + ], + globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*", + wildcard: "[^\\\\/]*", + escapePrefix: "`" +}; +/** Convert a glob string to a regular expression. + * + * Tries to match bash glob expansion as closely as possible. + * + * Basic glob syntax: + * - `*` - Matches everything without leaving the path segment. + * - `?` - Matches any single character. + * - `{foo,bar}` - Matches `foo` or `bar`. + * - `[abcd]` - Matches `a`, `b`, `c` or `d`. + * - `[a-d]` - Matches `a`, `b`, `c` or `d`. + * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`. + * - `[[::]]` - Matches any character belonging to ``. + * - `[[:alnum:]]` - Matches any digit or letter. + * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`. + * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes + * for a complete list of supported character classes. + * - `\` - Escapes the next character for an `os` other than `"windows"`. + * - \` - Escapes the next character for `os` set to `"windows"`. + * - `/` - Path separator. + * - `\` - Additional path separator only for `os` set to `"windows"`. + * + * Extended syntax: + * - Requires `{ extended: true }`. + * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`. + * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same. + * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`. + * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`. + * - `!(foo|bar)` - Matches anything other than `{foo,bar}`. + * - See https://www.linuxjournal.com/content/bash-extended-globbing. + * + * Globstar syntax: + * - Requires `{ globstar: true }`. + * - `**` - Matches any number of any path segments. + * - Must comprise its entire path segment in the provided glob. + * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option. + * + * Note the following properties: + * - The generated `RegExp` is anchored at both start and end. + * - Repeating and trailing separators are tolerated. Trailing separators in the + * provided glob have no meaning and are discarded. + * - Absolute globs will only match absolute paths, etc. + * - Empty globs will match nothing. + * - Any special glob syntax must be contained to one path segment. For example, + * `?(foo|bar/baz)` is invalid. The separator will take precedence and the + * first segment ends with an unclosed group. + * - If a path segment ends with unclosed groups or a dangling escape prefix, a + * parse error has occurred. Every character for that segment is taken + * literally in this event. + * + * Limitations: + * - A negative group like `!(foo|bar)` will wrongly be converted to a negative + * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly + * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively, + * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if + * the group occurs not nested at the end of the segment. + * + * @example Usage + * ```ts + * import { globToRegExp } from "@std/path/windows/glob-to-regexp"; + * import { assertEquals } from "@std/assert"; + * + * assertEquals(globToRegExp("*.js"), /^[^\\/]*\.js(?:\\|\/)*$/); + * ``` + * + * @param glob Glob string to convert. + * @param options Conversion options. + * @returns The regular expression equivalent to the glob. + */ function globToRegExp(glob, options = {}) { + return _globToRegExp(constants, glob, options); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Test whether the given string is a glob. + * + * @example Usage + * ```ts + * import { isGlob } from "@std/path/is-glob"; + * import { assert } from "@std/assert"; + * + * assert(!isGlob("foo/bar/../baz")); + * assert(isGlob("foo/*ar/../baz")); + * ``` + * + * @param str String to test. + * @returns `true` if the given string is a glob, otherwise `false` + */ function isGlob(str) { + const chars = { + "{": "}", + "(": ")", + "[": "]" + }; + const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; + if (str === "") { + return false; + } + let match; + while(match = regex.exec(str)){ + if (match[2]) return true; + let idx = match.index + match[0].length; + // if an open bracket/brace/paren is escaped, + // set the index to the next closing character + const open = match[1]; + const close = open ? chars[open] : null; + if (open && close) { + const n = str.indexOf(close, idx); + if (n !== -1) { + idx = n + 1; + } + } + str = str.slice(idx); + } + return false; +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. + * + * @example Usage + * ```ts + * import { normalizeGlob } from "@std/path/windows/normalize-glob"; + * import { assertEquals } from "@std/assert"; + * + * const normalized = normalizeGlob("**\\foo\\..\\bar", { globstar: true }); + * assertEquals(normalized, "**\\bar"); + * ``` + * + * @param glob The glob pattern to normalize. + * @param options The options for glob pattern. + * @returns The normalized glob pattern. + */ function normalizeGlob(glob, options = {}) { + const { globstar = false } = options; + if (glob.match(/\0/g)) { + throw new Error(`Glob contains invalid characters: "${glob}"`); + } + if (!globstar) { + return normalize(glob); + } + const s = SEPARATOR_PATTERN.source; + const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g"); + return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, ".."); +} + +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// This module is browser compatible. +/** + * Like join(), but doesn't collapse "**\/.." when `globstar` is true. + * + * @example Usage + * + * ```ts + * import { joinGlobs } from "@std/path/windows/join-globs"; + * import { assertEquals } from "@std/assert"; + * + * const joined = joinGlobs(["foo", "**", "bar"], { globstar: true }); + * assertEquals(joined, "foo\\**\\bar"); + * ``` + * + * @param globs The globs to join. + * @param options The options for glob pattern. + * @returns The joined glob pattern. + */ function joinGlobs(globs, options = {}) { + const { globstar = false } = options; + if (!globstar || globs.length === 0) { + return join(...globs); + } + let joined; + for (const glob of globs){ + const path = glob; + if (path.length > 0) { + if (!joined) joined = path; + else joined += `${SEPARATOR}${path}`; + } + } + if (!joined) return "."; + return normalizeGlob(joined, { + globstar + }); +} + +export { DELIMITER, SEPARATOR, SEPARATOR_PATTERN, basename, common, dirname, extname, format, fromFileUrl, globToRegExp, isAbsolute, isGlob, join, joinGlobs, normalize, normalizeGlob, parse, relative, resolve, toFileUrl, toNamespacedPath }; diff --git a/node_modules/@eslint/config-array/dist/esm/types.ts b/node_modules/@eslint/config-array/dist/esm/types.ts new file mode 100644 index 0000000..1af4011 --- /dev/null +++ b/node_modules/@eslint/config-array/dist/esm/types.ts @@ -0,0 +1,24 @@ +/** + * @fileoverview Types for the config-array package. + * @author Nicholas C. Zakas + */ + +export interface ConfigObject { + /** + * The files to include. + */ + files?: string[]; + + /** + * The files to exclude. + */ + ignores?: string[]; + + /** + * The name of the config object. + */ + name?: string; + + // may also have any number of other properties + [key: string]: unknown; +} diff --git a/node_modules/@eslint/config-array/package.json b/node_modules/@eslint/config-array/package.json new file mode 100644 index 0000000..fc98dda --- /dev/null +++ b/node_modules/@eslint/config-array/package.json @@ -0,0 +1,66 @@ +{ + "name": "@eslint/config-array", + "version": "0.19.2", + "description": "General purpose glob-based configuration matching.", + "author": "Nicholas C. Zakas", + "type": "module", + "main": "dist/esm/index.js", + "types": "dist/esm/index.d.ts", + "exports": { + "require": { + "types": "./dist/cjs/index.d.cts", + "default": "./dist/cjs/index.cjs" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/rewrite.git" + }, + "bugs": { + "url": "https://github.com/eslint/rewrite/issues" + }, + "homepage": "https://github.com/eslint/rewrite#readme", + "scripts": { + "build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js", + "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts", + "build:std__path": "rollup -c rollup.std__path-config.js && node fix-std__path-imports", + "build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts && npm run build:std__path", + "test:jsr": "npx jsr@latest publish --dry-run", + "pretest": "npm run build", + "test": "mocha tests/", + "test:coverage": "c8 npm test" + }, + "keywords": [ + "configuration", + "configarray", + "config file" + ], + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "devDependencies": { + "@jsr/std__path": "^1.0.4", + "@types/minimatch": "^3.0.5", + "c8": "^9.1.0", + "mocha": "^10.4.0", + "rollup": "^4.16.2", + "rollup-plugin-copy": "^3.5.0", + "typescript": "^5.4.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } +} diff --git a/node_modules/@eslint/core/LICENSE b/node_modules/@eslint/core/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@eslint/core/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@eslint/core/README.md b/node_modules/@eslint/core/README.md new file mode 100644 index 0000000..1a93f30 --- /dev/null +++ b/node_modules/@eslint/core/README.md @@ -0,0 +1,29 @@ +# ESLint Core + +## Overview + +This package is the future home of the rewritten, runtime-agnostic ESLint core. + +Right now, it exports the core types necessary to implement language plugins. + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io

Silver Sponsors

+

Vite JetBrains Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/node_modules/@eslint/core/dist/cjs/types.d.cts b/node_modules/@eslint/core/dist/cjs/types.d.cts new file mode 100644 index 0000000..4112095 --- /dev/null +++ b/node_modules/@eslint/core/dist/cjs/types.d.cts @@ -0,0 +1,809 @@ +/** + * @fileoverview Shared types for ESLint Core. + */ +import { JSONSchema4 } from "json-schema"; +/** + * Represents an error inside of a file. + */ +export interface FileError { + message: string; + line: number; + column: number; + endLine?: number; + endColumn?: number; +} +/** + * Represents a problem found in a file. + */ +export interface FileProblem { + ruleId: string | null; + message: string; + loc: SourceLocation; +} +/** + * Represents the start and end coordinates of a node inside the source. + */ +export interface SourceLocation { + start: Position; + end: Position; +} +/** + * Represents the start and end coordinates of a node inside the source with an offset. + */ +export interface SourceLocationWithOffset { + start: PositionWithOffset; + end: PositionWithOffset; +} +/** + * Represents a location coordinate inside the source. ESLint-style formats + * have just `line` and `column` while others may have `offset` as well. + */ +export interface Position { + line: number; + column: number; +} +/** + * Represents a location coordinate inside the source with an offset. + */ +export interface PositionWithOffset extends Position { + offset: number; +} +/** + * Represents a range of characters in the source. + */ +export type SourceRange = [number, number]; +/** + * What the rule is responsible for finding: + * - `problem` means the rule has noticed a potential error. + * - `suggestion` means the rule suggests an alternate or better approach. + * - `layout` means the rule is looking at spacing, indentation, etc. + */ +export type RuleType = "problem" | "suggestion" | "layout"; +/** + * The type of fix the rule can provide: + * - `code` means the rule can fix syntax. + * - `whitespace` means the rule can fix spacing and indentation. + */ +export type RuleFixType = "code" | "whitespace"; +/** + * An object containing visitor information for a rule. Each method is either the + * name of a node type or a selector, or is a method that will be called at specific + * times during the traversal. + */ +export type RuleVisitor = Record void) | undefined>; +/** + * Rule meta information used for documentation. + */ +export interface RulesMetaDocs { + /** + * A short description of the rule. + */ + description?: string | undefined; + /** + * The URL to the documentation for the rule. + */ + url?: string | undefined; + /** + * The category the rule falls under. + * @deprecated No longer used. + */ + category?: string | undefined; + /** + * Indicates if the rule is generally recommended for all users. + */ + recommended?: boolean | undefined; + /** + * Indicates if the rule is frozen (no longer accepting feature requests). + */ + frozen?: boolean | undefined; +} +/** + * Meta information about a rule. + */ +export interface RulesMeta { + /** + * Properties that are used when documenting the rule. + */ + docs?: (RulesMetaDocs & ExtRuleDocs) | undefined; + /** + * The type of rule. + */ + type?: RuleType | undefined; + /** + * The schema for the rule options. Required if the rule has options. + */ + schema?: JSONSchema4 | JSONSchema4[] | false | undefined; + /** Any default options to be recursively merged on top of any user-provided options. */ + defaultOptions?: unknown[]; + /** + * The messages that the rule can report. + */ + messages?: Record; + /** + * Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated. + */ + deprecated?: boolean | DeprecatedInfo | undefined; + /** + * @deprecated Use deprecated.replacedBy instead. + * The name of the rule(s) this rule was replaced by, if it was deprecated. + */ + replacedBy?: readonly string[] | undefined; + /** + * Indicates if the rule is fixable, and if so, what type of fix it provides. + */ + fixable?: RuleFixType | undefined; + /** + * Indicates if the rule may provide suggestions. + */ + hasSuggestions?: boolean | undefined; + /** + * The language the rule is intended to lint. + */ + language?: string; + /** + * The dialects of `language` that the rule is intended to lint. + */ + dialects?: string[]; +} +/** + * Provides additional metadata about a deprecation. + */ +export interface DeprecatedInfo { + /** + * General message presented to the user, e.g. for the key rule why the rule + * is deprecated or for info how to replace the rule. + */ + message?: string; + /** + * URL to more information about this deprecation in general. + */ + url?: string; + /** + * An empty array explicitly states that there is no replacement. + */ + replacedBy?: ReplacedByInfo[]; + /** + * The package version since when the rule is deprecated (should use full + * semver without a leading "v"). + */ + deprecatedSince?: string; + /** + * The estimated version when the rule is removed (probably the next major + * version). null means the rule is "frozen" (will be available but will not + * be changed). + */ + availableUntil?: string | null; +} +/** + * Provides metadata about a replacement + */ +export interface ReplacedByInfo { + /** + * General message presented to the user, e.g. how to replace the rule + */ + message?: string; + /** + * URL to more information about this replacement in general + */ + url?: string; + /** + * Name should be "eslint" if the replacement is an ESLint core rule. Omit + * the property if the replacement is in the same plugin. + */ + plugin?: ExternalSpecifier; + /** + * Name and documentation of the replacement rule + */ + rule?: ExternalSpecifier; +} +/** + * Specifies the name and url of an external resource. At least one property + * should be set. + */ +export interface ExternalSpecifier { + /** + * Name of the referenced plugin / rule. + */ + name?: string; + /** + * URL pointing to documentation for the plugin / rule. + */ + url?: string; +} +/** + * Generic type for `RuleContext`. + */ +export interface RuleContextTypeOptions { + LangOptions: LanguageOptions; + Code: SourceCode; + RuleOptions: unknown[]; + Node: unknown; + MessageIds: string; +} +/** + * Represents the context object that is passed to a rule. This object contains + * information about the current state of the linting process and is the rule's + * view into the outside world. + */ +export interface RuleContext { + /** + * The current working directory for the session. + */ + cwd: string; + /** + * Returns the current working directory for the session. + * @deprecated Use `cwd` instead. + */ + getCwd(): string; + /** + * The filename of the file being linted. + */ + filename: string; + /** + * Returns the filename of the file being linted. + * @deprecated Use `filename` instead. + */ + getFilename(): string; + /** + * The physical filename of the file being linted. + */ + physicalFilename: string; + /** + * Returns the physical filename of the file being linted. + * @deprecated Use `physicalFilename` instead. + */ + getPhysicalFilename(): string; + /** + * The source code object that the rule is running on. + */ + sourceCode: Options["Code"]; + /** + * Returns the source code object that the rule is running on. + * @deprecated Use `sourceCode` instead. + */ + getSourceCode(): Options["Code"]; + /** + * Shared settings for the configuration. + */ + settings: SettingsConfig; + /** + * Parser-specific options for the configuration. + * @deprecated Use `languageOptions.parserOptions` instead. + */ + parserOptions: Record; + /** + * The language options for the configuration. + */ + languageOptions: Options["LangOptions"]; + /** + * The CommonJS path to the parser used while parsing this file. + * @deprecated No longer used. + */ + parserPath: string | undefined; + /** + * The rule ID. + */ + id: string; + /** + * The rule's configured options. + */ + options: Options["RuleOptions"]; + /** + * The report function that the rule should use to report problems. + * @param violation The violation to report. + */ + report(violation: ViolationReport): void; +} +/** + * Manager of text edits for a rule fix. + */ +export interface RuleTextEditor { + /** + * Inserts text after the specified node or token. + * @param syntaxElement The node or token to insert after. + * @param text The edit to insert after the node or token. + */ + insertTextAfter(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit; + /** + * Inserts text after the specified range. + * @param range The range to insert after. + * @param text The edit to insert after the range. + */ + insertTextAfterRange(range: SourceRange, text: string): RuleTextEdit; + /** + * Inserts text before the specified node or token. + * @param syntaxElement A syntax element with location information to insert before. + * @param text The edit to insert before the node or token. + */ + insertTextBefore(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit; + /** + * Inserts text before the specified range. + * @param range The range to insert before. + * @param text The edit to insert before the range. + */ + insertTextBeforeRange(range: SourceRange, text: string): RuleTextEdit; + /** + * Removes the specified node or token. + * @param syntaxElement A syntax element with location information to remove. + * @returns The edit to remove the node or token. + */ + remove(syntaxElement: EditableSyntaxElement): RuleTextEdit; + /** + * Removes the specified range. + * @param range The range to remove. + * @returns The edit to remove the range. + */ + removeRange(range: SourceRange): RuleTextEdit; + /** + * Replaces the specified node or token with the given text. + * @param syntaxElement A syntax element with location information to replace. + * @param text The text to replace the node or token with. + * @returns The edit to replace the node or token. + */ + replaceText(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit; + /** + * Replaces the specified range with the given text. + * @param range The range to replace. + * @param text The text to replace the range with. + * @returns The edit to replace the range. + */ + replaceTextRange(range: SourceRange, text: string): RuleTextEdit; +} +/** + * Represents a fix for a rule violation implemented as a text edit. + */ +export interface RuleTextEdit { + /** + * The range to replace. + */ + range: SourceRange; + /** + * The text to insert. + */ + text: string; +} +/** + * Fixes a violation. + * @param fixer The text editor to apply the fix. + * @returns The fix(es) for the violation. + */ +type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable | null; +interface ViolationReportBase { + /** + * The type of node that the violation is for. + * @deprecated May be removed in the future. + */ + nodeType?: string | undefined; + /** + * The data to insert into the message. + */ + data?: Record | undefined; + /** + * The fix to be applied for the violation. + */ + fix?: RuleFixer | null | undefined; + /** + * An array of suggested fixes for the problem. These fixes may change the + * behavior of the code, so they are not applied automatically. + */ + suggest?: SuggestedEdit[] | null | undefined; +} +type ViolationMessage = { + message: string; +} | { + messageId: MessageIds; +}; +type ViolationLocation = { + loc: SourceLocation | Position; +} | { + node: Node; +}; +export type ViolationReport = ViolationReportBase & ViolationMessage & ViolationLocation; +interface SuggestedEditBase { + /** + * The data to insert into the message. + */ + data?: Record | undefined; + /** + * The fix to be applied for the suggestion. + */ + fix?: RuleFixer | null | undefined; +} +type SuggestionMessage = { + desc: string; +} | { + messageId: string; +}; +/** + * A suggested edit for a rule violation. + */ +export type SuggestedEdit = SuggestedEditBase & SuggestionMessage; +/** + * Generic options for the `RuleDefinition` type. + */ +export interface RuleDefinitionTypeOptions { + LangOptions: LanguageOptions; + Code: SourceCode; + RuleOptions: unknown[]; + Visitor: RuleVisitor; + Node: unknown; + MessageIds: string; + ExtRuleDocs: unknown; +} +/** + * The definition of an ESLint rule. + */ +export interface RuleDefinition { + /** + * The meta information for the rule. + */ + meta?: RulesMeta; + /** + * Creates the visitor that ESLint uses to apply the rule during traversal. + * @param context The rule context. + * @returns The rule visitor. + */ + create(context: RuleContext<{ + LangOptions: Options["LangOptions"]; + Code: Options["Code"]; + RuleOptions: Options["RuleOptions"]; + Node: Options["Node"]; + MessageIds: Options["MessageIds"]; + }>): Options["Visitor"]; +} +/** + * The human readable severity level used in a configuration. + */ +export type SeverityName = "off" | "warn" | "error"; +/** + * The numeric severity level for a rule. + * + * - `0` means off. + * - `1` means warn. + * - `2` means error. + */ +export type SeverityLevel = 0 | 1 | 2; +/** + * The severity of a rule in a configuration. + */ +export type Severity = SeverityName | SeverityLevel; +/** + * Represents the configuration options for the core linter. + */ +export interface LinterOptionsConfig { + /** + * Indicates whether or not inline configuration is evaluated. + */ + noInlineConfig?: boolean; + /** + * Indicates what to do when an unused disable directive is found. + */ + reportUnusedDisableDirectives?: boolean | Severity; +} +/** + * Shared settings that are accessible from within plugins. + */ +export type SettingsConfig = Record; +/** + * The configuration for a rule. + */ +export type RuleConfig = Severity | [Severity, ...unknown[]]; +/** + * A collection of rules and their configurations. + */ +export type RulesConfig = Record; +/** + * Generic options for the `Language` type. + */ +export interface LanguageTypeOptions { + LangOptions: LanguageOptions; + Code: SourceCode; + RootNode: unknown; + Node: unknown; +} +/** + * Represents a plugin language. + */ +export interface Language { + /** + * Indicates how ESLint should read the file. + */ + fileType: "text"; + /** + * First line number returned from the parser (text mode only). + */ + lineStart: 0 | 1; + /** + * First column number returned from the parser (text mode only). + */ + columnStart: 0 | 1; + /** + * The property to read the node type from. Used in selector querying. + */ + nodeTypeKey: string; + /** + * The traversal path that tools should take when evaluating the AST + */ + visitorKeys?: Record; + /** + * Default language options. User-defined options are merged with this object. + */ + defaultLanguageOptions?: LanguageOptions; + /** + * Validates languageOptions for this language. + */ + validateLanguageOptions(languageOptions: Options["LangOptions"]): void; + /** + * Normalizes languageOptions for this language. + */ + normalizeLanguageOptions?(languageOptions: Options["LangOptions"]): Options["LangOptions"]; + /** + * Helper for esquery that allows languages to match nodes against + * class. esquery currently has classes like `function` that will + * match all the various function nodes. This method allows languages + * to implement similar shorthands. + */ + matchesSelectorClass?(className: string, node: Options["Node"], ancestry: Options["Node"][]): boolean; + /** + * Parses the given file input into its component parts. This file should not + * throws errors for parsing errors but rather should return any parsing + * errors as parse of the ParseResult object. + */ + parse(file: File, context: LanguageContext): ParseResult; + /** + * Creates SourceCode object that ESLint uses to work with a file. + */ + createSourceCode(file: File, input: OkParseResult, context: LanguageContext): Options["Code"]; +} +/** + * Plugin-defined options for the language. + */ +export type LanguageOptions = Record; +/** + * The context object that is passed to the language plugin methods. + */ +export interface LanguageContext { + languageOptions: LangOptions; +} +/** + * Represents a file read by ESLint. + */ +export interface File { + /** + * The path that ESLint uses for this file. May be a virtual path + * if it was returned by a processor. + */ + path: string; + /** + * The path to the file on disk. This always maps directly to a file + * regardless of whether it was returned from a processor. + */ + physicalPath: string; + /** + * Indicates if the original source contained a byte-order marker. + * ESLint strips the BOM from the `body`, but this info is needed + * to correctly apply autofixing. + */ + bom: boolean; + /** + * The body of the file to parse. + */ + body: string | Uint8Array; +} +/** + * Represents the successful result of parsing a file. + */ +export interface OkParseResult { + /** + * Indicates if the parse was successful. If true, the parse was successful + * and ESLint should continue on to create a SourceCode object and run rules; + * if false, ESLint should just report the error(s) without doing anything + * else. + */ + ok: true; + /** + * The abstract syntax tree created by the parser. (only when ok: true) + */ + ast: RootNode; + /** + * Any additional data that the parser wants to provide. + */ + [key: string]: any; +} +/** + * Represents the unsuccessful result of parsing a file. + */ +export interface NotOkParseResult { + /** + * Indicates if the parse was successful. If true, the parse was successful + * and ESLint should continue on to create a SourceCode object and run rules; + * if false, ESLint should just report the error(s) without doing anything + * else. + */ + ok: false; + /** + * Any parsing errors, whether fatal or not. (only when ok: false) + */ + errors: FileError[]; + /** + * Any additional data that the parser wants to provide. + */ + [key: string]: any; +} +export type ParseResult = OkParseResult | NotOkParseResult; +/** + * Represents inline configuration found in the source code. + */ +interface InlineConfigElement { + /** + * The location of the inline config element. + */ + loc: SourceLocation; + /** + * The interpreted configuration from the inline config element. + */ + config: { + rules: RulesConfig; + }; +} +/** + * Generic options for the `SourceCodeBase` type. + */ +interface SourceCodeBaseTypeOptions { + LangOptions: LanguageOptions; + RootNode: unknown; + SyntaxElementWithLoc: unknown; + ConfigNode: unknown; +} +/** + * Represents the basic interface for a source code object. + */ +interface SourceCodeBase { + /** + * Root of the AST. + */ + ast: Options["RootNode"]; + /** + * The traversal path that tools should take when evaluating the AST. + * When present, this overrides the `visitorKeys` on the language for + * just this source code object. + */ + visitorKeys?: Record; + /** + * Retrieves the equivalent of `loc` for a given node or token. + * @param syntaxElement The node or token to get the location for. + * @returns The location of the node or token. + */ + getLoc(syntaxElement: Options["SyntaxElementWithLoc"]): SourceLocation; + /** + * Retrieves the equivalent of `range` for a given node or token. + * @param syntaxElement The node or token to get the range for. + * @returns The range of the node or token. + */ + getRange(syntaxElement: Options["SyntaxElementWithLoc"]): SourceRange; + /** + * Traversal of AST. + */ + traverse(): Iterable; + /** + * Applies language options passed in from the ESLint core. + */ + applyLanguageOptions?(languageOptions: Options["LangOptions"]): void; + /** + * Return all of the inline areas where ESLint should be disabled/enabled + * along with any problems found in evaluating the directives. + */ + getDisableDirectives?(): { + directives: Directive[]; + problems: FileProblem[]; + }; + /** + * Returns an array of all inline configuration nodes found in the + * source code. + */ + getInlineConfigNodes?(): Options["ConfigNode"][]; + /** + * Applies configuration found inside of the source code. This method is only + * called when ESLint is running with inline configuration allowed. + */ + applyInlineConfig?(): { + configs: InlineConfigElement[]; + problems: FileProblem[]; + }; + /** + * Called by ESLint core to indicate that it has finished providing + * information. We now add in all the missing variables and ensure that + * state-changing methods cannot be called by rules. + * @returns {void} + */ + finalize?(): void; +} +/** + * Represents the source of a text file being linted. + */ +export interface TextSourceCode extends SourceCodeBase { + /** + * The body of the file that you'd like rule developers to access. + */ + text: string; +} +/** + * Represents the source of a binary file being linted. + */ +export interface BinarySourceCode extends SourceCodeBase { + /** + * The body of the file that you'd like rule developers to access. + */ + body: Uint8Array; +} +export type SourceCode = TextSourceCode | BinarySourceCode; +/** + * Represents a traversal step visiting the AST. + */ +export interface VisitTraversalStep { + kind: 1; + target: unknown; + phase: 1 | 2; + args: unknown[]; +} +/** + * Represents a traversal step calling a function. + */ +export interface CallTraversalStep { + kind: 2; + target: string; + phase?: string; + args: unknown[]; +} +export type TraversalStep = VisitTraversalStep | CallTraversalStep; +/** + * The type of disable directive. This determines how ESLint will disable rules. + */ +export type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line"; +/** + * Represents a disable directive. + */ +export interface Directive { + /** + * The type of directive. + */ + type: DirectiveType; + /** + * The node of the directive. May be in the AST or a comment/token. + */ + node: unknown; + /** + * The value of the directive. + */ + value: string; + /** + * The justification for the directive. + */ + justification?: string; +} +export {}; diff --git a/node_modules/@eslint/core/package.json b/node_modules/@eslint/core/package.json new file mode 100644 index 0000000..7b7648b --- /dev/null +++ b/node_modules/@eslint/core/package.json @@ -0,0 +1,49 @@ +{ + "name": "@eslint/core", + "version": "0.12.0", + "description": "Runtime-agnostic core of ESLint", + "type": "module", + "types": "./dist/esm/types.d.ts", + "exports": { + "types": { + "import": "./dist/esm/types.d.ts", + "require": "./dist/cjs/types.d.cts" + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "build:cts": "node -e \"fs.cpSync('dist/esm/types.d.ts', 'dist/cjs/types.d.cts')\"", + "build": "tsc && npm run build:cts", + "test:jsr": "npx jsr@latest publish --dry-run", + "test:types": "tsc -p tests/types/tsconfig.json" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/rewrite.git" + }, + "keywords": [ + "eslint", + "core" + ], + "author": "Nicholas C. Zakas", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/rewrite/issues" + }, + "homepage": "https://github.com/eslint/rewrite#readme", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "devDependencies": { + "json-schema": "^0.4.0", + "typescript": "^5.4.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } +} diff --git a/node_modules/@eslint/eslintrc/LICENSE b/node_modules/@eslint/eslintrc/LICENSE new file mode 100644 index 0000000..b607bb3 --- /dev/null +++ b/node_modules/@eslint/eslintrc/LICENSE @@ -0,0 +1,19 @@ +Copyright OpenJS Foundation and other contributors, + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@eslint/eslintrc/README.md b/node_modules/@eslint/eslintrc/README.md new file mode 100644 index 0000000..cdcf0a6 --- /dev/null +++ b/node_modules/@eslint/eslintrc/README.md @@ -0,0 +1,126 @@ +# ESLintRC Library + +This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs. + +**Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system. + +## Installation + +You can install the package as follows: + +``` +npm install @eslint/eslintrc --save-dev + +# or + +yarn add @eslint/eslintrc -D +``` + +## Usage (ESM) + +The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file: + +```js +import { FlatCompat } from "@eslint/eslintrc"; +import js from "@eslint/js"; +import path from "path"; +import { fileURLToPath } from "url"; + +// mimic CommonJS variables -- not needed if using CommonJS +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const compat = new FlatCompat({ + baseDirectory: __dirname, // optional; default: process.cwd() + resolvePluginsRelativeTo: __dirname, // optional + recommendedConfig: js.configs.recommended, // optional unless you're using "eslint:recommended" + allConfig: js.configs.all, // optional unless you're using "eslint:all" +}); + +export default [ + + // mimic ESLintRC-style extends + ...compat.extends("standard", "example", "plugin:react/recommended"), + + // mimic environments + ...compat.env({ + es2020: true, + node: true + }), + + // mimic plugins + ...compat.plugins("jsx-a11y", "react"), + + // translate an entire config + ...compat.config({ + plugins: ["jsx-a11y", "react"], + extends: "standard", + env: { + es2020: true, + node: true + }, + rules: { + semi: "error" + } + }) +]; +``` + +## Usage (CommonJS) + +Using `FlatCompat` in CommonJS files is similar to ESM, but you'll use `require()` and `module.exports` instead of `import` and `export`. Here's how you use it inside of your `eslint.config.js` CommonJS file: + +```js +const { FlatCompat } = require("@eslint/eslintrc"); +const js = require("@eslint/js"); + +const compat = new FlatCompat({ + baseDirectory: __dirname, // optional; default: process.cwd() + resolvePluginsRelativeTo: __dirname, // optional + recommendedConfig: js.configs.recommended, // optional unless using "eslint:recommended" + allConfig: js.configs.all, // optional unless using "eslint:all" +}); + +module.exports = [ + + // mimic ESLintRC-style extends + ...compat.extends("standard", "example", "plugin:react/recommended"), + + // mimic environments + ...compat.env({ + es2020: true, + node: true + }), + + // mimic plugins + ...compat.plugins("jsx-a11y", "react"), + + // translate an entire config + ...compat.config({ + plugins: ["jsx-a11y", "react"], + extends: "standard", + env: { + es2020: true, + node: true + }, + rules: { + semi: "error" + } + }) +]; +``` + +## Troubleshooting + +**TypeError: Missing parameter 'recommendedConfig' in FlatCompat constructor** + +The `recommendedConfig` option is required when any config uses `eslint:recommended`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:recommended` config. + +**TypeError: Missing parameter 'allConfig' in FlatCompat constructor** + +The `allConfig` option is required when any config uses `eslint:all`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:all` config. + + +## License + +MIT License diff --git a/node_modules/@eslint/eslintrc/conf/config-schema.js b/node_modules/@eslint/eslintrc/conf/config-schema.js new file mode 100644 index 0000000..ada90e1 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/config-schema.js @@ -0,0 +1,79 @@ +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +const baseConfigProperties = { + $schema: { type: "string" }, + env: { type: "object" }, + extends: { $ref: "#/definitions/stringOrStrings" }, + globals: { type: "object" }, + overrides: { + type: "array", + items: { $ref: "#/definitions/overrideConfig" }, + additionalItems: false + }, + parser: { type: ["string", "null"] }, + parserOptions: { type: "object" }, + plugins: { type: "array" }, + processor: { type: "string" }, + rules: { type: "object" }, + settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, + reportUnusedDisableDirectives: { type: "boolean" }, + + ecmaFeatures: { type: "object" } // deprecated; logs a warning when used +}; + +const configSchema = { + definitions: { + stringOrStrings: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false + } + ] + }, + stringOrStringsRequired: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false, + minItems: 1 + } + ] + }, + + // Config at top-level. + objectConfig: { + type: "object", + properties: { + root: { type: "boolean" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...baseConfigProperties + }, + additionalProperties: false + }, + + // Config in `overrides`. + overrideConfig: { + type: "object", + properties: { + excludedFiles: { $ref: "#/definitions/stringOrStrings" }, + files: { $ref: "#/definitions/stringOrStringsRequired" }, + ...baseConfigProperties + }, + required: ["files"], + additionalProperties: false + } + }, + + $ref: "#/definitions/objectConfig" +}; + +export default configSchema; diff --git a/node_modules/@eslint/eslintrc/conf/environments.js b/node_modules/@eslint/eslintrc/conf/environments.js new file mode 100644 index 0000000..e296fae --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/environments.js @@ -0,0 +1,215 @@ +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import globals from "globals"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwn(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +export default new Map(Object.entries({ + + // Language + builtin: { + globals: globals.es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + es2023: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 14 + } + }, + es2024: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 15 + } + }, + + // Platforms + browser: { + globals: globals.browser + }, + node: { + globals: globals.node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals["shared-node-browser"] + }, + worker: { + globals: globals.worker + }, + serviceworker: { + globals: globals.serviceworker + }, + + // Frameworks + commonjs: { + globals: globals.commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals.amd + }, + mocha: { + globals: globals.mocha + }, + jasmine: { + globals: globals.jasmine + }, + jest: { + globals: globals.jest + }, + phantomjs: { + globals: globals.phantomjs + }, + jquery: { + globals: globals.jquery + }, + qunit: { + globals: globals.qunit + }, + prototypejs: { + globals: globals.prototypejs + }, + shelljs: { + globals: globals.shelljs + }, + meteor: { + globals: globals.meteor + }, + mongo: { + globals: globals.mongo + }, + protractor: { + globals: globals.protractor + }, + applescript: { + globals: globals.applescript + }, + nashorn: { + globals: globals.nashorn + }, + atomtest: { + globals: globals.atomtest + }, + embertest: { + globals: globals.embertest + }, + webextensions: { + globals: globals.webextensions + }, + greasemonkey: { + globals: globals.greasemonkey + } +})); diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs new file mode 100644 index 0000000..6000445 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs @@ -0,0 +1,1212 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var util = require('node:util'); +var path = require('node:path'); +var Ajv = require('ajv'); +var globals = require('globals'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var util__default = /*#__PURE__*/_interopDefaultLegacy(util); +var path__default = /*#__PURE__*/_interopDefaultLegacy(path); +var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv); +var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals); + +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = new Set([0, 1, 2, "off", "warn", "error"]); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.has(severity); +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +var ConfigOps = { + __proto__: null, + getRuleSeverity: getRuleSeverity, + normalizeToStrings: normalizeToStrings, + isErrorSeverity: isErrorSeverity, + isValidSeverity: isValidSeverity, + isEverySeverityValid: isEverySeverityValid, + normalizeConfigGlobal: normalizeConfigGlobal +}; + +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path__default["default"].relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +var ajvOrig = (additionalOptions = {}) => { + const ajv = new Ajv__default["default"]({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle -- part of the API + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; + +/** + * @fileoverview Applies default rule options + * @author JoshuaKGoldberg + */ + +/** + * Check if the variable contains an object strictly rejecting arrays + * @param {unknown} value an object + * @returns {boolean} Whether value is an object + */ +function isObjectNotArray(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + +/** + * Deeply merges second on top of first, creating a new {} object if needed. + * @param {T} first Base, default value. + * @param {U} second User-specified value. + * @returns {T | U | (T & U)} Merged equivalent of second on top of first. + */ +function deepMergeObjects(first, second) { + if (second === void 0) { + return first; + } + + if (!isObjectNotArray(first) || !isObjectNotArray(second)) { + return second; + } + + const result = { ...first, ...second }; + + for (const key of Object.keys(second)) { + if (Object.prototype.propertyIsEnumerable.call(first, key)) { + result[key] = deepMergeObjects(first[key], second[key]); + } + } + + return result; +} + +/** + * Deeply merges second on top of first, creating a new [] array if needed. + * @param {T[] | undefined} first Base, default values. + * @param {U[] | undefined} second User-specified values. + * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first. + */ +function deepMergeArrays(first, second) { + if (!first || !second) { + return second || first || []; + } + + return [ + ...first.map((value, i) => deepMergeObjects(value, second[i])), + ...second.slice(first.length) + ]; +} + +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +const baseConfigProperties = { + $schema: { type: "string" }, + env: { type: "object" }, + extends: { $ref: "#/definitions/stringOrStrings" }, + globals: { type: "object" }, + overrides: { + type: "array", + items: { $ref: "#/definitions/overrideConfig" }, + additionalItems: false + }, + parser: { type: ["string", "null"] }, + parserOptions: { type: "object" }, + plugins: { type: "array" }, + processor: { type: "string" }, + rules: { type: "object" }, + settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, + reportUnusedDisableDirectives: { type: "boolean" }, + + ecmaFeatures: { type: "object" } // deprecated; logs a warning when used +}; + +const configSchema = { + definitions: { + stringOrStrings: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false + } + ] + }, + stringOrStringsRequired: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false, + minItems: 1 + } + ] + }, + + // Config at top-level. + objectConfig: { + type: "object", + properties: { + root: { type: "boolean" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...baseConfigProperties + }, + additionalProperties: false + }, + + // Config in `overrides`. + overrideConfig: { + type: "object", + properties: { + excludedFiles: { $ref: "#/definitions/stringOrStrings" }, + files: { $ref: "#/definitions/stringOrStringsRequired" }, + ...baseConfigProperties + }, + required: ["files"], + additionalProperties: false + } + }, + + $ref: "#/definitions/objectConfig" +}; + +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwn(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +var environments = new Map(Object.entries({ + + // Language + builtin: { + globals: globals__default["default"].es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + es2023: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 14 + } + }, + es2024: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 15 + } + }, + + // Platforms + browser: { + globals: globals__default["default"].browser + }, + node: { + globals: globals__default["default"].node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals__default["default"]["shared-node-browser"] + }, + worker: { + globals: globals__default["default"].worker + }, + serviceworker: { + globals: globals__default["default"].serviceworker + }, + + // Frameworks + commonjs: { + globals: globals__default["default"].commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals__default["default"].amd + }, + mocha: { + globals: globals__default["default"].mocha + }, + jasmine: { + globals: globals__default["default"].jasmine + }, + jest: { + globals: globals__default["default"].jest + }, + phantomjs: { + globals: globals__default["default"].phantomjs + }, + jquery: { + globals: globals__default["default"].jquery + }, + qunit: { + globals: globals__default["default"].qunit + }, + prototypejs: { + globals: globals__default["default"].prototypejs + }, + shelljs: { + globals: globals__default["default"].shelljs + }, + meteor: { + globals: globals__default["default"].meteor + }, + mongo: { + globals: globals__default["default"].mongo + }, + protractor: { + globals: globals__default["default"].protractor + }, + applescript: { + globals: globals__default["default"].applescript + }, + nashorn: { + globals: globals__default["default"].nashorn + }, + atomtest: { + globals: globals__default["default"].atomtest + }, + embertest: { + globals: globals__default["default"].embertest + }, + webextensions: { + globals: globals__default["default"].webextensions + }, + greasemonkey: { + globals: globals__default["default"].greasemonkey + } +})); + +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +const ajv = ajvOrig(); + +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +// JSON schema that disallows passing any options +const noOptionsSchema = Object.freeze({ + type: "array", + minItems: 0, + maxItems: 0 +}); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Validator for configuration objects. + */ +class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {Rule} rule A rule object + * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`. + * @returns {Object|null} JSON Schema for the rule's options. + * `null` if rule wasn't passed or its `meta.schema` is `false`. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + if (!rule.meta) { + return { ...noOptionsSchema }; // default if `meta.schema` is not specified + } + + const schema = rule.meta.schema; + + if (typeof schema === "undefined") { + return { ...noOptionsSchema }; // default if `meta.schema` is not specified + } + + // `schema:false` is an allowed explicit opt-out of options validation for the rule + if (schema === false) { + return null; + } + + if (typeof schema !== "object" || schema === null) { + throw new TypeError("Rule's `meta.schema` must be an array or object"); + } + + // ESLint-specific array form needs to be converted into a valid JSON Schema definition + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + + // `schema:[]` is an explicit way to specify that the rule does not accept any options + return { ...noOptionsSchema }; + } + + // `schema:` is assumed to be a valid JSON Schema definition + return schema; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + * @throws {Error} If the severity is invalid. + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + * @throws {Error} If the options are invalid. + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + try { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } catch (err) { + const errorWithCode = new Error(err.message, { cause: err }); + + errorWithCode.code = "ESLINT_INVALID_RULE_OPTIONS_SCHEMA"; + + throw errorWithCode; + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, localOptions); + + validateRule(mergedOptions); + + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + * @throws {Error} If the options are invalid. + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + let enhancedMessage = err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA" + ? `Error while processing options validation schema of rule '${ruleId}': ${err.message}` + : `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + enhancedMessage = `${source}:\n\t${enhancedMessage}`; + } + + const enhancedError = new Error(enhancedMessage, { cause: err }); + + if (err.code) { + enhancedError.code = err.code; + } + + throw enhancedError; + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + * @throws {Error} If the environment is invalid. + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || environments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {(id:string) => Processor} getProcessor The getter of defined processors. + * @returns {void} + * @throws {Error} If the processor is invalid. + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + * @throws {Error} If the config is invalid. + */ + validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwn(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +} + +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +var naming = { + __proto__: null, + normalizePackageName: normalizePackageName, + getShorthandName: getShorthandName, + getNamespaceFromTerm: getNamespaceFromTerm +}; + +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + environments, + + // shared + ConfigOps, + ConfigValidator, + naming +}; + +exports.Legacy = Legacy; +//# sourceMappingURL=eslintrc-universal.cjs.map diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map new file mode 100644 index 0000000..8842905 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"eslintrc-universal.cjs","sources":["../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../lib/shared/deep-merge-arrays.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/index-universal.js"],"sourcesContent":["/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = new Set([0, 1, 2, \"off\", \"warn\", \"error\"]);\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.has(severity);\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"node:path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle -- part of the API\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Applies default rule options\n * @author JoshuaKGoldberg\n */\n\n/**\n * Check if the variable contains an object strictly rejecting arrays\n * @param {unknown} value an object\n * @returns {boolean} Whether value is an object\n */\nfunction isObjectNotArray(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Deeply merges second on top of first, creating a new {} object if needed.\n * @param {T} first Base, default value.\n * @param {U} second User-specified value.\n * @returns {T | U | (T & U)} Merged equivalent of second on top of first.\n */\nfunction deepMergeObjects(first, second) {\n if (second === void 0) {\n return first;\n }\n\n if (!isObjectNotArray(first) || !isObjectNotArray(second)) {\n return second;\n }\n\n const result = { ...first, ...second };\n\n for (const key of Object.keys(second)) {\n if (Object.prototype.propertyIsEnumerable.call(first, key)) {\n result[key] = deepMergeObjects(first[key], second[key]);\n }\n }\n\n return result;\n}\n\n/**\n * Deeply merges second on top of first, creating a new [] array if needed.\n * @param {T[] | undefined} first Base, default values.\n * @param {U[] | undefined} second User-specified values.\n * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first.\n */\nfunction deepMergeArrays(first, second) {\n if (!first || !second) {\n return second || first || [];\n }\n\n return [\n ...first.map((value, i) => deepMergeObjects(value, second[i])),\n ...second.slice(first.length)\n ];\n}\n\nexport { deepMergeArrays };\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record} current The newer object.\n * @param {Record} prev The older object.\n * @returns {Record} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwn(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n es2023: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 14\n }\n },\n es2024: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 15\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" -- not needed in this file */\n\n//------------------------------------------------------------------------------\n// Typedefs\n//------------------------------------------------------------------------------\n\n/** @typedef {import(\"../shared/types\").Rule} Rule */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"node:util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport { deepMergeArrays } from \"./deep-merge-arrays.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n// JSON schema that disallows passing any options\nconst noOptionsSchema = Object.freeze({\n type: \"array\",\n minItems: 0,\n maxItems: 0\n});\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\n/**\n * Validator for configuration objects.\n */\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {Rule} rule A rule object\n * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.\n * @returns {Object|null} JSON Schema for the rule's options.\n * `null` if rule wasn't passed or its `meta.schema` is `false`.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n if (!rule.meta) {\n return { ...noOptionsSchema }; // default if `meta.schema` is not specified\n }\n\n const schema = rule.meta.schema;\n\n if (typeof schema === \"undefined\") {\n return { ...noOptionsSchema }; // default if `meta.schema` is not specified\n }\n\n // `schema:false` is an allowed explicit opt-out of options validation for the rule\n if (schema === false) {\n return null;\n }\n\n if (typeof schema !== \"object\" || schema === null) {\n throw new TypeError(\"Rule's `meta.schema` must be an array or object\");\n }\n\n // ESLint-specific array form needs to be converted into a valid JSON Schema definition\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n\n // `schema:[]` is an explicit way to specify that the rule does not accept any options\n return { ...noOptionsSchema };\n }\n\n // `schema:` is assumed to be a valid JSON Schema definition\n return schema;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n * @throws {Error} If the severity is invalid.\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n * @throws {Error} If the options are invalid.\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n try {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n } catch (err) {\n const errorWithCode = new Error(err.message, { cause: err });\n\n errorWithCode.code = \"ESLINT_INVALID_RULE_OPTIONS_SCHEMA\";\n\n throw errorWithCode;\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, localOptions);\n\n validateRule(mergedOptions);\n\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n * @throws {Error} If the options are invalid.\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n let enhancedMessage = err.code === \"ESLINT_INVALID_RULE_OPTIONS_SCHEMA\"\n ? `Error while processing options validation schema of rule '${ruleId}': ${err.message}`\n : `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n enhancedMessage = `${source}:\\n\\t${enhancedMessage}`;\n }\n\n const enhancedError = new Error(enhancedMessage, { cause: err });\n\n if (err.code) {\n enhancedError.code = err.code;\n }\n\n throw enhancedError;\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n * @throws {Error} If the environment is invalid.\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {(id:string) => Processor} getProcessor The getter of defined processors.\n * @returns {void}\n * @throws {Error} If the processor is invalid.\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n * @throws {Error} If the config is invalid.\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwn(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n naming\n};\n\nexport {\n Legacy\n};\n"],"names":["path","Ajv","globals","util","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs new file mode 100644 index 0000000..c50b720 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs @@ -0,0 +1,4456 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var debugOrig = require('debug'); +var fs = require('node:fs'); +var importFresh = require('import-fresh'); +var Module = require('node:module'); +var path = require('node:path'); +var stripComments = require('strip-json-comments'); +var assert = require('node:assert'); +var ignore = require('ignore'); +var util = require('node:util'); +var minimatch = require('minimatch'); +var Ajv = require('ajv'); +var globals = require('globals'); +var os = require('node:os'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var debugOrig__default = /*#__PURE__*/_interopDefaultLegacy(debugOrig); +var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +var importFresh__default = /*#__PURE__*/_interopDefaultLegacy(importFresh); +var Module__default = /*#__PURE__*/_interopDefaultLegacy(Module); +var path__default = /*#__PURE__*/_interopDefaultLegacy(path); +var stripComments__default = /*#__PURE__*/_interopDefaultLegacy(stripComments); +var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); +var ignore__default = /*#__PURE__*/_interopDefaultLegacy(ignore); +var util__default = /*#__PURE__*/_interopDefaultLegacy(util); +var minimatch__default = /*#__PURE__*/_interopDefaultLegacy(minimatch); +var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv); +var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals); +var os__default = /*#__PURE__*/_interopDefaultLegacy(os); + +/** + * @fileoverview `IgnorePattern` class. + * + * `IgnorePattern` class has the set of glob patterns and the base path. + * + * It provides two static methods. + * + * - `IgnorePattern.createDefaultIgnore(cwd)` + * Create the default predicate function. + * - `IgnorePattern.createIgnore(ignorePatterns)` + * Create the predicate function from multiple `IgnorePattern` objects. + * + * It provides two properties and a method. + * + * - `patterns` + * The glob patterns that ignore to lint. + * - `basePath` + * The base path of the glob patterns. If absolute paths existed in the + * glob patterns, those are handled as relative paths to the base path. + * - `getPatternsRelativeTo(basePath)` + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * + * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes + * `ignorePatterns` properties. + * + * @author Toru Nagashima + */ + +const debug$3 = debugOrig__default["default"]("eslintrc:ignore-pattern"); + +/** @typedef {ReturnType} Ignore */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the path to the common ancestor directory of given paths. + * @param {string[]} sourcePaths The paths to calculate the common ancestor. + * @returns {string} The path to the common ancestor directory. + */ +function getCommonAncestorPath(sourcePaths) { + let result = sourcePaths[0]; + + for (let i = 1; i < sourcePaths.length; ++i) { + const a = result; + const b = sourcePaths[i]; + + // Set the shorter one (it's the common ancestor if one includes the other). + result = a.length < b.length ? a : b; + + // Set the common ancestor. + for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) { + if (a[j] !== b[j]) { + result = a.slice(0, lastSepPos); + break; + } + if (a[j] === path__default["default"].sep) { + lastSepPos = j; + } + } + } + + let resolvedResult = result || path__default["default"].sep; + + // if Windows common ancestor is root of drive must have trailing slash to be absolute. + if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") { + resolvedResult += path__default["default"].sep; + } + return resolvedResult; +} + +/** + * Make relative path. + * @param {string} from The source path to get relative path. + * @param {string} to The destination path to get relative path. + * @returns {string} The relative path. + */ +function relative(from, to) { + const relPath = path__default["default"].relative(from, to); + + if (path__default["default"].sep === "/") { + return relPath; + } + return relPath.split(path__default["default"].sep).join("/"); +} + +/** + * Get the trailing slash if existed. + * @param {string} filePath The path to check. + * @returns {string} The trailing slash if existed. + */ +function dirSuffix(filePath) { + const isDir = ( + filePath.endsWith(path__default["default"].sep) || + (process.platform === "win32" && filePath.endsWith("/")) + ); + + return isDir ? "/" : ""; +} + +const DefaultPatterns = Object.freeze(["/**/node_modules/*"]); +const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]); + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +/** + * Represents a set of glob patterns to ignore against a base path. + */ +class IgnorePattern { + + /** + * The default patterns. + * @type {string[]} + */ + static get DefaultPatterns() { + return DefaultPatterns; + } + + /** + * Create the default predicate function. + * @param {string} cwd The current working directory. + * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createDefaultIgnore(cwd) { + return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]); + } + + /** + * Create the predicate function from multiple `IgnorePattern` objects. + * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns. + * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createIgnore(ignorePatterns) { + debug$3("Create with: %o", ignorePatterns); + + const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath)); + const patterns = ignorePatterns.flatMap(p => p.getPatternsRelativeTo(basePath)); + const ig = ignore__default["default"]({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]); + const dotIg = ignore__default["default"]({ allowRelativePaths: true }).add(patterns); + + debug$3(" processed: %o", { basePath, patterns }); + + return Object.assign( + (filePath, dot = false) => { + assert__default["default"](path__default["default"].isAbsolute(filePath), "'filePath' should be an absolute path."); + const relPathRaw = relative(basePath, filePath); + const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath)); + const adoptedIg = dot ? dotIg : ig; + const result = relPath !== "" && adoptedIg.ignores(relPath); + + debug$3("Check", { filePath, dot, relativePath: relPath, result }); + return result; + }, + { basePath, patterns } + ); + } + + /** + * Initialize a new `IgnorePattern` instance. + * @param {string[]} patterns The glob patterns that ignore to lint. + * @param {string} basePath The base path of `patterns`. + */ + constructor(patterns, basePath) { + assert__default["default"](path__default["default"].isAbsolute(basePath), "'basePath' should be an absolute path."); + + /** + * The glob patterns that ignore to lint. + * @type {string[]} + */ + this.patterns = patterns; + + /** + * The base path of `patterns`. + * @type {string} + */ + this.basePath = basePath; + + /** + * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`. + * + * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility. + * It's `false` as-is for `ignorePatterns` property in config files. + * @type {boolean} + */ + this.loose = false; + } + + /** + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * @param {string} newBasePath The base path. + * @returns {string[]} Modifired patterns. + */ + getPatternsRelativeTo(newBasePath) { + assert__default["default"](path__default["default"].isAbsolute(newBasePath), "'newBasePath' should be an absolute path."); + const { basePath, loose, patterns } = this; + + if (newBasePath === basePath) { + return patterns; + } + const prefix = `/${relative(newBasePath, basePath)}`; + + return patterns.map(pattern => { + const negative = pattern.startsWith("!"); + const head = negative ? "!" : ""; + const body = negative ? pattern.slice(1) : pattern; + + if (body.startsWith("/") || body.startsWith("../")) { + return `${head}${prefix}${body}`; + } + return loose ? pattern : `${head}${prefix}/**/${body}`; + }); + } +} + +/** + * @fileoverview `ExtractedConfig` class. + * + * `ExtractedConfig` class expresses a final configuration for a specific file. + * + * It provides one method. + * + * - `toCompatibleObjectAsConfigFileContent()` + * Convert this configuration to the compatible object as the content of + * config files. It converts the loaded parser and plugins to strings. + * `CLIEngine#getConfigForFile(filePath)` method uses this method. + * + * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance. + * + * @author Toru Nagashima + */ + +// For VSCode intellisense +/** @typedef {import("../../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").SeverityConf} SeverityConf */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ + +/** + * Check if `xs` starts with `ys`. + * @template T + * @param {T[]} xs The array to check. + * @param {T[]} ys The array that may be the first part of `xs`. + * @returns {boolean} `true` if `xs` starts with `ys`. + */ +function startsWith(xs, ys) { + return xs.length >= ys.length && ys.every((y, i) => y === xs[i]); +} + +/** + * The class for extracted config data. + */ +class ExtractedConfig { + constructor() { + + /** + * The config name what `noInlineConfig` setting came from. + * @type {string} + */ + this.configNameOfNoInlineConfig = ""; + + /** + * Environments. + * @type {Record} + */ + this.env = {}; + + /** + * Global variables. + * @type {Record} + */ + this.globals = {}; + + /** + * The glob patterns that ignore to lint. + * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined} + */ + this.ignores = void 0; + + /** + * The flag that disables directive comments. + * @type {boolean|undefined} + */ + this.noInlineConfig = void 0; + + /** + * Parser definition. + * @type {DependentParser|null} + */ + this.parser = null; + + /** + * Options for the parser. + * @type {Object} + */ + this.parserOptions = {}; + + /** + * Plugin definitions. + * @type {Record} + */ + this.plugins = {}; + + /** + * Processor ID. + * @type {string|null} + */ + this.processor = null; + + /** + * The flag that reports unused `eslint-disable` directive comments. + * @type {boolean|undefined} + */ + this.reportUnusedDisableDirectives = void 0; + + /** + * Rule settings. + * @type {Record} + */ + this.rules = {}; + + /** + * Shared settings. + * @type {Object} + */ + this.settings = {}; + } + + /** + * Convert this config to the compatible object as a config file content. + * @returns {ConfigData} The converted object. + */ + toCompatibleObjectAsConfigFileContent() { + const { + /* eslint-disable no-unused-vars -- needed to make `config` correct */ + configNameOfNoInlineConfig: _ignore1, + processor: _ignore2, + /* eslint-enable no-unused-vars -- needed to make `config` correct */ + ignores, + ...config + } = this; + + config.parser = config.parser && config.parser.filePath; + config.plugins = Object.keys(config.plugins).filter(Boolean).reverse(); + config.ignorePatterns = ignores ? ignores.patterns : []; + + // Strip the default patterns from `ignorePatterns`. + if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) { + config.ignorePatterns = + config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length); + } + + return config; + } +} + +/** + * @fileoverview `ConfigArray` class. + * + * `ConfigArray` class expresses the full of a configuration. It has the entry + * config file, base config files that were extended, loaded parsers, and loaded + * plugins. + * + * `ConfigArray` class provides three properties and two methods. + * + * - `pluginEnvironments` + * - `pluginProcessors` + * - `pluginRules` + * The `Map` objects that contain the members of all plugins that this + * config array contains. Those map objects don't have mutation methods. + * Those keys are the member ID such as `pluginId/memberName`. + * - `isRoot()` + * If `true` then this configuration has `root:true` property. + * - `extractConfig(filePath)` + * Extract the final configuration for a given file. This means merging + * every config array element which that `criteria` property matched. The + * `filePath` argument must be an absolute path. + * + * `ConfigArrayFactory` provides the loading logic of config files. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../../shared/types").Rule} Rule */ +/** @typedef {import("../../shared/types").Plugin} Plugin */ +/** @typedef {import("../../shared/types").Processor} Processor */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {import("./override-tester")["OverrideTester"]} OverrideTester */ + +/** + * @typedef {Object} ConfigArrayElement + * @property {string} name The name of this config element. + * @property {string} filePath The path to the source file of this config element. + * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element. + * @property {Record|undefined} env The environment settings. + * @property {Record|undefined} globals The global variable settings. + * @property {IgnorePattern|undefined} ignorePattern The ignore patterns. + * @property {boolean|undefined} noInlineConfig The flag that disables directive comments. + * @property {DependentParser|undefined} parser The parser loader. + * @property {Object|undefined} parserOptions The parser options. + * @property {Record|undefined} plugins The plugin loaders. + * @property {string|undefined} processor The processor name to refer plugin's processor. + * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments. + * @property {boolean|undefined} root The flag to express root. + * @property {Record|undefined} rules The rule settings + * @property {Object|undefined} settings The shared settings. + * @property {"config" | "ignore" | "implicit-processor"} type The element type. + */ + +/** + * @typedef {Object} ConfigArrayInternalSlots + * @property {Map} cache The cache to extract configs. + * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition. + * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition. + * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition. + */ + +/** @type {WeakMap} */ +const internalSlotsMap$2 = new class extends WeakMap { + get(key) { + let value = super.get(key); + + if (!value) { + value = { + cache: new Map(), + envMap: null, + processorMap: null, + ruleMap: null + }; + super.set(key, value); + } + + return value; + } +}(); + +/** + * Get the indices which are matched to a given file. + * @param {ConfigArrayElement[]} elements The elements. + * @param {string} filePath The path to a target file. + * @returns {number[]} The indices. + */ +function getMatchedIndices(elements, filePath) { + const indices = []; + + for (let i = elements.length - 1; i >= 0; --i) { + const element = elements[i]; + + if (!element.criteria || (filePath && element.criteria.test(filePath))) { + indices.push(i); + } + } + + return indices; +} + +/** + * Check if a value is a non-null object. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(x) { + return typeof x === "object" && x !== null; +} + +/** + * Merge two objects. + * + * Assign every property values of `y` to `x` if `x` doesn't have the property. + * If `x`'s property value is an object, it does recursive. + * @param {Object} target The destination to merge + * @param {Object|undefined} source The source to merge. + * @returns {void} + */ +function mergeWithoutOverwrite(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + + if (isNonNullObject(target[key])) { + mergeWithoutOverwrite(target[key], source[key]); + } else if (target[key] === void 0) { + if (isNonNullObject(source[key])) { + target[key] = Array.isArray(source[key]) ? [] : {}; + mergeWithoutOverwrite(target[key], source[key]); + } else if (source[key] !== void 0) { + target[key] = source[key]; + } + } + } +} + +/** + * The error for plugin conflicts. + */ +class PluginConflictError extends Error { + + /** + * Initialize this error object. + * @param {string} pluginId The plugin ID. + * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins. + */ + constructor(pluginId, plugins) { + super(`Plugin "${pluginId}" was conflicted between ${plugins.map(p => `"${p.importerName}"`).join(" and ")}.`); + this.messageTemplate = "plugin-conflict"; + this.messageData = { pluginId, plugins }; + } +} + +/** + * Merge plugins. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + * @throws {PluginConflictError} When a plugin was conflicted. + */ +function mergePlugins(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetValue = target[key]; + const sourceValue = source[key]; + + // Adopt the plugin which was found at first. + if (targetValue === void 0) { + if (sourceValue.error) { + throw sourceValue.error; + } + target[key] = sourceValue; + } else if (sourceValue.filePath !== targetValue.filePath) { + throw new PluginConflictError(key, [ + { + filePath: targetValue.filePath, + importerName: targetValue.importerName + }, + { + filePath: sourceValue.filePath, + importerName: sourceValue.importerName + } + ]); + } + } +} + +/** + * Merge rule configs. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergeRuleConfigs(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetDef = target[key]; + const sourceDef = source[key]; + + // Adopt the rule config which was found at first. + if (targetDef === void 0) { + if (Array.isArray(sourceDef)) { + target[key] = [...sourceDef]; + } else { + target[key] = [sourceDef]; + } + + /* + * If the first found rule config is severity only and the current rule + * config has options, merge the severity and the options. + */ + } else if ( + targetDef.length === 1 && + Array.isArray(sourceDef) && + sourceDef.length >= 2 + ) { + targetDef.push(...sourceDef.slice(1)); + } + } +} + +/** + * Create the extracted config. + * @param {ConfigArray} instance The config elements. + * @param {number[]} indices The indices to use. + * @returns {ExtractedConfig} The extracted config. + * @throws {Error} When a plugin is conflicted. + */ +function createConfig(instance, indices) { + const config = new ExtractedConfig(); + const ignorePatterns = []; + + // Merge elements. + for (const index of indices) { + const element = instance[index]; + + // Adopt the parser which was found at first. + if (!config.parser && element.parser) { + if (element.parser.error) { + throw element.parser.error; + } + config.parser = element.parser; + } + + // Adopt the processor which was found at first. + if (!config.processor && element.processor) { + config.processor = element.processor; + } + + // Adopt the noInlineConfig which was found at first. + if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) { + config.noInlineConfig = element.noInlineConfig; + config.configNameOfNoInlineConfig = element.name; + } + + // Adopt the reportUnusedDisableDirectives which was found at first. + if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) { + config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives; + } + + // Collect ignorePatterns + if (element.ignorePattern) { + ignorePatterns.push(element.ignorePattern); + } + + // Merge others. + mergeWithoutOverwrite(config.env, element.env); + mergeWithoutOverwrite(config.globals, element.globals); + mergeWithoutOverwrite(config.parserOptions, element.parserOptions); + mergeWithoutOverwrite(config.settings, element.settings); + mergePlugins(config.plugins, element.plugins); + mergeRuleConfigs(config.rules, element.rules); + } + + // Create the predicate function for ignore patterns. + if (ignorePatterns.length > 0) { + config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse()); + } + + return config; +} + +/** + * Collect definitions. + * @template T, U + * @param {string} pluginId The plugin ID for prefix. + * @param {Record} defs The definitions to collect. + * @param {Map} map The map to output. + * @returns {void} + */ +function collect(pluginId, defs, map) { + if (defs) { + const prefix = pluginId && `${pluginId}/`; + + for (const [key, value] of Object.entries(defs)) { + map.set(`${prefix}${key}`, value); + } + } +} + +/** + * Delete the mutation methods from a given map. + * @param {Map} map The map object to delete. + * @returns {void} + */ +function deleteMutationMethods(map) { + Object.defineProperties(map, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + set: { configurable: true, value: void 0 } + }); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArrayElement[]} elements The config elements. + * @param {ConfigArrayInternalSlots} slots The internal slots. + * @returns {void} + */ +function initPluginMemberMaps(elements, slots) { + const processed = new Set(); + + slots.envMap = new Map(); + slots.processorMap = new Map(); + slots.ruleMap = new Map(); + + for (const element of elements) { + if (!element.plugins) { + continue; + } + + for (const [pluginId, value] of Object.entries(element.plugins)) { + const plugin = value.definition; + + if (!plugin || processed.has(pluginId)) { + continue; + } + processed.add(pluginId); + + collect(pluginId, plugin.environments, slots.envMap); + collect(pluginId, plugin.processors, slots.processorMap); + collect(pluginId, plugin.rules, slots.ruleMap); + } + } + + deleteMutationMethods(slots.envMap); + deleteMutationMethods(slots.processorMap); + deleteMutationMethods(slots.ruleMap); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArray} instance The config elements. + * @returns {ConfigArrayInternalSlots} The extracted config. + */ +function ensurePluginMemberMaps(instance) { + const slots = internalSlotsMap$2.get(instance); + + if (!slots.ruleMap) { + initPluginMemberMaps(instance, slots); + } + + return slots; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The Config Array. + * + * `ConfigArray` instance contains all settings, parsers, and plugins. + * You need to call `ConfigArray#extractConfig(filePath)` method in order to + * extract, merge and get only the config data which is related to an arbitrary + * file. + * @extends {Array} + */ +class ConfigArray extends Array { + + /** + * Get the plugin environments. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin environments. + */ + get pluginEnvironments() { + return ensurePluginMemberMaps(this).envMap; + } + + /** + * Get the plugin processors. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin processors. + */ + get pluginProcessors() { + return ensurePluginMemberMaps(this).processorMap; + } + + /** + * Get the plugin rules. + * The returned map cannot be mutated. + * @returns {ReadonlyMap} The plugin rules. + */ + get pluginRules() { + return ensurePluginMemberMaps(this).ruleMap; + } + + /** + * Check if this config has `root` flag. + * @returns {boolean} `true` if this config array is root. + */ + isRoot() { + for (let i = this.length - 1; i >= 0; --i) { + const root = this[i].root; + + if (typeof root === "boolean") { + return root; + } + } + return false; + } + + /** + * Extract the config data which is related to a given file. + * @param {string} filePath The absolute path to the target file. + * @returns {ExtractedConfig} The extracted config data. + */ + extractConfig(filePath) { + const { cache } = internalSlotsMap$2.get(this); + const indices = getMatchedIndices(this, filePath); + const cacheKey = indices.join(","); + + if (!cache.has(cacheKey)) { + cache.set(cacheKey, createConfig(this, indices)); + } + + return cache.get(cacheKey); + } + + /** + * Check if a given path is an additional lint target. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the file is an additional lint target. + */ + isAdditionalTargetPath(filePath) { + for (const { criteria, type } of this) { + if ( + type === "config" && + criteria && + !criteria.endsWithWildcard && + criteria.test(filePath) + ) { + return true; + } + } + return false; + } +} + +/** + * Get the used extracted configs. + * CLIEngine will use this method to collect used deprecated rules. + * @param {ConfigArray} instance The config array object to get. + * @returns {ExtractedConfig[]} The used extracted configs. + * @private + */ +function getUsedExtractedConfigs(instance) { + const { cache } = internalSlotsMap$2.get(instance); + + return Array.from(cache.values()); +} + +/** + * @fileoverview `ConfigDependency` class. + * + * `ConfigDependency` class expresses a loaded parser or plugin. + * + * If the parser or plugin was loaded successfully, it has `definition` property + * and `filePath` property. Otherwise, it has `error` property. + * + * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it + * omits `definition` property. + * + * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers + * or plugins. + * + * @author Toru Nagashima + */ + +/** + * The class is to store parsers or plugins. + * This class hides the loaded object from `JSON.stringify()` and `console.log`. + * @template T + */ +class ConfigDependency { + + /** + * Initialize this instance. + * @param {Object} data The dependency data. + * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {T} [data.original] The original, non-normalized dependency if the loading succeeded. + * @param {Error} [data.error] The error object if the loading failed. + * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. + * @param {string} data.id The ID of this dependency. + * @param {string} data.importerName The name of the config file which loads this dependency. + * @param {string} data.importerPath The path to the config file which loads this dependency. + */ + constructor({ + definition = null, + original = null, + error = null, + filePath = null, + id, + importerName, + importerPath + }) { + + /** + * The loaded dependency if the loading succeeded. + * @type {T|null} + */ + this.definition = definition; + + /** + * The original dependency as loaded directly from disk if the loading succeeded. + * @type {T|null} + */ + this.original = original; + + /** + * The error object if the loading failed. + * @type {Error|null} + */ + this.error = error; + + /** + * The loaded dependency if the loading succeeded. + * @type {string|null} + */ + this.filePath = filePath; + + /** + * The ID of this dependency. + * @type {string} + */ + this.id = id; + + /** + * The name of the config file which loads this dependency. + * @type {string} + */ + this.importerName = importerName; + + /** + * The path to the config file which loads this dependency. + * @type {string} + */ + this.importerPath = importerPath; + } + + /** + * Converts this instance to a JSON compatible object. + * @returns {Object} a JSON compatible object. + */ + toJSON() { + const obj = this[util__default["default"].inspect.custom](); + + // Display `error.message` (`Error#message` is unenumerable). + if (obj.error instanceof Error) { + obj.error = { ...obj.error, message: obj.error.message }; + } + + return obj; + } + + /** + * Custom inspect method for Node.js `console.log()`. + * @returns {Object} an object to display by `console.log()`. + */ + [util__default["default"].inspect.custom]() { + const { + definition: _ignore1, // eslint-disable-line no-unused-vars -- needed to make `obj` correct + original: _ignore2, // eslint-disable-line no-unused-vars -- needed to make `obj` correct + ...obj + } = this; + + return obj; + } +} + +/** + * @fileoverview `OverrideTester` class. + * + * `OverrideTester` class handles `files` property and `excludedFiles` property + * of `overrides` config. + * + * It provides one method. + * + * - `test(filePath)` + * Test if a file path matches the pair of `files` property and + * `excludedFiles` property. The `filePath` argument must be an absolute + * path. + * + * `ConfigArrayFactory` creates `OverrideTester` objects when it processes + * `overrides` properties. + * + * @author Toru Nagashima + */ + +const { Minimatch } = minimatch__default["default"]; + +const minimatchOpts = { dot: true, matchBase: true }; + +/** + * @typedef {Object} Pattern + * @property {InstanceType[] | null} includes The positive matchers. + * @property {InstanceType[] | null} excludes The negative matchers. + */ + +/** + * Normalize a given pattern to an array. + * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns. + * @returns {string[]|null} Normalized patterns. + * @private + */ +function normalizePatterns(patterns) { + if (Array.isArray(patterns)) { + return patterns.filter(Boolean); + } + if (typeof patterns === "string" && patterns) { + return [patterns]; + } + return []; +} + +/** + * Create the matchers of given patterns. + * @param {string[]} patterns The patterns. + * @returns {InstanceType[] | null} The matchers. + */ +function toMatcher(patterns) { + if (patterns.length === 0) { + return null; + } + return patterns.map(pattern => { + if (/^\.[/\\]/u.test(pattern)) { + return new Minimatch( + pattern.slice(2), + + // `./*.js` should not match with `subdir/foo.js` + { ...minimatchOpts, matchBase: false } + ); + } + return new Minimatch(pattern, minimatchOpts); + }); +} + +/** + * Convert a given matcher to string. + * @param {Pattern} matchers The matchers. + * @returns {string} The string expression of the matcher. + */ +function patternToJson({ includes, excludes }) { + return { + includes: includes && includes.map(m => m.pattern), + excludes: excludes && excludes.map(m => m.pattern) + }; +} + +/** + * The class to test given paths are matched by the patterns. + */ +class OverrideTester { + + /** + * Create a tester with given criteria. + * If there are no criteria, returns `null`. + * @param {string|string[]} files The glob patterns for included files. + * @param {string|string[]} excludedFiles The glob patterns for excluded files. + * @param {string} basePath The path to the base directory to test paths. + * @returns {OverrideTester|null} The created instance or `null`. + * @throws {Error} When invalid patterns are given. + */ + static create(files, excludedFiles, basePath) { + const includePatterns = normalizePatterns(files); + const excludePatterns = normalizePatterns(excludedFiles); + let endsWithWildcard = false; + + if (includePatterns.length === 0) { + return null; + } + + // Rejects absolute paths or relative paths to parents. + for (const pattern of includePatterns) { + if (path__default["default"].isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + if (pattern.endsWith("*")) { + endsWithWildcard = true; + } + } + for (const pattern of excludePatterns) { + if (path__default["default"].isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + } + + const includes = toMatcher(includePatterns); + const excludes = toMatcher(excludePatterns); + + return new OverrideTester( + [{ includes, excludes }], + basePath, + endsWithWildcard + ); + } + + /** + * Combine two testers by logical and. + * If either of the testers was `null`, returns the other tester. + * The `basePath` property of the two must be the same value. + * @param {OverrideTester|null} a A tester. + * @param {OverrideTester|null} b Another tester. + * @returns {OverrideTester|null} Combined tester. + */ + static and(a, b) { + if (!b) { + return a && new OverrideTester( + a.patterns, + a.basePath, + a.endsWithWildcard + ); + } + if (!a) { + return new OverrideTester( + b.patterns, + b.basePath, + b.endsWithWildcard + ); + } + + assert__default["default"].strictEqual(a.basePath, b.basePath); + return new OverrideTester( + a.patterns.concat(b.patterns), + a.basePath, + a.endsWithWildcard || b.endsWithWildcard + ); + } + + /** + * Initialize this instance. + * @param {Pattern[]} patterns The matchers. + * @param {string} basePath The base path. + * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`. + */ + constructor(patterns, basePath, endsWithWildcard = false) { + + /** @type {Pattern[]} */ + this.patterns = patterns; + + /** @type {string} */ + this.basePath = basePath; + + /** @type {boolean} */ + this.endsWithWildcard = endsWithWildcard; + } + + /** + * Test if a given path is matched or not. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the path was matched. + * @throws {Error} When invalid `filePath` is given. + */ + test(filePath) { + if (typeof filePath !== "string" || !path__default["default"].isAbsolute(filePath)) { + throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`); + } + const relativePath = path__default["default"].relative(this.basePath, filePath); + + return this.patterns.every(({ includes, excludes }) => ( + (!includes || includes.some(m => m.match(relativePath))) && + (!excludes || !excludes.some(m => m.match(relativePath))) + )); + } + + /** + * Converts this instance to a JSON compatible object. + * @returns {Object} a JSON compatible object. + */ + toJSON() { + if (this.patterns.length === 1) { + return { + ...patternToJson(this.patterns[0]), + basePath: this.basePath + }; + } + return { + AND: this.patterns.map(patternToJson), + basePath: this.basePath + }; + } + + /** + * Custom inspect method for Node.js `console.log()`. + * @returns {Object} an object to display by `console.log()`. + */ + [util__default["default"].inspect.custom]() { + return this.toJSON(); + } +} + +/** + * @fileoverview `ConfigArray` class. + * @author Toru Nagashima + */ + +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = new Set([0, 1, 2, "off", "warn", "error"]); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.has(severity); +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +var ConfigOps = { + __proto__: null, + getRuleSeverity: getRuleSeverity, + normalizeToStrings: normalizeToStrings, + isErrorSeverity: isErrorSeverity, + isValidSeverity: isValidSeverity, + isEverySeverityValid: isEverySeverityValid, + normalizeConfigGlobal: normalizeConfigGlobal +}; + +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path__default["default"].relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +var ajvOrig = (additionalOptions = {}) => { + const ajv = new Ajv__default["default"]({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle -- part of the API + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; + +/** + * @fileoverview Applies default rule options + * @author JoshuaKGoldberg + */ + +/** + * Check if the variable contains an object strictly rejecting arrays + * @param {unknown} value an object + * @returns {boolean} Whether value is an object + */ +function isObjectNotArray(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + +/** + * Deeply merges second on top of first, creating a new {} object if needed. + * @param {T} first Base, default value. + * @param {U} second User-specified value. + * @returns {T | U | (T & U)} Merged equivalent of second on top of first. + */ +function deepMergeObjects(first, second) { + if (second === void 0) { + return first; + } + + if (!isObjectNotArray(first) || !isObjectNotArray(second)) { + return second; + } + + const result = { ...first, ...second }; + + for (const key of Object.keys(second)) { + if (Object.prototype.propertyIsEnumerable.call(first, key)) { + result[key] = deepMergeObjects(first[key], second[key]); + } + } + + return result; +} + +/** + * Deeply merges second on top of first, creating a new [] array if needed. + * @param {T[] | undefined} first Base, default values. + * @param {U[] | undefined} second User-specified values. + * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first. + */ +function deepMergeArrays(first, second) { + if (!first || !second) { + return second || first || []; + } + + return [ + ...first.map((value, i) => deepMergeObjects(value, second[i])), + ...second.slice(first.length) + ]; +} + +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +const baseConfigProperties = { + $schema: { type: "string" }, + env: { type: "object" }, + extends: { $ref: "#/definitions/stringOrStrings" }, + globals: { type: "object" }, + overrides: { + type: "array", + items: { $ref: "#/definitions/overrideConfig" }, + additionalItems: false + }, + parser: { type: ["string", "null"] }, + parserOptions: { type: "object" }, + plugins: { type: "array" }, + processor: { type: "string" }, + rules: { type: "object" }, + settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, + reportUnusedDisableDirectives: { type: "boolean" }, + + ecmaFeatures: { type: "object" } // deprecated; logs a warning when used +}; + +const configSchema = { + definitions: { + stringOrStrings: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false + } + ] + }, + stringOrStringsRequired: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false, + minItems: 1 + } + ] + }, + + // Config at top-level. + objectConfig: { + type: "object", + properties: { + root: { type: "boolean" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...baseConfigProperties + }, + additionalProperties: false + }, + + // Config in `overrides`. + overrideConfig: { + type: "object", + properties: { + excludedFiles: { $ref: "#/definitions/stringOrStrings" }, + files: { $ref: "#/definitions/stringOrStringsRequired" }, + ...baseConfigProperties + }, + required: ["files"], + additionalProperties: false + } + }, + + $ref: "#/definitions/objectConfig" +}; + +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwn(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +var environments = new Map(Object.entries({ + + // Language + builtin: { + globals: globals__default["default"].es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + es2023: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 14 + } + }, + es2024: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 15 + } + }, + + // Platforms + browser: { + globals: globals__default["default"].browser + }, + node: { + globals: globals__default["default"].node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals__default["default"]["shared-node-browser"] + }, + worker: { + globals: globals__default["default"].worker + }, + serviceworker: { + globals: globals__default["default"].serviceworker + }, + + // Frameworks + commonjs: { + globals: globals__default["default"].commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals__default["default"].amd + }, + mocha: { + globals: globals__default["default"].mocha + }, + jasmine: { + globals: globals__default["default"].jasmine + }, + jest: { + globals: globals__default["default"].jest + }, + phantomjs: { + globals: globals__default["default"].phantomjs + }, + jquery: { + globals: globals__default["default"].jquery + }, + qunit: { + globals: globals__default["default"].qunit + }, + prototypejs: { + globals: globals__default["default"].prototypejs + }, + shelljs: { + globals: globals__default["default"].shelljs + }, + meteor: { + globals: globals__default["default"].meteor + }, + mongo: { + globals: globals__default["default"].mongo + }, + protractor: { + globals: globals__default["default"].protractor + }, + applescript: { + globals: globals__default["default"].applescript + }, + nashorn: { + globals: globals__default["default"].nashorn + }, + atomtest: { + globals: globals__default["default"].atomtest + }, + embertest: { + globals: globals__default["default"].embertest + }, + webextensions: { + globals: globals__default["default"].webextensions + }, + greasemonkey: { + globals: globals__default["default"].greasemonkey + } +})); + +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +const ajv = ajvOrig(); + +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +// JSON schema that disallows passing any options +const noOptionsSchema = Object.freeze({ + type: "array", + minItems: 0, + maxItems: 0 +}); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Validator for configuration objects. + */ +class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {Rule} rule A rule object + * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`. + * @returns {Object|null} JSON Schema for the rule's options. + * `null` if rule wasn't passed or its `meta.schema` is `false`. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + if (!rule.meta) { + return { ...noOptionsSchema }; // default if `meta.schema` is not specified + } + + const schema = rule.meta.schema; + + if (typeof schema === "undefined") { + return { ...noOptionsSchema }; // default if `meta.schema` is not specified + } + + // `schema:false` is an allowed explicit opt-out of options validation for the rule + if (schema === false) { + return null; + } + + if (typeof schema !== "object" || schema === null) { + throw new TypeError("Rule's `meta.schema` must be an array or object"); + } + + // ESLint-specific array form needs to be converted into a valid JSON Schema definition + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + + // `schema:[]` is an explicit way to specify that the rule does not accept any options + return { ...noOptionsSchema }; + } + + // `schema:` is assumed to be a valid JSON Schema definition + return schema; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + * @throws {Error} If the severity is invalid. + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + * @throws {Error} If the options are invalid. + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + try { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } catch (err) { + const errorWithCode = new Error(err.message, { cause: err }); + + errorWithCode.code = "ESLINT_INVALID_RULE_OPTIONS_SCHEMA"; + + throw errorWithCode; + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, localOptions); + + validateRule(mergedOptions); + + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + * @throws {Error} If the options are invalid. + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + let enhancedMessage = err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA" + ? `Error while processing options validation schema of rule '${ruleId}': ${err.message}` + : `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + enhancedMessage = `${source}:\n\t${enhancedMessage}`; + } + + const enhancedError = new Error(enhancedMessage, { cause: err }); + + if (err.code) { + enhancedError.code = err.code; + } + + throw enhancedError; + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + * @throws {Error} If the environment is invalid. + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || environments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {(id:string) => Processor} getProcessor The getter of defined processors. + * @returns {void} + * @throws {Error} If the processor is invalid. + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + * @throws {Error} If the config is invalid. + */ + validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwn(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +} + +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +var naming = { + __proto__: null, + normalizePackageName: normalizePackageName, + getShorthandName: getShorthandName, + getNamespaceFromTerm: getNamespaceFromTerm +}; + +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +const createRequire = Module__default["default"].createRequire; + +/** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + * @throws {Error} When the module cannot be resolved. + */ +function resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } +} + +var ModuleResolver = { + __proto__: null, + resolve: resolve +}; + +/** + * @fileoverview The factory of `ConfigArray` objects. + * + * This class provides methods to create `ConfigArray` instance. + * + * - `create(configData, options)` + * Create a `ConfigArray` instance from a config data. This is to handle CLI + * options except `--config`. + * - `loadFile(filePath, options)` + * Create a `ConfigArray` instance from a config file. This is to handle + * `--config` option. If the file was not found, throws the following error: + * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error. + * - If the filename was `package.json`, an IO error or an + * `ESLINT_CONFIG_FIELD_NOT_FOUND` error. + * - Otherwise, an IO error such as `ENOENT`. + * - `loadInDirectory(directoryPath, options)` + * Create a `ConfigArray` instance from a config file which is on a given + * directory. This tries to load `.eslintrc.*` or `package.json`. If not + * found, returns an empty `ConfigArray`. + * - `loadESLintIgnore(filePath)` + * Create a `ConfigArray` instance from a config file that is `.eslintignore` + * format. This is to handle `--ignore-path` option. + * - `loadDefaultESLintIgnore()` + * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in + * the current working directory. + * + * `ConfigArrayFactory` class has the responsibility that loads configuration + * files, including loading `extends`, `parser`, and `plugins`. The created + * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`. + * + * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class + * handles cascading and hierarchy. + * + * @author Toru Nagashima + */ + +const require$1 = Module.createRequire(require('url').pathToFileURL(__filename).toString()); + +const debug$2 = debugOrig__default["default"]("eslintrc:config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const configFilenames = [ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json", + ".eslintrc", + "package.json" +]; + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").OverrideConfigData} OverrideConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {import("./config-array/config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-array/config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {ConfigArray[0]} ConfigArrayElement */ + +/** + * @typedef {Object} ConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {string} [cwd] The path to the current working directory. + * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cwd The path to the current working directory. + * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {string} pluginBasePath The base path to resolve plugins. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** @type {WeakMap} */ +const internalSlotsMap$1 = new WeakMap(); + +/** @type {WeakMap} */ +const normalizedPlugins = new WeakMap(); + +/** + * Check if a given string is a file path. + * @param {string} nameOrPath A module name or file path. + * @returns {boolean} `true` if the `nameOrPath` is a file path. + */ +function isFilePath(nameOrPath) { + return ( + /^\.{1,2}[/\\]/u.test(nameOrPath) || + path__default["default"].isAbsolute(nameOrPath) + ); +} + +/** + * Convenience wrapper for synchronously reading file contents. + * @param {string} filePath The filename to read. + * @returns {string} The file contents, with the BOM removed. + * @private + */ +function readFile(filePath) { + return fs__default["default"].readFileSync(filePath, "utf8").replace(/^\ufeff/u, ""); +} + +/** + * Loads a YAML configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadYAMLConfigFile(filePath) { + debug$2(`Loading YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require$1("js-yaml"); + + try { + + // empty YAML file can be null, so always use + return yaml.load(readFile(filePath)) || {}; + } catch (e) { + debug$2(`Error reading YAML file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JSON configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSONConfigFile(filePath) { + debug$2(`Loading JSON config file: ${filePath}`); + + try { + return JSON.parse(stripComments__default["default"](readFile(filePath))); + } catch (e) { + debug$2(`Error reading JSON file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + e.messageTemplate = "failed-to-read-json"; + e.messageData = { + path: filePath, + message: e.message + }; + throw e; + } +} + +/** + * Loads a legacy (.eslintrc) configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadLegacyConfigFile(filePath) { + debug$2(`Loading legacy config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require$1("js-yaml"); + + try { + return yaml.load(stripComments__default["default"](readFile(filePath))) || /* istanbul ignore next */ {}; + } catch (e) { + debug$2("Error reading YAML file: %s\n%o", filePath, e); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JavaScript configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSConfigFile(filePath) { + debug$2(`Loading JS config file: ${filePath}`); + try { + return importFresh__default["default"](filePath); + } catch (e) { + debug$2(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a configuration from a package.json file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadPackageJSONConfigFile(filePath) { + debug$2(`Loading package.json config file: ${filePath}`); + try { + const packageData = loadJSONConfigFile(filePath); + + if (!Object.hasOwn(packageData, "eslintConfig")) { + throw Object.assign( + new Error("package.json file doesn't have 'eslintConfig' field."), + { code: "ESLINT_CONFIG_FIELD_NOT_FOUND" } + ); + } + + return packageData.eslintConfig; + } catch (e) { + debug$2(`Error reading package.json file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a `.eslintignore` from a file. + * @param {string} filePath The filename to load. + * @returns {string[]} The ignore patterns from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadESLintIgnoreFile(filePath) { + debug$2(`Loading .eslintignore file: ${filePath}`); + + try { + return readFile(filePath) + .split(/\r?\n/gu) + .filter(line => line.trim() !== "" && !line.startsWith("#")); + } catch (e) { + debug$2(`Error reading .eslintignore file: ${filePath}`); + e.message = `Cannot read .eslintignore file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Creates an error to notify about a missing config to extend from. + * @param {string} configName The name of the missing config. + * @param {string} importerName The name of the config that imported the missing config + * @param {string} messageTemplate The text template to source error strings from. + * @returns {Error} The error object to throw + * @private + */ +function configInvalidError(configName, importerName, messageTemplate) { + return Object.assign( + new Error(`Failed to load config "${configName}" to extend from.`), + { + messageTemplate, + messageData: { configName, importerName } + } + ); +} + +/** + * Loads a configuration file regardless of the source. Inspects the file path + * to determine the correctly way to load the config file. + * @param {string} filePath The path to the configuration. + * @returns {ConfigData|null} The configuration information. + * @private + */ +function loadConfigFile(filePath) { + switch (path__default["default"].extname(filePath)) { + case ".js": + case ".cjs": + return loadJSConfigFile(filePath); + + case ".json": + if (path__default["default"].basename(filePath) === "package.json") { + return loadPackageJSONConfigFile(filePath); + } + return loadJSONConfigFile(filePath); + + case ".yaml": + case ".yml": + return loadYAMLConfigFile(filePath); + + default: + return loadLegacyConfigFile(filePath); + } +} + +/** + * Write debug log. + * @param {string} request The requested module name. + * @param {string} relativeTo The file path to resolve the request relative to. + * @param {string} filePath The resolved file path. + * @returns {void} + */ +function writeDebugLogForLoading(request, relativeTo, filePath) { + /* istanbul ignore next */ + if (debug$2.enabled) { + let nameAndVersion = null; // eslint-disable-line no-useless-assignment -- known bug in the rule + + try { + const packageJsonPath = resolve( + `${request}/package.json`, + relativeTo + ); + const { version = "unknown" } = require$1(packageJsonPath); + + nameAndVersion = `${request}@${version}`; + } catch (error) { + debug$2("package.json was not found:", error.message); + nameAndVersion = request; + } + + debug$2("Loaded: %s (%s)", nameAndVersion, filePath); + } +} + +/** + * Create a new context with default values. + * @param {ConfigArrayFactoryInternalSlots} slots The internal slots. + * @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`. + * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`. + * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string. + * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`. + * @returns {ConfigArrayFactoryLoadingContext} The created context. + */ +function createContext( + { cwd, resolvePluginsRelativeTo }, + providedType, + providedName, + providedFilePath, + providedMatchBasePath +) { + const filePath = providedFilePath + ? path__default["default"].resolve(cwd, providedFilePath) + : ""; + const matchBasePath = + (providedMatchBasePath && path__default["default"].resolve(cwd, providedMatchBasePath)) || + (filePath && path__default["default"].dirname(filePath)) || + cwd; + const name = + providedName || + (filePath && path__default["default"].relative(cwd, filePath)) || + ""; + const pluginBasePath = + resolvePluginsRelativeTo || + (filePath && path__default["default"].dirname(filePath)) || + cwd; + const type = providedType || "config"; + + return { filePath, matchBasePath, name, pluginBasePath, type }; +} + +/** + * Normalize a given plugin. + * - Ensure the object to have four properties: configs, environments, processors, and rules. + * - Ensure the object to not have other properties. + * @param {Plugin} plugin The plugin to normalize. + * @returns {Plugin} The normalized plugin. + */ +function normalizePlugin(plugin) { + + // first check the cache + let normalizedPlugin = normalizedPlugins.get(plugin); + + if (normalizedPlugin) { + return normalizedPlugin; + } + + normalizedPlugin = { + configs: plugin.configs || {}, + environments: plugin.environments || {}, + processors: plugin.processors || {}, + rules: plugin.rules || {} + }; + + // save the reference for later + normalizedPlugins.set(plugin, normalizedPlugin); + + return normalizedPlugin; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The factory of `ConfigArray` objects. + */ +class ConfigArrayFactory { + + /** + * Initialize this instance. + * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins. + */ + constructor({ + additionalPluginPool = new Map(), + cwd = process.cwd(), + resolvePluginsRelativeTo, + builtInRules, + resolver = ModuleResolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = {}) { + internalSlotsMap$1.set(this, { + additionalPluginPool, + cwd, + resolvePluginsRelativeTo: + resolvePluginsRelativeTo && + path__default["default"].resolve(cwd, resolvePluginsRelativeTo), + builtInRules, + resolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + }); + } + + /** + * Create `ConfigArray` instance from a config data. + * @param {ConfigData|null} configData The config data to create. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.filePath] The path to this config data. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + create(configData, { basePath, filePath, name } = {}) { + if (!configData) { + return new ConfigArray(); + } + + const slots = internalSlotsMap$1.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + const elements = this._normalizeConfigData(configData, ctx); + + return new ConfigArray(...elements); + } + + /** + * Load a config file. + * @param {string} filePath The path to a config file. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + loadFile(filePath, { basePath, name } = {}) { + const slots = internalSlotsMap$1.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + + return new ConfigArray(...this._loadConfigData(ctx)); + } + + /** + * Load the config file on a given directory if exists. + * @param {string} directoryPath The path to a directory. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @throws {Error} If the config file is invalid. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadInDirectory(directoryPath, { basePath, name } = {}) { + const slots = internalSlotsMap$1.get(this); + + for (const filename of configFilenames) { + const ctx = createContext( + slots, + "config", + name, + path__default["default"].join(directoryPath, filename), + basePath + ); + + if (fs__default["default"].existsSync(ctx.filePath) && fs__default["default"].statSync(ctx.filePath).isFile()) { + let configData; + + try { + configData = loadConfigFile(ctx.filePath); + } catch (error) { + if (!error || error.code !== "ESLINT_CONFIG_FIELD_NOT_FOUND") { + throw error; + } + } + + if (configData) { + debug$2(`Config file found: ${ctx.filePath}`); + return new ConfigArray( + ...this._normalizeConfigData(configData, ctx) + ); + } + } + } + + debug$2(`Config file not found on ${directoryPath}`); + return new ConfigArray(); + } + + /** + * Check if a config file on a given directory exists or not. + * @param {string} directoryPath The path to a directory. + * @returns {string | null} The path to the found config file. If not found then null. + */ + static getPathToConfigFileInDirectory(directoryPath) { + for (const filename of configFilenames) { + const filePath = path__default["default"].join(directoryPath, filename); + + if (fs__default["default"].existsSync(filePath)) { + if (filename === "package.json") { + try { + loadPackageJSONConfigFile(filePath); + return filePath; + } catch { /* ignore */ } + } else { + return filePath; + } + } + } + return null; + } + + /** + * Load `.eslintignore` file. + * @param {string} filePath The path to a `.eslintignore` file to load. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadESLintIgnore(filePath) { + const slots = internalSlotsMap$1.get(this); + const ctx = createContext( + slots, + "ignore", + void 0, + filePath, + slots.cwd + ); + const ignorePatterns = loadESLintIgnoreFile(ctx.filePath); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(ignorePatterns, ctx) + ); + } + + /** + * Load `.eslintignore` file in the current working directory. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + * @throws {Error} If the ignore file is invalid. + */ + loadDefaultESLintIgnore() { + const slots = internalSlotsMap$1.get(this); + const eslintIgnorePath = path__default["default"].resolve(slots.cwd, ".eslintignore"); + const packageJsonPath = path__default["default"].resolve(slots.cwd, "package.json"); + + if (fs__default["default"].existsSync(eslintIgnorePath)) { + return this.loadESLintIgnore(eslintIgnorePath); + } + if (fs__default["default"].existsSync(packageJsonPath)) { + const data = loadJSONConfigFile(packageJsonPath); + + if (Object.hasOwn(data, "eslintIgnore")) { + if (!Array.isArray(data.eslintIgnore)) { + throw new Error("Package.json eslintIgnore property requires an array of paths"); + } + const ctx = createContext( + slots, + "ignore", + "eslintIgnore in package.json", + packageJsonPath, + slots.cwd + ); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx) + ); + } + } + + return new ConfigArray(); + } + + /** + * Load a given config file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} Loaded config. + * @private + */ + _loadConfigData(ctx) { + return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx); + } + + /** + * Normalize a given `.eslintignore` data to config array elements. + * @param {string[]} ignorePatterns The patterns to ignore files. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeESLintIgnoreData(ignorePatterns, ctx) { + const elements = this._normalizeObjectConfigData( + { ignorePatterns }, + ctx + ); + + // Set `ignorePattern.loose` flag for backward compatibility. + for (const element of elements) { + if (element.ignorePattern) { + element.ignorePattern.loose = true; + } + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _normalizeConfigData(configData, ctx) { + const validator = new ConfigValidator(); + + validator.validateConfigSchema(configData, ctx.name || ctx.filePath); + return this._normalizeObjectConfigData(configData, ctx); + } + + /** + * Normalize a given config to an array. + * @param {ConfigData|OverrideConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigData(configData, ctx) { + const { files, excludedFiles, ...configBody } = configData; + const criteria = OverrideTester.create( + files, + excludedFiles, + ctx.matchBasePath + ); + const elements = this._normalizeObjectConfigDataBody(configBody, ctx); + + // Apply the criteria to every element. + for (const element of elements) { + + /* + * Merge the criteria. + * This is for the `overrides` entries that came from the + * configurations of `overrides[].extends`. + */ + element.criteria = OverrideTester.and(criteria, element.criteria); + + /* + * Remove `root` property to ignore `root` settings which came from + * `extends` in `overrides`. + */ + if (element.criteria) { + element.root = void 0; + } + + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigDataBody( + { + env, + extends: extend, + globals, + ignorePatterns, + noInlineConfig, + parser: parserName, + parserOptions, + plugins: pluginList, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings, + overrides: overrideList = [] + }, + ctx + ) { + const extendList = Array.isArray(extend) ? extend : [extend]; + const ignorePattern = ignorePatterns && new IgnorePattern( + Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns], + ctx.matchBasePath + ); + + // Flatten `extends`. + for (const extendName of extendList.filter(Boolean)) { + yield* this._loadExtends(extendName, ctx); + } + + // Load parser & plugins. + const parser = parserName && this._loadParser(parserName, ctx); + const plugins = pluginList && this._loadPlugins(pluginList, ctx); + + // Yield pseudo config data for file extension processors. + if (plugins) { + yield* this._takeFileExtensionProcessors(plugins, ctx); + } + + // Yield the config data except `extends` and `overrides`. + yield { + + // Debug information. + type: ctx.type, + name: ctx.name, + filePath: ctx.filePath, + + // Config data. + criteria: null, + env, + globals, + ignorePattern, + noInlineConfig, + parser, + parserOptions, + plugins, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings + }; + + // Flatten `overries`. + for (let i = 0; i < overrideList.length; ++i) { + yield* this._normalizeObjectConfigData( + overrideList[i], + { ...ctx, name: `${ctx.name}#overrides[${i}]` } + ); + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @throws {Error} If the extended config file can't be loaded. + * @private + */ + _loadExtends(extendName, ctx) { + debug$2("Loading {extends:%j} relative to %s", extendName, ctx.filePath); + try { + if (extendName.startsWith("eslint:")) { + return this._loadExtendedBuiltInConfig(extendName, ctx); + } + if (extendName.startsWith("plugin:")) { + return this._loadExtendedPluginConfig(extendName, ctx); + } + return this._loadExtendedShareableConfig(extendName, ctx); + } catch (error) { + error.message += `\nReferenced from: ${ctx.filePath || ctx.name}`; + throw error; + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @throws {Error} If the extended config file can't be loaded. + * @private + */ + _loadExtendedBuiltInConfig(extendName, ctx) { + const { + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = internalSlotsMap$1.get(this); + + if (extendName === "eslint:recommended") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintRecommendedConfig) { + if (typeof getEslintRecommendedConfig !== "function") { + throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`); + } + return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintRecommendedPath + }); + } + if (extendName === "eslint:all") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintAllConfig) { + if (typeof getEslintAllConfig !== "function") { + throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`); + } + return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintAllPath + }); + } + + throw configInvalidError(extendName, ctx.name, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @throws {Error} If the extended config file can't be loaded. + * @private + */ + _loadExtendedPluginConfig(extendName, ctx) { + const slashIndex = extendName.lastIndexOf("/"); + + if (slashIndex === -1) { + throw configInvalidError(extendName, ctx.filePath, "plugin-invalid"); + } + + const pluginName = extendName.slice("plugin:".length, slashIndex); + const configName = extendName.slice(slashIndex + 1); + + if (isFilePath(pluginName)) { + throw new Error("'extends' cannot use a file path for plugins."); + } + + const plugin = this._loadPlugin(pluginName, ctx); + const configData = + plugin.definition && + plugin.definition.configs[configName]; + + if (configData) { + return this._normalizeConfigData(configData, { + ...ctx, + filePath: plugin.filePath || ctx.filePath, + name: `${ctx.name} » plugin:${plugin.id}/${configName}` + }); + } + + throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @throws {Error} If the extended config file can't be loaded. + * @private + */ + _loadExtendedShareableConfig(extendName, ctx) { + const { cwd, resolver } = internalSlotsMap$1.get(this); + const relativeTo = ctx.filePath || path__default["default"].join(cwd, "__placeholder__.js"); + let request; + + if (isFilePath(extendName)) { + request = extendName; + } else if (extendName.startsWith(".")) { + request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior. + } else { + request = normalizePackageName( + extendName, + "eslint-config" + ); + } + + let filePath; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (error) { + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + throw configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + throw error; + } + + writeDebugLogForLoading(request, relativeTo, filePath); + return this._loadConfigData({ + ...ctx, + filePath, + name: `${ctx.name} » ${request}` + }); + } + + /** + * Load given plugins. + * @param {string[]} names The plugin names to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {Record} The loaded parser. + * @private + */ + _loadPlugins(names, ctx) { + return names.reduce((map, name) => { + if (isFilePath(name)) { + throw new Error("Plugins array cannot includes file paths."); + } + const plugin = this._loadPlugin(name, ctx); + + map[plugin.id] = plugin; + + return map; + }, {}); + } + + /** + * Load a given parser. + * @param {string} nameOrPath The package name or the path to a parser file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentParser} The loaded parser. + */ + _loadParser(nameOrPath, ctx) { + debug$2("Loading parser %j from %s", nameOrPath, ctx.filePath); + + const { cwd, resolver } = internalSlotsMap$1.get(this); + const relativeTo = ctx.filePath || path__default["default"].join(cwd, "__placeholder__.js"); + + try { + const filePath = resolver.resolve(nameOrPath, relativeTo); + + writeDebugLogForLoading(nameOrPath, relativeTo, filePath); + + return new ConfigDependency({ + definition: require$1(filePath), + filePath, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (error) { + + // If the parser name is "espree", load the espree of ESLint. + if (nameOrPath === "espree") { + debug$2("Fallback espree."); + return new ConfigDependency({ + definition: require$1("espree"), + filePath: require$1.resolve("espree"), + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + debug$2("Failed to load parser '%s' declared in '%s'.", nameOrPath, ctx.name); + error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`; + + return new ConfigDependency({ + error, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + } + + /** + * Load a given plugin. + * @param {string} name The plugin name to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentPlugin} The loaded plugin. + * @private + */ + _loadPlugin(name, ctx) { + debug$2("Loading plugin %j from %s", name, ctx.filePath); + + const { additionalPluginPool, resolver } = internalSlotsMap$1.get(this); + const request = normalizePackageName(name, "eslint-plugin"); + const id = getShorthandName(request, "eslint-plugin"); + const relativeTo = path__default["default"].join(ctx.pluginBasePath, "__placeholder__.js"); + + if (name.match(/\s+/u)) { + const error = Object.assign( + new Error(`Whitespace found in plugin name '${name}'`), + { + messageTemplate: "whitespace-found", + messageData: { pluginName: request } + } + ); + + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + // Check for additional pool. + const plugin = + additionalPluginPool.get(request) || + additionalPluginPool.get(id); + + if (plugin) { + return new ConfigDependency({ + definition: normalizePlugin(plugin), + original: plugin, + filePath: "", // It's unknown where the plugin came from. + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + let filePath; + let error; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (resolveError) { + error = resolveError; + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + error.messageTemplate = "plugin-missing"; + error.messageData = { + pluginName: request, + resolvePluginsRelativeTo: ctx.pluginBasePath, + importerName: ctx.name + }; + } + } + + if (filePath) { + try { + writeDebugLogForLoading(request, relativeTo, filePath); + + const startTime = Date.now(); + const pluginDefinition = require$1(filePath); + + debug$2(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`); + + return new ConfigDependency({ + definition: normalizePlugin(pluginDefinition), + original: pluginDefinition, + filePath, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (loadError) { + error = loadError; + } + } + + debug$2("Failed to load plugin '%s' declared in '%s'.", name, ctx.name); + error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`; + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + /** + * Take file expression processors as config array elements. + * @param {Record} plugins The plugin definitions. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The config array elements of file expression processors. + * @private + */ + *_takeFileExtensionProcessors(plugins, ctx) { + for (const pluginId of Object.keys(plugins)) { + const processors = + plugins[pluginId] && + plugins[pluginId].definition && + plugins[pluginId].definition.processors; + + if (!processors) { + continue; + } + + for (const processorId of Object.keys(processors)) { + if (processorId.startsWith(".")) { + yield* this._normalizeObjectConfigData( + { + files: [`*${processorId}`], + processor: `${pluginId}/${processorId}` + }, + { + ...ctx, + type: "implicit-processor", + name: `${ctx.name}#processors["${pluginId}/${processorId}"]` + } + ); + } + } + } + } +} + +/** + * @fileoverview `CascadingConfigArrayFactory` class. + * + * `CascadingConfigArrayFactory` class has a responsibility: + * + * 1. Handles cascading of config files. + * + * It provides two methods: + * + * - `getConfigArrayForFile(filePath)` + * Get the corresponded configuration of a given file. This method doesn't + * throw even if the given file didn't exist. + * - `clearCache()` + * Clear the internal cache. You have to call this method when + * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends + * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.) + * + * @author Toru Nagashima + */ + +const debug$1 = debugOrig__default["default"]("eslintrc:cascading-config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {ConfigData} [baseConfig] The config by `baseConfig` option. + * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files. + * @property {string} [cwd] The base directory to start lookup. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + * @property {string} [specificConfigPath] The value of `--config` option. + * @property {boolean} [useEslintrc] if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryInternalSlots + * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option. + * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`. + * @property {ConfigArray} cliConfigArray The config array of CLI options. + * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`. + * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {Map} configCache The cache from directory paths to config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`. + * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`. + * @property {boolean} useEslintrc if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Create the config array from `baseConfig` and `rulePaths`. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createBaseConfigArray({ + configArrayFactory, + baseConfigData, + rulePaths, + cwd, + loadRules +}) { + const baseConfigArray = configArrayFactory.create( + baseConfigData, + { name: "BaseConfig" } + ); + + /* + * Create the config array element for the default ignore patterns. + * This element has `ignorePattern` property that ignores the default + * patterns in the current working directory. + */ + baseConfigArray.unshift(configArrayFactory.create( + { ignorePatterns: IgnorePattern.DefaultPatterns }, + { name: "DefaultIgnorePattern" } + )[0]); + + /* + * Load rules `--rulesdir` option as a pseudo plugin. + * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate + * the rule's options with only information in the config array. + */ + if (rulePaths && rulePaths.length > 0) { + baseConfigArray.push({ + type: "config", + name: "--rulesdir", + filePath: "", + plugins: { + "": new ConfigDependency({ + definition: { + rules: rulePaths.reduce( + (map, rulesPath) => Object.assign( + map, + loadRules(rulesPath, cwd) + ), + {} + ) + }, + filePath: "", + id: "", + importerName: "--rulesdir", + importerPath: "" + }) + } + }); + } + + return baseConfigArray; +} + +/** + * Create the config array from CLI options. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath +}) { + const cliConfigArray = configArrayFactory.create( + cliConfigData, + { name: "CLIOptions" } + ); + + cliConfigArray.unshift( + ...(ignorePath + ? configArrayFactory.loadESLintIgnore(ignorePath) + : configArrayFactory.loadDefaultESLintIgnore()) + ); + + if (specificConfigPath) { + cliConfigArray.unshift( + ...configArrayFactory.loadFile( + specificConfigPath, + { name: "--config", basePath: cwd } + ) + ); + } + + return cliConfigArray; +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class ConfigurationNotFoundError extends Error { + + + /** + * @param {string} directoryPath The directory path. + */ + constructor(directoryPath) { + super(`No ESLint configuration found in ${directoryPath}.`); + this.messageTemplate = "no-config-found"; + this.messageData = { directoryPath }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class CascadingConfigArrayFactory { + + /** + * Initialize this enumerator. + * @param {CascadingConfigArrayFactoryOptions} options The options. + */ + constructor({ + additionalPluginPool = new Map(), + baseConfig: baseConfigData = null, + cliConfig: cliConfigData = null, + cwd = process.cwd(), + ignorePath, + resolvePluginsRelativeTo, + rulePaths = [], + specificConfigPath = null, + useEslintrc = true, + builtInRules = new Map(), + loadRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + } = {}) { + const configArrayFactory = new ConfigArrayFactory({ + additionalPluginPool, + cwd, + resolvePluginsRelativeTo, + builtInRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + }); + + internalSlotsMap.set(this, { + baseConfigArray: createBaseConfigArray({ + baseConfigData, + configArrayFactory, + cwd, + rulePaths, + loadRules + }), + baseConfigData, + cliConfigArray: createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath + }), + cliConfigData, + configArrayFactory, + configCache: new Map(), + cwd, + finalizeCache: new WeakMap(), + ignorePath, + rulePaths, + specificConfigPath, + useEslintrc, + builtInRules, + loadRules + }); + } + + /** + * The path to the current working directory. + * This is used by tests. + * @type {string} + */ + get cwd() { + const { cwd } = internalSlotsMap.get(this); + + return cwd; + } + + /** + * Get the config array of a given file. + * If `filePath` was not given, it returns the config which contains only + * `baseConfigData` and `cliConfigData`. + * @param {string} [filePath] The file path to a file. + * @param {Object} [options] The options. + * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The config array of the file. + */ + getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) { + const { + baseConfigArray, + cliConfigArray, + cwd + } = internalSlotsMap.get(this); + + if (!filePath) { + return new ConfigArray(...baseConfigArray, ...cliConfigArray); + } + + const directoryPath = path__default["default"].dirname(path__default["default"].resolve(cwd, filePath)); + + debug$1(`Load config files for ${directoryPath}.`); + + return this._finalizeConfigArray( + this._loadConfigInAncestors(directoryPath), + directoryPath, + ignoreNotFoundError + ); + } + + /** + * Set the config data to override all configs. + * Require to call `clearCache()` method after this method is called. + * @param {ConfigData} configData The config data to override all configs. + * @returns {void} + */ + setOverrideConfig(configData) { + const slots = internalSlotsMap.get(this); + + slots.cliConfigData = configData; + } + + /** + * Clear config cache. + * @returns {void} + */ + clearCache() { + const slots = internalSlotsMap.get(this); + + slots.baseConfigArray = createBaseConfigArray(slots); + slots.cliConfigArray = createCLIConfigArray(slots); + slots.configCache.clear(); + } + + /** + * Load and normalize config files from the ancestor directories. + * @param {string} directoryPath The path to a leaf directory. + * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories. + * @returns {ConfigArray} The loaded config. + * @throws {Error} If a config file is invalid. + * @private + */ + _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) { + const { + baseConfigArray, + configArrayFactory, + configCache, + cwd, + useEslintrc + } = internalSlotsMap.get(this); + + if (!useEslintrc) { + return baseConfigArray; + } + + let configArray = configCache.get(directoryPath); + + // Hit cache. + if (configArray) { + debug$1(`Cache hit: ${directoryPath}.`); + return configArray; + } + debug$1(`No cache found: ${directoryPath}.`); + + const homePath = os__default["default"].homedir(); + + // Consider this is root. + if (directoryPath === homePath && cwd !== homePath) { + debug$1("Stop traversing because of considered root."); + if (configsExistInSubdirs) { + const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath); + + if (filePath) { + emitDeprecationWarning( + filePath, + "ESLINT_PERSONAL_CONFIG_SUPPRESS" + ); + } + } + return this._cacheConfig(directoryPath, baseConfigArray); + } + + // Load the config on this directory. + try { + configArray = configArrayFactory.loadInDirectory(directoryPath); + } catch (error) { + /* istanbul ignore next */ + if (error.code === "EACCES") { + debug$1("Stop traversing because of 'EACCES' error."); + return this._cacheConfig(directoryPath, baseConfigArray); + } + throw error; + } + + if (configArray.length > 0 && configArray.isRoot()) { + debug$1("Stop traversing because of 'root:true'."); + configArray.unshift(...baseConfigArray); + return this._cacheConfig(directoryPath, configArray); + } + + // Load from the ancestors and merge it. + const parentPath = path__default["default"].dirname(directoryPath); + const parentConfigArray = parentPath && parentPath !== directoryPath + ? this._loadConfigInAncestors( + parentPath, + configsExistInSubdirs || configArray.length > 0 + ) + : baseConfigArray; + + if (configArray.length > 0) { + configArray.unshift(...parentConfigArray); + } else { + configArray = parentConfigArray; + } + + // Cache and return. + return this._cacheConfig(directoryPath, configArray); + } + + /** + * Freeze and cache a given config. + * @param {string} directoryPath The path to a directory as a cache key. + * @param {ConfigArray} configArray The config array as a cache value. + * @returns {ConfigArray} The `configArray` (frozen). + */ + _cacheConfig(directoryPath, configArray) { + const { configCache } = internalSlotsMap.get(this); + + Object.freeze(configArray); + configCache.set(directoryPath, configArray); + + return configArray; + } + + /** + * Finalize a given config array. + * Concatenate `--config` and other CLI options. + * @param {ConfigArray} configArray The parent config array. + * @param {string} directoryPath The path to the leaf directory to find config files. + * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The loaded config. + * @throws {Error} If a config file is invalid. + * @private + */ + _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) { + const { + cliConfigArray, + configArrayFactory, + finalizeCache, + useEslintrc, + builtInRules + } = internalSlotsMap.get(this); + + let finalConfigArray = finalizeCache.get(configArray); + + if (!finalConfigArray) { + finalConfigArray = configArray; + + // Load the personal config if there are no regular config files. + if ( + useEslintrc && + configArray.every(c => !c.filePath) && + cliConfigArray.every(c => !c.filePath) // `--config` option can be a file. + ) { + const homePath = os__default["default"].homedir(); + + debug$1("Loading the config file of the home directory:", homePath); + + const personalConfigArray = configArrayFactory.loadInDirectory( + homePath, + { name: "PersonalConfig" } + ); + + if ( + personalConfigArray.length > 0 && + !directoryPath.startsWith(homePath) + ) { + const lastElement = + personalConfigArray.at(-1); + + emitDeprecationWarning( + lastElement.filePath, + "ESLINT_PERSONAL_CONFIG_LOAD" + ); + } + + finalConfigArray = finalConfigArray.concat(personalConfigArray); + } + + // Apply CLI options. + if (cliConfigArray.length > 0) { + finalConfigArray = finalConfigArray.concat(cliConfigArray); + } + + // Validate rule settings and environments. + const validator = new ConfigValidator({ + builtInRules + }); + + validator.validateConfigArray(finalConfigArray); + + // Cache it. + Object.freeze(finalConfigArray); + finalizeCache.set(configArray, finalConfigArray); + + debug$1( + "Configuration was determined: %o on %s", + finalConfigArray, + directoryPath + ); + } + + // At least one element (the default ignore patterns) exists. + if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) { + throw new ConfigurationNotFoundError(directoryPath); + } + + return finalConfigArray; + } +} + +/** + * @fileoverview Compatibility class for flat config. + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").Processor} Processor */ + +const debug = debugOrig__default["default"]("eslintrc:flat-compat"); +const cafactory = Symbol("cafactory"); + +/** + * Translates an ESLintRC-style config object into a flag-config-style config + * object. + * @param {Object} eslintrcConfig An ESLintRC-style config object. + * @param {Object} options Options to help translate the config. + * @param {string} options.resolveConfigRelativeTo To the directory to resolve + * configs from. + * @param {string} options.resolvePluginsRelativeTo The directory to resolve + * plugins from. + * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment + * names to objects. + * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor + * names to objects. + * @returns {Object} A flag-config-style config object. + * @throws {Error} If a plugin or environment cannot be resolved. + */ +function translateESLintRC(eslintrcConfig, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo, + pluginEnvironments, + pluginProcessors +}) { + + const flatConfig = {}; + const configs = []; + const languageOptions = {}; + const linterOptions = {}; + const keysToCopy = ["settings", "rules", "processor"]; + const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"]; + const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"]; + + // copy over simple translations + for (const key of keysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig[key] = eslintrcConfig[key]; + } + } + + // copy over languageOptions + for (const key of languageOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + + // create the languageOptions key in the flat config + flatConfig.languageOptions = languageOptions; + + if (key === "parser") { + debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`); + + if (eslintrcConfig[key].error) { + throw eslintrcConfig[key].error; + } + + languageOptions[key] = eslintrcConfig[key].definition; + continue; + } + + // clone any object values that are in the eslintrc config + if (eslintrcConfig[key] && typeof eslintrcConfig[key] === "object") { + languageOptions[key] = { + ...eslintrcConfig[key] + }; + } else { + languageOptions[key] = eslintrcConfig[key]; + } + } + } + + // copy over linterOptions + for (const key of linterOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig.linterOptions = linterOptions; + linterOptions[key] = eslintrcConfig[key]; + } + } + + // move ecmaVersion a level up + if (languageOptions.parserOptions) { + + if ("ecmaVersion" in languageOptions.parserOptions) { + languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion; + delete languageOptions.parserOptions.ecmaVersion; + } + + if ("sourceType" in languageOptions.parserOptions) { + languageOptions.sourceType = languageOptions.parserOptions.sourceType; + delete languageOptions.parserOptions.sourceType; + } + + // check to see if we even need parserOptions anymore and remove it if not + if (Object.keys(languageOptions.parserOptions).length === 0) { + delete languageOptions.parserOptions; + } + } + + // overrides + if (eslintrcConfig.criteria) { + flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)]; + } + + // translate plugins + if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === "object") { + debug(`Translating plugins: ${eslintrcConfig.plugins}`); + + flatConfig.plugins = {}; + + for (const pluginName of Object.keys(eslintrcConfig.plugins)) { + + debug(`Translating plugin: ${pluginName}`); + debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`); + + const { original: plugin, error } = eslintrcConfig.plugins[pluginName]; + + if (error) { + throw error; + } + + flatConfig.plugins[pluginName] = plugin; + + // create a config for any processors + if (plugin.processors) { + for (const processorName of Object.keys(plugin.processors)) { + if (processorName.startsWith(".")) { + debug(`Assigning processor: ${pluginName}/${processorName}`); + + configs.unshift({ + files: [`**/*${processorName}`], + processor: pluginProcessors.get(`${pluginName}/${processorName}`) + }); + } + + } + } + } + } + + // translate env - must come after plugins + if (eslintrcConfig.env && typeof eslintrcConfig.env === "object") { + for (const envName of Object.keys(eslintrcConfig.env)) { + + // only add environments that are true + if (eslintrcConfig.env[envName]) { + debug(`Translating environment: ${envName}`); + + if (environments.has(envName)) { + + // built-in environments should be defined first + configs.unshift(...translateESLintRC({ + criteria: eslintrcConfig.criteria, + ...environments.get(envName) + }, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } else if (pluginEnvironments.has(envName)) { + + // if the environment comes from a plugin, it should come after the plugin config + configs.push(...translateESLintRC({ + criteria: eslintrcConfig.criteria, + ...pluginEnvironments.get(envName) + }, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } + } + } + } + + // only add if there are actually keys in the config + if (Object.keys(flatConfig).length > 0) { + configs.push(flatConfig); + } + + return configs; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A compatibility class for working with configs. + */ +class FlatCompat { + + constructor({ + baseDirectory = process.cwd(), + resolvePluginsRelativeTo = baseDirectory, + recommendedConfig, + allConfig + } = {}) { + this.baseDirectory = baseDirectory; + this.resolvePluginsRelativeTo = resolvePluginsRelativeTo; + this[cafactory] = new ConfigArrayFactory({ + cwd: baseDirectory, + resolvePluginsRelativeTo, + getEslintAllConfig() { + + if (!allConfig) { + throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor."); + } + + return allConfig; + }, + getEslintRecommendedConfig() { + + if (!recommendedConfig) { + throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor."); + } + + return recommendedConfig; + } + }); + } + + /** + * Translates an ESLintRC-style config into a flag-config-style config. + * @param {Object} eslintrcConfig The ESLintRC-style config object. + * @returns {Object} A flag-config-style config object. + */ + config(eslintrcConfig) { + const eslintrcArray = this[cafactory].create(eslintrcConfig, { + basePath: this.baseDirectory + }); + + const flatArray = []; + let hasIgnorePatterns = false; + + eslintrcArray.forEach(configData => { + if (configData.type === "config") { + hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern; + flatArray.push(...translateESLintRC(configData, { + resolveConfigRelativeTo: path__default["default"].join(this.baseDirectory, "__placeholder.js"), + resolvePluginsRelativeTo: path__default["default"].join(this.resolvePluginsRelativeTo, "__placeholder.js"), + pluginEnvironments: eslintrcArray.pluginEnvironments, + pluginProcessors: eslintrcArray.pluginProcessors + })); + } + }); + + // combine ignorePatterns to emulate ESLintRC behavior better + if (hasIgnorePatterns) { + flatArray.unshift({ + ignores: [filePath => { + + // Compute the final config for this file. + // This filters config array elements by `files`/`excludedFiles` then merges the elements. + const finalConfig = eslintrcArray.extractConfig(filePath); + + // Test the `ignorePattern` properties of the final config. + return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath); + }] + }); + } + + return flatArray; + } + + /** + * Translates the `env` section of an ESLintRC-style config. + * @param {Object} envConfig The `env` section of an ESLintRC config. + * @returns {Object[]} An array of flag-config objects representing the environments. + */ + env(envConfig) { + return this.config({ + env: envConfig + }); + } + + /** + * Translates the `extends` section of an ESLintRC-style config. + * @param {...string} configsToExtend The names of the configs to load. + * @returns {Object[]} An array of flag-config objects representing the config. + */ + extends(...configsToExtend) { + return this.config({ + extends: configsToExtend + }); + } + + /** + * Translates the `plugins` section of an ESLintRC-style config. + * @param {...string} plugins The names of the plugins to load. + * @returns {Object[]} An array of flag-config objects representing the plugins. + */ + plugins(...plugins) { + return this.config({ + plugins + }); + } +} + +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + ConfigArray, + createConfigArrayFactoryContext: createContext, + CascadingConfigArrayFactory, + ConfigArrayFactory, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs, + environments, + loadConfigFile, + + // shared + ConfigOps, + ConfigValidator, + ModuleResolver, + naming +}; + +exports.FlatCompat = FlatCompat; +exports.Legacy = Legacy; +//# sourceMappingURL=eslintrc.cjs.map diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map new file mode 100644 index 0000000..3c5800e --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"eslintrc.cjs","sources":["../lib/config-array/ignore-pattern.js","../lib/config-array/extracted-config.js","../lib/config-array/config-array.js","../lib/config-array/config-dependency.js","../lib/config-array/override-tester.js","../lib/config-array/index.js","../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../lib/shared/deep-merge-arrays.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/shared/relative-module-resolver.js","../lib/config-array-factory.js","../lib/cascading-config-array-factory.js","../lib/flat-compat.js","../lib/index.js"],"sourcesContent":["/**\n * @fileoverview `IgnorePattern` class.\n *\n * `IgnorePattern` class has the set of glob patterns and the base path.\n *\n * It provides two static methods.\n *\n * - `IgnorePattern.createDefaultIgnore(cwd)`\n * Create the default predicate function.\n * - `IgnorePattern.createIgnore(ignorePatterns)`\n * Create the predicate function from multiple `IgnorePattern` objects.\n *\n * It provides two properties and a method.\n *\n * - `patterns`\n * The glob patterns that ignore to lint.\n * - `basePath`\n * The base path of the glob patterns. If absolute paths existed in the\n * glob patterns, those are handled as relative paths to the base path.\n * - `getPatternsRelativeTo(basePath)`\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n *\n * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes\n * `ignorePatterns` properties.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport assert from \"node:assert\";\nimport path from \"node:path\";\nimport ignore from \"ignore\";\nimport debugOrig from \"debug\";\n\nconst debug = debugOrig(\"eslintrc:ignore-pattern\");\n\n/** @typedef {ReturnType} Ignore */\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the path to the common ancestor directory of given paths.\n * @param {string[]} sourcePaths The paths to calculate the common ancestor.\n * @returns {string} The path to the common ancestor directory.\n */\nfunction getCommonAncestorPath(sourcePaths) {\n let result = sourcePaths[0];\n\n for (let i = 1; i < sourcePaths.length; ++i) {\n const a = result;\n const b = sourcePaths[i];\n\n // Set the shorter one (it's the common ancestor if one includes the other).\n result = a.length < b.length ? a : b;\n\n // Set the common ancestor.\n for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) {\n if (a[j] !== b[j]) {\n result = a.slice(0, lastSepPos);\n break;\n }\n if (a[j] === path.sep) {\n lastSepPos = j;\n }\n }\n }\n\n let resolvedResult = result || path.sep;\n\n // if Windows common ancestor is root of drive must have trailing slash to be absolute.\n if (resolvedResult && resolvedResult.endsWith(\":\") && process.platform === \"win32\") {\n resolvedResult += path.sep;\n }\n return resolvedResult;\n}\n\n/**\n * Make relative path.\n * @param {string} from The source path to get relative path.\n * @param {string} to The destination path to get relative path.\n * @returns {string} The relative path.\n */\nfunction relative(from, to) {\n const relPath = path.relative(from, to);\n\n if (path.sep === \"/\") {\n return relPath;\n }\n return relPath.split(path.sep).join(\"/\");\n}\n\n/**\n * Get the trailing slash if existed.\n * @param {string} filePath The path to check.\n * @returns {string} The trailing slash if existed.\n */\nfunction dirSuffix(filePath) {\n const isDir = (\n filePath.endsWith(path.sep) ||\n (process.platform === \"win32\" && filePath.endsWith(\"/\"))\n );\n\n return isDir ? \"/\" : \"\";\n}\n\nconst DefaultPatterns = Object.freeze([\"/**/node_modules/*\"]);\nconst DotPatterns = Object.freeze([\".*\", \"!.eslintrc.*\", \"!../\"]);\n\n//------------------------------------------------------------------------------\n// Public\n//------------------------------------------------------------------------------\n\n/**\n * Represents a set of glob patterns to ignore against a base path.\n */\nclass IgnorePattern {\n\n /**\n * The default patterns.\n * @type {string[]}\n */\n static get DefaultPatterns() {\n return DefaultPatterns;\n }\n\n /**\n * Create the default predicate function.\n * @param {string} cwd The current working directory.\n * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createDefaultIgnore(cwd) {\n return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]);\n }\n\n /**\n * Create the predicate function from multiple `IgnorePattern` objects.\n * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns.\n * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createIgnore(ignorePatterns) {\n debug(\"Create with: %o\", ignorePatterns);\n\n const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath));\n const patterns = ignorePatterns.flatMap(p => p.getPatternsRelativeTo(basePath));\n const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]);\n const dotIg = ignore({ allowRelativePaths: true }).add(patterns);\n\n debug(\" processed: %o\", { basePath, patterns });\n\n return Object.assign(\n (filePath, dot = false) => {\n assert(path.isAbsolute(filePath), \"'filePath' should be an absolute path.\");\n const relPathRaw = relative(basePath, filePath);\n const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath));\n const adoptedIg = dot ? dotIg : ig;\n const result = relPath !== \"\" && adoptedIg.ignores(relPath);\n\n debug(\"Check\", { filePath, dot, relativePath: relPath, result });\n return result;\n },\n { basePath, patterns }\n );\n }\n\n /**\n * Initialize a new `IgnorePattern` instance.\n * @param {string[]} patterns The glob patterns that ignore to lint.\n * @param {string} basePath The base path of `patterns`.\n */\n constructor(patterns, basePath) {\n assert(path.isAbsolute(basePath), \"'basePath' should be an absolute path.\");\n\n /**\n * The glob patterns that ignore to lint.\n * @type {string[]}\n */\n this.patterns = patterns;\n\n /**\n * The base path of `patterns`.\n * @type {string}\n */\n this.basePath = basePath;\n\n /**\n * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`.\n *\n * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility.\n * It's `false` as-is for `ignorePatterns` property in config files.\n * @type {boolean}\n */\n this.loose = false;\n }\n\n /**\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n * @param {string} newBasePath The base path.\n * @returns {string[]} Modifired patterns.\n */\n getPatternsRelativeTo(newBasePath) {\n assert(path.isAbsolute(newBasePath), \"'newBasePath' should be an absolute path.\");\n const { basePath, loose, patterns } = this;\n\n if (newBasePath === basePath) {\n return patterns;\n }\n const prefix = `/${relative(newBasePath, basePath)}`;\n\n return patterns.map(pattern => {\n const negative = pattern.startsWith(\"!\");\n const head = negative ? \"!\" : \"\";\n const body = negative ? pattern.slice(1) : pattern;\n\n if (body.startsWith(\"/\") || body.startsWith(\"../\")) {\n return `${head}${prefix}${body}`;\n }\n return loose ? pattern : `${head}${prefix}/**/${body}`;\n });\n }\n}\n\nexport { IgnorePattern };\n","/**\n * @fileoverview `ExtractedConfig` class.\n *\n * `ExtractedConfig` class expresses a final configuration for a specific file.\n *\n * It provides one method.\n *\n * - `toCompatibleObjectAsConfigFileContent()`\n * Convert this configuration to the compatible object as the content of\n * config files. It converts the loaded parser and plugins to strings.\n * `CLIEngine#getConfigForFile(filePath)` method uses this method.\n *\n * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance.\n *\n * @author Toru Nagashima \n */\n\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n// For VSCode intellisense\n/** @typedef {import(\"../../shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").SeverityConf} SeverityConf */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n\n/**\n * Check if `xs` starts with `ys`.\n * @template T\n * @param {T[]} xs The array to check.\n * @param {T[]} ys The array that may be the first part of `xs`.\n * @returns {boolean} `true` if `xs` starts with `ys`.\n */\nfunction startsWith(xs, ys) {\n return xs.length >= ys.length && ys.every((y, i) => y === xs[i]);\n}\n\n/**\n * The class for extracted config data.\n */\nclass ExtractedConfig {\n constructor() {\n\n /**\n * The config name what `noInlineConfig` setting came from.\n * @type {string}\n */\n this.configNameOfNoInlineConfig = \"\";\n\n /**\n * Environments.\n * @type {Record}\n */\n this.env = {};\n\n /**\n * Global variables.\n * @type {Record}\n */\n this.globals = {};\n\n /**\n * The glob patterns that ignore to lint.\n * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined}\n */\n this.ignores = void 0;\n\n /**\n * The flag that disables directive comments.\n * @type {boolean|undefined}\n */\n this.noInlineConfig = void 0;\n\n /**\n * Parser definition.\n * @type {DependentParser|null}\n */\n this.parser = null;\n\n /**\n * Options for the parser.\n * @type {Object}\n */\n this.parserOptions = {};\n\n /**\n * Plugin definitions.\n * @type {Record}\n */\n this.plugins = {};\n\n /**\n * Processor ID.\n * @type {string|null}\n */\n this.processor = null;\n\n /**\n * The flag that reports unused `eslint-disable` directive comments.\n * @type {boolean|undefined}\n */\n this.reportUnusedDisableDirectives = void 0;\n\n /**\n * Rule settings.\n * @type {Record}\n */\n this.rules = {};\n\n /**\n * Shared settings.\n * @type {Object}\n */\n this.settings = {};\n }\n\n /**\n * Convert this config to the compatible object as a config file content.\n * @returns {ConfigData} The converted object.\n */\n toCompatibleObjectAsConfigFileContent() {\n const {\n /* eslint-disable no-unused-vars -- needed to make `config` correct */\n configNameOfNoInlineConfig: _ignore1,\n processor: _ignore2,\n /* eslint-enable no-unused-vars -- needed to make `config` correct */\n ignores,\n ...config\n } = this;\n\n config.parser = config.parser && config.parser.filePath;\n config.plugins = Object.keys(config.plugins).filter(Boolean).reverse();\n config.ignorePatterns = ignores ? ignores.patterns : [];\n\n // Strip the default patterns from `ignorePatterns`.\n if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) {\n config.ignorePatterns =\n config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length);\n }\n\n return config;\n }\n}\n\nexport { ExtractedConfig };\n","/**\n * @fileoverview `ConfigArray` class.\n *\n * `ConfigArray` class expresses the full of a configuration. It has the entry\n * config file, base config files that were extended, loaded parsers, and loaded\n * plugins.\n *\n * `ConfigArray` class provides three properties and two methods.\n *\n * - `pluginEnvironments`\n * - `pluginProcessors`\n * - `pluginRules`\n * The `Map` objects that contain the members of all plugins that this\n * config array contains. Those map objects don't have mutation methods.\n * Those keys are the member ID such as `pluginId/memberName`.\n * - `isRoot()`\n * If `true` then this configuration has `root:true` property.\n * - `extractConfig(filePath)`\n * Extract the final configuration for a given file. This means merging\n * every config array element which that `criteria` property matched. The\n * `filePath` argument must be an absolute path.\n *\n * `ConfigArrayFactory` provides the loading logic of config files.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").RuleConf} RuleConf */\n/** @typedef {import(\"../../shared/types\").Rule} Rule */\n/** @typedef {import(\"../../shared/types\").Plugin} Plugin */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {import(\"./override-tester\")[\"OverrideTester\"]} OverrideTester */\n\n/**\n * @typedef {Object} ConfigArrayElement\n * @property {string} name The name of this config element.\n * @property {string} filePath The path to the source file of this config element.\n * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element.\n * @property {Record|undefined} env The environment settings.\n * @property {Record|undefined} globals The global variable settings.\n * @property {IgnorePattern|undefined} ignorePattern The ignore patterns.\n * @property {boolean|undefined} noInlineConfig The flag that disables directive comments.\n * @property {DependentParser|undefined} parser The parser loader.\n * @property {Object|undefined} parserOptions The parser options.\n * @property {Record|undefined} plugins The plugin loaders.\n * @property {string|undefined} processor The processor name to refer plugin's processor.\n * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments.\n * @property {boolean|undefined} root The flag to express root.\n * @property {Record|undefined} rules The rule settings\n * @property {Object|undefined} settings The shared settings.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The element type.\n */\n\n/**\n * @typedef {Object} ConfigArrayInternalSlots\n * @property {Map} cache The cache to extract configs.\n * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition.\n * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition.\n * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new class extends WeakMap {\n get(key) {\n let value = super.get(key);\n\n if (!value) {\n value = {\n cache: new Map(),\n envMap: null,\n processorMap: null,\n ruleMap: null\n };\n super.set(key, value);\n }\n\n return value;\n }\n}();\n\n/**\n * Get the indices which are matched to a given file.\n * @param {ConfigArrayElement[]} elements The elements.\n * @param {string} filePath The path to a target file.\n * @returns {number[]} The indices.\n */\nfunction getMatchedIndices(elements, filePath) {\n const indices = [];\n\n for (let i = elements.length - 1; i >= 0; --i) {\n const element = elements[i];\n\n if (!element.criteria || (filePath && element.criteria.test(filePath))) {\n indices.push(i);\n }\n }\n\n return indices;\n}\n\n/**\n * Check if a value is a non-null object.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is a non-null object.\n */\nfunction isNonNullObject(x) {\n return typeof x === \"object\" && x !== null;\n}\n\n/**\n * Merge two objects.\n *\n * Assign every property values of `y` to `x` if `x` doesn't have the property.\n * If `x`'s property value is an object, it does recursive.\n * @param {Object} target The destination to merge\n * @param {Object|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeWithoutOverwrite(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n\n if (isNonNullObject(target[key])) {\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (target[key] === void 0) {\n if (isNonNullObject(source[key])) {\n target[key] = Array.isArray(source[key]) ? [] : {};\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (source[key] !== void 0) {\n target[key] = source[key];\n }\n }\n }\n}\n\n/**\n * The error for plugin conflicts.\n */\nclass PluginConflictError extends Error {\n\n /**\n * Initialize this error object.\n * @param {string} pluginId The plugin ID.\n * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins.\n */\n constructor(pluginId, plugins) {\n super(`Plugin \"${pluginId}\" was conflicted between ${plugins.map(p => `\"${p.importerName}\"`).join(\" and \")}.`);\n this.messageTemplate = \"plugin-conflict\";\n this.messageData = { pluginId, plugins };\n }\n}\n\n/**\n * Merge plugins.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n * @throws {PluginConflictError} When a plugin was conflicted.\n */\nfunction mergePlugins(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetValue = target[key];\n const sourceValue = source[key];\n\n // Adopt the plugin which was found at first.\n if (targetValue === void 0) {\n if (sourceValue.error) {\n throw sourceValue.error;\n }\n target[key] = sourceValue;\n } else if (sourceValue.filePath !== targetValue.filePath) {\n throw new PluginConflictError(key, [\n {\n filePath: targetValue.filePath,\n importerName: targetValue.importerName\n },\n {\n filePath: sourceValue.filePath,\n importerName: sourceValue.importerName\n }\n ]);\n }\n }\n}\n\n/**\n * Merge rule configs.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeRuleConfigs(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetDef = target[key];\n const sourceDef = source[key];\n\n // Adopt the rule config which was found at first.\n if (targetDef === void 0) {\n if (Array.isArray(sourceDef)) {\n target[key] = [...sourceDef];\n } else {\n target[key] = [sourceDef];\n }\n\n /*\n * If the first found rule config is severity only and the current rule\n * config has options, merge the severity and the options.\n */\n } else if (\n targetDef.length === 1 &&\n Array.isArray(sourceDef) &&\n sourceDef.length >= 2\n ) {\n targetDef.push(...sourceDef.slice(1));\n }\n }\n}\n\n/**\n * Create the extracted config.\n * @param {ConfigArray} instance The config elements.\n * @param {number[]} indices The indices to use.\n * @returns {ExtractedConfig} The extracted config.\n * @throws {Error} When a plugin is conflicted.\n */\nfunction createConfig(instance, indices) {\n const config = new ExtractedConfig();\n const ignorePatterns = [];\n\n // Merge elements.\n for (const index of indices) {\n const element = instance[index];\n\n // Adopt the parser which was found at first.\n if (!config.parser && element.parser) {\n if (element.parser.error) {\n throw element.parser.error;\n }\n config.parser = element.parser;\n }\n\n // Adopt the processor which was found at first.\n if (!config.processor && element.processor) {\n config.processor = element.processor;\n }\n\n // Adopt the noInlineConfig which was found at first.\n if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) {\n config.noInlineConfig = element.noInlineConfig;\n config.configNameOfNoInlineConfig = element.name;\n }\n\n // Adopt the reportUnusedDisableDirectives which was found at first.\n if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) {\n config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives;\n }\n\n // Collect ignorePatterns\n if (element.ignorePattern) {\n ignorePatterns.push(element.ignorePattern);\n }\n\n // Merge others.\n mergeWithoutOverwrite(config.env, element.env);\n mergeWithoutOverwrite(config.globals, element.globals);\n mergeWithoutOverwrite(config.parserOptions, element.parserOptions);\n mergeWithoutOverwrite(config.settings, element.settings);\n mergePlugins(config.plugins, element.plugins);\n mergeRuleConfigs(config.rules, element.rules);\n }\n\n // Create the predicate function for ignore patterns.\n if (ignorePatterns.length > 0) {\n config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse());\n }\n\n return config;\n}\n\n/**\n * Collect definitions.\n * @template T, U\n * @param {string} pluginId The plugin ID for prefix.\n * @param {Record} defs The definitions to collect.\n * @param {Map} map The map to output.\n * @returns {void}\n */\nfunction collect(pluginId, defs, map) {\n if (defs) {\n const prefix = pluginId && `${pluginId}/`;\n\n for (const [key, value] of Object.entries(defs)) {\n map.set(`${prefix}${key}`, value);\n }\n }\n}\n\n/**\n * Delete the mutation methods from a given map.\n * @param {Map} map The map object to delete.\n * @returns {void}\n */\nfunction deleteMutationMethods(map) {\n Object.defineProperties(map, {\n clear: { configurable: true, value: void 0 },\n delete: { configurable: true, value: void 0 },\n set: { configurable: true, value: void 0 }\n });\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArrayElement[]} elements The config elements.\n * @param {ConfigArrayInternalSlots} slots The internal slots.\n * @returns {void}\n */\nfunction initPluginMemberMaps(elements, slots) {\n const processed = new Set();\n\n slots.envMap = new Map();\n slots.processorMap = new Map();\n slots.ruleMap = new Map();\n\n for (const element of elements) {\n if (!element.plugins) {\n continue;\n }\n\n for (const [pluginId, value] of Object.entries(element.plugins)) {\n const plugin = value.definition;\n\n if (!plugin || processed.has(pluginId)) {\n continue;\n }\n processed.add(pluginId);\n\n collect(pluginId, plugin.environments, slots.envMap);\n collect(pluginId, plugin.processors, slots.processorMap);\n collect(pluginId, plugin.rules, slots.ruleMap);\n }\n }\n\n deleteMutationMethods(slots.envMap);\n deleteMutationMethods(slots.processorMap);\n deleteMutationMethods(slots.ruleMap);\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArray} instance The config elements.\n * @returns {ConfigArrayInternalSlots} The extracted config.\n */\nfunction ensurePluginMemberMaps(instance) {\n const slots = internalSlotsMap.get(instance);\n\n if (!slots.ruleMap) {\n initPluginMemberMaps(instance, slots);\n }\n\n return slots;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The Config Array.\n *\n * `ConfigArray` instance contains all settings, parsers, and plugins.\n * You need to call `ConfigArray#extractConfig(filePath)` method in order to\n * extract, merge and get only the config data which is related to an arbitrary\n * file.\n * @extends {Array}\n */\nclass ConfigArray extends Array {\n\n /**\n * Get the plugin environments.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin environments.\n */\n get pluginEnvironments() {\n return ensurePluginMemberMaps(this).envMap;\n }\n\n /**\n * Get the plugin processors.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin processors.\n */\n get pluginProcessors() {\n return ensurePluginMemberMaps(this).processorMap;\n }\n\n /**\n * Get the plugin rules.\n * The returned map cannot be mutated.\n * @returns {ReadonlyMap} The plugin rules.\n */\n get pluginRules() {\n return ensurePluginMemberMaps(this).ruleMap;\n }\n\n /**\n * Check if this config has `root` flag.\n * @returns {boolean} `true` if this config array is root.\n */\n isRoot() {\n for (let i = this.length - 1; i >= 0; --i) {\n const root = this[i].root;\n\n if (typeof root === \"boolean\") {\n return root;\n }\n }\n return false;\n }\n\n /**\n * Extract the config data which is related to a given file.\n * @param {string} filePath The absolute path to the target file.\n * @returns {ExtractedConfig} The extracted config data.\n */\n extractConfig(filePath) {\n const { cache } = internalSlotsMap.get(this);\n const indices = getMatchedIndices(this, filePath);\n const cacheKey = indices.join(\",\");\n\n if (!cache.has(cacheKey)) {\n cache.set(cacheKey, createConfig(this, indices));\n }\n\n return cache.get(cacheKey);\n }\n\n /**\n * Check if a given path is an additional lint target.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the file is an additional lint target.\n */\n isAdditionalTargetPath(filePath) {\n for (const { criteria, type } of this) {\n if (\n type === \"config\" &&\n criteria &&\n !criteria.endsWithWildcard &&\n criteria.test(filePath)\n ) {\n return true;\n }\n }\n return false;\n }\n}\n\n/**\n * Get the used extracted configs.\n * CLIEngine will use this method to collect used deprecated rules.\n * @param {ConfigArray} instance The config array object to get.\n * @returns {ExtractedConfig[]} The used extracted configs.\n * @private\n */\nfunction getUsedExtractedConfigs(instance) {\n const { cache } = internalSlotsMap.get(instance);\n\n return Array.from(cache.values());\n}\n\n\nexport {\n ConfigArray,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview `ConfigDependency` class.\n *\n * `ConfigDependency` class expresses a loaded parser or plugin.\n *\n * If the parser or plugin was loaded successfully, it has `definition` property\n * and `filePath` property. Otherwise, it has `error` property.\n *\n * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it\n * omits `definition` property.\n *\n * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers\n * or plugins.\n *\n * @author Toru Nagashima \n */\n\nimport util from \"node:util\";\n\n/**\n * The class is to store parsers or plugins.\n * This class hides the loaded object from `JSON.stringify()` and `console.log`.\n * @template T\n */\nclass ConfigDependency {\n\n /**\n * Initialize this instance.\n * @param {Object} data The dependency data.\n * @param {T} [data.definition] The dependency if the loading succeeded.\n * @param {T} [data.original] The original, non-normalized dependency if the loading succeeded.\n * @param {Error} [data.error] The error object if the loading failed.\n * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded.\n * @param {string} data.id The ID of this dependency.\n * @param {string} data.importerName The name of the config file which loads this dependency.\n * @param {string} data.importerPath The path to the config file which loads this dependency.\n */\n constructor({\n definition = null,\n original = null,\n error = null,\n filePath = null,\n id,\n importerName,\n importerPath\n }) {\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {T|null}\n */\n this.definition = definition;\n\n /**\n * The original dependency as loaded directly from disk if the loading succeeded.\n * @type {T|null}\n */\n this.original = original;\n\n /**\n * The error object if the loading failed.\n * @type {Error|null}\n */\n this.error = error;\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {string|null}\n */\n this.filePath = filePath;\n\n /**\n * The ID of this dependency.\n * @type {string}\n */\n this.id = id;\n\n /**\n * The name of the config file which loads this dependency.\n * @type {string}\n */\n this.importerName = importerName;\n\n /**\n * The path to the config file which loads this dependency.\n * @type {string}\n */\n this.importerPath = importerPath;\n }\n\n /**\n * Converts this instance to a JSON compatible object.\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n const obj = this[util.inspect.custom]();\n\n // Display `error.message` (`Error#message` is unenumerable).\n if (obj.error instanceof Error) {\n obj.error = { ...obj.error, message: obj.error.message };\n }\n\n return obj;\n }\n\n /**\n * Custom inspect method for Node.js `console.log()`.\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n const {\n definition: _ignore1, // eslint-disable-line no-unused-vars -- needed to make `obj` correct\n original: _ignore2, // eslint-disable-line no-unused-vars -- needed to make `obj` correct\n ...obj\n } = this;\n\n return obj;\n }\n}\n\n/** @typedef {ConfigDependency} DependentParser */\n/** @typedef {ConfigDependency} DependentPlugin */\n\nexport { ConfigDependency };\n","/**\n * @fileoverview `OverrideTester` class.\n *\n * `OverrideTester` class handles `files` property and `excludedFiles` property\n * of `overrides` config.\n *\n * It provides one method.\n *\n * - `test(filePath)`\n * Test if a file path matches the pair of `files` property and\n * `excludedFiles` property. The `filePath` argument must be an absolute\n * path.\n *\n * `ConfigArrayFactory` creates `OverrideTester` objects when it processes\n * `overrides` properties.\n *\n * @author Toru Nagashima \n */\n\nimport assert from \"node:assert\";\nimport path from \"node:path\";\nimport util from \"node:util\";\nimport minimatch from \"minimatch\";\n\nconst { Minimatch } = minimatch;\n\nconst minimatchOpts = { dot: true, matchBase: true };\n\n/**\n * @typedef {Object} Pattern\n * @property {InstanceType[] | null} includes The positive matchers.\n * @property {InstanceType[] | null} excludes The negative matchers.\n */\n\n/**\n * Normalize a given pattern to an array.\n * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns.\n * @returns {string[]|null} Normalized patterns.\n * @private\n */\nfunction normalizePatterns(patterns) {\n if (Array.isArray(patterns)) {\n return patterns.filter(Boolean);\n }\n if (typeof patterns === \"string\" && patterns) {\n return [patterns];\n }\n return [];\n}\n\n/**\n * Create the matchers of given patterns.\n * @param {string[]} patterns The patterns.\n * @returns {InstanceType[] | null} The matchers.\n */\nfunction toMatcher(patterns) {\n if (patterns.length === 0) {\n return null;\n }\n return patterns.map(pattern => {\n if (/^\\.[/\\\\]/u.test(pattern)) {\n return new Minimatch(\n pattern.slice(2),\n\n // `./*.js` should not match with `subdir/foo.js`\n { ...minimatchOpts, matchBase: false }\n );\n }\n return new Minimatch(pattern, minimatchOpts);\n });\n}\n\n/**\n * Convert a given matcher to string.\n * @param {Pattern} matchers The matchers.\n * @returns {string} The string expression of the matcher.\n */\nfunction patternToJson({ includes, excludes }) {\n return {\n includes: includes && includes.map(m => m.pattern),\n excludes: excludes && excludes.map(m => m.pattern)\n };\n}\n\n/**\n * The class to test given paths are matched by the patterns.\n */\nclass OverrideTester {\n\n /**\n * Create a tester with given criteria.\n * If there are no criteria, returns `null`.\n * @param {string|string[]} files The glob patterns for included files.\n * @param {string|string[]} excludedFiles The glob patterns for excluded files.\n * @param {string} basePath The path to the base directory to test paths.\n * @returns {OverrideTester|null} The created instance or `null`.\n * @throws {Error} When invalid patterns are given.\n */\n static create(files, excludedFiles, basePath) {\n const includePatterns = normalizePatterns(files);\n const excludePatterns = normalizePatterns(excludedFiles);\n let endsWithWildcard = false;\n\n if (includePatterns.length === 0) {\n return null;\n }\n\n // Rejects absolute paths or relative paths to parents.\n for (const pattern of includePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n if (pattern.endsWith(\"*\")) {\n endsWithWildcard = true;\n }\n }\n for (const pattern of excludePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n }\n\n const includes = toMatcher(includePatterns);\n const excludes = toMatcher(excludePatterns);\n\n return new OverrideTester(\n [{ includes, excludes }],\n basePath,\n endsWithWildcard\n );\n }\n\n /**\n * Combine two testers by logical and.\n * If either of the testers was `null`, returns the other tester.\n * The `basePath` property of the two must be the same value.\n * @param {OverrideTester|null} a A tester.\n * @param {OverrideTester|null} b Another tester.\n * @returns {OverrideTester|null} Combined tester.\n */\n static and(a, b) {\n if (!b) {\n return a && new OverrideTester(\n a.patterns,\n a.basePath,\n a.endsWithWildcard\n );\n }\n if (!a) {\n return new OverrideTester(\n b.patterns,\n b.basePath,\n b.endsWithWildcard\n );\n }\n\n assert.strictEqual(a.basePath, b.basePath);\n return new OverrideTester(\n a.patterns.concat(b.patterns),\n a.basePath,\n a.endsWithWildcard || b.endsWithWildcard\n );\n }\n\n /**\n * Initialize this instance.\n * @param {Pattern[]} patterns The matchers.\n * @param {string} basePath The base path.\n * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`.\n */\n constructor(patterns, basePath, endsWithWildcard = false) {\n\n /** @type {Pattern[]} */\n this.patterns = patterns;\n\n /** @type {string} */\n this.basePath = basePath;\n\n /** @type {boolean} */\n this.endsWithWildcard = endsWithWildcard;\n }\n\n /**\n * Test if a given path is matched or not.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the path was matched.\n * @throws {Error} When invalid `filePath` is given.\n */\n test(filePath) {\n if (typeof filePath !== \"string\" || !path.isAbsolute(filePath)) {\n throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`);\n }\n const relativePath = path.relative(this.basePath, filePath);\n\n return this.patterns.every(({ includes, excludes }) => (\n (!includes || includes.some(m => m.match(relativePath))) &&\n (!excludes || !excludes.some(m => m.match(relativePath)))\n ));\n }\n\n /**\n * Converts this instance to a JSON compatible object.\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n if (this.patterns.length === 1) {\n return {\n ...patternToJson(this.patterns[0]),\n basePath: this.basePath\n };\n }\n return {\n AND: this.patterns.map(patternToJson),\n basePath: this.basePath\n };\n }\n\n /**\n * Custom inspect method for Node.js `console.log()`.\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n return this.toJSON();\n }\n}\n\nexport { OverrideTester };\n","/**\n * @fileoverview `ConfigArray` class.\n * @author Toru Nagashima \n */\n\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array.js\";\nimport { ConfigDependency } from \"./config-dependency.js\";\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\nimport { OverrideTester } from \"./override-tester.js\";\n\nexport {\n ConfigArray,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = new Set([0, 1, 2, \"off\", \"warn\", \"error\"]);\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.has(severity);\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"node:path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle -- part of the API\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Applies default rule options\n * @author JoshuaKGoldberg\n */\n\n/**\n * Check if the variable contains an object strictly rejecting arrays\n * @param {unknown} value an object\n * @returns {boolean} Whether value is an object\n */\nfunction isObjectNotArray(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Deeply merges second on top of first, creating a new {} object if needed.\n * @param {T} first Base, default value.\n * @param {U} second User-specified value.\n * @returns {T | U | (T & U)} Merged equivalent of second on top of first.\n */\nfunction deepMergeObjects(first, second) {\n if (second === void 0) {\n return first;\n }\n\n if (!isObjectNotArray(first) || !isObjectNotArray(second)) {\n return second;\n }\n\n const result = { ...first, ...second };\n\n for (const key of Object.keys(second)) {\n if (Object.prototype.propertyIsEnumerable.call(first, key)) {\n result[key] = deepMergeObjects(first[key], second[key]);\n }\n }\n\n return result;\n}\n\n/**\n * Deeply merges second on top of first, creating a new [] array if needed.\n * @param {T[] | undefined} first Base, default values.\n * @param {U[] | undefined} second User-specified values.\n * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first.\n */\nfunction deepMergeArrays(first, second) {\n if (!first || !second) {\n return second || first || [];\n }\n\n return [\n ...first.map((value, i) => deepMergeObjects(value, second[i])),\n ...second.slice(first.length)\n ];\n}\n\nexport { deepMergeArrays };\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record} current The newer object.\n * @param {Record} prev The older object.\n * @returns {Record} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwn(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n es2023: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 14\n }\n },\n es2024: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 15\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" -- not needed in this file */\n\n//------------------------------------------------------------------------------\n// Typedefs\n//------------------------------------------------------------------------------\n\n/** @typedef {import(\"../shared/types\").Rule} Rule */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"node:util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport { deepMergeArrays } from \"./deep-merge-arrays.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n// JSON schema that disallows passing any options\nconst noOptionsSchema = Object.freeze({\n type: \"array\",\n minItems: 0,\n maxItems: 0\n});\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\n/**\n * Validator for configuration objects.\n */\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {Rule} rule A rule object\n * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.\n * @returns {Object|null} JSON Schema for the rule's options.\n * `null` if rule wasn't passed or its `meta.schema` is `false`.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n if (!rule.meta) {\n return { ...noOptionsSchema }; // default if `meta.schema` is not specified\n }\n\n const schema = rule.meta.schema;\n\n if (typeof schema === \"undefined\") {\n return { ...noOptionsSchema }; // default if `meta.schema` is not specified\n }\n\n // `schema:false` is an allowed explicit opt-out of options validation for the rule\n if (schema === false) {\n return null;\n }\n\n if (typeof schema !== \"object\" || schema === null) {\n throw new TypeError(\"Rule's `meta.schema` must be an array or object\");\n }\n\n // ESLint-specific array form needs to be converted into a valid JSON Schema definition\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n\n // `schema:[]` is an explicit way to specify that the rule does not accept any options\n return { ...noOptionsSchema };\n }\n\n // `schema:` is assumed to be a valid JSON Schema definition\n return schema;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n * @throws {Error} If the severity is invalid.\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n * @throws {Error} If the options are invalid.\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n try {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n } catch (err) {\n const errorWithCode = new Error(err.message, { cause: err });\n\n errorWithCode.code = \"ESLINT_INVALID_RULE_OPTIONS_SCHEMA\";\n\n throw errorWithCode;\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, localOptions);\n\n validateRule(mergedOptions);\n\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n * @throws {Error} If the options are invalid.\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n let enhancedMessage = err.code === \"ESLINT_INVALID_RULE_OPTIONS_SCHEMA\"\n ? `Error while processing options validation schema of rule '${ruleId}': ${err.message}`\n : `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n enhancedMessage = `${source}:\\n\\t${enhancedMessage}`;\n }\n\n const enhancedError = new Error(enhancedMessage, { cause: err });\n\n if (err.code) {\n enhancedError.code = err.code;\n }\n\n throw enhancedError;\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n * @throws {Error} If the environment is invalid.\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {(id:string) => Processor} getProcessor The getter of defined processors.\n * @returns {void}\n * @throws {Error} If the processor is invalid.\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n * @throws {Error} If the config is invalid.\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwn(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * Utility for resolving a module relative to another module\n * @author Teddy Katz\n */\n\nimport Module from \"node:module\";\n\n/*\n * `Module.createRequire` is added in v12.2.0. It supports URL as well.\n * We only support the case where the argument is a filepath, not a URL.\n */\nconst createRequire = Module.createRequire;\n\n/**\n * Resolves a Node module relative to another module\n * @param {string} moduleName The name of a Node module, or a path to a Node module.\n * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be\n * a file rather than a directory, but the file need not actually exist.\n * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`\n * @throws {Error} When the module cannot be resolved.\n */\nfunction resolve(moduleName, relativeToPath) {\n try {\n return createRequire(relativeToPath).resolve(moduleName);\n } catch (error) {\n\n // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future.\n if (\n typeof error === \"object\" &&\n error !== null &&\n error.code === \"MODULE_NOT_FOUND\" &&\n !error.requireStack &&\n error.message.includes(moduleName)\n ) {\n error.message += `\\nRequire stack:\\n- ${relativeToPath}`;\n }\n throw error;\n }\n}\n\nexport {\n resolve\n};\n","/**\n * @fileoverview The factory of `ConfigArray` objects.\n *\n * This class provides methods to create `ConfigArray` instance.\n *\n * - `create(configData, options)`\n * Create a `ConfigArray` instance from a config data. This is to handle CLI\n * options except `--config`.\n * - `loadFile(filePath, options)`\n * Create a `ConfigArray` instance from a config file. This is to handle\n * `--config` option. If the file was not found, throws the following error:\n * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error.\n * - If the filename was `package.json`, an IO error or an\n * `ESLINT_CONFIG_FIELD_NOT_FOUND` error.\n * - Otherwise, an IO error such as `ENOENT`.\n * - `loadInDirectory(directoryPath, options)`\n * Create a `ConfigArray` instance from a config file which is on a given\n * directory. This tries to load `.eslintrc.*` or `package.json`. If not\n * found, returns an empty `ConfigArray`.\n * - `loadESLintIgnore(filePath)`\n * Create a `ConfigArray` instance from a config file that is `.eslintignore`\n * format. This is to handle `--ignore-path` option.\n * - `loadDefaultESLintIgnore()`\n * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in\n * the current working directory.\n *\n * `ConfigArrayFactory` class has the responsibility that loads configuration\n * files, including loading `extends`, `parser`, and `plugins`. The created\n * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`.\n *\n * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class\n * handles cascading and hierarchy.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport fs from \"node:fs\";\nimport importFresh from \"import-fresh\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport stripComments from \"strip-json-comments\";\n\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern,\n OverrideTester\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\n\nconst require = createRequire(import.meta.url);\n\nconst debug = debugOrig(\"eslintrc:config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\nconst configFilenames = [\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.yaml\",\n \".eslintrc.yml\",\n \".eslintrc.json\",\n \".eslintrc\",\n \"package.json\"\n];\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").OverrideConfigData} OverrideConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {import(\"./config-array/config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-array/config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {ConfigArray[0]} ConfigArrayElement */\n\n/**\n * @typedef {Object} ConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {string} [cwd] The path to the current working directory.\n * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryInternalSlots\n * @property {Map} additionalPluginPool The map for additional plugins.\n * @property {string} cwd The path to the current working directory.\n * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {string} pluginBasePath The base path to resolve plugins.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/** @type {WeakMap} */\nconst normalizedPlugins = new WeakMap();\n\n/**\n * Check if a given string is a file path.\n * @param {string} nameOrPath A module name or file path.\n * @returns {boolean} `true` if the `nameOrPath` is a file path.\n */\nfunction isFilePath(nameOrPath) {\n return (\n /^\\.{1,2}[/\\\\]/u.test(nameOrPath) ||\n path.isAbsolute(nameOrPath)\n );\n}\n\n/**\n * Convenience wrapper for synchronously reading file contents.\n * @param {string} filePath The filename to read.\n * @returns {string} The file contents, with the BOM removed.\n * @private\n */\nfunction readFile(filePath) {\n return fs.readFileSync(filePath, \"utf8\").replace(/^\\ufeff/u, \"\");\n}\n\n/**\n * Loads a YAML configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadYAMLConfigFile(filePath) {\n debug(`Loading YAML config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n\n // empty YAML file can be null, so always use\n return yaml.load(readFile(filePath)) || {};\n } catch (e) {\n debug(`Error reading YAML file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JSON configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSONConfigFile(filePath) {\n debug(`Loading JSON config file: ${filePath}`);\n\n try {\n return JSON.parse(stripComments(readFile(filePath)));\n } catch (e) {\n debug(`Error reading JSON file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n e.messageTemplate = \"failed-to-read-json\";\n e.messageData = {\n path: filePath,\n message: e.message\n };\n throw e;\n }\n}\n\n/**\n * Loads a legacy (.eslintrc) configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadLegacyConfigFile(filePath) {\n debug(`Loading legacy config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n return yaml.load(stripComments(readFile(filePath))) || /* istanbul ignore next */ {};\n } catch (e) {\n debug(\"Error reading YAML file: %s\\n%o\", filePath, e);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JavaScript configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSConfigFile(filePath) {\n debug(`Loading JS config file: ${filePath}`);\n try {\n return importFresh(filePath);\n } catch (e) {\n debug(`Error reading JavaScript file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a configuration from a package.json file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadPackageJSONConfigFile(filePath) {\n debug(`Loading package.json config file: ${filePath}`);\n try {\n const packageData = loadJSONConfigFile(filePath);\n\n if (!Object.hasOwn(packageData, \"eslintConfig\")) {\n throw Object.assign(\n new Error(\"package.json file doesn't have 'eslintConfig' field.\"),\n { code: \"ESLINT_CONFIG_FIELD_NOT_FOUND\" }\n );\n }\n\n return packageData.eslintConfig;\n } catch (e) {\n debug(`Error reading package.json file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a `.eslintignore` from a file.\n * @param {string} filePath The filename to load.\n * @returns {string[]} The ignore patterns from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadESLintIgnoreFile(filePath) {\n debug(`Loading .eslintignore file: ${filePath}`);\n\n try {\n return readFile(filePath)\n .split(/\\r?\\n/gu)\n .filter(line => line.trim() !== \"\" && !line.startsWith(\"#\"));\n } catch (e) {\n debug(`Error reading .eslintignore file: ${filePath}`);\n e.message = `Cannot read .eslintignore file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Creates an error to notify about a missing config to extend from.\n * @param {string} configName The name of the missing config.\n * @param {string} importerName The name of the config that imported the missing config\n * @param {string} messageTemplate The text template to source error strings from.\n * @returns {Error} The error object to throw\n * @private\n */\nfunction configInvalidError(configName, importerName, messageTemplate) {\n return Object.assign(\n new Error(`Failed to load config \"${configName}\" to extend from.`),\n {\n messageTemplate,\n messageData: { configName, importerName }\n }\n );\n}\n\n/**\n * Loads a configuration file regardless of the source. Inspects the file path\n * to determine the correctly way to load the config file.\n * @param {string} filePath The path to the configuration.\n * @returns {ConfigData|null} The configuration information.\n * @private\n */\nfunction loadConfigFile(filePath) {\n switch (path.extname(filePath)) {\n case \".js\":\n case \".cjs\":\n return loadJSConfigFile(filePath);\n\n case \".json\":\n if (path.basename(filePath) === \"package.json\") {\n return loadPackageJSONConfigFile(filePath);\n }\n return loadJSONConfigFile(filePath);\n\n case \".yaml\":\n case \".yml\":\n return loadYAMLConfigFile(filePath);\n\n default:\n return loadLegacyConfigFile(filePath);\n }\n}\n\n/**\n * Write debug log.\n * @param {string} request The requested module name.\n * @param {string} relativeTo The file path to resolve the request relative to.\n * @param {string} filePath The resolved file path.\n * @returns {void}\n */\nfunction writeDebugLogForLoading(request, relativeTo, filePath) {\n /* istanbul ignore next */\n if (debug.enabled) {\n let nameAndVersion = null; // eslint-disable-line no-useless-assignment -- known bug in the rule\n\n try {\n const packageJsonPath = ModuleResolver.resolve(\n `${request}/package.json`,\n relativeTo\n );\n const { version = \"unknown\" } = require(packageJsonPath);\n\n nameAndVersion = `${request}@${version}`;\n } catch (error) {\n debug(\"package.json was not found:\", error.message);\n nameAndVersion = request;\n }\n\n debug(\"Loaded: %s (%s)\", nameAndVersion, filePath);\n }\n}\n\n/**\n * Create a new context with default values.\n * @param {ConfigArrayFactoryInternalSlots} slots The internal slots.\n * @param {\"config\" | \"ignore\" | \"implicit-processor\" | undefined} providedType The type of the current configuration. Default is `\"config\"`.\n * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`.\n * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string.\n * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`.\n * @returns {ConfigArrayFactoryLoadingContext} The created context.\n */\nfunction createContext(\n { cwd, resolvePluginsRelativeTo },\n providedType,\n providedName,\n providedFilePath,\n providedMatchBasePath\n) {\n const filePath = providedFilePath\n ? path.resolve(cwd, providedFilePath)\n : \"\";\n const matchBasePath =\n (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const name =\n providedName ||\n (filePath && path.relative(cwd, filePath)) ||\n \"\";\n const pluginBasePath =\n resolvePluginsRelativeTo ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const type = providedType || \"config\";\n\n return { filePath, matchBasePath, name, pluginBasePath, type };\n}\n\n/**\n * Normalize a given plugin.\n * - Ensure the object to have four properties: configs, environments, processors, and rules.\n * - Ensure the object to not have other properties.\n * @param {Plugin} plugin The plugin to normalize.\n * @returns {Plugin} The normalized plugin.\n */\nfunction normalizePlugin(plugin) {\n\n // first check the cache\n let normalizedPlugin = normalizedPlugins.get(plugin);\n\n if (normalizedPlugin) {\n return normalizedPlugin;\n }\n\n normalizedPlugin = {\n configs: plugin.configs || {},\n environments: plugin.environments || {},\n processors: plugin.processors || {},\n rules: plugin.rules || {}\n };\n\n // save the reference for later\n normalizedPlugins.set(plugin, normalizedPlugin);\n\n return normalizedPlugin;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The factory of `ConfigArray` objects.\n */\nclass ConfigArrayFactory {\n\n /**\n * Initialize this instance.\n * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins.\n */\n constructor({\n additionalPluginPool = new Map(),\n cwd = process.cwd(),\n resolvePluginsRelativeTo,\n builtInRules,\n resolver = ModuleResolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = {}) {\n internalSlotsMap.set(this, {\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo:\n resolvePluginsRelativeTo &&\n path.resolve(cwd, resolvePluginsRelativeTo),\n builtInRules,\n resolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n });\n }\n\n /**\n * Create `ConfigArray` instance from a config data.\n * @param {ConfigData|null} configData The config data to create.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.filePath] The path to this config data.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n create(configData, { basePath, filePath, name } = {}) {\n if (!configData) {\n return new ConfigArray();\n }\n\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n const elements = this._normalizeConfigData(configData, ctx);\n\n return new ConfigArray(...elements);\n }\n\n /**\n * Load a config file.\n * @param {string} filePath The path to a config file.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n loadFile(filePath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n\n return new ConfigArray(...this._loadConfigData(ctx));\n }\n\n /**\n * Load the config file on a given directory if exists.\n * @param {string} directoryPath The path to a directory.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @throws {Error} If the config file is invalid.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadInDirectory(directoryPath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n\n for (const filename of configFilenames) {\n const ctx = createContext(\n slots,\n \"config\",\n name,\n path.join(directoryPath, filename),\n basePath\n );\n\n if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) {\n let configData;\n\n try {\n configData = loadConfigFile(ctx.filePath);\n } catch (error) {\n if (!error || error.code !== \"ESLINT_CONFIG_FIELD_NOT_FOUND\") {\n throw error;\n }\n }\n\n if (configData) {\n debug(`Config file found: ${ctx.filePath}`);\n return new ConfigArray(\n ...this._normalizeConfigData(configData, ctx)\n );\n }\n }\n }\n\n debug(`Config file not found on ${directoryPath}`);\n return new ConfigArray();\n }\n\n /**\n * Check if a config file on a given directory exists or not.\n * @param {string} directoryPath The path to a directory.\n * @returns {string | null} The path to the found config file. If not found then null.\n */\n static getPathToConfigFileInDirectory(directoryPath) {\n for (const filename of configFilenames) {\n const filePath = path.join(directoryPath, filename);\n\n if (fs.existsSync(filePath)) {\n if (filename === \"package.json\") {\n try {\n loadPackageJSONConfigFile(filePath);\n return filePath;\n } catch { /* ignore */ }\n } else {\n return filePath;\n }\n }\n }\n return null;\n }\n\n /**\n * Load `.eslintignore` file.\n * @param {string} filePath The path to a `.eslintignore` file to load.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadESLintIgnore(filePath) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(\n slots,\n \"ignore\",\n void 0,\n filePath,\n slots.cwd\n );\n const ignorePatterns = loadESLintIgnoreFile(ctx.filePath);\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(ignorePatterns, ctx)\n );\n }\n\n /**\n * Load `.eslintignore` file in the current working directory.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n * @throws {Error} If the ignore file is invalid.\n */\n loadDefaultESLintIgnore() {\n const slots = internalSlotsMap.get(this);\n const eslintIgnorePath = path.resolve(slots.cwd, \".eslintignore\");\n const packageJsonPath = path.resolve(slots.cwd, \"package.json\");\n\n if (fs.existsSync(eslintIgnorePath)) {\n return this.loadESLintIgnore(eslintIgnorePath);\n }\n if (fs.existsSync(packageJsonPath)) {\n const data = loadJSONConfigFile(packageJsonPath);\n\n if (Object.hasOwn(data, \"eslintIgnore\")) {\n if (!Array.isArray(data.eslintIgnore)) {\n throw new Error(\"Package.json eslintIgnore property requires an array of paths\");\n }\n const ctx = createContext(\n slots,\n \"ignore\",\n \"eslintIgnore in package.json\",\n packageJsonPath,\n slots.cwd\n );\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx)\n );\n }\n }\n\n return new ConfigArray();\n }\n\n /**\n * Load a given config file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} Loaded config.\n * @private\n */\n _loadConfigData(ctx) {\n return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx);\n }\n\n /**\n * Normalize a given `.eslintignore` data to config array elements.\n * @param {string[]} ignorePatterns The patterns to ignore files.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeESLintIgnoreData(ignorePatterns, ctx) {\n const elements = this._normalizeObjectConfigData(\n { ignorePatterns },\n ctx\n );\n\n // Set `ignorePattern.loose` flag for backward compatibility.\n for (const element of elements) {\n if (element.ignorePattern) {\n element.ignorePattern.loose = true;\n }\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _normalizeConfigData(configData, ctx) {\n const validator = new ConfigValidator();\n\n validator.validateConfigSchema(configData, ctx.name || ctx.filePath);\n return this._normalizeObjectConfigData(configData, ctx);\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData|OverrideConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigData(configData, ctx) {\n const { files, excludedFiles, ...configBody } = configData;\n const criteria = OverrideTester.create(\n files,\n excludedFiles,\n ctx.matchBasePath\n );\n const elements = this._normalizeObjectConfigDataBody(configBody, ctx);\n\n // Apply the criteria to every element.\n for (const element of elements) {\n\n /*\n * Merge the criteria.\n * This is for the `overrides` entries that came from the\n * configurations of `overrides[].extends`.\n */\n element.criteria = OverrideTester.and(criteria, element.criteria);\n\n /*\n * Remove `root` property to ignore `root` settings which came from\n * `extends` in `overrides`.\n */\n if (element.criteria) {\n element.root = void 0;\n }\n\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigDataBody(\n {\n env,\n extends: extend,\n globals,\n ignorePatterns,\n noInlineConfig,\n parser: parserName,\n parserOptions,\n plugins: pluginList,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings,\n overrides: overrideList = []\n },\n ctx\n ) {\n const extendList = Array.isArray(extend) ? extend : [extend];\n const ignorePattern = ignorePatterns && new IgnorePattern(\n Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns],\n ctx.matchBasePath\n );\n\n // Flatten `extends`.\n for (const extendName of extendList.filter(Boolean)) {\n yield* this._loadExtends(extendName, ctx);\n }\n\n // Load parser & plugins.\n const parser = parserName && this._loadParser(parserName, ctx);\n const plugins = pluginList && this._loadPlugins(pluginList, ctx);\n\n // Yield pseudo config data for file extension processors.\n if (plugins) {\n yield* this._takeFileExtensionProcessors(plugins, ctx);\n }\n\n // Yield the config data except `extends` and `overrides`.\n yield {\n\n // Debug information.\n type: ctx.type,\n name: ctx.name,\n filePath: ctx.filePath,\n\n // Config data.\n criteria: null,\n env,\n globals,\n ignorePattern,\n noInlineConfig,\n parser,\n parserOptions,\n plugins,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings\n };\n\n // Flatten `overries`.\n for (let i = 0; i < overrideList.length; ++i) {\n yield* this._normalizeObjectConfigData(\n overrideList[i],\n { ...ctx, name: `${ctx.name}#overrides[${i}]` }\n );\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @throws {Error} If the extended config file can't be loaded.\n * @private\n */\n _loadExtends(extendName, ctx) {\n debug(\"Loading {extends:%j} relative to %s\", extendName, ctx.filePath);\n try {\n if (extendName.startsWith(\"eslint:\")) {\n return this._loadExtendedBuiltInConfig(extendName, ctx);\n }\n if (extendName.startsWith(\"plugin:\")) {\n return this._loadExtendedPluginConfig(extendName, ctx);\n }\n return this._loadExtendedShareableConfig(extendName, ctx);\n } catch (error) {\n error.message += `\\nReferenced from: ${ctx.filePath || ctx.name}`;\n throw error;\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @throws {Error} If the extended config file can't be loaded.\n * @private\n */\n _loadExtendedBuiltInConfig(extendName, ctx) {\n const {\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = internalSlotsMap.get(this);\n\n if (extendName === \"eslint:recommended\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintRecommendedConfig) {\n if (typeof getEslintRecommendedConfig !== \"function\") {\n throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`);\n }\n return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintRecommendedPath\n });\n }\n if (extendName === \"eslint:all\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintAllConfig) {\n if (typeof getEslintAllConfig !== \"function\") {\n throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`);\n }\n return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintAllPath\n });\n }\n\n throw configInvalidError(extendName, ctx.name, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @throws {Error} If the extended config file can't be loaded.\n * @private\n */\n _loadExtendedPluginConfig(extendName, ctx) {\n const slashIndex = extendName.lastIndexOf(\"/\");\n\n if (slashIndex === -1) {\n throw configInvalidError(extendName, ctx.filePath, \"plugin-invalid\");\n }\n\n const pluginName = extendName.slice(\"plugin:\".length, slashIndex);\n const configName = extendName.slice(slashIndex + 1);\n\n if (isFilePath(pluginName)) {\n throw new Error(\"'extends' cannot use a file path for plugins.\");\n }\n\n const plugin = this._loadPlugin(pluginName, ctx);\n const configData =\n plugin.definition &&\n plugin.definition.configs[configName];\n\n if (configData) {\n return this._normalizeConfigData(configData, {\n ...ctx,\n filePath: plugin.filePath || ctx.filePath,\n name: `${ctx.name} » plugin:${plugin.id}/${configName}`\n });\n }\n\n throw plugin.error || configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @throws {Error} If the extended config file can't be loaded.\n * @private\n */\n _loadExtendedShareableConfig(extendName, ctx) {\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n let request;\n\n if (isFilePath(extendName)) {\n request = extendName;\n } else if (extendName.startsWith(\".\")) {\n request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior.\n } else {\n request = naming.normalizePackageName(\n extendName,\n \"eslint-config\"\n );\n }\n\n let filePath;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (error) {\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n throw configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n throw error;\n }\n\n writeDebugLogForLoading(request, relativeTo, filePath);\n return this._loadConfigData({\n ...ctx,\n filePath,\n name: `${ctx.name} » ${request}`\n });\n }\n\n /**\n * Load given plugins.\n * @param {string[]} names The plugin names to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {Record} The loaded parser.\n * @private\n */\n _loadPlugins(names, ctx) {\n return names.reduce((map, name) => {\n if (isFilePath(name)) {\n throw new Error(\"Plugins array cannot includes file paths.\");\n }\n const plugin = this._loadPlugin(name, ctx);\n\n map[plugin.id] = plugin;\n\n return map;\n }, {});\n }\n\n /**\n * Load a given parser.\n * @param {string} nameOrPath The package name or the path to a parser file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentParser} The loaded parser.\n */\n _loadParser(nameOrPath, ctx) {\n debug(\"Loading parser %j from %s\", nameOrPath, ctx.filePath);\n\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n\n try {\n const filePath = resolver.resolve(nameOrPath, relativeTo);\n\n writeDebugLogForLoading(nameOrPath, relativeTo, filePath);\n\n return new ConfigDependency({\n definition: require(filePath),\n filePath,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (error) {\n\n // If the parser name is \"espree\", load the espree of ESLint.\n if (nameOrPath === \"espree\") {\n debug(\"Fallback espree.\");\n return new ConfigDependency({\n definition: require(\"espree\"),\n filePath: require.resolve(\"espree\"),\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n debug(\"Failed to load parser '%s' declared in '%s'.\", nameOrPath, ctx.name);\n error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`;\n\n return new ConfigDependency({\n error,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n }\n\n /**\n * Load a given plugin.\n * @param {string} name The plugin name to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentPlugin} The loaded plugin.\n * @private\n */\n _loadPlugin(name, ctx) {\n debug(\"Loading plugin %j from %s\", name, ctx.filePath);\n\n const { additionalPluginPool, resolver } = internalSlotsMap.get(this);\n const request = naming.normalizePackageName(name, \"eslint-plugin\");\n const id = naming.getShorthandName(request, \"eslint-plugin\");\n const relativeTo = path.join(ctx.pluginBasePath, \"__placeholder__.js\");\n\n if (name.match(/\\s+/u)) {\n const error = Object.assign(\n new Error(`Whitespace found in plugin name '${name}'`),\n {\n messageTemplate: \"whitespace-found\",\n messageData: { pluginName: request }\n }\n );\n\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n // Check for additional pool.\n const plugin =\n additionalPluginPool.get(request) ||\n additionalPluginPool.get(id);\n\n if (plugin) {\n return new ConfigDependency({\n definition: normalizePlugin(plugin),\n original: plugin,\n filePath: \"\", // It's unknown where the plugin came from.\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n let filePath;\n let error;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (resolveError) {\n error = resolveError;\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n error.messageTemplate = \"plugin-missing\";\n error.messageData = {\n pluginName: request,\n resolvePluginsRelativeTo: ctx.pluginBasePath,\n importerName: ctx.name\n };\n }\n }\n\n if (filePath) {\n try {\n writeDebugLogForLoading(request, relativeTo, filePath);\n\n const startTime = Date.now();\n const pluginDefinition = require(filePath);\n\n debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);\n\n return new ConfigDependency({\n definition: normalizePlugin(pluginDefinition),\n original: pluginDefinition,\n filePath,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (loadError) {\n error = loadError;\n }\n }\n\n debug(\"Failed to load plugin '%s' declared in '%s'.\", name, ctx.name);\n error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`;\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n /**\n * Take file expression processors as config array elements.\n * @param {Record} plugins The plugin definitions.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The config array elements of file expression processors.\n * @private\n */\n *_takeFileExtensionProcessors(plugins, ctx) {\n for (const pluginId of Object.keys(plugins)) {\n const processors =\n plugins[pluginId] &&\n plugins[pluginId].definition &&\n plugins[pluginId].definition.processors;\n\n if (!processors) {\n continue;\n }\n\n for (const processorId of Object.keys(processors)) {\n if (processorId.startsWith(\".\")) {\n yield* this._normalizeObjectConfigData(\n {\n files: [`*${processorId}`],\n processor: `${pluginId}/${processorId}`\n },\n {\n ...ctx,\n type: \"implicit-processor\",\n name: `${ctx.name}#processors[\"${pluginId}/${processorId}\"]`\n }\n );\n }\n }\n }\n }\n}\n\nexport {\n ConfigArrayFactory,\n createContext,\n loadConfigFile\n};\n","/**\n * @fileoverview `CascadingConfigArrayFactory` class.\n *\n * `CascadingConfigArrayFactory` class has a responsibility:\n *\n * 1. Handles cascading of config files.\n *\n * It provides two methods:\n *\n * - `getConfigArrayForFile(filePath)`\n * Get the corresponded configuration of a given file. This method doesn't\n * throw even if the given file didn't exist.\n * - `clearCache()`\n * Clear the internal cache. You have to call this method when\n * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends\n * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.)\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport { emitDeprecationWarning } from \"./shared/deprecation-warnings.js\";\n\nconst debug = debugOrig(\"eslintrc:cascading-config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {ReturnType} ConfigArray */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {ConfigData} [baseConfig] The config by `baseConfig` option.\n * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files.\n * @property {string} [cwd] The base directory to start lookup.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]} [rulePaths] The value of `--rulesdir` option.\n * @property {string} [specificConfigPath] The value of `--config` option.\n * @property {boolean} [useEslintrc] if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryInternalSlots\n * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option.\n * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`.\n * @property {ConfigArray} cliConfigArray The config array of CLI options.\n * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`.\n * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays.\n * @property {Map} configCache The cache from directory paths to config arrays.\n * @property {string} cwd The base directory to start lookup.\n * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`.\n * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`.\n * @property {boolean} useEslintrc if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/**\n * Create the config array from `baseConfig` and `rulePaths`.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createBaseConfigArray({\n configArrayFactory,\n baseConfigData,\n rulePaths,\n cwd,\n loadRules\n}) {\n const baseConfigArray = configArrayFactory.create(\n baseConfigData,\n { name: \"BaseConfig\" }\n );\n\n /*\n * Create the config array element for the default ignore patterns.\n * This element has `ignorePattern` property that ignores the default\n * patterns in the current working directory.\n */\n baseConfigArray.unshift(configArrayFactory.create(\n { ignorePatterns: IgnorePattern.DefaultPatterns },\n { name: \"DefaultIgnorePattern\" }\n )[0]);\n\n /*\n * Load rules `--rulesdir` option as a pseudo plugin.\n * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate\n * the rule's options with only information in the config array.\n */\n if (rulePaths && rulePaths.length > 0) {\n baseConfigArray.push({\n type: \"config\",\n name: \"--rulesdir\",\n filePath: \"\",\n plugins: {\n \"\": new ConfigDependency({\n definition: {\n rules: rulePaths.reduce(\n (map, rulesPath) => Object.assign(\n map,\n loadRules(rulesPath, cwd)\n ),\n {}\n )\n },\n filePath: \"\",\n id: \"\",\n importerName: \"--rulesdir\",\n importerPath: \"\"\n })\n }\n });\n }\n\n return baseConfigArray;\n}\n\n/**\n * Create the config array from CLI options.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n}) {\n const cliConfigArray = configArrayFactory.create(\n cliConfigData,\n { name: \"CLIOptions\" }\n );\n\n cliConfigArray.unshift(\n ...(ignorePath\n ? configArrayFactory.loadESLintIgnore(ignorePath)\n : configArrayFactory.loadDefaultESLintIgnore())\n );\n\n if (specificConfigPath) {\n cliConfigArray.unshift(\n ...configArrayFactory.loadFile(\n specificConfigPath,\n { name: \"--config\", basePath: cwd }\n )\n );\n }\n\n return cliConfigArray;\n}\n\n/**\n * The error type when there are files matched by a glob, but all of them have been ignored.\n */\nclass ConfigurationNotFoundError extends Error {\n\n\n /**\n * @param {string} directoryPath The directory path.\n */\n constructor(directoryPath) {\n super(`No ESLint configuration found in ${directoryPath}.`);\n this.messageTemplate = \"no-config-found\";\n this.messageData = { directoryPath };\n }\n}\n\n/**\n * This class provides the functionality that enumerates every file which is\n * matched by given glob patterns and that configuration.\n */\nclass CascadingConfigArrayFactory {\n\n /**\n * Initialize this enumerator.\n * @param {CascadingConfigArrayFactoryOptions} options The options.\n */\n constructor({\n additionalPluginPool = new Map(),\n baseConfig: baseConfigData = null,\n cliConfig: cliConfigData = null,\n cwd = process.cwd(),\n ignorePath,\n resolvePluginsRelativeTo,\n rulePaths = [],\n specificConfigPath = null,\n useEslintrc = true,\n builtInRules = new Map(),\n loadRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n } = {}) {\n const configArrayFactory = new ConfigArrayFactory({\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo,\n builtInRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n });\n\n internalSlotsMap.set(this, {\n baseConfigArray: createBaseConfigArray({\n baseConfigData,\n configArrayFactory,\n cwd,\n rulePaths,\n loadRules\n }),\n baseConfigData,\n cliConfigArray: createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n }),\n cliConfigData,\n configArrayFactory,\n configCache: new Map(),\n cwd,\n finalizeCache: new WeakMap(),\n ignorePath,\n rulePaths,\n specificConfigPath,\n useEslintrc,\n builtInRules,\n loadRules\n });\n }\n\n /**\n * The path to the current working directory.\n * This is used by tests.\n * @type {string}\n */\n get cwd() {\n const { cwd } = internalSlotsMap.get(this);\n\n return cwd;\n }\n\n /**\n * Get the config array of a given file.\n * If `filePath` was not given, it returns the config which contains only\n * `baseConfigData` and `cliConfigData`.\n * @param {string} [filePath] The file path to a file.\n * @param {Object} [options] The options.\n * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The config array of the file.\n */\n getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) {\n const {\n baseConfigArray,\n cliConfigArray,\n cwd\n } = internalSlotsMap.get(this);\n\n if (!filePath) {\n return new ConfigArray(...baseConfigArray, ...cliConfigArray);\n }\n\n const directoryPath = path.dirname(path.resolve(cwd, filePath));\n\n debug(`Load config files for ${directoryPath}.`);\n\n return this._finalizeConfigArray(\n this._loadConfigInAncestors(directoryPath),\n directoryPath,\n ignoreNotFoundError\n );\n }\n\n /**\n * Set the config data to override all configs.\n * Require to call `clearCache()` method after this method is called.\n * @param {ConfigData} configData The config data to override all configs.\n * @returns {void}\n */\n setOverrideConfig(configData) {\n const slots = internalSlotsMap.get(this);\n\n slots.cliConfigData = configData;\n }\n\n /**\n * Clear config cache.\n * @returns {void}\n */\n clearCache() {\n const slots = internalSlotsMap.get(this);\n\n slots.baseConfigArray = createBaseConfigArray(slots);\n slots.cliConfigArray = createCLIConfigArray(slots);\n slots.configCache.clear();\n }\n\n /**\n * Load and normalize config files from the ancestor directories.\n * @param {string} directoryPath The path to a leaf directory.\n * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories.\n * @returns {ConfigArray} The loaded config.\n * @throws {Error} If a config file is invalid.\n * @private\n */\n _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) {\n const {\n baseConfigArray,\n configArrayFactory,\n configCache,\n cwd,\n useEslintrc\n } = internalSlotsMap.get(this);\n\n if (!useEslintrc) {\n return baseConfigArray;\n }\n\n let configArray = configCache.get(directoryPath);\n\n // Hit cache.\n if (configArray) {\n debug(`Cache hit: ${directoryPath}.`);\n return configArray;\n }\n debug(`No cache found: ${directoryPath}.`);\n\n const homePath = os.homedir();\n\n // Consider this is root.\n if (directoryPath === homePath && cwd !== homePath) {\n debug(\"Stop traversing because of considered root.\");\n if (configsExistInSubdirs) {\n const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath);\n\n if (filePath) {\n emitDeprecationWarning(\n filePath,\n \"ESLINT_PERSONAL_CONFIG_SUPPRESS\"\n );\n }\n }\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n\n // Load the config on this directory.\n try {\n configArray = configArrayFactory.loadInDirectory(directoryPath);\n } catch (error) {\n /* istanbul ignore next */\n if (error.code === \"EACCES\") {\n debug(\"Stop traversing because of 'EACCES' error.\");\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n throw error;\n }\n\n if (configArray.length > 0 && configArray.isRoot()) {\n debug(\"Stop traversing because of 'root:true'.\");\n configArray.unshift(...baseConfigArray);\n return this._cacheConfig(directoryPath, configArray);\n }\n\n // Load from the ancestors and merge it.\n const parentPath = path.dirname(directoryPath);\n const parentConfigArray = parentPath && parentPath !== directoryPath\n ? this._loadConfigInAncestors(\n parentPath,\n configsExistInSubdirs || configArray.length > 0\n )\n : baseConfigArray;\n\n if (configArray.length > 0) {\n configArray.unshift(...parentConfigArray);\n } else {\n configArray = parentConfigArray;\n }\n\n // Cache and return.\n return this._cacheConfig(directoryPath, configArray);\n }\n\n /**\n * Freeze and cache a given config.\n * @param {string} directoryPath The path to a directory as a cache key.\n * @param {ConfigArray} configArray The config array as a cache value.\n * @returns {ConfigArray} The `configArray` (frozen).\n */\n _cacheConfig(directoryPath, configArray) {\n const { configCache } = internalSlotsMap.get(this);\n\n Object.freeze(configArray);\n configCache.set(directoryPath, configArray);\n\n return configArray;\n }\n\n /**\n * Finalize a given config array.\n * Concatenate `--config` and other CLI options.\n * @param {ConfigArray} configArray The parent config array.\n * @param {string} directoryPath The path to the leaf directory to find config files.\n * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The loaded config.\n * @throws {Error} If a config file is invalid.\n * @private\n */\n _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) {\n const {\n cliConfigArray,\n configArrayFactory,\n finalizeCache,\n useEslintrc,\n builtInRules\n } = internalSlotsMap.get(this);\n\n let finalConfigArray = finalizeCache.get(configArray);\n\n if (!finalConfigArray) {\n finalConfigArray = configArray;\n\n // Load the personal config if there are no regular config files.\n if (\n useEslintrc &&\n configArray.every(c => !c.filePath) &&\n cliConfigArray.every(c => !c.filePath) // `--config` option can be a file.\n ) {\n const homePath = os.homedir();\n\n debug(\"Loading the config file of the home directory:\", homePath);\n\n const personalConfigArray = configArrayFactory.loadInDirectory(\n homePath,\n { name: \"PersonalConfig\" }\n );\n\n if (\n personalConfigArray.length > 0 &&\n !directoryPath.startsWith(homePath)\n ) {\n const lastElement =\n personalConfigArray.at(-1);\n\n emitDeprecationWarning(\n lastElement.filePath,\n \"ESLINT_PERSONAL_CONFIG_LOAD\"\n );\n }\n\n finalConfigArray = finalConfigArray.concat(personalConfigArray);\n }\n\n // Apply CLI options.\n if (cliConfigArray.length > 0) {\n finalConfigArray = finalConfigArray.concat(cliConfigArray);\n }\n\n // Validate rule settings and environments.\n const validator = new ConfigValidator({\n builtInRules\n });\n\n validator.validateConfigArray(finalConfigArray);\n\n // Cache it.\n Object.freeze(finalConfigArray);\n finalizeCache.set(configArray, finalConfigArray);\n\n debug(\n \"Configuration was determined: %o on %s\",\n finalConfigArray,\n directoryPath\n );\n }\n\n // At least one element (the default ignore patterns) exists.\n if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) {\n throw new ConfigurationNotFoundError(directoryPath);\n }\n\n return finalConfigArray;\n }\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport { CascadingConfigArrayFactory };\n","/**\n * @fileoverview Compatibility class for flat config.\n * @author Nicholas C. Zakas\n */\n\n//-----------------------------------------------------------------------------\n// Requirements\n//-----------------------------------------------------------------------------\n\nimport createDebug from \"debug\";\nimport path from \"node:path\";\n\nimport environments from \"../conf/environments.js\";\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n\nconst debug = createDebug(\"eslintrc:flat-compat\");\nconst cafactory = Symbol(\"cafactory\");\n\n/**\n * Translates an ESLintRC-style config object into a flag-config-style config\n * object.\n * @param {Object} eslintrcConfig An ESLintRC-style config object.\n * @param {Object} options Options to help translate the config.\n * @param {string} options.resolveConfigRelativeTo To the directory to resolve\n * configs from.\n * @param {string} options.resolvePluginsRelativeTo The directory to resolve\n * plugins from.\n * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment\n * names to objects.\n * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor\n * names to objects.\n * @returns {Object} A flag-config-style config object.\n * @throws {Error} If a plugin or environment cannot be resolved.\n */\nfunction translateESLintRC(eslintrcConfig, {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo,\n pluginEnvironments,\n pluginProcessors\n}) {\n\n const flatConfig = {};\n const configs = [];\n const languageOptions = {};\n const linterOptions = {};\n const keysToCopy = [\"settings\", \"rules\", \"processor\"];\n const languageOptionsKeysToCopy = [\"globals\", \"parser\", \"parserOptions\"];\n const linterOptionsKeysToCopy = [\"noInlineConfig\", \"reportUnusedDisableDirectives\"];\n\n // copy over simple translations\n for (const key of keysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig[key] = eslintrcConfig[key];\n }\n }\n\n // copy over languageOptions\n for (const key of languageOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n\n // create the languageOptions key in the flat config\n flatConfig.languageOptions = languageOptions;\n\n if (key === \"parser\") {\n debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`);\n\n if (eslintrcConfig[key].error) {\n throw eslintrcConfig[key].error;\n }\n\n languageOptions[key] = eslintrcConfig[key].definition;\n continue;\n }\n\n // clone any object values that are in the eslintrc config\n if (eslintrcConfig[key] && typeof eslintrcConfig[key] === \"object\") {\n languageOptions[key] = {\n ...eslintrcConfig[key]\n };\n } else {\n languageOptions[key] = eslintrcConfig[key];\n }\n }\n }\n\n // copy over linterOptions\n for (const key of linterOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig.linterOptions = linterOptions;\n linterOptions[key] = eslintrcConfig[key];\n }\n }\n\n // move ecmaVersion a level up\n if (languageOptions.parserOptions) {\n\n if (\"ecmaVersion\" in languageOptions.parserOptions) {\n languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion;\n delete languageOptions.parserOptions.ecmaVersion;\n }\n\n if (\"sourceType\" in languageOptions.parserOptions) {\n languageOptions.sourceType = languageOptions.parserOptions.sourceType;\n delete languageOptions.parserOptions.sourceType;\n }\n\n // check to see if we even need parserOptions anymore and remove it if not\n if (Object.keys(languageOptions.parserOptions).length === 0) {\n delete languageOptions.parserOptions;\n }\n }\n\n // overrides\n if (eslintrcConfig.criteria) {\n flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)];\n }\n\n // translate plugins\n if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === \"object\") {\n debug(`Translating plugins: ${eslintrcConfig.plugins}`);\n\n flatConfig.plugins = {};\n\n for (const pluginName of Object.keys(eslintrcConfig.plugins)) {\n\n debug(`Translating plugin: ${pluginName}`);\n debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`);\n\n const { original: plugin, error } = eslintrcConfig.plugins[pluginName];\n\n if (error) {\n throw error;\n }\n\n flatConfig.plugins[pluginName] = plugin;\n\n // create a config for any processors\n if (plugin.processors) {\n for (const processorName of Object.keys(plugin.processors)) {\n if (processorName.startsWith(\".\")) {\n debug(`Assigning processor: ${pluginName}/${processorName}`);\n\n configs.unshift({\n files: [`**/*${processorName}`],\n processor: pluginProcessors.get(`${pluginName}/${processorName}`)\n });\n }\n\n }\n }\n }\n }\n\n // translate env - must come after plugins\n if (eslintrcConfig.env && typeof eslintrcConfig.env === \"object\") {\n for (const envName of Object.keys(eslintrcConfig.env)) {\n\n // only add environments that are true\n if (eslintrcConfig.env[envName]) {\n debug(`Translating environment: ${envName}`);\n\n if (environments.has(envName)) {\n\n // built-in environments should be defined first\n configs.unshift(...translateESLintRC({\n criteria: eslintrcConfig.criteria,\n ...environments.get(envName)\n }, {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n } else if (pluginEnvironments.has(envName)) {\n\n // if the environment comes from a plugin, it should come after the plugin config\n configs.push(...translateESLintRC({\n criteria: eslintrcConfig.criteria,\n ...pluginEnvironments.get(envName)\n }, {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n }\n }\n }\n }\n\n // only add if there are actually keys in the config\n if (Object.keys(flatConfig).length > 0) {\n configs.push(flatConfig);\n }\n\n return configs;\n}\n\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\n/**\n * A compatibility class for working with configs.\n */\nclass FlatCompat {\n\n constructor({\n baseDirectory = process.cwd(),\n resolvePluginsRelativeTo = baseDirectory,\n recommendedConfig,\n allConfig\n } = {}) {\n this.baseDirectory = baseDirectory;\n this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;\n this[cafactory] = new ConfigArrayFactory({\n cwd: baseDirectory,\n resolvePluginsRelativeTo,\n getEslintAllConfig() {\n\n if (!allConfig) {\n throw new TypeError(\"Missing parameter 'allConfig' in FlatCompat constructor.\");\n }\n\n return allConfig;\n },\n getEslintRecommendedConfig() {\n\n if (!recommendedConfig) {\n throw new TypeError(\"Missing parameter 'recommendedConfig' in FlatCompat constructor.\");\n }\n\n return recommendedConfig;\n }\n });\n }\n\n /**\n * Translates an ESLintRC-style config into a flag-config-style config.\n * @param {Object} eslintrcConfig The ESLintRC-style config object.\n * @returns {Object} A flag-config-style config object.\n */\n config(eslintrcConfig) {\n const eslintrcArray = this[cafactory].create(eslintrcConfig, {\n basePath: this.baseDirectory\n });\n\n const flatArray = [];\n let hasIgnorePatterns = false;\n\n eslintrcArray.forEach(configData => {\n if (configData.type === \"config\") {\n hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern;\n flatArray.push(...translateESLintRC(configData, {\n resolveConfigRelativeTo: path.join(this.baseDirectory, \"__placeholder.js\"),\n resolvePluginsRelativeTo: path.join(this.resolvePluginsRelativeTo, \"__placeholder.js\"),\n pluginEnvironments: eslintrcArray.pluginEnvironments,\n pluginProcessors: eslintrcArray.pluginProcessors\n }));\n }\n });\n\n // combine ignorePatterns to emulate ESLintRC behavior better\n if (hasIgnorePatterns) {\n flatArray.unshift({\n ignores: [filePath => {\n\n // Compute the final config for this file.\n // This filters config array elements by `files`/`excludedFiles` then merges the elements.\n const finalConfig = eslintrcArray.extractConfig(filePath);\n\n // Test the `ignorePattern` properties of the final config.\n return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath);\n }]\n });\n }\n\n return flatArray;\n }\n\n /**\n * Translates the `env` section of an ESLintRC-style config.\n * @param {Object} envConfig The `env` section of an ESLintRC config.\n * @returns {Object[]} An array of flag-config objects representing the environments.\n */\n env(envConfig) {\n return this.config({\n env: envConfig\n });\n }\n\n /**\n * Translates the `extends` section of an ESLintRC-style config.\n * @param {...string} configsToExtend The names of the configs to load.\n * @returns {Object[]} An array of flag-config objects representing the config.\n */\n extends(...configsToExtend) {\n return this.config({\n extends: configsToExtend\n });\n }\n\n /**\n * Translates the `plugins` section of an ESLintRC-style config.\n * @param {...string} plugins The names of the plugins to load.\n * @returns {Object[]} An array of flag-config objects representing the plugins.\n */\n plugins(...plugins) {\n return this.config({\n plugins\n });\n }\n}\n\nexport { FlatCompat };\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport {\n ConfigArrayFactory,\n createContext as createConfigArrayFactoryContext,\n loadConfigFile\n} from \"./config-array-factory.js\";\n\nimport { CascadingConfigArrayFactory } from \"./cascading-config-array-factory.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array/index.js\";\nimport { ConfigDependency } from \"./config-array/config-dependency.js\";\nimport { ExtractedConfig } from \"./config-array/extracted-config.js\";\nimport { IgnorePattern } from \"./config-array/ignore-pattern.js\";\nimport { OverrideTester } from \"./config-array/override-tester.js\";\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport { FlatCompat } from \"./flat-compat.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n ConfigArray,\n createConfigArrayFactoryContext,\n CascadingConfigArrayFactory,\n ConfigArrayFactory,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs,\n environments,\n loadConfigFile,\n\n // shared\n ConfigOps,\n ConfigValidator,\n ModuleResolver,\n naming\n};\n\nexport {\n\n Legacy,\n\n FlatCompat\n\n};\n"],"names":["debug","debugOrig","path","ignore","assert","internalSlotsMap","util","minimatch","Ajv","globals","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal","Module","require","createRequire","fs","stripComments","importFresh","ModuleResolver.resolve","naming.normalizePackageName","naming.getShorthandName","os","createDebug","createConfigArrayFactoryContext"],"mappings":"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I,EAAE,oBAAoB;AACtD,4BAA4B,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC;AACxF,yBAAyB;AACzB,qBAAqB,CAAC;AACtB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;;ACnoCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA,MAAMA,OAAK,GAAGC,6BAAS,CAAC,yCAAyC,CAAC,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAE,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC;AAC/B,IAAI,kBAAkB;AACtB,IAAI,cAAc;AAClB,IAAI,SAAS;AACb,IAAI,GAAG;AACP,IAAI,SAAS;AACb,CAAC,EAAE;AACH,IAAI,MAAM,eAAe,GAAG,kBAAkB,CAAC,MAAM;AACrD,QAAQ,cAAc;AACtB,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE;AAC9B,KAAK,CAAC;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,MAAM;AACrD,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC,eAAe,EAAE;AACzD,QAAQ,EAAE,IAAI,EAAE,sBAAsB,EAAE;AACxC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,C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"} \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.d.cts b/node_modules/@eslint/eslintrc/dist/eslintrc.d.cts new file mode 100644 index 0000000..258d3a5 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc.d.cts @@ -0,0 +1,76 @@ +/** + * @fileoverview This file contains the core types for ESLint. It was initially extracted + * from the `@types/eslint__eslintrc` package. + */ + +/* + * MIT License + * Copyright (c) Microsoft Corporation. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE + */ + +import type { Linter } from "eslint"; + +/** + * A compatibility class for working with configs. + */ +export class FlatCompat { + constructor({ + baseDirectory, + resolvePluginsRelativeTo, + recommendedConfig, + allConfig, + }?: { + /** + * default: process.cwd() + */ + baseDirectory?: string; + resolvePluginsRelativeTo?: string; + recommendedConfig?: Linter.LegacyConfig; + allConfig?: Linter.LegacyConfig; + }); + + /** + * Translates an ESLintRC-style config into a flag-config-style config. + * @param eslintrcConfig The ESLintRC-style config object. + * @returns A flag-config-style config object. + */ + config(eslintrcConfig: Linter.LegacyConfig): Linter.Config[]; + + /** + * Translates the `env` section of an ESLintRC-style config. + * @param envConfig The `env` section of an ESLintRC config. + * @returns An array of flag-config objects representing the environments. + */ + env(envConfig: { [name: string]: boolean }): Linter.Config[]; + + /** + * Translates the `extends` section of an ESLintRC-style config. + * @param configsToExtend The names of the configs to load. + * @returns An array of flag-config objects representing the config. + */ + extends(...configsToExtend: string[]): Linter.Config[]; + + /** + * Translates the `plugins` section of an ESLintRC-style config. + * @param plugins The names of the plugins to load. + * @returns An array of flag-config objects representing the plugins. + */ + plugins(...plugins: string[]): Linter.Config[]; +} diff --git a/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js new file mode 100644 index 0000000..7154910 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js @@ -0,0 +1,534 @@ +/** + * @fileoverview `CascadingConfigArrayFactory` class. + * + * `CascadingConfigArrayFactory` class has a responsibility: + * + * 1. Handles cascading of config files. + * + * It provides two methods: + * + * - `getConfigArrayForFile(filePath)` + * Get the corresponded configuration of a given file. This method doesn't + * throw even if the given file didn't exist. + * - `clearCache()` + * Clear the internal cache. You have to call this method when + * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends + * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.) + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import debugOrig from "debug"; +import os from "node:os"; +import path from "node:path"; + +import { ConfigArrayFactory } from "./config-array-factory.js"; +import { + ConfigArray, + ConfigDependency, + IgnorePattern +} from "./config-array/index.js"; +import ConfigValidator from "./shared/config-validator.js"; +import { emitDeprecationWarning } from "./shared/deprecation-warnings.js"; + +const debug = debugOrig("eslintrc:cascading-config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {ConfigData} [baseConfig] The config by `baseConfig` option. + * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files. + * @property {string} [cwd] The base directory to start lookup. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + * @property {string} [specificConfigPath] The value of `--config` option. + * @property {boolean} [useEslintrc] if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryInternalSlots + * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option. + * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`. + * @property {ConfigArray} cliConfigArray The config array of CLI options. + * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`. + * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {Map} configCache The cache from directory paths to config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`. + * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`. + * @property {boolean} useEslintrc if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Create the config array from `baseConfig` and `rulePaths`. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createBaseConfigArray({ + configArrayFactory, + baseConfigData, + rulePaths, + cwd, + loadRules +}) { + const baseConfigArray = configArrayFactory.create( + baseConfigData, + { name: "BaseConfig" } + ); + + /* + * Create the config array element for the default ignore patterns. + * This element has `ignorePattern` property that ignores the default + * patterns in the current working directory. + */ + baseConfigArray.unshift(configArrayFactory.create( + { ignorePatterns: IgnorePattern.DefaultPatterns }, + { name: "DefaultIgnorePattern" } + )[0]); + + /* + * Load rules `--rulesdir` option as a pseudo plugin. + * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate + * the rule's options with only information in the config array. + */ + if (rulePaths && rulePaths.length > 0) { + baseConfigArray.push({ + type: "config", + name: "--rulesdir", + filePath: "", + plugins: { + "": new ConfigDependency({ + definition: { + rules: rulePaths.reduce( + (map, rulesPath) => Object.assign( + map, + loadRules(rulesPath, cwd) + ), + {} + ) + }, + filePath: "", + id: "", + importerName: "--rulesdir", + importerPath: "" + }) + } + }); + } + + return baseConfigArray; +} + +/** + * Create the config array from CLI options. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath +}) { + const cliConfigArray = configArrayFactory.create( + cliConfigData, + { name: "CLIOptions" } + ); + + cliConfigArray.unshift( + ...(ignorePath + ? configArrayFactory.loadESLintIgnore(ignorePath) + : configArrayFactory.loadDefaultESLintIgnore()) + ); + + if (specificConfigPath) { + cliConfigArray.unshift( + ...configArrayFactory.loadFile( + specificConfigPath, + { name: "--config", basePath: cwd } + ) + ); + } + + return cliConfigArray; +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class ConfigurationNotFoundError extends Error { + + + /** + * @param {string} directoryPath The directory path. + */ + constructor(directoryPath) { + super(`No ESLint configuration found in ${directoryPath}.`); + this.messageTemplate = "no-config-found"; + this.messageData = { directoryPath }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class CascadingConfigArrayFactory { + + /** + * Initialize this enumerator. + * @param {CascadingConfigArrayFactoryOptions} options The options. + */ + constructor({ + additionalPluginPool = new Map(), + baseConfig: baseConfigData = null, + cliConfig: cliConfigData = null, + cwd = process.cwd(), + ignorePath, + resolvePluginsRelativeTo, + rulePaths = [], + specificConfigPath = null, + useEslintrc = true, + builtInRules = new Map(), + loadRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + } = {}) { + const configArrayFactory = new ConfigArrayFactory({ + additionalPluginPool, + cwd, + resolvePluginsRelativeTo, + builtInRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + }); + + internalSlotsMap.set(this, { + baseConfigArray: createBaseConfigArray({ + baseConfigData, + configArrayFactory, + cwd, + rulePaths, + loadRules + }), + baseConfigData, + cliConfigArray: createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath + }), + cliConfigData, + configArrayFactory, + configCache: new Map(), + cwd, + finalizeCache: new WeakMap(), + ignorePath, + rulePaths, + specificConfigPath, + useEslintrc, + builtInRules, + loadRules + }); + } + + /** + * The path to the current working directory. + * This is used by tests. + * @type {string} + */ + get cwd() { + const { cwd } = internalSlotsMap.get(this); + + return cwd; + } + + /** + * Get the config array of a given file. + * If `filePath` was not given, it returns the config which contains only + * `baseConfigData` and `cliConfigData`. + * @param {string} [filePath] The file path to a file. + * @param {Object} [options] The options. + * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The config array of the file. + */ + getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) { + const { + baseConfigArray, + cliConfigArray, + cwd + } = internalSlotsMap.get(this); + + if (!filePath) { + return new ConfigArray(...baseConfigArray, ...cliConfigArray); + } + + const directoryPath = path.dirname(path.resolve(cwd, filePath)); + + debug(`Load config files for ${directoryPath}.`); + + return this._finalizeConfigArray( + this._loadConfigInAncestors(directoryPath), + directoryPath, + ignoreNotFoundError + ); + } + + /** + * Set the config data to override all configs. + * Require to call `clearCache()` method after this method is called. + * @param {ConfigData} configData The config data to override all configs. + * @returns {void} + */ + setOverrideConfig(configData) { + const slots = internalSlotsMap.get(this); + + slots.cliConfigData = configData; + } + + /** + * Clear config cache. + * @returns {void} + */ + clearCache() { + const slots = internalSlotsMap.get(this); + + slots.baseConfigArray = createBaseConfigArray(slots); + slots.cliConfigArray = createCLIConfigArray(slots); + slots.configCache.clear(); + } + + /** + * Load and normalize config files from the ancestor directories. + * @param {string} directoryPath The path to a leaf directory. + * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories. + * @returns {ConfigArray} The loaded config. + * @throws {Error} If a config file is invalid. + * @private + */ + _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) { + const { + baseConfigArray, + configArrayFactory, + configCache, + cwd, + useEslintrc + } = internalSlotsMap.get(this); + + if (!useEslintrc) { + return baseConfigArray; + } + + let configArray = configCache.get(directoryPath); + + // Hit cache. + if (configArray) { + debug(`Cache hit: ${directoryPath}.`); + return configArray; + } + debug(`No cache found: ${directoryPath}.`); + + const homePath = os.homedir(); + + // Consider this is root. + if (directoryPath === homePath && cwd !== homePath) { + debug("Stop traversing because of considered root."); + if (configsExistInSubdirs) { + const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath); + + if (filePath) { + emitDeprecationWarning( + filePath, + "ESLINT_PERSONAL_CONFIG_SUPPRESS" + ); + } + } + return this._cacheConfig(directoryPath, baseConfigArray); + } + + // Load the config on this directory. + try { + configArray = configArrayFactory.loadInDirectory(directoryPath); + } catch (error) { + /* istanbul ignore next */ + if (error.code === "EACCES") { + debug("Stop traversing because of 'EACCES' error."); + return this._cacheConfig(directoryPath, baseConfigArray); + } + throw error; + } + + if (configArray.length > 0 && configArray.isRoot()) { + debug("Stop traversing because of 'root:true'."); + configArray.unshift(...baseConfigArray); + return this._cacheConfig(directoryPath, configArray); + } + + // Load from the ancestors and merge it. + const parentPath = path.dirname(directoryPath); + const parentConfigArray = parentPath && parentPath !== directoryPath + ? this._loadConfigInAncestors( + parentPath, + configsExistInSubdirs || configArray.length > 0 + ) + : baseConfigArray; + + if (configArray.length > 0) { + configArray.unshift(...parentConfigArray); + } else { + configArray = parentConfigArray; + } + + // Cache and return. + return this._cacheConfig(directoryPath, configArray); + } + + /** + * Freeze and cache a given config. + * @param {string} directoryPath The path to a directory as a cache key. + * @param {ConfigArray} configArray The config array as a cache value. + * @returns {ConfigArray} The `configArray` (frozen). + */ + _cacheConfig(directoryPath, configArray) { + const { configCache } = internalSlotsMap.get(this); + + Object.freeze(configArray); + configCache.set(directoryPath, configArray); + + return configArray; + } + + /** + * Finalize a given config array. + * Concatenate `--config` and other CLI options. + * @param {ConfigArray} configArray The parent config array. + * @param {string} directoryPath The path to the leaf directory to find config files. + * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The loaded config. + * @throws {Error} If a config file is invalid. + * @private + */ + _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) { + const { + cliConfigArray, + configArrayFactory, + finalizeCache, + useEslintrc, + builtInRules + } = internalSlotsMap.get(this); + + let finalConfigArray = finalizeCache.get(configArray); + + if (!finalConfigArray) { + finalConfigArray = configArray; + + // Load the personal config if there are no regular config files. + if ( + useEslintrc && + configArray.every(c => !c.filePath) && + cliConfigArray.every(c => !c.filePath) // `--config` option can be a file. + ) { + const homePath = os.homedir(); + + debug("Loading the config file of the home directory:", homePath); + + const personalConfigArray = configArrayFactory.loadInDirectory( + homePath, + { name: "PersonalConfig" } + ); + + if ( + personalConfigArray.length > 0 && + !directoryPath.startsWith(homePath) + ) { + const lastElement = + personalConfigArray.at(-1); + + emitDeprecationWarning( + lastElement.filePath, + "ESLINT_PERSONAL_CONFIG_LOAD" + ); + } + + finalConfigArray = finalConfigArray.concat(personalConfigArray); + } + + // Apply CLI options. + if (cliConfigArray.length > 0) { + finalConfigArray = finalConfigArray.concat(cliConfigArray); + } + + // Validate rule settings and environments. + const validator = new ConfigValidator({ + builtInRules + }); + + validator.validateConfigArray(finalConfigArray); + + // Cache it. + Object.freeze(finalConfigArray); + finalizeCache.set(configArray, finalConfigArray); + + debug( + "Configuration was determined: %o on %s", + finalConfigArray, + directoryPath + ); + } + + // At least one element (the default ignore patterns) exists. + if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) { + throw new ConfigurationNotFoundError(directoryPath); + } + + return finalConfigArray; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export { CascadingConfigArrayFactory }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/node_modules/@eslint/eslintrc/lib/config-array-factory.js new file mode 100644 index 0000000..5c7c3ef --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array-factory.js @@ -0,0 +1,1162 @@ +/** + * @fileoverview The factory of `ConfigArray` objects. + * + * This class provides methods to create `ConfigArray` instance. + * + * - `create(configData, options)` + * Create a `ConfigArray` instance from a config data. This is to handle CLI + * options except `--config`. + * - `loadFile(filePath, options)` + * Create a `ConfigArray` instance from a config file. This is to handle + * `--config` option. If the file was not found, throws the following error: + * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error. + * - If the filename was `package.json`, an IO error or an + * `ESLINT_CONFIG_FIELD_NOT_FOUND` error. + * - Otherwise, an IO error such as `ENOENT`. + * - `loadInDirectory(directoryPath, options)` + * Create a `ConfigArray` instance from a config file which is on a given + * directory. This tries to load `.eslintrc.*` or `package.json`. If not + * found, returns an empty `ConfigArray`. + * - `loadESLintIgnore(filePath)` + * Create a `ConfigArray` instance from a config file that is `.eslintignore` + * format. This is to handle `--ignore-path` option. + * - `loadDefaultESLintIgnore()` + * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in + * the current working directory. + * + * `ConfigArrayFactory` class has the responsibility that loads configuration + * files, including loading `extends`, `parser`, and `plugins`. The created + * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`. + * + * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class + * handles cascading and hierarchy. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import debugOrig from "debug"; +import fs from "node:fs"; +import importFresh from "import-fresh"; +import { createRequire } from "node:module"; +import path from "node:path"; +import stripComments from "strip-json-comments"; + +import { + ConfigArray, + ConfigDependency, + IgnorePattern, + OverrideTester +} from "./config-array/index.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import * as ModuleResolver from "./shared/relative-module-resolver.js"; + +const require = createRequire(import.meta.url); + +const debug = debugOrig("eslintrc:config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const configFilenames = [ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json", + ".eslintrc", + "package.json" +]; + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").OverrideConfigData} OverrideConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {import("./config-array/config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-array/config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {ConfigArray[0]} ConfigArrayElement */ + +/** + * @typedef {Object} ConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {string} [cwd] The path to the current working directory. + * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cwd The path to the current working directory. + * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {string} pluginBasePath The base path to resolve plugins. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** @type {WeakMap} */ +const normalizedPlugins = new WeakMap(); + +/** + * Check if a given string is a file path. + * @param {string} nameOrPath A module name or file path. + * @returns {boolean} `true` if the `nameOrPath` is a file path. + */ +function isFilePath(nameOrPath) { + return ( + /^\.{1,2}[/\\]/u.test(nameOrPath) || + path.isAbsolute(nameOrPath) + ); +} + +/** + * Convenience wrapper for synchronously reading file contents. + * @param {string} filePath The filename to read. + * @returns {string} The file contents, with the BOM removed. + * @private + */ +function readFile(filePath) { + return fs.readFileSync(filePath, "utf8").replace(/^\ufeff/u, ""); +} + +/** + * Loads a YAML configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadYAMLConfigFile(filePath) { + debug(`Loading YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + try { + + // empty YAML file can be null, so always use + return yaml.load(readFile(filePath)) || {}; + } catch (e) { + debug(`Error reading YAML file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JSON configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSONConfigFile(filePath) { + debug(`Loading JSON config file: ${filePath}`); + + try { + return JSON.parse(stripComments(readFile(filePath))); + } catch (e) { + debug(`Error reading JSON file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + e.messageTemplate = "failed-to-read-json"; + e.messageData = { + path: filePath, + message: e.message + }; + throw e; + } +} + +/** + * Loads a legacy (.eslintrc) configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadLegacyConfigFile(filePath) { + debug(`Loading legacy config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + try { + return yaml.load(stripComments(readFile(filePath))) || /* istanbul ignore next */ {}; + } catch (e) { + debug("Error reading YAML file: %s\n%o", filePath, e); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JavaScript configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSConfigFile(filePath) { + debug(`Loading JS config file: ${filePath}`); + try { + return importFresh(filePath); + } catch (e) { + debug(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a configuration from a package.json file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadPackageJSONConfigFile(filePath) { + debug(`Loading package.json config file: ${filePath}`); + try { + const packageData = loadJSONConfigFile(filePath); + + if (!Object.hasOwn(packageData, "eslintConfig")) { + throw Object.assign( + new Error("package.json file doesn't have 'eslintConfig' field."), + { code: "ESLINT_CONFIG_FIELD_NOT_FOUND" } + ); + } + + return packageData.eslintConfig; + } catch (e) { + debug(`Error reading package.json file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a `.eslintignore` from a file. + * @param {string} filePath The filename to load. + * @returns {string[]} The ignore patterns from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadESLintIgnoreFile(filePath) { + debug(`Loading .eslintignore file: ${filePath}`); + + try { + return readFile(filePath) + .split(/\r?\n/gu) + .filter(line => line.trim() !== "" && !line.startsWith("#")); + } catch (e) { + debug(`Error reading .eslintignore file: ${filePath}`); + e.message = `Cannot read .eslintignore file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Creates an error to notify about a missing config to extend from. + * @param {string} configName The name of the missing config. + * @param {string} importerName The name of the config that imported the missing config + * @param {string} messageTemplate The text template to source error strings from. + * @returns {Error} The error object to throw + * @private + */ +function configInvalidError(configName, importerName, messageTemplate) { + return Object.assign( + new Error(`Failed to load config "${configName}" to extend from.`), + { + messageTemplate, + messageData: { configName, importerName } + } + ); +} + +/** + * Loads a configuration file regardless of the source. Inspects the file path + * to determine the correctly way to load the config file. + * @param {string} filePath The path to the configuration. + * @returns {ConfigData|null} The configuration information. + * @private + */ +function loadConfigFile(filePath) { + switch (path.extname(filePath)) { + case ".js": + case ".cjs": + return loadJSConfigFile(filePath); + + case ".json": + if (path.basename(filePath) === "package.json") { + return loadPackageJSONConfigFile(filePath); + } + return loadJSONConfigFile(filePath); + + case ".yaml": + case ".yml": + return loadYAMLConfigFile(filePath); + + default: + return loadLegacyConfigFile(filePath); + } +} + +/** + * Write debug log. + * @param {string} request The requested module name. + * @param {string} relativeTo The file path to resolve the request relative to. + * @param {string} filePath The resolved file path. + * @returns {void} + */ +function writeDebugLogForLoading(request, relativeTo, filePath) { + /* istanbul ignore next */ + if (debug.enabled) { + let nameAndVersion = null; // eslint-disable-line no-useless-assignment -- known bug in the rule + + try { + const packageJsonPath = ModuleResolver.resolve( + `${request}/package.json`, + relativeTo + ); + const { version = "unknown" } = require(packageJsonPath); + + nameAndVersion = `${request}@${version}`; + } catch (error) { + debug("package.json was not found:", error.message); + nameAndVersion = request; + } + + debug("Loaded: %s (%s)", nameAndVersion, filePath); + } +} + +/** + * Create a new context with default values. + * @param {ConfigArrayFactoryInternalSlots} slots The internal slots. + * @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`. + * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`. + * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string. + * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`. + * @returns {ConfigArrayFactoryLoadingContext} The created context. + */ +function createContext( + { cwd, resolvePluginsRelativeTo }, + providedType, + providedName, + providedFilePath, + providedMatchBasePath +) { + const filePath = providedFilePath + ? path.resolve(cwd, providedFilePath) + : ""; + const matchBasePath = + (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) || + (filePath && path.dirname(filePath)) || + cwd; + const name = + providedName || + (filePath && path.relative(cwd, filePath)) || + ""; + const pluginBasePath = + resolvePluginsRelativeTo || + (filePath && path.dirname(filePath)) || + cwd; + const type = providedType || "config"; + + return { filePath, matchBasePath, name, pluginBasePath, type }; +} + +/** + * Normalize a given plugin. + * - Ensure the object to have four properties: configs, environments, processors, and rules. + * - Ensure the object to not have other properties. + * @param {Plugin} plugin The plugin to normalize. + * @returns {Plugin} The normalized plugin. + */ +function normalizePlugin(plugin) { + + // first check the cache + let normalizedPlugin = normalizedPlugins.get(plugin); + + if (normalizedPlugin) { + return normalizedPlugin; + } + + normalizedPlugin = { + configs: plugin.configs || {}, + environments: plugin.environments || {}, + processors: plugin.processors || {}, + rules: plugin.rules || {} + }; + + // save the reference for later + normalizedPlugins.set(plugin, normalizedPlugin); + + return normalizedPlugin; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The factory of `ConfigArray` objects. + */ +class ConfigArrayFactory { + + /** + * Initialize this instance. + * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins. + */ + constructor({ + additionalPluginPool = new Map(), + cwd = process.cwd(), + resolvePluginsRelativeTo, + builtInRules, + resolver = ModuleResolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = {}) { + internalSlotsMap.set(this, { + additionalPluginPool, + cwd, + resolvePluginsRelativeTo: + resolvePluginsRelativeTo && + path.resolve(cwd, resolvePluginsRelativeTo), + builtInRules, + resolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + }); + } + + /** + * Create `ConfigArray` instance from a config data. + * @param {ConfigData|null} configData The config data to create. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.filePath] The path to this config data. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + create(configData, { basePath, filePath, name } = {}) { + if (!configData) { + return new ConfigArray(); + } + + const slots = internalSlotsMap.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + const elements = this._normalizeConfigData(configData, ctx); + + return new ConfigArray(...elements); + } + + /** + * Load a config file. + * @param {string} filePath The path to a config file. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + loadFile(filePath, { basePath, name } = {}) { + const slots = internalSlotsMap.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + + return new ConfigArray(...this._loadConfigData(ctx)); + } + + /** + * Load the config file on a given directory if exists. + * @param {string} directoryPath The path to a directory. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @throws {Error} If the config file is invalid. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadInDirectory(directoryPath, { basePath, name } = {}) { + const slots = internalSlotsMap.get(this); + + for (const filename of configFilenames) { + const ctx = createContext( + slots, + "config", + name, + path.join(directoryPath, filename), + basePath + ); + + if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) { + let configData; + + try { + configData = loadConfigFile(ctx.filePath); + } catch (error) { + if (!error || error.code !== "ESLINT_CONFIG_FIELD_NOT_FOUND") { + throw error; + } + } + + if (configData) { + debug(`Config file found: ${ctx.filePath}`); + return new ConfigArray( + ...this._normalizeConfigData(configData, ctx) + ); + } + } + } + + debug(`Config file not found on ${directoryPath}`); + return new ConfigArray(); + } + + /** + * Check if a config file on a given directory exists or not. + * @param {string} directoryPath The path to a directory. + * @returns {string | null} The path to the found config file. If not found then null. + */ + static getPathToConfigFileInDirectory(directoryPath) { + for (const filename of configFilenames) { + const filePath = path.join(directoryPath, filename); + + if (fs.existsSync(filePath)) { + if (filename === "package.json") { + try { + loadPackageJSONConfigFile(filePath); + return filePath; + } catch { /* ignore */ } + } else { + return filePath; + } + } + } + return null; + } + + /** + * Load `.eslintignore` file. + * @param {string} filePath The path to a `.eslintignore` file to load. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadESLintIgnore(filePath) { + const slots = internalSlotsMap.get(this); + const ctx = createContext( + slots, + "ignore", + void 0, + filePath, + slots.cwd + ); + const ignorePatterns = loadESLintIgnoreFile(ctx.filePath); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(ignorePatterns, ctx) + ); + } + + /** + * Load `.eslintignore` file in the current working directory. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + * @throws {Error} If the ignore file is invalid. + */ + loadDefaultESLintIgnore() { + const slots = internalSlotsMap.get(this); + const eslintIgnorePath = path.resolve(slots.cwd, ".eslintignore"); + const packageJsonPath = path.resolve(slots.cwd, "package.json"); + + if (fs.existsSync(eslintIgnorePath)) { + return this.loadESLintIgnore(eslintIgnorePath); + } + if (fs.existsSync(packageJsonPath)) { + const data = loadJSONConfigFile(packageJsonPath); + + if (Object.hasOwn(data, "eslintIgnore")) { + if (!Array.isArray(data.eslintIgnore)) { + throw new Error("Package.json eslintIgnore property requires an array of paths"); + } + const ctx = createContext( + slots, + "ignore", + "eslintIgnore in package.json", + packageJsonPath, + slots.cwd + ); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx) + ); + } + } + + return new ConfigArray(); + } + + /** + * Load a given config file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} Loaded config. + * @private + */ + _loadConfigData(ctx) { + return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx); + } + + /** + * Normalize a given `.eslintignore` data to config array elements. + * @param {string[]} ignorePatterns The patterns to ignore files. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeESLintIgnoreData(ignorePatterns, ctx) { + const elements = this._normalizeObjectConfigData( + { ignorePatterns }, + ctx + ); + + // Set `ignorePattern.loose` flag for backward compatibility. + for (const element of elements) { + if (element.ignorePattern) { + element.ignorePattern.loose = true; + } + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _normalizeConfigData(configData, ctx) { + const validator = new ConfigValidator(); + + validator.validateConfigSchema(configData, ctx.name || ctx.filePath); + return this._normalizeObjectConfigData(configData, ctx); + } + + /** + * Normalize a given config to an array. + * @param {ConfigData|OverrideConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigData(configData, ctx) { + const { files, excludedFiles, ...configBody } = configData; + const criteria = OverrideTester.create( + files, + excludedFiles, + ctx.matchBasePath + ); + const elements = this._normalizeObjectConfigDataBody(configBody, ctx); + + // Apply the criteria to every element. + for (const element of elements) { + + /* + * Merge the criteria. + * This is for the `overrides` entries that came from the + * configurations of `overrides[].extends`. + */ + element.criteria = OverrideTester.and(criteria, element.criteria); + + /* + * Remove `root` property to ignore `root` settings which came from + * `extends` in `overrides`. + */ + if (element.criteria) { + element.root = void 0; + } + + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigDataBody( + { + env, + extends: extend, + globals, + ignorePatterns, + noInlineConfig, + parser: parserName, + parserOptions, + plugins: pluginList, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings, + overrides: overrideList = [] + }, + ctx + ) { + const extendList = Array.isArray(extend) ? extend : [extend]; + const ignorePattern = ignorePatterns && new IgnorePattern( + Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns], + ctx.matchBasePath + ); + + // Flatten `extends`. + for (const extendName of extendList.filter(Boolean)) { + yield* this._loadExtends(extendName, ctx); + } + + // Load parser & plugins. + const parser = parserName && this._loadParser(parserName, ctx); + const plugins = pluginList && this._loadPlugins(pluginList, ctx); + + // Yield pseudo config data for file extension processors. + if (plugins) { + yield* this._takeFileExtensionProcessors(plugins, ctx); + } + + // Yield the config data except `extends` and `overrides`. + yield { + + // Debug information. + type: ctx.type, + name: ctx.name, + filePath: ctx.filePath, + + // Config data. + criteria: null, + env, + globals, + ignorePattern, + noInlineConfig, + parser, + parserOptions, + plugins, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings + }; + + // Flatten `overries`. + for (let i = 0; i < overrideList.length; ++i) { + yield* this._normalizeObjectConfigData( + overrideList[i], + { ...ctx, name: `${ctx.name}#overrides[${i}]` } + ); + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @throws {Error} If the extended config file can't be loaded. + * @private + */ + _loadExtends(extendName, ctx) { + debug("Loading {extends:%j} relative to %s", extendName, ctx.filePath); + try { + if (extendName.startsWith("eslint:")) { + return this._loadExtendedBuiltInConfig(extendName, ctx); + } + if (extendName.startsWith("plugin:")) { + return this._loadExtendedPluginConfig(extendName, ctx); + } + return this._loadExtendedShareableConfig(extendName, ctx); + } catch (error) { + error.message += `\nReferenced from: ${ctx.filePath || ctx.name}`; + throw error; + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @throws {Error} If the extended config file can't be loaded. + * @private + */ + _loadExtendedBuiltInConfig(extendName, ctx) { + const { + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = internalSlotsMap.get(this); + + if (extendName === "eslint:recommended") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintRecommendedConfig) { + if (typeof getEslintRecommendedConfig !== "function") { + throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`); + } + return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintRecommendedPath + }); + } + if (extendName === "eslint:all") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintAllConfig) { + if (typeof getEslintAllConfig !== "function") { + throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`); + } + return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintAllPath + }); + } + + throw configInvalidError(extendName, ctx.name, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @throws {Error} If the extended config file can't be loaded. + * @private + */ + _loadExtendedPluginConfig(extendName, ctx) { + const slashIndex = extendName.lastIndexOf("/"); + + if (slashIndex === -1) { + throw configInvalidError(extendName, ctx.filePath, "plugin-invalid"); + } + + const pluginName = extendName.slice("plugin:".length, slashIndex); + const configName = extendName.slice(slashIndex + 1); + + if (isFilePath(pluginName)) { + throw new Error("'extends' cannot use a file path for plugins."); + } + + const plugin = this._loadPlugin(pluginName, ctx); + const configData = + plugin.definition && + plugin.definition.configs[configName]; + + if (configData) { + return this._normalizeConfigData(configData, { + ...ctx, + filePath: plugin.filePath || ctx.filePath, + name: `${ctx.name} » plugin:${plugin.id}/${configName}` + }); + } + + throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @throws {Error} If the extended config file can't be loaded. + * @private + */ + _loadExtendedShareableConfig(extendName, ctx) { + const { cwd, resolver } = internalSlotsMap.get(this); + const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); + let request; + + if (isFilePath(extendName)) { + request = extendName; + } else if (extendName.startsWith(".")) { + request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior. + } else { + request = naming.normalizePackageName( + extendName, + "eslint-config" + ); + } + + let filePath; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (error) { + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + throw configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + throw error; + } + + writeDebugLogForLoading(request, relativeTo, filePath); + return this._loadConfigData({ + ...ctx, + filePath, + name: `${ctx.name} » ${request}` + }); + } + + /** + * Load given plugins. + * @param {string[]} names The plugin names to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {Record} The loaded parser. + * @private + */ + _loadPlugins(names, ctx) { + return names.reduce((map, name) => { + if (isFilePath(name)) { + throw new Error("Plugins array cannot includes file paths."); + } + const plugin = this._loadPlugin(name, ctx); + + map[plugin.id] = plugin; + + return map; + }, {}); + } + + /** + * Load a given parser. + * @param {string} nameOrPath The package name or the path to a parser file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentParser} The loaded parser. + */ + _loadParser(nameOrPath, ctx) { + debug("Loading parser %j from %s", nameOrPath, ctx.filePath); + + const { cwd, resolver } = internalSlotsMap.get(this); + const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); + + try { + const filePath = resolver.resolve(nameOrPath, relativeTo); + + writeDebugLogForLoading(nameOrPath, relativeTo, filePath); + + return new ConfigDependency({ + definition: require(filePath), + filePath, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (error) { + + // If the parser name is "espree", load the espree of ESLint. + if (nameOrPath === "espree") { + debug("Fallback espree."); + return new ConfigDependency({ + definition: require("espree"), + filePath: require.resolve("espree"), + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + debug("Failed to load parser '%s' declared in '%s'.", nameOrPath, ctx.name); + error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`; + + return new ConfigDependency({ + error, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + } + + /** + * Load a given plugin. + * @param {string} name The plugin name to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentPlugin} The loaded plugin. + * @private + */ + _loadPlugin(name, ctx) { + debug("Loading plugin %j from %s", name, ctx.filePath); + + const { additionalPluginPool, resolver } = internalSlotsMap.get(this); + const request = naming.normalizePackageName(name, "eslint-plugin"); + const id = naming.getShorthandName(request, "eslint-plugin"); + const relativeTo = path.join(ctx.pluginBasePath, "__placeholder__.js"); + + if (name.match(/\s+/u)) { + const error = Object.assign( + new Error(`Whitespace found in plugin name '${name}'`), + { + messageTemplate: "whitespace-found", + messageData: { pluginName: request } + } + ); + + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + // Check for additional pool. + const plugin = + additionalPluginPool.get(request) || + additionalPluginPool.get(id); + + if (plugin) { + return new ConfigDependency({ + definition: normalizePlugin(plugin), + original: plugin, + filePath: "", // It's unknown where the plugin came from. + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + let filePath; + let error; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (resolveError) { + error = resolveError; + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + error.messageTemplate = "plugin-missing"; + error.messageData = { + pluginName: request, + resolvePluginsRelativeTo: ctx.pluginBasePath, + importerName: ctx.name + }; + } + } + + if (filePath) { + try { + writeDebugLogForLoading(request, relativeTo, filePath); + + const startTime = Date.now(); + const pluginDefinition = require(filePath); + + debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`); + + return new ConfigDependency({ + definition: normalizePlugin(pluginDefinition), + original: pluginDefinition, + filePath, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (loadError) { + error = loadError; + } + } + + debug("Failed to load plugin '%s' declared in '%s'.", name, ctx.name); + error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`; + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + /** + * Take file expression processors as config array elements. + * @param {Record} plugins The plugin definitions. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The config array elements of file expression processors. + * @private + */ + *_takeFileExtensionProcessors(plugins, ctx) { + for (const pluginId of Object.keys(plugins)) { + const processors = + plugins[pluginId] && + plugins[pluginId].definition && + plugins[pluginId].definition.processors; + + if (!processors) { + continue; + } + + for (const processorId of Object.keys(processors)) { + if (processorId.startsWith(".")) { + yield* this._normalizeObjectConfigData( + { + files: [`*${processorId}`], + processor: `${pluginId}/${processorId}` + }, + { + ...ctx, + type: "implicit-processor", + name: `${ctx.name}#processors["${pluginId}/${processorId}"]` + } + ); + } + } + } + } +} + +export { + ConfigArrayFactory, + createContext, + loadConfigFile +}; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/config-array.js b/node_modules/@eslint/eslintrc/lib/config-array/config-array.js new file mode 100644 index 0000000..8b3ec28 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/config-array.js @@ -0,0 +1,512 @@ +/** + * @fileoverview `ConfigArray` class. + * + * `ConfigArray` class expresses the full of a configuration. It has the entry + * config file, base config files that were extended, loaded parsers, and loaded + * plugins. + * + * `ConfigArray` class provides three properties and two methods. + * + * - `pluginEnvironments` + * - `pluginProcessors` + * - `pluginRules` + * The `Map` objects that contain the members of all plugins that this + * config array contains. Those map objects don't have mutation methods. + * Those keys are the member ID such as `pluginId/memberName`. + * - `isRoot()` + * If `true` then this configuration has `root:true` property. + * - `extractConfig(filePath)` + * Extract the final configuration for a given file. This means merging + * every config array element which that `criteria` property matched. The + * `filePath` argument must be an absolute path. + * + * `ConfigArrayFactory` provides the loading logic of config files. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import { ExtractedConfig } from "./extracted-config.js"; +import { IgnorePattern } from "./ignore-pattern.js"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../../shared/types").Rule} Rule */ +/** @typedef {import("../../shared/types").Plugin} Plugin */ +/** @typedef {import("../../shared/types").Processor} Processor */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {import("./override-tester")["OverrideTester"]} OverrideTester */ + +/** + * @typedef {Object} ConfigArrayElement + * @property {string} name The name of this config element. + * @property {string} filePath The path to the source file of this config element. + * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element. + * @property {Record|undefined} env The environment settings. + * @property {Record|undefined} globals The global variable settings. + * @property {IgnorePattern|undefined} ignorePattern The ignore patterns. + * @property {boolean|undefined} noInlineConfig The flag that disables directive comments. + * @property {DependentParser|undefined} parser The parser loader. + * @property {Object|undefined} parserOptions The parser options. + * @property {Record|undefined} plugins The plugin loaders. + * @property {string|undefined} processor The processor name to refer plugin's processor. + * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments. + * @property {boolean|undefined} root The flag to express root. + * @property {Record|undefined} rules The rule settings + * @property {Object|undefined} settings The shared settings. + * @property {"config" | "ignore" | "implicit-processor"} type The element type. + */ + +/** + * @typedef {Object} ConfigArrayInternalSlots + * @property {Map} cache The cache to extract configs. + * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition. + * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition. + * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new class extends WeakMap { + get(key) { + let value = super.get(key); + + if (!value) { + value = { + cache: new Map(), + envMap: null, + processorMap: null, + ruleMap: null + }; + super.set(key, value); + } + + return value; + } +}(); + +/** + * Get the indices which are matched to a given file. + * @param {ConfigArrayElement[]} elements The elements. + * @param {string} filePath The path to a target file. + * @returns {number[]} The indices. + */ +function getMatchedIndices(elements, filePath) { + const indices = []; + + for (let i = elements.length - 1; i >= 0; --i) { + const element = elements[i]; + + if (!element.criteria || (filePath && element.criteria.test(filePath))) { + indices.push(i); + } + } + + return indices; +} + +/** + * Check if a value is a non-null object. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(x) { + return typeof x === "object" && x !== null; +} + +/** + * Merge two objects. + * + * Assign every property values of `y` to `x` if `x` doesn't have the property. + * If `x`'s property value is an object, it does recursive. + * @param {Object} target The destination to merge + * @param {Object|undefined} source The source to merge. + * @returns {void} + */ +function mergeWithoutOverwrite(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + + if (isNonNullObject(target[key])) { + mergeWithoutOverwrite(target[key], source[key]); + } else if (target[key] === void 0) { + if (isNonNullObject(source[key])) { + target[key] = Array.isArray(source[key]) ? [] : {}; + mergeWithoutOverwrite(target[key], source[key]); + } else if (source[key] !== void 0) { + target[key] = source[key]; + } + } + } +} + +/** + * The error for plugin conflicts. + */ +class PluginConflictError extends Error { + + /** + * Initialize this error object. + * @param {string} pluginId The plugin ID. + * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins. + */ + constructor(pluginId, plugins) { + super(`Plugin "${pluginId}" was conflicted between ${plugins.map(p => `"${p.importerName}"`).join(" and ")}.`); + this.messageTemplate = "plugin-conflict"; + this.messageData = { pluginId, plugins }; + } +} + +/** + * Merge plugins. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + * @throws {PluginConflictError} When a plugin was conflicted. + */ +function mergePlugins(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetValue = target[key]; + const sourceValue = source[key]; + + // Adopt the plugin which was found at first. + if (targetValue === void 0) { + if (sourceValue.error) { + throw sourceValue.error; + } + target[key] = sourceValue; + } else if (sourceValue.filePath !== targetValue.filePath) { + throw new PluginConflictError(key, [ + { + filePath: targetValue.filePath, + importerName: targetValue.importerName + }, + { + filePath: sourceValue.filePath, + importerName: sourceValue.importerName + } + ]); + } + } +} + +/** + * Merge rule configs. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergeRuleConfigs(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetDef = target[key]; + const sourceDef = source[key]; + + // Adopt the rule config which was found at first. + if (targetDef === void 0) { + if (Array.isArray(sourceDef)) { + target[key] = [...sourceDef]; + } else { + target[key] = [sourceDef]; + } + + /* + * If the first found rule config is severity only and the current rule + * config has options, merge the severity and the options. + */ + } else if ( + targetDef.length === 1 && + Array.isArray(sourceDef) && + sourceDef.length >= 2 + ) { + targetDef.push(...sourceDef.slice(1)); + } + } +} + +/** + * Create the extracted config. + * @param {ConfigArray} instance The config elements. + * @param {number[]} indices The indices to use. + * @returns {ExtractedConfig} The extracted config. + * @throws {Error} When a plugin is conflicted. + */ +function createConfig(instance, indices) { + const config = new ExtractedConfig(); + const ignorePatterns = []; + + // Merge elements. + for (const index of indices) { + const element = instance[index]; + + // Adopt the parser which was found at first. + if (!config.parser && element.parser) { + if (element.parser.error) { + throw element.parser.error; + } + config.parser = element.parser; + } + + // Adopt the processor which was found at first. + if (!config.processor && element.processor) { + config.processor = element.processor; + } + + // Adopt the noInlineConfig which was found at first. + if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) { + config.noInlineConfig = element.noInlineConfig; + config.configNameOfNoInlineConfig = element.name; + } + + // Adopt the reportUnusedDisableDirectives which was found at first. + if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) { + config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives; + } + + // Collect ignorePatterns + if (element.ignorePattern) { + ignorePatterns.push(element.ignorePattern); + } + + // Merge others. + mergeWithoutOverwrite(config.env, element.env); + mergeWithoutOverwrite(config.globals, element.globals); + mergeWithoutOverwrite(config.parserOptions, element.parserOptions); + mergeWithoutOverwrite(config.settings, element.settings); + mergePlugins(config.plugins, element.plugins); + mergeRuleConfigs(config.rules, element.rules); + } + + // Create the predicate function for ignore patterns. + if (ignorePatterns.length > 0) { + config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse()); + } + + return config; +} + +/** + * Collect definitions. + * @template T, U + * @param {string} pluginId The plugin ID for prefix. + * @param {Record} defs The definitions to collect. + * @param {Map} map The map to output. + * @returns {void} + */ +function collect(pluginId, defs, map) { + if (defs) { + const prefix = pluginId && `${pluginId}/`; + + for (const [key, value] of Object.entries(defs)) { + map.set(`${prefix}${key}`, value); + } + } +} + +/** + * Delete the mutation methods from a given map. + * @param {Map} map The map object to delete. + * @returns {void} + */ +function deleteMutationMethods(map) { + Object.defineProperties(map, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + set: { configurable: true, value: void 0 } + }); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArrayElement[]} elements The config elements. + * @param {ConfigArrayInternalSlots} slots The internal slots. + * @returns {void} + */ +function initPluginMemberMaps(elements, slots) { + const processed = new Set(); + + slots.envMap = new Map(); + slots.processorMap = new Map(); + slots.ruleMap = new Map(); + + for (const element of elements) { + if (!element.plugins) { + continue; + } + + for (const [pluginId, value] of Object.entries(element.plugins)) { + const plugin = value.definition; + + if (!plugin || processed.has(pluginId)) { + continue; + } + processed.add(pluginId); + + collect(pluginId, plugin.environments, slots.envMap); + collect(pluginId, plugin.processors, slots.processorMap); + collect(pluginId, plugin.rules, slots.ruleMap); + } + } + + deleteMutationMethods(slots.envMap); + deleteMutationMethods(slots.processorMap); + deleteMutationMethods(slots.ruleMap); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArray} instance The config elements. + * @returns {ConfigArrayInternalSlots} The extracted config. + */ +function ensurePluginMemberMaps(instance) { + const slots = internalSlotsMap.get(instance); + + if (!slots.ruleMap) { + initPluginMemberMaps(instance, slots); + } + + return slots; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The Config Array. + * + * `ConfigArray` instance contains all settings, parsers, and plugins. + * You need to call `ConfigArray#extractConfig(filePath)` method in order to + * extract, merge and get only the config data which is related to an arbitrary + * file. + * @extends {Array} + */ +class ConfigArray extends Array { + + /** + * Get the plugin environments. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin environments. + */ + get pluginEnvironments() { + return ensurePluginMemberMaps(this).envMap; + } + + /** + * Get the plugin processors. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin processors. + */ + get pluginProcessors() { + return ensurePluginMemberMaps(this).processorMap; + } + + /** + * Get the plugin rules. + * The returned map cannot be mutated. + * @returns {ReadonlyMap} The plugin rules. + */ + get pluginRules() { + return ensurePluginMemberMaps(this).ruleMap; + } + + /** + * Check if this config has `root` flag. + * @returns {boolean} `true` if this config array is root. + */ + isRoot() { + for (let i = this.length - 1; i >= 0; --i) { + const root = this[i].root; + + if (typeof root === "boolean") { + return root; + } + } + return false; + } + + /** + * Extract the config data which is related to a given file. + * @param {string} filePath The absolute path to the target file. + * @returns {ExtractedConfig} The extracted config data. + */ + extractConfig(filePath) { + const { cache } = internalSlotsMap.get(this); + const indices = getMatchedIndices(this, filePath); + const cacheKey = indices.join(","); + + if (!cache.has(cacheKey)) { + cache.set(cacheKey, createConfig(this, indices)); + } + + return cache.get(cacheKey); + } + + /** + * Check if a given path is an additional lint target. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the file is an additional lint target. + */ + isAdditionalTargetPath(filePath) { + for (const { criteria, type } of this) { + if ( + type === "config" && + criteria && + !criteria.endsWithWildcard && + criteria.test(filePath) + ) { + return true; + } + } + return false; + } +} + +/** + * Get the used extracted configs. + * CLIEngine will use this method to collect used deprecated rules. + * @param {ConfigArray} instance The config array object to get. + * @returns {ExtractedConfig[]} The used extracted configs. + * @private + */ +function getUsedExtractedConfigs(instance) { + const { cache } = internalSlotsMap.get(instance); + + return Array.from(cache.values()); +} + + +export { + ConfigArray, + getUsedExtractedConfigs +}; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js b/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js new file mode 100644 index 0000000..8096895 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js @@ -0,0 +1,124 @@ +/** + * @fileoverview `ConfigDependency` class. + * + * `ConfigDependency` class expresses a loaded parser or plugin. + * + * If the parser or plugin was loaded successfully, it has `definition` property + * and `filePath` property. Otherwise, it has `error` property. + * + * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it + * omits `definition` property. + * + * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers + * or plugins. + * + * @author Toru Nagashima + */ + +import util from "node:util"; + +/** + * The class is to store parsers or plugins. + * This class hides the loaded object from `JSON.stringify()` and `console.log`. + * @template T + */ +class ConfigDependency { + + /** + * Initialize this instance. + * @param {Object} data The dependency data. + * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {T} [data.original] The original, non-normalized dependency if the loading succeeded. + * @param {Error} [data.error] The error object if the loading failed. + * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. + * @param {string} data.id The ID of this dependency. + * @param {string} data.importerName The name of the config file which loads this dependency. + * @param {string} data.importerPath The path to the config file which loads this dependency. + */ + constructor({ + definition = null, + original = null, + error = null, + filePath = null, + id, + importerName, + importerPath + }) { + + /** + * The loaded dependency if the loading succeeded. + * @type {T|null} + */ + this.definition = definition; + + /** + * The original dependency as loaded directly from disk if the loading succeeded. + * @type {T|null} + */ + this.original = original; + + /** + * The error object if the loading failed. + * @type {Error|null} + */ + this.error = error; + + /** + * The loaded dependency if the loading succeeded. + * @type {string|null} + */ + this.filePath = filePath; + + /** + * The ID of this dependency. + * @type {string} + */ + this.id = id; + + /** + * The name of the config file which loads this dependency. + * @type {string} + */ + this.importerName = importerName; + + /** + * The path to the config file which loads this dependency. + * @type {string} + */ + this.importerPath = importerPath; + } + + /** + * Converts this instance to a JSON compatible object. + * @returns {Object} a JSON compatible object. + */ + toJSON() { + const obj = this[util.inspect.custom](); + + // Display `error.message` (`Error#message` is unenumerable). + if (obj.error instanceof Error) { + obj.error = { ...obj.error, message: obj.error.message }; + } + + return obj; + } + + /** + * Custom inspect method for Node.js `console.log()`. + * @returns {Object} an object to display by `console.log()`. + */ + [util.inspect.custom]() { + const { + definition: _ignore1, // eslint-disable-line no-unused-vars -- needed to make `obj` correct + original: _ignore2, // eslint-disable-line no-unused-vars -- needed to make `obj` correct + ...obj + } = this; + + return obj; + } +} + +/** @typedef {ConfigDependency} DependentParser */ +/** @typedef {ConfigDependency} DependentPlugin */ + +export { ConfigDependency }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js b/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js new file mode 100644 index 0000000..65206f2 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js @@ -0,0 +1,145 @@ +/** + * @fileoverview `ExtractedConfig` class. + * + * `ExtractedConfig` class expresses a final configuration for a specific file. + * + * It provides one method. + * + * - `toCompatibleObjectAsConfigFileContent()` + * Convert this configuration to the compatible object as the content of + * config files. It converts the loaded parser and plugins to strings. + * `CLIEngine#getConfigForFile(filePath)` method uses this method. + * + * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance. + * + * @author Toru Nagashima + */ + +import { IgnorePattern } from "./ignore-pattern.js"; + +// For VSCode intellisense +/** @typedef {import("../../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").SeverityConf} SeverityConf */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ + +/** + * Check if `xs` starts with `ys`. + * @template T + * @param {T[]} xs The array to check. + * @param {T[]} ys The array that may be the first part of `xs`. + * @returns {boolean} `true` if `xs` starts with `ys`. + */ +function startsWith(xs, ys) { + return xs.length >= ys.length && ys.every((y, i) => y === xs[i]); +} + +/** + * The class for extracted config data. + */ +class ExtractedConfig { + constructor() { + + /** + * The config name what `noInlineConfig` setting came from. + * @type {string} + */ + this.configNameOfNoInlineConfig = ""; + + /** + * Environments. + * @type {Record} + */ + this.env = {}; + + /** + * Global variables. + * @type {Record} + */ + this.globals = {}; + + /** + * The glob patterns that ignore to lint. + * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined} + */ + this.ignores = void 0; + + /** + * The flag that disables directive comments. + * @type {boolean|undefined} + */ + this.noInlineConfig = void 0; + + /** + * Parser definition. + * @type {DependentParser|null} + */ + this.parser = null; + + /** + * Options for the parser. + * @type {Object} + */ + this.parserOptions = {}; + + /** + * Plugin definitions. + * @type {Record} + */ + this.plugins = {}; + + /** + * Processor ID. + * @type {string|null} + */ + this.processor = null; + + /** + * The flag that reports unused `eslint-disable` directive comments. + * @type {boolean|undefined} + */ + this.reportUnusedDisableDirectives = void 0; + + /** + * Rule settings. + * @type {Record} + */ + this.rules = {}; + + /** + * Shared settings. + * @type {Object} + */ + this.settings = {}; + } + + /** + * Convert this config to the compatible object as a config file content. + * @returns {ConfigData} The converted object. + */ + toCompatibleObjectAsConfigFileContent() { + const { + /* eslint-disable no-unused-vars -- needed to make `config` correct */ + configNameOfNoInlineConfig: _ignore1, + processor: _ignore2, + /* eslint-enable no-unused-vars -- needed to make `config` correct */ + ignores, + ...config + } = this; + + config.parser = config.parser && config.parser.filePath; + config.plugins = Object.keys(config.plugins).filter(Boolean).reverse(); + config.ignorePatterns = ignores ? ignores.patterns : []; + + // Strip the default patterns from `ignorePatterns`. + if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) { + config.ignorePatterns = + config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length); + } + + return config; + } +} + +export { ExtractedConfig }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js b/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js new file mode 100644 index 0000000..edb5287 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js @@ -0,0 +1,239 @@ +/** + * @fileoverview `IgnorePattern` class. + * + * `IgnorePattern` class has the set of glob patterns and the base path. + * + * It provides two static methods. + * + * - `IgnorePattern.createDefaultIgnore(cwd)` + * Create the default predicate function. + * - `IgnorePattern.createIgnore(ignorePatterns)` + * Create the predicate function from multiple `IgnorePattern` objects. + * + * It provides two properties and a method. + * + * - `patterns` + * The glob patterns that ignore to lint. + * - `basePath` + * The base path of the glob patterns. If absolute paths existed in the + * glob patterns, those are handled as relative paths to the base path. + * - `getPatternsRelativeTo(basePath)` + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * + * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes + * `ignorePatterns` properties. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import assert from "node:assert"; +import path from "node:path"; +import ignore from "ignore"; +import debugOrig from "debug"; + +const debug = debugOrig("eslintrc:ignore-pattern"); + +/** @typedef {ReturnType} Ignore */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the path to the common ancestor directory of given paths. + * @param {string[]} sourcePaths The paths to calculate the common ancestor. + * @returns {string} The path to the common ancestor directory. + */ +function getCommonAncestorPath(sourcePaths) { + let result = sourcePaths[0]; + + for (let i = 1; i < sourcePaths.length; ++i) { + const a = result; + const b = sourcePaths[i]; + + // Set the shorter one (it's the common ancestor if one includes the other). + result = a.length < b.length ? a : b; + + // Set the common ancestor. + for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) { + if (a[j] !== b[j]) { + result = a.slice(0, lastSepPos); + break; + } + if (a[j] === path.sep) { + lastSepPos = j; + } + } + } + + let resolvedResult = result || path.sep; + + // if Windows common ancestor is root of drive must have trailing slash to be absolute. + if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") { + resolvedResult += path.sep; + } + return resolvedResult; +} + +/** + * Make relative path. + * @param {string} from The source path to get relative path. + * @param {string} to The destination path to get relative path. + * @returns {string} The relative path. + */ +function relative(from, to) { + const relPath = path.relative(from, to); + + if (path.sep === "/") { + return relPath; + } + return relPath.split(path.sep).join("/"); +} + +/** + * Get the trailing slash if existed. + * @param {string} filePath The path to check. + * @returns {string} The trailing slash if existed. + */ +function dirSuffix(filePath) { + const isDir = ( + filePath.endsWith(path.sep) || + (process.platform === "win32" && filePath.endsWith("/")) + ); + + return isDir ? "/" : ""; +} + +const DefaultPatterns = Object.freeze(["/**/node_modules/*"]); +const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]); + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +/** + * Represents a set of glob patterns to ignore against a base path. + */ +class IgnorePattern { + + /** + * The default patterns. + * @type {string[]} + */ + static get DefaultPatterns() { + return DefaultPatterns; + } + + /** + * Create the default predicate function. + * @param {string} cwd The current working directory. + * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createDefaultIgnore(cwd) { + return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]); + } + + /** + * Create the predicate function from multiple `IgnorePattern` objects. + * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns. + * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createIgnore(ignorePatterns) { + debug("Create with: %o", ignorePatterns); + + const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath)); + const patterns = ignorePatterns.flatMap(p => p.getPatternsRelativeTo(basePath)); + const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]); + const dotIg = ignore({ allowRelativePaths: true }).add(patterns); + + debug(" processed: %o", { basePath, patterns }); + + return Object.assign( + (filePath, dot = false) => { + assert(path.isAbsolute(filePath), "'filePath' should be an absolute path."); + const relPathRaw = relative(basePath, filePath); + const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath)); + const adoptedIg = dot ? dotIg : ig; + const result = relPath !== "" && adoptedIg.ignores(relPath); + + debug("Check", { filePath, dot, relativePath: relPath, result }); + return result; + }, + { basePath, patterns } + ); + } + + /** + * Initialize a new `IgnorePattern` instance. + * @param {string[]} patterns The glob patterns that ignore to lint. + * @param {string} basePath The base path of `patterns`. + */ + constructor(patterns, basePath) { + assert(path.isAbsolute(basePath), "'basePath' should be an absolute path."); + + /** + * The glob patterns that ignore to lint. + * @type {string[]} + */ + this.patterns = patterns; + + /** + * The base path of `patterns`. + * @type {string} + */ + this.basePath = basePath; + + /** + * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`. + * + * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility. + * It's `false` as-is for `ignorePatterns` property in config files. + * @type {boolean} + */ + this.loose = false; + } + + /** + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * @param {string} newBasePath The base path. + * @returns {string[]} Modifired patterns. + */ + getPatternsRelativeTo(newBasePath) { + assert(path.isAbsolute(newBasePath), "'newBasePath' should be an absolute path."); + const { basePath, loose, patterns } = this; + + if (newBasePath === basePath) { + return patterns; + } + const prefix = `/${relative(newBasePath, basePath)}`; + + return patterns.map(pattern => { + const negative = pattern.startsWith("!"); + const head = negative ? "!" : ""; + const body = negative ? pattern.slice(1) : pattern; + + if (body.startsWith("/") || body.startsWith("../")) { + return `${head}${prefix}${body}`; + } + return loose ? pattern : `${head}${prefix}/**/${body}`; + }); + } +} + +export { IgnorePattern }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/index.js b/node_modules/@eslint/eslintrc/lib/config-array/index.js new file mode 100644 index 0000000..647f02b --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/index.js @@ -0,0 +1,19 @@ +/** + * @fileoverview `ConfigArray` class. + * @author Toru Nagashima + */ + +import { ConfigArray, getUsedExtractedConfigs } from "./config-array.js"; +import { ConfigDependency } from "./config-dependency.js"; +import { ExtractedConfig } from "./extracted-config.js"; +import { IgnorePattern } from "./ignore-pattern.js"; +import { OverrideTester } from "./override-tester.js"; + +export { + ConfigArray, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs +}; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js b/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js new file mode 100644 index 0000000..3a445b1 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js @@ -0,0 +1,227 @@ +/** + * @fileoverview `OverrideTester` class. + * + * `OverrideTester` class handles `files` property and `excludedFiles` property + * of `overrides` config. + * + * It provides one method. + * + * - `test(filePath)` + * Test if a file path matches the pair of `files` property and + * `excludedFiles` property. The `filePath` argument must be an absolute + * path. + * + * `ConfigArrayFactory` creates `OverrideTester` objects when it processes + * `overrides` properties. + * + * @author Toru Nagashima + */ + +import assert from "node:assert"; +import path from "node:path"; +import util from "node:util"; +import minimatch from "minimatch"; + +const { Minimatch } = minimatch; + +const minimatchOpts = { dot: true, matchBase: true }; + +/** + * @typedef {Object} Pattern + * @property {InstanceType[] | null} includes The positive matchers. + * @property {InstanceType[] | null} excludes The negative matchers. + */ + +/** + * Normalize a given pattern to an array. + * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns. + * @returns {string[]|null} Normalized patterns. + * @private + */ +function normalizePatterns(patterns) { + if (Array.isArray(patterns)) { + return patterns.filter(Boolean); + } + if (typeof patterns === "string" && patterns) { + return [patterns]; + } + return []; +} + +/** + * Create the matchers of given patterns. + * @param {string[]} patterns The patterns. + * @returns {InstanceType[] | null} The matchers. + */ +function toMatcher(patterns) { + if (patterns.length === 0) { + return null; + } + return patterns.map(pattern => { + if (/^\.[/\\]/u.test(pattern)) { + return new Minimatch( + pattern.slice(2), + + // `./*.js` should not match with `subdir/foo.js` + { ...minimatchOpts, matchBase: false } + ); + } + return new Minimatch(pattern, minimatchOpts); + }); +} + +/** + * Convert a given matcher to string. + * @param {Pattern} matchers The matchers. + * @returns {string} The string expression of the matcher. + */ +function patternToJson({ includes, excludes }) { + return { + includes: includes && includes.map(m => m.pattern), + excludes: excludes && excludes.map(m => m.pattern) + }; +} + +/** + * The class to test given paths are matched by the patterns. + */ +class OverrideTester { + + /** + * Create a tester with given criteria. + * If there are no criteria, returns `null`. + * @param {string|string[]} files The glob patterns for included files. + * @param {string|string[]} excludedFiles The glob patterns for excluded files. + * @param {string} basePath The path to the base directory to test paths. + * @returns {OverrideTester|null} The created instance or `null`. + * @throws {Error} When invalid patterns are given. + */ + static create(files, excludedFiles, basePath) { + const includePatterns = normalizePatterns(files); + const excludePatterns = normalizePatterns(excludedFiles); + let endsWithWildcard = false; + + if (includePatterns.length === 0) { + return null; + } + + // Rejects absolute paths or relative paths to parents. + for (const pattern of includePatterns) { + if (path.isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + if (pattern.endsWith("*")) { + endsWithWildcard = true; + } + } + for (const pattern of excludePatterns) { + if (path.isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + } + + const includes = toMatcher(includePatterns); + const excludes = toMatcher(excludePatterns); + + return new OverrideTester( + [{ includes, excludes }], + basePath, + endsWithWildcard + ); + } + + /** + * Combine two testers by logical and. + * If either of the testers was `null`, returns the other tester. + * The `basePath` property of the two must be the same value. + * @param {OverrideTester|null} a A tester. + * @param {OverrideTester|null} b Another tester. + * @returns {OverrideTester|null} Combined tester. + */ + static and(a, b) { + if (!b) { + return a && new OverrideTester( + a.patterns, + a.basePath, + a.endsWithWildcard + ); + } + if (!a) { + return new OverrideTester( + b.patterns, + b.basePath, + b.endsWithWildcard + ); + } + + assert.strictEqual(a.basePath, b.basePath); + return new OverrideTester( + a.patterns.concat(b.patterns), + a.basePath, + a.endsWithWildcard || b.endsWithWildcard + ); + } + + /** + * Initialize this instance. + * @param {Pattern[]} patterns The matchers. + * @param {string} basePath The base path. + * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`. + */ + constructor(patterns, basePath, endsWithWildcard = false) { + + /** @type {Pattern[]} */ + this.patterns = patterns; + + /** @type {string} */ + this.basePath = basePath; + + /** @type {boolean} */ + this.endsWithWildcard = endsWithWildcard; + } + + /** + * Test if a given path is matched or not. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the path was matched. + * @throws {Error} When invalid `filePath` is given. + */ + test(filePath) { + if (typeof filePath !== "string" || !path.isAbsolute(filePath)) { + throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`); + } + const relativePath = path.relative(this.basePath, filePath); + + return this.patterns.every(({ includes, excludes }) => ( + (!includes || includes.some(m => m.match(relativePath))) && + (!excludes || !excludes.some(m => m.match(relativePath))) + )); + } + + /** + * Converts this instance to a JSON compatible object. + * @returns {Object} a JSON compatible object. + */ + toJSON() { + if (this.patterns.length === 1) { + return { + ...patternToJson(this.patterns[0]), + basePath: this.basePath + }; + } + return { + AND: this.patterns.map(patternToJson), + basePath: this.basePath + }; + } + + /** + * Custom inspect method for Node.js `console.log()`. + * @returns {Object} an object to display by `console.log()`. + */ + [util.inspect.custom]() { + return this.toJSON(); + } +} + +export { OverrideTester }; diff --git a/node_modules/@eslint/eslintrc/lib/flat-compat.js b/node_modules/@eslint/eslintrc/lib/flat-compat.js new file mode 100644 index 0000000..caaca20 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/flat-compat.js @@ -0,0 +1,319 @@ +/** + * @fileoverview Compatibility class for flat config. + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +import createDebug from "debug"; +import path from "node:path"; + +import environments from "../conf/environments.js"; +import { ConfigArrayFactory } from "./config-array-factory.js"; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").Processor} Processor */ + +const debug = createDebug("eslintrc:flat-compat"); +const cafactory = Symbol("cafactory"); + +/** + * Translates an ESLintRC-style config object into a flag-config-style config + * object. + * @param {Object} eslintrcConfig An ESLintRC-style config object. + * @param {Object} options Options to help translate the config. + * @param {string} options.resolveConfigRelativeTo To the directory to resolve + * configs from. + * @param {string} options.resolvePluginsRelativeTo The directory to resolve + * plugins from. + * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment + * names to objects. + * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor + * names to objects. + * @returns {Object} A flag-config-style config object. + * @throws {Error} If a plugin or environment cannot be resolved. + */ +function translateESLintRC(eslintrcConfig, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo, + pluginEnvironments, + pluginProcessors +}) { + + const flatConfig = {}; + const configs = []; + const languageOptions = {}; + const linterOptions = {}; + const keysToCopy = ["settings", "rules", "processor"]; + const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"]; + const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"]; + + // copy over simple translations + for (const key of keysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig[key] = eslintrcConfig[key]; + } + } + + // copy over languageOptions + for (const key of languageOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + + // create the languageOptions key in the flat config + flatConfig.languageOptions = languageOptions; + + if (key === "parser") { + debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`); + + if (eslintrcConfig[key].error) { + throw eslintrcConfig[key].error; + } + + languageOptions[key] = eslintrcConfig[key].definition; + continue; + } + + // clone any object values that are in the eslintrc config + if (eslintrcConfig[key] && typeof eslintrcConfig[key] === "object") { + languageOptions[key] = { + ...eslintrcConfig[key] + }; + } else { + languageOptions[key] = eslintrcConfig[key]; + } + } + } + + // copy over linterOptions + for (const key of linterOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig.linterOptions = linterOptions; + linterOptions[key] = eslintrcConfig[key]; + } + } + + // move ecmaVersion a level up + if (languageOptions.parserOptions) { + + if ("ecmaVersion" in languageOptions.parserOptions) { + languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion; + delete languageOptions.parserOptions.ecmaVersion; + } + + if ("sourceType" in languageOptions.parserOptions) { + languageOptions.sourceType = languageOptions.parserOptions.sourceType; + delete languageOptions.parserOptions.sourceType; + } + + // check to see if we even need parserOptions anymore and remove it if not + if (Object.keys(languageOptions.parserOptions).length === 0) { + delete languageOptions.parserOptions; + } + } + + // overrides + if (eslintrcConfig.criteria) { + flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)]; + } + + // translate plugins + if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === "object") { + debug(`Translating plugins: ${eslintrcConfig.plugins}`); + + flatConfig.plugins = {}; + + for (const pluginName of Object.keys(eslintrcConfig.plugins)) { + + debug(`Translating plugin: ${pluginName}`); + debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`); + + const { original: plugin, error } = eslintrcConfig.plugins[pluginName]; + + if (error) { + throw error; + } + + flatConfig.plugins[pluginName] = plugin; + + // create a config for any processors + if (plugin.processors) { + for (const processorName of Object.keys(plugin.processors)) { + if (processorName.startsWith(".")) { + debug(`Assigning processor: ${pluginName}/${processorName}`); + + configs.unshift({ + files: [`**/*${processorName}`], + processor: pluginProcessors.get(`${pluginName}/${processorName}`) + }); + } + + } + } + } + } + + // translate env - must come after plugins + if (eslintrcConfig.env && typeof eslintrcConfig.env === "object") { + for (const envName of Object.keys(eslintrcConfig.env)) { + + // only add environments that are true + if (eslintrcConfig.env[envName]) { + debug(`Translating environment: ${envName}`); + + if (environments.has(envName)) { + + // built-in environments should be defined first + configs.unshift(...translateESLintRC({ + criteria: eslintrcConfig.criteria, + ...environments.get(envName) + }, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } else if (pluginEnvironments.has(envName)) { + + // if the environment comes from a plugin, it should come after the plugin config + configs.push(...translateESLintRC({ + criteria: eslintrcConfig.criteria, + ...pluginEnvironments.get(envName) + }, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } + } + } + } + + // only add if there are actually keys in the config + if (Object.keys(flatConfig).length > 0) { + configs.push(flatConfig); + } + + return configs; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A compatibility class for working with configs. + */ +class FlatCompat { + + constructor({ + baseDirectory = process.cwd(), + resolvePluginsRelativeTo = baseDirectory, + recommendedConfig, + allConfig + } = {}) { + this.baseDirectory = baseDirectory; + this.resolvePluginsRelativeTo = resolvePluginsRelativeTo; + this[cafactory] = new ConfigArrayFactory({ + cwd: baseDirectory, + resolvePluginsRelativeTo, + getEslintAllConfig() { + + if (!allConfig) { + throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor."); + } + + return allConfig; + }, + getEslintRecommendedConfig() { + + if (!recommendedConfig) { + throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor."); + } + + return recommendedConfig; + } + }); + } + + /** + * Translates an ESLintRC-style config into a flag-config-style config. + * @param {Object} eslintrcConfig The ESLintRC-style config object. + * @returns {Object} A flag-config-style config object. + */ + config(eslintrcConfig) { + const eslintrcArray = this[cafactory].create(eslintrcConfig, { + basePath: this.baseDirectory + }); + + const flatArray = []; + let hasIgnorePatterns = false; + + eslintrcArray.forEach(configData => { + if (configData.type === "config") { + hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern; + flatArray.push(...translateESLintRC(configData, { + resolveConfigRelativeTo: path.join(this.baseDirectory, "__placeholder.js"), + resolvePluginsRelativeTo: path.join(this.resolvePluginsRelativeTo, "__placeholder.js"), + pluginEnvironments: eslintrcArray.pluginEnvironments, + pluginProcessors: eslintrcArray.pluginProcessors + })); + } + }); + + // combine ignorePatterns to emulate ESLintRC behavior better + if (hasIgnorePatterns) { + flatArray.unshift({ + ignores: [filePath => { + + // Compute the final config for this file. + // This filters config array elements by `files`/`excludedFiles` then merges the elements. + const finalConfig = eslintrcArray.extractConfig(filePath); + + // Test the `ignorePattern` properties of the final config. + return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath); + }] + }); + } + + return flatArray; + } + + /** + * Translates the `env` section of an ESLintRC-style config. + * @param {Object} envConfig The `env` section of an ESLintRC config. + * @returns {Object[]} An array of flag-config objects representing the environments. + */ + env(envConfig) { + return this.config({ + env: envConfig + }); + } + + /** + * Translates the `extends` section of an ESLintRC-style config. + * @param {...string} configsToExtend The names of the configs to load. + * @returns {Object[]} An array of flag-config objects representing the config. + */ + extends(...configsToExtend) { + return this.config({ + extends: configsToExtend + }); + } + + /** + * Translates the `plugins` section of an ESLintRC-style config. + * @param {...string} plugins The names of the plugins to load. + * @returns {Object[]} An array of flag-config objects representing the plugins. + */ + plugins(...plugins) { + return this.config({ + plugins + }); + } +} + +export { FlatCompat }; diff --git a/node_modules/@eslint/eslintrc/lib/index-universal.js b/node_modules/@eslint/eslintrc/lib/index-universal.js new file mode 100644 index 0000000..6f6b302 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/index-universal.js @@ -0,0 +1,29 @@ +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import * as ConfigOps from "./shared/config-ops.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import environments from "../conf/environments.js"; + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + environments, + + // shared + ConfigOps, + ConfigValidator, + naming +}; + +export { + Legacy +}; diff --git a/node_modules/@eslint/eslintrc/lib/index.js b/node_modules/@eslint/eslintrc/lib/index.js new file mode 100644 index 0000000..a37e574 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/index.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import { + ConfigArrayFactory, + createContext as createConfigArrayFactoryContext, + loadConfigFile +} from "./config-array-factory.js"; + +import { CascadingConfigArrayFactory } from "./cascading-config-array-factory.js"; +import * as ModuleResolver from "./shared/relative-module-resolver.js"; +import { ConfigArray, getUsedExtractedConfigs } from "./config-array/index.js"; +import { ConfigDependency } from "./config-array/config-dependency.js"; +import { ExtractedConfig } from "./config-array/extracted-config.js"; +import { IgnorePattern } from "./config-array/ignore-pattern.js"; +import { OverrideTester } from "./config-array/override-tester.js"; +import * as ConfigOps from "./shared/config-ops.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import { FlatCompat } from "./flat-compat.js"; +import environments from "../conf/environments.js"; + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + ConfigArray, + createConfigArrayFactoryContext, + CascadingConfigArrayFactory, + ConfigArrayFactory, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs, + environments, + loadConfigFile, + + // shared + ConfigOps, + ConfigValidator, + ModuleResolver, + naming +}; + +export { + + Legacy, + + FlatCompat + +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/ajv.js b/node_modules/@eslint/eslintrc/lib/shared/ajv.js new file mode 100644 index 0000000..7e53d12 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/ajv.js @@ -0,0 +1,191 @@ +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import Ajv from "ajv"; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export default (additionalOptions = {}) => { + const ajv = new Ajv({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle -- part of the API + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/config-ops.js b/node_modules/@eslint/eslintrc/lib/shared/config-ops.js new file mode 100644 index 0000000..465d9b8 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/config-ops.js @@ -0,0 +1,135 @@ +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = new Set([0, 1, 2, "off", "warn", "error"]); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.has(severity); +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +export { + getRuleSeverity, + normalizeToStrings, + isErrorSeverity, + isValidSeverity, + isEverySeverityValid, + normalizeConfigGlobal +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/config-validator.js b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js new file mode 100644 index 0000000..6857e7a --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js @@ -0,0 +1,383 @@ +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +/* eslint class-methods-use-this: "off" -- not needed in this file */ + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").Rule} Rule */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import util from "node:util"; +import * as ConfigOps from "./config-ops.js"; +import { emitDeprecationWarning } from "./deprecation-warnings.js"; +import ajvOrig from "./ajv.js"; +import { deepMergeArrays } from "./deep-merge-arrays.js"; +import configSchema from "../../conf/config-schema.js"; +import BuiltInEnvironments from "../../conf/environments.js"; + +const ajv = ajvOrig(); + +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +// JSON schema that disallows passing any options +const noOptionsSchema = Object.freeze({ + type: "array", + minItems: 0, + maxItems: 0 +}); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Validator for configuration objects. + */ +export default class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {Rule} rule A rule object + * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`. + * @returns {Object|null} JSON Schema for the rule's options. + * `null` if rule wasn't passed or its `meta.schema` is `false`. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + if (!rule.meta) { + return { ...noOptionsSchema }; // default if `meta.schema` is not specified + } + + const schema = rule.meta.schema; + + if (typeof schema === "undefined") { + return { ...noOptionsSchema }; // default if `meta.schema` is not specified + } + + // `schema:false` is an allowed explicit opt-out of options validation for the rule + if (schema === false) { + return null; + } + + if (typeof schema !== "object" || schema === null) { + throw new TypeError("Rule's `meta.schema` must be an array or object"); + } + + // ESLint-specific array form needs to be converted into a valid JSON Schema definition + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + + // `schema:[]` is an explicit way to specify that the rule does not accept any options + return { ...noOptionsSchema }; + } + + // `schema:` is assumed to be a valid JSON Schema definition + return schema; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + * @throws {Error} If the severity is invalid. + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + * @throws {Error} If the options are invalid. + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + try { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } catch (err) { + const errorWithCode = new Error(err.message, { cause: err }); + + errorWithCode.code = "ESLINT_INVALID_RULE_OPTIONS_SCHEMA"; + + throw errorWithCode; + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, localOptions); + + validateRule(mergedOptions); + + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + * @throws {Error} If the options are invalid. + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + let enhancedMessage = err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA" + ? `Error while processing options validation schema of rule '${ruleId}': ${err.message}` + : `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + enhancedMessage = `${source}:\n\t${enhancedMessage}`; + } + + const enhancedError = new Error(enhancedMessage, { cause: err }); + + if (err.code) { + enhancedError.code = err.code; + } + + throw enhancedError; + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + * @throws {Error} If the environment is invalid. + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + ConfigOps.normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {(id:string) => Processor} getProcessor The getter of defined processors. + * @returns {void} + * @throws {Error} If the processor is invalid. + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + * @throws {Error} If the config is invalid. + */ + validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwn(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +} diff --git a/node_modules/@eslint/eslintrc/lib/shared/deep-merge-arrays.js b/node_modules/@eslint/eslintrc/lib/shared/deep-merge-arrays.js new file mode 100644 index 0000000..0c7ec34 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/deep-merge-arrays.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Applies default rule options + * @author JoshuaKGoldberg + */ + +/** + * Check if the variable contains an object strictly rejecting arrays + * @param {unknown} value an object + * @returns {boolean} Whether value is an object + */ +function isObjectNotArray(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + +/** + * Deeply merges second on top of first, creating a new {} object if needed. + * @param {T} first Base, default value. + * @param {U} second User-specified value. + * @returns {T | U | (T & U)} Merged equivalent of second on top of first. + */ +function deepMergeObjects(first, second) { + if (second === void 0) { + return first; + } + + if (!isObjectNotArray(first) || !isObjectNotArray(second)) { + return second; + } + + const result = { ...first, ...second }; + + for (const key of Object.keys(second)) { + if (Object.prototype.propertyIsEnumerable.call(first, key)) { + result[key] = deepMergeObjects(first[key], second[key]); + } + } + + return result; +} + +/** + * Deeply merges second on top of first, creating a new [] array if needed. + * @param {T[] | undefined} first Base, default values. + * @param {U[] | undefined} second User-specified values. + * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first. + */ +function deepMergeArrays(first, second) { + if (!first || !second) { + return second || first || []; + } + + return [ + ...first.map((value, i) => deepMergeObjects(value, second[i])), + ...second.slice(first.length) + ]; +} + +export { deepMergeArrays }; diff --git a/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js b/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js new file mode 100644 index 0000000..39cfe2c --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import path from "node:path"; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path.relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export { + emitDeprecationWarning +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/naming.js b/node_modules/@eslint/eslintrc/lib/shared/naming.js new file mode 100644 index 0000000..93df5fc --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/naming.js @@ -0,0 +1,96 @@ +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export { + normalizePackageName, + getShorthandName, + getNamespaceFromTerm +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js b/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js new file mode 100644 index 0000000..81415b4 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js @@ -0,0 +1,43 @@ +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +import Module from "node:module"; + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +const createRequire = Module.createRequire; + +/** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + * @throws {Error} When the module cannot be resolved. + */ +function resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } +} + +export { + resolve +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/types.js b/node_modules/@eslint/eslintrc/lib/shared/types.js new file mode 100644 index 0000000..a32c35e --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/types.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Define common types for input completion. + * @author Toru Nagashima + */ + +/** @type {any} */ +export default {}; + +/** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */ +/** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */ +/** @typedef {SeverityConf | [SeverityConf, ...any[]]} RuleConf */ + +/** + * @typedef {Object} EcmaFeatures + * @property {boolean} [globalReturn] Enabling `return` statements at the top-level. + * @property {boolean} [jsx] Enabling JSX syntax. + * @property {boolean} [impliedStrict] Enabling strict mode always. + */ + +/** + * @typedef {Object} ParserOptions + * @property {EcmaFeatures} [ecmaFeatures] The optional features. + * @property {3|5|6|7|8|9|10|11|12|2015|2016|2017|2018|2019|2020|2021} [ecmaVersion] The ECMAScript version (or revision number). + * @property {"script"|"module"} [sourceType] The source code type. + */ + +/** + * @typedef {Object} ConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {Record} [globals] The global variable settings. + * @property {string | string[]} [ignorePatterns] The glob patterns that ignore to lint. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {boolean} [root] The root flag. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} OverrideConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [excludedFiles] The glob pattarns for excluded files. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {string | string[]} files The glob patterns for target files. + * @property {Record} [globals] The global variable settings. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} ParseResult + * @property {Object} ast The AST. + * @property {ScopeManager} [scopeManager] The scope manager of the AST. + * @property {Record} [services] The services that the parser provides. + * @property {Record} [visitorKeys] The visitor keys of the AST. + */ + +/** + * @typedef {Object} Parser + * @property {(text:string, options:ParserOptions) => Object} parse The definition of global variables. + * @property {(text:string, options:ParserOptions) => ParseResult} [parseForESLint] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} Environment + * @property {Record} [globals] The definition of global variables. + * @property {ParserOptions} [parserOptions] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} LintMessage + * @property {number} column The 1-based column number. + * @property {number} [endColumn] The 1-based column number of the end location. + * @property {number} [endLine] The 1-based line number of the end location. + * @property {boolean} fatal If `true` then this is a fatal error. + * @property {{range:[number,number], text:string}} [fix] Information for autofix. + * @property {number} line The 1-based line number. + * @property {string} message The error message. + * @property {string|null} ruleId The ID of the rule which makes this message. + * @property {0|1|2} severity The severity of this message. + * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. + */ + +/** + * @typedef {Object} SuggestionResult + * @property {string} desc A short description. + * @property {string} [messageId] Id referencing a message for the description. + * @property {{ text: string, range: number[] }} fix fix result info + */ + +/** + * @typedef {Object} Processor + * @property {(text:string, filename:string) => Array} [preprocess] The function to extract code blocks. + * @property {(messagesList:LintMessage[][], filename:string) => LintMessage[]} [postprocess] The function to merge messages. + * @property {boolean} [supportsAutofix] If `true` then it means the processor supports autofix. + */ + +/** + * @typedef {Object} RuleMetaDocs + * @property {string} category The category of the rule. + * @property {string} description The description of the rule. + * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset. + * @property {string} url The URL of the rule documentation. + */ + +/** + * @typedef {Object} RuleMeta + * @property {boolean} [deprecated] If `true` then the rule has been deprecated. + * @property {RuleMetaDocs} docs The document information of the rule. + * @property {"code"|"whitespace"} [fixable] The autofix type. + * @property {Record} [messages] The messages the rule reports. + * @property {string[]} [replacedBy] The IDs of the alternative rules. + * @property {Array|Object} schema The option schema of the rule. + * @property {"problem"|"suggestion"|"layout"} type The rule type. + */ + +/** + * @typedef {Object} Rule + * @property {Function} create The factory of the rule. + * @property {RuleMeta} meta The meta data of the rule. + */ + +/** + * @typedef {Object} Plugin + * @property {Record} [configs] The definition of plugin configs. + * @property {Record} [environments] The definition of plugin environments. + * @property {Record} [processors] The definition of plugin processors. + * @property {Record} [rules] The definition of plugin rules. + */ + +/** + * Information of deprecated rules. + * @typedef {Object} DeprecatedRuleInfo + * @property {string} ruleId The rule ID. + * @property {string[]} replacedBy The rule IDs that replace this deprecated rule. + */ diff --git a/node_modules/@eslint/eslintrc/node_modules/globals/globals.json b/node_modules/@eslint/eslintrc/node_modules/globals/globals.json new file mode 100644 index 0000000..4e75173 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/globals/globals.json @@ -0,0 +1,1998 @@ +{ + "builtin": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, + "es5": { + "Array": false, + "Boolean": false, + "constructor": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "propertyIsEnumerable": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false + }, + "es2015": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es2017": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es2020": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es2021": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, + "browser": { + "AbortController": false, + "AbortSignal": false, + "addEventListener": false, + "alert": false, + "AnalyserNode": false, + "Animation": false, + "AnimationEffectReadOnly": false, + "AnimationEffectTiming": false, + "AnimationEffectTimingReadOnly": false, + "AnimationEvent": false, + "AnimationPlaybackEvent": false, + "AnimationTimeline": false, + "applicationCache": false, + "ApplicationCache": false, + "ApplicationCacheErrorEvent": false, + "atob": false, + "Attr": false, + "Audio": false, + "AudioBuffer": false, + "AudioBufferSourceNode": false, + "AudioContext": false, + "AudioDestinationNode": false, + "AudioListener": false, + "AudioNode": false, + "AudioParam": false, + "AudioProcessingEvent": false, + "AudioScheduledSourceNode": false, + "AudioWorkletGlobalScope": false, + "AudioWorkletNode": false, + "AudioWorkletProcessor": false, + "BarProp": false, + "BaseAudioContext": false, + "BatteryManager": false, + "BeforeUnloadEvent": false, + "BiquadFilterNode": false, + "Blob": false, + "BlobEvent": false, + "blur": false, + "BroadcastChannel": false, + "btoa": false, + "BudgetService": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "cancelAnimationFrame": false, + "cancelIdleCallback": false, + "CanvasCaptureMediaStreamTrack": false, + "CanvasGradient": false, + "CanvasPattern": false, + "CanvasRenderingContext2D": false, + "ChannelMergerNode": false, + "ChannelSplitterNode": false, + "CharacterData": false, + "clearInterval": false, + "clearTimeout": false, + "clientInformation": false, + "ClipboardEvent": false, + "ClipboardItem": false, + "close": false, + "closed": false, + "CloseEvent": false, + "Comment": false, + "CompositionEvent": false, + "CompressionStream": false, + "confirm": false, + "console": false, + "ConstantSourceNode": false, + "ConvolverNode": false, + "CountQueuingStrategy": false, + "createImageBitmap": false, + "Credential": false, + "CredentialsContainer": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CSS": false, + "CSSConditionRule": false, + "CSSFontFaceRule": false, + "CSSGroupingRule": false, + "CSSImportRule": false, + "CSSKeyframeRule": false, + "CSSKeyframesRule": false, + "CSSMatrixComponent": false, + "CSSMediaRule": false, + "CSSNamespaceRule": false, + "CSSPageRule": false, + "CSSPerspective": false, + "CSSRotate": false, + "CSSRule": false, + "CSSRuleList": false, + "CSSScale": false, + "CSSSkew": false, + "CSSSkewX": false, + "CSSSkewY": false, + "CSSStyleDeclaration": false, + "CSSStyleRule": false, + "CSSStyleSheet": false, + "CSSSupportsRule": false, + "CSSTransformValue": false, + "CSSTranslate": false, + "CustomElementRegistry": false, + "customElements": false, + "CustomEvent": false, + "DataTransfer": false, + "DataTransferItem": false, + "DataTransferItemList": false, + "DecompressionStream": false, + "defaultstatus": false, + "defaultStatus": false, + "DelayNode": false, + "DeviceMotionEvent": false, + "DeviceOrientationEvent": false, + "devicePixelRatio": false, + "dispatchEvent": false, + "document": false, + "Document": false, + "DocumentFragment": false, + "DocumentType": false, + "DOMError": false, + "DOMException": false, + "DOMImplementation": false, + "DOMMatrix": false, + "DOMMatrixReadOnly": false, + "DOMParser": false, + "DOMPoint": false, + "DOMPointReadOnly": false, + "DOMQuad": false, + "DOMRect": false, + "DOMRectList": false, + "DOMRectReadOnly": false, + "DOMStringList": false, + "DOMStringMap": false, + "DOMTokenList": false, + "DragEvent": false, + "DynamicsCompressorNode": false, + "Element": false, + "ErrorEvent": false, + "event": false, + "Event": false, + "EventSource": false, + "EventTarget": false, + "external": false, + "fetch": false, + "File": false, + "FileList": false, + "FileReader": false, + "find": false, + "focus": false, + "FocusEvent": false, + "FontFace": false, + "FontFaceSetLoadEvent": false, + "FormData": false, + "FormDataEvent": false, + "frameElement": false, + "frames": false, + "GainNode": false, + "Gamepad": false, + "GamepadButton": false, + "GamepadEvent": false, + "getComputedStyle": false, + "getSelection": false, + "HashChangeEvent": false, + "Headers": false, + "history": false, + "History": false, + "HTMLAllCollection": false, + "HTMLAnchorElement": false, + "HTMLAreaElement": false, + "HTMLAudioElement": false, + "HTMLBaseElement": false, + "HTMLBodyElement": false, + "HTMLBRElement": false, + "HTMLButtonElement": false, + "HTMLCanvasElement": false, + "HTMLCollection": false, + "HTMLContentElement": false, + "HTMLDataElement": false, + "HTMLDataListElement": false, + "HTMLDetailsElement": false, + "HTMLDialogElement": false, + "HTMLDirectoryElement": false, + "HTMLDivElement": false, + "HTMLDListElement": false, + "HTMLDocument": false, + "HTMLElement": false, + "HTMLEmbedElement": false, + "HTMLFieldSetElement": false, + "HTMLFontElement": false, + "HTMLFormControlsCollection": false, + "HTMLFormElement": false, + "HTMLFrameElement": false, + "HTMLFrameSetElement": false, + "HTMLHeadElement": false, + "HTMLHeadingElement": false, + "HTMLHRElement": false, + "HTMLHtmlElement": false, + "HTMLIFrameElement": false, + "HTMLImageElement": false, + "HTMLInputElement": false, + "HTMLLabelElement": false, + "HTMLLegendElement": false, + "HTMLLIElement": false, + "HTMLLinkElement": false, + "HTMLMapElement": false, + "HTMLMarqueeElement": false, + "HTMLMediaElement": false, + "HTMLMenuElement": false, + "HTMLMetaElement": false, + "HTMLMeterElement": false, + "HTMLModElement": false, + "HTMLObjectElement": false, + "HTMLOListElement": false, + "HTMLOptGroupElement": false, + "HTMLOptionElement": false, + "HTMLOptionsCollection": false, + "HTMLOutputElement": false, + "HTMLParagraphElement": false, + "HTMLParamElement": false, + "HTMLPictureElement": false, + "HTMLPreElement": false, + "HTMLProgressElement": false, + "HTMLQuoteElement": false, + "HTMLScriptElement": false, + "HTMLSelectElement": false, + "HTMLShadowElement": false, + "HTMLSlotElement": false, + "HTMLSourceElement": false, + "HTMLSpanElement": false, + "HTMLStyleElement": false, + "HTMLTableCaptionElement": false, + "HTMLTableCellElement": false, + "HTMLTableColElement": false, + "HTMLTableElement": false, + "HTMLTableRowElement": false, + "HTMLTableSectionElement": false, + "HTMLTemplateElement": false, + "HTMLTextAreaElement": false, + "HTMLTimeElement": false, + "HTMLTitleElement": false, + "HTMLTrackElement": false, + "HTMLUListElement": false, + "HTMLUnknownElement": false, + "HTMLVideoElement": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "IdleDeadline": false, + "IIRFilterNode": false, + "Image": false, + "ImageBitmap": false, + "ImageBitmapRenderingContext": false, + "ImageCapture": false, + "ImageData": false, + "indexedDB": false, + "innerHeight": false, + "innerWidth": false, + "InputEvent": false, + "IntersectionObserver": false, + "IntersectionObserverEntry": false, + "Intl": false, + "isSecureContext": false, + "KeyboardEvent": false, + "KeyframeEffect": false, + "KeyframeEffectReadOnly": false, + "length": false, + "localStorage": false, + "location": true, + "Location": false, + "locationbar": false, + "matchMedia": false, + "MediaDeviceInfo": false, + "MediaDevices": false, + "MediaElementAudioSourceNode": false, + "MediaEncryptedEvent": false, + "MediaError": false, + "MediaKeyMessageEvent": false, + "MediaKeySession": false, + "MediaKeyStatusMap": false, + "MediaKeySystemAccess": false, + "MediaList": false, + "MediaMetadata": false, + "MediaQueryList": false, + "MediaQueryListEvent": false, + "MediaRecorder": false, + "MediaSettingsRange": false, + "MediaSource": false, + "MediaStream": false, + "MediaStreamAudioDestinationNode": false, + "MediaStreamAudioSourceNode": false, + "MediaStreamConstraints": false, + "MediaStreamEvent": false, + "MediaStreamTrack": false, + "MediaStreamTrackEvent": false, + "menubar": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "MIDIAccess": false, + "MIDIConnectionEvent": false, + "MIDIInput": false, + "MIDIInputMap": false, + "MIDIMessageEvent": false, + "MIDIOutput": false, + "MIDIOutputMap": false, + "MIDIPort": false, + "MimeType": false, + "MimeTypeArray": false, + "MouseEvent": false, + "moveBy": false, + "moveTo": false, + "MutationEvent": false, + "MutationObserver": false, + "MutationRecord": false, + "name": false, + "NamedNodeMap": false, + "NavigationPreloadManager": false, + "navigator": false, + "Navigator": false, + "NavigatorUAData": false, + "NetworkInformation": false, + "Node": false, + "NodeFilter": false, + "NodeIterator": false, + "NodeList": false, + "Notification": false, + "OfflineAudioCompletionEvent": false, + "OfflineAudioContext": false, + "offscreenBuffering": false, + "OffscreenCanvas": true, + "OffscreenCanvasRenderingContext2D": false, + "onabort": true, + "onafterprint": true, + "onanimationend": true, + "onanimationiteration": true, + "onanimationstart": true, + "onappinstalled": true, + "onauxclick": true, + "onbeforeinstallprompt": true, + "onbeforeprint": true, + "onbeforeunload": true, + "onblur": true, + "oncancel": true, + "oncanplay": true, + "oncanplaythrough": true, + "onchange": true, + "onclick": true, + "onclose": true, + "oncontextmenu": true, + "oncuechange": true, + "ondblclick": true, + "ondevicemotion": true, + "ondeviceorientation": true, + "ondeviceorientationabsolute": true, + "ondrag": true, + "ondragend": true, + "ondragenter": true, + "ondragleave": true, + "ondragover": true, + "ondragstart": true, + "ondrop": true, + "ondurationchange": true, + "onemptied": true, + "onended": true, + "onerror": true, + "onfocus": true, + "ongotpointercapture": true, + "onhashchange": true, + "oninput": true, + "oninvalid": true, + "onkeydown": true, + "onkeypress": true, + "onkeyup": true, + "onlanguagechange": true, + "onload": true, + "onloadeddata": true, + "onloadedmetadata": true, + "onloadstart": true, + "onlostpointercapture": true, + "onmessage": true, + "onmessageerror": true, + "onmousedown": true, + "onmouseenter": true, + "onmouseleave": true, + "onmousemove": true, + "onmouseout": true, + "onmouseover": true, + "onmouseup": true, + "onmousewheel": true, + "onoffline": true, + "ononline": true, + "onpagehide": true, + "onpageshow": true, + "onpause": true, + "onplay": true, + "onplaying": true, + "onpointercancel": true, + "onpointerdown": true, + "onpointerenter": true, + "onpointerleave": true, + "onpointermove": true, + "onpointerout": true, + "onpointerover": true, + "onpointerup": true, + "onpopstate": true, + "onprogress": true, + "onratechange": true, + "onrejectionhandled": true, + "onreset": true, + "onresize": true, + "onscroll": true, + "onsearch": true, + "onseeked": true, + "onseeking": true, + "onselect": true, + "onstalled": true, + "onstorage": true, + "onsubmit": true, + "onsuspend": true, + "ontimeupdate": true, + "ontoggle": true, + "ontransitionend": true, + "onunhandledrejection": true, + "onunload": true, + "onvolumechange": true, + "onwaiting": true, + "onwheel": true, + "open": false, + "openDatabase": false, + "opener": false, + "Option": false, + "origin": false, + "OscillatorNode": false, + "outerHeight": false, + "outerWidth": false, + "OverconstrainedError": false, + "PageTransitionEvent": false, + "pageXOffset": false, + "pageYOffset": false, + "PannerNode": false, + "parent": false, + "Path2D": false, + "PaymentAddress": false, + "PaymentRequest": false, + "PaymentRequestUpdateEvent": false, + "PaymentResponse": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceLongTaskTiming": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceNavigationTiming": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformancePaintTiming": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "PeriodicWave": false, + "Permissions": false, + "PermissionStatus": false, + "personalbar": false, + "PhotoCapabilities": false, + "Plugin": false, + "PluginArray": false, + "PointerEvent": false, + "PopStateEvent": false, + "postMessage": false, + "Presentation": false, + "PresentationAvailability": false, + "PresentationConnection": false, + "PresentationConnectionAvailableEvent": false, + "PresentationConnectionCloseEvent": false, + "PresentationConnectionList": false, + "PresentationReceiver": false, + "PresentationRequest": false, + "print": false, + "ProcessingInstruction": false, + "ProgressEvent": false, + "PromiseRejectionEvent": false, + "prompt": false, + "PushManager": false, + "PushSubscription": false, + "PushSubscriptionOptions": false, + "queueMicrotask": false, + "RadioNodeList": false, + "Range": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "registerProcessor": false, + "RemotePlayback": false, + "removeEventListener": false, + "reportError": false, + "Request": false, + "requestAnimationFrame": false, + "requestIdleCallback": false, + "resizeBy": false, + "ResizeObserver": false, + "ResizeObserverEntry": false, + "resizeTo": false, + "Response": false, + "RTCCertificate": false, + "RTCDataChannel": false, + "RTCDataChannelEvent": false, + "RTCDtlsTransport": false, + "RTCIceCandidate": false, + "RTCIceGatherer": false, + "RTCIceTransport": false, + "RTCPeerConnection": false, + "RTCPeerConnectionIceEvent": false, + "RTCRtpContributingSource": false, + "RTCRtpReceiver": false, + "RTCRtpSender": false, + "RTCSctpTransport": false, + "RTCSessionDescription": false, + "RTCStatsReport": false, + "RTCTrackEvent": false, + "screen": false, + "Screen": false, + "screenLeft": false, + "ScreenOrientation": false, + "screenTop": false, + "screenX": false, + "screenY": false, + "ScriptProcessorNode": false, + "scroll": false, + "scrollbars": false, + "scrollBy": false, + "scrollTo": false, + "scrollX": false, + "scrollY": false, + "SecurityPolicyViolationEvent": false, + "Selection": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerRegistration": false, + "sessionStorage": false, + "setInterval": false, + "setTimeout": false, + "ShadowRoot": false, + "SharedWorker": false, + "SourceBuffer": false, + "SourceBufferList": false, + "speechSynthesis": false, + "SpeechSynthesisEvent": false, + "SpeechSynthesisUtterance": false, + "StaticRange": false, + "status": false, + "statusbar": false, + "StereoPannerNode": false, + "stop": false, + "Storage": false, + "StorageEvent": false, + "StorageManager": false, + "structuredClone": false, + "styleMedia": false, + "StyleSheet": false, + "StyleSheetList": false, + "SubmitEvent": false, + "SubtleCrypto": false, + "SVGAElement": false, + "SVGAngle": false, + "SVGAnimatedAngle": false, + "SVGAnimatedBoolean": false, + "SVGAnimatedEnumeration": false, + "SVGAnimatedInteger": false, + "SVGAnimatedLength": false, + "SVGAnimatedLengthList": false, + "SVGAnimatedNumber": false, + "SVGAnimatedNumberList": false, + "SVGAnimatedPreserveAspectRatio": false, + "SVGAnimatedRect": false, + "SVGAnimatedString": false, + "SVGAnimatedTransformList": false, + "SVGAnimateElement": false, + "SVGAnimateMotionElement": false, + "SVGAnimateTransformElement": false, + "SVGAnimationElement": false, + "SVGCircleElement": false, + "SVGClipPathElement": false, + "SVGComponentTransferFunctionElement": false, + "SVGDefsElement": false, + "SVGDescElement": false, + "SVGDiscardElement": false, + "SVGElement": false, + "SVGEllipseElement": false, + "SVGFEBlendElement": false, + "SVGFEColorMatrixElement": false, + "SVGFEComponentTransferElement": false, + "SVGFECompositeElement": false, + "SVGFEConvolveMatrixElement": false, + "SVGFEDiffuseLightingElement": false, + "SVGFEDisplacementMapElement": false, + "SVGFEDistantLightElement": false, + "SVGFEDropShadowElement": false, + "SVGFEFloodElement": false, + "SVGFEFuncAElement": false, + "SVGFEFuncBElement": false, + "SVGFEFuncGElement": false, + "SVGFEFuncRElement": false, + "SVGFEGaussianBlurElement": false, + "SVGFEImageElement": false, + "SVGFEMergeElement": false, + "SVGFEMergeNodeElement": false, + "SVGFEMorphologyElement": false, + "SVGFEOffsetElement": false, + "SVGFEPointLightElement": false, + "SVGFESpecularLightingElement": false, + "SVGFESpotLightElement": false, + "SVGFETileElement": false, + "SVGFETurbulenceElement": false, + "SVGFilterElement": false, + "SVGForeignObjectElement": false, + "SVGGElement": false, + "SVGGeometryElement": false, + "SVGGradientElement": false, + "SVGGraphicsElement": false, + "SVGImageElement": false, + "SVGLength": false, + "SVGLengthList": false, + "SVGLinearGradientElement": false, + "SVGLineElement": false, + "SVGMarkerElement": false, + "SVGMaskElement": false, + "SVGMatrix": false, + "SVGMetadataElement": false, + "SVGMPathElement": false, + "SVGNumber": false, + "SVGNumberList": false, + "SVGPathElement": false, + "SVGPatternElement": false, + "SVGPoint": false, + "SVGPointList": false, + "SVGPolygonElement": false, + "SVGPolylineElement": false, + "SVGPreserveAspectRatio": false, + "SVGRadialGradientElement": false, + "SVGRect": false, + "SVGRectElement": false, + "SVGScriptElement": false, + "SVGSetElement": false, + "SVGStopElement": false, + "SVGStringList": false, + "SVGStyleElement": false, + "SVGSVGElement": false, + "SVGSwitchElement": false, + "SVGSymbolElement": false, + "SVGTextContentElement": false, + "SVGTextElement": false, + "SVGTextPathElement": false, + "SVGTextPositioningElement": false, + "SVGTitleElement": false, + "SVGTransform": false, + "SVGTransformList": false, + "SVGTSpanElement": false, + "SVGUnitTypes": false, + "SVGUseElement": false, + "SVGViewElement": false, + "TaskAttributionTiming": false, + "Text": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TextEvent": false, + "TextMetrics": false, + "TextTrack": false, + "TextTrackCue": false, + "TextTrackCueList": false, + "TextTrackList": false, + "TimeRanges": false, + "ToggleEvent": false, + "toolbar": false, + "top": false, + "Touch": false, + "TouchEvent": false, + "TouchList": false, + "TrackEvent": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "TransitionEvent": false, + "TreeWalker": false, + "UIEvent": false, + "URL": false, + "URLSearchParams": false, + "ValidityState": false, + "visualViewport": false, + "VisualViewport": false, + "VTTCue": false, + "WaveShaperNode": false, + "WebAssembly": false, + "WebGL2RenderingContext": false, + "WebGLActiveInfo": false, + "WebGLBuffer": false, + "WebGLContextEvent": false, + "WebGLFramebuffer": false, + "WebGLProgram": false, + "WebGLQuery": false, + "WebGLRenderbuffer": false, + "WebGLRenderingContext": false, + "WebGLSampler": false, + "WebGLShader": false, + "WebGLShaderPrecisionFormat": false, + "WebGLSync": false, + "WebGLTexture": false, + "WebGLTransformFeedback": false, + "WebGLUniformLocation": false, + "WebGLVertexArrayObject": false, + "WebSocket": false, + "WheelEvent": false, + "window": false, + "Window": false, + "Worker": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false, + "XMLDocument": false, + "XMLHttpRequest": false, + "XMLHttpRequestEventTarget": false, + "XMLHttpRequestUpload": false, + "XMLSerializer": false, + "XPathEvaluator": false, + "XPathExpression": false, + "XPathResult": false, + "XRAnchor": false, + "XRBoundedReferenceSpace": false, + "XRCPUDepthInformation": false, + "XRDepthInformation": false, + "XRFrame": false, + "XRInputSource": false, + "XRInputSourceArray": false, + "XRInputSourceEvent": false, + "XRInputSourcesChangeEvent": false, + "XRPose": false, + "XRReferenceSpace": false, + "XRReferenceSpaceEvent": false, + "XRRenderState": false, + "XRRigidTransform": false, + "XRSession": false, + "XRSessionEvent": false, + "XRSpace": false, + "XRSystem": false, + "XRView": false, + "XRViewerPose": false, + "XRViewport": false, + "XRWebGLBinding": false, + "XRWebGLDepthInformation": false, + "XRWebGLLayer": false, + "XSLTProcessor": false + }, + "worker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "clearInterval": false, + "clearTimeout": false, + "close": true, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CustomEvent": false, + "DecompressionStream": false, + "ErrorEvent": false, + "Event": false, + "fetch": false, + "File": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": true, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onlanguagechange": true, + "onmessage": true, + "onoffline": true, + "ononline": true, + "onrejectionhandled": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "removeEventListener": false, + "reportError": false, + "Request": false, + "Response": false, + "self": true, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "SubtleCrypto": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "URL": false, + "URLSearchParams": false, + "WebAssembly": false, + "WebSocket": false, + "Worker": false, + "WorkerGlobalScope": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false, + "XMLHttpRequest": false + }, + "node": { + "__dirname": false, + "__filename": false, + "AbortController": false, + "AbortSignal": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Buffer": false, + "ByteLengthQueuingStrategy": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CustomEvent": false, + "DecompressionStream": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "exports": true, + "fetch": false, + "File": false, + "FormData": false, + "global": false, + "Headers": false, + "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "module": false, + "performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "process": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "Request": false, + "require": false, + "Response": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "structuredClone": false, + "SubtleCrypto": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "URL": false, + "URLSearchParams": false, + "WebAssembly": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false + }, + "nodeBuiltin": { + "AbortController": false, + "AbortSignal": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Buffer": false, + "ByteLengthQueuingStrategy": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CustomEvent": false, + "DecompressionStream": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "fetch": false, + "File": false, + "FormData": false, + "global": false, + "Headers": false, + "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "process": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "Request": false, + "Response": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "structuredClone": false, + "SubtleCrypto": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "URL": false, + "URLSearchParams": false, + "WebAssembly": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false + }, + "commonjs": { + "exports": true, + "global": false, + "module": false, + "require": false + }, + "amd": { + "define": false, + "require": false + }, + "mocha": { + "after": false, + "afterEach": false, + "before": false, + "beforeEach": false, + "context": false, + "describe": false, + "it": false, + "mocha": false, + "run": false, + "setup": false, + "specify": false, + "suite": false, + "suiteSetup": false, + "suiteTeardown": false, + "teardown": false, + "test": false, + "xcontext": false, + "xdescribe": false, + "xit": false, + "xspecify": false + }, + "jasmine": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "expectAsync": false, + "fail": false, + "fdescribe": false, + "fit": false, + "it": false, + "jasmine": false, + "pending": false, + "runs": false, + "spyOn": false, + "spyOnAllFunctions": false, + "spyOnProperty": false, + "waits": false, + "waitsFor": false, + "xdescribe": false, + "xit": false + }, + "jest": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "fdescribe": false, + "fit": false, + "it": false, + "jest": false, + "pit": false, + "require": false, + "test": false, + "xdescribe": false, + "xit": false, + "xtest": false + }, + "qunit": { + "asyncTest": false, + "deepEqual": false, + "equal": false, + "expect": false, + "module": false, + "notDeepEqual": false, + "notEqual": false, + "notOk": false, + "notPropEqual": false, + "notStrictEqual": false, + "ok": false, + "propEqual": false, + "QUnit": false, + "raises": false, + "start": false, + "stop": false, + "strictEqual": false, + "test": false, + "throws": false + }, + "phantomjs": { + "console": true, + "exports": true, + "phantom": true, + "require": true, + "WebPage": true + }, + "couch": { + "emit": false, + "exports": false, + "getRow": false, + "log": false, + "module": false, + "provides": false, + "require": false, + "respond": false, + "send": false, + "start": false, + "sum": false + }, + "rhino": { + "defineClass": false, + "deserialize": false, + "gc": false, + "help": false, + "importClass": false, + "importPackage": false, + "java": false, + "load": false, + "loadClass": false, + "Packages": false, + "print": false, + "quit": false, + "readFile": false, + "readUrl": false, + "runCommand": false, + "seal": false, + "serialize": false, + "spawn": false, + "sync": false, + "toint32": false, + "version": false + }, + "nashorn": { + "__DIR__": false, + "__FILE__": false, + "__LINE__": false, + "com": false, + "edu": false, + "exit": false, + "java": false, + "Java": false, + "javafx": false, + "JavaImporter": false, + "javax": false, + "JSAdapter": false, + "load": false, + "loadWithNewGlobal": false, + "org": false, + "Packages": false, + "print": false, + "quit": false + }, + "wsh": { + "ActiveXObject": false, + "CollectGarbage": false, + "Debug": false, + "Enumerator": false, + "GetObject": false, + "RuntimeObject": false, + "ScriptEngine": false, + "ScriptEngineBuildVersion": false, + "ScriptEngineMajorVersion": false, + "ScriptEngineMinorVersion": false, + "VBArray": false, + "WScript": false, + "WSH": false + }, + "jquery": { + "$": false, + "jQuery": false + }, + "yui": { + "YAHOO": false, + "YAHOO_config": false, + "YUI": false, + "YUI_config": false + }, + "shelljs": { + "cat": false, + "cd": false, + "chmod": false, + "config": false, + "cp": false, + "dirs": false, + "echo": false, + "env": false, + "error": false, + "exec": false, + "exit": false, + "find": false, + "grep": false, + "ln": false, + "ls": false, + "mkdir": false, + "mv": false, + "popd": false, + "pushd": false, + "pwd": false, + "rm": false, + "sed": false, + "set": false, + "target": false, + "tempdir": false, + "test": false, + "touch": false, + "which": false + }, + "prototypejs": { + "$": false, + "$$": false, + "$A": false, + "$break": false, + "$continue": false, + "$F": false, + "$H": false, + "$R": false, + "$w": false, + "Abstract": false, + "Ajax": false, + "Autocompleter": false, + "Builder": false, + "Class": false, + "Control": false, + "Draggable": false, + "Draggables": false, + "Droppables": false, + "Effect": false, + "Element": false, + "Enumerable": false, + "Event": false, + "Field": false, + "Form": false, + "Hash": false, + "Insertion": false, + "ObjectRange": false, + "PeriodicalExecuter": false, + "Position": false, + "Prototype": false, + "Scriptaculous": false, + "Selector": false, + "Sortable": false, + "SortableObserver": false, + "Sound": false, + "Template": false, + "Toggle": false, + "Try": false + }, + "meteor": { + "$": false, + "Accounts": false, + "AccountsClient": false, + "AccountsCommon": false, + "AccountsServer": false, + "App": false, + "Assets": false, + "Blaze": false, + "check": false, + "Cordova": false, + "DDP": false, + "DDPRateLimiter": false, + "DDPServer": false, + "Deps": false, + "EJSON": false, + "Email": false, + "HTTP": false, + "Log": false, + "Match": false, + "Meteor": false, + "Mongo": false, + "MongoInternals": false, + "Npm": false, + "Package": false, + "Plugin": false, + "process": false, + "Random": false, + "ReactiveDict": false, + "ReactiveVar": false, + "Router": false, + "ServiceConfiguration": false, + "Session": false, + "share": false, + "Spacebars": false, + "Template": false, + "Tinytest": false, + "Tracker": false, + "UI": false, + "Utils": false, + "WebApp": false, + "WebAppInternals": false + }, + "mongo": { + "_isWindows": false, + "_rand": false, + "BulkWriteResult": false, + "cat": false, + "cd": false, + "connect": false, + "db": false, + "getHostName": false, + "getMemInfo": false, + "hostname": false, + "ISODate": false, + "listFiles": false, + "load": false, + "ls": false, + "md5sumFile": false, + "mkdir": false, + "Mongo": false, + "NumberInt": false, + "NumberLong": false, + "ObjectId": false, + "PlanCache": false, + "print": false, + "printjson": false, + "pwd": false, + "quit": false, + "removeFile": false, + "rs": false, + "sh": false, + "UUID": false, + "version": false, + "WriteResult": false + }, + "applescript": { + "$": false, + "Application": false, + "Automation": false, + "console": false, + "delay": false, + "Library": false, + "ObjC": false, + "ObjectSpecifier": false, + "Path": false, + "Progress": false, + "Ref": false + }, + "serviceworker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "clearInterval": false, + "clearTimeout": false, + "Client": false, + "clients": false, + "Clients": false, + "close": true, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CustomEvent": false, + "DecompressionStream": false, + "ErrorEvent": false, + "Event": false, + "ExtendableEvent": false, + "ExtendableMessageEvent": false, + "fetch": false, + "FetchEvent": false, + "File": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": false, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onfetch": true, + "oninstall": true, + "onlanguagechange": true, + "onmessage": true, + "onmessageerror": true, + "onnotificationclick": true, + "onnotificationclose": true, + "onoffline": true, + "ononline": true, + "onpush": true, + "onpushsubscriptionchange": true, + "onrejectionhandled": true, + "onsync": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "registration": false, + "removeEventListener": false, + "Request": false, + "Response": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerGlobalScope": false, + "ServiceWorkerMessageEvent": false, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "skipWaiting": false, + "SubtleCrypto": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "URL": false, + "URLSearchParams": false, + "WebAssembly": false, + "WebSocket": false, + "WindowClient": false, + "Worker": false, + "WorkerGlobalScope": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false, + "XMLHttpRequest": false + }, + "atomtest": { + "advanceClock": false, + "atom": false, + "fakeClearInterval": false, + "fakeClearTimeout": false, + "fakeSetInterval": false, + "fakeSetTimeout": false, + "resetTimeouts": false, + "waitsForPromise": false + }, + "embertest": { + "andThen": false, + "click": false, + "currentPath": false, + "currentRouteName": false, + "currentURL": false, + "fillIn": false, + "find": false, + "findAll": false, + "findWithAssert": false, + "keyEvent": false, + "pauseTest": false, + "resumeTest": false, + "triggerEvent": false, + "visit": false, + "wait": false + }, + "protractor": { + "$": false, + "$$": false, + "browser": false, + "by": false, + "By": false, + "DartObject": false, + "element": false, + "protractor": false + }, + "shared-node-browser": { + "AbortController": false, + "AbortSignal": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "ByteLengthQueuingStrategy": false, + "clearInterval": false, + "clearTimeout": false, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CustomEvent": false, + "DecompressionStream": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "fetch": false, + "File": false, + "FormData": false, + "Headers": false, + "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "Request": false, + "Response": false, + "setInterval": false, + "setTimeout": false, + "structuredClone": false, + "SubtleCrypto": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "URL": false, + "URLSearchParams": false, + "WebAssembly": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false + }, + "webextensions": { + "browser": false, + "chrome": false, + "opr": false + }, + "greasemonkey": { + "cloneInto": false, + "createObjectIn": false, + "exportFunction": false, + "GM": false, + "GM_addElement": false, + "GM_addStyle": false, + "GM_addValueChangeListener": false, + "GM_deleteValue": false, + "GM_download": false, + "GM_getResourceText": false, + "GM_getResourceURL": false, + "GM_getTab": false, + "GM_getTabs": false, + "GM_getValue": false, + "GM_info": false, + "GM_listValues": false, + "GM_log": false, + "GM_notification": false, + "GM_openInTab": false, + "GM_registerMenuCommand": false, + "GM_removeValueChangeListener": false, + "GM_saveTab": false, + "GM_setClipboard": false, + "GM_setValue": false, + "GM_unregisterMenuCommand": false, + "GM_xmlhttpRequest": false, + "unsafeWindow": false + }, + "devtools": { + "$": false, + "$_": false, + "$$": false, + "$0": false, + "$1": false, + "$2": false, + "$3": false, + "$4": false, + "$x": false, + "chrome": false, + "clear": false, + "copy": false, + "debug": false, + "dir": false, + "dirxml": false, + "getEventListeners": false, + "inspect": false, + "keys": false, + "monitor": false, + "monitorEvents": false, + "profile": false, + "profileEnd": false, + "queryObjects": false, + "table": false, + "undebug": false, + "unmonitor": false, + "unmonitorEvents": false, + "values": false + } +} diff --git a/node_modules/@eslint/eslintrc/node_modules/globals/index.js b/node_modules/@eslint/eslintrc/node_modules/globals/index.js new file mode 100644 index 0000000..a951582 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/globals/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('./globals.json'); diff --git a/node_modules/@eslint/eslintrc/node_modules/globals/license b/node_modules/@eslint/eslintrc/node_modules/globals/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/globals/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@eslint/eslintrc/node_modules/globals/package.json b/node_modules/@eslint/eslintrc/node_modules/globals/package.json new file mode 100644 index 0000000..fca10a5 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/globals/package.json @@ -0,0 +1,58 @@ +{ + "name": "globals", + "version": "14.0.0", + "description": "Global identifiers from different JavaScript environments", + "license": "MIT", + "repository": "sindresorhus/globals", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "sideEffects": false, + "engines": { + "node": ">=18" + }, + "scripts": { + "test": "xo && ava && tsd", + "prepare": "npm run --silent update-types", + "update-builtin-globals": "node scripts/get-builtin-globals.mjs", + "update-types": "node scripts/generate-types.mjs > index.d.ts" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "devDependencies": { + "ava": "^2.4.0", + "cheerio": "^1.0.0-rc.12", + "tsd": "^0.30.4", + "type-fest": "^4.10.2", + "xo": "^0.36.1" + }, + "xo": { + "ignores": [ + "get-browser-globals.js" + ], + "rules": { + "node/no-unsupported-features/es-syntax": "off" + } + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + } +} diff --git a/node_modules/@eslint/eslintrc/node_modules/globals/readme.md b/node_modules/@eslint/eslintrc/node_modules/globals/readme.md new file mode 100644 index 0000000..29442a8 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/globals/readme.md @@ -0,0 +1,44 @@ +# globals + +> Global identifiers from different JavaScript environments + +It's just a [JSON file](globals.json), so use it in any environment. + +This package is used by ESLint. + +**This package [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** + +## Install + +```sh +npm install globals +``` + +## Usage + +```js +const globals = require('globals'); + +console.log(globals.browser); +/* +{ + addEventListener: false, + applicationCache: false, + ArrayBuffer: false, + atob: false, + … +} +*/ +``` + +Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise. + +For Node.js this package provides two sets of globals: + +- `globals.nodeBuiltin`: Globals available to all code running in Node.js. + These will usually be available as properties on the `global` object and include `process`, `Buffer`, but not CommonJS arguments like `require`. + See: https://nodejs.org/api/globals.html +- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope"). + See: https://nodejs.org/api/modules.html#modules_the_module_scope + +When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references. diff --git a/node_modules/@eslint/eslintrc/package.json b/node_modules/@eslint/eslintrc/package.json new file mode 100644 index 0000000..613b489 --- /dev/null +++ b/node_modules/@eslint/eslintrc/package.json @@ -0,0 +1,84 @@ +{ + "name": "@eslint/eslintrc", + "version": "3.3.0", + "description": "The legacy ESLintRC config file format for ESLint", + "type": "module", + "main": "./dist/eslintrc.cjs", + "types": "./dist/eslintrc.d.ts", + "exports": { + ".": { + "import": "./lib/index.js", + "require": "./dist/eslintrc.cjs", + "types": "./lib/types/index.d.ts" + }, + "./package.json": "./package.json", + "./universal": { + "import": "./lib/index-universal.js", + "require": "./dist/eslintrc-universal.cjs" + } + }, + "files": [ + "lib", + "conf", + "LICENSE", + "dist", + "universal.js" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "build": "rollup -c && node -e \"fs.copyFileSync('./lib/types/index.d.ts', './dist/eslintrc.d.cts')\"", + "lint": "eslint . --report-unused-disable-directives", + "lint:fix": "npm run lint -- --fix", + "prepare": "npm run build", + "release:generate:latest": "eslint-generate-release", + "release:generate:alpha": "eslint-generate-prerelease alpha", + "release:generate:beta": "eslint-generate-prerelease beta", + "release:generate:rc": "eslint-generate-prerelease rc", + "release:publish": "eslint-publish-release", + "test": "mocha -R progress -c 'tests/lib/*.cjs' && c8 mocha -R progress -c 'tests/lib/**/*.js'", + "test:types": "tsc -p tests/lib/types/tsconfig.json" + }, + "repository": "eslint/eslintrc", + "funding": "https://opencollective.com/eslint", + "keywords": [ + "ESLint", + "ESLintRC", + "Configuration" + ], + "author": "Nicholas C. Zakas", + "license": "MIT", + "bugs": { + "url": "https://github.com/eslint/eslintrc/issues" + }, + "homepage": "https://github.com/eslint/eslintrc#readme", + "devDependencies": { + "c8": "^7.7.3", + "chai": "^4.3.4", + "eslint": "^9.20.1", + "eslint-config-eslint": "^11.0.0", + "eslint-release": "^3.2.0", + "fs-teardown": "^0.1.3", + "mocha": "^9.0.3", + "rollup": "^2.70.1", + "shelljs": "^0.8.5", + "sinon": "^11.1.2", + "temp-dir": "^2.0.0", + "typescript": "^5.7.3" + }, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } +} diff --git a/node_modules/@eslint/eslintrc/universal.js b/node_modules/@eslint/eslintrc/universal.js new file mode 100644 index 0000000..2257383 --- /dev/null +++ b/node_modules/@eslint/eslintrc/universal.js @@ -0,0 +1,10 @@ +/* global module, require -- required for CJS file */ + +// Jest (and probably some other runtimes with custom implementations of +// `require`) doesn't support `exports` in `package.json`, so this file is here +// to help them load this module. Note that it is also `.js` and not `.cjs` for +// the same reason - `cjs` files requires to be loaded with an extension, but +// since Jest doesn't respect `module` outside of ESM mode it still works in +// this case (and the `require` in _this_ file does specify the extension). + +module.exports = require("./dist/eslintrc-universal.cjs"); diff --git a/node_modules/@eslint/js/LICENSE b/node_modules/@eslint/js/LICENSE new file mode 100644 index 0000000..b607bb3 --- /dev/null +++ b/node_modules/@eslint/js/LICENSE @@ -0,0 +1,19 @@ +Copyright OpenJS Foundation and other contributors, + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@eslint/js/README.md b/node_modules/@eslint/js/README.md new file mode 100644 index 0000000..04fc5b2 --- /dev/null +++ b/node_modules/@eslint/js/README.md @@ -0,0 +1,60 @@ +[![npm version](https://img.shields.io/npm/v/@eslint/js.svg)](https://www.npmjs.com/package/@eslint/js) + +# ESLint JavaScript Plugin + +[Website](https://eslint.org) | [Configure ESLint](https://eslint.org/docs/latest/use/configure) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/latest/contribute) | [Twitter](https://twitter.com/geteslint) | [Chatroom](https://eslint.org/chat) + +The beginnings of separating out JavaScript-specific functionality from ESLint. + +Right now, this plugin contains two configurations: + +* `recommended` - enables the rules recommended by the ESLint team (the replacement for `"eslint:recommended"`) +* `all` - enables all ESLint rules (the replacement for `"eslint:all"`) + +## Installation + +```shell +npm install @eslint/js -D +``` + +## Usage + +Use in your `eslint.config.js` file anytime you want to extend one of the configs: + +```js +import js from "@eslint/js"; + +export default [ + + // apply recommended rules to JS files + { + name: "your-project/recommended-rules", + files: ["**/*.js"], + rules: js.configs.recommended.rules + }, + + // apply recommended rules to JS files with an override + { + name: "your-project/recommended-rules-with-override", + files: ["**/*.js"], + rules: { + ...js.configs.recommended.rules, + "no-unused-vars": "warn" + } + }, + + // apply all rules to JS files + { + name: "your-project/all-rules", + files: ["**/*.js"], + rules: { + ...js.configs.all.rules, + "no-unused-vars": "warn" + } + } +] +``` + +## License + +MIT diff --git a/node_modules/@eslint/js/package.json b/node_modules/@eslint/js/package.json new file mode 100644 index 0000000..be77663 --- /dev/null +++ b/node_modules/@eslint/js/package.json @@ -0,0 +1,35 @@ +{ + "name": "@eslint/js", + "version": "9.21.0", + "description": "ESLint JavaScript language implementation", + "main": "./src/index.js", + "types": "./types/index.d.ts", + "scripts": { + "test:types": "tsc -p tests/types/tsconfig.json" + }, + "files": [ + "LICENSE", + "README.md", + "src", + "types" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/eslint/eslint.git", + "directory": "packages/js" + }, + "homepage": "https://eslint.org", + "bugs": "https://github.com/eslint/eslint/issues/", + "keywords": [ + "javascript", + "eslint-plugin", + "eslint" + ], + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } +} diff --git a/node_modules/@eslint/js/src/configs/eslint-all.js b/node_modules/@eslint/js/src/configs/eslint-all.js new file mode 100644 index 0000000..e7f4e0e --- /dev/null +++ b/node_modules/@eslint/js/src/configs/eslint-all.js @@ -0,0 +1,217 @@ +/* + * WARNING: This file is autogenerated using the tools/update-eslint-all.js + * script. Do not edit manually. + */ +"use strict"; + +/* eslint quote-props: off -- autogenerated so don't lint */ + +/* + * IMPORTANT! + * + * We cannot add a "name" property to this object because it's still used in eslintrc + * which doesn't support the "name" property. If we add a "name" property, it will + * cause an error. + */ + +module.exports = Object.freeze({ + "rules": { + "accessor-pairs": "error", + "array-callback-return": "error", + "arrow-body-style": "error", + "block-scoped-var": "error", + "camelcase": "error", + "capitalized-comments": "error", + "class-methods-use-this": "error", + "complexity": "error", + "consistent-return": "error", + "consistent-this": "error", + "constructor-super": "error", + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "default-param-last": "error", + "dot-notation": "error", + "eqeqeq": "error", + "for-direction": "error", + "func-name-matching": "error", + "func-names": "error", + "func-style": "error", + "getter-return": "error", + "grouped-accessor-pairs": "error", + "guard-for-in": "error", + "id-denylist": "error", + "id-length": "error", + "id-match": "error", + "init-declarations": "error", + "logical-assignment-operators": "error", + "max-classes-per-file": "error", + "max-depth": "error", + "max-lines": "error", + "max-lines-per-function": "error", + "max-nested-callbacks": "error", + "max-params": "error", + "max-statements": "error", + "new-cap": "error", + "no-alert": "error", + "no-array-constructor": "error", + "no-async-promise-executor": "error", + "no-await-in-loop": "error", + "no-bitwise": "error", + "no-caller": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-console": "error", + "no-const-assign": "error", + "no-constant-binary-expression": "error", + "no-constant-condition": "error", + "no-constructor-return": "error", + "no-continue": "error", + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-div-regex": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-else-if": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-duplicate-imports": "error", + "no-else-return": "error", + "no-empty": "error", + "no-empty-character-class": "error", + "no-empty-function": "error", + "no-empty-pattern": "error", + "no-empty-static-block": "error", + "no-eq-null": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-boolean-cast": "error", + "no-extra-label": "error", + "no-fallthrough": "error", + "no-func-assign": "error", + "no-global-assign": "error", + "no-implicit-coercion": "error", + "no-implicit-globals": "error", + "no-implied-eval": "error", + "no-import-assign": "error", + "no-inline-comments": "error", + "no-inner-declarations": "error", + "no-invalid-regexp": "error", + "no-invalid-this": "error", + "no-irregular-whitespace": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": "error", + "no-lone-blocks": "error", + "no-lonely-if": "error", + "no-loop-func": "error", + "no-loss-of-precision": "error", + "no-magic-numbers": "error", + "no-misleading-character-class": "error", + "no-multi-assign": "error", + "no-multi-str": "error", + "no-negated-condition": "error", + "no-nested-ternary": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-native-nonconstructor": "error", + "no-new-wrappers": "error", + "no-nonoctal-decimal-escape": "error", + "no-obj-calls": "error", + "no-object-constructor": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-param-reassign": "error", + "no-plusplus": "error", + "no-promise-executor-return": "error", + "no-proto": "error", + "no-prototype-builtins": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-restricted-exports": "error", + "no-restricted-globals": "error", + "no-restricted-imports": "error", + "no-restricted-properties": "error", + "no-restricted-syntax": "error", + "no-return-assign": "error", + "no-script-url": "error", + "no-self-assign": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-setter-return": "error", + "no-shadow": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-template-curly-in-string": "error", + "no-ternary": "error", + "no-this-before-super": "error", + "no-throw-literal": "error", + "no-undef": "error", + "no-undef-init": "error", + "no-undefined": "error", + "no-underscore-dangle": "error", + "no-unexpected-multiline": "error", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": "error", + "no-unreachable": "error", + "no-unreachable-loop": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unsafe-optional-chaining": "error", + "no-unused-expressions": "error", + "no-unused-labels": "error", + "no-unused-private-class-members": "error", + "no-unused-vars": "error", + "no-use-before-define": "error", + "no-useless-assignment": "error", + "no-useless-backreference": "error", + "no-useless-call": "error", + "no-useless-catch": "error", + "no-useless-computed-key": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-var": "error", + "no-void": "error", + "no-warning-comments": "error", + "no-with": "error", + "object-shorthand": "error", + "one-var": "error", + "operator-assignment": "error", + "prefer-arrow-callback": "error", + "prefer-const": "error", + "prefer-destructuring": "error", + "prefer-exponentiation-operator": "error", + "prefer-named-capture-group": "error", + "prefer-numeric-literals": "error", + "prefer-object-has-own": "error", + "prefer-object-spread": "error", + "prefer-promise-reject-errors": "error", + "prefer-regex-literals": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "prefer-template": "error", + "radix": "error", + "require-atomic-updates": "error", + "require-await": "error", + "require-unicode-regexp": "error", + "require-yield": "error", + "sort-imports": "error", + "sort-keys": "error", + "sort-vars": "error", + "strict": "error", + "symbol-description": "error", + "unicode-bom": "error", + "use-isnan": "error", + "valid-typeof": "error", + "vars-on-top": "error", + "yoda": "error" + } +}); diff --git a/node_modules/@eslint/js/src/configs/eslint-recommended.js b/node_modules/@eslint/js/src/configs/eslint-recommended.js new file mode 100644 index 0000000..3559267 --- /dev/null +++ b/node_modules/@eslint/js/src/configs/eslint-recommended.js @@ -0,0 +1,83 @@ +/** + * @fileoverview Configuration applied when a user configuration extends from + * eslint:recommended. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */ + +/* + * IMPORTANT! + * + * We cannot add a "name" property to this object because it's still used in eslintrc + * which doesn't support the "name" property. If we add a "name" property, it will + * cause an error. + */ + +module.exports = Object.freeze({ + rules: Object.freeze({ + "constructor-super": "error", + "for-direction": "error", + "getter-return": "error", + "no-async-promise-executor": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-binary-expression": "error", + "no-constant-condition": "error", + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-else-if": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-empty-static-block": "error", + "no-ex-assign": "error", + "no-extra-boolean-cast": "error", + "no-fallthrough": "error", + "no-func-assign": "error", + "no-global-assign": "error", + "no-import-assign": "error", + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-loss-of-precision": "error", + "no-misleading-character-class": "error", + "no-new-native-nonconstructor": "error", + "no-nonoctal-decimal-escape": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-prototype-builtins": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-self-assign": "error", + "no-setter-return": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-this-before-super": "error", + "no-undef": "error", + "no-unexpected-multiline": "error", + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unsafe-optional-chaining": "error", + "no-unused-labels": "error", + "no-unused-private-class-members": "error", + "no-unused-vars": "error", + "no-useless-backreference": "error", + "no-useless-catch": "error", + "no-useless-escape": "error", + "no-with": "error", + "require-yield": "error", + "use-isnan": "error", + "valid-typeof": "error" + }) +}); diff --git a/node_modules/@eslint/js/src/index.js b/node_modules/@eslint/js/src/index.js new file mode 100644 index 0000000..ec252bc --- /dev/null +++ b/node_modules/@eslint/js/src/index.js @@ -0,0 +1,23 @@ +/** + * @fileoverview Main package entrypoint. + * @author Nicholas C. Zakas + */ + +"use strict"; + +const { name, version } = require("../package.json"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + name, + version + }, + configs: { + all: require("./configs/eslint-all"), + recommended: require("./configs/eslint-recommended") + } +}; diff --git a/node_modules/@eslint/object-schema/LICENSE b/node_modules/@eslint/object-schema/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@eslint/object-schema/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@eslint/object-schema/README.md b/node_modules/@eslint/object-schema/README.md new file mode 100644 index 0000000..57191af --- /dev/null +++ b/node_modules/@eslint/object-schema/README.md @@ -0,0 +1,242 @@ +# ObjectSchema Package + +## Overview + +A JavaScript object merge/validation utility where you can define a different merge and validation strategy for each key. This is helpful when you need to validate complex data structures and then merge them in a way that is more complex than `Object.assign()`. This is used in the [`@eslint/config-array`](https://npmjs.com/package/@eslint/config-array) package but can also be used on its own. + +## Installation + +For Node.js and compatible runtimes: + +```shell +npm install @eslint/object-schema +# or +yarn add @eslint/object-schema +# or +pnpm install @eslint/object-schema +# or +bun install @eslint/object-schema +``` + +For Deno: + +```shell +deno add @eslint/object-schema +``` + +## Usage + +Import the `ObjectSchema` constructor: + +```js +// using ESM +import { ObjectSchema } from "@eslint/object-schema"; + +// using CommonJS +const { ObjectSchema } = require("@eslint/object-schema"); + +const schema = new ObjectSchema({ + // define a definition for the "downloads" key + downloads: { + required: true, + merge(value1, value2) { + return value1 + value2; + }, + validate(value) { + if (typeof value !== "number") { + throw new Error("Expected downloads to be a number."); + } + }, + }, + + // define a strategy for the "versions" key + version: { + required: true, + merge(value1, value2) { + return value1.concat(value2); + }, + validate(value) { + if (!Array.isArray(value)) { + throw new Error("Expected versions to be an array."); + } + }, + }, +}); + +const record1 = { + downloads: 25, + versions: ["v1.0.0", "v1.1.0", "v1.2.0"], +}; + +const record2 = { + downloads: 125, + versions: ["v2.0.0", "v2.1.0", "v3.0.0"], +}; + +// make sure the records are valid +schema.validate(record1); +schema.validate(record2); + +// merge together (schema.merge() accepts any number of objects) +const result = schema.merge(record1, record2); + +// result looks like this: + +const result = { + downloads: 75, + versions: ["v1.0.0", "v1.1.0", "v1.2.0", "v2.0.0", "v2.1.0", "v3.0.0"], +}; +``` + +## Tips and Tricks + +### Named merge strategies + +Instead of specifying a `merge()` method, you can specify one of the following strings to use a default merge strategy: + +- `"assign"` - use `Object.assign()` to merge the two values into one object. +- `"overwrite"` - the second value always replaces the first. +- `"replace"` - the second value replaces the first if the second is not `undefined`. + +For example: + +```js +const schema = new ObjectSchema({ + name: { + merge: "replace", + validate() {}, + }, +}); +``` + +### Named validation strategies + +Instead of specifying a `validate()` method, you can specify one of the following strings to use a default validation strategy: + +- `"array"` - value must be an array. +- `"boolean"` - value must be a boolean. +- `"number"` - value must be a number. +- `"object"` - value must be an object. +- `"object?"` - value must be an object or null. +- `"string"` - value must be a string. +- `"string!"` - value must be a non-empty string. + +For example: + +```js +const schema = new ObjectSchema({ + name: { + merge: "replace", + validate: "string", + }, +}); +``` + +### Subschemas + +If you are defining a key that is, itself, an object, you can simplify the process by using a subschema. Instead of defining `merge()` and `validate()`, assign a `schema` key that contains a schema definition, like this: + +```js +const schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string", + }, + last: { + merge: "replace", + validate: "string", + }, + }, + }, +}); + +schema.validate({ + name: { + first: "n", + last: "z", + }, +}); +``` + +### Remove Keys During Merge + +If the merge strategy for a key returns `undefined`, then the key will not appear in the final object. For example: + +```js +const schema = new ObjectSchema({ + date: { + merge() { + return undefined; + }, + validate(value) { + Date.parse(value); // throws an error when invalid + }, + }, +}); + +const object1 = { date: "5/5/2005" }; +const object2 = { date: "6/6/2006" }; + +const result = schema.merge(object1, object2); + +console.log("date" in result); // false +``` + +### Requiring Another Key Be Present + +If you'd like the presence of one key to require the presence of another key, you can use the `requires` property to specify an array of other properties that any key requires. For example: + +```js +const schema = new ObjectSchema(); + +const schema = new ObjectSchema({ + date: { + merge() { + return undefined; + }, + validate(value) { + Date.parse(value); // throws an error when invalid + }, + }, + time: { + requires: ["date"], + merge(first, second) { + return second; + }, + validate(value) { + // ... + }, + }, +}); + +// throws error: Key "time" requires keys "date" +schema.validate({ + time: "13:45", +}); +``` + +In this example, even though `date` is an optional key, it is required to be present whenever `time` is present. + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io

Silver Sponsors

+

SERP Triumph JetBrains Liftoff American Express

Bronze Sponsors

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/node_modules/@eslint/object-schema/dist/cjs/index.cjs b/node_modules/@eslint/object-schema/dist/cjs/index.cjs new file mode 100644 index 0000000..a9687a5 --- /dev/null +++ b/node_modules/@eslint/object-schema/dist/cjs/index.cjs @@ -0,0 +1,455 @@ +'use strict'; + +/** + * @fileoverview Merge Strategy + */ + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Container class for several different merge strategies. + */ +class MergeStrategy { + /** + * Merges two keys by overwriting the first with the second. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value. + */ + static overwrite(value1, value2) { + return value2; + } + + /** + * Merges two keys by replacing the first with the second only if the + * second is defined. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value if it is defined. + */ + static replace(value1, value2) { + if (typeof value2 !== "undefined") { + return value2; + } + + return value1; + } + + /** + * Merges two properties by assigning properties from the second to the first. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} A new object containing properties from both value1 and + * value2. + */ + static assign(value1, value2) { + return Object.assign({}, value1, value2); + } +} + +/** + * @fileoverview Validation Strategy + */ + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Container class for several different validation strategies. + */ +class ValidationStrategy { + /** + * Validates that a value is an array. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static array(value) { + if (!Array.isArray(value)) { + throw new TypeError("Expected an array."); + } + } + + /** + * Validates that a value is a boolean. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static boolean(value) { + if (typeof value !== "boolean") { + throw new TypeError("Expected a Boolean."); + } + } + + /** + * Validates that a value is a number. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static number(value) { + if (typeof value !== "number") { + throw new TypeError("Expected a number."); + } + } + + /** + * Validates that a value is a object. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static object(value) { + if (!value || typeof value !== "object") { + throw new TypeError("Expected an object."); + } + } + + /** + * Validates that a value is a object or null. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "object?"(value) { + if (typeof value !== "object") { + throw new TypeError("Expected an object or null."); + } + } + + /** + * Validates that a value is a string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static string(value) { + if (typeof value !== "string") { + throw new TypeError("Expected a string."); + } + } + + /** + * Validates that a value is a non-empty string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "string!"(value) { + if (typeof value !== "string" || value.length === 0) { + throw new TypeError("Expected a non-empty string."); + } + } +} + +/** + * @fileoverview Object Schema + */ + + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** @typedef {import("./types.ts").ObjectDefinition} ObjectDefinition */ +/** @typedef {import("./types.ts").PropertyDefinition} PropertyDefinition */ + +//----------------------------------------------------------------------------- +// Private +//----------------------------------------------------------------------------- + +/** + * Validates a schema strategy. + * @param {string} name The name of the key this strategy is for. + * @param {PropertyDefinition} definition The strategy for the object key. + * @returns {void} + * @throws {Error} When the strategy is missing a name. + * @throws {Error} When the strategy is missing a merge() method. + * @throws {Error} When the strategy is missing a validate() method. + */ +function validateDefinition(name, definition) { + let hasSchema = false; + if (definition.schema) { + if (typeof definition.schema === "object") { + hasSchema = true; + } else { + throw new TypeError("Schema must be an object."); + } + } + + if (typeof definition.merge === "string") { + if (!(definition.merge in MergeStrategy)) { + throw new TypeError( + `Definition for key "${name}" missing valid merge strategy.`, + ); + } + } else if (!hasSchema && typeof definition.merge !== "function") { + throw new TypeError( + `Definition for key "${name}" must have a merge property.`, + ); + } + + if (typeof definition.validate === "string") { + if (!(definition.validate in ValidationStrategy)) { + throw new TypeError( + `Definition for key "${name}" missing valid validation strategy.`, + ); + } + } else if (!hasSchema && typeof definition.validate !== "function") { + throw new TypeError( + `Definition for key "${name}" must have a validate() method.`, + ); + } +} + +//----------------------------------------------------------------------------- +// Errors +//----------------------------------------------------------------------------- + +/** + * Error when an unexpected key is found. + */ +class UnexpectedKeyError extends Error { + /** + * Creates a new instance. + * @param {string} key The key that was unexpected. + */ + constructor(key) { + super(`Unexpected key "${key}" found.`); + } +} + +/** + * Error when a required key is missing. + */ +class MissingKeyError extends Error { + /** + * Creates a new instance. + * @param {string} key The key that was missing. + */ + constructor(key) { + super(`Missing required key "${key}".`); + } +} + +/** + * Error when a key requires other keys that are missing. + */ +class MissingDependentKeysError extends Error { + /** + * Creates a new instance. + * @param {string} key The key that was unexpected. + * @param {Array} requiredKeys The keys that are required. + */ + constructor(key, requiredKeys) { + super(`Key "${key}" requires keys "${requiredKeys.join('", "')}".`); + } +} + +/** + * Wrapper error for errors occuring during a merge or validate operation. + */ +class WrapperError extends Error { + /** + * Creates a new instance. + * @param {string} key The object key causing the error. + * @param {Error} source The source error. + */ + constructor(key, source) { + super(`Key "${key}": ${source.message}`, { cause: source }); + + // copy over custom properties that aren't represented + for (const sourceKey of Object.keys(source)) { + if (!(sourceKey in this)) { + this[sourceKey] = source[sourceKey]; + } + } + } +} + +//----------------------------------------------------------------------------- +// Main +//----------------------------------------------------------------------------- + +/** + * Represents an object validation/merging schema. + */ +class ObjectSchema { + /** + * Track all definitions in the schema by key. + * @type {Map} + */ + #definitions = new Map(); + + /** + * Separately track any keys that are required for faster validtion. + * @type {Map} + */ + #requiredKeys = new Map(); + + /** + * Creates a new instance. + * @param {ObjectDefinition} definitions The schema definitions. + */ + constructor(definitions) { + if (!definitions) { + throw new Error("Schema definitions missing."); + } + + // add in all strategies + for (const key of Object.keys(definitions)) { + validateDefinition(key, definitions[key]); + + // normalize merge and validate methods if subschema is present + if (typeof definitions[key].schema === "object") { + const schema = new ObjectSchema(definitions[key].schema); + definitions[key] = { + ...definitions[key], + merge(first = {}, second = {}) { + return schema.merge(first, second); + }, + validate(value) { + ValidationStrategy.object(value); + schema.validate(value); + }, + }; + } + + // normalize the merge method in case there's a string + if (typeof definitions[key].merge === "string") { + definitions[key] = { + ...definitions[key], + merge: MergeStrategy[ + /** @type {string} */ (definitions[key].merge) + ], + }; + } + + // normalize the validate method in case there's a string + if (typeof definitions[key].validate === "string") { + definitions[key] = { + ...definitions[key], + validate: + ValidationStrategy[ + /** @type {string} */ (definitions[key].validate) + ], + }; + } + + this.#definitions.set(key, definitions[key]); + + if (definitions[key].required) { + this.#requiredKeys.set(key, definitions[key]); + } + } + } + + /** + * Determines if a strategy has been registered for the given object key. + * @param {string} key The object key to find a strategy for. + * @returns {boolean} True if the key has a strategy registered, false if not. + */ + hasKey(key) { + return this.#definitions.has(key); + } + + /** + * Merges objects together to create a new object comprised of the keys + * of the all objects. Keys are merged based on the each key's merge + * strategy. + * @param {...Object} objects The objects to merge. + * @returns {Object} A new object with a mix of all objects' keys. + * @throws {Error} If any object is invalid. + */ + merge(...objects) { + // double check arguments + if (objects.length < 2) { + throw new TypeError("merge() requires at least two arguments."); + } + + if ( + objects.some( + object => object === null || typeof object !== "object", + ) + ) { + throw new TypeError("All arguments must be objects."); + } + + return objects.reduce((result, object) => { + this.validate(object); + + for (const [key, strategy] of this.#definitions) { + try { + if (key in result || key in object) { + const merge = /** @type {Function} */ (strategy.merge); + const value = merge.call( + this, + result[key], + object[key], + ); + if (value !== undefined) { + result[key] = value; + } + } + } catch (ex) { + throw new WrapperError(key, ex); + } + } + return result; + }, {}); + } + + /** + * Validates an object's keys based on the validate strategy for each key. + * @param {Object} object The object to validate. + * @returns {void} + * @throws {Error} When the object is invalid. + */ + validate(object) { + // check existing keys first + for (const key of Object.keys(object)) { + // check to see if the key is defined + if (!this.hasKey(key)) { + throw new UnexpectedKeyError(key); + } + + // validate existing keys + const definition = this.#definitions.get(key); + + // first check to see if any other keys are required + if (Array.isArray(definition.requires)) { + if ( + !definition.requires.every(otherKey => otherKey in object) + ) { + throw new MissingDependentKeysError( + key, + definition.requires, + ); + } + } + + // now apply remaining validation strategy + try { + const validate = /** @type {Function} */ (definition.validate); + validate.call(definition, object[key]); + } catch (ex) { + throw new WrapperError(key, ex); + } + } + + // ensure required keys aren't missing + for (const [key] of this.#requiredKeys) { + if (!(key in object)) { + throw new MissingKeyError(key); + } + } + } +} + +exports.MergeStrategy = MergeStrategy; +exports.ObjectSchema = ObjectSchema; +exports.ValidationStrategy = ValidationStrategy; diff --git a/node_modules/@eslint/object-schema/dist/cjs/index.d.cts b/node_modules/@eslint/object-schema/dist/cjs/index.d.cts new file mode 100644 index 0000000..80c2d94 --- /dev/null +++ b/node_modules/@eslint/object-schema/dist/cjs/index.d.cts @@ -0,0 +1,123 @@ +export type ObjectDefinition = import("./types.cts").ObjectDefinition; +export type PropertyDefinition = import("./types.cts").PropertyDefinition; +/** + * @fileoverview Merge Strategy + */ +/** + * Container class for several different merge strategies. + */ +export class MergeStrategy { + /** + * Merges two keys by overwriting the first with the second. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value. + */ + static overwrite(value1: any, value2: any): any; + /** + * Merges two keys by replacing the first with the second only if the + * second is defined. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value if it is defined. + */ + static replace(value1: any, value2: any): any; + /** + * Merges two properties by assigning properties from the second to the first. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} A new object containing properties from both value1 and + * value2. + */ + static assign(value1: any, value2: any): any; +} +/** + * Represents an object validation/merging schema. + */ +export class ObjectSchema { + /** + * Creates a new instance. + * @param {ObjectDefinition} definitions The schema definitions. + */ + constructor(definitions: ObjectDefinition); + /** + * Determines if a strategy has been registered for the given object key. + * @param {string} key The object key to find a strategy for. + * @returns {boolean} True if the key has a strategy registered, false if not. + */ + hasKey(key: string): boolean; + /** + * Merges objects together to create a new object comprised of the keys + * of the all objects. Keys are merged based on the each key's merge + * strategy. + * @param {...Object} objects The objects to merge. + * @returns {Object} A new object with a mix of all objects' keys. + * @throws {Error} If any object is invalid. + */ + merge(...objects: any[]): any; + /** + * Validates an object's keys based on the validate strategy for each key. + * @param {Object} object The object to validate. + * @returns {void} + * @throws {Error} When the object is invalid. + */ + validate(object: any): void; + #private; +} +/** + * @fileoverview Validation Strategy + */ +/** + * Container class for several different validation strategies. + */ +export class ValidationStrategy { + /** + * Validates that a value is an array. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static array(value: any): void; + /** + * Validates that a value is a boolean. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static boolean(value: any): void; + /** + * Validates that a value is a number. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static number(value: any): void; + /** + * Validates that a value is a object. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static object(value: any): void; + /** + * Validates that a value is a object or null. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "object?"(value: any): void; + /** + * Validates that a value is a string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static string(value: any): void; + /** + * Validates that a value is a non-empty string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "string!"(value: any): void; +} diff --git a/node_modules/@eslint/object-schema/dist/cjs/types.ts b/node_modules/@eslint/object-schema/dist/cjs/types.ts new file mode 100644 index 0000000..c409a6e --- /dev/null +++ b/node_modules/@eslint/object-schema/dist/cjs/types.ts @@ -0,0 +1,57 @@ +/** + * @fileoverview Types for object-schema package. + */ + +/** + * Built-in validation strategies. + */ +export type BuiltInValidationStrategy = + | "array" + | "boolean" + | "number" + | "object" + | "object?" + | "string" + | "string!"; + +/** + * Built-in merge strategies. + */ +export type BuiltInMergeStrategy = "assign" | "overwrite" | "replace"; + +/** + * Property definition. + */ +export interface PropertyDefinition { + /** + * Indicates if the property is required. + */ + required: boolean; + + /** + * The other properties that must be present when this property is used. + */ + requires?: string[]; + + /** + * The strategy to merge the property. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/eslint/rewrite/pull/90#discussion_r1687206213 + merge: BuiltInMergeStrategy | ((target: any, source: any) => any); + + /** + * The strategy to validate the property. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/eslint/rewrite/pull/90#discussion_r1687206213 + validate: BuiltInValidationStrategy | ((value: any) => void); + + /** + * The schema for the object value of this property. + */ + schema?: ObjectDefinition; +} + +/** + * Object definition. + */ +export type ObjectDefinition = Record; diff --git a/node_modules/@eslint/object-schema/dist/esm/index.js b/node_modules/@eslint/object-schema/dist/esm/index.js new file mode 100644 index 0000000..2e7bcd4 --- /dev/null +++ b/node_modules/@eslint/object-schema/dist/esm/index.js @@ -0,0 +1,452 @@ +// @ts-self-types="./index.d.ts" +/** + * @fileoverview Merge Strategy + */ + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Container class for several different merge strategies. + */ +class MergeStrategy { + /** + * Merges two keys by overwriting the first with the second. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value. + */ + static overwrite(value1, value2) { + return value2; + } + + /** + * Merges two keys by replacing the first with the second only if the + * second is defined. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value if it is defined. + */ + static replace(value1, value2) { + if (typeof value2 !== "undefined") { + return value2; + } + + return value1; + } + + /** + * Merges two properties by assigning properties from the second to the first. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} A new object containing properties from both value1 and + * value2. + */ + static assign(value1, value2) { + return Object.assign({}, value1, value2); + } +} + +/** + * @fileoverview Validation Strategy + */ + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Container class for several different validation strategies. + */ +class ValidationStrategy { + /** + * Validates that a value is an array. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static array(value) { + if (!Array.isArray(value)) { + throw new TypeError("Expected an array."); + } + } + + /** + * Validates that a value is a boolean. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static boolean(value) { + if (typeof value !== "boolean") { + throw new TypeError("Expected a Boolean."); + } + } + + /** + * Validates that a value is a number. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static number(value) { + if (typeof value !== "number") { + throw new TypeError("Expected a number."); + } + } + + /** + * Validates that a value is a object. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static object(value) { + if (!value || typeof value !== "object") { + throw new TypeError("Expected an object."); + } + } + + /** + * Validates that a value is a object or null. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "object?"(value) { + if (typeof value !== "object") { + throw new TypeError("Expected an object or null."); + } + } + + /** + * Validates that a value is a string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static string(value) { + if (typeof value !== "string") { + throw new TypeError("Expected a string."); + } + } + + /** + * Validates that a value is a non-empty string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "string!"(value) { + if (typeof value !== "string" || value.length === 0) { + throw new TypeError("Expected a non-empty string."); + } + } +} + +/** + * @fileoverview Object Schema + */ + + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** @typedef {import("./types.ts").ObjectDefinition} ObjectDefinition */ +/** @typedef {import("./types.ts").PropertyDefinition} PropertyDefinition */ + +//----------------------------------------------------------------------------- +// Private +//----------------------------------------------------------------------------- + +/** + * Validates a schema strategy. + * @param {string} name The name of the key this strategy is for. + * @param {PropertyDefinition} definition The strategy for the object key. + * @returns {void} + * @throws {Error} When the strategy is missing a name. + * @throws {Error} When the strategy is missing a merge() method. + * @throws {Error} When the strategy is missing a validate() method. + */ +function validateDefinition(name, definition) { + let hasSchema = false; + if (definition.schema) { + if (typeof definition.schema === "object") { + hasSchema = true; + } else { + throw new TypeError("Schema must be an object."); + } + } + + if (typeof definition.merge === "string") { + if (!(definition.merge in MergeStrategy)) { + throw new TypeError( + `Definition for key "${name}" missing valid merge strategy.`, + ); + } + } else if (!hasSchema && typeof definition.merge !== "function") { + throw new TypeError( + `Definition for key "${name}" must have a merge property.`, + ); + } + + if (typeof definition.validate === "string") { + if (!(definition.validate in ValidationStrategy)) { + throw new TypeError( + `Definition for key "${name}" missing valid validation strategy.`, + ); + } + } else if (!hasSchema && typeof definition.validate !== "function") { + throw new TypeError( + `Definition for key "${name}" must have a validate() method.`, + ); + } +} + +//----------------------------------------------------------------------------- +// Errors +//----------------------------------------------------------------------------- + +/** + * Error when an unexpected key is found. + */ +class UnexpectedKeyError extends Error { + /** + * Creates a new instance. + * @param {string} key The key that was unexpected. + */ + constructor(key) { + super(`Unexpected key "${key}" found.`); + } +} + +/** + * Error when a required key is missing. + */ +class MissingKeyError extends Error { + /** + * Creates a new instance. + * @param {string} key The key that was missing. + */ + constructor(key) { + super(`Missing required key "${key}".`); + } +} + +/** + * Error when a key requires other keys that are missing. + */ +class MissingDependentKeysError extends Error { + /** + * Creates a new instance. + * @param {string} key The key that was unexpected. + * @param {Array} requiredKeys The keys that are required. + */ + constructor(key, requiredKeys) { + super(`Key "${key}" requires keys "${requiredKeys.join('", "')}".`); + } +} + +/** + * Wrapper error for errors occuring during a merge or validate operation. + */ +class WrapperError extends Error { + /** + * Creates a new instance. + * @param {string} key The object key causing the error. + * @param {Error} source The source error. + */ + constructor(key, source) { + super(`Key "${key}": ${source.message}`, { cause: source }); + + // copy over custom properties that aren't represented + for (const sourceKey of Object.keys(source)) { + if (!(sourceKey in this)) { + this[sourceKey] = source[sourceKey]; + } + } + } +} + +//----------------------------------------------------------------------------- +// Main +//----------------------------------------------------------------------------- + +/** + * Represents an object validation/merging schema. + */ +class ObjectSchema { + /** + * Track all definitions in the schema by key. + * @type {Map} + */ + #definitions = new Map(); + + /** + * Separately track any keys that are required for faster validtion. + * @type {Map} + */ + #requiredKeys = new Map(); + + /** + * Creates a new instance. + * @param {ObjectDefinition} definitions The schema definitions. + */ + constructor(definitions) { + if (!definitions) { + throw new Error("Schema definitions missing."); + } + + // add in all strategies + for (const key of Object.keys(definitions)) { + validateDefinition(key, definitions[key]); + + // normalize merge and validate methods if subschema is present + if (typeof definitions[key].schema === "object") { + const schema = new ObjectSchema(definitions[key].schema); + definitions[key] = { + ...definitions[key], + merge(first = {}, second = {}) { + return schema.merge(first, second); + }, + validate(value) { + ValidationStrategy.object(value); + schema.validate(value); + }, + }; + } + + // normalize the merge method in case there's a string + if (typeof definitions[key].merge === "string") { + definitions[key] = { + ...definitions[key], + merge: MergeStrategy[ + /** @type {string} */ (definitions[key].merge) + ], + }; + } + + // normalize the validate method in case there's a string + if (typeof definitions[key].validate === "string") { + definitions[key] = { + ...definitions[key], + validate: + ValidationStrategy[ + /** @type {string} */ (definitions[key].validate) + ], + }; + } + + this.#definitions.set(key, definitions[key]); + + if (definitions[key].required) { + this.#requiredKeys.set(key, definitions[key]); + } + } + } + + /** + * Determines if a strategy has been registered for the given object key. + * @param {string} key The object key to find a strategy for. + * @returns {boolean} True if the key has a strategy registered, false if not. + */ + hasKey(key) { + return this.#definitions.has(key); + } + + /** + * Merges objects together to create a new object comprised of the keys + * of the all objects. Keys are merged based on the each key's merge + * strategy. + * @param {...Object} objects The objects to merge. + * @returns {Object} A new object with a mix of all objects' keys. + * @throws {Error} If any object is invalid. + */ + merge(...objects) { + // double check arguments + if (objects.length < 2) { + throw new TypeError("merge() requires at least two arguments."); + } + + if ( + objects.some( + object => object === null || typeof object !== "object", + ) + ) { + throw new TypeError("All arguments must be objects."); + } + + return objects.reduce((result, object) => { + this.validate(object); + + for (const [key, strategy] of this.#definitions) { + try { + if (key in result || key in object) { + const merge = /** @type {Function} */ (strategy.merge); + const value = merge.call( + this, + result[key], + object[key], + ); + if (value !== undefined) { + result[key] = value; + } + } + } catch (ex) { + throw new WrapperError(key, ex); + } + } + return result; + }, {}); + } + + /** + * Validates an object's keys based on the validate strategy for each key. + * @param {Object} object The object to validate. + * @returns {void} + * @throws {Error} When the object is invalid. + */ + validate(object) { + // check existing keys first + for (const key of Object.keys(object)) { + // check to see if the key is defined + if (!this.hasKey(key)) { + throw new UnexpectedKeyError(key); + } + + // validate existing keys + const definition = this.#definitions.get(key); + + // first check to see if any other keys are required + if (Array.isArray(definition.requires)) { + if ( + !definition.requires.every(otherKey => otherKey in object) + ) { + throw new MissingDependentKeysError( + key, + definition.requires, + ); + } + } + + // now apply remaining validation strategy + try { + const validate = /** @type {Function} */ (definition.validate); + validate.call(definition, object[key]); + } catch (ex) { + throw new WrapperError(key, ex); + } + } + + // ensure required keys aren't missing + for (const [key] of this.#requiredKeys) { + if (!(key in object)) { + throw new MissingKeyError(key); + } + } + } +} + +export { MergeStrategy, ObjectSchema, ValidationStrategy }; diff --git a/node_modules/@eslint/object-schema/dist/esm/types.ts b/node_modules/@eslint/object-schema/dist/esm/types.ts new file mode 100644 index 0000000..c409a6e --- /dev/null +++ b/node_modules/@eslint/object-schema/dist/esm/types.ts @@ -0,0 +1,57 @@ +/** + * @fileoverview Types for object-schema package. + */ + +/** + * Built-in validation strategies. + */ +export type BuiltInValidationStrategy = + | "array" + | "boolean" + | "number" + | "object" + | "object?" + | "string" + | "string!"; + +/** + * Built-in merge strategies. + */ +export type BuiltInMergeStrategy = "assign" | "overwrite" | "replace"; + +/** + * Property definition. + */ +export interface PropertyDefinition { + /** + * Indicates if the property is required. + */ + required: boolean; + + /** + * The other properties that must be present when this property is used. + */ + requires?: string[]; + + /** + * The strategy to merge the property. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/eslint/rewrite/pull/90#discussion_r1687206213 + merge: BuiltInMergeStrategy | ((target: any, source: any) => any); + + /** + * The strategy to validate the property. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/eslint/rewrite/pull/90#discussion_r1687206213 + validate: BuiltInValidationStrategy | ((value: any) => void); + + /** + * The schema for the object value of this property. + */ + schema?: ObjectDefinition; +} + +/** + * Object definition. + */ +export type ObjectDefinition = Record; diff --git a/node_modules/@eslint/object-schema/package.json b/node_modules/@eslint/object-schema/package.json new file mode 100644 index 0000000..65a6def --- /dev/null +++ b/node_modules/@eslint/object-schema/package.json @@ -0,0 +1,60 @@ +{ + "name": "@eslint/object-schema", + "version": "2.1.6", + "description": "An object schema merger/validator", + "type": "module", + "main": "dist/esm/index.js", + "types": "dist/esm/index.d.ts", + "exports": { + "require": { + "types": "./dist/cjs/index.d.cts", + "default": "./dist/cjs/index.cjs" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" + }, + "directories": { + "test": "tests" + }, + "scripts": { + "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts", + "build": "rollup -c && tsc -p tsconfig.esm.json && npm run build:cts", + "test:jsr": "npx jsr@latest publish --dry-run", + "test": "mocha tests/", + "test:coverage": "c8 npm test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/rewrite.git" + }, + "keywords": [ + "object", + "validation", + "schema", + "merge" + ], + "author": "Nicholas C. Zakas", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/rewrite/issues" + }, + "homepage": "https://github.com/eslint/rewrite#readme", + "devDependencies": { + "c8": "^9.1.0", + "mocha": "^10.4.0", + "rollup": "^4.16.2", + "rollup-plugin-copy": "^3.5.0", + "typescript": "^5.4.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } +} diff --git a/node_modules/@eslint/plugin-kit/LICENSE b/node_modules/@eslint/plugin-kit/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@eslint/plugin-kit/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@eslint/plugin-kit/README.md b/node_modules/@eslint/plugin-kit/README.md new file mode 100644 index 0000000..074844f --- /dev/null +++ b/node_modules/@eslint/plugin-kit/README.md @@ -0,0 +1,273 @@ +# ESLint Plugin Kit + +## Description + +A collection of utilities to help build ESLint plugins. + +## Installation + +For Node.js and compatible runtimes: + +```shell +npm install @eslint/plugin-kit +# or +yarn add @eslint/plugin-kit +# or +pnpm install @eslint/plugin-kit +# or +bun install @eslint/plugin-kit +``` + +For Deno: + +```shell +deno add @eslint/plugin-kit +``` + +## Usage + +This package exports the following utilities: + +- `ConfigCommentParser` - used to parse ESLint configuration comments (i.e., `/* eslint-disable rule */`) +- `VisitNodeStep` and `CallMethodStep` - used to help implement `SourceCode#traverse()` +- `Directive` - used to help implement `SourceCode#getDisableDirectives()` +- `TextSourceCodeBase` - base class to help implement the `SourceCode` interface + +### `ConfigCommentParser` + +To use the `ConfigCommentParser` class, import it from the package and create a new instance, such as: + +```js +import { ConfigCommentParser } from "@eslint/plugin-kit"; + +// create a new instance +const commentParser = new ConfigCommentParser(); + +// pass in a comment string without the comment delimiters +const directive = commentParser.parseDirective( + "eslint-disable prefer-const, semi -- I don't want to use these.", +); + +// will be undefined when a directive can't be parsed +if (directive) { + console.log(directive.label); // "eslint-disable" + console.log(directive.value); // "prefer-const, semi" + console.log(directive.justification); // "I don't want to use these" +} +``` + +There are different styles of directive values that you'll need to parse separately to get the correct format: + +```js +import { ConfigCommentParser } from "@eslint/plugin-kit"; + +// create a new instance +const commentParser = new ConfigCommentParser(); + +// list format +const list = commentParser.parseListConfig("prefer-const, semi"); +console.log(Object.entries(list)); // [["prefer-const", true], ["semi", true]] + +// string format +const strings = commentParser.parseStringConfig("foo:off, bar"); +console.log(Object.entries(strings)); // [["foo", "off"], ["bar", null]] + +// JSON-like config format +const jsonLike = commentParser.parseJSONLikeConfig( + "semi:[error, never], prefer-const: warn", +); +console.log(Object.entries(jsonLike.config)); // [["semi", ["error", "never"]], ["prefer-const", "warn"]] +``` + +### `VisitNodeStep` and `CallMethodStep` + +The `VisitNodeStep` and `CallMethodStep` classes represent steps in the traversal of source code. They implement the correct interfaces to return from the `SourceCode#traverse()` method. + +The `VisitNodeStep` class is the more common of the two, where you are describing a visit to a particular node during the traversal. The constructor accepts three arguments: + +- `target` - the node being visited. This is used to determine the method to call inside of a rule. For instance, if the node's type is `Literal` then ESLint will call a method named `Literal()` on the rule (if present). +- `phase` - either 1 for enter or 2 for exit. +- `args` - an array of arguments to pass into the visitor method of a rule. + +For example: + +```js +import { VisitNodeStep } from "@eslint/plugin-kit"; + +class MySourceCode { + traverse() { + const steps = []; + + for (const { node, parent, phase } of iterator(this.ast)) { + steps.push( + new VisitNodeStep({ + target: node, + phase: phase === "enter" ? 1 : 2, + args: [node, parent], + }), + ); + } + + return steps; + } +} +``` + +The `CallMethodStep` class is less common and is used to tell ESLint to call a specific method on the rule. The constructor accepts two arguments: + +- `target` - the name of the method to call, frequently beginning with `"on"` such as `"onCodePathStart"`. +- `args` - an array of arguments to pass to the method. + +For example: + +```js +import { VisitNodeStep, CallMethodStep } from "@eslint/plugin-kit"; + +class MySourceCode { + + traverse() { + + const steps = []; + + for (const { node, parent, phase } of iterator(this.ast)) { + steps.push( + new VisitNodeStep({ + target: node, + phase: phase === "enter" ? 1 : 2, + args: [node, parent], + }), + ); + + // call a method indicating how many times we've been through the loop + steps.push( + new CallMethodStep({ + target: "onIteration", + args: [steps.length] + }); + ) + } + + return steps; + } +} +``` + +### `Directive` + +The `Directive` class represents a disable directive in the source code and implements the `Directive` interface from `@eslint/core`. You can tell ESLint about disable directives using the `SourceCode#getDisableDirectives()` method, where part of the return value is an array of `Directive` objects. Here's an example: + +```js +import { Directive, ConfigCommentParser } from "@eslint/plugin-kit"; + +class MySourceCode { + getDisableDirectives() { + const directives = []; + const problems = []; + const commentParser = new ConfigCommentParser(); + + // read in the inline config nodes to check each one + this.getInlineConfigNodes().forEach(comment => { + // Step 1: Parse the directive + const { label, value, justification } = + commentParser.parseDirective(comment.value); + + // Step 2: Extract the directive value and create the `Directive` object + switch (label) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = label.slice("eslint-".length); + + directives.push( + new Directive({ + type: directiveType, + node: comment, + value, + justification, + }), + ); + } + + // ignore any comments that don't begin with known labels + } + }); + + return { + directives, + problems, + }; + } +} +``` + +### `TextSourceCodeBase` + +The `TextSourceCodeBase` class is intended to be a base class that has several of the common members found in `SourceCode` objects already implemented. Those members are: + +- `lines` - an array of text lines that is created automatically when the constructor is called. +- `getLoc(node)` - gets the location of a node. Works for nodes that have the ESLint-style `loc` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different location format, you'll still need to implement this method yourself. +- `getRange(node)` - gets the range of a node within the source text. Works for nodes that have the ESLint-style `range` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different range format, you'll still need to implement this method yourself. +- `getText(nodeOrToken, charsBefore, charsAfter)` - gets the source text for the given node or token that has range information attached. Optionally, can return additional characters before and after the given node or token. As long as `getRange()` is properly implemented, this method will just work. +- `getAncestors(node)` - returns the ancestry of the node. In order for this to work, you must implement the `getParent()` method yourself. + +Here's an example: + +```js +import { TextSourceCodeBase } from "@eslint/plugin-kit"; + +export class MySourceCode extends TextSourceCodeBase { + #parents = new Map(); + + constructor({ ast, text }) { + super({ ast, text }); + } + + getParent(node) { + return this.#parents.get(node); + } + + traverse() { + const steps = []; + + for (const { node, parent, phase } of iterator(this.ast)) { + //save the parent information + this.#parent.set(node, parent); + + steps.push( + new VisitNodeStep({ + target: node, + phase: phase === "enter" ? 1 : 2, + args: [node, parent], + }), + ); + } + + return steps; + } +} +``` + +In general, it's safe to collect the parent information during the `traverse()` method as `getParent()` and `getAncestor()` will only be called from rules once the AST has been traversed at least once. + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io

Silver Sponsors

+

Vite JetBrains Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/node_modules/@eslint/plugin-kit/dist/cjs/index.cjs b/node_modules/@eslint/plugin-kit/dist/cjs/index.cjs new file mode 100644 index 0000000..06b0cf9 --- /dev/null +++ b/node_modules/@eslint/plugin-kit/dist/cjs/index.cjs @@ -0,0 +1,611 @@ +'use strict'; + +var levn = require('levn'); + +/** + * @fileoverview Config Comment Parser + * @author Nicholas C. Zakas + */ + + +//----------------------------------------------------------------------------- +// Type Definitions +//----------------------------------------------------------------------------- + +/** @typedef {import("@eslint/core").RuleConfig} RuleConfig */ +/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */ +/** @typedef {import("./types.ts").StringConfig} StringConfig */ +/** @typedef {import("./types.ts").BooleanConfig} BooleanConfig */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const directivesPattern = /^([a-z]+(?:-[a-z]+)*)(?:\s|$)/u; +const validSeverities = new Set([0, 1, 2, "off", "warn", "error"]); + +/** + * Determines if the severity in the rule configuration is valid. + * @param {RuleConfig} ruleConfig A rule's configuration. + */ +function isSeverityValid(ruleConfig) { + const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + return validSeverities.has(severity); +} + +/** + * Determines if all severities in the rules configuration are valid. + * @param {RulesConfig} rulesConfig The rules configuration to check. + * @returns {boolean} `true` if all severities are valid, otherwise `false`. + */ +function isEverySeverityValid(rulesConfig) { + return Object.values(rulesConfig).every(isSeverityValid); +} + +/** + * Represents a directive comment. + */ +class DirectiveComment { + /** + * The label of the directive, such as "eslint", "eslint-disable", etc. + * @type {string} + */ + label = ""; + + /** + * The value of the directive (the string after the label). + * @type {string} + */ + value = ""; + + /** + * The justification of the directive (the string after the --). + * @type {string} + */ + justification = ""; + + /** + * Creates a new directive comment. + * @param {string} label The label of the directive. + * @param {string} value The value of the directive. + * @param {string} justification The justification of the directive. + */ + constructor(label, value, justification) { + this.label = label; + this.value = value; + this.justification = justification; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object to parse ESLint configuration comments. + */ +class ConfigCommentParser { + /** + * Parses a list of "name:string_value" or/and "name" options divided by comma or + * whitespace. Used for "global" comments. + * @param {string} string The string to parse. + * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided. + */ + parseStringConfig(string) { + const items = /** @type {StringConfig} */ ({}); + + // Collapse whitespace around `:` and `,` to make parsing easier + const trimmedString = string + .trim() + .replace(/(? { + if (!name) { + return; + } + + // value defaults to null (if not provided), e.g: "foo" => ["foo", null] + const [key, value = null] = name.split(":"); + + items[key] = value; + }); + + return items; + } + + /** + * Parses a JSON-like config. + * @param {string} string The string to parse. + * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object + */ + parseJSONLikeConfig(string) { + // Parses a JSON-like comment by the same way as parsing CLI option. + try { + const items = + /** @type {RulesConfig} */ (levn.parse("Object", string)) || {}; + + /* + * When the configuration has any invalid severities, it should be completely + * ignored. This is because the configuration is not valid and should not be + * applied. + * + * For example, the following configuration is invalid: + * + * "no-alert: 2 no-console: 2" + * + * This results in a configuration of { "no-alert": "2 no-console: 2" }, which is + * not valid. In this case, the configuration should be ignored. + */ + if (isEverySeverityValid(items)) { + return { + ok: true, + config: items, + }; + } + } catch { + // levn parsing error: ignore to parse the string by a fallback. + } + + /* + * Optionator cannot parse commaless notations. + * But we are supporting that. So this is a fallback for that. + */ + const normalizedString = string + .replace(/([-a-zA-Z0-9/]+):/gu, '"$1":') + .replace(/(\]|[0-9])\s+(?=")/u, "$1,"); + + try { + const items = JSON.parse(`{${normalizedString}}`); + + return { + ok: true, + config: items, + }; + } catch (ex) { + const errorMessage = ex instanceof Error ? ex.message : String(ex); + + return { + ok: false, + error: { + message: `Failed to parse JSON from '${normalizedString}': ${errorMessage}`, + }, + }; + } + } + + /** + * Parses a config of values separated by comma. + * @param {string} string The string to parse. + * @returns {BooleanConfig} Result map of values and true values + */ + parseListConfig(string) { + const items = /** @type {BooleanConfig} */ ({}); + + string.split(",").forEach(name => { + const trimmedName = name + .trim() + .replace( + /^(?['"]?)(?.*)\k$/su, + "$", + ); + + if (trimmedName) { + items[trimmedName] = true; + } + }); + + return items; + } + + /** + * Extract the directive and the justification from a given directive comment and trim them. + * @param {string} value The comment text to extract. + * @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification. + */ + #extractDirectiveComment(value) { + const match = /\s-{2,}\s/u.exec(value); + + if (!match) { + return { directivePart: value.trim(), justificationPart: "" }; + } + + const directive = value.slice(0, match.index).trim(); + const justification = value.slice(match.index + match[0].length).trim(); + + return { directivePart: directive, justificationPart: justification }; + } + + /** + * Parses a directive comment into directive text and value. + * @param {string} string The string with the directive to be parsed. + * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid. + */ + parseDirective(string) { + const { directivePart, justificationPart } = + this.#extractDirectiveComment(string); + const match = directivesPattern.exec(directivePart); + + if (!match) { + return undefined; + } + + const directiveText = match[1]; + const directiveValue = directivePart.slice( + match.index + directiveText.length, + ); + + return new DirectiveComment( + directiveText, + directiveValue.trim(), + justificationPart, + ); + } +} + +/** + * @fileoverview A collection of helper classes for implementing `SourceCode`. + * @author Nicholas C. Zakas + */ + +/* eslint class-methods-use-this: off -- Required to complete interface. */ + +//----------------------------------------------------------------------------- +// Type Definitions +//----------------------------------------------------------------------------- + +/** @typedef {import("@eslint/core").VisitTraversalStep} VisitTraversalStep */ +/** @typedef {import("@eslint/core").CallTraversalStep} CallTraversalStep */ +/** @typedef {import("@eslint/core").TextSourceCode} TextSourceCode */ +/** @typedef {import("@eslint/core").TraversalStep} TraversalStep */ +/** @typedef {import("@eslint/core").SourceLocation} SourceLocation */ +/** @typedef {import("@eslint/core").SourceLocationWithOffset} SourceLocationWithOffset */ +/** @typedef {import("@eslint/core").SourceRange} SourceRange */ +/** @typedef {import("@eslint/core").Directive} IDirective */ +/** @typedef {import("@eslint/core").DirectiveType} DirectiveType */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Determines if a node has ESTree-style loc information. + * @param {object} node The node to check. + * @returns {node is {loc:SourceLocation}} `true` if the node has ESTree-style loc information, `false` if not. + */ +function hasESTreeStyleLoc(node) { + return "loc" in node; +} + +/** + * Determines if a node has position-style loc information. + * @param {object} node The node to check. + * @returns {node is {position:SourceLocation}} `true` if the node has position-style range information, `false` if not. + */ +function hasPosStyleLoc(node) { + return "position" in node; +} + +/** + * Determines if a node has ESTree-style range information. + * @param {object} node The node to check. + * @returns {node is {range:SourceRange}} `true` if the node has ESTree-style range information, `false` if not. + */ +function hasESTreeStyleRange(node) { + return "range" in node; +} + +/** + * Determines if a node has position-style range information. + * @param {object} node The node to check. + * @returns {node is {position:SourceLocationWithOffset}} `true` if the node has position-style range information, `false` if not. + */ +function hasPosStyleRange(node) { + return "position" in node; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class to represent a step in the traversal process where a node is visited. + * @implements {VisitTraversalStep} + */ +class VisitNodeStep { + /** + * The type of the step. + * @type {"visit"} + * @readonly + */ + type = "visit"; + + /** + * The kind of the step. Represents the same data as the `type` property + * but it's a number for performance. + * @type {1} + * @readonly + */ + kind = 1; + + /** + * The target of the step. + * @type {object} + */ + target; + + /** + * The phase of the step. + * @type {1|2} + */ + phase; + + /** + * The arguments of the step. + * @type {Array} + */ + args; + + /** + * Creates a new instance. + * @param {Object} options The options for the step. + * @param {object} options.target The target of the step. + * @param {1|2} options.phase The phase of the step. + * @param {Array} options.args The arguments of the step. + */ + constructor({ target, phase, args }) { + this.target = target; + this.phase = phase; + this.args = args; + } +} + +/** + * A class to represent a step in the traversal process where a + * method is called. + * @implements {CallTraversalStep} + */ +class CallMethodStep { + /** + * The type of the step. + * @type {"call"} + * @readonly + */ + type = "call"; + + /** + * The kind of the step. Represents the same data as the `type` property + * but it's a number for performance. + * @type {2} + * @readonly + */ + kind = 2; + + /** + * The name of the method to call. + * @type {string} + */ + target; + + /** + * The arguments to pass to the method. + * @type {Array} + */ + args; + + /** + * Creates a new instance. + * @param {Object} options The options for the step. + * @param {string} options.target The target of the step. + * @param {Array} options.args The arguments of the step. + */ + constructor({ target, args }) { + this.target = target; + this.args = args; + } +} + +/** + * A class to represent a directive comment. + * @implements {IDirective} + */ +class Directive { + /** + * The type of directive. + * @type {DirectiveType} + * @readonly + */ + type; + + /** + * The node representing the directive. + * @type {unknown} + * @readonly + */ + node; + + /** + * Everything after the "eslint-disable" portion of the directive, + * but before the "--" that indicates the justification. + * @type {string} + * @readonly + */ + value; + + /** + * The justification for the directive. + * @type {string} + * @readonly + */ + justification; + + /** + * Creates a new instance. + * @param {Object} options The options for the directive. + * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive. + * @param {unknown} options.node The node representing the directive. + * @param {string} options.value The value of the directive. + * @param {string} options.justification The justification for the directive. + */ + constructor({ type, node, value, justification }) { + this.type = type; + this.node = node; + this.value = value; + this.justification = justification; + } +} + +/** + * Source Code Base Object + * @implements {TextSourceCode} + */ +class TextSourceCodeBase { + /** + * The lines of text in the source code. + * @type {Array} + */ + #lines; + + /** + * The AST of the source code. + * @type {object} + */ + ast; + + /** + * The text of the source code. + * @type {string} + */ + text; + + /** + * Creates a new instance. + * @param {Object} options The options for the instance. + * @param {string} options.text The source code text. + * @param {object} options.ast The root AST node. + * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. + */ + constructor({ text, ast, lineEndingPattern = /\r?\n/u }) { + this.ast = ast; + this.text = text; + this.#lines = text.split(lineEndingPattern); + } + + /** + * Returns the loc information for the given node or token. + * @param {object} nodeOrToken The node or token to get the loc information for. + * @returns {SourceLocation} The loc information for the node or token. + */ + getLoc(nodeOrToken) { + if (hasESTreeStyleLoc(nodeOrToken)) { + return nodeOrToken.loc; + } + + if (hasPosStyleLoc(nodeOrToken)) { + return nodeOrToken.position; + } + + throw new Error( + "Custom getLoc() method must be implemented in the subclass.", + ); + } + + /** + * Returns the range information for the given node or token. + * @param {object} nodeOrToken The node or token to get the range information for. + * @returns {SourceRange} The range information for the node or token. + */ + getRange(nodeOrToken) { + if (hasESTreeStyleRange(nodeOrToken)) { + return nodeOrToken.range; + } + + if (hasPosStyleRange(nodeOrToken)) { + return [ + nodeOrToken.position.start.offset, + nodeOrToken.position.end.offset, + ]; + } + + throw new Error( + "Custom getRange() method must be implemented in the subclass.", + ); + } + + /* eslint-disable no-unused-vars -- Required to complete interface. */ + /** + * Returns the parent of the given node. + * @param {object} node The node to get the parent of. + * @returns {object|undefined} The parent of the node. + */ + getParent(node) { + throw new Error("Not implemented."); + } + /* eslint-enable no-unused-vars -- Required to complete interface. */ + + /** + * Gets all the ancestors of a given node + * @param {object} node The node + * @returns {Array} All the ancestor nodes in the AST, not including the provided node, starting + * from the root node at index 0 and going inwards to the parent node. + * @throws {TypeError} When `node` is missing. + */ + getAncestors(node) { + if (!node) { + throw new TypeError("Missing required argument: node."); + } + + const ancestorsStartingAtParent = []; + + for ( + let ancestor = this.getParent(node); + ancestor; + ancestor = this.getParent(ancestor) + ) { + ancestorsStartingAtParent.push(ancestor); + } + + return ancestorsStartingAtParent.reverse(); + } + + /** + * Gets the source code for the given node. + * @param {object} [node] The AST node to get the text for. + * @param {number} [beforeCount] The number of characters before the node to retrieve. + * @param {number} [afterCount] The number of characters after the node to retrieve. + * @returns {string} The text representing the AST node. + * @public + */ + getText(node, beforeCount, afterCount) { + if (node) { + const range = this.getRange(node); + return this.text.slice( + Math.max(range[0] - (beforeCount || 0), 0), + range[1] + (afterCount || 0), + ); + } + return this.text; + } + + /** + * Gets the entire source text split into an array of lines. + * @returns {Array} The source text as an array of lines. + * @public + */ + get lines() { + return this.#lines; + } + + /** + * Traverse the source code and return the steps that were taken. + * @returns {Iterable} The steps that were taken while traversing the source code. + */ + traverse() { + throw new Error("Not implemented."); + } +} + +exports.CallMethodStep = CallMethodStep; +exports.ConfigCommentParser = ConfigCommentParser; +exports.Directive = Directive; +exports.TextSourceCodeBase = TextSourceCodeBase; +exports.VisitNodeStep = VisitNodeStep; diff --git a/node_modules/@eslint/plugin-kit/dist/cjs/index.d.cts b/node_modules/@eslint/plugin-kit/dist/cjs/index.d.cts new file mode 100644 index 0000000..5cdd7fa --- /dev/null +++ b/node_modules/@eslint/plugin-kit/dist/cjs/index.d.cts @@ -0,0 +1,286 @@ +export type VisitTraversalStep = import("@eslint/core").VisitTraversalStep; +export type CallTraversalStep = import("@eslint/core").CallTraversalStep; +export type TextSourceCode = import("@eslint/core").TextSourceCode; +export type TraversalStep = import("@eslint/core").TraversalStep; +export type SourceLocation = import("@eslint/core").SourceLocation; +export type SourceLocationWithOffset = import("@eslint/core").SourceLocationWithOffset; +export type SourceRange = import("@eslint/core").SourceRange; +export type IDirective = import("@eslint/core").Directive; +export type DirectiveType = import("@eslint/core").DirectiveType; +export type RuleConfig = import("@eslint/core").RuleConfig; +export type RulesConfig = import("@eslint/core").RulesConfig; +export type StringConfig = import("./types.cts").StringConfig; +export type BooleanConfig = import("./types.cts").BooleanConfig; +/** + * A class to represent a step in the traversal process where a + * method is called. + * @implements {CallTraversalStep} + */ +export class CallMethodStep implements CallTraversalStep { + /** + * Creates a new instance. + * @param {Object} options The options for the step. + * @param {string} options.target The target of the step. + * @param {Array} options.args The arguments of the step. + */ + constructor({ target, args }: { + target: string; + args: Array; + }); + /** + * The type of the step. + * @type {"call"} + * @readonly + */ + readonly type: "call"; + /** + * The kind of the step. Represents the same data as the `type` property + * but it's a number for performance. + * @type {2} + * @readonly + */ + readonly kind: 2; + /** + * The name of the method to call. + * @type {string} + */ + target: string; + /** + * The arguments to pass to the method. + * @type {Array} + */ + args: Array; +} +/** + * Object to parse ESLint configuration comments. + */ +export class ConfigCommentParser { + /** + * Parses a list of "name:string_value" or/and "name" options divided by comma or + * whitespace. Used for "global" comments. + * @param {string} string The string to parse. + * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided. + */ + parseStringConfig(string: string): StringConfig; + /** + * Parses a JSON-like config. + * @param {string} string The string to parse. + * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object + */ + parseJSONLikeConfig(string: string): ({ + ok: true; + config: RulesConfig; + } | { + ok: false; + error: { + message: string; + }; + }); + /** + * Parses a config of values separated by comma. + * @param {string} string The string to parse. + * @returns {BooleanConfig} Result map of values and true values + */ + parseListConfig(string: string): BooleanConfig; + /** + * Parses a directive comment into directive text and value. + * @param {string} string The string with the directive to be parsed. + * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid. + */ + parseDirective(string: string): DirectiveComment | undefined; + #private; +} +/** + * A class to represent a directive comment. + * @implements {IDirective} + */ +export class Directive implements IDirective { + /** + * Creates a new instance. + * @param {Object} options The options for the directive. + * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive. + * @param {unknown} options.node The node representing the directive. + * @param {string} options.value The value of the directive. + * @param {string} options.justification The justification for the directive. + */ + constructor({ type, node, value, justification }: { + type: "disable" | "enable" | "disable-next-line" | "disable-line"; + node: unknown; + value: string; + justification: string; + }); + /** + * The type of directive. + * @type {DirectiveType} + * @readonly + */ + readonly type: DirectiveType; + /** + * The node representing the directive. + * @type {unknown} + * @readonly + */ + readonly node: unknown; + /** + * Everything after the "eslint-disable" portion of the directive, + * but before the "--" that indicates the justification. + * @type {string} + * @readonly + */ + readonly value: string; + /** + * The justification for the directive. + * @type {string} + * @readonly + */ + readonly justification: string; +} +/** + * Source Code Base Object + * @implements {TextSourceCode} + */ +export class TextSourceCodeBase implements TextSourceCode { + /** + * Creates a new instance. + * @param {Object} options The options for the instance. + * @param {string} options.text The source code text. + * @param {object} options.ast The root AST node. + * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. + */ + constructor({ text, ast, lineEndingPattern }: { + text: string; + ast: object; + lineEndingPattern?: RegExp; + }); + /** + * The AST of the source code. + * @type {object} + */ + ast: object; + /** + * The text of the source code. + * @type {string} + */ + text: string; + /** + * Returns the loc information for the given node or token. + * @param {object} nodeOrToken The node or token to get the loc information for. + * @returns {SourceLocation} The loc information for the node or token. + */ + getLoc(nodeOrToken: object): SourceLocation; + /** + * Returns the range information for the given node or token. + * @param {object} nodeOrToken The node or token to get the range information for. + * @returns {SourceRange} The range information for the node or token. + */ + getRange(nodeOrToken: object): SourceRange; + /** + * Returns the parent of the given node. + * @param {object} node The node to get the parent of. + * @returns {object|undefined} The parent of the node. + */ + getParent(node: object): object | undefined; + /** + * Gets all the ancestors of a given node + * @param {object} node The node + * @returns {Array} All the ancestor nodes in the AST, not including the provided node, starting + * from the root node at index 0 and going inwards to the parent node. + * @throws {TypeError} When `node` is missing. + */ + getAncestors(node: object): Array; + /** + * Gets the source code for the given node. + * @param {object} [node] The AST node to get the text for. + * @param {number} [beforeCount] The number of characters before the node to retrieve. + * @param {number} [afterCount] The number of characters after the node to retrieve. + * @returns {string} The text representing the AST node. + * @public + */ + public getText(node?: object, beforeCount?: number, afterCount?: number): string; + /** + * Gets the entire source text split into an array of lines. + * @returns {Array} The source text as an array of lines. + * @public + */ + public get lines(): Array; + /** + * Traverse the source code and return the steps that were taken. + * @returns {Iterable} The steps that were taken while traversing the source code. + */ + traverse(): Iterable; + #private; +} +/** + * A class to represent a step in the traversal process where a node is visited. + * @implements {VisitTraversalStep} + */ +export class VisitNodeStep implements VisitTraversalStep { + /** + * Creates a new instance. + * @param {Object} options The options for the step. + * @param {object} options.target The target of the step. + * @param {1|2} options.phase The phase of the step. + * @param {Array} options.args The arguments of the step. + */ + constructor({ target, phase, args }: { + target: object; + phase: 1 | 2; + args: Array; + }); + /** + * The type of the step. + * @type {"visit"} + * @readonly + */ + readonly type: "visit"; + /** + * The kind of the step. Represents the same data as the `type` property + * but it's a number for performance. + * @type {1} + * @readonly + */ + readonly kind: 1; + /** + * The target of the step. + * @type {object} + */ + target: object; + /** + * The phase of the step. + * @type {1|2} + */ + phase: 1 | 2; + /** + * The arguments of the step. + * @type {Array} + */ + args: Array; +} +/** + * Represents a directive comment. + */ +declare class DirectiveComment { + /** + * Creates a new directive comment. + * @param {string} label The label of the directive. + * @param {string} value The value of the directive. + * @param {string} justification The justification of the directive. + */ + constructor(label: string, value: string, justification: string); + /** + * The label of the directive, such as "eslint", "eslint-disable", etc. + * @type {string} + */ + label: string; + /** + * The value of the directive (the string after the label). + * @type {string} + */ + value: string; + /** + * The justification of the directive (the string after the --). + * @type {string} + */ + justification: string; +} +export {}; diff --git a/node_modules/@eslint/plugin-kit/dist/cjs/types.cts b/node_modules/@eslint/plugin-kit/dist/cjs/types.cts new file mode 100644 index 0000000..d3f6a88 --- /dev/null +++ b/node_modules/@eslint/plugin-kit/dist/cjs/types.cts @@ -0,0 +1,7 @@ +/** + * @fileoverview Types for the plugin-kit package. + * @author Nicholas C. Zakas + */ + +export type StringConfig = Record; +export type BooleanConfig = Record; diff --git a/node_modules/@eslint/plugin-kit/dist/esm/index.js b/node_modules/@eslint/plugin-kit/dist/esm/index.js new file mode 100644 index 0000000..8ea51b7 --- /dev/null +++ b/node_modules/@eslint/plugin-kit/dist/esm/index.js @@ -0,0 +1,606 @@ +// @ts-self-types="./index.d.ts" +import levn from 'levn'; + +/** + * @fileoverview Config Comment Parser + * @author Nicholas C. Zakas + */ + + +//----------------------------------------------------------------------------- +// Type Definitions +//----------------------------------------------------------------------------- + +/** @typedef {import("@eslint/core").RuleConfig} RuleConfig */ +/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */ +/** @typedef {import("./types.ts").StringConfig} StringConfig */ +/** @typedef {import("./types.ts").BooleanConfig} BooleanConfig */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const directivesPattern = /^([a-z]+(?:-[a-z]+)*)(?:\s|$)/u; +const validSeverities = new Set([0, 1, 2, "off", "warn", "error"]); + +/** + * Determines if the severity in the rule configuration is valid. + * @param {RuleConfig} ruleConfig A rule's configuration. + */ +function isSeverityValid(ruleConfig) { + const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + return validSeverities.has(severity); +} + +/** + * Determines if all severities in the rules configuration are valid. + * @param {RulesConfig} rulesConfig The rules configuration to check. + * @returns {boolean} `true` if all severities are valid, otherwise `false`. + */ +function isEverySeverityValid(rulesConfig) { + return Object.values(rulesConfig).every(isSeverityValid); +} + +/** + * Represents a directive comment. + */ +class DirectiveComment { + /** + * The label of the directive, such as "eslint", "eslint-disable", etc. + * @type {string} + */ + label = ""; + + /** + * The value of the directive (the string after the label). + * @type {string} + */ + value = ""; + + /** + * The justification of the directive (the string after the --). + * @type {string} + */ + justification = ""; + + /** + * Creates a new directive comment. + * @param {string} label The label of the directive. + * @param {string} value The value of the directive. + * @param {string} justification The justification of the directive. + */ + constructor(label, value, justification) { + this.label = label; + this.value = value; + this.justification = justification; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object to parse ESLint configuration comments. + */ +class ConfigCommentParser { + /** + * Parses a list of "name:string_value" or/and "name" options divided by comma or + * whitespace. Used for "global" comments. + * @param {string} string The string to parse. + * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided. + */ + parseStringConfig(string) { + const items = /** @type {StringConfig} */ ({}); + + // Collapse whitespace around `:` and `,` to make parsing easier + const trimmedString = string + .trim() + .replace(/(? { + if (!name) { + return; + } + + // value defaults to null (if not provided), e.g: "foo" => ["foo", null] + const [key, value = null] = name.split(":"); + + items[key] = value; + }); + + return items; + } + + /** + * Parses a JSON-like config. + * @param {string} string The string to parse. + * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object + */ + parseJSONLikeConfig(string) { + // Parses a JSON-like comment by the same way as parsing CLI option. + try { + const items = + /** @type {RulesConfig} */ (levn.parse("Object", string)) || {}; + + /* + * When the configuration has any invalid severities, it should be completely + * ignored. This is because the configuration is not valid and should not be + * applied. + * + * For example, the following configuration is invalid: + * + * "no-alert: 2 no-console: 2" + * + * This results in a configuration of { "no-alert": "2 no-console: 2" }, which is + * not valid. In this case, the configuration should be ignored. + */ + if (isEverySeverityValid(items)) { + return { + ok: true, + config: items, + }; + } + } catch { + // levn parsing error: ignore to parse the string by a fallback. + } + + /* + * Optionator cannot parse commaless notations. + * But we are supporting that. So this is a fallback for that. + */ + const normalizedString = string + .replace(/([-a-zA-Z0-9/]+):/gu, '"$1":') + .replace(/(\]|[0-9])\s+(?=")/u, "$1,"); + + try { + const items = JSON.parse(`{${normalizedString}}`); + + return { + ok: true, + config: items, + }; + } catch (ex) { + const errorMessage = ex instanceof Error ? ex.message : String(ex); + + return { + ok: false, + error: { + message: `Failed to parse JSON from '${normalizedString}': ${errorMessage}`, + }, + }; + } + } + + /** + * Parses a config of values separated by comma. + * @param {string} string The string to parse. + * @returns {BooleanConfig} Result map of values and true values + */ + parseListConfig(string) { + const items = /** @type {BooleanConfig} */ ({}); + + string.split(",").forEach(name => { + const trimmedName = name + .trim() + .replace( + /^(?['"]?)(?.*)\k$/su, + "$", + ); + + if (trimmedName) { + items[trimmedName] = true; + } + }); + + return items; + } + + /** + * Extract the directive and the justification from a given directive comment and trim them. + * @param {string} value The comment text to extract. + * @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification. + */ + #extractDirectiveComment(value) { + const match = /\s-{2,}\s/u.exec(value); + + if (!match) { + return { directivePart: value.trim(), justificationPart: "" }; + } + + const directive = value.slice(0, match.index).trim(); + const justification = value.slice(match.index + match[0].length).trim(); + + return { directivePart: directive, justificationPart: justification }; + } + + /** + * Parses a directive comment into directive text and value. + * @param {string} string The string with the directive to be parsed. + * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid. + */ + parseDirective(string) { + const { directivePart, justificationPart } = + this.#extractDirectiveComment(string); + const match = directivesPattern.exec(directivePart); + + if (!match) { + return undefined; + } + + const directiveText = match[1]; + const directiveValue = directivePart.slice( + match.index + directiveText.length, + ); + + return new DirectiveComment( + directiveText, + directiveValue.trim(), + justificationPart, + ); + } +} + +/** + * @fileoverview A collection of helper classes for implementing `SourceCode`. + * @author Nicholas C. Zakas + */ + +/* eslint class-methods-use-this: off -- Required to complete interface. */ + +//----------------------------------------------------------------------------- +// Type Definitions +//----------------------------------------------------------------------------- + +/** @typedef {import("@eslint/core").VisitTraversalStep} VisitTraversalStep */ +/** @typedef {import("@eslint/core").CallTraversalStep} CallTraversalStep */ +/** @typedef {import("@eslint/core").TextSourceCode} TextSourceCode */ +/** @typedef {import("@eslint/core").TraversalStep} TraversalStep */ +/** @typedef {import("@eslint/core").SourceLocation} SourceLocation */ +/** @typedef {import("@eslint/core").SourceLocationWithOffset} SourceLocationWithOffset */ +/** @typedef {import("@eslint/core").SourceRange} SourceRange */ +/** @typedef {import("@eslint/core").Directive} IDirective */ +/** @typedef {import("@eslint/core").DirectiveType} DirectiveType */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Determines if a node has ESTree-style loc information. + * @param {object} node The node to check. + * @returns {node is {loc:SourceLocation}} `true` if the node has ESTree-style loc information, `false` if not. + */ +function hasESTreeStyleLoc(node) { + return "loc" in node; +} + +/** + * Determines if a node has position-style loc information. + * @param {object} node The node to check. + * @returns {node is {position:SourceLocation}} `true` if the node has position-style range information, `false` if not. + */ +function hasPosStyleLoc(node) { + return "position" in node; +} + +/** + * Determines if a node has ESTree-style range information. + * @param {object} node The node to check. + * @returns {node is {range:SourceRange}} `true` if the node has ESTree-style range information, `false` if not. + */ +function hasESTreeStyleRange(node) { + return "range" in node; +} + +/** + * Determines if a node has position-style range information. + * @param {object} node The node to check. + * @returns {node is {position:SourceLocationWithOffset}} `true` if the node has position-style range information, `false` if not. + */ +function hasPosStyleRange(node) { + return "position" in node; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class to represent a step in the traversal process where a node is visited. + * @implements {VisitTraversalStep} + */ +class VisitNodeStep { + /** + * The type of the step. + * @type {"visit"} + * @readonly + */ + type = "visit"; + + /** + * The kind of the step. Represents the same data as the `type` property + * but it's a number for performance. + * @type {1} + * @readonly + */ + kind = 1; + + /** + * The target of the step. + * @type {object} + */ + target; + + /** + * The phase of the step. + * @type {1|2} + */ + phase; + + /** + * The arguments of the step. + * @type {Array} + */ + args; + + /** + * Creates a new instance. + * @param {Object} options The options for the step. + * @param {object} options.target The target of the step. + * @param {1|2} options.phase The phase of the step. + * @param {Array} options.args The arguments of the step. + */ + constructor({ target, phase, args }) { + this.target = target; + this.phase = phase; + this.args = args; + } +} + +/** + * A class to represent a step in the traversal process where a + * method is called. + * @implements {CallTraversalStep} + */ +class CallMethodStep { + /** + * The type of the step. + * @type {"call"} + * @readonly + */ + type = "call"; + + /** + * The kind of the step. Represents the same data as the `type` property + * but it's a number for performance. + * @type {2} + * @readonly + */ + kind = 2; + + /** + * The name of the method to call. + * @type {string} + */ + target; + + /** + * The arguments to pass to the method. + * @type {Array} + */ + args; + + /** + * Creates a new instance. + * @param {Object} options The options for the step. + * @param {string} options.target The target of the step. + * @param {Array} options.args The arguments of the step. + */ + constructor({ target, args }) { + this.target = target; + this.args = args; + } +} + +/** + * A class to represent a directive comment. + * @implements {IDirective} + */ +class Directive { + /** + * The type of directive. + * @type {DirectiveType} + * @readonly + */ + type; + + /** + * The node representing the directive. + * @type {unknown} + * @readonly + */ + node; + + /** + * Everything after the "eslint-disable" portion of the directive, + * but before the "--" that indicates the justification. + * @type {string} + * @readonly + */ + value; + + /** + * The justification for the directive. + * @type {string} + * @readonly + */ + justification; + + /** + * Creates a new instance. + * @param {Object} options The options for the directive. + * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive. + * @param {unknown} options.node The node representing the directive. + * @param {string} options.value The value of the directive. + * @param {string} options.justification The justification for the directive. + */ + constructor({ type, node, value, justification }) { + this.type = type; + this.node = node; + this.value = value; + this.justification = justification; + } +} + +/** + * Source Code Base Object + * @implements {TextSourceCode} + */ +class TextSourceCodeBase { + /** + * The lines of text in the source code. + * @type {Array} + */ + #lines; + + /** + * The AST of the source code. + * @type {object} + */ + ast; + + /** + * The text of the source code. + * @type {string} + */ + text; + + /** + * Creates a new instance. + * @param {Object} options The options for the instance. + * @param {string} options.text The source code text. + * @param {object} options.ast The root AST node. + * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. + */ + constructor({ text, ast, lineEndingPattern = /\r?\n/u }) { + this.ast = ast; + this.text = text; + this.#lines = text.split(lineEndingPattern); + } + + /** + * Returns the loc information for the given node or token. + * @param {object} nodeOrToken The node or token to get the loc information for. + * @returns {SourceLocation} The loc information for the node or token. + */ + getLoc(nodeOrToken) { + if (hasESTreeStyleLoc(nodeOrToken)) { + return nodeOrToken.loc; + } + + if (hasPosStyleLoc(nodeOrToken)) { + return nodeOrToken.position; + } + + throw new Error( + "Custom getLoc() method must be implemented in the subclass.", + ); + } + + /** + * Returns the range information for the given node or token. + * @param {object} nodeOrToken The node or token to get the range information for. + * @returns {SourceRange} The range information for the node or token. + */ + getRange(nodeOrToken) { + if (hasESTreeStyleRange(nodeOrToken)) { + return nodeOrToken.range; + } + + if (hasPosStyleRange(nodeOrToken)) { + return [ + nodeOrToken.position.start.offset, + nodeOrToken.position.end.offset, + ]; + } + + throw new Error( + "Custom getRange() method must be implemented in the subclass.", + ); + } + + /* eslint-disable no-unused-vars -- Required to complete interface. */ + /** + * Returns the parent of the given node. + * @param {object} node The node to get the parent of. + * @returns {object|undefined} The parent of the node. + */ + getParent(node) { + throw new Error("Not implemented."); + } + /* eslint-enable no-unused-vars -- Required to complete interface. */ + + /** + * Gets all the ancestors of a given node + * @param {object} node The node + * @returns {Array} All the ancestor nodes in the AST, not including the provided node, starting + * from the root node at index 0 and going inwards to the parent node. + * @throws {TypeError} When `node` is missing. + */ + getAncestors(node) { + if (!node) { + throw new TypeError("Missing required argument: node."); + } + + const ancestorsStartingAtParent = []; + + for ( + let ancestor = this.getParent(node); + ancestor; + ancestor = this.getParent(ancestor) + ) { + ancestorsStartingAtParent.push(ancestor); + } + + return ancestorsStartingAtParent.reverse(); + } + + /** + * Gets the source code for the given node. + * @param {object} [node] The AST node to get the text for. + * @param {number} [beforeCount] The number of characters before the node to retrieve. + * @param {number} [afterCount] The number of characters after the node to retrieve. + * @returns {string} The text representing the AST node. + * @public + */ + getText(node, beforeCount, afterCount) { + if (node) { + const range = this.getRange(node); + return this.text.slice( + Math.max(range[0] - (beforeCount || 0), 0), + range[1] + (afterCount || 0), + ); + } + return this.text; + } + + /** + * Gets the entire source text split into an array of lines. + * @returns {Array} The source text as an array of lines. + * @public + */ + get lines() { + return this.#lines; + } + + /** + * Traverse the source code and return the steps that were taken. + * @returns {Iterable} The steps that were taken while traversing the source code. + */ + traverse() { + throw new Error("Not implemented."); + } +} + +export { CallMethodStep, ConfigCommentParser, Directive, TextSourceCodeBase, VisitNodeStep }; diff --git a/node_modules/@eslint/plugin-kit/dist/esm/types.ts b/node_modules/@eslint/plugin-kit/dist/esm/types.ts new file mode 100644 index 0000000..d3f6a88 --- /dev/null +++ b/node_modules/@eslint/plugin-kit/dist/esm/types.ts @@ -0,0 +1,7 @@ +/** + * @fileoverview Types for the plugin-kit package. + * @author Nicholas C. Zakas + */ + +export type StringConfig = Record; +export type BooleanConfig = Record; diff --git a/node_modules/@eslint/plugin-kit/package.json b/node_modules/@eslint/plugin-kit/package.json new file mode 100644 index 0000000..99e96d2 --- /dev/null +++ b/node_modules/@eslint/plugin-kit/package.json @@ -0,0 +1,64 @@ +{ + "name": "@eslint/plugin-kit", + "version": "0.2.7", + "description": "Utilities for building ESLint plugins.", + "author": "Nicholas C. Zakas", + "type": "module", + "main": "dist/esm/index.js", + "types": "dist/esm/index.d.ts", + "exports": { + "require": { + "types": "./dist/cjs/index.d.cts", + "default": "./dist/cjs/index.cjs" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/rewrite.git" + }, + "bugs": { + "url": "https://github.com/eslint/rewrite/issues" + }, + "homepage": "https://github.com/eslint/rewrite#readme", + "scripts": { + "build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js", + "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts", + "build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts", + "pretest": "npm run build", + "test": "mocha tests/", + "test:coverage": "c8 npm test", + "test:jsr": "npx jsr@latest publish --dry-run", + "test:types": "tsc -p tests/types/tsconfig.json" + }, + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin" + ], + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" + }, + "devDependencies": { + "@types/levn": "^0.4.0", + "c8": "^9.1.0", + "mocha": "^10.4.0", + "rollup": "^4.16.2", + "rollup-plugin-copy": "^3.5.0", + "typescript": "^5.4.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } +} diff --git a/node_modules/@fastify/busboy/package.json b/node_modules/@fastify/busboy/package.json index 0c117b1..83693ac 100644 --- a/node_modules/@fastify/busboy/package.json +++ b/node_modules/@fastify/busboy/package.json @@ -1,36 +1,8 @@ { - "_from": "@fastify/busboy@^2.0.0", - "_id": "@fastify/busboy@2.1.1", - "_inBundle": false, - "_integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", - "_location": "/@fastify/busboy", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@fastify/busboy@^2.0.0", - "name": "@fastify/busboy", - "escapedName": "@fastify%2fbusboy", - "scope": "@fastify", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/undici" - ], - "_resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", - "_shasum": "b9da6a878a371829a0502c9b6c1c143ef6663f4d", - "_spec": "@fastify/busboy@^2.0.0", - "_where": "/Users/scubbo/Code/commit-report-sync/node_modules/undici", - "author": { - "name": "Brian White", - "email": "mscdex@mscdex.net" - }, - "bugs": { - "url": "https://github.com/fastify/busboy/issues" - }, - "bundleDependencies": false, + "name": "@fastify/busboy", + "version": "2.1.1", + "private": false, + "author": "Brian White ", "contributors": [ { "name": "Igor Savin", @@ -43,8 +15,26 @@ "url": "https://github.com/uzlopak" } ], - "deprecated": false, "description": "A streaming parser for HTML form data for node.js", + "main": "lib/main", + "type": "commonjs", + "types": "lib/main.d.ts", + "scripts": { + "bench:busboy": "cd benchmarks && npm install && npm run benchmark-fastify", + "bench:dicer": "node bench/dicer/dicer-bench-multipart-parser.js", + "coveralls": "nyc report --reporter=lcov", + "lint": "npm run lint:standard", + "lint:everything": "npm run lint && npm run test:types", + "lint:fix": "standard --fix", + "lint:standard": "standard --verbose | snazzy", + "test:mocha": "tap", + "test:types": "tsd", + "test:coverage": "nyc npm run test", + "test": "npm run test:mocha" + }, + "engines": { + "node": ">=14" + }, "devDependencies": { "@types/node": "^20.1.0", "busboy": "^1.0.0", @@ -56,19 +46,6 @@ "tsd": "^0.30.0", "typescript": "^5.0.2" }, - "engines": { - "node": ">=14" - }, - "files": [ - "README.md", - "LICENSE", - "lib/*", - "deps/encoding/*", - "deps/dicer/lib", - "deps/streamsearch/", - "deps/dicer/LICENSE" - ], - "homepage": "https://github.com/fastify/busboy#readme", "keywords": [ "uploads", "forms", @@ -76,25 +53,17 @@ "form-data" ], "license": "MIT", - "main": "lib/main", - "name": "@fastify/busboy", - "private": false, "repository": { "type": "git", "url": "git+https://github.com/fastify/busboy.git" }, - "scripts": { - "bench:busboy": "cd benchmarks && npm install && npm run benchmark-fastify", - "bench:dicer": "node bench/dicer/dicer-bench-multipart-parser.js", - "coveralls": "nyc report --reporter=lcov", - "lint": "npm run lint:standard", - "lint:everything": "npm run lint && npm run test:types", - "lint:fix": "standard --fix", - "lint:standard": "standard --verbose | snazzy", - "test": "npm run test:mocha", - "test:coverage": "nyc npm run test", - "test:mocha": "tap", - "test:types": "tsd" + "tsd": { + "directory": "test/types", + "compilerOptions": { + "esModuleInterop": false, + "module": "commonjs", + "target": "ES2017" + } }, "standard": { "globals": [ @@ -105,15 +74,13 @@ "bench" ] }, - "tsd": { - "directory": "test/types", - "compilerOptions": { - "esModuleInterop": false, - "module": "commonjs", - "target": "ES2017" - } - }, - "type": "commonjs", - "types": "lib/main.d.ts", - "version": "2.1.1" + "files": [ + "README.md", + "LICENSE", + "lib/*", + "deps/encoding/*", + "deps/dicer/lib", + "deps/streamsearch/", + "deps/dicer/LICENSE" + ] } diff --git a/node_modules/@humanfs/core/LICENSE b/node_modules/@humanfs/core/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@humanfs/core/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@humanfs/core/README.md b/node_modules/@humanfs/core/README.md new file mode 100644 index 0000000..4f86d14 --- /dev/null +++ b/node_modules/@humanfs/core/README.md @@ -0,0 +1,140 @@ +# `@humanfs/core` + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star. + +## Description + +The core functionality for humanfs that is shared across all implementations for all runtimes. The contents of this package are intentionally runtime agnostic and are not intended to be used alone. + +Currently, this package simply exports the `Hfs` class, which is an abstract base class intended to be inherited from in runtime-specific hfs packages (like `@humanfs/node`). + +> [!WARNING] +> This project is **experimental** and may change significantly before v1.0.0. Use at your own caution and definitely not in production! + +## Installation + +### Node.js + +Install using your favorite package manager for Node.js: + +```shell +npm install @humanfs/core + +# or + +pnpm install @humanfs/core + +# or + +yarn add @humanfs/core + +# or + +bun install @humanfs/core +``` + +Then you can import the `Hfs` and `Path` classes like this: + +```js +import { Hfs, Path } from "@humanfs/core"; +``` + +### Deno + +Install using [JSR](https://jsr.io): + +```shell +deno add @humanfs/core + +# or + +jsr add @humanfs/core +``` + +Then you can import the `Hfs` class like this: + +```js +import { Hfs, Path } from "@humanfs/core"; +``` + +### Browser + +It's recommended to import the minified version to save bandwidth: + +```js +import { Hfs, Path } from "https://cdn.skypack.dev/@humanfs/core?min"; +``` + +However, you can also import the unminified version for debugging purposes: + +```js +import { Hfs, Path } from "https://cdn.skypack.dev/@humanfs/core"; +``` + +## Usage + +### `Hfs` Class + +The `Hfs` class contains all of the basic functionality for an `Hfs` instance *without* a predefined impl. This class is mostly used for creating runtime-specific impls, such as `NodeHfs` and `DenoHfs`. + +You can create your own instance by providing an `impl` directly: + +```js +const hfs = new Hfs({ impl: { async text() {} }}); +``` + +The specified `impl` becomes the base impl for the instance, meaning you can always reset back to it using `resetImpl()`. + +You can also inherit from `Hfs` to create your own class with a preconfigured impl, such as: + +```js +class MyHfs extends Hfs { + constructor() { + super({ + impl: myImpl + }); + } +} +``` + +### `Path` Class + +The `Path` class represents the path to a directory or file within a file system. It's an abstract representation that can be used even outside of traditional file systems where string paths might not make sense. + +```js +const myPath = new Path(["dir", "subdir"]); +console.log(myPath.toString()); // "dir/subdir" + +// add another step +myPath.push("file.txt"); +console.log(myPath.toString()); // "dir/subdir/file.txt" + +// get just the last step +console.log(myPath.name); // "file.txt" + +// change just the last step +myPath.name = "file.json"; +console.log(myPath.name); // "file.json" +console.log(myPath.toString()); // "dir/subdir/file.json" + +// get the size of the path +console.log(myPath.size); // 3 + +// remove the last step +myPath.pop(); +console.log(myPath.toString()); // "dir/subdir" + +// iterate over the steps +for (const step of myPath) { + // do something +} + +// create a new path from a string +const newPath = Path.fromString("/foo/bar"); +``` + +## License + +Apache 2.0 diff --git a/node_modules/@humanfs/core/package.json b/node_modules/@humanfs/core/package.json new file mode 100644 index 0000000..e1f9f40 --- /dev/null +++ b/node_modules/@humanfs/core/package.json @@ -0,0 +1,52 @@ +{ + "name": "@humanfs/core", + "version": "0.19.1", + "description": "The core of the humanfs library.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "import": { + "types": "./dist/index.d.ts", + "default": "./src/index.js" + } + }, + "files": [ + "dist", + "src" + ], + "scripts": { + "build": "tsc", + "prepare": "npm run build", + "pretest": "npm run build", + "test": "c8 mocha tests" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/humanfs.git" + }, + "publishConfig": { + "access": "public" + }, + "keywords": [ + "filesystem", + "fs", + "hfs", + "files" + ], + "author": "Nicholas C. Zakas", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/humanwhocodes/humanfs/issues" + }, + "homepage": "https://github.com/humanwhocodes/humanfs#readme", + "engines": { + "node": ">=18.18.0" + }, + "devDependencies": { + "@humanfs/types": "^0.15.0", + "c8": "^9.0.0", + "mocha": "^10.2.0", + "typescript": "^5.2.2" + } +} diff --git a/node_modules/@humanfs/core/src/errors.js b/node_modules/@humanfs/core/src/errors.js new file mode 100644 index 0000000..8fb35be --- /dev/null +++ b/node_modules/@humanfs/core/src/errors.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Common error classes + * @author Nicholas C. Zakas + */ + +/** + * Error thrown when a file or directory is not found. + */ +export class NotFoundError extends Error { + /** + * Name of the error class. + * @type {string} + */ + name = "NotFoundError"; + + /** + * Error code. + * @type {string} + */ + code = "ENOENT"; + + /** + * Creates a new instance. + * @param {string} message The error message. + */ + constructor(message) { + super(`ENOENT: No such file or directory, ${message}`); + } +} + +/** + * Error thrown when an operation is not permitted. + */ +export class PermissionError extends Error { + /** + * Name of the error class. + * @type {string} + */ + name = "PermissionError"; + + /** + * Error code. + * @type {string} + */ + code = "EPERM"; + + /** + * Creates a new instance. + * @param {string} message The error message. + */ + constructor(message) { + super(`EPERM: Operation not permitted, ${message}`); + } +} + +/** + * Error thrown when an operation is not allowed on a directory. + */ + +export class DirectoryError extends Error { + /** + * Name of the error class. + * @type {string} + */ + name = "DirectoryError"; + + /** + * Error code. + * @type {string} + */ + code = "EISDIR"; + + /** + * Creates a new instance. + * @param {string} message The error message. + */ + constructor(message) { + super(`EISDIR: Illegal operation on a directory, ${message}`); + } +} + +/** + * Error thrown when a directory is not empty. + */ +export class NotEmptyError extends Error { + /** + * Name of the error class. + * @type {string} + */ + name = "NotEmptyError"; + + /** + * Error code. + * @type {string} + */ + code = "ENOTEMPTY"; + + /** + * Creates a new instance. + * @param {string} message The error message. + */ + constructor(message) { + super(`ENOTEMPTY: Directory not empty, ${message}`); + } +} diff --git a/node_modules/@humanfs/core/src/hfs.js b/node_modules/@humanfs/core/src/hfs.js new file mode 100644 index 0000000..38ee31c --- /dev/null +++ b/node_modules/@humanfs/core/src/hfs.js @@ -0,0 +1,699 @@ +/** + * @fileoverview The main file for the humanfs package. + * @author Nicholas C. Zakas + */ + +/* global URL, TextDecoder, TextEncoder */ + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** @typedef {import("@humanfs/types").HfsImpl} HfsImpl */ +/** @typedef {import("@humanfs/types").HfsDirectoryEntry} HfsDirectoryEntry */ +/** @typedef {import("@humanfs/types").HfsWalkEntry} HfsWalkEntry */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const decoder = new TextDecoder(); +const encoder = new TextEncoder(); + +/** + * Error to represent when a method is missing on an impl. + */ +export class NoSuchMethodError extends Error { + /** + * Creates a new instance. + * @param {string} methodName The name of the method that was missing. + */ + constructor(methodName) { + super(`Method "${methodName}" does not exist on impl.`); + } +} + +/** + * Error to represent when a method is not supported on an impl. This happens + * when a method on `Hfs` is called with one name and the corresponding method + * on the impl has a different name. (Example: `text()` and `bytes()`.) + */ +export class MethodNotSupportedError extends Error { + /** + * Creates a new instance. + * @param {string} methodName The name of the method that was missing. + */ + constructor(methodName) { + super(`Method "${methodName}" is not supported on this impl.`); + } +} + +/** + * Error to represent when an impl is already set. + */ +export class ImplAlreadySetError extends Error { + /** + * Creates a new instance. + */ + constructor() { + super(`Implementation already set.`); + } +} + +/** + * Asserts that the given path is a valid file path. + * @param {any} fileOrDirPath The path to check. + * @returns {void} + * @throws {TypeError} When the path is not a non-empty string. + */ +function assertValidFileOrDirPath(fileOrDirPath) { + if ( + !fileOrDirPath || + (!(fileOrDirPath instanceof URL) && typeof fileOrDirPath !== "string") + ) { + throw new TypeError("Path must be a non-empty string or URL."); + } +} + +/** + * Asserts that the given file contents are valid. + * @param {any} contents The contents to check. + * @returns {void} + * @throws {TypeError} When the contents are not a string or ArrayBuffer. + */ +function assertValidFileContents(contents) { + if ( + typeof contents !== "string" && + !(contents instanceof ArrayBuffer) && + !ArrayBuffer.isView(contents) + ) { + throw new TypeError( + "File contents must be a string, ArrayBuffer, or ArrayBuffer view.", + ); + } +} + +/** + * Converts the given contents to Uint8Array. + * @param {any} contents The data to convert. + * @returns {Uint8Array} The converted Uint8Array. + * @throws {TypeError} When the contents are not a string or ArrayBuffer. + */ +function toUint8Array(contents) { + if (contents instanceof Uint8Array) { + return contents; + } + + if (typeof contents === "string") { + return encoder.encode(contents); + } + + if (contents instanceof ArrayBuffer) { + return new Uint8Array(contents); + } + + if (ArrayBuffer.isView(contents)) { + const bytes = contents.buffer.slice( + contents.byteOffset, + contents.byteOffset + contents.byteLength, + ); + return new Uint8Array(bytes); + } + throw new TypeError( + "Invalid contents type. Expected string or ArrayBuffer.", + ); +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class representing a log entry. + */ +export class LogEntry { + /** + * The type of log entry. + * @type {string} + */ + type; + + /** + * The data associated with the log entry. + * @type {any} + */ + data; + + /** + * The time at which the log entry was created. + * @type {number} + */ + timestamp = Date.now(); + + /** + * Creates a new instance. + * @param {string} type The type of log entry. + * @param {any} [data] The data associated with the log entry. + */ + constructor(type, data) { + this.type = type; + this.data = data; + } +} + +/** + * A class representing a file system utility library. + * @implements {HfsImpl} + */ +export class Hfs { + /** + * The base implementation for this instance. + * @type {HfsImpl} + */ + #baseImpl; + + /** + * The current implementation for this instance. + * @type {HfsImpl} + */ + #impl; + + /** + * A map of log names to their corresponding entries. + * @type {Map>} + */ + #logs = new Map(); + + /** + * Creates a new instance. + * @param {object} options The options for the instance. + * @param {HfsImpl} options.impl The implementation to use. + */ + constructor({ impl }) { + this.#baseImpl = impl; + this.#impl = impl; + } + + /** + * Logs an entry onto all currently open logs. + * @param {string} methodName The name of the method being called. + * @param {...*} args The arguments to the method. + * @returns {void} + */ + #log(methodName, ...args) { + for (const logs of this.#logs.values()) { + logs.push(new LogEntry("call", { methodName, args })); + } + } + + /** + * Starts a new log with the given name. + * @param {string} name The name of the log to start; + * @returns {void} + * @throws {Error} When the log already exists. + * @throws {TypeError} When the name is not a non-empty string. + */ + logStart(name) { + if (!name || typeof name !== "string") { + throw new TypeError("Log name must be a non-empty string."); + } + + if (this.#logs.has(name)) { + throw new Error(`Log "${name}" already exists.`); + } + + this.#logs.set(name, []); + } + + /** + * Ends a log with the given name and returns the entries. + * @param {string} name The name of the log to end. + * @returns {Array} The entries in the log. + * @throws {Error} When the log does not exist. + */ + logEnd(name) { + if (this.#logs.has(name)) { + const logs = this.#logs.get(name); + this.#logs.delete(name); + return logs; + } + + throw new Error(`Log "${name}" does not exist.`); + } + + /** + * Determines if the current implementation is the base implementation. + * @returns {boolean} True if the current implementation is the base implementation. + */ + isBaseImpl() { + return this.#impl === this.#baseImpl; + } + + /** + * Sets the implementation for this instance. + * @param {object} impl The implementation to use. + * @returns {void} + */ + setImpl(impl) { + this.#log("implSet", impl); + + if (this.#impl !== this.#baseImpl) { + throw new ImplAlreadySetError(); + } + + this.#impl = impl; + } + + /** + * Resets the implementation for this instance back to its original. + * @returns {void} + */ + resetImpl() { + this.#log("implReset"); + this.#impl = this.#baseImpl; + } + + /** + * Asserts that the given method exists on the current implementation. + * @param {string} methodName The name of the method to check. + * @returns {void} + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + */ + #assertImplMethod(methodName) { + if (typeof this.#impl[methodName] !== "function") { + throw new NoSuchMethodError(methodName); + } + } + + /** + * Asserts that the given method exists on the current implementation, and if not, + * throws an error with a different method name. + * @param {string} methodName The name of the method to check. + * @param {string} targetMethodName The name of the method that should be reported + * as an error when methodName does not exist. + * @returns {void} + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + */ + #assertImplMethodAlt(methodName, targetMethodName) { + if (typeof this.#impl[methodName] !== "function") { + throw new MethodNotSupportedError(targetMethodName); + } + } + + /** + * Calls the given method on the current implementation. + * @param {string} methodName The name of the method to call. + * @param {...any} args The arguments to the method. + * @returns {any} The return value from the method. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + */ + #callImplMethod(methodName, ...args) { + this.#log(methodName, ...args); + this.#assertImplMethod(methodName); + return this.#impl[methodName](...args); + } + + /** + * Calls the given method on the current implementation and doesn't log the call. + * @param {string} methodName The name of the method to call. + * @param {...any} args The arguments to the method. + * @returns {any} The return value from the method. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + */ + #callImplMethodWithoutLog(methodName, ...args) { + this.#assertImplMethod(methodName); + return this.#impl[methodName](...args); + } + + /** + * Calls the given method on the current implementation but logs a different method name. + * @param {string} methodName The name of the method to call. + * @param {string} targetMethodName The name of the method to log. + * @param {...any} args The arguments to the method. + * @returns {any} The return value from the method. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + */ + #callImplMethodAlt(methodName, targetMethodName, ...args) { + this.#log(targetMethodName, ...args); + this.#assertImplMethodAlt(methodName, targetMethodName); + return this.#impl[methodName](...args); + } + + /** + * Reads the given file and returns the contents as text. Assumes UTF-8 encoding. + * @param {string|URL} filePath The file to read. + * @returns {Promise} The contents of the file. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the file path is not a non-empty string. + */ + async text(filePath) { + assertValidFileOrDirPath(filePath); + + const result = await this.#callImplMethodAlt("bytes", "text", filePath); + return result ? decoder.decode(result) : undefined; + } + + /** + * Reads the given file and returns the contents as JSON. Assumes UTF-8 encoding. + * @param {string|URL} filePath The file to read. + * @returns {Promise} The contents of the file as JSON. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {SyntaxError} When the file contents are not valid JSON. + * @throws {TypeError} When the file path is not a non-empty string. + */ + async json(filePath) { + assertValidFileOrDirPath(filePath); + + const result = await this.#callImplMethodAlt("bytes", "json", filePath); + return result ? JSON.parse(decoder.decode(result)) : undefined; + } + + /** + * Reads the given file and returns the contents as an ArrayBuffer. + * @param {string|URL} filePath The file to read. + * @returns {Promise} The contents of the file as an ArrayBuffer. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the file path is not a non-empty string. + * @deprecated Use bytes() instead. + */ + async arrayBuffer(filePath) { + assertValidFileOrDirPath(filePath); + + const result = await this.#callImplMethodAlt( + "bytes", + "arrayBuffer", + filePath, + ); + return result?.buffer; + } + + /** + * Reads the given file and returns the contents as an Uint8Array. + * @param {string|URL} filePath The file to read. + * @returns {Promise} The contents of the file as an Uint8Array. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the file path is not a non-empty string. + */ + async bytes(filePath) { + assertValidFileOrDirPath(filePath); + return this.#callImplMethod("bytes", filePath); + } + + /** + * Writes the given data to the given file. Creates any necessary directories along the way. + * If the data is a string, UTF-8 encoding is used. + * @param {string|URL} filePath The file to write. + * @param {string|ArrayBuffer|ArrayBufferView} contents The data to write. + * @returns {Promise} A promise that resolves when the file is written. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the file path is not a non-empty string. + */ + async write(filePath, contents) { + assertValidFileOrDirPath(filePath); + assertValidFileContents(contents); + this.#log("write", filePath, contents); + + let value = toUint8Array(contents); + return this.#callImplMethodWithoutLog("write", filePath, value); + } + + /** + * Appends the given data to the given file. Creates any necessary directories along the way. + * If the data is a string, UTF-8 encoding is used. + * @param {string|URL} filePath The file to append to. + * @param {string|ArrayBuffer|ArrayBufferView} contents The data to append. + * @returns {Promise} A promise that resolves when the file is appended to. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the file path is not a non-empty string. + * @throws {TypeError} When the file contents are not a string or ArrayBuffer. + * @throws {Error} When the file cannot be appended to. + */ + async append(filePath, contents) { + assertValidFileOrDirPath(filePath); + assertValidFileContents(contents); + this.#log("append", filePath, contents); + + let value = toUint8Array(contents); + return this.#callImplMethodWithoutLog("append", filePath, value); + } + + /** + * Determines if the given file exists. + * @param {string|URL} filePath The file to check. + * @returns {Promise} True if the file exists. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the file path is not a non-empty string. + */ + async isFile(filePath) { + assertValidFileOrDirPath(filePath); + return this.#callImplMethod("isFile", filePath); + } + + /** + * Determines if the given directory exists. + * @param {string|URL} dirPath The directory to check. + * @returns {Promise} True if the directory exists. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the directory path is not a non-empty string. + */ + async isDirectory(dirPath) { + assertValidFileOrDirPath(dirPath); + return this.#callImplMethod("isDirectory", dirPath); + } + + /** + * Creates the given directory. + * @param {string|URL} dirPath The directory to create. + * @returns {Promise} A promise that resolves when the directory is created. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the directory path is not a non-empty string. + */ + async createDirectory(dirPath) { + assertValidFileOrDirPath(dirPath); + return this.#callImplMethod("createDirectory", dirPath); + } + + /** + * Deletes the given file or empty directory. + * @param {string|URL} filePath The file to delete. + * @returns {Promise} A promise that resolves when the file or + * directory is deleted, true if the file or directory is deleted, false + * if the file or directory does not exist. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the file path is not a non-empty string. + */ + async delete(filePath) { + assertValidFileOrDirPath(filePath); + return this.#callImplMethod("delete", filePath); + } + + /** + * Deletes the given file or directory recursively. + * @param {string|URL} dirPath The directory to delete. + * @returns {Promise} A promise that resolves when the file or + * directory is deleted, true if the file or directory is deleted, false + * if the file or directory does not exist. + * @throws {NoSuchMethodError} When the method does not exist on the current implementation. + * @throws {TypeError} When the directory path is not a non-empty string. + */ + async deleteAll(dirPath) { + assertValidFileOrDirPath(dirPath); + return this.#callImplMethod("deleteAll", dirPath); + } + + /** + * Returns a list of directory entries for the given path. + * @param {string|URL} dirPath The path to the directory to read. + * @returns {AsyncIterable} A promise that resolves with the + * directory entries. + * @throws {TypeError} If the directory path is not a string or URL. + * @throws {Error} If the directory cannot be read. + */ + async *list(dirPath) { + assertValidFileOrDirPath(dirPath); + yield* await this.#callImplMethod("list", dirPath); + } + + /** + * Walks a directory using a depth-first traversal and returns the entries + * from the traversal. + * @param {string|URL} dirPath The path to the directory to walk. + * @param {Object} [options] The options for the walk. + * @param {(entry:HfsWalkEntry) => Promise|boolean} [options.directoryFilter] A filter function to determine + * if a directory's entries should be included in the walk. + * @param {(entry:HfsWalkEntry) => Promise|boolean} [options.entryFilter] A filter function to determine if + * an entry should be included in the walk. + * @returns {AsyncIterable} A promise that resolves with the + * directory entries. + * @throws {TypeError} If the directory path is not a string or URL. + * @throws {Error} If the directory cannot be read. + */ + async *walk( + dirPath, + { directoryFilter = () => true, entryFilter = () => true } = {}, + ) { + assertValidFileOrDirPath(dirPath); + this.#log("walk", dirPath, { directoryFilter, entryFilter }); + + // inner function for recursion without additional logging + const walk = async function* ( + dirPath, + { directoryFilter, entryFilter, parentPath = "", depth = 1 }, + ) { + let dirEntries; + + try { + dirEntries = await this.#callImplMethodWithoutLog( + "list", + dirPath, + ); + } catch (error) { + // if the directory does not exist then return an empty array + if (error.code === "ENOENT") { + return; + } + + // otherwise, rethrow the error + throw error; + } + + for await (const listEntry of dirEntries) { + const walkEntry = { + path: listEntry.name, + depth, + ...listEntry, + }; + + if (parentPath) { + walkEntry.path = `${parentPath}/${walkEntry.path}`; + } + + // first emit the entry but only if the entry filter returns true + let shouldEmitEntry = entryFilter(walkEntry); + if (shouldEmitEntry.then) { + shouldEmitEntry = await shouldEmitEntry; + } + + if (shouldEmitEntry) { + yield walkEntry; + } + + // if it's a directory then yield the entry and walk the directory + if (listEntry.isDirectory) { + // if the directory filter returns false, skip the directory + let shouldWalkDirectory = directoryFilter(walkEntry); + if (shouldWalkDirectory.then) { + shouldWalkDirectory = await shouldWalkDirectory; + } + + if (!shouldWalkDirectory) { + continue; + } + + // make sure there's a trailing slash on the directory path before appending + const directoryPath = + dirPath instanceof URL + ? new URL( + listEntry.name, + dirPath.href.endsWith("/") + ? dirPath.href + : `${dirPath.href}/`, + ) + : `${dirPath.endsWith("/") ? dirPath : `${dirPath}/`}${listEntry.name}`; + + yield* walk(directoryPath, { + directoryFilter, + entryFilter, + parentPath: walkEntry.path, + depth: depth + 1, + }); + } + } + }.bind(this); + + yield* walk(dirPath, { directoryFilter, entryFilter }); + } + + /** + * Returns the size of the given file. + * @param {string|URL} filePath The path to the file to read. + * @returns {Promise} A promise that resolves with the size of the file. + * @throws {TypeError} If the file path is not a string or URL. + * @throws {Error} If the file cannot be read. + */ + async size(filePath) { + assertValidFileOrDirPath(filePath); + return this.#callImplMethod("size", filePath); + } + + /** + * Returns the last modified timestamp of the given file or directory. + * @param {string|URL} fileOrDirPath The path to the file or directory. + * @returns {Promise} A promise that resolves with the last modified date + * or undefined if the file or directory does not exist. + * @throws {TypeError} If the path is not a string or URL. + */ + async lastModified(fileOrDirPath) { + assertValidFileOrDirPath(fileOrDirPath); + return this.#callImplMethod("lastModified", fileOrDirPath); + } + + /** + * Copys a file from one location to another. + * @param {string|URL} source The path to the file to copy. + * @param {string|URL} destination The path to the new file. + * @returns {Promise} A promise that resolves when the file is copied. + * @throws {TypeError} If the file path is not a string or URL. + * @throws {Error} If the file cannot be copied. + */ + async copy(source, destination) { + assertValidFileOrDirPath(source); + assertValidFileOrDirPath(destination); + return this.#callImplMethod("copy", source, destination); + } + + /** + * Copies a file or directory from one location to another. + * @param {string|URL} source The path to the file or directory to copy. + * @param {string|URL} destination The path to copy the file or directory to. + * @returns {Promise} A promise that resolves when the file or directory is + * copied. + * @throws {TypeError} If the directory path is not a string or URL. + * @throws {Error} If the directory cannot be copied. + */ + async copyAll(source, destination) { + assertValidFileOrDirPath(source); + assertValidFileOrDirPath(destination); + return this.#callImplMethod("copyAll", source, destination); + } + + /** + * Moves a file from the source path to the destination path. + * @param {string|URL} source The location of the file to move. + * @param {string|URL} destination The destination of the file to move. + * @returns {Promise} A promise that resolves when the move is complete. + * @throws {TypeError} If the file or directory paths are not strings. + * @throws {Error} If the file or directory cannot be moved. + */ + async move(source, destination) { + assertValidFileOrDirPath(source); + assertValidFileOrDirPath(destination); + return this.#callImplMethod("move", source, destination); + } + + /** + * Moves a file or directory from one location to another. + * @param {string|URL} source The path to the file or directory to move. + * @param {string|URL} destination The path to move the file or directory to. + * @returns {Promise} A promise that resolves when the file or directory is + * moved. + * @throws {TypeError} If the source is not a string or URL. + * @throws {TypeError} If the destination is not a string or URL. + * @throws {Error} If the file or directory cannot be moved. + */ + async moveAll(source, destination) { + assertValidFileOrDirPath(source); + assertValidFileOrDirPath(destination); + return this.#callImplMethod("moveAll", source, destination); + } +} diff --git a/node_modules/@humanfs/core/src/index.js b/node_modules/@humanfs/core/src/index.js new file mode 100644 index 0000000..1b662d4 --- /dev/null +++ b/node_modules/@humanfs/core/src/index.js @@ -0,0 +1,8 @@ +/** + * @fileoverview API entrypoint for hfs/core + * @author Nicholas C. Zakas + */ + +export { Hfs } from "./hfs.js"; +export { Path } from "./path.js"; +export * from "./errors.js"; diff --git a/node_modules/@humanfs/core/src/path.js b/node_modules/@humanfs/core/src/path.js new file mode 100644 index 0000000..4798091 --- /dev/null +++ b/node_modules/@humanfs/core/src/path.js @@ -0,0 +1,237 @@ +/** + * @fileoverview The Path class. + * @author Nicholas C. Zakas + */ + +/* globals URL */ + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** @typedef{import("@humanfs/types").HfsImpl} HfsImpl */ +/** @typedef{import("@humanfs/types").HfsDirectoryEntry} HfsDirectoryEntry */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Normalizes a path to use forward slashes. + * @param {string} filePath The path to normalize. + * @returns {string} The normalized path. + */ +function normalizePath(filePath) { + let startIndex = 0; + let endIndex = filePath.length; + + if (/[a-z]:\//i.test(filePath)) { + startIndex = 3; + } + + if (filePath.startsWith("./")) { + startIndex = 2; + } + + if (filePath.startsWith("/")) { + startIndex = 1; + } + + if (filePath.endsWith("/")) { + endIndex = filePath.length - 1; + } + + return filePath.slice(startIndex, endIndex).replace(/\\/g, "/"); +} + +/** + * Asserts that the given name is a non-empty string, no equal to "." or "..", + * and does not contain a forward slash or backslash. + * @param {string} name The name to check. + * @returns {void} + * @throws {TypeError} When name is not valid. + */ +function assertValidName(name) { + if (typeof name !== "string") { + throw new TypeError("name must be a string"); + } + + if (!name) { + throw new TypeError("name cannot be empty"); + } + + if (name === ".") { + throw new TypeError(`name cannot be "."`); + } + + if (name === "..") { + throw new TypeError(`name cannot be ".."`); + } + + if (name.includes("/") || name.includes("\\")) { + throw new TypeError( + `name cannot contain a slash or backslash: "${name}"`, + ); + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +export class Path { + /** + * The steps in the path. + * @type {Array} + */ + #steps; + + /** + * Creates a new instance. + * @param {Iterable} [steps] The steps to use for the path. + * @throws {TypeError} When steps is not iterable. + */ + constructor(steps = []) { + if (typeof steps[Symbol.iterator] !== "function") { + throw new TypeError("steps must be iterable"); + } + + this.#steps = [...steps]; + this.#steps.forEach(assertValidName); + } + + /** + * Adds steps to the end of the path. + * @param {...string} steps The steps to add to the path. + * @returns {void} + */ + push(...steps) { + steps.forEach(assertValidName); + this.#steps.push(...steps); + } + + /** + * Removes the last step from the path. + * @returns {string} The last step in the path. + */ + pop() { + return this.#steps.pop(); + } + + /** + * Returns an iterator for steps in the path. + * @returns {IterableIterator} An iterator for the steps in the path. + */ + steps() { + return this.#steps.values(); + } + + /** + * Returns an iterator for the steps in the path. + * @returns {IterableIterator} An iterator for the steps in the path. + */ + [Symbol.iterator]() { + return this.steps(); + } + + /** + * Retrieves the name (the last step) of the path. + * @type {string} + */ + get name() { + return this.#steps[this.#steps.length - 1]; + } + + /** + * Sets the name (the last step) of the path. + * @type {string} + */ + set name(value) { + assertValidName(value); + this.#steps[this.#steps.length - 1] = value; + } + + /** + * Retrieves the size of the path. + * @type {number} + */ + get size() { + return this.#steps.length; + } + + /** + * Returns the path as a string. + * @returns {string} The path as a string. + */ + toString() { + return this.#steps.join("/"); + } + + /** + * Creates a new path based on the argument type. If the argument is a string, + * it is assumed to be a file or directory path and is converted to a Path + * instance. If the argument is a URL, it is assumed to be a file URL and is + * converted to a Path instance. If the argument is a Path instance, it is + * copied into a new Path instance. If the argument is an array, it is assumed + * to be the steps of a path and is used to create a new Path instance. + * @param {string|URL|Path|Array} pathish The value to convert to a Path instance. + * @returns {Path} A new Path instance. + * @throws {TypeError} When pathish is not a string, URL, Path, or Array. + * @throws {TypeError} When pathish is a string and is empty. + */ + static from(pathish) { + if (typeof pathish === "string") { + if (!pathish) { + throw new TypeError("argument cannot be empty"); + } + + return Path.fromString(pathish); + } + + if (pathish instanceof URL) { + return Path.fromURL(pathish); + } + + if (pathish instanceof Path || Array.isArray(pathish)) { + return new Path(pathish); + } + + throw new TypeError("argument must be a string, URL, Path, or Array"); + } + + /** + * Creates a new Path instance from a string. + * @param {string} fileOrDirPath The file or directory path to convert. + * @returns {Path} A new Path instance. + * @deprecated Use Path.from() instead. + */ + static fromString(fileOrDirPath) { + return new Path(normalizePath(fileOrDirPath).split("/")); + } + + /** + * Creates a new Path instance from a URL. + * @param {URL} url The URL to convert. + * @returns {Path} A new Path instance. + * @throws {TypeError} When url is not a URL instance. + * @throws {TypeError} When url.pathname is empty. + * @throws {TypeError} When url.protocol is not "file:". + * @deprecated Use Path.from() instead. + */ + static fromURL(url) { + if (!(url instanceof URL)) { + throw new TypeError("url must be a URL instance"); + } + + if (!url.pathname || url.pathname === "/") { + throw new TypeError("url.pathname cannot be empty"); + } + + if (url.protocol !== "file:") { + throw new TypeError(`url.protocol must be "file:"`); + } + + // Remove leading slash in pathname + return new Path(normalizePath(url.pathname.slice(1)).split("/")); + } +} diff --git a/node_modules/@humanfs/node/LICENSE b/node_modules/@humanfs/node/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@humanfs/node/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@humanfs/node/README.md b/node_modules/@humanfs/node/README.md new file mode 100644 index 0000000..c3e4be4 --- /dev/null +++ b/node_modules/@humanfs/node/README.md @@ -0,0 +1,141 @@ +# `@humanfs/node` + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star. + +## Description + +The `hfs` bindings for use in Node.js and Node.js-compatible runtimes. + +> [!WARNING] +> This project is **experimental** and may change significantly before v1.0.0. Use at your own caution and definitely not in production! + +## Installation + +Install using your favorite package manager: + +```shell +npm install @humanfs/node + +# or + +pnpm install @humanfs/node + +# or + +yarn add @humanfs/node + +# or + +bun install @humanfs/node +``` + +## Usage + +The easiest way to use hfs in your project is to import the `hfs` object: + +```js +import { hfs } from "@humanfs/node"; +``` + +Then, you can use the API methods: + +```js +// 1. Files + +// read from a text file +const text = await hfs.text("file.txt"); + +// read from a JSON file +const json = await hfs.json("file.json"); + +// read raw bytes from a text file +const arrayBuffer = await hfs.arrayBuffer("file.txt"); + +// write text to a file +await hfs.write("file.txt", "Hello world!"); + +// write bytes to a file +await hfs.write("file.txt", new TextEncoder().encode("Hello world!")); + +// append text to a file +await hfs.append("file.txt", "Hello world!"); + +// append bytes to a file +await hfs.append("file.txt", new TextEncoder().encode("Hello world!")); + +// does the file exist? +const found = await hfs.isFile("file.txt"); + +// how big is the file? +const size = await hfs.size("file.txt"); + +// when was the file modified? +const mtime = await hfs.lastModified("file.txt"); + +// copy a file from one location to another +await hfs.copy("file.txt", "file-copy.txt"); + +// move a file from one location to another +await hfs.move("file.txt", "renamed.txt"); + +// delete a file +await hfs.delete("file.txt"); + +// 2. Directories + +// create a directory +await hfs.createDirectory("dir"); + +// create a directory recursively +await hfs.createDirectory("dir/subdir"); + +// does the directory exist? +const dirFound = await hfs.isDirectory("dir"); + +// copy the entire directory +hfs.copyAll("from-dir", "to-dir"); + +// move the entire directory +hfs.moveAll("from-dir", "to-dir"); + +// delete a directory +await hfs.delete("dir"); + +// delete a non-empty directory +await hfs.deleteAll("dir"); +``` + +If you'd like to create your own instance, import the `NodeHfs` constructor: + +```js +import { NodeHfs } from "@humanfs/node"; +import fsp from "fs/promises"; + +const hfs = new NodeHfs(); + +// optionally specify the fs/promises object to use +const hfs = new NodeHfs({ fsp }); +``` + +If you'd like to use just the impl, import the `NodeHfsImpl` constructor: + +```js +import { NodeHfsImpl } from "@humanfs/node"; +import fsp from "fs/promises"; + +const hfs = new NodeHfsImpl(); + +// optionally specify the fs/promises object to use +const hfs = new NodeHfsImpl({ fsp }); +``` + +## Errors Handled + +* `ENOENT` - in most cases, these errors are handled silently. +* `ENFILE` and `EMFILE` - calls that result in these errors are retried for up to 60 seconds before giving up for good. + +## License + +Apache 2.0 diff --git a/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/LICENSE b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/README.md b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/README.md new file mode 100644 index 0000000..c419ef1 --- /dev/null +++ b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/README.md @@ -0,0 +1,138 @@ +# Retry utility + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star. + +## Description + +A utility for retrying failed async JavaScript calls based on the error returned. + +## Usage + +### Node.js + +Install using [npm][npm] or [yarn][yarn]: + +``` +npm install @humanwhocodes/retry + +# or + +yarn add @humanwhocodes/retry +``` + +Import into your Node.js project: + +```js +// CommonJS +const { Retrier } = require("@humanwhocodes/retry"); + +// ESM +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Deno + +Install using [JSR](https://jsr.io): + +```shell +deno add @humanwhocodes/retry + +#or + +jsr add @humanwhocodes/retry +``` + +Then import into your Deno project: + +```js +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Bun + +Install using this command: + +``` +bun add @humanwhocodes/retry +``` + +Import into your Bun project: + +```js +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Browser + +It's recommended to import the minified version to save bandwidth: + +```js +import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry?min"; +``` + +However, you can also import the unminified version for debugging purposes: + +```js +import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry"; +``` + +## API + +After importing, create a new instance of `Retrier` and specify the function to run on the error. This function should return `true` if you want the call retried and `false` if not. + +```js +// this instance will retry if the specific error code is found +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); +``` + +Then, call the `retry()` method around the function you'd like to retry, such as: + +```js +import fs from "fs/promises"; + +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); + +const text = await retrier.retry(() => fs.readFile("README.md", "utf8")); +``` + +The `retry()` method will either pass through the result on success or wait and retry on failure. Any error that isn't caught by the retrier is automatically rejected so the end result is a transparent passing through of both success and failure. + +You can also pass an `AbortSignal` to cancel a retry: + +```js +import fs from "fs/promises"; + +const controller = new AbortController(); +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); + +const text = await retrier.retry( + () => fs.readFile("README.md", "utf8"), + { signal: controller.signal } +); +``` + +## Developer Setup + +1. Fork the repository +2. Clone your fork +3. Run `npm install` to setup dependencies +4. Run `npm test` to run tests + +## License + +Apache 2.0 + +## Prior Art + +This utility is inspired by, and contains code from [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). + +[npm]: https://npmjs.com/ +[yarn]: https://yarnpkg.com/ diff --git a/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.cjs b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.cjs new file mode 100644 index 0000000..5e06a42 --- /dev/null +++ b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.cjs @@ -0,0 +1,303 @@ +'use strict'; + +/** + * @fileoverview A utility for retrying failed async method calls. + */ + +/* global setTimeout, clearTimeout */ + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const MAX_TASK_TIMEOUT = 60000; +const MAX_TASK_DELAY = 100; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * The following logic has been extracted from graceful-fs. + * + * The ISC License + * + * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * Checks if it is time to retry a task based on the timestamp and last attempt time. + * @param {RetryTask} task The task to check. + * @param {number} maxDelay The maximum delay for the queue. + * @returns {boolean} true if it is time to retry, false otherwise. + */ +function isTimeToRetry(task, maxDelay) { + const timeSinceLastAttempt = Date.now() - task.lastAttempt; + const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1); + const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay); + + return timeSinceLastAttempt >= desiredDelay; +} + +/** + * Checks if it is time to bail out based on the given timestamp. + * @param {RetryTask} task The task to check. + * @param {number} timeout The timeout for the queue. + * @returns {boolean} true if it is time to bail, false otherwise. + */ +function isTimeToBail(task, timeout) { + return task.age > timeout; +} + + +/** + * A class to represent a task in the retry queue. + */ +class RetryTask { + + /** + * The unique ID for the task. + * @type {string} + */ + id = Math.random().toString(36).slice(2); + + /** + * The function to call. + * @type {Function} + */ + fn; + + /** + * The error that was thrown. + * @type {Error} + */ + error; + + /** + * The timestamp of the task. + * @type {number} + */ + timestamp = Date.now(); + + /** + * The timestamp of the last attempt. + * @type {number} + */ + lastAttempt = this.timestamp; + + /** + * The resolve function for the promise. + * @type {Function} + */ + resolve; + + /** + * The reject function for the promise. + * @type {Function} + */ + reject; + + /** + * The AbortSignal to monitor for cancellation. + * @type {AbortSignal|undefined} + */ + signal; + + /** + * Creates a new instance. + * @param {Function} fn The function to call. + * @param {Error} error The error that was thrown. + * @param {Function} resolve The resolve function for the promise. + * @param {Function} reject The reject function for the promise. + * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation. + */ + constructor(fn, error, resolve, reject, signal) { + this.fn = fn; + this.error = error; + this.timestamp = Date.now(); + this.lastAttempt = Date.now(); + this.resolve = resolve; + this.reject = reject; + this.signal = signal; + } + + /** + * Gets the age of the task. + * @returns {number} The age of the task in milliseconds. + * @readonly + */ + get age() { + return Date.now() - this.timestamp; + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class that manages a queue of retry jobs. + */ +class Retrier { + + /** + * Represents the queue for processing tasks. + * @type {Array} + */ + #queue = []; + + /** + * The timeout for the queue. + * @type {number} + */ + #timeout; + + /** + * The maximum delay for the queue. + * @type {number} + */ + #maxDelay; + + /** + * The setTimeout() timer ID. + * @type {NodeJS.Timeout|undefined} + */ + #timerId; + + /** + * The function to call. + * @type {Function} + */ + #check; + + /** + * Creates a new instance. + * @param {Function} check The function to call. + * @param {object} [options] The options for the instance. + * @param {number} [options.timeout] The timeout for the queue. + * @param {number} [options.maxDelay] The maximum delay for the queue. + */ + constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY } = {}) { + + if (typeof check !== "function") { + throw new Error("Missing function to check errors"); + } + + this.#check = check; + this.#timeout = timeout; + this.#maxDelay = maxDelay; + } + + /** + * Adds a new retry job to the queue. + * @param {Function} fn The function to call. + * @param {object} [options] The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @returns {Promise} A promise that resolves when the queue is + * processed. + */ + retry(fn, { signal } = {}) { + + signal?.throwIfAborted(); + + let result; + + try { + result = fn(); + } catch (/** @type {any} */ error) { + return Promise.reject(new Error(`Synchronous error: ${error.message}`, { cause: error })); + } + + // if the result is not a promise then reject an error + if (!result || typeof result.then !== "function") { + return Promise.reject(new Error("Result is not a promise.")); + } + + // call the original function and catch any ENFILE or EMFILE errors + // @ts-ignore because we know it's any + return Promise.resolve(result).catch(error => { + if (!this.#check(error)) { + throw error; + } + + return new Promise((resolve, reject) => { + this.#queue.push(new RetryTask(fn, error, resolve, reject, signal)); + + signal?.addEventListener("abort", () => { + reject(signal.reason); + }); + + this.#processQueue(); + }); + }); + } + + /** + * Processes the queue. + * @returns {void} + */ + #processQueue() { + // clear any timer because we're going to check right now + clearTimeout(this.#timerId); + this.#timerId = undefined; + + // if there's nothing in the queue, we're done + const task = this.#queue.shift(); + if (!task) { + return; + } + const processAgain = () => { + this.#timerId = setTimeout(() => this.#processQueue(), 0); + }; + + // if it's time to bail, then bail + if (isTimeToBail(task, this.#timeout)) { + task.reject(task.error); + processAgain(); + return; + } + + // if it's not time to retry, then wait and try again + if (!isTimeToRetry(task, this.#maxDelay)) { + this.#queue.push(task); + processAgain(); + return; + } + + // otherwise, try again + task.lastAttempt = Date.now(); + + // Promise.resolve needed in case it's a thenable but not a Promise + Promise.resolve(task.fn()) + // @ts-ignore because we know it's any + .then(result => task.resolve(result)) + + // @ts-ignore because we know it's any + .catch(error => { + if (!this.#check(error)) { + task.reject(error); + return; + } + + // update the task timestamp and push to back of queue to try again + task.lastAttempt = Date.now(); + this.#queue.push(task); + + }) + .finally(() => this.#processQueue()); + } +} + +exports.Retrier = Retrier; diff --git a/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.d.cts b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.d.cts new file mode 100644 index 0000000..f152965 --- /dev/null +++ b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.d.cts @@ -0,0 +1,28 @@ +/** + * A class that manages a queue of retry jobs. + */ +export class Retrier { + /** + * Creates a new instance. + * @param {Function} check The function to call. + * @param {object} [options] The options for the instance. + * @param {number} [options.timeout] The timeout for the queue. + * @param {number} [options.maxDelay] The maximum delay for the queue. + */ + constructor(check: Function, { timeout, maxDelay }?: { + timeout?: number | undefined; + maxDelay?: number | undefined; + } | undefined); + /** + * Adds a new retry job to the queue. + * @param {Function} fn The function to call. + * @param {object} [options] The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @returns {Promise} A promise that resolves when the queue is + * processed. + */ + retry(fn: Function, { signal }?: { + signal?: AbortSignal | undefined; + } | undefined): Promise; + #private; +} diff --git a/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.js b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.js new file mode 100644 index 0000000..4343d58 --- /dev/null +++ b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.js @@ -0,0 +1,302 @@ +// @ts-self-types="./retrier.d.ts" +/** + * @fileoverview A utility for retrying failed async method calls. + */ + +/* global setTimeout, clearTimeout */ + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const MAX_TASK_TIMEOUT = 60000; +const MAX_TASK_DELAY = 100; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * The following logic has been extracted from graceful-fs. + * + * The ISC License + * + * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * Checks if it is time to retry a task based on the timestamp and last attempt time. + * @param {RetryTask} task The task to check. + * @param {number} maxDelay The maximum delay for the queue. + * @returns {boolean} true if it is time to retry, false otherwise. + */ +function isTimeToRetry(task, maxDelay) { + const timeSinceLastAttempt = Date.now() - task.lastAttempt; + const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1); + const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay); + + return timeSinceLastAttempt >= desiredDelay; +} + +/** + * Checks if it is time to bail out based on the given timestamp. + * @param {RetryTask} task The task to check. + * @param {number} timeout The timeout for the queue. + * @returns {boolean} true if it is time to bail, false otherwise. + */ +function isTimeToBail(task, timeout) { + return task.age > timeout; +} + + +/** + * A class to represent a task in the retry queue. + */ +class RetryTask { + + /** + * The unique ID for the task. + * @type {string} + */ + id = Math.random().toString(36).slice(2); + + /** + * The function to call. + * @type {Function} + */ + fn; + + /** + * The error that was thrown. + * @type {Error} + */ + error; + + /** + * The timestamp of the task. + * @type {number} + */ + timestamp = Date.now(); + + /** + * The timestamp of the last attempt. + * @type {number} + */ + lastAttempt = this.timestamp; + + /** + * The resolve function for the promise. + * @type {Function} + */ + resolve; + + /** + * The reject function for the promise. + * @type {Function} + */ + reject; + + /** + * The AbortSignal to monitor for cancellation. + * @type {AbortSignal|undefined} + */ + signal; + + /** + * Creates a new instance. + * @param {Function} fn The function to call. + * @param {Error} error The error that was thrown. + * @param {Function} resolve The resolve function for the promise. + * @param {Function} reject The reject function for the promise. + * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation. + */ + constructor(fn, error, resolve, reject, signal) { + this.fn = fn; + this.error = error; + this.timestamp = Date.now(); + this.lastAttempt = Date.now(); + this.resolve = resolve; + this.reject = reject; + this.signal = signal; + } + + /** + * Gets the age of the task. + * @returns {number} The age of the task in milliseconds. + * @readonly + */ + get age() { + return Date.now() - this.timestamp; + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class that manages a queue of retry jobs. + */ +class Retrier { + + /** + * Represents the queue for processing tasks. + * @type {Array} + */ + #queue = []; + + /** + * The timeout for the queue. + * @type {number} + */ + #timeout; + + /** + * The maximum delay for the queue. + * @type {number} + */ + #maxDelay; + + /** + * The setTimeout() timer ID. + * @type {NodeJS.Timeout|undefined} + */ + #timerId; + + /** + * The function to call. + * @type {Function} + */ + #check; + + /** + * Creates a new instance. + * @param {Function} check The function to call. + * @param {object} [options] The options for the instance. + * @param {number} [options.timeout] The timeout for the queue. + * @param {number} [options.maxDelay] The maximum delay for the queue. + */ + constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY } = {}) { + + if (typeof check !== "function") { + throw new Error("Missing function to check errors"); + } + + this.#check = check; + this.#timeout = timeout; + this.#maxDelay = maxDelay; + } + + /** + * Adds a new retry job to the queue. + * @param {Function} fn The function to call. + * @param {object} [options] The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @returns {Promise} A promise that resolves when the queue is + * processed. + */ + retry(fn, { signal } = {}) { + + signal?.throwIfAborted(); + + let result; + + try { + result = fn(); + } catch (/** @type {any} */ error) { + return Promise.reject(new Error(`Synchronous error: ${error.message}`, { cause: error })); + } + + // if the result is not a promise then reject an error + if (!result || typeof result.then !== "function") { + return Promise.reject(new Error("Result is not a promise.")); + } + + // call the original function and catch any ENFILE or EMFILE errors + // @ts-ignore because we know it's any + return Promise.resolve(result).catch(error => { + if (!this.#check(error)) { + throw error; + } + + return new Promise((resolve, reject) => { + this.#queue.push(new RetryTask(fn, error, resolve, reject, signal)); + + signal?.addEventListener("abort", () => { + reject(signal.reason); + }); + + this.#processQueue(); + }); + }); + } + + /** + * Processes the queue. + * @returns {void} + */ + #processQueue() { + // clear any timer because we're going to check right now + clearTimeout(this.#timerId); + this.#timerId = undefined; + + // if there's nothing in the queue, we're done + const task = this.#queue.shift(); + if (!task) { + return; + } + const processAgain = () => { + this.#timerId = setTimeout(() => this.#processQueue(), 0); + }; + + // if it's time to bail, then bail + if (isTimeToBail(task, this.#timeout)) { + task.reject(task.error); + processAgain(); + return; + } + + // if it's not time to retry, then wait and try again + if (!isTimeToRetry(task, this.#maxDelay)) { + this.#queue.push(task); + processAgain(); + return; + } + + // otherwise, try again + task.lastAttempt = Date.now(); + + // Promise.resolve needed in case it's a thenable but not a Promise + Promise.resolve(task.fn()) + // @ts-ignore because we know it's any + .then(result => task.resolve(result)) + + // @ts-ignore because we know it's any + .catch(error => { + if (!this.#check(error)) { + task.reject(error); + return; + } + + // update the task timestamp and push to back of queue to try again + task.lastAttempt = Date.now(); + this.#queue.push(task); + + }) + .finally(() => this.#processQueue()); + } +} + +export { Retrier }; diff --git a/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.min.js b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.min.js new file mode 100644 index 0000000..6021e1a --- /dev/null +++ b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.min.js @@ -0,0 +1 @@ +class RetryTask{id=Math.random().toString(36).slice(2);fn;error;timestamp=Date.now();lastAttempt=this.timestamp;resolve;reject;signal;constructor(t,e,r,s,i){this.fn=t,this.error=e,this.timestamp=Date.now(),this.lastAttempt=Date.now(),this.resolve=r,this.reject=s,this.signal=i}get age(){return Date.now()-this.timestamp}}class Retrier{#t=[];#e;#r;#s;#i;constructor(t,{timeout:e=6e4,maxDelay:r=100}={}){if("function"!=typeof t)throw new Error("Missing function to check errors");this.#i=t,this.#e=e,this.#r=r}retry(t,{signal:e}={}){let r;e?.throwIfAborted();try{r=t()}catch(t){return Promise.reject(new Error(`Synchronous error: ${t.message}`,{cause:t}))}return r&&"function"==typeof r.then?Promise.resolve(r).catch((r=>{if(!this.#i(r))throw r;return new Promise(((s,i)=>{this.#t.push(new RetryTask(t,r,s,i,e)),e?.addEventListener("abort",(()=>{i(e.reason)})),this.#o()}))})):Promise.reject(new Error("Result is not a promise."))}#o(){clearTimeout(this.#s),this.#s=void 0;const t=this.#t.shift();if(!t)return;const e=()=>{this.#s=setTimeout((()=>this.#o()),0)};return function(t,e){return t.age>e}(t,this.#e)?(t.reject(t.error),void e()):function(t,e){const r=Date.now()-t.lastAttempt,s=Math.max(t.lastAttempt-t.timestamp,1);return r>=Math.min(1.2*s,e)}(t,this.#r)?(t.lastAttempt=Date.now(),void Promise.resolve(t.fn()).then((e=>t.resolve(e))).catch((e=>{this.#i(e)?(t.lastAttempt=Date.now(),this.#t.push(t)):t.reject(e)})).finally((()=>this.#o()))):(this.#t.push(t),void e())}}export{Retrier}; diff --git a/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.mjs b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.mjs new file mode 100644 index 0000000..6794621 --- /dev/null +++ b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/dist/retrier.mjs @@ -0,0 +1,301 @@ +/** + * @fileoverview A utility for retrying failed async method calls. + */ + +/* global setTimeout, clearTimeout */ + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const MAX_TASK_TIMEOUT = 60000; +const MAX_TASK_DELAY = 100; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * The following logic has been extracted from graceful-fs. + * + * The ISC License + * + * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * Checks if it is time to retry a task based on the timestamp and last attempt time. + * @param {RetryTask} task The task to check. + * @param {number} maxDelay The maximum delay for the queue. + * @returns {boolean} true if it is time to retry, false otherwise. + */ +function isTimeToRetry(task, maxDelay) { + const timeSinceLastAttempt = Date.now() - task.lastAttempt; + const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1); + const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay); + + return timeSinceLastAttempt >= desiredDelay; +} + +/** + * Checks if it is time to bail out based on the given timestamp. + * @param {RetryTask} task The task to check. + * @param {number} timeout The timeout for the queue. + * @returns {boolean} true if it is time to bail, false otherwise. + */ +function isTimeToBail(task, timeout) { + return task.age > timeout; +} + + +/** + * A class to represent a task in the retry queue. + */ +class RetryTask { + + /** + * The unique ID for the task. + * @type {string} + */ + id = Math.random().toString(36).slice(2); + + /** + * The function to call. + * @type {Function} + */ + fn; + + /** + * The error that was thrown. + * @type {Error} + */ + error; + + /** + * The timestamp of the task. + * @type {number} + */ + timestamp = Date.now(); + + /** + * The timestamp of the last attempt. + * @type {number} + */ + lastAttempt = this.timestamp; + + /** + * The resolve function for the promise. + * @type {Function} + */ + resolve; + + /** + * The reject function for the promise. + * @type {Function} + */ + reject; + + /** + * The AbortSignal to monitor for cancellation. + * @type {AbortSignal|undefined} + */ + signal; + + /** + * Creates a new instance. + * @param {Function} fn The function to call. + * @param {Error} error The error that was thrown. + * @param {Function} resolve The resolve function for the promise. + * @param {Function} reject The reject function for the promise. + * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation. + */ + constructor(fn, error, resolve, reject, signal) { + this.fn = fn; + this.error = error; + this.timestamp = Date.now(); + this.lastAttempt = Date.now(); + this.resolve = resolve; + this.reject = reject; + this.signal = signal; + } + + /** + * Gets the age of the task. + * @returns {number} The age of the task in milliseconds. + * @readonly + */ + get age() { + return Date.now() - this.timestamp; + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class that manages a queue of retry jobs. + */ +class Retrier { + + /** + * Represents the queue for processing tasks. + * @type {Array} + */ + #queue = []; + + /** + * The timeout for the queue. + * @type {number} + */ + #timeout; + + /** + * The maximum delay for the queue. + * @type {number} + */ + #maxDelay; + + /** + * The setTimeout() timer ID. + * @type {NodeJS.Timeout|undefined} + */ + #timerId; + + /** + * The function to call. + * @type {Function} + */ + #check; + + /** + * Creates a new instance. + * @param {Function} check The function to call. + * @param {object} [options] The options for the instance. + * @param {number} [options.timeout] The timeout for the queue. + * @param {number} [options.maxDelay] The maximum delay for the queue. + */ + constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY } = {}) { + + if (typeof check !== "function") { + throw new Error("Missing function to check errors"); + } + + this.#check = check; + this.#timeout = timeout; + this.#maxDelay = maxDelay; + } + + /** + * Adds a new retry job to the queue. + * @param {Function} fn The function to call. + * @param {object} [options] The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @returns {Promise} A promise that resolves when the queue is + * processed. + */ + retry(fn, { signal } = {}) { + + signal?.throwIfAborted(); + + let result; + + try { + result = fn(); + } catch (/** @type {any} */ error) { + return Promise.reject(new Error(`Synchronous error: ${error.message}`, { cause: error })); + } + + // if the result is not a promise then reject an error + if (!result || typeof result.then !== "function") { + return Promise.reject(new Error("Result is not a promise.")); + } + + // call the original function and catch any ENFILE or EMFILE errors + // @ts-ignore because we know it's any + return Promise.resolve(result).catch(error => { + if (!this.#check(error)) { + throw error; + } + + return new Promise((resolve, reject) => { + this.#queue.push(new RetryTask(fn, error, resolve, reject, signal)); + + signal?.addEventListener("abort", () => { + reject(signal.reason); + }); + + this.#processQueue(); + }); + }); + } + + /** + * Processes the queue. + * @returns {void} + */ + #processQueue() { + // clear any timer because we're going to check right now + clearTimeout(this.#timerId); + this.#timerId = undefined; + + // if there's nothing in the queue, we're done + const task = this.#queue.shift(); + if (!task) { + return; + } + const processAgain = () => { + this.#timerId = setTimeout(() => this.#processQueue(), 0); + }; + + // if it's time to bail, then bail + if (isTimeToBail(task, this.#timeout)) { + task.reject(task.error); + processAgain(); + return; + } + + // if it's not time to retry, then wait and try again + if (!isTimeToRetry(task, this.#maxDelay)) { + this.#queue.push(task); + processAgain(); + return; + } + + // otherwise, try again + task.lastAttempt = Date.now(); + + // Promise.resolve needed in case it's a thenable but not a Promise + Promise.resolve(task.fn()) + // @ts-ignore because we know it's any + .then(result => task.resolve(result)) + + // @ts-ignore because we know it's any + .catch(error => { + if (!this.#check(error)) { + task.reject(error); + return; + } + + // update the task timestamp and push to back of queue to try again + task.lastAttempt = Date.now(); + this.#queue.push(task); + + }) + .finally(() => this.#processQueue()); + } +} + +export { Retrier }; diff --git a/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/package.json b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/package.json new file mode 100644 index 0000000..a33e749 --- /dev/null +++ b/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry/package.json @@ -0,0 +1,77 @@ +{ + "name": "@humanwhocodes/retry", + "version": "0.3.1", + "description": "A utility to retry failed async methods.", + "type": "module", + "main": "dist/retrier.cjs", + "module": "dist/retrier.js", + "types": "dist/retrier.d.ts", + "exports": { + "require": { + "types": "./dist/retrier.d.cts", + "default": "./dist/retrier.cjs" + }, + "import": { + "types": "./dist/retrier.d.ts", + "default": "./dist/retrier.js" + } + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18.18" + }, + "publishConfig": { + "access": "public" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "eslint --fix" + ] + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + }, + "scripts": { + "build:cts-types": "node -e \"fs.copyFileSync('dist/retrier.d.ts', 'dist/retrier.d.cts')\"", + "build": "rollup -c && tsc && npm run build:cts-types", + "prepare": "npm run build", + "lint": "eslint src/ tests/", + "pretest": "npm run build", + "test:unit": "mocha tests/retrier.test.js", + "test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs", + "test:jsr": "npx jsr@latest publish --dry-run", + "test:emfile": "node tools/check-emfile-handling.js", + "test": "npm run test:unit && npm run test:build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/retry.git" + }, + "keywords": [ + "nodejs", + "retry", + "async", + "promises" + ], + "author": "Nicholas C. Zaks", + "license": "Apache-2.0", + "devDependencies": { + "@eslint/js": "^8.49.0", + "@rollup/plugin-terser": "0.4.4", + "@tsconfig/node16": "^16.1.1", + "@types/mocha": "^10.0.3", + "@types/node": "20.12.6", + "eslint": "^8.21.0", + "lint-staged": "15.2.1", + "mocha": "^10.3.0", + "rollup": "3.29.4", + "typescript": "5.4.4", + "yorkie": "2.0.0" + } +} diff --git a/node_modules/@humanfs/node/package.json b/node_modules/@humanfs/node/package.json new file mode 100644 index 0000000..5b303fa --- /dev/null +++ b/node_modules/@humanfs/node/package.json @@ -0,0 +1,57 @@ +{ + "name": "@humanfs/node", + "version": "0.16.6", + "description": "The Node.js bindings of the humanfs library.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "import": { + "types": "./dist/index.d.ts", + "default": "./src/index.js" + } + }, + "files": [ + "dist", + "src" + ], + "scripts": { + "build": "tsc", + "prepare": "npm run build", + "pretest": "npm run build", + "test": "mocha ./tests/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/humanfs.git" + }, + "publishConfig": { + "access": "public" + }, + "keywords": [ + "filesystem", + "fs", + "hfs", + "files" + ], + "author": "Nicholas C. Zakas", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/humanwhocodes/humanfs/issues" + }, + "homepage": "https://github.com/humanwhocodes/humanfs#readme", + "engines": { + "node": ">=18.18.0" + }, + "devDependencies": { + "@types/node": "^20.9.4", + "@humanfs/test": "^0.15.0", + "@humanfs/types": "^0.15.0", + "mocha": "^10.2.0", + "typescript": "^5.2.2" + }, + "dependencies": { + "@humanwhocodes/retry": "^0.3.0", + "@humanfs/core": "^0.19.1" + } +} diff --git a/node_modules/@humanfs/node/src/index.js b/node_modules/@humanfs/node/src/index.js new file mode 100644 index 0000000..6d551aa --- /dev/null +++ b/node_modules/@humanfs/node/src/index.js @@ -0,0 +1,7 @@ +/** + * @fileoverview This file exports everything for this package. + * @author Nicholas C. Zakas + */ + +export * from "./node-hfs.js"; +export { Hfs } from "@humanfs/core"; diff --git a/node_modules/@humanfs/node/src/node-hfs.js b/node_modules/@humanfs/node/src/node-hfs.js new file mode 100644 index 0000000..7840c87 --- /dev/null +++ b/node_modules/@humanfs/node/src/node-hfs.js @@ -0,0 +1,452 @@ +/** + * @fileoverview The main file for the hfs package. + * @author Nicholas C. Zakas + */ +/* global Buffer:readonly, URL */ + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** @typedef {import("@humanfs/types").HfsImpl} HfsImpl */ +/** @typedef {import("@humanfs/types").HfsDirectoryEntry} HfsDirectoryEntry */ +/** @typedef {import("node:fs/promises")} Fsp */ +/** @typedef {import("fs").Dirent} Dirent */ + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +import { Hfs } from "@humanfs/core"; +import path from "node:path"; +import { Retrier } from "@humanwhocodes/retry"; +import nativeFsp from "node:fs/promises"; +import { fileURLToPath } from "node:url"; + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const RETRY_ERROR_CODES = new Set(["ENFILE", "EMFILE"]); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * A class representing a directory entry. + * @implements {HfsDirectoryEntry} + */ +class NodeHfsDirectoryEntry { + /** + * The name of the directory entry. + * @type {string} + */ + name; + + /** + * True if the entry is a file. + * @type {boolean} + */ + isFile; + + /** + * True if the entry is a directory. + * @type {boolean} + */ + isDirectory; + + /** + * True if the entry is a symbolic link. + * @type {boolean} + */ + isSymlink; + + /** + * Creates a new instance. + * @param {Dirent} dirent The directory entry to wrap. + */ + constructor(dirent) { + this.name = dirent.name; + this.isFile = dirent.isFile(); + this.isDirectory = dirent.isDirectory(); + this.isSymlink = dirent.isSymbolicLink(); + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class representing the Node.js implementation of Hfs. + * @implements {HfsImpl} + */ +export class NodeHfsImpl { + /** + * The file system module to use. + * @type {Fsp} + */ + #fsp; + + /** + * The retryer object used for retrying operations. + * @type {Retrier} + */ + #retrier; + + /** + * Creates a new instance. + * @param {object} [options] The options for the instance. + * @param {Fsp} [options.fsp] The file system module to use. + */ + constructor({ fsp = nativeFsp } = {}) { + this.#fsp = fsp; + this.#retrier = new Retrier(error => RETRY_ERROR_CODES.has(error.code)); + } + + /** + * Reads a file and returns the contents as an Uint8Array. + * @param {string|URL} filePath The path to the file to read. + * @returns {Promise} A promise that resolves with the contents + * of the file or undefined if the file doesn't exist. + * @throws {Error} If the file cannot be read. + * @throws {TypeError} If the file path is not a string. + */ + bytes(filePath) { + return this.#retrier + .retry(() => this.#fsp.readFile(filePath)) + .then(buffer => new Uint8Array(buffer.buffer)) + .catch(error => { + if (error.code === "ENOENT") { + return undefined; + } + + throw error; + }); + } + + /** + * Writes a value to a file. If the value is a string, UTF-8 encoding is used. + * @param {string|URL} filePath The path to the file to write. + * @param {Uint8Array} contents The contents to write to the + * file. + * @returns {Promise} A promise that resolves when the file is + * written. + * @throws {TypeError} If the file path is not a string. + * @throws {Error} If the file cannot be written. + */ + async write(filePath, contents) { + const value = Buffer.from(contents); + + return this.#retrier + .retry(() => this.#fsp.writeFile(filePath, value)) + .catch(error => { + // the directory may not exist, so create it + if (error.code === "ENOENT") { + const dirPath = path.dirname( + filePath instanceof URL + ? fileURLToPath(filePath) + : filePath, + ); + + return this.#fsp + .mkdir(dirPath, { recursive: true }) + .then(() => this.#fsp.writeFile(filePath, value)); + } + + throw error; + }); + } + + /** + * Appends a value to a file. If the value is a string, UTF-8 encoding is used. + * @param {string|URL} filePath The path to the file to append to. + * @param {Uint8Array} contents The contents to append to the + * file. + * @returns {Promise} A promise that resolves when the file is + * written. + * @throws {TypeError} If the file path is not a string. + * @throws {Error} If the file cannot be appended to. + */ + async append(filePath, contents) { + const value = Buffer.from(contents); + + return this.#retrier + .retry(() => this.#fsp.appendFile(filePath, value)) + .catch(error => { + // the directory may not exist, so create it + if (error.code === "ENOENT") { + const dirPath = path.dirname( + filePath instanceof URL + ? fileURLToPath(filePath) + : filePath, + ); + + return this.#fsp + .mkdir(dirPath, { recursive: true }) + .then(() => this.#fsp.appendFile(filePath, value)); + } + + throw error; + }); + } + + /** + * Checks if a file exists. + * @param {string|URL} filePath The path to the file to check. + * @returns {Promise} A promise that resolves with true if the + * file exists or false if it does not. + * @throws {Error} If the operation fails with a code other than ENOENT. + */ + isFile(filePath) { + return this.#fsp + .stat(filePath) + .then(stat => stat.isFile()) + .catch(error => { + if (error.code === "ENOENT") { + return false; + } + + throw error; + }); + } + + /** + * Checks if a directory exists. + * @param {string|URL} dirPath The path to the directory to check. + * @returns {Promise} A promise that resolves with true if the + * directory exists or false if it does not. + * @throws {Error} If the operation fails with a code other than ENOENT. + */ + isDirectory(dirPath) { + return this.#fsp + .stat(dirPath) + .then(stat => stat.isDirectory()) + .catch(error => { + if (error.code === "ENOENT") { + return false; + } + + throw error; + }); + } + + /** + * Creates a directory recursively. + * @param {string|URL} dirPath The path to the directory to create. + * @returns {Promise} A promise that resolves when the directory is + * created. + */ + async createDirectory(dirPath) { + await this.#fsp.mkdir(dirPath, { recursive: true }); + } + + /** + * Deletes a file or empty directory. + * @param {string|URL} fileOrDirPath The path to the file or directory to + * delete. + * @returns {Promise} A promise that resolves when the file or + * directory is deleted, true if the file or directory is deleted, false + * if the file or directory does not exist. + * @throws {TypeError} If the file or directory path is not a string. + * @throws {Error} If the file or directory cannot be deleted. + */ + delete(fileOrDirPath) { + return this.#fsp + .rm(fileOrDirPath) + .then(() => true) + .catch(error => { + if (error.code === "ERR_FS_EISDIR") { + return this.#fsp.rmdir(fileOrDirPath).then(() => true); + } + + if (error.code === "ENOENT") { + return false; + } + + throw error; + }); + } + + /** + * Deletes a file or directory recursively. + * @param {string|URL} fileOrDirPath The path to the file or directory to + * delete. + * @returns {Promise} A promise that resolves when the file or + * directory is deleted, true if the file or directory is deleted, false + * if the file or directory does not exist. + * @throws {TypeError} If the file or directory path is not a string. + * @throws {Error} If the file or directory cannot be deleted. + */ + deleteAll(fileOrDirPath) { + return this.#fsp + .rm(fileOrDirPath, { recursive: true }) + .then(() => true) + .catch(error => { + if (error.code === "ENOENT") { + return false; + } + + throw error; + }); + } + + /** + * Returns a list of directory entries for the given path. + * @param {string|URL} dirPath The path to the directory to read. + * @returns {AsyncIterable} A promise that resolves with the + * directory entries. + * @throws {TypeError} If the directory path is not a string. + * @throws {Error} If the directory cannot be read. + */ + async *list(dirPath) { + const entries = await this.#fsp.readdir(dirPath, { + withFileTypes: true, + }); + + for (const entry of entries) { + yield new NodeHfsDirectoryEntry(entry); + } + } + + /** + * Returns the size of a file. This method handles ENOENT errors + * and returns undefined in that case. + * @param {string|URL} filePath The path to the file to read. + * @returns {Promise} A promise that resolves with the size of the + * file in bytes or undefined if the file doesn't exist. + */ + size(filePath) { + return this.#fsp + .stat(filePath) + .then(stat => stat.size) + .catch(error => { + if (error.code === "ENOENT") { + return undefined; + } + + throw error; + }); + } + + /** + * Returns the last modified date of a file or directory. This method handles ENOENT errors + * and returns undefined in that case. + * @param {string|URL} fileOrDirPath The path to the file to read. + * @returns {Promise} A promise that resolves with the last modified + * date of the file or directory, or undefined if the file doesn't exist. + */ + lastModified(fileOrDirPath) { + return this.#fsp + .stat(fileOrDirPath) + .then(stat => stat.mtime) + .catch(error => { + if (error.code === "ENOENT") { + return undefined; + } + + throw error; + }); + } + + /** + * Copies a file from one location to another. + * @param {string|URL} source The path to the file to copy. + * @param {string|URL} destination The path to copy the file to. + * @returns {Promise} A promise that resolves when the file is copied. + * @throws {Error} If the source file does not exist. + * @throws {Error} If the source file is a directory. + * @throws {Error} If the destination file is a directory. + */ + copy(source, destination) { + return this.#fsp.copyFile(source, destination); + } + + /** + * Copies a file or directory from one location to another. + * @param {string|URL} source The path to the file or directory to copy. + * @param {string|URL} destination The path to copy the file or directory to. + * @returns {Promise} A promise that resolves when the file or directory is + * copied. + * @throws {Error} If the source file or directory does not exist. + * @throws {Error} If the destination file or directory is a directory. + */ + async copyAll(source, destination) { + // for files use copy() and exit + if (await this.isFile(source)) { + return this.copy(source, destination); + } + + const sourceStr = + source instanceof URL ? fileURLToPath(source) : source; + + const destinationStr = + destination instanceof URL + ? fileURLToPath(destination) + : destination; + + // for directories, create the destination directory and copy each entry + await this.createDirectory(destination); + + for await (const entry of this.list(source)) { + const fromEntryPath = path.join(sourceStr, entry.name); + const toEntryPath = path.join(destinationStr, entry.name); + + if (entry.isDirectory) { + await this.copyAll(fromEntryPath, toEntryPath); + } else { + await this.copy(fromEntryPath, toEntryPath); + } + } + } + + /** + * Moves a file from the source path to the destination path. + * @param {string|URL} source The location of the file to move. + * @param {string|URL} destination The destination of the file to move. + * @returns {Promise} A promise that resolves when the move is complete. + * @throws {TypeError} If the file paths are not strings. + * @throws {Error} If the file cannot be moved. + */ + move(source, destination) { + return this.#fsp.stat(source).then(stat => { + if (stat.isDirectory()) { + throw new Error( + `EISDIR: illegal operation on a directory, move '${source}' -> '${destination}'`, + ); + } + + return this.#fsp.rename(source, destination); + }); + } + + /** + * Moves a file or directory from the source path to the destination path. + * @param {string|URL} source The location of the file or directory to move. + * @param {string|URL} destination The destination of the file or directory to move. + * @returns {Promise} A promise that resolves when the move is complete. + * @throws {TypeError} If the file paths are not strings. + * @throws {Error} If the file or directory cannot be moved. + */ + async moveAll(source, destination) { + return this.#fsp.rename(source, destination); + } +} + +/** + * A class representing a file system utility library. + * @implements {HfsImpl} + */ +export class NodeHfs extends Hfs { + /** + * Creates a new instance. + * @param {object} [options] The options for the instance. + * @param {Fsp} [options.fsp] The file system module to use. + */ + constructor({ fsp } = {}) { + super({ impl: new NodeHfsImpl({ fsp }) }); + } +} + +export const hfs = new NodeHfs(); diff --git a/node_modules/@humanwhocodes/module-importer/CHANGELOG.md b/node_modules/@humanwhocodes/module-importer/CHANGELOG.md new file mode 100644 index 0000000..1b442a1 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## [1.0.1](https://github.com/humanwhocodes/module-importer/compare/v1.0.0...v1.0.1) (2022-08-18) + + +### Bug Fixes + +* Ensure CommonJS mode works correctly. ([cf54a0b](https://github.com/humanwhocodes/module-importer/commit/cf54a0b998085066fbe1776dd0b4cacd808cc192)), closes [#6](https://github.com/humanwhocodes/module-importer/issues/6) + +## 1.0.0 (2022-08-17) + + +### Features + +* Implement ModuleImporter ([3ce4e82](https://www.github.com/humanwhocodes/module-importer/commit/3ce4e820c30c114e787bfed00a0966ac4772f563)) diff --git a/node_modules/@humanwhocodes/module-importer/LICENSE b/node_modules/@humanwhocodes/module-importer/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@humanwhocodes/module-importer/README.md b/node_modules/@humanwhocodes/module-importer/README.md new file mode 100644 index 0000000..3de07a7 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/README.md @@ -0,0 +1,80 @@ +# ModuleImporter + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). + +## Description + +A utility for seamlessly importing modules in Node.js regardless if they are CommonJS or ESM format. Under the hood, this uses `import()` and relies on Node.js's CommonJS compatibility to work correctly. This ensures that the correct locations and formats are used for CommonJS so you can call one method and not worry about any compatibility issues. + +The problem with the default `import()` is that it always resolves relative to the file location in which it is called. If you want to resolve from a different location, you need to jump through a few hoops to achieve that. This package makes it easy to both resolve and import modules from any directory. + +## Usage + +### Node.js + +Install using [npm][npm] or [yarn][yarn]: + +``` +npm install @humanwhocodes/module-importer + +# or + +yarn add @humanwhocodes/module-importer +``` + +Import into your Node.js project: + +```js +// CommonJS +const { ModuleImporter } = require("@humanwhocodes/module-importer"); + +// ESM +import { ModuleImporter } from "@humanwhocodes/module-importer"; +``` + +### Bun + +Install using this command: + +``` +bun add @humanwhocodes/module-importer +``` + +Import into your Bun project: + +```js +import { ModuleImporter } from "@humanwhocodes/module-importer"; +``` + +## API + +After importing, create a new instance of `ModuleImporter` to start emitting events: + +```js +// cwd can be omitted to use process.cwd() +const importer = new ModuleImporter(cwd); + +// you can resolve the location of any package +const location = importer.resolve("./some-file.cjs"); + +// you can also import directly +const module = importer.import("./some-file.cjs"); +``` + +For both `resolve()` and `import()`, you can pass in package names and filenames. + +## Developer Setup + +1. Fork the repository +2. Clone your fork +3. Run `npm install` to setup dependencies +4. Run `npm test` to run tests + +## License + +Apache 2.0 + +[npm]: https://npmjs.com/ +[yarn]: https://yarnpkg.com/ diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs b/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs new file mode 100644 index 0000000..779e0cf --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs @@ -0,0 +1,22 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var module$1 = require('module'); +var url = require('url'); +var path = require('path'); + +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('module-importer.cjs', document.baseURI).href))); +const __dirname$1 = path.dirname(__filename$1); +const require$1 = module$1.createRequire(__dirname$1 + "/"); +const { ModuleImporter } = require$1("./module-importer.cjs"); + +exports.ModuleImporter = ModuleImporter; diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts new file mode 100644 index 0000000..a1acbb6 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts @@ -0,0 +1,27 @@ +export class ModuleImporter { + /** + * Creates a new instance. + * @param {string} [cwd] The current working directory to resolve from. + */ + constructor(cwd?: string); + /** + * The base directory from which paths should be resolved. + * @type {string} + */ + cwd: string; + /** + * Resolves a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {string|undefined} The location of the import. + * @throws {Error} If specifier cannot be located. + */ + resolve(specifier: string): string | undefined; + /** + * Imports a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {Promise} The module's object. + */ + import(specifier: string): Promise; +} diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.js b/node_modules/@humanwhocodes/module-importer/dist/module-importer.js new file mode 100644 index 0000000..26e052d --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.js @@ -0,0 +1,18 @@ +import { createRequire } from 'module'; +import { fileURLToPath } from 'url'; +import { dirname } from 'path'; + +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const require = createRequire(__dirname + "/"); +const { ModuleImporter } = require("./module-importer.cjs"); + +export { ModuleImporter }; diff --git a/node_modules/@humanwhocodes/module-importer/package.json b/node_modules/@humanwhocodes/module-importer/package.json new file mode 100644 index 0000000..8ece071 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/package.json @@ -0,0 +1,65 @@ +{ + "name": "@humanwhocodes/module-importer", + "version": "1.0.1", + "description": "Universal module importer for Node.js", + "main": "src/module-importer.cjs", + "module": "src/module-importer.js", + "type": "module", + "types": "dist/module-importer.d.ts", + "exports": { + "require": "./src/module-importer.cjs", + "import": "./src/module-importer.js" + }, + "files": [ + "dist", + "src" + ], + "publishConfig": { + "access": "public" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "eslint --fix" + ] + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + }, + "scripts": { + "build": "rollup -c && tsc", + "prepare": "npm run build", + "lint": "eslint src/ tests/", + "test:unit": "c8 mocha tests/module-importer.test.js", + "test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs", + "test": "npm run test:unit && npm run test:build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/module-importer.git" + }, + "keywords": [ + "modules", + "esm", + "commonjs" + ], + "engines": { + "node": ">=12.22" + }, + "author": "Nicholas C. Zaks", + "license": "Apache-2.0", + "devDependencies": { + "@types/node": "^18.7.6", + "c8": "7.12.0", + "chai": "4.3.6", + "eslint": "8.22.0", + "lint-staged": "13.0.3", + "mocha": "9.2.2", + "rollup": "2.78.0", + "typescript": "4.7.4", + "yorkie": "2.0.0" + } +} diff --git a/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs b/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs new file mode 100644 index 0000000..3efb095 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs @@ -0,0 +1,81 @@ +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +const { createRequire } = require("module"); +const { pathToFileURL } = require("url"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const SLASHES = new Set(["/", "\\"]); + +/** + * Normalizes directories to have a trailing slash. + * Resolve is pretty finicky -- if the directory name doesn't have + * a trailing slash then it tries to look in the parent directory. + * i.e., if the directory is "/usr/nzakas/foo" it will start the + * search in /usr/nzakas. However, if the directory is "/user/nzakas/foo/", + * then it will start the search in /user/nzakas/foo. + * @param {string} directory The directory to check. + * @returns {string} The normalized directory. + */ +function normalizeDirectory(directory) { + if (!SLASHES.has(directory[directory.length-1])) { + return directory + "/"; + } + + return directory; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Class for importing both CommonJS and ESM modules in Node.js. + */ +exports.ModuleImporter = class ModuleImporter { + + /** + * Creates a new instance. + * @param {string} [cwd] The current working directory to resolve from. + */ + constructor(cwd = process.cwd()) { + + /** + * The base directory from which paths should be resolved. + * @type {string} + */ + this.cwd = normalizeDirectory(cwd); + } + + /** + * Resolves a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {string|undefined} The location of the import. + * @throws {Error} If specifier cannot be located. + */ + resolve(specifier) { + const require = createRequire(this.cwd); + return require.resolve(specifier); + } + + /** + * Imports a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {Promise} The module's object. + */ + import(specifier) { + const location = this.resolve(specifier); + return import(pathToFileURL(location).href); + } + +} diff --git a/node_modules/@humanwhocodes/module-importer/src/module-importer.js b/node_modules/@humanwhocodes/module-importer/src/module-importer.js new file mode 100644 index 0000000..f5464e1 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/src/module-importer.js @@ -0,0 +1,22 @@ +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +import { createRequire } from "module"; +import { fileURLToPath } from "url"; +import { dirname } from "path"; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const require = createRequire(__dirname + "/"); +const { ModuleImporter } = require("./module-importer.cjs"); + +export { ModuleImporter }; diff --git a/node_modules/@humanwhocodes/retry/LICENSE b/node_modules/@humanwhocodes/retry/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@humanwhocodes/retry/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@humanwhocodes/retry/README.md b/node_modules/@humanwhocodes/retry/README.md new file mode 100644 index 0000000..0ec7a47 --- /dev/null +++ b/node_modules/@humanwhocodes/retry/README.md @@ -0,0 +1,177 @@ +# Retry utility + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star. + +## Description + +A utility for retrying failed async JavaScript calls based on the error returned. + +## Usage + +### Node.js + +Install using [npm][npm] or [yarn][yarn]: + +``` +npm install @humanwhocodes/retry + +# or + +yarn add @humanwhocodes/retry +``` + +Import into your Node.js project: + +```js +// CommonJS +const { Retrier } = require("@humanwhocodes/retry"); + +// ESM +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Deno + +Install using [JSR](https://jsr.io): + +```shell +deno add @humanwhocodes/retry + +#or + +jsr add @humanwhocodes/retry +``` + +Then import into your Deno project: + +```js +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Bun + +Install using this command: + +``` +bun add @humanwhocodes/retry +``` + +Import into your Bun project: + +```js +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Browser + +It's recommended to import the minified version to save bandwidth: + +```js +import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry?min"; +``` + +However, you can also import the unminified version for debugging purposes: + +```js +import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry"; +``` + +## API + +After importing, create a new instance of `Retrier` and specify the function to run on the error. This function should return `true` if you want the call retried and `false` if not. + +```js +// this instance will retry if the specific error code is found +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); +``` + +Then, call the `retry()` method around the function you'd like to retry, such as: + +```js +import fs from "fs/promises"; + +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); + +const text = await retrier.retry(() => fs.readFile("README.md", "utf8")); +``` + +The `retry()` method will either pass through the result on success or wait and retry on failure. Any error that isn't caught by the retrier is automatically rejected so the end result is a transparent passing through of both success and failure. + +### Setting a Timeout + +You can control how long a task will attempt to retry before giving up by passing the `timeout` option to the `Retrier` constructor. By default, the timeout is one minute. + +```js +import fs from "fs/promises"; + +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}, { timeout: 100_000 }); + +const text = await retrier.retry(() => fs.readFile("README.md", "utf8")); +``` + +When a call times out, it rejects the first error that was received from calling the function. + +### Setting a Concurrency Limit + +When processing a large number of function calls, you can limit the number of concurrent function calls by passing the `concurrency` option to the `Retrier` constructor. By default, `concurrency` is 1000. + +```js +import fs from "fs/promises"; + +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}, { concurrency: 100 }); + +const filenames = getFilenames(); +const contents = await Promise.all( + filenames.map(filename => retrier.retry(() => fs.readFile(filename, "utf8")) +); +``` + +### Aborting with `AbortSignal` + +You can also pass an `AbortSignal` to cancel a retry: + +```js +import fs from "fs/promises"; + +const controller = new AbortController(); +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); + +const text = await retrier.retry( + () => fs.readFile("README.md", "utf8"), + { signal: controller.signal } +); +``` + +## Developer Setup + +1. Fork the repository +2. Clone your fork +3. Run `npm install` to setup dependencies +4. Run `npm test` to run tests + +### Debug Output + +Enable debugging output by setting the `DEBUG` environment variable to `"@hwc/retry"` before running. + +## License + +Apache 2.0 + +## Prior Art + +This utility is inspired by, and contains code from [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). + +[npm]: https://npmjs.com/ +[yarn]: https://yarnpkg.com/ diff --git a/node_modules/@humanwhocodes/retry/dist/retrier.cjs b/node_modules/@humanwhocodes/retry/dist/retrier.cjs new file mode 100644 index 0000000..33f7fbe --- /dev/null +++ b/node_modules/@humanwhocodes/retry/dist/retrier.cjs @@ -0,0 +1,477 @@ +'use strict'; + +/** + * @fileoverview A utility for retrying failed async method calls. + */ + +/* global setTimeout, clearTimeout */ + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const MAX_TASK_TIMEOUT = 60000; +const MAX_TASK_DELAY = 100; +const MAX_CONCURRENCY = 1000; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Logs a message to the console if the DEBUG environment variable is set. + * @param {string} message The message to log. + * @returns {void} + */ +function debug(message) { + if (globalThis?.process?.env.DEBUG === "@hwc/retry") { + console.debug(message); + } +} + +/* + * The following logic has been extracted from graceful-fs. + * + * The ISC License + * + * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * Checks if it is time to retry a task based on the timestamp and last attempt time. + * @param {RetryTask} task The task to check. + * @param {number} maxDelay The maximum delay for the queue. + * @returns {boolean} true if it is time to retry, false otherwise. + */ +function isTimeToRetry(task, maxDelay) { + const timeSinceLastAttempt = Date.now() - task.lastAttempt; + const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1); + const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay); + + return timeSinceLastAttempt >= desiredDelay; +} + +/** + * Checks if it is time to bail out based on the given timestamp. + * @param {RetryTask} task The task to check. + * @param {number} timeout The timeout for the queue. + * @returns {boolean} true if it is time to bail, false otherwise. + */ +function isTimeToBail(task, timeout) { + return task.age > timeout; +} + +/** + * Creates a new promise with resolve and reject functions. + * @returns {{promise:Promise, resolve:(value:any) => any, reject: (value:any) => any}} A new promise. + */ +function createPromise() { + if (Promise.withResolvers) { + return Promise.withResolvers(); + } + + let resolve, reject; + + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + + if (resolve === undefined || reject === undefined) { + throw new Error("Promise executor did not initialize resolve or reject."); + } + + return { promise, resolve, reject }; +} + + +/** + * A class to represent a task in the retry queue. + */ +class RetryTask { + + /** + * The unique ID for the task. + * @type {string} + */ + id = Math.random().toString(36).slice(2); + + /** + * The function to call. + * @type {Function} + */ + fn; + + /** + * The error that was thrown. + * @type {Error} + */ + error; + + /** + * The timestamp of the task. + * @type {number} + */ + timestamp = Date.now(); + + /** + * The timestamp of the last attempt. + * @type {number} + */ + lastAttempt = this.timestamp; + + /** + * The resolve function for the promise. + * @type {Function} + */ + resolve; + + /** + * The reject function for the promise. + * @type {Function} + */ + reject; + + /** + * The AbortSignal to monitor for cancellation. + * @type {AbortSignal|undefined} + */ + signal; + + /** + * Creates a new instance. + * @param {Function} fn The function to call. + * @param {Error} error The error that was thrown. + * @param {Function} resolve The resolve function for the promise. + * @param {Function} reject The reject function for the promise. + * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation. + */ + constructor(fn, error, resolve, reject, signal) { + this.fn = fn; + this.error = error; + this.timestamp = Date.now(); + this.lastAttempt = Date.now(); + this.resolve = resolve; + this.reject = reject; + this.signal = signal; + } + + /** + * Gets the age of the task. + * @returns {number} The age of the task in milliseconds. + * @readonly + */ + get age() { + return Date.now() - this.timestamp; + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class that manages a queue of retry jobs. + */ +class Retrier { + + /** + * Represents the queue for processing tasks. + * @type {Array} + */ + #retrying = []; + + /** + * Represents the queue for pending tasks. + * @type {Array} + */ + #pending = []; + + /** + * The number of tasks currently being processed. + * @type {number} + */ + #working = 0; + + /** + * The timeout for the queue. + * @type {number} + */ + #timeout; + + /** + * The maximum delay for the queue. + * @type {number} + */ + #maxDelay; + + /** + * The setTimeout() timer ID. + * @type {NodeJS.Timeout|undefined} + */ + #timerId; + + /** + * The function to call. + * @type {Function} + */ + #check; + + /** + * The maximum number of concurrent tasks. + * @type {number} + */ + #concurrency; + + /** + * Creates a new instance. + * @param {Function} check The function to call. + * @param {object} [options] The options for the instance. + * @param {number} [options.timeout] The timeout for the queue. + * @param {number} [options.maxDelay] The maximum delay for the queue. + * @param {number} [options.concurrency] The maximum number of concurrent tasks. + */ + constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY, concurrency = MAX_CONCURRENCY } = {}) { + + if (typeof check !== "function") { + throw new Error("Missing function to check errors"); + } + + this.#check = check; + this.#timeout = timeout; + this.#maxDelay = maxDelay; + this.#concurrency = concurrency; + } + + /** + * Gets the number of tasks waiting to be retried. + * @returns {number} The number of tasks in the retry queue. + */ + get retrying() { + return this.#retrying.length; + } + + /** + * Gets the number of tasks waiting to be processed in the pending queue. + * @returns {number} The number of tasks in the pending queue. + */ + get pending() { + return this.#pending.length; + } + + /** + * Gets the number of tasks currently being processed. + * @returns {number} The number of tasks currently being processed. + */ + get working() { + return this.#working; + } + + /** + * Calls the function and retries if it fails. + * @param {Function} fn The function to call. + * @param {Object} options The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @param {Promise} options.promise The promise to return when the function settles. + * @param {Function} options.resolve The resolve function for the promise. + * @param {Function} options.reject The reject function for the promise. + * @returns {Promise} A promise that resolves when the function is + * called successfully. + */ + #call(fn, { signal, promise, resolve, reject }) { + + let result; + + try { + result = fn(); + } catch (/** @type {any} */ error) { + reject(new Error(`Synchronous error: ${error.message}`, { cause: error })); + return promise; + } + + // if the result is not a promise then reject an error + if (!result || typeof result.then !== "function") { + reject(new Error("Result is not a promise.")); + return promise; + } + + this.#working++; + promise.finally(() => { + this.#working--; + this.#processPending(); + }) + // `promise.finally` creates a new promise that may be rejected, so it must be handled. + .catch(() => { }); + + // call the original function and catch any ENFILE or EMFILE errors + Promise.resolve(result) + .then(value => { + debug("Function called successfully without retry."); + resolve(value); + }) + .catch(error => { + if (!this.#check(error)) { + reject(error); + return; + } + + const task = new RetryTask(fn, error, resolve, reject, signal); + + debug(`Function failed, queuing for retry with task ${task.id}.`); + this.#retrying.push(task); + + signal?.addEventListener("abort", () => { + debug(`Task ${task.id} was aborted due to AbortSignal.`); + reject(signal.reason); + }); + + this.#processQueue(); + }); + + return promise; + } + + /** + * Adds a new retry job to the queue. + * @param {Function} fn The function to call. + * @param {object} [options] The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @returns {Promise} A promise that resolves when the queue is + * processed. + */ + retry(fn, { signal } = {}) { + + signal?.throwIfAborted(); + + const { promise, resolve, reject } = createPromise(); + + this.#pending.push(() => this.#call(fn, { signal, promise, resolve, reject })); + this.#processPending(); + + return promise; + } + + + /** + * Processes the pending queue and the retry queue. + * @returns {void} + */ + #processAll() { + if (this.pending) { + this.#processPending(); + } + + if (this.retrying) { + this.#processQueue(); + } + } + + /** + * Processes the pending queue to see which tasks can be started. + * @returns {void} + */ + #processPending() { + + debug(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`); + + const available = this.#concurrency - this.working; + + if (available <= 0) { + return; + } + + const count = Math.min(this.pending, available); + + for (let i = 0; i < count; i++) { + const task = this.#pending.shift(); + task?.(); + } + + debug(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`); + } + + /** + * Processes the queue. + * @returns {void} + */ + #processQueue() { + // clear any timer because we're going to check right now + clearTimeout(this.#timerId); + this.#timerId = undefined; + + debug(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`); + + const processAgain = () => { + this.#timerId = setTimeout(() => this.#processAll(), 0); + }; + + // if there's nothing in the queue, we're done + const task = this.#retrying.shift(); + if (!task) { + debug("Queue is empty, exiting."); + + if (this.pending) { + processAgain(); + } + return; + } + + // if it's time to bail, then bail + if (isTimeToBail(task, this.#timeout)) { + debug(`Task ${task.id} was abandoned due to timeout.`); + task.reject(task.error); + processAgain(); + return; + } + + // if it's not time to retry, then wait and try again + if (!isTimeToRetry(task, this.#maxDelay)) { + debug(`Task ${task.id} is not ready to retry, skipping.`); + this.#retrying.push(task); + processAgain(); + return; + } + + // otherwise, try again + task.lastAttempt = Date.now(); + + // Promise.resolve needed in case it's a thenable but not a Promise + Promise.resolve(task.fn()) + // @ts-ignore because we know it's any + .then(result => { + debug(`Task ${task.id} succeeded after ${task.age}ms.`); + task.resolve(result); + }) + + // @ts-ignore because we know it's any + .catch(error => { + if (!this.#check(error)) { + debug(`Task ${task.id} failed with non-retryable error: ${error.message}.`); + task.reject(error); + return; + } + + // update the task timestamp and push to back of queue to try again + task.lastAttempt = Date.now(); + this.#retrying.push(task); + debug(`Task ${task.id} failed, requeueing to try again.`); + }) + .finally(() => { + this.#processAll(); + }); + } +} + +exports.Retrier = Retrier; diff --git a/node_modules/@humanwhocodes/retry/dist/retrier.d.cts b/node_modules/@humanwhocodes/retry/dist/retrier.d.cts new file mode 100644 index 0000000..4b60d6f --- /dev/null +++ b/node_modules/@humanwhocodes/retry/dist/retrier.d.cts @@ -0,0 +1,45 @@ +/** + * A class that manages a queue of retry jobs. + */ +export class Retrier { + /** + * Creates a new instance. + * @param {Function} check The function to call. + * @param {object} [options] The options for the instance. + * @param {number} [options.timeout] The timeout for the queue. + * @param {number} [options.maxDelay] The maximum delay for the queue. + * @param {number} [options.concurrency] The maximum number of concurrent tasks. + */ + constructor(check: Function, { timeout, maxDelay, concurrency }?: { + timeout?: number | undefined; + maxDelay?: number | undefined; + concurrency?: number | undefined; + } | undefined); + /** + * Gets the number of tasks waiting to be retried. + * @returns {number} The number of tasks in the retry queue. + */ + get retrying(): number; + /** + * Gets the number of tasks waiting to be processed in the pending queue. + * @returns {number} The number of tasks in the pending queue. + */ + get pending(): number; + /** + * Gets the number of tasks currently being processed. + * @returns {number} The number of tasks currently being processed. + */ + get working(): number; + /** + * Adds a new retry job to the queue. + * @param {Function} fn The function to call. + * @param {object} [options] The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @returns {Promise} A promise that resolves when the queue is + * processed. + */ + retry(fn: Function, { signal }?: { + signal?: AbortSignal | undefined; + } | undefined): Promise; + #private; +} diff --git a/node_modules/@humanwhocodes/retry/dist/retrier.js b/node_modules/@humanwhocodes/retry/dist/retrier.js new file mode 100644 index 0000000..f1a8c87 --- /dev/null +++ b/node_modules/@humanwhocodes/retry/dist/retrier.js @@ -0,0 +1,476 @@ +// @ts-self-types="./retrier.d.ts" +/** + * @fileoverview A utility for retrying failed async method calls. + */ + +/* global setTimeout, clearTimeout */ + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const MAX_TASK_TIMEOUT = 60000; +const MAX_TASK_DELAY = 100; +const MAX_CONCURRENCY = 1000; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Logs a message to the console if the DEBUG environment variable is set. + * @param {string} message The message to log. + * @returns {void} + */ +function debug(message) { + if (globalThis?.process?.env.DEBUG === "@hwc/retry") { + console.debug(message); + } +} + +/* + * The following logic has been extracted from graceful-fs. + * + * The ISC License + * + * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * Checks if it is time to retry a task based on the timestamp and last attempt time. + * @param {RetryTask} task The task to check. + * @param {number} maxDelay The maximum delay for the queue. + * @returns {boolean} true if it is time to retry, false otherwise. + */ +function isTimeToRetry(task, maxDelay) { + const timeSinceLastAttempt = Date.now() - task.lastAttempt; + const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1); + const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay); + + return timeSinceLastAttempt >= desiredDelay; +} + +/** + * Checks if it is time to bail out based on the given timestamp. + * @param {RetryTask} task The task to check. + * @param {number} timeout The timeout for the queue. + * @returns {boolean} true if it is time to bail, false otherwise. + */ +function isTimeToBail(task, timeout) { + return task.age > timeout; +} + +/** + * Creates a new promise with resolve and reject functions. + * @returns {{promise:Promise, resolve:(value:any) => any, reject: (value:any) => any}} A new promise. + */ +function createPromise() { + if (Promise.withResolvers) { + return Promise.withResolvers(); + } + + let resolve, reject; + + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + + if (resolve === undefined || reject === undefined) { + throw new Error("Promise executor did not initialize resolve or reject."); + } + + return { promise, resolve, reject }; +} + + +/** + * A class to represent a task in the retry queue. + */ +class RetryTask { + + /** + * The unique ID for the task. + * @type {string} + */ + id = Math.random().toString(36).slice(2); + + /** + * The function to call. + * @type {Function} + */ + fn; + + /** + * The error that was thrown. + * @type {Error} + */ + error; + + /** + * The timestamp of the task. + * @type {number} + */ + timestamp = Date.now(); + + /** + * The timestamp of the last attempt. + * @type {number} + */ + lastAttempt = this.timestamp; + + /** + * The resolve function for the promise. + * @type {Function} + */ + resolve; + + /** + * The reject function for the promise. + * @type {Function} + */ + reject; + + /** + * The AbortSignal to monitor for cancellation. + * @type {AbortSignal|undefined} + */ + signal; + + /** + * Creates a new instance. + * @param {Function} fn The function to call. + * @param {Error} error The error that was thrown. + * @param {Function} resolve The resolve function for the promise. + * @param {Function} reject The reject function for the promise. + * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation. + */ + constructor(fn, error, resolve, reject, signal) { + this.fn = fn; + this.error = error; + this.timestamp = Date.now(); + this.lastAttempt = Date.now(); + this.resolve = resolve; + this.reject = reject; + this.signal = signal; + } + + /** + * Gets the age of the task. + * @returns {number} The age of the task in milliseconds. + * @readonly + */ + get age() { + return Date.now() - this.timestamp; + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class that manages a queue of retry jobs. + */ +class Retrier { + + /** + * Represents the queue for processing tasks. + * @type {Array} + */ + #retrying = []; + + /** + * Represents the queue for pending tasks. + * @type {Array} + */ + #pending = []; + + /** + * The number of tasks currently being processed. + * @type {number} + */ + #working = 0; + + /** + * The timeout for the queue. + * @type {number} + */ + #timeout; + + /** + * The maximum delay for the queue. + * @type {number} + */ + #maxDelay; + + /** + * The setTimeout() timer ID. + * @type {NodeJS.Timeout|undefined} + */ + #timerId; + + /** + * The function to call. + * @type {Function} + */ + #check; + + /** + * The maximum number of concurrent tasks. + * @type {number} + */ + #concurrency; + + /** + * Creates a new instance. + * @param {Function} check The function to call. + * @param {object} [options] The options for the instance. + * @param {number} [options.timeout] The timeout for the queue. + * @param {number} [options.maxDelay] The maximum delay for the queue. + * @param {number} [options.concurrency] The maximum number of concurrent tasks. + */ + constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY, concurrency = MAX_CONCURRENCY } = {}) { + + if (typeof check !== "function") { + throw new Error("Missing function to check errors"); + } + + this.#check = check; + this.#timeout = timeout; + this.#maxDelay = maxDelay; + this.#concurrency = concurrency; + } + + /** + * Gets the number of tasks waiting to be retried. + * @returns {number} The number of tasks in the retry queue. + */ + get retrying() { + return this.#retrying.length; + } + + /** + * Gets the number of tasks waiting to be processed in the pending queue. + * @returns {number} The number of tasks in the pending queue. + */ + get pending() { + return this.#pending.length; + } + + /** + * Gets the number of tasks currently being processed. + * @returns {number} The number of tasks currently being processed. + */ + get working() { + return this.#working; + } + + /** + * Calls the function and retries if it fails. + * @param {Function} fn The function to call. + * @param {Object} options The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @param {Promise} options.promise The promise to return when the function settles. + * @param {Function} options.resolve The resolve function for the promise. + * @param {Function} options.reject The reject function for the promise. + * @returns {Promise} A promise that resolves when the function is + * called successfully. + */ + #call(fn, { signal, promise, resolve, reject }) { + + let result; + + try { + result = fn(); + } catch (/** @type {any} */ error) { + reject(new Error(`Synchronous error: ${error.message}`, { cause: error })); + return promise; + } + + // if the result is not a promise then reject an error + if (!result || typeof result.then !== "function") { + reject(new Error("Result is not a promise.")); + return promise; + } + + this.#working++; + promise.finally(() => { + this.#working--; + this.#processPending(); + }) + // `promise.finally` creates a new promise that may be rejected, so it must be handled. + .catch(() => { }); + + // call the original function and catch any ENFILE or EMFILE errors + Promise.resolve(result) + .then(value => { + debug("Function called successfully without retry."); + resolve(value); + }) + .catch(error => { + if (!this.#check(error)) { + reject(error); + return; + } + + const task = new RetryTask(fn, error, resolve, reject, signal); + + debug(`Function failed, queuing for retry with task ${task.id}.`); + this.#retrying.push(task); + + signal?.addEventListener("abort", () => { + debug(`Task ${task.id} was aborted due to AbortSignal.`); + reject(signal.reason); + }); + + this.#processQueue(); + }); + + return promise; + } + + /** + * Adds a new retry job to the queue. + * @param {Function} fn The function to call. + * @param {object} [options] The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @returns {Promise} A promise that resolves when the queue is + * processed. + */ + retry(fn, { signal } = {}) { + + signal?.throwIfAborted(); + + const { promise, resolve, reject } = createPromise(); + + this.#pending.push(() => this.#call(fn, { signal, promise, resolve, reject })); + this.#processPending(); + + return promise; + } + + + /** + * Processes the pending queue and the retry queue. + * @returns {void} + */ + #processAll() { + if (this.pending) { + this.#processPending(); + } + + if (this.retrying) { + this.#processQueue(); + } + } + + /** + * Processes the pending queue to see which tasks can be started. + * @returns {void} + */ + #processPending() { + + debug(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`); + + const available = this.#concurrency - this.working; + + if (available <= 0) { + return; + } + + const count = Math.min(this.pending, available); + + for (let i = 0; i < count; i++) { + const task = this.#pending.shift(); + task?.(); + } + + debug(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`); + } + + /** + * Processes the queue. + * @returns {void} + */ + #processQueue() { + // clear any timer because we're going to check right now + clearTimeout(this.#timerId); + this.#timerId = undefined; + + debug(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`); + + const processAgain = () => { + this.#timerId = setTimeout(() => this.#processAll(), 0); + }; + + // if there's nothing in the queue, we're done + const task = this.#retrying.shift(); + if (!task) { + debug("Queue is empty, exiting."); + + if (this.pending) { + processAgain(); + } + return; + } + + // if it's time to bail, then bail + if (isTimeToBail(task, this.#timeout)) { + debug(`Task ${task.id} was abandoned due to timeout.`); + task.reject(task.error); + processAgain(); + return; + } + + // if it's not time to retry, then wait and try again + if (!isTimeToRetry(task, this.#maxDelay)) { + debug(`Task ${task.id} is not ready to retry, skipping.`); + this.#retrying.push(task); + processAgain(); + return; + } + + // otherwise, try again + task.lastAttempt = Date.now(); + + // Promise.resolve needed in case it's a thenable but not a Promise + Promise.resolve(task.fn()) + // @ts-ignore because we know it's any + .then(result => { + debug(`Task ${task.id} succeeded after ${task.age}ms.`); + task.resolve(result); + }) + + // @ts-ignore because we know it's any + .catch(error => { + if (!this.#check(error)) { + debug(`Task ${task.id} failed with non-retryable error: ${error.message}.`); + task.reject(error); + return; + } + + // update the task timestamp and push to back of queue to try again + task.lastAttempt = Date.now(); + this.#retrying.push(task); + debug(`Task ${task.id} failed, requeueing to try again.`); + }) + .finally(() => { + this.#processAll(); + }); + } +} + +export { Retrier }; diff --git a/node_modules/@humanwhocodes/retry/dist/retrier.min.js b/node_modules/@humanwhocodes/retry/dist/retrier.min.js new file mode 100644 index 0000000..3760926 --- /dev/null +++ b/node_modules/@humanwhocodes/retry/dist/retrier.min.js @@ -0,0 +1 @@ +function e(e){"@hwc/retry"===globalThis?.process?.env.DEBUG&&console.debug(e)}class RetryTask{id=Math.random().toString(36).slice(2);fn;error;timestamp=Date.now();lastAttempt=this.timestamp;resolve;reject;signal;constructor(e,t,r,i,s){this.fn=e,this.error=t,this.timestamp=Date.now(),this.lastAttempt=Date.now(),this.resolve=r,this.reject=i,this.signal=s}get age(){return Date.now()-this.timestamp}}class Retrier{#e=[];#t=[];#r=0;#i;#s;#n;#o;#c;constructor(e,{timeout:t=6e4,maxDelay:r=100,concurrency:i=1e3}={}){if("function"!=typeof e)throw new Error("Missing function to check errors");this.#o=e,this.#i=t,this.#s=r,this.#c=i}get retrying(){return this.#e.length}get pending(){return this.#t.length}get working(){return this.#r}#a(t,{signal:r,promise:i,resolve:s,reject:n}){let o;try{o=t()}catch(e){return n(new Error(`Synchronous error: ${e.message}`,{cause:e})),i}return o&&"function"==typeof o.then?(this.#r++,i.finally((()=>{this.#r--,this.#h()})).catch((()=>{})),Promise.resolve(o).then((t=>{e("Function called successfully without retry."),s(t)})).catch((i=>{if(!this.#o(i))return void n(i);const o=new RetryTask(t,i,s,n,r);e(`Function failed, queuing for retry with task ${o.id}.`),this.#e.push(o),r?.addEventListener("abort",(()=>{e(`Task ${o.id} was aborted due to AbortSignal.`),n(r.reason)})),this.#g()})),i):(n(new Error("Result is not a promise.")),i)}retry(e,{signal:t}={}){t?.throwIfAborted();const{promise:r,resolve:i,reject:s}=function(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;const r=new Promise(((r,i)=>{e=r,t=i}));if(void 0===e||void 0===t)throw new Error("Promise executor did not initialize resolve or reject.");return{promise:r,resolve:e,reject:t}}();return this.#t.push((()=>this.#a(e,{signal:t,promise:r,resolve:i,reject:s}))),this.#h(),r}#u(){this.pending&&this.#h(),this.retrying&&this.#g()}#h(){e(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`);const t=this.#c-this.working;if(t<=0)return;const r=Math.min(this.pending,t);for(let e=0;e{this.#n=setTimeout((()=>this.#u()),0)},r=this.#e.shift();return r?function(e,t){return e.age>t}(r,this.#i)?(e(`Task ${r.id} was abandoned due to timeout.`),r.reject(r.error),void t()):function(e,t){const r=Date.now()-e.lastAttempt,i=Math.max(e.lastAttempt-e.timestamp,1);return r>=Math.min(1.2*i,t)}(r,this.#s)?(r.lastAttempt=Date.now(),void Promise.resolve(r.fn()).then((t=>{e(`Task ${r.id} succeeded after ${r.age}ms.`),r.resolve(t)})).catch((t=>{if(!this.#o(t))return e(`Task ${r.id} failed with non-retryable error: ${t.message}.`),void r.reject(t);r.lastAttempt=Date.now(),this.#e.push(r),e(`Task ${r.id} failed, requeueing to try again.`)})).finally((()=>{this.#u()}))):(e(`Task ${r.id} is not ready to retry, skipping.`),this.#e.push(r),void t()):(e("Queue is empty, exiting."),void(this.pending&&t()))}}export{Retrier}; diff --git a/node_modules/@humanwhocodes/retry/dist/retrier.mjs b/node_modules/@humanwhocodes/retry/dist/retrier.mjs new file mode 100644 index 0000000..2457a2f --- /dev/null +++ b/node_modules/@humanwhocodes/retry/dist/retrier.mjs @@ -0,0 +1,475 @@ +/** + * @fileoverview A utility for retrying failed async method calls. + */ + +/* global setTimeout, clearTimeout */ + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const MAX_TASK_TIMEOUT = 60000; +const MAX_TASK_DELAY = 100; +const MAX_CONCURRENCY = 1000; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Logs a message to the console if the DEBUG environment variable is set. + * @param {string} message The message to log. + * @returns {void} + */ +function debug(message) { + if (globalThis?.process?.env.DEBUG === "@hwc/retry") { + console.debug(message); + } +} + +/* + * The following logic has been extracted from graceful-fs. + * + * The ISC License + * + * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * Checks if it is time to retry a task based on the timestamp and last attempt time. + * @param {RetryTask} task The task to check. + * @param {number} maxDelay The maximum delay for the queue. + * @returns {boolean} true if it is time to retry, false otherwise. + */ +function isTimeToRetry(task, maxDelay) { + const timeSinceLastAttempt = Date.now() - task.lastAttempt; + const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1); + const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay); + + return timeSinceLastAttempt >= desiredDelay; +} + +/** + * Checks if it is time to bail out based on the given timestamp. + * @param {RetryTask} task The task to check. + * @param {number} timeout The timeout for the queue. + * @returns {boolean} true if it is time to bail, false otherwise. + */ +function isTimeToBail(task, timeout) { + return task.age > timeout; +} + +/** + * Creates a new promise with resolve and reject functions. + * @returns {{promise:Promise, resolve:(value:any) => any, reject: (value:any) => any}} A new promise. + */ +function createPromise() { + if (Promise.withResolvers) { + return Promise.withResolvers(); + } + + let resolve, reject; + + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + + if (resolve === undefined || reject === undefined) { + throw new Error("Promise executor did not initialize resolve or reject."); + } + + return { promise, resolve, reject }; +} + + +/** + * A class to represent a task in the retry queue. + */ +class RetryTask { + + /** + * The unique ID for the task. + * @type {string} + */ + id = Math.random().toString(36).slice(2); + + /** + * The function to call. + * @type {Function} + */ + fn; + + /** + * The error that was thrown. + * @type {Error} + */ + error; + + /** + * The timestamp of the task. + * @type {number} + */ + timestamp = Date.now(); + + /** + * The timestamp of the last attempt. + * @type {number} + */ + lastAttempt = this.timestamp; + + /** + * The resolve function for the promise. + * @type {Function} + */ + resolve; + + /** + * The reject function for the promise. + * @type {Function} + */ + reject; + + /** + * The AbortSignal to monitor for cancellation. + * @type {AbortSignal|undefined} + */ + signal; + + /** + * Creates a new instance. + * @param {Function} fn The function to call. + * @param {Error} error The error that was thrown. + * @param {Function} resolve The resolve function for the promise. + * @param {Function} reject The reject function for the promise. + * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation. + */ + constructor(fn, error, resolve, reject, signal) { + this.fn = fn; + this.error = error; + this.timestamp = Date.now(); + this.lastAttempt = Date.now(); + this.resolve = resolve; + this.reject = reject; + this.signal = signal; + } + + /** + * Gets the age of the task. + * @returns {number} The age of the task in milliseconds. + * @readonly + */ + get age() { + return Date.now() - this.timestamp; + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A class that manages a queue of retry jobs. + */ +class Retrier { + + /** + * Represents the queue for processing tasks. + * @type {Array} + */ + #retrying = []; + + /** + * Represents the queue for pending tasks. + * @type {Array} + */ + #pending = []; + + /** + * The number of tasks currently being processed. + * @type {number} + */ + #working = 0; + + /** + * The timeout for the queue. + * @type {number} + */ + #timeout; + + /** + * The maximum delay for the queue. + * @type {number} + */ + #maxDelay; + + /** + * The setTimeout() timer ID. + * @type {NodeJS.Timeout|undefined} + */ + #timerId; + + /** + * The function to call. + * @type {Function} + */ + #check; + + /** + * The maximum number of concurrent tasks. + * @type {number} + */ + #concurrency; + + /** + * Creates a new instance. + * @param {Function} check The function to call. + * @param {object} [options] The options for the instance. + * @param {number} [options.timeout] The timeout for the queue. + * @param {number} [options.maxDelay] The maximum delay for the queue. + * @param {number} [options.concurrency] The maximum number of concurrent tasks. + */ + constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY, concurrency = MAX_CONCURRENCY } = {}) { + + if (typeof check !== "function") { + throw new Error("Missing function to check errors"); + } + + this.#check = check; + this.#timeout = timeout; + this.#maxDelay = maxDelay; + this.#concurrency = concurrency; + } + + /** + * Gets the number of tasks waiting to be retried. + * @returns {number} The number of tasks in the retry queue. + */ + get retrying() { + return this.#retrying.length; + } + + /** + * Gets the number of tasks waiting to be processed in the pending queue. + * @returns {number} The number of tasks in the pending queue. + */ + get pending() { + return this.#pending.length; + } + + /** + * Gets the number of tasks currently being processed. + * @returns {number} The number of tasks currently being processed. + */ + get working() { + return this.#working; + } + + /** + * Calls the function and retries if it fails. + * @param {Function} fn The function to call. + * @param {Object} options The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @param {Promise} options.promise The promise to return when the function settles. + * @param {Function} options.resolve The resolve function for the promise. + * @param {Function} options.reject The reject function for the promise. + * @returns {Promise} A promise that resolves when the function is + * called successfully. + */ + #call(fn, { signal, promise, resolve, reject }) { + + let result; + + try { + result = fn(); + } catch (/** @type {any} */ error) { + reject(new Error(`Synchronous error: ${error.message}`, { cause: error })); + return promise; + } + + // if the result is not a promise then reject an error + if (!result || typeof result.then !== "function") { + reject(new Error("Result is not a promise.")); + return promise; + } + + this.#working++; + promise.finally(() => { + this.#working--; + this.#processPending(); + }) + // `promise.finally` creates a new promise that may be rejected, so it must be handled. + .catch(() => { }); + + // call the original function and catch any ENFILE or EMFILE errors + Promise.resolve(result) + .then(value => { + debug("Function called successfully without retry."); + resolve(value); + }) + .catch(error => { + if (!this.#check(error)) { + reject(error); + return; + } + + const task = new RetryTask(fn, error, resolve, reject, signal); + + debug(`Function failed, queuing for retry with task ${task.id}.`); + this.#retrying.push(task); + + signal?.addEventListener("abort", () => { + debug(`Task ${task.id} was aborted due to AbortSignal.`); + reject(signal.reason); + }); + + this.#processQueue(); + }); + + return promise; + } + + /** + * Adds a new retry job to the queue. + * @param {Function} fn The function to call. + * @param {object} [options] The options for the job. + * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation. + * @returns {Promise} A promise that resolves when the queue is + * processed. + */ + retry(fn, { signal } = {}) { + + signal?.throwIfAborted(); + + const { promise, resolve, reject } = createPromise(); + + this.#pending.push(() => this.#call(fn, { signal, promise, resolve, reject })); + this.#processPending(); + + return promise; + } + + + /** + * Processes the pending queue and the retry queue. + * @returns {void} + */ + #processAll() { + if (this.pending) { + this.#processPending(); + } + + if (this.retrying) { + this.#processQueue(); + } + } + + /** + * Processes the pending queue to see which tasks can be started. + * @returns {void} + */ + #processPending() { + + debug(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`); + + const available = this.#concurrency - this.working; + + if (available <= 0) { + return; + } + + const count = Math.min(this.pending, available); + + for (let i = 0; i < count; i++) { + const task = this.#pending.shift(); + task?.(); + } + + debug(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`); + } + + /** + * Processes the queue. + * @returns {void} + */ + #processQueue() { + // clear any timer because we're going to check right now + clearTimeout(this.#timerId); + this.#timerId = undefined; + + debug(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`); + + const processAgain = () => { + this.#timerId = setTimeout(() => this.#processAll(), 0); + }; + + // if there's nothing in the queue, we're done + const task = this.#retrying.shift(); + if (!task) { + debug("Queue is empty, exiting."); + + if (this.pending) { + processAgain(); + } + return; + } + + // if it's time to bail, then bail + if (isTimeToBail(task, this.#timeout)) { + debug(`Task ${task.id} was abandoned due to timeout.`); + task.reject(task.error); + processAgain(); + return; + } + + // if it's not time to retry, then wait and try again + if (!isTimeToRetry(task, this.#maxDelay)) { + debug(`Task ${task.id} is not ready to retry, skipping.`); + this.#retrying.push(task); + processAgain(); + return; + } + + // otherwise, try again + task.lastAttempt = Date.now(); + + // Promise.resolve needed in case it's a thenable but not a Promise + Promise.resolve(task.fn()) + // @ts-ignore because we know it's any + .then(result => { + debug(`Task ${task.id} succeeded after ${task.age}ms.`); + task.resolve(result); + }) + + // @ts-ignore because we know it's any + .catch(error => { + if (!this.#check(error)) { + debug(`Task ${task.id} failed with non-retryable error: ${error.message}.`); + task.reject(error); + return; + } + + // update the task timestamp and push to back of queue to try again + task.lastAttempt = Date.now(); + this.#retrying.push(task); + debug(`Task ${task.id} failed, requeueing to try again.`); + }) + .finally(() => { + this.#processAll(); + }); + } +} + +export { Retrier }; diff --git a/node_modules/@humanwhocodes/retry/package.json b/node_modules/@humanwhocodes/retry/package.json new file mode 100644 index 0000000..54de0bc --- /dev/null +++ b/node_modules/@humanwhocodes/retry/package.json @@ -0,0 +1,77 @@ +{ + "name": "@humanwhocodes/retry", + "version": "0.4.2", + "description": "A utility to retry failed async methods.", + "type": "module", + "main": "dist/retrier.cjs", + "module": "dist/retrier.js", + "types": "dist/retrier.d.ts", + "exports": { + "require": { + "types": "./dist/retrier.d.cts", + "default": "./dist/retrier.cjs" + }, + "import": { + "types": "./dist/retrier.d.ts", + "default": "./dist/retrier.js" + } + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18.18" + }, + "publishConfig": { + "access": "public" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "eslint --fix" + ] + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + }, + "scripts": { + "build:cts-types": "node -e \"fs.copyFileSync('dist/retrier.d.ts', 'dist/retrier.d.cts')\"", + "build": "rollup -c && tsc && npm run build:cts-types", + "prepare": "npm run build", + "lint": "eslint src/ tests/", + "pretest": "npm run build", + "test:unit": "mocha tests/retrier.test.js", + "test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs", + "test:jsr": "npx jsr@latest publish --dry-run", + "test:emfile": "node tools/check-emfile-handling.js", + "test": "npm run test:unit && npm run test:build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/retry.git" + }, + "keywords": [ + "nodejs", + "retry", + "async", + "promises" + ], + "author": "Nicholas C. Zaks", + "license": "Apache-2.0", + "devDependencies": { + "@eslint/js": "^8.49.0", + "@rollup/plugin-terser": "0.4.4", + "@tsconfig/node16": "^16.1.1", + "@types/mocha": "^10.0.3", + "@types/node": "20.12.6", + "eslint": "^8.21.0", + "lint-staged": "15.2.1", + "mocha": "^10.3.0", + "rollup": "3.29.4", + "typescript": "5.4.4", + "yorkie": "2.0.0" + } +} diff --git a/node_modules/@nodelib/fs.scandir/LICENSE b/node_modules/@nodelib/fs.scandir/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.scandir/README.md b/node_modules/@nodelib/fs.scandir/README.md new file mode 100644 index 0000000..e0b218b --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/README.md @@ -0,0 +1,171 @@ +# @nodelib/fs.scandir + +> List files and directories inside the specified directory. + +## :bulb: Highlights + +The package is aimed at obtaining information about entries in the directory. + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.scandir +``` + +## Usage + +```ts +import * as fsScandir from '@nodelib/fs.scandir'; + +fsScandir.scandir('path', (error, stats) => { /* … */ }); +``` + +## API + +### .scandir(path, [optionsOrSettings], callback) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. + +```ts +fsScandir.scandir('path', (error, entries) => { /* … */ }); +fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); +fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); +``` + +### .scandirSync(path, [optionsOrSettings]) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. + +```ts +const entries = fsScandir.scandirSync('path'); +const entries = fsScandir.scandirSync('path', {}); +const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsScandir.Settings({ followSymbolicLinks: false }); + +const entries = fsScandir.scandirSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. +* `stats` (optional) — An instance of `fs.Stats` class. + +For example, the `scandir` call for `tools` directory with one directory inside: + +```ts +{ + dirent: Dirent { name: 'typedoc', /* … */ }, + name: 'typedoc', + path: 'tools/typedoc' +} +``` + +## Options + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; + readdir?: typeof fs.readdir; + readdirSync?: typeof fs.readdirSync; +} + +const settings = new fsScandir.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## `old` and `modern` mode + +This package has two modes that are used depending on the environment and parameters of use. + +### old + +* Node.js below `10.10` or when the `stats` option is enabled + +When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). + +### modern + +* Node.js 10.10+ and the `stats` option is disabled + +In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. + +This mode makes fewer calls to the file system. It's faster. + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.scandir/package.json b/node_modules/@nodelib/fs.scandir/package.json new file mode 100644 index 0000000..d3a8924 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.scandir", + "version": "2.1.5", + "description": "List files and directories inside the specified directory", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "scandir", + "readdir", + "dirent" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4", + "@types/run-parallel": "^1.1.0" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md new file mode 100644 index 0000000..686f047 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/README.md @@ -0,0 +1,126 @@ +# @nodelib/fs.stat + +> Get the status of a file with some features. + +## :bulb: Highlights + +Wrapper around standard method `fs.lstat` and `fs.stat` with some features. + +* :beginner: Normally follows symbolic link. +* :gear: Can safely work with broken symbolic link. + +## Install + +```console +npm install @nodelib/fs.stat +``` + +## Usage + +```ts +import * as fsStat from '@nodelib/fs.stat'; + +fsStat.stat('path', (error, stats) => { /* … */ }); +``` + +## API + +### .stat(path, [optionsOrSettings], callback) + +Returns an instance of `fs.Stats` class for provided path with standard callback-style. + +```ts +fsStat.stat('path', (error, stats) => { /* … */ }); +fsStat.stat('path', {}, (error, stats) => { /* … */ }); +fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); +``` + +### .statSync(path, [optionsOrSettings]) + +Returns an instance of `fs.Stats` class for provided path. + +```ts +const stats = fsStat.stat('path'); +const stats = fsStat.stat('path', {}); +const stats = fsStat.stat('path', new fsStat.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsStat.Settings({ followSymbolicLink: false }); + +const stats = fsStat.stat('path', settings); +``` + +## Options + +### `followSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. + +### `markSymbolicLink` + +* Type: `boolean` +* Default: `false` + +Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). + +> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; +} + +const settings = new fsStat.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json new file mode 100644 index 0000000..f2540c2 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nodelib/fs.stat", + "version": "2.0.5", + "description": "Get the status of a file with some features", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "stat" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.walk/LICENSE b/node_modules/@nodelib/fs.walk/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.walk/README.md b/node_modules/@nodelib/fs.walk/README.md new file mode 100644 index 0000000..6ccc08d --- /dev/null +++ b/node_modules/@nodelib/fs.walk/README.md @@ -0,0 +1,215 @@ +# @nodelib/fs.walk + +> A library for efficiently walking a directory recursively. + +## :bulb: Highlights + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). +* :gear: Built-in directories/files and error filtering system. +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.walk +``` + +## Usage + +```ts +import * as fsWalk from '@nodelib/fs.walk'; + +fsWalk.walk('path', (error, entries) => { /* … */ }); +``` + +## API + +### .walk(path, [optionsOrSettings], callback) + +Reads the directory recursively and asynchronously. Requires a callback function. + +> :book: If you want to use the Promise API, use `util.promisify`. + +```ts +fsWalk.walk('path', (error, entries) => { /* … */ }); +fsWalk.walk('path', {}, (error, entries) => { /* … */ }); +fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); +``` + +### .walkStream(path, [optionsOrSettings]) + +Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. + +```ts +const stream = fsWalk.walkStream('path'); +const stream = fsWalk.walkStream('path', {}); +const stream = fsWalk.walkStream('path', new fsWalk.Settings()); +``` + +### .walkSync(path, [optionsOrSettings]) + +Reads the directory recursively and synchronously. Returns an array of entries. + +```ts +const entries = fsWalk.walkSync('path'); +const entries = fsWalk.walkSync('path', {}); +const entries = fsWalk.walkSync('path', new fsWalk.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsWalk.Settings({ followSymbolicLinks: true }); + +const entries = fsWalk.walkSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. +* [`stats`] — An instance of `fs.Stats` class. + +## Options + +### basePath + +* Type: `string` +* Default: `undefined` + +By default, all paths are built relative to the root path. You can use this option to set custom root path. + +In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. + +```ts +fsWalk.walkSync('root'); // → ['root/file.txt'] +fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] +``` + +### concurrency + +* Type: `number` +* Default: `Infinity` + +The maximum number of concurrent calls to `fs.readdir`. + +> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). + +### deepFilter + +* Type: [`DeepFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the directory will be read deep or not. + +```ts +// Skip all directories that starts with `node_modules` +const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); +``` + +### entryFilter + +* Type: [`EntryFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the entry will be included to results or not. + +```ts +// Exclude all `.js` files from results +const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); +``` + +### errorFilter + +* Type: [`ErrorFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that allows you to skip errors that occur when reading directories. + +For example, you can skip `ENOENT` errors if required: + +```ts +// Skip all ENOENT errors +const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; +``` + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: `FileSystemAdapter` +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat: typeof fs.lstat; + stat: typeof fs.stat; + lstatSync: typeof fs.lstatSync; + statSync: typeof fs.statSync; + readdir: typeof fs.readdir; + readdirSync: typeof fs.readdirSync; +} + +const settings = new fsWalk.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.walk/package.json b/node_modules/@nodelib/fs.walk/package.json new file mode 100644 index 0000000..86bfce4 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.walk", + "version": "1.2.8", + "description": "A library for efficiently walking a directory recursively", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "walk", + "scanner", + "crawler" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*", + "!out/**/tests/**" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" +} diff --git a/node_modules/@types/estree/LICENSE b/node_modules/@types/estree/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/estree/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/estree/README.md b/node_modules/@types/estree/README.md new file mode 100644 index 0000000..6e40c08 --- /dev/null +++ b/node_modules/@types/estree/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/estree` + +# Summary +This package contains type definitions for estree (https://github.com/estree/estree). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree. + +### Additional Details + * Last updated: Wed, 18 Sep 2024 09:37:00 GMT + * Dependencies: none + +# Credits +These definitions were written by [RReverser](https://github.com/RReverser). diff --git a/node_modules/@types/estree/package.json b/node_modules/@types/estree/package.json new file mode 100644 index 0000000..f410761 --- /dev/null +++ b/node_modules/@types/estree/package.json @@ -0,0 +1,26 @@ +{ + "name": "@types/estree", + "version": "1.0.6", + "description": "TypeScript definitions for estree", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree", + "license": "MIT", + "contributors": [ + { + "name": "RReverser", + "githubUsername": "RReverser", + "url": "https://github.com/RReverser" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/estree" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "0310b41994a6f8d7530af6c53d47d8b227f32925e43718507fdb1178e05006b1", + "typeScriptVersion": "4.8", + "nonNpm": true +} \ No newline at end of file diff --git a/node_modules/@types/json-schema/LICENSE b/node_modules/@types/json-schema/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/json-schema/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/json-schema/README.md b/node_modules/@types/json-schema/README.md new file mode 100644 index 0000000..42d55d3 --- /dev/null +++ b/node_modules/@types/json-schema/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/json-schema` + +# Summary +This package contains type definitions for json-schema (https://github.com/kriszyp/json-schema). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 03:09:37 GMT + * Dependencies: none + +# Credits +These definitions were written by [Boris Cherny](https://github.com/bcherny), [Lucian Buzzo](https://github.com/lucianbuzzo), [Roland Groza](https://github.com/rolandjitsu), and [Jason Kwok](https://github.com/JasonHK). diff --git a/node_modules/@types/json-schema/package.json b/node_modules/@types/json-schema/package.json new file mode 100644 index 0000000..3c41bd7 --- /dev/null +++ b/node_modules/@types/json-schema/package.json @@ -0,0 +1,40 @@ +{ + "name": "@types/json-schema", + "version": "7.0.15", + "description": "TypeScript definitions for json-schema", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema", + "license": "MIT", + "contributors": [ + { + "name": "Boris Cherny", + "githubUsername": "bcherny", + "url": "https://github.com/bcherny" + }, + { + "name": "Lucian Buzzo", + "githubUsername": "lucianbuzzo", + "url": "https://github.com/lucianbuzzo" + }, + { + "name": "Roland Groza", + "githubUsername": "rolandjitsu", + "url": "https://github.com/rolandjitsu" + }, + { + "name": "Jason Kwok", + "githubUsername": "JasonHK", + "url": "https://github.com/JasonHK" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/json-schema" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "79984fd70cd25c3f7d72b84368778c763c89728ea0073832d745d4691b705257", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index 7ce7d38..371c5bd 100644 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -1,211 +1,220 @@ { - "_from": "@types/node@^20.0.0", - "_id": "@types/node@20.17.22", - "_inBundle": false, - "_integrity": "sha512-9RV2zST+0s3EhfrMZIhrz2bhuhBwxgkbHEwP2gtGWPjBzVQjifMzJ9exw7aDZhR1wbpj8zBrfp3bo8oJcGiUUw==", - "_location": "/@types/node", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@types/node@^20.0.0", "name": "@types/node", - "escapedName": "@types%2fnode", - "scope": "@types", - "rawSpec": "^20.0.0", - "saveSpec": null, - "fetchSpec": "^20.0.0" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.22.tgz", - "_shasum": "18e463b500af6e6d407d2a0084dfc244ef3c8d06", - "_spec": "@types/node@^20.0.0", - "_where": "/Users/scubbo/Code/commit-report-sync", - "bugs": { - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Microsoft TypeScript", - "url": "https://github.com/Microsoft" + "version": "20.17.22", + "description": "TypeScript definitions for node", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", + "license": "MIT", + "contributors": [ + { + "name": "Microsoft TypeScript", + "githubUsername": "Microsoft", + "url": "https://github.com/Microsoft" + }, + { + "name": "Alberto Schiabel", + "githubUsername": "jkomyno", + "url": "https://github.com/jkomyno" + }, + { + "name": "Alvis HT Tang", + "githubUsername": "alvis", + "url": "https://github.com/alvis" + }, + { + "name": "Andrew Makarov", + "githubUsername": "r3nya", + "url": "https://github.com/r3nya" + }, + { + "name": "Benjamin Toueg", + "githubUsername": "btoueg", + "url": "https://github.com/btoueg" + }, + { + "name": "Chigozirim C.", + "githubUsername": "smac89", + "url": "https://github.com/smac89" + }, + { + "name": "David Junger", + "githubUsername": "touffy", + "url": "https://github.com/touffy" + }, + { + "name": "Deividas Bakanas", + "githubUsername": "DeividasBakanas", + "url": "https://github.com/DeividasBakanas" + }, + { + "name": "Eugene Y. Q. Shen", + "githubUsername": "eyqs", + "url": "https://github.com/eyqs" + }, + { + "name": "Hannes Magnusson", + "githubUsername": "Hannes-Magnusson-CK", + "url": "https://github.com/Hannes-Magnusson-CK" + }, + { + "name": "Huw", + "githubUsername": "hoo29", + "url": "https://github.com/hoo29" + }, + { + "name": "Kelvin Jin", + "githubUsername": "kjin", + "url": "https://github.com/kjin" + }, + { + "name": "Klaus Meinhardt", + "githubUsername": "ajafff", + "url": "https://github.com/ajafff" + }, + { + "name": "Lishude", + "githubUsername": "islishude", + "url": "https://github.com/islishude" + }, + { + "name": "Mariusz Wiktorczyk", + "githubUsername": "mwiktorczyk", + "url": "https://github.com/mwiktorczyk" + }, + { + "name": "Mohsen Azimi", + "githubUsername": "mohsen1", + "url": "https://github.com/mohsen1" + }, + { + "name": "Nikita Galkin", + "githubUsername": "galkin", + "url": "https://github.com/galkin" + }, + { + "name": "Parambir Singh", + "githubUsername": "parambirs", + "url": "https://github.com/parambirs" + }, + { + "name": "Sebastian Silbermann", + "githubUsername": "eps1lon", + "url": "https://github.com/eps1lon" + }, + { + "name": "Thomas den Hollander", + "githubUsername": "ThomasdenH", + "url": "https://github.com/ThomasdenH" + }, + { + "name": "Wilco Bakker", + "githubUsername": "WilcoBakker", + "url": "https://github.com/WilcoBakker" + }, + { + "name": "wwwy3y3", + "githubUsername": "wwwy3y3", + "url": "https://github.com/wwwy3y3" + }, + { + "name": "Samuel Ainsworth", + "githubUsername": "samuela", + "url": "https://github.com/samuela" + }, + { + "name": "Kyle Uehlein", + "githubUsername": "kuehlein", + "url": "https://github.com/kuehlein" + }, + { + "name": "Thanik Bhongbhibhat", + "githubUsername": "bhongy", + "url": "https://github.com/bhongy" + }, + { + "name": "Marcin Kopacz", + "githubUsername": "chyzwar", + "url": "https://github.com/chyzwar" + }, + { + "name": "Trivikram Kamat", + "githubUsername": "trivikr", + "url": "https://github.com/trivikr" + }, + { + "name": "Junxiao Shi", + "githubUsername": "yoursunny", + "url": "https://github.com/yoursunny" + }, + { + "name": "Ilia Baryshnikov", + "githubUsername": "qwelias", + "url": "https://github.com/qwelias" + }, + { + "name": "ExE Boss", + "githubUsername": "ExE-Boss", + "url": "https://github.com/ExE-Boss" + }, + { + "name": "Piotr Błażejewicz", + "githubUsername": "peterblazejewicz", + "url": "https://github.com/peterblazejewicz" + }, + { + "name": "Anna Henningsen", + "githubUsername": "addaleax", + "url": "https://github.com/addaleax" + }, + { + "name": "Victor Perin", + "githubUsername": "victorperin", + "url": "https://github.com/victorperin" + }, + { + "name": "NodeJS Contributors", + "githubUsername": "NodeJS", + "url": "https://github.com/NodeJS" + }, + { + "name": "Linus Unnebäck", + "githubUsername": "LinusU", + "url": "https://github.com/LinusU" + }, + { + "name": "wafuwafu13", + "githubUsername": "wafuwafu13", + "url": "https://github.com/wafuwafu13" + }, + { + "name": "Matteo Collina", + "githubUsername": "mcollina", + "url": "https://github.com/mcollina" + }, + { + "name": "Dmitry Semigradsky", + "githubUsername": "Semigradsky", + "url": "https://github.com/Semigradsky" + } + ], + "main": "", + "types": "index.d.ts", + "typesVersions": { + "<=5.6": { + "*": [ + "ts5.6/*" + ] + } }, - { - "name": "Alberto Schiabel", - "url": "https://github.com/jkomyno" + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/node" }, - { - "name": "Alvis HT Tang", - "url": "https://github.com/alvis" + "scripts": {}, + "dependencies": { + "undici-types": "~6.19.2" }, - { - "name": "Andrew Makarov", - "url": "https://github.com/r3nya" - }, - { - "name": "Benjamin Toueg", - "url": "https://github.com/btoueg" - }, - { - "name": "Chigozirim C.", - "url": "https://github.com/smac89" - }, - { - "name": "David Junger", - "url": "https://github.com/touffy" - }, - { - "name": "Deividas Bakanas", - "url": "https://github.com/DeividasBakanas" - }, - { - "name": "Eugene Y. Q. Shen", - "url": "https://github.com/eyqs" - }, - { - "name": "Hannes Magnusson", - "url": "https://github.com/Hannes-Magnusson-CK" - }, - { - "name": "Huw", - "url": "https://github.com/hoo29" - }, - { - "name": "Kelvin Jin", - "url": "https://github.com/kjin" - }, - { - "name": "Klaus Meinhardt", - "url": "https://github.com/ajafff" - }, - { - "name": "Lishude", - "url": "https://github.com/islishude" - }, - { - "name": "Mariusz Wiktorczyk", - "url": "https://github.com/mwiktorczyk" - }, - { - "name": "Mohsen Azimi", - "url": "https://github.com/mohsen1" - }, - { - "name": "Nikita Galkin", - "url": "https://github.com/galkin" - }, - { - "name": "Parambir Singh", - "url": "https://github.com/parambirs" - }, - { - "name": "Sebastian Silbermann", - "url": "https://github.com/eps1lon" - }, - { - "name": "Thomas den Hollander", - "url": "https://github.com/ThomasdenH" - }, - { - "name": "Wilco Bakker", - "url": "https://github.com/WilcoBakker" - }, - { - "name": "wwwy3y3", - "url": "https://github.com/wwwy3y3" - }, - { - "name": "Samuel Ainsworth", - "url": "https://github.com/samuela" - }, - { - "name": "Kyle Uehlein", - "url": "https://github.com/kuehlein" - }, - { - "name": "Thanik Bhongbhibhat", - "url": "https://github.com/bhongy" - }, - { - "name": "Marcin Kopacz", - "url": "https://github.com/chyzwar" - }, - { - "name": "Trivikram Kamat", - "url": "https://github.com/trivikr" - }, - { - "name": "Junxiao Shi", - "url": "https://github.com/yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "url": "https://github.com/qwelias" - }, - { - "name": "ExE Boss", - "url": "https://github.com/ExE-Boss" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "url": "https://github.com/addaleax" - }, - { - "name": "Victor Perin", - "url": "https://github.com/victorperin" - }, - { - "name": "NodeJS Contributors", - "url": "https://github.com/NodeJS" - }, - { - "name": "Linus Unnebäck", - "url": "https://github.com/LinusU" - }, - { - "name": "wafuwafu13", - "url": "https://github.com/wafuwafu13" - }, - { - "name": "Matteo Collina", - "url": "https://github.com/mcollina" - }, - { - "name": "Dmitry Semigradsky", - "url": "https://github.com/Semigradsky" - } - ], - "dependencies": { - "undici-types": "~6.19.2" - }, - "deprecated": false, - "description": "TypeScript definitions for node", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", - "license": "MIT", - "main": "", - "name": "@types/node", - "peerDependencies": {}, - "repository": { - "type": "git", - "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "typeScriptVersion": "5.0", - "types": "index.d.ts", - "typesPublisherContentHash": "0512e4162067df9d306d7bd666fcfccf5ddac25b3d097560266b1310f7825880", - "typesVersions": { - "<=5.6": { - "*": [ - "ts5.6/*" - ] - } - }, - "version": "20.17.22" -} + "peerDependencies": {}, + "typesPublisherContentHash": "0512e4162067df9d306d7bd666fcfccf5ddac25b3d097560266b1310f7825880", + "typeScriptVersion": "5.0" +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/LICENSE b/node_modules/@typescript-eslint/eslint-plugin/LICENSE new file mode 100644 index 0000000..a116410 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/eslint-plugin/README.md b/node_modules/@typescript-eslint/eslint-plugin/README.md new file mode 100644 index 0000000..3f894c8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/eslint-plugin` + +An ESLint plugin which provides lint rules for TypeScript codebases. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/eslint-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/eslint-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) + +👉 See **https://typescript-eslint.io/getting-started** for our Getting Started docs. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.d.ts.map new file mode 100644 index 0000000..ac701c4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../src/configs/all.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBAyJiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js new file mode 100644 index 0000000..3bb2088 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js @@ -0,0 +1,161 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/ban-ts-comment': 'error', + '@typescript-eslint/ban-tslint-comment': 'error', + '@typescript-eslint/class-literal-property-style': 'error', + 'class-methods-use-this': 'off', + '@typescript-eslint/class-methods-use-this': 'error', + '@typescript-eslint/consistent-generic-constructors': 'error', + '@typescript-eslint/consistent-indexed-object-style': 'error', + 'consistent-return': 'off', + '@typescript-eslint/consistent-return': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/consistent-type-exports': 'error', + '@typescript-eslint/consistent-type-imports': 'error', + 'default-param-last': 'off', + '@typescript-eslint/default-param-last': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/explicit-function-return-type': 'error', + '@typescript-eslint/explicit-member-accessibility': 'error', + '@typescript-eslint/explicit-module-boundary-types': 'error', + 'init-declarations': 'off', + '@typescript-eslint/init-declarations': 'error', + 'max-params': 'off', + '@typescript-eslint/max-params': 'error', + '@typescript-eslint/member-ordering': 'error', + '@typescript-eslint/method-signature-style': 'error', + '@typescript-eslint/naming-convention': 'error', + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', + '@typescript-eslint/no-confusing-void-expression': 'error', + '@typescript-eslint/no-deprecated': 'error', + 'no-dupe-class-members': 'off', + '@typescript-eslint/no-dupe-class-members': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-dynamic-delete': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-extraneous-class': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-import-type-side-effects': 'error', + '@typescript-eslint/no-inferrable-types': 'error', + 'no-invalid-this': 'off', + '@typescript-eslint/no-invalid-this': 'error', + '@typescript-eslint/no-invalid-void-type': 'error', + 'no-loop-func': 'off', + '@typescript-eslint/no-loop-func': 'error', + 'no-magic-numbers': 'off', + '@typescript-eslint/no-magic-numbers': 'error', + '@typescript-eslint/no-meaningless-void-operator': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-misused-spread': 'error', + '@typescript-eslint/no-mixed-enums': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'error', + 'no-redeclare': 'off', + '@typescript-eslint/no-redeclare': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-require-imports': 'error', + 'no-restricted-imports': 'off', + '@typescript-eslint/no-restricted-imports': 'error', + '@typescript-eslint/no-restricted-types': 'error', + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-parameter-property-assignment': 'error', + '@typescript-eslint/no-unnecessary-qualifier': 'error', + '@typescript-eslint/no-unnecessary-template-expression': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unnecessary-type-parameters': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-type-assertion': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'error', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/no-useless-empty-export': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + '@typescript-eslint/parameter-properties': 'error', + '@typescript-eslint/prefer-as-const': 'error', + 'prefer-destructuring': 'off', + '@typescript-eslint/prefer-destructuring': 'error', + '@typescript-eslint/prefer-enum-initializers': 'error', + '@typescript-eslint/prefer-find': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/prefer-nullish-coalescing': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + '@typescript-eslint/prefer-readonly': 'error', + '@typescript-eslint/prefer-readonly-parameter-types': 'error', + '@typescript-eslint/prefer-reduce-type-parameter': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-return-this-type': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'error', + '@typescript-eslint/promise-function-async': 'error', + '@typescript-eslint/related-getter-setter-pairs': 'error', + '@typescript-eslint/require-array-sort-compare': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + 'no-return-await': 'off', + '@typescript-eslint/return-await': 'error', + '@typescript-eslint/strict-boolean-expressions': 'error', + '@typescript-eslint/switch-exhaustiveness-check': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/typedef': 'error', + '@typescript-eslint/unbound-method': 'error', + '@typescript-eslint/unified-signatures': 'error', + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.d.ts.map new file mode 100644 index 0000000..7533120 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";;;;;;;AAEA,kBAIiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js new file mode 100644 index 0000000..2852f3c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js @@ -0,0 +1,6 @@ +"use strict"; +module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { sourceType: 'module' }, + plugins: ['@typescript-eslint'], +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.d.ts.map new file mode 100644 index 0000000..78f4ce6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"disable-type-checked.d.ts","sourceRoot":"","sources":["../../src/configs/disable-type-checked.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBA8DiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.js new file mode 100644 index 0000000..d96a1d1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.js @@ -0,0 +1,70 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + parserOptions: { program: null, project: false, projectService: false }, + rules: { + '@typescript-eslint/await-thenable': 'off', + '@typescript-eslint/consistent-return': 'off', + '@typescript-eslint/consistent-type-exports': 'off', + '@typescript-eslint/dot-notation': 'off', + '@typescript-eslint/naming-convention': 'off', + '@typescript-eslint/no-array-delete': 'off', + '@typescript-eslint/no-base-to-string': 'off', + '@typescript-eslint/no-confusing-void-expression': 'off', + '@typescript-eslint/no-deprecated': 'off', + '@typescript-eslint/no-duplicate-type-constituents': 'off', + '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/no-for-in-array': 'off', + '@typescript-eslint/no-implied-eval': 'off', + '@typescript-eslint/no-meaningless-void-operator': 'off', + '@typescript-eslint/no-misused-promises': 'off', + '@typescript-eslint/no-misused-spread': 'off', + '@typescript-eslint/no-mixed-enums': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'off', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', + '@typescript-eslint/no-unnecessary-condition': 'off', + '@typescript-eslint/no-unnecessary-qualifier': 'off', + '@typescript-eslint/no-unnecessary-template-expression': 'off', + '@typescript-eslint/no-unnecessary-type-arguments': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'off', + '@typescript-eslint/no-unnecessary-type-parameters': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-enum-comparison': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-type-assertion': 'off', + '@typescript-eslint/no-unsafe-unary-minus': 'off', + '@typescript-eslint/non-nullable-type-assertion-style': 'off', + '@typescript-eslint/only-throw-error': 'off', + '@typescript-eslint/prefer-destructuring': 'off', + '@typescript-eslint/prefer-find': 'off', + '@typescript-eslint/prefer-includes': 'off', + '@typescript-eslint/prefer-nullish-coalescing': 'off', + '@typescript-eslint/prefer-optional-chain': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-readonly': 'off', + '@typescript-eslint/prefer-readonly-parameter-types': 'off', + '@typescript-eslint/prefer-reduce-type-parameter': 'off', + '@typescript-eslint/prefer-regexp-exec': 'off', + '@typescript-eslint/prefer-return-this-type': 'off', + '@typescript-eslint/prefer-string-starts-ends-with': 'off', + '@typescript-eslint/promise-function-async': 'off', + '@typescript-eslint/related-getter-setter-pairs': 'off', + '@typescript-eslint/require-array-sort-compare': 'off', + '@typescript-eslint/require-await': 'off', + '@typescript-eslint/restrict-plus-operands': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/return-await': 'off', + '@typescript-eslint/strict-boolean-expressions': 'off', + '@typescript-eslint/switch-exhaustiveness-check': 'off', + '@typescript-eslint/unbound-method': 'off', + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'off', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended-raw.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended-raw.d.ts.map new file mode 100644 index 0000000..472d48d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended-raw.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eslint-recommended-raw.d.ts","sourceRoot":"","sources":["../../src/configs/eslint-recommended-raw.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,QAAA,MAAM,MAAM,GACV,OAAO,MAAM,GAAG,WAAW,KAC1B;IACD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAiChD,CAAC;AAEH,SAAS,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended-raw.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended-raw.js new file mode 100644 index 0000000..236b89d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended-raw.js @@ -0,0 +1,42 @@ +"use strict"; +// NOTE: this file is isolated to be shared across legacy and flat configs +// it is exported via `./use-at-your-own-risk/eslint-recommended-raw` +// and it has types manually defined in `./eslint-recommended-raw.d.ts` +/** + * This is a compatibility ruleset that: + * - disables rules from eslint:recommended which are already handled by TypeScript. + * - enables rules that make sense due to TS's typechecking / transpilation. + */ +const config = (style) => ({ + files: style === 'glob' + ? // classic configs use glob syntax + ['*.ts', '*.tsx', '*.mts', '*.cts'] + : // flat configs use minimatch syntax + ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'], + rules: { + 'constructor-super': 'off', // ts(2335) & ts(2377) + 'getter-return': 'off', // ts(2378) + 'no-class-assign': 'off', // ts(2629) + 'no-const-assign': 'off', // ts(2588) + 'no-dupe-args': 'off', // ts(2300) + 'no-dupe-class-members': 'off', // ts(2393) & ts(2300) + 'no-dupe-keys': 'off', // ts(1117) + 'no-func-assign': 'off', // ts(2630) + 'no-import-assign': 'off', // ts(2632) & ts(2540) + // TODO - remove this once we no longer support ESLint v8 + 'no-new-symbol': 'off', // ts(7009) + 'no-new-native-nonconstructor': 'off', // ts(7009) + 'no-obj-calls': 'off', // ts(2349) + 'no-redeclare': 'off', // ts(2451) + 'no-setter-return': 'off', // ts(2408) + 'no-this-before-super': 'off', // ts(2376) & ts(17009) + 'no-undef': 'off', // ts(2304) & ts(2552) + 'no-unreachable': 'off', // ts(7027) + 'no-unsafe-negation': 'off', // ts(2365) & ts(2322) & ts(2358) + 'no-var': 'error', // ts transpiles let/const to var, so no need for vars any more + 'prefer-const': 'error', // ts provides better types with const + 'prefer-rest-params': 'error', // ts provides better types with rest args over arguments + 'prefer-spread': 'error', // ts transpiles spread to apply, so no need for manual apply + }, +}); +module.exports = config; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.d.ts.map new file mode 100644 index 0000000..24e2ac8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eslint-recommended.d.ts","sourceRoot":"","sources":["../../src/configs/eslint-recommended.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAMH,kBAEiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js new file mode 100644 index 0000000..754aeeb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js @@ -0,0 +1,13 @@ +"use strict"; +/** + * This is a compatibility ruleset that: + * - disables rules from eslint:recommended which are already handled by TypeScript. + * - enables rules that make sense due to TS's typechecking / transpilation. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const eslint_recommended_raw_1 = __importDefault(require("./eslint-recommended-raw")); +module.exports = { + overrides: [(0, eslint_recommended_raw_1.default)('glob')], +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked-only.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked-only.d.ts.map new file mode 100644 index 0000000..4ccabee --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked-only.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recommended-type-checked-only.d.ts","sourceRoot":"","sources":["../../src/configs/recommended-type-checked-only.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBA+BiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked-only.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked-only.js new file mode 100644 index 0000000..18102b4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked-only.js @@ -0,0 +1,39 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + '@typescript-eslint/unbound-method': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked.d.ts.map new file mode 100644 index 0000000..4f822f2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recommended-type-checked.d.ts","sourceRoot":"","sources":["../../src/configs/recommended-type-checked.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBAsDiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked.js new file mode 100644 index 0000000..243df9d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-type-checked.js @@ -0,0 +1,62 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/ban-ts-comment': 'error', + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/unbound-method': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.d.ts.map new file mode 100644 index 0000000..eecaede --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBA2BiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js new file mode 100644 index 0000000..cf5347a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js @@ -0,0 +1,35 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/ban-ts-comment': 'error', + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked-only.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked-only.d.ts.map new file mode 100644 index 0000000..50ac49c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked-only.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strict-type-checked-only.d.ts","sourceRoot":"","sources":["../../src/configs/strict-type-checked-only.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBAqEiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked-only.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked-only.js new file mode 100644 index 0000000..f5d72cb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked-only.js @@ -0,0 +1,77 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-confusing-void-expression': 'error', + '@typescript-eslint/no-deprecated': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-meaningless-void-operator': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-misused-spread': 'error', + '@typescript-eslint/no-mixed-enums': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-template-expression': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-parameters': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + '@typescript-eslint/prefer-reduce-type-parameter': 'error', + '@typescript-eslint/prefer-return-this-type': 'error', + '@typescript-eslint/related-getter-setter-pairs': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': [ + 'error', + { + allowAny: false, + allowBoolean: false, + allowNullish: false, + allowNumberAndString: false, + allowRegExp: false, + }, + ], + '@typescript-eslint/restrict-template-expressions': [ + 'error', + { + allowAny: false, + allowBoolean: false, + allowNever: false, + allowNullish: false, + allowNumber: false, + allowRegExp: false, + }, + ], + 'no-return-await': 'off', + '@typescript-eslint/return-await': [ + 'error', + 'error-handling-correctness-only', + ], + '@typescript-eslint/unbound-method': 'error', + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked.d.ts.map new file mode 100644 index 0000000..2a536f9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strict-type-checked.d.ts","sourceRoot":"","sources":["../../src/configs/strict-type-checked.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBAwGiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked.js new file mode 100644 index 0000000..3614c64 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked.js @@ -0,0 +1,112 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/ban-ts-comment': [ + 'error', + { minimumDescriptionLength: 10 }, + ], + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-confusing-void-expression': 'error', + '@typescript-eslint/no-deprecated': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-dynamic-delete': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-extraneous-class': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-invalid-void-type': 'error', + '@typescript-eslint/no-meaningless-void-operator': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-misused-spread': 'error', + '@typescript-eslint/no-mixed-enums': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-template-expression': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unnecessary-type-parameters': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + '@typescript-eslint/prefer-reduce-type-parameter': 'error', + '@typescript-eslint/prefer-return-this-type': 'error', + '@typescript-eslint/related-getter-setter-pairs': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': [ + 'error', + { + allowAny: false, + allowBoolean: false, + allowNullish: false, + allowNumberAndString: false, + allowRegExp: false, + }, + ], + '@typescript-eslint/restrict-template-expressions': [ + 'error', + { + allowAny: false, + allowBoolean: false, + allowNever: false, + allowNullish: false, + allowNumber: false, + allowRegExp: false, + }, + ], + 'no-return-await': 'off', + '@typescript-eslint/return-await': [ + 'error', + 'error-handling-correctness-only', + ], + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/unbound-method': 'error', + '@typescript-eslint/unified-signatures': 'error', + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.d.ts.map new file mode 100644 index 0000000..ffe40af --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strict.d.ts","sourceRoot":"","sources":["../../src/configs/strict.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBAuCiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js new file mode 100644 index 0000000..7521cd2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js @@ -0,0 +1,47 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/ban-ts-comment': [ + 'error', + { minimumDescriptionLength: 10 }, + ], + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-dynamic-delete': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-extraneous-class': 'error', + '@typescript-eslint/no-invalid-void-type': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'error', + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/unified-signatures': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked-only.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked-only.d.ts.map new file mode 100644 index 0000000..adb382b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked-only.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stylistic-type-checked-only.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic-type-checked-only.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,kBAaiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked-only.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked-only.js new file mode 100644 index 0000000..4f7be16 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked-only.js @@ -0,0 +1,21 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-find': 'error', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-nullish-coalescing': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked.d.ts.map new file mode 100644 index 0000000..3c4200a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stylistic-type-checked.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic-type-checked.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kBA2BiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked.js new file mode 100644 index 0000000..43ce8de --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic-type-checked.js @@ -0,0 +1,35 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/ban-tslint-comment': 'error', + '@typescript-eslint/class-literal-property-style': 'error', + '@typescript-eslint/consistent-generic-constructors': 'error', + '@typescript-eslint/consistent-indexed-object-style': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-inferrable-types': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-find': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-nullish-coalescing': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic.d.ts.map new file mode 100644 index 0000000..c7c0f5b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stylistic.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AASA,kBAkBiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic.js new file mode 100644 index 0000000..d688102 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/stylistic.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/ban-tslint-comment': 'error', + '@typescript-eslint/class-literal-property-style': 'error', + '@typescript-eslint/consistent-generic-constructors': 'error', + '@typescript-eslint/consistent-indexed-object-style': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-inferrable-types': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + }, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/index.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/index.d.ts.map new file mode 100644 index 0000000..ae673e7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6BE,mEAAmE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBrE,kBAI0B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/index.js b/node_modules/@typescript-eslint/eslint-plugin/dist/index.js new file mode 100644 index 0000000..f9ef9b0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/index.js @@ -0,0 +1,46 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const all_1 = __importDefault(require("./configs/all")); +const base_1 = __importDefault(require("./configs/base")); +const disable_type_checked_1 = __importDefault(require("./configs/disable-type-checked")); +const eslint_recommended_1 = __importDefault(require("./configs/eslint-recommended")); +const recommended_1 = __importDefault(require("./configs/recommended")); +const recommended_type_checked_1 = __importDefault(require("./configs/recommended-type-checked")); +const recommended_type_checked_only_1 = __importDefault(require("./configs/recommended-type-checked-only")); +const strict_1 = __importDefault(require("./configs/strict")); +const strict_type_checked_1 = __importDefault(require("./configs/strict-type-checked")); +const strict_type_checked_only_1 = __importDefault(require("./configs/strict-type-checked-only")); +const stylistic_1 = __importDefault(require("./configs/stylistic")); +const stylistic_type_checked_1 = __importDefault(require("./configs/stylistic-type-checked")); +const stylistic_type_checked_only_1 = __importDefault(require("./configs/stylistic-type-checked-only")); +const rules_1 = __importDefault(require("./rules")); +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +const { name, version } = require('../package.json'); +const configs = { + all: all_1.default, + base: base_1.default, + 'disable-type-checked': disable_type_checked_1.default, + 'eslint-recommended': eslint_recommended_1.default, + recommended: recommended_1.default, + /** @deprecated - please use "recommended-type-checked" instead. */ + 'recommended-requiring-type-checking': recommended_type_checked_1.default, + 'recommended-type-checked': recommended_type_checked_1.default, + 'recommended-type-checked-only': recommended_type_checked_only_1.default, + strict: strict_1.default, + 'strict-type-checked': strict_type_checked_1.default, + 'strict-type-checked-only': strict_type_checked_only_1.default, + stylistic: stylistic_1.default, + 'stylistic-type-checked': stylistic_type_checked_1.default, + 'stylistic-type-checked-only': stylistic_type_checked_only_1.default, +}; +const meta = { + name, + version, +}; +module.exports = { + configs, + meta, + rules: rules_1.default, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.d.ts.map new file mode 100644 index 0000000..a346ff8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"adjacent-overload-signatures.d.ts","sourceRoot":"","sources":["../../src/rules/adjacent-overload-signatures.ts"],"names":[],"mappings":";AAuBA,wBA8IG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js new file mode 100644 index 0000000..23ca5e2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'adjacent-overload-signatures', + meta: { + type: 'suggestion', + docs: { + description: 'Require that function overload signatures be consecutive', + recommended: 'stylistic', + }, + messages: { + adjacentSignature: 'All {{name}} signatures should be adjacent.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * Gets the name and attribute of the member being processed. + * @param member the member being processed. + * @returns the name and attribute of the member or null if it's a member not relevant to the rule. + */ + function getMemberMethod(member) { + switch (member.type) { + case utils_1.AST_NODE_TYPES.ExportDefaultDeclaration: + case utils_1.AST_NODE_TYPES.ExportNamedDeclaration: { + // export statements (e.g. export { a };) + // have no declarations, so ignore them + if (!member.declaration) { + return null; + } + return getMemberMethod(member.declaration); + } + case utils_1.AST_NODE_TYPES.TSDeclareFunction: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: { + const name = member.id?.name ?? null; + if (name == null) { + return null; + } + return { + name, + type: util_1.MemberNameType.Normal, + callSignature: false, + }; + } + case utils_1.AST_NODE_TYPES.TSMethodSignature: + case utils_1.AST_NODE_TYPES.MethodDefinition: + return { + ...(0, util_1.getNameFromMember)(member, context.sourceCode), + callSignature: false, + static: !!member.static, + }; + case utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration: + return { + name: 'call', + type: util_1.MemberNameType.Normal, + callSignature: true, + }; + case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return { + name: 'new', + type: util_1.MemberNameType.Normal, + callSignature: false, + }; + } + return null; + } + function isSameMethod(method1, method2) { + return (!!method2 && + method1.name === method2.name && + method1.static === method2.static && + method1.callSignature === method2.callSignature && + method1.type === method2.type); + } + function getMembers(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.ClassBody: + case utils_1.AST_NODE_TYPES.Program: + case utils_1.AST_NODE_TYPES.TSModuleBlock: + case utils_1.AST_NODE_TYPES.TSInterfaceBody: + case utils_1.AST_NODE_TYPES.BlockStatement: + return node.body; + case utils_1.AST_NODE_TYPES.TSTypeLiteral: + return node.members; + } + } + function checkBodyForOverloadMethods(node) { + const members = getMembers(node); + let lastMethod = null; + const seenMethods = []; + members.forEach(member => { + const method = getMemberMethod(member); + if (method == null) { + lastMethod = null; + return; + } + const index = seenMethods.findIndex(seenMethod => isSameMethod(method, seenMethod)); + if (index > -1 && !isSameMethod(method, lastMethod)) { + context.report({ + node: member, + messageId: 'adjacentSignature', + data: { + name: `${method.static ? 'static ' : ''}${method.name}`, + }, + }); + } + else if (index === -1) { + seenMethods.push(method); + } + lastMethod = method; + }); + } + return { + BlockStatement: checkBodyForOverloadMethods, + ClassBody: checkBodyForOverloadMethods, + Program: checkBodyForOverloadMethods, + TSInterfaceBody: checkBodyForOverloadMethods, + TSModuleBlock: checkBodyForOverloadMethods, + TSTypeLiteral: checkBodyForOverloadMethods, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.d.ts.map new file mode 100644 index 0000000..d027d02 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"array-type.d.ts","sourceRoot":"","sources":["../../src/rules/array-type.ts"],"names":[],"mappings":"AA2EA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AAChE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,OAAO,EAAE,YAAY,CAAC;QACtB,QAAQ,CAAC,EAAE,YAAY,CAAC;KACzB;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAClB,kBAAkB,GAClB,0BAA0B,GAC1B,wBAAwB,GACxB,gCAAgC,GAChC,oBAAoB,GACpB,0BAA0B,CAAC;;AAE/B,wBAgNG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js new file mode 100644 index 0000000..b8235d0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js @@ -0,0 +1,232 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +/** + * Check whatever node can be considered as simple + * @param node the node to be evaluated. + */ +function isSimpleType(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.Identifier: + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + case utils_1.AST_NODE_TYPES.TSNeverKeyword: + case utils_1.AST_NODE_TYPES.TSNumberKeyword: + case utils_1.AST_NODE_TYPES.TSBigIntKeyword: + case utils_1.AST_NODE_TYPES.TSObjectKeyword: + case utils_1.AST_NODE_TYPES.TSStringKeyword: + case utils_1.AST_NODE_TYPES.TSSymbolKeyword: + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + case utils_1.AST_NODE_TYPES.TSVoidKeyword: + case utils_1.AST_NODE_TYPES.TSNullKeyword: + case utils_1.AST_NODE_TYPES.TSArrayType: + case utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + case utils_1.AST_NODE_TYPES.TSThisType: + case utils_1.AST_NODE_TYPES.TSQualifiedName: + return true; + case utils_1.AST_NODE_TYPES.TSTypeReference: + if (node.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + node.typeName.name === 'Array') { + if (!node.typeArguments) { + return true; + } + if (node.typeArguments.params.length === 1) { + return isSimpleType(node.typeArguments.params[0]); + } + } + else { + if (node.typeArguments) { + return false; + } + return isSimpleType(node.typeName); + } + return false; + default: + return false; + } +} +/** + * Check if node needs parentheses + * @param node the node to be evaluated. + */ +function typeNeedsParentheses(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSTypeReference: + return typeNeedsParentheses(node.typeName); + case utils_1.AST_NODE_TYPES.TSUnionType: + case utils_1.AST_NODE_TYPES.TSFunctionType: + case utils_1.AST_NODE_TYPES.TSIntersectionType: + case utils_1.AST_NODE_TYPES.TSTypeOperator: + case utils_1.AST_NODE_TYPES.TSInferType: + case utils_1.AST_NODE_TYPES.TSConstructorType: + case utils_1.AST_NODE_TYPES.TSConditionalType: + return true; + case utils_1.AST_NODE_TYPES.Identifier: + return node.name === 'ReadonlyArray'; + default: + return false; + } +} +exports.default = (0, util_1.createRule)({ + name: 'array-type', + meta: { + type: 'suggestion', + docs: { + description: 'Require consistently using either `T[]` or `Array` for arrays', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + errorStringArray: "Array type using '{{className}}<{{type}}>' is forbidden. Use '{{readonlyPrefix}}{{type}}[]' instead.", + errorStringArrayReadonly: "Array type using '{{className}}<{{type}}>' is forbidden. Use '{{readonlyPrefix}}{{type}}' instead.", + errorStringArraySimple: "Array type using '{{className}}<{{type}}>' is forbidden for simple types. Use '{{readonlyPrefix}}{{type}}[]' instead.", + errorStringArraySimpleReadonly: "Array type using '{{className}}<{{type}}>' is forbidden for simple types. Use '{{readonlyPrefix}}{{type}}' instead.", + errorStringGeneric: "Array type using '{{readonlyPrefix}}{{type}}[]' is forbidden. Use '{{className}}<{{type}}>' instead.", + errorStringGenericSimple: "Array type using '{{readonlyPrefix}}{{type}}[]' is forbidden for non-simple types. Use '{{className}}<{{type}}>' instead.", + }, + schema: [ + { + type: 'object', + $defs: { + arrayOption: { + type: 'string', + enum: ['array', 'generic', 'array-simple'], + }, + }, + additionalProperties: false, + properties: { + default: { + $ref: '#/items/0/$defs/arrayOption', + description: 'The array type expected for mutable cases.', + }, + readonly: { + $ref: '#/items/0/$defs/arrayOption', + description: 'The array type expected for readonly cases. If omitted, the value for `default` will be used.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + default: 'array', + }, + ], + create(context, [options]) { + const defaultOption = options.default; + const readonlyOption = options.readonly ?? defaultOption; + /** + * @param node the node to be evaluated. + */ + function getMessageType(node) { + if (isSimpleType(node)) { + return context.sourceCode.getText(node); + } + return 'T'; + } + return { + TSArrayType(node) { + const isReadonly = node.parent.type === utils_1.AST_NODE_TYPES.TSTypeOperator && + node.parent.operator === 'readonly'; + const currentOption = isReadonly ? readonlyOption : defaultOption; + if (currentOption === 'array' || + (currentOption === 'array-simple' && isSimpleType(node.elementType))) { + return; + } + const messageId = currentOption === 'generic' + ? 'errorStringGeneric' + : 'errorStringGenericSimple'; + const errorNode = isReadonly ? node.parent : node; + context.report({ + node: errorNode, + messageId, + data: { + type: getMessageType(node.elementType), + className: isReadonly ? 'ReadonlyArray' : 'Array', + readonlyPrefix: isReadonly ? 'readonly ' : '', + }, + fix(fixer) { + const typeNode = node.elementType; + const arrayType = isReadonly ? 'ReadonlyArray' : 'Array'; + return [ + fixer.replaceTextRange([errorNode.range[0], typeNode.range[0]], `${arrayType}<`), + fixer.replaceTextRange([typeNode.range[1], errorNode.range[1]], '>'), + ]; + }, + }); + }, + TSTypeReference(node) { + if (node.typeName.type !== utils_1.AST_NODE_TYPES.Identifier || + !(node.typeName.name === 'Array' || + node.typeName.name === 'ReadonlyArray' || + node.typeName.name === 'Readonly') || + (node.typeName.name === 'Readonly' && + node.typeArguments?.params[0].type !== utils_1.AST_NODE_TYPES.TSArrayType)) { + return; + } + const isReadonlyWithGenericArrayType = node.typeName.name === 'Readonly' && + node.typeArguments?.params[0].type === utils_1.AST_NODE_TYPES.TSArrayType; + const isReadonlyArrayType = node.typeName.name === 'ReadonlyArray' || + isReadonlyWithGenericArrayType; + const currentOption = isReadonlyArrayType + ? readonlyOption + : defaultOption; + if (currentOption === 'generic') { + return; + } + const readonlyPrefix = isReadonlyArrayType ? 'readonly ' : ''; + const typeParams = node.typeArguments?.params; + const messageId = currentOption === 'array' + ? isReadonlyWithGenericArrayType + ? 'errorStringArrayReadonly' + : 'errorStringArray' + : isReadonlyArrayType && node.typeName.name !== 'ReadonlyArray' + ? 'errorStringArraySimpleReadonly' + : 'errorStringArraySimple'; + if (!typeParams || typeParams.length === 0) { + // Create an 'any' array + context.report({ + node, + messageId, + data: { + type: 'any', + className: isReadonlyArrayType ? 'ReadonlyArray' : 'Array', + readonlyPrefix, + }, + fix(fixer) { + return fixer.replaceText(node, `${readonlyPrefix}any[]`); + }, + }); + return; + } + if (typeParams.length !== 1 || + (currentOption === 'array-simple' && !isSimpleType(typeParams[0]))) { + return; + } + const type = typeParams[0]; + const typeParens = typeNeedsParentheses(type); + const parentParens = readonlyPrefix && + node.parent.type === utils_1.AST_NODE_TYPES.TSArrayType && + !(0, util_1.isParenthesized)(node.parent.elementType, context.sourceCode); + const start = `${parentParens ? '(' : ''}${readonlyPrefix}${typeParens ? '(' : ''}`; + const end = `${typeParens ? ')' : ''}${isReadonlyWithGenericArrayType ? '' : `[]`}${parentParens ? ')' : ''}`; + context.report({ + node, + messageId, + data: { + type: getMessageType(type), + className: isReadonlyArrayType ? node.typeName.name : 'Array', + readonlyPrefix, + }, + fix(fixer) { + return [ + fixer.replaceTextRange([node.range[0], type.range[0]], start), + fixer.replaceTextRange([type.range[1], node.range[1]], end), + ]; + }, + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.d.ts.map new file mode 100644 index 0000000..b36c875 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"await-thenable.d.ts","sourceRoot":"","sources":["../../src/rules/await-thenable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAiBnE,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,gCAAgC,GAChC,sBAAsB,GACtB,4BAA4B,GAC5B,aAAa,CAAC;;AAElB,wBAyJG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js new file mode 100644 index 0000000..b4741b2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js @@ -0,0 +1,146 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +const getForStatementHeadLoc_1 = require("../util/getForStatementHeadLoc"); +exports.default = (0, util_1.createRule)({ + name: 'await-thenable', + meta: { + type: 'problem', + docs: { + description: 'Disallow awaiting a value that is not a Thenable', + recommended: 'recommended', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + await: 'Unexpected `await` of a non-Promise (non-"Thenable") value.', + awaitUsingOfNonAsyncDisposable: 'Unexpected `await using` of a value that is not async disposable.', + convertToOrdinaryFor: 'Convert to an ordinary `for...of` loop.', + forAwaitOfNonAsyncIterable: 'Unexpected `for await...of` of a value that is not async iterable.', + removeAwait: 'Remove unnecessary `await`.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + return { + AwaitExpression(node) { + const awaitArgumentEsNode = node.argument; + const awaitArgumentType = services.getTypeAtLocation(awaitArgumentEsNode); + const awaitArgumentTsNode = services.esTreeNodeToTSNodeMap.get(awaitArgumentEsNode); + const certainty = (0, util_1.needsToBeAwaited)(checker, awaitArgumentTsNode, awaitArgumentType); + if (certainty === util_1.Awaitable.Never) { + context.report({ + node, + messageId: 'await', + suggest: [ + { + messageId: 'removeAwait', + fix(fixer) { + const awaitKeyword = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isAwaitKeyword), util_1.NullThrowsReasons.MissingToken('await', 'await expression')); + return fixer.remove(awaitKeyword); + }, + }, + ], + }); + } + }, + 'ForOfStatement[await=true]'(node) { + const type = services.getTypeAtLocation(node.right); + if ((0, util_1.isTypeAnyType)(type)) { + return; + } + const hasAsyncIteratorSymbol = tsutils + .unionTypeParts(type) + .some(typePart => tsutils.getWellKnownSymbolPropertyOfType(typePart, 'asyncIterator', checker) != null); + if (!hasAsyncIteratorSymbol) { + context.report({ + loc: (0, getForStatementHeadLoc_1.getForStatementHeadLoc)(context.sourceCode, node), + messageId: 'forAwaitOfNonAsyncIterable', + suggest: [ + // Note that this suggestion causes broken code for sync iterables + // of promises, since the loop variable is not awaited. + { + messageId: 'convertToOrdinaryFor', + fix(fixer) { + const awaitToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isAwaitKeyword), util_1.NullThrowsReasons.MissingToken('await', 'for await loop')); + return fixer.remove(awaitToken); + }, + }, + ], + }); + } + }, + 'VariableDeclaration[kind="await using"]'(node) { + for (const declarator of node.declarations) { + const init = declarator.init; + if (init == null) { + continue; + } + const type = services.getTypeAtLocation(init); + if ((0, util_1.isTypeAnyType)(type)) { + continue; + } + const hasAsyncDisposeSymbol = tsutils + .unionTypeParts(type) + .some(typePart => tsutils.getWellKnownSymbolPropertyOfType(typePart, 'asyncDispose', checker) != null); + if (!hasAsyncDisposeSymbol) { + context.report({ + node: init, + messageId: 'awaitUsingOfNonAsyncDisposable', + // let the user figure out what to do if there's + // await using a = b, c = d, e = f; + // it's rare and not worth the complexity to handle. + ...(0, util_1.getFixOrSuggest)({ + fixOrSuggest: node.declarations.length === 1 ? 'suggest' : 'none', + suggestion: { + messageId: 'removeAwait', + fix(fixer) { + const awaitToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isAwaitKeyword), util_1.NullThrowsReasons.MissingToken('await', 'await using')); + return fixer.remove(awaitToken); + }, + }, + }), + }); + } + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.d.ts.map new file mode 100644 index 0000000..a58a433 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ban-ts-comment.d.ts","sourceRoot":"","sources":["../../src/rules/ban-ts-comment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAQnE,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,wBAAwB,GACxB;IAAE,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,MAAM,WAAW,YAAY;IAC3B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;CAChC;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,YAAY,CAAC,CAAC;AAErC,MAAM,MAAM,UAAU,GAClB,kCAAkC,GAClC,oBAAoB,GACpB,8CAA8C,GAC9C,uCAAuC,GACvC,8BAA8B,CAAC;;AAOnC,wBA8OG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js new file mode 100644 index 0000000..766495a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js @@ -0,0 +1,184 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const defaultMinimumDescriptionLength = 3; +exports.default = (0, util_1.createRule)({ + name: 'ban-ts-comment', + meta: { + type: 'problem', + docs: { + description: 'Disallow `@ts-` comments or require descriptions after directives', + recommended: { + recommended: true, + strict: [{ minimumDescriptionLength: 10 }], + }, + }, + hasSuggestions: true, + messages: { + replaceTsIgnoreWithTsExpectError: 'Replace "@ts-ignore" with "@ts-expect-error".', + tsDirectiveComment: 'Do not use "@ts-{{directive}}" because it alters compilation errors.', + tsDirectiveCommentDescriptionNotMatchPattern: 'The description for the "@ts-{{directive}}" directive must match the {{format}} format.', + tsDirectiveCommentRequiresDescription: 'Include a description after the "@ts-{{directive}}" directive to explain why the @ts-{{directive}} is necessary. The description must be {{minimumDescriptionLength}} characters or longer.', + tsIgnoreInsteadOfExpectError: 'Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free.', + }, + schema: [ + { + type: 'object', + $defs: { + directiveConfigSchema: { + oneOf: [ + { + type: 'boolean', + default: true, + }, + { + type: 'string', + enum: ['allow-with-description'], + }, + { + type: 'object', + additionalProperties: false, + properties: { + descriptionFormat: { type: 'string' }, + }, + }, + ], + }, + }, + additionalProperties: false, + properties: { + minimumDescriptionLength: { + type: 'number', + default: defaultMinimumDescriptionLength, + description: 'A minimum character length for descriptions when `allow-with-description` is enabled.', + }, + 'ts-check': { $ref: '#/items/0/$defs/directiveConfigSchema' }, + 'ts-expect-error': { $ref: '#/items/0/$defs/directiveConfigSchema' }, + 'ts-ignore': { $ref: '#/items/0/$defs/directiveConfigSchema' }, + 'ts-nocheck': { $ref: '#/items/0/$defs/directiveConfigSchema' }, + }, + }, + ], + }, + defaultOptions: [ + { + minimumDescriptionLength: defaultMinimumDescriptionLength, + 'ts-check': false, + 'ts-expect-error': 'allow-with-description', + 'ts-ignore': true, + 'ts-nocheck': true, + }, + ], + create(context, [options]) { + // https://github.com/microsoft/TypeScript/blob/6f1ad5ad8bec5671f7e951a3524b62d82ec4be68/src/compiler/parser.ts#L10591 + const singleLinePragmaRegEx = /^\/\/\/?\s*@ts-(?check|nocheck)(?.*)$/; + /* + The regex used are taken from the ones used in the official TypeScript repo - + https://github.com/microsoft/TypeScript/blob/6f1ad5ad8bec5671f7e951a3524b62d82ec4be68/src/compiler/scanner.ts#L340-L348 + */ + const commentDirectiveRegExSingleLine = /^\/*\s*@ts-(?expect-error|ignore)(?.*)/; + const commentDirectiveRegExMultiLine = /^\s*(?:\/|\*)*\s*@ts-(?expect-error|ignore)(?.*)/; + const descriptionFormats = new Map(); + for (const directive of [ + 'ts-expect-error', + 'ts-ignore', + 'ts-nocheck', + 'ts-check', + ]) { + const option = options[directive]; + if (typeof option === 'object' && option.descriptionFormat) { + descriptionFormats.set(directive, new RegExp(option.descriptionFormat)); + } + } + function execDirectiveRegEx(regex, str) { + const match = regex.exec(str); + if (!match) { + return null; + } + const { description, directive } = (0, util_1.nullThrows)(match.groups, 'RegExp should contain groups'); + return { + description: (0, util_1.nullThrows)(description, 'RegExp should contain "description" group'), + directive: (0, util_1.nullThrows)(directive, 'RegExp should contain "directive" group'), + }; + } + function findDirectiveInComment(comment) { + if (comment.type === utils_1.AST_TOKEN_TYPES.Line) { + const matchedPragma = execDirectiveRegEx(singleLinePragmaRegEx, `//${comment.value}`); + if (matchedPragma) { + return matchedPragma; + } + return execDirectiveRegEx(commentDirectiveRegExSingleLine, comment.value); + } + const commentLines = comment.value.split('\n'); + return execDirectiveRegEx(commentDirectiveRegExMultiLine, commentLines[commentLines.length - 1]); + } + return { + Program(node) { + const firstStatement = node.body.at(0); + const comments = context.sourceCode.getAllComments(); + comments.forEach(comment => { + const match = findDirectiveInComment(comment); + if (!match) { + return; + } + const { description, directive } = match; + if (directive === 'nocheck' && + firstStatement && + firstStatement.loc.start.line <= comment.loc.start.line) { + return; + } + const fullDirective = `ts-${directive}`; + const option = options[fullDirective]; + if (option === true) { + if (directive === 'ignore') { + // Special case to suggest @ts-expect-error instead of @ts-ignore + context.report({ + node: comment, + messageId: 'tsIgnoreInsteadOfExpectError', + suggest: [ + { + messageId: 'replaceTsIgnoreWithTsExpectError', + fix(fixer) { + const commentText = comment.value.replace(/@ts-ignore/, '@ts-expect-error'); + return fixer.replaceText(comment, comment.type === utils_1.AST_TOKEN_TYPES.Line + ? `//${commentText}` + : `/*${commentText}*/`); + }, + }, + ], + }); + } + else { + context.report({ + node: comment, + messageId: 'tsDirectiveComment', + data: { directive }, + }); + } + } + if (option === 'allow-with-description' || + (typeof option === 'object' && option.descriptionFormat)) { + const { minimumDescriptionLength } = options; + const format = descriptionFormats.get(fullDirective); + if ((0, util_1.getStringLength)(description.trim()) < + (0, util_1.nullThrows)(minimumDescriptionLength, 'Expected minimumDescriptionLength to be set')) { + context.report({ + node: comment, + messageId: 'tsDirectiveCommentRequiresDescription', + data: { directive, minimumDescriptionLength }, + }); + } + else if (format && !format.test(description)) { + context.report({ + node: comment, + messageId: 'tsDirectiveCommentDescriptionNotMatchPattern', + data: { directive, format: format.source }, + }); + } + } + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.d.ts.map new file mode 100644 index 0000000..133fd58 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ban-tslint-comment.d.ts","sourceRoot":"","sources":["../../src/rules/ban-tslint-comment.ts"],"names":[],"mappings":";AAiBA,wBA0CG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js new file mode 100644 index 0000000..db4c4e7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +// tslint regex +// https://github.com/palantir/tslint/blob/95d9d958833fd9dc0002d18cbe34db20d0fbf437/src/enableDisableRules.ts#L32 +const ENABLE_DISABLE_REGEX = /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/; +const toText = (text, type) => type === utils_1.AST_TOKEN_TYPES.Line + ? ['//', text.trim()].join(' ') + : ['/*', text.trim(), '*/'].join(' '); +exports.default = (0, util_1.createRule)({ + name: 'ban-tslint-comment', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow `// tslint:` comments', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + commentDetected: 'tslint comment detected: "{{ text }}"', + }, + schema: [], + }, + defaultOptions: [], + create: context => { + return { + Program() { + const comments = context.sourceCode.getAllComments(); + comments.forEach(c => { + if (ENABLE_DISABLE_REGEX.test(c.value)) { + context.report({ + node: c, + messageId: 'commentDetected', + data: { text: toText(c.value, c.type) }, + fix(fixer) { + const rangeStart = context.sourceCode.getIndexFromLoc({ + column: c.loc.start.column > 0 ? c.loc.start.column - 1 : 0, + line: c.loc.start.line, + }); + const rangeEnd = context.sourceCode.getIndexFromLoc({ + column: c.loc.end.column, + line: c.loc.end.line, + }); + return fixer.removeRange([rangeStart, rangeEnd + 1]); + }, + }); + } + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.d.ts.map new file mode 100644 index 0000000..44f1361 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"class-literal-property-style.d.ts","sourceRoot":"","sources":["../../src/rules/class-literal-property-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAanE,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;AAC7C,MAAM,MAAM,UAAU,GAClB,kBAAkB,GAClB,4BAA4B,GAC5B,mBAAmB,GACnB,6BAA6B,CAAC;;AAsClC,wBAoLG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js new file mode 100644 index 0000000..ba35798 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js @@ -0,0 +1,160 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const printNodeModifiers = (node, final) => `${node.accessibility ?? ''}${node.static ? ' static' : ''} ${final} `.trimStart(); +const isSupportedLiteral = (node) => { + switch (node.type) { + case utils_1.AST_NODE_TYPES.Literal: + return true; + case utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + return node.quasi.quasis.length === 1; + case utils_1.AST_NODE_TYPES.TemplateLiteral: + return node.quasis.length === 1; + default: + return false; + } +}; +exports.default = (0, util_1.createRule)({ + name: 'class-literal-property-style', + meta: { + type: 'problem', + docs: { + description: 'Enforce that literals on classes are exposed in a consistent style', + recommended: 'stylistic', + }, + hasSuggestions: true, + messages: { + preferFieldStyle: 'Literals should be exposed using readonly fields.', + preferFieldStyleSuggestion: 'Replace the literals with readonly fields.', + preferGetterStyle: 'Literals should be exposed using getters.', + preferGetterStyleSuggestion: 'Replace the literals with getters.', + }, + schema: [ + { + type: 'string', + description: 'Which literal class member syntax to prefer.', + enum: ['fields', 'getters'], + }, + ], + }, + defaultOptions: ['fields'], + create(context, [style]) { + const propertiesInfoStack = []; + function enterClassBody() { + propertiesInfoStack.push({ + excludeSet: new Set(), + properties: [], + }); + } + function exitClassBody() { + const { excludeSet, properties } = (0, util_1.nullThrows)(propertiesInfoStack.pop(), 'Stack should exist on class exit'); + properties.forEach(node => { + const { value } = node; + if (!value || !isSupportedLiteral(value)) { + return; + } + const name = (0, util_1.getStaticMemberAccessValue)(node, context); + if (name && excludeSet.has(name)) { + return; + } + context.report({ + node: node.key, + messageId: 'preferGetterStyle', + suggest: [ + { + messageId: 'preferGetterStyleSuggestion', + fix(fixer) { + const name = context.sourceCode.getText(node.key); + let text = ''; + text += printNodeModifiers(node, 'get'); + text += node.computed ? `[${name}]` : name; + text += `() { return ${context.sourceCode.getText(value)}; }`; + return fixer.replaceText(node, text); + }, + }, + ], + }); + }); + } + function excludeAssignedProperty(node) { + if ((0, util_1.isAssignee)(node)) { + const { excludeSet } = propertiesInfoStack[propertiesInfoStack.length - 1]; + const name = (0, util_1.getStaticMemberAccessValue)(node, context); + if (name) { + excludeSet.add(name); + } + } + } + return { + ...(style === 'fields' && { + MethodDefinition(node) { + if (node.kind !== 'get' || + node.override || + !node.value.body || + node.value.body.body.length === 0) { + return; + } + const [statement] = node.value.body.body; + if (statement.type !== utils_1.AST_NODE_TYPES.ReturnStatement) { + return; + } + const { argument } = statement; + if (!argument || !isSupportedLiteral(argument)) { + return; + } + const name = (0, util_1.getStaticMemberAccessValue)(node, context); + const hasDuplicateKeySetter = name && + node.parent.body.some(element => { + return (element.type === utils_1.AST_NODE_TYPES.MethodDefinition && + element.kind === 'set' && + (0, util_1.isStaticMemberAccessOfValue)(element, context, name)); + }); + if (hasDuplicateKeySetter) { + return; + } + context.report({ + node: node.key, + messageId: 'preferFieldStyle', + suggest: [ + { + messageId: 'preferFieldStyleSuggestion', + fix(fixer) { + const name = context.sourceCode.getText(node.key); + let text = ''; + text += printNodeModifiers(node, 'readonly'); + text += node.computed ? `[${name}]` : name; + text += ` = ${context.sourceCode.getText(argument)};`; + return fixer.replaceText(node, text); + }, + }, + ], + }); + }, + }), + ...(style === 'getters' && { + ClassBody: enterClassBody, + 'ClassBody:exit': exitClassBody, + 'MethodDefinition[kind="constructor"] ThisExpression'(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.MemberExpression) { + let parent = node.parent; + while (!(0, util_1.isFunction)(parent)) { + parent = parent.parent; + } + if (parent.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + parent.parent.kind === 'constructor') { + excludeAssignedProperty(node.parent); + } + } + }, + PropertyDefinition(node) { + if (!node.readonly || node.declare || node.override) { + return; + } + const { properties } = propertiesInfoStack[propertiesInfoStack.length - 1]; + properties.push(node); + }, + }), + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-methods-use-this.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-methods-use-this.d.ts.map new file mode 100644 index 0000000..3400997 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-methods-use-this.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"class-methods-use-this.d.ts","sourceRoot":"","sources":["../../src/rules/class-methods-use-this.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,qCAAqC,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;QAClE,qBAAqB,CAAC,EAAE,OAAO,CAAC;KACjC;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;;AAEvC,wBAkSG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-methods-use-this.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-methods-use-this.js new file mode 100644 index 0000000..15734bb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-methods-use-this.js @@ -0,0 +1,220 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'class-methods-use-this', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce that class methods utilize `this`', + extendsBaseRule: true, + requiresTypeChecking: false, + }, + messages: { + missingThis: "Expected 'this' to be used by class {{name}}.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + enforceForClassFields: { + type: 'boolean', + default: true, + description: 'Enforces that functions used as instance field initializers utilize `this`.', + }, + exceptMethods: { + type: 'array', + description: 'Allows specified method names to be ignored with this rule.', + items: { + type: 'string', + }, + }, + ignoreClassesThatImplementAnInterface: { + description: 'Whether to ignore class members that are defined within a class that `implements` a type.', + oneOf: [ + { + type: 'boolean', + description: 'Ignore all classes that implement an interface', + }, + { + type: 'string', + description: 'Ignore only the public fields of classes that implement an interface', + enum: ['public-fields'], + }, + ], + }, + ignoreOverrideMethods: { + type: 'boolean', + description: 'Whether to ignore members marked with the `override` modifier.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + enforceForClassFields: true, + exceptMethods: [], + ignoreClassesThatImplementAnInterface: false, + ignoreOverrideMethods: false, + }, + ], + create(context, [{ enforceForClassFields, exceptMethods: exceptMethodsRaw, ignoreClassesThatImplementAnInterface, ignoreOverrideMethods, },]) { + const exceptMethods = new Set(exceptMethodsRaw); + let stack; + function pushContext(member) { + if (member?.parent.type === utils_1.AST_NODE_TYPES.ClassBody) { + stack = { + class: member.parent.parent, + member, + parent: stack, + usesThis: false, + }; + } + else { + stack = { + class: null, + member: null, + parent: stack, + usesThis: false, + }; + } + } + function enterFunction(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition || + node.parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition || + node.parent.type === utils_1.AST_NODE_TYPES.AccessorProperty) { + pushContext(node.parent); + } + else { + pushContext(); + } + } + /** + * Pop `this` used flag from the stack. + */ + function popContext() { + const oldStack = stack; + stack = stack?.parent; + return oldStack; + } + function isPublicField(accessibility) { + if (!accessibility || accessibility === 'public') { + return true; + } + return false; + } + /** + * Check if the node is an instance method not excluded by config + */ + function isIncludedInstanceMethod(node) { + if (node.static || + (node.type === utils_1.AST_NODE_TYPES.MethodDefinition && + node.kind === 'constructor') || + ((node.type === utils_1.AST_NODE_TYPES.PropertyDefinition || + node.type === utils_1.AST_NODE_TYPES.AccessorProperty) && + !enforceForClassFields)) { + return false; + } + if (node.computed || exceptMethods.size === 0) { + return true; + } + const hashIfNeeded = node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier ? '#' : ''; + const name = (0, util_1.getStaticMemberAccessValue)(node, context); + return (typeof name !== 'string' || !exceptMethods.has(hashIfNeeded + name)); + } + /** + * Checks if we are leaving a function that is a method, and reports if 'this' has not been used. + * Static methods and the constructor are exempt. + * Then pops the context off the stack. + */ + function exitFunction(node) { + const stackContext = popContext(); + if (stackContext?.member == null || + stackContext.usesThis || + (ignoreOverrideMethods && stackContext.member.override) || + (ignoreClassesThatImplementAnInterface === true && + stackContext.class.implements.length > 0) || + (ignoreClassesThatImplementAnInterface === 'public-fields' && + stackContext.class.implements.length > 0 && + isPublicField(stackContext.member.accessibility))) { + return; + } + if (isIncludedInstanceMethod(stackContext.member)) { + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(node, context.sourceCode), + node, + messageId: 'missingThis', + data: { + name: (0, util_1.getFunctionNameWithKind)(node), + }, + }); + } + } + return { + // function declarations have their own `this` context + FunctionDeclaration() { + pushContext(); + }, + 'FunctionDeclaration:exit'() { + popContext(); + }, + FunctionExpression(node) { + enterFunction(node); + }, + 'FunctionExpression:exit'(node) { + exitFunction(node); + }, + ...(enforceForClassFields + ? { + 'AccessorProperty > ArrowFunctionExpression.value'(node) { + enterFunction(node); + }, + 'AccessorProperty > ArrowFunctionExpression.value:exit'(node) { + exitFunction(node); + }, + 'PropertyDefinition > ArrowFunctionExpression.value'(node) { + enterFunction(node); + }, + 'PropertyDefinition > ArrowFunctionExpression.value:exit'(node) { + exitFunction(node); + }, + } + : {}), + /* + * Class field value are implicit functions. + */ + 'AccessorProperty:exit'() { + popContext(); + }, + 'AccessorProperty > *.key:exit'() { + pushContext(); + }, + 'PropertyDefinition:exit'() { + popContext(); + }, + 'PropertyDefinition > *.key:exit'() { + pushContext(); + }, + /* + * Class static blocks are implicit functions. They aren't required to use `this`, + * but we have to push context so that it captures any use of `this` in the static block + * separately from enclosing contexts, because static blocks have their own `this` and it + * shouldn't count as used `this` in enclosing contexts. + */ + StaticBlock() { + pushContext(); + }, + 'StaticBlock:exit'() { + popContext(); + }, + 'ThisExpression, Super'() { + if (stack) { + stack.usesThis = true; + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.d.ts.map new file mode 100644 index 0000000..094963c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-generic-constructors.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-generic-constructors.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;AACtE,MAAM,MAAM,OAAO,GAAG,CAAC,aAAa,GAAG,iBAAiB,CAAC,CAAC;;AAE1D,wBAqJG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js new file mode 100644 index 0000000..6c2548e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js @@ -0,0 +1,110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'consistent-generic-constructors', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce specifying generic type arguments on type annotation or constructor name of a constructor call', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + preferConstructor: 'The generic type arguments should be specified as part of the constructor type arguments.', + preferTypeAnnotation: 'The generic type arguments should be specified as part of the type annotation.', + }, + schema: [ + { + type: 'string', + description: 'Which constructor call syntax to prefer.', + enum: ['type-annotation', 'constructor'], + }, + ], + }, + defaultOptions: ['constructor'], + create(context, [mode]) { + return { + 'VariableDeclarator,PropertyDefinition,AccessorProperty,:matches(FunctionDeclaration,FunctionExpression) > AssignmentPattern'(node) { + function getLHSRHS() { + switch (node.type) { + case utils_1.AST_NODE_TYPES.VariableDeclarator: + return [node.id, node.init]; + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.AccessorProperty: + return [node, node.value]; + case utils_1.AST_NODE_TYPES.AssignmentPattern: + return [node.left, node.right]; + default: + throw new Error(`Unhandled node type: ${node.type}`); + } + } + const [lhsName, rhs] = getLHSRHS(); + const lhs = lhsName.typeAnnotation?.typeAnnotation; + if (!rhs || + rhs.type !== utils_1.AST_NODE_TYPES.NewExpression || + rhs.callee.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + if (lhs && + (lhs.type !== utils_1.AST_NODE_TYPES.TSTypeReference || + lhs.typeName.type !== utils_1.AST_NODE_TYPES.Identifier || + lhs.typeName.name !== rhs.callee.name)) { + return; + } + if (mode === 'type-annotation') { + if (!lhs && rhs.typeArguments) { + const { callee, typeArguments } = rhs; + const typeAnnotation = context.sourceCode.getText(callee) + + context.sourceCode.getText(typeArguments); + context.report({ + node, + messageId: 'preferTypeAnnotation', + fix(fixer) { + function getIDToAttachAnnotation() { + if (node.type !== utils_1.AST_NODE_TYPES.PropertyDefinition && + node.type !== utils_1.AST_NODE_TYPES.AccessorProperty) { + return lhsName; + } + if (!node.computed) { + return node.key; + } + // If the property's computed, we have to attach the + // annotation after the square bracket, not the enclosed expression + return (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.key), util_1.NullThrowsReasons.MissingToken(']', 'key')); + } + return [ + fixer.remove(typeArguments), + fixer.insertTextAfter(getIDToAttachAnnotation(), `: ${typeAnnotation}`), + ]; + }, + }); + } + return; + } + if (lhs?.typeArguments && !rhs.typeArguments) { + const hasParens = context.sourceCode.getTokenAfter(rhs.callee)?.value === '('; + const extraComments = new Set(context.sourceCode.getCommentsInside(lhs.parent)); + context.sourceCode + .getCommentsInside(lhs.typeArguments) + .forEach(c => extraComments.delete(c)); + context.report({ + node, + messageId: 'preferConstructor', + *fix(fixer) { + yield fixer.remove(lhs.parent); + for (const comment of extraComments) { + yield fixer.insertTextAfter(rhs.callee, context.sourceCode.getText(comment)); + } + yield fixer.insertTextAfter(rhs.callee, context.sourceCode.getText(lhs.typeArguments)); + if (!hasParens) { + yield fixer.insertTextAfter(rhs.callee, '()'); + } + }, + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.d.ts.map new file mode 100644 index 0000000..ed76d2f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-indexed-object-style.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-indexed-object-style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAanE,MAAM,MAAM,UAAU,GAClB,sBAAsB,GACtB,gCAAgC,GAChC,cAAc,CAAC;AACnB,MAAM,MAAM,OAAO,GAAG,CAAC,iBAAiB,GAAG,QAAQ,CAAC,CAAC;;AAErD,wBA4OG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js new file mode 100644 index 0000000..3d87a22 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js @@ -0,0 +1,250 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'consistent-indexed-object-style', + meta: { + type: 'suggestion', + docs: { + description: 'Require or disallow the `Record` type', + recommended: 'stylistic', + }, + fixable: 'code', + // eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- suggestions are exposed through a helper. + hasSuggestions: true, + messages: { + preferIndexSignature: 'An index signature is preferred over a record.', + preferIndexSignatureSuggestion: 'Change into an index signature instead of a record.', + preferRecord: 'A record is preferred over an index signature.', + }, + schema: [ + { + type: 'string', + description: 'Which indexed object syntax to prefer.', + enum: ['record', 'index-signature'], + }, + ], + }, + defaultOptions: ['record'], + create(context, [mode]) { + function checkMembers(members, node, parentId, prefix, postfix, safeFix = true) { + if (members.length !== 1) { + return; + } + const [member] = members; + if (member.type !== utils_1.AST_NODE_TYPES.TSIndexSignature) { + return; + } + const parameter = member.parameters.at(0); + if (parameter?.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const keyType = parameter.typeAnnotation; + if (!keyType) { + return; + } + const valueType = member.typeAnnotation; + if (!valueType) { + return; + } + if (parentId) { + const scope = context.sourceCode.getScope(parentId); + const superVar = utils_1.ASTUtils.findVariable(scope, parentId.name); + if (superVar && + isDeeplyReferencingType(node, superVar, new Set([parentId]))) { + return; + } + } + context.report({ + node, + messageId: 'preferRecord', + fix: safeFix + ? (fixer) => { + const key = context.sourceCode.getText(keyType.typeAnnotation); + const value = context.sourceCode.getText(valueType.typeAnnotation); + const record = member.readonly + ? `Readonly>` + : `Record<${key}, ${value}>`; + return fixer.replaceText(node, `${prefix}${record}${postfix}`); + } + : null, + }); + } + return { + ...(mode === 'index-signature' && { + TSTypeReference(node) { + const typeName = node.typeName; + if (typeName.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + if (typeName.name !== 'Record') { + return; + } + const params = node.typeArguments?.params; + if (params?.length !== 2) { + return; + } + const indexParam = params[0]; + const shouldFix = indexParam.type === utils_1.AST_NODE_TYPES.TSStringKeyword || + indexParam.type === utils_1.AST_NODE_TYPES.TSNumberKeyword || + indexParam.type === utils_1.AST_NODE_TYPES.TSSymbolKeyword; + context.report({ + node, + messageId: 'preferIndexSignature', + ...(0, util_1.getFixOrSuggest)({ + fixOrSuggest: shouldFix ? 'fix' : 'suggest', + suggestion: { + messageId: 'preferIndexSignatureSuggestion', + fix: fixer => { + const key = context.sourceCode.getText(params[0]); + const type = context.sourceCode.getText(params[1]); + return fixer.replaceText(node, `{ [key: ${key}]: ${type} }`); + }, + }, + }), + }); + }, + }), + ...(mode === 'record' && { + TSInterfaceDeclaration(node) { + let genericTypes = ''; + if (node.typeParameters?.params.length) { + genericTypes = `<${node.typeParameters.params + .map(p => context.sourceCode.getText(p)) + .join(', ')}>`; + } + checkMembers(node.body.body, node, node.id, `type ${node.id.name}${genericTypes} = `, ';', !node.extends.length); + }, + TSMappedType(node) { + const key = node.key; + const scope = context.sourceCode.getScope(key); + const scopeManagerKey = (0, util_1.nullThrows)(scope.variables.find(value => value.name === key.name && value.isTypeVariable), 'key type parameter must be a defined type variable in its scope'); + // If the key is used to compute the value, we can't convert to a Record. + if (scopeManagerKey.references.some(reference => reference.isTypeReference)) { + return; + } + const constraint = node.constraint; + if (constraint.type === utils_1.AST_NODE_TYPES.TSTypeOperator && + constraint.operator === 'keyof' && + !(0, util_1.isParenthesized)(constraint, context.sourceCode)) { + // This is a weird special case, since modifiers are preserved by + // the mapped type, but not by the Record type. So this type is not, + // in general, equivalent to a Record type. + return; + } + // If the mapped type is circular, we can't convert it to a Record. + const parentId = findParentDeclaration(node)?.id; + if (parentId) { + const scope = context.sourceCode.getScope(key); + const superVar = utils_1.ASTUtils.findVariable(scope, parentId.name); + if (superVar) { + const isCircular = superVar.references.some(item => item.isTypeReference && + node.range[0] <= item.identifier.range[0] && + node.range[1] >= item.identifier.range[1]); + if (isCircular) { + return; + } + } + } + // There's no builtin Mutable type, so we can't autofix it really. + const canFix = node.readonly !== '-'; + context.report({ + node, + messageId: 'preferRecord', + ...(canFix && { + fix: (fixer) => { + const keyType = context.sourceCode.getText(constraint); + const valueType = context.sourceCode.getText(node.typeAnnotation); + let recordText = `Record<${keyType}, ${valueType}>`; + if (node.optional === '+' || node.optional === true) { + recordText = `Partial<${recordText}>`; + } + else if (node.optional === '-') { + recordText = `Required<${recordText}>`; + } + if (node.readonly === '+' || node.readonly === true) { + recordText = `Readonly<${recordText}>`; + } + return fixer.replaceText(node, recordText); + }, + }), + }); + }, + TSTypeLiteral(node) { + const parent = findParentDeclaration(node); + checkMembers(node.members, node, parent?.id, '', ''); + }, + }), + }; + }, +}); +function findParentDeclaration(node) { + if (node.parent && node.parent.type !== utils_1.AST_NODE_TYPES.TSTypeAnnotation) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) { + return node.parent; + } + return findParentDeclaration(node.parent); + } + return undefined; +} +function isDeeplyReferencingType(node, superVar, visited) { + if (visited.has(node)) { + // something on the chain is circular but it's not the reference being checked + return false; + } + visited.add(node); + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSTypeLiteral: + return node.members.some(member => isDeeplyReferencingType(member, superVar, visited)); + case utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration: + return isDeeplyReferencingType(node.typeAnnotation, superVar, visited); + case utils_1.AST_NODE_TYPES.TSIndexedAccessType: + return [node.indexType, node.objectType].some(type => isDeeplyReferencingType(type, superVar, visited)); + case utils_1.AST_NODE_TYPES.TSConditionalType: + return [ + node.checkType, + node.extendsType, + node.falseType, + node.trueType, + ].some(type => isDeeplyReferencingType(type, superVar, visited)); + case utils_1.AST_NODE_TYPES.TSUnionType: + case utils_1.AST_NODE_TYPES.TSIntersectionType: + return node.types.some(type => isDeeplyReferencingType(type, superVar, visited)); + case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration: + return node.body.body.some(type => isDeeplyReferencingType(type, superVar, visited)); + case utils_1.AST_NODE_TYPES.TSTypeAnnotation: + return isDeeplyReferencingType(node.typeAnnotation, superVar, visited); + case utils_1.AST_NODE_TYPES.TSIndexSignature: { + if (node.typeAnnotation) { + return isDeeplyReferencingType(node.typeAnnotation, superVar, visited); + } + break; + } + case utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation: { + return node.params.some(param => isDeeplyReferencingType(param, superVar, visited)); + } + case utils_1.AST_NODE_TYPES.TSTypeReference: { + if (isDeeplyReferencingType(node.typeName, superVar, visited)) { + return true; + } + if (node.typeArguments && + isDeeplyReferencingType(node.typeArguments, superVar, visited)) { + return true; + } + break; + } + case utils_1.AST_NODE_TYPES.Identifier: { + // check if the identifier is a reference of the type being checked + if (superVar.references.some(ref => (0, util_1.isNodeEqual)(ref.identifier, node))) { + return true; + } + // otherwise, follow its definition(s) + const refVar = utils_1.ASTUtils.findVariable(superVar.scope, node.name); + if (refVar) { + return refVar.defs.some(def => isDeeplyReferencingType(def.node, superVar, visited)); + } + } + } + return false; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-return.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-return.d.ts.map new file mode 100644 index 0000000..2b666ac --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-return.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-return.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-return.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;;yCAoFkB,SAC1B,uBAAiB;qCAEf,SAAS,mBAAmB;oCAEZ,SAAU,kBACvB;0BACH,SAAG,eACT;EA5FqD,CAAC;AAExD,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;AAQtE,wBA2GG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-return.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-return.js new file mode 100644 index 0000000..73fa424 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-return.js @@ -0,0 +1,135 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('consistent-return'); +const defaultOptions = [{ treatUndefinedAsUnspecified: false }]; +exports.default = (0, util_1.createRule)({ + name: 'consistent-return', + meta: { + type: 'suggestion', + defaultOptions, + docs: { + description: 'Require `return` statements to either always or never specify values', + extendsBaseRule: true, + requiresTypeChecking: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions, + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const rules = baseRule.create(context); + const functions = []; + const treatUndefinedAsUnspecified = options?.treatUndefinedAsUnspecified === true; + function enterFunction(node) { + functions.push(node); + } + function exitFunction() { + functions.pop(); + } + function getCurrentFunction() { + return functions[functions.length - 1] ?? null; + } + function isPromiseVoid(node, type) { + if (tsutils.isThenableType(checker, node, type) && + tsutils.isTypeReference(type)) { + const awaitedType = type.typeArguments?.[0]; + if (awaitedType) { + if ((0, util_1.isTypeFlagSet)(awaitedType, ts.TypeFlags.Void)) { + return true; + } + return isPromiseVoid(node, awaitedType); + } + } + return false; + } + function isReturnVoidOrThenableVoid(node) { + const functionType = services.getTypeAtLocation(node); + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const callSignatures = functionType.getCallSignatures(); + return callSignatures.some(signature => { + const returnType = signature.getReturnType(); + if (node.async) { + return isPromiseVoid(tsNode, returnType); + } + return (0, util_1.isTypeFlagSet)(returnType, ts.TypeFlags.Void); + }); + } + return { + ...rules, + ArrowFunctionExpression: enterFunction, + 'ArrowFunctionExpression:exit'(node) { + exitFunction(); + rules['ArrowFunctionExpression:exit'](node); + }, + FunctionDeclaration: enterFunction, + 'FunctionDeclaration:exit'(node) { + exitFunction(); + rules['FunctionDeclaration:exit'](node); + }, + FunctionExpression: enterFunction, + 'FunctionExpression:exit'(node) { + exitFunction(); + rules['FunctionExpression:exit'](node); + }, + ReturnStatement(node) { + const functionNode = getCurrentFunction(); + if (!node.argument && + functionNode && + isReturnVoidOrThenableVoid(functionNode)) { + return; + } + if (treatUndefinedAsUnspecified && node.argument) { + const returnValueType = services.getTypeAtLocation(node.argument); + if (returnValueType.flags === ts.TypeFlags.Undefined) { + rules.ReturnStatement({ + ...node, + argument: null, + }); + return; + } + } + rules.ReturnStatement(node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.d.ts.map new file mode 100644 index 0000000..baf2401 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-type-assertions.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-type-assertions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAgBnE,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,IAAI,GACJ,OAAO,GACP,yCAAyC,GACzC,wCAAwC,GACxC,0CAA0C,GAC1C,yCAAyC,GACzC,8BAA8B,GAC9B,+BAA+B,CAAC;AACpC,KAAK,QAAQ,GACT;IACE,cAAc,EAAE,eAAe,GAAG,IAAI,CAAC;IACvC,2BAA2B,CAAC,EAAE,OAAO,GAAG,oBAAoB,GAAG,OAAO,CAAC;IACvE,0BAA0B,CAAC,EAAE,OAAO,GAAG,oBAAoB,GAAG,OAAO,CAAC;CACvE,GACD;IACE,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AACN,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;;AAM1C,wBA2TG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js new file mode 100644 index 0000000..fb941d4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js @@ -0,0 +1,256 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getWrappedCode_1 = require("../util/getWrappedCode"); +exports.default = (0, util_1.createRule)({ + name: 'consistent-type-assertions', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce consistent usage of type assertions', + recommended: 'stylistic', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + 'angle-bracket': "Use '<{{cast}}>' instead of 'as {{cast}}'.", + as: "Use 'as {{cast}}' instead of '<{{cast}}>'.", + never: 'Do not use any type assertions.', + replaceArrayTypeAssertionWithAnnotation: 'Use const x: {{cast}} = [ ... ] instead.', + replaceArrayTypeAssertionWithSatisfies: 'Use const x = [ ... ] satisfies {{cast}} instead.', + replaceObjectTypeAssertionWithAnnotation: 'Use const x: {{cast}} = { ... } instead.', + replaceObjectTypeAssertionWithSatisfies: 'Use const x = { ... } satisfies {{cast}} instead.', + unexpectedArrayTypeAssertion: 'Always prefer const x: T[] = [ ... ].', + unexpectedObjectTypeAssertion: 'Always prefer const x: T = { ... }.', + }, + schema: [ + { + oneOf: [ + { + type: 'object', + additionalProperties: false, + properties: { + assertionStyle: { + type: 'string', + description: 'The expected assertion style to enforce.', + enum: ['never'], + }, + }, + required: ['assertionStyle'], + }, + { + type: 'object', + additionalProperties: false, + properties: { + arrayLiteralTypeAssertions: { + type: 'string', + description: 'Whether to always prefer type declarations for array literals used as variable initializers, rather than type assertions.', + enum: ['allow', 'allow-as-parameter', 'never'], + }, + assertionStyle: { + type: 'string', + description: 'The expected assertion style to enforce.', + enum: ['as', 'angle-bracket'], + }, + objectLiteralTypeAssertions: { + type: 'string', + description: 'Whether to always prefer type declarations for object literals used as variable initializers, rather than type assertions.', + enum: ['allow', 'allow-as-parameter', 'never'], + }, + }, + }, + ], + }, + ], + }, + defaultOptions: [ + { + arrayLiteralTypeAssertions: 'allow', + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', + }, + ], + create(context, [options]) { + function isConst(node) { + if (node.type !== utils_1.AST_NODE_TYPES.TSTypeReference) { + return false; + } + return (node.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + node.typeName.name === 'const'); + } + function reportIncorrectAssertionType(node) { + const messageId = options.assertionStyle; + // If this node is `as const`, then don't report an error. + if (isConst(node.typeAnnotation) && messageId === 'never') { + return; + } + context.report({ + node, + messageId, + data: messageId !== 'never' + ? { cast: context.sourceCode.getText(node.typeAnnotation) } + : {}, + fix: messageId === 'as' + ? (fixer) => { + // lazily access parserServices to avoid crashing on non TS files (#9860) + const tsNode = (0, util_1.getParserServices)(context, true).esTreeNodeToTSNodeMap.get(node); + const expressionCode = context.sourceCode.getText(node.expression); + const typeAnnotationCode = context.sourceCode.getText(node.typeAnnotation); + const asPrecedence = (0, util_1.getOperatorPrecedence)(ts.SyntaxKind.AsExpression, ts.SyntaxKind.Unknown); + const parentPrecedence = (0, util_1.getOperatorPrecedence)(tsNode.parent.kind, ts.isBinaryExpression(tsNode.parent) + ? tsNode.parent.operatorToken.kind + : ts.SyntaxKind.Unknown, ts.isNewExpression(tsNode.parent) + ? tsNode.parent.arguments != null && + tsNode.parent.arguments.length > 0 + : undefined); + const expressionPrecedence = (0, util_1.getOperatorPrecedenceForNode)(node.expression); + const expressionCodeWrapped = (0, getWrappedCode_1.getWrappedCode)(expressionCode, expressionPrecedence, asPrecedence); + const text = `${expressionCodeWrapped} as ${typeAnnotationCode}`; + return fixer.replaceText(node, (0, util_1.isParenthesized)(node, context.sourceCode) + ? text + : (0, getWrappedCode_1.getWrappedCode)(text, asPrecedence, parentPrecedence)); + } + : undefined, + }); + } + function checkType(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + return false; + case utils_1.AST_NODE_TYPES.TSTypeReference: + return ( + // Ignore `as const` and `` + !isConst(node) || + // Allow qualified names which have dots between identifiers, `Foo.Bar` + node.typeName.type === utils_1.AST_NODE_TYPES.TSQualifiedName); + default: + return true; + } + } + function getSuggestions(node, annotationMessageId, satisfiesMessageId) { + const suggestions = []; + if (node.parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator && + !node.parent.id.typeAnnotation) { + const { parent } = node; + suggestions.push({ + messageId: annotationMessageId, + data: { cast: context.sourceCode.getText(node.typeAnnotation) }, + fix: fixer => [ + fixer.insertTextAfter(parent.id, `: ${context.sourceCode.getText(node.typeAnnotation)}`), + fixer.replaceText(node, (0, util_1.getTextWithParentheses)(context.sourceCode, node.expression)), + ], + }); + } + suggestions.push({ + messageId: satisfiesMessageId, + data: { cast: context.sourceCode.getText(node.typeAnnotation) }, + fix: fixer => [ + fixer.replaceText(node, (0, util_1.getTextWithParentheses)(context.sourceCode, node.expression)), + fixer.insertTextAfter(node, ` satisfies ${context.sourceCode.getText(node.typeAnnotation)}`), + ], + }); + return suggestions; + } + function isAsParameter(node) { + return (node.parent.type === utils_1.AST_NODE_TYPES.NewExpression || + node.parent.type === utils_1.AST_NODE_TYPES.CallExpression || + node.parent.type === utils_1.AST_NODE_TYPES.ThrowStatement || + node.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern || + node.parent.type === utils_1.AST_NODE_TYPES.JSXExpressionContainer || + (node.parent.type === utils_1.AST_NODE_TYPES.TemplateLiteral && + node.parent.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression)); + } + function checkExpressionForObjectAssertion(node) { + if (options.assertionStyle === 'never' || + options.objectLiteralTypeAssertions === 'allow' || + node.expression.type !== utils_1.AST_NODE_TYPES.ObjectExpression) { + return; + } + if (options.objectLiteralTypeAssertions === 'allow-as-parameter' && + isAsParameter(node)) { + return; + } + if (checkType(node.typeAnnotation)) { + const suggest = getSuggestions(node, 'replaceObjectTypeAssertionWithAnnotation', 'replaceObjectTypeAssertionWithSatisfies'); + context.report({ + node, + messageId: 'unexpectedObjectTypeAssertion', + suggest, + }); + } + } + function checkExpressionForArrayAssertion(node) { + if (options.assertionStyle === 'never' || + options.arrayLiteralTypeAssertions === 'allow' || + node.expression.type !== utils_1.AST_NODE_TYPES.ArrayExpression) { + return; + } + if (options.arrayLiteralTypeAssertions === 'allow-as-parameter' && + isAsParameter(node)) { + return; + } + if (checkType(node.typeAnnotation)) { + const suggest = getSuggestions(node, 'replaceArrayTypeAssertionWithAnnotation', 'replaceArrayTypeAssertionWithSatisfies'); + context.report({ + node, + messageId: 'unexpectedArrayTypeAssertion', + suggest, + }); + } + } + return { + TSAsExpression(node) { + if (options.assertionStyle !== 'as') { + reportIncorrectAssertionType(node); + return; + } + checkExpressionForObjectAssertion(node); + checkExpressionForArrayAssertion(node); + }, + TSTypeAssertion(node) { + if (options.assertionStyle !== 'angle-bracket') { + reportIncorrectAssertionType(node); + return; + } + checkExpressionForObjectAssertion(node); + checkExpressionForArrayAssertion(node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.d.ts.map new file mode 100644 index 0000000..cc490c4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-type-definitions.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-type-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAMnE,wBAkJG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js new file mode 100644 index 0000000..3669ecb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'consistent-type-definitions', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce type definitions to consistently use either `interface` or `type`', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + interfaceOverType: 'Use an `interface` instead of a `type`.', + typeOverInterface: 'Use a `type` instead of an `interface`.', + }, + schema: [ + { + type: 'string', + description: 'Which type definition syntax to prefer.', + enum: ['interface', 'type'], + }, + ], + }, + defaultOptions: ['interface'], + create(context, [option]) { + /** + * Iterates from the highest parent to the currently traversed node + * to determine whether any node in tree is globally declared module declaration + */ + function isCurrentlyTraversedNodeWithinModuleDeclaration(node) { + return context.sourceCode + .getAncestors(node) + .some(node => node.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration && + node.declare && + node.kind === 'global'); + } + return { + ...(option === 'interface' && { + "TSTypeAliasDeclaration[typeAnnotation.type='TSTypeLiteral']"(node) { + context.report({ + node: node.id, + messageId: 'interfaceOverType', + fix(fixer) { + const typeToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(node.id, token => token.value === 'type'), util_1.NullThrowsReasons.MissingToken('type keyword', 'type alias')); + const equalsToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(node.typeAnnotation, token => token.value === '='), util_1.NullThrowsReasons.MissingToken('=', 'type alias')); + const beforeEqualsToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(equalsToken, { + includeComments: true, + }), util_1.NullThrowsReasons.MissingToken('before =', 'type alias')); + return [ + // replace 'type' with 'interface'. + fixer.replaceText(typeToken, 'interface'), + // delete from the = to the { of the type, and put a space to be pretty. + fixer.replaceTextRange([beforeEqualsToken.range[1], node.typeAnnotation.range[0]], ' '), + // remove from the closing } through the end of the statement. + fixer.removeRange([ + node.typeAnnotation.range[1], + node.range[1], + ]), + ]; + }, + }); + }, + }), + ...(option === 'type' && { + TSInterfaceDeclaration(node) { + const fix = isCurrentlyTraversedNodeWithinModuleDeclaration(node) + ? null + : (fixer) => { + const typeNode = node.typeParameters ?? node.id; + const fixes = []; + const firstToken = context.sourceCode.getTokenBefore(node.id); + if (firstToken) { + fixes.push(fixer.replaceText(firstToken, 'type')); + fixes.push(fixer.replaceTextRange([typeNode.range[1], node.body.range[0]], ' = ')); + } + node.extends.forEach(heritage => { + const typeIdentifier = context.sourceCode.getText(heritage); + fixes.push(fixer.insertTextAfter(node.body, ` & ${typeIdentifier}`)); + }); + if (node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration) { + fixes.push(fixer.removeRange([node.parent.range[0], node.range[0]]), fixer.insertTextAfter(node.body, `\nexport default ${node.id.name}`)); + } + return fixes; + }; + context.report({ + node: node.id, + messageId: 'typeOverInterface', + /** + * remove automatically fix when the interface is within a declare global + * @see {@link https://github.com/typescript-eslint/typescript-eslint/issues/2707} + */ + fix, + }); + }, + }), + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-exports.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-exports.d.ts.map new file mode 100644 index 0000000..f351c49 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-exports.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-type-exports.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-type-exports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAgBnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,sCAAsC,EAAE,OAAO,CAAC;KACjD;CACF,CAAC;AAgBF,MAAM,MAAM,UAAU,GAClB,yBAAyB,GACzB,oBAAoB,GACpB,eAAe,CAAC;;AAEpB,wBAgSG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-exports.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-exports.js new file mode 100644 index 0000000..e06f26a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-exports.js @@ -0,0 +1,335 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'consistent-type-exports', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce consistent usage of type exports', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + multipleExportsAreTypes: 'Type exports {{exportNames}} are not values and should be exported using `export type`.', + singleExportIsType: 'Type export {{exportNames}} is not a value and should be exported using `export type`.', + typeOverValue: 'All exports in the declaration are only used as types. Use `export type`.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + fixMixedExportsWithInlineTypeSpecifier: { + type: 'boolean', + description: 'Whether the rule will autofix "mixed" export cases using TS inline type specifiers.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + fixMixedExportsWithInlineTypeSpecifier: false, + }, + ], + create(context, [{ fixMixedExportsWithInlineTypeSpecifier }]) { + const sourceExportsMap = {}; + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + /** + * Helper for identifying if a symbol resolves to a + * JavaScript value or a TypeScript type. + * + * @returns True/false if is a type or not, or undefined if the specifier + * can't be resolved. + */ + function isSymbolTypeBased(symbol) { + if (!symbol) { + return undefined; + } + const aliasedSymbol = tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : symbol; + if (checker.isUnknownSymbol(aliasedSymbol)) { + return undefined; + } + return !(aliasedSymbol.flags & ts.SymbolFlags.Value); + } + return { + ExportAllDeclaration(node) { + if (node.exportKind === 'type') { + return; + } + const sourceModule = ts.resolveModuleName(node.source.value, context.filename, services.program.getCompilerOptions(), ts.sys); + if (sourceModule.resolvedModule == null) { + return; + } + const sourceFile = services.program.getSourceFile(sourceModule.resolvedModule.resolvedFileName); + if (sourceFile == null) { + return; + } + const sourceFileSymbol = checker.getSymbolAtLocation(sourceFile); + if (sourceFileSymbol == null) { + return; + } + const sourceFileType = checker.getTypeOfSymbol(sourceFileSymbol); + // Module can explicitly export types or values, and it's not difficult + // to distinguish one from the other, since we can get the flags of + // the exported symbols or check if symbol export declaration has + // the "type" keyword in it. + // + // Things get a lot more complicated when we're dealing with + // export * from './module-with-type-only-exports' + // export type * from './module-with-type-and-value-exports' + // + // TS checker has an internal function getExportsOfModuleWorker that + // recursively visits all module exports, including "export *". It then + // puts type-only-star-exported symbols into the typeOnlyExportStarMap + // property of sourceFile's SymbolLinks. Since symbol links aren't + // exposed outside the checker, we cannot access it directly. + // + // Therefore, to filter out value properties, we use the following hack: + // checker.getPropertiesOfType returns all exports that were originally + // values, but checker.getPropertyOfType returns undefined for + // properties that are mentioned in the typeOnlyExportStarMap. + const isThereAnyExportedValue = checker + .getPropertiesOfType(sourceFileType) + .some(propertyTypeSymbol => checker.getPropertyOfType(sourceFileType, propertyTypeSymbol.escapedName.toString()) != null); + if (isThereAnyExportedValue) { + return; + } + context.report({ + node, + messageId: 'typeOverValue', + fix(fixer) { + const asteriskToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '*'), util_1.NullThrowsReasons.MissingToken('asterisk', 'export all declaration')); + return fixer.insertTextBefore(asteriskToken, 'type '); + }, + }); + }, + ExportNamedDeclaration(node) { + // Coerce the source into a string for use as a lookup entry. + const source = getSourceFromExport(node) ?? 'undefined'; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + const sourceExports = (sourceExportsMap[source] ||= { + reportValueExports: [], + source, + typeOnlyNamedExport: null, + valueOnlyNamedExport: null, + }); + // Cache the first encountered exports for the package. We will need to come + // back to these later when fixing the problems. + if (node.exportKind === 'type') { + if (sourceExports.typeOnlyNamedExport == null) { + // The export is a type export + sourceExports.typeOnlyNamedExport = node; + } + } + else if (sourceExports.valueOnlyNamedExport == null) { + // The export is a value export + sourceExports.valueOnlyNamedExport = node; + } + // Next for the current export, we will separate type/value specifiers. + const typeBasedSpecifiers = []; + const inlineTypeSpecifiers = []; + const valueSpecifiers = []; + // Note: it is valid to export values as types. We will avoid reporting errors + // when this is encountered. + if (node.exportKind !== 'type') { + for (const specifier of node.specifiers) { + if (specifier.exportKind === 'type') { + inlineTypeSpecifiers.push(specifier); + continue; + } + const isTypeBased = isSymbolTypeBased(services.getSymbolAtLocation(specifier.exported)); + if (isTypeBased === true) { + typeBasedSpecifiers.push(specifier); + } + else if (isTypeBased === false) { + // When isTypeBased is undefined, we should avoid reporting them. + valueSpecifiers.push(specifier); + } + } + } + if ((node.exportKind === 'value' && typeBasedSpecifiers.length) || + (node.exportKind === 'type' && valueSpecifiers.length)) { + sourceExports.reportValueExports.push({ + node, + inlineTypeSpecifiers, + typeBasedSpecifiers, + valueSpecifiers, + }); + } + }, + 'Program:exit'() { + for (const sourceExports of Object.values(sourceExportsMap)) { + // If this export has no issues, move on. + if (sourceExports.reportValueExports.length === 0) { + continue; + } + for (const report of sourceExports.reportValueExports) { + if (report.valueSpecifiers.length === 0) { + // Export is all type-only with no type specifiers; convert the entire export to `export type`. + context.report({ + node: report.node, + messageId: 'typeOverValue', + *fix(fixer) { + yield* fixExportInsertType(fixer, context.sourceCode, report.node); + }, + }); + continue; + } + // We have both type and value violations. + const allExportNames = report.typeBasedSpecifiers.map(specifier => specifier.local.type === utils_1.AST_NODE_TYPES.Identifier + ? specifier.local.name + : specifier.local.value); + if (allExportNames.length === 1) { + const exportNames = allExportNames[0]; + context.report({ + node: report.node, + messageId: 'singleExportIsType', + data: { exportNames }, + *fix(fixer) { + if (fixMixedExportsWithInlineTypeSpecifier) { + yield* fixAddTypeSpecifierToNamedExports(fixer, report); + } + else { + yield* fixSeparateNamedExports(fixer, context.sourceCode, report); + } + }, + }); + } + else { + const exportNames = (0, util_1.formatWordList)(allExportNames); + context.report({ + node: report.node, + messageId: 'multipleExportsAreTypes', + data: { exportNames }, + *fix(fixer) { + if (fixMixedExportsWithInlineTypeSpecifier) { + yield* fixAddTypeSpecifierToNamedExports(fixer, report); + } + else { + yield* fixSeparateNamedExports(fixer, context.sourceCode, report); + } + }, + }); + } + } + } + }, + }; + }, +}); +/** + * Inserts "type" into an export. + * + * Example: + * + * export type { Foo } from 'foo'; + * ^^^^ + */ +function* fixExportInsertType(fixer, sourceCode, node) { + const exportToken = (0, util_1.nullThrows)(sourceCode.getFirstToken(node), util_1.NullThrowsReasons.MissingToken('export', node.type)); + yield fixer.insertTextAfter(exportToken, ' type'); + for (const specifier of node.specifiers) { + if (specifier.exportKind === 'type') { + const kindToken = (0, util_1.nullThrows)(sourceCode.getFirstToken(specifier), util_1.NullThrowsReasons.MissingToken('export', specifier.type)); + const firstTokenAfter = (0, util_1.nullThrows)(sourceCode.getTokenAfter(kindToken, { + includeComments: true, + }), 'Missing token following the export kind.'); + yield fixer.removeRange([kindToken.range[0], firstTokenAfter.range[0]]); + } + } +} +/** + * Separates the exports which mismatch the kind of export the given + * node represents. For example, a type export's named specifiers which + * represent values will be inserted in a separate `export` statement. + */ +function* fixSeparateNamedExports(fixer, sourceCode, report) { + const { node, inlineTypeSpecifiers, typeBasedSpecifiers, valueSpecifiers } = report; + const typeSpecifiers = [...typeBasedSpecifiers, ...inlineTypeSpecifiers]; + const source = getSourceFromExport(node); + const specifierNames = typeSpecifiers.map(getSpecifierText).join(', '); + const exportToken = (0, util_1.nullThrows)(sourceCode.getFirstToken(node), util_1.NullThrowsReasons.MissingToken('export', node.type)); + // Filter the bad exports from the current line. + const filteredSpecifierNames = valueSpecifiers + .map(getSpecifierText) + .join(', '); + const openToken = (0, util_1.nullThrows)(sourceCode.getFirstToken(node, util_1.isOpeningBraceToken), util_1.NullThrowsReasons.MissingToken('{', node.type)); + const closeToken = (0, util_1.nullThrows)(sourceCode.getLastToken(node, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', node.type)); + // Remove exports from the current line which we're going to re-insert. + yield fixer.replaceTextRange([openToken.range[1], closeToken.range[0]], ` ${filteredSpecifierNames} `); + // Insert the bad exports into a new export line above. + yield fixer.insertTextBefore(exportToken, `export type { ${specifierNames} }${source ? ` from '${source}'` : ''};\n`); +} +function* fixAddTypeSpecifierToNamedExports(fixer, report) { + if (report.node.exportKind === 'type') { + return; + } + for (const specifier of report.typeBasedSpecifiers) { + yield fixer.insertTextBefore(specifier, 'type '); + } +} +/** + * Returns the source of the export, or undefined if the named export has no source. + */ +function getSourceFromExport(node) { + if (node.source?.type === utils_1.AST_NODE_TYPES.Literal && + typeof node.source.value === 'string') { + return node.source.value; + } + return undefined; +} +/** + * Returns the specifier text for the export. If it is aliased, we take care to return + * the proper formatting. + */ +function getSpecifierText(specifier) { + const exportedName = specifier.exported.type === utils_1.AST_NODE_TYPES.Literal + ? specifier.exported.raw + : specifier.exported.name; + const localName = specifier.local.type === utils_1.AST_NODE_TYPES.Literal + ? specifier.local.raw + : specifier.local.name; + return `${localName}${exportedName !== localName ? ` as ${exportedName}` : ''}`; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.d.ts.map new file mode 100644 index 0000000..096131a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-type-imports.d.ts","sourceRoot":"","sources":["../../src/rules/consistent-type-imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAkBnE,KAAK,MAAM,GAAG,iBAAiB,GAAG,cAAc,CAAC;AACjD,KAAK,QAAQ,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AAEhE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;CACF,CAAC;AAoBF,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,yBAAyB,GACzB,yBAAyB,GACzB,eAAe,CAAC;;AACpB,wBAw4BG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js new file mode 100644 index 0000000..6ff2015 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js @@ -0,0 +1,608 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'consistent-type-imports', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce consistent usage of type imports', + }, + fixable: 'code', + messages: { + avoidImportType: 'Use an `import` instead of an `import type`.', + noImportTypeAnnotations: '`import()` type annotations are forbidden.', + someImportsAreOnlyTypes: 'Imports {{typeImports}} are only used as type.', + typeOverValue: 'All imports in the declaration are only used as types. Use `import type`.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + disallowTypeAnnotations: { + type: 'boolean', + description: 'Whether to disallow type imports in type annotations (`import()`).', + }, + fixStyle: { + type: 'string', + description: 'The expected type modifier to be added when an import is detected as used only in the type position.', + enum: ['separate-type-imports', 'inline-type-imports'], + }, + prefer: { + type: 'string', + description: 'The expected import kind for type-only imports.', + enum: ['type-imports', 'no-type-imports'], + }, + }, + }, + ], + }, + defaultOptions: [ + { + disallowTypeAnnotations: true, + fixStyle: 'separate-type-imports', + prefer: 'type-imports', + }, + ], + create(context, [option]) { + const prefer = option.prefer ?? 'type-imports'; + const disallowTypeAnnotations = option.disallowTypeAnnotations !== false; + const selectors = {}; + if (disallowTypeAnnotations) { + selectors.TSImportType = (node) => { + context.report({ + node, + messageId: 'noImportTypeAnnotations', + }); + }; + } + if (prefer === 'no-type-imports') { + return { + ...selectors, + 'ImportDeclaration[importKind = "type"]'(node) { + context.report({ + node, + messageId: 'avoidImportType', + fix(fixer) { + return fixRemoveTypeSpecifierFromImportDeclaration(fixer, node); + }, + }); + }, + 'ImportSpecifier[importKind = "type"]'(node) { + context.report({ + node, + messageId: 'avoidImportType', + fix(fixer) { + return fixRemoveTypeSpecifierFromImportSpecifier(fixer, node); + }, + }); + }, + }; + } + // prefer type imports + const fixStyle = option.fixStyle ?? 'separate-type-imports'; + let hasDecoratorMetadata = false; + const sourceImportsMap = {}; + const emitDecoratorMetadata = (0, util_1.getParserServices)(context, true).emitDecoratorMetadata ?? false; + const experimentalDecorators = (0, util_1.getParserServices)(context, true).experimentalDecorators ?? false; + if (experimentalDecorators && emitDecoratorMetadata) { + selectors.Decorator = () => { + hasDecoratorMetadata = true; + }; + } + return { + ...selectors, + ImportDeclaration(node) { + const source = node.source.value; + // sourceImports is the object containing all the specifics for a particular import source, type or value + sourceImportsMap[source] ??= { + reportValueImports: [], // if there is a mismatch where type importKind but value specifiers + source, + typeOnlyNamedImport: null, // if only type imports + valueImport: null, // if only value imports + valueOnlyNamedImport: null, // if only value imports with named specifiers + }; + const sourceImports = sourceImportsMap[source]; + if (node.importKind === 'type') { + if (!sourceImports.typeOnlyNamedImport && + node.specifiers.every(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier)) { + // definitely import type { TypeX } + sourceImports.typeOnlyNamedImport = node; + } + } + else if (!sourceImports.valueOnlyNamedImport && + node.specifiers.length && + node.specifiers.every(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier)) { + sourceImports.valueOnlyNamedImport = node; + sourceImports.valueImport = node; + } + else if (!sourceImports.valueImport && + node.specifiers.some(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportDefaultSpecifier)) { + sourceImports.valueImport = node; + } + const typeSpecifiers = []; + const inlineTypeSpecifiers = []; + const valueSpecifiers = []; + const unusedSpecifiers = []; + for (const specifier of node.specifiers) { + if (specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier && + specifier.importKind === 'type') { + inlineTypeSpecifiers.push(specifier); + continue; + } + const [variable] = context.sourceCode.getDeclaredVariables(specifier); + if (variable.references.length === 0) { + unusedSpecifiers.push(specifier); + } + else { + const onlyHasTypeReferences = variable.references.every(ref => { + /** + * keep origin import kind when export + * export { Type } + * export default Type; + * export = Type; + */ + if ((ref.identifier.parent.type === + utils_1.AST_NODE_TYPES.ExportSpecifier || + ref.identifier.parent.type === + utils_1.AST_NODE_TYPES.ExportDefaultDeclaration || + ref.identifier.parent.type === + utils_1.AST_NODE_TYPES.TSExportAssignment) && + ref.isValueReference && + ref.isTypeReference) { + return node.importKind === 'type'; + } + if (ref.isValueReference) { + let parent = ref.identifier.parent; + let child = ref.identifier; + while (parent) { + switch (parent.type) { + // CASE 1: + // `type T = typeof foo` will create a value reference because "foo" must be a value type + // however this value reference is safe to use with type-only imports + case utils_1.AST_NODE_TYPES.TSTypeQuery: + return true; + case utils_1.AST_NODE_TYPES.TSQualifiedName: + // TSTypeQuery must have a TSESTree.EntityName as its child, so we can filter here and break early + if (parent.left !== child) { + return false; + } + child = parent; + parent = parent.parent; + continue; + // END CASE 1 + ////////////// + // CASE 2: + // `type T = { [foo]: string }` will create a value reference because "foo" must be a value type + // however this value reference is safe to use with type-only imports. + // Also this is represented as a non-type AST - hence it uses MemberExpression + case utils_1.AST_NODE_TYPES.TSPropertySignature: + return parent.key === child; + case utils_1.AST_NODE_TYPES.MemberExpression: + if (parent.object !== child) { + return false; + } + child = parent; + parent = parent.parent; + continue; + // END CASE 2 + default: + return false; + } + } + } + return ref.isTypeReference; + }); + if (onlyHasTypeReferences) { + typeSpecifiers.push(specifier); + } + else { + valueSpecifiers.push(specifier); + } + } + } + if (node.importKind === 'value' && typeSpecifiers.length) { + sourceImports.reportValueImports.push({ + node, + inlineTypeSpecifiers, + typeSpecifiers, + unusedSpecifiers, + valueSpecifiers, + }); + } + }, + 'Program:exit'() { + if (hasDecoratorMetadata) { + // Experimental decorator metadata is bowl of poop that cannot be + // supported based on pure syntactic analysis. + // + // So we can do one of two things: + // 1) add type-information to the rule in a breaking change and + // prevent users from using it so that we can fully support this + // case. + // 2) make the rule ignore all imports that are used in a file that + // might have decorator metadata. + // + // (1) is has huge impact and prevents the rule from being used by 99% + // of users Frankly - it's a straight-up bad option. So instead we + // choose with option (2) and just avoid reporting on any imports in a + // file with both emitDecoratorMetadata AND decorators + // + // For more context see the discussion in this issue and its linked + // issues: + // https://github.com/typescript-eslint/typescript-eslint/issues/5468 + // + // + // NOTE - in TS 5.0 `experimentalDecorators` became the legacy option, + // replaced with un-flagged, stable decorators and thus the type-aware + // emitDecoratorMetadata implementation also became legacy. in TS 5.2 + // support for the new, stable decorator metadata proposal was added - + // however this proposal does not include type information + // + // + // PHEW. So TL;DR what does all this mean? + // - if you use experimentalDecorators:true, + // emitDecoratorMetadata:true, and have a decorator in the file - + // the rule will do nothing in the file out of an abundance of + // caution. + // - else the rule will work as normal. + return; + } + for (const sourceImports of Object.values(sourceImportsMap)) { + if (sourceImports.reportValueImports.length === 0) { + // nothing to fix. value specifiers and type specifiers are correctly written + continue; + } + for (const report of sourceImports.reportValueImports) { + if (report.valueSpecifiers.length === 0 && + report.unusedSpecifiers.length === 0 && + report.node.importKind !== 'type') { + /** + * checks if import has type assertions + * @example + * ```ts + * import * as type from 'mod' assert \{ type: 'json' \}; + * ``` + * https://github.com/typescript-eslint/typescript-eslint/issues/7527 + */ + if (report.node.attributes.length === 0) { + context.report({ + node: report.node, + messageId: 'typeOverValue', + *fix(fixer) { + yield* fixToTypeImportDeclaration(fixer, report, sourceImports); + }, + }); + } + } + else { + // we have a mixed type/value import or just value imports, so we need to split them out into multiple imports if separate-type-imports is configured + const importNames = report.typeSpecifiers.map(specifier => `"${specifier.local.name}"`); + const message = (() => { + const typeImports = (0, util_1.formatWordList)(importNames); + if (importNames.length === 1) { + return { + messageId: 'someImportsAreOnlyTypes', + data: { + typeImports, + }, + }; + } + return { + messageId: 'someImportsAreOnlyTypes', + data: { + typeImports, + }, + }; + })(); + context.report({ + node: report.node, + ...message, + *fix(fixer) { + // take all the typeSpecifiers and put them on a new line + yield* fixToTypeImportDeclaration(fixer, report, sourceImports); + }, + }); + } + } + } + }, + }; + function classifySpecifier(node) { + const defaultSpecifier = node.specifiers[0].type === utils_1.AST_NODE_TYPES.ImportDefaultSpecifier + ? node.specifiers[0] + : null; + const namespaceSpecifier = node.specifiers.find((specifier) => specifier.type === utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier) ?? null; + const namedSpecifiers = node.specifiers.filter((specifier) => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier); + return { + defaultSpecifier, + namedSpecifiers, + namespaceSpecifier, + }; + } + /** + * Returns information for fixing named specifiers, type or value + */ + function getFixesNamedSpecifiers(fixer, node, subsetNamedSpecifiers, allNamedSpecifiers) { + if (allNamedSpecifiers.length === 0) { + return { + removeTypeNamedSpecifiers: [], + typeNamedSpecifiersText: '', + }; + } + const typeNamedSpecifiersTexts = []; + const removeTypeNamedSpecifiers = []; + if (subsetNamedSpecifiers.length === allNamedSpecifiers.length) { + // import Foo, {Type1, Type2} from 'foo' + // import DefType, {Type1, Type2} from 'foo' + const openingBraceToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(subsetNamedSpecifiers[0], util_1.isOpeningBraceToken), util_1.NullThrowsReasons.MissingToken('{', node.type)); + const commaToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(openingBraceToken, util_1.isCommaToken), util_1.NullThrowsReasons.MissingToken(',', node.type)); + const closingBraceToken = (0, util_1.nullThrows)(context.sourceCode.getFirstTokenBetween(openingBraceToken, node.source, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', node.type)); + // import DefType, {...} from 'foo' + // ^^^^^^^ remove + removeTypeNamedSpecifiers.push(fixer.removeRange([commaToken.range[0], closingBraceToken.range[1]])); + typeNamedSpecifiersTexts.push(context.sourceCode.text.slice(openingBraceToken.range[1], closingBraceToken.range[0])); + } + else { + const namedSpecifierGroups = []; + let group = []; + for (const namedSpecifier of allNamedSpecifiers) { + if (subsetNamedSpecifiers.includes(namedSpecifier)) { + group.push(namedSpecifier); + } + else if (group.length) { + namedSpecifierGroups.push(group); + group = []; + } + } + if (group.length) { + namedSpecifierGroups.push(group); + } + for (const namedSpecifiers of namedSpecifierGroups) { + const { removeRange, textRange } = getNamedSpecifierRanges(namedSpecifiers, allNamedSpecifiers); + removeTypeNamedSpecifiers.push(fixer.removeRange(removeRange)); + typeNamedSpecifiersTexts.push(context.sourceCode.text.slice(...textRange)); + } + } + return { + removeTypeNamedSpecifiers, + typeNamedSpecifiersText: typeNamedSpecifiersTexts.join(','), + }; + } + /** + * Returns ranges for fixing named specifier. + */ + function getNamedSpecifierRanges(namedSpecifierGroup, allNamedSpecifiers) { + const first = namedSpecifierGroup[0]; + const last = namedSpecifierGroup[namedSpecifierGroup.length - 1]; + const removeRange = [first.range[0], last.range[1]]; + const textRange = [...removeRange]; + const before = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(first), util_1.NullThrowsReasons.MissingToken('token', 'first specifier')); + textRange[0] = before.range[1]; + if ((0, util_1.isCommaToken)(before)) { + removeRange[0] = before.range[0]; + } + else { + removeRange[0] = before.range[1]; + } + const isFirst = allNamedSpecifiers[0] === first; + const isLast = allNamedSpecifiers[allNamedSpecifiers.length - 1] === last; + const after = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(last), util_1.NullThrowsReasons.MissingToken('token', 'last specifier')); + textRange[1] = after.range[0]; + if ((isFirst || isLast) && (0, util_1.isCommaToken)(after)) { + removeRange[1] = after.range[1]; + } + return { + removeRange, + textRange, + }; + } + /** + * insert specifiers to named import node. + * e.g. + * import type { Already, Type1, Type2 } from 'foo' + * ^^^^^^^^^^^^^ insert + */ + function fixInsertNamedSpecifiersInNamedSpecifierList(fixer, target, insertText) { + const closingBraceToken = (0, util_1.nullThrows)(context.sourceCode.getFirstTokenBetween((0, util_1.nullThrows)(context.sourceCode.getFirstToken(target), util_1.NullThrowsReasons.MissingToken('token before', 'import')), target.source, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', target.type)); + const before = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(closingBraceToken), util_1.NullThrowsReasons.MissingToken('token before', 'closing brace')); + if (!(0, util_1.isCommaToken)(before) && !(0, util_1.isOpeningBraceToken)(before)) { + insertText = `,${insertText}`; + } + return fixer.insertTextBefore(closingBraceToken, insertText); + } + /** + * insert type keyword to named import node. + * e.g. + * import ADefault, { Already, type Type1, type Type2 } from 'foo' + * ^^^^ insert + */ + function* fixInsertTypeKeywordInNamedSpecifierList(fixer, typeSpecifiers) { + for (const spec of typeSpecifiers) { + const insertText = context.sourceCode.text.slice(...spec.range); + yield fixer.replaceTextRange(spec.range, `type ${insertText}`); + } + } + function* fixInlineTypeImportDeclaration(fixer, report, sourceImports) { + const { node } = report; + // For a value import, will only add an inline type to named specifiers + const { namedSpecifiers } = classifySpecifier(node); + const typeNamedSpecifiers = namedSpecifiers.filter(specifier => report.typeSpecifiers.includes(specifier)); + if (sourceImports.valueImport) { + // add import named type specifiers to its value import + // import ValueA, { type A } + // ^^^^ insert + const { namedSpecifiers: valueImportNamedSpecifiers } = classifySpecifier(sourceImports.valueImport); + if (sourceImports.valueOnlyNamedImport || + valueImportNamedSpecifiers.length) { + yield* fixInsertTypeKeywordInNamedSpecifierList(fixer, typeNamedSpecifiers); + } + } + } + function* fixToTypeImportDeclaration(fixer, report, sourceImports) { + const { node } = report; + const { defaultSpecifier, namedSpecifiers, namespaceSpecifier } = classifySpecifier(node); + if (namespaceSpecifier && !defaultSpecifier) { + // import * as types from 'foo' + // checks for presence of import assertions + if (node.attributes.length === 0) { + yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, false); + } + return; + } + if (defaultSpecifier) { + if (report.typeSpecifiers.includes(defaultSpecifier) && + namedSpecifiers.length === 0 && + !namespaceSpecifier) { + // import Type from 'foo' + yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, true); + return; + } + if (fixStyle === 'inline-type-imports' && + !report.typeSpecifiers.includes(defaultSpecifier) && + namedSpecifiers.length > 0 && + !namespaceSpecifier) { + // if there is a default specifier but it isn't a type specifier, then just add the inline type modifier to the named specifiers + // import AValue, {BValue, Type1, Type2} from 'foo' + yield* fixInlineTypeImportDeclaration(fixer, report, sourceImports); + return; + } + } + else if (!namespaceSpecifier) { + if (fixStyle === 'inline-type-imports' && + namedSpecifiers.some(specifier => report.typeSpecifiers.includes(specifier))) { + // import {AValue, Type1, Type2} from 'foo' + yield* fixInlineTypeImportDeclaration(fixer, report, sourceImports); + return; + } + if (namedSpecifiers.every(specifier => report.typeSpecifiers.includes(specifier))) { + // import {Type1, Type2} from 'foo' + yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, false); + return; + } + } + const typeNamedSpecifiers = namedSpecifiers.filter(specifier => report.typeSpecifiers.includes(specifier)); + const fixesNamedSpecifiers = getFixesNamedSpecifiers(fixer, node, typeNamedSpecifiers, namedSpecifiers); + const afterFixes = []; + if (typeNamedSpecifiers.length) { + if (sourceImports.typeOnlyNamedImport) { + const insertTypeNamedSpecifiers = fixInsertNamedSpecifiersInNamedSpecifierList(fixer, sourceImports.typeOnlyNamedImport, fixesNamedSpecifiers.typeNamedSpecifiersText); + if (sourceImports.typeOnlyNamedImport.range[1] <= node.range[0]) { + yield insertTypeNamedSpecifiers; + } + else { + afterFixes.push(insertTypeNamedSpecifiers); + } + } + else { + // The import is both default and named. Insert named on new line because can't mix default type import and named type imports + // eslint-disable-next-line no-lonely-if + if (fixStyle === 'inline-type-imports') { + yield fixer.insertTextBefore(node, `import {${typeNamedSpecifiers + .map(spec => { + const insertText = context.sourceCode.text.slice(...spec.range); + return `type ${insertText}`; + }) + .join(', ')}} from ${context.sourceCode.getText(node.source)};\n`); + } + else { + yield fixer.insertTextBefore(node, `import type {${fixesNamedSpecifiers.typeNamedSpecifiersText}} from ${context.sourceCode.getText(node.source)};\n`); + } + } + } + const fixesRemoveTypeNamespaceSpecifier = []; + if (namespaceSpecifier && + report.typeSpecifiers.includes(namespaceSpecifier)) { + // import Foo, * as Type from 'foo' + // import DefType, * as Type from 'foo' + // import DefType, * as Type from 'foo' + const commaToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(namespaceSpecifier, util_1.isCommaToken), util_1.NullThrowsReasons.MissingToken(',', node.type)); + // import Def, * as Ns from 'foo' + // ^^^^^^^^^ remove + fixesRemoveTypeNamespaceSpecifier.push(fixer.removeRange([commaToken.range[0], namespaceSpecifier.range[1]])); + // import type * as Ns from 'foo' + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ insert + yield fixer.insertTextBefore(node, `import type ${context.sourceCode.getText(namespaceSpecifier)} from ${context.sourceCode.getText(node.source)};\n`); + } + if (defaultSpecifier && + report.typeSpecifiers.includes(defaultSpecifier)) { + if (report.typeSpecifiers.length === node.specifiers.length) { + const importToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import', node.type)); + // import type Type from 'foo' + // ^^^^ insert + yield fixer.insertTextAfter(importToken, ' type'); + } + else { + const commaToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(defaultSpecifier, util_1.isCommaToken), util_1.NullThrowsReasons.MissingToken(',', defaultSpecifier.type)); + // import Type , {...} from 'foo' + // ^^^^^ pick + const defaultText = context.sourceCode.text + .slice(defaultSpecifier.range[0], commaToken.range[0]) + .trim(); + yield fixer.insertTextBefore(node, `import type ${defaultText} from ${context.sourceCode.getText(node.source)};\n`); + const afterToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(commaToken, { + includeComments: true, + }), util_1.NullThrowsReasons.MissingToken('any token', node.type)); + // import Type , {...} from 'foo' + // ^^^^^^^ remove + yield fixer.removeRange([ + defaultSpecifier.range[0], + afterToken.range[0], + ]); + } + } + yield* fixesNamedSpecifiers.removeTypeNamedSpecifiers; + yield* fixesRemoveTypeNamespaceSpecifier; + yield* afterFixes; + } + function* fixInsertTypeSpecifierForImportDeclaration(fixer, node, isDefaultImport) { + // import type Foo from 'foo' + // ^^^^^ insert + const importToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import', node.type)); + yield fixer.insertTextAfter(importToken, ' type'); + if (isDefaultImport) { + // Has default import + const openingBraceToken = context.sourceCode.getFirstTokenBetween(importToken, node.source, util_1.isOpeningBraceToken); + if (openingBraceToken) { + // Only braces. e.g. import Foo, {} from 'foo' + const commaToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(openingBraceToken, util_1.isCommaToken), util_1.NullThrowsReasons.MissingToken(',', node.type)); + const closingBraceToken = (0, util_1.nullThrows)(context.sourceCode.getFirstTokenBetween(openingBraceToken, node.source, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', node.type)); + // import type Foo, {} from 'foo' + // ^^ remove + yield fixer.removeRange([ + commaToken.range[0], + closingBraceToken.range[1], + ]); + const specifiersText = context.sourceCode.text.slice(commaToken.range[1], closingBraceToken.range[1]); + if (node.specifiers.length > 1) { + yield fixer.insertTextAfter(node, `\nimport type${specifiersText} from ${context.sourceCode.getText(node.source)};`); + } + } + } + // make sure we don't do anything like `import type {type T} from 'foo';` + for (const specifier of node.specifiers) { + if (specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier && + specifier.importKind === 'type') { + yield* fixRemoveTypeSpecifierFromImportSpecifier(fixer, specifier); + } + } + } + function* fixRemoveTypeSpecifierFromImportDeclaration(fixer, node) { + // import type Foo from 'foo' + // ^^^^ remove + const importToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import', node.type)); + const typeToken = (0, util_1.nullThrows)(context.sourceCode.getFirstTokenBetween(importToken, node.specifiers[0]?.local ?? node.source, util_1.isTypeKeyword), util_1.NullThrowsReasons.MissingToken('type', node.type)); + const afterToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(typeToken, { includeComments: true }), util_1.NullThrowsReasons.MissingToken('any token', node.type)); + yield fixer.removeRange([typeToken.range[0], afterToken.range[0]]); + } + function* fixRemoveTypeSpecifierFromImportSpecifier(fixer, node) { + // import { type Foo } from 'foo' + // ^^^^ remove + const typeToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isTypeKeyword), util_1.NullThrowsReasons.MissingToken('type', node.type)); + const afterToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(typeToken, { includeComments: true }), util_1.NullThrowsReasons.MissingToken('any token', node.type)); + yield fixer.removeRange([typeToken.range[0], afterToken.range[0]]); + } + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.d.ts.map new file mode 100644 index 0000000..bfa4bf4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"default-param-last.d.ts","sourceRoot":"","sources":["../../src/rules/default-param-last.ts"],"names":[],"mappings":";AAMA,wBA+EG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js new file mode 100644 index 0000000..15f6971 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'default-param-last', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce default parameters to be last', + extendsBaseRule: true, + }, + messages: { + shouldBeLast: 'Default parameters should be last.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * checks if node is optional parameter + * @param node the node to be evaluated + * @private + */ + function isOptionalParam(node) { + return ((node.type === utils_1.AST_NODE_TYPES.ArrayPattern || + node.type === utils_1.AST_NODE_TYPES.AssignmentPattern || + node.type === utils_1.AST_NODE_TYPES.Identifier || + node.type === utils_1.AST_NODE_TYPES.ObjectPattern || + node.type === utils_1.AST_NODE_TYPES.RestElement) && + node.optional); + } + /** + * checks if node is plain parameter + * @param node the node to be evaluated + * @private + */ + function isPlainParam(node) { + return !(node.type === utils_1.AST_NODE_TYPES.AssignmentPattern || + node.type === utils_1.AST_NODE_TYPES.RestElement || + isOptionalParam(node)); + } + function checkDefaultParamLast(node) { + let hasSeenPlainParam = false; + for (let i = node.params.length - 1; i >= 0; i--) { + const current = node.params[i]; + const param = current.type === utils_1.AST_NODE_TYPES.TSParameterProperty + ? current.parameter + : current; + if (isPlainParam(param)) { + hasSeenPlainParam = true; + continue; + } + if (hasSeenPlainParam && + (isOptionalParam(param) || + param.type === utils_1.AST_NODE_TYPES.AssignmentPattern)) { + context.report({ node: current, messageId: 'shouldBeLast' }); + } + } + } + return { + ArrowFunctionExpression: checkDefaultParamLast, + FunctionDeclaration: checkDefaultParamLast, + FunctionExpression: checkDefaultParamLast, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.d.ts.map new file mode 100644 index 0000000..566c795 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dot-notation.d.ts","sourceRoot":"","sources":["../../src/rules/dot-notation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;;;;;;2BAoI4gP,SAAU,gBAAgB;EApIlgP,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;;;;;AAYtE,wBAoHG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js new file mode 100644 index 0000000..a9dcbda --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js @@ -0,0 +1,143 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('dot-notation'); +const defaultOptions = [ + { + allowIndexSignaturePropertyAccess: false, + allowKeywords: true, + allowPattern: '', + allowPrivateClassPropertyAccess: false, + allowProtectedClassPropertyAccess: false, + }, +]; +exports.default = (0, util_1.createRule)({ + name: 'dot-notation', + meta: { + type: 'suggestion', + defaultOptions, + docs: { + description: 'Enforce dot notation whenever possible', + extendsBaseRule: true, + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: baseRule.meta.fixable, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowIndexSignaturePropertyAccess: { + type: 'boolean', + default: false, + description: 'Whether to allow accessing properties matching an index signature with array notation.', + }, + allowKeywords: { + type: 'boolean', + default: true, + description: 'Whether to allow keywords such as ["class"]`.', + }, + allowPattern: { + type: 'string', + default: '', + description: 'Regular expression of names to allow.', + }, + allowPrivateClassPropertyAccess: { + type: 'boolean', + default: false, + description: 'Whether to allow accessing class members marked as `private` with array notation.', + }, + allowProtectedClassPropertyAccess: { + type: 'boolean', + default: false, + description: 'Whether to allow accessing class members marked as `protected` with array notation.', + }, + }, + }, + ], + }, + defaultOptions, + create(context, [options]) { + const rules = baseRule.create(context); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const allowPrivateClassPropertyAccess = options.allowPrivateClassPropertyAccess; + const allowProtectedClassPropertyAccess = options.allowProtectedClassPropertyAccess; + const allowIndexSignaturePropertyAccess = (options.allowIndexSignaturePropertyAccess ?? false) || + tsutils.isCompilerOptionEnabled(services.program.getCompilerOptions(), 'noPropertyAccessFromIndexSignature'); + return { + MemberExpression(node) { + if ((allowPrivateClassPropertyAccess || + allowProtectedClassPropertyAccess || + allowIndexSignaturePropertyAccess) && + node.computed) { + // for perf reasons - only fetch symbols if we have to + const propertySymbol = services.getSymbolAtLocation(node.property) ?? + services + .getTypeAtLocation(node.object) + .getNonNullableType() + .getProperties() + .find(propertySymbol => node.property.type === utils_1.AST_NODE_TYPES.Literal && + propertySymbol.escapedName === node.property.value); + const modifierKind = (0, util_1.getModifiers)(propertySymbol?.getDeclarations()?.[0])?.[0].kind; + if ((allowPrivateClassPropertyAccess && + modifierKind === ts.SyntaxKind.PrivateKeyword) || + (allowProtectedClassPropertyAccess && + modifierKind === ts.SyntaxKind.ProtectedKeyword)) { + return; + } + if (propertySymbol == null && allowIndexSignaturePropertyAccess) { + const objectType = services + .getTypeAtLocation(node.object) + .getNonNullableType(); + const indexInfos = checker.getIndexInfosOfType(objectType); + if (indexInfos.some(info => info.keyType.flags & ts.TypeFlags.StringLike)) { + return; + } + } + } + rules.MemberExpression(node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/enum-utils/shared.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/enum-utils/shared.d.ts.map new file mode 100644 index 0000000..708c30b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/enum-utils/shared.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/rules/enum-utils/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAwBjC;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,WAAW,EAAE,CAM/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,EAAE,CAAC,WAAW,EAC3B,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,EAAE,CAAC,IAAI,EAAE,CAEX;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,EAAE,CAAC,WAAW,EAAE,EAC9B,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,IAAI,CA+Bf"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/enum-utils/shared.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/enum-utils/shared.js new file mode 100644 index 0000000..10601af --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/enum-utils/shared.js @@ -0,0 +1,121 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEnumLiterals = getEnumLiterals; +exports.getEnumTypes = getEnumTypes; +exports.getEnumKeyForLiteral = getEnumKeyForLiteral; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../../util"); +/* + * If passed an enum member, returns the type of the parent. Otherwise, + * returns itself. + * + * For example: + * - `Fruit` --> `Fruit` + * - `Fruit.Apple` --> `Fruit` + */ +function getBaseEnumType(typeChecker, type) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const symbol = type.getSymbol(); + if (!tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.EnumMember)) { + return type; + } + return typeChecker.getTypeAtLocation(symbol.valueDeclaration.parent); +} +/** + * Retrieve only the Enum literals from a type. for example: + * - 123 --> [] + * - {} --> [] + * - Fruit.Apple --> [Fruit.Apple] + * - Fruit.Apple | Vegetable.Lettuce --> [Fruit.Apple, Vegetable.Lettuce] + * - Fruit.Apple | Vegetable.Lettuce | 123 --> [Fruit.Apple, Vegetable.Lettuce] + * - T extends Fruit --> [Fruit] + */ +function getEnumLiterals(type) { + return tsutils + .unionTypeParts(type) + .filter((subType) => (0, util_1.isTypeFlagSet)(subType, ts.TypeFlags.EnumLiteral)); +} +/** + * A type can have 0 or more enum types. For example: + * - 123 --> [] + * - {} --> [] + * - Fruit.Apple --> [Fruit] + * - Fruit.Apple | Vegetable.Lettuce --> [Fruit, Vegetable] + * - Fruit.Apple | Vegetable.Lettuce | 123 --> [Fruit, Vegetable] + * - T extends Fruit --> [Fruit] + */ +function getEnumTypes(typeChecker, type) { + return getEnumLiterals(type).map(type => getBaseEnumType(typeChecker, type)); +} +/** + * Returns the enum key that matches the given literal node, or null if none + * match. For example: + * ```ts + * enum Fruit { + * Apple = 'apple', + * Banana = 'banana', + * } + * + * getEnumKeyForLiteral([Fruit.Apple, Fruit.Banana], 'apple') --> 'Fruit.Apple' + * getEnumKeyForLiteral([Fruit.Apple, Fruit.Banana], 'banana') --> 'Fruit.Banana' + * getEnumKeyForLiteral([Fruit.Apple, Fruit.Banana], 'cherry') --> null + * ``` + */ +function getEnumKeyForLiteral(enumLiterals, literal) { + for (const enumLiteral of enumLiterals) { + if (enumLiteral.value === literal) { + const { symbol } = enumLiteral; + const memberDeclaration = symbol.valueDeclaration; + const enumDeclaration = memberDeclaration.parent; + const memberNameIdentifier = memberDeclaration.name; + const enumName = enumDeclaration.name.text; + switch (memberNameIdentifier.kind) { + case ts.SyntaxKind.Identifier: + return `${enumName}.${memberNameIdentifier.text}`; + case ts.SyntaxKind.StringLiteral: { + const memberName = memberNameIdentifier.text.replaceAll("'", "\\'"); + return `${enumName}['${memberName}']`; + } + case ts.SyntaxKind.ComputedPropertyName: + return `${enumName}[${memberNameIdentifier.expression.getText()}]`; + default: + break; + } + } + } + return null; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.d.ts.map new file mode 100644 index 0000000..253270f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"explicit-function-return-type.d.ts","sourceRoot":"","sources":["../../src/rules/explicit-function-return-type.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,oDAAoD,CAAC,EAAE,OAAO,CAAC;QAC/D,yCAAyC,CAAC,EAAE,OAAO,CAAC;QACpD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,mCAAmC,CAAC,EAAE,OAAO,CAAC;QAC9C,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,6BAA6B,CAAC,EAAE,OAAO,CAAC;KACzC;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC;;AAO7C,wBAiOG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js new file mode 100644 index 0000000..5ca3550 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js @@ -0,0 +1,179 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const explicitReturnTypeUtils_1 = require("../util/explicitReturnTypeUtils"); +exports.default = (0, util_1.createRule)({ + name: 'explicit-function-return-type', + meta: { + type: 'problem', + docs: { + description: 'Require explicit return types on functions and class methods', + }, + messages: { + missingReturnType: 'Missing return type on function.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowConciseArrowFunctionExpressionsStartingWithVoid: { + type: 'boolean', + description: 'Whether to allow arrow functions that start with the `void` keyword.', + }, + allowDirectConstAssertionInArrowFunctions: { + type: 'boolean', + description: 'Whether to ignore arrow functions immediately returning a `as const` value.', + }, + allowedNames: { + type: 'array', + description: 'An array of function/method names that will not have their arguments or return values checked.', + items: { + type: 'string', + }, + }, + allowExpressions: { + type: 'boolean', + description: 'Whether to ignore function expressions (functions which are not part of a declaration).', + }, + allowFunctionsWithoutTypeParameters: { + type: 'boolean', + description: "Whether to ignore functions that don't have generic type parameters.", + }, + allowHigherOrderFunctions: { + type: 'boolean', + description: 'Whether to ignore functions immediately returning another function expression.', + }, + allowIIFEs: { + type: 'boolean', + description: 'Whether to ignore immediately invoked function expressions (IIFEs).', + }, + allowTypedFunctionExpressions: { + type: 'boolean', + description: 'Whether to ignore type annotations on the variable of function expressions.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowConciseArrowFunctionExpressionsStartingWithVoid: false, + allowDirectConstAssertionInArrowFunctions: true, + allowedNames: [], + allowExpressions: false, + allowFunctionsWithoutTypeParameters: false, + allowHigherOrderFunctions: true, + allowIIFEs: false, + allowTypedFunctionExpressions: true, + }, + ], + create(context, [options]) { + const functionInfoStack = []; + function enterFunction(node) { + functionInfoStack.push({ + node, + returns: [], + }); + } + function popFunctionInfo(exitNodeType) { + return (0, util_1.nullThrows)(functionInfoStack.pop(), `Stack should exist on ${exitNodeType} exit`); + } + function isAllowedFunction(node) { + if (options.allowFunctionsWithoutTypeParameters && !node.typeParameters) { + return true; + } + if (options.allowIIFEs && isIIFE(node)) { + return true; + } + if (!options.allowedNames?.length) { + return false; + } + if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + node.type === utils_1.AST_NODE_TYPES.FunctionExpression) { + const parent = node.parent; + let funcName; + if (node.id?.name) { + funcName = node.id.name; + } + else { + switch (parent.type) { + case utils_1.AST_NODE_TYPES.VariableDeclarator: { + if (parent.id.type === utils_1.AST_NODE_TYPES.Identifier) { + funcName = parent.id.name; + } + break; + } + case utils_1.AST_NODE_TYPES.MethodDefinition: + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.Property: { + if (parent.key.type === utils_1.AST_NODE_TYPES.Identifier && + !parent.computed) { + funcName = parent.key.name; + } + break; + } + } + } + if (!!funcName && !!options.allowedNames.includes(funcName)) { + return true; + } + } + if (node.type === utils_1.AST_NODE_TYPES.FunctionDeclaration && + node.id && + !!options.allowedNames.includes(node.id.name)) { + return true; + } + return false; + } + function isIIFE(node) { + return node.parent.type === utils_1.AST_NODE_TYPES.CallExpression; + } + function exitFunctionExpression(node) { + const info = popFunctionInfo('function expression'); + if (options.allowConciseArrowFunctionExpressionsStartingWithVoid && + node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.expression && + node.body.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.body.operator === 'void') { + return; + } + if (isAllowedFunction(node)) { + return; + } + if (options.allowTypedFunctionExpressions && + ((0, explicitReturnTypeUtils_1.isValidFunctionExpressionReturnType)(node, options) || + (0, explicitReturnTypeUtils_1.ancestorHasReturnType)(node))) { + return; + } + (0, explicitReturnTypeUtils_1.checkFunctionReturnType)(info, options, context.sourceCode, loc => context.report({ + loc, + node, + messageId: 'missingReturnType', + })); + } + return { + 'ArrowFunctionExpression, FunctionExpression, FunctionDeclaration': enterFunction, + 'ArrowFunctionExpression:exit': exitFunctionExpression, + 'FunctionDeclaration:exit'(node) { + const info = popFunctionInfo('function declaration'); + if (isAllowedFunction(node)) { + return; + } + if (options.allowTypedFunctionExpressions && node.returnType) { + return; + } + (0, explicitReturnTypeUtils_1.checkFunctionReturnType)(info, options, context.sourceCode, loc => context.report({ + loc, + node, + messageId: 'missingReturnType', + })); + }, + 'FunctionExpression:exit': exitFunctionExpression, + ReturnStatement(node) { + functionInfoStack.at(-1)?.returns.push(node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.d.ts.map new file mode 100644 index 0000000..5e9ddfc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"explicit-member-accessibility.d.ts","sourceRoot":"","sources":["../../src/rules/explicit-member-accessibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAgBnE,KAAK,kBAAkB,GACnB,UAAU,GACV,WAAW,GACX,KAAK,CAAC;AAEV,MAAM,WAAW,MAAM;IACrB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE;QACV,SAAS,CAAC,EAAE,kBAAkB,CAAC;QAC/B,YAAY,CAAC,EAAE,kBAAkB,CAAC;QAClC,OAAO,CAAC,EAAE,kBAAkB,CAAC;QAC7B,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;QACzC,UAAU,CAAC,EAAE,kBAAkB,CAAC;KACjC,CAAC;CACH;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;AAE/B,MAAM,MAAM,UAAU,GAClB,0BAA0B,GAC1B,sBAAsB,GACtB,6BAA6B,CAAC;;AAElC,wBA0WG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js new file mode 100644 index 0000000..772dba0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js @@ -0,0 +1,292 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getMemberHeadLoc_1 = require("../util/getMemberHeadLoc"); +const rangeToLoc_1 = require("../util/rangeToLoc"); +exports.default = (0, util_1.createRule)({ + name: 'explicit-member-accessibility', + meta: { + type: 'problem', + docs: { + description: 'Require explicit accessibility modifiers on class properties and methods', + // too opinionated to be recommended + }, + fixable: 'code', + hasSuggestions: true, + messages: { + addExplicitAccessibility: "Add '{{ type }}' accessibility modifier", + missingAccessibility: 'Missing accessibility modifier on {{type}} {{name}}.', + unwantedPublicAccessibility: 'Public accessibility modifier on {{type}} {{name}}.', + }, + schema: [ + { + type: 'object', + $defs: { + accessibilityLevel: { + oneOf: [ + { + type: 'string', + description: 'Always require an accessor.', + enum: ['explicit'], + }, + { + type: 'string', + description: 'Require an accessor except when public.', + enum: ['no-public'], + }, + { + type: 'string', + description: 'Never check whether there is an accessor.', + enum: ['off'], + }, + ], + }, + }, + additionalProperties: false, + properties: { + accessibility: { + $ref: '#/items/0/$defs/accessibilityLevel', + description: 'Which accessibility modifier is required to exist or not exist.', + }, + ignoredMethodNames: { + type: 'array', + description: 'Specific method names that may be ignored.', + items: { + type: 'string', + }, + }, + overrides: { + type: 'object', + additionalProperties: false, + description: 'Changes to required accessibility modifiers for specific kinds of class members.', + properties: { + accessors: { $ref: '#/items/0/$defs/accessibilityLevel' }, + constructors: { $ref: '#/items/0/$defs/accessibilityLevel' }, + methods: { $ref: '#/items/0/$defs/accessibilityLevel' }, + parameterProperties: { + $ref: '#/items/0/$defs/accessibilityLevel', + }, + properties: { $ref: '#/items/0/$defs/accessibilityLevel' }, + }, + }, + }, + }, + ], + }, + defaultOptions: [{ accessibility: 'explicit' }], + create(context, [option]) { + const baseCheck = option.accessibility ?? 'explicit'; + const overrides = option.overrides ?? {}; + const ctorCheck = overrides.constructors ?? baseCheck; + const accessorCheck = overrides.accessors ?? baseCheck; + const methodCheck = overrides.methods ?? baseCheck; + const propCheck = overrides.properties ?? baseCheck; + const paramPropCheck = overrides.parameterProperties ?? baseCheck; + const ignoredMethodNames = new Set(option.ignoredMethodNames ?? []); + /** + * Checks if a method declaration has an accessibility modifier. + * @param methodDefinition The node representing a MethodDefinition. + */ + function checkMethodAccessibilityModifier(methodDefinition) { + if (methodDefinition.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + return; + } + let nodeType = 'method definition'; + let check = baseCheck; + switch (methodDefinition.kind) { + case 'method': + check = methodCheck; + break; + case 'constructor': + check = ctorCheck; + break; + case 'get': + case 'set': + check = accessorCheck; + nodeType = `${methodDefinition.kind} property accessor`; + break; + } + const { name: methodName } = (0, util_1.getNameFromMember)(methodDefinition, context.sourceCode); + if (check === 'off' || ignoredMethodNames.has(methodName)) { + return; + } + if (check === 'no-public' && + methodDefinition.accessibility === 'public') { + const publicKeyword = findPublicKeyword(methodDefinition); + context.report({ + loc: (0, rangeToLoc_1.rangeToLoc)(context.sourceCode, publicKeyword.range), + messageId: 'unwantedPublicAccessibility', + data: { + name: methodName, + type: nodeType, + }, + fix: fixer => fixer.removeRange(publicKeyword.rangeToRemove), + }); + } + else if (check === 'explicit' && !methodDefinition.accessibility) { + context.report({ + loc: (0, getMemberHeadLoc_1.getMemberHeadLoc)(context.sourceCode, methodDefinition), + messageId: 'missingAccessibility', + data: { + name: methodName, + type: nodeType, + }, + suggest: getMissingAccessibilitySuggestions(methodDefinition), + }); + } + } + /** + * Returns an object containing a range that corresponds to the "public" + * keyword for a node, and the range that would need to be removed to + * remove the "public" keyword (including associated whitespace). + */ + function findPublicKeyword(node) { + const tokens = context.sourceCode.getTokens(node); + let rangeToRemove; + let keywordRange; + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + if (token.type === utils_1.AST_TOKEN_TYPES.Keyword && + token.value === 'public') { + keywordRange = structuredClone(token.range); + const commensAfterPublicKeyword = context.sourceCode.getCommentsAfter(token); + if (commensAfterPublicKeyword.length) { + // public /* Hi there! */ static foo() + // ^^^^^^^ + rangeToRemove = [ + token.range[0], + commensAfterPublicKeyword[0].range[0], + ]; + break; + } + else { + // public static foo() + // ^^^^^^^ + rangeToRemove = [token.range[0], tokens[i + 1].range[0]]; + break; + } + } + } + return { range: keywordRange, rangeToRemove }; + } + /** + * Creates a fixer that adds an accessibility modifier keyword + */ + function getMissingAccessibilitySuggestions(node) { + function fix(accessibility, fixer) { + if (node.decorators.length) { + const lastDecorator = node.decorators[node.decorators.length - 1]; + const nextToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(lastDecorator), util_1.NullThrowsReasons.MissingToken('token', 'last decorator')); + return fixer.insertTextBefore(nextToken, `${accessibility} `); + } + return fixer.insertTextBefore(node, `${accessibility} `); + } + return [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + fix: fixer => fix('public', fixer), + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + fix: fixer => fix('private', fixer), + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + fix: fixer => fix('protected', fixer), + }, + ]; + } + /** + * Checks if property has an accessibility modifier. + * @param propertyDefinition The node representing a PropertyDefinition. + */ + function checkPropertyAccessibilityModifier(propertyDefinition) { + if (propertyDefinition.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + return; + } + const nodeType = 'class property'; + const { name: propertyName } = (0, util_1.getNameFromMember)(propertyDefinition, context.sourceCode); + if (propCheck === 'no-public' && + propertyDefinition.accessibility === 'public') { + const publicKeywordRange = findPublicKeyword(propertyDefinition); + context.report({ + loc: (0, rangeToLoc_1.rangeToLoc)(context.sourceCode, publicKeywordRange.range), + messageId: 'unwantedPublicAccessibility', + data: { + name: propertyName, + type: nodeType, + }, + fix: fixer => fixer.removeRange(publicKeywordRange.rangeToRemove), + }); + } + else if (propCheck === 'explicit' && + !propertyDefinition.accessibility) { + context.report({ + loc: (0, getMemberHeadLoc_1.getMemberHeadLoc)(context.sourceCode, propertyDefinition), + messageId: 'missingAccessibility', + data: { + name: propertyName, + type: nodeType, + }, + suggest: getMissingAccessibilitySuggestions(propertyDefinition), + }); + } + } + /** + * Checks that the parameter property has the desired accessibility modifiers set. + * @param node The node representing a Parameter Property + */ + function checkParameterPropertyAccessibilityModifier(node) { + const nodeType = 'parameter property'; + // HAS to be an identifier or assignment or TSC will throw + if (node.parameter.type !== utils_1.AST_NODE_TYPES.Identifier && + node.parameter.type !== utils_1.AST_NODE_TYPES.AssignmentPattern) { + return; + } + const nodeName = node.parameter.type === utils_1.AST_NODE_TYPES.Identifier + ? node.parameter.name + : // has to be an Identifier or TSC will throw an error + node.parameter.left.name; + switch (paramPropCheck) { + case 'explicit': { + if (!node.accessibility) { + context.report({ + loc: (0, getMemberHeadLoc_1.getParameterPropertyHeadLoc)(context.sourceCode, node, nodeName), + messageId: 'missingAccessibility', + data: { + name: nodeName, + type: nodeType, + }, + suggest: getMissingAccessibilitySuggestions(node), + }); + } + break; + } + case 'no-public': { + if (node.accessibility === 'public' && node.readonly) { + const publicKeyword = findPublicKeyword(node); + context.report({ + loc: (0, rangeToLoc_1.rangeToLoc)(context.sourceCode, publicKeyword.range), + messageId: 'unwantedPublicAccessibility', + data: { + name: nodeName, + type: nodeType, + }, + fix: fixer => fixer.removeRange(publicKeyword.rangeToRemove), + }); + } + break; + } + } + } + return { + 'MethodDefinition, TSAbstractMethodDefinition': checkMethodAccessibilityModifier, + 'PropertyDefinition, TSAbstractPropertyDefinition, AccessorProperty, TSAbstractAccessorProperty': checkPropertyAccessibilityModifier, + TSParameterProperty: checkParameterPropertyAccessibilityModifier, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.d.ts.map new file mode 100644 index 0000000..bcf2552 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"explicit-module-boundary-types.d.ts","sourceRoot":"","sources":["../../src/rules/explicit-module-boundary-types.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,kCAAkC,CAAC,EAAE,OAAO,CAAC;QAC7C,yCAAyC,CAAC,EAAE,OAAO,CAAC;QACpD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,6BAA6B,CAAC,EAAE,OAAO,CAAC;QACxC,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAClB,aAAa,GACb,oBAAoB,GACpB,gBAAgB,GAChB,uBAAuB,GACvB,mBAAmB,CAAC;;AAExB,wBAweG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js new file mode 100644 index 0000000..eebf835 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js @@ -0,0 +1,386 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const explicitReturnTypeUtils_1 = require("../util/explicitReturnTypeUtils"); +exports.default = (0, util_1.createRule)({ + name: 'explicit-module-boundary-types', + meta: { + type: 'problem', + docs: { + description: "Require explicit return and argument types on exported functions' and classes' public class methods", + }, + messages: { + anyTypedArg: "Argument '{{name}}' should be typed with a non-any type.", + anyTypedArgUnnamed: '{{type}} argument should be typed with a non-any type.', + missingArgType: "Argument '{{name}}' should be typed.", + missingArgTypeUnnamed: '{{type}} argument should be typed.', + missingReturnType: 'Missing return type on function.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowArgumentsExplicitlyTypedAsAny: { + type: 'boolean', + description: 'Whether to ignore arguments that are explicitly typed as `any`.', + }, + allowDirectConstAssertionInArrowFunctions: { + type: 'boolean', + description: [ + 'Whether to ignore return type annotations on body-less arrow functions that return an `as const` type assertion.', + 'You must still type the parameters of the function.', + ].join('\n'), + }, + allowedNames: { + type: 'array', + description: 'An array of function/method names that will not have their arguments or return values checked.', + items: { + type: 'string', + }, + }, + allowHigherOrderFunctions: { + type: 'boolean', + description: [ + 'Whether to ignore return type annotations on functions immediately returning another function expression.', + 'You must still type the parameters of the function.', + ].join('\n'), + }, + allowOverloadFunctions: { + type: 'boolean', + description: 'Whether to ignore return type annotations on functions with overload signatures.', + }, + allowTypedFunctionExpressions: { + type: 'boolean', + description: 'Whether to ignore type annotations on the variable of a function expression.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowArgumentsExplicitlyTypedAsAny: false, + allowDirectConstAssertionInArrowFunctions: true, + allowedNames: [], + allowHigherOrderFunctions: true, + allowOverloadFunctions: false, + allowTypedFunctionExpressions: true, + }, + ], + create(context, [options]) { + // tracks all of the functions we've already checked + const checkedFunctions = new Set(); + const functionStack = []; + const functionReturnsMap = new Map(); + // all nodes visited, avoids infinite recursion for cyclic references + // (such as class member referring to itself) + const alreadyVisited = new Set(); + function getReturnsInFunction(node) { + return functionReturnsMap.get(node) ?? []; + } + function enterFunction(node) { + functionStack.push(node); + functionReturnsMap.set(node, []); + } + function exitFunction() { + functionStack.pop(); + } + /* + # How the rule works: + + As the rule traverses the AST, it immediately checks every single function that it finds is exported. + "exported" means that it is either directly exported, or that its name is exported. + + It also collects a list of every single function it finds on the way, but does not check them. + After it's finished traversing the AST, it then iterates through the list of found functions, and checks to see if + any of them are part of a higher-order function + */ + return { + 'ArrowFunctionExpression, FunctionDeclaration, FunctionExpression': enterFunction, + 'ArrowFunctionExpression:exit': exitFunction, + 'ExportDefaultDeclaration:exit'(node) { + checkNode(node.declaration); + }, + 'ExportNamedDeclaration:not([source]):exit'(node) { + if (node.declaration) { + checkNode(node.declaration); + } + else { + for (const specifier of node.specifiers) { + followReference(specifier.local); + } + } + }, + 'FunctionDeclaration:exit': exitFunction, + 'FunctionExpression:exit': exitFunction, + 'Program:exit'() { + for (const [node, returns] of functionReturnsMap) { + if (isExportedHigherOrderFunction({ node, returns })) { + checkNode(node); + } + } + }, + ReturnStatement(node) { + const current = functionStack[functionStack.length - 1]; + functionReturnsMap.get(current)?.push(node); + }, + 'TSExportAssignment:exit'(node) { + checkNode(node.expression); + }, + }; + function checkParameters(node) { + function checkParameter(param) { + function report(namedMessageId, unnamedMessageId) { + if (param.type === utils_1.AST_NODE_TYPES.Identifier) { + context.report({ + node: param, + messageId: namedMessageId, + data: { name: param.name }, + }); + } + else if (param.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + context.report({ + node: param, + messageId: unnamedMessageId, + data: { type: 'Array pattern' }, + }); + } + else if (param.type === utils_1.AST_NODE_TYPES.ObjectPattern) { + context.report({ + node: param, + messageId: unnamedMessageId, + data: { type: 'Object pattern' }, + }); + } + else if (param.type === utils_1.AST_NODE_TYPES.RestElement) { + if (param.argument.type === utils_1.AST_NODE_TYPES.Identifier) { + context.report({ + node: param, + messageId: namedMessageId, + data: { name: param.argument.name }, + }); + } + else { + context.report({ + node: param, + messageId: unnamedMessageId, + data: { type: 'Rest' }, + }); + } + } + } + switch (param.type) { + case utils_1.AST_NODE_TYPES.ArrayPattern: + case utils_1.AST_NODE_TYPES.Identifier: + case utils_1.AST_NODE_TYPES.ObjectPattern: + case utils_1.AST_NODE_TYPES.RestElement: + if (!param.typeAnnotation) { + report('missingArgType', 'missingArgTypeUnnamed'); + } + else if (options.allowArgumentsExplicitlyTypedAsAny !== true && + param.typeAnnotation.typeAnnotation.type === + utils_1.AST_NODE_TYPES.TSAnyKeyword) { + report('anyTypedArg', 'anyTypedArgUnnamed'); + } + return; + case utils_1.AST_NODE_TYPES.TSParameterProperty: + return checkParameter(param.parameter); + case utils_1.AST_NODE_TYPES.AssignmentPattern: // ignored as it has a type via its assignment + return; + } + } + for (const arg of node.params) { + checkParameter(arg); + } + } + /** + * Checks if a function name is allowed and should not be checked. + */ + function isAllowedName(node) { + if (!node || !options.allowedNames || options.allowedNames.length === 0) { + return false; + } + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator || + node.type === utils_1.AST_NODE_TYPES.FunctionDeclaration) { + return (node.id?.type === utils_1.AST_NODE_TYPES.Identifier && + options.allowedNames.includes(node.id.name)); + } + if (node.type === utils_1.AST_NODE_TYPES.MethodDefinition || + node.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || + (node.type === utils_1.AST_NODE_TYPES.Property && node.method) || + node.type === utils_1.AST_NODE_TYPES.PropertyDefinition || + node.type === utils_1.AST_NODE_TYPES.AccessorProperty) { + return (0, util_1.isStaticMemberAccessOfValue)(node, context, ...options.allowedNames); + } + return false; + } + function isExportedHigherOrderFunction({ node, }) { + let current = node.parent; + while (current) { + if (current.type === utils_1.AST_NODE_TYPES.ReturnStatement) { + // the parent of a return will always be a block statement, so we can skip over it + current = current.parent.parent; + continue; + } + if (!(0, util_1.isFunction)(current)) { + return false; + } + const returns = getReturnsInFunction(current); + if (!(0, explicitReturnTypeUtils_1.doesImmediatelyReturnFunctionExpression)({ node: current, returns })) { + return false; + } + if (checkedFunctions.has(current)) { + return true; + } + current = current.parent; + } + return false; + } + function followReference(node) { + const scope = context.sourceCode.getScope(node); + const variable = scope.set.get(node.name); + /* istanbul ignore if */ if (!variable) { + return; + } + // check all of the definitions + for (const definition of variable.defs) { + // cases we don't care about in this rule + if ([ + scope_manager_1.DefinitionType.CatchClause, + scope_manager_1.DefinitionType.ImplicitGlobalVariable, + scope_manager_1.DefinitionType.ImportBinding, + scope_manager_1.DefinitionType.Parameter, + ].includes(definition.type)) { + continue; + } + checkNode(definition.node); + } + // follow references to find writes to the variable + for (const reference of variable.references) { + if ( + // we don't want to check the initialization ref, as this is handled by the declaration check + !reference.init && + reference.writeExpr) { + checkNode(reference.writeExpr); + } + } + } + function checkNode(node) { + if (node == null || alreadyVisited.has(node)) { + return; + } + alreadyVisited.add(node); + switch (node.type) { + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: { + const returns = getReturnsInFunction(node); + return checkFunctionExpression({ node, returns }); + } + case utils_1.AST_NODE_TYPES.ArrayExpression: + for (const element of node.elements) { + checkNode(element); + } + return; + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.AccessorProperty: + case utils_1.AST_NODE_TYPES.MethodDefinition: + case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + if (node.accessibility === 'private' || + node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + return; + } + return checkNode(node.value); + case utils_1.AST_NODE_TYPES.ClassDeclaration: + case utils_1.AST_NODE_TYPES.ClassExpression: + for (const element of node.body.body) { + checkNode(element); + } + return; + case utils_1.AST_NODE_TYPES.FunctionDeclaration: { + const returns = getReturnsInFunction(node); + return checkFunction({ node, returns }); + } + case utils_1.AST_NODE_TYPES.Identifier: + return followReference(node); + case utils_1.AST_NODE_TYPES.ObjectExpression: + for (const property of node.properties) { + checkNode(property); + } + return; + case utils_1.AST_NODE_TYPES.Property: + return checkNode(node.value); + case utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression: + return checkEmptyBodyFunctionExpression(node); + case utils_1.AST_NODE_TYPES.VariableDeclaration: + for (const declaration of node.declarations) { + checkNode(declaration); + } + return; + case utils_1.AST_NODE_TYPES.VariableDeclarator: + return checkNode(node.init); + } + } + function checkEmptyBodyFunctionExpression(node) { + const isConstructor = node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + node.parent.kind === 'constructor'; + const isSetAccessor = (node.parent.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || + node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition) && + node.parent.kind === 'set'; + if (!isConstructor && !isSetAccessor && !node.returnType) { + context.report({ + node, + messageId: 'missingReturnType', + }); + } + checkParameters(node); + } + function checkFunctionExpression({ node, returns, }) { + if (checkedFunctions.has(node)) { + return; + } + checkedFunctions.add(node); + if (isAllowedName(node.parent) || + (0, explicitReturnTypeUtils_1.isTypedFunctionExpression)(node, options) || + (0, explicitReturnTypeUtils_1.ancestorHasReturnType)(node)) { + return; + } + if (options.allowOverloadFunctions && + node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + (0, util_1.hasOverloadSignatures)(node.parent, context)) { + return; + } + (0, explicitReturnTypeUtils_1.checkFunctionExpressionReturnType)({ node, returns }, options, context.sourceCode, loc => { + context.report({ + loc, + node, + messageId: 'missingReturnType', + }); + }); + checkParameters(node); + } + function checkFunction({ node, returns, }) { + if (checkedFunctions.has(node)) { + return; + } + checkedFunctions.add(node); + if (isAllowedName(node) || (0, explicitReturnTypeUtils_1.ancestorHasReturnType)(node)) { + return; + } + if (options.allowOverloadFunctions && + (0, util_1.hasOverloadSignatures)(node, context)) { + return; + } + (0, explicitReturnTypeUtils_1.checkFunctionReturnType)({ node, returns }, options, context.sourceCode, loc => { + context.report({ + loc, + node, + messageId: 'missingReturnType', + }); + }); + checkParameters(node); + } + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.d.ts.map new file mode 100644 index 0000000..a8fd440 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAqIA,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoImB,CAAC;AAE/B,SAAS,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js new file mode 100644 index 0000000..2142db5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js @@ -0,0 +1,267 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const adjacent_overload_signatures_1 = __importDefault(require("./adjacent-overload-signatures")); +const array_type_1 = __importDefault(require("./array-type")); +const await_thenable_1 = __importDefault(require("./await-thenable")); +const ban_ts_comment_1 = __importDefault(require("./ban-ts-comment")); +const ban_tslint_comment_1 = __importDefault(require("./ban-tslint-comment")); +const class_literal_property_style_1 = __importDefault(require("./class-literal-property-style")); +const class_methods_use_this_1 = __importDefault(require("./class-methods-use-this")); +const consistent_generic_constructors_1 = __importDefault(require("./consistent-generic-constructors")); +const consistent_indexed_object_style_1 = __importDefault(require("./consistent-indexed-object-style")); +const consistent_return_1 = __importDefault(require("./consistent-return")); +const consistent_type_assertions_1 = __importDefault(require("./consistent-type-assertions")); +const consistent_type_definitions_1 = __importDefault(require("./consistent-type-definitions")); +const consistent_type_exports_1 = __importDefault(require("./consistent-type-exports")); +const consistent_type_imports_1 = __importDefault(require("./consistent-type-imports")); +const default_param_last_1 = __importDefault(require("./default-param-last")); +const dot_notation_1 = __importDefault(require("./dot-notation")); +const explicit_function_return_type_1 = __importDefault(require("./explicit-function-return-type")); +const explicit_member_accessibility_1 = __importDefault(require("./explicit-member-accessibility")); +const explicit_module_boundary_types_1 = __importDefault(require("./explicit-module-boundary-types")); +const init_declarations_1 = __importDefault(require("./init-declarations")); +const max_params_1 = __importDefault(require("./max-params")); +const member_ordering_1 = __importDefault(require("./member-ordering")); +const method_signature_style_1 = __importDefault(require("./method-signature-style")); +const naming_convention_1 = __importDefault(require("./naming-convention")); +const no_array_constructor_1 = __importDefault(require("./no-array-constructor")); +const no_array_delete_1 = __importDefault(require("./no-array-delete")); +const no_base_to_string_1 = __importDefault(require("./no-base-to-string")); +const no_confusing_non_null_assertion_1 = __importDefault(require("./no-confusing-non-null-assertion")); +const no_confusing_void_expression_1 = __importDefault(require("./no-confusing-void-expression")); +const no_deprecated_1 = __importDefault(require("./no-deprecated")); +const no_dupe_class_members_1 = __importDefault(require("./no-dupe-class-members")); +const no_duplicate_enum_values_1 = __importDefault(require("./no-duplicate-enum-values")); +const no_duplicate_type_constituents_1 = __importDefault(require("./no-duplicate-type-constituents")); +const no_dynamic_delete_1 = __importDefault(require("./no-dynamic-delete")); +const no_empty_function_1 = __importDefault(require("./no-empty-function")); +const no_empty_interface_1 = __importDefault(require("./no-empty-interface")); +const no_empty_object_type_1 = __importDefault(require("./no-empty-object-type")); +const no_explicit_any_1 = __importDefault(require("./no-explicit-any")); +const no_extra_non_null_assertion_1 = __importDefault(require("./no-extra-non-null-assertion")); +const no_extraneous_class_1 = __importDefault(require("./no-extraneous-class")); +const no_floating_promises_1 = __importDefault(require("./no-floating-promises")); +const no_for_in_array_1 = __importDefault(require("./no-for-in-array")); +const no_implied_eval_1 = __importDefault(require("./no-implied-eval")); +const no_import_type_side_effects_1 = __importDefault(require("./no-import-type-side-effects")); +const no_inferrable_types_1 = __importDefault(require("./no-inferrable-types")); +const no_invalid_this_1 = __importDefault(require("./no-invalid-this")); +const no_invalid_void_type_1 = __importDefault(require("./no-invalid-void-type")); +const no_loop_func_1 = __importDefault(require("./no-loop-func")); +const no_loss_of_precision_1 = __importDefault(require("./no-loss-of-precision")); +const no_magic_numbers_1 = __importDefault(require("./no-magic-numbers")); +const no_meaningless_void_operator_1 = __importDefault(require("./no-meaningless-void-operator")); +const no_misused_new_1 = __importDefault(require("./no-misused-new")); +const no_misused_promises_1 = __importDefault(require("./no-misused-promises")); +const no_misused_spread_1 = __importDefault(require("./no-misused-spread")); +const no_mixed_enums_1 = __importDefault(require("./no-mixed-enums")); +const no_namespace_1 = __importDefault(require("./no-namespace")); +const no_non_null_asserted_nullish_coalescing_1 = __importDefault(require("./no-non-null-asserted-nullish-coalescing")); +const no_non_null_asserted_optional_chain_1 = __importDefault(require("./no-non-null-asserted-optional-chain")); +const no_non_null_assertion_1 = __importDefault(require("./no-non-null-assertion")); +const no_redeclare_1 = __importDefault(require("./no-redeclare")); +const no_redundant_type_constituents_1 = __importDefault(require("./no-redundant-type-constituents")); +const no_require_imports_1 = __importDefault(require("./no-require-imports")); +const no_restricted_imports_1 = __importDefault(require("./no-restricted-imports")); +const no_restricted_types_1 = __importDefault(require("./no-restricted-types")); +const no_shadow_1 = __importDefault(require("./no-shadow")); +const no_this_alias_1 = __importDefault(require("./no-this-alias")); +const no_type_alias_1 = __importDefault(require("./no-type-alias")); +const no_unnecessary_boolean_literal_compare_1 = __importDefault(require("./no-unnecessary-boolean-literal-compare")); +const no_unnecessary_condition_1 = __importDefault(require("./no-unnecessary-condition")); +const no_unnecessary_parameter_property_assignment_1 = __importDefault(require("./no-unnecessary-parameter-property-assignment")); +const no_unnecessary_qualifier_1 = __importDefault(require("./no-unnecessary-qualifier")); +const no_unnecessary_template_expression_1 = __importDefault(require("./no-unnecessary-template-expression")); +const no_unnecessary_type_arguments_1 = __importDefault(require("./no-unnecessary-type-arguments")); +const no_unnecessary_type_assertion_1 = __importDefault(require("./no-unnecessary-type-assertion")); +const no_unnecessary_type_constraint_1 = __importDefault(require("./no-unnecessary-type-constraint")); +const no_unnecessary_type_parameters_1 = __importDefault(require("./no-unnecessary-type-parameters")); +const no_unsafe_argument_1 = __importDefault(require("./no-unsafe-argument")); +const no_unsafe_assignment_1 = __importDefault(require("./no-unsafe-assignment")); +const no_unsafe_call_1 = __importDefault(require("./no-unsafe-call")); +const no_unsafe_declaration_merging_1 = __importDefault(require("./no-unsafe-declaration-merging")); +const no_unsafe_enum_comparison_1 = __importDefault(require("./no-unsafe-enum-comparison")); +const no_unsafe_function_type_1 = __importDefault(require("./no-unsafe-function-type")); +const no_unsafe_member_access_1 = __importDefault(require("./no-unsafe-member-access")); +const no_unsafe_return_1 = __importDefault(require("./no-unsafe-return")); +const no_unsafe_type_assertion_1 = __importDefault(require("./no-unsafe-type-assertion")); +const no_unsafe_unary_minus_1 = __importDefault(require("./no-unsafe-unary-minus")); +const no_unused_expressions_1 = __importDefault(require("./no-unused-expressions")); +const no_unused_vars_1 = __importDefault(require("./no-unused-vars")); +const no_use_before_define_1 = __importDefault(require("./no-use-before-define")); +const no_useless_constructor_1 = __importDefault(require("./no-useless-constructor")); +const no_useless_empty_export_1 = __importDefault(require("./no-useless-empty-export")); +const no_var_requires_1 = __importDefault(require("./no-var-requires")); +const no_wrapper_object_types_1 = __importDefault(require("./no-wrapper-object-types")); +const non_nullable_type_assertion_style_1 = __importDefault(require("./non-nullable-type-assertion-style")); +const only_throw_error_1 = __importDefault(require("./only-throw-error")); +const parameter_properties_1 = __importDefault(require("./parameter-properties")); +const prefer_as_const_1 = __importDefault(require("./prefer-as-const")); +const prefer_destructuring_1 = __importDefault(require("./prefer-destructuring")); +const prefer_enum_initializers_1 = __importDefault(require("./prefer-enum-initializers")); +const prefer_find_1 = __importDefault(require("./prefer-find")); +const prefer_for_of_1 = __importDefault(require("./prefer-for-of")); +const prefer_function_type_1 = __importDefault(require("./prefer-function-type")); +const prefer_includes_1 = __importDefault(require("./prefer-includes")); +const prefer_literal_enum_member_1 = __importDefault(require("./prefer-literal-enum-member")); +const prefer_namespace_keyword_1 = __importDefault(require("./prefer-namespace-keyword")); +const prefer_nullish_coalescing_1 = __importDefault(require("./prefer-nullish-coalescing")); +const prefer_optional_chain_1 = __importDefault(require("./prefer-optional-chain")); +const prefer_promise_reject_errors_1 = __importDefault(require("./prefer-promise-reject-errors")); +const prefer_readonly_1 = __importDefault(require("./prefer-readonly")); +const prefer_readonly_parameter_types_1 = __importDefault(require("./prefer-readonly-parameter-types")); +const prefer_reduce_type_parameter_1 = __importDefault(require("./prefer-reduce-type-parameter")); +const prefer_regexp_exec_1 = __importDefault(require("./prefer-regexp-exec")); +const prefer_return_this_type_1 = __importDefault(require("./prefer-return-this-type")); +const prefer_string_starts_ends_with_1 = __importDefault(require("./prefer-string-starts-ends-with")); +const prefer_ts_expect_error_1 = __importDefault(require("./prefer-ts-expect-error")); +const promise_function_async_1 = __importDefault(require("./promise-function-async")); +const related_getter_setter_pairs_1 = __importDefault(require("./related-getter-setter-pairs")); +const require_array_sort_compare_1 = __importDefault(require("./require-array-sort-compare")); +const require_await_1 = __importDefault(require("./require-await")); +const restrict_plus_operands_1 = __importDefault(require("./restrict-plus-operands")); +const restrict_template_expressions_1 = __importDefault(require("./restrict-template-expressions")); +const return_await_1 = __importDefault(require("./return-await")); +const sort_type_constituents_1 = __importDefault(require("./sort-type-constituents")); +const strict_boolean_expressions_1 = __importDefault(require("./strict-boolean-expressions")); +const switch_exhaustiveness_check_1 = __importDefault(require("./switch-exhaustiveness-check")); +const triple_slash_reference_1 = __importDefault(require("./triple-slash-reference")); +const typedef_1 = __importDefault(require("./typedef")); +const unbound_method_1 = __importDefault(require("./unbound-method")); +const unified_signatures_1 = __importDefault(require("./unified-signatures")); +const use_unknown_in_catch_callback_variable_1 = __importDefault(require("./use-unknown-in-catch-callback-variable")); +const rules = { + 'adjacent-overload-signatures': adjacent_overload_signatures_1.default, + 'array-type': array_type_1.default, + 'await-thenable': await_thenable_1.default, + 'ban-ts-comment': ban_ts_comment_1.default, + 'ban-tslint-comment': ban_tslint_comment_1.default, + 'class-literal-property-style': class_literal_property_style_1.default, + 'class-methods-use-this': class_methods_use_this_1.default, + 'consistent-generic-constructors': consistent_generic_constructors_1.default, + 'consistent-indexed-object-style': consistent_indexed_object_style_1.default, + 'consistent-return': consistent_return_1.default, + 'consistent-type-assertions': consistent_type_assertions_1.default, + 'consistent-type-definitions': consistent_type_definitions_1.default, + 'consistent-type-exports': consistent_type_exports_1.default, + 'consistent-type-imports': consistent_type_imports_1.default, + 'default-param-last': default_param_last_1.default, + 'dot-notation': dot_notation_1.default, + 'explicit-function-return-type': explicit_function_return_type_1.default, + 'explicit-member-accessibility': explicit_member_accessibility_1.default, + 'explicit-module-boundary-types': explicit_module_boundary_types_1.default, + 'init-declarations': init_declarations_1.default, + 'max-params': max_params_1.default, + 'member-ordering': member_ordering_1.default, + 'method-signature-style': method_signature_style_1.default, + 'naming-convention': naming_convention_1.default, + 'no-array-constructor': no_array_constructor_1.default, + 'no-array-delete': no_array_delete_1.default, + 'no-base-to-string': no_base_to_string_1.default, + 'no-confusing-non-null-assertion': no_confusing_non_null_assertion_1.default, + 'no-confusing-void-expression': no_confusing_void_expression_1.default, + 'no-deprecated': no_deprecated_1.default, + 'no-dupe-class-members': no_dupe_class_members_1.default, + 'no-duplicate-enum-values': no_duplicate_enum_values_1.default, + 'no-duplicate-type-constituents': no_duplicate_type_constituents_1.default, + 'no-dynamic-delete': no_dynamic_delete_1.default, + 'no-empty-function': no_empty_function_1.default, + 'no-empty-interface': no_empty_interface_1.default, + 'no-empty-object-type': no_empty_object_type_1.default, + 'no-explicit-any': no_explicit_any_1.default, + 'no-extra-non-null-assertion': no_extra_non_null_assertion_1.default, + 'no-extraneous-class': no_extraneous_class_1.default, + 'no-floating-promises': no_floating_promises_1.default, + 'no-for-in-array': no_for_in_array_1.default, + 'no-implied-eval': no_implied_eval_1.default, + 'no-import-type-side-effects': no_import_type_side_effects_1.default, + 'no-inferrable-types': no_inferrable_types_1.default, + 'no-invalid-this': no_invalid_this_1.default, + 'no-invalid-void-type': no_invalid_void_type_1.default, + 'no-loop-func': no_loop_func_1.default, + 'no-loss-of-precision': no_loss_of_precision_1.default, + 'no-magic-numbers': no_magic_numbers_1.default, + 'no-meaningless-void-operator': no_meaningless_void_operator_1.default, + 'no-misused-new': no_misused_new_1.default, + 'no-misused-promises': no_misused_promises_1.default, + 'no-misused-spread': no_misused_spread_1.default, + 'no-mixed-enums': no_mixed_enums_1.default, + 'no-namespace': no_namespace_1.default, + 'no-non-null-asserted-nullish-coalescing': no_non_null_asserted_nullish_coalescing_1.default, + 'no-non-null-asserted-optional-chain': no_non_null_asserted_optional_chain_1.default, + 'no-non-null-assertion': no_non_null_assertion_1.default, + 'no-redeclare': no_redeclare_1.default, + 'no-redundant-type-constituents': no_redundant_type_constituents_1.default, + 'no-require-imports': no_require_imports_1.default, + 'no-restricted-imports': no_restricted_imports_1.default, + 'no-restricted-types': no_restricted_types_1.default, + 'no-shadow': no_shadow_1.default, + 'no-this-alias': no_this_alias_1.default, + 'no-type-alias': no_type_alias_1.default, + 'no-unnecessary-boolean-literal-compare': no_unnecessary_boolean_literal_compare_1.default, + 'no-unnecessary-condition': no_unnecessary_condition_1.default, + 'no-unnecessary-parameter-property-assignment': no_unnecessary_parameter_property_assignment_1.default, + 'no-unnecessary-qualifier': no_unnecessary_qualifier_1.default, + 'no-unnecessary-template-expression': no_unnecessary_template_expression_1.default, + 'no-unnecessary-type-arguments': no_unnecessary_type_arguments_1.default, + 'no-unnecessary-type-assertion': no_unnecessary_type_assertion_1.default, + 'no-unnecessary-type-constraint': no_unnecessary_type_constraint_1.default, + 'no-unnecessary-type-parameters': no_unnecessary_type_parameters_1.default, + 'no-unsafe-argument': no_unsafe_argument_1.default, + 'no-unsafe-assignment': no_unsafe_assignment_1.default, + 'no-unsafe-call': no_unsafe_call_1.default, + 'no-unsafe-declaration-merging': no_unsafe_declaration_merging_1.default, + 'no-unsafe-enum-comparison': no_unsafe_enum_comparison_1.default, + 'no-unsafe-function-type': no_unsafe_function_type_1.default, + 'no-unsafe-member-access': no_unsafe_member_access_1.default, + 'no-unsafe-return': no_unsafe_return_1.default, + 'no-unsafe-type-assertion': no_unsafe_type_assertion_1.default, + 'no-unsafe-unary-minus': no_unsafe_unary_minus_1.default, + 'no-unused-expressions': no_unused_expressions_1.default, + 'no-unused-vars': no_unused_vars_1.default, + 'no-use-before-define': no_use_before_define_1.default, + 'no-useless-constructor': no_useless_constructor_1.default, + 'no-useless-empty-export': no_useless_empty_export_1.default, + 'no-var-requires': no_var_requires_1.default, + 'no-wrapper-object-types': no_wrapper_object_types_1.default, + 'non-nullable-type-assertion-style': non_nullable_type_assertion_style_1.default, + 'only-throw-error': only_throw_error_1.default, + 'parameter-properties': parameter_properties_1.default, + 'prefer-as-const': prefer_as_const_1.default, + 'prefer-destructuring': prefer_destructuring_1.default, + 'prefer-enum-initializers': prefer_enum_initializers_1.default, + 'prefer-find': prefer_find_1.default, + 'prefer-for-of': prefer_for_of_1.default, + 'prefer-function-type': prefer_function_type_1.default, + 'prefer-includes': prefer_includes_1.default, + 'prefer-literal-enum-member': prefer_literal_enum_member_1.default, + 'prefer-namespace-keyword': prefer_namespace_keyword_1.default, + 'prefer-nullish-coalescing': prefer_nullish_coalescing_1.default, + 'prefer-optional-chain': prefer_optional_chain_1.default, + 'prefer-promise-reject-errors': prefer_promise_reject_errors_1.default, + 'prefer-readonly': prefer_readonly_1.default, + 'prefer-readonly-parameter-types': prefer_readonly_parameter_types_1.default, + 'prefer-reduce-type-parameter': prefer_reduce_type_parameter_1.default, + 'prefer-regexp-exec': prefer_regexp_exec_1.default, + 'prefer-return-this-type': prefer_return_this_type_1.default, + 'prefer-string-starts-ends-with': prefer_string_starts_ends_with_1.default, + 'prefer-ts-expect-error': prefer_ts_expect_error_1.default, + 'promise-function-async': promise_function_async_1.default, + 'related-getter-setter-pairs': related_getter_setter_pairs_1.default, + 'require-array-sort-compare': require_array_sort_compare_1.default, + 'require-await': require_await_1.default, + 'restrict-plus-operands': restrict_plus_operands_1.default, + 'restrict-template-expressions': restrict_template_expressions_1.default, + 'return-await': return_await_1.default, + 'sort-type-constituents': sort_type_constituents_1.default, + 'strict-boolean-expressions': strict_boolean_expressions_1.default, + 'switch-exhaustiveness-check': switch_exhaustiveness_check_1.default, + 'triple-slash-reference': triple_slash_reference_1.default, + typedef: typedef_1.default, + 'unbound-method': unbound_method_1.default, + 'unified-signatures': unified_signatures_1.default, + 'use-unknown-in-catch-callback-variable': use_unknown_in_catch_callback_variable_1.default, +}; +module.exports = rules; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.d.ts.map new file mode 100644 index 0000000..ff920cf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init-declarations.d.ts","sourceRoot":"","sources":["../../src/rules/init-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;;qCA6H2lO,SAAU,mBAAmB;EA7H/kO,CAAC;AAExD,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;AAEtE,wBAgGG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js new file mode 100644 index 0000000..4523a3d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('init-declarations'); +exports.default = (0, util_1.createRule)({ + name: 'init-declarations', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Require or disallow initialization in variable declarations', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions: ['always'], + create(context, [mode]) { + // Make a custom context to adjust the loc of reports where the base + // rule's behavior is a bit too aggressive with TS-specific syntax (namely, + // type annotations). + function getBaseContextOverride() { + const reportOverride = descriptor => { + if ('node' in descriptor && descriptor.loc == null) { + const { node, ...rest } = descriptor; + // We only want to special case the report loc when reporting on + // variables declarations that are not initialized. Declarations that + // _are_ initialized get reported by the base rule due to a setting to + // prohibit initializing variables entirely, in which case underlining + // the whole node including the type annotation and initializer is + // appropriate. + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator && + node.init == null) { + context.report({ + ...rest, + loc: getReportLoc(node), + }); + return; + } + } + context.report(descriptor); + }; + // `return { ...context, report: reportOverride }` isn't safe because the + // `context` object has some getters that need to be preserved. + // + // `return new Proxy(context, ...)` doesn't work because `context` has + // non-configurable properties that throw when constructing a Proxy. + // + // So, we'll just use Proxy on a dummy object and use the `get` trap to + // proxy `context`'s properties. + return new Proxy({}, { + get: (target, prop, receiver) => prop === 'report' + ? reportOverride + : Reflect.get(context, prop, receiver), + }); + } + const rules = baseRule.create(getBaseContextOverride()); + return { + 'VariableDeclaration:exit'(node) { + if (mode === 'always') { + if (node.declare) { + return; + } + if (isAncestorNamespaceDeclared(node)) { + return; + } + } + rules['VariableDeclaration:exit'](node); + }, + }; + function isAncestorNamespaceDeclared(node) { + let ancestor = node.parent; + while (ancestor) { + if (ancestor.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration && + ancestor.declare) { + return true; + } + ancestor = ancestor.parent; + } + return false; + } + }, +}); +/** + * When reporting an uninitialized variable declarator, get the loc excluding + * the type annotation. + */ +function getReportLoc(node) { + const start = structuredClone(node.loc.start); + const end = { + line: node.loc.start.line, + // `if (id.type === AST_NODE_TYPES.Identifier)` is a condition for + // reporting in the base rule (as opposed to things like destructuring + // assignment), so the type assertion should always be valid. + column: node.loc.start.column + node.id.name.length, + }; + return { + start, + end, + }; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/max-params.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/max-params.d.ts.map new file mode 100644 index 0000000..fdce4d9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/max-params.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"max-params.d.ts","sourceRoot":"","sources":["../../src/rules/max-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAcjB,QAAA,MAAM,QAAQ;;;;;;;kCAqFqgC,SAAU,uBAAuB;8BAA6D,SAAU,mBAAmB,GAAY,SAAU,iBAAiB,GAAY,SAAU,cAAc;6BAA+C,SAAU,kBAAkB;EArFpvC,CAAC;AAEjD,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;;;;;AAEtE,wBA+EG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/max-params.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/max-params.js new file mode 100644 index 0000000..418ebc1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/max-params.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('max-params'); +exports.default = (0, util_1.createRule)({ + name: 'max-params', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Enforce a maximum number of parameters in function definitions', + extendsBaseRule: true, + }, + messages: baseRule.meta.messages, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + countVoidThis: { + type: 'boolean', + description: 'Whether to count a `this` declaration when the type is `void`.', + }, + max: { + type: 'integer', + description: 'A maximum number of parameters in function definitions.', + minimum: 0, + }, + maximum: { + type: 'integer', + description: '(deprecated) A maximum number of parameters in function definitions.', + minimum: 0, + }, + }, + }, + ], + }, + defaultOptions: [{ countVoidThis: false, max: 3 }], + create(context, [{ countVoidThis }]) { + const baseRules = baseRule.create(context); + if (countVoidThis === true) { + return baseRules; + } + const removeVoidThisParam = (node) => { + if (node.params.length === 0 || + node.params[0].type !== utils_1.AST_NODE_TYPES.Identifier || + node.params[0].name !== 'this' || + node.params[0].typeAnnotation?.typeAnnotation.type !== + utils_1.AST_NODE_TYPES.TSVoidKeyword) { + return node; + } + return { + ...node, + params: node.params.slice(1), + }; + }; + const wrapListener = (listener) => { + return (node) => { + listener(removeVoidThisParam(node)); + }; + }; + return { + ArrowFunctionExpression: wrapListener(baseRules.ArrowFunctionExpression), + FunctionDeclaration: wrapListener(baseRules.FunctionDeclaration), + FunctionExpression: wrapListener(baseRules.FunctionExpression), + TSDeclareFunction: wrapListener(baseRules.FunctionDeclaration), + TSFunctionType: wrapListener(baseRules.FunctionDeclaration), + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.d.ts.map new file mode 100644 index 0000000..4d67d19 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"member-ordering.d.ts","sourceRoot":"","sources":["../../src/rules/member-ordering.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY/E,MAAM,MAAM,UAAU,GAClB,qBAAqB,GACrB,gBAAgB,GAChB,+BAA+B,CAAC;AAEpC,KAAK,YAAY,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAE5D,KAAK,UAAU,GACX,UAAU,GACV,gBAAgB,GAChB,aAAa,GACb,OAAO,GACP,KAAK,GACL,QAAQ,GACR,KAAK,GACL,WAAW,GACX,uBAAuB,GACvB,YAAY,CAAC;AAEjB,KAAK,mBAAmB,GACpB,UAAU,GACV,OAAO,GACP,KAAK,GACL,QAAQ,GACR,KAAK,GACL,OAAO,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;AAEhD,KAAK,qBAAqB,GAAG,OAAO,CAClC,UAAU,EACV,aAAa,GAAG,oBAAoB,GAAG,WAAW,CACnD,CAAC;AAEF,KAAK,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtD,KAAK,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC;AAEzD,KAAK,cAAc,GACf,GAAG,aAAa,IAAI,OAAO,CACzB,UAAU,EACV,oBAAoB,GAAG,WAAW,GAAG,uBAAuB,CAC7D,EAAE,GACH,GAAG,aAAa,IAAI,WAAW,IAAI,qBAAqB,EAAE,GAC1D,GAAG,aAAa,cAAc,mBAAmB,EAAE,GACnD,GAAG,WAAW,IAAI,qBAAqB,EAAE,GACzC,aAAa,mBAAmB,EAAE,GAClC,UAAU,CAAC;AAEf,KAAK,UAAU,GAAG,cAAc,GAAG,cAAc,EAAE,CAAC;AAEpD,KAAK,iBAAiB,GAClB,gBAAgB,GAChB,iCAAiC,GACjC,SAAS,GACT,0BAA0B,CAAC;AAE/B,KAAK,KAAK,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAE9C,UAAU,iBAAiB;IACzB,WAAW,CAAC,EAAE,OAAO,GAAG,UAAU,EAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,KAAK,WAAW,GAAG,OAAO,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAC;AAG9D,KAAK,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,OAAO,CAAC,EAAE,WAAW,CAAC;QACtB,gBAAgB,CAAC,EAAE,WAAW,CAAC;QAC/B,OAAO,CAAC,EAAE,WAAW,CAAC;QACtB,UAAU,CAAC,EAAE,WAAW,CAAC;QACzB,YAAY,CAAC,EAAE,WAAW,CAAC;KAC5B;CACF,CAAC;AAwCF,eAAO,MAAM,YAAY,EAAE,UAAU,EAyKpC,CAAC;;AAwaF,wBA2YG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js new file mode 100644 index 0000000..c08f657 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js @@ -0,0 +1,827 @@ +"use strict"; +// This rule was feature-frozen before we enabled no-property-in-node. +/* eslint-disable eslint-plugin/no-property-in-node */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultOrder = void 0; +const utils_1 = require("@typescript-eslint/utils"); +const natural_compare_1 = __importDefault(require("natural-compare")); +const util_1 = require("../util"); +const neverConfig = { + type: 'string', + enum: ['never'], +}; +const arrayConfig = (memberTypes) => ({ + type: 'array', + items: { + oneOf: [ + { + $ref: memberTypes, + }, + { + type: 'array', + items: { + $ref: memberTypes, + }, + }, + ], + }, +}); +const objectConfig = (memberTypes) => ({ + type: 'object', + additionalProperties: false, + properties: { + memberTypes: { + oneOf: [arrayConfig(memberTypes), neverConfig], + }, + optionalityOrder: { + $ref: '#/items/0/$defs/optionalityOrderOptions', + }, + order: { + $ref: '#/items/0/$defs/orderOptions', + }, + }, +}); +exports.defaultOrder = [ + // Index signature + 'signature', + 'call-signature', + // Fields + 'public-static-field', + 'protected-static-field', + 'private-static-field', + '#private-static-field', + 'public-decorated-field', + 'protected-decorated-field', + 'private-decorated-field', + 'public-instance-field', + 'protected-instance-field', + 'private-instance-field', + '#private-instance-field', + 'public-abstract-field', + 'protected-abstract-field', + 'public-field', + 'protected-field', + 'private-field', + '#private-field', + 'static-field', + 'instance-field', + 'abstract-field', + 'decorated-field', + 'field', + // Static initialization + 'static-initialization', + // Constructors + 'public-constructor', + 'protected-constructor', + 'private-constructor', + 'constructor', + // Accessors + 'public-static-accessor', + 'protected-static-accessor', + 'private-static-accessor', + '#private-static-accessor', + 'public-decorated-accessor', + 'protected-decorated-accessor', + 'private-decorated-accessor', + 'public-instance-accessor', + 'protected-instance-accessor', + 'private-instance-accessor', + '#private-instance-accessor', + 'public-abstract-accessor', + 'protected-abstract-accessor', + 'public-accessor', + 'protected-accessor', + 'private-accessor', + '#private-accessor', + 'static-accessor', + 'instance-accessor', + 'abstract-accessor', + 'decorated-accessor', + 'accessor', + // Getters + 'public-static-get', + 'protected-static-get', + 'private-static-get', + '#private-static-get', + 'public-decorated-get', + 'protected-decorated-get', + 'private-decorated-get', + 'public-instance-get', + 'protected-instance-get', + 'private-instance-get', + '#private-instance-get', + 'public-abstract-get', + 'protected-abstract-get', + 'public-get', + 'protected-get', + 'private-get', + '#private-get', + 'static-get', + 'instance-get', + 'abstract-get', + 'decorated-get', + 'get', + // Setters + 'public-static-set', + 'protected-static-set', + 'private-static-set', + '#private-static-set', + 'public-decorated-set', + 'protected-decorated-set', + 'private-decorated-set', + 'public-instance-set', + 'protected-instance-set', + 'private-instance-set', + '#private-instance-set', + 'public-abstract-set', + 'protected-abstract-set', + 'public-set', + 'protected-set', + 'private-set', + '#private-set', + 'static-set', + 'instance-set', + 'abstract-set', + 'decorated-set', + 'set', + // Methods + 'public-static-method', + 'protected-static-method', + 'private-static-method', + '#private-static-method', + 'public-decorated-method', + 'protected-decorated-method', + 'private-decorated-method', + 'public-instance-method', + 'protected-instance-method', + 'private-instance-method', + '#private-instance-method', + 'public-abstract-method', + 'protected-abstract-method', + 'public-method', + 'protected-method', + 'private-method', + '#private-method', + 'static-method', + 'instance-method', + 'abstract-method', + 'decorated-method', + 'method', +]; +const allMemberTypes = [ + ...new Set([ + 'readonly-signature', + 'signature', + 'readonly-field', + 'field', + 'method', + 'call-signature', + 'constructor', + 'accessor', + 'get', + 'set', + 'static-initialization', + ].flatMap(type => [ + type, + ...['public', 'protected', 'private', '#private'] + .flatMap(accessibility => [ + type !== 'readonly-signature' && + type !== 'signature' && + type !== 'static-initialization' && + type !== 'call-signature' && + !(type === 'constructor' && accessibility === '#private') + ? `${accessibility}-${type}` // e.g. `public-field` + : [], + // Only class instance fields, methods, accessors, get and set can have decorators attached to them + accessibility !== '#private' && + (type === 'readonly-field' || + type === 'field' || + type === 'method' || + type === 'accessor' || + type === 'get' || + type === 'set') + ? [`${accessibility}-decorated-${type}`, `decorated-${type}`] + : [], + type !== 'constructor' && + type !== 'readonly-signature' && + type !== 'signature' && + type !== 'call-signature' + ? [ + 'static', + 'instance', + // There is no `static-constructor` or `instance-constructor` or `abstract-constructor` + ...(accessibility === '#private' || + accessibility === 'private' + ? [] + : ['abstract']), + ].flatMap(scope => [ + `${scope}-${type}`, + `${accessibility}-${scope}-${type}`, + ]) + : [], + ]) + .flat(), + ])), +]; +const functionExpressions = [ + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, +]; +/** + * Gets the node type. + * + * @param node the node to be evaluated. + */ +function getNodeType(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + case utils_1.AST_NODE_TYPES.MethodDefinition: + case utils_1.AST_NODE_TYPES.TSMethodSignature: + return node.kind; + case utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration: + return 'call-signature'; + case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return 'constructor'; + case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition: + case utils_1.AST_NODE_TYPES.TSPropertySignature: + return node.readonly ? 'readonly-field' : 'field'; + case utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty: + case utils_1.AST_NODE_TYPES.AccessorProperty: + return 'accessor'; + case utils_1.AST_NODE_TYPES.PropertyDefinition: + return node.value && functionExpressions.includes(node.value.type) + ? 'method' + : node.readonly + ? 'readonly-field' + : 'field'; + case utils_1.AST_NODE_TYPES.TSIndexSignature: + return node.readonly ? 'readonly-signature' : 'signature'; + case utils_1.AST_NODE_TYPES.StaticBlock: + return 'static-initialization'; + default: + return null; + } +} +/** + * Gets the raw string value of a member's name + */ +function getMemberRawName(member, sourceCode) { + const { name, type } = (0, util_1.getNameFromMember)(member, sourceCode); + if (type === util_1.MemberNameType.Quoted) { + return name.slice(1, -1); + } + if (type === util_1.MemberNameType.Private) { + return name.slice(1); + } + return name; +} +/** + * Gets the member name based on the member type. + * + * @param node the node to be evaluated. + */ +function getMemberName(node, sourceCode) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSPropertySignature: + case utils_1.AST_NODE_TYPES.TSMethodSignature: + case utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty: + case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition: + case utils_1.AST_NODE_TYPES.AccessorProperty: + case utils_1.AST_NODE_TYPES.PropertyDefinition: + return getMemberRawName(node, sourceCode); + case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + case utils_1.AST_NODE_TYPES.MethodDefinition: + return node.kind === 'constructor' + ? 'constructor' + : getMemberRawName(node, sourceCode); + case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return 'new'; + case utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration: + return 'call'; + case utils_1.AST_NODE_TYPES.TSIndexSignature: + return (0, util_1.getNameFromIndexSignature)(node); + case utils_1.AST_NODE_TYPES.StaticBlock: + return 'static block'; + default: + return null; + } +} +/** + * Returns true if the member is optional based on the member type. + * + * @param node the node to be evaluated. + * + * @returns Whether the member is optional, or false if it cannot be optional at all. + */ +function isMemberOptional(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSPropertySignature: + case utils_1.AST_NODE_TYPES.TSMethodSignature: + case utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty: + case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition: + case utils_1.AST_NODE_TYPES.AccessorProperty: + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + case utils_1.AST_NODE_TYPES.MethodDefinition: + return !!node.optional; + } + return false; +} +/** + * Gets the calculated rank using the provided method definition. + * The algorithm is as follows: + * - Get the rank based on the accessibility-scope-type name, e.g. public-instance-field + * - If there is no order for accessibility-scope-type, then strip out the accessibility. + * - If there is no order for scope-type, then strip out the scope. + * - If there is no order for type, then return -1 + * @param memberGroups the valid names to be validated. + * @param orderConfig the current order to be validated. + * + * @return Index of the matching member type in the order configuration. + */ +function getRankOrder(memberGroups, orderConfig) { + let rank = -1; + const stack = [...memberGroups]; // Get a copy of the member groups + while (stack.length > 0 && rank === -1) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const memberGroup = stack.shift(); + rank = orderConfig.findIndex(memberType => Array.isArray(memberType) + ? memberType.includes(memberGroup) + : memberType === memberGroup); + } + return rank; +} +function getAccessibility(node) { + if ('accessibility' in node && node.accessibility) { + return node.accessibility; + } + if ('key' in node && node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + return '#private'; + } + return 'public'; +} +/** + * Gets the rank of the node given the order. + * @param node the node to be evaluated. + * @param orderConfig the current order to be validated. + * @param supportsModifiers a flag indicating whether the type supports modifiers (scope or accessibility) or not. + */ +function getRank(node, orderConfig, supportsModifiers) { + const type = getNodeType(node); + if (node.type === utils_1.AST_NODE_TYPES.MethodDefinition && + node.value.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return -1; + } + if (type == null) { + // shouldn't happen but just in case, put it on the end + return orderConfig.length - 1; + } + const abstract = node.type === utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty || + node.type === utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition || + node.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition; + const scope = 'static' in node && node.static + ? 'static' + : abstract + ? 'abstract' + : 'instance'; + const accessibility = getAccessibility(node); + // Collect all existing member groups that apply to this node... + // (e.g. 'public-instance-field', 'instance-field', 'public-field', 'constructor' etc.) + const memberGroups = []; + if (supportsModifiers) { + const decorated = 'decorators' in node && node.decorators.length > 0; + if (decorated && + (type === 'readonly-field' || + type === 'field' || + type === 'method' || + type === 'accessor' || + type === 'get' || + type === 'set')) { + memberGroups.push(`${accessibility}-decorated-${type}`); + memberGroups.push(`decorated-${type}`); + if (type === 'readonly-field') { + memberGroups.push(`${accessibility}-decorated-field`); + memberGroups.push(`decorated-field`); + } + } + if (type !== 'readonly-signature' && + type !== 'signature' && + type !== 'static-initialization') { + if (type !== 'constructor') { + // Constructors have no scope + memberGroups.push(`${accessibility}-${scope}-${type}`); + memberGroups.push(`${scope}-${type}`); + if (type === 'readonly-field') { + memberGroups.push(`${accessibility}-${scope}-field`); + memberGroups.push(`${scope}-field`); + } + } + memberGroups.push(`${accessibility}-${type}`); + if (type === 'readonly-field') { + memberGroups.push(`${accessibility}-field`); + } + } + } + memberGroups.push(type); + if (type === 'readonly-signature') { + memberGroups.push('signature'); + } + else if (type === 'readonly-field') { + memberGroups.push('field'); + } + // ...then get the rank order for those member groups based on the node + return getRankOrder(memberGroups, orderConfig); +} +/** + * Groups members into arrays of consecutive members with the same rank. + * If, for example, the memberSet parameter looks like the following... + * @example + * ``` + * interface Foo { + * [a: string]: number; + * + * a: x; + * B: x; + * c: x; + * + * c(): void; + * B(): void; + * a(): void; + * + * (): Baz; + * + * new (): Bar; + * } + * ``` + * ...the resulting array will look like: [[a, B, c], [c, B, a]]. + * @param memberSet The members to be grouped. + * @param memberType The configured order of member types. + * @param supportsModifiers It'll get passed to getRank(). + * @returns The array of groups of members. + */ +function groupMembersByType(members, memberTypes, supportsModifiers) { + const groupedMembers = []; + const memberRanks = members.map(member => getRank(member, memberTypes, supportsModifiers)); + let previousRank = undefined; + members.forEach((member, index) => { + if (index === members.length - 1) { + return; + } + const rankOfCurrentMember = memberRanks[index]; + const rankOfNextMember = memberRanks[index + 1]; + if (rankOfCurrentMember === previousRank) { + groupedMembers.at(-1)?.push(member); + } + else if (rankOfCurrentMember === rankOfNextMember) { + groupedMembers.push([member]); + previousRank = rankOfCurrentMember; + } + }); + return groupedMembers; +} +/** + * Gets the lowest possible rank(s) higher than target. + * e.g. given the following order: + * ... + * public-static-method + * protected-static-method + * private-static-method + * public-instance-method + * protected-instance-method + * private-instance-method + * ... + * and considering that a public-instance-method has already been declared, so ranks contains + * public-instance-method, then the lowest possible rank for public-static-method is + * public-instance-method. + * If a lowest possible rank is a member group, a comma separated list of ranks is returned. + * @param ranks the existing ranks in the object. + * @param target the minimum target rank to filter on. + * @param order the current order to be validated. + * @returns the name(s) of the lowest possible rank without dashes (-). + */ +function getLowestRank(ranks, target, order) { + let lowest = ranks[ranks.length - 1]; + ranks.forEach(rank => { + if (rank > target) { + lowest = Math.min(lowest, rank); + } + }); + const lowestRank = order[lowest]; + const lowestRanks = Array.isArray(lowestRank) ? lowestRank : [lowestRank]; + return lowestRanks.map(rank => rank.replaceAll('-', ' ')).join(', '); +} +exports.default = (0, util_1.createRule)({ + name: 'member-ordering', + meta: { + type: 'suggestion', + docs: { + description: 'Require a consistent member declaration order', + }, + messages: { + incorrectGroupOrder: 'Member {{name}} should be declared before all {{rank}} definitions.', + incorrectOrder: 'Member {{member}} should be declared before member {{beforeMember}}.', + incorrectRequiredMembersOrder: `Member {{member}} should be declared after all {{optionalOrRequired}} members.`, + }, + schema: [ + { + type: 'object', + $defs: { + allItems: { + type: 'string', + enum: allMemberTypes, + }, + optionalityOrderOptions: { + type: 'string', + enum: ['optional-first', 'required-first'], + }, + orderOptions: { + type: 'string', + enum: [ + 'alphabetically', + 'alphabetically-case-insensitive', + 'as-written', + 'natural', + 'natural-case-insensitive', + ], + }, + typeItems: { + type: 'string', + enum: [ + 'readonly-signature', + 'signature', + 'readonly-field', + 'field', + 'method', + 'constructor', + ], + }, + // ajv is order-dependent; these configs must come last + baseConfig: { + oneOf: [ + neverConfig, + arrayConfig('#/items/0/$defs/allItems'), + objectConfig('#/items/0/$defs/allItems'), + ], + }, + typesConfig: { + oneOf: [ + neverConfig, + arrayConfig('#/items/0/$defs/typeItems'), + objectConfig('#/items/0/$defs/typeItems'), + ], + }, + }, + additionalProperties: false, + properties: { + classes: { + $ref: '#/items/0/$defs/baseConfig', + }, + classExpressions: { + $ref: '#/items/0/$defs/baseConfig', + }, + default: { + $ref: '#/items/0/$defs/baseConfig', + }, + interfaces: { + $ref: '#/items/0/$defs/typesConfig', + }, + typeLiterals: { + $ref: '#/items/0/$defs/typesConfig', + }, + }, + }, + ], + }, + defaultOptions: [ + { + default: { + memberTypes: exports.defaultOrder, + }, + }, + ], + create(context, [options]) { + /** + * Checks if the member groups are correctly sorted. + * + * @param members Members to be validated. + * @param groupOrder Group order to be validated. + * @param supportsModifiers A flag indicating whether the type supports modifiers (scope or accessibility) or not. + * + * @return Array of member groups or null if one of the groups is not correctly sorted. + */ + function checkGroupSort(members, groupOrder, supportsModifiers) { + const previousRanks = []; + const memberGroups = []; + let isCorrectlySorted = true; + // Find first member which isn't correctly sorted + for (const member of members) { + const rank = getRank(member, groupOrder, supportsModifiers); + const name = getMemberName(member, context.sourceCode); + const rankLastMember = previousRanks[previousRanks.length - 1]; + if (rank === -1) { + continue; + } + // Works for 1st item because x < undefined === false for any x (typeof string) + if (rank < rankLastMember) { + context.report({ + node: member, + messageId: 'incorrectGroupOrder', + data: { + name, + rank: getLowestRank(previousRanks, rank, groupOrder), + }, + }); + isCorrectlySorted = false; + } + else if (rank === rankLastMember) { + // Same member group --> Push to existing member group array + memberGroups[memberGroups.length - 1].push(member); + } + else { + // New member group --> Create new member group array + previousRanks.push(rank); + memberGroups.push([member]); + } + } + return isCorrectlySorted ? memberGroups : null; + } + /** + * Checks if the members are alphabetically sorted. + * + * @param members Members to be validated. + * @param order What order the members should be sorted in. + * + * @return True if all members are correctly sorted. + */ + function checkAlphaSort(members, order) { + let previousName = ''; + let isCorrectlySorted = true; + // Find first member which isn't correctly sorted + members.forEach(member => { + const name = getMemberName(member, context.sourceCode); + // Note: Not all members have names + if (name) { + if (naturalOutOfOrder(name, previousName, order)) { + context.report({ + node: member, + messageId: 'incorrectOrder', + data: { + beforeMember: previousName, + member: name, + }, + }); + isCorrectlySorted = false; + } + previousName = name; + } + }); + return isCorrectlySorted; + } + function naturalOutOfOrder(name, previousName, order) { + if (name === previousName) { + return false; + } + switch (order) { + case 'alphabetically': + return name < previousName; + case 'alphabetically-case-insensitive': + return name.toLowerCase() < previousName.toLowerCase(); + case 'natural': + return (0, natural_compare_1.default)(name, previousName) !== 1; + case 'natural-case-insensitive': + return ((0, natural_compare_1.default)(name.toLowerCase(), previousName.toLowerCase()) !== 1); + } + } + /** + * Checks if the order of optional and required members is correct based + * on the given 'required' parameter. + * + * @param members Members to be validated. + * @param optionalityOrder Where to place optional members, if not intermixed. + * + * @return True if all required and optional members are correctly sorted. + */ + function checkRequiredOrder(members, optionalityOrder) { + const switchIndex = members.findIndex((member, i) => i && isMemberOptional(member) !== isMemberOptional(members[i - 1])); + const report = (member) => context.report({ + loc: member.loc, + messageId: 'incorrectRequiredMembersOrder', + data: { + member: getMemberName(member, context.sourceCode), + optionalOrRequired: optionalityOrder === 'required-first' ? 'required' : 'optional', + }, + }); + // if the optionality of the first item is correct (based on optionalityOrder) + // then the first 0 inclusive to switchIndex exclusive members all + // have the correct optionality + if (isMemberOptional(members[0]) !== + (optionalityOrder === 'optional-first')) { + report(members[0]); + return false; + } + for (let i = switchIndex + 1; i < members.length; i++) { + if (isMemberOptional(members[i]) !== + isMemberOptional(members[switchIndex])) { + report(members[switchIndex]); + return false; + } + } + return true; + } + /** + * Validates if all members are correctly sorted. + * + * @param members Members to be validated. + * @param orderConfig Order config to be validated. + * @param supportsModifiers A flag indicating whether the type supports modifiers (scope or accessibility) or not. + */ + function validateMembersOrder(members, orderConfig, supportsModifiers) { + if (orderConfig === 'never') { + return; + } + // Standardize config + let order; + let memberTypes; + let optionalityOrder; + /** + * It runs an alphabetic sort on the groups of the members of the class in the source code. + * @param memberSet The members in the class of the source code on which the grouping operation will be performed. + */ + const checkAlphaSortForAllMembers = (memberSet) => { + const hasAlphaSort = !!(order && order !== 'as-written'); + if (hasAlphaSort && Array.isArray(memberTypes)) { + groupMembersByType(memberSet, memberTypes, supportsModifiers).forEach(members => { + checkAlphaSort(members, order); + }); + } + }; + // returns true if everything is good and false if an error was reported + const checkOrder = (memberSet) => { + const hasAlphaSort = !!(order && order !== 'as-written'); + // Check order + if (Array.isArray(memberTypes)) { + const grouped = checkGroupSort(memberSet, memberTypes, supportsModifiers); + if (grouped == null) { + checkAlphaSortForAllMembers(members); + return false; + } + if (hasAlphaSort) { + grouped.map(groupMember => checkAlphaSort(groupMember, order)); + } + } + else if (hasAlphaSort) { + return checkAlphaSort(memberSet, order); + } + return false; + }; + if (Array.isArray(orderConfig)) { + memberTypes = orderConfig; + } + else { + order = orderConfig.order; + memberTypes = orderConfig.memberTypes; + optionalityOrder = orderConfig.optionalityOrder; + } + if (!optionalityOrder) { + checkOrder(members); + return; + } + const switchIndex = members.findIndex((member, i) => i && isMemberOptional(member) !== isMemberOptional(members[i - 1])); + if (switchIndex !== -1) { + if (!checkRequiredOrder(members, optionalityOrder)) { + return; + } + checkOrder(members.slice(0, switchIndex)); + checkOrder(members.slice(switchIndex)); + } + else { + checkOrder(members); + } + } + // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + return { + ClassDeclaration(node) { + validateMembersOrder(node.body.body, options.classes ?? options.default, true); + }, + 'ClassDeclaration, FunctionDeclaration'(node) { + if ('superClass' in node) { + // ... + } + }, + ClassExpression(node) { + validateMembersOrder(node.body.body, options.classExpressions ?? options.default, true); + }, + TSInterfaceDeclaration(node) { + validateMembersOrder(node.body.body, options.interfaces ?? options.default, false); + }, + TSTypeLiteral(node) { + validateMembersOrder(node.members, options.typeLiterals ?? options.default, false); + }, + }; + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.d.ts.map new file mode 100644 index 0000000..bcd1ad0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"method-signature-style.d.ts","sourceRoot":"","sources":["../../src/rules/method-signature-style.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AACjD,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,eAAe,CAAC;;AAEzD,wBAmOG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js new file mode 100644 index 0000000..741e3ec --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js @@ -0,0 +1,176 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'method-signature-style', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using a particular method signature syntax', + }, + fixable: 'code', + messages: { + errorMethod: 'Shorthand method signature is forbidden. Use a function property instead.', + errorProperty: 'Function property signature is forbidden. Use a method shorthand instead.', + }, + schema: [ + { + type: 'string', + enum: ['property', 'method'], + }, + ], + }, + defaultOptions: ['property'], + create(context, [mode]) { + function getMethodKey(node) { + let key = context.sourceCode.getText(node.key); + if (node.computed) { + key = `[${key}]`; + } + if (node.optional) { + key = `${key}?`; + } + if (node.readonly) { + key = `readonly ${key}`; + } + return key; + } + function getMethodParams(node) { + let params = '()'; + if (node.params.length > 0) { + const openingParen = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(node.params[0], util_1.isOpeningParenToken), 'Missing opening paren before first parameter'); + const closingParen = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.params[node.params.length - 1], util_1.isClosingParenToken), 'Missing closing paren after last parameter'); + params = context.sourceCode.text.substring(openingParen.range[0], closingParen.range[1]); + } + if (node.typeParameters != null) { + const typeParams = context.sourceCode.getText(node.typeParameters); + params = `${typeParams}${params}`; + } + return params; + } + function getMethodReturnType(node) { + return node.returnType == null + ? // if the method has no return type, it implicitly has an `any` return type + // we just make it explicit here so we can do the fix + 'any' + : context.sourceCode.getText(node.returnType.typeAnnotation); + } + function getDelimiter(node) { + const lastToken = context.sourceCode.getLastToken(node); + if (lastToken && + ((0, util_1.isSemicolonToken)(lastToken) || (0, util_1.isCommaToken)(lastToken))) { + return lastToken.value; + } + return ''; + } + function isNodeParentModuleDeclaration(node) { + if (!node.parent) { + return false; + } + if (node.parent.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration) { + return true; + } + if (node.parent.type === utils_1.AST_NODE_TYPES.Program) { + return false; + } + return isNodeParentModuleDeclaration(node.parent); + } + return { + ...(mode === 'property' && { + TSMethodSignature(methodNode) { + if (methodNode.kind !== 'method') { + return; + } + const parent = methodNode.parent; + const members = parent.type === utils_1.AST_NODE_TYPES.TSInterfaceBody + ? parent.body + : parent.members; + const duplicatedKeyMethodNodes = members.filter((element) => element.type === utils_1.AST_NODE_TYPES.TSMethodSignature && + element !== methodNode && + getMethodKey(element) === getMethodKey(methodNode)); + const isParentModule = isNodeParentModuleDeclaration(methodNode); + if (duplicatedKeyMethodNodes.length > 0) { + if (isParentModule) { + context.report({ + node: methodNode, + messageId: 'errorMethod', + }); + } + else { + context.report({ + node: methodNode, + messageId: 'errorMethod', + *fix(fixer) { + const methodNodes = [ + methodNode, + ...duplicatedKeyMethodNodes, + ].sort((a, b) => (a.range[0] < b.range[0] ? -1 : 1)); + const typeString = methodNodes + .map(node => { + const params = getMethodParams(node); + const returnType = getMethodReturnType(node); + return `(${params} => ${returnType})`; + }) + .join(' & '); + const key = getMethodKey(methodNode); + const delimiter = getDelimiter(methodNode); + yield fixer.replaceText(methodNode, `${key}: ${typeString}${delimiter}`); + for (const node of duplicatedKeyMethodNodes) { + const lastToken = context.sourceCode.getLastToken(node); + if (lastToken) { + const nextToken = context.sourceCode.getTokenAfter(lastToken); + if (nextToken) { + yield fixer.remove(node); + yield fixer.replaceTextRange([lastToken.range[1], nextToken.range[0]], ''); + } + } + } + }, + }); + } + return; + } + if (isParentModule) { + context.report({ + node: methodNode, + messageId: 'errorMethod', + }); + } + else { + context.report({ + node: methodNode, + messageId: 'errorMethod', + fix: fixer => { + const key = getMethodKey(methodNode); + const params = getMethodParams(methodNode); + const returnType = getMethodReturnType(methodNode); + const delimiter = getDelimiter(methodNode); + return fixer.replaceText(methodNode, `${key}: ${params} => ${returnType}${delimiter}`); + }, + }); + } + }, + }), + ...(mode === 'method' && { + TSPropertySignature(propertyNode) { + const typeNode = propertyNode.typeAnnotation?.typeAnnotation; + if (typeNode?.type !== utils_1.AST_NODE_TYPES.TSFunctionType) { + return; + } + context.report({ + node: propertyNode, + messageId: 'errorProperty', + fix: fixer => { + const key = getMethodKey(propertyNode); + const params = getMethodParams(typeNode); + const returnType = getMethodReturnType(typeNode); + const delimiter = getDelimiter(propertyNode); + return fixer.replaceText(propertyNode, `${key}${params}: ${returnType}${delimiter}`); + }, + }); + }, + }), + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.d.ts.map new file mode 100644 index 0000000..7f6a562 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/rules/naming-convention-utils/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,SAAS,IAAI;IACb,eAAe,IAAA;IACf,UAAU,IAAA;IACV,gBAAgB,IAAA;IAChB,UAAU,IAAA;IACV,UAAU,IAAA;CACX;AACD,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAErE,oBAAY,iBAAiB;IAC3B,MAAM,IAAI;IACV,KAAK,IAAA;IACL,OAAO,IAAA;IAGP,aAAa,IAAA;IACb,WAAW,IAAA;IACX,mBAAmB,IAAA;CACpB;AACD,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAErE,oBAAY,SAAS;IAEnB,QAAQ,IAAS;IACjB,QAAQ,IAAS;IACjB,SAAS,IAAS;IAGlB,iBAAiB,IAAS;IAC1B,eAAe,KAAS;IACxB,UAAU,KAAS;IACnB,WAAW,KAAS;IACpB,mBAAmB,MAAS;IAC5B,UAAU,MAAS;IACnB,aAAa,MAAS;IACtB,qBAAqB,OAAU;IAC/B,YAAY,OAAU;IACtB,YAAY,OAAU;IAGtB,KAAK,OAAU;IACf,SAAS,QAAU;IACnB,SAAS,QAAU;IACnB,IAAI,QAAU;IACd,aAAa,SAAU;IAGvB,MAAM,SAAU;CACjB;AACD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,SAAS,CAAC;AAErD,oBAAY,aAAa;IAEvB,OAAO,KAAK;IACZ,YAAY,IAGS;IACrB,UAAU,OAUc;IACxB,QAAQ,SAKiB;IACzB,MAAM,MAGgB;IACtB,QAAQ,OAGgB;IACxB,QAAQ,OAAyD;CAElE;AACD,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,aAAa,CAAC;AAC7D,MAAM,MAAM,gCAAgC,GACxC,mBAAmB,GACnB,eAAe,CAAC;AAEpB,oBAAY,SAAS;IAEnB,KAAK,IAAS;IAEd,QAAQ,IAAS;IAEjB,MAAM,IAAS;IAEf,MAAM,IAAS;IACf,SAAS,KAAS;IAClB,OAAO,KAAS;IAChB,UAAU,KAAS;IACnB,QAAQ,MAAS;IAEjB,YAAY,MAAS;IAErB,MAAM,MAAS;IAEf,QAAQ,OAAU;IAElB,MAAM,OAAU;IAEhB,cAAc,OAAU;IAExB,QAAQ,OAAU;IAElB,KAAK,QAAU;IAEf,OAAO,QAAU;IAEjB,SAAS,QAAU;CAGpB;AACD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,SAAS,CAAC;AAErD,oBAAY,aAAa;IACvB,OAAO,SAAU;IACjB,MAAM,SAAU;IAChB,MAAM,SAAU;IAChB,QAAQ,UAAU;IAClB,KAAK,UAAU;CAChB;AACD,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.js new file mode 100644 index 0000000..5696653 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.js @@ -0,0 +1,102 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeModifiers = exports.Modifiers = exports.MetaSelectors = exports.Selectors = exports.UnderscoreOptions = exports.PredefinedFormats = void 0; +var PredefinedFormats; +(function (PredefinedFormats) { + PredefinedFormats[PredefinedFormats["camelCase"] = 1] = "camelCase"; + PredefinedFormats[PredefinedFormats["strictCamelCase"] = 2] = "strictCamelCase"; + PredefinedFormats[PredefinedFormats["PascalCase"] = 3] = "PascalCase"; + PredefinedFormats[PredefinedFormats["StrictPascalCase"] = 4] = "StrictPascalCase"; + PredefinedFormats[PredefinedFormats["snake_case"] = 5] = "snake_case"; + PredefinedFormats[PredefinedFormats["UPPER_CASE"] = 6] = "UPPER_CASE"; +})(PredefinedFormats || (exports.PredefinedFormats = PredefinedFormats = {})); +var UnderscoreOptions; +(function (UnderscoreOptions) { + UnderscoreOptions[UnderscoreOptions["forbid"] = 1] = "forbid"; + UnderscoreOptions[UnderscoreOptions["allow"] = 2] = "allow"; + UnderscoreOptions[UnderscoreOptions["require"] = 3] = "require"; + // special cases as it's common practice to use double underscore + UnderscoreOptions[UnderscoreOptions["requireDouble"] = 4] = "requireDouble"; + UnderscoreOptions[UnderscoreOptions["allowDouble"] = 5] = "allowDouble"; + UnderscoreOptions[UnderscoreOptions["allowSingleOrDouble"] = 6] = "allowSingleOrDouble"; +})(UnderscoreOptions || (exports.UnderscoreOptions = UnderscoreOptions = {})); +var Selectors; +(function (Selectors) { + // variableLike + Selectors[Selectors["variable"] = 1] = "variable"; + Selectors[Selectors["function"] = 2] = "function"; + Selectors[Selectors["parameter"] = 4] = "parameter"; + // memberLike + Selectors[Selectors["parameterProperty"] = 8] = "parameterProperty"; + Selectors[Selectors["classicAccessor"] = 16] = "classicAccessor"; + Selectors[Selectors["enumMember"] = 32] = "enumMember"; + Selectors[Selectors["classMethod"] = 64] = "classMethod"; + Selectors[Selectors["objectLiteralMethod"] = 128] = "objectLiteralMethod"; + Selectors[Selectors["typeMethod"] = 256] = "typeMethod"; + Selectors[Selectors["classProperty"] = 512] = "classProperty"; + Selectors[Selectors["objectLiteralProperty"] = 1024] = "objectLiteralProperty"; + Selectors[Selectors["typeProperty"] = 2048] = "typeProperty"; + Selectors[Selectors["autoAccessor"] = 4096] = "autoAccessor"; + // typeLike + Selectors[Selectors["class"] = 8192] = "class"; + Selectors[Selectors["interface"] = 16384] = "interface"; + Selectors[Selectors["typeAlias"] = 32768] = "typeAlias"; + Selectors[Selectors["enum"] = 65536] = "enum"; + Selectors[Selectors["typeParameter"] = 131072] = "typeParameter"; + // other + Selectors[Selectors["import"] = 262144] = "import"; +})(Selectors || (exports.Selectors = Selectors = {})); +var MetaSelectors; +(function (MetaSelectors) { + /* eslint-disable @typescript-eslint/prefer-literal-enum-member */ + MetaSelectors[MetaSelectors["default"] = -1] = "default"; + MetaSelectors[MetaSelectors["variableLike"] = 7] = "variableLike"; + MetaSelectors[MetaSelectors["memberLike"] = 8184] = "memberLike"; + MetaSelectors[MetaSelectors["typeLike"] = 253952] = "typeLike"; + MetaSelectors[MetaSelectors["method"] = 448] = "method"; + MetaSelectors[MetaSelectors["property"] = 3584] = "property"; + MetaSelectors[MetaSelectors["accessor"] = 4112] = "accessor"; + /* eslint-enable @typescript-eslint/prefer-literal-enum-member */ +})(MetaSelectors || (exports.MetaSelectors = MetaSelectors = {})); +var Modifiers; +(function (Modifiers) { + // const variable + Modifiers[Modifiers["const"] = 1] = "const"; + // readonly members + Modifiers[Modifiers["readonly"] = 2] = "readonly"; + // static members + Modifiers[Modifiers["static"] = 4] = "static"; + // member accessibility + Modifiers[Modifiers["public"] = 8] = "public"; + Modifiers[Modifiers["protected"] = 16] = "protected"; + Modifiers[Modifiers["private"] = 32] = "private"; + Modifiers[Modifiers["#private"] = 64] = "#private"; + Modifiers[Modifiers["abstract"] = 128] = "abstract"; + // destructured variable + Modifiers[Modifiers["destructured"] = 256] = "destructured"; + // variables declared in the top-level scope + Modifiers[Modifiers["global"] = 512] = "global"; + // things that are exported + Modifiers[Modifiers["exported"] = 1024] = "exported"; + // things that are unused + Modifiers[Modifiers["unused"] = 2048] = "unused"; + // properties that require quoting + Modifiers[Modifiers["requiresQuotes"] = 4096] = "requiresQuotes"; + // class members that are overridden + Modifiers[Modifiers["override"] = 8192] = "override"; + // class methods, object function properties, or functions that are async via the `async` keyword + Modifiers[Modifiers["async"] = 16384] = "async"; + // default imports + Modifiers[Modifiers["default"] = 32768] = "default"; + // namespace imports + Modifiers[Modifiers["namespace"] = 65536] = "namespace"; + // make sure TypeModifiers starts at Modifiers + 1 or else sorting won't work +})(Modifiers || (exports.Modifiers = Modifiers = {})); +var TypeModifiers; +(function (TypeModifiers) { + TypeModifiers[TypeModifiers["boolean"] = 131072] = "boolean"; + TypeModifiers[TypeModifiers["string"] = 262144] = "string"; + TypeModifiers[TypeModifiers["number"] = 524288] = "number"; + TypeModifiers[TypeModifiers["function"] = 1048576] = "function"; + TypeModifiers[TypeModifiers["array"] = 2097152] = "array"; +})(TypeModifiers || (exports.TypeModifiers = TypeModifiers = {})); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format.d.ts.map new file mode 100644 index 0000000..1919b9e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/rules/naming-convention-utils/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAkG5C,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CACpD,MAAM,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAQrD,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format.js new file mode 100644 index 0000000..e2a6eec --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format.js @@ -0,0 +1,89 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PredefinedFormatToCheckFunction = void 0; +const enums_1 = require("./enums"); +/* +These format functions are taken from `tslint-consistent-codestyle/naming-convention`: +https://github.com/ajafff/tslint-consistent-codestyle/blob/ab156cc8881bcc401236d999f4ce034b59039e81/rules/namingConventionRule.ts#L603-L645 + +The license for the code can be viewed here: +https://github.com/ajafff/tslint-consistent-codestyle/blob/ab156cc8881bcc401236d999f4ce034b59039e81/LICENSE +*/ +/* +Why not regex here? Because it's actually really, really difficult to create a regex to handle +all of the unicode cases, and we have many non-english users that use non-english characters. +https://gist.github.com/mathiasbynens/6334847 +*/ +function isPascalCase(name) { + return (name.length === 0 || + (name[0] === name[0].toUpperCase() && !name.includes('_'))); +} +function isStrictPascalCase(name) { + return (name.length === 0 || + (name[0] === name[0].toUpperCase() && hasStrictCamelHumps(name, true))); +} +function isCamelCase(name) { + return (name.length === 0 || + (name[0] === name[0].toLowerCase() && !name.includes('_'))); +} +function isStrictCamelCase(name) { + return (name.length === 0 || + (name[0] === name[0].toLowerCase() && hasStrictCamelHumps(name, false))); +} +function hasStrictCamelHumps(name, isUpper) { + function isUppercaseChar(char) { + return char === char.toUpperCase() && char !== char.toLowerCase(); + } + if (name.startsWith('_')) { + return false; + } + for (let i = 1; i < name.length; ++i) { + if (name[i] === '_') { + return false; + } + if (isUpper === isUppercaseChar(name[i])) { + if (isUpper) { + return false; + } + } + else { + isUpper = !isUpper; + } + } + return true; +} +function isSnakeCase(name) { + return (name.length === 0 || + (name === name.toLowerCase() && validateUnderscores(name))); +} +function isUpperCase(name) { + return (name.length === 0 || + (name === name.toUpperCase() && validateUnderscores(name))); +} +/** Check for leading trailing and adjacent underscores */ +function validateUnderscores(name) { + if (name.startsWith('_')) { + return false; + } + let wasUnderscore = false; + for (let i = 1; i < name.length; ++i) { + if (name[i] === '_') { + if (wasUnderscore) { + return false; + } + wasUnderscore = true; + } + else { + wasUnderscore = false; + } + } + return !wasUnderscore; +} +exports.PredefinedFormatToCheckFunction = { + [enums_1.PredefinedFormats.camelCase]: isCamelCase, + [enums_1.PredefinedFormats.PascalCase]: isPascalCase, + [enums_1.PredefinedFormats.snake_case]: isSnakeCase, + [enums_1.PredefinedFormats.strictCamelCase]: isStrictCamelCase, + [enums_1.PredefinedFormats.StrictPascalCase]: isStrictPascalCase, + [enums_1.PredefinedFormats.UPPER_CASE]: isUpperCase, +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/index.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/index.d.ts.map new file mode 100644 index 0000000..f8900c9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/naming-convention-utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,YAAY,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvD,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/index.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/index.js new file mode 100644 index 0000000..0db6e93 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selectorTypeToMessageString = exports.SCHEMA = exports.parseOptions = exports.Modifiers = void 0; +var enums_1 = require("./enums"); +Object.defineProperty(exports, "Modifiers", { enumerable: true, get: function () { return enums_1.Modifiers; } }); +var parse_options_1 = require("./parse-options"); +Object.defineProperty(exports, "parseOptions", { enumerable: true, get: function () { return parse_options_1.parseOptions; } }); +var schema_1 = require("./schema"); +Object.defineProperty(exports, "SCHEMA", { enumerable: true, get: function () { return schema_1.SCHEMA; } }); +var shared_1 = require("./shared"); +Object.defineProperty(exports, "selectorTypeToMessageString", { enumerable: true, get: function () { return shared_1.selectorTypeToMessageString; } }); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options.d.ts.map new file mode 100644 index 0000000..b24b230 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-options.d.ts","sourceRoot":"","sources":["../../../src/rules/naming-convention-utils/parse-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAEP,aAAa,EAEd,MAAM,SAAS,CAAC;AA6EjB,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAS5D"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options.js new file mode 100644 index 0000000..eff503f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseOptions = parseOptions; +const util_1 = require("../../util"); +const enums_1 = require("./enums"); +const shared_1 = require("./shared"); +const validator_1 = require("./validator"); +function normalizeOption(option) { + let weight = 0; + option.modifiers?.forEach(mod => { + weight |= enums_1.Modifiers[mod]; + }); + option.types?.forEach(mod => { + weight |= enums_1.TypeModifiers[mod]; + }); + // give selectors with a filter the _highest_ priority + if (option.filter) { + weight |= 1 << 30; + } + const normalizedOption = { + // format options + custom: option.custom + ? { + match: option.custom.match, + regex: new RegExp(option.custom.regex, 'u'), + } + : null, + filter: option.filter != null + ? typeof option.filter === 'string' + ? { + match: true, + regex: new RegExp(option.filter, 'u'), + } + : { + match: option.filter.match, + regex: new RegExp(option.filter.regex, 'u'), + } + : null, + format: option.format ? option.format.map(f => enums_1.PredefinedFormats[f]) : null, + leadingUnderscore: option.leadingUnderscore != null + ? enums_1.UnderscoreOptions[option.leadingUnderscore] + : null, + modifiers: option.modifiers?.map(m => enums_1.Modifiers[m]) ?? null, + prefix: option.prefix && option.prefix.length > 0 ? option.prefix : null, + suffix: option.suffix && option.suffix.length > 0 ? option.suffix : null, + trailingUnderscore: option.trailingUnderscore != null + ? enums_1.UnderscoreOptions[option.trailingUnderscore] + : null, + types: option.types?.map(m => enums_1.TypeModifiers[m]) ?? null, + // calculated ordering weight based on modifiers + modifierWeight: weight, + }; + const selectors = Array.isArray(option.selector) + ? option.selector + : [option.selector]; + return selectors.map(selector => ({ + selector: (0, shared_1.isMetaSelector)(selector) + ? enums_1.MetaSelectors[selector] + : enums_1.Selectors[selector], + ...normalizedOption, + })); +} +function parseOptions(context) { + const normalizedOptions = context.options.flatMap(normalizeOption); + return Object.fromEntries((0, util_1.getEnumNames)(enums_1.Selectors).map(k => [ + k, + (0, validator_1.createValidator)(k, context, normalizedOptions), + ])); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.d.ts.map new file mode 100644 index 0000000..6363d48 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/rules/naming-convention-utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AA2L3D,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,WA+I/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.js new file mode 100644 index 0000000..719777d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.js @@ -0,0 +1,305 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SCHEMA = void 0; +const util_1 = require("../../util"); +const enums_1 = require("./enums"); +const $DEFS = { + // enums + predefinedFormats: { + enum: (0, util_1.getEnumNames)(enums_1.PredefinedFormats), + type: 'string', + }, + typeModifiers: { + enum: (0, util_1.getEnumNames)(enums_1.TypeModifiers), + type: 'string', + }, + underscoreOptions: { + enum: (0, util_1.getEnumNames)(enums_1.UnderscoreOptions), + type: 'string', + }, + // repeated types + formatOptionsConfig: { + oneOf: [ + { + additionalItems: false, + items: { + $ref: '#/$defs/predefinedFormats', + }, + type: 'array', + }, + { + type: 'null', + }, + ], + }, + matchRegexConfig: { + additionalProperties: false, + properties: { + match: { type: 'boolean' }, + regex: { type: 'string' }, + }, + required: ['match', 'regex'], + type: 'object', + }, + prefixSuffixConfig: { + additionalItems: false, + items: { + minLength: 1, + type: 'string', + }, + type: 'array', + }, +}; +const UNDERSCORE_SCHEMA = { + $ref: '#/$defs/underscoreOptions', +}; +const PREFIX_SUFFIX_SCHEMA = { + $ref: '#/$defs/prefixSuffixConfig', +}; +const MATCH_REGEX_SCHEMA = { + $ref: '#/$defs/matchRegexConfig', +}; +const FORMAT_OPTIONS_PROPERTIES = { + custom: MATCH_REGEX_SCHEMA, + failureMessage: { + type: 'string', + }, + format: { + $ref: '#/$defs/formatOptionsConfig', + }, + leadingUnderscore: UNDERSCORE_SCHEMA, + prefix: PREFIX_SUFFIX_SCHEMA, + suffix: PREFIX_SUFFIX_SCHEMA, + trailingUnderscore: UNDERSCORE_SCHEMA, +}; +function selectorSchema(selectorString, allowType, modifiers) { + const selector = { + filter: { + oneOf: [ + { + minLength: 1, + type: 'string', + }, + MATCH_REGEX_SCHEMA, + ], + }, + selector: { + enum: [selectorString], + type: 'string', + }, + }; + if (modifiers && modifiers.length > 0) { + selector.modifiers = { + additionalItems: false, + items: { + enum: modifiers, + type: 'string', + }, + type: 'array', + }; + } + if (allowType) { + selector.types = { + additionalItems: false, + items: { + $ref: '#/$defs/typeModifiers', + }, + type: 'array', + }; + } + return [ + { + additionalProperties: false, + description: `Selector '${selectorString}'`, + properties: { + ...FORMAT_OPTIONS_PROPERTIES, + ...selector, + }, + required: ['selector', 'format'], + type: 'object', + }, + ]; +} +function selectorsSchema() { + return { + additionalProperties: false, + description: 'Multiple selectors in one config', + properties: { + ...FORMAT_OPTIONS_PROPERTIES, + filter: { + oneOf: [ + { + minLength: 1, + type: 'string', + }, + MATCH_REGEX_SCHEMA, + ], + }, + modifiers: { + additionalItems: false, + items: { + enum: (0, util_1.getEnumNames)(enums_1.Modifiers), + type: 'string', + }, + type: 'array', + }, + selector: { + additionalItems: false, + items: { + enum: [...(0, util_1.getEnumNames)(enums_1.MetaSelectors), ...(0, util_1.getEnumNames)(enums_1.Selectors)], + type: 'string', + }, + type: 'array', + }, + types: { + additionalItems: false, + items: { + $ref: '#/$defs/typeModifiers', + }, + type: 'array', + }, + }, + required: ['selector', 'format'], + type: 'object', + }; +} +exports.SCHEMA = { + $defs: $DEFS, + additionalItems: false, + items: { + oneOf: [ + selectorsSchema(), + ...selectorSchema('default', false, (0, util_1.getEnumNames)(enums_1.Modifiers)), + ...selectorSchema('variableLike', false, ['unused', 'async']), + ...selectorSchema('variable', true, [ + 'const', + 'destructured', + 'exported', + 'global', + 'unused', + 'async', + ]), + ...selectorSchema('function', false, [ + 'exported', + 'global', + 'unused', + 'async', + ]), + ...selectorSchema('parameter', true, ['destructured', 'unused']), + ...selectorSchema('memberLike', false, [ + 'abstract', + 'private', + '#private', + 'protected', + 'public', + 'readonly', + 'requiresQuotes', + 'static', + 'override', + 'async', + ]), + ...selectorSchema('classProperty', true, [ + 'abstract', + 'private', + '#private', + 'protected', + 'public', + 'readonly', + 'requiresQuotes', + 'static', + 'override', + ]), + ...selectorSchema('objectLiteralProperty', true, [ + 'public', + 'requiresQuotes', + ]), + ...selectorSchema('typeProperty', true, [ + 'public', + 'readonly', + 'requiresQuotes', + ]), + ...selectorSchema('parameterProperty', true, [ + 'private', + 'protected', + 'public', + 'readonly', + ]), + ...selectorSchema('property', true, [ + 'abstract', + 'private', + '#private', + 'protected', + 'public', + 'readonly', + 'requiresQuotes', + 'static', + 'override', + 'async', + ]), + ...selectorSchema('classMethod', false, [ + 'abstract', + 'private', + '#private', + 'protected', + 'public', + 'requiresQuotes', + 'static', + 'override', + 'async', + ]), + ...selectorSchema('objectLiteralMethod', false, [ + 'public', + 'requiresQuotes', + 'async', + ]), + ...selectorSchema('typeMethod', false, ['public', 'requiresQuotes']), + ...selectorSchema('method', false, [ + 'abstract', + 'private', + '#private', + 'protected', + 'public', + 'requiresQuotes', + 'static', + 'override', + 'async', + ]), + ...selectorSchema('classicAccessor', true, [ + 'abstract', + 'private', + 'protected', + 'public', + 'requiresQuotes', + 'static', + 'override', + ]), + ...selectorSchema('autoAccessor', true, [ + 'abstract', + 'private', + 'protected', + 'public', + 'requiresQuotes', + 'static', + 'override', + ]), + ...selectorSchema('accessor', true, [ + 'abstract', + 'private', + 'protected', + 'public', + 'requiresQuotes', + 'static', + 'override', + ]), + ...selectorSchema('enumMember', false, ['requiresQuotes']), + ...selectorSchema('typeLike', false, ['abstract', 'exported', 'unused']), + ...selectorSchema('class', false, ['abstract', 'exported', 'unused']), + ...selectorSchema('interface', false, ['exported', 'unused']), + ...selectorSchema('typeAlias', false, ['exported', 'unused']), + ...selectorSchema('enum', false, ['exported', 'unused']), + ...selectorSchema('typeParameter', false, ['unused']), + ...selectorSchema('import', false, ['default', 'namespace']), + ], + }, + type: 'array', +}; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared.d.ts.map new file mode 100644 index 0000000..bf963cd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/rules/naming-convention-utils/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,mBAAmB,EACnB,SAAS,EACT,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,eAAe,GAC5B,MAAM,CAGR;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,gCAAgC,GAAG,aAAa,GAAG,SAAS,GACrE,QAAQ,IAAI,mBAAmB,CAEjC;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,gCAAgC,GAAG,aAAa,GAAG,SAAS,GACrE,OAAO,CAIT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared.js new file mode 100644 index 0000000..654cb25 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selectorTypeToMessageString = selectorTypeToMessageString; +exports.isMetaSelector = isMetaSelector; +exports.isMethodOrPropertySelector = isMethodOrPropertySelector; +const enums_1 = require("./enums"); +function selectorTypeToMessageString(selectorType) { + const notCamelCase = selectorType.replaceAll(/([A-Z])/g, ' $1'); + return notCamelCase.charAt(0).toUpperCase() + notCamelCase.slice(1); +} +function isMetaSelector(selector) { + return selector in enums_1.MetaSelectors; +} +function isMethodOrPropertySelector(selector) { + return (selector === enums_1.MetaSelectors.method || selector === enums_1.MetaSelectors.property); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types.d.ts.map new file mode 100644 index 0000000..1c00616 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/rules/naming-convention-utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EACV,gCAAgC,EAChC,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAE7B,MAAM,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAC;IACzC,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAC5C,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,QAAQ,EACJ,gCAAgC,GAChC,gCAAgC,EAAE,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;IAC7C,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAEpC,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC;IACnC,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAE9B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,kBAAkB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC7C,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,MAAM,iBAAiB,GAAG,CAC9B,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,iBAAiB,EACzE,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KACvB,IAAI,CAAC;AACV,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AACvE,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator.d.ts.map new file mode 100644 index 0000000..302b1b2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../src/rules/naming-convention-utils/validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAkB3D,wBAAgB,eAAe,CAC7B,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,kBAAkB,EAAE,GAC/B,CACD,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,iBAAiB,KACtE,IAAI,CAgYR"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator.js new file mode 100644 index 0000000..64dfc62 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator.js @@ -0,0 +1,349 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createValidator = createValidator; +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../../util"); +const enums_1 = require("./enums"); +const format_1 = require("./format"); +const shared_1 = require("./shared"); +function createValidator(type, context, allConfigs) { + // make sure the "highest priority" configs are checked first + const selectorType = enums_1.Selectors[type]; + const configs = allConfigs + // gather all of the applicable selectors + .filter(c => (c.selector & selectorType) !== 0 || + c.selector === enums_1.MetaSelectors.default) + .sort((a, b) => { + if (a.selector === b.selector) { + // in the event of the same selector, order by modifier weight + // sort descending - the type modifiers are "more important" + return b.modifierWeight - a.modifierWeight; + } + const aIsMeta = (0, shared_1.isMetaSelector)(a.selector); + const bIsMeta = (0, shared_1.isMetaSelector)(b.selector); + // non-meta selectors should go ahead of meta selectors + if (aIsMeta && !bIsMeta) { + return 1; + } + if (!aIsMeta && bIsMeta) { + return -1; + } + const aIsMethodOrProperty = (0, shared_1.isMethodOrPropertySelector)(a.selector); + const bIsMethodOrProperty = (0, shared_1.isMethodOrPropertySelector)(b.selector); + // for backward compatibility, method and property have higher precedence than other meta selectors + if (aIsMethodOrProperty && !bIsMethodOrProperty) { + return -1; + } + if (!aIsMethodOrProperty && bIsMethodOrProperty) { + return 1; + } + // both aren't meta selectors + // sort descending - the meta selectors are "least important" + return b.selector - a.selector; + }); + return (node, modifiers = new Set()) => { + const originalName = node.type === utils_1.AST_NODE_TYPES.Identifier || + node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier + ? node.name + : `${node.value}`; + // return will break the loop and stop checking configs + // it is only used when the name is known to have failed or succeeded a config. + for (const config of configs) { + if (config.filter?.regex.test(originalName) !== config.filter?.match) { + // name does not match the filter + continue; + } + if (config.modifiers?.some(modifier => !modifiers.has(modifier))) { + // does not have the required modifiers + continue; + } + if (!isCorrectType(node, config, context, selectorType)) { + // is not the correct type + continue; + } + let name = originalName; + name = validateUnderscore('leading', config, name, node, originalName); + if (name == null) { + // fail + return; + } + name = validateUnderscore('trailing', config, name, node, originalName); + if (name == null) { + // fail + return; + } + name = validateAffix('prefix', config, name, node, originalName); + if (name == null) { + // fail + return; + } + name = validateAffix('suffix', config, name, node, originalName); + if (name == null) { + // fail + return; + } + if (!validateCustom(config, name, node, originalName)) { + // fail + return; + } + if (!validatePredefinedFormat(config, name, node, originalName, modifiers)) { + // fail + return; + } + // it's valid for this config, so we don't need to check any more configs + return; + } + }; + // centralizes the logic for formatting the report data + function formatReportData({ affixes, count, custom, formats, originalName, position, processedName, }) { + return { + affixes: affixes?.join(', '), + count, + formats: formats?.map(f => enums_1.PredefinedFormats[f]).join(', '), + name: originalName, + position, + processedName, + regex: custom?.regex.toString(), + regexMatch: custom?.match === true + ? 'match' + : custom?.match === false + ? 'not match' + : null, + type: (0, shared_1.selectorTypeToMessageString)(type), + }; + } + /** + * @returns the name with the underscore removed, if it is valid according to the specified underscore option, null otherwise + */ + function validateUnderscore(position, config, name, node, originalName) { + const option = position === 'leading' + ? config.leadingUnderscore + : config.trailingUnderscore; + if (!option) { + return name; + } + const hasSingleUnderscore = position === 'leading' + ? () => name.startsWith('_') + : () => name.endsWith('_'); + const trimSingleUnderscore = position === 'leading' + ? () => name.slice(1) + : () => name.slice(0, -1); + const hasDoubleUnderscore = position === 'leading' + ? () => name.startsWith('__') + : () => name.endsWith('__'); + const trimDoubleUnderscore = position === 'leading' + ? () => name.slice(2) + : () => name.slice(0, -2); + switch (option) { + // ALLOW - no conditions as the user doesn't care if it's there or not + case enums_1.UnderscoreOptions.allow: { + if (hasSingleUnderscore()) { + return trimSingleUnderscore(); + } + return name; + } + case enums_1.UnderscoreOptions.allowDouble: { + if (hasDoubleUnderscore()) { + return trimDoubleUnderscore(); + } + return name; + } + case enums_1.UnderscoreOptions.allowSingleOrDouble: { + if (hasDoubleUnderscore()) { + return trimDoubleUnderscore(); + } + if (hasSingleUnderscore()) { + return trimSingleUnderscore(); + } + return name; + } + // FORBID + case enums_1.UnderscoreOptions.forbid: { + if (hasSingleUnderscore()) { + context.report({ + data: formatReportData({ + count: 'one', + originalName, + position, + }), + messageId: 'unexpectedUnderscore', + node, + }); + return null; + } + return name; + } + // REQUIRE + case enums_1.UnderscoreOptions.require: { + if (!hasSingleUnderscore()) { + context.report({ + data: formatReportData({ + count: 'one', + originalName, + position, + }), + messageId: 'missingUnderscore', + node, + }); + return null; + } + return trimSingleUnderscore(); + } + case enums_1.UnderscoreOptions.requireDouble: { + if (!hasDoubleUnderscore()) { + context.report({ + data: formatReportData({ + count: 'two', + originalName, + position, + }), + messageId: 'missingUnderscore', + node, + }); + return null; + } + return trimDoubleUnderscore(); + } + } + } + /** + * @returns the name with the affix removed, if it is valid according to the specified affix option, null otherwise + */ + function validateAffix(position, config, name, node, originalName) { + const affixes = config[position]; + if (!affixes || affixes.length === 0) { + return name; + } + for (const affix of affixes) { + const hasAffix = position === 'prefix' ? name.startsWith(affix) : name.endsWith(affix); + const trimAffix = position === 'prefix' + ? () => name.slice(affix.length) + : () => name.slice(0, -affix.length); + if (hasAffix) { + // matches, so trim it and return + return trimAffix(); + } + } + context.report({ + data: formatReportData({ + affixes, + originalName, + position, + }), + messageId: 'missingAffix', + node, + }); + return null; + } + /** + * @returns true if the name is valid according to the `regex` option, false otherwise + */ + function validateCustom(config, name, node, originalName) { + const custom = config.custom; + if (!custom) { + return true; + } + const result = custom.regex.test(name); + if (custom.match && result) { + return true; + } + if (!custom.match && !result) { + return true; + } + context.report({ + data: formatReportData({ + custom, + originalName, + }), + messageId: 'satisfyCustom', + node, + }); + return false; + } + /** + * @returns true if the name is valid according to the `format` option, false otherwise + */ + function validatePredefinedFormat(config, name, node, originalName, modifiers) { + const formats = config.format; + if (!formats?.length) { + return true; + } + if (!modifiers.has(enums_1.Modifiers.requiresQuotes)) { + for (const format of formats) { + const checker = format_1.PredefinedFormatToCheckFunction[format]; + if (checker(name)) { + return true; + } + } + } + context.report({ + data: formatReportData({ + formats, + originalName, + processedName: name, + }), + messageId: originalName === name + ? 'doesNotMatchFormat' + : 'doesNotMatchFormatTrimmed', + node, + }); + return false; + } +} +const SelectorsAllowedToHaveTypes = enums_1.Selectors.variable | + enums_1.Selectors.parameter | + enums_1.Selectors.classProperty | + enums_1.Selectors.objectLiteralProperty | + enums_1.Selectors.typeProperty | + enums_1.Selectors.parameterProperty | + enums_1.Selectors.classicAccessor; +function isCorrectType(node, config, context, selector) { + if (config.types == null) { + return true; + } + if ((SelectorsAllowedToHaveTypes & selector) === 0) { + return true; + } + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const type = services + .getTypeAtLocation(node) + // remove null and undefined from the type, as we don't care about it here + .getNonNullableType(); + for (const allowedType of config.types) { + switch (allowedType) { + case enums_1.TypeModifiers.array: + if (isAllTypesMatch(type, t => checker.isArrayType(t) || checker.isTupleType(t))) { + return true; + } + break; + case enums_1.TypeModifiers.function: + if (isAllTypesMatch(type, t => t.getCallSignatures().length > 0)) { + return true; + } + break; + case enums_1.TypeModifiers.boolean: + case enums_1.TypeModifiers.number: + case enums_1.TypeModifiers.string: { + const typeString = checker.typeToString( + // this will resolve things like true => boolean, 'a' => string and 1 => number + checker.getWidenedType(checker.getBaseTypeOfLiteralType(type))); + const allowedTypeString = enums_1.TypeModifiers[allowedType]; + if (typeString === allowedTypeString) { + return true; + } + break; + } + } + } + return false; +} +/** + * @returns `true` if the type (or all union types) in the given type return true for the callback + */ +function isAllTypesMatch(type, cb) { + if (type.isUnion()) { + return type.types.every(t => cb(t)); + } + return cb(type); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.d.ts.map new file mode 100644 index 0000000..868be6b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"naming-convention.d.ts","sourceRoot":"","sources":["../../src/rules/naming-convention.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EAEV,QAAQ,EAET,MAAM,2BAA2B,CAAC;AAUnC,MAAM,MAAM,UAAU,GAClB,oBAAoB,GACpB,2BAA2B,GAC3B,cAAc,GACd,mBAAmB,GACnB,eAAe,GACf,sBAAsB,CAAC;AAK3B,MAAM,MAAM,OAAO,GAAG,QAAQ,EAAE,CAAC;;AA8BjC,wBAspBG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js new file mode 100644 index 0000000..c7b14c9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js @@ -0,0 +1,504 @@ +"use strict"; +// This rule was feature-frozen before we enabled no-property-in-node. +/* eslint-disable eslint-plugin/no-property-in-node */ +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const naming_convention_utils_1 = require("./naming-convention-utils"); +// This essentially mirrors ESLint's `camelcase` rule +// note that that rule ignores leading and trailing underscores and only checks those in the middle of a variable name +const defaultCamelCaseAllTheThingsConfig = [ + { + format: ['camelCase'], + leadingUnderscore: 'allow', + selector: 'default', + trailingUnderscore: 'allow', + }, + { + format: ['camelCase', 'PascalCase'], + selector: 'import', + }, + { + format: ['camelCase', 'UPPER_CASE'], + leadingUnderscore: 'allow', + selector: 'variable', + trailingUnderscore: 'allow', + }, + { + format: ['PascalCase'], + selector: 'typeLike', + }, +]; +exports.default = (0, util_1.createRule)({ + name: 'naming-convention', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce naming conventions for everything across a codebase', + // technically only requires type checking if the user uses "type" modifiers + requiresTypeChecking: true, + }, + messages: { + doesNotMatchFormat: '{{type}} name `{{name}}` must match one of the following formats: {{formats}}', + doesNotMatchFormatTrimmed: '{{type}} name `{{name}}` trimmed as `{{processedName}}` must match one of the following formats: {{formats}}', + missingAffix: '{{type}} name `{{name}}` must have one of the following {{position}}es: {{affixes}}', + missingUnderscore: '{{type}} name `{{name}}` must have {{count}} {{position}} underscore(s).', + satisfyCustom: '{{type}} name `{{name}}` must {{regexMatch}} the RegExp: {{regex}}', + unexpectedUnderscore: '{{type}} name `{{name}}` must not have a {{position}} underscore.', + }, + schema: naming_convention_utils_1.SCHEMA, + }, + defaultOptions: defaultCamelCaseAllTheThingsConfig, + create(contextWithoutDefaults) { + const context = contextWithoutDefaults.options.length > 0 + ? contextWithoutDefaults + : // only apply the defaults when the user provides no config + Object.setPrototypeOf({ + options: defaultCamelCaseAllTheThingsConfig, + }, contextWithoutDefaults); + const validators = (0, naming_convention_utils_1.parseOptions)(context); + const compilerOptions = (0, util_1.getParserServices)(context, true).program?.getCompilerOptions() ?? {}; + function handleMember(validator, node, modifiers) { + const key = node.key; + if (requiresQuoting(key, compilerOptions.target)) { + modifiers.add(naming_convention_utils_1.Modifiers.requiresQuotes); + } + validator(key, modifiers); + } + function getMemberModifiers(node) { + const modifiers = new Set(); + if ('key' in node && node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + modifiers.add(naming_convention_utils_1.Modifiers['#private']); + } + else if (node.accessibility) { + modifiers.add(naming_convention_utils_1.Modifiers[node.accessibility]); + } + else { + modifiers.add(naming_convention_utils_1.Modifiers.public); + } + if (node.static) { + modifiers.add(naming_convention_utils_1.Modifiers.static); + } + if ('readonly' in node && node.readonly) { + modifiers.add(naming_convention_utils_1.Modifiers.readonly); + } + if ('override' in node && node.override) { + modifiers.add(naming_convention_utils_1.Modifiers.override); + } + if (node.type === utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition || + node.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || + node.type === utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty) { + modifiers.add(naming_convention_utils_1.Modifiers.abstract); + } + return modifiers; + } + const { unusedVariables } = (0, util_1.collectVariables)(context); + function isUnused(name, initialScope) { + let variable = null; + let scope = initialScope; + while (scope) { + variable = scope.set.get(name) ?? null; + if (variable) { + break; + } + scope = scope.upper; + } + if (!variable) { + return false; + } + return unusedVariables.has(variable); + } + function isDestructured(id) { + return ( + // `const { x }` + // does not match `const { x: y }` + (id.parent.type === utils_1.AST_NODE_TYPES.Property && id.parent.shorthand) || + // `const { x = 2 }` + // does not match const `{ x: y = 2 }` + (id.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern && + id.parent.parent.type === utils_1.AST_NODE_TYPES.Property && + id.parent.parent.shorthand)); + } + function isAsyncMemberOrProperty(propertyOrMemberNode) { + return Boolean('value' in propertyOrMemberNode && + propertyOrMemberNode.value && + 'async' in propertyOrMemberNode.value && + propertyOrMemberNode.value.async); + } + function isAsyncVariableIdentifier(id) { + return Boolean(('async' in id.parent && id.parent.async) || + ('init' in id.parent && + id.parent.init && + 'async' in id.parent.init && + id.parent.init.async)); + } + const selectors = { + // #region import + 'FunctionDeclaration, TSDeclareFunction, FunctionExpression': { + handler: (node, validator) => { + if (node.id == null) { + return; + } + const modifiers = new Set(); + // functions create their own nested scope + const scope = context.sourceCode.getScope(node).upper; + if (isGlobal(scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.global); + } + if (isExported(node, node.id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.exported); + } + if (isUnused(node.id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.unused); + } + if (node.async) { + modifiers.add(naming_convention_utils_1.Modifiers.async); + } + validator(node.id, modifiers); + }, + validator: validators.function, + }, + // #endregion + // #region variable + 'ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier': { + handler: (node, validator) => { + const modifiers = new Set(); + switch (node.type) { + case utils_1.AST_NODE_TYPES.ImportDefaultSpecifier: + modifiers.add(naming_convention_utils_1.Modifiers.default); + break; + case utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier: + modifiers.add(naming_convention_utils_1.Modifiers.namespace); + break; + case utils_1.AST_NODE_TYPES.ImportSpecifier: + // Handle `import { default as Foo }` + if (node.imported.type === utils_1.AST_NODE_TYPES.Identifier && + node.imported.name !== 'default') { + return; + } + modifiers.add(naming_convention_utils_1.Modifiers.default); + break; + } + validator(node.local, modifiers); + }, + validator: validators.import, + }, + // #endregion + // #region function + VariableDeclarator: { + handler: (node, validator) => { + const identifiers = getIdentifiersFromPattern(node.id); + const baseModifiers = new Set(); + const parent = node.parent; + if (parent.kind === 'const') { + baseModifiers.add(naming_convention_utils_1.Modifiers.const); + } + if (isGlobal(context.sourceCode.getScope(node))) { + baseModifiers.add(naming_convention_utils_1.Modifiers.global); + } + identifiers.forEach(id => { + const modifiers = new Set(baseModifiers); + if (isDestructured(id)) { + modifiers.add(naming_convention_utils_1.Modifiers.destructured); + } + const scope = context.sourceCode.getScope(id); + if (isExported(parent, id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.exported); + } + if (isUnused(id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.unused); + } + if (isAsyncVariableIdentifier(id)) { + modifiers.add(naming_convention_utils_1.Modifiers.async); + } + validator(id, modifiers); + }); + }, + validator: validators.variable, + }, + // #endregion function + // #region parameter + ':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]': { + handler: (node, validator) => { + const modifiers = getMemberModifiers(node); + handleMember(validator, node, modifiers); + }, + validator: validators.classProperty, + }, + // #endregion parameter + // #region parameterProperty + ':not(ObjectPattern) > Property[computed = false][kind = "init"][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]': { + handler: (node, validator) => { + const modifiers = new Set([naming_convention_utils_1.Modifiers.public]); + handleMember(validator, node, modifiers); + }, + validator: validators.objectLiteralProperty, + }, + // #endregion parameterProperty + // #region property + [[ + ':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type = "ArrowFunctionExpression"]', + ':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type = "FunctionExpression"]', + ':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type = "TSEmptyBodyFunctionExpression"]', + ':matches(MethodDefinition, TSAbstractMethodDefinition)[computed = false][kind = "method"]', + ].join(', ')]: { + handler: (node, validator) => { + const modifiers = getMemberModifiers(node); + if (isAsyncMemberOrProperty(node)) { + modifiers.add(naming_convention_utils_1.Modifiers.async); + } + handleMember(validator, node, modifiers); + }, + validator: validators.classMethod, + }, + [[ + 'MethodDefinition[computed = false]:matches([kind = "get"], [kind = "set"])', + 'TSAbstractMethodDefinition[computed = false]:matches([kind="get"], [kind="set"])', + ].join(', ')]: { + handler: (node, validator) => { + const modifiers = getMemberModifiers(node); + handleMember(validator, node, modifiers); + }, + validator: validators.classicAccessor, + }, + [[ + 'Property[computed = false][kind = "init"][value.type = "ArrowFunctionExpression"]', + 'Property[computed = false][kind = "init"][value.type = "FunctionExpression"]', + 'Property[computed = false][kind = "init"][value.type = "TSEmptyBodyFunctionExpression"]', + ].join(', ')]: { + handler: (node, validator) => { + const modifiers = new Set([naming_convention_utils_1.Modifiers.public]); + if (isAsyncMemberOrProperty(node)) { + modifiers.add(naming_convention_utils_1.Modifiers.async); + } + handleMember(validator, node, modifiers); + }, + validator: validators.objectLiteralMethod, + }, + // #endregion property + // #region method + [[ + 'TSMethodSignature[computed = false]', + 'TSPropertySignature[computed = false][typeAnnotation.typeAnnotation.type = "TSFunctionType"]', + ].join(', ')]: { + handler: (node, validator) => { + const modifiers = new Set([naming_convention_utils_1.Modifiers.public]); + handleMember(validator, node, modifiers); + }, + validator: validators.typeMethod, + }, + [[ + utils_1.AST_NODE_TYPES.AccessorProperty, + utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty, + ].join(', ')]: { + handler: (node, validator) => { + const modifiers = getMemberModifiers(node); + handleMember(validator, node, modifiers); + }, + validator: validators.autoAccessor, + }, + 'FunctionDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, FunctionExpression, ArrowFunctionExpression': { + handler: (node, validator) => { + node.params.forEach(param => { + if (param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) { + return; + } + const identifiers = getIdentifiersFromPattern(param); + identifiers.forEach(i => { + const modifiers = new Set(); + if (isDestructured(i)) { + modifiers.add(naming_convention_utils_1.Modifiers.destructured); + } + if (isUnused(i.name, context.sourceCode.getScope(i))) { + modifiers.add(naming_convention_utils_1.Modifiers.unused); + } + validator(i, modifiers); + }); + }); + }, + validator: validators.parameter, + }, + // #endregion method + // #region accessor + 'Property[computed = false]:matches([kind = "get"], [kind = "set"])': { + handler: (node, validator) => { + const modifiers = new Set([naming_convention_utils_1.Modifiers.public]); + handleMember(validator, node, modifiers); + }, + validator: validators.classicAccessor, + }, + TSParameterProperty: { + handler: (node, validator) => { + const modifiers = getMemberModifiers(node); + const identifiers = getIdentifiersFromPattern(node.parameter); + identifiers.forEach(i => { + validator(i, modifiers); + }); + }, + validator: validators.parameterProperty, + }, + // #endregion accessor + // #region autoAccessor + 'TSPropertySignature[computed = false][typeAnnotation.typeAnnotation.type != "TSFunctionType"]': { + handler: (node, validator) => { + const modifiers = new Set([naming_convention_utils_1.Modifiers.public]); + if (node.readonly) { + modifiers.add(naming_convention_utils_1.Modifiers.readonly); + } + handleMember(validator, node, modifiers); + }, + validator: validators.typeProperty, + }, + // #endregion autoAccessor + // #region enumMember + // computed is optional, so can't do [computed = false] + 'ClassDeclaration, ClassExpression': { + handler: (node, validator) => { + const id = node.id; + if (id == null) { + return; + } + const modifiers = new Set(); + // classes create their own nested scope + const scope = context.sourceCode.getScope(node).upper; + if (node.abstract) { + modifiers.add(naming_convention_utils_1.Modifiers.abstract); + } + if (isExported(node, id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.exported); + } + if (isUnused(id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.unused); + } + validator(id, modifiers); + }, + validator: validators.class, + }, + // #endregion enumMember + // #region class + TSEnumDeclaration: { + handler: (node, validator) => { + const modifiers = new Set(); + // enums create their own nested scope + const scope = context.sourceCode.getScope(node).upper; + if (isExported(node, node.id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.exported); + } + if (isUnused(node.id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.unused); + } + validator(node.id, modifiers); + }, + validator: validators.enum, + }, + // #endregion class + // #region interface + 'TSEnumMember[computed != true]': { + handler: (node, validator) => { + const id = node.id; + const modifiers = new Set(); + if (requiresQuoting(id, compilerOptions.target)) { + modifiers.add(naming_convention_utils_1.Modifiers.requiresQuotes); + } + validator(id, modifiers); + }, + validator: validators.enumMember, + }, + // #endregion interface + // #region typeAlias + TSInterfaceDeclaration: { + handler: (node, validator) => { + const modifiers = new Set(); + const scope = context.sourceCode.getScope(node); + if (isExported(node, node.id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.exported); + } + if (isUnused(node.id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.unused); + } + validator(node.id, modifiers); + }, + validator: validators.interface, + }, + // #endregion typeAlias + // #region enum + TSTypeAliasDeclaration: { + handler: (node, validator) => { + const modifiers = new Set(); + const scope = context.sourceCode.getScope(node); + if (isExported(node, node.id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.exported); + } + if (isUnused(node.id.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.unused); + } + validator(node.id, modifiers); + }, + validator: validators.typeAlias, + }, + // #endregion enum + // #region typeParameter + 'TSTypeParameterDeclaration > TSTypeParameter': { + handler: (node, validator) => { + const modifiers = new Set(); + const scope = context.sourceCode.getScope(node); + if (isUnused(node.name.name, scope)) { + modifiers.add(naming_convention_utils_1.Modifiers.unused); + } + validator(node.name, modifiers); + }, + validator: validators.typeParameter, + }, + // #endregion typeParameter + }; + return Object.fromEntries(Object.entries(selectors).map(([selector, { handler, validator }]) => { + return [ + selector, + (node) => { + handler(node, validator); + }, + ]; + })); + }, +}); +function getIdentifiersFromPattern(pattern) { + const identifiers = []; + const visitor = new scope_manager_1.PatternVisitor({}, pattern, id => identifiers.push(id)); + visitor.visit(pattern); + return identifiers; +} +function isExported(node, name, scope) { + if (node?.parent?.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration || + node?.parent?.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) { + return true; + } + if (scope == null) { + return false; + } + const variable = scope.set.get(name); + if (variable) { + for (const ref of variable.references) { + const refParent = ref.identifier.parent; + if (refParent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration || + refParent.type === utils_1.AST_NODE_TYPES.ExportSpecifier) { + return true; + } + } + } + return false; +} +function isGlobal(scope) { + if (scope == null) { + return false; + } + return (scope.type === utils_1.TSESLint.Scope.ScopeType.global || + scope.type === utils_1.TSESLint.Scope.ScopeType.module); +} +function requiresQuoting(node, target) { + const name = node.type === utils_1.AST_NODE_TYPES.Identifier || + node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier + ? node.name + : `${node.value}`; + return (0, util_1.requiresQuoting)(name, target); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.d.ts.map new file mode 100644 index 0000000..2b3f48d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-array-constructor.d.ts","sourceRoot":"","sources":["../../src/rules/no-array-constructor.ts"],"names":[],"mappings":";AAMA,wBAuDG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js new file mode 100644 index 0000000..62dd829 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-array-constructor', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow generic `Array` constructors', + extendsBaseRule: true, + recommended: 'recommended', + }, + fixable: 'code', + messages: { + useLiteral: 'The array literal notation [] is preferable.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * Disallow construction of dense arrays using the Array constructor + * @param node node to evaluate + */ + function check(node) { + if (node.arguments.length !== 1 && + node.callee.type === utils_1.AST_NODE_TYPES.Identifier && + node.callee.name === 'Array' && + !node.typeArguments && + !(0, util_1.isOptionalCallExpression)(node)) { + context.report({ + node, + messageId: 'useLiteral', + fix(fixer) { + if (node.arguments.length === 0) { + return fixer.replaceText(node, '[]'); + } + const fullText = context.sourceCode.getText(node); + const preambleLength = node.callee.range[1] - node.range[0]; + return fixer.replaceText(node, `[${fullText.slice(preambleLength + 1, -1)}]`); + }, + }); + } + } + return { + CallExpression: check, + NewExpression: check, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-delete.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-delete.d.ts.map new file mode 100644 index 0000000..bfbd39a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-delete.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-array-delete.d.ts","sourceRoot":"","sources":["../../src/rules/no-array-delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAWnE,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,WAAW,CAAC;;AAEtD,wBAiGG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-delete.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-delete.js new file mode 100644 index 0000000..cff2cdb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-delete.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-array-delete', + meta: { + type: 'problem', + docs: { + description: 'Disallow using the `delete` operator on array values', + recommended: 'recommended', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + noArrayDelete: 'Using the `delete` operator with an array expression is unsafe.', + useSplice: 'Use `array.splice()` instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function isUnderlyingTypeArray(type) { + const predicate = (t) => checker.isArrayType(t) || checker.isTupleType(t); + if (type.isUnion()) { + return type.types.every(predicate); + } + if (type.isIntersection()) { + return type.types.some(predicate); + } + return predicate(type); + } + return { + 'UnaryExpression[operator="delete"]'(node) { + const { argument } = node; + if (argument.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return; + } + const type = (0, util_1.getConstrainedTypeAtLocation)(services, argument.object); + if (!isUnderlyingTypeArray(type)) { + return; + } + context.report({ + node, + messageId: 'noArrayDelete', + suggest: [ + { + messageId: 'useSplice', + fix(fixer) { + const { object, property } = argument; + const shouldHaveParentheses = property.type === utils_1.AST_NODE_TYPES.SequenceExpression; + const nodeMap = services.esTreeNodeToTSNodeMap; + const target = nodeMap.get(object).getText(); + const rawKey = nodeMap.get(property).getText(); + const key = shouldHaveParentheses ? `(${rawKey})` : rawKey; + let suggestion = `${target}.splice(${key}, 1)`; + const comments = context.sourceCode.getCommentsInside(node); + if (comments.length > 0) { + const indentationCount = node.loc.start.column; + const indentation = ' '.repeat(indentationCount); + const commentsText = comments + .map(comment => { + return comment.type === utils_1.AST_TOKEN_TYPES.Line + ? `//${comment.value}` + : `/*${comment.value}*/`; + }) + .join(`\n${indentation}`); + suggestion = `${commentsText}\n${indentation}${suggestion}`; + } + return fixer.replaceText(node, suggestion); + }, + }, + ], + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.d.ts.map new file mode 100644 index 0000000..3abddfb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-base-to-string.d.ts","sourceRoot":"","sources":["../../src/rules/no-base-to-string.ts"],"names":[],"mappings":"AAoBA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC7B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,cAAc,CAAC;;AAE1D,wBAwTG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js new file mode 100644 index 0000000..4e80892 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js @@ -0,0 +1,266 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +var Usefulness; +(function (Usefulness) { + Usefulness["Always"] = "always"; + Usefulness["Never"] = "will"; + Usefulness["Sometimes"] = "may"; +})(Usefulness || (Usefulness = {})); +exports.default = (0, util_1.createRule)({ + name: 'no-base-to-string', + meta: { + type: 'suggestion', + docs: { + description: 'Require `.toString()` and `.toLocaleString()` to only be called on objects which provide useful information when stringified', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + baseArrayJoin: "Using `join()` for {{name}} {{certainty}} use Object's default stringification format ('[object Object]') when stringified.", + baseToString: "'{{name}}' {{certainty}} use Object's default stringification format ('[object Object]') when stringified.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoredTypeNames: { + type: 'array', + description: 'Stringified regular expressions of type names to ignore.', + items: { + type: 'string', + }, + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoredTypeNames: ['Error', 'RegExp', 'URL', 'URLSearchParams'], + }, + ], + create(context, [option]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const ignoredTypeNames = option.ignoredTypeNames ?? []; + function checkExpression(node, type) { + if (node.type === utils_1.AST_NODE_TYPES.Literal) { + return; + } + const certainty = collectToStringCertainty(type ?? services.getTypeAtLocation(node), new Set()); + if (certainty === Usefulness.Always) { + return; + } + context.report({ + node, + messageId: 'baseToString', + data: { + name: context.sourceCode.getText(node), + certainty, + }, + }); + } + function checkExpressionForArrayJoin(node, type) { + const certainty = collectJoinCertainty(type, new Set()); + if (certainty === Usefulness.Always) { + return; + } + context.report({ + node, + messageId: 'baseArrayJoin', + data: { + name: context.sourceCode.getText(node), + certainty, + }, + }); + } + function collectUnionTypeCertainty(type, collectSubTypeCertainty) { + const certainties = type.types.map(t => collectSubTypeCertainty(t)); + if (certainties.every(certainty => certainty === Usefulness.Never)) { + return Usefulness.Never; + } + if (certainties.every(certainty => certainty === Usefulness.Always)) { + return Usefulness.Always; + } + return Usefulness.Sometimes; + } + function collectIntersectionTypeCertainty(type, collectSubTypeCertainty) { + for (const subType of type.types) { + const subtypeUsefulness = collectSubTypeCertainty(subType); + if (subtypeUsefulness === Usefulness.Always) { + return Usefulness.Always; + } + } + return Usefulness.Never; + } + function collectTupleCertainty(type, visited) { + const typeArgs = checker.getTypeArguments(type); + const certainties = typeArgs.map(t => collectToStringCertainty(t, visited)); + if (certainties.some(certainty => certainty === Usefulness.Never)) { + return Usefulness.Never; + } + if (certainties.some(certainty => certainty === Usefulness.Sometimes)) { + return Usefulness.Sometimes; + } + return Usefulness.Always; + } + function collectArrayCertainty(type, visited) { + const elemType = (0, util_1.nullThrows)(type.getNumberIndexType(), 'array should have number index type'); + return collectToStringCertainty(elemType, visited); + } + function collectJoinCertainty(type, visited) { + if (tsutils.isUnionType(type)) { + return collectUnionTypeCertainty(type, t => collectJoinCertainty(t, visited)); + } + if (tsutils.isIntersectionType(type)) { + return collectIntersectionTypeCertainty(type, t => collectJoinCertainty(t, visited)); + } + if (checker.isTupleType(type)) { + return collectTupleCertainty(type, visited); + } + if (checker.isArrayType(type)) { + return collectArrayCertainty(type, visited); + } + return Usefulness.Always; + } + function collectToStringCertainty(type, visited) { + if (visited.has(type)) { + // don't report if this is a self referencing array or tuple type + return Usefulness.Always; + } + if (tsutils.isTypeParameter(type)) { + const constraint = type.getConstraint(); + if (constraint) { + return collectToStringCertainty(constraint, visited); + } + // unconstrained generic means `unknown` + return Usefulness.Always; + } + // the Boolean type definition missing toString() + if (type.flags & ts.TypeFlags.Boolean || + type.flags & ts.TypeFlags.BooleanLiteral) { + return Usefulness.Always; + } + if (ignoredTypeNames.includes((0, util_1.getTypeName)(checker, type))) { + return Usefulness.Always; + } + if (type.isIntersection()) { + return collectIntersectionTypeCertainty(type, t => collectToStringCertainty(t, visited)); + } + if (type.isUnion()) { + return collectUnionTypeCertainty(type, t => collectToStringCertainty(t, visited)); + } + if (checker.isTupleType(type)) { + return collectTupleCertainty(type, new Set([...visited, type])); + } + if (checker.isArrayType(type)) { + return collectArrayCertainty(type, new Set([...visited, type])); + } + const toString = checker.getPropertyOfType(type, 'toString') ?? + checker.getPropertyOfType(type, 'toLocaleString'); + if (!toString) { + // e.g. any/unknown + return Usefulness.Always; + } + const declarations = toString.getDeclarations(); + if (declarations == null || declarations.length !== 1) { + // If there are multiple declarations, at least one of them must not be + // the default object toString. + // + // This may only matter for older versions of TS + // see https://github.com/typescript-eslint/typescript-eslint/issues/8585 + return Usefulness.Always; + } + const declaration = declarations[0]; + const isBaseToString = ts.isInterfaceDeclaration(declaration.parent) && + declaration.parent.name.text === 'Object'; + return isBaseToString ? Usefulness.Never : Usefulness.Always; + } + function isBuiltInStringCall(node) { + if (node.callee.type === utils_1.AST_NODE_TYPES.Identifier && + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + node.callee.name === 'String' && + node.arguments[0]) { + const scope = context.sourceCode.getScope(node); + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + const variable = scope.set.get('String'); + return !variable?.defs.length; + } + return false; + } + return { + 'AssignmentExpression[operator = "+="], BinaryExpression[operator = "+"]'(node) { + const leftType = services.getTypeAtLocation(node.left); + const rightType = services.getTypeAtLocation(node.right); + if ((0, util_1.getTypeName)(checker, leftType) === 'string') { + checkExpression(node.right, rightType); + } + else if ((0, util_1.getTypeName)(checker, rightType) === 'string' && + node.left.type !== utils_1.AST_NODE_TYPES.PrivateIdentifier) { + checkExpression(node.left, leftType); + } + }, + CallExpression(node) { + if (isBuiltInStringCall(node) && + node.arguments[0].type !== utils_1.AST_NODE_TYPES.SpreadElement) { + checkExpression(node.arguments[0]); + } + }, + 'CallExpression > MemberExpression.callee > Identifier[name = "join"].property'(node) { + const memberExpr = node.parent; + const type = (0, util_1.getConstrainedTypeAtLocation)(services, memberExpr.object); + checkExpressionForArrayJoin(memberExpr.object, type); + }, + 'CallExpression > MemberExpression.callee > Identifier[name = /^(toLocaleString|toString)$/].property'(node) { + const memberExpr = node.parent; + checkExpression(memberExpr.object); + }, + TemplateLiteral(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + return; + } + for (const expression of node.expressions) { + checkExpression(expression); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.d.ts.map new file mode 100644 index 0000000..3342214 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-confusing-non-null-assertion.d.ts","sourceRoot":"","sources":["../../src/rules/no-confusing-non-null-assertion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAUnE,MAAM,MAAM,SAAS,GACjB,iBAAiB,GACjB,gBAAgB,GAChB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,GACpB,mBAAmB,GACnB,YAAY,CAAC;;AAgBjB,wBA8IG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js new file mode 100644 index 0000000..73319b9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js @@ -0,0 +1,142 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const confusingOperators = new Set([ + '=', + '==', + '===', + 'in', + 'instanceof', +]); +function isConfusingOperator(operator) { + return confusingOperators.has(operator); +} +exports.default = (0, util_1.createRule)({ + name: 'no-confusing-non-null-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallow non-null assertion in locations that may be confusing', + recommended: 'stylistic', + }, + hasSuggestions: true, + messages: { + confusingAssign: 'Confusing combination of non-null assertion and assignment like `a! = b`, which looks very similar to `a != b`.', + confusingEqual: 'Confusing combination of non-null assertion and equality test like `a! == b`, which looks very similar to `a !== b`.', + confusingOperator: 'Confusing combination of non-null assertion and `{{operator}}` operator like `a! {{operator}} b`, which might be misinterpreted as `!(a {{operator}} b)`.', + notNeedInAssign: 'Remove unnecessary non-null assertion (!) in assignment left-hand side.', + notNeedInEqualTest: 'Remove unnecessary non-null assertion (!) in equality test.', + notNeedInOperator: 'Remove possibly unnecessary non-null assertion (!) in the left operand of the `{{operator}}` operator.', + wrapUpLeft: 'Wrap the left-hand side in parentheses to avoid confusion with "{{operator}}" operator.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function confusingOperatorToMessageData(operator) { + switch (operator) { + case '=': + return { + messageId: 'confusingAssign', + }; + case '==': + case '===': + return { + messageId: 'confusingEqual', + }; + case 'in': + case 'instanceof': + return { + messageId: 'confusingOperator', + data: { operator }, + }; + // istanbul ignore next + default: + operator; + throw new Error(`Unexpected operator ${operator}`); + } + } + return { + 'BinaryExpression, AssignmentExpression'(node) { + const operator = node.operator; + if (isConfusingOperator(operator)) { + // Look for a non-null assertion as the last token on the left hand side. + // That way, we catch things like `1 + two! === 3`, even though the left + // hand side isn't a non-null assertion AST node. + const leftHandFinalToken = context.sourceCode.getLastToken(node.left); + const tokenAfterLeft = context.sourceCode.getTokenAfter(node.left); + if (leftHandFinalToken?.type === utils_1.AST_TOKEN_TYPES.Punctuator && + leftHandFinalToken.value === '!' && + tokenAfterLeft?.value !== ')') { + if (node.left.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) { + let suggestions; + switch (operator) { + case '=': + suggestions = [ + { + messageId: 'notNeedInAssign', + fix: (fixer) => fixer.remove(leftHandFinalToken), + }, + ]; + break; + case '==': + case '===': + suggestions = [ + { + messageId: 'notNeedInEqualTest', + fix: (fixer) => fixer.remove(leftHandFinalToken), + }, + ]; + break; + case 'in': + case 'instanceof': + suggestions = [ + { + messageId: 'notNeedInOperator', + data: { operator }, + fix: (fixer) => fixer.remove(leftHandFinalToken), + }, + { + messageId: 'wrapUpLeft', + data: { operator }, + fix: wrapUpLeftFixer(node), + }, + ]; + break; + // istanbul ignore next + default: + operator; + return; + } + context.report({ + node, + ...confusingOperatorToMessageData(operator), + suggest: suggestions, + }); + } + else { + context.report({ + node, + ...confusingOperatorToMessageData(operator), + suggest: [ + { + messageId: 'wrapUpLeft', + data: { operator }, + fix: wrapUpLeftFixer(node), + }, + ], + }); + } + } + } + }, + }; + }, +}); +function wrapUpLeftFixer(node) { + return (fixer) => [ + fixer.insertTextBefore(node.left, '('), + fixer.insertTextAfter(node.left, ')'), + ]; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.d.ts.map new file mode 100644 index 0000000..54d6b2c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-confusing-void-expression.d.ts","sourceRoot":"","sources":["../../src/rules/no-confusing-void-expression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAoBnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,4BAA4B,CAAC,EAAE,OAAO,CAAC;KACxC;CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,8BAA8B,GAC9B,uBAAuB,GACvB,2BAA2B,GAC3B,+BAA+B,GAC/B,yBAAyB,GACzB,kBAAkB,CAAC;;AAEvB,wBAobG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.js new file mode 100644 index 0000000..7408f2e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.js @@ -0,0 +1,359 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getParentFunctionNode_1 = require("../util/getParentFunctionNode"); +exports.default = (0, util_1.createRule)({ + name: 'no-confusing-void-expression', + meta: { + type: 'problem', + docs: { + description: 'Require expressions of type void to appear in statement position', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + hasSuggestions: true, + messages: { + invalidVoidExpr: 'Placing a void expression inside another expression is forbidden. ' + + 'Move it to its own statement instead.', + invalidVoidExprArrow: 'Returning a void expression from an arrow function shorthand is forbidden. ' + + 'Please add braces to the arrow function.', + invalidVoidExprArrowWrapVoid: 'Void expressions returned from an arrow function shorthand ' + + 'must be marked explicitly with the `void` operator.', + invalidVoidExprReturn: 'Returning a void expression from a function is forbidden. ' + + 'Please move it before the `return` statement.', + invalidVoidExprReturnLast: 'Returning a void expression from a function is forbidden. ' + + 'Please remove the `return` statement.', + invalidVoidExprReturnWrapVoid: 'Void expressions returned from a function ' + + 'must be marked explicitly with the `void` operator.', + invalidVoidExprWrapVoid: 'Void expressions used inside another expression ' + + 'must be moved to its own statement ' + + 'or marked explicitly with the `void` operator.', + voidExprWrapVoid: 'Mark with an explicit `void` operator.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreArrowShorthand: { + type: 'boolean', + description: 'Whether to ignore "shorthand" `() =>` arrow functions: those without `{ ... }` braces.', + }, + ignoreVoidOperator: { + type: 'boolean', + description: 'Whether to ignore returns that start with the `void` operator.', + }, + ignoreVoidReturningFunctions: { + type: 'boolean', + description: 'Whether to ignore returns from functions with explicit `void` return types and functions with contextual `void` return types.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreArrowShorthand: false, + ignoreVoidOperator: false, + ignoreVoidReturningFunctions: false, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + return { + 'AwaitExpression, CallExpression, TaggedTemplateExpression'(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + if (!tsutils.isTypeFlagSet(type, ts.TypeFlags.VoidLike)) { + // not a void expression + return; + } + const invalidAncestor = findInvalidAncestor(node); + if (invalidAncestor == null) { + // void expression is in valid position + return; + } + const wrapVoidFix = (fixer) => { + const nodeText = context.sourceCode.getText(node); + const newNodeText = `void ${nodeText}`; + return fixer.replaceText(node, newNodeText); + }; + if (invalidAncestor.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + // handle arrow function shorthand + if (options.ignoreVoidReturningFunctions) { + const returnsVoid = isVoidReturningFunctionNode(invalidAncestor); + if (returnsVoid) { + return; + } + } + if (options.ignoreVoidOperator) { + // handle wrapping with `void` + return context.report({ + node, + messageId: 'invalidVoidExprArrowWrapVoid', + fix: wrapVoidFix, + }); + } + // handle wrapping with braces + const arrowFunction = invalidAncestor; + return context.report({ + node, + messageId: 'invalidVoidExprArrow', + fix(fixer) { + if (!canFix(arrowFunction)) { + return null; + } + const arrowBody = arrowFunction.body; + const arrowBodyText = context.sourceCode.getText(arrowBody); + const newArrowBodyText = `{ ${arrowBodyText}; }`; + if ((0, util_1.isParenthesized)(arrowBody, context.sourceCode)) { + const bodyOpeningParen = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(arrowBody, util_1.isOpeningParenToken), util_1.NullThrowsReasons.MissingToken('opening parenthesis', 'arrow body')); + const bodyClosingParen = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(arrowBody, util_1.isClosingParenToken), util_1.NullThrowsReasons.MissingToken('closing parenthesis', 'arrow body')); + return fixer.replaceTextRange([bodyOpeningParen.range[0], bodyClosingParen.range[1]], newArrowBodyText); + } + return fixer.replaceText(arrowBody, newArrowBodyText); + }, + }); + } + if (invalidAncestor.type === utils_1.AST_NODE_TYPES.ReturnStatement) { + // handle return statement + if (options.ignoreVoidReturningFunctions) { + const functionNode = (0, getParentFunctionNode_1.getParentFunctionNode)(invalidAncestor); + if (functionNode) { + const returnsVoid = isVoidReturningFunctionNode(functionNode); + if (returnsVoid) { + return; + } + } + } + if (options.ignoreVoidOperator) { + // handle wrapping with `void` + return context.report({ + node, + messageId: 'invalidVoidExprReturnWrapVoid', + fix: wrapVoidFix, + }); + } + if (isFinalReturn(invalidAncestor)) { + // remove the `return` keyword + return context.report({ + node, + messageId: 'invalidVoidExprReturnLast', + fix(fixer) { + if (!canFix(invalidAncestor)) { + return null; + } + const returnValue = invalidAncestor.argument; + const returnValueText = context.sourceCode.getText(returnValue); + let newReturnStmtText = `${returnValueText};`; + if (isPreventingASI(returnValue)) { + // put a semicolon at the beginning of the line + newReturnStmtText = `;${newReturnStmtText}`; + } + return fixer.replaceText(invalidAncestor, newReturnStmtText); + }, + }); + } + // move before the `return` keyword + return context.report({ + node, + messageId: 'invalidVoidExprReturn', + fix(fixer) { + const returnValue = invalidAncestor.argument; + const returnValueText = context.sourceCode.getText(returnValue); + let newReturnStmtText = `${returnValueText}; return;`; + if (isPreventingASI(returnValue)) { + // put a semicolon at the beginning of the line + newReturnStmtText = `;${newReturnStmtText}`; + } + if (invalidAncestor.parent.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + // e.g. `if (cond) return console.error();` + // add braces if not inside a block + newReturnStmtText = `{ ${newReturnStmtText} }`; + } + return fixer.replaceText(invalidAncestor, newReturnStmtText); + }, + }); + } + // handle generic case + if (options.ignoreVoidOperator) { + // this would be reported by this rule btw. such irony + return context.report({ + node, + messageId: 'invalidVoidExprWrapVoid', + suggest: [{ messageId: 'voidExprWrapVoid', fix: wrapVoidFix }], + }); + } + context.report({ + node, + messageId: 'invalidVoidExpr', + }); + }, + }; + /** + * Inspects the void expression's ancestors and finds closest invalid one. + * By default anything other than an ExpressionStatement is invalid. + * Parent expressions which can be used for their short-circuiting behavior + * are ignored and their parents are checked instead. + * @param node The void expression node to check. + * @returns Invalid ancestor node if it was found. `null` otherwise. + */ + function findInvalidAncestor(node) { + const parent = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent); + if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression && + node !== parent.expressions[parent.expressions.length - 1]) { + return null; + } + if (parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + // e.g. `{ console.log("foo"); }` + // this is always valid + return null; + } + if (parent.type === utils_1.AST_NODE_TYPES.LogicalExpression && + parent.right === node) { + // e.g. `x && console.log(x)` + // this is valid only if the next ancestor is valid + return findInvalidAncestor(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + (parent.consequent === node || parent.alternate === node)) { + // e.g. `cond ? console.log(true) : console.log(false)` + // this is valid only if the next ancestor is valid + return findInvalidAncestor(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + // e.g. `() => console.log("foo")` + // this is valid with an appropriate option + options.ignoreArrowShorthand) { + return null; + } + if (parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + parent.operator === 'void' && + // e.g. `void console.log("foo")` + // this is valid with an appropriate option + options.ignoreVoidOperator) { + return null; + } + if (parent.type === utils_1.AST_NODE_TYPES.ChainExpression) { + // e.g. `console?.log('foo')` + return findInvalidAncestor(parent); + } + // Any other parent is invalid. + // We can assume a return statement will have an argument. + return parent; + } + /** Checks whether the return statement is the last statement in a function body. */ + function isFinalReturn(node) { + // the parent must be a block + const block = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent); + if (block.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + // e.g. `if (cond) return;` (not in a block) + return false; + } + // the block's parent must be a function + const blockParent = (0, util_1.nullThrows)(block.parent, util_1.NullThrowsReasons.MissingParent); + if (![ + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.FunctionExpression, + ].includes(blockParent.type)) { + // e.g. `if (cond) { return; }` + // not in a top-level function block + return false; + } + // must be the last child of the block + if (block.body.indexOf(node) < block.body.length - 1) { + // not the last statement in the block + return false; + } + return true; + } + /** + * Checks whether the given node, if placed on its own line, + * would prevent automatic semicolon insertion on the line before. + * + * This happens if the line begins with `(`, `[` or `` ` `` + */ + function isPreventingASI(node) { + const startToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node), util_1.NullThrowsReasons.MissingToken('first token', node.type)); + return ['(', '[', '`'].includes(startToken.value); + } + function canFix(node) { + const targetNode = node.type === utils_1.AST_NODE_TYPES.ReturnStatement + ? node.argument + : node.body; + const type = (0, util_1.getConstrainedTypeAtLocation)(services, targetNode); + return tsutils.isTypeFlagSet(type, ts.TypeFlags.VoidLike); + } + function isFunctionReturnTypeIncludesVoid(functionType) { + const callSignatures = tsutils.getCallSignaturesOfType(functionType); + return callSignatures.some(signature => { + const returnType = signature.getReturnType(); + return tsutils + .unionTypeParts(returnType) + .some(tsutils.isIntrinsicVoidType); + }); + } + function isVoidReturningFunctionNode(functionNode) { + // Game plan: + // - If the function node has a type annotation, check if it includes `void`. + // - If it does then the function is safe to return `void` expressions in. + // - Otherwise, check if the function is a function-expression or an arrow-function. + // - If it is, get its contextual type and bail if we cannot. + // - Return based on whether the contextual type includes `void` or not + const functionTSNode = services.esTreeNodeToTSNodeMap.get(functionNode); + if (functionTSNode.type) { + const returnType = checker.getTypeFromTypeNode(functionTSNode.type); + return tsutils + .unionTypeParts(returnType) + .some(tsutils.isIntrinsicVoidType); + } + if (ts.isExpression(functionTSNode)) { + const functionType = checker.getContextualType(functionTSNode); + if (functionType) { + return tsutils + .unionTypeParts(functionType) + .some(isFunctionReturnTypeIncludesVoid); + } + } + return false; + } + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-deprecated.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-deprecated.d.ts.map new file mode 100644 index 0000000..331ae3f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-deprecated.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-deprecated.d.ts","sourceRoot":"","sources":["../../src/rules/no-deprecated.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAgBpD,KAAK,UAAU,GAAG,YAAY,GAAG,sBAAsB,CAAC;AAExD,KAAK,OAAO,GAAG;IACb;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;KAChC;CACF,CAAC;;AAEF,wBAyXG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-deprecated.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-deprecated.js new file mode 100644 index 0000000..b33ab9f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-deprecated.js @@ -0,0 +1,340 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-deprecated', + meta: { + type: 'problem', + docs: { + description: 'Disallow using code marked as `@deprecated`', + recommended: 'strict', + requiresTypeChecking: true, + }, + messages: { + deprecated: `\`{{name}}\` is deprecated.`, + deprecatedWithReason: `\`{{name}}\` is deprecated. {{reason}}`, + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + ...util_1.typeOrValueSpecifiersSchema, + description: 'Type specifiers that can be allowed.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + }, + ], + create(context, [options]) { + const { jsDocParsingMode } = context.parserOptions; + const allow = options.allow; + if (jsDocParsingMode === 'none' || jsDocParsingMode === 'type-info') { + throw new Error(`Cannot be used with jsDocParsingMode: '${jsDocParsingMode}'.`); + } + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + // Deprecated jsdoc tags can be added on some symbol alias, e.g. + // + // export { /** @deprecated */ foo } + // + // When we import foo, its symbol is an alias of the exported foo (the one + // with the deprecated tag), which is itself an alias of the original foo. + // Therefore, we carefully go through the chain of aliases and check each + // immediate alias for deprecated tags + function searchForDeprecationInAliasesChain(symbol, checkDeprecationsOfAliasedSymbol) { + if (!symbol || !tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias)) { + return checkDeprecationsOfAliasedSymbol + ? getJsDocDeprecation(symbol) + : undefined; + } + const targetSymbol = checker.getAliasedSymbol(symbol); + while (tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias)) { + const reason = getJsDocDeprecation(symbol); + if (reason != null) { + return reason; + } + const immediateAliasedSymbol = symbol.getDeclarations() && checker.getImmediateAliasedSymbol(symbol); + if (!immediateAliasedSymbol) { + break; + } + symbol = immediateAliasedSymbol; + if (checkDeprecationsOfAliasedSymbol && symbol === targetSymbol) { + return getJsDocDeprecation(symbol); + } + } + return undefined; + } + function isDeclaration(node) { + const { parent } = node; + switch (parent.type) { + case utils_1.AST_NODE_TYPES.ArrayPattern: + return parent.elements.includes(node); + case utils_1.AST_NODE_TYPES.ClassExpression: + case utils_1.AST_NODE_TYPES.ClassDeclaration: + case utils_1.AST_NODE_TYPES.VariableDeclarator: + case utils_1.AST_NODE_TYPES.TSEnumMember: + return parent.id === node; + case utils_1.AST_NODE_TYPES.MethodDefinition: + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.AccessorProperty: + return parent.key === node; + case utils_1.AST_NODE_TYPES.Property: + // foo in "const { foo } = bar" will be processed twice, as parent.key + // and parent.value. The second is treated as a declaration. + if (parent.shorthand && parent.value === node) { + return parent.parent.type === utils_1.AST_NODE_TYPES.ObjectPattern; + } + if (parent.value === node) { + return false; + } + return parent.parent.type === utils_1.AST_NODE_TYPES.ObjectExpression; + case utils_1.AST_NODE_TYPES.AssignmentPattern: + // foo in "const { foo = "" } = bar" will be processed twice, as parent.parent.key + // and parent.left. The second is treated as a declaration. + return parent.left === node; + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.TSDeclareFunction: + case utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression: + case utils_1.AST_NODE_TYPES.TSEnumDeclaration: + case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration: + case utils_1.AST_NODE_TYPES.TSMethodSignature: + case utils_1.AST_NODE_TYPES.TSModuleDeclaration: + case utils_1.AST_NODE_TYPES.TSParameterProperty: + case utils_1.AST_NODE_TYPES.TSPropertySignature: + case utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration: + case utils_1.AST_NODE_TYPES.TSTypeParameter: + return true; + default: + return false; + } + } + function isInsideExportOrImport(node) { + let current = node; + while (true) { + switch (current.type) { + case utils_1.AST_NODE_TYPES.ExportAllDeclaration: + case utils_1.AST_NODE_TYPES.ExportNamedDeclaration: + case utils_1.AST_NODE_TYPES.ImportDeclaration: + return true; + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.BlockStatement: + case utils_1.AST_NODE_TYPES.ClassDeclaration: + case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.Program: + case utils_1.AST_NODE_TYPES.TSUnionType: + case utils_1.AST_NODE_TYPES.VariableDeclarator: + return false; + default: + current = current.parent; + } + } + } + function getJsDocDeprecation(symbol) { + let jsDocTags; + try { + jsDocTags = symbol?.getJsDocTags(checker); + } + catch { + // workaround for https://github.com/microsoft/TypeScript/issues/60024 + return; + } + const tag = jsDocTags?.find(tag => tag.name === 'deprecated'); + if (!tag) { + return undefined; + } + const displayParts = tag.text; + return displayParts ? ts.displayPartsToString(displayParts) : ''; + } + function isNodeCalleeOfParent(node) { + switch (node.parent?.type) { + case utils_1.AST_NODE_TYPES.NewExpression: + case utils_1.AST_NODE_TYPES.CallExpression: + return node.parent.callee === node; + case utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + return node.parent.tag === node; + case utils_1.AST_NODE_TYPES.JSXOpeningElement: + return node.parent.name === node; + default: + return false; + } + } + function getCallLikeNode(node) { + let callee = node; + while (callee.parent?.type === utils_1.AST_NODE_TYPES.MemberExpression && + callee.parent.property === callee) { + callee = callee.parent; + } + return isNodeCalleeOfParent(callee) ? callee : undefined; + } + function getCallLikeDeprecation(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node.parent); + // If the node is a direct function call, we look for its signature. + const signature = (0, util_1.nullThrows)(checker.getResolvedSignature(tsNode), 'Expected call like node to have signature'); + const symbol = services.getSymbolAtLocation(node); + const aliasedSymbol = symbol != null && tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : symbol; + const symbolDeclarationKind = aliasedSymbol?.declarations?.[0].kind; + // Properties with function-like types have "deprecated" jsdoc + // on their symbols, not on their signatures: + // + // interface Props { + // /** @deprecated */ + // property: () => 'foo' + // ^symbol^ ^signature^ + // } + if (symbolDeclarationKind !== ts.SyntaxKind.MethodDeclaration && + symbolDeclarationKind !== ts.SyntaxKind.FunctionDeclaration && + symbolDeclarationKind !== ts.SyntaxKind.MethodSignature) { + return (searchForDeprecationInAliasesChain(symbol, true) ?? + getJsDocDeprecation(signature) ?? + getJsDocDeprecation(aliasedSymbol)); + } + return (searchForDeprecationInAliasesChain(symbol, + // Here we're working with a function declaration or method. + // Both can have 1 or more overloads, each overload creates one + // ts.Declaration which is placed in symbol.declarations. + // + // Imagine the following code: + // + // function foo(): void + // /** @deprecated Some Reason */ + // function foo(arg: string): void + // function foo(arg?: string): void {} + // + // foo() // <- foo is our symbol + // + // If we call getJsDocDeprecation(checker.getAliasedSymbol(symbol)), + // we get 'Some Reason', but after all, we are calling foo with + // a signature that is not deprecated! + // It works this way because symbol.getJsDocTags returns tags from + // all symbol declarations combined into one array. And AFAIK there is + // no publicly exported TS function that can tell us if a particular + // declaration is deprecated or not. + // + // So, in case of function and method declarations, we don't check original + // aliased symbol, but rely on the getJsDocDeprecation(signature) call below. + false) ?? getJsDocDeprecation(signature)); + } + function getJSXAttributeDeprecation(openingElement, propertyName) { + const tsNode = services.esTreeNodeToTSNodeMap.get(openingElement.name); + const contextualType = (0, util_1.nullThrows)(checker.getContextualType(tsNode), 'Expected JSX opening element name to have contextualType'); + const symbol = contextualType.getProperty(propertyName); + return getJsDocDeprecation(symbol); + } + function getDeprecationReason(node) { + const callLikeNode = getCallLikeNode(node); + if (callLikeNode) { + return getCallLikeDeprecation(callLikeNode); + } + if (node.parent.type === utils_1.AST_NODE_TYPES.JSXAttribute && + node.type !== utils_1.AST_NODE_TYPES.Super) { + return getJSXAttributeDeprecation(node.parent.parent, node.name); + } + if (node.parent.type === utils_1.AST_NODE_TYPES.Property && + node.type !== utils_1.AST_NODE_TYPES.Super) { + const property = services + .getTypeAtLocation(node.parent.parent) + .getProperty(node.name); + const propertySymbol = services.getSymbolAtLocation(node); + const valueSymbol = checker.getShorthandAssignmentValueSymbol(propertySymbol?.valueDeclaration); + return (getJsDocDeprecation(property) ?? + getJsDocDeprecation(propertySymbol) ?? + getJsDocDeprecation(valueSymbol)); + } + return searchForDeprecationInAliasesChain(services.getSymbolAtLocation(node), true); + } + function checkIdentifier(node) { + if (isDeclaration(node) || isInsideExportOrImport(node)) { + return; + } + const reason = getDeprecationReason(node); + if (reason == null) { + return; + } + const type = services.getTypeAtLocation(node); + if ((0, util_1.typeMatchesSomeSpecifier)(type, allow, services.program)) { + return; + } + const name = getReportedNodeName(node); + context.report({ + ...(reason + ? { + messageId: 'deprecatedWithReason', + data: { name, reason }, + } + : { + messageId: 'deprecated', + data: { name }, + }), + node, + }); + } + return { + Identifier: checkIdentifier, + JSXIdentifier(node) { + if (node.parent.type !== utils_1.AST_NODE_TYPES.JSXClosingElement) { + checkIdentifier(node); + } + }, + PrivateIdentifier: checkIdentifier, + Super: checkIdentifier, + }; + }, +}); +function getReportedNodeName(node) { + if (node.type === utils_1.AST_NODE_TYPES.Super) { + return 'super'; + } + if (node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + return `#${node.name}`; + } + return node.name; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.d.ts.map new file mode 100644 index 0000000..1707039 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-dupe-class-members.d.ts","sourceRoot":"","sources":["../../src/rules/no-dupe-class-members.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;iDAiDw+F,SAAU,gBAAgB,GAAE,SAAU,kBAAkB;;;EAjDn/F,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;AAEtE,wBA2CG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js new file mode 100644 index 0000000..b5468da --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-dupe-class-members'); +exports.default = (0, util_1.createRule)({ + name: 'no-dupe-class-members', + meta: { + type: 'problem', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Disallow duplicate class members', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions: [], + create(context) { + const rules = baseRule.create(context); + function wrapMemberDefinitionListener(coreListener) { + return (node) => { + if (node.computed) { + return; + } + if (node.value && + node.value.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return; + } + return coreListener(node); + }; + } + return { + ...rules, + 'MethodDefinition, PropertyDefinition': wrapMemberDefinitionListener(rules['MethodDefinition, PropertyDefinition']), + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.d.ts.map new file mode 100644 index 0000000..980a147 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-duplicate-enum-values.d.ts","sourceRoot":"","sources":["../../src/rules/no-duplicate-enum-values.ts"],"names":[],"mappings":";AAMA,wBAgFG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js new file mode 100644 index 0000000..b54fd6b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-duplicate-enum-values', + meta: { + type: 'problem', + docs: { + description: 'Disallow duplicate enum member values', + recommended: 'recommended', + }, + hasSuggestions: false, + messages: { + duplicateValue: 'Duplicate enum member value {{value}}.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function isStringLiteral(node) { + return (node.type === utils_1.AST_NODE_TYPES.Literal && typeof node.value === 'string'); + } + function isNumberLiteral(node) { + return (node.type === utils_1.AST_NODE_TYPES.Literal && typeof node.value === 'number'); + } + function isStaticTemplateLiteral(node) { + return (node.type === utils_1.AST_NODE_TYPES.TemplateLiteral && + node.expressions.length === 0 && + node.quasis.length === 1); + } + return { + TSEnumDeclaration(node) { + const enumMembers = node.body.members; + const seenValues = new Set(); + enumMembers.forEach(member => { + if (member.initializer == null) { + return; + } + let value; + if (isStringLiteral(member.initializer)) { + value = String(member.initializer.value); + } + else if (isNumberLiteral(member.initializer)) { + value = Number(member.initializer.value); + } + else if (isStaticTemplateLiteral(member.initializer)) { + value = member.initializer.quasis[0].value.cooked; + } + if (value == null) { + return; + } + if (seenValues.has(value)) { + context.report({ + node: member, + messageId: 'duplicateValue', + data: { + value, + }, + }); + } + else { + seenValues.add(value); + } + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-type-constituents.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-type-constituents.d.ts.map new file mode 100644 index 0000000..4984743 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-type-constituents.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-duplicate-type-constituents.d.ts","sourceRoot":"","sources":["../../src/rules/no-duplicate-type-constituents.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;;AAwDrD,wBA4NG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-type-constituents.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-type-constituents.js new file mode 100644 index 0000000..acb785c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-type-constituents.js @@ -0,0 +1,219 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const astIgnoreKeys = new Set(['loc', 'parent', 'range']); +const isSameAstNode = (actualNode, expectedNode) => { + if (actualNode === expectedNode) { + return true; + } + if (actualNode && + expectedNode && + typeof actualNode === 'object' && + typeof expectedNode === 'object') { + if (Array.isArray(actualNode) && Array.isArray(expectedNode)) { + if (actualNode.length !== expectedNode.length) { + return false; + } + return !actualNode.some((nodeEle, index) => !isSameAstNode(nodeEle, expectedNode[index])); + } + const actualNodeKeys = Object.keys(actualNode).filter(key => !astIgnoreKeys.has(key)); + const expectedNodeKeys = Object.keys(expectedNode).filter(key => !astIgnoreKeys.has(key)); + if (actualNodeKeys.length !== expectedNodeKeys.length) { + return false; + } + if (actualNodeKeys.some(actualNodeKey => !Object.hasOwn(expectedNode, actualNodeKey))) { + return false; + } + if (actualNodeKeys.some(actualNodeKey => !isSameAstNode(actualNode[actualNodeKey], expectedNode[actualNodeKey]))) { + return false; + } + return true; + } + return false; +}; +exports.default = (0, util_1.createRule)({ + name: 'no-duplicate-type-constituents', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow duplicate constituents of union or intersection types', + recommended: 'recommended', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + duplicate: '{{type}} type constituent is duplicated with {{previous}}.', + unnecessary: 'Explicit undefined is unnecessary on an optional parameter.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreIntersections: { + type: 'boolean', + description: 'Whether to ignore `&` intersections.', + }, + ignoreUnions: { + type: 'boolean', + description: 'Whether to ignore `|` unions.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreIntersections: false, + ignoreUnions: false, + }, + ], + create(context, [{ ignoreIntersections, ignoreUnions }]) { + const parserServices = (0, util_1.getParserServices)(context); + const { sourceCode } = context; + function report(messageId, constituentNode, data) { + const getUnionOrIntersectionToken = (where, at) => sourceCode[`getTokens${where}`](constituentNode, { + filter: token => ['&', '|'].includes(token.value) && + constituentNode.parent.range[0] <= token.range[0] && + token.range[1] <= constituentNode.parent.range[1], + }).at(at); + const beforeUnionOrIntersectionToken = getUnionOrIntersectionToken('Before', -1); + let afterUnionOrIntersectionToken; + let bracketBeforeTokens; + let bracketAfterTokens; + if (beforeUnionOrIntersectionToken) { + bracketBeforeTokens = sourceCode.getTokensBetween(beforeUnionOrIntersectionToken, constituentNode); + bracketAfterTokens = sourceCode.getTokensAfter(constituentNode, { + count: bracketBeforeTokens.length, + }); + } + else { + afterUnionOrIntersectionToken = (0, util_1.nullThrows)(getUnionOrIntersectionToken('After', 0), util_1.NullThrowsReasons.MissingToken('union or intersection token', 'duplicate type constituent')); + bracketAfterTokens = sourceCode.getTokensBetween(constituentNode, afterUnionOrIntersectionToken); + bracketBeforeTokens = sourceCode.getTokensBefore(constituentNode, { + count: bracketAfterTokens.length, + }); + } + context.report({ + loc: { + start: constituentNode.loc.start, + end: (bracketAfterTokens.at(-1) ?? constituentNode).loc.end, + }, + node: constituentNode, + messageId, + data, + fix: fixer => [ + beforeUnionOrIntersectionToken, + ...bracketBeforeTokens, + constituentNode, + ...bracketAfterTokens, + afterUnionOrIntersectionToken, + ].flatMap(token => (token ? fixer.remove(token) : [])), + }); + } + function checkDuplicateRecursively(unionOrIntersection, constituentNode, uniqueConstituents, cachedTypeMap, forEachNodeType) { + const type = parserServices.getTypeAtLocation(constituentNode); + if (tsutils.isIntrinsicErrorType(type)) { + return; + } + const duplicatedPrevious = uniqueConstituents.find(ele => isSameAstNode(ele, constituentNode)) ?? + cachedTypeMap.get(type); + if (duplicatedPrevious) { + report('duplicate', constituentNode, { + type: unionOrIntersection, + previous: sourceCode.getText(duplicatedPrevious), + }); + return; + } + forEachNodeType?.(type, constituentNode); + cachedTypeMap.set(type, constituentNode); + uniqueConstituents.push(constituentNode); + if ((unionOrIntersection === 'Union' && + constituentNode.type === utils_1.AST_NODE_TYPES.TSUnionType) || + (unionOrIntersection === 'Intersection' && + constituentNode.type === utils_1.AST_NODE_TYPES.TSIntersectionType)) { + for (const constituent of constituentNode.types) { + checkDuplicateRecursively(unionOrIntersection, constituent, uniqueConstituents, cachedTypeMap, forEachNodeType); + } + } + } + function checkDuplicate(node, forEachNodeType) { + const cachedTypeMap = new Map(); + const uniqueConstituents = []; + const unionOrIntersection = node.type === utils_1.AST_NODE_TYPES.TSIntersectionType + ? 'Intersection' + : 'Union'; + for (const type of node.types) { + checkDuplicateRecursively(unionOrIntersection, type, uniqueConstituents, cachedTypeMap, forEachNodeType); + } + } + return { + ...(!ignoreIntersections && { + TSIntersectionType(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TSIntersectionType) { + return; + } + checkDuplicate(node); + }, + }), + ...(!ignoreUnions && { + TSUnionType: (node) => { + if (node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType) { + return; + } + checkDuplicate(node, (constituentNodeType, constituentNode) => { + const maybeTypeAnnotation = node.parent; + if (maybeTypeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeAnnotation) { + const maybeIdentifier = maybeTypeAnnotation.parent; + if (maybeIdentifier.type === utils_1.AST_NODE_TYPES.Identifier && + maybeIdentifier.optional) { + const maybeFunction = maybeIdentifier.parent; + if ((0, util_1.isFunctionOrFunctionType)(maybeFunction) && + maybeFunction.params.includes(maybeIdentifier) && + tsutils.isTypeFlagSet(constituentNodeType, ts.TypeFlags.Undefined)) { + report('unnecessary', constituentNode); + } + } + } + }); + }, + }), + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.d.ts.map new file mode 100644 index 0000000..1cf8585 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-dynamic-delete.d.ts","sourceRoot":"","sources":["../../src/rules/no-dynamic-delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAMnE,wBAwEG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js new file mode 100644 index 0000000..0937e40 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-dynamic-delete', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow using the `delete` operator on computed key expressions', + recommended: 'strict', + }, + fixable: 'code', + messages: { + dynamicDelete: 'Do not delete dynamically computed property keys.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function createFixer(member) { + if (member.property.type === utils_1.AST_NODE_TYPES.Literal && + typeof member.property.value === 'string') { + return createPropertyReplacement(member.property, `.${member.property.value}`); + } + return undefined; + } + return { + 'UnaryExpression[operator=delete]'(node) { + if (node.argument.type !== utils_1.AST_NODE_TYPES.MemberExpression || + !node.argument.computed || + isAcceptableIndexExpression(node.argument.property)) { + return; + } + context.report({ + node: node.argument.property, + messageId: 'dynamicDelete', + fix: createFixer(node.argument), + }); + }, + }; + function createPropertyReplacement(property, replacement) { + return (fixer) => fixer.replaceTextRange(getTokenRange(property), replacement); + } + function getTokenRange(property) { + return [ + (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(property), util_1.NullThrowsReasons.MissingToken('token before', 'property')).range[0], + (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(property), util_1.NullThrowsReasons.MissingToken('token after', 'property')).range[1], + ]; + } + }, +}); +function isAcceptableIndexExpression(property) { + return ((property.type === utils_1.AST_NODE_TYPES.Literal && + ['number', 'string'].includes(typeof property.value)) || + (property.type === utils_1.AST_NODE_TYPES.UnaryExpression && + property.operator === '-' && + property.argument.type === utils_1.AST_NODE_TYPES.Literal && + typeof property.argument.value === 'number')); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.d.ts.map new file mode 100644 index 0000000..b31be93 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-empty-function.d.ts","sourceRoot":"","sources":["../../src/rules/no-empty-function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;;8BA2K4S,SAAU,mBAAmB;6BAAuC,SAAU,kBAAkB;EA3KnW,CAAC;AAExD,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;AA0CtE,wBA6HG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js new file mode 100644 index 0000000..f4449fc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js @@ -0,0 +1,134 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-empty-function'); +const defaultOptions = [ + { + allow: [], + }, +]; +const schema = (0, util_1.deepMerge)( +// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- https://github.com/microsoft/TypeScript/issues/17002 +Array.isArray(baseRule.meta.schema) + ? baseRule.meta.schema[0] + : baseRule.meta.schema, { + properties: { + allow: { + description: 'Locations and kinds of functions that are allowed to be empty.', + items: { + type: 'string', + enum: [ + 'functions', + 'arrowFunctions', + 'generatorFunctions', + 'methods', + 'generatorMethods', + 'getters', + 'setters', + 'constructors', + 'private-constructors', + 'protected-constructors', + 'asyncFunctions', + 'asyncMethods', + 'decoratedFunctions', + 'overrideMethods', + ], + }, + }, + }, +}); +exports.default = (0, util_1.createRule)({ + name: 'no-empty-function', + meta: { + type: 'suggestion', + defaultOptions, + docs: { + description: 'Disallow empty functions', + extendsBaseRule: true, + recommended: 'stylistic', + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: [schema], + }, + defaultOptions, + create(context, [{ allow = [] }]) { + const rules = baseRule.create(context); + const isAllowedProtectedConstructors = allow.includes('protected-constructors'); + const isAllowedPrivateConstructors = allow.includes('private-constructors'); + const isAllowedDecoratedFunctions = allow.includes('decoratedFunctions'); + const isAllowedOverrideMethods = allow.includes('overrideMethods'); + /** + * Check if the method body is empty + * @param node the node to be validated + * @returns true if the body is empty + * @private + */ + function isBodyEmpty(node) { + return node.body.body.length === 0; + } + /** + * Check if method has parameter properties + * @param node the node to be validated + * @returns true if the body has parameter properties + * @private + */ + function hasParameterProperties(node) { + return node.params.some(param => param.type === utils_1.AST_NODE_TYPES.TSParameterProperty); + } + /** + * @param node the node to be validated + * @returns true if the constructor is allowed to be empty + * @private + */ + function isAllowedEmptyConstructor(node) { + const parent = node.parent; + if (isBodyEmpty(node) && + parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + parent.kind === 'constructor') { + const { accessibility } = parent; + return ( + // allow protected constructors + (accessibility === 'protected' && isAllowedProtectedConstructors) || + // allow private constructors + (accessibility === 'private' && isAllowedPrivateConstructors) || + // allow constructors which have parameter properties + hasParameterProperties(node)); + } + return false; + } + /** + * @param node the node to be validated + * @returns true if a function has decorators + * @private + */ + function isAllowedEmptyDecoratedFunctions(node) { + if (isAllowedDecoratedFunctions && isBodyEmpty(node)) { + const decorators = node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition + ? node.parent.decorators + : undefined; + return !!decorators && !!decorators.length; + } + return false; + } + function isAllowedEmptyOverrideMethod(node) { + return (isAllowedOverrideMethods && + isBodyEmpty(node) && + node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + node.parent.override); + } + return { + ...rules, + FunctionExpression(node) { + if (isAllowedEmptyConstructor(node) || + isAllowedEmptyDecoratedFunctions(node) || + isAllowedEmptyOverrideMethod(node)) { + return; + } + rules.FunctionExpression(node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.d.ts.map new file mode 100644 index 0000000..db812de --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-empty-interface.d.ts","sourceRoot":"","sources":["../../src/rules/no-empty-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOzD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,kBAAkB,CAAC;;AAExD,wBAwGG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js new file mode 100644 index 0000000..b52d9d4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-empty-interface', + meta: { + type: 'suggestion', + deprecated: true, + docs: { + description: 'Disallow the declaration of empty interfaces', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + noEmpty: 'An empty interface is equivalent to `{}`.', + noEmptyWithSuper: 'An interface declaring no members is equivalent to its supertype.', + }, + replacedBy: ['@typescript-eslint/no-empty-object-type'], + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowSingleExtends: { + type: 'boolean', + description: 'Whether to allow empty interfaces that extend a single other interface.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowSingleExtends: false, + }, + ], + create(context, [{ allowSingleExtends }]) { + return { + TSInterfaceDeclaration(node) { + if (node.body.body.length !== 0) { + // interface contains members --> Nothing to report + return; + } + const extend = node.extends; + if (extend.length === 0) { + context.report({ + node: node.id, + messageId: 'noEmpty', + }); + } + else if (extend.length === 1 && + // interface extends exactly 1 interface --> Report depending on rule setting + !allowSingleExtends) { + const fix = (fixer) => { + let typeParam = ''; + if (node.typeParameters) { + typeParam = context.sourceCode.getText(node.typeParameters); + } + return fixer.replaceText(node, `type ${context.sourceCode.getText(node.id)}${typeParam} = ${context.sourceCode.getText(extend[0])}`); + }; + const scope = context.sourceCode.getScope(node); + const mergedWithClassDeclaration = scope.set + .get(node.id.name) + ?.defs.some(def => def.node.type === utils_1.AST_NODE_TYPES.ClassDeclaration); + const isInAmbientDeclaration = !!((0, util_1.isDefinitionFile)(context.filename) && + scope.type === scope_manager_1.ScopeType.tsModule && + scope.block.declare); + const useAutoFix = !(isInAmbientDeclaration || mergedWithClassDeclaration); + context.report({ + node: node.id, + messageId: 'noEmptyWithSuper', + ...(useAutoFix + ? { fix } + : !mergedWithClassDeclaration + ? { + suggest: [ + { + messageId: 'noEmptyWithSuper', + fix, + }, + ], + } + : null), + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-object-type.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-object-type.d.ts.map new file mode 100644 index 0000000..3ffe6c4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-object-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-empty-object-type.d.ts","sourceRoot":"","sources":["../../src/rules/no-empty-object-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAMzD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,qBAAqB,CAAC;AAEzE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,kBAAkB,GAClB,2BAA2B,GAC3B,eAAe,GACf,uBAAuB,GACvB,gCAAgC,GAChC,wBAAwB,CAAC;;AAU7B,wBA6JG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-object-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-object-type.js new file mode 100644 index 0000000..89beddf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-object-type.js @@ -0,0 +1,143 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const noEmptyMessage = (emptyType) => [ + `${emptyType} allows any non-nullish value, including literals like \`0\` and \`""\`.`, + "- If that's what you want, disable this lint rule with an inline comment or configure the '{{ option }}' rule option.", + '- If you want a type meaning "any object", you probably want `object` instead.', + '- If you want a type meaning "any value", you probably want `unknown` instead.', +].join('\n'); +exports.default = (0, util_1.createRule)({ + name: 'no-empty-object-type', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow accidentally using the "empty object" type', + recommended: 'recommended', + }, + hasSuggestions: true, + messages: { + noEmptyInterface: noEmptyMessage('An empty interface declaration'), + noEmptyInterfaceWithSuper: 'An interface declaring no members is equivalent to its supertype.', + noEmptyObject: noEmptyMessage('The `{}` ("empty object") type'), + replaceEmptyInterface: 'Replace empty interface with `{{replacement}}`.', + replaceEmptyInterfaceWithSuper: 'Replace empty interface with a type alias.', + replaceEmptyObjectType: 'Replace `{}` with `{{replacement}}`.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowInterfaces: { + type: 'string', + description: 'Whether to allow empty interfaces.', + enum: ['always', 'never', 'with-single-extends'], + }, + allowObjectTypes: { + type: 'string', + description: 'Whether to allow empty object type literals.', + enum: ['always', 'never'], + }, + allowWithName: { + type: 'string', + description: 'A stringified regular expression to allow interfaces and object type aliases with the configured name.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowInterfaces: 'never', + allowObjectTypes: 'never', + }, + ], + create(context, [{ allowInterfaces, allowObjectTypes, allowWithName }]) { + const allowWithNameTester = allowWithName + ? new RegExp(allowWithName, 'u') + : undefined; + return { + ...(allowInterfaces !== 'always' && { + TSInterfaceDeclaration(node) { + if (allowWithNameTester?.test(node.id.name)) { + return; + } + const extend = node.extends; + if (node.body.body.length !== 0 || + (extend.length === 1 && + allowInterfaces === 'with-single-extends') || + extend.length > 1) { + return; + } + const scope = context.sourceCode.getScope(node); + const mergedWithClassDeclaration = scope.set + .get(node.id.name) + ?.defs.some(def => def.node.type === utils_1.AST_NODE_TYPES.ClassDeclaration); + if (extend.length === 0) { + context.report({ + node: node.id, + messageId: 'noEmptyInterface', + data: { option: 'allowInterfaces' }, + ...(!mergedWithClassDeclaration && { + suggest: ['object', 'unknown'].map(replacement => ({ + messageId: 'replaceEmptyInterface', + data: { replacement }, + fix(fixer) { + const id = context.sourceCode.getText(node.id); + const typeParam = node.typeParameters + ? context.sourceCode.getText(node.typeParameters) + : ''; + return fixer.replaceText(node, `type ${id}${typeParam} = ${replacement}`); + }, + })), + }), + }); + return; + } + context.report({ + node: node.id, + messageId: 'noEmptyInterfaceWithSuper', + ...(!mergedWithClassDeclaration && { + suggest: [ + { + messageId: 'replaceEmptyInterfaceWithSuper', + fix(fixer) { + const extended = context.sourceCode.getText(extend[0]); + const id = context.sourceCode.getText(node.id); + const typeParam = node.typeParameters + ? context.sourceCode.getText(node.typeParameters) + : ''; + return fixer.replaceText(node, `type ${id}${typeParam} = ${extended}`); + }, + }, + ], + }), + }); + }, + }), + ...(allowObjectTypes !== 'always' && { + TSTypeLiteral(node) { + if (node.members.length || + node.parent.type === utils_1.AST_NODE_TYPES.TSIntersectionType || + (allowWithNameTester && + node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration && + allowWithNameTester.test(node.parent.id.name))) { + return; + } + context.report({ + node, + messageId: 'noEmptyObject', + data: { option: 'allowObjectTypes' }, + suggest: ['object', 'unknown'].map(replacement => ({ + messageId: 'replaceEmptyObjectType', + data: { replacement }, + fix: (fixer) => fixer.replaceText(node, replacement), + })), + }); + }, + }), + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.d.ts.map new file mode 100644 index 0000000..2946d66 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-explicit-any.d.ts","sourceRoot":"","sources":["../../src/rules/no-explicit-any.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAMnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,gBAAgB,GAAG,eAAe,CAAC;;AAE7E,wBAsMG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js new file mode 100644 index 0000000..5b0970b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js @@ -0,0 +1,169 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-explicit-any', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow the `any` type', + recommended: 'recommended', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + suggestNever: "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", + suggestUnknown: 'Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.', + unexpectedAny: 'Unexpected any. Specify a different type.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + fixToUnknown: { + type: 'boolean', + description: 'Whether to enable auto-fixing in which the `any` type is converted to the `unknown` type.', + }, + ignoreRestArgs: { + type: 'boolean', + description: 'Whether to ignore rest parameter arrays.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + fixToUnknown: false, + ignoreRestArgs: false, + }, + ], + create(context, [{ fixToUnknown, ignoreRestArgs }]) { + /** + * Checks if the node is an arrow function, function/constructor declaration or function expression + * @param node the node to be validated. + * @returns true if the node is any kind of function declaration or expression + * @private + */ + function isNodeValidFunction(node) { + return [ + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, // const x = (...args: any[]) => {}; + utils_1.AST_NODE_TYPES.FunctionDeclaration, // function f(...args: any[]) {} + utils_1.AST_NODE_TYPES.FunctionExpression, // const x = function(...args: any[]) {}; + utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, // type T = {(...args: any[]): unknown}; + utils_1.AST_NODE_TYPES.TSConstructorType, // type T = new (...args: any[]) => unknown + utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, // type T = {new (...args: any[]): unknown}; + utils_1.AST_NODE_TYPES.TSDeclareFunction, // declare function _8(...args: any[]): unknown; + utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, // declare class A { f(...args: any[]): unknown; } + utils_1.AST_NODE_TYPES.TSFunctionType, // type T = (...args: any[]) => unknown; + utils_1.AST_NODE_TYPES.TSMethodSignature, // type T = {f(...args: any[]): unknown}; + ].includes(node.type); + } + /** + * Checks if the node is a rest element child node of a function + * @param node the node to be validated. + * @returns true if the node is a rest element child node of a function + * @private + */ + function isNodeRestElementInFunction(node) { + return (node.type === utils_1.AST_NODE_TYPES.RestElement && + isNodeValidFunction(node.parent)); + } + /** + * Checks if the node is a TSTypeOperator node with a readonly operator + * @param node the node to be validated. + * @returns true if the node is a TSTypeOperator node with a readonly operator + * @private + */ + function isNodeReadonlyTSTypeOperator(node) { + return (node.type === utils_1.AST_NODE_TYPES.TSTypeOperator && + node.operator === 'readonly'); + } + /** + * Checks if the node is a TSTypeReference node with an Array identifier + * @param node the node to be validated. + * @returns true if the node is a TSTypeReference node with an Array identifier + * @private + */ + function isNodeValidArrayTSTypeReference(node) { + return (node.type === utils_1.AST_NODE_TYPES.TSTypeReference && + node.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + ['Array', 'ReadonlyArray'].includes(node.typeName.name)); + } + /** + * Checks if the node is a valid TSTypeOperator or TSTypeReference node + * @param node the node to be validated. + * @returns true if the node is a valid TSTypeOperator or TSTypeReference node + * @private + */ + function isNodeValidTSType(node) { + return (isNodeReadonlyTSTypeOperator(node) || + isNodeValidArrayTSTypeReference(node)); + } + /** + * Checks if the great grand-parent node is a RestElement node in a function + * @param node the node to be validated. + * @returns true if the great grand-parent node is a RestElement node in a function + * @private + */ + function isGreatGrandparentRestElement(node) { + return (node.parent?.parent?.parent != null && + isNodeRestElementInFunction(node.parent.parent.parent)); + } + /** + * Checks if the great great grand-parent node is a valid RestElement node in a function + * @param node the node to be validated. + * @returns true if the great great grand-parent node is a valid RestElement node in a function + * @private + */ + function isGreatGreatGrandparentRestElement(node) { + return (node.parent?.parent?.parent?.parent != null && + isNodeValidTSType(node.parent.parent) && + isNodeRestElementInFunction(node.parent.parent.parent.parent)); + } + /** + * Checks if the great grand-parent or the great great grand-parent node is a RestElement node + * @param node the node to be validated. + * @returns true if the great grand-parent or the great great grand-parent node is a RestElement node + * @private + */ + function isNodeDescendantOfRestElementInFunction(node) { + return (isGreatGrandparentRestElement(node) || + isGreatGreatGrandparentRestElement(node)); + } + return { + TSAnyKeyword(node) { + if (ignoreRestArgs && isNodeDescendantOfRestElementInFunction(node)) { + return; + } + const fixOrSuggest = { + fix: null, + suggest: [ + { + messageId: 'suggestUnknown', + fix(fixer) { + return fixer.replaceText(node, 'unknown'); + }, + }, + { + messageId: 'suggestNever', + fix(fixer) { + return fixer.replaceText(node, 'never'); + }, + }, + ], + }; + if (fixToUnknown) { + fixOrSuggest.fix = (fixer) => fixer.replaceText(node, 'unknown'); + } + context.report({ + node, + messageId: 'unexpectedAny', + ...fixOrSuggest, + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.d.ts.map new file mode 100644 index 0000000..c23c383 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-extra-non-null-assertion.d.ts","sourceRoot":"","sources":["../../src/rules/no-extra-non-null-assertion.ts"],"names":[],"mappings":";AAIA,wBAoCG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js new file mode 100644 index 0000000..e91afd7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-extra-non-null-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallow extra non-null assertions', + recommended: 'recommended', + }, + fixable: 'code', + messages: { + noExtraNonNullAssertion: 'Forbidden extra non-null assertion.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function checkExtraNonNullAssertion(node) { + context.report({ + node, + messageId: 'noExtraNonNullAssertion', + fix(fixer) { + return fixer.removeRange([node.range[1] - 1, node.range[1]]); + }, + }); + } + return { + 'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion, + 'MemberExpression[optional = true] > TSNonNullExpression.object': checkExtraNonNullAssertion, + 'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.d.ts.map new file mode 100644 index 0000000..3f835c4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-extraneous-class.d.ts","sourceRoot":"","sources":["../../src/rules/no-extraneous-class.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,iBAAiB,GAAG,YAAY,CAAC;;AAEpE,wBA8IG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js new file mode 100644 index 0000000..3e05244 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js @@ -0,0 +1,120 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-extraneous-class', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow classes used as namespaces', + recommended: 'strict', + }, + messages: { + empty: 'Unexpected empty class.', + onlyConstructor: 'Unexpected class with only a constructor.', + onlyStatic: 'Unexpected class with only static properties.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowConstructorOnly: { + type: 'boolean', + description: 'Whether to allow extraneous classes that contain only a constructor.', + }, + allowEmpty: { + type: 'boolean', + description: 'Whether to allow extraneous classes that have no body (i.e. are empty).', + }, + allowStaticOnly: { + type: 'boolean', + description: 'Whether to allow extraneous classes that only contain static members.', + }, + allowWithDecorator: { + type: 'boolean', + description: 'Whether to allow extraneous classes that include a decorator.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowConstructorOnly: false, + allowEmpty: false, + allowStaticOnly: false, + allowWithDecorator: false, + }, + ], + create(context, [{ allowConstructorOnly, allowEmpty, allowStaticOnly, allowWithDecorator }]) { + const isAllowWithDecorator = (node) => { + return !!(allowWithDecorator && + node?.decorators && + node.decorators.length !== 0); + }; + return { + ClassBody(node) { + const parent = node.parent; + if (parent.superClass || isAllowWithDecorator(parent)) { + return; + } + const reportNode = parent.type === utils_1.AST_NODE_TYPES.ClassDeclaration && parent.id + ? parent.id + : parent; + if (node.body.length === 0) { + if (allowEmpty) { + return; + } + context.report({ + node: reportNode, + messageId: 'empty', + }); + return; + } + let onlyStatic = true; + let onlyConstructor = true; + for (const prop of node.body) { + if (prop.type === utils_1.AST_NODE_TYPES.MethodDefinition && + prop.kind === 'constructor') { + if (prop.value.params.some(param => param.type === utils_1.AST_NODE_TYPES.TSParameterProperty)) { + onlyConstructor = false; + onlyStatic = false; + } + } + else { + onlyConstructor = false; + if (((prop.type === utils_1.AST_NODE_TYPES.PropertyDefinition || + prop.type === utils_1.AST_NODE_TYPES.MethodDefinition || + prop.type === utils_1.AST_NODE_TYPES.AccessorProperty) && + !prop.static) || + prop.type === utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition || + prop.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || // `static abstract` methods and properties are currently not supported. See: https://github.com/microsoft/TypeScript/issues/34516 + prop.type === utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty) { + onlyStatic = false; + } + } + if (!(onlyStatic || onlyConstructor)) { + break; + } + } + if (onlyConstructor) { + if (!allowConstructorOnly) { + context.report({ + node: reportNode, + messageId: 'onlyConstructor', + }); + } + return; + } + if (onlyStatic && !allowStaticOnly) { + context.report({ + node: reportNode, + messageId: 'onlyStatic', + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.d.ts.map new file mode 100644 index 0000000..cb42a77 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-floating-promises.d.ts","sourceRoot":"","sources":["../../src/rules/no-floating-promises.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAMnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAepD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,sBAAsB,CAAC,EAAE,oBAAoB,EAAE,CAAC;QAChD,yBAAyB,CAAC,EAAE,oBAAoB,EAAE,CAAC;QACnD,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB;CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,UAAU,GACV,kBAAkB,GAClB,iBAAiB,GACjB,sBAAsB,GACtB,0BAA0B,GAC1B,iCAAiC,GACjC,qCAAqC,GACrC,cAAc,CAAC;;AAmBnB,wBAkaG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js new file mode 100644 index 0000000..44f812d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js @@ -0,0 +1,381 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const messageBase = 'Promises must be awaited, end with a call to .catch, or end with a call to .then with a rejection handler.'; +const messageBaseVoid = 'Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler' + + ' or be explicitly marked as ignored with the `void` operator.'; +const messageRejectionHandler = 'A rejection handler that is not a function will be ignored.'; +const messagePromiseArray = "An array of Promises may be unintentional. Consider handling the promises' fulfillment or rejection with Promise.all or similar."; +const messagePromiseArrayVoid = "An array of Promises may be unintentional. Consider handling the promises' fulfillment or rejection with Promise.all or similar," + + ' or explicitly marking the expression as ignored with the `void` operator.'; +exports.default = (0, util_1.createRule)({ + name: 'no-floating-promises', + meta: { + type: 'problem', + docs: { + description: 'Require Promise-like statements to be handled appropriately', + recommended: 'recommended', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + floating: messageBase, + floatingFixAwait: 'Add await operator.', + floatingFixVoid: 'Add void operator to ignore.', + floatingPromiseArray: messagePromiseArray, + floatingPromiseArrayVoid: messagePromiseArrayVoid, + floatingUselessRejectionHandler: `${messageBase} ${messageRejectionHandler}`, + floatingUselessRejectionHandlerVoid: `${messageBaseVoid} ${messageRejectionHandler}`, + floatingVoid: messageBaseVoid, + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowForKnownSafeCalls: { + ...util_1.readonlynessOptionsSchema.properties.allow, + description: 'Type specifiers of functions whose calls are safe to float.', + }, + allowForKnownSafePromises: { + ...util_1.readonlynessOptionsSchema.properties.allow, + description: 'Type specifiers that are known to be safe to float.', + }, + checkThenables: { + type: 'boolean', + description: 'Whether to check all "Thenable"s, not just the built-in Promise type.', + }, + ignoreIIFE: { + type: 'boolean', + description: 'Whether to ignore async IIFEs (Immediately Invoked Function Expressions).', + }, + ignoreVoid: { + type: 'boolean', + description: 'Whether to ignore `void` expressions.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowForKnownSafeCalls: util_1.readonlynessOptionsDefaults.allow, + allowForKnownSafePromises: util_1.readonlynessOptionsDefaults.allow, + checkThenables: false, + ignoreIIFE: false, + ignoreVoid: true, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const { checkThenables } = options; + // TODO: #5439 + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + const allowForKnownSafePromises = options.allowForKnownSafePromises; + const allowForKnownSafeCalls = options.allowForKnownSafeCalls; + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + return { + ExpressionStatement(node) { + if (options.ignoreIIFE && isAsyncIife(node)) { + return; + } + const expression = (0, util_1.skipChainExpression)(node.expression); + if (isKnownSafePromiseReturn(expression)) { + return; + } + const { isUnhandled, nonFunctionHandler, promiseArray } = isUnhandledPromise(checker, expression); + if (isUnhandled) { + if (promiseArray) { + context.report({ + node, + messageId: options.ignoreVoid + ? 'floatingPromiseArrayVoid' + : 'floatingPromiseArray', + }); + } + else if (options.ignoreVoid) { + context.report({ + node, + messageId: nonFunctionHandler + ? 'floatingUselessRejectionHandlerVoid' + : 'floatingVoid', + suggest: [ + { + messageId: 'floatingFixVoid', + fix(fixer) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node.expression); + if (isHigherPrecedenceThanUnary(tsNode)) { + return fixer.insertTextBefore(node, 'void '); + } + return [ + fixer.insertTextBefore(node, 'void ('), + fixer.insertTextAfterRange([expression.range[1], expression.range[1]], ')'), + ]; + }, + }, + { + messageId: 'floatingFixAwait', + fix: (fixer) => addAwait(fixer, expression, node), + }, + ], + }); + } + else { + context.report({ + node, + messageId: nonFunctionHandler + ? 'floatingUselessRejectionHandler' + : 'floating', + suggest: [ + { + messageId: 'floatingFixAwait', + fix: (fixer) => addAwait(fixer, expression, node), + }, + ], + }); + } + } + }, + }; + function addAwait(fixer, expression, node) { + if (expression.type === utils_1.AST_NODE_TYPES.UnaryExpression && + expression.operator === 'void') { + return fixer.replaceTextRange([expression.range[0], expression.range[0] + 4], 'await'); + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node.expression); + if (isHigherPrecedenceThanUnary(tsNode)) { + return fixer.insertTextBefore(node, 'await '); + } + return [ + fixer.insertTextBefore(node, 'await ('), + fixer.insertTextAfterRange([expression.range[1], expression.range[1]], ')'), + ]; + } + function isKnownSafePromiseReturn(node) { + if (node.type !== utils_1.AST_NODE_TYPES.CallExpression) { + return false; + } + const type = services.getTypeAtLocation(node.callee); + return (0, util_1.typeMatchesSomeSpecifier)(type, allowForKnownSafeCalls, services.program); + } + function isHigherPrecedenceThanUnary(node) { + const operator = ts.isBinaryExpression(node) + ? node.operatorToken.kind + : ts.SyntaxKind.Unknown; + const nodePrecedence = (0, util_1.getOperatorPrecedence)(node.kind, operator); + return nodePrecedence > util_1.OperatorPrecedence.Unary; + } + function isAsyncIife(node) { + if (node.expression.type !== utils_1.AST_NODE_TYPES.CallExpression) { + return false; + } + return (node.expression.callee.type === + utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + node.expression.callee.type === utils_1.AST_NODE_TYPES.FunctionExpression); + } + function isValidRejectionHandler(rejectionHandler) { + return (services.program + .getTypeChecker() + .getTypeAtLocation(services.esTreeNodeToTSNodeMap.get(rejectionHandler)) + .getCallSignatures().length > 0); + } + function isUnhandledPromise(checker, node) { + if (node.type === utils_1.AST_NODE_TYPES.AssignmentExpression) { + return { isUnhandled: false }; + } + // First, check expressions whose resulting types may not be promise-like + if (node.type === utils_1.AST_NODE_TYPES.SequenceExpression) { + // Any child in a comma expression could return a potentially unhandled + // promise, so we check them all regardless of whether the final returned + // value is promise-like. + return (node.expressions + .map(item => isUnhandledPromise(checker, item)) + .find(result => result.isUnhandled) ?? { isUnhandled: false }); + } + if (!options.ignoreVoid && + node.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.operator === 'void') { + // Similarly, a `void` expression always returns undefined, so we need to + // see what's inside it without checking the type of the overall expression. + return isUnhandledPromise(checker, node.argument); + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + // Check the type. At this point it can't be unhandled if it isn't a promise + // or array thereof. + if (isPromiseArray(tsNode)) { + return { isUnhandled: true, promiseArray: true }; + } + // await expression addresses promises, but not promise arrays. + if (node.type === utils_1.AST_NODE_TYPES.AwaitExpression) { + // you would think this wouldn't be strictly necessary, since we're + // anyway checking the type of the expression, but, unfortunately TS + // reports the result of `await (promise as Promise & number)` + // as `Promise & number` instead of `number`. + return { isUnhandled: false }; + } + if (!isPromiseLike(tsNode)) { + return { isUnhandled: false }; + } + if (node.type === utils_1.AST_NODE_TYPES.CallExpression) { + // If the outer expression is a call, a `.catch()` or `.then()` with + // rejection handler handles the promise. + const { callee } = node; + if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression) { + const methodName = (0, util_1.getStaticMemberAccessValue)(callee, context); + const catchRejectionHandler = methodName === 'catch' && node.arguments.length >= 1 + ? node.arguments[0] + : undefined; + if (catchRejectionHandler) { + if (isValidRejectionHandler(catchRejectionHandler)) { + return { isUnhandled: false }; + } + return { isUnhandled: true, nonFunctionHandler: true }; + } + const thenRejectionHandler = methodName === 'then' && node.arguments.length >= 2 + ? node.arguments[1] + : undefined; + if (thenRejectionHandler) { + if (isValidRejectionHandler(thenRejectionHandler)) { + return { isUnhandled: false }; + } + return { isUnhandled: true, nonFunctionHandler: true }; + } + // `x.finally()` is transparent to resolution of the promise, so check `x`. + // ("object" in this context is the `x` in `x.finally()`) + const promiseFinallyObject = methodName === 'finally' ? callee.object : undefined; + if (promiseFinallyObject) { + return isUnhandledPromise(checker, promiseFinallyObject); + } + } + // All other cases are unhandled. + return { isUnhandled: true }; + } + if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) { + // We must be getting the promise-like value from one of the branches of the + // ternary. Check them directly. + const alternateResult = isUnhandledPromise(checker, node.alternate); + if (alternateResult.isUnhandled) { + return alternateResult; + } + return isUnhandledPromise(checker, node.consequent); + } + if (node.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + const leftResult = isUnhandledPromise(checker, node.left); + if (leftResult.isUnhandled) { + return leftResult; + } + return isUnhandledPromise(checker, node.right); + } + // Anything else is unhandled. + return { isUnhandled: true }; + } + function isPromiseArray(node) { + const type = checker.getTypeAtLocation(node); + for (const ty of tsutils + .unionTypeParts(type) + .map(t => checker.getApparentType(t))) { + if (checker.isArrayType(ty)) { + const arrayType = checker.getTypeArguments(ty)[0]; + if (isPromiseLike(node, arrayType)) { + return true; + } + } + if (checker.isTupleType(ty)) { + for (const tupleElementType of checker.getTypeArguments(ty)) { + if (isPromiseLike(node, tupleElementType)) { + return true; + } + } + } + } + return false; + } + function isPromiseLike(node, type) { + type ??= checker.getTypeAtLocation(node); + // The highest priority is to allow anything allowlisted + if ((0, util_1.typeMatchesSomeSpecifier)(type, allowForKnownSafePromises, services.program)) { + return false; + } + // Otherwise, we always consider the built-in Promise to be Promise-like... + const typeParts = tsutils.unionTypeParts(checker.getApparentType(type)); + if (typeParts.some(typePart => (0, util_1.isBuiltinSymbolLike)(services.program, typePart, 'Promise'))) { + return true; + } + // ...and only check all Thenables if explicitly told to + if (!checkThenables) { + return false; + } + // Modified from tsutils.isThenable() to only consider thenables which can be + // rejected/caught via a second parameter. Original source (MIT licensed): + // + // https://github.com/ajafff/tsutils/blob/49d0d31050b44b81e918eae4fbaf1dfe7b7286af/util/type.ts#L95-L125 + for (const ty of typeParts) { + const then = ty.getProperty('then'); + if (then == null) { + continue; + } + const thenType = checker.getTypeOfSymbolAtLocation(then, node); + if (hasMatchingSignature(thenType, signature => signature.parameters.length >= 2 && + isFunctionParam(checker, signature.parameters[0], node) && + isFunctionParam(checker, signature.parameters[1], node))) { + return true; + } + } + return false; + } + }, +}); +function hasMatchingSignature(type, matcher) { + for (const t of tsutils.unionTypeParts(type)) { + if (t.getCallSignatures().some(matcher)) { + return true; + } + } + return false; +} +function isFunctionParam(checker, param, node) { + const type = checker.getApparentType(checker.getTypeOfSymbolAtLocation(param, node)); + for (const t of tsutils.unionTypeParts(type)) { + if (t.getCallSignatures().length !== 0) { + return true; + } + } + return false; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.d.ts.map new file mode 100644 index 0000000..7e2f955 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-for-in-array.d.ts","sourceRoot":"","sources":["../../src/rules/no-for-in-array.ts"],"names":[],"mappings":";AAUA,wBAiCG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js new file mode 100644 index 0000000..95f3e8b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js @@ -0,0 +1,86 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getForStatementHeadLoc_1 = require("../util/getForStatementHeadLoc"); +exports.default = (0, util_1.createRule)({ + name: 'no-for-in-array', + meta: { + type: 'problem', + docs: { + description: 'Disallow iterating over an array with a for-in loop', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + forInViolation: 'For-in loops over arrays skips holes, returns indices as strings, and may visit the prototype chain or other enumerable properties. Use a more robust iteration method such as for-of or array.forEach instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + ForInStatement(node) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node.right); + if (isArrayLike(checker, type)) { + context.report({ + loc: (0, getForStatementHeadLoc_1.getForStatementHeadLoc)(context.sourceCode, node), + messageId: 'forInViolation', + }); + } + }, + }; + }, +}); +function isArrayLike(checker, type) { + return isTypeRecurser(type, t => t.getNumberIndexType() != null && hasArrayishLength(checker, t)); +} +function hasArrayishLength(checker, type) { + const lengthProperty = type.getProperty('length'); + if (lengthProperty == null) { + return false; + } + return tsutils.isTypeFlagSet(checker.getTypeOfSymbol(lengthProperty), ts.TypeFlags.NumberLike); +} +function isTypeRecurser(type, predicate) { + if (type.isUnionOrIntersection()) { + return type.types.some(t => isTypeRecurser(t, predicate)); + } + return predicate(type); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.d.ts.map new file mode 100644 index 0000000..319aedf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-implied-eval.d.ts","sourceRoot":"","sources":["../../src/rules/no-implied-eval.ts"],"names":[],"mappings":";AAsBA,wBA6IG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js new file mode 100644 index 0000000..52c745e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js @@ -0,0 +1,152 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const FUNCTION_CONSTRUCTOR = 'Function'; +const GLOBAL_CANDIDATES = new Set(['global', 'globalThis', 'window']); +const EVAL_LIKE_FUNCTIONS = new Set([ + 'execScript', + 'setImmediate', + 'setInterval', + 'setTimeout', +]); +exports.default = (0, util_1.createRule)({ + name: 'no-implied-eval', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow the use of `eval()`-like functions', + extendsBaseRule: true, + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + noFunctionConstructor: 'Implied eval. Do not use the Function constructor to create functions.', + noImpliedEvalError: 'Implied eval. Consider passing a function.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function getCalleeName(node) { + if (node.type === utils_1.AST_NODE_TYPES.Identifier) { + return node.name; + } + if (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.object.type === utils_1.AST_NODE_TYPES.Identifier && + GLOBAL_CANDIDATES.has(node.object.name)) { + if (node.property.type === utils_1.AST_NODE_TYPES.Identifier) { + return node.property.name; + } + if (node.property.type === utils_1.AST_NODE_TYPES.Literal && + typeof node.property.value === 'string') { + return node.property.value; + } + } + return null; + } + function isFunctionType(node) { + const type = services.getTypeAtLocation(node); + const symbol = type.getSymbol(); + if (symbol && + tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Function | ts.SymbolFlags.Method)) { + return true; + } + if ((0, util_1.isBuiltinSymbolLike)(services.program, type, FUNCTION_CONSTRUCTOR)) { + return true; + } + const signatures = checker.getSignaturesOfType(type, ts.SignatureKind.Call); + return signatures.length > 0; + } + function isBind(node) { + return node.type === utils_1.AST_NODE_TYPES.MemberExpression + ? isBind(node.property) + : node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === 'bind'; + } + function isFunction(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + case utils_1.AST_NODE_TYPES.FunctionExpression: + return true; + case utils_1.AST_NODE_TYPES.Literal: + case utils_1.AST_NODE_TYPES.TemplateLiteral: + return false; + case utils_1.AST_NODE_TYPES.CallExpression: + return isBind(node.callee) || isFunctionType(node); + default: + return isFunctionType(node); + } + } + function checkImpliedEval(node) { + const calleeName = getCalleeName(node.callee); + if (calleeName == null) { + return; + } + if (calleeName === FUNCTION_CONSTRUCTOR) { + const type = services.getTypeAtLocation(node.callee); + const symbol = type.getSymbol(); + if (symbol) { + if ((0, util_1.isBuiltinSymbolLike)(services.program, type, 'FunctionConstructor')) { + context.report({ node, messageId: 'noFunctionConstructor' }); + return; + } + } + else { + context.report({ node, messageId: 'noFunctionConstructor' }); + return; + } + } + if (node.arguments.length === 0) { + return; + } + const [handler] = node.arguments; + if (EVAL_LIKE_FUNCTIONS.has(calleeName) && + !isFunction(handler) && + (0, util_1.isReferenceToGlobalFunction)(calleeName, node, context.sourceCode)) { + context.report({ node: handler, messageId: 'noImpliedEvalError' }); + } + } + return { + CallExpression: checkImpliedEval, + NewExpression: checkImpliedEval, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-import-type-side-effects.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-import-type-side-effects.d.ts.map new file mode 100644 index 0000000..467025d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-import-type-side-effects.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-import-type-side-effects.d.ts","sourceRoot":"","sources":["../../src/rules/no-import-type-side-effects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAYnE,MAAM,MAAM,OAAO,GAAG,EAAE,CAAC;AACzB,MAAM,MAAM,UAAU,GAAG,sBAAsB,CAAC;;AAEhD,wBAqEG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-import-type-side-effects.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-import-type-side-effects.js new file mode 100644 index 0000000..e4e09b7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-import-type-side-effects.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-import-type-side-effects', + meta: { + type: 'problem', + docs: { + description: 'Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers', + }, + fixable: 'code', + messages: { + useTopLevelQualifier: 'TypeScript will only remove the inline type specifiers which will leave behind a side effect import at runtime. Convert this to a top-level type qualifier to properly remove the entire import.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + 'ImportDeclaration[importKind!="type"]'(node) { + if (node.specifiers.length === 0) { + return; + } + const specifiers = []; + for (const specifier of node.specifiers) { + if (specifier.type !== utils_1.AST_NODE_TYPES.ImportSpecifier || + specifier.importKind !== 'type') { + return; + } + specifiers.push(specifier); + } + context.report({ + node, + messageId: 'useTopLevelQualifier', + fix(fixer) { + const fixes = []; + for (const specifier of specifiers) { + const qualifier = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(specifier, util_1.isTypeKeyword), util_1.NullThrowsReasons.MissingToken('type keyword', 'import specifier')); + fixes.push(fixer.removeRange([ + qualifier.range[0], + specifier.imported.range[0], + ])); + } + const importKeyword = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import keyword', 'import')); + fixes.push(fixer.insertTextAfter(importKeyword, ' type')); + return fixes; + }, + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.d.ts.map new file mode 100644 index 0000000..5c08dd2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-inferrable-types.d.ts","sourceRoot":"","sources":["../../src/rules/no-inferrable-types.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC;;AAE5C,wBAgRG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js new file mode 100644 index 0000000..622ac2d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js @@ -0,0 +1,182 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-inferrable-types', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + noInferrableType: 'Type {{type}} trivially inferred from a {{type}} literal, remove type annotation.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreParameters: { + type: 'boolean', + description: 'Whether to ignore function parameters.', + }, + ignoreProperties: { + type: 'boolean', + description: 'Whether to ignore class properties.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreParameters: false, + ignoreProperties: false, + }, + ], + create(context, [{ ignoreParameters, ignoreProperties }]) { + function isFunctionCall(init, callName) { + const node = (0, util_1.skipChainExpression)(init); + return (node.type === utils_1.AST_NODE_TYPES.CallExpression && + node.callee.type === utils_1.AST_NODE_TYPES.Identifier && + node.callee.name === callName); + } + function isLiteral(init, typeName) { + return (init.type === utils_1.AST_NODE_TYPES.Literal && typeof init.value === typeName); + } + function isIdentifier(init, ...names) { + return (init.type === utils_1.AST_NODE_TYPES.Identifier && names.includes(init.name)); + } + function hasUnaryPrefix(init, ...operators) { + return (init.type === utils_1.AST_NODE_TYPES.UnaryExpression && + operators.includes(init.operator)); + } + const keywordMap = { + [utils_1.AST_NODE_TYPES.TSBigIntKeyword]: 'bigint', + [utils_1.AST_NODE_TYPES.TSBooleanKeyword]: 'boolean', + [utils_1.AST_NODE_TYPES.TSNullKeyword]: 'null', + [utils_1.AST_NODE_TYPES.TSNumberKeyword]: 'number', + [utils_1.AST_NODE_TYPES.TSStringKeyword]: 'string', + [utils_1.AST_NODE_TYPES.TSSymbolKeyword]: 'symbol', + [utils_1.AST_NODE_TYPES.TSUndefinedKeyword]: 'undefined', + }; + /** + * Returns whether a node has an inferrable value or not + */ + function isInferrable(annotation, init) { + switch (annotation.type) { + case utils_1.AST_NODE_TYPES.TSBigIntKeyword: { + // note that bigint cannot have + prefixed to it + const unwrappedInit = hasUnaryPrefix(init, '-') + ? init.argument + : init; + return (isFunctionCall(unwrappedInit, 'BigInt') || + unwrappedInit.type === utils_1.AST_NODE_TYPES.Literal); + } + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + return (hasUnaryPrefix(init, '!') || + isFunctionCall(init, 'Boolean') || + isLiteral(init, 'boolean')); + case utils_1.AST_NODE_TYPES.TSNumberKeyword: { + const unwrappedInit = hasUnaryPrefix(init, '+', '-') + ? init.argument + : init; + return (isIdentifier(unwrappedInit, 'Infinity', 'NaN') || + isFunctionCall(unwrappedInit, 'Number') || + isLiteral(unwrappedInit, 'number')); + } + case utils_1.AST_NODE_TYPES.TSNullKeyword: + return init.type === utils_1.AST_NODE_TYPES.Literal && init.value == null; + case utils_1.AST_NODE_TYPES.TSStringKeyword: + return (isFunctionCall(init, 'String') || + isLiteral(init, 'string') || + init.type === utils_1.AST_NODE_TYPES.TemplateLiteral); + case utils_1.AST_NODE_TYPES.TSSymbolKeyword: + return isFunctionCall(init, 'Symbol'); + case utils_1.AST_NODE_TYPES.TSTypeReference: { + if (annotation.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + annotation.typeName.name === 'RegExp') { + const isRegExpLiteral = init.type === utils_1.AST_NODE_TYPES.Literal && + init.value instanceof RegExp; + const isRegExpNewCall = init.type === utils_1.AST_NODE_TYPES.NewExpression && + init.callee.type === utils_1.AST_NODE_TYPES.Identifier && + init.callee.name === 'RegExp'; + const isRegExpCall = isFunctionCall(init, 'RegExp'); + return isRegExpLiteral || isRegExpCall || isRegExpNewCall; + } + return false; + } + case utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + return (hasUnaryPrefix(init, 'void') || isIdentifier(init, 'undefined')); + } + return false; + } + /** + * Reports an inferrable type declaration, if any + */ + function reportInferrableType(node, typeNode, initNode) { + if (!typeNode || !initNode) { + return; + } + if (!isInferrable(typeNode.typeAnnotation, initNode)) { + return; + } + const type = typeNode.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference + ? // TODO - if we add more references + 'RegExp' + : keywordMap[typeNode.typeAnnotation.type]; + context.report({ + node, + messageId: 'noInferrableType', + data: { + type, + }, + *fix(fixer) { + if ((node.type === utils_1.AST_NODE_TYPES.AssignmentPattern && + node.left.optional) || + (node.type === utils_1.AST_NODE_TYPES.PropertyDefinition && node.definite)) { + yield fixer.remove((0, util_1.nullThrows)(context.sourceCode.getTokenBefore(typeNode), util_1.NullThrowsReasons.MissingToken('token before', 'type node'))); + } + yield fixer.remove(typeNode); + }, + }); + } + function inferrableVariableVisitor(node) { + reportInferrableType(node, node.id.typeAnnotation, node.init); + } + function inferrableParameterVisitor(node) { + if (ignoreParameters) { + return; + } + node.params.forEach(param => { + if (param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) { + param = param.parameter; + } + if (param.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + reportInferrableType(param, param.left.typeAnnotation, param.right); + } + }); + } + function inferrablePropertyVisitor(node) { + // We ignore `readonly` because of Microsoft/TypeScript#14416 + // Essentially a readonly property without a type + // will result in its value being the type, leading to + // compile errors if the type is stripped. + if (ignoreProperties || node.readonly || node.optional) { + return; + } + reportInferrableType(node, node.typeAnnotation, node.value); + } + return { + AccessorProperty: inferrablePropertyVisitor, + ArrowFunctionExpression: inferrableParameterVisitor, + FunctionDeclaration: inferrableParameterVisitor, + FunctionExpression: inferrableParameterVisitor, + PropertyDefinition: inferrablePropertyVisitor, + VariableDeclarator: inferrableVariableVisitor, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.d.ts.map new file mode 100644 index 0000000..846c882 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-invalid-this.d.ts","sourceRoot":"","sources":["../../src/rules/no-invalid-this.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;;yBA0Fu1R,SAAU,cAAc;EA1Fx0R,CAAC;AAEtD,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;AAItE,wBAkFG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js new file mode 100644 index 0000000..a3d80e7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-invalid-this'); +const defaultOptions = [{ capIsConstructor: true }]; +exports.default = (0, util_1.createRule)({ + name: 'no-invalid-this', + meta: { + type: 'suggestion', + defaultOptions, + docs: { + description: 'Disallow `this` keywords outside of classes or class-like objects', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions, + create(context) { + const rules = baseRule.create(context); + /** + * Since function definitions can be nested we use a stack storing if "this" is valid in the current context. + * + * Example: + * + * function a(this: number) { // valid "this" + * function b() { + * console.log(this); // invalid "this" + * } + * } + * + * When parsing the function declaration of "a" the stack will be: [true] + * When parsing the function declaration of "b" the stack will be: [true, false] + */ + const thisIsValidStack = []; + return { + ...rules, + AccessorProperty() { + thisIsValidStack.push(true); + }, + 'AccessorProperty:exit'() { + thisIsValidStack.pop(); + }, + FunctionDeclaration(node) { + thisIsValidStack.push(node.params.some(param => param.type === utils_1.AST_NODE_TYPES.Identifier && param.name === 'this')); + }, + 'FunctionDeclaration:exit'() { + thisIsValidStack.pop(); + }, + FunctionExpression(node) { + thisIsValidStack.push(node.params.some(param => param.type === utils_1.AST_NODE_TYPES.Identifier && param.name === 'this')); + }, + 'FunctionExpression:exit'() { + thisIsValidStack.pop(); + }, + PropertyDefinition() { + thisIsValidStack.push(true); + }, + 'PropertyDefinition:exit'() { + thisIsValidStack.pop(); + }, + ThisExpression(node) { + const thisIsValidHere = thisIsValidStack[thisIsValidStack.length - 1]; + if (thisIsValidHere) { + return; + } + // baseRule's work + rules.ThisExpression(node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.d.ts.map new file mode 100644 index 0000000..151bafc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-invalid-void-type.d.ts","sourceRoot":"","sources":["../../src/rules/no-invalid-void-type.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,OAAO;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,2BAA2B,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;CAC/D;AAED,MAAM,MAAM,UAAU,GAClB,uBAAuB,GACvB,sBAAsB,GACtB,+BAA+B,GAC/B,iCAAiC,GACjC,0CAA0C,GAC1C,6BAA6B,CAAC;;AAElC,wBA2OG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js new file mode 100644 index 0000000..ba54c51 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js @@ -0,0 +1,210 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-invalid-void-type', + meta: { + type: 'problem', + docs: { + description: 'Disallow `void` type outside of generic or return types', + recommended: 'strict', + }, + messages: { + invalidVoidForGeneric: '{{ generic }} may not have void as a type argument.', + invalidVoidNotReturn: 'void is only valid as a return type.', + invalidVoidNotReturnOrGeneric: 'void is only valid as a return type or generic type argument.', + invalidVoidNotReturnOrThisParam: 'void is only valid as return type or type of `this` parameter.', + invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type argument or the type of a `this` parameter.', + invalidVoidUnionConstituent: 'void is not valid as a constituent in a union type', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowAsThisParameter: { + type: 'boolean', + description: 'Whether a `this` parameter of a function may be `void`.', + }, + allowInGenericTypeArguments: { + description: 'Whether `void` can be used as a valid value for generic type parameters.', + oneOf: [ + { + type: 'boolean', + description: 'Whether `void` can be used as a valid value for all generic type parameters.', + }, + { + type: 'array', + description: 'Allowlist of types that may accept `void` as a generic type parameter.', + items: { type: 'string' }, + minItems: 1, + }, + ], + }, + }, + }, + ], + }, + defaultOptions: [ + { allowAsThisParameter: false, allowInGenericTypeArguments: true }, + ], + create(context, [{ allowAsThisParameter, allowInGenericTypeArguments }]) { + const validParents = [ + utils_1.AST_NODE_TYPES.TSTypeAnnotation, // + ]; + const invalidGrandParents = [ + utils_1.AST_NODE_TYPES.TSPropertySignature, + utils_1.AST_NODE_TYPES.CallExpression, + utils_1.AST_NODE_TYPES.PropertyDefinition, + utils_1.AST_NODE_TYPES.AccessorProperty, + utils_1.AST_NODE_TYPES.Identifier, + ]; + const validUnionMembers = [ + utils_1.AST_NODE_TYPES.TSVoidKeyword, + utils_1.AST_NODE_TYPES.TSNeverKeyword, + ]; + if (allowInGenericTypeArguments === true) { + validParents.push(utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation); + } + /** + * @brief check if the given void keyword is used as a valid generic type + * + * reports if the type parametrized by void is not in the allowlist, or + * allowInGenericTypeArguments is false. + * no-op if the given void keyword is not used as generic type + */ + function checkGenericTypeArgument(node) { + // only matches T<..., void, ...> + // extra check for precaution + /* istanbul ignore next */ + if (node.parent.type !== utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation || + node.parent.parent.type !== utils_1.AST_NODE_TYPES.TSTypeReference) { + return; + } + // check allowlist + if (Array.isArray(allowInGenericTypeArguments)) { + const fullyQualifiedName = context.sourceCode + .getText(node.parent.parent.typeName) + .replaceAll(' ', ''); + if (!allowInGenericTypeArguments + .map(s => s.replaceAll(' ', '')) + .includes(fullyQualifiedName)) { + context.report({ + node, + messageId: 'invalidVoidForGeneric', + data: { generic: fullyQualifiedName }, + }); + } + return; + } + if (!allowInGenericTypeArguments) { + context.report({ + node, + messageId: allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParam' + : 'invalidVoidNotReturn', + }); + } + } + /** + * @brief checks if the generic type parameter defaults to void + */ + function checkDefaultVoid(node, parentNode) { + if (parentNode.default !== node) { + context.report({ + node, + messageId: getNotReturnOrGenericMessageId(node), + }); + } + } + /** + * @brief checks that a union containing void is valid + * @return true if every member of the union is specified as a valid type in + * validUnionMembers, or is a valid generic type parametrized by void + */ + function isValidUnionType(node) { + return node.types.every(member => validUnionMembers.includes(member.type) || + // allows any T<..., void, ...> here, checked by checkGenericTypeArgument + (member.type === utils_1.AST_NODE_TYPES.TSTypeReference && + member.typeArguments?.type === + utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation && + member.typeArguments.params + .map(param => param.type) + .includes(utils_1.AST_NODE_TYPES.TSVoidKeyword))); + } + return { + TSVoidKeyword(node) { + // checks T<..., void, ...> against specification of allowInGenericArguments option + if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation && + node.parent.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference) { + checkGenericTypeArgument(node); + return; + } + // allow if allowInGenericTypeArguments is specified, and report if the generic type parameter extends void + if (allowInGenericTypeArguments && + node.parent.type === utils_1.AST_NODE_TYPES.TSTypeParameter && + node.parent.default?.type === utils_1.AST_NODE_TYPES.TSVoidKeyword) { + checkDefaultVoid(node, node.parent); + return; + } + // union w/ void must contain types from validUnionMembers, or a valid generic void type + if (node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType && + isValidUnionType(node.parent)) { + return; + } + // using `void` as part of the return type of function overloading implementation + if (node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType) { + const declaringFunction = getParentFunctionDeclarationNode(node.parent); + if (declaringFunction && + (0, util_1.hasOverloadSignatures)(declaringFunction, context)) { + return; + } + } + // this parameter is ok to be void. + if (allowAsThisParameter && + node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAnnotation && + node.parent.parent.type === utils_1.AST_NODE_TYPES.Identifier && + node.parent.parent.name === 'this') { + return; + } + // default cases + if (validParents.includes(node.parent.type) && + // https://github.com/typescript-eslint/typescript-eslint/issues/6225 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + !invalidGrandParents.includes(node.parent.parent.type)) { + return; + } + context.report({ + node, + messageId: allowInGenericTypeArguments && allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParamOrGeneric' + : allowInGenericTypeArguments + ? getNotReturnOrGenericMessageId(node) + : allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParam' + : 'invalidVoidNotReturn', + }); + }, + }; + }, +}); +function getNotReturnOrGenericMessageId(node) { + return node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType + ? 'invalidVoidUnionConstituent' + : 'invalidVoidNotReturnOrGeneric'; +} +function getParentFunctionDeclarationNode(node) { + let current = node.parent; + while (current) { + if (current.type === utils_1.AST_NODE_TYPES.FunctionDeclaration) { + return current; + } + if (current.type === utils_1.AST_NODE_TYPES.MethodDefinition && + current.value.body != null) { + return current; + } + current = current.parent; + } + return null; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.d.ts.map new file mode 100644 index 0000000..da1160e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-loop-func.d.ts","sourceRoot":"","sources":["../../src/rules/no-loop-func.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAInE,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;kCAgMoB,SAC1B,uBAAgB;8BACC,SAAU,mBAElC;6BAAuC,SAAU,kBAEnC;EAtMmC,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;AAEtE,wBA0OG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js new file mode 100644 index 0000000..29b8579 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js @@ -0,0 +1,187 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-loop-func'); +exports.default = (0, util_1.createRule)({ + name: 'no-loop-func', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Disallow function declarations that contain unsafe references inside loop statements', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: [], + }, + defaultOptions: [], + create(context) { + const SKIPPED_IIFE_NODES = new Set(); + /** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those. + * `Scope.through` contains references of nested functions. + * + * @param node An AST node to get. + * @returns The containing loop node of the specified node, or `null`. + */ + function getContainingLoopNode(node) { + for (let currentNode = node; currentNode.parent; currentNode = currentNode.parent) { + const parent = currentNode.parent; + switch (parent.type) { + case utils_1.AST_NODE_TYPES.WhileStatement: + case utils_1.AST_NODE_TYPES.DoWhileStatement: + return parent; + case utils_1.AST_NODE_TYPES.ForStatement: + // `init` is outside of the loop. + if (parent.init !== currentNode) { + return parent; + } + break; + case utils_1.AST_NODE_TYPES.ForInStatement: + case utils_1.AST_NODE_TYPES.ForOfStatement: + // `right` is outside of the loop. + if (parent.right !== currentNode) { + return parent; + } + break; + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + // We don't need to check nested functions. + // We need to check nested functions only in case of IIFE. + if (SKIPPED_IIFE_NODES.has(parent)) { + break; + } + return null; + default: + break; + } + } + return null; + } + /** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * @param node A node to get. This is a loop node. + * @param excludedNode A node that the result node should not include. + * @returns The most outer loop node. + */ + function getTopLoopNode(node, excludedNode) { + const border = excludedNode ? excludedNode.range[1] : 0; + let retv = node; + let containingLoopNode = node; + while (containingLoopNode && containingLoopNode.range[0] >= border) { + retv = containingLoopNode; + containingLoopNode = getContainingLoopNode(containingLoopNode); + } + return retv; + } + /** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * @param loopNode A containing loop node. + * @param reference A reference to check. + * @returns `true` if the reference is safe or not. + */ + function isSafe(loopNode, reference) { + const variable = reference.resolved; + const definition = variable?.defs[0]; + const declaration = definition?.parent; + const kind = declaration?.type === utils_1.AST_NODE_TYPES.VariableDeclaration + ? declaration.kind + : ''; + // type references are all safe + // this only really matters for global types that haven't been configured + if (reference.isTypeReference) { + return true; + } + // Variables which are declared by `const` is safe. + if (kind === 'const') { + return true; + } + /* + * Variables which are declared by `let` in the loop is safe. + * It's a different instance from the next loop step's. + */ + if (kind === 'let' && + declaration && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1]) { + return true; + } + /* + * WriteReferences which exist after this border are unsafe because those + * can modify the variable. + */ + const border = getTopLoopNode(loopNode, kind === 'let' ? declaration : null).range[0]; + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * + * @param upperRef A reference to check. + * @returns `true` if the reference is safe. + */ + function isSafeReference(upperRef) { + const id = upperRef.identifier; + return (!upperRef.isWrite() || + (variable?.scope.variableScope === upperRef.from.variableScope && + id.range[0] < border)); + } + return variable?.references.every(isSafeReference) ?? false; + } + /** + * Reports functions which match the following condition: + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * + * @param node The AST node to check. + */ + function checkForLoops(node) { + const loopNode = getContainingLoopNode(node); + if (!loopNode) { + return; + } + const references = context.sourceCode.getScope(node).through; + if (!(node.async || node.generator) && isIIFE(node)) { + const isFunctionExpression = node.type === utils_1.AST_NODE_TYPES.FunctionExpression; + // Check if the function is referenced elsewhere in the code + const isFunctionReferenced = isFunctionExpression && node.id + ? references.some(r => r.identifier.name === node.id?.name) + : false; + if (!isFunctionReferenced) { + SKIPPED_IIFE_NODES.add(node); + return; + } + } + const unsafeRefs = references + .filter(r => r.resolved && !isSafe(loopNode, r)) + .map(r => r.identifier.name); + if (unsafeRefs.length > 0) { + context.report({ + node, + messageId: 'unsafeRefs', + data: { varNames: `'${unsafeRefs.join("', '")}'` }, + }); + } + } + return { + ArrowFunctionExpression: checkForLoops, + FunctionDeclaration: checkForLoops, + FunctionExpression: checkForLoops, + }; + }, +}); +function isIIFE(node) { + return (node.parent.type === utils_1.AST_NODE_TYPES.CallExpression && + node.parent.callee === node); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.d.ts.map new file mode 100644 index 0000000..02b3bfc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-loss-of-precision.d.ts","sourceRoot":"","sources":["../../src/rules/no-loss-of-precision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,QAAA,MAAM,QAAQ,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAElD,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;AAC7E,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAClD,WAAW,CAAC,OAAO,QAAQ,CAAC,CAC7B,CAAC;;AAEF,wBAkBG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js new file mode 100644 index 0000000..31470d1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-loss-of-precision'); +exports.default = (0, util_1.createRule)({ + name: 'no-loss-of-precision', + meta: { + type: 'problem', + // defaultOptions, -- base rule does not use defaultOptions + deprecated: true, + docs: { + description: 'Disallow literal numbers that lose precision', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: [], + }, + defaultOptions: [], + create(context) { + return baseRule.create(context); + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.d.ts.map new file mode 100644 index 0000000..f9b0625 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-magic-numbers.d.ts","sourceRoot":"","sources":["../../src/rules/no-magic-numbers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;;;;;;;;;kBA+MQ,SAAU,OAAO;EA/Me,CAAC;AAEvD,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;;;;;;;;AA+BtE,wBA+FG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js new file mode 100644 index 0000000..911ab46 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js @@ -0,0 +1,247 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-magic-numbers'); +// Extend base schema with additional property to ignore TS numeric literal types +const schema = (0, util_1.deepMerge)( +// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- https://github.com/microsoft/TypeScript/issues/17002 +Array.isArray(baseRule.meta.schema) + ? baseRule.meta.schema[0] + : baseRule.meta.schema, { + properties: { + ignoreEnums: { + type: 'boolean', + description: 'Whether enums used in TypeScript are considered okay.', + }, + ignoreNumericLiteralTypes: { + type: 'boolean', + description: 'Whether numbers used in TypeScript numeric literal types are considered okay.', + }, + ignoreReadonlyClassProperties: { + type: 'boolean', + description: 'Whether `readonly` class properties are considered okay.', + }, + ignoreTypeIndexes: { + type: 'boolean', + description: 'Whether numbers used to index types are okay.', + }, + }, +}); +exports.default = (0, util_1.createRule)({ + name: 'no-magic-numbers', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Disallow magic numbers', + extendsBaseRule: true, + }, + messages: baseRule.meta.messages, + schema: [schema], + }, + defaultOptions: [ + { + detectObjects: false, + enforceConst: false, + ignore: [], + ignoreArrayIndexes: false, + ignoreEnums: false, + ignoreNumericLiteralTypes: false, + ignoreReadonlyClassProperties: false, + ignoreTypeIndexes: false, + }, + ], + create(context, [options]) { + const rules = baseRule.create(context); + const ignored = new Set((options.ignore ?? []).map(normalizeIgnoreValue)); + return { + Literal(node) { + // If it’s not a numeric literal we’re not interested + if (typeof node.value !== 'number' && typeof node.value !== 'bigint') { + return; + } + // This will be `true` if we’re configured to ignore this case (eg. it’s + // an enum and `ignoreEnums` is `true`). It will be `false` if we’re not + // configured to ignore this case. It will remain `undefined` if this is + // not one of our exception cases, and we’ll fall back to the base rule. + let isAllowed; + // Check if the node is ignored + if (ignored.has(normalizeLiteralValue(node, node.value))) { + isAllowed = true; + } + // Check if the node is a TypeScript enum declaration + else if (isParentTSEnumDeclaration(node)) { + isAllowed = options.ignoreEnums === true; + } + // Check TypeScript specific nodes for Numeric Literal + else if (isTSNumericLiteralType(node)) { + isAllowed = options.ignoreNumericLiteralTypes === true; + } + // Check if the node is a type index + else if (isAncestorTSIndexedAccessType(node)) { + isAllowed = options.ignoreTypeIndexes === true; + } + // Check if the node is a readonly class property + else if (isParentTSReadonlyPropertyDefinition(node)) { + isAllowed = options.ignoreReadonlyClassProperties === true; + } + // If we’ve hit a case where the ignore option is true we can return now + if (isAllowed === true) { + return; + } + // If the ignore option is *not* set we can report it now + if (isAllowed === false) { + let fullNumberNode = node; + let raw = node.raw; + if (node.parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + // the base rule only shows the operator for negative numbers + // https://github.com/eslint/eslint/blob/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d/lib/rules/no-magic-numbers.js#L126 + node.parent.operator === '-') { + fullNumberNode = node.parent; + raw = `${node.parent.operator}${node.raw}`; + } + context.report({ + node: fullNumberNode, + messageId: 'noMagic', + data: { raw }, + }); + return; + } + // Let the base rule deal with the rest + rules.Literal(node); + }, + }; + }, +}); +/** + * Convert the value to bigint if it's a string. Otherwise, return the value as-is. + * @param value The value to normalize. + * @returns The normalized value. + */ +function normalizeIgnoreValue(value) { + if (typeof value === 'string') { + return BigInt(value.slice(0, -1)); + } + return value; +} +/** + * Converts the node to its numeric value, handling prefixed numbers (-1 / +1) + * @param node the node to normalize. + * @param value the node's value. + */ +function normalizeLiteralValue(node, value) { + if (node.parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + ['-', '+'].includes(node.parent.operator) && + node.parent.operator === '-') { + return -value; + } + return value; +} +/** + * Gets the true parent of the literal, handling prefixed numbers (-1 / +1) + */ +function getLiteralParent(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + ['-', '+'].includes(node.parent.operator)) { + return node.parent.parent; + } + return node.parent; +} +/** + * Checks if the node grandparent is a Typescript type alias declaration + * @param node the node to be validated. + * @returns true if the node grandparent is a Typescript type alias declaration + * @private + */ +function isGrandparentTSTypeAliasDeclaration(node) { + return node.parent?.parent?.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration; +} +/** + * Checks if the node grandparent is a Typescript union type and its parent is a type alias declaration + * @param node the node to be validated. + * @returns true if the node grandparent is a Typescript union type and its parent is a type alias declaration + * @private + */ +function isGrandparentTSUnionType(node) { + if (node.parent?.parent?.type === utils_1.AST_NODE_TYPES.TSUnionType) { + return isGrandparentTSTypeAliasDeclaration(node.parent); + } + return false; +} +/** + * Checks if the node parent is a Typescript enum member + * @param node the node to be validated. + * @returns true if the node parent is a Typescript enum member + * @private + */ +function isParentTSEnumDeclaration(node) { + const parent = getLiteralParent(node); + return parent?.type === utils_1.AST_NODE_TYPES.TSEnumMember; +} +/** + * Checks if the node parent is a Typescript literal type + * @param node the node to be validated. + * @returns true if the node parent is a Typescript literal type + * @private + */ +function isParentTSLiteralType(node) { + return node.parent?.type === utils_1.AST_NODE_TYPES.TSLiteralType; +} +/** + * Checks if the node is a valid TypeScript numeric literal type. + * @param node the node to be validated. + * @returns true if the node is a TypeScript numeric literal type. + * @private + */ +function isTSNumericLiteralType(node) { + // For negative numbers, use the parent node + if (node.parent?.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.parent.operator === '-') { + node = node.parent; + } + // If the parent node is not a TSLiteralType, early return + if (!isParentTSLiteralType(node)) { + return false; + } + // If the grandparent is a TSTypeAliasDeclaration, ignore + if (isGrandparentTSTypeAliasDeclaration(node)) { + return true; + } + // If the grandparent is a TSUnionType and it's parent is a TSTypeAliasDeclaration, ignore + if (isGrandparentTSUnionType(node)) { + return true; + } + return false; +} +/** + * Checks if the node parent is a readonly class property + * @param node the node to be validated. + * @returns true if the node parent is a readonly class property + * @private + */ +function isParentTSReadonlyPropertyDefinition(node) { + const parent = getLiteralParent(node); + if (parent?.type === utils_1.AST_NODE_TYPES.PropertyDefinition && parent.readonly) { + return true; + } + return false; +} +/** + * Checks if the node is part of a type indexed access (eg. Foo[4]) + * @param node the node to be validated. + * @returns true if the node is part of an indexed access + * @private + */ +function isAncestorTSIndexedAccessType(node) { + // Handle unary expressions (eg. -4) + let ancestor = getLiteralParent(node); + // Go up another level while we’re part of a type union (eg. 1 | 2) or + // intersection (eg. 1 & 2) + while (ancestor?.parent?.type === utils_1.AST_NODE_TYPES.TSUnionType || + ancestor?.parent?.type === utils_1.AST_NODE_TYPES.TSIntersectionType) { + ancestor = ancestor.parent; + } + return ancestor?.parent?.type === utils_1.AST_NODE_TYPES.TSIndexedAccessType; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.d.ts.map new file mode 100644 index 0000000..e84ccff --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-meaningless-void-operator.d.ts","sourceRoot":"","sources":["../../src/rules/no-meaningless-void-operator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAQnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,UAAU,EAAE,OAAO,CAAC;KACrB;CACF,CAAC;;AAEF,wBA8EG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js new file mode 100644 index 0000000..be50b9e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js @@ -0,0 +1,104 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-meaningless-void-operator', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow the `void` operator except when used to discard a value', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + hasSuggestions: true, + messages: { + meaninglessVoidOperator: "void operator shouldn't be used on {{type}}; it should convey that a return value is being ignored", + removeVoid: "Remove 'void'", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + checkNever: { + type: 'boolean', + default: false, + description: 'Whether to suggest removing `void` when the argument has type `never`.', + }, + }, + }, + ], + }, + defaultOptions: [{ checkNever: false }], + create(context, [{ checkNever }]) { + const services = utils_1.ESLintUtils.getParserServices(context); + const checker = services.program.getTypeChecker(); + return { + 'UnaryExpression[operator="void"]'(node) { + const fix = (fixer) => { + return fixer.removeRange([ + context.sourceCode.getTokens(node)[0].range[0], + context.sourceCode.getTokens(node)[1].range[0], + ]); + }; + const argType = services.getTypeAtLocation(node.argument); + const unionParts = tsutils.unionTypeParts(argType); + if (unionParts.every(part => part.flags & (ts.TypeFlags.Void | ts.TypeFlags.Undefined))) { + context.report({ + node, + messageId: 'meaninglessVoidOperator', + data: { type: checker.typeToString(argType) }, + fix, + }); + } + else if (checkNever && + unionParts.every(part => part.flags & + (ts.TypeFlags.Void | ts.TypeFlags.Undefined | ts.TypeFlags.Never))) { + context.report({ + node, + messageId: 'meaninglessVoidOperator', + data: { type: checker.typeToString(argType) }, + suggest: [{ messageId: 'removeVoid', fix }], + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.d.ts.map new file mode 100644 index 0000000..e60e9b1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-misused-new.d.ts","sourceRoot":"","sources":["../../src/rules/no-misused-new.ts"],"names":[],"mappings":";AAMA,wBA2GG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js new file mode 100644 index 0000000..2cbc611 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-misused-new', + meta: { + type: 'problem', + docs: { + description: 'Enforce valid definition of `new` and `constructor`', + recommended: 'recommended', + }, + messages: { + errorMessageClass: 'Class cannot have method named `new`.', + errorMessageInterface: 'Interfaces cannot be constructed, only classes.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * @param node type to be inspected. + * @returns name of simple type or null + */ + function getTypeReferenceName(node) { + if (node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSTypeAnnotation: + return getTypeReferenceName(node.typeAnnotation); + case utils_1.AST_NODE_TYPES.TSTypeReference: + return getTypeReferenceName(node.typeName); + case utils_1.AST_NODE_TYPES.Identifier: + return node.name; + default: + break; + } + } + return null; + } + /** + * @param parent parent node. + * @param returnType type to be compared + */ + function isMatchingParentType(parent, returnType) { + if (parent && + (parent.type === utils_1.AST_NODE_TYPES.ClassDeclaration || + parent.type === utils_1.AST_NODE_TYPES.ClassExpression || + parent.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) && + parent.id) { + return getTypeReferenceName(returnType) === parent.id.name; + } + return false; + } + return { + "ClassBody > MethodDefinition[key.name='new']"(node) { + if (node.value.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression && + isMatchingParentType(node.parent.parent, node.value.returnType)) { + context.report({ + node, + messageId: 'errorMessageClass', + }); + } + }, + 'TSInterfaceBody > TSConstructSignatureDeclaration'(node) { + if (isMatchingParentType(node.parent.parent, node.returnType)) { + // constructor + context.report({ + node, + messageId: 'errorMessageInterface', + }); + } + }, + "TSMethodSignature[key.name='constructor']"(node) { + context.report({ + node, + messageId: 'errorMessageInterface', + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.d.ts.map new file mode 100644 index 0000000..12626e1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-misused-promises.d.ts","sourceRoot":"","sources":["../../src/rules/no-misused-promises.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAiBnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,gBAAgB,CAAC,EAAE,OAAO,GAAG,uBAAuB,CAAC;KACtD;CACF,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,WAAW,GACX,QAAQ,GACR,oBAAoB,GACpB,qBAAqB,GACrB,2BAA2B,GAC3B,oBAAoB,GACpB,uBAAuB,GACvB,oBAAoB,CAAC;;AAgCzB,wBAgmBG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js new file mode 100644 index 0000000..d7b5774 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js @@ -0,0 +1,753 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +function parseChecksVoidReturn(checksVoidReturn) { + switch (checksVoidReturn) { + case false: + return false; + case true: + case undefined: + return { + arguments: true, + attributes: true, + inheritedMethods: true, + properties: true, + returns: true, + variables: true, + }; + default: + return { + arguments: checksVoidReturn.arguments ?? true, + attributes: checksVoidReturn.attributes ?? true, + inheritedMethods: checksVoidReturn.inheritedMethods ?? true, + properties: checksVoidReturn.properties ?? true, + returns: checksVoidReturn.returns ?? true, + variables: checksVoidReturn.variables ?? true, + }; + } +} +exports.default = (0, util_1.createRule)({ + name: 'no-misused-promises', + meta: { + type: 'problem', + docs: { + description: 'Disallow Promises in places not designed to handle them', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + conditional: 'Expected non-Promise value in a boolean conditional.', + predicate: 'Expected a non-Promise value to be returned.', + spread: 'Expected a non-Promise value to be spreaded in an object.', + voidReturnArgument: 'Promise returned in function argument where a void return was expected.', + voidReturnAttribute: 'Promise-returning function provided to attribute where a void return was expected.', + voidReturnInheritedMethod: "Promise-returning method provided where a void return was expected by extended/implemented type '{{ heritageTypeName }}'.", + voidReturnProperty: 'Promise-returning function provided to property where a void return was expected.', + voidReturnReturnValue: 'Promise-returning function provided to return value where a void return was expected.', + voidReturnVariable: 'Promise-returning function provided to variable where a void return was expected.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + checksConditionals: { + type: 'boolean', + description: 'Whether to warn when a Promise is provided to conditional statements.', + }, + checksSpreads: { + type: 'boolean', + description: 'Whether to warn when `...` spreading a `Promise`.', + }, + checksVoidReturn: { + description: 'Whether to warn when a Promise is returned from a function typed as returning `void`.', + oneOf: [ + { + type: 'boolean', + description: 'Whether to disable checking all asynchronous functions.', + }, + { + type: 'object', + additionalProperties: false, + description: 'Which forms of functions may have checking disabled.', + properties: { + arguments: { + type: 'boolean', + description: 'Disables checking an asynchronous function passed as argument where the parameter type expects a function that returns `void`.', + }, + attributes: { + type: 'boolean', + description: 'Disables checking an asynchronous function passed as a JSX attribute expected to be a function that returns `void`.', + }, + inheritedMethods: { + type: 'boolean', + description: 'Disables checking an asynchronous method in a type that extends or implements another type expecting that method to return `void`.', + }, + properties: { + type: 'boolean', + description: 'Disables checking an asynchronous function passed as an object property expected to be a function that returns `void`.', + }, + returns: { + type: 'boolean', + description: 'Disables checking an asynchronous function returned in a function whose return type is a function that returns `void`.', + }, + variables: { + type: 'boolean', + description: 'Disables checking an asynchronous function used as a variable whose return type is a function that returns `void`.', + }, + }, + }, + ], + }, + }, + }, + ], + }, + defaultOptions: [ + { + checksConditionals: true, + checksSpreads: true, + checksVoidReturn: true, + }, + ], + create(context, [{ checksConditionals, checksSpreads, checksVoidReturn }]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const checkedNodes = new Set(); + const conditionalChecks = { + 'CallExpression > MemberExpression': checkArrayPredicates, + ConditionalExpression: checkTestConditional, + DoWhileStatement: checkTestConditional, + ForStatement: checkTestConditional, + IfStatement: checkTestConditional, + LogicalExpression: checkConditional, + 'UnaryExpression[operator="!"]'(node) { + checkConditional(node.argument, true); + }, + WhileStatement: checkTestConditional, + }; + checksVoidReturn = parseChecksVoidReturn(checksVoidReturn); + const voidReturnChecks = checksVoidReturn + ? { + ...(checksVoidReturn.arguments && { + CallExpression: checkArguments, + NewExpression: checkArguments, + }), + ...(checksVoidReturn.attributes && { + JSXAttribute: checkJSXAttribute, + }), + ...(checksVoidReturn.inheritedMethods && { + ClassDeclaration: checkClassLikeOrInterfaceNode, + ClassExpression: checkClassLikeOrInterfaceNode, + TSInterfaceDeclaration: checkClassLikeOrInterfaceNode, + }), + ...(checksVoidReturn.properties && { + Property: checkProperty, + }), + ...(checksVoidReturn.returns && { + ReturnStatement: checkReturnStatement, + }), + ...(checksVoidReturn.variables && { + AssignmentExpression: checkAssignment, + VariableDeclarator: checkVariableDeclaration, + }), + } + : {}; + const spreadChecks = { + SpreadElement: checkSpread, + }; + /** + * A syntactic check to see if an annotated type is maybe a function type. + * This is a perf optimization to help avoid requesting types where possible + */ + function isPossiblyFunctionType(node) { + switch (node.typeAnnotation.type) { + case utils_1.AST_NODE_TYPES.TSConditionalType: + case utils_1.AST_NODE_TYPES.TSConstructorType: + case utils_1.AST_NODE_TYPES.TSFunctionType: + case utils_1.AST_NODE_TYPES.TSImportType: + case utils_1.AST_NODE_TYPES.TSIndexedAccessType: + case utils_1.AST_NODE_TYPES.TSInferType: + case utils_1.AST_NODE_TYPES.TSIntersectionType: + case utils_1.AST_NODE_TYPES.TSQualifiedName: + case utils_1.AST_NODE_TYPES.TSThisType: + case utils_1.AST_NODE_TYPES.TSTypeOperator: + case utils_1.AST_NODE_TYPES.TSTypeQuery: + case utils_1.AST_NODE_TYPES.TSTypeReference: + case utils_1.AST_NODE_TYPES.TSUnionType: + return true; + case utils_1.AST_NODE_TYPES.TSTypeLiteral: + return node.typeAnnotation.members.some(member => member.type === utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration || + member.type === utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration); + case utils_1.AST_NODE_TYPES.TSAbstractKeyword: + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + case utils_1.AST_NODE_TYPES.TSArrayType: + case utils_1.AST_NODE_TYPES.TSAsyncKeyword: + case utils_1.AST_NODE_TYPES.TSBigIntKeyword: + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + case utils_1.AST_NODE_TYPES.TSDeclareKeyword: + case utils_1.AST_NODE_TYPES.TSExportKeyword: + case utils_1.AST_NODE_TYPES.TSIntrinsicKeyword: + case utils_1.AST_NODE_TYPES.TSLiteralType: + case utils_1.AST_NODE_TYPES.TSMappedType: + case utils_1.AST_NODE_TYPES.TSNamedTupleMember: + case utils_1.AST_NODE_TYPES.TSNeverKeyword: + case utils_1.AST_NODE_TYPES.TSNullKeyword: + case utils_1.AST_NODE_TYPES.TSNumberKeyword: + case utils_1.AST_NODE_TYPES.TSObjectKeyword: + case utils_1.AST_NODE_TYPES.TSOptionalType: + case utils_1.AST_NODE_TYPES.TSPrivateKeyword: + case utils_1.AST_NODE_TYPES.TSProtectedKeyword: + case utils_1.AST_NODE_TYPES.TSPublicKeyword: + case utils_1.AST_NODE_TYPES.TSReadonlyKeyword: + case utils_1.AST_NODE_TYPES.TSRestType: + case utils_1.AST_NODE_TYPES.TSStaticKeyword: + case utils_1.AST_NODE_TYPES.TSStringKeyword: + case utils_1.AST_NODE_TYPES.TSSymbolKeyword: + case utils_1.AST_NODE_TYPES.TSTemplateLiteralType: + case utils_1.AST_NODE_TYPES.TSTupleType: + case utils_1.AST_NODE_TYPES.TSTypePredicate: + case utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + case utils_1.AST_NODE_TYPES.TSVoidKeyword: + return false; + } + } + function checkTestConditional(node) { + if (node.test) { + checkConditional(node.test, true); + } + } + /** + * This function analyzes the type of a node and checks if it is a Promise in a boolean conditional. + * It uses recursion when checking nested logical operators. + * @param node The AST node to check. + * @param isTestExpr Whether the node is a descendant of a test expression. + */ + function checkConditional(node, isTestExpr = false) { + // prevent checking the same node multiple times + if (checkedNodes.has(node)) { + return; + } + checkedNodes.add(node); + if (node.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + // ignore the left operand for nullish coalescing expressions not in a context of a test expression + if (node.operator !== '??' || isTestExpr) { + checkConditional(node.left, isTestExpr); + } + // we ignore the right operand when not in a context of a test expression + if (isTestExpr) { + checkConditional(node.right, isTestExpr); + } + return; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (isAlwaysThenable(checker, tsNode)) { + context.report({ + node, + messageId: 'conditional', + }); + } + } + function checkArrayPredicates(node) { + const parent = node.parent; + if (parent.type === utils_1.AST_NODE_TYPES.CallExpression) { + const callback = parent.arguments.at(0); + if (callback && + (0, util_1.isArrayMethodCallWithPredicate)(context, services, parent)) { + const type = services.esTreeNodeToTSNodeMap.get(callback); + if (returnsThenable(checker, type)) { + context.report({ + node: callback, + messageId: 'predicate', + }); + } + } + } + } + function checkArguments(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const voidArgs = voidFunctionArguments(checker, tsNode); + if (voidArgs.size === 0) { + return; + } + for (const [index, argument] of node.arguments.entries()) { + if (!voidArgs.has(index)) { + continue; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(argument); + if (returnsThenable(checker, tsNode)) { + context.report({ + node: argument, + messageId: 'voidReturnArgument', + }); + } + } + } + function checkAssignment(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const varType = services.getTypeAtLocation(node.left); + if (!isVoidReturningFunctionType(checker, tsNode.left, varType)) { + return; + } + if (returnsThenable(checker, tsNode.right)) { + context.report({ + node: node.right, + messageId: 'voidReturnVariable', + }); + } + } + function checkVariableDeclaration(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (tsNode.initializer == null || + node.init == null || + node.id.typeAnnotation == null) { + return; + } + // syntactically ignore some known-good cases to avoid touching type info + if (!isPossiblyFunctionType(node.id.typeAnnotation)) { + return; + } + const varType = services.getTypeAtLocation(node.id); + if (!isVoidReturningFunctionType(checker, tsNode.initializer, varType)) { + return; + } + if (returnsThenable(checker, tsNode.initializer)) { + context.report({ + node: node.init, + messageId: 'voidReturnVariable', + }); + } + } + function checkProperty(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (ts.isPropertyAssignment(tsNode)) { + const contextualType = checker.getContextualType(tsNode.initializer); + if (contextualType != null && + isVoidReturningFunctionType(checker, tsNode.initializer, contextualType) && + returnsThenable(checker, tsNode.initializer)) { + if ((0, util_1.isFunction)(node.value)) { + const functionNode = node.value; + if (functionNode.returnType) { + context.report({ + node: functionNode.returnType.typeAnnotation, + messageId: 'voidReturnProperty', + }); + } + else { + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(functionNode, context.sourceCode), + messageId: 'voidReturnProperty', + }); + } + } + else { + context.report({ + node: node.value, + messageId: 'voidReturnProperty', + }); + } + } + } + else if (ts.isShorthandPropertyAssignment(tsNode)) { + const contextualType = checker.getContextualType(tsNode.name); + if (contextualType != null && + isVoidReturningFunctionType(checker, tsNode.name, contextualType) && + returnsThenable(checker, tsNode.name)) { + context.report({ + node: node.value, + messageId: 'voidReturnProperty', + }); + } + } + else if (ts.isMethodDeclaration(tsNode)) { + if (ts.isComputedPropertyName(tsNode.name)) { + return; + } + const obj = tsNode.parent; + // Below condition isn't satisfied unless something goes wrong, + // but is needed for type checking. + // 'node' does not include class method declaration so 'obj' is + // always an object literal expression, but after converting 'node' + // to TypeScript AST, its type includes MethodDeclaration which + // does include the case of class method declaration. + if (!ts.isObjectLiteralExpression(obj)) { + return; + } + if (!returnsThenable(checker, tsNode)) { + return; + } + const objType = checker.getContextualType(obj); + if (objType == null) { + return; + } + const propertySymbol = checker.getPropertyOfType(objType, tsNode.name.text); + if (propertySymbol == null) { + return; + } + const contextualType = checker.getTypeOfSymbolAtLocation(propertySymbol, tsNode.name); + if (isVoidReturningFunctionType(checker, tsNode.name, contextualType)) { + const functionNode = node.value; + if (functionNode.returnType) { + context.report({ + node: functionNode.returnType.typeAnnotation, + messageId: 'voidReturnProperty', + }); + } + else { + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(functionNode, context.sourceCode), + messageId: 'voidReturnProperty', + }); + } + } + return; + } + } + function checkReturnStatement(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (tsNode.expression == null || node.argument == null) { + return; + } + // syntactically ignore some known-good cases to avoid touching type info + const functionNode = (() => { + let current = node.parent; + while (current && !(0, util_1.isFunction)(current)) { + current = current.parent; + } + return (0, util_1.nullThrows)(current, util_1.NullThrowsReasons.MissingParent); + })(); + if (functionNode.returnType && + !isPossiblyFunctionType(functionNode.returnType)) { + return; + } + const contextualType = checker.getContextualType(tsNode.expression); + if (contextualType != null && + isVoidReturningFunctionType(checker, tsNode.expression, contextualType) && + returnsThenable(checker, tsNode.expression)) { + context.report({ + node: node.argument, + messageId: 'voidReturnReturnValue', + }); + } + } + function checkClassLikeOrInterfaceNode(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const heritageTypes = getHeritageTypes(checker, tsNode); + if (!heritageTypes?.length) { + return; + } + for (const nodeMember of tsNode.members) { + const memberName = nodeMember.name?.getText(); + if (memberName == null) { + // Call/construct/index signatures don't have names. TS allows call signatures to mismatch, + // and construct signatures can't be async. + // TODO - Once we're able to use `checker.isTypeAssignableTo` (v8), we can check an index + // signature here against its compatible index signatures in `heritageTypes` + continue; + } + if (!returnsThenable(checker, nodeMember)) { + continue; + } + const node = services.tsNodeToESTreeNodeMap.get(nodeMember); + if (isStaticMember(node)) { + continue; + } + for (const heritageType of heritageTypes) { + checkHeritageTypeForMemberReturningVoid(nodeMember, heritageType, memberName); + } + } + } + /** + * Checks `heritageType` for a member named `memberName` that returns void; reports the + * 'voidReturnInheritedMethod' message if found. + * @param nodeMember Node member that returns a Promise + * @param heritageType Heritage type to check against + * @param memberName Name of the member to check for + */ + function checkHeritageTypeForMemberReturningVoid(nodeMember, heritageType, memberName) { + const heritageMember = getMemberIfExists(heritageType, memberName); + if (heritageMember == null) { + return; + } + const memberType = checker.getTypeOfSymbolAtLocation(heritageMember, nodeMember); + if (!isVoidReturningFunctionType(checker, nodeMember, memberType)) { + return; + } + context.report({ + node: services.tsNodeToESTreeNodeMap.get(nodeMember), + messageId: 'voidReturnInheritedMethod', + data: { heritageTypeName: checker.typeToString(heritageType) }, + }); + } + function checkJSXAttribute(node) { + if (node.value == null || + node.value.type !== utils_1.AST_NODE_TYPES.JSXExpressionContainer) { + return; + } + const expressionContainer = services.esTreeNodeToTSNodeMap.get(node.value); + const expression = services.esTreeNodeToTSNodeMap.get(node.value.expression); + const contextualType = checker.getContextualType(expressionContainer); + if (contextualType != null && + isVoidReturningFunctionType(checker, expressionContainer, contextualType) && + returnsThenable(checker, expression)) { + context.report({ + node: node.value, + messageId: 'voidReturnAttribute', + }); + } + } + function checkSpread(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (isSometimesThenable(checker, tsNode.expression)) { + context.report({ + node: node.argument, + messageId: 'spread', + }); + } + } + return { + ...(checksConditionals ? conditionalChecks : {}), + ...(checksVoidReturn ? voidReturnChecks : {}), + ...(checksSpreads ? spreadChecks : {}), + }; + }, +}); +function isSometimesThenable(checker, node) { + const type = checker.getTypeAtLocation(node); + for (const subType of tsutils.unionTypeParts(checker.getApparentType(type))) { + if (tsutils.isThenableType(checker, node, subType)) { + return true; + } + } + return false; +} +// Variation on the thenable check which requires all forms of the type (read: +// alternates in a union) to be thenable. Otherwise, you might be trying to +// check if something is defined or undefined and get caught because one of the +// branches is thenable. +function isAlwaysThenable(checker, node) { + const type = checker.getTypeAtLocation(node); + for (const subType of tsutils.unionTypeParts(checker.getApparentType(type))) { + const thenProp = subType.getProperty('then'); + // If one of the alternates has no then property, it is not thenable in all + // cases. + if (thenProp == null) { + return false; + } + // We walk through each variation of the then property. Since we know it + // exists at this point, we just need at least one of the alternates to + // be of the right form to consider it thenable. + const thenType = checker.getTypeOfSymbolAtLocation(thenProp, node); + let hasThenableSignature = false; + for (const subType of tsutils.unionTypeParts(thenType)) { + for (const signature of subType.getCallSignatures()) { + if (signature.parameters.length !== 0 && + isFunctionParam(checker, signature.parameters[0], node)) { + hasThenableSignature = true; + break; + } + } + // We only need to find one variant of the then property that has a + // function signature for it to be thenable. + if (hasThenableSignature) { + break; + } + } + // If no flavors of the then property are thenable, we don't consider the + // overall type to be thenable + if (!hasThenableSignature) { + return false; + } + } + // If all variants are considered thenable (i.e. haven't returned false), we + // consider the overall type thenable + return true; +} +function isFunctionParam(checker, param, node) { + const type = checker.getApparentType(checker.getTypeOfSymbolAtLocation(param, node)); + for (const subType of tsutils.unionTypeParts(type)) { + if (subType.getCallSignatures().length !== 0) { + return true; + } + } + return false; +} +function checkThenableOrVoidArgument(checker, node, type, index, thenableReturnIndices, voidReturnIndices) { + if (isThenableReturningFunctionType(checker, node.expression, type)) { + thenableReturnIndices.add(index); + } + else if (isVoidReturningFunctionType(checker, node.expression, type) && + // If a certain argument accepts both thenable and void returns, + // a promise-returning function is valid + !thenableReturnIndices.has(index)) { + voidReturnIndices.add(index); + } + const contextualType = checker.getContextualTypeForArgumentAtIndex(node, index); + if (contextualType !== type) { + checkThenableOrVoidArgument(checker, node, contextualType, index, thenableReturnIndices, voidReturnIndices); + } +} +// Get the positions of arguments which are void functions (and not also +// thenable functions). These are the candidates for the void-return check at +// the current call site. +// If the function parameters end with a 'rest' parameter, then we consider +// the array type parameter (e.g. '...args:Array') when determining +// if trailing arguments are candidates. +function voidFunctionArguments(checker, node) { + // 'new' can be used without any arguments, as in 'let b = new Object;' + // In this case, there are no argument positions to check, so return early. + if (!node.arguments) { + return new Set(); + } + const thenableReturnIndices = new Set(); + const voidReturnIndices = new Set(); + const type = checker.getTypeAtLocation(node.expression); + // We can't use checker.getResolvedSignature because it prefers an early '() => void' over a later '() => Promise' + // See https://github.com/microsoft/TypeScript/issues/48077 + for (const subType of tsutils.unionTypeParts(type)) { + // Standard function calls and `new` have two different types of signatures + const signatures = ts.isCallExpression(node) + ? subType.getCallSignatures() + : subType.getConstructSignatures(); + for (const signature of signatures) { + for (const [index, parameter] of signature.parameters.entries()) { + const decl = parameter.valueDeclaration; + let type = checker.getTypeOfSymbolAtLocation(parameter, node.expression); + // If this is a array 'rest' parameter, check all of the argument indices + // from the current argument to the end. + if (decl && (0, util_1.isRestParameterDeclaration)(decl)) { + if (checker.isArrayType(type)) { + // Unwrap 'Array' to 'MaybeVoidFunction', + // so that we'll handle it in the same way as a non-rest + // 'param: MaybeVoidFunction' + type = checker.getTypeArguments(type)[0]; + for (let i = index; i < node.arguments.length; i++) { + checkThenableOrVoidArgument(checker, node, type, i, thenableReturnIndices, voidReturnIndices); + } + } + else if (checker.isTupleType(type)) { + // Check each type in the tuple - for example, [boolean, () => void] would + // add the index of the second tuple parameter to 'voidReturnIndices' + const typeArgs = checker.getTypeArguments(type); + for (let i = index; i < node.arguments.length && i - index < typeArgs.length; i++) { + checkThenableOrVoidArgument(checker, node, typeArgs[i - index], i, thenableReturnIndices, voidReturnIndices); + } + } + } + else { + checkThenableOrVoidArgument(checker, node, type, index, thenableReturnIndices, voidReturnIndices); + } + } + } + } + for (const index of thenableReturnIndices) { + voidReturnIndices.delete(index); + } + return voidReturnIndices; +} +/** + * @returns Whether any call signature of the type has a thenable return type. + */ +function anySignatureIsThenableType(checker, node, type) { + for (const signature of type.getCallSignatures()) { + const returnType = signature.getReturnType(); + if (tsutils.isThenableType(checker, node, returnType)) { + return true; + } + } + return false; +} +/** + * @returns Whether type is a thenable-returning function. + */ +function isThenableReturningFunctionType(checker, node, type) { + for (const subType of tsutils.unionTypeParts(type)) { + if (anySignatureIsThenableType(checker, node, subType)) { + return true; + } + } + return false; +} +/** + * @returns Whether type is a void-returning function. + */ +function isVoidReturningFunctionType(checker, node, type) { + let hadVoidReturn = false; + for (const subType of tsutils.unionTypeParts(type)) { + for (const signature of subType.getCallSignatures()) { + const returnType = signature.getReturnType(); + // If a certain positional argument accepts both thenable and void returns, + // a promise-returning function is valid + if (tsutils.isThenableType(checker, node, returnType)) { + return false; + } + hadVoidReturn ||= tsutils.isTypeFlagSet(returnType, ts.TypeFlags.Void); + } + } + return hadVoidReturn; +} +/** + * @returns Whether expression is a function that returns a thenable. + */ +function returnsThenable(checker, node) { + const type = checker.getApparentType(checker.getTypeAtLocation(node)); + return tsutils + .unionTypeParts(type) + .some(t => anySignatureIsThenableType(checker, node, t)); +} +function getHeritageTypes(checker, tsNode) { + return tsNode.heritageClauses + ?.flatMap(clause => clause.types) + .map(typeExpression => checker.getTypeAtLocation(typeExpression)); +} +/** + * @returns The member with the given name in `type`, if it exists. + */ +function getMemberIfExists(type, memberName) { + const escapedMemberName = ts.escapeLeadingUnderscores(memberName); + const symbolMemberMatch = type.getSymbol()?.members?.get(escapedMemberName); + return (symbolMemberMatch ?? tsutils.getPropertyOfType(type, escapedMemberName)); +} +function isStaticMember(node) { + return ((node.type === utils_1.AST_NODE_TYPES.MethodDefinition || + node.type === utils_1.AST_NODE_TYPES.PropertyDefinition || + node.type === utils_1.AST_NODE_TYPES.AccessorProperty) && + node.static); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.d.ts.map new file mode 100644 index 0000000..f930c59 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-misused-spread.d.ts","sourceRoot":"","sources":["../../src/rules/no-misused-spread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAMnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAepD,KAAK,OAAO,GAAG;IACb;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;KAChC;CACF,CAAC;AAEF,KAAK,UAAU,GACX,UAAU,GACV,uBAAuB,GACvB,kCAAkC,GAClC,+BAA+B,GAC/B,0BAA0B,GAC1B,0BAA0B,GAC1B,qBAAqB,GACrB,yBAAyB,GACzB,gBAAgB,GAChB,0BAA0B,CAAC;;AAE/B,wBA2NG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.js new file mode 100644 index 0000000..4fda956 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.js @@ -0,0 +1,260 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-misused-spread', + meta: { + type: 'problem', + docs: { + description: 'Disallow using the spread operator when it might cause unexpected behavior', + recommended: 'strict', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + addAwait: 'Add await operator.', + noArraySpreadInObject: 'Using the spread operator on an array in an object will result in a list of indices.', + noClassDeclarationSpreadInObject: 'Using the spread operator on class declarations will spread only their static properties, and will lose their class prototype.', + noClassInstanceSpreadInObject: 'Using the spread operator on class instances will lose their class prototype.', + noFunctionSpreadInObject: 'Using the spread operator on a function without additional properties can cause unexpected behavior. Did you forget to call the function?', + noIterableSpreadInObject: 'Using the spread operator on an Iterable in an object can cause unexpected behavior.', + noMapSpreadInObject: 'Using the spread operator on a Map in an object will result in an empty object. Did you mean to use `Object.fromEntries(map)` instead?', + noPromiseSpreadInObject: 'Using the spread operator on Promise in an object can cause unexpected behavior. Did you forget to await the promise?', + noStringSpread: [ + 'Using the spread operator on a string can mishandle special characters, as can `.split("")`.', + '- `...` produces Unicode code points, which will decompose complex emojis into individual emojis', + '- .split("") produces UTF-16 code units, which breaks rich characters in many languages', + 'Consider using `Intl.Segmenter` for locale-aware string decomposition.', + "Otherwise, if you don't need to preserve emojis or other non-Ascii characters, disable this lint rule on this line or configure the 'allow' rule option.", + ].join('\n'), + replaceMapSpreadInObject: 'Replace map spread in object with `Object.fromEntries()`', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + ...util_1.readonlynessOptionsSchema.properties.allow, + description: 'An array of type specifiers that are known to be safe to spread.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function checkArrayOrCallSpread(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node.argument); + if (!(0, util_1.typeMatchesSomeSpecifier)(type, options.allow, services.program) && + isString(type)) { + context.report({ + node, + messageId: 'noStringSpread', + }); + } + } + function getMapSpreadSuggestions(node, type) { + const types = tsutils.unionTypeParts(type); + if (types.some(t => !isMap(services.program, t))) { + return null; + } + if (node.parent.type === utils_1.AST_NODE_TYPES.ObjectExpression && + node.parent.properties.length === 1) { + return [ + { + messageId: 'replaceMapSpreadInObject', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node.argument, + sourceCode: context.sourceCode, + wrap: code => `Object.fromEntries(${code})`, + }), + }, + ]; + } + return [ + { + messageId: 'replaceMapSpreadInObject', + fix: (0, util_1.getWrappingFixer)({ + node: node.argument, + sourceCode: context.sourceCode, + wrap: code => `Object.fromEntries(${code})`, + }), + }, + ]; + } + function getPromiseSpreadSuggestions(node) { + const isHighPrecendence = (0, util_1.isHigherPrecedenceThanAwait)(services.esTreeNodeToTSNodeMap.get(node)); + return [ + { + messageId: 'addAwait', + fix: fixer => isHighPrecendence + ? fixer.insertTextBefore(node, 'await ') + : [ + fixer.insertTextBefore(node, 'await ('), + fixer.insertTextAfter(node, ')'), + ], + }, + ]; + } + function checkObjectSpread(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node.argument); + if ((0, util_1.typeMatchesSomeSpecifier)(type, options.allow, services.program)) { + return; + } + if (isPromise(services.program, type)) { + context.report({ + node, + messageId: 'noPromiseSpreadInObject', + suggest: getPromiseSpreadSuggestions(node.argument), + }); + return; + } + if (isFunctionWithoutProps(type)) { + context.report({ + node, + messageId: 'noFunctionSpreadInObject', + }); + return; + } + if (isMap(services.program, type)) { + context.report({ + node, + messageId: 'noMapSpreadInObject', + suggest: getMapSpreadSuggestions(node, type), + }); + return; + } + if (isArray(checker, type)) { + context.report({ + node, + messageId: 'noArraySpreadInObject', + }); + return; + } + if (isIterable(type, checker) && + // Don't report when the type is string, since TS will flag it already + !isString(type)) { + context.report({ + node, + messageId: 'noIterableSpreadInObject', + }); + return; + } + if (isClassInstance(checker, type)) { + context.report({ + node, + messageId: 'noClassInstanceSpreadInObject', + }); + return; + } + if (isClassDeclaration(type)) { + context.report({ + node, + messageId: 'noClassDeclarationSpreadInObject', + }); + } + } + return { + 'ArrayExpression > SpreadElement': checkArrayOrCallSpread, + 'CallExpression > SpreadElement': checkArrayOrCallSpread, + JSXSpreadAttribute: checkObjectSpread, + 'ObjectExpression > SpreadElement': checkObjectSpread, + }; + }, +}); +function isIterable(type, checker) { + return tsutils + .typeParts(type) + .some(t => !!tsutils.getWellKnownSymbolPropertyOfType(t, 'iterator', checker)); +} +function isArray(checker, type) { + return isTypeRecurser(type, t => checker.isArrayType(t) || checker.isTupleType(t)); +} +function isString(type) { + return isTypeRecurser(type, t => (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.StringLike)); +} +function isFunctionWithoutProps(type) { + return isTypeRecurser(type, t => t.getCallSignatures().length > 0 && t.getProperties().length === 0); +} +function isPromise(program, type) { + return isTypeRecurser(type, t => (0, util_1.isPromiseLike)(program, t)); +} +function isClassInstance(checker, type) { + return isTypeRecurser(type, t => { + // If the type itself has a construct signature, it's a class(-like) + if (t.getConstructSignatures().length) { + return false; + } + const symbol = t.getSymbol(); + // If the type's symbol has a construct signature, the type is an instance + return !!symbol + ?.getDeclarations() + ?.some(declaration => checker + .getTypeOfSymbolAtLocation(symbol, declaration) + .getConstructSignatures().length); + }); +} +function isClassDeclaration(type) { + return isTypeRecurser(type, t => { + if (tsutils.isObjectType(t) && + tsutils.isObjectFlagSet(t, ts.ObjectFlags.InstantiationExpressionType)) { + return true; + } + const kind = t.getSymbol()?.valueDeclaration?.kind; + return (kind === ts.SyntaxKind.ClassDeclaration || + kind === ts.SyntaxKind.ClassExpression); + }); +} +function isMap(program, type) { + return isTypeRecurser(type, t => (0, util_1.isBuiltinSymbolLike)(program, t, ['Map', 'ReadonlyMap', 'WeakMap'])); +} +function isTypeRecurser(type, predicate) { + if (type.isUnionOrIntersection()) { + return type.types.some(t => isTypeRecurser(t, predicate)); + } + return predicate(type); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.d.ts.map new file mode 100644 index 0000000..6b1c35a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-mixed-enums.d.ts","sourceRoot":"","sources":["../../src/rules/no-mixed-enums.ts"],"names":[],"mappings":";AAgBA,wBA4MG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.js new file mode 100644 index 0000000..91e064a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.js @@ -0,0 +1,200 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +var AllowedType; +(function (AllowedType) { + AllowedType[AllowedType["Number"] = 0] = "Number"; + AllowedType[AllowedType["String"] = 1] = "String"; + AllowedType[AllowedType["Unknown"] = 2] = "Unknown"; +})(AllowedType || (AllowedType = {})); +exports.default = (0, util_1.createRule)({ + name: 'no-mixed-enums', + meta: { + type: 'problem', + docs: { + description: 'Disallow enums from having both number and string members', + recommended: 'strict', + requiresTypeChecking: true, + }, + messages: { + mixed: `Mixing number and string enums can be confusing.`, + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const parserServices = (0, util_1.getParserServices)(context); + const typeChecker = parserServices.program.getTypeChecker(); + function collectNodeDefinitions(node) { + const { name } = node.id; + const found = { + imports: [], + previousSibling: undefined, + }; + let scope = context.sourceCode.getScope(node); + for (const definition of scope.upper?.set.get(name)?.defs ?? []) { + if (definition.node.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration && + definition.node.range[0] < node.range[0] && + definition.node.body.members.length > 0) { + found.previousSibling = definition.node; + break; + } + } + while (scope) { + scope.set.get(name)?.defs.forEach(definition => { + if (definition.type === scope_manager_1.DefinitionType.ImportBinding) { + found.imports.push(definition.node); + } + }); + scope = scope.upper; + } + return found; + } + function getAllowedTypeForNode(node) { + return tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(node), ts.TypeFlags.StringLike) + ? AllowedType.String + : AllowedType.Number; + } + function getTypeFromImported(imported) { + const type = typeChecker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(imported)); + const valueDeclaration = type.getSymbol()?.valueDeclaration; + if (!valueDeclaration || + !ts.isEnumDeclaration(valueDeclaration) || + valueDeclaration.members.length === 0) { + return undefined; + } + return getAllowedTypeForNode(valueDeclaration.members[0]); + } + function getMemberType(member) { + if (!member.initializer) { + return AllowedType.Number; + } + switch (member.initializer.type) { + case utils_1.AST_NODE_TYPES.Literal: + switch (typeof member.initializer.value) { + case 'number': + return AllowedType.Number; + case 'string': + return AllowedType.String; + default: + return AllowedType.Unknown; + } + case utils_1.AST_NODE_TYPES.TemplateLiteral: + return AllowedType.String; + default: + return getAllowedTypeForNode(parserServices.esTreeNodeToTSNodeMap.get(member.initializer)); + } + } + function getDesiredTypeForDefinition(node) { + const { imports, previousSibling } = collectNodeDefinitions(node); + // Case: Merged ambiently via module augmentation + // import { MyEnum } from 'other-module'; + // declare module 'other-module' { + // enum MyEnum { A } + // } + for (const imported of imports) { + const typeFromImported = getTypeFromImported(imported); + if (typeFromImported != null) { + return typeFromImported; + } + } + // Case: Multiple enum declarations in the same file + // enum MyEnum { A } + // enum MyEnum { B } + if (previousSibling) { + return getMemberType(previousSibling.body.members[0]); + } + // Case: Namespace declaration merging + // namespace MyNamespace { + // export enum MyEnum { A } + // } + // namespace MyNamespace { + // export enum MyEnum { B } + // } + if (node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration && + node.parent.parent.type === utils_1.AST_NODE_TYPES.TSModuleBlock) { + // https://github.com/typescript-eslint/typescript-eslint/issues/8352 + // TODO: We don't need to dip into the TypeScript type checker here! + // Merged namespaces must all exist in the same file. + // We could instead compare this file's nodes to find the merges. + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.id); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const declarations = typeChecker + .getSymbolAtLocation(tsNode) + .getDeclarations(); + const [{ initializer }] = declarations[0] + .members; + return initializer && + tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(initializer), ts.TypeFlags.StringLike) + ? AllowedType.String + : AllowedType.Number; + } + // Finally, we default to the type of the first enum member + return getMemberType(node.body.members[0]); + } + return { + TSEnumDeclaration(node) { + if (!node.body.members.length) { + return; + } + let desiredType = getDesiredTypeForDefinition(node); + if (desiredType === ts.TypeFlags.Unknown) { + return; + } + for (const member of node.body.members) { + const currentType = getMemberType(member); + if (currentType === AllowedType.Unknown) { + return; + } + if (currentType === AllowedType.Number) { + desiredType ??= currentType; + } + if (currentType !== desiredType) { + context.report({ + node: member.initializer ?? member, + messageId: 'mixed', + }); + return; + } + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.d.ts.map new file mode 100644 index 0000000..7a68074 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-namespace.d.ts","sourceRoot":"","sources":["../../src/rules/no-namespace.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,yBAAyB,CAAC;;AAEnD,wBAiEG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js new file mode 100644 index 0000000..c003513 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-namespace', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow TypeScript namespaces', + recommended: 'recommended', + }, + messages: { + moduleSyntaxIsPreferred: 'ES2015 module syntax is preferred over namespaces.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowDeclarations: { + type: 'boolean', + description: 'Whether to allow `declare` with custom TypeScript namespaces.', + }, + allowDefinitionFiles: { + type: 'boolean', + description: 'Whether to allow `declare` with custom TypeScript namespaces inside definition files.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowDeclarations: false, + allowDefinitionFiles: true, + }, + ], + create(context, [{ allowDeclarations, allowDefinitionFiles }]) { + function isDeclaration(node) { + if (node.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration && node.declare) { + return true; + } + return node.parent != null && isDeclaration(node.parent); + } + return { + "TSModuleDeclaration[global!=true][id.type!='Literal']"(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration || + (allowDefinitionFiles && (0, util_1.isDefinitionFile)(context.filename)) || + (allowDeclarations && isDeclaration(node))) { + return; + } + context.report({ + node, + messageId: 'moduleSyntaxIsPreferred', + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.d.ts.map new file mode 100644 index 0000000..301e9f9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-non-null-asserted-nullish-coalescing.d.ts","sourceRoot":"","sources":["../../src/rules/no-non-null-asserted-nullish-coalescing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;;AA+BzD,wBAmEG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.js new file mode 100644 index 0000000..c37f52f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +function hasAssignmentBeforeNode(variable, node) { + return (variable.references.some(ref => ref.isWrite() && ref.identifier.range[1] < node.range[1]) || + variable.defs.some(def => isDefinitionWithAssignment(def) && def.node.range[1] < node.range[1])); +} +function isDefinitionWithAssignment(definition) { + if (definition.type !== scope_manager_1.DefinitionType.Variable) { + return false; + } + const variableDeclarator = definition.node; + return variableDeclarator.definite || variableDeclarator.init != null; +} +exports.default = (0, util_1.createRule)({ + name: 'no-non-null-asserted-nullish-coalescing', + meta: { + type: 'problem', + docs: { + description: 'Disallow non-null assertions in the left operand of a nullish coalescing operator', + recommended: 'strict', + }, + hasSuggestions: true, + messages: { + noNonNullAssertedNullishCoalescing: 'The nullish coalescing operator is designed to handle undefined and null - using a non-null assertion is not needed.', + suggestRemovingNonNull: 'Remove the non-null assertion.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + 'LogicalExpression[operator = "??"] > TSNonNullExpression.left'(node) { + if (node.expression.type === utils_1.TSESTree.AST_NODE_TYPES.Identifier) { + const scope = context.sourceCode.getScope(node); + const identifier = node.expression; + const variable = utils_1.ASTUtils.findVariable(scope, identifier.name); + if (variable && !hasAssignmentBeforeNode(variable, node)) { + return; + } + } + context.report({ + node, + messageId: 'noNonNullAssertedNullishCoalescing', + /* + Use a suggestion instead of a fixer, because this can break type checks. + The resulting type of the nullish coalesce is only influenced by the right operand if the left operand can be `null` or `undefined`. + After removing the non-null assertion the type of the left operand might contain `null` or `undefined` and then the type of the right operand + might change the resulting type of the nullish coalesce. + See the following example: + + function test(x?: string): string { + const bar = x! ?? false; // type analysis reports `bar` has type `string` + // x ?? false; // type analysis reports `bar` has type `string | false` + return bar; + } + */ + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + const exclamationMark = (0, util_1.nullThrows)(context.sourceCode.getLastToken(node, utils_1.ASTUtils.isNonNullAssertionPunctuator), util_1.NullThrowsReasons.MissingToken('!', 'Non-null Assertion')); + return fixer.remove(exclamationMark); + }, + }, + ], + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.d.ts.map new file mode 100644 index 0000000..cc8343c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-non-null-asserted-optional-chain.d.ts","sourceRoot":"","sources":["../../src/rules/no-non-null-asserted-optional-chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAInE,wBAoEG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js new file mode 100644 index 0000000..58e41c1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-non-null-asserted-optional-chain', + meta: { + type: 'problem', + docs: { + description: 'Disallow non-null assertions after an optional chain expression', + recommended: 'recommended', + }, + hasSuggestions: true, + messages: { + noNonNullOptionalChain: 'Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong.', + suggestRemovingNonNull: 'You should remove the non-null assertion.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + // non-nulling a wrapped chain will scrub all nulls introduced by the chain + // (x?.y)! + // (x?.())! + 'TSNonNullExpression > ChainExpression'(node) { + // selector guarantees this assertion + const parent = node.parent; + context.report({ + node, + messageId: 'noNonNullOptionalChain', + // use a suggestion instead of a fixer, because this can obviously break type checks + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + return fixer.removeRange([ + parent.range[1] - 1, + parent.range[1], + ]); + }, + }, + ], + }); + }, + // non-nulling at the end of a chain will scrub all nulls introduced by the chain + // x?.y! + // x?.()! + 'ChainExpression > TSNonNullExpression'(node) { + context.report({ + node, + messageId: 'noNonNullOptionalChain', + // use a suggestion instead of a fixer, because this can obviously break type checks + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + return fixer.removeRange([node.range[1] - 1, node.range[1]]); + }, + }, + ], + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.d.ts.map new file mode 100644 index 0000000..a566871 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-non-null-assertion.d.ts","sourceRoot":"","sources":["../../src/rules/no-non-null-assertion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAWzD,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,sBAAsB,CAAC;;AAE9D,wBAuGG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js new file mode 100644 index 0000000..02c9fcb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-non-null-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallow non-null assertions using the `!` postfix operator', + recommended: 'strict', + }, + hasSuggestions: true, + messages: { + noNonNull: 'Forbidden non-null assertion.', + suggestOptionalChain: 'Consider using the optional chain operator `?.` instead. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + TSNonNullExpression(node) { + const suggest = []; + // it always exists in non-null assertion + const nonNullOperator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.expression, util_1.isNonNullAssertionPunctuator), util_1.NullThrowsReasons.MissingToken('!', 'expression')); + function replaceTokenWithOptional() { + return fixer => fixer.replaceText(nonNullOperator, '?.'); + } + function removeToken() { + return fixer => fixer.remove(nonNullOperator); + } + if (node.parent.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.parent.object === node) { + if (!node.parent.optional) { + if (node.parent.computed) { + // it is x![y]?.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix: replaceTokenWithOptional(), + }); + } + else { + // it is x!.y?.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix(fixer) { + // x!.y?.z + // ^ punctuator + const punctuator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(nonNullOperator), util_1.NullThrowsReasons.MissingToken('.', '!')); + return [ + fixer.remove(nonNullOperator), + fixer.insertTextBefore(punctuator, '?'), + ]; + }, + }); + } + } + else { + // it is x!?.[y].z or x!?.y.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix: removeToken(), + }); + } + } + else if (node.parent.type === utils_1.AST_NODE_TYPES.CallExpression && + node.parent.callee === node) { + if (!node.parent.optional) { + // it is x.y?.z!() + suggest.push({ + messageId: 'suggestOptionalChain', + fix: replaceTokenWithOptional(), + }); + } + else { + // it is x.y.z!?.() + suggest.push({ + messageId: 'suggestOptionalChain', + fix: removeToken(), + }); + } + } + context.report({ + node, + messageId: 'noNonNull', + suggest, + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.d.ts.map new file mode 100644 index 0000000..b9b802d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-redeclare.d.ts","sourceRoot":"","sources":["../../src/rules/no-redeclare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAOnE,MAAM,MAAM,UAAU,GAClB,YAAY,GACZ,qBAAqB,GACrB,oBAAoB,CAAC;AACzB,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC;CACF,CAAC;;AAEF,wBAyQG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js new file mode 100644 index 0000000..cf453c9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js @@ -0,0 +1,200 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-redeclare', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow variable redeclaration', + extendsBaseRule: true, + }, + messages: { + redeclared: "'{{id}}' is already defined.", + redeclaredAsBuiltin: "'{{id}}' is already defined as a built-in global variable.", + redeclaredBySyntax: "'{{id}}' is already defined by a variable declaration.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + builtinGlobals: { + type: 'boolean', + description: 'Whether to report shadowing of built-in global variables.', + }, + ignoreDeclarationMerge: { + type: 'boolean', + description: 'Whether to ignore declaration merges between certain TypeScript declaration types.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + builtinGlobals: true, + ignoreDeclarationMerge: true, + }, + ], + create(context, [options]) { + const CLASS_DECLARATION_MERGE_NODES = new Set([ + utils_1.AST_NODE_TYPES.ClassDeclaration, + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + ]); + const FUNCTION_DECLARATION_MERGE_NODES = new Set([ + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + ]); + const ENUM_DECLARATION_MERGE_NODES = new Set([ + utils_1.AST_NODE_TYPES.TSEnumDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + ]); + function* iterateDeclarations(variable) { + if (options.builtinGlobals && + 'eslintImplicitGlobalSetting' in variable && + (variable.eslintImplicitGlobalSetting === 'readonly' || + variable.eslintImplicitGlobalSetting === 'writable')) { + yield { type: 'builtin' }; + } + if ('eslintExplicitGlobalComments' in variable && + variable.eslintExplicitGlobalComments) { + for (const comment of variable.eslintExplicitGlobalComments) { + yield { + loc: (0, util_1.getNameLocationInGlobalDirectiveComment)(context.sourceCode, comment, variable.name), + node: comment, + type: 'comment', + }; + } + } + const identifiers = variable.identifiers + .map(id => ({ + identifier: id, + parent: id.parent, + })) + // ignore function declarations because TS will treat them as an overload + .filter(({ parent }) => parent.type !== utils_1.AST_NODE_TYPES.TSDeclareFunction); + if (options.ignoreDeclarationMerge && identifiers.length > 1) { + if ( + // interfaces merging + identifiers.every(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration)) { + return; + } + if ( + // namespace/module merging + identifiers.every(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration)) { + return; + } + if ( + // class + interface/namespace merging + identifiers.every(({ parent }) => CLASS_DECLARATION_MERGE_NODES.has(parent.type))) { + const classDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.ClassDeclaration); + if (classDecls.length === 1) { + // safe declaration merging + return; + } + // there's more than one class declaration, which needs to be reported + for (const { identifier } of classDecls) { + yield { loc: identifier.loc, node: identifier, type: 'syntax' }; + } + return; + } + if ( + // class + interface/namespace merging + identifiers.every(({ parent }) => FUNCTION_DECLARATION_MERGE_NODES.has(parent.type))) { + const functionDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.FunctionDeclaration); + if (functionDecls.length === 1) { + // safe declaration merging + return; + } + // there's more than one function declaration, which needs to be reported + for (const { identifier } of functionDecls) { + yield { loc: identifier.loc, node: identifier, type: 'syntax' }; + } + return; + } + if ( + // enum + namespace merging + identifiers.every(({ parent }) => ENUM_DECLARATION_MERGE_NODES.has(parent.type))) { + const enumDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration); + if (enumDecls.length === 1) { + // safe declaration merging + return; + } + // there's more than one enum declaration, which needs to be reported + for (const { identifier } of enumDecls) { + yield { loc: identifier.loc, node: identifier, type: 'syntax' }; + } + return; + } + } + for (const { identifier } of identifiers) { + yield { loc: identifier.loc, node: identifier, type: 'syntax' }; + } + } + function findVariablesInScope(scope) { + for (const variable of scope.variables) { + const [declaration, ...extraDeclarations] = iterateDeclarations(variable); + if (extraDeclarations.length === 0) { + continue; + } + /* + * If the type of a declaration is different from the type of + * the first declaration, it shows the location of the first + * declaration. + */ + const detailMessageId = declaration.type === 'builtin' + ? 'redeclaredAsBuiltin' + : 'redeclaredBySyntax'; + const data = { id: variable.name }; + // Report extra declarations. + for (const { loc, node, type } of extraDeclarations) { + const messageId = type === declaration.type ? 'redeclared' : detailMessageId; + if (node) { + context.report({ loc, node, messageId, data }); + } + else if (loc) { + context.report({ loc, messageId, data }); + } + } + } + } + /** + * Find variables in the current scope. + */ + function checkForBlock(node) { + const scope = context.sourceCode.getScope(node); + /* + * In ES5, some node type such as `BlockStatement` doesn't have that scope. + * `scope.block` is a different node in such a case. + */ + if (scope.block === node) { + findVariablesInScope(scope); + } + } + return { + ArrowFunctionExpression: checkForBlock, + BlockStatement: checkForBlock, + ForInStatement: checkForBlock, + ForOfStatement: checkForBlock, + ForStatement: checkForBlock, + FunctionDeclaration: checkForBlock, + FunctionExpression: checkForBlock, + Program(node) { + const scope = context.sourceCode.getScope(node); + findVariablesInScope(scope); + // Node.js or ES modules has a special scope. + if (scope.type === scope_manager_1.ScopeType.global && + scope.childScopes[0] && + // The special scope's block is the Program node. + scope.block === scope.childScopes[0].block) { + findVariablesInScope(scope.childScopes[0]); + } + }, + SwitchStatement: checkForBlock, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.d.ts.map new file mode 100644 index 0000000..97a7cb5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-redundant-type-constituents.d.ts","sourceRoot":"","sources":["../../src/rules/no-redundant-type-constituents.ts"],"names":[],"mappings":";AAgMA,wBAqVG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.js new file mode 100644 index 0000000..eb1d31c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.js @@ -0,0 +1,431 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const literalToPrimitiveTypeFlags = { + [ts.TypeFlags.BigIntLiteral]: ts.TypeFlags.BigInt, + [ts.TypeFlags.BooleanLiteral]: ts.TypeFlags.Boolean, + [ts.TypeFlags.NumberLiteral]: ts.TypeFlags.Number, + [ts.TypeFlags.StringLiteral]: ts.TypeFlags.String, + [ts.TypeFlags.TemplateLiteral]: ts.TypeFlags.String, +}; +const literalTypeFlags = [ + ts.TypeFlags.BigIntLiteral, + ts.TypeFlags.BooleanLiteral, + ts.TypeFlags.NumberLiteral, + ts.TypeFlags.StringLiteral, + ts.TypeFlags.TemplateLiteral, +]; +const primitiveTypeFlags = [ + ts.TypeFlags.BigInt, + ts.TypeFlags.Boolean, + ts.TypeFlags.Number, + ts.TypeFlags.String, +]; +const primitiveTypeFlagNames = { + [ts.TypeFlags.BigInt]: 'bigint', + [ts.TypeFlags.Boolean]: 'boolean', + [ts.TypeFlags.Number]: 'number', + [ts.TypeFlags.String]: 'string', +}; +const primitiveTypeFlagTypes = { + bigint: ts.TypeFlags.BigIntLiteral, + boolean: ts.TypeFlags.BooleanLiteral, + number: ts.TypeFlags.NumberLiteral, + string: ts.TypeFlags.StringLiteral, +}; +const keywordNodeTypesToTsTypes = new Map([ + [utils_1.TSESTree.AST_NODE_TYPES.TSAnyKeyword, ts.TypeFlags.Any], + [utils_1.TSESTree.AST_NODE_TYPES.TSBigIntKeyword, ts.TypeFlags.BigInt], + [utils_1.TSESTree.AST_NODE_TYPES.TSBooleanKeyword, ts.TypeFlags.Boolean], + [utils_1.TSESTree.AST_NODE_TYPES.TSNeverKeyword, ts.TypeFlags.Never], + [utils_1.TSESTree.AST_NODE_TYPES.TSNumberKeyword, ts.TypeFlags.Number], + [utils_1.TSESTree.AST_NODE_TYPES.TSStringKeyword, ts.TypeFlags.String], + [utils_1.TSESTree.AST_NODE_TYPES.TSUnknownKeyword, ts.TypeFlags.Unknown], +]); +function addToMapGroup(map, key, value) { + const existing = map.get(key); + if (existing) { + existing.push(value); + } + else { + map.set(key, [value]); + } +} +function describeLiteralType(type) { + if (type.isStringLiteral()) { + return JSON.stringify(type.value); + } + if ((0, util_1.isTypeBigIntLiteralType)(type)) { + return `${type.value.negative ? '-' : ''}${type.value.base10Value}n`; + } + if (type.isLiteral()) { + // eslint-disable-next-line @typescript-eslint/no-base-to-string + return type.value.toString(); + } + if (tsutils.isIntrinsicErrorType(type) && type.aliasSymbol) { + return type.aliasSymbol.escapedName.toString(); + } + if ((0, util_1.isTypeAnyType)(type)) { + return 'any'; + } + if ((0, util_1.isTypeNeverType)(type)) { + return 'never'; + } + if ((0, util_1.isTypeUnknownType)(type)) { + return 'unknown'; + } + if ((0, util_1.isTypeTemplateLiteralType)(type)) { + return 'template literal type'; + } + if ((0, util_1.isTypeBigIntLiteralType)(type)) { + return `${type.value.negative ? '-' : ''}${type.value.base10Value}n`; + } + if (tsutils.isTrueLiteralType(type)) { + return 'true'; + } + if (tsutils.isFalseLiteralType(type)) { + return 'false'; + } + return 'literal type'; +} +function describeLiteralTypeNode(typeNode) { + switch (typeNode.type) { + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + return 'any'; + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + return 'boolean'; + case utils_1.AST_NODE_TYPES.TSNeverKeyword: + return 'never'; + case utils_1.AST_NODE_TYPES.TSNumberKeyword: + return 'number'; + case utils_1.AST_NODE_TYPES.TSStringKeyword: + return 'string'; + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + return 'unknown'; + case utils_1.AST_NODE_TYPES.TSLiteralType: + switch (typeNode.literal.type) { + case utils_1.TSESTree.AST_NODE_TYPES.Literal: + switch (typeof typeNode.literal.value) { + case 'bigint': + return `${typeNode.literal.value < 0 ? '-' : ''}${typeNode.literal.value}n`; + case 'string': + return JSON.stringify(typeNode.literal.value); + default: + return `${typeNode.literal.value}`; + } + case utils_1.TSESTree.AST_NODE_TYPES.TemplateLiteral: + return 'template literal type'; + } + } + return 'literal type'; +} +function isNodeInsideReturnType(node) { + return !!(node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAnnotation && + (0, util_1.isFunctionOrFunctionType)(node.parent.parent)); +} +/** + * @remarks TypeScript stores boolean types as the union false | true, always. + */ +function unionTypePartsUnlessBoolean(type) { + return type.isUnion() && + type.types.length === 2 && + tsutils.isFalseLiteralType(type.types[0]) && + tsutils.isTrueLiteralType(type.types[1]) + ? [type] + : tsutils.unionTypeParts(type); +} +exports.default = (0, util_1.createRule)({ + name: 'no-redundant-type-constituents', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow members of unions and intersections that do nothing or override type information', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + errorTypeOverrides: `'{{typeName}}' is an 'error' type that acts as 'any' and overrides all other types in this {{container}} type.`, + literalOverridden: `{{literal}} is overridden by {{primitive}} in this union type.`, + overridden: `'{{typeName}}' is overridden by other types in this {{container}} type.`, + overrides: `'{{typeName}}' overrides all other types in this {{container}} type.`, + primitiveOverridden: `{{primitive}} is overridden by the {{literal}} in this intersection type.`, + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const typesCache = new Map(); + function getTypeNodeTypePartFlags(typeNode) { + const keywordTypeFlags = keywordNodeTypesToTsTypes.get(typeNode.type); + if (keywordTypeFlags) { + return [ + { + typeFlags: keywordTypeFlags, + typeName: describeLiteralTypeNode(typeNode), + }, + ]; + } + if (typeNode.type === utils_1.AST_NODE_TYPES.TSLiteralType && + typeNode.literal.type === utils_1.AST_NODE_TYPES.Literal) { + return [ + { + typeFlags: primitiveTypeFlagTypes[typeof typeNode.literal + .value], + typeName: describeLiteralTypeNode(typeNode), + }, + ]; + } + if (typeNode.type === utils_1.AST_NODE_TYPES.TSUnionType) { + return typeNode.types.flatMap(getTypeNodeTypePartFlags); + } + const nodeType = services.getTypeAtLocation(typeNode); + const typeParts = unionTypePartsUnlessBoolean(nodeType); + return typeParts.map(typePart => ({ + typeFlags: typePart.flags, + typeName: describeLiteralType(typePart), + })); + } + function getTypeNodeTypePartFlagsCached(typeNode) { + const existing = typesCache.get(typeNode); + if (existing) { + return existing; + } + const created = getTypeNodeTypePartFlags(typeNode); + typesCache.set(typeNode, created); + return created; + } + return { + 'TSIntersectionType:exit'(node) { + const seenLiteralTypes = new Map(); + const seenPrimitiveTypes = new Map(); + const seenUnionTypes = new Map(); + function checkIntersectionBottomAndTopTypes({ typeFlags, typeName }, typeNode) { + for (const [messageId, checkFlag] of [ + ['overrides', ts.TypeFlags.Any], + ['overrides', ts.TypeFlags.Never], + ['overridden', ts.TypeFlags.Unknown], + ]) { + if (typeFlags === checkFlag) { + context.report({ + node: typeNode, + messageId: typeFlags === ts.TypeFlags.Any && typeName !== 'any' + ? 'errorTypeOverrides' + : messageId, + data: { + container: 'intersection', + typeName, + }, + }); + return true; + } + } + return false; + } + for (const typeNode of node.types) { + const typePartFlags = getTypeNodeTypePartFlagsCached(typeNode); + for (const typePart of typePartFlags) { + if (checkIntersectionBottomAndTopTypes(typePart, typeNode)) { + continue; + } + for (const literalTypeFlag of literalTypeFlags) { + if (typePart.typeFlags === literalTypeFlag) { + addToMapGroup(seenLiteralTypes, literalToPrimitiveTypeFlags[literalTypeFlag], typePart.typeName); + break; + } + } + for (const primitiveTypeFlag of primitiveTypeFlags) { + if (typePart.typeFlags === primitiveTypeFlag) { + addToMapGroup(seenPrimitiveTypes, primitiveTypeFlag, typeNode); + } + } + } + // if any typeNode is TSTypeReference and typePartFlags have more than 1 element, than the referenced type is definitely a union. + if (typePartFlags.length >= 2) { + seenUnionTypes.set(typeNode, typePartFlags); + } + } + /** + * @example + * ```ts + * type F = "a"|2|"b"; + * type I = F & string; + * ``` + * This function checks if all the union members of `F` are assignable to the other member of `I`. If every member is assignable, then its reported else not. + */ + const checkIfUnionsAreAssignable = () => { + for (const [typeRef, typeValues] of seenUnionTypes) { + let primitive = undefined; + for (const { typeFlags } of typeValues) { + if (seenPrimitiveTypes.has(literalToPrimitiveTypeFlags[typeFlags])) { + primitive = + literalToPrimitiveTypeFlags[typeFlags]; + } + else { + primitive = undefined; + break; + } + } + if (Number.isInteger(primitive)) { + context.report({ + node: typeRef, + messageId: 'primitiveOverridden', + data: { + literal: typeValues.map(name => name.typeName).join(' | '), + primitive: primitiveTypeFlagNames[primitive], + }, + }); + } + } + }; + if (seenUnionTypes.size > 0) { + checkIfUnionsAreAssignable(); + return; + } + // For each primitive type of all the seen primitive types, + // if there was a literal type seen that overrides it, + // report each of the primitive type's type nodes + for (const [primitiveTypeFlag, typeNodes] of seenPrimitiveTypes) { + const matchedLiteralTypes = seenLiteralTypes.get(primitiveTypeFlag); + if (matchedLiteralTypes) { + for (const typeNode of typeNodes) { + context.report({ + node: typeNode, + messageId: 'primitiveOverridden', + data: { + literal: matchedLiteralTypes.join(' | '), + primitive: primitiveTypeFlagNames[primitiveTypeFlag], + }, + }); + } + } + } + }, + 'TSUnionType:exit'(node) { + const seenLiteralTypes = new Map(); + const seenPrimitiveTypes = new Set(); + function checkUnionBottomAndTopTypes({ typeFlags, typeName }, typeNode) { + for (const checkFlag of [ + ts.TypeFlags.Any, + ts.TypeFlags.Unknown, + ]) { + if (typeFlags === checkFlag) { + context.report({ + node: typeNode, + messageId: typeFlags === ts.TypeFlags.Any && typeName !== 'any' + ? 'errorTypeOverrides' + : 'overrides', + data: { + container: 'union', + typeName, + }, + }); + return true; + } + } + if (typeFlags === ts.TypeFlags.Never && + !isNodeInsideReturnType(node)) { + context.report({ + node: typeNode, + messageId: 'overridden', + data: { + container: 'union', + typeName: 'never', + }, + }); + return true; + } + return false; + } + for (const typeNode of node.types) { + const typePartFlags = getTypeNodeTypePartFlagsCached(typeNode); + for (const typePart of typePartFlags) { + if (checkUnionBottomAndTopTypes(typePart, typeNode)) { + continue; + } + for (const literalTypeFlag of literalTypeFlags) { + if (typePart.typeFlags === literalTypeFlag) { + addToMapGroup(seenLiteralTypes, literalToPrimitiveTypeFlags[literalTypeFlag], { + literalValue: typePart.typeName, + typeNode, + }); + break; + } + } + for (const primitiveTypeFlag of primitiveTypeFlags) { + if ((typePart.typeFlags & primitiveTypeFlag) !== 0) { + seenPrimitiveTypes.add(primitiveTypeFlag); + } + } + } + } + const overriddenTypeNodes = new Map(); + // For each primitive type of all the seen literal types, + // if there was a primitive type seen that overrides it, + // upsert the literal text and primitive type under the backing type node + for (const [primitiveTypeFlag, typeNodesWithText] of seenLiteralTypes) { + if (seenPrimitiveTypes.has(primitiveTypeFlag)) { + for (const { literalValue, typeNode } of typeNodesWithText) { + addToMapGroup(overriddenTypeNodes, typeNode, { + literalValue, + primitiveTypeFlag, + }); + } + } + } + // For each type node that had at least one overridden literal, + // group those literals by their primitive type, + // then report each primitive type with all its literals + for (const [typeNode, typeFlagsWithText] of overriddenTypeNodes) { + const grouped = (0, util_1.arrayGroupByToMap)(typeFlagsWithText, pair => pair.primitiveTypeFlag); + for (const [primitiveTypeFlag, pairs] of grouped) { + context.report({ + node: typeNode, + messageId: 'literalOverridden', + data: { + literal: pairs.map(pair => pair.literalValue).join(' | '), + primitive: primitiveTypeFlagNames[primitiveTypeFlag], + }, + }); + } + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.d.ts.map new file mode 100644 index 0000000..80bb4fb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-require-imports.d.ts","sourceRoot":"","sources":["../../src/rules/no-require-imports.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC;;AAE5C,wBAyFG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js new file mode 100644 index 0000000..a3bc484 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js @@ -0,0 +1,115 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-require-imports', + meta: { + type: 'problem', + docs: { + description: 'Disallow invocation of `require()`', + recommended: 'recommended', + }, + messages: { + noRequireImports: 'A `require()` style import is forbidden.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + type: 'array', + description: 'Patterns of import paths to allow requiring from.', + items: { type: 'string' }, + }, + allowAsImport: { + type: 'boolean', + description: 'Allows `require` statements in import declarations.', + }, + }, + }, + ], + }, + defaultOptions: [{ allow: [], allowAsImport: false }], + create(context, options) { + const allowAsImport = options[0].allowAsImport; + const allowPatterns = options[0].allow?.map(pattern => new RegExp(pattern, 'u')); + function isImportPathAllowed(importPath) { + return allowPatterns?.some(pattern => importPath.match(pattern)); + } + function isStringOrTemplateLiteral(node) { + return ((node.type === utils_1.AST_NODE_TYPES.Literal && + typeof node.value === 'string') || + node.type === utils_1.AST_NODE_TYPES.TemplateLiteral); + } + return { + 'CallExpression[callee.name="require"]'(node) { + if (node.arguments[0] && isStringOrTemplateLiteral(node.arguments[0])) { + const argValue = util.getStaticStringValue(node.arguments[0]); + if (typeof argValue === 'string' && isImportPathAllowed(argValue)) { + return; + } + } + const variable = utils_1.ASTUtils.findVariable(context.sourceCode.getScope(node), 'require'); + // ignore non-global require usage as it's something user-land custom instead + // of the commonjs standard + if (!variable?.identifiers.length) { + context.report({ + node, + messageId: 'noRequireImports', + }); + } + }, + TSExternalModuleReference(node) { + if (isStringOrTemplateLiteral(node.expression)) { + const argValue = util.getStaticStringValue(node.expression); + if (typeof argValue === 'string' && isImportPathAllowed(argValue)) { + return; + } + } + if (allowAsImport && + node.parent.type === utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration) { + return; + } + context.report({ + node, + messageId: 'noRequireImports', + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.d.ts.map new file mode 100644 index 0000000..6f9a294 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-restricted-imports.d.ts","sourceRoot":"","sources":["../../src/rules/no-restricted-imports.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,qBAAqB,EAErB,YAAY,EACb,MAAM,wCAAwC,CAAC;AAMhD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ,+VAA6C,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;AA4MtE,wBAkJG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js new file mode 100644 index 0000000..83755e3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js @@ -0,0 +1,243 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ignore_1 = __importDefault(require("ignore")); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-restricted-imports'); +// In some versions of eslint, the base rule has a completely incompatible schema +// This helper function is to safely try to get parts of the schema. If it's not +// possible, we'll fallback to less strict checks. +const tryAccess = (getter, fallback) => { + try { + return getter(); + } + catch { + return fallback; + } +}; +const baseSchema = baseRule.meta.schema; +const allowTypeImportsOptionSchema = { + allowTypeImports: { + type: 'boolean', + description: 'Whether to allow type-only imports for a path.', + }, +}; +const arrayOfStringsOrObjects = { + type: 'array', + items: { + anyOf: [ + { type: 'string' }, + { + type: 'object', + additionalProperties: false, + properties: { + ...tryAccess(() => baseSchema.anyOf[1].items[0].properties.paths.items.anyOf[1] + .properties, undefined), + ...allowTypeImportsOptionSchema, + }, + required: tryAccess(() => baseSchema.anyOf[1].items[0].properties.paths.items.anyOf[1] + .required, undefined), + }, + ], + }, + uniqueItems: true, +}; +const arrayOfStringsOrObjectPatterns = { + anyOf: [ + { + type: 'array', + items: { + type: 'string', + }, + uniqueItems: true, + }, + { + type: 'array', + items: { + type: 'object', + additionalProperties: false, + properties: { + ...tryAccess(() => baseSchema.anyOf[1].items[0].properties.patterns.anyOf[1].items + .properties, undefined), + ...allowTypeImportsOptionSchema, + }, + required: tryAccess(() => baseSchema.anyOf[1].items[0].properties.patterns.anyOf[1].items + .required, []), + }, + uniqueItems: true, + }, + ], +}; +const schema = { + anyOf: [ + arrayOfStringsOrObjects, + { + type: 'array', + additionalItems: false, + items: [ + { + type: 'object', + additionalProperties: false, + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStringsOrObjectPatterns, + }, + }, + ], + }, + ], +}; +function isObjectOfPaths(obj) { + return !!obj && Object.hasOwn(obj, 'paths'); +} +function isObjectOfPatterns(obj) { + return !!obj && Object.hasOwn(obj, 'patterns'); +} +function isOptionsArrayOfStringOrObject(options) { + if (isObjectOfPaths(options[0])) { + return false; + } + if (isObjectOfPatterns(options[0])) { + return false; + } + return true; +} +function getRestrictedPaths(options) { + if (isOptionsArrayOfStringOrObject(options)) { + return options; + } + if (isObjectOfPaths(options[0])) { + return options[0].paths; + } + return []; +} +function getRestrictedPatterns(options) { + if (isObjectOfPatterns(options[0])) { + return options[0].patterns; + } + return []; +} +function shouldCreateRule(baseRules, options) { + if (Object.keys(baseRules).length === 0 || options.length === 0) { + return false; + } + if (!isOptionsArrayOfStringOrObject(options)) { + return !!(options[0].paths?.length || options[0].patterns?.length); + } + return true; +} +exports.default = (0, util_1.createRule)({ + name: 'no-restricted-imports', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Disallow specified modules when loaded by `import`', + extendsBaseRule: true, + }, + fixable: baseRule.meta.fixable, + messages: baseRule.meta.messages, + schema, + }, + defaultOptions: [], + create(context) { + const rules = baseRule.create(context); + const { options } = context; + if (!shouldCreateRule(rules, options)) { + return {}; + } + const restrictedPaths = getRestrictedPaths(options); + const allowedTypeImportPathNameSet = new Set(); + for (const restrictedPath of restrictedPaths) { + if (typeof restrictedPath === 'object' && + restrictedPath.allowTypeImports) { + allowedTypeImportPathNameSet.add(restrictedPath.name); + } + } + function isAllowedTypeImportPath(importSource) { + return allowedTypeImportPathNameSet.has(importSource); + } + const restrictedPatterns = getRestrictedPatterns(options); + const allowedImportTypeMatchers = []; + const allowedImportTypeRegexMatchers = []; + for (const restrictedPattern of restrictedPatterns) { + if (typeof restrictedPattern === 'object' && + restrictedPattern.allowTypeImports) { + // Following how ignore is configured in the base rule + if (restrictedPattern.group) { + allowedImportTypeMatchers.push((0, ignore_1.default)({ + allowRelativePaths: true, + ignoreCase: !restrictedPattern.caseSensitive, + }).add(restrictedPattern.group)); + } + if (restrictedPattern.regex) { + allowedImportTypeRegexMatchers.push(new RegExp(restrictedPattern.regex, restrictedPattern.caseSensitive ? 'u' : 'iu')); + } + } + } + function isAllowedTypeImportPattern(importSource) { + return ( + // As long as there's one matching pattern that allows type import + allowedImportTypeMatchers.some(matcher => matcher.ignores(importSource)) || + allowedImportTypeRegexMatchers.some(regex => regex.test(importSource))); + } + function checkImportNode(node) { + if (node.importKind === 'type' || + (node.specifiers.length > 0 && + node.specifiers.every(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier && + specifier.importKind === 'type'))) { + const importSource = node.source.value.trim(); + if (!isAllowedTypeImportPath(importSource) && + !isAllowedTypeImportPattern(importSource)) { + return rules.ImportDeclaration(node); + } + } + else { + return rules.ImportDeclaration(node); + } + } + return { + ExportAllDeclaration: rules.ExportAllDeclaration, + 'ExportNamedDeclaration[source]'(node) { + if (node.exportKind === 'type' || + (node.specifiers.length > 0 && + node.specifiers.every(specifier => specifier.exportKind === 'type'))) { + const importSource = node.source.value.trim(); + if (!isAllowedTypeImportPath(importSource) && + !isAllowedTypeImportPattern(importSource)) { + return rules.ExportNamedDeclaration(node); + } + } + else { + return rules.ExportNamedDeclaration(node); + } + }, + ImportDeclaration: checkImportNode, + TSImportEqualsDeclaration(node) { + if (node.moduleReference.type === utils_1.AST_NODE_TYPES.TSExternalModuleReference) { + const synthesizedImport = { + ...node, + type: utils_1.AST_NODE_TYPES.ImportDeclaration, + assertions: [], + attributes: [], + source: node.moduleReference.expression, + specifiers: [ + { + ...node.id, + type: utils_1.AST_NODE_TYPES.ImportDefaultSpecifier, + local: node.id, + // @ts-expect-error -- parent types are incompatible but it's fine for the purposes of this extension + parent: node.id.parent, + }, + ], + }; + return checkImportNode(synthesizedImport); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.d.ts.map new file mode 100644 index 0000000..7a0f824 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-restricted-types.d.ts","sourceRoot":"","sources":["../../src/rules/no-restricted-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAMnE,KAAK,KAAK,GAAG,MAAM,CACjB,MAAM,EACJ,OAAO,GACP,MAAM,GACN;IACE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,GACD,IAAI,CACP,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,KAAK,CAAC,EAAE,KAAK,CAAC;KACf;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,mBAAmB,GAAG,uBAAuB,CAAC;;AA6CvE,wBAyJG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.js new file mode 100644 index 0000000..fa3204c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.js @@ -0,0 +1,165 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +function removeSpaces(str) { + return str.replaceAll(/\s/g, ''); +} +function stringifyNode(node, sourceCode) { + return removeSpaces(sourceCode.getText(node)); +} +function getCustomMessage(bannedType) { + if (!bannedType || bannedType === true) { + return ''; + } + if (typeof bannedType === 'string') { + return ` ${bannedType}`; + } + if (bannedType.message) { + return ` ${bannedType.message}`; + } + return ''; +} +const TYPE_KEYWORDS = { + bigint: utils_1.AST_NODE_TYPES.TSBigIntKeyword, + boolean: utils_1.AST_NODE_TYPES.TSBooleanKeyword, + never: utils_1.AST_NODE_TYPES.TSNeverKeyword, + null: utils_1.AST_NODE_TYPES.TSNullKeyword, + number: utils_1.AST_NODE_TYPES.TSNumberKeyword, + object: utils_1.AST_NODE_TYPES.TSObjectKeyword, + string: utils_1.AST_NODE_TYPES.TSStringKeyword, + symbol: utils_1.AST_NODE_TYPES.TSSymbolKeyword, + undefined: utils_1.AST_NODE_TYPES.TSUndefinedKeyword, + unknown: utils_1.AST_NODE_TYPES.TSUnknownKeyword, + void: utils_1.AST_NODE_TYPES.TSVoidKeyword, +}; +exports.default = (0, util_1.createRule)({ + name: 'no-restricted-types', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow certain types', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + bannedTypeMessage: "Don't use `{{name}}` as a type.{{customMessage}}", + bannedTypeReplacement: 'Replace `{{name}}` with `{{replacement}}`.', + }, + schema: [ + { + type: 'object', + $defs: { + banConfig: { + oneOf: [ + { + type: 'boolean', + description: 'Bans the type with the default message.', + enum: [true], + }, + { + type: 'string', + description: 'Bans the type with a custom message.', + }, + { + type: 'object', + additionalProperties: false, + description: 'Bans a type.', + properties: { + fixWith: { + type: 'string', + description: 'Type to autofix replace with. Note that autofixers can be applied automatically - so you need to be careful with this option.', + }, + message: { + type: 'string', + description: 'Custom error message.', + }, + suggest: { + type: 'array', + description: 'Types to suggest replacing with.', + items: { type: 'string' }, + }, + }, + }, + ], + }, + }, + additionalProperties: false, + properties: { + types: { + type: 'object', + additionalProperties: { + $ref: '#/items/0/$defs/banConfig', + }, + description: 'An object whose keys are the types you want to ban, and the values are error messages.', + }, + }, + }, + ], + }, + defaultOptions: [{}], + create(context, [{ types = {} }]) { + const bannedTypes = new Map(Object.entries(types).map(([type, data]) => [removeSpaces(type), data])); + function checkBannedTypes(typeNode, name = stringifyNode(typeNode, context.sourceCode)) { + const bannedType = bannedTypes.get(name); + if (bannedType == null || bannedType === false) { + return; + } + const customMessage = getCustomMessage(bannedType); + const fixWith = bannedType && typeof bannedType === 'object' && bannedType.fixWith; + const suggest = bannedType && typeof bannedType === 'object' + ? bannedType.suggest + : undefined; + context.report({ + node: typeNode, + messageId: 'bannedTypeMessage', + data: { + name, + customMessage, + }, + fix: fixWith + ? (fixer) => fixer.replaceText(typeNode, fixWith) + : null, + suggest: suggest?.map(replacement => ({ + messageId: 'bannedTypeReplacement', + data: { + name, + replacement, + }, + fix: (fixer) => fixer.replaceText(typeNode, replacement), + })), + }); + } + const keywordSelectors = (0, util_1.objectReduceKey)(TYPE_KEYWORDS, (acc, keyword) => { + if (bannedTypes.has(keyword)) { + acc[TYPE_KEYWORDS[keyword]] = (node) => checkBannedTypes(node, keyword); + } + return acc; + }, {}); + return { + ...keywordSelectors, + TSClassImplements(node) { + checkBannedTypes(node); + }, + TSInterfaceHeritage(node) { + checkBannedTypes(node); + }, + TSTupleType(node) { + if (!node.elementTypes.length) { + checkBannedTypes(node); + } + }, + TSTypeLiteral(node) { + if (!node.members.length) { + checkBannedTypes(node); + } + }, + TSTypeReference(node) { + checkBannedTypes(node.typeName); + if (node.typeArguments) { + checkBannedTypes(node); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.d.ts.map new file mode 100644 index 0000000..7749277 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-shadow.d.ts","sourceRoot":"","sources":["../../src/rules/no-shadow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAQnE,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,gBAAgB,CAAC;AACvD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,qBAAqB,GAAG,OAAO,GAAG,OAAO,CAAC;QACxE,0CAA0C,CAAC,EAAE,OAAO,CAAC;QACrD,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;KACjC;CACF,CAAC;;AAmBF,wBAgqBG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js new file mode 100644 index 0000000..3769ed8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js @@ -0,0 +1,521 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const isTypeImport_1 = require("../util/isTypeImport"); +const allowedFunctionVariableDefTypes = new Set([ + utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSFunctionType, + utils_1.AST_NODE_TYPES.TSMethodSignature, + utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSConstructorType, +]); +const functionsHoistedNodes = new Set([utils_1.AST_NODE_TYPES.FunctionDeclaration]); +const typesHoistedNodes = new Set([ + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, +]); +exports.default = (0, util_1.createRule)({ + name: 'no-shadow', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow variable declarations from shadowing variables declared in the outer scope', + extendsBaseRule: true, + }, + messages: { + noShadow: "'{{name}}' is already declared in the upper scope on line {{shadowedLine}} column {{shadowedColumn}}.", + noShadowGlobal: "'{{name}}' is already a global variable.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + type: 'array', + description: 'Identifier names for which shadowing is allowed.', + items: { + type: 'string', + }, + }, + builtinGlobals: { + type: 'boolean', + description: 'Whether to report shadowing of built-in global variables.', + }, + hoist: { + type: 'string', + description: 'Whether to report shadowing before outer functions or variables are defined.', + enum: ['all', 'functions', 'functions-and-types', 'never', 'types'], + }, + ignoreFunctionTypeParameterNameValueShadow: { + type: 'boolean', + description: 'Whether to ignore function parameters named the same as a variable.', + }, + ignoreOnInitialization: { + type: 'boolean', + description: 'Whether to ignore the variable initializers when the shadowed variable is presumably still unitialized.', + }, + ignoreTypeValueShadow: { + type: 'boolean', + description: 'Whether to ignore types named the same as a variable.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + builtinGlobals: false, + hoist: 'functions-and-types', + ignoreFunctionTypeParameterNameValueShadow: true, + ignoreOnInitialization: false, + ignoreTypeValueShadow: true, + }, + ], + create(context, [options]) { + /** + * Check if a scope is a TypeScript module augmenting the global namespace. + */ + function isGlobalAugmentation(scope) { + return ((scope.type === scope_manager_1.ScopeType.tsModule && scope.block.kind === 'global') || + (!!scope.upper && isGlobalAugmentation(scope.upper))); + } + /** + * Check if variable is a `this` parameter. + */ + function isThisParam(variable) { + return (variable.defs[0].type === scope_manager_1.DefinitionType.Parameter && + variable.name === 'this'); + } + function isTypeValueShadow(variable, shadowed) { + if (options.ignoreTypeValueShadow !== true) { + return false; + } + if (!('isValueVariable' in variable)) { + // this shouldn't happen... + return false; + } + const firstDefinition = shadowed.defs.at(0); + const isShadowedValue = !('isValueVariable' in shadowed) || + !firstDefinition || + (!(0, isTypeImport_1.isTypeImport)(firstDefinition) && shadowed.isValueVariable); + return variable.isValueVariable !== isShadowedValue; + } + function isFunctionTypeParameterNameValueShadow(variable, shadowed) { + if (options.ignoreFunctionTypeParameterNameValueShadow !== true) { + return false; + } + if (!('isValueVariable' in variable)) { + // this shouldn't happen... + return false; + } + const isShadowedValue = 'isValueVariable' in shadowed ? shadowed.isValueVariable : true; + if (!isShadowedValue) { + return false; + } + return variable.defs.every(def => allowedFunctionVariableDefTypes.has(def.node.type)); + } + function isGenericOfStaticMethod(variable) { + if (!('isTypeVariable' in variable)) { + // this shouldn't happen... + return false; + } + if (!variable.isTypeVariable) { + return false; + } + if (variable.identifiers.length === 0) { + return false; + } + const typeParameter = variable.identifiers[0].parent; + if (typeParameter.type !== utils_1.AST_NODE_TYPES.TSTypeParameter) { + return false; + } + const typeParameterDecl = typeParameter.parent; + if (typeParameterDecl.type !== utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration) { + return false; + } + const functionExpr = typeParameterDecl.parent; + if (functionExpr.type !== utils_1.AST_NODE_TYPES.FunctionExpression && + functionExpr.type !== utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return false; + } + const methodDefinition = functionExpr.parent; + if (methodDefinition.type !== utils_1.AST_NODE_TYPES.MethodDefinition) { + return false; + } + return methodDefinition.static; + } + function isGenericOfClass(variable) { + if (!('isTypeVariable' in variable)) { + // this shouldn't happen... + return false; + } + if (!variable.isTypeVariable) { + return false; + } + if (variable.identifiers.length === 0) { + return false; + } + const typeParameter = variable.identifiers[0].parent; + if (typeParameter.type !== utils_1.AST_NODE_TYPES.TSTypeParameter) { + return false; + } + const typeParameterDecl = typeParameter.parent; + if (typeParameterDecl.type !== utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration) { + return false; + } + const classDecl = typeParameterDecl.parent; + return (classDecl.type === utils_1.AST_NODE_TYPES.ClassDeclaration || + classDecl.type === utils_1.AST_NODE_TYPES.ClassExpression); + } + function isGenericOfAStaticMethodShadow(variable, shadowed) { + return isGenericOfStaticMethod(variable) && isGenericOfClass(shadowed); + } + function isImportDeclaration(definition) { + return definition.type === utils_1.AST_NODE_TYPES.ImportDeclaration; + } + function isExternalModuleDeclarationWithName(scope, name) { + return (scope.type === scope_manager_1.ScopeType.tsModule && + scope.block.id.type === utils_1.AST_NODE_TYPES.Literal && + scope.block.id.value === name); + } + function isExternalDeclarationMerging(scope, variable, shadowed) { + const [firstDefinition] = shadowed.defs; + const [secondDefinition] = variable.defs; + return ((0, isTypeImport_1.isTypeImport)(firstDefinition) && + isImportDeclaration(firstDefinition.parent) && + isExternalModuleDeclarationWithName(scope, firstDefinition.parent.source.value) && + (secondDefinition.node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration || + secondDefinition.node.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration)); + } + /** + * Check if variable name is allowed. + * @param variable The variable to check. + * @returns Whether or not the variable name is allowed. + */ + function isAllowed(variable) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return options.allow.includes(variable.name); + } + /** + * Checks if a variable of the class name in the class scope of ClassDeclaration. + * + * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param variable The variable to check. + * @returns Whether or not the variable of the class name in the class scope of ClassDeclaration. + */ + function isDuplicatedClassNameVariable(variable) { + const block = variable.scope.block; + return (block.type === utils_1.AST_NODE_TYPES.ClassDeclaration && + block.id === variable.identifiers[0]); + } + /** + * Checks if a variable of the class name in the class scope of TSEnumDeclaration. + * + * TSEnumDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param variable The variable to check. + * @returns Whether or not the variable of the class name in the class scope of TSEnumDeclaration. + */ + function isDuplicatedEnumNameVariable(variable) { + const block = variable.scope.block; + return (block.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration && + block.id === variable.identifiers[0]); + } + /** + * Checks whether or not a given location is inside of the range of a given node. + * @param node An node to check. + * @param location A location to check. + * @returns `true` if the location is inside of the range of the node. + */ + function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; + } + /** + * Searches from the current node through its ancestry to find a matching node. + * @param node a node to get. + * @param match a callback that checks whether or not the node verifies its condition or not. + * @returns the matching node. + */ + function findSelfOrAncestor(node, match) { + let currentNode = node; + while (currentNode && !match(currentNode)) { + currentNode = currentNode.parent; + } + return currentNode; + } + /** + * Finds function's outer scope. + * @param scope Function's own scope. + * @returns Function's outer scope. + */ + function getOuterScope(scope) { + const upper = scope.upper; + if (upper?.type === scope_manager_1.ScopeType.functionExpressionName) { + return upper.upper; + } + return upper; + } + /** + * Checks if a variable and a shadowedVariable have the same init pattern ancestor. + * @param variable a variable to check. + * @param shadowedVariable a shadowedVariable to check. + * @returns Whether or not the variable and the shadowedVariable have the same init pattern ancestor. + */ + function isInitPatternNode(variable, shadowedVariable) { + const outerDef = shadowedVariable.defs.at(0); + if (!outerDef) { + return false; + } + const { variableScope } = variable.scope; + if (!((variableScope.block.type === + utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + variableScope.block.type === utils_1.AST_NODE_TYPES.FunctionExpression) && + getOuterScope(variableScope) === shadowedVariable.scope)) { + return false; + } + const fun = variableScope.block; + const { parent } = fun; + const callExpression = findSelfOrAncestor(parent, node => node.type === utils_1.AST_NODE_TYPES.CallExpression); + if (!callExpression) { + return false; + } + let node = outerDef.name; + const location = callExpression.range[1]; + while (node) { + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + if (isInRange(node.init, location)) { + return true; + } + if ((node.parent.parent.type === utils_1.AST_NODE_TYPES.ForInStatement || + node.parent.parent.type === utils_1.AST_NODE_TYPES.ForOfStatement) && + isInRange(node.parent.parent.right, location)) { + return true; + } + break; + } + else if (node.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + if (isInRange(node.right, location)) { + return true; + } + } + else if ([ + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + utils_1.AST_NODE_TYPES.CatchClause, + utils_1.AST_NODE_TYPES.ClassDeclaration, + utils_1.AST_NODE_TYPES.ClassExpression, + utils_1.AST_NODE_TYPES.ExportNamedDeclaration, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.ImportDeclaration, + ].includes(node.type)) { + break; + } + node = node.parent; + } + return false; + } + /** + * Checks if a variable is inside the initializer of scopeVar. + * + * To avoid reporting at declarations such as `var a = function a() {};`. + * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. + * @param variable The variable to check. + * @param scopeVar The scope variable to look for. + * @returns Whether or not the variable is inside initializer of scopeVar. + */ + function isOnInitializer(variable, scopeVar) { + const outerScope = scopeVar.scope; + const outerDef = scopeVar.defs.at(0); + const outer = outerDef?.parent?.range; + const innerScope = variable.scope; + const innerDef = variable.defs.at(0); + const inner = innerDef?.name.range; + return !!(outer && + inner && + outer[0] < inner[0] && + inner[1] < outer[1] && + ((innerDef.type === scope_manager_1.DefinitionType.FunctionName && + innerDef.node.type === utils_1.AST_NODE_TYPES.FunctionExpression) || + innerDef.node.type === utils_1.AST_NODE_TYPES.ClassExpression) && + outerScope === innerScope.upper); + } + /** + * Get a range of a variable's identifier node. + * @param variable The variable to get. + * @returns The range of the variable's identifier node. + */ + function getNameRange(variable) { + const def = variable.defs.at(0); + return def?.name.range; + } + /** + * Checks if a variable is in TDZ of scopeVar. + * @param variable The variable to check. + * @param scopeVar The variable of TDZ. + * @returns Whether or not the variable is in TDZ of scopeVar. + */ + function isInTdz(variable, scopeVar) { + const outerDef = scopeVar.defs.at(0); + const inner = getNameRange(variable); + const outer = getNameRange(scopeVar); + if (!inner || !outer || inner[1] >= outer[0]) { + return false; + } + if (!outerDef) { + return true; + } + if (options.hoist === 'functions') { + return !functionsHoistedNodes.has(outerDef.node.type); + } + if (options.hoist === 'types') { + return !typesHoistedNodes.has(outerDef.node.type); + } + if (options.hoist === 'functions-and-types') { + return (!functionsHoistedNodes.has(outerDef.node.type) && + !typesHoistedNodes.has(outerDef.node.type)); + } + return true; + } + /** + * Get declared line and column of a variable. + * @param variable The variable to get. + * @returns The declared line and column of the variable. + */ + function getDeclaredLocation(variable) { + const identifier = variable.identifiers.at(0); + if (identifier) { + return { + column: identifier.loc.start.column + 1, + global: false, + line: identifier.loc.start.line, + }; + } + return { + global: true, + }; + } + /** + * Checks if the initialization of a variable has the declare modifier in a + * definition file. + */ + function isDeclareInDTSFile(variable) { + const fileName = context.filename; + if (!(0, util_1.isDefinitionFile)(fileName)) { + return false; + } + return variable.defs.some(def => { + return ((def.type === scope_manager_1.DefinitionType.Variable && def.parent.declare) || + (def.type === scope_manager_1.DefinitionType.ClassName && def.node.declare) || + (def.type === scope_manager_1.DefinitionType.TSEnumName && def.node.declare) || + (def.type === scope_manager_1.DefinitionType.TSModuleName && def.node.declare)); + }); + } + /** + * Checks the current context for shadowed variables. + * @param scope Fixme + */ + function checkForShadows(scope) { + // ignore global augmentation + if (isGlobalAugmentation(scope)) { + return; + } + const variables = scope.variables; + for (const variable of variables) { + // ignore "arguments" + if (variable.identifiers.length === 0) { + continue; + } + // this params are pseudo-params that cannot be shadowed + if (isThisParam(variable)) { + continue; + } + // ignore variables of a class name in the class scope of ClassDeclaration + if (isDuplicatedClassNameVariable(variable)) { + continue; + } + // ignore variables of a class name in the class scope of ClassDeclaration + if (isDuplicatedEnumNameVariable(variable)) { + continue; + } + // ignore configured allowed names + if (isAllowed(variable)) { + continue; + } + // ignore variables with the declare keyword in .d.ts files + if (isDeclareInDTSFile(variable)) { + continue; + } + // Gets shadowed variable. + const shadowed = scope.upper + ? utils_1.ASTUtils.findVariable(scope.upper, variable.name) + : null; + if (!shadowed) { + continue; + } + // ignore type value variable shadowing if configured + if (isTypeValueShadow(variable, shadowed)) { + continue; + } + // ignore function type parameter name shadowing if configured + if (isFunctionTypeParameterNameValueShadow(variable, shadowed)) { + continue; + } + // ignore static class method generic shadowing class generic + // this is impossible for the scope analyser to understand + // so we have to handle this manually in this rule + if (isGenericOfAStaticMethodShadow(variable, shadowed)) { + continue; + } + if (isExternalDeclarationMerging(scope, variable, shadowed)) { + continue; + } + const isESLintGlobal = 'writeable' in shadowed; + if ((shadowed.identifiers.length > 0 || + (options.builtinGlobals && isESLintGlobal)) && + !isOnInitializer(variable, shadowed) && + !(options.ignoreOnInitialization && + isInitPatternNode(variable, shadowed)) && + !(options.hoist !== 'all' && isInTdz(variable, shadowed))) { + const location = getDeclaredLocation(shadowed); + context.report({ + node: variable.identifiers[0], + ...(location.global + ? { + messageId: 'noShadowGlobal', + data: { + name: variable.name, + }, + } + : { + messageId: 'noShadow', + data: { + name: variable.name, + shadowedColumn: location.column, + shadowedLine: location.line, + }, + }), + }); + } + } + } + return { + 'Program:exit'(node) { + const globalScope = context.sourceCode.getScope(node); + const stack = [...globalScope.childScopes]; + while (stack.length) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const scope = stack.pop(); + stack.push(...scope.childScopes); + checkForShadows(scope); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.d.ts.map new file mode 100644 index 0000000..41e7fbc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-this-alias.d.ts","sourceRoot":"","sources":["../../src/rules/no-this-alias.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;;AAE9D,wBAsEG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js new file mode 100644 index 0000000..f63fa3c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-this-alias', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow aliasing `this`', + recommended: 'recommended', + }, + messages: { + thisAssignment: "Unexpected aliasing of 'this' to local variable.", + thisDestructure: "Unexpected aliasing of members of 'this' to local variables.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowDestructuring: { + type: 'boolean', + description: 'Whether to ignore destructurings, such as `const { props, state } = this`.', + }, + allowedNames: { + type: 'array', + description: 'Names to ignore, such as ["self"] for `const self = this;`.', + items: { + type: 'string', + }, + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowDestructuring: true, + allowedNames: [], + }, + ], + create(context, [{ allowDestructuring, allowedNames }]) { + return { + "VariableDeclarator[init.type='ThisExpression'], AssignmentExpression[right.type='ThisExpression']"(node) { + const id = node.type === utils_1.AST_NODE_TYPES.VariableDeclarator ? node.id : node.left; + if (allowDestructuring && id.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const hasAllowedName = id.type === utils_1.AST_NODE_TYPES.Identifier + ? // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + allowedNames.includes(id.name) + : false; + if (!hasAllowedName) { + context.report({ + node: id, + messageId: id.type === utils_1.AST_NODE_TYPES.Identifier + ? 'thisAssignment' + : 'thisDestructure', + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.d.ts.map new file mode 100644 index 0000000..b637fbe --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-type-alias.d.ts","sourceRoot":"","sources":["../../src/rules/no-type-alias.ts"],"names":[],"mappings":"AAMA,KAAK,MAAM,GACP,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,6BAA6B,GAC7B,OAAO,CAAC;AAEZ,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;QACpC,qBAAqB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;QAC3C,iBAAiB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;QACvC,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,oBAAoB,GAAG,aAAa,CAAC;;AAU9D,wBAwTG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js new file mode 100644 index 0000000..d41314b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js @@ -0,0 +1,258 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-type-alias', + meta: { + type: 'suggestion', + deprecated: true, + docs: { + description: 'Disallow type aliases', + // too opinionated to be recommended + }, + messages: { + noCompositionAlias: '{{typeName}} in {{compositionType}} types are not allowed.', + noTypeAlias: 'Type {{alias}} are not allowed.', + }, + schema: [ + { + type: 'object', + $defs: { + expandedOptions: { + type: 'string', + enum: [ + 'always', + 'never', + 'in-unions', + 'in-intersections', + 'in-unions-and-intersections', + ], + }, + simpleOptions: { + type: 'string', + enum: ['always', 'never'], + }, + }, + additionalProperties: false, + properties: { + allowAliases: { + $ref: '#/items/0/$defs/expandedOptions', + description: 'Whether to allow direct one-to-one type aliases.', + }, + allowCallbacks: { + $ref: '#/items/0/$defs/simpleOptions', + description: 'Whether to allow type aliases for callbacks.', + }, + allowConditionalTypes: { + $ref: '#/items/0/$defs/simpleOptions', + description: 'Whether to allow type aliases for conditional types.', + }, + allowConstructors: { + $ref: '#/items/0/$defs/simpleOptions', + description: 'Whether to allow type aliases with constructors.', + }, + allowGenerics: { + $ref: '#/items/0/$defs/simpleOptions', + description: 'Whether to allow type aliases with generic types.', + }, + allowLiterals: { + $ref: '#/items/0/$defs/expandedOptions', + description: 'Whether to allow type aliases with object literal types.', + }, + allowMappedTypes: { + $ref: '#/items/0/$defs/expandedOptions', + description: 'Whether to allow type aliases with mapped types.', + }, + allowTupleTypes: { + $ref: '#/items/0/$defs/expandedOptions', + description: 'Whether to allow type aliases with tuple types.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowAliases: 'never', + allowCallbacks: 'never', + allowConditionalTypes: 'never', + allowConstructors: 'never', + allowGenerics: 'never', + allowLiterals: 'never', + allowMappedTypes: 'never', + allowTupleTypes: 'never', + }, + ], + create(context, [{ allowAliases, allowCallbacks, allowConditionalTypes, allowConstructors, allowGenerics, allowLiterals, allowMappedTypes, allowTupleTypes, },]) { + const unions = ['always', 'in-unions', 'in-unions-and-intersections']; + const intersections = [ + 'always', + 'in-intersections', + 'in-unions-and-intersections', + ]; + const compositions = [ + 'in-unions', + 'in-intersections', + 'in-unions-and-intersections', + ]; + const aliasTypes = new Set([ + utils_1.AST_NODE_TYPES.TSArrayType, + utils_1.AST_NODE_TYPES.TSImportType, + utils_1.AST_NODE_TYPES.TSIndexedAccessType, + utils_1.AST_NODE_TYPES.TSLiteralType, + utils_1.AST_NODE_TYPES.TSTemplateLiteralType, + utils_1.AST_NODE_TYPES.TSTypeQuery, + utils_1.AST_NODE_TYPES.TSTypeReference, + ]); + /** + * Determines if the composition type is supported by the allowed flags. + * @param isTopLevel a flag indicating this is the top level node. + * @param compositionType the composition type (either TSUnionType or TSIntersectionType) + * @param allowed the currently allowed flags. + */ + function isSupportedComposition(isTopLevel, compositionType, allowed) { + return (!compositions.includes(allowed) || + (!isTopLevel && + ((compositionType === utils_1.AST_NODE_TYPES.TSUnionType && + unions.includes(allowed)) || + (compositionType === utils_1.AST_NODE_TYPES.TSIntersectionType && + intersections.includes(allowed))))); + } + /** + * Gets the message to be displayed based on the node type and whether the node is a top level declaration. + * @param node the location + * @param compositionType the type of composition this alias is part of (undefined if not + * part of a composition) + * @param isRoot a flag indicating we are dealing with the top level declaration. + * @param type the kind of type alias being validated. + */ + function reportError(node, compositionType, isRoot, type) { + if (isRoot) { + return context.report({ + node, + messageId: 'noTypeAlias', + data: { + alias: type.toLowerCase(), + }, + }); + } + return context.report({ + node, + messageId: 'noCompositionAlias', + data: { + compositionType: compositionType === utils_1.AST_NODE_TYPES.TSUnionType + ? 'union' + : 'intersection', + typeName: type, + }, + }); + } + const isValidTupleType = (type) => { + if (type.node.type === utils_1.AST_NODE_TYPES.TSTupleType) { + return true; + } + if (type.node.type === utils_1.AST_NODE_TYPES.TSTypeOperator && + ['keyof', 'readonly'].includes(type.node.operator) && + type.node.typeAnnotation && + type.node.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTupleType) { + return true; + } + return false; + }; + const isValidGeneric = (type) => { + return (type.node.type === utils_1.AST_NODE_TYPES.TSTypeReference && + type.node.typeArguments != null); + }; + const checkAndReport = (optionValue, isTopLevel, type, label) => { + if (optionValue === 'never' || + !isSupportedComposition(isTopLevel, type.compositionType, optionValue)) { + reportError(type.node, type.compositionType, isTopLevel, label); + } + }; + /** + * Validates the node looking for aliases, callbacks and literals. + * @param type the type of composition this alias is part of (null if not + * part of a composition) + * @param isTopLevel a flag indicating this is the top level node. + */ + function validateTypeAliases(type, isTopLevel = false) { + // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + if (type.node.type === utils_1.AST_NODE_TYPES.TSFunctionType) { + // callback + if (allowCallbacks === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Callbacks'); + } + } + else if (type.node.type === utils_1.AST_NODE_TYPES.TSConditionalType) { + // conditional type + if (allowConditionalTypes === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Conditional types'); + } + } + else if (type.node.type === utils_1.AST_NODE_TYPES.TSConstructorType) { + if (allowConstructors === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Constructors'); + } + } + else if (type.node.type === utils_1.AST_NODE_TYPES.TSTypeLiteral) { + // literal object type + checkAndReport(allowLiterals, isTopLevel, type, 'Literals'); + } + else if (type.node.type === utils_1.AST_NODE_TYPES.TSMappedType) { + // mapped type + checkAndReport(allowMappedTypes, isTopLevel, type, 'Mapped types'); + } + else if (isValidTupleType(type)) { + // tuple types + checkAndReport(allowTupleTypes, isTopLevel, type, 'Tuple Types'); + } + else if (isValidGeneric(type)) { + if (allowGenerics === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Generics'); + } + } + else if (type.node.type.endsWith(utils_1.AST_TOKEN_TYPES.Keyword) || + aliasTypes.has(type.node.type) || + (type.node.type === utils_1.AST_NODE_TYPES.TSTypeOperator && + (type.node.operator === 'keyof' || + (type.node.operator === 'readonly' && + type.node.typeAnnotation && + aliasTypes.has(type.node.typeAnnotation.type))))) { + // alias / keyword + checkAndReport(allowAliases, isTopLevel, type, 'Aliases'); + } + else { + // unhandled type - shouldn't happen + reportError(type.node, type.compositionType, isTopLevel, 'Unhandled'); + } + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + } + /** + * Flatten the given type into an array of its dependencies + */ + function getTypes(node, compositionType = null) { + if (node.type === utils_1.AST_NODE_TYPES.TSUnionType || + node.type === utils_1.AST_NODE_TYPES.TSIntersectionType) { + return node.types.flatMap(type => getTypes(type, node.type)); + } + return [{ node, compositionType }]; + } + return { + TSTypeAliasDeclaration(node) { + const types = getTypes(node.typeAnnotation); + if (types.length === 1) { + // is a top level type annotation + validateTypeAliases(types[0], true); + } + else { + // is a composition type + types.forEach(type => { + validateTypeAliases(type); + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.d.ts.map new file mode 100644 index 0000000..7544513 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-boolean-literal-compare.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-boolean-literal-compare.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAClB,0BAA0B,GAC1B,+BAA+B,GAC/B,gCAAgC,GAChC,QAAQ,GACR,SAAS,GACT,mBAAmB,CAAC;AAExB,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,qCAAqC,CAAC,EAAE,OAAO,CAAC;QAChD,oCAAoC,CAAC,EAAE,OAAO,CAAC;QAC/C,sDAAsD,CAAC,EAAE,OAAO,CAAC;KAClE;CACF,CAAC;;AAYF,wBAkRG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js new file mode 100644 index 0000000..f2db70a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js @@ -0,0 +1,263 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-boolean-literal-compare', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary equality comparisons against boolean literals', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + comparingNullableToFalse: 'This expression unnecessarily compares a nullable boolean value to false instead of using the ?? operator to provide a default.', + comparingNullableToTrueDirect: 'This expression unnecessarily compares a nullable boolean value to true instead of using it directly.', + comparingNullableToTrueNegated: 'This expression unnecessarily compares a nullable boolean value to true instead of negating it.', + direct: 'This expression unnecessarily compares a boolean value to a boolean instead of using it directly.', + negated: 'This expression unnecessarily compares a boolean value to a boolean instead of negating it.', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowComparingNullableBooleansToFalse: { + type: 'boolean', + description: 'Whether to allow comparisons between nullable boolean variables and `false`.', + }, + allowComparingNullableBooleansToTrue: { + type: 'boolean', + description: 'Whether to allow comparisons between nullable boolean variables and `true`.', + }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowComparingNullableBooleansToFalse: true, + allowComparingNullableBooleansToTrue: true, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + options.allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + function getBooleanComparison(node) { + const comparison = deconstructComparison(node); + if (!comparison) { + return undefined; + } + const { constraintType, isTypeParameter } = (0, util_1.getConstraintInfo)(checker, services.getTypeAtLocation(comparison.expression)); + if (isTypeParameter && constraintType == null) { + return undefined; + } + if (isBooleanType(constraintType)) { + return { + ...comparison, + expressionIsNullableBoolean: false, + }; + } + if (isNullableBoolean(constraintType)) { + return { + ...comparison, + expressionIsNullableBoolean: true, + }; + } + return undefined; + } + function isBooleanType(expressionType) { + return tsutils.isTypeFlagSet(expressionType, ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral); + } + /** + * checks if the expressionType is a union that + * 1) contains at least one nullish type (null or undefined) + * 2) contains at least once boolean type (true or false or boolean) + * 3) does not contain any types besides nullish and boolean types + */ + function isNullableBoolean(expressionType) { + if (!expressionType.isUnion()) { + return false; + } + const { types } = expressionType; + const nonNullishTypes = types.filter(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Undefined | ts.TypeFlags.Null)); + const hasNonNullishType = nonNullishTypes.length > 0; + if (!hasNonNullishType) { + return false; + } + const hasNullableType = nonNullishTypes.length < types.length; + if (!hasNullableType) { + return false; + } + const allNonNullishTypesAreBoolean = nonNullishTypes.every(isBooleanType); + if (!allNonNullishTypesAreBoolean) { + return false; + } + return true; + } + function deconstructComparison(node) { + const comparisonType = getEqualsKind(node.operator); + if (!comparisonType) { + return undefined; + } + for (const [against, expression] of [ + [node.right, node.left], + [node.left, node.right], + ]) { + if (against.type !== utils_1.AST_NODE_TYPES.Literal || + typeof against.value !== 'boolean') { + continue; + } + const { value: literalBooleanInComparison } = against; + const negated = !comparisonType.isPositive; + return { + expression, + literalBooleanInComparison, + negated, + }; + } + return undefined; + } + function nodeIsUnaryNegation(node) { + return (node.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.prefix && + node.operator === '!'); + } + return { + BinaryExpression(node) { + const comparison = getBooleanComparison(node); + if (comparison == null) { + return; + } + if (comparison.expressionIsNullableBoolean) { + if (comparison.literalBooleanInComparison && + options.allowComparingNullableBooleansToTrue) { + return; + } + if (!comparison.literalBooleanInComparison && + options.allowComparingNullableBooleansToFalse) { + return; + } + } + context.report({ + node, + messageId: comparison.expressionIsNullableBoolean + ? comparison.literalBooleanInComparison + ? comparison.negated + ? 'comparingNullableToTrueNegated' + : 'comparingNullableToTrueDirect' + : 'comparingNullableToFalse' + : comparison.negated + ? 'negated' + : 'direct', + *fix(fixer) { + // 1. isUnaryNegation - parent negation + // 2. literalBooleanInComparison - is compared to literal boolean + // 3. negated - is expression negated + const isUnaryNegation = nodeIsUnaryNegation(node.parent); + const shouldNegate = comparison.negated !== comparison.literalBooleanInComparison; + const mutatedNode = isUnaryNegation ? node.parent : node; + yield fixer.replaceText(mutatedNode, context.sourceCode.getText(comparison.expression)); + // if `isUnaryNegation === literalBooleanInComparison === !negated` is true - negate the expression + if (shouldNegate === isUnaryNegation) { + yield fixer.insertTextBefore(mutatedNode, '!'); + // if the expression `exp` is not a strong precedence node, wrap it in parentheses + if (!(0, util_1.isStrongPrecedenceNode)(comparison.expression)) { + yield fixer.insertTextBefore(mutatedNode, '('); + yield fixer.insertTextAfter(mutatedNode, ')'); + } + } + // if the expression `exp` is nullable, and we're not comparing to `true`, insert `?? true` + if (comparison.expressionIsNullableBoolean && + !comparison.literalBooleanInComparison) { + // provide the default `true` + yield fixer.insertTextBefore(mutatedNode, '('); + yield fixer.insertTextAfter(mutatedNode, ' ?? true)'); + } + }, + }); + }, + }; + }, +}); +function getEqualsKind(operator) { + switch (operator) { + case '!=': + return { + isPositive: false, + isStrict: false, + }; + case '!==': + return { + isPositive: false, + isStrict: true, + }; + case '==': + return { + isPositive: true, + isStrict: false, + }; + case '===': + return { + isPositive: true, + isStrict: true, + }; + default: + return undefined; + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.d.ts.map new file mode 100644 index 0000000..18b3b11 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-condition.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-condition.ts"],"names":[],"mappings":"AAwGA,KAAK,iCAAiC,GAAG,OAAO,CAAC;AAEjD,KAAK,2BAA2B,GAAG,QAAQ,GAAG,OAAO,GAAG,uBAAuB,CAAC;AAShF,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,2BAA2B,CAAC,EACxB,2BAA2B,GAC3B,iCAAiC,CAAC;QACtC,sDAAsD,CAAC,EAAE,OAAO,CAAC;QACjE,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B;CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,+BAA+B,GAC/B,OAAO,GACP,cAAc,GACd,oBAAoB,GACpB,4BAA4B,GAC5B,mBAAmB,GACnB,wBAAwB,CAAC;;AAE7B,wBAgwBG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js new file mode 100644 index 0000000..b77cf8d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js @@ -0,0 +1,654 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const assertionFunctionUtils_1 = require("../util/assertionFunctionUtils"); +// #region +function toStaticValue(type) { + // type.isLiteral() only covers numbers/bigints and strings, hence the rest of the branches. + if (tsutils.isBooleanLiteralType(type)) { + return { value: tsutils.isTrueLiteralType(type) }; + } + if (type.flags === ts.TypeFlags.Undefined) { + return { value: undefined }; + } + if (type.flags === ts.TypeFlags.Null) { + return { value: null }; + } + if (type.isLiteral()) { + return { value: (0, util_1.getValueOfLiteralType)(type) }; + } + return undefined; +} +const BOOL_OPERATORS = new Set([ + '<', + '>', + '<=', + '>=', + '==', + '===', + '!=', + '!==', +]); +function isBoolOperator(operator) { + return BOOL_OPERATORS.has(operator); +} +function booleanComparison(left, operator, right) { + switch (operator) { + case '!=': + // eslint-disable-next-line eqeqeq -- intentionally comparing with loose equality + return left != right; + case '!==': + return left !== right; + case '<': + // @ts-expect-error: we don't care if the comparison seems unintentional. + return left < right; + case '<=': + // @ts-expect-error: we don't care if the comparison seems unintentional. + return left <= right; + case '==': + // eslint-disable-next-line eqeqeq -- intentionally comparing with loose equality + return left == right; + case '===': + return left === right; + case '>': + // @ts-expect-error: we don't care if the comparison seems unintentional. + return left > right; + case '>=': + // @ts-expect-error: we don't care if the comparison seems unintentional. + return left >= right; + } +} +const constantLoopConditionsAllowedLiterals = new Set([ + true, + false, + 1, + 0, +]); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-condition', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow conditionals where the type is always truthy or always falsy', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + alwaysFalsy: 'Unnecessary conditional, value is always falsy.', + alwaysFalsyFunc: 'This callback should return a conditional, but return is always falsy.', + alwaysNullish: 'Unnecessary conditional, left-hand side of `??` operator is always `null` or `undefined`.', + alwaysTruthy: 'Unnecessary conditional, value is always truthy.', + alwaysTruthyFunc: 'This callback should return a conditional, but return is always truthy.', + comparisonBetweenLiteralTypes: 'Unnecessary conditional, comparison is always {{trueOrFalse}}, since `{{left}} {{operator}} {{right}}` is {{trueOrFalse}}.', + never: 'Unnecessary conditional, value is `never`.', + neverNullish: 'Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined.', + neverOptionalChain: 'Unnecessary optional chain on a non-nullish value.', + noOverlapBooleanExpression: 'Unnecessary conditional, the types have no overlap.', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + typeGuardAlreadyIsType: 'Unnecessary conditional, expression already has the type being checked by the {{typeGuardOrAssertionFunction}}.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowConstantLoopConditions: { + description: 'Whether to ignore constant loop conditions, such as `while (true)`.', + oneOf: [ + { + type: 'boolean', + }, + { + type: 'string', + enum: ['always', 'never', 'only-allowed-literals'], + }, + ], + }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Whether to not error when running with a tsconfig that has strictNullChecks turned.', + }, + checkTypePredicates: { + type: 'boolean', + description: 'Whether to check the asserted argument of a type predicate function for unnecessary conditions', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowConstantLoopConditions: 'never', + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + checkTypePredicates: false, + }, + ], + create(context, [{ allowConstantLoopConditions, allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, checkTypePredicates, },]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + const isNoUncheckedIndexedAccess = tsutils.isCompilerOptionEnabled(compilerOptions, 'noUncheckedIndexedAccess'); + const allowConstantLoopConditionsOption = normalizeAllowConstantLoopConditions( + // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + allowConstantLoopConditions); + if (!isStrictNullChecks && + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + function nodeIsArrayType(node) { + const nodeType = (0, util_1.getConstrainedTypeAtLocation)(services, node); + return tsutils + .unionTypeParts(nodeType) + .some(part => checker.isArrayType(part)); + } + function nodeIsTupleType(node) { + const nodeType = (0, util_1.getConstrainedTypeAtLocation)(services, node); + return tsutils + .unionTypeParts(nodeType) + .some(part => checker.isTupleType(part)); + } + function isArrayIndexExpression(node) { + return ( + // Is an index signature + node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.computed && + // ...into an array type + (nodeIsArrayType(node.object) || + // ... or a tuple type + (nodeIsTupleType(node.object) && + // Exception: literal index into a tuple - will have a sound type + node.property.type !== utils_1.AST_NODE_TYPES.Literal))); + } + // Conditional is always necessary if it involves: + // `any` or `unknown` or a naked type variable + function isConditionalAlwaysNecessary(type) { + return tsutils + .unionTypeParts(type) + .some(part => (0, util_1.isTypeAnyType)(part) || + (0, util_1.isTypeUnknownType)(part) || + (0, util_1.isTypeFlagSet)(part, ts.TypeFlags.TypeVariable)); + } + function isNullableMemberExpression(node) { + const objectType = services.getTypeAtLocation(node.object); + if (node.computed) { + const propertyType = services.getTypeAtLocation(node.property); + return isNullablePropertyType(objectType, propertyType); + } + const property = node.property; + // Get the actual property name, to account for private properties (this.#prop). + const propertyName = context.sourceCode.getText(property); + const propertyType = objectType + .getProperties() + .find(prop => prop.name === propertyName); + if (propertyType && + tsutils.isSymbolFlagSet(propertyType, ts.SymbolFlags.Optional)) { + return true; + } + return false; + } + /** + * Checks if a conditional node is necessary: + * if the type of the node is always true or always false, it's not necessary. + */ + function checkNode(expression, isUnaryNotArgument = false, node = expression) { + // Check if the node is Unary Negation expression and handle it + if (expression.type === utils_1.AST_NODE_TYPES.UnaryExpression && + expression.operator === '!') { + return checkNode(expression.argument, !isUnaryNotArgument, node); + } + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (isArrayIndexExpression(expression)) { + return; + } + // When checking logical expressions, only check the right side + // as the left side has been checked by checkLogicalExpressionForUnnecessaryConditionals + // + // Unless the node is nullish coalescing, as it's common to use patterns like `nullBool ?? true` to to strict + // boolean checks if we inspect the right here, it'll usually be a constant condition on purpose. + // In this case it's better to inspect the type of the expression as a whole. + if (expression.type === utils_1.AST_NODE_TYPES.LogicalExpression && + expression.operator !== '??') { + return checkNode(expression.right); + } + const type = (0, util_1.getConstrainedTypeAtLocation)(services, expression); + if (isConditionalAlwaysNecessary(type)) { + return; + } + let messageId = null; + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Never)) { + messageId = 'never'; + } + else if (!(0, util_1.isPossiblyTruthy)(type)) { + messageId = !isUnaryNotArgument ? 'alwaysFalsy' : 'alwaysTruthy'; + } + else if (!(0, util_1.isPossiblyFalsy)(type)) { + messageId = !isUnaryNotArgument ? 'alwaysTruthy' : 'alwaysFalsy'; + } + if (messageId) { + context.report({ node, messageId }); + } + } + function checkNodeForNullish(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + // Conditional is always necessary if it involves `any`, `unknown` or a naked type parameter + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.TypeParameter | + ts.TypeFlags.TypeVariable)) { + return; + } + let messageId = null; + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Never)) { + messageId = 'never'; + } + else if (!(0, util_1.isPossiblyNullish)(type) && + !(node.type === utils_1.AST_NODE_TYPES.MemberExpression && + isNullableMemberExpression(node))) { + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (!isArrayIndexExpression(node) && + !(node.type === utils_1.AST_NODE_TYPES.ChainExpression && + node.expression.type !== utils_1.AST_NODE_TYPES.TSNonNullExpression && + optionChainContainsOptionArrayIndex(node.expression))) { + messageId = 'neverNullish'; + } + } + else if ((0, util_1.isAlwaysNullish)(type)) { + messageId = 'alwaysNullish'; + } + if (messageId) { + context.report({ node, messageId }); + } + } + /** + * Checks that a binary expression is necessarily conditional, reports otherwise. + * If both sides of the binary expression are literal values, it's not a necessary condition. + * + * NOTE: It's also unnecessary if the types that don't overlap at all + * but that case is handled by the Typescript compiler itself. + * Known exceptions: + * - https://github.com/microsoft/TypeScript/issues/32627 + * - https://github.com/microsoft/TypeScript/issues/37160 (handled) + */ + function checkIfBoolExpressionIsNecessaryConditional(node, left, right, operator) { + const leftType = (0, util_1.getConstrainedTypeAtLocation)(services, left); + const rightType = (0, util_1.getConstrainedTypeAtLocation)(services, right); + const leftStaticValue = toStaticValue(leftType); + const rightStaticValue = toStaticValue(rightType); + if (leftStaticValue != null && rightStaticValue != null) { + const conditionIsTrue = booleanComparison(leftStaticValue.value, operator, rightStaticValue.value); + context.report({ + node, + messageId: 'comparisonBetweenLiteralTypes', + data: { + left: checker.typeToString(leftType), + operator, + right: checker.typeToString(rightType), + trueOrFalse: conditionIsTrue ? 'true' : 'false', + }, + }); + return; + } + // Workaround for https://github.com/microsoft/TypeScript/issues/37160 + if (isStrictNullChecks) { + const UNDEFINED = ts.TypeFlags.Undefined; + const NULL = ts.TypeFlags.Null; + const VOID = ts.TypeFlags.Void; + const isComparable = (type, flag) => { + // Allow comparison to `any`, `unknown` or a naked type parameter. + flag |= + ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.TypeParameter | + ts.TypeFlags.TypeVariable; + // Allow loose comparison to nullish values. + if (operator === '==' || operator === '!=') { + flag |= NULL | UNDEFINED | VOID; + } + return (0, util_1.isTypeFlagSet)(type, flag); + }; + if ((leftType.flags === UNDEFINED && + !isComparable(rightType, UNDEFINED | VOID)) || + (rightType.flags === UNDEFINED && + !isComparable(leftType, UNDEFINED | VOID)) || + (leftType.flags === NULL && !isComparable(rightType, NULL)) || + (rightType.flags === NULL && !isComparable(leftType, NULL))) { + context.report({ node, messageId: 'noOverlapBooleanExpression' }); + return; + } + } + } + /** + * Checks that a logical expression contains a boolean, reports otherwise. + */ + function checkLogicalExpressionForUnnecessaryConditionals(node) { + if (node.operator === '??') { + checkNodeForNullish(node.left); + return; + } + // Only checks the left side, since the right side might not be "conditional" at all. + // The right side will be checked if the LogicalExpression is used in a conditional context + checkNode(node.left); + } + function checkIfWhileLoopIsNecessaryConditional(node) { + if (allowConstantLoopConditionsOption === 'only-allowed-literals' && + node.test.type === utils_1.AST_NODE_TYPES.Literal && + constantLoopConditionsAllowedLiterals.has(node.test.value)) { + return; + } + checkIfLoopIsNecessaryConditional(node); + } + /** + * Checks that a testable expression of a loop is necessarily conditional, reports otherwise. + */ + function checkIfLoopIsNecessaryConditional(node) { + if (node.test == null) { + // e.g. `for(;;)` + return; + } + if (allowConstantLoopConditionsOption === 'always' && + tsutils.isTrueLiteralType((0, util_1.getConstrainedTypeAtLocation)(services, node.test))) { + return; + } + checkNode(node.test); + } + function checkCallExpression(node) { + if (checkTypePredicates) { + const truthinessAssertedArgument = (0, assertionFunctionUtils_1.findTruthinessAssertedArgument)(services, node); + if (truthinessAssertedArgument != null) { + checkNode(truthinessAssertedArgument); + } + const typeGuardAssertedArgument = (0, assertionFunctionUtils_1.findTypeGuardAssertedArgument)(services, node); + if (typeGuardAssertedArgument != null) { + const typeOfArgument = (0, util_1.getConstrainedTypeAtLocation)(services, typeGuardAssertedArgument.argument); + if (typeOfArgument === typeGuardAssertedArgument.type) { + context.report({ + node: typeGuardAssertedArgument.argument, + messageId: 'typeGuardAlreadyIsType', + data: { + typeGuardOrAssertionFunction: typeGuardAssertedArgument.asserts + ? 'assertion function' + : 'type guard', + }, + }); + } + } + } + // If this is something like arr.filter(x => /*condition*/), check `condition` + if ((0, util_1.isArrayMethodCallWithPredicate)(context, services, node) && + node.arguments.length) { + const callback = node.arguments[0]; + // Inline defined functions + if (callback.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + callback.type === utils_1.AST_NODE_TYPES.FunctionExpression) { + // Two special cases, where we can directly check the node that's returned: + // () => something + if (callback.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + return checkNode(callback.body); + } + // () => { return something; } + const callbackBody = callback.body.body; + if (callbackBody.length === 1 && + callbackBody[0].type === utils_1.AST_NODE_TYPES.ReturnStatement && + callbackBody[0].argument) { + return checkNode(callbackBody[0].argument); + } + // Potential enhancement: could use code-path analysis to check + // any function with a single return statement + // (Value to complexity ratio is dubious however) + } + // Otherwise just do type analysis on the function as a whole. + const returnTypes = tsutils + .getCallSignaturesOfType((0, util_1.getConstrainedTypeAtLocation)(services, callback)) + .map(sig => sig.getReturnType()); + if (returnTypes.length === 0) { + // Not a callable function, e.g. `any` + return; + } + let hasFalsyReturnTypes = false; + let hasTruthyReturnTypes = false; + for (const type of returnTypes) { + const { constraintType } = (0, util_1.getConstraintInfo)(checker, type); + // Predicate is always necessary if it involves `any` or `unknown` + if (!constraintType || + (0, util_1.isTypeAnyType)(constraintType) || + (0, util_1.isTypeUnknownType)(constraintType)) { + return; + } + if ((0, util_1.isPossiblyFalsy)(constraintType)) { + hasFalsyReturnTypes = true; + } + if ((0, util_1.isPossiblyTruthy)(constraintType)) { + hasTruthyReturnTypes = true; + } + // bail early if both a possibly-truthy and a possibly-falsy have been detected + if (hasFalsyReturnTypes && hasTruthyReturnTypes) { + return; + } + } + if (!hasFalsyReturnTypes) { + return context.report({ + node: callback, + messageId: 'alwaysTruthyFunc', + }); + } + if (!hasTruthyReturnTypes) { + return context.report({ + node: callback, + messageId: 'alwaysFalsyFunc', + }); + } + } + } + // Recursively searches an optional chain for an array index expression + // Has to search the entire chain, because an array index will "infect" the rest of the types + // Example: + // ``` + // [{x: {y: "z"} }][n] // type is {x: {y: "z"}} + // ?.x // type is {y: "z"} + // ?.y // This access is considered "unnecessary" according to the types + // ``` + function optionChainContainsOptionArrayIndex(node) { + const lhsNode = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object; + if (node.optional && isArrayIndexExpression(lhsNode)) { + return true; + } + if (lhsNode.type === utils_1.AST_NODE_TYPES.MemberExpression || + lhsNode.type === utils_1.AST_NODE_TYPES.CallExpression) { + return optionChainContainsOptionArrayIndex(lhsNode); + } + return false; + } + function isNullablePropertyType(objType, propertyType) { + if (propertyType.isUnion()) { + return propertyType.types.some(type => isNullablePropertyType(objType, type)); + } + if (propertyType.isNumberLiteral() || propertyType.isStringLiteral()) { + const propType = (0, util_1.getTypeOfPropertyOfName)(checker, objType, propertyType.value.toString()); + if (propType) { + return (0, util_1.isNullableType)(propType); + } + } + const typeName = (0, util_1.getTypeName)(checker, propertyType); + return checker + .getIndexInfosOfType(objType) + .some(info => (0, util_1.getTypeName)(checker, info.keyType) === typeName); + } + // Checks whether a member expression is nullable or not regardless of it's previous node. + // Example: + // ``` + // // 'bar' is nullable if 'foo' is null. + // // but this function checks regardless of 'foo' type, so returns 'true'. + // declare const foo: { bar : { baz: string } } | null + // foo?.bar; + // ``` + function isMemberExpressionNullableOriginFromObject(node) { + const prevType = (0, util_1.getConstrainedTypeAtLocation)(services, node.object); + const property = node.property; + if (prevType.isUnion() && (0, util_1.isIdentifier)(property)) { + const isOwnNullable = prevType.types.some(type => { + if (node.computed) { + const propertyType = (0, util_1.getConstrainedTypeAtLocation)(services, node.property); + return isNullablePropertyType(type, propertyType); + } + const propType = (0, util_1.getTypeOfPropertyOfName)(checker, type, property.name); + if (propType) { + return (0, util_1.isNullableType)(propType); + } + const indexInfo = checker.getIndexInfosOfType(type); + return indexInfo.some(info => { + const isStringTypeName = (0, util_1.getTypeName)(checker, info.keyType) === 'string'; + return (isStringTypeName && + (isNoUncheckedIndexedAccess || (0, util_1.isNullableType)(info.type))); + }); + }); + return !isOwnNullable && (0, util_1.isNullableType)(prevType); + } + return false; + } + function isCallExpressionNullableOriginFromCallee(node) { + const prevType = (0, util_1.getConstrainedTypeAtLocation)(services, node.callee); + if (prevType.isUnion()) { + const isOwnNullable = prevType.types.some(type => { + const signatures = type.getCallSignatures(); + return signatures.some(sig => (0, util_1.isNullableType)(sig.getReturnType())); + }); + return !isOwnNullable && (0, util_1.isNullableType)(prevType); + } + return false; + } + function isOptionableExpression(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + const isOwnNullable = node.type === utils_1.AST_NODE_TYPES.MemberExpression + ? !isMemberExpressionNullableOriginFromObject(node) + : node.type === utils_1.AST_NODE_TYPES.CallExpression + ? !isCallExpressionNullableOriginFromCallee(node) + : true; + return (isConditionalAlwaysNecessary(type) || + (isOwnNullable && (0, util_1.isNullableType)(type))); + } + function checkOptionalChain(node, beforeOperator, fix) { + // We only care if this step in the chain is optional. If just descend + // from an optional chain, then that's fine. + if (!node.optional) { + return; + } + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (optionChainContainsOptionArrayIndex(node)) { + return; + } + const nodeToCheck = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object; + if (isOptionableExpression(nodeToCheck)) { + return; + } + const questionDotOperator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(beforeOperator, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '?.'), util_1.NullThrowsReasons.MissingToken('operator', node.type)); + context.report({ + loc: questionDotOperator.loc, + node, + messageId: 'neverOptionalChain', + fix(fixer) { + return fixer.replaceText(questionDotOperator, fix); + }, + }); + } + function checkOptionalMemberExpression(node) { + checkOptionalChain(node, node.object, node.computed ? '' : '.'); + } + function checkOptionalCallExpression(node) { + checkOptionalChain(node, node.callee, ''); + } + function checkAssignmentExpression(node) { + // Similar to checkLogicalExpressionForUnnecessaryConditionals, since + // a ||= b is equivalent to a || (a = b) + if (['&&=', '||='].includes(node.operator)) { + checkNode(node.left); + } + else if (node.operator === '??=') { + checkNodeForNullish(node.left); + } + } + return { + AssignmentExpression: checkAssignmentExpression, + BinaryExpression(node) { + const { operator } = node; + if (isBoolOperator(operator)) { + checkIfBoolExpressionIsNecessaryConditional(node, node.left, node.right, operator); + } + }, + CallExpression: checkCallExpression, + 'CallExpression[optional = true]': checkOptionalCallExpression, + ConditionalExpression: (node) => checkNode(node.test), + DoWhileStatement: checkIfLoopIsNecessaryConditional, + ForStatement: checkIfLoopIsNecessaryConditional, + IfStatement: (node) => checkNode(node.test), + LogicalExpression: checkLogicalExpressionForUnnecessaryConditionals, + 'MemberExpression[optional = true]': checkOptionalMemberExpression, + SwitchCase({ parent, test }) { + // only check `case ...:`, not `default:` + if (test) { + checkIfBoolExpressionIsNecessaryConditional(test, parent.discriminant, test, '==='); + } + }, + WhileStatement: checkIfWhileLoopIsNecessaryConditional, + }; + }, +}); +function normalizeAllowConstantLoopConditions(allowConstantLoopConditions) { + if (allowConstantLoopConditions === true) { + return 'always'; + } + if (allowConstantLoopConditions === false) { + return 'never'; + } + return allowConstantLoopConditions; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.d.ts.map new file mode 100644 index 0000000..27dc2f2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-parameter-property-assignment.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-parameter-property-assignment.ts"],"names":[],"mappings":";AASA,wBA8NG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.js new file mode 100644 index 0000000..c62b9ea --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.js @@ -0,0 +1,149 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const UNNECESSARY_OPERATORS = new Set(['??=', '&&=', '=', '||=']); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-parameter-property-assignment', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary assignment of constructor property parameter', + }, + messages: { + unnecessaryAssign: 'This assignment is unnecessary since it is already assigned by a parameter property.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const reportInfoStack = []; + function isThisMemberExpression(node) { + return (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.object.type === utils_1.AST_NODE_TYPES.ThisExpression); + } + function getPropertyName(node) { + if (!isThisMemberExpression(node)) { + return null; + } + if (node.property.type === utils_1.AST_NODE_TYPES.Identifier) { + return node.property.name; + } + if (node.computed) { + return (0, util_1.getStaticStringValue)(node.property); + } + return null; + } + function findParentFunction(node) { + if (!node || + node.type === utils_1.AST_NODE_TYPES.FunctionDeclaration || + node.type === utils_1.AST_NODE_TYPES.FunctionExpression || + node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + return node; + } + return findParentFunction(node.parent); + } + function findParentPropertyDefinition(node) { + if (!node || node.type === utils_1.AST_NODE_TYPES.PropertyDefinition) { + return node; + } + return findParentPropertyDefinition(node.parent); + } + function isConstructorFunctionExpression(node) { + return (node?.type === utils_1.AST_NODE_TYPES.FunctionExpression && + utils_1.ASTUtils.isConstructor(node.parent)); + } + function isReferenceFromParameter(node) { + const scope = context.sourceCode.getScope(node); + const rightRef = scope.references.find(ref => ref.identifier.name === node.name); + return rightRef?.resolved?.defs.at(0)?.type === scope_manager_1.DefinitionType.Parameter; + } + function isParameterPropertyWithName(node, name) { + return (node.type === utils_1.AST_NODE_TYPES.TSParameterProperty && + ((node.parameter.type === utils_1.AST_NODE_TYPES.Identifier && // constructor (public foo) {} + node.parameter.name === name) || + (node.parameter.type === utils_1.AST_NODE_TYPES.AssignmentPattern && // constructor (public foo = 1) {} + node.parameter.left.type === utils_1.AST_NODE_TYPES.Identifier && + node.parameter.left.name === name))); + } + function getIdentifier(node) { + if (node.type === utils_1.AST_NODE_TYPES.Identifier) { + return node; + } + if (node.type === utils_1.AST_NODE_TYPES.TSAsExpression || + node.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) { + return getIdentifier(node.expression); + } + return null; + } + function isArrowIIFE(node) { + return (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.parent.type === utils_1.AST_NODE_TYPES.CallExpression); + } + return { + ClassBody() { + reportInfoStack.push({ + assignedBeforeConstructor: new Set(), + assignedBeforeUnnecessary: new Set(), + unnecessaryAssignments: [], + }); + }, + 'ClassBody:exit'() { + const { assignedBeforeConstructor, unnecessaryAssignments } = (0, util_1.nullThrows)(reportInfoStack.pop(), 'The top stack should exist'); + unnecessaryAssignments.forEach(({ name, node }) => { + if (assignedBeforeConstructor.has(name)) { + return; + } + context.report({ + node, + messageId: 'unnecessaryAssign', + }); + }); + }, + "MethodDefinition[kind='constructor'] > FunctionExpression AssignmentExpression"(node) { + const leftName = getPropertyName(node.left); + if (!leftName) { + return; + } + let functionNode = findParentFunction(node); + if (functionNode && isArrowIIFE(functionNode)) { + functionNode = findParentFunction(functionNode.parent); + } + if (!isConstructorFunctionExpression(functionNode)) { + return; + } + const { assignedBeforeUnnecessary, unnecessaryAssignments } = (0, util_1.nullThrows)(reportInfoStack.at(reportInfoStack.length - 1), 'The top of stack should exist'); + if (!UNNECESSARY_OPERATORS.has(node.operator)) { + assignedBeforeUnnecessary.add(leftName); + return; + } + const rightId = getIdentifier(node.right); + if (leftName !== rightId?.name || !isReferenceFromParameter(rightId)) { + return; + } + const hasParameterProperty = functionNode.params.some(param => isParameterPropertyWithName(param, rightId.name)); + if (hasParameterProperty && !assignedBeforeUnnecessary.has(leftName)) { + unnecessaryAssignments.push({ + name: leftName, + node, + }); + } + }, + 'PropertyDefinition AssignmentExpression'(node) { + const name = getPropertyName(node.left); + if (!name) { + return; + } + const functionNode = findParentFunction(node); + if (functionNode && + !(isArrowIIFE(functionNode) && + findParentPropertyDefinition(node)?.value === functionNode.parent)) { + return; + } + const { assignedBeforeConstructor } = (0, util_1.nullThrows)(reportInfoStack.at(-1), 'The top stack should exist'); + assignedBeforeConstructor.add(name); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.d.ts.map new file mode 100644 index 0000000..359a0b3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-qualifier.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-qualifier.ts"],"names":[],"mappings":";AAQA,wBAuLG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js new file mode 100644 index 0000000..bd0d2fb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js @@ -0,0 +1,156 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-qualifier', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary namespace qualifiers', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + unnecessaryQualifier: "Qualifier is unnecessary since '{{ name }}' is in scope.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const namespacesInScope = []; + let currentFailedNamespaceExpression = null; + const services = (0, util_1.getParserServices)(context); + const esTreeNodeToTSNodeMap = services.esTreeNodeToTSNodeMap; + const checker = services.program.getTypeChecker(); + function tryGetAliasedSymbol(symbol, checker) { + return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : null; + } + function symbolIsNamespaceInScope(symbol) { + const symbolDeclarations = symbol.getDeclarations() ?? []; + if (symbolDeclarations.some(decl => namespacesInScope.some(ns => ns === decl))) { + return true; + } + const alias = tryGetAliasedSymbol(symbol, checker); + return alias != null && symbolIsNamespaceInScope(alias); + } + function getSymbolInScope(node, flags, name) { + const scope = checker.getSymbolsInScope(node, flags); + return scope.find(scopeSymbol => scopeSymbol.name === name); + } + function symbolsAreEqual(accessed, inScope) { + return accessed === checker.getExportSymbolOfSymbol(inScope); + } + function qualifierIsUnnecessary(qualifier, name) { + const namespaceSymbol = services.getSymbolAtLocation(qualifier); + if (namespaceSymbol == null || + !symbolIsNamespaceInScope(namespaceSymbol)) { + return false; + } + const accessedSymbol = services.getSymbolAtLocation(name); + if (accessedSymbol == null) { + return false; + } + // If the symbol in scope is different, the qualifier is necessary. + const tsQualifier = esTreeNodeToTSNodeMap.get(qualifier); + const fromScope = getSymbolInScope(tsQualifier, accessedSymbol.flags, context.sourceCode.getText(name)); + return !!fromScope && symbolsAreEqual(accessedSymbol, fromScope); + } + function visitNamespaceAccess(node, qualifier, name) { + // Only look for nested qualifier errors if we didn't already fail on the outer qualifier. + if (!currentFailedNamespaceExpression && + qualifierIsUnnecessary(qualifier, name)) { + currentFailedNamespaceExpression = node; + context.report({ + node: qualifier, + messageId: 'unnecessaryQualifier', + data: { + name: context.sourceCode.getText(name), + }, + fix(fixer) { + return fixer.removeRange([qualifier.range[0], name.range[0]]); + }, + }); + } + } + function enterDeclaration(node) { + namespacesInScope.push(esTreeNodeToTSNodeMap.get(node)); + } + function exitDeclaration() { + namespacesInScope.pop(); + } + function resetCurrentNamespaceExpression(node) { + if (node === currentFailedNamespaceExpression) { + currentFailedNamespaceExpression = null; + } + } + function isPropertyAccessExpression(node) { + return node.type === utils_1.AST_NODE_TYPES.MemberExpression && !node.computed; + } + function isEntityNameExpression(node) { + return (node.type === utils_1.AST_NODE_TYPES.Identifier || + (isPropertyAccessExpression(node) && + isEntityNameExpression(node.object))); + } + return { + 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]': enterDeclaration, + 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit': exitDeclaration, + 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]': enterDeclaration, + 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit': exitDeclaration, + 'MemberExpression:exit': resetCurrentNamespaceExpression, + 'MemberExpression[computed=false]'(node) { + const property = node.property; + if (isEntityNameExpression(node.object)) { + visitNamespaceAccess(node, node.object, property); + } + }, + TSEnumDeclaration: enterDeclaration, + 'TSEnumDeclaration:exit': exitDeclaration, + 'TSModuleDeclaration:exit': exitDeclaration, + 'TSModuleDeclaration > TSModuleBlock'(node) { + enterDeclaration(node.parent); + }, + TSQualifiedName(node) { + visitNamespaceAccess(node, node.left, node.right); + }, + 'TSQualifiedName:exit': resetCurrentNamespaceExpression, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.d.ts.map new file mode 100644 index 0000000..151150c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-template-expression.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-template-expression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAmBzD,MAAM,MAAM,SAAS,GAAG,iCAAiC,CAAC;;AAuB1D,wBAmbG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.js new file mode 100644 index 0000000..4d3e278 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.js @@ -0,0 +1,361 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const rangeToLoc_1 = require("../util/rangeToLoc"); +const evenNumOfBackslashesRegExp = /(? { + const symbol = t.getSymbol(); + return !!(symbol?.valueDeclaration && ts.isEnumMember(symbol.valueDeclaration)); + }); + } + const isLiteral = (0, util_1.isNodeOfType)(utils_1.TSESTree.AST_NODE_TYPES.Literal); + function isTemplateLiteral(node) { + return node.type === utils_1.AST_NODE_TYPES.TemplateLiteral; + } + function isInfinityIdentifier(node) { + return (node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === 'Infinity'); + } + function isNaNIdentifier(node) { + return node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === 'NaN'; + } + function isFixableIdentifier(node) { + return ((0, util_1.isUndefinedIdentifier)(node) || + isInfinityIdentifier(node) || + isNaNIdentifier(node)); + } + function hasCommentsBetweenQuasi(startQuasi, endQuasi) { + const startToken = (0, util_1.nullThrows)(context.sourceCode.getTokenByRangeStart(startQuasi.range[0]), util_1.NullThrowsReasons.MissingToken('`${', 'opening template literal')); + const endToken = (0, util_1.nullThrows)(context.sourceCode.getTokenByRangeStart(endQuasi.range[0]), util_1.NullThrowsReasons.MissingToken('}', 'closing template literal')); + return context.sourceCode.commentsExistBetween(startToken, endToken); + } + function isTrivialInterpolation(node) { + return (node.quasis.length === 2 && + node.quasis[0].value.raw === '' && + node.quasis[1].value.raw === ''); + } + function getInterpolations(node) { + if (node.type === utils_1.AST_NODE_TYPES.TemplateLiteral) { + return node.expressions; + } + return node.types; + } + function getInterpolationInfos(node) { + return getInterpolations(node).map((interpolation, index) => ({ + interpolation, + nextQuasi: node.quasis[index + 1], + prevQuasi: node.quasis[index], + })); + } + function getLiteral(node) { + const maybeLiteral = node.type === utils_1.AST_NODE_TYPES.TSLiteralType ? node.literal : node; + return isLiteral(maybeLiteral) ? maybeLiteral : null; + } + function getTemplateLiteral(node) { + const maybeTemplateLiteral = node.type === utils_1.AST_NODE_TYPES.TSLiteralType ? node.literal : node; + return isTemplateLiteral(maybeTemplateLiteral) + ? maybeTemplateLiteral + : null; + } + function reportSingleInterpolation(node) { + const interpolations = getInterpolations(node); + context.report({ + loc: (0, rangeToLoc_1.rangeToLoc)(context.sourceCode, [ + interpolations[0].range[0] - 2, + interpolations[0].range[1] + 1, + ]), + messageId: 'noUnnecessaryTemplateExpression', + fix(fixer) { + const wrappingCode = (0, util_1.getMovedNodeCode)({ + destinationNode: node, + nodeToMove: interpolations[0], + sourceCode: context.sourceCode, + }); + return fixer.replaceText(node, wrappingCode); + }, + }); + } + function isUnncessaryValueInterpolation({ interpolation, nextQuasi, prevQuasi, }) { + if (hasCommentsBetweenQuasi(prevQuasi, nextQuasi)) { + return false; + } + if (isFixableIdentifier(interpolation)) { + return true; + } + if (isLiteral(interpolation)) { + // allow trailing whitespace literal + if (startsWithNewLine(nextQuasi.value.raw)) { + return !(typeof interpolation.value === 'string' && + isWhitespace(interpolation.value)); + } + return true; + } + if (isTemplateLiteral(interpolation)) { + // allow trailing whitespace literal + if (startsWithNewLine(nextQuasi.value.raw)) { + return !(interpolation.quasis.length === 1 && + isWhitespace(interpolation.quasis[0].value.raw)); + } + return true; + } + return false; + } + function isUnncessaryTypeInterpolation({ interpolation, nextQuasi, prevQuasi, }) { + if (hasCommentsBetweenQuasi(prevQuasi, nextQuasi)) { + return false; + } + const literal = getLiteral(interpolation); + if (literal) { + // allow trailing whitespace literal + if (startsWithNewLine(nextQuasi.value.raw)) { + return !(typeof literal.value === 'string' && isWhitespace(literal.value)); + } + return true; + } + if (interpolation.type === utils_1.AST_NODE_TYPES.TSNullKeyword || + interpolation.type === utils_1.AST_NODE_TYPES.TSUndefinedKeyword) { + return true; + } + const templateLiteral = getTemplateLiteral(interpolation); + if (templateLiteral) { + // allow trailing whitespace literal + if (startsWithNewLine(nextQuasi.value.raw)) { + return !(templateLiteral.quasis.length === 1 && + isWhitespace(templateLiteral.quasis[0].value.raw)); + } + return true; + } + return false; + } + function getReportDescriptors(infos) { + let nextCharacterIsOpeningCurlyBrace = false; + const reportDescriptors = []; + const reversedInfos = [...infos].reverse(); + for (const { interpolation, nextQuasi, prevQuasi } of reversedInfos) { + const fixers = []; + if (nextQuasi.value.raw !== '') { + nextCharacterIsOpeningCurlyBrace = + nextQuasi.value.raw.startsWith('{'); + } + const literal = getLiteral(interpolation); + const templateLiteral = getTemplateLiteral(interpolation); + if (literal) { + let escapedValue = (typeof literal.value === 'string' + ? // The value is already a string, so we're removing quotes: + // "'va`lue'" -> "va`lue" + literal.raw.slice(1, -1) + : // The value may be one of number | bigint | boolean | RegExp | null. + // In regular expressions, we escape every backslash + String(literal.value).replaceAll('\\', '\\\\')) + // The string or RegExp may contain ` or ${. + // We want both of these to be escaped in the final template expression. + // + // A pair of backslashes means "escaped backslash", so backslashes + // from this pair won't escape ` or ${. Therefore, to escape these + // sequences in the resulting template expression, we need to escape + // all sequences that are preceded by an even number of backslashes. + // + // This RegExp does the following transformations: + // \` -> \` + // \\` -> \\\` + // \${ -> \${ + // \\${ -> \\\${ + .replaceAll(new RegExp(`${String(evenNumOfBackslashesRegExp.source)}(\`|\\\${)`, 'g'), '\\$1'); + // `...${'...$'}{...` + // ^^^^ + if (nextCharacterIsOpeningCurlyBrace && + endsWithUnescapedDollarSign(escapedValue)) { + escapedValue = escapedValue.replaceAll(/\$$/g, '\\$'); + } + if (escapedValue.length !== 0) { + nextCharacterIsOpeningCurlyBrace = escapedValue.startsWith('{'); + } + fixers.push(fixer => [fixer.replaceText(literal, escapedValue)]); + } + else if (templateLiteral) { + // Since we iterate from the last expression to the first, + // a subsequent expression can tell the current expression + // that it starts with {. + // + // `... ${`... $`}${'{...'} ...` + // ^ ^ subsequent expression starts with { + // current expression ends with a dollar sign, + // so '$' + '{' === '${' (bad news for us). + // Let's escape the dollar sign at the end. + if (nextCharacterIsOpeningCurlyBrace && + endsWithUnescapedDollarSign(templateLiteral.quasis[templateLiteral.quasis.length - 1].value + .raw)) { + fixers.push(fixer => [ + fixer.replaceTextRange([templateLiteral.range[1] - 2, templateLiteral.range[1] - 2], '\\'), + ]); + } + if (templateLiteral.quasis.length === 1 && + templateLiteral.quasis[0].value.raw.length !== 0) { + nextCharacterIsOpeningCurlyBrace = + templateLiteral.quasis[0].value.raw.startsWith('{'); + } + // Remove the beginning and trailing backtick characters. + fixers.push(fixer => [ + fixer.removeRange([ + templateLiteral.range[0], + templateLiteral.range[0] + 1, + ]), + fixer.removeRange([ + templateLiteral.range[1] - 1, + templateLiteral.range[1], + ]), + ]); + } + else { + nextCharacterIsOpeningCurlyBrace = false; + } + // `... $${'{...'} ...` + // ^^^^^ + if (nextCharacterIsOpeningCurlyBrace && + endsWithUnescapedDollarSign(prevQuasi.value.raw)) { + fixers.push(fixer => [ + fixer.replaceTextRange([prevQuasi.range[1] - 3, prevQuasi.range[1] - 2], '\\$'), + ]); + } + const warnLocStart = prevQuasi.range[1] - 2; + const warnLocEnd = nextQuasi.range[0] + 1; + reportDescriptors.push({ + loc: (0, rangeToLoc_1.rangeToLoc)(context.sourceCode, [warnLocStart, warnLocEnd]), + messageId: 'noUnnecessaryTemplateExpression', + fix(fixer) { + return [ + // Remove the quasis' parts that are related to the current expression. + fixer.removeRange([warnLocStart, interpolation.range[0]]), + fixer.removeRange([interpolation.range[1], warnLocEnd]), + ...fixers.flatMap(cb => cb(fixer)), + ]; + }, + }); + } + return reportDescriptors; + } + return { + TemplateLiteral(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + return; + } + if (isTrivialInterpolation(node) && + !hasCommentsBetweenQuasi(node.quasis[0], node.quasis[1])) { + const { constraintType } = (0, util_1.getConstraintInfo)(checker, services.getTypeAtLocation(node.expressions[0])); + if (constraintType && isUnderlyingTypeString(constraintType)) { + reportSingleInterpolation(node); + return; + } + } + const infos = getInterpolationInfos(node).filter(isUnncessaryValueInterpolation); + for (const reportDescriptor of getReportDescriptors(infos)) { + context.report(reportDescriptor); + } + }, + TSTemplateLiteralType(node) { + if (isTrivialInterpolation(node) && + !hasCommentsBetweenQuasi(node.quasis[0], node.quasis[1])) { + const { constraintType, isTypeParameter } = (0, util_1.getConstraintInfo)(checker, services.getTypeAtLocation(node.types[0])); + if (constraintType && + !isTypeParameter && + isUnderlyingTypeString(constraintType) && + !isEnumMemberType(constraintType)) { + reportSingleInterpolation(node); + return; + } + } + const infos = getInterpolationInfos(node).filter(isUnncessaryTypeInterpolation); + for (const reportDescriptor of getReportDescriptors(infos)) { + context.report(reportDescriptor); + } + }, + }; + }, +}); +function isWhitespace(x) { + // allow empty string too since we went to allow + // ` ${''} + // `; + // + // in addition to + // `${' '} + // `; + // + return /^\s*$/.test(x); +} +function startsWithNewLine(x) { + return x.startsWith('\n') || x.startsWith('\r\n'); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.d.ts.map new file mode 100644 index 0000000..3aea5c1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-type-arguments.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-type-arguments.ts"],"names":[],"mappings":"AAwBA,MAAM,MAAM,UAAU,GAAG,0BAA0B,CAAC;;AAEpD,wBAoGG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js new file mode 100644 index 0000000..bfbebf3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js @@ -0,0 +1,197 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-arguments', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow type arguments that are equal to the default', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + unnecessaryTypeParameter: 'This is the default value for this type parameter, so it can be omitted.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function getTypeForComparison(type) { + if ((0, util_1.isTypeReferenceType)(type)) { + return { + type: type.target, + typeArguments: checker.getTypeArguments(type), + }; + } + return { + type, + typeArguments: [], + }; + } + function checkTSArgsAndParameters(esParameters, typeParameters) { + // Just check the last one. Must specify previous type parameters if the last one is specified. + const i = esParameters.params.length - 1; + const arg = esParameters.params[i]; + const param = typeParameters.at(i); + if (!param?.default) { + return; + } + // TODO: would like checker.areTypesEquivalent. https://github.com/Microsoft/TypeScript/issues/13502 + const defaultType = checker.getTypeAtLocation(param.default); + const argType = services.getTypeAtLocation(arg); + // this check should handle some of the most simple cases of like strings, numbers, etc + if (defaultType !== argType) { + // For more complex types (like aliases to generic object types) - TS won't always create a + // global shared type object for the type - so we need to resort to manually comparing the + // reference type and the passed type arguments. + // Also - in case there are aliases - we need to resolve them before we do checks + const defaultTypeResolved = getTypeForComparison(defaultType); + const argTypeResolved = getTypeForComparison(argType); + if ( + // ensure the resolved type AND all the parameters are the same + defaultTypeResolved.type !== argTypeResolved.type || + defaultTypeResolved.typeArguments.length !== + argTypeResolved.typeArguments.length || + defaultTypeResolved.typeArguments.some((t, i) => t !== argTypeResolved.typeArguments[i])) { + return; + } + } + context.report({ + node: arg, + messageId: 'unnecessaryTypeParameter', + fix: fixer => fixer.removeRange(i === 0 + ? esParameters.range + : [esParameters.params[i - 1].range[1], arg.range[1]]), + }); + } + return { + TSTypeParameterInstantiation(node) { + const expression = services.esTreeNodeToTSNodeMap.get(node); + const typeParameters = getTypeParametersFromNode(node, expression, checker); + if (typeParameters) { + checkTSArgsAndParameters(node, typeParameters); + } + }, + }; + }, +}); +function getTypeParametersFromNode(node, tsNode, checker) { + if (ts.isExpressionWithTypeArguments(tsNode)) { + return getTypeParametersFromType(node, tsNode.expression, checker); + } + if (ts.isTypeReferenceNode(tsNode)) { + return getTypeParametersFromType(node, tsNode.typeName, checker); + } + if (ts.isCallExpression(tsNode) || + ts.isNewExpression(tsNode) || + ts.isTaggedTemplateExpression(tsNode) || + ts.isJsxOpeningElement(tsNode) || + ts.isJsxSelfClosingElement(tsNode)) { + return getTypeParametersFromCall(node, tsNode, checker); + } + return undefined; +} +function getTypeParametersFromType(node, type, checker) { + const symAtLocation = checker.getSymbolAtLocation(type); + if (!symAtLocation) { + return undefined; + } + const sym = getAliasedSymbol(symAtLocation, checker); + const declarations = sym.getDeclarations(); + if (!declarations) { + return undefined; + } + const sortedDeclaraions = sortDeclarationsByTypeValueContext(node, declarations); + return (0, util_1.findFirstResult)(sortedDeclaraions, decl => { + if (ts.isTypeAliasDeclaration(decl) || + ts.isInterfaceDeclaration(decl) || + ts.isClassLike(decl)) { + return decl.typeParameters; + } + if (ts.isVariableDeclaration(decl)) { + return getConstructSignatureDeclaration(symAtLocation, checker) + ?.typeParameters; + } + return undefined; + }); +} +function getTypeParametersFromCall(node, tsNode, checker) { + const sig = checker.getResolvedSignature(tsNode); + const sigDecl = sig?.getDeclaration(); + if (!sigDecl) { + return ts.isNewExpression(tsNode) + ? getTypeParametersFromType(node, tsNode.expression, checker) + : undefined; + } + return sigDecl.typeParameters; +} +function getAliasedSymbol(symbol, checker) { + return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : symbol; +} +function isInTypeContext(node) { + return (node.parent.type === utils_1.AST_NODE_TYPES.TSInterfaceHeritage || + node.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference || + node.parent.type === utils_1.AST_NODE_TYPES.TSClassImplements); +} +function isTypeContextDeclaration(decl) { + return ts.isTypeAliasDeclaration(decl) || ts.isInterfaceDeclaration(decl); +} +function typeFirstCompare(declA, declB) { + const aIsType = isTypeContextDeclaration(declA); + const bIsType = isTypeContextDeclaration(declB); + return Number(bIsType) - Number(aIsType); +} +function sortDeclarationsByTypeValueContext(node, declarations) { + const sorted = [...declarations].sort(typeFirstCompare); + if (isInTypeContext(node)) { + return sorted; + } + return sorted.reverse(); +} +function getConstructSignatureDeclaration(symbol, checker) { + const type = checker.getTypeOfSymbol(symbol); + const sig = type.getConstructSignatures(); + return sig.at(0)?.getDeclaration(); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.d.ts.map new file mode 100644 index 0000000..9439ec2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-type-assertion.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-type-assertion.ts"],"names":[],"mappings":"AAqBA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,yBAAyB,GAAG,sBAAsB,CAAC;;AAE5E,wBAwXG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js new file mode 100644 index 0000000..d77c940 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js @@ -0,0 +1,298 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-assertion', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow type assertions that do not change the type of an expression', + recommended: 'recommended', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + contextuallyUnnecessary: 'This assertion is unnecessary since the receiver accepts the original type of the expression.', + unnecessaryAssertion: 'This assertion is unnecessary since it does not change the type of the expression.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + typesToIgnore: { + type: 'array', + description: 'A list of type names to ignore.', + items: { + type: 'string', + }, + }, + }, + }, + ], + }, + defaultOptions: [{}], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + /** + * Returns true if there's a chance the variable has been used before a value has been assigned to it + */ + function isPossiblyUsedBeforeAssigned(node) { + const declaration = (0, util_1.getDeclaration)(services, node); + if (!declaration) { + // don't know what the declaration is for some reason, so just assume the worst + return true; + } + if ( + // non-strict mode doesn't care about used before assigned errors + tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks') && + // ignore class properties as they are compile time guarded + // also ignore function arguments as they can't be used before defined + ts.isVariableDeclaration(declaration)) { + // For var declarations, we need to check whether the node + // is actually in a descendant of its declaration or not. If not, + // it may be used before defined. + // eg + // if (Math.random() < 0.5) { + // var x: number = 2; + // } else { + // x!.toFixed(); + // } + if (ts.isVariableDeclarationList(declaration.parent) && + // var + declaration.parent.flags === ts.NodeFlags.None && + // If they are not in the same file it will not exist. + // This situation must not occur using before defined. + services.tsNodeToESTreeNodeMap.has(declaration)) { + const declaratorNode = services.tsNodeToESTreeNodeMap.get(declaration); + const scope = context.sourceCode.getScope(node); + const declaratorScope = context.sourceCode.getScope(declaratorNode); + let parentScope = declaratorScope; + while ((parentScope = parentScope.upper)) { + if (parentScope === scope) { + return true; + } + } + } + if ( + // is it `const x!: number` + declaration.initializer == null && + declaration.exclamationToken == null && + declaration.type != null) { + // check if the defined variable type has changed since assignment + const declarationType = checker.getTypeFromTypeNode(declaration.type); + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + if (declarationType === type && + // `declare`s are never narrowed, so never skip them + !(ts.isVariableDeclarationList(declaration.parent) && + ts.isVariableStatement(declaration.parent.parent) && + tsutils.includesModifier((0, util_1.getModifiers)(declaration.parent.parent), ts.SyntaxKind.DeclareKeyword))) { + // possibly used before assigned, so just skip it + // better to false negative and skip it, than false positive and fix to compile erroring code + // + // no better way to figure this out right now + // https://github.com/Microsoft/TypeScript/issues/31124 + return true; + } + } + } + return false; + } + function isConstAssertion(node) { + return (node.type === utils_1.AST_NODE_TYPES.TSTypeReference && + node.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + node.typeName.name === 'const'); + } + function isTemplateLiteralWithExpressions(expression) { + return (expression.type === utils_1.AST_NODE_TYPES.TemplateLiteral && + expression.expressions.length !== 0); + } + function isImplicitlyNarrowedLiteralDeclaration({ expression, parent, }) { + /** + * Even on `const` variable declarations, template literals with expressions can sometimes be widened without a type assertion. + * @see https://github.com/typescript-eslint/typescript-eslint/issues/8737 + */ + if (isTemplateLiteralWithExpressions(expression)) { + return false; + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const maybeDeclarationNode = parent.parent; + return ((maybeDeclarationNode.type === utils_1.AST_NODE_TYPES.VariableDeclaration && + maybeDeclarationNode.kind === 'const') || + (parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition && parent.readonly)); + } + function isTypeUnchanged(uncast, cast) { + if (uncast === cast) { + return true; + } + if ((0, util_1.isTypeFlagSet)(uncast, ts.TypeFlags.Undefined) && + (0, util_1.isTypeFlagSet)(cast, ts.TypeFlags.Undefined) && + tsutils.isCompilerOptionEnabled(compilerOptions, 'exactOptionalPropertyTypes')) { + const uncastParts = tsutils + .unionTypeParts(uncast) + .filter(part => !(0, util_1.isTypeFlagSet)(part, ts.TypeFlags.Undefined)); + const castParts = tsutils + .unionTypeParts(cast) + .filter(part => !(0, util_1.isTypeFlagSet)(part, ts.TypeFlags.Undefined)); + if (uncastParts.length !== castParts.length) { + return false; + } + const uncastPartsSet = new Set(uncastParts); + return castParts.every(part => uncastPartsSet.has(part)); + } + return false; + } + return { + 'TSAsExpression, TSTypeAssertion'(node) { + if (options.typesToIgnore?.includes(context.sourceCode.getText(node.typeAnnotation))) { + return; + } + const castType = services.getTypeAtLocation(node); + const uncastType = services.getTypeAtLocation(node.expression); + const typeIsUnchanged = isTypeUnchanged(uncastType, castType); + const wouldSameTypeBeInferred = castType.isLiteral() + ? isImplicitlyNarrowedLiteralDeclaration(node) + : !isConstAssertion(node.typeAnnotation); + if (typeIsUnchanged && wouldSameTypeBeInferred) { + context.report({ + node, + messageId: 'unnecessaryAssertion', + fix(fixer) { + if (node.type === utils_1.AST_NODE_TYPES.TSTypeAssertion) { + const openingAngleBracket = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(node.typeAnnotation, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '<'), util_1.NullThrowsReasons.MissingToken('<', 'type annotation')); + const closingAngleBracket = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.typeAnnotation, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '>'), util_1.NullThrowsReasons.MissingToken('>', 'type annotation')); + // < ( number ) > ( 3 + 5 ) + // ^---remove---^ + return fixer.removeRange([ + openingAngleBracket.range[0], + closingAngleBracket.range[1], + ]); + } + // `as` is always present in TSAsExpression + const asToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.expression, token => token.type === utils_1.AST_TOKEN_TYPES.Identifier && + token.value === 'as'), util_1.NullThrowsReasons.MissingToken('>', 'type annotation')); + const tokenBeforeAs = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(asToken, { + includeComments: true, + }), util_1.NullThrowsReasons.MissingToken('comment', 'as')); + // ( 3 + 5 ) as number + // ^--remove--^ + return fixer.removeRange([tokenBeforeAs.range[1], node.range[1]]); + }, + }); + } + // TODO - add contextually unnecessary check for this + }, + TSNonNullExpression(node) { + const removeExclamationFix = fixer => { + const exclamationToken = (0, util_1.nullThrows)(context.sourceCode.getLastToken(node, token => token.value === '!'), util_1.NullThrowsReasons.MissingToken('exclamation mark', 'non-null assertion')); + return fixer.removeRange(exclamationToken.range); + }; + if (node.parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + node.parent.operator === '=') { + if (node.parent.left === node) { + context.report({ + node, + messageId: 'contextuallyUnnecessary', + fix: removeExclamationFix, + }); + } + // for all other = assignments we ignore non-null checks + // this is because non-null assertions can change the type-flow of the code + // so whilst they might be unnecessary for the assignment - they are necessary + // for following code + return; + } + const originalNode = services.esTreeNodeToTSNodeMap.get(node); + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node.expression); + if (!(0, util_1.isNullableType)(type)) { + if (node.expression.type === utils_1.AST_NODE_TYPES.Identifier && + isPossiblyUsedBeforeAssigned(node.expression)) { + return; + } + context.report({ + node, + messageId: 'unnecessaryAssertion', + fix: removeExclamationFix, + }); + } + else { + // we know it's a nullable type + // so figure out if the variable is used in a place that accepts nullable types + const contextualType = (0, util_1.getContextualType)(checker, originalNode); + if (contextualType) { + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Unknown) && + !(0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Unknown)) { + return; + } + // in strict mode you can't assign null to undefined, so we have to make sure that + // the two types share a nullable type + const typeIncludesUndefined = (0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Undefined); + const typeIncludesNull = (0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Null); + const typeIncludesVoid = (0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Void); + const contextualTypeIncludesUndefined = (0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Undefined); + const contextualTypeIncludesNull = (0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Null); + const contextualTypeIncludesVoid = (0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Void); + // make sure that the parent accepts the same types + // i.e. assigning `string | null | undefined` to `string | undefined` is invalid + const isValidUndefined = typeIncludesUndefined + ? contextualTypeIncludesUndefined + : true; + const isValidNull = typeIncludesNull + ? contextualTypeIncludesNull + : true; + const isValidVoid = typeIncludesVoid + ? contextualTypeIncludesVoid + : true; + if (isValidUndefined && isValidNull && isValidVoid) { + context.report({ + node, + messageId: 'contextuallyUnnecessary', + fix: removeExclamationFix, + }); + } + } + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.d.ts.map new file mode 100644 index 0000000..85d6598 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-type-constraint.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-type-constraint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAenE,wBAsGG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js new file mode 100644 index 0000000..adb49ee --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js @@ -0,0 +1,119 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const node_path_1 = require("node:path"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-constraint', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary constraints on generic types', + recommended: 'recommended', + }, + hasSuggestions: true, + messages: { + removeUnnecessaryConstraint: 'Remove the unnecessary `{{constraint}}` constraint.', + unnecessaryConstraint: 'Constraining the generic type `{{name}}` to `{{constraint}}` does nothing and is unnecessary.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + // In theory, we could use the type checker for more advanced constraint types... + // ...but in practice, these types are rare, and likely not worth requiring type info. + // https://github.com/typescript-eslint/typescript-eslint/pull/2516#discussion_r495731858 + const unnecessaryConstraints = new Map([ + [utils_1.AST_NODE_TYPES.TSAnyKeyword, 'any'], + [utils_1.AST_NODE_TYPES.TSUnknownKeyword, 'unknown'], + ]); + function checkRequiresGenericDeclarationDisambiguation(filename) { + const pathExt = (0, node_path_1.extname)(filename).toLocaleLowerCase(); + switch (pathExt) { + case ts.Extension.Cts: + case ts.Extension.Mts: + case ts.Extension.Tsx: + return true; + default: + return false; + } + } + const requiresGenericDeclarationDisambiguation = checkRequiresGenericDeclarationDisambiguation(context.filename); + const checkNode = (node, inArrowFunction) => { + const constraint = unnecessaryConstraints.get(node.constraint.type); + function shouldAddTrailingComma() { + if (!inArrowFunction || !requiresGenericDeclarationDisambiguation) { + return false; + } + // Only () => {} would need trailing comma + return (node.parent.params.length === + 1 && + context.sourceCode.getTokensAfter(node)[0].value !== ',' && + !node.default); + } + if (constraint) { + context.report({ + node, + messageId: 'unnecessaryConstraint', + data: { + name: node.name.name, + constraint, + }, + suggest: [ + { + messageId: 'removeUnnecessaryConstraint', + data: { + constraint, + }, + fix(fixer) { + return fixer.replaceTextRange([node.name.range[1], node.constraint.range[1]], shouldAddTrailingComma() ? ',' : ''); + }, + }, + ], + }); + } + }; + return { + ':not(ArrowFunctionExpression) > TSTypeParameterDeclaration > TSTypeParameter[constraint]'(node) { + checkNode(node, false); + }, + 'ArrowFunctionExpression > TSTypeParameterDeclaration > TSTypeParameter[constraint]'(node) { + checkNode(node, true); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.d.ts.map new file mode 100644 index 0000000..c5e7d8f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-type-parameters.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-type-parameters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAoBnE,wBAqLG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.js new file mode 100644 index 0000000..1442a27 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.js @@ -0,0 +1,401 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-parameters', + meta: { + type: 'problem', + docs: { + description: "Disallow type parameters that aren't used multiple times", + recommended: 'strict', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + replaceUsagesWithConstraint: 'Replace all usages of type parameter with its constraint.', + sole: 'Type parameter {{name}} is {{uses}} in the {{descriptor}} signature.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const parserServices = (0, util_1.getParserServices)(context); + function checkNode(node, descriptor) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const checker = parserServices.program.getTypeChecker(); + let counts; + // Get the scope in which the type parameters are declared. + const scope = context.sourceCode.getScope(node); + for (const typeParameter of tsNode.typeParameters) { + const esTypeParameter = parserServices.tsNodeToESTreeNodeMap.get(typeParameter); + const smTypeParameterVariable = (0, util_1.nullThrows)((() => { + const variable = scope.set.get(esTypeParameter.name.name); + return variable?.isTypeVariable ? variable : undefined; + })(), "Type parameter should be present in scope's variables."); + // Quick path: if the type parameter is used multiple times in the AST, + // we don't need to dip into types to know it's repeated. + if (isTypeParameterRepeatedInAST(esTypeParameter, smTypeParameterVariable.references, node.body?.range[0] ?? node.returnType?.range[1])) { + continue; + } + // For any inferred types, we have to dip into type checking. + counts ??= countTypeParameterUsage(checker, tsNode); + const identifierCounts = counts.get(typeParameter.name); + if (!identifierCounts || identifierCounts > 2) { + continue; + } + context.report({ + node: esTypeParameter, + messageId: 'sole', + data: { + name: typeParameter.name.text, + descriptor, + uses: identifierCounts === 1 ? 'never used' : 'used only once', + }, + suggest: [ + { + messageId: 'replaceUsagesWithConstraint', + *fix(fixer) { + // Replace all the usages of the type parameter with the constraint... + const constraint = esTypeParameter.constraint; + // special case - a constraint of 'any' actually acts like 'unknown' + const constraintText = constraint != null && + constraint.type !== utils_1.AST_NODE_TYPES.TSAnyKeyword + ? context.sourceCode.getText(constraint) + : 'unknown'; + for (const reference of smTypeParameterVariable.references) { + if (reference.isTypeReference) { + const referenceNode = reference.identifier; + yield fixer.replaceText(referenceNode, constraintText); + } + } + // ...and remove the type parameter itself from the declaration. + const typeParamsNode = (0, util_1.nullThrows)(node.typeParameters, 'node should have type parameters'); + // We are assuming at this point that the reported type parameter + // is present in the inspected node's type parameters. + if (typeParamsNode.params.length === 1) { + // Remove the whole generic syntax if we're removing the only type parameter in the list. + yield fixer.remove(typeParamsNode); + } + else { + const index = typeParamsNode.params.indexOf(esTypeParameter); + if (index === 0) { + const commaAfter = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(esTypeParameter, token => token.value === ','), util_1.NullThrowsReasons.MissingToken('comma', 'type parameter list')); + const tokenAfterComma = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(commaAfter, { + includeComments: true, + }), util_1.NullThrowsReasons.MissingToken('token', 'type parameter list')); + yield fixer.removeRange([ + esTypeParameter.range[0], + tokenAfterComma.range[0], + ]); + } + else { + const commaBefore = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(esTypeParameter, token => token.value === ','), util_1.NullThrowsReasons.MissingToken('comma', 'type parameter list')); + yield fixer.removeRange([ + commaBefore.range[0], + esTypeParameter.range[1], + ]); + } + } + }, + }, + ], + }); + } + } + return { + [[ + 'ArrowFunctionExpression[typeParameters]', + 'FunctionDeclaration[typeParameters]', + 'FunctionExpression[typeParameters]', + 'TSCallSignatureDeclaration[typeParameters]', + 'TSConstructorType[typeParameters]', + 'TSDeclareFunction[typeParameters]', + 'TSEmptyBodyFunctionExpression[typeParameters]', + 'TSFunctionType[typeParameters]', + 'TSMethodSignature[typeParameters]', + ].join(', ')](node) { + checkNode(node, 'function'); + }, + [[ + 'ClassDeclaration[typeParameters]', + 'ClassExpression[typeParameters]', + ].join(', ')](node) { + checkNode(node, 'class'); + }, + }; + }, +}); +function isTypeParameterRepeatedInAST(node, references, startOfBody = Infinity) { + let total = 0; + for (const reference of references) { + // References inside the type parameter's definition don't count... + if (reference.identifier.range[0] < node.range[1] && + reference.identifier.range[1] > node.range[0]) { + continue; + } + // ...nor references that are outside the declaring signature. + if (reference.identifier.range[0] > startOfBody) { + continue; + } + // Neither do references that aren't to the same type parameter, + // namely value-land (non-type) identifiers of the type parameter's type, + // and references to different type parameters or values. + if (!reference.isTypeReference || + reference.identifier.name !== node.name.name) { + continue; + } + // If the type parameter is being used as a type argument, then we + // know the type parameter is being reused and can't be reported. + if (reference.identifier.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference) { + const grandparent = skipConstituentsUpward(reference.identifier.parent.parent); + if (grandparent.type === utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation && + grandparent.params.includes(reference.identifier.parent) && + // Array and ReadonlyArray must be handled carefully + // let's defer the check to the type-aware phase + !(grandparent.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference && + grandparent.parent.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + ['Array', 'ReadonlyArray'].includes(grandparent.parent.typeName.name))) { + return true; + } + } + total += 1; + if (total >= 2) { + return true; + } + } + return false; +} +function skipConstituentsUpward(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSIntersectionType: + case utils_1.AST_NODE_TYPES.TSUnionType: + return skipConstituentsUpward(node.parent); + default: + return node; + } +} +/** + * Count uses of type parameters in inferred return types. + * We need to resolve and analyze the inferred return type of a function + * to see whether it contains additional references to the type parameters. + * For classes, we need to do this for all their methods. + */ +function countTypeParameterUsage(checker, node) { + const counts = new Map(); + if (ts.isClassLike(node)) { + for (const typeParameter of node.typeParameters) { + collectTypeParameterUsageCounts(checker, typeParameter, counts, true); + } + for (const member of node.members) { + collectTypeParameterUsageCounts(checker, member, counts, true); + } + } + else { + collectTypeParameterUsageCounts(checker, node, counts, false); + } + return counts; +} +/** + * Populates {@link foundIdentifierUsages} by the number of times each type parameter + * appears in the given type by checking its uses through its type references. + * This is essentially a limited subset of the scope manager, but for types. + */ +function collectTypeParameterUsageCounts(checker, node, foundIdentifierUsages, fromClass) { + const visitedSymbolLists = new Set(); + const type = checker.getTypeAtLocation(node); + const typeUsages = new Map(); + const visitedConstraints = new Set(); + let functionLikeType = false; + let visitedDefault = false; + if (ts.isCallSignatureDeclaration(node) || + ts.isConstructorDeclaration(node)) { + functionLikeType = true; + visitSignature(checker.getSignatureFromDeclaration(node)); + } + if (!functionLikeType) { + visitType(type, false); + } + function visitType(type, assumeMultipleUses, isReturnType = false) { + // Seeing the same type > (threshold=3 ** 2) times indicates a likely + // recursive type, like `type T = { [P in keyof T]: T }`. + // If it's not recursive, then heck, we've seen it enough times that any + // referenced types have been counted enough to qualify as used. + if (!type || incrementTypeUsages(type) > 9) { + return; + } + if (tsutils.isTypeParameter(type)) { + const declaration = type.getSymbol()?.getDeclarations()?.[0]; + if (declaration) { + incrementIdentifierCount(declaration.name, assumeMultipleUses); + // Visiting the type of a constrained type parameter will recurse into + // the constraint. We avoid infinite loops by visiting each only once. + if (declaration.constraint && + !visitedConstraints.has(declaration.constraint)) { + visitedConstraints.add(declaration.constraint); + visitType(checker.getTypeAtLocation(declaration.constraint), false); + } + if (declaration.default && !visitedDefault) { + visitedDefault = true; + visitType(checker.getTypeAtLocation(declaration.default), false); + } + } + } + // Catch-all: generic type references like `Exclude` + else if (type.aliasTypeArguments) { + // We don't descend into the definition of the type alias, so we don't + // know whether it's used multiple times. It's safest to assume it is. + visitTypesList(type.aliasTypeArguments, true); + } + // Intersections and unions like `0 | 1` + else if (tsutils.isUnionOrIntersectionType(type)) { + visitTypesList(type.types, assumeMultipleUses); + } + // Index access types like `T[K]` + else if (tsutils.isIndexedAccessType(type)) { + visitType(type.objectType, assumeMultipleUses); + visitType(type.indexType, assumeMultipleUses); + } + // Tuple types like `[K, V]` + // Generic type references like `Map` + else if (tsutils.isTypeReference(type)) { + for (const typeArgument of type.typeArguments ?? []) { + // currently, if we are in a "class context", everything is accepted + let thisAssumeMultipleUses = fromClass || assumeMultipleUses; + // special cases - readonly arrays/tuples are considered only to use the + // type parameter once. Mutable arrays/tuples are considered to use the + // type parameter multiple times if and only if they are returned. + // other kind of type references always count as multiple uses + thisAssumeMultipleUses ||= tsutils.isTupleType(type.target) + ? isReturnType && !type.target.readonly + : checker.isArrayType(type.target) + ? isReturnType && + type.symbol?.getName() === 'Array' + : true; + visitType(typeArgument, thisAssumeMultipleUses, isReturnType); + } + } + // Template literals like `a${T}b` + else if (tsutils.isTemplateLiteralType(type)) { + for (const subType of type.types) { + visitType(subType, assumeMultipleUses); + } + } + // Conditional types like `T extends string ? T : never` + else if (tsutils.isConditionalType(type)) { + visitType(type.checkType, assumeMultipleUses); + visitType(type.extendsType, assumeMultipleUses); + } + // Catch-all: inferred object types like `{ K: V }`. + // These catch-alls should be _after_ more specific checks like + // `isTypeReference` to avoid descending into all the properties of a + // generic interface/class, e.g. `Map`. + else if (tsutils.isObjectType(type)) { + const properties = type.getProperties(); + visitSymbolsListOnce(properties, false); + if (isMappedType(type)) { + visitType(type.typeParameter, false); + if (properties.length === 0) { + // TS treats mapped types like `{[k in "a"]: T}` like `{a: T}`. + // They have properties, so we need to avoid double-counting. + visitType(type.templateType ?? type.constraintType, false); + } + } + visitType(type.getNumberIndexType(), true); + visitType(type.getStringIndexType(), true); + type.getCallSignatures().forEach(signature => { + functionLikeType = true; + visitSignature(signature); + }); + type.getConstructSignatures().forEach(signature => { + functionLikeType = true; + visitSignature(signature); + }); + } + // Catch-all: operator types like `keyof T` + else if (isOperatorType(type)) { + visitType(type.type, assumeMultipleUses); + } + } + function incrementIdentifierCount(id, assumeMultipleUses) { + const identifierCount = foundIdentifierUsages.get(id) ?? 0; + const value = assumeMultipleUses ? 2 : 1; + foundIdentifierUsages.set(id, identifierCount + value); + } + function incrementTypeUsages(type) { + const count = (typeUsages.get(type) ?? 0) + 1; + typeUsages.set(type, count); + return count; + } + function visitSignature(signature) { + if (!signature) { + return; + } + if (signature.thisParameter) { + visitType(checker.getTypeOfSymbol(signature.thisParameter), false); + } + for (const parameter of signature.parameters) { + visitType(checker.getTypeOfSymbol(parameter), false); + } + for (const typeParameter of signature.getTypeParameters() ?? []) { + visitType(typeParameter, false); + } + visitType(checker.getTypePredicateOfSignature(signature)?.type ?? + signature.getReturnType(), false, true); + } + function visitSymbolsListOnce(symbols, assumeMultipleUses) { + if (visitedSymbolLists.has(symbols)) { + return; + } + visitedSymbolLists.add(symbols); + for (const symbol of symbols) { + visitType(checker.getTypeOfSymbol(symbol), assumeMultipleUses); + } + } + function visitTypesList(types, assumeMultipleUses) { + for (const type of types) { + visitType(type, assumeMultipleUses); + } + } +} +function isMappedType(type) { + return 'typeParameter' in type; +} +function isOperatorType(type) { + return 'type' in type && !!type.type; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.d.ts.map new file mode 100644 index 0000000..5197868 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-argument.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-argument.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,UAAU,GAClB,gBAAgB,GAChB,mBAAmB,GACnB,cAAc,GACd,mBAAmB,CAAC;;AA2HxB,wBAuLG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js new file mode 100644 index 0000000..0ac4090 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js @@ -0,0 +1,272 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +var RestTypeKind; +(function (RestTypeKind) { + RestTypeKind[RestTypeKind["Array"] = 0] = "Array"; + RestTypeKind[RestTypeKind["Tuple"] = 1] = "Tuple"; + RestTypeKind[RestTypeKind["Other"] = 2] = "Other"; +})(RestTypeKind || (RestTypeKind = {})); +class FunctionSignature { + paramTypes; + restType; + hasConsumedArguments = false; + parameterTypeIndex = 0; + constructor(paramTypes, restType) { + this.paramTypes = paramTypes; + this.restType = restType; + } + static create(checker, tsNode) { + const signature = checker.getResolvedSignature(tsNode); + if (!signature) { + return null; + } + const paramTypes = []; + let restType = null; + const parameters = signature.getParameters(); + for (let i = 0; i < parameters.length; i += 1) { + const param = parameters[i]; + const type = checker.getTypeOfSymbolAtLocation(param, tsNode); + const decl = param.getDeclarations()?.[0]; + if (decl && (0, util_1.isRestParameterDeclaration)(decl)) { + // is a rest param + if (checker.isArrayType(type)) { + restType = { + type: checker.getTypeArguments(type)[0], + index: i, + kind: RestTypeKind.Array, + }; + } + else if (checker.isTupleType(type)) { + restType = { + index: i, + kind: RestTypeKind.Tuple, + typeArguments: checker.getTypeArguments(type), + }; + } + else { + restType = { + type, + index: i, + kind: RestTypeKind.Other, + }; + } + break; + } + paramTypes.push(type); + } + return new this(paramTypes, restType); + } + consumeRemainingArguments() { + this.hasConsumedArguments = true; + } + getNextParameterType() { + const index = this.parameterTypeIndex; + this.parameterTypeIndex += 1; + if (index >= this.paramTypes.length || this.hasConsumedArguments) { + if (this.restType == null) { + return null; + } + switch (this.restType.kind) { + case RestTypeKind.Tuple: { + const typeArguments = this.restType.typeArguments; + if (this.hasConsumedArguments) { + // all types consumed by a rest - just assume it's the last type + // there is one edge case where this is wrong, but we ignore it because + // it's rare and really complicated to handle + // eg: function foo(...a: [number, ...string[], number]) + return typeArguments[typeArguments.length - 1]; + } + const typeIndex = index - this.restType.index; + if (typeIndex >= typeArguments.length) { + return typeArguments[typeArguments.length - 1]; + } + return typeArguments[typeIndex]; + } + case RestTypeKind.Array: + case RestTypeKind.Other: + return this.restType.type; + } + } + return this.paramTypes[index]; + } +} +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-argument', + meta: { + type: 'problem', + docs: { + description: 'Disallow calling a function with a value with type `any`', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unsafeArgument: 'Unsafe argument of type {{sender}} assigned to a parameter of type {{receiver}}.', + unsafeArraySpread: 'Unsafe spread of an {{sender}} array type.', + unsafeSpread: 'Unsafe spread of an {{sender}} type.', + unsafeTupleSpread: 'Unsafe spread of a tuple type. The argument is {{sender}} and is assigned to a parameter of type {{receiver}}.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function describeType(type) { + if (tsutils.isIntrinsicErrorType(type)) { + return 'error typed'; + } + return `\`${checker.typeToString(type)}\``; + } + function describeTypeForSpread(type) { + if (checker.isArrayType(type) && + tsutils.isIntrinsicErrorType(checker.getTypeArguments(type)[0])) { + return 'error'; + } + return describeType(type); + } + function describeTypeForTuple(type) { + if (tsutils.isIntrinsicErrorType(type)) { + return 'error typed'; + } + return `of type \`${checker.typeToString(type)}\``; + } + function checkUnsafeArguments(args, callee, node) { + if (args.length === 0) { + return; + } + // ignore any-typed calls as these are caught by no-unsafe-call + if ((0, util_1.isTypeAnyType)(services.getTypeAtLocation(callee))) { + return; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const signature = (0, util_1.nullThrows)(FunctionSignature.create(checker, tsNode), 'Expected to a signature resolved'); + if (node.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + // Consumes the first parameter (TemplateStringsArray) of the function called with TaggedTemplateExpression. + signature.getNextParameterType(); + } + for (const argument of args) { + switch (argument.type) { + // spreads consume + case utils_1.AST_NODE_TYPES.SpreadElement: { + const spreadArgType = services.getTypeAtLocation(argument.argument); + if ((0, util_1.isTypeAnyType)(spreadArgType)) { + // foo(...any) + context.report({ + node: argument, + messageId: 'unsafeSpread', + data: { sender: describeType(spreadArgType) }, + }); + } + else if ((0, util_1.isTypeAnyArrayType)(spreadArgType, checker)) { + // foo(...any[]) + // TODO - we could break down the spread and compare the array type against each argument + context.report({ + node: argument, + messageId: 'unsafeArraySpread', + data: { sender: describeTypeForSpread(spreadArgType) }, + }); + } + else if (checker.isTupleType(spreadArgType)) { + // foo(...[tuple1, tuple2]) + const spreadTypeArguments = checker.getTypeArguments(spreadArgType); + for (const tupleType of spreadTypeArguments) { + const parameterType = signature.getNextParameterType(); + if (parameterType == null) { + continue; + } + const result = (0, util_1.isUnsafeAssignment)(tupleType, parameterType, checker, + // we can't pass the individual tuple members in here as this will most likely be a spread variable + // not a spread array + null); + if (result) { + context.report({ + node: argument, + messageId: 'unsafeTupleSpread', + data: { + receiver: describeType(parameterType), + sender: describeTypeForTuple(tupleType), + }, + }); + } + } + if (spreadArgType.target.combinedFlags & ts.ElementFlags.Variable) { + // the last element was a rest - so all remaining defined arguments can be considered "consumed" + // all remaining arguments should be compared against the rest type (if one exists) + signature.consumeRemainingArguments(); + } + } + else { + // something that's iterable + // handling this will be pretty complex - so we ignore it for now + // TODO - handle generic iterable case + } + break; + } + default: { + const parameterType = signature.getNextParameterType(); + if (parameterType == null) { + continue; + } + const argumentType = services.getTypeAtLocation(argument); + const result = (0, util_1.isUnsafeAssignment)(argumentType, parameterType, checker, argument); + if (result) { + context.report({ + node: argument, + messageId: 'unsafeArgument', + data: { + receiver: describeType(parameterType), + sender: describeType(argumentType), + }, + }); + } + } + } + } + } + return { + 'CallExpression, NewExpression'(node) { + checkUnsafeArguments(node.arguments, node.callee, node); + }, + TaggedTemplateExpression(node) { + checkUnsafeArguments(node.quasi.expressions, node.tag, node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.d.ts.map new file mode 100644 index 0000000..818e532 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-assignment.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-assignment.ts"],"names":[],"mappings":";AA6BA,wBA4ZG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js new file mode 100644 index 0000000..d05dcd8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js @@ -0,0 +1,320 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +var ComparisonType; +(function (ComparisonType) { + /** Do no assignment comparison */ + ComparisonType[ComparisonType["None"] = 0] = "None"; + /** Use the receiver's type for comparison */ + ComparisonType[ComparisonType["Basic"] = 1] = "Basic"; + /** Use the sender's contextual type for comparison */ + ComparisonType[ComparisonType["Contextual"] = 2] = "Contextual"; +})(ComparisonType || (ComparisonType = {})); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-assignment', + meta: { + type: 'problem', + docs: { + description: 'Disallow assigning a value with type `any` to variables and properties', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + anyAssignment: 'Unsafe assignment of an {{sender}} value.', + anyAssignmentThis: [ + 'Unsafe assignment of an {{sender}} value. `this` is typed as `any`.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + unsafeArrayPattern: 'Unsafe array destructuring of an {{sender}} array value.', + unsafeArrayPatternFromTuple: 'Unsafe array destructuring of a tuple element with an {{sender}} value.', + unsafeArraySpread: 'Unsafe spread of an {{sender}} value in an array.', + unsafeAssignment: 'Unsafe assignment of type {{sender}} to a variable of type {{receiver}}.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'noImplicitThis'); + // returns true if the assignment reported + function checkArrayDestructureHelper(receiverNode, senderNode) { + if (receiverNode.type !== utils_1.AST_NODE_TYPES.ArrayPattern) { + return false; + } + const senderTsNode = services.esTreeNodeToTSNodeMap.get(senderNode); + const senderType = services.getTypeAtLocation(senderNode); + return checkArrayDestructure(receiverNode, senderType, senderTsNode); + } + // returns true if the assignment reported + function checkArrayDestructure(receiverNode, senderType, senderNode) { + // any array + // const [x] = ([] as any[]); + if ((0, util_1.isTypeAnyArrayType)(senderType, checker)) { + context.report({ + node: receiverNode, + messageId: 'unsafeArrayPattern', + data: createData(senderType), + }); + return false; + } + if (!checker.isTupleType(senderType)) { + return true; + } + const tupleElements = checker.getTypeArguments(senderType); + // tuple with any + // const [x] = [1 as any]; + let didReport = false; + for (let receiverIndex = 0; receiverIndex < receiverNode.elements.length; receiverIndex += 1) { + const receiverElement = receiverNode.elements[receiverIndex]; + if (!receiverElement) { + continue; + } + if (receiverElement.type === utils_1.AST_NODE_TYPES.RestElement) { + // don't handle rests as they're not a 1:1 assignment + continue; + } + const senderType = tupleElements[receiverIndex]; + if (!senderType) { + continue; + } + // check for the any type first so we can handle [[[x]]] = [any] + if ((0, util_1.isTypeAnyType)(senderType)) { + context.report({ + node: receiverElement, + messageId: 'unsafeArrayPatternFromTuple', + data: createData(senderType), + }); + // we want to report on every invalid element in the tuple + didReport = true; + } + else if (receiverElement.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + didReport = checkArrayDestructure(receiverElement, senderType, senderNode); + } + else if (receiverElement.type === utils_1.AST_NODE_TYPES.ObjectPattern) { + didReport = checkObjectDestructure(receiverElement, senderType, senderNode); + } + } + return didReport; + } + // returns true if the assignment reported + function checkObjectDestructureHelper(receiverNode, senderNode) { + if (receiverNode.type !== utils_1.AST_NODE_TYPES.ObjectPattern) { + return false; + } + const senderTsNode = services.esTreeNodeToTSNodeMap.get(senderNode); + const senderType = services.getTypeAtLocation(senderNode); + return checkObjectDestructure(receiverNode, senderType, senderTsNode); + } + // returns true if the assignment reported + function checkObjectDestructure(receiverNode, senderType, senderNode) { + const properties = new Map(senderType + .getProperties() + .map(property => [ + property.getName(), + checker.getTypeOfSymbolAtLocation(property, senderNode), + ])); + let didReport = false; + for (const receiverProperty of receiverNode.properties) { + if (receiverProperty.type === utils_1.AST_NODE_TYPES.RestElement) { + // don't bother checking rest + continue; + } + let key; + if (!receiverProperty.computed) { + key = + receiverProperty.key.type === utils_1.AST_NODE_TYPES.Identifier + ? receiverProperty.key.name + : String(receiverProperty.key.value); + } + else if (receiverProperty.key.type === utils_1.AST_NODE_TYPES.Literal) { + key = String(receiverProperty.key.value); + } + else if (receiverProperty.key.type === utils_1.AST_NODE_TYPES.TemplateLiteral && + receiverProperty.key.quasis.length === 1) { + key = String(receiverProperty.key.quasis[0].value.cooked); + } + else { + // can't figure out the name, so skip it + continue; + } + const senderType = properties.get(key); + if (!senderType) { + continue; + } + // check for the any type first so we can handle {x: {y: z}} = {x: any} + if ((0, util_1.isTypeAnyType)(senderType)) { + context.report({ + node: receiverProperty.value, + messageId: 'unsafeArrayPatternFromTuple', + data: createData(senderType), + }); + didReport = true; + } + else if (receiverProperty.value.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + didReport = checkArrayDestructure(receiverProperty.value, senderType, senderNode); + } + else if (receiverProperty.value.type === utils_1.AST_NODE_TYPES.ObjectPattern) { + didReport = checkObjectDestructure(receiverProperty.value, senderType, senderNode); + } + } + return didReport; + } + // returns true if the assignment reported + function checkAssignment(receiverNode, senderNode, reportingNode, comparisonType) { + const receiverTsNode = services.esTreeNodeToTSNodeMap.get(receiverNode); + const receiverType = comparisonType === ComparisonType.Contextual + ? ((0, util_1.getContextualType)(checker, receiverTsNode) ?? + services.getTypeAtLocation(receiverNode)) + : services.getTypeAtLocation(receiverNode); + const senderType = services.getTypeAtLocation(senderNode); + if ((0, util_1.isTypeAnyType)(senderType)) { + // handle cases when we assign any ==> unknown. + if ((0, util_1.isTypeUnknownType)(receiverType)) { + return false; + } + let messageId = 'anyAssignment'; + if (!isNoImplicitThis) { + // `var foo = this` + const thisExpression = (0, util_1.getThisExpression)(senderNode); + if (thisExpression && + (0, util_1.isTypeAnyType)((0, util_1.getConstrainedTypeAtLocation)(services, thisExpression))) { + messageId = 'anyAssignmentThis'; + } + } + context.report({ + node: reportingNode, + messageId, + data: createData(senderType), + }); + return true; + } + if (comparisonType === ComparisonType.None) { + return false; + } + const result = (0, util_1.isUnsafeAssignment)(senderType, receiverType, checker, senderNode); + if (!result) { + return false; + } + const { receiver, sender } = result; + context.report({ + node: reportingNode, + messageId: 'unsafeAssignment', + data: createData(sender, receiver), + }); + return true; + } + function getComparisonType(typeAnnotation) { + return typeAnnotation + ? // if there's a type annotation, we can do a comparison + ComparisonType.Basic + : // no type annotation means the variable's type will just be inferred, thus equal + ComparisonType.None; + } + function createData(senderType, receiverType) { + if (receiverType) { + return { + receiver: `\`${checker.typeToString(receiverType)}\``, + sender: `\`${checker.typeToString(senderType)}\``, + }; + } + return { + sender: tsutils.isIntrinsicErrorType(senderType) + ? 'error typed' + : '`any`', + }; + } + return { + 'AccessorProperty[value != null]'(node) { + checkAssignment(node.key, node.value, node, getComparisonType(node.typeAnnotation)); + }, + 'AssignmentExpression[operator = "="], AssignmentPattern'(node) { + let didReport = checkAssignment(node.left, node.right, node, + // the variable already has some form of a type to compare against + ComparisonType.Basic); + if (!didReport) { + didReport = checkArrayDestructureHelper(node.left, node.right); + } + if (!didReport) { + checkObjectDestructureHelper(node.left, node.right); + } + }, + 'PropertyDefinition[value != null]'(node) { + checkAssignment(node.key, node.value, node, getComparisonType(node.typeAnnotation)); + }, + 'VariableDeclarator[init != null]'(node) { + const init = (0, util_1.nullThrows)(node.init, util_1.NullThrowsReasons.MissingToken(node.type, 'init')); + let didReport = checkAssignment(node.id, init, node, getComparisonType(node.id.typeAnnotation)); + if (!didReport) { + didReport = checkArrayDestructureHelper(node.id, init); + } + if (!didReport) { + checkObjectDestructureHelper(node.id, init); + } + }, + // object pattern props are checked via assignments + ':not(ObjectPattern) > Property'(node) { + if (node.value.type === utils_1.AST_NODE_TYPES.AssignmentPattern || + node.value.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + // handled by other selector + return; + } + checkAssignment(node.key, node.value, node, ComparisonType.Contextual); + }, + 'ArrayExpression > SpreadElement'(node) { + const restType = services.getTypeAtLocation(node.argument); + if ((0, util_1.isTypeAnyType)(restType) || (0, util_1.isTypeAnyArrayType)(restType, checker)) { + context.report({ + node, + messageId: 'unsafeArraySpread', + data: createData(restType), + }); + } + }, + 'JSXAttribute[value != null]'(node) { + const value = (0, util_1.nullThrows)(node.value, util_1.NullThrowsReasons.MissingToken(node.type, 'value')); + if (value.type !== utils_1.AST_NODE_TYPES.JSXExpressionContainer || + value.expression.type === utils_1.AST_NODE_TYPES.JSXEmptyExpression) { + return; + } + checkAssignment(node.name, value.expression, value.expression, ComparisonType.Contextual); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.d.ts.map new file mode 100644 index 0000000..916aba4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-call.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-call.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAClB,YAAY,GACZ,gBAAgB,GAChB,WAAW,GACX,mBAAmB,CAAC;;AAExB,wBAuHG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js new file mode 100644 index 0000000..8aa687e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js @@ -0,0 +1,131 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-call', + meta: { + type: 'problem', + docs: { + description: 'Disallow calling a value with type `any`', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unsafeCall: 'Unsafe call of a(n) {{type}} typed value.', + unsafeCallThis: [ + 'Unsafe call of a(n) {{type}} typed value. `this` is typed as {{type}}.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + unsafeNew: 'Unsafe construction of a(n) {{type}} typed value.', + unsafeTemplateTag: 'Unsafe use of a(n) {{type}} typed template tag.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const compilerOptions = services.program.getCompilerOptions(); + const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'noImplicitThis'); + function checkCall(node, reportingNode, messageId) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + if ((0, util_1.isTypeAnyType)(type)) { + if (!isNoImplicitThis) { + // `this()` or `this.foo()` or `this.foo[bar]()` + const thisExpression = (0, util_1.getThisExpression)(node); + if (thisExpression && + (0, util_1.isTypeAnyType)((0, util_1.getConstrainedTypeAtLocation)(services, thisExpression))) { + messageId = 'unsafeCallThis'; + } + } + const isErrorType = tsutils.isIntrinsicErrorType(type); + context.report({ + node: reportingNode, + messageId, + data: { + type: isErrorType ? '`error` type' : '`any`', + }, + }); + return; + } + if ((0, util_1.isBuiltinSymbolLike)(services.program, type, 'Function')) { + // this also matches subtypes of `Function`, like `interface Foo extends Function {}`. + // + // For weird TS reasons that I don't understand, these are + // + // safe to construct if: + // - they have at least one call signature _that is not void-returning_, + // - OR they have at least one construct signature. + // + // safe to call (including as template) if: + // - they have at least one call signature + // - OR they have at least one construct signature. + const constructSignatures = type.getConstructSignatures(); + if (constructSignatures.length > 0) { + return; + } + const callSignatures = type.getCallSignatures(); + if (messageId === 'unsafeNew') { + if (callSignatures.some(signature => !tsutils.isIntrinsicVoidType(signature.getReturnType()))) { + return; + } + } + else if (callSignatures.length > 0) { + return; + } + context.report({ + node: reportingNode, + messageId, + data: { + type: '`Function`', + }, + }); + return; + } + } + return { + 'CallExpression > *.callee'(node) { + checkCall(node, node, 'unsafeCall'); + }, + NewExpression(node) { + checkCall(node.callee, node, 'unsafeNew'); + }, + 'TaggedTemplateExpression > *.tag'(node) { + checkCall(node, node, 'unsafeTemplateTag'); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.d.ts.map new file mode 100644 index 0000000..236ef9d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-declaration-merging.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-declaration-merging.ts"],"names":[],"mappings":";AAOA,wBAkEG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.js new file mode 100644 index 0000000..8d54322 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-declaration-merging', + meta: { + type: 'problem', + docs: { + description: 'Disallow unsafe declaration merging', + recommended: 'recommended', + requiresTypeChecking: false, + }, + messages: { + unsafeMerging: 'Unsafe declaration merging between classes and interfaces.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function checkUnsafeDeclaration(scope, node, unsafeKind) { + const variable = scope.set.get(node.name); + if (!variable) { + return; + } + const defs = variable.defs; + if (defs.length <= 1) { + return; + } + if (defs.some(def => def.node.type === unsafeKind)) { + context.report({ + node, + messageId: 'unsafeMerging', + }); + } + } + return { + ClassDeclaration(node) { + if (node.id) { + // by default eslint returns the inner class scope for the ClassDeclaration node + // but we want the outer scope within which merged variables will sit + const currentScope = context.sourceCode.getScope(node).upper; + if (currentScope == null) { + return; + } + checkUnsafeDeclaration(currentScope, node.id, utils_1.AST_NODE_TYPES.TSInterfaceDeclaration); + } + }, + TSInterfaceDeclaration(node) { + checkUnsafeDeclaration(context.sourceCode.getScope(node), node.id, utils_1.AST_NODE_TYPES.ClassDeclaration); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.d.ts.map new file mode 100644 index 0000000..66a1d3f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-enum-comparison.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-enum-comparison.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAyDnE,wBAsJG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.js new file mode 100644 index 0000000..17a74fd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.js @@ -0,0 +1,190 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const shared_1 = require("./enum-utils/shared"); +/** + * @returns Whether the right type is an unsafe comparison against any left type. + */ +function typeViolates(leftTypeParts, rightType) { + const leftEnumValueTypes = new Set(leftTypeParts.map(getEnumValueType)); + return ((leftEnumValueTypes.has(ts.TypeFlags.Number) && isNumberLike(rightType)) || + (leftEnumValueTypes.has(ts.TypeFlags.String) && isStringLike(rightType))); +} +function isNumberLike(type) { + const typeParts = tsutils.intersectionTypeParts(type); + return typeParts.some(typePart => { + return tsutils.isTypeFlagSet(typePart, ts.TypeFlags.Number | ts.TypeFlags.NumberLike); + }); +} +function isStringLike(type) { + const typeParts = tsutils.intersectionTypeParts(type); + return typeParts.some(typePart => { + return tsutils.isTypeFlagSet(typePart, ts.TypeFlags.String | ts.TypeFlags.StringLike); + }); +} +/** + * @returns What type a type's enum value is (number or string), if either. + */ +function getEnumValueType(type) { + return tsutils.isTypeFlagSet(type, ts.TypeFlags.EnumLike) + ? tsutils.isTypeFlagSet(type, ts.TypeFlags.NumberLiteral) + ? ts.TypeFlags.Number + : ts.TypeFlags.String + : undefined; +} +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-enum-comparison', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow comparing an enum value with a non-enum value', + recommended: 'recommended', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + mismatchedCase: 'The case statement does not have a shared enum type with the switch predicate.', + mismatchedCondition: 'The two values in this comparison do not have a shared enum type.', + replaceValueWithEnum: 'Replace with an enum value comparison.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const parserServices = (0, util_1.getParserServices)(context); + const typeChecker = parserServices.program.getTypeChecker(); + function isMismatchedComparison(leftType, rightType) { + // Allow comparisons that don't have anything to do with enums: + // + // ```ts + // 1 === 2; + // ``` + const leftEnumTypes = (0, shared_1.getEnumTypes)(typeChecker, leftType); + const rightEnumTypes = new Set((0, shared_1.getEnumTypes)(typeChecker, rightType)); + if (leftEnumTypes.length === 0 && rightEnumTypes.size === 0) { + return false; + } + // Allow comparisons that share an enum type: + // + // ```ts + // Fruit.Apple === Fruit.Banana; + // ``` + for (const leftEnumType of leftEnumTypes) { + if (rightEnumTypes.has(leftEnumType)) { + return false; + } + } + // We need to split the type into the union type parts in order to find + // valid enum comparisons like: + // + // ```ts + // declare const something: Fruit | Vegetable; + // something === Fruit.Apple; + // ``` + const leftTypeParts = tsutils.unionTypeParts(leftType); + const rightTypeParts = tsutils.unionTypeParts(rightType); + // If a type exists in both sides, we consider this comparison safe: + // + // ```ts + // declare const fruit: Fruit.Apple | 0; + // fruit === 0; + // ``` + for (const leftTypePart of leftTypeParts) { + if (rightTypeParts.includes(leftTypePart)) { + return false; + } + } + return (typeViolates(leftTypeParts, rightType) || + typeViolates(rightTypeParts, leftType)); + } + return { + 'BinaryExpression[operator=/^[<>!=]?={0,2}$/]'(node) { + const leftType = parserServices.getTypeAtLocation(node.left); + const rightType = parserServices.getTypeAtLocation(node.right); + if (isMismatchedComparison(leftType, rightType)) { + context.report({ + node, + messageId: 'mismatchedCondition', + suggest: [ + { + messageId: 'replaceValueWithEnum', + fix(fixer) { + // Replace the right side with an enum key if possible: + // + // ```ts + // Fruit.Apple === 'apple'; // Fruit.Apple === Fruit.Apple + // ``` + const leftEnumKey = (0, shared_1.getEnumKeyForLiteral)((0, shared_1.getEnumLiterals)(leftType), (0, util_1.getStaticValue)(node.right)?.value); + if (leftEnumKey) { + return fixer.replaceText(node.right, leftEnumKey); + } + // Replace the left side with an enum key if possible: + // + // ```ts + // declare const fruit: Fruit; + // 'apple' === Fruit.Apple; // Fruit.Apple === Fruit.Apple + // ``` + const rightEnumKey = (0, shared_1.getEnumKeyForLiteral)((0, shared_1.getEnumLiterals)(rightType), (0, util_1.getStaticValue)(node.left)?.value); + if (rightEnumKey) { + return fixer.replaceText(node.left, rightEnumKey); + } + return null; + }, + }, + ], + }); + } + }, + SwitchCase(node) { + // Ignore `default` cases. + if (node.test == null) { + return; + } + const { parent } = node; + const leftType = parserServices.getTypeAtLocation(parent.discriminant); + const rightType = parserServices.getTypeAtLocation(node.test); + if (isMismatchedComparison(leftType, rightType)) { + context.report({ + node, + messageId: 'mismatchedCase', + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.d.ts.map new file mode 100644 index 0000000..de9dbbd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-function-type.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-function-type.ts"],"names":[],"mappings":";AAMA,wBA4CG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.js new file mode 100644 index 0000000..02504f8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-function-type', + meta: { + type: 'problem', + docs: { + description: 'Disallow using the unsafe built-in Function type', + recommended: 'recommended', + }, + fixable: 'code', + messages: { + bannedFunctionType: [ + 'The `Function` type accepts any function-like value.', + 'Prefer explicitly defining any function parameters and return type.', + ].join('\n'), + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function checkBannedTypes(node) { + if (node.type === utils_1.AST_NODE_TYPES.Identifier && + node.name === 'Function' && + (0, util_1.isReferenceToGlobalFunction)('Function', node, context.sourceCode)) { + context.report({ + node, + messageId: 'bannedFunctionType', + }); + } + } + return { + TSClassImplements(node) { + checkBannedTypes(node.expression); + }, + TSInterfaceHeritage(node) { + checkBannedTypes(node.expression); + }, + TSTypeReference(node) { + checkBannedTypes(node.typeName); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.d.ts.map new file mode 100644 index 0000000..08d7d67 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-member-access.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-member-access.ts"],"names":[],"mappings":";AAwBA,wBAwHG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js new file mode 100644 index 0000000..3d9c619 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js @@ -0,0 +1,141 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +var State; +(function (State) { + State[State["Unsafe"] = 1] = "Unsafe"; + State[State["Safe"] = 2] = "Safe"; +})(State || (State = {})); +function createDataType(type) { + const isErrorType = tsutils.isIntrinsicErrorType(type); + return isErrorType ? '`error` typed' : '`any`'; +} +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-member-access', + meta: { + type: 'problem', + docs: { + description: 'Disallow member access on a value with type `any`', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unsafeComputedMemberAccess: 'Computed name {{property}} resolves to an {{type}} value.', + unsafeMemberExpression: 'Unsafe member access {{property}} on an {{type}} value.', + unsafeThisMemberExpression: [ + 'Unsafe member access {{property}} on an `any` value. `this` is typed as `any`.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const compilerOptions = services.program.getCompilerOptions(); + const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'noImplicitThis'); + const stateCache = new Map(); + function checkMemberExpression(node) { + const cachedState = stateCache.get(node); + if (cachedState) { + return cachedState; + } + if (node.object.type === utils_1.AST_NODE_TYPES.MemberExpression) { + const objectState = checkMemberExpression(node.object); + if (objectState === State.Unsafe) { + // if the object is unsafe, we know this will be unsafe as well + // we don't need to report, as we have already reported on the inner member expr + stateCache.set(node, objectState); + return objectState; + } + } + const type = services.getTypeAtLocation(node.object); + const state = (0, util_1.isTypeAnyType)(type) ? State.Unsafe : State.Safe; + stateCache.set(node, state); + if (state === State.Unsafe) { + const propertyName = context.sourceCode.getText(node.property); + let messageId = 'unsafeMemberExpression'; + if (!isNoImplicitThis) { + // `this.foo` or `this.foo[bar]` + const thisExpression = (0, util_1.getThisExpression)(node); + if (thisExpression && + (0, util_1.isTypeAnyType)((0, util_1.getConstrainedTypeAtLocation)(services, thisExpression))) { + messageId = 'unsafeThisMemberExpression'; + } + } + context.report({ + node: node.property, + messageId, + data: { + type: createDataType(type), + property: node.computed ? `[${propertyName}]` : `.${propertyName}`, + }, + }); + } + return state; + } + return { + // ignore MemberExpressions with ancestors of type `TSClassImplements` or `TSInterfaceHeritage` + 'MemberExpression:not(TSClassImplements MemberExpression, TSInterfaceHeritage MemberExpression)': checkMemberExpression, + 'MemberExpression[computed = true] > *.property'(node) { + if ( + // x[1] + node.type === utils_1.AST_NODE_TYPES.Literal || + // x[1++] x[++x] etc + // FUN FACT - **all** update expressions return type number, regardless of the argument's type, + // because JS engines return NaN if there the argument is not a number. + node.type === utils_1.AST_NODE_TYPES.UpdateExpression) { + // perf optimizations - literals can obviously never be `any` + return; + } + const type = services.getTypeAtLocation(node); + if ((0, util_1.isTypeAnyType)(type)) { + const propertyName = context.sourceCode.getText(node); + context.report({ + node, + messageId: 'unsafeComputedMemberAccess', + data: { + type: createDataType(type), + property: `[${propertyName}]`, + }, + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.d.ts.map new file mode 100644 index 0000000..d03764d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-return.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-return.ts"],"names":[],"mappings":";AAqBA,wBAwMG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js new file mode 100644 index 0000000..4e1f46d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js @@ -0,0 +1,185 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getParentFunctionNode_1 = require("../util/getParentFunctionNode"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-return', + meta: { + type: 'problem', + docs: { + description: 'Disallow returning a value with type `any` from a function', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unsafeReturn: 'Unsafe return of a value of type {{type}}.', + unsafeReturnAssignment: 'Unsafe return of type `{{sender}}` from function with return type `{{receiver}}`.', + unsafeReturnThis: [ + 'Unsafe return of a value of type `{{type}}`. `this` is typed as `any`.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'noImplicitThis'); + function checkReturn(returnNode, reportingNode = returnNode) { + const tsNode = services.esTreeNodeToTSNodeMap.get(returnNode); + const type = checker.getTypeAtLocation(tsNode); + const anyType = (0, util_1.discriminateAnyType)(type, checker, services.program, tsNode); + const functionNode = (0, getParentFunctionNode_1.getParentFunctionNode)(returnNode); + /* istanbul ignore if */ if (!functionNode) { + return; + } + // function has an explicit return type, so ensure it's a safe return + const returnNodeType = (0, util_1.getConstrainedTypeAtLocation)(services, returnNode); + const functionTSNode = services.esTreeNodeToTSNodeMap.get(functionNode); + // function expressions will not have their return type modified based on receiver typing + // so we have to use the contextual typing in these cases, i.e. + // const foo1: () => Set = () => new Set(); + // the return type of the arrow function is Set even though the variable is typed as Set + let functionType = ts.isFunctionExpression(functionTSNode) || + ts.isArrowFunction(functionTSNode) + ? (0, util_1.getContextualType)(checker, functionTSNode) + : services.getTypeAtLocation(functionNode); + if (!functionType) { + functionType = services.getTypeAtLocation(functionNode); + } + const callSignatures = tsutils.getCallSignaturesOfType(functionType); + // If there is an explicit type annotation *and* that type matches the actual + // function return type, we shouldn't complain (it's intentional, even if unsafe) + if (functionTSNode.type) { + for (const signature of callSignatures) { + const signatureReturnType = signature.getReturnType(); + if (returnNodeType === signatureReturnType || + (0, util_1.isTypeFlagSet)(signatureReturnType, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return; + } + if (functionNode.async) { + const awaitedSignatureReturnType = checker.getAwaitedType(signatureReturnType); + const awaitedReturnNodeType = checker.getAwaitedType(returnNodeType); + if (awaitedReturnNodeType === awaitedSignatureReturnType || + (awaitedSignatureReturnType && + (0, util_1.isTypeFlagSet)(awaitedSignatureReturnType, ts.TypeFlags.Any | ts.TypeFlags.Unknown))) { + return; + } + } + } + } + if (anyType !== util_1.AnyType.Safe) { + // Allow cases when the declared return type of the function is either unknown or unknown[] + // and the function is returning any or any[]. + for (const signature of callSignatures) { + const functionReturnType = signature.getReturnType(); + if (anyType === util_1.AnyType.Any && + (0, util_1.isTypeUnknownType)(functionReturnType)) { + return; + } + if (anyType === util_1.AnyType.AnyArray && + (0, util_1.isTypeUnknownArrayType)(functionReturnType, checker)) { + return; + } + const awaitedType = checker.getAwaitedType(functionReturnType); + if (awaitedType && + anyType === util_1.AnyType.PromiseAny && + (0, util_1.isTypeUnknownType)(awaitedType)) { + return; + } + } + if (anyType === util_1.AnyType.PromiseAny && !functionNode.async) { + return; + } + let messageId = 'unsafeReturn'; + const isErrorType = tsutils.isIntrinsicErrorType(returnNodeType); + if (!isNoImplicitThis) { + // `return this` + const thisExpression = (0, util_1.getThisExpression)(returnNode); + if (thisExpression && + (0, util_1.isTypeAnyType)((0, util_1.getConstrainedTypeAtLocation)(services, thisExpression))) { + messageId = 'unsafeReturnThis'; + } + } + // If the function return type was not unknown/unknown[], mark usage as unsafeReturn. + return context.report({ + node: reportingNode, + messageId, + data: { + type: isErrorType + ? 'error' + : anyType === util_1.AnyType.Any + ? '`any`' + : anyType === util_1.AnyType.PromiseAny + ? '`Promise`' + : '`any[]`', + }, + }); + } + const signature = functionType.getCallSignatures().at(0); + if (signature) { + const functionReturnType = signature.getReturnType(); + const result = (0, util_1.isUnsafeAssignment)(returnNodeType, functionReturnType, checker, returnNode); + if (!result) { + return; + } + const { receiver, sender } = result; + return context.report({ + node: reportingNode, + messageId: 'unsafeReturnAssignment', + data: { + receiver: checker.typeToString(receiver), + sender: checker.typeToString(sender), + }, + }); + } + } + return { + 'ArrowFunctionExpression > :not(BlockStatement).body': checkReturn, + ReturnStatement(node) { + const argument = node.argument; + if (!argument) { + return; + } + checkReturn(argument, node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.d.ts.map new file mode 100644 index 0000000..c4bf50a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-type-assertion.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-type-assertion.ts"],"names":[],"mappings":";AAaA,wBAqKG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.js new file mode 100644 index 0000000..9e3a2c8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.js @@ -0,0 +1,158 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-type-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallow type assertions that narrow a type', + requiresTypeChecking: true, + }, + messages: { + unsafeOfAnyTypeAssertion: 'Unsafe assertion from {{type}} detected: consider using type guards or a safer assertion.', + unsafeToAnyTypeAssertion: 'Unsafe assertion to {{type}} detected: consider using a more specific type to ensure safety.', + unsafeToUnconstrainedTypeAssertion: "Unsafe type assertion: '{{type}}' could be instantiated with an arbitrary type which could be unrelated to the original type.", + unsafeTypeAssertion: "Unsafe type assertion: type '{{type}}' is more narrow than the original type.", + unsafeTypeAssertionAssignableToConstraint: "Unsafe type assertion: the original type is assignable to the constraint of type '{{type}}', but '{{type}}' could be instantiated with a different subtype of its constraint.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function getAnyTypeName(type) { + return tsutils.isIntrinsicErrorType(type) ? 'error typed' : '`any`'; + } + function isObjectLiteralType(type) { + return (tsutils.isObjectType(type) && + tsutils.isObjectFlagSet(type, ts.ObjectFlags.ObjectLiteral)); + } + function checkExpression(node) { + const expressionType = services.getTypeAtLocation(node.expression); + const assertedType = services.getTypeAtLocation(node.typeAnnotation); + if (expressionType === assertedType) { + return; + } + // handle cases when asserting unknown ==> any. + if ((0, util_1.isTypeAnyType)(assertedType) && (0, util_1.isTypeUnknownType)(expressionType)) { + context.report({ + node, + messageId: 'unsafeToAnyTypeAssertion', + data: { + type: '`any`', + }, + }); + return; + } + const unsafeExpressionAny = (0, util_1.isUnsafeAssignment)(expressionType, assertedType, checker, node.expression); + if (unsafeExpressionAny) { + context.report({ + node, + messageId: 'unsafeOfAnyTypeAssertion', + data: { + type: getAnyTypeName(unsafeExpressionAny.sender), + }, + }); + return; + } + const unsafeAssertedAny = (0, util_1.isUnsafeAssignment)(assertedType, expressionType, checker, node.typeAnnotation); + if (unsafeAssertedAny) { + context.report({ + node, + messageId: 'unsafeToAnyTypeAssertion', + data: { + type: getAnyTypeName(unsafeAssertedAny.sender), + }, + }); + return; + } + // Use the widened type in case of an object literal so `isTypeAssignableTo()` + // won't fail on excess property check. + const expressionWidenedType = isObjectLiteralType(expressionType) + ? checker.getWidenedType(expressionType) + : expressionType; + const isAssertionSafe = checker.isTypeAssignableTo(expressionWidenedType, assertedType); + if (isAssertionSafe) { + return; + } + // Produce a more specific error message when targeting a type parameter + if (tsutils.isTypeParameter(assertedType)) { + const assertedTypeConstraint = checker.getBaseConstraintOfType(assertedType); + if (!assertedTypeConstraint) { + // asserting to an unconstrained type parameter is unsafe + context.report({ + node, + messageId: 'unsafeToUnconstrainedTypeAssertion', + data: { + type: checker.typeToString(assertedType), + }, + }); + return; + } + // special case message if the original type is assignable to the + // constraint of the target type parameter + const isAssignableToConstraint = checker.isTypeAssignableTo(expressionWidenedType, assertedTypeConstraint); + if (isAssignableToConstraint) { + context.report({ + node, + messageId: 'unsafeTypeAssertionAssignableToConstraint', + data: { + type: checker.typeToString(assertedType), + }, + }); + return; + } + } + // General error message + context.report({ + node, + messageId: 'unsafeTypeAssertion', + data: { + type: checker.typeToString(assertedType), + }, + }); + } + return { + 'TSAsExpression, TSTypeAssertion'(node) { + checkExpression(node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.d.ts.map new file mode 100644 index 0000000..1c60cb5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-unary-minus.d.ts","sourceRoot":"","sources":["../../src/rules/no-unsafe-unary-minus.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,OAAO,GAAG,EAAE,CAAC;AACzB,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC;;AAEtC,wBAmDG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.js new file mode 100644 index 0000000..febf721 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.js @@ -0,0 +1,78 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unsafe-unary-minus', + meta: { + type: 'problem', + docs: { + description: 'Require unary negation to take a number', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unaryMinus: 'Argument of unary negation should be assignable to number | bigint but is {{type}} instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + UnaryExpression(node) { + if (node.operator !== '-') { + return; + } + const services = util.getParserServices(context); + const argType = util.getConstrainedTypeAtLocation(services, node.argument); + const checker = services.program.getTypeChecker(); + if (tsutils + .unionTypeParts(argType) + .some(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Any | + ts.TypeFlags.Never | + ts.TypeFlags.BigIntLike | + ts.TypeFlags.NumberLike))) { + context.report({ + node, + messageId: 'unaryMinus', + data: { type: checker.typeToString(argType) }, + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.d.ts.map new file mode 100644 index 0000000..5a4fa67 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unused-expressions.d.ts","sourceRoot":"","sources":["../../src/rules/no-unused-expressions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;;;;8BA2EwrO,SAAU,mBAAmB;EA3ExqO,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;AACtE,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;;;AAUhE,wBA6DG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js new file mode 100644 index 0000000..c8118c5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-unused-expressions'); +const defaultOptions = [ + { + allowShortCircuit: false, + allowTaggedTemplates: false, + allowTernary: false, + }, +]; +exports.default = (0, util_1.createRule)({ + name: 'no-unused-expressions', + meta: { + type: 'suggestion', + defaultOptions, + docs: { + description: 'Disallow unused expressions', + extendsBaseRule: true, + recommended: 'recommended', + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions, + create(context, [{ allowShortCircuit = false, allowTernary = false }]) { + const rules = baseRule.create(context); + function isValidExpression(node) { + if (allowShortCircuit && node.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + return isValidExpression(node.right); + } + if (allowTernary && node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) { + return (isValidExpression(node.alternate) && + isValidExpression(node.consequent)); + } + return ((node.type === utils_1.AST_NODE_TYPES.ChainExpression && + node.expression.type === utils_1.AST_NODE_TYPES.CallExpression) || + node.type === utils_1.AST_NODE_TYPES.ImportExpression); + } + return { + ExpressionStatement(node) { + if (node.directive || isValidExpression(node.expression)) { + return; + } + const expressionType = node.expression.type; + if (expressionType === + utils_1.TSESTree.AST_NODE_TYPES.TSInstantiationExpression || + expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSAsExpression || + expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSNonNullExpression || + expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSTypeAssertion) { + rules.ExpressionStatement({ + ...node, + expression: node.expression.expression, + }); + return; + } + rules.ExpressionStatement(node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.d.ts.map new file mode 100644 index 0000000..4783a26 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unused-vars.d.ts","sourceRoot":"","sources":["../../src/rules/no-unused-vars.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAepE,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAC3E,MAAM,MAAM,OAAO,GAAG;IAClB,KAAK,GACL,OAAO,GACP;QACE,IAAI,CAAC,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC;QACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QAC9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,8BAA8B,CAAC,EAAE,MAAM,CAAC;QACxC,8BAA8B,CAAC,EAAE,OAAO,CAAC;QACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;QACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;CACJ,CAAC;;AA0BF,wBAuuBG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js new file mode 100644 index 0000000..5de4888 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js @@ -0,0 +1,668 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const referenceContainsTypeQuery_1 = require("../util/referenceContainsTypeQuery"); +exports.default = (0, util_1.createRule)({ + name: 'no-unused-vars', + meta: { + type: 'problem', + docs: { + description: 'Disallow unused variables', + extendsBaseRule: true, + recommended: 'recommended', + }, + messages: { + unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}.", + usedIgnoredVar: "'{{varName}}' is marked as ignored but is used{{additional}}.", + usedOnlyAsType: "'{{varName}}' is {{action}} but only used as a type{{additional}}.", + }, + schema: [ + { + oneOf: [ + { + type: 'string', + enum: ['all', 'local'], + }, + { + type: 'object', + additionalProperties: false, + properties: { + args: { + type: 'string', + description: 'Whether to check all, some, or no arguments.', + enum: ['all', 'after-used', 'none'], + }, + argsIgnorePattern: { + type: 'string', + description: 'Regular expressions of argument names to not check for usage.', + }, + caughtErrors: { + type: 'string', + description: 'Whether to check catch block arguments.', + enum: ['all', 'none'], + }, + caughtErrorsIgnorePattern: { + type: 'string', + description: 'Regular expressions of catch block argument names to not check for usage.', + }, + destructuredArrayIgnorePattern: { + type: 'string', + description: 'Regular expressions of destructured array variable names to not check for usage.', + }, + ignoreClassWithStaticInitBlock: { + type: 'boolean', + description: 'Whether to ignore classes with at least one static initialization block.', + }, + ignoreRestSiblings: { + type: 'boolean', + description: 'Whether to ignore sibling properties in `...` destructurings.', + }, + reportUsedIgnorePattern: { + type: 'boolean', + description: 'Whether to report variables that match any of the valid ignore pattern options if they have been used.', + }, + vars: { + type: 'string', + description: 'Whether to check all variables or only locally-declared variables.', + enum: ['all', 'local'], + }, + varsIgnorePattern: { + type: 'string', + description: 'Regular expressions of variable names to not check for usage.', + }, + }, + }, + ], + }, + ], + }, + defaultOptions: [{}], + create(context, [firstOption]) { + const MODULE_DECL_CACHE = new Map(); + const options = (() => { + const options = { + args: 'after-used', + caughtErrors: 'all', + ignoreClassWithStaticInitBlock: false, + ignoreRestSiblings: false, + reportUsedIgnorePattern: false, + vars: 'all', + }; + if (typeof firstOption === 'string') { + options.vars = firstOption; + } + else { + options.vars = firstOption.vars ?? options.vars; + options.args = firstOption.args ?? options.args; + options.ignoreRestSiblings = + firstOption.ignoreRestSiblings ?? options.ignoreRestSiblings; + options.caughtErrors = firstOption.caughtErrors ?? options.caughtErrors; + options.ignoreClassWithStaticInitBlock = + firstOption.ignoreClassWithStaticInitBlock ?? + options.ignoreClassWithStaticInitBlock; + options.reportUsedIgnorePattern = + firstOption.reportUsedIgnorePattern ?? + options.reportUsedIgnorePattern; + if (firstOption.varsIgnorePattern) { + options.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern, 'u'); + } + if (firstOption.argsIgnorePattern) { + options.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern, 'u'); + } + if (firstOption.caughtErrorsIgnorePattern) { + options.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, 'u'); + } + if (firstOption.destructuredArrayIgnorePattern) { + options.destructuredArrayIgnorePattern = new RegExp(firstOption.destructuredArrayIgnorePattern, 'u'); + } + } + return options; + })(); + /** + * Determines what variable type a def is. + * @param def the declaration to check + * @returns a simple name for the types of variables that this rule supports + */ + function defToVariableType(def) { + /* + * This `destructuredArrayIgnorePattern` error report works differently from the catch + * clause and parameter error reports. _Both_ the `varsIgnorePattern` and the + * `destructuredArrayIgnorePattern` will be checked for array destructuring. However, + * for the purposes of the report, the currently defined behavior is to only inform the + * user of the `destructuredArrayIgnorePattern` if it's present (regardless of the fact + * that the `varsIgnorePattern` would also apply). If it's not present, the user will be + * informed of the `varsIgnorePattern`, assuming that's present. + */ + if (options.destructuredArrayIgnorePattern && + def.name.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + return 'array-destructure'; + } + switch (def.type) { + case scope_manager_1.DefinitionType.CatchClause: + return 'catch-clause'; + case scope_manager_1.DefinitionType.Parameter: + return 'parameter'; + default: + return 'variable'; + } + } + /** + * Gets a given variable's description and configured ignore pattern + * based on the provided variableType + * @param variableType a simple name for the types of variables that this rule supports + * @returns the given variable's description and + * ignore pattern + */ + function getVariableDescription(variableType) { + switch (variableType) { + case 'array-destructure': + return { + pattern: options.destructuredArrayIgnorePattern?.toString(), + variableDescription: 'elements of array destructuring', + }; + case 'catch-clause': + return { + pattern: options.caughtErrorsIgnorePattern?.toString(), + variableDescription: 'caught errors', + }; + case 'parameter': + return { + pattern: options.argsIgnorePattern?.toString(), + variableDescription: 'args', + }; + case 'variable': + return { + pattern: options.varsIgnorePattern?.toString(), + variableDescription: 'vars', + }; + } + } + /** + * Generates the message data about the variable being defined and unused, + * including the ignore pattern if configured. + * @param unusedVar eslint-scope variable object. + * @returns The message data to be used with this unused variable. + */ + function getDefinedMessageData(unusedVar) { + const def = unusedVar.defs.at(0); + let additionalMessageData = ''; + if (def) { + const { pattern, variableDescription } = getVariableDescription(defToVariableType(def)); + if (pattern && variableDescription) { + additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`; + } + } + return { + action: 'defined', + additional: additionalMessageData, + varName: unusedVar.name, + }; + } + /** + * Generate the warning message about the variable being + * assigned and unused, including the ignore pattern if configured. + * @param unusedVar eslint-scope variable object. + * @returns The message data to be used with this unused variable. + */ + function getAssignedMessageData(unusedVar) { + const def = unusedVar.defs.at(0); + let additionalMessageData = ''; + if (def) { + const { pattern, variableDescription } = getVariableDescription(defToVariableType(def)); + if (pattern && variableDescription) { + additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`; + } + } + return { + action: 'assigned a value', + additional: additionalMessageData, + varName: unusedVar.name, + }; + } + /** + * Generate the warning message about a variable being used even though + * it is marked as being ignored. + * @param variable eslint-scope variable object + * @param variableType a simple name for the types of variables that this rule supports + * @returns The message data to be used with this used ignored variable. + */ + function getUsedIgnoredMessageData(variable, variableType) { + const { pattern, variableDescription } = getVariableDescription(variableType); + let additionalMessageData = ''; + if (pattern && variableDescription) { + additionalMessageData = `. Used ${variableDescription} must not match ${pattern}`; + } + return { + additional: additionalMessageData, + varName: variable.name, + }; + } + function collectUnusedVariables() { + /** + * Checks whether a node is a sibling of the rest property or not. + * @param node a node to check + * @returns True if the node is a sibling of the rest property, otherwise false. + */ + function hasRestSibling(node) { + return (node.type === utils_1.AST_NODE_TYPES.Property && + node.parent.type === utils_1.AST_NODE_TYPES.ObjectPattern && + node.parent.properties[node.parent.properties.length - 1].type === + utils_1.AST_NODE_TYPES.RestElement); + } + /** + * Determines if a variable has a sibling rest property + * @param variable eslint-scope variable object. + * @returns True if the variable is exported, false if not. + */ + function hasRestSpreadSibling(variable) { + if (options.ignoreRestSiblings) { + const hasRestSiblingDefinition = variable.defs.some(def => hasRestSibling(def.name.parent)); + const hasRestSiblingReference = variable.references.some(ref => hasRestSibling(ref.identifier.parent)); + return hasRestSiblingDefinition || hasRestSiblingReference; + } + return false; + } + /** + * Checks whether the given variable is after the last used parameter. + * @param variable The variable to check. + * @returns `true` if the variable is defined after the last used parameter. + */ + function isAfterLastUsedArg(variable) { + const def = variable.defs[0]; + const params = context.sourceCode.getDeclaredVariables(def.node); + const posteriorParams = params.slice(params.indexOf(variable) + 1); + // If any used parameters occur after this parameter, do not report. + return !posteriorParams.some(v => v.references.length > 0 || v.eslintUsed); + } + const analysisResults = (0, util_1.collectVariables)(context); + const variables = [ + ...Array.from(analysisResults.unusedVariables, variable => ({ + used: false, + variable, + })), + ...Array.from(analysisResults.usedVariables, variable => ({ + used: true, + variable, + })), + ]; + const unusedVariablesReturn = []; + for (const { used, variable } of variables) { + // explicit global variables don't have definitions. + if (variable.defs.length === 0) { + if (!used) { + unusedVariablesReturn.push(variable); + } + continue; + } + const def = variable.defs[0]; + if (variable.scope.type === utils_1.TSESLint.Scope.ScopeType.global && + options.vars === 'local') { + // skip variables in the global scope if configured to + continue; + } + const refUsedInArrayPatterns = variable.references.some(ref => ref.identifier.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern); + // skip elements of array destructuring patterns + if ((def.name.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern || + refUsedInArrayPatterns) && + def.name.type === utils_1.AST_NODE_TYPES.Identifier && + options.destructuredArrayIgnorePattern?.test(def.name.name)) { + if (options.reportUsedIgnorePattern && used) { + context.report({ + node: def.name, + messageId: 'usedIgnoredVar', + data: getUsedIgnoredMessageData(variable, 'array-destructure'), + }); + } + continue; + } + if (def.type === utils_1.TSESLint.Scope.DefinitionType.ClassName) { + const hasStaticBlock = def.node.body.body.some(node => node.type === utils_1.AST_NODE_TYPES.StaticBlock); + if (options.ignoreClassWithStaticInitBlock && hasStaticBlock) { + continue; + } + } + // skip catch variables + if (def.type === utils_1.TSESLint.Scope.DefinitionType.CatchClause) { + if (options.caughtErrors === 'none') { + continue; + } + // skip ignored parameters + if (def.name.type === utils_1.AST_NODE_TYPES.Identifier && + options.caughtErrorsIgnorePattern?.test(def.name.name)) { + if (options.reportUsedIgnorePattern && used) { + context.report({ + node: def.name, + messageId: 'usedIgnoredVar', + data: getUsedIgnoredMessageData(variable, 'catch-clause'), + }); + } + continue; + } + } + else if (def.type === utils_1.TSESLint.Scope.DefinitionType.Parameter) { + // if "args" option is "none", skip any parameter + if (options.args === 'none') { + continue; + } + // skip ignored parameters + if (def.name.type === utils_1.AST_NODE_TYPES.Identifier && + options.argsIgnorePattern?.test(def.name.name)) { + if (options.reportUsedIgnorePattern && used) { + context.report({ + node: def.name, + messageId: 'usedIgnoredVar', + data: getUsedIgnoredMessageData(variable, 'parameter'), + }); + } + continue; + } + // if "args" option is "after-used", skip used variables + if (options.args === 'after-used' && + (0, util_1.isFunction)(def.name.parent) && + !isAfterLastUsedArg(variable)) { + continue; + } + } + // skip ignored variables + else if (def.name.type === utils_1.AST_NODE_TYPES.Identifier && + options.varsIgnorePattern?.test(def.name.name)) { + if (options.reportUsedIgnorePattern && + used && + /* enum members are always marked as 'used' by `collectVariables`, but in reality they may be used or + unused. either way, don't complain about their naming. */ + def.type !== utils_1.TSESLint.Scope.DefinitionType.TSEnumMember) { + context.report({ + node: def.name, + messageId: 'usedIgnoredVar', + data: getUsedIgnoredMessageData(variable, 'variable'), + }); + } + continue; + } + if (hasRestSpreadSibling(variable)) { + continue; + } + // in case another rule has run and used the collectUnusedVariables, + // we want to ensure our selectors that marked variables as used are respected + if (variable.eslintUsed) { + continue; + } + if (!used) { + unusedVariablesReturn.push(variable); + } + } + return unusedVariablesReturn; + } + return { + // top-level declaration file handling + [ambientDeclarationSelector(utils_1.AST_NODE_TYPES.Program)](node) { + if (!(0, util_1.isDefinitionFile)(context.filename)) { + return; + } + const moduleDecl = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent); + if (checkForOverridingExportStatements(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // children of a namespace that is a child of a declared namespace are auto-exported + [ambientDeclarationSelector('TSModuleDeclaration[declare = true] > TSModuleBlock TSModuleDeclaration > TSModuleBlock')](node) { + const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent); + if (checkForOverridingExportStatements(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // declared namespace handling + [ambientDeclarationSelector('TSModuleDeclaration[declare = true] > TSModuleBlock')](node) { + const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent); + if (checkForOverridingExportStatements(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // namespace handling in definition files + [ambientDeclarationSelector('TSModuleDeclaration > TSModuleBlock')](node) { + if (!(0, util_1.isDefinitionFile)(context.filename)) { + return; + } + const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent); + if (checkForOverridingExportStatements(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // collect + 'Program:exit'(programNode) { + const unusedVars = collectUnusedVariables(); + for (const unusedVar of unusedVars) { + // Report the first declaration. + if (unusedVar.defs.length > 0) { + const usedOnlyAsType = unusedVar.references.some(ref => (0, referenceContainsTypeQuery_1.referenceContainsTypeQuery)(ref.identifier)); + const isImportUsedOnlyAsType = usedOnlyAsType && + unusedVar.defs.some(def => def.type === scope_manager_1.DefinitionType.ImportBinding); + if (isImportUsedOnlyAsType) { + continue; + } + const writeReferences = unusedVar.references.filter(ref => ref.isWrite() && + ref.from.variableScope === unusedVar.scope.variableScope); + const id = writeReferences.length + ? writeReferences[writeReferences.length - 1].identifier + : unusedVar.identifiers[0]; + const messageId = usedOnlyAsType ? 'usedOnlyAsType' : 'unusedVar'; + const { start } = id.loc; + const idLength = id.name.length; + const loc = { + start, + end: { + column: start.column + idLength, + line: start.line, + }, + }; + context.report({ + loc, + messageId, + data: unusedVar.references.some(ref => ref.isWrite()) + ? getAssignedMessageData(unusedVar) + : getDefinedMessageData(unusedVar), + }); + // If there are no regular declaration, report the first `/*globals*/` comment directive. + } + else if ('eslintExplicitGlobalComments' in unusedVar && + unusedVar.eslintExplicitGlobalComments) { + const directiveComment = unusedVar.eslintExplicitGlobalComments[0]; + context.report({ + loc: (0, util_1.getNameLocationInGlobalDirectiveComment)(context.sourceCode, directiveComment, unusedVar.name), + node: programNode, + messageId: 'unusedVar', + data: getDefinedMessageData(unusedVar), + }); + } + } + }, + }; + function checkForOverridingExportStatements(node) { + const cached = MODULE_DECL_CACHE.get(node); + if (cached != null) { + return cached; + } + const body = getStatementsOfNode(node); + if (hasOverridingExportStatement(body)) { + MODULE_DECL_CACHE.set(node, true); + return true; + } + MODULE_DECL_CACHE.set(node, false); + return false; + } + function ambientDeclarationSelector(parent) { + return [ + // Types are ambiently exported + `${parent} > :matches(${[ + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, + ].join(', ')})`, + // Value things are ambiently exported if they are "declare"d + `${parent} > :matches(${[ + utils_1.AST_NODE_TYPES.ClassDeclaration, + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSEnumDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + utils_1.AST_NODE_TYPES.VariableDeclaration, + ].join(', ')})`, + ].join(', '); + } + function markDeclarationChildAsUsed(node) { + const identifiers = []; + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration: + case utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration: + case utils_1.AST_NODE_TYPES.ClassDeclaration: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + case utils_1.AST_NODE_TYPES.TSDeclareFunction: + case utils_1.AST_NODE_TYPES.TSEnumDeclaration: + case utils_1.AST_NODE_TYPES.TSModuleDeclaration: + if (node.id?.type === utils_1.AST_NODE_TYPES.Identifier) { + identifiers.push(node.id); + } + break; + case utils_1.AST_NODE_TYPES.VariableDeclaration: + for (const declaration of node.declarations) { + visitPattern(declaration, pattern => { + identifiers.push(pattern); + }); + } + break; + } + let scope = context.sourceCode.getScope(node); + const shouldUseUpperScope = [ + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + ].includes(node.type); + if (scope.variableScope !== scope) { + scope = scope.variableScope; + } + else if (shouldUseUpperScope && scope.upper) { + scope = scope.upper; + } + for (const id of identifiers) { + const superVar = scope.set.get(id.name); + if (superVar) { + superVar.eslintUsed = true; + } + } + } + function visitPattern(node, cb) { + const visitor = new scope_manager_1.PatternVisitor({}, node, cb); + visitor.visit(node); + } + }, +}); +function hasOverridingExportStatement(body) { + for (const statement of body) { + if ((statement.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration && + statement.declaration == null) || + statement.type === utils_1.AST_NODE_TYPES.ExportAllDeclaration || + statement.type === utils_1.AST_NODE_TYPES.TSExportAssignment) { + return true; + } + if (statement.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration && + statement.declaration.type === utils_1.AST_NODE_TYPES.Identifier) { + return true; + } + } + return false; +} +function getStatementsOfNode(block) { + if (block.type === utils_1.AST_NODE_TYPES.Program) { + return block.body; + } + return block.body.body; +} +/* + +###### TODO ###### + +Edge cases that aren't currently handled due to laziness and them being super edgy edge cases + + +--- function params referenced in typeof type refs in the function declaration --- +--- NOTE - TS gets these cases wrong + +function _foo( + arg: number // arg should be unused +): typeof arg { + return 1 as any; +} + +function _bar( + arg: number, // arg should be unused + _arg2: typeof arg, +) {} + + +--- function names referenced in typeof type refs in the function declaration --- +--- NOTE - TS gets these cases right + +function foo( // foo should be unused +): typeof foo { + return 1 as any; +} + +function bar( // bar should be unused + _arg: typeof bar +) {} + + +--- if an interface is merged into a namespace --- +--- NOTE - TS gets these cases wrong + +namespace Test { + interface Foo { // Foo should be unused here + a: string; + } + export namespace Foo { + export type T = 'b'; + } +} +type T = Test.Foo; // Error: Namespace 'Test' has no exported member 'Foo'. + + +namespace Test { + export interface Foo { + a: string; + } + namespace Foo { // Foo should be unused here + export type T = 'b'; + } +} +type T = Test.Foo.T; // Error: Namespace 'Test' has no exported member 'Foo'. + +--- + +These cases are mishandled because the base rule assumes that each variable has one def, but type-value shadowing +creates a variable with two defs + +--- type-only or value-only references to type/value shadowed variables --- +--- NOTE - TS gets these cases wrong + +type T = 1; +const T = 2; // this T should be unused + +type U = T; // this U should be unused +const U = 3; + +const _V = U; + + +--- partially exported type/value shadowed variables --- +--- NOTE - TS gets these cases wrong + +export interface Foo {} +const Foo = 1; // this Foo should be unused + +interface Bar {} // this Bar should be unused +export const Bar = 1; + +*/ diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.d.ts.map new file mode 100644 index 0000000..e146883 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-use-before-define.d.ts","sourceRoot":"","sources":["../../src/rules/no-use-before-define.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AA0MpE,MAAM,WAAW,MAAM;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AACD,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;AAC1C,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC;;AAE7C,wBA+KG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js new file mode 100644 index 0000000..3c03309 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js @@ -0,0 +1,302 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const referenceContainsTypeQuery_1 = require("../util/referenceContainsTypeQuery"); +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/; +/** + * Parses a given value as options. + */ +function parseOptions(options) { + let functions = true; + let classes = true; + let enums = true; + let variables = true; + let typedefs = true; + let ignoreTypeReferences = true; + let allowNamedExports = false; + if (typeof options === 'string') { + functions = options !== 'nofunc'; + } + else if (typeof options === 'object' && options != null) { + functions = options.functions !== false; + classes = options.classes !== false; + enums = options.enums !== false; + variables = options.variables !== false; + typedefs = options.typedefs !== false; + ignoreTypeReferences = options.ignoreTypeReferences !== false; + allowNamedExports = options.allowNamedExports !== false; + } + return { + allowNamedExports, + classes, + enums, + functions, + ignoreTypeReferences, + typedefs, + variables, + }; +} +/** + * Checks whether or not a given variable is a function declaration. + */ +function isFunction(variable) { + return variable.defs[0].type === scope_manager_1.DefinitionType.FunctionName; +} +/** + * Checks whether or not a given variable is a type declaration. + */ +function isTypedef(variable) { + return variable.defs[0].type === scope_manager_1.DefinitionType.Type; +} +/** + * Checks whether or not a given variable is a enum declaration. + */ +function isOuterEnum(variable, reference) { + return (variable.defs[0].type === scope_manager_1.DefinitionType.TSEnumName && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given variable is a class declaration in an upper function scope. + */ +function isOuterClass(variable, reference) { + return (variable.defs[0].type === scope_manager_1.DefinitionType.ClassName && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given variable is a variable declaration in an upper function scope. + */ +function isOuterVariable(variable, reference) { + return (variable.defs[0].type === scope_manager_1.DefinitionType.Variable && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given reference is a export reference. + */ +function isNamedExports(reference) { + const { identifier } = reference; + return (identifier.parent.type === utils_1.AST_NODE_TYPES.ExportSpecifier && + identifier.parent.local === identifier); +} +/** + * Checks whether or not a given reference is a type reference. + */ +function isTypeReference(reference) { + return (reference.isTypeReference || + (0, referenceContainsTypeQuery_1.referenceContainsTypeQuery)(reference.identifier)); +} +/** + * Checks whether or not a given location is inside of the range of a given node. + */ +function isInRange(node, location) { + return !!node && node.range[0] <= location && location <= node.range[1]; +} +/** + * Decorators are transpiled such that the decorator is placed after the class declaration + * So it is considered safe + */ +function isClassRefInClassDecorator(variable, reference) { + if (variable.defs[0].type !== scope_manager_1.DefinitionType.ClassName || + variable.defs[0].node.decorators.length === 0) { + return false; + } + for (const deco of variable.defs[0].node.decorators) { + if (reference.identifier.range[0] >= deco.range[0] && + reference.identifier.range[1] <= deco.range[1]) { + return true; + } + } + return false; +} +/** + * Checks whether or not a given reference is inside of the initializers of a given variable. + * + * @returns `true` in the following cases: + * - var a = a + * - var [a = a] = list + * - var {a = a} = obj + * - for (var a in a) {} + * - for (var a of a) {} + */ +function isInInitializer(variable, reference) { + if (variable.scope !== reference.from) { + return false; + } + let node = variable.identifiers[0].parent; + const location = reference.identifier.range[1]; + while (node) { + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + if (isInRange(node.init, location)) { + return true; + } + if ((node.parent.parent.type === utils_1.AST_NODE_TYPES.ForInStatement || + node.parent.parent.type === utils_1.AST_NODE_TYPES.ForOfStatement) && + isInRange(node.parent.parent.right, location)) { + return true; + } + break; + } + else if (node.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + if (isInRange(node.right, location)) { + return true; + } + } + else if (SENTINEL_TYPE.test(node.type)) { + break; + } + node = node.parent; + } + return false; +} +exports.default = (0, util_1.createRule)({ + name: 'no-use-before-define', + meta: { + type: 'problem', + docs: { + description: 'Disallow the use of variables before they are defined', + extendsBaseRule: true, + }, + messages: { + noUseBeforeDefine: "'{{name}}' was used before it was defined.", + }, + schema: [ + { + oneOf: [ + { + type: 'string', + enum: ['nofunc'], + }, + { + type: 'object', + additionalProperties: false, + properties: { + allowNamedExports: { + type: 'boolean', + description: 'Whether to ignore named exports.', + }, + classes: { + type: 'boolean', + description: 'Whether to ignore references to class declarations.', + }, + enums: { + type: 'boolean', + description: 'Whether to check references to enums.', + }, + functions: { + type: 'boolean', + description: 'Whether to ignore references to function declarations.', + }, + ignoreTypeReferences: { + type: 'boolean', + description: 'Whether to ignore type references, such as in type annotations and assertions.', + }, + typedefs: { + type: 'boolean', + description: 'Whether to check references to types.', + }, + variables: { + type: 'boolean', + description: 'Whether to ignore references to variables.', + }, + }, + }, + ], + }, + ], + }, + defaultOptions: [ + { + allowNamedExports: false, + classes: true, + enums: true, + functions: true, + ignoreTypeReferences: true, + typedefs: true, + variables: true, + }, + ], + create(context, optionsWithDefault) { + const options = parseOptions(optionsWithDefault[0]); + /** + * Determines whether a given use-before-define case should be reported according to the options. + * @param variable The variable that gets used before being defined + * @param reference The reference to the variable + */ + function isForbidden(variable, reference) { + if (options.ignoreTypeReferences && isTypeReference(reference)) { + return false; + } + if (isFunction(variable)) { + return options.functions; + } + if (isOuterClass(variable, reference)) { + return options.classes; + } + if (isOuterVariable(variable, reference)) { + return options.variables; + } + if (isOuterEnum(variable, reference)) { + return options.enums; + } + if (isTypedef(variable)) { + return options.typedefs; + } + return true; + } + function isDefinedBeforeUse(variable, reference) { + return (variable.identifiers[0].range[1] <= reference.identifier.range[1] && + !(reference.isValueReference && isInInitializer(variable, reference))); + } + /** + * Finds and validates all variables in a given scope. + */ + function findVariablesInScope(scope) { + scope.references.forEach(reference => { + const variable = reference.resolved; + function report() { + context.report({ + node: reference.identifier, + messageId: 'noUseBeforeDefine', + data: { + name: reference.identifier.name, + }, + }); + } + // Skips when the reference is: + // - initializations. + // - referring to an undefined variable. + // - referring to a global environment variable (there're no identifiers). + // - located preceded by the variable (except in initializers). + // - allowed by options. + if (reference.init) { + return; + } + if (!options.allowNamedExports && isNamedExports(reference)) { + if (!variable || !isDefinedBeforeUse(variable, reference)) { + report(); + } + return; + } + if (!variable) { + return; + } + if (variable.identifiers.length === 0 || + isDefinedBeforeUse(variable, reference) || + !isForbidden(variable, reference) || + isClassRefInClassDecorator(variable, reference) || + reference.from.type === utils_1.TSESLint.Scope.ScopeType.functionType) { + return; + } + // Reports. + report(); + }); + scope.childScopes.forEach(findVariablesInScope); + } + return { + Program(node) { + findVariablesInScope(context.sourceCode.getScope(node)); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.d.ts.map new file mode 100644 index 0000000..3812148 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-useless-constructor.d.ts","sourceRoot":"","sources":["../../src/rules/no-useless-constructor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;2BA+Dm+R,SAAU,gBAAgB;EA/D/8R,CAAC;AAE7D,MAAM,MAAM,OAAO,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;AA8BtE,wBA6BG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js new file mode 100644 index 0000000..6bdee67 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-useless-constructor'); +/** + * Check if method with accessibility is not useless + */ +function checkAccessibility(node) { + switch (node.accessibility) { + case 'protected': + case 'private': + return false; + case 'public': + if (node.parent.parent.superClass) { + return false; + } + break; + } + return true; +} +/** + * Check if method is not useless due to typescript parameter properties and decorators + */ +function checkParams(node) { + return !node.value.params.some(param => param.type === utils_1.AST_NODE_TYPES.TSParameterProperty || + param.decorators.length); +} +exports.default = (0, util_1.createRule)({ + name: 'no-useless-constructor', + meta: { + type: 'problem', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Disallow unnecessary constructors', + extendsBaseRule: true, + recommended: 'strict', + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions: [], + create(context) { + const rules = baseRule.create(context); + return { + MethodDefinition(node) { + if (node.value.type === utils_1.AST_NODE_TYPES.FunctionExpression && + checkAccessibility(node) && + checkParams(node)) { + rules.MethodDefinition(node); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.d.ts.map new file mode 100644 index 0000000..962c983 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-useless-empty-export.d.ts","sourceRoot":"","sources":["../../src/rules/no-useless-empty-export.ts"],"names":[],"mappings":";AA0BA,wBAyDG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js new file mode 100644 index 0000000..804dfa3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +function isEmptyExport(node) { + return (node.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration && + node.specifiers.length === 0 && + !node.declaration); +} +const exportOrImportNodeTypes = new Set([ + utils_1.AST_NODE_TYPES.ExportAllDeclaration, + utils_1.AST_NODE_TYPES.ExportDefaultDeclaration, + utils_1.AST_NODE_TYPES.ExportNamedDeclaration, + utils_1.AST_NODE_TYPES.ExportSpecifier, + utils_1.AST_NODE_TYPES.ImportDeclaration, + utils_1.AST_NODE_TYPES.TSExportAssignment, + utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration, +]); +exports.default = (0, util_1.createRule)({ + name: 'no-useless-empty-export', + meta: { + type: 'suggestion', + docs: { + description: "Disallow empty exports that don't change anything in a module file", + }, + fixable: 'code', + hasSuggestions: false, + messages: { + uselessExport: 'Empty export does nothing and can be removed.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + // In a definition file, export {} is necessary to make the module properly + // encapsulated, even when there are other exports + // https://github.com/typescript-eslint/typescript-eslint/issues/4975 + if ((0, util_1.isDefinitionFile)(context.filename)) { + return {}; + } + function checkNode(node) { + if (!Array.isArray(node.body)) { + return; + } + const emptyExports = []; + let foundOtherExport = false; + for (const statement of node.body) { + if (isEmptyExport(statement)) { + emptyExports.push(statement); + } + else if (exportOrImportNodeTypes.has(statement.type)) { + foundOtherExport = true; + } + } + if (foundOtherExport) { + for (const emptyExport of emptyExports) { + context.report({ + node: emptyExport, + messageId: 'uselessExport', + fix: fixer => fixer.remove(emptyExport), + }); + } + } + } + return { + Program: checkNode, + TSModuleDeclaration: checkNode, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.d.ts.map new file mode 100644 index 0000000..5b1bdbf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-var-requires.d.ts","sourceRoot":"","sources":["../../src/rules/no-var-requires.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;;AAErC,wBAmFG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js new file mode 100644 index 0000000..5fe2d20 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-var-requires', + meta: { + type: 'problem', + deprecated: true, + docs: { + description: 'Disallow `require` statements except in import statements', + }, + messages: { + noVarReqs: 'Require statement not part of import statement.', + }, + replacedBy: ['@typescript-eslint/no-require-imports'], + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + type: 'array', + description: 'Patterns of import paths to allow requiring from.', + items: { type: 'string' }, + }, + }, + }, + ], + }, + defaultOptions: [{ allow: [] }], + create(context, options) { + const allowPatterns = options[0].allow.map(pattern => new RegExp(pattern, 'u')); + function isImportPathAllowed(importPath) { + return allowPatterns.some(pattern => importPath.match(pattern)); + } + function isStringOrTemplateLiteral(node) { + return ((node.type === utils_1.AST_NODE_TYPES.Literal && + typeof node.value === 'string') || + node.type === utils_1.AST_NODE_TYPES.TemplateLiteral); + } + return { + 'CallExpression[callee.name="require"]'(node) { + if (node.arguments[0] && isStringOrTemplateLiteral(node.arguments[0])) { + const argValue = (0, util_1.getStaticStringValue)(node.arguments[0]); + if (typeof argValue === 'string' && isImportPathAllowed(argValue)) { + return; + } + } + const parent = node.parent.type === utils_1.AST_NODE_TYPES.ChainExpression + ? node.parent.parent + : node.parent; + if ([ + utils_1.AST_NODE_TYPES.CallExpression, + utils_1.AST_NODE_TYPES.MemberExpression, + utils_1.AST_NODE_TYPES.NewExpression, + utils_1.AST_NODE_TYPES.TSAsExpression, + utils_1.AST_NODE_TYPES.TSTypeAssertion, + utils_1.AST_NODE_TYPES.VariableDeclarator, + ].includes(parent.type)) { + const variable = utils_1.ASTUtils.findVariable(context.sourceCode.getScope(node), 'require'); + if (!variable?.identifiers.length) { + context.report({ + node, + messageId: 'noVarReqs', + }); + } + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.d.ts.map new file mode 100644 index 0000000..2030181 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"no-wrapper-object-types.d.ts","sourceRoot":"","sources":["../../src/rules/no-wrapper-object-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAiBnE,wBAsDG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.js new file mode 100644 index 0000000..11c3509 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const classNames = new Set([ + 'BigInt', + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + 'Boolean', + 'Number', + 'Object', + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + 'String', + 'Symbol', +]); +exports.default = (0, util_1.createRule)({ + name: 'no-wrapper-object-types', + meta: { + type: 'problem', + docs: { + description: 'Disallow using confusing built-in primitive class wrappers', + recommended: 'recommended', + }, + fixable: 'code', + messages: { + bannedClassType: 'Prefer using the primitive `{{preferred}}` as a type name, rather than the upper-cased `{{typeName}}`.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function checkBannedTypes(node, includeFix) { + const typeName = node.type === utils_1.AST_NODE_TYPES.Identifier && node.name; + if (!typeName || + !classNames.has(typeName) || + !(0, util_1.isReferenceToGlobalFunction)(typeName, node, context.sourceCode)) { + return; + } + const preferred = typeName.toLowerCase(); + context.report({ + node, + messageId: 'bannedClassType', + data: { preferred, typeName }, + fix: includeFix + ? (fixer) => fixer.replaceText(node, preferred) + : undefined, + }); + } + return { + TSClassImplements(node) { + checkBannedTypes(node.expression, false); + }, + TSInterfaceHeritage(node) { + checkBannedTypes(node.expression, false); + }, + TSTypeReference(node) { + checkBannedTypes(node.typeName, true); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.d.ts.map new file mode 100644 index 0000000..1c54ce9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"non-nullable-type-assertion-style.d.ts","sourceRoot":"","sources":["../../src/rules/non-nullable-type-assertion-style.ts"],"names":[],"mappings":";AAaA,wBAwIG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js new file mode 100644 index 0000000..8bcb96b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js @@ -0,0 +1,132 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'non-nullable-type-assertion-style', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce non-null assertions over explicit type assertions', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferNonNullAssertion: 'Use a ! assertion to more succinctly remove null and undefined from the type.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const getTypesIfNotLoose = (node) => { + const type = services.getTypeAtLocation(node); + if (tsutils.isTypeFlagSet(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return undefined; + } + return tsutils.unionTypeParts(type); + }; + const couldBeNullish = (type) => { + if (type.flags & ts.TypeFlags.TypeParameter) { + const constraint = type.getConstraint(); + return constraint == null || couldBeNullish(constraint); + } + if (tsutils.isUnionType(type)) { + for (const part of type.types) { + if (couldBeNullish(part)) { + return true; + } + } + return false; + } + return (type.flags & (ts.TypeFlags.Null | ts.TypeFlags.Undefined)) !== 0; + }; + const sameTypeWithoutNullish = (assertedTypes, originalTypes) => { + const nonNullishOriginalTypes = originalTypes.filter(type => (type.flags & (ts.TypeFlags.Null | ts.TypeFlags.Undefined)) === 0); + if (nonNullishOriginalTypes.length === originalTypes.length) { + return false; + } + for (const assertedType of assertedTypes) { + if (couldBeNullish(assertedType) || + !nonNullishOriginalTypes.includes(assertedType)) { + return false; + } + } + for (const originalType of nonNullishOriginalTypes) { + if (!assertedTypes.includes(originalType)) { + return false; + } + } + return true; + }; + const isConstAssertion = (node) => { + return (node.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference && + node.typeAnnotation.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + node.typeAnnotation.typeName.name === 'const'); + }; + return { + 'TSAsExpression, TSTypeAssertion'(node) { + if (isConstAssertion(node)) { + return; + } + const originalTypes = getTypesIfNotLoose(node.expression); + if (!originalTypes) { + return; + } + const assertedTypes = getTypesIfNotLoose(node.typeAnnotation); + if (!assertedTypes) { + return; + } + if (sameTypeWithoutNullish(assertedTypes, originalTypes)) { + const expressionSourceCode = context.sourceCode.getText(node.expression); + const higherPrecedenceThanUnary = (0, util_1.getOperatorPrecedence)(services.esTreeNodeToTSNodeMap.get(node.expression).kind, ts.SyntaxKind.Unknown) > util_1.OperatorPrecedence.Unary; + context.report({ + node, + messageId: 'preferNonNullAssertion', + fix(fixer) { + return fixer.replaceText(node, higherPrecedenceThanUnary + ? `${expressionSourceCode}!` + : `(${expressionSourceCode})!`); + }, + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.d.ts.map new file mode 100644 index 0000000..93f05ca --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"only-throw-error.d.ts","sourceRoot":"","sources":["../../src/rules/only-throw-error.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAYpD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5C,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;QAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC;CACF,CAAC;;AAEF,wBAuFG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.js new file mode 100644 index 0000000..3fd4c91 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.js @@ -0,0 +1,114 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'only-throw-error', + meta: { + type: 'problem', + docs: { + description: 'Disallow throwing non-`Error` values as exceptions', + extendsBaseRule: 'no-throw-literal', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + object: 'Expected an error object to be thrown.', + undef: 'Do not throw undefined.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + ...util_1.typeOrValueSpecifiersSchema, + description: 'Type specifiers that can be thrown.', + }, + allowThrowingAny: { + type: 'boolean', + description: 'Whether to always allow throwing values typed as `any`.', + }, + allowThrowingUnknown: { + type: 'boolean', + description: 'Whether to always allow throwing values typed as `unknown`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + allowThrowingAny: true, + allowThrowingUnknown: true, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const allow = options.allow; + function checkThrowArgument(node) { + if (node.type === utils_1.AST_NODE_TYPES.AwaitExpression || + node.type === utils_1.AST_NODE_TYPES.YieldExpression) { + return; + } + const type = services.getTypeAtLocation(node); + if ((0, util_1.typeMatchesSomeSpecifier)(type, allow, services.program)) { + return; + } + if (type.flags & ts.TypeFlags.Undefined) { + context.report({ node, messageId: 'undef' }); + return; + } + if (options.allowThrowingAny && (0, util_1.isTypeAnyType)(type)) { + return; + } + if (options.allowThrowingUnknown && (0, util_1.isTypeUnknownType)(type)) { + return; + } + if ((0, util_1.isErrorLike)(services.program, type)) { + return; + } + context.report({ node, messageId: 'object' }); + } + return { + ThrowStatement(node) { + checkThrowArgument(node.argument); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.d.ts.map new file mode 100644 index 0000000..b64050b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parameter-properties.d.ts","sourceRoot":"","sources":["../../src/rules/parameter-properties.ts"],"names":[],"mappings":"AAMA,KAAK,QAAQ,GACT,SAAS,GACT,kBAAkB,GAClB,WAAW,GACX,oBAAoB,GACpB,QAAQ,GACR,iBAAiB,GACjB,UAAU,CAAC;AAEf,KAAK,MAAM,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAEtD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAAG,yBAAyB,CAAC;;AAE3E,wBAiOG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js new file mode 100644 index 0000000..95a5e12 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js @@ -0,0 +1,170 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'parameter-properties', + meta: { + type: 'problem', + docs: { + description: 'Require or disallow parameter properties in class constructors', + }, + messages: { + preferClassProperty: 'Property {{parameter}} should be declared as a class property.', + preferParameterProperty: 'Property {{parameter}} should be declared as a parameter property.', + }, + schema: [ + { + type: 'object', + $defs: { + modifier: { + type: 'string', + enum: [ + 'readonly', + 'private', + 'protected', + 'public', + 'private readonly', + 'protected readonly', + 'public readonly', + ], + }, + }, + additionalProperties: false, + properties: { + allow: { + type: 'array', + description: 'Whether to allow certain kinds of properties to be ignored.', + items: { + $ref: '#/items/0/$defs/modifier', + }, + }, + prefer: { + type: 'string', + description: 'Whether to prefer class properties or parameter properties.', + enum: ['class-property', 'parameter-property'], + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + prefer: 'class-property', + }, + ], + create(context, [{ allow = [], prefer = 'class-property' }]) { + /** + * Gets the modifiers of `node`. + * @param node the node to be inspected. + */ + function getModifiers(node) { + const modifiers = []; + if (node.accessibility) { + modifiers.push(node.accessibility); + } + if (node.readonly) { + modifiers.push('readonly'); + } + return modifiers.filter(Boolean).join(' '); + } + if (prefer === 'class-property') { + return { + TSParameterProperty(node) { + const modifiers = getModifiers(node); + if (!allow.includes(modifiers)) { + // HAS to be an identifier or assignment or TSC will throw + if (node.parameter.type !== utils_1.AST_NODE_TYPES.Identifier && + node.parameter.type !== utils_1.AST_NODE_TYPES.AssignmentPattern) { + return; + } + const name = node.parameter.type === utils_1.AST_NODE_TYPES.Identifier + ? node.parameter.name + : // has to be an Identifier or TSC will throw an error + node.parameter.left.name; + context.report({ + node, + messageId: 'preferClassProperty', + data: { + parameter: name, + }, + }); + } + }, + }; + } + const propertyNodesByNameStack = []; + function getNodesByName(name) { + const propertyNodesByName = propertyNodesByNameStack[propertyNodesByNameStack.length - 1]; + const existing = propertyNodesByName.get(name); + if (existing) { + return existing; + } + const created = {}; + propertyNodesByName.set(name, created); + return created; + } + function typeAnnotationsMatch(classProperty, constructorParameter) { + if (!classProperty.typeAnnotation || + !constructorParameter.typeAnnotation) { + return (classProperty.typeAnnotation === constructorParameter.typeAnnotation); + } + return (context.sourceCode.getText(classProperty.typeAnnotation) === + context.sourceCode.getText(constructorParameter.typeAnnotation)); + } + return { + ':matches(ClassDeclaration, ClassExpression):exit'() { + const propertyNodesByName = (0, util_1.nullThrows)(propertyNodesByNameStack.pop(), 'Stack should exist on class exit'); + for (const [name, nodes] of propertyNodesByName) { + if (nodes.classProperty && + nodes.constructorAssignment && + nodes.constructorParameter && + typeAnnotationsMatch(nodes.classProperty, nodes.constructorParameter)) { + context.report({ + node: nodes.classProperty, + messageId: 'preferParameterProperty', + data: { + parameter: name, + }, + }); + } + } + }, + ClassBody(node) { + for (const element of node.body) { + if (element.type === utils_1.AST_NODE_TYPES.PropertyDefinition && + element.key.type === utils_1.AST_NODE_TYPES.Identifier && + !element.value && + !allow.includes(getModifiers(element))) { + getNodesByName(element.key.name).classProperty = element; + } + } + }, + 'ClassDeclaration, ClassExpression'() { + propertyNodesByNameStack.push(new Map()); + }, + 'MethodDefinition[kind="constructor"]'(node) { + for (const parameter of node.value.params) { + if (parameter.type === utils_1.AST_NODE_TYPES.Identifier) { + getNodesByName(parameter.name).constructorParameter = parameter; + } + } + for (const statement of node.value.body?.body ?? []) { + if (statement.type !== utils_1.AST_NODE_TYPES.ExpressionStatement || + statement.expression.type !== utils_1.AST_NODE_TYPES.AssignmentExpression || + statement.expression.left.type !== + utils_1.AST_NODE_TYPES.MemberExpression || + statement.expression.left.object.type !== + utils_1.AST_NODE_TYPES.ThisExpression || + statement.expression.left.property.type !== + utils_1.AST_NODE_TYPES.Identifier || + statement.expression.right.type !== utils_1.AST_NODE_TYPES.Identifier) { + break; + } + getNodesByName(statement.expression.right.name).constructorAssignment = statement.expression; + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.d.ts.map new file mode 100644 index 0000000..1dc9166 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-as-const.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-as-const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAMnE,wBA2EG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js new file mode 100644 index 0000000..9e7ef2f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-as-const', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce the use of `as const` over literal type', + recommended: 'recommended', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + preferConstAssertion: 'Expected a `const` instead of a literal type assertion.', + variableConstAssertion: 'Expected a `const` assertion instead of a literal type annotation.', + variableSuggest: 'You should use `as const` instead of type annotation.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function compareTypes(valueNode, typeNode, canFix) { + if (valueNode.type === utils_1.AST_NODE_TYPES.Literal && + typeNode.type === utils_1.AST_NODE_TYPES.TSLiteralType && + typeNode.literal.type === utils_1.AST_NODE_TYPES.Literal && + valueNode.raw === typeNode.literal.raw) { + if (canFix) { + context.report({ + node: typeNode, + messageId: 'preferConstAssertion', + fix: fixer => fixer.replaceText(typeNode, 'const'), + }); + } + else { + context.report({ + node: typeNode, + messageId: 'variableConstAssertion', + suggest: [ + { + messageId: 'variableSuggest', + fix: (fixer) => [ + fixer.remove(typeNode.parent), + fixer.insertTextAfter(valueNode, ' as const'), + ], + }, + ], + }); + } + } + } + return { + PropertyDefinition(node) { + if (node.value && node.typeAnnotation) { + compareTypes(node.value, node.typeAnnotation.typeAnnotation, false); + } + }, + TSAsExpression(node) { + compareTypes(node.expression, node.typeAnnotation, true); + }, + TSTypeAssertion(node) { + compareTypes(node.expression, node.typeAnnotation, true); + }, + VariableDeclarator(node) { + if (node.init && node.id.typeAnnotation) { + compareTypes(node.init, node.id.typeAnnotation.typeAnnotation, false); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.d.ts.map new file mode 100644 index 0000000..b2f7a8c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-destructuring.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-destructuring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOnE,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,QAAQ;;;;+BAuOktN,SAAU,oBAAoB;6BAAuC,SAAU,kBAAkB;EAvOvwN,CAAC;AAE3D,KAAK,WAAW,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC7D,KAAK,kBAAkB,GAAG;IACxB,uCAAuC,CAAC,EAAE,OAAO,CAAC;CACnD,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AACnB,MAAM,MAAM,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAE3D,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,QAAQ,CAAC,CAAC;;AA8CtE,wBAuHG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.js new file mode 100644 index 0000000..76b414e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.js @@ -0,0 +1,214 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('prefer-destructuring'); +const destructuringTypeConfig = { + type: 'object', + additionalProperties: false, + properties: { + array: { + type: 'boolean', + }, + object: { + type: 'boolean', + }, + }, +}; +const schema = [ + { + oneOf: [ + { + type: 'object', + additionalProperties: false, + properties: { + AssignmentExpression: destructuringTypeConfig, + VariableDeclarator: destructuringTypeConfig, + }, + }, + destructuringTypeConfig, + ], + }, + { + type: 'object', + properties: { + enforceForDeclarationWithTypeAnnotation: { + type: 'boolean', + description: 'Whether to enforce destructuring on variable declarations with type annotations.', + }, + enforceForRenamedProperties: { + type: 'boolean', + description: 'Whether to enforce destructuring that use a different variable name than the property name.', + }, + }, + }, +]; +exports.default = (0, util_1.createRule)({ + name: 'prefer-destructuring', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Require destructuring from arrays and/or objects', + extendsBaseRule: true, + requiresTypeChecking: true, + }, + fixable: baseRule.meta.fixable, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema, + }, + defaultOptions: [ + { + AssignmentExpression: { + array: true, + object: true, + }, + VariableDeclarator: { + array: true, + object: true, + }, + }, + {}, + ], + create(context, [enabledTypes, options]) { + const { enforceForDeclarationWithTypeAnnotation = false, enforceForRenamedProperties = false, } = options; + const { esTreeNodeToTSNodeMap, program } = (0, util_1.getParserServices)(context); + const typeChecker = program.getTypeChecker(); + const baseRules = baseRule.create(context); + let baseRulesWithoutFixCache = null; + return { + AssignmentExpression(node) { + if (node.operator !== '=') { + return; + } + performCheck(node.left, node.right, node); + }, + VariableDeclarator(node) { + performCheck(node.id, node.init, node); + }, + }; + function performCheck(leftNode, rightNode, reportNode) { + const rules = leftNode.type === utils_1.AST_NODE_TYPES.Identifier && + leftNode.typeAnnotation == null + ? baseRules + : baseRulesWithoutFix(); + if ((leftNode.type === utils_1.AST_NODE_TYPES.ArrayPattern || + leftNode.type === utils_1.AST_NODE_TYPES.Identifier || + leftNode.type === utils_1.AST_NODE_TYPES.ObjectPattern) && + leftNode.typeAnnotation != null && + !enforceForDeclarationWithTypeAnnotation) { + return; + } + if (rightNode != null && + isArrayLiteralIntegerIndexAccess(rightNode) && + rightNode.object.type !== utils_1.AST_NODE_TYPES.Super) { + const tsObj = esTreeNodeToTSNodeMap.get(rightNode.object); + const objType = typeChecker.getTypeAtLocation(tsObj); + if (!isTypeAnyOrIterableType(objType, typeChecker)) { + if (!enforceForRenamedProperties || + !getNormalizedEnabledType(reportNode.type, 'object')) { + return; + } + context.report({ + node: reportNode, + messageId: 'preferDestructuring', + data: { type: 'object' }, + }); + return; + } + } + if (reportNode.type === utils_1.AST_NODE_TYPES.AssignmentExpression) { + rules.AssignmentExpression(reportNode); + } + else { + rules.VariableDeclarator(reportNode); + } + } + function getNormalizedEnabledType(nodeType, destructuringType) { + if ('object' in enabledTypes || 'array' in enabledTypes) { + return enabledTypes[destructuringType]; + } + return enabledTypes[nodeType][destructuringType]; + } + function baseRulesWithoutFix() { + baseRulesWithoutFixCache ??= baseRule.create(noFixContext(context)); + return baseRulesWithoutFixCache; + } + }, +}); +function noFixContext(context) { + const customContext = { + report: (descriptor) => { + context.report({ + ...descriptor, + fix: undefined, + }); + }, + }; + // we can't directly proxy `context` because its `report` property is non-configurable + // and non-writable. So we proxy `customContext` and redirect all + // property access to the original context except for `report` + return new Proxy(customContext, { + get(target, path, receiver) { + if (path !== 'report') { + return Reflect.get(context, path, receiver); + } + return Reflect.get(target, path, receiver); + }, + }); +} +function isTypeAnyOrIterableType(type, typeChecker) { + if ((0, util_1.isTypeAnyType)(type)) { + return true; + } + if (!type.isUnion()) { + const iterator = tsutils.getWellKnownSymbolPropertyOfType(type, 'iterator', typeChecker); + return iterator != null; + } + return type.types.every(t => isTypeAnyOrIterableType(t, typeChecker)); +} +function isArrayLiteralIntegerIndexAccess(node) { + if (node.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return false; + } + if (node.property.type !== utils_1.AST_NODE_TYPES.Literal) { + return false; + } + return Number.isInteger(node.property.value); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.d.ts.map new file mode 100644 index 0000000..4265619 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-enum-initializers.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-enum-initializers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAInE,MAAM,MAAM,UAAU,GAAG,mBAAmB,GAAG,6BAA6B,CAAC;;AAE7E,wBA+DG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js new file mode 100644 index 0000000..d9549e6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-enum-initializers', + meta: { + type: 'suggestion', + docs: { + description: 'Require each enum member value to be explicitly initialized', + }, + hasSuggestions: true, + messages: { + defineInitializer: "The value of the member '{{ name }}' should be explicitly defined.", + defineInitializerSuggestion: 'Can be fixed to {{ name }} = {{ suggested }}', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function TSEnumDeclaration(node) { + const { members } = node.body; + members.forEach((member, index) => { + if (member.initializer == null) { + const name = context.sourceCode.getText(member); + context.report({ + node: member, + messageId: 'defineInitializer', + data: { + name, + }, + suggest: [ + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: index }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = ${index}`); + }, + }, + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: index + 1 }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = ${index + 1}`); + }, + }, + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: `'${name}'` }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = '${name}'`); + }, + }, + ], + }); + } + }); + } + return { + TSEnumDeclaration, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.d.ts.map new file mode 100644 index 0000000..c37430a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-find.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAiBnE,wBA2SG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js new file mode 100644 index 0000000..8b5e8bd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js @@ -0,0 +1,247 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-find', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + preferFind: 'Prefer .find(...) instead of .filter(...)[0].', + preferFindSuggestion: 'Use .find(...) instead of .filter(...)[0].', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function parseArrayFilterExpressions(expression) { + const node = (0, util_1.skipChainExpression)(expression); + if (node.type === utils_1.AST_NODE_TYPES.SequenceExpression) { + // Only the last expression in (a, b, [1, 2, 3].filter(condition))[0] matters + const lastExpression = (0, util_1.nullThrows)(node.expressions.at(-1), 'Expected to have more than zero expressions in a sequence expression'); + return parseArrayFilterExpressions(lastExpression); + } + // This is the only reason we're returning a list rather than a single value. + if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) { + // Both branches of the ternary _must_ return results. + const consequentResult = parseArrayFilterExpressions(node.consequent); + if (consequentResult.length === 0) { + return []; + } + const alternateResult = parseArrayFilterExpressions(node.alternate); + if (alternateResult.length === 0) { + return []; + } + // Accumulate the results from both sides and pass up the chain. + return [...consequentResult, ...alternateResult]; + } + // Check if it looks like <>(...), but not <>?.(...) + if (node.type === utils_1.AST_NODE_TYPES.CallExpression && !node.optional) { + const callee = node.callee; + // Check if it looks like <>.filter(...) or <>['filter'](...), + // or the optional chaining variants. + if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression) { + const isBracketSyntaxForFilter = callee.computed; + if ((0, util_1.isStaticMemberAccessOfValue)(callee, context, 'filter')) { + const filterNode = callee.property; + const filteredObjectType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object); + // As long as the object is a (possibly nullable) array, + // this is an Array.prototype.filter expression. + if (isArrayish(filteredObjectType)) { + return [ + { + filterNode, + isBracketSyntaxForFilter, + }, + ]; + } + } + } + } + // not a filter expression. + return []; + } + /** + * Tells whether the type is a possibly nullable array/tuple or union thereof. + */ + function isArrayish(type) { + let isAtLeastOneArrayishComponent = false; + for (const unionPart of tsutils.unionTypeParts(type)) { + if (tsutils.isIntrinsicNullType(unionPart) || + tsutils.isIntrinsicUndefinedType(unionPart)) { + continue; + } + // apparently checker.isArrayType(T[] & S[]) => false. + // so we need to check the intersection parts individually. + const isArrayOrIntersectionThereof = tsutils + .intersectionTypeParts(unionPart) + .every(intersectionPart => checker.isArrayType(intersectionPart) || + checker.isTupleType(intersectionPart)); + if (!isArrayOrIntersectionThereof) { + // There is a non-array, non-nullish type component, + // so it's not an array. + return false; + } + isAtLeastOneArrayishComponent = true; + } + return isAtLeastOneArrayishComponent; + } + function getObjectIfArrayAtZeroExpression(node) { + // .at() should take exactly one argument. + if (node.arguments.length !== 1) { + return undefined; + } + const callee = node.callee; + if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression && + !callee.optional && + (0, util_1.isStaticMemberAccessOfValue)(callee, context, 'at')) { + const atArgument = (0, util_1.getStaticValue)(node.arguments[0], globalScope); + if (atArgument != null && isTreatedAsZeroByArrayAt(atArgument.value)) { + return callee.object; + } + } + return undefined; + } + /** + * Implements the algorithm for array indexing by `.at()` method. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at#parameters + */ + function isTreatedAsZeroByArrayAt(value) { + // This would cause the number constructor coercion to throw. Other static + // values are safe. + if (typeof value === 'symbol') { + return false; + } + const asNumber = Number(value); + if (isNaN(asNumber)) { + return true; + } + return Math.trunc(asNumber) === 0; + } + function isMemberAccessOfZero(node) { + const property = (0, util_1.getStaticValue)(node.property, globalScope); + // Check if it looks like <>[0] or <>['0'], but not <>?.[0] + return (!node.optional && + property != null && + isTreatedAsZeroByMemberAccess(property.value)); + } + /** + * Implements the algorithm for array indexing by member operator. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#array_indices + */ + function isTreatedAsZeroByMemberAccess(value) { + return String(value) === '0'; + } + function generateFixToRemoveArrayElementAccess(fixer, arrayNode, wholeExpressionBeingFlagged) { + const tokenToStartDeletingFrom = (0, util_1.nullThrows)( + // The next `.` or `[` is what we're looking for. + // think of (...).at(0) or (...)[0] or even (...)["at"](0). + context.sourceCode.getTokenAfter(arrayNode, token => token.value === '.' || token.value === '['), 'Expected to find a member access token!'); + return fixer.removeRange([ + tokenToStartDeletingFrom.range[0], + wholeExpressionBeingFlagged.range[1], + ]); + } + function generateFixToReplaceFilterWithFind(fixer, filterExpression) { + return fixer.replaceText(filterExpression.filterNode, filterExpression.isBracketSyntaxForFilter ? '"find"' : 'find'); + } + return { + // This query will be used to find things like `filteredResults.at(0)`. + CallExpression(node) { + const object = getObjectIfArrayAtZeroExpression(node); + if (object) { + const filterExpressions = parseArrayFilterExpressions(object); + if (filterExpressions.length !== 0) { + context.report({ + node, + messageId: 'preferFind', + suggest: [ + { + messageId: 'preferFindSuggestion', + fix: (fixer) => { + return [ + ...filterExpressions.map(filterExpression => generateFixToReplaceFilterWithFind(fixer, filterExpression)), + // Get rid of the .at(0) or ['at'](0). + generateFixToRemoveArrayElementAccess(fixer, object, node), + ]; + }, + }, + ], + }); + } + } + }, + // This query will be used to find things like `filteredResults[0]`. + // + // Note: we're always looking for array member access to be "computed", + // i.e. `filteredResults[0]`, since `filteredResults.0` isn't a thing. + 'MemberExpression[computed=true]'(node) { + if (isMemberAccessOfZero(node)) { + const object = node.object; + const filterExpressions = parseArrayFilterExpressions(object); + if (filterExpressions.length !== 0) { + context.report({ + node, + messageId: 'preferFind', + suggest: [ + { + messageId: 'preferFindSuggestion', + fix: (fixer) => { + return [ + ...filterExpressions.map(filterExpression => generateFixToReplaceFilterWithFind(fixer, filterExpression)), + // Get rid of the [0]. + generateFixToRemoveArrayElementAccess(fixer, object, node), + ]; + }, + }, + ], + }); + } + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.d.ts.map new file mode 100644 index 0000000..f218616 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-for-of.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-for-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAMnE,wBAgKG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js new file mode 100644 index 0000000..e77461a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js @@ -0,0 +1,115 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-for-of', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce the use of `for-of` loop over the standard `for` loop where possible', + recommended: 'stylistic', + }, + messages: { + preferForOf: 'Expected a `for-of` loop instead of a `for` loop with this simple iteration.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function isSingleVariableDeclaration(node) { + return (node?.type === utils_1.AST_NODE_TYPES.VariableDeclaration && + node.kind !== 'const' && + node.declarations.length === 1); + } + function isLiteral(node, value) { + return node.type === utils_1.AST_NODE_TYPES.Literal && node.value === value; + } + function isZeroInitialized(node) { + return node.init != null && isLiteral(node.init, 0); + } + function isMatchingIdentifier(node, name) { + return node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === name; + } + function isLessThanLengthExpression(node, name) { + if (node?.type === utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '<' && + isMatchingIdentifier(node.left, name) && + node.right.type === utils_1.AST_NODE_TYPES.MemberExpression && + isMatchingIdentifier(node.right.property, 'length')) { + return node.right.object; + } + return null; + } + function isIncrement(node, name) { + if (!node) { + return false; + } + switch (node.type) { + case utils_1.AST_NODE_TYPES.UpdateExpression: + // x++ or ++x + return (node.operator === '++' && isMatchingIdentifier(node.argument, name)); + case utils_1.AST_NODE_TYPES.AssignmentExpression: + if (isMatchingIdentifier(node.left, name)) { + if (node.operator === '+=') { + // x += 1 + return isLiteral(node.right, 1); + } + if (node.operator === '=') { + // x = x + 1 or x = 1 + x + const expr = node.right; + return (expr.type === utils_1.AST_NODE_TYPES.BinaryExpression && + expr.operator === '+' && + ((isMatchingIdentifier(expr.left, name) && + isLiteral(expr.right, 1)) || + (isLiteral(expr.left, 1) && + isMatchingIdentifier(expr.right, name)))); + } + } + } + return false; + } + function contains(outer, inner) { + return (outer.range[0] <= inner.range[0] && outer.range[1] >= inner.range[1]); + } + function isIndexOnlyUsedWithArray(body, indexVar, arrayExpression) { + const arrayText = context.sourceCode.getText(arrayExpression); + return indexVar.references.every(reference => { + const id = reference.identifier; + const node = id.parent; + return (!contains(body, id) || + (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.object.type !== utils_1.AST_NODE_TYPES.ThisExpression && + node.property === id && + context.sourceCode.getText(node.object) === arrayText && + !(0, util_1.isAssignee)(node))); + }); + } + return { + 'ForStatement:exit'(node) { + if (!isSingleVariableDeclaration(node.init)) { + return; + } + const declarator = node.init.declarations[0]; + if (!declarator || + !isZeroInitialized(declarator) || + declarator.id.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const indexName = declarator.id.name; + const arrayExpression = isLessThanLengthExpression(node.test, indexName); + if (!arrayExpression) { + return; + } + const [indexVar] = context.sourceCode.getDeclaredVariables(node.init); + if (isIncrement(node.update, indexName) && + isIndexOnlyUsedWithArray(node.body, indexVar, arrayExpression)) { + context.report({ + node, + messageId: 'preferForOf', + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.d.ts.map new file mode 100644 index 0000000..ebe1960 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-function-type.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-function-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAMnE,eAAO,MAAM,OAAO;;;CAGV,CAAC;;AAEX,wBAsNG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js new file mode 100644 index 0000000..b933734 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js @@ -0,0 +1,186 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.phrases = void 0; +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.phrases = { + [utils_1.AST_NODE_TYPES.TSInterfaceDeclaration]: 'Interface', + [utils_1.AST_NODE_TYPES.TSTypeLiteral]: 'Type literal', +}; +exports.default = (0, util_1.createRule)({ + name: 'prefer-function-type', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using function types instead of interfaces with call signatures', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + functionTypeOverCallableType: '{{ literalOrInterface }} only has a call signature, you should use a function type instead.', + unexpectedThisOnFunctionOnlyInterface: "`this` refers to the function type '{{ interfaceName }}', did you intend to use a generic `this` parameter like `(this: Self, ...) => Self` instead?", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * Checks if there the interface has exactly one supertype that isn't named 'Function' + * @param node The node being checked + */ + function hasOneSupertype(node) { + if (node.extends.length === 0) { + return false; + } + if (node.extends.length !== 1) { + return true; + } + const expr = node.extends[0].expression; + return (expr.type !== utils_1.AST_NODE_TYPES.Identifier || expr.name !== 'Function'); + } + /** + * @param parent The parent of the call signature causing the diagnostic + */ + function shouldWrapSuggestion(parent) { + if (!parent) { + return false; + } + switch (parent.type) { + case utils_1.AST_NODE_TYPES.TSUnionType: + case utils_1.AST_NODE_TYPES.TSIntersectionType: + case utils_1.AST_NODE_TYPES.TSArrayType: + return true; + default: + return false; + } + } + /** + * @param member The TypeElement being checked + * @param node The parent of member being checked + */ + function checkMember(member, node, tsThisTypes = null) { + if ((member.type === utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration || + member.type === utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration) && + member.returnType != null) { + if (tsThisTypes?.length && + node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) { + // the message can be confusing if we don't point directly to the `this` node instead of the whole member + // and in favour of generating at most one error we'll only report the first occurrence of `this` if there are multiple + context.report({ + node: tsThisTypes[0], + messageId: 'unexpectedThisOnFunctionOnlyInterface', + data: { + interfaceName: node.id.name, + }, + }); + return; + } + const fixable = node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration; + const fix = fixable + ? null + : (fixer) => { + const fixes = []; + const start = member.range[0]; + // https://github.com/microsoft/TypeScript/pull/56908 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const colonPos = member.returnType.range[0] - start; + const text = context.sourceCode + .getText() + .slice(start, member.range[1]); + const comments = [ + ...context.sourceCode.getCommentsBefore(member), + ...context.sourceCode.getCommentsAfter(member), + ]; + let suggestion = `${text.slice(0, colonPos)} =>${text.slice(colonPos + 1)}`; + const lastChar = suggestion.endsWith(';') ? ';' : ''; + if (lastChar) { + suggestion = suggestion.slice(0, -1); + } + if (shouldWrapSuggestion(node.parent)) { + suggestion = `(${suggestion})`; + } + if (node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) { + if (node.typeParameters != null) { + suggestion = `type ${context.sourceCode + .getText() + .slice(node.id.range[0], node.typeParameters.range[1])} = ${suggestion}${lastChar}`; + } + else { + suggestion = `type ${node.id.name} = ${suggestion}${lastChar}`; + } + } + const isParentExported = node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration; + if (node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration && + isParentExported) { + const commentsText = comments + .map(({ type, value }) => type === utils_1.AST_TOKEN_TYPES.Line + ? `//${value}\n` + : `/*${value}*/\n`) + .join(''); + // comments should move before export and not between export and interface declaration + fixes.push(fixer.insertTextBefore(node.parent, commentsText)); + } + else { + comments.forEach(comment => { + let commentText = comment.type === utils_1.AST_TOKEN_TYPES.Line + ? `//${comment.value}` + : `/*${comment.value}*/`; + const isCommentOnTheSameLine = comment.loc.start.line === member.loc.start.line; + if (!isCommentOnTheSameLine) { + commentText += '\n'; + } + else { + commentText += ' '; + } + suggestion = commentText + suggestion; + }); + } + const fixStart = node.range[0]; + fixes.push(fixer.replaceTextRange([fixStart, node.range[1]], suggestion)); + return fixes; + }; + context.report({ + node: member, + messageId: 'functionTypeOverCallableType', + data: { + literalOrInterface: exports.phrases[node.type], + }, + fix, + }); + } + } + let tsThisTypes = null; + let literalNesting = 0; + return { + TSInterfaceDeclaration() { + // when entering an interface reset the count of `this`s to empty. + tsThisTypes = []; + }, + 'TSInterfaceDeclaration:exit'(node) { + if (!hasOneSupertype(node) && node.body.body.length === 1) { + checkMember(node.body.body[0], node, tsThisTypes); + } + // on exit check member and reset the array to nothing. + tsThisTypes = null; + }, + 'TSInterfaceDeclaration TSThisType'(node) { + // inside an interface keep track of all ThisType references. + // unless it's inside a nested type literal in which case it's invalid code anyway + // we don't want to incorrectly say "it refers to name" while typescript says it's completely invalid. + if (literalNesting === 0 && tsThisTypes != null) { + tsThisTypes.push(node); + } + }, + // keep track of nested literals to avoid complaining about invalid `this` uses + 'TSInterfaceDeclaration TSTypeLiteral'() { + literalNesting += 1; + }, + 'TSInterfaceDeclaration TSTypeLiteral:exit'() { + literalNesting -= 1; + }, + 'TSTypeLiteral[members.length = 1]'(node) { + checkMember(node.members[0], node); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.d.ts.map new file mode 100644 index 0000000..000e3a2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-includes.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-includes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAcnE,wBAkQG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js new file mode 100644 index 0000000..171dac6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js @@ -0,0 +1,242 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const regexpp_1 = require("@eslint-community/regexpp"); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-includes', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce `includes` method over `indexOf` method', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferIncludes: "Use 'includes()' method instead.", + preferStringIncludes: 'Use `String#includes()` method with a string instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function isNumber(node, value) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return evaluated != null && evaluated.value === value; + } + function isPositiveCheck(node) { + switch (node.operator) { + case '!==': + case '!=': + case '>': + return isNumber(node.right, -1); + case '>=': + return isNumber(node.right, 0); + default: + return false; + } + } + function isNegativeCheck(node) { + switch (node.operator) { + case '===': + case '==': + case '<=': + return isNumber(node.right, -1); + case '<': + return isNumber(node.right, 0); + default: + return false; + } + } + function hasSameParameters(nodeA, nodeB) { + if (!ts.isFunctionLike(nodeA) || !ts.isFunctionLike(nodeB)) { + return false; + } + const paramsA = nodeA.parameters; + const paramsB = nodeB.parameters; + if (paramsA.length !== paramsB.length) { + return false; + } + for (let i = 0; i < paramsA.length; ++i) { + const paramA = paramsA[i]; + const paramB = paramsB[i]; + // Check name, type, and question token once. + if (paramA.getText() !== paramB.getText()) { + return false; + } + } + return true; + } + /** + * Parse a given node if it's a `RegExp` instance. + * @param node The node to parse. + */ + function parseRegExp(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + if (evaluated == null || !(evaluated.value instanceof RegExp)) { + return null; + } + const { flags, pattern } = (0, regexpp_1.parseRegExpLiteral)(evaluated.value); + if (pattern.alternatives.length !== 1 || + flags.ignoreCase || + flags.global) { + return null; + } + // Check if it can determine a unique string. + const chars = pattern.alternatives[0].elements; + if (!chars.every(c => c.type === 'Character')) { + return null; + } + // To string. + return String.fromCodePoint(...chars.map(c => c.value)); + } + function escapeString(str) { + const EscapeMap = { + '\0': '\\0', + '\t': '\\t', + '\n': '\\n', + '\v': '\\v', + '\f': '\\f', + '\r': '\\r', + "'": "\\'", + '\\': '\\\\', + // "\b" cause unexpected replacements + // '\b': '\\b', + }; + const replaceRegex = new RegExp(Object.values(EscapeMap).join('|'), 'g'); + return str.replaceAll(replaceRegex, char => EscapeMap[char]); + } + function checkArrayIndexOf(node, allowFixing) { + if (!(0, util_1.isStaticMemberAccessOfValue)(node, context, 'indexOf')) { + return; + } + // Check if the comparison is equivalent to `includes()`. + const callNode = node.parent; + const compareNode = (callNode.parent.type === utils_1.AST_NODE_TYPES.ChainExpression + ? callNode.parent.parent + : callNode.parent); + const negative = isNegativeCheck(compareNode); + if (!negative && !isPositiveCheck(compareNode)) { + return; + } + // Get the symbol of `indexOf` method. + const indexofMethodDeclarations = services + .getSymbolAtLocation(node.property) + ?.getDeclarations(); + if (indexofMethodDeclarations == null || + indexofMethodDeclarations.length === 0) { + return; + } + // Check if every declaration of `indexOf` method has `includes` method + // and the two methods have the same parameters. + for (const instanceofMethodDecl of indexofMethodDeclarations) { + const typeDecl = instanceofMethodDecl.parent; + const type = checker.getTypeAtLocation(typeDecl); + const includesMethodDecl = type + .getProperty('includes') + ?.getDeclarations(); + if (!includesMethodDecl?.some(includesMethodDecl => hasSameParameters(includesMethodDecl, instanceofMethodDecl))) { + return; + } + } + // Report it. + context.report({ + node: compareNode, + messageId: 'preferIncludes', + ...(allowFixing && { + *fix(fixer) { + if (negative) { + yield fixer.insertTextBefore(callNode, '!'); + } + yield fixer.replaceText(node.property, 'includes'); + yield fixer.removeRange([callNode.range[1], compareNode.range[1]]); + }, + }), + }); + } + return { + // a.indexOf(b) !== 1 + 'BinaryExpression > CallExpression.left > MemberExpression'(node) { + checkArrayIndexOf(node, /* allowFixing */ true); + }, + // a?.indexOf(b) !== 1 + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression'(node) { + checkArrayIndexOf(node, /* allowFixing */ false); + }, + // /bar/.test(foo) + 'CallExpression[arguments.length=1] > MemberExpression.callee[property.name="test"][computed=false]'(node) { + const callNode = node.parent; + const text = parseRegExp(node.object); + if (text == null) { + return; + } + //check the argument type of test methods + const argument = callNode.arguments[0]; + const type = (0, util_1.getConstrainedTypeAtLocation)(services, argument); + const includesMethodDecl = type + .getProperty('includes') + ?.getDeclarations(); + if (includesMethodDecl == null) { + return; + } + context.report({ + node: callNode, + messageId: 'preferStringIncludes', + *fix(fixer) { + const argNode = callNode.arguments[0]; + const needsParen = argNode.type !== utils_1.AST_NODE_TYPES.Literal && + argNode.type !== utils_1.AST_NODE_TYPES.TemplateLiteral && + argNode.type !== utils_1.AST_NODE_TYPES.Identifier && + argNode.type !== utils_1.AST_NODE_TYPES.MemberExpression && + argNode.type !== utils_1.AST_NODE_TYPES.CallExpression; + yield fixer.removeRange([callNode.range[0], argNode.range[0]]); + yield fixer.removeRange([argNode.range[1], callNode.range[1]]); + if (needsParen) { + yield fixer.insertTextBefore(argNode, '('); + yield fixer.insertTextAfter(argNode, ')'); + } + yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}includes('${escapeString(text)}')`); + }, + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.d.ts.map new file mode 100644 index 0000000..c7e341c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-literal-enum-member.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-literal-enum-member.ts"],"names":[],"mappings":";;;AAMA,wBAmJG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js new file mode 100644 index 0000000..168fdcd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js @@ -0,0 +1,116 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-literal-enum-member', + meta: { + type: 'suggestion', + docs: { + description: 'Require all enum members to be literal values', + recommended: 'strict', + requiresTypeChecking: false, + }, + messages: { + notLiteral: `Explicit enum value must only be a literal value (string or number).`, + notLiteralOrBitwiseExpression: `Explicit enum value must only be a literal value (string or number) or a bitwise expression.`, + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowBitwiseExpressions: { + type: 'boolean', + description: 'Whether to allow using bitwise expressions in enum initializers.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowBitwiseExpressions: false, + }, + ], + create(context, [{ allowBitwiseExpressions }]) { + function isIdentifierWithName(node, name) { + return node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === name; + } + function hasEnumMember(decl, name) { + return decl.body.members.some(member => isIdentifierWithName(member.id, name) || + (member.id.type === utils_1.AST_NODE_TYPES.Literal && + (0, util_1.getStaticStringValue)(member.id) === name)); + } + function isSelfEnumMember(decl, node) { + if (node.type === utils_1.AST_NODE_TYPES.Identifier) { + return hasEnumMember(decl, node.name); + } + if (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + isIdentifierWithName(node.object, decl.id.name)) { + if (node.property.type === utils_1.AST_NODE_TYPES.Identifier) { + return hasEnumMember(decl, node.property.name); + } + if (node.computed) { + const propertyName = (0, util_1.getStaticStringValue)(node.property); + if (propertyName) { + return hasEnumMember(decl, propertyName); + } + } + } + return false; + } + return { + TSEnumMember(node) { + // If there is no initializer, then this node is just the name of the member, so ignore. + if (node.initializer == null) { + return; + } + const declaration = node.parent.parent; + function isAllowedInitializerExpressionRecursive(node, partOfBitwiseComputation) { + // You can only refer to an enum member if it's part of a bitwise computation. + // so C = B isn't allowed (special case), but C = A | B is. + if (partOfBitwiseComputation && isSelfEnumMember(declaration, node)) { + return true; + } + switch (node.type) { + // any old literal + case utils_1.AST_NODE_TYPES.Literal: + return true; + // TemplateLiteral without expressions + case utils_1.AST_NODE_TYPES.TemplateLiteral: + return node.expressions.length === 0; + case utils_1.AST_NODE_TYPES.UnaryExpression: + // +123, -123, etc. + if (['-', '+'].includes(node.operator)) { + return isAllowedInitializerExpressionRecursive(node.argument, partOfBitwiseComputation); + } + if (allowBitwiseExpressions) { + return (node.operator === '~' && + isAllowedInitializerExpressionRecursive(node.argument, true)); + } + return false; + case utils_1.AST_NODE_TYPES.BinaryExpression: + if (allowBitwiseExpressions) { + return (['&', '^', '<<', '>>', '>>>', '|'].includes(node.operator) && + isAllowedInitializerExpressionRecursive(node.left, true) && + isAllowedInitializerExpressionRecursive(node.right, true)); + } + return false; + default: + return false; + } + } + if (isAllowedInitializerExpressionRecursive(node.initializer, false)) { + return; + } + context.report({ + node: node.id, + messageId: allowBitwiseExpressions + ? 'notLiteralOrBitwiseExpression' + : 'notLiteral', + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.d.ts.map new file mode 100644 index 0000000..208d056 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-namespace-keyword.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-namespace-keyword.ts"],"names":[],"mappings":";AAIA,wBA2CG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js new file mode 100644 index 0000000..f606def --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-namespace-keyword', + meta: { + type: 'suggestion', + docs: { + description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules', + recommended: 'recommended', + }, + fixable: 'code', + messages: { + useNamespace: "Use 'namespace' instead of 'module' to declare custom TypeScript modules.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + TSModuleDeclaration(node) { + // Do nothing if the name is a string. + if (node.id.type === utils_1.AST_NODE_TYPES.Literal) { + return; + } + // Get tokens of the declaration header. + const moduleType = context.sourceCode.getTokenBefore(node.id); + if (moduleType && + moduleType.type === utils_1.AST_TOKEN_TYPES.Identifier && + moduleType.value === 'module') { + context.report({ + node, + messageId: 'useNamespace', + fix(fixer) { + return fixer.replaceText(moduleType, 'namespace'); + }, + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.d.ts.map new file mode 100644 index 0000000..a92aaa6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-nullish-coalescing.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-nullish-coalescing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AA8BnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,sDAAsD,CAAC,EAAE,OAAO,CAAC;QACjE,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,6BAA6B,CAAC,EAAE,OAAO,CAAC;QACxC,gBAAgB,CAAC,EACb;YACE,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,MAAM,CAAC,EAAE,OAAO,CAAC;SAClB,GACD,IAAI,CAAC;QACT,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,0BAA0B,GAC1B,gBAAgB,CAAC;;AAErB,wBAmeG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js new file mode 100644 index 0000000..abfdaee --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js @@ -0,0 +1,520 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const isIdentifierOrMemberOrChainExpression = (0, util_1.isNodeOfTypes)([ + utils_1.AST_NODE_TYPES.ChainExpression, + utils_1.AST_NODE_TYPES.Identifier, + utils_1.AST_NODE_TYPES.MemberExpression, +]); +exports.default = (0, util_1.createRule)({ + name: 'prefer-nullish-coalescing', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using the nullish coalescing operator instead of logical assignments or chaining', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + preferNullishOverOr: 'Prefer using nullish coalescing operator (`??{{ equals }}`) instead of a logical {{ description }} (`||{{ equals }}`), as it is a safer operator.', + preferNullishOverTernary: 'Prefer using nullish coalescing operator (`??{{ equals }}`) instead of a ternary expression, as it is simpler to read.', + suggestNullish: 'Fix to nullish coalescing operator (`??{{ equals }}`).', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.', + }, + ignoreBooleanCoercion: { + type: 'boolean', + description: 'Whether to ignore arguments to the `Boolean` constructor', + }, + ignoreConditionalTests: { + type: 'boolean', + description: 'Whether to ignore cases that are located within a conditional test.', + }, + ignoreMixedLogicalExpressions: { + type: 'boolean', + description: 'Whether to ignore any logical or expressions that are part of a mixed logical expression (with `&&`).', + }, + ignorePrimitives: { + description: 'Whether to ignore all (`true`) or some (an object with properties) primitive types.', + oneOf: [ + { + type: 'object', + description: 'Which primitives types may be ignored.', + properties: { + bigint: { + type: 'boolean', + description: 'Ignore bigint primitive types.', + }, + boolean: { + type: 'boolean', + description: 'Ignore boolean primitive types.', + }, + number: { + type: 'boolean', + description: 'Ignore number primitive types.', + }, + string: { + type: 'boolean', + description: 'Ignore string primitive types.', + }, + }, + }, + { + type: 'boolean', + description: 'Ignore all primitive types.', + enum: [true], + }, + ], + }, + ignoreTernaryTests: { + type: 'boolean', + description: 'Whether to ignore any ternary expressions that could be simplified by using the nullish coalescing operator.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + ignoreBooleanCoercion: false, + ignoreConditionalTests: true, + ignoreMixedLogicalExpressions: false, + ignorePrimitives: { + bigint: false, + boolean: false, + number: false, + string: false, + }, + ignoreTernaryTests: false, + }, + ], + create(context, [{ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, ignoreBooleanCoercion, ignoreConditionalTests, ignoreMixedLogicalExpressions, ignorePrimitives, ignoreTernaryTests, },]) { + const parserServices = (0, util_1.getParserServices)(context); + const compilerOptions = parserServices.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + /** + * Checks whether a type tested for truthiness is eligible for conversion to + * a nullishness check, taking into account the rule's configuration. + */ + function isTypeEligibleForPreferNullish(type) { + if (!(0, util_1.isPossiblyNullish)(type)) { + return false; + } + const ignorableFlags = [ + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + (ignorePrimitives === true || ignorePrimitives.bigint) && + ts.TypeFlags.BigIntLike, + (ignorePrimitives === true || ignorePrimitives.boolean) && + ts.TypeFlags.BooleanLike, + (ignorePrimitives === true || ignorePrimitives.number) && + ts.TypeFlags.NumberLike, + (ignorePrimitives === true || ignorePrimitives.string) && + ts.TypeFlags.StringLike, + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + ] + .filter((flag) => typeof flag === 'number') + .reduce((previous, flag) => previous | flag, 0); + if (type.flags !== ts.TypeFlags.Null && + type.flags !== ts.TypeFlags.Undefined && + type.types.some(t => tsutils + .intersectionTypeParts(t) + .some(t => tsutils.isTypeFlagSet(t, ignorableFlags)))) { + return false; + } + return true; + } + /** + * Determines whether a control flow construct that uses the truthiness of + * a test expression is eligible for conversion to the nullish coalescing + * operator, taking into account (both dependent on the rule's configuration): + * 1. Whether the construct is in a permitted syntactic context + * 2. Whether the type of the test expression is deemed eligible for + * conversion + * + * @param node The overall node to be converted (e.g. `a || b` or `a ? a : b`) + * @param testNode The node being tested (i.e. `a`) + */ + function isTruthinessCheckEligibleForPreferNullish({ node, testNode, }) { + const testType = parserServices.getTypeAtLocation(testNode); + if (!isTypeEligibleForPreferNullish(testType)) { + return false; + } + if (ignoreConditionalTests === true && isConditionalTest(node)) { + return false; + } + if (ignoreBooleanCoercion === true && + isBooleanConstructorContext(node, context)) { + return false; + } + return true; + } + function checkAndFixWithPreferNullishOverOr(node, description, equals) { + if (!isTruthinessCheckEligibleForPreferNullish({ + node, + testNode: node.left, + })) { + return; + } + if (ignoreMixedLogicalExpressions === true && + isMixedLogicalExpression(node)) { + return; + } + const barBarOperator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.left, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === node.operator), util_1.NullThrowsReasons.MissingToken('operator', node.type)); + function* fix(fixer) { + if ((0, util_1.isLogicalOrOperator)(node.parent)) { + // '&&' and '??' operations cannot be mixed without parentheses (e.g. a && b ?? c) + if (node.left.type === utils_1.AST_NODE_TYPES.LogicalExpression && + !(0, util_1.isLogicalOrOperator)(node.left.left)) { + yield fixer.insertTextBefore(node.left.right, '('); + } + else { + yield fixer.insertTextBefore(node.left, '('); + } + yield fixer.insertTextAfter(node.right, ')'); + } + yield fixer.replaceText(barBarOperator, node.operator.replace('||', '??')); + } + context.report({ + node: barBarOperator, + messageId: 'preferNullishOverOr', + data: { description, equals }, + suggest: [ + { + messageId: 'suggestNullish', + data: { equals }, + fix, + }, + ], + }); + } + return { + 'AssignmentExpression[operator = "||="]'(node) { + checkAndFixWithPreferNullishOverOr(node, 'assignment', '='); + }, + ConditionalExpression(node) { + if (ignoreTernaryTests) { + return; + } + let operator; + let nodesInsideTestExpression = []; + if (node.test.type === utils_1.AST_NODE_TYPES.BinaryExpression) { + nodesInsideTestExpression = [node.test.left, node.test.right]; + if (node.test.operator === '==' || + node.test.operator === '!=' || + node.test.operator === '===' || + node.test.operator === '!==') { + operator = node.test.operator; + } + } + else if (node.test.type === utils_1.AST_NODE_TYPES.LogicalExpression && + node.test.left.type === utils_1.AST_NODE_TYPES.BinaryExpression && + node.test.right.type === utils_1.AST_NODE_TYPES.BinaryExpression) { + nodesInsideTestExpression = [ + node.test.left.left, + node.test.left.right, + node.test.right.left, + node.test.right.right, + ]; + if (['||', '||='].includes(node.test.operator)) { + if (node.test.left.operator === '===' && + node.test.right.operator === '===') { + operator = '==='; + } + else if (((node.test.left.operator === '===' || + node.test.right.operator === '===') && + (node.test.left.operator === '==' || + node.test.right.operator === '==')) || + (node.test.left.operator === '==' && + node.test.right.operator === '==')) { + operator = '=='; + } + } + else if (node.test.operator === '&&') { + if (node.test.left.operator === '!==' && + node.test.right.operator === '!==') { + operator = '!=='; + } + else if (((node.test.left.operator === '!==' || + node.test.right.operator === '!==') && + (node.test.left.operator === '!=' || + node.test.right.operator === '!=')) || + (node.test.left.operator === '!=' && + node.test.right.operator === '!=')) { + operator = '!='; + } + } + } + let nullishCoalescingLeftNode; + let hasTruthinessCheck = false; + let hasNullCheckWithoutTruthinessCheck = false; + let hasUndefinedCheckWithoutTruthinessCheck = false; + if (!operator) { + let testNode; + hasTruthinessCheck = true; + if (isIdentifierOrMemberOrChainExpression(node.test)) { + testNode = node.test; + } + else if (node.test.type === utils_1.AST_NODE_TYPES.UnaryExpression && + isIdentifierOrMemberOrChainExpression(node.test.argument) && + node.test.operator === '!') { + testNode = node.test.argument; + operator = '!'; + } + if (testNode && + areNodesSimilarMemberAccess(testNode, getBranchNodes(node, operator).nonNullishBranch)) { + nullishCoalescingLeftNode = testNode; + } + } + else { + // we check that the test only contains null, undefined and the identifier + for (const testNode of nodesInsideTestExpression) { + if ((0, util_1.isNullLiteral)(testNode)) { + hasNullCheckWithoutTruthinessCheck = true; + } + else if ((0, util_1.isUndefinedIdentifier)(testNode)) { + hasUndefinedCheckWithoutTruthinessCheck = true; + } + else if (areNodesSimilarMemberAccess(testNode, getBranchNodes(node, operator).nonNullishBranch)) { + // Only consider the first expression in a multi-part nullish check, + // as subsequent expressions might not require all the optional chaining operators. + // For example: a?.b?.c !== undefined && a.b.c !== null ? a.b.c : 'foo'; + // This works because `node.test` is always evaluated first in the loop + // and has the same or more necessary optional chaining operators + // than `node.alternate` or `node.consequent`. + nullishCoalescingLeftNode ??= testNode; + } + else { + return; + } + } + } + if (!nullishCoalescingLeftNode) { + return; + } + const isFixableWithPreferNullishOverTernary = (() => { + // x ? x : y and !x ? y : x patterns + if (hasTruthinessCheck) { + return isTruthinessCheckEligibleForPreferNullish({ + node, + testNode: nullishCoalescingLeftNode, + }); + } + // it is fixable if we check for both null and undefined, or not if neither + if (hasUndefinedCheckWithoutTruthinessCheck === + hasNullCheckWithoutTruthinessCheck) { + return hasUndefinedCheckWithoutTruthinessCheck; + } + // it is fixable if we loosely check for either null or undefined + if (operator === '==' || operator === '!=') { + return true; + } + const type = parserServices.getTypeAtLocation(nullishCoalescingLeftNode); + const flags = (0, util_1.getTypeFlags)(type); + if (flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return false; + } + const hasNullType = (flags & ts.TypeFlags.Null) !== 0; + // it is fixable if we check for undefined and the type is not nullable + if (hasUndefinedCheckWithoutTruthinessCheck && !hasNullType) { + return true; + } + const hasUndefinedType = (flags & ts.TypeFlags.Undefined) !== 0; + // it is fixable if we check for null and the type can't be undefined + return hasNullCheckWithoutTruthinessCheck && !hasUndefinedType; + })(); + if (isFixableWithPreferNullishOverTernary) { + context.report({ + node, + messageId: 'preferNullishOverTernary', + // TODO: also account for = in the ternary clause + data: { equals: '' }, + suggest: [ + { + messageId: 'suggestNullish', + data: { equals: '' }, + fix(fixer) { + return fixer.replaceText(node, `${(0, util_1.getTextWithParentheses)(context.sourceCode, nullishCoalescingLeftNode)} ?? ${(0, util_1.getTextWithParentheses)(context.sourceCode, getBranchNodes(node, operator).nullishBranch)}`); + }, + }, + ], + }); + } + }, + 'LogicalExpression[operator = "||"]'(node) { + checkAndFixWithPreferNullishOverOr(node, 'or', ''); + }, + }; + }, +}); +function isConditionalTest(node) { + const parent = node.parent; + if (parent == null) { + return false; + } + if (parent.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + return isConditionalTest(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + (parent.consequent === node || parent.alternate === node)) { + return isConditionalTest(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression && + parent.expressions.at(-1) === node) { + return isConditionalTest(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + parent.operator === '!') { + return isConditionalTest(parent); + } + if ((parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression || + parent.type === utils_1.AST_NODE_TYPES.DoWhileStatement || + parent.type === utils_1.AST_NODE_TYPES.IfStatement || + parent.type === utils_1.AST_NODE_TYPES.ForStatement || + parent.type === utils_1.AST_NODE_TYPES.WhileStatement) && + parent.test === node) { + return true; + } + return false; +} +function isBooleanConstructorContext(node, context) { + const parent = node.parent; + if (parent == null) { + return false; + } + if (parent.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + return isBooleanConstructorContext(parent, context); + } + if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + (parent.consequent === node || parent.alternate === node)) { + return isBooleanConstructorContext(parent, context); + } + if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression && + parent.expressions.at(-1) === node) { + return isBooleanConstructorContext(parent, context); + } + return isBuiltInBooleanCall(parent, context); +} +function isBuiltInBooleanCall(node, context) { + if (node.type === utils_1.AST_NODE_TYPES.CallExpression && + node.callee.type === utils_1.AST_NODE_TYPES.Identifier && + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + node.callee.name === 'Boolean' && + node.arguments[0]) { + const scope = context.sourceCode.getScope(node); + const variable = scope.set.get(utils_1.AST_TOKEN_TYPES.Boolean); + return variable == null || variable.defs.length === 0; + } + return false; +} +function isMixedLogicalExpression(node) { + const seen = new Set(); + const queue = [node.parent, node.left, node.right]; + for (const current of queue) { + if (seen.has(current)) { + continue; + } + seen.add(current); + if (current.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + if (current.operator === '&&') { + return true; + } + if (['||', '||='].includes(current.operator)) { + // check the pieces of the node to catch cases like `a || b || c && d` + queue.push(current.parent, current.left, current.right); + } + } + } + return false; +} +/** + * Checks if two TSESTree nodes have the same member access sequence, + * regardless of optional chaining differences. + * + * Note: This does not imply that the nodes are runtime-equivalent. + * + * Example: `a.b.c`, `a?.b.c`, `a.b?.c`, `(a?.b).c`, `(a.b)?.c` are considered similar. + * + * @param a First TSESTree node. + * @param b Second TSESTree node. + * @returns `true` if the nodes access members in the same order; otherwise, `false`. + */ +function areNodesSimilarMemberAccess(a, b) { + if (a.type === utils_1.AST_NODE_TYPES.MemberExpression && + b.type === utils_1.AST_NODE_TYPES.MemberExpression) { + return ((0, util_1.isNodeEqual)(a.property, b.property) && + areNodesSimilarMemberAccess(a.object, b.object)); + } + if (a.type === utils_1.AST_NODE_TYPES.ChainExpression || + b.type === utils_1.AST_NODE_TYPES.ChainExpression) { + return areNodesSimilarMemberAccess((0, util_1.skipChainExpression)(a), (0, util_1.skipChainExpression)(b)); + } + return (0, util_1.isNodeEqual)(a, b); +} +/** + * Returns the branch nodes of a conditional expression: + * - the "nonNullish branch" is the branch when test node is not nullish + * - the "nullish branch" is the branch when test node is nullish + */ +function getBranchNodes(node, operator) { + if (!operator || ['!=', '!=='].includes(operator)) { + return { nonNullishBranch: node.consequent, nullishBranch: node.alternate }; + } + return { nonNullishBranch: node.alternate, nullishBranch: node.consequent }; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.d.ts.map new file mode 100644 index 0000000..d6b67a6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PreferOptionalChainOptions.d.ts","sourceRoot":"","sources":["../../../src/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,6BAA6B,GACrC,sBAAsB,GACtB,qBAAqB,CAAC;AAE1B,MAAM,WAAW,0BAA0B;IACzC,kEAAkE,CAAC,EAAE,OAAO,CAAC;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.d.ts.map new file mode 100644 index 0000000..af7eb19 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"analyzeChain.d.ts","sourceRoot":"","sources":["../../../src/rules/prefer-optional-chain-utils/analyzeChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAGV,WAAW,EAEZ,MAAM,oCAAoC,CAAC;AAM5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AA8etC,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,CAClB,6BAA6B,EAC7B;IAAC,0BAA0B;CAAC,CAC7B,EACD,cAAc,EAAE,iCAAiC,EACjD,OAAO,EAAE,0BAA0B,EACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAChD,KAAK,EAAE,YAAY,EAAE,GACpB,IAAI,CA0GN"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.js new file mode 100644 index 0000000..4401d1b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.js @@ -0,0 +1,467 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.analyzeChain = analyzeChain; +const utils_1 = require("@typescript-eslint/utils"); +const ts_api_utils_1 = require("ts-api-utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../../util"); +const checkNullishAndReport_1 = require("./checkNullishAndReport"); +const compareNodes_1 = require("./compareNodes"); +const gatherLogicalOperands_1 = require("./gatherLogicalOperands"); +function includesType(parserServices, node, typeFlagIn) { + const typeFlag = typeFlagIn | ts.TypeFlags.Any | ts.TypeFlags.Unknown; + const types = (0, ts_api_utils_1.unionTypeParts)(parserServices.getTypeAtLocation(node)); + for (const type of types) { + if ((0, util_1.isTypeFlagSet)(type, typeFlag)) { + return true; + } + } + return false; +} +const analyzeAndChainOperand = (parserServices, operand, index, chain) => { + switch (operand.comparisonType) { + case gatherLogicalOperands_1.NullishComparisonType.Boolean: { + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualNull && + operand.comparedName.type === utils_1.AST_NODE_TYPES.Identifier) { + return null; + } + return [operand]; + } + case gatherLogicalOperands_1.NullishComparisonType.NotEqualNullOrUndefined: + return [operand]; + case gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualNull: { + // handle `x !== null && x !== undefined` + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualUndefined && + (0, compareNodes_1.compareNodes)(operand.comparedName, nextOperand.comparedName) === + compareNodes_1.NodeComparisonResult.Equal) { + return [operand, nextOperand]; + } + if (includesType(parserServices, operand.comparedName, ts.TypeFlags.Undefined)) { + // we know the next operand is not an `undefined` check and that this + // operand includes `undefined` - which means that making this an + // optional chain would change the runtime behavior of the expression + return null; + } + return [operand]; + } + case gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualUndefined: { + // handle `x !== undefined && x !== null` + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualNull && + (0, compareNodes_1.compareNodes)(operand.comparedName, nextOperand.comparedName) === + compareNodes_1.NodeComparisonResult.Equal) { + return [operand, nextOperand]; + } + if (includesType(parserServices, operand.comparedName, ts.TypeFlags.Null)) { + // we know the next operand is not a `null` check and that this + // operand includes `null` - which means that making this an + // optional chain would change the runtime behavior of the expression + return null; + } + return [operand]; + } + default: + return null; + } +}; +const analyzeOrChainOperand = (parserServices, operand, index, chain) => { + switch (operand.comparisonType) { + case gatherLogicalOperands_1.NullishComparisonType.NotBoolean: + case gatherLogicalOperands_1.NullishComparisonType.EqualNullOrUndefined: + return [operand]; + case gatherLogicalOperands_1.NullishComparisonType.StrictEqualNull: { + // handle `x === null || x === undefined` + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.StrictEqualUndefined && + (0, compareNodes_1.compareNodes)(operand.comparedName, nextOperand.comparedName) === + compareNodes_1.NodeComparisonResult.Equal) { + return [operand, nextOperand]; + } + if (includesType(parserServices, operand.comparedName, ts.TypeFlags.Undefined)) { + // we know the next operand is not an `undefined` check and that this + // operand includes `undefined` - which means that making this an + // optional chain would change the runtime behavior of the expression + return null; + } + return [operand]; + } + case gatherLogicalOperands_1.NullishComparisonType.StrictEqualUndefined: { + // handle `x === undefined || x === null` + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === gatherLogicalOperands_1.NullishComparisonType.StrictEqualNull && + (0, compareNodes_1.compareNodes)(operand.comparedName, nextOperand.comparedName) === + compareNodes_1.NodeComparisonResult.Equal) { + return [operand, nextOperand]; + } + if (includesType(parserServices, operand.comparedName, ts.TypeFlags.Null)) { + // we know the next operand is not a `null` check and that this + // operand includes `null` - which means that making this an + // optional chain would change the runtime behavior of the expression + return null; + } + return [operand]; + } + default: + return null; + } +}; +/** + * Returns the range that needs to be reported from the chain. + * @param chain The chain of logical expressions. + * @param boundary The boundary range that the range to report cannot fall outside. + * @param sourceCode The source code to get tokens. + * @returns The range to report. + */ +function getReportRange(chain, boundary, sourceCode) { + const leftNode = chain[0].node; + const rightNode = chain[chain.length - 1].node; + let leftMost = (0, util_1.nullThrows)(sourceCode.getFirstToken(leftNode), util_1.NullThrowsReasons.MissingToken('any token', leftNode.type)); + let rightMost = (0, util_1.nullThrows)(sourceCode.getLastToken(rightNode), util_1.NullThrowsReasons.MissingToken('any token', rightNode.type)); + while (leftMost.range[0] > boundary[0]) { + const token = sourceCode.getTokenBefore(leftMost); + if (!token || !(0, util_1.isOpeningParenToken)(token) || token.range[0] < boundary[0]) { + break; + } + leftMost = token; + } + while (rightMost.range[1] < boundary[1]) { + const token = sourceCode.getTokenAfter(rightMost); + if (!token || !(0, util_1.isClosingParenToken)(token) || token.range[1] > boundary[1]) { + break; + } + rightMost = token; + } + return [leftMost.range[0], rightMost.range[1]]; +} +function getReportDescriptor(sourceCode, parserServices, node, operator, options, chain) { + const lastOperand = chain[chain.length - 1]; + let useSuggestionFixer; + if (options.allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing === + true) { + // user has opted-in to the unsafe behavior + useSuggestionFixer = false; + } + // optional chain specifically will union `undefined` into the final type + // so we need to make sure that there is at least one operand that includes + // `undefined`, or else we're going to change the final type - which is + // unsafe and might cause downstream type errors. + else if (lastOperand.comparisonType === gatherLogicalOperands_1.NullishComparisonType.EqualNullOrUndefined || + lastOperand.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotEqualNullOrUndefined || + lastOperand.comparisonType === gatherLogicalOperands_1.NullishComparisonType.StrictEqualUndefined || + lastOperand.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualUndefined || + (operator === '||' && + lastOperand.comparisonType === gatherLogicalOperands_1.NullishComparisonType.NotBoolean)) { + // we know the last operand is an equality check - so the change in types + // DOES NOT matter and will not change the runtime result or cause a type + // check error + useSuggestionFixer = false; + } + else { + useSuggestionFixer = true; + for (const operand of chain) { + if (includesType(parserServices, operand.node, ts.TypeFlags.Undefined)) { + useSuggestionFixer = false; + break; + } + } + // TODO - we could further reduce the false-positive rate of this check by + // checking for cases where the change in types don't matter like + // the test location of an if/while/etc statement. + // but it's quite complex to do this without false-negatives, so + // for now we'll just be over-eager with our matching. + // + // it's MUCH better to false-positive here and only provide a + // suggestion fixer, rather than false-negative and autofix to + // broken code. + } + // In its most naive form we could just slap `?.` for every single part of the + // chain. However this would be undesirable because it'd create unnecessary + // conditions in the user's code where there were none before - and it would + // cause errors with rules like our `no-unnecessary-condition`. + // + // Instead we want to include the minimum number of `?.` required to correctly + // unify the code into a single chain. Naively you might think that we can + // just take the final operand add `?.` after the locations from the previous + // operands - however this won't be correct either because earlier operands + // can include a necessary `?.` that's not needed or included in a later + // operand. + // + // So instead what we need to do is to start at the first operand and + // iteratively diff it against the next operand, and add the difference to the + // first operand. + // + // eg + // `foo && foo.bar && foo.bar.baz?.bam && foo.bar.baz.bam()` + // 1) `foo` + // 2) diff(`foo`, `foo.bar`) = `.bar` + // 3) result = `foo?.bar` + // 4) diff(`foo.bar`, `foo.bar.baz?.bam`) = `.baz?.bam` + // 5) result = `foo?.bar?.baz?.bam` + // 6) diff(`foo.bar.baz?.bam`, `foo.bar.baz.bam()`) = `()` + // 7) result = `foo?.bar?.baz?.bam?.()` + const parts = []; + for (const current of chain) { + const nextOperand = flattenChainExpression(sourceCode, current.comparedName); + const diff = nextOperand.slice(parts.length); + if (diff.length > 0) { + if (parts.length > 0) { + // we need to make the first operand of the diff optional so it matches the + // logic before merging + // foo.bar && foo.bar.baz + // diff = .baz + // result = foo.bar?.baz + diff[0].optional = true; + } + parts.push(...diff); + } + } + let newCode = parts + .map(part => { + let str = ''; + if (part.optional) { + str += '?.'; + } + else { + if (part.nonNull) { + str += '!'; + } + if (part.requiresDot) { + str += '.'; + } + } + if (part.precedence !== util_1.OperatorPrecedence.Invalid && + part.precedence < util_1.OperatorPrecedence.Member) { + str += `(${part.text})`; + } + else { + str += part.text; + } + return str; + }) + .join(''); + if (lastOperand.node.type === utils_1.AST_NODE_TYPES.BinaryExpression) { + // retain the ending comparison for cases like + // x && x.a != null + // x && typeof x.a !== 'undefined' + const operator = lastOperand.node.operator; + const { left, right } = (() => { + if (lastOperand.isYoda) { + const unaryOperator = lastOperand.node.right.type === utils_1.AST_NODE_TYPES.UnaryExpression + ? `${lastOperand.node.right.operator} ` + : ''; + return { + left: sourceCode.getText(lastOperand.node.left), + right: unaryOperator + newCode, + }; + } + const unaryOperator = lastOperand.node.left.type === utils_1.AST_NODE_TYPES.UnaryExpression + ? `${lastOperand.node.left.operator} ` + : ''; + return { + left: unaryOperator + newCode, + right: sourceCode.getText(lastOperand.node.right), + }; + })(); + newCode = `${left} ${operator} ${right}`; + } + else if (lastOperand.comparisonType === gatherLogicalOperands_1.NullishComparisonType.NotBoolean) { + newCode = `!${newCode}`; + } + const reportRange = getReportRange(chain, node.range, sourceCode); + const fix = fixer => fixer.replaceTextRange(reportRange, newCode); + return { + loc: { + end: sourceCode.getLocFromIndex(reportRange[1]), + start: sourceCode.getLocFromIndex(reportRange[0]), + }, + messageId: 'preferOptionalChain', + ...(0, util_1.getFixOrSuggest)({ + fixOrSuggest: useSuggestionFixer ? 'suggest' : 'fix', + suggestion: { + fix, + messageId: 'optionalChainSuggest', + }, + }), + }; + function flattenChainExpression(sourceCode, node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.ChainExpression: + return flattenChainExpression(sourceCode, node.expression); + case utils_1.AST_NODE_TYPES.CallExpression: { + const argumentsText = (() => { + const closingParenToken = (0, util_1.nullThrows)(sourceCode.getLastToken(node), util_1.NullThrowsReasons.MissingToken('closing parenthesis', node.type)); + const openingParenToken = (0, util_1.nullThrows)(sourceCode.getFirstTokenBetween(node.typeArguments ?? node.callee, closingParenToken, util_1.isOpeningParenToken), util_1.NullThrowsReasons.MissingToken('opening parenthesis', node.type)); + return sourceCode.text.substring(openingParenToken.range[0], closingParenToken.range[1]); + })(); + const typeArgumentsText = (() => { + if (node.typeArguments == null) { + return ''; + } + return sourceCode.getText(node.typeArguments); + })(); + return [ + ...flattenChainExpression(sourceCode, node.callee), + { + nonNull: false, + optional: node.optional, + // no precedence for this + precedence: util_1.OperatorPrecedence.Invalid, + requiresDot: false, + text: typeArgumentsText + argumentsText, + }, + ]; + } + case utils_1.AST_NODE_TYPES.MemberExpression: { + const propertyText = sourceCode.getText(node.property); + return [ + ...flattenChainExpression(sourceCode, node.object), + { + nonNull: node.object.type === utils_1.AST_NODE_TYPES.TSNonNullExpression, + optional: node.optional, + precedence: node.computed + ? // computed is already wrapped in [] so no need to wrap in () as well + util_1.OperatorPrecedence.Invalid + : (0, util_1.getOperatorPrecedenceForNode)(node.property), + requiresDot: !node.computed, + text: node.computed ? `[${propertyText}]` : propertyText, + }, + ]; + } + case utils_1.AST_NODE_TYPES.TSNonNullExpression: + return flattenChainExpression(sourceCode, node.expression); + default: + return [ + { + nonNull: false, + optional: false, + precedence: (0, util_1.getOperatorPrecedenceForNode)(node), + requiresDot: false, + text: sourceCode.getText(node), + }, + ]; + } + } +} +function analyzeChain(context, parserServices, options, node, operator, chain) { + // need at least 2 operands in a chain for it to be a chain + if (chain.length <= 1 || + /* istanbul ignore next -- previous checks make this unreachable, but keep it for exhaustiveness check */ + operator === '??') { + return; + } + const analyzeOperand = (() => { + switch (operator) { + case '&&': + return analyzeAndChainOperand; + case '||': + return analyzeOrChainOperand; + } + })(); + // Things like x !== null && x !== undefined have two nodes, but they are + // one logical unit here, so we'll allow them to be grouped. + let subChain = []; + const maybeReportThenReset = (newChainSeed) => { + if (subChain.length > 1) { + const subChainFlat = subChain.flat(); + (0, checkNullishAndReport_1.checkNullishAndReport)(context, parserServices, options, subChainFlat.slice(0, -1).map(({ node }) => node), getReportDescriptor(context.sourceCode, parserServices, node, operator, options, subChainFlat)); + } + // we've reached the end of a chain of logical expressions + // i.e. the current operand doesn't belong to the previous chain. + // + // we don't want to throw away the current operand otherwise we will skip it + // and that can cause us to miss chains. So instead we seed the new chain + // with the current operand + // + // eg this means we can catch cases like: + // unrelated != null && foo != null && foo.bar != null; + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ first "chain" + // ^^^^^^^^^^^ newChainSeed + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ second chain + subChain = newChainSeed ? [newChainSeed] : []; + }; + for (let i = 0; i < chain.length; i += 1) { + const lastOperand = subChain.flat().at(-1); + const operand = chain[i]; + const validatedOperands = analyzeOperand(parserServices, operand, i, chain); + if (!validatedOperands) { + // TODO - #7170 + // check if the name is a superset/equal - if it is, then it likely + // intended to be part of the chain and something we should include in the + // report, eg + // foo == null || foo.bar; + // ^^^^^^^^^^^ valid OR chain + // ^^^^^^^ invalid OR chain logical, but still part of + // the chain for combination purposes + maybeReportThenReset(); + continue; + } + // in case multiple operands were consumed - make sure to correctly increment the index + i += validatedOperands.length - 1; + const currentOperand = validatedOperands[0]; + if (lastOperand) { + const comparisonResult = (0, compareNodes_1.compareNodes)(lastOperand.comparedName, + // purposely inspect and push the last operand because the prior operands don't matter + // this also means we won't false-positive in cases like + // foo !== null && foo !== undefined + validatedOperands[validatedOperands.length - 1].comparedName); + if (comparisonResult === compareNodes_1.NodeComparisonResult.Subset) { + // the operands are comparable, so we can continue searching + subChain.push(currentOperand); + } + else if (comparisonResult === compareNodes_1.NodeComparisonResult.Invalid) { + maybeReportThenReset(validatedOperands); + } + else { + // purposely don't push this case because the node is a no-op and if + // we consider it then we might report on things like + // foo && foo + } + } + else { + subChain.push(currentOperand); + } + } + // check the leftovers + maybeReportThenReset(); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.d.ts.map new file mode 100644 index 0000000..d827b57 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"checkNullishAndReport.d.ts","sourceRoot":"","sources":["../../../src/rules/prefer-optional-chain-utils/checkNullishAndReport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAM5C,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,CAClB,6BAA6B,EAC7B;IAAC,0BAA0B;CAAC,CAC7B,EACD,cAAc,EAAE,iCAAiC,EACjD,EAAE,cAAc,EAAE,EAAE,0BAA0B,EAC9C,iBAAiB,EAAE,QAAQ,CAAC,UAAU,EAAE,EACxC,UAAU,EAAE,gBAAgB,CAAC,6BAA6B,CAAC,GAC1D,IAAI,CAWN"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.js new file mode 100644 index 0000000..5ceb886 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.js @@ -0,0 +1,45 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkNullishAndReport = checkNullishAndReport; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const ts_api_utils_1 = require("ts-api-utils"); +const ts = __importStar(require("typescript")); +function checkNullishAndReport(context, parserServices, { requireNullish }, maybeNullishNodes, descriptor) { + if (!requireNullish || + maybeNullishNodes.some(node => (0, ts_api_utils_1.unionTypeParts)(parserServices.getTypeAtLocation(node)).some(t => (0, type_utils_1.isTypeFlagSet)(t, ts.TypeFlags.Null | ts.TypeFlags.Undefined)))) { + context.report(descriptor); + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.d.ts.map new file mode 100644 index 0000000..a1717db --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"compareNodes.d.ts","sourceRoot":"","sources":["../../../src/rules/prefer-optional-chain-utils/compareNodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,0BAAkB,oBAAoB;IACpC,4CAA4C;IAC5C,KAAK,UAAU;IACf,kDAAkD;IAClD,MAAM,WAAW;IACjB,uEAAuE;IACvE,OAAO,YAAY;CACpB;AA8GD,KAAK,oBAAoB,GAAG,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;AAuQ7D;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,oBAAoB,GAC1B,oBAAoB,CAqBtB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.js new file mode 100644 index 0000000..8ac09ef --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.js @@ -0,0 +1,326 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodeComparisonResult = void 0; +exports.compareNodes = compareNodes; +const utils_1 = require("@typescript-eslint/utils"); +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +var NodeComparisonResult; +(function (NodeComparisonResult) { + /** the two nodes are comparably the same */ + NodeComparisonResult["Equal"] = "Equal"; + /** the left node is a subset of the right node */ + NodeComparisonResult["Subset"] = "Subset"; + /** the left node is not the same or is a superset of the right node */ + NodeComparisonResult["Invalid"] = "Invalid"; +})(NodeComparisonResult || (exports.NodeComparisonResult = NodeComparisonResult = {})); +function compareArrays(arrayA, arrayB) { + if (arrayA.length !== arrayB.length) { + return NodeComparisonResult.Invalid; + } + const result = arrayA.every((elA, idx) => { + const elB = arrayB[idx]; + if (elA == null || elB == null) { + return elA === elB; + } + return compareUnknownValues(elA, elB) === NodeComparisonResult.Equal; + }); + if (result) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; +} +function isValidNode(x) { + return (typeof x === 'object' && + x != null && + 'type' in x && + typeof x.type === 'string'); +} +function isValidChainExpressionToLookThrough(node) { + return (!(node.parent?.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.parent.object === node) && + !(node.parent?.type === utils_1.AST_NODE_TYPES.CallExpression && + node.parent.callee === node) && + node.type === utils_1.AST_NODE_TYPES.ChainExpression); +} +function compareUnknownValues(valueA, valueB) { + /* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */ + if (valueA == null || valueB == null) { + if (valueA !== valueB) { + return NodeComparisonResult.Invalid; + } + return NodeComparisonResult.Equal; + } + /* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */ + if (!isValidNode(valueA) || !isValidNode(valueB)) { + return NodeComparisonResult.Invalid; + } + return compareNodes(valueA, valueB); +} +function compareByVisiting(nodeA, nodeB) { + const currentVisitorKeys = visitor_keys_1.visitorKeys[nodeA.type]; + /* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */ + if (currentVisitorKeys == null) { + // we don't know how to visit this node, so assume it's invalid to avoid false-positives / broken fixers + return NodeComparisonResult.Invalid; + } + if (currentVisitorKeys.length === 0) { + // assume nodes with no keys are constant things like keywords + return NodeComparisonResult.Equal; + } + for (const key of currentVisitorKeys) { + // @ts-expect-error - dynamic access but it's safe + const nodeAChildOrChildren = nodeA[key]; + // @ts-expect-error - dynamic access but it's safe + const nodeBChildOrChildren = nodeB[key]; + if (Array.isArray(nodeAChildOrChildren)) { + const arrayA = nodeAChildOrChildren; + const arrayB = nodeBChildOrChildren; + const result = compareArrays(arrayA, arrayB); + if (result !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + // fallthrough to the next key as the key was "equal" + } + else { + const result = compareUnknownValues(nodeAChildOrChildren, nodeBChildOrChildren); + if (result !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + // fallthrough to the next key as the key was "equal" + } + } + return NodeComparisonResult.Equal; +} +function compareNodesUncached(nodeA, nodeB) { + if (nodeA.type !== nodeB.type) { + // special cases where nodes are allowed to be non-equal + // look through a chain expression node at the top-level because it only + // exists to delimit the end of an optional chain + // + // a?.b && a.b.c + // ^^^^ ChainExpression, MemberExpression + // ^^^^^ MemberExpression + // + // except for in this class of cases + // (a?.b).c && a.b.c + // because the parentheses have runtime meaning (sad face) + if (isValidChainExpressionToLookThrough(nodeA)) { + return compareNodes(nodeA.expression, nodeB); + } + if (isValidChainExpressionToLookThrough(nodeB)) { + return compareNodes(nodeA, nodeB.expression); + } + // look through the type-only non-null assertion because its existence could + // possibly be replaced by an optional chain instead + // + // a.b! && a.b.c + // ^^^^ TSNonNullExpression + if (nodeA.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) { + return compareNodes(nodeA.expression, nodeB); + } + if (nodeB.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) { + return compareNodes(nodeA, nodeB.expression); + } + // special case for subset optional chains where the node types don't match, + // but we want to try comparing by discarding the "extra" code + // + // a && a.b + // ^ compare this + // a && a() + // ^ compare this + // a.b && a.b() + // ^^^ compare this + // a() && a().b + // ^^^ compare this + // import.meta && import.meta.b + // ^^^^^^^^^^^ compare this + if (nodeA.type === utils_1.AST_NODE_TYPES.CallExpression || + nodeA.type === utils_1.AST_NODE_TYPES.Identifier || + nodeA.type === utils_1.AST_NODE_TYPES.MemberExpression || + nodeA.type === utils_1.AST_NODE_TYPES.MetaProperty) { + switch (nodeB.type) { + case utils_1.AST_NODE_TYPES.MemberExpression: + if (nodeB.property.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + // Private identifiers in optional chaining is not currently allowed + // TODO - handle this once TS supports it (https://github.com/microsoft/TypeScript/issues/42734) + return NodeComparisonResult.Invalid; + } + if (compareNodes(nodeA, nodeB.object) !== NodeComparisonResult.Invalid) { + return NodeComparisonResult.Subset; + } + return NodeComparisonResult.Invalid; + case utils_1.AST_NODE_TYPES.CallExpression: + if (compareNodes(nodeA, nodeB.callee) !== NodeComparisonResult.Invalid) { + return NodeComparisonResult.Subset; + } + return NodeComparisonResult.Invalid; + default: + return NodeComparisonResult.Invalid; + } + } + return NodeComparisonResult.Invalid; + } + switch (nodeA.type) { + // these expressions create a new instance each time - so it makes no sense to compare the chain + case utils_1.AST_NODE_TYPES.ArrayExpression: + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.ClassExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.JSXElement: + case utils_1.AST_NODE_TYPES.JSXFragment: + case utils_1.AST_NODE_TYPES.NewExpression: + case utils_1.AST_NODE_TYPES.ObjectExpression: + return NodeComparisonResult.Invalid; + // chaining from assignments could change the value irrevocably - so it makes no sense to compare the chain + case utils_1.AST_NODE_TYPES.AssignmentExpression: + return NodeComparisonResult.Invalid; + case utils_1.AST_NODE_TYPES.CallExpression: { + const nodeBCall = nodeB; + // check for cases like + // foo() && foo()(bar) + // ^^^^^ nodeA + // ^^^^^^^^^^ nodeB + // we don't want to check the arguments in this case + const aSubsetOfB = compareNodes(nodeA, nodeBCall.callee); + if (aSubsetOfB !== NodeComparisonResult.Invalid) { + return NodeComparisonResult.Subset; + } + const calleeCompare = compareNodes(nodeA.callee, nodeBCall.callee); + if (calleeCompare !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + // NOTE - we purposely ignore optional flag because for our purposes + // foo?.bar() && foo.bar?.()?.baz + // or + // foo.bar() && foo?.bar?.()?.baz + // are going to be exactly the same + const argumentCompare = compareArrays(nodeA.arguments, nodeBCall.arguments); + if (argumentCompare !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + const typeParamCompare = compareNodes(nodeA.typeArguments, nodeBCall.typeArguments); + if (typeParamCompare === NodeComparisonResult.Equal) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; + } + case utils_1.AST_NODE_TYPES.ChainExpression: + // special case handling for ChainExpression because it's allowed to be a subset + return compareNodes(nodeA, nodeB.expression); + case utils_1.AST_NODE_TYPES.Identifier: + case utils_1.AST_NODE_TYPES.PrivateIdentifier: + if (nodeA.name === nodeB.name) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; + case utils_1.AST_NODE_TYPES.Literal: { + const nodeBLiteral = nodeB; + if (nodeA.raw === nodeBLiteral.raw && + nodeA.value === nodeBLiteral.value) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; + } + case utils_1.AST_NODE_TYPES.MemberExpression: { + const nodeBMember = nodeB; + if (nodeBMember.property.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + // Private identifiers in optional chaining is not currently allowed + // TODO - handle this once TS supports it (https://github.com/microsoft/TypeScript/issues/42734) + return NodeComparisonResult.Invalid; + } + // check for cases like + // foo.bar && foo.bar.baz + // ^^^^^^^ nodeA + // ^^^^^^^^^^^ nodeB + // result === Equal + // + // foo.bar && foo.bar.baz.bam + // ^^^^^^^ nodeA + // ^^^^^^^^^^^^^^^ nodeB + // result === Subset + // + // we don't want to check the property in this case + const aSubsetOfB = compareNodes(nodeA, nodeBMember.object); + if (aSubsetOfB !== NodeComparisonResult.Invalid) { + return NodeComparisonResult.Subset; + } + if (nodeA.computed !== nodeBMember.computed) { + return NodeComparisonResult.Invalid; + } + // NOTE - we purposely ignore optional flag because for our purposes + // foo?.bar && foo.bar?.baz + // or + // foo.bar && foo?.bar?.baz + // are going to be exactly the same + const objectCompare = compareNodes(nodeA.object, nodeBMember.object); + if (objectCompare !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + return compareNodes(nodeA.property, nodeBMember.property); + } + case utils_1.AST_NODE_TYPES.TSTemplateLiteralType: + case utils_1.AST_NODE_TYPES.TemplateLiteral: { + const nodeBTemplate = nodeB; + const areQuasisEqual = nodeA.quasis.length === nodeBTemplate.quasis.length && + nodeA.quasis.every((elA, idx) => { + const elB = nodeBTemplate.quasis[idx]; + return elA.value.cooked === elB.value.cooked; + }); + if (!areQuasisEqual) { + return NodeComparisonResult.Invalid; + } + return NodeComparisonResult.Equal; + } + case utils_1.AST_NODE_TYPES.TemplateElement: { + const nodeBElement = nodeB; + if (nodeA.value.cooked === nodeBElement.value.cooked) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; + } + // these aren't actually valid expressions. + // https://github.com/typescript-eslint/typescript-eslint/blob/20d7caee35ab84ae6381fdf04338c9e2b9e2bc48/packages/ast-spec/src/unions/Expression.ts#L37-L43 + case utils_1.AST_NODE_TYPES.ArrayPattern: + case utils_1.AST_NODE_TYPES.ObjectPattern: + /* istanbul ignore next */ + return NodeComparisonResult.Invalid; + // update expression returns a number and also changes the value each time - so it makes no sense to compare the chain + case utils_1.AST_NODE_TYPES.UpdateExpression: + return NodeComparisonResult.Invalid; + // yield returns the value passed to the `next` function, so it may not be the same each time - so it makes no sense to compare the chain + case utils_1.AST_NODE_TYPES.YieldExpression: + return NodeComparisonResult.Invalid; + // general-case automatic handling of nodes to save us implementing every + // single case by hand. This just iterates the visitor keys to recursively + // check the children. + // + // Any specific logic cases or short-circuits should be listed as separate + // cases so that they don't fall into this generic handling + default: + return compareByVisiting(nodeA, nodeB); + } +} +const COMPARE_NODES_CACHE = new WeakMap(); +/** + * Compares two nodes' ASTs to determine if the A is equal to or a subset of B + */ +function compareNodes(nodeA, nodeB) { + if (nodeA == null || nodeB == null) { + if (nodeA !== nodeB) { + return NodeComparisonResult.Invalid; + } + return NodeComparisonResult.Equal; + } + const cached = COMPARE_NODES_CACHE.get(nodeA)?.get(nodeB); + if (cached) { + return cached; + } + const result = compareNodesUncached(nodeA, nodeB); + let mapA = COMPARE_NODES_CACHE.get(nodeA); + if (mapA == null) { + mapA = new WeakMap(); + COMPARE_NODES_CACHE.set(nodeA, mapA); + } + mapA.set(nodeB, result); + return result; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.d.ts.map new file mode 100644 index 0000000..bba5ee6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gatherLogicalOperands.d.ts","sourceRoot":"","sources":["../../../src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAYrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAS/E,0BAAkB,eAAe;IAC/B,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AACD,0BAAkB,qBAAqB;IACrC,oCAAoC;IACpC,uBAAuB,4BAA4B;IACnD,oCAAoC;IACpC,oBAAoB,yBAAyB;IAE7C,mBAAmB;IACnB,kBAAkB,uBAAuB;IACzC,mBAAmB;IACnB,eAAe,oBAAoB;IAEnC,oDAAoD;IACpD,uBAAuB,4BAA4B;IACnD,oDAAoD;IACpD,oBAAoB,yBAAyB;IAE7C,WAAW;IACX,UAAU,eAAe;IACzB,UAAU;IACV,OAAO,YAAY;CACpB;AACD,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC;IAC5B,cAAc,EAAE,qBAAqB,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC;IAC1B,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC;CAC7B;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC;CAC/B;AACD,KAAK,OAAO,GAAG,cAAc,GAAG,YAAY,CAAC;AAwD7C,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,EAChC,cAAc,EAAE,iCAAiC,EACjD,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAChC,OAAO,EAAE,0BAA0B,GAClC;IACD,iBAAiB,EAAE,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACnD,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB,CA0PA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.js new file mode 100644 index 0000000..d849715 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.js @@ -0,0 +1,319 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NullishComparisonType = exports.OperandValidity = void 0; +exports.gatherLogicalOperands = gatherLogicalOperands; +const utils_1 = require("@typescript-eslint/utils"); +const ts_api_utils_1 = require("ts-api-utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../../util"); +var ComparisonValueType; +(function (ComparisonValueType) { + ComparisonValueType["Null"] = "Null"; + ComparisonValueType["Undefined"] = "Undefined"; + ComparisonValueType["UndefinedStringLiteral"] = "UndefinedStringLiteral"; +})(ComparisonValueType || (ComparisonValueType = {})); +var OperandValidity; +(function (OperandValidity) { + OperandValidity["Valid"] = "Valid"; + OperandValidity["Invalid"] = "Invalid"; +})(OperandValidity || (exports.OperandValidity = OperandValidity = {})); +var NullishComparisonType; +(function (NullishComparisonType) { + /** `x != null`, `x != undefined` */ + NullishComparisonType["NotEqualNullOrUndefined"] = "NotEqualNullOrUndefined"; + /** `x == null`, `x == undefined` */ + NullishComparisonType["EqualNullOrUndefined"] = "EqualNullOrUndefined"; + /** `x !== null` */ + NullishComparisonType["NotStrictEqualNull"] = "NotStrictEqualNull"; + /** `x === null` */ + NullishComparisonType["StrictEqualNull"] = "StrictEqualNull"; + /** `x !== undefined`, `typeof x !== 'undefined'` */ + NullishComparisonType["NotStrictEqualUndefined"] = "NotStrictEqualUndefined"; + /** `x === undefined`, `typeof x === 'undefined'` */ + NullishComparisonType["StrictEqualUndefined"] = "StrictEqualUndefined"; + /** `!x` */ + NullishComparisonType["NotBoolean"] = "NotBoolean"; + /** `x` */ + NullishComparisonType["Boolean"] = "Boolean"; +})(NullishComparisonType || (exports.NullishComparisonType = NullishComparisonType = {})); +const NULLISH_FLAGS = ts.TypeFlags.Null | ts.TypeFlags.Undefined; +function isValidFalseBooleanCheckType(node, disallowFalseyLiteral, parserServices, options) { + const type = parserServices.getTypeAtLocation(node); + const types = (0, ts_api_utils_1.unionTypeParts)(type); + if (disallowFalseyLiteral && + /* + ``` + declare const x: false | {a: string}; + x && x.a; + !x || x.a; + ``` + + We don't want to consider these two cases because the boolean expression + narrows out the non-nullish falsy cases - so converting the chain to `x?.a` + would introduce a build error + */ (types.some(t => (0, ts_api_utils_1.isBooleanLiteralType)(t) && t.intrinsicName === 'false') || + types.some(t => (0, ts_api_utils_1.isStringLiteralType)(t) && t.value === '') || + types.some(t => (0, ts_api_utils_1.isNumberLiteralType)(t) && t.value === 0) || + types.some(t => (0, ts_api_utils_1.isBigIntLiteralType)(t) && t.value.base10Value === '0'))) { + return false; + } + let allowedFlags = NULLISH_FLAGS | ts.TypeFlags.Object; + if (options.checkAny === true) { + allowedFlags |= ts.TypeFlags.Any; + } + if (options.checkUnknown === true) { + allowedFlags |= ts.TypeFlags.Unknown; + } + if (options.checkString === true) { + allowedFlags |= ts.TypeFlags.StringLike; + } + if (options.checkNumber === true) { + allowedFlags |= ts.TypeFlags.NumberLike; + } + if (options.checkBoolean === true) { + allowedFlags |= ts.TypeFlags.BooleanLike; + } + if (options.checkBigInt === true) { + allowedFlags |= ts.TypeFlags.BigIntLike; + } + return types.every(t => (0, util_1.isTypeFlagSet)(t, allowedFlags)); +} +function gatherLogicalOperands(node, parserServices, sourceCode, options) { + const result = []; + const { newlySeenLogicals, operands } = flattenLogicalOperands(node); + for (const operand of operands) { + const areMoreOperands = operand !== operands.at(-1); + switch (operand.type) { + case utils_1.AST_NODE_TYPES.BinaryExpression: { + // check for "yoda" style logical: null != x + const { comparedExpression, comparedValue, isYoda } = (() => { + // non-yoda checks are by far the most common, so check for them first + const comparedValueRight = getComparisonValueType(operand.right); + if (comparedValueRight) { + return { + comparedExpression: operand.left, + comparedValue: comparedValueRight, + isYoda: false, + }; + } + return { + comparedExpression: operand.right, + comparedValue: getComparisonValueType(operand.left), + isYoda: true, + }; + })(); + if (comparedValue === ComparisonValueType.UndefinedStringLiteral) { + if (comparedExpression.type === utils_1.AST_NODE_TYPES.UnaryExpression && + comparedExpression.operator === 'typeof') { + const argument = comparedExpression.argument; + if (argument.type === utils_1.AST_NODE_TYPES.Identifier && + // typeof window === 'undefined' + (0, util_1.isReferenceToGlobalFunction)(argument.name, argument, sourceCode)) { + result.push({ type: OperandValidity.Invalid }); + continue; + } + // typeof x.y === 'undefined' + result.push({ + comparedName: comparedExpression.argument, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotStrictEqualUndefined + : NullishComparisonType.StrictEqualUndefined, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + } + // y === 'undefined' + result.push({ type: OperandValidity.Invalid }); + continue; + } + switch (operand.operator) { + case '!=': + case '==': + if (comparedValue === ComparisonValueType.Null || + comparedValue === ComparisonValueType.Undefined) { + // x == null, x == undefined + result.push({ + comparedName: comparedExpression, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotEqualNullOrUndefined + : NullishComparisonType.EqualNullOrUndefined, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + } + // x == something :( + result.push({ type: OperandValidity.Invalid }); + continue; + case '!==': + case '===': { + const comparedName = comparedExpression; + switch (comparedValue) { + case ComparisonValueType.Null: + result.push({ + comparedName, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotStrictEqualNull + : NullishComparisonType.StrictEqualNull, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + case ComparisonValueType.Undefined: + result.push({ + comparedName, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotStrictEqualUndefined + : NullishComparisonType.StrictEqualUndefined, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + default: + // x === something :( + result.push({ type: OperandValidity.Invalid }); + continue; + } + } + } + result.push({ type: OperandValidity.Invalid }); + continue; + } + case utils_1.AST_NODE_TYPES.UnaryExpression: + if (operand.operator === '!' && + isValidFalseBooleanCheckType(operand.argument, areMoreOperands && node.operator === '||', parserServices, options)) { + result.push({ + comparedName: operand.argument, + comparisonType: NullishComparisonType.NotBoolean, + isYoda: false, + node: operand, + type: OperandValidity.Valid, + }); + continue; + } + result.push({ type: OperandValidity.Invalid }); + continue; + case utils_1.AST_NODE_TYPES.LogicalExpression: + // explicitly ignore the mixed logical expression cases + result.push({ type: OperandValidity.Invalid }); + continue; + default: + if (isValidFalseBooleanCheckType(operand, areMoreOperands && node.operator === '&&', parserServices, options)) { + result.push({ + comparedName: operand, + comparisonType: NullishComparisonType.Boolean, + isYoda: false, + node: operand, + type: OperandValidity.Valid, + }); + } + else { + result.push({ type: OperandValidity.Invalid }); + } + continue; + } + } + return { + newlySeenLogicals, + operands: result, + }; + /* + The AST is always constructed such the first element is always the deepest element. + I.e. for this code: `foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz` + The AST will look like this: + { + left: { + left: { + left: foo + right: foo.bar + } + right: foo.bar.baz + } + right: foo.bar.baz.buzz + } + + So given any logical expression, we can perform a depth-first traversal to get + the operands in order. + + Note that this function purposely does not inspect mixed logical expressions + like `foo || foo.bar && foo.bar.baz` - separate selector + */ + function flattenLogicalOperands(node) { + const operands = []; + const newlySeenLogicals = new Set([node]); + const stack = [node.right, node.left]; + let current; + while ((current = stack.pop())) { + if (current.type === utils_1.AST_NODE_TYPES.LogicalExpression && + current.operator === node.operator) { + newlySeenLogicals.add(current); + stack.push(current.right); + stack.push(current.left); + } + else { + operands.push(current); + } + } + return { + newlySeenLogicals, + operands, + }; + } + function getComparisonValueType(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.Literal: + // eslint-disable-next-line eqeqeq, @typescript-eslint/internal/eqeq-nullish -- intentional exact comparison against null + if (node.value === null && node.raw === 'null') { + return ComparisonValueType.Null; + } + if (node.value === 'undefined') { + return ComparisonValueType.UndefinedStringLiteral; + } + return null; + case utils_1.AST_NODE_TYPES.Identifier: + if (node.name === 'undefined') { + return ComparisonValueType.Undefined; + } + return null; + } + return null; + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.d.ts.map new file mode 100644 index 0000000..08bdc84 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-optional-chain.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-optional-chain.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,0DAA0D,CAAC;;AAelE,wBAiMG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js new file mode 100644 index 0000000..f0c0c58 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js @@ -0,0 +1,146 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const analyzeChain_1 = require("./prefer-optional-chain-utils/analyzeChain"); +const checkNullishAndReport_1 = require("./prefer-optional-chain-utils/checkNullishAndReport"); +const gatherLogicalOperands_1 = require("./prefer-optional-chain-utils/gatherLogicalOperands"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-optional-chain', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + hasSuggestions: true, + messages: { + optionalChainSuggest: 'Change to an optional chain.', + preferOptionalChain: "Prefer using an optional chain expression instead, as it's more concise and easier to read.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: { + type: 'boolean', + description: 'Allow autofixers that will change the return type of the expression. This option is considered unsafe as it may break the build.', + }, + checkAny: { + type: 'boolean', + description: 'Check operands that are typed as `any` when inspecting "loose boolean" operands.', + }, + checkBigInt: { + type: 'boolean', + description: 'Check operands that are typed as `bigint` when inspecting "loose boolean" operands.', + }, + checkBoolean: { + type: 'boolean', + description: 'Check operands that are typed as `boolean` when inspecting "loose boolean" operands.', + }, + checkNumber: { + type: 'boolean', + description: 'Check operands that are typed as `number` when inspecting "loose boolean" operands.', + }, + checkString: { + type: 'boolean', + description: 'Check operands that are typed as `string` when inspecting "loose boolean" operands.', + }, + checkUnknown: { + type: 'boolean', + description: 'Check operands that are typed as `unknown` when inspecting "loose boolean" operands.', + }, + requireNullish: { + type: 'boolean', + description: 'Skip operands that are not typed with `null` and/or `undefined` when inspecting "loose boolean" operands.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false, + checkAny: true, + checkBigInt: true, + checkBoolean: true, + checkNumber: true, + checkString: true, + checkUnknown: true, + requireNullish: false, + }, + ], + create(context, [options]) { + const parserServices = (0, util_1.getParserServices)(context); + const seenLogicals = new Set(); + return { + // specific handling for `(foo ?? {}).bar` / `(foo || {}).bar` + 'LogicalExpression[operator!="??"]'(node) { + if (seenLogicals.has(node)) { + return; + } + const { newlySeenLogicals, operands } = (0, gatherLogicalOperands_1.gatherLogicalOperands)(node, parserServices, context.sourceCode, options); + for (const logical of newlySeenLogicals) { + seenLogicals.add(logical); + } + let currentChain = []; + for (const operand of operands) { + if (operand.type === gatherLogicalOperands_1.OperandValidity.Invalid) { + (0, analyzeChain_1.analyzeChain)(context, parserServices, options, node, node.operator, currentChain); + currentChain = []; + } + else { + currentChain.push(operand); + } + } + // make sure to check whatever's left + if (currentChain.length > 0) { + (0, analyzeChain_1.analyzeChain)(context, parserServices, options, node, node.operator, currentChain); + } + }, + 'LogicalExpression[operator="||"], LogicalExpression[operator="??"]'(node) { + const leftNode = node.left; + const rightNode = node.right; + const parentNode = node.parent; + const isRightNodeAnEmptyObjectLiteral = rightNode.type === utils_1.AST_NODE_TYPES.ObjectExpression && + rightNode.properties.length === 0; + if (!isRightNodeAnEmptyObjectLiteral || + parentNode.type !== utils_1.AST_NODE_TYPES.MemberExpression || + parentNode.optional) { + return; + } + seenLogicals.add(node); + function isLeftSideLowerPrecedence() { + const logicalTsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const leftTsNode = parserServices.esTreeNodeToTSNodeMap.get(leftNode); + const leftPrecedence = (0, util_1.getOperatorPrecedence)(leftTsNode.kind, logicalTsNode.operatorToken.kind); + return leftPrecedence < util_1.OperatorPrecedence.LeftHandSide; + } + (0, checkNullishAndReport_1.checkNullishAndReport)(context, parserServices, options, [leftNode], { + node: parentNode, + messageId: 'preferOptionalChain', + suggest: [ + { + messageId: 'optionalChainSuggest', + fix: (fixer) => { + const leftNodeText = context.sourceCode.getText(leftNode); + // Any node that is made of an operator with higher or equal precedence, + const maybeWrappedLeftNode = isLeftSideLowerPrecedence() + ? `(${leftNodeText})` + : leftNodeText; + const propertyToBeOptionalText = context.sourceCode.getText(parentNode.property); + const maybeWrappedProperty = parentNode.computed + ? `[${propertyToBeOptionalText}]` + : propertyToBeOptionalText; + return fixer.replaceTextRange(parentNode.range, `${maybeWrappedLeftNode}?.${maybeWrappedProperty}`); + }, + }, + ], + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.d.ts.map new file mode 100644 index 0000000..57e38ab --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-promise-reject-errors.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-promise-reject-errors.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,UAAU,GAAG,eAAe,CAAC;AAEzC,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC;CACF,CAAC;;AAEF,wBA4IG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.js new file mode 100644 index 0000000..bc97e1c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.js @@ -0,0 +1,116 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-promise-reject-errors', + meta: { + type: 'suggestion', + docs: { + description: 'Require using Error objects as Promise rejection reasons', + extendsBaseRule: true, + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + rejectAnError: 'Expected the Promise rejection reason to be an Error.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowEmptyReject: { + type: 'boolean', + description: 'Whether to allow calls to `Promise.reject()` with no arguments.', + }, + allowThrowingAny: { + type: 'boolean', + description: 'Whether to always allow throwing values typed as `any`.', + }, + allowThrowingUnknown: { + type: 'boolean', + description: 'Whether to always allow throwing values typed as `unknown`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowEmptyReject: false, + allowThrowingAny: false, + allowThrowingUnknown: false, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + function checkRejectCall(callExpression) { + const argument = callExpression.arguments.at(0); + if (argument) { + const type = services.getTypeAtLocation(argument); + if (options.allowThrowingAny && (0, util_1.isTypeAnyType)(type)) { + return; + } + if (options.allowThrowingUnknown && (0, util_1.isTypeUnknownType)(type)) { + return; + } + if ((0, util_1.isErrorLike)(services.program, type) || + (0, util_1.isReadonlyErrorLike)(services.program, type)) { + return; + } + } + else if (options.allowEmptyReject) { + return; + } + context.report({ + node: callExpression, + messageId: 'rejectAnError', + }); + } + function typeAtLocationIsLikePromise(node) { + const type = services.getTypeAtLocation(node); + return ((0, util_1.isPromiseConstructorLike)(services.program, type) || + (0, util_1.isPromiseLike)(services.program, type)); + } + return { + CallExpression(node) { + const callee = (0, util_1.skipChainExpression)(node.callee); + if (callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return; + } + if (!(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'reject') || + !typeAtLocationIsLikePromise(callee.object)) { + return; + } + checkRejectCall(node); + }, + NewExpression(node) { + const callee = (0, util_1.skipChainExpression)(node.callee); + if (!(0, util_1.isPromiseConstructorLike)(services.program, services.getTypeAtLocation(callee))) { + return; + } + const executor = node.arguments.at(0); + if (!executor || !(0, util_1.isFunction)(executor)) { + return; + } + const rejectParamNode = executor.params.at(1); + if (!rejectParamNode || !(0, util_1.isIdentifier)(rejectParamNode)) { + return; + } + // reject param is always present in variables declared by executor + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const rejectVariable = context.sourceCode + .getDeclaredVariables(executor) + .find(variable => variable.identifiers.includes(rejectParamNode)); + rejectVariable.references.forEach(ref => { + if (ref.identifier.parent.type !== utils_1.AST_NODE_TYPES.CallExpression || + ref.identifier !== ref.identifier.parent.callee) { + return; + } + checkRejectCall(ref.identifier.parent); + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.d.ts.map new file mode 100644 index 0000000..b668036 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-readonly-parameter-types.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-readonly-parameter-types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAUpD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;QAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC;;AAE5C,wBAqHG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js new file mode 100644 index 0000000..63cc636 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js @@ -0,0 +1,89 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-readonly-parameter-types', + meta: { + type: 'suggestion', + docs: { + description: 'Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs', + requiresTypeChecking: true, + }, + messages: { + shouldBeReadonly: 'Parameter should be a read only type.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + ...util_1.readonlynessOptionsSchema.properties.allow, + description: 'An array of type specifiers to ignore.', + }, + checkParameterProperties: { + type: 'boolean', + description: 'Whether to check class parameter properties.', + }, + ignoreInferredTypes: { + type: 'boolean', + description: "Whether to ignore parameters which don't explicitly specify a type.", + }, + treatMethodsAsReadonly: { + ...util_1.readonlynessOptionsSchema.properties.treatMethodsAsReadonly, + description: 'Whether to treat all mutable methods as though they are readonly.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: util_1.readonlynessOptionsDefaults.allow, + checkParameterProperties: true, + ignoreInferredTypes: false, + treatMethodsAsReadonly: util_1.readonlynessOptionsDefaults.treatMethodsAsReadonly, + }, + ], + create(context, [{ allow, checkParameterProperties, ignoreInferredTypes, treatMethodsAsReadonly, },]) { + const services = (0, util_1.getParserServices)(context); + return { + [[ + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + utils_1.AST_NODE_TYPES.TSFunctionType, + utils_1.AST_NODE_TYPES.TSMethodSignature, + ].join(', ')](node) { + for (const param of node.params) { + if (!checkParameterProperties && + param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) { + continue; + } + const actualParam = param.type === utils_1.AST_NODE_TYPES.TSParameterProperty + ? param.parameter + : param; + if (ignoreInferredTypes && actualParam.typeAnnotation == null) { + continue; + } + const type = services.getTypeAtLocation(actualParam); + const isReadOnly = (0, util_1.isTypeReadonly)(services.program, type, { + allow, + treatMethodsAsReadonly: !!treatMethodsAsReadonly, + }); + if (!isReadOnly) { + context.report({ + node: actualParam, + messageId: 'shouldBeReadonly', + }); + } + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.d.ts.map new file mode 100644 index 0000000..9788f7d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-readonly.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-readonly.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC1C,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B;CACF,CAAC;;AASF,wBAgUG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js new file mode 100644 index 0000000..d92c6b7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js @@ -0,0 +1,392 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getMemberHeadLoc_1 = require("../util/getMemberHeadLoc"); +const functionScopeBoundaries = [ + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.MethodDefinition, +].join(', '); +exports.default = (0, util_1.createRule)({ + name: 'prefer-readonly', + meta: { + type: 'suggestion', + docs: { + description: "Require private members to be marked as `readonly` if they're never modified outside of the constructor", + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferReadonly: "Member '{{name}}' is never reassigned; mark it as `readonly`.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + onlyInlineLambdas: { + type: 'boolean', + description: 'Whether to restrict checking only to members immediately assigned a lambda value.', + }, + }, + }, + ], + }, + defaultOptions: [{ onlyInlineLambdas: false }], + create(context, [{ onlyInlineLambdas }]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const classScopeStack = []; + function handlePropertyAccessExpression(node, parent, classScope) { + if (ts.isBinaryExpression(parent)) { + handleParentBinaryExpression(node, parent, classScope); + return; + } + if (ts.isDeleteExpression(parent) || isDestructuringAssignment(node)) { + classScope.addVariableModification(node); + return; + } + if (ts.isPostfixUnaryExpression(parent) || + ts.isPrefixUnaryExpression(parent)) { + handleParentPostfixOrPrefixUnaryExpression(parent, classScope); + } + } + function handleParentBinaryExpression(node, parent, classScope) { + if (parent.left === node && + tsutils.isAssignmentKind(parent.operatorToken.kind)) { + classScope.addVariableModification(node); + } + } + function handleParentPostfixOrPrefixUnaryExpression(node, classScope) { + if (node.operator === ts.SyntaxKind.PlusPlusToken || + node.operator === ts.SyntaxKind.MinusMinusToken) { + classScope.addVariableModification(node.operand); + } + } + function isDestructuringAssignment(node) { + let current = node.parent; + while (current) { + const parent = current.parent; + if (ts.isObjectLiteralExpression(parent) || + ts.isArrayLiteralExpression(parent) || + ts.isSpreadAssignment(parent) || + (ts.isSpreadElement(parent) && + ts.isArrayLiteralExpression(parent.parent))) { + current = parent; + } + else if (ts.isBinaryExpression(parent) && + !ts.isPropertyAccessExpression(current)) { + return (parent.left === current && + parent.operatorToken.kind === ts.SyntaxKind.EqualsToken); + } + else { + break; + } + } + return false; + } + function isFunctionScopeBoundaryInStack(node) { + if (classScopeStack.length === 0) { + return false; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (ts.isConstructorDeclaration(tsNode)) { + return false; + } + return tsutils.isFunctionScopeBoundary(tsNode); + } + function getEsNodesFromViolatingNode(violatingNode) { + return { + esNode: services.tsNodeToESTreeNodeMap.get(violatingNode), + nameNode: services.tsNodeToESTreeNodeMap.get(violatingNode.name), + }; + } + function getTypeAnnotationForViolatingNode(node, type, initializerType) { + const annotation = checker.typeToString(type); + // verify the about-to-be-added type annotation is in-scope + if (tsutils.isTypeFlagSet(initializerType, ts.TypeFlags.EnumLiteral)) { + const scope = context.sourceCode.getScope(node); + const variable = utils_1.ASTUtils.findVariable(scope, annotation); + if (variable == null) { + return null; + } + const definition = variable.defs.find(def => def.isTypeDefinition); + if (definition == null) { + return null; + } + const definitionType = services.getTypeAtLocation(definition.node); + if (definitionType !== type) { + return null; + } + } + return annotation; + } + return { + [`${functionScopeBoundaries}:exit`](node) { + if (utils_1.ASTUtils.isConstructor(node)) { + classScopeStack[classScopeStack.length - 1].exitConstructor(); + } + else if (isFunctionScopeBoundaryInStack(node)) { + classScopeStack[classScopeStack.length - 1].exitNonConstructor(); + } + }, + 'ClassDeclaration, ClassExpression'(node) { + classScopeStack.push(new ClassScope(checker, services.esTreeNodeToTSNodeMap.get(node), onlyInlineLambdas)); + }, + 'ClassDeclaration, ClassExpression:exit'() { + const finalizedClassScope = (0, util_1.nullThrows)(classScopeStack.pop(), 'Stack should exist on class exit'); + for (const violatingNode of finalizedClassScope.finalizeUnmodifiedPrivateNonReadonlys()) { + const { esNode, nameNode } = getEsNodesFromViolatingNode(violatingNode); + const reportNodeOrLoc = (() => { + switch (esNode.type) { + case utils_1.AST_NODE_TYPES.MethodDefinition: + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + return { loc: (0, getMemberHeadLoc_1.getMemberHeadLoc)(context.sourceCode, esNode) }; + case utils_1.AST_NODE_TYPES.TSParameterProperty: + return { + loc: (0, getMemberHeadLoc_1.getParameterPropertyHeadLoc)(context.sourceCode, esNode, nameNode.name), + }; + default: + return { node: esNode }; + } + })(); + const typeAnnotation = (() => { + if (esNode.type !== utils_1.AST_NODE_TYPES.PropertyDefinition) { + return null; + } + if (esNode.typeAnnotation || !esNode.value) { + return null; + } + if (nameNode.type !== utils_1.AST_NODE_TYPES.Identifier) { + return null; + } + const hasConstructorModifications = finalizedClassScope.memberHasConstructorModifications(nameNode.name); + if (!hasConstructorModifications) { + return null; + } + const violatingType = services.getTypeAtLocation(esNode); + const initializerType = services.getTypeAtLocation(esNode.value); + // if the RHS is a literal, its type would be narrowed, while the + // type of the initializer (which isn't `readonly`) would be the + // widened type + if (initializerType === violatingType) { + return null; + } + if (!tsutils.isLiteralType(initializerType)) { + return null; + } + return getTypeAnnotationForViolatingNode(esNode, violatingType, initializerType); + })(); + context.report({ + ...reportNodeOrLoc, + messageId: 'preferReadonly', + data: { + name: context.sourceCode.getText(nameNode), + }, + *fix(fixer) { + yield fixer.insertTextBefore(nameNode, 'readonly '); + if (typeAnnotation) { + yield fixer.insertTextAfter(nameNode, `: ${typeAnnotation}`); + } + }, + }); + } + }, + [functionScopeBoundaries](node) { + if (utils_1.ASTUtils.isConstructor(node)) { + classScopeStack[classScopeStack.length - 1].enterConstructor(services.esTreeNodeToTSNodeMap.get(node)); + } + else if (isFunctionScopeBoundaryInStack(node)) { + classScopeStack[classScopeStack.length - 1].enterNonConstructor(); + } + }, + MemberExpression(node) { + if (classScopeStack.length !== 0 && !node.computed) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + handlePropertyAccessExpression(tsNode, tsNode.parent, classScopeStack[classScopeStack.length - 1]); + } + }, + }; + }, +}); +const OUTSIDE_CONSTRUCTOR = -1; +const DIRECTLY_INSIDE_CONSTRUCTOR = 0; +var TypeToClassRelation; +(function (TypeToClassRelation) { + TypeToClassRelation[TypeToClassRelation["ClassAndInstance"] = 0] = "ClassAndInstance"; + TypeToClassRelation[TypeToClassRelation["Class"] = 1] = "Class"; + TypeToClassRelation[TypeToClassRelation["Instance"] = 2] = "Instance"; + TypeToClassRelation[TypeToClassRelation["None"] = 3] = "None"; +})(TypeToClassRelation || (TypeToClassRelation = {})); +class ClassScope { + checker; + onlyInlineLambdas; + classType; + constructorScopeDepth = OUTSIDE_CONSTRUCTOR; + memberVariableModifications = new Set(); + memberVariableWithConstructorModifications = new Set(); + privateModifiableMembers = new Map(); + privateModifiableStatics = new Map(); + staticVariableModifications = new Set(); + constructor(checker, classNode, onlyInlineLambdas) { + this.checker = checker; + this.onlyInlineLambdas = onlyInlineLambdas; + const classType = checker.getTypeAtLocation(classNode); + if (tsutils.isIntersectionType(classType)) { + this.classType = classType.types[0]; + } + else { + this.classType = classType; + } + for (const member of classNode.members) { + if (ts.isPropertyDeclaration(member)) { + this.addDeclaredVariable(member); + } + } + } + addDeclaredVariable(node) { + if (!(tsutils.isModifierFlagSet(node, ts.ModifierFlags.Private) || + node.name.kind === ts.SyntaxKind.PrivateIdentifier) || + tsutils.isModifierFlagSet(node, ts.ModifierFlags.Accessor | ts.ModifierFlags.Readonly) || + ts.isComputedPropertyName(node.name)) { + return; + } + if (this.onlyInlineLambdas && + node.initializer != null && + !ts.isArrowFunction(node.initializer)) { + return; + } + (tsutils.isModifierFlagSet(node, ts.ModifierFlags.Static) + ? this.privateModifiableStatics + : this.privateModifiableMembers).set(node.name.getText(), node); + } + addVariableModification(node) { + const modifierType = this.checker.getTypeAtLocation(node.expression); + const relationOfModifierTypeToClass = this.getTypeToClassRelation(modifierType); + if (relationOfModifierTypeToClass === TypeToClassRelation.Instance && + this.constructorScopeDepth === DIRECTLY_INSIDE_CONSTRUCTOR) { + this.memberVariableWithConstructorModifications.add(node.name.text); + return; + } + if (relationOfModifierTypeToClass === TypeToClassRelation.Instance || + relationOfModifierTypeToClass === TypeToClassRelation.ClassAndInstance) { + this.memberVariableModifications.add(node.name.text); + } + if (relationOfModifierTypeToClass === TypeToClassRelation.Class || + relationOfModifierTypeToClass === TypeToClassRelation.ClassAndInstance) { + this.staticVariableModifications.add(node.name.text); + } + } + enterConstructor(node) { + this.constructorScopeDepth = DIRECTLY_INSIDE_CONSTRUCTOR; + for (const parameter of node.parameters) { + if (tsutils.isModifierFlagSet(parameter, ts.ModifierFlags.Private)) { + this.addDeclaredVariable(parameter); + } + } + } + enterNonConstructor() { + if (this.constructorScopeDepth !== OUTSIDE_CONSTRUCTOR) { + this.constructorScopeDepth += 1; + } + } + exitConstructor() { + this.constructorScopeDepth = OUTSIDE_CONSTRUCTOR; + } + exitNonConstructor() { + if (this.constructorScopeDepth !== OUTSIDE_CONSTRUCTOR) { + this.constructorScopeDepth -= 1; + } + } + finalizeUnmodifiedPrivateNonReadonlys() { + this.memberVariableModifications.forEach(variableName => { + this.privateModifiableMembers.delete(variableName); + }); + this.staticVariableModifications.forEach(variableName => { + this.privateModifiableStatics.delete(variableName); + }); + return [ + ...this.privateModifiableMembers.values(), + ...this.privateModifiableStatics.values(), + ]; + } + getTypeToClassRelation(type) { + if (type.isIntersection()) { + let result = TypeToClassRelation.None; + for (const subType of type.types) { + const subTypeResult = this.getTypeToClassRelation(subType); + switch (subTypeResult) { + case TypeToClassRelation.Class: + if (result === TypeToClassRelation.Instance) { + return TypeToClassRelation.ClassAndInstance; + } + result = TypeToClassRelation.Class; + break; + case TypeToClassRelation.Instance: + if (result === TypeToClassRelation.Class) { + return TypeToClassRelation.ClassAndInstance; + } + result = TypeToClassRelation.Instance; + break; + } + } + return result; + } + if (type.isUnion()) { + // any union of class/instance and something else will prevent access to + // private members, so we assume that union consists only of classes + // or class instances, because otherwise tsc will report an error + return this.getTypeToClassRelation(type.types[0]); + } + if (!type.getSymbol() || !(0, util_1.typeIsOrHasBaseType)(type, this.classType)) { + return TypeToClassRelation.None; + } + const typeIsClass = tsutils.isObjectType(type) && + tsutils.isObjectFlagSet(type, ts.ObjectFlags.Anonymous); + if (typeIsClass) { + return TypeToClassRelation.Class; + } + return TypeToClassRelation.Instance; + } + memberHasConstructorModifications(name) { + return this.memberVariableWithConstructorModifications.has(name); + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.d.ts.map new file mode 100644 index 0000000..a28bfe2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-reduce-type-parameter.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-reduce-type-parameter.ts"],"names":[],"mappings":";AAiBA,wBA6GG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js new file mode 100644 index 0000000..7fd99bc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js @@ -0,0 +1,114 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-reduce-type-parameter', + meta: { + type: 'problem', + docs: { + description: 'Enforce using type parameter when calling `Array#reduce` instead of using a type assertion', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferTypeParameter: 'Unnecessary assertion: Array#reduce accepts a type parameter for the default value.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function isArrayType(type) { + return tsutils + .unionTypeParts(type) + .every(unionPart => tsutils + .intersectionTypeParts(unionPart) + .every(t => checker.isArrayType(t) || checker.isTupleType(t))); + } + return { + 'CallExpression > MemberExpression.callee'(callee) { + if (!(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'reduce')) { + return; + } + const [, secondArg] = callee.parent.arguments; + if (callee.parent.arguments.length < 2) { + return; + } + if ((0, util_1.isTypeAssertion)(secondArg)) { + const initializerType = services.getTypeAtLocation(secondArg.expression); + const assertedType = services.getTypeAtLocation(secondArg.typeAnnotation); + const isAssertionNecessary = !checker.isTypeAssignableTo(initializerType, assertedType); + // don't report this if the resulting fix will be a type error + if (isAssertionNecessary) { + return; + } + } + else { + return; + } + // Get the symbol of the `reduce` method. + const calleeObjType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object); + // Check the owner type of the `reduce` method. + if (isArrayType(calleeObjType)) { + context.report({ + node: secondArg, + messageId: 'preferTypeParameter', + fix: fixer => { + const fixes = [ + fixer.removeRange([ + secondArg.range[0], + secondArg.expression.range[0], + ]), + fixer.removeRange([ + secondArg.expression.range[1], + secondArg.range[1], + ]), + ]; + if (!callee.parent.typeArguments) { + fixes.push(fixer.insertTextAfter(callee, `<${context.sourceCode.getText(secondArg.typeAnnotation)}>`)); + } + return fixes; + }, + }); + return; + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.d.ts.map new file mode 100644 index 0000000..9aecc39 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-regexp-exec.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-regexp-exec.ts"],"names":[],"mappings":";AAsBA,wBAkKG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js new file mode 100644 index 0000000..45a8de0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js @@ -0,0 +1,178 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +var ArgumentType; +(function (ArgumentType) { + ArgumentType[ArgumentType["Other"] = 0] = "Other"; + ArgumentType[ArgumentType["String"] = 1] = "String"; + ArgumentType[ArgumentType["RegExp"] = 2] = "RegExp"; + ArgumentType[ArgumentType["Both"] = 3] = "Both"; +})(ArgumentType || (ArgumentType = {})); +exports.default = (0, util_1.createRule)({ + name: 'prefer-regexp-exec', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce `RegExp#exec` over `String#match` if no global flag is provided', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + regExpExecOverStringMatch: 'Use the `RegExp#exec()` method instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + /** + * Check if a given node type is a string. + * @param type The node type to check. + */ + function isStringType(type) { + return (0, util_1.getTypeName)(checker, type) === 'string'; + } + /** + * Check if a given node type is a RegExp. + * @param type The node type to check. + */ + function isRegExpType(type) { + return (0, util_1.getTypeName)(checker, type) === 'RegExp'; + } + function collectArgumentTypes(types) { + let result = ArgumentType.Other; + for (const type of types) { + if (isRegExpType(type)) { + result |= ArgumentType.RegExp; + } + else if (isStringType(type)) { + result |= ArgumentType.String; + } + } + return result; + } + /** + * Returns true if and only if we have syntactic proof that the /g flag is + * absent. Returns false in all other cases (i.e. it still might or might + * not contain the global flag). + */ + function definitelyDoesNotContainGlobalFlag(node) { + if ((node.type === utils_1.AST_NODE_TYPES.CallExpression || + node.type === utils_1.AST_NODE_TYPES.NewExpression) && + node.callee.type === utils_1.AST_NODE_TYPES.Identifier && + node.callee.name === 'RegExp') { + const flags = node.arguments.at(1); + return !(flags?.type === utils_1.AST_NODE_TYPES.Literal && + typeof flags.value === 'string' && + flags.value.includes('g')); + } + return false; + } + return { + 'CallExpression[arguments.length=1] > MemberExpression'(memberNode) { + if (!(0, util_1.isStaticMemberAccessOfValue)(memberNode, context, 'match')) { + return; + } + const objectNode = memberNode.object; + const callNode = memberNode.parent; + const [argumentNode] = callNode.arguments; + const argumentValue = (0, util_1.getStaticValue)(argumentNode, globalScope); + if (!isStringType(services.getTypeAtLocation(objectNode))) { + return; + } + // Don't report regular expressions with global flag. + if ((!argumentValue && + !definitelyDoesNotContainGlobalFlag(argumentNode)) || + (argumentValue && + argumentValue.value instanceof RegExp && + argumentValue.value.flags.includes('g'))) { + return; + } + if (argumentNode.type === utils_1.AST_NODE_TYPES.Literal && + typeof argumentNode.value === 'string') { + let regExp; + try { + regExp = RegExp(argumentNode.value); + } + catch { + return; + } + return context.report({ + node: memberNode.property, + messageId: 'regExpExecOverStringMatch', + fix: (0, util_1.getWrappingFixer)({ + node: callNode, + innerNode: [objectNode], + sourceCode: context.sourceCode, + wrap: objectCode => `${regExp.toString()}.exec(${objectCode})`, + }), + }); + } + const argumentType = services.getTypeAtLocation(argumentNode); + const argumentTypes = collectArgumentTypes(tsutils.unionTypeParts(argumentType)); + switch (argumentTypes) { + case ArgumentType.RegExp: + return context.report({ + node: memberNode.property, + messageId: 'regExpExecOverStringMatch', + fix: (0, util_1.getWrappingFixer)({ + node: callNode, + innerNode: [objectNode, argumentNode], + sourceCode: context.sourceCode, + wrap: (objectCode, argumentCode) => `${argumentCode}.exec(${objectCode})`, + }), + }); + case ArgumentType.String: + return context.report({ + node: memberNode.property, + messageId: 'regExpExecOverStringMatch', + fix: (0, util_1.getWrappingFixer)({ + node: callNode, + innerNode: [objectNode, argumentNode], + sourceCode: context.sourceCode, + wrap: (objectCode, argumentCode) => `RegExp(${argumentCode}).exec(${objectCode})`, + }), + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.d.ts.map new file mode 100644 index 0000000..fa491db --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-return-this-type.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-return-this-type.ts"],"names":[],"mappings":";AAeA,wBA8JG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.js new file mode 100644 index 0000000..2fa732b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.js @@ -0,0 +1,148 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-return-this-type', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce that `this` is used when only `this` type is returned', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + useThisType: 'Use `this` type instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function tryGetNameInType(name, typeNode) { + if (typeNode.type === utils_1.AST_NODE_TYPES.TSTypeReference && + typeNode.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + typeNode.typeName.name === name) { + return typeNode; + } + if (typeNode.type === utils_1.AST_NODE_TYPES.TSUnionType) { + for (const type of typeNode.types) { + const found = tryGetNameInType(name, type); + if (found) { + return found; + } + } + } + return undefined; + } + function isThisSpecifiedInParameters(originalFunc) { + const firstArg = originalFunc.params.at(0); + return !!(firstArg?.type === utils_1.AST_NODE_TYPES.Identifier && firstArg.name === 'this'); + } + function isFunctionReturningThis(originalFunc, originalClass) { + if (isThisSpecifiedInParameters(originalFunc)) { + return false; + } + const func = services.esTreeNodeToTSNodeMap.get(originalFunc); + if (!func.body) { + return false; + } + const classType = services.getTypeAtLocation(originalClass); + if (func.body.kind !== ts.SyntaxKind.Block) { + const type = checker.getTypeAtLocation(func.body); + return classType.thisType === type; + } + let hasReturnThis = false; + let hasReturnClassType = false; + (0, util_1.forEachReturnStatement)(func.body, stmt => { + const expr = stmt.expression; + if (!expr) { + return; + } + // fast check + if (expr.kind === ts.SyntaxKind.ThisKeyword) { + hasReturnThis = true; + return; + } + const type = checker.getTypeAtLocation(expr); + if (classType === type) { + hasReturnClassType = true; + return true; + } + if (classType.thisType === type) { + hasReturnThis = true; + return; + } + return; + }); + return !hasReturnClassType && hasReturnThis; + } + function checkFunction(originalFunc, originalClass) { + const className = originalClass.id?.name; + if (!className || !originalFunc.returnType) { + return; + } + const node = tryGetNameInType(className, originalFunc.returnType.typeAnnotation); + if (!node) { + return; + } + if (isFunctionReturningThis(originalFunc, originalClass)) { + context.report({ + node, + messageId: 'useThisType', + fix: fixer => fixer.replaceText(node, 'this'), + }); + } + } + function checkProperty(node) { + if (!(node.value?.type === utils_1.AST_NODE_TYPES.FunctionExpression || + node.value?.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression)) { + return; + } + checkFunction(node.value, node.parent.parent); + } + return { + 'ClassBody > AccessorProperty': checkProperty, + 'ClassBody > MethodDefinition'(node) { + checkFunction(node.value, node.parent.parent); + }, + 'ClassBody > PropertyDefinition': checkProperty, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.d.ts.map new file mode 100644 index 0000000..225269b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-string-starts-ends-with.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-string-starts-ends-with.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAqBnE,KAAK,4BAA4B,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEvD,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,0BAA0B,CAAC,EAAE,4BAA4B,CAAC;KAC3D;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;;AAE/D,wBAkrBG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js new file mode 100644 index 0000000..b921a32 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js @@ -0,0 +1,512 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const regexpp_1 = require("@eslint-community/regexpp"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const EQ_OPERATORS = /^[=!]=/; +const regexpp = new regexpp_1.RegExpParser(); +exports.default = (0, util_1.createRule)({ + name: 'prefer-string-starts-ends-with', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using `String#startsWith` and `String#endsWith` over other equivalent methods of checking substrings', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferEndsWith: "Use the 'String#endsWith' method instead.", + preferStartsWith: "Use 'String#startsWith' method instead.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowSingleElementEquality: { + type: 'string', + description: 'Whether to allow equality checks against the first or last element of a string.', + enum: ['always', 'never'], + }, + }, + }, + ], + }, + defaultOptions: [{ allowSingleElementEquality: 'never' }], + create(context, [{ allowSingleElementEquality }]) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + /** + * Check if a given node is a string. + * @param node The node to check. + */ + function isStringType(node) { + const objectType = services.getTypeAtLocation(node); + return (0, util_1.getTypeName)(checker, objectType) === 'string'; + } + /** + * Check if a given node is a `Literal` node that is null. + * @param node The node to check. + */ + function isNull(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return evaluated != null && evaluated.value == null; + } + /** + * Check if a given node is a `Literal` node that is a given value. + * @param node The node to check. + * @param value The expected value of the `Literal` node. + */ + function isNumber(node, value) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return evaluated != null && evaluated.value === value; + } + /** + * Check if a given node is a `Literal` node that is a character. + * @param node The node to check. + */ + function isCharacter(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return (evaluated != null && + typeof evaluated.value === 'string' && + // checks if the string is a character long + evaluated.value[0] === evaluated.value); + } + /** + * Check if a given node is `==`, `===`, `!=`, or `!==`. + * @param node The node to check. + */ + function isEqualityComparison(node) { + return (node.type === utils_1.AST_NODE_TYPES.BinaryExpression && + EQ_OPERATORS.test(node.operator)); + } + /** + * Check if two given nodes are the same meaning. + * @param node1 A node to compare. + * @param node2 Another node to compare. + */ + function isSameTokens(node1, node2) { + const tokens1 = context.sourceCode.getTokens(node1); + const tokens2 = context.sourceCode.getTokens(node2); + if (tokens1.length !== tokens2.length) { + return false; + } + for (let i = 0; i < tokens1.length; ++i) { + const token1 = tokens1[i]; + const token2 = tokens2[i]; + if (token1.type !== token2.type || token1.value !== token2.value) { + return false; + } + } + return true; + } + /** + * Check if a given node is the expression of the length of a string. + * + * - If `length` property access of `expectedObjectNode`, it's `true`. + * E.g., `foo` → `foo.length` / `"foo"` → `"foo".length` + * - If `expectedObjectNode` is a string literal, `node` can be a number. + * E.g., `"foo"` → `3` + * + * @param node The node to check. + * @param expectedObjectNode The node which is expected as the receiver of `length` property. + */ + function isLengthExpression(node, expectedObjectNode) { + if (node.type === utils_1.AST_NODE_TYPES.MemberExpression) { + return ((0, util_1.getPropertyName)(node, globalScope) === 'length' && + isSameTokens(node.object, expectedObjectNode)); + } + const evaluatedLength = (0, util_1.getStaticValue)(node, globalScope); + const evaluatedString = (0, util_1.getStaticValue)(expectedObjectNode, globalScope); + return (evaluatedLength != null && + evaluatedString != null && + typeof evaluatedLength.value === 'number' && + typeof evaluatedString.value === 'string' && + evaluatedLength.value === evaluatedString.value.length); + } + /** + * Returns true if `node` is `-substring.length` or + * `parentString.length - substring.length` + */ + function isLengthAheadOfEnd(node, substring, parentString) { + return ((node.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.operator === '-' && + isLengthExpression(node.argument, substring)) || + (node.type === utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '-' && + isLengthExpression(node.left, parentString) && + isLengthExpression(node.right, substring))); + } + /** + * Check if a given node is the expression of the last index. + * + * E.g. `foo.length - 1` + * + * @param node The node to check. + * @param expectedObjectNode The node which is expected as the receiver of `length` property. + */ + function isLastIndexExpression(node, expectedObjectNode) { + return (node.type === utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '-' && + isLengthExpression(node.left, expectedObjectNode) && + isNumber(node.right, 1)); + } + /** + * Get the range of the property of a given `MemberExpression` node. + * + * - `obj[foo]` → the range of `[foo]` + * - `obf.foo` → the range of `.foo` + * - `(obj).foo` → the range of `.foo` + * + * @param node The member expression node to get. + */ + function getPropertyRange(node) { + const dotOrOpenBracket = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.object, util_1.isNotClosingParenToken), util_1.NullThrowsReasons.MissingToken('closing parenthesis', 'member')); + return [dotOrOpenBracket.range[0], node.range[1]]; + } + /** + * Parse a given `RegExp` pattern to that string if it's a static string. + * @param pattern The RegExp pattern text to parse. + * @param unicode Whether the RegExp is unicode. + */ + function parseRegExpText(pattern, unicode) { + // Parse it. + const ast = regexpp.parsePattern(pattern, undefined, undefined, { + unicode, + }); + if (ast.alternatives.length !== 1) { + return null; + } + // Drop `^`/`$` assertion. + const chars = ast.alternatives[0].elements; + const first = chars[0]; + if (first.type === 'Assertion' && first.kind === 'start') { + chars.shift(); + } + else { + chars.pop(); + } + // Check if it can determine a unique string. + if (!chars.every(c => c.type === 'Character')) { + return null; + } + // To string. + return String.fromCodePoint(...chars.map(c => c.value)); + } + /** + * Parse a given node if it's a `RegExp` instance. + * @param node The node to parse. + */ + function parseRegExp(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + if (evaluated == null || !(evaluated.value instanceof RegExp)) { + return null; + } + const { flags, source } = evaluated.value; + const isStartsWith = source.startsWith('^'); + const isEndsWith = source.endsWith('$'); + if (isStartsWith === isEndsWith || + flags.includes('i') || + flags.includes('m')) { + return null; + } + const text = parseRegExpText(source, flags.includes('u')); + if (text == null) { + return null; + } + return { isEndsWith, isStartsWith, text }; + } + function getLeftNode(init) { + const node = (0, util_1.skipChainExpression)(init); + const leftNode = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node; + if (leftNode.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + throw new Error(`Expected a MemberExpression, got ${leftNode.type}`); + } + return leftNode; + } + /** + * Fix code with using the right operand as the search string. + * For example: `foo.slice(0, 3) === 'bar'` → `foo.startsWith('bar')` + * @param fixer The rule fixer. + * @param node The node which was reported. + * @param kind The kind of the report. + * @param isNegative The flag to fix to negative condition. + */ + function* fixWithRightOperand(fixer, node, kind, isNegative, isOptional) { + // left is CallExpression or MemberExpression. + const leftNode = getLeftNode(node.left); + const propertyRange = getPropertyRange(leftNode); + if (isNegative) { + yield fixer.insertTextBefore(node, '!'); + } + yield fixer.replaceTextRange([propertyRange[0], node.right.range[0]], `${isOptional ? '?.' : '.'}${kind}sWith(`); + yield fixer.replaceTextRange([node.right.range[1], node.range[1]], ')'); + } + /** + * Fix code with using the first argument as the search string. + * For example: `foo.indexOf('bar') === 0` → `foo.startsWith('bar')` + * @param fixer The rule fixer. + * @param node The node which was reported. + * @param kind The kind of the report. + * @param negative The flag to fix to negative condition. + */ + function* fixWithArgument(fixer, node, callNode, calleeNode, kind, negative, isOptional) { + if (negative) { + yield fixer.insertTextBefore(node, '!'); + } + yield fixer.replaceTextRange(getPropertyRange(calleeNode), `${isOptional ? '?.' : '.'}${kind}sWith`); + yield fixer.removeRange([callNode.range[1], node.range[1]]); + } + function getParent(node) { + return (0, util_1.nullThrows)(node.parent?.type === utils_1.AST_NODE_TYPES.ChainExpression + ? node.parent.parent + : node.parent, util_1.NullThrowsReasons.MissingParent); + } + return { + // foo[0] === "a" + // foo.charAt(0) === "a" + // foo[foo.length - 1] === "a" + // foo.charAt(foo.length - 1) === "a" + [[ + 'BinaryExpression > MemberExpression.left[computed=true]', + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="charAt"][computed=false]', + 'BinaryExpression > ChainExpression.left > MemberExpression[computed=true]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="charAt"][computed=false]', + ].join(', ')](node) { + let parentNode = getParent(node); + let indexNode = null; + if (parentNode.type === utils_1.AST_NODE_TYPES.CallExpression) { + if (parentNode.arguments.length === 1) { + indexNode = parentNode.arguments[0]; + } + parentNode = getParent(parentNode); + } + else { + indexNode = node.property; + } + if (indexNode == null || + !isEqualityComparison(parentNode) || + !isStringType(node.object)) { + return; + } + const isEndsWith = isLastIndexExpression(indexNode, node.object); + if (allowSingleElementEquality === 'always' && isEndsWith) { + return; + } + const isStartsWith = !isEndsWith && isNumber(indexNode, 0); + if ((allowSingleElementEquality === 'always' && isStartsWith) || + (!isStartsWith && !isEndsWith)) { + return; + } + const eqNode = parentNode; + context.report({ + node: parentNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + fix(fixer) { + // Don't fix if it can change the behavior. + if (!isCharacter(eqNode.right)) { + return null; + } + return fixWithRightOperand(fixer, eqNode, isStartsWith ? 'start' : 'end', eqNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.indexOf('bar') === 0 + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="indexOf"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="indexOf"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (callNode.arguments.length !== 1 || + !isEqualityComparison(parentNode) || + !isNumber(parentNode.right, 0) || + !isStringType(node.object)) { + return; + } + context.report({ + node: parentNode, + messageId: 'preferStartsWith', + fix(fixer) { + return fixWithArgument(fixer, parentNode, callNode, node, 'start', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.lastIndexOf('bar') === foo.length - 3 + // foo.lastIndexOf(bar) === foo.length - bar.length + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="lastIndexOf"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="lastIndexOf"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (callNode.arguments.length !== 1 || + !isEqualityComparison(parentNode) || + parentNode.right.type !== utils_1.AST_NODE_TYPES.BinaryExpression || + parentNode.right.operator !== '-' || + !isLengthExpression(parentNode.right.left, node.object) || + !isLengthExpression(parentNode.right.right, callNode.arguments[0]) || + !isStringType(node.object)) { + return; + } + context.report({ + node: parentNode, + messageId: 'preferEndsWith', + fix(fixer) { + return fixWithArgument(fixer, parentNode, callNode, node, 'end', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.match(/^bar/) === null + // foo.match(/bar$/) === null + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="match"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="match"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (!isNull(parentNode.right) || !isStringType(node.object)) { + return; + } + const parsed = callNode.arguments.length === 1 + ? parseRegExp(callNode.arguments[0]) + : null; + if (parsed == null) { + return; + } + const { isStartsWith, text } = parsed; + context.report({ + node: callNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + *fix(fixer) { + if (!parentNode.operator.startsWith('!')) { + yield fixer.insertTextBefore(parentNode, '!'); + } + yield fixer.replaceTextRange(getPropertyRange(node), `${node.optional ? '?.' : '.'}${isStartsWith ? 'start' : 'end'}sWith`); + yield fixer.replaceText(callNode.arguments[0], JSON.stringify(text)); + yield fixer.removeRange([callNode.range[1], parentNode.range[1]]); + }, + }); + }, + // foo.slice(0, 3) === 'bar' + // foo.slice(-3) === 'bar' + // foo.slice(-3, foo.length) === 'bar' + // foo.substring(0, 3) === 'bar' + // foo.substring(foo.length - 3) === 'bar' + // foo.substring(foo.length - 3, foo.length) === 'bar' + [[ + 'BinaryExpression > CallExpression.left > MemberExpression', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression', + ].join(', ')](node) { + if (!(0, util_1.isStaticMemberAccessOfValue)(node, context, 'slice', 'substring')) { + return; + } + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (!isEqualityComparison(parentNode) || !isStringType(node.object)) { + return; + } + let isEndsWith = false; + let isStartsWith = false; + if (callNode.arguments.length === 1) { + if ( + // foo.slice(-bar.length) === bar + // foo.slice(foo.length - bar.length) === bar + isLengthAheadOfEnd(callNode.arguments[0], parentNode.right, node.object)) { + isEndsWith = true; + } + } + else if (callNode.arguments.length === 2) { + if ( + // foo.slice(0, bar.length) === bar + isNumber(callNode.arguments[0], 0) && + isLengthExpression(callNode.arguments[1], parentNode.right)) { + isStartsWith = true; + } + else if ( + // foo.slice(foo.length - bar.length, foo.length) === bar + // foo.slice(foo.length - bar.length, 0) === bar + // foo.slice(-bar.length, foo.length) === bar + // foo.slice(-bar.length, 0) === bar + (isLengthExpression(callNode.arguments[1], node.object) || + isNumber(callNode.arguments[1], 0)) && + isLengthAheadOfEnd(callNode.arguments[0], parentNode.right, node.object)) { + isEndsWith = true; + } + } + if (!isStartsWith && !isEndsWith) { + return; + } + const eqNode = parentNode; + const negativeIndexSupported = node.property.name === 'slice'; + context.report({ + node: parentNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + fix(fixer) { + // Don't fix if it can change the behavior. + if (eqNode.operator.length === 2 && + (eqNode.right.type !== utils_1.AST_NODE_TYPES.Literal || + typeof eqNode.right.value !== 'string')) { + return null; + } + // code being checked is likely mistake: + // unequal length of strings being checked for equality + // or reliant on behavior of substring (negative indices interpreted as 0) + if (isStartsWith) { + if (!isLengthExpression(callNode.arguments[1], eqNode.right)) { + return null; + } + } + else { + const posNode = callNode.arguments[0]; + const posNodeIsAbsolutelyValid = (posNode.type === utils_1.AST_NODE_TYPES.BinaryExpression && + posNode.operator === '-' && + isLengthExpression(posNode.left, node.object) && + isLengthExpression(posNode.right, eqNode.right)) || + (negativeIndexSupported && + posNode.type === utils_1.AST_NODE_TYPES.UnaryExpression && + posNode.operator === '-' && + isLengthExpression(posNode.argument, eqNode.right)); + if (!posNodeIsAbsolutelyValid) { + return null; + } + } + return fixWithRightOperand(fixer, parentNode, isStartsWith ? 'start' : 'end', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // /^bar/.test(foo) + // /bar$/.test(foo) + 'CallExpression > MemberExpression.callee[property.name="test"][computed=false]'(node) { + const callNode = getParent(node); + const parsed = callNode.arguments.length === 1 ? parseRegExp(node.object) : null; + if (parsed == null) { + return; + } + const { isStartsWith, text } = parsed; + const messageId = isStartsWith ? 'preferStartsWith' : 'preferEndsWith'; + const methodName = isStartsWith ? 'startsWith' : 'endsWith'; + context.report({ + node: callNode, + messageId, + *fix(fixer) { + const argNode = callNode.arguments[0]; + const needsParen = argNode.type !== utils_1.AST_NODE_TYPES.Literal && + argNode.type !== utils_1.AST_NODE_TYPES.TemplateLiteral && + argNode.type !== utils_1.AST_NODE_TYPES.Identifier && + argNode.type !== utils_1.AST_NODE_TYPES.MemberExpression && + argNode.type !== utils_1.AST_NODE_TYPES.CallExpression; + yield fixer.removeRange([callNode.range[0], argNode.range[0]]); + if (needsParen) { + yield fixer.insertTextBefore(argNode, '('); + yield fixer.insertTextAfter(argNode, ')'); + } + yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}${methodName}(${JSON.stringify(text)}`); + }, + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.d.ts.map new file mode 100644 index 0000000..5bc0b81 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-ts-expect-error.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-ts-expect-error.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,UAAU,GAAG,0BAA0B,CAAC;;AAEpD,wBA0EG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js new file mode 100644 index 0000000..f20687d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-ts-expect-error', + meta: { + type: 'problem', + deprecated: true, + docs: { + description: 'Enforce using `@ts-expect-error` over `@ts-ignore`', + }, + fixable: 'code', + messages: { + preferExpectErrorComment: 'Use "@ts-expect-error" to ensure an error is actually being suppressed.', + }, + replacedBy: ['@typescript-eslint/ban-ts-comment'], + schema: [], + }, + defaultOptions: [], + create(context) { + const tsIgnoreRegExpSingleLine = /^\s*\/?\s*@ts-ignore/; + const tsIgnoreRegExpMultiLine = /^\s*(?:\/|\*)*\s*@ts-ignore/; + function isLineComment(comment) { + return comment.type === utils_1.AST_TOKEN_TYPES.Line; + } + function getLastCommentLine(comment) { + if (isLineComment(comment)) { + return comment.value; + } + // For multiline comments - we look at only the last line. + const commentlines = comment.value.split('\n'); + return commentlines[commentlines.length - 1]; + } + function isValidTsIgnorePresent(comment) { + const line = getLastCommentLine(comment); + return isLineComment(comment) + ? tsIgnoreRegExpSingleLine.test(line) + : tsIgnoreRegExpMultiLine.test(line); + } + return { + Program() { + const comments = context.sourceCode.getAllComments(); + comments.forEach(comment => { + if (isValidTsIgnorePresent(comment)) { + const lineCommentRuleFixer = (fixer) => fixer.replaceText(comment, `//${comment.value.replace('@ts-ignore', '@ts-expect-error')}`); + const blockCommentRuleFixer = (fixer) => fixer.replaceText(comment, `/*${comment.value.replace('@ts-ignore', '@ts-expect-error')}*/`); + context.report({ + node: comment, + messageId: 'preferExpectErrorComment', + fix: isLineComment(comment) + ? lineCommentRuleFixer + : blockCommentRuleFixer, + }); + } + }); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.d.ts.map new file mode 100644 index 0000000..2c026eb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"promise-function-async.d.ts","sourceRoot":"","sources":["../../src/rules/promise-function-async.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,uBAAuB,CAAC,EAAE,OAAO,CAAC;KACnC;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC;;AAExC,wBA6OG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js new file mode 100644 index 0000000..0c068ff --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js @@ -0,0 +1,197 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'promise-function-async', + meta: { + type: 'suggestion', + docs: { + description: 'Require any function or method that returns a Promise to be marked async', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + missingAsync: 'Functions that return promises must be async.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowAny: { + type: 'boolean', + description: 'Whether to consider `any` and `unknown` to be Promises.', + }, + allowedPromiseNames: { + type: 'array', + description: 'Any extra names of classes or interfaces to be considered Promises.', + items: { + type: 'string', + }, + }, + checkArrowFunctions: { + type: 'boolean', + description: 'Whether to check arrow functions.', + }, + checkFunctionDeclarations: { + type: 'boolean', + description: 'Whether to check standalone function declarations.', + }, + checkFunctionExpressions: { + type: 'boolean', + description: 'Whether to check inline function expressions', + }, + checkMethodDeclarations: { + type: 'boolean', + description: 'Whether to check methods on classes and object literals.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowAny: true, + allowedPromiseNames: [], + checkArrowFunctions: true, + checkFunctionDeclarations: true, + checkFunctionExpressions: true, + checkMethodDeclarations: true, + }, + ], + create(context, [{ allowAny, allowedPromiseNames, checkArrowFunctions, checkFunctionDeclarations, checkFunctionExpressions, checkMethodDeclarations, },]) { + const allAllowedPromiseNames = new Set([ + 'Promise', + // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + ...allowedPromiseNames, + ]); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function validateNode(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition) { + // Abstract method can't be async + return; + } + if ((node.parent.type === utils_1.AST_NODE_TYPES.Property || + node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition) && + (node.parent.kind === 'get' || node.parent.kind === 'set')) { + // Getters and setters can't be async + return; + } + const signatures = services.getTypeAtLocation(node).getCallSignatures(); + if (!signatures.length) { + return; + } + const returnTypes = signatures.map(signature => checker.getReturnTypeOfSignature(signature)); + if (!allowAny && + returnTypes.some(type => (0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown))) { + // Report without auto fixer because the return type is unknown + return context.report({ + loc: (0, util_1.getFunctionHeadLoc)(node, context.sourceCode), + node, + messageId: 'missingAsync', + }); + } + if ( + // require all potential return types to be promise/any/unknown + returnTypes.every(type => (0, util_1.containsAllTypesByName)(type, true, allAllowedPromiseNames, + // If no return type is explicitly set, we check if any parts of the return type match a Promise (instead of requiring all to match). + node.returnType == null))) { + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(node, context.sourceCode), + node, + messageId: 'missingAsync', + fix: fixer => { + if (node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition || + (node.parent.type === utils_1.AST_NODE_TYPES.Property && + node.parent.method)) { + // this function is a class method or object function property shorthand + const method = node.parent; + // the token to put `async` before + let keyToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(method), util_1.NullThrowsReasons.MissingToken('key token', 'method')); + // if there are decorators then skip past them + if (method.type === utils_1.AST_NODE_TYPES.MethodDefinition && + method.decorators.length) { + const lastDecorator = method.decorators[method.decorators.length - 1]; + keyToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(lastDecorator), util_1.NullThrowsReasons.MissingToken('key token', 'last decorator')); + } + // if current token is a keyword like `static` or `public` then skip it + while (keyToken.type === utils_1.AST_TOKEN_TYPES.Keyword && + keyToken.range[0] < method.key.range[0]) { + keyToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(keyToken), util_1.NullThrowsReasons.MissingToken('token', 'keyword')); + } + // check if there is a space between key and previous token + const insertSpace = !context.sourceCode.isSpaceBetween((0, util_1.nullThrows)(context.sourceCode.getTokenBefore(keyToken), util_1.NullThrowsReasons.MissingToken('token', 'keyword')), keyToken); + let code = 'async '; + if (insertSpace) { + code = ` ${code}`; + } + return fixer.insertTextBefore(keyToken, code); + } + return fixer.insertTextBefore(node, 'async '); + }, + }); + } + } + return { + ...(checkArrowFunctions && { + 'ArrowFunctionExpression[async = false]'(node) { + validateNode(node); + }, + }), + ...(checkFunctionDeclarations && { + 'FunctionDeclaration[async = false]'(node) { + validateNode(node); + }, + }), + 'FunctionExpression[async = false]'(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + node.parent.kind === 'method') { + if (checkMethodDeclarations) { + validateNode(node); + } + return; + } + if (checkFunctionExpressions) { + validateNode(node); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.d.ts.map new file mode 100644 index 0000000..ff80124 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"related-getter-setter-pairs.d.ts","sourceRoot":"","sources":["../../src/rules/related-getter-setter-pairs.ts"],"names":[],"mappings":";AAwBA,wBAoFG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.js new file mode 100644 index 0000000..b0328ce --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'related-getter-setter-pairs', + meta: { + type: 'problem', + docs: { + description: 'Enforce that `get()` types should be assignable to their equivalent `set()` type', + recommended: 'strict', + requiresTypeChecking: true, + }, + messages: { + mismatch: '`get()` type should be assignable to its equivalent `set()` type.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const methodPairsStack = []; + function addPropertyNode(member, inner, kind) { + const methodPairs = methodPairsStack[methodPairsStack.length - 1]; + const { name } = (0, util_1.getNameFromMember)(member, context.sourceCode); + methodPairs.set(name, { + ...methodPairs.get(name), + [kind]: inner, + }); + } + return { + ':matches(ClassBody, TSInterfaceBody, TSTypeLiteral):exit'() { + const methodPairs = methodPairsStack[methodPairsStack.length - 1]; + for (const pair of methodPairs.values()) { + if (!pair.get || !pair.set) { + continue; + } + const getter = pair.get; + const getType = services.getTypeAtLocation(getter); + const setType = services.getTypeAtLocation(pair.set.params[0]); + if (!checker.isTypeAssignableTo(getType, setType)) { + context.report({ + node: getter.returnType.typeAnnotation, + messageId: 'mismatch', + }); + } + } + methodPairsStack.pop(); + }, + ':matches(MethodDefinition, TSMethodSignature)[kind=get]'(node) { + const getter = getMethodFromNode(node); + if (getter.returnType) { + addPropertyNode(node, getter, 'get'); + } + }, + ':matches(MethodDefinition, TSMethodSignature)[kind=set]'(node) { + const setter = getMethodFromNode(node); + if (setter.params.length === 1) { + addPropertyNode(node, setter, 'set'); + } + }, + 'ClassBody, TSInterfaceBody, TSTypeLiteral'() { + methodPairsStack.push(new Map()); + }, + }; + }, +}); +function getMethodFromNode(node) { + return node.type === utils_1.AST_NODE_TYPES.TSMethodSignature ? node : node.value; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.d.ts.map new file mode 100644 index 0000000..c8c8342 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"require-array-sort-compare.d.ts","sourceRoot":"","sources":["../../src/rules/require-array-sort-compare.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC;;AAE1C,wBAyEG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js new file mode 100644 index 0000000..eff6280 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'require-array-sort-compare', + meta: { + type: 'problem', + docs: { + description: 'Require `Array#sort` and `Array#toSorted` calls to always provide a `compareFunction`', + requiresTypeChecking: true, + }, + messages: { + requireCompare: "Require 'compare' argument.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreStringArrays: { + type: 'boolean', + description: 'Whether to ignore arrays in which all elements are strings.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreStringArrays: true, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + /** + * Check if a given node is an array which all elements are string. + */ + function isStringArrayNode(node) { + const type = services.getTypeAtLocation(node); + if (checker.isArrayType(type) || checker.isTupleType(type)) { + const typeArgs = checker.getTypeArguments(type); + return typeArgs.every(arg => (0, util_1.getTypeName)(checker, arg) === 'string'); + } + return false; + } + function checkSortArgument(callee) { + if (!(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'sort', 'toSorted')) { + return; + } + const calleeObjType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object); + if (options.ignoreStringArrays && isStringArrayNode(callee.object)) { + return; + } + if ((0, util_1.isTypeArrayTypeOrUnionOfArrayTypes)(calleeObjType, checker)) { + context.report({ node: callee.parent, messageId: 'requireCompare' }); + } + } + return { + 'CallExpression[arguments.length=0] > MemberExpression': checkSortArgument, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.d.ts.map new file mode 100644 index 0000000..5bf61da --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"require-await.d.ts","sourceRoot":"","sources":["../../src/rules/require-await.ts"],"names":[],"mappings":";AA8BA,wBAuRG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js new file mode 100644 index 0000000..afc5dff --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js @@ -0,0 +1,263 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'require-await', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow async functions which do not return promises and have no `await` expression', + extendsBaseRule: true, + recommended: 'recommended', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + missingAwait: "{{name}} has no 'await' expression.", + removeAsync: "Remove 'async'.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + let scopeInfo = null; + /** + * Push the scope info object to the stack. + */ + function enterFunction(node) { + scopeInfo = { + hasAsync: node.async, + hasAwait: false, + isAsyncYield: false, + isGen: node.generator || false, + upper: scopeInfo, + }; + } + /** + * Pop the top scope info object from the stack. + * Also, it reports the function if needed. + */ + function exitFunction(node) { + /* istanbul ignore if */ if (!scopeInfo) { + // this shouldn't ever happen, as we have to exit a function after we enter it + return; + } + if (node.async && + !scopeInfo.hasAwait && + !isEmptyFunction(node) && + !(scopeInfo.isGen && scopeInfo.isAsyncYield)) { + // If the function belongs to a method definition or + // property, then the function's range may not include the + // `async` keyword and we should look at the parent instead. + const nodeWithAsyncKeyword = (node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + node.parent.value === node) || + (node.parent.type === utils_1.AST_NODE_TYPES.Property && + node.parent.method && + node.parent.value === node) + ? node.parent + : node; + const asyncToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(nodeWithAsyncKeyword, token => token.value === 'async'), 'The node is an async function, so it must have an "async" token.'); + const asyncRange = [ + asyncToken.range[0], + (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(asyncToken, { + includeComments: true, + }), 'There will always be a token after the "async" keyword.').range[0], + ]; + // Removing the `async` keyword can cause parsing errors if the + // current statement is relying on automatic semicolon insertion. + // If ASI is currently being used, then we should replace the + // `async` keyword with a semicolon. + const nextToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(asyncToken), 'There will always be a token after the "async" keyword.'); + const addSemiColon = nextToken.type === utils_1.AST_TOKEN_TYPES.Punctuator && + (nextToken.value === '[' || nextToken.value === '(') && + (nodeWithAsyncKeyword.type === utils_1.AST_NODE_TYPES.MethodDefinition || + (0, util_1.isStartOfExpressionStatement)(nodeWithAsyncKeyword)) && + (0, util_1.needsPrecedingSemicolon)(context.sourceCode, nodeWithAsyncKeyword); + const changes = [ + { range: asyncRange, replacement: addSemiColon ? ';' : undefined }, + ]; + // If there's a return type annotation and it's a + // `Promise`, we can also change the return type + // annotation to just `T` as part of the suggestion. + // Alternatively, if the function is a generator and + // the return type annotation is `AsyncGenerator`, + // then we can change it to `Generator`. + if (node.returnType?.typeAnnotation.type === + utils_1.AST_NODE_TYPES.TSTypeReference) { + if (scopeInfo.isGen) { + if (hasTypeName(node.returnType.typeAnnotation, 'AsyncGenerator')) { + changes.push({ + range: node.returnType.typeAnnotation.typeName.range, + replacement: 'Generator', + }); + } + } + else if (hasTypeName(node.returnType.typeAnnotation, 'Promise') && + node.returnType.typeAnnotation.typeArguments != null) { + const openAngle = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node.returnType.typeAnnotation, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '<'), 'There are type arguments, so the angle bracket will exist.'); + const closeAngle = (0, util_1.nullThrows)(context.sourceCode.getLastToken(node.returnType.typeAnnotation, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '>'), 'There are type arguments, so the angle bracket will exist.'); + changes.push( + // Remove the closing angled bracket. + { range: closeAngle.range, replacement: undefined }, + // Remove the "Promise" identifier + // and the opening angled bracket. + { + range: [ + node.returnType.typeAnnotation.typeName.range[0], + openAngle.range[1], + ], + replacement: undefined, + }); + } + } + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(node, context.sourceCode), + node, + messageId: 'missingAwait', + data: { + name: (0, util_1.upperCaseFirst)((0, util_1.getFunctionNameWithKind)(node)), + }, + suggest: [ + { + messageId: 'removeAsync', + fix: (fixer) => changes.map(change => change.replacement != null + ? fixer.replaceTextRange(change.range, change.replacement) + : fixer.removeRange(change.range)), + }, + ], + }); + } + scopeInfo = scopeInfo.upper; + } + /** + * Checks if the node returns a thenable type + */ + function isThenableType(node) { + const type = checker.getTypeAtLocation(node); + return tsutils.isThenableType(checker, node, type); + } + /** + * Marks the current scope as having an await + */ + function markAsHasAwait() { + if (!scopeInfo) { + return; + } + scopeInfo.hasAwait = true; + } + /** + * Mark `scopeInfo.isAsyncYield` to `true` if it + * 1) delegates async generator function + * or + * 2) yields thenable type + */ + function visitYieldExpression(node) { + if (!scopeInfo?.isGen || !node.argument) { + return; + } + if (node.argument.type === utils_1.AST_NODE_TYPES.Literal) { + // ignoring this as for literals we don't need to check the definition + // eg : async function* run() { yield* 1 } + return; + } + if (!node.delegate) { + if (isThenableType(services.esTreeNodeToTSNodeMap.get(node.argument))) { + scopeInfo.isAsyncYield = true; + } + return; + } + const type = services.getTypeAtLocation(node.argument); + const typesToCheck = expandUnionOrIntersectionType(type); + for (const type of typesToCheck) { + const asyncIterator = tsutils.getWellKnownSymbolPropertyOfType(type, 'asyncIterator', checker); + if (asyncIterator != null) { + scopeInfo.isAsyncYield = true; + break; + } + } + } + return { + ArrowFunctionExpression: enterFunction, + 'ArrowFunctionExpression:exit': exitFunction, + AwaitExpression: markAsHasAwait, + 'ForOfStatement[await = true]': markAsHasAwait, + FunctionDeclaration: enterFunction, + 'FunctionDeclaration:exit': exitFunction, + FunctionExpression: enterFunction, + 'FunctionExpression:exit': exitFunction, + 'VariableDeclaration[kind = "await using"]': markAsHasAwait, + YieldExpression: visitYieldExpression, + // check body-less async arrow function. + // ignore `async () => await foo` because it's obviously correct + 'ArrowFunctionExpression[async = true] > :not(BlockStatement, AwaitExpression)'(node) { + const expression = services.esTreeNodeToTSNodeMap.get(node); + if (isThenableType(expression)) { + markAsHasAwait(); + } + }, + ReturnStatement(node) { + // short circuit early to avoid unnecessary type checks + if (!scopeInfo || scopeInfo.hasAwait || !scopeInfo.hasAsync) { + return; + } + const { expression } = services.esTreeNodeToTSNodeMap.get(node); + if (expression && isThenableType(expression)) { + markAsHasAwait(); + } + }, + }; + }, +}); +function isEmptyFunction(node) { + return (node.body.type === utils_1.AST_NODE_TYPES.BlockStatement && + node.body.body.length === 0); +} +function expandUnionOrIntersectionType(type) { + if (type.isUnionOrIntersection()) { + return type.types.flatMap(expandUnionOrIntersectionType); + } + return [type]; +} +function hasTypeName(typeReference, typeName) { + return (typeReference.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + typeReference.typeName.name === typeName); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.d.ts.map new file mode 100644 index 0000000..a65b537 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"restrict-plus-operands.d.ts","sourceRoot":"","sources":["../../src/rules/restrict-plus-operands.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,uBAAuB,CAAC,EAAE,OAAO,CAAC;KACnC;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,SAAS,GAAG,YAAY,CAAC;;AAEtE,wBA0OG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js new file mode 100644 index 0000000..421d013 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js @@ -0,0 +1,231 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'restrict-plus-operands', + meta: { + type: 'problem', + docs: { + description: 'Require both operands of addition to be the same type and be `bigint`, `number`, or `string`', + recommended: { + recommended: true, + strict: [ + { + allowAny: false, + allowBoolean: false, + allowNullish: false, + allowNumberAndString: false, + allowRegExp: false, + }, + ], + }, + requiresTypeChecking: true, + }, + messages: { + bigintAndNumber: "Numeric '+' operations must either be both bigints or both numbers. Got `{{left}}` + `{{right}}`.", + invalid: "Invalid operand for a '+' operation. Operands must each be a number or {{stringLike}}. Got `{{type}}`.", + mismatched: "Operands of '+' operations must be a number or {{stringLike}}. Got `{{left}}` + `{{right}}`.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowAny: { + type: 'boolean', + description: 'Whether to allow `any` typed values.', + }, + allowBoolean: { + type: 'boolean', + description: 'Whether to allow `boolean` typed values.', + }, + allowNullish: { + type: 'boolean', + description: 'Whether to allow potentially `null` or `undefined` typed values.', + }, + allowNumberAndString: { + type: 'boolean', + description: 'Whether to allow `bigint`/`number` typed values and `string` typed values to be added together.', + }, + allowRegExp: { + type: 'boolean', + description: 'Whether to allow `regexp` typed values.', + }, + skipCompoundAssignments: { + type: 'boolean', + description: 'Whether to skip compound assignments such as `+=`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowAny: true, + allowBoolean: true, + allowNullish: true, + allowNumberAndString: true, + allowRegExp: true, + skipCompoundAssignments: false, + }, + ], + create(context, [{ allowAny, allowBoolean, allowNullish, allowNumberAndString, allowRegExp, skipCompoundAssignments, },]) { + const services = (0, util_1.getParserServices)(context); + const typeChecker = services.program.getTypeChecker(); + const stringLikes = [ + allowAny && '`any`', + allowBoolean && '`boolean`', + allowNullish && '`null`', + allowRegExp && '`RegExp`', + allowNullish && '`undefined`', + ].filter((value) => typeof value === 'string'); + const stringLike = stringLikes.length + ? stringLikes.length === 1 + ? `string, allowing a string + ${stringLikes[0]}` + : `string, allowing a string + any of: ${stringLikes.join(', ')}` + : 'string'; + function getTypeConstrained(node) { + return typeChecker.getBaseTypeOfLiteralType((0, util_1.getConstrainedTypeAtLocation)(services, node)); + } + function checkPlusOperands(node) { + const leftType = getTypeConstrained(node.left); + const rightType = getTypeConstrained(node.right); + if (leftType === rightType && + tsutils.isTypeFlagSet(leftType, ts.TypeFlags.BigIntLike | + ts.TypeFlags.NumberLike | + ts.TypeFlags.StringLike)) { + return; + } + let hadIndividualComplaint = false; + for (const [baseNode, baseType, otherType] of [ + [node.left, leftType, rightType], + [node.right, rightType, leftType], + ]) { + if (isTypeFlagSetInUnion(baseType, ts.TypeFlags.ESSymbolLike | + ts.TypeFlags.Never | + ts.TypeFlags.Unknown) || + (!allowAny && isTypeFlagSetInUnion(baseType, ts.TypeFlags.Any)) || + (!allowBoolean && + isTypeFlagSetInUnion(baseType, ts.TypeFlags.BooleanLike)) || + (!allowNullish && + (0, util_1.isTypeFlagSet)(baseType, ts.TypeFlags.Null | ts.TypeFlags.Undefined))) { + context.report({ + node: baseNode, + messageId: 'invalid', + data: { + type: typeChecker.typeToString(baseType), + stringLike, + }, + }); + hadIndividualComplaint = true; + continue; + } + // RegExps also contain ts.TypeFlags.Any & ts.TypeFlags.Object + for (const subBaseType of tsutils.unionTypeParts(baseType)) { + const typeName = (0, util_1.getTypeName)(typeChecker, subBaseType); + if (typeName === 'RegExp' + ? !allowRegExp || + tsutils.isTypeFlagSet(otherType, ts.TypeFlags.NumberLike) + : (!allowAny && (0, util_1.isTypeAnyType)(subBaseType)) || + isDeeplyObjectType(subBaseType)) { + context.report({ + node: baseNode, + messageId: 'invalid', + data: { + type: typeChecker.typeToString(subBaseType), + stringLike, + }, + }); + hadIndividualComplaint = true; + continue; + } + } + } + if (hadIndividualComplaint) { + return; + } + for (const [baseType, otherType] of [ + [leftType, rightType], + [rightType, leftType], + ]) { + if (!allowNumberAndString && + isTypeFlagSetInUnion(baseType, ts.TypeFlags.StringLike) && + isTypeFlagSetInUnion(otherType, ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike)) { + return context.report({ + node, + messageId: 'mismatched', + data: { + left: typeChecker.typeToString(leftType), + right: typeChecker.typeToString(rightType), + stringLike, + }, + }); + } + if (isTypeFlagSetInUnion(baseType, ts.TypeFlags.NumberLike) && + isTypeFlagSetInUnion(otherType, ts.TypeFlags.BigIntLike)) { + return context.report({ + node, + messageId: 'bigintAndNumber', + data: { + left: typeChecker.typeToString(leftType), + right: typeChecker.typeToString(rightType), + }, + }); + } + } + } + return { + "BinaryExpression[operator='+']": checkPlusOperands, + ...(!skipCompoundAssignments && { + "AssignmentExpression[operator='+=']"(node) { + checkPlusOperands(node); + }, + }), + }; + }, +}); +function isDeeplyObjectType(type) { + return type.isIntersection() + ? tsutils.intersectionTypeParts(type).every(tsutils.isObjectType) + : tsutils.unionTypeParts(type).every(tsutils.isObjectType); +} +function isTypeFlagSetInUnion(type, flag) { + return tsutils + .unionTypeParts(type) + .some(subType => tsutils.isTypeFlagSet(subType, flag)); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.d.ts.map new file mode 100644 index 0000000..e72ec9b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"restrict-template-expressions.d.ts","sourceRoot":"","sources":["../../src/rules/restrict-template-expressions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AASpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAKL,aAAa,EAEb,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,KAAK,YAAY,GAAG,CAClB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,EACpB,oBAAoB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,KAC1C,OAAO,CAAC;AAOb,QAAA,MAAM,aAAa;;;4IARY,IAAI,KAAK,OAAO,KAaF,OAAO,2CAW7B,OAAO;GAQ3B,CAAC;AAEJ,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;KAChC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;CACvE,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;;AAEtC,wBA2GG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js new file mode 100644 index 0000000..b514423 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const type_utils_1 = require("@typescript-eslint/type-utils"); +const utils_1 = require("@typescript-eslint/utils"); +const typescript_1 = require("typescript"); +const util_1 = require("../util"); +const testTypeFlag = (flagsToCheck) => type => (0, util_1.isTypeFlagSet)(type, flagsToCheck); +const optionTesters = [ + ['Any', util_1.isTypeAnyType], + [ + 'Array', + (type, checker, recursivelyCheckType) => (checker.isArrayType(type) || checker.isTupleType(type)) && + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + recursivelyCheckType(type.getNumberIndexType()), + ], + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + ['Boolean', testTypeFlag(typescript_1.TypeFlags.BooleanLike)], + ['Nullish', testTypeFlag(typescript_1.TypeFlags.Null | typescript_1.TypeFlags.Undefined)], + ['Number', testTypeFlag(typescript_1.TypeFlags.NumberLike | typescript_1.TypeFlags.BigIntLike)], + [ + 'RegExp', + (type, checker) => (0, util_1.getTypeName)(checker, type) === 'RegExp', + ], + ['Never', util_1.isTypeNeverType], +].map(([type, tester]) => ({ + type, + option: `allow${type}`, + tester, +})); +exports.default = (0, util_1.createRule)({ + name: 'restrict-template-expressions', + meta: { + type: 'problem', + docs: { + description: 'Enforce template literal expressions to be of `string` type', + recommended: { + recommended: true, + strict: [ + { + allowAny: false, + allowBoolean: false, + allowNever: false, + allowNullish: false, + allowNumber: false, + allowRegExp: false, + }, + ], + }, + requiresTypeChecking: true, + }, + messages: { + invalidType: 'Invalid type "{{type}}" of template literal expression.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ...Object.fromEntries(optionTesters.map(({ type, option }) => [ + option, + { + type: 'boolean', + description: `Whether to allow \`${type.toLowerCase()}\` typed values in template expressions.`, + }, + ])), + allow: { + description: `Types to allow in template expressions.`, + ...type_utils_1.typeOrValueSpecifiersSchema, + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [{ name: ['Error', 'URL', 'URLSearchParams'], from: 'lib' }], + allowAny: true, + allowBoolean: true, + allowNullish: true, + allowNumber: true, + allowRegExp: true, + }, + ], + create(context, [{ allow, ...options }]) { + const services = (0, util_1.getParserServices)(context); + const { program } = services; + const checker = program.getTypeChecker(); + const enabledOptionTesters = optionTesters.filter(({ option }) => options[option]); + return { + TemplateLiteral(node) { + // don't check tagged template literals + if (node.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + return; + } + for (const expression of node.expressions) { + const expressionType = (0, util_1.getConstrainedTypeAtLocation)(services, expression); + if (!recursivelyCheckType(expressionType)) { + context.report({ + node: expression, + messageId: 'invalidType', + data: { type: checker.typeToString(expressionType) }, + }); + } + } + }, + }; + function recursivelyCheckType(innerType) { + if (innerType.isUnion()) { + return innerType.types.every(recursivelyCheckType); + } + if (innerType.isIntersection()) { + return innerType.types.some(recursivelyCheckType); + } + return ((0, util_1.isTypeFlagSet)(innerType, typescript_1.TypeFlags.StringLike) || + (0, type_utils_1.typeMatchesSomeSpecifier)(innerType, allow, program) || + enabledOptionTesters.some(({ tester }) => tester(innerType, checker, recursivelyCheckType))); + } + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.d.ts.map new file mode 100644 index 0000000..4224733 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"return-await.d.ts","sourceRoot":"","sources":["../../src/rules/return-await.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;;AAiCnE,wBAuXG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js new file mode 100644 index 0000000..b334025 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js @@ -0,0 +1,363 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'return-await', + meta: { + type: 'problem', + docs: { + description: 'Enforce consistent awaiting of returned promises', + recommended: { + strict: ['error-handling-correctness-only'], + }, + requiresTypeChecking: true, + }, + fixable: 'code', + // eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- suggestions are exposed through a helper. + hasSuggestions: true, + messages: { + disallowedPromiseAwait: 'Returning an awaited promise is not allowed in this context.', + disallowedPromiseAwaitSuggestion: 'Remove `await` before the expression. Use caution as this may impact control flow.', + nonPromiseAwait: 'Returning an awaited value that is not a promise is not allowed.', + requiredPromiseAwait: 'Returning an awaited promise is required in this context.', + requiredPromiseAwaitSuggestion: 'Add `await` before the expression. Use caution as this may impact control flow.', + }, + schema: [ + { + type: 'string', + oneOf: [ + { + type: 'string', + description: 'Requires that all returned promises be awaited.', + enum: ['always'], + }, + { + type: 'string', + description: 'In error-handling contexts, the rule enforces that returned promises must be awaited. In ordinary contexts, the rule does not enforce any particular behavior around whether returned promises are awaited.', + enum: ['error-handling-correctness-only'], + }, + { + type: 'string', + description: 'In error-handling contexts, the rule enforces that returned promises must be awaited. In ordinary contexts, the rule enforces that returned promises _must not_ be awaited.', + enum: ['in-try-catch'], + }, + { + type: 'string', + description: 'Disallows awaiting any returned promises.', + enum: ['never'], + }, + ], + }, + ], + }, + defaultOptions: ['in-try-catch'], + create(context, [option]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const scopeInfoStack = []; + function enterFunction(node) { + scopeInfoStack.push({ + hasAsync: node.async, + owningFunc: node, + }); + } + function exitFunction() { + scopeInfoStack.pop(); + } + function affectsExplicitResourceManagement(node) { + // just need to determine if there is a `using` declaration in scope. + let scope = context.sourceCode.getScope(node); + const functionScope = scope.variableScope; + while (true) { + for (const variable of scope.variables) { + if (variable.defs.length !== 1) { + // This can't be the case for `using` or `await using` since it's + // an error to redeclare those more than once in the same scope, + // unlike, say, `var` declarations. + continue; + } + const declaration = variable.defs[0]; + const declaratorNode = declaration.node; + const declarationNode = declaratorNode.parent; + // if it's a using/await using declaration, and it comes _before_ the + // node we're checking, it affects control flow for that node. + if (['await using', 'using'].includes(declarationNode.kind) && + declaratorNode.range[1] < node.range[0]) { + return true; + } + } + if (scope === functionScope) { + // We've checked all the relevant scopes + break; + } + // This should always exist, since the rule should only be checking + // contexts in which `return` statements are legal, which should always + // be inside a function. + scope = (0, util_1.nullThrows)(scope.upper, 'Expected parent scope to exist. return-await should only operate on return statements within functions'); + } + return false; + } + /** + * Tests whether a node is inside of an explicit error handling context + * (try/catch/finally) in a way that throwing an exception will have an + * impact on the program's control flow. + */ + function affectsExplicitErrorHandling(node) { + // If an error-handling block is followed by another error-handling block, + // control flow is affected by whether promises in it are awaited or not. + // Otherwise, we need to check recursively for nested try statements until + // we get to the top level of a function or the program. If by then, + // there's no offending error-handling blocks, it doesn't affect control + // flow. + const tryAncestorResult = findContainingTryStatement(node); + if (tryAncestorResult == null) { + return false; + } + const { block, tryStatement } = tryAncestorResult; + switch (block) { + case 'catch': + // Exceptions thrown in catch blocks followed by a finally block affect + // control flow. + if (tryStatement.finallyBlock != null) { + return true; + } + // Otherwise recurse. + return affectsExplicitErrorHandling(tryStatement); + case 'finally': + return affectsExplicitErrorHandling(tryStatement); + case 'try': + // Try blocks are always followed by either a catch or finally, + // so exceptions thrown here always affect control flow. + return true; + default: { + const __never = block; + throw new Error(`Unexpected block type: ${String(__never)}`); + } + } + } + /** + * A try _statement_ is the whole thing that encompasses try block, + * catch clause, and finally block. This function finds the nearest + * enclosing try statement (if present) for a given node, and reports which + * part of the try statement the node is in. + */ + function findContainingTryStatement(node) { + let child = node; + let ancestor = node.parent; + while (ancestor && !ts.isFunctionLike(ancestor)) { + if (ts.isTryStatement(ancestor)) { + let block; + if (child === ancestor.tryBlock) { + block = 'try'; + } + else if (child === ancestor.catchClause) { + block = 'catch'; + } + else if (child === ancestor.finallyBlock) { + block = 'finally'; + } + return { + block: (0, util_1.nullThrows)(block, 'Child of a try statement must be a try block, catch clause, or finally block'), + tryStatement: ancestor, + }; + } + child = ancestor; + ancestor = ancestor.parent; + } + return undefined; + } + function removeAwait(fixer, node) { + // Should always be an await node; but let's be safe. + /* istanbul ignore if */ if (!(0, util_1.isAwaitExpression)(node)) { + return null; + } + const awaitToken = context.sourceCode.getFirstToken(node, util_1.isAwaitKeyword); + // Should always be the case; but let's be safe. + /* istanbul ignore if */ if (!awaitToken) { + return null; + } + const startAt = awaitToken.range[0]; + let endAt = awaitToken.range[1]; + // Also remove any extraneous whitespace after `await`, if there is any. + const nextToken = context.sourceCode.getTokenAfter(awaitToken, { + includeComments: true, + }); + if (nextToken) { + endAt = nextToken.range[0]; + } + return fixer.removeRange([startAt, endAt]); + } + function insertAwait(fixer, node, isHighPrecendence) { + if (isHighPrecendence) { + return fixer.insertTextBefore(node, 'await '); + } + return [ + fixer.insertTextBefore(node, 'await ('), + fixer.insertTextAfter(node, ')'), + ]; + } + function test(node, expression) { + let child; + const isAwait = ts.isAwaitExpression(expression); + if (isAwait) { + child = expression.getChildAt(1); + } + else { + child = expression; + } + const type = checker.getTypeAtLocation(child); + const certainty = (0, util_1.needsToBeAwaited)(checker, expression, type); + // handle awaited _non_thenables + if (certainty !== util_1.Awaitable.Always) { + if (isAwait) { + if (certainty === util_1.Awaitable.May) { + return; + } + context.report({ + node, + messageId: 'nonPromiseAwait', + fix: fixer => removeAwait(fixer, node), + }); + } + return; + } + // At this point it's definitely a thenable. + const affectsErrorHandling = affectsExplicitErrorHandling(expression) || + affectsExplicitResourceManagement(node); + const useAutoFix = !affectsErrorHandling; + const ruleConfiguration = getConfiguration(option); + const shouldAwaitInCurrentContext = affectsErrorHandling + ? ruleConfiguration.errorHandlingContext + : ruleConfiguration.ordinaryContext; + switch (shouldAwaitInCurrentContext) { + case 'await': + if (!isAwait) { + context.report({ + node, + messageId: 'requiredPromiseAwait', + ...(0, util_1.getFixOrSuggest)({ + fixOrSuggest: useAutoFix ? 'fix' : 'suggest', + suggestion: { + messageId: 'requiredPromiseAwaitSuggestion', + fix: fixer => insertAwait(fixer, node, (0, util_1.isHigherPrecedenceThanAwait)(expression)), + }, + }), + }); + } + break; + case "don't-care": + break; + case 'no-await': + if (isAwait) { + context.report({ + node, + messageId: 'disallowedPromiseAwait', + ...(0, util_1.getFixOrSuggest)({ + fixOrSuggest: useAutoFix ? 'fix' : 'suggest', + suggestion: { + messageId: 'disallowedPromiseAwaitSuggestion', + fix: fixer => removeAwait(fixer, node), + }, + }), + }); + } + break; + } + } + function findPossiblyReturnedNodes(node) { + if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) { + return [ + ...findPossiblyReturnedNodes(node.alternate), + ...findPossiblyReturnedNodes(node.consequent), + ]; + } + return [node]; + } + return { + ArrowFunctionExpression: enterFunction, + 'ArrowFunctionExpression:exit': exitFunction, + FunctionDeclaration: enterFunction, + 'FunctionDeclaration:exit': exitFunction, + FunctionExpression: enterFunction, + 'FunctionExpression:exit': exitFunction, + // executes after less specific handler, so exitFunction is called + 'ArrowFunctionExpression[async = true]:exit'(node) { + if (node.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + findPossiblyReturnedNodes(node.body).forEach(node => { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + test(node, tsNode); + }); + } + }, + ReturnStatement(node) { + const scopeInfo = scopeInfoStack.at(-1); + if (!scopeInfo?.hasAsync || !node.argument) { + return; + } + findPossiblyReturnedNodes(node.argument).forEach(node => { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + test(node, tsNode); + }); + }, + }; + }, +}); +function getConfiguration(option) { + switch (option) { + case 'always': + return { + errorHandlingContext: 'await', + ordinaryContext: 'await', + }; + case 'error-handling-correctness-only': + return { + errorHandlingContext: 'await', + ordinaryContext: "don't-care", + }; + case 'in-try-catch': + return { + errorHandlingContext: 'await', + ordinaryContext: 'no-await', + }; + case 'never': + return { + errorHandlingContext: 'no-await', + ordinaryContext: 'no-await', + }; + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.d.ts.map new file mode 100644 index 0000000..5e4df36 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sort-type-constituents.d.ts","sourceRoot":"","sources":["../../src/rules/sort-type-constituents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AA6GnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,gBAAgB,GAAG,YAAY,CAAC;;AAEvE,wBAiLG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js new file mode 100644 index 0000000..dfe753d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js @@ -0,0 +1,247 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +var Group; +(function (Group) { + Group["conditional"] = "conditional"; + Group["function"] = "function"; + Group["import"] = "import"; + Group["intersection"] = "intersection"; + Group["keyword"] = "keyword"; + Group["nullish"] = "nullish"; + Group["literal"] = "literal"; + Group["named"] = "named"; + Group["object"] = "object"; + Group["operator"] = "operator"; + Group["tuple"] = "tuple"; + Group["union"] = "union"; +})(Group || (Group = {})); +function getGroup(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSConditionalType: + return Group.conditional; + case utils_1.AST_NODE_TYPES.TSConstructorType: + case utils_1.AST_NODE_TYPES.TSFunctionType: + return Group.function; + case utils_1.AST_NODE_TYPES.TSImportType: + return Group.import; + case utils_1.AST_NODE_TYPES.TSIntersectionType: + return Group.intersection; + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + case utils_1.AST_NODE_TYPES.TSBigIntKeyword: + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + case utils_1.AST_NODE_TYPES.TSNeverKeyword: + case utils_1.AST_NODE_TYPES.TSNumberKeyword: + case utils_1.AST_NODE_TYPES.TSObjectKeyword: + case utils_1.AST_NODE_TYPES.TSStringKeyword: + case utils_1.AST_NODE_TYPES.TSSymbolKeyword: + case utils_1.AST_NODE_TYPES.TSThisType: + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + case utils_1.AST_NODE_TYPES.TSIntrinsicKeyword: + return Group.keyword; + case utils_1.AST_NODE_TYPES.TSNullKeyword: + case utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + case utils_1.AST_NODE_TYPES.TSVoidKeyword: + return Group.nullish; + case utils_1.AST_NODE_TYPES.TSLiteralType: + case utils_1.AST_NODE_TYPES.TSTemplateLiteralType: + return Group.literal; + case utils_1.AST_NODE_TYPES.TSArrayType: + case utils_1.AST_NODE_TYPES.TSIndexedAccessType: + case utils_1.AST_NODE_TYPES.TSInferType: + case utils_1.AST_NODE_TYPES.TSTypeReference: + case utils_1.AST_NODE_TYPES.TSQualifiedName: + return Group.named; + case utils_1.AST_NODE_TYPES.TSMappedType: + case utils_1.AST_NODE_TYPES.TSTypeLiteral: + return Group.object; + case utils_1.AST_NODE_TYPES.TSTypeOperator: + case utils_1.AST_NODE_TYPES.TSTypeQuery: + return Group.operator; + case utils_1.AST_NODE_TYPES.TSTupleType: + return Group.tuple; + case utils_1.AST_NODE_TYPES.TSUnionType: + return Group.union; + // These types should never occur as part of a union/intersection + case utils_1.AST_NODE_TYPES.TSAbstractKeyword: + case utils_1.AST_NODE_TYPES.TSAsyncKeyword: + case utils_1.AST_NODE_TYPES.TSDeclareKeyword: + case utils_1.AST_NODE_TYPES.TSExportKeyword: + case utils_1.AST_NODE_TYPES.TSNamedTupleMember: + case utils_1.AST_NODE_TYPES.TSOptionalType: + case utils_1.AST_NODE_TYPES.TSPrivateKeyword: + case utils_1.AST_NODE_TYPES.TSProtectedKeyword: + case utils_1.AST_NODE_TYPES.TSPublicKeyword: + case utils_1.AST_NODE_TYPES.TSReadonlyKeyword: + case utils_1.AST_NODE_TYPES.TSRestType: + case utils_1.AST_NODE_TYPES.TSStaticKeyword: + case utils_1.AST_NODE_TYPES.TSTypePredicate: + /* istanbul ignore next */ + throw new Error(`Unexpected Type ${node.type}`); + } +} +function caseSensitiveSort(a, b) { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; +} +exports.default = (0, util_1.createRule)({ + name: 'sort-type-constituents', + meta: { + type: 'suggestion', + deprecated: true, + docs: { + description: 'Enforce constituents of a type union/intersection to be sorted alphabetically', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + notSorted: '{{type}} type constituents must be sorted.', + notSortedNamed: '{{type}} type {{name}} constituents must be sorted.', + suggestFix: 'Sort constituents of type (removes all comments).', + }, + replacedBy: [ + 'perfectionist/sort-intersection-types', + 'perfectionist/sort-union-types', + ], + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + caseSensitive: { + type: 'boolean', + description: 'Whether to sort using case sensitive string comparisons.', + }, + checkIntersections: { + type: 'boolean', + description: 'Whether to check intersection types (`&`).', + }, + checkUnions: { + type: 'boolean', + description: 'Whether to check union types (`|`).', + }, + groupOrder: { + type: 'array', + description: 'Ordering of the groups.', + items: { + type: 'string', + enum: (0, util_1.getEnumNames)(Group), + }, + }, + }, + }, + ], + }, + defaultOptions: [ + { + caseSensitive: false, + checkIntersections: true, + checkUnions: true, + groupOrder: [ + Group.named, + Group.keyword, + Group.operator, + Group.literal, + Group.function, + Group.import, + Group.conditional, + Group.object, + Group.tuple, + Group.intersection, + Group.union, + Group.nullish, + ], + }, + ], + create(context, [{ caseSensitive, checkIntersections, checkUnions, groupOrder }]) { + const collator = new Intl.Collator('en', { + numeric: true, + sensitivity: 'base', + }); + function checkSorting(node) { + const sourceOrder = node.types.map(type => { + const group = groupOrder?.indexOf(getGroup(type)) ?? -1; + return { + node: type, + group: group === -1 ? Number.MAX_SAFE_INTEGER : group, + text: context.sourceCode.getText(type), + }; + }); + const expectedOrder = [...sourceOrder].sort((a, b) => { + if (a.group !== b.group) { + return a.group - b.group; + } + if (caseSensitive) { + return caseSensitiveSort(a.text, b.text); + } + return (collator.compare(a.text, b.text) || + (a.text < b.text ? -1 : a.text > b.text ? 1 : 0)); + }); + const hasComments = node.types.some(type => { + const count = context.sourceCode.getCommentsBefore(type).length + + context.sourceCode.getCommentsAfter(type).length; + return count > 0; + }); + for (let i = 0; i < expectedOrder.length; i += 1) { + if (expectedOrder[i].node !== sourceOrder[i].node) { + let messageId = 'notSorted'; + const data = { + name: '', + type: node.type === utils_1.AST_NODE_TYPES.TSIntersectionType + ? 'Intersection' + : 'Union', + }; + if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) { + messageId = 'notSortedNamed'; + data.name = node.parent.id.name; + } + const fix = fixer => { + const sorted = expectedOrder + .map(t => (0, util_1.typeNodeRequiresParentheses)(t.node, t.text) || + (node.type === utils_1.AST_NODE_TYPES.TSIntersectionType && + t.node.type === utils_1.AST_NODE_TYPES.TSUnionType) + ? `(${t.text})` + : t.text) + .join(node.type === utils_1.AST_NODE_TYPES.TSIntersectionType ? ' & ' : ' | '); + return fixer.replaceText(node, sorted); + }; + return context.report({ + node, + messageId, + data, + // don't autofix if any of the types have leading/trailing comments + // the logic for preserving them correctly is a pain - we may implement this later + ...(hasComments + ? { + suggest: [ + { + messageId: 'suggestFix', + fix, + }, + ], + } + : { fix }), + }); + } + } + } + return { + ...(checkIntersections && { + TSIntersectionType(node) { + checkSorting(node); + }, + }), + ...(checkUnions && { + TSUnionType(node) { + checkSorting(node); + }, + }), + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.d.ts.map new file mode 100644 index 0000000..50fb373 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strict-boolean-expressions.d.ts","sourceRoot":"","sources":["../../src/rules/strict-boolean-expressions.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,sDAAsD,CAAC,EAAE,OAAO,CAAC;QACjE,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB;CACF,CAAC;AAEF,KAAK,uBAAuB,GACxB,mBAAmB,GACnB,+BAA+B,GAC/B,4BAA4B,GAC5B,8BAA8B,GAC9B,8BAA8B,GAC9B,8BAA8B,GAC9B,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,SAAS,GACjB,yBAAyB,GACzB,uCAAuC,GACvC,oCAAoC,GACpC,gCAAgC,GAChC,0BAA0B,GAC1B,wBAAwB,GACxB,4BAA4B,GAC5B,iCAAiC,GACjC,yBAAyB,GACzB,yBAAyB,GACzB,gCAAgC,GAChC,0BAA0B,GAC1B,yBAAyB,GACzB,2BAA2B,GAC3B,mBAAmB,GACnB,wBAAwB,GACxB,uBAAuB,CAAC;;AAE5B,wBAm/BG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js new file mode 100644 index 0000000..89860be --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js @@ -0,0 +1,882 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const assertionFunctionUtils_1 = require("../util/assertionFunctionUtils"); +exports.default = (0, util_1.createRule)({ + name: 'strict-boolean-expressions', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow certain types in boolean expressions', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + conditionErrorAny: 'Unexpected any value in {{context}}. ' + + 'An explicit comparison or type conversion is required.', + conditionErrorNullableBoolean: 'Unexpected nullable boolean value in {{context}}. ' + + 'Please handle the nullish case explicitly.', + conditionErrorNullableEnum: 'Unexpected nullable enum value in {{context}}. ' + + 'Please handle the nullish/zero/NaN cases explicitly.', + conditionErrorNullableNumber: 'Unexpected nullable number value in {{context}}. ' + + 'Please handle the nullish/zero/NaN cases explicitly.', + conditionErrorNullableObject: 'Unexpected nullable object value in {{context}}. ' + + 'An explicit null check is required.', + conditionErrorNullableString: 'Unexpected nullable string value in {{context}}. ' + + 'Please handle the nullish/empty cases explicitly.', + conditionErrorNullish: 'Unexpected nullish value in conditional. ' + + 'The condition is always false.', + conditionErrorNumber: 'Unexpected number value in {{context}}. ' + + 'An explicit zero/NaN check is required.', + conditionErrorObject: 'Unexpected object value in {{context}}. ' + + 'The condition is always true.', + conditionErrorOther: 'Unexpected value in conditional. ' + + 'A boolean expression is required.', + conditionErrorString: 'Unexpected string value in {{context}}. ' + + 'An explicit empty string check is required.', + conditionFixCastBoolean: 'Explicitly convert value to a boolean (`Boolean(value)`)', + conditionFixCompareArrayLengthNonzero: "Change condition to check array's length (`value.length > 0`)", + conditionFixCompareArrayLengthZero: "Change condition to check array's length (`value.length === 0`)", + conditionFixCompareEmptyString: 'Change condition to check for empty string (`value !== ""`)', + conditionFixCompareFalse: 'Change condition to check if false (`value === false`)', + conditionFixCompareNaN: 'Change condition to check for NaN (`!Number.isNaN(value)`)', + conditionFixCompareNullish: 'Change condition to check for null/undefined (`value != null`)', + conditionFixCompareStringLength: "Change condition to check string's length (`value.length !== 0`)", + conditionFixCompareTrue: 'Change condition to check if true (`value === true`)', + conditionFixCompareZero: 'Change condition to check for 0 (`value !== 0`)', + conditionFixDefaultEmptyString: 'Explicitly treat nullish value the same as an empty string (`value ?? ""`)', + conditionFixDefaultFalse: 'Explicitly treat nullish value the same as false (`value ?? false`)', + conditionFixDefaultZero: 'Explicitly treat nullish value the same as 0 (`value ?? 0`)', + explicitBooleanReturnType: 'Add an explicit `boolean` return type annotation.', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + predicateCannotBeAsync: "Predicate function should not be 'async'; expected a boolean return type.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowAny: { + type: 'boolean', + description: 'Whether to allow `any`s in a boolean context.', + }, + allowNullableBoolean: { + type: 'boolean', + description: 'Whether to allow nullable `boolean`s in a boolean context.', + }, + allowNullableEnum: { + type: 'boolean', + description: 'Whether to allow nullable `enum`s in a boolean context.', + }, + allowNullableNumber: { + type: 'boolean', + description: 'Whether to allow nullable `number`s in a boolean context.', + }, + allowNullableObject: { + type: 'boolean', + description: 'Whether to allow nullable `object`s, `symbol`s, and functions in a boolean context.', + }, + allowNullableString: { + type: 'boolean', + description: 'Whether to allow nullable `string`s in a boolean context.', + }, + allowNumber: { + type: 'boolean', + description: 'Whether to allow `number`s in a boolean context.', + }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.', + }, + allowString: { + type: 'boolean', + description: 'Whether to allow `string`s in a boolean context.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowAny: false, + allowNullableBoolean: false, + allowNullableEnum: false, + allowNullableNumber: false, + allowNullableObject: true, + allowNullableString: false, + allowNumber: true, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + allowString: true, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + options.allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + const traversedNodes = new Set(); + return { + CallExpression: traverseCallExpression, + ConditionalExpression: traverseTestExpression, + DoWhileStatement: traverseTestExpression, + ForStatement: traverseTestExpression, + IfStatement: traverseTestExpression, + 'LogicalExpression[operator!="??"]': traverseLogicalExpression, + 'UnaryExpression[operator="!"]': traverseUnaryLogicalExpression, + WhileStatement: traverseTestExpression, + }; + /** + * Inspects condition of a test expression. (`if`, `while`, `for`, etc.) + */ + function traverseTestExpression(node) { + if (node.test == null) { + return; + } + traverseNode(node.test, true); + } + /** + * Inspects the argument of a unary logical expression (`!`). + */ + function traverseUnaryLogicalExpression(node) { + traverseNode(node.argument, true); + } + /** + * Inspects the arguments of a logical expression (`&&`, `||`). + * + * If the logical expression is a descendant of a test expression, + * the `isCondition` flag should be set to true. + * Otherwise, if the logical expression is there on it's own, + * it's used for control flow and is not a condition itself. + */ + function traverseLogicalExpression(node, isCondition = false) { + // left argument is always treated as a condition + traverseNode(node.left, true); + // if the logical expression is used for control flow, + // then its right argument is used for its side effects only + traverseNode(node.right, isCondition); + } + function traverseCallExpression(node) { + const assertedArgument = (0, assertionFunctionUtils_1.findTruthinessAssertedArgument)(services, node); + if (assertedArgument != null) { + traverseNode(assertedArgument, true); + } + if ((0, util_1.isArrayMethodCallWithPredicate)(context, services, node)) { + const predicate = node.arguments.at(0); + if (predicate) { + checkArrayMethodCallPredicate(predicate); + } + } + } + /** + * Dedicated function to check array method predicate calls. Reports predicate + * arguments that don't return a boolean value. + */ + function checkArrayMethodCallPredicate(predicateNode) { + const isFunctionExpression = utils_1.ASTUtils.isFunction(predicateNode); + // custom message for accidental `async` function expressions + if (isFunctionExpression && predicateNode.async) { + return context.report({ + node: predicateNode, + messageId: 'predicateCannotBeAsync', + }); + } + const returnTypes = services + .getTypeAtLocation(predicateNode) + .getCallSignatures() + .map(signature => { + const type = signature.getReturnType(); + if (tsutils.isTypeParameter(type)) { + return checker.getBaseConstraintOfType(type) ?? type; + } + return type; + }); + const flattenTypes = [ + ...new Set(returnTypes.flatMap(type => tsutils.unionTypeParts(type))), + ]; + const types = inspectVariantTypes(flattenTypes); + const reportType = determineReportType(types); + if (reportType == null) { + return; + } + const suggestions = []; + if (isFunctionExpression && + predicateNode.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + suggestions.push(...getSuggestionsForConditionError(predicateNode.body, reportType)); + } + if (isFunctionExpression && !predicateNode.returnType) { + suggestions.push({ + messageId: 'explicitBooleanReturnType', + fix: fixer => { + if (predicateNode.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + (0, util_1.isParenlessArrowFunction)(predicateNode, context.sourceCode)) { + return [ + fixer.insertTextBefore(predicateNode.params[0], '('), + fixer.insertTextAfter(predicateNode.params[0], '): boolean'), + ]; + } + if (predicateNode.params.length === 0) { + const closingBracket = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(predicateNode, token => token.value === ')'), 'function expression has to have a closing parenthesis.'); + return fixer.insertTextAfter(closingBracket, ': boolean'); + } + const lastClosingParenthesis = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(predicateNode.params[predicateNode.params.length - 1], token => token.value === ')'), 'function expression has to have a closing parenthesis.'); + return fixer.insertTextAfter(lastClosingParenthesis, ': boolean'); + }, + }); + } + return context.report({ + node: predicateNode, + messageId: reportType, + data: { + context: 'array predicate return type', + }, + suggest: suggestions, + }); + } + /** + * Inspects any node. + * + * If it's a logical expression then it recursively traverses its arguments. + * If it's any other kind of node then it's type is finally checked against the rule, + * unless `isCondition` flag is set to false, in which case + * it's assumed to be used for side effects only and is skipped. + */ + function traverseNode(node, isCondition) { + // prevent checking the same node multiple times + if (traversedNodes.has(node)) { + return; + } + traversedNodes.add(node); + // for logical operator, we check its operands + if (node.type === utils_1.AST_NODE_TYPES.LogicalExpression && + node.operator !== '??') { + traverseLogicalExpression(node, isCondition); + return; + } + // skip if node is not a condition + if (!isCondition) { + return; + } + checkNode(node); + } + function determineReportType(types) { + const is = (...wantedTypes) => types.size === wantedTypes.length && + wantedTypes.every(type => types.has(type)); + // boolean + if (is('boolean') || is('truthy boolean')) { + // boolean is always ok + return undefined; + } + // never + if (is('never')) { + // never is always okay + return undefined; + } + // nullish + if (is('nullish')) { + // condition is always false + return 'conditionErrorNullish'; + } + // Known edge case: boolean `true` and nullish values are always valid boolean expressions + if (is('nullish', 'truthy boolean')) { + return; + } + // nullable boolean + if (is('nullish', 'boolean')) { + return !options.allowNullableBoolean + ? 'conditionErrorNullableBoolean' + : undefined; + } + // Known edge case: truthy primitives and nullish values are always valid boolean expressions + if ((options.allowNumber && is('nullish', 'truthy number')) || + (options.allowString && is('nullish', 'truthy string'))) { + return; + } + // string + if (is('string') || is('truthy string')) { + return !options.allowString ? 'conditionErrorString' : undefined; + } + // nullable string + if (is('nullish', 'string')) { + return !options.allowNullableString + ? 'conditionErrorNullableString' + : undefined; + } + // number + if (is('number') || is('truthy number')) { + return !options.allowNumber ? 'conditionErrorNumber' : undefined; + } + // nullable number + if (is('nullish', 'number')) { + return !options.allowNullableNumber + ? 'conditionErrorNullableNumber' + : undefined; + } + // object + if (is('object')) { + return 'conditionErrorObject'; + } + // nullable object + if (is('nullish', 'object')) { + return !options.allowNullableObject + ? 'conditionErrorNullableObject' + : undefined; + } + // nullable enum + if (is('nullish', 'number', 'enum') || + is('nullish', 'string', 'enum') || + is('nullish', 'truthy number', 'enum') || + is('nullish', 'truthy string', 'enum') || + // mixed enums + is('nullish', 'truthy number', 'truthy string', 'enum') || + is('nullish', 'truthy number', 'string', 'enum') || + is('nullish', 'truthy string', 'number', 'enum') || + is('nullish', 'number', 'string', 'enum')) { + return !options.allowNullableEnum + ? 'conditionErrorNullableEnum' + : undefined; + } + // any + if (is('any')) { + return !options.allowAny ? 'conditionErrorAny' : undefined; + } + return 'conditionErrorOther'; + } + function getSuggestionsForConditionError(node, conditionError) { + switch (conditionError) { + case 'conditionErrorAny': + return [ + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorNullableBoolean': + if (isLogicalNegationExpression(node.parent)) { + // if (!nullableBoolean) + return [ + { + messageId: 'conditionFixDefaultFalse', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? false`, + }), + }, + { + messageId: 'conditionFixCompareFalse', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} === false`, + }), + }, + ]; + } + // if (nullableBoolean) + return [ + { + messageId: 'conditionFixDefaultFalse', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? false`, + }), + }, + { + messageId: 'conditionFixCompareTrue', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} === true`, + }), + }, + ]; + case 'conditionErrorNullableEnum': + if (isLogicalNegationExpression(node.parent)) { + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + ]; + } + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + ]; + case 'conditionErrorNullableNumber': + if (isLogicalNegationExpression(node.parent)) { + // if (!nullableNumber) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + { + messageId: 'conditionFixDefaultZero', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? 0`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `!Boolean(${code})`, + }), + }, + ]; + } + // if (nullableNumber) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + { + messageId: 'conditionFixDefaultZero', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? 0`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorNullableObject': + if (isLogicalNegationExpression(node.parent)) { + // if (!nullableObject) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + ]; + } + // if (nullableObject) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + ]; + case 'conditionErrorNullableString': + if (isLogicalNegationExpression(node.parent)) { + // if (!nullableString) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + { + messageId: 'conditionFixDefaultEmptyString', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? ""`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `!Boolean(${code})`, + }), + }, + ]; + } + // if (nullableString) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + { + messageId: 'conditionFixDefaultEmptyString', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? ""`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorNumber': + if (isArrayLengthExpression(node, checker, services)) { + if (isLogicalNegationExpression(node.parent)) { + // if (!array.length) + return [ + { + messageId: 'conditionFixCompareArrayLengthZero', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} === 0`, + }), + }, + ]; + } + // if (array.length) + return [ + { + messageId: 'conditionFixCompareArrayLengthNonzero', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} > 0`, + }), + }, + ]; + } + if (isLogicalNegationExpression(node.parent)) { + // if (!number) + return [ + { + messageId: 'conditionFixCompareZero', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + // TODO: we have to compare to 0n if the type is bigint + wrap: code => `${code} === 0`, + }), + }, + { + // TODO: don't suggest this for bigint because it can't be NaN + messageId: 'conditionFixCompareNaN', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `Number.isNaN(${code})`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `!Boolean(${code})`, + }), + }, + ]; + } + // if (number) + return [ + { + messageId: 'conditionFixCompareZero', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} !== 0`, + }), + }, + { + messageId: 'conditionFixCompareNaN', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `!Number.isNaN(${code})`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorString': + if (isLogicalNegationExpression(node.parent)) { + // if (!string) + return [ + { + messageId: 'conditionFixCompareStringLength', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code}.length === 0`, + }), + }, + { + messageId: 'conditionFixCompareEmptyString', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} === ""`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `!Boolean(${code})`, + }), + }, + ]; + } + // if (string) + return [ + { + messageId: 'conditionFixCompareStringLength', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code}.length > 0`, + }), + }, + { + messageId: 'conditionFixCompareEmptyString', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} !== ""`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorObject': + case 'conditionErrorNullish': + case 'conditionErrorOther': + return []; + default: + conditionError; + throw new Error('Unreachable'); + } + } + /** + * This function does the actual type check on a node. + * It analyzes the type of a node and checks if it is allowed in a boolean context. + */ + function checkNode(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + const types = inspectVariantTypes(tsutils.unionTypeParts(type)); + const reportType = determineReportType(types); + if (reportType != null) { + context.report({ + node, + messageId: reportType, + data: { + context: 'conditional', + }, + suggest: getSuggestionsForConditionError(node, reportType), + }); + } + } + /** + * Check union variants for the types we care about + */ + function inspectVariantTypes(types) { + const variantTypes = new Set(); + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike))) { + variantTypes.add('nullish'); + } + const booleans = types.filter(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.BooleanLike)); + // If incoming type is either "true" or "false", there will be one type + // object with intrinsicName set accordingly + // If incoming type is boolean, there will be two type objects with + // intrinsicName set "true" and "false" each because of ts-api-utils.unionTypeParts() + if (booleans.length === 1) { + variantTypes.add(tsutils.isTrueLiteralType(booleans[0]) ? 'truthy boolean' : 'boolean'); + } + else if (booleans.length === 2) { + variantTypes.add('boolean'); + } + const strings = types.filter(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.StringLike)); + if (strings.length) { + if (strings.every(type => type.isStringLiteral() && type.value !== '')) { + variantTypes.add('truthy string'); + } + else { + variantTypes.add('string'); + } + } + const numbers = types.filter(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike)); + if (numbers.length) { + if (numbers.every(type => type.isNumberLiteral() && type.value !== 0)) { + variantTypes.add('truthy number'); + } + else { + variantTypes.add('number'); + } + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.EnumLike))) { + variantTypes.add('enum'); + } + if (types.some(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | + ts.TypeFlags.Undefined | + ts.TypeFlags.VoidLike | + ts.TypeFlags.BooleanLike | + ts.TypeFlags.StringLike | + ts.TypeFlags.NumberLike | + ts.TypeFlags.BigIntLike | + ts.TypeFlags.TypeParameter | + ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.Never))) { + variantTypes.add(types.some(isBrandedBoolean) ? 'boolean' : 'object'); + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.TypeParameter | + ts.TypeFlags.Any | + ts.TypeFlags.Unknown))) { + variantTypes.add('any'); + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.Never))) { + variantTypes.add('never'); + } + return variantTypes; + } + }, +}); +function isLogicalNegationExpression(node) { + return node.type === utils_1.AST_NODE_TYPES.UnaryExpression && node.operator === '!'; +} +function isArrayLengthExpression(node, typeChecker, services) { + if (node.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return false; + } + if (node.computed) { + return false; + } + if (node.property.name !== 'length') { + return false; + } + const objectType = (0, util_1.getConstrainedTypeAtLocation)(services, node.object); + return (0, util_1.isTypeArrayTypeOrUnionOfArrayTypes)(objectType, typeChecker); +} +/** + * Verify is the type is a branded boolean (e.g. `type Foo = boolean & { __brand: 'Foo' }`) + * + * @param type The type checked + */ +function isBrandedBoolean(type) { + return (type.isIntersection() && + type.types.some(childType => isBooleanType(childType))); +} +function isBooleanType(expressionType) { + return tsutils.isTypeFlagSet(expressionType, ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.d.ts.map new file mode 100644 index 0000000..e0ce6f1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"switch-exhaustiveness-check.d.ts","sourceRoot":"","sources":["../../src/rules/switch-exhaustiveness-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAyBnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE;;;;;WAKG;QACH,mCAAmC,CAAC,EAAE,OAAO,CAAC;QAE9C;;;;WAIG;QACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;QAEpC;;WAEG;QACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;QAEnC;;;;WAIG;QACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;KAC9C;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,sBAAsB,GACtB,uBAAuB,CAAC;;AAE5B,wBA+VG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js new file mode 100644 index 0000000..dc28e8a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js @@ -0,0 +1,291 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const DEFAULT_COMMENT_PATTERN = /^no default$/iu; +exports.default = (0, util_1.createRule)({ + name: 'switch-exhaustiveness-check', + meta: { + type: 'suggestion', + docs: { + description: 'Require switch-case statements to be exhaustive', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + addMissingCases: 'Add branches for missing cases.', + dangerousDefaultCase: 'The switch statement is exhaustive, so the default case is unnecessary.', + switchIsNotExhaustive: 'Switch is not exhaustive. Cases not matched: {{missingBranches}}', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowDefaultCaseForExhaustiveSwitch: { + type: 'boolean', + description: `If 'true', allow 'default' cases on switch statements with exhaustive cases.`, + }, + considerDefaultExhaustiveForUnions: { + type: 'boolean', + description: `If 'true', the 'default' clause is used to determine whether the switch statement is exhaustive for union type`, + }, + defaultCaseCommentPattern: { + type: 'string', + description: `Regular expression for a comment that can indicate an intentionally omitted default case.`, + }, + requireDefaultForNonUnion: { + type: 'boolean', + description: `If 'true', require a 'default' clause for switches on non-union types.`, + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowDefaultCaseForExhaustiveSwitch: true, + considerDefaultExhaustiveForUnions: false, + requireDefaultForNonUnion: false, + }, + ], + create(context, [{ allowDefaultCaseForExhaustiveSwitch, considerDefaultExhaustiveForUnions, defaultCaseCommentPattern, requireDefaultForNonUnion, },]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const commentRegExp = defaultCaseCommentPattern != null + ? new RegExp(defaultCaseCommentPattern, 'u') + : DEFAULT_COMMENT_PATTERN; + function getCommentDefaultCase(node) { + const lastCase = node.cases.at(-1); + const commentsAfterLastCase = lastCase + ? context.sourceCode.getCommentsAfter(lastCase) + : []; + const defaultCaseComment = commentsAfterLastCase.at(-1); + if (commentRegExp.test(defaultCaseComment?.value.trim() || '')) { + return defaultCaseComment; + } + return; + } + function typeToString(type) { + return checker.typeToString(type, undefined, ts.TypeFormatFlags.AllowUniqueESSymbolType | + ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope | + ts.TypeFormatFlags.UseFullyQualifiedType); + } + function getSwitchMetadata(node) { + const defaultCase = node.cases.find(switchCase => switchCase.test == null); + const discriminantType = (0, util_1.getConstrainedTypeAtLocation)(services, node.discriminant); + const symbolName = discriminantType.getSymbol()?.escapedName; + const containsNonLiteralType = doesTypeContainNonLiteralType(discriminantType); + const caseTypes = new Set(); + for (const switchCase of node.cases) { + // If the `test` property of the switch case is `null`, then we are on a + // `default` case. + if (switchCase.test == null) { + continue; + } + const caseType = (0, util_1.getConstrainedTypeAtLocation)(services, switchCase.test); + caseTypes.add(caseType); + } + const missingLiteralBranchTypes = []; + for (const unionPart of tsutils.unionTypeParts(discriminantType)) { + for (const intersectionPart of tsutils.intersectionTypeParts(unionPart)) { + if (caseTypes.has(intersectionPart) || + !isTypeLiteralLikeType(intersectionPart)) { + continue; + } + // "missing", "optional" and "undefined" types are different runtime objects, + // but all of them have TypeFlags.Undefined type flag + if ([...caseTypes].some(tsutils.isIntrinsicUndefinedType) && + tsutils.isIntrinsicUndefinedType(intersectionPart)) { + continue; + } + missingLiteralBranchTypes.push(intersectionPart); + } + } + return { + containsNonLiteralType, + defaultCase: defaultCase ?? getCommentDefaultCase(node), + missingLiteralBranchTypes, + symbolName, + }; + } + function checkSwitchExhaustive(node, switchMetadata) { + const { defaultCase, missingLiteralBranchTypes, symbolName } = switchMetadata; + // If considerDefaultExhaustiveForUnions is enabled, the presence of a default case + // always makes the switch exhaustive. + if (considerDefaultExhaustiveForUnions && defaultCase != null) { + return; + } + if (missingLiteralBranchTypes.length > 0) { + context.report({ + node: node.discriminant, + messageId: 'switchIsNotExhaustive', + data: { + missingBranches: missingLiteralBranchTypes + .map(missingType => tsutils.isTypeFlagSet(missingType, ts.TypeFlags.ESSymbolLike) + ? `typeof ${missingType.getSymbol()?.escapedName}` + : typeToString(missingType)) + .join(' | '), + }, + suggest: [ + { + messageId: 'addMissingCases', + fix(fixer) { + return fixSwitch(fixer, node, missingLiteralBranchTypes, defaultCase, symbolName?.toString()); + }, + }, + ], + }); + } + } + function fixSwitch(fixer, node, missingBranchTypes, // null means default branch + defaultCase, symbolName) { + const lastCase = node.cases.length > 0 ? node.cases[node.cases.length - 1] : null; + const caseIndent = lastCase + ? ' '.repeat(lastCase.loc.start.column) + : // If there are no cases, use indentation of the switch statement and + // leave it to the user to format it correctly. + ' '.repeat(node.loc.start.column); + const missingCases = []; + for (const missingBranchType of missingBranchTypes) { + if (missingBranchType == null) { + missingCases.push(`default: { throw new Error('default case') }`); + continue; + } + const missingBranchName = missingBranchType.getSymbol()?.escapedName; + let caseTest = tsutils.isTypeFlagSet(missingBranchType, ts.TypeFlags.ESSymbolLike) + ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + missingBranchName + : typeToString(missingBranchType); + if (symbolName && + (missingBranchName || missingBranchName === '') && + (0, util_1.requiresQuoting)(missingBranchName.toString(), compilerOptions.target)) { + const escapedBranchName = missingBranchName + .replaceAll("'", "\\'") + .replaceAll('\n', '\\n') + .replaceAll('\r', '\\r'); + caseTest = `${symbolName}['${escapedBranchName}']`; + } + missingCases.push(`case ${caseTest}: { throw new Error('Not implemented yet: ${caseTest + .replaceAll('\\', '\\\\') + .replaceAll("'", "\\'")} case') }`); + } + const fixString = missingCases + .map(code => `${caseIndent}${code}`) + .join('\n'); + if (lastCase) { + if (defaultCase) { + const beforeFixString = missingCases + .map(code => `${code}\n${caseIndent}`) + .join(''); + return fixer.insertTextBefore(defaultCase, beforeFixString); + } + return fixer.insertTextAfter(lastCase, `\n${fixString}`); + } + // There were no existing cases. + const openingBrace = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.discriminant, util_1.isOpeningBraceToken), util_1.NullThrowsReasons.MissingToken('{', 'discriminant')); + const closingBrace = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.discriminant, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', 'discriminant')); + return fixer.replaceTextRange([openingBrace.range[0], closingBrace.range[1]], ['{', fixString, `${caseIndent}}`].join('\n')); + } + function checkSwitchUnnecessaryDefaultCase(switchMetadata) { + if (allowDefaultCaseForExhaustiveSwitch) { + return; + } + const { containsNonLiteralType, defaultCase, missingLiteralBranchTypes } = switchMetadata; + if (missingLiteralBranchTypes.length === 0 && + defaultCase != null && + !containsNonLiteralType) { + context.report({ + node: defaultCase, + messageId: 'dangerousDefaultCase', + }); + } + } + function checkSwitchNoUnionDefaultCase(node, switchMetadata) { + if (!requireDefaultForNonUnion) { + return; + } + const { containsNonLiteralType, defaultCase } = switchMetadata; + if (containsNonLiteralType && defaultCase == null) { + context.report({ + node: node.discriminant, + messageId: 'switchIsNotExhaustive', + data: { missingBranches: 'default' }, + suggest: [ + { + messageId: 'addMissingCases', + fix(fixer) { + return fixSwitch(fixer, node, [null], defaultCase); + }, + }, + ], + }); + } + } + return { + SwitchStatement(node) { + const switchMetadata = getSwitchMetadata(node); + checkSwitchExhaustive(node, switchMetadata); + checkSwitchUnnecessaryDefaultCase(switchMetadata); + checkSwitchNoUnionDefaultCase(node, switchMetadata); + }, + }; + }, +}); +function isTypeLiteralLikeType(type) { + return tsutils.isTypeFlagSet(type, ts.TypeFlags.Literal | + ts.TypeFlags.Undefined | + ts.TypeFlags.Null | + ts.TypeFlags.UniqueESSymbol); +} +/** + * For example: + * + * - `"foo" | "bar"` is a type with all literal types. + * - `"foo" | number` is a type that contains non-literal types. + * - `"foo" & { bar: 1 }` is a type that contains non-literal types. + * + * Default cases are never superfluous in switches with non-literal types. + */ +function doesTypeContainNonLiteralType(type) { + return tsutils + .unionTypeParts(type) + .some(type => tsutils + .intersectionTypeParts(type) + .every(subType => !isTypeLiteralLikeType(subType))); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.d.ts.map new file mode 100644 index 0000000..29be62d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"triple-slash-reference.d.ts","sourceRoot":"","sources":["../../src/rules/triple-slash-reference.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,GAAG,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;QACzB,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;QAC1B,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,eAAe,CAAC;KAC9C;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,sBAAsB,CAAC;;AAEhD,wBA0HG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js new file mode 100644 index 0000000..edc8d3f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js @@ -0,0 +1,110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'triple-slash-reference', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow certain triple slash directives in favor of ES6-style import declarations', + recommended: 'recommended', + }, + messages: { + tripleSlashReference: 'Do not use a triple slash reference for {{module}}, use `import` style instead.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + lib: { + type: 'string', + description: 'What to enforce for `/// ` references.', + enum: ['always', 'never'], + }, + path: { + type: 'string', + description: 'What to enforce for `/// ` references.', + enum: ['always', 'never'], + }, + types: { + type: 'string', + description: 'What to enforce for `/// ` references.', + enum: ['always', 'never', 'prefer-import'], + }, + }, + }, + ], + }, + defaultOptions: [ + { + lib: 'always', + path: 'never', + types: 'prefer-import', + }, + ], + create(context, [{ lib, path, types }]) { + let programNode; + const references = []; + function hasMatchingReference(source) { + references.forEach(reference => { + if (reference.importName === source.value) { + context.report({ + node: reference.comment, + messageId: 'tripleSlashReference', + data: { + module: reference.importName, + }, + }); + } + }); + } + return { + ImportDeclaration(node) { + if (programNode) { + hasMatchingReference(node.source); + } + }, + Program(node) { + if (lib === 'always' && path === 'always' && types === 'always') { + return; + } + programNode = node; + const referenceRegExp = /^\/\s* { + if (comment.type !== utils_1.AST_TOKEN_TYPES.Line) { + return; + } + const referenceResult = referenceRegExp.exec(comment.value); + if (referenceResult) { + if ((referenceResult[1] === 'types' && types === 'never') || + (referenceResult[1] === 'path' && path === 'never') || + (referenceResult[1] === 'lib' && lib === 'never')) { + context.report({ + node: comment, + messageId: 'tripleSlashReference', + data: { + module: referenceResult[2], + }, + }); + return; + } + if (referenceResult[1] === 'types' && types === 'prefer-import') { + references.push({ comment, importName: referenceResult[2] }); + } + } + }); + }, + TSImportEqualsDeclaration(node) { + if (programNode) { + const reference = node.moduleReference; + if (reference.type === utils_1.AST_NODE_TYPES.TSExternalModuleReference) { + hasMatchingReference(reference.expression); + } + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.d.ts.map new file mode 100644 index 0000000..a98c444 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"typedef.d.ts","sourceRoot":"","sources":["../../src/rules/typedef.ts"],"names":[],"mappings":"AAMA,0BAAkB,UAAU;IAC1B,kBAAkB,uBAAuB;IACzC,cAAc,mBAAmB;IACjC,yBAAyB,8BAA8B;IACvD,mBAAmB,wBAAwB;IAC3C,SAAS,cAAc;IACvB,mBAAmB,wBAAwB;IAC3C,mBAAmB,wBAAwB;IAC3C,iCAAiC,sCAAsC;CACxE;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,sBAAsB,CAAC;;AAEpE,wBAiSG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js new file mode 100644 index 0000000..a3129c5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js @@ -0,0 +1,235 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OptionKeys = void 0; +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +var OptionKeys; +(function (OptionKeys) { + OptionKeys["ArrayDestructuring"] = "arrayDestructuring"; + OptionKeys["ArrowParameter"] = "arrowParameter"; + OptionKeys["MemberVariableDeclaration"] = "memberVariableDeclaration"; + OptionKeys["ObjectDestructuring"] = "objectDestructuring"; + OptionKeys["Parameter"] = "parameter"; + OptionKeys["PropertyDeclaration"] = "propertyDeclaration"; + OptionKeys["VariableDeclaration"] = "variableDeclaration"; + OptionKeys["VariableDeclarationIgnoreFunction"] = "variableDeclarationIgnoreFunction"; +})(OptionKeys || (exports.OptionKeys = OptionKeys = {})); +exports.default = (0, util_1.createRule)({ + name: 'typedef', + meta: { + type: 'suggestion', + docs: { + description: 'Require type annotations in certain places', + }, + messages: { + expectedTypedef: 'Expected a type annotation.', + expectedTypedefNamed: 'Expected {{name}} to have a type annotation.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + [OptionKeys.ArrayDestructuring]: { + type: 'boolean', + description: 'Whether to enforce type annotations on variables declared using array destructuring.', + }, + [OptionKeys.ArrowParameter]: { + type: 'boolean', + description: 'Whether to enforce type annotations for parameters of arrow functions.', + }, + [OptionKeys.MemberVariableDeclaration]: { + type: 'boolean', + description: 'Whether to enforce type annotations on member variables of classes.', + }, + [OptionKeys.ObjectDestructuring]: { + type: 'boolean', + description: 'Whether to enforce type annotations on variables declared using object destructuring.', + }, + [OptionKeys.Parameter]: { + type: 'boolean', + description: 'Whether to enforce type annotations for parameters of functions and methods.', + }, + [OptionKeys.PropertyDeclaration]: { + type: 'boolean', + description: 'Whether to enforce type annotations for properties of interfaces and types.', + }, + [OptionKeys.VariableDeclaration]: { + type: 'boolean', + description: 'Whether to enforce type annotations for variable declarations, excluding array and object destructuring.', + }, + [OptionKeys.VariableDeclarationIgnoreFunction]: { + type: 'boolean', + description: 'Whether to ignore variable declarations for non-arrow and arrow functions.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + [OptionKeys.ArrayDestructuring]: false, + [OptionKeys.ArrowParameter]: false, + [OptionKeys.MemberVariableDeclaration]: false, + [OptionKeys.ObjectDestructuring]: false, + [OptionKeys.Parameter]: false, + [OptionKeys.PropertyDeclaration]: false, + [OptionKeys.VariableDeclaration]: false, + [OptionKeys.VariableDeclarationIgnoreFunction]: false, + }, + ], + create(context, [{ arrayDestructuring, arrowParameter, memberVariableDeclaration, objectDestructuring, parameter, propertyDeclaration, variableDeclaration, variableDeclarationIgnoreFunction, },]) { + function report(location, name) { + context.report({ + node: location, + messageId: name ? 'expectedTypedefNamed' : 'expectedTypedef', + data: { name }, + }); + } + function getNodeName(node) { + return node.type === utils_1.AST_NODE_TYPES.Identifier ? node.name : undefined; + } + function isForOfStatementContext(node) { + let current = node.parent; + while (current) { + switch (current.type) { + case utils_1.AST_NODE_TYPES.VariableDeclarator: + case utils_1.AST_NODE_TYPES.VariableDeclaration: + case utils_1.AST_NODE_TYPES.ObjectPattern: + case utils_1.AST_NODE_TYPES.ArrayPattern: + case utils_1.AST_NODE_TYPES.Property: + current = current.parent; + break; + case utils_1.AST_NODE_TYPES.ForOfStatement: + return true; + default: + current = undefined; + } + } + return false; + } + function checkParameters(params) { + for (const param of params) { + let annotationNode; + switch (param.type) { + case utils_1.AST_NODE_TYPES.AssignmentPattern: + annotationNode = param.left; + break; + case utils_1.AST_NODE_TYPES.TSParameterProperty: + annotationNode = param.parameter; + // Check TS parameter property with default value like `constructor(private param: string = 'something') {}` + if (annotationNode.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + annotationNode = annotationNode.left; + } + break; + default: + annotationNode = param; + break; + } + if (!annotationNode.typeAnnotation) { + report(param, getNodeName(param)); + } + } + } + function isVariableDeclarationIgnoreFunction(node) { + return (variableDeclarationIgnoreFunction === true && + (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + node.type === utils_1.AST_NODE_TYPES.FunctionExpression)); + } + function isAncestorHasTypeAnnotation(node) { + let ancestor = node.parent; + while (ancestor) { + if ((ancestor.type === utils_1.AST_NODE_TYPES.ObjectPattern || + ancestor.type === utils_1.AST_NODE_TYPES.ArrayPattern) && + ancestor.typeAnnotation) { + return true; + } + ancestor = ancestor.parent; + } + return false; + } + return { + ...(arrayDestructuring && { + ArrayPattern(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.RestElement && + node.parent.typeAnnotation) { + return; + } + if (!node.typeAnnotation && + !isForOfStatementContext(node) && + !isAncestorHasTypeAnnotation(node) && + node.parent.type !== utils_1.AST_NODE_TYPES.AssignmentExpression) { + report(node); + } + }, + }), + ...(arrowParameter && { + ArrowFunctionExpression(node) { + checkParameters(node.params); + }, + }), + ...(memberVariableDeclaration && { + PropertyDefinition(node) { + if (!(node.value && isVariableDeclarationIgnoreFunction(node.value)) && + !node.typeAnnotation) { + report(node, node.key.type === utils_1.AST_NODE_TYPES.Identifier + ? node.key.name + : undefined); + } + }, + }), + ...(parameter && { + 'FunctionDeclaration, FunctionExpression'(node) { + checkParameters(node.params); + }, + }), + ...(objectDestructuring && { + ObjectPattern(node) { + if (!node.typeAnnotation && + !isForOfStatementContext(node) && + !isAncestorHasTypeAnnotation(node)) { + report(node); + } + }, + }), + ...(propertyDeclaration && { + 'TSIndexSignature, TSPropertySignature'(node) { + if (!node.typeAnnotation) { + report(node, node.type === utils_1.AST_NODE_TYPES.TSPropertySignature + ? getNodeName(node.key) + : undefined); + } + }, + }), + VariableDeclarator(node) { + if (!variableDeclaration || + node.id.typeAnnotation || + (node.id.type === utils_1.AST_NODE_TYPES.ArrayPattern && + !arrayDestructuring) || + (node.id.type === utils_1.AST_NODE_TYPES.ObjectPattern && + !objectDestructuring) || + (node.init && isVariableDeclarationIgnoreFunction(node.init))) { + return; + } + let current = node.parent; + while (current) { + switch (current.type) { + case utils_1.AST_NODE_TYPES.VariableDeclaration: + // Keep looking upwards + current = current.parent; + break; + case utils_1.AST_NODE_TYPES.ForOfStatement: + case utils_1.AST_NODE_TYPES.ForInStatement: + // Stop traversing and don't report an error + return; + default: + // Stop traversing + current = undefined; + break; + } + } + report(node, getNodeName(node.id)); + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.d.ts.map new file mode 100644 index 0000000..62a9720 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"unbound-method.d.ts","sourceRoot":"","sources":["../../src/rules/unbound-method.ts"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACd,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;AAE/B,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,8BAA8B,CAAC;;AAiFpE,wBA0KG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js new file mode 100644 index 0000000..b17a469 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js @@ -0,0 +1,331 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +/** + * Static methods on these globals are either not `this`-aware or supported being + * called without `this`. + * + * - `Promise` is not in the list because it supports subclassing by using `this` + * - `Array` is in the list because although it supports subclassing, the `this` + * value defaults to `Array` when unbound + * + * This is now a language-design invariant: static methods are never `this`-aware + * because TC39 wants to make `array.map(Class.method)` work! + */ +const SUPPORTED_GLOBALS = [ + 'Number', + 'Object', + 'String', // eslint-disable-line @typescript-eslint/internal/prefer-ast-types-enum + 'RegExp', + 'Symbol', + 'Array', + 'Proxy', + 'Date', + 'Atomics', + 'Reflect', + 'console', + 'Math', + 'JSON', + 'Intl', +]; +const nativelyBoundMembers = new Set(SUPPORTED_GLOBALS.flatMap(namespace => { + if (!(namespace in global)) { + // node.js might not have namespaces like Intl depending on compilation options + // https://nodejs.org/api/intl.html#intl_options_for_building_node_js + return []; + } + const object = global[namespace]; + return Object.getOwnPropertyNames(object) + .filter(name => !name.startsWith('_') && + typeof object[name] === 'function') + .map(name => `${namespace}.${name}`); +})); +const SUPPORTED_GLOBAL_TYPES = [ + 'NumberConstructor', + 'ObjectConstructor', + 'StringConstructor', + 'SymbolConstructor', + 'ArrayConstructor', + 'Array', + 'ProxyConstructor', + 'Console', + 'DateConstructor', + 'Atomics', + 'Math', + 'JSON', +]; +const isNotImported = (symbol, currentSourceFile) => { + const { valueDeclaration } = symbol; + if (!valueDeclaration) { + // working around https://github.com/microsoft/TypeScript/issues/31294 + return false; + } + return (!!currentSourceFile && + currentSourceFile !== valueDeclaration.getSourceFile()); +}; +const BASE_MESSAGE = 'Avoid referencing unbound methods which may cause unintentional scoping of `this`.'; +exports.default = (0, util_1.createRule)({ + name: 'unbound-method', + meta: { + type: 'problem', + docs: { + description: 'Enforce unbound methods are called with their expected scope', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unbound: BASE_MESSAGE, + unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf your function does not access \`this\`, you can annotate it with \`this: void\`, or consider using an arrow function instead.`, + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreStatic: { + type: 'boolean', + description: 'Whether to skip checking whether `static` methods are correctly bound.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreStatic: false, + }, + ], + create(context, [{ ignoreStatic }]) { + const services = (0, util_1.getParserServices)(context); + const currentSourceFile = services.program.getSourceFile(context.filename); + function checkIfMethodAndReport(node, symbol) { + if (!symbol) { + return false; + } + const { dangerous, firstParamIsThis } = checkIfMethod(symbol, ignoreStatic); + if (dangerous) { + context.report({ + node, + messageId: firstParamIsThis === false + ? 'unboundWithoutThisAnnotation' + : 'unbound', + }); + return true; + } + return false; + } + function isNativelyBound(object, property) { + // We can't rely entirely on the type-level checks made at the end of this + // function, because sometimes type declarations don't come from the + // default library, but come from, for example, "@types/node". And we can't + // tell if a method is unbound just by looking at its signature declared in + // the interface. + // + // See related discussion https://github.com/typescript-eslint/typescript-eslint/pull/8952#discussion_r1576543310 + if (object.type === utils_1.AST_NODE_TYPES.Identifier && + property.type === utils_1.AST_NODE_TYPES.Identifier) { + const objectSymbol = services.getSymbolAtLocation(object); + const notImported = objectSymbol != null && + isNotImported(objectSymbol, currentSourceFile); + if (notImported && + nativelyBoundMembers.has(`${object.name}.${property.name}`)) { + return true; + } + } + // if `${object.name}.${property.name}` doesn't match any of + // the nativelyBoundMembers, then we fallback to type-level checks + return ((0, util_1.isBuiltinSymbolLike)(services.program, services.getTypeAtLocation(object), SUPPORTED_GLOBAL_TYPES) && + (0, util_1.isSymbolFromDefaultLibrary)(services.program, services.getTypeAtLocation(property).getSymbol())); + } + return { + MemberExpression(node) { + if (isSafeUse(node) || isNativelyBound(node.object, node.property)) { + return; + } + checkIfMethodAndReport(node, services.getSymbolAtLocation(node)); + }, + ObjectPattern(node) { + if (isNodeInsideTypeDeclaration(node)) { + return; + } + let initNode = null; + if (node.parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + initNode = node.parent.init; + } + else if (node.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern || + node.parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression) { + initNode = node.parent.right; + } + for (const property of node.properties) { + if (property.type !== utils_1.AST_NODE_TYPES.Property || + property.key.type !== utils_1.AST_NODE_TYPES.Identifier) { + continue; + } + if (initNode) { + if (!isNativelyBound(initNode, property.key)) { + const reported = checkIfMethodAndReport(property.key, services + .getTypeAtLocation(initNode) + .getProperty(property.key.name)); + if (reported) { + continue; + } + // In assignment patterns, we should also check the type of + // Foo's nativelyBound method because initNode might be used as + // default value: + // function ({ nativelyBound }: Foo = NativeObject) {} + } + else if (node.parent.type !== utils_1.AST_NODE_TYPES.AssignmentPattern) { + continue; + } + } + for (const intersectionPart of tsutils + .unionTypeParts(services.getTypeAtLocation(node)) + .flatMap(unionPart => tsutils.intersectionTypeParts(unionPart))) { + const reported = checkIfMethodAndReport(property.key, intersectionPart.getProperty(property.key.name)); + if (reported) { + break; + } + } + } + }, + }; + }, +}); +function isNodeInsideTypeDeclaration(node) { + let parent = node; + while ((parent = parent.parent)) { + if ((parent.type === utils_1.AST_NODE_TYPES.ClassDeclaration && parent.declare) || + parent.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || + parent.type === utils_1.AST_NODE_TYPES.TSDeclareFunction || + parent.type === utils_1.AST_NODE_TYPES.TSFunctionType || + parent.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration || + parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration || + (parent.type === utils_1.AST_NODE_TYPES.VariableDeclaration && parent.declare)) { + return true; + } + } + return false; +} +function checkIfMethod(symbol, ignoreStatic) { + const { valueDeclaration } = symbol; + if (!valueDeclaration) { + // working around https://github.com/microsoft/TypeScript/issues/31294 + return { dangerous: false }; + } + switch (valueDeclaration.kind) { + case ts.SyntaxKind.PropertyDeclaration: + return { + dangerous: valueDeclaration.initializer?.kind === + ts.SyntaxKind.FunctionExpression, + }; + case ts.SyntaxKind.PropertyAssignment: { + const assignee = valueDeclaration.initializer; + if (assignee.kind !== ts.SyntaxKind.FunctionExpression) { + return { + dangerous: false, + }; + } + return checkMethod(assignee, ignoreStatic); + } + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.MethodSignature: { + return checkMethod(valueDeclaration, ignoreStatic); + } + } + return { dangerous: false }; +} +function checkMethod(valueDeclaration, ignoreStatic) { + const firstParam = valueDeclaration.parameters.at(0); + const firstParamIsThis = firstParam?.name.kind === ts.SyntaxKind.Identifier && + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison + firstParam.name.escapedText === 'this'; + const thisArgIsVoid = firstParamIsThis && firstParam.type?.kind === ts.SyntaxKind.VoidKeyword; + return { + dangerous: !thisArgIsVoid && + !(ignoreStatic && + tsutils.includesModifier((0, util_1.getModifiers)(valueDeclaration), ts.SyntaxKind.StaticKeyword)), + firstParamIsThis, + }; +} +function isSafeUse(node) { + const parent = node.parent; + switch (parent?.type) { + case utils_1.AST_NODE_TYPES.IfStatement: + case utils_1.AST_NODE_TYPES.ForStatement: + case utils_1.AST_NODE_TYPES.MemberExpression: + case utils_1.AST_NODE_TYPES.SwitchStatement: + case utils_1.AST_NODE_TYPES.UpdateExpression: + case utils_1.AST_NODE_TYPES.WhileStatement: + return true; + case utils_1.AST_NODE_TYPES.CallExpression: + return parent.callee === node; + case utils_1.AST_NODE_TYPES.ConditionalExpression: + return parent.test === node; + case utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + return parent.tag === node; + case utils_1.AST_NODE_TYPES.UnaryExpression: + // the first case is safe for obvious + // reasons. The second one is also fine + // since we're returning something falsy + return ['!', 'delete', 'typeof', 'void'].includes(parent.operator); + case utils_1.AST_NODE_TYPES.BinaryExpression: + return ['!=', '!==', '==', '===', 'instanceof'].includes(parent.operator); + case utils_1.AST_NODE_TYPES.AssignmentExpression: + return (parent.operator === '=' && + (node === parent.left || + (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.object.type === utils_1.AST_NODE_TYPES.Super && + parent.left.type === utils_1.AST_NODE_TYPES.MemberExpression && + parent.left.object.type === utils_1.AST_NODE_TYPES.ThisExpression))); + case utils_1.AST_NODE_TYPES.ChainExpression: + case utils_1.AST_NODE_TYPES.TSNonNullExpression: + case utils_1.AST_NODE_TYPES.TSAsExpression: + case utils_1.AST_NODE_TYPES.TSTypeAssertion: + return isSafeUse(parent); + case utils_1.AST_NODE_TYPES.LogicalExpression: + if (parent.operator === '&&' && parent.left === node) { + // this is safe, as && will return the left if and only if it's falsy + return true; + } + // in all other cases, it's likely the logical expression will return the method ref + // so make sure the parent is a safe usage + return isSafeUse(parent); + } + return false; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.d.ts.map new file mode 100644 index 0000000..763dbb1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"unified-signatures.d.ts","sourceRoot":"","sources":["../../src/rules/unified-signatures.ts"],"names":[],"mappings":"AAuDA,MAAM,MAAM,UAAU,GAClB,uBAAuB,GACvB,yBAAyB,GACzB,2BAA2B,CAAC;AAEhC,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,gCAAgC,CAAC,EAAE,OAAO,CAAC;QAC3C,iCAAiC,CAAC,EAAE,OAAO,CAAC;KAC7C;CACF,CAAC;;AAEF,wBAyiBG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js new file mode 100644 index 0000000..5023c64 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js @@ -0,0 +1,435 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'unified-signatures', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow two overloads that could be unified into one with a union or an optional/rest parameter', + // too opinionated to be recommended + recommended: 'strict', + }, + messages: { + omittingRestParameter: '{{failureStringStart}} with a rest parameter.', + omittingSingleParameter: '{{failureStringStart}} with an optional parameter.', + singleParameterDifference: '{{failureStringStart}} taking `{{type1}} | {{type2}}`.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreDifferentlyNamedParameters: { + type: 'boolean', + description: 'Whether two parameters with different names at the same index should be considered different even if their types are the same.', + }, + ignoreOverloadsWithDifferentJSDoc: { + type: 'boolean', + description: 'Whether two overloads with different JSDoc comments should be considered different even if their parameter and return types are the same.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreDifferentlyNamedParameters: false, + ignoreOverloadsWithDifferentJSDoc: false, + }, + ], + create(context, [{ ignoreDifferentlyNamedParameters, ignoreOverloadsWithDifferentJSDoc }]) { + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + function failureStringStart(otherLine) { + // For only 2 overloads we don't need to specify which is the other one. + const overloads = otherLine == null + ? 'These overloads' + : `This overload and the one on line ${otherLine}`; + return `${overloads} can be combined into one signature`; + } + function addFailures(failures) { + for (const failure of failures) { + const { only2, unify } = failure; + switch (unify.kind) { + case 'single-parameter-difference': { + const { p0, p1 } = unify; + const lineOfOtherOverload = only2 ? undefined : p0.loc.start.line; + const typeAnnotation0 = isTSParameterProperty(p0) + ? p0.parameter.typeAnnotation + : p0.typeAnnotation; + const typeAnnotation1 = isTSParameterProperty(p1) + ? p1.parameter.typeAnnotation + : p1.typeAnnotation; + context.report({ + loc: p1.loc, + node: p1, + messageId: 'singleParameterDifference', + data: { + failureStringStart: failureStringStart(lineOfOtherOverload), + type1: context.sourceCode.getText(typeAnnotation0?.typeAnnotation), + type2: context.sourceCode.getText(typeAnnotation1?.typeAnnotation), + }, + }); + break; + } + case 'extra-parameter': { + const { extraParameter, otherSignature } = unify; + const lineOfOtherOverload = only2 + ? undefined + : otherSignature.loc.start.line; + context.report({ + loc: extraParameter.loc, + node: extraParameter, + messageId: extraParameter.type === utils_1.AST_NODE_TYPES.RestElement + ? 'omittingRestParameter' + : 'omittingSingleParameter', + data: { + failureStringStart: failureStringStart(lineOfOtherOverload), + }, + }); + } + } + } + } + function checkOverloads(signatures, typeParameters) { + const result = []; + const isTypeParameter = getIsTypeParameter(typeParameters); + for (const overloads of signatures) { + forEachPair(overloads, (a, b) => { + const signature0 = a.value ?? a; + const signature1 = b.value ?? b; + const unify = compareSignatures(signature0, signature1, isTypeParameter); + if (unify != null) { + result.push({ only2: overloads.length === 2, unify }); + } + }); + } + return result; + } + function compareSignatures(a, b, isTypeParameter) { + if (!signaturesCanBeUnified(a, b, isTypeParameter)) { + return undefined; + } + return a.params.length === b.params.length + ? signaturesDifferBySingleParameter(a.params, b.params) + : signaturesDifferByOptionalOrRestParameter(a, b); + } + function signaturesCanBeUnified(a, b, isTypeParameter) { + // Must return the same type. + const aTypeParams = a.typeParameters != null ? a.typeParameters.params : undefined; + const bTypeParams = b.typeParameters != null ? b.typeParameters.params : undefined; + if (ignoreDifferentlyNamedParameters) { + const commonParamsLength = Math.min(a.params.length, b.params.length); + for (let i = 0; i < commonParamsLength; i += 1) { + if (a.params[i].type === b.params[i].type && + getStaticParameterName(a.params[i]) !== + getStaticParameterName(b.params[i])) { + return false; + } + } + } + if (ignoreOverloadsWithDifferentJSDoc) { + const aComment = getBlockCommentForNode(getExportingNode(a) ?? a); + const bComment = getBlockCommentForNode(getExportingNode(b) ?? b); + if (aComment?.value !== bComment?.value) { + return false; + } + } + return (typesAreEqual(a.returnType, b.returnType) && + // Must take the same type parameters. + // If one uses a type parameter (from outside) and the other doesn't, they shouldn't be joined. + (0, util_1.arraysAreEqual)(aTypeParams, bTypeParams, typeParametersAreEqual) && + signatureUsesTypeParameter(a, isTypeParameter) === + signatureUsesTypeParameter(b, isTypeParameter)); + } + /** Detect `a(x: number, y: number, z: number)` and `a(x: number, y: string, z: number)`. */ + function signaturesDifferBySingleParameter(types1, types2) { + const index = getIndexOfFirstDifference(types1, types2, parametersAreEqual); + if (index == null) { + return undefined; + } + // If remaining arrays are equal, the signatures differ by just one parameter type + if (!(0, util_1.arraysAreEqual)(types1.slice(index + 1), types2.slice(index + 1), parametersAreEqual)) { + return undefined; + } + const a = types1[index]; + const b = types2[index]; + // Can unify `a?: string` and `b?: number`. Can't unify `...args: string[]` and `...args: number[]`. + // See https://github.com/Microsoft/TypeScript/issues/5077 + return parametersHaveEqualSigils(a, b) && + a.type !== utils_1.AST_NODE_TYPES.RestElement + ? { kind: 'single-parameter-difference', p0: a, p1: b } + : undefined; + } + /** + * Detect `a(): void` and `a(x: number): void`. + * Returns the parameter declaration (`x: number` in this example) that should be optional/rest, and overload it's a part of. + */ + function signaturesDifferByOptionalOrRestParameter(a, b) { + const sig1 = a.params; + const sig2 = b.params; + const minLength = Math.min(sig1.length, sig2.length); + const longer = sig1.length < sig2.length ? sig2 : sig1; + const shorter = sig1.length < sig2.length ? sig1 : sig2; + const shorterSig = sig1.length < sig2.length ? a : b; + // If one is has 2+ parameters more than the other, they must all be optional/rest. + // Differ by optional parameters: f() and f(x), f() and f(x, ?y, ...z) + // Not allowed: f() and f(x, y) + for (let i = minLength + 1; i < longer.length; i++) { + if (!parameterMayBeMissing(longer[i])) { + return undefined; + } + } + for (let i = 0; i < minLength; i++) { + const sig1i = sig1[i]; + const sig2i = sig2[i]; + const typeAnnotation1 = isTSParameterProperty(sig1i) + ? sig1i.parameter.typeAnnotation + : sig1i.typeAnnotation; + const typeAnnotation2 = isTSParameterProperty(sig2i) + ? sig2i.parameter.typeAnnotation + : sig2i.typeAnnotation; + if (!typesAreEqual(typeAnnotation1, typeAnnotation2)) { + return undefined; + } + } + if (minLength > 0 && + shorter[minLength - 1].type === utils_1.AST_NODE_TYPES.RestElement) { + return undefined; + } + return { + extraParameter: longer[longer.length - 1], + kind: 'extra-parameter', + otherSignature: shorterSig, + }; + } + /** Given type parameters, returns a function to test whether a type is one of those parameters. */ + function getIsTypeParameter(typeParameters) { + if (typeParameters == null) { + return (() => false); + } + const set = new Set(); + for (const t of typeParameters.params) { + set.add(t.name.name); + } + return (typeName => set.has(typeName)); + } + /** True if any of the outer type parameters are used in a signature. */ + function signatureUsesTypeParameter(sig, isTypeParameter) { + return sig.params.some((p) => typeContainsTypeParameter(isTSParameterProperty(p) + ? p.parameter.typeAnnotation + : p.typeAnnotation)); + function typeContainsTypeParameter(type) { + if (!type) { + return false; + } + if (type.type === utils_1.AST_NODE_TYPES.TSTypeReference) { + const typeName = type.typeName; + if (isIdentifier(typeName) && isTypeParameter(typeName.name)) { + return true; + } + } + return typeContainsTypeParameter(type.typeAnnotation ?? + type.elementType); + } + } + function isTSParameterProperty(node) { + return node.type === utils_1.AST_NODE_TYPES.TSParameterProperty; + } + function parametersAreEqual(a, b) { + const typeAnnotationA = isTSParameterProperty(a) + ? a.parameter.typeAnnotation + : a.typeAnnotation; + const typeAnnotationB = isTSParameterProperty(b) + ? b.parameter.typeAnnotation + : b.typeAnnotation; + return (parametersHaveEqualSigils(a, b) && + typesAreEqual(typeAnnotationA, typeAnnotationB)); + } + /** True for optional/rest parameters. */ + function parameterMayBeMissing(p) { + const optional = isTSParameterProperty(p) + ? p.parameter.optional + : p.optional; + return p.type === utils_1.AST_NODE_TYPES.RestElement || optional; + } + /** False if one is optional and the other isn't, or one is a rest parameter and the other isn't. */ + function parametersHaveEqualSigils(a, b) { + const optionalA = isTSParameterProperty(a) + ? a.parameter.optional + : a.optional; + const optionalB = isTSParameterProperty(b) + ? b.parameter.optional + : b.optional; + return ((a.type === utils_1.AST_NODE_TYPES.RestElement) === + (b.type === utils_1.AST_NODE_TYPES.RestElement) && optionalA === optionalB); + } + function typeParametersAreEqual(a, b) { + return (a.name.name === b.name.name && + constraintsAreEqual(a.constraint, b.constraint)); + } + function typesAreEqual(a, b) { + return (a === b || + (a != null && + b != null && + context.sourceCode.getText(a.typeAnnotation) === + context.sourceCode.getText(b.typeAnnotation))); + } + function constraintsAreEqual(a, b) { + return a === b || (a != null && b != null && a.type === b.type); + } + /* Returns the first index where `a` and `b` differ. */ + function getIndexOfFirstDifference(a, b, equal) { + for (let i = 0; i < a.length && i < b.length; i++) { + if (!equal(a[i], b[i])) { + return i; + } + } + return undefined; + } + /** Calls `action` for every pair of values in `values`. */ + function forEachPair(values, action) { + for (let i = 0; i < values.length; i++) { + for (let j = i + 1; j < values.length; j++) { + action(values[i], values[j]); + } + } + } + const scopes = []; + let currentScope = { + overloads: new Map(), + }; + function createScope(parent, typeParameters) { + if (currentScope) { + scopes.push(currentScope); + } + currentScope = { + overloads: new Map(), + parent, + typeParameters, + }; + } + function checkScope() { + const scope = (0, util_1.nullThrows)(currentScope, 'checkScope() called without a current scope'); + const failures = checkOverloads([...scope.overloads.values()], scope.typeParameters); + addFailures(failures); + currentScope = scopes.pop(); + } + /** + * @returns the first valid JSDoc comment annotating `node` + */ + function getBlockCommentForNode(node) { + return context.sourceCode + .getCommentsBefore(node) + .reverse() + .find(comment => comment.type === utils_1.AST_TOKEN_TYPES.Block); + } + function addOverload(signature, key, containingNode) { + key ??= getOverloadKey(signature); + if (currentScope && + (containingNode ?? signature).parent === currentScope.parent) { + const overloads = currentScope.overloads.get(key); + if (overloads != null) { + overloads.push(signature); + } + else { + currentScope.overloads.set(key, [signature]); + } + } + } + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + return { + ClassDeclaration(node) { + createScope(node.body, node.typeParameters); + }, + Program: createScope, + TSInterfaceDeclaration(node) { + createScope(node.body, node.typeParameters); + }, + TSModuleBlock: createScope, + TSTypeLiteral: createScope, + // collect overloads + MethodDefinition(node) { + if (!node.value.body && !isGetterOrSetter(node)) { + addOverload(node); + } + }, + TSAbstractMethodDefinition(node) { + if (!node.value.body && !isGetterOrSetter(node)) { + addOverload(node); + } + }, + TSCallSignatureDeclaration: addOverload, + TSConstructSignatureDeclaration: addOverload, + TSDeclareFunction(node) { + const exportingNode = getExportingNode(node); + addOverload(node, node.id?.name ?? exportingNode?.type, exportingNode); + }, + TSMethodSignature(node) { + if (!isGetterOrSetter(node)) { + addOverload(node); + } + }, + // validate scopes + 'ClassDeclaration:exit': checkScope, + 'Program:exit': checkScope, + 'TSInterfaceDeclaration:exit': checkScope, + 'TSModuleBlock:exit': checkScope, + 'TSTypeLiteral:exit': checkScope, + }; + }, +}); +function getExportingNode(node) { + return node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration || + node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration + ? node.parent + : undefined; +} +function getOverloadKey(node) { + const info = getOverloadInfo(node); + return ((node.computed ? '0' : '1') + + (node.static ? '0' : '1') + + info); +} +function getOverloadInfo(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return 'constructor'; + case utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration: + return '()'; + default: { + const { key } = node; + if (isPrivateIdentifier(key)) { + return `private_identifier_${key.name}`; + } + if (isIdentifier(key)) { + return `identifier_${key.name}`; + } + return key.raw; + } + } +} +function getStaticParameterName(param) { + switch (param.type) { + case utils_1.AST_NODE_TYPES.Identifier: + return param.name; + case utils_1.AST_NODE_TYPES.RestElement: + return getStaticParameterName(param.argument); + default: + return undefined; + } +} +function isIdentifier(node) { + return node.type === utils_1.AST_NODE_TYPES.Identifier; +} +function isPrivateIdentifier(node) { + return node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier; +} +function isGetterOrSetter(node) { + return node.kind === 'get' || node.kind === 'set'; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.d.ts.map new file mode 100644 index 0000000..2fa9201 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"use-unknown-in-catch-callback-variable.d.ts","sourceRoot":"","sources":["../../src/rules/use-unknown-in-catch-callback-variable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAgBnE,MAAM,MAAM,UAAU,GAClB,wCAAwC,GACxC,oCAAoC,GACpC,YAAY,GACZ,qCAAqC,GACrC,sCAAsC,GACtC,mCAAmC,GACnC,+BAA+B,CAAC;;AAKpC,wBAmSG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.js new file mode 100644 index 0000000..0245359 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.js @@ -0,0 +1,262 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +const useUnknownMessageBase = 'Prefer the safe `: unknown` for a `{{method}}`{{append}} callback variable.'; +exports.default = (0, util_1.createRule)({ + name: 'use-unknown-in-catch-callback-variable', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce typing arguments in Promise rejection callbacks as `unknown`', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + hasSuggestions: true, + messages: { + addUnknownRestTypeAnnotationSuggestion: 'Add an explicit `: [unknown]` type annotation to the rejection callback rest variable.', + addUnknownTypeAnnotationSuggestion: 'Add an explicit `: unknown` type annotation to the rejection callback variable.', + useUnknown: useUnknownMessageBase, + useUnknownArrayDestructuringPattern: `${useUnknownMessageBase} The thrown error may not be iterable.`, + useUnknownObjectDestructuringPattern: `${useUnknownMessageBase} The thrown error may be nullable, or may not have the expected shape.`, + wrongRestTypeAnnotationSuggestion: 'Change existing type annotation to `: [unknown]`.', + wrongTypeAnnotationSuggestion: 'Change existing type annotation to `: unknown`.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const { esTreeNodeToTSNodeMap, program } = (0, util_1.getParserServices)(context); + const checker = program.getTypeChecker(); + function isFlaggableHandlerType(type) { + for (const unionPart of tsutils.unionTypeParts(type)) { + const callSignatures = tsutils.getCallSignaturesOfType(unionPart); + if (callSignatures.length === 0) { + // Ignore any non-function components to the type. Those are not this rule's problem. + continue; + } + for (const callSignature of callSignatures) { + const firstParam = callSignature.parameters.at(0); + if (!firstParam) { + // it's not an issue if there's no catch variable at all. + continue; + } + let firstParamType = checker.getTypeOfSymbol(firstParam); + const decl = firstParam.valueDeclaration; + if (decl != null && (0, util_1.isRestParameterDeclaration)(decl)) { + if (checker.isArrayType(firstParamType)) { + firstParamType = checker.getTypeArguments(firstParamType)[0]; + } + else if (checker.isTupleType(firstParamType)) { + firstParamType = checker.getTypeArguments(firstParamType)[0]; + } + else { + // a rest arg that's not an array or tuple should definitely be flagged. + return true; + } + } + if (!tsutils.isIntrinsicUnknownType(firstParamType)) { + return true; + } + } + } + return false; + } + function collectFlaggedNodes(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.LogicalExpression: + return [ + ...collectFlaggedNodes(node.left), + ...collectFlaggedNodes(node.right), + ]; + case utils_1.AST_NODE_TYPES.SequenceExpression: + return collectFlaggedNodes((0, util_1.nullThrows)(node.expressions.at(-1), 'sequence expression must have multiple expressions')); + case utils_1.AST_NODE_TYPES.ConditionalExpression: + return [ + ...collectFlaggedNodes(node.consequent), + ...collectFlaggedNodes(node.alternate), + ]; + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + { + const argument = esTreeNodeToTSNodeMap.get(node); + const typeOfArgument = checker.getTypeAtLocation(argument); + if (isFlaggableHandlerType(typeOfArgument)) { + return [node]; + } + } + break; + default: + break; + } + return []; + } + /** + * Analyzes the syntax of the catch argument and makes a best effort to pinpoint + * why it's reporting, and to come up with a suggested fix if possible. + * + * This function is explicitly operating under the assumption that the + * rule _is reporting_, so it is not guaranteed to be sound to call otherwise. + */ + function refineReportIfPossible(argument) { + const catchVariableOuterWithIncorrectTypes = (0, util_1.nullThrows)(argument.params.at(0), 'There should have been at least one parameter for the rule to have flagged.'); + // Function expressions can't have parameter properties; those only exist in constructors. + const catchVariableOuter = catchVariableOuterWithIncorrectTypes; + const catchVariableInner = catchVariableOuter.type === utils_1.AST_NODE_TYPES.AssignmentPattern + ? catchVariableOuter.left + : catchVariableOuter; + switch (catchVariableInner.type) { + case utils_1.AST_NODE_TYPES.Identifier: { + const catchVariableTypeAnnotation = catchVariableInner.typeAnnotation; + if (catchVariableTypeAnnotation == null) { + return { + node: catchVariableOuter, + suggest: [ + { + messageId: 'addUnknownTypeAnnotationSuggestion', + fix: (fixer) => { + if (argument.type === + utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + (0, util_1.isParenlessArrowFunction)(argument, context.sourceCode)) { + return [ + fixer.insertTextBefore(catchVariableInner, '('), + fixer.insertTextAfter(catchVariableInner, ': unknown)'), + ]; + } + return [ + fixer.insertTextAfter(catchVariableInner, ': unknown'), + ]; + }, + }, + ], + }; + } + return { + node: catchVariableOuter, + suggest: [ + { + messageId: 'wrongTypeAnnotationSuggestion', + fix: (fixer) => fixer.replaceText(catchVariableTypeAnnotation, ': unknown'), + }, + ], + }; + } + case utils_1.AST_NODE_TYPES.ArrayPattern: { + return { + node: catchVariableOuter, + messageId: 'useUnknownArrayDestructuringPattern', + }; + } + case utils_1.AST_NODE_TYPES.ObjectPattern: { + return { + node: catchVariableOuter, + messageId: 'useUnknownObjectDestructuringPattern', + }; + } + case utils_1.AST_NODE_TYPES.RestElement: { + const catchVariableTypeAnnotation = catchVariableInner.typeAnnotation; + if (catchVariableTypeAnnotation == null) { + return { + node: catchVariableOuter, + suggest: [ + { + messageId: 'addUnknownRestTypeAnnotationSuggestion', + fix: (fixer) => fixer.insertTextAfter(catchVariableInner, ': [unknown]'), + }, + ], + }; + } + return { + node: catchVariableOuter, + suggest: [ + { + messageId: 'wrongRestTypeAnnotationSuggestion', + fix: (fixer) => fixer.replaceText(catchVariableTypeAnnotation, ': [unknown]'), + }, + ], + }; + } + } + } + return { + CallExpression({ arguments: args, callee }) { + if (callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return; + } + const staticMemberAccessKey = (0, util_1.getStaticMemberAccessValue)(callee, context); + if (!staticMemberAccessKey) { + return; + } + const promiseMethodInfo = [ + { append: '', argIndexToCheck: 0, method: 'catch' }, + { append: ' rejection', argIndexToCheck: 1, method: 'then' }, + ].find(({ method }) => staticMemberAccessKey === method); + if (!promiseMethodInfo) { + return; + } + // Need to be enough args to check + const { argIndexToCheck, ...data } = promiseMethodInfo; + if (args.length < argIndexToCheck + 1) { + return; + } + // Argument to check, and all arguments before it, must be "ordinary" arguments (i.e. no spread arguments) + // promise.catch(f), promise.catch(() => {}), promise.catch(, <>) + const argsToCheck = args.slice(0, argIndexToCheck + 1); + if (argsToCheck.some(({ type }) => type === utils_1.AST_NODE_TYPES.SpreadElement)) { + return; + } + if (!tsutils.isThenableType(checker, esTreeNodeToTSNodeMap.get(callee), checker.getTypeAtLocation(esTreeNodeToTSNodeMap.get(callee.object)))) { + return; + } + // the `some` check above has already excluded `SpreadElement`, so we are safe to assert the same + const argToCheck = argsToCheck[argIndexToCheck]; + for (const node of collectFlaggedNodes(argToCheck)) { + // We are now guaranteed to report, but we have a bit of work to do + // to determine exactly where, and whether we can fix it. + const overrides = refineReportIfPossible(node); + context.report({ + node, + messageId: 'useUnknown', + data, + ...overrides, + }); + } + }, + }; + }, +}); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.d.ts.map new file mode 100644 index 0000000..38be7f5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assertionFunctionUtils.d.ts","sourceRoot":"","sources":["../../src/util/assertionFunctionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,iCAAiC,EAC3C,IAAI,EAAE,QAAQ,CAAC,cAAc,GAC5B,QAAQ,CAAC,UAAU,GAAG,SAAS,CAsCjC;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,iCAAiC,EAC3C,IAAI,EAAE,QAAQ,CAAC,cAAc,GAE3B;IACE,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;CACf,GACD,SAAS,CAmDZ"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.js new file mode 100644 index 0000000..63f9a7e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.js @@ -0,0 +1,118 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.findTruthinessAssertedArgument = findTruthinessAssertedArgument; +exports.findTypeGuardAssertedArgument = findTypeGuardAssertedArgument; +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +/** + * Inspect a call expression to see if it's a call to an assertion function. + * If it is, return the node of the argument that is asserted. + */ +function findTruthinessAssertedArgument(services, node) { + // If the call looks like `assert(expr1, expr2, ...c, d, e, f)`, then we can + // only care if `expr1` or `expr2` is asserted, since anything that happens + // within or after a spread argument is out of scope to reason about. + const checkableArguments = []; + for (const argument of node.arguments) { + if (argument.type === utils_1.AST_NODE_TYPES.SpreadElement) { + break; + } + checkableArguments.push(argument); + } + // nothing to do + if (checkableArguments.length === 0) { + return undefined; + } + const checker = services.program.getTypeChecker(); + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const signature = checker.getResolvedSignature(tsNode); + if (signature == null) { + return undefined; + } + const firstTypePredicateResult = checker.getTypePredicateOfSignature(signature); + if (firstTypePredicateResult == null) { + return undefined; + } + const { kind, parameterIndex, type } = firstTypePredicateResult; + if (!(kind === ts.TypePredicateKind.AssertsIdentifier && type == null)) { + return undefined; + } + return checkableArguments.at(parameterIndex); +} +/** + * Inspect a call expression to see if it's a call to an assertion function. + * If it is, return the node of the argument that is asserted and other useful info. + */ +function findTypeGuardAssertedArgument(services, node) { + // If the call looks like `assert(expr1, expr2, ...c, d, e, f)`, then we can + // only care if `expr1` or `expr2` is asserted, since anything that happens + // within or after a spread argument is out of scope to reason about. + const checkableArguments = []; + for (const argument of node.arguments) { + if (argument.type === utils_1.AST_NODE_TYPES.SpreadElement) { + break; + } + checkableArguments.push(argument); + } + // nothing to do + if (checkableArguments.length === 0) { + return undefined; + } + const checker = services.program.getTypeChecker(); + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const callSignature = checker.getResolvedSignature(tsNode); + if (callSignature == null) { + return undefined; + } + const typePredicateInfo = checker.getTypePredicateOfSignature(callSignature); + if (typePredicateInfo == null) { + return undefined; + } + const { kind, parameterIndex, type } = typePredicateInfo; + if (!((kind === ts.TypePredicateKind.AssertsIdentifier || + kind === ts.TypePredicateKind.Identifier) && + type != null)) { + return undefined; + } + if (parameterIndex >= checkableArguments.length) { + return undefined; + } + return { + argument: checkableArguments[parameterIndex], + asserts: kind === ts.TypePredicateKind.AssertsIdentifier, + type, + }; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.d.ts.map new file mode 100644 index 0000000..92f12fe --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"astUtils.d.ts","sourceRoot":"","sources":["../../src/util/astUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAKjC,cAAc,oCAAoC,CAAC;AAKnD;;;;;;GAMG;AACH,wBAAgB,uCAAuC,CACrD,UAAU,EAAE,QAAQ,CAAC,UAAU,EAC/B,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,IAAI,EAAE,MAAM,GACX,QAAQ,CAAC,cAAc,CAsBzB;AAKD,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,IAAI,EAAE,EAAE,CAAC,KAAK,EACd,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,KAAK,CAAC,GACvC,CAAC,GAAG,SAAS,CA2Bf"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js new file mode 100644 index 0000000..fc5e05c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js @@ -0,0 +1,97 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getNameLocationInGlobalDirectiveComment = getNameLocationInGlobalDirectiveComment; +exports.forEachReturnStatement = forEachReturnStatement; +const ts = __importStar(require("typescript")); +const escapeRegExp_1 = require("./escapeRegExp"); +// deeply re-export, for convenience +__exportStar(require("@typescript-eslint/utils/ast-utils"), exports); +// The following is copied from `eslint`'s source code since it doesn't exist in eslint@5. +// https://github.com/eslint/eslint/blob/145aec1ab9052fbca96a44d04927c595951b1536/lib/rules/utils/ast-utils.js#L1751-L1779 +// Could be export { getNameLocationInGlobalDirectiveComment } from 'eslint/lib/rules/utils/ast-utils' +/** + * Get the `loc` object of a given name in a `/*globals` directive comment. + * @param sourceCode The source code to convert index to loc. + * @param comment The `/*globals` directive comment which include the name. + * @param name The name to find. + * @returns The `loc` object. + */ +function getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { + const namePattern = new RegExp(`[\\s,]${(0, escapeRegExp_1.escapeRegExp)(name)}(?:$|[\\s,:])`, 'gu'); + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf('global') + 6; + // Search a given variable name. + const match = namePattern.exec(comment.value); + // Convert the index to loc. + const start = sourceCode.getLocFromIndex(comment.range[0] + '/*'.length + (match ? match.index + 1 : 0)); + const end = { + column: start.column + (match ? name.length : 1), + line: start.line, + }; + return { end, start }; +} +// Copied from typescript https://github.com/microsoft/TypeScript/blob/42b0e3c4630c129ca39ce0df9fff5f0d1b4dd348/src/compiler/utilities.ts#L1335 +// Warning: This has the same semantics as the forEach family of functions, +// in that traversal terminates in the event that 'visitor' supplies a truthy value. +function forEachReturnStatement(body, visitor) { + return traverse(body); + function traverse(node) { + switch (node.kind) { + case ts.SyntaxKind.ReturnStatement: + return visitor(node); + case ts.SyntaxKind.CaseBlock: + case ts.SyntaxKind.Block: + case ts.SyntaxKind.IfStatement: + case ts.SyntaxKind.DoStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.ForOfStatement: + case ts.SyntaxKind.WithStatement: + case ts.SyntaxKind.SwitchStatement: + case ts.SyntaxKind.CaseClause: + case ts.SyntaxKind.DefaultClause: + case ts.SyntaxKind.LabeledStatement: + case ts.SyntaxKind.TryStatement: + case ts.SyntaxKind.CatchClause: + return ts.forEachChild(node, traverse); + } + return undefined; + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.d.ts.map new file mode 100644 index 0000000..9170c29 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"collectUnusedVariables.d.ts","sourceRoot":"","sources":["../../src/util/collectUnusedVariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACd,MAAM,kCAAkC,CAAC;AAQ1C,OAAO,EAIL,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAKlC,UAAU,gBAAgB;IACxB,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACrD,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACpD;AAqxBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,SAAS,OAAO,EAAE,EAElC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,GAC3D,gBAAgB,CAQlB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js new file mode 100644 index 0000000..848eba6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js @@ -0,0 +1,604 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.collectVariables = collectVariables; +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const isTypeImport_1 = require("./isTypeImport"); +const referenceContainsTypeQuery_1 = require("./referenceContainsTypeQuery"); +/** + * This class leverages an AST visitor to mark variables as used via the + * `eslintUsed` property. + */ +class UnusedVarsVisitor extends scope_manager_1.Visitor { + /** + * We keep a weak cache so that multiple rules can share the calculation + */ + static RESULTS_CACHE = new WeakMap(); + ClassDeclaration = this.visitClass; + ClassExpression = this.visitClass; + ForInStatement = this.visitForInForOf; + ForOfStatement = this.visitForInForOf; + //#region HELPERS + FunctionDeclaration = this.visitFunction; + FunctionExpression = this.visitFunction; + MethodDefinition = this.visitSetter; + Property = this.visitSetter; + TSCallSignatureDeclaration = this.visitFunctionTypeSignature; + TSConstructorType = this.visitFunctionTypeSignature; + TSConstructSignatureDeclaration = this.visitFunctionTypeSignature; + TSDeclareFunction = this.visitFunctionTypeSignature; + TSEmptyBodyFunctionExpression = this.visitFunctionTypeSignature; + //#endregion HELPERS + //#region VISITORS + // NOTE - This is a simple visitor - meaning it does not support selectors + TSFunctionType = this.visitFunctionTypeSignature; + TSMethodSignature = this.visitFunctionTypeSignature; + #scopeManager; + constructor(scopeManager) { + super({ + visitChildrenEvenIfSelectorExists: true, + }); + this.#scopeManager = scopeManager; + } + static collectUnusedVariables(program, scopeManager) { + const cached = this.RESULTS_CACHE.get(program); + if (cached) { + return cached; + } + const visitor = new this(scopeManager); + visitor.visit(program); + const unusedVars = visitor.collectUnusedVariables(visitor.getScope(program)); + this.RESULTS_CACHE.set(program, unusedVars); + return unusedVars; + } + Identifier(node) { + const scope = this.getScope(node); + if (scope.type === utils_1.TSESLint.Scope.ScopeType.function && + node.name === 'this' && + // this parameters should always be considered used as they're pseudo-parameters + 'params' in scope.block && + scope.block.params.includes(node)) { + this.markVariableAsUsed(node); + } + } + TSEnumDeclaration(node) { + // enum members create variables because they can be referenced within the enum, + // but they obviously aren't unused variables for the purposes of this rule. + const scope = this.getScope(node); + for (const variable of scope.variables) { + this.markVariableAsUsed(variable); + } + } + TSMappedType(node) { + // mapped types create a variable for their type name, but it's not necessary to reference it, + // so we shouldn't consider it as unused for the purpose of this rule. + this.markVariableAsUsed(node.key); + } + TSModuleDeclaration(node) { + // -- global augmentation can be in any file, and they do not need exports + if (node.kind === 'global') { + this.markVariableAsUsed('global', node.parent); + } + } + TSParameterProperty(node) { + let identifier = null; + switch (node.parameter.type) { + case utils_1.AST_NODE_TYPES.AssignmentPattern: + if (node.parameter.left.type === utils_1.AST_NODE_TYPES.Identifier) { + identifier = node.parameter.left; + } + break; + case utils_1.AST_NODE_TYPES.Identifier: + identifier = node.parameter; + break; + } + if (identifier) { + this.markVariableAsUsed(identifier); + } + } + collectUnusedVariables(scope, variables = { + unusedVariables: new Set(), + usedVariables: new Set(), + }) { + if ( + // skip function expression names + // this scope is created just to house the variable that allows a function + // expression to self-reference if it has a name defined + !scope.functionExpressionScope) { + for (const variable of scope.variables) { + // cases that we don't want to treat as used or unused + if ( + // implicit lib variables (from @typescript-eslint/scope-manager) + // these aren't variables that should be checked ever + variable instanceof scope_manager_1.ImplicitLibVariable) { + continue; + } + if ( + // variables marked with markVariableAsUsed() + variable.eslintUsed || + // basic exported variables + isExported(variable) || + // variables implicitly exported via a merged declaration + isMergableExported(variable) || + // used variables + isUsedVariable(variable)) { + variables.usedVariables.add(variable); + } + else { + variables.unusedVariables.add(variable); + } + } + } + for (const childScope of scope.childScopes) { + this.collectUnusedVariables(childScope, variables); + } + return variables; + } + getScope(currentNode) { + // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. + const inner = currentNode.type !== utils_1.AST_NODE_TYPES.Program; + let node = currentNode; + while (node) { + const scope = this.#scopeManager.acquire(node, inner); + if (scope) { + if (scope.type === scope_manager_1.ScopeType.functionExpressionName) { + return scope.childScopes[0]; + } + return scope; + } + node = node.parent; + } + return this.#scopeManager.scopes[0]; + } + markVariableAsUsed(variableOrIdentifierOrName, parent) { + if (typeof variableOrIdentifierOrName !== 'string' && + !('type' in variableOrIdentifierOrName)) { + variableOrIdentifierOrName.eslintUsed = true; + return; + } + let name; + let node; + if (typeof variableOrIdentifierOrName === 'string') { + name = variableOrIdentifierOrName; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + node = parent; + } + else { + name = variableOrIdentifierOrName.name; + node = variableOrIdentifierOrName; + } + let currentScope = this.getScope(node); + while (currentScope) { + const variable = currentScope.variables.find(scopeVar => scopeVar.name === name); + if (variable) { + variable.eslintUsed = true; + return; + } + currentScope = currentScope.upper; + } + } + visitClass(node) { + // skip a variable of class itself name in the class scope + const scope = this.getScope(node); + for (const variable of scope.variables) { + if (variable.identifiers[0] === scope.block.id) { + this.markVariableAsUsed(variable); + return; + } + } + } + visitForInForOf(node) { + /** + * (Brad Zacher): I hate that this has to exist. + * But it is required for compat with the base ESLint rule. + * + * In 2015, ESLint decided to add an exception for these two specific cases + * ``` + * for (var key in object) return; + * + * var key; + * for (key in object) return; + * ``` + * + * I disagree with it, but what are you going to do... + * + * https://github.com/eslint/eslint/issues/2342 + */ + let idOrVariable; + if (node.left.type === utils_1.AST_NODE_TYPES.VariableDeclaration) { + const variable = this.#scopeManager.getDeclaredVariables(node.left).at(0); + if (!variable) { + return; + } + idOrVariable = variable; + } + if (node.left.type === utils_1.AST_NODE_TYPES.Identifier) { + idOrVariable = node.left; + } + if (idOrVariable == null) { + return; + } + let body = node.body; + if (node.body.type === utils_1.AST_NODE_TYPES.BlockStatement) { + if (node.body.body.length !== 1) { + return; + } + body = node.body.body[0]; + } + if (body.type !== utils_1.AST_NODE_TYPES.ReturnStatement) { + return; + } + this.markVariableAsUsed(idOrVariable); + } + visitFunction(node) { + const scope = this.getScope(node); + // skip implicit "arguments" variable + const variable = scope.set.get('arguments'); + if (variable?.defs.length === 0) { + this.markVariableAsUsed(variable); + } + } + visitFunctionTypeSignature(node) { + // function type signature params create variables because they can be referenced within the signature, + // but they obviously aren't unused variables for the purposes of this rule. + for (const param of node.params) { + this.visitPattern(param, name => { + this.markVariableAsUsed(name); + }); + } + } + visitSetter(node) { + if (node.kind === 'set') { + // ignore setter parameters because they're syntactically required to exist + for (const param of node.value.params) { + this.visitPattern(param, id => { + this.markVariableAsUsed(id); + }); + } + } + } +} +//#region private helpers +/** + * Checks the position of given nodes. + * @param inner A node which is expected as inside. + * @param outer A node which is expected as outside. + * @returns `true` if the `inner` node exists in the `outer` node. + */ +function isInside(inner, outer) { + return inner.range[0] >= outer.range[0] && inner.range[1] <= outer.range[1]; +} +/** + * Determine if an identifier is referencing an enclosing name. + * This only applies to declarations that create their own scope (modules, functions, classes) + * @param ref The reference to check. + * @param nodes The candidate function nodes. + * @returns True if it's a self-reference, false if not. + */ +function isSelfReference(ref, nodes) { + let scope = ref.from; + while (scope) { + if (nodes.has(scope.block)) { + return true; + } + scope = scope.upper; + } + return false; +} +const MERGABLE_TYPES = new Set([ + utils_1.AST_NODE_TYPES.ClassDeclaration, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, +]); +/** + * Determine if the variable is directly exported + * @param variable the variable to check + */ +function isMergableExported(variable) { + // If all of the merged things are of the same type, TS will error if not all of them are exported - so we only need to find one + for (const def of variable.defs) { + // parameters can never be exported. + // their `node` prop points to the function decl, which can be exported + // so we need to special case them + if (def.type === utils_1.TSESLint.Scope.DefinitionType.Parameter) { + continue; + } + if ((MERGABLE_TYPES.has(def.node.type) && + def.node.parent?.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) || + def.node.parent?.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration) { + return true; + } + } + return false; +} +/** + * Determines if a given variable is being exported from a module. + * @param variable eslint-scope variable object. + * @returns True if the variable is exported, false if not. + */ +function isExported(variable) { + return variable.defs.some(definition => { + let node = definition.node; + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + node = node.parent; + } + else if (definition.type === utils_1.TSESLint.Scope.DefinitionType.Parameter) { + return false; + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return node.parent.type.startsWith('Export'); + }); +} +const LOGICAL_ASSIGNMENT_OPERATORS = new Set(['??=', '&&=', '||=']); +/** + * Determines if the variable is used. + * @param variable The variable to check. + * @returns True if the variable is used + */ +function isUsedVariable(variable) { + /** + * Gets a list of function definitions for a specified variable. + * @param variable eslint-scope variable object. + * @returns Function nodes. + */ + function getFunctionDefinitions(variable) { + const functionDefinitions = new Set(); + variable.defs.forEach(def => { + // FunctionDeclarations + if (def.type === utils_1.TSESLint.Scope.DefinitionType.FunctionName) { + functionDefinitions.add(def.node); + } + // FunctionExpressions + if (def.type === utils_1.TSESLint.Scope.DefinitionType.Variable && + (def.node.init?.type === utils_1.AST_NODE_TYPES.FunctionExpression || + def.node.init?.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression)) { + functionDefinitions.add(def.node.init); + } + }); + return functionDefinitions; + } + function getTypeDeclarations(variable) { + const nodes = new Set(); + variable.defs.forEach(def => { + if (def.node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration || + def.node.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) { + nodes.add(def.node); + } + }); + return nodes; + } + function getModuleDeclarations(variable) { + const nodes = new Set(); + variable.defs.forEach(def => { + if (def.node.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration) { + nodes.add(def.node); + } + }); + return nodes; + } + function getEnumDeclarations(variable) { + const nodes = new Set(); + variable.defs.forEach(def => { + if (def.node.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration) { + nodes.add(def.node); + } + }); + return nodes; + } + /** + * Checks if the ref is contained within one of the given nodes + */ + function isInsideOneOf(ref, nodes) { + for (const node of nodes) { + if (isInside(ref.identifier, node)) { + return true; + } + } + return false; + } + /** + * Checks whether a given node is unused expression or not. + * @param node The node itself + * @returns The node is an unused expression. + */ + function isUnusedExpression(node) { + const parent = node.parent; + if (parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + return true; + } + if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression) { + const isLastExpression = parent.expressions[parent.expressions.length - 1] === node; + if (!isLastExpression) { + return true; + } + return isUnusedExpression(parent); + } + return false; + } + /** + * If a given reference is left-hand side of an assignment, this gets + * the right-hand side node of the assignment. + * + * In the following cases, this returns null. + * + * - The reference is not the LHS of an assignment expression. + * - The reference is inside of a loop. + * - The reference is inside of a function scope which is different from + * the declaration. + * @param ref A reference to check. + * @param prevRhsNode The previous RHS node. + * @returns The RHS node or null. + */ + function getRhsNode(ref, prevRhsNode) { + /** + * Checks whether the given node is in a loop or not. + * @param node The node to check. + * @returns `true` if the node is in a loop. + */ + function isInLoop(node) { + let currentNode = node; + while (currentNode) { + if (utils_1.ASTUtils.isFunction(currentNode)) { + break; + } + if (utils_1.ASTUtils.isLoop(currentNode)) { + return true; + } + currentNode = currentNode.parent; + } + return false; + } + const id = ref.identifier; + const parent = id.parent; + const refScope = ref.from.variableScope; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const varScope = ref.resolved.scope.variableScope; + const canBeUsedLater = refScope !== varScope || isInLoop(id); + /* + * Inherits the previous node if this reference is in the node. + * This is for `a = a + a`-like code. + */ + if (prevRhsNode && isInside(id, prevRhsNode)) { + return prevRhsNode; + } + if (parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + isUnusedExpression(parent) && + id === parent.left && + !canBeUsedLater) { + return parent.right; + } + return null; + } + /** + * Checks whether a given reference is a read to update itself or not. + * @param ref A reference to check. + * @param rhsNode The RHS node of the previous assignment. + * @returns The reference is a read to update itself. + */ + function isReadForItself(ref, rhsNode) { + /** + * Checks whether a given Identifier node exists inside of a function node which can be used later. + * + * "can be used later" means: + * - the function is assigned to a variable. + * - the function is bound to a property and the object can be used later. + * - the function is bound as an argument of a function call. + * + * If a reference exists in a function which can be used later, the reference is read when the function is called. + * @param id An Identifier node to check. + * @param rhsNode The RHS node of the previous assignment. + * @returns `true` if the `id` node exists inside of a function node which can be used later. + */ + function isInsideOfStorableFunction(id, rhsNode) { + /** + * Finds a function node from ancestors of a node. + * @param node A start node to find. + * @returns A found function node. + */ + function getUpperFunction(node) { + let currentNode = node; + while (currentNode) { + if (utils_1.ASTUtils.isFunction(currentNode)) { + return currentNode; + } + currentNode = currentNode.parent; + } + return null; + } + /** + * Checks whether a given function node is stored to somewhere or not. + * If the function node is stored, the function can be used later. + * @param funcNode A function node to check. + * @param rhsNode The RHS node of the previous assignment. + * @returns `true` if under the following conditions: + * - the funcNode is assigned to a variable. + * - the funcNode is bound as an argument of a function call. + * - the function is bound to a property and the object satisfies above conditions. + */ + function isStorableFunction(funcNode, rhsNode) { + let node = funcNode; + let parent = funcNode.parent; + while (parent && isInside(parent, rhsNode)) { + switch (parent.type) { + case utils_1.AST_NODE_TYPES.SequenceExpression: + if (parent.expressions[parent.expressions.length - 1] !== node) { + return false; + } + break; + case utils_1.AST_NODE_TYPES.CallExpression: + case utils_1.AST_NODE_TYPES.NewExpression: + return parent.callee !== node; + case utils_1.AST_NODE_TYPES.AssignmentExpression: + case utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + case utils_1.AST_NODE_TYPES.YieldExpression: + return true; + default: + if (parent.type.endsWith('Statement') || + parent.type.endsWith('Declaration')) { + /* + * If it encountered statements, this is a complex pattern. + * Since analyzing complex patterns is hard, this returns `true` to avoid false positive. + */ + return true; + } + } + node = parent; + parent = parent.parent; + } + return false; + } + const funcNode = getUpperFunction(id); + return (!!funcNode && + isInside(funcNode, rhsNode) && + isStorableFunction(funcNode, rhsNode)); + } + const id = ref.identifier; + const parent = id.parent; + return (ref.isRead() && // in RHS of an assignment for itself. e.g. `a = a + 1` + // self update. e.g. `a += 1`, `a++` + ((parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + !LOGICAL_ASSIGNMENT_OPERATORS.has(parent.operator) && + isUnusedExpression(parent) && + parent.left === id) || + (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression && + isUnusedExpression(parent)) || + (!!rhsNode && + isInside(id, rhsNode) && + !isInsideOfStorableFunction(id, rhsNode)))); + } + const functionNodes = getFunctionDefinitions(variable); + const isFunctionDefinition = functionNodes.size > 0; + const typeDeclNodes = getTypeDeclarations(variable); + const isTypeDecl = typeDeclNodes.size > 0; + const moduleDeclNodes = getModuleDeclarations(variable); + const isModuleDecl = moduleDeclNodes.size > 0; + const enumDeclNodes = getEnumDeclarations(variable); + const isEnumDecl = enumDeclNodes.size > 0; + const isImportedAsType = variable.defs.every(isTypeImport_1.isTypeImport); + let rhsNode = null; + return variable.references.some(ref => { + const forItself = isReadForItself(ref, rhsNode); + rhsNode = getRhsNode(ref, rhsNode); + return (ref.isRead() && + !forItself && + !(!isImportedAsType && (0, referenceContainsTypeQuery_1.referenceContainsTypeQuery)(ref.identifier)) && + !(isFunctionDefinition && isSelfReference(ref, functionNodes)) && + !(isTypeDecl && isInsideOneOf(ref, typeDeclNodes)) && + !(isModuleDecl && isSelfReference(ref, moduleDeclNodes)) && + !(isEnumDecl && isSelfReference(ref, enumDeclNodes))); + }); +} +//#endregion private helpers +/** + * Collects the set of unused variables for a given context. + * + * Due to complexity, this does not take into consideration: + * - variables within declaration files + * - variables within ambient module declarations + */ +function collectVariables(context) { + return UnusedVarsVisitor.collectUnusedVariables(context.sourceCode.ast, utils_1.ESLintUtils.nullThrows(context.sourceCode.scopeManager, 'Missing required scope manager')); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.d.ts.map new file mode 100644 index 0000000..662680c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createRule.d.ts","sourceRoot":"","sources":["../../src/util/createRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,UAAU,uQAEtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js new file mode 100644 index 0000000..2ae6aec --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createRule = void 0; +const utils_1 = require("@typescript-eslint/utils"); +exports.createRule = utils_1.ESLintUtils.RuleCreator(name => `https://typescript-eslint.io/rules/${name}`); diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.d.ts.map new file mode 100644 index 0000000..4b2b6c1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"escapeRegExp.d.ts","sourceRoot":"","sources":["../../src/util/escapeRegExp.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAAC,MAAM,SAAK,GAAG,MAAM,CAIhD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.js new file mode 100644 index 0000000..02d2ab6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escapeRegExp = escapeRegExp; +/** + * Lodash + * Released under MIT license + */ +const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +const reHasRegExpChar = RegExp(reRegExpChar.source); +function escapeRegExp(string = '') { + return string && reHasRegExpChar.test(string) + ? string.replaceAll(reRegExpChar, '\\$&') + : string; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.d.ts.map new file mode 100644 index 0000000..8ddbacd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"explicitReturnTypeUtils.d.ts","sourceRoot":"","sources":["../../src/util/explicitReturnTypeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAWnE,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,kBAAkB,CAAC;AAChC,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;AAE7E,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,YAAY;IAClD,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,QAAQ,CAAC,eAAe,EAAE,CAAC;CACrC;AA6HD;;;;;;;;;;GAUG;AACH,wBAAgB,uCAAuC,CAAC,EACtD,IAAI,EACJ,OAAO,GACR,EAAE,YAAY,CAAC,YAAY,CAAC,GAAG,OAAO,CAetC;AAyBD,UAAU,OAAO;IACf,yCAAyC,CAAC,EAAE,OAAO,CAAC;IACpD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,kBAAkB,EACxB,OAAO,EAAE,OAAO,GACf,OAAO,CAeT;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,kBAAkB,EACxB,OAAO,EAAE,OAAO,GACf,OAAO,CAiCT;AAuBD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC,EAC7C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,QAAQ,CAAC,UAAU,EAC/B,MAAM,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,cAAc,KAAK,IAAI,GAC7C,IAAI,CAMN;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,YAAY,CAAC,kBAAkB,CAAC,EACtC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,QAAQ,CAAC,UAAU,EAC/B,MAAM,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,cAAc,KAAK,IAAI,GAC7C,IAAI,CAMN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAyCjE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js new file mode 100644 index 0000000..d574aca --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js @@ -0,0 +1,240 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.doesImmediatelyReturnFunctionExpression = doesImmediatelyReturnFunctionExpression; +exports.isTypedFunctionExpression = isTypedFunctionExpression; +exports.isValidFunctionExpressionReturnType = isValidFunctionExpressionReturnType; +exports.checkFunctionReturnType = checkFunctionReturnType; +exports.checkFunctionExpressionReturnType = checkFunctionExpressionReturnType; +exports.ancestorHasReturnType = ancestorHasReturnType; +const utils_1 = require("@typescript-eslint/utils"); +const astUtils_1 = require("./astUtils"); +const getFunctionHeadLoc_1 = require("./getFunctionHeadLoc"); +/** + * Checks if a node is a variable declarator with a type annotation. + * ``` + * const x: Foo = ... + * ``` + */ +function isVariableDeclaratorWithTypeAnnotation(node) { + return (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator && !!node.id.typeAnnotation); +} +/** + * Checks if a node is a class property with a type annotation. + * ``` + * public x: Foo = ... + * ``` + */ +function isPropertyDefinitionWithTypeAnnotation(node) { + return (node.type === utils_1.AST_NODE_TYPES.PropertyDefinition && !!node.typeAnnotation); +} +/** + * Checks if a node belongs to: + * ``` + * foo(() => 1) + * ``` + */ +function isFunctionArgument(parent, callee) { + return (parent.type === utils_1.AST_NODE_TYPES.CallExpression && + // make sure this isn't an IIFE + parent.callee !== callee); +} +/** + * Checks if a node is type-constrained in JSX + * ``` + * {}} /> + * {() => {}} + * + * ``` + */ +function isTypedJSX(node) { + return (node.type === utils_1.AST_NODE_TYPES.JSXExpressionContainer || + node.type === utils_1.AST_NODE_TYPES.JSXSpreadAttribute); +} +function isTypedParent(parent, callee) { + return ((0, astUtils_1.isTypeAssertion)(parent) || + isVariableDeclaratorWithTypeAnnotation(parent) || + isDefaultFunctionParameterWithTypeAnnotation(parent) || + isPropertyDefinitionWithTypeAnnotation(parent) || + isFunctionArgument(parent, callee) || + isTypedJSX(parent)); +} +function isDefaultFunctionParameterWithTypeAnnotation(node) { + return (node.type === utils_1.AST_NODE_TYPES.AssignmentPattern && + node.left.typeAnnotation != null); +} +/** + * Checks if a node belongs to: + * ``` + * new Foo(() => {}) + * ^^^^^^^^ + * ``` + */ +function isConstructorArgument(node) { + return node.type === utils_1.AST_NODE_TYPES.NewExpression; +} +/** + * Checks if a node is a property or a nested property of a typed object: + * ``` + * const x: Foo = { prop: () => {} } + * const x = { prop: () => {} } as Foo + * const x = { prop: () => {} } + * const x: Foo = { bar: { prop: () => {} } } + * ``` + */ +function isPropertyOfObjectWithType(property) { + if (!property || property.type !== utils_1.AST_NODE_TYPES.Property) { + return false; + } + const objectExpr = property.parent; + if (objectExpr.type !== utils_1.AST_NODE_TYPES.ObjectExpression) { + return false; + } + const parent = objectExpr.parent; + return isTypedParent(parent) || isPropertyOfObjectWithType(parent); +} +/** + * Checks if a function belongs to: + * ``` + * () => () => ... + * () => function () { ... } + * () => { return () => ... } + * () => { return function () { ... } } + * function fn() { return () => ... } + * function fn() { return function() { ... } } + * ``` + */ +function doesImmediatelyReturnFunctionExpression({ node, returns, }) { + if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + utils_1.ASTUtils.isFunction(node.body)) { + return true; + } + if (returns.length === 0) { + return false; + } + return returns.every(node => node.argument && utils_1.ASTUtils.isFunction(node.argument)); +} +/** + * Checks if a function belongs to: + * ``` + * ({ action: 'xxx' } as const) + * ``` + */ +function isConstAssertion(node) { + if ((0, astUtils_1.isTypeAssertion)(node)) { + const { typeAnnotation } = node; + if (typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference) { + const { typeName } = typeAnnotation; + if (typeName.type === utils_1.AST_NODE_TYPES.Identifier && + typeName.name === 'const') { + return true; + } + } + } + return false; +} +/** + * True when the provided function expression is typed. + */ +function isTypedFunctionExpression(node, options) { + const parent = utils_1.ESLintUtils.nullThrows(node.parent, utils_1.ESLintUtils.NullThrowsReasons.MissingParent); + if (!options.allowTypedFunctionExpressions) { + return false; + } + return (isTypedParent(parent, node) || + isPropertyOfObjectWithType(parent) || + isConstructorArgument(parent)); +} +/** + * Check whether the function expression return type is either typed or valid + * with the provided options. + */ +function isValidFunctionExpressionReturnType(node, options) { + if (isTypedFunctionExpression(node, options)) { + return true; + } + const parent = utils_1.ESLintUtils.nullThrows(node.parent, utils_1.ESLintUtils.NullThrowsReasons.MissingParent); + if (options.allowExpressions && + parent.type !== utils_1.AST_NODE_TYPES.VariableDeclarator && + parent.type !== utils_1.AST_NODE_TYPES.MethodDefinition && + parent.type !== utils_1.AST_NODE_TYPES.ExportDefaultDeclaration && + parent.type !== utils_1.AST_NODE_TYPES.PropertyDefinition) { + return true; + } + // https://github.com/typescript-eslint/typescript-eslint/issues/653 + if (!options.allowDirectConstAssertionInArrowFunctions || + node.type !== utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + return false; + } + let body = node.body; + while (body.type === utils_1.AST_NODE_TYPES.TSSatisfiesExpression) { + body = body.expression; + } + return isConstAssertion(body); +} +/** + * Check that the function expression or declaration is valid. + */ +function isValidFunctionReturnType({ node, returns }, options) { + if (options.allowHigherOrderFunctions && + doesImmediatelyReturnFunctionExpression({ node, returns })) { + return true; + } + return (node.returnType != null || + (0, astUtils_1.isConstructor)(node.parent) || + (0, astUtils_1.isSetter)(node.parent)); +} +/** + * Checks if a function declaration/expression has a return type. + */ +function checkFunctionReturnType({ node, returns }, options, sourceCode, report) { + if (isValidFunctionReturnType({ node, returns }, options)) { + return; + } + report((0, getFunctionHeadLoc_1.getFunctionHeadLoc)(node, sourceCode)); +} +/** + * Checks if a function declaration/expression has a return type. + */ +function checkFunctionExpressionReturnType(info, options, sourceCode, report) { + if (isValidFunctionExpressionReturnType(info.node, options)) { + return; + } + checkFunctionReturnType(info, options, sourceCode, report); +} +/** + * Check whether any ancestor of the provided function has a valid return type. + */ +function ancestorHasReturnType(node) { + let ancestor = node.parent; + if (ancestor.type === utils_1.AST_NODE_TYPES.Property) { + ancestor = ancestor.value; + } + // if the ancestor is not a return, then this function was not returned at all, so we can exit early + const isReturnStatement = ancestor.type === utils_1.AST_NODE_TYPES.ReturnStatement; + const isBodylessArrow = ancestor.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + ancestor.body.type !== utils_1.AST_NODE_TYPES.BlockStatement; + if (!isReturnStatement && !isBodylessArrow) { + return false; + } + while (ancestor) { + switch (ancestor.type) { + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + if (ancestor.returnType) { + return true; + } + break; + // const x: Foo = () => {}; + // Assume that a typed variable types the function expression + case utils_1.AST_NODE_TYPES.VariableDeclarator: + return !!ancestor.id.typeAnnotation; + case utils_1.AST_NODE_TYPES.PropertyDefinition: + return !!ancestor.typeAnnotation; + case utils_1.AST_NODE_TYPES.ExpressionStatement: + return false; + } + ancestor = ancestor.parent; + } + return false; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.d.ts.map new file mode 100644 index 0000000..9cf1997 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getConstraintInfo.d.ts","sourceRoot":"","sources":["../../src/util/getConstraintInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,WAAW,+BAA+B;IAC9C,cAAc,EAAE,SAAS,CAAC;IAC1B,eAAe,EAAE,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,6BAA6B;IAC5C,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;IACxB,eAAe,EAAE,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;IACxB,eAAe,EAAE,KAAK,CAAC;CACxB;AAED,MAAM,MAAM,kBAAkB,GAC1B,6BAA6B,GAC7B,4BAA4B,GAC5B,+BAA+B,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,kBAAkB,CAYpB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.js new file mode 100644 index 0000000..76f2096 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.js @@ -0,0 +1,70 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getConstraintInfo = getConstraintInfo; +const tsutils = __importStar(require("ts-api-utils")); +/** + * Returns whether the type is a generic and what its constraint is. + * + * If the type is not a generic, `isTypeParameter` will be `false`, and + * `constraintType` will be the same as the input type. + * + * If the type is a generic, and it is constrained, `isTypeParameter` will be + * `true`, and `constraintType` will be the constraint type. + * + * If the type is a generic, but it is not constrained, `constraintType` will be + * `undefined` (rather than an `unknown` type), due to https://github.com/microsoft/TypeScript/issues/60475 + * + * Successor to {@link getConstrainedTypeAtLocation} due to https://github.com/typescript-eslint/typescript-eslint/issues/10438 + * + * This is considered internal since it is unstable for now and may have breaking changes at any time. + * Use at your own risk. + * + * @internal + * + */ +function getConstraintInfo(checker, type) { + if (tsutils.isTypeParameter(type)) { + const constraintType = checker.getBaseConstraintOfType(type); + return { + constraintType, + isTypeParameter: true, + }; + } + return { + constraintType: type, + isTypeParameter: false, + }; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.d.ts.map new file mode 100644 index 0000000..03b625d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getESLintCoreRule.d.ts","sourceRoot":"","sources":["../../src/util/getESLintCoreRule.ts"],"names":[],"mappings":"AAGA,UAAU,OAAO;IAEf,cAAc,EAAE,cAAc,+BAA+B,CAAC,CAAC;IAC/D,mBAAmB,EAAE,cAAc,oCAAoC,CAAC,CAAC;IACzE,cAAc,EAAE,cAAc,+BAA+B,CAAC,CAAC;IAC/D,mBAAmB,EAAE,cAAc,oCAAoC,CAAC,CAAC;IACzE,YAAY,EAAE,cAAc,6BAA6B,CAAC,CAAC;IAC3D,cAAc,EAAE,cAAc,+BAA+B,CAAC,CAAC;IAC/D,uBAAuB,EAAE,cAAc,wCAAwC,CAAC,CAAC;IACjF,mBAAmB,EAAE,cAAc,oCAAoC,CAAC,CAAC;IACzE,qBAAqB,EAAE,cAAc,sCAAsC,CAAC,CAAC;IAC7E,iBAAiB,EAAE,cAAc,kCAAkC,CAAC,CAAC;IACrE,cAAc,EAAE,cAAc,+BAA+B,CAAC,CAAC;IAC/D,sBAAsB,EAAE,cAAc,uCAAuC,CAAC,CAAC;IAC/E,kBAAkB,EAAE,cAAc,mCAAmC,CAAC,CAAC;IACvE,uBAAuB,EAAE,cAAc,wCAAwC,CAAC,CAAC;IACjF,uBAAuB,EAAE,cAAc,wCAAwC,CAAC,CAAC;IACjF,UAAU,EAAE,cAAc,2BAA2B,CAAC,CAAC;IACvD,uBAAuB,EAAE,cAAc,wCAAwC,CAAC,CAAC;IACjF,wBAAwB,EAAE,cAAc,yCAAyC,CAAC,CAAC;IACnF,cAAc,EAAE,cAAc,+BAA+B,CAAC,CAAC;IAC/D,sBAAsB,EAAE,cAAc,uCAAuC,CAAC,CAAC;IAC/E,MAAM,EAAE,cAAc,yBAAyB,CAAC,CAAC;CAElD;AAED,KAAK,MAAM,GAAG,MAAM,OAAO,CAAC;AAE5B,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC,KAAG,OAAO,CAAC,CAAC,CAItE,CAAC;AAEJ,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EACrD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAMnB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.js new file mode 100644 index 0000000..6bb8fa4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getESLintCoreRule = void 0; +exports.maybeGetESLintCoreRule = maybeGetESLintCoreRule; +const utils_1 = require("@typescript-eslint/utils"); +const use_at_your_own_risk_1 = require("eslint/use-at-your-own-risk"); +const getESLintCoreRule = (ruleId) => utils_1.ESLintUtils.nullThrows(use_at_your_own_risk_1.builtinRules.get(ruleId), `ESLint's core rule '${ruleId}' not found.`); +exports.getESLintCoreRule = getESLintCoreRule; +function maybeGetESLintCoreRule(ruleId) { + try { + return (0, exports.getESLintCoreRule)(ruleId); + } + catch { + return null; + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.d.ts.map new file mode 100644 index 0000000..44a7071 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getFixOrSuggest.d.ts","sourceRoot":"","sources":["../../src/util/getFixOrSuggest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,wBAAgB,eAAe,CAAC,SAAS,SAAS,MAAM,EAAE,EACxD,YAAY,EACZ,UAAU,GACX,EAAE;IACD,YAAY,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,QAAQ,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;CAC5D,GACG;IAAE,GAAG,EAAE,QAAQ,CAAC,iBAAiB,CAAA;CAAE,GACnC;IAAE,OAAO,EAAE,QAAQ,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,CAAA;CAAE,GAC7D,SAAS,CASZ"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js new file mode 100644 index 0000000..d665b96 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFixOrSuggest = getFixOrSuggest; +function getFixOrSuggest({ fixOrSuggest, suggestion, }) { + switch (fixOrSuggest) { + case 'fix': + return { fix: suggestion.fix }; + case 'none': + return undefined; + case 'suggest': + return { suggest: [suggestion] }; + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.d.ts.map new file mode 100644 index 0000000..7707abc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getForStatementHeadLoc.d.ts","sourceRoot":"","sources":["../../src/util/getForStatementHeadLoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAInE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,QAAQ,CAAC,UAAU,EAC/B,IAAI,EACA,QAAQ,CAAC,cAAc,GACvB,QAAQ,CAAC,cAAc,GACvB,QAAQ,CAAC,YAAY,GACxB,QAAQ,CAAC,cAAc,CASzB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.js new file mode 100644 index 0000000..aa6c0da --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getForStatementHeadLoc = getForStatementHeadLoc; +const eslint_utils_1 = require("@typescript-eslint/utils/eslint-utils"); +/** + * Gets the location of the head of the given for statement variant for reporting. + * + * - `for (const foo in bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for (const foo of bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for await (const foo of bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for (let i = 0; i < 10; i++) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +function getForStatementHeadLoc(sourceCode, node) { + const closingParens = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenBefore(node.body, token => token.value === ')'), 'for statement must have a closing parenthesis.'); + return { + end: structuredClone(closingParens.loc.end), + start: structuredClone(node.loc.start), + }; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.d.ts.map new file mode 100644 index 0000000..e222028 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getFunctionHeadLoc.d.ts","sourceRoot":"","sources":["../../src/util/getFunctionHeadLoc.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAMnE,KAAK,YAAY,GACb,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,CAAC;AA2ChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,QAAQ,CAAC,UAAU,GAC9B,QAAQ,CAAC,cAAc,CAiDzB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.js new file mode 100644 index 0000000..15d2b07 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.js @@ -0,0 +1,161 @@ +"use strict"; +// adapted from https://github.com/eslint/eslint/blob/5bdaae205c3a0089ea338b382df59e21d5b06436/lib/rules/utils/ast-utils.js#L1668-L1787 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFunctionHeadLoc = getFunctionHeadLoc; +const utils_1 = require("@typescript-eslint/utils"); +const astUtils_1 = require("./astUtils"); +/** + * Gets the `(` token of the given function node. + * @param node The function node to get. + * @param sourceCode The source code object to get tokens. + * @returns `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + // If the node is an arrow function and doesn't have parens, this returns the identifier of the first param. + if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.params.length === 1) { + const argToken = utils_1.ESLintUtils.nullThrows(sourceCode.getFirstToken(node.params[0]), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('parameter', 'arrow function')); + const maybeParenToken = sourceCode.getTokenBefore(argToken); + return maybeParenToken && (0, astUtils_1.isOpeningParenToken)(maybeParenToken) + ? maybeParenToken + : argToken; + } + // Otherwise, returns paren. + return node.id != null + ? utils_1.ESLintUtils.nullThrows(sourceCode.getTokenAfter(node.id, astUtils_1.isOpeningParenToken), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('id', 'function')) + : utils_1.ESLintUtils.nullThrows(sourceCode.getFirstToken(node, astUtils_1.isOpeningParenToken), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('opening parenthesis', 'function')); +} +/** + * Gets the location of the given function node for reporting. + * + * - `function foo() {}` + * ^^^^^^^^^^^^ + * - `(function foo() {})` + * ^^^^^^^^^^^^ + * - `(function() {})` + * ^^^^^^^^ + * - `function* foo() {}` + * ^^^^^^^^^^^^^ + * - `(function* foo() {})` + * ^^^^^^^^^^^^^ + * - `(function*() {})` + * ^^^^^^^^^ + * - `() => {}` + * ^^ + * - `async () => {}` + * ^^ + * - `({ foo: function foo() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ foo: function() {} })` + * ^^^^^^^^^^^^^ + * - `({ ['foo']: function() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function() {} })` + * ^^^^^^^^^^^^^^^ + * - `({ foo() {} })` + * ^^^ + * - `({ foo: function* foo() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ foo: function*() {} })` + * ^^^^^^^^^^^^^^ + * - `({ ['foo']: function*() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function*() {} })` + * ^^^^^^^^^^^^^^^^ + * - `({ *foo() {} })` + * ^^^^ + * - `({ foo: async function foo() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ foo: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^ + * - `({ ['foo']: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `({ async foo() {} })` + * ^^^^^^^^^ + * - `({ get foo() {} })` + * ^^^^^^^ + * - `({ set foo(a) {} })` + * ^^^^^^^ + * - `class A { constructor() {} }` + * ^^^^^^^^^^^ + * - `class A { foo() {} }` + * ^^^ + * - `class A { *foo() {} }` + * ^^^^ + * - `class A { async foo() {} }` + * ^^^^^^^^^ + * - `class A { ['foo']() {} }` + * ^^^^^^^ + * - `class A { *['foo']() {} }` + * ^^^^^^^^ + * - `class A { async ['foo']() {} }` + * ^^^^^^^^^^^^^ + * - `class A { [foo]() {} }` + * ^^^^^ + * - `class A { *[foo]() {} }` + * ^^^^^^ + * - `class A { async [foo]() {} }` + * ^^^^^^^^^^^ + * - `class A { get foo() {} }` + * ^^^^^^^ + * - `class A { set foo(a) {} }` + * ^^^^^^^ + * - `class A { static foo() {} }` + * ^^^^^^^^^^ + * - `class A { static *foo() {} }` + * ^^^^^^^^^^^ + * - `class A { static async foo() {} }` + * ^^^^^^^^^^^^^^^^ + * - `class A { static get foo() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static set foo(a) {} }` + * ^^^^^^^^^^^^^^ + * - `class A { foo = function() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static foo = function() {} }` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `class A { foo = (a, b) => {} }` + * ^^^^^^ + * @param node The function node to get. + * @param sourceCode The source code object to get tokens. + * @returns The location of the function node for reporting. + */ +function getFunctionHeadLoc(node, sourceCode) { + const parent = node.parent; + let start = null; + let end = null; + if (parent.type === utils_1.AST_NODE_TYPES.MethodDefinition || + parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition) { + // the decorator's range is included within the member + // however it's usually irrelevant to the member itself - so we don't want + // to highlight it ever. + if (parent.decorators.length > 0) { + const lastDecorator = parent.decorators[parent.decorators.length - 1]; + const firstTokenAfterDecorator = utils_1.ESLintUtils.nullThrows(sourceCode.getTokenAfter(lastDecorator), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('modifier or member name', 'class member')); + start = firstTokenAfterDecorator.loc.start; + } + else { + start = parent.loc.start; + } + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + else if (parent.type === utils_1.AST_NODE_TYPES.Property) { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + else if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + const arrowToken = utils_1.ESLintUtils.nullThrows(sourceCode.getTokenBefore(node.body, astUtils_1.isArrowToken), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('arrow token', 'arrow function')); + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } + else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + return { + end: { ...end }, + start: { ...start }, + }; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.d.ts.map new file mode 100644 index 0000000..d13b379 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getMemberHeadLoc.d.ts","sourceRoot":"","sources":["../../src/util/getMemberHeadLoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,IAAI,EACA,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,4BAA4B,GACxC,QAAQ,CAAC,cAAc,CA8BzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,IAAI,EAAE,QAAQ,CAAC,mBAAmB,EAClC,QAAQ,EAAE,MAAM,GACf,QAAQ,CAAC,cAAc,CAyBzB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.js new file mode 100644 index 0000000..8b0f177 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getMemberHeadLoc = getMemberHeadLoc; +exports.getParameterPropertyHeadLoc = getParameterPropertyHeadLoc; +const eslint_utils_1 = require("@typescript-eslint/utils/eslint-utils"); +/** + * Generates report loc suitable for reporting on how a class member is + * declared, rather than how it's implemented. + * + * ```ts + * class A { + * abstract method(): void; + * ~~~~~~~~~~~~~~~ + * + * concreteMethod(): void { + * ~~~~~~~~~~~~~~ + * // code + * } + * + * abstract private property?: string; + * ~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * @decorator override concreteProperty = 'value'; + * ~~~~~~~~~~~~~~~~~~~~~~~~~ + * } + * ``` + */ +function getMemberHeadLoc(sourceCode, node) { + let start; + if (node.decorators.length === 0) { + start = node.loc.start; + } + else { + const lastDecorator = node.decorators[node.decorators.length - 1]; + const nextToken = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(lastDecorator), eslint_utils_1.NullThrowsReasons.MissingToken('token', 'last decorator')); + start = nextToken.loc.start; + } + let end; + if (!node.computed) { + end = node.key.loc.end; + } + else { + const closingBracket = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(node.key, token => token.value === ']'), eslint_utils_1.NullThrowsReasons.MissingToken(']', node.type)); + end = closingBracket.loc.end; + } + return { + end: structuredClone(end), + start: structuredClone(start), + }; +} +/** + * Generates report loc suitable for reporting on how a parameter property is + * declared. + * + * ```ts + * class A { + * constructor(private property: string = 'value') { + * ~~~~~~~~~~~~~~~~ + * } + * ``` + */ +function getParameterPropertyHeadLoc(sourceCode, node, nodeName) { + // Parameter properties have a weirdly different AST structure + // than other class members. + let start; + if (node.decorators.length === 0) { + start = structuredClone(node.loc.start); + } + else { + const lastDecorator = node.decorators[node.decorators.length - 1]; + const nextToken = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(lastDecorator), eslint_utils_1.NullThrowsReasons.MissingToken('token', 'last decorator')); + start = structuredClone(nextToken.loc.start); + } + const end = sourceCode.getLocFromIndex(node.parameter.range[0] + nodeName.length); + return { + end, + start, + }; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.d.ts.map new file mode 100644 index 0000000..1033083 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getOperatorPrecedence.d.ts","sourceRoot":"","sources":["../../src/util/getOperatorPrecedence.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,oBAAY,kBAAkB;IAI5B,KAAK,IAAA;IAKL,MAAM,IAAA;IAkBN,KAAK,IAAA;IAML,UAAU,IAAA;IAWV,WAAW,IAAA;IAOX,QAAQ,IAAc,CAAE,sBAAsB;IAK9C,SAAS,IAAA;IAKT,UAAU,IAAA;IAKV,SAAS,IAAA;IAKT,UAAU,IAAA;IAKV,UAAU,IAAA;IAQV,QAAQ,KAAA;IAWR,UAAU,KAAA;IAOV,KAAK,KAAA;IAML,QAAQ,KAAA;IAMR,cAAc,KAAA;IAKd,cAAc,KAAA;IAed,KAAK,KAAA;IAML,MAAM,KAAA;IAQN,YAAY,KAAA;IAkBZ,MAAM,KAAA;IAiBN,OAAO,KAAA;IAEP,OAAO,KAAU;IACjB,MAAM,IAAQ;IAGd,OAAO,KAAK;CACb;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,kBAAkB,CA8FpB;AAED,KAAK,oBAAoB,GACrB,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GACtC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAE5C,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,UAAU,EACxB,YAAY,CAAC,EAAE,OAAO,GACrB,kBAAkB,CAqGpB;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,UAAU,GAAG,oBAAoB,GACtC,kBAAkB,CAkFpB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.js new file mode 100644 index 0000000..13e1e03 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.js @@ -0,0 +1,417 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OperatorPrecedence = void 0; +exports.getOperatorPrecedenceForNode = getOperatorPrecedenceForNode; +exports.getOperatorPrecedence = getOperatorPrecedence; +exports.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; +const utils_1 = require("@typescript-eslint/utils"); +const typescript_1 = require("typescript"); +var OperatorPrecedence; +(function (OperatorPrecedence) { + // Expression: + // AssignmentExpression + // Expression `,` AssignmentExpression + OperatorPrecedence[OperatorPrecedence["Comma"] = 0] = "Comma"; + // NOTE: `Spread` is higher than `Comma` due to how it is parsed in |ElementList| + // SpreadElement: + // `...` AssignmentExpression + OperatorPrecedence[OperatorPrecedence["Spread"] = 1] = "Spread"; + // AssignmentExpression: + // ConditionalExpression + // YieldExpression + // ArrowFunction + // AsyncArrowFunction + // LeftHandSideExpression `=` AssignmentExpression + // LeftHandSideExpression AssignmentOperator AssignmentExpression + // + // NOTE: AssignmentExpression is broken down into several precedences due to the requirements + // of the parenthesize rules. + // AssignmentExpression: YieldExpression + // YieldExpression: + // `yield` + // `yield` AssignmentExpression + // `yield` `*` AssignmentExpression + OperatorPrecedence[OperatorPrecedence["Yield"] = 2] = "Yield"; + // AssignmentExpression: LeftHandSideExpression `=` AssignmentExpression + // AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression + // AssignmentOperator: one of + // `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + OperatorPrecedence[OperatorPrecedence["Assignment"] = 3] = "Assignment"; + // NOTE: `Conditional` is considered higher than `Assignment` here, but in reality they have + // the same precedence. + // AssignmentExpression: ConditionalExpression + // ConditionalExpression: + // ShortCircuitExpression + // ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression + // ShortCircuitExpression: + // LogicalORExpression + // CoalesceExpression + OperatorPrecedence[OperatorPrecedence["Conditional"] = 4] = "Conditional"; + // CoalesceExpression: + // CoalesceExpressionHead `??` BitwiseORExpression + // CoalesceExpressionHead: + // CoalesceExpression + // BitwiseORExpression + OperatorPrecedence[OperatorPrecedence["Coalesce"] = 4] = "Coalesce"; + // LogicalORExpression: + // LogicalANDExpression + // LogicalORExpression `||` LogicalANDExpression + OperatorPrecedence[OperatorPrecedence["LogicalOR"] = 5] = "LogicalOR"; + // LogicalANDExpression: + // BitwiseORExpression + // LogicalANDExpression `&&` BitwiseORExpression + OperatorPrecedence[OperatorPrecedence["LogicalAND"] = 6] = "LogicalAND"; + // BitwiseORExpression: + // BitwiseXORExpression + // BitwiseORExpression `^` BitwiseXORExpression + OperatorPrecedence[OperatorPrecedence["BitwiseOR"] = 7] = "BitwiseOR"; + // BitwiseXORExpression: + // BitwiseANDExpression + // BitwiseXORExpression `^` BitwiseANDExpression + OperatorPrecedence[OperatorPrecedence["BitwiseXOR"] = 8] = "BitwiseXOR"; + // BitwiseANDExpression: + // EqualityExpression + // BitwiseANDExpression `^` EqualityExpression + OperatorPrecedence[OperatorPrecedence["BitwiseAND"] = 9] = "BitwiseAND"; + // EqualityExpression: + // RelationalExpression + // EqualityExpression `==` RelationalExpression + // EqualityExpression `!=` RelationalExpression + // EqualityExpression `===` RelationalExpression + // EqualityExpression `!==` RelationalExpression + OperatorPrecedence[OperatorPrecedence["Equality"] = 10] = "Equality"; + // RelationalExpression: + // ShiftExpression + // RelationalExpression `<` ShiftExpression + // RelationalExpression `>` ShiftExpression + // RelationalExpression `<=` ShiftExpression + // RelationalExpression `>=` ShiftExpression + // RelationalExpression `instanceof` ShiftExpression + // RelationalExpression `in` ShiftExpression + // [+TypeScript] RelationalExpression `as` Type + OperatorPrecedence[OperatorPrecedence["Relational"] = 11] = "Relational"; + // ShiftExpression: + // AdditiveExpression + // ShiftExpression `<<` AdditiveExpression + // ShiftExpression `>>` AdditiveExpression + // ShiftExpression `>>>` AdditiveExpression + OperatorPrecedence[OperatorPrecedence["Shift"] = 12] = "Shift"; + // AdditiveExpression: + // MultiplicativeExpression + // AdditiveExpression `+` MultiplicativeExpression + // AdditiveExpression `-` MultiplicativeExpression + OperatorPrecedence[OperatorPrecedence["Additive"] = 13] = "Additive"; + // MultiplicativeExpression: + // ExponentiationExpression + // MultiplicativeExpression MultiplicativeOperator ExponentiationExpression + // MultiplicativeOperator: one of `*`, `/`, `%` + OperatorPrecedence[OperatorPrecedence["Multiplicative"] = 14] = "Multiplicative"; + // ExponentiationExpression: + // UnaryExpression + // UpdateExpression `**` ExponentiationExpression + OperatorPrecedence[OperatorPrecedence["Exponentiation"] = 15] = "Exponentiation"; + // UnaryExpression: + // UpdateExpression + // `delete` UnaryExpression + // `void` UnaryExpression + // `typeof` UnaryExpression + // `+` UnaryExpression + // `-` UnaryExpression + // `~` UnaryExpression + // `!` UnaryExpression + // AwaitExpression + // UpdateExpression: // TODO: Do we need to investigate the precedence here? + // `++` UnaryExpression + // `--` UnaryExpression + OperatorPrecedence[OperatorPrecedence["Unary"] = 16] = "Unary"; + // UpdateExpression: + // LeftHandSideExpression + // LeftHandSideExpression `++` + // LeftHandSideExpression `--` + OperatorPrecedence[OperatorPrecedence["Update"] = 17] = "Update"; + // LeftHandSideExpression: + // NewExpression + // CallExpression + // NewExpression: + // MemberExpression + // `new` NewExpression + OperatorPrecedence[OperatorPrecedence["LeftHandSide"] = 18] = "LeftHandSide"; + // CallExpression: + // CoverCallExpressionAndAsyncArrowHead + // SuperCall + // ImportCall + // CallExpression Arguments + // CallExpression `[` Expression `]` + // CallExpression `.` IdentifierName + // CallExpression TemplateLiteral + // MemberExpression: + // PrimaryExpression + // MemberExpression `[` Expression `]` + // MemberExpression `.` IdentifierName + // MemberExpression TemplateLiteral + // SuperProperty + // MetaProperty + // `new` MemberExpression Arguments + OperatorPrecedence[OperatorPrecedence["Member"] = 19] = "Member"; + // TODO: JSXElement? + // PrimaryExpression: + // `this` + // IdentifierReference + // Literal + // ArrayLiteral + // ObjectLiteral + // FunctionExpression + // ClassExpression + // GeneratorExpression + // AsyncFunctionExpression + // AsyncGeneratorExpression + // RegularExpressionLiteral + // TemplateLiteral + // CoverParenthesizedExpressionAndArrowParameterList + OperatorPrecedence[OperatorPrecedence["Primary"] = 20] = "Primary"; + OperatorPrecedence[OperatorPrecedence["Highest"] = 20] = "Highest"; + OperatorPrecedence[OperatorPrecedence["Lowest"] = 0] = "Lowest"; + // -1 is lower than all other precedences. Returning it will cause binary expression + // parsing to stop. + OperatorPrecedence[OperatorPrecedence["Invalid"] = -1] = "Invalid"; +})(OperatorPrecedence || (exports.OperatorPrecedence = OperatorPrecedence = {})); +function getOperatorPrecedenceForNode(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.SpreadElement: + case utils_1.AST_NODE_TYPES.RestElement: + return OperatorPrecedence.Spread; + case utils_1.AST_NODE_TYPES.YieldExpression: + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + return OperatorPrecedence.Yield; + case utils_1.AST_NODE_TYPES.ConditionalExpression: + return OperatorPrecedence.Conditional; + case utils_1.AST_NODE_TYPES.SequenceExpression: + return OperatorPrecedence.Comma; + case utils_1.AST_NODE_TYPES.AssignmentExpression: + case utils_1.AST_NODE_TYPES.BinaryExpression: + case utils_1.AST_NODE_TYPES.LogicalExpression: + switch (node.operator) { + case '==': + case '+=': + case '-=': + case '**=': + case '*=': + case '/=': + case '%=': + case '<<=': + case '>>=': + case '>>>=': + case '&=': + case '^=': + case '|=': + case '||=': + case '&&=': + case '??=': + return OperatorPrecedence.Assignment; + default: + return getBinaryOperatorPrecedence(node.operator); + } + case utils_1.AST_NODE_TYPES.TSTypeAssertion: + case utils_1.AST_NODE_TYPES.TSNonNullExpression: + case utils_1.AST_NODE_TYPES.UnaryExpression: + case utils_1.AST_NODE_TYPES.AwaitExpression: + return OperatorPrecedence.Unary; + case utils_1.AST_NODE_TYPES.UpdateExpression: + // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? + if (node.prefix) { + return OperatorPrecedence.Unary; + } + return OperatorPrecedence.Update; + case utils_1.AST_NODE_TYPES.ChainExpression: + return getOperatorPrecedenceForNode(node.expression); + case utils_1.AST_NODE_TYPES.CallExpression: + return OperatorPrecedence.LeftHandSide; + case utils_1.AST_NODE_TYPES.NewExpression: + return node.arguments.length > 0 + ? OperatorPrecedence.Member + : OperatorPrecedence.LeftHandSide; + case utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + case utils_1.AST_NODE_TYPES.MemberExpression: + case utils_1.AST_NODE_TYPES.MetaProperty: + return OperatorPrecedence.Member; + case utils_1.AST_NODE_TYPES.TSAsExpression: + return OperatorPrecedence.Relational; + case utils_1.AST_NODE_TYPES.ThisExpression: + case utils_1.AST_NODE_TYPES.Super: + case utils_1.AST_NODE_TYPES.Identifier: + case utils_1.AST_NODE_TYPES.PrivateIdentifier: + case utils_1.AST_NODE_TYPES.Literal: + case utils_1.AST_NODE_TYPES.ArrayExpression: + case utils_1.AST_NODE_TYPES.ObjectExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.ClassExpression: + case utils_1.AST_NODE_TYPES.TemplateLiteral: + case utils_1.AST_NODE_TYPES.JSXElement: + case utils_1.AST_NODE_TYPES.JSXFragment: + // we don't have nodes for these cases + // case SyntaxKind.ParenthesizedExpression: + // case SyntaxKind.OmittedExpression: + return OperatorPrecedence.Primary; + default: + return OperatorPrecedence.Invalid; + } +} +function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { + switch (nodeKind) { + // A list of comma-separated expressions. This node is only created by transformations. + case typescript_1.SyntaxKind.CommaListExpression: + return OperatorPrecedence.Comma; + case typescript_1.SyntaxKind.SpreadElement: + return OperatorPrecedence.Spread; + case typescript_1.SyntaxKind.YieldExpression: + return OperatorPrecedence.Yield; + case typescript_1.SyntaxKind.ConditionalExpression: + return OperatorPrecedence.Conditional; + case typescript_1.SyntaxKind.BinaryExpression: + switch (operatorKind) { + case typescript_1.SyntaxKind.AmpersandAmpersandEqualsToken: + case typescript_1.SyntaxKind.AmpersandEqualsToken: + case typescript_1.SyntaxKind.AsteriskAsteriskEqualsToken: + case typescript_1.SyntaxKind.AsteriskEqualsToken: + case typescript_1.SyntaxKind.BarBarEqualsToken: + case typescript_1.SyntaxKind.BarEqualsToken: + case typescript_1.SyntaxKind.CaretEqualsToken: + case typescript_1.SyntaxKind.EqualsToken: + case typescript_1.SyntaxKind.GreaterThanGreaterThanEqualsToken: + case typescript_1.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case typescript_1.SyntaxKind.LessThanLessThanEqualsToken: + case typescript_1.SyntaxKind.MinusEqualsToken: + case typescript_1.SyntaxKind.PercentEqualsToken: + case typescript_1.SyntaxKind.PlusEqualsToken: + case typescript_1.SyntaxKind.QuestionQuestionEqualsToken: + case typescript_1.SyntaxKind.SlashEqualsToken: + return OperatorPrecedence.Assignment; + case typescript_1.SyntaxKind.CommaToken: + return OperatorPrecedence.Comma; + default: + return getBinaryOperatorPrecedence(operatorKind); + } + // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? + case typescript_1.SyntaxKind.TypeAssertionExpression: + case typescript_1.SyntaxKind.NonNullExpression: + case typescript_1.SyntaxKind.PrefixUnaryExpression: + case typescript_1.SyntaxKind.TypeOfExpression: + case typescript_1.SyntaxKind.VoidExpression: + case typescript_1.SyntaxKind.DeleteExpression: + case typescript_1.SyntaxKind.AwaitExpression: + return OperatorPrecedence.Unary; + case typescript_1.SyntaxKind.PostfixUnaryExpression: + return OperatorPrecedence.Update; + case typescript_1.SyntaxKind.CallExpression: + return OperatorPrecedence.LeftHandSide; + case typescript_1.SyntaxKind.NewExpression: + return hasArguments + ? OperatorPrecedence.Member + : OperatorPrecedence.LeftHandSide; + case typescript_1.SyntaxKind.TaggedTemplateExpression: + case typescript_1.SyntaxKind.PropertyAccessExpression: + case typescript_1.SyntaxKind.ElementAccessExpression: + case typescript_1.SyntaxKind.MetaProperty: + return OperatorPrecedence.Member; + case typescript_1.SyntaxKind.AsExpression: + case typescript_1.SyntaxKind.SatisfiesExpression: + return OperatorPrecedence.Relational; + case typescript_1.SyntaxKind.ThisKeyword: + case typescript_1.SyntaxKind.SuperKeyword: + case typescript_1.SyntaxKind.Identifier: + case typescript_1.SyntaxKind.PrivateIdentifier: + case typescript_1.SyntaxKind.NullKeyword: + case typescript_1.SyntaxKind.TrueKeyword: + case typescript_1.SyntaxKind.FalseKeyword: + case typescript_1.SyntaxKind.NumericLiteral: + case typescript_1.SyntaxKind.BigIntLiteral: + case typescript_1.SyntaxKind.StringLiteral: + case typescript_1.SyntaxKind.ArrayLiteralExpression: + case typescript_1.SyntaxKind.ObjectLiteralExpression: + case typescript_1.SyntaxKind.FunctionExpression: + case typescript_1.SyntaxKind.ArrowFunction: + case typescript_1.SyntaxKind.ClassExpression: + case typescript_1.SyntaxKind.RegularExpressionLiteral: + case typescript_1.SyntaxKind.NoSubstitutionTemplateLiteral: + case typescript_1.SyntaxKind.TemplateExpression: + case typescript_1.SyntaxKind.ParenthesizedExpression: + case typescript_1.SyntaxKind.OmittedExpression: + case typescript_1.SyntaxKind.JsxElement: + case typescript_1.SyntaxKind.JsxSelfClosingElement: + case typescript_1.SyntaxKind.JsxFragment: + return OperatorPrecedence.Primary; + default: + return OperatorPrecedence.Invalid; + } +} +function getBinaryOperatorPrecedence(kind) { + switch (kind) { + case '-': + case '+': + case typescript_1.SyntaxKind.MinusToken: + case typescript_1.SyntaxKind.PlusToken: + return OperatorPrecedence.Additive; + case '!=': + case '!==': + case '==': + case '===': + case typescript_1.SyntaxKind.EqualsEqualsEqualsToken: + case typescript_1.SyntaxKind.EqualsEqualsToken: + case typescript_1.SyntaxKind.ExclamationEqualsEqualsToken: + case typescript_1.SyntaxKind.ExclamationEqualsToken: + return OperatorPrecedence.Equality; + case '??': + case typescript_1.SyntaxKind.QuestionQuestionToken: + return OperatorPrecedence.Coalesce; + case '*': + case '/': + case '%': + case typescript_1.SyntaxKind.AsteriskToken: + case typescript_1.SyntaxKind.PercentToken: + case typescript_1.SyntaxKind.SlashToken: + return OperatorPrecedence.Multiplicative; + case '**': + case typescript_1.SyntaxKind.AsteriskAsteriskToken: + return OperatorPrecedence.Exponentiation; + case '&': + case typescript_1.SyntaxKind.AmpersandToken: + return OperatorPrecedence.BitwiseAND; + case '&&': + case typescript_1.SyntaxKind.AmpersandAmpersandToken: + return OperatorPrecedence.LogicalAND; + case '^': + case typescript_1.SyntaxKind.CaretToken: + return OperatorPrecedence.BitwiseXOR; + case '<': + case '<=': + case '>': + case '>=': + case 'in': + case 'instanceof': + case typescript_1.SyntaxKind.AsKeyword: + case typescript_1.SyntaxKind.GreaterThanEqualsToken: + case typescript_1.SyntaxKind.GreaterThanToken: + case typescript_1.SyntaxKind.InKeyword: + case typescript_1.SyntaxKind.InstanceOfKeyword: + case typescript_1.SyntaxKind.LessThanEqualsToken: + case typescript_1.SyntaxKind.LessThanToken: + // case 'as': -- we don't have a token for this + return OperatorPrecedence.Relational; + case '<<': + case '>>': + case '>>>': + case typescript_1.SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case typescript_1.SyntaxKind.GreaterThanGreaterThanToken: + case typescript_1.SyntaxKind.LessThanLessThanToken: + return OperatorPrecedence.Shift; + case '|': + case typescript_1.SyntaxKind.BarToken: + return OperatorPrecedence.BitwiseOR; + case '||': + case typescript_1.SyntaxKind.BarBarToken: + return OperatorPrecedence.LogicalOR; + } + // -1 is lower than all other precedences. Returning it will cause binary expression + // parsing to stop. + return -1; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.d.ts.map new file mode 100644 index 0000000..4c8c236 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getParentFunctionNode.d.ts","sourceRoot":"","sources":["../../src/util/getParentFunctionNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAEjB,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,GAC3B,IAAI,CAiBP"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.js new file mode 100644 index 0000000..fba2413 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getParentFunctionNode = getParentFunctionNode; +const utils_1 = require("@typescript-eslint/utils"); +function getParentFunctionNode(node) { + let current = node.parent; + while (current) { + if (current.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + current.type === utils_1.AST_NODE_TYPES.FunctionDeclaration || + current.type === utils_1.AST_NODE_TYPES.FunctionExpression) { + return current; + } + current = current.parent; + } + // this shouldn't happen in correct code, but someone may attempt to parse bad code + // the parser won't error, so we shouldn't throw here + /* istanbul ignore next */ return null; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.d.ts.map new file mode 100644 index 0000000..bc45f3d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getStaticStringValue.d.ts","sourceRoot":"","sources":["../../src/util/getStaticStringValue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAMzD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,CAgCvE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.js new file mode 100644 index 0000000..e7ecd11 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.js @@ -0,0 +1,44 @@ +"use strict"; +// adapted from https://github.com/eslint/eslint/blob/5bdaae205c3a0089ea338b382df59e21d5b06436/lib/rules/utils/ast-utils.js#L191-L230 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStaticStringValue = getStaticStringValue; +const utils_1 = require("@typescript-eslint/utils"); +const isNullLiteral_1 = require("./isNullLiteral"); +/** + * Returns the result of the string conversion applied to the evaluated value of the given expression node, + * if it can be determined statically. + * + * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only. + * In all other cases, this function returns `null`. + * @param node Expression node. + * @returns String value if it can be determined. Otherwise, `null`. + */ +function getStaticStringValue(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.Literal: + // eslint-disable-next-line eqeqeq, @typescript-eslint/internal/eqeq-nullish -- intentional strict comparison for literal value + if (node.value === null) { + if ((0, isNullLiteral_1.isNullLiteral)(node)) { + return String(node.value); // "null" + } + if ('regex' in node) { + return `/${node.regex.pattern}/${node.regex.flags}`; + } + if ('bigint' in node) { + return node.bigint; + } + // Otherwise, this is an unknown literal. The function will return null. + } + else { + return String(node.value); + } + break; + case utils_1.AST_NODE_TYPES.TemplateLiteral: + if (node.expressions.length === 0 && node.quasis.length === 1) { + return node.quasis[0].value.cooked; + } + break; + // no default + } + return null; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.d.ts.map new file mode 100644 index 0000000..fc912d9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getStringLength.d.ts","sourceRoot":"","sources":["../../src/util/getStringLength.ts"],"names":[],"mappings":"AAQA,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQrD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.js new file mode 100644 index 0000000..c65dc7e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.js @@ -0,0 +1,18 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStringLength = getStringLength; +const graphemer_1 = __importDefault(require("graphemer")); +let splitter; +function isASCII(value) { + return /^[\u0020-\u007f]*$/u.test(value); +} +function getStringLength(value) { + if (isASCII(value)) { + return value.length; + } + splitter ??= new graphemer_1.default(); + return splitter.countGraphemes(value); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.d.ts.map new file mode 100644 index 0000000..caab081 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getTextWithParentheses.d.ts","sourceRoot":"","sources":["../../src/util/getTextWithParentheses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAUrE,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAChC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,MAAM,CAoBR"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.js new file mode 100644 index 0000000..bcdd7d0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTextWithParentheses = getTextWithParentheses; +const _1 = require("."); +function getTextWithParentheses(sourceCode, node) { + // Capture parentheses before and after the node + let beforeCount = 0; + let afterCount = 0; + if ((0, _1.isParenthesized)(node, sourceCode)) { + const bodyOpeningParen = (0, _1.nullThrows)(sourceCode.getTokenBefore(node, _1.isOpeningParenToken), _1.NullThrowsReasons.MissingToken('(', 'node')); + const bodyClosingParen = (0, _1.nullThrows)(sourceCode.getTokenAfter(node, _1.isClosingParenToken), _1.NullThrowsReasons.MissingToken(')', 'node')); + beforeCount = node.range[0] - bodyOpeningParen.range[0]; + afterCount = bodyClosingParen.range[1] - node.range[1]; + } + return sourceCode.getText(node, beforeCount, afterCount); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.d.ts.map new file mode 100644 index 0000000..668b172 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getThisExpression.d.ts","sourceRoot":"","sources":["../../src/util/getThisExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,QAAQ,CAAC,cAAc,GAAG,SAAS,CAgBrC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.js new file mode 100644 index 0000000..c0beac1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getThisExpression = getThisExpression; +const utils_1 = require("@typescript-eslint/utils"); +function getThisExpression(node) { + while (true) { + if (node.type === utils_1.AST_NODE_TYPES.CallExpression) { + node = node.callee; + } + else if (node.type === utils_1.AST_NODE_TYPES.ThisExpression) { + return node; + } + else if (node.type === utils_1.AST_NODE_TYPES.MemberExpression) { + node = node.object; + } + else if (node.type === utils_1.AST_NODE_TYPES.ChainExpression) { + node = node.expression; + } + else { + break; + } + } + return; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.d.ts.map new file mode 100644 index 0000000..b7aca83 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getValueOfLiteralType.d.ts","sourceRoot":"","sources":["../../src/util/getValueOfLiteralType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAYtC,eAAO,MAAM,qBAAqB,GAChC,MAAM,EAAE,CAAC,WAAW,KACnB,MAAM,GAAG,MAAM,GAAG,MAKpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.js new file mode 100644 index 0000000..7d5889b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getValueOfLiteralType = void 0; +const valueIsPseudoBigInt = (value) => { + return typeof value === 'object'; +}; +const pseudoBigIntToBigInt = (value) => { + return BigInt((value.negative ? '-' : '') + value.base10Value); +}; +const getValueOfLiteralType = (type) => { + if (valueIsPseudoBigInt(type.value)) { + return pseudoBigIntToBigInt(type.value); + } + return type.value; +}; +exports.getValueOfLiteralType = getValueOfLiteralType; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.d.ts.map new file mode 100644 index 0000000..65ccee0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getWrappedCode.d.ts","sourceRoot":"","sources":["../../src/util/getWrappedCode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,kBAAkB,GACnC,MAAM,CAER"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.js new file mode 100644 index 0000000..e098b8c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getWrappedCode = getWrappedCode; +function getWrappedCode(text, nodePrecedence, parentPrecedence) { + return nodePrecedence > parentPrecedence ? text : `(${text})`; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.d.ts.map new file mode 100644 index 0000000..66cdc5a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getWrappingFixer.d.ts","sourceRoot":"","sources":["../../src/util/getWrappingFixer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQnE,UAAU,mBAAmB;IAC3B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC5C,kCAAkC;IAClC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,mBAAmB;IACnB,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC1C;;;;OAIG;IACH,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,mBAAmB,GAC1B,QAAQ,CAAC,iBAAiB,CA2C5B;AACD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC;IAC/B,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC;IAC1B,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;CAC3C,GAAG,MAAM,CAeT;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAcxE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js new file mode 100644 index 0000000..300bc5f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js @@ -0,0 +1,181 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getWrappingFixer = getWrappingFixer; +exports.getMovedNodeCode = getMovedNodeCode; +exports.isStrongPrecedenceNode = isStrongPrecedenceNode; +const utils_1 = require("@typescript-eslint/utils"); +/** + * Wraps node with some code. Adds parenthesis as necessary. + * @returns Fixer which adds the specified code and parens if necessary. + */ +function getWrappingFixer(params) { + const { node, innerNode = node, sourceCode, wrap } = params; + const innerNodes = Array.isArray(innerNode) ? innerNode : [innerNode]; + return (fixer) => { + const innerCodes = innerNodes.map(innerNode => { + let code = sourceCode.getText(innerNode); + /** + * Wrap our node in parens to prevent the following cases: + * - It has a weaker precedence than the code we are wrapping it in + * - It's gotten mistaken as block statement instead of object expression + */ + if (!isStrongPrecedenceNode(innerNode) || + isObjectExpressionInOneLineReturn(node, innerNode)) { + code = `(${code})`; + } + return code; + }); + // do the wrapping + let code = wrap(...innerCodes); + // check the outer expression's precedence + if (isWeakPrecedenceParent(node) && + // we wrapped the node in some expression which very likely has a different precedence than original wrapped node + // let's wrap the whole expression in parens just in case + !utils_1.ASTUtils.isParenthesized(node, sourceCode)) { + code = `(${code})`; + } + // check if we need to insert semicolon + if (/^[`([]/.test(code) && isMissingSemicolonBefore(node, sourceCode)) { + code = `;${code}`; + } + return fixer.replaceText(node, code); + }; +} +/** + * If the node to be moved and the destination node require parentheses, include parentheses in the node to be moved. + * @param sourceCode Source code of current file + * @param nodeToMove Nodes that need to be moved + * @param destinationNode Final destination node with nodeToMove + * @returns If parentheses are required, code for the nodeToMove node is returned with parentheses at both ends of the code. + */ +function getMovedNodeCode(params) { + const { destinationNode, nodeToMove: existingNode, sourceCode } = params; + const code = sourceCode.getText(existingNode); + if (isStrongPrecedenceNode(existingNode)) { + // Moved node never needs parens + return code; + } + if (!isWeakPrecedenceParent(destinationNode)) { + // Destination would never needs parens, regardless what node moves there + return code; + } + // Parens may be necessary + return `(${code})`; +} +/** + * Check if a node will always have the same precedence if it's parent changes. + */ +function isStrongPrecedenceNode(innerNode) { + return (innerNode.type === utils_1.AST_NODE_TYPES.Literal || + innerNode.type === utils_1.AST_NODE_TYPES.Identifier || + innerNode.type === utils_1.AST_NODE_TYPES.TSTypeReference || + innerNode.type === utils_1.AST_NODE_TYPES.TSTypeOperator || + innerNode.type === utils_1.AST_NODE_TYPES.ArrayExpression || + innerNode.type === utils_1.AST_NODE_TYPES.ObjectExpression || + innerNode.type === utils_1.AST_NODE_TYPES.MemberExpression || + innerNode.type === utils_1.AST_NODE_TYPES.CallExpression || + innerNode.type === utils_1.AST_NODE_TYPES.NewExpression || + innerNode.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression || + innerNode.type === utils_1.AST_NODE_TYPES.TSInstantiationExpression); +} +/** + * Check if a node's parent could have different precedence if the node changes. + */ +function isWeakPrecedenceParent(node) { + const parent = node.parent; + if (!parent) { + return false; + } + if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression || + parent.type === utils_1.AST_NODE_TYPES.UnaryExpression || + parent.type === utils_1.AST_NODE_TYPES.BinaryExpression || + parent.type === utils_1.AST_NODE_TYPES.LogicalExpression || + parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression || + parent.type === utils_1.AST_NODE_TYPES.AwaitExpression) { + return true; + } + if (parent.type === utils_1.AST_NODE_TYPES.MemberExpression && + parent.object === node) { + return true; + } + if ((parent.type === utils_1.AST_NODE_TYPES.CallExpression || + parent.type === utils_1.AST_NODE_TYPES.NewExpression) && + parent.callee === node) { + return true; + } + if (parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression && + parent.tag === node) { + return true; + } + return false; +} +/** + * Returns true if a node is at the beginning of expression statement and the statement above doesn't end with semicolon. + * Doesn't check if the node begins with `(`, `[` or `` ` ``. + */ +function isMissingSemicolonBefore(node, sourceCode) { + for (;;) { + // https://github.com/typescript-eslint/typescript-eslint/issues/6225 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const parent = node.parent; + if (parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + const block = parent.parent; + if (block.type === utils_1.AST_NODE_TYPES.Program || + block.type === utils_1.AST_NODE_TYPES.BlockStatement) { + // parent is an expression statement in a block + const statementIndex = block.body.indexOf(parent); + const previousStatement = block.body[statementIndex - 1]; + if (statementIndex > 0 && + utils_1.ESLintUtils.nullThrows(sourceCode.getLastToken(previousStatement), 'Mismatched semicolon and block').value !== ';') { + return true; + } + } + } + if (!isLeftHandSide(node)) { + return false; + } + node = parent; + } +} +/** + * Checks if a node is LHS of an operator. + */ +function isLeftHandSide(node) { + // https://github.com/typescript-eslint/typescript-eslint/issues/6225 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const parent = node.parent; + // a++ + if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression) { + return true; + } + // a + b + if ((parent.type === utils_1.AST_NODE_TYPES.BinaryExpression || + parent.type === utils_1.AST_NODE_TYPES.LogicalExpression || + parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression) && + node === parent.left) { + return true; + } + // a ? b : c + if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + node === parent.test) { + return true; + } + // a(b) + if (parent.type === utils_1.AST_NODE_TYPES.CallExpression && node === parent.callee) { + return true; + } + // a`b` + if (parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression && + node === parent.tag) { + return true; + } + return false; +} +/** + * Checks if a node's parent is arrow function expression and a inner node is object expression + */ +function isObjectExpressionInOneLineReturn(node, innerNode) { + return (node.parent?.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.parent.body === node && + innerNode.type === utils_1.AST_NODE_TYPES.ObjectExpression); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.d.ts.map new file mode 100644 index 0000000..64bbe50 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hasOverloadSignatures.d.ts","sourceRoot":"","sources":["../../src/util/hasOverloadSignatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAMtE;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,QAAQ,CAAC,mBAAmB,GAAG,QAAQ,CAAC,gBAAgB,EAC9D,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GACtC,OAAO,CAqCT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.js new file mode 100644 index 0000000..0211766 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasOverloadSignatures = hasOverloadSignatures; +const utils_1 = require("@typescript-eslint/utils"); +const misc_1 = require("./misc"); +/** + * @return `true` if the function or method node has overload signatures. + */ +function hasOverloadSignatures(node, context) { + // `export default function () {}` + if (node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration) { + return node.parent.parent.body.some(member => { + return (member.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration && + member.declaration.type === utils_1.AST_NODE_TYPES.TSDeclareFunction); + }); + } + // `export function f() {}` + if (node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) { + return node.parent.parent.body.some(member => { + return (member.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration && + member.declaration?.type === utils_1.AST_NODE_TYPES.TSDeclareFunction && + getFunctionDeclarationName(member.declaration, context) === + getFunctionDeclarationName(node, context)); + }); + } + // either: + // - `function f() {}` + // - `class T { foo() {} }` + const nodeKey = getFunctionDeclarationName(node, context); + return node.parent.body.some(member => { + return ((member.type === utils_1.AST_NODE_TYPES.TSDeclareFunction || + (member.type === utils_1.AST_NODE_TYPES.MethodDefinition && + member.value.body == null)) && + nodeKey === getFunctionDeclarationName(member, context)); + }); +} +function getFunctionDeclarationName(node, context) { + if (node.type === utils_1.AST_NODE_TYPES.FunctionDeclaration || + node.type === utils_1.AST_NODE_TYPES.TSDeclareFunction) { + // For a `FunctionDeclaration` or `TSDeclareFunction` this may be `null` if + // and only if the parent is an `ExportDefaultDeclaration`. + // + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return node.id.name; + } + return (0, misc_1.getStaticMemberAccessValue)(node, context); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.d.ts.map new file mode 100644 index 0000000..baa0eaa --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAG5C,cAAc,+BAA+B,CAAC;AAE9C,eAAO,MACL,YAAY,mCACZ,SAAS,gCACT,iBAAiB,wCACjB,gBAAgB,uCAChB,UAAU,iCACV,iBAAiB;;;CACJ,CAAC;AAChB,MAAM,MAAM,2BAA2B,CAAC,CAAC,IACvC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;AAC7C,MAAM,MAAM,wBAAwB,CAAC,CAAC,IACpC,WAAW,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js new file mode 100644 index 0000000..aec7c1b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js @@ -0,0 +1,50 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NullThrowsReasons = exports.nullThrows = exports.isObjectNotArray = exports.getParserServices = exports.deepMerge = exports.applyDefault = void 0; +const utils_1 = require("@typescript-eslint/utils"); +__exportStar(require("./astUtils"), exports); +__exportStar(require("./collectUnusedVariables"), exports); +__exportStar(require("./createRule"), exports); +__exportStar(require("./getFixOrSuggest"), exports); +__exportStar(require("./getFunctionHeadLoc"), exports); +__exportStar(require("./getOperatorPrecedence"), exports); +__exportStar(require("./getStaticStringValue"), exports); +__exportStar(require("./getStringLength"), exports); +__exportStar(require("./getTextWithParentheses"), exports); +__exportStar(require("./getThisExpression"), exports); +__exportStar(require("./getWrappingFixer"), exports); +__exportStar(require("./hasOverloadSignatures"), exports); +__exportStar(require("./isArrayMethodCallWithPredicate"), exports); +__exportStar(require("./isAssignee"), exports); +__exportStar(require("./isNodeEqual"), exports); +__exportStar(require("./isNullLiteral"), exports); +__exportStar(require("./isStartOfExpressionStatement"), exports); +__exportStar(require("./isUndefinedIdentifier"), exports); +__exportStar(require("./misc"), exports); +__exportStar(require("./needsPrecedingSemiColon"), exports); +__exportStar(require("./objectIterators"), exports); +__exportStar(require("./needsToBeAwaited"), exports); +__exportStar(require("./scopeUtils"), exports); +__exportStar(require("./types"), exports); +__exportStar(require("./getConstraintInfo"), exports); +__exportStar(require("./getValueOfLiteralType"), exports); +__exportStar(require("./isHigherPrecedenceThanAwait"), exports); +__exportStar(require("./skipChainExpression"), exports); +__exportStar(require("./truthinessAndNullishUtils"), exports); +// this is done for convenience - saves migrating all of the old rules +__exportStar(require("@typescript-eslint/type-utils"), exports); +exports.applyDefault = utils_1.ESLintUtils.applyDefault, exports.deepMerge = utils_1.ESLintUtils.deepMerge, exports.getParserServices = utils_1.ESLintUtils.getParserServices, exports.isObjectNotArray = utils_1.ESLintUtils.isObjectNotArray, exports.nullThrows = utils_1.ESLintUtils.nullThrows, exports.NullThrowsReasons = utils_1.ESLintUtils.NullThrowsReasons; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.d.ts.map new file mode 100644 index 0000000..29f33b2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isArrayMethodCallWithPredicate.d.ts","sourceRoot":"","sources":["../../src/util/isArrayMethodCallWithPredicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAkBtE,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EACvC,QAAQ,EAAE,iCAAiC,EAC3C,IAAI,EAAE,QAAQ,CAAC,cAAc,GAC5B,OAAO,CAiBT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.js new file mode 100644 index 0000000..a5de596 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.js @@ -0,0 +1,64 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isArrayMethodCallWithPredicate = isArrayMethodCallWithPredicate; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const misc_1 = require("./misc"); +const ARRAY_PREDICATE_FUNCTIONS = new Set([ + 'every', + 'filter', + 'find', + 'findIndex', + 'findLast', + 'findLastIndex', + 'some', +]); +function isArrayMethodCallWithPredicate(context, services, node) { + if (node.callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return false; + } + const staticAccessValue = (0, misc_1.getStaticMemberAccessValue)(node.callee, context); + if (!ARRAY_PREDICATE_FUNCTIONS.has(staticAccessValue)) { + return false; + } + const checker = services.program.getTypeChecker(); + const type = (0, type_utils_1.getConstrainedTypeAtLocation)(services, node.callee.object); + return tsutils + .unionTypeParts(type) + .flatMap(part => tsutils.intersectionTypeParts(part)) + .some(t => checker.isArrayType(t) || checker.isTupleType(t)); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.d.ts.map new file mode 100644 index 0000000..6f61e4a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isAssignee.d.ts","sourceRoot":"","sources":["../../src/util/isAssignee.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAoDvD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.js new file mode 100644 index 0000000..c87b16f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isAssignee = isAssignee; +const utils_1 = require("@typescript-eslint/utils"); +function isAssignee(node) { + const parent = node.parent; + if (!parent) { + return false; + } + // a[i] = 1, a[i] += 1, etc. + if (parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + parent.left === node) { + return true; + } + // delete a[i] + if (parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + parent.operator === 'delete' && + parent.argument === node) { + return true; + } + // a[i]++, --a[i], etc. + if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression && + parent.argument === node) { + return true; + } + // [a[i]] = [0] + if (parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + return true; + } + // [...a[i]] = [0] + if (parent.type === utils_1.AST_NODE_TYPES.RestElement) { + return true; + } + // ({ foo: a[i] }) = { foo: 0 } + if (parent.type === utils_1.AST_NODE_TYPES.Property && + parent.value === node && + parent.parent.type === utils_1.AST_NODE_TYPES.ObjectExpression && + isAssignee(parent.parent)) { + return true; + } + return false; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.d.ts.map new file mode 100644 index 0000000..4b9cd5c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isHigherPrecedenceThanAwait.d.ts","sourceRoot":"","sources":["../../src/util/isHigherPrecedenceThanAwait.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAUpE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.js new file mode 100644 index 0000000..a2e7dc4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.js @@ -0,0 +1,46 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isHigherPrecedenceThanAwait = isHigherPrecedenceThanAwait; +const ts = __importStar(require("typescript")); +const getOperatorPrecedence_1 = require("./getOperatorPrecedence"); +function isHigherPrecedenceThanAwait(tsNode) { + const operator = ts.isBinaryExpression(tsNode) + ? tsNode.operatorToken.kind + : ts.SyntaxKind.Unknown; + const nodePrecedence = (0, getOperatorPrecedence_1.getOperatorPrecedence)(tsNode.kind, operator); + const awaitPrecedence = (0, getOperatorPrecedence_1.getOperatorPrecedence)(ts.SyntaxKind.AwaitExpression, ts.SyntaxKind.Unknown); + return nodePrecedence > awaitPrecedence; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.d.ts.map new file mode 100644 index 0000000..d6ace84 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isNodeEqual.d.ts","sourceRoot":"","sources":["../../src/util/isNodeEqual.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CA4BvE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js new file mode 100644 index 0000000..3f98024 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isNodeEqual = isNodeEqual; +const utils_1 = require("@typescript-eslint/utils"); +function isNodeEqual(a, b) { + if (a.type !== b.type) { + return false; + } + if (a.type === utils_1.AST_NODE_TYPES.ThisExpression && + b.type === utils_1.AST_NODE_TYPES.ThisExpression) { + return true; + } + if (a.type === utils_1.AST_NODE_TYPES.Literal && b.type === utils_1.AST_NODE_TYPES.Literal) { + return a.value === b.value; + } + if (a.type === utils_1.AST_NODE_TYPES.Identifier && + b.type === utils_1.AST_NODE_TYPES.Identifier) { + return a.name === b.name; + } + if (a.type === utils_1.AST_NODE_TYPES.MemberExpression && + b.type === utils_1.AST_NODE_TYPES.MemberExpression) { + return (isNodeEqual(a.property, b.property) && isNodeEqual(a.object, b.object)); + } + return false; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.d.ts.map new file mode 100644 index 0000000..3eac91a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isNullLiteral.d.ts","sourceRoot":"","sources":["../../src/util/isNullLiteral.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,GAAG,CAAC,IAAI,QAAQ,CAAC,WAAW,CAEzE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js new file mode 100644 index 0000000..e9a7921 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isNullLiteral = isNullLiteral; +const utils_1 = require("@typescript-eslint/utils"); +function isNullLiteral(i) { + return i.type === utils_1.AST_NODE_TYPES.Literal && i.value == null; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.d.ts.map new file mode 100644 index 0000000..95eb210 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isStartOfExpressionStatement.d.ts","sourceRoot":"","sources":["../../src/util/isStartOfExpressionStatement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOzD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAUzE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.js new file mode 100644 index 0000000..cdaf7e5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isStartOfExpressionStatement = isStartOfExpressionStatement; +const utils_1 = require("@typescript-eslint/utils"); +// The following is copied from `eslint`'s source code. +// https://github.com/eslint/eslint/blob/3a4eaf921543b1cd5d1df4ea9dec02fab396af2a/lib/rules/utils/ast-utils.js#L1026-L1041 +// Could be export { isStartOfExpressionStatement } from 'eslint/lib/rules/utils/ast-utils' +/** + * Tests if a node appears at the beginning of an ancestor ExpressionStatement node. + * @param node The node to check. + * @returns Whether the node appears at the beginning of an ancestor ExpressionStatement node. + */ +function isStartOfExpressionStatement(node) { + const start = node.range[0]; + let ancestor = node; + while ((ancestor = ancestor.parent) && ancestor.range[0] === start) { + if (ancestor.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + return true; + } + } + return false; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.d.ts.map new file mode 100644 index 0000000..59e50e4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isTypeImport.d.ts","sourceRoot":"","sources":["../../src/util/isTypeImport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,uBAAuB,EACxB,MAAM,kCAAkC,CAAC;AAK1C;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,UAAU,CAAC,EAAE,UAAU,GACtB,UAAU,IAAI,uBAAuB,CAOvC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.js new file mode 100644 index 0000000..1baae10 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTypeImport = isTypeImport; +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +/** + * Determine whether a variable definition is a type import. e.g.: + * + * ```ts + * import type { Foo } from 'foo'; + * import { type Bar } from 'bar'; + * ``` + * + * @param definition - The variable definition to check. + */ +function isTypeImport(definition) { + return (definition?.type === scope_manager_1.DefinitionType.ImportBinding && + (definition.parent.importKind === 'type' || + (definition.node.type === utils_1.AST_NODE_TYPES.ImportSpecifier && + definition.node.importKind === 'type'))); +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.d.ts.map new file mode 100644 index 0000000..28d6b9f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isUndefinedIdentifier.d.ts","sourceRoot":"","sources":["../../src/util/isUndefinedIdentifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAE/D"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js new file mode 100644 index 0000000..e43bf37 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isUndefinedIdentifier = isUndefinedIdentifier; +const utils_1 = require("@typescript-eslint/utils"); +function isUndefinedIdentifier(i) { + return i.type === utils_1.AST_NODE_TYPES.Identifier && i.name === 'undefined'; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.d.ts.map new file mode 100644 index 0000000..2762004 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/util/misc.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js new file mode 100644 index 0000000..8961aea --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js @@ -0,0 +1,273 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isStaticMemberAccessOfValue = exports.MemberNameType = void 0; +exports.isDefinitionFile = isDefinitionFile; +exports.upperCaseFirst = upperCaseFirst; +exports.arrayGroupByToMap = arrayGroupByToMap; +exports.arraysAreEqual = arraysAreEqual; +exports.findFirstResult = findFirstResult; +exports.getNameFromIndexSignature = getNameFromIndexSignature; +exports.getNameFromMember = getNameFromMember; +exports.getEnumNames = getEnumNames; +exports.formatWordList = formatWordList; +exports.findLastIndex = findLastIndex; +exports.typeNodeRequiresParentheses = typeNodeRequiresParentheses; +exports.isRestParameterDeclaration = isRestParameterDeclaration; +exports.isParenlessArrowFunction = isParenlessArrowFunction; +exports.getStaticMemberAccessValue = getStaticMemberAccessValue; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const astUtils_1 = require("./astUtils"); +const DEFINITION_EXTENSIONS = [ + ts.Extension.Dts, + ts.Extension.Dcts, + ts.Extension.Dmts, +]; +/** + * Check if the context file name is *.d.ts or *.d.tsx + */ +function isDefinitionFile(fileName) { + const lowerFileName = fileName.toLowerCase(); + for (const definitionExt of DEFINITION_EXTENSIONS) { + if (lowerFileName.endsWith(definitionExt)) { + return true; + } + } + return false; +} +/** + * Upper cases the first character or the string + */ +function upperCaseFirst(str) { + return str[0].toUpperCase() + str.slice(1); +} +function arrayGroupByToMap(array, getKey) { + const groups = new Map(); + for (const item of array) { + const key = getKey(item); + const existing = groups.get(key); + if (existing) { + existing.push(item); + } + else { + groups.set(key, [item]); + } + } + return groups; +} +function arraysAreEqual(a, b, eq) { + return (a === b || + (a != null && + b != null && + a.length === b.length && + a.every((x, idx) => eq(x, b[idx])))); +} +/** Returns the first non-`undefined` result. */ +function findFirstResult(inputs, getResult) { + for (const element of inputs) { + const result = getResult(element); + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + if (result !== undefined) { + return result; + } + } + return undefined; +} +/** + * Gets a string representation of the name of the index signature. + */ +function getNameFromIndexSignature(node) { + const propName = node.parameters.find((parameter) => parameter.type === utils_1.AST_NODE_TYPES.Identifier); + return propName ? propName.name : '(index signature)'; +} +var MemberNameType; +(function (MemberNameType) { + MemberNameType[MemberNameType["Private"] = 1] = "Private"; + MemberNameType[MemberNameType["Quoted"] = 2] = "Quoted"; + MemberNameType[MemberNameType["Normal"] = 3] = "Normal"; + MemberNameType[MemberNameType["Expression"] = 4] = "Expression"; +})(MemberNameType || (exports.MemberNameType = MemberNameType = {})); +/** + * Gets a string name representation of the name of the given MethodDefinition + * or PropertyDefinition node, with handling for computed property names. + */ +function getNameFromMember(member, sourceCode) { + if (member.key.type === utils_1.AST_NODE_TYPES.Identifier) { + return { + name: member.key.name, + type: MemberNameType.Normal, + }; + } + if (member.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + return { + name: `#${member.key.name}`, + type: MemberNameType.Private, + }; + } + if (member.key.type === utils_1.AST_NODE_TYPES.Literal) { + const name = `${member.key.value}`; + if ((0, type_utils_1.requiresQuoting)(name)) { + return { + name: `"${name}"`, + type: MemberNameType.Quoted, + }; + } + return { + name, + type: MemberNameType.Normal, + }; + } + return { + name: sourceCode.text.slice(...member.key.range), + type: MemberNameType.Expression, + }; +} +function getEnumNames(myEnum) { + return Object.keys(myEnum).filter(x => isNaN(Number(x))); +} +/** + * Given an array of words, returns an English-friendly concatenation, separated with commas, with + * the `and` clause inserted before the last item. + * + * Example: ['foo', 'bar', 'baz' ] returns the string "foo, bar, and baz". + */ +function formatWordList(words) { + if (!words.length) { + return ''; + } + if (words.length === 1) { + return words[0]; + } + return [words.slice(0, -1).join(', '), words.slice(-1)[0]].join(' and '); +} +/** + * Iterates the array in reverse and returns the index of the first element it + * finds which passes the predicate function. + * + * @returns Returns the index of the element if it finds it or -1 otherwise. + */ +function findLastIndex(members, predicate) { + let idx = members.length - 1; + while (idx >= 0) { + const valid = predicate(members[idx]); + if (valid) { + return idx; + } + idx--; + } + return -1; +} +function typeNodeRequiresParentheses(node, text) { + return (node.type === utils_1.AST_NODE_TYPES.TSFunctionType || + node.type === utils_1.AST_NODE_TYPES.TSConstructorType || + node.type === utils_1.AST_NODE_TYPES.TSConditionalType || + (node.type === utils_1.AST_NODE_TYPES.TSUnionType && text.startsWith('|')) || + (node.type === utils_1.AST_NODE_TYPES.TSIntersectionType && text.startsWith('&'))); +} +function isRestParameterDeclaration(decl) { + return ts.isParameter(decl) && decl.dotDotDotToken != null; +} +function isParenlessArrowFunction(node, sourceCode) { + return (node.params.length === 1 && !(0, astUtils_1.isParenthesized)(node.params[0], sourceCode)); +} +/** + * Gets a member being accessed or declared if its value can be determined statically, and + * resolves it to the string or symbol value that will be used as the actual member + * access key at runtime. Otherwise, returns `undefined`. + * + * ```ts + * x.member // returns 'member' + * ^^^^^^^^ + * + * x?.member // returns 'member' (optional chaining is treated the same) + * ^^^^^^^^^ + * + * x['value'] // returns 'value' + * ^^^^^^^^^^ + * + * x[Math.random()] // returns undefined (not a static value) + * ^^^^^^^^^^^^^^^^ + * + * arr[0] // returns '0' (NOT 0) + * ^^^^^^ + * + * arr[0n] // returns '0' (NOT 0n) + * ^^^^^^^ + * + * const s = Symbol.for('symbolName') + * x[s] // returns `Symbol.for('symbolName')` (since it's a static/global symbol) + * ^^^^ + * + * const us = Symbol('symbolName') + * x[us] // returns undefined (since it's a unique symbol, so not statically analyzable) + * ^^^^^ + * + * var object = { + * 1234: '4567', // returns '1234' (NOT 1234) + * ^^^^^^^^^^^^ + * method() { } // returns 'method' + * ^^^^^^^^^^^^ + * } + * + * class WithMembers { + * foo: string // returns 'foo' + * ^^^^^^^^^^^ + * } + * ``` + */ +function getStaticMemberAccessValue(node, { sourceCode }) { + const key = node.type === utils_1.AST_NODE_TYPES.MemberExpression ? node.property : node.key; + const { type } = key; + if (!node.computed && + (type === utils_1.AST_NODE_TYPES.Identifier || + type === utils_1.AST_NODE_TYPES.PrivateIdentifier)) { + return key.name; + } + const result = (0, astUtils_1.getStaticValue)(key, sourceCode.getScope(node)); + if (!result) { + return undefined; + } + const { value } = result; + return typeof value === 'symbol' ? value : String(value); +} +/** + * Answers whether the member expression looks like + * `x.value`, `x['value']`, + * or even `const v = 'value'; x[v]` (or optional variants thereof). + */ +const isStaticMemberAccessOfValue = (memberExpression, context, ...values) => values.includes(getStaticMemberAccessValue(memberExpression, context)); +exports.isStaticMemberAccessOfValue = isStaticMemberAccessOfValue; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.d.ts.map new file mode 100644 index 0000000..06cedab --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"needsPrecedingSemiColon.d.ts","sourceRoot":"","sources":["../../src/util/needsPrecedingSemiColon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AA6DrE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,OAAO,CAoDT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.js new file mode 100644 index 0000000..91760ae --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.needsPrecedingSemicolon = needsPrecedingSemicolon; +const utils_1 = require("@typescript-eslint/utils"); +const ast_utils_1 = require("@typescript-eslint/utils/ast-utils"); +// The following is adapted from `eslint`'s source code. +// https://github.com/eslint/eslint/blob/3a4eaf921543b1cd5d1df4ea9dec02fab396af2a/lib/rules/utils/ast-utils.js#L1043-L1132 +// Could be export { isStartOfExpressionStatement } from 'eslint/lib/rules/utils/ast-utils' +const BREAK_OR_CONTINUE = new Set([ + utils_1.AST_NODE_TYPES.BreakStatement, + utils_1.AST_NODE_TYPES.ContinueStatement, +]); +// Declaration types that must contain a string Literal node at the end. +const DECLARATIONS = new Set([ + utils_1.AST_NODE_TYPES.ExportAllDeclaration, + utils_1.AST_NODE_TYPES.ExportNamedDeclaration, + utils_1.AST_NODE_TYPES.ImportDeclaration, +]); +const IDENTIFIER_OR_KEYWORD = new Set([ + utils_1.AST_NODE_TYPES.Identifier, + utils_1.AST_TOKEN_TYPES.Keyword, +]); +// Keywords that can immediately precede an ExpressionStatement node, mapped to the their node types. +const NODE_TYPES_BY_KEYWORD = { + __proto__: null, + break: utils_1.AST_NODE_TYPES.BreakStatement, + continue: utils_1.AST_NODE_TYPES.ContinueStatement, + debugger: utils_1.AST_NODE_TYPES.DebuggerStatement, + do: utils_1.AST_NODE_TYPES.DoWhileStatement, + else: utils_1.AST_NODE_TYPES.IfStatement, + return: utils_1.AST_NODE_TYPES.ReturnStatement, + yield: utils_1.AST_NODE_TYPES.YieldExpression, +}; +/* + * Before an opening parenthesis, postfix `++` and `--` always trigger ASI; + * the tokens `:`, `;`, `{` and `=>` don't expect a semicolon, as that would count as an empty statement. + */ +const PUNCTUATORS = new Set(['--', ';', ':', '{', '++', '=>']); +/* + * Statements that can contain an `ExpressionStatement` after a closing parenthesis. + * DoWhileStatement is an exception in that it always triggers ASI after the closing parenthesis. + */ +const STATEMENTS = new Set([ + utils_1.AST_NODE_TYPES.DoWhileStatement, + utils_1.AST_NODE_TYPES.ForInStatement, + utils_1.AST_NODE_TYPES.ForOfStatement, + utils_1.AST_NODE_TYPES.ForStatement, + utils_1.AST_NODE_TYPES.IfStatement, + utils_1.AST_NODE_TYPES.WhileStatement, + utils_1.AST_NODE_TYPES.WithStatement, +]); +/** + * Determines whether an opening parenthesis `(`, bracket `[` or backtick ``` ` ``` needs to be preceded by a semicolon. + * This opening parenthesis or bracket should be at the start of an `ExpressionStatement`, a `MethodDefinition` or at + * the start of the body of an `ArrowFunctionExpression`. + * @param sourceCode The source code object. + * @param node A node at the position where an opening parenthesis or bracket will be inserted. + * @returns Whether a semicolon is required before the opening parenthesis or bracket. + */ +function needsPrecedingSemicolon(sourceCode, node) { + const prevToken = sourceCode.getTokenBefore(node); + if (!prevToken || + (prevToken.type === utils_1.AST_TOKEN_TYPES.Punctuator && + PUNCTUATORS.has(prevToken.value))) { + return false; + } + const prevNode = sourceCode.getNodeByRangeIndex(prevToken.range[0]); + if (!prevNode) { + return false; + } + if ((0, ast_utils_1.isClosingParenToken)(prevToken)) { + return !STATEMENTS.has(prevNode.type); + } + if ((0, ast_utils_1.isClosingBraceToken)(prevToken)) { + return ((prevNode.type === utils_1.AST_NODE_TYPES.BlockStatement && + prevNode.parent.type === utils_1.AST_NODE_TYPES.FunctionExpression && + prevNode.parent.parent.type !== utils_1.AST_NODE_TYPES.MethodDefinition) || + (prevNode.type === utils_1.AST_NODE_TYPES.ClassBody && + prevNode.parent.type === utils_1.AST_NODE_TYPES.ClassExpression) || + prevNode.type === utils_1.AST_NODE_TYPES.ObjectExpression); + } + if (!prevNode.parent) { + return false; + } + if (IDENTIFIER_OR_KEYWORD.has(prevToken.type)) { + if (BREAK_OR_CONTINUE.has(prevNode.parent.type)) { + return false; + } + const keyword = prevToken.value; + const nodeType = NODE_TYPES_BY_KEYWORD[keyword]; + return prevNode.type !== nodeType; + } + if (prevToken.type === utils_1.AST_TOKEN_TYPES.String) { + return !DECLARATIONS.has(prevNode.parent.type); + } + return true; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.d.ts.map new file mode 100644 index 0000000..d41b43b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"needsToBeAwaited.d.ts","sourceRoot":"","sources":["../../src/util/needsToBeAwaited.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAUtC,oBAAY,SAAS;IACnB,MAAM,IAAA;IACN,KAAK,IAAA;IACL,GAAG,IAAA;CACJ;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,SAAS,CAoBX"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.js new file mode 100644 index 0000000..7cd63a2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.js @@ -0,0 +1,63 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Awaitable = void 0; +exports.needsToBeAwaited = needsToBeAwaited; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const tsutils = __importStar(require("ts-api-utils")); +const getConstraintInfo_1 = require("./getConstraintInfo"); +var Awaitable; +(function (Awaitable) { + Awaitable[Awaitable["Always"] = 0] = "Always"; + Awaitable[Awaitable["Never"] = 1] = "Never"; + Awaitable[Awaitable["May"] = 2] = "May"; +})(Awaitable || (exports.Awaitable = Awaitable = {})); +function needsToBeAwaited(checker, node, type) { + const { constraintType, isTypeParameter } = (0, getConstraintInfo_1.getConstraintInfo)(checker, type); + // unconstrained generic types should be treated as unknown + if (isTypeParameter && constraintType == null) { + return Awaitable.May; + } + // `any` and `unknown` types may need to be awaited + if ((0, type_utils_1.isTypeAnyType)(constraintType) || (0, type_utils_1.isTypeUnknownType)(constraintType)) { + return Awaitable.May; + } + // 'thenable' values should always be be awaited + if (tsutils.isThenableType(checker, node, constraintType)) { + return Awaitable.Always; + } + // anything else should not be awaited + return Awaitable.Never; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.d.ts.map new file mode 100644 index 0000000..d141364 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"objectIterators.d.ts","sourceRoot":"","sources":["../../src/util/objectIterators.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,GAAG,EAAE,CAAC,EACN,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,IAAI,GAC/B,IAAI,CAKN;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EACpE,GAAG,EAAE,CAAC,EACN,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,MAAM,GACjC,MAAM,EAAE,CAMV;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,EAC5E,GAAG,EAAE,CAAC,EACN,QAAQ,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,CAAC,KAAK,WAAW,EACzD,OAAO,EAAE,WAAW,GACnB,WAAW,CAMb"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js new file mode 100644 index 0000000..80651af --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.objectForEachKey = objectForEachKey; +exports.objectMapKey = objectMapKey; +exports.objectReduceKey = objectReduceKey; +function objectForEachKey(obj, callback) { + const keys = Object.keys(obj); + for (const key of keys) { + callback(key); + } +} +function objectMapKey(obj, callback) { + const values = []; + objectForEachKey(obj, key => { + values.push(callback(key)); + }); + return values; +} +function objectReduceKey(obj, callback, initial) { + let accumulator = initial; + objectForEachKey(obj, key => { + accumulator = callback(accumulator, key); + }); + return accumulator; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.d.ts.map new file mode 100644 index 0000000..202619b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"rangeToLoc.d.ts","sourceRoot":"","sources":["../../src/util/rangeToLoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEnE,wBAAgB,UAAU,CACxB,UAAU,EAAE,QAAQ,CAAC,UAAU,EAC/B,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,GACxB,QAAQ,CAAC,cAAc,CAKzB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.js new file mode 100644 index 0000000..2fb8cba --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.rangeToLoc = rangeToLoc; +function rangeToLoc(sourceCode, range) { + return { + end: sourceCode.getLocFromIndex(range[1]), + start: sourceCode.getLocFromIndex(range[0]), + }; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.d.ts.map new file mode 100644 index 0000000..862d9a3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"referenceContainsTypeQuery.d.ts","sourceRoot":"","sources":["../../src/util/referenceContainsTypeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAavE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.js new file mode 100644 index 0000000..45bc86e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.referenceContainsTypeQuery = referenceContainsTypeQuery; +const utils_1 = require("@typescript-eslint/utils"); +/** + * Recursively checks whether a given reference has a type query declaration among its parents + */ +function referenceContainsTypeQuery(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSTypeQuery: + return true; + case utils_1.AST_NODE_TYPES.TSQualifiedName: + case utils_1.AST_NODE_TYPES.Identifier: + return referenceContainsTypeQuery(node.parent); + default: + // if we find a different node, there's no chance that we're in a TSTypeQuery + return false; + } +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.d.ts.map new file mode 100644 index 0000000..e1d9999 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scopeUtils.d.ts","sourceRoot":"","sources":["../../src/util/scopeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAErE,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,UAAU,EAAE,UAAU,GACrB,OAAO,CAOT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.js new file mode 100644 index 0000000..2144552 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isReferenceToGlobalFunction = isReferenceToGlobalFunction; +function isReferenceToGlobalFunction(calleeName, node, sourceCode) { + const ref = sourceCode + .getScope(node) + .references.find(ref => ref.identifier.name === calleeName); + // ensure it's the "global" version + return !ref?.resolved?.defs.length; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.d.ts.map new file mode 100644 index 0000000..3f2399d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"skipChainExpression.d.ts","sourceRoot":"","sources":["../../src/util/skipChainExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,QAAQ,CAAC,IAAI,EACzD,IAAI,EAAE,CAAC,GACN,CAAC,GAAG,QAAQ,CAAC,YAAY,CAE3B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.js new file mode 100644 index 0000000..8f041cf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.skipChainExpression = skipChainExpression; +const utils_1 = require("@typescript-eslint/utils"); +function skipChainExpression(node) { + return node.type === utils_1.AST_NODE_TYPES.ChainExpression ? node.expression : node; +} diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessAndNullishUtils.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessAndNullishUtils.d.ts.map new file mode 100644 index 0000000..19ca2c5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessAndNullishUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"truthinessAndNullishUtils.d.ts","sourceRoot":"","sources":["../../src/util/truthinessAndNullishUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AASjC,eAAO,MAAM,eAAe,GAAI,MAAM,EAAE,CAAC,IAAI,KAAG,OAS0B,CAAC;AAE3E,eAAO,MAAM,gBAAgB,GAAI,MAAM,EAAE,CAAC,IAAI,KAAG,OAQ5C,CAAC;AAON,eAAO,MAAM,iBAAiB,GAAI,MAAM,EAAE,CAAC,IAAI,KAAG,OACA,CAAC;AAEnD,eAAO,MAAM,eAAe,GAAI,MAAM,EAAE,CAAC,IAAI,KAAG,OACG,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessAndNullishUtils.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessAndNullishUtils.js new file mode 100644 index 0000000..52ab4c8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessAndNullishUtils.js @@ -0,0 +1,67 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isAlwaysNullish = exports.isPossiblyNullish = exports.isPossiblyTruthy = exports.isPossiblyFalsy = void 0; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const getValueOfLiteralType_1 = require("./getValueOfLiteralType"); +// Truthiness utilities +const isTruthyLiteral = (type) => tsutils.isTrueLiteralType(type) || + (type.isLiteral() && !!(0, getValueOfLiteralType_1.getValueOfLiteralType)(type)); +const isPossiblyFalsy = (type) => tsutils + .unionTypeParts(type) + // Intersections like `string & {}` can also be possibly falsy, + // requiring us to look into the intersection. + .flatMap(type => tsutils.intersectionTypeParts(type)) + // PossiblyFalsy flag includes literal values, so exclude ones that + // are definitely truthy + .filter(t => !isTruthyLiteral(t)) + .some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.PossiblyFalsy)); +exports.isPossiblyFalsy = isPossiblyFalsy; +const isPossiblyTruthy = (type) => tsutils + .unionTypeParts(type) + .map(type => tsutils.intersectionTypeParts(type)) + .some(intersectionParts => +// It is possible to define intersections that are always falsy, +// like `"" & { __brand: string }`. +intersectionParts.every(type => !tsutils.isFalsyType(type))); +exports.isPossiblyTruthy = isPossiblyTruthy; +// Nullish utilities +const nullishFlag = ts.TypeFlags.Undefined | ts.TypeFlags.Null; +const isNullishType = (type) => tsutils.isTypeFlagSet(type, nullishFlag); +const isPossiblyNullish = (type) => tsutils.unionTypeParts(type).some(isNullishType); +exports.isPossiblyNullish = isPossiblyNullish; +const isAlwaysNullish = (type) => tsutils.unionTypeParts(type).every(isNullishType); +exports.isAlwaysNullish = isAlwaysNullish; diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.d.ts.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.d.ts.map new file mode 100644 index 0000000..dfbe8d1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/util/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,IAAI,EAAE,GAAG,SAAS,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,GACtE,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhD,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md new file mode 100644 index 0000000..75c5723 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md @@ -0,0 +1,57 @@ +--- +title: Overview +sidebar_label: Overview +pagination_next: null +pagination_prev: null +slug: / +--- + +`@typescript-eslint/eslint-plugin` includes over 100 rules that detect best practice violations, bugs, and/or stylistic issues specifically for TypeScript code. All of our rules are listed below. + +:::tip +Instead of enabling rules one by one, we recommend using one of [our pre-defined configs](/users/configs) to enable a large set of recommended rules. +::: + +## Rules + +The rules are listed in alphabetical order. You can optionally filter them based on these categories: + +import RulesTable from "@site/src/components/RulesTable"; + + + +## Filtering + +### Config Group (⚙️) + +"Config Group" refers to the [pre-defined config](/users/configs) that includes the rule. Extending from a configuration preset allow for enabling a large set of recommended rules all at once. + +### Metadata + +- `🔧 fixable` refers to whether the rule contains an [ESLint `--fix` auto-fixer](https://eslint.org/docs/latest/use/command-line-interface#--fix). +- `💡 has suggestions` refers to whether the rule contains an ESLint suggestion fixer. + - Sometimes, it is not safe to automatically fix the code with an auto-fixer. But in these cases, we often have a good guess of what the correct fix should be, and we can provide it as a suggestion to the developer. +- `💭 requires type information` refers to whether the rule requires [typed linting](/getting-started/typed-linting). +- `🧱 extension rule` means that the rule is an extension of an [core ESLint rule](https://eslint.org/docs/latest/rules) (see [Extension Rules](#extension-rules)). +- `💀 deprecated rule` means that the rule should no longer be used and will be removed from the plugin in a future version. + +## Extension Rules + +Some core ESLint rules do not support TypeScript syntax: either they crash, ignore the syntax, or falsely report against it. +In these cases, we create what we call an "extension rule": a rule within our plugin that has the same functionality, but also supports TypeScript. + +Extension rules generally completely replace the base rule from ESLint core. +If the base rule is enabled in a config you extend from, you'll need to disable the base rule: + +```js +module.exports = { + extends: ['eslint:recommended'], + rules: { + // Note: you must disable the base rule as it can report incorrect errors + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + }, +}; +``` + +[Search for `🧱 extension rule`s](?=extension#rules) in this page to see all extension rules. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md new file mode 100644 index 0000000..49947c3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md @@ -0,0 +1,36 @@ +--- +description: '' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/RULE_NAME_REPLACEME** for documentation. + +## Examples + +To fill out: tell us more about this rule. + + + + +```ts +// To fill out: incorrect code +``` + + + + +```ts +// To fill out: correct code +``` + + + + +## When Not To Use It + +To fill out: why wouldn't you want to use this rule? +For example if this rule requires a feature released in a certain TS version. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.mdx new file mode 100644 index 0000000..60f62b2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.mdx @@ -0,0 +1,105 @@ +--- +description: 'Require that function overload signatures be consecutive.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/adjacent-overload-signatures** for documentation. + +Function overload signatures represent multiple ways a function can be called, potentially with different return types. +It's typical for an interface or type alias describing a function to place all overload signatures next to each other. +If Signatures placed elsewhere in the type are easier to be missed by future developers reading the code. + +## Examples + + + + +```ts +declare namespace Foo { + export function foo(s: string): void; + export function foo(n: number): void; + export function bar(): void; + export function foo(sn: string | number): void; +} + +type Foo = { + foo(s: string): void; + foo(n: number): void; + bar(): void; + foo(sn: string | number): void; +}; + +interface Foo { + foo(s: string): void; + foo(n: number): void; + bar(): void; + foo(sn: string | number): void; +} + +class Foo { + foo(s: string): void; + foo(n: number): void; + bar(): void {} + foo(sn: string | number): void {} +} + +export function foo(s: string): void; +export function foo(n: number): void; +export function bar(): void; +export function foo(sn: string | number): void; +``` + + + + +```ts +declare namespace Foo { + export function foo(s: string): void; + export function foo(n: number): void; + export function foo(sn: string | number): void; + export function bar(): void; +} + +type Foo = { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void; + bar(): void; +}; + +interface Foo { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void; + bar(): void; +} + +class Foo { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void {} + bar(): void {} +} + +export function bar(): void; +export function foo(s: string): void; +export function foo(n: number): void; +export function foo(sn: string | number): void; +``` + + + + +## When Not To Use It + +It can sometimes be useful to place overload signatures alongside other meaningful parts of a type. +For example, if each of a function's overloads corresponds to a different property, you might wish to put each overloads next to its corresponding property. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [`unified-signatures`](./unified-signatures.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.mdx new file mode 100644 index 0000000..8c520c8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.mdx @@ -0,0 +1,126 @@ +--- +description: 'Require consistently using either `T[]` or `Array` for arrays.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/array-type** for documentation. + +TypeScript provides two equivalent ways to define an array type: `T[]` and `Array`. +The two styles are functionally equivalent. +Using the same style consistently across your codebase makes it easier for developers to read and understand array types. + +## Options + +The default config will enforce that all mutable and readonly arrays use the `'array'` syntax. + +### `"array"` + +Always use `T[]` or `readonly T[]` for all array types. + + + + +```ts option='{ "default": "array" }' +const x: Array = ['a', 'b']; +const y: ReadonlyArray = ['a', 'b']; +``` + + + + +```ts option='{ "default": "array" }' +const x: string[] = ['a', 'b']; +const y: readonly string[] = ['a', 'b']; +``` + + + + +### `"generic"` + +Always use `Array`, `ReadonlyArray`, or `Readonly>` for all array types. +`readonly T[]` will be modified to `ReadonlyArray` and `Readonly` will be modified to `Readonly>`. + + + + +```ts option='{ "default": "generic" }' +const x: string[] = ['a', 'b']; +const y: readonly string[] = ['a', 'b']; +const z: Readonly = ['a', 'b']; +``` + + + + +```ts option='{ "default": "generic" }' +const x: Array = ['a', 'b']; +const y: ReadonlyArray = ['a', 'b']; +const z: Readonly> = ['a', 'b']; +``` + + + + +### `"array-simple"` + +Use `T[]` or `readonly T[]` for simple types (i.e. types which are just primitive names or type references). +Use `Array` or `ReadonlyArray` for all other types (union types, intersection types, object types, function types, etc). + + + + +```ts option='{ "default": "array-simple" }' +const a: (string | number)[] = ['a', 'b']; +const b: { prop: string }[] = [{ prop: 'a' }]; +const c: (() => void)[] = [() => {}]; +const d: Array = ['a', 'b']; +const e: Array = ['a', 'b']; +const f: ReadonlyArray = ['a', 'b']; +``` + + + + +```ts option='{ "default": "array-simple" }' +const a: Array = ['a', 'b']; +const b: Array<{ prop: string }> = [{ prop: 'a' }]; +const c: Array<() => void> = [() => {}]; +const d: MyType[] = ['a', 'b']; +const e: string[] = ['a', 'b']; +const f: readonly string[] = ['a', 'b']; +``` + + + + +## Combination Matrix + +This matrix lists all possible option combinations and their expected results for different types of Arrays. + +| defaultOption | readonlyOption | Array with simple type | Array with non simple type | Readonly array with simple type | Readonly array with non simple type | +| -------------- | -------------- | ---------------------- | -------------------------- | ------------------------------- | ----------------------------------- | +| `array` | | `number[]` | `(Foo & Bar)[]` | `readonly number[]` | `readonly (Foo & Bar)[]` | +| `array` | `array` | `number[]` | `(Foo & Bar)[]` | `readonly number[]` | `readonly (Foo & Bar)[]` | +| `array` | `array-simple` | `number[]` | `(Foo & Bar)[]` | `readonly number[]` | `ReadonlyArray` | +| `array` | `generic` | `number[]` | `(Foo & Bar)[]` | `ReadonlyArray` | `ReadonlyArray` | +| `array-simple` | | `number[]` | `Array` | `readonly number[]` | `ReadonlyArray` | +| `array-simple` | `array` | `number[]` | `Array` | `readonly number[]` | `readonly (Foo & Bar)[]` | +| `array-simple` | `array-simple` | `number[]` | `Array` | `readonly number[]` | `ReadonlyArray` | +| `array-simple` | `generic` | `number[]` | `Array` | `ReadonlyArray` | `ReadonlyArray` | +| `generic` | | `Array` | `Array` | `ReadonlyArray` | `ReadonlyArray` | +| `generic` | `array` | `Array` | `Array` | `readonly number[]` | `readonly (Foo & Bar)[]` | +| `generic` | `array-simple` | `Array` | `Array` | `readonly number[]` | `ReadonlyArray` | +| `generic` | `generic` | `Array` | `Array` | `ReadonlyArray` | `ReadonlyArray` | + +## When Not To Use It + +This rule is purely a stylistic rule for maintaining consistency in your project. +You can turn it off if you don't want to keep a consistent style for array types. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.mdx new file mode 100644 index 0000000..c4006c8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.mdx @@ -0,0 +1,184 @@ +--- +description: 'Disallow awaiting a value that is not a Thenable.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/await-thenable** for documentation. + +A "Thenable" value is an object which has a `then` method, such as a Promise. +The [`await` keyword](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) is generally used to retrieve the result of calling a Thenable's `then` method. + +If the `await` keyword is used on a value that is not a Thenable, the value is directly resolved, but will still pause execution until the next microtask. +While doing so is valid JavaScript, it is often a programmer error, such as forgetting to add parenthesis to call a function that returns a Promise. + +## Examples + + + + +```ts +await 'value'; + +const createValue = () => 'value'; +await createValue(); +``` + + + + +```ts +await Promise.resolve('value'); + +const createValue = async () => 'value'; +await createValue(); +``` + + + + +## Async Iteration (`for await...of` Loops) + +This rule also inspects [`for await...of` statements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of), and reports if the value being iterated over is not async-iterable. + +:::info[Why does the rule report on `for await...of` loops used on an array of Promises?] + +While `for await...of` can be used with synchronous iterables, and it will await each promise produced by the iterable, it is inadvisable to do so. +There are some tiny nuances that you may want to consider. + +The biggest difference between using `for await...of` and using `for...of` (apart from awaiting each result yourself) is error handling. +When an error occurs within the loop body, `for await...of` does _not_ close the original sync iterable, while `for...of` does. +For detailed examples of this, see the [MDN documentation on using `for await...of` with sync-iterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of#iterating_over_sync_iterables_and_generators). + +Also consider whether you need sequential awaiting at all. Using `for await...of` may obscure potential opportunities for concurrent processing, such as those reported by [`no-await-in-loop`](https://eslint.org/docs/latest/rules/no-await-in-loop). Consider instead using one of the [promise concurrency methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) for better performance. + +::: + +### Examples + + + + +```ts +async function syncIterable() { + const arrayOfValues = [1, 2, 3]; + for await (const value of arrayOfValues) { + console.log(value); + } +} + +async function syncIterableOfPromises() { + const arrayOfPromises = [ + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), + ]; + for await (const promisedValue of arrayOfPromises) { + console.log(promisedValue); + } +} +``` + + + + +```ts +async function syncIterable() { + const arrayOfValues = [1, 2, 3]; + for (const value of arrayOfValues) { + console.log(value); + } +} + +async function syncIterableOfPromises() { + const arrayOfPromises = [ + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), + ]; + for (const promisedValue of await Promise.all(arrayOfPromises)) { + console.log(promisedValue); + } +} + +async function validUseOfForAwaitOnAsyncIterable() { + async function* yieldThingsAsynchronously() { + yield 1; + await new Promise(resolve => setTimeout(resolve, 1000)); + yield 2; + } + + for await (const promisedValue of yieldThingsAsynchronously()) { + console.log(promisedValue); + } +} +``` + + + + +## Explicit Resource Management (`await using` Statements) + +This rule also inspects [`await using` statements](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management). +If the disposable being used is not async-disposable, an `await using` statement is unnecessary. + +### Examples + + + + +```ts +function makeSyncDisposable(): Disposable { + return { + [Symbol.dispose](): void { + // Dispose of the resource + }, + }; +} + +async function shouldNotAwait() { + await using resource = makeSyncDisposable(); +} +``` + + + + +```ts +function makeSyncDisposable(): Disposable { + return { + [Symbol.dispose](): void { + // Dispose of the resource + }, + }; +} + +async function shouldNotAwait() { + using resource = makeSyncDisposable(); +} + +function makeAsyncDisposable(): AsyncDisposable { + return { + async [Symbol.asyncDispose](): Promise { + // Dispose of the resource asynchronously + }, + }; +} + +async function shouldAwait() { + await using resource = makeAsyncDisposable(); +} +``` + + + + +## When Not To Use It + +If you want to allow code to `await` non-Promise values. +For example, if your framework is in transition from one style of asynchronous code to another, it may be useful to include `await`s unnecessarily. +This is generally not preferred but can sometimes be useful for visual consistency. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.mdx new file mode 100644 index 0000000..e233874 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.mdx @@ -0,0 +1,165 @@ +--- +description: 'Disallow `@ts-` comments or require descriptions after directives.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation. + +TypeScript provides several directive comments that can be used to alter how it processes files. +Using these to suppress TypeScript compiler errors reduces the effectiveness of TypeScript overall. +Instead, it's generally better to correct the types of code, to make directives unnecessary. + +The directive comments supported by TypeScript are: + +```ts +// @ts-expect-error +// @ts-ignore +// @ts-nocheck +// @ts-check +``` + +This rule lets you set which directive comments you want to allow in your codebase. + +## Options + +By default, only `@ts-check` is allowed, as it enables rather than suppresses errors. + +### `ts-expect-error`, `ts-ignore`, `ts-nocheck`, `ts-check` directives + +A value of `true` for a particular directive means that this rule will report if it finds any usage of said directive. + + + + +```ts option='{ "ts-ignore": true }' +if (false) { + // @ts-ignore: Unreachable code error + console.log('hello'); +} +if (false) { + /* @ts-ignore: Unreachable code error */ + console.log('hello'); +} +``` + + + + +```ts option='{ "ts-ignore": true }' +if (false) { + // Compiler warns about unreachable code error + console.log('hello'); +} +``` + + + + +### `allow-with-description` + +A value of `'allow-with-description'` for a particular directive means that this rule will report if it finds a directive that does not have a description following the directive (on the same line). + +For example, with `{ 'ts-expect-error': 'allow-with-description' }`: + + + + +```ts option='{ "ts-expect-error": "allow-with-description" }' +if (false) { + // @ts-expect-error + console.log('hello'); +} +if (false) { + /* @ts-expect-error */ + console.log('hello'); +} +``` + + + + +```ts option='{ "ts-expect-error": "allow-with-description" }' +if (false) { + // @ts-expect-error: Unreachable code error + console.log('hello'); +} +if (false) { + /* @ts-expect-error: Unreachable code error */ + console.log('hello'); +} +``` + + + +### `descriptionFormat` + +{/* insert option description */} + +For each directive type, you can specify a custom format in the form of a regular expression. Only description that matches the pattern will be allowed. + +For example, with `{ 'ts-expect-error': { descriptionFormat: '^: TS\\d+ because .+$' } }`: + + + + +{/* prettier-ignore */} +```ts option='{ "ts-expect-error": { "descriptionFormat": "^: TS\\\\d+ because .+$" } }' +// @ts-expect-error: the library definition is wrong +const a = doSomething('hello'); +``` + + + + +{/* prettier-ignore */} +```ts option='{ "ts-expect-error": { "descriptionFormat": "^: TS\\\\d+ because .+$" } }' +// @ts-expect-error: TS1234 because the library definition is wrong +const a = doSomething('hello'); +``` + + + + +### `minimumDescriptionLength` + +{/* insert option description */} + +Use `minimumDescriptionLength` to set a minimum length for descriptions when using the `allow-with-description` option for a directive. + +For example, with `{ 'ts-expect-error': 'allow-with-description', minimumDescriptionLength: 10 }` the following pattern is: + + + + +```ts option='{ "ts-expect-error": "allow-with-description", "minimumDescriptionLength": 10 }' +if (false) { + // @ts-expect-error: TODO + console.log('hello'); +} +``` + + + + +```ts option='{ "ts-expect-error": "allow-with-description", "minimumDescriptionLength": 10 }' +if (false) { + // @ts-expect-error The rationale for this override is described in issue #1337 on GitLab + console.log('hello'); +} +``` + + + + +## When Not To Use It + +If your project or its dependencies were not architected with strong type safety in mind, it can be difficult to always adhere to proper TypeScript semantics. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- TypeScript [Type Checking JavaScript Files](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.mdx new file mode 100644 index 0000000..c6aa3b9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.mdx @@ -0,0 +1,45 @@ +--- +description: 'Disallow `// tslint:` comments.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/ban-tslint-comment** for documentation. + +Useful when migrating from TSLint to ESLint. Once TSLint has been removed, this rule helps locate TSLint annotations (e.g. `// tslint:disable`). + +> See the [TSLint rule flags docs](https://palantir.github.io/tslint/usage/rule-flags) for reference. + +## Examples + + + + +```ts +/* tslint:disable */ +/* tslint:enable */ +/* tslint:disable:rule1 rule2 rule3... */ +/* tslint:enable:rule1 rule2 rule3... */ +// tslint:disable-next-line +someCode(); // tslint:disable-line +// tslint:disable-next-line:rule1 rule2 rule3... +``` + + + + +```ts +// This is a comment that just happens to mention tslint +/* This is a multiline comment that just happens to mention tslint */ +someCode(); // This is a comment that just happens to mention tslint +``` + + + + +## When Not To Use It + +If you are still using TSLint alongside ESLint. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md new file mode 100644 index 0000000..5145957 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md @@ -0,0 +1,26 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +The old `ban-types` rule encompassed multiple areas of functionality, and so has been split into several rules. + +**[`no-restricted-types`](./no-restricted-types.mdx)** is the new rule for banning a configurable list of type names. +It has no options enabled by default and is akin to rules like [`no-restricted-globals`](https://eslint.org/docs/latest/rules/no-restricted-globals), [`no-restricted-properties`](https://eslint.org/docs/latest/rules/no-restricted-properties), and [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax). + +The default options from `ban-types` are now covered by: + +- **[`no-empty-object-type`](./no-empty-object-type.mdx)**: banning the built-in `{}` type in confusing locations +- **[`no-unsafe-function-type`](./no-unsafe-function-type.mdx)**: banning the built-in `Function` +- **[`no-wrapper-object-types`](./no-wrapper-object-types.mdx)**: banning `Object` and built-in class wrappers such as `Number` + +`ban-types` itself is removed in typescript-eslint v8. +See [Announcing typescript-eslint v8 Beta](/blog/announcing-typescript-eslint-v8-beta) for more details. +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md new file mode 100644 index 0000000..5abacea --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been deprecated in favour of the [`naming-convention`](./naming-convention.mdx) rule. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.mdx new file mode 100644 index 0000000..d980d3b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.mdx @@ -0,0 +1,112 @@ +--- +description: 'Enforce that literals on classes are exposed in a consistent style.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/class-literal-property-style** for documentation. + +Some TypeScript applications store literal values on classes using fields with the `readonly` modifier to prevent them from being reassigned. +When writing TypeScript libraries that could be used by JavaScript users, however, it's typically safer to expose these literals using `getter`s, since the `readonly` modifier is enforced at compile type. + +This rule aims to ensure that literals exposed by classes are done so consistently, in one of the two style described above. +By default this rule prefers the `fields` style as it means JS doesn't have to setup & teardown a function closure. + +## Options + +:::note +This rule only checks for constant _literal_ values (string, template string, number, bigint, boolean, regexp, null). It does not check objects or arrays, because a readonly field behaves differently to a getter in those cases. It also does not check functions, as it is a common pattern to use readonly fields with arrow function values as auto-bound methods. +This is because these types can be mutated and carry with them more complex implications about their usage. +::: + +### `"fields"` + +This style checks for any getter methods that return literal values, and requires them to be defined using fields with the `readonly` modifier instead. + +Examples of code with the `fields` style: + + + + +```ts option='"fields"' +class Mx { + public static get myField1() { + return 1; + } + + private get ['myField2']() { + return 'hello world'; + } +} +``` + + + + +```ts option='"fields"' +class Mx { + public readonly myField1 = 1; + + // not a literal + public readonly myField2 = [1, 2, 3]; + + private readonly ['myField3'] = 'hello world'; + + public get myField4() { + return `hello from ${window.location.href}`; + } +} +``` + + + + +### `"getters"` + +This style checks for any `readonly` fields that are assigned literal values, and requires them to be defined as getters instead. +This style pairs well with the [`@typescript-eslint/prefer-readonly`](prefer-readonly.mdx) rule, +as it will identify fields that can be `readonly`, and thus should be made into getters. + +Examples of code with the `getters` style: + + + + +```ts option='"getters"' +class Mx { + readonly myField1 = 1; + readonly myField2 = `hello world`; + private readonly myField3 = 'hello world'; +} +``` + + + + +```ts option='"getters"' +class Mx { + // no readonly modifier + public myField1 = 'hello'; + + // not a literal + public readonly myField2 = [1, 2, 3]; + + public static get myField3() { + return 1; + } + + private get ['myField4']() { + return 'hello world'; + } +} +``` + + + + +## When Not To Use It + +When you have no strong preference, or do not wish to enforce a particular style for how literal values are exposed by your classes. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-methods-use-this.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-methods-use-this.mdx new file mode 100644 index 0000000..94138fc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-methods-use-this.mdx @@ -0,0 +1,135 @@ +--- +description: 'Enforce that class methods utilize `this`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/class-methods-use-this** for documentation. + +It adds support for ignoring `override` methods and/or methods on classes that implement an interface. It also supports auto-accessor properties. + +## Options + +This rule adds the following options: + +```ts +interface Options extends BaseClassMethodsUseThisOptions { + ignoreOverrideMethods?: boolean; + ignoreClassesThatImplementAnInterface?: boolean | 'public-fields'; +} + +const defaultOptions: Options = { + ...baseClassMethodsUseThisOptions, + ignoreOverrideMethods: false, + ignoreClassesThatImplementAnInterface: false, +}; +``` + +### `ignoreOverrideMethods` + +{/* insert option description */} + +Example of correct code when `ignoreOverrideMethods` is set to `true`: + +```ts option='{ "ignoreOverrideMethods": true }' showPlaygroundButton +abstract class Base { + abstract method(): void; + abstract property: () => void; +} + +class Derived extends Base { + override method() {} + override property = () => {}; +} +``` + +### `ignoreClassesThatImplementAnInterface` + +{/* insert option description */} + +If specified, it can be either: + +- `true`: Ignore all classes that implement an interface +- `'public-fields'`: Ignore only the public fields of classes that implement an interface + +Note that this option applies to all class members, not just those defined in the interface. + +#### `true` + +Examples of code when `ignoreClassesThatImplementAnInterface` is set to `true`: + + + + +```ts option='{ "ignoreClassesThatImplementAnInterface": true }' showPlaygroundButton +class Standalone { + method() {} + property = () => {}; +} +``` + + + + +```ts option='{ "ignoreClassesThatImplementAnInterface": true }' showPlaygroundButton +interface Base { + method(): void; +} + +class Derived implements Base { + method() {} + property = () => {}; +} +``` + + + + +#### `'public-fields'` + +Example of incorrect code when `ignoreClassesThatImplementAnInterface` is set to `'public-fields'`: + + + + +```ts option='{ "ignoreClassesThatImplementAnInterface": "public-fields" }' showPlaygroundButton +interface Base { + method(): void; +} + +class Derived implements Base { + method() {} + property = () => {}; + + private privateMethod() {} + private privateProperty = () => {}; + + protected protectedMethod() {} + protected protectedProperty = () => {}; +} +``` + + + + +```ts option='{ "ignoreClassesThatImplementAnInterface": "public-fields" }' +interface Base { + method(): void; +} + +class Derived implements Base { + method() {} + property = () => {}; +} +``` + + + + +## When Not To Use It + +If your project dynamically changes `this` scopes around in a way TypeScript has difficulties modeling, this rule may not be viable to use. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.mdx new file mode 100644 index 0000000..e4c5e07 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.mdx @@ -0,0 +1,87 @@ +--- +description: 'Enforce specifying generic type arguments on type annotation or constructor name of a constructor call.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/consistent-generic-constructors** for documentation. + +When constructing a generic class, you can specify the type arguments on either the left-hand side (as a type annotation) or the right-hand side (as part of the constructor call): + +```ts +// Left-hand side +const map: Map = new Map(); + +// Right-hand side +const map = new Map(); +``` + +This rule ensures that type arguments appear consistently on one side of the declaration. +Keeping to one side consistently improve code readability. + +> The rule never reports when there are type parameters on both sides, or neither sides of the declaration. +> It also doesn't report if the names of the type annotation and the constructor don't match. + +## Options + +- `'constructor'` _(default)_: type arguments that **only** appear on the type annotation are disallowed. +- `'type-annotation'`: type arguments that **only** appear on the constructor are disallowed. + +### `'constructor'` + +{/* insert option description */} + + + + +```ts option='"constructor"' +const map: Map = new Map(); +const set: Set = new Set(); +``` + + + + +```ts option='"constructor"' +const map = new Map(); +const map: Map = new MyMap(); +const set = new Set(); +const set = new Set(); +const set: Set = new Set(); +``` + + + + +### `'type-annotation'` + + + + +```ts option='"type-annotation"' +const map = new Map(); +const set = new Set(); +``` + + + + +```ts option='"type-annotation"' +const map: Map = new Map(); +const set: Set = new Set(); +const set = new Set(); +const set: Set = new Set(); +``` + + + + +## When Not To Use It + +You can turn this rule off if you don't want to enforce one kind of generic constructor style over the other. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.mdx new file mode 100644 index 0000000..5c980af --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.mdx @@ -0,0 +1,105 @@ +--- +description: 'Require or disallow the `Record` type.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/consistent-indexed-object-style** for documentation. + +TypeScript supports defining arbitrary object keys using an index signature or mapped type. +TypeScript also has a builtin type named `Record` to create an empty object defining only an index signature. +For example, the following types are equal: + +```ts +interface IndexSignatureInterface { + [key: string]: unknown; +} + +type IndexSignatureType = { + [key: string]: unknown; +}; + +type MappedType = { + [key in string]: unknown; +}; + +type RecordType = Record; +``` + +Using one declaration form consistently improves code readability. + +## Options + +- `'record'` _(default)_: only allow the `Record` type. +- `'index-signature'`: only allow index signatures. + +### `'record'` + +{/* insert option description */} + + + + +```ts option='"record"' +interface IndexSignatureInterface { + [key: string]: unknown; +} + +type IndexSignatureType = { + [key: string]: unknown; +}; + +type MappedType = { + [key in string]: unknown; +}; +``` + + + + +```ts option='"record"' +type RecordType = Record; +``` + + + + +### `'index-signature'` + + + + +```ts option='"index-signature"' +type RecordType = Record; +``` + + + + +```ts option='"index-signature"' +interface IndexSignatureInterface { + [key: string]: unknown; +} + +type IndexSignatureType = { + [key: string]: unknown; +}; + +type MappedType = { + [key in string]: unknown; +}; +``` + + + + +## When Not To Use It + +This rule is purely a stylistic rule for maintaining consistency in your project. +You can turn it off if you don't want to keep a consistent style for indexed object types. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-return.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-return.mdx new file mode 100644 index 0000000..ac7b9aa --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-return.mdx @@ -0,0 +1,51 @@ +--- +description: 'Require `return` statements to either always or never specify values.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/consistent-return** for documentation. + +It adds support for functions that return `void` or `Promise`. + +:::danger warning +If possible, it is recommended to use tsconfig's [`noImplicitReturns`](https://www.typescriptlang.org/tsconfig/#noImplicitReturns) option rather than this rule. `noImplicitReturns` is powered by TS's type information and control-flow analysis so it has better coverage than this rule. +::: + + + + +```ts +function foo(): undefined {} +function bar(flag: boolean): undefined { + if (flag) return foo(); + return; +} + +async function baz(flag: boolean): Promise { + if (flag) return; + return foo(); +} +``` + + + + +```ts +function foo(): void {} +function bar(flag: boolean): void { + if (flag) return foo(); + return; +} + +async function baz(flag: boolean): Promise { + if (flag) return 42; + return; +} +``` + + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.mdx new file mode 100644 index 0000000..094e999 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.mdx @@ -0,0 +1,196 @@ +--- +description: 'Enforce consistent usage of type assertions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/consistent-type-assertions** for documentation. + +TypeScript provides two syntaxes for "type assertions": + +- Angle brackets: `value` +- As: `value as Type` + +This rule aims to standardize the use of type assertion style across the codebase. +Keeping to one syntax consistently helps with code readability. + +:::note +Type assertions are also commonly referred as "type casting" in TypeScript. +However, that term is technically slightly different to what is understood by type casting in other languages. +Type assertions are a way to say to the TypeScript compiler, _"I know better than you, it's actually this different type!"_. +::: + +[`const` assertions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) are always allowed by this rule. +Examples of them include `let x = "hello" as const;` and `let x = "hello";`. + +## Options + +### `assertionStyle` + +{/* insert option description */} + +Valid values for `assertionStyle` are: + +- `as` will enforce that you always use `... as foo`. +- `angle-bracket` will enforce that you always use `...` +- `never` will enforce that you do not do any type assertions. + +Most codebases will want to enforce not using `angle-bracket` style because it conflicts with JSX syntax, and is confusing when paired with generic syntax. + +Some codebases like to go for an extra level of type safety, and ban assertions altogether via the `never` option. + +### `objectLiteralTypeAssertions` + +{/* insert option description */} + +For example, this would prefer `const x: T = { ... };` to `const x = { ... } as T;` (or similar with angle brackets). +The type assertion in the latter case is either unnecessary or will probably hide an error. + +The compiler will warn for excess properties with this syntax, but not missing _required_ fields. For example: `const x: { foo: number } = {};` will fail to compile, but `const x = {} as { foo: number }` will succeed. + +The const assertion `const x = { foo: 1 } as const`, introduced in TypeScript 3.4, is considered beneficial and is ignored by this option. + +Assertions to `any` are also ignored by this option. + +Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }`: + + + + +```ts option='{ "assertionStyle": "as", "objectLiteralTypeAssertions": "never" }' +const x = { foo: 1 } as T; + +function bar() { + return { foo: 1 } as T; +} +``` + + + + +```ts option='{ "assertionStyle": "as", "objectLiteralTypeAssertions": "never" }' +const x: T = { foo: 1 }; +const y = { foo: 1 } as any; +const z = { foo: 1 } as unknown; + +function bar(): T { + return { foo: 1 }; +} +``` + + + + +Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }`: + + + + +```ts option='{ "assertionStyle": "as", "objectLiteralTypeAssertions": "allow-as-parameter" }' +const x = { foo: 1 } as T; + +function bar() { + return { foo: 1 } as T; +} +``` + + + + +```tsx option='{ "assertionStyle": "as", "objectLiteralTypeAssertions": "allow-as-parameter" }' +const x: T = { foo: 1 }; +const y = { foo: 1 } as any; +const z = { foo: 1 } as unknown; +bar({ foo: 1 } as T); +new Clazz({ foo: 1 } as T); +function bar() { + throw { foo: 1 } as Foo; +} +const foo = ; +``` + + + + +### `arrayLiteralTypeAssertions` + +{/* insert option description */} + +For example, this would prefer `const x: T[] = [ ... ];` to `const x = [ ... ] as T[];` (or similar with angle brackets). + +The compiler will warn for excess properties of elements with this syntax, but not missing _required_ fields of those objects. +For example: `const x: {foo: number}[] = [{}];` will fail to compile, but `const x = [{}] as [{ foo: number }]` will succeed. + +The const assertion `const x = [1, 2, 3] as const`, introduced in TypeScript 3.4, is considered beneficial and is ignored by this option. + +Assertions to `any` are also ignored by this option. + +Examples of code for `{ assertionStyle: 'as', arrayLiteralTypeAssertions: 'never' }`: + + + + +```ts option='{ "assertionStyle": "as", "arrayLiteralTypeAssertions": "never" }' +const x = ['foo'] as T; + +function bar() { + return ['foo'] as T; +} +``` + + + + +```ts option='{ "assertionStyle": "as", "arrayLiteralTypeAssertions": "never" }' +const x: T = ['foo']; +const y = ['foo'] as any; +const z = ['foo'] as unknown; + +function bar(): T { + return ['foo']; +} +``` + + + + +Examples of code for `{ assertionStyle: 'as', arrayLiteralTypeAssertions: 'allow-as-parameter' }`: + + + + +```ts option='{ "assertionStyle": "as", "arrayLiteralTypeAssertions": "allow-as-parameter" }' +const x = ['foo'] as T; + +function bar() { + return ['foo'] as T; +} +``` + + + + +```tsx option='{ "assertionStyle": "as", "arrayLiteralTypeAssertions": "allow-as-parameter" }' +const x: T = ['foo']; +const y = ['foo'] as any; +const z = ['foo'] as unknown; +bar(['foo'] as T); +new Clazz(['foo'] as T); +function bar() { + throw ['foo'] as Foo; +} +const foo = ; +``` + + + + +## When Not To Use It + +If you do not want to enforce consistent type assertions. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.mdx new file mode 100644 index 0000000..a81fce4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.mdx @@ -0,0 +1,133 @@ +--- +description: 'Enforce type definitions to consistently use either `interface` or `type`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/consistent-type-definitions** for documentation. + +TypeScript provides two common ways to define an object type: `interface` and `type`. + +```ts +// type alias +type T1 = { + a: string; + b: number; +}; + +// interface keyword +interface T2 { + a: string; + b: number; +} +``` + +The two are generally very similar, and can often be used interchangeably. +Using the same type declaration style consistently helps with code readability. + +## Options + +- `'interface'` _(default)_: enforce using `interface`s for object type definitions. +- `'type'`: enforce using `type`s for object type definitions. + +### `'interface'` + +{/* insert option description */} + + + + +```ts option='"interface"' +type T = { x: number }; +``` + + + + +```ts option='"interface"' +type T = string; +type Foo = string | {}; + +interface T { + x: number; +} +``` + + + + +### `'type'` + +{/* insert option description */} + + + + +```ts option='"type"' +interface T { + x: number; +} +``` + + + + +```ts option='"type"' +type T = { x: number }; +``` + + + + +## FAQs + +### What are the differences between `interface` and `type`? + +There are very few differences between interfaces and object types in TypeScript. +Other than type aliases being used to represent union types, it is rare that you will need to choose one over the other. + +| Feature | Interfaces | Object Types | Explanation | +| --------------------- | ---------- | ------------ | ------------------------------------------------------------------------------------------------------ | +| Object shapes | ✅ | ✅ | Both can be used to represent general object shapes. | +| General performance | ✅ | ✅ | Both are optimized for performance in TypeScript's type checker. | +| Edge case performance | ✅ | | Large, complex logical types can be optimized better with interfaces by TypeScript's type checker. | +| Traditional semantics | ✅ | | Interfaces are typically the default in much -though not all- of the TypeScript community. | +| Non-object shapes | | ✅ | Object types may describe literals, primitives, unions, and intersections. | +| Logical types | | ✅ | Object types may include conditional and mapped types. | +| Merging | Allowed | Not allowed | Interfaces of the same name are treated as one interface ("merged"); type aliases may not share names. | + +We recommend choosing one definition style, using it when possible, and falling back to the other style when needed. +The benefits of remaining consistent within a codebase almost always outweigh the benefits of either definition style. + +### When do the performance differences between `interface` and `type` matter? + +Almost never. +Most TypeScript projects do not -and should not- utilize types that exercise the performance differences between the two kinds of definitions. + +If you are having problems with type checking performance, see the [TypeScript Wiki's Performance page](https://github.com/microsoft/TypeScript/wiki/Performance). + +### Why is the default `interface`? + +Interfaces are the prevailing, most common style in the TypeScript. +`interface` has traditionally been TypeScript's intended ("semantic") way to convey _"an object with these fields"_. + +We generally recommend staying with the default, `'interface'`, to be stylistically consistent with the majority of TypeScript projects. +If you strongly prefer `'type'`, that's fine too. + +## When Not To Use It + +If you specifically want to manually choose whether to use an interface or type literal for stylistic reasons each time you define a type, you can avoid this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. + +You might occasionally need to a different definition type in specific cases, such as if your project is a dependency or dependent of another project that relies on a specific type definition style. +Consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [TypeScript Handbook > Everyday Types > Differences Between Type Aliases and Interfaces](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces) +- [StackOverflow: Interfaces vs Types in TypeScript](https://stackoverflow.com/questions/37233735/interfaces-vs-types-in-typescript) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.mdx new file mode 100644 index 0000000..293db56 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.mdx @@ -0,0 +1,97 @@ +--- +description: 'Enforce consistent usage of type exports.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/consistent-type-exports** for documentation. + +TypeScript allows specifying a `type` keyword on exports to indicate that the export exists only in the type system, not at runtime. +This allows transpilers to drop exports without knowing the types of the dependencies. + +> See [Blog > Consistent Type Exports and Imports: Why and How](/blog/consistent-type-imports-and-exports-why-and-how) for more details. + +## Examples + + + + +```ts +interface ButtonProps { + onClick: () => void; +} + +class Button implements ButtonProps { + onClick = () => console.log('button!'); +} + +export { Button, ButtonProps }; +``` + + + + +```ts +interface ButtonProps { + onClick: () => void; +} + +class Button implements ButtonProps { + onClick = () => console.log('button!'); +} + +export { Button }; +export type { ButtonProps }; +``` + + + + +## Options + +### `fixMixedExportsWithInlineTypeSpecifier` + +{/* insert option description */} + +If you are using a TypeScript version less than 4.5, then you will not be able to use this option. + +For example the following code: + +```ts +const x = 1; +type T = number; + +export { x, T }; +``` + +With `{fixMixedExportsWithInlineTypeSpecifier: true}` will be fixed to: + +```ts +const x = 1; +type T = number; + +export { x, type T }; +``` + +With `{fixMixedExportsWithInlineTypeSpecifier: false}` will be fixed to: + +```ts +const x = 1; +type T = number; + +export type { T }; +export { x }; +``` + +## When Not To Use It + +If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. +This rule may be less useful in those cases. + +If you specifically want to use both export kinds for stylistic reasons, or don't wish to enforce one style over the other, you can avoid this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.mdx new file mode 100644 index 0000000..4ff5054 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.mdx @@ -0,0 +1,139 @@ +--- +description: 'Enforce consistent usage of type imports.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/consistent-type-imports** for documentation. + +TypeScript allows specifying a `type` keyword on imports to indicate that the export exists only in the type system, not at runtime. +This allows transpilers to drop imports without knowing the types of the dependencies. + +> See [Blog > Consistent Type Exports and Imports: Why and How](/blog/consistent-type-imports-and-exports-why-and-how) for more details. + +## Options + +### `prefer` + +{/* insert option description */} + +Valid values for `prefer` are: + +- `type-imports` will enforce that you always use `import type Foo from '...'` except referenced by metadata of decorators. It is the default. +- `no-type-imports` will enforce that you always use `import Foo from '...'`. + +Examples of **correct** code with `{prefer: 'type-imports'}`, and **incorrect** code with `{prefer: 'no-type-imports'}`. + +```ts option='{ "prefer": "type-imports" }' showPlaygroundButton +import type { Foo } from 'Foo'; +import type Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + +Examples of **incorrect** code with `{prefer: 'type-imports'}`, and **correct** code with `{prefer: 'no-type-imports'}`. + +```ts option='{ "prefer": "type-imports" }' showPlaygroundButton +import { Foo } from 'Foo'; +import Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + +### `fixStyle` + +{/* insert option description */} + +Valid values for `fixStyle` are: + +- `separate-type-imports` will add the type keyword after the import keyword `import type { A } from '...'`. It is the default. +- `inline-type-imports` will inline the type keyword `import { type A } from '...'` and is only available in TypeScript 4.5 and onwards. See [documentation here](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#type-modifiers-on-import-names 'TypeScript 4.5 documentation on type modifiers and import names'). + + + + +```ts +import { Foo } from 'Foo'; +import Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + + + + +```ts option='{ "fixStyle": "separate-type-imports" }' +import type { Foo } from 'Foo'; +import type Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + + + + +```ts option='{ "fixStyle": "inline-type-imports" }' +import { type Foo } from 'Foo'; +import type Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + + + + +### `disallowTypeAnnotations` + +{/* insert option description */} + +Examples of **incorrect** code with `{disallowTypeAnnotations: true}`: + +```ts option='{ "disallowTypeAnnotations": true }' showPlaygroundButton +type T = import('Foo').Foo; +const x: import('Bar') = 1; +``` + +## Caveat: `@decorators` + `experimentalDecorators: true` + `emitDecoratorMetadata: true` + +:::note +If you are using `experimentalDecorators: false` (eg [TypeScript v5.0's stable decorators](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#decorators)) then the rule will always report errors as expected. +This caveat **only** applies to `experimentalDecorators: true` +::: + +The rule will **_not_** report any errors in files _that contain decorators_ when **both** `experimentalDecorators` and `emitDecoratorMetadata` are turned on. + +> See [Blog > Changes to consistent-type-imports when used with legacy decorators and decorator metadata](/blog/changes-to-consistent-type-imports-with-decorators) for more details. + +If you are using [type-aware linting](/getting-started/typed-linting) then we will automatically infer your setup from your tsconfig and you should not need to configure anything. +Otherwise you can explicitly tell our tooling to analyze your code as if the compiler option was turned on by setting both [`parserOptions.emitDecoratorMetadata = true`](/packages/parser/#emitdecoratormetadata) and [`parserOptions.experimentalDecorators = true`](/packages/parser/#experimentaldecorators). + +## Comparison with `importsNotUsedAsValues` / `verbatimModuleSyntax` + +[`verbatimModuleSyntax`](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax) was introduced in TypeScript v5.0 (as a replacement for `importsNotUsedAsValues`). +This rule and `verbatimModuleSyntax` _mostly_ behave in the same way. +There are a few behavior differences: +| Situation | `consistent-type-imports` (ESLint) | `verbatimModuleSyntax` (TypeScript) | +| -------------------------------------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------- | +| Unused imports | Ignored (consider using [`@typescript-eslint/no-unused-vars`](/rules/no-unused-vars)) | Type error | +| Usage with `emitDecoratorMetadata` & `experimentalDecorations` | Ignores files that contain decorators | Reports on files that contain decorators | +| Failures detected | Does not fail `tsc` build; can be auto-fixed with `--fix` | Fails `tsc` build; cannot be auto-fixed on the command-line | +| `import { type T } from 'T';` | TypeScript will emit nothing (it "elides" the import) | TypeScript emits `import {} from 'T'` | + +Because there are some differences, using both this rule and `verbatimModuleSyntax` at the same time can lead to conflicting errors. +As such we recommend that you only ever use one _or_ the other -- never both. + +## When Not To Use It + +If you specifically want to use both import kinds for stylistic reasons, or don't wish to enforce one style over the other, you can avoid this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. + +## Related To + +- [`no-import-type-side-effects`](./no-import-type-side-effects.mdx) +- [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md) +- [`import/no-duplicates` with `{"prefer-inline": true}`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md#inline-type-imports) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.mdx new file mode 100644 index 0000000..02fb115 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.mdx @@ -0,0 +1,59 @@ +--- +description: 'Enforce default parameters to be last.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/default-param-last** for documentation. + +It adds support for optional parameters. + + + + +```ts +function f(a = 0, b: number) {} +function f(a: number, b = 0, c: number) {} +function f(a: number, b?: number, c: number) {} +class Foo { + constructor( + public a = 10, + private b: number, + ) {} +} +class Foo { + constructor( + public a?: number, + private b: number, + ) {} +} +``` + + + + +```ts +function f(a = 0) {} +function f(a: number, b = 0) {} +function f(a: number, b?: number) {} +function f(a: number, b?: number, c = 0) {} +function f(a: number, b = 0, c?: number) {} +class Foo { + constructor( + public a, + private b = 0, + ) {} +} +class Foo { + constructor( + public a, + private b?: number, + ) {} +} +``` + + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.mdx new file mode 100644 index 0000000..4231884 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.mdx @@ -0,0 +1,94 @@ +--- +description: 'Enforce dot notation whenever possible.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/dot-notation** for documentation. + +It adds: + +- Support for optionally ignoring computed `private` and/or `protected` member access. +- Compatibility with TypeScript's `noPropertyAccessFromIndexSignature` option. + +## Options + +This rule adds the following options: + +```ts +interface Options extends BaseDotNotationOptions { + allowPrivateClassPropertyAccess?: boolean; + allowProtectedClassPropertyAccess?: boolean; + allowIndexSignaturePropertyAccess?: boolean; +} + +const defaultOptions: Options = { + ...baseDotNotationDefaultOptions, + allowPrivateClassPropertyAccess: false, + allowProtectedClassPropertyAccess: false, + allowIndexSignaturePropertyAccess: false, +}; +``` + +If the TypeScript compiler option `noPropertyAccessFromIndexSignature` is set to `true`, then this rule always allows the use of square bracket notation to access properties of types that have a `string` index signature, even if `allowIndexSignaturePropertyAccess` is `false`. + +### `allowPrivateClassPropertyAccess` + +{/* insert option description */} + +This can be useful because TypeScript will report a type error on dot notation but not array notation. + +Example of a correct code when `allowPrivateClassPropertyAccess` is set to `true`: + +```ts option='{ "allowPrivateClassPropertyAccess": true }' showPlaygroundButton +class X { + private priv_prop = 123; +} + +const x = new X(); +x['priv_prop'] = 123; +``` + +### `allowProtectedClassPropertyAccess` + +{/* insert option description */} + +This can be useful because TypeScript will report a type error on dot notation but not array notation. + +Example of a correct code when `allowProtectedClassPropertyAccess` is set to `true`: + +```ts option='{ "allowProtectedClassPropertyAccess": true }' showPlaygroundButton +class X { + protected protected_prop = 123; +} + +const x = new X(); +x['protected_prop'] = 123; +``` + +### `allowIndexSignaturePropertyAccess` + +{/* insert option description */} + +Example of correct code when `allowIndexSignaturePropertyAccess` is set to `true`: + +```ts option='{ "allowIndexSignaturePropertyAccess": true }' showPlaygroundButton +class X { + [key: string]: number; +} + +const x = new X(); +x['hello'] = 123; +``` + +If the TypeScript compiler option `noPropertyAccessFromIndexSignature` is set to `true`, then the above code is always allowed, even if `allowIndexSignaturePropertyAccess` is `false`. + +## When Not To Use It + +If you specifically want to use both member access kinds for stylistic reasons, or don't wish to enforce one style over the other, you can avoid this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.mdx new file mode 100644 index 0000000..c449305 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.mdx @@ -0,0 +1,359 @@ +--- +description: 'Require explicit return types on functions and class methods.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/explicit-function-return-type** for documentation. + +Functions in TypeScript often don't need to be given an explicit return type annotation. +Leaving off the return type is less code to read or write and allows the compiler to infer it from the contents of the function. + +However, explicit return types do make it visually more clear what type is returned by a function. +They can also speed up TypeScript type checking performance in large codebases with many large functions. + +This rule enforces that functions do have an explicit return type annotation. + +## Examples + + + + +```ts +// Should indicate that no value is returned (void) +function test() { + return; +} + +// Should indicate that a number is returned +var fn = function () { + return 1; +}; + +// Should indicate that a string is returned +var arrowFn = () => 'test'; + +class Test { + // Should indicate that no value is returned (void) + method() { + return; + } +} +``` + + + + +```ts +// No return value should be expected (void) +function test(): void { + return; +} + +// A return value of type number +var fn = function (): number { + return 1; +}; + +// A return value of type string +var arrowFn = (): string => 'test'; + +class Test { + // No return value should be expected (void) + method(): void { + return; + } +} +``` + + + + +## Options + +### Configuring in a mixed JS/TS codebase + +If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files. + +```jsonc +{ + "rules": { + // disable the rule for all files + "@typescript-eslint/explicit-function-return-type": "off", + }, + "overrides": [ + { + // enable the rule specifically for TypeScript files + "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], + "rules": { + "@typescript-eslint/explicit-function-return-type": "error", + }, + }, + ], +} +``` + +### `allowExpressions` + +{/* insert option description */} + +Examples of code for this rule with `{ allowExpressions: true }`: + + + + +```ts option='{ "allowExpressions": true }' +function test() {} + +const fn = () => {}; + +export default () => {}; +``` + + + + +```ts option='{ "allowExpressions": true }' +node.addEventListener('click', () => {}); + +node.addEventListener('click', function () {}); + +const foo = arr.map(i => i * i); +``` + + + + +### `allowTypedFunctionExpressions` + +{/* insert option description */} + +Examples of code for this rule with `{ allowTypedFunctionExpressions: true }`: + + + + +```ts option='{ "allowTypedFunctionExpressions": true }' +let arrowFn = () => 'test'; + +let funcExpr = function () { + return 'test'; +}; + +let objectProp = { + foo: () => 1, +}; +``` + + + + +```ts option='{ "allowTypedFunctionExpressions": true }' +type FuncType = () => string; + +let arrowFn: FuncType = () => 'test'; + +let funcExpr: FuncType = function () { + return 'test'; +}; + +let asTyped = (() => '') as () => string; + +interface ObjectType { + foo(): number; +} +let objectProp: ObjectType = { + foo: () => 1, +}; +let objectPropAs = { + foo: () => 1, +} as ObjectType; + +declare function functionWithArg(arg: () => number); +functionWithArg(() => 1); + +declare function functionWithObjectArg(arg: { method: () => number }); +functionWithObjectArg({ + method() { + return 1; + }, +}); +``` + + + + +### `allowHigherOrderFunctions` + +{/* insert option description */} + +Examples of code for this rule with `{ allowHigherOrderFunctions: true }`: + + + + +```ts option='{ "allowHigherOrderFunctions": true }' +var arrowFn = () => () => {}; + +function fn() { + return function () {}; +} +``` + + + + +```ts option='{ "allowHigherOrderFunctions": true }' +var arrowFn = () => (): void => {}; + +function fn() { + return function (): void {}; +} +``` + + + + +### `allowDirectConstAssertionInArrowFunctions` + +{/* insert option description */} + +Examples of code for this rule with `{ allowDirectConstAssertionInArrowFunctions: true }`: + + + + +```ts option='{ "allowDirectConstAssertionInArrowFunctions": true }' +const func = (value: number) => ({ type: 'X', value }) as any; +const func = (value: number) => ({ type: 'X', value }) as Action; +``` + + + + +```ts option='{ "allowDirectConstAssertionInArrowFunctions": true }' +const func = (value: number) => ({ foo: 'bar', value }) as const; +const func = () => x as const; +``` + + + + +### `allowConciseArrowFunctionExpressionsStartingWithVoid` + +{/* insert option description */} + +Examples of code for this rule with `{ allowConciseArrowFunctionExpressionsStartingWithVoid: true }`: + + + + +```ts option='{ "allowConciseArrowFunctionExpressionsStartingWithVoid": true }' +var join = (a: string, b: string) => `${a}${b}`; + +const log = (message: string) => { + console.log(message); +}; +``` + + + + +```ts option='{ "allowConciseArrowFunctionExpressionsStartingWithVoid": true }' +var log = (message: string) => void console.log(message); +``` + + + + +### `allowFunctionsWithoutTypeParameters` + +{/* insert option description */} + +Examples of code for this rule with `{ allowFunctionsWithoutTypeParameters: true }`: + + + + +```ts option='{ "allowFunctionsWithoutTypeParameters": true }' +function foo(t: T) { + return t; +} + +const bar = (t: T) => t; +``` + + + + +```ts option='{ "allowFunctionsWithoutTypeParameters": true }' +function foo(t: T): T { + return t; +} + +const bar = (t: T): T => t; + +function allowedFunction(x: string) { + return x; +} + +const allowedArrow = (x: string) => x; +``` + + + + +### `allowedNames` + +{/* insert option description */} + +You may pass function/method names you would like this rule to ignore, like so: + +```json +{ + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowedNames": ["ignoredFunctionName", "ignoredMethodName"] + } + ] +} +``` + +### `allowIIFEs` + +{/* insert option description */} + +Examples of code for this rule with `{ allowIIFEs: true }`: + + + + +```ts option='{ "allowIIFEs": true }' +var func = () => 'foo'; +``` + + + + +```ts option='{ "allowIIFEs": true }' +var foo = (() => 'foo')(); + +var bar = (function () { + return 'bar'; +})(); +``` + + + + +## When Not To Use It + +If you don't find the added cost of explicitly writing function return types to be worth the visual clarity, or your project is not large enough for it to be a factor in type checking performance, then you will not need this rule. + +## Further Reading + +- TypeScript [Functions](https://www.typescriptlang.org/docs/handbook/functions.html#function-types) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.mdx new file mode 100644 index 0000000..67b78cb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.mdx @@ -0,0 +1,353 @@ +--- +description: 'Require explicit accessibility modifiers on class properties and methods.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/explicit-member-accessibility** for documentation. + +TypeScript allows placing explicit `public`, `protected`, and `private` accessibility modifiers in front of class members. +The modifiers exist solely in the type system and just serve to describe who is allowed to access those members. + +Leaving off accessibility modifiers makes for less code to read and write. +Members are `public` by default. + +However, adding in explicit accessibility modifiers can be helpful in codebases with many classes for enforcing proper privacy of members. +Some developers also find it preferable for code readability to keep member publicity explicit. + +## Examples + +This rule aims to make code more readable and explicit about who can use +which properties. + +## Options + +### Configuring in a mixed JS/TS codebase + +If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files. + +```jsonc +{ + "rules": { + // disable the rule for all files + "@typescript-eslint/explicit-member-accessibility": "off", + }, + "overrides": [ + { + // enable the rule specifically for TypeScript files + "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], + "rules": { + "@typescript-eslint/explicit-member-accessibility": "error", + }, + }, + ], +} +``` + +### `accessibility` + +{/* insert option description */} + +This rule in its default state requires no configuration and will enforce that every class member has an accessibility modifier. If you would like to allow for some implicit public members then you have the following options: + +```jsonc +{ + "accessibility": "explicit", + "overrides": { + "accessors": "explicit", + "constructors": "no-public", + "methods": "explicit", + "properties": "off", + "parameterProperties": "explicit", + }, +} +``` + +Note the above is an example of a possible configuration you could use - it is not the default configuration. + +The following patterns are considered incorrect code if no options are provided: + +```ts showPlaygroundButton +class Animal { + constructor(name) { + // No accessibility modifier + this.animalName = name; + } + animalName: string; // No accessibility modifier + get name(): string { + // No accessibility modifier + return this.animalName; + } + set name(value: string) { + // No accessibility modifier + this.animalName = value; + } + walk() { + // method + } +} +``` + +The following patterns are considered correct with the default options `{ accessibility: 'explicit' }`: + +```ts option='{ "accessibility": "explicit" }' showPlaygroundButton +class Animal { + public constructor( + public breed, + name, + ) { + // Parameter property and constructor + this.animalName = name; + } + private animalName: string; // Property + get name(): string { + // get accessor + return this.animalName; + } + set name(value: string) { + // set accessor + this.animalName = value; + } + public walk() { + // method + } +} +``` + +The following patterns are considered incorrect with the accessibility set to **no-public** `[{ accessibility: 'no-public' }]`: + +```ts option='{ "accessibility": "no-public" }' showPlaygroundButton +class Animal { + public constructor( + public breed, + name, + ) { + // Parameter property and constructor + this.animalName = name; + } + public animalName: string; // Property + public get name(): string { + // get accessor + return this.animalName; + } + public set name(value: string) { + // set accessor + this.animalName = value; + } + public walk() { + // method + } +} +``` + +The following patterns are considered correct with the accessibility set to **no-public** `[{ accessibility: 'no-public' }]`: + +```ts option='{ "accessibility": "no-public" }' showPlaygroundButton +class Animal { + constructor( + protected breed, + name, + ) { + // Parameter property and constructor + this.name = name; + } + private animalName: string; // Property + get name(): string { + // get accessor + return this.animalName; + } + private set name(value: string) { + // set accessor + this.animalName = value; + } + protected walk() { + // method + } +} +``` + +### `overrides` + +{/* insert option description */} + +There are three ways in which an override can be used. + +- To disallow the use of public on a given member. +- To enforce explicit member accessibility when the root has allowed implicit public accessibility +- To disable any checks on given member type + +#### Disallow the use of public on a given member + +e.g. `[ { overrides: { constructors: 'no-public' } } ]` + +The following patterns are considered incorrect with the example override + +```ts option='{ "overrides": { "constructors": "no-public" } }' showPlaygroundButton +class Animal { + public constructor(protected animalName) {} + public get name() { + return this.animalName; + } +} +``` + +The following patterns are considered correct with the example override + +```ts option='{ "overrides": { "constructors": "no-public" } }' showPlaygroundButton +class Animal { + constructor(protected animalName) {} + public get name() { + return this.animalName; + } +} +``` + +#### Require explicit accessibility for a given member + +e.g. `[ { accessibility: 'no-public', overrides: { properties: 'explicit' } } ]` + +The following patterns are considered incorrect with the example override + +```ts option='{ "accessibility": "no-public", "overrides": { "properties": "explicit" } }' showPlaygroundButton +class Animal { + constructor(protected animalName) {} + get name() { + return this.animalName; + } + protected set name(value: string) { + this.animalName = value; + } + legs: number; + private hasFleas: boolean; +} +``` + +The following patterns are considered correct with the example override + +```ts option='{ "accessibility": "no-public", "overrides": { "properties": "explicit" } }' showPlaygroundButton +class Animal { + constructor(protected animalName) {} + get name() { + return this.animalName; + } + protected set name(value: string) { + this.animalName = value; + } + public legs: number; + private hasFleas: boolean; +} +``` + +e.g. `[ { accessibility: 'off', overrides: { parameterProperties: 'explicit' } } ]` + +The following code is considered incorrect with the example override + +```ts option='{ "accessibility": "off", "overrides": { "parameterProperties": "explicit" } }' showPlaygroundButton +class Animal { + constructor(readonly animalName: string) {} +} +``` + +The following code patterns are considered correct with the example override + +```ts option='{ "accessibility": "off", "overrides": { "parameterProperties": "explicit" } }' showPlaygroundButton +class Animal { + constructor(public readonly animalName: string) {} +} + +class Animal { + constructor(public animalName: string) {} +} + +class Animal { + constructor(animalName: string) {} +} +``` + +e.g. `[ { accessibility: 'off', overrides: { parameterProperties: 'no-public' } } ]` + +The following code is considered incorrect with the example override + +```ts option='{ "accessibility": "off", "overrides": { "parameterProperties": "no-public" } }' showPlaygroundButton +class Animal { + constructor(public readonly animalName: string) {} +} +``` + +The following code is considered correct with the example override + +```ts option='{ "accessibility": "off", "overrides": { "parameterProperties": "no-public" } }' showPlaygroundButton +class Animal { + constructor(public animalName: string) {} +} +``` + +#### Disable any checks on given member type + +e.g. `[{ overrides: { accessors : 'off' } } ]` + +As no checks on the overridden member type are performed all permutations of visibility are permitted for that member type + +The follow pattern is considered incorrect for the given configuration + +```ts option='{ "overrides": { "accessors" : "off" } }' showPlaygroundButton +class Animal { + constructor(protected animalName) {} + public get name() { + return this.animalName; + } + get legs() { + return this.legCount; + } +} +``` + +The following patterns are considered correct with the example override + +```ts option='{ "overrides": { "accessors" : "off" } }' showPlaygroundButton +class Animal { + public constructor(protected animalName) {} + public get name() { + return this.animalName; + } + get legs() { + return this.legCount; + } +} +``` + +### `ignoredMethodNames` + +{/* insert option description */} + +Note that this option does not care about context, and will ignore every method with these names, which could lead to it missing some cases. You should use this sparingly. +e.g. `[ { ignoredMethodNames: ['specificMethod', 'whateverMethod'] } ]` + +```ts option='{ "ignoredMethodNames": ["specificMethod", "whateverMethod"] }' showPlaygroundButton +class Animal { + get specificMethod() { + console.log('No error because you specified this method on option'); + } + get whateverMethod() { + console.log('No error because you specified this method on option'); + } + public get otherMethod() { + console.log('This method comply with this rule'); + } +} +``` + +## When Not To Use It + +If you think defaulting to public is a good default, then you should consider using the `no-public` setting. +If you want to mix implicit and explicit public members then you can disable this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. + +## Further Reading + +- TypeScript [Accessibility Modifiers Handbook Docs](https://www.typescriptlang.org/docs/handbook/2/classes.html#member-visibility) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.mdx new file mode 100644 index 0000000..c4a21e2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.mdx @@ -0,0 +1,287 @@ +--- +description: "Require explicit return and argument types on exported functions' and classes' public class methods." +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/explicit-module-boundary-types** for documentation. + +Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output. +Adding explicit type annotations for those types can help improve code readability. +It can also improve TypeScript type checking performance on larger codebases. + +## Examples + + + + +```ts +// Should indicate that no value is returned (void) +export function test() { + return; +} + +// Should indicate that a string is returned +export var arrowFn = () => 'test'; + +// All arguments should be typed +export var arrowFn = (arg): string => `test ${arg}`; +export var arrowFn = (arg: any): string => `test ${arg}`; + +export class Test { + // Should indicate that no value is returned (void) + method() { + return; + } +} +``` + + + + +```ts +// A function with no return value (void) +export function test(): void { + return; +} + +// A return value of type string +export var arrowFn = (): string => 'test'; + +// All arguments should be typed +export var arrowFn = (arg: string): string => `test ${arg}`; +export var arrowFn = (arg: unknown): string => `test ${arg}`; + +export class Test { + // A class method with no return value (void) + method(): void { + return; + } +} + +// The function does not apply because it is not an exported function. +function test() { + return; +} +``` + + + + +## Options + +### Configuring in a mixed JS/TS codebase + +If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files. + +```jsonc +{ + "rules": { + // disable the rule for all files + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + "overrides": [ + { + // enable the rule specifically for TypeScript files + "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "error", + }, + }, + ], +} +``` + +### `allowArgumentsExplicitlyTypedAsAny` + +{/* insert option description */} + +Examples of code for this rule with `{ allowArgumentsExplicitlyTypedAsAny: false }`: + + + + +```ts option='{ "allowArgumentsExplicitlyTypedAsAny": false }' +export const func = (value: any): number => value + 1; +``` + + + + +```ts option='{ "allowArgumentsExplicitlyTypedAsAny": true }' +export const func = (value: any): number => value + 1; +``` + + + + +### `allowDirectConstAssertionInArrowFunctions` + +{/* insert option description */} + +Examples of code for this rule with `{ allowDirectConstAssertionInArrowFunctions: false }`: + + + + +```ts option='{ "allowDirectConstAssertionInArrowFunctions": false }' +export const func = (value: number) => ({ type: 'X', value }); +export const foo = () => ({ + bar: true, +}); +export const bar = () => 1; +``` + + + + +```ts option='{ "allowDirectConstAssertionInArrowFunctions": true }' +export const func = (value: number) => ({ type: 'X', value }) as const; +export const foo = () => + ({ + bar: true, + }) as const; +export const bar = () => 1 as const; +``` + + + + +### `allowedNames` + +{/* insert option description */} + +You may pass function/method names you would like this rule to ignore, like so: + +```json +{ + "@typescript-eslint/explicit-module-boundary-types": [ + "error", + { + "allowedNames": ["ignoredFunctionName", "ignoredMethodName"] + } + ] +} +``` + +### `allowHigherOrderFunctions` + +{/* insert option description */} + +Examples of code for this rule with `{ allowHigherOrderFunctions: false }`: + + + + +```ts option='{ "allowHigherOrderFunctions": false }' +export const arrowFn = () => () => {}; + +export function fn() { + return function () {}; +} + +export function foo(outer: string) { + return function (inner: string) {}; +} +``` + + + + +```ts option='{ "allowHigherOrderFunctions": true }' +export const arrowFn = () => (): void => {}; + +export function fn() { + return function (): void {}; +} + +export function foo(outer: string) { + return function (inner: string): void {}; +} +``` + + + + +### `allowTypedFunctionExpressions` + +{/* insert option description */} + +Examples of code for this rule with `{ allowTypedFunctionExpressions: false }`: + + + + +```ts option='{ "allowTypedFunctionExpressions": false }' +export let arrowFn = () => 'test'; + +export let funcExpr = function () { + return 'test'; +}; + +export let objectProp = { + foo: () => 1, +}; + +export const foo = bar => {}; +``` + + + + +```ts option='{ "allowTypedFunctionExpressions": true }' +type FuncType = () => string; + +export let arrowFn: FuncType = () => 'test'; + +export let funcExpr: FuncType = function () { + return 'test'; +}; + +export let asTyped = (() => '') as () => string; + +interface ObjectType { + foo(): number; +} +export let objectProp: ObjectType = { + foo: () => 1, +}; +export let objectPropAs = { + foo: () => 1, +} as ObjectType; + +type FooType = (bar: string) => void; +export const foo: FooType = bar => {}; +``` + + + + +### `allowOverloadFunctions` + +{/* insert option description */} + +Examples of correct code when `allowOverloadFunctions` is set to `true`: + +```ts option='{ "allowOverloadFunctions": true }' showPlaygroundButton +export function test(a: string): string; +export function test(a: number): number; +export function test(a: unknown) { + return a; +} +``` + +## When Not To Use It + +If your project is not used by downstream consumers that are sensitive to API types, you can disable this rule. + +## Further Reading + +- TypeScript [Functions](https://www.typescriptlang.org/docs/handbook/functions.html#function-types) + +## Related To + +- [explicit-function-return-type](./explicit-function-return-type.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.mdx new file mode 100644 index 0000000..ac5b10a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.mdx @@ -0,0 +1,12 @@ +--- +description: 'Require or disallow initialization in variable declarations.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/init-declarations** for documentation. + +It adds support for TypeScript's `declare` variables. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/max-params.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/max-params.mdx new file mode 100644 index 0000000..bddcba3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/max-params.mdx @@ -0,0 +1,54 @@ +--- +description: 'Enforce a maximum number of parameters in function definitions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/max-params** for documentation. + +It adds support for TypeScript `this` parameters so they won't be counted as a parameter. + +## Options + +This rule adds the following options: + +```ts +interface Options extends BaseMaxParamsOptions { + countVoidThis?: boolean; +} + +const defaultOptions: Options = { + ...baseMaxParamsOptions, + countVoidThis: false, +}; +``` + +### `countVoidThis` + +{/* insert option description */} + +Example of a code when `countVoidThis` is set to `false` and `max` is `1`: + + + + +```ts option='{ "countVoidThis": false, "max": 1 }' +function hasNoThis(this: void, first: string, second: string) { + // ... +} +``` + + + + +```ts option='{ "countVoidThis": false, "max": 1 }' +function hasNoThis(this: void, first: string) { + // ... +} +``` + + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.mdx new file mode 100644 index 0000000..82f8f84 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.mdx @@ -0,0 +1,1483 @@ +--- +description: 'Require a consistent member declaration order.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/member-ordering** for documentation. + +This rule aims to standardize the way classes, interfaces, and type literals are structured and ordered. +A consistent ordering of fields, methods and constructors can make code easier to read, navigate, and edit. + +:::note +This rule is _feature frozen_: it will no longer receive new features such as new options. +It still will accept bug and documentation fixes for its existing area of features. + +Stylistic rules that enforce naming and/or sorting conventions tend to grow incomprehensibly complex as increasingly obscure features are requested. +This rule has reached the limit of what is reasonable for the typescript-eslint project to maintain. +See [eslint-plugin: Feature freeze naming and sorting stylistic rules](https://github.com/typescript-eslint/typescript-eslint/issues/8792) for more information. +::: + +## Options + +```ts +interface Options { + default?: OrderConfig; + classes?: OrderConfig; + classExpressions?: OrderConfig; + interfaces?: OrderConfig; + typeLiterals?: OrderConfig; +} + +type OrderConfig = MemberType[] | SortedOrderConfig | 'never'; + +interface SortedOrderConfig { + memberTypes?: MemberType[] | 'never'; + optionalityOrder?: 'optional-first' | 'required-first'; + order?: + | 'alphabetically' + | 'alphabetically-case-insensitive' + | 'as-written' + | 'natural' + | 'natural-case-insensitive'; +} + +// See below for the more specific MemberType strings +type MemberType = string | string[]; +``` + +You can configure `OrderConfig` options for: + +- **`default`**: all constructs (used as a fallback) +- **`classes`**?: override ordering specifically for classes +- **`classExpressions`**?: override ordering specifically for class expressions +- **`interfaces`**?: override ordering specifically for interfaces +- **`typeLiterals`**?: override ordering specifically for type literals + +The `OrderConfig` settings for each kind of construct may configure sorting on up to three levels: + +- **`memberTypes`**: organizing on member type groups such as methods vs. properties +- **`optionalityOrder`**: whether to put all optional members first or all required members first +- **`order`**: organizing based on member names, such as alphabetically + +### Groups + +You can define many different groups based on different attributes of members. +The supported member attributes are, in order: + +- **Accessibility** (`'public' | 'protected' | 'private' | '#private'`) +- **Decoration** (`'decorated'`): Whether the member has an explicit accessibility decorator +- **Kind** (`'call-signature' | 'constructor' | 'field' | 'readonly-field' | 'get' | 'method' | 'set' | 'signature' | 'readonly-signature'`) + +Member attributes may be joined with a `'-'` to combine into more specific groups. +For example, `'public-field'` would come before `'private-field'`. + +### Orders + +The `order` value specifies what order members should be within a group. +It defaults to `as-written`, meaning any order is fine. +Other allowed values are: + +- `alphabetically`: Sorted in a-z alphabetical order, directly using string `<` comparison (so `B` comes before `a`) +- `alphabetically-case-insensitive`: Sorted in a-z alphabetical order, ignoring case (so `a` comes before `B`) +- `natural`: Same as `alphabetically`, but using [`natural-compare-lite`](https://github.com/litejs/natural-compare-lite) for more friendly sorting of numbers +- `natural-case-insensitive`: Same as `alphabetically-case-insensitive`, but using [`natural-compare-lite`](https://github.com/litejs/natural-compare-lite) for more friendly sorting of numbers + +### Default configuration + +The default configuration looks as follows: + +```jsonc +{ + "default": { + "memberTypes": [ + // Index signature + "signature", + "call-signature", + + // Fields + "public-static-field", + "protected-static-field", + "private-static-field", + "#private-static-field", + + "public-decorated-field", + "protected-decorated-field", + "private-decorated-field", + + "public-instance-field", + "protected-instance-field", + "private-instance-field", + "#private-instance-field", + + "public-abstract-field", + "protected-abstract-field", + + "public-field", + "protected-field", + "private-field", + "#private-field", + + "static-field", + "instance-field", + "abstract-field", + + "decorated-field", + + "field", + + // Static initialization + "static-initialization", + + // Constructors + "public-constructor", + "protected-constructor", + "private-constructor", + + "constructor", + + // Accessors + "public-static-accessor", + "protected-static-accessor", + "private-static-accessor", + "#private-static-accessor", + + "public-decorated-accessor", + "protected-decorated-accessor", + "private-decorated-accessor", + + "public-instance-accessor", + "protected-instance-accessor", + "private-instance-accessor", + "#private-instance-accessor", + + "public-abstract-accessor", + "protected-abstract-accessor", + + "public-accessor", + "protected-accessor", + "private-accessor", + "#private-accessor", + + "static-accessor", + "instance-accessor", + "abstract-accessor", + + "decorated-accessor", + + "accessor", + + // Getters + "public-static-get", + "protected-static-get", + "private-static-get", + "#private-static-get", + + "public-decorated-get", + "protected-decorated-get", + "private-decorated-get", + + "public-instance-get", + "protected-instance-get", + "private-instance-get", + "#private-instance-get", + + "public-abstract-get", + "protected-abstract-get", + + "public-get", + "protected-get", + "private-get", + "#private-get", + + "static-get", + "instance-get", + "abstract-get", + + "decorated-get", + + "get", + + // Setters + "public-static-set", + "protected-static-set", + "private-static-set", + "#private-static-set", + + "public-decorated-set", + "protected-decorated-set", + "private-decorated-set", + + "public-instance-set", + "protected-instance-set", + "private-instance-set", + "#private-instance-set", + + "public-abstract-set", + "protected-abstract-set", + + "public-set", + "protected-set", + "private-set", + "#private-set", + + "static-set", + "instance-set", + "abstract-set", + + "decorated-set", + + "set", + + // Methods + "public-static-method", + "protected-static-method", + "private-static-method", + "#private-static-method", + + "public-decorated-method", + "protected-decorated-method", + "private-decorated-method", + + "public-instance-method", + "protected-instance-method", + "private-instance-method", + "#private-instance-method", + + "public-abstract-method", + "protected-abstract-method", + + "public-method", + "protected-method", + "private-method", + "#private-method", + + "static-method", + "instance-method", + "abstract-method", + + "decorated-method", + + "method", + ], + }, +} +``` + +:::note +The default configuration contains member group types which contain other member types. +This is intentional to provide better error messages. +::: + +:::tip +By default, the members are not sorted. +If you want to sort them alphabetically, you have to provide a custom configuration. +::: + +## Examples + +### General Order on All Constructs + +This config specifies the order for all constructs. +It ignores member types other than signatures, methods, constructors, and fields. +It also ignores accessibility and scope. + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { "default": ["signature", "method", "constructor", "field"] }, + ], + }, +} +``` + + + + +```ts option='{ "default": ["signature", "method", "constructor", "field"] }' +interface Foo { + B: string; // -> field + + new (); // -> constructor + + A(): void; // -> method + + [Z: string]: any; // -> signature +} +``` + +```ts option='{ "default": ["signature", "method", "constructor", "field"] }' +type Foo = { + B: string; // -> field + + // no constructor + + A(): void; // -> method + + // no signature +}; +``` + +```ts option='{ "default": ["signature", "method", "constructor", "field"] }' +class Foo { + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field + + constructor() {} // -> constructor + + public static A(): void {} // -> method + public B(): void {} // -> method + + [Z: string]: any; // -> signature +} +``` + +```ts option='{ "default": ["signature", "method", "constructor", "field"] }' +const Foo = class { + private C: string; // -> field + public D: string; // -> field + + constructor() {} // -> constructor + + public static A(): void {} // -> method + public B(): void {} // -> method + + [Z: string]: any; // -> signature + + protected static E: string; // -> field +}; +``` + + + + +```ts option='{ "default": ["signature", "method", "constructor", "field"] }' +interface Foo { + [Z: string]: any; // -> signature + + A(): void; // -> method + + new (); // -> constructor + + B: string; // -> field +} +``` + +```ts option='{ "default": ["signature", "method", "constructor", "field"] }' +type Foo = { + // no signature + + A(): void; // -> method + + // no constructor + + B: string; // -> field +}; +``` + +```ts option='{ "default": ["signature", "method", "constructor", "field"] }' +class Foo { + [Z: string]: any; // -> signature + + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +} +``` + +```ts option='{ "default": ["signature", "method", "constructor", "field"] }' +const Foo = class { + [Z: string]: any; // -> signature + + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +}; +``` + + + + +### Classes + +#### Public Instance Methods Before Public Static Fields + +This config specifies that public instance methods should come first before public static fields. +Everything else can be placed anywhere. +It doesn't apply to interfaces or type literals as accessibility and scope are not part of them. + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { "default": ["public-instance-method", "public-static-field"] }, + ], + }, +} +``` + + + + +```ts option='{ "default": ["public-instance-method", "public-static-field"] }' +class Foo { + private C: string; // (irrelevant) + + public D: string; // (irrelevant) + + public static E: string; // -> public static field + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + [Z: string]: any; // (irrelevant) + + public B(): void {} // -> public instance method +} +``` + +```ts option='{ "default": ["public-instance-method", "public-static-field"] }' +const Foo = class { + private C: string; // (irrelevant) + + [Z: string]: any; // (irrelevant) + + public static E: string; // -> public static field + + public D: string; // (irrelevant) + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + public B(): void {} // -> public instance method +}; +``` + + + + +```ts option='{ "default": ["public-instance-method", "public-static-field"] }' +class Foo { + public B(): void {} // -> public instance method + + private C: string; // (irrelevant) + + public D: string; // (irrelevant) + + public static E: string; // -> public static field + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + [Z: string]: any; // (irrelevant) +} +``` + +```ts option='{ "default": ["public-instance-method", "public-static-field"] }' +const Foo = class { + public B(): void {} // -> public instance method + + private C: string; // (irrelevant) + + [Z: string]: any; // (irrelevant) + + public D: string; // (irrelevant) + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + public static E: string; // -> public static field +}; +``` + + + + +#### Static Fields Before Instance Fields + +This config specifies that static fields should come before instance fields, with public static fields first. +It doesn't apply to interfaces or type literals as accessibility and scope are not part of them. + +```jsonc +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { "default": ["public-static-field", "static-field", "instance-field"] }, + ], + }, +} +``` + + + + +```ts option='{ "default": ["public-static-field", "static-field", "instance-field"] }' +class Foo { + private E: string; // -> instance field + + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field + + public static A: string; // -> public static field + + [Z: string]: any; // (irrelevant) +} +``` + +```ts option='{ "default": ["public-static-field", "static-field", "instance-field"] }' +const foo = class { + public T(): void {} // method (irrelevant) + + private static B: string; // -> static field + + constructor() {} // constructor (irrelevant) + + private E: string; // -> instance field + + protected static C: string; // -> static field + private static D: string; // -> static field + + [Z: string]: any; // signature (irrelevant) + + public static A: string; // -> public static field +}; +``` + + + + +```ts option='{ "default": ["public-static-field", "static-field", "instance-field"] }' +class Foo { + public static A: string; // -> public static field + + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field + + private E: string; // -> instance field + + [Z: string]: any; // (irrelevant) +} +``` + +```ts option='{ "default": ["public-static-field", "static-field", "instance-field"] }' +const foo = class { + [Z: string]: any; // -> signature (irrelevant) + + public static A: string; // -> public static field + + constructor() {} // -> constructor (irrelevant) + + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field + + private E: string; // -> instance field + + public T(): void {} // -> method (irrelevant) +}; +``` + + + + +#### Class Declarations + +This config only specifies an order for classes: methods, then the constructor, then fields. +It does not apply to class expressions (use `classExpressions` for them). +Default settings will be used for class declarations and all other syntax constructs other than class declarations. + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { "classes": ["method", "constructor", "field"] }, + ], + }, +} +``` + + + + +```ts option='{ "classes": ["method", "constructor", "field"] }' +class Foo { + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field + + constructor() {} // -> constructor + + public static A(): void {} // -> method + public B(): void {} // -> method +} +``` + + + + +```ts option='{ "classes": ["method", "constructor", "field"] }' +class Foo { + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +} +``` + + + + +#### Class Expressions + +This config only specifies an order for classes expressions: methods, then the constructor, then fields. +It does not apply to class declarations (use `classes` for them). +Default settings will be used for class declarations and all other syntax constructs other than class expressions. + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { "classExpressions": ["method", "constructor", "field"] }, + ], + }, +} +``` + + + + +```ts option='{ "classExpressions": ["method", "constructor", "field"] }' +const foo = class { + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field + + constructor() {} // -> constructor + + public static A(): void {} // -> method + public B(): void {} // -> method +}; +``` + + + + +```ts option='{ "classExpressions": ["method", "constructor", "field"] }' +const foo = class { + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +}; +``` + + + + +### Interfaces + +This config only specifies an order for interfaces: signatures, then methods, then constructors, then fields. +It does not apply to type literals (use `typeLiterals` for them). +Default settings will be used for type literals and all other syntax constructs other than class expressions. + +:::note +These member types are the only ones allowed for `interfaces`. +::: + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { "interfaces": ["signature", "method", "constructor", "field"] }, + ], + }, +} +``` + + + + +```ts option='{ "interfaces": ["signature", "method", "constructor", "field"] }' +interface Foo { + B: string; // -> field + + new (); // -> constructor + + A(): void; // -> method + + [Z: string]: any; // -> signature +} +``` + + + + +```ts option='{ "interfaces": ["signature", "method", "constructor", "field"] }' +interface Foo { + [Z: string]: any; // -> signature + + A(): void; // -> method + + new (); // -> constructor + + B: string; // -> field +} +``` + + + + +### Type Literals + +This config only specifies an order for type literals: signatures, then methods, then constructors, then fields. +It does not apply to interfaces (use `interfaces` for them). +Default settings will be used for interfaces and all other syntax constructs other than class expressions. + +:::note +These member types are the only ones allowed for `typeLiterals`. +::: + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { "typeLiterals": ["signature", "method", "constructor", "field"] }, + ], + }, +} +``` + + + + +```ts option='{ "typeLiterals": ["signature", "method", "constructor", "field"] }' +type Foo = { + B: string; // -> field + + A(): void; // -> method + + new (); // -> constructor + + [Z: string]: any; // -> signature +}; +``` + + + + +```ts option='{ "typeLiterals": ["signature", "method", "constructor", "field"] }' +type Foo = { + [Z: string]: any; // -> signature + + A(): void; // -> method + + new (); // -> constructor + + B: string; // -> field +}; +``` + + + + +### Sorting Options + +#### Sorting Alphabetically Within Member Groups + +The default member order will be applied if `memberTypes` is not specified. +You can see the default order in [Default Configuration](#default-configuration). + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": { + "order": "alphabetically", + }, + }, + ], + }, +} +``` + + + + +```ts option='{"default":{"order":"alphabetically"}}' +interface Foo { + a: x; + B: x; + c: x; + + B(): void; + c(): void; + a(): void; +} +``` + + + + +```ts option='{"default":{"order":"alphabetically"}}' +interface Foo { + B: x; + a: x; + c: x; + + B(): void; + a(): void; + c(): void; +} +``` + + + + +#### Sorting Alphabetically Within Custom Member Groups + +This config specifies that within each custom `memberTypes` group, members are in an alphabetic case-sensitive order. + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": { + "memberTypes": ["method", "field"], + "order": "alphabetically", + }, + }, + ], + }, +} +``` + + + + +```ts option='{"default":{"memberTypes":["method","field"],"order":"alphabetically"}}' +interface Foo { + B(): void; + c(): void; + a(): void; + + a: x; + B: x; + c: x; +} +``` + + + + +```ts option='{"default":{"memberTypes":["method","field"],"order":"alphabetically"}}' +interface Foo { + B(): void; + a(): void; + c(): void; + + B: x; + a: x; + c: x; +} +``` + + + + +#### Sorting Alphabetically Case Insensitive Within Member Groups + +The default member order will be applied if `memberTypes` is not specified. +You can see the default order in [Default Configuration](#default-configuration). + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": { + "order": "alphabetically-case-insensitive", + }, + }, + ], + }, +} +``` + + + + +```ts option='{"default":{"order":"alphabetically-case-insensitive"}}' +interface Foo { + B: x; + a: x; + c: x; + + B(): void; + c(): void; + a(): void; +} +``` + + + + +```ts option='{"default":{"order":"alphabetically-case-insensitive"}}' +interface Foo { + a: x; + B: x; + c: x; + + a(): void; + B(): void; + c(): void; +} +``` + + + + +#### Sorting Alphabetically Ignoring Member Groups + +This config specifies that members are all sorted in an alphabetic case-sensitive order. +It ignores any member group types completely by specifying `"never"` for `memberTypes`. + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { "default": { "memberTypes": "never", "order": "alphabetically" } }, + ], + }, +} +``` + + + + +```ts option='{ "default": { "memberTypes": "never", "order": "alphabetically" } }' +interface Foo { + b(): void; + a: boolean; + + [a: string]: number; + new (): Bar; + (): Baz; +} +``` + + + + +```ts option='{ "default": { "memberTypes": "never", "order": "alphabetically" } }' +interface Foo { + [a: string]: number; + a: boolean; + b(): void; + + (): Baz; + new (): Bar; +} +``` + + + + +#### Sorting Optional Members First or Last + +The `optionalityOrder` option may be enabled to place all optional members in a group at the beginning or end of that group. + +This config places all optional members before all required members: + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": { + "optionalityOrder": "optional-first", + "order": "alphabetically", + }, + }, + ], + }, +} +``` + + + + +```ts option='{ "default": { "optionalityOrder": "optional-first", "order": "alphabetically" } }' +interface Foo { + a: boolean; + b?: number; + c: string; +} +``` + + + + +```ts option='{ "default": { "optionalityOrder": "optional-first", "order": "alphabetically" } }' +interface Foo { + b?: number; + a: boolean; + c: string; +} +``` + + + + +This config places all required members before all optional members: + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": { + "optionalityOrder": "required-first", + "order": "alphabetically", + }, + }, + ], + }, +} +``` + + + + +```ts option='{ "default": { "optionalityOrder": "required-first", "order": "alphabetically" } }' +interface Foo { + a: boolean; + b?: number; + c: string; +} +``` + + + + +```ts option='{ "default": { "optionalityOrder": "required-first", "order": "alphabetically" } }' +interface Foo { + a: boolean; + c: string; + b?: number; +} +``` + + + + +## All Supported Options + +### Member Types (Granular Form) + +There are multiple ways to specify the member types. +The most explicit and granular form is the following: + +```jsonc +[ + // Index signature + "signature", + "readonly-signature", + + // Fields + "public-static-field", + "public-static-readonly-field", + "protected-static-field", + "protected-static-readonly-field", + "private-static-field", + "private-static-readonly-field", + "#private-static-field", + "#private-static-readonly-field", + + "public-decorated-field", + "public-decorated-readonly-field", + "protected-decorated-field", + "protected-decorated-readonly-field", + "private-decorated-field", + "private-decorated-readonly-field", + + "public-instance-field", + "public-instance-readonly-field", + "protected-instance-field", + "protected-instance-readonly-field", + "private-instance-field", + "private-instance-readonly-field", + "#private-instance-field", + "#private-instance-readonly-field", + + "public-abstract-field", + "public-abstract-readonly-field", + "protected-abstract-field", + "protected-abstract-readonly-field", + + "public-field", + "public-readonly-field", + "protected-field", + "protected-readonly-field", + "private-field", + "private-readonly-field" + "#private-field", + "#private-readonly-field" + + "static-field", + "static-readonly-field", + "instance-field", + "instance-readonly-field" + "abstract-field", + "abstract-readonly-field", + + "decorated-field", + "decorated-readonly-field", + + "field", + "readonly-field", + + // Static initialization + "static-initialization", + + // Constructors + "public-constructor", + "protected-constructor", + "private-constructor", + + // Getters + "public-static-get", + "protected-static-get", + "private-static-get", + "#private-static-get", + + "public-decorated-get", + "protected-decorated-get", + "private-decorated-get", + + "public-instance-get", + "protected-instance-get", + "private-instance-get", + "#private-instance-get", + + "public-abstract-get", + "protected-abstract-get", + + "public-get", + "protected-get", + "private-get", + "#private-get", + + "static-get", + "instance-get", + "abstract-get", + + "decorated-get", + + "get", + + // Setters + "public-static-set", + "protected-static-set", + "private-static-set", + "#private-static-set", + + "public-decorated-set", + "protected-decorated-set", + "private-decorated-set", + + "public-instance-set", + "protected-instance-set", + "private-instance-set", + "#private-instance-set", + + "public-abstract-set", + "protected-abstract-set", + + "public-set", + "protected-set", + "private-set", + + "static-set", + "instance-set", + "abstract-set", + + "decorated-set", + + "set", + + // Methods + "public-static-method", + "protected-static-method", + "private-static-method", + "#private-static-method", + "public-decorated-method", + "protected-decorated-method", + "private-decorated-method", + "public-instance-method", + "protected-instance-method", + "private-instance-method", + "#private-instance-method", + "public-abstract-method", + "protected-abstract-method" +] +``` + +:::note +If you only specify some of the possible types, the non-specified ones can have any particular order. +This means that they can be placed before, within or after the specified types and the linter won't complain about it. +::: + +### Member Group Types (With Accessibility, Ignoring Scope) + +It is also possible to group member types by their accessibility (`static`, `instance`, `abstract`), ignoring their scope. + +```jsonc +[ + // Index signature + // No accessibility for index signature. + + // Fields + "public-field", // = ["public-static-field", "public-instance-field"] + "protected-field", // = ["protected-static-field", "protected-instance-field"] + "private-field", // = ["private-static-field", "private-instance-field"] + + // Static initialization + // No accessibility for static initialization. + + // Constructors + // Only the accessibility of constructors is configurable. See below. + + // Getters + "public-get", // = ["public-static-get", "public-instance-get"] + "protected-get", // = ["protected-static-get", "protected-instance-get"] + "private-get", // = ["private-static-get", "private-instance-get"] + + // Setters + "public-set", // = ["public-static-set", "public-instance-set"] + "protected-set", // = ["protected-static-set", "protected-instance-set"] + "private-set", // = ["private-static-set", "private-instance-set"] + + // Methods + "public-method", // = ["public-static-method", "public-instance-method"] + "protected-method", // = ["protected-static-method", "protected-instance-method"] + "private-method", // = ["private-static-method", "private-instance-method"] +] +``` + +### Member Group Types (With Accessibility and a Decorator) + +It is also possible to group methods or fields with a decorator separately, optionally specifying +their accessibility. + +```jsonc +[ + // Index signature + // No decorators for index signature. + + // Fields + "public-decorated-field", + "protected-decorated-field", + "private-decorated-field", + + "decorated-field", // = ["public-decorated-field", "protected-decorated-field", "private-decorated-field"] + + // Static initialization + // No decorators for static initialization. + + // Constructors + // There are no decorators for constructors. + + // Getters + "public-decorated-get", + "protected-decorated-get", + "private-decorated-get", + + "decorated-get", // = ["public-decorated-get", "protected-decorated-get", "private-decorated-get"] + + // Setters + "public-decorated-set", + "protected-decorated-set", + "private-decorated-set", + + "decorated-set", // = ["public-decorated-set", "protected-decorated-set", "private-decorated-set"] + + // Methods + "public-decorated-method", + "protected-decorated-method", + "private-decorated-method", + + "decorated-method", // = ["public-decorated-method", "protected-decorated-method", "private-decorated-method"] +] +``` + +### Member Group Types (With Scope, Ignoring Accessibility) + +Another option is to group the member types by their scope (`public`, `protected`, `private`), ignoring their accessibility. + +```jsonc +[ + // Index signature + // No scope for index signature. + + // Fields + "static-field", // = ["public-static-field", "protected-static-field", "private-static-field"] + "instance-field", // = ["public-instance-field", "protected-instance-field", "private-instance-field"] + "abstract-field", // = ["public-abstract-field", "protected-abstract-field"] + + // Static initialization + // No scope for static initialization. + + // Constructors + "constructor", // = ["public-constructor", "protected-constructor", "private-constructor"] + + // Getters + "static-get", // = ["public-static-get", "protected-static-get", "private-static-get"] + "instance-get", // = ["public-instance-get", "protected-instance-get", "private-instance-get"] + "abstract-get", // = ["public-abstract-get", "protected-abstract-get"] + + // Setters + "static-set", // = ["public-static-set", "protected-static-set", "private-static-set"] + "instance-set", // = ["public-instance-set", "protected-instance-set", "private-instance-set"] + "abstract-set", // = ["public-abstract-set", "protected-abstract-set"] + + // Methods + "static-method", // = ["public-static-method", "protected-static-method", "private-static-method"] + "instance-method", // = ["public-instance-method", "protected-instance-method", "private-instance-method"] + "abstract-method", // = ["public-abstract-method", "protected-abstract-method"] +] +``` + +### Member Group Types (With Scope and Accessibility) + +The third grouping option is to ignore both scope and accessibility. + +```jsonc +[ + // Index signature + // No grouping for index signature. + + // Fields + "field", // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", + // "public-abstract-field", "protected-abstract-field"] + + // Static initialization + // No grouping for static initialization. + + // Constructors + // Only the accessibility of constructors is configurable. + + // Getters + "get", // = ["public-static-get", "protected-static-get", "private-static-get", "public-instance-get", "protected-instance-get", "private-instance-get", + // "public-abstract-get", "protected-abstract-get"] + + // Setters + "set", // = ["public-static-set", "protected-static-set", "private-static-set", "public-instance-set", "protected-instance-set", "private-instance-set", + // "public-abstract-set", "protected-abstract-set"] + + // Methods + "method", // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method", + // "public-abstract-method", "protected-abstract-method"] +] +``` + +### Member Group Types (Readonly Fields) + +It is possible to group fields by their `readonly` modifiers. + +```jsonc +[ + // Index signature + "readonly-signature", + "signature", + + // Fields + "readonly-field", // = ["public-static-readonly-field", "protected-static-readonly-field", "private-static-readonly-field", "public-instance-readonly-field", "protected-instance-readonly-field", "private-instance-readonly-field", "public-abstract-readonly-field", "protected-abstract-readonly-field"] + "field", // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", "public-abstract-field", "protected-abstract-field"] +] +``` + +### Grouping Different Member Types at the Same Rank + +It is also possible to group different member types at the same rank. + +```jsonc +[ + // Index signature + "signature", + + // Fields + "field", + + // Static initialization + "static-initialization", + + // Constructors + "constructor", + + // Getters and Setters at the same rank + ["get", "set"], + + // Methods + "method", +] +``` + +## When Not To Use It + +If you don't care about the general order of your members, then you will not need this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.mdx new file mode 100644 index 0000000..1f26962 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.mdx @@ -0,0 +1,124 @@ +--- +description: 'Enforce using a particular method signature syntax.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/method-signature-style** for documentation. + +TypeScript provides two ways to define an object/interface function property: + +```ts +interface Example { + // method shorthand syntax + func(arg: string): number; + + // regular property with function type + func: (arg: string) => number; +} +``` + +The two are very similar; most of the time it doesn't matter which one you use. + +A good practice is to use the TypeScript's `strict` option (which implies `strictFunctionTypes`) which enables correct typechecking for function properties only (method signatures get old behavior). + +TypeScript FAQ: + +> A method and a function property of the same type behave differently. +> Methods are always bivariant in their argument, while function properties are contravariant in their argument under `strictFunctionTypes`. + +See the reasoning behind that in the [TypeScript PR for the compiler option](https://github.com/microsoft/TypeScript/pull/18654). + +## Options + +This rule accepts one string option: + +- `"property"`: Enforce using property signature for functions. Use this to enforce maximum correctness together with TypeScript's strict mode. +- `"method"`: Enforce using method signature for functions. Use this if you aren't using TypeScript's strict mode and prefer this style. + +### `property` + +{/* insert option description */} + +Examples of code with `property` option. + + + + +```ts option='"property"' +interface T1 { + func(arg: string): number; +} +type T2 = { + func(arg: boolean): void; +}; +interface T3 { + func(arg: number): void; + func(arg: string): void; + func(arg: boolean): void; +} +``` + + + + +```ts option='"property"' +interface T1 { + func: (arg: string) => number; +} +type T2 = { + func: (arg: boolean) => void; +}; +// this is equivalent to the overload +interface T3 { + func: ((arg: number) => void) & + ((arg: string) => void) & + ((arg: boolean) => void); +} +``` + + + + +### `method` + +{/* insert option description */} + +Examples of code with `method` option. + + + + +```ts option='"method"' +interface T1 { + func: (arg: string) => number; +} +type T2 = { + func: (arg: boolean) => void; +}; +``` + + + + +```ts option='"method"' +interface T1 { + func(arg: string): number; +} +type T2 = { + func(arg: boolean): void; +}; +``` + + + + +## When Not To Use It + +If you don't want to enforce a particular style for object/interface function types, and/or if you don't use `strictFunctionTypes`, then you don't need this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.mdx new file mode 100644 index 0000000..e129b44 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.mdx @@ -0,0 +1,755 @@ +--- +description: 'Enforce naming conventions for everything across a codebase.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/naming-convention** for documentation. + +Enforcing naming conventions helps keep the codebase consistent, and reduces overhead when thinking about how to name a variable. +Additionally, a well-designed style guide can help communicate intent, such as by enforcing all private properties begin with an `_`, and all global-level constants are written in `UPPER_CASE`. + +:::note +This rule is _feature frozen_: it will no longer receive new features such as new options. +It still will accept bug and documentation fixes for its existing area of features and to support new TypeScript versions. + +Stylistic rules that enforce naming and/or sorting conventions tend to grow incomprehensibly complex as increasingly obscure features are requested. +This rule has reached the limit of what is reasonable for the typescript-eslint project to maintain. +See [eslint-plugin: Feature freeze naming and sorting stylistic rules](https://github.com/typescript-eslint/typescript-eslint/issues/8792) for more information. +::: + +## Examples + +This rule allows you to enforce conventions for any identifier, using granular selectors to create a fine-grained style guide. + +:::note + +This rule only needs type information in specific cases, detailed below. + +::: + +## Options + +This rule accepts an array of objects, with each object describing a different naming convention. +Each property will be described in detail below. Also see the examples section below for illustrated examples. + +```ts +type Options = { + // format options + format: + | ( + | 'camelCase' + | 'strictCamelCase' + | 'PascalCase' + | 'StrictPascalCase' + | 'snake_case' + | 'UPPER_CASE' + )[] + | null; + custom?: { + regex: string; + match: boolean; + }; + leadingUnderscore?: + | 'forbid' + | 'require' + | 'requireDouble' + | 'allow' + | 'allowDouble' + | 'allowSingleOrDouble'; + trailingUnderscore?: + | 'forbid' + | 'require' + | 'requireDouble' + | 'allow' + | 'allowDouble' + | 'allowSingleOrDouble'; + prefix?: string[]; + suffix?: string[]; + + // selector options + selector: Selector | Selector[]; + filter?: + | string + | { + regex: string; + match: boolean; + }; + // the allowed values for these are dependent on the selector - see below + modifiers?: Modifiers[]; + types?: Types[]; +}[]; + +// the default config is similar to ESLint's camelcase rule but more strict +const defaultOptions: Options = [ + { + selector: 'default', + format: ['camelCase'], + leadingUnderscore: 'allow', + trailingUnderscore: 'allow', + }, + + { + selector: 'import', + format: ['camelCase', 'PascalCase'], + }, + + { + selector: 'variable', + format: ['camelCase', 'UPPER_CASE'], + leadingUnderscore: 'allow', + trailingUnderscore: 'allow', + }, + + { + selector: 'typeLike', + format: ['PascalCase'], + }, +]; +``` + +### Format Options + +Every single selector can have the same set of format options. +For information about how each selector is applied, see ["How does the rule evaluate a name's format?"](#how-does-the-rule-evaluate-a-names-format). + +#### `format` + +The `format` option defines the allowed formats for the identifier. This option accepts an array of the following values, and the identifier can match any of them: + +- `camelCase` - standard camelCase format - no underscores are allowed between characters, and consecutive capitals are allowed (i.e. both `myID` and `myId` are valid). +- `PascalCase` - same as `camelCase`, except the first character must be upper-case. +- `snake_case` - standard snake_case format - all characters must be lower-case, and underscores are allowed. +- `strictCamelCase` - same as `camelCase`, but consecutive capitals are not allowed (i.e. `myId` is valid, but `myID` is not). +- `StrictPascalCase` - same as `strictCamelCase`, except the first character must be upper-case. +- `UPPER_CASE` - same as `snake_case`, except all characters must be upper-case. + +Instead of an array, you may also pass `null`. This signifies "this selector shall not have its format checked". +This can be useful if you want to enforce no particular format for a specific selector, after applying a group selector. + +#### `custom` + +The `custom` option defines a custom regex that the identifier must (or must not) match. This option allows you to have a bit more finer-grained control over identifiers, letting you ban (or force) certain patterns and substrings. +Accepts an object with the following properties: + +- `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`. +- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)` + +#### `filter` + +The `filter` option operates similar to `custom`, accepting the same shaped object, except that it controls if the rest of the configuration should or should not be applied to an identifier. + +You can use this to include or exclude specific identifiers from specific configurations. + +Accepts an object with the following properties: + +- `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`. +- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)` + +Alternatively, `filter` accepts a regular expression (anything accepted into `new RegExp(filter)`). In this case, it's treated as if you had passed an object with the regex and `match: true`. + +#### `leadingUnderscore` / `trailingUnderscore` + +The `leadingUnderscore` / `trailingUnderscore` options control whether leading/trailing underscores are considered valid. Accepts one of the following values: + +- `allow` - existence of a single leading/trailing underscore is not explicitly enforced. +- `allowDouble` - existence of a double leading/trailing underscore is not explicitly enforced. +- `allowSingleOrDouble` - existence of a single or a double leading/trailing underscore is not explicitly enforced. +- `forbid` - a leading/trailing underscore is not allowed at all. +- `require` - a single leading/trailing underscore must be included. +- `requireDouble` - two leading/trailing underscores must be included. + +#### `prefix` / `suffix` + +The `prefix` / `suffix` options control which prefix/suffix strings must exist for the identifier. Accepts an array of strings. + +If these are provided, the identifier must start with one of the provided values. For example, if you provide `{ prefix: ['Class', 'IFace', 'Type'] }`, then the following names are valid: `ClassBar`, `IFaceFoo`, `TypeBaz`, but the name `Bang` is not valid, as it contains none of the prefixes. + +**Note:** As [documented above](#format-options), the prefix is trimmed before format is validated, therefore PascalCase must be used to allow variables such as `isEnabled` using the prefix `is`. + +### Selector Options + +- `selector` allows you to specify what types of identifiers to target. + - Accepts one or array of selectors to define an option block that applies to one or multiple selectors. + - For example, if you provide `{ selector: ['function', 'variable'] }`, then it will apply the same option to variable and function nodes. + - See [Allowed Selectors, Modifiers and Types](#allowed-selectors-modifiers-and-types) below for the complete list of allowed selectors. +- `modifiers` allows you to specify which modifiers to granularly apply to, such as the accessibility (`#private`/`private`/`protected`/`public`), or if the thing is `static`, etc. + - The name must match _all_ of the modifiers. + - For example, if you provide `{ modifiers: ['private','readonly','static'] }`, then it will only match something that is `private static readonly`, and something that is just `private` will not match. + - The following `modifiers` are allowed: + - `abstract`,`override`,`private`,`protected`,`readonly`,`static` - matches any member explicitly declared with the given modifier. + - `async` - matches any method, function, or function variable which is async via the `async` keyword (e.g. does not match functions that return promises without using `async` keyword) + - `const` - matches a variable declared as being `const` (`const x = 1`). + - `destructured` - matches a variable declared via an object destructuring pattern (`const {x, z = 2}`). + - Note that this does not match renamed destructured properties (`const {x: y, a: b = 2}`). + - `exported` - matches anything that is exported from the module. + - `global` - matches a variable/function declared in the top-level scope. + - `#private` - matches any member with a private identifier (an identifier that starts with `#`) + - `public` - matches any member that is either explicitly declared as `public`, or has no visibility modifier (i.e. implicitly public). + - `requiresQuotes` - matches any name that requires quotes as it is not a valid identifier (i.e. has a space, a dash, etc in it). + - `unused` - matches anything that is not used. +- `types` allows you to specify which types to match. This option supports simple, primitive types only (`array`,`boolean`,`function`,`number`,`string`). + - The name must match _one_ of the types. + - **_NOTE - Using this option will require that you lint with type information._** + - For example, this lets you do things like enforce that `boolean` variables are prefixed with a verb. + - The following `types` are allowed: + - `array` matches any type assignable to `Array | null | undefined` + - `boolean` matches any type assignable to `boolean | null | undefined` + - `function` matches any type assignable to `Function | null | undefined` + - `number` matches any type assignable to `number | null | undefined` + - `string` matches any type assignable to `string | null | undefined` + +The ordering of selectors does not matter. The implementation will automatically sort the selectors to ensure they match from most-specific to least specific. It will keep checking selectors in that order until it finds one that matches the name. See ["How does the rule automatically order selectors?"](#how-does-the-rule-automatically-order-selectors) + +#### Allowed Selectors, Modifiers and Types + +There are two types of selectors, individual selectors, and grouped selectors. + +##### Individual Selectors + +Individual Selectors match specific, well-defined sets. There is no overlap between each of the individual selectors. + +- `classicAccessor` - matches any accessor. It refers to the methods attached to `get` and `set` syntax. + - Allowed `modifiers`: `abstract`, `override`, `private`, `protected`, `public`, `requiresQuotes`, `static`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `autoAccessor` - matches any auto-accessor. An auto-accessor is just a class field starting with an `accessor` keyword. + - Allowed `modifiers`: `abstract`, `override`, `private`, `protected`, `public`, `requiresQuotes`, `static`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `class` - matches any class declaration. + - Allowed `modifiers`: `abstract`, `exported`, `unused`. + - Allowed `types`: none. +- `classMethod` - matches any class method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors. + - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `requiresQuotes`, `static`. + - Allowed `types`: none. +- `classProperty` - matches any class property. Does not match properties that have direct function expression or arrow function expression values. + - Allowed `modifiers`: `abstract`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `enum` - matches any enum declaration. + - Allowed `modifiers`: `exported`, `unused`. + - Allowed `types`: none. +- `enumMember` - matches any enum member. + - Allowed `modifiers`: `requiresQuotes`. + - Allowed `types`: none. +- `function` - matches any named function declaration or named function expression. + - Allowed `modifiers`: `async`, `exported`, `global`, `unused`. + - Allowed `types`: none. +- `import` - matches namespace imports and default imports (i.e. does not match named imports). + - Allowed `modifiers`: `default`, `namespace`. + - Allowed `types`: none. +- `interface` - matches any interface declaration. + - Allowed `modifiers`: `exported`, `unused`. + - Allowed `types`: none. +- `objectLiteralMethod` - matches any object literal method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors. + - Allowed `modifiers`: `async`, `public`, `requiresQuotes`. + - Allowed `types`: none. +- `objectLiteralProperty` - matches any object literal property. Does not match properties that have direct function expression or arrow function expression values. + - Allowed `modifiers`: `public`, `requiresQuotes`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `parameter` - matches any function parameter. Does not match parameter properties. + - Allowed `modifiers`: `destructured`, `unused`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `parameterProperty` - matches any parameter property. + - Allowed `modifiers`: `private`, `protected`, `public`, `readonly`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `typeAlias` - matches any type alias declaration. + - Allowed `modifiers`: `exported`, `unused`. + - Allowed `types`: none. +- `typeMethod` - matches any object type method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors. + - Allowed `modifiers`: `public`, `requiresQuotes`. + - Allowed `types`: none. +- `typeParameter` - matches any generic type parameter declaration. + - Allowed `modifiers`: `unused`. + - Allowed `types`: none. +- `typeProperty` - matches any object type property. Does not match properties that have direct function expression or arrow function expression values. + - Allowed `modifiers`: `public`, `readonly`, `requiresQuotes`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `variable` - matches any `const` / `let` / `var` variable name. + - Allowed `modifiers`: `async`, `const`, `destructured`, `exported`, `global`, `unused`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. + +##### Group Selectors + +Group Selectors are provided for convenience, and essentially bundle up sets of individual selectors. + +- `default` - matches everything. + - Allowed `modifiers`: all modifiers. + - Allowed `types`: none. +- `accessor` - matches the same as `classicAccessor` and `autoAccessor`. + - Allowed `modifiers`: `abstract`, `override`, `private`, `protected`, `public`, `requiresQuotes`, `static`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `memberLike` - matches the same as `classicAccessor`, `autoAccessor`, `enumMember`, `method`, `parameterProperty`, `property`. + - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. + - Allowed `types`: none. +- `method` - matches the same as `classMethod`, `objectLiteralMethod`, `typeMethod`. + - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. + - Allowed `types`: none. +- `property` - matches the same as `classProperty`, `objectLiteralProperty`, `typeProperty`. + - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. +- `typeLike` - matches the same as `class`, `enum`, `interface`, `typeAlias`, `typeParameter`. + - Allowed `modifiers`: `abstract`, `unused`. + - Allowed `types`: none. +- `variableLike` - matches the same as `function`, `parameter` and `variable`. + - Allowed `modifiers`: `async`, `unused`. + - Allowed `types`: none. + +## FAQ + +This is a big rule, and there's a lot of docs. Here are a few clarifications that people often ask about or figure out via trial-and-error. + +### How does the rule evaluate a selector? + +Each selector is checked in the following way: + +1. check the `filter` + 1. if `filter` is omitted → skip this step. + 2. if the name matches the `filter` → continue evaluating this selector. + 3. if the name does not match the `filter` → skip this selector and continue to the next selector. +2. check the `selector` + 1. if `selector` is one individual selector → the name's type must be of that type. + 2. if `selector` is a group selector → the name's type must be one of the grouped types. + 3. if `selector` is an array of selectors → apply the above for each selector in the array. +3. check the `types` + 1. if `types` is omitted → skip this step. + 2. if the name has a type in `types` → continue evaluating this selector. + 3. if the name does not have a type in `types` → skip this selector and continue to the next selector. + +A name is considered to pass the config if it: + +1. Matches one selector and passes all of that selector's format checks. +2. Matches no selectors. + +A name is considered to fail the config if it matches one selector and fails one that selector's format checks. + +### How does the rule automatically order selectors? + +Each identifier should match exactly one selector. It may match multiple group selectors - but only ever one selector. +With that in mind - the base sort order works out to be: + +1. Individual Selectors +2. Grouped Selectors +3. Default Selector + +Within each of these categories, some further sorting occurs based on what selector options are supplied: + +1. `filter` is given the highest priority above all else. +2. `types` +3. `modifiers` +4. everything else + +For example, if you provide the following config: + +```ts +[ + /* 1 */ { selector: 'default', format: ['camelCase'] }, + /* 2 */ { selector: 'variable', format: ['snake_case'] }, + /* 3 */ { selector: 'variable', types: ['boolean'], format: ['UPPER_CASE'] }, + /* 4 */ { selector: 'variableLike', format: ['PascalCase'] }, +]; +``` + +Then for the code `const x = 1`, the rule will validate the selectors in the following order: `3`, `2`, `4`, `1`. +To clearly spell it out: + +- (3) is tested first because it has `types` and is an individual selector. +- (2) is tested next because it is an individual selector. +- (4) is tested next as it is a grouped selector. +- (1) is tested last as it is the base default selector. + +Its worth noting that whilst this order is applied, all selectors may not run on a name. +This is explained in ["How does the rule evaluate a name's format?"](#how-does-the-rule-evaluate-a-names-format) + +### How does the rule evaluate a name's format? + +When the format of an identifier is checked, it is checked in the following order: + +1. validate leading underscore +1. validate trailing underscore +1. validate prefix +1. validate suffix +1. validate custom +1. validate format + +For steps 1-4, if the identifier matches the option, the matching part will be removed. +This is done so that you can apply formats like PascalCase without worrying about prefixes or underscores causing it to not match. + +One final note is that if the name were to become empty via this trimming process, it is considered to match all `format`s. An example of where this might be useful is for generic type parameters, where you want all names to be prefixed with `T`, but also want to allow for the single character `T` name. + +Here are some examples to help illustrate + +Name: `_IMyInterface` +Selector: + +```json +{ + "leadingUnderscore": "require", + "prefix": ["I"], + "format": ["UPPER_CASE", "StrictPascalCase"] +} +``` + +1. `name = _IMyInterface` +1. validate leading underscore + 1. config is provided + 1. check name → pass + 1. Trim underscore → `name = IMyInterface` +1. validate trailing underscore + 1. config is not provided → skip +1. validate prefix + 1. config is provided + 1. check name → pass + 1. Trim prefix → `name = MyInterface` +1. validate suffix + 1. config is not provided → skip +1. validate custom + 1. config is not provided → skip +1. validate format + 1. for each format... + 1. `format = 'UPPER_CASE'` + 1. check format → fail. + - Important to note that if you supply multiple formats - the name only needs to match _one_ of them! + 1. `format = 'StrictPascalCase'` + 1. check format → success. +1. **_success_** + +Name: `IMyInterface` +Selector: + +```json +{ + "format": ["StrictPascalCase"], + "trailingUnderscore": "allow", + "custom": { + "regex": "^I[A-Z]", + "match": false + } +} +``` + +1. `name = IMyInterface` +1. validate leading underscore + 1. config is not provided → skip +1. validate trailing underscore + 1. config is provided + 1. check name → pass + 1. Trim underscore → `name = IMyInterface` +1. validate prefix + 1. config is not provided → skip +1. validate suffix + 1. config is not provided → skip +1. validate custom + 1. config is provided + 1. `regex = new RegExp("^I[A-Z]")` + 1. `regex.test(name) === custom.match` + 1. **_fail_** → report and exit + +### What happens if I provide a `modifiers` to a Group Selector? + +Some group selectors accept `modifiers`. For the most part these will work exactly the same as with individual selectors. +There is one exception to this in that a modifier might not apply to all individual selectors covered by a group selector. + +For example - `memberLike` includes the `enumMember` selector, and it allows the `protected` modifier. +An `enumMember` can never ever be `protected`, which means that the following config will never match any `enumMember`: + +```json +{ + "selector": "memberLike", + "modifiers": ["protected"] +} +``` + +To help with matching, members that cannot specify an accessibility will always have the `public` modifier. This means that the following config will always match any `enumMember`: + +```json +{ + "selector": "memberLike", + "modifiers": ["public"] +} +``` + +## Examples + +### Enforce that all variables, functions and properties follow are camelCase + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { "selector": "variableLike", "format": ["camelCase"] } + ] +} +``` + +### Enforce that private members are prefixed with an underscore + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "memberLike", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "require" + } + ] +} +``` + +### Enforce that boolean variables are prefixed with an allowed verb + +**Note:** As [documented above](#format-options), the prefix is trimmed before format is validated, thus PascalCase must be used to allow variables such as `isEnabled`. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "types": ["boolean"], + "format": ["PascalCase"], + "prefix": ["is", "should", "has", "can", "did", "will"] + } + ] +} +``` + +### Enforce that all variables are either in camelCase or UPPER_CASE + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "format": ["camelCase", "UPPER_CASE"] + } + ] +} +``` + +### Enforce that all const variables are in UPPER_CASE + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "modifiers": ["const"], + "format": ["UPPER_CASE"] + } + ] +} +``` + +### Enforce that type parameters (generics) are prefixed with `T` + +This allows you to emulate the old `generic-type-naming` rule. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "typeParameter", + "format": ["PascalCase"], + "prefix": ["T"] + } + ] +} +``` + +### Enforce that interface names do not begin with an `I` + +This allows you to emulate the old `interface-name-prefix` rule. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "interface", + "format": ["PascalCase"], + "custom": { + "regex": "^I[A-Z]", + "match": false + } + } + ] +} +``` + +### Enforce that function names are either in camelCase or PascalCase + +Function names are typically camelCase, but UI library components (especially JSX, such as React and Solid) use PascalCase to distinguish them from intrinsic elements. If you are writing function components, consider allowing both camelCase and PascalCase for functions. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "function", + "format": ["camelCase", "PascalCase"] + } + ] +} +``` + +### Enforce that variable and function names are in camelCase + +This allows you to lint multiple type with same pattern. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": ["variable", "function"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ] +} +``` + +### Ignore properties that **_require_** quotes + +Sometimes you have to use a quoted name that breaks the convention (for example, HTTP headers). +If this is a common thing in your codebase, then you have a few options. + +If you simply want to allow all property names that require quotes, you can use the `requiresQuotes` modifier to match any property name that _requires_ quoting, and use `format: null` to ignore the name. + +```jsonc +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": [ + "classProperty", + "objectLiteralProperty", + "typeProperty", + "classMethod", + "objectLiteralMethod", + "typeMethod", + "accessor", + "enumMember", + ], + "format": null, + "modifiers": ["requiresQuotes"], + }, + ], +} +``` + +If you have a small and known list of exceptions, you can use the `filter` option to ignore these specific names only: + +```jsonc +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "property", + "format": ["strictCamelCase"], + "filter": { + // you can expand this regex to add more allowed names + "regex": "^(Property-Name-One|Property-Name-Two)$", + "match": false, + }, + }, + ], +} +``` + +You can use the `filter` option to ignore names with specific characters: + +```jsonc +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "property", + "format": ["strictCamelCase"], + "filter": { + // you can expand this regex as you find more cases that require quoting that you want to allow + "regex": "[- ]", + "match": false, + }, + }, + ], +} +``` + +Note that there is no way to ignore any name that is quoted - only names that are required to be quoted. +This is intentional - adding quotes around a name is not an escape hatch for proper naming. +If you want an escape hatch for a specific name - you should can use an [`eslint-disable` comment](https://eslint.org/docs/user-guide/configuring#disabling-rules-with-inline-comments). + +### Ignore destructured names + +Sometimes you might want to allow destructured properties to retain their original name, even if it breaks your naming convention. + +You can use the `destructured` modifier to match these names, and explicitly set `format: null` to apply no formatting: + +```jsonc +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "modifiers": ["destructured"], + "format": null, + }, + ], +} +``` + +### Enforce the codebase follows ESLint's `camelcase` conventions + +```json +{ + "camelcase": "off", + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "default", + "format": ["camelCase"] + }, + + { + "selector": "variable", + "format": ["camelCase", "UPPER_CASE"] + }, + { + "selector": "parameter", + "format": ["camelCase"], + "leadingUnderscore": "allow" + }, + + { + "selector": "memberLike", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "require" + }, + + { + "selector": "typeLike", + "format": ["PascalCase"] + } + ] +} +``` + +## When Not To Use It + +This rule can be very strict. +If you don't have strong needs for enforcing naming conventions, we recommend using it only to flag very egregious violations of your naming standards. +Consider documenting your naming conventions and enforcing them in code review if you have processes like that. + +If you do not want to enforce naming conventions for anything, you can disable this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend that if you care about naming conventions, pick a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.mdx new file mode 100644 index 0000000..7318142 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.mdx @@ -0,0 +1,34 @@ +--- +description: 'Disallow generic `Array` constructors.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-array-constructor** for documentation. + +It adds support for the generically typed `Array` constructor (`new Array()`). + + + + +```ts +Array(0, 1, 2); +new Array(0, 1, 2); +``` + + + + +```ts +Array(0, 1, 2); +new Array(x, y, z); + +Array(500); +new Array(someOtherArray.length); +``` + + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-delete.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-delete.mdx new file mode 100644 index 0000000..38e170f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-delete.mdx @@ -0,0 +1,44 @@ +--- +description: 'Disallow using the `delete` operator on array values.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-array-delete** for documentation. + +When using the `delete` operator with an array value, the array's `length` property is not affected, +but the element at the specified index is removed and leaves an empty slot in the array. +This is likely to lead to unexpected behavior. As mentioned in the +[MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#deleting_array_elements), +the recommended way to remove an element from an array is by using the +[`Array#splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) method. + +## Examples + + + + +```ts +declare const arr: number[]; + +delete arr[0]; +``` + + + + +```ts +declare const arr: number[]; + +arr.splice(0, 1); +``` + + + + +## When Not To Use It + +When you want to allow the delete operator with array expressions. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.mdx new file mode 100644 index 0000000..8097ca8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.mdx @@ -0,0 +1,115 @@ +--- +description: 'Require `.toString()` and `.toLocaleString()` to only be called on objects which provide useful information when stringified.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-base-to-string** for documentation. + +JavaScript will call `toString()` on an object when it is converted to a string, such as when concatenated with a string (`expr + ''`), when interpolated into template literals (`${expr}`), or when passed as an argument to the String constructor (`String(expr)`). +The default Object `.toString()` and `toLocaleString()` use the format `"[object Object]"`, which is often not what was intended. +This rule reports on stringified values that aren't primitives and don't define a more useful `.toString()` or `toLocaleString()` method. + +> Note that `Function` provides its own `.toString()` and `toLocaleString()` that return the function's code. +> Functions are not flagged by this rule. + +## Examples + + + + +```ts +// Passing an object or class instance to string concatenation: +'' + {}; + +class MyClass {} +const value = new MyClass(); +value + ''; + +// Interpolation and manual .toString() and `toLocaleString()` calls too: +`Value: ${value}`; +String({}); +({}).toString(); +({}).toLocaleString(); + +// Stringifying objects or instances in an array with the `Array.prototype.join`. +[{}, new MyClass()].join(''); +``` + + + + +```ts +// These types all have useful .toString() and `toLocaleString()` methods +'Text' + true; +`Value: ${123}`; +`Arrays too: ${[1, 2, 3]}`; +(() => {}).toString(); +String(42); +(() => {}).toLocaleString(); + +// Defining a custom .toString class is considered acceptable +class CustomToString { + toString() { + return 'Hello, world!'; + } +} +`Value: ${new CustomToString()}`; + +const literalWithToString = { + toString: () => 'Hello, world!', +}; + +`Value: ${literalWithToString}`; +``` + + + + +## Alternatives + +Consider using `JSON.stringify` when you want to convert non-primitive things to string for logging, debugging, etc. + +```typescript +declare const o: object; +const errorMessage = 'Found unexpected value: ' + JSON.stringify(o); +``` + +## Options + +### `ignoredTypeNames` + +{/* insert option description */} + +This is useful for types missing `toString()` or `toLocaleString()` (but actually has `toString()` or `toLocaleString()`). +There are some types missing `toString()` or `toLocaleString()` in old versions of TypeScript, like `RegExp`, `URL`, `URLSearchParams` etc. + +The following patterns are considered correct with the default options `{ ignoredTypeNames: ["RegExp"] }`: + +```ts option='{ "ignoredTypeNames": ["RegExp"] }' showPlaygroundButton +`${/regex/}`; +'' + /regex/; +/regex/.toString(); +let value = /regex/; +value.toString(); +let text = `${value}`; +String(/regex/); +``` + +## When Not To Use It + +If you don't mind a risk of `"[object Object]"` or incorrect type coercions in your values, then you will not need this rule. + +## Related To + +- [`restrict-plus-operands`](./restrict-plus-operands.mdx) +- [`restrict-template-expressions`](./restrict-template-expressions.mdx) + +## Further Reading + +- [`Object.prototype.toString()` MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString) +- [`Object.prototype.toLocaleString()` MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString) +- [Microsoft/TypeScript Add missing toString declarations for base types that have them](https://github.com/microsoft/TypeScript/issues/38347) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.mdx new file mode 100644 index 0000000..01a47a9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.mdx @@ -0,0 +1,75 @@ +--- +description: 'Disallow non-null assertion in locations that may be confusing.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-confusing-non-null-assertion** for documentation. + +Using a non-null assertion (`!`) next to an assignment or equality check (`=` or `==` or `===`) creates code that is confusing as it looks similar to an inequality check (`!=` `!==`). + +```typescript +a! == b; // a non-null assertion(`!`) and an equals test(`==`) +a !== b; // not equals test(`!==`) +a! === b; // a non-null assertion(`!`) and a triple equals test(`===`) +``` + +Using a non-null assertion (`!`) next to an in test (`in`) or an instanceof test (`instanceof`) creates code that is confusing since it may look like the operator is negated, but it is actually not. + +{/* prettier-ignore */} +```typescript +a! in b; // a non-null assertion(`!`) and an in test(`in`) +a !in b; // also a non-null assertion(`!`) and an in test(`in`) +!(a in b); // a negated in test + +a! instanceof b; // a non-null assertion(`!`) and an instanceof test(`instanceof`) +a !instanceof b; // also a non-null assertion(`!`) and an instanceof test(`instanceof`) +!(a instanceof b); // a negated instanceof test +```` + +This rule flags confusing `!` assertions and suggests either removing them or wrapping the asserted expression in `()` parenthesis. + +## Examples + + + + +```ts +interface Foo { + bar?: string; + num?: number; +} + +const foo: Foo = getFoo(); +const isEqualsBar = foo.bar! == 'hello'; +const isEqualsNum = 1 + foo.num! == 2; +``` + + + + +{/* prettier-ignore */} +```ts +interface Foo { + bar?: string; + num?: number; +} + +const foo: Foo = getFoo(); +const isEqualsBar = foo.bar == 'hello'; +const isEqualsNum = (1 + foo.num!) == 2; +``` + + + + +## When Not To Use It + +If you don't care about this confusion, then you will not need this rule. + +## Further Reading + +- [`Issue: Easy misunderstanding: "! ==="`](https://github.com/microsoft/TypeScript/issues/37837) in [TypeScript repo](https://github.com/microsoft/TypeScript) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.mdx new file mode 100644 index 0000000..5b9c8ad --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.mdx @@ -0,0 +1,148 @@ +--- +description: 'Require expressions of type void to appear in statement position.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-confusing-void-expression** for documentation. + +`void` in TypeScript refers to a function return that is meant to be ignored. +Attempting to use a `void`-typed value, such as storing the result of a called function in a variable, is often a sign of a programmer error. +`void` can also be misleading for other developers even if used correctly. + +This rule prevents `void` type expressions from being used in misleading locations such as being assigned to a variable, provided as a function argument, or returned from a function. + +## Examples + + + + +```ts +// somebody forgot that `alert` doesn't return anything +const response = alert('Are you sure?'); +console.log(alert('Are you sure?')); + +// it's not obvious whether the chained promise will contain the response (fixable) +promise.then(value => window.postMessage(value)); + +// it looks like we are returning the result of `console.error` (fixable) +function doSomething() { + if (!somethingToDo) { + return console.error('Nothing to do!'); + } + + console.log('Doing a thing...'); +} +``` + + + + +```ts +// just a regular void function in a statement position +alert('Hello, world!'); + +// this function returns a boolean value so it's ok +const response = confirm('Are you sure?'); +console.log(confirm('Are you sure?')); + +// now it's obvious that `postMessage` doesn't return any response +promise.then(value => { + window.postMessage(value); +}); + +// now it's explicit that we want to log the error and return early +function doSomething() { + if (!somethingToDo) { + console.error('Nothing to do!'); + return; + } + + console.log('Doing a thing...'); +} + +// using logical expressions for their side effects is fine +cond && console.log('true'); +cond || console.error('false'); +cond ? console.log('true') : console.error('false'); +``` + + + + +## Options + +### `ignoreArrowShorthand` + +{/* insert option description */} + +It might be undesirable to wrap every arrow function shorthand expression. +Especially when using the Prettier formatter, which spreads such code across 3 lines instead of 1. + +Examples of additional **correct** code with this option enabled: + +```ts option='{ "ignoreArrowShorthand": true }' showPlaygroundButton +promise.then(value => window.postMessage(value)); +``` + +### `ignoreVoidOperator` + +{/* insert option description */} + +It might be preferable to only use some distinct syntax +to explicitly mark the confusing but valid usage of void expressions. +This option allows void expressions which are explicitly wrapped in the `void` operator. +This can help avoid confusion among other developers as long as they are made aware of this code style. + +This option also changes the automatic fixes for common cases to use the `void` operator. +It also enables a suggestion fix to wrap the void expression with `void` operator for every problem reported. + +Examples of additional **correct** code with this option enabled: + +```ts option='{ "ignoreVoidOperator": true }' showPlaygroundButton +// now it's obvious that we don't expect any response +promise.then(value => void window.postMessage(value)); + +// now it's explicit that we don't want to return anything +function doSomething() { + if (!somethingToDo) { + return void console.error('Nothing to do!'); + } + + console.log('Doing a thing...'); +} + +// we are sure that we want to always log `undefined` +console.log(void alert('Hello, world!')); +``` + +### `ignoreVoidReturningFunctions` + +{/* insert option description */} + +Some projects prefer allowing functions that explicitly return `void` to return `void` expressions. Doing so allows more writing more succinct functions. + +:::note +This is technically risky as the `void`-returning function might actually be returning a value not seen by the type system. +::: + +```ts option='{ "ignoreVoidReturningFunctions": true }' showPlaygroundButton +function foo(): void { + return console.log(); +} + +function onError(callback: () => void): void { + callback(); +} + +onError(() => console.log('oops')); +``` + +## When Not To Use It + +The return type of a function can be inspected by going to its definition or hovering over it in an IDE. +If you don't care about being explicit about the void type in actual code then don't use this rule. +Also, if you strongly prefer a concise coding style more strongly than any fear of `void`-related bugs then you can avoid this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-deprecated.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-deprecated.mdx new file mode 100644 index 0000000..09da790 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-deprecated.mdx @@ -0,0 +1,119 @@ +--- +description: 'Disallow using code marked as `@deprecated`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-deprecated** for documentation. + +The [JSDoc `@deprecated` tag](https://jsdoc.app/tags-deprecated) can be used to document some piece of code being deprecated. +It's best to avoid using code marked as deprecated. +This rule reports on any references to code marked as `@deprecated`. + +:::note +[TypeScript recognizes the `@deprecated` tag](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#deprecated), allowing editors to visually indicate deprecated code — usually with a ~strikethrough~. +However, TypeScript doesn't report type errors for deprecated code on its own. +::: + +## Examples + + + + +```ts +/** @deprecated Use apiV2 instead. */ +declare function apiV1(): Promise; + +declare function apiV2(): Promise; + +await apiV1(); +``` + +```ts +import { parse } from 'node:url'; + +// 'parse' is deprecated. Use the WHATWG URL API instead. +const url = parse('/foo'); +``` + + + + +```ts +/** @deprecated Use apiV2 instead. */ +declare function apiV1(): Promise; + +declare function apiV2(): Promise; + +await apiV2(); +``` + +```ts +// Modern Node.js API, uses `new URL()` +const url2 = new URL('/foo', 'http://www.example.com'); +``` + + + + +## Options + +### `allow` + +{/* insert option description */} + +This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier). + +Examples of code for this rule with: + +```json +{ + "allow": [ + { "from": "file", "name": "apiV1" }, + { "from": "lib", "name": "escape" } + ] +} +``` + + + + +```ts option='{"allow":[{"from":"file","name":"apiV1"},{"from":"lib","name":"escape"}]}' +/** @deprecated */ +declare function apiV2(): Promise; + +await apiV2(); + +// `unescape` has been deprecated since ES5. +unescape('...'); +``` + + + + + +```ts option='{"allow":[{"from":"file","name":"apiV1"},{"from":"lib","name":"escape"}]}' +import { Bar } from 'bar-lib'; +/** @deprecated */ +declare function apiV1(): Promise; + +await apiV1(); + +// `escape` has been deprecated since ES5. +escape('...'); +``` + + + + +## When Not To Use It + +If portions of your project heavily use deprecated APIs and have no plan for moving to non-deprecated ones, you might want to disable this rule in those portions. + +## Related To + +- [`import/no-deprecated`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md) and [`import-x/no-deprecated`](https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-deprecated.md): Does not use type information, but does also support [TomDoc](http://tomdoc.org) +- [`eslint-plugin-deprecation`](https://github.com/gund/eslint-plugin-deprecation) ([`deprecation/deprecation`](https://github.com/gund/eslint-plugin-deprecation?tab=readme-ov-file#rules)): Predecessor to this rule in a separate plugin diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.mdx new file mode 100644 index 0000000..6e2f79c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.mdx @@ -0,0 +1,16 @@ +--- +description: 'Disallow duplicate class members.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-dupe-class-members** for documentation. + +import TypeScriptOverlap from '@site/src/components/TypeScriptOverlap'; + + + +It adds support for TypeScript's method overload definitions. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.mdx new file mode 100644 index 0000000..d28eb7a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.mdx @@ -0,0 +1,66 @@ +--- +description: 'Disallow duplicate enum member values.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-duplicate-enum-values** for documentation. + +Although TypeScript supports duplicate enum member values, people usually expect members to have unique values within the same enum. Duplicate values can lead to bugs that are hard to track down. + +## Examples + +This rule disallows defining an enum with multiple members initialized to the same value. + +> This rule only enforces on enum members initialized with string or number literals. +> Members without an initializer or initialized with an expression are not checked by this rule. + + + + +```ts +enum E { + A = 0, + B = 0, +} +``` + +```ts +enum E { + A = 'A', + B = 'A', + C = `A`, +} +``` + + + + +```ts +enum E { + A = 0, + B = 1, +} +``` + +```ts +enum E { + A = 'A', + B = 'B', + C = `C`, +} +``` + + + + +## When Not To Use It + +It can sometimes be useful to include duplicate enum members for very specific use cases. +For example, when renaming an enum member, it can sometimes be useful to keep the old name until a scheduled major breaking change. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +In general, if your project intentionally duplicates enum member values, you can avoid this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.mdx new file mode 100644 index 0000000..45ec178 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.mdx @@ -0,0 +1,17 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been deprecated in favour of the [`import/no-duplicates`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-duplicates.md) rule. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-type-constituents.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-type-constituents.mdx new file mode 100644 index 0000000..dfd7d2d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-type-constituents.mdx @@ -0,0 +1,89 @@ +--- +description: 'Disallow duplicate constituents of union or intersection types.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-duplicate-type-constituents** for documentation. + +TypeScript supports types ("constituents") within union and intersection types being duplicates of each other. +However, developers typically expect each constituent to be unique within its intersection or union. +Duplicate values make the code overly verbose and generally reduce readability. + +This rule disallows duplicate union or intersection constituents. +We consider types to be duplicate if they evaluate to the same result in the type system. +For example, given `type A = string` and `type T = string | A`, this rule would flag that `A` is the same type as `string`. + +This rule also disallows explicitly listing `undefined` in a type union when a function parameter is marked as optional. +Doing so is unnecessary. +Please note that this check only applies to parameters, not properties. +Therefore, it does not conflict with the [`exactOptionalPropertyTypes`](https://www.typescriptlang.org/tsconfig/#exactOptionalPropertyTypes) TypeScript compiler setting. + + + + +```ts +type T1 = 'A' | 'A'; + +type T2 = string | string | number; + +type T3 = { a: string } & { a: string }; + +type T4 = [1, 2, 3] | [1, 2, 3]; + +type StringA = string; +type StringB = string; +type T5 = StringA | StringB; + +const fn = (a?: string | undefined) => {}; +``` + + + + +```ts +type T1 = 'A' | 'B'; + +type T2 = string | number | boolean; + +type T3 = { a: string } & { b: string }; + +type T4 = [1, 2, 3] | [1, 2, 3, 4]; + +type StringA = string; +type NumberB = number; +type T5 = StringA | NumberB; + +const fn = (a?: string) => {}; +``` + + + + +## Options + +### `ignoreIntersections` + +{/* insert option description */} + +When set to true, duplicate checks on intersection type constituents are ignored. + +### `ignoreUnions` + +{/* insert option description */} + +When set to true, duplicate checks on union type constituents are ignored. + +## When Not To Use It + +It can sometimes be useful for the sake of documentation to include aliases for the same type. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +> In some of those cases, [branded types](https://basarat.gitbook.io/typescript/main-1/nominaltyping#using-interfaces) might be a type-safe way to represent the underlying data types. + +## Related To + +- [no-redundant-type-constituents](./no-redundant-type-constituents.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.mdx new file mode 100644 index 0000000..0bd7d41 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.mdx @@ -0,0 +1,64 @@ +--- +description: 'Disallow using the `delete` operator on computed key expressions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-dynamic-delete** for documentation. + +Deleting dynamically computed keys can be dangerous and in some cases not well optimized. +Using the `delete` operator on keys that aren't runtime constants could be a sign that you're using the wrong data structures. +Consider using a `Map` or `Set` if you’re using an object as a key-value collection. + +Dynamically adding and removing keys from objects can cause occasional edge case bugs. For example, some objects use "hidden properties" (such as `__data`) for private storage, and deleting them can break the object's internal state. Furthermore, [`delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete) cannot remove inherited properties or non-configurable properties. This makes it interact badly with anything more complicated than a plain object: + +- The [`length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) of an array is non-configurable, and deleting it is a runtime error. +- You can't remove properties on the prototype of an object, such as deleting methods from class instances. +- Sometimes, `delete` only removes the own property, leaving the inherited property intact. For example, deleting the [`name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name) property of a function only removes the own property, but there's also a `Function.prototype.name` property that remains. + +## Examples + + + + +```ts +// Dynamic, difficult-to-reason-about lookups +const name = 'name'; +delete container[name]; +delete container[name.toUpperCase()]; +``` + + + + +```ts +const container: { [i: string]: number } = { + /* ... */ +}; + +// Constant runtime lookups by string index +delete container.aaa; + +// Constants that must be accessed by [] +delete container[7]; +delete container[-1]; + +// All strings are allowed, to be compatible with the noPropertyAccessFromIndexSignature +// TS compiler option +delete container['aaa']; +delete container['Infinity']; +``` + + + + +## When Not To Use It + +When you know your keys are safe to delete, this rule can be unnecessary. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +Do not consider this rule as performance advice before profiling your code's bottlenecks. +Even repeated minor performance slowdowns likely do not significantly affect your application's general perceived speed. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.mdx new file mode 100644 index 0000000..cf71ede --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.mdx @@ -0,0 +1,94 @@ +--- +description: 'Disallow empty functions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-empty-function** for documentation. + +It adds support for handling TypeScript specific code that would otherwise trigger the rule. + +One example of valid TypeScript specific code that would otherwise trigger the `no-empty-function` rule is the use of [parameter properties](https://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties) in constructor functions. + +## Options + +This rule adds the following options: + +```ts +type AdditionalAllowOptionEntries = + | 'private-constructors' + | 'protected-constructors' + | 'decoratedFunctions' + | 'overrideMethods'; + +type AllowOptionEntries = + | BaseNoEmptyFunctionAllowOptionEntries + | AdditionalAllowOptionEntries; + +interface Options extends BaseNoEmptyFunctionOptions { + allow?: Array; +} +const defaultOptions: Options = { + ...baseNoEmptyFunctionDefaultOptions, + allow: [], +}; +``` + +### allow: `private-constructors` + +Examples of correct code for the `{ "allow": ["private-constructors"] }` option: + +```ts option='{ "allow": ["private-constructors"] }' showPlaygroundButton +class Foo { + private constructor() {} +} +``` + +### allow: `protected-constructors` + +Examples of correct code for the `{ "allow": ["protected-constructors"] }` option: + +```ts option='{ "allow": ["protected-constructors"] }' showPlaygroundButton +class Foo { + protected constructor() {} +} +``` + +### allow: `decoratedFunctions` + +Examples of correct code for the `{ "allow": ["decoratedFunctions"] }` option: + +```ts option='{ "allow": ["decoratedFunctions"] }' showPlaygroundButton +class Foo { + @decorator() + foo() {} +} +``` + +### allow: `overrideMethods` + +Examples of correct code for the `{ "allow": ["overrideMethods"] }` option: + +```ts option='{ "allow": ["overrideMethods"] }' showPlaygroundButton +abstract class Base { + protected greet(): void { + console.log('Hello!'); + } +} + +class Foo extends Base { + protected override greet(): void {} +} +``` + +## When Not To Use It + +If you are working with external APIs that require functions even if they do nothing, then you may want to avoid this rule. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +Test code often violates this rule as well. +If your testing setup doesn't support "mock" or "spy" functions such as [`jest.fn()`](https://jestjs.io/docs/mock-functions), [`sinon.spy()`](https://sinonjs.org/releases/latest/spies), or [`vi.fn()`](https://vitest.dev/guide/mocking.html), you may wish to disable this rule in test files. +Again, if those cases aren't extremely common, you might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule in test files. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.mdx new file mode 100644 index 0000000..4eeb2f3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.mdx @@ -0,0 +1,75 @@ +--- +description: 'Disallow the declaration of empty interfaces.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-empty-interface** for documentation. + +:::danger Deprecated + +This rule has been deprecated in favour of the more comprehensive [`@typescript-eslint/no-empty-object-type`](./no-empty-object-type.mdx) rule. + +::: + +An empty interface in TypeScript does very little: any non-nullable value is assignable to `{}`. +Using an empty interface is often a sign of programmer error, such as misunderstanding the concept of `{}` or forgetting to fill in fields. + +This rule aims to ensure that only meaningful interfaces are declared in the code. + +## Examples + + + + +```ts +// an empty interface +interface Foo {} + +// an interface with only one supertype (Bar === Foo) +interface Bar extends Foo {} + +// an interface with an empty list of supertypes +interface Baz {} +``` + + + + +```ts +// an interface with any number of members +interface Foo { + name: string; +} + +// same as above +interface Bar { + age: number; +} + +// an interface with more than one supertype +// in this case the interface can be used as a replacement of an intersection type. +interface Baz extends Foo, Bar {} +``` + + + + +## Options + +### `allowSingleExtends` + +{/* insert option description */} + +`allowSingleExtends: true` will silence warnings about extending a single interface without adding additional members. + +## When Not To Use It + +If you don't care about having empty/meaningless interfaces, then you will not need this rule. + +## Related To + +- [`no-empty-object-type`](./no-empty-object-type.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-object-type.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-object-type.mdx new file mode 100644 index 0000000..b1ed390 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-object-type.mdx @@ -0,0 +1,150 @@ +--- +description: 'Disallow accidentally using the "empty object" type.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-empty-object-type** for documentation. + +The `{}`, or "empty object" type in TypeScript is a common source of confusion for developers unfamiliar with TypeScript's structural typing. +`{}` represents any _non-nullish value_, including literals like `0` and `""`: + +```ts +let anyNonNullishValue: {} = 'Intentionally allowed by TypeScript.'; +``` + +Often, developers writing `{}` actually mean either: + +- `object`: representing any _object_ value +- `unknown`: representing any value at all, including `null` and `undefined` + +In other words, the "empty object" type `{}` really means _"any value that is defined"_. +That includes arrays, class instances, functions, and primitives such as `string` and `symbol`. + +To avoid confusion around the `{}` type allowing any _non-nullish value_, this rule bans usage of the `{}` type. +That includes interfaces and object type aliases with no fields. + +:::tip +If you do have a use case for an API allowing `{}`, you can always configure the [rule's options](#options), use an [ESLint disable comment](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1), or [disable the rule in your ESLint config](https://eslint.org/docs/latest/use/configure/rules#using-configuration-files-1). +::: + +Note that this rule does not report on: + +- `{}` as a type constituent in an intersection type (e.g. types like TypeScript's built-in `type NonNullable = T & {}`), as this can be useful in type system operations. +- Interfaces that extend from multiple other interfaces. + +## Examples + + + + +```ts +let anyObject: {}; +let anyValue: {}; + +interface AnyObjectA {} +interface AnyValueA {} + +type AnyObjectB = {}; +type AnyValueB = {}; +``` + + + + +```ts +let anyObject: object; +let anyValue: unknown; + +type AnyObjectA = object; +type AnyValueA = unknown; + +type AnyObjectB = object; +type AnyValueB = unknown; + +let objectWith: { property: boolean }; + +interface InterfaceWith { + property: boolean; +} + +type TypeWith = { property: boolean }; +``` + + + + +## Options + +By default, this rule flags both interfaces and object types. + +### `allowInterfaces` + +{/* insert option description */} + +Allowed values are: + +- `'always'`: to always allow interfaces with no fields +- `'never'` _(default)_: to never allow interfaces with no fields +- `'with-single-extends'`: to allow empty interfaces that `extend` from a single base interface + +Examples of **correct** code for this rule with `{ allowInterfaces: 'with-single-extends' }`: + +```ts option='{ "allowInterfaces": "with-single-extends" }' showPlaygroundButton +interface Base { + value: boolean; +} + +interface Derived extends Base {} +``` + +### `allowObjectTypes` + +{/* insert option description */} + +Allowed values are: + +- `'always'`: to always allow object type literals with no fields +- `'never'` _(default)_: to never allow object type literals with no fields + +### `allowWithName` + +{/* insert option description */} + +This can be useful if your existing code style includes a pattern of declaring empty types with `{}` instead of `object`. + +Examples of code for this rule with `{ allowWithName: 'Props$' }`: + + + + +```ts option='{ "allowWithName": "Props$" }' showPlaygroundButton +interface InterfaceValue {} + +type TypeValue = {}; +``` + + + + +```ts option='{ "allowWithName": "Props$" }' showPlaygroundButton +interface InterfaceProps {} + +type TypeProps = {}; +``` + + + + +## When Not To Use It + +If your code commonly needs to represent the _"any non-nullish value"_ type, this rule may not be for you. +Projects that extensively use type operations such as conditional types and mapped types oftentimes benefit from disabling this rule. + +## Further Reading + +- [Enhancement: [ban-types] Split the {} ban into a separate, better-phrased rule](https://github.com/typescript-eslint/typescript-eslint/issues/8700) +- [The Empty Object Type in TypeScript](https://www.totaltypescript.com/the-empty-object-type-in-typescript) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.mdx new file mode 100644 index 0000000..f0c8c20 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.mdx @@ -0,0 +1,177 @@ +--- +description: 'Disallow the `any` type.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-explicit-any** for documentation. + +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. +This rule reports on explicit uses of the `any` keyword as a type annotation. + +Preferable alternatives to `any` include: + +- If the type is known, describing it in an `interface` or `type` +- If the type is not known, using the safer `unknown` type + +> TypeScript's `--noImplicitAny` compiler option prevents an implied `any`, but doesn't prevent `any` from being explicitly used the way this rule does. + +## Examples + + + + +```ts +const age: any = 'seventeen'; +``` + +```ts +const ages: any[] = ['seventeen']; +``` + +```ts +const ages: Array = ['seventeen']; +``` + +```ts +function greet(): any {} +``` + +```ts +function greet(): any[] {} +``` + +```ts +function greet(): Array {} +``` + +```ts +function greet(): Array> {} +``` + +```ts +function greet(param: Array): string {} +``` + +```ts +function greet(param: Array): Array {} +``` + + + + +```ts +const age: number = 17; +``` + +```ts +const ages: number[] = [17]; +``` + +```ts +const ages: Array = [17]; +``` + +```ts +function greet(): string {} +``` + +```ts +function greet(): string[] {} +``` + +```ts +function greet(): Array {} +``` + +```ts +function greet(): Array> {} +``` + +```ts +function greet(param: Array): string {} +``` + +```ts +function greet(param: Array): Array {} +``` + + + + +## Options + +### `fixToUnknown` + +{/* insert option description */} + +By default, this rule will not provide automatic ESLint _fixes_: only opt-in _suggestions_. +Switching types to `unknown` is safer but is likely to cause additional type errors. + +Enabling `{ "fixToUnknown": true }` gives the rule an auto-fixer to replace `: any` with `: unknown`. + +### `ignoreRestArgs` + +{/* insert option description */} + +The examples below are **incorrect** when `{ignoreRestArgs: false}`, but **correct** when `{ignoreRestArgs: true}`. + +```ts option='{ "ignoreRestArgs": false }' showPlaygroundButton +function foo1(...args: any[]): void {} +function foo2(...args: readonly any[]): void {} +function foo3(...args: Array): void {} +function foo4(...args: ReadonlyArray): void {} + +declare function bar(...args: any[]): void; + +const baz = (...args: any[]) => {}; +const qux = function (...args: any[]) {}; + +type Quux = (...args: any[]) => void; +type Quuz = new (...args: any[]) => void; + +interface Grault { + (...args: any[]): void; +} +interface Corge { + new (...args: any[]): void; +} +interface Garply { + f(...args: any[]): void; +} +``` + +## When Not To Use It + +`any` is always a dangerous escape hatch. +Whenever possible, it is always safer to avoid it. +TypeScript's `unknown` is almost always preferable to `any`. + +However, there are occasional situations where it can be necessary to use `any`. +Most commonly: + +- If your project isn't fully onboarded to TypeScript yet, `any` can be temporarily used in places where types aren't yet known or representable +- If an external package doesn't yet have typings and you want to use `any` pending adding a `.d.ts` for it +- You're working with particularly complex or nuanced code that can't yet be represented in the TypeScript type system + +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [Avoiding `any`s with Linting and TypeScript](/blog/avoiding-anys) +- [`no-unsafe-argument`](./no-unsafe-argument.mdx) +- [`no-unsafe-assignment`](./no-unsafe-assignment.mdx) +- [`no-unsafe-call`](./no-unsafe-call.mdx) +- [`no-unsafe-member-access`](./no-unsafe-member-access.mdx) +- [`no-unsafe-return`](./no-unsafe-return.mdx) + +## Further Reading + +- TypeScript [`any` type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any) +- TypeScript's [`unknown` type](https://www.typescriptlang.org/docs/handbook/2/functions.html#unknown) +- TypeScript [`any` type documentation](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any) +- TypeScript [`unknown` type release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html#new-unknown-top-type) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.mdx new file mode 100644 index 0000000..5f108b7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.mdx @@ -0,0 +1,60 @@ +--- +description: 'Disallow extra non-null assertions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-extra-non-null-assertion** for documentation. + +The `!` non-null assertion operator in TypeScript is used to assert that a value's type does not include `null` or `undefined`. +Using the operator any more than once on a single value does nothing. + +## Examples + + + + +```ts +const foo: { bar: number } | null = null; +const bar = foo!!!.bar; +``` + +```ts +function foo(bar: number | undefined) { + const bar: number = bar!!!; +} +``` + +```ts +function foo(bar?: { n: number }) { + return bar!?.n; +} +``` + + + + +```ts +const foo: { bar: number } | null = null; +const bar = foo!.bar; +``` + +```ts +function foo(bar: number | undefined) { + const bar: number = bar!; +} +``` + +```ts +function foo(bar?: { n: number }) { + return bar?.n; +} +``` + + + + +{/* Intentionally Omitted: When Not To Use It */} diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.mdx new file mode 100644 index 0000000..b6639b5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.mdx @@ -0,0 +1,329 @@ +--- +description: 'Disallow classes used as namespaces.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-extraneous-class** for documentation. + +This rule reports when a class has no non-static members, such as for a class used exclusively as a static namespace. + +Users who come from a [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming) paradigm may wrap their utility functions in an extra class, instead of putting them at the top level of an ECMAScript module. +Doing so is generally unnecessary in JavaScript and TypeScript projects. + +- Wrapper classes add extra cognitive complexity to code without adding any structural improvements + - Whatever would be put on them, such as utility functions, are already organized by virtue of being in a module. + - As an alternative, you can `import * as ...` the module to get all of them in a single object. +- IDEs can't provide as good suggestions for static class or namespace imported properties when you start typing property names +- It's more difficult to statically analyze code for unused variables, etc. when they're all on the class (see: [Finding dead code (and dead types) in TypeScript](https://effectivetypescript.com/2020/10/20/tsprune)). + +This rule also reports classes that have only a constructor and no fields. +Those classes can generally be replaced with a standalone function. + +## Examples + + + + +```ts +class StaticConstants { + static readonly version = 42; + + static isProduction() { + return process.env.NODE_ENV === 'production'; + } +} + +class HelloWorldLogger { + constructor() { + console.log('Hello, world!'); + } +} + +abstract class Foo {} +``` + + + + +```ts +export const version = 42; + +export function isProduction() { + return process.env.NODE_ENV === 'production'; +} + +function logHelloWorld() { + console.log('Hello, world!'); +} + +abstract class Foo { + abstract prop: string; +} +``` + + + + +## Alternatives + +### Individual Exports (Recommended) + +Instead of using a static utility class we recommend you individually export the utilities from your module. + + + + +```ts +export class Utilities { + static util1() { + return Utilities.util3(); + } + + static util2() { + /* ... */ + } + + static util3() { + /* ... */ + } +} +``` + + + + +```ts +export function util1() { + return util3(); +} + +export function util2() { + /* ... */ +} + +export function util3() { + /* ... */ +} +``` + + + + +### Namespace Imports (Not Recommended) + +If you strongly prefer to have all constructs from a module available as properties of a single object, you can `import * as` the module. +This is known as a "namespace import". +Namespace imports are sometimes preferable because they keep all properties nested and don't need to be changed as you start or stop using various properties from the module. + +However, namespace imports are impacted by these downsides: + +- They also don't play as well with tree shaking in modern bundlers +- They require a name prefix before each property's usage + + + + +```ts +// utilities.ts +export class Utilities { + static sayHello() { + console.log('Hello, world!'); + } +} + +// consumers.ts +import { Utilities } from './utilities'; + +Utilities.sayHello(); +``` + + + + +```ts +// utilities.ts +export function sayHello() { + console.log('Hello, world!'); +} + +// consumers.ts +import * as utilities from './utilities'; + +utilities.sayHello(); +``` + + + + +```ts +// utilities.ts +export function sayHello() { + console.log('Hello, world!'); +} + +// consumers.ts +import { sayHello } from './utilities'; + +sayHello(); +``` + + + + +### Notes on Mutating Variables + +One case you need to be careful of is exporting mutable variables. +While class properties can be mutated externally, exported variables are always constant. +This means that importers can only ever read the first value they are assigned and cannot write to the variables. + +Needing to write to an exported variable is very rare and is generally considered a code smell. +If you do need it you can accomplish it using getter and setter functions: + + + + +```ts +export class Utilities { + static mutableCount = 1; + + static incrementCount() { + Utilities.mutableCount += 1; + } +} +``` + + + + +```ts +let mutableCount = 1; + +export function getMutableCount() { + return mutableField; +} + +export function incrementCount() { + mutableField += 1; +} +``` + + + + +## Options + +This rule normally bans classes that are empty (have no constructor or fields). +The rule's options each add an exemption for a specific type of class. + +### `allowConstructorOnly` + +{/* insert option description */} + + + + +```ts option='{ "allowConstructorOnly": true }' +class NoFields {} +``` + + + + +```ts option='{ "allowConstructorOnly": true }' +class NoFields { + constructor() { + console.log('Hello, world!'); + } +} +``` + + + + +### `allowEmpty` + +{/* insert option description */} + + + + +```ts option='{ "allowEmpty": true }' +class NoFields { + constructor() { + console.log('Hello, world!'); + } +} +``` + + + + +```ts option='{ "allowEmpty": true }' +class NoFields {} +``` + + + + +### `allowStaticOnly` + +{/* insert option description */} + +:::caution +We strongly recommend against the `allowStaticOnly` exemption. +It works against this rule's primary purpose of discouraging classes used only for static members. +::: + + + + +```ts option='{ "allowStaticOnly": true }' +class EmptyClass {} +``` + + + + +```ts option='{ "allowStaticOnly": true }' +class NotEmptyClass { + static version = 42; +} +``` + + + + +### `allowWithDecorator` + +{/* insert option description */} + + + + +```ts option='{ "allowWithDecorator": true }' +class Constants { + static readonly version = 42; +} +``` + + + + +```ts option='{ "allowWithDecorator": true }' +@logOnRead() +class Constants { + static readonly version = 42; +} +``` + + + + +## When Not To Use It + +If your project was set up before modern class and namespace practices, and you don't have the time to switch over, you might not be practically able to use this rule. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.mdx new file mode 100644 index 0000000..12bf746 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.mdx @@ -0,0 +1,282 @@ +--- +description: 'Require Promise-like statements to be handled appropriately.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-floating-promises** for documentation. + +A "floating" Promise is one that is created without any code set up to handle any errors it might throw. +Floating Promises can cause several issues, such as improperly sequenced operations, ignored Promise rejections, and more. + +This rule will report Promise-valued statements that are not treated in one of the following ways: + +- Calling its `.then()` with two arguments +- Calling its `.catch()` with one argument +- `await`ing it +- `return`ing it +- [`void`ing it](#ignorevoid) + +This rule also reports when an Array containing Promises is created and not properly handled. The main way to resolve this is by using one of the Promise concurrency methods to create a single Promise, then handling that according to the procedure above. These methods include: + +- `Promise.all()` +- `Promise.allSettled()` +- `Promise.any()` +- `Promise.race()` + +:::tip +`no-floating-promises` only detects apparently unhandled Promise _statements_. +See [`no-misused-promises`](./no-misused-promises.mdx) for detecting code that provides Promises to _logical_ locations such as if statements. + +See [_Using promises (error handling) on MDN_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#error_handling) for a detailed writeup on Promise error-handling. +::: + +## Examples + + + + +```ts +const promise = new Promise((resolve, reject) => resolve('value')); +promise; + +async function returnsPromise() { + return 'value'; +} +returnsPromise().then(() => {}); + +Promise.reject('value').catch(); + +Promise.reject('value').finally(); + +[1, 2, 3].map(async x => x + 1); +``` + + + + +```ts +const promise = new Promise((resolve, reject) => resolve('value')); +await promise; + +async function returnsPromise() { + return 'value'; +} + +void returnsPromise(); + +returnsPromise().then( + () => {}, + () => {}, +); + +Promise.reject('value').catch(() => {}); + +await Promise.reject('value').finally(() => {}); + +await Promise.all([1, 2, 3].map(async x => x + 1)); +``` + + + + +## Options + +### `checkThenables` + +{/* insert option description */} + +A ["Thenable"](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is an object which has a `then` method, such as a `Promise`. +Other Thenables include TypeScript's built-in `PromiseLike` interface and any custom object that happens to have a `.then()`. + +The `checkThenables` option triggers `no-floating-promises` to also consider all values that satisfy the Thenable shape (a `.then()` method that takes two callback parameters), not just Promises. +This can be useful if your code works with older `Promise` polyfills instead of the native `Promise` class. + + + + +```ts option='{"checkThenables": true}' +declare function createPromiseLike(): PromiseLike; + +createPromiseLike(); + +interface MyThenable { + then(onFulfilled: () => void, onRejected: () => void): MyThenable; +} + +declare function createMyThenable(): MyThenable; + +createMyThenable(); +``` + + + + +```ts option='{"checkThenables": true}' +declare function createPromiseLike(): PromiseLike; + +await createPromiseLike(); + +interface MyThenable { + then(onFulfilled: () => void, onRejected: () => void): MyThenable; +} + +declare function createMyThenable(): MyThenable; + +await createMyThenable(); +``` + + + + +### `ignoreVoid` + +{/* insert option description */} + +Placing the [`void` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void) in front of a Promise can be a convenient way to explicitly mark that Promise as intentionally not awaited. + +:::warning +Voiding a Promise doesn't handle it or change the runtime behavior. +The outcome is just ignored, like disabling the rule with an [ESLint disable comment](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1). +Such Promise rejections will still be unhandled. +::: + +Examples of **correct** code for this rule with `{ ignoreVoid: true }`: + +```ts option='{ "ignoreVoid": true }' showPlaygroundButton +async function returnsPromise() { + return 'value'; +} +void returnsPromise(); + +void Promise.reject('value'); +``` + +When this option is set to `true`, if you are using `no-void`, you should turn on the [`allowAsStatement`](https://eslint.org/docs/rules/no-void#allowasstatement) option. + +### `ignoreIIFE` + +{/* insert option description */} + +Examples of **correct** code for this rule with `{ ignoreIIFE: true }`: + +{/* prettier-ignore */} +```ts option='{ "ignoreIIFE": true }' showPlaygroundButton +await (async function () { + await res(1); +})(); + +(async function () { + await res(1); +})(); +``` + +### `allowForKnownSafePromises` + +{/* insert option description */} + +For example, you may need to do this in the case of libraries whose APIs return Promises whose rejections are safely handled by the library. + +This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier). + +Examples of code for this rule with: + +```json +{ + "allowForKnownSafePromises": [ + { "from": "file", "name": "SafePromise" }, + { "from": "lib", "name": "PromiseLike" }, + { "from": "package", "name": "Bar", "package": "bar-lib" } + ] +} +``` + + + + +```ts option='{"allowForKnownSafePromises":[{"from":"file","name":"SafePromise"},{"from":"lib","name":"PromiseLike"},{"from":"package","name":"Bar","package":"bar-lib"}]}' +let promise: Promise = Promise.resolve(2); +promise; + +function returnsPromise(): Promise { + return Promise.resolve(42); +} + +returnsPromise(); +``` + + + + +```ts option='{"allowForKnownSafePromises":[{"from":"file","name":"SafePromise"},{"from":"lib","name":"PromiseLike"},{"from":"package","name":"Bar","package":"bar-lib"}]}' +// promises can be marked as safe by using branded types +type SafePromise = Promise & { __linterBrands?: string }; + +let promise: SafePromise = Promise.resolve(2); +promise; + +function returnsSafePromise(): SafePromise { + return Promise.resolve(42); +} + +returnsSafePromise(); +``` + + + + +### `allowForKnownSafeCalls` + +{/* insert option description */} + +For example, you may need to do this in the case of libraries whose APIs may be called without handling the resultant Promises. + +This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier). + +Examples of code for this rule with: + +```json +{ + "allowForKnownSafeCalls": [ + { "from": "file", "name": "safe", "path": "input.ts" } + ] +} +``` + + + + +```ts option='{"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.ts"}]}' +declare function unsafe(...args: unknown[]): Promise; + +unsafe('...', () => {}); +``` + + + + +```ts option='{"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.ts"}]}' skipValidation +declare function safe(...args: unknown[]): Promise; + +safe('...', () => {}); +``` + + + + +## When Not To Use It + +This rule can be difficult to enable on large existing projects that set up many floating Promises. +Alternately, if you're not worried about crashes from floating or misused Promises -such as if you have global unhandled Promise handlers registered- then in some cases it may be safe to not use this rule. +You might consider using `void`s and/or [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [`no-misused-promises`](./no-misused-promises.mdx) + +## Further Reading + +- ["Using Promises" MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises). Note especially the sections on [Promise rejection events](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#promise_rejection_events) and [Composition](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#composition). diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.mdx new file mode 100644 index 0000000..d3a1b01 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.mdx @@ -0,0 +1,67 @@ +--- +description: 'Disallow iterating over an array with a for-in loop.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-for-in-array** for documentation. + +A for-in loop (`for (const i in o)`) iterates over the properties of an Object. +While it is legal to use for-in loops with array values, it is not common. There are several potential bugs with this: + +1. It iterates over all enumerable properties, including non-index ones and the entire prototype chain. For example, [`RegExp.prototype.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) returns an array with additional properties, and `for-in` will iterate over them. Some libraries or even your own code may add additional methods to `Array.prototype` (either as polyfill or as custom methods), and if not done properly, they may be iterated over as well. +2. It skips holes in the array. While sparse arrays are rare and advised against, they are still possible and your code should be able to handle them. +3. The "index" is returned as a string, not a number. This can be caught by TypeScript, but can still lead to subtle bugs. + +You may have confused for-in with for-of, which iterates over the elements of the array. If you actually need the index, use a regular `for` loop or the `forEach` method. + +## Examples + + + + +```ts +declare const array: string[]; + +for (const i in array) { + console.log(array[i]); +} + +for (const i in array) { + console.log(i, array[i]); +} +``` + + + + +```ts +declare const array: string[]; + +for (const value of array) { + console.log(value); +} + +for (let i = 0; i < array.length; i += 1) { + console.log(i, array[i]); +} + +array.forEach((value, i) => { + console.log(i, value); +}); + +for (const [i, value] of array.entries()) { + console.log(i, value); +} +``` + + + + +## When Not To Use It + +If your project is a rare one that intentionally loops over string indices of arrays, you can turn off this rule. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.mdx new file mode 100644 index 0000000..df7191a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.mdx @@ -0,0 +1,106 @@ +--- +description: 'Disallow the use of `eval()`-like functions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-implied-eval** for documentation. + +It uses type information to determine which values are `eval()`-like functions. + +It's considered a good practice to avoid using `eval()`. There are security and performance implications involved with doing so, which is why many linters recommend disallowing `eval()`. However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns. + +The first is using `setTimeout()`, `setInterval()`, `setImmediate` or `execScript()` (Internet Explorer only), all of which can accept a string of code as their first argument + +```ts +setTimeout('alert(`Hi!`);', 100); +``` + +or using `new Function()` + +```ts +const fn = new Function('a', 'b', 'return a + b'); +``` + +This is considered an implied `eval()` because a string of code is +passed in to be interpreted. The same can be done with `setInterval()`, `setImmediate()` and `execScript()`. All interpret the JavaScript code in the global scope. + +The best practice is to avoid using `new Function()` or `execScript()` and always use a function for the first argument of `setTimeout()`, `setInterval()` and `setImmediate()`. + +## Examples + +This rule aims to eliminate implied `eval()` through the use of `new Function()`, `setTimeout()`, `setInterval()`, `setImmediate()` or `execScript()`. + + + + +```ts +setTimeout('alert(`Hi!`);', 100); + +setInterval('alert(`Hi!`);', 100); + +setImmediate('alert(`Hi!`)'); + +execScript('alert(`Hi!`)'); + +window.setTimeout('count = 5', 10); + +window.setInterval('foo = bar', 10); + +const fn = '() = {}'; +setTimeout(fn, 100); + +const fn = () => { + return 'x = 10'; +}; +setTimeout(fn(), 100); + +const fn = new Function('a', 'b', 'return a + b'); +``` + + + + +```ts +setTimeout(function () { + alert('Hi!'); +}, 100); + +setInterval(function () { + alert('Hi!'); +}, 100); + +setImmediate(function () { + alert('Hi!'); +}); + +execScript(function () { + alert('Hi!'); +}); + +const fn = () => {}; +setTimeout(fn, 100); + +const foo = { + fn: function () {}, +}; +setTimeout(foo.fn, 100); +setTimeout(foo.fn.bind(this), 100); + +class Foo { + static fn = () => {}; +} + +setTimeout(Foo.fn, 100); +``` + + + + +## When Not To Use It + +If your project is a rare one that needs to allow `new Function()` or `setTimeout()`, `setInterval()`, `setImmediate()` and `execScript()` with string arguments, then you can disable this rule. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-import-type-side-effects.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-import-type-side-effects.mdx new file mode 100644 index 0000000..f115b03 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-import-type-side-effects.mdx @@ -0,0 +1,80 @@ +--- +description: 'Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-import-type-side-effects** for documentation. + +The [`--verbatimModuleSyntax`](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax) compiler option causes TypeScript to do simple and predictable transpilation on import declarations. +Namely, it completely removes import declarations with a top-level `type` qualifier, and it removes any import specifiers with an inline `type` qualifier. + +The latter behavior does have one potentially surprising effect in that in certain cases TS can leave behind a "side effect" import at runtime: + +```ts +import { type A, type B } from 'mod'; + +// is transpiled to + +import {} from 'mod'; +// which is the same as +import 'mod'; +``` + +For the rare case of needing to import for side effects, this may be desirable - but for most cases you will not want to leave behind an unnecessary side effect import. + +## Examples + +This rule enforces that you use a top-level `type` qualifier for imports when it only imports specifiers with an inline `type` qualifier + + + + +```ts +import { type A } from 'mod'; +import { type A as AA } from 'mod'; +import { type A, type B } from 'mod'; +import { type A as AA, type B as BB } from 'mod'; +``` + + + + +```ts +import type { A } from 'mod'; +import type { A as AA } from 'mod'; +import type { A, B } from 'mod'; +import type { A as AA, B as BB } from 'mod'; + +import T from 'mod'; +import type T from 'mod'; + +import * as T from 'mod'; +import type * as T from 'mod'; + +import { T } from 'mod'; +import type { T } from 'mod'; +import { T, U } from 'mod'; +import type { T, U } from 'mod'; +import { type T, U } from 'mod'; +import { T, type U } from 'mod'; + +import type T, { U } from 'mod'; +import T, { type U } from 'mod'; +``` + + + + +## When Not To Use It + +If you're not using TypeScript 5.0's `verbatimModuleSyntax` option and your project is built with a bundler that manages import side effects for you, this rule may not be as useful for you. + +## Related To + +- [`consistent-type-imports`](./consistent-type-imports.mdx) +- [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md) +- [`import/no-duplicates` with `{"prefer-inline": true}`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md#inline-type-imports) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.mdx new file mode 100644 index 0000000..25bfbbe --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.mdx @@ -0,0 +1,113 @@ +--- +description: 'Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-inferrable-types** for documentation. + +TypeScript is able to infer the types of parameters, properties, and variables from their default or initial values. +There is no need to use an explicit `:` type annotation on one of those constructs initialized to a boolean, number, or string. +Doing so adds unnecessary verbosity to code -making it harder to read- and in some cases can prevent TypeScript from inferring a more specific literal type (e.g. `10`) instead of the more general primitive type (e.g. `number`) + +## Examples + + + + +```ts +const a: bigint = 10n; +const a: bigint = BigInt(10); +const a: boolean = !0; +const a: boolean = Boolean(null); +const a: boolean = true; +const a: null = null; +const a: number = 10; +const a: number = Infinity; +const a: number = NaN; +const a: number = Number('1'); +const a: RegExp = /a/; +const a: RegExp = new RegExp('a'); +const a: string = `str`; +const a: string = String(1); +const a: symbol = Symbol('a'); +const a: undefined = undefined; +const a: undefined = void someValue; + +class Foo { + prop: number = 5; +} + +function fn(a: number = 5, b: boolean = true) {} +``` + + + + +```ts +const a = 10n; +const a = BigInt(10); +const a = !0; +const a = Boolean(null); +const a = true; +const a = null; +const a = 10; +const a = Infinity; +const a = NaN; +const a = Number('1'); +const a = /a/; +const a = new RegExp('a'); +const a = `str`; +const a = String(1); +const a = Symbol('a'); +const a = undefined; +const a = void someValue; + +class Foo { + prop = 5; +} + +function fn(a = 5, b = true) {} +``` + + + + +## Options + +### `ignoreParameters` + +{/* insert option description */} + +When set to true, the following pattern is considered valid: + +```ts option='{ "ignoreParameters": true }' showPlaygroundButton +function foo(a: number = 5, b: boolean = true) { + // ... +} +``` + +### `ignoreProperties` + +{/* insert option description */} + +When set to true, the following pattern is considered valid: + +```ts option='{ "ignoreProperties": true }' showPlaygroundButton +class Foo { + prop: number = 5; +} +``` + +## When Not To Use It + +If you strongly prefer to have explicit types regardless of whether they can be inferred, this rule may not be for you. + +If you use the `--isolatedDeclarations` compiler option, this rule is incompatible. + +## Further Reading + +- [TypeScript Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.mdx new file mode 100644 index 0000000..6d9d993 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.mdx @@ -0,0 +1,16 @@ +--- +description: 'Disallow `this` keywords outside of classes or class-like objects.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-invalid-this** for documentation. + +import TypeScriptOverlap from '@site/src/components/TypeScriptOverlap'; + + + +It adds support for TypeScript's `this` parameters. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.mdx new file mode 100644 index 0000000..6cfa270 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.mdx @@ -0,0 +1,119 @@ +--- +description: 'Disallow `void` type outside of generic or return types.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-invalid-void-type** for documentation. + +`void` in TypeScript refers to a function return that is meant to be ignored. +Attempting to use a `void` type outside of a return type or generic type argument is often a sign of programmer error. +`void` can also be misleading for other developers even if used correctly. + +> The `void` type means cannot be mixed with any other types, other than `never`, which accepts all types. +> If you think you need this then you probably want the `undefined` type instead. + +## Examples + + + + +```ts +type PossibleValues = string | number | void; +type MorePossibleValues = string | ((number & any) | (string | void)); + +function logSomething(thing: void) {} +function printArg(arg: T) {} + +logAndReturn(undefined); + +interface Interface { + lambda: () => void; + prop: void; +} + +class MyClass { + private readonly propName: void; +} +``` + + + + +```ts +type NoOp = () => void; + +function noop(): void {} + +let trulyUndefined = void 0; + +async function promiseMeSomething(): Promise {} + +type stillVoid = void | never; +``` + + + + +## Options + +### `allowInGenericTypeArguments` + +{/* insert option description */} + +Alternatively, you can provide an array of strings which allowlist which types may accept `void` as a generic type parameter. + +Any types considered valid by this option will be considered valid as part of a union type with `void`. + +This option is `true` by default. + +The following patterns are considered warnings with `{ allowInGenericTypeArguments: false }`: + +```ts option='{ "allowInGenericTypeArguments": false }' showPlaygroundButton +logAndReturn(undefined); + +let voidPromise: Promise = new Promise(() => {}); +let voidMap: Map = new Map(); +``` + +The following patterns are considered warnings with `{ allowInGenericTypeArguments: ['Ex.Mx.Tx'] }`: + +```ts option='{ "allowInGenericTypeArguments": ["Ex.Mx.Tx"] }' showPlaygroundButton +logAndReturn(undefined); + +type NotAllowedVoid1 = Mx.Tx; +type NotAllowedVoid2 = Tx; +type NotAllowedVoid3 = Promise; +``` + +The following patterns are not considered warnings with `{ allowInGenericTypeArguments: ['Ex.Mx.Tx'] }`: + +```ts option='{ "allowInGenericTypeArguments": ["Ex.Mx.Tx"] }' showPlaygroundButton +type AllowedVoid = Ex.Mx.Tx; +type AllowedVoidUnion = void | Ex.Mx.Tx; +``` + +### `allowAsThisParameter` + +{/* insert option description */} + +This pattern can be useful to explicitly label function types that do not use a `this` argument. [See the TypeScript docs for more information](https://www.typescriptlang.org/docs/handbook/functions.html#this-parameters-in-callbacks). + +This option is `false` by default. + +The following patterns are considered warnings with `{ allowAsThisParameter: false }` but valid with `{ allowAsThisParameter: true }`: + +```ts option='{ "allowAsThisParameter": false }' showPlaygroundButton +function doThing(this: void) {} +class Example { + static helper(this: void) {} + callback(this: void) {} +} +``` + +## When Not To Use It + +If you don't care about if `void` is used with other types, or in invalid places, then you don't need this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.mdx new file mode 100644 index 0000000..6f60b55 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.mdx @@ -0,0 +1,12 @@ +--- +description: 'Disallow function declarations that contain unsafe references inside loop statements.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-loop-func** for documentation. + +It adds support for TypeScript types. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.mdx new file mode 100644 index 0000000..77f4825 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.mdx @@ -0,0 +1,17 @@ +--- +description: 'Disallow literal numbers that lose precision.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-loss-of-precision** for documentation. + +:::danger Deprecated + +This rule has been deprecated because the base [`eslint/no-loss-of-precision`](https://eslint.org/docs/rules/no-loss-of-precision) rule added support for [numeric separators](https://github.com/tc39/proposal-numeric-separator). +There is no longer any need to use this extension rule. + +::: diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.mdx new file mode 100644 index 0000000..a3fd503 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.mdx @@ -0,0 +1,131 @@ +--- +description: 'Disallow magic numbers.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-magic-numbers** for documentation. + +It adds support for: + +- numeric literal types (`type T = 1`), +- `enum` members (`enum Foo { bar = 1 }`), +- `readonly` class properties (`class Foo { readonly bar = 1 }`). + +## Options + +This rule adds the following options: + +```ts +interface Options extends BaseNoMagicNumbersOptions { + ignoreEnums?: boolean; + ignoreNumericLiteralTypes?: boolean; + ignoreReadonlyClassProperties?: boolean; + ignoreTypeIndexes?: boolean; +} + +const defaultOptions: Options = { + ...baseNoMagicNumbersDefaultOptions, + ignoreEnums: false, + ignoreNumericLiteralTypes: false, + ignoreReadonlyClassProperties: false, + ignoreTypeIndexes: false, +}; +``` + +### `ignoreEnums` + +{/* insert option description */} + +Whether enums used in TypeScript are considered okay. `false` by default. + +Examples of **incorrect** code for the `{ "ignoreEnums": false }` option: + +```ts option='{ "ignoreEnums": false }' showPlaygroundButton +enum foo { + SECOND = 1000, +} +``` + +Examples of **correct** code for the `{ "ignoreEnums": true }` option: + +```ts option='{ "ignoreEnums": true }' showPlaygroundButton +enum foo { + SECOND = 1000, +} +``` + +### `ignoreNumericLiteralTypes` + +{/* insert option description */} + +Whether numbers used in TypeScript numeric literal types are considered okay. `false` by default. + +Examples of **incorrect** code for the `{ "ignoreNumericLiteralTypes": false }` option: + +```ts option='{ "ignoreNumericLiteralTypes": false }' showPlaygroundButton +type SmallPrimes = 2 | 3 | 5 | 7 | 11; +``` + +Examples of **correct** code for the `{ "ignoreNumericLiteralTypes": true }` option: + +```ts option='{ "ignoreNumericLiteralTypes": true }' showPlaygroundButton +type SmallPrimes = 2 | 3 | 5 | 7 | 11; +``` + +### `ignoreReadonlyClassProperties` + +{/* insert option description */} + +Whether `readonly` class properties are considered okay. + +Examples of **incorrect** code for the `{ "ignoreReadonlyClassProperties": false }` option: + +```ts option='{ "ignoreReadonlyClassProperties": false }' showPlaygroundButton +class Foo { + readonly A = 1; + readonly B = 2; + public static readonly C = 1; + static readonly D = 1; +} +``` + +Examples of **correct** code for the `{ "ignoreReadonlyClassProperties": true }` option: + +```ts option='{ "ignoreReadonlyClassProperties": true }' showPlaygroundButton +class Foo { + readonly A = 1; + readonly B = 2; + public static readonly C = 1; + static readonly D = 1; +} +``` + +### `ignoreTypeIndexes` + +{/* insert option description */} + +Whether numbers used to index types are okay. `false` by default. + +Examples of **incorrect** code for the `{ "ignoreTypeIndexes": false }` option: + +```ts option='{ "ignoreTypeIndexes": false }' showPlaygroundButton +type Foo = Bar[0]; +type Baz = Parameters[2]; +``` + +Examples of **correct** code for the `{ "ignoreTypeIndexes": true }` option: + +```ts option='{ "ignoreTypeIndexes": true }' showPlaygroundButton +type Foo = Bar[0]; +type Baz = Parameters[2]; +``` + +## When Not To Use It + +If your project frequently deals with constant numbers and you don't wish to take up extra space to declare them, this rule might not be for you. +We recommend at least using descriptive comments and/or names to describe constants. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.mdx new file mode 100644 index 0000000..c4987ea --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.mdx @@ -0,0 +1,61 @@ +--- +description: 'Disallow the `void` operator except when used to discard a value.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-meaningless-void-operator** for documentation. + +`void` in TypeScript refers to a function return that is meant to be ignored. +The `void` operator is a useful tool to convey the programmer's intent to discard a value. +For example, it is recommended as one way of suppressing [`@typescript-eslint/no-floating-promises`](./no-floating-promises.mdx) instead of adding `.catch()` to a promise. + +This rule helps an authors catch API changes where previously a value was being discarded at a call site, but the callee changed so it no longer returns a value. +When combined with [no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions), it also helps _readers_ of the code by ensuring consistency: a statement that looks like `void foo();` is **always** discarding a return value, and a statement that looks like `foo();` is **never** discarding a return value. +This rule reports on any `void` operator whose argument is already of type `void` or `undefined`. + +## Examples + +## Examples + + + + +```ts +void (() => {})(); + +function foo() {} +void foo(); +``` + + + + +```ts +(() => {})(); + +function foo() {} +foo(); // nothing to discard + +function bar(x: number) { + void x; // discarding a number + return 2; +} +void bar(1); // discarding a number +``` + + + + +## Options + +### `checkNever` + +{/* insert option description */} + +## When Not To Use It + +If you don't mind extra `void`s in your project, you can avoid this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.mdx new file mode 100644 index 0000000..e1e02c4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.mdx @@ -0,0 +1,53 @@ +--- +description: 'Enforce valid definition of `new` and `constructor`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-misused-new** for documentation. + +JavaScript classes may define a `constructor` method that runs when a class instance is newly created. +TypeScript allows interfaces that describe a static class object to define a `new()` method (though this is rarely used in real world code). +Developers new to JavaScript classes and/or TypeScript interfaces may sometimes confuse when to use `constructor` or `new`. + +This rule reports when a class defines a method named `new` or an interface defines a method named `constructor`. + +## Examples + + + + +```ts +declare class C { + new(): C; +} + +interface I { + new (): I; + constructor(): void; +} +``` + + + + +```ts +declare class C { + constructor(); +} + +interface I { + new (): C; +} +``` + + + + +## When Not To Use It + +If you intentionally want a class with a `new` method, and you're confident nobody working in your code will mistake it with a constructor, you might not want this rule. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.mdx new file mode 100644 index 0000000..52dc08d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.mdx @@ -0,0 +1,314 @@ +--- +description: 'Disallow Promises in places not designed to handle them.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-misused-promises** for documentation. + +This rule forbids providing Promises to logical locations such as if statements in places where the TypeScript compiler allows them but they are not handled properly. +These situations can often arise due to a missing `await` keyword or just a misunderstanding of the way async +functions are handled/awaited. + +:::tip +`no-misused-promises` only detects code that provides Promises to incorrect _logical_ locations. +See [`no-floating-promises`](./no-floating-promises.mdx) for detecting unhandled Promise _statements_. +::: + +## Options + +### `checksConditionals` + +{/* insert option description */} + +If you don't want to check conditionals, you can configure the rule with `"checksConditionals": false`: + +```json +{ + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksConditionals": false + } + ] +} +``` + +Doing so prevents the rule from looking at code like `if (somePromise)`. + +### `checksVoidReturn` + +{/* insert option description */} + +Likewise, if you don't want to check functions that return promises where a void return is +expected, your configuration will look like this: + +```json +{ + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false + } + ] +} +``` + +You can disable selective parts of the `checksVoidReturn` option by providing an object that disables specific checks. For example, if you don't mind that passing a `() => Promise` to a `() => void` parameter or JSX attribute can lead to a floating unhandled Promise: + +```json +{ + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": { + "arguments": false, + "attributes": false + } + } + ] +} +``` + +The following sub-options are supported: + +#### `arguments` + +Disables checking an asynchronous function passed as argument where the parameter type expects a function that returns `void`. + +#### `attributes` + +Disables checking an asynchronous function passed as a JSX attribute expected to be a function that returns `void`. + +#### `inheritedMethods` + +Disables checking an asynchronous method in a type that extends or implements another type expecting that method to return `void`. + +:::note +For now, `no-misused-promises` only checks _named_ methods against extended/implemented types: that is, call/construct/index signatures are ignored. Call signatures are not required in TypeScript to be consistent with one another, and construct signatures cannot be `async` in the first place. Index signature checking may be implemented in the future. +::: + +#### `properties` + +Disables checking an asynchronous function passed as an object property expected to be a function that returns `void`. + +#### `returns` + +Disables checking an asynchronous function returned in a function whose return type is a function that returns `void`. + +#### `variables` + +Disables checking an asynchronous function used as a variable whose return type is a function that returns `void`. + +### `checksSpreads` + +{/* insert option description */} + +If you don't want to check object spreads, you can add this configuration: + +```json +{ + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksSpreads": false + } + ] +} +``` + +## Examples + +### `checksConditionals` + +{/* insert option description */} + +Examples of code for this rule with `checksConditionals: true`: + + + + +```ts option='{ "checksConditionals": true }' +const promise = Promise.resolve('value'); + +if (promise) { + // Do something +} + +const val = promise ? 123 : 456; + +[1, 2, 3].filter(() => promise); + +while (promise) { + // Do something +} +``` + + + + +```ts option='{ "checksConditionals": true }' +const promise = Promise.resolve('value'); + +// Always `await` the Promise in a conditional +if (await promise) { + // Do something +} + +const val = (await promise) ? 123 : 456; + +const returnVal = await promise; +[1, 2, 3].filter(() => returnVal); + +while (await promise) { + // Do something +} +``` + + + + +### `checksVoidReturn` + +{/* insert option description */} + +Examples of code for this rule with `checksVoidReturn: true`: + + + + +```ts option='{ "checksVoidReturn": true }' +[1, 2, 3].forEach(async value => { + await fetch(`/${value}`); +}); + +new Promise(async (resolve, reject) => { + await fetch('/'); + resolve(); +}); + +document.addEventListener('click', async () => { + console.log('synchronous call'); + await fetch('/'); + console.log('synchronous call'); +}); + +interface MySyncInterface { + setThing(): void; +} +class MyClass implements MySyncInterface { + async setThing(): Promise { + this.thing = await fetchThing(); + } +} +``` + + + + +```ts option='{ "checksVoidReturn": true }' +// for-of puts `await` in outer context +for (const value of [1, 2, 3]) { + await doSomething(value); +} + +// If outer context is not `async`, handle error explicitly +Promise.all( + [1, 2, 3].map(async value => { + await doSomething(value); + }), +).catch(handleError); + +// Use an async IIFE wrapper +new Promise((resolve, reject) => { + // combine with `void` keyword to tell `no-floating-promises` rule to ignore unhandled rejection + void (async () => { + await doSomething(); + resolve(); + })(); +}); + +// Name the async wrapper to call it later +document.addEventListener('click', () => { + const handler = async () => { + await doSomething(); + otherSynchronousCall(); + }; + + try { + synchronousCall(); + } catch (err) { + handleSpecificError(err); + } + + handler().catch(handleError); +}); + +interface MyAsyncInterface { + setThing(): Promise; +} +class MyClass implements MyAsyncInterface { + async setThing(): Promise { + this.thing = await fetchThing(); + } +} +``` + + + + +### `checksSpreads` + +{/* insert option description */} + +Examples of code for this rule with `checksSpreads: true`: + + + + +```ts option='{ "checksSpreads": true }' +const getData = () => fetch('/'); + +console.log({ foo: 42, ...getData() }); + +const awaitData = async () => { + await fetch('/'); +}; + +console.log({ foo: 42, ...awaitData() }); +``` + + + + +```ts option='{ "checksSpreads": true }' +const getData = () => fetch('/'); + +console.log({ foo: 42, ...(await getData()) }); + +const awaitData = async () => { + await fetch('/'); +}; + +console.log({ foo: 42, ...(await awaitData()) }); +``` + + + + +## When Not To Use It + +This rule can be difficult to enable on large existing projects that set up many misused Promises. +Alternately, if you're not worried about crashes from floating or misused Promises -such as if you have global unhandled Promise handlers registered- then in some cases it may be safe to not use this rule. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [TypeScript void function assignability](https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-functions-returning-non-void-assignable-to-function-returning-void) + +## Related To + +- [`no-floating-promises`](./no-floating-promises.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-spread.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-spread.mdx new file mode 100644 index 0000000..5b3320e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-spread.mdx @@ -0,0 +1,132 @@ +--- +description: 'Disallow using the spread operator when it might cause unexpected behavior.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-misused-spread** for documentation. + +[Spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) (`...`) is a JavaScript feature for creating an object with the joined properties of one or more other objects. +TypeScript allows spreading objects whose properties are not typically meant to be enumerated, such as arrays and class instances. + +This rule disallows using the spread syntax on values whose types indicate doing so may cause unexpected behavior. +That includes the following cases: + +- Spreading a `Promise` into an object. + You probably meant to `await` it. +- Spreading a function without properties into an object. + You probably meant to call it. +- Spreading an iterable (`Array`, `Map`, etc.) into an object. + Iterable objects usually do not have meaningful enumerable properties and you probably meant to spread it into an array instead. +- Spreading a string into an array. + String enumeration behaviors in JavaScript around encoded characters are often surprising. +- Spreading a `class` into an object. + This copies all static own properties of the class, but none of the inheritance chain. +- Spreading a class instance into an object. + This does not faithfully copy the instance because only its own properties are copied, but the inheritance chain is lost, including all its methods. + +## Examples + + + + +```ts +declare const promise: Promise; +const spreadPromise = { ...promise }; + +declare function getObject(): Record; +const getObjectSpread = { ...getObject }; + +declare const map: Map; +const mapSpread = { ...map }; + +declare const userName: string; +const characters = [...userName]; +``` + +```ts +declare class Box { + value: number; +} +const boxSpread = { ...Box }; + +declare const instance: Box; +const instanceSpread = { ...instance }; +``` + + + + +```ts +declare const promise: Promise; +const spreadPromise = { ...(await promise) }; + +declare function getObject(): Record; +const getObjectSpread = { ...getObject() }; + +declare const map: Map; +const mapObject = Object.fromEntries(map); + +declare const userName: string; +const characters = userName.split(''); +``` + + + + +## Options + +### `allow` + +{/* insert option description */} + +This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier). + +Examples of a configuration for this option in a `file.ts` file: + +```json +"@typescript-eslint/no-misused-spread": [ + "error", + { + "allow": [ + { "from": "file", "name": "BrandedString", "path": "file.ts" }, + ] + } +] +``` + + + + +```ts option='{"allow":[{ "from": "file", "name": "BrandedString" }]}' +declare const unbrandedString: string; + +const spreadUnbrandedString = [...unbrandedString]; +``` + + + + +```ts option='{"allow":[{ "from": "file", "name": "BrandedString" }]}' +type BrandedString = string & { __brand: 'safe' }; + +declare const brandedString: BrandedString; + +const spreadBrandedString = [...brandedString]; +``` + + + + +## When Not To Use It + +If your application intentionally works with raw data in unusual ways, such as directly manipulating class prototype chains, you might not want this rule. + +If your use cases for unusual spreads only involve a few types, you might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) and/or the [`allow` option](#allow) instead of completely disabling this rule. + +## Further Reading + +- [Strings Shouldn't Be Iterable By Default](https://www.xanthir.com/b4wJ1) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-mixed-enums.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-mixed-enums.mdx new file mode 100644 index 0000000..5e16833 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-mixed-enums.mdx @@ -0,0 +1,96 @@ +--- +description: 'Disallow enums from having both number and string members.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-mixed-enums** for documentation. + +TypeScript enums are allowed to assign numeric or string values to their members. +Most enums contain either all numbers or all strings, but in theory you can mix-and-match within the same enum. +Mixing enum member types is generally considered confusing and a bad practice. + +## Examples + + + + +```ts +enum Status { + Unknown, + Closed = 1, + Open = 'open', +} +``` + + + + +```ts +enum Status { + Unknown = 0, + Closed = 1, + Open = 2, +} +``` + + + + +```ts +enum Status { + Unknown, + Closed, + Open, +} +``` + + + + +```ts +enum Status { + Unknown = 'unknown', + Closed = 'closed', + Open = 'open', +} +``` + + + + +## Iteration Pitfalls of Mixed Enum Member Values + +Enum values may be iterated over using `Object.entries`/`Object.keys`/`Object.values`. + +If all enum members are strings, the number of items will match the number of enum members: + +```ts +enum Status { + Closed = 'closed', + Open = 'open', +} + +// ['closed', 'open'] +Object.values(Status); +``` + +But if the enum contains members that are initialized with numbers -including implicitly initialized numbers— then iteration over that enum will include those numbers as well: + +```ts +enum Status { + Unknown, + Closed = 1, + Open = 'open', +} + +// ["Unknown", "Closed", 0, 1, "open"] +Object.values(Status); +``` + +## When Not To Use It + +If you don't mind the confusion of mixed enum member values and don't iterate over enums, you can safely disable this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.mdx new file mode 100644 index 0000000..7a4928f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.mdx @@ -0,0 +1,157 @@ +--- +description: 'Disallow TypeScript namespaces.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-namespace** for documentation. + +TypeScript historically allowed a form of code organization called "custom modules" (`module Example {}`), later renamed to "namespaces" (`namespace Example`). +Namespaces are an outdated way to organize TypeScript code. +ES2015 module syntax is now preferred (`import`/`export`). + +> This rule does not report on the use of TypeScript module declarations to describe external APIs (`declare module 'foo' {}`). + +## Examples + +Examples of code with the default options: + + + + +```ts +module foo {} +namespace foo {} + +declare module foo {} +declare namespace foo {} +``` + + + + +```ts +declare module 'foo' {} + +// anything inside a d.ts file +``` + + + + +## Options + +### `allowDeclarations` + +{/* insert option description */} + +Examples of code with the `{ "allowDeclarations": true }` option: + + + + +```ts option='{ "allowDeclarations": true }' +module foo {} +namespace foo {} +``` + + + + +```ts option='{ "allowDeclarations": true }' +declare module 'foo' {} +declare module foo {} +declare namespace foo {} + +declare global { + namespace foo {} +} + +declare module foo { + namespace foo {} +} +``` + + + + +Examples of code for the `{ "allowDeclarations": false }` option: + + + + +```ts option='{ "allowDeclarations": false }' +module foo {} +namespace foo {} +declare module foo {} +declare namespace foo {} +``` + + + + +```ts option='{ "allowDeclarations": false }' +declare module 'foo' {} +``` + + + + +### `allowDefinitionFiles` + +{/* insert option description */} + +Examples of code for the `{ "allowDefinitionFiles": true }` option: + + + + +```ts option='{ "allowDefinitionFiles": true }' +// if outside a d.ts file +module foo {} +namespace foo {} + +// if outside a d.ts file and allowDeclarations = false +module foo {} +namespace foo {} +declare module foo {} +declare namespace foo {} +``` + + + + +```ts option='{ "allowDefinitionFiles": true }' +declare module 'foo' {} + +// anything inside a d.ts file +``` + + + + +## When Not To Use It + +If your project uses TypeScript's CommonJS export syntax (`export = ...`), you may need to use namespaces in order to export types from your module. +You can learn more about this at: + +- [TypeScript#52203](https://github.com/microsoft/TypeScript/pull/52203), the pull request introducing [`verbatimModuleSyntax`](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax) +- [TypeScript#60852](https://github.com/microsoft/TypeScript/issues/60852), an issue requesting syntax to export types from a CommonJS module. + +If your project uses this syntax, either because it was architected before modern modules and namespaces, or because a module option such as `verbatimModuleSyntax` requires it, it may be difficult to migrate off of namespaces. +In that case you may not be able to use this rule for parts of your project. + +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +{/* cspell:disable-next-line */} + +- [FAQ: I get errors from the `@typescript-eslint/no-namespace` and/or `no-var` rules about declaring global variables](/troubleshooting/faqs/eslint#i-get-errors-from-the-typescript-eslintno-namespace-andor-no-var-rules-about-declaring-global-variables) +- [FAQ: How should I handle reports that conflict with verbatimModuleSyntax?](/troubleshooting/faqs/typescript#how-should-i-handle-reports-that-conflict-with-verbatimmodulesyntax) +- [TypeScript handbook entry on Modules](https://www.typescriptlang.org/docs/handbook/modules.html) +- [TypeScript handbook entry on Namespaces](https://www.typescriptlang.org/docs/handbook/namespaces.html) +- [TypeScript handbook entry on Namespaces and Modules](https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.mdx new file mode 100644 index 0000000..3c66cdc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.mdx @@ -0,0 +1,60 @@ +--- +description: 'Disallow non-null assertions in the left operand of a nullish coalescing operator.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing** for documentation. + +The `??` nullish coalescing runtime operator allows providing a default value when dealing with `null` or `undefined`. +Using a `!` non-null assertion type operator in the left operand of a nullish coalescing operator is redundant, and likely a sign of programmer error or confusion over the two operators. + +## Examples + + + + +```ts +foo! ?? bar; +foo.bazz! ?? bar; +foo!.bazz! ?? bar; +foo()! ?? bar; + +let x!: string; +x! ?? ''; + +let x: string; +x = foo(); +x! ?? ''; +``` + + + + +```ts +foo ?? bar; +foo ?? bar!; +foo!.bazz ?? bar; +foo!.bazz ?? bar!; +foo() ?? bar; + +// This is considered correct code because there's no way for the user to satisfy it. +let x: string; +x! ?? ''; +``` + + + + +## When Not To Use It + +If your project's types don't yet fully describe whether certain values may be nullable, such as if you're transitioning to `strictNullChecks`, this rule might create many false reports. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) +- [Nullish Coalescing Proposal](https://github.com/tc39/proposal-nullish-coalescing) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.mdx new file mode 100644 index 0000000..0a46583 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.mdx @@ -0,0 +1,46 @@ +--- +description: 'Disallow non-null assertions after an optional chain expression.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain** for documentation. + +`?.` optional chain expressions provide `undefined` if an object is `null` or `undefined`. +Using a `!` non-null assertion to assert the result of an `?.` optional chain expression is non-nullable is likely wrong. + +> Most of the time, either the object was not nullable and did not need the `?.` for its property lookup, or the `!` is incorrect and introducing a type safety hole. + +## Examples + + + + +```ts +foo?.bar!; +foo?.bar()!; +``` + + + + +```ts +foo?.bar; +foo?.bar(); +``` + + + + +## When Not To Use It + +If your project's types don't yet fully describe whether certain values may be nullable, such as if you're transitioning to `strictNullChecks`, this rule might create many false reports. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) +- [Optional Chaining Proposal](https://github.com/tc39/proposal-optional-chaining/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.mdx new file mode 100644 index 0000000..b970633 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.mdx @@ -0,0 +1,48 @@ +--- +description: 'Disallow non-null assertions using the `!` postfix operator.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-non-null-assertion** for documentation. + +TypeScript's `!` non-null assertion operator asserts to the type system that an expression is non-nullable, as in not `null` or `undefined`. +Using assertions to tell the type system new information is often a sign that code is not fully type-safe. +It's generally better to structure program logic so that TypeScript understands when values may be nullable. + +## Examples + + + + +```ts +interface Example { + property?: string; +} + +declare const example: Example; +const includesBaz = example.property!.includes('baz'); +``` + + + + +```ts +interface Example { + property?: string; +} + +declare const example: Example; +const includesBaz = example.property?.includes('baz') ?? false; +``` + + + + +## When Not To Use It + +If your project's types don't yet fully describe whether certain values may be nullable, such as if you're transitioning to `strictNullChecks`, this rule might create many false reports. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.mdx new file mode 100644 index 0000000..4af33c6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.mdx @@ -0,0 +1,16 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been deprecated in favour of the [`parameter-properties`](https://typescript-eslint.io/rules/parameter-properties/) rule. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.mdx new file mode 100644 index 0000000..f969157 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.mdx @@ -0,0 +1,79 @@ +--- +description: 'Disallow variable redeclaration.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-redeclare** for documentation. + +import TypeScriptOverlap from '@site/src/components/TypeScriptOverlap'; + + + +It adds support for TypeScript function overloads, and declaration merging. + +## Options + +This rule adds the following options: + +```ts +interface Options extends BaseNoRedeclareOptions { + ignoreDeclarationMerge?: boolean; +} + +const defaultOptions: Options = { + ...baseNoRedeclareDefaultOptions, + ignoreDeclarationMerge: true, +}; +``` + +### `ignoreDeclarationMerge` + +{/* insert option description */} + +The following sets will be ignored when this option is enabled: + +- interface + interface +- namespace + namespace +- class + interface +- class + namespace +- class + interface + namespace +- function + namespace +- enum + namespace + +Examples of **correct** code with `{ ignoreDeclarationMerge: true }`: + +```ts option='{ "ignoreDeclarationMerge": true }' showPlaygroundButton +interface A { + prop1: 1; +} +interface A { + prop2: 2; +} + +namespace Foo { + export const a = 1; +} +namespace Foo { + export const b = 2; +} + +class Bar {} +namespace Bar {} + +function Baz() {} +namespace Baz {} +``` + +**Note:** Even with this option set to true, this rule will report if you name a type and a variable the same name. **_This is intentional_**. +Declaring a variable and a type the same is usually an accident, and it can lead to hard-to-understand code. +If you have a rare case where you're intentionally naming a type the same name as a variable, use a disable comment. For example: + +```ts option='{ "ignoreDeclarationMerge": true }' showPlaygroundButton +type something = string; +// eslint-disable-next-line @typescript-eslint/no-redeclare -- intentionally naming the variable the same as the type +const something = 2; +``` diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.mdx new file mode 100644 index 0000000..a119ebd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.mdx @@ -0,0 +1,102 @@ +--- +description: 'Disallow members of unions and intersections that do nothing or override type information.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-redundant-type-constituents** for documentation. + +Some types can override some other types ("constituents") in a union or intersection and/or be overridden by some other types. +TypeScript's set theory of types includes cases where a constituent type might be useless in the parent union or intersection. + +Within `|` unions: + +- `any` and `unknown` "override" all other union members +- `never` is dropped from unions in any position except when in a return type position +- primitive types such as `string` "override" any of their literal types such as `""` + +Within `&` intersections: + +- `any` and `never` "override" all other intersection members +- `unknown` is dropped from intersections +- literal types "override" any primitive types in an intersection +- literal types such as `""` "override" any of their primitive types such as `string` + +## Examples + + + + +```ts +type UnionAny = any | 'foo'; +type UnionUnknown = unknown | 'foo'; +type UnionNever = never | 'foo'; + +type UnionBooleanLiteral = boolean | false; +type UnionNumberLiteral = number | 1; +type UnionStringLiteral = string | 'foo'; + +type IntersectionAny = any & 'foo'; +type IntersectionUnknown = string & unknown; +type IntersectionNever = string | never; + +type IntersectionBooleanLiteral = boolean & false; +type IntersectionNumberLiteral = number & 1; +type IntersectionStringLiteral = string & 'foo'; +``` + + + + +```ts +type UnionAny = any; +type UnionUnknown = unknown; +type UnionNever = never; + +type UnionBooleanLiteral = boolean; +type UnionNumberLiteral = number; +type UnionStringLiteral = string; + +type IntersectionAny = any; +type IntersectionUnknown = string; +type IntersectionNever = string; + +type IntersectionBooleanLiteral = false; +type IntersectionNumberLiteral = 1; +type IntersectionStringLiteral = 'foo'; +``` + + + + +## Limitations + +This rule plays it safe and only works with bottom types, top types, and comparing literal types to primitive types. + +## When Not To Use It + +Some projects choose to occasionally intentionally include a redundant type constituent for documentation purposes. +For example, the following code includes `string` in a union even though the `unknown` makes it redundant: + +```ts +/** + * Normally a string name, but sometimes arbitrary unknown data. + */ +type NameOrOther = string | unknown; +``` + +If you strongly feel a preference for these unnecessary type constituents, this rule might not be for you. + +## Further Reading + +- [Union Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) +- [Intersection Types](https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types) +- [Bottom Types](https://en.wikipedia.org/wiki/Bottom_type) +- [Top Types](https://en.wikipedia.org/wiki/Top_type) + +## Related To + +- [no-duplicate-type-constituents](./no-duplicate-type-constituents.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.mdx new file mode 100644 index 0000000..1d82851 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.mdx @@ -0,0 +1,114 @@ +--- +description: 'Disallow invocation of `require()`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-require-imports** for documentation. + +Depending on your TSConfig settings and whether you're authoring ES Modules or CommonJS, TS may allow both `import` and `require()` to be used, even within a single file. + +This rule enforces that you use the newer ES Module `import` syntax over CommonJS `require()`. + +## Examples + + + + +```ts +const lib1 = require('lib1'); +const { lib2 } = require('lib2'); +import lib3 = require('lib3'); +``` + + + + +```ts +import * as lib1 from 'lib1'; +import { lib2 } from 'lib2'; +import * as lib3 from 'lib3'; +``` + + + + +## Options + +### `allow` + +{/* insert option description */} + +These strings will be compiled into regular expressions with the `u` flag and be used to test against the imported path. A common use case is to allow importing `package.json`. This is because `package.json` commonly lives outside of the TS root directory, so statically importing it would lead to root directory conflicts, especially with `resolveJsonModule` enabled. You can also use it to allow importing any JSON if your environment doesn't support JSON modules, or use it for other cases where `import` statements cannot work. + +With `{ allow: ['/package\\.json$'] }`: + + + + +```ts option='{ "allow": ["/package.json$"] }' +console.log(require('../data.json').version); +``` + + + + +```ts option='{ "allow": ["/package.json$"] }' +console.log(require('../package.json').version); +``` + + + + +### `allowAsImport` + +{/* insert option description */} + +When set to `true`, `import ... = require(...)` declarations won't be reported. +This is beneficial if you use certain module options that require strict CommonJS interop semantics, such as [verbatimModuleSyntax](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax). + +With `{ allowAsImport: true }`: + + + + +```ts option='{ "allowAsImport": true }' +var foo = require('foo'); +const foo = require('foo'); +let foo = require('foo'); +``` + + + + +```ts option='{ "allowAsImport": true }' +import foo = require('foo'); +import foo from 'foo'; +``` + + + + +## Usage with CommonJS + +While this rule is primarily intended to promote ES Module syntax, it still makes sense to enable this rule when authoring CommonJS modules. + +If you prefer to use TypeScript's built-in `import ... from ...` ES Module syntax, which is transformed to `require()` calls during transpilation when outputting CommonJS, you can use the rule's default behavior. + +If, instead, you prefer to use `require()` syntax, we recommend you use this rule with [`allowAsImport`](#allowAsImport) enabled. +That way, you still enforce usage of `import ... = require(...)` rather than bare `require()` calls, which are not statically analyzed by TypeScript. +We don't directly a way to _prohibit_ ES Module syntax from being used; consider instead using TypeScript's [`verbatimModuleSyntax`](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax) option if you find yourself in a situation where you would want this. + +## When Not To Use It + +If you are authoring CommonJS modules _and_ your project frequently uses dynamic `require`s, then this rule might not be applicable to you. +Otherwise the `allowAsImport` option probably suits your needs. + +If only a subset of your project uses dynamic `require`s then you might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [`no-var-requires`](./no-var-requires.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.mdx new file mode 100644 index 0000000..170819f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.mdx @@ -0,0 +1,84 @@ +--- +description: 'Disallow specified modules when loaded by `import`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-restricted-imports** for documentation. + +It adds support for type import syntaxes: + +- `import type X from "..."` +- `import { type X } from "..."` +- `import x = require("...")` + +## Options + +This rule adds the following options: + +### `allowTypeImports` + +{/* insert option description */} + +Whether to allow type-only imports for a path. +Default: `false`. + +You can specify this option for a specific path or pattern as follows: + +```jsonc +{ + "rules": { + "@typescript-eslint/no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "import-foo", + "message": "Please use import-bar instead.", + "allowTypeImports": true, + }, + { + "name": "import-baz", + "message": "Please use import-quux instead.", + "allowTypeImports": true, + }, + ], + }, + ], + }, +} +``` + +Whether to allow [Type-Only Imports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export). + +Examples of code with the above config: + + + + +```ts option='{"paths":[{"name":"import-foo","message":"Please use import-bar instead.","allowTypeImports":true},{"name":"import-baz","message":"Please use import-quux instead.","allowTypeImports":true}]}' +import foo from 'import-foo'; +export { Foo } from 'import-foo'; + +import baz from 'import-baz'; +export { Baz } from 'import-baz'; +``` + + + + +```ts option='{"paths":[{"name":"import-foo","message":"Please use import-bar instead.","allowTypeImports":true},{"name":"import-baz","message":"Please use import-quux instead.","allowTypeImports":true}]}' +import { foo } from 'other-module'; + +import type foo from 'import-foo'; +export type { Foo } from 'import-foo'; + +import type baz from 'import-baz'; +export type { Baz } from 'import-baz'; +``` + + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-types.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-types.mdx new file mode 100644 index 0000000..30485e4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-types.mdx @@ -0,0 +1,70 @@ +--- +description: 'Disallow certain types.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-restricted-types** for documentation. + +It can sometimes be useful to ban specific types from being used in type annotations. +For example, a project might be migrating from using one type to another, and want to ban references to the old type. + +This rule can be configured to ban a list of specific types and can suggest alternatives. +Note that it does not ban the corresponding runtime objects from being used. + +## Options + +### `types` + +{/* insert option description */} + +The type can either be a type name literal (`OldType`) or a a type name with generic parameter instantiation(s) (`OldType`). + +The values can be: + +- A string, which is the error message to be reported; or +- An object with the following properties: + - `message: string`: the message to display when the type is matched. + - `fixWith?: string`: a string to replace the banned type with when the fixer is run. If this is omitted, no fix will be done. + - `suggest?: string[]`: a list of suggested replacements for the banned type. + +Example configuration: + +```jsonc +{ + "@typescript-eslint/no-restricted-types": [ + "error", + { + "types": { + // add a custom message to help explain why not to use it + "OldType": "Don't use OldType because it is unsafe", + + // add a custom message, and tell the plugin how to fix it + "OldAPI": { + "message": "Use NewAPI instead", + "fixWith": "NewAPI", + }, + + // add a custom message, and tell the plugin how to suggest a fix + "SoonToBeOldAPI": { + "message": "Use NewAPI instead", + "suggest": ["NewAPIOne", "NewAPITwo"], + }, + }, + }, + ], +} +``` + +## When Not To Use It + +If you have no need to ban specific types from being used in type annotations, you don't need this rule. + +## Related To + +- [`no-empty-object-type`](./no-empty-object-type.mdx) +- [`no-unsafe-function-type`](./no-unsafe-function-type.mdx) +- [`no-wrapper-object-types`](./no-wrapper-object-types.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.mdx new file mode 100644 index 0000000..ca6b8b1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.mdx @@ -0,0 +1,143 @@ +--- +description: 'Disallow variable declarations from shadowing variables declared in the outer scope.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-shadow** for documentation. + +It adds support for TypeScript's `this` parameters and global augmentation, and adds options for TypeScript features. + +## Options + +This rule adds the following options: + +```ts +type AdditionalHoistOptionEntries = 'types' | 'functions-and-types'; + +type HoistOptionEntries = + | BaseNoShadowHoistOptionEntries + | AdditionalHoistOptionEntries; + +interface Options extends BaseNoShadowOptions { + hoist?: HoistOptionEntries; + ignoreTypeValueShadow?: boolean; + ignoreFunctionTypeParameterNameValueShadow?: boolean; +} + +const defaultOptions: Options = { + ...baseNoShadowDefaultOptions, + hoist: 'functions-and-types', + ignoreTypeValueShadow: true, + ignoreFunctionTypeParameterNameValueShadow: true, +}; +``` + +### hoist: `types` + +Examples of incorrect code for the `{ "hoist": "types" }` option: + +```ts option='{ "hoist": "types" }' showPlaygroundButton +type Bar = 1; +type Foo = 1; +``` + +### hoist: `functions-and-types` + +Examples of incorrect code for the `{ "hoist": "functions-and-types" }` option: + +```ts option='{ "hoist": "functions-and-types" }' showPlaygroundButton +// types +type Bar = 1; +type Foo = 1; + +// functions +if (true) { + let b = 6; +} + +function b() {} +``` + +### `ignoreTypeValueShadow` + +{/* insert option description */} + +This is generally safe because you cannot use variables in type locations without a `typeof` operator, so there's little risk of confusion. + +Examples of **correct** code with `{ ignoreTypeValueShadow: true }`: + +```ts option='{ "ignoreTypeValueShadow": true }' showPlaygroundButton +type Foo = number; +interface Bar { + prop: number; +} + +function f() { + const Foo = 1; + const Bar = 'test'; +} +``` + +:::note + +_Shadowing_ specifically refers to two identical identifiers that are in different, nested scopes. This is different from _redeclaration_, which is when two identical identifiers are in the same scope. Redeclaration is covered by the [`no-redeclare`](./no-redeclare.mdx) rule instead. + +::: + +### `ignoreFunctionTypeParameterNameValueShadow` + +{/* insert option description */} + +Each of a function type's arguments creates a value variable within the scope of the function type. This is done so that you can reference the type later using the `typeof` operator: + +```ts +type Func = (test: string) => typeof test; + +declare const fn: Func; +const result = fn('str'); // typeof result === string +``` + +This means that function type arguments shadow value variable names in parent scopes: + +```ts +let test = 1; +type TestType = typeof test; // === number +type Func = (test: string) => typeof test; // this "test" references the argument, not the variable + +declare const fn: Func; +const result = fn('str'); // typeof result === string +``` + +If you do not use the `typeof` operator in a function type return type position, you can safely turn this option on. + +Examples of **correct** code with `{ ignoreFunctionTypeParameterNameValueShadow: true }`: + +```ts option='{ "ignoreFunctionTypeParameterNameValueShadow": true }' showPlaygroundButton +const test = 1; +type Func = (test: string) => typeof test; +``` + +## FAQ + +### Why does the rule report on enum members that share the same name as a variable in a parent scope? + +Reporting on this case isn't a bug - it is completely intentional and correct reporting! The rule reports due to a relatively unknown feature of enums - enum members create a variable within the enum scope so that they can be referenced within the enum without a qualifier. + +To illustrate this with an example: + +```ts +const A = 2; +enum Test { + A = 1, + B = A, +} + +console.log(Test.B); +// what should be logged? +``` + +Naively looking at the above code, it might look like the log should output `2`, because the outer variable `A`'s value is `2` - however, the code instead outputs `1`, which is the value of `Test.A`. This is because the unqualified code `B = A` is equivalent to the fully-qualified code `B = Test.A`. Due to this behavior, the enum member has **shadowed** the outer variable declaration. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.mdx new file mode 100644 index 0000000..f5a9c86 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.mdx @@ -0,0 +1,124 @@ +--- +description: 'Disallow aliasing `this`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-this-alias** for documentation. + +Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES6 practices +or not managing scope well. + +## Examples + + + + +```ts +const self = this; + +setTimeout(function () { + self.doWork(); +}); +``` + + + + +```ts +setTimeout(() => { + this.doWork(); +}); +``` + + + + +## Options + +### `allowDestructuring` + +{/* insert option description */} + +It can sometimes be useful to destructure properties from a class instance, such as retrieving multiple properties from the instance in one of its methods. +`allowDestructuring` allows those destructures and is `true` by default. +You can explicitly disallow them by setting `allowDestructuring` to `false`. + +Examples of code for the `{ "allowDestructuring": false }` option: + + + + +```ts option='{ "allowDestructuring": false }' +class ComponentLike { + props: unknown; + state: unknown; + + render() { + const { props, state } = this; + + console.log(props); + console.log(state); + } +} +``` + + + + +```ts option='{ "allowDestructuring": false }' +class ComponentLike { + props: unknown; + state: unknown; + + render() { + console.log(this.props); + console.log(this.state); + } +} +``` + + + + +### `allowedNames` + +{/* insert option description */} + +`no-this-alias` can alternately be used to allow only a specific list of names as `this` aliases. +We recommend against this except as a transitory step towards fixing all rule violations. + +Examples of code for the `{ "allowedNames": ["self"] }` option: + + + + +```ts option='{ "allowedNames": ["self"] }' +class Example { + method() { + const that = this; + } +} +``` + + + + +```ts option='{ "allowedNames": ["self"] }' +class Example { + method() { + const self = this; + } +} +``` + + + + +## When Not To Use It + +If your project is structured in a way that it needs to assign `this` to variables, this rule is likely not for you. +If only a subset of your project assigns `this` to variables then you might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.mdx new file mode 100644 index 0000000..3142deb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.mdx @@ -0,0 +1,626 @@ +--- +description: 'Disallow type aliases.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-type-alias** for documentation. + +:::danger Deprecated + +This rule has been deprecated in favour of the [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.mdx) rule. +TypeScript type aliases are a commonly necessary language feature; banning it altogether is oftentimes counterproductive. + +::: + +:::note + +If you want to ban certain classifications of type aliases, consider using [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax). +See [Troubleshooting & FAQs](/troubleshooting/faqs/general#how-can-i-ban-specific-language-feature). + +::: + +In TypeScript, type aliases serve three purposes: + +- Aliasing other types so that we can refer to them using a simpler name. + +```ts +// this... +type Person = { + firstName: string; + lastName: string; + age: number; +}; + +function addPerson(person: Person) { + // ... +} + +// is easier to read than this... +function addPerson(person: { + firstName: string; + lastName: string; + age: number; +}) { + // ... +} +``` + +- Act sort of like an interface, providing a set of methods and properties that must exist + in the objects implementing the type. + +```ts +type Person = { + firstName: string; + lastName: string; + age: number; + walk: () => void; + talk: () => void; +}; + +// you know person will have 3 properties and 2 methods, +// because the structure has already been defined. +var person: Person = { + // ... +}; + +// so we can be sure that this will work +person.walk(); +``` + +- Act like mapping tools between types to allow quick modifications. + +```ts +type Immutable = { readonly [P in keyof T]: T[P] }; + +type Person = { + name: string; + age: number; +}; + +type ImmutablePerson = Immutable; + +var person: ImmutablePerson = { name: 'John', age: 30 }; +person.name = 'Brad'; // error, readonly property +``` + +When aliasing, the type alias does not create a new type, it just creates a new name +to refer to the original type. So aliasing primitives and other simple types, tuples, unions +or intersections can some times be redundant. + +```ts +// this doesn't make much sense +type myString = string; +``` + +On the other hand, using a type alias as an interface can limit your ability to: + +- Reuse your code: interfaces can be extended or implemented by other types. Type aliases cannot. +- Debug your code: interfaces create a new name, so is easy to identify the base type of an object + while debugging the application. + +Finally, mapping types is an advanced technique and leaving it open can quickly become a pain point +in your application. + +## Examples + +This rule disallows the use of type aliases in favor of interfaces +and simplified types (primitives, tuples, unions, intersections, etc). + +## Options + +### `allowAliases` + +{/* insert option description */} + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. +- `"in-unions"`, allows aliasing in union statements, e.g. `type Foo = string | string[];` +- `"in-intersections"`, allows aliasing in intersection statements, e.g. `type Foo = string & string[];` +- `"in-unions-and-intersections"`, allows aliasing in union and/or intersection statements. + +Examples of **correct** code for the `{ "allowAliases": "always" }` options: + +```ts option='{ "allowAliases": "always" }' showPlaygroundButton +// primitives +type Foo = 'a'; + +type Foo = 'a' | 'b'; + +type Foo = string; + +type Foo = string | string[]; + +type Foo = string & string[]; + +type Foo = `foo-${number}`; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar; + +type Foo = Bar | Baz; + +type Foo = Bar & Baz; +``` + +Examples of **incorrect** code for the `{ "allowAliases": "in-unions" }` option: + +```ts option='{ "allowAliases": "in-unions" }' showPlaygroundButton +// primitives +type Foo = 'a'; + +type Foo = string; + +type Foo = string & string[]; + +type Foo = `foo-${number}`; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar; + +type Foo = Bar & Baz; +``` + +Examples of **correct** code for the `{ "allowAliases": "in-unions" }` option: + +```ts option='{ "allowAliases": "in-unions" }' showPlaygroundButton +// primitives +type Foo = 'a' | 'b'; + +type Foo = string | string[]; + +type Foo = `a-${number}` | `b-${number}`; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar | Baz; +``` + +Examples of **incorrect** code for the `{ "allowAliases": "in-intersections" }` option: + +```ts option='{ "allowAliases": "in-intersections" }' showPlaygroundButton +// primitives +type Foo = 'a'; + +type Foo = 'a' | 'b'; + +type Foo = string; + +type Foo = string | string[]; + +type Foo = `a-${number}` | `b-${number}`; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar; + +type Foo = Bar | Baz; +``` + +Examples of **correct** code for the `{ "allowAliases": "in-intersections" }` option: + +```ts option='{ "allowAliases": "in-intersections" }' showPlaygroundButton +// primitives +type Foo = string & string[]; + +type Foo = `a-${number}` & `b-${number}`; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar & Baz; +``` + +Examples of **incorrect** code for the `{ "allowAliases": "in-unions-and-intersections" }` option: + +```ts option='{ "allowAliases": "in-unions-and-intersections" }' showPlaygroundButton +// primitives +type Foo = 'a'; + +type Foo = string; + +type Foo = `foo-${number}`; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar; +``` + +Examples of **correct** code for the `{ "allowAliases": "in-unions-and-intersections" }` option: + +```ts option='{ "allowAliases": "in-unions-and-intersections" }' showPlaygroundButton +// primitives +type Foo = 'a' | 'b'; + +type Foo = string | string[]; + +type Foo = string & string[]; + +type Foo = `a-${number}` & `b-${number}`; + +type Foo = `a-${number}` | `b-${number}`; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar | Baz; + +type Foo = Bar & Baz; +``` + +### `allowCallbacks` + +{/* insert option description */} + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. + +Examples of **correct** code for the `{ "allowCallbacks": "always" }` option: + +```ts option='{ "allowCallbacks": "always" }' showPlaygroundButton +type Foo = () => void; + +type Foo = (name: string) => string; + +class Person {} + +type Foo = (name: string, age: number) => string | Person; + +type Foo = (name: string, age: number) => string & Person; +``` + +### `allowConditionalTypes` + +{/* insert option description */} + +Examples of **correct** code for the `{ "allowConditionalTypes": "always" }` option: + +```ts option='{ "allowConditionalTypes": "always" }' showPlaygroundButton +type Foo = T extends number ? number : null; +``` + +### `allowConstructors` + +{/* insert option description */} + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. + +Examples of **correct** code for the `{ "allowConstructors": "always" }` option: + +```ts option='{ "allowConstructors": "always" }' showPlaygroundButton +type Foo = new () => void; +``` + +### `allowLiterals` + +{/* insert option description */} + +The setting accepts the following options: + +- `"always"` or `"never"` to active or deactivate the feature. +- `"in-unions"`, allows literals in union statements, e.g. `type Foo = string | string[];` +- `"in-intersections"`, allows literals in intersection statements, e.g. `type Foo = string & string[];` +- `"in-unions-and-intersections"`, allows literals in union and/or intersection statements. + +Examples of **correct** code for the `{ "allowLiterals": "always" }` options: + +```ts option='{ "allowLiterals": "always" }' showPlaygroundButton +type Foo = {}; + +type Foo = { + name: string; + age: number; +}; + +type Foo = { + name: string; + age: number; + walk: (miles: number) => void; +}; + +type Foo = { name: string } | { age: number }; + +type Foo = { name: string } & { age: number }; +``` + +Examples of **incorrect** code for the `{ "allowLiterals": "in-unions" }` option: + +```ts option='{ "allowLiterals": "in-unions" }' showPlaygroundButton +type Foo = {}; + +type Foo = { + name: string; + age: number; +}; + +type Foo = { + name: string; + age: number; + walk: (miles: number) => void; +}; + +type Foo = { name: string } & { age: number }; +``` + +Examples of **correct** code for the `{ "allowLiterals": "in-unions" }` option: + +```ts option='{ "allowLiterals": "in-unions" }' showPlaygroundButton +type Foo = { name: string } | { age: number }; +``` + +Examples of **incorrect** code for the `{ "allowLiterals": "in-intersections" }` option: + +```ts option='{ "allowLiterals": "in-intersections" }' showPlaygroundButton +type Foo = {}; + +type Foo = { + name: string; + age: number; +}; + +type Foo = { + name: string; + age: number; + walk: (miles: number) => void; +}; + +type Foo = { name: string } | { age: number }; +``` + +Examples of **correct** code for the `{ "allowLiterals": "in-intersections" }` option: + +```ts option='{ "allowLiterals": "in-intersections" }' showPlaygroundButton +type Foo = { name: string } & { age: number }; +``` + +Examples of **incorrect** code for the `{ "allowLiterals": "in-unions-and-intersections" }` option: + +```ts option='{ "allowLiterals": "in-unions-and-intersections" }' showPlaygroundButton +type Foo = {}; + +type Foo = { + name: string; + age: number; +}; + +type Foo = { + name: string; + age: number; + walk: (miles: number) => void; +}; +``` + +Examples of **correct** code for the `{ "allowLiterals": "in-unions-and-intersections" }` option: + +```ts option='{ "allowLiterals": "in-unions-and-intersections" }' showPlaygroundButton +type Foo = { name: string } | { age: number }; + +type Foo = { name: string } & { age: number }; +``` + +### `allowMappedTypes` + +{/* insert option description */} + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. +- `"in-unions"`, allows aliasing in union statements, e.g. `type Foo = string | string[];` +- `"in-intersections"`, allows aliasing in intersection statements, e.g. `type Foo = string & string[];` +- `"in-unions-and-intersections"`, allows aliasing in union and/or intersection statements. + +Examples of **correct** code for the `{ "allowMappedTypes": "always" }` options: + +```ts option='{ "allowMappedTypes": "always" }' showPlaygroundButton +type Foo = { readonly [P in keyof T]: T[P] }; + +type Foo = { [P in keyof T]?: T[P] }; + +type Foo = + | { readonly [P in keyof T]: T[P] } + | { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] }; + +type Foo = { readonly [P in keyof T]: T[P] } & { + readonly [P in keyof U]: U[P]; +}; + +type Foo = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] }; +``` + +Examples of **incorrect** code for the `{ "allowMappedTypes": "in-unions" }` option: + +```ts option='{ "allowMappedTypes": "in-unions" }' showPlaygroundButton +type Foo = { readonly [P in keyof T]: T[P] }; + +type Foo = { [P in keyof T]?: T[P] }; + +type Foo = { readonly [P in keyof T]: T[P] } & { + readonly [P in keyof U]: U[P]; +}; + +type Foo = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] }; +``` + +Examples of **correct** code for the `{ "allowMappedTypes": "in-unions" }` option: + +```ts option='{ "allowMappedTypes": "in-unions" }' showPlaygroundButton +type Foo = + | { readonly [P in keyof T]: T[P] } + | { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] }; +``` + +Examples of **incorrect** code for the `{ "allowMappedTypes": "in-intersections" }` option: + +```ts option='{ "allowMappedTypes": "in-intersections" }' showPlaygroundButton +type Foo = { readonly [P in keyof T]: T[P] }; + +type Foo = { [P in keyof T]?: T[P] }; + +type Foo = + | { readonly [P in keyof T]: T[P] } + | { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] }; +``` + +Examples of **correct** code for the `{ "allowMappedTypes": "in-intersections" }` option: + +```ts option='{ "allowMappedTypes": "in-intersections" }' showPlaygroundButton +type Foo = { readonly [P in keyof T]: T[P] } & { + readonly [P in keyof U]: U[P]; +}; + +type Foo = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] }; +``` + +Examples of **incorrect** code for the `{ "allowMappedTypes": "in-unions-and-intersections" }` option: + +```ts option='{ "allowMappedTypes": "in-unions-and-intersections" }' showPlaygroundButton +type Foo = { readonly [P in keyof T]: T[P] }; + +type Foo = { [P in keyof T]?: T[P] }; +``` + +Examples of **correct** code for the `{ "allowMappedTypes": "in-unions-and-intersections" }` option: + +```ts option='{ "allowMappedTypes": "in-unions-and-intersections" }' showPlaygroundButton +type Foo = + | { readonly [P in keyof T]: T[P] } + | { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] }; + +type Foo = { readonly [P in keyof T]: T[P] } & { + readonly [P in keyof U]: U[P]; +}; + +type Foo = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] }; +``` + +### `allowTupleTypes` + +{/* insert option description */} + +The setting accepts the following options: + +- `"always"` or `"never"` to active or deactivate the feature. +- `"in-unions"`, allows tuples in union statements, e.g. `type Foo = [string] | [string, string];` +- `"in-intersections"`, allows tuples in intersection statements, e.g. `type Foo = [string] & [string, string];` +- `"in-unions-and-intersections"`, allows tuples in union and/or intersection statements. + +Examples of **correct** code for the `{ "allowTupleTypes": "always" }` options: + +```ts option='{ "allowTupleTypes": "always" }' showPlaygroundButton +type Foo = [number]; + +type Foo = [number] | [number, number]; + +type Foo = [number] & [number, number]; + +type Foo = [number] | ([number, number] & [string, string]); +``` + +Examples of **incorrect** code for the `{ "allowTupleTypes": "in-unions" }` option: + +```ts option='{ "allowTupleTypes": "in-unions" }' showPlaygroundButton +type Foo = [number]; + +type Foo = [number] & [number, number]; + +type Foo = [string] & [number]; +``` + +Examples of **correct** code for the `{ "allowTupleTypes": "in-unions" }` option: + +```ts option='{ "allowTupleTypes": "in-unions" }' showPlaygroundButton +type Foo = [number] | [number, number]; + +type Foo = [string] | [number]; +``` + +Examples of **incorrect** code for the `{ "allowTupleTypes": "in-intersections" }` option: + +```ts option='{ "allowTupleTypes": "in-intersections" }' showPlaygroundButton +type Foo = [number]; + +type Foo = [number] | [number, number]; + +type Foo = [string] | [number]; +``` + +Examples of **correct** code for the `{ "allowTupleTypes": "in-intersections" }` option: + +```ts option='{ "allowTupleTypes": "in-intersections" }' showPlaygroundButton +type Foo = [number] & [number, number]; + +type Foo = [string] & [number]; +``` + +Examples of **incorrect** code for the `{ "allowTupleTypes": "in-unions-and-intersections" }` option: + +```ts option='{ "allowTupleTypes": "in-unions-and-intersections" }' showPlaygroundButton +type Foo = [number]; + +type Foo = [string]; +``` + +Examples of **correct** code for the `{ "allowTupleTypes": "in-unions-and-intersections" }` option: + +```ts option='{ "allowTupleTypes": "in-unions-and-intersections" }' showPlaygroundButton +type Foo = [number] & [number, number]; + +type Foo = [string] | [number]; +``` + +### `allowGenerics` + +{/* insert option description */} + +The setting accepts the following options: + +- `"always"` or `"never"` to active or deactivate the feature. + +Examples of **correct** code for the `{ "allowGenerics": "always" }` options: + +```ts option='{ "allowGenerics": "always" }' showPlaygroundButton +type Foo = Bar; + +type Foo = Record; + +type Foo = Readonly; + +type Foo = Partial; + +type Foo = Omit; +``` + +{/* Intentionally Omitted: When Not To Use It */} + +## Further Reading + +- [Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.mdx new file mode 100644 index 0000000..3562b8d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.mdx @@ -0,0 +1,165 @@ +--- +description: 'Disallow unnecessary equality comparisons against boolean literals.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare** for documentation. + +Comparing boolean values to boolean literals is unnecessary: those comparisons result in the same booleans. +Using the boolean values directly, or via a unary negation (`!value`), is more concise and clearer. + +This rule ensures that you do not include unnecessary comparisons with boolean literals. +A comparison is considered unnecessary if it checks a boolean literal against any variable with just the `boolean` type. +A comparison is **_not_** considered unnecessary if the type is a union of booleans (`string | boolean`, `SomeObject | boolean`, etc.). + +## Examples + +:::note +Throughout this page, only strict equality (`===` and `!==`) are used in the examples. +However, the implementation of the rule does not distinguish between strict and loose equality. +Any example below that uses `===` would be treated the same way if `==` was used, and `!==` would be treated the same way if `!=` was used. +::: + + + + +```ts +declare const someCondition: boolean; +if (someCondition === true) { +} +``` + + + + +```ts +declare const someCondition: boolean; +if (someCondition) { +} + +declare const someObjectBoolean: boolean | Record; +if (someObjectBoolean === true) { +} + +declare const someStringBoolean: boolean | string; +if (someStringBoolean === true) { +} +``` + + + + +## Options + +This rule always checks comparisons between a boolean variable and a boolean +literal. Comparisons between nullable boolean variables and boolean literals +are **not** checked by default. + +### `allowComparingNullableBooleansToTrue` + +{/* insert option description */} + +Examples of code for this rule with `{ allowComparingNullableBooleansToTrue: false }`: + + + + +```ts option='{ "allowComparingNullableBooleansToTrue": false }' +declare const someUndefinedCondition: boolean | undefined; +if (someUndefinedCondition === true) { +} + +declare const someNullCondition: boolean | null; +if (someNullCondition !== true) { +} +``` + + + + +```ts option='{ "allowComparingNullableBooleansToTrue": false }' +declare const someUndefinedCondition: boolean | undefined; +if (someUndefinedCondition) { +} + +declare const someNullCondition: boolean | null; +if (!someNullCondition) { +} +``` + + + + +### `allowComparingNullableBooleansToFalse` + +{/* insert option description */} + +Examples of code for this rule with `{ allowComparingNullableBooleansToFalse: false }`: + + + + +```ts option='{ "allowComparingNullableBooleansToFalse": false }' +declare const someUndefinedCondition: boolean | undefined; +if (someUndefinedCondition === false) { +} + +declare const someNullCondition: boolean | null; +if (someNullCondition !== false) { +} +``` + + + + +```ts option='{ "allowComparingNullableBooleansToFalse": false }' +declare const someUndefinedCondition: boolean | undefined; +if (!(someUndefinedCondition ?? true)) { +} + +declare const someNullCondition: boolean | null; +if (someNullCondition ?? true) { +} +``` + + + + +### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing` + +:::danger Deprecated + +This option will be removed in the next major version of typescript-eslint. + +::: + +{/* insert option description */} + +Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule useless. + +You should be using `strictNullChecks` to ensure complete type-safety in your codebase. + +If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option. + +## Fixer + +| Comparison | Fixer Output | Notes | +| :----------------------------: | ------------------------------- | ----------------------------------------------------------------------------------- | +| `booleanVar === true` | `booleanVar` | | +| `booleanVar !== true` | `!booleanVar` | | +| `booleanVar === false` | `!booleanVar` | | +| `booleanVar !== false` | `booleanVar` | | +| `nullableBooleanVar === true` | `nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` | +| `nullableBooleanVar !== true` | `!nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` | +| `nullableBooleanVar === false` | `!(nullableBooleanVar ?? true)` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` | +| `nullableBooleanVar !== false` | `nullableBooleanVar ?? true` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` | + +## When Not To Use It + +Do not use this rule when `strictNullChecks` is disabled. +ESLint is not able to distinguish between `false` and `undefined` or `null` values. +This can cause unintended code changes when using autofix. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.mdx new file mode 100644 index 0000000..734da5d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.mdx @@ -0,0 +1,244 @@ +--- +description: 'Disallow conditionals where the type is always truthy or always falsy.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-condition** for documentation. + +Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary". +Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary and will be flagged by this rule. + +The following expressions are checked: + +- Arguments to the `&&`, `||` and `?:` (ternary) operators +- Conditions for `if`, `for`, `while`, and `do-while` statements +- `case`s in `switch` statements +- Base values of optional chain expressions + +## Examples + + + + +```ts +function head(items: T[]) { + // items can never be nullable, so this is unnecessary + if (items) { + return items[0].toUpperCase(); + } +} + +function foo(arg: 'bar' | 'baz') { + // arg is never nullable or empty string, so this is unnecessary + if (arg) { + } +} + +function bar(arg: string) { + // arg can never be nullish, so ?. is unnecessary + return arg?.length; +} + +// Checks array predicate return types, where possible +[ + [1, 2], + [3, 4], +].filter(t => t); // number[] is always truthy +``` + + + + +```ts +function head(items: T[]) { + // Necessary, since items.length might be 0 + if (items.length) { + return items[0].toUpperCase(); + } +} + +function foo(arg: string) { + // Necessary, since arg might be ''. + if (arg) { + } +} + +function bar(arg?: string | null) { + // Necessary, since arg might be nullish + return arg?.length; +} + +[0, 1, 2, 3].filter(t => t); // number can be truthy or falsy +``` + + + + +## Options + +### `allowConstantLoopConditions` + +{/* insert option description */} + +#### `'never'` + +Disallow constant conditions in loops. Same as `false`. + +Example of incorrect code for `{ allowConstantLoopConditions: 'never' }`: + +```ts option='{ "allowConstantLoopConditions": "never" }' showPlaygroundButton +while (true) { + // ... +} + +for (; true; ) { + // ... +} + +do { + // ... +} while (true); +``` + +#### `'always'` + +Allow constant conditions in loops. Same as `true`. + +Example of correct code for `{ allowConstantLoopConditions: 'always' }`: + +```ts option='{ "allowConstantLoopConditions": "always" }' showPlaygroundButton +while (true) { + // ... +} + +for (; true; ) { + // ... +} + +do { + // ... +} while (true); +``` + +#### `'only-allowed-literals'` + +Permit idiomatic constant literal conditions in `while` loop conditions. + +Specifically, `true`, `false`, `0`, and `1` are allowed despite always being truthy or falsy, as these are common patterns and are not likely to represent developer errors. + +Example of correct code for `{ allowConstantLoopConditions: 'only-allowed-literals' }`: + +```ts option='{ "allowConstantLoopConditions": "only-allowed-literals" }' showPlaygroundButton +while (true) { + // ... +} +``` + +Example of incorrect code for `{ allowConstantLoopConditions: 'only-allowed-literals' }`: + +```ts option='{ "allowConstantLoopConditions": "only-allowed-literals" }' showPlaygroundButton +// `alwaysTrue` has the type of `true` (which isn't allowed) +// as only the literal value of `true` is allowed. + +declare const alwaysTrue: true; + +while (alwaysTrue) { + // ... +} + +// not even a variable that references the value of `true` is allowed, only +// the literal value of `true` used directly. + +const thisIsTrue = true; + +while (thisIsTrue) { + // ... +} +``` + +### `checkTypePredicates` + +{/* insert option description */} + +Example of additional incorrect code with `{ checkTypePredicates: true }`: + +```ts option='{ "checkTypePredicates": true }' showPlaygroundButton +function assert(condition: unknown): asserts condition { + if (!condition) { + throw new Error('Condition is falsy'); + } +} + +assert(false); // Unnecessary; condition is always falsy. + +const neverNull = {}; +assert(neverNull); // Unnecessary; condition is always truthy. + +function isString(value: unknown): value is string { + return typeof value === 'string'; +} + +declare const s: string; + +// Unnecessary; s is always a string. +if (isString(s)) { +} + +function assertIsString(value: unknown): asserts value is string { + if (!isString(value)) { + throw new Error('Value is not a string'); + } +} + +assertIsString(s); // Unnecessary; s is always a string. +``` + +Whether this option makes sense for your project may vary. +Some projects may intentionally use type predicates to ensure that runtime values do indeed match the types according to TypeScript, especially in test code. +Often, it makes sense to use eslint-disable comments in these cases, with a comment indicating why the condition should be checked at runtime, despite appearing unnecessary. +However, in some contexts, it may be more appropriate to keep this option disabled entirely. + +### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing` + +{/* insert option description */} + +:::danger Deprecated +This option will be removed in the next major version of typescript-eslint. +::: + +If this is set to `false`, then the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`. + +Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule useless. + +You should be using `strictNullChecks` to ensure complete type-safety in your codebase. + +If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option. + +## When Not To Use It + +If your project is not accurately typed, such as if it's in the process of being converted to TypeScript or is susceptible to [trade-offs in control flow analysis](https://github.com/Microsoft/TypeScript/issues/9998), it may be difficult to enable this rule for particularly non-type-safe areas of code. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +This rule has a known edge case of triggering on conditions that were modified within function calls (as side effects). +It is due to limitations of TypeScript's type narrowing. +See [#9998](https://github.com/microsoft/TypeScript/issues/9998) for details. +We recommend using a [type assertion](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions) in those cases. + +```ts +let condition = false as boolean; + +const f = () => (condition = true); +f(); + +if (condition) { +} +``` + +## Related To + +- ESLint: [no-constant-condition](https://eslint.org/docs/rules/no-constant-condition) - `no-unnecessary-condition` is essentially a stronger version of `no-constant-condition`, but requires type information. +- [strict-boolean-expressions](./strict-boolean-expressions.mdx) - a more opinionated version of `no-unnecessary-condition`. `strict-boolean-expressions` enforces a specific code style, while `no-unnecessary-condition` is about correctness. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-parameter-property-assignment.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-parameter-property-assignment.mdx new file mode 100644 index 0000000..836ac8b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-parameter-property-assignment.mdx @@ -0,0 +1,42 @@ +--- +description: 'Disallow unnecessary assignment of constructor property parameter.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment** for documentation. + +[TypeScript's parameter properties](https://www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties) allow creating and initializing a member in one place. +Therefore, in most cases, it is not necessary to assign parameter properties of the same name to members within a constructor. + +## Examples + + + + +```ts +class Foo { + constructor(public bar: string) { + this.bar = bar; + } +} +``` + + + + +```ts +class Foo { + constructor(public bar: string) {} +} +``` + + + + +## When Not To Use It + +If you don't use parameter properties, you can ignore this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.mdx new file mode 100644 index 0000000..aaf5edb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.mdx @@ -0,0 +1,57 @@ +--- +description: 'Disallow unnecessary namespace qualifiers.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-qualifier** for documentation. + +Members of TypeScript enums and namespaces are generally retrieved as qualified property lookups: e.g. `Enum.member`. +However, when accessed within their parent enum or namespace, the qualifier is unnecessary: e.g. just `member` instead of `Enum.member`. +This rule reports when an enum or namespace qualifier is unnecessary. + +## Examples + + + + +```ts +enum A { + B, + C = A.B, +} +``` + +```ts +namespace A { + export type B = number; + const x: A.B = 3; +} +``` + + + + +```ts +enum A { + B, + C = B, +} +``` + +```ts +namespace A { + export type B = number; + const x: B = 3; +} +``` + + + + +## When Not To Use It + +If you explicitly prefer to use fully qualified names, such as for explicitness, then you don't need to use this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-template-expression.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-template-expression.mdx new file mode 100644 index 0000000..aded1f4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-template-expression.mdx @@ -0,0 +1,108 @@ +--- +description: 'Disallow unnecessary template expressions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-template-expression** for documentation. + +This rule reports template literals that contain substitution expressions (also variously referred to as embedded expressions or string interpolations) that are unnecessary and can be simplified. + +:::info[Migration from `no-useless-template-literals`] + +This rule was formerly known as [`no-useless-template-literals`](./no-useless-template-literals.mdx). +The new name is a drop-in replacement with identical functionality. + +::: + +## Examples + + + + +```ts +// Static values can be incorporated into the surrounding template. + +const ab1 = `${'a'}${'b'}`; +const ab2 = `a${'b'}`; +type AB1 = `${'A'}${'B'}`; +type AB2 = `A${'B'}`; + +const stringWithNumber = `${'1 + 1 = '}${2}`; + +const stringWithBoolean = `${'true is '}${true}`; + +// Some simple expressions that are already strings +// can be rewritten without a template at all. + +const text = 'a'; +const wrappedText = `${text}`; +type Text = 'A'; +type WrappedText = `${Text}`; + +declare const intersectionWithString: string & { _brand: 'test-brand' }; +const wrappedIntersection = `${intersectionWithString}`; +type IntersectionWithString = string & { _brand: 'test-brand' }; +type WrappedIntersection = `${IntersectionWithString}`; +``` + + + + +```ts +// Static values can be incorporated into the surrounding template. + +const ab1 = `ab`; +const ab2 = `ab`; +type AB = `AB`; + +// Transforming enum members into string unions using template literals is allowed. +enum ABC { + A = 'A', + B = 'B', + C = 'C', +} +type ABCUnion = `${ABC}`; +type A = `${ABC.A}`; + +// Interpolating type parameters is allowed. +type TextUtil = `${T}`; + +const stringWithNumber = `1 + 1 = 2`; + +const stringWithBoolean = `true is true`; + +// Some simple expressions that are already strings +// can be rewritten without a template at all. + +const text = 'a'; +const wrappedText = text; +type Text = 'A'; +type WrappedText = Text; + +declare const intersectionWithString: string & { _brand: 'test-brand' }; +const wrappedIntersection = intersectionWithString; +type IntersectionWithString = string & { _brand: 'test-brand' }; +type WrappedIntersection = IntersectionWithString; +``` + + + + +:::info +This rule does not aim to flag template literals without substitution expressions that could have been written as an ordinary string. +That is to say, this rule will not help you turn `` `this` `` into `"this"`. +If you are looking for such a rule, you can configure the [`@stylistic/ts/quotes`](https://eslint.style/rules/ts/quotes) rule to do this. +::: + +## When Not To Use It + +When you want to allow string expressions inside template literals. + +## Related To + +- [`restrict-template-expressions`](./restrict-template-expressions.mdx) +- [`@stylistic/ts/quotes`](https://eslint.style/rules/ts/quotes) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.mdx new file mode 100644 index 0000000..875b4f4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.mdx @@ -0,0 +1,85 @@ +--- +description: 'Disallow type arguments that are equal to the default.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-type-arguments** for documentation. + +Type parameters in TypeScript may specify a default value. +For example: + +```ts +function f(/* ... */) { + // ... +} +``` + +It is redundant to provide an explicit type parameter equal to that default: e.g. calling `f(...)`. +This rule reports when an explicitly specified type argument is the default for that type parameter. + +## Examples + + + + +```ts +function f() {} +f(); +``` + +```ts +function g() {} +g(); +``` + +```ts +class C {} +new C(); + +class D extends C {} +``` + +```ts +interface I {} +class Impl implements I {} +``` + + + + +```ts +function f() {} +f(); +f(); +``` + +```ts +function g() {} +g(); +g(); +``` + +```ts +class C {} +new C(); +new C(); + +class D extends C {} +class D extends C {} +``` + +```ts +interface I {} +class Impl implements I {} +``` + + + + +## When Not To Use It + +If you prefer explicitly specifying type parameters even when they are equal to the default, you can skip this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.mdx new file mode 100644 index 0000000..497f843 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.mdx @@ -0,0 +1,89 @@ +--- +description: 'Disallow type assertions that do not change the type of an expression.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-type-assertion** for documentation. + +TypeScript can be told an expression is a different type than expected using `as` type assertions. +Leaving `as` assertions in the codebase increases visual clutter and harms code readability, so it's generally best practice to remove them if they don't change the type of an expression. +This rule reports when a type assertion does not change the type of an expression. + +## Examples + + + + +```ts +const foo = 3; +const bar = foo!; +``` + +```ts +const foo = (3 + 5); +``` + +```ts +type Foo = number; +const foo = (3 + 5); +``` + +```ts +type Foo = number; +const foo = (3 + 5) as Foo; +``` + +```ts +const foo = 'foo' as const; +``` + +```ts +function foo(x: number): number { + return x!; // unnecessary non-null +} +``` + + + + +```ts +const foo = 3; +``` + +```ts +const foo = 3 as number; +``` + +```ts +let foo = 'foo' as const; +``` + +```ts +function foo(x: number | undefined): number { + return x!; +} +``` + + + + +## Options + +### `typesToIgnore` + +{/* insert option description */} + +With `@typescript-eslint/no-unnecessary-type-assertion: ["error", { typesToIgnore: ['Foo'] }]`, the following is **correct** code: + +```ts option='{ "typesToIgnore": ["Foo"] }' showPlaygroundButton +type Foo = 3; +const foo: Foo = 3; +``` + +## When Not To Use It + +If you don't care about having no-op type assertions in your code, then you can turn off this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.mdx new file mode 100644 index 0000000..ba52d4b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.mdx @@ -0,0 +1,61 @@ +--- +description: 'Disallow unnecessary constraints on generic types.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-type-constraint** for documentation. + +Generic type parameters (``) in TypeScript may be "constrained" with an [`extends` keyword](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints). +When no `extends` is provided, type parameters default a constraint to `unknown`. +It is therefore redundant to `extend` from `any` or `unknown`. + +## Examples + + + + +```ts +interface FooAny {} + +interface FooUnknown {} + +type BarAny = {}; + +type BarUnknown = {}; + +class BazAny { + quxAny() {} +} + +const QuuxAny = () => {}; + +function QuuzAny() {} +``` + + + + +```ts +interface Foo {} + +type Bar = {}; + +class Baz { + qux() {} +} + +const Quux = () => {}; + +function Quuz() {} +``` + + + + +## When Not To Use It + +If you don't care about the specific styles of your type constraints, or never use them in the first place, then you will not need this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-parameters.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-parameters.mdx new file mode 100644 index 0000000..06a0a9e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-parameters.mdx @@ -0,0 +1,255 @@ +--- +description: "Disallow type parameters that aren't used multiple times." +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unnecessary-type-parameters** for documentation. + +This rule forbids type parameters that aren't used multiple times in a function, method, or class definition. + +Type parameters relate two types. +If a type parameter is only used once, then it is not relating anything. +It can usually be replaced with explicit types such as `unknown`. + +At best unnecessary type parameters make code harder to read. +At worst they can be used to disguise unsafe type assertions. + +:::warning +This rule was recently added, and has a surprising amount of hidden complexity compared to most of our rules. If you encounter unexpected behavior with it, please check closely the [Limitations](#limitations) and [FAQ](#faq) sections below and our [issue tracker](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+no-unnecessary-type-parameters). +If you don't see your case covered, please [reach out to us](https://typescript-eslint.io/contributing/issues)! +::: + +## Examples + + + + +```ts +function second(a: A, b: B): B { + return b; +} + +function parseJSON(input: string): T { + return JSON.parse(input); +} + +function printProperty(obj: T, key: K) { + console.log(obj[key]); +} +``` + + + + +```ts +function second(a: unknown, b: B): B { + return b; +} + +function parseJSON(input: string): unknown { + return JSON.parse(input); +} + +function printProperty(obj: T, key: keyof T) { + console.log(obj[key]); +} + +// T appears twice: in the type of arg and as the return type +function identity(arg: T): T { + return arg; +} + +// T appears twice: "keyof T" and in the inferred return type (T[K]). +// K appears twice: "key: K" and in the inferred return type (T[K]). +function getProperty(obj: T, key: K) { + return obj[key]; +} +``` + + + + +## Limitations + +Note that this rule allows any type parameter that is used multiple times, even if those uses are via a type argument. +For example, the following `T` is used multiple times by virtue of being in an `Array`, even though its name only appears once after declaration: + +```ts +declare function createStateHistory(): T[]; +``` + +This is because the type parameter `T` relates multiple methods in `T[]` (`Array`) together, making it used more than once. + +Therefore, this rule won't report on type parameters used as a type argument. +This includes type arguments provided to global types such as `Array`, `Map`, and `Set` that have multiple methods and properties that can change values based on the type parameter. + +On the other hand, readonly and fixed array-likes such as `readonly T[]`, `ReadonlyArray`, and tuples such as `[T]` are special cases that are specifically reported on when used as input types, or as `readonly` output types. +The following example will be reported because `T` is used only once as type argument for the `ReadonlyArray` global type: + + + + +```ts +declare function length(array: ReadonlyArray): number; +``` + + + + +```ts +declare function length(array: ReadonlyArray): number; +``` + + + + +## FAQ + +### The return type is only used as an input, so why isn't the rule reporting? + +One common reason that this might be the case is when the return type is not specified explicitly. +The rule uses uses type information to count implicit usages of the type parameter in the function signature, including in the inferred return type. +For example, the following function... + +```ts +function identity(arg: T) { + return arg; +} +``` + +...implicitly has a return type of `T`. Therefore, the type parameter `T` is used twice, and the rule will not report this function. + +For other reasons the rule might not be reporting, be sure to check the [Limitations section](#limitations) and other FAQs. + +### I'm using the type parameter inside the function, so why is the rule reporting? + +You might be surprised to that the rule reports on a function like this: + +```ts +function log(string1: T): void { + const string2: T = string1; + console.log(string2); +} +``` + +After all, the type parameter `T` relates the input `string1` and the local variable `string2`, right? +However, this usage is unnecessary, since we can achieve the same results by replacing all usages of the type parameter with its constraint. +That is to say, the function can always be rewritten as: + +```ts +function log(string1: string): void { + const string2: string = string1; + console.log(string2); +} +``` + +Therefore, this rule only counts usages of a type parameter in the _signature_ of a function, method, or class, but not in the implementation. See also [#9735](https://github.com/typescript-eslint/typescript-eslint/issues/9735) + +### Why am I getting TypeScript errors saying "Object literal may only specify known properties" after removing an unnecessary type parameter? + +Suppose you have a situation like the following, which will trigger the rule to report. + +```ts +interface SomeProperties { + foo: string; +} + +// T is only used once, so the rule will report. +function serialize(x: T): string { + return JSON.stringify(x); +} + +serialize({ foo: 'bar', anotherProperty: 'baz' }); +``` + +If we remove the unnecessary type parameter, we'll get an error: + +```ts +function serialize(x: SomeProperties): string { + return JSON.stringify(x); +} + +// TS Error: Object literal may only specify known properties, and 'anotherProperty' does not exist in type 'SomeProperties'. +serialize({ foo: 'bar', anotherProperty: 'baz' }); +``` + +This is because TypeScript figures it's _usually_ an error to explicitly provide excess properties in a location that expects a specific type. +See [the TypeScript handbook's section on excess property checks](https://www.typescriptlang.org/docs/handbook/2/objects.html#excess-property-checks) for further discussion. + +To resolve this, you have two approaches to choose from. + +1. If it doesn't make sense to accept excess properties in your function, you'll want to fix the errors at the call sites. Usually, you can simply remove any excess properties where the function is called. +2. Otherwise, if you do want your function to accept excess properties, you can modify the parameter type in order to allow excess properties explicitly by using an [index signature](https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures): + + ```ts + interface SomeProperties { + foo: string; + + // This allows any other properties. + // You may wish to make these types more specific according to your use case. + [key: PropertKey]: unknown; + } + + function serialize(x: SomeProperties): string { + return JSON.stringify(x); + } + + // No error! + serialize({ foo: 'bar', anotherProperty: 'baz' }); + ``` + +Which solution is appropriate is a case-by-case decision, depending on the intended use case of your function. + +### I have a complex scenario that is reported by the rule, but I can't see how to remove the type parameter. What should I do? + +Sometimes, you may be able to rewrite the code by reaching for some niche TypeScript features, such as [the `NoInfer` utility type](https://www.typescriptlang.org/docs/handbook/utility-types.html#noinfertype) (see [#9751](https://github.com/typescript-eslint/typescript-eslint/issues/9751)). + +But, quite possibly, you've hit an edge case where the type is being used in a subtle way that the rule doesn't account for. +For example, the following arcane code is a way of testing whether two types are equal, and will be reported by the rule (see [#9709](https://github.com/typescript-eslint/typescript-eslint/issues/9709)): + +{/* prettier-ignore */} +```ts +type Compute = A extends Function ? A : { [K in keyof A]: Compute }; +type Equal = + (() => T1 extends Compute ? 1 : 2) extends + (() => T2 extends Compute ? 1 : 2) + ? true + : false; +``` + +In this case, the function types created within the `Equal` type are never expected to be assigned to; they're just created for the purpose of type system manipulations. +This usage is not what the rule is intended to analyze. + +Use eslint-disable comments as appropriate to suppress the rule in these kinds of cases. + +{/* TODO - include an FAQ entry regarding instantiation expressions once the conversation in https://github.com/typescript-eslint/typescript-eslint/pull/9536#discussion_r1705850744 is done */} + +## When Not To Use It + +This rule will report on functions that use type parameters solely to test types, for example: + +```ts +function assertType(arg: T) {} + +assertType(123); +assertType('abc'); +// ~~~~~ +// Argument of type 'string' is not assignable to parameter of type 'number'. +``` + +If you're using this pattern then you'll want to disable this rule on files that test types. + +## Further Reading + +- TypeScript handbook: [Type Parameters Should Appear Twice](https://microsoft.github.io/TypeScript-New-Handbook/everything/#type-parameters-should-appear-twice) +- Effective TypeScript: [The Golden Rule of Generics](https://effectivetypescript.com/2020/08/12/generics-golden-rule/) + +## Related To + +- eslint-plugin-etc's [`no-misused-generics`](https://github.com/cartant/eslint-plugin-etc/blob/main/docs/rules/no-misused-generics.md) +- wotan's [`no-misused-generics`](https://github.com/fimbullinter/wotan/blob/master/packages/mimir/docs/no-misused-generics.md) +- DefinitelyTyped-tools' [`no-unnecessary-generics`](https://github.com/microsoft/DefinitelyTyped-tools/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-generics.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.mdx new file mode 100644 index 0000000..09b98cb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.mdx @@ -0,0 +1,98 @@ +--- +description: 'Disallow calling a function with a value with type `any`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-argument** for documentation. + +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Calling a function with an `any` typed argument creates a potential safety hole and source of bugs. + +This rule disallows calling a function with `any` in its arguments. +That includes spreading arrays or tuples with `any` typed elements as function arguments. + +This rule also compares generic type argument types to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type. +For example, it will error if you pass `Set` as an argument to a parameter declared as `Set`. + +## Examples + + + + +```ts +declare function foo(arg1: string, arg2: number, arg3: string): void; + +const anyTyped = 1 as any; + +foo(...anyTyped); +foo(anyTyped, 1, 'a'); + +const anyArray: any[] = []; +foo(...anyArray); + +const tuple1 = ['a', anyTyped, 'b'] as const; +foo(...tuple1); + +const tuple2 = [1] as const; +foo('a', ...tuple2, anyTyped); + +declare function bar(arg1: string, arg2: number, ...rest: string[]): void; +const x = [1, 2] as [number, ...number[]]; +foo('a', ...x, anyTyped); + +declare function baz(arg1: Set, arg2: Map): void; +foo(new Set(), new Map()); +``` + + + + +```ts +declare function foo(arg1: string, arg2: number, arg3: string): void; + +foo('a', 1, 'b'); + +const tuple1 = ['a', 1, 'b'] as const; +foo(...tuple1); + +declare function bar(arg1: string, arg2: number, ...rest: string[]): void; +const array: string[] = ['a']; +bar('a', 1, ...array); + +declare function baz(arg1: Set, arg2: Map): void; +foo(new Set(), new Map()); +``` + + + + +There are cases where the rule allows passing an argument of `any` to `unknown`. + +Example of `any` to `unknown` assignment that are allowed: + +```ts showPlaygroundButton +declare function foo(arg1: unknown, arg2: Set, arg3: unknown[]): void; +foo(1 as any, new Set(), [] as any[]); +``` + +## When Not To Use It + +If your codebase has many existing `any`s or areas of unsafe code, it may be difficult to enable this rule. +It may be easier to skip the `no-unsafe-*` rules pending increasing type safety in unsafe areas of your project. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [Avoiding `any`s with Linting and TypeScript](/blog/avoiding-anys) +- [`no-explicit-any`](./no-explicit-any.mdx) +- [`no-unsafe-assignment`](./no-unsafe-assignment.mdx) +- [`no-unsafe-call`](./no-unsafe-call.mdx) +- [`no-unsafe-member-access`](./no-unsafe-member-access.mdx) +- [`no-unsafe-return`](./no-unsafe-return.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.mdx new file mode 100644 index 0000000..dceab88 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.mdx @@ -0,0 +1,101 @@ +--- +description: 'Disallow assigning a value with type `any` to variables and properties.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-assignment** for documentation. + +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Assigning an `any` typed value to a variable can be hard to pick up on, particularly if it leaks in from an external library. + +This rule disallows assigning `any` to a variable, and assigning `any[]` to an array destructuring. + +This rule also compares generic type argument types to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type. +For example, it will error if you assign `Set` to a variable declared as `Set`. + +## Examples + + + + +```ts +const x = 1 as any, + y = 1 as any; +const [x] = 1 as any; +const [x] = [] as any[]; +const [x] = [1 as any]; +[x] = [1] as [any]; + +function foo(a = 1 as any) {} +class Foo { + constructor(private a = 1 as any) {} +} +class Foo { + private a = 1 as any; +} + +// generic position examples +const x: Set = new Set(); +const x: Map = new Map(); +const x: Set = new Set(); +const x: Set>> = new Set>>(); +``` + + + + +```ts +const x = 1, + y = 1; +const [x] = [1]; +[x] = [1] as [number]; + +function foo(a = 1) {} +class Foo { + constructor(private a = 1) {} +} +class Foo { + private a = 1; +} + +// generic position examples +const x: Set = new Set(); +const x: Map = new Map(); +const x: Set = new Set(); +const x: Set>> = new Set>>(); +``` + + + + +There are cases where the rule allows assignment of `any` to `unknown`. + +Example of `any` to `unknown` assignment that are allowed: + +```ts showPlaygroundButton +const x: unknown = y as any; +const x: unknown[] = y as any[]; +const x: Set = y as Set; +``` + +## When Not To Use It + +If your codebase has many existing `any`s or areas of unsafe code, it may be difficult to enable this rule. +It may be easier to skip the `no-unsafe-*` rules pending increasing type safety in unsafe areas of your project. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [Avoiding `any`s with Linting and TypeScript](/blog/avoiding-anys) +- [`no-explicit-any`](./no-explicit-any.mdx) +- [`no-unsafe-argument`](./no-unsafe-argument.mdx) +- [`no-unsafe-call`](./no-unsafe-call.mdx) +- [`no-unsafe-member-access`](./no-unsafe-member-access.mdx) +- [`no-unsafe-return`](./no-unsafe-return.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.mdx new file mode 100644 index 0000000..961749b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.mdx @@ -0,0 +1,120 @@ +--- +description: 'Disallow calling a value with type `any`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-call** for documentation. + +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Calling an `any`-typed value as a function creates a potential type safety hole and source of bugs in your codebase. + +This rule disallows calling any value that is typed as `any`. + +## Examples + + + + +```ts +declare const anyVar: any; +declare const nestedAny: { prop: any }; + +anyVar(); +anyVar.a.b(); + +nestedAny.prop(); +nestedAny.prop['a'](); + +new anyVar(); +new nestedAny.prop(); + +anyVar`foo`; +nestedAny.prop`foo`; +``` + + + + +```ts +declare const typedVar: () => void; +declare const typedNested: { prop: { a: () => void } }; + +typedVar(); +typedNested.prop.a(); + +(() => {})(); + +new Map(); + +String.raw`foo`; +``` + + + + +## The Unsafe `Function` Type + +The `Function` type is behaves almost identically to `any` when called, so this rule also disallows calling values of type `Function`. + + + + +```ts +const f: Function = () => {}; +f(); +``` + + + + +Note that whereas [no-unsafe-function-type](./no-unsafe-function-type.mdx) helps prevent the _creation_ of `Function` types, this rule helps prevent the unsafe _use_ of `Function` types, which may creep into your codebase without explicitly referencing the `Function` type at all. +See, for example, the following code: + +```ts +function callUnsafe(maybeFunction: unknown): string { + if (typeof maybeFunction === 'function') { + // TypeScript allows this, but it's completely unsound. + return maybeFunction('call', 'with', 'any', 'args'); + } + // etc +} +``` + +In this sort of situation, beware that there is no way to guarantee with runtime checks that a value is safe to call. +If you _really_ want to call a value whose type you don't know, your best best is to use a `try`/`catch` and suppress any TypeScript or linter errors that get in your way. + +```ts +function callSafe(maybeFunction: unknown): void { + try { + // intentionally unsound type assertion + (maybeFunction as () => unknown)(); + } catch (e) { + console.error( + 'Function either could not be called or threw an error when called: ', + e, + ); + } +} +``` + +## When Not To Use It + +If your codebase has many existing `any`s or areas of unsafe code, it may be difficult to enable this rule. +It may be easier to skip the `no-unsafe-*` rules pending increasing type safety in unsafe areas of your project. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [Avoiding `any`s with Linting and TypeScript](/blog/avoiding-anys) +- [`no-explicit-any`](./no-explicit-any.mdx) +- [`no-unsafe-argument`](./no-unsafe-argument.mdx) +- [`no-unsafe-assignment`](./no-unsafe-assignment.mdx) +- [`no-unsafe-member-access`](./no-unsafe-member-access.mdx) +- [`no-unsafe-return`](./no-unsafe-return.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-declaration-merging.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-declaration-merging.mdx new file mode 100644 index 0000000..d03605f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-declaration-merging.mdx @@ -0,0 +1,65 @@ +--- +description: 'Disallow unsafe declaration merging.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-declaration-merging** for documentation. + +TypeScript's "declaration merging" supports merging separate declarations with the same name. + +Declaration merging between classes and interfaces is unsafe. +The TypeScript compiler doesn't check whether properties are initialized, which can cause lead to TypeScript not detecting code that will cause runtime errors. + +```ts +interface Foo { + nums: number[]; +} + +class Foo {} + +const foo = new Foo(); + +foo.nums.push(1); // Runtime Error: Cannot read properties of undefined. +``` + +## Examples + + + + +```ts +interface Foo {} + +class Foo {} +``` + + + + +```ts +interface Foo {} +class Bar implements Foo {} + +namespace Baz {} +namespace Baz {} +enum Baz {} + +namespace Qux {} +function Qux() {} +``` + + + + +## When Not To Use It + +If your project intentionally defines classes and interfaces with unsafe declaration merging patterns, this rule might not be for you. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [Declaration Merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-enum-comparison.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-enum-comparison.mdx new file mode 100644 index 0000000..4b25e78 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-enum-comparison.mdx @@ -0,0 +1,98 @@ +--- +description: 'Disallow comparing an enum value with a non-enum value.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-enum-comparison** for documentation. + +The TypeScript compiler can be surprisingly lenient when working with enums. +While overt safety problems with enums were [resolved in TypeScript 5.0](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#all-enums-are-union-enums), some logical pitfalls remain permitted. +For example, it is allowed to compare enum values against non-enum values: + +```ts +enum Vegetable { + Asparagus = 'asparagus', +} + +declare const vegetable: Vegetable; + +vegetable === 'asparagus'; // No error +``` + +The above code snippet should instead be written as `vegetable === Vegetable.Asparagus`. +Allowing non-enums in comparisons subverts the point of using enums in the first place. +By enforcing comparisons with properly typed enums: + +- It makes a codebase more resilient to enum members changing values. +- It allows for code IDEs to use the "Rename Symbol" feature to quickly rename an enum. +- It aligns code to the proper enum semantics of referring to them by name and treating their values as implementation details. + +## Examples + + + + +```ts +enum Fruit { + Apple, +} + +declare let fruit: Fruit; + +// bad - comparison between enum and explicit value instead of named enum member +fruit === 0; + +enum Vegetable { + Asparagus = 'asparagus', +} + +declare let vegetable: Vegetable; + +// bad - comparison between enum and explicit value instead of named enum member +vegetable === 'asparagus'; + +declare let anyString: string; + +// bad - comparison between enum and non-enum value +anyString === Vegetable.Asparagus; +``` + + + + +```ts +enum Fruit { + Apple, +} + +declare let fruit: Fruit; + +fruit === Fruit.Apple; + +enum Vegetable { + Asparagus = 'asparagus', +} + +declare let vegetable: Vegetable; + +vegetable === Vegetable.Asparagus; +``` + + + + +## When Not To Use It + +If you don't mind enums being treated as a namespaced bag of values, rather than opaque identifiers, you likely don't need this rule. + +Sometimes, you may want to ingest a value from an API or user input, then use it as an enum throughout your application. +While validating the input, it may be appropriate to disable the rule. +Alternately, you might consider making use of a validation library like [Zod](https://zod.dev/?id=native-enums). +See further discussion of this topic in [#8557](https://github.com/typescript-eslint/typescript-eslint/issues/8557). + +Finally, in the rare case of relying on an third party enums that are only imported as `type`s, it may be difficult to adhere to this rule. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-function-type.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-function-type.mdx new file mode 100644 index 0000000..e6cd3a0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-function-type.mdx @@ -0,0 +1,65 @@ +--- +description: 'Disallow using the unsafe built-in Function type.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-function-type** for documentation. + +TypeScript's built-in `Function` type allows being called with any number of arguments and returns type `any`. +`Function` also allows classes or plain objects that happen to possess all properties of the `Function` class. +It's generally better to specify function parameters and return types with the function type syntax. + +"Catch-all" function types include: + +- `() => void`: a function that has no parameters and whose return is ignored +- `(...args: never) => unknown`: a "top type" for functions that can be assigned any function type, but can't be called + +Examples of code for this rule: + + + + +```ts +let noParametersOrReturn: Function; +noParametersOrReturn = () => {}; + +let stringToNumber: Function; +stringToNumber = (text: string) => text.length; + +let identity: Function; +identity = value => value; +``` + + + + +```ts +let noParametersOrReturn: () => void; +noParametersOrReturn = () => {}; + +let stringToNumber: (text: string) => number; +stringToNumber = text => text.length; + +let identity: (value: T) => T; +identity = value => value; +``` + + + + +## When Not To Use It + +If your project is still onboarding to TypeScript, it might be difficult to fully replace all unsafe `Function` types with more precise function types. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [Avoiding `any`s with Linting and TypeScript](/blog/avoiding-anys) +- [`no-empty-object-type`](./no-empty-object-type.mdx) +- [`no-restricted-types`](./no-restricted-types.mdx) +- [`no-unsafe-call`](./no-unsafe-call.mdx) +- [`no-wrapper-object-types`](./no-wrapper-object-types.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.mdx new file mode 100644 index 0000000..2f1eb0e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.mdx @@ -0,0 +1,81 @@ +--- +description: 'Disallow member access on a value with type `any`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-member-access** for documentation. + +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Accessing a member of an `any`-typed value creates a potential type safety hole and source of bugs in your codebase. + +This rule disallows member access on any variable that is typed as `any`. + +## Examples + + + + +```ts +declare const anyVar: any; +declare const nestedAny: { prop: any }; + +anyVar.a; +anyVar.a.b; +anyVar['a']; +anyVar['a']['b']; + +nestedAny.prop.a; +nestedAny.prop['a']; + +const key = 'a'; +nestedAny.prop[key]; + +// Using an any to access a member is unsafe +const arr = [1, 2, 3]; +arr[anyVar]; +nestedAny[anyVar]; +``` + + + + +```ts +declare const properlyTyped: { prop: { a: string } }; + +properlyTyped.prop.a; +properlyTyped.prop['a']; + +const key = 'a'; +properlyTyped.prop[key]; + +const arr = [1, 2, 3]; +arr[1]; +let idx = 1; +arr[idx]; +arr[idx++]; +``` + + + + +## When Not To Use It + +If your codebase has many existing `any`s or areas of unsafe code, it may be difficult to enable this rule. +It may be easier to skip the `no-unsafe-*` rules pending increasing type safety in unsafe areas of your project. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [Avoiding `any`s with Linting and TypeScript](/blog/avoiding-anys) +- [`no-explicit-any`](./no-explicit-any.mdx) +- [`no-unsafe-argument`](./no-unsafe-argument.mdx) +- [`no-unsafe-assignment`](./no-unsafe-assignment.mdx) +- [`no-unsafe-call`](./no-unsafe-call.mdx) +- [`no-unsafe-return`](./no-unsafe-return.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.mdx new file mode 100644 index 0000000..013c14b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.mdx @@ -0,0 +1,126 @@ +--- +description: 'Disallow returning a value with type `any` from a function.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-return** for documentation. + +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Returning an `any`-typed value from a function creates a potential type safety hole and source of bugs in your codebase. + +This rule disallows returning `any` or `any[]` from a function and returning `Promise` from an async function. + +This rule also compares generic type argument types to ensure you don't return an unsafe `any` in a generic position to a function that's expecting a specific type. +For example, it will error if you return `Set` from a function declared as returning `Set`. + +## Examples + + + + +```ts +function foo1() { + return 1 as any; +} +function foo2() { + return Object.create(null); +} +const foo3 = () => { + return 1 as any; +}; +const foo4 = () => Object.create(null); + +function foo5() { + return [] as any[]; +} +function foo6() { + return [] as Array; +} +function foo7() { + return [] as readonly any[]; +} +function foo8() { + return [] as Readonly; +} +const foo9 = () => { + return [] as any[]; +}; +const foo10 = () => [] as any[]; + +const foo11 = (): string[] => [1, 2, 3] as any[]; + +async function foo13() { + return Promise.resolve({} as any); +} + +// generic position examples +function assignability1(): Set { + return new Set([1]); +} +type TAssign = () => Set; +const assignability2: TAssign = () => new Set([true]); +``` + + + + +```ts +function foo1() { + return 1; +} +function foo2() { + return Object.create(null) as Record; +} + +const foo3 = () => []; +const foo4 = () => ['a']; + +async function foo5() { + return Promise.resolve(1); +} + +function assignability1(): Set { + return new Set(['foo']); +} +type TAssign = () => Set; +const assignability2: TAssign = () => new Set(['foo']); +``` + + + + +There are cases where the rule allows to return `any` to `unknown`. + +Examples of `any` to `unknown` return that are allowed: + +```ts showPlaygroundButton +function foo1(): unknown { + return JSON.parse(singleObjString); // Return type for JSON.parse is any. +} + +function foo2(): unknown[] { + return [] as any[]; +} +``` + +## When Not To Use It + +If your codebase has many existing `any`s or areas of unsafe code, it may be difficult to enable this rule. +It may be easier to skip the `no-unsafe-*` rules pending increasing type safety in unsafe areas of your project. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [Avoiding `any`s with Linting and TypeScript](/blog/avoiding-anys) +- [`no-explicit-any`](./no-explicit-any.mdx) +- [`no-unsafe-argument`](./no-unsafe-argument.mdx) +- [`no-unsafe-assignment`](./no-unsafe-assignment.mdx) +- [`no-unsafe-call`](./no-unsafe-call.mdx) +- [`no-unsafe-member-access`](./no-unsafe-member-access.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-type-assertion.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-type-assertion.mdx new file mode 100644 index 0000000..53c1e51 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-type-assertion.mdx @@ -0,0 +1,63 @@ +--- +description: 'Disallow type assertions that narrow a type.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-type-assertion** for documentation. + +Type assertions are a way to tell TypeScript what the type of a value is. This can be useful but also unsafe if you use type assertions to narrow down a type. + +This rule forbids using type assertions to narrow a type, as this bypasses TypeScript's type-checking. Type assertions that broaden a type are safe because TypeScript essentially knows _less_ about a type. + +Instead of using type assertions to narrow a type, it's better to rely on type guards, which help avoid potential runtime errors caused by unsafe type assertions. + +## Examples + + + + +```ts +function f() { + return Math.random() < 0.5 ? 42 : 'oops'; +} + +const z = f() as number; + +const items = [1, '2', 3, '4']; + +const number = items[0] as number; +``` + + + + +```ts +function f() { + return Math.random() < 0.5 ? 42 : 'oops'; +} + +const z = f() as number | string | boolean; + +const items = [1, '2', 3, '4']; + +const number = items[0] as number | string | undefined; +``` + + + + +## When Not To Use It + +If your codebase has many unsafe type assertions, then it may be difficult to enable this rule. +It may be easier to skip the `no-unsafe-*` rules pending increasing type safety in unsafe areas of your project. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +If your project frequently stubs objects in test files, the rule may trigger a lot of reports. Consider disabling the rule for such files to reduce frequent warnings. + +## Further Reading + +- More on TypeScript's [type assertions](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-unary-minus.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-unary-minus.mdx new file mode 100644 index 0000000..307914e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-unary-minus.mdx @@ -0,0 +1,60 @@ +--- +description: 'Require unary negation to take a number.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-unary-minus** for documentation. + +TypeScript does not prevent you from putting a minus sign before things other than numbers: + +```ts +const s = 'hello'; +const x = -s; // x is NaN +``` + +This rule restricts the unary `-` operator to `number | bigint`. + +## Examples + + + + +```ts +declare const a: string; +-a; + +declare const b: {}; +-b; +``` + + + + +```ts +-42; +-42n; + +declare const a: number; +-a; + +declare const b: number; +-b; + +declare const c: number | bigint; +-c; + +declare const d: any; +-d; + +declare const e: 1 | 2; +-e; +``` + + + + +{/* Intentionally Omitted: When Not To Use It */} diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.mdx new file mode 100644 index 0000000..64094a5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.mdx @@ -0,0 +1,52 @@ +--- +description: 'Disallow unused expressions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unused-expressions** for documentation. + +It supports TypeScript-specific expressions: + +- Marks directives in modules declarations (`"use strict"`, etc.) as not unused +- Marks the following expressions as unused if their wrapped value expressions are unused: + - Assertion expressions: `x as number;`, `x!;`, `x;` + - Instantiation expressions: `Set;` + +Although the type expressions never have runtime side effects (that is, `x!;` is the same as `x;`), they can be used to assert types for testing purposes. + +## Examples + + + + +```ts +Set; +1 as number; +window!; +``` + + + + +```ts +function getSet() { + return Set; +} + +// Funtion calls are allowed, so type expressions that wrap function calls are allowed +getSet(); +getSet() as Set; +getSet()!; + +// Namespaces can have directives +namespace A { + 'use strict'; +} +``` + + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.mdx new file mode 100644 index 0000000..461cf3d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.mdx @@ -0,0 +1,120 @@ +--- +description: 'Disallow unused variables.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unused-vars** for documentation. + +It adds support for TypeScript features, such as types. + +## Options + +## FAQs + +### What benefits does this rule have over TypeScript? + +TypeScript provides [`noUnusedLocals`](https://www.typescriptlang.org/tsconfig#noUnusedLocals) and [`noUnusedParameters`](https://www.typescriptlang.org/tsconfig#noUnusedParameters) compiler options that can report errors on unused local variables or parameters, respectively. +Those compiler options can be convenient to use if you don't want to set up ESLint and typescript-eslint. +However: + +- These lint rules are more configurable than TypeScript's compiler options. + - For example, the [`varsIgnorePattern` option](https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern) can customize what names are always allowed to be exempted. TypeScript hardcodes its exemptions to names starting with `_`. + If you would like to emulate the TypeScript style of exempting names starting with `_`, you can use this configuration (this includes errors as well): + ```json + { + "rules": { + "@typescript-eslint/no-unused-vars": [ + "error", + { + "args": "all", + "argsIgnorePattern": "^_", + "caughtErrors": "all", + "caughtErrorsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "ignoreRestSiblings": true + } + ] + } + } + ``` +- [ESLint can be configured](https://eslint.org/docs/latest/use/configure/rules) within lines, files, and folders. TypeScript compiler options are linked to their TSConfig file. +- Many projects configure TypeScript's reported errors to block builds more aggressively than ESLint complaints. Blocking builds on unused variables can be inconvenient. + +We generally recommend using `@typescript-eslint/no-unused-vars` to flag unused locals and parameters instead of TypeScript. + +:::tip +Editors such as VS Code will still generally "grey out" unused variables even if `noUnusedLocals` and `noUnusedParameters` are not enabled in a project. +::: + +Also see similar rules provided by ESLint: + +- [`no-unused-private-class-members`](https://eslint.org/docs/latest/rules/no-unused-private-class-members) +- [`no-unused-labels`](https://eslint.org/docs/latest/rules/no-unused-labels) + +### Why does this rule report variables used only for types? + +This rule does not count type-only uses when determining whether a variable is used. +Declaring variables only to use them for types adds code and runtime complexity. +The variables are never actually used at runtime. +They can be misleading to readers of the code. + + + + + +For example, if a variable is only used for `typeof`, this rule will report: + +```ts +const box = { + // ~~~ + // 'box' is assigned a value but only used as a type. + value: 123, +}; + +export type Box = typeof box; +``` + +Instead, it's often cleaner and less code to write out the types directly: + +```ts +export interface Box { + value: number; +} +``` + + + + + +For example, if a Zod schema variable is only used for `typeof`, this rule will report: + +```ts +import { z } from 'zod'; + +const schema = z.object({ + // ~~~~~~ + // 'schema' is assigned a value but only used as a type. + value: z.number(), +}); + +export type Box = z.infer; +``` + +Instead, it's often cleaner and less code to write out the types directly: + +```ts +export interface Box { + value: number; +} +``` + + + + + +If you find yourself writing runtime values only for types, consider refactoring your code to declare types directly. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.mdx new file mode 100644 index 0000000..fb995cb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.mdx @@ -0,0 +1,98 @@ +--- +description: 'Disallow the use of variables before they are defined.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-use-before-define** for documentation. + +It adds support for `type`, `interface` and `enum` declarations. + +## Options + +This rule adds the following options: + +```ts +interface Options extends BaseNoUseBeforeDefineOptions { + enums?: boolean; + typedefs?: boolean; + ignoreTypeReferences?: boolean; +} + +const defaultOptions: Options = { + ...baseNoUseBeforeDefineDefaultOptions, + enums: true, + typedefs: true, + ignoreTypeReferences: true, +}; +``` + +### `enums` + +{/* insert option description */} + +If this is `true`, this rule warns every reference to a enum before the enum declaration. +If this is `false`, this rule will ignore references to enums, when the reference is in a child scope. + +Examples of code for the `{ "enums": true }` option: + + + + +```ts option='{ "enums": true }' +const x = Foo.FOO; + +enum Foo { + FOO, +} +``` + + + + +```ts option='{ "enums": false }' +function foo() { + return Foo.FOO; +} + +enum Foo { + FOO, +} +``` + + + + +### `typedefs` + +{/* insert option description */} + +If this is `true`, this rule warns every reference to a type before the type declaration. +If this is `false`, this rule will ignore references to types. + +Examples of **correct** code for the `{ "typedefs": false }` option: + +```ts option='{ "typedefs": false }' showPlaygroundButton +let myVar: StringOrNumber; +type StringOrNumber = string | number; +``` + +### `ignoreTypeReferences` + +{/* insert option description */} + +If this is `true`, this rule ignores all type references. +If this is `false`, this will check all type references. + +Examples of **correct** code for the `{ "ignoreTypeReferences": true }` option: + +```ts option='{ "ignoreTypeReferences": true }' showPlaygroundButton +let var1: StringOrNumber; +type StringOrNumber = string | number; + +let var2: Enum; +enum Enum {} +``` diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.mdx new file mode 100644 index 0000000..1154971 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.mdx @@ -0,0 +1,21 @@ +--- +description: 'Disallow unnecessary constructors.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-useless-constructor** for documentation. + +It adds support for: + +- constructors marked as `protected` / `private` (i.e. marking a constructor as non-public), +- `public` constructors when there is no superclass, +- constructors with only parameter properties. + +### Caveat + +This lint rule will report on constructors whose sole purpose is to change visibility of a parent constructor. +See [discussion on this rule's lack of type information](https://github.com/typescript-eslint/typescript-eslint/issues/3820#issuecomment-917821240) for context. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.mdx new file mode 100644 index 0000000..27d66d9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.mdx @@ -0,0 +1,53 @@ +--- +description: "Disallow empty exports that don't change anything in a module file." +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-useless-empty-export** for documentation. + +An empty `export {}` statement is sometimes useful in TypeScript code to turn a file that would otherwise be a script file into a module file. +Per the [TypeScript Handbook Modules page](https://www.typescriptlang.org/docs/handbook/modules.html): + +> In TypeScript, just as in ECMAScript 2015, any file containing a top-level import or export is considered a module. +> Conversely, a file without any top-level import or export declarations is treated as a script whose contents are available in the global scope (and therefore to modules as well). + +However, an `export {}` statement does nothing if there are any other top-level import or export statements in a file. + +This rule reports an `export {}` that doesn't do anything in a file already using ES modules. + +## Examples + + + + +```ts +export const value = 'Hello, world!'; +export {}; +``` + +```ts +import 'some-other-module'; +export {}; +``` + + + + +```ts +export const value = 'Hello, world!'; +``` + +```ts +import 'some-other-module'; +``` + + + + +## When Not To Use It + +If you don't mind an empty `export {}` at the bottom of files, you likely don't need this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-template-literals.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-template-literals.mdx new file mode 100644 index 0000000..c255f8c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-template-literals.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been renamed to [`no-unnecessary-template-expression`](./no-unnecessary-template-expression.mdx). See [#8544](https://github.com/typescript-eslint/typescript-eslint/issues/8544) for more information. + +::: diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.mdx new file mode 100644 index 0000000..fc3e656 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.mdx @@ -0,0 +1,77 @@ +--- +description: 'Disallow `require` statements except in import statements.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-var-requires** for documentation. + +:::danger Deprecated + +This rule has been deprecated in favour of the [`@typescript-eslint/no-require-imports`](./no-require-imports.mdx) rule. + +::: + +In other words, the use of forms such as `var foo = require("foo")` are banned. Instead use ES6 style imports or `import foo = require("foo")` imports. + +## Examples + + + + +```ts +var foo = require('foo'); +const foo = require('foo'); +let foo = require('foo'); +``` + + + + +```ts +import foo = require('foo'); +require('foo'); +import foo from 'foo'; +``` + + + + +## Options + +### `allow` + +{/* insert option description */} + +A array of strings. These strings will be compiled into regular expressions with the `u` flag and be used to test against the imported path. A common use case is to allow importing `package.json`. This is because `package.json` commonly lives outside of the TS root directory, so statically importing it would lead to root directory conflicts, especially with `resolveJsonModule` enabled. You can also use it to allow importing any JSON if your environment doesn't support JSON modules, or use it for other cases where `import` statements cannot work. + +With `{allow: ['/package\\.json$']}`: + + + + +```ts option='{ "allow": ["/package.json$"] }' +const foo = require('../data.json'); +``` + + + + +```ts option='{ "allow": ["/package.json$"] }' +const foo = require('../package.json'); +``` + + + + +## When Not To Use It + +If your project frequently uses older CommonJS `require`s, then this rule might not be applicable to you. +If only a subset of your project uses `require`s then you might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Related To + +- [`no-require-imports`](./no-require-imports.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-wrapper-object-types.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-wrapper-object-types.mdx new file mode 100644 index 0000000..2d6a933 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-wrapper-object-types.mdx @@ -0,0 +1,75 @@ +--- +description: 'Disallow using confusing built-in primitive class wrappers.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-wrapper-object-types** for documentation. + +TypeScript defines several confusing pairs of types that look very similar to each other, but actually mean different things: `boolean`/`Boolean`, `number`/`Number`, `string`/`String`, `bigint`/`BigInt`, `symbol`/`Symbol`, `object`/`Object`. +In general, only the lowercase variant is appropriate to use. +Therefore, this rule enforces that you only use the lowercase variant. + +JavaScript has [8 data types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures) at runtime, and these are described in TypeScript by the lowercase types `undefined`, `null`, `boolean`, `number`, `string`, `bigint`, `symbol`, and `object`. + +As for the uppercase types, these are _structural types_ which describe JavaScript "wrapper" objects for each of the data types, such as [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) and [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number). +Additionally, due to the quirks of structural typing, the corresponding primitives are _also_ assignable to these uppercase types, since they have the same "shape". + +It is a universal best practice to work directly with the built-in primitives, like `0`, rather than objects that "look like" the corresponding primitive, like `new Number(0)`. + +- Primitives have the expected value semantics with `==` and `===` equality checks, whereas their object counterparts are compared by reference. + That is to say, `"str" === "str"` but `new String("str") !== new String("str")`. +- Primitives have well-known behavior around truthiness/falsiness which is common to rely on, whereas all objects are truthy, regardless of the wrapped value (e.g. `new Boolean(false)` is truthy). +- TypeScript only allows arithmetic operations (e.g. `x - y`) to be performed on numeric primitives, not objects. + +As a result, using the lowercase type names like `number` in TypeScript types instead of the uppercase names like `Number` is a better practice that describes code more accurately. + +Examples of code for this rule: + + + + +```ts +let myBigInt: BigInt; +let myBoolean: Boolean; +let myNumber: Number; +let myString: String; +let mySymbol: Symbol; + +let myObject: Object = 'allowed by TypeScript'; +``` + + + + +```ts +let myBigint: bigint; +let myBoolean: boolean; +let myNumber: number; +let myString: string; +let mySymbol: symbol; + +let myObject: object = "Type 'string' is not assignable to type 'object'."; +``` + + + + +## When Not To Use It + +If your project is a rare one that intentionally deals with the class equivalents of primitives, it might not be worthwhile to use this rule. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [MDN documentation on primitives](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) +- [MDN documentation on `string` primitives and `String` objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_primitives_and_string_objects) + +## Related To + +- [`no-empty-object-type`](./no-empty-object-type.mdx) +- [`no-restricted-types`](./no-restricted-types.mdx) +- [`no-unsafe-function-type`](./no-unsafe-function-type.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.mdx new file mode 100644 index 0000000..90ec607 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.mdx @@ -0,0 +1,47 @@ +--- +description: 'Enforce non-null assertions over explicit type assertions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/non-nullable-type-assertion-style** for documentation. + +There are two common ways to assert to TypeScript that a value is its type without `null` or `undefined`: + +- `!`: Non-null assertion +- `as`: Traditional type assertion with a coincidentally equivalent type + +`!` non-null assertions are generally preferred for requiring less code and being harder to fall out of sync as types change. +This rule reports when an `as` assertion is doing the same job as a `!` would, and suggests fixing the code to be an `!`. + +## Examples + + + + +```ts +const maybe: string | undefined = Math.random() > 0.5 ? '' : undefined; + +const definitely = maybe as string; +const alsoDefinitely = maybe; +``` + + + + +```ts +const maybe: string | undefined = Math.random() > 0.5 ? '' : undefined; + +const definitely = maybe!; +const alsoDefinitely = maybe!; +``` + + + + +## When Not To Use It + +If you don't mind having unnecessarily verbose type assertions, you can avoid this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/only-throw-error.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/only-throw-error.mdx new file mode 100644 index 0000000..49d980a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/only-throw-error.mdx @@ -0,0 +1,144 @@ +--- +description: 'Disallow throwing non-`Error` values as exceptions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/only-throw-error** for documentation. + +It uses type information to determine which values are `Error`s. + +It is considered good practice to only `throw` the `Error` object itself or an object using the `Error` object as base objects for user-defined exceptions. +The fundamental benefit of `Error` objects is that they automatically keep track of where they were built and originated. + +:::info[Migration from `no-throw-literal`] + +This extension rule was formerly known as `@typescript-eslint/no-throw-literal`. +The new name is a drop-in replacement with identical functionality. + +::: + +## Examples + +This rule is aimed at maintaining consistency when throwing exception by disallowing to throw literals and other expressions which cannot possibly be an `Error` object. + + + + +```ts +throw 'error'; + +throw 0; + +throw undefined; + +throw null; + +const err = new Error(); +throw 'an ' + err; + +const err = new Error(); +throw `${err}`; + +const err = ''; +throw err; + +function getError() { + return ''; +} +throw getError(); + +const foo = { + bar: '', +}; +throw foo.bar; +``` + + + + +```ts +throw new Error(); + +throw new Error('error'); + +const e = new Error('error'); +throw e; + +try { + throw new Error('error'); +} catch (e) { + throw e; +} + +const err = new Error(); +throw err; + +function getError() { + return new Error(); +} +throw getError(); + +const foo = { + bar: new Error(), +}; +throw foo.bar; + +class CustomError extends Error { + // ... +} +throw new CustomError(); +``` + + + + +## Options + +This rule adds the following options: + +```ts +interface Options { + /** + * Type specifiers that can be thrown. + */ + allow?: ( + | { + from: 'file'; + name: [string, ...string[]] | string; + path?: string; + } + | { + from: 'lib'; + name: [string, ...string[]] | string; + } + | { + from: 'package'; + name: [string, ...string[]] | string; + package: string; + } + | string + )[]; + + /** + * Whether to always allow throwing values typed as `any`. + */ + allowThrowingAny?: boolean; + + /** + * Whether to always allow throwing values typed as `unknown`. + */ + allowThrowingUnknown?: boolean; +} + +const defaultOptions: Options = { + allow: [], + allowThrowingAny: true, + allowThrowingUnknown: true, +}; +``` + +{/* Intentionally Omitted: When Not To Use It */} diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.mdx new file mode 100644 index 0000000..1e60721 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.mdx @@ -0,0 +1,522 @@ +--- +description: 'Require or disallow parameter properties in class constructors.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/parameter-properties** for documentation. + +TypeScript includes a "parameter properties" shorthand for declaring a class constructor parameter and class property in one location. +Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways of declaring and initializing class members. + +This rule can be configured to always disallow the use of parameter properties or enforce their usage when possible. + +## Options + +This rule, in its default state, does not require any argument and would completely disallow the use of parameter properties. +It may take an options object containing either or both of: + +- `"allow"`: allowing certain kinds of properties to be ignored +- `"prefer"`: either `"class-property"` _(default)_ or `"parameter-property"` + +### `allow` + +{/* insert option description */} + +If you would like to ignore certain kinds of properties then you may pass an object containing `"allow"` as an array of any of the following options: + +- `allow`, an array containing one or more of the allowed modifiers. Valid values are: + - `readonly`, allows **readonly** parameter properties. + - `private`, allows **private** parameter properties. + - `protected`, allows **protected** parameter properties. + - `public`, allows **public** parameter properties. + - `private readonly`, allows **private readonly** parameter properties. + - `protected readonly`, allows **protected readonly** parameter properties. + - `public readonly`, allows **public readonly** parameter properties. + +For example, to ignore `public` properties: + +```json +{ + "@typescript-eslint/parameter-properties": [ + true, + { + "allow": ["public"] + } + ] +} +``` + +### `prefer` + +{/* insert option description */} + +By default, the rule prefers class properties. +You can switch it to instead preferring parameter properties with (`"parameter-property"`). + +In `"parameter-property"` mode, the rule will issue a report when: + +- A class property and constructor parameter have the same name and type +- The constructor parameter is assigned to the class property at the beginning of the constructor + +### default + +Examples of code for this rule with no options at all: + + + + +```ts +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + + + + +```ts +class Foo { + constructor(name: string) {} +} +``` + + + + +### readonly + +Examples of code for the `{ "allow": ["readonly"] }` options: + + + + +```ts option='{ "allow": ["readonly"] }' +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + + + + +```ts option='{ "allow": ["readonly"] }' +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(readonly name: string) {} +} +``` + + + + +### private + +Examples of code for the `{ "allow": ["private"] }` options: + + + + +```ts option='{ "allow": ["private"] }' +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + + + + +```ts option='{ "allow": ["private"] }' +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(private name: string) {} +} +``` + + + + +### protected + +Examples of code for the `{ "allow": ["protected"] }` options: + + + + +```ts option='{ "allow": ["protected"] }' +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + + + + +```ts option='{ "allow": ["protected"] }' +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} +``` + + + + +### public + +Examples of code for the `{ "allow": ["public"] }` options: + + + + +```ts option='{ "allow": ["public"] }' +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + + + + +```ts option='{ "allow": ["public"] }' +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(public name: string) {} +} +``` + + + + +### private readonly + +Examples of code for the `{ "allow": ["private readonly"] }` options: + + + + +```ts option='{ "allow": ["private readonly"] }' +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + + + + +```ts option='{ "allow": ["private readonly"] }' +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} +``` + + + + +### protected readonly + +Examples of code for the `{ "allow": ["protected readonly"] }` options: + + + + +```ts option='{ "allow": ["protected readonly"] }' +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + + + + +```ts option='{ "allow": ["protected readonly"] }' +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} +``` + + + + +### public readonly + +Examples of code for the `{ "allow": ["public readonly"] }` options: + + + + +```ts option='{ "allow": ["public readonly"] }' +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} +``` + + + + +```ts option='{ "allow": ["public readonly"] }' +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + + + + +### `"parameter-property"` + +Examples of code for the `{ "prefer": "parameter-property" }` option: + + + + +```ts option='{ "prefer": "parameter-property" }' +class Foo { + private name: string; + constructor(name: string) { + this.name = name; + } +} + +class Foo { + public readonly name: string; + constructor(name: string) { + this.name = name; + } +} + +class Foo { + constructor(name: string) { + this.name = name; + } + name: string; +} +``` + + + + +```ts option='{ "prefer": "parameter-property" }' +class Foo { + private differentName: string; + constructor(name: string) { + this.differentName = name; + } +} + +class Foo { + private differentType: number | undefined; + constructor(differentType: number) { + this.differentType = differentType; + } +} + +class Foo { + protected logicInConstructor: string; + constructor(logicInConstructor: string) { + console.log('Hello, world!'); + this.logicInConstructor = logicInConstructor; + } +} +``` + + + + +## When Not To Use It + +If you don't care about which style of parameter properties in constructors is used in your classes, then you will not need this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.mdx new file mode 100644 index 0000000..e723766 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.mdx @@ -0,0 +1,51 @@ +--- +description: 'Enforce the use of `as const` over literal type.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-as-const** for documentation. + +There are two common ways to tell TypeScript that a literal value should be interpreted as its literal type (e.g. `2`) rather than general primitive type (e.g. `number`); + +- `as const`: telling TypeScript to infer the literal type automatically +- `as` with the literal type: explicitly telling the literal type to TypeScript + +`as const` is generally preferred, as it doesn't require re-typing the literal value. +This rule reports when an `as` with an explicit literal type can be replaced with an `as const`. + +## Examples + + + + +```ts +let bar: 2 = 2; +let foo = <'bar'>'bar'; +let foo = { bar: 'baz' as 'baz' }; +``` + + + + +```ts +let foo = 'bar'; +let foo = 'bar' as const; +let foo: 'bar' = 'bar' as const; +let bar = 'bar' as string; +let foo = 'bar'; +let foo = { bar: 'baz' }; +``` + + + + +## When Not To Use It + +If you don't care about which style of literals assertions is used in your code, then you will not need this rule. + +However, keep in mind that inconsistent style can harm readability in a project. +We recommend picking a single option for this rule that works best for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-destructuring.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-destructuring.mdx new file mode 100644 index 0000000..553323e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-destructuring.mdx @@ -0,0 +1,101 @@ +--- +description: 'Require destructuring from arrays and/or objects.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-destructuring** for documentation. + +It adds support for TypeScript's type annotations in variable declarations. + +## Examples + + + + + +```ts +const x: string = obj.x; // This is incorrect and the auto fixer provides following untyped fix. +// const { x } = obj; +``` + + + + +```ts +const x: string = obj.x; // This is correct by default. You can also forbid this by an option. +``` + + + + +And it infers binding patterns more accurately thanks to the type checker. + + + + +```ts +const x = ['a']; +const y = x[0]; +``` + + + + +```ts +const x = { 0: 'a' }; +const y = x[0]; +``` + +It is correct when `enforceForRenamedProperties` is not true. +Valid destructuring syntax is renamed style like `{ 0: y } = x` rather than `[y] = x` because `x` is not iterable. + + + + +## Options + +This rule adds the following options: + +```ts +type Options = [ + BasePreferDestructuringOptions[0], + BasePreferDestructuringOptions[1] & { + enforceForDeclarationWithTypeAnnotation?: boolean; + }, +]; + +const defaultOptions: Options = [ + basePreferDestructuringDefaultOptions[0], + { + ...basePreferDestructuringDefaultOptions[1], + enforceForDeclarationWithTypeAnnotation: false, + }, +]; +``` + +### `enforceForDeclarationWithTypeAnnotation` + +{/* insert option description */} + +Examples with `{ enforceForDeclarationWithTypeAnnotation: true }`: + + + + +```ts option='{ "object": true }, { "enforceForDeclarationWithTypeAnnotation": true }' +const x: string = obj.x; +``` + + + + +```ts option='{ "object": true }, { "enforceForDeclarationWithTypeAnnotation": true }' +const { x }: { x: string } = obj; +``` + + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.mdx new file mode 100644 index 0000000..1c208ed --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.mdx @@ -0,0 +1,68 @@ +--- +description: 'Require each enum member value to be explicitly initialized.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-enum-initializers** for documentation. + +TypeScript `enum`s are a practical way to organize semantically related constant values. +Members of `enum`s that don't have explicit values are by default given sequentially increasing numbers. + +In projects where the value of `enum` members are important, allowing implicit values for enums can cause bugs if `enum`s are modified over time. + +This rule recommends having each `enum` member value explicitly initialized. + +## Examples + + + + +```ts +enum Status { + Open = 1, + Close, +} + +enum Direction { + Up, + Down, +} + +enum Color { + Red, + Green = 'Green', + Blue = 'Blue', +} +``` + + + + +```ts +enum Status { + Open = 'Open', + Close = 'Close', +} + +enum Direction { + Up = 1, + Down = 2, +} + +enum Color { + Red = 'Red', + Green = 'Green', + Blue = 'Blue', +} +``` + + + + +## When Not To Use It + +If you don't care about `enum`s having implicit values you can safely disable this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-find.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-find.mdx new file mode 100644 index 0000000..66089f5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-find.mdx @@ -0,0 +1,45 @@ +--- +description: 'Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-find** for documentation. + +When searching for the first item in an array matching a condition, it may be tempting to use code like `arr.filter(x => x > 0)[0]`. +However, it is simpler to use [Array.prototype.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) instead, `arr.find(x => x > 0)`, which also returns the first entry matching a condition. +Because the `.find()` only needs to execute the callback until it finds a match, it's also more efficient. + +:::info + +Beware the difference in short-circuiting behavior between the approaches. +`.find()` will only execute the callback on array elements until it finds a match, whereas `.filter()` executes the callback for all array elements. +Therefore, when fixing errors from this rule, be sure that your `.filter()` callbacks do not have side effects. + +::: + + + + +```ts +[1, 2, 3].filter(x => x > 1)[0]; + +[1, 2, 3].filter(x => x > 1).at(0); +``` + + + + +```ts +[1, 2, 3].find(x => x > 1); +``` + + + + +## When Not To Use It + +If you intentionally use patterns like `.filter(callback)[0]` to execute side effects in `callback` on all array elements, you will want to avoid this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.mdx new file mode 100644 index 0000000..0399c78 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.mdx @@ -0,0 +1,50 @@ +--- +description: 'Enforce the use of `for-of` loop over the standard `for` loop where possible.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-for-of** for documentation. + +Many developers default to writing `for (let i = 0; i < ...` loops to iterate over arrays. +However, in many of those arrays, the loop iterator variable (e.g. `i`) is only used to access the respective element of the array. +In those cases, a `for-of` loop is easier to read and write. + +This rule recommends a for-of loop when the loop index is only used to read from an array that is being iterated. + +## Examples + + + + +```ts +declare const array: string[]; + +for (let i = 0; i < array.length; i++) { + console.log(array[i]); +} +``` + + + + +```ts +declare const array: string[]; + +for (const x of array) { + console.log(x); +} + +for (let i = 0; i < array.length; i++) { + // i is used, so for-of could not be used. + console.log(i, array[i]); +} +``` + + + + +{/* Intentionally Omitted: When Not To Use It */} diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.mdx new file mode 100644 index 0000000..e6a6988 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.mdx @@ -0,0 +1,98 @@ +--- +description: 'Enforce using function types instead of interfaces with call signatures.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-function-type** for documentation. + +TypeScript allows for two common ways to declare a type for a function: + +- Function type: `() => string` +- Object type with a signature: `{ (): string }` + +The function type form is generally preferred when possible for being more succinct. + +This rule suggests using a function type instead of an interface or object type literal with a single call signature. + +## Examples + + + + +```ts +interface Example { + (): string; +} +``` + +```ts +function foo(example: { (): number }): number { + return example(); +} +``` + +```ts +interface ReturnsSelf { + // returns the function itself, not the `this` argument. + (arg: string): this; +} +``` + + + + +```ts +type Example = () => string; +``` + +```ts +function foo(example: () => number): number { + return bar(); +} +``` + +```ts +// returns the function itself, not the `this` argument. +type ReturnsSelf = (arg: string) => ReturnsSelf; +``` + +```ts +function foo(bar: { (): string; baz: number }): string { + return bar(); +} +``` + +```ts +interface Foo { + bar: string; +} +interface Bar extends Foo { + (): void; +} +``` + +```ts +// multiple call signatures (overloads) is allowed: +interface Overloaded { + (data: string): number; + (id: number): string; +} +// this is equivelent to Overloaded interface. +type Intersection = ((data: string) => number) & ((id: number) => string); +``` + + + + +## When Not To Use It + +If you specifically want to use an interface or type literal with a single call signature for stylistic reasons, you can avoid this rule. + +This rule has a known edge case of sometimes triggering on global augmentations such as `interface Function`. +These edge cases are rare and often symptomatic of odd code. +We recommend you use an [inline ESLint disable comment](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1). +See [#454](https://github.com/typescript-eslint/typescript-eslint/issues/454) for details. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.mdx new file mode 100644 index 0000000..eb79a92 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.mdx @@ -0,0 +1,81 @@ +--- +description: 'Enforce `includes` method over `indexOf` method.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-includes** for documentation. + +Prior to ES2015, `Array#indexOf` and `String#indexOf` comparisons against `-1` were the standard ways to check whether a value exists in an array or string, respectively. +Alternatives that are easier to read and write now exist: ES2015 added `String#includes` and ES2016 added `Array#includes`. + +This rule reports when an `.indexOf` call can be replaced with an `.includes`. +Additionally, this rule reports the tests of simple regular expressions in favor of `String#includes`. + +> This rule will report on any receiver object of an `indexOf` method call that has an `includes` method where the two methods have the same parameters. +> Matching types include: `String`, `Array`, `ReadonlyArray`, and typed arrays. + +## Examples + + + + +```ts +const str: string; +const array: any[]; +const readonlyArray: ReadonlyArray; +const typedArray: UInt8Array; +const maybe: string; +const userDefined: { + indexOf(x: any): number; + includes(x: any): boolean; +}; + +str.indexOf(value) !== -1; +array.indexOf(value) !== -1; +readonlyArray.indexOf(value) === -1; +typedArray.indexOf(value) > -1; +maybe?.indexOf('') !== -1; +userDefined.indexOf(value) >= 0; + +/example/.test(str); +``` + + + + +```ts +const str: string; +const array: any[]; +const readonlyArray: ReadonlyArray; +const typedArray: UInt8Array; +const maybe: string; +const userDefined: { + indexOf(x: any): number; + includes(x: any): boolean; +}; + +str.includes(value); +array.includes(value); +!readonlyArray.includes(value); +typedArray.includes(value); +maybe?.includes(''); +userDefined.includes(value); + +str.includes('example'); + +// The two methods have different parameters. +declare const mismatchExample: { + indexOf(x: unknown, fromIndex?: number): number; + includes(x: unknown): boolean; +}; +mismatchExample.indexOf(value) >= 0; +``` + + + + +{/* Intentionally Omitted: When Not To Use It */} diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.mdx new file mode 100644 index 0000000..9d2e2ff --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.mdx @@ -0,0 +1,111 @@ +--- +description: 'Require all enum members to be literal values.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-literal-enum-member** for documentation. + +TypeScript allows the value of an enum member to be many different kinds of valid JavaScript expressions. +However, because enums create their own scope whereby each enum member becomes a variable in that scope, developers are often surprised at the resultant values. +For example: + +```ts +const imOutside = 2; +const b = 2; +enum Foo { + outer = imOutside, + a = 1, + b = a, + c = b, + // does c == Foo.b == Foo.c == 1? + // or does c == b == 2? +} +``` + +> The answer is that `Foo.c` will be `1` at runtime [[TypeScript playground](https://www.typescriptlang.org/play/#src=const%20imOutside%20%3D%202%3B%0D%0Aconst%20b%20%3D%202%3B%0D%0Aenum%20Foo%20%7B%0D%0A%20%20%20%20outer%20%3D%20imOutside%2C%0D%0A%20%20%20%20a%20%3D%201%2C%0D%0A%20%20%20%20b%20%3D%20a%2C%0D%0A%20%20%20%20c%20%3D%20b%2C%0D%0A%20%20%20%20%2F%2F%20does%20c%20%3D%3D%20Foo.b%20%3D%3D%20Foo.c%20%3D%3D%201%3F%0D%0A%20%20%20%20%2F%2F%20or%20does%20c%20%3D%3D%20b%20%3D%3D%202%3F%0D%0A%7D)]. + +Therefore, it's often better to prevent unexpected results in code by requiring the use of literal values as enum members. +This rule reports when an enum member is given a value that is not a literal. + +## Examples + + + + +```ts +const str = 'Test'; +const string1 = 'string1'; +const string2 = 'string2'; + +enum Invalid { + A = str, // Variable assignment + B = `Interpolates ${string1} and ${string2}`, // Template literal with interpolation + C = 2 + 2, // Expression assignment + D = C, // Assignment to another enum member +} +``` + + + + +```ts +enum Valid { + A, // No initializer; initialized with ascending integers starting from 0 + B = 'TestStr', // A regular string + C = `A template literal string`, // A template literal without interpolation + D = 4, // A number +} +``` + + + + +## Options + +### `allowBitwiseExpressions` + +{/* insert option description */} + +Examples of code for the `{ "allowBitwiseExpressions": true }` option: + + + + +```ts option='{ "allowBitwiseExpressions": true }' +const x = 1; +enum Foo { + A = x << 0, + B = x >> 0, + C = x >>> 0, + D = x | 0, + E = x & 0, + F = x ^ 0, + G = ~x, +} +``` + + + + +```ts option='{ "allowBitwiseExpressions": true }' +enum Foo { + A = 1 << 0, + B = 1 >> 0, + C = 1 >>> 0, + D = 1 | 0, + E = 1 & 0, + F = 1 ^ 0, + G = ~1, +} +``` + + + + +## When Not To Use It + +If you want use anything other than simple literals as an enum value, this rule might not be for you. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.mdx new file mode 100644 index 0000000..02dc462 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.mdx @@ -0,0 +1,51 @@ +--- +description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-namespace-keyword** for documentation. + +TypeScript historically allowed a form of code organization called "custom modules" (`module Example {}`), later renamed to "namespaces" (`namespace Example`). + +Namespaces are an outdated way to organize TypeScript code. +ES2015 module syntax is now preferred (`import`/`export`). + +For projects still using custom modules / namespaces, it's preferred to refer to them as namespaces. +This rule reports when the `module` keyword is used instead of `namespace`. + +> This rule does not report on the use of TypeScript module declarations to describe external APIs (`declare module 'foo' {}`). + +## Examples + + + + +```ts +module Example {} +``` + + + + +```ts +namespace Example {} + +declare module 'foo' {} +``` + + + + +## When Not To Use It + +If you are not using TypeScript's older `module`/`namespace` keywords, then you will not need this rule. + +## Further Reading + +- [Modules](https://www.typescriptlang.org/docs/handbook/modules.html) +- [Namespaces](https://www.typescriptlang.org/docs/handbook/namespaces.html) +- [Namespaces and Modules](https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx new file mode 100644 index 0000000..87cf885 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx @@ -0,0 +1,257 @@ +--- +description: 'Enforce using the nullish coalescing operator instead of logical assignments or chaining.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-nullish-coalescing** for documentation. + +The `??` nullish coalescing runtime operator allows providing a default value when dealing with `null` or `undefined`. +Because the nullish coalescing operator _only_ coalesces when the original value is `null` or `undefined`, it is much safer than relying upon logical OR operator chaining `||`, which coalesces on any _falsy_ value. + +This rule reports when you may consider replacing: + +- An `||` operator with `??` +- An `||=` operator with `??=` +- Ternary expressions (`?:`) that are equivalent to `||` or `??` with `??` + +:::caution +This rule will not work as expected if [`strictNullChecks`](https://www.typescriptlang.org/tsconfig#strictNullChecks) is not enabled. +::: + +## Options + +### `ignoreTernaryTests` + +{/* insert option description */} + +Examples of code for this rule with `{ ignoreTernaryTests: false }`: + + + + +```ts option='{ "ignoreTernaryTests": false }' +declare const a: any; +a !== undefined && a !== null ? a : 'a string'; +a === undefined || a === null ? 'a string' : a; +a == undefined ? 'a string' : a; +a == null ? 'a string' : a; + +declare const b: string | undefined; +b !== undefined ? b : 'a string'; +b === undefined ? 'a string' : b; +b ? b : 'a string'; +!b ? 'a string' : b; + +declare const c: string | null; +c !== null ? c : 'a string'; +c === null ? 'a string' : c; +c ? c : 'a string'; +!c ? 'a string' : c; +``` + + + + +```ts option='{ "ignoreTernaryTests": false }' +declare const a: any; +a ?? 'a string'; + +declare const b: string | undefined; +b ?? 'a string'; + +declare const c: string | null; +c ?? 'a string'; +``` + + + + +### `ignoreConditionalTests` + +{/* insert option description */} + +Generally expressions within conditional tests intentionally use the falsy fallthrough behavior of the logical or operator, meaning that fixing the operator to the nullish coalesce operator could cause bugs. + +If you're looking to enforce stricter conditional tests, you should consider using the `strict-boolean-expressions` rule. + +Examples of code for this rule with `{ ignoreConditionalTests: false }`: + + + + +```ts option='{ "ignoreConditionalTests": false }' +declare const a: string | null; +declare const b: string | null; + +if (a || b) { +} +if ((a ||= b)) { +} +while (a || b) {} +while ((a ||= b)) {} +do {} while (a || b); +for (let i = 0; a || b; i += 1) {} +a || b ? true : false; +``` + + + + +```ts option='{ "ignoreConditionalTests": false }' +declare const a: string | null; +declare const b: string | null; + +if (a ?? b) { +} +if ((a ??= b)) { +} +while (a ?? b) {} +while ((a ??= b)) {} +do {} while (a ?? b); +for (let i = 0; a ?? b; i += 1) {} +(a ?? b) ? true : false; +``` + + + + +### `ignoreMixedLogicalExpressions` + +{/* insert option description */} + +Generally expressions within mixed logical expressions intentionally use the falsy fallthrough behavior of the logical or operator, meaning that fixing the operator to the nullish coalesce operator could cause bugs. + +If you're looking to enforce stricter conditional tests, you should consider using the `strict-boolean-expressions` rule. + +Examples of code for this rule with `{ ignoreMixedLogicalExpressions: false }`: + + + + +```ts option='{ "ignoreMixedLogicalExpressions": false }' +declare const a: string | null; +declare const b: string | null; +declare const c: string | null; +declare const d: string | null; + +a || (b && c); +a ||= b && c; +(a && b) || c || d; +a || (b && c) || d; +a || (b && c && d); +``` + + + + +```ts option='{ "ignoreMixedLogicalExpressions": false }' +declare const a: string | null; +declare const b: string | null; +declare const c: string | null; +declare const d: string | null; + +a ?? (b && c); +a ??= b && c; +(a && b) ?? c ?? d; +a ?? (b && c) ?? d; +a ?? (b && c && d); +``` + + + + +**_NOTE:_** Errors for this specific case will be presented as suggestions (see below), instead of fixes. This is because it is not always safe to automatically convert `||` to `??` within a mixed logical expression, as we cannot tell the intended precedence of the operator. Note that by design, `??` requires parentheses when used with `&&` or `||` in the same expression. + +### `ignorePrimitives` + +{/* insert option description */} + +If you would like to ignore expressions containing operands of certain primitive types that can be falsy then you may pass an object containing a boolean value for each primitive: + +- `string: true`, ignores `null` or `undefined` unions with `string` (default: `false`). +- `number: true`, ignores `null` or `undefined` unions with `number` (default: `false`). +- `bigint: true`, ignores `null` or `undefined` unions with `bigint` (default: `false`). +- `boolean: true`, ignores `null` or `undefined` unions with `boolean` (default: `false`). + +Examples of code for this rule with `{ ignorePrimitives: { string: false } }`: + + + + +```ts option='{ "ignorePrimitives": { "string": false } }' +declare const foo: string | undefined; + +foo || 'a string'; +``` + + + + +```ts option='{ "ignorePrimitives": { "string": false } }' +declare const foo: string | undefined; + +foo ?? 'a string'; +``` + + + + +Also, if you would like to ignore all primitives types, you can set `ignorePrimitives: true`. It is equivalent to `ignorePrimitives: { string: true, number: true, bigint: true, boolean: true }`. + +### `ignoreBooleanCoercion` + +{/* insert option description */} + +Examples of code for this rule with `{ ignoreBooleanCoercion: false }`: + + + + +```ts option='{ "ignoreBooleanCoercion": false }' +declare const a: string | true | undefined; +declare const b: string | boolean | undefined; + +const x = Boolean(a || b); +``` + + + + +```ts option='{ "ignoreBooleanCoercion": false }' +declare const a: string | true | undefined; +declare const b: string | boolean | undefined; + +const x = Boolean(a ?? b); +``` + + + + +### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing` + +:::danger Deprecated + +This option will be removed in the next major version of typescript-eslint. + +::: + +{/* insert option description */} + +Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule useless. + +You should be using `strictNullChecks` to ensure complete type-safety in your codebase. + +If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option. + +## When Not To Use It + +If you are not using TypeScript 3.7 (or greater), then you will not be able to use this rule, as the operator is not supported. + +## Further Reading + +- [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) +- [Nullish Coalescing Operator Proposal](https://github.com/tc39/proposal-nullish-coalescing/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.mdx new file mode 100644 index 0000000..777c800 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.mdx @@ -0,0 +1,304 @@ +--- +description: 'Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-optional-chain** for documentation. + +`?.` optional chain expressions provide `undefined` if an object is `null` or `undefined`. +Because the optional chain operator _only_ chains when the property value is `null` or `undefined`, it is much safer than relying upon logical AND operator chaining `&&`; which chains on any _truthy_ value. +It is also often less code to use `?.` optional chaining than `&&` truthiness checks. + +This rule reports on code where an `&&` operator can be safely replaced with `?.` optional chaining. + +## Examples + + + + +```ts +foo && foo.a && foo.a.b && foo.a.b.c; +foo && foo['a'] && foo['a'].b && foo['a'].b.c; +foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method(); + +// With empty objects +(((foo || {}).a || {}).b || {}).c; +(((foo || {})['a'] || {}).b || {}).c; + +// With negated `or`s +!foo || !foo.bar; +!foo || !foo[bar]; +!foo || !foo.bar || !foo.bar.baz || !foo.bar.baz(); + +// this rule also supports converting chained strict nullish checks: +foo && + foo.a != null && + foo.a.b !== null && + foo.a.b.c != undefined && + foo.a.b.c.d !== undefined && + foo.a.b.c.d.e; +``` + + + + +```ts +foo?.a?.b?.c; +foo?.['a']?.b?.c; +foo?.a?.b?.method?.(); + +foo?.a?.b?.c?.d?.e; + +!foo?.bar; +!foo?.[bar]; +!foo?.bar?.baz?.(); +``` + + + + +## Options + +In the context of the descriptions below a "loose boolean" operand is any operand that implicitly coerces the value to a boolean. +Specifically the argument of the not operator (`!loose`) or a bare value in a logical expression (`loose && looser`). + +### `allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing` + +{/* insert option description */} + +When this option is `true`, the rule will provide an auto-fixer for cases where the return type of the expression would change. For example for the expression `!foo || foo.bar` the return type of the expression is `true | T`, however for the equivalent optional chain `foo?.bar` the return type of the expression is `undefined | T`. Thus changing the code from a logical expression to an optional chain expression has altered the type of the expression. + +In some cases this distinction _may_ matter - which is why these fixers are considered unsafe - they may break the build! For example in the following code: + +```ts option='{ "allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing": true }' showPlaygroundButton +declare const foo: { bar: boolean } | null | undefined; +declare function acceptsBoolean(arg: boolean): void; + +// ✅ typechecks succesfully as the expression only returns `boolean` +acceptsBoolean(foo != null && foo.bar); + +// ❌ typechecks UNSUCCESSFULLY as the expression returns `boolean | undefined` +acceptsBoolean(foo?.bar); +``` + +This style of code isn't super common - which means having this option set to `true` _should_ be safe in most codebases. However we default it to `false` due to its unsafe nature. We have provided this option for convenience because it increases the autofix cases covered by the rule. If you set option to `true` the onus is entirely on you and your team to ensure that each fix is correct and safe and that it does not break the build. + +When this option is `false` unsafe cases will have suggestion fixers provided instead of auto-fixers - meaning you can manually apply the fix using your IDE tooling. + +### `checkAny` + +{/* insert option description */} + +Examples of code for this rule with `{ checkAny: true }`: + + + + +```ts option='{ "checkAny": true }' +declare const thing: any; + +thing && thing.toString(); +``` + + + + +```ts option='{ "checkAny": true }' +declare const thing: any; + +thing?.toString(); +``` + + + + +### `checkUnknown` + +{/* insert option description */} + +Examples of code for this rule with `{ checkUnknown: true }`: + + + + +```ts option='{ "checkUnknown": true }' +declare const thing: unknown; + +thing && thing.toString(); +``` + + + + +```ts option='{ "checkUnknown": true }' +declare const thing: unknown; + +thing?.toString(); +``` + + + + +### `checkString` + +{/* insert option description */} + +Examples of code for this rule with `{ checkString: true }`: + + + + +```ts option='{ "checkString": true }' +declare const thing: string; + +thing && thing.toString(); +``` + + + + +```ts option='{ "checkString": true }' +declare const thing: string; + +thing?.toString(); +``` + + + + +### `checkNumber` + +{/* insert option description */} + +Examples of code for this rule with `{ checkNumber: true }`: + + + + +```ts option='{ "checkNumber": true }' +declare const thing: number; + +thing && thing.toString(); +``` + + + + +```ts option='{ "checkNumber": true }' +declare const thing: number; + +thing?.toString(); +``` + + + + +### `checkBoolean` + +{/* insert option description */} + +:::note + +This rule intentionally ignores the following case: + +```ts +declare const x: false | { a: string }; +x && x.a; +!x || x.a; +``` + +The boolean expression narrows out the non-nullish falsy cases - so converting the chain to `x?.a` would introduce a type error. + +::: + +Examples of code for this rule with `{ checkBoolean: true }`: + + + + +```ts option='{ "checkBoolean": true }' +declare const thing: true; + +thing && thing.toString(); +``` + + + + +```ts option='{ "checkBoolean": true }' +declare const thing: true; + +thing?.toString(); +``` + + + + +### `checkBigInt` + +{/* insert option description */} + +Examples of code for this rule with `{ checkBigInt: true }`: + + + + +```ts option='{ "checkBigInt": true }' +declare const thing: bigint; + +thing && thing.toString(); +``` + + + + +```ts option='{ "checkBigInt": true }' +declare const thing: bigint; + +thing?.toString(); +``` + + + + +### `requireNullish` + +{/* insert option description */} + +Examples of code for this rule with `{ requireNullish: true }`: + + + + +```ts option='{ "requireNullish": true }' +declare const thing1: string | null; +thing1 && thing1.toString(); +``` + + + + +```ts option='{ "requireNullish": true }' +declare const thing1: string | null; +thing1?.toString(); + +declare const thing2: string; +thing2 && thing2.toString(); +``` + + + + +## When Not To Use It + +If your project is not accurately typed, such as if it's in the process of being converted to TypeScript or is susceptible to [trade-offs in control flow analysis](https://github.com/Microsoft/TypeScript/issues/9998), it may be difficult to enable this rule for particularly non-type-safe areas of code. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) +- [Optional Chaining Proposal](https://github.com/tc39/proposal-optional-chaining/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-promise-reject-errors.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-promise-reject-errors.mdx new file mode 100644 index 0000000..6b531a3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-promise-reject-errors.mdx @@ -0,0 +1,78 @@ +--- +description: 'Require using Error objects as Promise rejection reasons.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-promise-reject-errors** for documentation. + +It uses type information to enforce that `Promise`s are only rejected with `Error` objects. + +## Examples + + + + +```ts +Promise.reject('error'); + +const err = new Error(); +Promise.reject('an ' + err); + +new Promise((resolve, reject) => reject('error')); + +new Promise((resolve, reject) => { + const err = new Error(); + reject('an ' + err); +}); +``` + + + + +```ts +Promise.reject(new Error()); + +class CustomError extends Error { + // ... +} +Promise.reject(new CustomError()); + +new Promise((resolve, reject) => reject(new Error())); + +new Promise((resolve, reject) => { + class CustomError extends Error { + // ... + } + return reject(new CustomError()); +}); +``` + + + + +## Options + +This rule adds the following options: + +```ts +interface Options { + /** + * Whether to always allow throwing values typed as `any`. + */ + allowThrowingAny?: boolean; + + /** + * Whether to always allow throwing values typed as `unknown`. + */ + allowThrowingUnknown?: boolean; +} + +const defaultOptions: Options = { + allowThrowingAny: false, + allowThrowingUnknown: false, +}; +``` diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.mdx new file mode 100644 index 0000000..02b7dc9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.mdx @@ -0,0 +1,408 @@ +--- +description: 'Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-readonly-parameter-types** for documentation. + +Mutating function arguments can lead to confusing, hard to debug behavior. +Whilst it's easy to implicitly remember to not modify function arguments, explicitly typing arguments as readonly provides clear contract to consumers. +This contract makes it easier for a consumer to reason about if a function has side-effects. + +This rule allows you to enforce that function parameters resolve to readonly types. +A type is considered readonly if: + +- it is a primitive type (`string`, `number`, `boolean`, `symbol`, or an enum), +- it is a function signature type, +- it is a readonly array type whose element type is considered readonly. +- it is a readonly tuple type whose elements are all considered readonly. +- it is an object type whose properties are all marked as readonly, and whose values are all considered readonly. + +## Examples + + + + +```ts +function array1(arg: string[]) {} // array is not readonly +function array2(arg: readonly string[][]) {} // array element is not readonly +function array3(arg: [string, number]) {} // tuple is not readonly +function array4(arg: readonly [string[], number]) {} // tuple element is not readonly +// the above examples work the same if you use ReadonlyArray instead + +function object1(arg: { prop: string }) {} // property is not readonly +function object2(arg: { readonly prop: string; prop2: string }) {} // not all properties are readonly +function object3(arg: { readonly prop: { prop2: string } }) {} // nested property is not readonly +// the above examples work the same if you use Readonly instead + +interface CustomArrayType extends ReadonlyArray { + prop: string; // note: this property is mutable +} +function custom1(arg: CustomArrayType) {} + +interface CustomFunction { + (): void; + prop: string; // note: this property is mutable +} +function custom2(arg: CustomFunction) {} + +function union(arg: string[] | ReadonlyArray) {} // not all types are readonly + +// rule also checks function types +interface Foo { + (arg: string[]): void; +} +interface Foo { + new (arg: string[]): void; +} +const x = { foo(arg: string[]): void {} }; +function foo(arg: string[]); +type Foo = (arg: string[]) => void; +interface Foo { + foo(arg: string[]): void; +} +``` + + + + +```ts +function array1(arg: readonly string[]) {} +function array2(arg: readonly (readonly string[])[]) {} +function array3(arg: readonly [string, number]) {} +function array4(arg: readonly [readonly string[], number]) {} +// the above examples work the same if you use ReadonlyArray instead + +function object1(arg: { readonly prop: string }) {} +function object2(arg: { readonly prop: string; readonly prop2: string }) {} +function object3(arg: { readonly prop: { readonly prop2: string } }) {} +// the above examples work the same if you use Readonly instead + +interface CustomArrayType extends ReadonlyArray { + readonly prop: string; +} +function custom1(arg: Readonly) {} +// interfaces that extend the array types are not considered arrays, and thus must be made readonly. + +interface CustomFunction { + (): void; + readonly prop: string; +} +function custom2(arg: CustomFunction) {} + +function union(arg: readonly string[] | ReadonlyArray) {} + +function primitive1(arg: string) {} +function primitive2(arg: number) {} +function primitive3(arg: boolean) {} +function primitive4(arg: unknown) {} +function primitive5(arg: null) {} +function primitive6(arg: undefined) {} +function primitive7(arg: any) {} +function primitive8(arg: never) {} +function primitive9(arg: string | number | undefined) {} + +function fnSig(arg: () => void) {} + +enum Foo { + a, + b, +} +function enumArg(arg: Foo) {} + +function symb1(arg: symbol) {} +const customSymbol = Symbol('a'); +function symb2(arg: typeof customSymbol) {} + +// function types +interface Foo { + (arg: readonly string[]): void; +} +interface Foo { + new (arg: readonly string[]): void; +} +const x = { foo(arg: readonly string[]): void {} }; +function foo(arg: readonly string[]); +type Foo = (arg: readonly string[]) => void; +interface Foo { + foo(arg: readonly string[]): void; +} +``` + + + + +## Options + +### `allow` + +{/* insert option description */} + +Some complex types cannot easily be made readonly, for example the `HTMLElement` type or the `JQueryStatic` type from `@types/jquery`. This option allows you to globally disable reporting of such types. + +This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier). + +Examples of code for this rule with: + +```json +{ + "allow": [ + { "from": "file", "name": "Foo" }, + { "from": "lib", "name": "HTMLElement" }, + { "from": "package", "name": "Bar", "package": "bar-lib" } + ] +} +``` + + + + +```ts option='{"allow":[{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}' +interface ThisIsMutable { + prop: string; +} + +interface Wrapper { + sub: ThisIsMutable; +} + +interface WrapperWithOther { + readonly sub: Foo; + otherProp: string; +} + +// Incorrect because ThisIsMutable is not readonly +function fn1(arg: ThisIsMutable) {} + +// Incorrect because Wrapper.sub is not readonly +function fn2(arg: Wrapper) {} + +// Incorrect because WrapperWithOther.otherProp is not readonly and not in the allowlist +function fn3(arg: WrapperWithOther) {} +``` + +```ts option='{"allow":[{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}' +import { Foo } from 'some-lib'; +import { Bar } from 'incorrect-lib'; + +interface HTMLElement { + prop: string; +} + +// Incorrect because Foo is not a local type +function fn1(arg: Foo) {} + +// Incorrect because HTMLElement is not from the default library +function fn2(arg: HTMLElement) {} + +// Incorrect because Bar is not from "bar-lib" +function fn3(arg: Bar) {} +``` + + + + +```ts option='{"allow":[{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}' +interface Foo { + prop: string; +} + +interface Wrapper { + readonly sub: Foo; + readonly otherProp: string; +} + +// Works because Foo is allowed +function fn1(arg: Foo) {} + +// Works even when Foo is nested somewhere in the type, with other properties still being checked +function fn2(arg: Wrapper) {} +``` + +```ts option='{"allow":[{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}' +import { Bar } from 'bar-lib'; + +interface Foo { + prop: string; +} + +// Works because Foo is a local type +function fn1(arg: Foo) {} + +// Works because HTMLElement is from the default library +function fn2(arg: HTMLElement) {} + +// Works because Bar is from "bar-lib" +function fn3(arg: Bar) {} +``` + +```ts option='{"allow":[{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}' +import { Foo } from './foo'; + +// Works because Foo is still a local type - it has to be in the same package +function fn(arg: Foo) {} +``` + + + + +### `checkParameterProperties` + +{/* insert option description */} + +Because parameter properties create properties on the class, it may be undesirable to force them to be readonly. + +Examples of code for this rule with `{checkParameterProperties: true}`: + + + + +```ts option='{ "checkParameterProperties": true }' +class Foo { + constructor(private paramProp: string[]) {} +} +``` + + + + +```ts option='{ "checkParameterProperties": true }' +class Foo { + constructor(private paramProp: readonly string[]) {} +} +``` + + + + +Examples of **correct** code for this rule with `{checkParameterProperties: false}`: + +```ts option='{ "checkParameterProperties": false }' showPlaygroundButton +class Foo { + constructor( + private paramProp1: string[], + private paramProp2: readonly string[], + ) {} +} +``` + +### `ignoreInferredTypes` + +{/* insert option description */} + +This may be desirable in cases where an external dependency specifies a callback with mutable parameters, and manually annotating the callback's parameters is undesirable. + +Examples of code for this rule with `{ignoreInferredTypes: true}`: + + + + +```ts option='{ "ignoreInferredTypes": true }' skipValidation +import { acceptsCallback, CallbackOptions } from 'external-dependency'; + +acceptsCallback((options: CallbackOptions) => {}); +``` + +
+external-dependency.d.ts + +```ts option='{ "ignoreInferredTypes": true }' +export interface CallbackOptions { + prop: string; +} +type Callback = (options: CallbackOptions) => void; +type AcceptsCallback = (callback: Callback) => void; + +export const acceptsCallback: AcceptsCallback; +``` + +
+ +
+ + +```ts option='{ "ignoreInferredTypes": true }' +import { acceptsCallback } from 'external-dependency'; + +acceptsCallback(options => {}); +``` + +
+external-dependency.d.ts + +```ts option='{ "ignoreInferredTypes": true }' skipValidation +export interface CallbackOptions { + prop: string; +} +type Callback = (options: CallbackOptions) => void; +type AcceptsCallback = (callback: Callback) => void; + +export const acceptsCallback: AcceptsCallback; +``` + +
+ +
+
+ +### `treatMethodsAsReadonly` + +{/* insert option description */} + +This may be desirable when you are never reassigning methods. + +Examples of code for this rule with `{treatMethodsAsReadonly: false}`: + + + + +```ts option='{ "treatMethodsAsReadonly": false }' +type MyType = { + readonly prop: string; + method(): string; // note: this method is mutable +}; +function foo(arg: MyType) {} +``` + + + + +```ts option='{ "treatMethodsAsReadonly": false }' +type MyType = Readonly<{ + prop: string; + method(): string; +}>; +function foo(arg: MyType) {} + +type MyOtherType = { + readonly prop: string; + readonly method: () => string; +}; +function bar(arg: MyOtherType) {} +``` + + + + +Examples of **correct** code for this rule with `{treatMethodsAsReadonly: true}`: + +```ts option='{ "treatMethodsAsReadonly": true }' showPlaygroundButton +type MyType = { + readonly prop: string; + method(): string; // note: this method is mutable +}; +function foo(arg: MyType) {} +``` + +## When Not To Use It + +If your project does not attempt to enforce strong immutability guarantees of parameters, you can avoid this rule. + +This rule is very strict on what it considers mutable. +Many types that describe themselves as readonly are considered mutable because they have mutable properties such as arrays or tuples. +To work around these limitations, you might need to use the rule's options. +In particular, the [`allow` option](#allow) can explicitly mark a type as readonly. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.mdx new file mode 100644 index 0000000..c711102 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.mdx @@ -0,0 +1,111 @@ +--- +description: "Require private members to be marked as `readonly` if they're never modified outside of the constructor." +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-readonly** for documentation. + +Private member variables (whether using the `private` modifier or private `#` fields) are never permitted to be modified outside of their declaring class. +If that class never modifies their value, they may safely be marked as `readonly`. + +This rule reports on private members are marked as `readonly` if they're never modified outside of the constructor. + +## Examples + + + + +```ts +class Container { + // These member variables could be marked as readonly + private neverModifiedMember = true; + private onlyModifiedInConstructor: number; + #neverModifiedPrivateField = 3; + + public constructor( + onlyModifiedInConstructor: number, + // Private parameter properties can also be marked as readonly + private neverModifiedParameter: string, + ) { + this.onlyModifiedInConstructor = onlyModifiedInConstructor; + } +} +``` + + + + +```ts +class Container { + // Public members might be modified externally + public publicMember: boolean; + + // Protected members might be modified by child classes + protected protectedMember: number; + + // This is modified later on by the class + private modifiedLater = 'unchanged'; + + public mutate() { + this.modifiedLater = 'mutated'; + } + + // This is modified later on by the class + #modifiedLaterPrivateField = 'unchanged'; + + public mutatePrivateField() { + this.#modifiedLaterPrivateField = 'mutated'; + } +} +``` + + + + +## Options + +### `onlyInlineLambdas` + +{/* insert option description */} + +```jsonc +{ + "@typescript-eslint/prefer-readonly": [ + "error", + { "onlyInlineLambdas": true }, + ], +} +``` + +Example of code for the `{ "onlyInlineLambdas": true }` options: + + + + +```ts option='{ "onlyInlineLambdas": true }' +class Container { + private onClick = () => { + /* ... */ + }; +} +``` + + + + +```ts option='{ "onlyInlineLambdas": true }' +class Container { + private neverModifiedPrivate = 'unchanged'; +} +``` + + + + +## When Not To Use It + +If you aren't trying to enforce strong immutability guarantees, this rule may be too restrictive for your project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.mdx new file mode 100644 index 0000000..999e0e3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.mdx @@ -0,0 +1,66 @@ +--- +description: 'Enforce using type parameter when calling `Array#reduce` instead of using a type assertion.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-reduce-type-parameter** for documentation. + +It's common to call `Array#reduce` with a generic type, such as an array or object, as the initial value. +Since these values are empty, their types are not usable: + +- `[]` has type `never[]`, which can't have items pushed into it as nothing is type `never` +- `{}` has type `{}`, which doesn't have an index signature and so can't have properties added to it + +A common solution to this problem is to use an `as` assertion on the initial value. +While this will work, it's not the most optimal solution as type assertions have subtle effects on the underlying types that can allow bugs to slip in. + +A better solution is to pass the type in as a generic type argument to `Array#reduce` explicitly. +This means that TypeScript doesn't have to try to infer the type, and avoids the common pitfalls that come with assertions. + +This rule looks for calls to `Array#reduce`, and reports if an initial value is being passed & asserted. +It will suggest instead pass the asserted type to `Array#reduce` as a generic type argument. + +## Examples + + + + +```ts +[1, 2, 3].reduce((arr, num) => arr.concat(num * 2), [] as number[]); + +['a', 'b'].reduce( + (accum, name) => ({ + ...accum, + [name]: true, + }), + {} as Record, +); +``` + + + + +```ts +[1, 2, 3].reduce((arr, num) => arr.concat(num * 2), []); + +['a', 'b'].reduce>( + (accum, name) => ({ + ...accum, + [name]: true, + }), + {}, +); +``` + + + + +## When Not To Use It + +This rule can sometimes be difficult to work around when creating objects using a `.reduce`. +See [[prefer-reduce-type-parameter] unfixable reporting #3440](https://github.com/typescript-eslint/typescript-eslint/issues/3440) for more details. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.mdx new file mode 100644 index 0000000..1536638 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.mdx @@ -0,0 +1,52 @@ +--- +description: 'Enforce `RegExp#exec` over `String#match` if no global flag is provided.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-regexp-exec** for documentation. + +`String#match` is defined to work the same as `RegExp#exec` when the regular expression does not include the `g` flag. +Keeping to consistently using one of the two can help improve code readability. + +This rule reports when a `String#match` call can be replaced with an equivalent `RegExp#exec`. + +> `RegExp#exec` may also be slightly faster than `String#match`; this is the reason to choose it as the preferred usage. + +## Examples + + + + +```ts +'something'.match(/thing/); + +'some things are just things'.match(/thing/); + +const text = 'something'; +const search = /thing/; +text.match(search); +``` + + + + +```ts +/thing/.exec('something'); + +'some things are just things'.match(/thing/g); + +const text = 'something'; +const search = /thing/; +search.exec(text); +``` + + + + +## When Not To Use It + +If you prefer consistent use of `String#match` for both with `g` flag and without it, you can turn this rule off. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.mdx new file mode 100644 index 0000000..1c45bf8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.mdx @@ -0,0 +1,93 @@ +--- +description: 'Enforce that `this` is used when only `this` type is returned.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-return-this-type** for documentation. + +[Method chaining](https://en.wikipedia.org/wiki/Method_chaining) is a common pattern in OOP languages and TypeScript provides a special [polymorphic `this` type](https://www.typescriptlang.org/docs/handbook/2/classes.html#this-types) to facilitate it. +Class methods that explicitly declare a return type of the class name instead of `this` make it harder for extending classes to call that method: the returned object will be typed as the base class, not the derived class. + +This rule reports when a class method declares a return type of that class name instead of `this`. + +```ts +class Animal { + eat(): Animal { + // ~~~~~~ + // Either removing this type annotation or replacing + // it with `this` would remove the type error below. + console.log("I'm moving!"); + return this; + } +} + +class Cat extends Animal { + meow(): Cat { + console.log('Meow~'); + return this; + } +} + +const cat = new Cat(); +cat.eat().meow(); +// ~~~~ +// Error: Property 'meow' does not exist on type 'Animal'. +// because `eat` returns `Animal` and not all animals meow. +``` + +## Examples + + + + +```ts +class Foo { + f1(): Foo { + return this; + } + f2 = (): Foo => { + return this; + }; + f3(): Foo | undefined { + return Math.random() > 0.5 ? this : undefined; + } +} +``` + + + + +```ts +class Foo { + f1(): this { + return this; + } + f2() { + return this; + } + f3 = (): this => { + return this; + }; + f4 = () => { + return this; + }; +} + +class Base {} +class Derived extends Base { + f(): Base { + return this; + } +} +``` + + + + +## When Not To Use It + +If you don't use method chaining or explicit return values, you can safely turn this rule off. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.mdx new file mode 100644 index 0000000..cc0860b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.mdx @@ -0,0 +1,84 @@ +--- +description: 'Enforce using `String#startsWith` and `String#endsWith` over other equivalent methods of checking substrings.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-string-starts-ends-with** for documentation. + +There are multiple ways to verify if a string starts or ends with a specific string, such as `foo.indexOf('bar') === 0`. +As of ES2015, the most common way in JavaScript is to use `String#startsWith` and `String#endsWith`. +Keeping to those methods consistently helps with code readability. + +This rule reports when a string method can be replaced safely with `String#startsWith` or `String#endsWith`. + +## Examples + + + + +```ts +declare const foo: string; + +// starts with +foo[0] === 'b'; +foo.charAt(0) === 'b'; +foo.indexOf('bar') === 0; +foo.slice(0, 3) === 'bar'; +foo.substring(0, 3) === 'bar'; +foo.match(/^bar/) != null; +/^bar/.test(foo); + +// ends with +foo[foo.length - 1] === 'b'; +foo.charAt(foo.length - 1) === 'b'; +foo.lastIndexOf('bar') === foo.length - 3; +foo.slice(-3) === 'bar'; +foo.substring(foo.length - 3) === 'bar'; +foo.match(/bar$/) != null; +/bar$/.test(foo); +``` + + + + +```ts +declare const foo: string; + +// starts with +foo.startsWith('bar'); + +// ends with +foo.endsWith('bar'); +``` + + + + +## Options + +### `allowSingleElementEquality` + +{/* insert option description */} + +If switched to `'always'`, the rule will allow equality checks against the first or last character in a string. +This can be preferable in projects that don't deal with special character encodings and prefer a more succinct style. + +The following code is considered incorrect by default, but is allowed with `allowSingleElementEquality: 'always'`: + +```ts option='{ "allowSingleElementEquality": "always" }' showPlaygroundButton +declare const text: string; + +text[0] === 'a'; +text[0] === text[0].toUpperCase(); +text[0] === text[1]; +text[text.length - 1] === 'b'; +``` + +## When Not To Use It + +If you don't mind which style of string checking is used, you can turn this rule off safely. +However, keep in mind that inconsistent style can harm readability in a project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.mdx new file mode 100644 index 0000000..1d0614f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.mdx @@ -0,0 +1,86 @@ +--- +description: 'Enforce using `@ts-expect-error` over `@ts-ignore`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/prefer-ts-expect-error** for documentation. + +:::danger Deprecated + +This rule has been deprecated in favor of [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.mdx). +This rule (`@typescript-eslint/prefer-ts-expect-error`) will be removed in a future major version of typescript-eslint. + +When it was first created, `@typescript-eslint/ban-ts-comment` rule was only responsible for suggesting to remove `@ts-ignore` directive. +It was later updated to suggest replacing `@ts-ignore` with `@ts-expect-error` directive, so that it replaces `@typescript-eslint/prefer-ts-expect-error` entirely. + +::: + +TypeScript allows you to suppress all errors on a line by placing a comment starting with `@ts-ignore` or `@ts-expect-error` immediately before the erroring line. +The two directives work the same, except `@ts-expect-error` causes a type error if placed before a line that's not erroring in the first place. + +This means it's easy for `@ts-ignore`s to be forgotten about, and remain in code even after the error they were suppressing is fixed. +This is dangerous, as if a new error arises on that line it'll be suppressed by the forgotten about `@ts-ignore`, and so be missed. + +## Examples + +This rule reports any usage of `@ts-ignore`, including a fixer to replace with `@ts-expect-error`. + + + + +```ts +// @ts-ignore +const str: string = 1; + +/** + * Explaining comment + * + * @ts-ignore */ +const multiLine: number = 'value'; + +/** @ts-ignore */ +const block: string = 1; + +const isOptionEnabled = (key: string): boolean => { + // @ts-ignore: if key isn't in globalOptions it'll be undefined which is false + return !!globalOptions[key]; +}; +``` + + + + +```ts +// @ts-expect-error +const str: string = 1; + +/** + * Explaining comment + * + * @ts-expect-error */ +const multiLine: number = 'value'; + +/** @ts-expect-error */ +const block: string = 1; + +const isOptionEnabled = (key: string): boolean => { + // @ts-expect-error: if key isn't in globalOptions it'll be undefined which is false + return !!globalOptions[key]; +}; +``` + + + + +## When Not To Use It + +If you are compiling against multiple versions of TypeScript and using `@ts-ignore` to ignore version-specific type errors, this rule might get in your way. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [Original Implementing PR](https://github.com/microsoft/TypeScript/pull/36014) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.mdx new file mode 100644 index 0000000..f13da18 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.mdx @@ -0,0 +1,143 @@ +--- +description: 'Require any function or method that returns a Promise to be marked async.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/promise-function-async** for documentation. + +Ensures that each function is only capable of: + +- returning a rejected promise, or +- throwing an Error object. + +In contrast, non-`async`, `Promise`-returning functions are technically capable of either. +Code that handles the results of those functions will often need to handle both cases, which can get complex. +This rule's practice removes a requirement for creating code to handle both cases. + +> When functions return unions of `Promise` and non-`Promise` types implicitly, it is usually a mistake—this rule flags those cases. If it is intentional, make the return type explicitly to allow the rule to pass. + +## Examples + +Examples of code for this rule + + + + +```ts +const arrowFunctionReturnsPromise = () => Promise.resolve('value'); + +function functionReturnsPromise() { + return Promise.resolve('value'); +} + +function functionReturnsUnionWithPromiseImplicitly(p: boolean) { + return p ? 'value' : Promise.resolve('value'); +} +``` + + + + +```ts +const arrowFunctionReturnsPromise = async () => Promise.resolve('value'); + +async function functionReturnsPromise() { + return Promise.resolve('value'); +} + +// An explicit return type that is not Promise means this function cannot be made async, so it is ignored by the rule +function functionReturnsUnionWithPromiseExplicitly( + p: boolean, +): string | Promise { + return p ? 'value' : Promise.resolve('value'); +} + +async function functionReturnsUnionWithPromiseImplicitly(p: boolean) { + return p ? 'value' : Promise.resolve('value'); +} +``` + + + + +## Options + +### `allowAny` + +{/* insert option description */} + +If you want additional safety, consider turning this option off, as it makes the rule less able to catch incorrect Promise behaviors. + +Examples of code with `{ "allowAny": false }`: + + + + +```ts option='{ "allowAny": false }' +const returnsAny = () => ({}) as any; +``` + + + + +```ts option='{ "allowAny": false }' +const returnsAny = async () => ({}) as any; +``` + + + + +### `allowedPromiseNames` + +{/* insert option description */} + +For projects that use constructs other than the global built-in `Promise` for asynchronous code. +This option allows specifying string names of classes or interfaces that cause a function to be checked as well. + +Examples of code with `{ "allowedPromiseNames": ["Bluebird"] }`: + + + + +```ts option='{ "allowedPromiseNames": ["Bluebird"] }' +class Bluebird {} + +const returnsBluebird = () => new Bluebird(() => {}); +``` + + + + +```ts option='{ "allowedPromiseNames": ["Bluebird"] }' +class Bluebird {} + +const returnsBluebird = async () => new Bluebird(() => {}); +``` + + + + +### `checkArrowFunctions` + +{/* insert option description */} + +### `checkFunctionDeclarations` + +{/* insert option description */} + +### `checkFunctionExpressions` + +{/* insert option description */} + +### `checkMethodDeclarations` + +{/* insert option description */} + +## When Not To Use It + +This rule can be difficult to enable on projects that use APIs which require functions to always be `async`. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) along with filing issues on your dependencies for those specific situations instead of completely disabling this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/related-getter-setter-pairs.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/related-getter-setter-pairs.mdx new file mode 100644 index 0000000..d709faf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/related-getter-setter-pairs.mdx @@ -0,0 +1,61 @@ +--- +description: 'Enforce that `get()` types should be assignable to their equivalent `set()` type.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/related-getter-setter-pairs** for documentation. + +TypeScript allows defining different types for a `get` parameter and its corresponding `set` return. +Prior to TypeScript 4.3, the types had to be identical. +From TypeScript 4.3 to 5.0, the `get` type had to be a subtype of the `set` type. +As of TypeScript 5.1, the types may be completely unrelated as long as there is an explicit type annotation. + +Defining drastically different types for a `get` and `set` pair can be confusing. +It means that assigning a property to itself would not work: + +```ts +// Assumes box.value's get() return is assignable to its set() parameter +box.value = box.value; +``` + +This rule reports cases where a `get()` and `set()` have the same name, but the `get()`'s type is not assignable to the `set()`'s. + +## Examples + + + + +```ts +interface Box { + get value(): string; + set value(newValue: number); +} +``` + + + + +```ts +interface Box { + get value(): string; + set value(newValue: string); +} +``` + + + + +## When Not To Use It + +If your project needs to model unusual relationships between data, such as older DOM types, this rule may not be useful for you. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## Further Reading + +- [MDN documentation on `get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) +- [MDN documentation on `set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set) +- [TypeScript 5.1 Release Notes > Unrelated Types for Getters and Setters](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-1.html#unrelated-types-for-getters-and-setters) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.mdx new file mode 100644 index 0000000..7ca4b94 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.mdx @@ -0,0 +1,89 @@ +--- +description: 'Require `Array#sort` and `Array#toSorted` calls to always provide a `compareFunction`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/require-array-sort-compare** for documentation. + +When called without a compare function, `Array#sort()` and `Array#toSorted()` converts all non-undefined array elements into strings and then compares said strings based off their UTF-16 code units [[ECMA specification](https://www.ecma-international.org/ecma-262/9.0/#sec-sortcompare)]. + +The result is that elements are sorted alphabetically, regardless of their type. +For example, when sorting numbers, this results in a "10 before 2" order: + +```ts +[1, 2, 3, 10, 20, 30].sort(); //→ [1, 10, 2, 20, 3, 30] +``` + +This rule reports on any call to the sort methods that do not provide a `compare` argument. + +## Examples + +This rule aims to ensure all calls of the native sort methods provide a `compareFunction`, while ignoring calls to user-defined methods. + + + + +```ts +const array: any[]; +const stringArray: string[]; + +array.sort(); + +// String arrays should be sorted using `String#localeCompare`. +stringArray.sort(); +``` + + + + +```ts +const array: any[]; +const userDefinedType: { sort(): void }; + +array.sort((a, b) => a - b); +array.sort((a, b) => a.localeCompare(b)); + +userDefinedType.sort(); +``` + + + + +## Options + +### `ignoreStringArrays` + +{/* insert option description */} + +Examples of code for this rule with `{ ignoreStringArrays: true }`: + + + + +```ts option='{ "ignoreStringArrays": true }' +const one = 1; +const two = 2; +const three = 3; +[one, two, three].sort(); +``` + + + + +```ts option='{ "ignoreStringArrays": true }' +const one = '1'; +const two = '2'; +const three = '3'; +[one, two, three].sort(); +``` + + + + +## When Not To Use It + +If you intentionally want your arrays to be always sorted in a string-like manner, you can turn this rule off safely. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.mdx new file mode 100644 index 0000000..6d55da0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.mdx @@ -0,0 +1,53 @@ +--- +description: 'Disallow async functions which do not return promises and have no `await` expression.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/require-await** for documentation. + +It uses type information to allow promise-returning functions to be marked as `async` without containing an `await` expression. + +:::note +`yield` expressions in [async generator functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function*) behave differently from sync generator functions (they unwrap promises), so the base rule never checks async generator functions. On the other hand, our rule uses type information and can detect async generator functions that both never use `await` and always yield non-promise values. +::: + +## Examples + + + + +```ts +async function returnNumber() { + return 1; +} + +async function* asyncGenerator() { + yield 1; +} + +const num = returnNumber(); +const callAsyncGenerator = () => asyncGenerator(); +``` + + + + +```ts +function returnNumber() { + return 1; +} + +function* syncGenerator() { + yield 1; +} + +const num = returnNumber(); +const callSyncGenerator = () => syncGenerator(); +``` + + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.mdx new file mode 100644 index 0000000..321af82 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.mdx @@ -0,0 +1,245 @@ +--- +description: 'Require both operands of addition to be the same type and be `bigint`, `number`, or `string`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/restrict-plus-operands** for documentation. + +TypeScript allows `+` adding together two values of any type(s). +However, adding values that are not the same type and/or are not the same primitive type is often a sign of programmer error. + +This rule reports when a `+` operation combines two values of different types, or a type that is not `bigint`, `number`, or `string`. + +## Examples + + + + +```ts +let foo = 1n + 1; +let fn = (a: string, b: never) => a + b; +``` + + + + +```ts +let foo = 1n + 1n; +let fn = (a: string, b: string) => a + b; +``` + + + + +## Options + +:::caution +We generally recommend against using these options, as they limit which varieties of incorrect `+` usage can be checked. +This in turn severely limits the validation that the rule can do to ensure that resulting strings and numbers are correct. + +Safer alternatives to using the `allow*` options include: + +- Using variadic forms of logging APIs to avoid needing to `+` values. + ```ts + // Remove this line + console.log('The result is ' + true); + // Add this line + console.log('The result is', true); + ``` +- Using `.toFixed()` to coerce numbers to well-formed string representations: + ```ts + const number = 1.123456789; + const result = 'The number is ' + number.toFixed(2); + // result === 'The number is 1.12' + ``` +- Calling `.toString()` on other types to mark explicit and intentional string coercion: + ```ts + const arg = '11'; + const regex = /[0-9]/; + const result = + 'The result of ' + + regex.toString() + + '.test("' + + arg + + '") is ' + + regex.test(arg).toString(); + // result === 'The result of /[0-9]/.test("11") is true' + ``` + +::: + +### `allowAny` + +{/* insert option description */} + +Examples of code for this rule with `{ allowAny: true }`: + + + + +```ts option='{ "allowAny": true }' +let fn = (a: number, b: []) => a + b; +let fn = (a: string, b: []) => a + b; +``` + + + + +```ts option='{ "allowAny": true }' +let fn = (a: number, b: any) => a + b; +let fn = (a: string, b: any) => a + b; +``` + + + + +### `allowBoolean` + +{/* insert option description */} + +Examples of code for this rule with `{ allowBoolean: true }`: + + + + +```ts option='{ "allowBoolean": true }' +let fn = (a: number, b: unknown) => a + b; +let fn = (a: string, b: unknown) => a + b; +``` + + + + +```ts option='{ "allowBoolean": true }' +let fn = (a: number, b: boolean) => a + b; +let fn = (a: string, b: boolean) => a + b; +``` + + + + +### `allowNullish` + +{/* insert option description */} + +Examples of code for this rule with `{ allowNullish: true }`: + + + + +```ts option='{ "allowNullish": true }' +let fn = (a: number, b: unknown) => a + b; +let fn = (a: number, b: never) => a + b; +let fn = (a: string, b: unknown) => a + b; +let fn = (a: string, b: never) => a + b; +``` + + + + +```ts option='{ "allowNullish": true }' +let fn = (a: number, b: undefined) => a + b; +let fn = (a: number, b: null) => a + b; +let fn = (a: string, b: undefined) => a + b; +let fn = (a: string, b: null) => a + b; +``` + + + + +### `allowNumberAndString` + +{/* insert option description */} + +Examples of code for this rule with `{ allowNumberAndString: true }`: + + + + +```ts option='{ "allowNumberAndString": true }' +let fn = (a: number, b: unknown) => a + b; +let fn = (a: number, b: never) => a + b; +``` + + + + +```ts option='{ "allowNumberAndString": true }' +let fn = (a: number, b: string) => a + b; +let fn = (a: number, b: number | string) => a + b; +let fn = (a: bigint, b: string) => a + b; +``` + + + + +### `allowRegExp` + +{/* insert option description */} + +Examples of code for this rule with `{ allowRegExp: true }`: + + + + +```ts option='{ "allowRegExp": true }' +let fn = (a: number, b: RegExp) => a + b; +``` + + + + +```ts option='{ "allowRegExp": true }' +let fn = (a: string, b: RegExp) => a + b; +``` + + + + +### `skipCompoundAssignments` + +{/* insert option description */} + +Examples of code for this rule with `{ skipCompoundAssignments: false }`: + + + + +```ts option='{ "skipCompoundAssignments": false }' +let foo: bigint = 0n; +foo += 1; + +let bar: number[] = [1]; +bar += 1; +``` + + + + +```ts option='{ "skipCompoundAssignments": false }' +let foo: bigint = 0n; +foo += 1n; + +let bar: number = 1; +bar += 1; +``` + + + + +## When Not To Use It + +If you don't mind a risk of `"[object Object]"` or incorrect type coercions in your values, then you will not need this rule. + +## Related To + +- [`no-base-to-string`](./no-base-to-string.mdx) +- [`restrict-template-expressions`](./restrict-template-expressions.mdx) + +## Further Reading + +- [`Object.prototype.toString()` MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.mdx new file mode 100644 index 0000000..75bee93 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.mdx @@ -0,0 +1,167 @@ +--- +description: 'Enforce template literal expressions to be of `string` type.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/restrict-template-expressions** for documentation. + +JavaScript automatically [converts an object to a string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) in a string context, such as when concatenating it with a string using `+` or embedding it in a template literal using `${}`. +The default `toString()` method of objects uses the format `"[object Object]"`, which is often not what was intended. +This rule reports on values used in a template literal string that aren't strings, optionally allowing other data types that provide useful stringification results. + +:::note + +The default settings of this rule intentionally do not allow objects with a custom `toString()` method to be used in template literals, because the stringification result may not be user-friendly. + +For example, arrays have a custom [`toString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) method, which only calls `join()` internally, which joins the array elements with commas. This means that (1) array elements are not necessarily stringified to useful results (2) the commas don't have spaces after them, making the result not user-friendly. The best way to format arrays is to use [`Intl.ListFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat), which even supports adding the "and" conjunction where necessary. +You must explicitly call `object.toString()` if you want to use this object in a template literal, or turn on the `allowArray` option to specifically allow arrays. +The [`no-base-to-string`](./no-base-to-string.mdx) rule can be used to guard this case against producing `"[object Object]"` by accident. + +::: + +## Examples + + + + +```ts +const arg1 = [1, 2]; +const msg1 = `arg1 = ${arg1}`; + +const arg2 = { name: 'Foo' }; +const msg2 = `arg2 = ${arg2 || null}`; +``` + + + + +```ts +const arg = 'foo'; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'default'}`; + +const stringWithKindProp: string & { _kind?: 'MyString' } = 'foo'; +const msg3 = `stringWithKindProp = ${stringWithKindProp}`; +``` + + + + +## Options + +### `allowNumber` + +{/* insert option description */} + +Examples of additional **correct** code for this rule with `{ allowNumber: true }`: + +```ts option='{ "allowNumber": true }' showPlaygroundButton +const arg = 123; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'zero'}`; +``` + +This option controls both numbers and BigInts. + +We recommend avoiding using this option if you use any floating point numbers. +Although `` `${1}` `` evaluates to `'1'`, `` `${0.1 + 0.2}` `` evaluates to `'0.30000000000000004'`. +Consider using [`.toFixed()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) or [`.toPrecision()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) instead. + +### `allowBoolean` + +{/* insert option description */} + +Examples of additional **correct** code for this rule with `{ allowBoolean: true }`: + +```ts option='{ "allowBoolean": true }' showPlaygroundButton +const arg = true; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'not truthy'}`; +``` + +### `allowAny` + +{/* insert option description */} + +Examples of additional **correct** code for this rule with `{ allowAny: true }`: + +```ts option='{ "allowAny": true }' showPlaygroundButton +const user = JSON.parse('{ "name": "foo" }'); +const msg1 = `arg = ${user.name}`; +const msg2 = `arg = ${user.name || 'the user with no name'}`; +``` + +### `allowNullish` + +{/* insert option description */} + +Examples of additional **correct** code for this rule with `{ allowNullish: true }`: + +```ts option='{ "allowNullish": true }' showPlaygroundButton +const arg = condition ? 'ok' : null; +const msg1 = `arg = ${arg}`; +``` + +### `allowRegExp` + +{/* insert option description */} + +Examples of additional **correct** code for this rule with `{ allowRegExp: true }`: + +```ts option='{ "allowRegExp": true }' showPlaygroundButton +const arg = new RegExp('foo'); +const msg1 = `arg = ${arg}`; +``` + +```ts option='{ "allowRegExp": true }' showPlaygroundButton +const arg = /foo/; +const msg1 = `arg = ${arg}`; +``` + +### `allowNever` + +{/* insert option description */} + +Examples of additional **correct** code for this rule with `{ allowNever: true }`: + +```ts option='{ "allowNever": true }' showPlaygroundButton +const arg = 'something'; +const msg1 = typeof arg === 'string' ? arg : `arg = ${arg}`; +``` + +### `allowArray` + +{/* insert option description */} + +Examples of additional **correct** code for this rule with `{ allowArray: true }`: + +```ts option='{ "allowArray": true }' showPlaygroundButton +const arg = ['foo', 'bar']; +const msg1 = `arg = ${arg}`; +``` + +### `allow` + +{/* insert option description */} + +This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier). + +Examples of additional **correct** code for this rule with the default option `{ allow: [{ from: 'lib', name: 'Error' }, { from: 'lib', name: 'URL' }, { from: 'lib', name: 'URLSearchParams' }] }`: + +```ts showPlaygroundButton +const error = new Error(); +const msg1 = `arg = ${error}`; +``` + +## When Not To Use It + +If you're not worried about incorrectly stringifying non-string values in template literals, then you likely don't need this rule. + +## Related To + +- [`no-base-to-string`](./no-base-to-string.mdx) +- [`restrict-plus-operands`](./restrict-plus-operands.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.mdx new file mode 100644 index 0000000..db4f2f5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.mdx @@ -0,0 +1,339 @@ +--- +description: 'Enforce consistent awaiting of returned promises.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/return-await** for documentation. + +In `async` functions, it is valid to return a promise-wrapped value or a value directly, both of which ultimately produce a promise with the same fulfillment value. Returning a value rather than a promise-wrapped value can have several subtle benefits: + +- Returning an awaited promise [improves stack trace information](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#improving_stack_trace). +- When the `return` statement is in `try...catch`, awaiting the promise allows the promise's rejection to be caught instead of leaving the error to the caller. +- Contrary to popular belief, `return await promise;` is [at least as fast as directly returning the promise](https://github.com/tc39/proposal-faster-promise-adoption). + +This rule enforces consistent handling of whether to await promises before returning them. + +:::info + +This rule used to be considered an extension of the (now-deprecated) ESLint core rule [`no-return-await`](https://eslint.org/docs/latest/rules/no-return-await#options). +Without type information, the only situations that could be flagged by `no-return-await` were of neutral-to-negative value, which eventually led to its deprecation. +In contrast, with access to type information, `@typescript-eslint/return-await` delivers enough positive value to earn it a spot in our strict preset. + +If you previously used `no-return-await`, this rule's `in-try-catch` option has the closest behavior to the `no-return-await` rule. + +::: + +## Options + +```ts +type Options = + | 'in-try-catch' + | 'always' + | 'error-handling-correctness-only' + | 'never'; + +const defaultOptions: Options = 'in-try-catch'; +``` + +The options in this rule distinguish between "ordinary contexts" and "error-handling contexts". +An error-handling context is anywhere where returning an unawaited promise would cause unexpected control flow regarding exceptions/rejections. +See detailed examples in the sections for each option. + +- If you return a promise within a `try` block, it should be awaited in order to trigger subsequent `catch` or `finally` blocks as expected. +- If you return a promise within a `catch` block, and there _is_ a `finally` block, it should be awaited in order to trigger the `finally` block as expected. +- If you return a promise between a `using` or `await using` declaration and the end of its scope, it should be awaited, since it behaves equivalently to code wrapped in a `try` block followed by a `finally`. + +Ordinary contexts are anywhere else a promise may be returned. +The choice of whether to await a returned promise in an ordinary context is mostly stylistic. + +With these terms defined, the options may be summarized as follows: + +| Option | Ordinary Context
(stylistic preference 🎨) | Error-Handling Context
(catches bugs 🐛) | Should I use this option? | +| :-------------------------------: | :----------------------------------------------: | :----------------------------------------------------------: | :--------------------------------------------------------: | +| `always` | `return await promise;` | `return await promise;` | ✅ Yes! | +| `in-try-catch` | `return promise;` | `return await promise;` | ✅ Yes! | +| `error-handling-correctness-only` | don't care 🤷 | `return await promise;` | 🟡 Okay to use, but the above options would be preferable. | +| `never` | `return promise;` | `return promise;`
(⚠️ This behavior may be harmful ⚠️) | ❌ No. This option is deprecated. | + +### `in-try-catch` + +In error-handling contexts, the rule enforces that returned promises must be awaited. +In ordinary contexts, the rule enforces that returned promises _must not_ be awaited. + +This is a good option if you prefer the shorter `return promise` form for stylistic reasons, wherever it's safe to use. + +Examples of code with `in-try-catch`: + + + + +```ts option='"in-try-catch"' +async function invalidInTryCatch1() { + try { + return Promise.reject('try'); + } catch (e) { + // Doesn't execute due to missing await. + } +} + +async function invalidInTryCatch2() { + try { + throw new Error('error'); + } catch (e) { + // Unnecessary await; rejections here don't impact control flow. + return await Promise.reject('catch'); + } +} + +// Prints 'starting async work', 'cleanup', 'async work done'. +async function invalidInTryCatch3() { + async function doAsyncWork(): Promise { + console.log('starting async work'); + await new Promise(resolve => setTimeout(resolve, 1000)); + console.log('async work done'); + } + + try { + throw new Error('error'); + } catch (e) { + // Missing await. + return doAsyncWork(); + } finally { + console.log('cleanup'); + } +} + +async function invalidInTryCatch4() { + try { + throw new Error('error'); + } catch (e) { + throw new Error('error2'); + } finally { + // Unnecessary await; rejections here don't impact control flow. + return await Promise.reject('finally'); + } +} + +async function invalidInTryCatch5() { + return await Promise.resolve('try'); +} + +async function invalidInTryCatch6() { + return await 'value'; +} + +async function invalidInTryCatch7() { + using x = createDisposable(); + return Promise.reject('using in scope'); +} +``` + + + + +```ts option='"in-try-catch"' +async function validInTryCatch1() { + try { + return await Promise.reject('try'); + } catch (e) { + // Executes as expected. + } +} + +async function validInTryCatch2() { + try { + throw new Error('error'); + } catch (e) { + return Promise.reject('catch'); + } +} + +// Prints 'starting async work', 'async work done', 'cleanup'. +async function validInTryCatch3() { + async function doAsyncWork(): Promise { + console.log('starting async work'); + await new Promise(resolve => setTimeout(resolve, 1000)); + console.log('async work done'); + } + + try { + throw new Error('error'); + } catch (e) { + return await doAsyncWork(); + } finally { + console.log('cleanup'); + } +} + +async function validInTryCatch4() { + try { + throw new Error('error'); + } catch (e) { + throw new Error('error2'); + } finally { + return Promise.reject('finally'); + } +} + +async function validInTryCatch5() { + return Promise.resolve('try'); +} + +async function validInTryCatch6() { + return 'value'; +} + +async function validInTryCatch7() { + using x = createDisposable(); + return await Promise.reject('using in scope'); +} +``` + + + + +### `always` + +{/* insert option description */} + +Requires that all returned promises be awaited. + +This is a good option if you like the consistency of simply always awaiting promises, or prefer not having to consider the distinction between error-handling contexts and ordinary contexts. + +Examples of code with `always`: + + + + +```ts option='"always"' +async function invalidAlways1() { + try { + return Promise.resolve('try'); + } catch (e) {} +} + +async function invalidAlways2() { + return Promise.resolve('try'); +} + +async function invalidAlways3() { + return await 'value'; +} +``` + + + + +```ts option='"always"' +async function validAlways1() { + try { + return await Promise.resolve('try'); + } catch (e) {} +} + +async function validAlways2() { + return await Promise.resolve('try'); +} + +async function validAlways3() { + return 'value'; +} +``` + + + + +### `error-handling-correctness-only` + +In error-handling contexts, the rule enforces that returned promises must be awaited. +In ordinary contexts, the rule does not enforce any particular behavior around whether returned promises are awaited. + +This is a good option if you only want to benefit from rule's ability to catch control flow bugs in error-handling contexts, but don't want to enforce a particular style otherwise. + +:::info +We recommend you configure either `in-try-catch` or `always` instead of this option. +While the choice of whether to await promises outside of error-handling contexts is mostly stylistic, it's generally best to be consistent. +::: + +Examples of additional correct code with `error-handling-correctness-only`: + + + + +```ts option='"error-handling-correctness-only"' +async function asyncFunction(): Promise { + if (Math.random() < 0.5) { + return await Promise.resolve(); + } else { + return Promise.resolve(); + } +} +``` + + + + +### `never` + +{/* insert option description */} + +Disallows awaiting any returned promises. + +:::warning + +This option is deprecated and will be removed in a future major version of typescript-eslint. + +The `never` option introduces undesirable behavior in error-handling contexts. +If you prefer to minimize returning awaited promises, consider instead using `in-try-catch` instead, which also generally bans returning awaited promises, but only where it is _safe_ not to await a promise. + +See more details at [typescript-eslint#9433](https://github.com/typescript-eslint/typescript-eslint/issues/9433). +::: + +Examples of code with `never`: + + + + +```ts option='"never"' +async function invalidNever1() { + try { + return await Promise.resolve('try'); + } catch (e) {} +} + +async function invalidNever2() { + return await Promise.resolve('try'); +} + +async function invalidNever3() { + return await 'value'; +} +``` + + + + +```ts option='"never"' +async function validNever1() { + try { + return Promise.resolve('try'); + } catch (e) {} +} + +async function validNever2() { + return Promise.resolve('try'); +} + +async function validNever3() { + return 'value'; +} +``` + + + + +{/* Intentionally Omitted: When Not To Use It */} diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.mdx new file mode 100644 index 0000000..8ed863f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.mdx @@ -0,0 +1,209 @@ +--- +description: 'Enforce constituents of a type union/intersection to be sorted alphabetically.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/sort-type-constituents** for documentation. + +:::danger Deprecated +This rule has been deprecated in favor of the [`perfectionist/sort-intersection-types`](https://perfectionist.dev/rules/sort-intersection-types) and [`perfectionist/sort-union-types`](https://perfectionist.dev/rules/sort-union-types) rules. + +See [Docs: Deprecate sort-type-constituents in favor of eslint-plugin-perfectionist](https://github.com/typescript-eslint/typescript-eslint/issues/8915) and [eslint-plugin: Feature freeze naming and sorting stylistic rules](https://github.com/typescript-eslint/typescript-eslint/issues/8792) for more information. +::: + +Sorting union (`|`) and intersection (`&`) types can help: + +- keep your codebase standardized +- find repeated types +- reduce diff churn + +This rule reports on any types that aren't sorted alphabetically. + +> Types are sorted case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties. + +## Examples + + + + +```ts +type T1 = B | A; + +type T2 = { b: string } & { a: string }; + +type T3 = [1, 2, 4] & [1, 2, 3]; + +type T4 = + | [1, 2, 4] + | [1, 2, 3] + | { b: string } + | { a: string } + | (() => void) + | (() => string) + | 'b' + | 'a' + | 'b' + | 'a' + | readonly string[] + | readonly number[] + | string[] + | number[] + | B + | A + | string + | any; +``` + + + + +```ts +type T1 = A | B; + +type T2 = { a: string } & { b: string }; + +type T3 = [1, 2, 3] & [1, 2, 4]; + +type T4 = + | A + | B + | number[] + | string[] + | any + | string + | readonly number[] + | readonly string[] + | 'a' + | 'a' + | 'b' + | 'b' + | (() => string) + | (() => void) + | { a: string } + | { b: string } + | [1, 2, 3] + | [1, 2, 4]; +``` + + + + +## Options + +### `caseSensitive` + +{/* insert option description */} + +Examples of code with `{ "caseSensitive": true }`: + + + + +```ts option='{ "caseSensitive": true }' +type T = 'DeletedAt' | 'DeleteForever'; +``` + + + + +```ts option='{ "caseSensitive": true }' +type T = 'DeleteForever' | 'DeletedAt'; +``` + + + + +### `checkIntersections` + +{/* insert option description */} + +Examples of code with `{ "checkIntersections": true }` (the default): + + + + +```ts option='{ "checkIntersections": true }' +type ExampleIntersection = B & A; +``` + + + + +```ts option='{ "checkIntersections": true }' +type ExampleIntersection = A & B; +``` + + + + +### `checkUnions` + +{/* insert option description */} + +Examples of code with `{ "checkUnions": true }` (the default): + + + + +```ts option='{ "checkUnions": true }' +type ExampleUnion = B | A; +``` + + + + +```ts option='{ "checkUnions": true }' +type ExampleUnion = A | B; +``` + + + + +### `groupOrder` + +{/* insert option description */} + +Each constituent of the type is placed into a group, and then the rule sorts alphabetically within each group. +The ordering of groups is determined by this option. + +- `conditional` - Conditional types (`A extends B ? C : D`) +- `function` - Function and constructor types (`() => void`, `new () => type`) +- `import` - Import types (`import('path')`) +- `intersection` - Intersection types (`A & B`) +- `keyword` - Keyword types (`any`, `string`, etc) +- `literal` - Literal types (`1`, `'b'`, `true`, etc) +- `named` - Named types (`A`, `A['prop']`, `B[]`, `Array`) +- `object` - Object types (`{ a: string }`, `{ [key: string]: number }`) +- `operator` - Operator types (`keyof A`, `typeof B`, `readonly C[]`) +- `tuple` - Tuple types (`[A, B, C]`) +- `union` - Union types (`A | B`) +- `nullish` - `null` and `undefined` + +For example, configuring the rule with `{ "groupOrder": ["literal", "nullish" ]}`: + + + + +```ts option='{ "groupOrder": ["literal", "nullish" ]}' +type ExampleGroup = null | 123; +``` + + + + +```ts option='{ "groupOrder": ["literal", "nullish" ]}' +type ExampleGroup = 123 | null; +``` + + + + +## When Not To Use It + +This rule is purely a stylistic rule for maintaining consistency in your project. +You can turn it off if you don't want to keep a consistent, predictable order for intersection and union types. +However, keep in mind that inconsistent style can harm readability in a project. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.mdx new file mode 100644 index 0000000..af5afd1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.mdx @@ -0,0 +1,16 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been renamed to [`sort-type-constituents`](https://typescript-eslint.io/rules/sort-type-constituents). + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.mdx new file mode 100644 index 0000000..a827ca7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.mdx @@ -0,0 +1,184 @@ +--- +description: 'Disallow certain types in boolean expressions.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/strict-boolean-expressions** for documentation. + +Forbids usage of non-boolean types in expressions where a boolean is expected. +`boolean` and `never` types are always allowed. +Additional types which are considered safe in a boolean context can be configured via options. + +The following nodes are considered boolean expressions and their type is checked: + +- Argument to the logical negation operator (`!arg`). +- The condition in a conditional expression (`cond ? x : y`). +- Conditions for `if`, `for`, `while`, and `do-while` statements. +- Operands of logical binary operators (`lhs || rhs` and `lhs && rhs`). + - Right-hand side operand is ignored when it's not a descendant of another boolean expression. + This is to allow usage of boolean operators for their short-circuiting behavior. +- Asserted argument of an assertion function (`assert(arg)`). +- Return type of array predicate functions such as `filter()`, `some()`, etc. + +## Examples + + + + +```ts +// nullable numbers are considered unsafe by default +declare const num: number | undefined; +if (num) { + console.log('num is defined'); +} + +// nullable strings are considered unsafe by default +declare const str: string | null; +if (!str) { + console.log('str is empty'); +} + +// nullable booleans are considered unsafe by default +function foo(bool?: boolean) { + if (bool) { + bar(); + } +} + +// `any`, unconstrained generics and unions of more than one primitive type are disallowed +const foo = (arg: T) => (arg ? 1 : 0); + +// always-truthy and always-falsy types are disallowed +let obj = {}; +while (obj) { + obj = getObj(); +} + +// assertion functions without an `is` are boolean contexts. +declare function assert(value: unknown): asserts value; +let maybeString = Math.random() > 0.5 ? '' : undefined; +assert(maybeString); + +// array predicates' return types are boolean contexts. +['one', null].filter(x => x); +``` + + + + +```tsx +// nullable values should be checked explicitly against null or undefined +let num: number | undefined = 0; +if (num != null) { + console.log('num is defined'); +} + +let str: string | null = null; +if (str != null && !str) { + console.log('str is empty'); +} + +function foo(bool?: boolean) { + if (bool ?? false) { + bar(); + } +} + +// `any` types should be converted to boolean explicitly +const foo = (arg: any) => (Boolean(arg) ? 1 : 0); +``` + + + + +## Options + +### `allowString` + +{/* insert option description */} + +This can be safe because strings have only one falsy value (`""`). +Set this to `false` if you prefer the explicit `str != ""` or `str.length > 0` style. + +### `allowNumber` + +{/* insert option description */} + +This can be safe because numbers have only two falsy values (`0` and `NaN`). +Set this to `false` if you prefer the explicit `num != 0` and `!Number.isNaN(num)` style. + +### `allowNullableObject` + +{/* insert option description */} + +This can be safe because objects, functions, and symbols don't have falsy values. +Set this to `false` if you prefer the explicit `obj != null` style. + +### `allowNullableBoolean` + +{/* insert option description */} + +This is unsafe because nullable booleans can be either `false` or nullish. +Set this to `false` if you want to enforce explicit `bool ?? false` or `bool ?? true` style. +Set this to `true` if you don't mind implicitly treating false the same as a nullish value. + +### `allowNullableString` + +{/* insert option description */} + +This is unsafe because nullable strings can be either an empty string or nullish. +Set this to `true` if you don't mind implicitly treating an empty string the same as a nullish value. + +### `allowNullableNumber` + +{/* insert option description */} + +This is unsafe because nullable numbers can be either a falsy number or nullish. +Set this to `true` if you don't mind implicitly treating zero or NaN the same as a nullish value. + +### `allowNullableEnum` + +{/* insert option description */} + +This is unsafe because nullable enums can be either a falsy number or nullish. +Set this to `true` if you don't mind implicitly treating an enum whose value is zero the same as a nullish value. + +### `allowAny` + +{/* insert option description */} + +This is unsafe for because `any` allows any values and disables many type checking checks. +Set this to `true` at your own risk. + +### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing` + +{/* insert option description */} + +:::danger Deprecated + +This option will be removed in the next major version of typescript-eslint. + +::: + +If this is set to `false`, then the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`. + +Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule a lot less useful. + +You should be using `strictNullChecks` to ensure complete type-safety in your codebase. + +If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option. + +## When Not To Use It + +If your project isn't likely to experience bugs from falsy non-boolean values being used in logical conditions, you can skip enabling this rule. + +Otherwise, this rule can be quite strict around requiring exact comparisons in logical checks. +If you prefer more succinct checks over more precise boolean logic, this rule might not be for you. + +## Related To + +- [no-unnecessary-condition](./no-unnecessary-condition.mdx) - Similar rule which reports always-truthy and always-falsy values in conditions diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.mdx new file mode 100644 index 0000000..20ee056 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.mdx @@ -0,0 +1,280 @@ +--- +description: 'Require switch-case statements to be exhaustive.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/switch-exhaustiveness-check** for documentation. + +When working with union types or enums in TypeScript, it's common to want to write a `switch` statement intended to contain a `case` for each possible type in the union or the enum. +However, if the union type or the enum changes, it's easy to forget to modify the cases to account for any new types. + +This rule reports when a `switch` statement over a value typed as a union of literals or as an enum is missing a case for any of those literal types and does not have a `default` clause. + +## Options + +### `allowDefaultCaseForExhaustiveSwitch` + +{/* insert option description */} + +If set to false, this rule will also report when a `switch` statement has a case for everything in a union and _also_ contains a `default` case. Thus, by setting this option to false, the rule becomes stricter. + +When a `switch` statement over a union type is exhaustive, a final `default` case would be a form of dead code. +Additionally, if a new value is added to the union type and you're using [`considerDefaultExhaustiveForUnions`](#considerDefaultExhaustiveForUnions), a `default` would prevent the `switch-exhaustiveness-check` rule from reporting on the new case not being handled in the `switch` statement. + +#### `allowDefaultCaseForExhaustiveSwitch` Caveats + +It can sometimes be useful to include a redundant `default` case on an exhaustive `switch` statement if it's possible for values to have types not represented by the union type. +For example, in applications that can have version mismatches between clients and servers, it's possible for a server running a newer software version to send a value not recognized by the client's older typings. + +If your project has a small number of intentionally redundant `default` cases, you might want to use an [inline ESLint disable comment](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for each of them. + +If your project has many intentionally redundant `default` cases, you may want to disable `allowDefaultCaseForExhaustiveSwitch` and use the [`default-case` core ESLint rule](https://eslint.org/docs/latest/rules/default-case) along with [a `satisfies never` check](https://www.typescriptlang.org/play?#code/C4TwDgpgBAYgTgVwJbCgXigcgIZjAGwkygB8sAjbAO2u0wG4AoRgMwSoGNgkB7KqBAGcI8ZMAAULRCgBcsacACUcwcDhIqAcygBvRlCiCA7ig4ALKJIWLd+g1A7ZhWXASJy99+3AjAEcfhw8QgApZA4iJi8AX2YvR2dMShoaTA87Lx8-AIpaGjCkCIYMqFiSgBMIFmwEfGB0rwMpMUNsbkEWJAhBKCoIADcIOCjGrP9A9gBrKh4jKgKikYNY5cZYoA). + +### `requireDefaultForNonUnion` + +{/* insert option description */} + +If set to true, this rule will also report when a `switch` statement switches over a non-union type (like a `number` or `string`, for example) and that `switch` statement does not have a `default` case. Thus, by setting this option to true, the rule becomes stricter. + +This is generally desirable so that `number` and `string` switches will be subject to the same exhaustive checks that your other switches are. + +Examples of additional **incorrect** code for this rule with `{ requireDefaultForNonUnion: true }`: + +```ts option='{ "requireDefaultForNonUnion": true }' showPlaygroundButton +const value: number = Math.floor(Math.random() * 3); + +switch (value) { + case 0: + return 0; + case 1: + return 1; +} +``` + +Since `value` is a non-union type it requires the switch case to have a default clause only with `requireDefaultForNonUnion` enabled. + +### `considerDefaultExhaustiveForUnions` + +{/* insert option description */} + +If set to true, a `switch` statement over a union type that includes a `default` case is considered exhaustive. +Otherwise, the rule enforces explicitly handling every constituent of the union type with their own explicit `case`. +Keeping this option disabled can be useful if you want to make sure every value added to the union receives explicit handling, with the `default` case reserved for reporting an error. + +Examples of additional **correct** code with `{ considerDefaultExhaustiveForUnions: true }`: + +```ts option='{ "considerDefaultExhaustiveForUnions": true }' showPlaygroundButton +declare const literal: 'a' | 'b'; + +switch (literal) { + case 'a': + break; + default: + break; +} +``` + +### `defaultCaseCommentPattern` + +{/* insert option description */} + +Default: `/^no default$/iu`. + +It can sometimes be preferable to omit the default case for only some switch statements. +For those situations, this rule can be given a pattern for a comment that's allowed to take the place of a `default:`. + +Examples of additional **correct** code with `{ defaultCaseCommentPattern: "^skip\\sdefault" }`: + +```ts option='{ "defaultCaseCommentPattern": "^skip default" }' showPlaygroundButton +declare const value: 'a' | 'b'; + +switch (value) { + case 'a': + break; + // skip default +} +``` + +## Examples + +When the switch doesn't have exhaustive cases, either filling them all out or adding a default (if you have `considerDefaultExhaustiveForUnions` enabled) will address the rule's complaint. + +Here are some examples of code working with a union of literals: + + + + +```ts +type Day = + | 'Monday' + | 'Tuesday' + | 'Wednesday' + | 'Thursday' + | 'Friday' + | 'Saturday' + | 'Sunday'; + +declare const day: Day; +let result = 0; + +switch (day) { + case 'Monday': + result = 1; + break; +} +``` + + + + +```ts +type Day = + | 'Monday' + | 'Tuesday' + | 'Wednesday' + | 'Thursday' + | 'Friday' + | 'Saturday' + | 'Sunday'; + +declare const day: Day; +let result = 0; + +switch (day) { + case 'Monday': + result = 1; + break; + case 'Tuesday': + result = 2; + break; + case 'Wednesday': + result = 3; + break; + case 'Thursday': + result = 4; + break; + case 'Friday': + result = 5; + break; + case 'Saturday': + result = 6; + break; + case 'Sunday': + result = 7; + break; +} +``` + + + + +```ts option='{ "considerDefaultExhaustiveForUnions": true }' +// requires `considerDefaultExhaustiveForUnions` to be set to true + +type Day = + | 'Monday' + | 'Tuesday' + | 'Wednesday' + | 'Thursday' + | 'Friday' + | 'Saturday' + | 'Sunday'; + +declare const day: Day; +let result = 0; + +switch (day) { + case 'Monday': + result = 1; + break; + default: + result = 42; +} +``` + + + + +Likewise, here are some examples of code working with an enum: + + + + +```ts +enum Fruit { + Apple, + Banana, + Cherry, +} + +declare const fruit: Fruit; + +switch (fruit) { + case Fruit.Apple: + console.log('an apple'); + break; +} +``` + + + + +```ts +enum Fruit { + Apple, + Banana, + Cherry, +} + +declare const fruit: Fruit; + +switch (fruit) { + case Fruit.Apple: + console.log('an apple'); + break; + + case Fruit.Banana: + console.log('a banana'); + break; + + case Fruit.Cherry: + console.log('a cherry'); + break; +} +``` + + + + +```ts option='{ "considerDefaultExhaustiveForUnions": true }' +// requires `considerDefaultExhaustiveForUnions` to be set to true + +enum Fruit { + Apple, + Banana, + Cherry, +} + +declare const fruit: Fruit; + +switch (fruit) { + case Fruit.Apple: + console.log('an apple'); + break; + + default: + console.log('a fruit'); + break; +} +``` + + + + +## When Not To Use It + +If you don't frequently `switch` over union types or enums with many parts, or intentionally wish to leave out some parts, this rule may not be for you. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.mdx new file mode 100644 index 0000000..2fe7847 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.mdx @@ -0,0 +1,129 @@ +--- +description: 'Disallow certain triple slash directives in favor of ES6-style import declarations.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/triple-slash-reference** for documentation. + +TypeScript's `///` triple-slash references are a way to indicate that types from another module are available in a file. +Use of triple-slash reference type directives is generally discouraged in favor of ECMAScript Module `import`s. +This rule reports on the use of `/// `, `/// `, or `/// ` directives. + +## Options + +Any number of the three kinds of references can be specified as an option. +Specifying `'always'` disables this lint rule for that kind of reference. + +### `lib` + +{/* insert option description */} + +When set to `'never'`, bans `/// ` and enforces using an `import` instead: + + + + +```ts option='{ "lib": "never" }' +/// + +globalThis.value; +``` + + + + +```ts option='{ "lib": "never" }' +import { value } from 'code'; +``` + + + + +### `path` + +{/* insert option description */} + +When set to `'never'`, bans `/// ` and enforces using an `import` instead: + + + + +```ts option='{ "path": "never" }' +/// + +globalThis.value; +``` + + + + +```ts option='{ "path": "never" }' +import { value } from 'code'; +``` + + + + +### `types` + +{/* insert option description */} + +When set to `'never'`, bans `/// ` and enforces using an `import` instead: + + + + +```ts option='{ "types": "never" }' +/// + +globalThis.value; +``` + + + + +```ts option='{ "types": "never" }' +import { value } from 'code'; +``` + + + + +The `types` option may alternately be given a `"prefer-import"` value. +Doing so indicates the rule should only report if there is already an `import` from the same location: + + + + +```ts option='{ "types": "prefer-import" }' +/// + +import { valueA } from 'code'; + +globalThis.valueB; +``` + + + + +```ts option='{ "types": "prefer-import" }' +import { valueA, valueB } from 'code'; +``` + + + + +## When Not To Use It + +Most modern TypeScript projects generally use `import` statements to bring in types. +It's rare to need a `///` triple-slash reference outside of auto-generated code. +If your project is a rare one with one of those use cases, this rule might not be for you. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +## When Not To Use It + +If you want to use all flavors of triple slash reference directives. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md new file mode 100644 index 0000000..039ef6e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md @@ -0,0 +1,15 @@ +--- +displayed_sidebar: rulesSidebar +--- + +:::danger Deprecated + +This rule has been moved to the [ESLint stylistic plugin](https://eslint.style). +See [#8072](https://github.com/typescript-eslint/typescript-eslint/issues/8072) and [#8074](https://github.com/typescript-eslint/typescript-eslint/issues/8074) for more information. + +::: + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.mdx new file mode 100644 index 0000000..8af5c04 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.mdx @@ -0,0 +1,347 @@ +--- +description: 'Require type annotations in certain places.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/typedef** for documentation. + +TypeScript cannot always infer types for all places in code. +Some locations require type annotations for their types to be inferred. + +This rule can enforce type annotations in locations regardless of whether they're required. +This is typically used to maintain consistency for element types that sometimes require them. + +```ts +class ContainsText { + // There must be a type annotation here to infer the type + delayedText: string; + + // `typedef` requires a type annotation here to maintain consistency + immediateTextExplicit: string = 'text'; + + // This is still a string type because of its initial value + immediateTextImplicit = 'text'; +} +``` + +> To enforce type definitions existing on call signatures, use [`explicit-function-return-type`](./explicit-function-return-type.mdx), or [`explicit-module-boundary-types`](./explicit-module-boundary-types.mdx). + +:::caution + +Requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. +TypeScript is often better at inferring types than easily written type annotations would allow. + +**Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and `--strictPropertyInitialization` compiler options to enforce type annotations only when useful.** + +::: + +## Options + +For example, with the following configuration: + +```json +{ + "rules": { + "@typescript-eslint/typedef": [ + "error", + { + "arrowParameter": true, + "variableDeclaration": true + } + ] + } +} +``` + +- Type annotations on arrow function parameters are required +- Type annotations on variables are required + +### `arrayDestructuring` + +{/* insert option description */} + +Examples of code with `{ "arrayDestructuring": true }`: + + + + +```ts option='{ "arrayDestructuring": true }' +const [a] = [1]; +const [b, c] = [1, 2]; +``` + + + + +```ts option='{ "arrayDestructuring": true }' +const [a]: number[] = [1]; +const [b]: [number] = [2]; +const [c, d]: [boolean, string] = [true, 'text']; + +for (const [key, val] of new Map([['key', 1]])) { +} +``` + + + + +### `arrowParameter` + +{/* insert option description */} + +Examples of code with `{ "arrowParameter": true }`: + + + + +```ts option='{ "arrowParameter": true }' +const logsSize = size => console.log(size); + +['hello', 'world'].map(text => text.length); + +const mapper = { + map: text => text + '...', +}; +``` + + + + +```ts option='{ "arrowParameter": true }' +const logsSize = (size: number) => console.log(size); + +['hello', 'world'].map((text: string) => text.length); + +const mapper = { + map: (text: string) => text + '...', +}; +``` + + + + +### `memberVariableDeclaration` + +{/* insert option description */} + +Examples of code with `{ "memberVariableDeclaration": true }`: + + + + +```ts option='{ "memberVariableDeclaration": true }' +class ContainsText { + delayedText; + immediateTextImplicit = 'text'; +} +``` + + + + +```ts option='{ "memberVariableDeclaration": true }' +class ContainsText { + delayedText: string; + immediateTextImplicit: string = 'text'; +} +``` + + + + +### `objectDestructuring` + +{/* insert option description */} + +Examples of code with `{ "objectDestructuring": true }`: + + + + +```ts option='{ "objectDestructuring": true }' +const { length } = 'text'; +const [b, c] = Math.random() ? [1, 2] : [3, 4]; +``` + + + + +```ts option='{ "objectDestructuring": true }' +const { length }: { length: number } = 'text'; +const [b, c]: [number, number] = Math.random() ? [1, 2] : [3, 4]; + +for (const { key, val } of [{ key: 'key', val: 1 }]) { +} +``` + + + + +### `parameter` + +{/* insert option description */} + +Examples of code with `{ "parameter": true }`: + + + + +```ts option='{ "parameter": true }' +function logsSize(size): void { + console.log(size); +} + +const doublesSize = function (size): number { + return size * 2; +}; + +const divider = { + curriesSize(size): number { + return size; + }, + dividesSize: function (size): number { + return size / 2; + }, +}; + +class Logger { + log(text): boolean { + console.log('>', text); + return true; + } +} +``` + + + + +```ts option='{ "parameter": true }' +function logsSize(size: number): void { + console.log(size); +} + +const doublesSize = function (size: number): number { + return size * 2; +}; + +const divider = { + curriesSize(size: number): number { + return size; + }, + dividesSize: function (size: number): number { + return size / 2; + }, +}; + +class Logger { + log(text: boolean): boolean { + console.log('>', text); + return true; + } +} +``` + + + + +### `propertyDeclaration` + +{/* insert option description */} + +Examples of code with `{ "propertyDeclaration": true }`: + + + + +```ts option='{ "propertyDeclaration": true }' +type Members = { + member; + otherMember; +}; +``` + + + + +```ts option='{ "propertyDeclaration": true }' +type Members = { + member: boolean; + otherMember: string; +}; +``` + + + + +### `variableDeclaration` + +{/* insert option description */} + +Examples of code with `{ "variableDeclaration": true }`: + + + + +```ts option='{ "variableDeclaration": true }' +const text = 'text'; +let initialText = 'text'; +let delayedText; +``` + + + + +```ts option='{ "variableDeclaration": true }' +const text: string = 'text'; +let initialText: string = 'text'; +let delayedText: string; +``` + + + + +### `variableDeclarationIgnoreFunction` + +{/* insert option description */} + +Examples of code with `{ "variableDeclaration": true, "variableDeclarationIgnoreFunction": true }`: + + + + +```ts option='{ "variableDeclaration": true, "variableDeclarationIgnoreFunction": true }' +const text = 'text'; +``` + + + + +```ts option='{ "variableDeclaration": true, "variableDeclarationIgnoreFunction": true }' +const a = (): void => {}; +const b = function (): void {}; +const c: () => void = (): void => {}; + +class Foo { + a = (): void => {}; + b = function (): void {}; + c: () => void = (): void => {}; +} +``` + + + + +## When Not To Use It + +If you are using stricter TypeScript compiler options, particularly `--noImplicitAny` and/or `--strictPropertyInitialization`, you likely don't need this rule. + +In general, if you do not consider the cost of writing unnecessary type annotations reasonable, then do not use this rule. + +## Further Reading + +- [TypeScript Type System](https://basarat.gitbooks.io/typescript/docs/types/type-system.html) +- [Type Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.mdx new file mode 100644 index 0000000..bf48bea --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.mdx @@ -0,0 +1,114 @@ +--- +description: 'Enforce unbound methods are called with their expected scope.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/unbound-method** for documentation. + +Class method functions don't preserve the class scope when passed as standalone variables ("unbound"). +If your function does not access `this`, [you can annotate it with `this: void`](https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function), or consider using an arrow function instead. +Otherwise, passing class methods around as values can remove type safety by failing to capture `this`. + +This rule reports when a class method is referenced in an unbound manner. + +:::note Tip +If you're working with `jest`, you can use [`eslint-plugin-jest`'s version of this rule](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md) to lint your test files, which knows when it's ok to pass an unbound method to `expect` calls. +::: + +## Examples + + + + +```ts +class MyClass { + public log(): void { + console.log(this); + } +} + +const instance = new MyClass(); + +// This logs the global scope (`window`/`global`), not the class instance +const myLog = instance.log; +myLog(); + +// This log might later be called with an incorrect scope +const { log } = instance; + +// arith.double may refer to `this` internally +const arith = { + double(x: number): number { + return x * 2; + }, +}; +const { double } = arith; +``` + + + + +```ts +class MyClass { + public logUnbound(): void { + console.log(this); + } + + public logBound = () => console.log(this); +} + +const instance = new MyClass(); + +// logBound will always be bound with the correct scope +const { logBound } = instance; +logBound(); + +// .bind and lambdas will also add a correct scope +const dotBindLog = instance.logUnbound.bind(instance); +const innerLog = () => instance.logUnbound(); + +// arith.double explicitly declares that it does not refer to `this` internally +const arith = { + double(this: void, x: number): number { + return x * 2; + }, +}; +const { double } = arith; +``` + + + + +## Options + +### `ignoreStatic` + +{/* insert option description */} + +Examples of **correct** code for this rule with `{ ignoreStatic: true }`: + +```ts option='{ "ignoreStatic": true }' showPlaygroundButton +class OtherClass { + static log() { + console.log(OtherClass); + } +} + +// With `ignoreStatic`, statics are assumed to not rely on a particular scope +const { log } = OtherClass; + +log(); +``` + +## When Not To Use It + +If your project dynamically changes `this` scopes around in a way TypeScript has difficulties modeling, this rule may not be viable to use. +For example, some functions have an additional parameter for specifying the `this` context, such as `Reflect.apply`, and array methods like `Array.prototype.map`. +This semantic is not easily expressed by TypeScript. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. + +If you're wanting to use `toBeCalled` and similar matches in `jest` tests, you can disable this rule for your test files in favor of [`eslint-plugin-jest`'s version of this rule](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.mdx). diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.mdx new file mode 100644 index 0000000..593af85 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.mdx @@ -0,0 +1,132 @@ +--- +description: 'Disallow two overloads that could be unified into one with a union or an optional/rest parameter.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/unified-signatures** for documentation. + +Function overload signatures are a TypeScript way to define a function that can be called in multiple very different ways. +Overload signatures add syntax and theoretical bloat, so it's generally best to avoid using them when possible. +Switching to union types and/or optional or rest parameters can often avoid the need for overload signatures. + +This rule reports when function overload signatures can be replaced by a single function signature. + +## Examples + + + + +```ts +function x(x: number): void; +function x(x: string): void; +``` + +```ts +function y(): void; +function y(...x: number[]): void; +``` + + + + +```ts +function x(x: number | string): void; +``` + +```ts +function y(...x: number[]): void; +``` + +```ts +// This rule won't check overload signatures with different rest parameter types. +// See https://github.com/microsoft/TypeScript/issues/5077 +function f(...a: number[]): void; +function f(...a: string[]): void; +``` + + + + +## Options + +### `ignoreDifferentlyNamedParameters` + +{/* insert option description */} + +Examples of code for this rule with `ignoreDifferentlyNamedParameters`: + + + + +```ts option='{ "ignoreDifferentlyNamedParameters": true }' +function f(a: number): void; +function f(a: string): void; +``` + + + + +```ts option='{ "ignoreDifferentlyNamedParameters": true }' +function f(a: number): void; +function f(b: string): void; +``` + + + + +### `ignoreOverloadsWithDifferentJSDoc` + +{/* insert option description */} + +Examples of code for this rule with `ignoreOverloadsWithDifferentJSDoc`: + + + + +```ts option='{ "ignoreOverloadsWithDifferentJSDoc": true }' +declare function f(x: string): void; +declare function f(x: boolean): void; +/** + * @deprecate + */ +declare function f(x: number): void; +/** + * @deprecate + */ +declare function f(x: null): void; +``` + + + + +```ts option='{ "ignoreOverloadsWithDifferentJSDoc": true }' +declare function f(x: string): void; +/** + * This signature does something else. + */ +declare function f(x: boolean): void; +/** + * @async + */ +declare function f(x: number): void; +/** + * @deprecate + */ +declare function f(x: null): void; +``` + + + + +## When Not To Use It + +This is purely a stylistic rule to help with readability of function signature overloads. +You can turn it off if you don't want to consistently keep them next to each other and unified. + +## Related To + +- [`adjacent-overload-signatures`](./adjacent-overload-signatures.mdx) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/use-unknown-in-catch-callback-variable.mdx b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/use-unknown-in-catch-callback-variable.mdx new file mode 100644 index 0000000..72a1fd8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/use-unknown-in-catch-callback-variable.mdx @@ -0,0 +1,97 @@ +--- +description: 'Enforce typing arguments in Promise rejection callbacks as `unknown`.' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable** for documentation. + +This rule enforces that you always use the `unknown` type for the parameter of a Promise rejection callback. + + + + +```ts +Promise.reject(new Error('I will reject!')).catch(err => { + console.log(err); +}); + +Promise.reject(new Error('I will reject!')).catch((err: any) => { + console.log(err); +}); + +Promise.reject(new Error('I will reject!')).catch((err: Error) => { + console.log(err); +}); + +Promise.reject(new Error('I will reject!')).then( + result => { + console.log(result); + }, + err => { + console.log(err); + }, +); +``` + + + + +```ts +Promise.reject(new Error('I will reject!')).catch((err: unknown) => { + console.log(err); +}); +``` + + + + +The reason for this rule is to enable programmers to impose constraints on `Promise` error handling analogously to what TypeScript provides for ordinary exception handling. + +For ordinary exceptions, TypeScript treats the `catch` variable as `any` by default. However, `unknown` would be a more accurate type, so TypeScript [introduced the `useUnknownInCatchVariables` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html#defaulting-to-the-unknown-type-in-catch-variables---useunknownincatchvariables) to treat the `catch` variable as `unknown` instead. + +```ts +try { + throw x; +} catch (err) { + // err has type 'any' with useUnknownInCatchVariables: false + // err has type 'unknown' with useUnknownInCatchVariables: true +} +``` + +The Promise analog of the `try-catch` block, [`Promise.prototype.catch()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch), is not affected by the `useUnknownInCatchVariables` compiler option, and its "`catch` variable" will always have the type `any`. + +```ts +Promise.reject(x).catch(err => { + // err has type 'any' regardless of `useUnknownInCatchVariables` +}); +``` + +However, you can still provide an explicit type annotation, which lets you achieve the same effect as the `useUnknownInCatchVariables` option does for synchronous `catch` variables. + +```ts +Promise.reject(x).catch((err: unknown) => { + // err has type 'unknown' +}); +``` + +:::info +There is actually a way to have the `catch()` and `then()` callback variables use the `unknown` type _without_ an explicit type annotation at the call sites, but it has the drawback that it involves overriding global type declarations. +For example, the library [better-TypeScript-lib](https://github.com/uhyo/better-typescript-lib) sets this up globally for your project (see [the relevant lines in the better-TypeScript-lib source code](https://github.com/uhyo/better-typescript-lib/blob/c294e177d1cc2b1d1803febf8192a4c83a1fe028/lib/lib.es5.d.ts#L635) for details on how). + +For further reading on this, you may also want to look into +[the discussion in the proposal for this rule](https://github.com/typescript-eslint/typescript-eslint/issues/7526#issuecomment-1690600813) and [this TypeScript issue on typing catch callback variables as unknown](https://github.com/microsoft/TypeScript/issues/45602). +::: + +## When Not To Use It + +If your codebase is not yet able to enable `useUnknownInCatchVariables`, it likely would be similarly difficult to enable this rule. + +If you have modified the global type declarations in order to make `then()` and `catch()` callbacks use the `unknown` type without an explicit type annotation, you do not need this rule. + +## Related To + +- [Avoiding `any`s with Linting and TypeScript](/blog/avoiding-anys) diff --git a/node_modules/@typescript-eslint/eslint-plugin/package.json b/node_modules/@typescript-eslint/eslint-plugin/package.json new file mode 100644 index 0000000..2647cee --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/package.json @@ -0,0 +1,109 @@ +{ + "name": "@typescript-eslint/eslint-plugin", + "version": "8.26.0", + "description": "TypeScript plugin for ESLint", + "files": [ + "dist", + "!*.tsbuildinfo", + "docs", + "eslint-recommended-raw.d.ts", + "index.d.ts", + "rules.d.ts", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json", + "./use-at-your-own-risk/rules": { + "types": "./rules.d.ts", + "default": "./dist/rules/index.js" + }, + "./use-at-your-own-risk/eslint-recommended-raw": { + "types": "./eslint-recommended-raw.d.ts", + "default": "./dist/configs/eslint-recommended-raw.js" + } + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/eslint-plugin" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io/packages/eslint-plugin", + "license": "MIT", + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "typescript" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "generate:breaking-changes": "tsx tools/generate-breaking-changes.mts", + "generate:configs": "npx nx generate-configs repo", + "lint": "npx nx lint", + "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --logHeapUsage", + "test-single": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --no-coverage", + "check-types": "npx nx typecheck" + }, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.26.0", + "@typescript-eslint/type-utils": "8.26.0", + "@typescript-eslint/utils": "8.26.0", + "@typescript-eslint/visitor-keys": "8.26.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" + }, + "devDependencies": { + "@jest/types": "29.6.3", + "@types/marked": "^5.0.2", + "@types/mdast": "^4.0.3", + "@types/natural-compare": "*", + "@typescript-eslint/rule-schema-to-typescript-types": "8.26.0", + "@typescript-eslint/rule-tester": "8.26.0", + "ajv": "^6.12.6", + "cross-env": "^7.0.3", + "cross-fetch": "*", + "eslint": "*", + "jest": "29.7.0", + "jest-specific-snapshot": "^8.0.0", + "json-schema": "*", + "markdown-table": "^3.0.3", + "marked": "^5.1.2", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx": "^3.0.0", + "micromark-extension-mdxjs": "^3.0.0", + "prettier": "^3.2.5", + "rimraf": "*", + "title-case": "^3.0.3", + "tsx": "*", + "typescript": "*", + "unist-util-visit": "^5.0.0" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } +} diff --git a/node_modules/@typescript-eslint/parser/LICENSE b/node_modules/@typescript-eslint/parser/LICENSE new file mode 100644 index 0000000..a116410 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/parser/README.md b/node_modules/@typescript-eslint/parser/README.md new file mode 100644 index 0000000..56ee655 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/parser` + +> An ESLint parser which leverages
TypeScript ESTree to allow for ESLint to lint TypeScript source code. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/parser.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/parser) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/parser.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/parser) + +👉 See **https://typescript-eslint.io/packages/parser** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/node_modules/@typescript-eslint/parser/dist/index.d.ts.map b/node_modules/@typescript-eslint/parser/dist/index.d.ts.map new file mode 100644 index 0000000..124854e --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EACL,WAAW,EACX,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,oCAAoC,EACzC,KAAK,iCAAiC,EACtC,2BAA2B,GAC5B,MAAM,sCAAsC,CAAC;AAI9C,eAAO,MAAM,OAAO,EAAE,MAA2C,CAAC;AAElE,eAAO,MAAM,IAAI;;;CAGhB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/index.js b/node_modules/@typescript-eslint/parser/dist/index.js new file mode 100644 index 0000000..47ea577 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.meta = exports.version = exports.withoutProjectParserOptions = exports.createProgram = exports.clearCaches = exports.parseForESLint = exports.parse = void 0; +var parser_1 = require("./parser"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } }); +Object.defineProperty(exports, "parseForESLint", { enumerable: true, get: function () { return parser_1.parseForESLint; } }); +var typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +Object.defineProperty(exports, "clearCaches", { enumerable: true, get: function () { return typescript_estree_1.clearCaches; } }); +Object.defineProperty(exports, "createProgram", { enumerable: true, get: function () { return typescript_estree_1.createProgram; } }); +Object.defineProperty(exports, "withoutProjectParserOptions", { enumerable: true, get: function () { return typescript_estree_1.withoutProjectParserOptions; } }); +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access +exports.version = require('../package.json').version; +exports.meta = { + name: 'typescript-eslint/parser', + version: exports.version, +}; diff --git a/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map b/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map new file mode 100644 index 0000000..34bc99e --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAO,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EACV,GAAG,EACH,cAAc,EAEf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAUtC,UAAU,aAAc,SAAQ,GAAG,CAAC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,IAAI,CAAA;CAAE,CAAC;IAClE,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;CAC1B;AAED,UAAU,oBAAoB;IAC5B,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAkDD,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,EAC5B,OAAO,CAAC,EAAE,aAAa,GACtB,oBAAoB,CAAC,KAAK,CAAC,CAE7B;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,EAC5B,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,GACnC,oBAAoB,CAiGtB;AAED,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser.js b/node_modules/@typescript-eslint/parser/dist/parser.js new file mode 100644 index 0000000..c61beec --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser.js @@ -0,0 +1,139 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parse = parse; +exports.parseForESLint = parseForESLint; +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +const debug_1 = __importDefault(require("debug")); +const typescript_1 = require("typescript"); +const log = (0, debug_1.default)('typescript-eslint:parser:parser'); +function validateBoolean(value, fallback = false) { + if (typeof value !== 'boolean') { + return fallback; + } + return value; +} +const LIB_FILENAME_REGEX = /lib\.(.+)\.d\.[cm]?ts$/; +function getLib(compilerOptions) { + if (compilerOptions.lib) { + return compilerOptions.lib + .map(lib => LIB_FILENAME_REGEX.exec(lib.toLowerCase())?.[1]) + .filter((lib) => !!lib); + } + const target = compilerOptions.target ?? typescript_1.ScriptTarget.ES5; + // https://github.com/microsoft/TypeScript/blob/ae582a22ee1bb052e19b7c1bc4cac60509b574e0/src/compiler/utilitiesPublic.ts#L13-L36 + switch (target) { + case typescript_1.ScriptTarget.ES2015: + return ['es6']; + case typescript_1.ScriptTarget.ES2016: + return ['es2016.full']; + case typescript_1.ScriptTarget.ES2017: + return ['es2017.full']; + case typescript_1.ScriptTarget.ES2018: + return ['es2018.full']; + case typescript_1.ScriptTarget.ES2019: + return ['es2019.full']; + case typescript_1.ScriptTarget.ES2020: + return ['es2020.full']; + case typescript_1.ScriptTarget.ES2021: + return ['es2021.full']; + case typescript_1.ScriptTarget.ES2022: + return ['es2022.full']; + case typescript_1.ScriptTarget.ES2023: + return ['es2023.full']; + case typescript_1.ScriptTarget.ES2024: + return ['es2024.full']; + case typescript_1.ScriptTarget.ESNext: + return ['esnext.full']; + default: + return ['lib']; + } +} +function parse(code, options) { + return parseForESLint(code, options).ast; +} +function parseForESLint(code, parserOptions) { + if (!parserOptions || typeof parserOptions !== 'object') { + parserOptions = {}; + } + else { + parserOptions = { ...parserOptions }; + } + // https://eslint.org/docs/user-guide/configuring#specifying-parser-options + // if sourceType is not provided by default eslint expect that it will be set to "script" + if (parserOptions.sourceType !== 'module' && + parserOptions.sourceType !== 'script') { + parserOptions.sourceType = 'script'; + } + if (typeof parserOptions.ecmaFeatures !== 'object') { + parserOptions.ecmaFeatures = {}; + } + /** + * Allow the user to suppress the warning from typescript-estree if they are using an unsupported + * version of TypeScript + */ + const warnOnUnsupportedTypeScriptVersion = validateBoolean(parserOptions.warnOnUnsupportedTypeScriptVersion, true); + const tsestreeOptions = { + jsx: validateBoolean(parserOptions.ecmaFeatures.jsx), + ...(!warnOnUnsupportedTypeScriptVersion && { loggerFn: false }), + ...parserOptions, + // Override errorOnTypeScriptSyntacticAndSemanticIssues and set it to false to prevent use from user config + // https://github.com/typescript-eslint/typescript-eslint/issues/8681#issuecomment-2000411834 + errorOnTypeScriptSyntacticAndSemanticIssues: false, + // comment, loc, range, and tokens should always be set for ESLint usage + // https://github.com/typescript-eslint/typescript-eslint/issues/8347 + comment: true, + loc: true, + range: true, + tokens: true, + }; + const analyzeOptions = { + globalReturn: parserOptions.ecmaFeatures.globalReturn, + jsxFragmentName: parserOptions.jsxFragmentName, + jsxPragma: parserOptions.jsxPragma, + lib: parserOptions.lib, + sourceType: parserOptions.sourceType, + }; + const { ast, services } = (0, typescript_estree_1.parseAndGenerateServices)(code, tsestreeOptions); + ast.sourceType = parserOptions.sourceType; + if (services.program) { + // automatically apply the options configured for the program + const compilerOptions = services.program.getCompilerOptions(); + if (analyzeOptions.lib == null) { + analyzeOptions.lib = getLib(compilerOptions); + log('Resolved libs from program: %o', analyzeOptions.lib); + } + if ( + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + analyzeOptions.jsxPragma === undefined && + compilerOptions.jsxFactory != null) { + // in case the user has specified something like "preact.h" + const factory = compilerOptions.jsxFactory.split('.')[0].trim(); + analyzeOptions.jsxPragma = factory; + log('Resolved jsxPragma from program: %s', analyzeOptions.jsxPragma); + } + if ( + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + analyzeOptions.jsxFragmentName === undefined && + compilerOptions.jsxFragmentFactory != null) { + // in case the user has specified something like "preact.Fragment" + const fragFactory = compilerOptions.jsxFragmentFactory + .split('.')[0] + .trim(); + analyzeOptions.jsxFragmentName = fragFactory; + log('Resolved jsxFragmentName from program: %s', analyzeOptions.jsxFragmentName); + } + } + const scopeManager = (0, scope_manager_1.analyze)(ast, analyzeOptions); + // if not defined - override from the parserOptions + services.emitDecoratorMetadata ??= + parserOptions.emitDecoratorMetadata === true; + services.experimentalDecorators ??= + parserOptions.experimentalDecorators === true; + services.isolatedDeclarations ??= parserOptions.isolatedDeclarations === true; + return { ast, scopeManager, services, visitorKeys: visitor_keys_1.visitorKeys }; +} diff --git a/node_modules/@typescript-eslint/parser/package.json b/node_modules/@typescript-eslint/parser/package.json new file mode 100644 index 0000000..d2334c3 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/package.json @@ -0,0 +1,83 @@ +{ + "name": "@typescript-eslint/parser", + "version": "8.26.0", + "description": "An ESLint custom parser which leverages TypeScript ESTree", + "files": [ + "dist", + "!*.tsbuildinfo", + "_ts4.3", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/parser" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io/packages/parser", + "license": "MIT", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "typescript", + "parser", + "syntax", + "eslint" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "lint": "npx nx lint", + "test": "jest", + "check-types": "npx nx typecheck" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + }, + "dependencies": { + "@typescript-eslint/scope-manager": "8.26.0", + "@typescript-eslint/types": "8.26.0", + "@typescript-eslint/typescript-estree": "8.26.0", + "@typescript-eslint/visitor-keys": "8.26.0", + "debug": "^4.3.4" + }, + "devDependencies": { + "@jest/types": "29.6.3", + "downlevel-dts": "*", + "glob": "*", + "jest": "29.7.0", + "prettier": "^3.2.5", + "rimraf": "*", + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/node_modules/@typescript-eslint/scope-manager/LICENSE b/node_modules/@typescript-eslint/scope-manager/LICENSE new file mode 100644 index 0000000..a116410 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/scope-manager/README.md b/node_modules/@typescript-eslint/scope-manager/README.md new file mode 100644 index 0000000..b730e9d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/README.md @@ -0,0 +1,10 @@ +# `@typescript-eslint/scope-manager` + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/scope-manager.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/scope-manager) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/scope-manager.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/scope-manager) + +👉 See **https://typescript-eslint.io/packages/scope-manager** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts.map new file mode 100644 index 0000000..62f8e82 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ID.d.ts","sourceRoot":"","sources":["../src/ID.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,IAAI,MAAM,MAAM,CAUhD;AAED,wBAAgB,QAAQ,IAAI,IAAI,CAE/B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ID.js b/node_modules/@typescript-eslint/scope-manager/dist/ID.js new file mode 100644 index 0000000..587fa91 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ID.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createIdGenerator = createIdGenerator; +exports.resetIds = resetIds; +const ID_CACHE = new Map(); +let NEXT_KEY = 0; +function createIdGenerator() { + const key = (NEXT_KEY += 1); + ID_CACHE.set(key, 0); + return () => { + const current = ID_CACHE.get(key) ?? 0; + const next = current + 1; + ID_CACHE.set(key, next); + return next; + }; +} +function resetIds() { + ID_CACHE.clear(); +} diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map new file mode 100644 index 0000000..f543d9d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeManager.d.ts","sourceRoot":"","sources":["../src/ScopeManager.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js new file mode 100644 index 0000000..f78b682 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js @@ -0,0 +1,181 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeManager = void 0; +const assert_1 = require("./assert"); +const scope_1 = require("./scope"); +const ClassFieldInitializerScope_1 = require("./scope/ClassFieldInitializerScope"); +const ClassStaticBlockScope_1 = require("./scope/ClassStaticBlockScope"); +/** + * @see https://eslint.org/docs/latest/developer-guide/scope-manager-interface#scopemanager-interface + */ +class ScopeManager { + #options; + currentScope; + declaredVariables; + /** + * The root scope + */ + globalScope; + nodeToScope; + /** + * All scopes + * @public + */ + scopes; + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.nodeToScope = new WeakMap(); + this.currentScope = null; + this.#options = options; + this.declaredVariables = new WeakMap(); + } + isES6() { + return true; + } + isGlobalReturn() { + return this.#options.globalReturn === true; + } + isImpliedStrict() { + return this.#options.impliedStrict === true; + } + isModule() { + return this.#options.sourceType === 'module'; + } + isStrictModeSupported() { + return true; + } + get variables() { + const variables = new Set(); + function recurse(scope) { + scope.variables.forEach(v => variables.add(v)); + scope.childScopes.forEach(recurse); + } + this.scopes.forEach(recurse); + return [...variables].sort((a, b) => a.$id - b.$id); + } + /** + * Get the variables that a given AST node defines. The gotten variables' `def[].node`/`def[].parent` property is the node. + * If the node does not define any variable, this returns an empty array. + * @param node An AST node to get their variables. + */ + getDeclaredVariables(node) { + return this.declaredVariables.get(node) ?? []; + } + /** + * Get the scope of a given AST node. The gotten scope's `block` property is the node. + * This method never returns `function-expression-name` scope. If the node does not have their scope, this returns `null`. + * + * @param node An AST node to get their scope. + * @param inner If the node has multiple scopes, this returns the outermost scope normally. + * If `inner` is `true` then this returns the innermost scope. + */ + acquire(node, inner = false) { + function predicate(testScope) { + if (testScope.type === scope_1.ScopeType.function && + testScope.functionExpressionScope) { + return false; + } + return true; + } + const scopes = this.nodeToScope.get(node); + if (!scopes || scopes.length === 0) { + return null; + } + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + if (predicate(scope)) { + return scope; + } + } + return null; + } + return scopes.find(predicate) ?? null; + } + nestBlockScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.BlockScope(this, this.currentScope, node)); + } + nestCatchScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.CatchScope(this, this.currentScope, node)); + } + nestClassFieldInitializerScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new ClassFieldInitializerScope_1.ClassFieldInitializerScope(this, this.currentScope, node)); + } + nestClassScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.ClassScope(this, this.currentScope, node)); + } + nestClassStaticBlockScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new ClassStaticBlockScope_1.ClassStaticBlockScope(this, this.currentScope, node)); + } + nestConditionalTypeScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.ConditionalTypeScope(this, this.currentScope, node)); + } + nestForScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.ForScope(this, this.currentScope, node)); + } + nestFunctionExpressionNameScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.FunctionExpressionNameScope(this, this.currentScope, node)); + } + nestFunctionScope(node, isMethodDefinition) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.FunctionScope(this, this.currentScope, node, isMethodDefinition)); + } + nestFunctionTypeScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.FunctionTypeScope(this, this.currentScope, node)); + } + nestGlobalScope(node) { + return this.nestScope(new scope_1.GlobalScope(this, node)); + } + nestMappedTypeScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.MappedTypeScope(this, this.currentScope, node)); + } + nestModuleScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.ModuleScope(this, this.currentScope, node)); + } + nestSwitchScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.SwitchScope(this, this.currentScope, node)); + } + nestTSEnumScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.TSEnumScope(this, this.currentScope, node)); + } + nestTSModuleScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.TSModuleScope(this, this.currentScope, node)); + } + nestTypeScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.TypeScope(this, this.currentScope, node)); + } + nestWithScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.WithScope(this, this.currentScope, node)); + } + nestScope(scope) { + if (scope instanceof scope_1.GlobalScope) { + (0, assert_1.assert)(this.currentScope == null); + this.globalScope = scope; + } + this.currentScope = scope; + return scope; + } +} +exports.ScopeManager = ScopeManager; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map new file mode 100644 index 0000000..73c7381 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAEzD;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAGxB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAaD;;GAEG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,eAAe,CAAC,EAAE,cAAc,GAC/B,YAAY,CA4Bd"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/analyze.js b/node_modules/@typescript-eslint/scope-manager/dist/analyze.js new file mode 100644 index 0000000..dfedd03 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/analyze.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.analyze = analyze; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +const referencer_1 = require("./referencer"); +const ScopeManager_1 = require("./ScopeManager"); +const DEFAULT_OPTIONS = { + childVisitorKeys: visitor_keys_1.visitorKeys, + emitDecoratorMetadata: false, + globalReturn: false, + impliedStrict: false, + jsxFragmentName: null, + jsxPragma: 'React', + lib: ['es2018'], + sourceType: 'script', +}; +/** + * Takes an AST and returns the analyzed scopes. + */ +function analyze(tree, providedOptions) { + const options = { + childVisitorKeys: providedOptions?.childVisitorKeys ?? DEFAULT_OPTIONS.childVisitorKeys, + emitDecoratorMetadata: false, + globalReturn: providedOptions?.globalReturn ?? DEFAULT_OPTIONS.globalReturn, + impliedStrict: providedOptions?.impliedStrict ?? DEFAULT_OPTIONS.impliedStrict, + jsxFragmentName: providedOptions?.jsxFragmentName ?? DEFAULT_OPTIONS.jsxFragmentName, + jsxPragma: + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + providedOptions?.jsxPragma === undefined + ? DEFAULT_OPTIONS.jsxPragma + : providedOptions.jsxPragma, + lib: providedOptions?.lib ?? ['esnext'], + sourceType: providedOptions?.sourceType ?? DEFAULT_OPTIONS.sourceType, + }; + // ensure the option is lower cased + options.lib = options.lib.map(l => l.toLowerCase()); + const scopeManager = new ScopeManager_1.ScopeManager(options); + const referencer = new referencer_1.Referencer(options, scopeManager); + referencer.visit(tree); + return scopeManager; +} diff --git a/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts.map new file mode 100644 index 0000000..137bbfa --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":"AACA,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAItE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/assert.js b/node_modules/@typescript-eslint/scope-manager/dist/assert.js new file mode 100644 index 0000000..24c3c19 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/assert.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assert = assert; +// the base assert module doesn't use ts assertion syntax +function assert(value, message) { + if (value == null) { + throw new Error(message); + } +} diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts.map new file mode 100644 index 0000000..86b2a6f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CatchClauseDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/CatchClauseDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,qBAAsB,SAAQ,cAAc,CACvD,cAAc,CAAC,WAAW,EAC1B,QAAQ,CAAC,WAAW,EACpB,IAAI,EACJ,QAAQ,CAAC,WAAW,CACrB;IACC,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;gBAEhC,IAAI,EAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC;CAG5E"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js new file mode 100644 index 0000000..a1816c5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CatchClauseDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class CatchClauseDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = false; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.CatchClause, name, node, null); + } +} +exports.CatchClauseDefinition = CatchClauseDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts.map new file mode 100644 index 0000000..20a0250 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassNameDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/ClassNameDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,mBAAoB,SAAQ,cAAc,CACrD,cAAc,CAAC,SAAS,EACxB,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,EACpD,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;IACC,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;gBAEhC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC;CAGzE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js new file mode 100644 index 0000000..55e6cc5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassNameDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class ClassNameDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.ClassName, name, node, null); + } +} +exports.ClassNameDefinition = ClassNameDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map new file mode 100644 index 0000000..5b1588e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Definition.d.ts","sourceRoot":"","sources":["../../src/definition/Definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,UAAU,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,gCAAgC,GAChC,uBAAuB,GACvB,mBAAmB,GACnB,sBAAsB,GACtB,oBAAoB,GACpB,sBAAsB,GACtB,cAAc,GACd,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts.map new file mode 100644 index 0000000..ee26ef4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DefinitionBase.d.ts","sourceRoot":"","sources":["../../src/definition/DefinitionBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMvD,8BAAsB,cAAc,CAClC,IAAI,SAAS,cAAc,EAC3B,IAAI,SAAS,QAAQ,CAAC,IAAI,EAC1B,MAAM,SAAS,QAAQ,CAAC,IAAI,GAAG,IAAI,EACnC,IAAI,SAAS,QAAQ,CAAC,IAAI;IAE1B;;OAEG;IACH,SAAgB,GAAG,EAAE,MAAM,CAAe;IAE1C,SAAgB,IAAI,EAAE,IAAI,CAAC;IAE3B;;;OAGG;IACH,SAAgB,IAAI,EAAE,IAAI,CAAC;IAE3B;;;OAGG;IACH,SAAgB,IAAI,EAAE,IAAI,CAAC;IAE3B;;;OAGG;IACH,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEnB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM;IAO9D;;OAEG;IACH,kBAAyB,gBAAgB,EAAE,OAAO,CAAC;IAEnD;;OAEG;IACH,kBAAyB,oBAAoB,EAAE,OAAO,CAAC;CACxD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js new file mode 100644 index 0000000..3327b11 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefinitionBase = void 0; +const ID_1 = require("../ID"); +const generator = (0, ID_1.createIdGenerator)(); +class DefinitionBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + $id = generator(); + type; + /** + * The `Identifier` node of this definition + * @public + */ + name; + /** + * The enclosing node of the name. + * @public + */ + node; + /** + * the enclosing statement node of the identifier. + * @public + */ + parent; + constructor(type, name, node, parent) { + this.type = type; + this.name = name; + this.node = node; + this.parent = parent; + } +} +exports.DefinitionBase = DefinitionBase; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts.map new file mode 100644 index 0000000..6294624 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DefinitionType.d.ts","sourceRoot":"","sources":["../../src/definition/DefinitionType.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,sBAAsB,2BAA2B;IACjD,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,YAAY,qBAAqB;IACjC,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js new file mode 100644 index 0000000..1ac3194 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefinitionType = void 0; +var DefinitionType; +(function (DefinitionType) { + DefinitionType["CatchClause"] = "CatchClause"; + DefinitionType["ClassName"] = "ClassName"; + DefinitionType["FunctionName"] = "FunctionName"; + DefinitionType["ImplicitGlobalVariable"] = "ImplicitGlobalVariable"; + DefinitionType["ImportBinding"] = "ImportBinding"; + DefinitionType["Parameter"] = "Parameter"; + DefinitionType["TSEnumName"] = "TSEnumName"; + DefinitionType["TSEnumMember"] = "TSEnumMemberName"; + DefinitionType["TSModuleName"] = "TSModuleName"; + DefinitionType["Type"] = "Type"; + DefinitionType["Variable"] = "Variable"; +})(DefinitionType || (exports.DefinitionType = DefinitionType = {})); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts.map new file mode 100644 index 0000000..17faaaa --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionNameDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/FunctionNameDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,sBAAuB,SAAQ,cAAc,CACxD,cAAc,CAAC,YAAY,EACzB,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,6BAA6B,EACxC,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;IACC,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;gBAEhC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;CAG5E"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js new file mode 100644 index 0000000..ed7998d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionNameDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class FunctionNameDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = false; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.FunctionName, name, node, null); + } +} +exports.FunctionNameDefinition = FunctionNameDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts.map new file mode 100644 index 0000000..c17e848 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImplicitGlobalVariableDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/ImplicitGlobalVariableDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,gCAAiC,SAAQ,cAAc,CAClE,cAAc,CAAC,sBAAsB,EACrC,QAAQ,CAAC,IAAI,EACb,IAAI,EACJ,QAAQ,CAAC,WAAW,CACrB;IACC,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;gBAG1C,IAAI,EAAE,QAAQ,CAAC,WAAW,EAC1B,IAAI,EAAE,gCAAgC,CAAC,MAAM,CAAC;CAIjD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js new file mode 100644 index 0000000..f48182d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImplicitGlobalVariableDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class ImplicitGlobalVariableDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = false; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.ImplicitGlobalVariable, name, node, null); + } +} +exports.ImplicitGlobalVariableDefinition = ImplicitGlobalVariableDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts.map new file mode 100644 index 0000000..25ac83b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportBindingDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/ImportBindingDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,uBAAwB,SAAQ,cAAc,CACzD,cAAc,CAAC,aAAa,EAC1B,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,wBAAwB,GACjC,QAAQ,CAAC,eAAe,GACxB,QAAQ,CAAC,yBAAyB,EACpC,QAAQ,CAAC,iBAAiB,GAAG,QAAQ,CAAC,yBAAyB,EAC/D,QAAQ,CAAC,UAAU,CACpB;IACC,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;gBAG1C,IAAI,EAAE,QAAQ,CAAC,UAAU,EACzB,IAAI,EAAE,QAAQ,CAAC,yBAAyB,EACxC,IAAI,EAAE,QAAQ,CAAC,yBAAyB;gBAGxC,IAAI,EAAE,QAAQ,CAAC,UAAU,EACzB,IAAI,EAAE,OAAO,CACX,uBAAuB,CAAC,MAAM,CAAC,EAC/B,QAAQ,CAAC,yBAAyB,CACnC,EACD,IAAI,EAAE,QAAQ,CAAC,iBAAiB;CASnC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js new file mode 100644 index 0000000..e5407f3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportBindingDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class ImportBindingDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node, decl) { + super(DefinitionType_1.DefinitionType.ImportBinding, name, node, decl); + } +} +exports.ImportBindingDefinition = ImportBindingDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts.map new file mode 100644 index 0000000..bcdbf7b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/ParameterDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,mBAAoB,SAAQ,cAAc,CACrD,cAAc,CAAC,SAAS,EACtB,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,+BAA+B,GACxC,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,6BAA6B,GACtC,QAAQ,CAAC,cAAc,GACvB,QAAQ,CAAC,iBAAiB,EAC5B,IAAI,EACJ,QAAQ,CAAC,WAAW,CACrB;IACC;;OAEG;IACH,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;IAC5C,SAAgB,IAAI,EAAE,OAAO,CAAC;gBAG5B,IAAI,EAAE,QAAQ,CAAC,WAAW,EAC1B,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,EACjC,IAAI,EAAE,OAAO;CAKhB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js new file mode 100644 index 0000000..81a4895 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParameterDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class ParameterDefinition extends DefinitionBase_1.DefinitionBase { + /** + * Whether the parameter definition is a part of a rest parameter. + */ + isTypeDefinition = false; + isVariableDefinition = true; + rest; + constructor(name, node, rest) { + super(DefinitionType_1.DefinitionType.Parameter, name, node, null); + this.rest = rest; + } +} +exports.ParameterDefinition = ParameterDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts.map new file mode 100644 index 0000000..86e58b8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumMemberDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/TSEnumMemberDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,sBAAuB,SAAQ,cAAc,CACxD,cAAc,CAAC,YAAY,EAC3B,QAAQ,CAAC,YAAY,EACrB,IAAI,EACJ,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,CAC7C;IACC,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;gBAG1C,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,EAClD,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;CAIvC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js new file mode 100644 index 0000000..c6da190 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumMemberDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class TSEnumMemberDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSEnumMember, name, node, null); + } +} +exports.TSEnumMemberDefinition = TSEnumMemberDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts.map new file mode 100644 index 0000000..2687ea2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumNameDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/TSEnumNameDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,oBAAqB,SAAQ,cAAc,CACtD,cAAc,CAAC,UAAU,EACzB,QAAQ,CAAC,iBAAiB,EAC1B,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;IACC,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;gBAEhC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC;CAG1E"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js new file mode 100644 index 0000000..d5453d2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumNameDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class TSEnumNameDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSEnumName, name, node, null); + } +} +exports.TSEnumNameDefinition = TSEnumNameDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts.map new file mode 100644 index 0000000..da41487 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSModuleNameDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/TSModuleNameDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,sBAAuB,SAAQ,cAAc,CACxD,cAAc,CAAC,YAAY,EAC3B,QAAQ,CAAC,mBAAmB,EAC5B,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;IACC,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;gBAEhC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;CAG5E"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js new file mode 100644 index 0000000..93fb847 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSModuleNameDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class TSModuleNameDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSModuleName, name, node, null); + } +} +exports.TSModuleNameDefinition = TSModuleNameDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts.map new file mode 100644 index 0000000..d780386 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/TypeDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,cAAe,SAAQ,cAAc,CAChD,cAAc,CAAC,IAAI,EACjB,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,YAAY,GACrB,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,eAAe,EAC1B,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;IACC,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,SAAS;gBAEjC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;CAGpE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js new file mode 100644 index 0000000..2966fde --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class TypeDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = false; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.Type, name, node, null); + } +} +exports.TypeDefinition = TypeDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts.map new file mode 100644 index 0000000..7957c3f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"VariableDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/VariableDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,kBAAmB,SAAQ,cAAc,CACpD,cAAc,CAAC,QAAQ,EACvB,QAAQ,CAAC,kBAAkB,EAC3B,QAAQ,CAAC,mBAAmB,EAC5B,QAAQ,CAAC,UAAU,CACpB;IACC,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;gBAG1C,IAAI,EAAE,QAAQ,CAAC,UAAU,EACzB,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,EAChC,IAAI,EAAE,QAAQ,CAAC,mBAAmB;CAIrC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js new file mode 100644 index 0000000..fc30f83 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariableDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class VariableDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = false; + isVariableDefinition = true; + constructor(name, node, decl) { + super(DefinitionType_1.DefinitionType.Variable, name, node, decl); + } +} +exports.VariableDefinition = VariableDefinition; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts.map new file mode 100644 index 0000000..dfd43be --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js new file mode 100644 index 0000000..67fad66 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js @@ -0,0 +1,29 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./CatchClauseDefinition"), exports); +__exportStar(require("./ClassNameDefinition"), exports); +__exportStar(require("./Definition"), exports); +__exportStar(require("./DefinitionType"), exports); +__exportStar(require("./FunctionNameDefinition"), exports); +__exportStar(require("./ImplicitGlobalVariableDefinition"), exports); +__exportStar(require("./ImportBindingDefinition"), exports); +__exportStar(require("./ParameterDefinition"), exports); +__exportStar(require("./TSEnumMemberDefinition"), exports); +__exportStar(require("./TSEnumNameDefinition"), exports); +__exportStar(require("./TSModuleNameDefinition"), exports); +__exportStar(require("./TypeDefinition"), exports); +__exportStar(require("./VariableDefinition"), exports); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts.map new file mode 100644 index 0000000..dd3d554 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/index.js b/node_modules/@typescript-eslint/scope-manager/dist/index.js new file mode 100644 index 0000000..3ecc7a3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/index.js @@ -0,0 +1,30 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeManager = exports.Visitor = exports.Reference = exports.PatternVisitor = exports.analyze = void 0; +var analyze_1 = require("./analyze"); +Object.defineProperty(exports, "analyze", { enumerable: true, get: function () { return analyze_1.analyze; } }); +__exportStar(require("./definition"), exports); +var PatternVisitor_1 = require("./referencer/PatternVisitor"); +Object.defineProperty(exports, "PatternVisitor", { enumerable: true, get: function () { return PatternVisitor_1.PatternVisitor; } }); +var Reference_1 = require("./referencer/Reference"); +Object.defineProperty(exports, "Reference", { enumerable: true, get: function () { return Reference_1.Reference; } }); +var Visitor_1 = require("./referencer/Visitor"); +Object.defineProperty(exports, "Visitor", { enumerable: true, get: function () { return Visitor_1.Visitor; } }); +__exportStar(require("./scope"), exports); +var ScopeManager_1 = require("./ScopeManager"); +Object.defineProperty(exports, "ScopeManager", { enumerable: true, get: function () { return ScopeManager_1.ScopeManager; } }); +__exportStar(require("./variable"), exports); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts.map new file mode 100644 index 0000000..632981a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../src/lib/base-config.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI;;;;EAIf,CAAC;AACH,eAAO,MAAM,KAAK;;;;EAIhB,CAAC;AACH,eAAO,MAAM,UAAU;;;;EAIrB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.js new file mode 100644 index 0000000..52febf4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.js @@ -0,0 +1,22 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TYPE_VALUE = exports.VALUE = exports.TYPE = void 0; +exports.TYPE = Object.freeze({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, +}); +exports.VALUE = Object.freeze({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: false, + isValueVariable: true, +}); +exports.TYPE_VALUE = Object.freeze({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, +}); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.d.ts.map new file mode 100644 index 0000000..7135f0a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/lib/decorators.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,UAAU,EAAE,aAgBxB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.js new file mode 100644 index 0000000..4b8c452 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.js @@ -0,0 +1,25 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decorators = void 0; +const base_config_1 = require("./base-config"); +exports.decorators = { + libs: [], + variables: [ + ['ClassMemberDecoratorContext', base_config_1.TYPE], + ['DecoratorContext', base_config_1.TYPE], + ['DecoratorMetadataObject', base_config_1.TYPE], + ['DecoratorMetadata', base_config_1.TYPE], + ['ClassDecoratorContext', base_config_1.TYPE], + ['ClassMethodDecoratorContext', base_config_1.TYPE], + ['ClassGetterDecoratorContext', base_config_1.TYPE], + ['ClassSetterDecoratorContext', base_config_1.TYPE], + ['ClassAccessorDecoratorContext', base_config_1.TYPE], + ['ClassAccessorDecoratorTarget', base_config_1.TYPE], + ['ClassAccessorDecoratorResult', base_config_1.TYPE], + ['ClassFieldDecoratorContext', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.d.ts.map new file mode 100644 index 0000000..3da556a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decorators.legacy.d.ts","sourceRoot":"","sources":["../../src/lib/decorators.legacy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,iBAAiB,EAAE,aAQ/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.js new file mode 100644 index 0000000..c6c196d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decorators_legacy = void 0; +const base_config_1 = require("./base-config"); +exports.decorators_legacy = { + libs: [], + variables: [ + ['ClassDecorator', base_config_1.TYPE], + ['PropertyDecorator', base_config_1.TYPE], + ['MethodDecorator', base_config_1.TYPE], + ['ParameterDecorator', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.d.ts.map new file mode 100644 index 0000000..2af9e90 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.asynciterable.d.ts","sourceRoot":"","sources":["../../src/lib/dom.asynciterable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,iBAAiB,EAAE,aAQ/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.js new file mode 100644 index 0000000..29fb89d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dom_asynciterable = void 0; +const base_config_1 = require("./base-config"); +exports.dom_asynciterable = { + libs: [], + variables: [ + ['FileSystemDirectoryHandleAsyncIterator', base_config_1.TYPE], + ['FileSystemDirectoryHandle', base_config_1.TYPE], + ['ReadableStreamAsyncIterator', base_config_1.TYPE], + ['ReadableStream', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map new file mode 100644 index 0000000..9d459fe --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/lib/dom.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,GAAG,EAAE,aAy+CjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map new file mode 100644 index 0000000..47fdbd4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.iterable.d.ts","sourceRoot":"","sources":["../../src/lib/dom.iterable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,YAAY,EAAE,aA8E1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js new file mode 100644 index 0000000..2f8b9d6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js @@ -0,0 +1,87 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dom_iterable = void 0; +const base_config_1 = require("./base-config"); +exports.dom_iterable = { + libs: [], + variables: [ + ['AudioParam', base_config_1.TYPE], + ['AudioParamMap', base_config_1.TYPE], + ['BaseAudioContext', base_config_1.TYPE], + ['CSSKeyframesRule', base_config_1.TYPE], + ['CSSNumericArray', base_config_1.TYPE], + ['CSSRuleList', base_config_1.TYPE], + ['CSSStyleDeclaration', base_config_1.TYPE], + ['CSSTransformValue', base_config_1.TYPE], + ['CSSUnparsedValue', base_config_1.TYPE], + ['Cache', base_config_1.TYPE], + ['CanvasPath', base_config_1.TYPE], + ['CanvasPathDrawingStyles', base_config_1.TYPE], + ['CustomStateSet', base_config_1.TYPE], + ['DOMRectList', base_config_1.TYPE], + ['DOMStringList', base_config_1.TYPE], + ['DOMTokenList', base_config_1.TYPE], + ['DataTransferItemList', base_config_1.TYPE], + ['EventCounts', base_config_1.TYPE], + ['FileList', base_config_1.TYPE], + ['FontFaceSet', base_config_1.TYPE], + ['FormDataIterator', base_config_1.TYPE], + ['FormData', base_config_1.TYPE], + ['HTMLAllCollection', base_config_1.TYPE], + ['HTMLCollectionBase', base_config_1.TYPE], + ['HTMLCollectionOf', base_config_1.TYPE], + ['HTMLFormElement', base_config_1.TYPE], + ['HTMLSelectElement', base_config_1.TYPE], + ['HeadersIterator', base_config_1.TYPE], + ['Headers', base_config_1.TYPE], + ['Highlight', base_config_1.TYPE], + ['HighlightRegistry', base_config_1.TYPE], + ['IDBDatabase', base_config_1.TYPE], + ['IDBObjectStore', base_config_1.TYPE], + ['ImageTrackList', base_config_1.TYPE], + ['MIDIInputMap', base_config_1.TYPE], + ['MIDIOutput', base_config_1.TYPE], + ['MIDIOutputMap', base_config_1.TYPE], + ['MediaKeyStatusMapIterator', base_config_1.TYPE], + ['MediaKeyStatusMap', base_config_1.TYPE], + ['MediaList', base_config_1.TYPE], + ['MessageEvent', base_config_1.TYPE], + ['MimeTypeArray', base_config_1.TYPE], + ['NamedNodeMap', base_config_1.TYPE], + ['Navigator', base_config_1.TYPE], + ['NodeList', base_config_1.TYPE], + ['NodeListOf', base_config_1.TYPE], + ['Plugin', base_config_1.TYPE], + ['PluginArray', base_config_1.TYPE], + ['RTCRtpTransceiver', base_config_1.TYPE], + ['RTCStatsReport', base_config_1.TYPE], + ['SVGLengthList', base_config_1.TYPE], + ['SVGNumberList', base_config_1.TYPE], + ['SVGPointList', base_config_1.TYPE], + ['SVGStringList', base_config_1.TYPE], + ['SVGTransformList', base_config_1.TYPE], + ['SourceBufferList', base_config_1.TYPE], + ['SpeechRecognitionResult', base_config_1.TYPE], + ['SpeechRecognitionResultList', base_config_1.TYPE], + ['StylePropertyMapReadOnlyIterator', base_config_1.TYPE], + ['StylePropertyMapReadOnly', base_config_1.TYPE], + ['StyleSheetList', base_config_1.TYPE], + ['SubtleCrypto', base_config_1.TYPE], + ['TextTrackCueList', base_config_1.TYPE], + ['TextTrackList', base_config_1.TYPE], + ['TouchList', base_config_1.TYPE], + ['URLSearchParamsIterator', base_config_1.TYPE], + ['URLSearchParams', base_config_1.TYPE], + ['ViewTransitionTypeSet', base_config_1.TYPE], + ['WEBGL_draw_buffers', base_config_1.TYPE], + ['WEBGL_multi_draw', base_config_1.TYPE], + ['WebGL2RenderingContextBase', base_config_1.TYPE], + ['WebGL2RenderingContextOverloads', base_config_1.TYPE], + ['WebGLRenderingContextBase', base_config_1.TYPE], + ['WebGLRenderingContextOverloads', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js new file mode 100644 index 0000000..0997d6a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js @@ -0,0 +1,1522 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dom = void 0; +const base_config_1 = require("./base-config"); +exports.dom = { + libs: [], + variables: [ + ['AddEventListenerOptions', base_config_1.TYPE], + ['AddressErrors', base_config_1.TYPE], + ['AesCbcParams', base_config_1.TYPE], + ['AesCtrParams', base_config_1.TYPE], + ['AesDerivedKeyParams', base_config_1.TYPE], + ['AesGcmParams', base_config_1.TYPE], + ['AesKeyAlgorithm', base_config_1.TYPE], + ['AesKeyGenParams', base_config_1.TYPE], + ['Algorithm', base_config_1.TYPE], + ['AnalyserOptions', base_config_1.TYPE], + ['AnimationEventInit', base_config_1.TYPE], + ['AnimationPlaybackEventInit', base_config_1.TYPE], + ['AssignedNodesOptions', base_config_1.TYPE], + ['AudioBufferOptions', base_config_1.TYPE], + ['AudioBufferSourceOptions', base_config_1.TYPE], + ['AudioConfiguration', base_config_1.TYPE], + ['AudioContextOptions', base_config_1.TYPE], + ['AudioDataCopyToOptions', base_config_1.TYPE], + ['AudioDataInit', base_config_1.TYPE], + ['AudioDecoderConfig', base_config_1.TYPE], + ['AudioDecoderInit', base_config_1.TYPE], + ['AudioDecoderSupport', base_config_1.TYPE], + ['AudioEncoderConfig', base_config_1.TYPE], + ['AudioEncoderInit', base_config_1.TYPE], + ['AudioEncoderSupport', base_config_1.TYPE], + ['AudioNodeOptions', base_config_1.TYPE], + ['AudioProcessingEventInit', base_config_1.TYPE], + ['AudioTimestamp', base_config_1.TYPE], + ['AudioWorkletNodeOptions', base_config_1.TYPE], + ['AuthenticationExtensionsClientInputs', base_config_1.TYPE], + ['AuthenticationExtensionsClientInputsJSON', base_config_1.TYPE], + ['AuthenticationExtensionsClientOutputs', base_config_1.TYPE], + ['AuthenticationExtensionsPRFInputs', base_config_1.TYPE], + ['AuthenticationExtensionsPRFOutputs', base_config_1.TYPE], + ['AuthenticationExtensionsPRFValues', base_config_1.TYPE], + ['AuthenticatorSelectionCriteria', base_config_1.TYPE], + ['AvcEncoderConfig', base_config_1.TYPE], + ['BiquadFilterOptions', base_config_1.TYPE], + ['BlobEventInit', base_config_1.TYPE], + ['BlobPropertyBag', base_config_1.TYPE], + ['CSSMatrixComponentOptions', base_config_1.TYPE], + ['CSSNumericType', base_config_1.TYPE], + ['CSSStyleSheetInit', base_config_1.TYPE], + ['CacheQueryOptions', base_config_1.TYPE], + ['CanvasRenderingContext2DSettings', base_config_1.TYPE], + ['CaretPositionFromPointOptions', base_config_1.TYPE], + ['ChannelMergerOptions', base_config_1.TYPE], + ['ChannelSplitterOptions', base_config_1.TYPE], + ['CheckVisibilityOptions', base_config_1.TYPE], + ['ClientQueryOptions', base_config_1.TYPE], + ['ClipboardEventInit', base_config_1.TYPE], + ['ClipboardItemOptions', base_config_1.TYPE], + ['CloseEventInit', base_config_1.TYPE], + ['CompositionEventInit', base_config_1.TYPE], + ['ComputedEffectTiming', base_config_1.TYPE], + ['ComputedKeyframe', base_config_1.TYPE], + ['ConstantSourceOptions', base_config_1.TYPE], + ['ConstrainBooleanParameters', base_config_1.TYPE], + ['ConstrainDOMStringParameters', base_config_1.TYPE], + ['ConstrainDoubleRange', base_config_1.TYPE], + ['ConstrainULongRange', base_config_1.TYPE], + ['ContentVisibilityAutoStateChangeEventInit', base_config_1.TYPE], + ['ConvolverOptions', base_config_1.TYPE], + ['CredentialCreationOptions', base_config_1.TYPE], + ['CredentialPropertiesOutput', base_config_1.TYPE], + ['CredentialRequestOptions', base_config_1.TYPE], + ['CryptoKeyPair', base_config_1.TYPE], + ['CustomEventInit', base_config_1.TYPE], + ['DOMMatrix2DInit', base_config_1.TYPE], + ['DOMMatrixInit', base_config_1.TYPE], + ['DOMPointInit', base_config_1.TYPE], + ['DOMQuadInit', base_config_1.TYPE], + ['DOMRectInit', base_config_1.TYPE], + ['DelayOptions', base_config_1.TYPE], + ['DeviceMotionEventAccelerationInit', base_config_1.TYPE], + ['DeviceMotionEventInit', base_config_1.TYPE], + ['DeviceMotionEventRotationRateInit', base_config_1.TYPE], + ['DeviceOrientationEventInit', base_config_1.TYPE], + ['DisplayMediaStreamOptions', base_config_1.TYPE], + ['DocumentTimelineOptions', base_config_1.TYPE], + ['DoubleRange', base_config_1.TYPE], + ['DragEventInit', base_config_1.TYPE], + ['DynamicsCompressorOptions', base_config_1.TYPE], + ['EcKeyAlgorithm', base_config_1.TYPE], + ['EcKeyGenParams', base_config_1.TYPE], + ['EcKeyImportParams', base_config_1.TYPE], + ['EcdhKeyDeriveParams', base_config_1.TYPE], + ['EcdsaParams', base_config_1.TYPE], + ['EffectTiming', base_config_1.TYPE], + ['ElementCreationOptions', base_config_1.TYPE], + ['ElementDefinitionOptions', base_config_1.TYPE], + ['EncodedAudioChunkInit', base_config_1.TYPE], + ['EncodedAudioChunkMetadata', base_config_1.TYPE], + ['EncodedVideoChunkInit', base_config_1.TYPE], + ['EncodedVideoChunkMetadata', base_config_1.TYPE], + ['ErrorEventInit', base_config_1.TYPE], + ['EventInit', base_config_1.TYPE], + ['EventListenerOptions', base_config_1.TYPE], + ['EventModifierInit', base_config_1.TYPE], + ['EventSourceInit', base_config_1.TYPE], + ['FilePropertyBag', base_config_1.TYPE], + ['FileSystemCreateWritableOptions', base_config_1.TYPE], + ['FileSystemFlags', base_config_1.TYPE], + ['FileSystemGetDirectoryOptions', base_config_1.TYPE], + ['FileSystemGetFileOptions', base_config_1.TYPE], + ['FileSystemRemoveOptions', base_config_1.TYPE], + ['FocusEventInit', base_config_1.TYPE], + ['FocusOptions', base_config_1.TYPE], + ['FontFaceDescriptors', base_config_1.TYPE], + ['FontFaceSetLoadEventInit', base_config_1.TYPE], + ['FormDataEventInit', base_config_1.TYPE], + ['FullscreenOptions', base_config_1.TYPE], + ['GainOptions', base_config_1.TYPE], + ['GamepadEffectParameters', base_config_1.TYPE], + ['GamepadEventInit', base_config_1.TYPE], + ['GetAnimationsOptions', base_config_1.TYPE], + ['GetHTMLOptions', base_config_1.TYPE], + ['GetNotificationOptions', base_config_1.TYPE], + ['GetRootNodeOptions', base_config_1.TYPE], + ['HashChangeEventInit', base_config_1.TYPE], + ['HkdfParams', base_config_1.TYPE], + ['HmacImportParams', base_config_1.TYPE], + ['HmacKeyAlgorithm', base_config_1.TYPE], + ['HmacKeyGenParams', base_config_1.TYPE], + ['IDBDatabaseInfo', base_config_1.TYPE], + ['IDBIndexParameters', base_config_1.TYPE], + ['IDBObjectStoreParameters', base_config_1.TYPE], + ['IDBTransactionOptions', base_config_1.TYPE], + ['IDBVersionChangeEventInit', base_config_1.TYPE], + ['IIRFilterOptions', base_config_1.TYPE], + ['IdleRequestOptions', base_config_1.TYPE], + ['ImageBitmapOptions', base_config_1.TYPE], + ['ImageBitmapRenderingContextSettings', base_config_1.TYPE], + ['ImageDataSettings', base_config_1.TYPE], + ['ImageDecodeOptions', base_config_1.TYPE], + ['ImageDecodeResult', base_config_1.TYPE], + ['ImageDecoderInit', base_config_1.TYPE], + ['ImageEncodeOptions', base_config_1.TYPE], + ['InputEventInit', base_config_1.TYPE], + ['IntersectionObserverInit', base_config_1.TYPE], + ['JsonWebKey', base_config_1.TYPE], + ['KeyAlgorithm', base_config_1.TYPE], + ['KeyboardEventInit', base_config_1.TYPE], + ['Keyframe', base_config_1.TYPE], + ['KeyframeAnimationOptions', base_config_1.TYPE], + ['KeyframeEffectOptions', base_config_1.TYPE], + ['LockInfo', base_config_1.TYPE], + ['LockManagerSnapshot', base_config_1.TYPE], + ['LockOptions', base_config_1.TYPE], + ['MIDIConnectionEventInit', base_config_1.TYPE], + ['MIDIMessageEventInit', base_config_1.TYPE], + ['MIDIOptions', base_config_1.TYPE], + ['MediaCapabilitiesDecodingInfo', base_config_1.TYPE], + ['MediaCapabilitiesEncodingInfo', base_config_1.TYPE], + ['MediaCapabilitiesInfo', base_config_1.TYPE], + ['MediaConfiguration', base_config_1.TYPE], + ['MediaDecodingConfiguration', base_config_1.TYPE], + ['MediaElementAudioSourceOptions', base_config_1.TYPE], + ['MediaEncodingConfiguration', base_config_1.TYPE], + ['MediaEncryptedEventInit', base_config_1.TYPE], + ['MediaImage', base_config_1.TYPE], + ['MediaKeyMessageEventInit', base_config_1.TYPE], + ['MediaKeySystemConfiguration', base_config_1.TYPE], + ['MediaKeySystemMediaCapability', base_config_1.TYPE], + ['MediaKeysPolicy', base_config_1.TYPE], + ['MediaMetadataInit', base_config_1.TYPE], + ['MediaPositionState', base_config_1.TYPE], + ['MediaQueryListEventInit', base_config_1.TYPE], + ['MediaRecorderOptions', base_config_1.TYPE], + ['MediaSessionActionDetails', base_config_1.TYPE], + ['MediaStreamAudioSourceOptions', base_config_1.TYPE], + ['MediaStreamConstraints', base_config_1.TYPE], + ['MediaStreamTrackEventInit', base_config_1.TYPE], + ['MediaTrackCapabilities', base_config_1.TYPE], + ['MediaTrackConstraintSet', base_config_1.TYPE], + ['MediaTrackConstraints', base_config_1.TYPE], + ['MediaTrackSettings', base_config_1.TYPE], + ['MediaTrackSupportedConstraints', base_config_1.TYPE], + ['MessageEventInit', base_config_1.TYPE], + ['MouseEventInit', base_config_1.TYPE], + ['MultiCacheQueryOptions', base_config_1.TYPE], + ['MutationObserverInit', base_config_1.TYPE], + ['NavigationPreloadState', base_config_1.TYPE], + ['NotificationOptions', base_config_1.TYPE], + ['OfflineAudioCompletionEventInit', base_config_1.TYPE], + ['OfflineAudioContextOptions', base_config_1.TYPE], + ['OptionalEffectTiming', base_config_1.TYPE], + ['OpusEncoderConfig', base_config_1.TYPE], + ['OscillatorOptions', base_config_1.TYPE], + ['PageRevealEventInit', base_config_1.TYPE], + ['PageSwapEventInit', base_config_1.TYPE], + ['PageTransitionEventInit', base_config_1.TYPE], + ['PannerOptions', base_config_1.TYPE], + ['PayerErrors', base_config_1.TYPE], + ['PaymentCurrencyAmount', base_config_1.TYPE], + ['PaymentDetailsBase', base_config_1.TYPE], + ['PaymentDetailsInit', base_config_1.TYPE], + ['PaymentDetailsModifier', base_config_1.TYPE], + ['PaymentDetailsUpdate', base_config_1.TYPE], + ['PaymentItem', base_config_1.TYPE], + ['PaymentMethodChangeEventInit', base_config_1.TYPE], + ['PaymentMethodData', base_config_1.TYPE], + ['PaymentOptions', base_config_1.TYPE], + ['PaymentRequestUpdateEventInit', base_config_1.TYPE], + ['PaymentShippingOption', base_config_1.TYPE], + ['PaymentValidationErrors', base_config_1.TYPE], + ['Pbkdf2Params', base_config_1.TYPE], + ['PerformanceMarkOptions', base_config_1.TYPE], + ['PerformanceMeasureOptions', base_config_1.TYPE], + ['PerformanceObserverInit', base_config_1.TYPE], + ['PeriodicWaveConstraints', base_config_1.TYPE], + ['PeriodicWaveOptions', base_config_1.TYPE], + ['PermissionDescriptor', base_config_1.TYPE], + ['PictureInPictureEventInit', base_config_1.TYPE], + ['PlaneLayout', base_config_1.TYPE], + ['PointerEventInit', base_config_1.TYPE], + ['PointerLockOptions', base_config_1.TYPE], + ['PopStateEventInit', base_config_1.TYPE], + ['PositionOptions', base_config_1.TYPE], + ['ProgressEventInit', base_config_1.TYPE], + ['PromiseRejectionEventInit', base_config_1.TYPE], + ['PropertyDefinition', base_config_1.TYPE], + ['PropertyIndexedKeyframes', base_config_1.TYPE], + ['PublicKeyCredentialCreationOptions', base_config_1.TYPE], + ['PublicKeyCredentialCreationOptionsJSON', base_config_1.TYPE], + ['PublicKeyCredentialDescriptor', base_config_1.TYPE], + ['PublicKeyCredentialDescriptorJSON', base_config_1.TYPE], + ['PublicKeyCredentialEntity', base_config_1.TYPE], + ['PublicKeyCredentialParameters', base_config_1.TYPE], + ['PublicKeyCredentialRequestOptions', base_config_1.TYPE], + ['PublicKeyCredentialRequestOptionsJSON', base_config_1.TYPE], + ['PublicKeyCredentialRpEntity', base_config_1.TYPE], + ['PublicKeyCredentialUserEntity', base_config_1.TYPE], + ['PublicKeyCredentialUserEntityJSON', base_config_1.TYPE], + ['PushSubscriptionJSON', base_config_1.TYPE], + ['PushSubscriptionOptionsInit', base_config_1.TYPE], + ['QueuingStrategy', base_config_1.TYPE], + ['QueuingStrategyInit', base_config_1.TYPE], + ['RTCAnswerOptions', base_config_1.TYPE], + ['RTCCertificateExpiration', base_config_1.TYPE], + ['RTCConfiguration', base_config_1.TYPE], + ['RTCDTMFToneChangeEventInit', base_config_1.TYPE], + ['RTCDataChannelEventInit', base_config_1.TYPE], + ['RTCDataChannelInit', base_config_1.TYPE], + ['RTCDtlsFingerprint', base_config_1.TYPE], + ['RTCEncodedAudioFrameMetadata', base_config_1.TYPE], + ['RTCEncodedVideoFrameMetadata', base_config_1.TYPE], + ['RTCErrorEventInit', base_config_1.TYPE], + ['RTCErrorInit', base_config_1.TYPE], + ['RTCIceCandidateInit', base_config_1.TYPE], + ['RTCIceCandidatePairStats', base_config_1.TYPE], + ['RTCIceServer', base_config_1.TYPE], + ['RTCInboundRtpStreamStats', base_config_1.TYPE], + ['RTCLocalSessionDescriptionInit', base_config_1.TYPE], + ['RTCOfferAnswerOptions', base_config_1.TYPE], + ['RTCOfferOptions', base_config_1.TYPE], + ['RTCOutboundRtpStreamStats', base_config_1.TYPE], + ['RTCPeerConnectionIceErrorEventInit', base_config_1.TYPE], + ['RTCPeerConnectionIceEventInit', base_config_1.TYPE], + ['RTCReceivedRtpStreamStats', base_config_1.TYPE], + ['RTCRtcpParameters', base_config_1.TYPE], + ['RTCRtpCapabilities', base_config_1.TYPE], + ['RTCRtpCodec', base_config_1.TYPE], + ['RTCRtpCodecParameters', base_config_1.TYPE], + ['RTCRtpCodingParameters', base_config_1.TYPE], + ['RTCRtpContributingSource', base_config_1.TYPE], + ['RTCRtpEncodingParameters', base_config_1.TYPE], + ['RTCRtpHeaderExtensionCapability', base_config_1.TYPE], + ['RTCRtpHeaderExtensionParameters', base_config_1.TYPE], + ['RTCRtpParameters', base_config_1.TYPE], + ['RTCRtpReceiveParameters', base_config_1.TYPE], + ['RTCRtpSendParameters', base_config_1.TYPE], + ['RTCRtpStreamStats', base_config_1.TYPE], + ['RTCRtpSynchronizationSource', base_config_1.TYPE], + ['RTCRtpTransceiverInit', base_config_1.TYPE], + ['RTCSentRtpStreamStats', base_config_1.TYPE], + ['RTCSessionDescriptionInit', base_config_1.TYPE], + ['RTCSetParameterOptions', base_config_1.TYPE], + ['RTCStats', base_config_1.TYPE], + ['RTCTrackEventInit', base_config_1.TYPE], + ['RTCTransportStats', base_config_1.TYPE], + ['ReadableStreamGetReaderOptions', base_config_1.TYPE], + ['ReadableStreamIteratorOptions', base_config_1.TYPE], + ['ReadableStreamReadDoneResult', base_config_1.TYPE], + ['ReadableStreamReadValueResult', base_config_1.TYPE], + ['ReadableWritablePair', base_config_1.TYPE], + ['RegistrationOptions', base_config_1.TYPE], + ['ReportingObserverOptions', base_config_1.TYPE], + ['RequestInit', base_config_1.TYPE], + ['ResizeObserverOptions', base_config_1.TYPE], + ['ResponseInit', base_config_1.TYPE], + ['RsaHashedImportParams', base_config_1.TYPE], + ['RsaHashedKeyAlgorithm', base_config_1.TYPE], + ['RsaHashedKeyGenParams', base_config_1.TYPE], + ['RsaKeyAlgorithm', base_config_1.TYPE], + ['RsaKeyGenParams', base_config_1.TYPE], + ['RsaOaepParams', base_config_1.TYPE], + ['RsaOtherPrimesInfo', base_config_1.TYPE], + ['RsaPssParams', base_config_1.TYPE], + ['SVGBoundingBoxOptions', base_config_1.TYPE], + ['ScrollIntoViewOptions', base_config_1.TYPE], + ['ScrollOptions', base_config_1.TYPE], + ['ScrollToOptions', base_config_1.TYPE], + ['SecurityPolicyViolationEventInit', base_config_1.TYPE], + ['ShadowRootInit', base_config_1.TYPE], + ['ShareData', base_config_1.TYPE], + ['SpeechSynthesisErrorEventInit', base_config_1.TYPE], + ['SpeechSynthesisEventInit', base_config_1.TYPE], + ['StaticRangeInit', base_config_1.TYPE], + ['StereoPannerOptions', base_config_1.TYPE], + ['StorageEstimate', base_config_1.TYPE], + ['StorageEventInit', base_config_1.TYPE], + ['StreamPipeOptions', base_config_1.TYPE], + ['StructuredSerializeOptions', base_config_1.TYPE], + ['SubmitEventInit', base_config_1.TYPE], + ['TextDecodeOptions', base_config_1.TYPE], + ['TextDecoderOptions', base_config_1.TYPE], + ['TextEncoderEncodeIntoResult', base_config_1.TYPE], + ['ToggleEventInit', base_config_1.TYPE], + ['TouchEventInit', base_config_1.TYPE], + ['TouchInit', base_config_1.TYPE], + ['TrackEventInit', base_config_1.TYPE], + ['Transformer', base_config_1.TYPE], + ['TransitionEventInit', base_config_1.TYPE], + ['UIEventInit', base_config_1.TYPE], + ['ULongRange', base_config_1.TYPE], + ['UnderlyingByteSource', base_config_1.TYPE], + ['UnderlyingDefaultSource', base_config_1.TYPE], + ['UnderlyingSink', base_config_1.TYPE], + ['UnderlyingSource', base_config_1.TYPE], + ['ValidityStateFlags', base_config_1.TYPE], + ['VideoColorSpaceInit', base_config_1.TYPE], + ['VideoConfiguration', base_config_1.TYPE], + ['VideoDecoderConfig', base_config_1.TYPE], + ['VideoDecoderInit', base_config_1.TYPE], + ['VideoDecoderSupport', base_config_1.TYPE], + ['VideoEncoderConfig', base_config_1.TYPE], + ['VideoEncoderEncodeOptions', base_config_1.TYPE], + ['VideoEncoderEncodeOptionsForAvc', base_config_1.TYPE], + ['VideoEncoderInit', base_config_1.TYPE], + ['VideoEncoderSupport', base_config_1.TYPE], + ['VideoFrameBufferInit', base_config_1.TYPE], + ['VideoFrameCallbackMetadata', base_config_1.TYPE], + ['VideoFrameCopyToOptions', base_config_1.TYPE], + ['VideoFrameInit', base_config_1.TYPE], + ['WaveShaperOptions', base_config_1.TYPE], + ['WebGLContextAttributes', base_config_1.TYPE], + ['WebGLContextEventInit', base_config_1.TYPE], + ['WebTransportCloseInfo', base_config_1.TYPE], + ['WebTransportErrorOptions', base_config_1.TYPE], + ['WebTransportHash', base_config_1.TYPE], + ['WebTransportOptions', base_config_1.TYPE], + ['WebTransportSendStreamOptions', base_config_1.TYPE], + ['WheelEventInit', base_config_1.TYPE], + ['WindowPostMessageOptions', base_config_1.TYPE], + ['WorkerOptions', base_config_1.TYPE], + ['WorkletOptions', base_config_1.TYPE], + ['WriteParams', base_config_1.TYPE], + ['NodeFilter', base_config_1.TYPE_VALUE], + ['XPathNSResolver', base_config_1.TYPE], + ['ANGLE_instanced_arrays', base_config_1.TYPE], + ['ARIAMixin', base_config_1.TYPE], + ['AbortController', base_config_1.TYPE_VALUE], + ['AbortSignalEventMap', base_config_1.TYPE], + ['AbortSignal', base_config_1.TYPE_VALUE], + ['AbstractRange', base_config_1.TYPE_VALUE], + ['AbstractWorkerEventMap', base_config_1.TYPE], + ['AbstractWorker', base_config_1.TYPE], + ['AnalyserNode', base_config_1.TYPE_VALUE], + ['Animatable', base_config_1.TYPE], + ['AnimationEventMap', base_config_1.TYPE], + ['Animation', base_config_1.TYPE_VALUE], + ['AnimationEffect', base_config_1.TYPE_VALUE], + ['AnimationEvent', base_config_1.TYPE_VALUE], + ['AnimationFrameProvider', base_config_1.TYPE], + ['AnimationPlaybackEvent', base_config_1.TYPE_VALUE], + ['AnimationTimeline', base_config_1.TYPE_VALUE], + ['Attr', base_config_1.TYPE_VALUE], + ['AudioBuffer', base_config_1.TYPE_VALUE], + ['AudioBufferSourceNode', base_config_1.TYPE_VALUE], + ['AudioContext', base_config_1.TYPE_VALUE], + ['AudioData', base_config_1.TYPE_VALUE], + ['AudioDecoderEventMap', base_config_1.TYPE], + ['AudioDecoder', base_config_1.TYPE_VALUE], + ['AudioDestinationNode', base_config_1.TYPE_VALUE], + ['AudioEncoderEventMap', base_config_1.TYPE], + ['AudioEncoder', base_config_1.TYPE_VALUE], + ['AudioListener', base_config_1.TYPE_VALUE], + ['AudioNode', base_config_1.TYPE_VALUE], + ['AudioParam', base_config_1.TYPE_VALUE], + ['AudioParamMap', base_config_1.TYPE_VALUE], + ['AudioProcessingEvent', base_config_1.TYPE_VALUE], + ['AudioScheduledSourceNodeEventMap', base_config_1.TYPE], + ['AudioScheduledSourceNode', base_config_1.TYPE_VALUE], + ['AudioWorklet', base_config_1.TYPE_VALUE], + ['AudioWorkletNodeEventMap', base_config_1.TYPE], + ['AudioWorkletNode', base_config_1.TYPE_VALUE], + ['AuthenticatorAssertionResponse', base_config_1.TYPE_VALUE], + ['AuthenticatorAttestationResponse', base_config_1.TYPE_VALUE], + ['AuthenticatorResponse', base_config_1.TYPE_VALUE], + ['BarProp', base_config_1.TYPE_VALUE], + ['BaseAudioContextEventMap', base_config_1.TYPE], + ['BaseAudioContext', base_config_1.TYPE_VALUE], + ['BeforeUnloadEvent', base_config_1.TYPE_VALUE], + ['BiquadFilterNode', base_config_1.TYPE_VALUE], + ['Blob', base_config_1.TYPE_VALUE], + ['BlobEvent', base_config_1.TYPE_VALUE], + ['Body', base_config_1.TYPE], + ['BroadcastChannelEventMap', base_config_1.TYPE], + ['BroadcastChannel', base_config_1.TYPE_VALUE], + ['ByteLengthQueuingStrategy', base_config_1.TYPE_VALUE], + ['CDATASection', base_config_1.TYPE_VALUE], + ['CSSAnimation', base_config_1.TYPE_VALUE], + ['CSSConditionRule', base_config_1.TYPE_VALUE], + ['CSSContainerRule', base_config_1.TYPE_VALUE], + ['CSSCounterStyleRule', base_config_1.TYPE_VALUE], + ['CSSFontFaceRule', base_config_1.TYPE_VALUE], + ['CSSFontFeatureValuesRule', base_config_1.TYPE_VALUE], + ['CSSFontPaletteValuesRule', base_config_1.TYPE_VALUE], + ['CSSGroupingRule', base_config_1.TYPE_VALUE], + ['CSSImageValue', base_config_1.TYPE_VALUE], + ['CSSImportRule', base_config_1.TYPE_VALUE], + ['CSSKeyframeRule', base_config_1.TYPE_VALUE], + ['CSSKeyframesRule', base_config_1.TYPE_VALUE], + ['CSSKeywordValue', base_config_1.TYPE_VALUE], + ['CSSLayerBlockRule', base_config_1.TYPE_VALUE], + ['CSSLayerStatementRule', base_config_1.TYPE_VALUE], + ['CSSMathClamp', base_config_1.TYPE_VALUE], + ['CSSMathInvert', base_config_1.TYPE_VALUE], + ['CSSMathMax', base_config_1.TYPE_VALUE], + ['CSSMathMin', base_config_1.TYPE_VALUE], + ['CSSMathNegate', base_config_1.TYPE_VALUE], + ['CSSMathProduct', base_config_1.TYPE_VALUE], + ['CSSMathSum', base_config_1.TYPE_VALUE], + ['CSSMathValue', base_config_1.TYPE_VALUE], + ['CSSMatrixComponent', base_config_1.TYPE_VALUE], + ['CSSMediaRule', base_config_1.TYPE_VALUE], + ['CSSNamespaceRule', base_config_1.TYPE_VALUE], + ['CSSNestedDeclarations', base_config_1.TYPE_VALUE], + ['CSSNumericArray', base_config_1.TYPE_VALUE], + ['CSSNumericValue', base_config_1.TYPE_VALUE], + ['CSSPageRule', base_config_1.TYPE_VALUE], + ['CSSPerspective', base_config_1.TYPE_VALUE], + ['CSSPropertyRule', base_config_1.TYPE_VALUE], + ['CSSRotate', base_config_1.TYPE_VALUE], + ['CSSRule', base_config_1.TYPE_VALUE], + ['CSSRuleList', base_config_1.TYPE_VALUE], + ['CSSScale', base_config_1.TYPE_VALUE], + ['CSSScopeRule', base_config_1.TYPE_VALUE], + ['CSSSkew', base_config_1.TYPE_VALUE], + ['CSSSkewX', base_config_1.TYPE_VALUE], + ['CSSSkewY', base_config_1.TYPE_VALUE], + ['CSSStartingStyleRule', base_config_1.TYPE_VALUE], + ['CSSStyleDeclaration', base_config_1.TYPE_VALUE], + ['CSSStyleRule', base_config_1.TYPE_VALUE], + ['CSSStyleSheet', base_config_1.TYPE_VALUE], + ['CSSStyleValue', base_config_1.TYPE_VALUE], + ['CSSSupportsRule', base_config_1.TYPE_VALUE], + ['CSSTransformComponent', base_config_1.TYPE_VALUE], + ['CSSTransformValue', base_config_1.TYPE_VALUE], + ['CSSTransition', base_config_1.TYPE_VALUE], + ['CSSTranslate', base_config_1.TYPE_VALUE], + ['CSSUnitValue', base_config_1.TYPE_VALUE], + ['CSSUnparsedValue', base_config_1.TYPE_VALUE], + ['CSSVariableReferenceValue', base_config_1.TYPE_VALUE], + ['CSSViewTransitionRule', base_config_1.TYPE_VALUE], + ['Cache', base_config_1.TYPE_VALUE], + ['CacheStorage', base_config_1.TYPE_VALUE], + ['CanvasCaptureMediaStreamTrack', base_config_1.TYPE_VALUE], + ['CanvasCompositing', base_config_1.TYPE], + ['CanvasDrawImage', base_config_1.TYPE], + ['CanvasDrawPath', base_config_1.TYPE], + ['CanvasFillStrokeStyles', base_config_1.TYPE], + ['CanvasFilters', base_config_1.TYPE], + ['CanvasGradient', base_config_1.TYPE_VALUE], + ['CanvasImageData', base_config_1.TYPE], + ['CanvasImageSmoothing', base_config_1.TYPE], + ['CanvasPath', base_config_1.TYPE], + ['CanvasPathDrawingStyles', base_config_1.TYPE], + ['CanvasPattern', base_config_1.TYPE_VALUE], + ['CanvasRect', base_config_1.TYPE], + ['CanvasRenderingContext2D', base_config_1.TYPE_VALUE], + ['CanvasSettings', base_config_1.TYPE], + ['CanvasShadowStyles', base_config_1.TYPE], + ['CanvasState', base_config_1.TYPE], + ['CanvasText', base_config_1.TYPE], + ['CanvasTextDrawingStyles', base_config_1.TYPE], + ['CanvasTransform', base_config_1.TYPE], + ['CanvasUserInterface', base_config_1.TYPE], + ['CaretPosition', base_config_1.TYPE_VALUE], + ['ChannelMergerNode', base_config_1.TYPE_VALUE], + ['ChannelSplitterNode', base_config_1.TYPE_VALUE], + ['CharacterData', base_config_1.TYPE_VALUE], + ['ChildNode', base_config_1.TYPE], + ['ClientRect', base_config_1.TYPE], + ['Clipboard', base_config_1.TYPE_VALUE], + ['ClipboardEvent', base_config_1.TYPE_VALUE], + ['ClipboardItem', base_config_1.TYPE_VALUE], + ['CloseEvent', base_config_1.TYPE_VALUE], + ['Comment', base_config_1.TYPE_VALUE], + ['CompositionEvent', base_config_1.TYPE_VALUE], + ['CompressionStream', base_config_1.TYPE_VALUE], + ['ConstantSourceNode', base_config_1.TYPE_VALUE], + ['ContentVisibilityAutoStateChangeEvent', base_config_1.TYPE_VALUE], + ['ConvolverNode', base_config_1.TYPE_VALUE], + ['CountQueuingStrategy', base_config_1.TYPE_VALUE], + ['Credential', base_config_1.TYPE_VALUE], + ['CredentialsContainer', base_config_1.TYPE_VALUE], + ['Crypto', base_config_1.TYPE_VALUE], + ['CryptoKey', base_config_1.TYPE_VALUE], + ['CustomElementRegistry', base_config_1.TYPE_VALUE], + ['CustomEvent', base_config_1.TYPE_VALUE], + ['CustomStateSet', base_config_1.TYPE_VALUE], + ['DOMException', base_config_1.TYPE_VALUE], + ['DOMImplementation', base_config_1.TYPE_VALUE], + ['DOMMatrix', base_config_1.TYPE_VALUE], + ['SVGMatrix', base_config_1.TYPE_VALUE], + ['WebKitCSSMatrix', base_config_1.TYPE_VALUE], + ['DOMMatrixReadOnly', base_config_1.TYPE_VALUE], + ['DOMParser', base_config_1.TYPE_VALUE], + ['DOMPoint', base_config_1.TYPE_VALUE], + ['SVGPoint', base_config_1.TYPE_VALUE], + ['DOMPointReadOnly', base_config_1.TYPE_VALUE], + ['DOMQuad', base_config_1.TYPE_VALUE], + ['DOMRect', base_config_1.TYPE_VALUE], + ['SVGRect', base_config_1.TYPE_VALUE], + ['DOMRectList', base_config_1.TYPE_VALUE], + ['DOMRectReadOnly', base_config_1.TYPE_VALUE], + ['DOMStringList', base_config_1.TYPE_VALUE], + ['DOMStringMap', base_config_1.TYPE_VALUE], + ['DOMTokenList', base_config_1.TYPE_VALUE], + ['DataTransfer', base_config_1.TYPE_VALUE], + ['DataTransferItem', base_config_1.TYPE_VALUE], + ['DataTransferItemList', base_config_1.TYPE_VALUE], + ['DecompressionStream', base_config_1.TYPE_VALUE], + ['DelayNode', base_config_1.TYPE_VALUE], + ['DeviceMotionEvent', base_config_1.TYPE_VALUE], + ['DeviceMotionEventAcceleration', base_config_1.TYPE], + ['DeviceMotionEventRotationRate', base_config_1.TYPE], + ['DeviceOrientationEvent', base_config_1.TYPE_VALUE], + ['DocumentEventMap', base_config_1.TYPE], + ['Document', base_config_1.TYPE_VALUE], + ['DocumentFragment', base_config_1.TYPE_VALUE], + ['DocumentOrShadowRoot', base_config_1.TYPE], + ['DocumentTimeline', base_config_1.TYPE_VALUE], + ['DocumentType', base_config_1.TYPE_VALUE], + ['DragEvent', base_config_1.TYPE_VALUE], + ['DynamicsCompressorNode', base_config_1.TYPE_VALUE], + ['EXT_blend_minmax', base_config_1.TYPE], + ['EXT_color_buffer_float', base_config_1.TYPE], + ['EXT_color_buffer_half_float', base_config_1.TYPE], + ['EXT_float_blend', base_config_1.TYPE], + ['EXT_frag_depth', base_config_1.TYPE], + ['EXT_sRGB', base_config_1.TYPE], + ['EXT_shader_texture_lod', base_config_1.TYPE], + ['EXT_texture_compression_bptc', base_config_1.TYPE], + ['EXT_texture_compression_rgtc', base_config_1.TYPE], + ['EXT_texture_filter_anisotropic', base_config_1.TYPE], + ['EXT_texture_norm16', base_config_1.TYPE], + ['ElementEventMap', base_config_1.TYPE], + ['Element', base_config_1.TYPE_VALUE], + ['ElementCSSInlineStyle', base_config_1.TYPE], + ['ElementContentEditable', base_config_1.TYPE], + ['ElementInternals', base_config_1.TYPE_VALUE], + ['EncodedAudioChunk', base_config_1.TYPE_VALUE], + ['EncodedVideoChunk', base_config_1.TYPE_VALUE], + ['ErrorEvent', base_config_1.TYPE_VALUE], + ['Event', base_config_1.TYPE_VALUE], + ['EventCounts', base_config_1.TYPE_VALUE], + ['EventListener', base_config_1.TYPE], + ['EventListenerObject', base_config_1.TYPE], + ['EventSourceEventMap', base_config_1.TYPE], + ['EventSource', base_config_1.TYPE_VALUE], + ['EventTarget', base_config_1.TYPE_VALUE], + ['External', base_config_1.TYPE_VALUE], + ['File', base_config_1.TYPE_VALUE], + ['FileList', base_config_1.TYPE_VALUE], + ['FileReaderEventMap', base_config_1.TYPE], + ['FileReader', base_config_1.TYPE_VALUE], + ['FileSystem', base_config_1.TYPE_VALUE], + ['FileSystemDirectoryEntry', base_config_1.TYPE_VALUE], + ['FileSystemDirectoryHandle', base_config_1.TYPE_VALUE], + ['FileSystemDirectoryReader', base_config_1.TYPE_VALUE], + ['FileSystemEntry', base_config_1.TYPE_VALUE], + ['FileSystemFileEntry', base_config_1.TYPE_VALUE], + ['FileSystemFileHandle', base_config_1.TYPE_VALUE], + ['FileSystemHandle', base_config_1.TYPE_VALUE], + ['FileSystemWritableFileStream', base_config_1.TYPE_VALUE], + ['FocusEvent', base_config_1.TYPE_VALUE], + ['FontFace', base_config_1.TYPE_VALUE], + ['FontFaceSetEventMap', base_config_1.TYPE], + ['FontFaceSet', base_config_1.TYPE_VALUE], + ['FontFaceSetLoadEvent', base_config_1.TYPE_VALUE], + ['FontFaceSource', base_config_1.TYPE], + ['FormData', base_config_1.TYPE_VALUE], + ['FormDataEvent', base_config_1.TYPE_VALUE], + ['FragmentDirective', base_config_1.TYPE_VALUE], + ['GPUError', base_config_1.TYPE], + ['GainNode', base_config_1.TYPE_VALUE], + ['Gamepad', base_config_1.TYPE_VALUE], + ['GamepadButton', base_config_1.TYPE_VALUE], + ['GamepadEvent', base_config_1.TYPE_VALUE], + ['GamepadHapticActuator', base_config_1.TYPE_VALUE], + ['GenericTransformStream', base_config_1.TYPE], + ['Geolocation', base_config_1.TYPE_VALUE], + ['GeolocationCoordinates', base_config_1.TYPE_VALUE], + ['GeolocationPosition', base_config_1.TYPE_VALUE], + ['GeolocationPositionError', base_config_1.TYPE_VALUE], + ['GlobalEventHandlersEventMap', base_config_1.TYPE], + ['GlobalEventHandlers', base_config_1.TYPE], + ['HTMLAllCollection', base_config_1.TYPE_VALUE], + ['HTMLAnchorElement', base_config_1.TYPE_VALUE], + ['HTMLAreaElement', base_config_1.TYPE_VALUE], + ['HTMLAudioElement', base_config_1.TYPE_VALUE], + ['HTMLBRElement', base_config_1.TYPE_VALUE], + ['HTMLBaseElement', base_config_1.TYPE_VALUE], + ['HTMLBodyElementEventMap', base_config_1.TYPE], + ['HTMLBodyElement', base_config_1.TYPE_VALUE], + ['HTMLButtonElement', base_config_1.TYPE_VALUE], + ['HTMLCanvasElement', base_config_1.TYPE_VALUE], + ['HTMLCollectionBase', base_config_1.TYPE], + ['HTMLCollection', base_config_1.TYPE_VALUE], + ['HTMLCollectionOf', base_config_1.TYPE], + ['HTMLDListElement', base_config_1.TYPE_VALUE], + ['HTMLDataElement', base_config_1.TYPE_VALUE], + ['HTMLDataListElement', base_config_1.TYPE_VALUE], + ['HTMLDetailsElement', base_config_1.TYPE_VALUE], + ['HTMLDialogElement', base_config_1.TYPE_VALUE], + ['HTMLDirectoryElement', base_config_1.TYPE_VALUE], + ['HTMLDivElement', base_config_1.TYPE_VALUE], + ['HTMLDocument', base_config_1.TYPE_VALUE], + ['HTMLElementEventMap', base_config_1.TYPE], + ['HTMLElement', base_config_1.TYPE_VALUE], + ['HTMLEmbedElement', base_config_1.TYPE_VALUE], + ['HTMLFieldSetElement', base_config_1.TYPE_VALUE], + ['HTMLFontElement', base_config_1.TYPE_VALUE], + ['HTMLFormControlsCollection', base_config_1.TYPE_VALUE], + ['HTMLFormElement', base_config_1.TYPE_VALUE], + ['HTMLFrameElement', base_config_1.TYPE_VALUE], + ['HTMLFrameSetElementEventMap', base_config_1.TYPE], + ['HTMLFrameSetElement', base_config_1.TYPE_VALUE], + ['HTMLHRElement', base_config_1.TYPE_VALUE], + ['HTMLHeadElement', base_config_1.TYPE_VALUE], + ['HTMLHeadingElement', base_config_1.TYPE_VALUE], + ['HTMLHtmlElement', base_config_1.TYPE_VALUE], + ['HTMLHyperlinkElementUtils', base_config_1.TYPE], + ['HTMLIFrameElement', base_config_1.TYPE_VALUE], + ['HTMLImageElement', base_config_1.TYPE_VALUE], + ['HTMLInputElement', base_config_1.TYPE_VALUE], + ['HTMLLIElement', base_config_1.TYPE_VALUE], + ['HTMLLabelElement', base_config_1.TYPE_VALUE], + ['HTMLLegendElement', base_config_1.TYPE_VALUE], + ['HTMLLinkElement', base_config_1.TYPE_VALUE], + ['HTMLMapElement', base_config_1.TYPE_VALUE], + ['HTMLMarqueeElement', base_config_1.TYPE_VALUE], + ['HTMLMediaElementEventMap', base_config_1.TYPE], + ['HTMLMediaElement', base_config_1.TYPE_VALUE], + ['HTMLMenuElement', base_config_1.TYPE_VALUE], + ['HTMLMetaElement', base_config_1.TYPE_VALUE], + ['HTMLMeterElement', base_config_1.TYPE_VALUE], + ['HTMLModElement', base_config_1.TYPE_VALUE], + ['HTMLOListElement', base_config_1.TYPE_VALUE], + ['HTMLObjectElement', base_config_1.TYPE_VALUE], + ['HTMLOptGroupElement', base_config_1.TYPE_VALUE], + ['HTMLOptionElement', base_config_1.TYPE_VALUE], + ['HTMLOptionsCollection', base_config_1.TYPE_VALUE], + ['HTMLOrSVGElement', base_config_1.TYPE], + ['HTMLOutputElement', base_config_1.TYPE_VALUE], + ['HTMLParagraphElement', base_config_1.TYPE_VALUE], + ['HTMLParamElement', base_config_1.TYPE_VALUE], + ['HTMLPictureElement', base_config_1.TYPE_VALUE], + ['HTMLPreElement', base_config_1.TYPE_VALUE], + ['HTMLProgressElement', base_config_1.TYPE_VALUE], + ['HTMLQuoteElement', base_config_1.TYPE_VALUE], + ['HTMLScriptElement', base_config_1.TYPE_VALUE], + ['HTMLSelectElement', base_config_1.TYPE_VALUE], + ['HTMLSlotElement', base_config_1.TYPE_VALUE], + ['HTMLSourceElement', base_config_1.TYPE_VALUE], + ['HTMLSpanElement', base_config_1.TYPE_VALUE], + ['HTMLStyleElement', base_config_1.TYPE_VALUE], + ['HTMLTableCaptionElement', base_config_1.TYPE_VALUE], + ['HTMLTableCellElement', base_config_1.TYPE_VALUE], + ['HTMLTableColElement', base_config_1.TYPE_VALUE], + ['HTMLTableDataCellElement', base_config_1.TYPE], + ['HTMLTableElement', base_config_1.TYPE_VALUE], + ['HTMLTableHeaderCellElement', base_config_1.TYPE], + ['HTMLTableRowElement', base_config_1.TYPE_VALUE], + ['HTMLTableSectionElement', base_config_1.TYPE_VALUE], + ['HTMLTemplateElement', base_config_1.TYPE_VALUE], + ['HTMLTextAreaElement', base_config_1.TYPE_VALUE], + ['HTMLTimeElement', base_config_1.TYPE_VALUE], + ['HTMLTitleElement', base_config_1.TYPE_VALUE], + ['HTMLTrackElement', base_config_1.TYPE_VALUE], + ['HTMLUListElement', base_config_1.TYPE_VALUE], + ['HTMLUnknownElement', base_config_1.TYPE_VALUE], + ['HTMLVideoElementEventMap', base_config_1.TYPE], + ['HTMLVideoElement', base_config_1.TYPE_VALUE], + ['HashChangeEvent', base_config_1.TYPE_VALUE], + ['Headers', base_config_1.TYPE_VALUE], + ['Highlight', base_config_1.TYPE_VALUE], + ['HighlightRegistry', base_config_1.TYPE_VALUE], + ['History', base_config_1.TYPE_VALUE], + ['IDBCursor', base_config_1.TYPE_VALUE], + ['IDBCursorWithValue', base_config_1.TYPE_VALUE], + ['IDBDatabaseEventMap', base_config_1.TYPE], + ['IDBDatabase', base_config_1.TYPE_VALUE], + ['IDBFactory', base_config_1.TYPE_VALUE], + ['IDBIndex', base_config_1.TYPE_VALUE], + ['IDBKeyRange', base_config_1.TYPE_VALUE], + ['IDBObjectStore', base_config_1.TYPE_VALUE], + ['IDBOpenDBRequestEventMap', base_config_1.TYPE], + ['IDBOpenDBRequest', base_config_1.TYPE_VALUE], + ['IDBRequestEventMap', base_config_1.TYPE], + ['IDBRequest', base_config_1.TYPE_VALUE], + ['IDBTransactionEventMap', base_config_1.TYPE], + ['IDBTransaction', base_config_1.TYPE_VALUE], + ['IDBVersionChangeEvent', base_config_1.TYPE_VALUE], + ['IIRFilterNode', base_config_1.TYPE_VALUE], + ['IdleDeadline', base_config_1.TYPE_VALUE], + ['ImageBitmap', base_config_1.TYPE_VALUE], + ['ImageBitmapRenderingContext', base_config_1.TYPE_VALUE], + ['ImageData', base_config_1.TYPE_VALUE], + ['ImageDecoder', base_config_1.TYPE_VALUE], + ['ImageTrack', base_config_1.TYPE_VALUE], + ['ImageTrackList', base_config_1.TYPE_VALUE], + ['ImportMeta', base_config_1.TYPE], + ['InputDeviceInfo', base_config_1.TYPE_VALUE], + ['InputEvent', base_config_1.TYPE_VALUE], + ['IntersectionObserver', base_config_1.TYPE_VALUE], + ['IntersectionObserverEntry', base_config_1.TYPE_VALUE], + ['KHR_parallel_shader_compile', base_config_1.TYPE], + ['KeyboardEvent', base_config_1.TYPE_VALUE], + ['KeyframeEffect', base_config_1.TYPE_VALUE], + ['LargestContentfulPaint', base_config_1.TYPE_VALUE], + ['LinkStyle', base_config_1.TYPE], + ['Location', base_config_1.TYPE_VALUE], + ['Lock', base_config_1.TYPE_VALUE], + ['LockManager', base_config_1.TYPE_VALUE], + ['MIDIAccessEventMap', base_config_1.TYPE], + ['MIDIAccess', base_config_1.TYPE_VALUE], + ['MIDIConnectionEvent', base_config_1.TYPE_VALUE], + ['MIDIInputEventMap', base_config_1.TYPE], + ['MIDIInput', base_config_1.TYPE_VALUE], + ['MIDIInputMap', base_config_1.TYPE_VALUE], + ['MIDIMessageEvent', base_config_1.TYPE_VALUE], + ['MIDIOutput', base_config_1.TYPE_VALUE], + ['MIDIOutputMap', base_config_1.TYPE_VALUE], + ['MIDIPortEventMap', base_config_1.TYPE], + ['MIDIPort', base_config_1.TYPE_VALUE], + ['MathMLElementEventMap', base_config_1.TYPE], + ['MathMLElement', base_config_1.TYPE_VALUE], + ['MediaCapabilities', base_config_1.TYPE_VALUE], + ['MediaDeviceInfo', base_config_1.TYPE_VALUE], + ['MediaDevicesEventMap', base_config_1.TYPE], + ['MediaDevices', base_config_1.TYPE_VALUE], + ['MediaElementAudioSourceNode', base_config_1.TYPE_VALUE], + ['MediaEncryptedEvent', base_config_1.TYPE_VALUE], + ['MediaError', base_config_1.TYPE_VALUE], + ['MediaKeyMessageEvent', base_config_1.TYPE_VALUE], + ['MediaKeySessionEventMap', base_config_1.TYPE], + ['MediaKeySession', base_config_1.TYPE_VALUE], + ['MediaKeyStatusMap', base_config_1.TYPE_VALUE], + ['MediaKeySystemAccess', base_config_1.TYPE_VALUE], + ['MediaKeys', base_config_1.TYPE_VALUE], + ['MediaList', base_config_1.TYPE_VALUE], + ['MediaMetadata', base_config_1.TYPE_VALUE], + ['MediaQueryListEventMap', base_config_1.TYPE], + ['MediaQueryList', base_config_1.TYPE_VALUE], + ['MediaQueryListEvent', base_config_1.TYPE_VALUE], + ['MediaRecorderEventMap', base_config_1.TYPE], + ['MediaRecorder', base_config_1.TYPE_VALUE], + ['MediaSession', base_config_1.TYPE_VALUE], + ['MediaSourceEventMap', base_config_1.TYPE], + ['MediaSource', base_config_1.TYPE_VALUE], + ['MediaSourceHandle', base_config_1.TYPE_VALUE], + ['MediaStreamEventMap', base_config_1.TYPE], + ['MediaStream', base_config_1.TYPE_VALUE], + ['MediaStreamAudioDestinationNode', base_config_1.TYPE_VALUE], + ['MediaStreamAudioSourceNode', base_config_1.TYPE_VALUE], + ['MediaStreamTrackEventMap', base_config_1.TYPE], + ['MediaStreamTrack', base_config_1.TYPE_VALUE], + ['MediaStreamTrackEvent', base_config_1.TYPE_VALUE], + ['MessageChannel', base_config_1.TYPE_VALUE], + ['MessageEvent', base_config_1.TYPE_VALUE], + ['MessageEventTargetEventMap', base_config_1.TYPE], + ['MessageEventTarget', base_config_1.TYPE], + ['MessagePortEventMap', base_config_1.TYPE], + ['MessagePort', base_config_1.TYPE_VALUE], + ['MimeType', base_config_1.TYPE_VALUE], + ['MimeTypeArray', base_config_1.TYPE_VALUE], + ['MouseEvent', base_config_1.TYPE_VALUE], + ['MutationObserver', base_config_1.TYPE_VALUE], + ['MutationRecord', base_config_1.TYPE_VALUE], + ['NamedNodeMap', base_config_1.TYPE_VALUE], + ['NavigationActivation', base_config_1.TYPE_VALUE], + ['NavigationHistoryEntryEventMap', base_config_1.TYPE], + ['NavigationHistoryEntry', base_config_1.TYPE_VALUE], + ['NavigationPreloadManager', base_config_1.TYPE_VALUE], + ['Navigator', base_config_1.TYPE_VALUE], + ['NavigatorAutomationInformation', base_config_1.TYPE], + ['NavigatorBadge', base_config_1.TYPE], + ['NavigatorConcurrentHardware', base_config_1.TYPE], + ['NavigatorContentUtils', base_config_1.TYPE], + ['NavigatorCookies', base_config_1.TYPE], + ['NavigatorID', base_config_1.TYPE], + ['NavigatorLanguage', base_config_1.TYPE], + ['NavigatorLocks', base_config_1.TYPE], + ['NavigatorOnLine', base_config_1.TYPE], + ['NavigatorPlugins', base_config_1.TYPE], + ['NavigatorStorage', base_config_1.TYPE], + ['Node', base_config_1.TYPE_VALUE], + ['NodeIterator', base_config_1.TYPE_VALUE], + ['NodeList', base_config_1.TYPE_VALUE], + ['NodeListOf', base_config_1.TYPE], + ['NonDocumentTypeChildNode', base_config_1.TYPE], + ['NonElementParentNode', base_config_1.TYPE], + ['NotificationEventMap', base_config_1.TYPE], + ['Notification', base_config_1.TYPE_VALUE], + ['OES_draw_buffers_indexed', base_config_1.TYPE], + ['OES_element_index_uint', base_config_1.TYPE], + ['OES_fbo_render_mipmap', base_config_1.TYPE], + ['OES_standard_derivatives', base_config_1.TYPE], + ['OES_texture_float', base_config_1.TYPE], + ['OES_texture_float_linear', base_config_1.TYPE], + ['OES_texture_half_float', base_config_1.TYPE], + ['OES_texture_half_float_linear', base_config_1.TYPE], + ['OES_vertex_array_object', base_config_1.TYPE], + ['OVR_multiview2', base_config_1.TYPE], + ['OfflineAudioCompletionEvent', base_config_1.TYPE_VALUE], + ['OfflineAudioContextEventMap', base_config_1.TYPE], + ['OfflineAudioContext', base_config_1.TYPE_VALUE], + ['OffscreenCanvasEventMap', base_config_1.TYPE], + ['OffscreenCanvas', base_config_1.TYPE_VALUE], + ['OffscreenCanvasRenderingContext2D', base_config_1.TYPE_VALUE], + ['OscillatorNode', base_config_1.TYPE_VALUE], + ['OverconstrainedError', base_config_1.TYPE_VALUE], + ['PageRevealEvent', base_config_1.TYPE_VALUE], + ['PageSwapEvent', base_config_1.TYPE_VALUE], + ['PageTransitionEvent', base_config_1.TYPE_VALUE], + ['PannerNode', base_config_1.TYPE_VALUE], + ['ParentNode', base_config_1.TYPE], + ['Path2D', base_config_1.TYPE_VALUE], + ['PaymentAddress', base_config_1.TYPE_VALUE], + ['PaymentMethodChangeEvent', base_config_1.TYPE_VALUE], + ['PaymentRequestEventMap', base_config_1.TYPE], + ['PaymentRequest', base_config_1.TYPE_VALUE], + ['PaymentRequestUpdateEvent', base_config_1.TYPE_VALUE], + ['PaymentResponseEventMap', base_config_1.TYPE], + ['PaymentResponse', base_config_1.TYPE_VALUE], + ['PerformanceEventMap', base_config_1.TYPE], + ['Performance', base_config_1.TYPE_VALUE], + ['PerformanceEntry', base_config_1.TYPE_VALUE], + ['PerformanceEventTiming', base_config_1.TYPE_VALUE], + ['PerformanceMark', base_config_1.TYPE_VALUE], + ['PerformanceMeasure', base_config_1.TYPE_VALUE], + ['PerformanceNavigation', base_config_1.TYPE_VALUE], + ['PerformanceNavigationTiming', base_config_1.TYPE_VALUE], + ['PerformanceObserver', base_config_1.TYPE_VALUE], + ['PerformanceObserverEntryList', base_config_1.TYPE_VALUE], + ['PerformancePaintTiming', base_config_1.TYPE_VALUE], + ['PerformanceResourceTiming', base_config_1.TYPE_VALUE], + ['PerformanceServerTiming', base_config_1.TYPE_VALUE], + ['PerformanceTiming', base_config_1.TYPE_VALUE], + ['PeriodicWave', base_config_1.TYPE_VALUE], + ['PermissionStatusEventMap', base_config_1.TYPE], + ['PermissionStatus', base_config_1.TYPE_VALUE], + ['Permissions', base_config_1.TYPE_VALUE], + ['PictureInPictureEvent', base_config_1.TYPE_VALUE], + ['PictureInPictureWindowEventMap', base_config_1.TYPE], + ['PictureInPictureWindow', base_config_1.TYPE_VALUE], + ['Plugin', base_config_1.TYPE_VALUE], + ['PluginArray', base_config_1.TYPE_VALUE], + ['PointerEvent', base_config_1.TYPE_VALUE], + ['PopStateEvent', base_config_1.TYPE_VALUE], + ['PopoverInvokerElement', base_config_1.TYPE], + ['ProcessingInstruction', base_config_1.TYPE_VALUE], + ['ProgressEvent', base_config_1.TYPE_VALUE], + ['PromiseRejectionEvent', base_config_1.TYPE_VALUE], + ['PublicKeyCredential', base_config_1.TYPE_VALUE], + ['PushManager', base_config_1.TYPE_VALUE], + ['PushSubscription', base_config_1.TYPE_VALUE], + ['PushSubscriptionOptions', base_config_1.TYPE_VALUE], + ['RTCCertificate', base_config_1.TYPE_VALUE], + ['RTCDTMFSenderEventMap', base_config_1.TYPE], + ['RTCDTMFSender', base_config_1.TYPE_VALUE], + ['RTCDTMFToneChangeEvent', base_config_1.TYPE_VALUE], + ['RTCDataChannelEventMap', base_config_1.TYPE], + ['RTCDataChannel', base_config_1.TYPE_VALUE], + ['RTCDataChannelEvent', base_config_1.TYPE_VALUE], + ['RTCDtlsTransportEventMap', base_config_1.TYPE], + ['RTCDtlsTransport', base_config_1.TYPE_VALUE], + ['RTCEncodedAudioFrame', base_config_1.TYPE_VALUE], + ['RTCEncodedVideoFrame', base_config_1.TYPE_VALUE], + ['RTCError', base_config_1.TYPE_VALUE], + ['RTCErrorEvent', base_config_1.TYPE_VALUE], + ['RTCIceCandidate', base_config_1.TYPE_VALUE], + ['RTCIceCandidatePair', base_config_1.TYPE], + ['RTCIceTransportEventMap', base_config_1.TYPE], + ['RTCIceTransport', base_config_1.TYPE_VALUE], + ['RTCPeerConnectionEventMap', base_config_1.TYPE], + ['RTCPeerConnection', base_config_1.TYPE_VALUE], + ['RTCPeerConnectionIceErrorEvent', base_config_1.TYPE_VALUE], + ['RTCPeerConnectionIceEvent', base_config_1.TYPE_VALUE], + ['RTCRtpReceiver', base_config_1.TYPE_VALUE], + ['RTCRtpScriptTransform', base_config_1.TYPE_VALUE], + ['RTCRtpSender', base_config_1.TYPE_VALUE], + ['RTCRtpTransceiver', base_config_1.TYPE_VALUE], + ['RTCSctpTransportEventMap', base_config_1.TYPE], + ['RTCSctpTransport', base_config_1.TYPE_VALUE], + ['RTCSessionDescription', base_config_1.TYPE_VALUE], + ['RTCStatsReport', base_config_1.TYPE_VALUE], + ['RTCTrackEvent', base_config_1.TYPE_VALUE], + ['RadioNodeList', base_config_1.TYPE_VALUE], + ['Range', base_config_1.TYPE_VALUE], + ['ReadableByteStreamController', base_config_1.TYPE_VALUE], + ['ReadableStream', base_config_1.TYPE_VALUE], + ['ReadableStreamBYOBReader', base_config_1.TYPE_VALUE], + ['ReadableStreamBYOBRequest', base_config_1.TYPE_VALUE], + ['ReadableStreamDefaultController', base_config_1.TYPE_VALUE], + ['ReadableStreamDefaultReader', base_config_1.TYPE_VALUE], + ['ReadableStreamGenericReader', base_config_1.TYPE], + ['RemotePlaybackEventMap', base_config_1.TYPE], + ['RemotePlayback', base_config_1.TYPE_VALUE], + ['Report', base_config_1.TYPE_VALUE], + ['ReportBody', base_config_1.TYPE_VALUE], + ['ReportingObserver', base_config_1.TYPE_VALUE], + ['Request', base_config_1.TYPE_VALUE], + ['ResizeObserver', base_config_1.TYPE_VALUE], + ['ResizeObserverEntry', base_config_1.TYPE_VALUE], + ['ResizeObserverSize', base_config_1.TYPE_VALUE], + ['Response', base_config_1.TYPE_VALUE], + ['SVGAElement', base_config_1.TYPE_VALUE], + ['SVGAngle', base_config_1.TYPE_VALUE], + ['SVGAnimateElement', base_config_1.TYPE_VALUE], + ['SVGAnimateMotionElement', base_config_1.TYPE_VALUE], + ['SVGAnimateTransformElement', base_config_1.TYPE_VALUE], + ['SVGAnimatedAngle', base_config_1.TYPE_VALUE], + ['SVGAnimatedBoolean', base_config_1.TYPE_VALUE], + ['SVGAnimatedEnumeration', base_config_1.TYPE_VALUE], + ['SVGAnimatedInteger', base_config_1.TYPE_VALUE], + ['SVGAnimatedLength', base_config_1.TYPE_VALUE], + ['SVGAnimatedLengthList', base_config_1.TYPE_VALUE], + ['SVGAnimatedNumber', base_config_1.TYPE_VALUE], + ['SVGAnimatedNumberList', base_config_1.TYPE_VALUE], + ['SVGAnimatedPoints', base_config_1.TYPE], + ['SVGAnimatedPreserveAspectRatio', base_config_1.TYPE_VALUE], + ['SVGAnimatedRect', base_config_1.TYPE_VALUE], + ['SVGAnimatedString', base_config_1.TYPE_VALUE], + ['SVGAnimatedTransformList', base_config_1.TYPE_VALUE], + ['SVGAnimationElement', base_config_1.TYPE_VALUE], + ['SVGCircleElement', base_config_1.TYPE_VALUE], + ['SVGClipPathElement', base_config_1.TYPE_VALUE], + ['SVGComponentTransferFunctionElement', base_config_1.TYPE_VALUE], + ['SVGDefsElement', base_config_1.TYPE_VALUE], + ['SVGDescElement', base_config_1.TYPE_VALUE], + ['SVGElementEventMap', base_config_1.TYPE], + ['SVGElement', base_config_1.TYPE_VALUE], + ['SVGEllipseElement', base_config_1.TYPE_VALUE], + ['SVGFEBlendElement', base_config_1.TYPE_VALUE], + ['SVGFEColorMatrixElement', base_config_1.TYPE_VALUE], + ['SVGFEComponentTransferElement', base_config_1.TYPE_VALUE], + ['SVGFECompositeElement', base_config_1.TYPE_VALUE], + ['SVGFEConvolveMatrixElement', base_config_1.TYPE_VALUE], + ['SVGFEDiffuseLightingElement', base_config_1.TYPE_VALUE], + ['SVGFEDisplacementMapElement', base_config_1.TYPE_VALUE], + ['SVGFEDistantLightElement', base_config_1.TYPE_VALUE], + ['SVGFEDropShadowElement', base_config_1.TYPE_VALUE], + ['SVGFEFloodElement', base_config_1.TYPE_VALUE], + ['SVGFEFuncAElement', base_config_1.TYPE_VALUE], + ['SVGFEFuncBElement', base_config_1.TYPE_VALUE], + ['SVGFEFuncGElement', base_config_1.TYPE_VALUE], + ['SVGFEFuncRElement', base_config_1.TYPE_VALUE], + ['SVGFEGaussianBlurElement', base_config_1.TYPE_VALUE], + ['SVGFEImageElement', base_config_1.TYPE_VALUE], + ['SVGFEMergeElement', base_config_1.TYPE_VALUE], + ['SVGFEMergeNodeElement', base_config_1.TYPE_VALUE], + ['SVGFEMorphologyElement', base_config_1.TYPE_VALUE], + ['SVGFEOffsetElement', base_config_1.TYPE_VALUE], + ['SVGFEPointLightElement', base_config_1.TYPE_VALUE], + ['SVGFESpecularLightingElement', base_config_1.TYPE_VALUE], + ['SVGFESpotLightElement', base_config_1.TYPE_VALUE], + ['SVGFETileElement', base_config_1.TYPE_VALUE], + ['SVGFETurbulenceElement', base_config_1.TYPE_VALUE], + ['SVGFilterElement', base_config_1.TYPE_VALUE], + ['SVGFilterPrimitiveStandardAttributes', base_config_1.TYPE], + ['SVGFitToViewBox', base_config_1.TYPE], + ['SVGForeignObjectElement', base_config_1.TYPE_VALUE], + ['SVGGElement', base_config_1.TYPE_VALUE], + ['SVGGeometryElement', base_config_1.TYPE_VALUE], + ['SVGGradientElement', base_config_1.TYPE_VALUE], + ['SVGGraphicsElement', base_config_1.TYPE_VALUE], + ['SVGImageElement', base_config_1.TYPE_VALUE], + ['SVGLength', base_config_1.TYPE_VALUE], + ['SVGLengthList', base_config_1.TYPE_VALUE], + ['SVGLineElement', base_config_1.TYPE_VALUE], + ['SVGLinearGradientElement', base_config_1.TYPE_VALUE], + ['SVGMPathElement', base_config_1.TYPE_VALUE], + ['SVGMarkerElement', base_config_1.TYPE_VALUE], + ['SVGMaskElement', base_config_1.TYPE_VALUE], + ['SVGMetadataElement', base_config_1.TYPE_VALUE], + ['SVGNumber', base_config_1.TYPE_VALUE], + ['SVGNumberList', base_config_1.TYPE_VALUE], + ['SVGPathElement', base_config_1.TYPE_VALUE], + ['SVGPatternElement', base_config_1.TYPE_VALUE], + ['SVGPointList', base_config_1.TYPE_VALUE], + ['SVGPolygonElement', base_config_1.TYPE_VALUE], + ['SVGPolylineElement', base_config_1.TYPE_VALUE], + ['SVGPreserveAspectRatio', base_config_1.TYPE_VALUE], + ['SVGRadialGradientElement', base_config_1.TYPE_VALUE], + ['SVGRectElement', base_config_1.TYPE_VALUE], + ['SVGSVGElementEventMap', base_config_1.TYPE], + ['SVGSVGElement', base_config_1.TYPE_VALUE], + ['SVGScriptElement', base_config_1.TYPE_VALUE], + ['SVGSetElement', base_config_1.TYPE_VALUE], + ['SVGStopElement', base_config_1.TYPE_VALUE], + ['SVGStringList', base_config_1.TYPE_VALUE], + ['SVGStyleElement', base_config_1.TYPE_VALUE], + ['SVGSwitchElement', base_config_1.TYPE_VALUE], + ['SVGSymbolElement', base_config_1.TYPE_VALUE], + ['SVGTSpanElement', base_config_1.TYPE_VALUE], + ['SVGTests', base_config_1.TYPE], + ['SVGTextContentElement', base_config_1.TYPE_VALUE], + ['SVGTextElement', base_config_1.TYPE_VALUE], + ['SVGTextPathElement', base_config_1.TYPE_VALUE], + ['SVGTextPositioningElement', base_config_1.TYPE_VALUE], + ['SVGTitleElement', base_config_1.TYPE_VALUE], + ['SVGTransform', base_config_1.TYPE_VALUE], + ['SVGTransformList', base_config_1.TYPE_VALUE], + ['SVGURIReference', base_config_1.TYPE], + ['SVGUnitTypes', base_config_1.TYPE_VALUE], + ['SVGUseElement', base_config_1.TYPE_VALUE], + ['SVGViewElement', base_config_1.TYPE_VALUE], + ['Screen', base_config_1.TYPE_VALUE], + ['ScreenOrientationEventMap', base_config_1.TYPE], + ['ScreenOrientation', base_config_1.TYPE_VALUE], + ['ScriptProcessorNodeEventMap', base_config_1.TYPE], + ['ScriptProcessorNode', base_config_1.TYPE_VALUE], + ['SecurityPolicyViolationEvent', base_config_1.TYPE_VALUE], + ['Selection', base_config_1.TYPE_VALUE], + ['ServiceWorkerEventMap', base_config_1.TYPE], + ['ServiceWorker', base_config_1.TYPE_VALUE], + ['ServiceWorkerContainerEventMap', base_config_1.TYPE], + ['ServiceWorkerContainer', base_config_1.TYPE_VALUE], + ['ServiceWorkerRegistrationEventMap', base_config_1.TYPE], + ['ServiceWorkerRegistration', base_config_1.TYPE_VALUE], + ['ShadowRootEventMap', base_config_1.TYPE], + ['ShadowRoot', base_config_1.TYPE_VALUE], + ['SharedWorker', base_config_1.TYPE_VALUE], + ['Slottable', base_config_1.TYPE], + ['SourceBufferEventMap', base_config_1.TYPE], + ['SourceBuffer', base_config_1.TYPE_VALUE], + ['SourceBufferListEventMap', base_config_1.TYPE], + ['SourceBufferList', base_config_1.TYPE_VALUE], + ['SpeechRecognitionAlternative', base_config_1.TYPE_VALUE], + ['SpeechRecognitionResult', base_config_1.TYPE_VALUE], + ['SpeechRecognitionResultList', base_config_1.TYPE_VALUE], + ['SpeechSynthesisEventMap', base_config_1.TYPE], + ['SpeechSynthesis', base_config_1.TYPE_VALUE], + ['SpeechSynthesisErrorEvent', base_config_1.TYPE_VALUE], + ['SpeechSynthesisEvent', base_config_1.TYPE_VALUE], + ['SpeechSynthesisUtteranceEventMap', base_config_1.TYPE], + ['SpeechSynthesisUtterance', base_config_1.TYPE_VALUE], + ['SpeechSynthesisVoice', base_config_1.TYPE_VALUE], + ['StaticRange', base_config_1.TYPE_VALUE], + ['StereoPannerNode', base_config_1.TYPE_VALUE], + ['Storage', base_config_1.TYPE_VALUE], + ['StorageEvent', base_config_1.TYPE_VALUE], + ['StorageManager', base_config_1.TYPE_VALUE], + ['StyleMedia', base_config_1.TYPE], + ['StylePropertyMap', base_config_1.TYPE_VALUE], + ['StylePropertyMapReadOnly', base_config_1.TYPE_VALUE], + ['StyleSheet', base_config_1.TYPE_VALUE], + ['StyleSheetList', base_config_1.TYPE_VALUE], + ['SubmitEvent', base_config_1.TYPE_VALUE], + ['SubtleCrypto', base_config_1.TYPE_VALUE], + ['Text', base_config_1.TYPE_VALUE], + ['TextDecoder', base_config_1.TYPE_VALUE], + ['TextDecoderCommon', base_config_1.TYPE], + ['TextDecoderStream', base_config_1.TYPE_VALUE], + ['TextEncoder', base_config_1.TYPE_VALUE], + ['TextEncoderCommon', base_config_1.TYPE], + ['TextEncoderStream', base_config_1.TYPE_VALUE], + ['TextEvent', base_config_1.TYPE_VALUE], + ['TextMetrics', base_config_1.TYPE_VALUE], + ['TextTrackEventMap', base_config_1.TYPE], + ['TextTrack', base_config_1.TYPE_VALUE], + ['TextTrackCueEventMap', base_config_1.TYPE], + ['TextTrackCue', base_config_1.TYPE_VALUE], + ['TextTrackCueList', base_config_1.TYPE_VALUE], + ['TextTrackListEventMap', base_config_1.TYPE], + ['TextTrackList', base_config_1.TYPE_VALUE], + ['TimeRanges', base_config_1.TYPE_VALUE], + ['ToggleEvent', base_config_1.TYPE_VALUE], + ['Touch', base_config_1.TYPE_VALUE], + ['TouchEvent', base_config_1.TYPE_VALUE], + ['TouchList', base_config_1.TYPE_VALUE], + ['TrackEvent', base_config_1.TYPE_VALUE], + ['TransformStream', base_config_1.TYPE_VALUE], + ['TransformStreamDefaultController', base_config_1.TYPE_VALUE], + ['TransitionEvent', base_config_1.TYPE_VALUE], + ['TreeWalker', base_config_1.TYPE_VALUE], + ['UIEvent', base_config_1.TYPE_VALUE], + ['URL', base_config_1.TYPE_VALUE], + ['webkitURL', base_config_1.TYPE_VALUE], + ['URLSearchParams', base_config_1.TYPE_VALUE], + ['UserActivation', base_config_1.TYPE_VALUE], + ['VTTCue', base_config_1.TYPE_VALUE], + ['VTTRegion', base_config_1.TYPE_VALUE], + ['ValidityState', base_config_1.TYPE_VALUE], + ['VideoColorSpace', base_config_1.TYPE_VALUE], + ['VideoDecoderEventMap', base_config_1.TYPE], + ['VideoDecoder', base_config_1.TYPE_VALUE], + ['VideoEncoderEventMap', base_config_1.TYPE], + ['VideoEncoder', base_config_1.TYPE_VALUE], + ['VideoFrame', base_config_1.TYPE_VALUE], + ['VideoPlaybackQuality', base_config_1.TYPE_VALUE], + ['ViewTransition', base_config_1.TYPE_VALUE], + ['ViewTransitionTypeSet', base_config_1.TYPE_VALUE], + ['VisualViewportEventMap', base_config_1.TYPE], + ['VisualViewport', base_config_1.TYPE_VALUE], + ['WEBGL_color_buffer_float', base_config_1.TYPE], + ['WEBGL_compressed_texture_astc', base_config_1.TYPE], + ['WEBGL_compressed_texture_etc', base_config_1.TYPE], + ['WEBGL_compressed_texture_etc1', base_config_1.TYPE], + ['WEBGL_compressed_texture_pvrtc', base_config_1.TYPE], + ['WEBGL_compressed_texture_s3tc', base_config_1.TYPE], + ['WEBGL_compressed_texture_s3tc_srgb', base_config_1.TYPE], + ['WEBGL_debug_renderer_info', base_config_1.TYPE], + ['WEBGL_debug_shaders', base_config_1.TYPE], + ['WEBGL_depth_texture', base_config_1.TYPE], + ['WEBGL_draw_buffers', base_config_1.TYPE], + ['WEBGL_lose_context', base_config_1.TYPE], + ['WEBGL_multi_draw', base_config_1.TYPE], + ['WakeLock', base_config_1.TYPE_VALUE], + ['WakeLockSentinelEventMap', base_config_1.TYPE], + ['WakeLockSentinel', base_config_1.TYPE_VALUE], + ['WaveShaperNode', base_config_1.TYPE_VALUE], + ['WebGL2RenderingContext', base_config_1.TYPE_VALUE], + ['WebGL2RenderingContextBase', base_config_1.TYPE], + ['WebGL2RenderingContextOverloads', base_config_1.TYPE], + ['WebGLActiveInfo', base_config_1.TYPE_VALUE], + ['WebGLBuffer', base_config_1.TYPE_VALUE], + ['WebGLContextEvent', base_config_1.TYPE_VALUE], + ['WebGLFramebuffer', base_config_1.TYPE_VALUE], + ['WebGLProgram', base_config_1.TYPE_VALUE], + ['WebGLQuery', base_config_1.TYPE_VALUE], + ['WebGLRenderbuffer', base_config_1.TYPE_VALUE], + ['WebGLRenderingContext', base_config_1.TYPE_VALUE], + ['WebGLRenderingContextBase', base_config_1.TYPE], + ['WebGLRenderingContextOverloads', base_config_1.TYPE], + ['WebGLSampler', base_config_1.TYPE_VALUE], + ['WebGLShader', base_config_1.TYPE_VALUE], + ['WebGLShaderPrecisionFormat', base_config_1.TYPE_VALUE], + ['WebGLSync', base_config_1.TYPE_VALUE], + ['WebGLTexture', base_config_1.TYPE_VALUE], + ['WebGLTransformFeedback', base_config_1.TYPE_VALUE], + ['WebGLUniformLocation', base_config_1.TYPE_VALUE], + ['WebGLVertexArrayObject', base_config_1.TYPE_VALUE], + ['WebGLVertexArrayObjectOES', base_config_1.TYPE], + ['WebSocketEventMap', base_config_1.TYPE], + ['WebSocket', base_config_1.TYPE_VALUE], + ['WebTransport', base_config_1.TYPE_VALUE], + ['WebTransportBidirectionalStream', base_config_1.TYPE_VALUE], + ['WebTransportDatagramDuplexStream', base_config_1.TYPE_VALUE], + ['WebTransportError', base_config_1.TYPE_VALUE], + ['WheelEvent', base_config_1.TYPE_VALUE], + ['WindowEventMap', base_config_1.TYPE], + ['Window', base_config_1.TYPE_VALUE], + ['WindowEventHandlersEventMap', base_config_1.TYPE], + ['WindowEventHandlers', base_config_1.TYPE], + ['WindowLocalStorage', base_config_1.TYPE], + ['WindowOrWorkerGlobalScope', base_config_1.TYPE], + ['WindowSessionStorage', base_config_1.TYPE], + ['WorkerEventMap', base_config_1.TYPE], + ['Worker', base_config_1.TYPE_VALUE], + ['Worklet', base_config_1.TYPE_VALUE], + ['WritableStream', base_config_1.TYPE_VALUE], + ['WritableStreamDefaultController', base_config_1.TYPE_VALUE], + ['WritableStreamDefaultWriter', base_config_1.TYPE_VALUE], + ['XMLDocument', base_config_1.TYPE_VALUE], + ['XMLHttpRequestEventMap', base_config_1.TYPE], + ['XMLHttpRequest', base_config_1.TYPE_VALUE], + ['XMLHttpRequestEventTargetEventMap', base_config_1.TYPE], + ['XMLHttpRequestEventTarget', base_config_1.TYPE_VALUE], + ['XMLHttpRequestUpload', base_config_1.TYPE_VALUE], + ['XMLSerializer', base_config_1.TYPE_VALUE], + ['XPathEvaluator', base_config_1.TYPE_VALUE], + ['XPathEvaluatorBase', base_config_1.TYPE], + ['XPathExpression', base_config_1.TYPE_VALUE], + ['XPathResult', base_config_1.TYPE_VALUE], + ['XSLTProcessor', base_config_1.TYPE_VALUE], + ['Console', base_config_1.TYPE], + ['CSS', base_config_1.TYPE_VALUE], + ['WebAssembly', base_config_1.TYPE_VALUE], + ['AudioDataOutputCallback', base_config_1.TYPE], + ['BlobCallback', base_config_1.TYPE], + ['CustomElementConstructor', base_config_1.TYPE], + ['DecodeErrorCallback', base_config_1.TYPE], + ['DecodeSuccessCallback', base_config_1.TYPE], + ['EncodedAudioChunkOutputCallback', base_config_1.TYPE], + ['EncodedVideoChunkOutputCallback', base_config_1.TYPE], + ['ErrorCallback', base_config_1.TYPE], + ['FileCallback', base_config_1.TYPE], + ['FileSystemEntriesCallback', base_config_1.TYPE], + ['FileSystemEntryCallback', base_config_1.TYPE], + ['FrameRequestCallback', base_config_1.TYPE], + ['FunctionStringCallback', base_config_1.TYPE], + ['IdleRequestCallback', base_config_1.TYPE], + ['IntersectionObserverCallback', base_config_1.TYPE], + ['LockGrantedCallback', base_config_1.TYPE], + ['MediaSessionActionHandler', base_config_1.TYPE], + ['MutationCallback', base_config_1.TYPE], + ['NotificationPermissionCallback', base_config_1.TYPE], + ['OnBeforeUnloadEventHandlerNonNull', base_config_1.TYPE], + ['OnErrorEventHandlerNonNull', base_config_1.TYPE], + ['PerformanceObserverCallback', base_config_1.TYPE], + ['PositionCallback', base_config_1.TYPE], + ['PositionErrorCallback', base_config_1.TYPE], + ['QueuingStrategySize', base_config_1.TYPE], + ['RTCPeerConnectionErrorCallback', base_config_1.TYPE], + ['RTCSessionDescriptionCallback', base_config_1.TYPE], + ['RemotePlaybackAvailabilityCallback', base_config_1.TYPE], + ['ReportingObserverCallback', base_config_1.TYPE], + ['ResizeObserverCallback', base_config_1.TYPE], + ['TransformerFlushCallback', base_config_1.TYPE], + ['TransformerStartCallback', base_config_1.TYPE], + ['TransformerTransformCallback', base_config_1.TYPE], + ['UnderlyingSinkAbortCallback', base_config_1.TYPE], + ['UnderlyingSinkCloseCallback', base_config_1.TYPE], + ['UnderlyingSinkStartCallback', base_config_1.TYPE], + ['UnderlyingSinkWriteCallback', base_config_1.TYPE], + ['UnderlyingSourceCancelCallback', base_config_1.TYPE], + ['UnderlyingSourcePullCallback', base_config_1.TYPE], + ['UnderlyingSourceStartCallback', base_config_1.TYPE], + ['VideoFrameOutputCallback', base_config_1.TYPE], + ['VideoFrameRequestCallback', base_config_1.TYPE], + ['ViewTransitionUpdateCallback', base_config_1.TYPE], + ['VoidFunction', base_config_1.TYPE], + ['WebCodecsErrorCallback', base_config_1.TYPE], + ['HTMLElementTagNameMap', base_config_1.TYPE], + ['HTMLElementDeprecatedTagNameMap', base_config_1.TYPE], + ['SVGElementTagNameMap', base_config_1.TYPE], + ['MathMLElementTagNameMap', base_config_1.TYPE], + ['ElementTagNameMap', base_config_1.TYPE], + ['AlgorithmIdentifier', base_config_1.TYPE], + ['AllowSharedBufferSource', base_config_1.TYPE], + ['AutoFill', base_config_1.TYPE], + ['AutoFillField', base_config_1.TYPE], + ['AutoFillSection', base_config_1.TYPE], + ['Base64URLString', base_config_1.TYPE], + ['BigInteger', base_config_1.TYPE], + ['BlobPart', base_config_1.TYPE], + ['BodyInit', base_config_1.TYPE], + ['BufferSource', base_config_1.TYPE], + ['COSEAlgorithmIdentifier', base_config_1.TYPE], + ['CSSKeywordish', base_config_1.TYPE], + ['CSSNumberish', base_config_1.TYPE], + ['CSSPerspectiveValue', base_config_1.TYPE], + ['CSSUnparsedSegment', base_config_1.TYPE], + ['CanvasImageSource', base_config_1.TYPE], + ['ClipboardItemData', base_config_1.TYPE], + ['ClipboardItems', base_config_1.TYPE], + ['ConstrainBoolean', base_config_1.TYPE], + ['ConstrainDOMString', base_config_1.TYPE], + ['ConstrainDouble', base_config_1.TYPE], + ['ConstrainULong', base_config_1.TYPE], + ['DOMHighResTimeStamp', base_config_1.TYPE], + ['EpochTimeStamp', base_config_1.TYPE], + ['EventListenerOrEventListenerObject', base_config_1.TYPE], + ['FileSystemWriteChunkType', base_config_1.TYPE], + ['Float32List', base_config_1.TYPE], + ['FormDataEntryValue', base_config_1.TYPE], + ['GLbitfield', base_config_1.TYPE], + ['GLboolean', base_config_1.TYPE], + ['GLclampf', base_config_1.TYPE], + ['GLenum', base_config_1.TYPE], + ['GLfloat', base_config_1.TYPE], + ['GLint', base_config_1.TYPE], + ['GLint64', base_config_1.TYPE], + ['GLintptr', base_config_1.TYPE], + ['GLsizei', base_config_1.TYPE], + ['GLsizeiptr', base_config_1.TYPE], + ['GLuint', base_config_1.TYPE], + ['GLuint64', base_config_1.TYPE], + ['HTMLOrSVGImageElement', base_config_1.TYPE], + ['HTMLOrSVGScriptElement', base_config_1.TYPE], + ['HashAlgorithmIdentifier', base_config_1.TYPE], + ['HeadersInit', base_config_1.TYPE], + ['IDBValidKey', base_config_1.TYPE], + ['ImageBitmapSource', base_config_1.TYPE], + ['ImageBufferSource', base_config_1.TYPE], + ['Int32List', base_config_1.TYPE], + ['LineAndPositionSetting', base_config_1.TYPE], + ['MediaProvider', base_config_1.TYPE], + ['MessageEventSource', base_config_1.TYPE], + ['MutationRecordType', base_config_1.TYPE], + ['NamedCurve', base_config_1.TYPE], + ['OffscreenRenderingContext', base_config_1.TYPE], + ['OnBeforeUnloadEventHandler', base_config_1.TYPE], + ['OnErrorEventHandler', base_config_1.TYPE], + ['OptionalPostfixToken', base_config_1.TYPE], + ['OptionalPrefixToken', base_config_1.TYPE], + ['PerformanceEntryList', base_config_1.TYPE], + ['PublicKeyCredentialClientCapabilities', base_config_1.TYPE], + ['PublicKeyCredentialJSON', base_config_1.TYPE], + ['RTCRtpTransform', base_config_1.TYPE], + ['ReadableStreamController', base_config_1.TYPE], + ['ReadableStreamReadResult', base_config_1.TYPE], + ['ReadableStreamReader', base_config_1.TYPE], + ['RenderingContext', base_config_1.TYPE], + ['ReportList', base_config_1.TYPE], + ['RequestInfo', base_config_1.TYPE], + ['TexImageSource', base_config_1.TYPE], + ['TimerHandler', base_config_1.TYPE], + ['Transferable', base_config_1.TYPE], + ['Uint32List', base_config_1.TYPE], + ['VibratePattern', base_config_1.TYPE], + ['WindowProxy', base_config_1.TYPE], + ['XMLHttpRequestBodyInit', base_config_1.TYPE], + ['AlignSetting', base_config_1.TYPE], + ['AlphaOption', base_config_1.TYPE], + ['AnimationPlayState', base_config_1.TYPE], + ['AnimationReplaceState', base_config_1.TYPE], + ['AppendMode', base_config_1.TYPE], + ['AttestationConveyancePreference', base_config_1.TYPE], + ['AudioContextLatencyCategory', base_config_1.TYPE], + ['AudioContextState', base_config_1.TYPE], + ['AudioSampleFormat', base_config_1.TYPE], + ['AuthenticatorAttachment', base_config_1.TYPE], + ['AuthenticatorTransport', base_config_1.TYPE], + ['AutoFillAddressKind', base_config_1.TYPE], + ['AutoFillBase', base_config_1.TYPE], + ['AutoFillContactField', base_config_1.TYPE], + ['AutoFillContactKind', base_config_1.TYPE], + ['AutoFillCredentialField', base_config_1.TYPE], + ['AutoFillNormalField', base_config_1.TYPE], + ['AutoKeyword', base_config_1.TYPE], + ['AutomationRate', base_config_1.TYPE], + ['AvcBitstreamFormat', base_config_1.TYPE], + ['BinaryType', base_config_1.TYPE], + ['BiquadFilterType', base_config_1.TYPE], + ['BitrateMode', base_config_1.TYPE], + ['CSSMathOperator', base_config_1.TYPE], + ['CSSNumericBaseType', base_config_1.TYPE], + ['CanPlayTypeResult', base_config_1.TYPE], + ['CanvasDirection', base_config_1.TYPE], + ['CanvasFillRule', base_config_1.TYPE], + ['CanvasFontKerning', base_config_1.TYPE], + ['CanvasFontStretch', base_config_1.TYPE], + ['CanvasFontVariantCaps', base_config_1.TYPE], + ['CanvasLineCap', base_config_1.TYPE], + ['CanvasLineJoin', base_config_1.TYPE], + ['CanvasTextAlign', base_config_1.TYPE], + ['CanvasTextBaseline', base_config_1.TYPE], + ['CanvasTextRendering', base_config_1.TYPE], + ['ChannelCountMode', base_config_1.TYPE], + ['ChannelInterpretation', base_config_1.TYPE], + ['ClientTypes', base_config_1.TYPE], + ['CodecState', base_config_1.TYPE], + ['ColorGamut', base_config_1.TYPE], + ['ColorSpaceConversion', base_config_1.TYPE], + ['CompositeOperation', base_config_1.TYPE], + ['CompositeOperationOrAuto', base_config_1.TYPE], + ['CompressionFormat', base_config_1.TYPE], + ['CredentialMediationRequirement', base_config_1.TYPE], + ['DOMParserSupportedType', base_config_1.TYPE], + ['DirectionSetting', base_config_1.TYPE], + ['DisplayCaptureSurfaceType', base_config_1.TYPE], + ['DistanceModelType', base_config_1.TYPE], + ['DocumentReadyState', base_config_1.TYPE], + ['DocumentVisibilityState', base_config_1.TYPE], + ['EncodedAudioChunkType', base_config_1.TYPE], + ['EncodedVideoChunkType', base_config_1.TYPE], + ['EndOfStreamError', base_config_1.TYPE], + ['EndingType', base_config_1.TYPE], + ['FileSystemHandleKind', base_config_1.TYPE], + ['FillMode', base_config_1.TYPE], + ['FontDisplay', base_config_1.TYPE], + ['FontFaceLoadStatus', base_config_1.TYPE], + ['FontFaceSetLoadStatus', base_config_1.TYPE], + ['FullscreenNavigationUI', base_config_1.TYPE], + ['GamepadHapticEffectType', base_config_1.TYPE], + ['GamepadHapticsResult', base_config_1.TYPE], + ['GamepadMappingType', base_config_1.TYPE], + ['GlobalCompositeOperation', base_config_1.TYPE], + ['HardwareAcceleration', base_config_1.TYPE], + ['HdrMetadataType', base_config_1.TYPE], + ['HighlightType', base_config_1.TYPE], + ['IDBCursorDirection', base_config_1.TYPE], + ['IDBRequestReadyState', base_config_1.TYPE], + ['IDBTransactionDurability', base_config_1.TYPE], + ['IDBTransactionMode', base_config_1.TYPE], + ['ImageOrientation', base_config_1.TYPE], + ['ImageSmoothingQuality', base_config_1.TYPE], + ['InsertPosition', base_config_1.TYPE], + ['IterationCompositeOperation', base_config_1.TYPE], + ['KeyFormat', base_config_1.TYPE], + ['KeyType', base_config_1.TYPE], + ['KeyUsage', base_config_1.TYPE], + ['LatencyMode', base_config_1.TYPE], + ['LineAlignSetting', base_config_1.TYPE], + ['LockMode', base_config_1.TYPE], + ['MIDIPortConnectionState', base_config_1.TYPE], + ['MIDIPortDeviceState', base_config_1.TYPE], + ['MIDIPortType', base_config_1.TYPE], + ['MediaDecodingType', base_config_1.TYPE], + ['MediaDeviceKind', base_config_1.TYPE], + ['MediaEncodingType', base_config_1.TYPE], + ['MediaKeyMessageType', base_config_1.TYPE], + ['MediaKeySessionClosedReason', base_config_1.TYPE], + ['MediaKeySessionType', base_config_1.TYPE], + ['MediaKeyStatus', base_config_1.TYPE], + ['MediaKeysRequirement', base_config_1.TYPE], + ['MediaSessionAction', base_config_1.TYPE], + ['MediaSessionPlaybackState', base_config_1.TYPE], + ['MediaStreamTrackState', base_config_1.TYPE], + ['NavigationTimingType', base_config_1.TYPE], + ['NavigationType', base_config_1.TYPE], + ['NotificationDirection', base_config_1.TYPE], + ['NotificationPermission', base_config_1.TYPE], + ['OffscreenRenderingContextId', base_config_1.TYPE], + ['OpusBitstreamFormat', base_config_1.TYPE], + ['OrientationType', base_config_1.TYPE], + ['OscillatorType', base_config_1.TYPE], + ['OverSampleType', base_config_1.TYPE], + ['PanningModelType', base_config_1.TYPE], + ['PaymentComplete', base_config_1.TYPE], + ['PaymentShippingType', base_config_1.TYPE], + ['PermissionName', base_config_1.TYPE], + ['PermissionState', base_config_1.TYPE], + ['PlaybackDirection', base_config_1.TYPE], + ['PositionAlignSetting', base_config_1.TYPE], + ['PredefinedColorSpace', base_config_1.TYPE], + ['PremultiplyAlpha', base_config_1.TYPE], + ['PresentationStyle', base_config_1.TYPE], + ['PublicKeyCredentialType', base_config_1.TYPE], + ['PushEncryptionKeyName', base_config_1.TYPE], + ['RTCBundlePolicy', base_config_1.TYPE], + ['RTCDataChannelState', base_config_1.TYPE], + ['RTCDegradationPreference', base_config_1.TYPE], + ['RTCDtlsRole', base_config_1.TYPE], + ['RTCDtlsTransportState', base_config_1.TYPE], + ['RTCEncodedVideoFrameType', base_config_1.TYPE], + ['RTCErrorDetailType', base_config_1.TYPE], + ['RTCIceCandidateType', base_config_1.TYPE], + ['RTCIceComponent', base_config_1.TYPE], + ['RTCIceConnectionState', base_config_1.TYPE], + ['RTCIceGathererState', base_config_1.TYPE], + ['RTCIceGatheringState', base_config_1.TYPE], + ['RTCIceProtocol', base_config_1.TYPE], + ['RTCIceRole', base_config_1.TYPE], + ['RTCIceTcpCandidateType', base_config_1.TYPE], + ['RTCIceTransportPolicy', base_config_1.TYPE], + ['RTCIceTransportState', base_config_1.TYPE], + ['RTCPeerConnectionState', base_config_1.TYPE], + ['RTCPriorityType', base_config_1.TYPE], + ['RTCQualityLimitationReason', base_config_1.TYPE], + ['RTCRtcpMuxPolicy', base_config_1.TYPE], + ['RTCRtpTransceiverDirection', base_config_1.TYPE], + ['RTCSctpTransportState', base_config_1.TYPE], + ['RTCSdpType', base_config_1.TYPE], + ['RTCSignalingState', base_config_1.TYPE], + ['RTCStatsIceCandidatePairState', base_config_1.TYPE], + ['RTCStatsType', base_config_1.TYPE], + ['ReadableStreamReaderMode', base_config_1.TYPE], + ['ReadableStreamType', base_config_1.TYPE], + ['ReadyState', base_config_1.TYPE], + ['RecordingState', base_config_1.TYPE], + ['ReferrerPolicy', base_config_1.TYPE], + ['RemotePlaybackState', base_config_1.TYPE], + ['RequestCache', base_config_1.TYPE], + ['RequestCredentials', base_config_1.TYPE], + ['RequestDestination', base_config_1.TYPE], + ['RequestMode', base_config_1.TYPE], + ['RequestPriority', base_config_1.TYPE], + ['RequestRedirect', base_config_1.TYPE], + ['ResidentKeyRequirement', base_config_1.TYPE], + ['ResizeObserverBoxOptions', base_config_1.TYPE], + ['ResizeQuality', base_config_1.TYPE], + ['ResponseType', base_config_1.TYPE], + ['ScrollBehavior', base_config_1.TYPE], + ['ScrollLogicalPosition', base_config_1.TYPE], + ['ScrollRestoration', base_config_1.TYPE], + ['ScrollSetting', base_config_1.TYPE], + ['SecurityPolicyViolationEventDisposition', base_config_1.TYPE], + ['SelectionMode', base_config_1.TYPE], + ['ServiceWorkerState', base_config_1.TYPE], + ['ServiceWorkerUpdateViaCache', base_config_1.TYPE], + ['ShadowRootMode', base_config_1.TYPE], + ['SlotAssignmentMode', base_config_1.TYPE], + ['SpeechSynthesisErrorCode', base_config_1.TYPE], + ['TextTrackKind', base_config_1.TYPE], + ['TextTrackMode', base_config_1.TYPE], + ['TouchType', base_config_1.TYPE], + ['TransferFunction', base_config_1.TYPE], + ['UserVerificationRequirement', base_config_1.TYPE], + ['VideoColorPrimaries', base_config_1.TYPE], + ['VideoEncoderBitrateMode', base_config_1.TYPE], + ['VideoFacingModeEnum', base_config_1.TYPE], + ['VideoMatrixCoefficients', base_config_1.TYPE], + ['VideoPixelFormat', base_config_1.TYPE], + ['VideoTransferCharacteristics', base_config_1.TYPE], + ['WakeLockType', base_config_1.TYPE], + ['WebGLPowerPreference', base_config_1.TYPE], + ['WebTransportCongestionControl', base_config_1.TYPE], + ['WebTransportErrorSource', base_config_1.TYPE], + ['WorkerType', base_config_1.TYPE], + ['WriteCommandType', base_config_1.TYPE], + ['XMLHttpRequestResponseType', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts.map new file mode 100644 index 0000000..db37fad --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.collection.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.collection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,iBAAiB,EAAE,aAc/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js new file mode 100644 index 0000000..30f3035 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js @@ -0,0 +1,23 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_collection = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_collection = { + libs: [], + variables: [ + ['Map', base_config_1.TYPE_VALUE], + ['MapConstructor', base_config_1.TYPE], + ['ReadonlyMap', base_config_1.TYPE], + ['WeakMap', base_config_1.TYPE_VALUE], + ['WeakMapConstructor', base_config_1.TYPE], + ['Set', base_config_1.TYPE_VALUE], + ['SetConstructor', base_config_1.TYPE], + ['ReadonlySet', base_config_1.TYPE], + ['WeakSet', base_config_1.TYPE_VALUE], + ['WeakSetConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts.map new file mode 100644 index 0000000..7eaa108 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.core.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.core.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAyBzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js new file mode 100644 index 0000000..f8c2a08 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js @@ -0,0 +1,34 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_core = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_core = { + libs: [], + variables: [ + ['Array', base_config_1.TYPE], + ['ArrayConstructor', base_config_1.TYPE], + ['DateConstructor', base_config_1.TYPE], + ['Function', base_config_1.TYPE], + ['Math', base_config_1.TYPE], + ['NumberConstructor', base_config_1.TYPE], + ['ObjectConstructor', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ['RegExpConstructor', base_config_1.TYPE], + ['String', base_config_1.TYPE], + ['StringConstructor', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts.map new file mode 100644 index 0000000..81ef182 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD,eAAO,MAAM,MAAM,EAAE,aAcpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts.map new file mode 100644 index 0000000..d22be27 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.generator.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.generator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,gBAAgB,EAAE,aAO9B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js new file mode 100644 index 0000000..0b51a85 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_generator = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2015_generator = { + libs: [es2015_iterable_1.es2015_iterable], + variables: [ + ['Generator', base_config_1.TYPE], + ['GeneratorFunction', base_config_1.TYPE], + ['GeneratorFunctionConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts.map new file mode 100644 index 0000000..bb7bc33 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.iterable.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.iterable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,eAAe,EAAE,aAoD7B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js new file mode 100644 index 0000000..d91a0a7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js @@ -0,0 +1,62 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_iterable = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2015_iterable = { + libs: [es2015_symbol_1.es2015_symbol], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['IteratorYieldResult', base_config_1.TYPE], + ['IteratorReturnResult', base_config_1.TYPE], + ['IteratorResult', base_config_1.TYPE], + ['Iterator', base_config_1.TYPE], + ['Iterable', base_config_1.TYPE], + ['IterableIterator', base_config_1.TYPE], + ['IteratorObject', base_config_1.TYPE], + ['BuiltinIteratorReturn', base_config_1.TYPE], + ['ArrayIterator', base_config_1.TYPE], + ['Array', base_config_1.TYPE], + ['ArrayConstructor', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['IArguments', base_config_1.TYPE], + ['MapIterator', base_config_1.TYPE], + ['Map', base_config_1.TYPE], + ['ReadonlyMap', base_config_1.TYPE], + ['MapConstructor', base_config_1.TYPE], + ['WeakMap', base_config_1.TYPE], + ['WeakMapConstructor', base_config_1.TYPE], + ['SetIterator', base_config_1.TYPE], + ['Set', base_config_1.TYPE], + ['ReadonlySet', base_config_1.TYPE], + ['SetConstructor', base_config_1.TYPE], + ['WeakSet', base_config_1.TYPE], + ['WeakSetConstructor', base_config_1.TYPE], + ['Promise', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ['StringIterator', base_config_1.TYPE], + ['String', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Int8ArrayConstructor', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ArrayConstructor', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Uint8ClampedArrayConstructor', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Int16ArrayConstructor', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Uint16ArrayConstructor', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Int32ArrayConstructor', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Uint32ArrayConstructor', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float32ArrayConstructor', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ['Float64ArrayConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js new file mode 100644 index 0000000..44ab404 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js @@ -0,0 +1,32 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015 = void 0; +const es5_1 = require("./es5"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_core_1 = require("./es2015.core"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es2015 = { + libs: [ + es5_1.es5, + es2015_core_1.es2015_core, + es2015_collection_1.es2015_collection, + es2015_iterable_1.es2015_iterable, + es2015_generator_1.es2015_generator, + es2015_promise_1.es2015_promise, + es2015_proxy_1.es2015_proxy, + es2015_reflect_1.es2015_reflect, + es2015_symbol_1.es2015_symbol, + es2015_symbol_wellknown_1.es2015_symbol_wellknown, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts.map new file mode 100644 index 0000000..1eb7cf9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.promise.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.promise.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,cAAc,EAAE,aAG5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js new file mode 100644 index 0000000..aca5961 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_promise = { + libs: [], + variables: [['PromiseConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts.map new file mode 100644 index 0000000..088e968 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.proxy.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.proxy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,YAAY,EAAE,aAM1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js new file mode 100644 index 0000000..2ce5022 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_proxy = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_proxy = { + libs: [], + variables: [ + ['ProxyHandler', base_config_1.TYPE], + ['ProxyConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts.map new file mode 100644 index 0000000..2aafc04 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.reflect.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.reflect.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,cAAc,EAAE,aAG5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js new file mode 100644 index 0000000..0e29c2e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_reflect = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_reflect = { + libs: [], + variables: [['Reflect', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts.map new file mode 100644 index 0000000..b202a75 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.symbol.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.symbol.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js new file mode 100644 index 0000000..2baaf5a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_symbol = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_symbol = { + libs: [], + variables: [['SymbolConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts.map new file mode 100644 index 0000000..277f754 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.symbol.wellknown.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.symbol.wellknown.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,uBAAuB,EAAE,aAqCrC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js new file mode 100644 index 0000000..fc5dadd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js @@ -0,0 +1,47 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_symbol_wellknown = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2015_symbol_wellknown = { + libs: [es2015_symbol_1.es2015_symbol], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['Symbol', base_config_1.TYPE], + ['Array', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Date', base_config_1.TYPE], + ['Map', base_config_1.TYPE], + ['WeakMap', base_config_1.TYPE], + ['Set', base_config_1.TYPE], + ['WeakSet', base_config_1.TYPE], + ['JSON', base_config_1.TYPE], + ['Function', base_config_1.TYPE], + ['GeneratorFunction', base_config_1.TYPE], + ['Math', base_config_1.TYPE], + ['Promise', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ['RegExpConstructor', base_config_1.TYPE], + ['String', base_config_1.TYPE], + ['ArrayBuffer', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ['ArrayConstructor', base_config_1.TYPE], + ['MapConstructor', base_config_1.TYPE], + ['SetConstructor', base_config_1.TYPE], + ['ArrayBufferConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts.map new file mode 100644 index 0000000..83a5572 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.array.include.d.ts","sourceRoot":"","sources":["../../src/lib/es2016.array.include.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,oBAAoB,EAAE,aAelC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js new file mode 100644 index 0000000..baab2d1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016_array_include = void 0; +const base_config_1 = require("./base-config"); +exports.es2016_array_include = { + libs: [], + variables: [ + ['Array', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts.map new file mode 100644 index 0000000..d5ec029 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.d.ts","sourceRoot":"","sources":["../../src/lib/es2016.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,MAAM,EAAE,aAGpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts.map new file mode 100644 index 0000000..49a637e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2016.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js new file mode 100644 index 0000000..029ae1c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016_full = void 0; +const dom_1 = require("./dom"); +const dom_iterable_1 = require("./dom.iterable"); +const es2016_1 = require("./es2016"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2016_full = { + libs: [es2016_1.es2016, dom_1.dom, webworker_importscripts_1.webworker_importscripts, scripthost_1.scripthost, dom_iterable_1.dom_iterable], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.d.ts.map new file mode 100644 index 0000000..0a6ae8f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2016.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.js new file mode 100644 index 0000000..e32da50 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2016_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js new file mode 100644 index 0000000..b98f66d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016 = void 0; +const es2015_1 = require("./es2015"); +const es2016_array_include_1 = require("./es2016.array.include"); +const es2016_intl_1 = require("./es2016.intl"); +exports.es2016 = { + libs: [es2015_1.es2015, es2016_array_include_1.es2016_array_include, es2016_intl_1.es2016_intl], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.d.ts.map new file mode 100644 index 0000000..b1ec808 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.arraybuffer.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.arraybuffer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,kBAAkB,EAAE,aAGhC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.js new file mode 100644 index 0000000..8f96439 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_arraybuffer = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_arraybuffer = { + libs: [], + variables: [['ArrayBufferConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts.map new file mode 100644 index 0000000..62cc070 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAWjD,eAAO,MAAM,MAAM,EAAE,aAYpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.d.ts.map new file mode 100644 index 0000000..c37dfb1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.date.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.date.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.js new file mode 100644 index 0000000..5e54f22 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_date = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_date = { + libs: [], + variables: [['DateConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts.map new file mode 100644 index 0000000..e474215 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js new file mode 100644 index 0000000..12a1568 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_full = void 0; +const dom_1 = require("./dom"); +const dom_iterable_1 = require("./dom.iterable"); +const es2017_1 = require("./es2017"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2017_full = { + libs: [es2017_1.es2017, dom_1.dom, webworker_importscripts_1.webworker_importscripts, scripthost_1.scripthost, dom_iterable_1.dom_iterable], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts.map new file mode 100644 index 0000000..4898b0c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js new file mode 100644 index 0000000..4b9ba6a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js new file mode 100644 index 0000000..bef7d0c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js @@ -0,0 +1,28 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017 = void 0; +const es2016_1 = require("./es2016"); +const es2017_arraybuffer_1 = require("./es2017.arraybuffer"); +const es2017_date_1 = require("./es2017.date"); +const es2017_intl_1 = require("./es2017.intl"); +const es2017_object_1 = require("./es2017.object"); +const es2017_sharedmemory_1 = require("./es2017.sharedmemory"); +const es2017_string_1 = require("./es2017.string"); +const es2017_typedarrays_1 = require("./es2017.typedarrays"); +exports.es2017 = { + libs: [ + es2016_1.es2016, + es2017_arraybuffer_1.es2017_arraybuffer, + es2017_date_1.es2017_date, + es2017_intl_1.es2017_intl, + es2017_object_1.es2017_object, + es2017_sharedmemory_1.es2017_sharedmemory, + es2017_string_1.es2017_string, + es2017_typedarrays_1.es2017_typedarrays, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts.map new file mode 100644 index 0000000..b18737d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.object.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.object.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js new file mode 100644 index 0000000..85c7b95 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_object = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_object = { + libs: [], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts.map new file mode 100644 index 0000000..271fdbf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.sharedmemory.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.sharedmemory.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,mBAAmB,EAAE,aAQjC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js new file mode 100644 index 0000000..66d0844 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js @@ -0,0 +1,19 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_sharedmemory = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es2017_sharedmemory = { + libs: [es2015_symbol_1.es2015_symbol, es2015_symbol_wellknown_1.es2015_symbol_wellknown], + variables: [ + ['SharedArrayBuffer', base_config_1.TYPE_VALUE], + ['SharedArrayBufferConstructor', base_config_1.TYPE], + ['ArrayBufferTypes', base_config_1.TYPE], + ['Atomics', base_config_1.TYPE_VALUE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts.map new file mode 100644 index 0000000..0d175b0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js new file mode 100644 index 0000000..3093985 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts.map new file mode 100644 index 0000000..9eee679 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.typedarrays.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.typedarrays.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,kBAAkB,EAAE,aAahC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js new file mode 100644 index 0000000..986aed9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js @@ -0,0 +1,22 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_typedarrays = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_typedarrays = { + libs: [], + variables: [ + ['Int8ArrayConstructor', base_config_1.TYPE], + ['Uint8ArrayConstructor', base_config_1.TYPE], + ['Uint8ClampedArrayConstructor', base_config_1.TYPE], + ['Int16ArrayConstructor', base_config_1.TYPE], + ['Uint16ArrayConstructor', base_config_1.TYPE], + ['Int32ArrayConstructor', base_config_1.TYPE], + ['Uint32ArrayConstructor', base_config_1.TYPE], + ['Float32ArrayConstructor', base_config_1.TYPE], + ['Float64ArrayConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts.map new file mode 100644 index 0000000..d49718b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.asyncgenerator.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.asyncgenerator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,qBAAqB,EAAE,aAOnC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js new file mode 100644 index 0000000..653f373 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_asyncgenerator = void 0; +const base_config_1 = require("./base-config"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +exports.es2018_asyncgenerator = { + libs: [es2018_asynciterable_1.es2018_asynciterable], + variables: [ + ['AsyncGenerator', base_config_1.TYPE], + ['AsyncGeneratorFunction', base_config_1.TYPE], + ['AsyncGeneratorFunctionConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts.map new file mode 100644 index 0000000..5924c70 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.asynciterable.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.asynciterable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,oBAAoB,EAAE,aASlC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js new file mode 100644 index 0000000..028f65c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js @@ -0,0 +1,20 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_asynciterable = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2018_asynciterable = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['AsyncIterator', base_config_1.TYPE], + ['AsyncIterable', base_config_1.TYPE], + ['AsyncIterableIterator', base_config_1.TYPE], + ['AsyncIteratorObject', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts.map new file mode 100644 index 0000000..765264d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,MAAM,EAAE,aAUpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts.map new file mode 100644 index 0000000..06e8c0f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,WAAW,EAAE,aAUzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js new file mode 100644 index 0000000..51466f5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2018_1 = require("./es2018"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2018_full = { + libs: [ + es2018_1.es2018, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts.map new file mode 100644 index 0000000..73b8c8b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js new file mode 100644 index 0000000..f5a83a9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2018_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js new file mode 100644 index 0000000..d618693 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018 = void 0; +const es2017_1 = require("./es2017"); +const es2018_asyncgenerator_1 = require("./es2018.asyncgenerator"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +const es2018_intl_1 = require("./es2018.intl"); +const es2018_promise_1 = require("./es2018.promise"); +const es2018_regexp_1 = require("./es2018.regexp"); +exports.es2018 = { + libs: [ + es2017_1.es2017, + es2018_asynciterable_1.es2018_asynciterable, + es2018_asyncgenerator_1.es2018_asyncgenerator, + es2018_promise_1.es2018_promise, + es2018_regexp_1.es2018_regexp, + es2018_intl_1.es2018_intl, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts.map new file mode 100644 index 0000000..ecfcc36 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.promise.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.promise.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,cAAc,EAAE,aAG5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js new file mode 100644 index 0000000..d4bafd7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2018_promise = { + libs: [], + variables: [['Promise', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts.map new file mode 100644 index 0000000..978490d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.regexp.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.regexp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAO3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js new file mode 100644 index 0000000..3de3e33 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.es2018_regexp = { + libs: [], + variables: [ + ['RegExpMatchArray', base_config_1.TYPE], + ['RegExpExecArray', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts.map new file mode 100644 index 0000000..876a8eb --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.array.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.array.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,YAAY,EAAE,aAO1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js new file mode 100644 index 0000000..8b314e6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_array = void 0; +const base_config_1 = require("./base-config"); +exports.es2019_array = { + libs: [], + variables: [ + ['FlatArray', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Array', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map new file mode 100644 index 0000000..0337d9b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,MAAM,EAAE,aAUpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts.map new file mode 100644 index 0000000..accff5a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,WAAW,EAAE,aAUzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js new file mode 100644 index 0000000..e9d2503 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2019_1 = require("./es2019"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2019_full = { + libs: [ + es2019_1.es2019, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts.map new file mode 100644 index 0000000..f83ecbf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js new file mode 100644 index 0000000..01c9469 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2019_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js new file mode 100644 index 0000000..de5c6a2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019 = void 0; +const es2018_1 = require("./es2018"); +const es2019_array_1 = require("./es2019.array"); +const es2019_intl_1 = require("./es2019.intl"); +const es2019_object_1 = require("./es2019.object"); +const es2019_string_1 = require("./es2019.string"); +const es2019_symbol_1 = require("./es2019.symbol"); +exports.es2019 = { + libs: [ + es2018_1.es2018, + es2019_array_1.es2019_array, + es2019_object_1.es2019_object, + es2019_string_1.es2019_string, + es2019_symbol_1.es2019_symbol, + es2019_intl_1.es2019_intl, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts.map new file mode 100644 index 0000000..ba581cf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.object.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.object.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js new file mode 100644 index 0000000..2d197bb --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_object = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2019_object = { + libs: [es2015_iterable_1.es2015_iterable], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts.map new file mode 100644 index 0000000..0abb46a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js new file mode 100644 index 0000000..b311a5b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2019_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts.map new file mode 100644 index 0000000..dd77e9f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.symbol.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.symbol.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js new file mode 100644 index 0000000..af24022 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_symbol = void 0; +const base_config_1 = require("./base-config"); +exports.es2019_symbol = { + libs: [], + variables: [['Symbol', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map new file mode 100644 index 0000000..188837f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.bigint.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.bigint.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,aAAa,EAAE,aAa3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js new file mode 100644 index 0000000..8956da3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js @@ -0,0 +1,23 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_bigint = void 0; +const base_config_1 = require("./base-config"); +const es2020_intl_1 = require("./es2020.intl"); +exports.es2020_bigint = { + libs: [es2020_intl_1.es2020_intl], + variables: [ + ['BigIntToLocaleStringOptions', base_config_1.TYPE], + ['BigInt', base_config_1.TYPE_VALUE], + ['BigIntConstructor', base_config_1.TYPE], + ['BigInt64Array', base_config_1.TYPE_VALUE], + ['BigInt64ArrayConstructor', base_config_1.TYPE], + ['BigUint64Array', base_config_1.TYPE_VALUE], + ['BigUint64ArrayConstructor', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ['Intl', base_config_1.TYPE_VALUE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map new file mode 100644 index 0000000..dc85ad4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAYjD,eAAO,MAAM,MAAM,EAAE,aAapB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts.map new file mode 100644 index 0000000..03be476 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.date.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.date.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js new file mode 100644 index 0000000..adcad45 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_date = void 0; +const base_config_1 = require("./base-config"); +const es2020_intl_1 = require("./es2020.intl"); +exports.es2020_date = { + libs: [es2020_intl_1.es2020_intl], + variables: [['Date', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts.map new file mode 100644 index 0000000..3e63439 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,WAAW,EAAE,aAUzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js new file mode 100644 index 0000000..200fedf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2020_1 = require("./es2020"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2020_full = { + libs: [ + es2020_1.es2020, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map new file mode 100644 index 0000000..49e71a8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js new file mode 100644 index 0000000..36a0f07 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_intl = void 0; +const base_config_1 = require("./base-config"); +const es2018_intl_1 = require("./es2018.intl"); +exports.es2020_intl = { + libs: [es2018_intl_1.es2018_intl], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js new file mode 100644 index 0000000..9997667 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js @@ -0,0 +1,30 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020 = void 0; +const es2019_1 = require("./es2019"); +const es2020_bigint_1 = require("./es2020.bigint"); +const es2020_date_1 = require("./es2020.date"); +const es2020_intl_1 = require("./es2020.intl"); +const es2020_number_1 = require("./es2020.number"); +const es2020_promise_1 = require("./es2020.promise"); +const es2020_sharedmemory_1 = require("./es2020.sharedmemory"); +const es2020_string_1 = require("./es2020.string"); +const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown"); +exports.es2020 = { + libs: [ + es2019_1.es2019, + es2020_bigint_1.es2020_bigint, + es2020_date_1.es2020_date, + es2020_number_1.es2020_number, + es2020_promise_1.es2020_promise, + es2020_sharedmemory_1.es2020_sharedmemory, + es2020_string_1.es2020_string, + es2020_symbol_wellknown_1.es2020_symbol_wellknown, + es2020_intl_1.es2020_intl, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts.map new file mode 100644 index 0000000..ab03a3f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.number.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.number.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js new file mode 100644 index 0000000..bafbf93 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_number = void 0; +const base_config_1 = require("./base-config"); +const es2020_intl_1 = require("./es2020.intl"); +exports.es2020_number = { + libs: [es2020_intl_1.es2020_intl], + variables: [['Number', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts.map new file mode 100644 index 0000000..c0d5b54 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.promise.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.promise.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js new file mode 100644 index 0000000..0640cef --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2020_promise = { + libs: [], + variables: [ + ['PromiseFulfilledResult', base_config_1.TYPE], + ['PromiseRejectedResult', base_config_1.TYPE], + ['PromiseSettledResult', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.d.ts.map new file mode 100644 index 0000000..a7acf31 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.sharedmemory.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.sharedmemory.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,mBAAmB,EAAE,aAGjC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.js new file mode 100644 index 0000000..d945547 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_sharedmemory = void 0; +const base_config_1 = require("./base-config"); +const es2020_bigint_1 = require("./es2020.bigint"); +exports.es2020_sharedmemory = { + libs: [es2020_bigint_1.es2020_bigint], + variables: [['Atomics', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts.map new file mode 100644 index 0000000..53fcbe9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js new file mode 100644 index 0000000..78390da --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_string = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2020_intl_1 = require("./es2020.intl"); +const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown"); +exports.es2020_string = { + libs: [es2015_iterable_1.es2015_iterable, es2020_intl_1.es2020_intl, es2020_symbol_wellknown_1.es2020_symbol_wellknown], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts.map new file mode 100644 index 0000000..430d5d0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.symbol.wellknown.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.symbol.wellknown.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,uBAAuB,EAAE,aAOrC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js new file mode 100644 index 0000000..23374c4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js @@ -0,0 +1,18 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_symbol_wellknown = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2020_symbol_wellknown = { + libs: [es2015_iterable_1.es2015_iterable, es2015_symbol_1.es2015_symbol], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['RegExpStringIterator', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.d.ts.map new file mode 100644 index 0000000..b362a0f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2021.d.ts","sourceRoot":"","sources":["../../src/lib/es2021.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD,eAAO,MAAM,MAAM,EAAE,aAGpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.d.ts.map new file mode 100644 index 0000000..913239e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2021.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2021.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,WAAW,EAAE,aAUzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.js new file mode 100644 index 0000000..09d9ead --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2021_1 = require("./es2021"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2021_full = { + libs: [ + es2021_1.es2021, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.d.ts.map new file mode 100644 index 0000000..9a95e0f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2021.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2021.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.js new file mode 100644 index 0000000..e4f1784 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2021_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.js new file mode 100644 index 0000000..a62791f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021 = void 0; +const es2020_1 = require("./es2020"); +const es2021_intl_1 = require("./es2021.intl"); +const es2021_promise_1 = require("./es2021.promise"); +const es2021_string_1 = require("./es2021.string"); +const es2021_weakref_1 = require("./es2021.weakref"); +exports.es2021 = { + libs: [es2020_1.es2020, es2021_promise_1.es2021_promise, es2021_string_1.es2021_string, es2021_weakref_1.es2021_weakref, es2021_intl_1.es2021_intl], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.d.ts.map new file mode 100644 index 0000000..4c4bdaa --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2021.promise.d.ts","sourceRoot":"","sources":["../../src/lib/es2021.promise.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,cAAc,EAAE,aAO5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.js new file mode 100644 index 0000000..515cebc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2021_promise = { + libs: [], + variables: [ + ['AggregateError', base_config_1.TYPE_VALUE], + ['AggregateErrorConstructor', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.d.ts.map new file mode 100644 index 0000000..f2afcab --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2021.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2021.string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.js new file mode 100644 index 0000000..54dd131 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2021_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.d.ts.map new file mode 100644 index 0000000..98aee9b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2021.weakref.d.ts","sourceRoot":"","sources":["../../src/lib/es2021.weakref.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.js new file mode 100644 index 0000000..5e85a24 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.js @@ -0,0 +1,18 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_weakref = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es2021_weakref = { + libs: [es2015_symbol_wellknown_1.es2015_symbol_wellknown], + variables: [ + ['WeakRef', base_config_1.TYPE_VALUE], + ['WeakRefConstructor', base_config_1.TYPE], + ['FinalizationRegistry', base_config_1.TYPE_VALUE], + ['FinalizationRegistryConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.d.ts.map new file mode 100644 index 0000000..5d96a1f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2022.array.d.ts","sourceRoot":"","sources":["../../src/lib/es2022.array.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,YAAY,EAAE,aAiB1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.js new file mode 100644 index 0000000..f66580d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_array = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_array = { + libs: [], + variables: [ + ['Array', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ['BigInt64Array', base_config_1.TYPE], + ['BigUint64Array', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts.map new file mode 100644 index 0000000..5db589f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2022.d.ts","sourceRoot":"","sources":["../../src/lib/es2022.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAUjD,eAAO,MAAM,MAAM,EAAE,aAWpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.d.ts.map new file mode 100644 index 0000000..5d29053 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2022.error.d.ts","sourceRoot":"","sources":["../../src/lib/es2022.error.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,YAAY,EAAE,aAc1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.js new file mode 100644 index 0000000..a880a6e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_error = void 0; +const base_config_1 = require("./base-config"); +const es2021_promise_1 = require("./es2021.promise"); +exports.es2022_error = { + libs: [es2021_promise_1.es2021_promise], + variables: [ + ['ErrorOptions', base_config_1.TYPE], + ['Error', base_config_1.TYPE], + ['ErrorConstructor', base_config_1.TYPE], + ['EvalErrorConstructor', base_config_1.TYPE], + ['RangeErrorConstructor', base_config_1.TYPE], + ['ReferenceErrorConstructor', base_config_1.TYPE], + ['SyntaxErrorConstructor', base_config_1.TYPE], + ['TypeErrorConstructor', base_config_1.TYPE], + ['URIErrorConstructor', base_config_1.TYPE], + ['AggregateErrorConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.d.ts.map new file mode 100644 index 0000000..bfd70a0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2022.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2022.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,WAAW,EAAE,aAUzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.js new file mode 100644 index 0000000..378631b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2022_1 = require("./es2022"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2022_full = { + libs: [ + es2022_1.es2022, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts.map new file mode 100644 index 0000000..40c294c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2022.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2022.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js new file mode 100644 index 0000000..afe167d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js new file mode 100644 index 0000000..382f73d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022 = void 0; +const es2021_1 = require("./es2021"); +const es2022_array_1 = require("./es2022.array"); +const es2022_error_1 = require("./es2022.error"); +const es2022_intl_1 = require("./es2022.intl"); +const es2022_object_1 = require("./es2022.object"); +const es2022_regexp_1 = require("./es2022.regexp"); +const es2022_string_1 = require("./es2022.string"); +exports.es2022 = { + libs: [ + es2021_1.es2021, + es2022_array_1.es2022_array, + es2022_error_1.es2022_error, + es2022_intl_1.es2022_intl, + es2022_object_1.es2022_object, + es2022_regexp_1.es2022_regexp, + es2022_string_1.es2022_string, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.d.ts.map new file mode 100644 index 0000000..e6d4b07 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2022.object.d.ts","sourceRoot":"","sources":["../../src/lib/es2022.object.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js new file mode 100644 index 0000000..81699ac --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_object = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_object = { + libs: [], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.d.ts.map new file mode 100644 index 0000000..d4ecb5b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2022.regexp.d.ts","sourceRoot":"","sources":["../../src/lib/es2022.regexp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAQ3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.js new file mode 100644 index 0000000..ab78510 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_regexp = { + libs: [], + variables: [ + ['RegExpMatchArray', base_config_1.TYPE], + ['RegExpExecArray', base_config_1.TYPE], + ['RegExpIndicesArray', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.d.ts.map new file mode 100644 index 0000000..c6b022e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2022.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2022.string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.js new file mode 100644 index 0000000..500dd50 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.d.ts.map new file mode 100644 index 0000000..19221cf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2023.array.d.ts","sourceRoot":"","sources":["../../src/lib/es2023.array.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,YAAY,EAAE,aAiB1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.js new file mode 100644 index 0000000..5b9a19b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023_array = void 0; +const base_config_1 = require("./base-config"); +exports.es2023_array = { + libs: [], + variables: [ + ['Array', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ['BigInt64Array', base_config_1.TYPE], + ['BigUint64Array', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.d.ts.map new file mode 100644 index 0000000..5e70e10 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2023.collection.d.ts","sourceRoot":"","sources":["../../src/lib/es2023.collection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,iBAAiB,EAAE,aAG/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.js new file mode 100644 index 0000000..b6ef0b3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023_collection = void 0; +const base_config_1 = require("./base-config"); +exports.es2023_collection = { + libs: [], + variables: [['WeakKeyTypes', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.d.ts.map new file mode 100644 index 0000000..479c56a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2023.d.ts","sourceRoot":"","sources":["../../src/lib/es2023.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,eAAO,MAAM,MAAM,EAAE,aAGpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.d.ts.map new file mode 100644 index 0000000..bee4941 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2023.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2023.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,WAAW,EAAE,aAUzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.js new file mode 100644 index 0000000..88dbbe2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2023_1 = require("./es2023"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2023_full = { + libs: [ + es2023_1.es2023, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.d.ts.map new file mode 100644 index 0000000..cde05d8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2023.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2023.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.js new file mode 100644 index 0000000..d67b565 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2023_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.js new file mode 100644 index 0000000..7369e24 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023 = void 0; +const es2022_1 = require("./es2022"); +const es2023_array_1 = require("./es2023.array"); +const es2023_collection_1 = require("./es2023.collection"); +const es2023_intl_1 = require("./es2023.intl"); +exports.es2023 = { + libs: [es2022_1.es2022, es2023_array_1.es2023_array, es2023_collection_1.es2023_collection, es2023_intl_1.es2023_intl], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.d.ts.map new file mode 100644 index 0000000..2cbdb61 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.arraybuffer.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.arraybuffer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,kBAAkB,EAAE,aAMhC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.js new file mode 100644 index 0000000..c11b486 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_arraybuffer = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_arraybuffer = { + libs: [], + variables: [ + ['ArrayBuffer', base_config_1.TYPE], + ['ArrayBufferConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.d.ts.map new file mode 100644 index 0000000..ba7fcbc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.collection.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.collection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,iBAAiB,EAAE,aAG/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.js new file mode 100644 index 0000000..e0c7b68 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_collection = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_collection = { + libs: [], + variables: [['MapConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.d.ts.map new file mode 100644 index 0000000..5b26f10 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAWjD,eAAO,MAAM,MAAM,EAAE,aAYpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.d.ts.map new file mode 100644 index 0000000..bd384ba --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,WAAW,EAAE,aAUzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.js new file mode 100644 index 0000000..5f31eef --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2024_1 = require("./es2024"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2024_full = { + libs: [ + es2024_1.es2024, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.js new file mode 100644 index 0000000..fddb877 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.js @@ -0,0 +1,28 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024 = void 0; +const es2023_1 = require("./es2023"); +const es2024_arraybuffer_1 = require("./es2024.arraybuffer"); +const es2024_collection_1 = require("./es2024.collection"); +const es2024_object_1 = require("./es2024.object"); +const es2024_promise_1 = require("./es2024.promise"); +const es2024_regexp_1 = require("./es2024.regexp"); +const es2024_sharedmemory_1 = require("./es2024.sharedmemory"); +const es2024_string_1 = require("./es2024.string"); +exports.es2024 = { + libs: [ + es2023_1.es2023, + es2024_arraybuffer_1.es2024_arraybuffer, + es2024_collection_1.es2024_collection, + es2024_object_1.es2024_object, + es2024_promise_1.es2024_promise, + es2024_regexp_1.es2024_regexp, + es2024_sharedmemory_1.es2024_sharedmemory, + es2024_string_1.es2024_string, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.d.ts.map new file mode 100644 index 0000000..6278015 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.object.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.object.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.js new file mode 100644 index 0000000..e733f70 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_object = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_object = { + libs: [], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.d.ts.map new file mode 100644 index 0000000..d8b453b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.promise.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.promise.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,cAAc,EAAE,aAM5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.js new file mode 100644 index 0000000..4501e65 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_promise = { + libs: [], + variables: [ + ['PromiseWithResolvers', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.d.ts.map new file mode 100644 index 0000000..276591d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.regexp.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.regexp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.js new file mode 100644 index 0000000..a2da5ad --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_regexp = { + libs: [], + variables: [['RegExp', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.d.ts.map new file mode 100644 index 0000000..7b9b733 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.sharedmemory.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.sharedmemory.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,mBAAmB,EAAE,aAOjC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.js new file mode 100644 index 0000000..2ed579b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_sharedmemory = void 0; +const base_config_1 = require("./base-config"); +const es2020_bigint_1 = require("./es2020.bigint"); +exports.es2024_sharedmemory = { + libs: [es2020_bigint_1.es2020_bigint], + variables: [ + ['Atomics', base_config_1.TYPE], + ['SharedArrayBuffer', base_config_1.TYPE], + ['SharedArrayBufferConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.d.ts.map new file mode 100644 index 0000000..3ccec64 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2024.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2024.string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.js new file mode 100644 index 0000000..fcf0029 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map new file mode 100644 index 0000000..3d4af9e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es5.d.ts","sourceRoot":"","sources":["../../src/lib/es5.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,GAAG,EAAE,aA2GjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js new file mode 100644 index 0000000..69ffa45 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js @@ -0,0 +1,118 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es5 = void 0; +const base_config_1 = require("./base-config"); +const decorators_1 = require("./decorators"); +const decorators_legacy_1 = require("./decorators.legacy"); +exports.es5 = { + libs: [decorators_1.decorators, decorators_legacy_1.decorators_legacy], + variables: [ + ['Symbol', base_config_1.TYPE], + ['PropertyKey', base_config_1.TYPE], + ['PropertyDescriptor', base_config_1.TYPE], + ['PropertyDescriptorMap', base_config_1.TYPE], + ['Object', base_config_1.TYPE_VALUE], + ['ObjectConstructor', base_config_1.TYPE], + ['Function', base_config_1.TYPE_VALUE], + ['FunctionConstructor', base_config_1.TYPE], + ['ThisParameterType', base_config_1.TYPE], + ['OmitThisParameter', base_config_1.TYPE], + ['CallableFunction', base_config_1.TYPE], + ['NewableFunction', base_config_1.TYPE], + ['IArguments', base_config_1.TYPE], + ['String', base_config_1.TYPE_VALUE], + ['StringConstructor', base_config_1.TYPE], + ['Boolean', base_config_1.TYPE_VALUE], + ['BooleanConstructor', base_config_1.TYPE], + ['Number', base_config_1.TYPE_VALUE], + ['NumberConstructor', base_config_1.TYPE], + ['TemplateStringsArray', base_config_1.TYPE], + ['ImportMeta', base_config_1.TYPE], + ['ImportCallOptions', base_config_1.TYPE], + ['ImportAssertions', base_config_1.TYPE], + ['ImportAttributes', base_config_1.TYPE], + ['Math', base_config_1.TYPE_VALUE], + ['Date', base_config_1.TYPE_VALUE], + ['DateConstructor', base_config_1.TYPE], + ['RegExpMatchArray', base_config_1.TYPE], + ['RegExpExecArray', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE_VALUE], + ['RegExpConstructor', base_config_1.TYPE], + ['Error', base_config_1.TYPE_VALUE], + ['ErrorConstructor', base_config_1.TYPE], + ['EvalError', base_config_1.TYPE_VALUE], + ['EvalErrorConstructor', base_config_1.TYPE], + ['RangeError', base_config_1.TYPE_VALUE], + ['RangeErrorConstructor', base_config_1.TYPE], + ['ReferenceError', base_config_1.TYPE_VALUE], + ['ReferenceErrorConstructor', base_config_1.TYPE], + ['SyntaxError', base_config_1.TYPE_VALUE], + ['SyntaxErrorConstructor', base_config_1.TYPE], + ['TypeError', base_config_1.TYPE_VALUE], + ['TypeErrorConstructor', base_config_1.TYPE], + ['URIError', base_config_1.TYPE_VALUE], + ['URIErrorConstructor', base_config_1.TYPE], + ['JSON', base_config_1.TYPE_VALUE], + ['ReadonlyArray', base_config_1.TYPE], + ['ConcatArray', base_config_1.TYPE], + ['Array', base_config_1.TYPE_VALUE], + ['ArrayConstructor', base_config_1.TYPE], + ['TypedPropertyDescriptor', base_config_1.TYPE], + ['PromiseConstructorLike', base_config_1.TYPE], + ['PromiseLike', base_config_1.TYPE], + ['Promise', base_config_1.TYPE], + ['Awaited', base_config_1.TYPE], + ['ArrayLike', base_config_1.TYPE], + ['Partial', base_config_1.TYPE], + ['Required', base_config_1.TYPE], + ['Readonly', base_config_1.TYPE], + ['Pick', base_config_1.TYPE], + ['Record', base_config_1.TYPE], + ['Exclude', base_config_1.TYPE], + ['Extract', base_config_1.TYPE], + ['Omit', base_config_1.TYPE], + ['NonNullable', base_config_1.TYPE], + ['Parameters', base_config_1.TYPE], + ['ConstructorParameters', base_config_1.TYPE], + ['ReturnType', base_config_1.TYPE], + ['InstanceType', base_config_1.TYPE], + ['Uppercase', base_config_1.TYPE], + ['Lowercase', base_config_1.TYPE], + ['Capitalize', base_config_1.TYPE], + ['Uncapitalize', base_config_1.TYPE], + ['NoInfer', base_config_1.TYPE], + ['ThisType', base_config_1.TYPE], + ['WeakKeyTypes', base_config_1.TYPE], + ['WeakKey', base_config_1.TYPE], + ['ArrayBuffer', base_config_1.TYPE_VALUE], + ['ArrayBufferTypes', base_config_1.TYPE], + ['ArrayBufferLike', base_config_1.TYPE], + ['ArrayBufferConstructor', base_config_1.TYPE], + ['ArrayBufferView', base_config_1.TYPE], + ['DataView', base_config_1.TYPE_VALUE], + ['DataViewConstructor', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE_VALUE], + ['Int8ArrayConstructor', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE_VALUE], + ['Uint8ArrayConstructor', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE_VALUE], + ['Uint8ClampedArrayConstructor', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE_VALUE], + ['Int16ArrayConstructor', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE_VALUE], + ['Uint16ArrayConstructor', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE_VALUE], + ['Int32ArrayConstructor', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE_VALUE], + ['Uint32ArrayConstructor', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE_VALUE], + ['Float32ArrayConstructor', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE_VALUE], + ['Float64ArrayConstructor', base_config_1.TYPE], + ['Intl', base_config_1.TYPE_VALUE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts.map new file mode 100644 index 0000000..c79acde --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es6.d.ts","sourceRoot":"","sources":["../../src/lib/es6.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD,eAAO,MAAM,GAAG,EAAE,aAcjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js new file mode 100644 index 0000000..1d5f05e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js @@ -0,0 +1,32 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es6 = void 0; +const es5_1 = require("./es5"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_core_1 = require("./es2015.core"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es6 = { + libs: [ + es5_1.es5, + es2015_core_1.es2015_core, + es2015_collection_1.es2015_collection, + es2015_iterable_1.es2015_iterable, + es2015_generator_1.es2015_generator, + es2015_promise_1.es2015_promise, + es2015_proxy_1.es2015_proxy, + es2015_reflect_1.es2015_reflect, + es2015_symbol_1.es2015_symbol, + es2015_symbol_wellknown_1.es2015_symbol_wellknown, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts.map new file mode 100644 index 0000000..9709d24 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es7.d.ts","sourceRoot":"","sources":["../../src/lib/es7.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,GAAG,EAAE,aAGjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js new file mode 100644 index 0000000..7b23ee3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es7 = void 0; +const es2015_1 = require("./es2015"); +const es2016_array_include_1 = require("./es2016.array.include"); +const es2016_intl_1 = require("./es2016.intl"); +exports.es7 = { + libs: [es2015_1.es2015, es2016_array_include_1.es2016_array_include, es2016_intl_1.es2016_intl], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts.map new file mode 100644 index 0000000..1f6b030 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.array.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.array.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,YAAY,EAAE,aAG1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js new file mode 100644 index 0000000..d94bd46 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_array = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_array = { + libs: [], + variables: [['ArrayConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts.map new file mode 100644 index 0000000..2b1525a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.asynciterable.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.asynciterable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,oBAAoB,EAAE,aASlC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js new file mode 100644 index 0000000..08501d9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js @@ -0,0 +1,20 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_asynciterable = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.esnext_asynciterable = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['AsyncIterator', base_config_1.TYPE], + ['AsyncIterable', base_config_1.TYPE], + ['AsyncIterableIterator', base_config_1.TYPE], + ['AsyncIteratorObject', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map new file mode 100644 index 0000000..9f7bcf4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.bigint.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.bigint.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,aAAa,EAAE,aAa3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js new file mode 100644 index 0000000..986f9af --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js @@ -0,0 +1,23 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_bigint = void 0; +const base_config_1 = require("./base-config"); +const es2020_intl_1 = require("./es2020.intl"); +exports.esnext_bigint = { + libs: [es2020_intl_1.es2020_intl], + variables: [ + ['BigIntToLocaleStringOptions', base_config_1.TYPE], + ['BigInt', base_config_1.TYPE_VALUE], + ['BigIntConstructor', base_config_1.TYPE], + ['BigInt64Array', base_config_1.TYPE_VALUE], + ['BigInt64ArrayConstructor', base_config_1.TYPE], + ['BigUint64Array', base_config_1.TYPE_VALUE], + ['BigUint64ArrayConstructor', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ['Intl', base_config_1.TYPE_VALUE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.d.ts.map new file mode 100644 index 0000000..8a1fc1d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.collection.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.collection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,iBAAiB,EAAE,aAO/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.js new file mode 100644 index 0000000..aff3926 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_collection = void 0; +const base_config_1 = require("./base-config"); +const es2024_collection_1 = require("./es2024.collection"); +exports.esnext_collection = { + libs: [es2024_collection_1.es2024_collection], + variables: [ + ['ReadonlySetLike', base_config_1.TYPE], + ['Set', base_config_1.TYPE], + ['ReadonlySet', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts.map new file mode 100644 index 0000000..ae5bda4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAYjD,eAAO,MAAM,MAAM,EAAE,aAapB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.d.ts.map new file mode 100644 index 0000000..f25bd5f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.decorators.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.decorators.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,iBAAiB,EAAE,aAM/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.js new file mode 100644 index 0000000..4ab3338 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_decorators = void 0; +const base_config_1 = require("./base-config"); +const decorators_1 = require("./decorators"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.esnext_decorators = { + libs: [es2015_symbol_1.es2015_symbol, decorators_1.decorators], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['Function', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.d.ts.map new file mode 100644 index 0000000..934eb73 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.disposable.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.disposable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,eAAO,MAAM,iBAAiB,EAAE,aAe/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.js new file mode 100644 index 0000000..476c497 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.js @@ -0,0 +1,27 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_disposable = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +exports.esnext_disposable = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable, es2018_asynciterable_1.es2018_asynciterable], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['Disposable', base_config_1.TYPE], + ['AsyncDisposable', base_config_1.TYPE], + ['SuppressedError', base_config_1.TYPE_VALUE], + ['SuppressedErrorConstructor', base_config_1.TYPE], + ['DisposableStack', base_config_1.TYPE_VALUE], + ['DisposableStackConstructor', base_config_1.TYPE], + ['AsyncDisposableStack', base_config_1.TYPE_VALUE], + ['AsyncDisposableStackConstructor', base_config_1.TYPE], + ['IteratorObject', base_config_1.TYPE], + ['AsyncIteratorObject', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.d.ts.map new file mode 100644 index 0000000..ca47853 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.float16.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.float16.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.js new file mode 100644 index 0000000..ca94541 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.js @@ -0,0 +1,19 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_float16 = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.esnext_float16 = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable], + variables: [ + ['Float16Array', base_config_1.TYPE_VALUE], + ['Float16ArrayConstructor', base_config_1.TYPE], + ['Math', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts.map new file mode 100644 index 0000000..7f82e61 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.full.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.full.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,WAAW,EAAE,aAUzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js new file mode 100644 index 0000000..8650003 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const esnext_1 = require("./esnext"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.esnext_full = { + libs: [ + esnext_1.esnext, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts.map new file mode 100644 index 0000000..26ec82c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.intl.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.intl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js new file mode 100644 index 0000000..cda8263 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_intl = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.d.ts.map new file mode 100644 index 0000000..f67e4ed --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.iterator.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.iterator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,eAAe,EAAE,aAM7B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.js new file mode 100644 index 0000000..b4d4f55 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_iterator = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.esnext_iterator = { + libs: [es2015_iterable_1.es2015_iterable], + variables: [ + ['Iterator', base_config_1.TYPE_VALUE], + ['IteratorObjectConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js new file mode 100644 index 0000000..474f089 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js @@ -0,0 +1,30 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext = void 0; +const es2024_1 = require("./es2024"); +const esnext_array_1 = require("./esnext.array"); +const esnext_collection_1 = require("./esnext.collection"); +const esnext_decorators_1 = require("./esnext.decorators"); +const esnext_disposable_1 = require("./esnext.disposable"); +const esnext_float16_1 = require("./esnext.float16"); +const esnext_intl_1 = require("./esnext.intl"); +const esnext_iterator_1 = require("./esnext.iterator"); +const esnext_promise_1 = require("./esnext.promise"); +exports.esnext = { + libs: [ + es2024_1.es2024, + esnext_intl_1.esnext_intl, + esnext_decorators_1.esnext_decorators, + esnext_disposable_1.esnext_disposable, + esnext_collection_1.esnext_collection, + esnext_array_1.esnext_array, + esnext_iterator_1.esnext_iterator, + esnext_promise_1.esnext_promise, + esnext_float16_1.esnext_float16, + ], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.d.ts.map new file mode 100644 index 0000000..159e8c5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.object.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.object.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.js new file mode 100644 index 0000000..4e222d9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_object = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_object = { + libs: [], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts.map new file mode 100644 index 0000000..a10b436 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.promise.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.promise.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,cAAc,EAAE,aAG5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js new file mode 100644 index 0000000..1f325c9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_promise = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_promise = { + libs: [], + variables: [['PromiseConstructor', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.d.ts.map new file mode 100644 index 0000000..a76a401 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.regexp.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.regexp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.js new file mode 100644 index 0000000..53d0b17 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_regexp = { + libs: [], + variables: [['RegExp', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts.map new file mode 100644 index 0000000..79d57da --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.string.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js new file mode 100644 index 0000000..1999ac1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_string = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts.map new file mode 100644 index 0000000..83fec72 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.symbol.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.symbol.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js new file mode 100644 index 0000000..a7935f5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_symbol = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_symbol = { + libs: [], + variables: [['Symbol', base_config_1.TYPE]], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.d.ts.map new file mode 100644 index 0000000..865c3b8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.weakref.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.weakref.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.js new file mode 100644 index 0000000..f2f4a9e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.js @@ -0,0 +1,18 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_weakref = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.esnext_weakref = { + libs: [es2015_symbol_wellknown_1.es2015_symbol_wellknown], + variables: [ + ['WeakRef', base_config_1.TYPE_VALUE], + ['WeakRefConstructor', base_config_1.TYPE], + ['FinalizationRegistry', base_config_1.TYPE_VALUE], + ['FinalizationRegistryConstructor', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map new file mode 100644 index 0000000..487056c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA6GjD,eAAO,MAAM,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CA8GjD,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js new file mode 100644 index 0000000..bda0889 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js @@ -0,0 +1,221 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lib = void 0; +const decorators_1 = require("./decorators"); +const decorators_legacy_1 = require("./decorators.legacy"); +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es5_1 = require("./es5"); +const es6_1 = require("./es6"); +const es7_1 = require("./es7"); +const es2015_1 = require("./es2015"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_core_1 = require("./es2015.core"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +const es2016_1 = require("./es2016"); +const es2016_array_include_1 = require("./es2016.array.include"); +const es2016_full_1 = require("./es2016.full"); +const es2016_intl_1 = require("./es2016.intl"); +const es2017_1 = require("./es2017"); +const es2017_arraybuffer_1 = require("./es2017.arraybuffer"); +const es2017_date_1 = require("./es2017.date"); +const es2017_full_1 = require("./es2017.full"); +const es2017_intl_1 = require("./es2017.intl"); +const es2017_object_1 = require("./es2017.object"); +const es2017_sharedmemory_1 = require("./es2017.sharedmemory"); +const es2017_string_1 = require("./es2017.string"); +const es2017_typedarrays_1 = require("./es2017.typedarrays"); +const es2018_1 = require("./es2018"); +const es2018_asyncgenerator_1 = require("./es2018.asyncgenerator"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +const es2018_full_1 = require("./es2018.full"); +const es2018_intl_1 = require("./es2018.intl"); +const es2018_promise_1 = require("./es2018.promise"); +const es2018_regexp_1 = require("./es2018.regexp"); +const es2019_1 = require("./es2019"); +const es2019_array_1 = require("./es2019.array"); +const es2019_full_1 = require("./es2019.full"); +const es2019_intl_1 = require("./es2019.intl"); +const es2019_object_1 = require("./es2019.object"); +const es2019_string_1 = require("./es2019.string"); +const es2019_symbol_1 = require("./es2019.symbol"); +const es2020_1 = require("./es2020"); +const es2020_bigint_1 = require("./es2020.bigint"); +const es2020_date_1 = require("./es2020.date"); +const es2020_full_1 = require("./es2020.full"); +const es2020_intl_1 = require("./es2020.intl"); +const es2020_number_1 = require("./es2020.number"); +const es2020_promise_1 = require("./es2020.promise"); +const es2020_sharedmemory_1 = require("./es2020.sharedmemory"); +const es2020_string_1 = require("./es2020.string"); +const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown"); +const es2021_1 = require("./es2021"); +const es2021_full_1 = require("./es2021.full"); +const es2021_intl_1 = require("./es2021.intl"); +const es2021_promise_1 = require("./es2021.promise"); +const es2021_string_1 = require("./es2021.string"); +const es2021_weakref_1 = require("./es2021.weakref"); +const es2022_1 = require("./es2022"); +const es2022_array_1 = require("./es2022.array"); +const es2022_error_1 = require("./es2022.error"); +const es2022_full_1 = require("./es2022.full"); +const es2022_intl_1 = require("./es2022.intl"); +const es2022_object_1 = require("./es2022.object"); +const es2022_regexp_1 = require("./es2022.regexp"); +const es2022_string_1 = require("./es2022.string"); +const es2023_1 = require("./es2023"); +const es2023_array_1 = require("./es2023.array"); +const es2023_collection_1 = require("./es2023.collection"); +const es2023_full_1 = require("./es2023.full"); +const es2023_intl_1 = require("./es2023.intl"); +const es2024_1 = require("./es2024"); +const es2024_arraybuffer_1 = require("./es2024.arraybuffer"); +const es2024_collection_1 = require("./es2024.collection"); +const es2024_full_1 = require("./es2024.full"); +const es2024_object_1 = require("./es2024.object"); +const es2024_promise_1 = require("./es2024.promise"); +const es2024_regexp_1 = require("./es2024.regexp"); +const es2024_sharedmemory_1 = require("./es2024.sharedmemory"); +const es2024_string_1 = require("./es2024.string"); +const esnext_1 = require("./esnext"); +const esnext_array_1 = require("./esnext.array"); +const esnext_asynciterable_1 = require("./esnext.asynciterable"); +const esnext_bigint_1 = require("./esnext.bigint"); +const esnext_collection_1 = require("./esnext.collection"); +const esnext_decorators_1 = require("./esnext.decorators"); +const esnext_disposable_1 = require("./esnext.disposable"); +const esnext_float16_1 = require("./esnext.float16"); +const esnext_full_1 = require("./esnext.full"); +const esnext_intl_1 = require("./esnext.intl"); +const esnext_iterator_1 = require("./esnext.iterator"); +const esnext_object_1 = require("./esnext.object"); +const esnext_promise_1 = require("./esnext.promise"); +const esnext_regexp_1 = require("./esnext.regexp"); +const esnext_string_1 = require("./esnext.string"); +const esnext_symbol_1 = require("./esnext.symbol"); +const esnext_weakref_1 = require("./esnext.weakref"); +const lib_1 = require("./lib"); +const scripthost_1 = require("./scripthost"); +const webworker_1 = require("./webworker"); +const webworker_asynciterable_1 = require("./webworker.asynciterable"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const webworker_iterable_1 = require("./webworker.iterable"); +exports.lib = new Map([ + ['es5', es5_1.es5], + ['es6', es6_1.es6], + ['es2015', es2015_1.es2015], + ['es7', es7_1.es7], + ['es2016', es2016_1.es2016], + ['es2017', es2017_1.es2017], + ['es2018', es2018_1.es2018], + ['es2019', es2019_1.es2019], + ['es2020', es2020_1.es2020], + ['es2021', es2021_1.es2021], + ['es2022', es2022_1.es2022], + ['es2023', es2023_1.es2023], + ['es2024', es2024_1.es2024], + ['esnext', esnext_1.esnext], + ['dom', dom_1.dom], + ['dom.iterable', dom_iterable_1.dom_iterable], + ['dom.asynciterable', dom_asynciterable_1.dom_asynciterable], + ['webworker', webworker_1.webworker], + ['webworker.importscripts', webworker_importscripts_1.webworker_importscripts], + ['webworker.iterable', webworker_iterable_1.webworker_iterable], + ['webworker.asynciterable', webworker_asynciterable_1.webworker_asynciterable], + ['scripthost', scripthost_1.scripthost], + ['es2015.core', es2015_core_1.es2015_core], + ['es2015.collection', es2015_collection_1.es2015_collection], + ['es2015.generator', es2015_generator_1.es2015_generator], + ['es2015.iterable', es2015_iterable_1.es2015_iterable], + ['es2015.promise', es2015_promise_1.es2015_promise], + ['es2015.proxy', es2015_proxy_1.es2015_proxy], + ['es2015.reflect', es2015_reflect_1.es2015_reflect], + ['es2015.symbol', es2015_symbol_1.es2015_symbol], + ['es2015.symbol.wellknown', es2015_symbol_wellknown_1.es2015_symbol_wellknown], + ['es2016.array.include', es2016_array_include_1.es2016_array_include], + ['es2016.intl', es2016_intl_1.es2016_intl], + ['es2017.arraybuffer', es2017_arraybuffer_1.es2017_arraybuffer], + ['es2017.date', es2017_date_1.es2017_date], + ['es2017.object', es2017_object_1.es2017_object], + ['es2017.sharedmemory', es2017_sharedmemory_1.es2017_sharedmemory], + ['es2017.string', es2017_string_1.es2017_string], + ['es2017.intl', es2017_intl_1.es2017_intl], + ['es2017.typedarrays', es2017_typedarrays_1.es2017_typedarrays], + ['es2018.asyncgenerator', es2018_asyncgenerator_1.es2018_asyncgenerator], + ['es2018.asynciterable', es2018_asynciterable_1.es2018_asynciterable], + ['es2018.intl', es2018_intl_1.es2018_intl], + ['es2018.promise', es2018_promise_1.es2018_promise], + ['es2018.regexp', es2018_regexp_1.es2018_regexp], + ['es2019.array', es2019_array_1.es2019_array], + ['es2019.object', es2019_object_1.es2019_object], + ['es2019.string', es2019_string_1.es2019_string], + ['es2019.symbol', es2019_symbol_1.es2019_symbol], + ['es2019.intl', es2019_intl_1.es2019_intl], + ['es2020.bigint', es2020_bigint_1.es2020_bigint], + ['es2020.date', es2020_date_1.es2020_date], + ['es2020.promise', es2020_promise_1.es2020_promise], + ['es2020.sharedmemory', es2020_sharedmemory_1.es2020_sharedmemory], + ['es2020.string', es2020_string_1.es2020_string], + ['es2020.symbol.wellknown', es2020_symbol_wellknown_1.es2020_symbol_wellknown], + ['es2020.intl', es2020_intl_1.es2020_intl], + ['es2020.number', es2020_number_1.es2020_number], + ['es2021.promise', es2021_promise_1.es2021_promise], + ['es2021.string', es2021_string_1.es2021_string], + ['es2021.weakref', es2021_weakref_1.es2021_weakref], + ['es2021.intl', es2021_intl_1.es2021_intl], + ['es2022.array', es2022_array_1.es2022_array], + ['es2022.error', es2022_error_1.es2022_error], + ['es2022.intl', es2022_intl_1.es2022_intl], + ['es2022.object', es2022_object_1.es2022_object], + ['es2022.string', es2022_string_1.es2022_string], + ['es2022.regexp', es2022_regexp_1.es2022_regexp], + ['es2023.array', es2023_array_1.es2023_array], + ['es2023.collection', es2023_collection_1.es2023_collection], + ['es2023.intl', es2023_intl_1.es2023_intl], + ['es2024.arraybuffer', es2024_arraybuffer_1.es2024_arraybuffer], + ['es2024.collection', es2024_collection_1.es2024_collection], + ['es2024.object', es2024_object_1.es2024_object], + ['es2024.promise', es2024_promise_1.es2024_promise], + ['es2024.regexp', es2024_regexp_1.es2024_regexp], + ['es2024.sharedmemory', es2024_sharedmemory_1.es2024_sharedmemory], + ['es2024.string', es2024_string_1.es2024_string], + ['esnext.array', esnext_array_1.esnext_array], + ['esnext.collection', esnext_collection_1.esnext_collection], + ['esnext.symbol', esnext_symbol_1.esnext_symbol], + ['esnext.asynciterable', esnext_asynciterable_1.esnext_asynciterable], + ['esnext.intl', esnext_intl_1.esnext_intl], + ['esnext.disposable', esnext_disposable_1.esnext_disposable], + ['esnext.bigint', esnext_bigint_1.esnext_bigint], + ['esnext.string', esnext_string_1.esnext_string], + ['esnext.promise', esnext_promise_1.esnext_promise], + ['esnext.weakref', esnext_weakref_1.esnext_weakref], + ['esnext.decorators', esnext_decorators_1.esnext_decorators], + ['esnext.object', esnext_object_1.esnext_object], + ['esnext.regexp', esnext_regexp_1.esnext_regexp], + ['esnext.iterator', esnext_iterator_1.esnext_iterator], + ['esnext.float16', esnext_float16_1.esnext_float16], + ['decorators', decorators_1.decorators], + ['decorators.legacy', decorators_legacy_1.decorators_legacy], + ['es2016.full', es2016_full_1.es2016_full], + ['es2017.full', es2017_full_1.es2017_full], + ['es2018.full', es2018_full_1.es2018_full], + ['es2019.full', es2019_full_1.es2019_full], + ['es2020.full', es2020_full_1.es2020_full], + ['es2021.full', es2021_full_1.es2021_full], + ['es2022.full', es2022_full_1.es2022_full], + ['es2023.full', es2023_full_1.es2023_full], + ['es2024.full', es2024_full_1.es2024_full], + ['esnext.full', esnext_full_1.esnext_full], + ['lib', lib_1.lib], +]); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts.map new file mode 100644 index 0000000..1c9f86f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib/lib.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,eAAO,MAAM,GAAG,EAAE,aAGjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js new file mode 100644 index 0000000..0866092 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lib = void 0; +const dom_1 = require("./dom"); +const es5_1 = require("./es5"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.lib = { + libs: [es5_1.es5, dom_1.dom, webworker_importscripts_1.webworker_importscripts, scripthost_1.scripthost], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts.map new file mode 100644 index 0000000..3c979b1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scripthost.d.ts","sourceRoot":"","sources":["../../src/lib/scripthost.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,UAAU,EAAE,aAiBxB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js new file mode 100644 index 0000000..4560751 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.scripthost = void 0; +const base_config_1 = require("./base-config"); +exports.scripthost = { + libs: [], + variables: [ + ['ActiveXObject', base_config_1.TYPE_VALUE], + ['ITextWriter', base_config_1.TYPE], + ['TextStreamBase', base_config_1.TYPE], + ['TextStreamWriter', base_config_1.TYPE], + ['TextStreamReader', base_config_1.TYPE], + ['SafeArray', base_config_1.TYPE_VALUE], + ['Enumerator', base_config_1.TYPE_VALUE], + ['EnumeratorConstructor', base_config_1.TYPE], + ['VBArray', base_config_1.TYPE_VALUE], + ['VBArrayConstructor', base_config_1.TYPE], + ['VarDate', base_config_1.TYPE_VALUE], + ['DateConstructor', base_config_1.TYPE], + ['Date', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.d.ts.map new file mode 100644 index 0000000..83f1663 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"webworker.asynciterable.d.ts","sourceRoot":"","sources":["../../src/lib/webworker.asynciterable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,uBAAuB,EAAE,aAQrC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.js new file mode 100644 index 0000000..55c9371 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker_asynciterable = void 0; +const base_config_1 = require("./base-config"); +exports.webworker_asynciterable = { + libs: [], + variables: [ + ['FileSystemDirectoryHandleAsyncIterator', base_config_1.TYPE], + ['FileSystemDirectoryHandle', base_config_1.TYPE], + ['ReadableStreamAsyncIterator', base_config_1.TYPE], + ['ReadableStream', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map new file mode 100644 index 0000000..9772b42 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"webworker.d.ts","sourceRoot":"","sources":["../../src/lib/webworker.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,SAAS,EAAE,aA+mBvB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts.map new file mode 100644 index 0000000..ee4dbe0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"webworker.importscripts.d.ts","sourceRoot":"","sources":["../../src/lib/webworker.importscripts.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,uBAAuB,EAAE,aAGrC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js new file mode 100644 index 0000000..b2d350c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js @@ -0,0 +1,11 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker_importscripts = void 0; +exports.webworker_importscripts = { + libs: [], + variables: [], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts.map new file mode 100644 index 0000000..191307a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"webworker.iterable.d.ts","sourceRoot":"","sources":["../../src/lib/webworker.iterable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,kBAAkB,EAAE,aAgChC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js new file mode 100644 index 0000000..1ba4cc7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js @@ -0,0 +1,41 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker_iterable = void 0; +const base_config_1 = require("./base-config"); +exports.webworker_iterable = { + libs: [], + variables: [ + ['CSSNumericArray', base_config_1.TYPE], + ['CSSTransformValue', base_config_1.TYPE], + ['CSSUnparsedValue', base_config_1.TYPE], + ['Cache', base_config_1.TYPE], + ['CanvasPath', base_config_1.TYPE], + ['CanvasPathDrawingStyles', base_config_1.TYPE], + ['DOMStringList', base_config_1.TYPE], + ['FileList', base_config_1.TYPE], + ['FontFaceSet', base_config_1.TYPE], + ['FormDataIterator', base_config_1.TYPE], + ['FormData', base_config_1.TYPE], + ['HeadersIterator', base_config_1.TYPE], + ['Headers', base_config_1.TYPE], + ['IDBDatabase', base_config_1.TYPE], + ['IDBObjectStore', base_config_1.TYPE], + ['ImageTrackList', base_config_1.TYPE], + ['MessageEvent', base_config_1.TYPE], + ['StylePropertyMapReadOnlyIterator', base_config_1.TYPE], + ['StylePropertyMapReadOnly', base_config_1.TYPE], + ['SubtleCrypto', base_config_1.TYPE], + ['URLSearchParamsIterator', base_config_1.TYPE], + ['URLSearchParams', base_config_1.TYPE], + ['WEBGL_draw_buffers', base_config_1.TYPE], + ['WEBGL_multi_draw', base_config_1.TYPE], + ['WebGL2RenderingContextBase', base_config_1.TYPE], + ['WebGL2RenderingContextOverloads', base_config_1.TYPE], + ['WebGLRenderingContextBase', base_config_1.TYPE], + ['WebGLRenderingContextOverloads', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js new file mode 100644 index 0000000..babe6e7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js @@ -0,0 +1,632 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker = void 0; +const base_config_1 = require("./base-config"); +exports.webworker = { + libs: [], + variables: [ + ['AddEventListenerOptions', base_config_1.TYPE], + ['AesCbcParams', base_config_1.TYPE], + ['AesCtrParams', base_config_1.TYPE], + ['AesDerivedKeyParams', base_config_1.TYPE], + ['AesGcmParams', base_config_1.TYPE], + ['AesKeyAlgorithm', base_config_1.TYPE], + ['AesKeyGenParams', base_config_1.TYPE], + ['Algorithm', base_config_1.TYPE], + ['AudioConfiguration', base_config_1.TYPE], + ['AudioDataCopyToOptions', base_config_1.TYPE], + ['AudioDataInit', base_config_1.TYPE], + ['AudioDecoderConfig', base_config_1.TYPE], + ['AudioDecoderInit', base_config_1.TYPE], + ['AudioDecoderSupport', base_config_1.TYPE], + ['AudioEncoderConfig', base_config_1.TYPE], + ['AudioEncoderInit', base_config_1.TYPE], + ['AudioEncoderSupport', base_config_1.TYPE], + ['AvcEncoderConfig', base_config_1.TYPE], + ['BlobPropertyBag', base_config_1.TYPE], + ['CSSMatrixComponentOptions', base_config_1.TYPE], + ['CSSNumericType', base_config_1.TYPE], + ['CacheQueryOptions', base_config_1.TYPE], + ['ClientQueryOptions', base_config_1.TYPE], + ['CloseEventInit', base_config_1.TYPE], + ['CryptoKeyPair', base_config_1.TYPE], + ['CustomEventInit', base_config_1.TYPE], + ['DOMMatrix2DInit', base_config_1.TYPE], + ['DOMMatrixInit', base_config_1.TYPE], + ['DOMPointInit', base_config_1.TYPE], + ['DOMQuadInit', base_config_1.TYPE], + ['DOMRectInit', base_config_1.TYPE], + ['EcKeyGenParams', base_config_1.TYPE], + ['EcKeyImportParams', base_config_1.TYPE], + ['EcdhKeyDeriveParams', base_config_1.TYPE], + ['EcdsaParams', base_config_1.TYPE], + ['EncodedAudioChunkInit', base_config_1.TYPE], + ['EncodedAudioChunkMetadata', base_config_1.TYPE], + ['EncodedVideoChunkInit', base_config_1.TYPE], + ['EncodedVideoChunkMetadata', base_config_1.TYPE], + ['ErrorEventInit', base_config_1.TYPE], + ['EventInit', base_config_1.TYPE], + ['EventListenerOptions', base_config_1.TYPE], + ['EventSourceInit', base_config_1.TYPE], + ['ExtendableEventInit', base_config_1.TYPE], + ['ExtendableMessageEventInit', base_config_1.TYPE], + ['FetchEventInit', base_config_1.TYPE], + ['FilePropertyBag', base_config_1.TYPE], + ['FileSystemCreateWritableOptions', base_config_1.TYPE], + ['FileSystemGetDirectoryOptions', base_config_1.TYPE], + ['FileSystemGetFileOptions', base_config_1.TYPE], + ['FileSystemReadWriteOptions', base_config_1.TYPE], + ['FileSystemRemoveOptions', base_config_1.TYPE], + ['FontFaceDescriptors', base_config_1.TYPE], + ['FontFaceSetLoadEventInit', base_config_1.TYPE], + ['GetNotificationOptions', base_config_1.TYPE], + ['HkdfParams', base_config_1.TYPE], + ['HmacImportParams', base_config_1.TYPE], + ['HmacKeyGenParams', base_config_1.TYPE], + ['IDBDatabaseInfo', base_config_1.TYPE], + ['IDBIndexParameters', base_config_1.TYPE], + ['IDBObjectStoreParameters', base_config_1.TYPE], + ['IDBTransactionOptions', base_config_1.TYPE], + ['IDBVersionChangeEventInit', base_config_1.TYPE], + ['ImageBitmapOptions', base_config_1.TYPE], + ['ImageBitmapRenderingContextSettings', base_config_1.TYPE], + ['ImageDataSettings', base_config_1.TYPE], + ['ImageDecodeOptions', base_config_1.TYPE], + ['ImageDecodeResult', base_config_1.TYPE], + ['ImageDecoderInit', base_config_1.TYPE], + ['ImageEncodeOptions', base_config_1.TYPE], + ['JsonWebKey', base_config_1.TYPE], + ['KeyAlgorithm', base_config_1.TYPE], + ['LockInfo', base_config_1.TYPE], + ['LockManagerSnapshot', base_config_1.TYPE], + ['LockOptions', base_config_1.TYPE], + ['MediaCapabilitiesDecodingInfo', base_config_1.TYPE], + ['MediaCapabilitiesEncodingInfo', base_config_1.TYPE], + ['MediaCapabilitiesInfo', base_config_1.TYPE], + ['MediaConfiguration', base_config_1.TYPE], + ['MediaDecodingConfiguration', base_config_1.TYPE], + ['MediaEncodingConfiguration', base_config_1.TYPE], + ['MediaStreamTrackProcessorInit', base_config_1.TYPE], + ['MessageEventInit', base_config_1.TYPE], + ['MultiCacheQueryOptions', base_config_1.TYPE], + ['NavigationPreloadState', base_config_1.TYPE], + ['NotificationEventInit', base_config_1.TYPE], + ['NotificationOptions', base_config_1.TYPE], + ['OpusEncoderConfig', base_config_1.TYPE], + ['Pbkdf2Params', base_config_1.TYPE], + ['PerformanceMarkOptions', base_config_1.TYPE], + ['PerformanceMeasureOptions', base_config_1.TYPE], + ['PerformanceObserverInit', base_config_1.TYPE], + ['PermissionDescriptor', base_config_1.TYPE], + ['PlaneLayout', base_config_1.TYPE], + ['ProgressEventInit', base_config_1.TYPE], + ['PromiseRejectionEventInit', base_config_1.TYPE], + ['PushEventInit', base_config_1.TYPE], + ['PushSubscriptionJSON', base_config_1.TYPE], + ['PushSubscriptionOptionsInit', base_config_1.TYPE], + ['QueuingStrategy', base_config_1.TYPE], + ['QueuingStrategyInit', base_config_1.TYPE], + ['RTCEncodedAudioFrameMetadata', base_config_1.TYPE], + ['RTCEncodedVideoFrameMetadata', base_config_1.TYPE], + ['ReadableStreamGetReaderOptions', base_config_1.TYPE], + ['ReadableStreamIteratorOptions', base_config_1.TYPE], + ['ReadableStreamReadDoneResult', base_config_1.TYPE], + ['ReadableStreamReadValueResult', base_config_1.TYPE], + ['ReadableWritablePair', base_config_1.TYPE], + ['RegistrationOptions', base_config_1.TYPE], + ['ReportingObserverOptions', base_config_1.TYPE], + ['RequestInit', base_config_1.TYPE], + ['ResponseInit', base_config_1.TYPE], + ['RsaHashedImportParams', base_config_1.TYPE], + ['RsaHashedKeyGenParams', base_config_1.TYPE], + ['RsaKeyGenParams', base_config_1.TYPE], + ['RsaOaepParams', base_config_1.TYPE], + ['RsaOtherPrimesInfo', base_config_1.TYPE], + ['RsaPssParams', base_config_1.TYPE], + ['SecurityPolicyViolationEventInit', base_config_1.TYPE], + ['StorageEstimate', base_config_1.TYPE], + ['StreamPipeOptions', base_config_1.TYPE], + ['StructuredSerializeOptions', base_config_1.TYPE], + ['TextDecodeOptions', base_config_1.TYPE], + ['TextDecoderOptions', base_config_1.TYPE], + ['TextEncoderEncodeIntoResult', base_config_1.TYPE], + ['Transformer', base_config_1.TYPE], + ['UnderlyingByteSource', base_config_1.TYPE], + ['UnderlyingDefaultSource', base_config_1.TYPE], + ['UnderlyingSink', base_config_1.TYPE], + ['UnderlyingSource', base_config_1.TYPE], + ['VideoColorSpaceInit', base_config_1.TYPE], + ['VideoConfiguration', base_config_1.TYPE], + ['VideoDecoderConfig', base_config_1.TYPE], + ['VideoDecoderInit', base_config_1.TYPE], + ['VideoDecoderSupport', base_config_1.TYPE], + ['VideoEncoderConfig', base_config_1.TYPE], + ['VideoEncoderEncodeOptions', base_config_1.TYPE], + ['VideoEncoderEncodeOptionsForAvc', base_config_1.TYPE], + ['VideoEncoderInit', base_config_1.TYPE], + ['VideoEncoderSupport', base_config_1.TYPE], + ['VideoFrameBufferInit', base_config_1.TYPE], + ['VideoFrameCopyToOptions', base_config_1.TYPE], + ['VideoFrameInit', base_config_1.TYPE], + ['WebGLContextAttributes', base_config_1.TYPE], + ['WebGLContextEventInit', base_config_1.TYPE], + ['WebTransportCloseInfo', base_config_1.TYPE], + ['WebTransportErrorOptions', base_config_1.TYPE], + ['WebTransportHash', base_config_1.TYPE], + ['WebTransportOptions', base_config_1.TYPE], + ['WebTransportSendStreamOptions', base_config_1.TYPE], + ['WorkerOptions', base_config_1.TYPE], + ['WriteParams', base_config_1.TYPE], + ['ANGLE_instanced_arrays', base_config_1.TYPE], + ['AbortController', base_config_1.TYPE_VALUE], + ['AbortSignalEventMap', base_config_1.TYPE], + ['AbortSignal', base_config_1.TYPE_VALUE], + ['AbstractWorkerEventMap', base_config_1.TYPE], + ['AbstractWorker', base_config_1.TYPE], + ['AnimationFrameProvider', base_config_1.TYPE], + ['AudioData', base_config_1.TYPE_VALUE], + ['AudioDecoderEventMap', base_config_1.TYPE], + ['AudioDecoder', base_config_1.TYPE_VALUE], + ['AudioEncoderEventMap', base_config_1.TYPE], + ['AudioEncoder', base_config_1.TYPE_VALUE], + ['Blob', base_config_1.TYPE_VALUE], + ['Body', base_config_1.TYPE], + ['BroadcastChannelEventMap', base_config_1.TYPE], + ['BroadcastChannel', base_config_1.TYPE_VALUE], + ['ByteLengthQueuingStrategy', base_config_1.TYPE_VALUE], + ['CSSImageValue', base_config_1.TYPE_VALUE], + ['CSSKeywordValue', base_config_1.TYPE_VALUE], + ['CSSMathClamp', base_config_1.TYPE_VALUE], + ['CSSMathInvert', base_config_1.TYPE_VALUE], + ['CSSMathMax', base_config_1.TYPE_VALUE], + ['CSSMathMin', base_config_1.TYPE_VALUE], + ['CSSMathNegate', base_config_1.TYPE_VALUE], + ['CSSMathProduct', base_config_1.TYPE_VALUE], + ['CSSMathSum', base_config_1.TYPE_VALUE], + ['CSSMathValue', base_config_1.TYPE_VALUE], + ['CSSMatrixComponent', base_config_1.TYPE_VALUE], + ['CSSNumericArray', base_config_1.TYPE_VALUE], + ['CSSNumericValue', base_config_1.TYPE_VALUE], + ['CSSPerspective', base_config_1.TYPE_VALUE], + ['CSSRotate', base_config_1.TYPE_VALUE], + ['CSSScale', base_config_1.TYPE_VALUE], + ['CSSSkew', base_config_1.TYPE_VALUE], + ['CSSSkewX', base_config_1.TYPE_VALUE], + ['CSSSkewY', base_config_1.TYPE_VALUE], + ['CSSStyleValue', base_config_1.TYPE_VALUE], + ['CSSTransformComponent', base_config_1.TYPE_VALUE], + ['CSSTransformValue', base_config_1.TYPE_VALUE], + ['CSSTranslate', base_config_1.TYPE_VALUE], + ['CSSUnitValue', base_config_1.TYPE_VALUE], + ['CSSUnparsedValue', base_config_1.TYPE_VALUE], + ['CSSVariableReferenceValue', base_config_1.TYPE_VALUE], + ['Cache', base_config_1.TYPE_VALUE], + ['CacheStorage', base_config_1.TYPE_VALUE], + ['CanvasCompositing', base_config_1.TYPE], + ['CanvasDrawImage', base_config_1.TYPE], + ['CanvasDrawPath', base_config_1.TYPE], + ['CanvasFillStrokeStyles', base_config_1.TYPE], + ['CanvasFilters', base_config_1.TYPE], + ['CanvasGradient', base_config_1.TYPE_VALUE], + ['CanvasImageData', base_config_1.TYPE], + ['CanvasImageSmoothing', base_config_1.TYPE], + ['CanvasPath', base_config_1.TYPE], + ['CanvasPathDrawingStyles', base_config_1.TYPE], + ['CanvasPattern', base_config_1.TYPE_VALUE], + ['CanvasRect', base_config_1.TYPE], + ['CanvasShadowStyles', base_config_1.TYPE], + ['CanvasState', base_config_1.TYPE], + ['CanvasText', base_config_1.TYPE], + ['CanvasTextDrawingStyles', base_config_1.TYPE], + ['CanvasTransform', base_config_1.TYPE], + ['Client', base_config_1.TYPE_VALUE], + ['Clients', base_config_1.TYPE_VALUE], + ['CloseEvent', base_config_1.TYPE_VALUE], + ['CompressionStream', base_config_1.TYPE_VALUE], + ['CountQueuingStrategy', base_config_1.TYPE_VALUE], + ['Crypto', base_config_1.TYPE_VALUE], + ['CryptoKey', base_config_1.TYPE_VALUE], + ['CustomEvent', base_config_1.TYPE_VALUE], + ['DOMException', base_config_1.TYPE_VALUE], + ['DOMMatrix', base_config_1.TYPE_VALUE], + ['DOMMatrixReadOnly', base_config_1.TYPE_VALUE], + ['DOMPoint', base_config_1.TYPE_VALUE], + ['DOMPointReadOnly', base_config_1.TYPE_VALUE], + ['DOMQuad', base_config_1.TYPE_VALUE], + ['DOMRect', base_config_1.TYPE_VALUE], + ['DOMRectReadOnly', base_config_1.TYPE_VALUE], + ['DOMStringList', base_config_1.TYPE_VALUE], + ['DecompressionStream', base_config_1.TYPE_VALUE], + ['DedicatedWorkerGlobalScopeEventMap', base_config_1.TYPE], + ['DedicatedWorkerGlobalScope', base_config_1.TYPE_VALUE], + ['EXT_blend_minmax', base_config_1.TYPE], + ['EXT_color_buffer_float', base_config_1.TYPE], + ['EXT_color_buffer_half_float', base_config_1.TYPE], + ['EXT_float_blend', base_config_1.TYPE], + ['EXT_frag_depth', base_config_1.TYPE], + ['EXT_sRGB', base_config_1.TYPE], + ['EXT_shader_texture_lod', base_config_1.TYPE], + ['EXT_texture_compression_bptc', base_config_1.TYPE], + ['EXT_texture_compression_rgtc', base_config_1.TYPE], + ['EXT_texture_filter_anisotropic', base_config_1.TYPE], + ['EXT_texture_norm16', base_config_1.TYPE], + ['EncodedAudioChunk', base_config_1.TYPE_VALUE], + ['EncodedVideoChunk', base_config_1.TYPE_VALUE], + ['ErrorEvent', base_config_1.TYPE_VALUE], + ['Event', base_config_1.TYPE_VALUE], + ['EventListener', base_config_1.TYPE], + ['EventListenerObject', base_config_1.TYPE], + ['EventSourceEventMap', base_config_1.TYPE], + ['EventSource', base_config_1.TYPE_VALUE], + ['EventTarget', base_config_1.TYPE_VALUE], + ['ExtendableEvent', base_config_1.TYPE_VALUE], + ['ExtendableMessageEvent', base_config_1.TYPE_VALUE], + ['FetchEvent', base_config_1.TYPE_VALUE], + ['File', base_config_1.TYPE_VALUE], + ['FileList', base_config_1.TYPE_VALUE], + ['FileReaderEventMap', base_config_1.TYPE], + ['FileReader', base_config_1.TYPE_VALUE], + ['FileReaderSync', base_config_1.TYPE_VALUE], + ['FileSystemDirectoryHandle', base_config_1.TYPE_VALUE], + ['FileSystemFileHandle', base_config_1.TYPE_VALUE], + ['FileSystemHandle', base_config_1.TYPE_VALUE], + ['FileSystemSyncAccessHandle', base_config_1.TYPE_VALUE], + ['FileSystemWritableFileStream', base_config_1.TYPE_VALUE], + ['FontFace', base_config_1.TYPE_VALUE], + ['FontFaceSetEventMap', base_config_1.TYPE], + ['FontFaceSet', base_config_1.TYPE_VALUE], + ['FontFaceSetLoadEvent', base_config_1.TYPE_VALUE], + ['FontFaceSource', base_config_1.TYPE], + ['FormData', base_config_1.TYPE_VALUE], + ['GPUError', base_config_1.TYPE], + ['GenericTransformStream', base_config_1.TYPE], + ['Headers', base_config_1.TYPE_VALUE], + ['IDBCursor', base_config_1.TYPE_VALUE], + ['IDBCursorWithValue', base_config_1.TYPE_VALUE], + ['IDBDatabaseEventMap', base_config_1.TYPE], + ['IDBDatabase', base_config_1.TYPE_VALUE], + ['IDBFactory', base_config_1.TYPE_VALUE], + ['IDBIndex', base_config_1.TYPE_VALUE], + ['IDBKeyRange', base_config_1.TYPE_VALUE], + ['IDBObjectStore', base_config_1.TYPE_VALUE], + ['IDBOpenDBRequestEventMap', base_config_1.TYPE], + ['IDBOpenDBRequest', base_config_1.TYPE_VALUE], + ['IDBRequestEventMap', base_config_1.TYPE], + ['IDBRequest', base_config_1.TYPE_VALUE], + ['IDBTransactionEventMap', base_config_1.TYPE], + ['IDBTransaction', base_config_1.TYPE_VALUE], + ['IDBVersionChangeEvent', base_config_1.TYPE_VALUE], + ['ImageBitmap', base_config_1.TYPE_VALUE], + ['ImageBitmapRenderingContext', base_config_1.TYPE_VALUE], + ['ImageData', base_config_1.TYPE_VALUE], + ['ImageDecoder', base_config_1.TYPE_VALUE], + ['ImageTrack', base_config_1.TYPE_VALUE], + ['ImageTrackList', base_config_1.TYPE_VALUE], + ['ImportMeta', base_config_1.TYPE], + ['KHR_parallel_shader_compile', base_config_1.TYPE], + ['Lock', base_config_1.TYPE_VALUE], + ['LockManager', base_config_1.TYPE_VALUE], + ['MediaCapabilities', base_config_1.TYPE_VALUE], + ['MediaSourceHandle', base_config_1.TYPE_VALUE], + ['MediaStreamTrackProcessor', base_config_1.TYPE_VALUE], + ['MessageChannel', base_config_1.TYPE_VALUE], + ['MessageEvent', base_config_1.TYPE_VALUE], + ['MessageEventTargetEventMap', base_config_1.TYPE], + ['MessageEventTarget', base_config_1.TYPE], + ['MessagePortEventMap', base_config_1.TYPE], + ['MessagePort', base_config_1.TYPE_VALUE], + ['NavigationPreloadManager', base_config_1.TYPE_VALUE], + ['NavigatorBadge', base_config_1.TYPE], + ['NavigatorConcurrentHardware', base_config_1.TYPE], + ['NavigatorID', base_config_1.TYPE], + ['NavigatorLanguage', base_config_1.TYPE], + ['NavigatorLocks', base_config_1.TYPE], + ['NavigatorOnLine', base_config_1.TYPE], + ['NavigatorStorage', base_config_1.TYPE], + ['NotificationEventMap', base_config_1.TYPE], + ['Notification', base_config_1.TYPE_VALUE], + ['NotificationEvent', base_config_1.TYPE_VALUE], + ['OES_draw_buffers_indexed', base_config_1.TYPE], + ['OES_element_index_uint', base_config_1.TYPE], + ['OES_fbo_render_mipmap', base_config_1.TYPE], + ['OES_standard_derivatives', base_config_1.TYPE], + ['OES_texture_float', base_config_1.TYPE], + ['OES_texture_float_linear', base_config_1.TYPE], + ['OES_texture_half_float', base_config_1.TYPE], + ['OES_texture_half_float_linear', base_config_1.TYPE], + ['OES_vertex_array_object', base_config_1.TYPE], + ['OVR_multiview2', base_config_1.TYPE], + ['OffscreenCanvasEventMap', base_config_1.TYPE], + ['OffscreenCanvas', base_config_1.TYPE_VALUE], + ['OffscreenCanvasRenderingContext2D', base_config_1.TYPE_VALUE], + ['Path2D', base_config_1.TYPE_VALUE], + ['PerformanceEventMap', base_config_1.TYPE], + ['Performance', base_config_1.TYPE_VALUE], + ['PerformanceEntry', base_config_1.TYPE_VALUE], + ['PerformanceMark', base_config_1.TYPE_VALUE], + ['PerformanceMeasure', base_config_1.TYPE_VALUE], + ['PerformanceObserver', base_config_1.TYPE_VALUE], + ['PerformanceObserverEntryList', base_config_1.TYPE_VALUE], + ['PerformanceResourceTiming', base_config_1.TYPE_VALUE], + ['PerformanceServerTiming', base_config_1.TYPE_VALUE], + ['PermissionStatusEventMap', base_config_1.TYPE], + ['PermissionStatus', base_config_1.TYPE_VALUE], + ['Permissions', base_config_1.TYPE_VALUE], + ['ProgressEvent', base_config_1.TYPE_VALUE], + ['PromiseRejectionEvent', base_config_1.TYPE_VALUE], + ['PushEvent', base_config_1.TYPE_VALUE], + ['PushManager', base_config_1.TYPE_VALUE], + ['PushMessageData', base_config_1.TYPE_VALUE], + ['PushSubscription', base_config_1.TYPE_VALUE], + ['PushSubscriptionOptions', base_config_1.TYPE_VALUE], + ['RTCDataChannelEventMap', base_config_1.TYPE], + ['RTCDataChannel', base_config_1.TYPE_VALUE], + ['RTCEncodedAudioFrame', base_config_1.TYPE_VALUE], + ['RTCEncodedVideoFrame', base_config_1.TYPE_VALUE], + ['RTCRtpScriptTransformer', base_config_1.TYPE_VALUE], + ['RTCTransformEvent', base_config_1.TYPE_VALUE], + ['ReadableByteStreamController', base_config_1.TYPE_VALUE], + ['ReadableStream', base_config_1.TYPE_VALUE], + ['ReadableStreamBYOBReader', base_config_1.TYPE_VALUE], + ['ReadableStreamBYOBRequest', base_config_1.TYPE_VALUE], + ['ReadableStreamDefaultController', base_config_1.TYPE_VALUE], + ['ReadableStreamDefaultReader', base_config_1.TYPE_VALUE], + ['ReadableStreamGenericReader', base_config_1.TYPE], + ['Report', base_config_1.TYPE_VALUE], + ['ReportBody', base_config_1.TYPE_VALUE], + ['ReportingObserver', base_config_1.TYPE_VALUE], + ['Request', base_config_1.TYPE_VALUE], + ['Response', base_config_1.TYPE_VALUE], + ['SecurityPolicyViolationEvent', base_config_1.TYPE_VALUE], + ['ServiceWorkerEventMap', base_config_1.TYPE], + ['ServiceWorker', base_config_1.TYPE_VALUE], + ['ServiceWorkerContainerEventMap', base_config_1.TYPE], + ['ServiceWorkerContainer', base_config_1.TYPE_VALUE], + ['ServiceWorkerGlobalScopeEventMap', base_config_1.TYPE], + ['ServiceWorkerGlobalScope', base_config_1.TYPE_VALUE], + ['ServiceWorkerRegistrationEventMap', base_config_1.TYPE], + ['ServiceWorkerRegistration', base_config_1.TYPE_VALUE], + ['SharedWorkerGlobalScopeEventMap', base_config_1.TYPE], + ['SharedWorkerGlobalScope', base_config_1.TYPE_VALUE], + ['StorageManager', base_config_1.TYPE_VALUE], + ['StylePropertyMapReadOnly', base_config_1.TYPE_VALUE], + ['SubtleCrypto', base_config_1.TYPE_VALUE], + ['TextDecoder', base_config_1.TYPE_VALUE], + ['TextDecoderCommon', base_config_1.TYPE], + ['TextDecoderStream', base_config_1.TYPE_VALUE], + ['TextEncoder', base_config_1.TYPE_VALUE], + ['TextEncoderCommon', base_config_1.TYPE], + ['TextEncoderStream', base_config_1.TYPE_VALUE], + ['TextMetrics', base_config_1.TYPE_VALUE], + ['TransformStream', base_config_1.TYPE_VALUE], + ['TransformStreamDefaultController', base_config_1.TYPE_VALUE], + ['URL', base_config_1.TYPE_VALUE], + ['URLSearchParams', base_config_1.TYPE_VALUE], + ['VideoColorSpace', base_config_1.TYPE_VALUE], + ['VideoDecoderEventMap', base_config_1.TYPE], + ['VideoDecoder', base_config_1.TYPE_VALUE], + ['VideoEncoderEventMap', base_config_1.TYPE], + ['VideoEncoder', base_config_1.TYPE_VALUE], + ['VideoFrame', base_config_1.TYPE_VALUE], + ['WEBGL_color_buffer_float', base_config_1.TYPE], + ['WEBGL_compressed_texture_astc', base_config_1.TYPE], + ['WEBGL_compressed_texture_etc', base_config_1.TYPE], + ['WEBGL_compressed_texture_etc1', base_config_1.TYPE], + ['WEBGL_compressed_texture_pvrtc', base_config_1.TYPE], + ['WEBGL_compressed_texture_s3tc', base_config_1.TYPE], + ['WEBGL_compressed_texture_s3tc_srgb', base_config_1.TYPE], + ['WEBGL_debug_renderer_info', base_config_1.TYPE], + ['WEBGL_debug_shaders', base_config_1.TYPE], + ['WEBGL_depth_texture', base_config_1.TYPE], + ['WEBGL_draw_buffers', base_config_1.TYPE], + ['WEBGL_lose_context', base_config_1.TYPE], + ['WEBGL_multi_draw', base_config_1.TYPE], + ['WebGL2RenderingContext', base_config_1.TYPE_VALUE], + ['WebGL2RenderingContextBase', base_config_1.TYPE], + ['WebGL2RenderingContextOverloads', base_config_1.TYPE], + ['WebGLActiveInfo', base_config_1.TYPE_VALUE], + ['WebGLBuffer', base_config_1.TYPE_VALUE], + ['WebGLContextEvent', base_config_1.TYPE_VALUE], + ['WebGLFramebuffer', base_config_1.TYPE_VALUE], + ['WebGLProgram', base_config_1.TYPE_VALUE], + ['WebGLQuery', base_config_1.TYPE_VALUE], + ['WebGLRenderbuffer', base_config_1.TYPE_VALUE], + ['WebGLRenderingContext', base_config_1.TYPE_VALUE], + ['WebGLRenderingContextBase', base_config_1.TYPE], + ['WebGLRenderingContextOverloads', base_config_1.TYPE], + ['WebGLSampler', base_config_1.TYPE_VALUE], + ['WebGLShader', base_config_1.TYPE_VALUE], + ['WebGLShaderPrecisionFormat', base_config_1.TYPE_VALUE], + ['WebGLSync', base_config_1.TYPE_VALUE], + ['WebGLTexture', base_config_1.TYPE_VALUE], + ['WebGLTransformFeedback', base_config_1.TYPE_VALUE], + ['WebGLUniformLocation', base_config_1.TYPE_VALUE], + ['WebGLVertexArrayObject', base_config_1.TYPE_VALUE], + ['WebGLVertexArrayObjectOES', base_config_1.TYPE], + ['WebSocketEventMap', base_config_1.TYPE], + ['WebSocket', base_config_1.TYPE_VALUE], + ['WebTransport', base_config_1.TYPE_VALUE], + ['WebTransportBidirectionalStream', base_config_1.TYPE_VALUE], + ['WebTransportDatagramDuplexStream', base_config_1.TYPE_VALUE], + ['WebTransportError', base_config_1.TYPE_VALUE], + ['WindowClient', base_config_1.TYPE_VALUE], + ['WindowOrWorkerGlobalScope', base_config_1.TYPE], + ['WorkerEventMap', base_config_1.TYPE], + ['Worker', base_config_1.TYPE_VALUE], + ['WorkerGlobalScopeEventMap', base_config_1.TYPE], + ['WorkerGlobalScope', base_config_1.TYPE_VALUE], + ['WorkerLocation', base_config_1.TYPE_VALUE], + ['WorkerNavigator', base_config_1.TYPE_VALUE], + ['WritableStream', base_config_1.TYPE_VALUE], + ['WritableStreamDefaultController', base_config_1.TYPE_VALUE], + ['WritableStreamDefaultWriter', base_config_1.TYPE_VALUE], + ['XMLHttpRequestEventMap', base_config_1.TYPE], + ['XMLHttpRequest', base_config_1.TYPE_VALUE], + ['XMLHttpRequestEventTargetEventMap', base_config_1.TYPE], + ['XMLHttpRequestEventTarget', base_config_1.TYPE_VALUE], + ['XMLHttpRequestUpload', base_config_1.TYPE_VALUE], + ['Console', base_config_1.TYPE], + ['WebAssembly', base_config_1.TYPE_VALUE], + ['AudioDataOutputCallback', base_config_1.TYPE], + ['EncodedAudioChunkOutputCallback', base_config_1.TYPE], + ['EncodedVideoChunkOutputCallback', base_config_1.TYPE], + ['FrameRequestCallback', base_config_1.TYPE], + ['LockGrantedCallback', base_config_1.TYPE], + ['OnErrorEventHandlerNonNull', base_config_1.TYPE], + ['PerformanceObserverCallback', base_config_1.TYPE], + ['QueuingStrategySize', base_config_1.TYPE], + ['ReportingObserverCallback', base_config_1.TYPE], + ['TransformerFlushCallback', base_config_1.TYPE], + ['TransformerStartCallback', base_config_1.TYPE], + ['TransformerTransformCallback', base_config_1.TYPE], + ['UnderlyingSinkAbortCallback', base_config_1.TYPE], + ['UnderlyingSinkCloseCallback', base_config_1.TYPE], + ['UnderlyingSinkStartCallback', base_config_1.TYPE], + ['UnderlyingSinkWriteCallback', base_config_1.TYPE], + ['UnderlyingSourceCancelCallback', base_config_1.TYPE], + ['UnderlyingSourcePullCallback', base_config_1.TYPE], + ['UnderlyingSourceStartCallback', base_config_1.TYPE], + ['VideoFrameOutputCallback', base_config_1.TYPE], + ['VoidFunction', base_config_1.TYPE], + ['WebCodecsErrorCallback', base_config_1.TYPE], + ['AlgorithmIdentifier', base_config_1.TYPE], + ['AllowSharedBufferSource', base_config_1.TYPE], + ['BigInteger', base_config_1.TYPE], + ['BlobPart', base_config_1.TYPE], + ['BodyInit', base_config_1.TYPE], + ['BufferSource', base_config_1.TYPE], + ['CSSKeywordish', base_config_1.TYPE], + ['CSSNumberish', base_config_1.TYPE], + ['CSSPerspectiveValue', base_config_1.TYPE], + ['CSSUnparsedSegment', base_config_1.TYPE], + ['CanvasImageSource', base_config_1.TYPE], + ['DOMHighResTimeStamp', base_config_1.TYPE], + ['EpochTimeStamp', base_config_1.TYPE], + ['EventListenerOrEventListenerObject', base_config_1.TYPE], + ['FileSystemWriteChunkType', base_config_1.TYPE], + ['Float32List', base_config_1.TYPE], + ['FormDataEntryValue', base_config_1.TYPE], + ['GLbitfield', base_config_1.TYPE], + ['GLboolean', base_config_1.TYPE], + ['GLclampf', base_config_1.TYPE], + ['GLenum', base_config_1.TYPE], + ['GLfloat', base_config_1.TYPE], + ['GLint', base_config_1.TYPE], + ['GLint64', base_config_1.TYPE], + ['GLintptr', base_config_1.TYPE], + ['GLsizei', base_config_1.TYPE], + ['GLsizeiptr', base_config_1.TYPE], + ['GLuint', base_config_1.TYPE], + ['GLuint64', base_config_1.TYPE], + ['HashAlgorithmIdentifier', base_config_1.TYPE], + ['HeadersInit', base_config_1.TYPE], + ['IDBValidKey', base_config_1.TYPE], + ['ImageBitmapSource', base_config_1.TYPE], + ['ImageBufferSource', base_config_1.TYPE], + ['Int32List', base_config_1.TYPE], + ['MessageEventSource', base_config_1.TYPE], + ['NamedCurve', base_config_1.TYPE], + ['OffscreenRenderingContext', base_config_1.TYPE], + ['OnErrorEventHandler', base_config_1.TYPE], + ['PerformanceEntryList', base_config_1.TYPE], + ['PushMessageDataInit', base_config_1.TYPE], + ['ReadableStreamController', base_config_1.TYPE], + ['ReadableStreamReadResult', base_config_1.TYPE], + ['ReadableStreamReader', base_config_1.TYPE], + ['ReportList', base_config_1.TYPE], + ['RequestInfo', base_config_1.TYPE], + ['TexImageSource', base_config_1.TYPE], + ['TimerHandler', base_config_1.TYPE], + ['Transferable', base_config_1.TYPE], + ['Uint32List', base_config_1.TYPE], + ['XMLHttpRequestBodyInit', base_config_1.TYPE], + ['AlphaOption', base_config_1.TYPE], + ['AudioSampleFormat', base_config_1.TYPE], + ['AvcBitstreamFormat', base_config_1.TYPE], + ['BinaryType', base_config_1.TYPE], + ['BitrateMode', base_config_1.TYPE], + ['CSSMathOperator', base_config_1.TYPE], + ['CSSNumericBaseType', base_config_1.TYPE], + ['CanvasDirection', base_config_1.TYPE], + ['CanvasFillRule', base_config_1.TYPE], + ['CanvasFontKerning', base_config_1.TYPE], + ['CanvasFontStretch', base_config_1.TYPE], + ['CanvasFontVariantCaps', base_config_1.TYPE], + ['CanvasLineCap', base_config_1.TYPE], + ['CanvasLineJoin', base_config_1.TYPE], + ['CanvasTextAlign', base_config_1.TYPE], + ['CanvasTextBaseline', base_config_1.TYPE], + ['CanvasTextRendering', base_config_1.TYPE], + ['ClientTypes', base_config_1.TYPE], + ['CodecState', base_config_1.TYPE], + ['ColorGamut', base_config_1.TYPE], + ['ColorSpaceConversion', base_config_1.TYPE], + ['CompressionFormat', base_config_1.TYPE], + ['DocumentVisibilityState', base_config_1.TYPE], + ['EncodedAudioChunkType', base_config_1.TYPE], + ['EncodedVideoChunkType', base_config_1.TYPE], + ['EndingType', base_config_1.TYPE], + ['FileSystemHandleKind', base_config_1.TYPE], + ['FontDisplay', base_config_1.TYPE], + ['FontFaceLoadStatus', base_config_1.TYPE], + ['FontFaceSetLoadStatus', base_config_1.TYPE], + ['FrameType', base_config_1.TYPE], + ['GlobalCompositeOperation', base_config_1.TYPE], + ['HardwareAcceleration', base_config_1.TYPE], + ['HdrMetadataType', base_config_1.TYPE], + ['IDBCursorDirection', base_config_1.TYPE], + ['IDBRequestReadyState', base_config_1.TYPE], + ['IDBTransactionDurability', base_config_1.TYPE], + ['IDBTransactionMode', base_config_1.TYPE], + ['ImageOrientation', base_config_1.TYPE], + ['ImageSmoothingQuality', base_config_1.TYPE], + ['KeyFormat', base_config_1.TYPE], + ['KeyType', base_config_1.TYPE], + ['KeyUsage', base_config_1.TYPE], + ['LatencyMode', base_config_1.TYPE], + ['LockMode', base_config_1.TYPE], + ['MediaDecodingType', base_config_1.TYPE], + ['MediaEncodingType', base_config_1.TYPE], + ['NotificationDirection', base_config_1.TYPE], + ['NotificationPermission', base_config_1.TYPE], + ['OffscreenRenderingContextId', base_config_1.TYPE], + ['OpusBitstreamFormat', base_config_1.TYPE], + ['PermissionName', base_config_1.TYPE], + ['PermissionState', base_config_1.TYPE], + ['PredefinedColorSpace', base_config_1.TYPE], + ['PremultiplyAlpha', base_config_1.TYPE], + ['PushEncryptionKeyName', base_config_1.TYPE], + ['RTCDataChannelState', base_config_1.TYPE], + ['RTCEncodedVideoFrameType', base_config_1.TYPE], + ['ReadableStreamReaderMode', base_config_1.TYPE], + ['ReadableStreamType', base_config_1.TYPE], + ['ReferrerPolicy', base_config_1.TYPE], + ['RequestCache', base_config_1.TYPE], + ['RequestCredentials', base_config_1.TYPE], + ['RequestDestination', base_config_1.TYPE], + ['RequestMode', base_config_1.TYPE], + ['RequestPriority', base_config_1.TYPE], + ['RequestRedirect', base_config_1.TYPE], + ['ResizeQuality', base_config_1.TYPE], + ['ResponseType', base_config_1.TYPE], + ['SecurityPolicyViolationEventDisposition', base_config_1.TYPE], + ['ServiceWorkerState', base_config_1.TYPE], + ['ServiceWorkerUpdateViaCache', base_config_1.TYPE], + ['TransferFunction', base_config_1.TYPE], + ['VideoColorPrimaries', base_config_1.TYPE], + ['VideoEncoderBitrateMode', base_config_1.TYPE], + ['VideoMatrixCoefficients', base_config_1.TYPE], + ['VideoPixelFormat', base_config_1.TYPE], + ['VideoTransferCharacteristics', base_config_1.TYPE], + ['WebGLPowerPreference', base_config_1.TYPE], + ['WebTransportCongestionControl', base_config_1.TYPE], + ['WebTransportErrorSource', base_config_1.TYPE], + ['WorkerType', base_config_1.TYPE], + ['WriteCommandType', base_config_1.TYPE], + ['XMLHttpRequestResponseType', base_config_1.TYPE], + ], +}; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map new file mode 100644 index 0000000..576fe00 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/ClassVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,YAAa,SAAQ,OAAO;;gBAKrC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe;IAO5D,MAAM,CAAC,KAAK,CACV,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,GACzD,IAAI;IAKE,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAa5D,SAAS,CAAC,UAAU,CAClB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,GACzD,IAAI;IAgCP,SAAS,CAAC,oCAAoC,CAC5C,IAAI,EAAE,QAAQ,CAAC,SAAS,GACvB,IAAI;IAaP,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAc5D,SAAS,CAAC,mBAAmB,CAC3B,IAAI,EAAE,QAAQ,CAAC,kBAAkB,EACjC,UAAU,EAAE,QAAQ,CAAC,gBAAgB,GACpC,IAAI;IA8GP,SAAS,CAAC,iBAAiB,CACzB,IAAI,EACA,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,4BAA4B,GACxC,IAAI;IA4BP,SAAS,CAAC,uBAAuB,CAC/B,IAAI,EACA,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,4BAA4B,GACxC,IAAI;IAWP,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAWjE,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAIjE,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI;IAMnD,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;IAIrD,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAIjE,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAInC,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,kBAAkB,GAAG,IAAI;IAIrE,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,GAAG,IAAI;IAQvD,SAAS,CAAC,0BAA0B,CAClC,IAAI,EAAE,QAAQ,CAAC,0BAA0B,GACxC,IAAI;IAIP,SAAS,CAAC,0BAA0B,CAClC,IAAI,EAAE,QAAQ,CAAC,0BAA0B,GACxC,IAAI;IAIP,SAAS,CAAC,4BAA4B,CACpC,IAAI,EAAE,QAAQ,CAAC,4BAA4B,GAC1C,IAAI;IAIP,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;CAGlE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js new file mode 100644 index 0000000..c5c90cc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js @@ -0,0 +1,267 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const definition_1 = require("../definition"); +const TypeVisitor_1 = require("./TypeVisitor"); +const Visitor_1 = require("./Visitor"); +class ClassVisitor extends Visitor_1.Visitor { + #classNode; + #referencer; + constructor(referencer, node) { + super(referencer); + this.#referencer = referencer; + this.#classNode = node; + } + static visit(referencer, node) { + const classVisitor = new ClassVisitor(referencer, node); + classVisitor.visitClass(node); + } + visit(node) { + // make sure we only handle the nodes we are designed to handle + if (node && node.type in this) { + super.visit(node); + } + else { + this.#referencer.visit(node); + } + } + /////////////////// + // Visit helpers // + /////////////////// + visitClass(node) { + if (node.type === types_1.AST_NODE_TYPES.ClassDeclaration && node.id) { + this.#referencer + .currentScope() + .defineIdentifier(node.id, new definition_1.ClassNameDefinition(node.id, node)); + } + node.decorators.forEach(d => this.#referencer.visit(d)); + this.#referencer.scopeManager.nestClassScope(node); + if (node.id) { + // define the class name again inside the new scope + // references to the class should not resolve directly to the parent class + this.#referencer + .currentScope() + .defineIdentifier(node.id, new definition_1.ClassNameDefinition(node.id, node)); + } + this.#referencer.visit(node.superClass); + // visit the type param declarations + this.visitType(node.typeParameters); + // then the usages + this.visitType(node.superTypeArguments); + node.implements.forEach(imp => this.visitType(imp)); + this.visit(node.body); + this.#referencer.close(node); + } + visitFunctionParameterTypeAnnotation(node) { + switch (node.type) { + case types_1.AST_NODE_TYPES.AssignmentPattern: + this.visitType(node.left.typeAnnotation); + break; + case types_1.AST_NODE_TYPES.TSParameterProperty: + this.visitFunctionParameterTypeAnnotation(node.parameter); + break; + default: + this.visitType(node.typeAnnotation); + } + } + visitMethod(node) { + if (node.computed) { + this.#referencer.visit(node.key); + } + if (node.value.type === types_1.AST_NODE_TYPES.FunctionExpression) { + this.visitMethodFunction(node.value, node); + } + else { + this.#referencer.visit(node.value); + } + node.decorators.forEach(d => this.#referencer.visit(d)); + } + visitMethodFunction(node, methodNode) { + if (node.id) { + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + this.#referencer.scopeManager.nestFunctionExpressionNameScope(node); + } + node.params.forEach(param => { + param.decorators.forEach(d => this.visit(d)); + }); + // Consider this function is in the MethodDefinition. + this.#referencer.scopeManager.nestFunctionScope(node, true); + /** + * class A { + * @meta // <--- check this + * foo(a: Type) {} + * + * @meta // <--- check this + * foo(): Type {} + * } + */ + let withMethodDecorators = !!methodNode.decorators.length; + /** + * class A { + * foo( + * @meta // <--- check this + * a: Type + * ) {} + * + * set foo( + * @meta // <--- EXCEPT this. TS do nothing for this + * a: Type + * ) {} + * } + */ + withMethodDecorators ||= + methodNode.kind !== 'set' && + node.params.some(param => param.decorators.length); + if (!withMethodDecorators && methodNode.kind === 'set') { + const keyName = getLiteralMethodKeyName(methodNode); + /** + * class A { + * @meta // <--- check this + * get a() {} + * set ['a'](v: Type) {} + * } + */ + if (keyName != null && + this.#classNode.body.body.find((node) => node !== methodNode && + node.type === types_1.AST_NODE_TYPES.MethodDefinition && + // Node must both be static or not + node.static === methodNode.static && + getLiteralMethodKeyName(node) === keyName)?.decorators.length) { + withMethodDecorators = true; + } + } + /** + * @meta // <--- check this + * class A { + * constructor(a: Type) {} + * } + */ + if (!withMethodDecorators && + methodNode.kind === 'constructor' && + this.#classNode.decorators.length) { + withMethodDecorators = true; + } + // Process parameter declarations. + for (const param of node.params) { + this.visitPattern(param, (pattern, info) => { + this.#referencer + .currentScope() + .defineIdentifier(pattern, new definition_1.ParameterDefinition(pattern, node, info.rest)); + this.#referencer.referencingDefaultValue(pattern, info.assignments, null, true); + }, { processRightHandNodes: true }); + this.visitFunctionParameterTypeAnnotation(param); + } + this.visitType(node.returnType); + this.visitType(node.typeParameters); + this.#referencer.visitChildren(node.body); + this.#referencer.close(node); + } + visitPropertyBase(node) { + if (node.computed) { + this.#referencer.visit(node.key); + } + if (node.value) { + if (node.type === types_1.AST_NODE_TYPES.PropertyDefinition || + node.type === types_1.AST_NODE_TYPES.AccessorProperty) { + this.#referencer.scopeManager.nestClassFieldInitializerScope(node.value); + } + this.#referencer.visit(node.value); + if (node.type === types_1.AST_NODE_TYPES.PropertyDefinition || + node.type === types_1.AST_NODE_TYPES.AccessorProperty) { + this.#referencer.close(node.value); + } + } + node.decorators.forEach(d => this.#referencer.visit(d)); + } + visitPropertyDefinition(node) { + this.visitPropertyBase(node); + /** + * class A { + * @meta // <--- check this + * foo: Type; + * } + */ + this.visitType(node.typeAnnotation); + } + visitType(node) { + if (!node) { + return; + } + TypeVisitor_1.TypeVisitor.visit(this.#referencer, node); + } + ///////////////////// + // Visit selectors // + ///////////////////// + AccessorProperty(node) { + this.visitPropertyDefinition(node); + } + ClassBody(node) { + // this is here on purpose so that this visitor explicitly declares visitors + // for all nodes it cares about (see the instance visit method above) + this.visitChildren(node); + } + Identifier(node) { + this.#referencer.visit(node); + } + MethodDefinition(node) { + this.visitMethod(node); + } + PrivateIdentifier() { + // intentionally skip + } + PropertyDefinition(node) { + this.visitPropertyDefinition(node); + } + StaticBlock(node) { + this.#referencer.scopeManager.nestClassStaticBlockScope(node); + node.body.forEach(b => this.visit(b)); + this.#referencer.close(node); + } + TSAbstractAccessorProperty(node) { + this.visitPropertyDefinition(node); + } + TSAbstractMethodDefinition(node) { + this.visitPropertyBase(node); + } + TSAbstractPropertyDefinition(node) { + this.visitPropertyDefinition(node); + } + TSIndexSignature(node) { + this.visitType(node); + } +} +exports.ClassVisitor = ClassVisitor; +/** + * Only if key is one of [identifier, string, number], ts will combine metadata of accessors . + * class A { + * get a() {} + * set ['a'](v: Type) {} + * + * get [1]() {} + * set [1](v: Type) {} + * + * // Following won't be combined + * get [key]() {} + * set [key](v: Type) {} + * + * get [true]() {} + * set [true](v: Type) {} + * + * get ['a'+'b']() {} + * set ['a'+'b']() {} + * } + */ +function getLiteralMethodKeyName(node) { + if (node.computed && node.key.type === types_1.AST_NODE_TYPES.Literal) { + if (typeof node.key.value === 'string' || + typeof node.key.value === 'number') { + return node.key.value; + } + } + else if (!node.computed && node.key.type === types_1.AST_NODE_TYPES.Identifier) { + return node.key.name; + } + return null; +} diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map new file mode 100644 index 0000000..7fac17e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExportVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/ExportVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,UAAU,GAClB,QAAQ,CAAC,oBAAoB,GAC7B,QAAQ,CAAC,wBAAwB,GACjC,QAAQ,CAAC,sBAAsB,CAAC;AAEpC,qBAAa,aAAc,SAAQ,OAAO;;gBAI5B,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAMpD,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAK5D,SAAS,CAAC,wBAAwB,CAChC,IAAI,EAAE,QAAQ,CAAC,wBAAwB,GACtC,IAAI;IAaP,SAAS,CAAC,sBAAsB,CAC9B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,GACpC,IAAI;IAgBP,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;IAgB/D,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;CAStD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js new file mode 100644 index 0000000..3e089e6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExportVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const Visitor_1 = require("./Visitor"); +class ExportVisitor extends Visitor_1.Visitor { + #exportNode; + #referencer; + constructor(node, referencer) { + super(referencer); + this.#exportNode = node; + this.#referencer = referencer; + } + static visit(referencer, node) { + const exportReferencer = new ExportVisitor(node, referencer); + exportReferencer.visit(node); + } + ExportDefaultDeclaration(node) { + if (node.declaration.type === types_1.AST_NODE_TYPES.Identifier) { + // export default A; + // this could be a type or a variable + this.visit(node.declaration); + } + else { + // export const a = 1; + // export something(); + // etc + // these not included in the scope of this visitor as they are all guaranteed to be values or declare variables + } + } + ExportNamedDeclaration(node) { + if (node.source) { + // export ... from 'foo'; + // these are external identifiers so there shouldn't be references or defs + return; + } + if (!node.declaration) { + // export { x }; + this.visitChildren(node); + } + else { + // export const x = 1; + // this is not included in the scope of this visitor as it creates a variable + } + } + ExportSpecifier(node) { + if (node.exportKind === 'type' && + node.local.type === types_1.AST_NODE_TYPES.Identifier) { + // export { type T }; + // type exports can only reference types + // + // we can't let this fall through to the Identifier selector because the exportKind is on this node + // and we don't have access to the `.parent` during scope analysis + this.#referencer.currentScope().referenceType(node.local); + } + else { + this.visit(node.local); + } + } + Identifier(node) { + if (this.#exportNode.exportKind === 'type') { + // export type { T }; + // type exports can only reference types + this.#referencer.currentScope().referenceType(node); + } + else { + this.#referencer.currentScope().referenceDualValueType(node); + } + } +} +exports.ExportVisitor = ExportVisitor; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts.map new file mode 100644 index 0000000..44ec7b5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/ImportVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,aAAc,SAAQ,OAAO;;gBAI5B,WAAW,EAAE,QAAQ,CAAC,iBAAiB,EAAE,UAAU,EAAE,UAAU;IAM3E,MAAM,CAAC,KAAK,CACV,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,QAAQ,CAAC,iBAAiB,GACtC,IAAI;IAKP,SAAS,CAAC,sBAAsB,CAC9B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,GACpC,IAAI;IAKP,SAAS,CAAC,wBAAwB,CAChC,IAAI,EAAE,QAAQ,CAAC,wBAAwB,GACtC,IAAI;IAKP,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;IAK/D,SAAS,CAAC,WAAW,CACnB,EAAE,EAAE,QAAQ,CAAC,UAAU,EACvB,SAAS,EACL,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,wBAAwB,GACjC,QAAQ,CAAC,eAAe,GAC3B,IAAI;CAQR"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js new file mode 100644 index 0000000..67a00f3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportVisitor = void 0; +const definition_1 = require("../definition"); +const Visitor_1 = require("./Visitor"); +class ImportVisitor extends Visitor_1.Visitor { + #declaration; + #referencer; + constructor(declaration, referencer) { + super(referencer); + this.#declaration = declaration; + this.#referencer = referencer; + } + static visit(referencer, declaration) { + const importReferencer = new ImportVisitor(declaration, referencer); + importReferencer.visit(declaration); + } + ImportDefaultSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } + ImportNamespaceSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } + ImportSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } + visitImport(id, specifier) { + this.#referencer + .currentScope() + .defineIdentifier(id, new definition_1.ImportBindingDefinition(id, specifier, this.#declaration)); + } +} +exports.ImportVisitor = ImportVisitor; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map new file mode 100644 index 0000000..2d0fb56 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PatternVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/PatternVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,MAAM,sBAAsB,GAAG,CACnC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAC5B,IAAI,EAAE;IACJ,WAAW,EAAE,CAAC,QAAQ,CAAC,oBAAoB,GAAG,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC5E,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB,KACE,IAAI,CAAC;AAEV,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AACnD,qBAAa,cAAe,SAAQ,WAAW;;IAS7C,SAAgB,cAAc,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAM;gBAGnD,OAAO,EAAE,qBAAqB,EAC9B,WAAW,EAAE,QAAQ,CAAC,IAAI,EAC1B,QAAQ,EAAE,sBAAsB;WAOpB,SAAS,CACrB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IACH,QAAQ,CAAC,YAAY,GACrB,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,UAAU,GACnB,QAAQ,CAAC,aAAa,GACtB,QAAQ,CAAC,WAAW,GACpB,QAAQ,CAAC,aAAa;IAa1B,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;IAI/D,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,YAAY,GAAG,IAAI;IAM5D,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,oBAAoB,GAAG,IAAI;IAOzE,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI;IAOtE,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,GAAG,IAAI;IAQ7D,SAAS,CAAC,SAAS,IAAI,IAAI;IAI3B,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;IAUxD,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAUjE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI;IAYrD,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,GAAG,IAAI;IAM1D,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,GAAG,IAAI;IAI3D,SAAS,CAAC,gBAAgB,IAAI,IAAI;CAGnC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js new file mode 100644 index 0000000..c7cab64 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js @@ -0,0 +1,94 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PatternVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const VisitorBase_1 = require("./VisitorBase"); +class PatternVisitor extends VisitorBase_1.VisitorBase { + #assignments = []; + #callback; + #restElements = []; + #rootPattern; + rightHandNodes = []; + constructor(options, rootPattern, callback) { + super(options); + this.#rootPattern = rootPattern; + this.#callback = callback; + } + static isPattern(node) { + const nodeType = node.type; + return (nodeType === types_1.AST_NODE_TYPES.Identifier || + nodeType === types_1.AST_NODE_TYPES.ObjectPattern || + nodeType === types_1.AST_NODE_TYPES.ArrayPattern || + nodeType === types_1.AST_NODE_TYPES.SpreadElement || + nodeType === types_1.AST_NODE_TYPES.RestElement || + nodeType === types_1.AST_NODE_TYPES.AssignmentPattern); + } + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + ArrayPattern(pattern) { + for (const element of pattern.elements) { + this.visit(element); + } + } + AssignmentExpression(node) { + this.#assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.#assignments.pop(); + } + AssignmentPattern(pattern) { + this.#assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.#assignments.pop(); + } + CallExpression(node) { + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } + Decorator() { + // don't visit any decorators when exploring a pattern + } + Identifier(pattern) { + const lastRestElement = this.#restElements.at(-1); + this.#callback(pattern, { + assignments: this.#assignments, + rest: lastRestElement?.argument === pattern, + topLevel: pattern === this.#rootPattern, + }); + } + MemberExpression(node) { + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + Property(property) { + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + RestElement(pattern) { + this.#restElements.push(pattern); + this.visit(pattern.argument); + this.#restElements.pop(); + } + SpreadElement(node) { + this.visit(node.argument); + } + TSTypeAnnotation() { + // we don't want to visit types + } +} +exports.PatternVisitor = PatternVisitor; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts.map new file mode 100644 index 0000000..e8239bd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["../../src/referencer/Reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,oBAAY,aAAa;IACvB,IAAI,IAAM;IACV,KAAK,IAAM;IACX,SAAS,IAAM;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC9B,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AAID,oBAAY,iBAAiB;IAC3B,KAAK,IAAM;IACX,IAAI,IAAM;CACX;AAED;;GAEG;AACH,qBAAa,SAAS;;IACpB;;OAEG;IACH,SAAgB,GAAG,EAAE,MAAM,CAAe;IAO1C;;;OAGG;IACH,SAAgB,IAAI,EAAE,KAAK,CAAC;IAE5B;;;OAGG;IACH,SAAgB,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC;IAEzE;;;OAGG;IACH,SAAgB,IAAI,CAAC,EAAE,OAAO,CAAC;IAE/B,SAAgB,mBAAmB,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAErE;;;OAGG;IACI,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,SAAgB,SAAS,CAAC,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;gBAQ/C,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,EACxD,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,aAAa,EACnB,SAAS,CAAC,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,EAChC,mBAAmB,CAAC,EAAE,uBAAuB,GAAG,IAAI,EACpD,IAAI,CAAC,EAAE,OAAO,EACd,aAAa,oBAA0B;IAgBzC;;OAEG;IACH,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED;;OAEG;IACH,IAAW,gBAAgB,IAAI,OAAO,CAErC;IAED;;;OAGG;IACI,OAAO,IAAI,OAAO;IAIzB;;;OAGG;IACI,MAAM,IAAI,OAAO;IAIxB;;;OAGG;IACI,UAAU,IAAI,OAAO;IAI5B;;;OAGG;IACI,WAAW,IAAI,OAAO;IAI7B;;;OAGG;IACI,WAAW,IAAI,OAAO;CAG9B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js new file mode 100644 index 0000000..49ceac7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Reference = exports.ReferenceTypeFlag = exports.ReferenceFlag = void 0; +const ID_1 = require("../ID"); +var ReferenceFlag; +(function (ReferenceFlag) { + ReferenceFlag[ReferenceFlag["Read"] = 1] = "Read"; + ReferenceFlag[ReferenceFlag["Write"] = 2] = "Write"; + ReferenceFlag[ReferenceFlag["ReadWrite"] = 3] = "ReadWrite"; +})(ReferenceFlag || (exports.ReferenceFlag = ReferenceFlag = {})); +const generator = (0, ID_1.createIdGenerator)(); +var ReferenceTypeFlag; +(function (ReferenceTypeFlag) { + ReferenceTypeFlag[ReferenceTypeFlag["Value"] = 1] = "Value"; + ReferenceTypeFlag[ReferenceTypeFlag["Type"] = 2] = "Type"; +})(ReferenceTypeFlag || (exports.ReferenceTypeFlag = ReferenceTypeFlag = {})); +/** + * A Reference represents a single occurrence of an identifier in code. + */ +class Reference { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + $id = generator(); + /** + * The read-write mode of the reference. + */ + #flag; + /** + * Reference to the enclosing Scope. + * @public + */ + from; + /** + * Identifier syntax node. + * @public + */ + identifier; + /** + * `true` if this writing reference is a variable initializer or a default value. + * @public + */ + init; + maybeImplicitGlobal; + /** + * The {@link Variable} object that this reference refers to. If such variable was not defined, this is `null`. + * @public + */ + resolved; + /** + * If reference is writeable, this is the node being written to it. + * @public + */ + writeExpr; + /** + * In some cases, a reference may be a type, value or both a type and value reference. + */ + #referenceType; + constructor(identifier, scope, flag, writeExpr, maybeImplicitGlobal, init, referenceType = ReferenceTypeFlag.Value) { + this.identifier = identifier; + this.from = scope; + this.resolved = null; + this.#flag = flag; + if (this.isWrite()) { + this.writeExpr = writeExpr; + this.init = init; + } + this.maybeImplicitGlobal = maybeImplicitGlobal; + this.#referenceType = referenceType; + } + /** + * True if this reference can reference types + */ + get isTypeReference() { + return (this.#referenceType & ReferenceTypeFlag.Type) !== 0; + } + /** + * True if this reference can reference values + */ + get isValueReference() { + return (this.#referenceType & ReferenceTypeFlag.Value) !== 0; + } + /** + * Whether the reference is writeable. + * @public + */ + isWrite() { + return !!(this.#flag & ReferenceFlag.Write); + } + /** + * Whether the reference is readable. + * @public + */ + isRead() { + return !!(this.#flag & ReferenceFlag.Read); + } + /** + * Whether the reference is read-only. + * @public + */ + isReadOnly() { + return this.#flag === ReferenceFlag.Read; + } + /** + * Whether the reference is write-only. + * @public + */ + isWriteOnly() { + return this.#flag === ReferenceFlag.Write; + } + /** + * Whether the reference is read-write. + * @public + */ + isReadWrite() { + return this.#flag === ReferenceFlag.ReadWrite; + } +} +exports.Reference = Reference; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map new file mode 100644 index 0000000..f8bd15d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Referencer.d.ts","sourceRoot":"","sources":["../../src/referencer/Referencer.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js new file mode 100644 index 0000000..0d4f62f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js @@ -0,0 +1,552 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Referencer = void 0; +const types_1 = require("@typescript-eslint/types"); +const assert_1 = require("../assert"); +const definition_1 = require("../definition"); +const lib_1 = require("../lib"); +const ClassVisitor_1 = require("./ClassVisitor"); +const ExportVisitor_1 = require("./ExportVisitor"); +const ImportVisitor_1 = require("./ImportVisitor"); +const PatternVisitor_1 = require("./PatternVisitor"); +const Reference_1 = require("./Reference"); +const TypeVisitor_1 = require("./TypeVisitor"); +const Visitor_1 = require("./Visitor"); +// Referencing variables and creating bindings. +class Referencer extends Visitor_1.Visitor { + #hasReferencedJsxFactory = false; + #hasReferencedJsxFragmentFactory = false; + #jsxFragmentName; + #jsxPragma; + #lib; + scopeManager; + constructor(options, scopeManager) { + super(options); + this.scopeManager = scopeManager; + this.#jsxPragma = options.jsxPragma; + this.#jsxFragmentName = options.jsxFragmentName; + this.#lib = options.lib; + } + populateGlobalsFromLib(globalScope) { + const flattenedLibs = new Set(); + for (const lib of this.#lib) { + const definition = lib_1.lib.get(lib); + if (!definition) { + throw new Error(`Invalid value for lib provided: ${lib}`); + } + flattenedLibs.add(definition); + } + // Flatten and deduplicate the set of included libs + for (const lib of flattenedLibs) { + // By adding the dependencies to the set as we iterate it, + // they get iterated only if they are new + for (const referencedLib of lib.libs) { + flattenedLibs.add(referencedLib); + } + // This loop is guaranteed to see each included lib exactly once + for (const [name, variable] of lib.variables) { + globalScope.defineImplicitVariable(name, variable); + } + } + // for const assertions (`{} as const` / `{}`) + globalScope.defineImplicitVariable('const', { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + }); + } + close(node) { + while (this.currentScope(true) && node === this.currentScope().block) { + this.scopeManager.currentScope = this.currentScope().close(this.scopeManager); + } + } + currentScope(dontThrowOnNull) { + if (!dontThrowOnNull) { + (0, assert_1.assert)(this.scopeManager.currentScope, 'aaa'); + } + return this.scopeManager.currentScope; + } + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + assignments.forEach(assignment => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, assignment.right, maybeImplicitGlobal, init); + }); + } + /** + * Searches for a variable named "name" in the upper scopes and adds a pseudo-reference from itself to itself + */ + referenceInSomeUpperScope(name) { + let scope = this.scopeManager.currentScope; + while (scope) { + const variable = scope.set.get(name); + if (!variable) { + scope = scope.upper; + continue; + } + scope.referenceValue(variable.identifiers[0]); + return true; + } + return false; + } + referenceJsxFragment() { + if (this.#jsxFragmentName == null || + this.#hasReferencedJsxFragmentFactory) { + return; + } + this.#hasReferencedJsxFragmentFactory = this.referenceInSomeUpperScope(this.#jsxFragmentName); + } + referenceJsxPragma() { + if (this.#jsxPragma == null || this.#hasReferencedJsxFactory) { + return; + } + this.#hasReferencedJsxFactory = this.referenceInSomeUpperScope(this.#jsxPragma); + } + /////////////////// + // Visit helpers // + /////////////////// + visitClass(node) { + ClassVisitor_1.ClassVisitor.visit(this, node); + } + visitForIn(node) { + if (node.left.type === types_1.AST_NODE_TYPES.VariableDeclaration && + node.left.kind !== 'var') { + this.scopeManager.nestForScope(node); + } + if (node.left.type === types_1.AST_NODE_TYPES.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, null, true); + }); + } + else { + this.visitPattern(node.left, (pattern, info) => { + const maybeImplicitGlobal = !this.currentScope().isStrict + ? { + node, + pattern, + } + : null; + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, maybeImplicitGlobal, false); + }, { processRightHandNodes: true }); + } + this.visit(node.right); + this.visit(node.body); + this.close(node); + } + visitFunction(node) { + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + if (node.type === types_1.AST_NODE_TYPES.FunctionExpression) { + if (node.id) { + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + this.scopeManager.nestFunctionExpressionNameScope(node); + } + } + else if (node.id) { + // id is defined in upper scope + this.currentScope().defineIdentifier(node.id, new definition_1.FunctionNameDefinition(node.id, node)); + } + // Consider this function is in the MethodDefinition. + this.scopeManager.nestFunctionScope(node, false); + // Process parameter declarations. + for (const param of node.params) { + this.visitPattern(param, (pattern, info) => { + this.currentScope().defineIdentifier(pattern, new definition_1.ParameterDefinition(pattern, node, info.rest)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }, { processRightHandNodes: true }); + this.visitFunctionParameterTypeAnnotation(param); + param.decorators.forEach(d => this.visit(d)); + } + this.visitType(node.returnType); + this.visitType(node.typeParameters); + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === types_1.AST_NODE_TYPES.BlockStatement) { + this.visitChildren(node.body); + } + else { + this.visit(node.body); + } + } + this.close(node); + } + visitFunctionParameterTypeAnnotation(node) { + switch (node.type) { + case types_1.AST_NODE_TYPES.AssignmentPattern: + this.visitType(node.left.typeAnnotation); + break; + case types_1.AST_NODE_TYPES.TSParameterProperty: + this.visitFunctionParameterTypeAnnotation(node.parameter); + break; + default: + this.visitType(node.typeAnnotation); + break; + } + } + visitJSXElement(node) { + if (node.name.type === types_1.AST_NODE_TYPES.JSXIdentifier) { + if (node.name.name[0].toUpperCase() === node.name.name[0] || + node.name.name === 'this') { + // lower cased component names are always treated as "intrinsic" names, and are converted to a string, + // not a variable by JSX transforms: + //
=> React.createElement("div", null) + // the only case we want to visit a lower-cased component has its name as "this", + this.visit(node.name); + } + } + else { + this.visit(node.name); + } + } + visitProperty(node) { + if (node.computed) { + this.visit(node.key); + } + this.visit(node.value); + } + visitType(node) { + if (!node) { + return; + } + TypeVisitor_1.TypeVisitor.visit(this, node); + } + visitTypeAssertion(node) { + this.visit(node.expression); + this.visitType(node.typeAnnotation); + } + ///////////////////// + // Visit selectors // + ///////////////////// + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + AssignmentExpression(node) { + const left = this.visitExpressionTarget(node.left); + if (PatternVisitor_1.PatternVisitor.isPattern(left)) { + if (node.operator === '=') { + this.visitPattern(left, (pattern, info) => { + const maybeImplicitGlobal = !this.currentScope().isStrict + ? { + node, + pattern, + } + : null; + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, maybeImplicitGlobal, false); + }, { processRightHandNodes: true }); + } + else if (left.type === types_1.AST_NODE_TYPES.Identifier) { + this.currentScope().referenceValue(left, Reference_1.ReferenceFlag.ReadWrite, node.right); + } + } + else { + this.visit(left); + } + this.visit(node.right); + } + BlockStatement(node) { + this.scopeManager.nestBlockScope(node); + this.visitChildren(node); + this.close(node); + } + BreakStatement() { + // don't reference the break statement's label + } + CallExpression(node) { + this.visitChildren(node, ['typeArguments']); + this.visitType(node.typeArguments); + } + CatchClause(node) { + this.scopeManager.nestCatchScope(node); + if (node.param) { + const param = node.param; + this.visitPattern(param, (pattern, info) => { + this.currentScope().defineIdentifier(pattern, new definition_1.CatchClauseDefinition(param, node)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }, { processRightHandNodes: true }); + } + this.visit(node.body); + this.close(node); + } + ClassDeclaration(node) { + this.visitClass(node); + } + ClassExpression(node) { + this.visitClass(node); + } + ContinueStatement() { + // don't reference the continue statement's label + } + ExportAllDeclaration() { + // this defines no local variables + } + ExportDefaultDeclaration(node) { + if (node.declaration.type === types_1.AST_NODE_TYPES.Identifier) { + ExportVisitor_1.ExportVisitor.visit(this, node); + } + else { + this.visit(node.declaration); + } + } + ExportNamedDeclaration(node) { + if (node.declaration) { + this.visit(node.declaration); + } + else { + ExportVisitor_1.ExportVisitor.visit(this, node); + } + } + ForInStatement(node) { + this.visitForIn(node); + } + ForOfStatement(node) { + this.visitForIn(node); + } + ForStatement(node) { + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates per iteration environment. However, this is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && + node.init.type === types_1.AST_NODE_TYPES.VariableDeclaration && + node.init.kind !== 'var') { + this.scopeManager.nestForScope(node); + } + this.visitChildren(node); + this.close(node); + } + FunctionDeclaration(node) { + this.visitFunction(node); + } + FunctionExpression(node) { + this.visitFunction(node); + } + Identifier(node) { + this.currentScope().referenceValue(node); + this.visitType(node.typeAnnotation); + } + ImportAttribute() { + // import assertions are module metadata and thus have no variables to reference + } + ImportDeclaration(node) { + (0, assert_1.assert)(this.scopeManager.isModule(), 'ImportDeclaration should appear when the mode is ES6 and in the module context.'); + ImportVisitor_1.ImportVisitor.visit(this, node); + } + JSXAttribute(node) { + this.visit(node.value); + } + JSXClosingElement(node) { + this.visitJSXElement(node); + } + JSXFragment(node) { + this.referenceJsxPragma(); + this.referenceJsxFragment(); + this.visitChildren(node); + } + JSXIdentifier(node) { + this.currentScope().referenceValue(node); + } + JSXMemberExpression(node) { + if (node.object.type !== types_1.AST_NODE_TYPES.JSXIdentifier || + node.object.name !== 'this') { + this.visit(node.object); + } + // we don't ever reference the property as it's always going to be a property on the thing + } + JSXOpeningElement(node) { + this.referenceJsxPragma(); + this.visitJSXElement(node); + this.visitType(node.typeArguments); + for (const attr of node.attributes) { + this.visit(attr); + } + } + LabeledStatement(node) { + this.visit(node.body); + } + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + MetaProperty() { + // meta properties all builtin globals + } + NewExpression(node) { + this.visitChildren(node, ['typeArguments']); + this.visitType(node.typeArguments); + } + PrivateIdentifier() { + // private identifiers are members on classes and thus have no variables to reference + } + Program(node) { + const globalScope = this.scopeManager.nestGlobalScope(node); + this.populateGlobalsFromLib(globalScope); + if (this.scopeManager.isGlobalReturn()) { + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.nestFunctionScope(node, false); + } + if (this.scopeManager.isModule()) { + this.scopeManager.nestModuleScope(node); + } + if (this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + this.visitChildren(node); + this.close(node); + } + Property(node) { + this.visitProperty(node); + } + SwitchStatement(node) { + this.visit(node.discriminant); + this.scopeManager.nestSwitchScope(node); + for (const switchCase of node.cases) { + this.visit(switchCase); + } + this.close(node); + } + TaggedTemplateExpression(node) { + this.visit(node.tag); + this.visit(node.quasi); + this.visitType(node.typeArguments); + } + TSAsExpression(node) { + this.visitTypeAssertion(node); + } + TSDeclareFunction(node) { + this.visitFunction(node); + } + TSEmptyBodyFunctionExpression(node) { + this.visitFunction(node); + } + TSEnumDeclaration(node) { + this.currentScope().defineIdentifier(node.id, new definition_1.TSEnumNameDefinition(node.id, node)); + // enum members can be referenced within the enum body + this.scopeManager.nestTSEnumScope(node); + for (const member of node.body.members) { + // TS resolves literal named members to be actual names + // enum Foo { + // 'a' = 1, + // b = a, // this references the 'a' member + // } + if (member.id.type === types_1.AST_NODE_TYPES.Literal && + typeof member.id.value === 'string') { + const name = member.id; + this.currentScope().defineLiteralIdentifier(name, new definition_1.TSEnumMemberDefinition(name, member)); + } + else if (!member.computed && + member.id.type === types_1.AST_NODE_TYPES.Identifier) { + this.currentScope().defineIdentifier(member.id, new definition_1.TSEnumMemberDefinition(member.id, member)); + } + this.visit(member.initializer); + } + this.close(node); + } + TSExportAssignment(node) { + if (node.expression.type === types_1.AST_NODE_TYPES.Identifier) { + // this is a special case - you can `export = T` where `T` is a type OR a + // value however `T[U]` is illegal when `T` is a type and `T.U` is illegal + // when `T.U` is a type + // i.e. if the expression is JUST an Identifier - it could be either ref + // kind; otherwise the standard rules apply + this.currentScope().referenceDualValueType(node.expression); + } + else { + this.visit(node.expression); + } + } + TSImportEqualsDeclaration(node) { + this.currentScope().defineIdentifier(node.id, new definition_1.ImportBindingDefinition(node.id, node, node)); + if (node.moduleReference.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + let moduleIdentifier = node.moduleReference.left; + while (moduleIdentifier.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + moduleIdentifier = moduleIdentifier.left; + } + this.visit(moduleIdentifier); + } + else { + this.visit(node.moduleReference); + } + } + TSInstantiationExpression(node) { + this.visitChildren(node, ['typeArguments']); + this.visitType(node.typeArguments); + } + TSInterfaceDeclaration(node) { + this.visitType(node); + } + TSModuleDeclaration(node) { + if (node.id.type === types_1.AST_NODE_TYPES.Identifier && node.kind !== 'global') { + this.currentScope().defineIdentifier(node.id, new definition_1.TSModuleNameDefinition(node.id, node)); + } + this.scopeManager.nestTSModuleScope(node); + this.visit(node.body); + this.close(node); + } + TSSatisfiesExpression(node) { + this.visitTypeAssertion(node); + } + TSTypeAliasDeclaration(node) { + this.visitType(node); + } + TSTypeAssertion(node) { + this.visitTypeAssertion(node); + } + UpdateExpression(node) { + const argument = this.visitExpressionTarget(node.argument); + if (PatternVisitor_1.PatternVisitor.isPattern(argument)) { + this.visitPattern(argument, pattern => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.ReadWrite, null); + }); + } + else { + this.visitChildren(node); + } + } + VariableDeclaration(node) { + const variableTargetScope = node.kind === 'var' + ? this.currentScope().variableScope + : this.currentScope(); + for (const decl of node.declarations) { + const init = decl.init; + this.visitPattern(decl.id, (pattern, info) => { + variableTargetScope.defineIdentifier(pattern, new definition_1.VariableDefinition(pattern, decl, node)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, init, null, true); + } + }, { processRightHandNodes: true }); + this.visit(decl.init); + this.visitType(decl.id.typeAnnotation); + } + } + WithStatement(node) { + this.visit(node.object); + // Then nest scope for WithStatement. + this.scopeManager.nestWithScope(node); + this.visit(node.body); + this.close(node); + } + visitExpressionTarget(left) { + switch (left.type) { + case types_1.AST_NODE_TYPES.TSAsExpression: + case types_1.AST_NODE_TYPES.TSTypeAssertion: + // explicitly visit the type annotation + this.visitType(left.typeAnnotation); + // intentional fallthrough + case types_1.AST_NODE_TYPES.TSNonNullExpression: + // unwrap the expression + left = left.expression; + } + return left; + } +} +exports.Referencer = Referencer; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map new file mode 100644 index 0000000..ae68524 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/TypeVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,WAAY,SAAQ,OAAO;;gBAG1B,UAAU,EAAE,UAAU;IAKlC,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI;IAS/D,SAAS,CAAC,iBAAiB,CACzB,IAAI,EACA,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,+BAA+B,GACxC,QAAQ,CAAC,cAAc,GACvB,QAAQ,CAAC,iBAAiB,GAC7B,IAAI;IAiCP,SAAS,CAAC,gBAAgB,CACxB,IAAI,EAAE,QAAQ,CAAC,iBAAiB,GAAG,QAAQ,CAAC,mBAAmB,GAC9D,IAAI;IAYP,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;IAIrD,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAKjE,SAAS,CAAC,0BAA0B,CAClC,IAAI,EAAE,QAAQ,CAAC,0BAA0B,GACxC,IAAI;IAIP,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI;IAanE,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI;IAInE,SAAS,CAAC,+BAA+B,CACvC,IAAI,EAAE,QAAQ,CAAC,+BAA+B,GAC7C,IAAI;IAIP,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,GAAG,IAAI;IAI7D,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,GAAG,IAAI;IAMzD,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IASjE,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,GAAG,IAAI;IAwCvD,SAAS,CAAC,sBAAsB,CAC9B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,GACpC,IAAI;IAmBP,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,GAAG,IAAI;IAYzD,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI;IAKnE,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,kBAAkB,GAAG,IAAI;IAKrE,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,mBAAmB,GAAG,IAAI;IAKvE,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;IAK/D,SAAS,CAAC,sBAAsB,CAC9B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,GACpC,IAAI;IAkBP,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;IAS/D,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;IAQ/D,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAKjE,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,GAAG,IAAI;CAwBxD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js new file mode 100644 index 0000000..2509a4a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js @@ -0,0 +1,221 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const definition_1 = require("../definition"); +const scope_1 = require("../scope"); +const Visitor_1 = require("./Visitor"); +class TypeVisitor extends Visitor_1.Visitor { + #referencer; + constructor(referencer) { + super(referencer); + this.#referencer = referencer; + } + static visit(referencer, node) { + const typeReferencer = new TypeVisitor(referencer); + typeReferencer.visit(node); + } + /////////////////// + // Visit helpers // + /////////////////// + visitFunctionType(node) { + // arguments and type parameters can only be referenced from within the function + this.#referencer.scopeManager.nestFunctionTypeScope(node); + this.visit(node.typeParameters); + for (const param of node.params) { + let didVisitAnnotation = false; + this.visitPattern(param, (pattern, info) => { + // a parameter name creates a value type variable which can be referenced later via typeof arg + this.#referencer + .currentScope() + .defineIdentifier(pattern, new definition_1.ParameterDefinition(pattern, node, info.rest)); + if (pattern.typeAnnotation) { + this.visit(pattern.typeAnnotation); + didVisitAnnotation = true; + } + }); + // there are a few special cases where the type annotation is owned by the parameter, not the pattern + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!didVisitAnnotation && 'typeAnnotation' in param) { + this.visit(param.typeAnnotation); + } + } + this.visit(node.returnType); + this.#referencer.close(node); + } + visitPropertyKey(node) { + if (!node.computed) { + return; + } + // computed members are treated as value references, and TS expects they have a literal type + this.#referencer.visit(node.key); + } + ///////////////////// + // Visit selectors // + ///////////////////// + Identifier(node) { + this.#referencer.currentScope().referenceType(node); + } + MemberExpression(node) { + this.visit(node.object); + // don't visit the property + } + TSCallSignatureDeclaration(node) { + this.visitFunctionType(node); + } + TSConditionalType(node) { + // conditional types can define inferred type parameters + // which are only accessible from inside the conditional parameter + this.#referencer.scopeManager.nestConditionalTypeScope(node); + // type parameters inferred in the condition clause are not accessible within the false branch + this.visitChildren(node, ['falseType']); + this.#referencer.close(node); + this.visit(node.falseType); + } + TSConstructorType(node) { + this.visitFunctionType(node); + } + TSConstructSignatureDeclaration(node) { + this.visitFunctionType(node); + } + TSFunctionType(node) { + this.visitFunctionType(node); + } + TSImportType(node) { + // the TS parser allows any type to be the parameter, but it's a syntax error - so we can ignore it + this.visit(node.typeArguments); + // the qualifier is just part of a standard EntityName, so it should not be visited + } + TSIndexSignature(node) { + for (const param of node.parameters) { + if (param.type === types_1.AST_NODE_TYPES.Identifier) { + this.visit(param.typeAnnotation); + } + } + this.visit(node.typeAnnotation); + } + TSInferType(node) { + const typeParameter = node.typeParameter; + let scope = this.#referencer.currentScope(); + /* + In cases where there is a sub-type scope created within a conditional type, then the generic should be defined in the + conditional type's scope, not the child type scope. + If we define it within the child type's scope then it won't be able to be referenced outside the child type + */ + if (scope.type === scope_1.ScopeType.functionType || + scope.type === scope_1.ScopeType.mappedType) { + // search up the scope tree to figure out if we're in a nested type scope + let currentScope = scope.upper; + while (currentScope) { + if (currentScope.type === scope_1.ScopeType.functionType || + currentScope.type === scope_1.ScopeType.mappedType) { + // ensure valid type parents only + currentScope = currentScope.upper; + continue; + } + if (currentScope.type === scope_1.ScopeType.conditionalType) { + scope = currentScope; + break; + } + break; + } + } + scope.defineIdentifier(typeParameter.name, new definition_1.TypeDefinition(typeParameter.name, typeParameter)); + this.visit(typeParameter.constraint); + } + TSInterfaceDeclaration(node) { + this.#referencer + .currentScope() + .defineIdentifier(node.id, new definition_1.TypeDefinition(node.id, node)); + if (node.typeParameters) { + // type parameters cannot be referenced from outside their current scope + this.#referencer.scopeManager.nestTypeScope(node); + this.visit(node.typeParameters); + } + node.extends.forEach(this.visit, this); + this.visit(node.body); + if (node.typeParameters) { + this.#referencer.close(node); + } + } + TSMappedType(node) { + // mapped types key can only be referenced within their return value + this.#referencer.scopeManager.nestMappedTypeScope(node); + this.#referencer + .currentScope() + .defineIdentifier(node.key, new definition_1.TypeDefinition(node.key, node)); + this.visit(node.constraint); + this.visit(node.nameType); + this.visit(node.typeAnnotation); + this.#referencer.close(node); + } + TSMethodSignature(node) { + this.visitPropertyKey(node); + this.visitFunctionType(node); + } + TSNamedTupleMember(node) { + this.visit(node.elementType); + // we don't visit the label as the label only exists for the purposes of documentation + } + TSPropertySignature(node) { + this.visitPropertyKey(node); + this.visit(node.typeAnnotation); + } + TSQualifiedName(node) { + this.visit(node.left); + // we don't visit the right as it a name on the thing, not a name to reference + } + TSTypeAliasDeclaration(node) { + this.#referencer + .currentScope() + .defineIdentifier(node.id, new definition_1.TypeDefinition(node.id, node)); + if (node.typeParameters) { + // type parameters cannot be referenced from outside their current scope + this.#referencer.scopeManager.nestTypeScope(node); + this.visit(node.typeParameters); + } + this.visit(node.typeAnnotation); + if (node.typeParameters) { + this.#referencer.close(node); + } + } + TSTypeParameter(node) { + this.#referencer + .currentScope() + .defineIdentifier(node.name, new definition_1.TypeDefinition(node.name, node)); + this.visit(node.constraint); + this.visit(node.default); + } + TSTypePredicate(node) { + if (node.parameterName.type !== types_1.AST_NODE_TYPES.TSThisType) { + this.#referencer.currentScope().referenceValue(node.parameterName); + } + this.visit(node.typeAnnotation); + } + // a type query `typeof foo` is a special case that references a _non-type_ variable, + TSTypeAnnotation(node) { + // check + this.visitChildren(node); + } + TSTypeQuery(node) { + let entityName; + if (node.exprName.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + let iter = node.exprName; + while (iter.left.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + iter = iter.left; + } + entityName = iter.left; + } + else { + entityName = node.exprName; + if (node.exprName.type === types_1.AST_NODE_TYPES.TSImportType) { + this.visit(node.exprName); + } + } + if (entityName.type === types_1.AST_NODE_TYPES.Identifier) { + this.#referencer.currentScope().referenceValue(entityName); + } + this.visit(node.typeArguments); + } +} +exports.TypeVisitor = TypeVisitor; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts.map new file mode 100644 index 0000000..83830e0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Visitor.d.ts","sourceRoot":"","sources":["../../src/referencer/Visitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AACD,qBAAa,OAAQ,SAAQ,WAAW;;gBAE1B,gBAAgB,EAAE,OAAO,GAAG,cAAc;IAatD,SAAS,CAAC,YAAY,CACpB,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,QAAQ,EAAE,sBAAsB,EAChC,OAAO,GAAE,mBAAsD,GAC9D,IAAI;CAWR;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js new file mode 100644 index 0000000..9752def --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VisitorBase = exports.Visitor = void 0; +const PatternVisitor_1 = require("./PatternVisitor"); +const VisitorBase_1 = require("./VisitorBase"); +class Visitor extends VisitorBase_1.VisitorBase { + #options; + constructor(optionsOrVisitor) { + super(optionsOrVisitor instanceof Visitor + ? optionsOrVisitor.#options + : optionsOrVisitor); + this.#options = + optionsOrVisitor instanceof Visitor + ? optionsOrVisitor.#options + : optionsOrVisitor; + } + visitPattern(node, callback, options = { processRightHandNodes: false }) { + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor_1.PatternVisitor(this.#options, node, callback); + visitor.visit(node); + // Process the right hand nodes recursively. + if (options.processRightHandNodes) { + visitor.rightHandNodes.forEach(this.visit, this); + } + } +} +exports.Visitor = Visitor; +var VisitorBase_2 = require("./VisitorBase"); +Object.defineProperty(exports, "VisitorBase", { enumerable: true, get: function () { return VisitorBase_2.VisitorBase; } }); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts.map new file mode 100644 index 0000000..da51b6f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"VisitorBase.d.ts","sourceRoot":"","sources":["../../src/referencer/VisitorBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAInE,MAAM,WAAW,cAAc;IAC7B,gBAAgB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,iCAAiC,CAAC,EAAE,OAAO,CAAC;CAC7C;AAaD,8BAAsB,WAAW;;gBAGnB,OAAO,EAAE,cAAc;IAMnC;;;;OAIG;IACH,aAAa,CAAC,CAAC,SAAS,QAAQ,CAAC,IAAI,EACnC,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC1B,UAAU,GAAE,CAAC,MAAM,CAAC,CAAC,EAAO,GAC3B,IAAI;IA6BP;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;CAepD;AAED,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js new file mode 100644 index 0000000..b772565 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VisitorBase = void 0; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +function isObject(obj) { + return typeof obj === 'object' && obj != null; +} +function isNode(node) { + return isObject(node) && typeof node.type === 'string'; +} +class VisitorBase { + #childVisitorKeys; + #visitChildrenEvenIfSelectorExists; + constructor(options) { + this.#childVisitorKeys = options.childVisitorKeys ?? visitor_keys_1.visitorKeys; + this.#visitChildrenEvenIfSelectorExists = + options.visitChildrenEvenIfSelectorExists ?? false; + } + /** + * Default method for visiting children. + * @param node the node whose children should be visited + * @param excludeArr a list of keys to not visit + */ + visitChildren(node, excludeArr = []) { + if (node?.type == null) { + return; + } + const exclude = new Set([...excludeArr, 'parent']); + const children = this.#childVisitorKeys[node.type] ?? Object.keys(node); + for (const key of children) { + if (exclude.has(key)) { + continue; + } + const child = node[key]; + if (!child) { + continue; + } + if (Array.isArray(child)) { + for (const subChild of child) { + if (isNode(subChild)) { + this.visit(subChild); + } + } + } + else if (isNode(child)) { + this.visit(child); + } + } + } + /** + * Dispatching node. + */ + visit(node) { + if (node?.type == null) { + return; + } + const visitor = this[node.type]; + if (visitor) { + visitor.call(this, node); + if (!this.#visitChildrenEvenIfSelectorExists) { + return; + } + } + this.visitChildren(node); + } +} +exports.VisitorBase = VisitorBase; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts.map new file mode 100644 index 0000000..36b3e57 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/referencer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js new file mode 100644 index 0000000..0f94d64 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Referencer = void 0; +var Referencer_1 = require("./Referencer"); +Object.defineProperty(exports, "Referencer", { enumerable: true, get: function () { return Referencer_1.Referencer; } }); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts.map new file mode 100644 index 0000000..591ab32 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BlockScope.d.ts","sourceRoot":"","sources":["../../src/scope/BlockScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,UAAW,SAAQ,SAAS,CACvC,SAAS,CAAC,KAAK,EACf,QAAQ,CAAC,cAAc,EACvB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;CAI7B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js new file mode 100644 index 0000000..9ead611 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BlockScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class BlockScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.block, upperScope, block, false); + } +} +exports.BlockScope = BlockScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts.map new file mode 100644 index 0000000..87c09cf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CatchScope.d.ts","sourceRoot":"","sources":["../../src/scope/CatchScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,UAAW,SAAQ,SAAS,CACvC,SAAS,CAAC,KAAK,EACf,QAAQ,CAAC,WAAW,EACpB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;CAI7B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js new file mode 100644 index 0000000..613ffb9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CatchScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class CatchScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.catch, upperScope, block, false); + } +} +exports.CatchScope = CatchScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.d.ts.map new file mode 100644 index 0000000..821c2e8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassFieldInitializerScope.d.ts","sourceRoot":"","sources":["../../src/scope/ClassFieldInitializerScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,0BAA2B,SAAQ,SAAS,CACvD,SAAS,CAAC,qBAAqB,EAE/B,QAAQ,CAAC,UAAU,EACnB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,0BAA0B,CAAC,OAAO,CAAC,EAC/C,KAAK,EAAE,0BAA0B,CAAC,OAAO,CAAC;CAU7C"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.js new file mode 100644 index 0000000..c469374 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassFieldInitializerScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ClassFieldInitializerScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.classFieldInitializer, upperScope, block, false); + } +} +exports.ClassFieldInitializerScope = ClassFieldInitializerScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts.map new file mode 100644 index 0000000..94a4ddf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassScope.d.ts","sourceRoot":"","sources":["../../src/scope/ClassScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,UAAW,SAAQ,SAAS,CACvC,SAAS,CAAC,KAAK,EACf,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,EACpD,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;CAI7B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js new file mode 100644 index 0000000..187c973 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ClassScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.class, upperScope, block, false); + } +} +exports.ClassScope = ClassScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts.map new file mode 100644 index 0000000..948e088 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassStaticBlockScope.d.ts","sourceRoot":"","sources":["../../src/scope/ClassStaticBlockScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,qBAAsB,SAAQ,SAAS,CAClD,SAAS,CAAC,gBAAgB,EAC1B,QAAQ,CAAC,WAAW,EACpB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,qBAAqB,CAAC,OAAO,CAAC,EAC1C,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAAC;CAIxC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.js new file mode 100644 index 0000000..77d700e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassStaticBlockScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ClassStaticBlockScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.classStaticBlock, upperScope, block, false); + } +} +exports.ClassStaticBlockScope = ClassStaticBlockScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts.map new file mode 100644 index 0000000..7c28743 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ConditionalTypeScope.d.ts","sourceRoot":"","sources":["../../src/scope/ConditionalTypeScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,oBAAqB,SAAQ,SAAS,CACjD,SAAS,CAAC,eAAe,EACzB,QAAQ,CAAC,iBAAiB,EAC1B,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,oBAAoB,CAAC,OAAO,CAAC,EACzC,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC;CAIvC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js new file mode 100644 index 0000000..e1d7e5f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConditionalTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ConditionalTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.conditionalType, upperScope, block, false); + } +} +exports.ConditionalTypeScope = ConditionalTypeScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts.map new file mode 100644 index 0000000..c551db1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ForScope.d.ts","sourceRoot":"","sources":["../../src/scope/ForScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,QAAS,SAAQ,SAAS,CACrC,SAAS,CAAC,GAAG,EACb,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,YAAY,EACzE,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,EAC7B,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;CAI3B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js new file mode 100644 index 0000000..dc3d7d5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ForScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ForScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.for, upperScope, block, false); + } +} +exports.ForScope = ForScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts.map new file mode 100644 index 0000000..de03bbf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionExpressionNameScope.d.ts","sourceRoot":"","sources":["../../src/scope/FunctionExpressionNameScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,2BAA4B,SAAQ,SAAS,CACxD,SAAS,CAAC,sBAAsB,EAChC,QAAQ,CAAC,kBAAkB,EAC3B,KAAK,CACN;IACC,SAAyB,uBAAuB,EAAE,IAAI,CAAC;gBAGrD,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,2BAA2B,CAAC,OAAO,CAAC,EAChD,KAAK,EAAE,2BAA2B,CAAC,OAAO,CAAC;CAiB9C"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js new file mode 100644 index 0000000..3afd1bd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionExpressionNameScope = void 0; +const definition_1 = require("../definition"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class FunctionExpressionNameScope extends ScopeBase_1.ScopeBase { + functionExpressionScope; + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.functionExpressionName, upperScope, block, false); + if (block.id) { + this.defineIdentifier(block.id, new definition_1.FunctionNameDefinition(block.id, block)); + } + this.functionExpressionScope = true; + } +} +exports.FunctionExpressionNameScope = FunctionExpressionNameScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts.map new file mode 100644 index 0000000..3c06de5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionScope.d.ts","sourceRoot":"","sources":["../../src/scope/FunctionScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,aAAc,SAAQ,SAAS,CAC1C,SAAS,CAAC,QAAQ,EAChB,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,OAAO,GAChB,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,6BAA6B,EACxC,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAClC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,kBAAkB,EAAE,OAAO;cAuBV,iBAAiB,CAClC,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,QAAQ,GACjB,OAAO;CAiBX"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js new file mode 100644 index 0000000..f5eb4d9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionScope = void 0; +const types_1 = require("@typescript-eslint/types"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class FunctionScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, ScopeType_1.ScopeType.function, upperScope, block, isMethodDefinition); + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== types_1.AST_NODE_TYPES.ArrowFunctionExpression) { + this.defineVariable('arguments', this.set, this.variables, null, null); + } + } + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + isValidResolution(ref, variable) { + // If `options.globalReturn` is true, `this.block` becomes a Program node. + if (this.block.type === types_1.AST_NODE_TYPES.Program) { + return true; + } + const bodyStart = this.block.body?.range[0] ?? -1; + // It's invalid resolution in the following case: + return !((variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart)) // the variable is in the body. + ); + } +} +exports.FunctionScope = FunctionScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts.map new file mode 100644 index 0000000..072a4d3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionTypeScope.d.ts","sourceRoot":"","sources":["../../src/scope/FunctionTypeScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,iBAAkB,SAAQ,SAAS,CAC9C,SAAS,CAAC,YAAY,EACpB,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,+BAA+B,GACxC,QAAQ,CAAC,cAAc,GACvB,QAAQ,CAAC,iBAAiB,EAC5B,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,iBAAiB,CAAC,OAAO,CAAC,EACtC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC;CAIpC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js new file mode 100644 index 0000000..9b3e5bf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class FunctionTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.functionType, upperScope, block, false); + } +} +exports.FunctionTypeScope = FunctionTypeScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts.map new file mode 100644 index 0000000..7265bfb --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GlobalScope.d.ts","sourceRoot":"","sources":["../../src/scope/GlobalScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,0BAA0B,EAAY,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,WAAY,SAAQ,SAAS,CACxC,SAAS,CAAC,MAAM,EAChB,QAAQ,CAAC,OAAO;AAChB;;GAEG;AACH,IAAI,CACL;IAEC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAQvB;gBAEU,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;IASnD,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,KAAK,GAAG,IAAI;IAwBxD,sBAAsB,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,0BAA0B,GAClC,IAAI;CASR"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js new file mode 100644 index 0000000..42df377 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GlobalScope = void 0; +const types_1 = require("@typescript-eslint/types"); +const assert_1 = require("../assert"); +const ImplicitGlobalVariableDefinition_1 = require("../definition/ImplicitGlobalVariableDefinition"); +const variable_1 = require("../variable"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class GlobalScope extends ScopeBase_1.ScopeBase { + // note this is accessed in used in the legacy eslint-scope tests, so it can't be true private + implicit; + constructor(scopeManager, block) { + super(scopeManager, ScopeType_1.ScopeType.global, null, block, false); + this.implicit = { + leftToBeResolved: [], + set: new Map(), + variables: [], + }; + } + close(scopeManager) { + (0, assert_1.assert)(this.leftToResolve); + for (const ref of this.leftToResolve) { + if (ref.maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + // create an implicit global variable from assignment expression + const info = ref.maybeImplicitGlobal; + const node = info.pattern; + if (node.type === types_1.AST_NODE_TYPES.Identifier) { + this.defineVariable(node.name, this.implicit.set, this.implicit.variables, node, new ImplicitGlobalVariableDefinition_1.ImplicitGlobalVariableDefinition(info.pattern, info.node)); + } + } + } + this.implicit.leftToBeResolved = this.leftToResolve; + return super.close(scopeManager); + } + defineImplicitVariable(name, options) { + this.defineVariable(new variable_1.ImplicitLibVariable(this, name, options), this.set, this.variables, null, null); + } +} +exports.GlobalScope = GlobalScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts.map new file mode 100644 index 0000000..1e146e3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MappedTypeScope.d.ts","sourceRoot":"","sources":["../../src/scope/MappedTypeScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,eAAgB,SAAQ,SAAS,CAC5C,SAAS,CAAC,UAAU,EACpB,QAAQ,CAAC,YAAY,EACrB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,EACpC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC;CAIlC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js new file mode 100644 index 0000000..bbe7bd2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MappedTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class MappedTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.mappedType, upperScope, block, false); + } +} +exports.MappedTypeScope = MappedTypeScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts.map new file mode 100644 index 0000000..39572ce --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ModuleScope.d.ts","sourceRoot":"","sources":["../../src/scope/ModuleScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,WAAY,SAAQ,SAAS,CACxC,SAAS,CAAC,MAAM,EAChB,QAAQ,CAAC,OAAO,EAChB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAChC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;CAI9B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js new file mode 100644 index 0000000..3180a56 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModuleScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ModuleScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.module, upperScope, block, false); + } +} +exports.ModuleScope = ModuleScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map new file mode 100644 index 0000000..d7cda27 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../src/scope/Scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,KAAK,GACb,UAAU,GACV,UAAU,GACV,0BAA0B,GAC1B,UAAU,GACV,qBAAqB,GACrB,oBAAoB,GACpB,QAAQ,GACR,2BAA2B,GAC3B,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,eAAe,GACf,WAAW,GACX,WAAW,GACX,WAAW,GACX,aAAa,GACb,SAAS,GACT,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map new file mode 100644 index 0000000..b693f2d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeBase.d.ts","sourceRoot":"","sources":["../../src/scope/ScopeBase.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js new file mode 100644 index 0000000..5e07a7c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js @@ -0,0 +1,360 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeBase = void 0; +const types_1 = require("@typescript-eslint/types"); +const assert_1 = require("../assert"); +const definition_1 = require("../definition"); +const ID_1 = require("../ID"); +const Reference_1 = require("../referencer/Reference"); +const variable_1 = require("../variable"); +const ScopeType_1 = require("./ScopeType"); +/** + * Test if scope is strict + */ +function isStrictScope(scope, block, isMethodDefinition) { + let body; + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper?.isStrict) { + return true; + } + if (isMethodDefinition) { + return true; + } + if (scope.type === ScopeType_1.ScopeType.class || + scope.type === ScopeType_1.ScopeType.conditionalType || + scope.type === ScopeType_1.ScopeType.functionType || + scope.type === ScopeType_1.ScopeType.mappedType || + scope.type === ScopeType_1.ScopeType.module || + scope.type === ScopeType_1.ScopeType.tsEnum || + scope.type === ScopeType_1.ScopeType.tsModule || + scope.type === ScopeType_1.ScopeType.type) { + return true; + } + if (scope.type === ScopeType_1.ScopeType.block || scope.type === ScopeType_1.ScopeType.switch) { + return false; + } + if (scope.type === ScopeType_1.ScopeType.function) { + const functionBody = block; + switch (functionBody.type) { + case types_1.AST_NODE_TYPES.ArrowFunctionExpression: + if (functionBody.body.type !== types_1.AST_NODE_TYPES.BlockStatement) { + return false; + } + body = functionBody.body; + break; + case types_1.AST_NODE_TYPES.Program: + body = functionBody; + break; + default: + body = functionBody.body; + } + if (!body) { + return false; + } + } + else if (scope.type === ScopeType_1.ScopeType.global) { + body = block; + } + else { + return false; + } + // Search 'use strict' directive. + for (const stmt of body.body) { + if (stmt.type !== types_1.AST_NODE_TYPES.ExpressionStatement) { + break; + } + if (stmt.directive === 'use strict') { + return true; + } + const expr = stmt.expression; + if (expr.type !== types_1.AST_NODE_TYPES.Literal) { + break; + } + if (expr.raw === '"use strict"' || expr.raw === "'use strict'") { + return true; + } + if (expr.value === 'use strict') { + return true; + } + } + return false; +} +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + const scopes = scopeManager.nodeToScope.get(scope.block); + if (scopes) { + scopes.push(scope); + } + else { + scopeManager.nodeToScope.set(scope.block, [scope]); + } +} +const generator = (0, ID_1.createIdGenerator)(); +const VARIABLE_SCOPE_TYPES = new Set([ + ScopeType_1.ScopeType.classFieldInitializer, + ScopeType_1.ScopeType.classStaticBlock, + ScopeType_1.ScopeType.function, + ScopeType_1.ScopeType.global, + ScopeType_1.ScopeType.module, + ScopeType_1.ScopeType.tsModule, +]); +class ScopeBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + $id = generator(); + /** + * The AST node which created this scope. + * @public + */ + block; + /** + * The array of child scopes. This does not include grandchild scopes. + * @public + */ + childScopes = []; + /** + * A map of the variables for each node in this scope. + * This is map is a pointer to the one in the parent ScopeManager instance + */ + #declaredVariables; + /** + * Generally, through the lexical scoping of JS you can always know which variable an identifier in the source code + * refers to. There are a few exceptions to this rule. With `global` and `with` scopes you can only decide at runtime + * which variable a reference refers to. + * All those scopes are considered "dynamic". + */ + #dynamic; + /** + * Whether this scope is created by a FunctionExpression. + * @public + */ + functionExpressionScope = false; + /** + * Whether 'use strict' is in effect in this scope. + * @public + */ + isStrict; + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + */ + leftToResolve = []; + /** + * Any variable {@link Reference} found in this scope. + * This includes occurrences of local variables as well as variables from parent scopes (including the global scope). + * For local variables this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the formal parameter in the parameter list. + * @public + */ + references = []; + /** + * The map from variable names to variable objects. + * @public + */ + set = new Map(); + /** + * The {@link Reference}s that are not resolved with this scope. + * @public + */ + through = []; + type; + /** + * Reference to the parent {@link Scope}. + * @public + */ + upper; + /** + * The scoped {@link Variable}s of this scope. + * In the case of a 'function' scope this includes the automatic argument `arguments` as its first element, as well + * as all further formal arguments. + * This does not include variables which are defined in child scopes. + * @public + */ + variables = []; + /** + * For scopes that can contain variable declarations, this is a self-reference. + * For other scope types this is the *variableScope* value of the parent scope. + * @public + */ + #dynamicCloseRef = (ref) => { + // notify all names are through to global + let current = this; + do { + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + current.through.push(ref); + current = current.upper; + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + } while (current); + }; + #globalCloseRef = (ref, scopeManager) => { + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.shouldStaticallyCloseForGlobal(ref, scopeManager)) { + this.#staticCloseRef(ref); + } + else { + this.#dynamicCloseRef(ref); + } + }; + #staticCloseRef = (ref) => { + const resolve = () => { + const name = ref.identifier.name; + const variable = this.set.get(name); + if (!variable) { + return false; + } + if (!this.isValidResolution(ref, variable)) { + return false; + } + // make sure we don't match a type reference to a value variable + const isValidTypeReference = ref.isTypeReference && variable.isTypeVariable; + const isValidValueReference = ref.isValueReference && variable.isValueVariable; + if (!isValidTypeReference && !isValidValueReference) { + return false; + } + variable.references.push(ref); + ref.resolved = variable; + return true; + }; + if (!resolve()) { + this.delegateToUpperScope(ref); + } + }; + variableScope; + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + const upperScopeAsScopeBase = upperScope; + this.type = type; + this.#dynamic = + this.type === ScopeType_1.ScopeType.global || this.type === ScopeType_1.ScopeType.with; + this.block = block; + this.variableScope = this.isVariableScope() + ? this + : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + upperScopeAsScopeBase.variableScope; + this.upper = upperScope; + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = isStrictScope(this, block, isMethodDefinition); + // this is guaranteed to be correct at runtime + upperScopeAsScopeBase?.childScopes.push(this); + this.#declaredVariables = scopeManager.declaredVariables; + registerScope(scopeManager, this); + } + isVariableScope() { + return VARIABLE_SCOPE_TYPES.has(this.type); + } + shouldStaticallyCloseForGlobal(ref, scopeManager) { + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + const variable = this.set.get(name); + if (!variable) { + return false; + } + // variable exists on the scope + // in module mode, we can statically resolve everything, regardless of its decl type + if (scopeManager.isModule()) { + return true; + } + // in script mode, only certain cases should be statically resolved + // Example: + // a `var` decl is ignored by the runtime if it clashes with a global name + // this means that we should not resolve the reference to the variable + const defs = variable.defs; + return (defs.length > 0 && + defs.every(def => { + if (def.type === definition_1.DefinitionType.Variable && def.parent.kind === 'var') { + return false; + } + return true; + })); + } + close(scopeManager) { + let closeRef; + if (this.shouldStaticallyClose()) { + closeRef = this.#staticCloseRef; + } + else if (this.type !== 'global') { + closeRef = this.#dynamicCloseRef; + } + else { + closeRef = this.#globalCloseRef; + } + // Try Resolving all references in this scope. + (0, assert_1.assert)(this.leftToResolve); + this.leftToResolve.forEach(ref => closeRef(ref, scopeManager)); + this.leftToResolve = null; + return this.upper; + } + shouldStaticallyClose() { + return !this.#dynamic; + } + /** + * To override by function scopes. + * References in default parameters isn't resolved to variables which are in their function body. + */ + defineVariable(nameOrVariable, set, variables, node, def) { + const name = typeof nameOrVariable === 'string' ? nameOrVariable : nameOrVariable.name; + let variable = set.get(name); + if (!variable) { + variable = + typeof nameOrVariable === 'string' + ? new variable_1.Variable(name, this) + : nameOrVariable; + set.set(name, variable); + variables.push(variable); + } + if (def) { + variable.defs.push(def); + this.addDeclaredVariablesOfNode(variable, def.node); + this.addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + delegateToUpperScope(ref) { + this.upper?.leftToResolve?.push(ref); + this.through.push(ref); + } + isValidResolution(_ref, _variable) { + return true; + } + addDeclaredVariablesOfNode(variable, node) { + if (node == null) { + return; + } + let variables = this.#declaredVariables.get(node); + if (variables == null) { + variables = []; + this.#declaredVariables.set(node, variables); + } + if (!variables.includes(variable)) { + variables.push(variable); + } + } + defineIdentifier(node, def) { + this.defineVariable(node.name, this.set, this.variables, node, def); + } + defineLiteralIdentifier(node, def) { + this.defineVariable(node.value, this.set, this.variables, null, def); + } + referenceDualValueType(node) { + const ref = new Reference_1.Reference(node, this, Reference_1.ReferenceFlag.Read, null, null, false, Reference_1.ReferenceTypeFlag.Type | Reference_1.ReferenceTypeFlag.Value); + this.references.push(ref); + this.leftToResolve?.push(ref); + } + referenceType(node) { + const ref = new Reference_1.Reference(node, this, Reference_1.ReferenceFlag.Read, null, null, false, Reference_1.ReferenceTypeFlag.Type); + this.references.push(ref); + this.leftToResolve?.push(ref); + } + referenceValue(node, assign = Reference_1.ReferenceFlag.Read, writeExpr, maybeImplicitGlobal, init = false) { + const ref = new Reference_1.Reference(node, this, assign, writeExpr, maybeImplicitGlobal, init, Reference_1.ReferenceTypeFlag.Value); + this.references.push(ref); + this.leftToResolve?.push(ref); + } +} +exports.ScopeBase = ScopeBase; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts.map new file mode 100644 index 0000000..6181f2d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeType.d.ts","sourceRoot":"","sources":["../../src/scope/ScopeType.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,qBAAqB,4BAA4B;IACjD,gBAAgB,uBAAuB;IACvC,eAAe,oBAAoB;IACnC,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,sBAAsB,6BAA6B;IACnD,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CACd"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js new file mode 100644 index 0000000..a027973 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeType = void 0; +var ScopeType; +(function (ScopeType) { + ScopeType["block"] = "block"; + ScopeType["catch"] = "catch"; + ScopeType["class"] = "class"; + ScopeType["classFieldInitializer"] = "class-field-initializer"; + ScopeType["classStaticBlock"] = "class-static-block"; + ScopeType["conditionalType"] = "conditionalType"; + ScopeType["for"] = "for"; + ScopeType["function"] = "function"; + ScopeType["functionExpressionName"] = "function-expression-name"; + ScopeType["functionType"] = "functionType"; + ScopeType["global"] = "global"; + ScopeType["mappedType"] = "mappedType"; + ScopeType["module"] = "module"; + ScopeType["switch"] = "switch"; + ScopeType["tsEnum"] = "tsEnum"; + ScopeType["tsModule"] = "tsModule"; + ScopeType["type"] = "type"; + ScopeType["with"] = "with"; +})(ScopeType || (exports.ScopeType = ScopeType = {})); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts.map new file mode 100644 index 0000000..035d6ae --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SwitchScope.d.ts","sourceRoot":"","sources":["../../src/scope/SwitchScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,WAAY,SAAQ,SAAS,CACxC,SAAS,CAAC,MAAM,EAChB,QAAQ,CAAC,eAAe,EACxB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAChC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;CAI9B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js new file mode 100644 index 0000000..c894a03 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SwitchScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class SwitchScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.switch, upperScope, block, false); + } +} +exports.SwitchScope = SwitchScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts.map new file mode 100644 index 0000000..dac52dc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumScope.d.ts","sourceRoot":"","sources":["../../src/scope/TSEnumScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,WAAY,SAAQ,SAAS,CACxC,SAAS,CAAC,MAAM,EAChB,QAAQ,CAAC,iBAAiB,EAC1B,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAChC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;CAI9B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js new file mode 100644 index 0000000..417bdde --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TSEnumScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.tsEnum, upperScope, block, false); + } +} +exports.TSEnumScope = TSEnumScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts.map new file mode 100644 index 0000000..beda392 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSModuleScope.d.ts","sourceRoot":"","sources":["../../src/scope/TSModuleScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,aAAc,SAAQ,SAAS,CAC1C,SAAS,CAAC,QAAQ,EAClB,QAAQ,CAAC,mBAAmB,EAC5B,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAClC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC;CAIhC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js new file mode 100644 index 0000000..04d9774 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSModuleScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TSModuleScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.tsModule, upperScope, block, false); + } +} +exports.TSModuleScope = TSModuleScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts.map new file mode 100644 index 0000000..838d873 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeScope.d.ts","sourceRoot":"","sources":["../../src/scope/TypeScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,SAAU,SAAQ,SAAS,CACtC,SAAS,CAAC,IAAI,EACd,QAAQ,CAAC,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,EACjE,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,EAC9B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;CAI5B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js new file mode 100644 index 0000000..c62ad96 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.type, upperScope, block, false); + } +} +exports.TypeScope = TypeScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts.map new file mode 100644 index 0000000..b6dab38 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"WithScope.d.ts","sourceRoot":"","sources":["../../src/scope/WithScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,SAAU,SAAQ,SAAS,CACtC,SAAS,CAAC,IAAI,EACd,QAAQ,CAAC,aAAa,EACtB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,EAC9B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;IAKX,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,KAAK,GAAG,IAAI;CAShE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js new file mode 100644 index 0000000..9ec3a47 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WithScope = void 0; +const assert_1 = require("../assert"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class WithScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.with, upperScope, block, false); + } + close(scopeManager) { + if (this.shouldStaticallyClose()) { + return super.close(scopeManager); + } + (0, assert_1.assert)(this.leftToResolve); + this.leftToResolve.forEach(ref => this.delegateToUpperScope(ref)); + this.leftToResolve = null; + return this.upper; + } +} +exports.WithScope = WithScope; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts.map new file mode 100644 index 0000000..43f10ba --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js new file mode 100644 index 0000000..d2e73d8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js @@ -0,0 +1,35 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./BlockScope"), exports); +__exportStar(require("./CatchScope"), exports); +__exportStar(require("./ClassFieldInitializerScope"), exports); +__exportStar(require("./ClassScope"), exports); +__exportStar(require("./ConditionalTypeScope"), exports); +__exportStar(require("./ForScope"), exports); +__exportStar(require("./FunctionExpressionNameScope"), exports); +__exportStar(require("./FunctionScope"), exports); +__exportStar(require("./FunctionTypeScope"), exports); +__exportStar(require("./GlobalScope"), exports); +__exportStar(require("./MappedTypeScope"), exports); +__exportStar(require("./ModuleScope"), exports); +__exportStar(require("./Scope"), exports); +__exportStar(require("./ScopeType"), exports); +__exportStar(require("./SwitchScope"), exports); +__exportStar(require("./TSEnumScope"), exports); +__exportStar(require("./TSModuleScope"), exports); +__exportStar(require("./TypeScope"), exports); +__exportStar(require("./WithScope"), exports); diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts.map new file mode 100644 index 0000000..0890fac --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ESLintScopeVariable.d.ts","sourceRoot":"","sources":["../../src/variable/ESLintScopeVariable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;IACnD;;;;;OAKG;IACI,SAAS,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACI,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAEtC;;;OAGG;IACI,2BAA2B,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAE7D;;;;OAIG;IACI,4BAA4B,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;CAC1D"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js new file mode 100644 index 0000000..8aea84e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ESLintScopeVariable = void 0; +const VariableBase_1 = require("./VariableBase"); +/** + * ESLint defines global variables using the eslint-scope Variable class + * This is declared here for consumers to use + */ +class ESLintScopeVariable extends VariableBase_1.VariableBase { + /** + * Written to by ESLint. + * If this key exists, this variable is a global variable added by ESLint. + * If this is `true`, this variable can be assigned arbitrary values. + * If this is `false`, this variable is readonly. + */ + writeable; // note that this isn't a typo - ESlint uses this spelling here + /** + * Written to by ESLint. + * This property is undefined if there are no globals directive comments. + * The array of globals directive comments which defined this global variable in the source code file. + */ + eslintExplicitGlobal; + /** + * Written to by ESLint. + * The configured value in config files. This can be different from `variable.writeable` if there are globals directive comments. + */ + eslintImplicitGlobalSetting; + /** + * Written to by ESLint. + * If this key exists, it is a global variable added by ESLint. + * If `true`, this global variable was defined by a globals directive comment in the source code file. + */ + eslintExplicitGlobalComments; +} +exports.ESLintScopeVariable = ESLintScopeVariable; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts.map new file mode 100644 index 0000000..322f675 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImplicitLibVariable.d.ts","sourceRoot":"","sources":["../../src/variable/ImplicitLibVariable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,mBAAmB,CAAC,6BAA6B,CAAC,CAAC;IAC1F,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,aAAa,EAAE,CAAC;IAC/B,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,0BAA0B,CAAC,EAAE,CAAC;CAC5D;AAED;;GAEG;AACH,qBAAa,mBACX,SAAQ,mBACR,YAAW,QAAQ;IAEnB;;OAEG;IACH,SAAgB,cAAc,EAAE,OAAO,CAAC;IAExC;;OAEG;IACH,SAAgB,eAAe,EAAE,OAAO,CAAC;gBAGvC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,MAAM,EACZ,EACE,2BAA2B,EAC3B,cAAc,EACd,eAAe,EACf,SAAS,GACV,EAAE,0BAA0B;CAShC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js new file mode 100644 index 0000000..b896c1e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImplicitLibVariable = void 0; +const ESLintScopeVariable_1 = require("./ESLintScopeVariable"); +/** + * An variable implicitly defined by the TS Lib + */ +class ImplicitLibVariable extends ESLintScopeVariable_1.ESLintScopeVariable { + /** + * `true` if the variable is valid in a type context, false otherwise + */ + isTypeVariable; + /** + * `true` if the variable is valid in a value context, false otherwise + */ + isValueVariable; + constructor(scope, name, { eslintImplicitGlobalSetting, isTypeVariable, isValueVariable, writeable, }) { + super(name, scope); + this.isTypeVariable = isTypeVariable ?? false; + this.isValueVariable = isValueVariable ?? false; + this.writeable = writeable ?? false; + this.eslintImplicitGlobalSetting = + eslintImplicitGlobalSetting ?? 'readonly'; + } +} +exports.ImplicitLibVariable = ImplicitLibVariable; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts.map new file mode 100644 index 0000000..9263ad4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Variable.d.ts","sourceRoot":"","sources":["../../src/variable/Variable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,qBAAa,QAAS,SAAQ,YAAY;IACxC;;;OAGG;IACH,IAAW,cAAc,IAAI,OAAO,CAOnC;IAED;;;OAGG;IACH,IAAW,eAAe,IAAI,OAAO,CAOpC;CACF"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js new file mode 100644 index 0000000..3623de9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Variable = void 0; +const VariableBase_1 = require("./VariableBase"); +/** + * A Variable represents a locally scoped identifier. These include arguments to functions. + */ +class Variable extends VariableBase_1.VariableBase { + /** + * `true` if the variable is valid in a type context, false otherwise + * @public + */ + get isTypeVariable() { + if (this.defs.length === 0) { + // we don't statically know whether this is a type or a value + return true; + } + return this.defs.some(def => def.isTypeDefinition); + } + /** + * `true` if the variable is valid in a value context, false otherwise + * @public + */ + get isValueVariable() { + if (this.defs.length === 0) { + // we don't statically know whether this is a type or a value + return true; + } + return this.defs.some(def => def.isVariableDefinition); + } +} +exports.Variable = Variable; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts.map new file mode 100644 index 0000000..182e398 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"VariableBase.d.ts","sourceRoot":"","sources":["../../src/variable/VariableBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAMtC,qBAAa,YAAY;IACvB;;OAEG;IACH,SAAgB,GAAG,EAAE,MAAM,CAAe;IAE1C;;;OAGG;IACH,SAAgB,IAAI,EAAE,UAAU,EAAE,CAAM;IACxC;;;OAGG;IACI,UAAU,UAAS;IAC1B;;;;OAIG;IACH,SAAgB,WAAW,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAM;IACxD;;;OAGG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,SAAgB,UAAU,EAAE,SAAS,EAAE,CAAM;IAC7C;;OAEG;IACH,SAAgB,KAAK,EAAE,KAAK,CAAC;gBAEjB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;CAIvC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js new file mode 100644 index 0000000..8a81b34 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariableBase = void 0; +const ID_1 = require("../ID"); +const generator = (0, ID_1.createIdGenerator)(); +class VariableBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + $id = generator(); + /** + * The array of the definitions of this variable. + * @public + */ + defs = []; + /** + * True if the variable is considered used for the purposes of `no-unused-vars`, false otherwise. + * @public + */ + eslintUsed = false; + /** + * The array of `Identifier` nodes which define this variable. + * If this variable is redeclared, this array includes two or more nodes. + * @public + */ + identifiers = []; + /** + * The variable name, as given in the source code. + * @public + */ + name; + /** + * List of {@link Reference} of this variable (excluding parameter entries) in its defining scope and all nested scopes. + * For defining occurrences only see {@link Variable#defs}. + * @public + */ + references = []; + /** + * Reference to the enclosing Scope. + */ + scope; + constructor(name, scope) { + this.name = name; + this.scope = scope; + } +} +exports.VariableBase = VariableBase; diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts.map new file mode 100644 index 0000000..46c7ba6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/variable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js new file mode 100644 index 0000000..a194a41 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Variable = exports.ImplicitLibVariable = exports.ESLintScopeVariable = void 0; +var ESLintScopeVariable_1 = require("./ESLintScopeVariable"); +Object.defineProperty(exports, "ESLintScopeVariable", { enumerable: true, get: function () { return ESLintScopeVariable_1.ESLintScopeVariable; } }); +var ImplicitLibVariable_1 = require("./ImplicitLibVariable"); +Object.defineProperty(exports, "ImplicitLibVariable", { enumerable: true, get: function () { return ImplicitLibVariable_1.ImplicitLibVariable; } }); +var Variable_1 = require("./Variable"); +Object.defineProperty(exports, "Variable", { enumerable: true, get: function () { return Variable_1.Variable; } }); diff --git a/node_modules/@typescript-eslint/scope-manager/package.json b/node_modules/@typescript-eslint/scope-manager/package.json new file mode 100644 index 0000000..e973439 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/package.json @@ -0,0 +1,75 @@ +{ + "name": "@typescript-eslint/scope-manager", + "version": "8.26.0", + "description": "TypeScript scope analyser for ESLint", + "files": [ + "dist", + "!*.tsbuildinfo", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "types": "./dist/index.d.ts", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/scope-manager" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io/packages/scope-manager", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "scripts": { + "build": "npx nx build", + "clean": "npx nx clean", + "clean-fixtures": "npx nx clean-fixtures", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "generate-lib": "npx nx generate-lib repo", + "lint": "npx nx lint", + "test": "jest", + "check-types": "npx nx typecheck" + }, + "dependencies": { + "@typescript-eslint/types": "8.26.0", + "@typescript-eslint/visitor-keys": "8.26.0" + }, + "devDependencies": { + "@jest/types": "29.6.3", + "@typescript-eslint/typescript-estree": "8.26.0", + "glob": "*", + "jest": "29.7.0", + "jest-specific-snapshot": "*", + "make-dir": "*", + "prettier": "^3.2.5", + "pretty-format": "*", + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/node_modules/@typescript-eslint/type-utils/LICENSE b/node_modules/@typescript-eslint/type-utils/LICENSE new file mode 100644 index 0000000..dabd464 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/type-utils/README.md b/node_modules/@typescript-eslint/type-utils/README.md new file mode 100644 index 0000000..c5d3279 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/type-utils` + +> Type utilities for working with TypeScript within ESLint rules. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) + +The utilities in this package are separated from `@typescript-eslint/utils` so that that package does not require a dependency on `typescript`. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.d.ts.map new file mode 100644 index 0000000..2be1084 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeOrValueSpecifier.d.ts","sourceRoot":"","sources":["../src/TypeOrValueSpecifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAStC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,aAAa,GACb,YAAY,GACZ,gBAAgB,CAAC;AAErB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FR,CAAC;AAEjC,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,EAAE,CAAC,OAAO,GAClB,OAAO,CA6CT;AAED,eAAO,MAAM,wBAAwB,GACnC,MAAM,EAAE,CAAC,IAAI,EACb,YAAY,oBAAoB,EAAE,YAAK,EACvC,SAAS,EAAE,CAAC,OAAO,KAClB,OAC2E,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.js b/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.js new file mode 100644 index 0000000..b595f60 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.js @@ -0,0 +1,172 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeMatchesSomeSpecifier = exports.typeOrValueSpecifiersSchema = void 0; +exports.typeMatchesSpecifier = typeMatchesSpecifier; +const tsutils = __importStar(require("ts-api-utils")); +const specifierNameMatches_1 = require("./typeOrValueSpecifiers/specifierNameMatches"); +const typeDeclaredInFile_1 = require("./typeOrValueSpecifiers/typeDeclaredInFile"); +const typeDeclaredInLib_1 = require("./typeOrValueSpecifiers/typeDeclaredInLib"); +const typeDeclaredInPackageDeclarationFile_1 = require("./typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile"); +exports.typeOrValueSpecifiersSchema = { + items: { + oneOf: [ + { + type: 'string', + }, + { + additionalProperties: false, + properties: { + from: { + enum: ['file'], + type: 'string', + }, + name: { + oneOf: [ + { + type: 'string', + }, + { + items: { + type: 'string', + }, + minItems: 1, + type: 'array', + uniqueItems: true, + }, + ], + }, + path: { + type: 'string', + }, + }, + required: ['from', 'name'], + type: 'object', + }, + { + additionalProperties: false, + properties: { + from: { + enum: ['lib'], + type: 'string', + }, + name: { + oneOf: [ + { + type: 'string', + }, + { + items: { + type: 'string', + }, + minItems: 1, + type: 'array', + uniqueItems: true, + }, + ], + }, + }, + required: ['from', 'name'], + type: 'object', + }, + { + additionalProperties: false, + properties: { + from: { + enum: ['package'], + type: 'string', + }, + name: { + oneOf: [ + { + type: 'string', + }, + { + items: { + type: 'string', + }, + minItems: 1, + type: 'array', + uniqueItems: true, + }, + ], + }, + package: { + type: 'string', + }, + }, + required: ['from', 'name', 'package'], + type: 'object', + }, + ], + }, + type: 'array', +}; +function typeMatchesSpecifier(type, specifier, program) { + const wholeTypeMatches = (() => { + if (tsutils.isIntrinsicErrorType(type)) { + return false; + } + if (typeof specifier === 'string') { + return (0, specifierNameMatches_1.specifierNameMatches)(type, specifier); + } + if (!(0, specifierNameMatches_1.specifierNameMatches)(type, specifier.name)) { + return false; + } + const symbol = type.getSymbol() ?? type.aliasSymbol; + const declarations = symbol?.getDeclarations() ?? []; + const declarationFiles = declarations.map(declaration => declaration.getSourceFile()); + switch (specifier.from) { + case 'file': + return (0, typeDeclaredInFile_1.typeDeclaredInFile)(specifier.path, declarationFiles, program); + case 'lib': + return (0, typeDeclaredInLib_1.typeDeclaredInLib)(declarationFiles, program); + case 'package': + return (0, typeDeclaredInPackageDeclarationFile_1.typeDeclaredInPackageDeclarationFile)(specifier.package, declarations, declarationFiles, program); + } + })(); + if (wholeTypeMatches) { + return true; + } + if (tsutils.isIntersectionType(type) && + tsutils + .intersectionTypeParts(type) + .some(part => typeMatchesSpecifier(part, specifier, program))) { + return true; + } + return false; +} +const typeMatchesSomeSpecifier = (type, specifiers = [], program) => specifiers.some(specifier => typeMatchesSpecifier(type, specifier, program)); +exports.typeMatchesSomeSpecifier = typeMatchesSomeSpecifier; diff --git a/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.d.ts.map new file mode 100644 index 0000000..f47f7d3 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"builtinSymbolLikes.d.ts","sourceRoot":"","sources":["../src/builtinSymbolLikes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAEzE;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,OAAO,CAET;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAEvE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,OAAO,CAQT;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,CAAC,EAAE,CACV,OAAO,EAAE;IACP,WAAW,EAAE,EAAE,CAAC,MAAM,CAAC;IACvB,kBAAkB,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC;CACxC,GAAG,EAAE,CAAC,IAAI,KACR,OAAO,GACX,OAAO,CAMT;AACD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,CACT,OAAO,EAAE;IACP,WAAW,EAAE,EAAE,CAAC,MAAM,CAAC;IACvB,kBAAkB,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC;CACxC,GAAG,EAAE,CAAC,IAAI,KACR,OAAO,GACX,OAAO,CAsBT;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAC5B,OAAO,CAoBT;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,GAAG,IAAI,GAC9C,OAAO,CAuCT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.js b/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.js new file mode 100644 index 0000000..3d1002f --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.js @@ -0,0 +1,164 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPromiseLike = isPromiseLike; +exports.isPromiseConstructorLike = isPromiseConstructorLike; +exports.isErrorLike = isErrorLike; +exports.isReadonlyErrorLike = isReadonlyErrorLike; +exports.isReadonlyTypeLike = isReadonlyTypeLike; +exports.isBuiltinTypeAliasLike = isBuiltinTypeAliasLike; +exports.isBuiltinSymbolLike = isBuiltinSymbolLike; +exports.isBuiltinSymbolLikeRecurser = isBuiltinSymbolLikeRecurser; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const isSymbolFromDefaultLibrary_1 = require("./isSymbolFromDefaultLibrary"); +/** + * @example + * ```ts + * class DerivedClass extends Promise {} + * DerivedClass.reject + * // ^ PromiseLike + * ``` + */ +function isPromiseLike(program, type) { + return isBuiltinSymbolLike(program, type, 'Promise'); +} +/** + * @example + * ```ts + * const value = Promise + * value.reject + * // ^ PromiseConstructorLike + * ``` + */ +function isPromiseConstructorLike(program, type) { + return isBuiltinSymbolLike(program, type, 'PromiseConstructor'); +} +/** + * @example + * ```ts + * class Foo extends Error {} + * new Foo() + * // ^ ErrorLike + * ``` + */ +function isErrorLike(program, type) { + return isBuiltinSymbolLike(program, type, 'Error'); +} +/** + * @example + * ```ts + * type T = Readonly + * // ^ ReadonlyErrorLike + * ``` + */ +function isReadonlyErrorLike(program, type) { + return isReadonlyTypeLike(program, type, subtype => { + const [typeArgument] = subtype.aliasTypeArguments; + return (isErrorLike(program, typeArgument) || + isReadonlyErrorLike(program, typeArgument)); + }); +} +/** + * @example + * ```ts + * type T = Readonly<{ foo: 'bar' }> + * // ^ ReadonlyTypeLike + * ``` + */ +function isReadonlyTypeLike(program, type, predicate) { + return isBuiltinTypeAliasLike(program, type, subtype => { + return (subtype.aliasSymbol.getName() === 'Readonly' && !!predicate?.(subtype)); + }); +} +function isBuiltinTypeAliasLike(program, type, predicate) { + return isBuiltinSymbolLikeRecurser(program, type, subtype => { + const { aliasSymbol, aliasTypeArguments } = subtype; + if (!aliasSymbol || !aliasTypeArguments) { + return false; + } + if ((0, isSymbolFromDefaultLibrary_1.isSymbolFromDefaultLibrary)(program, aliasSymbol) && + predicate(subtype)) { + return true; + } + return null; + }); +} +function isBuiltinSymbolLike(program, type, symbolName) { + return isBuiltinSymbolLikeRecurser(program, type, subType => { + const symbol = subType.getSymbol(); + if (!symbol) { + return false; + } + const actualSymbolName = symbol.getName(); + if ((Array.isArray(symbolName) + ? symbolName.some(name => actualSymbolName === name) + : actualSymbolName === symbolName) && + (0, isSymbolFromDefaultLibrary_1.isSymbolFromDefaultLibrary)(program, symbol)) { + return true; + } + return null; + }); +} +function isBuiltinSymbolLikeRecurser(program, type, predicate) { + if (type.isIntersection()) { + return type.types.some(t => isBuiltinSymbolLikeRecurser(program, t, predicate)); + } + if (type.isUnion()) { + return type.types.every(t => isBuiltinSymbolLikeRecurser(program, t, predicate)); + } + if (tsutils.isTypeParameter(type)) { + const t = type.getConstraint(); + if (t) { + return isBuiltinSymbolLikeRecurser(program, t, predicate); + } + return false; + } + const predicateResult = predicate(type); + if (typeof predicateResult === 'boolean') { + return predicateResult; + } + const symbol = type.getSymbol(); + if (symbol && + symbol.flags & (ts.SymbolFlags.Class | ts.SymbolFlags.Interface)) { + const checker = program.getTypeChecker(); + for (const baseType of checker.getBaseTypes(type)) { + if (isBuiltinSymbolLikeRecurser(program, baseType, predicate)) { + return true; + } + } + } + return false; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.d.ts.map new file mode 100644 index 0000000..d043e63 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"containsAllTypesByName.d.ts","sourceRoot":"","sources":["../src/containsAllTypesByName.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,EACzB,eAAe,UAAQ,GACtB,OAAO,CA+BT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.js b/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.js new file mode 100644 index 0000000..3307970 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.js @@ -0,0 +1,69 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.containsAllTypesByName = containsAllTypesByName; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const typeFlagUtils_1 = require("./typeFlagUtils"); +/** + * @param type Type being checked by name. + * @param allowAny Whether to consider `any` and `unknown` to match. + * @param allowedNames Symbol names checking on the type. + * @param matchAnyInstead Whether to instead just check if any parts match, rather than all parts. + * @returns Whether the type is, extends, or contains the allowed names (or all matches the allowed names, if mustMatchAll is true). + */ +function containsAllTypesByName(type, allowAny, allowedNames, matchAnyInstead = false) { + if ((0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return !allowAny; + } + if (tsutils.isTypeReference(type)) { + type = type.target; + } + const symbol = type.getSymbol(); + if (symbol && allowedNames.has(symbol.name)) { + return true; + } + const predicate = (t) => containsAllTypesByName(t, allowAny, allowedNames, matchAnyInstead); + if (tsutils.isUnionOrIntersectionType(type)) { + return matchAnyInstead + ? type.types.some(predicate) + : type.types.every(predicate); + } + const bases = type.getBaseTypes(); + return (bases != null && + (matchAnyInstead + ? bases.some(predicate) + : bases.length > 0 && bases.every(predicate))); +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.d.ts.map new file mode 100644 index 0000000..6248b21 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getConstrainedTypeAtLocation.d.ts","sourceRoot":"","sources":["../src/getConstrainedTypeAtLocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,iCAAiC,EAC3C,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,EAAE,CAAC,IAAI,CAOT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.js b/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.js new file mode 100644 index 0000000..05af126 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getConstrainedTypeAtLocation = getConstrainedTypeAtLocation; +/** + * Resolves the given node's type. Will return the type's generic constraint, if it has one. + * + * Warning - if the type is generic and does _not_ have a constraint, the type will be + * returned as-is, rather than returning an `unknown` type. This can be checked + * for by checking for the type flag ts.TypeFlags.TypeParameter. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/10438 + */ +function getConstrainedTypeAtLocation(services, node) { + const nodeType = services.getTypeAtLocation(node); + const constrained = services.program + .getTypeChecker() + .getBaseConstraintOfType(nodeType); + return constrained ?? nodeType; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/getContextualType.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/getContextualType.d.ts.map new file mode 100644 index 0000000..4f66d46 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getContextualType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getContextualType.d.ts","sourceRoot":"","sources":["../src/getContextualType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,UAAU,GAClB,EAAE,CAAC,IAAI,GAAG,SAAS,CAwCrB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/getContextualType.js b/node_modules/@typescript-eslint/type-utils/dist/getContextualType.js new file mode 100644 index 0000000..b67ef76 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getContextualType.js @@ -0,0 +1,76 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getContextualType = getContextualType; +const ts = __importStar(require("typescript")); +/** + * Returns the contextual type of a given node. + * Contextual type is the type of the target the node is going into. + * i.e. the type of a called function's parameter, or the defined type of a variable declaration + */ +function getContextualType(checker, node) { + const parent = node.parent; + if (ts.isCallExpression(parent) || ts.isNewExpression(parent)) { + if (node === parent.expression) { + // is the callee, so has no contextual type + return; + } + } + else if (ts.isVariableDeclaration(parent) || + ts.isPropertyDeclaration(parent) || + ts.isParameter(parent)) { + return parent.type ? checker.getTypeFromTypeNode(parent.type) : undefined; + } + else if (ts.isJsxExpression(parent)) { + return checker.getContextualType(parent); + } + else if (ts.isIdentifier(node) && + (ts.isPropertyAssignment(parent) || + ts.isShorthandPropertyAssignment(parent))) { + return checker.getContextualType(node); + } + else if (ts.isBinaryExpression(parent) && + parent.operatorToken.kind === ts.SyntaxKind.EqualsToken && + parent.right === node) { + // is RHS of assignment + return checker.getTypeAtLocation(parent.left); + } + else if (![ts.SyntaxKind.JsxExpression, ts.SyntaxKind.TemplateSpan].includes(parent.kind)) { + // parent is not something we know we can get the contextual type of + return; + } + // TODO - support return statement checking + return checker.getContextualType(node); +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.d.ts.map new file mode 100644 index 0000000..369214d --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getDeclaration.d.ts","sourceRoot":"","sources":["../src/getDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,iCAAiC,EAC3C,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,EAAE,CAAC,WAAW,GAAG,IAAI,CAOvB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.js b/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.js new file mode 100644 index 0000000..eba593d --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDeclaration = getDeclaration; +/** + * Gets the declaration for the given variable + */ +function getDeclaration(services, node) { + const symbol = services.getSymbolAtLocation(node); + if (!symbol) { + return null; + } + const declarations = symbol.getDeclarations(); + return declarations?.[0] ?? null; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.d.ts.map new file mode 100644 index 0000000..4b992bd --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getSourceFileOfNode.d.ts","sourceRoot":"","sources":["../src/getSourceFileOfNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,UAAU,CAKhE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.js b/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.js new file mode 100644 index 0000000..c27e044 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.js @@ -0,0 +1,46 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSourceFileOfNode = getSourceFileOfNode; +const ts = __importStar(require("typescript")); +/** + * Gets the source file for a given node + */ +function getSourceFileOfNode(node) { + while (node.kind !== ts.SyntaxKind.SourceFile) { + node = node.parent; + } + return node; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/getTypeName.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/getTypeName.d.ts.map new file mode 100644 index 0000000..a598b0f --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getTypeName.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getTypeName.d.ts","sourceRoot":"","sources":["../src/getTypeName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,EAAE,CAAC,WAAW,EAC3B,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,MAAM,CAqDR"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/getTypeName.js b/node_modules/@typescript-eslint/type-utils/dist/getTypeName.js new file mode 100644 index 0000000..e78114f --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/getTypeName.js @@ -0,0 +1,83 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTypeName = getTypeName; +const ts = __importStar(require("typescript")); +/** + * Get the type name of a given type. + * @param typeChecker The context sensitive TypeScript TypeChecker. + * @param type The type to get the name of. + */ +function getTypeName(typeChecker, type) { + // It handles `string` and string literal types as string. + if ((type.flags & ts.TypeFlags.StringLike) !== 0) { + return 'string'; + } + // If the type is a type parameter which extends primitive string types, + // but it was not recognized as a string like. So check the constraint + // type of the type parameter. + if ((type.flags & ts.TypeFlags.TypeParameter) !== 0) { + // `type.getConstraint()` method doesn't return the constraint type of + // the type parameter for some reason. So this gets the constraint type + // via AST. + const symbol = type.getSymbol(); + const decls = symbol?.getDeclarations(); + const typeParamDecl = decls?.[0]; + if (typeParamDecl != null && + ts.isTypeParameterDeclaration(typeParamDecl) && + typeParamDecl.constraint != null) { + return getTypeName(typeChecker, typeChecker.getTypeFromTypeNode(typeParamDecl.constraint)); + } + } + // If the type is a union and all types in the union are string like, + // return `string`. For example: + // - `"a" | "b"` is string. + // - `string | string[]` is not string. + if (type.isUnion() && + type.types + .map(value => getTypeName(typeChecker, value)) + .every(t => t === 'string')) { + return 'string'; + } + // If the type is an intersection and a type in the intersection is string + // like, return `string`. For example: `string & {__htmlEscaped: void}` + if (type.isIntersection() && + type.types + .map(value => getTypeName(typeChecker, value)) + .some(t => t === 'string')) { + return 'string'; + } + return typeChecker.typeToString(type); +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/index.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/index.d.ts.map new file mode 100644 index 0000000..4597d40 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EACL,aAAa,EACb,YAAY,EACZ,0BAA0B,GAC3B,MAAM,sCAAsC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/index.js b/node_modules/@typescript-eslint/type-utils/dist/index.js new file mode 100644 index 0000000..1967d46 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/index.js @@ -0,0 +1,36 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typescriptVersionIsAtLeast = exports.getModifiers = exports.getDecorators = void 0; +__exportStar(require("./builtinSymbolLikes"), exports); +__exportStar(require("./containsAllTypesByName"), exports); +__exportStar(require("./getConstrainedTypeAtLocation"), exports); +__exportStar(require("./getContextualType"), exports); +__exportStar(require("./getDeclaration"), exports); +__exportStar(require("./getSourceFileOfNode"), exports); +__exportStar(require("./getTypeName"), exports); +__exportStar(require("./isSymbolFromDefaultLibrary"), exports); +__exportStar(require("./isTypeReadonly"), exports); +__exportStar(require("./isUnsafeAssignment"), exports); +__exportStar(require("./predicates"), exports); +__exportStar(require("./propertyTypes"), exports); +__exportStar(require("./requiresQuoting"), exports); +__exportStar(require("./typeFlagUtils"), exports); +__exportStar(require("./TypeOrValueSpecifier"), exports); +var typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +Object.defineProperty(exports, "getDecorators", { enumerable: true, get: function () { return typescript_estree_1.getDecorators; } }); +Object.defineProperty(exports, "getModifiers", { enumerable: true, get: function () { return typescript_estree_1.getModifiers; } }); +Object.defineProperty(exports, "typescriptVersionIsAtLeast", { enumerable: true, get: function () { return typescript_estree_1.typescriptVersionIsAtLeast; } }); diff --git a/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.d.ts.map new file mode 100644 index 0000000..9e4009e --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isSymbolFromDefaultLibrary.d.ts","sourceRoot":"","sources":["../src/isSymbolFromDefaultLibrary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,SAAS,GAC5B,OAAO,CAcT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.js b/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.js new file mode 100644 index 0000000..4eba215 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSymbolFromDefaultLibrary = isSymbolFromDefaultLibrary; +function isSymbolFromDefaultLibrary(program, symbol) { + if (!symbol) { + return false; + } + const declarations = symbol.getDeclarations() ?? []; + for (const declaration of declarations) { + const sourceFile = declaration.getSourceFile(); + if (program.isSourceFileDefaultLibrary(sourceFile)) { + return true; + } + } + return false; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.d.ts.map new file mode 100644 index 0000000..e2749b0 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isTypeReadonly.d.ts","sourceRoot":"","sources":["../src/isTypeReadonly.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAiBnE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACxC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAC3C;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASf,CAAC;AAExB,eAAO,MAAM,2BAA2B,EAAE,mBAGzC,CAAC;AAgSF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,GAAE,mBAAiD,GACzD,OAAO,CAKT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js b/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js new file mode 100644 index 0000000..bfc4f8d --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js @@ -0,0 +1,241 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readonlynessOptionsDefaults = exports.readonlynessOptionsSchema = void 0; +exports.isTypeReadonly = isTypeReadonly; +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const propertyTypes_1 = require("./propertyTypes"); +const TypeOrValueSpecifier_1 = require("./TypeOrValueSpecifier"); +var Readonlyness; +(function (Readonlyness) { + /** the type cannot be handled by the function */ + Readonlyness[Readonlyness["UnknownType"] = 1] = "UnknownType"; + /** the type is mutable */ + Readonlyness[Readonlyness["Mutable"] = 2] = "Mutable"; + /** the type is readonly */ + Readonlyness[Readonlyness["Readonly"] = 3] = "Readonly"; +})(Readonlyness || (Readonlyness = {})); +exports.readonlynessOptionsSchema = { + additionalProperties: false, + properties: { + allow: TypeOrValueSpecifier_1.typeOrValueSpecifiersSchema, + treatMethodsAsReadonly: { + type: 'boolean', + }, + }, + type: 'object', +}; +exports.readonlynessOptionsDefaults = { + allow: [], + treatMethodsAsReadonly: false, +}; +function hasSymbol(node) { + return Object.hasOwn(node, 'symbol'); +} +function isTypeReadonlyArrayOrTuple(program, type, options, seenTypes) { + const checker = program.getTypeChecker(); + function checkTypeArguments(arrayType) { + const typeArguments = checker.getTypeArguments(arrayType); + // this shouldn't happen in reality as: + // - tuples require at least 1 type argument + // - ReadonlyArray requires at least 1 type argument + /* istanbul ignore if */ if (typeArguments.length === 0) { + return Readonlyness.Readonly; + } + // validate the element types are also readonly + if (typeArguments.some(typeArg => isTypeReadonlyRecurser(program, typeArg, options, seenTypes) === + Readonlyness.Mutable)) { + return Readonlyness.Mutable; + } + return Readonlyness.Readonly; + } + if (checker.isArrayType(type)) { + const symbol = utils_1.ESLintUtils.nullThrows(type.getSymbol(), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('symbol', 'array type')); + const escapedName = symbol.getEscapedName(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison + if (escapedName === 'Array') { + return Readonlyness.Mutable; + } + return checkTypeArguments(type); + } + if (checker.isTupleType(type)) { + if (!type.target.readonly) { + return Readonlyness.Mutable; + } + return checkTypeArguments(type); + } + return Readonlyness.UnknownType; +} +function isTypeReadonlyObject(program, type, options, seenTypes) { + const checker = program.getTypeChecker(); + function checkIndexSignature(kind) { + const indexInfo = checker.getIndexInfoOfType(type, kind); + if (indexInfo) { + if (!indexInfo.isReadonly) { + return Readonlyness.Mutable; + } + if (indexInfo.type === type || seenTypes.has(indexInfo.type)) { + return Readonlyness.Readonly; + } + return isTypeReadonlyRecurser(program, indexInfo.type, options, seenTypes); + } + return Readonlyness.UnknownType; + } + const properties = type.getProperties(); + if (properties.length) { + // ensure the properties are marked as readonly + for (const property of properties) { + if (options.treatMethodsAsReadonly) { + if (property.valueDeclaration != null && + hasSymbol(property.valueDeclaration) && + tsutils.isSymbolFlagSet(property.valueDeclaration.symbol, ts.SymbolFlags.Method)) { + continue; + } + const declarations = property.getDeclarations(); + const lastDeclaration = declarations != null && declarations.length > 0 + ? declarations[declarations.length - 1] + : undefined; + if (lastDeclaration != null && + hasSymbol(lastDeclaration) && + tsutils.isSymbolFlagSet(lastDeclaration.symbol, ts.SymbolFlags.Method)) { + continue; + } + } + if (tsutils.isPropertyReadonlyInType(type, property.getEscapedName(), checker)) { + continue; + } + const name = ts.getNameOfDeclaration(property.valueDeclaration); + if (name && ts.isPrivateIdentifier(name)) { + continue; + } + return Readonlyness.Mutable; + } + // all properties were readonly + // now ensure that all of the values are readonly also. + // do this after checking property readonly-ness as a perf optimization, + // as we might be able to bail out early due to a mutable property before + // doing this deep, potentially expensive check. + for (const property of properties) { + const propertyType = utils_1.ESLintUtils.nullThrows((0, propertyTypes_1.getTypeOfPropertyOfType)(checker, type, property), utils_1.ESLintUtils.NullThrowsReasons.MissingToken(`property "${property.name}"`, 'type')); + // handle recursive types. + // we only need this simple check, because a mutable recursive type will break via the above prop readonly check + if (seenTypes.has(propertyType)) { + continue; + } + if (isTypeReadonlyRecurser(program, propertyType, options, seenTypes) === + Readonlyness.Mutable) { + return Readonlyness.Mutable; + } + } + } + const isStringIndexSigReadonly = checkIndexSignature(ts.IndexKind.String); + if (isStringIndexSigReadonly === Readonlyness.Mutable) { + return isStringIndexSigReadonly; + } + const isNumberIndexSigReadonly = checkIndexSignature(ts.IndexKind.Number); + if (isNumberIndexSigReadonly === Readonlyness.Mutable) { + return isNumberIndexSigReadonly; + } + return Readonlyness.Readonly; +} +// a helper function to ensure the seenTypes map is always passed down, except by the external caller +function isTypeReadonlyRecurser(program, type, options, seenTypes) { + const checker = program.getTypeChecker(); + seenTypes.add(type); + if ((0, TypeOrValueSpecifier_1.typeMatchesSomeSpecifier)(type, options.allow, program)) { + return Readonlyness.Readonly; + } + if (tsutils.isUnionType(type)) { + // all types in the union must be readonly + const result = tsutils + .unionTypeParts(type) + .every(t => seenTypes.has(t) || + isTypeReadonlyRecurser(program, t, options, seenTypes) === + Readonlyness.Readonly); + const readonlyness = result ? Readonlyness.Readonly : Readonlyness.Mutable; + return readonlyness; + } + if (tsutils.isIntersectionType(type)) { + // Special case for handling arrays/tuples (as readonly arrays/tuples always have mutable methods). + if (type.types.some(t => checker.isArrayType(t) || checker.isTupleType(t))) { + const allReadonlyParts = type.types.every(t => seenTypes.has(t) || + isTypeReadonlyRecurser(program, t, options, seenTypes) === + Readonlyness.Readonly); + return allReadonlyParts ? Readonlyness.Readonly : Readonlyness.Mutable; + } + // Normal case. + const isReadonlyObject = isTypeReadonlyObject(program, type, options, seenTypes); + if (isReadonlyObject !== Readonlyness.UnknownType) { + return isReadonlyObject; + } + } + if (tsutils.isConditionalType(type)) { + const result = [type.root.node.trueType, type.root.node.falseType] + .map(checker.getTypeFromTypeNode) + .every(t => seenTypes.has(t) || + isTypeReadonlyRecurser(program, t, options, seenTypes) === + Readonlyness.Readonly); + const readonlyness = result ? Readonlyness.Readonly : Readonlyness.Mutable; + return readonlyness; + } + // all non-object, non-intersection types are readonly. + // this should only be primitive types + if (!tsutils.isObjectType(type)) { + return Readonlyness.Readonly; + } + // pure function types are readonly + if (type.getCallSignatures().length > 0 && + type.getProperties().length === 0) { + return Readonlyness.Readonly; + } + const isReadonlyArray = isTypeReadonlyArrayOrTuple(program, type, options, seenTypes); + if (isReadonlyArray !== Readonlyness.UnknownType) { + return isReadonlyArray; + } + const isReadonlyObject = isTypeReadonlyObject(program, type, options, seenTypes); + /* istanbul ignore else */ if (isReadonlyObject !== Readonlyness.UnknownType) { + return isReadonlyObject; + } + throw new Error('Unhandled type'); +} +/** + * Checks if the given type is readonly + */ +function isTypeReadonly(program, type, options = exports.readonlynessOptionsDefaults) { + return (isTypeReadonlyRecurser(program, type, options, new Set()) === + Readonlyness.Readonly); +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.d.ts.map new file mode 100644 index 0000000..c8a41f1 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isUnsafeAssignment.d.ts","sourceRoot":"","sources":["../src/isUnsafeAssignment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAOtC;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,EAAE,CAAC,IAAI,EACjB,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,UAAU,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,GAC/B;IAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC;IAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAA;CAAE,GAAG,KAAK,CAQhD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js b/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js new file mode 100644 index 0000000..2fde82e --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js @@ -0,0 +1,114 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isUnsafeAssignment = isUnsafeAssignment; +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const predicates_1 = require("./predicates"); +/** + * Does a simple check to see if there is an any being assigned to a non-any type. + * + * This also checks generic positions to ensure there's no unsafe sub-assignments. + * Note: in the case of generic positions, it makes the assumption that the two types are the same. + * + * @example See tests for examples + * + * @returns false if it's safe, or an object with the two types if it's unsafe + */ +function isUnsafeAssignment(type, receiver, checker, senderNode) { + return isUnsafeAssignmentWorker(type, receiver, checker, senderNode, new Map()); +} +function isUnsafeAssignmentWorker(type, receiver, checker, senderNode, visited) { + if ((0, predicates_1.isTypeAnyType)(type)) { + // Allow assignment of any ==> unknown. + if ((0, predicates_1.isTypeUnknownType)(receiver)) { + return false; + } + if (!(0, predicates_1.isTypeAnyType)(receiver)) { + return { receiver, sender: type }; + } + } + const typeAlreadyVisited = visited.get(type); + if (typeAlreadyVisited) { + if (typeAlreadyVisited.has(receiver)) { + return false; + } + typeAlreadyVisited.add(receiver); + } + else { + visited.set(type, new Set([receiver])); + } + if (tsutils.isTypeReference(type) && tsutils.isTypeReference(receiver)) { + // TODO - figure out how to handle cases like this, + // where the types are assignable, but not the same type + /* + function foo(): ReadonlySet { return new Set(); } + + // and + + type Test = { prop: T } + type Test2 = { prop: string } + declare const a: Test; + const b: Test2 = a; + */ + if (type.target !== receiver.target) { + // if the type references are different, assume safe, as we won't know how to compare the two types + // the generic positions might not be equivalent for both types + return false; + } + if (senderNode?.type === utils_1.AST_NODE_TYPES.NewExpression && + senderNode.callee.type === utils_1.AST_NODE_TYPES.Identifier && + senderNode.callee.name === 'Map' && + senderNode.arguments.length === 0 && + senderNode.typeArguments == null) { + // special case to handle `new Map()` + // unfortunately Map's default empty constructor is typed to return `Map` :( + // https://github.com/typescript-eslint/typescript-eslint/issues/2109#issuecomment-634144396 + return false; + } + const typeArguments = type.typeArguments ?? []; + const receiverTypeArguments = receiver.typeArguments ?? []; + for (let i = 0; i < typeArguments.length; i += 1) { + const arg = typeArguments[i]; + const receiverArg = receiverTypeArguments[i]; + const unsafe = isUnsafeAssignmentWorker(arg, receiverArg, checker, senderNode, visited); + if (unsafe) { + return { receiver, sender: type }; + } + } + return false; + } + return false; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts.map new file mode 100644 index 0000000..f553004 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../src/predicates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAMjC;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CASrD;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,OAAO,CAQT;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAExD;AAYD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,aAAa,CAM3E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAQpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,OAAO,CAKT;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,OAAO,CAKT;AAED,oBAAY,OAAO;IACjB,GAAG,IAAA;IACH,UAAU,IAAA;IACV,QAAQ,IAAA;IACR,IAAI,IAAA;CACL;AACD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,MAAM,EAAE,EAAE,CAAC,IAAI,GACd,OAAO,CAyBT;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,UAAU,EAAE,EAAE,CAAC,IAAI,GAClB,OAAO,CAqBT;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,IAAI,IAAI,EAAE,CAAC,iBAAiB,CAE9B;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,IAAI,IAAI,EAAE,CAAC,mBAAmB,CAEhC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/predicates.js b/node_modules/@typescript-eslint/type-utils/dist/predicates.js new file mode 100644 index 0000000..f4e18ba --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/predicates.js @@ -0,0 +1,190 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnyType = void 0; +exports.isNullableType = isNullableType; +exports.isTypeArrayTypeOrUnionOfArrayTypes = isTypeArrayTypeOrUnionOfArrayTypes; +exports.isTypeNeverType = isTypeNeverType; +exports.isTypeUnknownType = isTypeUnknownType; +exports.isTypeReferenceType = isTypeReferenceType; +exports.isTypeAnyType = isTypeAnyType; +exports.isTypeAnyArrayType = isTypeAnyArrayType; +exports.isTypeUnknownArrayType = isTypeUnknownArrayType; +exports.discriminateAnyType = discriminateAnyType; +exports.typeIsOrHasBaseType = typeIsOrHasBaseType; +exports.isTypeBigIntLiteralType = isTypeBigIntLiteralType; +exports.isTypeTemplateLiteralType = isTypeTemplateLiteralType; +const debug_1 = __importDefault(require("debug")); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const typeFlagUtils_1 = require("./typeFlagUtils"); +const log = (0, debug_1.default)('typescript-eslint:type-utils:predicates'); +/** + * Checks if the given type is (or accepts) nullable + */ +function isNullableType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.Null | + ts.TypeFlags.Undefined | + ts.TypeFlags.Void); +} +/** + * Checks if the given type is either an array type, + * or a union made up solely of array types. + */ +function isTypeArrayTypeOrUnionOfArrayTypes(type, checker) { + for (const t of tsutils.unionTypeParts(type)) { + if (!checker.isArrayType(t)) { + return false; + } + } + return true; +} +/** + * @returns true if the type is `never` + */ +function isTypeNeverType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Never); +} +/** + * @returns true if the type is `unknown` + */ +function isTypeUnknownType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Unknown); +} +// https://github.com/microsoft/TypeScript/blob/42aa18bf442c4df147e30deaf27261a41cbdc617/src/compiler/types.ts#L5157 +const Nullable = ts.TypeFlags.Undefined | ts.TypeFlags.Null; +// https://github.com/microsoft/TypeScript/blob/42aa18bf442c4df147e30deaf27261a41cbdc617/src/compiler/types.ts#L5187 +const ObjectFlagsType = ts.TypeFlags.Any | + Nullable | + ts.TypeFlags.Never | + ts.TypeFlags.Object | + ts.TypeFlags.Union | + ts.TypeFlags.Intersection; +function isTypeReferenceType(type) { + if ((type.flags & ObjectFlagsType) === 0) { + return false; + } + const objectTypeFlags = type.objectFlags; + return (objectTypeFlags & ts.ObjectFlags.Reference) !== 0; +} +/** + * @returns true if the type is `any` + */ +function isTypeAnyType(type) { + if ((0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Any)) { + if (type.intrinsicName === 'error') { + log('Found an "error" any type'); + } + return true; + } + return false; +} +/** + * @returns true if the type is `any[]` + */ +function isTypeAnyArrayType(type, checker) { + return (checker.isArrayType(type) && + isTypeAnyType(checker.getTypeArguments(type)[0])); +} +/** + * @returns true if the type is `unknown[]` + */ +function isTypeUnknownArrayType(type, checker) { + return (checker.isArrayType(type) && + isTypeUnknownType(checker.getTypeArguments(type)[0])); +} +var AnyType; +(function (AnyType) { + AnyType[AnyType["Any"] = 0] = "Any"; + AnyType[AnyType["PromiseAny"] = 1] = "PromiseAny"; + AnyType[AnyType["AnyArray"] = 2] = "AnyArray"; + AnyType[AnyType["Safe"] = 3] = "Safe"; +})(AnyType || (exports.AnyType = AnyType = {})); +/** + * @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`, `AnyType.PromiseAny` if the type is `Promise`, + * otherwise it returns `AnyType.Safe`. + */ +function discriminateAnyType(type, checker, program, tsNode) { + if (isTypeAnyType(type)) { + return AnyType.Any; + } + if (isTypeAnyArrayType(type, checker)) { + return AnyType.AnyArray; + } + for (const part of tsutils.typeParts(type)) { + if (tsutils.isThenableType(checker, tsNode, part)) { + const awaitedType = checker.getAwaitedType(part); + if (awaitedType) { + const awaitedAnyType = discriminateAnyType(awaitedType, checker, program, tsNode); + if (awaitedAnyType === AnyType.Any) { + return AnyType.PromiseAny; + } + } + } + } + return AnyType.Safe; +} +/** + * @returns Whether a type is an instance of the parent type, including for the parent's base types. + */ +function typeIsOrHasBaseType(type, parentType) { + const parentSymbol = parentType.getSymbol(); + if (!type.getSymbol() || !parentSymbol) { + return false; + } + const typeAndBaseTypes = [type]; + const ancestorTypes = type.getBaseTypes(); + if (ancestorTypes) { + typeAndBaseTypes.push(...ancestorTypes); + } + for (const baseType of typeAndBaseTypes) { + const baseSymbol = baseType.getSymbol(); + if (baseSymbol && baseSymbol.name === parentSymbol.name) { + return true; + } + } + return false; +} +function isTypeBigIntLiteralType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.BigIntLiteral); +} +function isTypeTemplateLiteralType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.TemplateLiteral); +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.d.ts.map new file mode 100644 index 0000000..214952c --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"propertyTypes.d.ts","sourceRoot":"","sources":["../src/propertyTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,EAAE,CAAC,QAAQ,GACxB,EAAE,CAAC,IAAI,GAAG,SAAS,CAerB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,EAAE,CAAC,MAAM,GAClB,EAAE,CAAC,IAAI,GAAG,SAAS,CAOrB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.js b/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.js new file mode 100644 index 0000000..d2c95a6 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTypeOfPropertyOfName = getTypeOfPropertyOfName; +exports.getTypeOfPropertyOfType = getTypeOfPropertyOfType; +function getTypeOfPropertyOfName(checker, type, name, escapedName) { + // Most names are directly usable in the checker and aren't different from escaped names + if (!escapedName || !isSymbol(escapedName)) { + return checker.getTypeOfPropertyOfType(type, name); + } + // Symbolic names may differ in their escaped name compared to their human-readable name + // https://github.com/typescript-eslint/typescript-eslint/issues/2143 + const escapedProperty = type + .getProperties() + .find(property => property.escapedName === escapedName); + return escapedProperty + ? checker.getDeclaredTypeOfSymbol(escapedProperty) + : undefined; +} +function getTypeOfPropertyOfType(checker, type, property) { + return getTypeOfPropertyOfName(checker, type, property.getName(), property.getEscapedName()); +} +// Symbolic names need to be specially handled because TS api is not sufficient for these cases. +// Source based on: +// https://github.com/microsoft/TypeScript/blob/0043abe982aae0d35f8df59f9715be6ada758ff7/src/compiler/utilities.ts#L3388-L3402 +function isSymbol(escapedName) { + return isKnownSymbol(escapedName) || isPrivateIdentifierSymbol(escapedName); +} +// case for escapedName: "__@foo@10", name: "__@foo@10" +function isKnownSymbol(escapedName) { + return escapedName.startsWith('__@'); +} +// case for escapedName: "__#1@#foo", name: "#foo" +function isPrivateIdentifierSymbol(escapedName) { + return escapedName.startsWith('__#'); +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.d.ts.map new file mode 100644 index 0000000..faa85ea --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"requiresQuoting.d.ts","sourceRoot":"","sources":["../src/requiresQuoting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,8HAA8H;AAC9H,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,EAAE,CAAC,YAAqC,GAC/C,OAAO,CAgBT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.js b/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.js new file mode 100644 index 0000000..1f2b379 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.js @@ -0,0 +1,52 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.requiresQuoting = requiresQuoting; +const ts = __importStar(require("typescript")); +/*** Indicates whether identifiers require the use of quotation marks when accessing property definitions and dot notation. */ +function requiresQuoting(name, target = ts.ScriptTarget.ESNext) { + if (name.length === 0) { + return true; + } + if (!ts.isIdentifierStart(name.charCodeAt(0), target)) { + return true; + } + for (let i = 1; i < name.length; i += 1) { + if (!ts.isIdentifierPart(name.charCodeAt(i), target)) { + return true; + } + } + return false; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.d.ts.map new file mode 100644 index 0000000..44c0c48 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"typeFlagUtils.d.ts","sourceRoot":"","sources":["../src/typeFlagUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,SAAS,CAOxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,YAAY,EAAE,EAAE,CAAC,SAAS;AAC1B,4EAA4E;AAC5E,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAST"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.js b/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.js new file mode 100644 index 0000000..c789f35 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.js @@ -0,0 +1,70 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTypeFlags = getTypeFlags; +exports.isTypeFlagSet = isTypeFlagSet; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const ANY_OR_UNKNOWN = ts.TypeFlags.Any | ts.TypeFlags.Unknown; +/** + * Gets all of the type flags in a type, iterating through unions automatically. + */ +function getTypeFlags(type) { + // @ts-expect-error Since typescript 5.0, this is invalid, but uses 0 as the default value of TypeFlags. + let flags = 0; + for (const t of tsutils.unionTypeParts(type)) { + flags |= t.flags; + } + return flags; +} +/** + * @param flagsToCheck The composition of one or more `ts.TypeFlags`. + * @param isReceiver Whether the type is a receiving type (e.g. the type of a + * called function's parameter). + * @remarks + * Note that if the type is a union, this function will decompose it into the + * parts and get the flags of every union constituent. If this is not desired, + * use the `isTypeFlag` function from tsutils. + */ +function isTypeFlagSet(type, flagsToCheck, +/** @deprecated This params is not used and will be removed in the future.*/ +isReceiver) { + const flags = getTypeFlags(type); + // eslint-disable-next-line @typescript-eslint/no-deprecated -- not used + if (isReceiver && flags & ANY_OR_UNKNOWN) { + return true; + } + return (flags & flagsToCheck) !== 0; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.d.ts.map new file mode 100644 index 0000000..271cfb7 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"specifierNameMatches.d.ts","sourceRoot":"","sources":["../../src/typeOrValueSpecifiers/specifierNameMatches.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GACvB,OAAO,CAeT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.js b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.js new file mode 100644 index 0000000..ac91b76 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.specifierNameMatches = specifierNameMatches; +function specifierNameMatches(type, names) { + if (typeof names === 'string') { + names = [names]; + } + const symbol = type.aliasSymbol ?? type.getSymbol(); + const candidateNames = symbol + ? [symbol.escapedName, type.intrinsicName] + : [type.intrinsicName]; + if (names.some(item => candidateNames.includes(item))) { + return true; + } + return false; +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.d.ts.map new file mode 100644 index 0000000..3e278d8 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"typeDeclaredInFile.d.ts","sourceRoot":"","sources":["../../src/typeOrValueSpecifiers/typeDeclaredInFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAKtC,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,gBAAgB,EAAE,EAAE,CAAC,UAAU,EAAE,EACjC,OAAO,EAAE,EAAE,CAAC,OAAO,GAClB,OAAO,CAaT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.js b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.js new file mode 100644 index 0000000..9530649 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.js @@ -0,0 +1,16 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeDeclaredInFile = typeDeclaredInFile; +const typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +const node_path_1 = __importDefault(require("node:path")); +function typeDeclaredInFile(relativePath, declarationFiles, program) { + if (relativePath == null) { + const cwd = (0, typescript_estree_1.getCanonicalFileName)(program.getCurrentDirectory()); + return declarationFiles.some(declaration => (0, typescript_estree_1.getCanonicalFileName)(declaration.fileName).startsWith(cwd)); + } + const absolutePath = (0, typescript_estree_1.getCanonicalFileName)(node_path_1.default.join(program.getCurrentDirectory(), relativePath)); + return declarationFiles.some(declaration => (0, typescript_estree_1.getCanonicalFileName)(declaration.fileName) === absolutePath); +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.d.ts.map new file mode 100644 index 0000000..09f2826 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"typeDeclaredInLib.d.ts","sourceRoot":"","sources":["../../src/typeOrValueSpecifiers/typeDeclaredInLib.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,EAAE,CAAC,UAAU,EAAE,EACjC,OAAO,EAAE,EAAE,CAAC,OAAO,GAClB,OAAO,CAUT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.js b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.js new file mode 100644 index 0000000..e25031a --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeDeclaredInLib = typeDeclaredInLib; +function typeDeclaredInLib(declarationFiles, program) { + // Assertion: The type is not an error type. + // Intrinsic type (i.e. string, number, boolean, etc) - Treat it as if it's from lib. + if (declarationFiles.length === 0) { + return true; + } + return declarationFiles.some(declaration => program.isSourceFileDefaultLibrary(declaration)); +} diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.d.ts.map b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.d.ts.map new file mode 100644 index 0000000..1e797bd --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"typeDeclaredInPackageDeclarationFile.d.ts","sourceRoot":"","sources":["../../src/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AA8CjC,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,EAAE,CAAC,IAAI,EAAE,EACvB,gBAAgB,EAAE,EAAE,CAAC,UAAU,EAAE,EACjC,OAAO,EAAE,EAAE,CAAC,OAAO,GAClB,OAAO,CAKT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.js b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.js new file mode 100644 index 0000000..b4feebf --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.js @@ -0,0 +1,67 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeDeclaredInPackageDeclarationFile = typeDeclaredInPackageDeclarationFile; +const ts = __importStar(require("typescript")); +function findParentModuleDeclaration(node) { + switch (node.kind) { + case ts.SyntaxKind.ModuleDeclaration: + return ts.isStringLiteral(node.name) + ? node + : undefined; + case ts.SyntaxKind.SourceFile: + return undefined; + default: + return findParentModuleDeclaration(node.parent); + } +} +function typeDeclaredInDeclareModule(packageName, declarations) { + return declarations.some(declaration => findParentModuleDeclaration(declaration)?.name.text === packageName); +} +function typeDeclaredInDeclarationFile(packageName, declarationFiles, program) { + // Handle scoped packages: if the name starts with @, remove it and replace / with __ + const typesPackageName = packageName.replace(/^@([^/]+)\//, '$1__'); + const matcher = new RegExp(`${packageName}|${typesPackageName}`); + return declarationFiles.some(declaration => { + const packageIdName = program.sourceFileToPackageName.get(declaration.path); + return (packageIdName != null && + matcher.test(packageIdName) && + program.isSourceFileFromExternalLibrary(declaration)); + }); +} +function typeDeclaredInPackageDeclarationFile(packageName, declarations, declarationFiles, program) { + return (typeDeclaredInDeclareModule(packageName, declarations) || + typeDeclaredInDeclarationFile(packageName, declarationFiles, program)); +} diff --git a/node_modules/@typescript-eslint/type-utils/package.json b/node_modules/@typescript-eslint/type-utils/package.json new file mode 100644 index 0000000..d0f9704 --- /dev/null +++ b/node_modules/@typescript-eslint/type-utils/package.json @@ -0,0 +1,80 @@ +{ + "name": "@typescript-eslint/type-utils", + "version": "8.26.0", + "description": "Type utilities for working with TypeScript + ESLint together", + "files": [ + "dist", + "!*.tsbuildinfo", + "_ts4.3", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/type-utils" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "lint": "npx nx lint", + "test": "jest", + "check-types": "npx nx typecheck" + }, + "dependencies": { + "@typescript-eslint/typescript-estree": "8.26.0", + "@typescript-eslint/utils": "8.26.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + }, + "devDependencies": { + "@jest/types": "29.6.3", + "@typescript-eslint/parser": "8.26.0", + "ajv": "^6.12.6", + "downlevel-dts": "*", + "jest": "29.7.0", + "prettier": "^3.2.5", + "rimraf": "*", + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/node_modules/@typescript-eslint/types/LICENSE b/node_modules/@typescript-eslint/types/LICENSE new file mode 100644 index 0000000..a116410 --- /dev/null +++ b/node_modules/@typescript-eslint/types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/types/README.md b/node_modules/@typescript-eslint/types/README.md new file mode 100644 index 0000000..7a3008b --- /dev/null +++ b/node_modules/@typescript-eslint/types/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/types` + +> Types for the TypeScript-ESTree AST spec + +This package exists to help us reduce cycles and provide lighter-weight packages at runtime. + +## ✋ Internal Package + +This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). +You likely don't want to use it directly. + +👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map b/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map new file mode 100644 index 0000000..dc2916f --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast-spec.d.ts","sourceRoot":"","sources":["../../src/generated/ast-spec.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js b/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js new file mode 100644 index 0000000..1c2808e --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js @@ -0,0 +1,199 @@ +"use strict"; +/********************************************** + * DO NOT MODIFY THIS FILE MANUALLY * + * * + * THIS FILE HAS BEEN COPIED FROM ast-spec. * + * ANY CHANGES WILL BE LOST ON THE NEXT BUILD * + * * + * MAKE CHANGES TO ast-spec AND THEN RUN * + * yarn build * + **********************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +var AST_NODE_TYPES; +(function (AST_NODE_TYPES) { + AST_NODE_TYPES["AccessorProperty"] = "AccessorProperty"; + AST_NODE_TYPES["ArrayExpression"] = "ArrayExpression"; + AST_NODE_TYPES["ArrayPattern"] = "ArrayPattern"; + AST_NODE_TYPES["ArrowFunctionExpression"] = "ArrowFunctionExpression"; + AST_NODE_TYPES["AssignmentExpression"] = "AssignmentExpression"; + AST_NODE_TYPES["AssignmentPattern"] = "AssignmentPattern"; + AST_NODE_TYPES["AwaitExpression"] = "AwaitExpression"; + AST_NODE_TYPES["BinaryExpression"] = "BinaryExpression"; + AST_NODE_TYPES["BlockStatement"] = "BlockStatement"; + AST_NODE_TYPES["BreakStatement"] = "BreakStatement"; + AST_NODE_TYPES["CallExpression"] = "CallExpression"; + AST_NODE_TYPES["CatchClause"] = "CatchClause"; + AST_NODE_TYPES["ChainExpression"] = "ChainExpression"; + AST_NODE_TYPES["ClassBody"] = "ClassBody"; + AST_NODE_TYPES["ClassDeclaration"] = "ClassDeclaration"; + AST_NODE_TYPES["ClassExpression"] = "ClassExpression"; + AST_NODE_TYPES["ConditionalExpression"] = "ConditionalExpression"; + AST_NODE_TYPES["ContinueStatement"] = "ContinueStatement"; + AST_NODE_TYPES["DebuggerStatement"] = "DebuggerStatement"; + AST_NODE_TYPES["Decorator"] = "Decorator"; + AST_NODE_TYPES["DoWhileStatement"] = "DoWhileStatement"; + AST_NODE_TYPES["EmptyStatement"] = "EmptyStatement"; + AST_NODE_TYPES["ExportAllDeclaration"] = "ExportAllDeclaration"; + AST_NODE_TYPES["ExportDefaultDeclaration"] = "ExportDefaultDeclaration"; + AST_NODE_TYPES["ExportNamedDeclaration"] = "ExportNamedDeclaration"; + AST_NODE_TYPES["ExportSpecifier"] = "ExportSpecifier"; + AST_NODE_TYPES["ExpressionStatement"] = "ExpressionStatement"; + AST_NODE_TYPES["ForInStatement"] = "ForInStatement"; + AST_NODE_TYPES["ForOfStatement"] = "ForOfStatement"; + AST_NODE_TYPES["ForStatement"] = "ForStatement"; + AST_NODE_TYPES["FunctionDeclaration"] = "FunctionDeclaration"; + AST_NODE_TYPES["FunctionExpression"] = "FunctionExpression"; + AST_NODE_TYPES["Identifier"] = "Identifier"; + AST_NODE_TYPES["IfStatement"] = "IfStatement"; + AST_NODE_TYPES["ImportAttribute"] = "ImportAttribute"; + AST_NODE_TYPES["ImportDeclaration"] = "ImportDeclaration"; + AST_NODE_TYPES["ImportDefaultSpecifier"] = "ImportDefaultSpecifier"; + AST_NODE_TYPES["ImportExpression"] = "ImportExpression"; + AST_NODE_TYPES["ImportNamespaceSpecifier"] = "ImportNamespaceSpecifier"; + AST_NODE_TYPES["ImportSpecifier"] = "ImportSpecifier"; + AST_NODE_TYPES["JSXAttribute"] = "JSXAttribute"; + AST_NODE_TYPES["JSXClosingElement"] = "JSXClosingElement"; + AST_NODE_TYPES["JSXClosingFragment"] = "JSXClosingFragment"; + AST_NODE_TYPES["JSXElement"] = "JSXElement"; + AST_NODE_TYPES["JSXEmptyExpression"] = "JSXEmptyExpression"; + AST_NODE_TYPES["JSXExpressionContainer"] = "JSXExpressionContainer"; + AST_NODE_TYPES["JSXFragment"] = "JSXFragment"; + AST_NODE_TYPES["JSXIdentifier"] = "JSXIdentifier"; + AST_NODE_TYPES["JSXMemberExpression"] = "JSXMemberExpression"; + AST_NODE_TYPES["JSXNamespacedName"] = "JSXNamespacedName"; + AST_NODE_TYPES["JSXOpeningElement"] = "JSXOpeningElement"; + AST_NODE_TYPES["JSXOpeningFragment"] = "JSXOpeningFragment"; + AST_NODE_TYPES["JSXSpreadAttribute"] = "JSXSpreadAttribute"; + AST_NODE_TYPES["JSXSpreadChild"] = "JSXSpreadChild"; + AST_NODE_TYPES["JSXText"] = "JSXText"; + AST_NODE_TYPES["LabeledStatement"] = "LabeledStatement"; + AST_NODE_TYPES["Literal"] = "Literal"; + AST_NODE_TYPES["LogicalExpression"] = "LogicalExpression"; + AST_NODE_TYPES["MemberExpression"] = "MemberExpression"; + AST_NODE_TYPES["MetaProperty"] = "MetaProperty"; + AST_NODE_TYPES["MethodDefinition"] = "MethodDefinition"; + AST_NODE_TYPES["NewExpression"] = "NewExpression"; + AST_NODE_TYPES["ObjectExpression"] = "ObjectExpression"; + AST_NODE_TYPES["ObjectPattern"] = "ObjectPattern"; + AST_NODE_TYPES["PrivateIdentifier"] = "PrivateIdentifier"; + AST_NODE_TYPES["Program"] = "Program"; + AST_NODE_TYPES["Property"] = "Property"; + AST_NODE_TYPES["PropertyDefinition"] = "PropertyDefinition"; + AST_NODE_TYPES["RestElement"] = "RestElement"; + AST_NODE_TYPES["ReturnStatement"] = "ReturnStatement"; + AST_NODE_TYPES["SequenceExpression"] = "SequenceExpression"; + AST_NODE_TYPES["SpreadElement"] = "SpreadElement"; + AST_NODE_TYPES["StaticBlock"] = "StaticBlock"; + AST_NODE_TYPES["Super"] = "Super"; + AST_NODE_TYPES["SwitchCase"] = "SwitchCase"; + AST_NODE_TYPES["SwitchStatement"] = "SwitchStatement"; + AST_NODE_TYPES["TaggedTemplateExpression"] = "TaggedTemplateExpression"; + AST_NODE_TYPES["TemplateElement"] = "TemplateElement"; + AST_NODE_TYPES["TemplateLiteral"] = "TemplateLiteral"; + AST_NODE_TYPES["ThisExpression"] = "ThisExpression"; + AST_NODE_TYPES["ThrowStatement"] = "ThrowStatement"; + AST_NODE_TYPES["TryStatement"] = "TryStatement"; + AST_NODE_TYPES["UnaryExpression"] = "UnaryExpression"; + AST_NODE_TYPES["UpdateExpression"] = "UpdateExpression"; + AST_NODE_TYPES["VariableDeclaration"] = "VariableDeclaration"; + AST_NODE_TYPES["VariableDeclarator"] = "VariableDeclarator"; + AST_NODE_TYPES["WhileStatement"] = "WhileStatement"; + AST_NODE_TYPES["WithStatement"] = "WithStatement"; + AST_NODE_TYPES["YieldExpression"] = "YieldExpression"; + AST_NODE_TYPES["TSAbstractAccessorProperty"] = "TSAbstractAccessorProperty"; + AST_NODE_TYPES["TSAbstractKeyword"] = "TSAbstractKeyword"; + AST_NODE_TYPES["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition"; + AST_NODE_TYPES["TSAbstractPropertyDefinition"] = "TSAbstractPropertyDefinition"; + AST_NODE_TYPES["TSAnyKeyword"] = "TSAnyKeyword"; + AST_NODE_TYPES["TSArrayType"] = "TSArrayType"; + AST_NODE_TYPES["TSAsExpression"] = "TSAsExpression"; + AST_NODE_TYPES["TSAsyncKeyword"] = "TSAsyncKeyword"; + AST_NODE_TYPES["TSBigIntKeyword"] = "TSBigIntKeyword"; + AST_NODE_TYPES["TSBooleanKeyword"] = "TSBooleanKeyword"; + AST_NODE_TYPES["TSCallSignatureDeclaration"] = "TSCallSignatureDeclaration"; + AST_NODE_TYPES["TSClassImplements"] = "TSClassImplements"; + AST_NODE_TYPES["TSConditionalType"] = "TSConditionalType"; + AST_NODE_TYPES["TSConstructorType"] = "TSConstructorType"; + AST_NODE_TYPES["TSConstructSignatureDeclaration"] = "TSConstructSignatureDeclaration"; + AST_NODE_TYPES["TSDeclareFunction"] = "TSDeclareFunction"; + AST_NODE_TYPES["TSDeclareKeyword"] = "TSDeclareKeyword"; + AST_NODE_TYPES["TSEmptyBodyFunctionExpression"] = "TSEmptyBodyFunctionExpression"; + AST_NODE_TYPES["TSEnumBody"] = "TSEnumBody"; + AST_NODE_TYPES["TSEnumDeclaration"] = "TSEnumDeclaration"; + AST_NODE_TYPES["TSEnumMember"] = "TSEnumMember"; + AST_NODE_TYPES["TSExportAssignment"] = "TSExportAssignment"; + AST_NODE_TYPES["TSExportKeyword"] = "TSExportKeyword"; + AST_NODE_TYPES["TSExternalModuleReference"] = "TSExternalModuleReference"; + AST_NODE_TYPES["TSFunctionType"] = "TSFunctionType"; + AST_NODE_TYPES["TSImportEqualsDeclaration"] = "TSImportEqualsDeclaration"; + AST_NODE_TYPES["TSImportType"] = "TSImportType"; + AST_NODE_TYPES["TSIndexedAccessType"] = "TSIndexedAccessType"; + AST_NODE_TYPES["TSIndexSignature"] = "TSIndexSignature"; + AST_NODE_TYPES["TSInferType"] = "TSInferType"; + AST_NODE_TYPES["TSInstantiationExpression"] = "TSInstantiationExpression"; + AST_NODE_TYPES["TSInterfaceBody"] = "TSInterfaceBody"; + AST_NODE_TYPES["TSInterfaceDeclaration"] = "TSInterfaceDeclaration"; + AST_NODE_TYPES["TSInterfaceHeritage"] = "TSInterfaceHeritage"; + AST_NODE_TYPES["TSIntersectionType"] = "TSIntersectionType"; + AST_NODE_TYPES["TSIntrinsicKeyword"] = "TSIntrinsicKeyword"; + AST_NODE_TYPES["TSLiteralType"] = "TSLiteralType"; + AST_NODE_TYPES["TSMappedType"] = "TSMappedType"; + AST_NODE_TYPES["TSMethodSignature"] = "TSMethodSignature"; + AST_NODE_TYPES["TSModuleBlock"] = "TSModuleBlock"; + AST_NODE_TYPES["TSModuleDeclaration"] = "TSModuleDeclaration"; + AST_NODE_TYPES["TSNamedTupleMember"] = "TSNamedTupleMember"; + AST_NODE_TYPES["TSNamespaceExportDeclaration"] = "TSNamespaceExportDeclaration"; + AST_NODE_TYPES["TSNeverKeyword"] = "TSNeverKeyword"; + AST_NODE_TYPES["TSNonNullExpression"] = "TSNonNullExpression"; + AST_NODE_TYPES["TSNullKeyword"] = "TSNullKeyword"; + AST_NODE_TYPES["TSNumberKeyword"] = "TSNumberKeyword"; + AST_NODE_TYPES["TSObjectKeyword"] = "TSObjectKeyword"; + AST_NODE_TYPES["TSOptionalType"] = "TSOptionalType"; + AST_NODE_TYPES["TSParameterProperty"] = "TSParameterProperty"; + AST_NODE_TYPES["TSPrivateKeyword"] = "TSPrivateKeyword"; + AST_NODE_TYPES["TSPropertySignature"] = "TSPropertySignature"; + AST_NODE_TYPES["TSProtectedKeyword"] = "TSProtectedKeyword"; + AST_NODE_TYPES["TSPublicKeyword"] = "TSPublicKeyword"; + AST_NODE_TYPES["TSQualifiedName"] = "TSQualifiedName"; + AST_NODE_TYPES["TSReadonlyKeyword"] = "TSReadonlyKeyword"; + AST_NODE_TYPES["TSRestType"] = "TSRestType"; + AST_NODE_TYPES["TSSatisfiesExpression"] = "TSSatisfiesExpression"; + AST_NODE_TYPES["TSStaticKeyword"] = "TSStaticKeyword"; + AST_NODE_TYPES["TSStringKeyword"] = "TSStringKeyword"; + AST_NODE_TYPES["TSSymbolKeyword"] = "TSSymbolKeyword"; + AST_NODE_TYPES["TSTemplateLiteralType"] = "TSTemplateLiteralType"; + AST_NODE_TYPES["TSThisType"] = "TSThisType"; + AST_NODE_TYPES["TSTupleType"] = "TSTupleType"; + AST_NODE_TYPES["TSTypeAliasDeclaration"] = "TSTypeAliasDeclaration"; + AST_NODE_TYPES["TSTypeAnnotation"] = "TSTypeAnnotation"; + AST_NODE_TYPES["TSTypeAssertion"] = "TSTypeAssertion"; + AST_NODE_TYPES["TSTypeLiteral"] = "TSTypeLiteral"; + AST_NODE_TYPES["TSTypeOperator"] = "TSTypeOperator"; + AST_NODE_TYPES["TSTypeParameter"] = "TSTypeParameter"; + AST_NODE_TYPES["TSTypeParameterDeclaration"] = "TSTypeParameterDeclaration"; + AST_NODE_TYPES["TSTypeParameterInstantiation"] = "TSTypeParameterInstantiation"; + AST_NODE_TYPES["TSTypePredicate"] = "TSTypePredicate"; + AST_NODE_TYPES["TSTypeQuery"] = "TSTypeQuery"; + AST_NODE_TYPES["TSTypeReference"] = "TSTypeReference"; + AST_NODE_TYPES["TSUndefinedKeyword"] = "TSUndefinedKeyword"; + AST_NODE_TYPES["TSUnionType"] = "TSUnionType"; + AST_NODE_TYPES["TSUnknownKeyword"] = "TSUnknownKeyword"; + AST_NODE_TYPES["TSVoidKeyword"] = "TSVoidKeyword"; +})(AST_NODE_TYPES || (exports.AST_NODE_TYPES = AST_NODE_TYPES = {})); +var AST_TOKEN_TYPES; +(function (AST_TOKEN_TYPES) { + AST_TOKEN_TYPES["Boolean"] = "Boolean"; + AST_TOKEN_TYPES["Identifier"] = "Identifier"; + AST_TOKEN_TYPES["JSXIdentifier"] = "JSXIdentifier"; + AST_TOKEN_TYPES["JSXText"] = "JSXText"; + AST_TOKEN_TYPES["Keyword"] = "Keyword"; + AST_TOKEN_TYPES["Null"] = "Null"; + AST_TOKEN_TYPES["Numeric"] = "Numeric"; + AST_TOKEN_TYPES["Punctuator"] = "Punctuator"; + AST_TOKEN_TYPES["RegularExpression"] = "RegularExpression"; + AST_TOKEN_TYPES["String"] = "String"; + AST_TOKEN_TYPES["Template"] = "Template"; + AST_TOKEN_TYPES["Block"] = "Block"; + AST_TOKEN_TYPES["Line"] = "Line"; +})(AST_TOKEN_TYPES || (exports.AST_TOKEN_TYPES = AST_TOKEN_TYPES = {})); diff --git a/node_modules/@typescript-eslint/types/dist/index.d.ts.map b/node_modules/@typescript-eslint/types/dist/index.d.ts.map new file mode 100644 index 0000000..6a86c53 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvE,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/index.js b/node_modules/@typescript-eslint/types/dist/index.js new file mode 100644 index 0000000..837a232 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/index.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +var ast_spec_1 = require("./generated/ast-spec"); +Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return ast_spec_1.AST_NODE_TYPES; } }); +Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return ast_spec_1.AST_TOKEN_TYPES; } }); +__exportStar(require("./lib"), exports); +__exportStar(require("./parser-options"), exports); +__exportStar(require("./ts-estree"), exports); diff --git a/node_modules/@typescript-eslint/types/dist/lib.d.ts.map b/node_modules/@typescript-eslint/types/dist/lib.d.ts.map new file mode 100644 index 0000000..4f09ac4 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/lib.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,GAAG,GACX,YAAY,GACZ,mBAAmB,GACnB,KAAK,GACL,mBAAmB,GACnB,cAAc,GACd,KAAK,GACL,KAAK,GACL,KAAK,GACL,QAAQ,GACR,mBAAmB,GACnB,aAAa,GACb,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,yBAAyB,GACzB,QAAQ,GACR,sBAAsB,GACtB,aAAa,GACb,aAAa,GACb,QAAQ,GACR,oBAAoB,GACpB,aAAa,GACb,aAAa,GACb,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,eAAe,GACf,oBAAoB,GACpB,QAAQ,GACR,uBAAuB,GACvB,sBAAsB,GACtB,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,QAAQ,GACR,cAAc,GACd,aAAa,GACb,aAAa,GACb,eAAe,GACf,eAAe,GACf,eAAe,GACf,QAAQ,GACR,eAAe,GACf,aAAa,GACb,aAAa,GACb,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,qBAAqB,GACrB,eAAe,GACf,yBAAyB,GACzB,QAAQ,GACR,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,QAAQ,GACR,cAAc,GACd,cAAc,GACd,aAAa,GACb,aAAa,GACb,eAAe,GACf,eAAe,GACf,eAAe,GACf,QAAQ,GACR,cAAc,GACd,mBAAmB,GACnB,aAAa,GACb,aAAa,GACb,QAAQ,GACR,oBAAoB,GACpB,mBAAmB,GACnB,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,qBAAqB,GACrB,eAAe,GACf,QAAQ,GACR,cAAc,GACd,sBAAsB,GACtB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,KAAK,GACL,YAAY,GACZ,WAAW,GACX,yBAAyB,GACzB,yBAAyB,GACzB,oBAAoB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/lib.js b/node_modules/@typescript-eslint/types/dist/lib.js new file mode 100644 index 0000000..fa29352 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/lib.js @@ -0,0 +1,6 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map b/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map new file mode 100644 index 0000000..b049b68 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser-options.d.ts","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,CAAC,QAAQ,GAAG,YAAY,GAAG,mBAAmB,CAAC,EAAE,CAAC;AACtD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEvD,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,SAAS,CAAC;AAEd,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,WAAW,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;OAMG;IACH,+DAA+D,CAAC,EAAE,MAAM,CAAC;CAC1E;AAGD,MAAM,WAAW,aAAa;IAC5B,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC;IACxC,aAAa,CAAC,EAAE;QACd,IAAI,CAAC,EAAE,oBAAoB,CAAC;KAC7B,CAAC;IAGF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EACT;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACnC,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC3B,GACD,SAAS,CAAC;IACd,WAAW,CAAC,EAAE,WAAW,CAAC;IAG1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,2CAA2C,CAAC,EAAE,OAAO,CAAC;IAEtD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7C,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAAC;IACjD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/parser-options.js b/node_modules/@typescript-eslint/types/dist/parser-options.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/parser-options.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map b/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map new file mode 100644 index 0000000..2f9f374 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-estree.d.ts","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ts-estree.js b/node_modules/@typescript-eslint/types/dist/ts-estree.js new file mode 100644 index 0000000..004be3c --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ts-estree.js @@ -0,0 +1,37 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSESTree = void 0; +exports.TSESTree = __importStar(require("./generated/ast-spec")); diff --git a/node_modules/@typescript-eslint/types/package.json b/node_modules/@typescript-eslint/types/package.json new file mode 100644 index 0000000..d529e2e --- /dev/null +++ b/node_modules/@typescript-eslint/types/package.json @@ -0,0 +1,88 @@ +{ + "name": "@typescript-eslint/types", + "version": "8.26.0", + "description": "Types for the TypeScript-ESTree AST spec", + "files": [ + "dist", + "!*.tsbuildinfo", + "_ts4.3", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "types": "./dist/index.d.ts", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/types" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "scripts": { + "copy-ast-spec": "tsx ./tools/copy-ast-spec.mts", + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf src/generated && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "generate-lib": "npx nx run scope-manager:generate-lib", + "lint": "npx nx lint", + "check-types": "npx nx typecheck" + }, + "nx": { + "targets": { + "copy-ast-spec": { + "dependsOn": [ + "^build" + ], + "outputs": [ + "{projectRoot}/src/generated" + ], + "cache": true + }, + "build": { + "dependsOn": [ + "^build", + "copy-ast-spec" + ] + } + } + }, + "devDependencies": { + "downlevel-dts": "*", + "prettier": "^3.2.5", + "rimraf": "*", + "tsx": "*", + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/node_modules/@typescript-eslint/typescript-estree/LICENSE b/node_modules/@typescript-eslint/typescript-estree/LICENSE new file mode 100644 index 0000000..a116410 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/typescript-estree/README.md b/node_modules/@typescript-eslint/typescript-estree/README.md new file mode 100644 index 0000000..c98838d --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/README.md @@ -0,0 +1,14 @@ +# `@typescript-eslint/typescript-estree` + +> A parser that produces an ESTree-compatible AST for TypeScript code. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/typescript-estree.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/typescript-estree.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) + +## Contributing + +👉 See **https://typescript-eslint.io/packages/typescript-estree** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map new file mode 100644 index 0000000..8da91fd --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast-converter.d.ts","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAO5C,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,EACf,aAAa,EAAE,aAAa,EAC5B,sBAAsB,EAAE,OAAO,GAC9B;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAA;CAAE,CA4DhD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js new file mode 100644 index 0000000..4e65f88 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.astConverter = astConverter; +const convert_1 = require("./convert"); +const convert_comments_1 = require("./convert-comments"); +const node_utils_1 = require("./node-utils"); +const simple_traverse_1 = require("./simple-traverse"); +function astConverter(ast, parseSettings, shouldPreserveNodeMaps) { + /** + * The TypeScript compiler produced fundamental parse errors when parsing the + * source. + */ + const { parseDiagnostics } = ast; + if (parseDiagnostics.length) { + throw (0, convert_1.convertError)(parseDiagnostics[0]); + } + /** + * Recursively convert the TypeScript AST into an ESTree-compatible AST + */ + const instance = new convert_1.Converter(ast, { + allowInvalidAST: parseSettings.allowInvalidAST, + errorOnUnknownASTType: parseSettings.errorOnUnknownASTType, + shouldPreserveNodeMaps, + suppressDeprecatedPropertyWarnings: parseSettings.suppressDeprecatedPropertyWarnings, + }); + const estree = instance.convertProgram(); + /** + * Optionally remove range and loc if specified + */ + if (!parseSettings.range || !parseSettings.loc) { + (0, simple_traverse_1.simpleTraverse)(estree, { + enter: node => { + if (!parseSettings.range) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional + // @ts-expect-error + delete node.range; + } + if (!parseSettings.loc) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional + // @ts-expect-error + delete node.loc; + } + }, + }); + } + /** + * Optionally convert and include all tokens in the AST + */ + if (parseSettings.tokens) { + estree.tokens = (0, node_utils_1.convertTokens)(ast); + } + /** + * Optionally convert and include all comments in the AST + */ + if (parseSettings.comment) { + estree.comments = (0, convert_comments_1.convertComments)(ast, parseSettings.codeFullText); + } + const astMaps = instance.getASTMaps(); + return { astMaps, estree }; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.d.ts.map new file mode 100644 index 0000000..eeec191 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clear-caches.d.ts","sourceRoot":"","sources":["../src/clear-caches.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAOlC;AAGD,eAAO,MAAM,iBAAiB,oBAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js b/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js new file mode 100644 index 0000000..f86643b --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearProgramCache = void 0; +exports.clearCaches = clearCaches; +const getWatchProgramsForProjects_1 = require("./create-program/getWatchProgramsForProjects"); +const parser_1 = require("./parser"); +const createParseSettings_1 = require("./parseSettings/createParseSettings"); +const resolveProjectList_1 = require("./parseSettings/resolveProjectList"); +/** + * Clears all of the internal caches. + * Generally you shouldn't need or want to use this. + * Examples of intended uses: + * - In tests to reset parser state to keep tests isolated. + * - In custom lint tooling that iteratively lints one project at a time to prevent OOMs. + */ +function clearCaches() { + (0, parser_1.clearDefaultProjectMatchedFiles)(); + (0, parser_1.clearProgramCache)(); + (0, getWatchProgramsForProjects_1.clearWatchCaches)(); + (0, createParseSettings_1.clearTSConfigMatchCache)(); + (0, createParseSettings_1.clearTSServerProjectService)(); + (0, resolveProjectList_1.clearGlobCache)(); +} +// TODO - delete this in next major +exports.clearProgramCache = clearCaches; diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts.map new file mode 100644 index 0000000..4ac2287 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convert-comments.d.ts","sourceRoot":"","sources":["../src/convert-comments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,EAAE,CAAC,UAAU,EAClB,IAAI,EAAE,MAAM,GACX,QAAQ,CAAC,OAAO,EAAE,CAgCpB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js new file mode 100644 index 0000000..b277f01 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js @@ -0,0 +1,71 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertComments = convertComments; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const node_utils_1 = require("./node-utils"); +const ts_estree_1 = require("./ts-estree"); +/** + * Convert all comments for the given AST. + * @param ast the AST object + * @param code the TypeScript code + * @returns the converted ESTreeComment + * @private + */ +function convertComments(ast, code) { + const comments = []; + tsutils.forEachComment(ast, (_, comment) => { + const type = comment.kind === ts.SyntaxKind.SingleLineCommentTrivia + ? ts_estree_1.AST_TOKEN_TYPES.Line + : ts_estree_1.AST_TOKEN_TYPES.Block; + const range = [comment.pos, comment.end]; + const loc = (0, node_utils_1.getLocFor)(range, ast); + // both comments start with 2 characters - /* or // + const textStart = range[0] + 2; + const textEnd = comment.kind === ts.SyntaxKind.SingleLineCommentTrivia + ? // single line comments end at the end + range[1] - textStart + : // multiline comments end 2 characters early + range[1] - textStart - 2; + comments.push({ + type, + loc, + range, + value: code.slice(textStart, textStart + textEnd), + }); + }, ast); + return comments; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map new file mode 100644 index 0000000..10969b3 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EACV,aAAa,EACb,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,EAAE,MAAM,aAAa,CAAC;AAmCtE,MAAM,WAAW,gBAAgB;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,wBAAwB,GAAG,EAAE,CAAC,sBAAsB,GAC1D,OAAO,CAMT;AAED,MAAM,WAAW,OAAO;IACtB,qBAAqB,EAAE,2BAA2B,CAAC;IACnD,qBAAqB,EAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED,qBAAa,SAAS;;IACpB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiB;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiB;IAEvD;;;;;OAKG;gBACS,GAAG,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAsZ1D,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,oCAAoC;IAe5C;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAiC9B,OAAO,CAAC,sBAAsB;IA4C9B;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAsB7B;;;;;OAKG;IACH,OAAO,CAAC,gDAAgD;IAexD;;;;OAIG;IACH,OAAO,CAAC,kDAAkD;IAmB1D;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAgBzB;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IA8BjB,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,+BAA+B;IAgDvC;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,sBAAsB;IAoC9B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAwhFnB,OAAO,CAAC,UAAU;IAclB,cAAc,IAAI,QAAQ,CAAC,OAAO;IAIlC;;;;OAIG;IACH,OAAO,CAAC,UAAU;IA0FlB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAgFlB,UAAU,IAAI,OAAO;IAOrB;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAYhC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert.js b/node_modules/@typescript-eslint/typescript-estree/dist/convert.js new file mode 100644 index 0000000..5a876ed --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert.js @@ -0,0 +1,2722 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Converter = void 0; +exports.convertError = convertError; +// There's lots of funny stuff due to the typing of ts.Node +/* eslint-disable @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */ +const ts = __importStar(require("typescript")); +const getModifiers_1 = require("./getModifiers"); +const node_utils_1 = require("./node-utils"); +const ts_estree_1 = require("./ts-estree"); +const SyntaxKind = ts.SyntaxKind; +/** + * Extends and formats a given error object + * @param error the error object + * @returns converted error object + */ +function convertError(error) { + return (0, node_utils_1.createError)(('message' in error && error.message) || error.messageText, error.file, error.start); +} +class Converter { + allowPattern = false; + ast; + esTreeNodeToTSNodeMap = new WeakMap(); + options; + tsNodeToESTreeNodeMap = new WeakMap(); + /** + * Converts a TypeScript node into an ESTree node + * @param ast the full TypeScript AST + * @param options additional options for the conversion + * @returns the converted ESTreeNode + */ + constructor(ast, options) { + this.ast = ast; + this.options = { ...options }; + } + #checkForStatementDeclaration(initializer, kind) { + const loop = kind === ts.SyntaxKind.ForInStatement ? 'for...in' : 'for...of'; + if (ts.isVariableDeclarationList(initializer)) { + if (initializer.declarations.length !== 1) { + this.#throwError(initializer, `Only a single variable declaration is allowed in a '${loop}' statement.`); + } + const declaration = initializer.declarations[0]; + if (declaration.initializer) { + this.#throwError(declaration, `The variable declaration of a '${loop}' statement cannot have an initializer.`); + } + else if (declaration.type) { + this.#throwError(declaration, `The variable declaration of a '${loop}' statement cannot have a type annotation.`); + } + if (kind === ts.SyntaxKind.ForInStatement && + initializer.flags & ts.NodeFlags.Using) { + this.#throwError(initializer, "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."); + } + } + else if (!(0, node_utils_1.isValidAssignmentTarget)(initializer) && + initializer.kind !== ts.SyntaxKind.ObjectLiteralExpression && + initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) { + this.#throwError(initializer, `The left-hand side of a '${loop}' statement must be a variable or a property access.`); + } + } + #checkModifiers(node) { + if (this.options.allowInvalidAST) { + return; + } + // typescript<5.0.0 + if ((0, node_utils_1.nodeHasIllegalDecorators)(node)) { + this.#throwError(node.illegalDecorators[0], 'Decorators are not valid here.'); + } + for (const decorator of (0, getModifiers_1.getDecorators)(node, + /* includeIllegalDecorators */ true) ?? []) { + // `checkGrammarModifiers` function in typescript + if (!(0, node_utils_1.nodeCanBeDecorated)(node)) { + if (ts.isMethodDeclaration(node) && !(0, node_utils_1.nodeIsPresent)(node.body)) { + this.#throwError(decorator, 'A decorator can only decorate a method implementation, not an overload.'); + } + else { + this.#throwError(decorator, 'Decorators are not valid here.'); + } + } + } + for (const modifier of (0, getModifiers_1.getModifiers)(node, + /* includeIllegalModifiers */ true) ?? []) { + if (modifier.kind !== SyntaxKind.ReadonlyKeyword) { + if (node.kind === SyntaxKind.PropertySignature || + node.kind === SyntaxKind.MethodSignature) { + this.#throwError(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a type member`); + } + if (node.kind === SyntaxKind.IndexSignature && + (modifier.kind !== SyntaxKind.StaticKeyword || + !ts.isClassLike(node.parent))) { + this.#throwError(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on an index signature`); + } + } + if (modifier.kind !== SyntaxKind.InKeyword && + modifier.kind !== SyntaxKind.OutKeyword && + modifier.kind !== SyntaxKind.ConstKeyword && + node.kind === SyntaxKind.TypeParameter) { + this.#throwError(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a type parameter`); + } + if ((modifier.kind === SyntaxKind.InKeyword || + modifier.kind === SyntaxKind.OutKeyword) && + (node.kind !== SyntaxKind.TypeParameter || + !(ts.isInterfaceDeclaration(node.parent) || + ts.isClassLike(node.parent) || + ts.isTypeAliasDeclaration(node.parent)))) { + this.#throwError(modifier, `'${ts.tokenToString(modifier.kind)}' modifier can only appear on a type parameter of a class, interface or type alias`); + } + if (modifier.kind === SyntaxKind.ReadonlyKeyword && + node.kind !== SyntaxKind.PropertyDeclaration && + node.kind !== SyntaxKind.PropertySignature && + node.kind !== SyntaxKind.IndexSignature && + node.kind !== SyntaxKind.Parameter) { + this.#throwError(modifier, "'readonly' modifier can only appear on a property declaration or index signature."); + } + if (modifier.kind === SyntaxKind.DeclareKeyword && + ts.isClassLike(node.parent) && + !ts.isPropertyDeclaration(node)) { + this.#throwError(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on class elements of this kind.`); + } + if (modifier.kind === SyntaxKind.DeclareKeyword && + ts.isVariableStatement(node)) { + const declarationKind = (0, node_utils_1.getDeclarationKind)(node.declarationList); + if (declarationKind === 'using' || declarationKind === 'await using') { + this.#throwError(modifier, `'declare' modifier cannot appear on a '${declarationKind}' declaration.`); + } + } + if (modifier.kind === SyntaxKind.AbstractKeyword && + node.kind !== SyntaxKind.ClassDeclaration && + node.kind !== SyntaxKind.ConstructorType && + node.kind !== SyntaxKind.MethodDeclaration && + node.kind !== SyntaxKind.PropertyDeclaration && + node.kind !== SyntaxKind.GetAccessor && + node.kind !== SyntaxKind.SetAccessor) { + this.#throwError(modifier, `'${ts.tokenToString(modifier.kind)}' modifier can only appear on a class, method, or property declaration.`); + } + if ((modifier.kind === SyntaxKind.StaticKeyword || + modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.PrivateKeyword) && + (node.parent.kind === SyntaxKind.ModuleBlock || + node.parent.kind === SyntaxKind.SourceFile)) { + this.#throwError(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a module or namespace element.`); + } + if (modifier.kind === SyntaxKind.AccessorKeyword && + node.kind !== SyntaxKind.PropertyDeclaration) { + this.#throwError(modifier, "'accessor' modifier can only appear on a property declaration."); + } + // `checkGrammarAsyncModifier` function in `typescript` + if (modifier.kind === SyntaxKind.AsyncKeyword && + node.kind !== SyntaxKind.MethodDeclaration && + node.kind !== SyntaxKind.FunctionDeclaration && + node.kind !== SyntaxKind.FunctionExpression && + node.kind !== SyntaxKind.ArrowFunction) { + this.#throwError(modifier, "'async' modifier cannot be used here."); + } + // `checkGrammarModifiers` function in `typescript` + if (node.kind === SyntaxKind.Parameter && + (modifier.kind === SyntaxKind.StaticKeyword || + modifier.kind === SyntaxKind.ExportKeyword || + modifier.kind === SyntaxKind.DeclareKeyword || + modifier.kind === SyntaxKind.AsyncKeyword)) { + this.#throwError(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a parameter.`); + } + // `checkGrammarModifiers` function in `typescript` + if (modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.PrivateKeyword) { + for (const anotherModifier of (0, getModifiers_1.getModifiers)(node) ?? []) { + if (anotherModifier !== modifier && + (anotherModifier.kind === SyntaxKind.PublicKeyword || + anotherModifier.kind === SyntaxKind.ProtectedKeyword || + anotherModifier.kind === SyntaxKind.PrivateKeyword)) { + this.#throwError(anotherModifier, `Accessibility modifier already seen.`); + } + } + } + // `checkParameter` function in `typescript` + if (node.kind === SyntaxKind.Parameter && + // In `typescript` package, it's `ts.hasSyntacticModifier(node, ts.ModifierFlags.ParameterPropertyModifier)` + // https://github.com/typescript-eslint/typescript-eslint/pull/6615#discussion_r1136489935 + (modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.PrivateKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.ReadonlyKeyword || + modifier.kind === SyntaxKind.OverrideKeyword)) { + const func = (0, node_utils_1.getContainingFunction)(node); + if (!(func.kind === SyntaxKind.Constructor && (0, node_utils_1.nodeIsPresent)(func.body))) { + this.#throwError(modifier, 'A parameter property is only allowed in a constructor implementation.'); + } + } + } + } + #throwError(node, message) { + let start; + let end; + if (typeof node === 'number') { + start = end = node; + } + else { + start = node.getStart(this.ast); + end = node.getEnd(); + } + throw (0, node_utils_1.createError)(message, this.ast, start, end); + } + #throwUnlessAllowInvalidAST(node, message) { + if (!this.options.allowInvalidAST) { + this.#throwError(node, message); + } + } + /** + * Creates a getter for a property under aliasKey that returns the value under + * valueKey. If suppressDeprecatedPropertyWarnings is not enabled, the + * getter also console warns about the deprecation. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/6469 + */ + #withDeprecatedAliasGetter(node, aliasKey, valueKey, suppressWarnings = false) { + let warned = suppressWarnings; + Object.defineProperty(node, aliasKey, { + configurable: true, + get: this.options.suppressDeprecatedPropertyWarnings + ? () => node[valueKey] + : () => { + if (!warned) { + process.emitWarning(`The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, 'DeprecationWarning'); + warned = true; + } + return node[valueKey]; + }, + set(value) { + Object.defineProperty(node, aliasKey, { + enumerable: true, + value, + writable: true, + }); + }, + }); + return node; + } + #withDeprecatedGetter(node, deprecatedKey, preferredKey, value) { + let warned = false; + Object.defineProperty(node, deprecatedKey, { + configurable: true, + get: this.options.suppressDeprecatedPropertyWarnings + ? () => value + : () => { + if (!warned) { + process.emitWarning(`The '${deprecatedKey}' property is deprecated on ${node.type} nodes. Use ${preferredKey} instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, 'DeprecationWarning'); + warned = true; + } + return value; + }, + set(value) { + Object.defineProperty(node, deprecatedKey, { + enumerable: true, + value, + writable: true, + }); + }, + }); + return node; + } + assertModuleSpecifier(node, allowNull) { + if (!allowNull && node.moduleSpecifier == null) { + this.#throwUnlessAllowInvalidAST(node, 'Module specifier must be a string literal.'); + } + if (node.moduleSpecifier && + node.moduleSpecifier?.kind !== SyntaxKind.StringLiteral) { + this.#throwUnlessAllowInvalidAST(node.moduleSpecifier, 'Module specifier must be a string literal.'); + } + } + convertBindingNameWithTypeAnnotation(name, tsType, parent) { + const id = this.convertPattern(name); + if (tsType) { + id.typeAnnotation = this.convertTypeAnnotation(tsType, parent); + this.fixParentLocation(id, id.typeAnnotation.range); + } + return id; + } + /** + * Coverts body Nodes and add a directive field to StringLiterals + * @param nodes of ts.Node + * @param parent parentNode + * @returns Array of body statements + */ + convertBodyExpressions(nodes, parent) { + let allowDirectives = (0, node_utils_1.canContainDirective)(parent); + return (nodes + .map(statement => { + const child = this.convertChild(statement); + if (allowDirectives) { + if (child?.expression && + ts.isExpressionStatement(statement) && + ts.isStringLiteral(statement.expression)) { + const raw = child.expression.raw; + child.directive = raw.slice(1, -1); + return child; // child can be null, but it's filtered below + } + allowDirectives = false; + } + return child; // child can be null, but it's filtered below + }) + // filter out unknown nodes for now + .filter(statement => statement)); + } + convertChainExpression(node, tsNode) { + const { child, isOptional } = (() => { + if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) { + return { child: node.object, isOptional: node.optional }; + } + if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) { + return { child: node.callee, isOptional: node.optional }; + } + return { child: node.expression, isOptional: false }; + })(); + const isChildUnwrappable = (0, node_utils_1.isChildUnwrappableOptionalChain)(tsNode, child); + if (!isChildUnwrappable && !isOptional) { + return node; + } + if (isChildUnwrappable && (0, node_utils_1.isChainExpression)(child)) { + // unwrap the chain expression child + const newChild = child.expression; + if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) { + node.object = newChild; + } + else if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) { + node.callee = newChild; + } + else { + node.expression = newChild; + } + } + return this.createNode(tsNode, { + type: ts_estree_1.AST_NODE_TYPES.ChainExpression, + expression: node, + }); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertChild(child, parent) { + return this.converter(child, parent, false); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertPattern(child, parent) { + return this.converter(child, parent, true); + } + /** + * Converts a child into a type annotation. This creates an intermediary + * TypeAnnotation node to match what Flow does. + * @param child The TypeScript AST node to convert. + * @param parent parentNode + * @returns The type annotation node. + */ + convertTypeAnnotation(child, parent) { + // in FunctionType and ConstructorType typeAnnotation has 2 characters `=>` and in other places is just colon + const offset = parent?.kind === SyntaxKind.FunctionType || + parent?.kind === SyntaxKind.ConstructorType + ? 2 + : 1; + const annotationStartCol = child.getFullStart() - offset; + const range = [annotationStartCol, child.end]; + const loc = (0, node_utils_1.getLocFor)(range, this.ast); + return { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAnnotation, + loc, + range, + typeAnnotation: this.convertChild(child), + }; + } + /** + * Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node + * @param typeArguments ts.NodeArray typeArguments + * @param node parent used to create this node + * @returns TypeParameterInstantiation node + */ + convertTypeArgumentsToTypeParameterInstantiation(typeArguments, node) { + const greaterThanToken = (0, node_utils_1.findNextToken)(typeArguments, this.ast, this.ast); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterInstantiation, + range: [typeArguments.pos - 1, greaterThanToken.end], + params: typeArguments.map(typeArgument => this.convertChild(typeArgument)), + }); + } + /** + * Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node + * @param typeParameters ts.Node typeParameters + * @returns TypeParameterDeclaration node + */ + convertTSTypeParametersToTypeParametersDeclaration(typeParameters) { + const greaterThanToken = (0, node_utils_1.findNextToken)(typeParameters, this.ast, this.ast); + const range = [ + typeParameters.pos - 1, + greaterThanToken.end, + ]; + return { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterDeclaration, + loc: (0, node_utils_1.getLocFor)(range, this.ast), + range, + params: typeParameters.map(typeParameter => this.convertChild(typeParameter)), + }; + } + /** + * Converts an array of ts.Node parameters into an array of ESTreeNode params + * @param parameters An array of ts.Node params to be converted + * @returns an array of converted ESTreeNode params + */ + convertParameters(parameters) { + if (!parameters?.length) { + return []; + } + return parameters.map(param => { + const convertedParam = this.convertChild(param); + convertedParam.decorators = + (0, getModifiers_1.getDecorators)(param)?.map(el => this.convertChild(el)) ?? []; + return convertedParam; + }); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param node the child ts.Node + * @param parent parentNode + * @param allowPattern flag to determine if patterns are allowed + * @returns the converted ESTree node + */ + converter(node, parent, allowPattern) { + /** + * Exit early for null and undefined + */ + if (!node) { + return null; + } + this.#checkModifiers(node); + const pattern = this.allowPattern; + if (allowPattern != null) { + this.allowPattern = allowPattern; + } + const result = this.convertNode(node, (parent ?? node.parent)); + this.registerTSNodeInNodeMap(node, result); + this.allowPattern = pattern; + return result; + } + convertImportAttributes(node) { + return node == null + ? [] + : node.elements.map(element => this.convertChild(element)); + } + convertJSXIdentifier(node) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.getText(), + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + convertJSXNamespaceOrIdentifier(node) { + // TypeScript@5.1 added in ts.JsxNamespacedName directly + // We prefer using that if it's relevant for this node type + if (node.kind === ts.SyntaxKind.JsxNamespacedName) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName, + name: this.createNode(node.name, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.name.text, + }), + namespace: this.createNode(node.namespace, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.namespace.text, + }), + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + // TypeScript@<5.1 has to manually parse the JSX attributes + const text = node.getText(); + const colonIndex = text.indexOf(':'); + // this is intentional we can ignore conversion if `:` is in first character + if (colonIndex > 0) { + const range = (0, node_utils_1.getRange)(node, this.ast); + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName, + range, + name: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + range: [range[0] + colonIndex + 1, range[1]], + name: text.slice(colonIndex + 1), + }), + namespace: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + range: [range[0], range[0] + colonIndex], + name: text.slice(0, colonIndex), + }), + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + return this.convertJSXIdentifier(node); + } + /** + * Converts a TypeScript JSX node.tagName into an ESTree node.name + * @param node the tagName object from a JSX ts.Node + * @returns the converted ESTree name object + */ + convertJSXTagName(node, parent) { + let result; + switch (node.kind) { + case SyntaxKind.PropertyAccessExpression: + if (node.name.kind === SyntaxKind.PrivateIdentifier) { + // This is one of the few times where TS explicitly errors, and doesn't even gracefully handle the syntax. + // So we shouldn't ever get into this state to begin with. + this.#throwError(node.name, 'Non-private identifier expected.'); + } + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXMemberExpression, + object: this.convertJSXTagName(node.expression, parent), + property: this.convertJSXIdentifier(node.name), + }); + break; + case SyntaxKind.ThisKeyword: + case SyntaxKind.Identifier: + default: + return this.convertJSXNamespaceOrIdentifier(node); + } + this.registerTSNodeInNodeMap(node, result); + return result; + } + convertMethodSignature(node) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSMethodSignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + kind: (() => { + switch (node.kind) { + case SyntaxKind.GetAccessor: + return 'get'; + case SyntaxKind.SetAccessor: + return 'set'; + case SyntaxKind.MethodSignature: + return 'method'; + } + })(), + optional: (0, node_utils_1.isOptional)(node), + params: this.convertParameters(node.parameters), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + /** + * Uses the provided range location to adjust the location data of the given Node + * @param result The node that will have its location data mutated + * @param childRange The child node range used to expand location + */ + fixParentLocation(result, childRange) { + if (childRange[0] < result.range[0]) { + result.range[0] = childRange[0]; + result.loc.start = (0, node_utils_1.getLineAndCharacterFor)(result.range[0], this.ast); + } + if (childRange[1] > result.range[1]) { + result.range[1] = childRange[1]; + result.loc.end = (0, node_utils_1.getLineAndCharacterFor)(result.range[1], this.ast); + } + } + /** + * Converts a TypeScript node into an ESTree node. + * The core of the conversion logic: + * Identify and convert each relevant TypeScript SyntaxKind + * @returns the converted ESTree node + */ + convertNode(node, parent) { + switch (node.kind) { + case SyntaxKind.SourceFile: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Program, + range: [node.getStart(this.ast), node.endOfFileToken.end], + body: this.convertBodyExpressions(node.statements, node), + comments: undefined, + sourceType: node.externalModuleIndicator ? 'module' : 'script', + tokens: undefined, + }); + } + case SyntaxKind.Block: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.BlockStatement, + body: this.convertBodyExpressions(node.statements, node), + }); + } + case SyntaxKind.Identifier: { + if ((0, node_utils_1.isThisInTypeQuery)(node)) { + // special case for `typeof this.foo` - TS emits an Identifier for `this` + // but we want to treat it as a ThisExpression for consistency + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThisExpression, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + decorators: [], + name: node.text, + optional: false, + typeAnnotation: undefined, + }); + } + case SyntaxKind.PrivateIdentifier: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.PrivateIdentifier, + // typescript includes the `#` in the text + name: node.text.slice(1), + }); + } + case SyntaxKind.WithStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.WithStatement, + body: this.convertChild(node.statement), + object: this.convertChild(node.expression), + }); + // Control Flow + case SyntaxKind.ReturnStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ReturnStatement, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.LabeledStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.LabeledStatement, + body: this.convertChild(node.statement), + label: this.convertChild(node.label), + }); + case SyntaxKind.ContinueStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ContinueStatement, + label: this.convertChild(node.label), + }); + case SyntaxKind.BreakStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.BreakStatement, + label: this.convertChild(node.label), + }); + // Choice + case SyntaxKind.IfStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.IfStatement, + alternate: this.convertChild(node.elseStatement), + consequent: this.convertChild(node.thenStatement), + test: this.convertChild(node.expression), + }); + case SyntaxKind.SwitchStatement: + if (node.caseBlock.clauses.filter(switchCase => switchCase.kind === SyntaxKind.DefaultClause).length > 1) { + this.#throwError(node, "A 'default' clause cannot appear more than once in a 'switch' statement."); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SwitchStatement, + cases: node.caseBlock.clauses.map(el => this.convertChild(el)), + discriminant: this.convertChild(node.expression), + }); + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SwitchCase, + // expression is present in case only + consequent: node.statements.map(el => this.convertChild(el)), + test: node.kind === SyntaxKind.CaseClause + ? this.convertChild(node.expression) + : null, + }); + // Exceptions + case SyntaxKind.ThrowStatement: + if (node.expression.end === node.expression.pos) { + this.#throwUnlessAllowInvalidAST(node, 'A throw statement must throw an expression.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThrowStatement, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.TryStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TryStatement, + block: this.convertChild(node.tryBlock), + finalizer: this.convertChild(node.finallyBlock), + handler: this.convertChild(node.catchClause), + }); + case SyntaxKind.CatchClause: + if (node.variableDeclaration?.initializer) { + this.#throwError(node.variableDeclaration.initializer, 'Catch clause variable cannot have an initializer.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.CatchClause, + body: this.convertChild(node.block), + param: node.variableDeclaration + ? this.convertBindingNameWithTypeAnnotation(node.variableDeclaration.name, node.variableDeclaration.type) + : null, + }); + // Loops + case SyntaxKind.WhileStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.WhileStatement, + body: this.convertChild(node.statement), + test: this.convertChild(node.expression), + }); + /** + * Unlike other parsers, TypeScript calls a "DoWhileStatement" + * a "DoStatement" + */ + case SyntaxKind.DoStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.DoWhileStatement, + body: this.convertChild(node.statement), + test: this.convertChild(node.expression), + }); + case SyntaxKind.ForStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForStatement, + body: this.convertChild(node.statement), + init: this.convertChild(node.initializer), + test: this.convertChild(node.condition), + update: this.convertChild(node.incrementor), + }); + case SyntaxKind.ForInStatement: + this.#checkForStatementDeclaration(node.initializer, node.kind); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForInStatement, + body: this.convertChild(node.statement), + left: this.convertPattern(node.initializer), + right: this.convertChild(node.expression), + }); + case SyntaxKind.ForOfStatement: { + this.#checkForStatementDeclaration(node.initializer, node.kind); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForOfStatement, + await: Boolean(node.awaitModifier && + node.awaitModifier.kind === SyntaxKind.AwaitKeyword), + body: this.convertChild(node.statement), + left: this.convertPattern(node.initializer), + right: this.convertChild(node.expression), + }); + } + // Declarations + case SyntaxKind.FunctionDeclaration: { + const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const isAsync = (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node); + const isGenerator = !!node.asteriskToken; + if (isDeclare) { + if (node.body) { + this.#throwError(node, 'An implementation cannot be declared in ambient contexts.'); + } + else if (isAsync) { + this.#throwError(node, "'async' modifier cannot be used in an ambient context."); + } + else if (isGenerator) { + this.#throwError(node, 'Generators are not allowed in an ambient context.'); + } + } + else if (!node.body && isGenerator) { + this.#throwError(node, 'A function signature cannot be declared as a generator.'); + } + const result = this.createNode(node, { + // declare implies no body due to the invariant above + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSDeclareFunction + : ts_estree_1.AST_NODE_TYPES.FunctionDeclaration, + async: isAsync, + body: this.convertChild(node.body) || undefined, + declare: isDeclare, + expression: false, + generator: isGenerator, + id: this.convertChild(node.name), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + return this.fixExports(node, result); + } + case SyntaxKind.VariableDeclaration: { + const definite = !!node.exclamationToken; + const init = this.convertChild(node.initializer); + const id = this.convertBindingNameWithTypeAnnotation(node.name, node.type, node); + if (definite) { + if (init) { + this.#throwError(node, 'Declarations with initializers cannot also have definite assignment assertions.'); + } + else if (id.type !== ts_estree_1.AST_NODE_TYPES.Identifier || + !id.typeAnnotation) { + this.#throwError(node, 'Declarations with definite assignment assertions must also have type annotations.'); + } + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator, + definite, + id, + init, + }); + } + case SyntaxKind.VariableStatement: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarationList.declarations.map(el => this.convertChild(el)), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + kind: (0, node_utils_1.getDeclarationKind)(node.declarationList), + }); + if (!result.declarations.length) { + this.#throwUnlessAllowInvalidAST(node, 'A variable declaration list must have at least one variable declarator.'); + } + if (result.kind === 'using' || result.kind === 'await using') { + node.declarationList.declarations.forEach((declaration, i) => { + if (result.declarations[i].init == null) { + this.#throwError(declaration, `'${result.kind}' declarations must be initialized.`); + } + if (result.declarations[i].id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) { + this.#throwError(declaration.name, `'${result.kind}' declarations may not have binding patterns.`); + } + }); + } + // Definite assignment only allowed for non-declare let and var + if (result.declare || + ['await using', 'const', 'using'].includes(result.kind)) { + node.declarationList.declarations.forEach((declaration, i) => { + if (result.declarations[i].definite) { + this.#throwError(declaration, `A definite assignment assertion '!' is not permitted in this context.`); + } + }); + } + if (result.declare) { + node.declarationList.declarations.forEach((declaration, i) => { + if (result.declarations[i].init && + (['let', 'var'].includes(result.kind) || + result.declarations[i].id.typeAnnotation)) { + this.#throwError(declaration, `Initializers are not permitted in ambient contexts.`); + } + }); + // Theoretically, only certain initializers are allowed for declare const, + // (TS1254: A 'const' initializer in an ambient context must be a string + // or numeric literal or literal enum reference.) but we just allow + // all expressions + } + // Note! No-declare does not mean the variable is not ambient, because + // it can be further nested in other declare contexts. Therefore we cannot + // check for const initializers. + /** + * Semantically, decorators are not allowed on variable declarations, + * Pre 4.8 TS would include them in the AST, so we did as well. + * However as of 4.8 TS no longer includes it (as it is, well, invalid). + * + * So for consistency across versions, we no longer include it either. + */ + return this.fixExports(node, result); + } + // mostly for for-of, for-in + case SyntaxKind.VariableDeclarationList: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarations.map(el => this.convertChild(el)), + declare: false, + kind: (0, node_utils_1.getDeclarationKind)(node), + }); + if (result.kind === 'using' || result.kind === 'await using') { + node.declarations.forEach((declaration, i) => { + if (result.declarations[i].init != null) { + this.#throwError(declaration, `'${result.kind}' declarations may not be initialized in for statement.`); + } + if (result.declarations[i].id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) { + this.#throwError(declaration.name, `'${result.kind}' declarations may not have binding patterns.`); + } + }); + } + return result; + } + // Expressions + case SyntaxKind.ExpressionStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExpressionStatement, + directive: undefined, + expression: this.convertChild(node.expression), + }); + case SyntaxKind.ThisKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThisExpression, + }); + case SyntaxKind.ArrayLiteralExpression: { + // TypeScript uses ArrayLiteralExpression in destructuring assignment, too + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayPattern, + decorators: [], + elements: node.elements.map(el => this.convertPattern(el)), + optional: false, + typeAnnotation: undefined, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayExpression, + elements: node.elements.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.ObjectLiteralExpression: { + // TypeScript uses ObjectLiteralExpression in destructuring assignment, too + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectPattern, + decorators: [], + optional: false, + properties: node.properties.map(el => this.convertPattern(el)), + typeAnnotation: undefined, + }); + } + const properties = []; + for (const property of node.properties) { + if ((property.kind === SyntaxKind.GetAccessor || + property.kind === SyntaxKind.SetAccessor || + property.kind === SyntaxKind.MethodDeclaration) && + !property.body) { + this.#throwUnlessAllowInvalidAST(property.end - 1, "'{' expected."); + } + properties.push(this.convertChild(property)); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectExpression, + properties, + }); + } + case SyntaxKind.PropertyAssignment: { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const { exclamationToken, questionToken } = node; + if (questionToken) { + this.#throwError(questionToken, 'A property assignment cannot have a question token.'); + } + if (exclamationToken) { + this.#throwError(exclamationToken, 'A property assignment cannot have an exclamation token.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + kind: 'init', + method: false, + optional: false, + shorthand: false, + value: this.converter(node.initializer, node, this.allowPattern), + }); + } + case SyntaxKind.ShorthandPropertyAssignment: { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const { exclamationToken, modifiers, questionToken } = node; + if (modifiers) { + this.#throwError(modifiers[0], 'A shorthand property assignment cannot have modifiers.'); + } + if (questionToken) { + this.#throwError(questionToken, 'A shorthand property assignment cannot have a question token.'); + } + if (exclamationToken) { + this.#throwError(exclamationToken, 'A shorthand property assignment cannot have an exclamation token.'); + } + if (node.objectAssignmentInitializer) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: false, + key: this.convertChild(node.name), + kind: 'init', + method: false, + optional: false, + shorthand: true, + value: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: this.convertPattern(node.name), + optional: false, + right: this.convertChild(node.objectAssignmentInitializer), + typeAnnotation: undefined, + }), + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: false, + key: this.convertChild(node.name), + kind: 'init', + method: false, + optional: false, + shorthand: true, + value: this.convertChild(node.name), + }); + } + case SyntaxKind.ComputedPropertyName: + return this.convertChild(node.expression); + case SyntaxKind.PropertyDeclaration: { + const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node); + if (isAbstract && node.initializer) { + this.#throwError(node.initializer, `Abstract property cannot have an initializer.`); + } + const isAccessor = (0, node_utils_1.hasModifier)(SyntaxKind.AccessorKeyword, node); + const type = (() => { + if (isAccessor) { + if (isAbstract) { + return ts_estree_1.AST_NODE_TYPES.TSAbstractAccessorProperty; + } + return ts_estree_1.AST_NODE_TYPES.AccessorProperty; + } + if (isAbstract) { + return ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition; + } + return ts_estree_1.AST_NODE_TYPES.PropertyDefinition; + })(); + const key = this.convertChild(node.name); + return this.createNode(node, { + type, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [], + definite: !!node.exclamationToken, + key, + optional: (key.type === ts_estree_1.AST_NODE_TYPES.Literal || + node.name.kind === SyntaxKind.Identifier || + node.name.kind === SyntaxKind.ComputedPropertyName || + node.name.kind === SyntaxKind.PrivateIdentifier) && + !!node.questionToken, + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + value: isAbstract ? null : this.convertChild(node.initializer), + }); + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: { + if (node.parent.kind === SyntaxKind.InterfaceDeclaration || + node.parent.kind === SyntaxKind.TypeLiteral) { + return this.convertMethodSignature(node); + } + } + // otherwise, it is a non-type accessor - intentional fallthrough + case SyntaxKind.MethodDeclaration: { + const method = this.createNode(node, { + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression + : ts_estree_1.AST_NODE_TYPES.FunctionExpression, + range: [node.parameters.pos - 1, node.end], + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + declare: false, + expression: false, // ESTreeNode as ESTreeNode here + generator: !!node.asteriskToken, + id: null, + params: [], + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + if (method.typeParameters) { + this.fixParentLocation(method, method.typeParameters.range); + } + let result; + if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + method.params = node.parameters.map(el => this.convertChild(el)); + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + kind: 'init', + method: node.kind === SyntaxKind.MethodDeclaration, + optional: !!node.questionToken, + shorthand: false, + value: method, + }); + } + else { + // class + /** + * Unlike in object literal methods, class method params can have decorators + */ + method.params = this.convertParameters(node.parameters); + /** + * TypeScript class methods can be defined as "abstract" + */ + const methodDefinitionType = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node) + ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition + : ts_estree_1.AST_NODE_TYPES.MethodDefinition; + result = this.createNode(node, { + type: methodDefinitionType, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [], + key: this.convertChild(node.name), + kind: 'method', + optional: !!node.questionToken, + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + value: method, + }); + } + if (node.kind === SyntaxKind.GetAccessor) { + result.kind = 'get'; + } + else if (node.kind === SyntaxKind.SetAccessor) { + result.kind = 'set'; + } + else if (!result.static && + node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor' && + result.type !== ts_estree_1.AST_NODE_TYPES.Property) { + result.kind = 'constructor'; + } + return result; + } + // TypeScript uses this even for static methods named "constructor" + case SyntaxKind.Constructor: { + const lastModifier = (0, node_utils_1.getLastModifier)(node); + const constructorToken = (lastModifier && (0, node_utils_1.findNextToken)(lastModifier, node, this.ast)) ?? + node.getFirstToken(); + const constructor = this.createNode(node, { + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression + : ts_estree_1.AST_NODE_TYPES.FunctionExpression, + range: [node.parameters.pos - 1, node.end], + async: false, + body: this.convertChild(node.body), + declare: false, + expression: false, // is not present in ESTreeNode + generator: false, + id: null, + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + if (constructor.typeParameters) { + this.fixParentLocation(constructor, constructor.typeParameters.range); + } + const constructorKey = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + range: [constructorToken.getStart(this.ast), constructorToken.end], + decorators: [], + name: 'constructor', + optional: false, + typeAnnotation: undefined, + }); + const isStatic = (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node); + return this.createNode(node, { + type: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node) + ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition + : ts_estree_1.AST_NODE_TYPES.MethodDefinition, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: false, + decorators: [], + key: constructorKey, + kind: isStatic ? 'method' : 'constructor', + optional: false, + override: false, + static: isStatic, + value: constructor, + }); + } + case SyntaxKind.FunctionExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.FunctionExpression, + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + declare: false, + expression: false, + generator: !!node.asteriskToken, + id: this.convertChild(node.name), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + case SyntaxKind.SuperKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Super, + }); + case SyntaxKind.ArrayBindingPattern: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayPattern, + decorators: [], + elements: node.elements.map(el => this.convertPattern(el)), + optional: false, + typeAnnotation: undefined, + }); + // occurs with missing array elements like [,] + case SyntaxKind.OmittedExpression: + return null; + case SyntaxKind.ObjectBindingPattern: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectPattern, + decorators: [], + optional: false, + properties: node.elements.map(el => this.convertPattern(el)), + typeAnnotation: undefined, + }); + case SyntaxKind.BindingElement: { + if (parent.kind === SyntaxKind.ArrayBindingPattern) { + const arrayItem = this.convertChild(node.name, parent); + if (node.initializer) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: arrayItem, + optional: false, + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + } + if (node.dotDotDotToken) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: arrayItem, + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + return arrayItem; + } + let result; + if (node.dotDotDotToken) { + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertChild(node.propertyName ?? node.name), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + else { + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: Boolean(node.propertyName && + node.propertyName.kind === SyntaxKind.ComputedPropertyName), + key: this.convertChild(node.propertyName ?? node.name), + kind: 'init', + method: false, + optional: false, + shorthand: !node.propertyName, + value: this.convertChild(node.name), + }); + } + if (node.initializer) { + result.value = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + range: [node.name.getStart(this.ast), node.initializer.end], + decorators: [], + left: this.convertChild(node.name), + optional: false, + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + } + return result; + } + case SyntaxKind.ArrowFunction: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression, + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + expression: node.body.kind !== SyntaxKind.Block, + generator: false, + id: null, + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + case SyntaxKind.YieldExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.YieldExpression, + argument: this.convertChild(node.expression), + delegate: !!node.asteriskToken, + }); + case SyntaxKind.AwaitExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AwaitExpression, + argument: this.convertChild(node.expression), + }); + // Template Literals + case SyntaxKind.NoSubstitutionTemplateLiteral: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral, + expressions: [], + quasis: [ + this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateElement, + tail: true, + value: { + cooked: node.text, + raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - 1), + }, + }), + ], + }); + case SyntaxKind.TemplateExpression: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral, + expressions: [], + quasis: [this.convertChild(node.head)], + }); + node.templateSpans.forEach(templateSpan => { + result.expressions.push(this.convertChild(templateSpan.expression)); + result.quasis.push(this.convertChild(templateSpan.literal)); + }); + return result; + } + case SyntaxKind.TaggedTemplateExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TaggedTemplateExpression, + quasi: this.convertChild(node.template), + tag: this.convertChild(node.tag), + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + }); + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + case SyntaxKind.TemplateTail: { + const tail = node.kind === SyntaxKind.TemplateTail; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateElement, + tail, + value: { + cooked: node.text, + raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - (tail ? 1 : 2)), + }, + }); + } + // Patterns + case SyntaxKind.SpreadAssignment: + case SyntaxKind.SpreadElement: { + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertPattern(node.expression), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SpreadElement, + argument: this.convertChild(node.expression), + }); + } + case SyntaxKind.Parameter: { + let parameter; + let result; + if (node.dotDotDotToken) { + parameter = result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertChild(node.name), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + else if (node.initializer) { + parameter = this.convertChild(node.name); + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: parameter, + optional: false, + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers) { + // AssignmentPattern should not contain modifiers in range + result.range[0] = parameter.range[0]; + result.loc = (0, node_utils_1.getLocFor)(result.range, this.ast); + } + } + else { + parameter = result = this.convertChild(node.name, parent); + } + if (node.type) { + parameter.typeAnnotation = this.convertTypeAnnotation(node.type, node); + this.fixParentLocation(parameter, parameter.typeAnnotation.range); + } + if (node.questionToken) { + if (node.questionToken.end > parameter.range[1]) { + parameter.range[1] = node.questionToken.end; + parameter.loc.end = (0, node_utils_1.getLineAndCharacterFor)(parameter.range[1], this.ast); + } + parameter.optional = true; + } + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSParameterProperty, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + decorators: [], + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + parameter: result, + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + }); + } + return result; + } + // Classes + case SyntaxKind.ClassDeclaration: + if (!node.name && + (!(0, node_utils_1.hasModifier)(ts.SyntaxKind.ExportKeyword, node) || + !(0, node_utils_1.hasModifier)(ts.SyntaxKind.DefaultKeyword, node))) { + this.#throwUnlessAllowInvalidAST(node, "A class declaration without the 'default' modifier must have a name."); + } + /* intentional fallthrough */ + case SyntaxKind.ClassExpression: { + const heritageClauses = node.heritageClauses ?? []; + const classNodeType = node.kind === SyntaxKind.ClassDeclaration + ? ts_estree_1.AST_NODE_TYPES.ClassDeclaration + : ts_estree_1.AST_NODE_TYPES.ClassExpression; + let extendsClause; + let implementsClause; + for (const heritageClause of heritageClauses) { + const { token, types } = heritageClause; + if (types.length === 0) { + this.#throwUnlessAllowInvalidAST(heritageClause, `'${ts.tokenToString(token)}' list cannot be empty.`); + } + if (token === SyntaxKind.ExtendsKeyword) { + if (extendsClause) { + this.#throwUnlessAllowInvalidAST(heritageClause, "'extends' clause already seen."); + } + if (implementsClause) { + this.#throwUnlessAllowInvalidAST(heritageClause, "'extends' clause must precede 'implements' clause."); + } + if (types.length > 1) { + this.#throwUnlessAllowInvalidAST(types[1], 'Classes can only extend a single class.'); + } + extendsClause ??= heritageClause; + } + else if (token === SyntaxKind.ImplementsKeyword) { + if (implementsClause) { + this.#throwUnlessAllowInvalidAST(heritageClause, "'implements' clause already seen."); + } + implementsClause ??= heritageClause; + } + } + const result = this.createNode(node, { + type: classNodeType, + abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node), + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ClassBody, + range: [node.members.pos - 1, node.end], + body: node.members + .filter(node_utils_1.isESTreeClassMember) + .map(el => this.convertChild(el)), + }), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [], + id: this.convertChild(node.name), + implements: implementsClause?.types.map(el => this.convertChild(el)) ?? [], + superClass: extendsClause?.types[0] + ? this.convertChild(extendsClause.types[0].expression) + : null, + superTypeArguments: undefined, + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + if (extendsClause?.types[0]?.typeArguments) { + result.superTypeArguments = + this.convertTypeArgumentsToTypeParameterInstantiation(extendsClause.types[0].typeArguments, extendsClause.types[0]); + } + return this.fixExports(node, result); + } + // Modules + case SyntaxKind.ModuleBlock: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSModuleBlock, + body: this.convertBodyExpressions(node.statements, node), + }); + case SyntaxKind.ImportDeclaration: { + this.assertModuleSpecifier(node, false); + const result = this.createNode(node, this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ImportDeclaration, + attributes: this.convertImportAttributes( + // eslint-disable-next-line @typescript-eslint/no-deprecated + node.attributes ?? node.assertClause), + importKind: 'value', + source: this.convertChild(node.moduleSpecifier), + specifiers: [], + }, 'assertions', 'attributes', true)); + if (node.importClause) { + if (node.importClause.isTypeOnly) { + result.importKind = 'type'; + } + if (node.importClause.name) { + result.specifiers.push(this.convertChild(node.importClause)); + } + if (node.importClause.namedBindings) { + switch (node.importClause.namedBindings.kind) { + case SyntaxKind.NamespaceImport: + result.specifiers.push(this.convertChild(node.importClause.namedBindings)); + break; + case SyntaxKind.NamedImports: + result.specifiers.push(...node.importClause.namedBindings.elements.map(el => this.convertChild(el))); + break; + } + } + } + return result; + } + case SyntaxKind.NamespaceImport: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportNamespaceSpecifier, + local: this.convertChild(node.name), + }); + case SyntaxKind.ImportSpecifier: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportSpecifier, + imported: this.convertChild(node.propertyName ?? node.name), + importKind: node.isTypeOnly ? 'type' : 'value', + local: this.convertChild(node.name), + }); + case SyntaxKind.ImportClause: { + const local = this.convertChild(node.name); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier, + range: local.range, + local, + }); + } + case SyntaxKind.ExportDeclaration: { + if (node.exportClause?.kind === SyntaxKind.NamedExports) { + this.assertModuleSpecifier(node, true); + return this.createNode(node, this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration, + attributes: this.convertImportAttributes( + // eslint-disable-next-line @typescript-eslint/no-deprecated + node.attributes ?? node.assertClause), + declaration: null, + exportKind: node.isTypeOnly ? 'type' : 'value', + source: this.convertChild(node.moduleSpecifier), + specifiers: node.exportClause.elements.map(el => this.convertChild(el, node)), + }, 'assertions', 'attributes', true)); + } + this.assertModuleSpecifier(node, false); + return this.createNode(node, this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ExportAllDeclaration, + attributes: this.convertImportAttributes( + // eslint-disable-next-line @typescript-eslint/no-deprecated + node.attributes ?? node.assertClause), + exported: node.exportClause?.kind === SyntaxKind.NamespaceExport + ? this.convertChild(node.exportClause.name) + : null, + exportKind: node.isTypeOnly ? 'type' : 'value', + source: this.convertChild(node.moduleSpecifier), + }, 'assertions', 'attributes', true)); + } + case SyntaxKind.ExportSpecifier: { + const local = node.propertyName ?? node.name; + if (local.kind === SyntaxKind.StringLiteral && + parent.kind === SyntaxKind.ExportDeclaration && + parent.moduleSpecifier?.kind !== SyntaxKind.StringLiteral) { + this.#throwError(local, 'A string literal cannot be used as a local exported binding without `from`.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportSpecifier, + exported: this.convertChild(node.name), + exportKind: node.isTypeOnly ? 'type' : 'value', + local: this.convertChild(local), + }); + } + case SyntaxKind.ExportAssignment: + if (node.isExportEquals) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSExportAssignment, + expression: this.convertChild(node.expression), + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration, + declaration: this.convertChild(node.expression), + exportKind: 'value', + }); + // Unary Operations + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: { + const operator = (0, node_utils_1.getTextForTokenKind)(node.operator); + /** + * ESTree uses UpdateExpression for ++/-- + */ + if (operator === '++' || operator === '--') { + if (!(0, node_utils_1.isValidAssignmentTarget)(node.operand)) { + this.#throwUnlessAllowInvalidAST(node.operand, 'Invalid left-hand side expression in unary operation'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UpdateExpression, + argument: this.convertChild(node.operand), + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + argument: this.convertChild(node.operand), + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + }); + } + case SyntaxKind.DeleteExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + argument: this.convertChild(node.expression), + operator: 'delete', + prefix: true, + }); + case SyntaxKind.VoidExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + argument: this.convertChild(node.expression), + operator: 'void', + prefix: true, + }); + case SyntaxKind.TypeOfExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + argument: this.convertChild(node.expression), + operator: 'typeof', + prefix: true, + }); + case SyntaxKind.TypeOperator: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeOperator, + operator: (0, node_utils_1.getTextForTokenKind)(node.operator), + typeAnnotation: this.convertChild(node.type), + }); + // Binary Operations + case SyntaxKind.BinaryExpression: { + // TypeScript uses BinaryExpression for sequences as well + if ((0, node_utils_1.isComma)(node.operatorToken)) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SequenceExpression, + expressions: [], + }); + const left = this.convertChild(node.left); + if (left.type === ts_estree_1.AST_NODE_TYPES.SequenceExpression && + node.left.kind !== SyntaxKind.ParenthesizedExpression) { + result.expressions.push(...left.expressions); + } + else { + result.expressions.push(left); + } + result.expressions.push(this.convertChild(node.right)); + return result; + } + const expressionType = (0, node_utils_1.getBinaryExpressionType)(node.operatorToken); + if (this.allowPattern && + expressionType.type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: this.convertPattern(node.left, node), + optional: false, + right: this.convertChild(node.right), + typeAnnotation: undefined, + }); + } + return this.createNode(node, { + ...expressionType, + left: this.converter(node.left, node, expressionType.type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression), + right: this.convertChild(node.right), + }); + } + case SyntaxKind.PropertyAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.name); + const computed = false; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MemberExpression, + computed, + object, + optional: node.questionDotToken != null, + property, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.ElementAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.argumentExpression); + const computed = true; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MemberExpression, + computed, + object, + optional: node.questionDotToken != null, + property, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.CallExpression: { + if (node.expression.kind === SyntaxKind.ImportKeyword) { + if (node.arguments.length !== 1 && node.arguments.length !== 2) { + this.#throwUnlessAllowInvalidAST(node.arguments[2] ?? node, 'Dynamic import requires exactly one or two arguments.'); + } + return this.createNode(node, this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ImportExpression, + options: node.arguments[1] + ? this.convertChild(node.arguments[1]) + : null, + source: this.convertChild(node.arguments[0]), + }, 'attributes', 'options', true)); + } + const callee = this.convertChild(node.expression); + const args = node.arguments.map(el => this.convertChild(el)); + const typeArguments = node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node); + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.CallExpression, + arguments: args, + callee, + optional: node.questionDotToken != null, + typeArguments, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.NewExpression: { + const typeArguments = node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node); + // NOTE - NewExpression cannot have an optional chain in it + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.NewExpression, + arguments: node.arguments + ? node.arguments.map(el => this.convertChild(el)) + : [], + callee: this.convertChild(node.expression), + typeArguments, + }); + } + case SyntaxKind.ConditionalExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ConditionalExpression, + alternate: this.convertChild(node.whenFalse), + consequent: this.convertChild(node.whenTrue), + test: this.convertChild(node.condition), + }); + case SyntaxKind.MetaProperty: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MetaProperty, + meta: this.createNode( + // TODO: do we really want to convert it to Token? + node.getFirstToken(), { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + decorators: [], + name: (0, node_utils_1.getTextForTokenKind)(node.keywordToken), + optional: false, + typeAnnotation: undefined, + }), + property: this.convertChild(node.name), + }); + } + case SyntaxKind.Decorator: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Decorator, + expression: this.convertChild(node.expression), + }); + } + // Literals + case SyntaxKind.StringLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: node.getText(), + value: parent.kind === SyntaxKind.JsxAttribute + ? (0, node_utils_1.unescapeStringLiteralText)(node.text) + : node.text, + }); + } + case SyntaxKind.NumericLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: node.getText(), + value: Number(node.text), + }); + } + case SyntaxKind.BigIntLiteral: { + const range = (0, node_utils_1.getRange)(node, this.ast); + const rawValue = this.ast.text.slice(range[0], range[1]); + const bigint = rawValue + // remove suffix `n` + .slice(0, -1) + // `BigInt` doesn't accept numeric separator + // and `bigint` property should not include numeric separator + .replaceAll('_', ''); + const value = typeof BigInt !== 'undefined' ? BigInt(bigint) : null; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + range, + bigint: value == null ? bigint : String(value), + raw: rawValue, + value, + }); + } + case SyntaxKind.RegularExpressionLiteral: { + const pattern = node.text.slice(1, node.text.lastIndexOf('/')); + const flags = node.text.slice(node.text.lastIndexOf('/') + 1); + let regex = null; + try { + regex = new RegExp(pattern, flags); + } + catch { + // Intentionally blank, so regex stays null + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: node.text, + regex: { + flags, + pattern, + }, + value: regex, + }); + } + case SyntaxKind.TrueKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: 'true', + value: true, + }); + case SyntaxKind.FalseKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: 'false', + value: false, + }); + case SyntaxKind.NullKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: 'null', + value: null, + }); + } + case SyntaxKind.EmptyStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.EmptyStatement, + }); + case SyntaxKind.DebuggerStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.DebuggerStatement, + }); + // JSX + case SyntaxKind.JsxElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXElement, + children: node.children.map(el => this.convertChild(el)), + closingElement: this.convertChild(node.closingElement), + openingElement: this.convertChild(node.openingElement), + }); + case SyntaxKind.JsxFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXFragment, + children: node.children.map(el => this.convertChild(el)), + closingFragment: this.convertChild(node.closingFragment), + openingFragment: this.convertChild(node.openingFragment), + }); + case SyntaxKind.JsxSelfClosingElement: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXElement, + /** + * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, + * TypeScript does not seem to have the idea of openingElement when tag is self-closing + */ + children: [], + closingElement: null, + openingElement: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement, + range: (0, node_utils_1.getRange)(node, this.ast), + attributes: node.attributes.properties.map(el => this.convertChild(el)), + name: this.convertJSXTagName(node.tagName, node), + selfClosing: true, + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) + : undefined, + }), + }); + } + case SyntaxKind.JsxOpeningElement: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement, + attributes: node.attributes.properties.map(el => this.convertChild(el)), + name: this.convertJSXTagName(node.tagName, node), + selfClosing: false, + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + }); + } + case SyntaxKind.JsxClosingElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXClosingElement, + name: this.convertJSXTagName(node.tagName, node), + }); + case SyntaxKind.JsxOpeningFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningFragment, + }); + case SyntaxKind.JsxClosingFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXClosingFragment, + }); + case SyntaxKind.JsxExpression: { + const expression = node.expression + ? this.convertChild(node.expression) + : this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXEmptyExpression, + range: [node.getStart(this.ast) + 1, node.getEnd() - 1], + }); + if (node.dotDotDotToken) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXSpreadChild, + expression, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXExpressionContainer, + expression, + }); + } + case SyntaxKind.JsxAttribute: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXAttribute, + name: this.convertJSXNamespaceOrIdentifier(node.name), + value: this.convertChild(node.initializer), + }); + } + case SyntaxKind.JsxText: { + const start = node.getFullStart(); + const end = node.getEnd(); + const text = this.ast.text.slice(start, end); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXText, + range: [start, end], + raw: text, + value: (0, node_utils_1.unescapeStringLiteralText)(text), + }); + } + case SyntaxKind.JsxSpreadAttribute: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXSpreadAttribute, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.QualifiedName: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName, + left: this.convertChild(node.left), + right: this.convertChild(node.right), + }); + } + // TypeScript specific + case SyntaxKind.TypeReference: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeReference, + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + typeName: this.convertChild(node.typeName), + }); + case SyntaxKind.TypeParameter: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameter, + const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node), + constraint: node.constraint && this.convertChild(node.constraint), + default: node.default ? this.convertChild(node.default) : undefined, + in: (0, node_utils_1.hasModifier)(SyntaxKind.InKeyword, node), + name: this.convertChild(node.name), + out: (0, node_utils_1.hasModifier)(SyntaxKind.OutKeyword, node), + }); + } + case SyntaxKind.ThisType: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSThisType, + }); + case SyntaxKind.AnyKeyword: + case SyntaxKind.BigIntKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.ObjectKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.UnknownKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.UndefinedKeyword: + case SyntaxKind.IntrinsicKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}`], + }); + } + case SyntaxKind.NonNullExpression: { + const nnExpr = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNonNullExpression, + expression: this.convertChild(node.expression), + }); + return this.convertChainExpression(nnExpr, node); + } + case SyntaxKind.TypeLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeLiteral, + members: node.members.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.ArrayType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSArrayType, + elementType: this.convertChild(node.elementType), + }); + } + case SyntaxKind.IndexedAccessType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIndexedAccessType, + indexType: this.convertChild(node.indexType), + objectType: this.convertChild(node.objectType), + }); + } + case SyntaxKind.ConditionalType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSConditionalType, + checkType: this.convertChild(node.checkType), + extendsType: this.convertChild(node.extendsType), + falseType: this.convertChild(node.falseType), + trueType: this.convertChild(node.trueType), + }); + } + case SyntaxKind.TypeQuery: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery, + exprName: this.convertChild(node.exprName), + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + }); + case SyntaxKind.MappedType: { + if (node.members && node.members.length > 0) { + this.#throwUnlessAllowInvalidAST(node.members[0], 'A mapped type may not declare properties or methods.'); + } + return this.createNode(node, this.#withDeprecatedGetter({ + type: ts_estree_1.AST_NODE_TYPES.TSMappedType, + constraint: this.convertChild(node.typeParameter.constraint), + key: this.convertChild(node.typeParameter.name), + nameType: this.convertChild(node.nameType) ?? null, + optional: node.questionToken && + (node.questionToken.kind === SyntaxKind.QuestionToken || + (0, node_utils_1.getTextForTokenKind)(node.questionToken.kind)), + readonly: node.readonlyToken && + (node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword || + (0, node_utils_1.getTextForTokenKind)(node.readonlyToken.kind)), + typeAnnotation: node.type && this.convertChild(node.type), + }, 'typeParameter', "'constraint' and 'key'", this.convertChild(node.typeParameter))); + } + case SyntaxKind.ParenthesizedExpression: + return this.convertChild(node.expression, parent); + case SyntaxKind.TypeAliasDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration, + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + id: this.convertChild(node.name), + typeAnnotation: this.convertChild(node.type), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + return this.fixExports(node, result); + } + case SyntaxKind.MethodSignature: { + return this.convertMethodSignature(node); + } + case SyntaxKind.PropertySignature: { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const { initializer } = node; + if (initializer) { + this.#throwError(initializer, 'A property signature cannot have an initializer.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSPropertySignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + optional: (0, node_utils_1.isOptional)(node), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + }); + } + case SyntaxKind.IndexSignature: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIndexSignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + parameters: node.parameters.map(el => this.convertChild(el)), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + }); + } + case SyntaxKind.ConstructorType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSConstructorType, + abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + case SyntaxKind.FunctionType: { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const { modifiers } = node; + if (modifiers) { + this.#throwError(modifiers[0], 'A function type cannot have modifiers.'); + } + } + // intentional fallthrough + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallSignature: { + const type = node.kind === SyntaxKind.ConstructSignature + ? ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration + : node.kind === SyntaxKind.CallSignature + ? ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration + : ts_estree_1.AST_NODE_TYPES.TSFunctionType; + return this.createNode(node, { + type, + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + case SyntaxKind.ExpressionWithTypeArguments: { + const parentKind = parent.kind; + const type = parentKind === SyntaxKind.InterfaceDeclaration + ? ts_estree_1.AST_NODE_TYPES.TSInterfaceHeritage + : parentKind === SyntaxKind.HeritageClause + ? ts_estree_1.AST_NODE_TYPES.TSClassImplements + : ts_estree_1.AST_NODE_TYPES.TSInstantiationExpression; + return this.createNode(node, { + type, + expression: this.convertChild(node.expression), + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + }); + } + case SyntaxKind.InterfaceDeclaration: { + const interfaceHeritageClauses = node.heritageClauses ?? []; + const interfaceExtends = []; + for (const heritageClause of interfaceHeritageClauses) { + if (heritageClause.token !== SyntaxKind.ExtendsKeyword) { + this.#throwError(heritageClause, heritageClause.token === SyntaxKind.ImplementsKeyword + ? "Interface declaration cannot have 'implements' clause." + : 'Unexpected token.'); + } + for (const heritageType of heritageClause.types) { + interfaceExtends.push(this.convertChild(heritageType, node)); + } + } + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration, + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInterfaceBody, + range: [node.members.pos - 1, node.end], + body: node.members.map(member => this.convertChild(member)), + }), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + extends: interfaceExtends, + id: this.convertChild(node.name), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + return this.fixExports(node, result); + } + case SyntaxKind.TypePredicate: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypePredicate, + asserts: node.assertsModifier != null, + parameterName: this.convertChild(node.parameterName), + typeAnnotation: null, + }); + /** + * Specific fix for type-guard location data + */ + if (node.type) { + result.typeAnnotation = this.convertTypeAnnotation(node.type, node); + result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; + result.typeAnnotation.range = + result.typeAnnotation.typeAnnotation.range; + } + return result; + } + case SyntaxKind.ImportType: { + const range = (0, node_utils_1.getRange)(node, this.ast); + if (node.isTypeOf) { + const token = (0, node_utils_1.findNextToken)(node.getFirstToken(), node, this.ast); + range[0] = token.getStart(this.ast); + } + let options = null; + if (node.attributes) { + const value = this.createNode(node.attributes, { + type: ts_estree_1.AST_NODE_TYPES.ObjectExpression, + properties: node.attributes.elements.map(importAttribute => this.createNode(importAttribute, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: false, + key: this.convertChild(importAttribute.name), + kind: 'init', + method: false, + optional: false, + shorthand: false, + value: this.convertChild(importAttribute.value), + })), + }); + const commaToken = (0, node_utils_1.findNextToken)(node.argument, node, this.ast); + const openBraceToken = (0, node_utils_1.findNextToken)(commaToken, node, this.ast); + const closeBraceToken = (0, node_utils_1.findNextToken)(node.attributes, node, this.ast); + const withToken = (0, node_utils_1.findNextToken)(openBraceToken, node, this.ast); + const withTokenRange = (0, node_utils_1.getRange)(withToken, this.ast); + options = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectExpression, + range: [openBraceToken.getStart(this.ast), closeBraceToken.end], + properties: [ + this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + range: [withTokenRange[0], node.attributes.end], + computed: false, + key: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + range: withTokenRange, + decorators: [], + name: 'with', + optional: false, + typeAnnotation: undefined, + }), + kind: 'init', + method: false, + optional: false, + shorthand: false, + value, + }), + ], + }); + } + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSImportType, + range, + argument: this.convertChild(node.argument), + options, + qualifier: this.convertChild(node.qualifier), + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) + : null, + }); + if (node.isTypeOf) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery, + exprName: result, + typeArguments: undefined, + }); + } + return result; + } + case SyntaxKind.EnumDeclaration: { + const members = node.members.map(el => this.convertChild(el)); + const result = this.createNode(node, this.#withDeprecatedGetter({ + type: ts_estree_1.AST_NODE_TYPES.TSEnumDeclaration, + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSEnumBody, + range: [node.members.pos - 1, node.end], + members, + }), + const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + id: this.convertChild(node.name), + }, 'members', `'body.members'`, node.members.map(el => this.convertChild(el)))); + return this.fixExports(node, result); + } + case SyntaxKind.EnumMember: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSEnumMember, + computed: node.name.kind === ts.SyntaxKind.ComputedPropertyName, + id: this.convertChild(node.name), + initializer: node.initializer && this.convertChild(node.initializer), + }); + } + case SyntaxKind.ModuleDeclaration: { + let isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration, + ...(() => { + // the constraints checked by this function are syntactically enforced by TS + // the checks mostly exist for type's sake + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + const id = this.convertChild(node.name); + const body = this.convertChild(node.body); + if (body == null || + body.type === ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration) { + this.#throwUnlessAllowInvalidAST(node.body ?? node, 'Expected a valid module body'); + } + if (id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) { + this.#throwUnlessAllowInvalidAST(node.name, 'global module augmentation must have an Identifier id'); + } + return { + body: body, + declare: false, + global: false, + id, + kind: 'global', + }; + } + if (ts.isStringLiteral(node.name)) { + const body = this.convertChild(node.body); + return { + kind: 'module', + ...(body != null ? { body } : {}), + declare: false, + global: false, + id: this.convertChild(node.name), + }; + } + // Nested module declarations are stored in TypeScript as nested tree nodes. + // We "unravel" them here by making our own nested TSQualifiedName, + // with the innermost node's body as the actual node body. + if (node.body == null) { + this.#throwUnlessAllowInvalidAST(node, 'Expected a module body'); + } + if (node.name.kind !== ts.SyntaxKind.Identifier) { + this.#throwUnlessAllowInvalidAST(node.name, '`namespace`s must have an Identifier id'); + } + let name = this.createNode(node.name, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + range: [node.name.getStart(this.ast), node.name.getEnd()], + decorators: [], + name: node.name.text, + optional: false, + typeAnnotation: undefined, + }); + while (node.body && + ts.isModuleDeclaration(node.body) && + node.body.name) { + node = node.body; + isDeclare ||= (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const nextName = node.name; + const right = this.createNode(nextName, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + range: [nextName.getStart(this.ast), nextName.getEnd()], + decorators: [], + name: nextName.text, + optional: false, + typeAnnotation: undefined, + }); + name = this.createNode(nextName, { + type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName, + range: [name.range[0], right.range[1]], + left: name, + right, + }); + } + return { + body: this.convertChild(node.body), + declare: false, + global: false, + id: name, + kind: node.flags & ts.NodeFlags.Namespace ? 'namespace' : 'module', + }; + })(), + }); + result.declare = isDeclare; + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + // eslint-disable-next-line @typescript-eslint/no-deprecated + result.global = true; + } + return this.fixExports(node, result); + } + // TypeScript specific types + case SyntaxKind.ParenthesizedType: { + return this.convertChild(node.type); + } + case SyntaxKind.UnionType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSUnionType, + types: node.types.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.IntersectionType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIntersectionType, + types: node.types.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.AsExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSAsExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + case SyntaxKind.InferType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInferType, + typeParameter: this.convertChild(node.typeParameter), + }); + } + case SyntaxKind.LiteralType: { + if (node.literal.kind === SyntaxKind.NullKeyword) { + // 4.0 started nesting null types inside a LiteralType node + // but our AST is designed around the old way of null being a keyword + return this.createNode(node.literal, { + type: ts_estree_1.AST_NODE_TYPES.TSNullKeyword, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSLiteralType, + literal: this.convertChild(node.literal), + }); + } + case SyntaxKind.TypeAssertionExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAssertion, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + case SyntaxKind.ImportEqualsDeclaration: { + return this.fixExports(node, this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSImportEqualsDeclaration, + id: this.convertChild(node.name), + importKind: node.isTypeOnly ? 'type' : 'value', + moduleReference: this.convertChild(node.moduleReference), + })); + } + case SyntaxKind.ExternalModuleReference: { + if (node.expression.kind !== SyntaxKind.StringLiteral) { + this.#throwError(node.expression, 'String literal expected.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSExternalModuleReference, + expression: this.convertChild(node.expression), + }); + } + case SyntaxKind.NamespaceExportDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNamespaceExportDeclaration, + id: this.convertChild(node.name), + }); + } + case SyntaxKind.AbstractKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSAbstractKeyword, + }); + } + // Tuple + case SyntaxKind.TupleType: { + const elementTypes = node.elements.map(el => this.convertChild(el)); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTupleType, + elementTypes, + }); + } + case SyntaxKind.NamedTupleMember: { + const member = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNamedTupleMember, + elementType: this.convertChild(node.type, node), + label: this.convertChild(node.name, node), + optional: node.questionToken != null, + }); + if (node.dotDotDotToken) { + // adjust the start to account for the "..." + member.range[0] = member.label.range[0]; + member.loc.start = member.label.loc.start; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSRestType, + typeAnnotation: member, + }); + } + return member; + } + case SyntaxKind.OptionalType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSOptionalType, + typeAnnotation: this.convertChild(node.type), + }); + } + case SyntaxKind.RestType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSRestType, + typeAnnotation: this.convertChild(node.type), + }); + } + // Template Literal Types + case SyntaxKind.TemplateLiteralType: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTemplateLiteralType, + quasis: [this.convertChild(node.head)], + types: [], + }); + node.templateSpans.forEach(templateSpan => { + result.types.push(this.convertChild(templateSpan.type)); + result.quasis.push(this.convertChild(templateSpan.literal)); + }); + return result; + } + case SyntaxKind.ClassStaticBlockDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.StaticBlock, + body: this.convertBodyExpressions(node.body.statements, node), + }); + } + // eslint-disable-next-line @typescript-eslint/no-deprecated + case SyntaxKind.AssertEntry: + case SyntaxKind.ImportAttribute: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportAttribute, + key: this.convertChild(node.name), + value: this.convertChild(node.value), + }); + } + case SyntaxKind.SatisfiesExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSSatisfiesExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + default: + return this.deeplyCopy(node); + } + } + createNode(node, data) { + const result = data; + result.range ??= (0, node_utils_1.getRange)(node, this.ast); + result.loc ??= (0, node_utils_1.getLocFor)(result.range, this.ast); + if (result && this.options.shouldPreserveNodeMaps) { + this.esTreeNodeToTSNodeMap.set(result, node); + } + return result; + } + convertProgram() { + return this.converter(this.ast); + } + /** + * For nodes that are copied directly from the TypeScript AST into + * ESTree mostly as-is. The only difference is the addition of a type + * property instead of a kind property. Recursively copies all children. + */ + deeplyCopy(node) { + if (node.kind === ts.SyntaxKind.JSDocFunctionType) { + this.#throwError(node, 'JSDoc types can only be used inside documentation comments.'); + } + const customType = `TS${SyntaxKind[node.kind]}`; + /** + * If the "errorOnUnknownASTType" option is set to true, throw an error, + * otherwise fallback to just including the unknown type as-is. + */ + if (this.options.errorOnUnknownASTType && !ts_estree_1.AST_NODE_TYPES[customType]) { + throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`); + } + const result = this.createNode(node, { + type: customType, + }); + if ('type' in node) { + result.typeAnnotation = + node.type && 'kind' in node.type && ts.isTypeNode(node.type) + ? this.convertTypeAnnotation(node.type, node) + : null; + } + if ('typeArguments' in node) { + result.typeArguments = + node.typeArguments && 'pos' in node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) + : null; + } + if ('typeParameters' in node) { + result.typeParameters = + node.typeParameters && 'pos' in node.typeParameters + ? this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters) + : null; + } + const decorators = (0, getModifiers_1.getDecorators)(node); + if (decorators?.length) { + result.decorators = decorators.map(el => this.convertChild(el)); + } + // keys we never want to clone from the base typescript node as they + // introduce garbage into our AST + const KEYS_TO_NOT_COPY = new Set([ + '_children', + 'decorators', + 'end', + 'flags', + 'heritageClauses', + 'illegalDecorators', + 'jsDoc', + 'kind', + 'locals', + 'localSymbol', + 'modifierFlagsCache', + 'modifiers', + 'nextContainer', + 'parent', + 'pos', + 'symbol', + 'transformFlags', + 'type', + 'typeArguments', + 'typeParameters', + ]); + Object.entries(node) + .filter(([key]) => !KEYS_TO_NOT_COPY.has(key)) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + result[key] = value.map(el => this.convertChild(el)); + } + else if (value && typeof value === 'object' && value.kind) { + // need to check node[key].kind to ensure we don't try to convert a symbol + result[key] = this.convertChild(value); + } + else { + result[key] = value; + } + }); + return result; + } + /** + * Fixes the exports of the given ts.Node + * @returns the ESTreeNode with fixed exports + */ + fixExports(node, result) { + const isNamespaceNode = ts.isModuleDeclaration(node) && !ts.isStringLiteral(node.name); + const modifiers = isNamespaceNode + ? (0, node_utils_1.getNamespaceModifiers)(node) + : (0, getModifiers_1.getModifiers)(node); + if (modifiers?.[0].kind === SyntaxKind.ExportKeyword) { + /** + * Make sure that original node is registered instead of export + */ + this.registerTSNodeInNodeMap(node, result); + const exportKeyword = modifiers[0]; + const nextModifier = modifiers[1]; + const declarationIsDefault = nextModifier?.kind === SyntaxKind.DefaultKeyword; + const varToken = declarationIsDefault + ? (0, node_utils_1.findNextToken)(nextModifier, this.ast, this.ast) + : (0, node_utils_1.findNextToken)(exportKeyword, this.ast, this.ast); + result.range[0] = varToken.getStart(this.ast); + result.loc = (0, node_utils_1.getLocFor)(result.range, this.ast); + if (declarationIsDefault) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration, + range: [exportKeyword.getStart(this.ast), result.range[1]], + declaration: result, + exportKind: 'value', + }); + } + const isType = result.type === ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration || + result.type === ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration; + const isDeclare = 'declare' in result && result.declare; + return this.createNode(node, + // @ts-expect-error - TODO, narrow the types here + this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration, + range: [exportKeyword.getStart(this.ast), result.range[1]], + attributes: [], + declaration: result, + exportKind: isType || isDeclare ? 'type' : 'value', + source: null, + specifiers: [], + }, 'assertions', 'attributes', true)); + } + return result; + } + getASTMaps() { + return { + esTreeNodeToTSNodeMap: this.esTreeNodeToTSNodeMap, + tsNodeToESTreeNodeMap: this.tsNodeToESTreeNodeMap, + }; + } + /** + * Register specific TypeScript node into map with first ESTree node provided + */ + registerTSNodeInNodeMap(node, result) { + if (result && + this.options.shouldPreserveNodeMaps && + !this.tsNodeToESTreeNodeMap.has(node)) { + this.tsNodeToESTreeNodeMap.set(node, result); + } + } +} +exports.Converter = Converter; diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts.map new file mode 100644 index 0000000..41de9ea --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"WatchCompilerHostOfConfigFile.d.ts","sourceRoot":"","sources":["../../src/create-program/WatchCompilerHostOfConfigFile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAGtC,UAAU,sBAAsB;IAC9B,aAAa,CAAC,CACZ,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,EAC3B,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,EAAE,CAAC;CACb;AAGD,UAAU,4BAA6B,SAAQ,sBAAsB;IACnE,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,EAC3B,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,EAAE,CAAC;CACb;AAGD,MAAM,WAAW,6BAA6B,CAAC,CAAC,SAAS,EAAE,CAAC,cAAc,CACxE,SAAQ,EAAE,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC3C,mBAAmB,CAAC,EAAE,SAAS,EAAE,CAAC,iBAAiB,EAAE,CAAC;IACtD,oCAAoC,CAClC,IAAI,EAAE,4BAA4B,GACjC,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js new file mode 100644 index 0000000..3cbc898 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js @@ -0,0 +1,5 @@ +"use strict"; +// These types are internal to TS. +// They have been trimmed down to only include the relevant bits +// We use some special internal TS apis to help us do our parsing flexibly +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map new file mode 100644 index 0000000..a642dd6 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createIsolatedProgram.d.ts","sourceRoot":"","sources":["../../src/create-program/createIsolatedProgram.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAStD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,aAAa,GAC3B,qBAAqB,CAoEvB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js new file mode 100644 index 0000000..85fb0b0 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js @@ -0,0 +1,96 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createIsolatedProgram = createIsolatedProgram; +const debug_1 = __importDefault(require("debug")); +const ts = __importStar(require("typescript")); +const getScriptKind_1 = require("./getScriptKind"); +const shared_1 = require("./shared"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:createIsolatedProgram'); +/** + * @returns Returns a new source file and program corresponding to the linted code + */ +function createIsolatedProgram(parseSettings) { + log('Getting isolated program in %s mode for: %s', parseSettings.jsx ? 'TSX' : 'TS', parseSettings.filePath); + const compilerHost = { + fileExists() { + return true; + }, + getCanonicalFileName() { + return parseSettings.filePath; + }, + getCurrentDirectory() { + return ''; + }, + getDefaultLibFileName() { + return 'lib.d.ts'; + }, + getDirectories() { + return []; + }, + // TODO: Support Windows CRLF + getNewLine() { + return '\n'; + }, + getSourceFile(filename) { + return ts.createSourceFile(filename, parseSettings.codeFullText, ts.ScriptTarget.Latest, + /* setParentNodes */ true, (0, getScriptKind_1.getScriptKind)(parseSettings.filePath, parseSettings.jsx)); + }, + readFile() { + return undefined; + }, + useCaseSensitiveFileNames() { + return true; + }, + writeFile() { + return null; + }, + }; + const program = ts.createProgram([parseSettings.filePath], { + jsDocParsingMode: parseSettings.jsDocParsingMode, + jsx: parseSettings.jsx ? ts.JsxEmit.Preserve : undefined, + noResolve: true, + target: ts.ScriptTarget.Latest, + ...(0, shared_1.createDefaultCompilerOptionsFromExtra)(parseSettings), + }, compilerHost); + const ast = program.getSourceFile(parseSettings.filePath); + if (!ast) { + throw new Error('Expected an ast to be returned for the single-file isolated program.'); + } + return { ast, program }; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map new file mode 100644 index 0000000..3d03fa5 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createProjectProgram.d.ts","sourceRoot":"","sources":["../../src/create-program/createProjectProgram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAUtD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,GACzC,qBAAqB,CAcvB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js new file mode 100644 index 0000000..584e98b --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js @@ -0,0 +1,23 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createProjectProgram = createProjectProgram; +const debug_1 = __importDefault(require("debug")); +const node_utils_1 = require("../node-utils"); +const createProjectProgramError_1 = require("./createProjectProgramError"); +const shared_1 = require("./shared"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:createProjectProgram'); +/** + * @param parseSettings Internal settings for parsing the file + * @returns If found, the source file corresponding to the code and the containing program + */ +function createProjectProgram(parseSettings, programsForProjects) { + log('Creating project program for: %s', parseSettings.filePath); + const astAndProgram = (0, node_utils_1.firstDefined)(programsForProjects, currentProgram => (0, shared_1.getAstFromProgram)(currentProgram, parseSettings.filePath)); + if (!astAndProgram) { + throw new Error((0, createProjectProgramError_1.createProjectProgramError)(parseSettings, programsForProjects).join('\n')); + } + return astAndProgram; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.d.ts.map new file mode 100644 index 0000000..104141e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createProjectProgramError.d.ts","sourceRoot":"","sources":["../../src/create-program/createProjectProgramError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKtD,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,GACzC,MAAM,EAAE,CAUV"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.js new file mode 100644 index 0000000..f8e6099 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.js @@ -0,0 +1,74 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createProjectProgramError = createProjectProgramError; +const node_path_1 = __importDefault(require("node:path")); +const describeFilePath_1 = require("./describeFilePath"); +const shared_1 = require("./shared"); +function createProjectProgramError(parseSettings, programsForProjects) { + const describedFilePath = (0, describeFilePath_1.describeFilePath)(parseSettings.filePath, parseSettings.tsconfigRootDir); + return [ + getErrorStart(describedFilePath, parseSettings), + ...getErrorDetails(describedFilePath, parseSettings, programsForProjects), + ]; +} +function getErrorStart(describedFilePath, parseSettings) { + const relativeProjects = [...parseSettings.projects.values()].map(projectFile => (0, describeFilePath_1.describeFilePath)(projectFile, parseSettings.tsconfigRootDir)); + const describedPrograms = relativeProjects.length === 1 + ? ` ${relativeProjects[0]}` + : `\n${relativeProjects.map(project => `- ${project}`).join('\n')}`; + return `ESLint was configured to run on \`${describedFilePath}\` using \`parserOptions.project\`:${describedPrograms}`; +} +function getErrorDetails(describedFilePath, parseSettings, programsForProjects) { + if (programsForProjects.length === 1 && + programsForProjects[0].getProjectReferences()?.length) { + return [ + `That TSConfig uses project "references" and doesn't include \`${describedFilePath}\` directly, which is not supported by \`parserOptions.project\`.`, + `Either:`, + `- Switch to \`parserOptions.projectService\``, + `- Use an ESLint-specific TSConfig`, + `See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#are-typescript-project-references-supported`, + ]; + } + const { extraFileExtensions } = parseSettings; + const details = []; + for (const extraExtension of extraFileExtensions) { + if (!extraExtension.startsWith('.')) { + details.push(`Found unexpected extension \`${extraExtension}\` specified with the \`parserOptions.extraFileExtensions\` option. Did you mean \`.${extraExtension}\`?`); + } + if (shared_1.DEFAULT_EXTRA_FILE_EXTENSIONS.has(extraExtension)) { + details.push(`You unnecessarily included the extension \`${extraExtension}\` with the \`parserOptions.extraFileExtensions\` option. This extension is already handled by the parser by default.`); + } + } + const fileExtension = node_path_1.default.extname(parseSettings.filePath); + if (!shared_1.DEFAULT_EXTRA_FILE_EXTENSIONS.has(fileExtension)) { + const nonStandardExt = `The extension for the file (\`${fileExtension}\`) is non-standard`; + if (extraFileExtensions.length > 0) { + if (!extraFileExtensions.includes(fileExtension)) { + return [ + ...details, + `${nonStandardExt}. It should be added to your existing \`parserOptions.extraFileExtensions\`.`, + ]; + } + } + else { + return [ + ...details, + `${nonStandardExt}. You should add \`parserOptions.extraFileExtensions\` to your config.`, + ]; + } + } + const [describedInclusions, describedSpecifiers] = parseSettings.projects.size === 1 + ? ['that TSConfig does not', 'that TSConfig'] + : ['none of those TSConfigs', 'one of those TSConfigs']; + return [ + ...details, + `However, ${describedInclusions} include this file. Either:`, + `- Change ESLint's list of included files to not include this file`, + `- Change ${describedSpecifiers} to include this file`, + `- Create a new TSConfig that includes this file and include it in your parserOptions.project`, + `See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file`, + ]; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.d.ts.map new file mode 100644 index 0000000..fd3eab8 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createProjectService.d.ts","sourceRoot":"","sources":["../../src/create-program/createProjectService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAI1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AA6B/D,MAAM,MAAM,wBAAwB,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC,mBAAmB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC1C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mCAAmC,EAAE,MAAM,CAAC;IAC5C,OAAO,EAAE,wBAAwB,CAAC;CACnC;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,OAAO,GAAG,qBAAqB,GAAG,SAAS,EACvD,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,GAAG,SAAS,EACjD,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,sBAAsB,CAoIxB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.js new file mode 100644 index 0000000..6f3ae43 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.js @@ -0,0 +1,133 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createProjectService = createProjectService; +const debug_1 = __importDefault(require("debug")); +const getParsedConfigFile_1 = require("./getParsedConfigFile"); +const validateDefaultProjectForFilesGlob_1 = require("./validateDefaultProjectForFilesGlob"); +const DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD = 8; +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:createProjectService'); +const logTsserverErr = (0, debug_1.default)('typescript-eslint:typescript-estree:tsserver:err'); +const logTsserverInfo = (0, debug_1.default)('typescript-eslint:typescript-estree:tsserver:info'); +const logTsserverPerf = (0, debug_1.default)('typescript-eslint:typescript-estree:tsserver:perf'); +const logTsserverEvent = (0, debug_1.default)('typescript-eslint:typescript-estree:tsserver:event'); +const doNothing = () => { }; +const createStubFileWatcher = () => ({ + close: doNothing, +}); +function createProjectService(optionsRaw, jsDocParsingMode, tsconfigRootDir) { + const optionsRawObject = typeof optionsRaw === 'object' ? optionsRaw : {}; + const options = { + defaultProject: 'tsconfig.json', + ...optionsRawObject, + }; + (0, validateDefaultProjectForFilesGlob_1.validateDefaultProjectForFilesGlob)(options.allowDefaultProject); + // We import this lazily to avoid its cost for users who don't use the service + // TODO: Once we drop support for TS<5.3 we can import from "typescript" directly + // eslint-disable-next-line @typescript-eslint/no-require-imports + const tsserver = require('typescript/lib/tsserverlibrary'); + // TODO: see getWatchProgramsForProjects + // We don't watch the disk, we just refer to these when ESLint calls us + // there's a whole separate update pass in maybeInvalidateProgram at the bottom of getWatchProgramsForProjects + // (this "goes nuclear on TypeScript") + const system = { + ...tsserver.sys, + clearImmediate, + clearTimeout, + setImmediate, + setTimeout, + watchDirectory: createStubFileWatcher, + watchFile: createStubFileWatcher, + // We stop loading any TypeScript plugins by default, to prevent them from attaching disk watchers + // See https://github.com/typescript-eslint/typescript-eslint/issues/9905 + ...(!options.loadTypeScriptPlugins && { + require: () => ({ + error: { + message: 'TypeScript plugins are not required when using parserOptions.projectService.', + }, + module: undefined, + }), + }), + }; + const logger = { + close: doNothing, + endGroup: doNothing, + getLogFileName: () => undefined, + // The debug library doesn't use levels without creating a namespace for each. + // Log levels are not passed to the writer so we wouldn't be able to forward + // to a respective namespace. Supporting would require an additional flag for + // granular control. Defaulting to all levels for now. + hasLevel: () => true, + info(s) { + this.msg(s, tsserver.server.Msg.Info); + }, + loggingEnabled: () => + // if none of the debug namespaces are enabled, then don't enable logging in tsserver + logTsserverInfo.enabled || + logTsserverErr.enabled || + logTsserverPerf.enabled, + msg: (s, type) => { + switch (type) { + case tsserver.server.Msg.Err: + logTsserverErr(s); + break; + case tsserver.server.Msg.Perf: + logTsserverPerf(s); + break; + default: + logTsserverInfo(s); + } + }, + perftrc(s) { + this.msg(s, tsserver.server.Msg.Perf); + }, + startGroup: doNothing, + }; + log('Creating project service with: %o', options); + const service = new tsserver.server.ProjectService({ + cancellationToken: { isCancellationRequested: () => false }, + eventHandler: logTsserverEvent.enabled + ? (e) => { + logTsserverEvent(e); + } + : undefined, + host: system, + jsDocParsingMode, + logger, + session: undefined, + useInferredProjectPerProjectRoot: false, + useSingleInferredProject: false, + }); + service.setHostConfiguration({ + preferences: { + includePackageJsonAutoImports: 'off', + }, + }); + log('Enabling default project: %s', options.defaultProject); + let configFile; + try { + configFile = (0, getParsedConfigFile_1.getParsedConfigFile)(tsserver, options.defaultProject, tsconfigRootDir); + } + catch (error) { + if (optionsRawObject.defaultProject) { + throw new Error(`Could not read project service default project '${options.defaultProject}': ${error.message}`); + } + } + if (configFile) { + service.setCompilerOptionsForInferredProjects( + // NOTE: The inferred projects API is not intended for source files when a tsconfig + // exists. There is no API that generates an InferredProjectCompilerOptions suggesting + // it is meant for hard coded options passed in. Hard asserting as a work around. + // See https://github.com/microsoft/TypeScript/blob/27bcd4cb5a98bce46c9cdd749752703ead021a4b/src/server/protocol.ts#L1904 + configFile.options); + } + return { + allowDefaultProject: options.allowDefaultProject, + lastReloadTimestamp: performance.now(), + maximumDefaultProjectFileMatchCount: options.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING ?? + DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD, + service, + }; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map new file mode 100644 index 0000000..781e086 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createSourceFile.d.ts","sourceRoot":"","sources":["../../src/create-program/createSourceFile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,aAAa,GAAG,EAAE,CAAC,UAAU,CAoB5E;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,aAAa,GAAG,eAAe,CAK7E"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js new file mode 100644 index 0000000..2ec8646 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js @@ -0,0 +1,62 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createSourceFile = createSourceFile; +exports.createNoProgram = createNoProgram; +const debug_1 = __importDefault(require("debug")); +const ts = __importStar(require("typescript")); +const source_files_1 = require("../source-files"); +const getScriptKind_1 = require("./getScriptKind"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:createSourceFile'); +function createSourceFile(parseSettings) { + log('Getting AST without type information in %s mode for: %s', parseSettings.jsx ? 'TSX' : 'TS', parseSettings.filePath); + return (0, source_files_1.isSourceFile)(parseSettings.code) + ? parseSettings.code + : ts.createSourceFile(parseSettings.filePath, parseSettings.codeFullText, { + jsDocParsingMode: parseSettings.jsDocParsingMode, + languageVersion: ts.ScriptTarget.Latest, + setExternalModuleIndicator: parseSettings.setExternalModuleIndicator, + }, + /* setParentNodes */ true, (0, getScriptKind_1.getScriptKind)(parseSettings.filePath, parseSettings.jsx)); +} +function createNoProgram(parseSettings) { + return { + ast: createSourceFile(parseSettings), + program: null, + }; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.d.ts.map new file mode 100644 index 0000000..6d049be --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"describeFilePath.d.ts","sourceRoot":"","sources":["../../src/create-program/describeFilePath.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,MAAM,CAyBR"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js new file mode 100644 index 0000000..f84ab50 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js @@ -0,0 +1,30 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.describeFilePath = describeFilePath; +const node_path_1 = __importDefault(require("node:path")); +function describeFilePath(filePath, tsconfigRootDir) { + // If the TSConfig root dir is a parent of the filePath, use + // `` as a prefix for the path. + const relative = node_path_1.default.relative(tsconfigRootDir, filePath); + if (relative && !relative.startsWith('..') && !node_path_1.default.isAbsolute(relative)) { + return `/${relative}`; + } + // Root-like Mac/Linux (~/*, ~*) or Windows (C:/*, /) paths that aren't + // relative to the TSConfig root dir should be fully described. + // This avoids strings like /../../../../repo/file.ts. + // https://github.com/typescript-eslint/typescript-eslint/issues/6289 + if (/^[(\w+:)\\/~]/.test(filePath)) { + return filePath; + } + // Similarly, if the relative path would contain a lot of ../.., then + // ignore it and print the file path directly. + if (/\.\.[/\\]\.\./.test(relative)) { + return filePath; + } + // Lastly, since we've eliminated all special cases, we know the cleanest + // path to print is probably the prefixed relative one. + return `/${relative}`; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getParsedConfigFile.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getParsedConfigFile.d.ts.map new file mode 100644 index 0000000..0b7cb3c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getParsedConfigFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getParsedConfigFile.d.ts","sourceRoot":"","sources":["../../src/create-program/getParsedConfigFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAO1D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,gBAAgB,CAAC,EAAE,MAAM,GACxB,EAAE,CAAC,iBAAiB,CA6CtB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getParsedConfigFile.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getParsedConfigFile.js new file mode 100644 index 0000000..994a4bf --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getParsedConfigFile.js @@ -0,0 +1,76 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getParsedConfigFile = getParsedConfigFile; +const fs = __importStar(require("node:fs")); +const path = __importStar(require("node:path")); +const shared_1 = require("./shared"); +/** + * Utility offered by parser to help consumers parse a config file. + * + * @param configFile the path to the tsconfig.json file, relative to `projectDirectory` + * @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()` + */ +function getParsedConfigFile(tsserver, configFile, projectDirectory) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/internal/eqeq-nullish + if (tsserver.sys === undefined) { + throw new Error('`getParsedConfigFile` is only supported in a Node-like environment.'); + } + const parsed = tsserver.getParsedCommandLineOfConfigFile(configFile, shared_1.CORE_COMPILER_OPTIONS, { + fileExists: fs.existsSync, + getCurrentDirectory, + onUnRecoverableConfigFileDiagnostic: diag => { + throw new Error(formatDiagnostics([diag])); // ensures that `parsed` is defined. + }, + readDirectory: tsserver.sys.readDirectory, + readFile: file => fs.readFileSync(path.isAbsolute(file) ? file : path.join(getCurrentDirectory(), file), 'utf-8'), + useCaseSensitiveFileNames: tsserver.sys.useCaseSensitiveFileNames, + }); + if (parsed?.errors.length) { + throw new Error(formatDiagnostics(parsed.errors)); + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return parsed; + function getCurrentDirectory() { + return projectDirectory ? path.resolve(projectDirectory) : process.cwd(); + } + function formatDiagnostics(diagnostics) { + return tsserver.formatDiagnostics(diagnostics, { + getCanonicalFileName: f => f, + getCurrentDirectory, + getNewLine: () => '\n', + }); + } +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts.map new file mode 100644 index 0000000..787037c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getScriptKind.d.ts","sourceRoot":"","sources":["../../src/create-program/getScriptKind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,EAAE,CAAC,UAAU,CA8B3E;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,EAAE,CAAC,UAAU,GACxB,EAAE,CAAC,eAAe,CAYpB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js new file mode 100644 index 0000000..6c948b5 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js @@ -0,0 +1,80 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getScriptKind = getScriptKind; +exports.getLanguageVariant = getLanguageVariant; +const node_path_1 = __importDefault(require("node:path")); +const ts = __importStar(require("typescript")); +function getScriptKind(filePath, jsx) { + const extension = node_path_1.default.extname(filePath).toLowerCase(); + // note - we only respect the user's jsx setting for unknown extensions + // this is so that we always match TS's internal script kind logic, preventing + // weird errors due to a mismatch. + // https://github.com/microsoft/TypeScript/blob/da00ba67ed1182ad334f7c713b8254fba174aeba/src/compiler/utilities.ts#L6948-L6968 + switch (extension) { + case ts.Extension.Cjs: + case ts.Extension.Js: + case ts.Extension.Mjs: + return ts.ScriptKind.JS; + case ts.Extension.Cts: + case ts.Extension.Mts: + case ts.Extension.Ts: + return ts.ScriptKind.TS; + case ts.Extension.Json: + return ts.ScriptKind.JSON; + case ts.Extension.Jsx: + return ts.ScriptKind.JSX; + case ts.Extension.Tsx: + return ts.ScriptKind.TSX; + default: + // unknown extension, force typescript to ignore the file extension, and respect the user's setting + return jsx ? ts.ScriptKind.TSX : ts.ScriptKind.TS; + } +} +function getLanguageVariant(scriptKind) { + // https://github.com/microsoft/TypeScript/blob/d6e483b8dabd8fd37c00954c3f2184bb7f1eb90c/src/compiler/utilities.ts#L6281-L6285 + switch (scriptKind) { + case ts.ScriptKind.JS: + case ts.ScriptKind.JSON: + case ts.ScriptKind.JSX: + case ts.ScriptKind.TSX: + return ts.LanguageVariant.JSX; + default: + return ts.LanguageVariant.Standard; + } +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.d.ts.map new file mode 100644 index 0000000..a3eae89 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getWatchProgramsForProjects.d.ts","sourceRoot":"","sources":["../../src/create-program/getWatchProgramsForProjects.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAiDtD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAOvC;AA4DD;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,aAAa,GAC3B,EAAE,CAAC,OAAO,EAAE,CA8Gd"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js new file mode 100644 index 0000000..1979990 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js @@ -0,0 +1,380 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearWatchCaches = clearWatchCaches; +exports.getWatchProgramsForProjects = getWatchProgramsForProjects; +const debug_1 = __importDefault(require("debug")); +const node_fs_1 = __importDefault(require("node:fs")); +const ts = __importStar(require("typescript")); +const source_files_1 = require("../source-files"); +const shared_1 = require("./shared"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:getWatchProgramsForProjects'); +/** + * Maps tsconfig paths to their corresponding file contents and resulting watches + */ +const knownWatchProgramMap = new Map(); +/** + * Maps file/folder paths to their set of corresponding watch callbacks + * There may be more than one per file/folder if a file/folder is shared between projects + */ +const fileWatchCallbackTrackingMap = new Map(); +const folderWatchCallbackTrackingMap = new Map(); +/** + * Stores the list of known files for each program + */ +const programFileListCache = new Map(); +/** + * Caches the last modified time of the tsconfig files + */ +const tsconfigLastModifiedTimestampCache = new Map(); +const parsedFilesSeenHash = new Map(); +/** + * Clear all of the parser caches. + * This should only be used in testing to ensure the parser is clean between tests. + */ +function clearWatchCaches() { + knownWatchProgramMap.clear(); + fileWatchCallbackTrackingMap.clear(); + folderWatchCallbackTrackingMap.clear(); + parsedFilesSeenHash.clear(); + programFileListCache.clear(); + tsconfigLastModifiedTimestampCache.clear(); +} +function saveWatchCallback(trackingMap) { + return (fileName, callback) => { + const normalizedFileName = (0, shared_1.getCanonicalFileName)(fileName); + const watchers = (() => { + let watchers = trackingMap.get(normalizedFileName); + if (!watchers) { + watchers = new Set(); + trackingMap.set(normalizedFileName, watchers); + } + return watchers; + })(); + watchers.add(callback); + return { + close: () => { + watchers.delete(callback); + }, + }; + }; +} +/** + * Holds information about the file currently being linted + */ +const currentLintOperationState = { + code: '', + filePath: '', +}; +/** + * Appropriately report issues found when reading a config file + * @param diagnostic The diagnostic raised when creating a program + */ +function diagnosticReporter(diagnostic) { + throw new Error(ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine)); +} +function updateCachedFileList(tsconfigPath, program) { + const fileList = new Set(program.getRootFileNames().map(f => (0, shared_1.getCanonicalFileName)(f))); + programFileListCache.set(tsconfigPath, fileList); + return fileList; +} +/** + * Calculate project environments using options provided by consumer and paths from config + * @param parseSettings Internal settings for parsing the file + * @returns The programs corresponding to the supplied tsconfig paths + */ +function getWatchProgramsForProjects(parseSettings) { + const filePath = (0, shared_1.getCanonicalFileName)(parseSettings.filePath); + const results = []; + // preserve reference to code and file being linted + currentLintOperationState.code = parseSettings.code; + currentLintOperationState.filePath = filePath; + // Update file version if necessary + const fileWatchCallbacks = fileWatchCallbackTrackingMap.get(filePath); + const codeHash = (0, shared_1.createHash)((0, source_files_1.getCodeText)(parseSettings.code)); + if (parsedFilesSeenHash.get(filePath) !== codeHash && + fileWatchCallbacks && + fileWatchCallbacks.size > 0) { + fileWatchCallbacks.forEach(cb => cb(filePath, ts.FileWatcherEventKind.Changed)); + } + const currentProjectsFromSettings = new Map(parseSettings.projects); + /* + * before we go into the process of attempting to find and update every program + * see if we know of a program that contains this file + */ + for (const [tsconfigPath, existingWatch] of knownWatchProgramMap.entries()) { + if (!currentProjectsFromSettings.has(tsconfigPath)) { + // the current parser run doesn't specify this tsconfig in parserOptions.project + // so we don't want to consider it for caching purposes. + // + // if we did consider it we might return a program for a project + // that wasn't specified in the current parser run (which is obv bad!). + continue; + } + let fileList = programFileListCache.get(tsconfigPath); + let updatedProgram = null; + if (!fileList) { + updatedProgram = existingWatch.getProgram().getProgram(); + fileList = updateCachedFileList(tsconfigPath, updatedProgram); + } + if (fileList.has(filePath)) { + log('Found existing program for file. %s', filePath); + updatedProgram ??= existingWatch.getProgram().getProgram(); + // sets parent pointers in source files + updatedProgram.getTypeChecker(); + return [updatedProgram]; + } + } + log('File did not belong to any existing programs, moving to create/update. %s', filePath); + /* + * We don't know of a program that contains the file, this means that either: + * - the required program hasn't been created yet, or + * - the file is new/renamed, and the program hasn't been updated. + */ + for (const tsconfigPath of parseSettings.projects) { + const existingWatch = knownWatchProgramMap.get(tsconfigPath[0]); + if (existingWatch) { + const updatedProgram = maybeInvalidateProgram(existingWatch, filePath, tsconfigPath[0]); + if (!updatedProgram) { + continue; + } + // sets parent pointers in source files + updatedProgram.getTypeChecker(); + // cache and check the file list + const fileList = updateCachedFileList(tsconfigPath[0], updatedProgram); + if (fileList.has(filePath)) { + log('Found updated program for file. %s', filePath); + // we can return early because we know this program contains the file + return [updatedProgram]; + } + results.push(updatedProgram); + continue; + } + const programWatch = createWatchProgram(tsconfigPath[1], parseSettings); + knownWatchProgramMap.set(tsconfigPath[0], programWatch); + const program = programWatch.getProgram().getProgram(); + // sets parent pointers in source files + program.getTypeChecker(); + // cache and check the file list + const fileList = updateCachedFileList(tsconfigPath[0], program); + if (fileList.has(filePath)) { + log('Found program for file. %s', filePath); + // we can return early because we know this program contains the file + return [program]; + } + results.push(program); + } + return results; +} +function createWatchProgram(tsconfigPath, parseSettings) { + log('Creating watch program for %s.', tsconfigPath); + // create compiler host + const watchCompilerHost = ts.createWatchCompilerHost(tsconfigPath, (0, shared_1.createDefaultCompilerOptionsFromExtra)(parseSettings), ts.sys, ts.createAbstractBuilder, diagnosticReporter, + // TODO: file issue on TypeScript to suggest making optional? + // eslint-disable-next-line @typescript-eslint/no-empty-function + /*reportWatchStatus*/ () => { }); + watchCompilerHost.jsDocParsingMode = parseSettings.jsDocParsingMode; + // ensure readFile reads the code being linted instead of the copy on disk + const oldReadFile = watchCompilerHost.readFile; + watchCompilerHost.readFile = (filePathIn, encoding) => { + const filePath = (0, shared_1.getCanonicalFileName)(filePathIn); + const fileContent = filePath === currentLintOperationState.filePath + ? (0, source_files_1.getCodeText)(currentLintOperationState.code) + : oldReadFile(filePath, encoding); + if (fileContent != null) { + parsedFilesSeenHash.set(filePath, (0, shared_1.createHash)(fileContent)); + } + return fileContent; + }; + // ensure process reports error on failure instead of exiting process immediately + watchCompilerHost.onUnRecoverableConfigFileDiagnostic = diagnosticReporter; + // ensure process doesn't emit programs + watchCompilerHost.afterProgramCreate = (program) => { + // report error if there are any errors in the config file + const configFileDiagnostics = program + .getConfigFileParsingDiagnostics() + .filter(diag => diag.category === ts.DiagnosticCategory.Error && diag.code !== 18003); + if (configFileDiagnostics.length > 0) { + diagnosticReporter(configFileDiagnostics[0]); + } + }; + /* + * From the CLI, the file watchers won't matter, as the files will be parsed once and then forgotten. + * When running from an IDE, these watchers will let us tell typescript about changes. + * + * ESLint IDE plugins will send us unfinished file content as the user types (before it's saved to disk). + * We use the file watchers to tell typescript about this latest file content. + * + * When files are created (or renamed), we won't know about them because we have no filesystem watchers attached. + * We use the folder watchers to tell typescript it needs to go and find new files in the project folders. + */ + watchCompilerHost.watchFile = saveWatchCallback(fileWatchCallbackTrackingMap); + watchCompilerHost.watchDirectory = saveWatchCallback(folderWatchCallbackTrackingMap); + // allow files with custom extensions to be included in program (uses internal ts api) + const oldOnDirectoryStructureHostCreate = watchCompilerHost.onCachedDirectoryStructureHostCreate; + watchCompilerHost.onCachedDirectoryStructureHostCreate = (host) => { + const oldReadDirectory = host.readDirectory; + host.readDirectory = (path, extensions, exclude, include, depth) => oldReadDirectory(path, !extensions + ? undefined + : [...extensions, ...parseSettings.extraFileExtensions], exclude, include, depth); + oldOnDirectoryStructureHostCreate(host); + }; + // This works only on 3.9 + watchCompilerHost.extraFileExtensions = parseSettings.extraFileExtensions.map(extension => ({ + extension, + isMixedContent: true, + scriptKind: ts.ScriptKind.Deferred, + })); + watchCompilerHost.trace = log; + // Since we don't want to asynchronously update program we want to disable timeout methods + // So any changes in the program will be delayed and updated when getProgram is called on watch + watchCompilerHost.setTimeout = undefined; + watchCompilerHost.clearTimeout = undefined; + return ts.createWatchProgram(watchCompilerHost); +} +function hasTSConfigChanged(tsconfigPath) { + const stat = node_fs_1.default.statSync(tsconfigPath); + const lastModifiedAt = stat.mtimeMs; + const cachedLastModifiedAt = tsconfigLastModifiedTimestampCache.get(tsconfigPath); + tsconfigLastModifiedTimestampCache.set(tsconfigPath, lastModifiedAt); + if (cachedLastModifiedAt == null) { + return false; + } + return Math.abs(cachedLastModifiedAt - lastModifiedAt) > Number.EPSILON; +} +function maybeInvalidateProgram(existingWatch, filePath, tsconfigPath) { + /* + * By calling watchProgram.getProgram(), it will trigger a resync of the program based on + * whatever new file content we've given it from our input. + */ + let updatedProgram = existingWatch.getProgram().getProgram(); + // In case this change causes problems in larger real world codebases + // Provide an escape hatch so people don't _have_ to revert to an older version + if (process.env.TSESTREE_NO_INVALIDATION === 'true') { + return updatedProgram; + } + if (hasTSConfigChanged(tsconfigPath)) { + /* + * If the stat of the tsconfig has changed, that could mean the include/exclude/files lists has changed + * We need to make sure typescript knows this so it can update appropriately + */ + log('tsconfig has changed - triggering program update. %s', tsconfigPath); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + fileWatchCallbackTrackingMap + .get(tsconfigPath) + .forEach(cb => cb(tsconfigPath, ts.FileWatcherEventKind.Changed)); + // tsconfig change means that the file list more than likely changed, so clear the cache + programFileListCache.delete(tsconfigPath); + } + let sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + /* + * Missing source file means our program's folder structure might be out of date. + * So we need to tell typescript it needs to update the correct folder. + */ + log('File was not found in program - triggering folder update. %s', filePath); + // Find the correct directory callback by climbing the folder tree + const currentDir = (0, shared_1.canonicalDirname)(filePath); + let current = null; + let next = currentDir; + let hasCallback = false; + while (current !== next) { + current = next; + const folderWatchCallbacks = folderWatchCallbackTrackingMap.get(current); + if (folderWatchCallbacks) { + for (const cb of folderWatchCallbacks) { + if (currentDir !== current) { + cb(currentDir, ts.FileWatcherEventKind.Changed); + } + cb(current, ts.FileWatcherEventKind.Changed); + } + hasCallback = true; + } + next = (0, shared_1.canonicalDirname)(current); + } + if (!hasCallback) { + /* + * No callback means the paths don't matchup - so no point returning any program + * this will signal to the caller to skip this program + */ + log('No callback found for file, not part of this program. %s', filePath); + return null; + } + // directory update means that the file list more than likely changed, so clear the cache + programFileListCache.delete(tsconfigPath); + // force the immediate resync + updatedProgram = existingWatch.getProgram().getProgram(); + sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + /* + * At this point we're in one of two states: + * - The file isn't supposed to be in this program due to exclusions + * - The file is new, and was renamed from an old, included filename + * + * For the latter case, we need to tell typescript that the old filename is now deleted + */ + log('File was still not found in program after directory update - checking file deletions. %s', filePath); + const rootFilenames = updatedProgram.getRootFileNames(); + // use find because we only need to "delete" one file to cause typescript to do a full resync + const deletedFile = rootFilenames.find(file => !node_fs_1.default.existsSync(file)); + if (!deletedFile) { + // There are no deleted files, so it must be the former case of the file not belonging to this program + return null; + } + const fileWatchCallbacks = fileWatchCallbackTrackingMap.get((0, shared_1.getCanonicalFileName)(deletedFile)); + if (!fileWatchCallbacks) { + // shouldn't happen, but just in case + log('Could not find watch callbacks for root file. %s', deletedFile); + return updatedProgram; + } + log('Marking file as deleted. %s', deletedFile); + fileWatchCallbacks.forEach(cb => cb(deletedFile, ts.FileWatcherEventKind.Deleted)); + // deleted files means that the file list _has_ changed, so clear the cache + programFileListCache.delete(tsconfigPath); + updatedProgram = existingWatch.getProgram().getProgram(); + sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + log('File was still not found in program after deletion check, assuming it is not part of this program. %s', filePath); + return null; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map new file mode 100644 index 0000000..3a69535 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/create-program/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC;IACnB,OAAO,EAAE,IAAI,CAAC;CACf;AACD,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC;IACnB,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;CACrB;AACD,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,eAAe,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,eAQtC,CAAC;AAYF,eAAO,MAAM,6BAA6B,aASxC,CAAC;AAEH,wBAAgB,qCAAqC,CACnD,aAAa,EAAE,aAAa,GAC3B,EAAE,CAAC,eAAe,CASpB;AAGD,MAAM,MAAM,aAAa,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAAC;AAU1D,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAMpE;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAI7E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,aAAa,CAEhE;AAmBD,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,MAAM,GACf,qBAAqB,GAAG,SAAS,CAWnC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOlD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js new file mode 100644 index 0000000..45a01b7 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js @@ -0,0 +1,142 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_EXTRA_FILE_EXTENSIONS = exports.CORE_COMPILER_OPTIONS = void 0; +exports.createDefaultCompilerOptionsFromExtra = createDefaultCompilerOptionsFromExtra; +exports.getCanonicalFileName = getCanonicalFileName; +exports.ensureAbsolutePath = ensureAbsolutePath; +exports.canonicalDirname = canonicalDirname; +exports.getAstFromProgram = getAstFromProgram; +exports.createHash = createHash; +const node_path_1 = __importDefault(require("node:path")); +const ts = __importStar(require("typescript")); +/** + * Compiler options required to avoid critical functionality issues + */ +exports.CORE_COMPILER_OPTIONS = { + noEmit: true, // required to avoid parse from causing emit to occur + /** + * Flags required to make no-unused-vars work + */ + noUnusedLocals: true, + noUnusedParameters: true, +}; +/** + * Default compiler options for program generation + */ +const DEFAULT_COMPILER_OPTIONS = { + ...exports.CORE_COMPILER_OPTIONS, + allowJs: true, + allowNonTsExtensions: true, + checkJs: true, +}; +exports.DEFAULT_EXTRA_FILE_EXTENSIONS = new Set([ + ts.Extension.Cjs, + ts.Extension.Cts, + ts.Extension.Js, + ts.Extension.Jsx, + ts.Extension.Mjs, + ts.Extension.Mts, + ts.Extension.Ts, + ts.Extension.Tsx, +]); +function createDefaultCompilerOptionsFromExtra(parseSettings) { + if (parseSettings.debugLevel.has('typescript')) { + return { + ...DEFAULT_COMPILER_OPTIONS, + extendedDiagnostics: true, + }; + } + return DEFAULT_COMPILER_OPTIONS; +} +// typescript doesn't provide a ts.sys implementation for browser environments +const useCaseSensitiveFileNames = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/internal/eqeq-nullish +ts.sys !== undefined ? ts.sys.useCaseSensitiveFileNames : true; +const correctPathCasing = useCaseSensitiveFileNames + ? (filePath) => filePath + : (filePath) => filePath.toLowerCase(); +function getCanonicalFileName(filePath) { + let normalized = node_path_1.default.normalize(filePath); + if (normalized.endsWith(node_path_1.default.sep)) { + normalized = normalized.slice(0, -1); + } + return correctPathCasing(normalized); +} +function ensureAbsolutePath(p, tsconfigRootDir) { + return node_path_1.default.isAbsolute(p) + ? p + : node_path_1.default.join(tsconfigRootDir || process.cwd(), p); +} +function canonicalDirname(p) { + return node_path_1.default.dirname(p); +} +const DEFINITION_EXTENSIONS = [ + ts.Extension.Dts, + ts.Extension.Dcts, + ts.Extension.Dmts, +]; +function getExtension(fileName) { + if (!fileName) { + return null; + } + return (DEFINITION_EXTENSIONS.find(definitionExt => fileName.endsWith(definitionExt)) ?? node_path_1.default.extname(fileName)); +} +function getAstFromProgram(currentProgram, filePath) { + const ast = currentProgram.getSourceFile(filePath); + // working around https://github.com/typescript-eslint/typescript-eslint/issues/1573 + const expectedExt = getExtension(filePath); + const returnedExt = getExtension(ast?.fileName); + if (expectedExt !== returnedExt) { + return undefined; + } + return ast && { ast, program: currentProgram }; +} +/** + * Hash content for compare content. + * @param content hashed contend + * @returns hashed result + */ +function createHash(content) { + // No ts.sys in browser environments. + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (ts.sys?.createHash) { + return ts.sys.createHash(content); + } + return content; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts.map new file mode 100644 index 0000000..99308f0 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useProvidedPrograms.d.ts","sourceRoot":"","sources":["../../src/create-program/useProvidedPrograms.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAStD,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,EACtC,aAAa,EAAE,aAAa,GAC3B,qBAAqB,GAAG,SAAS,CAoCnC;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,gBAAgB,CAAC,EAAE,MAAM,GACxB,EAAE,CAAC,OAAO,CAIZ"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js new file mode 100644 index 0000000..4b86def --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js @@ -0,0 +1,81 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useProvidedPrograms = useProvidedPrograms; +exports.createProgramFromConfigFile = createProgramFromConfigFile; +const debug_1 = __importDefault(require("debug")); +const path = __importStar(require("node:path")); +const ts = __importStar(require("typescript")); +const getParsedConfigFile_1 = require("./getParsedConfigFile"); +const shared_1 = require("./shared"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:useProvidedPrograms'); +function useProvidedPrograms(programInstances, parseSettings) { + log('Retrieving ast for %s from provided program instance(s)', parseSettings.filePath); + let astAndProgram; + for (const programInstance of programInstances) { + astAndProgram = (0, shared_1.getAstFromProgram)(programInstance, parseSettings.filePath); + // Stop at the first applicable program instance + if (astAndProgram) { + break; + } + } + if (astAndProgram) { + astAndProgram.program.getTypeChecker(); // ensure parent pointers are set in source files + return astAndProgram; + } + const relativeFilePath = path.relative(parseSettings.tsconfigRootDir, parseSettings.filePath); + const [typeSource, typeSources] = parseSettings.projects.size > 0 + ? ['project', 'project(s)'] + : ['programs', 'program instance(s)']; + const errorLines = [ + `"parserOptions.${typeSource}" has been provided for @typescript-eslint/parser.`, + `The file was not found in any of the provided ${typeSources}: ${relativeFilePath}`, + ]; + throw new Error(errorLines.join('\n')); +} +/** + * Utility offered by parser to help consumers construct their own program instance. + * + * @param configFile the path to the tsconfig.json file, relative to `projectDirectory` + * @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()` + */ +function createProgramFromConfigFile(configFile, projectDirectory) { + const parsed = (0, getParsedConfigFile_1.getParsedConfigFile)(ts, configFile, projectDirectory); + const host = ts.createCompilerHost(parsed.options, true); + return ts.createProgram(parsed.fileNames, parsed.options, host); +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.d.ts.map new file mode 100644 index 0000000..18df39c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"validateDefaultProjectForFilesGlob.d.ts","sourceRoot":"","sources":["../../src/create-program/validateDefaultProjectForFilesGlob.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uCAAuC,yNAKnD,CAAC;AAEF,wBAAgB,kCAAkC,CAChD,mBAAmB,EAAE,MAAM,EAAE,GAAG,SAAS,GACxC,IAAI,CAiBN"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.js new file mode 100644 index 0000000..1a7fab7 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION = void 0; +exports.validateDefaultProjectForFilesGlob = validateDefaultProjectForFilesGlob; +exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION = ` + +Having many files run with the default project is known to cause performance issues and slow down linting. + +See https://typescript-eslint.io/troubleshooting/typed-linting#allowdefaultproject-glob-too-wide +`; +function validateDefaultProjectForFilesGlob(allowDefaultProject) { + if (!allowDefaultProject?.length) { + return; + } + for (const glob of allowDefaultProject) { + if (glob === '*') { + throw new Error(`allowDefaultProject contains the overly wide '*'.${exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION}`); + } + if (glob.includes('**')) { + throw new Error(`allowDefaultProject glob '${glob}' contains a disallowed '**'.${exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION}`); + } + } +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.d.ts.map new file mode 100644 index 0000000..2cdc2b5 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createParserServices.d.ts","sourceRoot":"","sources":["../src/createParserServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,EAAE,CAAC,OAAO,GAAG,IAAI,GACzB,cAAc,CA6BhB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js b/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js new file mode 100644 index 0000000..cdaa693 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createParserServices = createParserServices; +function createParserServices(astMaps, program) { + if (!program) { + return { + emitDecoratorMetadata: undefined, + experimentalDecorators: undefined, + isolatedDeclarations: undefined, + program, + // we always return the node maps because + // (a) they don't require type info and + // (b) they can be useful when using some of TS's internal non-type-aware AST utils + ...astMaps, + }; + } + const checker = program.getTypeChecker(); + const compilerOptions = program.getCompilerOptions(); + return { + program, + // not set in the config is the same as off + emitDecoratorMetadata: compilerOptions.emitDecoratorMetadata ?? false, + experimentalDecorators: compilerOptions.experimentalDecorators ?? false, + isolatedDeclarations: compilerOptions.isolatedDeclarations ?? false, + ...astMaps, + getSymbolAtLocation: node => checker.getSymbolAtLocation(astMaps.esTreeNodeToTSNodeMap.get(node)), + getTypeAtLocation: node => checker.getTypeAtLocation(astMaps.esTreeNodeToTSNodeMap.get(node)), + }; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts.map new file mode 100644 index 0000000..a67408e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getModifiers.d.ts","sourceRoot":"","sources":["../src/getModifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAMjC,wBAAgB,YAAY,CAC1B,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,EAChC,uBAAuB,UAAQ,GAC9B,EAAE,CAAC,QAAQ,EAAE,GAAG,SAAS,CAsB3B;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,EAChC,wBAAwB,UAAQ,GAC/B,EAAE,CAAC,SAAS,EAAE,GAAG,SAAS,CAoB5B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js b/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js new file mode 100644 index 0000000..4c16405 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js @@ -0,0 +1,74 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getModifiers = getModifiers; +exports.getDecorators = getDecorators; +const ts = __importStar(require("typescript")); +const version_check_1 = require("./version-check"); +const isAtLeast48 = version_check_1.typescriptVersionIsAtLeast['4.8']; +function getModifiers(node, includeIllegalModifiers = false) { + if (node == null) { + return undefined; + } + if (isAtLeast48) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- this is safe as it's guarded + if (includeIllegalModifiers || ts.canHaveModifiers(node)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- this is safe as it's guarded + const modifiers = ts.getModifiers(node); + return modifiers ? [...modifiers] : undefined; + } + return undefined; + } + return ( + // @ts-expect-error intentional fallback for older TS versions + node.modifiers?.filter((m) => !ts.isDecorator(m))); +} +function getDecorators(node, includeIllegalDecorators = false) { + if (node == null) { + return undefined; + } + if (isAtLeast48) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- this is safe as it's guarded + if (includeIllegalDecorators || ts.canHaveDecorators(node)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- this is safe as it's guarded + const decorators = ts.getDecorators(node); + return decorators ? [...decorators] : undefined; + } + return undefined; + } + return ( + // @ts-expect-error intentional fallback for older TS versions + node.decorators?.filter(ts.isDecorator)); +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map new file mode 100644 index 0000000..e3be7be --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,2BAA2B,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACpG,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,KAAK,GAAG,EACR,KAAK,EACL,wBAAwB,EACxB,KAAK,8BAA8B,GACpC,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,cAAc,EACd,oCAAoC,EACpC,iCAAiC,EACjC,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/index.js b/node_modules/@typescript-eslint/typescript-estree/dist/index.js new file mode 100644 index 0000000..1f86bf3 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/index.js @@ -0,0 +1,38 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withoutProjectParserOptions = exports.version = exports.typescriptVersionIsAtLeast = exports.simpleTraverse = exports.parseAndGenerateServices = exports.parse = exports.TSError = exports.createProgram = exports.getCanonicalFileName = void 0; +__exportStar(require("./clear-caches"), exports); +__exportStar(require("./create-program/getScriptKind"), exports); +var shared_1 = require("./create-program/shared"); +Object.defineProperty(exports, "getCanonicalFileName", { enumerable: true, get: function () { return shared_1.getCanonicalFileName; } }); +var useProvidedPrograms_1 = require("./create-program/useProvidedPrograms"); +Object.defineProperty(exports, "createProgram", { enumerable: true, get: function () { return useProvidedPrograms_1.createProgramFromConfigFile; } }); +__exportStar(require("./getModifiers"), exports); +var node_utils_1 = require("./node-utils"); +Object.defineProperty(exports, "TSError", { enumerable: true, get: function () { return node_utils_1.TSError; } }); +var parser_1 = require("./parser"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } }); +Object.defineProperty(exports, "parseAndGenerateServices", { enumerable: true, get: function () { return parser_1.parseAndGenerateServices; } }); +var simple_traverse_1 = require("./simple-traverse"); +Object.defineProperty(exports, "simpleTraverse", { enumerable: true, get: function () { return simple_traverse_1.simpleTraverse; } }); +__exportStar(require("./ts-estree"), exports); +var version_check_1 = require("./version-check"); +Object.defineProperty(exports, "typescriptVersionIsAtLeast", { enumerable: true, get: function () { return version_check_1.typescriptVersionIsAtLeast; } }); +var version_1 = require("./version"); +Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_1.version; } }); +var withoutProjectParserOptions_1 = require("./withoutProjectParserOptions"); +Object.defineProperty(exports, "withoutProjectParserOptions", { enumerable: true, get: function () { return withoutProjectParserOptions_1.withoutProjectParserOptions; } }); diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.d.ts.map new file mode 100644 index 0000000..ce45e83 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"xhtml-entities.d.ts","sourceRoot":"","sources":["../../src/jsx/xhtml-entities.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8PhD,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js b/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js new file mode 100644 index 0000000..8fc299b --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js @@ -0,0 +1,258 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.xhtmlEntities = void 0; +exports.xhtmlEntities = { + Aacute: '\u00C1', + aacute: '\u00E1', + Acirc: '\u00C2', + acirc: '\u00E2', + acute: '\u00B4', + AElig: '\u00C6', + aelig: '\u00E6', + Agrave: '\u00C0', + agrave: '\u00E0', + alefsym: '\u2135', + Alpha: '\u0391', + alpha: '\u03B1', + amp: '&', + and: '\u2227', + ang: '\u2220', + apos: '\u0027', + Aring: '\u00C5', + aring: '\u00E5', + asymp: '\u2248', + Atilde: '\u00C3', + atilde: '\u00E3', + Auml: '\u00C4', + auml: '\u00E4', + bdquo: '\u201E', + Beta: '\u0392', + beta: '\u03B2', + brvbar: '\u00A6', + bull: '\u2022', + cap: '\u2229', + Ccedil: '\u00C7', + ccedil: '\u00E7', + cedil: '\u00B8', + cent: '\u00A2', + Chi: '\u03A7', + chi: '\u03C7', + circ: '\u02C6', + clubs: '\u2663', + cong: '\u2245', + copy: '\u00A9', + crarr: '\u21B5', + cup: '\u222A', + curren: '\u00A4', + dagger: '\u2020', + Dagger: '\u2021', + darr: '\u2193', + dArr: '\u21D3', + deg: '\u00B0', + Delta: '\u0394', + delta: '\u03B4', + diams: '\u2666', + divide: '\u00F7', + Eacute: '\u00C9', + eacute: '\u00E9', + Ecirc: '\u00CA', + ecirc: '\u00EA', + Egrave: '\u00C8', + egrave: '\u00E8', + empty: '\u2205', + emsp: '\u2003', + ensp: '\u2002', + Epsilon: '\u0395', + epsilon: '\u03B5', + equiv: '\u2261', + Eta: '\u0397', + eta: '\u03B7', + ETH: '\u00D0', + eth: '\u00F0', + Euml: '\u00CB', + euml: '\u00EB', + euro: '\u20AC', + exist: '\u2203', + fnof: '\u0192', + forall: '\u2200', + frac12: '\u00BD', + frac14: '\u00BC', + frac34: '\u00BE', + frasl: '\u2044', + Gamma: '\u0393', + gamma: '\u03B3', + ge: '\u2265', + gt: '>', + harr: '\u2194', + hArr: '\u21D4', + hearts: '\u2665', + hellip: '\u2026', + Iacute: '\u00CD', + iacute: '\u00ED', + Icirc: '\u00CE', + icirc: '\u00EE', + iexcl: '\u00A1', + Igrave: '\u00CC', + igrave: '\u00EC', + image: '\u2111', + infin: '\u221E', + int: '\u222B', + Iota: '\u0399', + iota: '\u03B9', + iquest: '\u00BF', + isin: '\u2208', + Iuml: '\u00CF', + iuml: '\u00EF', + Kappa: '\u039A', + kappa: '\u03BA', + Lambda: '\u039B', + lambda: '\u03BB', + lang: '\u2329', + laquo: '\u00AB', + larr: '\u2190', + lArr: '\u21D0', + lceil: '\u2308', + ldquo: '\u201C', + le: '\u2264', + lfloor: '\u230A', + lowast: '\u2217', + loz: '\u25CA', + lrm: '\u200E', + lsaquo: '\u2039', + lsquo: '\u2018', + lt: '<', + macr: '\u00AF', + mdash: '\u2014', + micro: '\u00B5', + middot: '\u00B7', + minus: '\u2212', + Mu: '\u039C', + mu: '\u03BC', + nabla: '\u2207', + nbsp: '\u00A0', + ndash: '\u2013', + ne: '\u2260', + ni: '\u220B', + not: '\u00AC', + notin: '\u2209', + nsub: '\u2284', + Ntilde: '\u00D1', + ntilde: '\u00F1', + Nu: '\u039D', + nu: '\u03BD', + Oacute: '\u00D3', + oacute: '\u00F3', + Ocirc: '\u00D4', + ocirc: '\u00F4', + OElig: '\u0152', + oelig: '\u0153', + Ograve: '\u00D2', + ograve: '\u00F2', + oline: '\u203E', + Omega: '\u03A9', + omega: '\u03C9', + Omicron: '\u039F', + omicron: '\u03BF', + oplus: '\u2295', + or: '\u2228', + ordf: '\u00AA', + ordm: '\u00BA', + Oslash: '\u00D8', + oslash: '\u00F8', + Otilde: '\u00D5', + otilde: '\u00F5', + otimes: '\u2297', + Ouml: '\u00D6', + ouml: '\u00F6', + para: '\u00B6', + part: '\u2202', + permil: '\u2030', + perp: '\u22A5', + Phi: '\u03A6', + phi: '\u03C6', + Pi: '\u03A0', + pi: '\u03C0', + piv: '\u03D6', + plusmn: '\u00B1', + pound: '\u00A3', + prime: '\u2032', + Prime: '\u2033', + prod: '\u220F', + prop: '\u221D', + Psi: '\u03A8', + psi: '\u03C8', + quot: '\u0022', + radic: '\u221A', + rang: '\u232A', + raquo: '\u00BB', + rarr: '\u2192', + rArr: '\u21D2', + rceil: '\u2309', + rdquo: '\u201D', + real: '\u211C', + reg: '\u00AE', + rfloor: '\u230B', + Rho: '\u03A1', + rho: '\u03C1', + rlm: '\u200F', + rsaquo: '\u203A', + rsquo: '\u2019', + sbquo: '\u201A', + Scaron: '\u0160', + scaron: '\u0161', + sdot: '\u22C5', + sect: '\u00A7', + shy: '\u00AD', + Sigma: '\u03A3', + sigma: '\u03C3', + sigmaf: '\u03C2', + sim: '\u223C', + spades: '\u2660', + sub: '\u2282', + sube: '\u2286', + sum: '\u2211', + sup: '\u2283', + sup1: '\u00B9', + sup2: '\u00B2', + sup3: '\u00B3', + supe: '\u2287', + szlig: '\u00DF', + Tau: '\u03A4', + tau: '\u03C4', + there4: '\u2234', + Theta: '\u0398', + theta: '\u03B8', + thetasym: '\u03D1', + thinsp: '\u2009', + THORN: '\u00DE', + thorn: '\u00FE', + tilde: '\u02DC', + times: '\u00D7', + trade: '\u2122', + Uacute: '\u00DA', + uacute: '\u00FA', + uarr: '\u2191', + uArr: '\u21D1', + Ucirc: '\u00DB', + ucirc: '\u00FB', + Ugrave: '\u00D9', + ugrave: '\u00F9', + uml: '\u00A8', + upsih: '\u03D2', + Upsilon: '\u03A5', + upsilon: '\u03C5', + Uuml: '\u00DC', + uuml: '\u00FC', + weierp: '\u2118', + Xi: '\u039E', + xi: '\u03BE', + Yacute: '\u00DD', + yacute: '\u00FD', + yen: '\u00A5', + yuml: '\u00FF', + Yuml: '\u0178', + Zeta: '\u0396', + zeta: '\u03B6', + zwj: '\u200D', + zwnj: '\u200C', +}; diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map new file mode 100644 index 0000000..f1ea907 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"node-utils.d.ts","sourceRoot":"","sources":["../src/node-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIpD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAK9D,QAAA,MAAM,UAAU,sBAAgB,CAAC;AAEjC,KAAK,mBAAmB,GACpB,EAAE,CAAC,UAAU,CAAC,uBAAuB,GACrC,EAAE,CAAC,UAAU,CAAC,WAAW,GACzB,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC;AAOxC,UAAU,WACR,SAAQ,QAAQ,CAAC,qBAAqB,EACpC,QAAQ,CAAC,oBAAoB;IAC/B,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;IACrC,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IACnC,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAC/B,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACzC,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;CACtC;AAED,KAAK,sBAAsB,GAAG,MAAM,QAAQ,CAAC,wBAAwB,CAAC;AAoBtE,KAAK,kBAAkB,GAAG,MAAM,QAAQ,CAAC,oBAAoB,CAAC;AA4B9D,KAAK,eAAe,GAAG,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAa5D;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,EAAE,CAAC,mBAAmB,GAC/B,QAAQ,IAAI,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAE3C;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,EAAE,CAAC,mBAAmB,GAC/B,QAAQ,IAAI,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAE1C;AAED,KAAK,iBAAiB,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,IAAI,CAAC,SAAS,MAAM,WAAW,GACzE,WAAW,CAAC,CAAC,CAAC,GACd,MAAM,GAAG,SAAS,CAAC;AACvB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,EACzD,IAAI,EAAE,CAAC,GACN,iBAAiB,CAAC,CAAC,CAAC,CAItB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAE1D;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,EAAE,CAAC,iBAAiB,EAClC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,OAAO,CAGT;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,QAAQ,GAAG,IAAI,CAMjE;AAED;;GAEG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,EAAE,CAAC,IAAI,GACb,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAE7C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAKhD;AAUD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,EAAE,CAAC,mBAAmB,GACpE;IACE,QAAQ,EAAE,iBAAiB,CAAC,sBAAsB,CAAC,CAAC;IACpD,IAAI,EAAE,cAAc,CAAC,oBAAoB,CAAC;CAC3C,GACD;IACE,QAAQ,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAChD,IAAI,EAAE,cAAc,CAAC,gBAAgB,CAAC;CACvC,GACD;IACE,QAAQ,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACjD,IAAI,EAAE,cAAc,CAAC,iBAAiB,CAAC;CACxC,CAyBJ;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,EAAE,CAAC,UAAU,GACjB,QAAQ,CAAC,QAAQ,CAMnB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,GAAG,EAAE,EAAE,CAAC,UAAU,GACjB,QAAQ,CAAC,cAAc,CAGzB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EACA,EAAE,CAAC,KAAK,GACR,EAAE,CAAC,2BAA2B,GAC9B,EAAE,CAAC,WAAW,GACd,EAAE,CAAC,UAAU,GAChB,OAAO,CAgBT;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC,EAC1C,GAAG,EAAE,EAAE,CAAC,UAAU,GACjB,CAAC,MAAM,EAAE,MAAM,CAAC,CAElB;AAWD;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAIjD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,uBAAuB,GAC/B,eAAe,CAejB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAkBhD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,aAAa,EAAE,EAAE,CAAC,SAAS,EAC3B,MAAM,EAAE,EAAE,CAAC,IAAI,EACf,GAAG,EAAE,EAAE,CAAC,UAAU,GACjB,EAAE,CAAC,IAAI,GAAG,SAAS,CAmBrB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,GACpC,EAAE,CAAC,IAAI,GAAG,SAAS,CASrB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAc9D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,IAAI,IAAI,EAAE,CAAC,oBAAoB,CAEjC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAC/B,aAAa,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC;CAClC,GAAG,OAAO,CAEV;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,QAAQ,CAAC,eAAe,CAElC;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EACA,EAAE,CAAC,cAAc,GACjB,EAAE,CAAC,uBAAuB,GAC1B,EAAE,CAAC,iBAAiB,GACpB,EAAE,CAAC,wBAAwB,EAC/B,KAAK,EAAE,QAAQ,CAAC,IAAI,GACnB,OAAO,CAMT;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,GAC7C,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CA+FxE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,EACnC,GAAG,EAAE,EAAE,CAAC,UAAU,GACjB,QAAQ,CAAC,KAAK,CA+BhB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,GAAG,QAAQ,CAAC,KAAK,EAAE,CAoBlE;AAED,qBAAa,OAAQ,SAAQ,KAAK;aAGd,QAAQ,EAAE,MAAM;aAChB,QAAQ,EAAE;QACxB,GAAG,EAAE;YACH,MAAM,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,KAAK,EAAE;YACL,MAAM,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;KACH;gBAbD,OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE;QACxB,GAAG,EAAE;YACH,MAAM,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,KAAK,EAAE;YACL,MAAM,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;KACH;IAWH,IAAI,KAAK,IAAI,MAAM,CAElB;IAGD,IAAI,UAAU,IAAI,MAAM,CAEvB;IAGD,IAAI,MAAM,IAAI,MAAM,CAEnB;CACF;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,EAAE,CAAC,UAAU,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAmB,GAC5B,OAAO,CAOT;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,IAAI,IAAI;IAAE,iBAAiB,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;CAAE,GAAG,EAAE,CAAC,IAAI,CAKpD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CAMrE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAC/B,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,EAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,GACrD,CAAC,GAAG,SAAS,CAcf;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CAOlE;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,SAAS,GACxB,IAAI,IAAI,EAAE,CAAC,UAAU,CAMvB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAUxD;AAeD,wBAAgB,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,IAAI,CAExE;AAGD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,EAAE,CAAC,oBAAoB,GAAG,SAAS,CAErC;AA4BD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAuDxD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CA6B9D;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,EAAE,CAAC,iBAAiB,GACzB,EAAE,CAAC,QAAQ,EAAE,GAAG,SAAS,CAgB3B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js new file mode 100644 index 0000000..a9702b3 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js @@ -0,0 +1,740 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSError = void 0; +exports.isLogicalOperator = isLogicalOperator; +exports.isESTreeBinaryOperator = isESTreeBinaryOperator; +exports.getTextForTokenKind = getTextForTokenKind; +exports.isESTreeClassMember = isESTreeClassMember; +exports.hasModifier = hasModifier; +exports.getLastModifier = getLastModifier; +exports.isComma = isComma; +exports.isComment = isComment; +exports.getBinaryExpressionType = getBinaryExpressionType; +exports.getLineAndCharacterFor = getLineAndCharacterFor; +exports.getLocFor = getLocFor; +exports.canContainDirective = canContainDirective; +exports.getRange = getRange; +exports.isJSXToken = isJSXToken; +exports.getDeclarationKind = getDeclarationKind; +exports.getTSNodeAccessibility = getTSNodeAccessibility; +exports.findNextToken = findNextToken; +exports.findFirstMatchingAncestor = findFirstMatchingAncestor; +exports.hasJSXAncestor = hasJSXAncestor; +exports.unescapeStringLiteralText = unescapeStringLiteralText; +exports.isComputedProperty = isComputedProperty; +exports.isOptional = isOptional; +exports.isChainExpression = isChainExpression; +exports.isChildUnwrappableOptionalChain = isChildUnwrappableOptionalChain; +exports.getTokenType = getTokenType; +exports.convertToken = convertToken; +exports.convertTokens = convertTokens; +exports.createError = createError; +exports.nodeHasIllegalDecorators = nodeHasIllegalDecorators; +exports.nodeHasTokens = nodeHasTokens; +exports.firstDefined = firstDefined; +exports.identifierIsThisKeyword = identifierIsThisKeyword; +exports.isThisIdentifier = isThisIdentifier; +exports.isThisInTypeQuery = isThisInTypeQuery; +exports.nodeIsPresent = nodeIsPresent; +exports.getContainingFunction = getContainingFunction; +exports.nodeCanBeDecorated = nodeCanBeDecorated; +exports.isValidAssignmentTarget = isValidAssignmentTarget; +exports.getNamespaceModifiers = getNamespaceModifiers; +const ts = __importStar(require("typescript")); +const getModifiers_1 = require("./getModifiers"); +const xhtml_entities_1 = require("./jsx/xhtml-entities"); +const ts_estree_1 = require("./ts-estree"); +const version_check_1 = require("./version-check"); +const isAtLeast50 = version_check_1.typescriptVersionIsAtLeast['5.0']; +const SyntaxKind = ts.SyntaxKind; +const LOGICAL_OPERATORS = new Set([ + SyntaxKind.AmpersandAmpersandToken, + SyntaxKind.BarBarToken, + SyntaxKind.QuestionQuestionToken, +]); +const ASSIGNMENT_OPERATORS = new Set([ + ts.SyntaxKind.AmpersandAmpersandEqualsToken, + ts.SyntaxKind.AmpersandEqualsToken, + ts.SyntaxKind.AsteriskAsteriskEqualsToken, + ts.SyntaxKind.AsteriskEqualsToken, + ts.SyntaxKind.BarBarEqualsToken, + ts.SyntaxKind.BarEqualsToken, + ts.SyntaxKind.CaretEqualsToken, + ts.SyntaxKind.EqualsToken, + ts.SyntaxKind.GreaterThanGreaterThanEqualsToken, + ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken, + ts.SyntaxKind.LessThanLessThanEqualsToken, + ts.SyntaxKind.MinusEqualsToken, + ts.SyntaxKind.PercentEqualsToken, + ts.SyntaxKind.PlusEqualsToken, + ts.SyntaxKind.QuestionQuestionEqualsToken, + ts.SyntaxKind.SlashEqualsToken, +]); +const BINARY_OPERATORS = new Set([ + SyntaxKind.AmpersandAmpersandToken, + SyntaxKind.AmpersandToken, + SyntaxKind.AsteriskAsteriskToken, + SyntaxKind.AsteriskToken, + SyntaxKind.BarBarToken, + SyntaxKind.BarToken, + SyntaxKind.CaretToken, + SyntaxKind.EqualsEqualsEqualsToken, + SyntaxKind.EqualsEqualsToken, + SyntaxKind.ExclamationEqualsEqualsToken, + SyntaxKind.ExclamationEqualsToken, + SyntaxKind.GreaterThanEqualsToken, + SyntaxKind.GreaterThanGreaterThanGreaterThanToken, + SyntaxKind.GreaterThanGreaterThanToken, + SyntaxKind.GreaterThanToken, + SyntaxKind.InKeyword, + SyntaxKind.InstanceOfKeyword, + SyntaxKind.LessThanEqualsToken, + SyntaxKind.LessThanLessThanToken, + SyntaxKind.LessThanToken, + SyntaxKind.MinusToken, + SyntaxKind.PercentToken, + SyntaxKind.PlusToken, + SyntaxKind.SlashToken, +]); +/** + * Returns true if the given ts.Token is the assignment operator + */ +function isAssignmentOperator(operator) { + return ASSIGNMENT_OPERATORS.has(operator.kind); +} +/** + * Returns true if the given ts.Token is a logical operator + */ +function isLogicalOperator(operator) { + return LOGICAL_OPERATORS.has(operator.kind); +} +function isESTreeBinaryOperator(operator) { + return BINARY_OPERATORS.has(operator.kind); +} +/** + * Returns the string form of the given TSToken SyntaxKind + */ +function getTextForTokenKind(kind) { + return ts.tokenToString(kind); +} +/** + * Returns true if the given ts.Node is a valid ESTree class member + */ +function isESTreeClassMember(node) { + return node.kind !== SyntaxKind.SemicolonClassElement; +} +/** + * Checks if a ts.Node has a modifier + */ +function hasModifier(modifierKind, node) { + const modifiers = (0, getModifiers_1.getModifiers)(node); + return modifiers?.some(modifier => modifier.kind === modifierKind) === true; +} +/** + * Get last last modifier in ast + * @returns returns last modifier if present or null + */ +function getLastModifier(node) { + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers == null) { + return null; + } + return modifiers[modifiers.length - 1] ?? null; +} +/** + * Returns true if the given ts.Token is a comma + */ +function isComma(token) { + return token.kind === SyntaxKind.CommaToken; +} +/** + * Returns true if the given ts.Node is a comment + */ +function isComment(node) { + return (node.kind === SyntaxKind.SingleLineCommentTrivia || + node.kind === SyntaxKind.MultiLineCommentTrivia); +} +/** + * Returns true if the given ts.Node is a JSDoc comment + */ +function isJSDocComment(node) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- SyntaxKind.JSDoc was only added in TS4.7 so we can't use it yet + return node.kind === SyntaxKind.JSDocComment; +} +/** + * Returns the binary expression type of the given ts.Token + */ +function getBinaryExpressionType(operator) { + if (isAssignmentOperator(operator)) { + return { + type: ts_estree_1.AST_NODE_TYPES.AssignmentExpression, + operator: getTextForTokenKind(operator.kind), + }; + } + if (isLogicalOperator(operator)) { + return { + type: ts_estree_1.AST_NODE_TYPES.LogicalExpression, + operator: getTextForTokenKind(operator.kind), + }; + } + if (isESTreeBinaryOperator(operator)) { + return { + type: ts_estree_1.AST_NODE_TYPES.BinaryExpression, + operator: getTextForTokenKind(operator.kind), + }; + } + throw new Error(`Unexpected binary operator ${ts.tokenToString(operator.kind)}`); +} +/** + * Returns line and column data for the given positions + */ +function getLineAndCharacterFor(pos, ast) { + const loc = ast.getLineAndCharacterOfPosition(pos); + return { + column: loc.character, + line: loc.line + 1, + }; +} +/** + * Returns line and column data for the given start and end positions, + * for the given AST + */ +function getLocFor(range, ast) { + const [start, end] = range.map(pos => getLineAndCharacterFor(pos, ast)); + return { end, start }; +} +/** + * Check whatever node can contain directive + */ +function canContainDirective(node) { + if (node.kind === ts.SyntaxKind.Block) { + switch (node.parent.kind) { + case ts.SyntaxKind.Constructor: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.MethodDeclaration: + return true; + default: + return false; + } + } + return true; +} +/** + * Returns range for the given ts.Node + */ +function getRange(node, ast) { + return [node.getStart(ast), node.getEnd()]; +} +/** + * Returns true if a given ts.Node is a token + */ +function isToken(node) { + return (node.kind >= SyntaxKind.FirstToken && node.kind <= SyntaxKind.LastToken); +} +/** + * Returns true if a given ts.Node is a JSX token + */ +function isJSXToken(node) { + return (node.kind >= SyntaxKind.JsxElement && node.kind <= SyntaxKind.JsxAttribute); +} +/** + * Returns the declaration kind of the given ts.Node + */ +function getDeclarationKind(node) { + if (node.flags & ts.NodeFlags.Let) { + return 'let'; + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison + if ((node.flags & ts.NodeFlags.AwaitUsing) === ts.NodeFlags.AwaitUsing) { + return 'await using'; + } + if (node.flags & ts.NodeFlags.Const) { + return 'const'; + } + if (node.flags & ts.NodeFlags.Using) { + return 'using'; + } + return 'var'; +} +/** + * Gets a ts.Node's accessibility level + */ +function getTSNodeAccessibility(node) { + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers == null) { + return undefined; + } + for (const modifier of modifiers) { + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + return 'public'; + case SyntaxKind.ProtectedKeyword: + return 'protected'; + case SyntaxKind.PrivateKeyword: + return 'private'; + default: + break; + } + } + return undefined; +} +/** + * Finds the next token based on the previous one and its parent + * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren + */ +function findNextToken(previousToken, parent, ast) { + return find(parent); + function find(n) { + if (ts.isToken(n) && n.pos === previousToken.end) { + // this is token that starts at the end of previous token - return it + return n; + } + return firstDefined(n.getChildren(ast), (child) => { + const shouldDiveInChildNode = + // previous token is enclosed somewhere in the child + (child.pos <= previousToken.pos && child.end > previousToken.end) || + // previous token ends exactly at the beginning of child + child.pos === previousToken.end; + return shouldDiveInChildNode && nodeHasTokens(child, ast) + ? find(child) + : undefined; + }); + } +} +/** + * Find the first matching ancestor based on the given predicate function. + * @param node The current ts.Node + * @param predicate The predicate function to apply to each checked ancestor + * @returns a matching parent ts.Node + */ +function findFirstMatchingAncestor(node, predicate) { + let current = node; + while (current) { + if (predicate(current)) { + return current; + } + current = current.parent; + } + return undefined; +} +/** + * Returns true if a given ts.Node has a JSX token within its hierarchy + */ +function hasJSXAncestor(node) { + return !!findFirstMatchingAncestor(node, isJSXToken); +} +/** + * Unescape the text content of string literals, e.g. & -> & + * @param text The escaped string literal text. + * @returns The unescaped string literal text. + */ +function unescapeStringLiteralText(text) { + return text.replaceAll(/&(?:#\d+|#x[\da-fA-F]+|[0-9a-zA-Z]+);/g, entity => { + const item = entity.slice(1, -1); + if (item[0] === '#') { + const codePoint = item[1] === 'x' + ? parseInt(item.slice(2), 16) + : parseInt(item.slice(1), 10); + return codePoint > 0x10ffff // RangeError: Invalid code point + ? entity + : String.fromCodePoint(codePoint); + } + return xhtml_entities_1.xhtmlEntities[item] || entity; + }); +} +/** + * Returns true if a given ts.Node is a computed property + */ +function isComputedProperty(node) { + return node.kind === SyntaxKind.ComputedPropertyName; +} +/** + * Returns true if a given ts.Node is optional (has QuestionToken) + * @param node ts.Node to be checked + */ +function isOptional(node) { + return !!node.questionToken; +} +/** + * Returns true if the node is an optional chain node + */ +function isChainExpression(node) { + return node.type === ts_estree_1.AST_NODE_TYPES.ChainExpression; +} +/** + * Returns true of the child of property access expression is an optional chain + */ +function isChildUnwrappableOptionalChain(node, child) { + return (isChainExpression(child) && + // (x?.y).z is semantically different, and as such .z is no longer optional + node.expression.kind !== ts.SyntaxKind.ParenthesizedExpression); +} +/** + * Returns the type of a given ts.Token + */ +function getTokenType(token) { + let keywordKind; + if (isAtLeast50 && token.kind === SyntaxKind.Identifier) { + keywordKind = ts.identifierToKeywordKind(token); + } + else if ('originalKeywordKind' in token) { + // @ts-expect-error -- intentional fallback for older TS versions <=4.9 + keywordKind = token.originalKeywordKind; + } + if (keywordKind) { + if (keywordKind === SyntaxKind.NullKeyword) { + return ts_estree_1.AST_TOKEN_TYPES.Null; + } + if (keywordKind >= SyntaxKind.FirstFutureReservedWord && + keywordKind <= SyntaxKind.LastKeyword) { + return ts_estree_1.AST_TOKEN_TYPES.Identifier; + } + return ts_estree_1.AST_TOKEN_TYPES.Keyword; + } + if (token.kind >= SyntaxKind.FirstKeyword && + token.kind <= SyntaxKind.LastFutureReservedWord) { + if (token.kind === SyntaxKind.FalseKeyword || + token.kind === SyntaxKind.TrueKeyword) { + return ts_estree_1.AST_TOKEN_TYPES.Boolean; + } + return ts_estree_1.AST_TOKEN_TYPES.Keyword; + } + if (token.kind >= SyntaxKind.FirstPunctuation && + token.kind <= SyntaxKind.LastPunctuation) { + return ts_estree_1.AST_TOKEN_TYPES.Punctuator; + } + if (token.kind >= SyntaxKind.NoSubstitutionTemplateLiteral && + token.kind <= SyntaxKind.TemplateTail) { + return ts_estree_1.AST_TOKEN_TYPES.Template; + } + switch (token.kind) { + case SyntaxKind.NumericLiteral: + return ts_estree_1.AST_TOKEN_TYPES.Numeric; + case SyntaxKind.JsxText: + return ts_estree_1.AST_TOKEN_TYPES.JSXText; + case SyntaxKind.StringLiteral: + // A TypeScript-StringLiteral token with a TypeScript-JsxAttribute or TypeScript-JsxElement parent, + // must actually be an ESTree-JSXText token + if (token.parent.kind === SyntaxKind.JsxAttribute || + token.parent.kind === SyntaxKind.JsxElement) { + return ts_estree_1.AST_TOKEN_TYPES.JSXText; + } + return ts_estree_1.AST_TOKEN_TYPES.String; + case SyntaxKind.RegularExpressionLiteral: + return ts_estree_1.AST_TOKEN_TYPES.RegularExpression; + case SyntaxKind.Identifier: + case SyntaxKind.ConstructorKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + // intentional fallthrough + default: + } + // Some JSX tokens have to be determined based on their parent + if (token.kind === SyntaxKind.Identifier) { + if (isJSXToken(token.parent)) { + return ts_estree_1.AST_TOKEN_TYPES.JSXIdentifier; + } + if (token.parent.kind === SyntaxKind.PropertyAccessExpression && + hasJSXAncestor(token)) { + return ts_estree_1.AST_TOKEN_TYPES.JSXIdentifier; + } + } + return ts_estree_1.AST_TOKEN_TYPES.Identifier; +} +/** + * Extends and formats a given ts.Token, for a given AST + */ +function convertToken(token, ast) { + const start = token.kind === SyntaxKind.JsxText + ? token.getFullStart() + : token.getStart(ast); + const end = token.getEnd(); + const value = ast.text.slice(start, end); + const tokenType = getTokenType(token); + const range = [start, end]; + const loc = getLocFor(range, ast); + if (tokenType === ts_estree_1.AST_TOKEN_TYPES.RegularExpression) { + return { + type: tokenType, + loc, + range, + regex: { + flags: value.slice(value.lastIndexOf('/') + 1), + pattern: value.slice(1, value.lastIndexOf('/')), + }, + value, + }; + } + // @ts-expect-error TS is complaining about `value` not being the correct + // type but it is + return { + type: tokenType, + loc, + range, + value, + }; +} +/** + * Converts all tokens for the given AST + * @param ast the AST object + * @returns the converted Tokens + */ +function convertTokens(ast) { + const result = []; + /** + * @param node the ts.Node + */ + function walk(node) { + // TypeScript generates tokens for types in JSDoc blocks. Comment tokens + // and their children should not be walked or added to the resulting tokens list. + if (isComment(node) || isJSDocComment(node)) { + return; + } + if (isToken(node) && node.kind !== SyntaxKind.EndOfFileToken) { + result.push(convertToken(node, ast)); + } + else { + node.getChildren(ast).forEach(walk); + } + } + walk(ast); + return result; +} +class TSError extends Error { + fileName; + location; + constructor(message, fileName, location) { + super(message); + this.fileName = fileName; + this.location = location; + Object.defineProperty(this, 'name', { + configurable: true, + enumerable: false, + value: new.target.name, + }); + } + // For old version of ESLint https://github.com/typescript-eslint/typescript-eslint/pull/6556#discussion_r1123237311 + get index() { + return this.location.start.offset; + } + // https://github.com/eslint/eslint/blob/b09a512107249a4eb19ef5a37b0bd672266eafdb/lib/linter/linter.js#L853 + get lineNumber() { + return this.location.start.line; + } + // https://github.com/eslint/eslint/blob/b09a512107249a4eb19ef5a37b0bd672266eafdb/lib/linter/linter.js#L854 + get column() { + return this.location.start.column; + } +} +exports.TSError = TSError; +function createError(message, ast, startIndex, endIndex = startIndex) { + const [start, end] = [startIndex, endIndex].map(offset => { + const { character: column, line } = ast.getLineAndCharacterOfPosition(offset); + return { column, line: line + 1, offset }; + }); + return new TSError(message, ast.fileName, { end, start }); +} +function nodeHasIllegalDecorators(node) { + return !!('illegalDecorators' in node && + node.illegalDecorators?.length); +} +function nodeHasTokens(n, ast) { + // If we have a token or node that has a non-zero width, it must have tokens. + // Note: getWidth() does not take trivia into account. + return n.kind === SyntaxKind.EndOfFileToken + ? !!n.jsDoc + : n.getWidth(ast) !== 0; +} +/** + * Like `forEach`, but suitable for use with numbers and strings (which may be falsy). + */ +function firstDefined(array, callback) { + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + if (array === undefined) { + return undefined; + } + for (let i = 0; i < array.length; i++) { + const result = callback(array[i], i); + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + if (result !== undefined) { + return result; + } + } + return undefined; +} +function identifierIsThisKeyword(id) { + return ((isAtLeast50 + ? ts.identifierToKeywordKind(id) + : // @ts-expect-error -- intentional fallback for older TS versions <=4.9 + id.originalKeywordKind) === SyntaxKind.ThisKeyword); +} +function isThisIdentifier(node) { + return (!!node && + node.kind === SyntaxKind.Identifier && + identifierIsThisKeyword(node)); +} +function isThisInTypeQuery(node) { + if (!isThisIdentifier(node)) { + return false; + } + while (ts.isQualifiedName(node.parent) && node.parent.left === node) { + node = node.parent; + } + return node.parent.kind === SyntaxKind.TypeQuery; +} +// `ts.nodeIsMissing` +function nodeIsMissing(node) { + if (node == null) { + return true; + } + return (node.pos === node.end && + node.pos >= 0 && + node.kind !== SyntaxKind.EndOfFileToken); +} +// `ts.nodeIsPresent` +function nodeIsPresent(node) { + return !nodeIsMissing(node); +} +// `ts.getContainingFunction` +function getContainingFunction(node) { + return ts.findAncestor(node.parent, ts.isFunctionLike); +} +// `ts.hasAbstractModifier` +function hasAbstractModifier(node) { + return hasModifier(SyntaxKind.AbstractKeyword, node); +} +// `ts.getThisParameter` +function getThisParameter(signature) { + if (signature.parameters.length && !ts.isJSDocSignature(signature)) { + const thisParameter = signature.parameters[0]; + if (parameterIsThisKeyword(thisParameter)) { + return thisParameter; + } + } + return null; +} +// `ts.parameterIsThisKeyword` +function parameterIsThisKeyword(parameter) { + return isThisIdentifier(parameter.name); +} +// Rewrite version of `ts.nodeCanBeDecorated` +// Returns `true` for both `useLegacyDecorators: true` and `useLegacyDecorators: false` +function nodeCanBeDecorated(node) { + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + return true; + case SyntaxKind.ClassExpression: + // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: true` + return true; + case SyntaxKind.PropertyDeclaration: { + const { parent } = node; + // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: true` + if (ts.isClassDeclaration(parent)) { + return true; + } + // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: false` + if (ts.isClassLike(parent) && !hasAbstractModifier(node)) { + return true; + } + return false; + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.MethodDeclaration: { + const { parent } = node; + // In `ts.nodeCanBeDecorated` + // when `useLegacyDecorators: true` uses `ts.isClassDeclaration` + // when `useLegacyDecorators: true` uses `ts.isClassLike` + return (Boolean(node.body) && + (ts.isClassDeclaration(parent) || ts.isClassLike(parent))); + } + case SyntaxKind.Parameter: { + // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: false` + const { parent } = node; + const grandparent = parent.parent; + return (Boolean(parent) && + 'body' in parent && + Boolean(parent.body) && + (parent.kind === SyntaxKind.Constructor || + parent.kind === SyntaxKind.MethodDeclaration || + parent.kind === SyntaxKind.SetAccessor) && + getThisParameter(parent) !== node && + Boolean(grandparent) && + grandparent.kind === SyntaxKind.ClassDeclaration); + } + } + return false; +} +function isValidAssignmentTarget(node) { + switch (node.kind) { + case SyntaxKind.Identifier: + return true; + case SyntaxKind.PropertyAccessExpression: + case SyntaxKind.ElementAccessExpression: + if (node.flags & ts.NodeFlags.OptionalChain) { + return false; + } + return true; + case SyntaxKind.ParenthesizedExpression: + case SyntaxKind.TypeAssertionExpression: + case SyntaxKind.AsExpression: + case SyntaxKind.SatisfiesExpression: + case SyntaxKind.ExpressionWithTypeArguments: + case SyntaxKind.NonNullExpression: + return isValidAssignmentTarget(node.expression); + default: + return false; + } +} +function getNamespaceModifiers(node) { + // For following nested namespaces, use modifiers given to the topmost namespace + // export declare namespace foo.bar.baz {} + let modifiers = (0, getModifiers_1.getModifiers)(node); + let moduleDeclaration = node; + while ((!modifiers || modifiers.length === 0) && + ts.isModuleDeclaration(moduleDeclaration.parent)) { + const parentModifiers = (0, getModifiers_1.getModifiers)(moduleDeclaration.parent); + if (parentModifiers?.length) { + modifiers = parentModifiers; + } + moduleDeclaration = moduleDeclaration.parent; + } + return modifiers; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.d.ts.map new file mode 100644 index 0000000..25de4e0 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpiringCache.d.ts","sourceRoot":"","sources":["../../src/parseSettings/ExpiringCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,eAAO,MAAM,uCAAuC,KAAK,CAAC;AAG1D,MAAM,WAAW,SAAS,CAAC,GAAG,EAAE,KAAK;IACnC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,KAAK,GAAG,SAAS,CAAC;IACjC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,qBAAa,aAAa,CAAC,GAAG,EAAE,KAAK,CAAE,YAAW,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC;;gBAWzD,oBAAoB,EAAE,oBAAoB;IAItD,KAAK,IAAI,IAAI;IAIb,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,KAAK,GAAG,SAAS;IAmBhC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;CAWlC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js new file mode 100644 index 0000000..0571828 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExpiringCache = exports.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = void 0; +exports.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = 30; +const ZERO_HR_TIME = [0, 0]; +/** + * A map with key-level expiration. + */ +class ExpiringCache { + #cacheDurationSeconds; + #map = new Map(); + constructor(cacheDurationSeconds) { + this.#cacheDurationSeconds = cacheDurationSeconds; + } + clear() { + this.#map.clear(); + } + get(key) { + const entry = this.#map.get(key); + if (entry?.value != null) { + if (this.#cacheDurationSeconds === 'Infinity') { + return entry.value; + } + const ageSeconds = process.hrtime(entry.lastSeen)[0]; + if (ageSeconds < this.#cacheDurationSeconds) { + // cache hit woo! + return entry.value; + } + // key has expired - clean it up to free up memory + this.#map.delete(key); + } + // no hit :'( + return undefined; + } + set(key, value) { + this.#map.set(key, { + lastSeen: this.#cacheDurationSeconds === 'Infinity' + ? // no need to waste time calculating the hrtime in infinity mode as there's no expiry + ZERO_HR_TIME + : process.hrtime(), + value, + }); + return this; + } +} +exports.ExpiringCache = ExpiringCache; diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.d.ts.map new file mode 100644 index 0000000..0f8eea7 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createParseSettings.d.ts","sourceRoot":"","sources":["../../src/parseSettings/createParseSettings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAiCpD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,EAC5B,eAAe,GAAE,OAAO,CAAC,eAAe,CAAM,GAC7C,oBAAoB,CAyJtB;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js new file mode 100644 index 0000000..12a3ae5 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js @@ -0,0 +1,211 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createParseSettings = createParseSettings; +exports.clearTSConfigMatchCache = clearTSConfigMatchCache; +exports.clearTSServerProjectService = clearTSServerProjectService; +const debug_1 = __importDefault(require("debug")); +const node_path_1 = __importDefault(require("node:path")); +const ts = __importStar(require("typescript")); +const createProjectService_1 = require("../create-program/createProjectService"); +const shared_1 = require("../create-program/shared"); +const source_files_1 = require("../source-files"); +const ExpiringCache_1 = require("./ExpiringCache"); +const getProjectConfigFiles_1 = require("./getProjectConfigFiles"); +const inferSingleRun_1 = require("./inferSingleRun"); +const resolveProjectList_1 = require("./resolveProjectList"); +const warnAboutTSVersion_1 = require("./warnAboutTSVersion"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parseSettings:createParseSettings'); +let TSCONFIG_MATCH_CACHE; +let TSSERVER_PROJECT_SERVICE = null; +// NOTE - we intentionally use "unnecessary" `?.` here because in TS<5.3 this enum doesn't exist +// This object exists so we can centralize these for tracking and so we don't proliferate these across the file +// https://github.com/microsoft/TypeScript/issues/56579 +/* eslint-disable @typescript-eslint/no-unnecessary-condition */ +const JSDocParsingMode = { + ParseAll: ts.JSDocParsingMode?.ParseAll, + ParseForTypeErrors: ts.JSDocParsingMode?.ParseForTypeErrors, + ParseForTypeInfo: ts.JSDocParsingMode?.ParseForTypeInfo, + ParseNone: ts.JSDocParsingMode?.ParseNone, +}; +/* eslint-enable @typescript-eslint/no-unnecessary-condition */ +function createParseSettings(code, tsestreeOptions = {}) { + const codeFullText = enforceCodeString(code); + const singleRun = (0, inferSingleRun_1.inferSingleRun)(tsestreeOptions); + const tsconfigRootDir = typeof tsestreeOptions.tsconfigRootDir === 'string' + ? tsestreeOptions.tsconfigRootDir + : process.cwd(); + const passedLoggerFn = typeof tsestreeOptions.loggerFn === 'function'; + const filePath = (0, shared_1.ensureAbsolutePath)(typeof tsestreeOptions.filePath === 'string' && + tsestreeOptions.filePath !== '' + ? tsestreeOptions.filePath + : getFileName(tsestreeOptions.jsx), tsconfigRootDir); + const extension = node_path_1.default.extname(filePath).toLowerCase(); + const jsDocParsingMode = (() => { + switch (tsestreeOptions.jsDocParsingMode) { + case 'all': + return JSDocParsingMode.ParseAll; + case 'none': + return JSDocParsingMode.ParseNone; + case 'type-info': + return JSDocParsingMode.ParseForTypeInfo; + default: + return JSDocParsingMode.ParseAll; + } + })(); + const parseSettings = { + loc: tsestreeOptions.loc === true, + range: tsestreeOptions.range === true, + allowInvalidAST: tsestreeOptions.allowInvalidAST === true, + code, + codeFullText, + comment: tsestreeOptions.comment === true, + comments: [], + debugLevel: tsestreeOptions.debugLevel === true + ? new Set(['typescript-eslint']) + : Array.isArray(tsestreeOptions.debugLevel) + ? new Set(tsestreeOptions.debugLevel) + : new Set(), + errorOnTypeScriptSyntacticAndSemanticIssues: false, + errorOnUnknownASTType: tsestreeOptions.errorOnUnknownASTType === true, + extraFileExtensions: Array.isArray(tsestreeOptions.extraFileExtensions) && + tsestreeOptions.extraFileExtensions.every(ext => typeof ext === 'string') + ? tsestreeOptions.extraFileExtensions + : [], + filePath, + jsDocParsingMode, + jsx: tsestreeOptions.jsx === true, + log: typeof tsestreeOptions.loggerFn === 'function' + ? tsestreeOptions.loggerFn + : tsestreeOptions.loggerFn === false + ? () => { } // eslint-disable-line @typescript-eslint/no-empty-function + : console.log, // eslint-disable-line no-console + preserveNodeMaps: tsestreeOptions.preserveNodeMaps !== false, + programs: Array.isArray(tsestreeOptions.programs) + ? tsestreeOptions.programs + : null, + projects: new Map(), + projectService: tsestreeOptions.projectService || + (tsestreeOptions.project && + tsestreeOptions.projectService !== false && + process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true') + ? (TSSERVER_PROJECT_SERVICE ??= (0, createProjectService_1.createProjectService)(tsestreeOptions.projectService, jsDocParsingMode, tsconfigRootDir)) + : undefined, + setExternalModuleIndicator: tsestreeOptions.sourceType === 'module' || + (tsestreeOptions.sourceType == null && extension === ts.Extension.Mjs) || + (tsestreeOptions.sourceType == null && extension === ts.Extension.Mts) + ? (file) => { + file.externalModuleIndicator = true; + } + : undefined, + singleRun, + suppressDeprecatedPropertyWarnings: tsestreeOptions.suppressDeprecatedPropertyWarnings ?? + process.env.NODE_ENV !== 'test', + tokens: tsestreeOptions.tokens === true ? [] : null, + tsconfigMatchCache: (TSCONFIG_MATCH_CACHE ??= new ExpiringCache_1.ExpiringCache(singleRun + ? 'Infinity' + : (tsestreeOptions.cacheLifetime?.glob ?? + ExpiringCache_1.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS))), + tsconfigRootDir, + }; + // debug doesn't support multiple `enable` calls, so have to do it all at once + if (parseSettings.debugLevel.size > 0) { + const namespaces = []; + if (parseSettings.debugLevel.has('typescript-eslint')) { + namespaces.push('typescript-eslint:*'); + } + if (parseSettings.debugLevel.has('eslint') || + // make sure we don't turn off the eslint debug if it was enabled via --debug + debug_1.default.enabled('eslint:*,-eslint:code-path')) { + // https://github.com/eslint/eslint/blob/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d/bin/eslint.js#L25 + namespaces.push('eslint:*,-eslint:code-path'); + } + debug_1.default.enable(namespaces.join(',')); + } + if (Array.isArray(tsestreeOptions.programs)) { + if (!tsestreeOptions.programs.length) { + throw new Error(`You have set parserOptions.programs to an empty array. This will cause all files to not be found in existing programs. Either provide one or more existing TypeScript Program instances in the array, or remove the parserOptions.programs setting.`); + } + log('parserOptions.programs was provided, so parserOptions.project will be ignored.'); + } + // Providing a program or project service overrides project resolution + if (!parseSettings.programs && !parseSettings.projectService) { + parseSettings.projects = (0, resolveProjectList_1.resolveProjectList)({ + cacheLifetime: tsestreeOptions.cacheLifetime, + project: (0, getProjectConfigFiles_1.getProjectConfigFiles)(parseSettings, tsestreeOptions.project), + projectFolderIgnoreList: tsestreeOptions.projectFolderIgnoreList, + singleRun: parseSettings.singleRun, + tsconfigRootDir, + }); + } + // No type-aware linting which means that cross-file (or even same-file) JSDoc is useless + // So in this specific case we default to 'none' if no value was provided + if (tsestreeOptions.jsDocParsingMode == null && + parseSettings.projects.size === 0 && + parseSettings.programs == null && + parseSettings.projectService == null) { + parseSettings.jsDocParsingMode = JSDocParsingMode.ParseNone; + } + (0, warnAboutTSVersion_1.warnAboutTSVersion)(parseSettings, passedLoggerFn); + return parseSettings; +} +function clearTSConfigMatchCache() { + TSCONFIG_MATCH_CACHE?.clear(); +} +function clearTSServerProjectService() { + TSSERVER_PROJECT_SERVICE = null; +} +/** + * Ensures source code is a string. + */ +function enforceCodeString(code) { + return (0, source_files_1.isSourceFile)(code) + ? code.getFullText(code) + : typeof code === 'string' + ? code + : String(code); +} +/** + * Compute the filename based on the parser options. + * + * Even if jsx option is set in typescript compiler, filename still has to + * contain .tsx file extension. + */ +function getFileName(jsx) { + return jsx ? 'estree.tsx' : 'estree.ts'; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.d.ts.map new file mode 100644 index 0000000..be48dc3 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getProjectConfigFiles.d.ts","sourceRoot":"","sources":["../../src/parseSettings/getProjectConfigFiles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,IAAI,CACjB,aAAa,EACb,UAAU,GAAG,oBAAoB,GAAG,iBAAiB,CACtD,EACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,GAClC,MAAM,EAAE,GAAG,IAAI,CAuCjB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js new file mode 100644 index 0000000..f487c73 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js @@ -0,0 +1,82 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getProjectConfigFiles = getProjectConfigFiles; +const debug_1 = __importDefault(require("debug")); +const fs = __importStar(require("node:fs")); +const path = __importStar(require("node:path")); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parseSettings:getProjectConfigFiles'); +/** + * Checks for a matching TSConfig to a file including its parent directories, + * permanently caching results under each directory it checks. + * + * @remarks + * We don't (yet!) have a way to attach file watchers on disk, but still need to + * cache file checks for rapid subsequent calls to fs.existsSync. See discussion + * in https://github.com/typescript-eslint/typescript-eslint/issues/101. + */ +function getProjectConfigFiles(parseSettings, project) { + if (project !== true) { + if (project == null || project === false) { + return null; + } + if (Array.isArray(project)) { + return project; + } + return [project]; + } + log('Looking for tsconfig.json at or above file: %s', parseSettings.filePath); + let directory = path.dirname(parseSettings.filePath); + const checkedDirectories = [directory]; + do { + log('Checking tsconfig.json path: %s', directory); + const tsconfigPath = path.join(directory, 'tsconfig.json'); + const cached = parseSettings.tsconfigMatchCache.get(directory) ?? + (fs.existsSync(tsconfigPath) && tsconfigPath); + if (cached) { + for (const directory of checkedDirectories) { + parseSettings.tsconfigMatchCache.set(directory, cached); + } + return [cached]; + } + directory = path.dirname(directory); + checkedDirectories.push(directory); + } while (directory.length > 1 && + directory.length >= parseSettings.tsconfigRootDir.length); + throw new Error(`project was set to \`true\` but couldn't find any tsconfig.json relative to '${parseSettings.filePath}' within '${parseSettings.tsconfigRootDir}'.`); +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts.map new file mode 100644 index 0000000..dda000a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parseSettings/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,KAAK,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,mBAAmB,CAAC;AAGjE,OAAO,QAAQ,YAAY,CAAC;IAE1B,KAAK,gBAAgB;KAAG;CACzB;AAED,OAAO,QAAQ,gCAAgC,CAAC;IAE9C,KAAK,gBAAgB;KAAG;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC;IAE7B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAE7B;;OAEG;IACH,UAAU,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IAE7B;;OAEG;IACH,2CAA2C,EAAE,OAAO,CAAC;IAErD;;OAEG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAE9B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,KAAK,IAAI,CAAC;IAE3D;;OAEG;IACH,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC;IAEtC;;;;OAIG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;OAEG;IACH,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAEtC;;OAEG;IACH,QAAQ,EAAE,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAE7C;;OAEG;IACH,cAAc,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAEnD;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,kCAAkC,EAAE,OAAO,CAAC;IAE5C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,kBAAkB,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9C;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.js b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.d.ts.map new file mode 100644 index 0000000..0c3f82e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inferSingleRun.d.ts","sourceRoot":"","sources":["../../src/parseSettings/inferSingleRun.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,GAAG,OAAO,CAsD5E"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js new file mode 100644 index 0000000..52c4af2 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js @@ -0,0 +1,65 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.inferSingleRun = inferSingleRun; +const node_path_1 = __importDefault(require("node:path")); +/** + * ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts, + * such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback + * on a file in an IDE). + * + * When typescript-eslint handles TypeScript Program management behind the scenes, this distinction + * is important because there is significant overhead to managing the so called Watch Programs + * needed for the long-running use-case. We therefore use the following logic to figure out which + * of these contexts applies to the current execution. + * + * @returns Whether this is part of a single run, rather than a long-running process. + */ +function inferSingleRun(options) { + // https://github.com/typescript-eslint/typescript-eslint/issues/9504 + // There's no support (yet?) for extraFileExtensions in single-run hosts. + // Only watch program hosts and project service can support that. + if (options?.extraFileExtensions?.length) { + return false; + } + if ( + // single-run implies type-aware linting - no projects means we can't be in single-run mode + options?.project == null || + // programs passed via options means the user should be managing the programs, so we shouldn't + // be creating our own single-run programs accidentally + options.programs != null) { + return false; + } + // Allow users to explicitly inform us of their intent to perform a single run (or not) with TSESTREE_SINGLE_RUN + if (process.env.TSESTREE_SINGLE_RUN === 'false') { + return false; + } + if (process.env.TSESTREE_SINGLE_RUN === 'true') { + return true; + } + // Ideally, we'd like to try to auto-detect CI or CLI usage that lets us infer a single CLI run. + if (!options.disallowAutomaticSingleRunInference) { + const possibleEslintBinPaths = [ + 'node_modules/.bin/eslint', // npm or yarn repo + 'node_modules/eslint/bin/eslint.js', // pnpm repo + ]; + if ( + // Default to single runs for CI processes. CI=true is set by most CI providers by default. + process.env.CI === 'true' || + // This will be true for invocations such as `npx eslint ...` and `./node_modules/.bin/eslint ...` + possibleEslintBinPaths.some(binPath => process.argv.length > 1 && + process.argv[1].endsWith(node_path_1.default.normalize(binPath)))) { + return !process.argv.includes('--fix'); + } + } + /** + * We default to assuming that this run could be part of a long-running session (e.g. in an IDE) + * and watch programs will therefore be required. + * + * Unless we can reliably infer otherwise, we default to assuming that this run could be part + * of a long-running session (e.g. in an IDE) and watch programs will therefore be required + */ + return false; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.d.ts.map new file mode 100644 index 0000000..ac7258e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolveProjectList.d.ts","sourceRoot":"","sources":["../../src/parseSettings/resolveProjectList.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAqBzD,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,QAAQ,CAAC;IAChB,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACjD,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,uBAAuB,EAAE,eAAe,CAAC,yBAAyB,CAAC,CAAC;IACpE,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC,GACD,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,CAgFpC;AAuBD;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js new file mode 100644 index 0000000..92f822a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js @@ -0,0 +1,99 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearGlobCache = clearGlobCache; +exports.resolveProjectList = resolveProjectList; +exports.clearGlobResolutionCache = clearGlobResolutionCache; +const debug_1 = __importDefault(require("debug")); +const fast_glob_1 = require("fast-glob"); +const is_glob_1 = __importDefault(require("is-glob")); +const shared_1 = require("../create-program/shared"); +const ExpiringCache_1 = require("./ExpiringCache"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parseSettings:resolveProjectList'); +let RESOLUTION_CACHE = null; +function clearGlobCache() { + RESOLUTION_CACHE?.clear(); +} +/** + * Normalizes, sanitizes, resolves and filters the provided project paths + */ +function resolveProjectList(options) { + const sanitizedProjects = []; + // Normalize and sanitize the project paths + if (options.project != null) { + for (const project of options.project) { + if (typeof project === 'string') { + sanitizedProjects.push(project); + } + } + } + if (sanitizedProjects.length === 0) { + return new Map(); + } + const projectFolderIgnoreList = (options.projectFolderIgnoreList ?? ['**/node_modules/**']) + .filter(folder => typeof folder === 'string') + // prefix with a ! for not match glob + .map(folder => (folder.startsWith('!') ? folder : `!${folder}`)); + const cacheKey = getHash({ + project: sanitizedProjects, + projectFolderIgnoreList, + tsconfigRootDir: options.tsconfigRootDir, + }); + if (RESOLUTION_CACHE == null) { + // note - we initialize the global cache based on the first config we encounter. + // this does mean that you can't have multiple lifetimes set per folder + // I doubt that anyone will really bother reconfiguring this, let alone + // try to do complicated setups, so we'll deal with this later if ever. + RESOLUTION_CACHE = new ExpiringCache_1.ExpiringCache(options.singleRun + ? 'Infinity' + : (options.cacheLifetime?.glob ?? + ExpiringCache_1.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS)); + } + else { + const cached = RESOLUTION_CACHE.get(cacheKey); + if (cached) { + return cached; + } + } + // Transform glob patterns into paths + const nonGlobProjects = sanitizedProjects.filter(project => !(0, is_glob_1.default)(project)); + const globProjects = sanitizedProjects.filter(project => (0, is_glob_1.default)(project)); + let globProjectPaths = []; + if (globProjects.length > 0) { + // Although fast-glob supports multiple patterns, fast-glob returns arbitrary order of results + // to improve performance. To ensure the order is correct, we need to call fast-glob for each pattern + // separately and then concatenate the results in patterns' order. + globProjectPaths = globProjects.flatMap(pattern => (0, fast_glob_1.sync)(pattern, { + cwd: options.tsconfigRootDir, + ignore: projectFolderIgnoreList, + })); + } + const uniqueCanonicalProjectPaths = new Map([...nonGlobProjects, ...globProjectPaths].map(project => [ + (0, shared_1.getCanonicalFileName)((0, shared_1.ensureAbsolutePath)(project, options.tsconfigRootDir)), + (0, shared_1.ensureAbsolutePath)(project, options.tsconfigRootDir), + ])); + log('parserOptions.project (excluding ignored) matched projects: %s', uniqueCanonicalProjectPaths); + RESOLUTION_CACHE.set(cacheKey, uniqueCanonicalProjectPaths); + return uniqueCanonicalProjectPaths; +} +function getHash({ project, projectFolderIgnoreList, tsconfigRootDir, }) { + // create a stable representation of the config + const hashObject = { + tsconfigRootDir, + // the project order does matter and can impact the resolved globs + project, + // the ignore order won't doesn't ever matter + projectFolderIgnoreList: [...projectFolderIgnoreList].sort(), + }; + return (0, shared_1.createHash)(JSON.stringify(hashObject)); +} +/** + * Exported for testing purposes only + * @internal + */ +function clearGlobResolutionCache() { + RESOLUTION_CACHE?.clear(); + RESOLUTION_CACHE = null; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts.map new file mode 100644 index 0000000..c629dd6 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"warnAboutTSVersion.d.ts","sourceRoot":"","sources":["../../src/parseSettings/warnAboutTSVersion.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C;;GAEG;AACH,eAAO,MAAM,6BAA6B,mBAAmB,CAAC;AAe9D,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,OAAO,GACtB,IAAI,CA8BN"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js new file mode 100644 index 0000000..d867b74 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js @@ -0,0 +1,81 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SUPPORTED_TYPESCRIPT_VERSIONS = void 0; +exports.warnAboutTSVersion = warnAboutTSVersion; +const semver_1 = __importDefault(require("semver")); +const ts = __importStar(require("typescript")); +const version_1 = require("../version"); +/** + * This needs to be kept in sync with package.json in the typescript-eslint monorepo + */ +exports.SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.8.4 <5.9.0'; +/* + * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one + * List them all separately here, so we can automatically create the full string + */ +const SUPPORTED_PRERELEASE_RANGES = []; +const ACTIVE_TYPESCRIPT_VERSION = ts.version; +const isRunningSupportedTypeScriptVersion = semver_1.default.satisfies(ACTIVE_TYPESCRIPT_VERSION, [exports.SUPPORTED_TYPESCRIPT_VERSIONS, ...SUPPORTED_PRERELEASE_RANGES].join(' || ')); +let warnedAboutTSVersion = false; +function warnAboutTSVersion(parseSettings, passedLoggerFn) { + if (isRunningSupportedTypeScriptVersion || warnedAboutTSVersion) { + return; + } + if (passedLoggerFn || + // See https://github.com/typescript-eslint/typescript-eslint/issues/7896 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + (typeof process === 'undefined' ? false : process.stdout?.isTTY)) { + const border = '============='; + const versionWarning = [ + border, + '\n', + 'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.', + '\n', + `* @typescript-eslint/typescript-estree version: ${version_1.version}`, + `* Supported TypeScript versions: ${exports.SUPPORTED_TYPESCRIPT_VERSIONS}`, + `* Your TypeScript version: ${ACTIVE_TYPESCRIPT_VERSION}`, + '\n', + 'Please only submit bug reports when using the officially supported version.', + '\n', + border, + ].join('\n'); + parseSettings.log(versionWarning); + } + warnedAboutTSVersion = true; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map new file mode 100644 index 0000000..dd7a5c9 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser-options.d.ts","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map new file mode 100644 index 0000000..7e286db --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,KAAK,EACV,cAAc,EAEd,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA4B5C,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAGD,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AA8CD,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,IAAI,GACnE;IAAE,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAA;CAAE,GAChC,EAAE,CAAC,GACL,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAA;CAAE,GAAG,EAAE,CAAC,GAC9D,QAAQ,CAAC,OAAO,CAAC;AAGnB,MAAM,WAAW,8BAA8B,CAAC,CAAC,SAAS,eAAe;IACvE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAMD,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAC/D,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,CAAC,GACV,GAAG,CAAC,CAAC,CAAC,CAGR;AA4CD,wBAAgB,kCAAkC,IAAI,IAAI,CAEzD;AAED,wBAAgB,wBAAwB,CACtC,CAAC,SAAS,eAAe,GAAG,eAAe,EAE3C,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,EAC5B,eAAe,EAAE,CAAC,GACjB,8BAA8B,CAAC,CAAC,CAAC,CA+GnC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser.js b/node_modules/@typescript-eslint/typescript-estree/dist/parser.js new file mode 100644 index 0000000..8fb3aa2 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser.js @@ -0,0 +1,180 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearProgramCache = clearProgramCache; +exports.clearDefaultProjectMatchedFiles = clearDefaultProjectMatchedFiles; +exports.parse = parse; +exports.clearParseAndGenerateServicesCalls = clearParseAndGenerateServicesCalls; +exports.parseAndGenerateServices = parseAndGenerateServices; +const debug_1 = __importDefault(require("debug")); +const ast_converter_1 = require("./ast-converter"); +const convert_1 = require("./convert"); +const createIsolatedProgram_1 = require("./create-program/createIsolatedProgram"); +const createProjectProgram_1 = require("./create-program/createProjectProgram"); +const createSourceFile_1 = require("./create-program/createSourceFile"); +const getWatchProgramsForProjects_1 = require("./create-program/getWatchProgramsForProjects"); +const useProvidedPrograms_1 = require("./create-program/useProvidedPrograms"); +const createParserServices_1 = require("./createParserServices"); +const createParseSettings_1 = require("./parseSettings/createParseSettings"); +const semantic_or_syntactic_errors_1 = require("./semantic-or-syntactic-errors"); +const useProgramFromProjectService_1 = require("./useProgramFromProjectService"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parser'); +/** + * Cache existing programs for the single run use-case. + * + * clearProgramCache() is only intended to be used in testing to ensure the parser is clean between tests. + */ +const existingPrograms = new Map(); +function clearProgramCache() { + existingPrograms.clear(); +} +const defaultProjectMatchedFiles = new Set(); +function clearDefaultProjectMatchedFiles() { + defaultProjectMatchedFiles.clear(); +} +/** + * @param parseSettings Internal settings for parsing the file + * @param hasFullTypeInformation True if the program should be attempted to be calculated from provided tsconfig files + * @returns Returns a source file and program corresponding to the linted code + */ +function getProgramAndAST(parseSettings, hasFullTypeInformation) { + if (parseSettings.projectService) { + const fromProjectService = (0, useProgramFromProjectService_1.useProgramFromProjectService)(parseSettings.projectService, parseSettings, hasFullTypeInformation, defaultProjectMatchedFiles); + if (fromProjectService) { + return fromProjectService; + } + } + if (parseSettings.programs) { + const fromProvidedPrograms = (0, useProvidedPrograms_1.useProvidedPrograms)(parseSettings.programs, parseSettings); + if (fromProvidedPrograms) { + return fromProvidedPrograms; + } + } + // no need to waste time creating a program as the caller didn't want parser services + // so we can save time and just create a lonesome source file + if (!hasFullTypeInformation) { + return (0, createSourceFile_1.createNoProgram)(parseSettings); + } + return (0, createProjectProgram_1.createProjectProgram)(parseSettings, (0, getWatchProgramsForProjects_1.getWatchProgramsForProjects)(parseSettings)); +} +function parse(code, options) { + const { ast } = parseWithNodeMapsInternal(code, options, false); + return ast; +} +function parseWithNodeMapsInternal(code, options, shouldPreserveNodeMaps) { + /** + * Reset the parse configuration + */ + const parseSettings = (0, createParseSettings_1.createParseSettings)(code, options); + /** + * Ensure users do not attempt to use parse() when they need parseAndGenerateServices() + */ + if (options?.errorOnTypeScriptSyntacticAndSemanticIssues) { + throw new Error(`"errorOnTypeScriptSyntacticAndSemanticIssues" is only supported for parseAndGenerateServices()`); + } + /** + * Create a ts.SourceFile directly, no ts.Program is needed for a simple parse + */ + const ast = (0, createSourceFile_1.createSourceFile)(parseSettings); + /** + * Convert the TypeScript AST to an ESTree-compatible one + */ + const { astMaps, estree } = (0, ast_converter_1.astConverter)(ast, parseSettings, shouldPreserveNodeMaps); + return { + ast: estree, + esTreeNodeToTSNodeMap: astMaps.esTreeNodeToTSNodeMap, + tsNodeToESTreeNodeMap: astMaps.tsNodeToESTreeNodeMap, + }; +} +let parseAndGenerateServicesCalls = {}; +// Privately exported utility intended for use in typescript-eslint unit tests only +function clearParseAndGenerateServicesCalls() { + parseAndGenerateServicesCalls = {}; +} +function parseAndGenerateServices(code, tsestreeOptions) { + /** + * Reset the parse configuration + */ + const parseSettings = (0, createParseSettings_1.createParseSettings)(code, tsestreeOptions); + /** + * If this is a single run in which the user has not provided any existing programs but there + * are programs which need to be created from the provided "project" option, + * create an Iterable which will lazily create the programs as needed by the iteration logic + */ + if (parseSettings.singleRun && + !parseSettings.programs && + parseSettings.projects.size > 0) { + parseSettings.programs = { + *[Symbol.iterator]() { + for (const configFile of parseSettings.projects) { + const existingProgram = existingPrograms.get(configFile[0]); + if (existingProgram) { + yield existingProgram; + } + else { + log('Detected single-run/CLI usage, creating Program once ahead of time for project: %s', configFile); + const newProgram = (0, useProvidedPrograms_1.createProgramFromConfigFile)(configFile[1]); + existingPrograms.set(configFile[0], newProgram); + yield newProgram; + } + } + }, + }; + } + const hasFullTypeInformation = parseSettings.programs != null || + parseSettings.projects.size > 0 || + !!parseSettings.projectService; + if (typeof tsestreeOptions.errorOnTypeScriptSyntacticAndSemanticIssues === + 'boolean' && + tsestreeOptions.errorOnTypeScriptSyntacticAndSemanticIssues) { + parseSettings.errorOnTypeScriptSyntacticAndSemanticIssues = true; + } + if (parseSettings.errorOnTypeScriptSyntacticAndSemanticIssues && + !hasFullTypeInformation) { + throw new Error('Cannot calculate TypeScript semantic issues without a valid project.'); + } + /** + * If we are in singleRun mode but the parseAndGenerateServices() function has been called more than once for the current file, + * it must mean that we are in the middle of an ESLint automated fix cycle (in which parsing can be performed up to an additional + * 10 times in order to apply all possible fixes for the file). + * + * In this scenario we cannot rely upon the singleRun AOT compiled programs because the SourceFiles will not contain the source + * with the latest fixes applied. Therefore we fallback to creating the quickest possible isolated program from the updated source. + */ + if (parseSettings.singleRun && tsestreeOptions.filePath) { + parseAndGenerateServicesCalls[tsestreeOptions.filePath] = + (parseAndGenerateServicesCalls[tsestreeOptions.filePath] || 0) + 1; + } + const { ast, program } = parseSettings.singleRun && + tsestreeOptions.filePath && + parseAndGenerateServicesCalls[tsestreeOptions.filePath] > 1 + ? (0, createIsolatedProgram_1.createIsolatedProgram)(parseSettings) + : getProgramAndAST(parseSettings, hasFullTypeInformation); + /** + * Convert the TypeScript AST to an ESTree-compatible one, and optionally preserve + * mappings between converted and original AST nodes + */ + const shouldPreserveNodeMaps = typeof parseSettings.preserveNodeMaps === 'boolean' + ? parseSettings.preserveNodeMaps + : true; + const { astMaps, estree } = (0, ast_converter_1.astConverter)(ast, parseSettings, shouldPreserveNodeMaps); + /** + * Even if TypeScript parsed the source code ok, and we had no problems converting the AST, + * there may be other syntactic or semantic issues in the code that we can optionally report on. + */ + if (program && parseSettings.errorOnTypeScriptSyntacticAndSemanticIssues) { + const error = (0, semantic_or_syntactic_errors_1.getFirstSemanticOrSyntacticError)(program, ast); + if (error) { + throw (0, convert_1.convertError)(error); + } + } + /** + * Return the converted AST and additional parser services + */ + return { + ast: estree, + services: (0, createParserServices_1.createParserServices)(astMaps, program), + }; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts.map new file mode 100644 index 0000000..63d13a7 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"semantic-or-syntactic-errors.d.ts","sourceRoot":"","sources":["../src/semantic-or-syntactic-errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,OAAO,EACP,UAAU,EACX,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,UAAU,GACd,wBAAwB,GAAG,SAAS,CAmCtC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js new file mode 100644 index 0000000..5e77d97 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js @@ -0,0 +1,94 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFirstSemanticOrSyntacticError = getFirstSemanticOrSyntacticError; +const typescript_1 = require("typescript"); +/** + * By default, diagnostics from the TypeScript compiler contain all errors - regardless of whether + * they are related to generic ECMAScript standards, or TypeScript-specific constructs. + * + * Therefore, we filter out all diagnostics, except for the ones we explicitly want to consider when + * the user opts in to throwing errors on semantic issues. + */ +function getFirstSemanticOrSyntacticError(program, ast) { + try { + const supportedSyntacticDiagnostics = allowlistSupportedDiagnostics(program.getSyntacticDiagnostics(ast)); + if (supportedSyntacticDiagnostics.length > 0) { + return convertDiagnosticToSemanticOrSyntacticError(supportedSyntacticDiagnostics[0]); + } + const supportedSemanticDiagnostics = allowlistSupportedDiagnostics(program.getSemanticDiagnostics(ast)); + if (supportedSemanticDiagnostics.length > 0) { + return convertDiagnosticToSemanticOrSyntacticError(supportedSemanticDiagnostics[0]); + } + return undefined; + } + catch (e) { + /** + * TypeScript compiler has certain Debug.fail() statements in, which will cause the diagnostics + * retrieval above to throw. + * + * E.g. from ast-alignment-tests + * "Debug Failure. Shouldn't ever directly check a JsxOpeningElement" + * + * For our current use-cases this is undesired behavior, so we just suppress it + * and log a warning. + */ + /* istanbul ignore next */ + console.warn(`Warning From TSC: "${e.message}`); // eslint-disable-line no-console + /* istanbul ignore next */ + return undefined; + } +} +function allowlistSupportedDiagnostics(diagnostics) { + return diagnostics.filter(diagnostic => { + switch (diagnostic.code) { + case 1013: // "A rest parameter or binding pattern may not have a trailing comma." + case 1014: // "A rest parameter must be last in a parameter list." + case 1044: // "'{0}' modifier cannot appear on a module or namespace element." + case 1045: // "A '{0}' modifier cannot be used with an interface declaration." + case 1048: // "A rest parameter cannot have an initializer." + case 1049: // "A 'set' accessor must have exactly one parameter." + case 1070: // "'{0}' modifier cannot appear on a type member." + case 1071: // "'{0}' modifier cannot appear on an index signature." + case 1085: // "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." + case 1090: // "'{0}' modifier cannot appear on a parameter." + case 1096: // "An index signature must have exactly one parameter." + case 1097: // "'{0}' list cannot be empty." + case 1098: // "Type parameter list cannot be empty." + case 1099: // "Type argument list cannot be empty." + case 1117: // "An object literal cannot have multiple properties with the same name in strict mode." + case 1121: // "Octal literals are not allowed in strict mode." + case 1123: // "Variable declaration list cannot be empty." + case 1141: // "String literal expected." + case 1162: // "An object member cannot be declared optional." + case 1164: // "Computed property names are not allowed in enums." + case 1172: // "'extends' clause already seen." + case 1173: // "'extends' clause must precede 'implements' clause." + case 1175: // "'implements' clause already seen." + case 1176: // "Interface declaration cannot have 'implements' clause." + case 1190: // "The variable declaration of a 'for...of' statement cannot have an initializer." + case 1196: // "Catch clause variable type annotation must be 'any' or 'unknown' if specified." + case 1200: // "Line terminator not permitted before arrow." + case 1206: // "Decorators are not valid here." + case 1211: // "A class declaration without the 'default' modifier must have a name." + case 1242: // "'abstract' modifier can only appear on a class, method, or property declaration." + case 1246: // "An interface property cannot have an initializer." + case 1255: // "A definite assignment assertion '!' is not permitted in this context." + case 1308: // "'await' expression is only allowed within an async function." + case 2364: // "The left-hand side of an assignment expression must be a variable or a property access." + case 2369: // "A parameter property is only allowed in a constructor implementation." + case 2452: // "An enum member cannot have a numeric name." + case 2462: // "A rest element must be last in a destructuring pattern." + case 8017: // "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." + case 17012: // "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" + case 17013: // "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." + return true; + } + return false; + }); +} +function convertDiagnosticToSemanticOrSyntacticError(diagnostic) { + return { + ...diagnostic, + message: (0, typescript_1.flattenDiagnosticMessageText)(diagnostic.messageText, typescript_1.sys.newLine), + }; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map new file mode 100644 index 0000000..9abec97 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simple-traverse.d.ts","sourceRoot":"","sources":["../src/simple-traverse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAInE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAmB5C,KAAK,qBAAqB,GAAG,QAAQ,CACjC;IACE,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,WAAW,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CACrC,GACD;IACE,WAAW,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACpC,QAAQ,EAAE,MAAM,CACd,MAAM,EACN,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,KAAK,IAAI,CACjE,CAAC;CACH,CACJ,CAAC;AAiDF,wBAAgB,cAAc,CAC5B,YAAY,EAAE,QAAQ,CAAC,IAAI,EAC3B,OAAO,EAAE,qBAAqB,EAC9B,iBAAiB,UAAQ,GACxB,IAAI,CAKN"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js new file mode 100644 index 0000000..6960df2 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.simpleTraverse = simpleTraverse; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +function isValidNode(x) { + return (typeof x === 'object' && + x != null && + 'type' in x && + typeof x.type === 'string'); +} +function getVisitorKeysForNode(allVisitorKeys, node) { + const keys = allVisitorKeys[node.type]; + return (keys ?? []); +} +class SimpleTraverser { + allVisitorKeys = visitor_keys_1.visitorKeys; + selectors; + setParentPointers; + constructor(selectors, setParentPointers = false) { + this.selectors = selectors; + this.setParentPointers = setParentPointers; + if (selectors.visitorKeys) { + this.allVisitorKeys = selectors.visitorKeys; + } + } + traverse(node, parent) { + if (!isValidNode(node)) { + return; + } + if (this.setParentPointers) { + node.parent = parent; + } + if ('enter' in this.selectors) { + this.selectors.enter(node, parent); + } + else if (node.type in this.selectors.visitors) { + this.selectors.visitors[node.type](node, parent); + } + const keys = getVisitorKeysForNode(this.allVisitorKeys, node); + if (keys.length < 1) { + return; + } + for (const key of keys) { + const childOrChildren = node[key]; + if (Array.isArray(childOrChildren)) { + for (const child of childOrChildren) { + this.traverse(child, node); + } + } + else { + this.traverse(childOrChildren, node); + } + } + } +} +function simpleTraverse(startingNode, options, setParentPointers = false) { + new SimpleTraverser(options, setParentPointers).traverse(startingNode, undefined); +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/source-files.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/source-files.d.ts.map new file mode 100644 index 0000000..68685a9 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/source-files.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-files.d.ts","sourceRoot":"","sources":["../src/source-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC,UAAU,CAUjE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,GAAG,MAAM,CAEhE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/source-files.js b/node_modules/@typescript-eslint/typescript-estree/dist/source-files.js new file mode 100644 index 0000000..51151c0 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/source-files.js @@ -0,0 +1,49 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSourceFile = isSourceFile; +exports.getCodeText = getCodeText; +const ts = __importStar(require("typescript")); +function isSourceFile(code) { + if (typeof code !== 'object' || code == null) { + return false; + } + const maybeSourceFile = code; + return (maybeSourceFile.kind === ts.SyntaxKind.SourceFile && + typeof maybeSourceFile.getFullText === 'function'); +} +function getCodeText(code) { + return isSourceFile(code) ? code.getFullText(code) : code; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map new file mode 100644 index 0000000..9f13f56 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"estree-to-ts-node-types.d.ts","sourceRoot":"","sources":["../../src/ts-estree/estree-to-ts-node-types.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts.map new file mode 100644 index 0000000..8b22372 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts-estree/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,GACT,MAAM,0BAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js new file mode 100644 index 0000000..2782aae --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js @@ -0,0 +1,24 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSESTree = exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +// for simplicity and backwards-compatibility +__exportStar(require("./estree-to-ts-node-types"), exports); +__exportStar(require("./ts-nodes"), exports); +var types_1 = require("@typescript-eslint/types"); +Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return types_1.AST_NODE_TYPES; } }); +Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return types_1.AST_TOKEN_TYPES; } }); +Object.defineProperty(exports, "TSESTree", { enumerable: true, get: function () { return types_1.TSESTree; } }); diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map new file mode 100644 index 0000000..e676701 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-nodes.d.ts","sourceRoot":"","sources":["../../src/ts-estree/ts-nodes.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.d.ts.map new file mode 100644 index 0000000..0cfba63 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"use-at-your-own-risk.d.ts","sourceRoot":"","sources":["../src/use-at-your-own-risk.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAG7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.js b/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.js new file mode 100644 index 0000000..2be33cd --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.js @@ -0,0 +1,27 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getCanonicalFileName = exports.typescriptVersionIsAtLeast = void 0; +// required by website +__exportStar(require("./ast-converter"), exports); +__exportStar(require("./create-program/getScriptKind"), exports); +// required by packages/utils/src/ts-estree.ts +__exportStar(require("./getModifiers"), exports); +var version_check_1 = require("./version-check"); +Object.defineProperty(exports, "typescriptVersionIsAtLeast", { enumerable: true, get: function () { return version_check_1.typescriptVersionIsAtLeast; } }); +// required by packages/type-utils +var shared_1 = require("./create-program/shared"); +Object.defineProperty(exports, "getCanonicalFileName", { enumerable: true, get: function () { return shared_1.getCanonicalFileName; } }); diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.d.ts.map new file mode 100644 index 0000000..1878d70 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useProgramFromProjectService.d.ts","sourceRoot":"","sources":["../src/useProgramFromProjectService.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EACf,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AA4M5D,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,sBAAsB,EAChC,aAAa,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC7C,sBAAsB,EAAE,OAAO,EAC/B,0BAA0B,EAAE,GAAG,CAAC,MAAM,CAAC,GACtC,aAAa,GAAG,SAAS,CAAC;AAC7B,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,sBAAsB,EAChC,aAAa,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC7C,sBAAsB,EAAE,IAAI,EAC5B,0BAA0B,EAAE,GAAG,CAAC,MAAM,CAAC,GACtC,qBAAqB,GAAG,SAAS,CAAC;AACrC,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,sBAAsB,EAChC,aAAa,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC7C,sBAAsB,EAAE,KAAK,EAC7B,0BAA0B,EAAE,GAAG,CAAC,MAAM,CAAC,GACtC,eAAe,GAAG,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js b/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js new file mode 100644 index 0000000..31e6875 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js @@ -0,0 +1,196 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useProgramFromProjectService = useProgramFromProjectService; +const debug_1 = __importDefault(require("debug")); +const minimatch_1 = require("minimatch"); +const node_path_1 = __importDefault(require("node:path")); +const node_util_1 = __importDefault(require("node:util")); +const ts = __importStar(require("typescript")); +const createProjectProgram_1 = require("./create-program/createProjectProgram"); +const createSourceFile_1 = require("./create-program/createSourceFile"); +const shared_1 = require("./create-program/shared"); +const validateDefaultProjectForFilesGlob_1 = require("./create-program/validateDefaultProjectForFilesGlob"); +const RELOAD_THROTTLE_MS = 250; +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:useProgramFromProjectService'); +const serviceFileExtensions = new WeakMap(); +const updateExtraFileExtensions = (service, extraFileExtensions) => { + const currentServiceFileExtensions = serviceFileExtensions.get(service) ?? []; + if (!node_util_1.default.isDeepStrictEqual(currentServiceFileExtensions, extraFileExtensions)) { + log('Updating extra file extensions: before=%s: after=%s', currentServiceFileExtensions, extraFileExtensions); + service.setHostConfiguration({ + extraFileExtensions: extraFileExtensions.map(extension => ({ + extension, + isMixedContent: false, + scriptKind: ts.ScriptKind.Deferred, + })), + }); + serviceFileExtensions.set(service, extraFileExtensions); + log('Extra file extensions updated: %o', extraFileExtensions); + } +}; +function openClientFileFromProjectService(defaultProjectMatchedFiles, isDefaultProjectAllowed, filePathAbsolute, parseSettings, serviceSettings) { + const opened = openClientFileAndMaybeReload(); + log('Result from attempting to open client file: %o', opened); + log('Default project allowed path: %s, based on config file: %s', isDefaultProjectAllowed, opened.configFileName); + if (opened.configFileName) { + if (isDefaultProjectAllowed) { + throw new Error(`${parseSettings.filePath} was included by allowDefaultProject but also was found in the project service. Consider removing it from allowDefaultProject.`); + } + } + else { + const wasNotFound = `${parseSettings.filePath} was not found by the project service`; + const fileExtension = node_path_1.default.extname(parseSettings.filePath); + const extraFileExtensions = parseSettings.extraFileExtensions; + if (!shared_1.DEFAULT_EXTRA_FILE_EXTENSIONS.has(fileExtension) && + !extraFileExtensions.includes(fileExtension)) { + const nonStandardExt = `${wasNotFound} because the extension for the file (\`${fileExtension}\`) is non-standard`; + if (extraFileExtensions.length > 0) { + throw new Error(`${nonStandardExt}. It should be added to your existing \`parserOptions.extraFileExtensions\`.`); + } + else { + throw new Error(`${nonStandardExt}. You should add \`parserOptions.extraFileExtensions\` to your config.`); + } + } + if (!isDefaultProjectAllowed) { + throw new Error(`${wasNotFound}. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`); + } + } + // No a configFileName indicates this file wasn't included in a TSConfig. + // That means it must get its type information from the default project. + if (!opened.configFileName) { + defaultProjectMatchedFiles.add(filePathAbsolute); + if (defaultProjectMatchedFiles.size > + serviceSettings.maximumDefaultProjectFileMatchCount) { + const filePrintLimit = 20; + const filesToPrint = [...defaultProjectMatchedFiles].slice(0, filePrintLimit); + const truncatedFileCount = defaultProjectMatchedFiles.size - filesToPrint.length; + throw new Error(`Too many files (>${serviceSettings.maximumDefaultProjectFileMatchCount}) have matched the default project.${validateDefaultProjectForFilesGlob_1.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION} +Matching files: +${filesToPrint.map(file => `- ${file}`).join('\n')} +${truncatedFileCount ? `...and ${truncatedFileCount} more files\n` : ''} +If you absolutely need more files included, set parserOptions.projectService.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING to a larger value. +`); + } + } + return opened; + function openClientFile() { + return serviceSettings.service.openClientFile(filePathAbsolute, parseSettings.codeFullText, + /* scriptKind */ undefined, parseSettings.tsconfigRootDir); + } + function openClientFileAndMaybeReload() { + log('Opening project service client file at path: %s', filePathAbsolute); + let opened = openClientFile(); + // If no project included the file and we're not in single-run mode, + // we might be running in an editor with outdated file info. + // We can try refreshing the project service - debounced for performance. + if (!opened.configFileErrors && + !opened.configFileName && + !parseSettings.singleRun && + !isDefaultProjectAllowed && + performance.now() - serviceSettings.lastReloadTimestamp > + RELOAD_THROTTLE_MS) { + log('No config file found; reloading project service and retrying.'); + serviceSettings.service.reloadProjects(); + opened = openClientFile(); + serviceSettings.lastReloadTimestamp = performance.now(); + } + return opened; + } +} +function createNoProgramWithProjectService(filePathAbsolute, parseSettings, service) { + log('No project service information available. Creating no program.'); + // If the project service knows about this file, this informs if of changes. + // Doing so ensures that: + // - if the file is not part of a project, we don't waste time creating a program (fast non-type-aware linting) + // - otherwise, we refresh the file in the project service (moderately fast, since the project is already loaded) + if (service.getScriptInfo(filePathAbsolute)) { + log('Script info available. Opening client file in project service.'); + service.openClientFile(filePathAbsolute, parseSettings.codeFullText, + /* scriptKind */ undefined, parseSettings.tsconfigRootDir); + } + return (0, createSourceFile_1.createNoProgram)(parseSettings); +} +function retrieveASTAndProgramFor(filePathAbsolute, parseSettings, serviceSettings) { + log('Retrieving script info and then program for: %s', filePathAbsolute); + const scriptInfo = serviceSettings.service.getScriptInfo(filePathAbsolute); + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + const program = serviceSettings.service + .getDefaultProjectForFile(scriptInfo.fileName, true) + .getLanguageService(/*ensureSynchronized*/ true) + .getProgram(); + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + if (!program) { + log('Could not find project service program for: %s', filePathAbsolute); + return undefined; + } + log('Found project service program for: %s', filePathAbsolute); + return (0, createProjectProgram_1.createProjectProgram)(parseSettings, [program]); +} +function useProgramFromProjectService(serviceSettings, parseSettings, hasFullTypeInformation, defaultProjectMatchedFiles) { + // NOTE: triggers a full project reload when changes are detected + updateExtraFileExtensions(serviceSettings.service, parseSettings.extraFileExtensions); + // We don't canonicalize the filename because it caused a performance regression. + // See https://github.com/typescript-eslint/typescript-eslint/issues/8519 + const filePathAbsolute = absolutify(parseSettings.filePath, serviceSettings); + log('Opening project service file for: %s at absolute path %s', parseSettings.filePath, filePathAbsolute); + const filePathRelative = node_path_1.default.relative(parseSettings.tsconfigRootDir, filePathAbsolute); + const isDefaultProjectAllowed = filePathMatchedBy(filePathRelative, serviceSettings.allowDefaultProject); + // Type-aware linting is disabled for this file. + // However, type-aware lint rules might still rely on its contents. + if (!hasFullTypeInformation && !isDefaultProjectAllowed) { + return createNoProgramWithProjectService(filePathAbsolute, parseSettings, serviceSettings.service); + } + // If type info was requested, we attempt to open it in the project service. + // By now, the file is known to be one of: + // - in the project service (valid configuration) + // - allowlisted in the default project (valid configuration) + // - neither, which openClientFileFromProjectService will throw an error for + const opened = hasFullTypeInformation && + openClientFileFromProjectService(defaultProjectMatchedFiles, isDefaultProjectAllowed, filePathAbsolute, parseSettings, serviceSettings); + log('Opened project service file: %o', opened); + return retrieveASTAndProgramFor(filePathAbsolute, parseSettings, serviceSettings); +} +function absolutify(filePath, serviceSettings) { + return node_path_1.default.isAbsolute(filePath) + ? filePath + : node_path_1.default.join(serviceSettings.service.host.getCurrentDirectory(), filePath); +} +function filePathMatchedBy(filePath, allowDefaultProject) { + return !!allowDefaultProject?.some(pattern => (0, minimatch_1.minimatch)(filePath, pattern)); +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map new file mode 100644 index 0000000..602feb1 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../src/version-check.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,QAAQ,mEASJ,CAAC;AACX,KAAK,QAAQ,GAAG,OAAO,QAAQ,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEvE,eAAO,MAAM,0BAA0B,EAAS,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js new file mode 100644 index 0000000..81a2c89 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js @@ -0,0 +1,57 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typescriptVersionIsAtLeast = void 0; +const semver = __importStar(require("semver")); +const ts = __importStar(require("typescript")); +function semverCheck(version) { + return semver.satisfies(ts.version, `>= ${version}.0 || >= ${version}.1-rc || >= ${version}.0-beta`, { + includePrerelease: true, + }); +} +const versions = [ + '4.7', + '4.8', + '4.9', + '5.0', + '5.1', + '5.2', + '5.3', + '5.4', +]; +exports.typescriptVersionIsAtLeast = {}; +for (const version of versions) { + exports.typescriptVersionIsAtLeast[version] = semverCheck(version); +} diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/version.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/version.d.ts.map new file mode 100644 index 0000000..70ffa1c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/version.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,EAAE,MAA2C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/version.js b/node_modules/@typescript-eslint/typescript-estree/dist/version.js new file mode 100644 index 0000000..b303ecb --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/version.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = void 0; +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access +exports.version = require('../package.json').version; diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.d.ts.map new file mode 100644 index 0000000..9d9db9e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"withoutProjectParserOptions.d.ts","sourceRoot":"","sources":["../src/withoutProjectParserOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,SAAS,MAAM,EAChE,IAAI,EAAE,OAAO,GACZ,IAAI,CACL,OAAO,EACP,gCAAgC,GAAG,SAAS,GAAG,gBAAgB,CAChE,CAMA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js b/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js new file mode 100644 index 0000000..365ba9b --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withoutProjectParserOptions = withoutProjectParserOptions; +/** + * Removes options that prompt the parser to parse the project with type + * information. In other words, you can use this if you are invoking the parser + * directly, to ensure that one file will be parsed in isolation, which is much, + * much faster. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/8428 + */ +function withoutProjectParserOptions(opts) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- The variables are meant to be omitted + const { EXPERIMENTAL_useProjectService, project, projectService, ...rest } = opts; + return rest; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/LICENSE b/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000..de32266 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/README.md b/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..e55c583 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/README.md @@ -0,0 +1,135 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..4af9dde --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/index.js @@ -0,0 +1,203 @@ +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m) return [str]; + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; + + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand(n[j], false)); + } + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + } + + return expansions; +} + diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/package.json b/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..7097d41 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/package.json @@ -0,0 +1,46 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "2.0.1", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0" + }, + "devDependencies": { + "@c4312/matcha": "^1.3.1", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/LICENSE b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..1493534 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/README.md b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/README.md new file mode 100644 index 0000000..3c97a02 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/README.md @@ -0,0 +1,454 @@ +# minimatch + +A minimal matching utility. + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```js +// hybrid module, load with require() or import +import { minimatch } from 'minimatch' +// or: +const { minimatch } = require('minimatch') + +minimatch('bar.foo', '*.foo') // true! +minimatch('bar.foo', '*.bar') // false! +minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +- Brace Expansion +- Extended glob matching +- "Globstar" `**` matching +- [Posix character + classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html), + like `[[:alpha:]]`, supporting the full range of Unicode + characters. For example, `[[:alpha:]]` will match against + `'é'`, though `[a-zA-Z]` will not. Collating symbol and set + matching is not supported, so `[[=e=]]` will _not_ match `'é'` + and `[[.ch.]]` will not match `'ch'` in locales where `ch` is + considered a single character. + +See: + +- `man sh` +- `man bash` [Pattern + Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) +- `man 3 fnmatch` +- `man 5 gitignore` + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes in patterns +will always be interpreted as escape characters, not path separators. + +Note that `\` or `/` _will_ be interpreted as path separators in paths on +Windows, and will match against `/` in glob expressions. + +So just always use `/` in patterns. + +### UNC Paths + +On Windows, UNC paths like `//?/c:/...` or +`//ComputerName/Share/...` are handled specially. + +- Patterns starting with a double-slash followed by some + non-slash characters will preserve their double-slash. As a + result, a pattern like `//*` will match `//x`, but not `/x`. +- Patterns staring with `//?/:` will _not_ treat + the `?` as a wildcard character. Instead, it will be treated + as a normal string. +- Patterns starting with `//?/:/...` will match + file paths starting with `:/...`, and vice versa, + as if the `//?/` was not present. This behavior only is + present when the drive letters are a case-insensitive match to + one another. The remaining portions of the path/pattern are + compared case sensitively, unless `nocase:true` is set. + +Note that specifying a UNC path using `\` characters as path +separators is always allowed in the file path argument, but only +allowed in the pattern argument when `windowsPathsNoEscape: true` +is set in the options. + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require('minimatch').Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +- `pattern` The original pattern the minimatch object represents. +- `options` The options supplied to the constructor. +- `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +- `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +- `negate` True if the pattern is negated. +- `comment` True if the pattern is a comment. +- `empty` True if the pattern is `""`. + +### Methods + +- `makeRe()` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +- `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +- `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. +- `hasMagic()` Returns true if the parsed pattern contains any + magic characters. Returns false if all comparator parts are + string literals. If the `magicalBraces` option is set on the + constructor, then it will consider brace expansions which are + not otherwise magical to be magic. If not set, then a pattern + like `a{b,c}d` will return `false`, because neither `abd` nor + `acd` contain any special glob characters. + + This does **not** mean that the pattern string can be used as a + literal filename, as it may contain magic glob characters that + are escaped. For example, the pattern `\\*` or `[*]` would not + be considered to have magic, as the matching portion parses to + the literal string `'*'` and would match a path named `'*'`, + not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may + be used to remove escape characters. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, '*.js', { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter('*.js', { matchBase: true })) +``` + +### minimatch.escape(pattern, options = {}) + +Escape all magic characters in a glob pattern, so that it will +only ever match literal strings + +If the `windowsPathsNoEscape` option is used, then characters are +escaped by wrapping in `[]`, because a magic character wrapped in +a character class can only be satisfied by that exact character. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.unescape(pattern, options = {}) + +Un-escape a glob string that may contain some escaped characters. + +If the `windowsPathsNoEscape` option is used, then square-brace +escapes are removed, but not backslash escapes. For example, it +will turn the string `'[*]'` into `*`, but it will not turn +`'\\*'` into `'*'`, because `\` is a path separator in +`windowsPathsNoEscape` mode. + +When `windowsPathsNoEscape` is not set, then both brace escapes +and backslash escapes are removed. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, '*.js', { matchBase: true }) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nocaseMagicOnly + +When used with `{nocase: true}`, create regular expressions that +are case-insensitive, but leave string match portions untouched. +Has no effect when used without `{nocase: true}` + +Useful when some other form of case-insensitive matching is used, +or if the original string representation is useful in some other +way. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### magicalBraces + +This only affects the results of the `Minimatch.hasMagic` method. + +If the pattern contains brace expansions, such as `a{b,c}d`, but +no other magic characters, then the `Minimatch.hasMagic()` method +will return `false` by default. When this option set, it will +return `true` for brace expansion as well as other magic glob +characters. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### windowsPathsNoEscape + +Use `\\` as a path separator _only_, and _never_ as an escape +character. If set, all `\\` characters are replaced with `/` in +the pattern. Note that this makes it **impossible** to match +against paths containing literal glob pattern characters, but +allows matching with patterns constructed using `path.join()` and +`path.resolve()` on Windows platforms, mimicking the (buggy!) +behavior of earlier versions on Windows. Please use with +caution, and be mindful of [the caveat about Windows +paths](#windows). + +For legacy reasons, this is also set if +`options.allowWindowsEscape` is set to the exact value `false`. + +### windowsNoMagicRoot + +When a pattern starts with a UNC path or drive letter, and in +`nocase:true` mode, do not convert the root portions of the +pattern into a case-insensitive regular expression, and instead +leave them as strings. + +This is the default when the platform is `win32` and +`nocase:true` is set. + +### preserveMultipleSlashes + +By default, multiple `/` characters (other than the leading `//` +in a UNC path, see "UNC Paths" above) are treated as a single +`/`. + +That is, a pattern like `a///b` will match the file path `a/b`. + +Set `preserveMultipleSlashes: true` to suppress this behavior. + +### optimizationLevel + +A number indicating the level of optimization that should be done +to the pattern prior to parsing and using it for matches. + +Globstar parts `**` are always converted to `*` when `noglobstar` +is set, and multiple adjacent `**` parts are converted into a +single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this +is equivalent in all cases). + +- `0` - Make no further changes. In this mode, `.` and `..` are + maintained in the pattern, meaning that they must also appear + in the same position in the test path string. Eg, a pattern + like `a/*/../c` will match the string `a/b/../c` but not the + string `a/c`. +- `1` - (default) Remove cases where a double-dot `..` follows a + pattern portion that is not `**`, `.`, `..`, or empty `''`. For + example, the pattern `./a/b/../*` is converted to `./a/*`, and + so it will match the path string `./a/c`, but not the path + string `./a/b/../c`. Dots and empty path portions in the + pattern are preserved. +- `2` (or higher) - Much more aggressive optimizations, suitable + for use with file-walking cases: + + - Remove cases where a double-dot `..` follows a pattern + portion that is not `**`, `.`, or empty `''`. Remove empty + and `.` portions of the pattern, where safe to do so (ie, + anywhere other than the last position, the first position, or + the second position in a pattern starting with `/`, as this + may indicate a UNC path on Windows). + - Convert patterns containing `
/**/../

/` into the + equivalent `

/{..,**}/

/`, where `

` is a + a pattern portion other than `.`, `..`, `**`, or empty + `''`. + - Dedupe patterns where a `**` portion is present in one and + omitted in another, and it is not the final path portion, and + they are otherwise equivalent. So `{a/**/b,a/b}` becomes + `a/**/b`, because `**` matches against an empty path portion. + - Dedupe patterns where a `*` portion is present in one, and a + non-dot pattern other than `**`, `.`, `..`, or `''` is in the + same position in the other. So `a/{*,x}/b` becomes `a/*/b`, + because `*` can match against `x`. + + While these optimizations improve the performance of + file-walking use cases such as [glob](http://npm.im/glob) (ie, + the reason this module exists), there are cases where it will + fail to match a literal string that would have been matched in + optimization level 1 or 0. + + Specifically, while the `Minimatch.match()` method will + optimize the file path string in the same ways, resulting in + the same matches, it will fail when tested with the regular + expression provided by `Minimatch.makeRe()`, unless the path + string is first processed with + `minimatch.levelTwoFileOptimize()` or similar. + +### platform + +When set to `win32`, this will trigger all windows-specific +behaviors (special handling for UNC paths, and treating `\` as +separators in file paths for comparison.) + +Defaults to the value of `process.platform`. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a +worthwhile goal, some discrepancies exist between minimatch and +other implementations. Some are intentional, and some are +unavoidable. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +Negated extglob patterns are handled as closely as possible to +Bash semantics, but there are some cases with negative extglobs +which are exceedingly difficult to express in a JavaScript +regular expression. In particular the negated pattern +`!(*|)*` will in bash match anything that does +not start with ``. However, +`!(*)*` _will_ match paths starting with +``, because the empty string can match against +the negated portion. In this library, `!(*|)*` +will _not_ match any pattern starting with ``, due to a +difference in precisely which patterns are considered "greedy" in +Regular Expressions vs bash path expansion. This may be fixable, +but not without incurring some complexity and performance costs, +and the trade-off seems to not be worth pursuing. + +Note that `fnmatch(3)` in libc is an extremely naive string comparison +matcher, which does not do anything special for slashes. This library is +designed to be used in glob searching and file walkers, and so it does do +special things with `/`. Thus, `foo*` will not match `foo/bar` in this +library, even though it would in `fnmatch(3)`. diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map new file mode 100644 index 0000000..c61c031 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAUlD,CAAA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js new file mode 100644 index 0000000..5fc86bb --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertValidPattern = void 0; +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; +exports.assertValidPattern = assertValidPattern; +//# sourceMappingURL=assert-valid-pattern.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map new file mode 100644 index 0000000..d43215c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA2B,CACxD,OAAY,EACe,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;KACvC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE;QACvC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;KAC3C;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: any) => void = (\n pattern: any\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts.map new file mode 100644 index 0000000..9e7bfb9 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwCvD,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAkCrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;gBAiBtB,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IA+ClB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAY/B,MAAM;IAgBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsIjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CAiMjE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js new file mode 100644 index 0000000..7b21096 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js @@ -0,0 +1,592 @@ +"use strict"; +// parse a single path portion +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST = void 0; +const brace_expressions_js_1 = require("./brace-expressions.js"); +const unescape_js_1 = require("./unescape.js"); +const types = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types.has(c); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + if (this.#toString !== undefined) + return this.#toString; + if (!this.type) { + return (this.#toString = this.#parts.map(p => String(p)).join('')); + } + else { + return (this.#toString = + this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')'); + } + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null + ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof AST && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new AST(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt) { + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') { + ast.push(acc); + acc = ''; + const ext = new AST(c, ast); + i = AST.#parseAST(str, ext, i, opt); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new AST(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (isExtglobType(c) && str.charAt(i) === '(') { + part.push(acc); + acc = ''; + const ext = new AST(c, part); + part.push(ext); + i = AST.#parseAST(str, ext, i, opt); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new AST(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + static fromGlob(pattern, options = {}) { + const ast = new AST(null, undefined, options); + AST.#parseAST(pattern, ast, 0, options); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + get options() { + return this.#options; + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) + this.#fillNegs(); + if (!this.type) { + const noEmpty = this.isStart() && this.isEnd(); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' + ? AST.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + (0, unescape_js_1.unescape)(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + this.#parts = [s]; + this.type = null; + this.#hasMagic = undefined; + return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; + } + // XXX abstract out this map method + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot + ? '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' + ? // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star + + ')' + : this.type === '@' + ? ')' + : this.type === '?' + ? ')?' + : this.type === '+' && bodyDotAllowed + ? ')' + : this.type === '*' && bodyDotAllowed + ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + (0, unescape_js_1.unescape)(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '*') { + if (noEmpty && glob === '*') + re += starNoEmpty; + else + re += star; + hasMagic = true; + continue; + } + if (c === '?') { + re += qmark; + hasMagic = true; + continue; + } + re += regExpEscape(c); + } + return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag]; + } +} +exports.AST = AST; +//# sourceMappingURL=ast.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js.map new file mode 100644 index 0000000..8383e43 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"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","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n// 1 2 3 4 5 6 1 2 3 46 5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n// v----- .* because there's more following,\n// v v otherwise, .+ because it must be\n// v v *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n// copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string): c is ExtglobType =>\n types.has(c as ExtglobType)\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nexport class AST {\n type: ExtglobType | null\n readonly #root: AST\n\n #hasMagic?: boolean\n #uflag: boolean = false\n #parts: (string | AST)[] = []\n readonly #parent?: AST\n readonly #parentIndex: number\n #negs: AST[]\n #filledNegs: boolean = false\n #options: MinimatchOptions\n #toString?: string\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt: boolean = false\n\n constructor(\n type: ExtglobType | null,\n parent?: AST,\n options: MinimatchOptions = {}\n ) {\n this.type = type\n // extglobs are inherently magical\n if (type) this.#hasMagic = true\n this.#parent = parent\n this.#root = this.#parent ? this.#parent.#root : this\n this.#options = this.#root === this ? options : this.#root.#options\n this.#negs = this.#root === this ? [] : this.#root.#negs\n if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n }\n\n get hasMagic(): boolean | undefined {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined) return this.#hasMagic\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string') continue\n if (p.type || p.hasMagic) return (this.#hasMagic = true)\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic\n }\n\n // reconstructs the pattern\n toString(): string {\n if (this.#toString !== undefined) return this.#toString\n if (!this.type) {\n return (this.#toString = this.#parts.map(p => String(p)).join(''))\n } else {\n return (this.#toString =\n this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')')\n }\n }\n\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root) throw new Error('should only call on root')\n if (this.#filledNegs) return this\n /* c8 ignore stop */\n\n // call toString() once to fill this out\n this.toString()\n this.#filledNegs = true\n let n: AST | undefined\n while ((n = this.#negs.pop())) {\n if (n.type !== '!') continue\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p: AST | undefined = n\n let pp = p.#parent\n while (pp) {\n for (\n let i = p.#parentIndex + 1;\n !pp.type && i < pp.#parts.length;\n i++\n ) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??')\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i])\n }\n }\n p = pp\n pp = p.#parent\n }\n }\n return this\n }\n\n push(...parts: (string | AST)[]) {\n for (const p of parts) {\n if (p === '') continue\n /* c8 ignore start */\n if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {\n throw new Error('invalid part: ' + p)\n }\n /* c8 ignore stop */\n this.#parts.push(p)\n }\n }\n\n toJSON() {\n const ret: any[] =\n this.type === null\n ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n if (this.isStart() && !this.type) ret.unshift([])\n if (\n this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))\n ) {\n ret.push({})\n }\n return ret\n }\n\n isStart(): boolean {\n if (this.#root === this) return true\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart()) return false\n if (this.#parentIndex === 0) return true\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i]\n if (!(pp instanceof AST && pp.type === '!')) {\n return false\n }\n }\n return true\n }\n\n isEnd(): boolean {\n if (this.#root === this) return true\n if (this.#parent?.type === '!') return true\n if (!this.#parent?.isEnd()) return false\n if (!this.type) return this.#parent?.isEnd()\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1\n }\n\n copyIn(part: AST | string) {\n if (typeof part === 'string') this.push(part)\n else this.push(part.clone(this))\n }\n\n clone(parent: AST) {\n const c = new AST(this.type, parent)\n for (const p of this.#parts) {\n c.copyIn(p)\n }\n return c\n }\n\n static #parseAST(\n str: string,\n ast: AST,\n pos: number,\n opt: MinimatchOptions\n ): number {\n let escaping = false\n let inBrace = false\n let braceStart = -1\n let braceNeg = false\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {\n ast.push(acc)\n acc = ''\n const ext = new AST(c, ast)\n i = AST.#parseAST(str, ext, i, opt)\n ast.push(ext)\n continue\n }\n acc += c\n }\n ast.push(acc)\n return i\n }\n\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1\n let part = new AST(null, ast)\n const parts: AST[] = []\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n if (isExtglobType(c) && str.charAt(i) === '(') {\n part.push(acc)\n acc = ''\n const ext = new AST(c, part)\n part.push(ext)\n i = AST.#parseAST(str, ext, i, opt)\n continue\n }\n if (c === '|') {\n part.push(acc)\n acc = ''\n parts.push(part)\n part = new AST(null, ast)\n continue\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true\n }\n part.push(acc)\n acc = ''\n ast.push(...parts, part)\n return i\n }\n acc += c\n }\n\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null\n ast.#hasMagic = undefined\n ast.#parts = [str.substring(pos - 1)]\n return i\n }\n\n static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n const ast = new AST(null, undefined, options)\n AST.#parseAST(pattern, ast, 0, options)\n return ast\n }\n\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern(): MMRegExp | string {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root) return this.#root.toMMPattern()\n /* c8 ignore stop */\n const glob = this.toString()\n const [re, body, hasMagic, uflag] = this.toRegExpSource()\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic =\n hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase())\n if (!anyMagic) {\n return body\n }\n\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n })\n }\n\n get options() {\n return this.#options\n }\n\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(\n allowDot?: boolean\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n const dot = allowDot ?? !!this.#options.dot\n if (this.#root === this) this.#fillNegs()\n if (!this.type) {\n const noEmpty = this.isStart() && this.isEnd()\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] =\n typeof p === 'string'\n ? AST.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot)\n this.#hasMagic = this.#hasMagic || hasMagic\n this.#uflag = this.#uflag || uflag\n return re\n })\n .join('')\n\n let start = ''\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed =\n this.#parts.length === 1 && justDots.has(this.#parts[0])\n if (!dotTravAllowed) {\n const aps = addPatternStart\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav =\n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''\n }\n }\n }\n\n // append the \"end of path portion\" pattern to negation tails\n let end = ''\n if (\n this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!'\n ) {\n end = '(?:$|\\\\/)'\n }\n const final = start + src + end\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n\n const repeated = this.type === '*' || this.type === '+'\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n let body = this.#partsToRegExp(dot)\n\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString()\n this.#parts = [s]\n this.type = null\n this.#hasMagic = undefined\n return [s, unescape(this.toString()), false, false]\n }\n\n // XXX abstract out this map method\n let bodyDotAllowed =\n !repeated || allowDot || dot || !startNoDot\n ? ''\n : this.#partsToRegExp(true)\n if (bodyDotAllowed === body) {\n bodyDotAllowed = ''\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`\n }\n\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = ''\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n } else {\n const close =\n this.type === '!'\n ? // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@'\n ? ')'\n : this.type === '?'\n ? ')?'\n : this.type === '+' && bodyDotAllowed\n ? ')'\n : this.type === '*' && bodyDotAllowed\n ? `)?`\n : `)${this.type}`\n final = start + body + close\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n #partsToRegExp(dot: boolean) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??')\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n this.#uflag = this.#uflag || uflag\n return re\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|')\n }\n\n static #parseGlob(\n glob: string,\n hasMagic: boolean | undefined,\n noEmpty: boolean = false\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n let escaping = false\n let re = ''\n let uflag = false\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i)\n if (escaping) {\n escaping = false\n re += (reSpecials.has(c) ? '\\\\' : '') + c\n continue\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\'\n } else {\n escaping = true\n }\n continue\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i)\n if (consumed) {\n re += src\n uflag = uflag || needUflag\n i += consumed - 1\n hasMagic = hasMagic || magic\n continue\n }\n }\n if (c === '*') {\n if (noEmpty && glob === '*') re += starNoEmpty\n else re += star\n hasMagic = true\n continue\n }\n if (c === '?') {\n re += qmark\n hasMagic = true\n continue\n }\n re += regExpEscape(c)\n }\n return [re, unescape(glob), !!hasMagic, uflag]\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map new file mode 100644 index 0000000..d394964 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AA+BA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,SACf,MAAM,YACF,MAAM,qBA8HjB,CAAA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js new file mode 100644 index 0000000..0e13eef --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js @@ -0,0 +1,152 @@ +"use strict"; +// translate the various posix character classes into unicode properties +// this works across all unicode locales +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseClass = void 0; +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length + ? '(' + sranges + '|' + snegs + ')' + : ranges.length + ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; +exports.parseClass = parseClass; +//# sourceMappingURL=brace-expressions.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js.map new file mode 100644 index 0000000..86b0475 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"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","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n}\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n src: string,\n uFlag: boolean,\n consumed: number,\n hasMagic: boolean\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n glob: string,\n position: number\n): ParseClassResult => {\n const pos = position\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression')\n }\n /* c8 ignore stop */\n const ranges: string[] = []\n const negs: string[] = []\n\n let i = pos + 1\n let sawStart = false\n let uflag = false\n let escaping = false\n let negate = false\n let endPos = pos\n let rangeStart = ''\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i)\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true\n i++\n continue\n }\n\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1\n break\n }\n\n sawStart = true\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true\n i++\n continue\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true]\n }\n i += cls.length\n if (neg) negs.push(unip)\n else ranges.push(unip)\n uflag = uflag || u\n continue WHILE\n }\n }\n }\n\n // now it's just a normal character, effectively\n escaping = false\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n } else if (c === rangeStart) {\n ranges.push(braceEscape(c))\n }\n rangeStart = ''\n i++\n continue\n }\n\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'))\n i += 2\n continue\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c\n i += 2\n continue\n }\n\n // not the start of a range, just a single character\n ranges.push(braceEscape(c))\n i++\n }\n\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false]\n }\n\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true]\n }\n\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (\n negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate\n ) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n return [regexpEscape(r), false, endPos - pos, false]\n }\n\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n const comb =\n ranges.length && negs.length\n ? '(' + sranges + '|' + snegs + ')'\n : ranges.length\n ? sranges\n : snegs\n\n return [comb, uflag, endPos - pos, true]\n}\n"]} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts.map new file mode 100644 index 0000000..0779dae --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,MACd,MAAM,8BAGN,KAAK,gBAAgB,EAAE,sBAAsB,CAAC,WAQlD,CAAA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js new file mode 100644 index 0000000..02a4f8a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escape = void 0; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + */ +const escape = (s, { windowsPathsNoEscape = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + return windowsPathsNoEscape + ? s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; +exports.escape = escape; +//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map new file mode 100644 index 0000000..264b2ea --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AACA;;;;;;;;GAQG;AACI,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,MACsB,EAAE,EACtD,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,OAAO,oBAAoB;QACzB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA;AAZY,QAAA,MAAM,UAYlB","sourcesContent":["import { MinimatchOptions } from './index.js'\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n */\nexport const escape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n }: Pick = {}\n) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n return windowsPathsNoEscape\n ? s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..195491d --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js new file mode 100644 index 0000000..64a0f1f --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js @@ -0,0 +1,1017 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; +const brace_expansion_1 = __importDefault(require("brace-expansion")); +const assert_valid_pattern_js_1 = require("./assert-valid-pattern.js"); +const ast_js_1 = require("./ast.js"); +const escape_js_1 = require("./escape.js"); +const unescape_js_1 = require("./unescape.js"); +const minimatch = (p, pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +exports.minimatch = minimatch; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform = (typeof process === 'object' && process + ? (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; +exports.minimatch.sep = exports.sep; +exports.GLOBSTAR = Symbol('globstar **'); +exports.minimatch.GLOBSTAR = exports.GLOBSTAR; +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options); +exports.filter = filter; +exports.minimatch.filter = exports.filter; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return exports.minimatch; + } + const orig = exports.minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: exports.GLOBSTAR, + }); +}; +exports.defaults = defaults; +exports.minimatch.defaults = exports.defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return (0, brace_expansion_1.default)(pattern); +}; +exports.braceExpand = braceExpand; +exports.minimatch.braceExpand = exports.braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +exports.makeRe = makeRe; +exports.minimatch.makeRe = exports.makeRe; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +exports.match = match; +exports.minimatch.match = exports.match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + regexp; + constructor(pattern, options = {}) { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + options = options || {}; + this.options = options; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined + ? options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn all ** into * + if (this.options.noglobstar) { + for (let i = 0; i < globParts.length; i++) { + for (let j = 0; j < globParts[i].length; j++) { + if (globParts[i][j] === '**') { + globParts[i][j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + // just collapse multiple ** portions into one + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //

// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p && p !== '.' && p !== '..' && p !== '**') {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        const options = this.options;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
+            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [file[fdi], pattern[pdi]];
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    if (pdi > fdi) {
+                        pattern = pattern.slice(pdi);
+                    }
+                    else if (fdi > pdi) {
+                        file = file.slice(fdi);
+                    }
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // dont' need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        this.debug('matchOne', this, { file, pattern });
+        this.debug('matchOne', file.length, pattern.length);
+        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            var p = pattern[pi];
+            var f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false) {
+                return false;
+            }
+            /* c8 ignore stop */
+            if (p === exports.GLOBSTAR) {
+                this.debug('GLOBSTAR', [pattern, p, f]);
+                // "**"
+                // a/**/b/**/c would match the following:
+                // a/b/x/y/z/c
+                // a/x/y/z/b/c
+                // a/b/x/b/x/c
+                // a/b/c
+                // To do this, take the rest of the pattern after
+                // the **, and see if it would match the file remainder.
+                // If so, return success.
+                // If not, the ** "swallows" a segment, and try again.
+                // This is recursively awful.
+                //
+                // a/**/b/**/c matching a/b/x/y/z/c
+                // - a matches a
+                // - doublestar
+                //   - matchOne(b/x/y/z/c, b/**/c)
+                //     - b matches b
+                //     - doublestar
+                //       - matchOne(x/y/z/c, c) -> no
+                //       - matchOne(y/z/c, c) -> no
+                //       - matchOne(z/c, c) -> no
+                //       - matchOne(c, c) yes, hit
+                var fr = fi;
+                var pr = pi + 1;
+                if (pr === pl) {
+                    this.debug('** at the end');
+                    // a ** at the end will just swallow the rest.
+                    // We have found a match.
+                    // however, it will not swallow /.x, unless
+                    // options.dot is set.
+                    // . and .. are *never* matched by **, for explosively
+                    // exponential reasons.
+                    for (; fi < fl; fi++) {
+                        if (file[fi] === '.' ||
+                            file[fi] === '..' ||
+                            (!options.dot && file[fi].charAt(0) === '.'))
+                            return false;
+                    }
+                    return true;
+                }
+                // ok, let's see if we can swallow whatever we can.
+                while (fr < fl) {
+                    var swallowee = file[fr];
+                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
+                    // XXX remove this slice.  Just pass the start index.
+                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+                        this.debug('globstar found match!', fr, fl, swallowee);
+                        // found a match.
+                        return true;
+                    }
+                    else {
+                        // can't swallow "." or ".." ever.
+                        // can only swallow ".foo" when explicitly asked.
+                        if (swallowee === '.' ||
+                            swallowee === '..' ||
+                            (!options.dot && swallowee.charAt(0) === '.')) {
+                            this.debug('dot detected!', file, fr, pattern, pr);
+                            break;
+                        }
+                        // ** swallows a segment, and continue.
+                        this.debug('globstar swallow a segment, and continue');
+                        fr++;
+                    }
+                }
+                // no match was found.
+                // However, in partial mode, we can't say this is necessarily over.
+                /* c8 ignore start */
+                if (partial) {
+                    // ran out of file
+                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
+                    if (fr === fl) {
+                        return true;
+                    }
+                }
+                /* c8 ignore stop */
+                return false;
+            }
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return (0, exports.braceExpand)(this.pattern, this.options);
+    }
+    parse(pattern) {
+        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return exports.GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot
+                    ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot
+                    ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar
+            ? star
+            : options.dot
+                ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return typeof p === 'string'
+                    ? regExpEscape(p)
+                    : p === exports.GLOBSTAR
+                        ? exports.GLOBSTAR
+                        : p._src;
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== exports.GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
+                }
+                else if (next !== exports.GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = exports.GLOBSTAR;
+                }
+            });
+            return pp.filter(p => p !== exports.GLOBSTAR).join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch (ex) {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (let i = 0; i < set.length; i++) {
+            const pattern = set[i];
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return exports.minimatch.defaults(def).Minimatch;
+    }
+}
+exports.Minimatch = Minimatch;
+/* c8 ignore start */
+var ast_js_2 = require("./ast.js");
+Object.defineProperty(exports, "AST", { enumerable: true, get: function () { return ast_js_2.AST; } });
+var escape_js_2 = require("./escape.js");
+Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
+var unescape_js_2 = require("./unescape.js");
+Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return unescape_js_2.unescape; } });
+/* c8 ignore stop */
+exports.minimatch.AST = ast_js_1.AST;
+exports.minimatch.Minimatch = Minimatch;
+exports.minimatch.escape = escape_js_1.escape;
+exports.minimatch.unescape = unescape_js_1.unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js.map
new file mode 100644
index 0000000..d4f6a87
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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","sourcesContent":["import expand from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport { AST, ExtglobType } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\ntype Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  nobrace?: boolean\n  nocomment?: boolean\n  nonegate?: boolean\n  debug?: boolean\n  noglobstar?: boolean\n  noext?: boolean\n  nonull?: boolean\n  windowsPathsNoEscape?: boolean\n  allowWindowsEscape?: boolean\n  partial?: boolean\n  dot?: boolean\n  nocase?: boolean\n  nocaseMagicOnly?: boolean\n  magicalBraces?: boolean\n  matchBase?: boolean\n  flipNegate?: boolean\n  preserveMultipleSlashes?: boolean\n  optimizationLevel?: number\n  platform?: Platform\n  windowsNoMagicRoot?: boolean\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {}\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?\\*\\[\\(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) => !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) => f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) => f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?\\*\\[\\(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process\n    ? (typeof process.env === 'object' &&\n        process.env &&\n        process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n      process.platform\n    : 'posix'\n) as Platform\ntype Sep = '\\\\' | '/'\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {}\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick = {}\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick = {}\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) => orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (list: string[], pattern: string, options: MinimatchOptions = {}) =>\n      orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {}\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern)\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {}\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options.allowWindowsEscape === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined\n        ? options.windowsNoMagicRoot\n        : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: any[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      this.debug = (...args: any[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn all ** into *\n    if (this.options.noglobstar) {\n      for (let i = 0; i < globParts.length; i++) {\n        for (let j = 0; j < globParts[i].length; j++) {\n          if (globParts[i][j] === '**') {\n            globParts[i][j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (p && p !== '.' && p !== '..' && p !== '**') {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(file: string[], pattern: ParseReturn[], partial: boolean = false) {\n    const options = this.options\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined\n      const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [file[fdi], pattern[pdi] as string]\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          if (pdi > fdi) {\n            pattern = pattern.slice(pdi)\n          } else if (fdi > pdi) {\n            file = file.slice(fdi)\n          }\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // dont' need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    this.debug('matchOne', this, { file, pattern })\n    this.debug('matchOne', file.length, pattern.length)\n\n    for (\n      var fi = 0, pi = 0, fl = file.length, pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      var p = pattern[pi]\n      var f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      if (p === GLOBSTAR) {\n        this.debug('GLOBSTAR', [pattern, p, f])\n\n        // \"**\"\n        // a/**/b/**/c would match the following:\n        // a/b/x/y/z/c\n        // a/x/y/z/b/c\n        // a/b/x/b/x/c\n        // a/b/c\n        // To do this, take the rest of the pattern after\n        // the **, and see if it would match the file remainder.\n        // If so, return success.\n        // If not, the ** \"swallows\" a segment, and try again.\n        // This is recursively awful.\n        //\n        // a/**/b/**/c matching a/b/x/y/z/c\n        // - a matches a\n        // - doublestar\n        //   - matchOne(b/x/y/z/c, b/**/c)\n        //     - b matches b\n        //     - doublestar\n        //       - matchOne(x/y/z/c, c) -> no\n        //       - matchOne(y/z/c, c) -> no\n        //       - matchOne(z/c, c) -> no\n        //       - matchOne(c, c) yes, hit\n        var fr = fi\n        var pr = pi + 1\n        if (pr === pl) {\n          this.debug('** at the end')\n          // a ** at the end will just swallow the rest.\n          // We have found a match.\n          // however, it will not swallow /.x, unless\n          // options.dot is set.\n          // . and .. are *never* matched by **, for explosively\n          // exponential reasons.\n          for (; fi < fl; fi++) {\n            if (\n              file[fi] === '.' ||\n              file[fi] === '..' ||\n              (!options.dot && file[fi].charAt(0) === '.')\n            )\n              return false\n          }\n          return true\n        }\n\n        // ok, let's see if we can swallow whatever we can.\n        while (fr < fl) {\n          var swallowee = file[fr]\n\n          this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n          // XXX remove this slice.  Just pass the start index.\n          if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n            this.debug('globstar found match!', fr, fl, swallowee)\n            // found a match.\n            return true\n          } else {\n            // can't swallow \".\" or \"..\" ever.\n            // can only swallow \".foo\" when explicitly asked.\n            if (\n              swallowee === '.' ||\n              swallowee === '..' ||\n              (!options.dot && swallowee.charAt(0) === '.')\n            ) {\n              this.debug('dot detected!', file, fr, pattern, pr)\n              break\n            }\n\n            // ** swallows a segment, and continue.\n            this.debug('globstar swallow a segment, and continue')\n            fr++\n          }\n        }\n\n        // no match was found.\n        // However, in partial mode, we can't say this is necessarily over.\n        /* c8 ignore start */\n        if (partial) {\n          // ran out of file\n          this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n          if (fr === fl) {\n            return true\n          }\n        }\n        /* c8 ignore stop */\n        return false\n      }\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase\n          ? options.dot\n            ? starDotExtTestNocaseDot\n            : starDotExtTestNocase\n          : options.dot\n          ? starDotExtTestDot\n          : starDotExtTest\n      )(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase\n          ? options.dot\n            ? qmarksTestNocaseDot\n            : qmarksTestNocase\n          : options.dot\n          ? qmarksTestDot\n          : qmarksTest\n      )(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar = options.noglobstar\n      ? star\n      : options.dot\n      ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return typeof p === 'string'\n            ? regExpEscape(p)\n            : p === GLOBSTAR\n            ? GLOBSTAR\n            : p._src\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        return pp.filter(p => p !== GLOBSTAR).join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch (ex) {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^\\/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (let i = 0; i < set.length; i++) {\n      const pattern = set[i]\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/package.json b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/package.json
new file mode 100644
index 0000000..5bbefff
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
new file mode 100644
index 0000000..7ace070
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,MAChB,MAAM,8BAGN,KAAK,gBAAgB,EAAE,sBAAsB,CAAC,WAKlD,CAAA"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
new file mode 100644
index 0000000..47c36bc
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
@@ -0,0 +1,24 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.unescape = void 0;
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link windowsPathsNoEscape} option is used, then square-brace
+ * escapes are removed, but not backslash escapes.  For example, it will turn
+ * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
+ * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both brace escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ */
+const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
+    return windowsPathsNoEscape
+        ? s.replace(/\[([^\/\\])\]/g, '$1')
+        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
+};
+exports.unescape = unescape;
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js.map
new file mode 100644
index 0000000..353d3aa
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":";;;AACA;;;;;;;;;;;;;GAaG;AACI,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,MACsB,EAAE,EACtD,EAAE;IACF,OAAO,oBAAoB;QACzB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC;QACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAChF,CAAC,CAAA;AATY,QAAA,QAAQ,YASpB","sourcesContent":["import { MinimatchOptions } from './index.js'\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link windowsPathsNoEscape} option is used, then square-brace\n * escapes are removed, but not backslash escapes.  For example, it will turn\n * the string `'[*]'` into `*`, but it will not turn `'\\\\*'` into `'*'`,\n * becuase `\\` is a path separator in `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both brace escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n */\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n  }: Pick = {}\n) => {\n  return windowsPathsNoEscape\n    ? s.replace(/\\[([^\\/\\\\])\\]/g, '$1')\n    : s.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g, '$1$2').replace(/\\\\([^\\/])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
new file mode 100644
index 0000000..c61c031
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAUlD,CAAA"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js
new file mode 100644
index 0000000..7b534fc
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js
@@ -0,0 +1,10 @@
+const MAX_PATTERN_LENGTH = 1024 * 64;
+export const assertValidPattern = (pattern) => {
+    if (typeof pattern !== 'string') {
+        throw new TypeError('invalid pattern');
+    }
+    if (pattern.length > MAX_PATTERN_LENGTH) {
+        throw new TypeError('pattern is too long');
+    }
+};
+//# sourceMappingURL=assert-valid-pattern.js.map
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
new file mode 100644
index 0000000..b1a5a0b
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAA2B,CACxD,OAAY,EACe,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;KACvC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE;QACvC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;KAC3C;AACH,CAAC,CAAA","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: any) => void = (\n  pattern: any\n): asserts pattern is string => {\n  if (typeof pattern !== 'string') {\n    throw new TypeError('invalid pattern')\n  }\n\n  if (pattern.length > MAX_PATTERN_LENGTH) {\n    throw new TypeError('pattern is too long')\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts.map
new file mode 100644
index 0000000..9e7bfb9
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwCvD,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAkCrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;gBAiBtB,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IA+ClB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAY/B,MAAM;IAgBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsIjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CAiMjE"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js
new file mode 100644
index 0000000..2d2bced
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js
@@ -0,0 +1,588 @@
+// parse a single path portion
+import { parseClass } from './brace-expressions.js';
+import { unescape } from './unescape.js';
+const types = new Set(['!', '?', '+', '*', '@']);
+const isExtglobType = (c) => types.has(c);
+// Patterns that get prepended to bind to the start of either the
+// entire string, or just a single path portion, to prevent dots
+// and/or traversal patterns, when needed.
+// Exts don't need the ^ or / bit, because the root binds that already.
+const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
+const startNoDot = '(?!\\.)';
+// characters that indicate a start of pattern needs the "no dots" bit,
+// because a dot *might* be matched. ( is not in the list, because in
+// the case of a child extglob, it will handle the prevention itself.
+const addPatternStart = new Set(['[', '.']);
+// cases where traversal is A-OK, no dot prevention needed
+const justDots = new Set(['..', '.']);
+const reSpecials = new Set('().*{}+?[]^$\\!');
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// any single thing other than /
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// use + when we need to ensure that *something* matches, because the * is
+// the only thing in the path portion.
+const starNoEmpty = qmark + '+?';
+// remove the \ chars that we added if we end up doing a nonmagic compare
+// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
+export class AST {
+    type;
+    #root;
+    #hasMagic;
+    #uflag = false;
+    #parts = [];
+    #parent;
+    #parentIndex;
+    #negs;
+    #filledNegs = false;
+    #options;
+    #toString;
+    // set to true if it's an extglob with no children
+    // (which really means one child of '')
+    #emptyExt = false;
+    constructor(type, parent, options = {}) {
+        this.type = type;
+        // extglobs are inherently magical
+        if (type)
+            this.#hasMagic = true;
+        this.#parent = parent;
+        this.#root = this.#parent ? this.#parent.#root : this;
+        this.#options = this.#root === this ? options : this.#root.#options;
+        this.#negs = this.#root === this ? [] : this.#root.#negs;
+        if (type === '!' && !this.#root.#filledNegs)
+            this.#negs.push(this);
+        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
+    }
+    get hasMagic() {
+        /* c8 ignore start */
+        if (this.#hasMagic !== undefined)
+            return this.#hasMagic;
+        /* c8 ignore stop */
+        for (const p of this.#parts) {
+            if (typeof p === 'string')
+                continue;
+            if (p.type || p.hasMagic)
+                return (this.#hasMagic = true);
+        }
+        // note: will be undefined until we generate the regexp src and find out
+        return this.#hasMagic;
+    }
+    // reconstructs the pattern
+    toString() {
+        if (this.#toString !== undefined)
+            return this.#toString;
+        if (!this.type) {
+            return (this.#toString = this.#parts.map(p => String(p)).join(''));
+        }
+        else {
+            return (this.#toString =
+                this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
+        }
+    }
+    #fillNegs() {
+        /* c8 ignore start */
+        if (this !== this.#root)
+            throw new Error('should only call on root');
+        if (this.#filledNegs)
+            return this;
+        /* c8 ignore stop */
+        // call toString() once to fill this out
+        this.toString();
+        this.#filledNegs = true;
+        let n;
+        while ((n = this.#negs.pop())) {
+            if (n.type !== '!')
+                continue;
+            // walk up the tree, appending everthing that comes AFTER parentIndex
+            let p = n;
+            let pp = p.#parent;
+            while (pp) {
+                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
+                    for (const part of n.#parts) {
+                        /* c8 ignore start */
+                        if (typeof part === 'string') {
+                            throw new Error('string part in extglob AST??');
+                        }
+                        /* c8 ignore stop */
+                        part.copyIn(pp.#parts[i]);
+                    }
+                }
+                p = pp;
+                pp = p.#parent;
+            }
+        }
+        return this;
+    }
+    push(...parts) {
+        for (const p of parts) {
+            if (p === '')
+                continue;
+            /* c8 ignore start */
+            if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
+                throw new Error('invalid part: ' + p);
+            }
+            /* c8 ignore stop */
+            this.#parts.push(p);
+        }
+    }
+    toJSON() {
+        const ret = this.type === null
+            ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))
+            : [this.type, ...this.#parts.map(p => p.toJSON())];
+        if (this.isStart() && !this.type)
+            ret.unshift([]);
+        if (this.isEnd() &&
+            (this === this.#root ||
+                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
+            ret.push({});
+        }
+        return ret;
+    }
+    isStart() {
+        if (this.#root === this)
+            return true;
+        // if (this.type) return !!this.#parent?.isStart()
+        if (!this.#parent?.isStart())
+            return false;
+        if (this.#parentIndex === 0)
+            return true;
+        // if everything AHEAD of this is a negation, then it's still the "start"
+        const p = this.#parent;
+        for (let i = 0; i < this.#parentIndex; i++) {
+            const pp = p.#parts[i];
+            if (!(pp instanceof AST && pp.type === '!')) {
+                return false;
+            }
+        }
+        return true;
+    }
+    isEnd() {
+        if (this.#root === this)
+            return true;
+        if (this.#parent?.type === '!')
+            return true;
+        if (!this.#parent?.isEnd())
+            return false;
+        if (!this.type)
+            return this.#parent?.isEnd();
+        // if not root, it'll always have a parent
+        /* c8 ignore start */
+        const pl = this.#parent ? this.#parent.#parts.length : 0;
+        /* c8 ignore stop */
+        return this.#parentIndex === pl - 1;
+    }
+    copyIn(part) {
+        if (typeof part === 'string')
+            this.push(part);
+        else
+            this.push(part.clone(this));
+    }
+    clone(parent) {
+        const c = new AST(this.type, parent);
+        for (const p of this.#parts) {
+            c.copyIn(p);
+        }
+        return c;
+    }
+    static #parseAST(str, ast, pos, opt) {
+        let escaping = false;
+        let inBrace = false;
+        let braceStart = -1;
+        let braceNeg = false;
+        if (ast.type === null) {
+            // outside of a extglob, append until we find a start
+            let i = pos;
+            let acc = '';
+            while (i < str.length) {
+                const c = str.charAt(i++);
+                // still accumulate escapes at this point, but we do ignore
+                // starts that are escaped
+                if (escaping || c === '\\') {
+                    escaping = !escaping;
+                    acc += c;
+                    continue;
+                }
+                if (inBrace) {
+                    if (i === braceStart + 1) {
+                        if (c === '^' || c === '!') {
+                            braceNeg = true;
+                        }
+                    }
+                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                        inBrace = false;
+                    }
+                    acc += c;
+                    continue;
+                }
+                else if (c === '[') {
+                    inBrace = true;
+                    braceStart = i;
+                    braceNeg = false;
+                    acc += c;
+                    continue;
+                }
+                if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
+                    ast.push(acc);
+                    acc = '';
+                    const ext = new AST(c, ast);
+                    i = AST.#parseAST(str, ext, i, opt);
+                    ast.push(ext);
+                    continue;
+                }
+                acc += c;
+            }
+            ast.push(acc);
+            return i;
+        }
+        // some kind of extglob, pos is at the (
+        // find the next | or )
+        let i = pos + 1;
+        let part = new AST(null, ast);
+        const parts = [];
+        let acc = '';
+        while (i < str.length) {
+            const c = str.charAt(i++);
+            // still accumulate escapes at this point, but we do ignore
+            // starts that are escaped
+            if (escaping || c === '\\') {
+                escaping = !escaping;
+                acc += c;
+                continue;
+            }
+            if (inBrace) {
+                if (i === braceStart + 1) {
+                    if (c === '^' || c === '!') {
+                        braceNeg = true;
+                    }
+                }
+                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                    inBrace = false;
+                }
+                acc += c;
+                continue;
+            }
+            else if (c === '[') {
+                inBrace = true;
+                braceStart = i;
+                braceNeg = false;
+                acc += c;
+                continue;
+            }
+            if (isExtglobType(c) && str.charAt(i) === '(') {
+                part.push(acc);
+                acc = '';
+                const ext = new AST(c, part);
+                part.push(ext);
+                i = AST.#parseAST(str, ext, i, opt);
+                continue;
+            }
+            if (c === '|') {
+                part.push(acc);
+                acc = '';
+                parts.push(part);
+                part = new AST(null, ast);
+                continue;
+            }
+            if (c === ')') {
+                if (acc === '' && ast.#parts.length === 0) {
+                    ast.#emptyExt = true;
+                }
+                part.push(acc);
+                acc = '';
+                ast.push(...parts, part);
+                return i;
+            }
+            acc += c;
+        }
+        // unfinished extglob
+        // if we got here, it was a malformed extglob! not an extglob, but
+        // maybe something else in there.
+        ast.type = null;
+        ast.#hasMagic = undefined;
+        ast.#parts = [str.substring(pos - 1)];
+        return i;
+    }
+    static fromGlob(pattern, options = {}) {
+        const ast = new AST(null, undefined, options);
+        AST.#parseAST(pattern, ast, 0, options);
+        return ast;
+    }
+    // returns the regular expression if there's magic, or the unescaped
+    // string if not.
+    toMMPattern() {
+        // should only be called on root
+        /* c8 ignore start */
+        if (this !== this.#root)
+            return this.#root.toMMPattern();
+        /* c8 ignore stop */
+        const glob = this.toString();
+        const [re, body, hasMagic, uflag] = this.toRegExpSource();
+        // if we're in nocase mode, and not nocaseMagicOnly, then we do
+        // still need a regular expression if we have to case-insensitively
+        // match capital/lowercase characters.
+        const anyMagic = hasMagic ||
+            this.#hasMagic ||
+            (this.#options.nocase &&
+                !this.#options.nocaseMagicOnly &&
+                glob.toUpperCase() !== glob.toLowerCase());
+        if (!anyMagic) {
+            return body;
+        }
+        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
+        return Object.assign(new RegExp(`^${re}$`, flags), {
+            _src: re,
+            _glob: glob,
+        });
+    }
+    get options() {
+        return this.#options;
+    }
+    // returns the string match, the regexp source, whether there's magic
+    // in the regexp (so a regular expression is required) and whether or
+    // not the uflag is needed for the regular expression (for posix classes)
+    // TODO: instead of injecting the start/end at this point, just return
+    // the BODY of the regexp, along with the start/end portions suitable
+    // for binding the start/end in either a joined full-path makeRe context
+    // (where we bind to (^|/), or a standalone matchPart context (where
+    // we bind to ^, and not /).  Otherwise slashes get duped!
+    //
+    // In part-matching mode, the start is:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: ^(?!\.\.?$)
+    // - if dots allowed or not possible: ^
+    // - if dots possible and not allowed: ^(?!\.)
+    // end is:
+    // - if not isEnd(): nothing
+    // - else: $
+    //
+    // In full-path matching mode, we put the slash at the START of the
+    // pattern, so start is:
+    // - if first pattern: same as part-matching mode
+    // - if not isStart(): nothing
+    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
+    // - if dots allowed or not possible: /
+    // - if dots possible and not allowed: /(?!\.)
+    // end is:
+    // - if last pattern, same as part-matching mode
+    // - else nothing
+    //
+    // Always put the (?:$|/) on negated tails, though, because that has to be
+    // there to bind the end of the negated pattern portion, and it's easier to
+    // just stick it in now rather than try to inject it later in the middle of
+    // the pattern.
+    //
+    // We can just always return the same end, and leave it up to the caller
+    // to know whether it's going to be used joined or in parts.
+    // And, if the start is adjusted slightly, can do the same there:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
+    // - if dots allowed or not possible: (?:/|^)
+    // - if dots possible and not allowed: (?:/|^)(?!\.)
+    //
+    // But it's better to have a simpler binding without a conditional, for
+    // performance, so probably better to return both start options.
+    //
+    // Then the caller just ignores the end if it's not the first pattern,
+    // and the start always gets applied.
+    //
+    // But that's always going to be $ if it's the ending pattern, or nothing,
+    // so the caller can just attach $ at the end of the pattern when building.
+    //
+    // So the todo is:
+    // - better detect what kind of start is needed
+    // - return both flavors of starting pattern
+    // - attach $ at the end of the pattern when creating the actual RegExp
+    //
+    // Ah, but wait, no, that all only applies to the root when the first pattern
+    // is not an extglob. If the first pattern IS an extglob, then we need all
+    // that dot prevention biz to live in the extglob portions, because eg
+    // +(*|.x*) can match .xy but not .yx.
+    //
+    // So, return the two flavors if it's #root and the first child is not an
+    // AST, otherwise leave it to the child AST to handle it, and there,
+    // use the (?:^|/) style of start binding.
+    //
+    // Even simplified further:
+    // - Since the start for a join is eg /(?!\.) and the start for a part
+    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
+    // or start or whatever) and prepend ^ or / at the Regexp construction.
+    toRegExpSource(allowDot) {
+        const dot = allowDot ?? !!this.#options.dot;
+        if (this.#root === this)
+            this.#fillNegs();
+        if (!this.type) {
+            const noEmpty = this.isStart() && this.isEnd();
+            const src = this.#parts
+                .map(p => {
+                const [re, _, hasMagic, uflag] = typeof p === 'string'
+                    ? AST.#parseGlob(p, this.#hasMagic, noEmpty)
+                    : p.toRegExpSource(allowDot);
+                this.#hasMagic = this.#hasMagic || hasMagic;
+                this.#uflag = this.#uflag || uflag;
+                return re;
+            })
+                .join('');
+            let start = '';
+            if (this.isStart()) {
+                if (typeof this.#parts[0] === 'string') {
+                    // this is the string that will match the start of the pattern,
+                    // so we need to protect against dots and such.
+                    // '.' and '..' cannot match unless the pattern is that exactly,
+                    // even if it starts with . or dot:true is set.
+                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
+                    if (!dotTravAllowed) {
+                        const aps = addPatternStart;
+                        // check if we have a possibility of matching . or ..,
+                        // and prevent that.
+                        const needNoTrav = 
+                        // dots are allowed, and the pattern starts with [ or .
+                        (dot && aps.has(src.charAt(0))) ||
+                            // the pattern starts with \., and then [ or .
+                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
+                            // the pattern starts with \.\., and then [ or .
+                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
+                        // no need to prevent dots if it can't match a dot, or if a
+                        // sub-pattern will be preventing it anyway.
+                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
+                        start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : '';
+                    }
+                }
+            }
+            // append the "end of path portion" pattern to negation tails
+            let end = '';
+            if (this.isEnd() &&
+                this.#root.#filledNegs &&
+                this.#parent?.type === '!') {
+                end = '(?:$|\\/)';
+            }
+            const final = start + src + end;
+            return [
+                final,
+                unescape(src),
+                (this.#hasMagic = !!this.#hasMagic),
+                this.#uflag,
+            ];
+        }
+        // We need to calculate the body *twice* if it's a repeat pattern
+        // at the start, once in nodot mode, then again in dot mode, so a
+        // pattern like *(?) can match 'x.y'
+        const repeated = this.type === '*' || this.type === '+';
+        // some kind of extglob
+        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
+        let body = this.#partsToRegExp(dot);
+        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
+            // invalid extglob, has to at least be *something* present, if it's
+            // the entire path portion.
+            const s = this.toString();
+            this.#parts = [s];
+            this.type = null;
+            this.#hasMagic = undefined;
+            return [s, unescape(this.toString()), false, false];
+        }
+        // XXX abstract out this map method
+        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
+            ? ''
+            : this.#partsToRegExp(true);
+        if (bodyDotAllowed === body) {
+            bodyDotAllowed = '';
+        }
+        if (bodyDotAllowed) {
+            body = `(?:${body})(?:${bodyDotAllowed})*?`;
+        }
+        // an empty !() is exactly equivalent to a starNoEmpty
+        let final = '';
+        if (this.type === '!' && this.#emptyExt) {
+            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
+        }
+        else {
+            const close = this.type === '!'
+                ? // !() must match something,but !(x) can match ''
+                    '))' +
+                        (this.isStart() && !dot && !allowDot ? startNoDot : '') +
+                        star +
+                        ')'
+                : this.type === '@'
+                    ? ')'
+                    : this.type === '?'
+                        ? ')?'
+                        : this.type === '+' && bodyDotAllowed
+                            ? ')'
+                            : this.type === '*' && bodyDotAllowed
+                                ? `)?`
+                                : `)${this.type}`;
+            final = start + body + close;
+        }
+        return [
+            final,
+            unescape(body),
+            (this.#hasMagic = !!this.#hasMagic),
+            this.#uflag,
+        ];
+    }
+    #partsToRegExp(dot) {
+        return this.#parts
+            .map(p => {
+            // extglob ASTs should only contain parent ASTs
+            /* c8 ignore start */
+            if (typeof p === 'string') {
+                throw new Error('string type in extglob ast??');
+            }
+            /* c8 ignore stop */
+            // can ignore hasMagic, because extglobs are already always magic
+            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
+            this.#uflag = this.#uflag || uflag;
+            return re;
+        })
+            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
+            .join('|');
+    }
+    static #parseGlob(glob, hasMagic, noEmpty = false) {
+        let escaping = false;
+        let re = '';
+        let uflag = false;
+        for (let i = 0; i < glob.length; i++) {
+            const c = glob.charAt(i);
+            if (escaping) {
+                escaping = false;
+                re += (reSpecials.has(c) ? '\\' : '') + c;
+                continue;
+            }
+            if (c === '\\') {
+                if (i === glob.length - 1) {
+                    re += '\\\\';
+                }
+                else {
+                    escaping = true;
+                }
+                continue;
+            }
+            if (c === '[') {
+                const [src, needUflag, consumed, magic] = parseClass(glob, i);
+                if (consumed) {
+                    re += src;
+                    uflag = uflag || needUflag;
+                    i += consumed - 1;
+                    hasMagic = hasMagic || magic;
+                    continue;
+                }
+            }
+            if (c === '*') {
+                if (noEmpty && glob === '*')
+                    re += starNoEmpty;
+                else
+                    re += star;
+                hasMagic = true;
+                continue;
+            }
+            if (c === '?') {
+                re += qmark;
+                hasMagic = true;
+                continue;
+            }
+            re += regExpEscape(c);
+        }
+        return [re, unescape(glob), !!hasMagic, uflag];
+    }
+}
+//# sourceMappingURL=ast.js.map
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js.map
new file mode 100644
index 0000000..f1f8b34
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"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","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n//   1   2 3   4 5 6      1   2    3   46      5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n//                                 v----- .* because there's more following,\n//                                 v    v  otherwise, .+ because it must be\n//                                 v    v  *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n//   copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string): c is ExtglobType =>\n  types.has(c as ExtglobType)\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nexport class AST {\n  type: ExtglobType | null\n  readonly #root: AST\n\n  #hasMagic?: boolean\n  #uflag: boolean = false\n  #parts: (string | AST)[] = []\n  readonly #parent?: AST\n  readonly #parentIndex: number\n  #negs: AST[]\n  #filledNegs: boolean = false\n  #options: MinimatchOptions\n  #toString?: string\n  // set to true if it's an extglob with no children\n  // (which really means one child of '')\n  #emptyExt: boolean = false\n\n  constructor(\n    type: ExtglobType | null,\n    parent?: AST,\n    options: MinimatchOptions = {}\n  ) {\n    this.type = type\n    // extglobs are inherently magical\n    if (type) this.#hasMagic = true\n    this.#parent = parent\n    this.#root = this.#parent ? this.#parent.#root : this\n    this.#options = this.#root === this ? options : this.#root.#options\n    this.#negs = this.#root === this ? [] : this.#root.#negs\n    if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n    this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n  }\n\n  get hasMagic(): boolean | undefined {\n    /* c8 ignore start */\n    if (this.#hasMagic !== undefined) return this.#hasMagic\n    /* c8 ignore stop */\n    for (const p of this.#parts) {\n      if (typeof p === 'string') continue\n      if (p.type || p.hasMagic) return (this.#hasMagic = true)\n    }\n    // note: will be undefined until we generate the regexp src and find out\n    return this.#hasMagic\n  }\n\n  // reconstructs the pattern\n  toString(): string {\n    if (this.#toString !== undefined) return this.#toString\n    if (!this.type) {\n      return (this.#toString = this.#parts.map(p => String(p)).join(''))\n    } else {\n      return (this.#toString =\n        this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')')\n    }\n  }\n\n  #fillNegs() {\n    /* c8 ignore start */\n    if (this !== this.#root) throw new Error('should only call on root')\n    if (this.#filledNegs) return this\n    /* c8 ignore stop */\n\n    // call toString() once to fill this out\n    this.toString()\n    this.#filledNegs = true\n    let n: AST | undefined\n    while ((n = this.#negs.pop())) {\n      if (n.type !== '!') continue\n      // walk up the tree, appending everthing that comes AFTER parentIndex\n      let p: AST | undefined = n\n      let pp = p.#parent\n      while (pp) {\n        for (\n          let i = p.#parentIndex + 1;\n          !pp.type && i < pp.#parts.length;\n          i++\n        ) {\n          for (const part of n.#parts) {\n            /* c8 ignore start */\n            if (typeof part === 'string') {\n              throw new Error('string part in extglob AST??')\n            }\n            /* c8 ignore stop */\n            part.copyIn(pp.#parts[i])\n          }\n        }\n        p = pp\n        pp = p.#parent\n      }\n    }\n    return this\n  }\n\n  push(...parts: (string | AST)[]) {\n    for (const p of parts) {\n      if (p === '') continue\n      /* c8 ignore start */\n      if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {\n        throw new Error('invalid part: ' + p)\n      }\n      /* c8 ignore stop */\n      this.#parts.push(p)\n    }\n  }\n\n  toJSON() {\n    const ret: any[] =\n      this.type === null\n        ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))\n        : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n    if (this.isStart() && !this.type) ret.unshift([])\n    if (\n      this.isEnd() &&\n      (this === this.#root ||\n        (this.#root.#filledNegs && this.#parent?.type === '!'))\n    ) {\n      ret.push({})\n    }\n    return ret\n  }\n\n  isStart(): boolean {\n    if (this.#root === this) return true\n    // if (this.type) return !!this.#parent?.isStart()\n    if (!this.#parent?.isStart()) return false\n    if (this.#parentIndex === 0) return true\n    // if everything AHEAD of this is a negation, then it's still the \"start\"\n    const p = this.#parent\n    for (let i = 0; i < this.#parentIndex; i++) {\n      const pp = p.#parts[i]\n      if (!(pp instanceof AST && pp.type === '!')) {\n        return false\n      }\n    }\n    return true\n  }\n\n  isEnd(): boolean {\n    if (this.#root === this) return true\n    if (this.#parent?.type === '!') return true\n    if (!this.#parent?.isEnd()) return false\n    if (!this.type) return this.#parent?.isEnd()\n    // if not root, it'll always have a parent\n    /* c8 ignore start */\n    const pl = this.#parent ? this.#parent.#parts.length : 0\n    /* c8 ignore stop */\n    return this.#parentIndex === pl - 1\n  }\n\n  copyIn(part: AST | string) {\n    if (typeof part === 'string') this.push(part)\n    else this.push(part.clone(this))\n  }\n\n  clone(parent: AST) {\n    const c = new AST(this.type, parent)\n    for (const p of this.#parts) {\n      c.copyIn(p)\n    }\n    return c\n  }\n\n  static #parseAST(\n    str: string,\n    ast: AST,\n    pos: number,\n    opt: MinimatchOptions\n  ): number {\n    let escaping = false\n    let inBrace = false\n    let braceStart = -1\n    let braceNeg = false\n    if (ast.type === null) {\n      // outside of a extglob, append until we find a start\n      let i = pos\n      let acc = ''\n      while (i < str.length) {\n        const c = str.charAt(i++)\n        // still accumulate escapes at this point, but we do ignore\n        // starts that are escaped\n        if (escaping || c === '\\\\') {\n          escaping = !escaping\n          acc += c\n          continue\n        }\n\n        if (inBrace) {\n          if (i === braceStart + 1) {\n            if (c === '^' || c === '!') {\n              braceNeg = true\n            }\n          } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n            inBrace = false\n          }\n          acc += c\n          continue\n        } else if (c === '[') {\n          inBrace = true\n          braceStart = i\n          braceNeg = false\n          acc += c\n          continue\n        }\n\n        if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {\n          ast.push(acc)\n          acc = ''\n          const ext = new AST(c, ast)\n          i = AST.#parseAST(str, ext, i, opt)\n          ast.push(ext)\n          continue\n        }\n        acc += c\n      }\n      ast.push(acc)\n      return i\n    }\n\n    // some kind of extglob, pos is at the (\n    // find the next | or )\n    let i = pos + 1\n    let part = new AST(null, ast)\n    const parts: AST[] = []\n    let acc = ''\n    while (i < str.length) {\n      const c = str.charAt(i++)\n      // still accumulate escapes at this point, but we do ignore\n      // starts that are escaped\n      if (escaping || c === '\\\\') {\n        escaping = !escaping\n        acc += c\n        continue\n      }\n\n      if (inBrace) {\n        if (i === braceStart + 1) {\n          if (c === '^' || c === '!') {\n            braceNeg = true\n          }\n        } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n          inBrace = false\n        }\n        acc += c\n        continue\n      } else if (c === '[') {\n        inBrace = true\n        braceStart = i\n        braceNeg = false\n        acc += c\n        continue\n      }\n\n      if (isExtglobType(c) && str.charAt(i) === '(') {\n        part.push(acc)\n        acc = ''\n        const ext = new AST(c, part)\n        part.push(ext)\n        i = AST.#parseAST(str, ext, i, opt)\n        continue\n      }\n      if (c === '|') {\n        part.push(acc)\n        acc = ''\n        parts.push(part)\n        part = new AST(null, ast)\n        continue\n      }\n      if (c === ')') {\n        if (acc === '' && ast.#parts.length === 0) {\n          ast.#emptyExt = true\n        }\n        part.push(acc)\n        acc = ''\n        ast.push(...parts, part)\n        return i\n      }\n      acc += c\n    }\n\n    // unfinished extglob\n    // if we got here, it was a malformed extglob! not an extglob, but\n    // maybe something else in there.\n    ast.type = null\n    ast.#hasMagic = undefined\n    ast.#parts = [str.substring(pos - 1)]\n    return i\n  }\n\n  static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n    const ast = new AST(null, undefined, options)\n    AST.#parseAST(pattern, ast, 0, options)\n    return ast\n  }\n\n  // returns the regular expression if there's magic, or the unescaped\n  // string if not.\n  toMMPattern(): MMRegExp | string {\n    // should only be called on root\n    /* c8 ignore start */\n    if (this !== this.#root) return this.#root.toMMPattern()\n    /* c8 ignore stop */\n    const glob = this.toString()\n    const [re, body, hasMagic, uflag] = this.toRegExpSource()\n    // if we're in nocase mode, and not nocaseMagicOnly, then we do\n    // still need a regular expression if we have to case-insensitively\n    // match capital/lowercase characters.\n    const anyMagic =\n      hasMagic ||\n      this.#hasMagic ||\n      (this.#options.nocase &&\n        !this.#options.nocaseMagicOnly &&\n        glob.toUpperCase() !== glob.toLowerCase())\n    if (!anyMagic) {\n      return body\n    }\n\n    const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n    return Object.assign(new RegExp(`^${re}$`, flags), {\n      _src: re,\n      _glob: glob,\n    })\n  }\n\n  get options() {\n    return this.#options\n  }\n\n  // returns the string match, the regexp source, whether there's magic\n  // in the regexp (so a regular expression is required) and whether or\n  // not the uflag is needed for the regular expression (for posix classes)\n  // TODO: instead of injecting the start/end at this point, just return\n  // the BODY of the regexp, along with the start/end portions suitable\n  // for binding the start/end in either a joined full-path makeRe context\n  // (where we bind to (^|/), or a standalone matchPart context (where\n  // we bind to ^, and not /).  Otherwise slashes get duped!\n  //\n  // In part-matching mode, the start is:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n  // - if dots allowed or not possible: ^\n  // - if dots possible and not allowed: ^(?!\\.)\n  // end is:\n  // - if not isEnd(): nothing\n  // - else: $\n  //\n  // In full-path matching mode, we put the slash at the START of the\n  // pattern, so start is:\n  // - if first pattern: same as part-matching mode\n  // - if not isStart(): nothing\n  // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n  // - if dots allowed or not possible: /\n  // - if dots possible and not allowed: /(?!\\.)\n  // end is:\n  // - if last pattern, same as part-matching mode\n  // - else nothing\n  //\n  // Always put the (?:$|/) on negated tails, though, because that has to be\n  // there to bind the end of the negated pattern portion, and it's easier to\n  // just stick it in now rather than try to inject it later in the middle of\n  // the pattern.\n  //\n  // We can just always return the same end, and leave it up to the caller\n  // to know whether it's going to be used joined or in parts.\n  // And, if the start is adjusted slightly, can do the same there:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n  // - if dots allowed or not possible: (?:/|^)\n  // - if dots possible and not allowed: (?:/|^)(?!\\.)\n  //\n  // But it's better to have a simpler binding without a conditional, for\n  // performance, so probably better to return both start options.\n  //\n  // Then the caller just ignores the end if it's not the first pattern,\n  // and the start always gets applied.\n  //\n  // But that's always going to be $ if it's the ending pattern, or nothing,\n  // so the caller can just attach $ at the end of the pattern when building.\n  //\n  // So the todo is:\n  // - better detect what kind of start is needed\n  // - return both flavors of starting pattern\n  // - attach $ at the end of the pattern when creating the actual RegExp\n  //\n  // Ah, but wait, no, that all only applies to the root when the first pattern\n  // is not an extglob. If the first pattern IS an extglob, then we need all\n  // that dot prevention biz to live in the extglob portions, because eg\n  // +(*|.x*) can match .xy but not .yx.\n  //\n  // So, return the two flavors if it's #root and the first child is not an\n  // AST, otherwise leave it to the child AST to handle it, and there,\n  // use the (?:^|/) style of start binding.\n  //\n  // Even simplified further:\n  // - Since the start for a join is eg /(?!\\.) and the start for a part\n  // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n  // or start or whatever) and prepend ^ or / at the Regexp construction.\n  toRegExpSource(\n    allowDot?: boolean\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    const dot = allowDot ?? !!this.#options.dot\n    if (this.#root === this) this.#fillNegs()\n    if (!this.type) {\n      const noEmpty = this.isStart() && this.isEnd()\n      const src = this.#parts\n        .map(p => {\n          const [re, _, hasMagic, uflag] =\n            typeof p === 'string'\n              ? AST.#parseGlob(p, this.#hasMagic, noEmpty)\n              : p.toRegExpSource(allowDot)\n          this.#hasMagic = this.#hasMagic || hasMagic\n          this.#uflag = this.#uflag || uflag\n          return re\n        })\n        .join('')\n\n      let start = ''\n      if (this.isStart()) {\n        if (typeof this.#parts[0] === 'string') {\n          // this is the string that will match the start of the pattern,\n          // so we need to protect against dots and such.\n\n          // '.' and '..' cannot match unless the pattern is that exactly,\n          // even if it starts with . or dot:true is set.\n          const dotTravAllowed =\n            this.#parts.length === 1 && justDots.has(this.#parts[0])\n          if (!dotTravAllowed) {\n            const aps = addPatternStart\n            // check if we have a possibility of matching . or ..,\n            // and prevent that.\n            const needNoTrav =\n              // dots are allowed, and the pattern starts with [ or .\n              (dot && aps.has(src.charAt(0))) ||\n              // the pattern starts with \\., and then [ or .\n              (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n              // the pattern starts with \\.\\., and then [ or .\n              (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n            // no need to prevent dots if it can't match a dot, or if a\n            // sub-pattern will be preventing it anyway.\n            const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n            start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''\n          }\n        }\n      }\n\n      // append the \"end of path portion\" pattern to negation tails\n      let end = ''\n      if (\n        this.isEnd() &&\n        this.#root.#filledNegs &&\n        this.#parent?.type === '!'\n      ) {\n        end = '(?:$|\\\\/)'\n      }\n      const final = start + src + end\n      return [\n        final,\n        unescape(src),\n        (this.#hasMagic = !!this.#hasMagic),\n        this.#uflag,\n      ]\n    }\n\n    // We need to calculate the body *twice* if it's a repeat pattern\n    // at the start, once in nodot mode, then again in dot mode, so a\n    // pattern like *(?) can match 'x.y'\n\n    const repeated = this.type === '*' || this.type === '+'\n    // some kind of extglob\n    const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n    let body = this.#partsToRegExp(dot)\n\n    if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n      // invalid extglob, has to at least be *something* present, if it's\n      // the entire path portion.\n      const s = this.toString()\n      this.#parts = [s]\n      this.type = null\n      this.#hasMagic = undefined\n      return [s, unescape(this.toString()), false, false]\n    }\n\n    // XXX abstract out this map method\n    let bodyDotAllowed =\n      !repeated || allowDot || dot || !startNoDot\n        ? ''\n        : this.#partsToRegExp(true)\n    if (bodyDotAllowed === body) {\n      bodyDotAllowed = ''\n    }\n    if (bodyDotAllowed) {\n      body = `(?:${body})(?:${bodyDotAllowed})*?`\n    }\n\n    // an empty !() is exactly equivalent to a starNoEmpty\n    let final = ''\n    if (this.type === '!' && this.#emptyExt) {\n      final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n    } else {\n      const close =\n        this.type === '!'\n          ? // !() must match something,but !(x) can match ''\n            '))' +\n            (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n            star +\n            ')'\n          : this.type === '@'\n          ? ')'\n          : this.type === '?'\n          ? ')?'\n          : this.type === '+' && bodyDotAllowed\n          ? ')'\n          : this.type === '*' && bodyDotAllowed\n          ? `)?`\n          : `)${this.type}`\n      final = start + body + close\n    }\n    return [\n      final,\n      unescape(body),\n      (this.#hasMagic = !!this.#hasMagic),\n      this.#uflag,\n    ]\n  }\n\n  #partsToRegExp(dot: boolean) {\n    return this.#parts\n      .map(p => {\n        // extglob ASTs should only contain parent ASTs\n        /* c8 ignore start */\n        if (typeof p === 'string') {\n          throw new Error('string type in extglob ast??')\n        }\n        /* c8 ignore stop */\n        // can ignore hasMagic, because extglobs are already always magic\n        const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n        this.#uflag = this.#uflag || uflag\n        return re\n      })\n      .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n      .join('|')\n  }\n\n  static #parseGlob(\n    glob: string,\n    hasMagic: boolean | undefined,\n    noEmpty: boolean = false\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    let escaping = false\n    let re = ''\n    let uflag = false\n    for (let i = 0; i < glob.length; i++) {\n      const c = glob.charAt(i)\n      if (escaping) {\n        escaping = false\n        re += (reSpecials.has(c) ? '\\\\' : '') + c\n        continue\n      }\n      if (c === '\\\\') {\n        if (i === glob.length - 1) {\n          re += '\\\\\\\\'\n        } else {\n          escaping = true\n        }\n        continue\n      }\n      if (c === '[') {\n        const [src, needUflag, consumed, magic] = parseClass(glob, i)\n        if (consumed) {\n          re += src\n          uflag = uflag || needUflag\n          i += consumed - 1\n          hasMagic = hasMagic || magic\n          continue\n        }\n      }\n      if (c === '*') {\n        if (noEmpty && glob === '*') re += starNoEmpty\n        else re += star\n        hasMagic = true\n        continue\n      }\n      if (c === '?') {\n        re += qmark\n        hasMagic = true\n        continue\n      }\n      re += regExpEscape(c)\n    }\n    return [re, unescape(glob), !!hasMagic, uflag]\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
new file mode 100644
index 0000000..d394964
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AA+BA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,SACf,MAAM,YACF,MAAM,qBA8HjB,CAAA"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js
new file mode 100644
index 0000000..c629d6a
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js
@@ -0,0 +1,148 @@
+// translate the various posix character classes into unicode properties
+// this works across all unicode locales
+// { : [, /u flag required, negated]
+const posixClasses = {
+    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
+    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
+    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
+    '[:blank:]': ['\\p{Zs}\\t', true],
+    '[:cntrl:]': ['\\p{Cc}', true],
+    '[:digit:]': ['\\p{Nd}', true],
+    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
+    '[:lower:]': ['\\p{Ll}', true],
+    '[:print:]': ['\\p{C}', true],
+    '[:punct:]': ['\\p{P}', true],
+    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
+    '[:upper:]': ['\\p{Lu}', true],
+    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
+    '[:xdigit:]': ['A-Fa-f0-9', false],
+};
+// only need to escape a few things inside of brace expressions
+// escapes: [ \ ] -
+const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
+// escape all regexp magic characters
+const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// everything has already been escaped, we just have to join
+const rangesToString = (ranges) => ranges.join('');
+// takes a glob string at a posix brace expression, and returns
+// an equivalent regular expression source, and boolean indicating
+// whether the /u flag needs to be applied, and the number of chars
+// consumed to parse the character class.
+// This also removes out of order ranges, and returns ($.) if the
+// entire class just no good.
+export const parseClass = (glob, position) => {
+    const pos = position;
+    /* c8 ignore start */
+    if (glob.charAt(pos) !== '[') {
+        throw new Error('not in a brace expression');
+    }
+    /* c8 ignore stop */
+    const ranges = [];
+    const negs = [];
+    let i = pos + 1;
+    let sawStart = false;
+    let uflag = false;
+    let escaping = false;
+    let negate = false;
+    let endPos = pos;
+    let rangeStart = '';
+    WHILE: while (i < glob.length) {
+        const c = glob.charAt(i);
+        if ((c === '!' || c === '^') && i === pos + 1) {
+            negate = true;
+            i++;
+            continue;
+        }
+        if (c === ']' && sawStart && !escaping) {
+            endPos = i + 1;
+            break;
+        }
+        sawStart = true;
+        if (c === '\\') {
+            if (!escaping) {
+                escaping = true;
+                i++;
+                continue;
+            }
+            // escaped \ char, fall through and treat like normal char
+        }
+        if (c === '[' && !escaping) {
+            // either a posix class, a collation equivalent, or just a [
+            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
+                if (glob.startsWith(cls, i)) {
+                    // invalid, [a-[] is fine, but not [a-[:alpha]]
+                    if (rangeStart) {
+                        return ['$.', false, glob.length - pos, true];
+                    }
+                    i += cls.length;
+                    if (neg)
+                        negs.push(unip);
+                    else
+                        ranges.push(unip);
+                    uflag = uflag || u;
+                    continue WHILE;
+                }
+            }
+        }
+        // now it's just a normal character, effectively
+        escaping = false;
+        if (rangeStart) {
+            // throw this range away if it's not valid, but others
+            // can still match.
+            if (c > rangeStart) {
+                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
+            }
+            else if (c === rangeStart) {
+                ranges.push(braceEscape(c));
+            }
+            rangeStart = '';
+            i++;
+            continue;
+        }
+        // now might be the start of a range.
+        // can be either c-d or c-] or c] or c] at this point
+        if (glob.startsWith('-]', i + 1)) {
+            ranges.push(braceEscape(c + '-'));
+            i += 2;
+            continue;
+        }
+        if (glob.startsWith('-', i + 1)) {
+            rangeStart = c;
+            i += 2;
+            continue;
+        }
+        // not the start of a range, just a single character
+        ranges.push(braceEscape(c));
+        i++;
+    }
+    if (endPos < i) {
+        // didn't see the end of the class, not a valid class,
+        // but might still be valid as a literal match.
+        return ['', false, 0, false];
+    }
+    // if we got no ranges and no negates, then we have a range that
+    // cannot possibly match anything, and that poisons the whole glob
+    if (!ranges.length && !negs.length) {
+        return ['$.', false, glob.length - pos, true];
+    }
+    // if we got one positive range, and it's a single character, then that's
+    // not actually a magic pattern, it's just that one literal character.
+    // we should not treat that as "magic", we should just return the literal
+    // character. [_] is a perfectly valid way to escape glob magic chars.
+    if (negs.length === 0 &&
+        ranges.length === 1 &&
+        /^\\?.$/.test(ranges[0]) &&
+        !negate) {
+        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
+        return [regexpEscape(r), false, endPos - pos, false];
+    }
+    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
+    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
+    const comb = ranges.length && negs.length
+        ? '(' + sranges + '|' + snegs + ')'
+        : ranges.length
+            ? sranges
+            : snegs;
+    return [comb, uflag, endPos - pos, true];
+};
+//# sourceMappingURL=brace-expressions.js.map
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js.map
new file mode 100644
index 0000000..cdba30d
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"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","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } = {\n  '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n  '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n  '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n  '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n  '[:cntrl:]': ['\\\\p{Cc}', true],\n  '[:digit:]': ['\\\\p{Nd}', true],\n  '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n  '[:lower:]': ['\\\\p{Ll}', true],\n  '[:print:]': ['\\\\p{C}', true],\n  '[:punct:]': ['\\\\p{P}', true],\n  '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n  '[:upper:]': ['\\\\p{Lu}', true],\n  '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n  '[:xdigit:]': ['A-Fa-f0-9', false],\n}\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n  src: string,\n  uFlag: boolean,\n  consumed: number,\n  hasMagic: boolean\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n  glob: string,\n  position: number\n): ParseClassResult => {\n  const pos = position\n  /* c8 ignore start */\n  if (glob.charAt(pos) !== '[') {\n    throw new Error('not in a brace expression')\n  }\n  /* c8 ignore stop */\n  const ranges: string[] = []\n  const negs: string[] = []\n\n  let i = pos + 1\n  let sawStart = false\n  let uflag = false\n  let escaping = false\n  let negate = false\n  let endPos = pos\n  let rangeStart = ''\n  WHILE: while (i < glob.length) {\n    const c = glob.charAt(i)\n    if ((c === '!' || c === '^') && i === pos + 1) {\n      negate = true\n      i++\n      continue\n    }\n\n    if (c === ']' && sawStart && !escaping) {\n      endPos = i + 1\n      break\n    }\n\n    sawStart = true\n    if (c === '\\\\') {\n      if (!escaping) {\n        escaping = true\n        i++\n        continue\n      }\n      // escaped \\ char, fall through and treat like normal char\n    }\n    if (c === '[' && !escaping) {\n      // either a posix class, a collation equivalent, or just a [\n      for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n        if (glob.startsWith(cls, i)) {\n          // invalid, [a-[] is fine, but not [a-[:alpha]]\n          if (rangeStart) {\n            return ['$.', false, glob.length - pos, true]\n          }\n          i += cls.length\n          if (neg) negs.push(unip)\n          else ranges.push(unip)\n          uflag = uflag || u\n          continue WHILE\n        }\n      }\n    }\n\n    // now it's just a normal character, effectively\n    escaping = false\n    if (rangeStart) {\n      // throw this range away if it's not valid, but others\n      // can still match.\n      if (c > rangeStart) {\n        ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n      } else if (c === rangeStart) {\n        ranges.push(braceEscape(c))\n      }\n      rangeStart = ''\n      i++\n      continue\n    }\n\n    // now might be the start of a range.\n    // can be either c-d or c-] or c] or c] at this point\n    if (glob.startsWith('-]', i + 1)) {\n      ranges.push(braceEscape(c + '-'))\n      i += 2\n      continue\n    }\n    if (glob.startsWith('-', i + 1)) {\n      rangeStart = c\n      i += 2\n      continue\n    }\n\n    // not the start of a range, just a single character\n    ranges.push(braceEscape(c))\n    i++\n  }\n\n  if (endPos < i) {\n    // didn't see the end of the class, not a valid class,\n    // but might still be valid as a literal match.\n    return ['', false, 0, false]\n  }\n\n  // if we got no ranges and no negates, then we have a range that\n  // cannot possibly match anything, and that poisons the whole glob\n  if (!ranges.length && !negs.length) {\n    return ['$.', false, glob.length - pos, true]\n  }\n\n  // if we got one positive range, and it's a single character, then that's\n  // not actually a magic pattern, it's just that one literal character.\n  // we should not treat that as \"magic\", we should just return the literal\n  // character. [_] is a perfectly valid way to escape glob magic chars.\n  if (\n    negs.length === 0 &&\n    ranges.length === 1 &&\n    /^\\\\?.$/.test(ranges[0]) &&\n    !negate\n  ) {\n    const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n    return [regexpEscape(r), false, endPos - pos, false]\n  }\n\n  const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n  const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n  const comb =\n    ranges.length && negs.length\n      ? '(' + sranges + '|' + snegs + ')'\n      : ranges.length\n      ? sranges\n      : snegs\n\n  return [comb, uflag, endPos - pos, true]\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts.map
new file mode 100644
index 0000000..0779dae
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,MACd,MAAM,8BAGN,KAAK,gBAAgB,EAAE,sBAAsB,CAAC,WAQlD,CAAA"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js
new file mode 100644
index 0000000..16f7c8c
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js
@@ -0,0 +1,18 @@
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ */
+export const escape = (s, { windowsPathsNoEscape = false, } = {}) => {
+    // don't need to escape +@! because we escape the parens
+    // that make those magic, and escaping ! as [!] isn't valid,
+    // because [!]] is a valid glob class meaning not ']'.
+    return windowsPathsNoEscape
+        ? s.replace(/[?*()[\]]/g, '[$&]')
+        : s.replace(/[?*()[\]\\]/g, '\\$&');
+};
+//# sourceMappingURL=escape.js.map
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js.map
new file mode 100644
index 0000000..170fd1a
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,MACsB,EAAE,EACtD,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,OAAO,oBAAoB;QACzB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA","sourcesContent":["import { MinimatchOptions } from './index.js'\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character.  In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n */\nexport const escape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n  }: Pick = {}\n) => {\n  // don't need to escape +@! because we escape the parens\n  // that make those magic, and escaping ! as [!] isn't valid,\n  // because [!]] is a valid glob class meaning not ']'.\n  return windowsPathsNoEscape\n    ? s.replace(/[?*()[\\]]/g, '[$&]')\n    : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts.map
new file mode 100644
index 0000000..195491d
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js
new file mode 100644
index 0000000..84b577b
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js
@@ -0,0 +1,1001 @@
+import expand from 'brace-expansion';
+import { assertValidPattern } from './assert-valid-pattern.js';
+import { AST } from './ast.js';
+import { escape } from './escape.js';
+import { unescape } from './unescape.js';
+export const minimatch = (p, pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // shortcut: comments match nothing.
+    if (!options.nocomment && pattern.charAt(0) === '#') {
+        return false;
+    }
+    return new Minimatch(pattern, options).match(p);
+};
+// Optimized checking for the most common glob patterns.
+const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
+const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
+const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
+const starDotExtTestNocase = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
+};
+const starDotExtTestNocaseDot = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => f.toLowerCase().endsWith(ext);
+};
+const starDotStarRE = /^\*+\.\*+$/;
+const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
+const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
+const dotStarRE = /^\.\*+$/;
+const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
+const starRE = /^\*+$/;
+const starTest = (f) => f.length !== 0 && !f.startsWith('.');
+const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
+const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
+const qmarksTestNocase = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestNocaseDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTest = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTestNoExt = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && !f.startsWith('.');
+};
+const qmarksTestNoExtDot = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && f !== '.' && f !== '..';
+};
+/* c8 ignore start */
+const defaultPlatform = (typeof process === 'object' && process
+    ? (typeof process.env === 'object' &&
+        process.env &&
+        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
+        process.platform
+    : 'posix');
+const path = {
+    win32: { sep: '\\' },
+    posix: { sep: '/' },
+};
+/* c8 ignore stop */
+export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
+minimatch.sep = sep;
+export const GLOBSTAR = Symbol('globstar **');
+minimatch.GLOBSTAR = GLOBSTAR;
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
+export const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
+minimatch.filter = filter;
+const ext = (a, b = {}) => Object.assign({}, a, b);
+export const defaults = (def) => {
+    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
+        return minimatch;
+    }
+    const orig = minimatch;
+    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
+    return Object.assign(m, {
+        Minimatch: class Minimatch extends orig.Minimatch {
+            constructor(pattern, options = {}) {
+                super(pattern, ext(def, options));
+            }
+            static defaults(options) {
+                return orig.defaults(ext(def, options)).Minimatch;
+            }
+        },
+        AST: class AST extends orig.AST {
+            /* c8 ignore start */
+            constructor(type, parent, options = {}) {
+                super(type, parent, ext(def, options));
+            }
+            /* c8 ignore stop */
+            static fromGlob(pattern, options = {}) {
+                return orig.AST.fromGlob(pattern, ext(def, options));
+            }
+        },
+        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
+        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
+        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
+        defaults: (options) => orig.defaults(ext(def, options)),
+        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
+        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
+        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
+        sep: orig.sep,
+        GLOBSTAR: GLOBSTAR,
+    });
+};
+minimatch.defaults = defaults;
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+export const braceExpand = (pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // Thanks to Yeting Li  for
+    // improving this regexp to avoid a ReDOS vulnerability.
+    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
+        // shortcut. no need to expand.
+        return [pattern];
+    }
+    return expand(pattern);
+};
+minimatch.braceExpand = braceExpand;
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
+minimatch.makeRe = makeRe;
+export const match = (list, pattern, options = {}) => {
+    const mm = new Minimatch(pattern, options);
+    list = list.filter(f => mm.match(f));
+    if (mm.options.nonull && !list.length) {
+        list.push(pattern);
+    }
+    return list;
+};
+minimatch.match = match;
+// replace stuff like \* with *
+const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+export class Minimatch {
+    options;
+    set;
+    pattern;
+    windowsPathsNoEscape;
+    nonegate;
+    negate;
+    comment;
+    empty;
+    preserveMultipleSlashes;
+    partial;
+    globSet;
+    globParts;
+    nocase;
+    isWindows;
+    platform;
+    windowsNoMagicRoot;
+    regexp;
+    constructor(pattern, options = {}) {
+        assertValidPattern(pattern);
+        options = options || {};
+        this.options = options;
+        this.pattern = pattern;
+        this.platform = options.platform || defaultPlatform;
+        this.isWindows = this.platform === 'win32';
+        this.windowsPathsNoEscape =
+            !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
+        if (this.windowsPathsNoEscape) {
+            this.pattern = this.pattern.replace(/\\/g, '/');
+        }
+        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
+        this.regexp = null;
+        this.negate = false;
+        this.nonegate = !!options.nonegate;
+        this.comment = false;
+        this.empty = false;
+        this.partial = !!options.partial;
+        this.nocase = !!this.options.nocase;
+        this.windowsNoMagicRoot =
+            options.windowsNoMagicRoot !== undefined
+                ? options.windowsNoMagicRoot
+                : !!(this.isWindows && this.nocase);
+        this.globSet = [];
+        this.globParts = [];
+        this.set = [];
+        // make the set of regexps etc.
+        this.make();
+    }
+    hasMagic() {
+        if (this.options.magicalBraces && this.set.length > 1) {
+            return true;
+        }
+        for (const pattern of this.set) {
+            for (const part of pattern) {
+                if (typeof part !== 'string')
+                    return true;
+            }
+        }
+        return false;
+    }
+    debug(..._) { }
+    make() {
+        const pattern = this.pattern;
+        const options = this.options;
+        // empty patterns and comments match nothing.
+        if (!options.nocomment && pattern.charAt(0) === '#') {
+            this.comment = true;
+            return;
+        }
+        if (!pattern) {
+            this.empty = true;
+            return;
+        }
+        // step 1: figure out negation, etc.
+        this.parseNegate();
+        // step 2: expand braces
+        this.globSet = [...new Set(this.braceExpand())];
+        if (options.debug) {
+            this.debug = (...args) => console.error(...args);
+        }
+        this.debug(this.pattern, this.globSet);
+        // step 3: now we have a set, so turn each one into a series of
+        // path-portion matching patterns.
+        // These will be regexps, except in the case of "**", which is
+        // set to the GLOBSTAR object for globstar behavior,
+        // and will not contain any / characters
+        //
+        // First, we preprocess to make the glob pattern sets a bit simpler
+        // and deduped.  There are some perf-killing patterns that can cause
+        // problems with a glob walk, but we can simplify them down a bit.
+        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
+        this.globParts = this.preprocess(rawGlobParts);
+        this.debug(this.pattern, this.globParts);
+        // glob --> regexps
+        let set = this.globParts.map((s, _, __) => {
+            if (this.isWindows && this.windowsNoMagicRoot) {
+                // check if it's a drive or unc path.
+                const isUNC = s[0] === '' &&
+                    s[1] === '' &&
+                    (s[2] === '?' || !globMagic.test(s[2])) &&
+                    !globMagic.test(s[3]);
+                const isDrive = /^[a-z]:/i.test(s[0]);
+                if (isUNC) {
+                    return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))];
+                }
+                else if (isDrive) {
+                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
+                }
+            }
+            return s.map(ss => this.parse(ss));
+        });
+        this.debug(this.pattern, set);
+        // filter out everything that didn't compile properly.
+        this.set = set.filter(s => s.indexOf(false) === -1);
+        // do not treat the ? in UNC paths as magic
+        if (this.isWindows) {
+            for (let i = 0; i < this.set.length; i++) {
+                const p = this.set[i];
+                if (p[0] === '' &&
+                    p[1] === '' &&
+                    this.globParts[i][2] === '?' &&
+                    typeof p[3] === 'string' &&
+                    /^[a-z]:$/i.test(p[3])) {
+                    p[2] = '?';
+                }
+            }
+        }
+        this.debug(this.pattern, this.set);
+    }
+    // various transforms to equivalent pattern sets that are
+    // faster to process in a filesystem walk.  The goal is to
+    // eliminate what we can, and push all ** patterns as far
+    // to the right as possible, even if it increases the number
+    // of patterns that we have to process.
+    preprocess(globParts) {
+        // if we're not in globstar mode, then turn all ** into *
+        if (this.options.noglobstar) {
+            for (let i = 0; i < globParts.length; i++) {
+                for (let j = 0; j < globParts[i].length; j++) {
+                    if (globParts[i][j] === '**') {
+                        globParts[i][j] = '*';
+                    }
+                }
+            }
+        }
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            // aggressive optimization for the purpose of fs walking
+            globParts = this.firstPhasePreProcess(globParts);
+            globParts = this.secondPhasePreProcess(globParts);
+        }
+        else if (optimizationLevel >= 1) {
+            // just basic optimizations to remove some .. parts
+            globParts = this.levelOneOptimize(globParts);
+        }
+        else {
+            // just collapse multiple ** portions into one
+            globParts = this.adjascentGlobstarOptimize(globParts);
+        }
+        return globParts;
+    }
+    // just get rid of adjascent ** portions
+    adjascentGlobstarOptimize(globParts) {
+        return globParts.map(parts => {
+            let gs = -1;
+            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
+                let i = gs;
+                while (parts[i + 1] === '**') {
+                    i++;
+                }
+                if (i !== gs) {
+                    parts.splice(gs, i - gs);
+                }
+            }
+            return parts;
+        });
+    }
+    // get rid of adjascent ** and resolve .. portions
+    levelOneOptimize(globParts) {
+        return globParts.map(parts => {
+            parts = parts.reduce((set, part) => {
+                const prev = set[set.length - 1];
+                if (part === '**' && prev === '**') {
+                    return set;
+                }
+                if (part === '..') {
+                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
+                        set.pop();
+                        return set;
+                    }
+                }
+                set.push(part);
+                return set;
+            }, []);
+            return parts.length === 0 ? [''] : parts;
+        });
+    }
+    levelTwoFileOptimize(parts) {
+        if (!Array.isArray(parts)) {
+            parts = this.slashSplit(parts);
+        }
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p && p !== '.' && p !== '..' && p !== '**') {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        const options = this.options;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
+            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [file[fdi], pattern[pdi]];
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    if (pdi > fdi) {
+                        pattern = pattern.slice(pdi);
+                    }
+                    else if (fdi > pdi) {
+                        file = file.slice(fdi);
+                    }
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // dont' need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        this.debug('matchOne', this, { file, pattern });
+        this.debug('matchOne', file.length, pattern.length);
+        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            var p = pattern[pi];
+            var f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false) {
+                return false;
+            }
+            /* c8 ignore stop */
+            if (p === GLOBSTAR) {
+                this.debug('GLOBSTAR', [pattern, p, f]);
+                // "**"
+                // a/**/b/**/c would match the following:
+                // a/b/x/y/z/c
+                // a/x/y/z/b/c
+                // a/b/x/b/x/c
+                // a/b/c
+                // To do this, take the rest of the pattern after
+                // the **, and see if it would match the file remainder.
+                // If so, return success.
+                // If not, the ** "swallows" a segment, and try again.
+                // This is recursively awful.
+                //
+                // a/**/b/**/c matching a/b/x/y/z/c
+                // - a matches a
+                // - doublestar
+                //   - matchOne(b/x/y/z/c, b/**/c)
+                //     - b matches b
+                //     - doublestar
+                //       - matchOne(x/y/z/c, c) -> no
+                //       - matchOne(y/z/c, c) -> no
+                //       - matchOne(z/c, c) -> no
+                //       - matchOne(c, c) yes, hit
+                var fr = fi;
+                var pr = pi + 1;
+                if (pr === pl) {
+                    this.debug('** at the end');
+                    // a ** at the end will just swallow the rest.
+                    // We have found a match.
+                    // however, it will not swallow /.x, unless
+                    // options.dot is set.
+                    // . and .. are *never* matched by **, for explosively
+                    // exponential reasons.
+                    for (; fi < fl; fi++) {
+                        if (file[fi] === '.' ||
+                            file[fi] === '..' ||
+                            (!options.dot && file[fi].charAt(0) === '.'))
+                            return false;
+                    }
+                    return true;
+                }
+                // ok, let's see if we can swallow whatever we can.
+                while (fr < fl) {
+                    var swallowee = file[fr];
+                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
+                    // XXX remove this slice.  Just pass the start index.
+                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+                        this.debug('globstar found match!', fr, fl, swallowee);
+                        // found a match.
+                        return true;
+                    }
+                    else {
+                        // can't swallow "." or ".." ever.
+                        // can only swallow ".foo" when explicitly asked.
+                        if (swallowee === '.' ||
+                            swallowee === '..' ||
+                            (!options.dot && swallowee.charAt(0) === '.')) {
+                            this.debug('dot detected!', file, fr, pattern, pr);
+                            break;
+                        }
+                        // ** swallows a segment, and continue.
+                        this.debug('globstar swallow a segment, and continue');
+                        fr++;
+                    }
+                }
+                // no match was found.
+                // However, in partial mode, we can't say this is necessarily over.
+                /* c8 ignore start */
+                if (partial) {
+                    // ran out of file
+                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
+                    if (fr === fl) {
+                        return true;
+                    }
+                }
+                /* c8 ignore stop */
+                return false;
+            }
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return braceExpand(this.pattern, this.options);
+    }
+    parse(pattern) {
+        assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot
+                    ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot
+                    ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar
+            ? star
+            : options.dot
+                ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return typeof p === 'string'
+                    ? regExpEscape(p)
+                    : p === GLOBSTAR
+                        ? GLOBSTAR
+                        : p._src;
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== GLOBSTAR || prev === GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
+                }
+                else if (next !== GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = GLOBSTAR;
+                }
+            });
+            return pp.filter(p => p !== GLOBSTAR).join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch (ex) {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (let i = 0; i < set.length; i++) {
+            const pattern = set[i];
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore start */
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+/* c8 ignore stop */
+minimatch.AST = AST;
+minimatch.Minimatch = Minimatch;
+minimatch.escape = escape;
+minimatch.unescape = unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js.map
new file mode 100644
index 0000000..ff82a0d
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,GAAG,EAAe,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAsCxC,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACnD,OAAO,KAAK,CAAA;KACb;IAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC,CAAA;AAED,wDAAwD;AACxD,MAAM,YAAY,GAAG,uBAAuB,CAAA;AAC5C,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CACpD,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACvC,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACzE,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC3C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC3E,CAAC,CAAA;AACD,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC9C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACrD,CAAC,CAAA;AACD,MAAM,aAAa,GAAG,YAAY,CAAA;AAClC,MAAM,eAAe,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC5E,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAE,EAAE,CACvC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC5C,MAAM,SAAS,GAAG,SAAS,CAAA;AAC3B,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC/E,MAAM,MAAM,GAAG,OAAO,CAAA;AACtB,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACpE,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAA;AAC5E,MAAM,QAAQ,GAAG,wBAAwB,CAAA;AACzC,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IAC5D,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACnC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAA;IACtB,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACjE,CAAC,CAAA;AACD,MAAM,mBAAmB,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IAC/D,MAAM,KAAK,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAA;IACtB,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACjE,CAAC,CAAA;AACD,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IACzD,MAAM,KAAK,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAClE,CAAC,CAAA;AACD,MAAM,UAAU,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAmB,EAAE,EAAE;IACtD,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACnC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAClE,CAAC,CAAA;AACD,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,CAAmB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAA;IACrB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC9D,CAAC,CAAA;AACD,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAmB,EAAE,EAAE;IACpD,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAA;IACrB,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAA;AACnE,CAAC,CAAA;AAED,qBAAqB;AACrB,MAAM,eAAe,GAAa,CAChC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO;IACpC,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC9B,OAAO,CAAC,GAAG;QACX,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;QAC7C,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CACA,CAAA;AAEb,MAAM,IAAI,GAAkC;IAC1C,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;IACpB,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;CACpB,CAAA;AACD,oBAAoB;AAEpB,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA;AAChF,SAAS,CAAC,GAAG,GAAG,GAAG,CAAA;AAEnB,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AAC7C,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA;AAE7B,gCAAgC;AAChC,iDAAiD;AACjD,MAAM,KAAK,GAAG,MAAM,CAAA;AAEpB,gCAAgC;AAChC,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,CAAA;AAEzB,4DAA4D;AAC5D,+DAA+D;AAC/D,6CAA6C;AAC7C,MAAM,UAAU,GAAG,yCAAyC,CAAA;AAE5D,kCAAkC;AAClC,6CAA6C;AAC7C,MAAM,YAAY,GAAG,yBAAyB,CAAA;AAE9C,MAAM,CAAC,MAAM,MAAM,GACjB,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACpD,CAAC,CAAS,EAAE,EAAE,CACZ,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAClC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AAEzB,MAAM,GAAG,GAAG,CAAC,CAAmB,EAAE,IAAsB,EAAE,EAAE,EAAE,CAC5D,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAEzB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAqB,EAAoB,EAAE;IAClE,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE;QAC/D,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,IAAI,GAAG,SAAS,CAAA;IAEtB,MAAM,CAAC,GAAG,CAAC,CAAS,EAAE,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACvE,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;IAErC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE;QACtB,SAAS,EAAE,MAAM,SAAU,SAAQ,IAAI,CAAC,SAAS;YAC/C,YAAY,OAAe,EAAE,UAA4B,EAAE;gBACzD,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACnC,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC,OAAyB;gBACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;YACnD,CAAC;SACF;QAED,GAAG,EAAE,MAAM,GAAI,SAAQ,IAAI,CAAC,GAAG;YAC7B,qBAAqB;YACrB,YACE,IAAwB,EACxB,MAAY,EACZ,UAA4B,EAAE;gBAE9B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACxC,CAAC;YACD,oBAAoB;YAEpB,MAAM,CAAC,QAAQ,CAAC,OAAe,EAAE,UAA4B,EAAE;gBAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;YACtD,CAAC;SACF;QAED,QAAQ,EAAE,CACR,CAAS,EACT,UAA0D,EAAE,EAC5D,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,EAAE,CACN,CAAS,EACT,UAA0D,EAAE,EAC5D,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEtC,MAAM,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEzC,QAAQ,EAAE,CAAC,OAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEzE,MAAM,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEzC,WAAW,EAAE,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CAC/D,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAE9C,KAAK,EAAE,CAAC,IAAc,EAAE,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACzE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAE9C,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,QAAQ,EAAE,QAA2B;KACtC,CAAC,CAAA;AACJ,CAAC,CAAA;AACD,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA;AAE7B,mBAAmB;AACnB,qBAAqB;AACrB,mBAAmB;AACnB,8BAA8B;AAC9B,mCAAmC;AACnC,2CAA2C;AAC3C,EAAE;AACF,iCAAiC;AACjC,qBAAqB;AACrB,iBAAiB;AACjB,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAE3B,wDAAwD;IACxD,wDAAwD;IACxD,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QACxD,+BAA+B;QAC/B,OAAO,CAAC,OAAO,CAAC,CAAA;KACjB;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,CAAA;AACxB,CAAC,CAAA;AACD,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAEnC,yCAAyC;AACzC,kDAAkD;AAClD,oEAAoE;AACpE,oEAAoE;AACpE,6DAA6D;AAC7D,kEAAkE;AAClE,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,qEAAqE;AACrE,8DAA8D;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,UAA4B,EAAE,EAAE,EAAE,CACxE,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAC1C,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AAEzB,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,IAAc,EACd,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC1C,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IACpC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACrC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;KACnB;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AACD,SAAS,CAAC,KAAK,GAAG,KAAK,CAAA;AAEvB,+BAA+B;AAC/B,MAAM,SAAS,GAAG,yBAAyB,CAAA;AAC3C,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAU/C,MAAM,OAAO,SAAS;IACpB,OAAO,CAAkB;IACzB,GAAG,CAAyB;IAC5B,OAAO,CAAQ;IAEf,oBAAoB,CAAS;IAC7B,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,KAAK,CAAS;IACd,uBAAuB,CAAS;IAChC,OAAO,CAAS;IAChB,OAAO,CAAU;IACjB,SAAS,CAAY;IACrB,MAAM,CAAS;IAEf,SAAS,CAAS;IAClB,QAAQ,CAAU;IAClB,kBAAkB,CAAS;IAE3B,MAAM,CAAyB;IAC/B,YAAY,OAAe,EAAE,UAA4B,EAAE;QACzD,kBAAkB,CAAC,OAAO,CAAC,CAAA;QAE3B,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,eAAe,CAAA;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,KAAK,OAAO,CAAA;QAC1C,IAAI,CAAC,oBAAoB;YACvB,CAAC,CAAC,OAAO,CAAC,oBAAoB,IAAI,OAAO,CAAC,kBAAkB,KAAK,KAAK,CAAA;QACxE,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAChD;QACD,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAA;QAChE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA;QACnC,IAAI,CAAC,kBAAkB;YACrB,OAAO,CAAC,kBAAkB,KAAK,SAAS;gBACtC,CAAC,CAAC,OAAO,CAAC,kBAAkB;gBAC5B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,CAAA;QAEvC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;QAEb,+BAA+B;QAC/B,IAAI,CAAC,IAAI,EAAE,CAAA;IACb,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;YACrD,OAAO,IAAI,CAAA;SACZ;QACD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE;YAC9B,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;gBAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ;oBAAE,OAAO,IAAI,CAAA;aAC1C;SACF;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,CAAC,GAAG,CAAQ,IAAG,CAAC;IAErB,IAAI;QACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,6CAA6C;QAC7C,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACnD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;YACnB,OAAM;SACP;QAED,IAAI,CAAC,OAAO,EAAE;YACZ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;YACjB,OAAM;SACP;QAED,oCAAoC;QACpC,IAAI,CAAC,WAAW,EAAE,CAAA;QAElB,wBAAwB;QACxB,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;QAE/C,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;SACxD;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAEtC,+DAA+D;QAC/D,kCAAkC;QAClC,8DAA8D;QAC9D,oDAAoD;QACpD,wCAAwC;QACxC,EAAE;QACF,mEAAmE;QACnE,oEAAoE;QACpE,kEAAkE;QAClE,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;QAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAExC,mBAAmB;QACnB,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;YACxC,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,kBAAkB,EAAE;gBAC7C,qCAAqC;gBACrC,MAAM,KAAK,GACT,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACvC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACvB,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACrC,IAAI,KAAK,EAAE;oBACT,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;iBACnE;qBAAM,IAAI,OAAO,EAAE;oBAClB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;iBACvD;aACF;YACD,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QAE7B,sDAAsD;QACtD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CACF,CAAA;QAE5B,2CAA2C;QAC3C,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACxC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACrB,IACE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBACX,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;oBAC5B,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ;oBACxB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACtB;oBACA,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;iBACX;aACF;SACF;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;IACpC,CAAC;IAED,yDAAyD;IACzD,0DAA0D;IAC1D,yDAAyD;IACzD,4DAA4D;IAC5D,uCAAuC;IACvC,UAAU,CAAC,SAAqB;QAC9B,yDAAyD;QACzD,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBAC5C,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;wBAC5B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;qBACtB;iBACF;aACF;SACF;QAED,MAAM,EAAE,iBAAiB,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAE9C,IAAI,iBAAiB,IAAI,CAAC,EAAE;YAC1B,wDAAwD;YACxD,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAA;YAChD,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAA;SAClD;aAAM,IAAI,iBAAiB,IAAI,CAAC,EAAE;YACjC,mDAAmD;YACnD,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;SAC7C;aAAM;YACL,8CAA8C;YAC9C,SAAS,GAAG,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAA;SACtD;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,wCAAwC;IACxC,yBAAyB,CAAC,SAAqB;QAC7C,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3B,IAAI,EAAE,GAAW,CAAC,CAAC,CAAA;YACnB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;gBAChD,IAAI,CAAC,GAAG,EAAE,CAAA;gBACV,OAAO,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;oBAC5B,CAAC,EAAE,CAAA;iBACJ;gBACD,IAAI,CAAC,KAAK,EAAE,EAAE;oBACZ,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;iBACzB;aACF;YACD,OAAO,KAAK,CAAA;QACd,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,kDAAkD;IAClD,gBAAgB,CAAC,SAAqB;QACpC,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3B,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAa,EAAE,IAAI,EAAE,EAAE;gBAC3C,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;gBAChC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE;oBAClC,OAAO,GAAG,CAAA;iBACX;gBACD,IAAI,IAAI,KAAK,IAAI,EAAE;oBACjB,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,EAAE;wBAC1D,GAAG,CAAC,GAAG,EAAE,CAAA;wBACT,OAAO,GAAG,CAAA;qBACX;iBACF;gBACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBACd,OAAO,GAAG,CAAA;YACZ,CAAC,EAAE,EAAE,CAAC,CAAA;YACN,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,oBAAoB,CAAC,KAAwB;QAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzB,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;SAC/B;QACD,IAAI,YAAY,GAAY,KAAK,CAAA;QACjC,GAAG;YACD,YAAY,GAAG,KAAK,CAAA;YACpB,mCAAmC;YACnC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE;gBACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;oBACzC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;oBAClB,iCAAiC;oBACjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;wBAAE,SAAQ;oBACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE;wBACzB,YAAY,GAAG,IAAI,CAAA;wBACnB,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;wBAClB,CAAC,EAAE,CAAA;qBACJ;iBACF;gBACD,IACE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG;oBAChB,KAAK,CAAC,MAAM,KAAK,CAAC;oBAClB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,EACrC;oBACA,YAAY,GAAG,IAAI,CAAA;oBACnB,KAAK,CAAC,GAAG,EAAE,CAAA;iBACZ;aACF;YAED,sCAAsC;YACtC,IAAI,EAAE,GAAW,CAAC,CAAA;YAClB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;gBAChD,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;gBACvB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE;oBAC9C,YAAY,GAAG,IAAI,CAAA;oBACnB,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;oBACvB,EAAE,IAAI,CAAC,CAAA;iBACR;aACF;SACF,QAAQ,YAAY,EAAC;QACtB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC1C,CAAC;IAED,yCAAyC;IACzC,8BAA8B;IAC9B,+BAA+B;IAC/B,iDAAiD;IACjD,iBAAiB;IACjB,EAAE;IACF,gEAAgE;IAChE,gEAAgE;IAChE,kEAAkE;IAClE,qDAAqD;IACrD,EAAE;IACF,kFAAkF;IAClF,mCAAmC;IACnC,sCAAsC;IACtC,4BAA4B;IAC5B,EAAE;IACF,qEAAqE;IACrE,+DAA+D;IAC/D,oBAAoB,CAAC,SAAqB;QACxC,IAAI,YAAY,GAAG,KAAK,CAAA;QACxB,GAAG;YACD,YAAY,GAAG,KAAK,CAAA;YACpB,kFAAkF;YAClF,KAAK,IAAI,KAAK,IAAI,SAAS,EAAE;gBAC3B,IAAI,EAAE,GAAW,CAAC,CAAC,CAAA;gBACnB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;oBAChD,IAAI,GAAG,GAAW,EAAE,CAAA;oBACpB,OAAO,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;wBAC9B,wCAAwC;wBACxC,GAAG,EAAE,CAAA;qBACN;oBACD,uDAAuD;oBACvD,mCAAmC;oBACnC,IAAI,GAAG,GAAG,EAAE,EAAE;wBACZ,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;qBAC/B;oBAED,IAAI,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACxB,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACvB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACxB,IAAI,IAAI,KAAK,IAAI;wBAAE,SAAQ;oBAC3B,IACE,CAAC,CAAC;wBACF,CAAC,KAAK,GAAG;wBACT,CAAC,KAAK,IAAI;wBACV,CAAC,EAAE;wBACH,EAAE,KAAK,GAAG;wBACV,EAAE,KAAK,IAAI,EACX;wBACA,SAAQ;qBACT;oBACD,YAAY,GAAG,IAAI,CAAA;oBACnB,4CAA4C;oBAC5C,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;oBACnB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;oBAC5B,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;oBAChB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBACrB,EAAE,EAAE,CAAA;iBACL;gBAED,mCAAmC;gBACnC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE;oBACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;wBACzC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;wBAClB,iCAAiC;wBACjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;4BAAE,SAAQ;wBACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE;4BACzB,YAAY,GAAG,IAAI,CAAA;4BACnB,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;4BAClB,CAAC,EAAE,CAAA;yBACJ;qBACF;oBACD,IACE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG;wBAChB,KAAK,CAAC,MAAM,KAAK,CAAC;wBAClB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,EACrC;wBACA,YAAY,GAAG,IAAI,CAAA;wBACnB,KAAK,CAAC,GAAG,EAAE,CAAA;qBACZ;iBACF;gBAED,sCAAsC;gBACtC,IAAI,EAAE,GAAW,CAAC,CAAA;gBAClB,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;oBAChD,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;oBACvB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE;wBAC9C,YAAY,GAAG,IAAI,CAAA;wBACnB,MAAM,OAAO,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,IAAI,CAAA;wBAClD,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;wBAClC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,CAAA;wBACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;4BAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;wBACtC,EAAE,IAAI,CAAC,CAAA;qBACR;iBACF;aACF;SACF,QAAQ,YAAY,EAAC;QAEtB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,sCAAsC;IACtC,sDAAsD;IACtD,8CAA8C;IAC9C,oDAAoD;IACpD,EAAE;IACF,2DAA2D;IAC3D,mDAAmD;IACnD,qBAAqB,CAAC,SAAqB;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAC7B,SAAS,CAAC,CAAC,CAAC,EACZ,SAAS,CAAC,CAAC,CAAC,EACZ,CAAC,IAAI,CAAC,uBAAuB,CAC9B,CAAA;gBACD,IAAI,OAAO,EAAE;oBACX,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA;oBACjB,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAA;oBACtB,MAAK;iBACN;aACF;SACF;QACD,OAAO,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IAC1C,CAAC;IAED,UAAU,CACR,CAAW,EACX,CAAW,EACX,eAAwB,KAAK;QAE7B,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IAAI,MAAM,GAAa,EAAE,CAAA;QACzB,IAAI,KAAK,GAAW,EAAE,CAAA;QACtB,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE;YACrC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAC1C,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;aACL;iBAAM,IAAI,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;gBAChE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;aACL;iBAAM,IAAI,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;gBAChE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;aACL;iBAAM,IACL,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG;gBACb,CAAC,CAAC,EAAE,CAAC;gBACL,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBAC5C,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EACd;gBACA,IAAI,KAAK,KAAK,GAAG;oBAAE,OAAO,KAAK,CAAA;gBAC/B,KAAK,GAAG,GAAG,CAAA;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;aACL;iBAAM,IACL,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG;gBACb,CAAC,CAAC,EAAE,CAAC;gBACL,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBAC5C,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EACd;gBACA,IAAI,KAAK,KAAK,GAAG;oBAAE,OAAO,KAAK,CAAA;gBAC/B,KAAK,GAAG,GAAG,CAAA;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,EAAE,EAAE,CAAA;gBACJ,EAAE,EAAE,CAAA;aACL;iBAAM;gBACL,OAAO,KAAK,CAAA;aACb;SACF;QACD,8DAA8D;QAC9D,iCAAiC;QACjC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,MAAM,CAAA;IACxC,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAM;QAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,YAAY,GAAG,CAAC,CAAA;QAEpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE;YACpE,MAAM,GAAG,CAAC,MAAM,CAAA;YAChB,YAAY,EAAE,CAAA;SACf;QAED,IAAI,YAAY;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAC5D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,+CAA+C;IAC/C,yCAAyC;IACzC,uDAAuD;IACvD,mDAAmD;IACnD,mBAAmB;IACnB,QAAQ,CAAC,IAAc,EAAE,OAAsB,EAAE,UAAmB,KAAK;QACvE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,4DAA4D;QAC5D,mEAAmE;QACnE,sBAAsB;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,SAAS,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1E,MAAM,OAAO,GACX,CAAC,SAAS;gBACV,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;gBACf,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAE3B,MAAM,YAAY,GAChB,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YAChE,MAAM,UAAU,GACd,CAAC,YAAY;gBACb,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE;gBACjB,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE;gBACjB,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG;gBAClB,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ;gBAC9B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YAE9B,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YACnD,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YACzD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBACtD,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAW,CAAC,CAAA;gBACtE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,EAAE;oBACzC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;oBACjB,IAAI,GAAG,GAAG,GAAG,EAAE;wBACb,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;qBAC7B;yBAAM,IAAI,GAAG,GAAG,GAAG,EAAE;wBACpB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;qBACvB;iBACF;aACF;SACF;QAED,4DAA4D;QAC5D,oEAAoE;QACpE,MAAM,EAAE,iBAAiB,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAC9C,IAAI,iBAAiB,IAAI,CAAC,EAAE;YAC1B,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SACvC;QAED,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;QAC/C,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;QAEnD,KACE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EACzD,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,EAClB,EAAE,EAAE,EAAE,EAAE,EAAE,EACV;YACA,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;YAC3B,IAAI,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA;YACnB,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAA;YAEhB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;YAEzB,wBAAwB;YACxB,wCAAwC;YACxC,qBAAqB;YACrB,IAAI,CAAC,KAAK,KAAK,EAAE;gBACf,OAAO,KAAK,CAAA;aACb;YACD,oBAAoB;YAEpB,IAAI,CAAC,KAAK,QAAQ,EAAE;gBAClB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;gBAEvC,OAAO;gBACP,yCAAyC;gBACzC,cAAc;gBACd,cAAc;gBACd,cAAc;gBACd,QAAQ;gBACR,iDAAiD;gBACjD,wDAAwD;gBACxD,yBAAyB;gBACzB,sDAAsD;gBACtD,6BAA6B;gBAC7B,EAAE;gBACF,mCAAmC;gBACnC,gBAAgB;gBAChB,eAAe;gBACf,kCAAkC;gBAClC,oBAAoB;gBACpB,mBAAmB;gBACnB,qCAAqC;gBACrC,mCAAmC;gBACnC,iCAAiC;gBACjC,kCAAkC;gBAClC,IAAI,EAAE,GAAG,EAAE,CAAA;gBACX,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;gBACf,IAAI,EAAE,KAAK,EAAE,EAAE;oBACb,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;oBAC3B,8CAA8C;oBAC9C,yBAAyB;oBACzB,2CAA2C;oBAC3C,sBAAsB;oBACtB,sDAAsD;oBACtD,uBAAuB;oBACvB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE;wBACpB,IACE,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG;4BAChB,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI;4BACjB,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;4BAE5C,OAAO,KAAK,CAAA;qBACf;oBACD,OAAO,IAAI,CAAA;iBACZ;gBAED,mDAAmD;gBACnD,OAAO,EAAE,GAAG,EAAE,EAAE;oBACd,IAAI,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,CAAA;oBAExB,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;oBAEhE,qDAAqD;oBACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE;wBAC7D,IAAI,CAAC,KAAK,CAAC,uBAAuB,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;wBACtD,iBAAiB;wBACjB,OAAO,IAAI,CAAA;qBACZ;yBAAM;wBACL,kCAAkC;wBAClC,iDAAiD;wBACjD,IACE,SAAS,KAAK,GAAG;4BACjB,SAAS,KAAK,IAAI;4BAClB,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,EAC7C;4BACA,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;4BAClD,MAAK;yBACN;wBAED,uCAAuC;wBACvC,IAAI,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAA;wBACtD,EAAE,EAAE,CAAA;qBACL;iBACF;gBAED,sBAAsB;gBACtB,mEAAmE;gBACnE,qBAAqB;gBACrB,IAAI,OAAO,EAAE;oBACX,kBAAkB;oBAClB,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;oBAC7D,IAAI,EAAE,KAAK,EAAE,EAAE;wBACb,OAAO,IAAI,CAAA;qBACZ;iBACF;gBACD,oBAAoB;gBACpB,OAAO,KAAK,CAAA;aACb;YAED,0BAA0B;YAC1B,gDAAgD;YAChD,qDAAqD;YACrD,IAAI,GAAY,CAAA;YAChB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;gBACzB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAA;gBACb,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;aACtC;iBAAM;gBACL,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACf,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;aACvC;YAED,IAAI,CAAC,GAAG;gBAAE,OAAO,KAAK,CAAA;SACvB;QAED,oDAAoD;QACpD,oDAAoD;QACpD,2CAA2C;QAC3C,kDAAkD;QAClD,oDAAoD;QACpD,uDAAuD;QACvD,oDAAoD;QACpD,yDAAyD;QACzD,6BAA6B;QAC7B,yCAAyC;QAEzC,gEAAgE;QAChE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;YAC1B,oDAAoD;YACpD,gBAAgB;YAChB,OAAO,IAAI,CAAA;SACZ;aAAM,IAAI,EAAE,KAAK,EAAE,EAAE;YACpB,+CAA+C;YAC/C,iDAAiD;YACjD,uBAAuB;YACvB,OAAO,OAAO,CAAA;SACf;aAAM,IAAI,EAAE,KAAK,EAAE,EAAE;YACpB,4CAA4C;YAC5C,oDAAoD;YACpD,iDAAiD;YACjD,wBAAwB;YACxB,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;YAEvC,qBAAqB;SACtB;aAAM;YACL,yBAAyB;YACzB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAA;SACxB;QACD,oBAAoB;IACtB,CAAC;IAED,WAAW;QACT,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,kBAAkB,CAAC,OAAO,CAAC,CAAA;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,YAAY;QACZ,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,QAAQ,CAAA;QACrC,IAAI,OAAO,KAAK,EAAE;YAAE,OAAO,EAAE,CAAA;QAE7B,uDAAuD;QACvD,0DAA0D;QAC1D,IAAI,CAA0B,CAAA;QAC9B,IAAI,QAAQ,GAAoC,IAAI,CAAA;QACpD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE;YAC/B,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAA;SAChD;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE;YAC5C,QAAQ,GAAG,CACT,OAAO,CAAC,MAAM;gBACZ,CAAC,CAAC,OAAO,CAAC,GAAG;oBACX,CAAC,CAAC,uBAAuB;oBACzB,CAAC,CAAC,oBAAoB;gBACxB,CAAC,CAAC,OAAO,CAAC,GAAG;oBACb,CAAC,CAAC,iBAAiB;oBACnB,CAAC,CAAC,cAAc,CACnB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SACR;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE;YACxC,QAAQ,GAAG,CACT,OAAO,CAAC,MAAM;gBACZ,CAAC,CAAC,OAAO,CAAC,GAAG;oBACX,CAAC,CAAC,mBAAmB;oBACrB,CAAC,CAAC,gBAAgB;gBACpB,CAAC,CAAC,OAAO,CAAC,GAAG;oBACb,CAAC,CAAC,aAAa;oBACf,CAAC,CAAC,UAAU,CACf,CAAC,CAAC,CAAC,CAAA;SACL;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE;YAC7C,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,eAAe,CAAA;SAC9D;aAAM,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE;YACzC,QAAQ,GAAG,WAAW,CAAA;SACvB;QAED,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;QAC5D,IAAI,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;YACtC,2CAA2C;YAC3C,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;SACxD;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK;YAAE,OAAO,IAAI,CAAC,MAAM,CAAA;QAE5D,mDAAmD;QACnD,4BAA4B;QAC5B,EAAE;QACF,wDAAwD;QACxD,yDAAyD;QACzD,2CAA2C;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QAEpB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;YACnB,OAAO,IAAI,CAAC,MAAM,CAAA;SACnB;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU;YAChC,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,OAAO,CAAC,GAAG;gBACb,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,YAAY,CAAA;QAChB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QAElD,kCAAkC;QAClC,kDAAkD;QAClD,sEAAsE;QACtE,iDAAiD;QACjD,8DAA8D;QAC9D,mCAAmC;QACnC,IAAI,EAAE,GAAG,GAAG;aACT,GAAG,CAAC,OAAO,CAAC,EAAE;YACb,MAAM,EAAE,GAAiC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBACvD,IAAI,CAAC,YAAY,MAAM,EAAE;oBACvB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;wBAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;iBAChD;gBACD,OAAO,OAAO,CAAC,KAAK,QAAQ;oBAC1B,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;oBACjB,CAAC,CAAC,CAAC,KAAK,QAAQ;wBAChB,CAAC,CAAC,QAAQ;wBACV,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;YACZ,CAAC,CAAiC,CAAA;YAClC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAClB,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;gBACtB,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;gBACtB,IAAI,CAAC,KAAK,QAAQ,IAAI,IAAI,KAAK,QAAQ,EAAE;oBACvC,OAAM;iBACP;gBACD,IAAI,IAAI,KAAK,SAAS,EAAE;oBACtB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,EAAE;wBAC3C,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;qBACjD;yBAAM;wBACL,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAA;qBAChB;iBACF;qBAAM,IAAI,IAAI,KAAK,SAAS,EAAE;oBAC7B,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAAA;iBAC9C;qBAAM,IAAI,IAAI,KAAK,QAAQ,EAAE;oBAC5B,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAA;oBACzD,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAA;iBACrB;YACH,CAAC,CAAC,CAAA;YACF,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACjD,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,CAAA;QAEZ,+DAA+D;QAC/D,mEAAmE;QACnE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAC9D,4BAA4B;QAC5B,gDAAgD;QAChD,EAAE,GAAG,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,CAAA;QAElC,gDAAgD;QAChD,IAAI,IAAI,CAAC,MAAM;YAAE,EAAE,GAAG,MAAM,GAAG,EAAE,GAAG,MAAM,CAAA;QAE1C,IAAI;YACF,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;YACjD,qBAAqB;SACtB;QAAC,OAAO,EAAE,EAAE;YACX,uBAAuB;YACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;SACpB;QACD,oBAAoB;QACpB,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,UAAU,CAAC,CAAS;QAClB,mDAAmD;QACnD,6DAA6D;QAC7D,8CAA8C;QAC9C,0CAA0C;QAC1C,IAAI,IAAI,CAAC,uBAAuB,EAAE;YAChC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;SACpB;aAAM,IAAI,IAAI,CAAC,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;YAClD,sCAAsC;YACtC,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;SAC/B;aAAM;YACL,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;SACtB;IACH,CAAC;IAED,KAAK,CAAC,CAAS,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO;QACrC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACpC,8CAA8C;QAC9C,iBAAiB;QACjB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAO,KAAK,CAAA;SACb;QACD,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,EAAE,CAAA;SAChB;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,EAAE;YACxB,OAAO,IAAI,CAAA;SACZ;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,gCAAgC;QAChC,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SAC5B;QAED,6CAA6C;QAC7C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;QAErC,0DAA0D;QAC1D,2DAA2D;QAC3D,mCAAmC;QACnC,uCAAuC;QAEvC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAEpC,0EAA0E;QAC1E,IAAI,QAAQ,GAAW,EAAE,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACxC,IAAI,CAAC,QAAQ,EAAE;YACb,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;gBACpD,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;aACjB;SACF;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;YACtB,IAAI,IAAI,GAAG,EAAE,CAAA;YACb,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC7C,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;aAClB;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YACjD,IAAI,GAAG,EAAE;gBACP,IAAI,OAAO,CAAC,UAAU,EAAE;oBACtB,OAAO,IAAI,CAAA;iBACZ;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;aACpB;SACF;QAED,2DAA2D;QAC3D,8BAA8B;QAC9B,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,OAAO,KAAK,CAAA;SACb;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AACD,qBAAqB;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,oBAAoB;AACpB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAA;AACnB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AACzB,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA","sourcesContent":["import expand from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport { AST, ExtglobType } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\ntype Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  nobrace?: boolean\n  nocomment?: boolean\n  nonegate?: boolean\n  debug?: boolean\n  noglobstar?: boolean\n  noext?: boolean\n  nonull?: boolean\n  windowsPathsNoEscape?: boolean\n  allowWindowsEscape?: boolean\n  partial?: boolean\n  dot?: boolean\n  nocase?: boolean\n  nocaseMagicOnly?: boolean\n  magicalBraces?: boolean\n  matchBase?: boolean\n  flipNegate?: boolean\n  preserveMultipleSlashes?: boolean\n  optimizationLevel?: number\n  platform?: Platform\n  windowsNoMagicRoot?: boolean\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {}\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?\\*\\[\\(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) => !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) => f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) => f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?\\*\\[\\(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process\n    ? (typeof process.env === 'object' &&\n        process.env &&\n        process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n      process.platform\n    : 'posix'\n) as Platform\ntype Sep = '\\\\' | '/'\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {}\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick = {}\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick = {}\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) => orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (list: string[], pattern: string, options: MinimatchOptions = {}) =>\n      orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {}\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern)\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {}\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options.allowWindowsEscape === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined\n        ? options.windowsNoMagicRoot\n        : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: any[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      this.debug = (...args: any[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn all ** into *\n    if (this.options.noglobstar) {\n      for (let i = 0; i < globParts.length; i++) {\n        for (let j = 0; j < globParts[i].length; j++) {\n          if (globParts[i][j] === '**') {\n            globParts[i][j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (p && p !== '.' && p !== '..' && p !== '**') {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(file: string[], pattern: ParseReturn[], partial: boolean = false) {\n    const options = this.options\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined\n      const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [file[fdi], pattern[pdi] as string]\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          if (pdi > fdi) {\n            pattern = pattern.slice(pdi)\n          } else if (fdi > pdi) {\n            file = file.slice(fdi)\n          }\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // dont' need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    this.debug('matchOne', this, { file, pattern })\n    this.debug('matchOne', file.length, pattern.length)\n\n    for (\n      var fi = 0, pi = 0, fl = file.length, pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      var p = pattern[pi]\n      var f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      if (p === GLOBSTAR) {\n        this.debug('GLOBSTAR', [pattern, p, f])\n\n        // \"**\"\n        // a/**/b/**/c would match the following:\n        // a/b/x/y/z/c\n        // a/x/y/z/b/c\n        // a/b/x/b/x/c\n        // a/b/c\n        // To do this, take the rest of the pattern after\n        // the **, and see if it would match the file remainder.\n        // If so, return success.\n        // If not, the ** \"swallows\" a segment, and try again.\n        // This is recursively awful.\n        //\n        // a/**/b/**/c matching a/b/x/y/z/c\n        // - a matches a\n        // - doublestar\n        //   - matchOne(b/x/y/z/c, b/**/c)\n        //     - b matches b\n        //     - doublestar\n        //       - matchOne(x/y/z/c, c) -> no\n        //       - matchOne(y/z/c, c) -> no\n        //       - matchOne(z/c, c) -> no\n        //       - matchOne(c, c) yes, hit\n        var fr = fi\n        var pr = pi + 1\n        if (pr === pl) {\n          this.debug('** at the end')\n          // a ** at the end will just swallow the rest.\n          // We have found a match.\n          // however, it will not swallow /.x, unless\n          // options.dot is set.\n          // . and .. are *never* matched by **, for explosively\n          // exponential reasons.\n          for (; fi < fl; fi++) {\n            if (\n              file[fi] === '.' ||\n              file[fi] === '..' ||\n              (!options.dot && file[fi].charAt(0) === '.')\n            )\n              return false\n          }\n          return true\n        }\n\n        // ok, let's see if we can swallow whatever we can.\n        while (fr < fl) {\n          var swallowee = file[fr]\n\n          this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n          // XXX remove this slice.  Just pass the start index.\n          if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n            this.debug('globstar found match!', fr, fl, swallowee)\n            // found a match.\n            return true\n          } else {\n            // can't swallow \".\" or \"..\" ever.\n            // can only swallow \".foo\" when explicitly asked.\n            if (\n              swallowee === '.' ||\n              swallowee === '..' ||\n              (!options.dot && swallowee.charAt(0) === '.')\n            ) {\n              this.debug('dot detected!', file, fr, pattern, pr)\n              break\n            }\n\n            // ** swallows a segment, and continue.\n            this.debug('globstar swallow a segment, and continue')\n            fr++\n          }\n        }\n\n        // no match was found.\n        // However, in partial mode, we can't say this is necessarily over.\n        /* c8 ignore start */\n        if (partial) {\n          // ran out of file\n          this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n          if (fr === fl) {\n            return true\n          }\n        }\n        /* c8 ignore stop */\n        return false\n      }\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase\n          ? options.dot\n            ? starDotExtTestNocaseDot\n            : starDotExtTestNocase\n          : options.dot\n          ? starDotExtTestDot\n          : starDotExtTest\n      )(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase\n          ? options.dot\n            ? qmarksTestNocaseDot\n            : qmarksTestNocase\n          : options.dot\n          ? qmarksTestDot\n          : qmarksTest\n      )(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar = options.noglobstar\n      ? star\n      : options.dot\n      ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return typeof p === 'string'\n            ? regExpEscape(p)\n            : p === GLOBSTAR\n            ? GLOBSTAR\n            : p._src\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        return pp.filter(p => p !== GLOBSTAR).join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch (ex) {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^\\/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (let i = 0; i < set.length; i++) {\n      const pattern = set[i]\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/package.json b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/package.json
new file mode 100644
index 0000000..3dbc1ca
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts.map
new file mode 100644
index 0000000..7ace070
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,MAChB,MAAM,8BAGN,KAAK,gBAAgB,EAAE,sBAAsB,CAAC,WAKlD,CAAA"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
new file mode 100644
index 0000000..0faf9a2
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
@@ -0,0 +1,20 @@
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link windowsPathsNoEscape} option is used, then square-brace
+ * escapes are removed, but not backslash escapes.  For example, it will turn
+ * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
+ * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both brace escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ */
+export const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
+    return windowsPathsNoEscape
+        ? s.replace(/\[([^\/\\])\]/g, '$1')
+        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
+};
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js.map b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js.map
new file mode 100644
index 0000000..eb146c2
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,MACsB,EAAE,EACtD,EAAE;IACF,OAAO,oBAAoB;QACzB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC;QACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAChF,CAAC,CAAA","sourcesContent":["import { MinimatchOptions } from './index.js'\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link windowsPathsNoEscape} option is used, then square-brace\n * escapes are removed, but not backslash escapes.  For example, it will turn\n * the string `'[*]'` into `*`, but it will not turn `'\\\\*'` into `'*'`,\n * becuase `\\` is a path separator in `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both brace escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n */\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n  }: Pick = {}\n) => {\n  return windowsPathsNoEscape\n    ? s.replace(/\\[([^\\/\\\\])\\]/g, '$1')\n    : s.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g, '$1$2').replace(/\\\\([^\\/])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/package.json b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/package.json
new file mode 100644
index 0000000..01fc48e
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/package.json
@@ -0,0 +1,82 @@
+{
+  "author": "Isaac Z. Schlueter  (http://blog.izs.me)",
+  "name": "minimatch",
+  "description": "a glob matcher in javascript",
+  "version": "9.0.5",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/minimatch.git"
+  },
+  "main": "./dist/commonjs/index.js",
+  "types": "./dist/commonjs/index.d.ts",
+  "exports": {
+    "./package.json": "./package.json",
+    ".": {
+      "import": {
+        "types": "./dist/esm/index.d.ts",
+        "default": "./dist/esm/index.js"
+      },
+      "require": {
+        "types": "./dist/commonjs/index.d.ts",
+        "default": "./dist/commonjs/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "prepare": "tshy",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "tap",
+    "snap": "tap",
+    "format": "prettier --write . --loglevel warn",
+    "benchmark": "node benchmark/index.js",
+    "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts"
+  },
+  "prettier": {
+    "semi": false,
+    "printWidth": 80,
+    "tabWidth": 2,
+    "useTabs": false,
+    "singleQuote": true,
+    "jsxSingleQuote": false,
+    "bracketSameLine": true,
+    "arrowParens": "avoid",
+    "endOfLine": "lf"
+  },
+  "engines": {
+    "node": ">=16 || 14 >=14.17"
+  },
+  "dependencies": {
+    "brace-expansion": "^2.0.1"
+  },
+  "devDependencies": {
+    "@types/brace-expansion": "^1.1.0",
+    "@types/node": "^18.15.11",
+    "@types/tap": "^15.0.8",
+    "eslint-config-prettier": "^8.6.0",
+    "mkdirp": "1",
+    "prettier": "^2.8.2",
+    "tap": "^18.7.2",
+    "ts-node": "^10.9.1",
+    "tshy": "^1.12.0",
+    "typedoc": "^0.23.21",
+    "typescript": "^4.9.3"
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/isaacs"
+  },
+  "license": "ISC",
+  "tshy": {
+    "exports": {
+      "./package.json": "./package.json",
+      ".": "./src/index.ts"
+    }
+  },
+  "type": "module"
+}
diff --git a/node_modules/@typescript-eslint/typescript-estree/package.json b/node_modules/@typescript-eslint/typescript-estree/package.json
new file mode 100644
index 0000000..cb05bcd
--- /dev/null
+++ b/node_modules/@typescript-eslint/typescript-estree/package.json
@@ -0,0 +1,90 @@
+{
+  "name": "@typescript-eslint/typescript-estree",
+  "version": "8.26.0",
+  "description": "A parser that converts TypeScript source code into an ESTree compatible form",
+  "files": [
+    "dist",
+    "!*.tsbuildinfo",
+    "_ts4.3",
+    "README.md",
+    "LICENSE"
+  ],
+  "type": "commonjs",
+  "exports": {
+    ".": {
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.js"
+    },
+    "./package.json": "./package.json",
+    "./use-at-your-own-risk": {
+      "types": "./dist/use-at-your-own-risk.d.ts",
+      "default": "./dist/use-at-your-own-risk.js"
+    }
+  },
+  "types": "./dist/index.d.ts",
+  "engines": {
+    "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/typescript-eslint/typescript-eslint.git",
+    "directory": "packages/typescript-estree"
+  },
+  "bugs": {
+    "url": "https://github.com/typescript-eslint/typescript-eslint/issues"
+  },
+  "homepage": "https://typescript-eslint.io/packages/typescript-estree",
+  "license": "MIT",
+  "keywords": [
+    "ast",
+    "estree",
+    "ecmascript",
+    "javascript",
+    "typescript",
+    "parser",
+    "syntax"
+  ],
+  "scripts": {
+    "build": "tsc -b tsconfig.build.json",
+    "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3",
+    "clean": "tsc -b tsconfig.build.json --clean",
+    "postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage",
+    "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
+    "lint": "npx nx lint",
+    "test": "jest --runInBand --verbose",
+    "check-types": "npx nx typecheck"
+  },
+  "dependencies": {
+    "@typescript-eslint/types": "8.26.0",
+    "@typescript-eslint/visitor-keys": "8.26.0",
+    "debug": "^4.3.4",
+    "fast-glob": "^3.3.2",
+    "is-glob": "^4.0.3",
+    "minimatch": "^9.0.4",
+    "semver": "^7.6.0",
+    "ts-api-utils": "^2.0.1"
+  },
+  "devDependencies": {
+    "@jest/types": "29.6.3",
+    "glob": "*",
+    "jest": "29.7.0",
+    "prettier": "^3.2.5",
+    "rimraf": "*",
+    "tmp": "*",
+    "typescript": "*"
+  },
+  "peerDependencies": {
+    "typescript": ">=4.8.4 <5.9.0"
+  },
+  "funding": {
+    "type": "opencollective",
+    "url": "https://opencollective.com/typescript-eslint"
+  },
+  "typesVersions": {
+    "<4.7": {
+      "*": [
+        "_ts4.3/*"
+      ]
+    }
+  }
+}
diff --git a/node_modules/@typescript-eslint/utils/LICENSE b/node_modules/@typescript-eslint/utils/LICENSE
new file mode 100644
index 0000000..a116410
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 typescript-eslint and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/@typescript-eslint/utils/README.md b/node_modules/@typescript-eslint/utils/README.md
new file mode 100644
index 0000000..7ba7500
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/README.md
@@ -0,0 +1,12 @@
+# `@typescript-eslint/utils`
+
+> Utilities for working with TypeScript + ESLint together.
+
+[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils)
+[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils)
+
+👉 See **https://typescript-eslint.io/packages/utils** for documentation on this package.
+
+> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code.
+
+
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map
new file mode 100644
index 0000000..b727886
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"PatternMatcher.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,CACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GACjD,MAAM,CAAC;IAEV;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAExD;;;;OAIG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAiC,KAC1D,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,KAC5B,cAAc,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.js
new file mode 100644
index 0000000..a31b5f5
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.js
@@ -0,0 +1,44 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PatternMatcher = void 0;
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+/**
+ * The class to find a pattern in strings as handling escape sequences.
+ * It ignores the found pattern if it's escaped with `\`.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class}
+ */
+exports.PatternMatcher = eslintUtils.PatternMatcher;
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map
new file mode 100644
index 0000000..20bac39
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ReferenceTracker.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/ReferenceTracker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,QAAA,MAAM,oBAAoB,EAAE,OAAO,MAA0C,CAAC;AAC9E,QAAA,MAAM,oBAAoB,EAAE,OAAO,MAA0C,CAAC;AAC9E,QAAA,MAAM,yBAAyB,EAAE,OAAO,MACA,CAAC;AACzC,QAAA,MAAM,mBAAmB,EAAE,OAAO,MAAyC,CAAC;AAE5E,UAAU,gBAAgB;IACxB;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,EACpB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAExD;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,EACpB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAExD;;;;;OAKG;IACH,uBAAuB,CAAC,CAAC,EACvB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;CACzD;AACD,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,IAAI,EAAE,OAAO,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,OAAO,yBAAyB,CAAC;IACrD,QAAQ,CAAC,GAAG,EAAE,OAAO,mBAAmB,CAAC;IAEzC,KACE,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,EACjC,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QACtC;;;;WAIG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;KAC5B,GACA,gBAAgB,CAAC;IAEpB,QAAQ,CAAC,IAAI,EAAE,OAAO,oBAAoB,CAAC;CAC5C;AAED,kBAAU,gBAAgB,CAAC;IACzB,KAAY,IAAI,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,KAAY,IAAI,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,KAAY,SAAS,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAC5D,KAAY,GAAG,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAChD,KAAY,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAEpD,KAAY,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,UAAiB,eAAe,CAAC,CAAC;QAChC,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC;QAC7B,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;KAC5B;IAED,UAAiB,cAAc,CAAC,CAAC,GAAG,GAAG;QACrC,IAAI,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,aAAa,CAAC;KACrB;CACF;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EACK,sBAAsB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.js
new file mode 100644
index 0000000..43c127d
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.js
@@ -0,0 +1,48 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ReferenceTracker = void 0;
+/* eslint-disable @typescript-eslint/no-namespace */
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+const ReferenceTrackerREAD = eslintUtils.ReferenceTracker.READ;
+const ReferenceTrackerCALL = eslintUtils.ReferenceTracker.CALL;
+const ReferenceTrackerCONSTRUCT = eslintUtils.ReferenceTracker.CONSTRUCT;
+const ReferenceTrackerESM = eslintUtils.ReferenceTracker.ESM;
+/**
+ * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class}
+ */
+exports.ReferenceTracker = eslintUtils.ReferenceTracker;
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.d.ts.map
new file mode 100644
index 0000000..fd71e3b
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"astUtilities.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/astUtilities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAA0C,CAC5E,IAAI,EACA,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,EAC/B,UAAU,EAAE,QAAQ,CAAC,UAAU,KAC5B,QAAQ,CAAC,cAAc,CAAC;AAE7B;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAA0C,CAC5E,IAAI,EACA,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,EAC/B,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,KAC7B,MAAM,CAAC;AAEZ;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAkC,CAC5D,IAAI,EACA,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,QAAQ,GACjB,QAAQ,CAAC,kBAAkB,EAC/B,YAAY,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,KAChC,MAAM,GAAG,IAAI,CAAC;AAEnB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,EAAiC,CAC1D,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,YAAY,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,KAChC;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAsC,CACpE,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,YAAY,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,KAChC,MAAM,GAAG,IAAI,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAgC,CACxD,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,UAAU,EAAE,QAAQ,CAAC,UAAU,EAC/B,OAAO,CAAC,EAAE;IACR,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C,KACE,OAAO,CAAC;AAEb,eAAO,MAAM,eAAe,EAAkC;IAC5D,CACE,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,UAAU,EAAE,QAAQ,CAAC,UAAU,GAC9B,OAAO,CAAC;IAEX;;;;;;;;OAQG;IACH,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,OAAO,CAAC;CACjE,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.js
new file mode 100644
index 0000000..29a0369
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.js
@@ -0,0 +1,101 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isParenthesized = exports.hasSideEffect = exports.getStringIfConstant = exports.getStaticValue = exports.getPropertyName = exports.getFunctionNameWithKind = exports.getFunctionHeadLocation = void 0;
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+/**
+ * Get the proper location of a given function node to report.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation}
+ */
+exports.getFunctionHeadLocation = eslintUtils.getFunctionHeadLocation;
+/**
+ * Get the name and kind of a given function node.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind}
+ */
+exports.getFunctionNameWithKind = eslintUtils.getFunctionNameWithKind;
+/**
+ * Get the property name of a given property node.
+ * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname}
+ * @returns The property name of the node. If the property name is not constant then it returns `null`.
+ */
+exports.getPropertyName = eslintUtils.getPropertyName;
+/**
+ * Get the value of a given node if it can decide the value statically.
+ * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
+ * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
+ * not been modified.
+ * For example, it considers `Symbol.iterator`, `Symbol.for('k')`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static, but `Symbol('k')` is not static.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue}
+ * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
+ * static value of the node, it returns `null`.
+ */
+exports.getStaticValue = eslintUtils.getStaticValue;
+/**
+ * Get the string value of a given node.
+ * This function is a tiny wrapper of the getStaticValue function.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant}
+ */
+exports.getStringIfConstant = eslintUtils.getStringIfConstant;
+/**
+ * Check whether a given node has any side effect or not.
+ * The side effect means that it may modify a certain variable or object member. This function considers the node which
+ * contains the following types as the node which has side effects:
+ * - `AssignmentExpression`
+ * - `AwaitExpression`
+ * - `CallExpression`
+ * - `ImportExpression`
+ * - `NewExpression`
+ * - `UnaryExpression([operator = "delete"])`
+ * - `UpdateExpression`
+ * - `YieldExpression`
+ * - When `options.considerGetters` is `true`:
+ *   - `MemberExpression`
+ * - When `options.considerImplicitTypeConversion` is `true`:
+ *   - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
+ *   - `MemberExpression([computed = true])`
+ *   - `MethodDefinition([computed = true])`
+ *   - `Property([computed = true])`
+ *   - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect}
+ */
+exports.hasSideEffect = eslintUtils.hasSideEffect;
+exports.isParenthesized = eslintUtils.isParenthesized;
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.d.ts.map
new file mode 100644
index 0000000..e6a6672
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.js
new file mode 100644
index 0000000..d2e9a64
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.js
@@ -0,0 +1,21 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./astUtilities"), exports);
+__exportStar(require("./PatternMatcher"), exports);
+__exportStar(require("./predicates"), exports);
+__exportStar(require("./ReferenceTracker"), exports);
+__exportStar(require("./scopeAnalysis"), exports);
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.d.ts.map
new file mode 100644
index 0000000..b02b493
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/predicates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,KAAK,uBAAuB,CAAC,aAAa,SAAS,QAAQ,CAAC,KAAK,IAAI,CACnE,KAAK,EAAE,QAAQ,CAAC,KAAK,KAClB,KAAK,IAAI,aAAa,CAAC;AAE5B,KAAK,0BAA0B,CAAC,aAAa,SAAS,QAAQ,CAAC,KAAK,IAAI,CACtE,KAAK,EAAE,QAAQ,CAAC,KAAK,KAClB,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAErD,KAAK,wBAAwB,CAAC,KAAK,SAAS,MAAM,IAAI;IACpD,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,QAAQ,CAAC,eAAe,CAAC;AAC7B,KAAK,kCAAkC,CAAC,KAAK,SAAS,MAAM,IAC1D,uBAAuB,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,KAAK,qCAAqC,CAAC,KAAK,SAAS,MAAM,IAC7D,0BAA0B,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAE9D,eAAO,MAAM,YAAY,EACK,kCAAkC,CAAC,IAAI,CAAC,CAAC;AACvE,eAAO,MAAM,eAAe,EACK,qCAAqC,CAAC,IAAI,CAAC,CAAC;AAE7E,eAAO,MAAM,mBAAmB,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AAC7E,eAAO,MAAM,sBAAsB,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC;AAEnF,eAAO,MAAM,qBAAqB,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AAC/E,eAAO,MAAM,wBAAwB,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC;AAErF,eAAO,MAAM,mBAAmB,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AAC7E,eAAO,MAAM,sBAAsB,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC;AAEnF,eAAO,MAAM,YAAY,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AACtE,eAAO,MAAM,eAAe,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC;AAE5E,eAAO,MAAM,YAAY,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AACtE,eAAO,MAAM,eAAe,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC;AAE5E,eAAO,MAAM,cAAc,EACK,uBAAuB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,EACK,0BAA0B,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAEhF,eAAO,MAAM,mBAAmB,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AAC7E,eAAO,MAAM,sBAAsB,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC;AAEnF,eAAO,MAAM,qBAAqB,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AAC/E,eAAO,MAAM,wBAAwB,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC;AAErF,eAAO,MAAM,mBAAmB,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AAC7E,eAAO,MAAM,sBAAsB,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC;AAEnF,eAAO,MAAM,gBAAgB,EACK,kCAAkC,CAAC,GAAG,CAAC,CAAC;AAC1E,eAAO,MAAM,mBAAmB,EACK,qCAAqC,CAAC,GAAG,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.js
new file mode 100644
index 0000000..6ca1279
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.js
@@ -0,0 +1,59 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isNotSemicolonToken = exports.isSemicolonToken = exports.isNotOpeningParenToken = exports.isOpeningParenToken = exports.isNotOpeningBracketToken = exports.isOpeningBracketToken = exports.isNotOpeningBraceToken = exports.isOpeningBraceToken = exports.isNotCommentToken = exports.isCommentToken = exports.isNotCommaToken = exports.isCommaToken = exports.isNotColonToken = exports.isColonToken = exports.isNotClosingParenToken = exports.isClosingParenToken = exports.isNotClosingBracketToken = exports.isClosingBracketToken = exports.isNotClosingBraceToken = exports.isClosingBraceToken = exports.isNotArrowToken = exports.isArrowToken = void 0;
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+exports.isArrowToken = eslintUtils.isArrowToken;
+exports.isNotArrowToken = eslintUtils.isNotArrowToken;
+exports.isClosingBraceToken = eslintUtils.isClosingBraceToken;
+exports.isNotClosingBraceToken = eslintUtils.isNotClosingBraceToken;
+exports.isClosingBracketToken = eslintUtils.isClosingBracketToken;
+exports.isNotClosingBracketToken = eslintUtils.isNotClosingBracketToken;
+exports.isClosingParenToken = eslintUtils.isClosingParenToken;
+exports.isNotClosingParenToken = eslintUtils.isNotClosingParenToken;
+exports.isColonToken = eslintUtils.isColonToken;
+exports.isNotColonToken = eslintUtils.isNotColonToken;
+exports.isCommaToken = eslintUtils.isCommaToken;
+exports.isNotCommaToken = eslintUtils.isNotCommaToken;
+exports.isCommentToken = eslintUtils.isCommentToken;
+exports.isNotCommentToken = eslintUtils.isNotCommentToken;
+exports.isOpeningBraceToken = eslintUtils.isOpeningBraceToken;
+exports.isNotOpeningBraceToken = eslintUtils.isNotOpeningBraceToken;
+exports.isOpeningBracketToken = eslintUtils.isOpeningBracketToken;
+exports.isNotOpeningBracketToken = eslintUtils.isNotOpeningBracketToken;
+exports.isOpeningParenToken = eslintUtils.isOpeningParenToken;
+exports.isNotOpeningParenToken = eslintUtils.isNotOpeningParenToken;
+exports.isSemicolonToken = eslintUtils.isSemicolonToken;
+exports.isNotSemicolonToken = eslintUtils.isNotSemicolonToken;
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map
new file mode 100644
index 0000000..40acf04
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"scopeAnalysis.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/scopeAnalysis.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAA+B,CACtD,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,EAClC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC,UAAU,KACrC,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAoC,CAChE,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,EAClC,IAAI,EAAE,QAAQ,CAAC,IAAI,KAChB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.js
new file mode 100644
index 0000000..5bc874e
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.js
@@ -0,0 +1,51 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getInnermostScope = exports.findVariable = void 0;
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+/**
+ * Get the variable of a given name.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
+ */
+exports.findVariable = eslintUtils.findVariable;
+/**
+ * Get the innermost scope which contains a given node.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#getinnermostscope}
+ * @returns The innermost scope which contains the given node.
+ * If such scope doesn't exist then it returns the 1st argument `initialScope`.
+ */
+exports.getInnermostScope = eslintUtils.getInnermostScope;
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts.map
new file mode 100644
index 0000000..f9dd879
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/ast-utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAO9E,eAAO,MAAM,YAAY,GACtB,QAAQ,SAAS,cAAc,EAAE,UAAU,QAAQ,MAElD,MAAM,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,KACrC,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAC3B,CAAC;AAE5B,eAAO,MAAM,aAAa,GACvB,SAAS,SAAS,SAAS,cAAc,EAAE,EAAE,WAAW,SAAS,MAEhE,MAAM,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,KACrC,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAE,CACpB,CAAC;AAE5C,eAAO,MAAM,0BAA0B,GACrC,QAAQ,SAAS,cAAc,EAC/B,aAAa,SAAS,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,EAChE,UAAU,SAAS,OAAO,CAAC,aAAa,CAAC,EAEzC,UAAU,QAAQ,EAClB,YAAY,UAAU,KACrB,CAAC,CACF,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,KACnC,IAAI,IAAI,UAAU,GAAG,aAAa,CAQtC,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,SAAS,SAAS,eAAe,EAGjC,cAAc,SAAS,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,EACnE,UAAU,SAAS,OAAO,CAAC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,EAEhE,WAAW,SAAS,EACpB,YAAY,UAAU,KACrB,CAAC,CACF,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,IAAI,GAAG,SAAS,KACrC,KAAK,IAAI,UAAU,GAAG,cAAc,CAUxC,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAEvC,SAAS,SAAS,eAAe,EACjC,cAAc,SAAS,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,EACnE,UAAU,SAAS,OAAO,CAAC,cAAc,CAAC,EAE1C,WAAW,SAAS,EACpB,YAAY,UAAU,KACrB,CAAC,CACF,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,IAAI,GAAG,SAAS,KACrC,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,CAAC,CAEN,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js
new file mode 100644
index 0000000..d1d7a8c
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isNotTokenOfTypeWithConditions = exports.isTokenOfTypeWithConditions = exports.isNodeOfTypeWithConditions = exports.isNodeOfTypes = exports.isNodeOfType = void 0;
+const isNodeOfType = (nodeType) => (node) => node?.type === nodeType;
+exports.isNodeOfType = isNodeOfType;
+const isNodeOfTypes = (nodeTypes) => (node) => !!node && nodeTypes.includes(node.type);
+exports.isNodeOfTypes = isNodeOfTypes;
+const isNodeOfTypeWithConditions = (nodeType, conditions) => {
+    const entries = Object.entries(conditions);
+    return (node) => node?.type === nodeType &&
+        entries.every(([key, value]) => node[key] === value);
+};
+exports.isNodeOfTypeWithConditions = isNodeOfTypeWithConditions;
+const isTokenOfTypeWithConditions = (tokenType, conditions) => {
+    const entries = Object.entries(conditions);
+    return (token) => token?.type === tokenType &&
+        entries.every(([key, value]) => token[key] === value);
+};
+exports.isTokenOfTypeWithConditions = isTokenOfTypeWithConditions;
+const isNotTokenOfTypeWithConditions = (tokenType, conditions) => (token) => !(0, exports.isTokenOfTypeWithConditions)(tokenType, conditions)(token);
+exports.isNotTokenOfTypeWithConditions = isNotTokenOfTypeWithConditions;
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/index.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/index.d.ts.map
new file mode 100644
index 0000000..c6f5e7f
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ast-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/index.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/index.js
new file mode 100644
index 0000000..5442939
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/index.js
@@ -0,0 +1,20 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./eslint-utils"), exports);
+__exportStar(require("./helpers"), exports);
+__exportStar(require("./misc"), exports);
+__exportStar(require("./predicates"), exports);
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.d.ts.map
new file mode 100644
index 0000000..ffd34d5
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/ast-utils/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,iBAAiB,QAA4B,CAAC;AAE3D;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,EACpC,KAAK,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,GACpC,OAAO,CAET"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.js
new file mode 100644
index 0000000..58b8223
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.LINEBREAK_MATCHER = void 0;
+exports.isTokenOnSameLine = isTokenOnSameLine;
+exports.LINEBREAK_MATCHER = /\r\n|[\r\n\u2028\u2029]/;
+/**
+ * Determines whether two adjacent tokens are on the same line
+ */
+function isTokenOnSameLine(left, right) {
+    return left.loc.end.line === right.loc.start.line;
+}
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts.map
new file mode 100644
index 0000000..04cd39c
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../src/ast-utils/predicates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAW7C,eAAO,MAAM,yBAAyB,UA6DzB,SAAW,KACxB;;4BA3DC,CAAC;AAEF,eAAO,MAAM,4BAA4B,UA8EZ,SAAU,KAAK,wWA3E3C,CAAC;AAEF,eAAO,MAAM,4BAA4B,UAmD5B,SAAW,KACxB;;4BAjDC,CAAC;AAEF,eAAO,MAAM,+BAA+B,UAoEf,SAAU,KAAK,wWAjE3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,SAEL,SAAU,IAAI;;2BAG7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,SARA,SAAU,IAAI,gGAW7C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,SAnCuC,SAC/D,IAAI,kFAqCG,CAAC;AAEZ,eAAO,MAAM,oBAAoB,SAjDvB,SAAU,IAAI,oOAmDvB,CAAC;AAOF,eAAO,MAAM,UAAU,SAjD4C,SAC/D,IAAI,oLAgD8C,CAAC;AAWvD,eAAO,MAAM,cAAc,SA5DwC,SAC/D,IAAI,iXA2DsD,CAAC;AAE/D,eAAO,MAAM,wBAAwB,SA9D8B,SAC/D,IAAI,wgBAgEG,CAAC;AAEZ,eAAO,MAAM,gBAAgB,SA5EnB,SAAU,IAAI,uDA4EmD,CAAC;AAE5E,eAAO,MAAM,mBAAmB,SA9EtB,SAAU,IAAI,0DAgFvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,SAzEkC,SAC/D,IAAI,2vBAuFG,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,aAAa,SA9EM,SAAU,IAAI,8MAiF7C,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,GAC9B,IAAI,IAAI;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GAAG,CAAC,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAO3E;AAED,eAAO,MAAM,YAAY,SAzHf,SAAU,IAAI,mDAyH2C,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,iBAAiB,SA9HpB,SAAU,IAAI,wDA8HqD,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,cAAc,UAvEd,SAAW,KACxB;;4BAyEC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,UA/Eb,SAAW,KACxB;;4BAiFC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,UAvFf,SAAW,KACxB;;yBAyFC,CAAC;AAEF,eAAO,MAAM,MAAM,SA/IgD,SAC/D,IAAI,+JAoJG,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.js b/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.js
new file mode 100644
index 0000000..7b86760
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.js
@@ -0,0 +1,108 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isLoop = exports.isImportKeyword = exports.isTypeKeyword = exports.isAwaitKeyword = exports.isAwaitExpression = exports.isIdentifier = exports.isConstructor = exports.isClassOrTypeElement = exports.isTSConstructorType = exports.isTSFunctionType = exports.isFunctionOrFunctionType = exports.isFunctionType = exports.isFunction = exports.isVariableDeclarator = exports.isTypeAssertion = exports.isLogicalOrOperator = exports.isOptionalCallExpression = exports.isNotNonNullAssertionPunctuator = exports.isNonNullAssertionPunctuator = exports.isNotOptionalChainPunctuator = exports.isOptionalChainPunctuator = void 0;
+exports.isSetter = isSetter;
+const ts_estree_1 = require("../ts-estree");
+const helpers_1 = require("./helpers");
+exports.isOptionalChainPunctuator = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: '?.' });
+exports.isNotOptionalChainPunctuator = (0, helpers_1.isNotTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: '?.' });
+exports.isNonNullAssertionPunctuator = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: '!' });
+exports.isNotNonNullAssertionPunctuator = (0, helpers_1.isNotTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: '!' });
+/**
+ * Returns true if and only if the node represents: foo?.() or foo.bar?.()
+ */
+exports.isOptionalCallExpression = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.CallExpression, 
+// this flag means the call expression itself is option
+// i.e. it is foo.bar?.() and not foo?.bar()
+{ optional: true });
+/**
+ * Returns true if and only if the node represents logical OR
+ */
+exports.isLogicalOrOperator = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.LogicalExpression, { operator: '||' });
+/**
+ * Checks if a node is a type assertion:
+ * ```
+ * x as foo
+ * x
+ * ```
+ */
+exports.isTypeAssertion = (0, helpers_1.isNodeOfTypes)([
+    ts_estree_1.AST_NODE_TYPES.TSAsExpression,
+    ts_estree_1.AST_NODE_TYPES.TSTypeAssertion,
+]);
+exports.isVariableDeclarator = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.VariableDeclarator);
+const functionTypes = [
+    ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression,
+    ts_estree_1.AST_NODE_TYPES.FunctionDeclaration,
+    ts_estree_1.AST_NODE_TYPES.FunctionExpression,
+];
+exports.isFunction = (0, helpers_1.isNodeOfTypes)(functionTypes);
+const functionTypeTypes = [
+    ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
+    ts_estree_1.AST_NODE_TYPES.TSConstructorType,
+    ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
+    ts_estree_1.AST_NODE_TYPES.TSDeclareFunction,
+    ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
+    ts_estree_1.AST_NODE_TYPES.TSFunctionType,
+    ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
+];
+exports.isFunctionType = (0, helpers_1.isNodeOfTypes)(functionTypeTypes);
+exports.isFunctionOrFunctionType = (0, helpers_1.isNodeOfTypes)([
+    ...functionTypes,
+    ...functionTypeTypes,
+]);
+exports.isTSFunctionType = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.TSFunctionType);
+exports.isTSConstructorType = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.TSConstructorType);
+exports.isClassOrTypeElement = (0, helpers_1.isNodeOfTypes)([
+    // ClassElement
+    ts_estree_1.AST_NODE_TYPES.PropertyDefinition,
+    ts_estree_1.AST_NODE_TYPES.FunctionExpression,
+    ts_estree_1.AST_NODE_TYPES.MethodDefinition,
+    ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition,
+    ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition,
+    ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
+    ts_estree_1.AST_NODE_TYPES.TSIndexSignature,
+    // TypeElement
+    ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
+    ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
+    // AST_NODE_TYPES.TSIndexSignature,
+    ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
+    ts_estree_1.AST_NODE_TYPES.TSPropertySignature,
+]);
+/**
+ * Checks if a node is a constructor method.
+ */
+exports.isConstructor = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.MethodDefinition, { kind: 'constructor' });
+/**
+ * Checks if a node is a setter method.
+ */
+function isSetter(node) {
+    return (!!node &&
+        (node.type === ts_estree_1.AST_NODE_TYPES.MethodDefinition ||
+            node.type === ts_estree_1.AST_NODE_TYPES.Property) &&
+        node.kind === 'set');
+}
+exports.isIdentifier = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.Identifier);
+/**
+ * Checks if a node represents an `await …` expression.
+ */
+exports.isAwaitExpression = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.AwaitExpression);
+/**
+ * Checks if a possible token is the `await` keyword.
+ */
+exports.isAwaitKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Identifier, { value: 'await' });
+/**
+ * Checks if a possible token is the `type` keyword.
+ */
+exports.isTypeKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Identifier, { value: 'type' });
+/**
+ * Checks if a possible token is the `import` keyword.
+ */
+exports.isImportKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Keyword, { value: 'import' });
+exports.isLoop = (0, helpers_1.isNodeOfTypes)([
+    ts_estree_1.AST_NODE_TYPES.DoWhileStatement,
+    ts_estree_1.AST_NODE_TYPES.ForStatement,
+    ts_estree_1.AST_NODE_TYPES.ForInStatement,
+    ts_estree_1.AST_NODE_TYPES.ForOfStatement,
+    ts_estree_1.AST_NODE_TYPES.WhileStatement,
+]);
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.d.ts.map b/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.d.ts.map
new file mode 100644
index 0000000..925db43
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"InferTypesFromRule.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/InferTypesFromRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,IACpC,CAAC,SAAS,UAAU,CAAC,MAAM,WAAW,EAAE,MAAM,OAAO,CAAC,GAClD,OAAO,GACP,CAAC,SAAS,kBAAkB,CAAC,MAAM,WAAW,EAAE,MAAM,OAAO,CAAC,GAC5D,OAAO,GACP,OAAO,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,2BAA2B,CAAC,CAAC,IACvC,CAAC,SAAS,UAAU,CAAC,MAAM,UAAU,EAAE,MAAM,SAAS,CAAC,GACnD,UAAU,GACV,CAAC,SAAS,kBAAkB,CAAC,MAAM,UAAU,EAAE,MAAM,SAAS,CAAC,GAC7D,UAAU,GACV,OAAO,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js b/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js
new file mode 100644
index 0000000..c8ad2e5
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts.map b/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts.map
new file mode 100644
index 0000000..69c927c
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"RuleCreator.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAK3B,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,CAC7B,UAAU,SAAS,MAAM,EACzB,UAAU,GAAG,OAAO,EACpB,OAAO,SAAS,SAAS,OAAO,EAAE,GAAG,EAAE,IACrC;IACF,IAAI,EAAE,UAAU,GAAG,gBAAgB,CAAC;CACrC,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;AAEhE,MAAM,WAAW,oBAAoB,CACnC,OAAO,SAAS,SAAS,OAAO,EAAE,EAClC,UAAU,SAAS,MAAM;IAEzB,MAAM,EAAE,CACN,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,EACnD,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,KAClC,YAAY,CAAC;IAClB,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,YAAY,CAC3B,OAAO,SAAS,SAAS,OAAO,EAAE,EAClC,UAAU,SAAS,MAAM,EACzB,IAAI,GAAG,OAAO,CACd,SAAQ,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC;IACjD,IAAI,EAAE,YAAY,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,mBAAmB,CAClC,OAAO,SAAS,SAAS,OAAO,EAAE,EAClC,UAAU,SAAS,MAAM,EACzB,IAAI,GAAG,OAAO,CACd,SAAQ,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC;IACjD,IAAI,EAAE,mBAAmB,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,UAAU,GAAG,OAAO,EAC9C,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,IAKtC,OAAO,SAAS,SAAS,OAAO,EAAE,EAClC,UAAU,SAAS,MAAM,EACzB,yBAIC,QAAQ,CACT,mBAAmB,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CACrD,KAAG,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,CAYhD;yBA1Be,WAAW;sBA0DzB,OAAO,SAAS,SAAS,OAAO,EAAE,EAClC,UAAU,SAAS,MAAM,QAEnB,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,KAChD,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC;;AAIlC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js b/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js
new file mode 100644
index 0000000..b4903e8
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js
@@ -0,0 +1,45 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.RuleCreator = RuleCreator;
+const applyDefault_1 = require("./applyDefault");
+/**
+ * Creates reusable function to create rules with default options and docs URLs.
+ *
+ * @param urlCreator Creates a documentation URL for a given rule name.
+ * @returns Function to create a rule with the docs URL format.
+ */
+function RuleCreator(urlCreator) {
+    // This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349
+    // TODO - when the above PR lands; add type checking for the context.report `data` property
+    return function createNamedRule({ meta, name, ...rule }) {
+        return createRule({
+            meta: {
+                ...meta,
+                docs: {
+                    ...meta.docs,
+                    url: urlCreator(name),
+                },
+            },
+            ...rule,
+        });
+    };
+}
+function createRule({ create, defaultOptions, meta, }) {
+    return {
+        create(context) {
+            const optionsWithDefault = (0, applyDefault_1.applyDefault)(defaultOptions, context.options);
+            return create(context, optionsWithDefault);
+        },
+        defaultOptions,
+        meta,
+    };
+}
+/**
+ * Creates a well-typed TSESLint custom ESLint rule without a docs URL.
+ *
+ * @returns Well-typed TSESLint custom ESLint rule.
+ * @remarks It is generally better to provide a docs URL function to RuleCreator.
+ */
+RuleCreator.withoutDocs = function withoutDocs(args) {
+    return createRule(args);
+};
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.d.ts.map b/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.d.ts.map
new file mode 100644
index 0000000..eac0569
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"applyDefault.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/applyDefault.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,SAAS,SAAS,OAAO,EAAE,EAC/B,OAAO,SAAS,IAAI,EAEpB,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,EACjC,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,GACjC,OAAO,CAwBT"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js b/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js
new file mode 100644
index 0000000..7f1b395
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.applyDefault = applyDefault;
+const deepMerge_1 = require("./deepMerge");
+/**
+ * Pure function - doesn't mutate either parameter!
+ * Uses the default options and overrides with the options provided by the user
+ * @param defaultOptions the defaults
+ * @param userOptions the user opts
+ * @returns the options with defaults
+ */
+function applyDefault(defaultOptions, userOptions) {
+    // clone defaults
+    const options = structuredClone(defaultOptions);
+    if (userOptions == null) {
+        return options;
+    }
+    // For avoiding the type error
+    //   `This expression is not callable. Type 'unknown' has no call signatures.ts(2349)`
+    options.forEach((opt, i) => {
+        // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish
+        if (userOptions[i] !== undefined) {
+            const userOpt = userOptions[i];
+            if ((0, deepMerge_1.isObjectNotArray)(userOpt) && (0, deepMerge_1.isObjectNotArray)(opt)) {
+                options[i] = (0, deepMerge_1.deepMerge)(opt, userOpt);
+            }
+            else {
+                options[i] = userOpt;
+            }
+        }
+    });
+    return options;
+}
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.d.ts.map b/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.d.ts.map
new file mode 100644
index 0000000..70f6e57
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAExD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,GAAE,UAAe,EACtB,MAAM,GAAE,UAAe,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA4BzB"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js b/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js
new file mode 100644
index 0000000..8101712
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js
@@ -0,0 +1,46 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isObjectNotArray = isObjectNotArray;
+exports.deepMerge = deepMerge;
+/**
+ * Check if the variable contains an object strictly rejecting arrays
+ * @returns `true` if obj is an object
+ */
+function isObjectNotArray(obj) {
+    return typeof obj === 'object' && obj != null && !Array.isArray(obj);
+}
+/**
+ * Pure function - doesn't mutate either parameter!
+ * Merges two objects together deeply, overwriting the properties in first with the properties in second
+ * @param first The first object
+ * @param second The second object
+ * @returns a new object
+ */
+function deepMerge(first = {}, second = {}) {
+    // get the unique set of keys across both objects
+    const keys = new Set([...Object.keys(first), ...Object.keys(second)]);
+    return Object.fromEntries([...keys].map(key => {
+        const firstHasKey = key in first;
+        const secondHasKey = key in second;
+        const firstValue = first[key];
+        const secondValue = second[key];
+        let value;
+        if (firstHasKey && secondHasKey) {
+            if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) {
+                // object type
+                value = deepMerge(firstValue, secondValue);
+            }
+            else {
+                // value type
+                value = secondValue;
+            }
+        }
+        else if (firstHasKey) {
+            value = firstValue;
+        }
+        else {
+            value = secondValue;
+        }
+        return [key, value];
+    }));
+}
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts.map b/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts.map
new file mode 100644
index 0000000..b206805
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"getParserServices.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,cAAc,EACd,iCAAiC,EAClC,MAAM,cAAc,CAAC;AAWtB;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,SAAS,OAAO,EAAE,EAElC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,GAC3D,iCAAiC,CAAC;AACrC;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,SAAS,OAAO,EAAE,EAElC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,EAC5D,+BAA+B,EAAE,KAAK,GACrC,iCAAiC,CAAC;AACrC;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,SAAS,OAAO,EAAE,EAElC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,EAC5D,+BAA+B,EAAE,IAAI,GACpC,cAAc,CAAC;AAClB;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,SAAS,OAAO,EAAE,EAElC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,EAC5D,+BAA+B,EAAE,OAAO,GACvC,cAAc,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js b/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js
new file mode 100644
index 0000000..bd0f76b
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js
@@ -0,0 +1,39 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getParserServices = getParserServices;
+const parserSeemsToBeTSESLint_1 = require("./parserSeemsToBeTSESLint");
+const ERROR_MESSAGE_REQUIRES_PARSER_SERVICES = "You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://typescript-eslint.io/getting-started/typed-linting for enabling linting with type information.";
+const ERROR_MESSAGE_UNKNOWN_PARSER = 'Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.';
+function getParserServices(context, allowWithoutFullTypeInformation = false) {
+    const parser = context.parserPath || context.languageOptions.parser?.meta?.name;
+    // This check is unnecessary if the user is using the latest version of our parser.
+    //
+    // However the world isn't perfect:
+    // - Users often use old parser versions.
+    //   Old versions of the parser would not return any parserServices unless parserOptions.project was set.
+    // - Users sometimes use parsers that aren't @typescript-eslint/parser
+    //   Other parsers won't return the parser services we expect (if they return any at all).
+    //
+    // This check allows us to handle bad user setups whilst providing a nice user-facing
+    // error message explaining the problem.
+    if (context.sourceCode.parserServices?.esTreeNodeToTSNodeMap == null ||
+        context.sourceCode.parserServices.tsNodeToESTreeNodeMap == null) {
+        throwError(parser);
+    }
+    // if a rule requires full type information, then hard fail if it doesn't exist
+    // this forces the user to supply parserOptions.project
+    if (context.sourceCode.parserServices.program == null &&
+        !allowWithoutFullTypeInformation) {
+        throwError(parser);
+    }
+    return context.sourceCode.parserServices;
+}
+/* eslint-enable @typescript-eslint/unified-signatures */
+function throwError(parser) {
+    const messages = [
+        ERROR_MESSAGE_REQUIRES_PARSER_SERVICES,
+        `Parser: ${parser || '(unknown)'}`,
+        !(0, parserSeemsToBeTSESLint_1.parserSeemsToBeTSESLint)(parser) && ERROR_MESSAGE_UNKNOWN_PARSER,
+    ].filter(Boolean);
+    throw new Error(messages.join('\n'));
+}
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.d.ts.map b/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.d.ts.map
new file mode 100644
index 0000000..d5c1331
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js b/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js
new file mode 100644
index 0000000..c07bc84
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js
@@ -0,0 +1,22 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./applyDefault"), exports);
+__exportStar(require("./deepMerge"), exports);
+__exportStar(require("./getParserServices"), exports);
+__exportStar(require("./InferTypesFromRule"), exports);
+__exportStar(require("./nullThrows"), exports);
+__exportStar(require("./RuleCreator"), exports);
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.d.ts.map b/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.d.ts.map
new file mode 100644
index 0000000..0da9e62
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"nullThrows.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/nullThrows.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;mCAEN,MAAM,SAAS,MAAM;CAEnC,CAAC;AAEX;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAMvE"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js b/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js
new file mode 100644
index 0000000..89e9382
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NullThrowsReasons = void 0;
+exports.nullThrows = nullThrows;
+/**
+ * A set of common reasons for calling nullThrows
+ */
+exports.NullThrowsReasons = {
+    MissingParent: 'Expected node to have a parent.',
+    MissingToken: (token, thing) => `Expected to find a ${token} for the ${thing}.`,
+};
+/**
+ * Assert that a value must not be null or undefined.
+ * This is a nice explicit alternative to the non-null assertion operator.
+ */
+function nullThrows(value, message) {
+    if (value == null) {
+        throw new Error(`Non-null Assertion Failed: ${message}`);
+    }
+    return value;
+}
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.d.ts.map b/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.d.ts.map
new file mode 100644
index 0000000..57c6222
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"parserSeemsToBeTSESLint.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/parserSeemsToBeTSESLint.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE3E"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js b/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js
new file mode 100644
index 0000000..c976b6c
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.parserSeemsToBeTSESLint = parserSeemsToBeTSESLint;
+function parserSeemsToBeTSESLint(parser) {
+    return !!parser && /(?:typescript-eslint|\.\.)[\w/\\]*parser/.test(parser);
+}
diff --git a/node_modules/@typescript-eslint/utils/dist/index.d.ts.map b/node_modules/@typescript-eslint/utils/dist/index.d.ts.map
new file mode 100644
index 0000000..107a73c
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/index.js b/node_modules/@typescript-eslint/utils/dist/index.js
new file mode 100644
index 0000000..8008ec2
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/index.js
@@ -0,0 +1,45 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TSUtils = exports.TSESLint = exports.JSONSchema = exports.ESLintUtils = exports.ASTUtils = void 0;
+exports.ASTUtils = __importStar(require("./ast-utils"));
+exports.ESLintUtils = __importStar(require("./eslint-utils"));
+exports.JSONSchema = __importStar(require("./json-schema"));
+exports.TSESLint = __importStar(require("./ts-eslint"));
+__exportStar(require("./ts-estree"), exports);
+exports.TSUtils = __importStar(require("./ts-utils"));
diff --git a/node_modules/@typescript-eslint/utils/dist/json-schema.d.ts.map b/node_modules/@typescript-eslint/utils/dist/json-schema.d.ts.map
new file mode 100644
index 0000000..7e85351
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/json-schema.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/json-schema.js b/node_modules/@typescript-eslint/utils/dist/json-schema.js
new file mode 100644
index 0000000..2a79849
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/json-schema.js
@@ -0,0 +1,8 @@
+"use strict";
+/**
+ * This is a fork of https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13f63c2eb8d7479caf01ab8d72f9e3683368a8f5/types/json-schema/index.d.ts
+ * We intentionally fork this because:
+ * - ESLint ***ONLY*** supports JSONSchema v4
+ * - We want to provide stricter types
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.d.ts.map
new file mode 100644
index 0000000..d62fd00
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"AST.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/AST.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE9D,kBAAU,GAAG,CAAC;IACZ,KAAY,SAAS,GAAG,eAAe,CAAC;IAExC,KAAY,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEnC,KAAY,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;IAErD,KAAY,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;CACpC;AAED,YAAY,EAAE,GAAG,EAAE,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.js
new file mode 100644
index 0000000..d89703d
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.js
@@ -0,0 +1,3 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace, no-restricted-syntax */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts.map
new file mode 100644
index 0000000..375230b
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Config.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.js
new file mode 100644
index 0000000..8e47a1b
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.js
@@ -0,0 +1,3 @@
+"use strict";
+/* eslint-disable  @typescript-eslint/consistent-indexed-object-style,  @typescript-eslint/no-namespace */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.d.ts.map
new file mode 100644
index 0000000..097c99f
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ESLint.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/ESLint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO;AAEL;;GAEG;AACH,YAAY,GACb,MAAM,uBAAuB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js
new file mode 100644
index 0000000..566f690
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js
@@ -0,0 +1,13 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.LegacyESLint = exports.ESLint = exports.FlatESLint = void 0;
+var FlatESLint_1 = require("./eslint/FlatESLint");
+Object.defineProperty(exports, "FlatESLint", { enumerable: true, get: function () { return FlatESLint_1.FlatESLint; } });
+var FlatESLint_2 = require("./eslint/FlatESLint");
+Object.defineProperty(exports, "ESLint", { enumerable: true, get: function () { return FlatESLint_2.FlatESLint; } });
+var LegacyESLint_1 = require("./eslint/LegacyESLint");
+// TODO(eslint@v10) - remove this in the next major
+/**
+ * @deprecated - use ESLint instead
+ */
+Object.defineProperty(exports, "LegacyESLint", { enumerable: true, get: function () { return LegacyESLint_1.LegacyESLint; } });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.d.ts.map
new file mode 100644
index 0000000..c515393
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"Linter.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.js
new file mode 100644
index 0000000..7fe7076
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.js
@@ -0,0 +1,13 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace, no-restricted-syntax */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Linter = void 0;
+const eslint_1 = require("eslint");
+/**
+ * The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it
+ * simply parses and reports on the code. In particular, the Linter object does not process configuration objects
+ * or files.
+ */
+class Linter extends eslint_1.Linter {
+}
+exports.Linter = Linter;
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.d.ts.map
new file mode 100644
index 0000000..bb35658
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"Parser.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,yBAAiB,MAAM,CAAC;IACtB,UAAiB,UAAU;QACzB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED;;;;;;OAMG;IACH,KAAY,iBAAiB,GACzB;QACE;;WAEG;QACH,IAAI,CAAC,EAAE;aAAG,CAAC,IAAI,MAAM,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS;SAAE,CAAC;QAC/D;;WAEG;QACH,cAAc,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,OAAO,GAChB;aAEA,CAAC,IAAI,MAAM,WAAW,GAAG,OAAO;SAClC,CAAC;KACH,GACD;QACE;;WAEG;QACH,IAAI,CAAC,EAAE;aAAG,CAAC,IAAI,MAAM,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS;SAAE,CAAC;QAC/D;;WAEG;QACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;KACjD,CAAC;IAEN,KAAY,YAAY,GACpB;QACE;;WAEG;QACH,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB;;WAEG;QACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,WAAW,CAAC;KACpE,GACD;QACE;;WAEG;QACH,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB;;WAEG;QACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;KAChE,CAAC;IAEN,UAAiB,WAAW;QAC1B;;WAEG;QACH,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC;QACtB;;;;WAIG;QACH,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;QAClC;;;;WAIG;QACH,QAAQ,CAAC,EAAE,cAAc,CAAC;QAC1B;;;;;WAKG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC;KAC3B;IAGD,UAAiB,WAAW;QAC1B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;KACvC;CACF"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.js
new file mode 100644
index 0000000..0d0ae6b
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.js
@@ -0,0 +1,3 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.d.ts.map
new file mode 100644
index 0000000..9c8b324
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ParserOptions.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/ParserOptions.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,GACX,MAAM,0BAA0B,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.js
new file mode 100644
index 0000000..c8ad2e5
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.d.ts.map
new file mode 100644
index 0000000..3e4ccd1
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"Processor.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Processor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,yBAAiB,SAAS,CAAC;IACzB,UAAiB,aAAa;QAC5B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,KAAY,UAAU,GAAG,CACvB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,CAAC,MAAM,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAErD,KAAY,WAAW,GAAG,CACxB,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,EACpC,QAAQ,EAAE,MAAM,KACb,MAAM,CAAC,WAAW,EAAE,CAAC;IAE1B,UAAiB,eAAe;QAC9B;;WAEG;QACH,IAAI,CAAC,EAAE,aAAa,CAAC;QAErB;;WAEG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC;QAE1B;;WAEG;QACH,UAAU,CAAC,EAAE,UAAU,CAAC;QAExB;;WAEG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B;IAED;;;;;;OAMG;IACH,UAAiB,oBAAoB;QACnC;;WAEG;QACH,IAAI,CAAC,EAAE;aAAG,CAAC,IAAI,MAAM,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS;SAAE,CAAC;QAErE;;WAEG;QAMH,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,GAAG,CAAC;QAE3D;;WAEG;QAMH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,GAAG,CAAC;QAErD;;WAEG;QACH,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KACvC;CACF"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.js
new file mode 100644
index 0000000..0d0ae6b
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.js
@@ -0,0 +1,3 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts.map
new file mode 100644
index 0000000..ffcb9c8
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Rule.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.js
new file mode 100644
index 0000000..c8ad2e5
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.d.ts.map
new file mode 100644
index 0000000..39d7239
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"RuleTester.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/RuleTester.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.js
new file mode 100644
index 0000000..4ae6f2f
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.RuleTester = void 0;
+/* eslint-disable @typescript-eslint/no-deprecated */
+const eslint_1 = require("eslint");
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+class RuleTester extends eslint_1.RuleTester {
+}
+exports.RuleTester = RuleTester;
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.d.ts.map
new file mode 100644
index 0000000..1bc3d62
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Scope.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,YAAY,MAAM,kCAAkC,CAAC;AAEjE,yBAAiB,KAAK,CAAC;IACrB,KAAY,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC;IACrD,KAAY,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;IAC/C,KAAY,QAAQ,GAAG,YAAY,CAAC,aAAa,CAAC;IAClD,KAAY,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;IAChC,MAAM,SAAS,+BAAyB,CAAC;IAEhD,KAAY,cAAc,GAAG,YAAY,CAAC,UAAU,CAAC;IACrD,KAAY,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;IAC1C,MAAM,cAAc,oCAA8B,CAAC;IAE1D,UAAiB,WAAW,CAAC;QAC3B,KAAY,qBAAqB,GAAG,YAAY,CAAC,qBAAqB,CAAC;QACvE,KAAY,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,CAAC;QACnE,KAAY,sBAAsB,GAAG,YAAY,CAAC,sBAAsB,CAAC;QACzE,KAAY,gCAAgC,GAC1C,YAAY,CAAC,gCAAgC,CAAC;QAChD,KAAY,uBAAuB,GAAG,YAAY,CAAC,uBAAuB,CAAC;QAC3E,KAAY,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,CAAC;QACnE,KAAY,sBAAsB,GAAG,YAAY,CAAC,sBAAsB,CAAC;QACzE,KAAY,oBAAoB,GAAG,YAAY,CAAC,oBAAoB,CAAC;QACrE,KAAY,sBAAsB,GAAG,YAAY,CAAC,sBAAsB,CAAC;QACzE,KAAY,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;QACzD,KAAY,kBAAkB,GAAG,YAAY,CAAC,kBAAkB,CAAC;KAClE;IACD,UAAiB,MAAM,CAAC;QACtB,KAAY,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;QACjD,KAAY,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;QACjD,KAAY,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;QACjD,KAAY,oBAAoB,GAAG,YAAY,CAAC,oBAAoB,CAAC;QACrE,KAAY,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;QAC7C,KAAY,2BAA2B,GACrC,YAAY,CAAC,2BAA2B,CAAC;QAC3C,KAAY,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;QACvD,KAAY,iBAAiB,GAAG,YAAY,CAAC,iBAAiB,CAAC;QAC/D,KAAY,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QACnD,KAAY,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC;QAC3D,KAAY,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QACnD,KAAY,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QACnD,KAAY,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QACnD,KAAY,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;QACvD,KAAY,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;QAC/C,KAAY,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;KAChD;CACF"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.js
new file mode 100644
index 0000000..f87449c
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.js
@@ -0,0 +1,43 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace */
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Scope = void 0;
+const scopeManager = __importStar(require("@typescript-eslint/scope-manager"));
+var Scope;
+(function (Scope) {
+    Scope.ScopeType = scopeManager.ScopeType;
+    Scope.DefinitionType = scopeManager.DefinitionType;
+})(Scope || (exports.Scope = Scope = {}));
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts.map
new file mode 100644
index 0000000..0bd7b58
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"SourceCode.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/SourceCode.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.js
new file mode 100644
index 0000000..a776954
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.js
@@ -0,0 +1,8 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace, no-restricted-syntax */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SourceCode = void 0;
+const eslint_1 = require("eslint");
+class SourceCode extends eslint_1.SourceCode {
+}
+exports.SourceCode = SourceCode;
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.d.ts.map
new file mode 100644
index 0000000..d9678ca
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ESLintShared.d.ts","sourceRoot":"","sources":["../../../src/ts-eslint/eslint/ESLintShared.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.js
new file mode 100644
index 0000000..c8ad2e5
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.d.ts.map
new file mode 100644
index 0000000..3afc310
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"FlatESLint.d.ts","sourceRoot":"","sources":["../../../src/ts-eslint/eslint/FlatESLint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAG9C,OAAO,OAAO,cAAe,SAAQ,MAAM,CAAC,UAAU,CACpD,UAAU,CAAC,WAAW,EACtB,UAAU,CAAC,aAAa,CACzB;IACC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAEnC;;;;;;OAMG;IACH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;IAEzE;;;;OAIG;IACH,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAC9C;+BAQoD,OAAO,cAAc;AAN1E;;;;;GAKG;AACH,qBAAa,UAAW,SAAQ,eAA2C;CAAG;AAC9E,yBAAiB,UAAU,CAAC;IAC1B,UAAiB,aACf,SAAQ,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC;QACpD;;;WAGG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACjC;;;;;WAKG;QACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QACtC;;;;WAIG;QACH,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB;;;;WAIG;QACH,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB;;;WAGG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB;IACD,KAAY,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IAC3D,KAAY,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACvC,KAAY,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACzC,KAAY,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAC7C,KAAY,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC3C,KAAY,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACzC,KAAY,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IACvD,KAAY,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IAC3D,KAAY,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACzD,KAAY,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACzD,KAAY,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IACrD,KAAY,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;IACjE,KAAY,UAAU,GAAG,CAAC,IAAI,EAAE;QAC9B,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,OAAO,CAAC;CACf"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.js
new file mode 100644
index 0000000..37f84a2
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.js
@@ -0,0 +1,14 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.FlatESLint = void 0;
+/* eslint-disable @typescript-eslint/no-namespace */
+const use_at_your_own_risk_1 = require("eslint/use-at-your-own-risk");
+/**
+ * The ESLint class is the primary class to use in Node.js applications.
+ * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
+ *
+ * If you want to lint code on browsers, use the Linter class instead.
+ */
+class FlatESLint extends use_at_your_own_risk_1.FlatESLint {
+}
+exports.FlatESLint = FlatESLint;
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.d.ts.map
new file mode 100644
index 0000000..e798f27
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"LegacyESLint.d.ts","sourceRoot":"","sources":["../../../src/ts-eslint/eslint/LegacyESLint.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAG9C,OAAO,OAAO,gBAAiB,SAAQ,MAAM,CAAC,UAAU,CACtD,aAAa,CAAC,MAAM,EACpB,YAAY,CAAC,aAAa,CAC3B;IACC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACxC;iCAQwD,OAAO,gBAAgB;AANhF;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,iBAA+C;CAAG;AACpF,yBAAiB,YAAY,CAAC;IAC5B,UAAiB,aACf,SAAQ,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC;QAClD;;;;;;;WAOG;QACH,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAC7B;;;WAGG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB;;;WAGG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB;;;WAGG;QACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC;;;WAGG;QACH,6BAA6B,CAAC,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7D;;;;;WAKG;QACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzC;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB;;;WAGG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB;IACD,KAAY,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IAC3D,KAAY,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACvC,KAAY,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACzC,KAAY,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAC7C,KAAY,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC1D,KAAY,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IACrD,KAAY,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;CAClE"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.js
new file mode 100644
index 0000000..f40012b
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.js
@@ -0,0 +1,14 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.LegacyESLint = void 0;
+const use_at_your_own_risk_1 = require("eslint/use-at-your-own-risk");
+/**
+ * The ESLint class is the primary class to use in Node.js applications.
+ * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
+ *
+ * If you want to lint code on browsers, use the Linter class instead.
+ */
+class LegacyESLint extends use_at_your_own_risk_1.LegacyESLint {
+}
+exports.LegacyESLint = LegacyESLint;
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.d.ts.map
new file mode 100644
index 0000000..31ec426
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.js b/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.js
new file mode 100644
index 0000000..7ee906e
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.js
@@ -0,0 +1,27 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./AST"), exports);
+__exportStar(require("./Config"), exports);
+__exportStar(require("./ESLint"), exports);
+__exportStar(require("./Linter"), exports);
+__exportStar(require("./Parser"), exports);
+__exportStar(require("./ParserOptions"), exports);
+__exportStar(require("./Processor"), exports);
+__exportStar(require("./Rule"), exports);
+__exportStar(require("./RuleTester"), exports);
+__exportStar(require("./Scope"), exports);
+__exportStar(require("./SourceCode"), exports);
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-estree.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-estree.d.ts.map
new file mode 100644
index 0000000..3a7063c
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-estree.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ts-estree.d.ts","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,GACT,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,cAAc,EACd,oCAAoC,EACpC,iCAAiC,GAClC,MAAM,sCAAsC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-estree.js b/node_modules/@typescript-eslint/utils/dist/ts-estree.js
new file mode 100644
index 0000000..b5843b3
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-estree.js
@@ -0,0 +1,9 @@
+"use strict";
+// for convenience's sake - export the types directly from here so consumers
+// don't need to reference/install both packages in their code
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TSESTree = exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0;
+var types_1 = require("@typescript-eslint/types");
+Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return types_1.AST_NODE_TYPES; } });
+Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return types_1.AST_TOKEN_TYPES; } });
+Object.defineProperty(exports, "TSESTree", { enumerable: true, get: function () { return types_1.TSESTree; } });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.d.ts.map
new file mode 100644
index 0000000..44bb4ef
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"NoInfer.d.ts","sourceRoot":"","sources":["../../src/ts-utils/NoInfer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.js b/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.js
new file mode 100644
index 0000000..c8ad2e5
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-utils/index.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-utils/index.d.ts.map
new file mode 100644
index 0000000..d1bbe75
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-utils/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-utils/index.js b/node_modules/@typescript-eslint/utils/dist/ts-utils/index.js
new file mode 100644
index 0000000..aa68bbb
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-utils/index.js
@@ -0,0 +1,18 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./isArray"), exports);
+__exportStar(require("./NoInfer"), exports);
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.d.ts.map b/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.d.ts.map
new file mode 100644
index 0000000..55264f2
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"isArray.d.ts","sourceRoot":"","sources":["../../src/ts-utils/isArray.ts"],"names":[],"mappings":"AACA,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,SAAS,OAAO,EAAE,CAE/D"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.js b/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.js
new file mode 100644
index 0000000..7deedcf
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.js
@@ -0,0 +1,7 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isArray = isArray;
+// https://github.com/microsoft/TypeScript/issues/17002
+function isArray(arg) {
+    return Array.isArray(arg);
+}
diff --git a/node_modules/@typescript-eslint/utils/package.json b/node_modules/@typescript-eslint/utils/package.json
new file mode 100644
index 0000000..1c33b52
--- /dev/null
+++ b/node_modules/@typescript-eslint/utils/package.json
@@ -0,0 +1,94 @@
+{
+  "name": "@typescript-eslint/utils",
+  "version": "8.26.0",
+  "description": "Utilities for working with TypeScript + ESLint together",
+  "files": [
+    "dist",
+    "!*.tsbuildinfo",
+    "_ts4.3",
+    "package.json",
+    "README.md",
+    "LICENSE"
+  ],
+  "type": "commonjs",
+  "exports": {
+    ".": {
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.js"
+    },
+    "./ast-utils": {
+      "types": "./dist/ast-utils/index.d.ts",
+      "default": "./dist/ast-utils/index.js"
+    },
+    "./eslint-utils": {
+      "types": "./dist/eslint-utils/index.d.ts",
+      "default": "./dist/eslint-utils/index.js"
+    },
+    "./json-schema": {
+      "types": "./dist/json-schema.d.ts",
+      "default": "./dist/json-schema.js"
+    },
+    "./ts-eslint": {
+      "types": "./dist/ts-eslint/index.d.ts",
+      "default": "./dist/ts-eslint/index.js"
+    },
+    "./package.json": "./package.json"
+  },
+  "types": "./dist/index.d.ts",
+  "engines": {
+    "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/typescript-eslint/typescript-eslint.git",
+    "directory": "packages/utils"
+  },
+  "bugs": {
+    "url": "https://github.com/typescript-eslint/typescript-eslint/issues"
+  },
+  "homepage": "https://typescript-eslint.io/packages/utils",
+  "license": "MIT",
+  "keywords": [
+    "eslint",
+    "typescript",
+    "estree"
+  ],
+  "scripts": {
+    "build": "tsc -b tsconfig.build.json",
+    "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3",
+    "clean": "tsc -b tsconfig.build.json --clean",
+    "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage",
+    "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
+    "lint": "npx nx lint",
+    "test": "jest",
+    "check-types": "npx nx typecheck"
+  },
+  "dependencies": {
+    "@eslint-community/eslint-utils": "^4.4.0",
+    "@typescript-eslint/scope-manager": "8.26.0",
+    "@typescript-eslint/types": "8.26.0",
+    "@typescript-eslint/typescript-estree": "8.26.0"
+  },
+  "peerDependencies": {
+    "eslint": "^8.57.0 || ^9.0.0",
+    "typescript": ">=4.8.4 <5.9.0"
+  },
+  "devDependencies": {
+    "downlevel-dts": "*",
+    "jest": "29.7.0",
+    "prettier": "^3.2.5",
+    "rimraf": "*",
+    "typescript": "*"
+  },
+  "funding": {
+    "type": "opencollective",
+    "url": "https://opencollective.com/typescript-eslint"
+  },
+  "typesVersions": {
+    "<4.7": {
+      "*": [
+        "_ts4.3/*"
+      ]
+    }
+  }
+}
diff --git a/node_modules/@typescript-eslint/visitor-keys/LICENSE b/node_modules/@typescript-eslint/visitor-keys/LICENSE
new file mode 100644
index 0000000..a116410
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 typescript-eslint and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/@typescript-eslint/visitor-keys/README.md b/node_modules/@typescript-eslint/visitor-keys/README.md
new file mode 100644
index 0000000..1745172
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/README.md
@@ -0,0 +1,10 @@
+# `@typescript-eslint/visitor-keys`
+
+> Visitor keys used to help traverse the TypeScript-ESTree AST.
+
+## ✋ Internal Package
+
+This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint).
+You likely don't want to use it directly.
+
+👉 See **https://typescript-eslint.io** for docs on typescript-eslint.
diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts.map b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts.map
new file mode 100644
index 0000000..8fdba2a
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"get-keys.d.ts","sourceRoot":"","sources":["../src/get-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,eAAO,MAAM,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,KAAK,SAAS,MAAM,EAC7C,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js
new file mode 100644
index 0000000..58c14a5
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js
@@ -0,0 +1,5 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getKeys = void 0;
+const eslint_visitor_keys_1 = require("eslint-visitor-keys");
+exports.getKeys = eslint_visitor_keys_1.getKeys;
diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts.map b/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts.map
new file mode 100644
index 0000000..d903176
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/index.js b/node_modules/@typescript-eslint/visitor-keys/dist/index.js
new file mode 100644
index 0000000..b86a328
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/dist/index.js
@@ -0,0 +1,7 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.visitorKeys = exports.getKeys = void 0;
+var get_keys_1 = require("./get-keys");
+Object.defineProperty(exports, "getKeys", { enumerable: true, get: function () { return get_keys_1.getKeys; } });
+var visitor_keys_1 = require("./visitor-keys");
+Object.defineProperty(exports, "visitorKeys", { enumerable: true, get: function () { return visitor_keys_1.visitorKeys; } });
diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map
new file mode 100644
index 0000000..33cd684
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"visitor-keys.d.ts","sourceRoot":"","sources":["../src/visitor-keys.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;AA0QxE,eAAO,MAAM,WAAW,EAAE,WACmB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js
new file mode 100644
index 0000000..b09fde6
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js
@@ -0,0 +1,194 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.visitorKeys = void 0;
+const eslintVisitorKeys = __importStar(require("eslint-visitor-keys"));
+/*
+ ********************************** IMPORTANT NOTE ********************************
+ *                                                                                *
+ * The key arrays should be sorted in the order in which you would want to visit  *
+ * the child keys.                                                                *
+ *                                                                                *
+ *                        DO NOT SORT THEM ALPHABETICALLY!                        *
+ *                                                                                *
+ * They should be sorted in the order that they appear in the source code.        *
+ * For example:                                                                   *
+ *                                                                                *
+ * class Foo extends Bar { prop: 1 }                                              *
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ClassDeclaration                             *
+ *       ^^^ id      ^^^ superClass                                               *
+ *                       ^^^^^^^^^^^ body                                         *
+ *                                                                                *
+ * It would be incorrect to provide the visitor keys ['body', 'id', 'superClass'] *
+ * because the body comes AFTER everything else in the source code.               *
+ * Instead the correct ordering would be ['id', 'superClass', 'body'].            *
+ *                                                                                *
+ **********************************************************************************
+ */
+const SharedVisitorKeys = (() => {
+    const FunctionType = ['typeParameters', 'params', 'returnType'];
+    const AnonymousFunction = [...FunctionType, 'body'];
+    const AbstractPropertyDefinition = [
+        'decorators',
+        'key',
+        'typeAnnotation',
+    ];
+    return {
+        AbstractPropertyDefinition: ['decorators', 'key', 'typeAnnotation'],
+        AnonymousFunction,
+        AsExpression: ['expression', 'typeAnnotation'],
+        ClassDeclaration: [
+            'decorators',
+            'id',
+            'typeParameters',
+            'superClass',
+            'superTypeArguments',
+            'implements',
+            'body',
+        ],
+        Function: ['id', ...AnonymousFunction],
+        FunctionType,
+        PropertyDefinition: [...AbstractPropertyDefinition, 'value'],
+    };
+})();
+const additionalKeys = {
+    AccessorProperty: SharedVisitorKeys.PropertyDefinition,
+    ArrayPattern: ['decorators', 'elements', 'typeAnnotation'],
+    ArrowFunctionExpression: SharedVisitorKeys.AnonymousFunction,
+    AssignmentPattern: ['decorators', 'left', 'right', 'typeAnnotation'],
+    CallExpression: ['callee', 'typeArguments', 'arguments'],
+    ClassDeclaration: SharedVisitorKeys.ClassDeclaration,
+    ClassExpression: SharedVisitorKeys.ClassDeclaration,
+    Decorator: ['expression'],
+    ExportAllDeclaration: ['exported', 'source', 'attributes'],
+    ExportNamedDeclaration: ['declaration', 'specifiers', 'source', 'attributes'],
+    FunctionDeclaration: SharedVisitorKeys.Function,
+    FunctionExpression: SharedVisitorKeys.Function,
+    Identifier: ['decorators', 'typeAnnotation'],
+    ImportAttribute: ['key', 'value'],
+    ImportDeclaration: ['specifiers', 'source', 'attributes'],
+    ImportExpression: ['source', 'options'],
+    JSXClosingFragment: [],
+    JSXOpeningElement: ['name', 'typeArguments', 'attributes'],
+    JSXOpeningFragment: [],
+    JSXSpreadChild: ['expression'],
+    MethodDefinition: ['decorators', 'key', 'value'],
+    NewExpression: ['callee', 'typeArguments', 'arguments'],
+    ObjectPattern: ['decorators', 'properties', 'typeAnnotation'],
+    PropertyDefinition: SharedVisitorKeys.PropertyDefinition,
+    RestElement: ['decorators', 'argument', 'typeAnnotation'],
+    StaticBlock: ['body'],
+    TaggedTemplateExpression: ['tag', 'typeArguments', 'quasi'],
+    TSAbstractAccessorProperty: SharedVisitorKeys.AbstractPropertyDefinition,
+    TSAbstractKeyword: [],
+    TSAbstractMethodDefinition: ['key', 'value'],
+    TSAbstractPropertyDefinition: SharedVisitorKeys.AbstractPropertyDefinition,
+    TSAnyKeyword: [],
+    TSArrayType: ['elementType'],
+    TSAsExpression: SharedVisitorKeys.AsExpression,
+    TSAsyncKeyword: [],
+    TSBigIntKeyword: [],
+    TSBooleanKeyword: [],
+    TSCallSignatureDeclaration: SharedVisitorKeys.FunctionType,
+    TSClassImplements: ['expression', 'typeArguments'],
+    TSConditionalType: ['checkType', 'extendsType', 'trueType', 'falseType'],
+    TSConstructorType: SharedVisitorKeys.FunctionType,
+    TSConstructSignatureDeclaration: SharedVisitorKeys.FunctionType,
+    TSDeclareFunction: SharedVisitorKeys.Function,
+    TSDeclareKeyword: [],
+    TSEmptyBodyFunctionExpression: ['id', ...SharedVisitorKeys.FunctionType],
+    TSEnumBody: ['members'],
+    TSEnumDeclaration: ['id', 'body'],
+    TSEnumMember: ['id', 'initializer'],
+    TSExportAssignment: ['expression'],
+    TSExportKeyword: [],
+    TSExternalModuleReference: ['expression'],
+    TSFunctionType: SharedVisitorKeys.FunctionType,
+    TSImportEqualsDeclaration: ['id', 'moduleReference'],
+    TSImportType: ['argument', 'qualifier', 'typeArguments', 'options'],
+    TSIndexedAccessType: ['indexType', 'objectType'],
+    TSIndexSignature: ['parameters', 'typeAnnotation'],
+    TSInferType: ['typeParameter'],
+    TSInstantiationExpression: ['expression', 'typeArguments'],
+    TSInterfaceBody: ['body'],
+    TSInterfaceDeclaration: ['id', 'typeParameters', 'extends', 'body'],
+    TSInterfaceHeritage: ['expression', 'typeArguments'],
+    TSIntersectionType: ['types'],
+    TSIntrinsicKeyword: [],
+    TSLiteralType: ['literal'],
+    TSMappedType: ['key', 'constraint', 'nameType', 'typeAnnotation'],
+    TSMethodSignature: ['typeParameters', 'key', 'params', 'returnType'],
+    TSModuleBlock: ['body'],
+    TSModuleDeclaration: ['id', 'body'],
+    TSNamedTupleMember: ['label', 'elementType'],
+    TSNamespaceExportDeclaration: ['id'],
+    TSNeverKeyword: [],
+    TSNonNullExpression: ['expression'],
+    TSNullKeyword: [],
+    TSNumberKeyword: [],
+    TSObjectKeyword: [],
+    TSOptionalType: ['typeAnnotation'],
+    TSParameterProperty: ['decorators', 'parameter'],
+    TSPrivateKeyword: [],
+    TSPropertySignature: ['typeAnnotation', 'key'],
+    TSProtectedKeyword: [],
+    TSPublicKeyword: [],
+    TSQualifiedName: ['left', 'right'],
+    TSReadonlyKeyword: [],
+    TSRestType: ['typeAnnotation'],
+    TSSatisfiesExpression: SharedVisitorKeys.AsExpression,
+    TSStaticKeyword: [],
+    TSStringKeyword: [],
+    TSSymbolKeyword: [],
+    TSTemplateLiteralType: ['quasis', 'types'],
+    TSThisType: [],
+    TSTupleType: ['elementTypes'],
+    TSTypeAliasDeclaration: ['id', 'typeParameters', 'typeAnnotation'],
+    TSTypeAnnotation: ['typeAnnotation'],
+    TSTypeAssertion: ['typeAnnotation', 'expression'],
+    TSTypeLiteral: ['members'],
+    TSTypeOperator: ['typeAnnotation'],
+    TSTypeParameter: ['name', 'constraint', 'default'],
+    TSTypeParameterDeclaration: ['params'],
+    TSTypeParameterInstantiation: ['params'],
+    TSTypePredicate: ['typeAnnotation', 'parameterName'],
+    TSTypeQuery: ['exprName', 'typeArguments'],
+    TSTypeReference: ['typeName', 'typeArguments'],
+    TSUndefinedKeyword: [],
+    TSUnionType: ['types'],
+    TSUnknownKeyword: [],
+    TSVoidKeyword: [],
+};
+exports.visitorKeys = eslintVisitorKeys.unionWith(additionalKeys);
diff --git a/node_modules/@typescript-eslint/visitor-keys/package.json b/node_modules/@typescript-eslint/visitor-keys/package.json
new file mode 100644
index 0000000..26cef07
--- /dev/null
+++ b/node_modules/@typescript-eslint/visitor-keys/package.json
@@ -0,0 +1,73 @@
+{
+  "name": "@typescript-eslint/visitor-keys",
+  "version": "8.26.0",
+  "description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
+  "files": [
+    "dist",
+    "!*.tsbuildinfo",
+    "_ts4.3",
+    "package.json",
+    "README.md",
+    "LICENSE"
+  ],
+  "type": "commonjs",
+  "exports": {
+    ".": {
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.js"
+    },
+    "./package.json": "./package.json"
+  },
+  "types": "./dist/index.d.ts",
+  "engines": {
+    "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/typescript-eslint/typescript-eslint.git",
+    "directory": "packages/visitor-keys"
+  },
+  "bugs": {
+    "url": "https://github.com/typescript-eslint/typescript-eslint/issues"
+  },
+  "homepage": "https://typescript-eslint.io",
+  "license": "MIT",
+  "keywords": [
+    "eslint",
+    "typescript",
+    "estree"
+  ],
+  "scripts": {
+    "build": "tsc -b tsconfig.build.json",
+    "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3",
+    "clean": "tsc -b tsconfig.build.json --clean",
+    "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage",
+    "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
+    "lint": "npx nx lint",
+    "test": "jest",
+    "check-types": "npx nx typecheck"
+  },
+  "dependencies": {
+    "@typescript-eslint/types": "8.26.0",
+    "eslint-visitor-keys": "^4.2.0"
+  },
+  "devDependencies": {
+    "@jest/types": "29.6.3",
+    "downlevel-dts": "*",
+    "jest": "29.7.0",
+    "prettier": "^3.2.5",
+    "rimraf": "*",
+    "typescript": "*"
+  },
+  "funding": {
+    "type": "opencollective",
+    "url": "https://opencollective.com/typescript-eslint"
+  },
+  "typesVersions": {
+    "<4.7": {
+      "*": [
+        "_ts4.3/*"
+      ]
+    }
+  }
+}
diff --git a/node_modules/@vercel/ncc/dist/ncc/cli.js.cache b/node_modules/@vercel/ncc/dist/ncc/cli.js.cache
index be9ef08..ad8a961 100644
Binary files a/node_modules/@vercel/ncc/dist/ncc/cli.js.cache and b/node_modules/@vercel/ncc/dist/ncc/cli.js.cache differ
diff --git a/node_modules/@vercel/ncc/dist/ncc/index.js.cache b/node_modules/@vercel/ncc/dist/ncc/index.js.cache
index 4e7c108..22d67b7 100644
Binary files a/node_modules/@vercel/ncc/dist/ncc/index.js.cache and b/node_modules/@vercel/ncc/dist/ncc/index.js.cache differ
diff --git a/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache b/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache
index 4b6f674..560cd7a 100644
Binary files a/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache and b/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache differ
diff --git a/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache b/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache
index 2a6d0d4..9efed4a 100644
Binary files a/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache and b/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache differ
diff --git a/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache b/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache
index 9355e74..82a6dd1 100644
Binary files a/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache and b/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache differ
diff --git a/node_modules/@vercel/ncc/package.json b/node_modules/@vercel/ncc/package.json
index c0f674b..647dae8 100644
--- a/node_modules/@vercel/ncc/package.json
+++ b/node_modules/@vercel/ncc/package.json
@@ -1,37 +1,23 @@
 {
-  "_from": "@vercel/ncc@^0.38.0",
-  "_id": "@vercel/ncc@0.38.3",
-  "_inBundle": false,
-  "_integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==",
-  "_location": "/@vercel/ncc",
-  "_phantomChildren": {},
-  "_requested": {
-    "type": "range",
-    "registry": true,
-    "raw": "@vercel/ncc@^0.38.0",
-    "name": "@vercel/ncc",
-    "escapedName": "@vercel%2fncc",
-    "scope": "@vercel",
-    "rawSpec": "^0.38.0",
-    "saveSpec": null,
-    "fetchSpec": "^0.38.0"
-  },
-  "_requiredBy": [
-    "#DEV:/"
-  ],
-  "_resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz",
-  "_shasum": "5475eeee3ac0f1a439f237596911525a490a88b5",
-  "_spec": "@vercel/ncc@^0.38.0",
-  "_where": "/Users/scubbo/Code/commit-report-sync",
-  "bin": {
-    "ncc": "dist/ncc/cli.js"
-  },
-  "bugs": {
-    "url": "https://github.com/vercel/ncc/issues"
-  },
-  "bundleDependencies": false,
-  "deprecated": false,
+  "name": "@vercel/ncc",
   "description": "Simple CLI for compiling a Node.js module into a single file, together with all its dependencies, gcc-style.",
+  "version": "0.38.3",
+  "repository": "vercel/ncc",
+  "license": "MIT",
+  "main": "./dist/ncc/index.js",
+  "bin": {
+    "ncc": "./dist/ncc/cli.js"
+  },
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "build": "node scripts/build.js",
+    "build-test-binary": "cd test/binary && node-gyp rebuild && cp build/Release/hello.node ../integration/hello.node",
+    "test": "node --expose-gc --max_old_space_size=4096 node_modules/jest/bin/jest.js",
+    "test-coverage": "node --expose-gc --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --coverage --globals \"{\\\"coverage\\\":true}\"",
+    "prepublishOnly": "node scripts/build.js --no-cache"
+  },
   "devDependencies": {
     "@azure/cosmos": "^3.17.3",
     "@bugsnag/js": "^7.21.0",
@@ -123,24 +109,5 @@
     "webpack": "5.94.0",
     "when": "^3.7.8"
   },
-  "files": [
-    "dist"
-  ],
-  "homepage": "https://github.com/vercel/ncc#readme",
-  "license": "MIT",
-  "main": "./dist/ncc/index.js",
-  "name": "@vercel/ncc",
-  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/vercel/ncc.git"
-  },
-  "scripts": {
-    "build": "node scripts/build.js",
-    "build-test-binary": "cd test/binary && node-gyp rebuild && cp build/Release/hello.node ../integration/hello.node",
-    "prepublishOnly": "node scripts/build.js --no-cache",
-    "test": "node --expose-gc --max_old_space_size=4096 node_modules/jest/bin/jest.js",
-    "test-coverage": "node --expose-gc --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --coverage --globals \"{\\\"coverage\\\":true}\""
-  },
-  "version": "0.38.3"
+  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
 }
diff --git a/node_modules/acorn-jsx/LICENSE b/node_modules/acorn-jsx/LICENSE
new file mode 100644
index 0000000..695d4b9
--- /dev/null
+++ b/node_modules/acorn-jsx/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2012-2017 by Ingvar Stepanyan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/acorn-jsx/README.md b/node_modules/acorn-jsx/README.md
new file mode 100644
index 0000000..317c3ac
--- /dev/null
+++ b/node_modules/acorn-jsx/README.md
@@ -0,0 +1,40 @@
+# Acorn-JSX
+
+[![Build Status](https://travis-ci.org/acornjs/acorn-jsx.svg?branch=master)](https://travis-ci.org/acornjs/acorn-jsx)
+[![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx)
+
+This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.
+
+It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools.
+
+## Transpiler
+
+Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood.
+
+## Usage
+
+Requiring this module provides you with an Acorn plugin that you can use like this:
+
+```javascript
+var acorn = require("acorn");
+var jsx = require("acorn-jsx");
+acorn.Parser.extend(jsx()).parse("my(, 'code');");
+```
+
+Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in ``, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option:
+
+```javascript
+acorn.Parser.extend(jsx({ allowNamespacedObjects: true }))
+```
+
+Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely:
+
+```javascript
+acorn.Parser.extend(jsx({ allowNamespaces: false }))
+```
+
+Note that by default `allowNamespaces` is enabled for spec compliancy.
+
+## License
+
+This plugin is issued under the [MIT license](./LICENSE).
diff --git a/node_modules/acorn-jsx/index.js b/node_modules/acorn-jsx/index.js
new file mode 100644
index 0000000..004e080
--- /dev/null
+++ b/node_modules/acorn-jsx/index.js
@@ -0,0 +1,488 @@
+'use strict';
+
+const XHTMLEntities = require('./xhtml');
+
+const hexNumber = /^[\da-fA-F]+$/;
+const decimalNumber = /^\d+$/;
+
+// The map to `acorn-jsx` tokens from `acorn` namespace objects.
+const acornJsxMap = new WeakMap();
+
+// Get the original tokens for the given `acorn` namespace object.
+function getJsxTokens(acorn) {
+  acorn = acorn.Parser.acorn || acorn;
+  let acornJsx = acornJsxMap.get(acorn);
+  if (!acornJsx) {
+    const tt = acorn.tokTypes;
+    const TokContext = acorn.TokContext;
+    const TokenType = acorn.TokenType;
+    const tc_oTag = new TokContext('...', true, true);
+    const tokContexts = {
+      tc_oTag: tc_oTag,
+      tc_cTag: tc_cTag,
+      tc_expr: tc_expr
+    };
+    const tokTypes = {
+      jsxName: new TokenType('jsxName'),
+      jsxText: new TokenType('jsxText', {beforeExpr: true}),
+      jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}),
+      jsxTagEnd: new TokenType('jsxTagEnd')
+    };
+
+    tokTypes.jsxTagStart.updateContext = function() {
+      this.context.push(tc_expr); // treat as beginning of JSX expression
+      this.context.push(tc_oTag); // start opening tag context
+      this.exprAllowed = false;
+    };
+    tokTypes.jsxTagEnd.updateContext = function(prevType) {
+      let out = this.context.pop();
+      if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) {
+        this.context.pop();
+        this.exprAllowed = this.curContext() === tc_expr;
+      } else {
+        this.exprAllowed = true;
+      }
+    };
+
+    acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes };
+    acornJsxMap.set(acorn, acornJsx);
+  }
+
+  return acornJsx;
+}
+
+// Transforms JSX element name to string.
+
+function getQualifiedJSXName(object) {
+  if (!object)
+    return object;
+
+  if (object.type === 'JSXIdentifier')
+    return object.name;
+
+  if (object.type === 'JSXNamespacedName')
+    return object.namespace.name + ':' + object.name.name;
+
+  if (object.type === 'JSXMemberExpression')
+    return getQualifiedJSXName(object.object) + '.' +
+    getQualifiedJSXName(object.property);
+}
+
+module.exports = function(options) {
+  options = options || {};
+  return function(Parser) {
+    return plugin({
+      allowNamespaces: options.allowNamespaces !== false,
+      allowNamespacedObjects: !!options.allowNamespacedObjects
+    }, Parser);
+  };
+};
+
+// This is `tokTypes` of the peer dep.
+// This can be different instances from the actual `tokTypes` this plugin uses.
+Object.defineProperty(module.exports, "tokTypes", {
+  get: function get_tokTypes() {
+    return getJsxTokens(require("acorn")).tokTypes;
+  },
+  configurable: true,
+  enumerable: true
+});
+
+function plugin(options, Parser) {
+  const acorn = Parser.acorn || require("acorn");
+  const acornJsx = getJsxTokens(acorn);
+  const tt = acorn.tokTypes;
+  const tok = acornJsx.tokTypes;
+  const tokContexts = acorn.tokContexts;
+  const tc_oTag = acornJsx.tokContexts.tc_oTag;
+  const tc_cTag = acornJsx.tokContexts.tc_cTag;
+  const tc_expr = acornJsx.tokContexts.tc_expr;
+  const isNewLine = acorn.isNewLine;
+  const isIdentifierStart = acorn.isIdentifierStart;
+  const isIdentifierChar = acorn.isIdentifierChar;
+
+  return class extends Parser {
+    // Expose actual `tokTypes` and `tokContexts` to other plugins.
+    static get acornJsx() {
+      return acornJsx;
+    }
+
+    // Reads inline JSX contents token.
+    jsx_readToken() {
+      let out = '', chunkStart = this.pos;
+      for (;;) {
+        if (this.pos >= this.input.length)
+          this.raise(this.start, 'Unterminated JSX contents');
+        let ch = this.input.charCodeAt(this.pos);
+
+        switch (ch) {
+        case 60: // '<'
+        case 123: // '{'
+          if (this.pos === this.start) {
+            if (ch === 60 && this.exprAllowed) {
+              ++this.pos;
+              return this.finishToken(tok.jsxTagStart);
+            }
+            return this.getTokenFromCode(ch);
+          }
+          out += this.input.slice(chunkStart, this.pos);
+          return this.finishToken(tok.jsxText, out);
+
+        case 38: // '&'
+          out += this.input.slice(chunkStart, this.pos);
+          out += this.jsx_readEntity();
+          chunkStart = this.pos;
+          break;
+
+        case 62: // '>'
+        case 125: // '}'
+          this.raise(
+            this.pos,
+            "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" +
+              (ch === 62 ? ">" : "}") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?"
+          );
+
+        default:
+          if (isNewLine(ch)) {
+            out += this.input.slice(chunkStart, this.pos);
+            out += this.jsx_readNewLine(true);
+            chunkStart = this.pos;
+          } else {
+            ++this.pos;
+          }
+        }
+      }
+    }
+
+    jsx_readNewLine(normalizeCRLF) {
+      let ch = this.input.charCodeAt(this.pos);
+      let out;
+      ++this.pos;
+      if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
+        ++this.pos;
+        out = normalizeCRLF ? '\n' : '\r\n';
+      } else {
+        out = String.fromCharCode(ch);
+      }
+      if (this.options.locations) {
+        ++this.curLine;
+        this.lineStart = this.pos;
+      }
+
+      return out;
+    }
+
+    jsx_readString(quote) {
+      let out = '', chunkStart = ++this.pos;
+      for (;;) {
+        if (this.pos >= this.input.length)
+          this.raise(this.start, 'Unterminated string constant');
+        let ch = this.input.charCodeAt(this.pos);
+        if (ch === quote) break;
+        if (ch === 38) { // '&'
+          out += this.input.slice(chunkStart, this.pos);
+          out += this.jsx_readEntity();
+          chunkStart = this.pos;
+        } else if (isNewLine(ch)) {
+          out += this.input.slice(chunkStart, this.pos);
+          out += this.jsx_readNewLine(false);
+          chunkStart = this.pos;
+        } else {
+          ++this.pos;
+        }
+      }
+      out += this.input.slice(chunkStart, this.pos++);
+      return this.finishToken(tt.string, out);
+    }
+
+    jsx_readEntity() {
+      let str = '', count = 0, entity;
+      let ch = this.input[this.pos];
+      if (ch !== '&')
+        this.raise(this.pos, 'Entity must start with an ampersand');
+      let startPos = ++this.pos;
+      while (this.pos < this.input.length && count++ < 10) {
+        ch = this.input[this.pos++];
+        if (ch === ';') {
+          if (str[0] === '#') {
+            if (str[1] === 'x') {
+              str = str.substr(2);
+              if (hexNumber.test(str))
+                entity = String.fromCharCode(parseInt(str, 16));
+            } else {
+              str = str.substr(1);
+              if (decimalNumber.test(str))
+                entity = String.fromCharCode(parseInt(str, 10));
+            }
+          } else {
+            entity = XHTMLEntities[str];
+          }
+          break;
+        }
+        str += ch;
+      }
+      if (!entity) {
+        this.pos = startPos;
+        return '&';
+      }
+      return entity;
+    }
+
+    // Read a JSX identifier (valid tag or attribute name).
+    //
+    // Optimized version since JSX identifiers can't contain
+    // escape characters and so can be read as single slice.
+    // Also assumes that first character was already checked
+    // by isIdentifierStart in readToken.
+
+    jsx_readWord() {
+      let ch, start = this.pos;
+      do {
+        ch = this.input.charCodeAt(++this.pos);
+      } while (isIdentifierChar(ch) || ch === 45); // '-'
+      return this.finishToken(tok.jsxName, this.input.slice(start, this.pos));
+    }
+
+    // Parse next token as JSX identifier
+
+    jsx_parseIdentifier() {
+      let node = this.startNode();
+      if (this.type === tok.jsxName)
+        node.name = this.value;
+      else if (this.type.keyword)
+        node.name = this.type.keyword;
+      else
+        this.unexpected();
+      this.next();
+      return this.finishNode(node, 'JSXIdentifier');
+    }
+
+    // Parse namespaced identifier.
+
+    jsx_parseNamespacedName() {
+      let startPos = this.start, startLoc = this.startLoc;
+      let name = this.jsx_parseIdentifier();
+      if (!options.allowNamespaces || !this.eat(tt.colon)) return name;
+      var node = this.startNodeAt(startPos, startLoc);
+      node.namespace = name;
+      node.name = this.jsx_parseIdentifier();
+      return this.finishNode(node, 'JSXNamespacedName');
+    }
+
+    // Parses element name in any form - namespaced, member
+    // or single identifier.
+
+    jsx_parseElementName() {
+      if (this.type === tok.jsxTagEnd) return '';
+      let startPos = this.start, startLoc = this.startLoc;
+      let node = this.jsx_parseNamespacedName();
+      if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) {
+        this.unexpected();
+      }
+      while (this.eat(tt.dot)) {
+        let newNode = this.startNodeAt(startPos, startLoc);
+        newNode.object = node;
+        newNode.property = this.jsx_parseIdentifier();
+        node = this.finishNode(newNode, 'JSXMemberExpression');
+      }
+      return node;
+    }
+
+    // Parses any type of JSX attribute value.
+
+    jsx_parseAttributeValue() {
+      switch (this.type) {
+      case tt.braceL:
+        let node = this.jsx_parseExpressionContainer();
+        if (node.expression.type === 'JSXEmptyExpression')
+          this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression');
+        return node;
+
+      case tok.jsxTagStart:
+      case tt.string:
+        return this.parseExprAtom();
+
+      default:
+        this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text');
+      }
+    }
+
+    // JSXEmptyExpression is unique type since it doesn't actually parse anything,
+    // and so it should start at the end of last read token (left brace) and finish
+    // at the beginning of the next one (right brace).
+
+    jsx_parseEmptyExpression() {
+      let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
+      return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc);
+    }
+
+    // Parses JSX expression enclosed into curly brackets.
+
+    jsx_parseExpressionContainer() {
+      let node = this.startNode();
+      this.next();
+      node.expression = this.type === tt.braceR
+        ? this.jsx_parseEmptyExpression()
+        : this.parseExpression();
+      this.expect(tt.braceR);
+      return this.finishNode(node, 'JSXExpressionContainer');
+    }
+
+    // Parses following JSX attribute name-value pair.
+
+    jsx_parseAttribute() {
+      let node = this.startNode();
+      if (this.eat(tt.braceL)) {
+        this.expect(tt.ellipsis);
+        node.argument = this.parseMaybeAssign();
+        this.expect(tt.braceR);
+        return this.finishNode(node, 'JSXSpreadAttribute');
+      }
+      node.name = this.jsx_parseNamespacedName();
+      node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;
+      return this.finishNode(node, 'JSXAttribute');
+    }
+
+    // Parses JSX opening tag starting after '<'.
+
+    jsx_parseOpeningElementAt(startPos, startLoc) {
+      let node = this.startNodeAt(startPos, startLoc);
+      node.attributes = [];
+      let nodeName = this.jsx_parseElementName();
+      if (nodeName) node.name = nodeName;
+      while (this.type !== tt.slash && this.type !== tok.jsxTagEnd)
+        node.attributes.push(this.jsx_parseAttribute());
+      node.selfClosing = this.eat(tt.slash);
+      this.expect(tok.jsxTagEnd);
+      return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment');
+    }
+
+    // Parses JSX closing tag starting after '');
+        }
+      }
+      let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment';
+
+      node['opening' + fragmentOrElement] = openingElement;
+      node['closing' + fragmentOrElement] = closingElement;
+      node.children = children;
+      if (this.type === tt.relational && this.value === "<") {
+        this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
+      }
+      return this.finishNode(node, 'JSX' + fragmentOrElement);
+    }
+
+    // Parse JSX text
+
+    jsx_parseText() {
+      let node = this.parseLiteral(this.value);
+      node.type = "JSXText";
+      return node;
+    }
+
+    // Parses entire JSX element from current position.
+
+    jsx_parseElement() {
+      let startPos = this.start, startLoc = this.startLoc;
+      this.next();
+      return this.jsx_parseElementAt(startPos, startLoc);
+    }
+
+    parseExprAtom(refShortHandDefaultPos) {
+      if (this.type === tok.jsxText)
+        return this.jsx_parseText();
+      else if (this.type === tok.jsxTagStart)
+        return this.jsx_parseElement();
+      else
+        return super.parseExprAtom(refShortHandDefaultPos);
+    }
+
+    readToken(code) {
+      let context = this.curContext();
+
+      if (context === tc_expr) return this.jsx_readToken();
+
+      if (context === tc_oTag || context === tc_cTag) {
+        if (isIdentifierStart(code)) return this.jsx_readWord();
+
+        if (code == 62) {
+          ++this.pos;
+          return this.finishToken(tok.jsxTagEnd);
+        }
+
+        if ((code === 34 || code === 39) && context == tc_oTag)
+          return this.jsx_readString(code);
+      }
+
+      if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) {
+        ++this.pos;
+        return this.finishToken(tok.jsxTagStart);
+      }
+      return super.readToken(code);
+    }
+
+    updateContext(prevType) {
+      if (this.type == tt.braceL) {
+        var curContext = this.curContext();
+        if (curContext == tc_oTag) this.context.push(tokContexts.b_expr);
+        else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl);
+        else super.updateContext(prevType);
+        this.exprAllowed = true;
+      } else if (this.type === tt.slash && prevType === tok.jsxTagStart) {
+        this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
+        this.context.push(tc_cTag); // reconsider as closing tag context
+        this.exprAllowed = false;
+      } else {
+        return super.updateContext(prevType);
+      }
+    }
+  };
+}
diff --git a/node_modules/acorn-jsx/package.json b/node_modules/acorn-jsx/package.json
new file mode 100644
index 0000000..6debde9
--- /dev/null
+++ b/node_modules/acorn-jsx/package.json
@@ -0,0 +1,27 @@
+{
+  "name": "acorn-jsx",
+  "description": "Modern, fast React.js JSX parser",
+  "homepage": "https://github.com/acornjs/acorn-jsx",
+  "version": "5.3.2",
+  "maintainers": [
+    {
+      "name": "Ingvar Stepanyan",
+      "email": "me@rreverser.com",
+      "web": "http://rreverser.com/"
+    }
+  ],
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/acornjs/acorn-jsx"
+  },
+  "license": "MIT",
+  "scripts": {
+    "test": "node test/run.js"
+  },
+  "peerDependencies": {
+    "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+  },
+  "devDependencies": {
+    "acorn": "^8.0.1"
+  }
+}
diff --git a/node_modules/acorn-jsx/xhtml.js b/node_modules/acorn-jsx/xhtml.js
new file mode 100644
index 0000000..c152009
--- /dev/null
+++ b/node_modules/acorn-jsx/xhtml.js
@@ -0,0 +1,255 @@
+module.exports = {
+  quot: '\u0022',
+  amp: '&',
+  apos: '\u0027',
+  lt: '<',
+  gt: '>',
+  nbsp: '\u00A0',
+  iexcl: '\u00A1',
+  cent: '\u00A2',
+  pound: '\u00A3',
+  curren: '\u00A4',
+  yen: '\u00A5',
+  brvbar: '\u00A6',
+  sect: '\u00A7',
+  uml: '\u00A8',
+  copy: '\u00A9',
+  ordf: '\u00AA',
+  laquo: '\u00AB',
+  not: '\u00AC',
+  shy: '\u00AD',
+  reg: '\u00AE',
+  macr: '\u00AF',
+  deg: '\u00B0',
+  plusmn: '\u00B1',
+  sup2: '\u00B2',
+  sup3: '\u00B3',
+  acute: '\u00B4',
+  micro: '\u00B5',
+  para: '\u00B6',
+  middot: '\u00B7',
+  cedil: '\u00B8',
+  sup1: '\u00B9',
+  ordm: '\u00BA',
+  raquo: '\u00BB',
+  frac14: '\u00BC',
+  frac12: '\u00BD',
+  frac34: '\u00BE',
+  iquest: '\u00BF',
+  Agrave: '\u00C0',
+  Aacute: '\u00C1',
+  Acirc: '\u00C2',
+  Atilde: '\u00C3',
+  Auml: '\u00C4',
+  Aring: '\u00C5',
+  AElig: '\u00C6',
+  Ccedil: '\u00C7',
+  Egrave: '\u00C8',
+  Eacute: '\u00C9',
+  Ecirc: '\u00CA',
+  Euml: '\u00CB',
+  Igrave: '\u00CC',
+  Iacute: '\u00CD',
+  Icirc: '\u00CE',
+  Iuml: '\u00CF',
+  ETH: '\u00D0',
+  Ntilde: '\u00D1',
+  Ograve: '\u00D2',
+  Oacute: '\u00D3',
+  Ocirc: '\u00D4',
+  Otilde: '\u00D5',
+  Ouml: '\u00D6',
+  times: '\u00D7',
+  Oslash: '\u00D8',
+  Ugrave: '\u00D9',
+  Uacute: '\u00DA',
+  Ucirc: '\u00DB',
+  Uuml: '\u00DC',
+  Yacute: '\u00DD',
+  THORN: '\u00DE',
+  szlig: '\u00DF',
+  agrave: '\u00E0',
+  aacute: '\u00E1',
+  acirc: '\u00E2',
+  atilde: '\u00E3',
+  auml: '\u00E4',
+  aring: '\u00E5',
+  aelig: '\u00E6',
+  ccedil: '\u00E7',
+  egrave: '\u00E8',
+  eacute: '\u00E9',
+  ecirc: '\u00EA',
+  euml: '\u00EB',
+  igrave: '\u00EC',
+  iacute: '\u00ED',
+  icirc: '\u00EE',
+  iuml: '\u00EF',
+  eth: '\u00F0',
+  ntilde: '\u00F1',
+  ograve: '\u00F2',
+  oacute: '\u00F3',
+  ocirc: '\u00F4',
+  otilde: '\u00F5',
+  ouml: '\u00F6',
+  divide: '\u00F7',
+  oslash: '\u00F8',
+  ugrave: '\u00F9',
+  uacute: '\u00FA',
+  ucirc: '\u00FB',
+  uuml: '\u00FC',
+  yacute: '\u00FD',
+  thorn: '\u00FE',
+  yuml: '\u00FF',
+  OElig: '\u0152',
+  oelig: '\u0153',
+  Scaron: '\u0160',
+  scaron: '\u0161',
+  Yuml: '\u0178',
+  fnof: '\u0192',
+  circ: '\u02C6',
+  tilde: '\u02DC',
+  Alpha: '\u0391',
+  Beta: '\u0392',
+  Gamma: '\u0393',
+  Delta: '\u0394',
+  Epsilon: '\u0395',
+  Zeta: '\u0396',
+  Eta: '\u0397',
+  Theta: '\u0398',
+  Iota: '\u0399',
+  Kappa: '\u039A',
+  Lambda: '\u039B',
+  Mu: '\u039C',
+  Nu: '\u039D',
+  Xi: '\u039E',
+  Omicron: '\u039F',
+  Pi: '\u03A0',
+  Rho: '\u03A1',
+  Sigma: '\u03A3',
+  Tau: '\u03A4',
+  Upsilon: '\u03A5',
+  Phi: '\u03A6',
+  Chi: '\u03A7',
+  Psi: '\u03A8',
+  Omega: '\u03A9',
+  alpha: '\u03B1',
+  beta: '\u03B2',
+  gamma: '\u03B3',
+  delta: '\u03B4',
+  epsilon: '\u03B5',
+  zeta: '\u03B6',
+  eta: '\u03B7',
+  theta: '\u03B8',
+  iota: '\u03B9',
+  kappa: '\u03BA',
+  lambda: '\u03BB',
+  mu: '\u03BC',
+  nu: '\u03BD',
+  xi: '\u03BE',
+  omicron: '\u03BF',
+  pi: '\u03C0',
+  rho: '\u03C1',
+  sigmaf: '\u03C2',
+  sigma: '\u03C3',
+  tau: '\u03C4',
+  upsilon: '\u03C5',
+  phi: '\u03C6',
+  chi: '\u03C7',
+  psi: '\u03C8',
+  omega: '\u03C9',
+  thetasym: '\u03D1',
+  upsih: '\u03D2',
+  piv: '\u03D6',
+  ensp: '\u2002',
+  emsp: '\u2003',
+  thinsp: '\u2009',
+  zwnj: '\u200C',
+  zwj: '\u200D',
+  lrm: '\u200E',
+  rlm: '\u200F',
+  ndash: '\u2013',
+  mdash: '\u2014',
+  lsquo: '\u2018',
+  rsquo: '\u2019',
+  sbquo: '\u201A',
+  ldquo: '\u201C',
+  rdquo: '\u201D',
+  bdquo: '\u201E',
+  dagger: '\u2020',
+  Dagger: '\u2021',
+  bull: '\u2022',
+  hellip: '\u2026',
+  permil: '\u2030',
+  prime: '\u2032',
+  Prime: '\u2033',
+  lsaquo: '\u2039',
+  rsaquo: '\u203A',
+  oline: '\u203E',
+  frasl: '\u2044',
+  euro: '\u20AC',
+  image: '\u2111',
+  weierp: '\u2118',
+  real: '\u211C',
+  trade: '\u2122',
+  alefsym: '\u2135',
+  larr: '\u2190',
+  uarr: '\u2191',
+  rarr: '\u2192',
+  darr: '\u2193',
+  harr: '\u2194',
+  crarr: '\u21B5',
+  lArr: '\u21D0',
+  uArr: '\u21D1',
+  rArr: '\u21D2',
+  dArr: '\u21D3',
+  hArr: '\u21D4',
+  forall: '\u2200',
+  part: '\u2202',
+  exist: '\u2203',
+  empty: '\u2205',
+  nabla: '\u2207',
+  isin: '\u2208',
+  notin: '\u2209',
+  ni: '\u220B',
+  prod: '\u220F',
+  sum: '\u2211',
+  minus: '\u2212',
+  lowast: '\u2217',
+  radic: '\u221A',
+  prop: '\u221D',
+  infin: '\u221E',
+  ang: '\u2220',
+  and: '\u2227',
+  or: '\u2228',
+  cap: '\u2229',
+  cup: '\u222A',
+  'int': '\u222B',
+  there4: '\u2234',
+  sim: '\u223C',
+  cong: '\u2245',
+  asymp: '\u2248',
+  ne: '\u2260',
+  equiv: '\u2261',
+  le: '\u2264',
+  ge: '\u2265',
+  sub: '\u2282',
+  sup: '\u2283',
+  nsub: '\u2284',
+  sube: '\u2286',
+  supe: '\u2287',
+  oplus: '\u2295',
+  otimes: '\u2297',
+  perp: '\u22A5',
+  sdot: '\u22C5',
+  lceil: '\u2308',
+  rceil: '\u2309',
+  lfloor: '\u230A',
+  rfloor: '\u230B',
+  lang: '\u2329',
+  rang: '\u232A',
+  loz: '\u25CA',
+  spades: '\u2660',
+  clubs: '\u2663',
+  hearts: '\u2665',
+  diams: '\u2666'
+};
diff --git a/node_modules/acorn/CHANGELOG.md b/node_modules/acorn/CHANGELOG.md
new file mode 100644
index 0000000..3137186
--- /dev/null
+++ b/node_modules/acorn/CHANGELOG.md
@@ -0,0 +1,928 @@
+## 8.14.0 (2024-10-27)
+
+### New features
+
+Support ES2025 import attributes.
+
+Support ES2025 RegExp modifiers.
+
+### Bug fixes
+
+Support some missing Unicode properties.
+
+## 8.13.0 (2024-10-16)
+
+### New features
+
+Upgrade to Unicode 16.0.
+
+## 8.12.1 (2024-07-03)
+
+### Bug fixes
+
+Fix a regression that caused Acorn to no longer run on Node versions <8.10.
+
+## 8.12.0 (2024-06-14)
+
+### New features
+
+Support ES2025 duplicate capture group names in regular expressions.
+
+### Bug fixes
+
+Include `VariableDeclarator` in the `AnyNode` type so that walker objects can refer to it without getting a type error.
+
+Properly raise a parse error for invalid `for`/`of` statements using `async` as binding name.
+
+Properly recognize \"use strict\" when preceded by a string with an escaped newline.
+
+Mark the `Parser` constructor as protected, not private, so plugins can extend it without type errors.
+
+Fix a bug where some invalid `delete` expressions were let through when the operand was parenthesized and `preserveParens` was enabled.
+
+Properly normalize line endings in raw strings of invalid template tokens.
+
+Properly track line numbers for escaped newlines in strings.
+
+Fix a bug that broke line number accounting after a template literal with invalid escape sequences.
+
+## 8.11.3 (2023-12-29)
+
+### Bug fixes
+
+Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error.
+
+Make sure `onToken` get an `import` keyword token when parsing `import.meta`.
+
+Fix a bug where `.loc.start` could be undefined for `new.target` `meta` nodes.
+
+## 8.11.2 (2023-10-27)
+
+### Bug fixes
+
+Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.
+
+## 8.11.1 (2023-10-26)
+
+### Bug fixes
+
+Fix a regression where `onToken` would receive 'name' tokens for 'new' keyword tokens.
+
+## 8.11.0 (2023-10-26)
+
+### Bug fixes
+
+Fix an issue where tokenizing (without parsing) an object literal with a property named `class` or `function` could, in some circumstance, put the tokenizer into an invalid state.
+
+Fix an issue where a slash after a call to a propery named the same as some keywords would be tokenized as a regular expression.
+
+### New features
+
+Upgrade to Unicode 15.1.
+
+Use a set of new, much more precise, TypeScript types.
+
+## 8.10.0 (2023-07-05)
+
+### New features
+
+Add a `checkPrivateFields` option that disables strict checking of private property use.
+
+## 8.9.0 (2023-06-16)
+
+### Bug fixes
+
+Forbid dynamic import after `new`, even when part of a member expression.
+
+### New features
+
+Add Unicode properties for ES2023.
+
+Add support for the `v` flag to regular expressions.
+
+## 8.8.2 (2023-01-23)
+
+### Bug fixes
+
+Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`.
+
+Fix an exception when passing no option object to `parse` or `new Parser`.
+
+Fix incorrect parse error on `if (0) let\n[astral identifier char]`.
+
+## 8.8.1 (2022-10-24)
+
+### Bug fixes
+
+Make type for `Comment` compatible with estree types.
+
+## 8.8.0 (2022-07-21)
+
+### Bug fixes
+
+Allow parentheses around spread args in destructuring object assignment.
+
+Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them.
+
+### New features
+
+Support hashbang comments by default in ECMAScript 2023 and later.
+
+## 8.7.1 (2021-04-26)
+
+### Bug fixes
+
+Stop handling `"use strict"` directives in ECMAScript versions before 5.
+
+Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked.
+
+Add missing type for `tokTypes`.
+
+## 8.7.0 (2021-12-27)
+
+### New features
+
+Support quoted export names.
+
+Upgrade to Unicode 14.
+
+Add support for Unicode 13 properties in regular expressions.
+
+### Bug fixes
+
+Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code.
+
+## 8.6.0 (2021-11-18)
+
+### Bug fixes
+
+Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment.
+
+### New features
+
+Support class private fields with the `in` operator.
+
+## 8.5.0 (2021-09-06)
+
+### Bug fixes
+
+Improve context-dependent tokenization in a number of corner cases.
+
+Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).
+
+Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators.
+
+Fix wrong end locations stored on SequenceExpression nodes.
+
+Implement restriction that `for`/`of` loop LHS can't start with `let`.
+
+### New features
+
+Add support for ES2022 class static blocks.
+
+Allow multiple input files to be passed to the CLI tool.
+
+## 8.4.1 (2021-06-24)
+
+### Bug fixes
+
+Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources.
+
+## 8.4.0 (2021-06-11)
+
+### New features
+
+A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context.
+
+## 8.3.0 (2021-05-31)
+
+### New features
+
+Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher.
+
+Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag.
+
+## 8.2.4 (2021-05-04)
+
+### Bug fixes
+
+Fix spec conformity in corner case 'for await (async of ...)'.
+
+## 8.2.3 (2021-05-04)
+
+### Bug fixes
+
+Fix an issue where the library couldn't parse 'for (async of ...)'.
+
+Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances.
+
+## 8.2.2 (2021-04-29)
+
+### Bug fixes
+
+Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield.
+
+## 8.2.1 (2021-04-24)
+
+### Bug fixes
+
+Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.
+
+## 8.2.0 (2021-04-24)
+
+### New features
+
+Add support for ES2022 class fields and private methods.
+
+## 8.1.1 (2021-04-12)
+
+### Various
+
+Stop shipping source maps in the NPM package.
+
+## 8.1.0 (2021-03-09)
+
+### Bug fixes
+
+Fix a spurious error in nested destructuring arrays.
+
+### New features
+
+Expose `allowAwaitOutsideFunction` in CLI interface.
+
+Make `allowImportExportAnywhere` also apply to `import.meta`.
+
+## 8.0.5 (2021-01-25)
+
+### Bug fixes
+
+Adjust package.json to work with Node 12.16.0 and 13.0-13.6.
+
+## 8.0.4 (2020-10-05)
+
+### Bug fixes
+
+Make `await x ** y` an error, following the spec.
+
+Fix potentially exponential regular expression.
+
+## 8.0.3 (2020-10-02)
+
+### Bug fixes
+
+Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`.
+
+## 8.0.2 (2020-09-30)
+
+### Bug fixes
+
+Make the TypeScript types reflect the current allowed values for `ecmaVersion`.
+
+Fix another regexp/division tokenizer issue.
+
+## 8.0.1 (2020-08-12)
+
+### Bug fixes
+
+Provide the correct value in the `version` export.
+
+## 8.0.0 (2020-08-12)
+
+### Bug fixes
+
+Disallow expressions like `(a = b) = c`.
+
+Make non-octal escape sequences a syntax error in strict mode.
+
+### New features
+
+The package can now be loaded directly as an ECMAScript module in node 13+.
+
+Update to the set of Unicode properties from ES2021.
+
+### Breaking changes
+
+The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
+
+Some changes to method signatures that may be used by plugins.
+
+## 7.4.0 (2020-08-03)
+
+### New features
+
+Add support for logical assignment operators.
+
+Add support for numeric separators.
+
+## 7.3.1 (2020-06-11)
+
+### Bug fixes
+
+Make the string in the `version` export match the actual library version.
+
+## 7.3.0 (2020-06-11)
+
+### Bug fixes
+
+Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
+
+### New features
+
+Add support for optional chaining (`?.`).
+
+## 7.2.0 (2020-05-09)
+
+### Bug fixes
+
+Fix precedence issue in parsing of async arrow functions.
+
+### New features
+
+Add support for nullish coalescing.
+
+Add support for `import.meta`.
+
+Support `export * as ...` syntax.
+
+Upgrade to Unicode 13.
+
+## 6.4.1 (2020-03-09)
+
+### Bug fixes
+
+More carefully check for valid UTF16 surrogate pairs in regexp validator.
+
+## 7.1.1 (2020-03-01)
+
+### Bug fixes
+
+Treat `\8` and `\9` as invalid escapes in template strings.
+
+Allow unicode escapes in property names that are keywords.
+
+Don't error on an exponential operator expression as argument to `await`.
+
+More carefully check for valid UTF16 surrogate pairs in regexp validator.
+
+## 7.1.0 (2019-09-24)
+
+### Bug fixes
+
+Disallow trailing object literal commas when ecmaVersion is less than 5.
+
+### New features
+
+Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
+
+## 7.0.0 (2019-08-13)
+
+### Breaking changes
+
+Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression).
+
+Makes 10 (ES2019) the default value for the `ecmaVersion` option.
+
+## 6.3.0 (2019-08-12)
+
+### New features
+
+`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard.
+
+## 6.2.1 (2019-07-21)
+
+### Bug fixes
+
+Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
+
+Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
+
+## 6.2.0 (2019-07-04)
+
+### Bug fixes
+
+Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
+
+Disallow binding `let` in patterns.
+
+### New features
+
+Support bigint syntax with `ecmaVersion` >= 11.
+
+Support dynamic `import` syntax with `ecmaVersion` >= 11.
+
+Upgrade to Unicode version 12.
+
+## 6.1.1 (2019-02-27)
+
+### Bug fixes
+
+Fix bug that caused parsing default exports of with names to fail.
+
+## 6.1.0 (2019-02-08)
+
+### Bug fixes
+
+Fix scope checking when redefining a `var` as a lexical binding.
+
+### New features
+
+Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
+
+## 6.0.7 (2019-02-04)
+
+### Bug fixes
+
+Check that exported bindings are defined.
+
+Don't treat `\u180e` as a whitespace character.
+
+Check for duplicate parameter names in methods.
+
+Don't allow shorthand properties when they are generators or async methods.
+
+Forbid binding `await` in async arrow function's parameter list.
+
+## 6.0.6 (2019-01-30)
+
+### Bug fixes
+
+The content of class declarations and expressions is now always parsed in strict mode.
+
+Don't allow `let` or `const` to bind the variable name `let`.
+
+Treat class declarations as lexical.
+
+Don't allow a generator function declaration as the sole body of an `if` or `else`.
+
+Ignore `"use strict"` when after an empty statement.
+
+Allow string line continuations with special line terminator characters.
+
+Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
+
+Fix bug with parsing `yield` in a `for` loop initializer.
+
+Implement special cases around scope checking for functions.
+
+## 6.0.5 (2019-01-02)
+
+### Bug fixes
+
+Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
+
+Don't treat `let` as a keyword when the next token is `{` on the next line.
+
+Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
+
+## 6.0.4 (2018-11-05)
+
+### Bug fixes
+
+Further improvements to tokenizing regular expressions in corner cases.
+
+## 6.0.3 (2018-11-04)
+
+### Bug fixes
+
+Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
+
+Remove stray symlink in the package tarball.
+
+## 6.0.2 (2018-09-26)
+
+### Bug fixes
+
+Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
+
+## 6.0.1 (2018-09-14)
+
+### Bug fixes
+
+Fix wrong value in `version` export.
+
+## 6.0.0 (2018-09-14)
+
+### Bug fixes
+
+Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
+
+Forbid `new.target` in top-level arrow functions.
+
+Fix issue with parsing a regexp after `yield` in some contexts.
+
+### New features
+
+The package now comes with TypeScript definitions.
+
+### Breaking changes
+
+The default value of the `ecmaVersion` option is now 9 (2018).
+
+Plugins work differently, and will have to be rewritten to work with this version.
+
+The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
+
+## 5.7.3 (2018-09-10)
+
+### Bug fixes
+
+Fix failure to tokenize regexps after expressions like `x.of`.
+
+Better error message for unterminated template literals.
+
+## 5.7.2 (2018-08-24)
+
+### Bug fixes
+
+Properly handle `allowAwaitOutsideFunction` in for statements.
+
+Treat function declarations at the top level of modules like let bindings.
+
+Don't allow async function declarations as the only statement under a label.
+
+## 5.7.0 (2018-06-15)
+
+### New features
+
+Upgraded to Unicode 11.
+
+## 5.6.0 (2018-05-31)
+
+### New features
+
+Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
+
+Allow binding-less catch statements when ECMAVersion >= 10.
+
+Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
+
+## 5.5.3 (2018-03-08)
+
+### Bug fixes
+
+A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
+
+## 5.5.2 (2018-03-08)
+
+### Bug fixes
+
+A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0.
+
+## 5.5.1 (2018-03-06)
+
+### Bug fixes
+
+Fix misleading error message for octal escapes in template strings.
+
+## 5.5.0 (2018-02-27)
+
+### New features
+
+The identifier character categorization is now based on Unicode version 10.
+
+Acorn will now validate the content of regular expressions, including new ES9 features.
+
+## 5.4.0 (2018-02-01)
+
+### Bug fixes
+
+Disallow duplicate or escaped flags on regular expressions.
+
+Disallow octal escapes in strings in strict mode.
+
+### New features
+
+Add support for async iteration.
+
+Add support for object spread and rest.
+
+## 5.3.0 (2017-12-28)
+
+### Bug fixes
+
+Fix parsing of floating point literals with leading zeroes in loose mode.
+
+Allow duplicate property names in object patterns.
+
+Don't allow static class methods named `prototype`.
+
+Disallow async functions directly under `if` or `else`.
+
+Parse right-hand-side of `for`/`of` as an assignment expression.
+
+Stricter parsing of `for`/`in`.
+
+Don't allow unicode escapes in contextual keywords.
+
+### New features
+
+Parsing class members was factored into smaller methods to allow plugins to hook into it.
+
+## 5.2.1 (2017-10-30)
+
+### Bug fixes
+
+Fix a token context corruption bug.
+
+## 5.2.0 (2017-10-30)
+
+### Bug fixes
+
+Fix token context tracking for `class` and `function` in property-name position.
+
+Make sure `%*` isn't parsed as a valid operator.
+
+Allow shorthand properties `get` and `set` to be followed by default values.
+
+Disallow `super` when not in callee or object position.
+
+### New features
+
+Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
+
+## 5.1.2 (2017-09-04)
+
+### Bug fixes
+
+Disable parsing of legacy HTML-style comments in modules.
+
+Fix parsing of async methods whose names are keywords.
+
+## 5.1.1 (2017-07-06)
+
+### Bug fixes
+
+Fix problem with disambiguating regexp and division after a class.
+
+## 5.1.0 (2017-07-05)
+
+### Bug fixes
+
+Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
+
+Parse zero-prefixed numbers with non-octal digits as decimal.
+
+Allow object/array patterns in rest parameters.
+
+Don't error when `yield` is used as a property name.
+
+Allow `async` as a shorthand object property.
+
+### New features
+
+Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
+
+## 5.0.3 (2017-04-01)
+
+### Bug fixes
+
+Fix spurious duplicate variable definition errors for named functions.
+
+## 5.0.2 (2017-03-30)
+
+### Bug fixes
+
+A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
+
+## 5.0.0 (2017-03-28)
+
+### Bug fixes
+
+Raise an error for duplicated lexical bindings.
+
+Fix spurious error when an assignement expression occurred after a spread expression.
+
+Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
+
+Allow labels in front or `var` declarations, even in strict mode.
+
+### Breaking changes
+
+Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.
+
+## 4.0.11 (2017-02-07)
+
+### Bug fixes
+
+Allow all forms of member expressions to be parenthesized as lvalue.
+
+## 4.0.10 (2017-02-07)
+
+### Bug fixes
+
+Don't expect semicolons after default-exported functions or classes, even when they are expressions.
+
+Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
+
+## 4.0.9 (2017-02-06)
+
+### Bug fixes
+
+Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
+
+## 4.0.8 (2017-02-03)
+
+### Bug fixes
+
+Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
+
+## 4.0.7 (2017-02-02)
+
+### Bug fixes
+
+Accept invalidly rejected code like `(x).y = 2` again.
+
+Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
+
+## 4.0.6 (2017-02-02)
+
+### Bug fixes
+
+Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
+
+## 4.0.5 (2017-02-02)
+
+### Bug fixes
+
+Disallow parenthesized pattern expressions.
+
+Allow keywords as export names.
+
+Don't allow the `async` keyword to be parenthesized.
+
+Properly raise an error when a keyword contains a character escape.
+
+Allow `"use strict"` to appear after other string literal expressions.
+
+Disallow labeled declarations.
+
+## 4.0.4 (2016-12-19)
+
+### Bug fixes
+
+Fix crash when `export` was followed by a keyword that can't be
+exported.
+
+## 4.0.3 (2016-08-16)
+
+### Bug fixes
+
+Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
+
+Properly parse properties named `async` in ES2017 mode.
+
+Fix bug where reserved words were broken in ES2017 mode.
+
+## 4.0.2 (2016-08-11)
+
+### Bug fixes
+
+Don't ignore period or 'e' characters after octal numbers.
+
+Fix broken parsing for call expressions in default parameter values of arrow functions.
+
+## 4.0.1 (2016-08-08)
+
+### Bug fixes
+
+Fix false positives in duplicated export name errors.
+
+## 4.0.0 (2016-08-07)
+
+### Breaking changes
+
+The default `ecmaVersion` option value is now 7.
+
+A number of internal method signatures changed, so plugins might need to be updated.
+
+### Bug fixes
+
+The parser now raises errors on duplicated export names.
+
+`arguments` and `eval` can now be used in shorthand properties.
+
+Duplicate parameter names in non-simple argument lists now always produce an error.
+
+### New features
+
+The `ecmaVersion` option now also accepts year-style version numbers
+(2015, etc).
+
+Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
+
+Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
+
+## 3.3.0 (2016-07-25)
+
+### Bug fixes
+
+Fix bug in tokenizing of regexp operator after a function declaration.
+
+Fix parser crash when parsing an array pattern with a hole.
+
+### New features
+
+Implement check against complex argument lists in functions that enable strict mode in ES7.
+
+## 3.2.0 (2016-06-07)
+
+### Bug fixes
+
+Improve handling of lack of unicode regexp support in host
+environment.
+
+Properly reject shorthand properties whose name is a keyword.
+
+### New features
+
+Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
+
+## 3.1.0 (2016-04-18)
+
+### Bug fixes
+
+Properly tokenize the division operator directly after a function expression.
+
+Allow trailing comma in destructuring arrays.
+
+## 3.0.4 (2016-02-25)
+
+### Fixes
+
+Allow update expressions as left-hand-side of the ES7 exponential operator.
+
+## 3.0.2 (2016-02-10)
+
+### Fixes
+
+Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
+
+## 3.0.0 (2016-02-10)
+
+### Breaking changes
+
+The default value of the `ecmaVersion` option is now 6 (used to be 5).
+
+Support for comprehension syntax (which was dropped from the draft spec) has been removed.
+
+### Fixes
+
+`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
+
+A parenthesized class or function expression after `export default` is now parsed correctly.
+
+### New features
+
+When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
+
+The identifier character ranges are now based on Unicode 8.0.0.
+
+Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
+
+## 2.7.0 (2016-01-04)
+
+### Fixes
+
+Stop allowing rest parameters in setters.
+
+Disallow `y` rexexp flag in ES5.
+
+Disallow `\00` and `\000` escapes in strict mode.
+
+Raise an error when an import name is a reserved word.
+
+## 2.6.2 (2015-11-10)
+
+### Fixes
+
+Don't crash when no options object is passed.
+
+## 2.6.0 (2015-11-09)
+
+### Fixes
+
+Add `await` as a reserved word in module sources.
+
+Disallow `yield` in a parameter default value for a generator.
+
+Forbid using a comma after a rest pattern in an array destructuring.
+
+### New features
+
+Support parsing stdin in command-line tool.
+
+## 2.5.0 (2015-10-27)
+
+### Fixes
+
+Fix tokenizer support in the command-line tool.
+
+Stop allowing `new.target` outside of functions.
+
+Remove legacy `guard` and `guardedHandler` properties from try nodes.
+
+Stop allowing multiple `__proto__` properties on an object literal in strict mode.
+
+Don't allow rest parameters to be non-identifier patterns.
+
+Check for duplicate paramter names in arrow functions.
diff --git a/node_modules/acorn/LICENSE b/node_modules/acorn/LICENSE
new file mode 100644
index 0000000..9d71cc6
--- /dev/null
+++ b/node_modules/acorn/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (C) 2012-2022 by various contributors (see AUTHORS)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/acorn/README.md b/node_modules/acorn/README.md
new file mode 100644
index 0000000..f7ff966
--- /dev/null
+++ b/node_modules/acorn/README.md
@@ -0,0 +1,282 @@
+# Acorn
+
+A tiny, fast JavaScript parser written in JavaScript.
+
+## Community
+
+Acorn is open source software released under an
+[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE).
+
+You are welcome to
+[report bugs](https://github.com/acornjs/acorn/issues) or create pull
+requests on [github](https://github.com/acornjs/acorn).
+
+## Installation
+
+The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):
+
+```sh
+npm install acorn
+```
+
+Alternately, you can download the source and build acorn yourself:
+
+```sh
+git clone https://github.com/acornjs/acorn.git
+cd acorn
+npm install
+```
+
+## Interface
+
+**parse**`(input, options)` is the main interface to the library. The
+`input` parameter is a string, `options` must be an object setting
+some of the options listed below. The return value will be an abstract
+syntax tree object as specified by the [ESTree
+spec](https://github.com/estree/estree).
+
+```javascript
+let acorn = require("acorn");
+console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}));
+```
+
+When encountering a syntax error, the parser will raise a
+`SyntaxError` object with a meaningful message. The error object will
+have a `pos` property that indicates the string offset at which the
+error occurred, and a `loc` object that contains a `{line, column}`
+object referring to that same position.
+
+Options are provided by in a second argument, which should be an
+object containing any of these fields (only `ecmaVersion` is
+required):
+
+- **ecmaVersion**: Indicates the ECMAScript version to parse. Can be a
+  number, either in year (`2022`) or plain version number (`6`) form,
+  or `"latest"` (the latest the library supports). This influences
+  support for strict mode, the set of reserved words, and support for
+  new syntax features.
+
+  **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
+  implemented by Acorn. Other proposed new features must be
+  implemented through plugins.
+
+- **sourceType**: Indicate the mode the code should be parsed in. Can be
+  either `"script"` or `"module"`. This influences global strict mode
+  and parsing of `import` and `export` declarations.
+
+  **NOTE**: If set to `"module"`, then static `import` / `export` syntax
+  will be valid, even if `ecmaVersion` is less than 6.
+
+- **onInsertedSemicolon**: If given a callback, that callback will be
+  called whenever a missing semicolon is inserted by the parser. The
+  callback will be given the character offset of the point where the
+  semicolon is inserted as argument, and if `locations` is on, also a
+  `{line, column}` object representing this position.
+
+- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
+  commas.
+
+- **allowReserved**: If `false`, using a reserved word will generate
+  an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
+  versions. When given the value `"never"`, reserved words and
+  keywords can also not be used as property names (as in Internet
+  Explorer's old parser).
+
+- **allowReturnOutsideFunction**: By default, a return statement at
+  the top level raises an error. Set this to `true` to accept such
+  code.
+
+- **allowImportExportEverywhere**: By default, `import` and `export`
+  declarations can only appear at a program's top level. Setting this
+  option to `true` allows them anywhere where a statement is allowed,
+  and also allows `import.meta` expressions to appear in scripts
+  (when `sourceType` is not `"module"`).
+
+- **allowAwaitOutsideFunction**: If `false`, `await` expressions can
+  only appear inside `async` functions. Defaults to `true` in modules
+  for `ecmaVersion` 2022 and later, `false` for lower versions.
+  Setting this option to `true` allows to have top-level `await`
+  expressions. They are still not allowed in non-`async` functions,
+  though.
+
+- **allowSuperOutsideMethod**: By default, `super` outside a method
+  raises an error. Set this to `true` to accept such code.
+
+- **allowHashBang**: When this is enabled, if the code starts with the
+  characters `#!` (as in a shellscript), the first line will be
+  treated as a comment. Defaults to true when `ecmaVersion` >= 2023.
+
+- **checkPrivateFields**: By default, the parser will verify that
+  private properties are only used in places where they are valid and
+  have been declared. Set this to false to turn such checks off.
+
+- **locations**: When `true`, each node has a `loc` object attached
+  with `start` and `end` subobjects, each of which contains the
+  one-based line and zero-based column numbers in `{line, column}`
+  form. Default is `false`.
+
+- **onToken**: If a function is passed for this option, each found
+  token will be passed in same format as tokens returned from
+  `tokenizer().getToken()`.
+
+  If array is passed, each found token is pushed to it.
+
+  Note that you are not allowed to call the parser from the
+  callback—that will corrupt its internal state.
+
+- **onComment**: If a function is passed for this option, whenever a
+  comment is encountered the function will be called with the
+  following parameters:
+
+  - `block`: `true` if the comment is a block comment, false if it
+    is a line comment.
+  - `text`: The content of the comment.
+  - `start`: Character offset of the start of the comment.
+  - `end`: Character offset of the end of the comment.
+
+  When the `locations` options is on, the `{line, column}` locations
+  of the comment’s start and end are passed as two additional
+  parameters.
+
+  If array is passed for this option, each found comment is pushed
+  to it as object in Esprima format:
+
+  ```javascript
+  {
+    "type": "Line" | "Block",
+    "value": "comment text",
+    "start": Number,
+    "end": Number,
+    // If `locations` option is on:
+    "loc": {
+      "start": {line: Number, column: Number}
+      "end": {line: Number, column: Number}
+    },
+    // If `ranges` option is on:
+    "range": [Number, Number]
+  }
+  ```
+
+  Note that you are not allowed to call the parser from the
+  callback—that will corrupt its internal state.
+
+- **ranges**: Nodes have their start and end characters offsets
+  recorded in `start` and `end` properties (directly on the node,
+  rather than the `loc` object, which holds line/column data. To also
+  add a
+  [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678)
+  `range` property holding a `[start, end]` array with the same
+  numbers, set the `ranges` option to `true`.
+
+- **program**: It is possible to parse multiple files into a single
+  AST by passing the tree produced by parsing the first file as the
+  `program` option in subsequent parses. This will add the toplevel
+  forms of the parsed file to the "Program" (top) node of an existing
+  parse tree.
+
+- **sourceFile**: When the `locations` option is `true`, you can pass
+  this option to add a `source` attribute in every node’s `loc`
+  object. Note that the contents of this option are not examined or
+  processed in any way; you are free to use whatever format you
+  choose.
+
+- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
+  will be added (regardless of the `location` option) directly to the
+  nodes, rather than the `loc` object.
+
+- **preserveParens**: If this option is `true`, parenthesized expressions
+  are represented by (non-standard) `ParenthesizedExpression` nodes
+  that have a single `expression` property containing the expression
+  inside parentheses.
+
+**parseExpressionAt**`(input, offset, options)` will parse a single
+expression in a string, and return its AST. It will not complain if
+there is more of the string left after the expression.
+
+**tokenizer**`(input, options)` returns an object with a `getToken`
+method that can be called repeatedly to get the next token, a `{start,
+end, type, value}` object (with added `loc` property when the
+`locations` option is enabled and `range` property when the `ranges`
+option is enabled). When the token's type is `tokTypes.eof`, you
+should stop calling the method, since it will keep returning that same
+token forever.
+
+Note that tokenizing JavaScript without parsing it is, in modern
+versions of the language, not really possible due to the way syntax is
+overloaded in ways that can only be disambiguated by the parse
+context. This package applies a bunch of heuristics to try and do a
+reasonable job, but you are advised to use `parse` with the `onToken`
+option instead of this.
+
+In ES6 environment, returned result can be used as any other
+protocol-compliant iterable:
+
+```javascript
+for (let token of acorn.tokenizer(str)) {
+  // iterate over the tokens
+}
+
+// transform code to array of tokens:
+var tokens = [...acorn.tokenizer(str)];
+```
+
+**tokTypes** holds an object mapping names to the token type objects
+that end up in the `type` properties of tokens.
+
+**getLineInfo**`(input, offset)` can be used to get a `{line,
+column}` object for a given program string and offset.
+
+### The `Parser` class
+
+Instances of the **`Parser`** class contain all the state and logic
+that drives a parse. It has static methods `parse`,
+`parseExpressionAt`, and `tokenizer` that match the top-level
+functions by the same name.
+
+When extending the parser with plugins, you need to call these methods
+on the extended version of the class. To extend a parser with plugins,
+you can use its static `extend` method.
+
+```javascript
+var acorn = require("acorn");
+var jsx = require("acorn-jsx");
+var JSXParser = acorn.Parser.extend(jsx());
+JSXParser.parse("foo()", {ecmaVersion: 2020});
+```
+
+The `extend` method takes any number of plugin values, and returns a
+new `Parser` class that includes the extra parser logic provided by
+the plugins.
+
+## Command line interface
+
+The `bin/acorn` utility can be used to parse a file from the command
+line. It accepts as arguments its input file and the following
+options:
+
+- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
+  to parse. Default is version 9.
+
+- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
+
+- `--locations`: Attaches a "loc" object to each node with "start" and
+  "end" subobjects, each of which contains the one-based line and
+  zero-based column numbers in `{line, column}` form.
+
+- `--allow-hash-bang`: If the code starts with the characters #! (as
+  in a shellscript), the first line will be treated as a comment.
+
+- `--allow-await-outside-function`: Allows top-level `await` expressions.
+  See the `allowAwaitOutsideFunction` option for more information.
+
+- `--compact`: No whitespace is used in the AST output.
+
+- `--silent`: Do not output the AST, just return the exit status.
+
+- `--help`: Print the usage information and quit.
+
+The utility spits out the syntax tree as JSON data.
+
+## Existing plugins
+
+ - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
diff --git a/node_modules/acorn/dist/acorn.d.mts b/node_modules/acorn/dist/acorn.d.mts
new file mode 100644
index 0000000..81f4e38
--- /dev/null
+++ b/node_modules/acorn/dist/acorn.d.mts
@@ -0,0 +1,866 @@
+export interface Node {
+  start: number
+  end: number
+  type: string
+  range?: [number, number]
+  loc?: SourceLocation | null
+}
+
+export interface SourceLocation {
+  source?: string | null
+  start: Position
+  end: Position
+}
+
+export interface Position {
+  /** 1-based */
+  line: number
+  /** 0-based */
+  column: number
+}
+
+export interface Identifier extends Node {
+  type: "Identifier"
+  name: string
+}
+
+export interface Literal extends Node {
+  type: "Literal"
+  value?: string | boolean | null | number | RegExp | bigint
+  raw?: string
+  regex?: {
+    pattern: string
+    flags: string
+  }
+  bigint?: string
+}
+
+export interface Program extends Node {
+  type: "Program"
+  body: Array
+  sourceType: "script" | "module"
+}
+
+export interface Function extends Node {
+  id?: Identifier | null
+  params: Array
+  body: BlockStatement | Expression
+  generator: boolean
+  expression: boolean
+  async: boolean
+}
+
+export interface ExpressionStatement extends Node {
+  type: "ExpressionStatement"
+  expression: Expression | Literal
+  directive?: string
+}
+
+export interface BlockStatement extends Node {
+  type: "BlockStatement"
+  body: Array
+}
+
+export interface EmptyStatement extends Node {
+  type: "EmptyStatement"
+}
+
+export interface DebuggerStatement extends Node {
+  type: "DebuggerStatement"
+}
+
+export interface WithStatement extends Node {
+  type: "WithStatement"
+  object: Expression
+  body: Statement
+}
+
+export interface ReturnStatement extends Node {
+  type: "ReturnStatement"
+  argument?: Expression | null
+}
+
+export interface LabeledStatement extends Node {
+  type: "LabeledStatement"
+  label: Identifier
+  body: Statement
+}
+
+export interface BreakStatement extends Node {
+  type: "BreakStatement"
+  label?: Identifier | null
+}
+
+export interface ContinueStatement extends Node {
+  type: "ContinueStatement"
+  label?: Identifier | null
+}
+
+export interface IfStatement extends Node {
+  type: "IfStatement"
+  test: Expression
+  consequent: Statement
+  alternate?: Statement | null
+}
+
+export interface SwitchStatement extends Node {
+  type: "SwitchStatement"
+  discriminant: Expression
+  cases: Array
+}
+
+export interface SwitchCase extends Node {
+  type: "SwitchCase"
+  test?: Expression | null
+  consequent: Array
+}
+
+export interface ThrowStatement extends Node {
+  type: "ThrowStatement"
+  argument: Expression
+}
+
+export interface TryStatement extends Node {
+  type: "TryStatement"
+  block: BlockStatement
+  handler?: CatchClause | null
+  finalizer?: BlockStatement | null
+}
+
+export interface CatchClause extends Node {
+  type: "CatchClause"
+  param?: Pattern | null
+  body: BlockStatement
+}
+
+export interface WhileStatement extends Node {
+  type: "WhileStatement"
+  test: Expression
+  body: Statement
+}
+
+export interface DoWhileStatement extends Node {
+  type: "DoWhileStatement"
+  body: Statement
+  test: Expression
+}
+
+export interface ForStatement extends Node {
+  type: "ForStatement"
+  init?: VariableDeclaration | Expression | null
+  test?: Expression | null
+  update?: Expression | null
+  body: Statement
+}
+
+export interface ForInStatement extends Node {
+  type: "ForInStatement"
+  left: VariableDeclaration | Pattern
+  right: Expression
+  body: Statement
+}
+
+export interface FunctionDeclaration extends Function {
+  type: "FunctionDeclaration"
+  id: Identifier
+  body: BlockStatement
+}
+
+export interface VariableDeclaration extends Node {
+  type: "VariableDeclaration"
+  declarations: Array
+  kind: "var" | "let" | "const"
+}
+
+export interface VariableDeclarator extends Node {
+  type: "VariableDeclarator"
+  id: Pattern
+  init?: Expression | null
+}
+
+export interface ThisExpression extends Node {
+  type: "ThisExpression"
+}
+
+export interface ArrayExpression extends Node {
+  type: "ArrayExpression"
+  elements: Array
+}
+
+export interface ObjectExpression extends Node {
+  type: "ObjectExpression"
+  properties: Array
+}
+
+export interface Property extends Node {
+  type: "Property"
+  key: Expression
+  value: Expression
+  kind: "init" | "get" | "set"
+  method: boolean
+  shorthand: boolean
+  computed: boolean
+}
+
+export interface FunctionExpression extends Function {
+  type: "FunctionExpression"
+  body: BlockStatement
+}
+
+export interface UnaryExpression extends Node {
+  type: "UnaryExpression"
+  operator: UnaryOperator
+  prefix: boolean
+  argument: Expression
+}
+
+export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"
+
+export interface UpdateExpression extends Node {
+  type: "UpdateExpression"
+  operator: UpdateOperator
+  argument: Expression
+  prefix: boolean
+}
+
+export type UpdateOperator = "++" | "--"
+
+export interface BinaryExpression extends Node {
+  type: "BinaryExpression"
+  operator: BinaryOperator
+  left: Expression | PrivateIdentifier
+  right: Expression
+}
+
+export type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in" | "instanceof" | "**"
+
+export interface AssignmentExpression extends Node {
+  type: "AssignmentExpression"
+  operator: AssignmentOperator
+  left: Pattern
+  right: Expression
+}
+
+export type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??="
+
+export interface LogicalExpression extends Node {
+  type: "LogicalExpression"
+  operator: LogicalOperator
+  left: Expression
+  right: Expression
+}
+
+export type LogicalOperator = "||" | "&&" | "??"
+
+export interface MemberExpression extends Node {
+  type: "MemberExpression"
+  object: Expression | Super
+  property: Expression | PrivateIdentifier
+  computed: boolean
+  optional: boolean
+}
+
+export interface ConditionalExpression extends Node {
+  type: "ConditionalExpression"
+  test: Expression
+  alternate: Expression
+  consequent: Expression
+}
+
+export interface CallExpression extends Node {
+  type: "CallExpression"
+  callee: Expression | Super
+  arguments: Array
+  optional: boolean
+}
+
+export interface NewExpression extends Node {
+  type: "NewExpression"
+  callee: Expression
+  arguments: Array
+}
+
+export interface SequenceExpression extends Node {
+  type: "SequenceExpression"
+  expressions: Array
+}
+
+export interface ForOfStatement extends Node {
+  type: "ForOfStatement"
+  left: VariableDeclaration | Pattern
+  right: Expression
+  body: Statement
+  await: boolean
+}
+
+export interface Super extends Node {
+  type: "Super"
+}
+
+export interface SpreadElement extends Node {
+  type: "SpreadElement"
+  argument: Expression
+}
+
+export interface ArrowFunctionExpression extends Function {
+  type: "ArrowFunctionExpression"
+}
+
+export interface YieldExpression extends Node {
+  type: "YieldExpression"
+  argument?: Expression | null
+  delegate: boolean
+}
+
+export interface TemplateLiteral extends Node {
+  type: "TemplateLiteral"
+  quasis: Array
+  expressions: Array
+}
+
+export interface TaggedTemplateExpression extends Node {
+  type: "TaggedTemplateExpression"
+  tag: Expression
+  quasi: TemplateLiteral
+}
+
+export interface TemplateElement extends Node {
+  type: "TemplateElement"
+  tail: boolean
+  value: {
+    cooked?: string | null
+    raw: string
+  }
+}
+
+export interface AssignmentProperty extends Node {
+  type: "Property"
+  key: Expression
+  value: Pattern
+  kind: "init"
+  method: false
+  shorthand: boolean
+  computed: boolean
+}
+
+export interface ObjectPattern extends Node {
+  type: "ObjectPattern"
+  properties: Array
+}
+
+export interface ArrayPattern extends Node {
+  type: "ArrayPattern"
+  elements: Array
+}
+
+export interface RestElement extends Node {
+  type: "RestElement"
+  argument: Pattern
+}
+
+export interface AssignmentPattern extends Node {
+  type: "AssignmentPattern"
+  left: Pattern
+  right: Expression
+}
+
+export interface Class extends Node {
+  id?: Identifier | null
+  superClass?: Expression | null
+  body: ClassBody
+}
+
+export interface ClassBody extends Node {
+  type: "ClassBody"
+  body: Array
+}
+
+export interface MethodDefinition extends Node {
+  type: "MethodDefinition"
+  key: Expression | PrivateIdentifier
+  value: FunctionExpression
+  kind: "constructor" | "method" | "get" | "set"
+  computed: boolean
+  static: boolean
+}
+
+export interface ClassDeclaration extends Class {
+  type: "ClassDeclaration"
+  id: Identifier
+}
+
+export interface ClassExpression extends Class {
+  type: "ClassExpression"
+}
+
+export interface MetaProperty extends Node {
+  type: "MetaProperty"
+  meta: Identifier
+  property: Identifier
+}
+
+export interface ImportDeclaration extends Node {
+  type: "ImportDeclaration"
+  specifiers: Array
+  source: Literal
+  attributes: Array
+}
+
+export interface ImportSpecifier extends Node {
+  type: "ImportSpecifier"
+  imported: Identifier | Literal
+  local: Identifier
+}
+
+export interface ImportDefaultSpecifier extends Node {
+  type: "ImportDefaultSpecifier"
+  local: Identifier
+}
+
+export interface ImportNamespaceSpecifier extends Node {
+  type: "ImportNamespaceSpecifier"
+  local: Identifier
+}
+
+export interface ImportAttribute extends Node {
+  type: "ImportAttribute"
+  key: Identifier | Literal
+  value: Literal
+}
+
+export interface ExportNamedDeclaration extends Node {
+  type: "ExportNamedDeclaration"
+  declaration?: Declaration | null
+  specifiers: Array
+  source?: Literal | null
+  attributes: Array
+}
+
+export interface ExportSpecifier extends Node {
+  type: "ExportSpecifier"
+  exported: Identifier | Literal
+  local: Identifier | Literal
+}
+
+export interface AnonymousFunctionDeclaration extends Function {
+  type: "FunctionDeclaration"
+  id: null
+  body: BlockStatement
+}
+
+export interface AnonymousClassDeclaration extends Class {
+  type: "ClassDeclaration"
+  id: null
+}
+
+export interface ExportDefaultDeclaration extends Node {
+  type: "ExportDefaultDeclaration"
+  declaration: AnonymousFunctionDeclaration | FunctionDeclaration | AnonymousClassDeclaration | ClassDeclaration | Expression
+}
+
+export interface ExportAllDeclaration extends Node {
+  type: "ExportAllDeclaration"
+  source: Literal
+  exported?: Identifier | Literal | null
+  attributes: Array
+}
+
+export interface AwaitExpression extends Node {
+  type: "AwaitExpression"
+  argument: Expression
+}
+
+export interface ChainExpression extends Node {
+  type: "ChainExpression"
+  expression: MemberExpression | CallExpression
+}
+
+export interface ImportExpression extends Node {
+  type: "ImportExpression"
+  source: Expression
+  options: Expression | null
+}
+
+export interface ParenthesizedExpression extends Node {
+  type: "ParenthesizedExpression"
+  expression: Expression
+}
+
+export interface PropertyDefinition extends Node {
+  type: "PropertyDefinition"
+  key: Expression | PrivateIdentifier
+  value?: Expression | null
+  computed: boolean
+  static: boolean
+}
+
+export interface PrivateIdentifier extends Node {
+  type: "PrivateIdentifier"
+  name: string
+}
+
+export interface StaticBlock extends Node {
+  type: "StaticBlock"
+  body: Array
+}
+
+export type Statement = 
+| ExpressionStatement
+| BlockStatement
+| EmptyStatement
+| DebuggerStatement
+| WithStatement
+| ReturnStatement
+| LabeledStatement
+| BreakStatement
+| ContinueStatement
+| IfStatement
+| SwitchStatement
+| ThrowStatement
+| TryStatement
+| WhileStatement
+| DoWhileStatement
+| ForStatement
+| ForInStatement
+| ForOfStatement
+| Declaration
+
+export type Declaration = 
+| FunctionDeclaration
+| VariableDeclaration
+| ClassDeclaration
+
+export type Expression = 
+| Identifier
+| Literal
+| ThisExpression
+| ArrayExpression
+| ObjectExpression
+| FunctionExpression
+| UnaryExpression
+| UpdateExpression
+| BinaryExpression
+| AssignmentExpression
+| LogicalExpression
+| MemberExpression
+| ConditionalExpression
+| CallExpression
+| NewExpression
+| SequenceExpression
+| ArrowFunctionExpression
+| YieldExpression
+| TemplateLiteral
+| TaggedTemplateExpression
+| ClassExpression
+| MetaProperty
+| AwaitExpression
+| ChainExpression
+| ImportExpression
+| ParenthesizedExpression
+
+export type Pattern = 
+| Identifier
+| MemberExpression
+| ObjectPattern
+| ArrayPattern
+| RestElement
+| AssignmentPattern
+
+export type ModuleDeclaration = 
+| ImportDeclaration
+| ExportNamedDeclaration
+| ExportDefaultDeclaration
+| ExportAllDeclaration
+
+export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportAttribute | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator
+
+export function parse(input: string, options: Options): Program
+
+export function parseExpressionAt(input: string, pos: number, options: Options): Expression
+
+export function tokenizer(input: string, options: Options): {
+  getToken(): Token
+  [Symbol.iterator](): Iterator
+}
+
+export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | "latest"
+
+export interface Options {
+  /**
+   * `ecmaVersion` indicates the ECMAScript version to parse. Can be a
+   * number, either in year (`2022`) or plain version number (`6`) form,
+   * or `"latest"` (the latest the library supports). This influences
+   * support for strict mode, the set of reserved words, and support for
+   * new syntax features.
+   */
+  ecmaVersion: ecmaVersion
+
+  /**
+   * `sourceType` indicates the mode the code should be parsed in.
+   * Can be either `"script"` or `"module"`. This influences global
+   * strict mode and parsing of `import` and `export` declarations.
+   */
+  sourceType?: "script" | "module"
+
+  /**
+   * a callback that will be called when a semicolon is automatically inserted.
+   * @param lastTokEnd the position of the comma as an offset
+   * @param lastTokEndLoc location if {@link locations} is enabled
+   */
+  onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
+
+  /**
+   * similar to `onInsertedSemicolon`, but for trailing commas
+   * @param lastTokEnd the position of the comma as an offset
+   * @param lastTokEndLoc location if `locations` is enabled
+   */
+  onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
+
+  /**
+   * By default, reserved words are only enforced if ecmaVersion >= 5.
+   * Set `allowReserved` to a boolean value to explicitly turn this on
+   * an off. When this option has the value "never", reserved words
+   * and keywords can also not be used as property names.
+   */
+  allowReserved?: boolean | "never"
+
+  /** 
+   * When enabled, a return at the top level is not considered an error.
+   */
+  allowReturnOutsideFunction?: boolean
+
+  /**
+   * When enabled, import/export statements are not constrained to
+   * appearing at the top of the program, and an import.meta expression
+   * in a script isn't considered an error.
+   */
+  allowImportExportEverywhere?: boolean
+
+  /**
+   * By default, `await` identifiers are allowed to appear at the top-level scope only if {@link ecmaVersion} >= 2022.
+   * When enabled, await identifiers are allowed to appear at the top-level scope,
+   * but they are still not allowed in non-async functions.
+   */
+  allowAwaitOutsideFunction?: boolean
+
+  /**
+   * When enabled, super identifiers are not constrained to
+   * appearing in methods and do not raise an error when they appear elsewhere.
+   */
+  allowSuperOutsideMethod?: boolean
+
+  /**
+   * When enabled, hashbang directive in the beginning of file is
+   * allowed and treated as a line comment. Enabled by default when
+   * {@link ecmaVersion} >= 2023.
+   */
+  allowHashBang?: boolean
+
+  /**
+   * By default, the parser will verify that private properties are
+   * only used in places where they are valid and have been declared.
+   * Set this to false to turn such checks off.
+   */
+  checkPrivateFields?: boolean
+
+  /**
+   * When `locations` is on, `loc` properties holding objects with
+   * `start` and `end` properties as {@link Position} objects will be attached to the
+   * nodes.
+   */
+  locations?: boolean
+
+  /**
+   * a callback that will cause Acorn to call that export function with object in the same
+   * format as tokens returned from `tokenizer().getToken()`. Note
+   * that you are not allowed to call the parser from the
+   * callback—that will corrupt its internal state.
+   */
+  onToken?: ((token: Token) => void) | Token[]
+
+
+  /**
+   * This takes a export function or an array.
+   * 
+   * When a export function is passed, Acorn will call that export function with `(block, text, start,
+   * end)` parameters whenever a comment is skipped. `block` is a
+   * boolean indicating whether this is a block (`/* *\/`) comment,
+   * `text` is the content of the comment, and `start` and `end` are
+   * character offsets that denote the start and end of the comment.
+   * When the {@link locations} option is on, two more parameters are
+   * passed, the full locations of {@link Position} export type of the start and
+   * end of the comments.
+   * 
+   * When a array is passed, each found comment of {@link Comment} export type is pushed to the array.
+   * 
+   * Note that you are not allowed to call the
+   * parser from the callback—that will corrupt its internal state.
+   */
+  onComment?: ((
+    isBlock: boolean, text: string, start: number, end: number, startLoc?: Position,
+    endLoc?: Position
+  ) => void) | Comment[]
+
+  /**
+   * Nodes have their start and end characters offsets recorded in
+   * `start` and `end` properties (directly on the node, rather than
+   * the `loc` object, which holds line/column data. To also add a
+   * [semi-standardized][range] `range` property holding a `[start,
+   * end]` array with the same numbers, set the `ranges` option to
+   * `true`.
+   */
+  ranges?: boolean
+
+  /**
+   * It is possible to parse multiple files into a single AST by
+   * passing the tree produced by parsing the first file as
+   * `program` option in subsequent parses. This will add the
+   * toplevel forms of the parsed file to the `Program` (top) node
+   * of an existing parse tree.
+   */
+  program?: Node
+
+  /**
+   * When {@link locations} is on, you can pass this to record the source
+   * file in every node's `loc` object.
+   */
+  sourceFile?: string
+
+  /**
+   * This value, if given, is stored in every node, whether {@link locations} is on or off.
+   */
+  directSourceFile?: string
+
+  /**
+   * When enabled, parenthesized expressions are represented by
+   * (non-standard) ParenthesizedExpression nodes
+   */
+  preserveParens?: boolean
+}
+  
+export class Parser {
+  options: Options
+  input: string
+  
+  protected constructor(options: Options, input: string, startPos?: number)
+  parse(): Program
+  
+  static parse(input: string, options: Options): Program
+  static parseExpressionAt(input: string, pos: number, options: Options): Expression
+  static tokenizer(input: string, options: Options): {
+    getToken(): Token
+    [Symbol.iterator](): Iterator
+  }
+  static extend(...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser
+}
+
+export const defaultOptions: Options
+
+export function getLineInfo(input: string, offset: number): Position
+
+export class TokenType {
+  label: string
+  keyword: string | undefined
+}
+
+export const tokTypes: {
+  num: TokenType
+  regexp: TokenType
+  string: TokenType
+  name: TokenType
+  privateId: TokenType
+  eof: TokenType
+
+  bracketL: TokenType
+  bracketR: TokenType
+  braceL: TokenType
+  braceR: TokenType
+  parenL: TokenType
+  parenR: TokenType
+  comma: TokenType
+  semi: TokenType
+  colon: TokenType
+  dot: TokenType
+  question: TokenType
+  questionDot: TokenType
+  arrow: TokenType
+  template: TokenType
+  invalidTemplate: TokenType
+  ellipsis: TokenType
+  backQuote: TokenType
+  dollarBraceL: TokenType
+
+  eq: TokenType
+  assign: TokenType
+  incDec: TokenType
+  prefix: TokenType
+  logicalOR: TokenType
+  logicalAND: TokenType
+  bitwiseOR: TokenType
+  bitwiseXOR: TokenType
+  bitwiseAND: TokenType
+  equality: TokenType
+  relational: TokenType
+  bitShift: TokenType
+  plusMin: TokenType
+  modulo: TokenType
+  star: TokenType
+  slash: TokenType
+  starstar: TokenType
+  coalesce: TokenType
+
+  _break: TokenType
+  _case: TokenType
+  _catch: TokenType
+  _continue: TokenType
+  _debugger: TokenType
+  _default: TokenType
+  _do: TokenType
+  _else: TokenType
+  _finally: TokenType
+  _for: TokenType
+  _function: TokenType
+  _if: TokenType
+  _return: TokenType
+  _switch: TokenType
+  _throw: TokenType
+  _try: TokenType
+  _var: TokenType
+  _const: TokenType
+  _while: TokenType
+  _with: TokenType
+  _new: TokenType
+  _this: TokenType
+  _super: TokenType
+  _class: TokenType
+  _extends: TokenType
+  _export: TokenType
+  _import: TokenType
+  _null: TokenType
+  _true: TokenType
+  _false: TokenType
+  _in: TokenType
+  _instanceof: TokenType
+  _typeof: TokenType
+  _void: TokenType
+  _delete: TokenType
+}
+
+export interface Comment {
+  type: "Line" | "Block"
+  value: string
+  start: number
+  end: number
+  loc?: SourceLocation
+  range?: [number, number]
+}
+
+export class Token {
+  type: TokenType
+  start: number
+  end: number
+  loc?: SourceLocation
+  range?: [number, number]
+}
+
+export const version: string
diff --git a/node_modules/acorn/dist/acorn.js b/node_modules/acorn/dist/acorn.js
new file mode 100644
index 0000000..2bfc15b
--- /dev/null
+++ b/node_modules/acorn/dist/acorn.js
@@ -0,0 +1,6174 @@
+(function (global, factory) {
+  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+  typeof define === 'function' && define.amd ? define(['exports'], factory) :
+  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.acorn = {}));
+})(this, (function (exports) { 'use strict';
+
+  // This file was generated. Do not modify manually!
+  var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+  // This file was generated. Do not modify manually!
+  var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
+
+  // This file was generated. Do not modify manually!
+  var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";
+
+  // This file was generated. Do not modify manually!
+  var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+
+  // These are a run-length and offset encoded representation of the
+  // >0xffff code points that are a valid part of identifiers. The
+  // offset starts at 0x10000, and each pair of numbers represents an
+  // offset to the next range, and then a size of the range.
+
+  // Reserved word lists for various dialects of the language
+
+  var reservedWords = {
+    3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
+    5: "class enum extends super const export import",
+    6: "enum",
+    strict: "implements interface let package private protected public static yield",
+    strictBind: "eval arguments"
+  };
+
+  // And the keywords
+
+  var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
+
+  var keywords$1 = {
+    5: ecma5AndLessKeywords,
+    "5module": ecma5AndLessKeywords + " export import",
+    6: ecma5AndLessKeywords + " const class extends export import super"
+  };
+
+  var keywordRelationalOperator = /^in(stanceof)?$/;
+
+  // ## Character categories
+
+  var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+  var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+
+  // This has a complexity linear to the value of the code. The
+  // assumption is that looking up astral identifier characters is
+  // rare.
+  function isInAstralSet(code, set) {
+    var pos = 0x10000;
+    for (var i = 0; i < set.length; i += 2) {
+      pos += set[i];
+      if (pos > code) { return false }
+      pos += set[i + 1];
+      if (pos >= code) { return true }
+    }
+    return false
+  }
+
+  // Test whether a given character code starts an identifier.
+
+  function isIdentifierStart(code, astral) {
+    if (code < 65) { return code === 36 }
+    if (code < 91) { return true }
+    if (code < 97) { return code === 95 }
+    if (code < 123) { return true }
+    if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
+    if (astral === false) { return false }
+    return isInAstralSet(code, astralIdentifierStartCodes)
+  }
+
+  // Test whether a given character is part of an identifier.
+
+  function isIdentifierChar(code, astral) {
+    if (code < 48) { return code === 36 }
+    if (code < 58) { return true }
+    if (code < 65) { return false }
+    if (code < 91) { return true }
+    if (code < 97) { return code === 95 }
+    if (code < 123) { return true }
+    if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
+    if (astral === false) { return false }
+    return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
+  }
+
+  // ## Token types
+
+  // The assignment of fine-grained, information-carrying type objects
+  // allows the tokenizer to store the information it has about a
+  // token in a way that is very cheap for the parser to look up.
+
+  // All token type variables start with an underscore, to make them
+  // easy to recognize.
+
+  // The `beforeExpr` property is used to disambiguate between regular
+  // expressions and divisions. It is set on all token types that can
+  // be followed by an expression (thus, a slash after them would be a
+  // regular expression).
+  //
+  // The `startsExpr` property is used to check if the token ends a
+  // `yield` expression. It is set on all token types that either can
+  // directly start an expression (like a quotation mark) or can
+  // continue an expression (like the body of a string).
+  //
+  // `isLoop` marks a keyword as starting a loop, which is important
+  // to know when parsing a label, in order to allow or disallow
+  // continue jumps to that label.
+
+  var TokenType = function TokenType(label, conf) {
+    if ( conf === void 0 ) conf = {};
+
+    this.label = label;
+    this.keyword = conf.keyword;
+    this.beforeExpr = !!conf.beforeExpr;
+    this.startsExpr = !!conf.startsExpr;
+    this.isLoop = !!conf.isLoop;
+    this.isAssign = !!conf.isAssign;
+    this.prefix = !!conf.prefix;
+    this.postfix = !!conf.postfix;
+    this.binop = conf.binop || null;
+    this.updateContext = null;
+  };
+
+  function binop(name, prec) {
+    return new TokenType(name, {beforeExpr: true, binop: prec})
+  }
+  var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};
+
+  // Map keyword names to token types.
+
+  var keywords = {};
+
+  // Succinct definitions of keyword token types
+  function kw(name, options) {
+    if ( options === void 0 ) options = {};
+
+    options.keyword = name;
+    return keywords[name] = new TokenType(name, options)
+  }
+
+  var types$1 = {
+    num: new TokenType("num", startsExpr),
+    regexp: new TokenType("regexp", startsExpr),
+    string: new TokenType("string", startsExpr),
+    name: new TokenType("name", startsExpr),
+    privateId: new TokenType("privateId", startsExpr),
+    eof: new TokenType("eof"),
+
+    // Punctuation token types.
+    bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
+    bracketR: new TokenType("]"),
+    braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
+    braceR: new TokenType("}"),
+    parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
+    parenR: new TokenType(")"),
+    comma: new TokenType(",", beforeExpr),
+    semi: new TokenType(";", beforeExpr),
+    colon: new TokenType(":", beforeExpr),
+    dot: new TokenType("."),
+    question: new TokenType("?", beforeExpr),
+    questionDot: new TokenType("?."),
+    arrow: new TokenType("=>", beforeExpr),
+    template: new TokenType("template"),
+    invalidTemplate: new TokenType("invalidTemplate"),
+    ellipsis: new TokenType("...", beforeExpr),
+    backQuote: new TokenType("`", startsExpr),
+    dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),
+
+    // Operators. These carry several kinds of properties to help the
+    // parser use them properly (the presence of these properties is
+    // what categorizes them as operators).
+    //
+    // `binop`, when present, specifies that this operator is a binary
+    // operator, and will refer to its precedence.
+    //
+    // `prefix` and `postfix` mark the operator as a prefix or postfix
+    // unary operator.
+    //
+    // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
+    // binary operators with a very low precedence, that should result
+    // in AssignmentExpression nodes.
+
+    eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
+    assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
+    incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
+    prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
+    logicalOR: binop("||", 1),
+    logicalAND: binop("&&", 2),
+    bitwiseOR: binop("|", 3),
+    bitwiseXOR: binop("^", 4),
+    bitwiseAND: binop("&", 5),
+    equality: binop("==/!=/===/!==", 6),
+    relational: binop("/<=/>=", 7),
+    bitShift: binop("<>/>>>", 8),
+    plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
+    modulo: binop("%", 10),
+    star: binop("*", 10),
+    slash: binop("/", 10),
+    starstar: new TokenType("**", {beforeExpr: true}),
+    coalesce: binop("??", 1),
+
+    // Keyword token types.
+    _break: kw("break"),
+    _case: kw("case", beforeExpr),
+    _catch: kw("catch"),
+    _continue: kw("continue"),
+    _debugger: kw("debugger"),
+    _default: kw("default", beforeExpr),
+    _do: kw("do", {isLoop: true, beforeExpr: true}),
+    _else: kw("else", beforeExpr),
+    _finally: kw("finally"),
+    _for: kw("for", {isLoop: true}),
+    _function: kw("function", startsExpr),
+    _if: kw("if"),
+    _return: kw("return", beforeExpr),
+    _switch: kw("switch"),
+    _throw: kw("throw", beforeExpr),
+    _try: kw("try"),
+    _var: kw("var"),
+    _const: kw("const"),
+    _while: kw("while", {isLoop: true}),
+    _with: kw("with"),
+    _new: kw("new", {beforeExpr: true, startsExpr: true}),
+    _this: kw("this", startsExpr),
+    _super: kw("super", startsExpr),
+    _class: kw("class", startsExpr),
+    _extends: kw("extends", beforeExpr),
+    _export: kw("export"),
+    _import: kw("import", startsExpr),
+    _null: kw("null", startsExpr),
+    _true: kw("true", startsExpr),
+    _false: kw("false", startsExpr),
+    _in: kw("in", {beforeExpr: true, binop: 7}),
+    _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
+    _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
+    _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
+    _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
+  };
+
+  // Matches a whole line break (where CRLF is considered a single
+  // line break). Used to count lines.
+
+  var lineBreak = /\r\n?|\n|\u2028|\u2029/;
+  var lineBreakG = new RegExp(lineBreak.source, "g");
+
+  function isNewLine(code) {
+    return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
+  }
+
+  function nextLineBreak(code, from, end) {
+    if ( end === void 0 ) end = code.length;
+
+    for (var i = from; i < end; i++) {
+      var next = code.charCodeAt(i);
+      if (isNewLine(next))
+        { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
+    }
+    return -1
+  }
+
+  var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
+
+  var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+
+  var ref = Object.prototype;
+  var hasOwnProperty = ref.hasOwnProperty;
+  var toString = ref.toString;
+
+  var hasOwn = Object.hasOwn || (function (obj, propName) { return (
+    hasOwnProperty.call(obj, propName)
+  ); });
+
+  var isArray = Array.isArray || (function (obj) { return (
+    toString.call(obj) === "[object Array]"
+  ); });
+
+  var regexpCache = Object.create(null);
+
+  function wordsRegexp(words) {
+    return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"))
+  }
+
+  function codePointToString(code) {
+    // UTF-16 Decoding
+    if (code <= 0xFFFF) { return String.fromCharCode(code) }
+    code -= 0x10000;
+    return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
+  }
+
+  var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
+
+  // These are used when `options.locations` is on, for the
+  // `startLoc` and `endLoc` properties.
+
+  var Position = function Position(line, col) {
+    this.line = line;
+    this.column = col;
+  };
+
+  Position.prototype.offset = function offset (n) {
+    return new Position(this.line, this.column + n)
+  };
+
+  var SourceLocation = function SourceLocation(p, start, end) {
+    this.start = start;
+    this.end = end;
+    if (p.sourceFile !== null) { this.source = p.sourceFile; }
+  };
+
+  // The `getLineInfo` function is mostly useful when the
+  // `locations` option is off (for performance reasons) and you
+  // want to find the line/column position for a given character
+  // offset. `input` should be the code string that the offset refers
+  // into.
+
+  function getLineInfo(input, offset) {
+    for (var line = 1, cur = 0;;) {
+      var nextBreak = nextLineBreak(input, cur, offset);
+      if (nextBreak < 0) { return new Position(line, offset - cur) }
+      ++line;
+      cur = nextBreak;
+    }
+  }
+
+  // A second argument must be given to configure the parser process.
+  // These options are recognized (only `ecmaVersion` is required):
+
+  var defaultOptions = {
+    // `ecmaVersion` indicates the ECMAScript version to parse. Must be
+    // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
+    // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
+    // (the latest version the library supports). This influences
+    // support for strict mode, the set of reserved words, and support
+    // for new syntax features.
+    ecmaVersion: null,
+    // `sourceType` indicates the mode the code should be parsed in.
+    // Can be either `"script"` or `"module"`. This influences global
+    // strict mode and parsing of `import` and `export` declarations.
+    sourceType: "script",
+    // `onInsertedSemicolon` can be a callback that will be called when
+    // a semicolon is automatically inserted. It will be passed the
+    // position of the inserted semicolon as an offset, and if
+    // `locations` is enabled, it is given the location as a `{line,
+    // column}` object as second argument.
+    onInsertedSemicolon: null,
+    // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
+    // trailing commas.
+    onTrailingComma: null,
+    // By default, reserved words are only enforced if ecmaVersion >= 5.
+    // Set `allowReserved` to a boolean value to explicitly turn this on
+    // an off. When this option has the value "never", reserved words
+    // and keywords can also not be used as property names.
+    allowReserved: null,
+    // When enabled, a return at the top level is not considered an
+    // error.
+    allowReturnOutsideFunction: false,
+    // When enabled, import/export statements are not constrained to
+    // appearing at the top of the program, and an import.meta expression
+    // in a script isn't considered an error.
+    allowImportExportEverywhere: false,
+    // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
+    // When enabled, await identifiers are allowed to appear at the top-level scope,
+    // but they are still not allowed in non-async functions.
+    allowAwaitOutsideFunction: null,
+    // When enabled, super identifiers are not constrained to
+    // appearing in methods and do not raise an error when they appear elsewhere.
+    allowSuperOutsideMethod: null,
+    // When enabled, hashbang directive in the beginning of file is
+    // allowed and treated as a line comment. Enabled by default when
+    // `ecmaVersion` >= 2023.
+    allowHashBang: false,
+    // By default, the parser will verify that private properties are
+    // only used in places where they are valid and have been declared.
+    // Set this to false to turn such checks off.
+    checkPrivateFields: true,
+    // When `locations` is on, `loc` properties holding objects with
+    // `start` and `end` properties in `{line, column}` form (with
+    // line being 1-based and column 0-based) will be attached to the
+    // nodes.
+    locations: false,
+    // A function can be passed as `onToken` option, which will
+    // cause Acorn to call that function with object in the same
+    // format as tokens returned from `tokenizer().getToken()`. Note
+    // that you are not allowed to call the parser from the
+    // callback—that will corrupt its internal state.
+    onToken: null,
+    // A function can be passed as `onComment` option, which will
+    // cause Acorn to call that function with `(block, text, start,
+    // end)` parameters whenever a comment is skipped. `block` is a
+    // boolean indicating whether this is a block (`/* */`) comment,
+    // `text` is the content of the comment, and `start` and `end` are
+    // character offsets that denote the start and end of the comment.
+    // When the `locations` option is on, two more parameters are
+    // passed, the full `{line, column}` locations of the start and
+    // end of the comments. Note that you are not allowed to call the
+    // parser from the callback—that will corrupt its internal state.
+    // When this option has an array as value, objects representing the
+    // comments are pushed to it.
+    onComment: null,
+    // Nodes have their start and end characters offsets recorded in
+    // `start` and `end` properties (directly on the node, rather than
+    // the `loc` object, which holds line/column data. To also add a
+    // [semi-standardized][range] `range` property holding a `[start,
+    // end]` array with the same numbers, set the `ranges` option to
+    // `true`.
+    //
+    // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
+    ranges: false,
+    // It is possible to parse multiple files into a single AST by
+    // passing the tree produced by parsing the first file as
+    // `program` option in subsequent parses. This will add the
+    // toplevel forms of the parsed file to the `Program` (top) node
+    // of an existing parse tree.
+    program: null,
+    // When `locations` is on, you can pass this to record the source
+    // file in every node's `loc` object.
+    sourceFile: null,
+    // This value, if given, is stored in every node, whether
+    // `locations` is on or off.
+    directSourceFile: null,
+    // When enabled, parenthesized expressions are represented by
+    // (non-standard) ParenthesizedExpression nodes
+    preserveParens: false
+  };
+
+  // Interpret and default an options object
+
+  var warnedAboutEcmaVersion = false;
+
+  function getOptions(opts) {
+    var options = {};
+
+    for (var opt in defaultOptions)
+      { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }
+
+    if (options.ecmaVersion === "latest") {
+      options.ecmaVersion = 1e8;
+    } else if (options.ecmaVersion == null) {
+      if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
+        warnedAboutEcmaVersion = true;
+        console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
+      }
+      options.ecmaVersion = 11;
+    } else if (options.ecmaVersion >= 2015) {
+      options.ecmaVersion -= 2009;
+    }
+
+    if (options.allowReserved == null)
+      { options.allowReserved = options.ecmaVersion < 5; }
+
+    if (!opts || opts.allowHashBang == null)
+      { options.allowHashBang = options.ecmaVersion >= 14; }
+
+    if (isArray(options.onToken)) {
+      var tokens = options.onToken;
+      options.onToken = function (token) { return tokens.push(token); };
+    }
+    if (isArray(options.onComment))
+      { options.onComment = pushComment(options, options.onComment); }
+
+    return options
+  }
+
+  function pushComment(options, array) {
+    return function(block, text, start, end, startLoc, endLoc) {
+      var comment = {
+        type: block ? "Block" : "Line",
+        value: text,
+        start: start,
+        end: end
+      };
+      if (options.locations)
+        { comment.loc = new SourceLocation(this, startLoc, endLoc); }
+      if (options.ranges)
+        { comment.range = [start, end]; }
+      array.push(comment);
+    }
+  }
+
+  // Each scope gets a bitset that may contain these flags
+  var
+      SCOPE_TOP = 1,
+      SCOPE_FUNCTION = 2,
+      SCOPE_ASYNC = 4,
+      SCOPE_GENERATOR = 8,
+      SCOPE_ARROW = 16,
+      SCOPE_SIMPLE_CATCH = 32,
+      SCOPE_SUPER = 64,
+      SCOPE_DIRECT_SUPER = 128,
+      SCOPE_CLASS_STATIC_BLOCK = 256,
+      SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
+
+  function functionFlags(async, generator) {
+    return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
+  }
+
+  // Used in checkLVal* and declareName to determine the type of a binding
+  var
+      BIND_NONE = 0, // Not a binding
+      BIND_VAR = 1, // Var-style binding
+      BIND_LEXICAL = 2, // Let- or const-style binding
+      BIND_FUNCTION = 3, // Function declaration
+      BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
+      BIND_OUTSIDE = 5; // Special case for function names as bound inside the function
+
+  var Parser = function Parser(options, input, startPos) {
+    this.options = options = getOptions(options);
+    this.sourceFile = options.sourceFile;
+    this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
+    var reserved = "";
+    if (options.allowReserved !== true) {
+      reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
+      if (options.sourceType === "module") { reserved += " await"; }
+    }
+    this.reservedWords = wordsRegexp(reserved);
+    var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
+    this.reservedWordsStrict = wordsRegexp(reservedStrict);
+    this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
+    this.input = String(input);
+
+    // Used to signal to callers of `readWord1` whether the word
+    // contained any escape sequences. This is needed because words with
+    // escape sequences must not be interpreted as keywords.
+    this.containsEsc = false;
+
+    // Set up token state
+
+    // The current position of the tokenizer in the input.
+    if (startPos) {
+      this.pos = startPos;
+      this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
+      this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
+    } else {
+      this.pos = this.lineStart = 0;
+      this.curLine = 1;
+    }
+
+    // Properties of the current token:
+    // Its type
+    this.type = types$1.eof;
+    // For tokens that include more information than their type, the value
+    this.value = null;
+    // Its start and end offset
+    this.start = this.end = this.pos;
+    // And, if locations are used, the {line, column} object
+    // corresponding to those offsets
+    this.startLoc = this.endLoc = this.curPosition();
+
+    // Position information for the previous token
+    this.lastTokEndLoc = this.lastTokStartLoc = null;
+    this.lastTokStart = this.lastTokEnd = this.pos;
+
+    // The context stack is used to superficially track syntactic
+    // context to predict whether a regular expression is allowed in a
+    // given position.
+    this.context = this.initialContext();
+    this.exprAllowed = true;
+
+    // Figure out if it's a module code.
+    this.inModule = options.sourceType === "module";
+    this.strict = this.inModule || this.strictDirective(this.pos);
+
+    // Used to signify the start of a potential arrow function
+    this.potentialArrowAt = -1;
+    this.potentialArrowInForAwait = false;
+
+    // Positions to delayed-check that yield/await does not exist in default parameters.
+    this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
+    // Labels in scope.
+    this.labels = [];
+    // Thus-far undefined exports.
+    this.undefinedExports = Object.create(null);
+
+    // If enabled, skip leading hashbang line.
+    if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
+      { this.skipLineComment(2); }
+
+    // Scope tracking for duplicate variable names (see scope.js)
+    this.scopeStack = [];
+    this.enterScope(SCOPE_TOP);
+
+    // For RegExp validation
+    this.regexpState = null;
+
+    // The stack of private names.
+    // Each element has two properties: 'declared' and 'used'.
+    // When it exited from the outermost class definition, all used private names must be declared.
+    this.privateNameStack = [];
+  };
+
+  var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } };
+
+  Parser.prototype.parse = function parse () {
+    var node = this.options.program || this.startNode();
+    this.nextToken();
+    return this.parseTopLevel(node)
+  };
+
+  prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
+
+  prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit };
+
+  prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit };
+
+  prototypeAccessors.canAwait.get = function () {
+    for (var i = this.scopeStack.length - 1; i >= 0; i--) {
+      var scope = this.scopeStack[i];
+      if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false }
+      if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 }
+    }
+    return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
+  };
+
+  prototypeAccessors.allowSuper.get = function () {
+    var ref = this.currentThisScope();
+      var flags = ref.flags;
+      var inClassFieldInit = ref.inClassFieldInit;
+    return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod
+  };
+
+  prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
+
+  prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
+
+  prototypeAccessors.allowNewDotTarget.get = function () {
+    var ref = this.currentThisScope();
+      var flags = ref.flags;
+      var inClassFieldInit = ref.inClassFieldInit;
+    return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit
+  };
+
+  prototypeAccessors.inClassStaticBlock.get = function () {
+    return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0
+  };
+
+  Parser.extend = function extend () {
+      var plugins = [], len = arguments.length;
+      while ( len-- ) plugins[ len ] = arguments[ len ];
+
+    var cls = this;
+    for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
+    return cls
+  };
+
+  Parser.parse = function parse (input, options) {
+    return new this(options, input).parse()
+  };
+
+  Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
+    var parser = new this(options, input, pos);
+    parser.nextToken();
+    return parser.parseExpression()
+  };
+
+  Parser.tokenizer = function tokenizer (input, options) {
+    return new this(options, input)
+  };
+
+  Object.defineProperties( Parser.prototype, prototypeAccessors );
+
+  var pp$9 = Parser.prototype;
+
+  // ## Parser utilities
+
+  var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
+  pp$9.strictDirective = function(start) {
+    if (this.options.ecmaVersion < 5) { return false }
+    for (;;) {
+      // Try to find string literal.
+      skipWhiteSpace.lastIndex = start;
+      start += skipWhiteSpace.exec(this.input)[0].length;
+      var match = literal.exec(this.input.slice(start));
+      if (!match) { return false }
+      if ((match[1] || match[2]) === "use strict") {
+        skipWhiteSpace.lastIndex = start + match[0].length;
+        var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
+        var next = this.input.charAt(end);
+        return next === ";" || next === "}" ||
+          (lineBreak.test(spaceAfter[0]) &&
+           !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
+      }
+      start += match[0].length;
+
+      // Skip semicolon, if any.
+      skipWhiteSpace.lastIndex = start;
+      start += skipWhiteSpace.exec(this.input)[0].length;
+      if (this.input[start] === ";")
+        { start++; }
+    }
+  };
+
+  // Predicate that tests whether the next token is of the given
+  // type, and if yes, consumes it as a side effect.
+
+  pp$9.eat = function(type) {
+    if (this.type === type) {
+      this.next();
+      return true
+    } else {
+      return false
+    }
+  };
+
+  // Tests whether parsed token is a contextual keyword.
+
+  pp$9.isContextual = function(name) {
+    return this.type === types$1.name && this.value === name && !this.containsEsc
+  };
+
+  // Consumes contextual keyword if possible.
+
+  pp$9.eatContextual = function(name) {
+    if (!this.isContextual(name)) { return false }
+    this.next();
+    return true
+  };
+
+  // Asserts that following token is given contextual keyword.
+
+  pp$9.expectContextual = function(name) {
+    if (!this.eatContextual(name)) { this.unexpected(); }
+  };
+
+  // Test whether a semicolon can be inserted at the current position.
+
+  pp$9.canInsertSemicolon = function() {
+    return this.type === types$1.eof ||
+      this.type === types$1.braceR ||
+      lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
+  };
+
+  pp$9.insertSemicolon = function() {
+    if (this.canInsertSemicolon()) {
+      if (this.options.onInsertedSemicolon)
+        { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
+      return true
+    }
+  };
+
+  // Consume a semicolon, or, failing that, see if we are allowed to
+  // pretend that there is a semicolon at this position.
+
+  pp$9.semicolon = function() {
+    if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }
+  };
+
+  pp$9.afterTrailingComma = function(tokType, notNext) {
+    if (this.type === tokType) {
+      if (this.options.onTrailingComma)
+        { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
+      if (!notNext)
+        { this.next(); }
+      return true
+    }
+  };
+
+  // Expect a token of a given type. If found, consume it, otherwise,
+  // raise an unexpected token error.
+
+  pp$9.expect = function(type) {
+    this.eat(type) || this.unexpected();
+  };
+
+  // Raise an unexpected token error.
+
+  pp$9.unexpected = function(pos) {
+    this.raise(pos != null ? pos : this.start, "Unexpected token");
+  };
+
+  var DestructuringErrors = function DestructuringErrors() {
+    this.shorthandAssign =
+    this.trailingComma =
+    this.parenthesizedAssign =
+    this.parenthesizedBind =
+    this.doubleProto =
+      -1;
+  };
+
+  pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
+    if (!refDestructuringErrors) { return }
+    if (refDestructuringErrors.trailingComma > -1)
+      { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
+    var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
+    if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); }
+  };
+
+  pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
+    if (!refDestructuringErrors) { return false }
+    var shorthandAssign = refDestructuringErrors.shorthandAssign;
+    var doubleProto = refDestructuringErrors.doubleProto;
+    if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
+    if (shorthandAssign >= 0)
+      { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
+    if (doubleProto >= 0)
+      { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
+  };
+
+  pp$9.checkYieldAwaitInDefaultParams = function() {
+    if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
+      { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
+    if (this.awaitPos)
+      { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
+  };
+
+  pp$9.isSimpleAssignTarget = function(expr) {
+    if (expr.type === "ParenthesizedExpression")
+      { return this.isSimpleAssignTarget(expr.expression) }
+    return expr.type === "Identifier" || expr.type === "MemberExpression"
+  };
+
+  var pp$8 = Parser.prototype;
+
+  // ### Statement parsing
+
+  // Parse a program. Initializes the parser, reads any number of
+  // statements, and wraps them in a Program node.  Optionally takes a
+  // `program` argument.  If present, the statements will be appended
+  // to its body instead of creating a new node.
+
+  pp$8.parseTopLevel = function(node) {
+    var exports = Object.create(null);
+    if (!node.body) { node.body = []; }
+    while (this.type !== types$1.eof) {
+      var stmt = this.parseStatement(null, true, exports);
+      node.body.push(stmt);
+    }
+    if (this.inModule)
+      { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
+        {
+          var name = list[i];
+
+          this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
+        } }
+    this.adaptDirectivePrologue(node.body);
+    this.next();
+    node.sourceType = this.options.sourceType;
+    return this.finishNode(node, "Program")
+  };
+
+  var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};
+
+  pp$8.isLet = function(context) {
+    if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
+    skipWhiteSpace.lastIndex = this.pos;
+    var skip = skipWhiteSpace.exec(this.input);
+    var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
+    // For ambiguous cases, determine if a LexicalDeclaration (or only a
+    // Statement) is allowed here. If context is not empty then only a Statement
+    // is allowed. However, `let [` is an explicit negative lookahead for
+    // ExpressionStatement, so special-case it first.
+    if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
+    if (context) { return false }
+
+    if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral
+    if (isIdentifierStart(nextCh, true)) {
+      var pos = next + 1;
+      while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; }
+      if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true }
+      var ident = this.input.slice(next, pos);
+      if (!keywordRelationalOperator.test(ident)) { return true }
+    }
+    return false
+  };
+
+  // check 'async [no LineTerminator here] function'
+  // - 'async /*foo*/ function' is OK.
+  // - 'async /*\n*/ function' is invalid.
+  pp$8.isAsyncFunction = function() {
+    if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
+      { return false }
+
+    skipWhiteSpace.lastIndex = this.pos;
+    var skip = skipWhiteSpace.exec(this.input);
+    var next = this.pos + skip[0].length, after;
+    return !lineBreak.test(this.input.slice(this.pos, next)) &&
+      this.input.slice(next, next + 8) === "function" &&
+      (next + 8 === this.input.length ||
+       !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))
+  };
+
+  // Parse a single statement.
+  //
+  // If expecting a statement and finding a slash operator, parse a
+  // regular expression literal. This is to handle cases like
+  // `if (foo) /blah/.exec(foo)`, where looking at the previous token
+  // does not help.
+
+  pp$8.parseStatement = function(context, topLevel, exports) {
+    var starttype = this.type, node = this.startNode(), kind;
+
+    if (this.isLet(context)) {
+      starttype = types$1._var;
+      kind = "let";
+    }
+
+    // Most types of statements are recognized by the keyword they
+    // start with. Many are trivial to parse, some require a bit of
+    // complexity.
+
+    switch (starttype) {
+    case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
+    case types$1._debugger: return this.parseDebuggerStatement(node)
+    case types$1._do: return this.parseDoStatement(node)
+    case types$1._for: return this.parseForStatement(node)
+    case types$1._function:
+      // Function as sole body of either an if statement or a labeled statement
+      // works, but not when it is part of a labeled statement that is the sole
+      // body of an if statement.
+      if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
+      return this.parseFunctionStatement(node, false, !context)
+    case types$1._class:
+      if (context) { this.unexpected(); }
+      return this.parseClass(node, true)
+    case types$1._if: return this.parseIfStatement(node)
+    case types$1._return: return this.parseReturnStatement(node)
+    case types$1._switch: return this.parseSwitchStatement(node)
+    case types$1._throw: return this.parseThrowStatement(node)
+    case types$1._try: return this.parseTryStatement(node)
+    case types$1._const: case types$1._var:
+      kind = kind || this.value;
+      if (context && kind !== "var") { this.unexpected(); }
+      return this.parseVarStatement(node, kind)
+    case types$1._while: return this.parseWhileStatement(node)
+    case types$1._with: return this.parseWithStatement(node)
+    case types$1.braceL: return this.parseBlock(true, node)
+    case types$1.semi: return this.parseEmptyStatement(node)
+    case types$1._export:
+    case types$1._import:
+      if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
+        skipWhiteSpace.lastIndex = this.pos;
+        var skip = skipWhiteSpace.exec(this.input);
+        var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
+        if (nextCh === 40 || nextCh === 46) // '(' or '.'
+          { return this.parseExpressionStatement(node, this.parseExpression()) }
+      }
+
+      if (!this.options.allowImportExportEverywhere) {
+        if (!topLevel)
+          { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
+        if (!this.inModule)
+          { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
+      }
+      return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)
+
+      // If the statement does not start with a statement keyword or a
+      // brace, it's an ExpressionStatement or LabeledStatement. We
+      // simply start parsing an expression, and afterwards, if the
+      // next token is a colon and the expression was a simple
+      // Identifier node, we switch to interpreting it as a label.
+    default:
+      if (this.isAsyncFunction()) {
+        if (context) { this.unexpected(); }
+        this.next();
+        return this.parseFunctionStatement(node, true, !context)
+      }
+
+      var maybeName = this.value, expr = this.parseExpression();
+      if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon))
+        { return this.parseLabeledStatement(node, maybeName, expr, context) }
+      else { return this.parseExpressionStatement(node, expr) }
+    }
+  };
+
+  pp$8.parseBreakContinueStatement = function(node, keyword) {
+    var isBreak = keyword === "break";
+    this.next();
+    if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }
+    else if (this.type !== types$1.name) { this.unexpected(); }
+    else {
+      node.label = this.parseIdent();
+      this.semicolon();
+    }
+
+    // Verify that there is an actual destination to break or
+    // continue to.
+    var i = 0;
+    for (; i < this.labels.length; ++i) {
+      var lab = this.labels[i];
+      if (node.label == null || lab.name === node.label.name) {
+        if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
+        if (node.label && isBreak) { break }
+      }
+    }
+    if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
+    return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
+  };
+
+  pp$8.parseDebuggerStatement = function(node) {
+    this.next();
+    this.semicolon();
+    return this.finishNode(node, "DebuggerStatement")
+  };
+
+  pp$8.parseDoStatement = function(node) {
+    this.next();
+    this.labels.push(loopLabel);
+    node.body = this.parseStatement("do");
+    this.labels.pop();
+    this.expect(types$1._while);
+    node.test = this.parseParenExpression();
+    if (this.options.ecmaVersion >= 6)
+      { this.eat(types$1.semi); }
+    else
+      { this.semicolon(); }
+    return this.finishNode(node, "DoWhileStatement")
+  };
+
+  // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
+  // loop is non-trivial. Basically, we have to parse the init `var`
+  // statement or expression, disallowing the `in` operator (see
+  // the second parameter to `parseExpression`), and then check
+  // whether the next token is `in` or `of`. When there is no init
+  // part (semicolon immediately after the opening parenthesis), it
+  // is a regular `for` loop.
+
+  pp$8.parseForStatement = function(node) {
+    this.next();
+    var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1;
+    this.labels.push(loopLabel);
+    this.enterScope(0);
+    this.expect(types$1.parenL);
+    if (this.type === types$1.semi) {
+      if (awaitAt > -1) { this.unexpected(awaitAt); }
+      return this.parseFor(node, null)
+    }
+    var isLet = this.isLet();
+    if (this.type === types$1._var || this.type === types$1._const || isLet) {
+      var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
+      this.next();
+      this.parseVar(init$1, true, kind);
+      this.finishNode(init$1, "VariableDeclaration");
+      if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {
+        if (this.options.ecmaVersion >= 9) {
+          if (this.type === types$1._in) {
+            if (awaitAt > -1) { this.unexpected(awaitAt); }
+          } else { node.await = awaitAt > -1; }
+        }
+        return this.parseForIn(node, init$1)
+      }
+      if (awaitAt > -1) { this.unexpected(awaitAt); }
+      return this.parseFor(node, init$1)
+    }
+    var startsWithLet = this.isContextual("let"), isForOf = false;
+    var containsEsc = this.containsEsc;
+    var refDestructuringErrors = new DestructuringErrors;
+    var initPos = this.start;
+    var init = awaitAt > -1
+      ? this.parseExprSubscripts(refDestructuringErrors, "await")
+      : this.parseExpression(true, refDestructuringErrors);
+    if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
+      if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)
+        if (this.type === types$1._in) { this.unexpected(awaitAt); }
+        node.await = true;
+      } else if (isForOf && this.options.ecmaVersion >= 8) {
+        if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); }
+        else if (this.options.ecmaVersion >= 9) { node.await = false; }
+      }
+      if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
+      this.toAssignable(init, false, refDestructuringErrors);
+      this.checkLValPattern(init);
+      return this.parseForIn(node, init)
+    } else {
+      this.checkExpressionErrors(refDestructuringErrors, true);
+    }
+    if (awaitAt > -1) { this.unexpected(awaitAt); }
+    return this.parseFor(node, init)
+  };
+
+  pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
+    this.next();
+    return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
+  };
+
+  pp$8.parseIfStatement = function(node) {
+    this.next();
+    node.test = this.parseParenExpression();
+    // allow function declarations in branches, but only in non-strict mode
+    node.consequent = this.parseStatement("if");
+    node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
+    return this.finishNode(node, "IfStatement")
+  };
+
+  pp$8.parseReturnStatement = function(node) {
+    if (!this.inFunction && !this.options.allowReturnOutsideFunction)
+      { this.raise(this.start, "'return' outside of function"); }
+    this.next();
+
+    // In `return` (and `break`/`continue`), the keywords with
+    // optional arguments, we eagerly look for a semicolon or the
+    // possibility to insert one.
+
+    if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }
+    else { node.argument = this.parseExpression(); this.semicolon(); }
+    return this.finishNode(node, "ReturnStatement")
+  };
+
+  pp$8.parseSwitchStatement = function(node) {
+    this.next();
+    node.discriminant = this.parseParenExpression();
+    node.cases = [];
+    this.expect(types$1.braceL);
+    this.labels.push(switchLabel);
+    this.enterScope(0);
+
+    // Statements under must be grouped (by label) in SwitchCase
+    // nodes. `cur` is used to keep the node that we are currently
+    // adding statements to.
+
+    var cur;
+    for (var sawDefault = false; this.type !== types$1.braceR;) {
+      if (this.type === types$1._case || this.type === types$1._default) {
+        var isCase = this.type === types$1._case;
+        if (cur) { this.finishNode(cur, "SwitchCase"); }
+        node.cases.push(cur = this.startNode());
+        cur.consequent = [];
+        this.next();
+        if (isCase) {
+          cur.test = this.parseExpression();
+        } else {
+          if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
+          sawDefault = true;
+          cur.test = null;
+        }
+        this.expect(types$1.colon);
+      } else {
+        if (!cur) { this.unexpected(); }
+        cur.consequent.push(this.parseStatement(null));
+      }
+    }
+    this.exitScope();
+    if (cur) { this.finishNode(cur, "SwitchCase"); }
+    this.next(); // Closing brace
+    this.labels.pop();
+    return this.finishNode(node, "SwitchStatement")
+  };
+
+  pp$8.parseThrowStatement = function(node) {
+    this.next();
+    if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
+      { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
+    node.argument = this.parseExpression();
+    this.semicolon();
+    return this.finishNode(node, "ThrowStatement")
+  };
+
+  // Reused empty array added for node fields that are always empty.
+
+  var empty$1 = [];
+
+  pp$8.parseCatchClauseParam = function() {
+    var param = this.parseBindingAtom();
+    var simple = param.type === "Identifier";
+    this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
+    this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
+    this.expect(types$1.parenR);
+
+    return param
+  };
+
+  pp$8.parseTryStatement = function(node) {
+    this.next();
+    node.block = this.parseBlock();
+    node.handler = null;
+    if (this.type === types$1._catch) {
+      var clause = this.startNode();
+      this.next();
+      if (this.eat(types$1.parenL)) {
+        clause.param = this.parseCatchClauseParam();
+      } else {
+        if (this.options.ecmaVersion < 10) { this.unexpected(); }
+        clause.param = null;
+        this.enterScope(0);
+      }
+      clause.body = this.parseBlock(false);
+      this.exitScope();
+      node.handler = this.finishNode(clause, "CatchClause");
+    }
+    node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
+    if (!node.handler && !node.finalizer)
+      { this.raise(node.start, "Missing catch or finally clause"); }
+    return this.finishNode(node, "TryStatement")
+  };
+
+  pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
+    this.next();
+    this.parseVar(node, false, kind, allowMissingInitializer);
+    this.semicolon();
+    return this.finishNode(node, "VariableDeclaration")
+  };
+
+  pp$8.parseWhileStatement = function(node) {
+    this.next();
+    node.test = this.parseParenExpression();
+    this.labels.push(loopLabel);
+    node.body = this.parseStatement("while");
+    this.labels.pop();
+    return this.finishNode(node, "WhileStatement")
+  };
+
+  pp$8.parseWithStatement = function(node) {
+    if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
+    this.next();
+    node.object = this.parseParenExpression();
+    node.body = this.parseStatement("with");
+    return this.finishNode(node, "WithStatement")
+  };
+
+  pp$8.parseEmptyStatement = function(node) {
+    this.next();
+    return this.finishNode(node, "EmptyStatement")
+  };
+
+  pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
+    for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
+      {
+      var label = list[i$1];
+
+      if (label.name === maybeName)
+        { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
+    } }
+    var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
+    for (var i = this.labels.length - 1; i >= 0; i--) {
+      var label$1 = this.labels[i];
+      if (label$1.statementStart === node.start) {
+        // Update information about previous labels on this node
+        label$1.statementStart = this.start;
+        label$1.kind = kind;
+      } else { break }
+    }
+    this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
+    node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
+    this.labels.pop();
+    node.label = expr;
+    return this.finishNode(node, "LabeledStatement")
+  };
+
+  pp$8.parseExpressionStatement = function(node, expr) {
+    node.expression = expr;
+    this.semicolon();
+    return this.finishNode(node, "ExpressionStatement")
+  };
+
+  // Parse a semicolon-enclosed block of statements, handling `"use
+  // strict"` declarations when `allowStrict` is true (used for
+  // function bodies).
+
+  pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {
+    if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
+    if ( node === void 0 ) node = this.startNode();
+
+    node.body = [];
+    this.expect(types$1.braceL);
+    if (createNewLexicalScope) { this.enterScope(0); }
+    while (this.type !== types$1.braceR) {
+      var stmt = this.parseStatement(null);
+      node.body.push(stmt);
+    }
+    if (exitStrict) { this.strict = false; }
+    this.next();
+    if (createNewLexicalScope) { this.exitScope(); }
+    return this.finishNode(node, "BlockStatement")
+  };
+
+  // Parse a regular `for` loop. The disambiguation code in
+  // `parseStatement` will already have parsed the init statement or
+  // expression.
+
+  pp$8.parseFor = function(node, init) {
+    node.init = init;
+    this.expect(types$1.semi);
+    node.test = this.type === types$1.semi ? null : this.parseExpression();
+    this.expect(types$1.semi);
+    node.update = this.type === types$1.parenR ? null : this.parseExpression();
+    this.expect(types$1.parenR);
+    node.body = this.parseStatement("for");
+    this.exitScope();
+    this.labels.pop();
+    return this.finishNode(node, "ForStatement")
+  };
+
+  // Parse a `for`/`in` and `for`/`of` loop, which are almost
+  // same from parser's perspective.
+
+  pp$8.parseForIn = function(node, init) {
+    var isForIn = this.type === types$1._in;
+    this.next();
+
+    if (
+      init.type === "VariableDeclaration" &&
+      init.declarations[0].init != null &&
+      (
+        !isForIn ||
+        this.options.ecmaVersion < 8 ||
+        this.strict ||
+        init.kind !== "var" ||
+        init.declarations[0].id.type !== "Identifier"
+      )
+    ) {
+      this.raise(
+        init.start,
+        ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
+      );
+    }
+    node.left = init;
+    node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
+    this.expect(types$1.parenR);
+    node.body = this.parseStatement("for");
+    this.exitScope();
+    this.labels.pop();
+    return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
+  };
+
+  // Parse a list of variable declarations.
+
+  pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
+    node.declarations = [];
+    node.kind = kind;
+    for (;;) {
+      var decl = this.startNode();
+      this.parseVarId(decl, kind);
+      if (this.eat(types$1.eq)) {
+        decl.init = this.parseMaybeAssign(isFor);
+      } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
+        this.unexpected();
+      } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
+        this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
+      } else {
+        decl.init = null;
+      }
+      node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
+      if (!this.eat(types$1.comma)) { break }
+    }
+    return node
+  };
+
+  pp$8.parseVarId = function(decl, kind) {
+    decl.id = this.parseBindingAtom();
+    this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
+  };
+
+  var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
+
+  // Parse a function declaration or literal (depending on the
+  // `statement & FUNC_STATEMENT`).
+
+  // Remove `allowExpressionBody` for 7.0.0, as it is only called with false
+  pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
+    this.initFunction(node);
+    if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
+      if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))
+        { this.unexpected(); }
+      node.generator = this.eat(types$1.star);
+    }
+    if (this.options.ecmaVersion >= 8)
+      { node.async = !!isAsync; }
+
+    if (statement & FUNC_STATEMENT) {
+      node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();
+      if (node.id && !(statement & FUNC_HANGING_STATEMENT))
+        // If it is a regular function declaration in sloppy mode, then it is
+        // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
+        // mode depends on properties of the current scope (see
+        // treatFunctionsAsVar).
+        { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
+    }
+
+    var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+    this.yieldPos = 0;
+    this.awaitPos = 0;
+    this.awaitIdentPos = 0;
+    this.enterScope(functionFlags(node.async, node.generator));
+
+    if (!(statement & FUNC_STATEMENT))
+      { node.id = this.type === types$1.name ? this.parseIdent() : null; }
+
+    this.parseFunctionParams(node);
+    this.parseFunctionBody(node, allowExpressionBody, false, forInit);
+
+    this.yieldPos = oldYieldPos;
+    this.awaitPos = oldAwaitPos;
+    this.awaitIdentPos = oldAwaitIdentPos;
+    return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
+  };
+
+  pp$8.parseFunctionParams = function(node) {
+    this.expect(types$1.parenL);
+    node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
+    this.checkYieldAwaitInDefaultParams();
+  };
+
+  // Parse a class declaration or literal (depending on the
+  // `isStatement` parameter).
+
+  pp$8.parseClass = function(node, isStatement) {
+    this.next();
+
+    // ecma-262 14.6 Class Definitions
+    // A class definition is always strict mode code.
+    var oldStrict = this.strict;
+    this.strict = true;
+
+    this.parseClassId(node, isStatement);
+    this.parseClassSuper(node);
+    var privateNameMap = this.enterClassBody();
+    var classBody = this.startNode();
+    var hadConstructor = false;
+    classBody.body = [];
+    this.expect(types$1.braceL);
+    while (this.type !== types$1.braceR) {
+      var element = this.parseClassElement(node.superClass !== null);
+      if (element) {
+        classBody.body.push(element);
+        if (element.type === "MethodDefinition" && element.kind === "constructor") {
+          if (hadConstructor) { this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); }
+          hadConstructor = true;
+        } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
+          this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared"));
+        }
+      }
+    }
+    this.strict = oldStrict;
+    this.next();
+    node.body = this.finishNode(classBody, "ClassBody");
+    this.exitClassBody();
+    return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
+  };
+
+  pp$8.parseClassElement = function(constructorAllowsSuper) {
+    if (this.eat(types$1.semi)) { return null }
+
+    var ecmaVersion = this.options.ecmaVersion;
+    var node = this.startNode();
+    var keyName = "";
+    var isGenerator = false;
+    var isAsync = false;
+    var kind = "method";
+    var isStatic = false;
+
+    if (this.eatContextual("static")) {
+      // Parse static init block
+      if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
+        this.parseClassStaticBlock(node);
+        return node
+      }
+      if (this.isClassElementNameStart() || this.type === types$1.star) {
+        isStatic = true;
+      } else {
+        keyName = "static";
+      }
+    }
+    node.static = isStatic;
+    if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
+      if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
+        isAsync = true;
+      } else {
+        keyName = "async";
+      }
+    }
+    if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {
+      isGenerator = true;
+    }
+    if (!keyName && !isAsync && !isGenerator) {
+      var lastValue = this.value;
+      if (this.eatContextual("get") || this.eatContextual("set")) {
+        if (this.isClassElementNameStart()) {
+          kind = lastValue;
+        } else {
+          keyName = lastValue;
+        }
+      }
+    }
+
+    // Parse element name
+    if (keyName) {
+      // 'async', 'get', 'set', or 'static' were not a keyword contextually.
+      // The last token is any of those. Make it the element name.
+      node.computed = false;
+      node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
+      node.key.name = keyName;
+      this.finishNode(node.key, "Identifier");
+    } else {
+      this.parseClassElementName(node);
+    }
+
+    // Parse element value
+    if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
+      var isConstructor = !node.static && checkKeyName(node, "constructor");
+      var allowsDirectSuper = isConstructor && constructorAllowsSuper;
+      // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.
+      if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); }
+      node.kind = isConstructor ? "constructor" : kind;
+      this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);
+    } else {
+      this.parseClassField(node);
+    }
+
+    return node
+  };
+
+  pp$8.isClassElementNameStart = function() {
+    return (
+      this.type === types$1.name ||
+      this.type === types$1.privateId ||
+      this.type === types$1.num ||
+      this.type === types$1.string ||
+      this.type === types$1.bracketL ||
+      this.type.keyword
+    )
+  };
+
+  pp$8.parseClassElementName = function(element) {
+    if (this.type === types$1.privateId) {
+      if (this.value === "constructor") {
+        this.raise(this.start, "Classes can't have an element named '#constructor'");
+      }
+      element.computed = false;
+      element.key = this.parsePrivateIdent();
+    } else {
+      this.parsePropertyName(element);
+    }
+  };
+
+  pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
+    // Check key and flags
+    var key = method.key;
+    if (method.kind === "constructor") {
+      if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
+      if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
+    } else if (method.static && checkKeyName(method, "prototype")) {
+      this.raise(key.start, "Classes may not have a static property named prototype");
+    }
+
+    // Parse value
+    var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
+
+    // Check value
+    if (method.kind === "get" && value.params.length !== 0)
+      { this.raiseRecoverable(value.start, "getter should have no params"); }
+    if (method.kind === "set" && value.params.length !== 1)
+      { this.raiseRecoverable(value.start, "setter should have exactly one param"); }
+    if (method.kind === "set" && value.params[0].type === "RestElement")
+      { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); }
+
+    return this.finishNode(method, "MethodDefinition")
+  };
+
+  pp$8.parseClassField = function(field) {
+    if (checkKeyName(field, "constructor")) {
+      this.raise(field.key.start, "Classes can't have a field named 'constructor'");
+    } else if (field.static && checkKeyName(field, "prototype")) {
+      this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
+    }
+
+    if (this.eat(types$1.eq)) {
+      // To raise SyntaxError if 'arguments' exists in the initializer.
+      var scope = this.currentThisScope();
+      var inClassFieldInit = scope.inClassFieldInit;
+      scope.inClassFieldInit = true;
+      field.value = this.parseMaybeAssign();
+      scope.inClassFieldInit = inClassFieldInit;
+    } else {
+      field.value = null;
+    }
+    this.semicolon();
+
+    return this.finishNode(field, "PropertyDefinition")
+  };
+
+  pp$8.parseClassStaticBlock = function(node) {
+    node.body = [];
+
+    var oldLabels = this.labels;
+    this.labels = [];
+    this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
+    while (this.type !== types$1.braceR) {
+      var stmt = this.parseStatement(null);
+      node.body.push(stmt);
+    }
+    this.next();
+    this.exitScope();
+    this.labels = oldLabels;
+
+    return this.finishNode(node, "StaticBlock")
+  };
+
+  pp$8.parseClassId = function(node, isStatement) {
+    if (this.type === types$1.name) {
+      node.id = this.parseIdent();
+      if (isStatement)
+        { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
+    } else {
+      if (isStatement === true)
+        { this.unexpected(); }
+      node.id = null;
+    }
+  };
+
+  pp$8.parseClassSuper = function(node) {
+    node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
+  };
+
+  pp$8.enterClassBody = function() {
+    var element = {declared: Object.create(null), used: []};
+    this.privateNameStack.push(element);
+    return element.declared
+  };
+
+  pp$8.exitClassBody = function() {
+    var ref = this.privateNameStack.pop();
+    var declared = ref.declared;
+    var used = ref.used;
+    if (!this.options.checkPrivateFields) { return }
+    var len = this.privateNameStack.length;
+    var parent = len === 0 ? null : this.privateNameStack[len - 1];
+    for (var i = 0; i < used.length; ++i) {
+      var id = used[i];
+      if (!hasOwn(declared, id.name)) {
+        if (parent) {
+          parent.used.push(id);
+        } else {
+          this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class"));
+        }
+      }
+    }
+  };
+
+  function isPrivateNameConflicted(privateNameMap, element) {
+    var name = element.key.name;
+    var curr = privateNameMap[name];
+
+    var next = "true";
+    if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) {
+      next = (element.static ? "s" : "i") + element.kind;
+    }
+
+    // `class { get #a(){}; static set #a(_){} }` is also conflict.
+    if (
+      curr === "iget" && next === "iset" ||
+      curr === "iset" && next === "iget" ||
+      curr === "sget" && next === "sset" ||
+      curr === "sset" && next === "sget"
+    ) {
+      privateNameMap[name] = "true";
+      return false
+    } else if (!curr) {
+      privateNameMap[name] = next;
+      return false
+    } else {
+      return true
+    }
+  }
+
+  function checkKeyName(node, name) {
+    var computed = node.computed;
+    var key = node.key;
+    return !computed && (
+      key.type === "Identifier" && key.name === name ||
+      key.type === "Literal" && key.value === name
+    )
+  }
+
+  // Parses module export declaration.
+
+  pp$8.parseExportAllDeclaration = function(node, exports) {
+    if (this.options.ecmaVersion >= 11) {
+      if (this.eatContextual("as")) {
+        node.exported = this.parseModuleExportName();
+        this.checkExport(exports, node.exported, this.lastTokStart);
+      } else {
+        node.exported = null;
+      }
+    }
+    this.expectContextual("from");
+    if (this.type !== types$1.string) { this.unexpected(); }
+    node.source = this.parseExprAtom();
+    if (this.options.ecmaVersion >= 16)
+      { node.attributes = this.parseWithClause(); }
+    this.semicolon();
+    return this.finishNode(node, "ExportAllDeclaration")
+  };
+
+  pp$8.parseExport = function(node, exports) {
+    this.next();
+    // export * from '...'
+    if (this.eat(types$1.star)) {
+      return this.parseExportAllDeclaration(node, exports)
+    }
+    if (this.eat(types$1._default)) { // export default ...
+      this.checkExport(exports, "default", this.lastTokStart);
+      node.declaration = this.parseExportDefaultDeclaration();
+      return this.finishNode(node, "ExportDefaultDeclaration")
+    }
+    // export var|const|let|function|class ...
+    if (this.shouldParseExportStatement()) {
+      node.declaration = this.parseExportDeclaration(node);
+      if (node.declaration.type === "VariableDeclaration")
+        { this.checkVariableExport(exports, node.declaration.declarations); }
+      else
+        { this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
+      node.specifiers = [];
+      node.source = null;
+    } else { // export { x, y as z } [from '...']
+      node.declaration = null;
+      node.specifiers = this.parseExportSpecifiers(exports);
+      if (this.eatContextual("from")) {
+        if (this.type !== types$1.string) { this.unexpected(); }
+        node.source = this.parseExprAtom();
+        if (this.options.ecmaVersion >= 16)
+          { node.attributes = this.parseWithClause(); }
+      } else {
+        for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
+          // check for keywords used as local names
+          var spec = list[i];
+
+          this.checkUnreserved(spec.local);
+          // check if export is defined
+          this.checkLocalExport(spec.local);
+
+          if (spec.local.type === "Literal") {
+            this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
+          }
+        }
+
+        node.source = null;
+      }
+      this.semicolon();
+    }
+    return this.finishNode(node, "ExportNamedDeclaration")
+  };
+
+  pp$8.parseExportDeclaration = function(node) {
+    return this.parseStatement(null)
+  };
+
+  pp$8.parseExportDefaultDeclaration = function() {
+    var isAsync;
+    if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
+      var fNode = this.startNode();
+      this.next();
+      if (isAsync) { this.next(); }
+      return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)
+    } else if (this.type === types$1._class) {
+      var cNode = this.startNode();
+      return this.parseClass(cNode, "nullableID")
+    } else {
+      var declaration = this.parseMaybeAssign();
+      this.semicolon();
+      return declaration
+    }
+  };
+
+  pp$8.checkExport = function(exports, name, pos) {
+    if (!exports) { return }
+    if (typeof name !== "string")
+      { name = name.type === "Identifier" ? name.name : name.value; }
+    if (hasOwn(exports, name))
+      { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
+    exports[name] = true;
+  };
+
+  pp$8.checkPatternExport = function(exports, pat) {
+    var type = pat.type;
+    if (type === "Identifier")
+      { this.checkExport(exports, pat, pat.start); }
+    else if (type === "ObjectPattern")
+      { for (var i = 0, list = pat.properties; i < list.length; i += 1)
+        {
+          var prop = list[i];
+
+          this.checkPatternExport(exports, prop);
+        } }
+    else if (type === "ArrayPattern")
+      { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
+        var elt = list$1[i$1];
+
+          if (elt) { this.checkPatternExport(exports, elt); }
+      } }
+    else if (type === "Property")
+      { this.checkPatternExport(exports, pat.value); }
+    else if (type === "AssignmentPattern")
+      { this.checkPatternExport(exports, pat.left); }
+    else if (type === "RestElement")
+      { this.checkPatternExport(exports, pat.argument); }
+  };
+
+  pp$8.checkVariableExport = function(exports, decls) {
+    if (!exports) { return }
+    for (var i = 0, list = decls; i < list.length; i += 1)
+      {
+      var decl = list[i];
+
+      this.checkPatternExport(exports, decl.id);
+    }
+  };
+
+  pp$8.shouldParseExportStatement = function() {
+    return this.type.keyword === "var" ||
+      this.type.keyword === "const" ||
+      this.type.keyword === "class" ||
+      this.type.keyword === "function" ||
+      this.isLet() ||
+      this.isAsyncFunction()
+  };
+
+  // Parses a comma-separated list of module exports.
+
+  pp$8.parseExportSpecifier = function(exports) {
+    var node = this.startNode();
+    node.local = this.parseModuleExportName();
+
+    node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
+    this.checkExport(
+      exports,
+      node.exported,
+      node.exported.start
+    );
+
+    return this.finishNode(node, "ExportSpecifier")
+  };
+
+  pp$8.parseExportSpecifiers = function(exports) {
+    var nodes = [], first = true;
+    // export { x, y as z } [from '...']
+    this.expect(types$1.braceL);
+    while (!this.eat(types$1.braceR)) {
+      if (!first) {
+        this.expect(types$1.comma);
+        if (this.afterTrailingComma(types$1.braceR)) { break }
+      } else { first = false; }
+
+      nodes.push(this.parseExportSpecifier(exports));
+    }
+    return nodes
+  };
+
+  // Parses import declaration.
+
+  pp$8.parseImport = function(node) {
+    this.next();
+
+    // import '...'
+    if (this.type === types$1.string) {
+      node.specifiers = empty$1;
+      node.source = this.parseExprAtom();
+    } else {
+      node.specifiers = this.parseImportSpecifiers();
+      this.expectContextual("from");
+      node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
+    }
+    if (this.options.ecmaVersion >= 16)
+      { node.attributes = this.parseWithClause(); }
+    this.semicolon();
+    return this.finishNode(node, "ImportDeclaration")
+  };
+
+  // Parses a comma-separated list of module imports.
+
+  pp$8.parseImportSpecifier = function() {
+    var node = this.startNode();
+    node.imported = this.parseModuleExportName();
+
+    if (this.eatContextual("as")) {
+      node.local = this.parseIdent();
+    } else {
+      this.checkUnreserved(node.imported);
+      node.local = node.imported;
+    }
+    this.checkLValSimple(node.local, BIND_LEXICAL);
+
+    return this.finishNode(node, "ImportSpecifier")
+  };
+
+  pp$8.parseImportDefaultSpecifier = function() {
+    // import defaultObj, { x, y as z } from '...'
+    var node = this.startNode();
+    node.local = this.parseIdent();
+    this.checkLValSimple(node.local, BIND_LEXICAL);
+    return this.finishNode(node, "ImportDefaultSpecifier")
+  };
+
+  pp$8.parseImportNamespaceSpecifier = function() {
+    var node = this.startNode();
+    this.next();
+    this.expectContextual("as");
+    node.local = this.parseIdent();
+    this.checkLValSimple(node.local, BIND_LEXICAL);
+    return this.finishNode(node, "ImportNamespaceSpecifier")
+  };
+
+  pp$8.parseImportSpecifiers = function() {
+    var nodes = [], first = true;
+    if (this.type === types$1.name) {
+      nodes.push(this.parseImportDefaultSpecifier());
+      if (!this.eat(types$1.comma)) { return nodes }
+    }
+    if (this.type === types$1.star) {
+      nodes.push(this.parseImportNamespaceSpecifier());
+      return nodes
+    }
+    this.expect(types$1.braceL);
+    while (!this.eat(types$1.braceR)) {
+      if (!first) {
+        this.expect(types$1.comma);
+        if (this.afterTrailingComma(types$1.braceR)) { break }
+      } else { first = false; }
+
+      nodes.push(this.parseImportSpecifier());
+    }
+    return nodes
+  };
+
+  pp$8.parseWithClause = function() {
+    var nodes = [];
+    if (!this.eat(types$1._with)) {
+      return nodes
+    }
+    this.expect(types$1.braceL);
+    var attributeKeys = {};
+    var first = true;
+    while (!this.eat(types$1.braceR)) {
+      if (!first) {
+        this.expect(types$1.comma);
+        if (this.afterTrailingComma(types$1.braceR)) { break }
+      } else { first = false; }
+
+      var attr = this.parseImportAttribute();
+      var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
+      if (hasOwn(attributeKeys, keyName))
+        { this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); }
+      attributeKeys[keyName] = true;
+      nodes.push(attr);
+    }
+    return nodes
+  };
+
+  pp$8.parseImportAttribute = function() {
+    var node = this.startNode();
+    node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
+    this.expect(types$1.colon);
+    if (this.type !== types$1.string) {
+      this.unexpected();
+    }
+    node.value = this.parseExprAtom();
+    return this.finishNode(node, "ImportAttribute")
+  };
+
+  pp$8.parseModuleExportName = function() {
+    if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
+      var stringLiteral = this.parseLiteral(this.value);
+      if (loneSurrogate.test(stringLiteral.value)) {
+        this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
+      }
+      return stringLiteral
+    }
+    return this.parseIdent(true)
+  };
+
+  // Set `ExpressionStatement#directive` property for directive prologues.
+  pp$8.adaptDirectivePrologue = function(statements) {
+    for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
+      statements[i].directive = statements[i].expression.raw.slice(1, -1);
+    }
+  };
+  pp$8.isDirectiveCandidate = function(statement) {
+    return (
+      this.options.ecmaVersion >= 5 &&
+      statement.type === "ExpressionStatement" &&
+      statement.expression.type === "Literal" &&
+      typeof statement.expression.value === "string" &&
+      // Reject parenthesized strings.
+      (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
+    )
+  };
+
+  var pp$7 = Parser.prototype;
+
+  // Convert existing expression atom to assignable pattern
+  // if possible.
+
+  pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
+    if (this.options.ecmaVersion >= 6 && node) {
+      switch (node.type) {
+      case "Identifier":
+        if (this.inAsync && node.name === "await")
+          { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
+        break
+
+      case "ObjectPattern":
+      case "ArrayPattern":
+      case "AssignmentPattern":
+      case "RestElement":
+        break
+
+      case "ObjectExpression":
+        node.type = "ObjectPattern";
+        if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+        for (var i = 0, list = node.properties; i < list.length; i += 1) {
+          var prop = list[i];
+
+        this.toAssignable(prop, isBinding);
+          // Early error:
+          //   AssignmentRestProperty[Yield, Await] :
+          //     `...` DestructuringAssignmentTarget[Yield, Await]
+          //
+          //   It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
+          if (
+            prop.type === "RestElement" &&
+            (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
+          ) {
+            this.raise(prop.argument.start, "Unexpected token");
+          }
+        }
+        break
+
+      case "Property":
+        // AssignmentProperty has type === "Property"
+        if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
+        this.toAssignable(node.value, isBinding);
+        break
+
+      case "ArrayExpression":
+        node.type = "ArrayPattern";
+        if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+        this.toAssignableList(node.elements, isBinding);
+        break
+
+      case "SpreadElement":
+        node.type = "RestElement";
+        this.toAssignable(node.argument, isBinding);
+        if (node.argument.type === "AssignmentPattern")
+          { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
+        break
+
+      case "AssignmentExpression":
+        if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
+        node.type = "AssignmentPattern";
+        delete node.operator;
+        this.toAssignable(node.left, isBinding);
+        break
+
+      case "ParenthesizedExpression":
+        this.toAssignable(node.expression, isBinding, refDestructuringErrors);
+        break
+
+      case "ChainExpression":
+        this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
+        break
+
+      case "MemberExpression":
+        if (!isBinding) { break }
+
+      default:
+        this.raise(node.start, "Assigning to rvalue");
+      }
+    } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+    return node
+  };
+
+  // Convert list of expression atoms to binding list.
+
+  pp$7.toAssignableList = function(exprList, isBinding) {
+    var end = exprList.length;
+    for (var i = 0; i < end; i++) {
+      var elt = exprList[i];
+      if (elt) { this.toAssignable(elt, isBinding); }
+    }
+    if (end) {
+      var last = exprList[end - 1];
+      if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
+        { this.unexpected(last.argument.start); }
+    }
+    return exprList
+  };
+
+  // Parses spread element.
+
+  pp$7.parseSpread = function(refDestructuringErrors) {
+    var node = this.startNode();
+    this.next();
+    node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
+    return this.finishNode(node, "SpreadElement")
+  };
+
+  pp$7.parseRestBinding = function() {
+    var node = this.startNode();
+    this.next();
+
+    // RestElement inside of a function parameter must be an identifier
+    if (this.options.ecmaVersion === 6 && this.type !== types$1.name)
+      { this.unexpected(); }
+
+    node.argument = this.parseBindingAtom();
+
+    return this.finishNode(node, "RestElement")
+  };
+
+  // Parses lvalue (assignable) atom.
+
+  pp$7.parseBindingAtom = function() {
+    if (this.options.ecmaVersion >= 6) {
+      switch (this.type) {
+      case types$1.bracketL:
+        var node = this.startNode();
+        this.next();
+        node.elements = this.parseBindingList(types$1.bracketR, true, true);
+        return this.finishNode(node, "ArrayPattern")
+
+      case types$1.braceL:
+        return this.parseObj(true)
+      }
+    }
+    return this.parseIdent()
+  };
+
+  pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {
+    var elts = [], first = true;
+    while (!this.eat(close)) {
+      if (first) { first = false; }
+      else { this.expect(types$1.comma); }
+      if (allowEmpty && this.type === types$1.comma) {
+        elts.push(null);
+      } else if (allowTrailingComma && this.afterTrailingComma(close)) {
+        break
+      } else if (this.type === types$1.ellipsis) {
+        var rest = this.parseRestBinding();
+        this.parseBindingListItem(rest);
+        elts.push(rest);
+        if (this.type === types$1.comma) { this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); }
+        this.expect(close);
+        break
+      } else {
+        elts.push(this.parseAssignableListItem(allowModifiers));
+      }
+    }
+    return elts
+  };
+
+  pp$7.parseAssignableListItem = function(allowModifiers) {
+    var elem = this.parseMaybeDefault(this.start, this.startLoc);
+    this.parseBindingListItem(elem);
+    return elem
+  };
+
+  pp$7.parseBindingListItem = function(param) {
+    return param
+  };
+
+  // Parses assignment pattern around given atom if possible.
+
+  pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
+    left = left || this.parseBindingAtom();
+    if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }
+    var node = this.startNodeAt(startPos, startLoc);
+    node.left = left;
+    node.right = this.parseMaybeAssign();
+    return this.finishNode(node, "AssignmentPattern")
+  };
+
+  // The following three functions all verify that a node is an lvalue —
+  // something that can be bound, or assigned to. In order to do so, they perform
+  // a variety of checks:
+  //
+  // - Check that none of the bound/assigned-to identifiers are reserved words.
+  // - Record name declarations for bindings in the appropriate scope.
+  // - Check duplicate argument names, if checkClashes is set.
+  //
+  // If a complex binding pattern is encountered (e.g., object and array
+  // destructuring), the entire pattern is recursively checked.
+  //
+  // There are three versions of checkLVal*() appropriate for different
+  // circumstances:
+  //
+  // - checkLValSimple() shall be used if the syntactic construct supports
+  //   nothing other than identifiers and member expressions. Parenthesized
+  //   expressions are also correctly handled. This is generally appropriate for
+  //   constructs for which the spec says
+  //
+  //   > It is a Syntax Error if AssignmentTargetType of [the production] is not
+  //   > simple.
+  //
+  //   It is also appropriate for checking if an identifier is valid and not
+  //   defined elsewhere, like import declarations or function/class identifiers.
+  //
+  //   Examples where this is used include:
+  //     a += …;
+  //     import a from '…';
+  //   where a is the node to be checked.
+  //
+  // - checkLValPattern() shall be used if the syntactic construct supports
+  //   anything checkLValSimple() supports, as well as object and array
+  //   destructuring patterns. This is generally appropriate for constructs for
+  //   which the spec says
+  //
+  //   > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
+  //   > an ArrayLiteral and AssignmentTargetType of [the production] is not
+  //   > simple.
+  //
+  //   Examples where this is used include:
+  //     (a = …);
+  //     const a = …;
+  //     try { … } catch (a) { … }
+  //   where a is the node to be checked.
+  //
+  // - checkLValInnerPattern() shall be used if the syntactic construct supports
+  //   anything checkLValPattern() supports, as well as default assignment
+  //   patterns, rest elements, and other constructs that may appear within an
+  //   object or array destructuring pattern.
+  //
+  //   As a special case, function parameters also use checkLValInnerPattern(),
+  //   as they also support defaults and rest constructs.
+  //
+  // These functions deliberately support both assignment and binding constructs,
+  // as the logic for both is exceedingly similar. If the node is the target of
+  // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
+  // should be set to the appropriate BIND_* constant, like BIND_VAR or
+  // BIND_LEXICAL.
+  //
+  // If the function is called with a non-BIND_NONE bindingType, then
+  // additionally a checkClashes object may be specified to allow checking for
+  // duplicate argument names. checkClashes is ignored if the provided construct
+  // is an assignment (i.e., bindingType is BIND_NONE).
+
+  pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
+    if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+    var isBind = bindingType !== BIND_NONE;
+
+    switch (expr.type) {
+    case "Identifier":
+      if (this.strict && this.reservedWordsStrictBind.test(expr.name))
+        { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
+      if (isBind) {
+        if (bindingType === BIND_LEXICAL && expr.name === "let")
+          { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
+        if (checkClashes) {
+          if (hasOwn(checkClashes, expr.name))
+            { this.raiseRecoverable(expr.start, "Argument name clash"); }
+          checkClashes[expr.name] = true;
+        }
+        if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
+      }
+      break
+
+    case "ChainExpression":
+      this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
+      break
+
+    case "MemberExpression":
+      if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
+      break
+
+    case "ParenthesizedExpression":
+      if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
+      return this.checkLValSimple(expr.expression, bindingType, checkClashes)
+
+    default:
+      this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
+    }
+  };
+
+  pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {
+    if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+    switch (expr.type) {
+    case "ObjectPattern":
+      for (var i = 0, list = expr.properties; i < list.length; i += 1) {
+        var prop = list[i];
+
+      this.checkLValInnerPattern(prop, bindingType, checkClashes);
+      }
+      break
+
+    case "ArrayPattern":
+      for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
+        var elem = list$1[i$1];
+
+      if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
+      }
+      break
+
+    default:
+      this.checkLValSimple(expr, bindingType, checkClashes);
+    }
+  };
+
+  pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
+    if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+    switch (expr.type) {
+    case "Property":
+      // AssignmentProperty has type === "Property"
+      this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
+      break
+
+    case "AssignmentPattern":
+      this.checkLValPattern(expr.left, bindingType, checkClashes);
+      break
+
+    case "RestElement":
+      this.checkLValPattern(expr.argument, bindingType, checkClashes);
+      break
+
+    default:
+      this.checkLValPattern(expr, bindingType, checkClashes);
+    }
+  };
+
+  // The algorithm used to determine whether a regexp can appear at a
+  // given point in the program is loosely based on sweet.js' approach.
+  // See https://github.com/mozilla/sweet.js/wiki/design
+
+
+  var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
+    this.token = token;
+    this.isExpr = !!isExpr;
+    this.preserveSpace = !!preserveSpace;
+    this.override = override;
+    this.generator = !!generator;
+  };
+
+  var types = {
+    b_stat: new TokContext("{", false),
+    b_expr: new TokContext("{", true),
+    b_tmpl: new TokContext("${", false),
+    p_stat: new TokContext("(", false),
+    p_expr: new TokContext("(", true),
+    q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
+    f_stat: new TokContext("function", false),
+    f_expr: new TokContext("function", true),
+    f_expr_gen: new TokContext("function", true, false, null, true),
+    f_gen: new TokContext("function", false, false, null, true)
+  };
+
+  var pp$6 = Parser.prototype;
+
+  pp$6.initialContext = function() {
+    return [types.b_stat]
+  };
+
+  pp$6.curContext = function() {
+    return this.context[this.context.length - 1]
+  };
+
+  pp$6.braceIsBlock = function(prevType) {
+    var parent = this.curContext();
+    if (parent === types.f_expr || parent === types.f_stat)
+      { return true }
+    if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))
+      { return !parent.isExpr }
+
+    // The check for `tt.name && exprAllowed` detects whether we are
+    // after a `yield` or `of` construct. See the `updateContext` for
+    // `tt.name`.
+    if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)
+      { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
+    if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)
+      { return true }
+    if (prevType === types$1.braceL)
+      { return parent === types.b_stat }
+    if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)
+      { return false }
+    return !this.exprAllowed
+  };
+
+  pp$6.inGeneratorContext = function() {
+    for (var i = this.context.length - 1; i >= 1; i--) {
+      var context = this.context[i];
+      if (context.token === "function")
+        { return context.generator }
+    }
+    return false
+  };
+
+  pp$6.updateContext = function(prevType) {
+    var update, type = this.type;
+    if (type.keyword && prevType === types$1.dot)
+      { this.exprAllowed = false; }
+    else if (update = type.updateContext)
+      { update.call(this, prevType); }
+    else
+      { this.exprAllowed = type.beforeExpr; }
+  };
+
+  // Used to handle edge cases when token context could not be inferred correctly during tokenization phase
+
+  pp$6.overrideContext = function(tokenCtx) {
+    if (this.curContext() !== tokenCtx) {
+      this.context[this.context.length - 1] = tokenCtx;
+    }
+  };
+
+  // Token-specific context update code
+
+  types$1.parenR.updateContext = types$1.braceR.updateContext = function() {
+    if (this.context.length === 1) {
+      this.exprAllowed = true;
+      return
+    }
+    var out = this.context.pop();
+    if (out === types.b_stat && this.curContext().token === "function") {
+      out = this.context.pop();
+    }
+    this.exprAllowed = !out.isExpr;
+  };
+
+  types$1.braceL.updateContext = function(prevType) {
+    this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);
+    this.exprAllowed = true;
+  };
+
+  types$1.dollarBraceL.updateContext = function() {
+    this.context.push(types.b_tmpl);
+    this.exprAllowed = true;
+  };
+
+  types$1.parenL.updateContext = function(prevType) {
+    var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;
+    this.context.push(statementParens ? types.p_stat : types.p_expr);
+    this.exprAllowed = true;
+  };
+
+  types$1.incDec.updateContext = function() {
+    // tokExprAllowed stays unchanged
+  };
+
+  types$1._function.updateContext = types$1._class.updateContext = function(prevType) {
+    if (prevType.beforeExpr && prevType !== types$1._else &&
+        !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&
+        !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
+        !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))
+      { this.context.push(types.f_expr); }
+    else
+      { this.context.push(types.f_stat); }
+    this.exprAllowed = false;
+  };
+
+  types$1.colon.updateContext = function() {
+    if (this.curContext().token === "function") { this.context.pop(); }
+    this.exprAllowed = true;
+  };
+
+  types$1.backQuote.updateContext = function() {
+    if (this.curContext() === types.q_tmpl)
+      { this.context.pop(); }
+    else
+      { this.context.push(types.q_tmpl); }
+    this.exprAllowed = false;
+  };
+
+  types$1.star.updateContext = function(prevType) {
+    if (prevType === types$1._function) {
+      var index = this.context.length - 1;
+      if (this.context[index] === types.f_expr)
+        { this.context[index] = types.f_expr_gen; }
+      else
+        { this.context[index] = types.f_gen; }
+    }
+    this.exprAllowed = true;
+  };
+
+  types$1.name.updateContext = function(prevType) {
+    var allowed = false;
+    if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {
+      if (this.value === "of" && !this.exprAllowed ||
+          this.value === "yield" && this.inGeneratorContext())
+        { allowed = true; }
+    }
+    this.exprAllowed = allowed;
+  };
+
+  // A recursive descent parser operates by defining functions for all
+  // syntactic elements, and recursively calling those, each function
+  // advancing the input stream and returning an AST node. Precedence
+  // of constructs (for example, the fact that `!x[1]` means `!(x[1])`
+  // instead of `(!x)[1]` is handled by the fact that the parser
+  // function that parses unary prefix operators is called first, and
+  // in turn calls the function that parses `[]` subscripts — that
+  // way, it'll receive the node for `x[1]` already parsed, and wraps
+  // *that* in the unary operator node.
+  //
+  // Acorn uses an [operator precedence parser][opp] to handle binary
+  // operator precedence, because it is much more compact than using
+  // the technique outlined above, which uses different, nesting
+  // functions to specify precedence, for all of the ten binary
+  // precedence levels that JavaScript defines.
+  //
+  // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser
+
+
+  var pp$5 = Parser.prototype;
+
+  // Check if property name clashes with already added.
+  // Object/class getters and setters are not allowed to clash —
+  // either with each other or with an init property — and in
+  // strict mode, init properties are also not allowed to be repeated.
+
+  pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
+    if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
+      { return }
+    if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
+      { return }
+    var key = prop.key;
+    var name;
+    switch (key.type) {
+    case "Identifier": name = key.name; break
+    case "Literal": name = String(key.value); break
+    default: return
+    }
+    var kind = prop.kind;
+    if (this.options.ecmaVersion >= 6) {
+      if (name === "__proto__" && kind === "init") {
+        if (propHash.proto) {
+          if (refDestructuringErrors) {
+            if (refDestructuringErrors.doubleProto < 0) {
+              refDestructuringErrors.doubleProto = key.start;
+            }
+          } else {
+            this.raiseRecoverable(key.start, "Redefinition of __proto__ property");
+          }
+        }
+        propHash.proto = true;
+      }
+      return
+    }
+    name = "$" + name;
+    var other = propHash[name];
+    if (other) {
+      var redefinition;
+      if (kind === "init") {
+        redefinition = this.strict && other.init || other.get || other.set;
+      } else {
+        redefinition = other.init || other[kind];
+      }
+      if (redefinition)
+        { this.raiseRecoverable(key.start, "Redefinition of property"); }
+    } else {
+      other = propHash[name] = {
+        init: false,
+        get: false,
+        set: false
+      };
+    }
+    other[kind] = true;
+  };
+
+  // ### Expression parsing
+
+  // These nest, from the most general expression type at the top to
+  // 'atomic', nondivisible expression types at the bottom. Most of
+  // the functions will simply let the function(s) below them parse,
+  // and, *if* the syntactic construct they handle is present, wrap
+  // the AST node that the inner parser gave them in another node.
+
+  // Parse a full expression. The optional arguments are used to
+  // forbid the `in` operator (in for loops initalization expressions)
+  // and provide reference for storing '=' operator inside shorthand
+  // property assignment in contexts where both object expression
+  // and object pattern might appear (so it's possible to raise
+  // delayed syntax error at correct position).
+
+  pp$5.parseExpression = function(forInit, refDestructuringErrors) {
+    var startPos = this.start, startLoc = this.startLoc;
+    var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
+    if (this.type === types$1.comma) {
+      var node = this.startNodeAt(startPos, startLoc);
+      node.expressions = [expr];
+      while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }
+      return this.finishNode(node, "SequenceExpression")
+    }
+    return expr
+  };
+
+  // Parse an assignment expression. This includes applications of
+  // operators like `+=`.
+
+  pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
+    if (this.isContextual("yield")) {
+      if (this.inGenerator) { return this.parseYield(forInit) }
+      // The tokenizer will assume an expression is allowed after
+      // `yield`, but this isn't that kind of yield
+      else { this.exprAllowed = false; }
+    }
+
+    var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;
+    if (refDestructuringErrors) {
+      oldParenAssign = refDestructuringErrors.parenthesizedAssign;
+      oldTrailingComma = refDestructuringErrors.trailingComma;
+      oldDoubleProto = refDestructuringErrors.doubleProto;
+      refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
+    } else {
+      refDestructuringErrors = new DestructuringErrors;
+      ownDestructuringErrors = true;
+    }
+
+    var startPos = this.start, startLoc = this.startLoc;
+    if (this.type === types$1.parenL || this.type === types$1.name) {
+      this.potentialArrowAt = this.start;
+      this.potentialArrowInForAwait = forInit === "await";
+    }
+    var left = this.parseMaybeConditional(forInit, refDestructuringErrors);
+    if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
+    if (this.type.isAssign) {
+      var node = this.startNodeAt(startPos, startLoc);
+      node.operator = this.value;
+      if (this.type === types$1.eq)
+        { left = this.toAssignable(left, false, refDestructuringErrors); }
+      if (!ownDestructuringErrors) {
+        refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
+      }
+      if (refDestructuringErrors.shorthandAssign >= left.start)
+        { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
+      if (this.type === types$1.eq)
+        { this.checkLValPattern(left); }
+      else
+        { this.checkLValSimple(left); }
+      node.left = left;
+      this.next();
+      node.right = this.parseMaybeAssign(forInit);
+      if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }
+      return this.finishNode(node, "AssignmentExpression")
+    } else {
+      if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
+    }
+    if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
+    if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
+    return left
+  };
+
+  // Parse a ternary conditional (`?:`) operator.
+
+  pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
+    var startPos = this.start, startLoc = this.startLoc;
+    var expr = this.parseExprOps(forInit, refDestructuringErrors);
+    if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+    if (this.eat(types$1.question)) {
+      var node = this.startNodeAt(startPos, startLoc);
+      node.test = expr;
+      node.consequent = this.parseMaybeAssign();
+      this.expect(types$1.colon);
+      node.alternate = this.parseMaybeAssign(forInit);
+      return this.finishNode(node, "ConditionalExpression")
+    }
+    return expr
+  };
+
+  // Start the precedence parser.
+
+  pp$5.parseExprOps = function(forInit, refDestructuringErrors) {
+    var startPos = this.start, startLoc = this.startLoc;
+    var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);
+    if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+    return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)
+  };
+
+  // Parse binary operators with the operator precedence parsing
+  // algorithm. `left` is the left-hand side of the operator.
+  // `minPrec` provides context that allows the function to stop and
+  // defer further parser to one of its callers when it encounters an
+  // operator that has a lower precedence than the set it is parsing.
+
+  pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {
+    var prec = this.type.binop;
+    if (prec != null && (!forInit || this.type !== types$1._in)) {
+      if (prec > minPrec) {
+        var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;
+        var coalesce = this.type === types$1.coalesce;
+        if (coalesce) {
+          // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
+          // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
+          prec = types$1.logicalAND.binop;
+        }
+        var op = this.value;
+        this.next();
+        var startPos = this.start, startLoc = this.startLoc;
+        var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);
+        var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
+        if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {
+          this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
+        }
+        return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)
+      }
+    }
+    return left
+  };
+
+  pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
+    if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); }
+    var node = this.startNodeAt(startPos, startLoc);
+    node.left = left;
+    node.operator = op;
+    node.right = right;
+    return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
+  };
+
+  // Parse unary operators, both prefix and postfix.
+
+  pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
+    var startPos = this.start, startLoc = this.startLoc, expr;
+    if (this.isContextual("await") && this.canAwait) {
+      expr = this.parseAwait(forInit);
+      sawUnary = true;
+    } else if (this.type.prefix) {
+      var node = this.startNode(), update = this.type === types$1.incDec;
+      node.operator = this.value;
+      node.prefix = true;
+      this.next();
+      node.argument = this.parseMaybeUnary(null, true, update, forInit);
+      this.checkExpressionErrors(refDestructuringErrors, true);
+      if (update) { this.checkLValSimple(node.argument); }
+      else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument))
+        { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
+      else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
+        { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
+      else { sawUnary = true; }
+      expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
+    } else if (!sawUnary && this.type === types$1.privateId) {
+      if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }
+      expr = this.parsePrivateIdent();
+      // only could be private fields in 'in', such as #x in obj
+      if (this.type !== types$1._in) { this.unexpected(); }
+    } else {
+      expr = this.parseExprSubscripts(refDestructuringErrors, forInit);
+      if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+      while (this.type.postfix && !this.canInsertSemicolon()) {
+        var node$1 = this.startNodeAt(startPos, startLoc);
+        node$1.operator = this.value;
+        node$1.prefix = false;
+        node$1.argument = expr;
+        this.checkLValSimple(expr);
+        this.next();
+        expr = this.finishNode(node$1, "UpdateExpression");
+      }
+    }
+
+    if (!incDec && this.eat(types$1.starstar)) {
+      if (sawUnary)
+        { this.unexpected(this.lastTokStart); }
+      else
+        { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) }
+    } else {
+      return expr
+    }
+  };
+
+  function isLocalVariableAccess(node) {
+    return (
+      node.type === "Identifier" ||
+      node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression)
+    )
+  }
+
+  function isPrivateFieldAccess(node) {
+    return (
+      node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
+      node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ||
+      node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression)
+    )
+  }
+
+  // Parse call, dot, and `[]`-subscript expressions.
+
+  pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
+    var startPos = this.start, startLoc = this.startLoc;
+    var expr = this.parseExprAtom(refDestructuringErrors, forInit);
+    if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
+      { return expr }
+    var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);
+    if (refDestructuringErrors && result.type === "MemberExpression") {
+      if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
+      if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
+      if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }
+    }
+    return result
+  };
+
+  pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {
+    var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
+        this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
+        this.potentialArrowAt === base.start;
+    var optionalChained = false;
+
+    while (true) {
+      var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);
+
+      if (element.optional) { optionalChained = true; }
+      if (element === base || element.type === "ArrowFunctionExpression") {
+        if (optionalChained) {
+          var chainNode = this.startNodeAt(startPos, startLoc);
+          chainNode.expression = element;
+          element = this.finishNode(chainNode, "ChainExpression");
+        }
+        return element
+      }
+
+      base = element;
+    }
+  };
+
+  pp$5.shouldParseAsyncArrow = function() {
+    return !this.canInsertSemicolon() && this.eat(types$1.arrow)
+  };
+
+  pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {
+    return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)
+  };
+
+  pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
+    var optionalSupported = this.options.ecmaVersion >= 11;
+    var optional = optionalSupported && this.eat(types$1.questionDot);
+    if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
+
+    var computed = this.eat(types$1.bracketL);
+    if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {
+      var node = this.startNodeAt(startPos, startLoc);
+      node.object = base;
+      if (computed) {
+        node.property = this.parseExpression();
+        this.expect(types$1.bracketR);
+      } else if (this.type === types$1.privateId && base.type !== "Super") {
+        node.property = this.parsePrivateIdent();
+      } else {
+        node.property = this.parseIdent(this.options.allowReserved !== "never");
+      }
+      node.computed = !!computed;
+      if (optionalSupported) {
+        node.optional = optional;
+      }
+      base = this.finishNode(node, "MemberExpression");
+    } else if (!noCalls && this.eat(types$1.parenL)) {
+      var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+      this.yieldPos = 0;
+      this.awaitPos = 0;
+      this.awaitIdentPos = 0;
+      var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
+      if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {
+        this.checkPatternErrors(refDestructuringErrors, false);
+        this.checkYieldAwaitInDefaultParams();
+        if (this.awaitIdentPos > 0)
+          { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
+        this.yieldPos = oldYieldPos;
+        this.awaitPos = oldAwaitPos;
+        this.awaitIdentPos = oldAwaitIdentPos;
+        return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit)
+      }
+      this.checkExpressionErrors(refDestructuringErrors, true);
+      this.yieldPos = oldYieldPos || this.yieldPos;
+      this.awaitPos = oldAwaitPos || this.awaitPos;
+      this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
+      var node$1 = this.startNodeAt(startPos, startLoc);
+      node$1.callee = base;
+      node$1.arguments = exprList;
+      if (optionalSupported) {
+        node$1.optional = optional;
+      }
+      base = this.finishNode(node$1, "CallExpression");
+    } else if (this.type === types$1.backQuote) {
+      if (optional || optionalChained) {
+        this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
+      }
+      var node$2 = this.startNodeAt(startPos, startLoc);
+      node$2.tag = base;
+      node$2.quasi = this.parseTemplate({isTagged: true});
+      base = this.finishNode(node$2, "TaggedTemplateExpression");
+    }
+    return base
+  };
+
+  // Parse an atomic expression — either a single token that is an
+  // expression, an expression started by a keyword like `function` or
+  // `new`, or an expression wrapped in punctuation like `()`, `[]`,
+  // or `{}`.
+
+  pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
+    // If a division operator appears in an expression position, the
+    // tokenizer got confused, and we force it to read a regexp instead.
+    if (this.type === types$1.slash) { this.readRegexp(); }
+
+    var node, canBeArrow = this.potentialArrowAt === this.start;
+    switch (this.type) {
+    case types$1._super:
+      if (!this.allowSuper)
+        { this.raise(this.start, "'super' keyword outside a method"); }
+      node = this.startNode();
+      this.next();
+      if (this.type === types$1.parenL && !this.allowDirectSuper)
+        { this.raise(node.start, "super() call outside constructor of a subclass"); }
+      // The `super` keyword can appear at below:
+      // SuperProperty:
+      //     super [ Expression ]
+      //     super . IdentifierName
+      // SuperCall:
+      //     super ( Arguments )
+      if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)
+        { this.unexpected(); }
+      return this.finishNode(node, "Super")
+
+    case types$1._this:
+      node = this.startNode();
+      this.next();
+      return this.finishNode(node, "ThisExpression")
+
+    case types$1.name:
+      var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
+      var id = this.parseIdent(false);
+      if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) {
+        this.overrideContext(types.f_expr);
+        return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)
+      }
+      if (canBeArrow && !this.canInsertSemicolon()) {
+        if (this.eat(types$1.arrow))
+          { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }
+        if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc &&
+            (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) {
+          id = this.parseIdent(false);
+          if (this.canInsertSemicolon() || !this.eat(types$1.arrow))
+            { this.unexpected(); }
+          return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)
+        }
+      }
+      return id
+
+    case types$1.regexp:
+      var value = this.value;
+      node = this.parseLiteral(value.value);
+      node.regex = {pattern: value.pattern, flags: value.flags};
+      return node
+
+    case types$1.num: case types$1.string:
+      return this.parseLiteral(this.value)
+
+    case types$1._null: case types$1._true: case types$1._false:
+      node = this.startNode();
+      node.value = this.type === types$1._null ? null : this.type === types$1._true;
+      node.raw = this.type.keyword;
+      this.next();
+      return this.finishNode(node, "Literal")
+
+    case types$1.parenL:
+      var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
+      if (refDestructuringErrors) {
+        if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
+          { refDestructuringErrors.parenthesizedAssign = start; }
+        if (refDestructuringErrors.parenthesizedBind < 0)
+          { refDestructuringErrors.parenthesizedBind = start; }
+      }
+      return expr
+
+    case types$1.bracketL:
+      node = this.startNode();
+      this.next();
+      node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
+      return this.finishNode(node, "ArrayExpression")
+
+    case types$1.braceL:
+      this.overrideContext(types.b_expr);
+      return this.parseObj(false, refDestructuringErrors)
+
+    case types$1._function:
+      node = this.startNode();
+      this.next();
+      return this.parseFunction(node, 0)
+
+    case types$1._class:
+      return this.parseClass(this.startNode(), false)
+
+    case types$1._new:
+      return this.parseNew()
+
+    case types$1.backQuote:
+      return this.parseTemplate()
+
+    case types$1._import:
+      if (this.options.ecmaVersion >= 11) {
+        return this.parseExprImport(forNew)
+      } else {
+        return this.unexpected()
+      }
+
+    default:
+      return this.parseExprAtomDefault()
+    }
+  };
+
+  pp$5.parseExprAtomDefault = function() {
+    this.unexpected();
+  };
+
+  pp$5.parseExprImport = function(forNew) {
+    var node = this.startNode();
+
+    // Consume `import` as an identifier for `import.meta`.
+    // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
+    if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
+    this.next();
+
+    if (this.type === types$1.parenL && !forNew) {
+      return this.parseDynamicImport(node)
+    } else if (this.type === types$1.dot) {
+      var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
+      meta.name = "import";
+      node.meta = this.finishNode(meta, "Identifier");
+      return this.parseImportMeta(node)
+    } else {
+      this.unexpected();
+    }
+  };
+
+  pp$5.parseDynamicImport = function(node) {
+    this.next(); // skip `(`
+
+    // Parse node.source.
+    node.source = this.parseMaybeAssign();
+
+    if (this.options.ecmaVersion >= 16) {
+      if (!this.eat(types$1.parenR)) {
+        this.expect(types$1.comma);
+        if (!this.afterTrailingComma(types$1.parenR)) {
+          node.options = this.parseMaybeAssign();
+          if (!this.eat(types$1.parenR)) {
+            this.expect(types$1.comma);
+            if (!this.afterTrailingComma(types$1.parenR)) {
+              this.unexpected();
+            }
+          }
+        } else {
+          node.options = null;
+        }
+      } else {
+        node.options = null;
+      }
+    } else {
+      // Verify ending.
+      if (!this.eat(types$1.parenR)) {
+        var errorPos = this.start;
+        if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
+          this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
+        } else {
+          this.unexpected(errorPos);
+        }
+      }
+    }
+
+    return this.finishNode(node, "ImportExpression")
+  };
+
+  pp$5.parseImportMeta = function(node) {
+    this.next(); // skip `.`
+
+    var containsEsc = this.containsEsc;
+    node.property = this.parseIdent(true);
+
+    if (node.property.name !== "meta")
+      { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
+    if (containsEsc)
+      { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
+    if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere)
+      { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }
+
+    return this.finishNode(node, "MetaProperty")
+  };
+
+  pp$5.parseLiteral = function(value) {
+    var node = this.startNode();
+    node.value = value;
+    node.raw = this.input.slice(this.start, this.end);
+    if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); }
+    this.next();
+    return this.finishNode(node, "Literal")
+  };
+
+  pp$5.parseParenExpression = function() {
+    this.expect(types$1.parenL);
+    var val = this.parseExpression();
+    this.expect(types$1.parenR);
+    return val
+  };
+
+  pp$5.shouldParseArrow = function(exprList) {
+    return !this.canInsertSemicolon()
+  };
+
+  pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
+    var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
+    if (this.options.ecmaVersion >= 6) {
+      this.next();
+
+      var innerStartPos = this.start, innerStartLoc = this.startLoc;
+      var exprList = [], first = true, lastIsComma = false;
+      var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
+      this.yieldPos = 0;
+      this.awaitPos = 0;
+      // Do not save awaitIdentPos to allow checking awaits nested in parameters
+      while (this.type !== types$1.parenR) {
+        first ? first = false : this.expect(types$1.comma);
+        if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {
+          lastIsComma = true;
+          break
+        } else if (this.type === types$1.ellipsis) {
+          spreadStart = this.start;
+          exprList.push(this.parseParenItem(this.parseRestBinding()));
+          if (this.type === types$1.comma) {
+            this.raiseRecoverable(
+              this.start,
+              "Comma is not permitted after the rest element"
+            );
+          }
+          break
+        } else {
+          exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
+        }
+      }
+      var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
+      this.expect(types$1.parenR);
+
+      if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {
+        this.checkPatternErrors(refDestructuringErrors, false);
+        this.checkYieldAwaitInDefaultParams();
+        this.yieldPos = oldYieldPos;
+        this.awaitPos = oldAwaitPos;
+        return this.parseParenArrowList(startPos, startLoc, exprList, forInit)
+      }
+
+      if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
+      if (spreadStart) { this.unexpected(spreadStart); }
+      this.checkExpressionErrors(refDestructuringErrors, true);
+      this.yieldPos = oldYieldPos || this.yieldPos;
+      this.awaitPos = oldAwaitPos || this.awaitPos;
+
+      if (exprList.length > 1) {
+        val = this.startNodeAt(innerStartPos, innerStartLoc);
+        val.expressions = exprList;
+        this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
+      } else {
+        val = exprList[0];
+      }
+    } else {
+      val = this.parseParenExpression();
+    }
+
+    if (this.options.preserveParens) {
+      var par = this.startNodeAt(startPos, startLoc);
+      par.expression = val;
+      return this.finishNode(par, "ParenthesizedExpression")
+    } else {
+      return val
+    }
+  };
+
+  pp$5.parseParenItem = function(item) {
+    return item
+  };
+
+  pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
+    return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)
+  };
+
+  // New's precedence is slightly tricky. It must allow its argument to
+  // be a `[]` or dot subscript expression, but not a call — at least,
+  // not without wrapping it in parentheses. Thus, it uses the noCalls
+  // argument to parseSubscripts to prevent it from consuming the
+  // argument list.
+
+  var empty = [];
+
+  pp$5.parseNew = function() {
+    if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
+    var node = this.startNode();
+    this.next();
+    if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
+      var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
+      meta.name = "new";
+      node.meta = this.finishNode(meta, "Identifier");
+      this.next();
+      var containsEsc = this.containsEsc;
+      node.property = this.parseIdent(true);
+      if (node.property.name !== "target")
+        { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
+      if (containsEsc)
+        { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
+      if (!this.allowNewDotTarget)
+        { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); }
+      return this.finishNode(node, "MetaProperty")
+    }
+    var startPos = this.start, startLoc = this.startLoc;
+    node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
+    if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }
+    else { node.arguments = empty; }
+    return this.finishNode(node, "NewExpression")
+  };
+
+  // Parse template expression.
+
+  pp$5.parseTemplateElement = function(ref) {
+    var isTagged = ref.isTagged;
+
+    var elem = this.startNode();
+    if (this.type === types$1.invalidTemplate) {
+      if (!isTagged) {
+        this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
+      }
+      elem.value = {
+        raw: this.value.replace(/\r\n?/g, "\n"),
+        cooked: null
+      };
+    } else {
+      elem.value = {
+        raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
+        cooked: this.value
+      };
+    }
+    this.next();
+    elem.tail = this.type === types$1.backQuote;
+    return this.finishNode(elem, "TemplateElement")
+  };
+
+  pp$5.parseTemplate = function(ref) {
+    if ( ref === void 0 ) ref = {};
+    var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;
+
+    var node = this.startNode();
+    this.next();
+    node.expressions = [];
+    var curElt = this.parseTemplateElement({isTagged: isTagged});
+    node.quasis = [curElt];
+    while (!curElt.tail) {
+      if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); }
+      this.expect(types$1.dollarBraceL);
+      node.expressions.push(this.parseExpression());
+      this.expect(types$1.braceR);
+      node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
+    }
+    this.next();
+    return this.finishNode(node, "TemplateLiteral")
+  };
+
+  pp$5.isAsyncProp = function(prop) {
+    return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
+      (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&
+      !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
+  };
+
+  // Parse an object literal or binding pattern.
+
+  pp$5.parseObj = function(isPattern, refDestructuringErrors) {
+    var node = this.startNode(), first = true, propHash = {};
+    node.properties = [];
+    this.next();
+    while (!this.eat(types$1.braceR)) {
+      if (!first) {
+        this.expect(types$1.comma);
+        if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }
+      } else { first = false; }
+
+      var prop = this.parseProperty(isPattern, refDestructuringErrors);
+      if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
+      node.properties.push(prop);
+    }
+    return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
+  };
+
+  pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
+    var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
+    if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {
+      if (isPattern) {
+        prop.argument = this.parseIdent(false);
+        if (this.type === types$1.comma) {
+          this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
+        }
+        return this.finishNode(prop, "RestElement")
+      }
+      // Parse argument.
+      prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
+      // To disallow trailing comma via `this.toAssignable()`.
+      if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
+        refDestructuringErrors.trailingComma = this.start;
+      }
+      // Finish
+      return this.finishNode(prop, "SpreadElement")
+    }
+    if (this.options.ecmaVersion >= 6) {
+      prop.method = false;
+      prop.shorthand = false;
+      if (isPattern || refDestructuringErrors) {
+        startPos = this.start;
+        startLoc = this.startLoc;
+      }
+      if (!isPattern)
+        { isGenerator = this.eat(types$1.star); }
+    }
+    var containsEsc = this.containsEsc;
+    this.parsePropertyName(prop);
+    if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
+      isAsync = true;
+      isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);
+      this.parsePropertyName(prop);
+    } else {
+      isAsync = false;
+    }
+    this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
+    return this.finishNode(prop, "Property")
+  };
+
+  pp$5.parseGetterSetter = function(prop) {
+    prop.kind = prop.key.name;
+    this.parsePropertyName(prop);
+    prop.value = this.parseMethod(false);
+    var paramCount = prop.kind === "get" ? 0 : 1;
+    if (prop.value.params.length !== paramCount) {
+      var start = prop.value.start;
+      if (prop.kind === "get")
+        { this.raiseRecoverable(start, "getter should have no params"); }
+      else
+        { this.raiseRecoverable(start, "setter should have exactly one param"); }
+    } else {
+      if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
+        { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
+    }
+  };
+
+  pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
+    if ((isGenerator || isAsync) && this.type === types$1.colon)
+      { this.unexpected(); }
+
+    if (this.eat(types$1.colon)) {
+      prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
+      prop.kind = "init";
+    } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
+      if (isPattern) { this.unexpected(); }
+      prop.kind = "init";
+      prop.method = true;
+      prop.value = this.parseMethod(isGenerator, isAsync);
+    } else if (!isPattern && !containsEsc &&
+               this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
+               (prop.key.name === "get" || prop.key.name === "set") &&
+               (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
+      if (isGenerator || isAsync) { this.unexpected(); }
+      this.parseGetterSetter(prop);
+    } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
+      if (isGenerator || isAsync) { this.unexpected(); }
+      this.checkUnreserved(prop.key);
+      if (prop.key.name === "await" && !this.awaitIdentPos)
+        { this.awaitIdentPos = startPos; }
+      prop.kind = "init";
+      if (isPattern) {
+        prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
+      } else if (this.type === types$1.eq && refDestructuringErrors) {
+        if (refDestructuringErrors.shorthandAssign < 0)
+          { refDestructuringErrors.shorthandAssign = this.start; }
+        prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
+      } else {
+        prop.value = this.copyNode(prop.key);
+      }
+      prop.shorthand = true;
+    } else { this.unexpected(); }
+  };
+
+  pp$5.parsePropertyName = function(prop) {
+    if (this.options.ecmaVersion >= 6) {
+      if (this.eat(types$1.bracketL)) {
+        prop.computed = true;
+        prop.key = this.parseMaybeAssign();
+        this.expect(types$1.bracketR);
+        return prop.key
+      } else {
+        prop.computed = false;
+      }
+    }
+    return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
+  };
+
+  // Initialize empty function node.
+
+  pp$5.initFunction = function(node) {
+    node.id = null;
+    if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
+    if (this.options.ecmaVersion >= 8) { node.async = false; }
+  };
+
+  // Parse object or class method.
+
+  pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
+    var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+
+    this.initFunction(node);
+    if (this.options.ecmaVersion >= 6)
+      { node.generator = isGenerator; }
+    if (this.options.ecmaVersion >= 8)
+      { node.async = !!isAsync; }
+
+    this.yieldPos = 0;
+    this.awaitPos = 0;
+    this.awaitIdentPos = 0;
+    this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
+
+    this.expect(types$1.parenL);
+    node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
+    this.checkYieldAwaitInDefaultParams();
+    this.parseFunctionBody(node, false, true, false);
+
+    this.yieldPos = oldYieldPos;
+    this.awaitPos = oldAwaitPos;
+    this.awaitIdentPos = oldAwaitIdentPos;
+    return this.finishNode(node, "FunctionExpression")
+  };
+
+  // Parse arrow function expression with given parameters.
+
+  pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {
+    var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+
+    this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
+    this.initFunction(node);
+    if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }
+
+    this.yieldPos = 0;
+    this.awaitPos = 0;
+    this.awaitIdentPos = 0;
+
+    node.params = this.toAssignableList(params, true);
+    this.parseFunctionBody(node, true, false, forInit);
+
+    this.yieldPos = oldYieldPos;
+    this.awaitPos = oldAwaitPos;
+    this.awaitIdentPos = oldAwaitIdentPos;
+    return this.finishNode(node, "ArrowFunctionExpression")
+  };
+
+  // Parse function body and check parameters.
+
+  pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
+    var isExpression = isArrowFunction && this.type !== types$1.braceL;
+    var oldStrict = this.strict, useStrict = false;
+
+    if (isExpression) {
+      node.body = this.parseMaybeAssign(forInit);
+      node.expression = true;
+      this.checkParams(node, false);
+    } else {
+      var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
+      if (!oldStrict || nonSimple) {
+        useStrict = this.strictDirective(this.end);
+        // If this is a strict mode function, verify that argument names
+        // are not repeated, and it does not try to bind the words `eval`
+        // or `arguments`.
+        if (useStrict && nonSimple)
+          { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
+      }
+      // Start a new scope with regard to labels and the `inFunction`
+      // flag (restore them to their old value afterwards).
+      var oldLabels = this.labels;
+      this.labels = [];
+      if (useStrict) { this.strict = true; }
+
+      // Add the params to varDeclaredNames to ensure that an error is thrown
+      // if a let/const declaration in the function clashes with one of the params.
+      this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
+      // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
+      if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
+      node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
+      node.expression = false;
+      this.adaptDirectivePrologue(node.body.body);
+      this.labels = oldLabels;
+    }
+    this.exitScope();
+  };
+
+  pp$5.isSimpleParamList = function(params) {
+    for (var i = 0, list = params; i < list.length; i += 1)
+      {
+      var param = list[i];
+
+      if (param.type !== "Identifier") { return false
+    } }
+    return true
+  };
+
+  // Checks function params for various disallowed patterns such as using "eval"
+  // or "arguments" and duplicate parameters.
+
+  pp$5.checkParams = function(node, allowDuplicates) {
+    var nameHash = Object.create(null);
+    for (var i = 0, list = node.params; i < list.length; i += 1)
+      {
+      var param = list[i];
+
+      this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
+    }
+  };
+
+  // Parses a comma-separated list of expressions, and returns them as
+  // an array. `close` is the token type that ends the list, and
+  // `allowEmpty` can be turned on to allow subsequent commas with
+  // nothing in between them to be parsed as `null` (which is needed
+  // for array literals).
+
+  pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
+    var elts = [], first = true;
+    while (!this.eat(close)) {
+      if (!first) {
+        this.expect(types$1.comma);
+        if (allowTrailingComma && this.afterTrailingComma(close)) { break }
+      } else { first = false; }
+
+      var elt = (void 0);
+      if (allowEmpty && this.type === types$1.comma)
+        { elt = null; }
+      else if (this.type === types$1.ellipsis) {
+        elt = this.parseSpread(refDestructuringErrors);
+        if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)
+          { refDestructuringErrors.trailingComma = this.start; }
+      } else {
+        elt = this.parseMaybeAssign(false, refDestructuringErrors);
+      }
+      elts.push(elt);
+    }
+    return elts
+  };
+
+  pp$5.checkUnreserved = function(ref) {
+    var start = ref.start;
+    var end = ref.end;
+    var name = ref.name;
+
+    if (this.inGenerator && name === "yield")
+      { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
+    if (this.inAsync && name === "await")
+      { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
+    if (this.currentThisScope().inClassFieldInit && name === "arguments")
+      { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); }
+    if (this.inClassStaticBlock && (name === "arguments" || name === "await"))
+      { this.raise(start, ("Cannot use " + name + " in class static initialization block")); }
+    if (this.keywords.test(name))
+      { this.raise(start, ("Unexpected keyword '" + name + "'")); }
+    if (this.options.ecmaVersion < 6 &&
+      this.input.slice(start, end).indexOf("\\") !== -1) { return }
+    var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
+    if (re.test(name)) {
+      if (!this.inAsync && name === "await")
+        { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
+      this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
+    }
+  };
+
+  // Parse the next token as an identifier. If `liberal` is true (used
+  // when parsing properties), it will also convert keywords into
+  // identifiers.
+
+  pp$5.parseIdent = function(liberal) {
+    var node = this.parseIdentNode();
+    this.next(!!liberal);
+    this.finishNode(node, "Identifier");
+    if (!liberal) {
+      this.checkUnreserved(node);
+      if (node.name === "await" && !this.awaitIdentPos)
+        { this.awaitIdentPos = node.start; }
+    }
+    return node
+  };
+
+  pp$5.parseIdentNode = function() {
+    var node = this.startNode();
+    if (this.type === types$1.name) {
+      node.name = this.value;
+    } else if (this.type.keyword) {
+      node.name = this.type.keyword;
+
+      // To fix https://github.com/acornjs/acorn/issues/575
+      // `class` and `function` keywords push new context into this.context.
+      // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
+      // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
+      if ((node.name === "class" || node.name === "function") &&
+        (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
+        this.context.pop();
+      }
+      this.type = types$1.name;
+    } else {
+      this.unexpected();
+    }
+    return node
+  };
+
+  pp$5.parsePrivateIdent = function() {
+    var node = this.startNode();
+    if (this.type === types$1.privateId) {
+      node.name = this.value;
+    } else {
+      this.unexpected();
+    }
+    this.next();
+    this.finishNode(node, "PrivateIdentifier");
+
+    // For validating existence
+    if (this.options.checkPrivateFields) {
+      if (this.privateNameStack.length === 0) {
+        this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
+      } else {
+        this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
+      }
+    }
+
+    return node
+  };
+
+  // Parses yield expression inside generator.
+
+  pp$5.parseYield = function(forInit) {
+    if (!this.yieldPos) { this.yieldPos = this.start; }
+
+    var node = this.startNode();
+    this.next();
+    if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {
+      node.delegate = false;
+      node.argument = null;
+    } else {
+      node.delegate = this.eat(types$1.star);
+      node.argument = this.parseMaybeAssign(forInit);
+    }
+    return this.finishNode(node, "YieldExpression")
+  };
+
+  pp$5.parseAwait = function(forInit) {
+    if (!this.awaitPos) { this.awaitPos = this.start; }
+
+    var node = this.startNode();
+    this.next();
+    node.argument = this.parseMaybeUnary(null, true, false, forInit);
+    return this.finishNode(node, "AwaitExpression")
+  };
+
+  var pp$4 = Parser.prototype;
+
+  // This function is used to raise exceptions on parse errors. It
+  // takes an offset integer (into the current `input`) to indicate
+  // the location of the error, attaches the position to the end
+  // of the error message, and then raises a `SyntaxError` with that
+  // message.
+
+  pp$4.raise = function(pos, message) {
+    var loc = getLineInfo(this.input, pos);
+    message += " (" + loc.line + ":" + loc.column + ")";
+    var err = new SyntaxError(message);
+    err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
+    throw err
+  };
+
+  pp$4.raiseRecoverable = pp$4.raise;
+
+  pp$4.curPosition = function() {
+    if (this.options.locations) {
+      return new Position(this.curLine, this.pos - this.lineStart)
+    }
+  };
+
+  var pp$3 = Parser.prototype;
+
+  var Scope = function Scope(flags) {
+    this.flags = flags;
+    // A list of var-declared names in the current lexical scope
+    this.var = [];
+    // A list of lexically-declared names in the current lexical scope
+    this.lexical = [];
+    // A list of lexically-declared FunctionDeclaration names in the current lexical scope
+    this.functions = [];
+    // A switch to disallow the identifier reference 'arguments'
+    this.inClassFieldInit = false;
+  };
+
+  // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
+
+  pp$3.enterScope = function(flags) {
+    this.scopeStack.push(new Scope(flags));
+  };
+
+  pp$3.exitScope = function() {
+    this.scopeStack.pop();
+  };
+
+  // The spec says:
+  // > At the top level of a function, or script, function declarations are
+  // > treated like var declarations rather than like lexical declarations.
+  pp$3.treatFunctionsAsVarInScope = function(scope) {
+    return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
+  };
+
+  pp$3.declareName = function(name, bindingType, pos) {
+    var redeclared = false;
+    if (bindingType === BIND_LEXICAL) {
+      var scope = this.currentScope();
+      redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
+      scope.lexical.push(name);
+      if (this.inModule && (scope.flags & SCOPE_TOP))
+        { delete this.undefinedExports[name]; }
+    } else if (bindingType === BIND_SIMPLE_CATCH) {
+      var scope$1 = this.currentScope();
+      scope$1.lexical.push(name);
+    } else if (bindingType === BIND_FUNCTION) {
+      var scope$2 = this.currentScope();
+      if (this.treatFunctionsAsVar)
+        { redeclared = scope$2.lexical.indexOf(name) > -1; }
+      else
+        { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
+      scope$2.functions.push(name);
+    } else {
+      for (var i = this.scopeStack.length - 1; i >= 0; --i) {
+        var scope$3 = this.scopeStack[i];
+        if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
+            !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
+          redeclared = true;
+          break
+        }
+        scope$3.var.push(name);
+        if (this.inModule && (scope$3.flags & SCOPE_TOP))
+          { delete this.undefinedExports[name]; }
+        if (scope$3.flags & SCOPE_VAR) { break }
+      }
+    }
+    if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
+  };
+
+  pp$3.checkLocalExport = function(id) {
+    // scope.functions must be empty as Module code is always strict.
+    if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
+        this.scopeStack[0].var.indexOf(id.name) === -1) {
+      this.undefinedExports[id.name] = id;
+    }
+  };
+
+  pp$3.currentScope = function() {
+    return this.scopeStack[this.scopeStack.length - 1]
+  };
+
+  pp$3.currentVarScope = function() {
+    for (var i = this.scopeStack.length - 1;; i--) {
+      var scope = this.scopeStack[i];
+      if (scope.flags & SCOPE_VAR) { return scope }
+    }
+  };
+
+  // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
+  pp$3.currentThisScope = function() {
+    for (var i = this.scopeStack.length - 1;; i--) {
+      var scope = this.scopeStack[i];
+      if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
+    }
+  };
+
+  var Node = function Node(parser, pos, loc) {
+    this.type = "";
+    this.start = pos;
+    this.end = 0;
+    if (parser.options.locations)
+      { this.loc = new SourceLocation(parser, loc); }
+    if (parser.options.directSourceFile)
+      { this.sourceFile = parser.options.directSourceFile; }
+    if (parser.options.ranges)
+      { this.range = [pos, 0]; }
+  };
+
+  // Start an AST node, attaching a start offset.
+
+  var pp$2 = Parser.prototype;
+
+  pp$2.startNode = function() {
+    return new Node(this, this.start, this.startLoc)
+  };
+
+  pp$2.startNodeAt = function(pos, loc) {
+    return new Node(this, pos, loc)
+  };
+
+  // Finish an AST node, adding `type` and `end` properties.
+
+  function finishNodeAt(node, type, pos, loc) {
+    node.type = type;
+    node.end = pos;
+    if (this.options.locations)
+      { node.loc.end = loc; }
+    if (this.options.ranges)
+      { node.range[1] = pos; }
+    return node
+  }
+
+  pp$2.finishNode = function(node, type) {
+    return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
+  };
+
+  // Finish node at given position
+
+  pp$2.finishNodeAt = function(node, type, pos, loc) {
+    return finishNodeAt.call(this, node, type, pos, loc)
+  };
+
+  pp$2.copyNode = function(node) {
+    var newNode = new Node(this, node.start, this.startLoc);
+    for (var prop in node) { newNode[prop] = node[prop]; }
+    return newNode
+  };
+
+  // This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
+  var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
+
+  // This file contains Unicode properties extracted from the ECMAScript specification.
+  // The lists are extracted like so:
+  // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
+
+  // #table-binary-unicode-properties
+  var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
+  var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
+  var ecma11BinaryProperties = ecma10BinaryProperties;
+  var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
+  var ecma13BinaryProperties = ecma12BinaryProperties;
+  var ecma14BinaryProperties = ecma13BinaryProperties;
+
+  var unicodeBinaryProperties = {
+    9: ecma9BinaryProperties,
+    10: ecma10BinaryProperties,
+    11: ecma11BinaryProperties,
+    12: ecma12BinaryProperties,
+    13: ecma13BinaryProperties,
+    14: ecma14BinaryProperties
+  };
+
+  // #table-binary-unicode-properties-of-strings
+  var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";
+
+  var unicodeBinaryPropertiesOfStrings = {
+    9: "",
+    10: "",
+    11: "",
+    12: "",
+    13: "",
+    14: ecma14BinaryPropertiesOfStrings
+  };
+
+  // #table-unicode-general-category-values
+  var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
+
+  // #table-unicode-script-values
+  var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
+  var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
+  var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
+  var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
+  var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
+  var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;
+
+  var unicodeScriptValues = {
+    9: ecma9ScriptValues,
+    10: ecma10ScriptValues,
+    11: ecma11ScriptValues,
+    12: ecma12ScriptValues,
+    13: ecma13ScriptValues,
+    14: ecma14ScriptValues
+  };
+
+  var data = {};
+  function buildUnicodeData(ecmaVersion) {
+    var d = data[ecmaVersion] = {
+      binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
+      binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
+      nonBinary: {
+        General_Category: wordsRegexp(unicodeGeneralCategoryValues),
+        Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
+      }
+    };
+    d.nonBinary.Script_Extensions = d.nonBinary.Script;
+
+    d.nonBinary.gc = d.nonBinary.General_Category;
+    d.nonBinary.sc = d.nonBinary.Script;
+    d.nonBinary.scx = d.nonBinary.Script_Extensions;
+  }
+
+  for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {
+    var ecmaVersion = list[i];
+
+    buildUnicodeData(ecmaVersion);
+  }
+
+  var pp$1 = Parser.prototype;
+
+  // Track disjunction structure to determine whether a duplicate
+  // capture group name is allowed because it is in a separate branch.
+  var BranchID = function BranchID(parent, base) {
+    // Parent disjunction branch
+    this.parent = parent;
+    // Identifies this set of sibling branches
+    this.base = base || this;
+  };
+
+  BranchID.prototype.separatedFrom = function separatedFrom (alt) {
+    // A branch is separate from another branch if they or any of
+    // their parents are siblings in a given disjunction
+    for (var self = this; self; self = self.parent) {
+      for (var other = alt; other; other = other.parent) {
+        if (self.base === other.base && self !== other) { return true }
+      }
+    }
+    return false
+  };
+
+  BranchID.prototype.sibling = function sibling () {
+    return new BranchID(this.parent, this.base)
+  };
+
+  var RegExpValidationState = function RegExpValidationState(parser) {
+    this.parser = parser;
+    this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
+    this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
+    this.source = "";
+    this.flags = "";
+    this.start = 0;
+    this.switchU = false;
+    this.switchV = false;
+    this.switchN = false;
+    this.pos = 0;
+    this.lastIntValue = 0;
+    this.lastStringValue = "";
+    this.lastAssertionIsQuantifiable = false;
+    this.numCapturingParens = 0;
+    this.maxBackReference = 0;
+    this.groupNames = Object.create(null);
+    this.backReferenceNames = [];
+    this.branchID = null;
+  };
+
+  RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
+    var unicodeSets = flags.indexOf("v") !== -1;
+    var unicode = flags.indexOf("u") !== -1;
+    this.start = start | 0;
+    this.source = pattern + "";
+    this.flags = flags;
+    if (unicodeSets && this.parser.options.ecmaVersion >= 15) {
+      this.switchU = true;
+      this.switchV = true;
+      this.switchN = true;
+    } else {
+      this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
+      this.switchV = false;
+      this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
+    }
+  };
+
+  RegExpValidationState.prototype.raise = function raise (message) {
+    this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
+  };
+
+  // If u flag is given, this returns the code point at the index (it combines a surrogate pair).
+  // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
+  RegExpValidationState.prototype.at = function at (i, forceU) {
+      if ( forceU === void 0 ) forceU = false;
+
+    var s = this.source;
+    var l = s.length;
+    if (i >= l) {
+      return -1
+    }
+    var c = s.charCodeAt(i);
+    if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
+      return c
+    }
+    var next = s.charCodeAt(i + 1);
+    return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
+  };
+
+  RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
+      if ( forceU === void 0 ) forceU = false;
+
+    var s = this.source;
+    var l = s.length;
+    if (i >= l) {
+      return l
+    }
+    var c = s.charCodeAt(i), next;
+    if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
+        (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
+      return i + 1
+    }
+    return i + 2
+  };
+
+  RegExpValidationState.prototype.current = function current (forceU) {
+      if ( forceU === void 0 ) forceU = false;
+
+    return this.at(this.pos, forceU)
+  };
+
+  RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
+      if ( forceU === void 0 ) forceU = false;
+
+    return this.at(this.nextIndex(this.pos, forceU), forceU)
+  };
+
+  RegExpValidationState.prototype.advance = function advance (forceU) {
+      if ( forceU === void 0 ) forceU = false;
+
+    this.pos = this.nextIndex(this.pos, forceU);
+  };
+
+  RegExpValidationState.prototype.eat = function eat (ch, forceU) {
+      if ( forceU === void 0 ) forceU = false;
+
+    if (this.current(forceU) === ch) {
+      this.advance(forceU);
+      return true
+    }
+    return false
+  };
+
+  RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) {
+      if ( forceU === void 0 ) forceU = false;
+
+    var pos = this.pos;
+    for (var i = 0, list = chs; i < list.length; i += 1) {
+      var ch = list[i];
+
+        var current = this.at(pos, forceU);
+      if (current === -1 || current !== ch) {
+        return false
+      }
+      pos = this.nextIndex(pos, forceU);
+    }
+    this.pos = pos;
+    return true
+  };
+
+  /**
+   * Validate the flags part of a given RegExpLiteral.
+   *
+   * @param {RegExpValidationState} state The state to validate RegExp.
+   * @returns {void}
+   */
+  pp$1.validateRegExpFlags = function(state) {
+    var validFlags = state.validFlags;
+    var flags = state.flags;
+
+    var u = false;
+    var v = false;
+
+    for (var i = 0; i < flags.length; i++) {
+      var flag = flags.charAt(i);
+      if (validFlags.indexOf(flag) === -1) {
+        this.raise(state.start, "Invalid regular expression flag");
+      }
+      if (flags.indexOf(flag, i + 1) > -1) {
+        this.raise(state.start, "Duplicate regular expression flag");
+      }
+      if (flag === "u") { u = true; }
+      if (flag === "v") { v = true; }
+    }
+    if (this.options.ecmaVersion >= 15 && u && v) {
+      this.raise(state.start, "Invalid regular expression flag");
+    }
+  };
+
+  function hasProp(obj) {
+    for (var _ in obj) { return true }
+    return false
+  }
+
+  /**
+   * Validate the pattern part of a given RegExpLiteral.
+   *
+   * @param {RegExpValidationState} state The state to validate RegExp.
+   * @returns {void}
+   */
+  pp$1.validateRegExpPattern = function(state) {
+    this.regexp_pattern(state);
+
+    // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
+    // parsing contains a |GroupName|, reparse with the goal symbol
+    // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
+    // exception if _P_ did not conform to the grammar, if any elements of _P_
+    // were not matched by the parse, or if any Early Error conditions exist.
+    if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
+      state.switchN = true;
+      this.regexp_pattern(state);
+    }
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
+  pp$1.regexp_pattern = function(state) {
+    state.pos = 0;
+    state.lastIntValue = 0;
+    state.lastStringValue = "";
+    state.lastAssertionIsQuantifiable = false;
+    state.numCapturingParens = 0;
+    state.maxBackReference = 0;
+    state.groupNames = Object.create(null);
+    state.backReferenceNames.length = 0;
+    state.branchID = null;
+
+    this.regexp_disjunction(state);
+
+    if (state.pos !== state.source.length) {
+      // Make the same messages as V8.
+      if (state.eat(0x29 /* ) */)) {
+        state.raise("Unmatched ')'");
+      }
+      if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
+        state.raise("Lone quantifier brackets");
+      }
+    }
+    if (state.maxBackReference > state.numCapturingParens) {
+      state.raise("Invalid escape");
+    }
+    for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
+      var name = list[i];
+
+      if (!state.groupNames[name]) {
+        state.raise("Invalid named capture referenced");
+      }
+    }
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
+  pp$1.regexp_disjunction = function(state) {
+    var trackDisjunction = this.options.ecmaVersion >= 16;
+    if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }
+    this.regexp_alternative(state);
+    while (state.eat(0x7C /* | */)) {
+      if (trackDisjunction) { state.branchID = state.branchID.sibling(); }
+      this.regexp_alternative(state);
+    }
+    if (trackDisjunction) { state.branchID = state.branchID.parent; }
+
+    // Make the same message as V8.
+    if (this.regexp_eatQuantifier(state, true)) {
+      state.raise("Nothing to repeat");
+    }
+    if (state.eat(0x7B /* { */)) {
+      state.raise("Lone quantifier brackets");
+    }
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
+  pp$1.regexp_alternative = function(state) {
+    while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
+  pp$1.regexp_eatTerm = function(state) {
+    if (this.regexp_eatAssertion(state)) {
+      // Handle `QuantifiableAssertion Quantifier` alternative.
+      // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
+      // is a QuantifiableAssertion.
+      if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
+        // Make the same message as V8.
+        if (state.switchU) {
+          state.raise("Invalid quantifier");
+        }
+      }
+      return true
+    }
+
+    if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
+      this.regexp_eatQuantifier(state);
+      return true
+    }
+
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
+  pp$1.regexp_eatAssertion = function(state) {
+    var start = state.pos;
+    state.lastAssertionIsQuantifiable = false;
+
+    // ^, $
+    if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
+      return true
+    }
+
+    // \b \B
+    if (state.eat(0x5C /* \ */)) {
+      if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
+        return true
+      }
+      state.pos = start;
+    }
+
+    // Lookahead / Lookbehind
+    if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
+      var lookbehind = false;
+      if (this.options.ecmaVersion >= 9) {
+        lookbehind = state.eat(0x3C /* < */);
+      }
+      if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
+        this.regexp_disjunction(state);
+        if (!state.eat(0x29 /* ) */)) {
+          state.raise("Unterminated group");
+        }
+        state.lastAssertionIsQuantifiable = !lookbehind;
+        return true
+      }
+    }
+
+    state.pos = start;
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
+  pp$1.regexp_eatQuantifier = function(state, noError) {
+    if ( noError === void 0 ) noError = false;
+
+    if (this.regexp_eatQuantifierPrefix(state, noError)) {
+      state.eat(0x3F /* ? */);
+      return true
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
+  pp$1.regexp_eatQuantifierPrefix = function(state, noError) {
+    return (
+      state.eat(0x2A /* * */) ||
+      state.eat(0x2B /* + */) ||
+      state.eat(0x3F /* ? */) ||
+      this.regexp_eatBracedQuantifier(state, noError)
+    )
+  };
+  pp$1.regexp_eatBracedQuantifier = function(state, noError) {
+    var start = state.pos;
+    if (state.eat(0x7B /* { */)) {
+      var min = 0, max = -1;
+      if (this.regexp_eatDecimalDigits(state)) {
+        min = state.lastIntValue;
+        if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
+          max = state.lastIntValue;
+        }
+        if (state.eat(0x7D /* } */)) {
+          // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
+          if (max !== -1 && max < min && !noError) {
+            state.raise("numbers out of order in {} quantifier");
+          }
+          return true
+        }
+      }
+      if (state.switchU && !noError) {
+        state.raise("Incomplete quantifier");
+      }
+      state.pos = start;
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
+  pp$1.regexp_eatAtom = function(state) {
+    return (
+      this.regexp_eatPatternCharacters(state) ||
+      state.eat(0x2E /* . */) ||
+      this.regexp_eatReverseSolidusAtomEscape(state) ||
+      this.regexp_eatCharacterClass(state) ||
+      this.regexp_eatUncapturingGroup(state) ||
+      this.regexp_eatCapturingGroup(state)
+    )
+  };
+  pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
+    var start = state.pos;
+    if (state.eat(0x5C /* \ */)) {
+      if (this.regexp_eatAtomEscape(state)) {
+        return true
+      }
+      state.pos = start;
+    }
+    return false
+  };
+  pp$1.regexp_eatUncapturingGroup = function(state) {
+    var start = state.pos;
+    if (state.eat(0x28 /* ( */)) {
+      if (state.eat(0x3F /* ? */)) {
+        if (this.options.ecmaVersion >= 16) {
+          var addModifiers = this.regexp_eatModifiers(state);
+          var hasHyphen = state.eat(0x2D /* - */);
+          if (addModifiers || hasHyphen) {
+            for (var i = 0; i < addModifiers.length; i++) {
+              var modifier = addModifiers.charAt(i);
+              if (addModifiers.indexOf(modifier, i + 1) > -1) {
+                state.raise("Duplicate regular expression modifiers");
+              }
+            }
+            if (hasHyphen) {
+              var removeModifiers = this.regexp_eatModifiers(state);
+              if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {
+                state.raise("Invalid regular expression modifiers");
+              }
+              for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
+                var modifier$1 = removeModifiers.charAt(i$1);
+                if (
+                  removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||
+                  addModifiers.indexOf(modifier$1) > -1
+                ) {
+                  state.raise("Duplicate regular expression modifiers");
+                }
+              }
+            }
+          }
+        }
+        if (state.eat(0x3A /* : */)) {
+          this.regexp_disjunction(state);
+          if (state.eat(0x29 /* ) */)) {
+            return true
+          }
+          state.raise("Unterminated group");
+        }
+      }
+      state.pos = start;
+    }
+    return false
+  };
+  pp$1.regexp_eatCapturingGroup = function(state) {
+    if (state.eat(0x28 /* ( */)) {
+      if (this.options.ecmaVersion >= 9) {
+        this.regexp_groupSpecifier(state);
+      } else if (state.current() === 0x3F /* ? */) {
+        state.raise("Invalid group");
+      }
+      this.regexp_disjunction(state);
+      if (state.eat(0x29 /* ) */)) {
+        state.numCapturingParens += 1;
+        return true
+      }
+      state.raise("Unterminated group");
+    }
+    return false
+  };
+  // RegularExpressionModifiers ::
+  //   [empty]
+  //   RegularExpressionModifiers RegularExpressionModifier
+  pp$1.regexp_eatModifiers = function(state) {
+    var modifiers = "";
+    var ch = 0;
+    while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
+      modifiers += codePointToString(ch);
+      state.advance();
+    }
+    return modifiers
+  };
+  // RegularExpressionModifier :: one of
+  //   `i` `m` `s`
+  function isRegularExpressionModifier(ch) {
+    return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
+  pp$1.regexp_eatExtendedAtom = function(state) {
+    return (
+      state.eat(0x2E /* . */) ||
+      this.regexp_eatReverseSolidusAtomEscape(state) ||
+      this.regexp_eatCharacterClass(state) ||
+      this.regexp_eatUncapturingGroup(state) ||
+      this.regexp_eatCapturingGroup(state) ||
+      this.regexp_eatInvalidBracedQuantifier(state) ||
+      this.regexp_eatExtendedPatternCharacter(state)
+    )
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
+  pp$1.regexp_eatInvalidBracedQuantifier = function(state) {
+    if (this.regexp_eatBracedQuantifier(state, true)) {
+      state.raise("Nothing to repeat");
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
+  pp$1.regexp_eatSyntaxCharacter = function(state) {
+    var ch = state.current();
+    if (isSyntaxCharacter(ch)) {
+      state.lastIntValue = ch;
+      state.advance();
+      return true
+    }
+    return false
+  };
+  function isSyntaxCharacter(ch) {
+    return (
+      ch === 0x24 /* $ */ ||
+      ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
+      ch === 0x2E /* . */ ||
+      ch === 0x3F /* ? */ ||
+      ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
+      ch >= 0x7B /* { */ && ch <= 0x7D /* } */
+    )
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
+  // But eat eager.
+  pp$1.regexp_eatPatternCharacters = function(state) {
+    var start = state.pos;
+    var ch = 0;
+    while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
+      state.advance();
+    }
+    return state.pos !== start
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
+  pp$1.regexp_eatExtendedPatternCharacter = function(state) {
+    var ch = state.current();
+    if (
+      ch !== -1 &&
+      ch !== 0x24 /* $ */ &&
+      !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
+      ch !== 0x2E /* . */ &&
+      ch !== 0x3F /* ? */ &&
+      ch !== 0x5B /* [ */ &&
+      ch !== 0x5E /* ^ */ &&
+      ch !== 0x7C /* | */
+    ) {
+      state.advance();
+      return true
+    }
+    return false
+  };
+
+  // GroupSpecifier ::
+  //   [empty]
+  //   `?` GroupName
+  pp$1.regexp_groupSpecifier = function(state) {
+    if (state.eat(0x3F /* ? */)) {
+      if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); }
+      var trackDisjunction = this.options.ecmaVersion >= 16;
+      var known = state.groupNames[state.lastStringValue];
+      if (known) {
+        if (trackDisjunction) {
+          for (var i = 0, list = known; i < list.length; i += 1) {
+            var altID = list[i];
+
+            if (!altID.separatedFrom(state.branchID))
+              { state.raise("Duplicate capture group name"); }
+          }
+        } else {
+          state.raise("Duplicate capture group name");
+        }
+      }
+      if (trackDisjunction) {
+        (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
+      } else {
+        state.groupNames[state.lastStringValue] = true;
+      }
+    }
+  };
+
+  // GroupName ::
+  //   `<` RegExpIdentifierName `>`
+  // Note: this updates `state.lastStringValue` property with the eaten name.
+  pp$1.regexp_eatGroupName = function(state) {
+    state.lastStringValue = "";
+    if (state.eat(0x3C /* < */)) {
+      if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
+        return true
+      }
+      state.raise("Invalid capture group name");
+    }
+    return false
+  };
+
+  // RegExpIdentifierName ::
+  //   RegExpIdentifierStart
+  //   RegExpIdentifierName RegExpIdentifierPart
+  // Note: this updates `state.lastStringValue` property with the eaten name.
+  pp$1.regexp_eatRegExpIdentifierName = function(state) {
+    state.lastStringValue = "";
+    if (this.regexp_eatRegExpIdentifierStart(state)) {
+      state.lastStringValue += codePointToString(state.lastIntValue);
+      while (this.regexp_eatRegExpIdentifierPart(state)) {
+        state.lastStringValue += codePointToString(state.lastIntValue);
+      }
+      return true
+    }
+    return false
+  };
+
+  // RegExpIdentifierStart ::
+  //   UnicodeIDStart
+  //   `$`
+  //   `_`
+  //   `\` RegExpUnicodeEscapeSequence[+U]
+  pp$1.regexp_eatRegExpIdentifierStart = function(state) {
+    var start = state.pos;
+    var forceU = this.options.ecmaVersion >= 11;
+    var ch = state.current(forceU);
+    state.advance(forceU);
+
+    if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
+      ch = state.lastIntValue;
+    }
+    if (isRegExpIdentifierStart(ch)) {
+      state.lastIntValue = ch;
+      return true
+    }
+
+    state.pos = start;
+    return false
+  };
+  function isRegExpIdentifierStart(ch) {
+    return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
+  }
+
+  // RegExpIdentifierPart ::
+  //   UnicodeIDContinue
+  //   `$`
+  //   `_`
+  //   `\` RegExpUnicodeEscapeSequence[+U]
+  //   
+  //   
+  pp$1.regexp_eatRegExpIdentifierPart = function(state) {
+    var start = state.pos;
+    var forceU = this.options.ecmaVersion >= 11;
+    var ch = state.current(forceU);
+    state.advance(forceU);
+
+    if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
+      ch = state.lastIntValue;
+    }
+    if (isRegExpIdentifierPart(ch)) {
+      state.lastIntValue = ch;
+      return true
+    }
+
+    state.pos = start;
+    return false
+  };
+  function isRegExpIdentifierPart(ch) {
+    return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /*  */ || ch === 0x200D /*  */
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
+  pp$1.regexp_eatAtomEscape = function(state) {
+    if (
+      this.regexp_eatBackReference(state) ||
+      this.regexp_eatCharacterClassEscape(state) ||
+      this.regexp_eatCharacterEscape(state) ||
+      (state.switchN && this.regexp_eatKGroupName(state))
+    ) {
+      return true
+    }
+    if (state.switchU) {
+      // Make the same message as V8.
+      if (state.current() === 0x63 /* c */) {
+        state.raise("Invalid unicode escape");
+      }
+      state.raise("Invalid escape");
+    }
+    return false
+  };
+  pp$1.regexp_eatBackReference = function(state) {
+    var start = state.pos;
+    if (this.regexp_eatDecimalEscape(state)) {
+      var n = state.lastIntValue;
+      if (state.switchU) {
+        // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
+        if (n > state.maxBackReference) {
+          state.maxBackReference = n;
+        }
+        return true
+      }
+      if (n <= state.numCapturingParens) {
+        return true
+      }
+      state.pos = start;
+    }
+    return false
+  };
+  pp$1.regexp_eatKGroupName = function(state) {
+    if (state.eat(0x6B /* k */)) {
+      if (this.regexp_eatGroupName(state)) {
+        state.backReferenceNames.push(state.lastStringValue);
+        return true
+      }
+      state.raise("Invalid named reference");
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
+  pp$1.regexp_eatCharacterEscape = function(state) {
+    return (
+      this.regexp_eatControlEscape(state) ||
+      this.regexp_eatCControlLetter(state) ||
+      this.regexp_eatZero(state) ||
+      this.regexp_eatHexEscapeSequence(state) ||
+      this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
+      (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
+      this.regexp_eatIdentityEscape(state)
+    )
+  };
+  pp$1.regexp_eatCControlLetter = function(state) {
+    var start = state.pos;
+    if (state.eat(0x63 /* c */)) {
+      if (this.regexp_eatControlLetter(state)) {
+        return true
+      }
+      state.pos = start;
+    }
+    return false
+  };
+  pp$1.regexp_eatZero = function(state) {
+    if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
+      state.lastIntValue = 0;
+      state.advance();
+      return true
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
+  pp$1.regexp_eatControlEscape = function(state) {
+    var ch = state.current();
+    if (ch === 0x74 /* t */) {
+      state.lastIntValue = 0x09; /* \t */
+      state.advance();
+      return true
+    }
+    if (ch === 0x6E /* n */) {
+      state.lastIntValue = 0x0A; /* \n */
+      state.advance();
+      return true
+    }
+    if (ch === 0x76 /* v */) {
+      state.lastIntValue = 0x0B; /* \v */
+      state.advance();
+      return true
+    }
+    if (ch === 0x66 /* f */) {
+      state.lastIntValue = 0x0C; /* \f */
+      state.advance();
+      return true
+    }
+    if (ch === 0x72 /* r */) {
+      state.lastIntValue = 0x0D; /* \r */
+      state.advance();
+      return true
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
+  pp$1.regexp_eatControlLetter = function(state) {
+    var ch = state.current();
+    if (isControlLetter(ch)) {
+      state.lastIntValue = ch % 0x20;
+      state.advance();
+      return true
+    }
+    return false
+  };
+  function isControlLetter(ch) {
+    return (
+      (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
+      (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
+    )
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
+  pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
+    if ( forceU === void 0 ) forceU = false;
+
+    var start = state.pos;
+    var switchU = forceU || state.switchU;
+
+    if (state.eat(0x75 /* u */)) {
+      if (this.regexp_eatFixedHexDigits(state, 4)) {
+        var lead = state.lastIntValue;
+        if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
+          var leadSurrogateEnd = state.pos;
+          if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
+            var trail = state.lastIntValue;
+            if (trail >= 0xDC00 && trail <= 0xDFFF) {
+              state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
+              return true
+            }
+          }
+          state.pos = leadSurrogateEnd;
+          state.lastIntValue = lead;
+        }
+        return true
+      }
+      if (
+        switchU &&
+        state.eat(0x7B /* { */) &&
+        this.regexp_eatHexDigits(state) &&
+        state.eat(0x7D /* } */) &&
+        isValidUnicode(state.lastIntValue)
+      ) {
+        return true
+      }
+      if (switchU) {
+        state.raise("Invalid unicode escape");
+      }
+      state.pos = start;
+    }
+
+    return false
+  };
+  function isValidUnicode(ch) {
+    return ch >= 0 && ch <= 0x10FFFF
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
+  pp$1.regexp_eatIdentityEscape = function(state) {
+    if (state.switchU) {
+      if (this.regexp_eatSyntaxCharacter(state)) {
+        return true
+      }
+      if (state.eat(0x2F /* / */)) {
+        state.lastIntValue = 0x2F; /* / */
+        return true
+      }
+      return false
+    }
+
+    var ch = state.current();
+    if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
+      state.lastIntValue = ch;
+      state.advance();
+      return true
+    }
+
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
+  pp$1.regexp_eatDecimalEscape = function(state) {
+    state.lastIntValue = 0;
+    var ch = state.current();
+    if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
+      do {
+        state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
+        state.advance();
+      } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
+      return true
+    }
+    return false
+  };
+
+  // Return values used by character set parsing methods, needed to
+  // forbid negation of sets that can match strings.
+  var CharSetNone = 0; // Nothing parsed
+  var CharSetOk = 1; // Construct parsed, cannot contain strings
+  var CharSetString = 2; // Construct parsed, can contain strings
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
+  pp$1.regexp_eatCharacterClassEscape = function(state) {
+    var ch = state.current();
+
+    if (isCharacterClassEscape(ch)) {
+      state.lastIntValue = -1;
+      state.advance();
+      return CharSetOk
+    }
+
+    var negate = false;
+    if (
+      state.switchU &&
+      this.options.ecmaVersion >= 9 &&
+      ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */)
+    ) {
+      state.lastIntValue = -1;
+      state.advance();
+      var result;
+      if (
+        state.eat(0x7B /* { */) &&
+        (result = this.regexp_eatUnicodePropertyValueExpression(state)) &&
+        state.eat(0x7D /* } */)
+      ) {
+        if (negate && result === CharSetString) { state.raise("Invalid property name"); }
+        return result
+      }
+      state.raise("Invalid property name");
+    }
+
+    return CharSetNone
+  };
+
+  function isCharacterClassEscape(ch) {
+    return (
+      ch === 0x64 /* d */ ||
+      ch === 0x44 /* D */ ||
+      ch === 0x73 /* s */ ||
+      ch === 0x53 /* S */ ||
+      ch === 0x77 /* w */ ||
+      ch === 0x57 /* W */
+    )
+  }
+
+  // UnicodePropertyValueExpression ::
+  //   UnicodePropertyName `=` UnicodePropertyValue
+  //   LoneUnicodePropertyNameOrValue
+  pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
+    var start = state.pos;
+
+    // UnicodePropertyName `=` UnicodePropertyValue
+    if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
+      var name = state.lastStringValue;
+      if (this.regexp_eatUnicodePropertyValue(state)) {
+        var value = state.lastStringValue;
+        this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
+        return CharSetOk
+      }
+    }
+    state.pos = start;
+
+    // LoneUnicodePropertyNameOrValue
+    if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
+      var nameOrValue = state.lastStringValue;
+      return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)
+    }
+    return CharSetNone
+  };
+
+  pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
+    if (!hasOwn(state.unicodeProperties.nonBinary, name))
+      { state.raise("Invalid property name"); }
+    if (!state.unicodeProperties.nonBinary[name].test(value))
+      { state.raise("Invalid property value"); }
+  };
+
+  pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
+    if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk }
+    if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString }
+    state.raise("Invalid property name");
+  };
+
+  // UnicodePropertyName ::
+  //   UnicodePropertyNameCharacters
+  pp$1.regexp_eatUnicodePropertyName = function(state) {
+    var ch = 0;
+    state.lastStringValue = "";
+    while (isUnicodePropertyNameCharacter(ch = state.current())) {
+      state.lastStringValue += codePointToString(ch);
+      state.advance();
+    }
+    return state.lastStringValue !== ""
+  };
+
+  function isUnicodePropertyNameCharacter(ch) {
+    return isControlLetter(ch) || ch === 0x5F /* _ */
+  }
+
+  // UnicodePropertyValue ::
+  //   UnicodePropertyValueCharacters
+  pp$1.regexp_eatUnicodePropertyValue = function(state) {
+    var ch = 0;
+    state.lastStringValue = "";
+    while (isUnicodePropertyValueCharacter(ch = state.current())) {
+      state.lastStringValue += codePointToString(ch);
+      state.advance();
+    }
+    return state.lastStringValue !== ""
+  };
+  function isUnicodePropertyValueCharacter(ch) {
+    return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
+  }
+
+  // LoneUnicodePropertyNameOrValue ::
+  //   UnicodePropertyValueCharacters
+  pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
+    return this.regexp_eatUnicodePropertyValue(state)
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
+  pp$1.regexp_eatCharacterClass = function(state) {
+    if (state.eat(0x5B /* [ */)) {
+      var negate = state.eat(0x5E /* ^ */);
+      var result = this.regexp_classContents(state);
+      if (!state.eat(0x5D /* ] */))
+        { state.raise("Unterminated character class"); }
+      if (negate && result === CharSetString)
+        { state.raise("Negated character class may contain strings"); }
+      return true
+    }
+    return false
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassContents
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
+  pp$1.regexp_classContents = function(state) {
+    if (state.current() === 0x5D /* ] */) { return CharSetOk }
+    if (state.switchV) { return this.regexp_classSetExpression(state) }
+    this.regexp_nonEmptyClassRanges(state);
+    return CharSetOk
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
+  pp$1.regexp_nonEmptyClassRanges = function(state) {
+    while (this.regexp_eatClassAtom(state)) {
+      var left = state.lastIntValue;
+      if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
+        var right = state.lastIntValue;
+        if (state.switchU && (left === -1 || right === -1)) {
+          state.raise("Invalid character class");
+        }
+        if (left !== -1 && right !== -1 && left > right) {
+          state.raise("Range out of order in character class");
+        }
+      }
+    }
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
+  pp$1.regexp_eatClassAtom = function(state) {
+    var start = state.pos;
+
+    if (state.eat(0x5C /* \ */)) {
+      if (this.regexp_eatClassEscape(state)) {
+        return true
+      }
+      if (state.switchU) {
+        // Make the same message as V8.
+        var ch$1 = state.current();
+        if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
+          state.raise("Invalid class escape");
+        }
+        state.raise("Invalid escape");
+      }
+      state.pos = start;
+    }
+
+    var ch = state.current();
+    if (ch !== 0x5D /* ] */) {
+      state.lastIntValue = ch;
+      state.advance();
+      return true
+    }
+
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
+  pp$1.regexp_eatClassEscape = function(state) {
+    var start = state.pos;
+
+    if (state.eat(0x62 /* b */)) {
+      state.lastIntValue = 0x08; /*  */
+      return true
+    }
+
+    if (state.switchU && state.eat(0x2D /* - */)) {
+      state.lastIntValue = 0x2D; /* - */
+      return true
+    }
+
+    if (!state.switchU && state.eat(0x63 /* c */)) {
+      if (this.regexp_eatClassControlLetter(state)) {
+        return true
+      }
+      state.pos = start;
+    }
+
+    return (
+      this.regexp_eatCharacterClassEscape(state) ||
+      this.regexp_eatCharacterEscape(state)
+    )
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassSetExpression
+  // https://tc39.es/ecma262/#prod-ClassUnion
+  // https://tc39.es/ecma262/#prod-ClassIntersection
+  // https://tc39.es/ecma262/#prod-ClassSubtraction
+  pp$1.regexp_classSetExpression = function(state) {
+    var result = CharSetOk, subResult;
+    if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) {
+      if (subResult === CharSetString) { result = CharSetString; }
+      // https://tc39.es/ecma262/#prod-ClassIntersection
+      var start = state.pos;
+      while (state.eatChars([0x26, 0x26] /* && */)) {
+        if (
+          state.current() !== 0x26 /* & */ &&
+          (subResult = this.regexp_eatClassSetOperand(state))
+        ) {
+          if (subResult !== CharSetString) { result = CharSetOk; }
+          continue
+        }
+        state.raise("Invalid character in character class");
+      }
+      if (start !== state.pos) { return result }
+      // https://tc39.es/ecma262/#prod-ClassSubtraction
+      while (state.eatChars([0x2D, 0x2D] /* -- */)) {
+        if (this.regexp_eatClassSetOperand(state)) { continue }
+        state.raise("Invalid character in character class");
+      }
+      if (start !== state.pos) { return result }
+    } else {
+      state.raise("Invalid character in character class");
+    }
+    // https://tc39.es/ecma262/#prod-ClassUnion
+    for (;;) {
+      if (this.regexp_eatClassSetRange(state)) { continue }
+      subResult = this.regexp_eatClassSetOperand(state);
+      if (!subResult) { return result }
+      if (subResult === CharSetString) { result = CharSetString; }
+    }
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassSetRange
+  pp$1.regexp_eatClassSetRange = function(state) {
+    var start = state.pos;
+    if (this.regexp_eatClassSetCharacter(state)) {
+      var left = state.lastIntValue;
+      if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) {
+        var right = state.lastIntValue;
+        if (left !== -1 && right !== -1 && left > right) {
+          state.raise("Range out of order in character class");
+        }
+        return true
+      }
+      state.pos = start;
+    }
+    return false
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassSetOperand
+  pp$1.regexp_eatClassSetOperand = function(state) {
+    if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk }
+    return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state)
+  };
+
+  // https://tc39.es/ecma262/#prod-NestedClass
+  pp$1.regexp_eatNestedClass = function(state) {
+    var start = state.pos;
+    if (state.eat(0x5B /* [ */)) {
+      var negate = state.eat(0x5E /* ^ */);
+      var result = this.regexp_classContents(state);
+      if (state.eat(0x5D /* ] */)) {
+        if (negate && result === CharSetString) {
+          state.raise("Negated character class may contain strings");
+        }
+        return result
+      }
+      state.pos = start;
+    }
+    if (state.eat(0x5C /* \ */)) {
+      var result$1 = this.regexp_eatCharacterClassEscape(state);
+      if (result$1) {
+        return result$1
+      }
+      state.pos = start;
+    }
+    return null
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassStringDisjunction
+  pp$1.regexp_eatClassStringDisjunction = function(state) {
+    var start = state.pos;
+    if (state.eatChars([0x5C, 0x71] /* \q */)) {
+      if (state.eat(0x7B /* { */)) {
+        var result = this.regexp_classStringDisjunctionContents(state);
+        if (state.eat(0x7D /* } */)) {
+          return result
+        }
+      } else {
+        // Make the same message as V8.
+        state.raise("Invalid escape");
+      }
+      state.pos = start;
+    }
+    return null
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents
+  pp$1.regexp_classStringDisjunctionContents = function(state) {
+    var result = this.regexp_classString(state);
+    while (state.eat(0x7C /* | */)) {
+      if (this.regexp_classString(state) === CharSetString) { result = CharSetString; }
+    }
+    return result
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassString
+  // https://tc39.es/ecma262/#prod-NonEmptyClassString
+  pp$1.regexp_classString = function(state) {
+    var count = 0;
+    while (this.regexp_eatClassSetCharacter(state)) { count++; }
+    return count === 1 ? CharSetOk : CharSetString
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassSetCharacter
+  pp$1.regexp_eatClassSetCharacter = function(state) {
+    var start = state.pos;
+    if (state.eat(0x5C /* \ */)) {
+      if (
+        this.regexp_eatCharacterEscape(state) ||
+        this.regexp_eatClassSetReservedPunctuator(state)
+      ) {
+        return true
+      }
+      if (state.eat(0x62 /* b */)) {
+        state.lastIntValue = 0x08; /*  */
+        return true
+      }
+      state.pos = start;
+      return false
+    }
+    var ch = state.current();
+    if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false }
+    if (isClassSetSyntaxCharacter(ch)) { return false }
+    state.advance();
+    state.lastIntValue = ch;
+    return true
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator
+  function isClassSetReservedDoublePunctuatorCharacter(ch) {
+    return (
+      ch === 0x21 /* ! */ ||
+      ch >= 0x23 /* # */ && ch <= 0x26 /* & */ ||
+      ch >= 0x2A /* * */ && ch <= 0x2C /* , */ ||
+      ch === 0x2E /* . */ ||
+      ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ ||
+      ch === 0x5E /* ^ */ ||
+      ch === 0x60 /* ` */ ||
+      ch === 0x7E /* ~ */
+    )
+  }
+
+  // https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter
+  function isClassSetSyntaxCharacter(ch) {
+    return (
+      ch === 0x28 /* ( */ ||
+      ch === 0x29 /* ) */ ||
+      ch === 0x2D /* - */ ||
+      ch === 0x2F /* / */ ||
+      ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ ||
+      ch >= 0x7B /* { */ && ch <= 0x7D /* } */
+    )
+  }
+
+  // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
+  pp$1.regexp_eatClassSetReservedPunctuator = function(state) {
+    var ch = state.current();
+    if (isClassSetReservedPunctuator(ch)) {
+      state.lastIntValue = ch;
+      state.advance();
+      return true
+    }
+    return false
+  };
+
+  // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
+  function isClassSetReservedPunctuator(ch) {
+    return (
+      ch === 0x21 /* ! */ ||
+      ch === 0x23 /* # */ ||
+      ch === 0x25 /* % */ ||
+      ch === 0x26 /* & */ ||
+      ch === 0x2C /* , */ ||
+      ch === 0x2D /* - */ ||
+      ch >= 0x3A /* : */ && ch <= 0x3E /* > */ ||
+      ch === 0x40 /* @ */ ||
+      ch === 0x60 /* ` */ ||
+      ch === 0x7E /* ~ */
+    )
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
+  pp$1.regexp_eatClassControlLetter = function(state) {
+    var ch = state.current();
+    if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
+      state.lastIntValue = ch % 0x20;
+      state.advance();
+      return true
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
+  pp$1.regexp_eatHexEscapeSequence = function(state) {
+    var start = state.pos;
+    if (state.eat(0x78 /* x */)) {
+      if (this.regexp_eatFixedHexDigits(state, 2)) {
+        return true
+      }
+      if (state.switchU) {
+        state.raise("Invalid escape");
+      }
+      state.pos = start;
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
+  pp$1.regexp_eatDecimalDigits = function(state) {
+    var start = state.pos;
+    var ch = 0;
+    state.lastIntValue = 0;
+    while (isDecimalDigit(ch = state.current())) {
+      state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
+      state.advance();
+    }
+    return state.pos !== start
+  };
+  function isDecimalDigit(ch) {
+    return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
+  pp$1.regexp_eatHexDigits = function(state) {
+    var start = state.pos;
+    var ch = 0;
+    state.lastIntValue = 0;
+    while (isHexDigit(ch = state.current())) {
+      state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
+      state.advance();
+    }
+    return state.pos !== start
+  };
+  function isHexDigit(ch) {
+    return (
+      (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
+      (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
+      (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
+    )
+  }
+  function hexToInt(ch) {
+    if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
+      return 10 + (ch - 0x41 /* A */)
+    }
+    if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
+      return 10 + (ch - 0x61 /* a */)
+    }
+    return ch - 0x30 /* 0 */
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
+  // Allows only 0-377(octal) i.e. 0-255(decimal).
+  pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {
+    if (this.regexp_eatOctalDigit(state)) {
+      var n1 = state.lastIntValue;
+      if (this.regexp_eatOctalDigit(state)) {
+        var n2 = state.lastIntValue;
+        if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
+          state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
+        } else {
+          state.lastIntValue = n1 * 8 + n2;
+        }
+      } else {
+        state.lastIntValue = n1;
+      }
+      return true
+    }
+    return false
+  };
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
+  pp$1.regexp_eatOctalDigit = function(state) {
+    var ch = state.current();
+    if (isOctalDigit(ch)) {
+      state.lastIntValue = ch - 0x30; /* 0 */
+      state.advance();
+      return true
+    }
+    state.lastIntValue = 0;
+    return false
+  };
+  function isOctalDigit(ch) {
+    return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
+  }
+
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
+  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
+  // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
+  pp$1.regexp_eatFixedHexDigits = function(state, length) {
+    var start = state.pos;
+    state.lastIntValue = 0;
+    for (var i = 0; i < length; ++i) {
+      var ch = state.current();
+      if (!isHexDigit(ch)) {
+        state.pos = start;
+        return false
+      }
+      state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
+      state.advance();
+    }
+    return true
+  };
+
+  // Object type used to represent tokens. Note that normally, tokens
+  // simply exist as properties on the parser object. This is only
+  // used for the onToken callback and the external tokenizer.
+
+  var Token = function Token(p) {
+    this.type = p.type;
+    this.value = p.value;
+    this.start = p.start;
+    this.end = p.end;
+    if (p.options.locations)
+      { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
+    if (p.options.ranges)
+      { this.range = [p.start, p.end]; }
+  };
+
+  // ## Tokenizer
+
+  var pp = Parser.prototype;
+
+  // Move to the next token
+
+  pp.next = function(ignoreEscapeSequenceInKeyword) {
+    if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
+      { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
+    if (this.options.onToken)
+      { this.options.onToken(new Token(this)); }
+
+    this.lastTokEnd = this.end;
+    this.lastTokStart = this.start;
+    this.lastTokEndLoc = this.endLoc;
+    this.lastTokStartLoc = this.startLoc;
+    this.nextToken();
+  };
+
+  pp.getToken = function() {
+    this.next();
+    return new Token(this)
+  };
+
+  // If we're in an ES6 environment, make parsers iterable
+  if (typeof Symbol !== "undefined")
+    { pp[Symbol.iterator] = function() {
+      var this$1$1 = this;
+
+      return {
+        next: function () {
+          var token = this$1$1.getToken();
+          return {
+            done: token.type === types$1.eof,
+            value: token
+          }
+        }
+      }
+    }; }
+
+  // Toggle strict mode. Re-reads the next number or string to please
+  // pedantic tests (`"use strict"; 010;` should fail).
+
+  // Read a single token, updating the parser object's token-related
+  // properties.
+
+  pp.nextToken = function() {
+    var curContext = this.curContext();
+    if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }
+
+    this.start = this.pos;
+    if (this.options.locations) { this.startLoc = this.curPosition(); }
+    if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }
+
+    if (curContext.override) { return curContext.override(this) }
+    else { this.readToken(this.fullCharCodeAtPos()); }
+  };
+
+  pp.readToken = function(code) {
+    // Identifier or keyword. '\uXXXX' sequences are allowed in
+    // identifiers, so '\' also dispatches to that.
+    if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
+      { return this.readWord() }
+
+    return this.getTokenFromCode(code)
+  };
+
+  pp.fullCharCodeAtPos = function() {
+    var code = this.input.charCodeAt(this.pos);
+    if (code <= 0xd7ff || code >= 0xdc00) { return code }
+    var next = this.input.charCodeAt(this.pos + 1);
+    return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00
+  };
+
+  pp.skipBlockComment = function() {
+    var startLoc = this.options.onComment && this.curPosition();
+    var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
+    if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
+    this.pos = end + 2;
+    if (this.options.locations) {
+      for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
+        ++this.curLine;
+        pos = this.lineStart = nextBreak;
+      }
+    }
+    if (this.options.onComment)
+      { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
+                             startLoc, this.curPosition()); }
+  };
+
+  pp.skipLineComment = function(startSkip) {
+    var start = this.pos;
+    var startLoc = this.options.onComment && this.curPosition();
+    var ch = this.input.charCodeAt(this.pos += startSkip);
+    while (this.pos < this.input.length && !isNewLine(ch)) {
+      ch = this.input.charCodeAt(++this.pos);
+    }
+    if (this.options.onComment)
+      { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
+                             startLoc, this.curPosition()); }
+  };
+
+  // Called at the start of the parse and after every token. Skips
+  // whitespace and comments, and.
+
+  pp.skipSpace = function() {
+    loop: while (this.pos < this.input.length) {
+      var ch = this.input.charCodeAt(this.pos);
+      switch (ch) {
+      case 32: case 160: // ' '
+        ++this.pos;
+        break
+      case 13:
+        if (this.input.charCodeAt(this.pos + 1) === 10) {
+          ++this.pos;
+        }
+      case 10: case 8232: case 8233:
+        ++this.pos;
+        if (this.options.locations) {
+          ++this.curLine;
+          this.lineStart = this.pos;
+        }
+        break
+      case 47: // '/'
+        switch (this.input.charCodeAt(this.pos + 1)) {
+        case 42: // '*'
+          this.skipBlockComment();
+          break
+        case 47:
+          this.skipLineComment(2);
+          break
+        default:
+          break loop
+        }
+        break
+      default:
+        if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
+          ++this.pos;
+        } else {
+          break loop
+        }
+      }
+    }
+  };
+
+  // Called at the end of every token. Sets `end`, `val`, and
+  // maintains `context` and `exprAllowed`, and skips the space after
+  // the token, so that the next one's `start` will point at the
+  // right position.
+
+  pp.finishToken = function(type, val) {
+    this.end = this.pos;
+    if (this.options.locations) { this.endLoc = this.curPosition(); }
+    var prevType = this.type;
+    this.type = type;
+    this.value = val;
+
+    this.updateContext(prevType);
+  };
+
+  // ### Token reading
+
+  // This is the function that is called to fetch the next token. It
+  // is somewhat obscure, because it works in character codes rather
+  // than characters, and because operator parsing has been inlined
+  // into it.
+  //
+  // All in the name of speed.
+  //
+  pp.readToken_dot = function() {
+    var next = this.input.charCodeAt(this.pos + 1);
+    if (next >= 48 && next <= 57) { return this.readNumber(true) }
+    var next2 = this.input.charCodeAt(this.pos + 2);
+    if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
+      this.pos += 3;
+      return this.finishToken(types$1.ellipsis)
+    } else {
+      ++this.pos;
+      return this.finishToken(types$1.dot)
+    }
+  };
+
+  pp.readToken_slash = function() { // '/'
+    var next = this.input.charCodeAt(this.pos + 1);
+    if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
+    if (next === 61) { return this.finishOp(types$1.assign, 2) }
+    return this.finishOp(types$1.slash, 1)
+  };
+
+  pp.readToken_mult_modulo_exp = function(code) { // '%*'
+    var next = this.input.charCodeAt(this.pos + 1);
+    var size = 1;
+    var tokentype = code === 42 ? types$1.star : types$1.modulo;
+
+    // exponentiation operator ** and **=
+    if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
+      ++size;
+      tokentype = types$1.starstar;
+      next = this.input.charCodeAt(this.pos + 2);
+    }
+
+    if (next === 61) { return this.finishOp(types$1.assign, size + 1) }
+    return this.finishOp(tokentype, size)
+  };
+
+  pp.readToken_pipe_amp = function(code) { // '|&'
+    var next = this.input.charCodeAt(this.pos + 1);
+    if (next === code) {
+      if (this.options.ecmaVersion >= 12) {
+        var next2 = this.input.charCodeAt(this.pos + 2);
+        if (next2 === 61) { return this.finishOp(types$1.assign, 3) }
+      }
+      return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)
+    }
+    if (next === 61) { return this.finishOp(types$1.assign, 2) }
+    return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)
+  };
+
+  pp.readToken_caret = function() { // '^'
+    var next = this.input.charCodeAt(this.pos + 1);
+    if (next === 61) { return this.finishOp(types$1.assign, 2) }
+    return this.finishOp(types$1.bitwiseXOR, 1)
+  };
+
+  pp.readToken_plus_min = function(code) { // '+-'
+    var next = this.input.charCodeAt(this.pos + 1);
+    if (next === code) {
+      if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
+          (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
+        // A `-->` line comment
+        this.skipLineComment(3);
+        this.skipSpace();
+        return this.nextToken()
+      }
+      return this.finishOp(types$1.incDec, 2)
+    }
+    if (next === 61) { return this.finishOp(types$1.assign, 2) }
+    return this.finishOp(types$1.plusMin, 1)
+  };
+
+  pp.readToken_lt_gt = function(code) { // '<>'
+    var next = this.input.charCodeAt(this.pos + 1);
+    var size = 1;
+    if (next === code) {
+      size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
+      if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }
+      return this.finishOp(types$1.bitShift, size)
+    }
+    if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
+        this.input.charCodeAt(this.pos + 3) === 45) {
+      // `` line comment
+      this.skipLineComment(3);
+      this.skipSpace();
+      return this.nextToken()
+    }
+    return this.finishOp(types$1.incDec, 2)
+  }
+  if (next === 61) { return this.finishOp(types$1.assign, 2) }
+  return this.finishOp(types$1.plusMin, 1)
+};
+
+pp.readToken_lt_gt = function(code) { // '<>'
+  var next = this.input.charCodeAt(this.pos + 1);
+  var size = 1;
+  if (next === code) {
+    size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
+    if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }
+    return this.finishOp(types$1.bitShift, size)
+  }
+  if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
+      this.input.charCodeAt(this.pos + 3) === 45) {
+    // `
+
+## Sponsors
+
+The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
+to get your logo on our READMEs and [website](https://eslint.org/sponsors).
+
+

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

trunk.io

Silver Sponsors

+

JetBrains Liftoff American Express Workleap

Bronze Sponsors

+

WordHint Anagram Solver Icons8 Discord GitBook Nx HeroCoders

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/node_modules/eslint-scope/dist/eslint-scope.cjs b/node_modules/eslint-scope/dist/eslint-scope.cjs new file mode 100644 index 0000000..0c41a3f --- /dev/null +++ b/node_modules/eslint-scope/dist/eslint-scope.cjs @@ -0,0 +1,2282 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var estraverse = require('estraverse'); +var esrecurse = require('esrecurse'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var estraverse__default = /*#__PURE__*/_interopDefaultLegacy(estraverse); +var esrecurse__default = /*#__PURE__*/_interopDefaultLegacy(esrecurse); + +/** + * @fileoverview Assertion utilities. + * @author Nicholas C. Zakas + */ + +/** + * Throws an error if the given condition is not truthy. + * @param {boolean} condition The condition to check. + * @param {string} message The message to include with the error. + * @returns {void} + * @throws {Error} When the condition is not truthy. + */ +function assert(condition, message = "Assertion failed.") { + if (!condition) { + throw new Error(message); + } +} + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const READ = 0x1; +const WRITE = 0x2; +const RW = READ | WRITE; + +/** + * A Reference represents a single occurrence of an identifier in code. + * @constructor Reference + */ +class Reference { + constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { + + /** + * Identifier syntax node. + * @member {espreeIdentifier} Reference#identifier + */ + this.identifier = ident; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Reference#from + */ + this.from = scope; + + /** + * Whether the reference comes from a dynamic scope (such as 'eval', + * 'with', etc.), and may be trapped by dynamic scopes. + * @member {boolean} Reference#tainted + */ + this.tainted = false; + + /** + * The variable this reference is resolved with. + * @member {Variable} Reference#resolved + */ + this.resolved = null; + + /** + * The read-write mode of the reference. (Value is one of {@link + * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). + * @member {number} Reference#flag + * @private + */ + this.flag = flag; + if (this.isWrite()) { + + /** + * If reference is writeable, this is the tree being written to it. + * @member {espreeNode} Reference#writeExpr + */ + this.writeExpr = writeExpr; + + /** + * Whether the Reference might refer to a partial value of writeExpr. + * @member {boolean} Reference#partial + */ + this.partial = partial; + + /** + * Whether the Reference is to write of initialization. + * @member {boolean} Reference#init + */ + this.init = init; + } + this.__maybeImplicitGlobal = maybeImplicitGlobal; + } + + /** + * Whether the reference is static. + * @function Reference#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.tainted && this.resolved && this.resolved.scope.isStatic(); + } + + /** + * Whether the reference is writeable. + * @function Reference#isWrite + * @returns {boolean} write + */ + isWrite() { + return !!(this.flag & Reference.WRITE); + } + + /** + * Whether the reference is readable. + * @function Reference#isRead + * @returns {boolean} read + */ + isRead() { + return !!(this.flag & Reference.READ); + } + + /** + * Whether the reference is read-only. + * @function Reference#isReadOnly + * @returns {boolean} read only + */ + isReadOnly() { + return this.flag === Reference.READ; + } + + /** + * Whether the reference is write-only. + * @function Reference#isWriteOnly + * @returns {boolean} write only + */ + isWriteOnly() { + return this.flag === Reference.WRITE; + } + + /** + * Whether the reference is read-write. + * @function Reference#isReadWrite + * @returns {boolean} read write + */ + isReadWrite() { + return this.flag === Reference.RW; + } +} + +/** + * @constant Reference.READ + * @private + */ +Reference.READ = READ; + +/** + * @constant Reference.WRITE + * @private + */ +Reference.WRITE = WRITE; + +/** + * @constant Reference.RW + * @private + */ +Reference.RW = RW; + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * A Variable represents a locally scoped identifier. These include arguments to + * functions. + * @constructor Variable + */ +class Variable { + constructor(name, scope) { + + /** + * The variable name, as given in the source code. + * @member {string} Variable#name + */ + this.name = name; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as AST nodes. + * @member {espree.Identifier[]} Variable#identifiers + */ + this.identifiers = []; + + /** + * List of {@link Reference|references} of this variable (excluding parameter entries) + * in its defining scope and all nested scopes. For defining + * occurrences only see {@link Variable#defs}. + * @member {Reference[]} Variable#references + */ + this.references = []; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as custom objects. + * @member {Definition[]} Variable#defs + */ + this.defs = []; + + this.tainted = false; + + /** + * Whether this is a stack variable. + * @member {boolean} Variable#stack + */ + this.stack = true; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Variable#scope + */ + this.scope = scope; + } +} + +Variable.CatchClause = "CatchClause"; +Variable.Parameter = "Parameter"; +Variable.FunctionName = "FunctionName"; +Variable.ClassName = "ClassName"; +Variable.Variable = "Variable"; +Variable.ImportBinding = "ImportBinding"; +Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @constructor Definition + */ +class Definition { + constructor(type, name, node, parent, index, kind) { + + /** + * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). + */ + this.type = type; + + /** + * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. + */ + this.name = name; + + /** + * @member {espree.Node} Definition#node - the enclosing node of the identifier. + */ + this.node = node; + + /** + * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. + */ + this.parent = parent; + + /** + * @member {number?} Definition#index - the index in the declaration statement. + */ + this.index = index; + + /** + * @member {string?} Definition#kind - the kind of the declaration statement. + */ + this.kind = kind; + } +} + +/** + * @constructor ParameterDefinition + */ +class ParameterDefinition extends Definition { + constructor(name, node, index, rest) { + super(Variable.Parameter, name, node, null, index, null); + + /** + * Whether the parameter definition is a part of a rest parameter. + * @member {boolean} ParameterDefinition#rest + */ + this.rest = rest; + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const { Syntax: Syntax$2 } = estraverse__default["default"]; + +/** + * Test if scope is struct + * @param {Scope} scope scope + * @param {Block} block block + * @param {boolean} isMethodDefinition is method definition + * @returns {boolean} is strict scope + */ +function isStrictScope(scope, block, isMethodDefinition) { + let body; + + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper && scope.upper.isStrict) { + return true; + } + + if (isMethodDefinition) { + return true; + } + + if (scope.type === "class" || scope.type === "module") { + return true; + } + + if (scope.type === "block" || scope.type === "switch") { + return false; + } + + if (scope.type === "function") { + if (block.type === Syntax$2.ArrowFunctionExpression && block.body.type !== Syntax$2.BlockStatement) { + return false; + } + + if (block.type === Syntax$2.Program) { + body = block; + } else { + body = block.body; + } + + if (!body) { + return false; + } + } else if (scope.type === "global") { + body = block; + } else { + return false; + } + + // Search for a 'use strict' directive. + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + /* + * Check if the current statement is a directive. + * If it isn't, then we're past the directive prologue + * so stop the search because directives cannot + * appear after this point. + * + * Some parsers set `directive:null` on non-directive + * statements, so the `typeof` check is safer than + * checking for property existence. + */ + if (typeof stmt.directive !== "string") { + break; + } + + if (stmt.directive === "use strict") { + return true; + } + } + + return false; +} + +/** + * Register scope + * @param {ScopeManager} scopeManager scope manager + * @param {Scope} scope scope + * @returns {void} + */ +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + + const scopes = scopeManager.__nodeToScope.get(scope.block); + + if (scopes) { + scopes.push(scope); + } else { + scopeManager.__nodeToScope.set(scope.block, [scope]); + } +} + +/** + * Should be statically + * @param {Object} def def + * @returns {boolean} should be statically + */ +function shouldBeStatically(def) { + return ( + (def.type === Variable.ClassName) || + (def.type === Variable.Variable && def.parent.kind !== "var") + ); +} + +/** + * @constructor Scope + */ +class Scope { + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + + /** + * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for", + * "class", "class-field-initializer", "class-static-block". + * @member {string} Scope#type + */ + this.type = type; + + /** + * The scoped {@link Variable}s of this scope, as { Variable.name + * : Variable }. + * @member {Map} Scope#set + */ + this.set = new Map(); + + /** + * The tainted variables of this scope, as { Variable.name : + * boolean }. + * @member {Map} Scope#taints + */ + this.taints = new Map(); + + /** + * Generally, through the lexical scoping of JS you can always know + * which variable an identifier in the source code refers to. There are + * a few exceptions to this rule. With 'global' and 'with' scopes you + * can only decide at runtime which variable a reference refers to. + * Moreover, if 'eval()' is used in a scope, it might introduce new + * bindings in this or its parent scopes. + * All those scopes are considered 'dynamic'. + * @member {boolean} Scope#dynamic + */ + this.dynamic = this.type === "global" || this.type === "with"; + + /** + * A reference to the scope-defining syntax node. + * @member {espree.Node} Scope#block + */ + this.block = block; + + /** + * The {@link Reference|references} that are not resolved with this scope. + * @member {Reference[]} Scope#through + */ + this.through = []; + + /** + * The scoped {@link Variable}s of this scope. In the case of a + * 'function' scope this includes the automatic argument arguments as + * its first element, as well as all further formal arguments. + * @member {Variable[]} Scope#variables + */ + this.variables = []; + + /** + * Any variable {@link Reference|reference} found in this scope. This + * includes occurrences of local variables as well as variables from + * parent scopes (including the global scope). For local variables + * this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the + * formal parameter in the parameter list. + * @member {Reference[]} Scope#references + */ + this.references = []; + + /** + * For 'global' and 'function' scopes, this is a self-reference. For + * other scope types this is the variableScope value of the + * parent scope. + * @member {Scope} Scope#variableScope + */ + this.variableScope = + this.type === "global" || + this.type === "module" || + this.type === "function" || + this.type === "class-field-initializer" || + this.type === "class-static-block" + ? this + : upperScope.variableScope; + + /** + * Whether this scope is created by a FunctionExpression. + * @member {boolean} Scope#functionExpressionScope + */ + this.functionExpressionScope = false; + + /** + * Whether this is a scope that contains an 'eval()' invocation. + * @member {boolean} Scope#directCallToEvalScope + */ + this.directCallToEvalScope = false; + + /** + * @member {boolean} Scope#thisFound + */ + this.thisFound = false; + + this.__left = []; + + /** + * Reference to the parent {@link Scope|scope}. + * @member {Scope} Scope#upper + */ + this.upper = upperScope; + + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = scopeManager.isStrictModeSupported() + ? isStrictScope(this, block, isMethodDefinition) + : false; + + /** + * List of nested {@link Scope}s. + * @member {Scope[]} Scope#childScopes + */ + this.childScopes = []; + if (this.upper) { + this.upper.childScopes.push(this); + } + + this.__declaredVariables = scopeManager.__declaredVariables; + + registerScope(scopeManager, this); + } + + __shouldStaticallyClose(scopeManager) { + return (!this.dynamic || scopeManager.__isOptimistic()); + } + + __shouldStaticallyCloseForGlobal(ref) { + + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + + const variable = this.set.get(name); + const defs = variable.defs; + + return defs.length > 0 && defs.every(shouldBeStatically); + } + + __staticCloseRef(ref) { + if (!this.__resolve(ref)) { + this.__delegateToUpperScope(ref); + } + } + + __dynamicCloseRef(ref) { + + // notify all names are through to global + let current = this; + + do { + current.through.push(ref); + current = current.upper; + } while (current); + } + + __globalCloseRef(ref) { + + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.__shouldStaticallyCloseForGlobal(ref)) { + this.__staticCloseRef(ref); + } else { + this.__dynamicCloseRef(ref); + } + } + + __close(scopeManager) { + let closeRef; + + if (this.__shouldStaticallyClose(scopeManager)) { + closeRef = this.__staticCloseRef; + } else if (this.type !== "global") { + closeRef = this.__dynamicCloseRef; + } else { + closeRef = this.__globalCloseRef; + } + + // Try Resolving all references in this scope. + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + closeRef.call(this, ref); + } + this.__left = null; + + return this.upper; + } + + // To override by function scopes. + // References in default parameters isn't resolved to variables which are in their function body. + __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars -- Desired as instance method with signature + return true; + } + + __resolve(ref) { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + + if (!this.__isValidResolution(ref, variable)) { + return false; + } + variable.references.push(ref); + variable.stack = variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + + return true; + } + + __delegateToUpperScope(ref) { + if (this.upper) { + this.upper.__left.push(ref); + } + this.through.push(ref); + } + + __addDeclaredVariablesOfNode(variable, node) { + if (node === null || node === void 0) { + return; + } + + let variables = this.__declaredVariables.get(node); + + if (variables === null || variables === void 0) { + variables = []; + this.__declaredVariables.set(node, variables); + } + if (!variables.includes(variable)) { + variables.push(variable); + } + } + + __defineGeneric(name, set, variables, node, def) { + let variable; + + variable = set.get(name); + if (!variable) { + variable = new Variable(name, this); + set.set(name, variable); + variables.push(variable); + } + + if (def) { + variable.defs.push(def); + this.__addDeclaredVariablesOfNode(variable, def.node); + this.__addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + + __define(node, def) { + if (node && node.type === Syntax$2.Identifier) { + this.__defineGeneric( + node.name, + this.set, + this.variables, + node, + def + ); + } + } + + __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { + + // because Array element may be null + if (!node || node.type !== Syntax$2.Identifier) { + return; + } + + // Specially handle like `this`. + if (node.name === "super") { + return; + } + + const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); + + this.references.push(ref); + this.__left.push(ref); + } + + __detectEval() { + let current = this; + + this.directCallToEvalScope = true; + do { + current.dynamic = true; + current = current.upper; + } while (current); + } + + __detectThis() { + this.thisFound = true; + } + + __isClosed() { + return this.__left === null; + } + + /** + * returns resolved {Reference} + * @function Scope#resolve + * @param {Espree.Identifier} ident identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident) { + let ref, i, iz; + + assert(this.__isClosed(), "Scope should be closed."); + assert(ident.type === Syntax$2.Identifier, "Target should be identifier."); + for (i = 0, iz = this.references.length; i < iz; ++i) { + ref = this.references[i]; + if (ref.identifier === ident) { + return ref; + } + } + return null; + } + + /** + * returns this scope is static + * @function Scope#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.dynamic; + } + + /** + * returns this scope has materialized arguments + * @function Scope#isArgumentsMaterialized + * @returns {boolean} arguemnts materialized + */ + isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this -- Desired as instance method + return true; + } + + /** + * returns this scope has materialized `this` reference + * @function Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized() { // eslint-disable-line class-methods-use-this -- Desired as instance method + return true; + } + + isUsedName(name) { + if (this.set.has(name)) { + return true; + } + for (let i = 0, iz = this.through.length; i < iz; ++i) { + if (this.through[i].identifier.name === name) { + return true; + } + } + return false; + } +} + +/** + * Global scope. + */ +class GlobalScope extends Scope { + constructor(scopeManager, block) { + super(scopeManager, "global", null, block, false); + this.implicit = { + set: new Map(), + variables: [], + + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + * @member {Reference[]} Scope#implicit#left + */ + left: [] + }; + } + + __close(scopeManager) { + const implicit = []; + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + implicit.push(ref.__maybeImplicitGlobal); + } + } + + // create an implicit global variable from assignment expression + for (let i = 0, iz = implicit.length; i < iz; ++i) { + const info = implicit[i]; + + this.__defineImplicit(info.pattern, + new Definition( + Variable.ImplicitGlobalVariable, + info.pattern, + info.node, + null, + null, + null + )); + + } + + this.implicit.left = this.__left; + + return super.__close(scopeManager); + } + + __defineImplicit(node, def) { + if (node && node.type === Syntax$2.Identifier) { + this.__defineGeneric( + node.name, + this.implicit.set, + this.implicit.variables, + node, + def + ); + } + } +} + +/** + * Module scope. + */ +class ModuleScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "module", upperScope, block, false); + } +} + +/** + * Function expression name scope. + */ +class FunctionExpressionNameScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "function-expression-name", upperScope, block, false); + this.__define(block.id, + new Definition( + Variable.FunctionName, + block.id, + block, + null, + null, + null + )); + this.functionExpressionScope = true; + } +} + +/** + * Catch scope. + */ +class CatchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "catch", upperScope, block, false); + } +} + +/** + * With statement scope. + */ +class WithScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "with", upperScope, block, false); + } + + __close(scopeManager) { + if (this.__shouldStaticallyClose(scopeManager)) { + return super.__close(scopeManager); + } + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + ref.tainted = true; + this.__delegateToUpperScope(ref); + } + this.__left = null; + + return this.upper; + } +} + +/** + * Block scope. + */ +class BlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "block", upperScope, block, false); + } +} + +/** + * Switch scope. + */ +class SwitchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "switch", upperScope, block, false); + } +} + +/** + * Function scope. + */ +class FunctionScope extends Scope { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, "function", upperScope, block, isMethodDefinition); + + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== Syntax$2.ArrowFunctionExpression) { + this.__defineArguments(); + } + } + + isArgumentsMaterialized() { + + // TODO(Constellation) + // We can more aggressive on this condition like this. + // + // function t() { + // // arguments of t is always hidden. + // function arguments() { + // } + // } + if (this.block.type === Syntax$2.ArrowFunctionExpression) { + return false; + } + + if (!this.isStatic()) { + return true; + } + + const variable = this.set.get("arguments"); + + assert(variable, "Always have arguments variable."); + return variable.tainted || variable.references.length !== 0; + } + + isThisMaterialized() { + if (!this.isStatic()) { + return true; + } + return this.thisFound; + } + + __defineArguments() { + this.__defineGeneric( + "arguments", + this.set, + this.variables, + null, + null + ); + this.taints.set("arguments", true); + } + + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + __isValidResolution(ref, variable) { + + // If `options.nodejsScope` is true, `this.block` becomes a Program node. + if (this.block.type === "Program") { + return true; + } + + const bodyStart = this.block.body.range[0]; + + // It's invalid resolution in the following case: + return !( + variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. + ); + } +} + +/** + * Scope of for, for-in, and for-of statements. + */ +class ForScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "for", upperScope, block, false); + } +} + +/** + * Class scope. + */ +class ClassScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class", upperScope, block, false); + } +} + +/** + * Class field initializer scope. + */ +class ClassFieldInitializerScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class-field-initializer", upperScope, block, true); + } +} + +/** + * Class static block scope. + */ +class ClassStaticBlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class-static-block", upperScope, block, true); + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @constructor ScopeManager + */ +class ScopeManager { + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.__nodeToScope = new WeakMap(); + this.__currentScope = null; + this.__options = options; + this.__declaredVariables = new WeakMap(); + } + + __isOptimistic() { + return this.__options.optimistic; + } + + __ignoreEval() { + return this.__options.ignoreEval; + } + + isGlobalReturn() { + return this.__options.nodejsScope || this.__options.sourceType === "commonjs"; + } + + isModule() { + return this.__options.sourceType === "module"; + } + + isImpliedStrict() { + return this.__options.impliedStrict; + } + + isStrictModeSupported() { + return this.__options.ecmaVersion >= 5; + } + + // Returns appropriate scope for this node. + __get(node) { + return this.__nodeToScope.get(node); + } + + /** + * Get variables that are declared by the node. + * + * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. + * If the node declares nothing, this method returns an empty array. + * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. + * @param {Espree.Node} node a node to get. + * @returns {Variable[]} variables that declared by the node. + */ + getDeclaredVariables(node) { + return this.__declaredVariables.get(node) || []; + } + + /** + * acquire scope from node. + * @function ScopeManager#acquire + * @param {Espree.Node} node node for the acquired scope. + * @param {?boolean} [inner=false] look up the most inner scope, default value is false. + * @returns {Scope?} Scope from node + */ + acquire(node, inner) { + + /** + * predicate + * @param {Scope} testScope scope to test + * @returns {boolean} predicate + */ + function predicate(testScope) { + if (testScope.type === "function" && testScope.functionExpressionScope) { + return false; + } + return true; + } + + const scopes = this.__get(node); + + if (!scopes || scopes.length === 0) { + return null; + } + + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } else { + for (let i = 0, iz = scopes.length; i < iz; ++i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } + + return null; + } + + /** + * acquire all scopes from node. + * @function ScopeManager#acquireAll + * @param {Espree.Node} node node for the acquired scope. + * @returns {Scopes?} Scope array + */ + acquireAll(node) { + return this.__get(node); + } + + /** + * release the node. + * @function ScopeManager#release + * @param {Espree.Node} node releasing node. + * @param {?boolean} [inner=false] look up the most inner scope, default value is false. + * @returns {Scope?} upper scope for the node. + */ + release(node, inner) { + const scopes = this.__get(node); + + if (scopes && scopes.length) { + const scope = scopes[0].upper; + + if (!scope) { + return null; + } + return this.acquire(scope.block, inner); + } + return null; + } + + attach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method + + detach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method + + __nestScope(scope) { + if (scope instanceof GlobalScope) { + assert(this.__currentScope === null); + this.globalScope = scope; + } + this.__currentScope = scope; + return scope; + } + + __nestGlobalScope(node) { + return this.__nestScope(new GlobalScope(this, node)); + } + + __nestBlockScope(node) { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + __nestFunctionScope(node, isMethodDefinition) { + return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); + } + + __nestForScope(node) { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + __nestCatchScope(node) { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + __nestWithScope(node) { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + __nestClassScope(node) { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + __nestClassFieldInitializerScope(node) { + return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node)); + } + + __nestClassStaticBlockScope(node) { + return this.__nestScope(new ClassStaticBlockScope(this, this.__currentScope, node)); + } + + __nestSwitchScope(node) { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + __nestModuleScope(node) { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + __nestFunctionExpressionNameScope(node) { + return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); + } + + __isES6() { + return this.__options.ecmaVersion >= 6; + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const { Syntax: Syntax$1 } = estraverse__default["default"]; + +/** + * Get last array element + * @param {Array} xs array + * @returns {any} Last elment + */ +function getLast(xs) { + return xs.at(-1) || null; +} + +/** + * Visitor for destructuring patterns. + */ +class PatternVisitor extends esrecurse__default["default"].Visitor { + static isPattern(node) { + const nodeType = node.type; + + return ( + nodeType === Syntax$1.Identifier || + nodeType === Syntax$1.ObjectPattern || + nodeType === Syntax$1.ArrayPattern || + nodeType === Syntax$1.SpreadElement || + nodeType === Syntax$1.RestElement || + nodeType === Syntax$1.AssignmentPattern + ); + } + + constructor(options, rootPattern, callback) { + super(null, options); + this.rootPattern = rootPattern; + this.callback = callback; + this.assignments = []; + this.rightHandNodes = []; + this.restElements = []; + } + + Identifier(pattern) { + const lastRestElement = getLast(this.restElements); + + this.callback(pattern, { + topLevel: pattern === this.rootPattern, + rest: lastRestElement !== null && lastRestElement !== void 0 && lastRestElement.argument === pattern, + assignments: this.assignments + }); + } + + Property(property) { + + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + + ArrayPattern(pattern) { + for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { + const element = pattern.elements[i]; + + this.visit(element); + } + } + + AssignmentPattern(pattern) { + this.assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.assignments.pop(); + } + + RestElement(pattern) { + this.restElements.push(pattern); + this.visit(pattern.argument); + this.restElements.pop(); + } + + MemberExpression(node) { + + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + + // + // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. + // By spec, LeftHandSideExpression is Pattern or MemberExpression. + // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) + // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... + // + + SpreadElement(node) { + this.visit(node.argument); + } + + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + + AssignmentExpression(node) { + this.assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.assignments.pop(); + } + + CallExpression(node) { + + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const { Syntax } = estraverse__default["default"]; + +/** + * Traverse identifier in pattern + * @param {Object} options options + * @param {pattern} rootPattern root pattern + * @param {Refencer} referencer referencer + * @param {callback} callback callback + * @returns {void} + */ +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { + + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor(options, rootPattern, callback); + + visitor.visit(rootPattern); + + // Process the right hand nodes recursively. + if (referencer !== null && referencer !== void 0) { + visitor.rightHandNodes.forEach(referencer.visit, referencer); + } +} + +// Importing ImportDeclaration. +// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation +// https://github.com/estree/estree/blob/master/es6.md#importdeclaration +// FIXME: Now, we don't create module environment, because the context is +// implementation dependent. + +/** + * Visitor for import specifiers. + */ +class Importer extends esrecurse__default["default"].Visitor { + constructor(declaration, referencer) { + super(null, referencer.options); + this.declaration = declaration; + this.referencer = referencer; + } + + visitImport(id, specifier) { + this.referencer.visitPattern(id, pattern => { + this.referencer.currentScope().__define(pattern, + new Definition( + Variable.ImportBinding, + pattern, + specifier, + this.declaration, + null, + null + )); + }); + } + + ImportNamespaceSpecifier(node) { + const local = (node.local || node.id); + + if (local) { + this.visitImport(local, node); + } + } + + ImportDefaultSpecifier(node) { + const local = (node.local || node.id); + + this.visitImport(local, node); + } + + ImportSpecifier(node) { + const local = (node.local || node.id); + + if (node.name) { + this.visitImport(node.name, node); + } else { + this.visitImport(local, node); + } + } +} + +/** + * Referencing variables and creating bindings. + */ +class Referencer extends esrecurse__default["default"].Visitor { + constructor(options, scopeManager) { + super(null, options); + this.options = options; + this.scopeManager = scopeManager; + this.parent = null; + this.isInnerMethodDefinition = false; + } + + currentScope() { + return this.scopeManager.__currentScope; + } + + close(node) { + while (this.currentScope() && node === this.currentScope().block) { + this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); + } + } + + pushInnerMethodDefinition(isInnerMethodDefinition) { + const previous = this.isInnerMethodDefinition; + + this.isInnerMethodDefinition = isInnerMethodDefinition; + return previous; + } + + popInnerMethodDefinition(isInnerMethodDefinition) { + this.isInnerMethodDefinition = isInnerMethodDefinition; + } + + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + const scope = this.currentScope(); + + assignments.forEach(assignment => { + scope.__referencing( + pattern, + Reference.WRITE, + assignment.right, + maybeImplicitGlobal, + pattern !== assignment.left, + init + ); + }); + } + + visitPattern(node, options, callback) { + let visitPatternOptions = options; + let visitPatternCallback = callback; + + if (typeof options === "function") { + visitPatternCallback = options; + visitPatternOptions = { processRightHandNodes: false }; + } + + traverseIdentifierInPattern( + this.options, + node, + visitPatternOptions.processRightHandNodes ? this : null, + visitPatternCallback + ); + } + + visitFunction(node) { + let i, iz; + + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + + if (node.type === Syntax.FunctionDeclaration) { + + // id is defined in upper scope + this.currentScope().__define(node.id, + new Definition( + Variable.FunctionName, + node.id, + node, + null, + null, + null + )); + } + + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + if (node.type === Syntax.FunctionExpression && node.id) { + this.scopeManager.__nestFunctionExpressionNameScope(node); + } + + // Consider this function is in the MethodDefinition. + this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); + + const that = this; + + /** + * Visit pattern callback + * @param {pattern} pattern pattern + * @param {Object} info info + * @returns {void} + */ + function visitPatternCallback(pattern, info) { + that.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + i, + info.rest + )); + + that.referencingDefaultValue(pattern, info.assignments, null, true); + } + + // Process parameter declarations. + for (i = 0, iz = node.params.length; i < iz; ++i) { + this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); + } + + // if there's a rest argument, add that + if (node.rest) { + this.visitPattern({ + type: "RestElement", + argument: node.rest + }, pattern => { + this.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + node.params.length, + true + )); + }); + } + + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === Syntax.BlockStatement) { + this.visitChildren(node.body); + } else { + this.visit(node.body); + } + } + + this.close(node); + } + + visitClass(node) { + if (node.type === Syntax.ClassDeclaration) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node, + null, + null, + null + )); + } + + this.scopeManager.__nestClassScope(node); + + if (node.id) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node + )); + } + + this.visit(node.superClass); + this.visit(node.body); + + this.close(node); + } + + visitProperty(node) { + let previous; + + if (node.computed) { + this.visit(node.key); + } + + const isMethodDefinition = node.type === Syntax.MethodDefinition; + + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + this.visit(node.value); + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + } + + visitForIn(node) { + if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + if (node.left.type === Syntax.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); + }); + } else { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); + }); + } + this.visit(node.right); + this.visit(node.body); + + this.close(node); + } + + visitVariableDeclaration(variableTargetScope, type, node, index) { + + const decl = node.declarations[index]; + const init = decl.init; + + this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { + variableTargetScope.__define( + pattern, + new Definition( + type, + pattern, + decl, + node, + index, + node.kind + ) + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); + } + }); + } + + AssignmentExpression(node) { + if (PatternVisitor.isPattern(node.left)) { + if (node.operator === "=") { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); + }); + } else { + this.currentScope().__referencing(node.left, Reference.RW, node.right); + } + } else { + this.visit(node.left); + } + this.visit(node.right); + } + + CatchClause(node) { + this.scopeManager.__nestCatchScope(node); + + this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { + this.currentScope().__define(pattern, + new Definition( + Variable.CatchClause, + pattern, + node, + null, + null, + null + )); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }); + this.visit(node.body); + + this.close(node); + } + + Program(node) { + this.scopeManager.__nestGlobalScope(node); + + if (this.scopeManager.isGlobalReturn()) { + + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.__nestFunctionScope(node, false); + } + + if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { + this.scopeManager.__nestModuleScope(node); + } + + if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + + this.visitChildren(node); + this.close(node); + } + + Identifier(node) { + this.currentScope().__referencing(node); + } + + // eslint-disable-next-line class-methods-use-this -- Desired as instance method + PrivateIdentifier() { + + // Do nothing. + } + + UpdateExpression(node) { + if (PatternVisitor.isPattern(node.argument)) { + this.currentScope().__referencing(node.argument, Reference.RW, null); + } else { + this.visitChildren(node); + } + } + + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + + Property(node) { + this.visitProperty(node); + } + + PropertyDefinition(node) { + const { computed, key, value } = node; + + if (computed) { + this.visit(key); + } + if (value) { + this.scopeManager.__nestClassFieldInitializerScope(value); + this.visit(value); + this.close(value); + } + } + + StaticBlock(node) { + this.scopeManager.__nestClassStaticBlockScope(node); + + this.visitChildren(node); + + this.close(node); + } + + MethodDefinition(node) { + this.visitProperty(node); + } + + BreakStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method + + ContinueStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method + + LabeledStatement(node) { + this.visit(node.body); + } + + ForStatement(node) { + + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates + // per iteration environment. However, escope is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ClassExpression(node) { + this.visitClass(node); + } + + ClassDeclaration(node) { + this.visitClass(node); + } + + CallExpression(node) { + + // Check this is direct call to eval + if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { + + // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and + // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. + this.currentScope().variableScope.__detectEval(); + } + this.visitChildren(node); + } + + BlockStatement(node) { + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestBlockScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ThisExpression() { + this.currentScope().variableScope.__detectThis(); + } + + WithStatement(node) { + this.visit(node.object); + + // Then nest scope for WithStatement. + this.scopeManager.__nestWithScope(node); + + this.visit(node.body); + + this.close(node); + } + + VariableDeclaration(node) { + const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); + + for (let i = 0, iz = node.declarations.length; i < iz; ++i) { + const decl = node.declarations[i]; + + this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); + if (decl.init) { + this.visit(decl.init); + } + } + } + + // sec 13.11.8 + SwitchStatement(node) { + this.visit(node.discriminant); + + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestSwitchScope(node); + } + + for (let i = 0, iz = node.cases.length; i < iz; ++i) { + this.visit(node.cases[i]); + } + + this.close(node); + } + + FunctionDeclaration(node) { + this.visitFunction(node); + } + + FunctionExpression(node) { + this.visitFunction(node); + } + + ForOfStatement(node) { + this.visitForIn(node); + } + + ForInStatement(node) { + this.visitForIn(node); + } + + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + + ImportDeclaration(node) { + assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); + + const importer = new Importer(node, this); + + importer.visit(node); + } + + visitExportDeclaration(node) { + if (node.source) { + return; + } + if (node.declaration) { + this.visit(node.declaration); + return; + } + + this.visitChildren(node); + } + + // TODO: ExportDeclaration doesn't exist. for bc? + ExportDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportAllDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportDefaultDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportNamedDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportSpecifier(node) { + + // TODO: `node.id` doesn't exist. for bc? + const local = (node.id || node.local); + + this.visit(local); + } + + MetaProperty() { // eslint-disable-line class-methods-use-this -- Desired as instance method + + // do nothing. + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +const version = "8.2.0"; + +/* + Copyright (C) 2012-2014 Yusuke Suzuki + Copyright (C) 2013 Alex Seville + Copyright (C) 2014 Thiago de Arruda + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Set the default options + * @returns {Object} options + */ +function defaultOptions() { + return { + optimistic: false, + nodejsScope: false, + impliedStrict: false, + sourceType: "script", // one of ['script', 'module', 'commonjs'] + ecmaVersion: 5, + childVisitorKeys: null, + fallback: "iteration" + }; +} + +/** + * Preform deep update on option object + * @param {Object} target Options + * @param {Object} override Updates + * @returns {Object} Updated options + */ +function updateDeeply(target, override) { + + /** + * Is hash object + * @param {Object} value Test value + * @returns {boolean} Result + */ + function isHashObject(value) { + return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); + } + + for (const key in override) { + if (Object.hasOwn(override, key)) { + const val = override[key]; + + if (isHashObject(val)) { + if (isHashObject(target[key])) { + updateDeeply(target[key], val); + } else { + target[key] = updateDeeply({}, val); + } + } else { + target[key] = val; + } + } + } + return target; +} + +/** + * Main interface function. Takes an Espree syntax tree and returns the + * analyzed scopes. + * @function analyze + * @param {espree.Tree} tree Abstract Syntax Tree + * @param {Object} providedOptions Options that tailor the scope analysis + * @param {boolean} [providedOptions.optimistic=false] the optimistic flag + * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls + * @param {boolean} [providedOptions.nodejsScope=false] whether the whole + * script is executed under node.js environment. When enabled, escope adds + * a function scope immediately following the global scope. + * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode + * (if ecmaVersion >= 5). + * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs' + * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. + * @returns {ScopeManager} ScopeManager + */ +function analyze(tree, providedOptions) { + const options = updateDeeply(defaultOptions(), providedOptions); + const scopeManager = new ScopeManager(options); + const referencer = new Referencer(options, scopeManager); + + referencer.visit(tree); + + assert(scopeManager.__currentScope === null, "currentScope should be null."); + + return scopeManager; +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +exports.Definition = Definition; +exports.PatternVisitor = PatternVisitor; +exports.Reference = Reference; +exports.Referencer = Referencer; +exports.Scope = Scope; +exports.ScopeManager = ScopeManager; +exports.Variable = Variable; +exports.analyze = analyze; +exports.version = version; +//# sourceMappingURL=eslint-scope.cjs.map diff --git a/node_modules/eslint-scope/lib/assert.js b/node_modules/eslint-scope/lib/assert.js new file mode 100644 index 0000000..6300bce --- /dev/null +++ b/node_modules/eslint-scope/lib/assert.js @@ -0,0 +1,17 @@ +/** + * @fileoverview Assertion utilities. + * @author Nicholas C. Zakas + */ + +/** + * Throws an error if the given condition is not truthy. + * @param {boolean} condition The condition to check. + * @param {string} message The message to include with the error. + * @returns {void} + * @throws {Error} When the condition is not truthy. + */ +export function assert(condition, message = "Assertion failed.") { + if (!condition) { + throw new Error(message); + } +} diff --git a/node_modules/eslint-scope/lib/definition.js b/node_modules/eslint-scope/lib/definition.js new file mode 100644 index 0000000..9744ef4 --- /dev/null +++ b/node_modules/eslint-scope/lib/definition.js @@ -0,0 +1,85 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +import Variable from "./variable.js"; + +/** + * @constructor Definition + */ +class Definition { + constructor(type, name, node, parent, index, kind) { + + /** + * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). + */ + this.type = type; + + /** + * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. + */ + this.name = name; + + /** + * @member {espree.Node} Definition#node - the enclosing node of the identifier. + */ + this.node = node; + + /** + * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. + */ + this.parent = parent; + + /** + * @member {number?} Definition#index - the index in the declaration statement. + */ + this.index = index; + + /** + * @member {string?} Definition#kind - the kind of the declaration statement. + */ + this.kind = kind; + } +} + +/** + * @constructor ParameterDefinition + */ +class ParameterDefinition extends Definition { + constructor(name, node, index, rest) { + super(Variable.Parameter, name, node, null, index, null); + + /** + * Whether the parameter definition is a part of a rest parameter. + * @member {boolean} ParameterDefinition#rest + */ + this.rest = rest; + } +} + +export { + ParameterDefinition, + Definition +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/index.js b/node_modules/eslint-scope/lib/index.js new file mode 100644 index 0000000..7e79c92 --- /dev/null +++ b/node_modules/eslint-scope/lib/index.js @@ -0,0 +1,169 @@ +/* + Copyright (C) 2012-2014 Yusuke Suzuki + Copyright (C) 2013 Alex Seville + Copyright (C) 2014 Thiago de Arruda + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Escope (escope) is an ECMAScript + * scope analyzer extracted from the esmangle project. + *

+ * escope finds lexical scopes in a source program, i.e. areas of that + * program where different occurrences of the same identifier refer to the same + * variable. With each scope the contained variables are collected, and each + * identifier reference in code is linked to its corresponding variable (if + * possible). + *

+ * escope works on a syntax tree of the parsed source code which has + * to adhere to the + * Mozilla Parser API. E.g. espree is a parser + * that produces such syntax trees. + *

+ * The main interface is the {@link analyze} function. + * @module escope + */ + +import { assert } from "./assert.js"; + +import ScopeManager from "./scope-manager.js"; +import Referencer from "./referencer.js"; +import Reference from "./reference.js"; +import Variable from "./variable.js"; + +import eslintScopeVersion from "./version.js"; + +/** + * Set the default options + * @returns {Object} options + */ +function defaultOptions() { + return { + optimistic: false, + nodejsScope: false, + impliedStrict: false, + sourceType: "script", // one of ['script', 'module', 'commonjs'] + ecmaVersion: 5, + childVisitorKeys: null, + fallback: "iteration" + }; +} + +/** + * Preform deep update on option object + * @param {Object} target Options + * @param {Object} override Updates + * @returns {Object} Updated options + */ +function updateDeeply(target, override) { + + /** + * Is hash object + * @param {Object} value Test value + * @returns {boolean} Result + */ + function isHashObject(value) { + return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); + } + + for (const key in override) { + if (Object.hasOwn(override, key)) { + const val = override[key]; + + if (isHashObject(val)) { + if (isHashObject(target[key])) { + updateDeeply(target[key], val); + } else { + target[key] = updateDeeply({}, val); + } + } else { + target[key] = val; + } + } + } + return target; +} + +/** + * Main interface function. Takes an Espree syntax tree and returns the + * analyzed scopes. + * @function analyze + * @param {espree.Tree} tree Abstract Syntax Tree + * @param {Object} providedOptions Options that tailor the scope analysis + * @param {boolean} [providedOptions.optimistic=false] the optimistic flag + * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls + * @param {boolean} [providedOptions.nodejsScope=false] whether the whole + * script is executed under node.js environment. When enabled, escope adds + * a function scope immediately following the global scope. + * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode + * (if ecmaVersion >= 5). + * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs' + * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. + * @returns {ScopeManager} ScopeManager + */ +function analyze(tree, providedOptions) { + const options = updateDeeply(defaultOptions(), providedOptions); + const scopeManager = new ScopeManager(options); + const referencer = new Referencer(options, scopeManager); + + referencer.visit(tree); + + assert(scopeManager.__currentScope === null, "currentScope should be null."); + + return scopeManager; +} + +export { + + /** @name module:escope.version */ + eslintScopeVersion as version, + + /** @name module:escope.Reference */ + Reference, + + /** @name module:escope.Variable */ + Variable, + + /** @name module:escope.ScopeManager */ + ScopeManager, + + /** @name module:escope.Referencer */ + Referencer, + + analyze +}; + +/** @name module:escope.Definition */ +export { Definition } from "./definition.js"; + +/** @name module:escope.PatternVisitor */ +export { default as PatternVisitor } from "./pattern-visitor.js"; + +/** @name module:escope.Scope */ +export { Scope } from "./scope.js"; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/pattern-visitor.js b/node_modules/eslint-scope/lib/pattern-visitor.js new file mode 100644 index 0000000..367a377 --- /dev/null +++ b/node_modules/eslint-scope/lib/pattern-visitor.js @@ -0,0 +1,154 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +import estraverse from "estraverse"; +import esrecurse from "esrecurse"; + +const { Syntax } = estraverse; + +/** + * Get last array element + * @param {Array} xs array + * @returns {any} Last elment + */ +function getLast(xs) { + return xs.at(-1) || null; +} + +/** + * Visitor for destructuring patterns. + */ +class PatternVisitor extends esrecurse.Visitor { + static isPattern(node) { + const nodeType = node.type; + + return ( + nodeType === Syntax.Identifier || + nodeType === Syntax.ObjectPattern || + nodeType === Syntax.ArrayPattern || + nodeType === Syntax.SpreadElement || + nodeType === Syntax.RestElement || + nodeType === Syntax.AssignmentPattern + ); + } + + constructor(options, rootPattern, callback) { + super(null, options); + this.rootPattern = rootPattern; + this.callback = callback; + this.assignments = []; + this.rightHandNodes = []; + this.restElements = []; + } + + Identifier(pattern) { + const lastRestElement = getLast(this.restElements); + + this.callback(pattern, { + topLevel: pattern === this.rootPattern, + rest: lastRestElement !== null && lastRestElement !== void 0 && lastRestElement.argument === pattern, + assignments: this.assignments + }); + } + + Property(property) { + + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + + ArrayPattern(pattern) { + for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { + const element = pattern.elements[i]; + + this.visit(element); + } + } + + AssignmentPattern(pattern) { + this.assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.assignments.pop(); + } + + RestElement(pattern) { + this.restElements.push(pattern); + this.visit(pattern.argument); + this.restElements.pop(); + } + + MemberExpression(node) { + + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + + // + // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. + // By spec, LeftHandSideExpression is Pattern or MemberExpression. + // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) + // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... + // + + SpreadElement(node) { + this.visit(node.argument); + } + + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + + AssignmentExpression(node) { + this.assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.assignments.pop(); + } + + CallExpression(node) { + + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } +} + +export default PatternVisitor; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/reference.js b/node_modules/eslint-scope/lib/reference.js new file mode 100644 index 0000000..e657d62 --- /dev/null +++ b/node_modules/eslint-scope/lib/reference.js @@ -0,0 +1,166 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const READ = 0x1; +const WRITE = 0x2; +const RW = READ | WRITE; + +/** + * A Reference represents a single occurrence of an identifier in code. + * @constructor Reference + */ +class Reference { + constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { + + /** + * Identifier syntax node. + * @member {espreeIdentifier} Reference#identifier + */ + this.identifier = ident; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Reference#from + */ + this.from = scope; + + /** + * Whether the reference comes from a dynamic scope (such as 'eval', + * 'with', etc.), and may be trapped by dynamic scopes. + * @member {boolean} Reference#tainted + */ + this.tainted = false; + + /** + * The variable this reference is resolved with. + * @member {Variable} Reference#resolved + */ + this.resolved = null; + + /** + * The read-write mode of the reference. (Value is one of {@link + * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). + * @member {number} Reference#flag + * @private + */ + this.flag = flag; + if (this.isWrite()) { + + /** + * If reference is writeable, this is the tree being written to it. + * @member {espreeNode} Reference#writeExpr + */ + this.writeExpr = writeExpr; + + /** + * Whether the Reference might refer to a partial value of writeExpr. + * @member {boolean} Reference#partial + */ + this.partial = partial; + + /** + * Whether the Reference is to write of initialization. + * @member {boolean} Reference#init + */ + this.init = init; + } + this.__maybeImplicitGlobal = maybeImplicitGlobal; + } + + /** + * Whether the reference is static. + * @function Reference#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.tainted && this.resolved && this.resolved.scope.isStatic(); + } + + /** + * Whether the reference is writeable. + * @function Reference#isWrite + * @returns {boolean} write + */ + isWrite() { + return !!(this.flag & Reference.WRITE); + } + + /** + * Whether the reference is readable. + * @function Reference#isRead + * @returns {boolean} read + */ + isRead() { + return !!(this.flag & Reference.READ); + } + + /** + * Whether the reference is read-only. + * @function Reference#isReadOnly + * @returns {boolean} read only + */ + isReadOnly() { + return this.flag === Reference.READ; + } + + /** + * Whether the reference is write-only. + * @function Reference#isWriteOnly + * @returns {boolean} write only + */ + isWriteOnly() { + return this.flag === Reference.WRITE; + } + + /** + * Whether the reference is read-write. + * @function Reference#isReadWrite + * @returns {boolean} read write + */ + isReadWrite() { + return this.flag === Reference.RW; + } +} + +/** + * @constant Reference.READ + * @private + */ +Reference.READ = READ; + +/** + * @constant Reference.WRITE + * @private + */ +Reference.WRITE = WRITE; + +/** + * @constant Reference.RW + * @private + */ +Reference.RW = RW; + +export default Reference; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/referencer.js b/node_modules/eslint-scope/lib/referencer.js new file mode 100644 index 0000000..f939aa8 --- /dev/null +++ b/node_modules/eslint-scope/lib/referencer.js @@ -0,0 +1,656 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +import estraverse from "estraverse"; +import esrecurse from "esrecurse"; +import Reference from "./reference.js"; +import Variable from "./variable.js"; +import PatternVisitor from "./pattern-visitor.js"; +import { Definition, ParameterDefinition } from "./definition.js"; +import { assert } from "./assert.js"; + +const { Syntax } = estraverse; + +/** + * Traverse identifier in pattern + * @param {Object} options options + * @param {pattern} rootPattern root pattern + * @param {Refencer} referencer referencer + * @param {callback} callback callback + * @returns {void} + */ +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { + + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor(options, rootPattern, callback); + + visitor.visit(rootPattern); + + // Process the right hand nodes recursively. + if (referencer !== null && referencer !== void 0) { + visitor.rightHandNodes.forEach(referencer.visit, referencer); + } +} + +// Importing ImportDeclaration. +// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation +// https://github.com/estree/estree/blob/master/es6.md#importdeclaration +// FIXME: Now, we don't create module environment, because the context is +// implementation dependent. + +/** + * Visitor for import specifiers. + */ +class Importer extends esrecurse.Visitor { + constructor(declaration, referencer) { + super(null, referencer.options); + this.declaration = declaration; + this.referencer = referencer; + } + + visitImport(id, specifier) { + this.referencer.visitPattern(id, pattern => { + this.referencer.currentScope().__define(pattern, + new Definition( + Variable.ImportBinding, + pattern, + specifier, + this.declaration, + null, + null + )); + }); + } + + ImportNamespaceSpecifier(node) { + const local = (node.local || node.id); + + if (local) { + this.visitImport(local, node); + } + } + + ImportDefaultSpecifier(node) { + const local = (node.local || node.id); + + this.visitImport(local, node); + } + + ImportSpecifier(node) { + const local = (node.local || node.id); + + if (node.name) { + this.visitImport(node.name, node); + } else { + this.visitImport(local, node); + } + } +} + +/** + * Referencing variables and creating bindings. + */ +class Referencer extends esrecurse.Visitor { + constructor(options, scopeManager) { + super(null, options); + this.options = options; + this.scopeManager = scopeManager; + this.parent = null; + this.isInnerMethodDefinition = false; + } + + currentScope() { + return this.scopeManager.__currentScope; + } + + close(node) { + while (this.currentScope() && node === this.currentScope().block) { + this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); + } + } + + pushInnerMethodDefinition(isInnerMethodDefinition) { + const previous = this.isInnerMethodDefinition; + + this.isInnerMethodDefinition = isInnerMethodDefinition; + return previous; + } + + popInnerMethodDefinition(isInnerMethodDefinition) { + this.isInnerMethodDefinition = isInnerMethodDefinition; + } + + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + const scope = this.currentScope(); + + assignments.forEach(assignment => { + scope.__referencing( + pattern, + Reference.WRITE, + assignment.right, + maybeImplicitGlobal, + pattern !== assignment.left, + init + ); + }); + } + + visitPattern(node, options, callback) { + let visitPatternOptions = options; + let visitPatternCallback = callback; + + if (typeof options === "function") { + visitPatternCallback = options; + visitPatternOptions = { processRightHandNodes: false }; + } + + traverseIdentifierInPattern( + this.options, + node, + visitPatternOptions.processRightHandNodes ? this : null, + visitPatternCallback + ); + } + + visitFunction(node) { + let i, iz; + + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + + if (node.type === Syntax.FunctionDeclaration) { + + // id is defined in upper scope + this.currentScope().__define(node.id, + new Definition( + Variable.FunctionName, + node.id, + node, + null, + null, + null + )); + } + + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + if (node.type === Syntax.FunctionExpression && node.id) { + this.scopeManager.__nestFunctionExpressionNameScope(node); + } + + // Consider this function is in the MethodDefinition. + this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); + + const that = this; + + /** + * Visit pattern callback + * @param {pattern} pattern pattern + * @param {Object} info info + * @returns {void} + */ + function visitPatternCallback(pattern, info) { + that.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + i, + info.rest + )); + + that.referencingDefaultValue(pattern, info.assignments, null, true); + } + + // Process parameter declarations. + for (i = 0, iz = node.params.length; i < iz; ++i) { + this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); + } + + // if there's a rest argument, add that + if (node.rest) { + this.visitPattern({ + type: "RestElement", + argument: node.rest + }, pattern => { + this.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + node.params.length, + true + )); + }); + } + + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === Syntax.BlockStatement) { + this.visitChildren(node.body); + } else { + this.visit(node.body); + } + } + + this.close(node); + } + + visitClass(node) { + if (node.type === Syntax.ClassDeclaration) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node, + null, + null, + null + )); + } + + this.scopeManager.__nestClassScope(node); + + if (node.id) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node + )); + } + + this.visit(node.superClass); + this.visit(node.body); + + this.close(node); + } + + visitProperty(node) { + let previous; + + if (node.computed) { + this.visit(node.key); + } + + const isMethodDefinition = node.type === Syntax.MethodDefinition; + + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + this.visit(node.value); + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + } + + visitForIn(node) { + if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + if (node.left.type === Syntax.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); + }); + } else { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); + }); + } + this.visit(node.right); + this.visit(node.body); + + this.close(node); + } + + visitVariableDeclaration(variableTargetScope, type, node, index) { + + const decl = node.declarations[index]; + const init = decl.init; + + this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { + variableTargetScope.__define( + pattern, + new Definition( + type, + pattern, + decl, + node, + index, + node.kind + ) + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); + } + }); + } + + AssignmentExpression(node) { + if (PatternVisitor.isPattern(node.left)) { + if (node.operator === "=") { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); + }); + } else { + this.currentScope().__referencing(node.left, Reference.RW, node.right); + } + } else { + this.visit(node.left); + } + this.visit(node.right); + } + + CatchClause(node) { + this.scopeManager.__nestCatchScope(node); + + this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { + this.currentScope().__define(pattern, + new Definition( + Variable.CatchClause, + pattern, + node, + null, + null, + null + )); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }); + this.visit(node.body); + + this.close(node); + } + + Program(node) { + this.scopeManager.__nestGlobalScope(node); + + if (this.scopeManager.isGlobalReturn()) { + + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.__nestFunctionScope(node, false); + } + + if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { + this.scopeManager.__nestModuleScope(node); + } + + if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + + this.visitChildren(node); + this.close(node); + } + + Identifier(node) { + this.currentScope().__referencing(node); + } + + // eslint-disable-next-line class-methods-use-this -- Desired as instance method + PrivateIdentifier() { + + // Do nothing. + } + + UpdateExpression(node) { + if (PatternVisitor.isPattern(node.argument)) { + this.currentScope().__referencing(node.argument, Reference.RW, null); + } else { + this.visitChildren(node); + } + } + + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + + Property(node) { + this.visitProperty(node); + } + + PropertyDefinition(node) { + const { computed, key, value } = node; + + if (computed) { + this.visit(key); + } + if (value) { + this.scopeManager.__nestClassFieldInitializerScope(value); + this.visit(value); + this.close(value); + } + } + + StaticBlock(node) { + this.scopeManager.__nestClassStaticBlockScope(node); + + this.visitChildren(node); + + this.close(node); + } + + MethodDefinition(node) { + this.visitProperty(node); + } + + BreakStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method + + ContinueStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method + + LabeledStatement(node) { + this.visit(node.body); + } + + ForStatement(node) { + + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates + // per iteration environment. However, escope is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ClassExpression(node) { + this.visitClass(node); + } + + ClassDeclaration(node) { + this.visitClass(node); + } + + CallExpression(node) { + + // Check this is direct call to eval + if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { + + // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and + // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. + this.currentScope().variableScope.__detectEval(); + } + this.visitChildren(node); + } + + BlockStatement(node) { + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestBlockScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ThisExpression() { + this.currentScope().variableScope.__detectThis(); + } + + WithStatement(node) { + this.visit(node.object); + + // Then nest scope for WithStatement. + this.scopeManager.__nestWithScope(node); + + this.visit(node.body); + + this.close(node); + } + + VariableDeclaration(node) { + const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); + + for (let i = 0, iz = node.declarations.length; i < iz; ++i) { + const decl = node.declarations[i]; + + this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); + if (decl.init) { + this.visit(decl.init); + } + } + } + + // sec 13.11.8 + SwitchStatement(node) { + this.visit(node.discriminant); + + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestSwitchScope(node); + } + + for (let i = 0, iz = node.cases.length; i < iz; ++i) { + this.visit(node.cases[i]); + } + + this.close(node); + } + + FunctionDeclaration(node) { + this.visitFunction(node); + } + + FunctionExpression(node) { + this.visitFunction(node); + } + + ForOfStatement(node) { + this.visitForIn(node); + } + + ForInStatement(node) { + this.visitForIn(node); + } + + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + + ImportDeclaration(node) { + assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); + + const importer = new Importer(node, this); + + importer.visit(node); + } + + visitExportDeclaration(node) { + if (node.source) { + return; + } + if (node.declaration) { + this.visit(node.declaration); + return; + } + + this.visitChildren(node); + } + + // TODO: ExportDeclaration doesn't exist. for bc? + ExportDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportAllDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportDefaultDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportNamedDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportSpecifier(node) { + + // TODO: `node.id` doesn't exist. for bc? + const local = (node.id || node.local); + + this.visit(local); + } + + MetaProperty() { // eslint-disable-line class-methods-use-this -- Desired as instance method + + // do nothing. + } +} + +export default Referencer; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope-manager.js b/node_modules/eslint-scope/lib/scope-manager.js new file mode 100644 index 0000000..a136648 --- /dev/null +++ b/node_modules/eslint-scope/lib/scope-manager.js @@ -0,0 +1,249 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +import { + BlockScope, + CatchScope, + ClassFieldInitializerScope, + ClassStaticBlockScope, + ClassScope, + ForScope, + FunctionExpressionNameScope, + FunctionScope, + GlobalScope, + ModuleScope, + SwitchScope, + WithScope +} from "./scope.js"; +import { assert } from "./assert.js"; + +/** + * @constructor ScopeManager + */ +class ScopeManager { + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.__nodeToScope = new WeakMap(); + this.__currentScope = null; + this.__options = options; + this.__declaredVariables = new WeakMap(); + } + + __isOptimistic() { + return this.__options.optimistic; + } + + __ignoreEval() { + return this.__options.ignoreEval; + } + + isGlobalReturn() { + return this.__options.nodejsScope || this.__options.sourceType === "commonjs"; + } + + isModule() { + return this.__options.sourceType === "module"; + } + + isImpliedStrict() { + return this.__options.impliedStrict; + } + + isStrictModeSupported() { + return this.__options.ecmaVersion >= 5; + } + + // Returns appropriate scope for this node. + __get(node) { + return this.__nodeToScope.get(node); + } + + /** + * Get variables that are declared by the node. + * + * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. + * If the node declares nothing, this method returns an empty array. + * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. + * @param {Espree.Node} node a node to get. + * @returns {Variable[]} variables that declared by the node. + */ + getDeclaredVariables(node) { + return this.__declaredVariables.get(node) || []; + } + + /** + * acquire scope from node. + * @function ScopeManager#acquire + * @param {Espree.Node} node node for the acquired scope. + * @param {?boolean} [inner=false] look up the most inner scope, default value is false. + * @returns {Scope?} Scope from node + */ + acquire(node, inner) { + + /** + * predicate + * @param {Scope} testScope scope to test + * @returns {boolean} predicate + */ + function predicate(testScope) { + if (testScope.type === "function" && testScope.functionExpressionScope) { + return false; + } + return true; + } + + const scopes = this.__get(node); + + if (!scopes || scopes.length === 0) { + return null; + } + + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } else { + for (let i = 0, iz = scopes.length; i < iz; ++i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } + + return null; + } + + /** + * acquire all scopes from node. + * @function ScopeManager#acquireAll + * @param {Espree.Node} node node for the acquired scope. + * @returns {Scopes?} Scope array + */ + acquireAll(node) { + return this.__get(node); + } + + /** + * release the node. + * @function ScopeManager#release + * @param {Espree.Node} node releasing node. + * @param {?boolean} [inner=false] look up the most inner scope, default value is false. + * @returns {Scope?} upper scope for the node. + */ + release(node, inner) { + const scopes = this.__get(node); + + if (scopes && scopes.length) { + const scope = scopes[0].upper; + + if (!scope) { + return null; + } + return this.acquire(scope.block, inner); + } + return null; + } + + attach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method + + detach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method + + __nestScope(scope) { + if (scope instanceof GlobalScope) { + assert(this.__currentScope === null); + this.globalScope = scope; + } + this.__currentScope = scope; + return scope; + } + + __nestGlobalScope(node) { + return this.__nestScope(new GlobalScope(this, node)); + } + + __nestBlockScope(node) { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + __nestFunctionScope(node, isMethodDefinition) { + return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); + } + + __nestForScope(node) { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + __nestCatchScope(node) { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + __nestWithScope(node) { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + __nestClassScope(node) { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + __nestClassFieldInitializerScope(node) { + return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node)); + } + + __nestClassStaticBlockScope(node) { + return this.__nestScope(new ClassStaticBlockScope(this, this.__currentScope, node)); + } + + __nestSwitchScope(node) { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + __nestModuleScope(node) { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + __nestFunctionExpressionNameScope(node) { + return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); + } + + __isES6() { + return this.__options.ecmaVersion >= 6; + } +} + +export default ScopeManager; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope.js b/node_modules/eslint-scope/lib/scope.js new file mode 100644 index 0000000..b3ef026 --- /dev/null +++ b/node_modules/eslint-scope/lib/scope.js @@ -0,0 +1,793 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +import estraverse from "estraverse"; + +import Reference from "./reference.js"; +import Variable from "./variable.js"; +import { Definition } from "./definition.js"; +import { assert } from "./assert.js"; + +const { Syntax } = estraverse; + +/** + * Test if scope is struct + * @param {Scope} scope scope + * @param {Block} block block + * @param {boolean} isMethodDefinition is method definition + * @returns {boolean} is strict scope + */ +function isStrictScope(scope, block, isMethodDefinition) { + let body; + + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper && scope.upper.isStrict) { + return true; + } + + if (isMethodDefinition) { + return true; + } + + if (scope.type === "class" || scope.type === "module") { + return true; + } + + if (scope.type === "block" || scope.type === "switch") { + return false; + } + + if (scope.type === "function") { + if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) { + return false; + } + + if (block.type === Syntax.Program) { + body = block; + } else { + body = block.body; + } + + if (!body) { + return false; + } + } else if (scope.type === "global") { + body = block; + } else { + return false; + } + + // Search for a 'use strict' directive. + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + /* + * Check if the current statement is a directive. + * If it isn't, then we're past the directive prologue + * so stop the search because directives cannot + * appear after this point. + * + * Some parsers set `directive:null` on non-directive + * statements, so the `typeof` check is safer than + * checking for property existence. + */ + if (typeof stmt.directive !== "string") { + break; + } + + if (stmt.directive === "use strict") { + return true; + } + } + + return false; +} + +/** + * Register scope + * @param {ScopeManager} scopeManager scope manager + * @param {Scope} scope scope + * @returns {void} + */ +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + + const scopes = scopeManager.__nodeToScope.get(scope.block); + + if (scopes) { + scopes.push(scope); + } else { + scopeManager.__nodeToScope.set(scope.block, [scope]); + } +} + +/** + * Should be statically + * @param {Object} def def + * @returns {boolean} should be statically + */ +function shouldBeStatically(def) { + return ( + (def.type === Variable.ClassName) || + (def.type === Variable.Variable && def.parent.kind !== "var") + ); +} + +/** + * @constructor Scope + */ +class Scope { + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + + /** + * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for", + * "class", "class-field-initializer", "class-static-block". + * @member {string} Scope#type + */ + this.type = type; + + /** + * The scoped {@link Variable}s of this scope, as { Variable.name + * : Variable }. + * @member {Map} Scope#set + */ + this.set = new Map(); + + /** + * The tainted variables of this scope, as { Variable.name : + * boolean }. + * @member {Map} Scope#taints + */ + this.taints = new Map(); + + /** + * Generally, through the lexical scoping of JS you can always know + * which variable an identifier in the source code refers to. There are + * a few exceptions to this rule. With 'global' and 'with' scopes you + * can only decide at runtime which variable a reference refers to. + * Moreover, if 'eval()' is used in a scope, it might introduce new + * bindings in this or its parent scopes. + * All those scopes are considered 'dynamic'. + * @member {boolean} Scope#dynamic + */ + this.dynamic = this.type === "global" || this.type === "with"; + + /** + * A reference to the scope-defining syntax node. + * @member {espree.Node} Scope#block + */ + this.block = block; + + /** + * The {@link Reference|references} that are not resolved with this scope. + * @member {Reference[]} Scope#through + */ + this.through = []; + + /** + * The scoped {@link Variable}s of this scope. In the case of a + * 'function' scope this includes the automatic argument arguments as + * its first element, as well as all further formal arguments. + * @member {Variable[]} Scope#variables + */ + this.variables = []; + + /** + * Any variable {@link Reference|reference} found in this scope. This + * includes occurrences of local variables as well as variables from + * parent scopes (including the global scope). For local variables + * this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the + * formal parameter in the parameter list. + * @member {Reference[]} Scope#references + */ + this.references = []; + + /** + * For 'global' and 'function' scopes, this is a self-reference. For + * other scope types this is the variableScope value of the + * parent scope. + * @member {Scope} Scope#variableScope + */ + this.variableScope = + this.type === "global" || + this.type === "module" || + this.type === "function" || + this.type === "class-field-initializer" || + this.type === "class-static-block" + ? this + : upperScope.variableScope; + + /** + * Whether this scope is created by a FunctionExpression. + * @member {boolean} Scope#functionExpressionScope + */ + this.functionExpressionScope = false; + + /** + * Whether this is a scope that contains an 'eval()' invocation. + * @member {boolean} Scope#directCallToEvalScope + */ + this.directCallToEvalScope = false; + + /** + * @member {boolean} Scope#thisFound + */ + this.thisFound = false; + + this.__left = []; + + /** + * Reference to the parent {@link Scope|scope}. + * @member {Scope} Scope#upper + */ + this.upper = upperScope; + + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = scopeManager.isStrictModeSupported() + ? isStrictScope(this, block, isMethodDefinition) + : false; + + /** + * List of nested {@link Scope}s. + * @member {Scope[]} Scope#childScopes + */ + this.childScopes = []; + if (this.upper) { + this.upper.childScopes.push(this); + } + + this.__declaredVariables = scopeManager.__declaredVariables; + + registerScope(scopeManager, this); + } + + __shouldStaticallyClose(scopeManager) { + return (!this.dynamic || scopeManager.__isOptimistic()); + } + + __shouldStaticallyCloseForGlobal(ref) { + + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + + const variable = this.set.get(name); + const defs = variable.defs; + + return defs.length > 0 && defs.every(shouldBeStatically); + } + + __staticCloseRef(ref) { + if (!this.__resolve(ref)) { + this.__delegateToUpperScope(ref); + } + } + + __dynamicCloseRef(ref) { + + // notify all names are through to global + let current = this; + + do { + current.through.push(ref); + current = current.upper; + } while (current); + } + + __globalCloseRef(ref) { + + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.__shouldStaticallyCloseForGlobal(ref)) { + this.__staticCloseRef(ref); + } else { + this.__dynamicCloseRef(ref); + } + } + + __close(scopeManager) { + let closeRef; + + if (this.__shouldStaticallyClose(scopeManager)) { + closeRef = this.__staticCloseRef; + } else if (this.type !== "global") { + closeRef = this.__dynamicCloseRef; + } else { + closeRef = this.__globalCloseRef; + } + + // Try Resolving all references in this scope. + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + closeRef.call(this, ref); + } + this.__left = null; + + return this.upper; + } + + // To override by function scopes. + // References in default parameters isn't resolved to variables which are in their function body. + __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars -- Desired as instance method with signature + return true; + } + + __resolve(ref) { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + + if (!this.__isValidResolution(ref, variable)) { + return false; + } + variable.references.push(ref); + variable.stack = variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + + return true; + } + + __delegateToUpperScope(ref) { + if (this.upper) { + this.upper.__left.push(ref); + } + this.through.push(ref); + } + + __addDeclaredVariablesOfNode(variable, node) { + if (node === null || node === void 0) { + return; + } + + let variables = this.__declaredVariables.get(node); + + if (variables === null || variables === void 0) { + variables = []; + this.__declaredVariables.set(node, variables); + } + if (!variables.includes(variable)) { + variables.push(variable); + } + } + + __defineGeneric(name, set, variables, node, def) { + let variable; + + variable = set.get(name); + if (!variable) { + variable = new Variable(name, this); + set.set(name, variable); + variables.push(variable); + } + + if (def) { + variable.defs.push(def); + this.__addDeclaredVariablesOfNode(variable, def.node); + this.__addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + + __define(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.set, + this.variables, + node, + def + ); + } + } + + __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { + + // because Array element may be null + if (!node || node.type !== Syntax.Identifier) { + return; + } + + // Specially handle like `this`. + if (node.name === "super") { + return; + } + + const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); + + this.references.push(ref); + this.__left.push(ref); + } + + __detectEval() { + let current = this; + + this.directCallToEvalScope = true; + do { + current.dynamic = true; + current = current.upper; + } while (current); + } + + __detectThis() { + this.thisFound = true; + } + + __isClosed() { + return this.__left === null; + } + + /** + * returns resolved {Reference} + * @function Scope#resolve + * @param {Espree.Identifier} ident identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident) { + let ref, i, iz; + + assert(this.__isClosed(), "Scope should be closed."); + assert(ident.type === Syntax.Identifier, "Target should be identifier."); + for (i = 0, iz = this.references.length; i < iz; ++i) { + ref = this.references[i]; + if (ref.identifier === ident) { + return ref; + } + } + return null; + } + + /** + * returns this scope is static + * @function Scope#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.dynamic; + } + + /** + * returns this scope has materialized arguments + * @function Scope#isArgumentsMaterialized + * @returns {boolean} arguemnts materialized + */ + isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this -- Desired as instance method + return true; + } + + /** + * returns this scope has materialized `this` reference + * @function Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized() { // eslint-disable-line class-methods-use-this -- Desired as instance method + return true; + } + + isUsedName(name) { + if (this.set.has(name)) { + return true; + } + for (let i = 0, iz = this.through.length; i < iz; ++i) { + if (this.through[i].identifier.name === name) { + return true; + } + } + return false; + } +} + +/** + * Global scope. + */ +class GlobalScope extends Scope { + constructor(scopeManager, block) { + super(scopeManager, "global", null, block, false); + this.implicit = { + set: new Map(), + variables: [], + + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + * @member {Reference[]} Scope#implicit#left + */ + left: [] + }; + } + + __close(scopeManager) { + const implicit = []; + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + implicit.push(ref.__maybeImplicitGlobal); + } + } + + // create an implicit global variable from assignment expression + for (let i = 0, iz = implicit.length; i < iz; ++i) { + const info = implicit[i]; + + this.__defineImplicit(info.pattern, + new Definition( + Variable.ImplicitGlobalVariable, + info.pattern, + info.node, + null, + null, + null + )); + + } + + this.implicit.left = this.__left; + + return super.__close(scopeManager); + } + + __defineImplicit(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.implicit.set, + this.implicit.variables, + node, + def + ); + } + } +} + +/** + * Module scope. + */ +class ModuleScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "module", upperScope, block, false); + } +} + +/** + * Function expression name scope. + */ +class FunctionExpressionNameScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "function-expression-name", upperScope, block, false); + this.__define(block.id, + new Definition( + Variable.FunctionName, + block.id, + block, + null, + null, + null + )); + this.functionExpressionScope = true; + } +} + +/** + * Catch scope. + */ +class CatchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "catch", upperScope, block, false); + } +} + +/** + * With statement scope. + */ +class WithScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "with", upperScope, block, false); + } + + __close(scopeManager) { + if (this.__shouldStaticallyClose(scopeManager)) { + return super.__close(scopeManager); + } + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + ref.tainted = true; + this.__delegateToUpperScope(ref); + } + this.__left = null; + + return this.upper; + } +} + +/** + * Block scope. + */ +class BlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "block", upperScope, block, false); + } +} + +/** + * Switch scope. + */ +class SwitchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "switch", upperScope, block, false); + } +} + +/** + * Function scope. + */ +class FunctionScope extends Scope { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, "function", upperScope, block, isMethodDefinition); + + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== Syntax.ArrowFunctionExpression) { + this.__defineArguments(); + } + } + + isArgumentsMaterialized() { + + // TODO(Constellation) + // We can more aggressive on this condition like this. + // + // function t() { + // // arguments of t is always hidden. + // function arguments() { + // } + // } + if (this.block.type === Syntax.ArrowFunctionExpression) { + return false; + } + + if (!this.isStatic()) { + return true; + } + + const variable = this.set.get("arguments"); + + assert(variable, "Always have arguments variable."); + return variable.tainted || variable.references.length !== 0; + } + + isThisMaterialized() { + if (!this.isStatic()) { + return true; + } + return this.thisFound; + } + + __defineArguments() { + this.__defineGeneric( + "arguments", + this.set, + this.variables, + null, + null + ); + this.taints.set("arguments", true); + } + + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + __isValidResolution(ref, variable) { + + // If `options.nodejsScope` is true, `this.block` becomes a Program node. + if (this.block.type === "Program") { + return true; + } + + const bodyStart = this.block.body.range[0]; + + // It's invalid resolution in the following case: + return !( + variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. + ); + } +} + +/** + * Scope of for, for-in, and for-of statements. + */ +class ForScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "for", upperScope, block, false); + } +} + +/** + * Class scope. + */ +class ClassScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class", upperScope, block, false); + } +} + +/** + * Class field initializer scope. + */ +class ClassFieldInitializerScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class-field-initializer", upperScope, block, true); + } +} + +/** + * Class static block scope. + */ +class ClassStaticBlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class-static-block", upperScope, block, true); + } +} + +export { + Scope, + GlobalScope, + ModuleScope, + FunctionExpressionNameScope, + CatchScope, + WithScope, + BlockScope, + SwitchScope, + FunctionScope, + ForScope, + ClassScope, + ClassFieldInitializerScope, + ClassStaticBlockScope +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/variable.js b/node_modules/eslint-scope/lib/variable.js new file mode 100644 index 0000000..286202f --- /dev/null +++ b/node_modules/eslint-scope/lib/variable.js @@ -0,0 +1,87 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * A Variable represents a locally scoped identifier. These include arguments to + * functions. + * @constructor Variable + */ +class Variable { + constructor(name, scope) { + + /** + * The variable name, as given in the source code. + * @member {string} Variable#name + */ + this.name = name; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as AST nodes. + * @member {espree.Identifier[]} Variable#identifiers + */ + this.identifiers = []; + + /** + * List of {@link Reference|references} of this variable (excluding parameter entries) + * in its defining scope and all nested scopes. For defining + * occurrences only see {@link Variable#defs}. + * @member {Reference[]} Variable#references + */ + this.references = []; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as custom objects. + * @member {Definition[]} Variable#defs + */ + this.defs = []; + + this.tainted = false; + + /** + * Whether this is a stack variable. + * @member {boolean} Variable#stack + */ + this.stack = true; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Variable#scope + */ + this.scope = scope; + } +} + +Variable.CatchClause = "CatchClause"; +Variable.Parameter = "Parameter"; +Variable.FunctionName = "FunctionName"; +Variable.ClassName = "ClassName"; +Variable.Variable = "Variable"; +Variable.ImportBinding = "ImportBinding"; +Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; + +export default Variable; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/version.js b/node_modules/eslint-scope/lib/version.js new file mode 100644 index 0000000..8108bb3 --- /dev/null +++ b/node_modules/eslint-scope/lib/version.js @@ -0,0 +1,3 @@ +const version = "8.2.0"; + +export default version; diff --git a/node_modules/eslint-scope/package.json b/node_modules/eslint-scope/package.json new file mode 100644 index 0000000..759d8ec --- /dev/null +++ b/node_modules/eslint-scope/package.json @@ -0,0 +1,59 @@ +{ + "name": "eslint-scope", + "description": "ECMAScript scope analyzer for ESLint", + "homepage": "https://github.com/eslint/js/blob/main/packages/eslint-scope/README.md", + "main": "./dist/eslint-scope.cjs", + "type": "module", + "exports": { + ".": { + "import": "./lib/index.js", + "require": "./dist/eslint-scope.cjs" + }, + "./package.json": "./package.json" + }, + "version": "8.2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": "eslint/js", + "funding": "https://opencollective.com/eslint", + "bugs": { + "url": "https://github.com/eslint/js/issues" + }, + "license": "BSD-2-Clause", + "scripts": { + "build": "rollup -c", + "build:update-version": "node tools/update-version.js", + "prepublishOnly": "npm run build:update-version && npm run build", + "pretest": "npm run build", + "release:generate:latest": "eslint-generate-release", + "release:generate:alpha": "eslint-generate-prerelease alpha", + "release:generate:beta": "eslint-generate-prerelease beta", + "release:generate:rc": "eslint-generate-prerelease rc", + "release:publish": "eslint-publish-release", + "test": "node Makefile.js test" + }, + "files": [ + "LICENSE", + "README.md", + "lib", + "dist/eslint-scope.cjs" + ], + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "devDependencies": { + "@typescript-eslint/parser": "^8.7.0", + "c8": "^7.7.3", + "chai": "^4.3.4", + "eslint-release": "^3.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "mocha": "^9.0.1", + "npm-license": "^0.3.3", + "rollup": "^2.52.7", + "shelljs": "^0.8.5", + "typescript": "^5.4.2" + } +} diff --git a/node_modules/eslint-visitor-keys/LICENSE b/node_modules/eslint-visitor-keys/LICENSE new file mode 100644 index 0000000..17a2553 --- /dev/null +++ b/node_modules/eslint-visitor-keys/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/eslint-visitor-keys/README.md b/node_modules/eslint-visitor-keys/README.md new file mode 100644 index 0000000..3cbbdd3 --- /dev/null +++ b/node_modules/eslint-visitor-keys/README.md @@ -0,0 +1,120 @@ +# eslint-visitor-keys + +[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) +[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) +[![Build Status](https://github.com/eslint/js/workflows/CI/badge.svg)](https://github.com/eslint/js/actions) + +Constants and utilities about visitor keys to traverse AST. + +## 💿 Installation + +Use [npm] to install. + +```bash +$ npm install eslint-visitor-keys +``` + +### Requirements + +- [Node.js] `^18.18.0`, `^20.9.0`, or `>=21.1.0` + +## 📖 Usage + +To use in an ESM file: + +```js +import * as evk from "eslint-visitor-keys" +``` + +To use in a CommonJS file: + +```js +const evk = require("eslint-visitor-keys") +``` + +### evk.KEYS + +> type: `{ [type: string]: string[] | undefined }` + +Visitor keys. This keys are frozen. + +This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. + +For example: + +``` +console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] +``` + +### evk.getKeys(node) + +> type: `(node: object) => string[]` + +Get the visitor keys of a given AST node. + +This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. + +This will be used to traverse unknown nodes. + +For example: + +```js +const node = { + type: "AssignmentExpression", + left: { type: "Identifier", name: "foo" }, + right: { type: "Literal", value: 0 } +} +console.log(evk.getKeys(node)) // → ["type", "left", "right"] +``` + +### evk.unionWith(additionalKeys) + +> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` + +Make the union set with `evk.KEYS` and the given keys. + +- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. +- It removes duplicated keys as keeping the first one. + +For example: + +```js +console.log(evk.unionWith({ + MethodDefinition: ["decorators"] +})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } +``` + +## 📰 Change log + +See [GitHub releases](https://github.com/eslint/js/releases). + +## 🍻 Contributing + +Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). + +### Development commands + +- `npm test` runs tests and measures code coverage. +- `npm run lint` checks source codes with ESLint. +- `npm run test:open-coverage` opens the code coverage report of the previous test with your default browser. + +[npm]: https://www.npmjs.com/ +[Node.js]: https://nodejs.org/ +[ESTree]: https://github.com/estree/estree + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

trunk.io

Silver Sponsors

+

JetBrains Liftoff American Express Workleap

Bronze Sponsors

+

WordHint Anagram Solver Icons8 Discord GitBook Nx HeroCoders

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs b/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs new file mode 100644 index 0000000..7f58e49 --- /dev/null +++ b/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs @@ -0,0 +1,396 @@ +'use strict'; + +/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`. + TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed +*/ +/** + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + */ +/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */ + +/** + * @type {VisitorKeys} + */ +const KEYS = { + ArrayExpression: [ + "elements" + ], + ArrayPattern: [ + "elements" + ], + ArrowFunctionExpression: [ + "params", + "body" + ], + AssignmentExpression: [ + "left", + "right" + ], + AssignmentPattern: [ + "left", + "right" + ], + AwaitExpression: [ + "argument" + ], + BinaryExpression: [ + "left", + "right" + ], + BlockStatement: [ + "body" + ], + BreakStatement: [ + "label" + ], + CallExpression: [ + "callee", + "arguments" + ], + CatchClause: [ + "param", + "body" + ], + ChainExpression: [ + "expression" + ], + ClassBody: [ + "body" + ], + ClassDeclaration: [ + "id", + "superClass", + "body" + ], + ClassExpression: [ + "id", + "superClass", + "body" + ], + ConditionalExpression: [ + "test", + "consequent", + "alternate" + ], + ContinueStatement: [ + "label" + ], + DebuggerStatement: [], + DoWhileStatement: [ + "body", + "test" + ], + EmptyStatement: [], + ExperimentalRestProperty: [ + "argument" + ], + ExperimentalSpreadProperty: [ + "argument" + ], + ExportAllDeclaration: [ + "exported", + "source", + "attributes" + ], + ExportDefaultDeclaration: [ + "declaration" + ], + ExportNamedDeclaration: [ + "declaration", + "specifiers", + "source", + "attributes" + ], + ExportSpecifier: [ + "exported", + "local" + ], + ExpressionStatement: [ + "expression" + ], + ForInStatement: [ + "left", + "right", + "body" + ], + ForOfStatement: [ + "left", + "right", + "body" + ], + ForStatement: [ + "init", + "test", + "update", + "body" + ], + FunctionDeclaration: [ + "id", + "params", + "body" + ], + FunctionExpression: [ + "id", + "params", + "body" + ], + Identifier: [], + IfStatement: [ + "test", + "consequent", + "alternate" + ], + ImportAttribute: [ + "key", + "value" + ], + ImportDeclaration: [ + "specifiers", + "source", + "attributes" + ], + ImportDefaultSpecifier: [ + "local" + ], + ImportExpression: [ + "source", + "options" + ], + ImportNamespaceSpecifier: [ + "local" + ], + ImportSpecifier: [ + "imported", + "local" + ], + JSXAttribute: [ + "name", + "value" + ], + JSXClosingElement: [ + "name" + ], + JSXClosingFragment: [], + JSXElement: [ + "openingElement", + "children", + "closingElement" + ], + JSXEmptyExpression: [], + JSXExpressionContainer: [ + "expression" + ], + JSXFragment: [ + "openingFragment", + "children", + "closingFragment" + ], + JSXIdentifier: [], + JSXMemberExpression: [ + "object", + "property" + ], + JSXNamespacedName: [ + "namespace", + "name" + ], + JSXOpeningElement: [ + "name", + "attributes" + ], + JSXOpeningFragment: [], + JSXSpreadAttribute: [ + "argument" + ], + JSXSpreadChild: [ + "expression" + ], + JSXText: [], + LabeledStatement: [ + "label", + "body" + ], + Literal: [], + LogicalExpression: [ + "left", + "right" + ], + MemberExpression: [ + "object", + "property" + ], + MetaProperty: [ + "meta", + "property" + ], + MethodDefinition: [ + "key", + "value" + ], + NewExpression: [ + "callee", + "arguments" + ], + ObjectExpression: [ + "properties" + ], + ObjectPattern: [ + "properties" + ], + PrivateIdentifier: [], + Program: [ + "body" + ], + Property: [ + "key", + "value" + ], + PropertyDefinition: [ + "key", + "value" + ], + RestElement: [ + "argument" + ], + ReturnStatement: [ + "argument" + ], + SequenceExpression: [ + "expressions" + ], + SpreadElement: [ + "argument" + ], + StaticBlock: [ + "body" + ], + Super: [], + SwitchCase: [ + "test", + "consequent" + ], + SwitchStatement: [ + "discriminant", + "cases" + ], + TaggedTemplateExpression: [ + "tag", + "quasi" + ], + TemplateElement: [], + TemplateLiteral: [ + "quasis", + "expressions" + ], + ThisExpression: [], + ThrowStatement: [ + "argument" + ], + TryStatement: [ + "block", + "handler", + "finalizer" + ], + UnaryExpression: [ + "argument" + ], + UpdateExpression: [ + "argument" + ], + VariableDeclaration: [ + "declarations" + ], + VariableDeclarator: [ + "id", + "init" + ], + WhileStatement: [ + "test", + "body" + ], + WithStatement: [ + "object", + "body" + ], + YieldExpression: [ + "argument" + ] +}; + +// Types. +const NODE_TYPES = Object.keys(KEYS); + +// Freeze the keys. +for (const type of NODE_TYPES) { + Object.freeze(KEYS[type]); +} +Object.freeze(KEYS); + +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ + +/** + * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys + */ + +// List to ignore keys. +const KEY_BLACKLIST = new Set([ + "parent", + "leadingComments", + "trailingComments" +]); + +/** + * Check whether a given key should be used or not. + * @param {string} key The key to check. + * @returns {boolean} `true` if the key should be used. + */ +function filterKey(key) { + return !KEY_BLACKLIST.has(key) && key[0] !== "_"; +} + + +/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`. + TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed +*/ +/** + * Get visitor keys of a given node. + * @param {Object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +function getKeys(node) { + return Object.keys(node).filter(filterKey); +} +/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */ + +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +function unionWith(additionalKeys) { + const retv = /** @type {{ [type: string]: ReadonlyArray }} */ + (Object.assign({}, KEYS)); + + for (const type of Object.keys(additionalKeys)) { + if (Object.hasOwn(retv, type)) { + const keys = new Set(additionalKeys[type]); + + for (const key of retv[type]) { + keys.add(key); + } + + retv[type] = Object.freeze(Array.from(keys)); + } else { + retv[type] = Object.freeze(Array.from(additionalKeys[type])); + } + } + + return Object.freeze(retv); +} + +exports.KEYS = KEYS; +exports.getKeys = getKeys; +exports.unionWith = unionWith; diff --git a/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts b/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts new file mode 100644 index 0000000..a868434 --- /dev/null +++ b/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts @@ -0,0 +1,27 @@ +type VisitorKeys$1 = { + readonly [type: string]: ReadonlyArray; +}; +/** + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + */ +/** + * @type {VisitorKeys} + */ +declare const KEYS: VisitorKeys$1; + +/** + * Get visitor keys of a given node. + * @param {Object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +declare function getKeys(node: Object): readonly string[]; +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +declare function unionWith(additionalKeys: VisitorKeys): VisitorKeys; + +type VisitorKeys = VisitorKeys$1; + +export { KEYS, type VisitorKeys, getKeys, unionWith }; diff --git a/node_modules/eslint-visitor-keys/lib/index.js b/node_modules/eslint-visitor-keys/lib/index.js new file mode 100644 index 0000000..1fc89b4 --- /dev/null +++ b/node_modules/eslint-visitor-keys/lib/index.js @@ -0,0 +1,67 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +import KEYS from "./visitor-keys.js"; + +/** + * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys + */ + +// List to ignore keys. +const KEY_BLACKLIST = new Set([ + "parent", + "leadingComments", + "trailingComments" +]); + +/** + * Check whether a given key should be used or not. + * @param {string} key The key to check. + * @returns {boolean} `true` if the key should be used. + */ +function filterKey(key) { + return !KEY_BLACKLIST.has(key) && key[0] !== "_"; +} + + +/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`. + TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed +*/ +/** + * Get visitor keys of a given node. + * @param {Object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +export function getKeys(node) { + return Object.keys(node).filter(filterKey); +} +/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */ + +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +export function unionWith(additionalKeys) { + const retv = /** @type {{ [type: string]: ReadonlyArray }} */ + (Object.assign({}, KEYS)); + + for (const type of Object.keys(additionalKeys)) { + if (Object.hasOwn(retv, type)) { + const keys = new Set(additionalKeys[type]); + + for (const key of retv[type]) { + keys.add(key); + } + + retv[type] = Object.freeze(Array.from(keys)); + } else { + retv[type] = Object.freeze(Array.from(additionalKeys[type])); + } + } + + return Object.freeze(retv); +} + +export { KEYS }; diff --git a/node_modules/eslint-visitor-keys/lib/visitor-keys.js b/node_modules/eslint-visitor-keys/lib/visitor-keys.js new file mode 100644 index 0000000..41feb4b --- /dev/null +++ b/node_modules/eslint-visitor-keys/lib/visitor-keys.js @@ -0,0 +1,327 @@ +/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`. + TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed +*/ +/** + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + */ +/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */ + +/** + * @type {VisitorKeys} + */ +const KEYS = { + ArrayExpression: [ + "elements" + ], + ArrayPattern: [ + "elements" + ], + ArrowFunctionExpression: [ + "params", + "body" + ], + AssignmentExpression: [ + "left", + "right" + ], + AssignmentPattern: [ + "left", + "right" + ], + AwaitExpression: [ + "argument" + ], + BinaryExpression: [ + "left", + "right" + ], + BlockStatement: [ + "body" + ], + BreakStatement: [ + "label" + ], + CallExpression: [ + "callee", + "arguments" + ], + CatchClause: [ + "param", + "body" + ], + ChainExpression: [ + "expression" + ], + ClassBody: [ + "body" + ], + ClassDeclaration: [ + "id", + "superClass", + "body" + ], + ClassExpression: [ + "id", + "superClass", + "body" + ], + ConditionalExpression: [ + "test", + "consequent", + "alternate" + ], + ContinueStatement: [ + "label" + ], + DebuggerStatement: [], + DoWhileStatement: [ + "body", + "test" + ], + EmptyStatement: [], + ExperimentalRestProperty: [ + "argument" + ], + ExperimentalSpreadProperty: [ + "argument" + ], + ExportAllDeclaration: [ + "exported", + "source", + "attributes" + ], + ExportDefaultDeclaration: [ + "declaration" + ], + ExportNamedDeclaration: [ + "declaration", + "specifiers", + "source", + "attributes" + ], + ExportSpecifier: [ + "exported", + "local" + ], + ExpressionStatement: [ + "expression" + ], + ForInStatement: [ + "left", + "right", + "body" + ], + ForOfStatement: [ + "left", + "right", + "body" + ], + ForStatement: [ + "init", + "test", + "update", + "body" + ], + FunctionDeclaration: [ + "id", + "params", + "body" + ], + FunctionExpression: [ + "id", + "params", + "body" + ], + Identifier: [], + IfStatement: [ + "test", + "consequent", + "alternate" + ], + ImportAttribute: [ + "key", + "value" + ], + ImportDeclaration: [ + "specifiers", + "source", + "attributes" + ], + ImportDefaultSpecifier: [ + "local" + ], + ImportExpression: [ + "source", + "options" + ], + ImportNamespaceSpecifier: [ + "local" + ], + ImportSpecifier: [ + "imported", + "local" + ], + JSXAttribute: [ + "name", + "value" + ], + JSXClosingElement: [ + "name" + ], + JSXClosingFragment: [], + JSXElement: [ + "openingElement", + "children", + "closingElement" + ], + JSXEmptyExpression: [], + JSXExpressionContainer: [ + "expression" + ], + JSXFragment: [ + "openingFragment", + "children", + "closingFragment" + ], + JSXIdentifier: [], + JSXMemberExpression: [ + "object", + "property" + ], + JSXNamespacedName: [ + "namespace", + "name" + ], + JSXOpeningElement: [ + "name", + "attributes" + ], + JSXOpeningFragment: [], + JSXSpreadAttribute: [ + "argument" + ], + JSXSpreadChild: [ + "expression" + ], + JSXText: [], + LabeledStatement: [ + "label", + "body" + ], + Literal: [], + LogicalExpression: [ + "left", + "right" + ], + MemberExpression: [ + "object", + "property" + ], + MetaProperty: [ + "meta", + "property" + ], + MethodDefinition: [ + "key", + "value" + ], + NewExpression: [ + "callee", + "arguments" + ], + ObjectExpression: [ + "properties" + ], + ObjectPattern: [ + "properties" + ], + PrivateIdentifier: [], + Program: [ + "body" + ], + Property: [ + "key", + "value" + ], + PropertyDefinition: [ + "key", + "value" + ], + RestElement: [ + "argument" + ], + ReturnStatement: [ + "argument" + ], + SequenceExpression: [ + "expressions" + ], + SpreadElement: [ + "argument" + ], + StaticBlock: [ + "body" + ], + Super: [], + SwitchCase: [ + "test", + "consequent" + ], + SwitchStatement: [ + "discriminant", + "cases" + ], + TaggedTemplateExpression: [ + "tag", + "quasi" + ], + TemplateElement: [], + TemplateLiteral: [ + "quasis", + "expressions" + ], + ThisExpression: [], + ThrowStatement: [ + "argument" + ], + TryStatement: [ + "block", + "handler", + "finalizer" + ], + UnaryExpression: [ + "argument" + ], + UpdateExpression: [ + "argument" + ], + VariableDeclaration: [ + "declarations" + ], + VariableDeclarator: [ + "id", + "init" + ], + WhileStatement: [ + "test", + "body" + ], + WithStatement: [ + "object", + "body" + ], + YieldExpression: [ + "argument" + ] +}; + +// Types. +const NODE_TYPES = Object.keys(KEYS); + +// Freeze the keys. +for (const type of NODE_TYPES) { + Object.freeze(KEYS[type]); +} +Object.freeze(KEYS); + +export default KEYS; diff --git a/node_modules/eslint-visitor-keys/package.json b/node_modules/eslint-visitor-keys/package.json new file mode 100644 index 0000000..4dc2123 --- /dev/null +++ b/node_modules/eslint-visitor-keys/package.json @@ -0,0 +1,67 @@ +{ + "name": "eslint-visitor-keys", + "version": "4.2.0", + "description": "Constants and utilities about visitor keys to traverse AST.", + "type": "module", + "main": "dist/eslint-visitor-keys.cjs", + "types": "./dist/index.d.ts", + "exports": { + ".": [ + { + "import": "./lib/index.js", + "require": "./dist/eslint-visitor-keys.cjs" + }, + "./dist/eslint-visitor-keys.cjs" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist/index.d.ts", + "dist/visitor-keys.d.ts", + "dist/eslint-visitor-keys.cjs", + "dist/eslint-visitor-keys.d.cts", + "lib" + ], + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "devDependencies": { + "@types/estree": "^0.0.51", + "@types/estree-jsx": "^0.0.1", + "@typescript-eslint/parser": "^8.7.0", + "c8": "^7.11.0", + "chai": "^4.3.6", + "eslint-release": "^3.2.0", + "esquery": "^1.4.0", + "json-diff": "^0.7.3", + "mocha": "^9.2.1", + "opener": "^1.5.2", + "rollup": "^4.22.4", + "rollup-plugin-dts": "^6.1.1", + "tsd": "^0.31.2", + "typescript": "^5.6.2" + }, + "scripts": { + "build": "npm run build:cjs && npm run build:types", + "build:cjs": "rollup -c", + "build:debug": "npm run build:cjs -- -m && npm run build:types", + "build:types": "tsc -v && tsc", + "release:generate:latest": "eslint-generate-release", + "release:generate:alpha": "eslint-generate-prerelease alpha", + "release:generate:beta": "eslint-generate-prerelease beta", + "release:generate:rc": "eslint-generate-prerelease rc", + "release:publish": "eslint-publish-release", + "test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js && npm run test:types", + "test:open-coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html", + "test:types": "tsd" + }, + "repository": "eslint/js", + "funding": "https://opencollective.com/eslint", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/js/issues" + }, + "homepage": "https://github.com/eslint/js/blob/main/packages/eslint-visitor-keys/README.md" +} diff --git a/node_modules/eslint/LICENSE b/node_modules/eslint/LICENSE new file mode 100644 index 0000000..b607bb3 --- /dev/null +++ b/node_modules/eslint/LICENSE @@ -0,0 +1,19 @@ +Copyright OpenJS Foundation and other contributors, + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/eslint/README.md b/node_modules/eslint/README.md new file mode 100644 index 0000000..178f39d --- /dev/null +++ b/node_modules/eslint/README.md @@ -0,0 +1,330 @@ +[![npm version](https://img.shields.io/npm/v/eslint.svg)](https://www.npmjs.com/package/eslint) +[![Downloads](https://img.shields.io/npm/dm/eslint.svg)](https://www.npmjs.com/package/eslint) +[![Build Status](https://github.com/eslint/eslint/workflows/CI/badge.svg)](https://github.com/eslint/eslint/actions) +
+[![Open Collective Backers](https://img.shields.io/opencollective/backers/eslint)](https://opencollective.com/eslint) +[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/eslint)](https://opencollective.com/eslint) + +# ESLint + +[Website](https://eslint.org) | +[Configure ESLint](https://eslint.org/docs/latest/use/configure) | +[Rules](https://eslint.org/docs/rules/) | +[Contribute to ESLint](https://eslint.org/docs/latest/contribute) | +[Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs) | +[Code of Conduct](https://eslint.org/conduct) | +[Twitter](https://twitter.com/geteslint) | +[Discord](https://eslint.org/chat) | +[Mastodon](https://fosstodon.org/@eslint) | +[Bluesky](https://bsky.app/profile/eslint.org) + +ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions: + +* ESLint uses [Espree](https://github.com/eslint/js/tree/main/packages/espree) for JavaScript parsing. +* ESLint uses an AST to evaluate patterns in code. +* ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime. + +## Table of Contents + +1. [Installation and Usage](#installation-and-usage) +1. [Configuration](#configuration) +1. [Version Support](#version-support) +1. [Code of Conduct](#code-of-conduct) +1. [Filing Issues](#filing-issues) +1. [Frequently Asked Questions](#frequently-asked-questions) +1. [Releases](#releases) +1. [Security Policy](#security-policy) +1. [Semantic Versioning Policy](#semantic-versioning-policy) +1. [License](#license) +1. [Team](#team) +1. [Sponsors](#sponsors) +1. [Technology Sponsors](#technology-sponsors) + +## Installation and Usage + +Prerequisites: [Node.js](https://nodejs.org/) (`^18.18.0`, `^20.9.0`, or `>=21.1.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.) + +You can install and configure ESLint using this command: + +```shell +npm init @eslint/config@latest +``` + +After that, you can run ESLint on any file or directory like this: + +```shell +npx eslint yourfile.js +``` + +### pnpm Installation + +To use ESLint with pnpm, we recommend setting up a `.npmrc` file with at least the following settings: + +```text +auto-install-peers=true +node-linker=hoisted +``` + +This ensures that pnpm installs dependencies in a way that is more compatible with npm and is less likely to produce errors. + +## Configuration + +You can configure rules in your `eslint.config.js` files as in this example: + +```js +export default [ + { + files: ["**/*.js", "**/*.cjs", "**/*.mjs"], + rules: { + "prefer-const": "warn", + "no-constant-binary-expression": "error" + } + } +]; +``` + +The names `"prefer-const"` and `"no-constant-binary-expression"` are the names of [rules](https://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values: + +* `"off"` or `0` - turn the rule off +* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code) +* `"error"` or `2` - turn the rule on as an error (exit code will be 1) + +The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/latest/use/configure)). + +## Version Support + +The ESLint team provides ongoing support for the current version and six months of limited support for the previous version. Limited support includes critical bug fixes, security issues, and compatibility issues only. + +ESLint offers commercial support for both current and previous versions through our partners, [Tidelift][tidelift] and [HeroDevs][herodevs]. + +See [Version Support](https://eslint.org/version-support) for more details. + +## Code of Conduct + +ESLint adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct). + +## Filing Issues + +Before filing an issue, please be sure to read the guidelines for what you're reporting: + +* [Bug Report](https://eslint.org/docs/latest/contribute/report-bugs) +* [Propose a New Rule](https://eslint.org/docs/latest/contribute/propose-new-rule) +* [Proposing a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change) +* [Request a Change](https://eslint.org/docs/latest/contribute/request-change) + +## Frequently Asked Questions + +### Does ESLint support JSX? + +Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/latest/use/configure)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics. + +### Does Prettier replace ESLint? + +No, ESLint and Prettier have different jobs: ESLint is a linter (looking for problematic patterns) and Prettier is a code formatter. Using both tools is common, refer to [Prettier's documentation](https://prettier.io/docs/en/install#eslint-and-other-linters) to learn how to configure them to work well with each other. + +### What ECMAScript versions does ESLint support? + +ESLint has full support for ECMAScript 3, 5, and every year from 2015 up until the most recent stage 4 specification (the default). You can set your desired ECMAScript syntax and other settings (like global variables) through [configuration](https://eslint.org/docs/latest/use/configure). + +### What about experimental features? + +ESLint's parser only officially supports the latest final ECMAScript standard. We will make changes to core rules in order to avoid crashes on stage 3 ECMAScript syntax proposals (as long as they are implemented using the correct experimental ESTree syntax). We may make changes to core rules to better work with language extensions (such as JSX, Flow, and TypeScript) on a case-by-case basis. + +In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) and [@babel/eslint-plugin](https://www.npmjs.com/package/@babel/eslint-plugin) to use any option available in Babel. + +Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/latest/contribute). Until then, please use the appropriate parser and plugin(s) for your experimental feature. + +### Which Node.js versions does ESLint support? + +ESLint updates the supported Node.js versions with each major release of ESLint. At that time, ESLint's supported Node.js versions are updated to be: + +1. The most recent maintenance release of Node.js +1. The lowest minor version of the Node.js LTS release that includes the features the ESLint team wants to use. +1. The Node.js Current release + +ESLint is also expected to work with Node.js versions released after the Node.js Current release. + +Refer to the [Quick Start Guide](https://eslint.org/docs/latest/use/getting-started#prerequisites) for the officially supported Node.js versions for a given ESLint release. + +### Where to ask for help? + +Open a [discussion](https://github.com/eslint/eslint/discussions) or stop by our [Discord server](https://eslint.org/chat). + +### Why doesn't ESLint lock dependency versions? + +Lock files like `package-lock.json` are helpful for deployed applications. They ensure that dependencies are consistent between environments and across deployments. + +Packages like `eslint` that get published to the npm registry do not include lock files. `npm install eslint` as a user will respect version constraints in ESLint's `package.json`. ESLint and its dependencies will be included in the user's lock file if one exists, but ESLint's own lock file would not be used. + +We intentionally don't lock dependency versions so that we have the latest compatible dependency versions in development and CI that our users get when installing ESLint in a project. + +The Twilio blog has a [deeper dive](https://www.twilio.com/blog/lockfiles-nodejs) to learn more. + +## Releases + +We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release. + +## Security Policy + +ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). + +## Semantic Versioning Policy + +ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint: + +* Patch release (intended to not break your lint build) + * A bug fix in a rule that results in ESLint reporting fewer linting errors. + * A bug fix to the CLI or core (including formatters). + * Improvements to documentation. + * Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage. + * Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone). +* Minor release (might break your lint build) + * A bug fix in a rule that results in ESLint reporting more linting errors. + * A new rule is created. + * A new option to an existing rule that does not result in ESLint reporting more linting errors by default. + * A new addition to an existing rule to support a newly-added language feature (within the last 12 months) that will result in ESLint reporting more linting errors by default. + * An existing rule is deprecated. + * A new CLI capability is created. + * New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.). + * A new formatter is created. + * `eslint:recommended` is updated and will result in strictly fewer linting errors (e.g., rule removals). +* Major release (likely to break your lint build) + * `eslint:recommended` is updated and may result in new linting errors (e.g., rule additions, most rule option updates). + * A new option to an existing rule that results in ESLint reporting more linting errors by default. + * An existing formatter is removed. + * Part of the public API is removed or changed in an incompatible way. The public API includes: + * Rule schemas + * Configuration schema + * Command-line options + * Node.js API + * Rule, formatter, parser, plugin APIs + +According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds. + +## License + +MIT License + +Copyright OpenJS Foundation and other contributors, + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +## Team + +These folks keep the project moving and are resources for help. + + + + + +### Technical Steering Committee (TSC) + +The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained. + +
+ +Nicholas C. Zakas's Avatar
+Nicholas C. Zakas +
+
+ +Francesco Trotta's Avatar
+Francesco Trotta +
+
+ +Milos Djermanovic's Avatar
+Milos Djermanovic +
+
+ +### Reviewers + +The people who review and implement new features. + +
+ +唯然's Avatar
+唯然 +
+
+ +Nitin Kumar's Avatar
+Nitin Kumar +
+
+ +### Committers + +The people who review and fix bugs and help triage issues. + +
+ +Josh Goldberg ✨'s Avatar
+Josh Goldberg ✨ +
+
+ +Tanuj Kanti's Avatar
+Tanuj Kanti +
+
+ +### Website Team + +Team members who focus specifically on eslint.org + +
+ +Amaresh  S M's Avatar
+Amaresh S M +
+
+ +Strek's Avatar
+Strek +
+
+ +Percy Ma's Avatar
+Percy Ma +
+
+ + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io

Silver Sponsors

+

Vite JetBrains Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ + +[tidelift]: https://tidelift.com/funding/github/npm/eslint +[herodevs]: https://www.herodevs.com/support/eslint-nes?utm_source=ESLintWebsite&utm_medium=ESLintWebsite&utm_campaign=ESLintNES&utm_id=ESLintNES diff --git a/node_modules/eslint/conf/default-cli-options.js b/node_modules/eslint/conf/default-cli-options.js new file mode 100644 index 0000000..dad03d8 --- /dev/null +++ b/node_modules/eslint/conf/default-cli-options.js @@ -0,0 +1,32 @@ +/** + * @fileoverview Default CLIEngineOptions. + * @author Ian VanSchooten + */ + +"use strict"; + +module.exports = { + configFile: null, + baseConfig: false, + rulePaths: [], + useEslintrc: true, + envs: [], + globals: [], + extensions: null, + ignore: true, + ignorePath: void 0, + cache: false, + + /* + * in order to honor the cacheFile option if specified + * this option should not have a default value otherwise + * it will always be used + */ + cacheLocation: "", + cacheFile: ".eslintcache", + cacheStrategy: "metadata", + fix: false, + allowInlineConfig: true, + reportUnusedDisableDirectives: void 0, + globInputPaths: true +}; diff --git a/node_modules/eslint/conf/ecma-version.js b/node_modules/eslint/conf/ecma-version.js new file mode 100644 index 0000000..4e38c1d --- /dev/null +++ b/node_modules/eslint/conf/ecma-version.js @@ -0,0 +1,16 @@ +/** + * @fileoverview Configuration related to ECMAScript versions + * @author Milos Djermanovic + */ + +"use strict"; + +/** + * The latest ECMAScript version supported by ESLint. + * @type {number} year-based ECMAScript version + */ +const LATEST_ECMA_VERSION = 2025; + +module.exports = { + LATEST_ECMA_VERSION +}; diff --git a/node_modules/eslint/conf/globals.js b/node_modules/eslint/conf/globals.js new file mode 100644 index 0000000..81df6bb --- /dev/null +++ b/node_modules/eslint/conf/globals.js @@ -0,0 +1,160 @@ +/** + * @fileoverview Globals for ecmaVersion/sourceType + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Globals +//----------------------------------------------------------------------------- + +const commonjs = { + exports: true, + global: false, + module: false, + require: false +}; + +const es3 = { + Array: false, + Boolean: false, + constructor: false, + Date: false, + decodeURI: false, + decodeURIComponent: false, + encodeURI: false, + encodeURIComponent: false, + Error: false, + escape: false, + eval: false, + EvalError: false, + Function: false, + hasOwnProperty: false, + Infinity: false, + isFinite: false, + isNaN: false, + isPrototypeOf: false, + Math: false, + NaN: false, + Number: false, + Object: false, + parseFloat: false, + parseInt: false, + propertyIsEnumerable: false, + RangeError: false, + ReferenceError: false, + RegExp: false, + String: false, + SyntaxError: false, + toLocaleString: false, + toString: false, + TypeError: false, + undefined: false, + unescape: false, + URIError: false, + valueOf: false +}; + +const es5 = { + ...es3, + JSON: false +}; + +const es2015 = { + ...es5, + ArrayBuffer: false, + DataView: false, + Float32Array: false, + Float64Array: false, + Int16Array: false, + Int32Array: false, + Int8Array: false, + Intl: false, + Map: false, + Promise: false, + Proxy: false, + Reflect: false, + Set: false, + Symbol: false, + Uint16Array: false, + Uint32Array: false, + Uint8Array: false, + Uint8ClampedArray: false, + WeakMap: false, + WeakSet: false +}; + +// no new globals in ES2016 +const es2016 = { + ...es2015 +}; + +const es2017 = { + ...es2016, + Atomics: false, + SharedArrayBuffer: false +}; + +// no new globals in ES2018 +const es2018 = { + ...es2017 +}; + +// no new globals in ES2019 +const es2019 = { + ...es2018 +}; + +const es2020 = { + ...es2019, + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const es2021 = { + ...es2020, + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +const es2022 = { + ...es2021 +}; + +const es2023 = { + ...es2022 +}; + +const es2024 = { + ...es2023 +}; + +const es2025 = { + ...es2024 +}; + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + commonjs, + es3, + es5, + es2015, + es2016, + es2017, + es2018, + es2019, + es2020, + es2021, + es2022, + es2023, + es2024, + es2025 +}; diff --git a/node_modules/eslint/conf/replacements.json b/node_modules/eslint/conf/replacements.json new file mode 100644 index 0000000..c047811 --- /dev/null +++ b/node_modules/eslint/conf/replacements.json @@ -0,0 +1,22 @@ +{ + "rules": { + "generator-star": ["generator-star-spacing"], + "global-strict": ["strict"], + "no-arrow-condition": ["no-confusing-arrow", "no-constant-condition"], + "no-comma-dangle": ["comma-dangle"], + "no-empty-class": ["no-empty-character-class"], + "no-empty-label": ["no-labels"], + "no-extra-strict": ["strict"], + "no-reserved-keys": ["quote-props"], + "no-space-before-semi": ["semi-spacing"], + "no-wrap-func": ["no-extra-parens"], + "space-after-function-name": ["space-before-function-paren"], + "space-after-keywords": ["keyword-spacing"], + "space-before-function-parentheses": ["space-before-function-paren"], + "space-before-keywords": ["keyword-spacing"], + "space-in-brackets": ["object-curly-spacing", "array-bracket-spacing", "computed-property-spacing"], + "space-return-throw-case": ["keyword-spacing"], + "space-unary-word-ops": ["space-unary-ops"], + "spaced-line-comment": ["spaced-comment"] + } +} diff --git a/node_modules/eslint/conf/rule-type-list.json b/node_modules/eslint/conf/rule-type-list.json new file mode 100644 index 0000000..ddd7e09 --- /dev/null +++ b/node_modules/eslint/conf/rule-type-list.json @@ -0,0 +1,94 @@ +{ + "types": { + "problem": [], + "suggestion": [], + "layout": [] + }, + "deprecated": [], + "removed": [ + { + "removed": "generator-star", + "replacedBy": [{ "rule": { "name": "generator-star-spacing" } }] + }, + { + "removed": "global-strict", + "replacedBy": [{ "rule": { "name": "strict" } }] + }, + { + "removed": "no-arrow-condition", + "replacedBy": [ + { "rule": { "name": "no-confusing-arrow" } }, + { "rule": { "name": "no-constant-condition" } } + ] + }, + { + "removed": "no-comma-dangle", + "replacedBy": [{ "rule": { "name": "comma-dangle" } }] + }, + { + "removed": "no-empty-class", + "replacedBy": [{ "rule": { "name": "no-empty-character-class" } }] + }, + { + "removed": "no-empty-label", + "replacedBy": [{ "rule": { "name": "no-labels" } }] + }, + { + "removed": "no-extra-strict", + "replacedBy": [{ "rule": { "name": "strict" } }] + }, + { + "removed": "no-reserved-keys", + "replacedBy": [{ "rule": { "name": "quote-props" } }] + }, + { + "removed": "no-space-before-semi", + "replacedBy": [{ "rule": { "name": "semi-spacing" } }] + }, + { + "removed": "no-wrap-func", + "replacedBy": [{ "rule": { "name": "no-extra-parens" } }] + }, + { + "removed": "space-after-function-name", + "replacedBy": [ + { "rule": { "name": "space-before-function-paren" } } + ] + }, + { + "removed": "space-after-keywords", + "replacedBy": [{ "rule": { "name": "keyword-spacing" } }] + }, + { + "removed": "space-before-function-parentheses", + "replacedBy": [ + { "rule": { "name": "space-before-function-paren" } } + ] + }, + { + "removed": "space-before-keywords", + "replacedBy": [{ "rule": { "name": "keyword-spacing" } }] + }, + { + "removed": "space-in-brackets", + "replacedBy": [ + { "rule": { "name": "object-curly-spacing" } }, + { "rule": { "name": "array-bracket-spacing" } } + ] + }, + { + "removed": "space-return-throw-case", + "replacedBy": [{ "rule": { "name": "keyword-spacing" } }] + }, + { + "removed": "space-unary-word-ops", + "replacedBy": [{ "rule": { "name": "space-unary-ops" } }] + }, + { + "removed": "spaced-line-comment", + "replacedBy": [{ "rule": { "name": "spaced-comment" } }] + }, + { "removed": "valid-jsdoc", "replacedBy": [] }, + { "removed": "require-jsdoc", "replacedBy": [] } + ] +} diff --git a/node_modules/eslint/lib/api.js b/node_modules/eslint/lib/api.js new file mode 100644 index 0000000..a134ecd --- /dev/null +++ b/node_modules/eslint/lib/api.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Expose out ESLint and CLI to require. + * @author Ian Christian Myers + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { ESLint, shouldUseFlatConfig } = require("./eslint/eslint"); +const { LegacyESLint } = require("./eslint/legacy-eslint"); +const { Linter } = require("./linter"); +const { RuleTester } = require("./rule-tester"); +const { SourceCode } = require("./languages/js/source-code"); + +//----------------------------------------------------------------------------- +// Functions +//----------------------------------------------------------------------------- + +/** + * Loads the correct ESLint constructor given the options. + * @param {Object} [options] The options object + * @param {boolean} [options.useFlatConfig] Whether or not to use a flat config + * @returns {Promise} The ESLint constructor + */ +async function loadESLint({ useFlatConfig } = {}) { + + /* + * Note: The v8.x version of this function also accepted a `cwd` option, but + * it is not used in this implementation so we silently ignore it. + */ + + const shouldESLintUseFlatConfig = useFlatConfig ?? (await shouldUseFlatConfig()); + + return shouldESLintUseFlatConfig ? ESLint : LegacyESLint; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + Linter, + loadESLint, + ESLint, + RuleTester, + SourceCode +}; diff --git a/node_modules/eslint/lib/cli-engine/cli-engine.js b/node_modules/eslint/lib/cli-engine/cli-engine.js new file mode 100644 index 0000000..43fcc73 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/cli-engine.js @@ -0,0 +1,1089 @@ +/** + * @fileoverview Main CLI object. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * The CLI object should *not* call process.exit() directly. It should only return + * exit codes. This allows other programs to use the CLI object and still control + * when the program exits. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("node:fs"); +const path = require("node:path"); +const defaultOptions = require("../../conf/default-cli-options"); +const pkg = require("../../package.json"); + + +const { + Legacy: { + ConfigOps, + naming, + CascadingConfigArrayFactory, + IgnorePattern, + getUsedExtractedConfigs, + ModuleResolver + } +} = require("@eslint/eslintrc"); + +const { FileEnumerator } = require("./file-enumerator"); + +const { Linter } = require("../linter"); +const builtInRules = require("../rules"); +const loadRules = require("./load-rules"); +const hash = require("./hash"); +const LintResultCache = require("./lint-result-cache"); + +const debug = require("debug")("eslint:cli-engine"); +const removedFormatters = new Set([ + "checkstyle", + "codeframe", + "compact", + "jslint-xml", + "junit", + "table", + "tap", + "unix", + "visualstudio" +]); +const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +// For VSCode IntelliSense +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */ +/** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {import("../shared/types").FormatterFunction} FormatterFunction */ +/** @typedef {ReturnType} ConfigArray */ +/** @typedef {ReturnType} ExtractedConfig */ + +/** + * The options to configure a CLI engine with. + * @typedef {Object} CLIEngineOptions + * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments. + * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this CLIEngine instance + * @property {boolean} [cache] Enable result caching. + * @property {string} [cacheLocation] The cache file to use instead of .eslintcache. + * @property {string} [configFile] The configuration file to use. + * @property {string} [cwd] The value to use for the current working directory. + * @property {string[]} [envs] An array of environments to load. + * @property {string[]|null} [extensions] An array of file extensions to check. + * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean. + * @property {string[]} [fixTypes] Array of rule types to apply fixes for. + * @property {string[]} [globals] An array of global variables to declare. + * @property {boolean} [ignore] False disables use of .eslintignore. + * @property {string} [ignorePath] The ignore file to use instead of .eslintignore. + * @property {string|string[]} [ignorePattern] One or more glob patterns to ignore. + * @property {boolean} [useEslintrc] False disables looking for .eslintrc + * @property {string} [parser] The name of the parser to use. + * @property {ParserOptions} [parserOptions] An object of parserOption settings to use. + * @property {string[]} [plugins] An array of plugins to load. + * @property {Record} [rules] An object of rules to use. + * @property {string[]} [rulePaths] An array of directories to load custom rules from. + * @property {boolean|string} [reportUnusedDisableDirectives] `true`, `"error"` or '"warn"' adds reports for unused eslint-disable directives + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD + */ + +/** + * A linting result. + * @typedef {Object} LintResult + * @property {string} filePath The path to the file that was linted. + * @property {LintMessage[]} messages All of the messages for the result. + * @property {SuppressedLintMessage[]} suppressedMessages All of the suppressed messages for the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} fatalErrorCount Number of fatal errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {string} [source] The source code of the file that was linted. + * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible. + */ + +/** + * Linting results. + * @typedef {Object} LintReport + * @property {LintResult[]} results All of the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} fatalErrorCount Number of fatal errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules. + */ + +/** + * Private data for CLIEngine. + * @typedef {Object} CLIEngineInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cacheFilePath The path to the cache of lint results. + * @property {CascadingConfigArrayFactory} configArrayFactory The factory of configs. + * @property {(filePath: string) => boolean} defaultIgnores The default predicate function to check if a file ignored or not. + * @property {FileEnumerator} fileEnumerator The file enumerator. + * @property {ConfigArray[]} lastConfigArrays The list of config arrays that the last `executeOnFiles` or `executeOnText` used. + * @property {LintResultCache|null} lintResultCache The cache of lint results. + * @property {Linter} linter The linter instance which has loaded rules. + * @property {CLIEngineOptions} options The normalized options of this instance. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Determines if each fix type in an array is supported by ESLint and throws + * an error if not. + * @param {string[]} fixTypes An array of fix types to check. + * @returns {void} + * @throws {Error} If an invalid fix type is found. + */ +function validateFixTypes(fixTypes) { + for (const fixType of fixTypes) { + if (!validFixTypes.has(fixType)) { + throw new Error(`Invalid fix type "${fixType}" found.`); + } + } +} + +/** + * It will calculate the error and warning count for collection of messages per file + * @param {LintMessage[]} messages Collection of messages + * @returns {Object} Contains the stats + * @private + */ +function calculateStatsPerFile(messages) { + const stat = { + errorCount: 0, + fatalErrorCount: 0, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }; + + for (let i = 0; i < messages.length; i++) { + const message = messages[i]; + + if (message.fatal || message.severity === 2) { + stat.errorCount++; + if (message.fatal) { + stat.fatalErrorCount++; + } + if (message.fix) { + stat.fixableErrorCount++; + } + } else { + stat.warningCount++; + if (message.fix) { + stat.fixableWarningCount++; + } + } + } + return stat; +} + +/** + * It will calculate the error and warning count for collection of results from all files + * @param {LintResult[]} results Collection of messages from all the files + * @returns {Object} Contains the stats + * @private + */ +function calculateStatsPerRun(results) { + const stat = { + errorCount: 0, + fatalErrorCount: 0, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }; + + for (let i = 0; i < results.length; i++) { + const result = results[i]; + + stat.errorCount += result.errorCount; + stat.fatalErrorCount += result.fatalErrorCount; + stat.warningCount += result.warningCount; + stat.fixableErrorCount += result.fixableErrorCount; + stat.fixableWarningCount += result.fixableWarningCount; + } + + return stat; +} + +/** + * Processes an source code using ESLint. + * @param {Object} config The config object. + * @param {string} config.text The source code to verify. + * @param {string} config.cwd The path to the current working directory. + * @param {string|undefined} config.filePath The path to the file of `text`. If this is undefined, it uses ``. + * @param {ConfigArray} config.config The config. + * @param {boolean} config.fix If `true` then it does fix. + * @param {boolean} config.allowInlineConfig If `true` then it uses directive comments. + * @param {boolean|string} config.reportUnusedDisableDirectives If `true`, `"error"` or '"warn"', then it reports unused `eslint-disable` comments. + * @param {FileEnumerator} config.fileEnumerator The file enumerator to check if a path is a target or not. + * @param {Linter} config.linter The linter instance to verify. + * @returns {LintResult} The result of linting. + * @private + */ +function verifyText({ + text, + cwd, + filePath: providedFilePath, + config, + fix, + allowInlineConfig, + reportUnusedDisableDirectives, + fileEnumerator, + linter +}) { + const filePath = providedFilePath || ""; + + debug(`Lint ${filePath}`); + + /* + * Verify. + * `config.extractConfig(filePath)` requires an absolute path, but `linter` + * doesn't know CWD, so it gives `linter` an absolute path always. + */ + const filePathToVerify = filePath === "" ? path.join(cwd, filePath) : filePath; + const { fixed, messages, output } = linter.verifyAndFix( + text, + config, + { + allowInlineConfig, + filename: filePathToVerify, + fix, + reportUnusedDisableDirectives, + + /** + * Check if the linter should adopt a given code block or not. + * @param {string} blockFilename The virtual filename of a code block. + * @returns {boolean} `true` if the linter should adopt the code block. + */ + filterCodeBlock(blockFilename) { + return fileEnumerator.isTargetPath(blockFilename); + } + } + ); + + // Tweak and return. + const result = { + filePath, + messages, + suppressedMessages: linter.getSuppressedMessages(), + ...calculateStatsPerFile(messages) + }; + + if (fixed) { + result.output = output; + } + if ( + result.errorCount + result.warningCount > 0 && + typeof result.output === "undefined" + ) { + result.source = text; + } + + return result; +} + +/** + * Returns result with warning by ignore settings + * @param {string} filePath File path of checked code + * @param {string} baseDir Absolute path of base directory + * @returns {LintResult} Result with single warning + * @private + */ +function createIgnoreResult(filePath, baseDir) { + let message; + const isHidden = filePath.split(path.sep) + .find(segment => /^\./u.test(segment)); + const isInNodeModules = baseDir && path.relative(baseDir, filePath).startsWith("node_modules"); + + if (isHidden) { + message = "File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."; + } else if (isInNodeModules) { + message = "File ignored by default. Use \"--ignore-pattern '!node_modules/*'\" to override."; + } else { + message = "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override."; + } + + return { + filePath: path.resolve(filePath), + messages: [ + { + ruleId: null, + fatal: false, + severity: 1, + message, + nodeType: null + } + ], + suppressedMessages: [], + errorCount: 0, + fatalErrorCount: 0, + warningCount: 1, + fixableErrorCount: 0, + fixableWarningCount: 0 + }; +} + +/** + * Get a rule. + * @param {string} ruleId The rule ID to get. + * @param {ConfigArray[]} configArrays The config arrays that have plugin rules. + * @returns {Rule|null} The rule or null. + */ +function getRule(ruleId, configArrays) { + for (const configArray of configArrays) { + const rule = configArray.pluginRules.get(ruleId); + + if (rule) { + return rule; + } + } + return builtInRules.get(ruleId) || null; +} + +/** + * Checks whether a message's rule type should be fixed. + * @param {LintMessage} message The message to check. + * @param {ConfigArray[]} lastConfigArrays The list of config arrays that the last `executeOnFiles` or `executeOnText` used. + * @param {string[]} fixTypes An array of fix types to check. + * @returns {boolean} Whether the message should be fixed. + */ +function shouldMessageBeFixed(message, lastConfigArrays, fixTypes) { + if (!message.ruleId) { + return fixTypes.has("directive"); + } + + const rule = message.ruleId && getRule(message.ruleId, lastConfigArrays); + + return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type)); +} + +/** + * Collect used deprecated rules. + * @param {ConfigArray[]} usedConfigArrays The config arrays which were used. + * @returns {IterableIterator} Used deprecated rules. + */ +function *iterateRuleDeprecationWarnings(usedConfigArrays) { + const processedRuleIds = new Set(); + + // Flatten used configs. + /** @type {ExtractedConfig[]} */ + const configs = usedConfigArrays.flatMap(getUsedExtractedConfigs); + + // Traverse rule configs. + for (const config of configs) { + for (const [ruleId, ruleConfig] of Object.entries(config.rules)) { + + // Skip if it was processed. + if (processedRuleIds.has(ruleId)) { + continue; + } + processedRuleIds.add(ruleId); + + // Skip if it's not used. + if (!ConfigOps.getRuleSeverity(ruleConfig)) { + continue; + } + const rule = getRule(ruleId, usedConfigArrays); + + // Skip if it's not deprecated. + if (!(rule && rule.meta && rule.meta.deprecated)) { + continue; + } + + // This rule was used and deprecated. + yield { + ruleId, + replacedBy: rule.meta.replacedBy || [] + }; + } + } +} + +/** + * Checks if the given message is an error message. + * @param {LintMessage} message The message to check. + * @returns {boolean} Whether or not the message is an error message. + * @private + */ +function isErrorMessage(message) { + return message.severity === 2; +} + + +/** + * return the cacheFile to be used by eslint, based on whether the provided parameter is + * a directory or looks like a directory (ends in `path.sep`), in which case the file + * name will be the `cacheFile/.cache_hashOfCWD` + * + * if cacheFile points to a file or looks like a file then it will just use that file + * @param {string} cacheFile The name of file to be used to store the cache + * @param {string} cwd Current working directory + * @returns {string} the resolved path to the cache file + */ +function getCacheFile(cacheFile, cwd) { + + /* + * make sure the path separators are normalized for the environment/os + * keeping the trailing path separator if present + */ + const normalizedCacheFile = path.normalize(cacheFile); + + const resolvedCacheFile = path.resolve(cwd, normalizedCacheFile); + const looksLikeADirectory = normalizedCacheFile.slice(-1) === path.sep; + + /** + * return the name for the cache file in case the provided parameter is a directory + * @returns {string} the resolved path to the cacheFile + */ + function getCacheFileForDirectory() { + return path.join(resolvedCacheFile, `.cache_${hash(cwd)}`); + } + + let fileStats; + + try { + fileStats = fs.lstatSync(resolvedCacheFile); + } catch { + fileStats = null; + } + + + /* + * in case the file exists we need to verify if the provided path + * is a directory or a file. If it is a directory we want to create a file + * inside that directory + */ + if (fileStats) { + + /* + * is a directory or is a file, but the original file the user provided + * looks like a directory but `path.resolve` removed the `last path.sep` + * so we need to still treat this like a directory + */ + if (fileStats.isDirectory() || looksLikeADirectory) { + return getCacheFileForDirectory(); + } + + // is file so just use that file + return resolvedCacheFile; + } + + /* + * here we known the file or directory doesn't exist, + * so we will try to infer if its a directory if it looks like a directory + * for the current operating system. + */ + + // if the last character passed is a path separator we assume is a directory + if (looksLikeADirectory) { + return getCacheFileForDirectory(); + } + + return resolvedCacheFile; +} + +/** + * Convert a string array to a boolean map. + * @param {string[]|null} keys The keys to assign true. + * @param {boolean} defaultValue The default value for each property. + * @param {string} displayName The property name which is used in error message. + * @throws {Error} Requires array. + * @returns {Record} The boolean map. + */ +function toBooleanMap(keys, defaultValue, displayName) { + if (keys && !Array.isArray(keys)) { + throw new Error(`${displayName} must be an array.`); + } + if (keys && keys.length > 0) { + return keys.reduce((map, def) => { + const [key, value] = def.split(":"); + + if (key !== "__proto__") { + map[key] = value === void 0 + ? defaultValue + : value === "true"; + } + + return map; + }, {}); + } + return void 0; +} + +/** + * Create a config data from CLI options. + * @param {CLIEngineOptions} options The options + * @returns {ConfigData|null} The created config data. + */ +function createConfigDataFromOptions(options) { + const { + ignorePattern, + parser, + parserOptions, + plugins, + rules + } = options; + const env = toBooleanMap(options.envs, true, "envs"); + const globals = toBooleanMap(options.globals, false, "globals"); + + if ( + env === void 0 && + globals === void 0 && + (ignorePattern === void 0 || ignorePattern.length === 0) && + parser === void 0 && + parserOptions === void 0 && + plugins === void 0 && + rules === void 0 + ) { + return null; + } + return { + env, + globals, + ignorePatterns: ignorePattern, + parser, + parserOptions, + plugins, + rules + }; +} + +/** + * Checks whether a directory exists at the given location + * @param {string} resolvedPath A path from the CWD + * @throws {Error} As thrown by `fs.statSync` or `fs.isDirectory`. + * @returns {boolean} `true` if a directory exists + */ +function directoryExists(resolvedPath) { + try { + return fs.statSync(resolvedPath).isDirectory(); + } catch (error) { + if (error && (error.code === "ENOENT" || error.code === "ENOTDIR")) { + return false; + } + throw error; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Core CLI. + */ +class CLIEngine { + + /** + * Creates a new instance of the core CLI engine. + * @param {CLIEngineOptions} providedOptions The options for this instance. + * @param {Object} [additionalData] Additional settings that are not CLIEngineOptions. + * @param {Record|null} [additionalData.preloadedPlugins] Preloaded plugins. + */ + constructor(providedOptions, { preloadedPlugins } = {}) { + const options = Object.assign( + Object.create(null), + defaultOptions, + { cwd: process.cwd() }, + providedOptions + ); + + if (options.fix === void 0) { + options.fix = false; + } + + const additionalPluginPool = new Map(); + + if (preloadedPlugins) { + for (const [id, plugin] of Object.entries(preloadedPlugins)) { + additionalPluginPool.set(id, plugin); + } + } + + const cacheFilePath = getCacheFile( + options.cacheLocation || options.cacheFile, + options.cwd + ); + const configArrayFactory = new CascadingConfigArrayFactory({ + additionalPluginPool, + baseConfig: options.baseConfig || null, + cliConfig: createConfigDataFromOptions(options), + cwd: options.cwd, + ignorePath: options.ignorePath, + resolvePluginsRelativeTo: options.resolvePluginsRelativeTo, + rulePaths: options.rulePaths, + specificConfigPath: options.configFile, + useEslintrc: options.useEslintrc, + builtInRules, + loadRules, + getEslintRecommendedConfig: () => require("@eslint/js").configs.recommended, + getEslintAllConfig: () => require("@eslint/js").configs.all + }); + const fileEnumerator = new FileEnumerator({ + configArrayFactory, + cwd: options.cwd, + extensions: options.extensions, + globInputPaths: options.globInputPaths, + errorOnUnmatchedPattern: options.errorOnUnmatchedPattern, + ignore: options.ignore + }); + const lintResultCache = + options.cache ? new LintResultCache(cacheFilePath, options.cacheStrategy) : null; + const linter = new Linter({ cwd: options.cwd, configType: "eslintrc" }); + + /** @type {ConfigArray[]} */ + const lastConfigArrays = [configArrayFactory.getConfigArrayForFile()]; + + // Store private data. + internalSlotsMap.set(this, { + additionalPluginPool, + cacheFilePath, + configArrayFactory, + defaultIgnores: IgnorePattern.createDefaultIgnore(options.cwd), + fileEnumerator, + lastConfigArrays, + lintResultCache, + linter, + options + }); + + // setup special filter for fixes + if (options.fix && options.fixTypes && options.fixTypes.length > 0) { + debug(`Using fix types ${options.fixTypes}`); + + // throw an error if any invalid fix types are found + validateFixTypes(options.fixTypes); + + // convert to Set for faster lookup + const fixTypes = new Set(options.fixTypes); + + // save original value of options.fix in case it's a function + const originalFix = (typeof options.fix === "function") + ? options.fix : () => true; + + options.fix = message => shouldMessageBeFixed(message, lastConfigArrays, fixTypes) && originalFix(message); + } + } + + getRules() { + const { lastConfigArrays } = internalSlotsMap.get(this); + + return new Map(function *() { + yield* builtInRules; + + for (const configArray of lastConfigArrays) { + yield* configArray.pluginRules; + } + }()); + } + + /** + * Returns results that only contains errors. + * @param {LintResult[]} results The results to filter. + * @returns {LintResult[]} The filtered results. + */ + static getErrorResults(results) { + const filtered = []; + + results.forEach(result => { + const filteredMessages = result.messages.filter(isErrorMessage); + const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage); + + if (filteredMessages.length > 0) { + filtered.push({ + ...result, + messages: filteredMessages, + suppressedMessages: filteredSuppressedMessages, + errorCount: filteredMessages.length, + warningCount: 0, + fixableErrorCount: result.fixableErrorCount, + fixableWarningCount: 0 + }); + } + }); + + return filtered; + } + + /** + * Outputs fixes from the given results to files. + * @param {LintReport} report The report object created by CLIEngine. + * @returns {void} + */ + static outputFixes(report) { + report.results.filter(result => Object.hasOwn(result, "output")).forEach(result => { + fs.writeFileSync(result.filePath, result.output); + }); + } + + /** + * Resolves the patterns passed into executeOnFiles() into glob-based patterns + * for easier handling. + * @param {string[]} patterns The file patterns passed on the command line. + * @returns {string[]} The equivalent glob patterns. + */ + resolveFileGlobPatterns(patterns) { + const { options } = internalSlotsMap.get(this); + + if (options.globInputPaths === false) { + return patterns.filter(Boolean); + } + + const extensions = (options.extensions || [".js"]).map(ext => ext.replace(/^\./u, "")); + const dirSuffix = `/**/*.{${extensions.join(",")}}`; + + return patterns.filter(Boolean).map(pathname => { + const resolvedPath = path.resolve(options.cwd, pathname); + const newPath = directoryExists(resolvedPath) + ? pathname.replace(/[/\\]$/u, "") + dirSuffix + : pathname; + + return path.normalize(newPath).replace(/\\/gu, "/"); + }); + } + + /** + * Executes the current configuration on an array of file and directory names. + * @param {string[]} patterns An array of file and directory names. + * @throws {Error} As may be thrown by `fs.unlinkSync`. + * @returns {LintReport} The results for all files that were linted. + */ + executeOnFiles(patterns) { + const { + cacheFilePath, + fileEnumerator, + lastConfigArrays, + lintResultCache, + linter, + options: { + allowInlineConfig, + cache, + cwd, + fix, + reportUnusedDisableDirectives + } + } = internalSlotsMap.get(this); + const results = []; + const startTime = Date.now(); + + // Clear the last used config arrays. + lastConfigArrays.length = 0; + + // Delete cache file; should this do here? + if (!cache) { + try { + fs.unlinkSync(cacheFilePath); + } catch (error) { + const errorCode = error && error.code; + + // Ignore errors when no such file exists or file system is read only (and cache file does not exist) + if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !fs.existsSync(cacheFilePath))) { + throw error; + } + } + } + + // Iterate source code files. + for (const { config, filePath, ignored } of fileEnumerator.iterateFiles(patterns)) { + if (ignored) { + results.push(createIgnoreResult(filePath, cwd)); + continue; + } + + /* + * Store used configs for: + * - this method uses to collect used deprecated rules. + * - `getRules()` method uses to collect all loaded rules. + * - `--fix-type` option uses to get the loaded rule's meta data. + */ + if (!lastConfigArrays.includes(config)) { + lastConfigArrays.push(config); + } + + // Skip if there is cached result. + if (lintResultCache) { + const cachedResult = + lintResultCache.getCachedLintResults(filePath, config); + + if (cachedResult) { + const hadMessages = + cachedResult.messages && + cachedResult.messages.length > 0; + + if (hadMessages && fix) { + debug(`Reprocessing cached file to allow autofix: ${filePath}`); + } else { + debug(`Skipping file since it hasn't changed: ${filePath}`); + results.push(cachedResult); + continue; + } + } + } + + // Do lint. + const result = verifyText({ + text: fs.readFileSync(filePath, "utf8"), + filePath, + config, + cwd, + fix, + allowInlineConfig, + reportUnusedDisableDirectives, + fileEnumerator, + linter + }); + + results.push(result); + + /* + * Store the lint result in the LintResultCache. + * NOTE: The LintResultCache will remove the file source and any + * other properties that are difficult to serialize, and will + * hydrate those properties back in on future lint runs. + */ + if (lintResultCache) { + lintResultCache.setCachedLintResults(filePath, config, result); + } + } + + // Persist the cache to disk. + if (lintResultCache) { + lintResultCache.reconcile(); + } + + debug(`Linting complete in: ${Date.now() - startTime}ms`); + let usedDeprecatedRules; + + return { + results, + ...calculateStatsPerRun(results), + + // Initialize it lazily because CLI and `ESLint` API don't use it. + get usedDeprecatedRules() { + if (!usedDeprecatedRules) { + usedDeprecatedRules = Array.from( + iterateRuleDeprecationWarnings(lastConfigArrays) + ); + } + return usedDeprecatedRules; + } + }; + } + + /** + * Executes the current configuration on text. + * @param {string} text A string of JavaScript code to lint. + * @param {string} [filename] An optional string representing the texts filename. + * @param {boolean} [warnIgnored] Always warn when a file is ignored + * @returns {LintReport} The results for the linting. + */ + executeOnText(text, filename, warnIgnored) { + const { + configArrayFactory, + fileEnumerator, + lastConfigArrays, + linter, + options: { + allowInlineConfig, + cwd, + fix, + reportUnusedDisableDirectives + } + } = internalSlotsMap.get(this); + const results = []; + const startTime = Date.now(); + const resolvedFilename = filename && path.resolve(cwd, filename); + + + // Clear the last used config arrays. + lastConfigArrays.length = 0; + if (resolvedFilename && this.isPathIgnored(resolvedFilename)) { + if (warnIgnored) { + results.push(createIgnoreResult(resolvedFilename, cwd)); + } + } else { + const config = configArrayFactory.getConfigArrayForFile( + resolvedFilename || "__placeholder__.js" + ); + + /* + * Store used configs for: + * - this method uses to collect used deprecated rules. + * - `getRules()` method uses to collect all loaded rules. + * - `--fix-type` option uses to get the loaded rule's meta data. + */ + lastConfigArrays.push(config); + + // Do lint. + results.push(verifyText({ + text, + filePath: resolvedFilename, + config, + cwd, + fix, + allowInlineConfig, + reportUnusedDisableDirectives, + fileEnumerator, + linter + })); + } + + debug(`Linting complete in: ${Date.now() - startTime}ms`); + let usedDeprecatedRules; + + return { + results, + ...calculateStatsPerRun(results), + + // Initialize it lazily because CLI and `ESLint` API don't use it. + get usedDeprecatedRules() { + if (!usedDeprecatedRules) { + usedDeprecatedRules = Array.from( + iterateRuleDeprecationWarnings(lastConfigArrays) + ); + } + return usedDeprecatedRules; + } + }; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file to retrieve a config object for. + * @throws {Error} If filepath a directory path. + * @returns {ConfigData} A configuration object for the file. + */ + getConfigForFile(filePath) { + const { configArrayFactory, options } = internalSlotsMap.get(this); + const absolutePath = path.resolve(options.cwd, filePath); + + if (directoryExists(absolutePath)) { + throw Object.assign( + new Error("'filePath' should not be a directory path."), + { messageTemplate: "print-config-with-directory-path" } + ); + } + + return configArrayFactory + .getConfigArrayForFile(absolutePath) + .extractConfig(absolutePath) + .toCompatibleObjectAsConfigFileContent(); + } + + /** + * Checks if a given path is ignored by ESLint. + * @param {string} filePath The path of the file to check. + * @returns {boolean} Whether or not the given path is ignored. + */ + isPathIgnored(filePath) { + const { + configArrayFactory, + defaultIgnores, + options: { cwd, ignore } + } = internalSlotsMap.get(this); + const absolutePath = path.resolve(cwd, filePath); + + if (ignore) { + const config = configArrayFactory + .getConfigArrayForFile(absolutePath) + .extractConfig(absolutePath); + const ignores = config.ignores || defaultIgnores; + + return ignores(absolutePath); + } + + return defaultIgnores(absolutePath); + } + + /** + * Returns the formatter representing the given format or null if the `format` is not a string. + * @param {string} [format] The name of the format to load or the path to a + * custom formatter. + * @throws {any} As may be thrown by requiring of formatter + * @returns {(FormatterFunction|null)} The formatter function or null if the `format` is not a string. + */ + getFormatter(format) { + + // default is stylish + const resolvedFormatName = format || "stylish"; + + // only strings are valid formatters + if (typeof resolvedFormatName === "string") { + + // replace \ with / for Windows compatibility + const normalizedFormatName = resolvedFormatName.replace(/\\/gu, "/"); + + const slots = internalSlotsMap.get(this); + const cwd = slots ? slots.options.cwd : process.cwd(); + const namespace = naming.getNamespaceFromTerm(normalizedFormatName); + + let formatterPath; + + // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) + if (!namespace && normalizedFormatName.includes("/")) { + formatterPath = path.resolve(cwd, normalizedFormatName); + } else { + try { + const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter"); + + formatterPath = ModuleResolver.resolve(npmFormat, path.join(cwd, "__placeholder__.js")); + } catch { + formatterPath = path.resolve(__dirname, "formatters", normalizedFormatName); + } + } + + try { + return require(formatterPath); + } catch (ex) { + if (removedFormatters.has(format)) { + ex.message = `The ${format} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${format}\``; + } else { + ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; + } + throw ex; + } + + } else { + return null; + } + } +} + +CLIEngine.version = pkg.version; +CLIEngine.getFormatter = CLIEngine.prototype.getFormatter; + +module.exports = { + CLIEngine, + + /** + * Get the internal slots of a given CLIEngine instance for tests. + * @param {CLIEngine} instance The CLIEngine instance to get. + * @returns {CLIEngineInternalSlots} The internal slots. + */ + getCLIEngineInternalSlots(instance) { + return internalSlotsMap.get(instance); + } +}; diff --git a/node_modules/eslint/lib/cli-engine/file-enumerator.js b/node_modules/eslint/lib/cli-engine/file-enumerator.js new file mode 100644 index 0000000..da5d103 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/file-enumerator.js @@ -0,0 +1,547 @@ +/** + * @fileoverview `FileEnumerator` class. + * + * `FileEnumerator` class has two responsibilities: + * + * 1. Find target files by processing glob patterns. + * 2. Tie each target file and appropriate configuration. + * + * It provides a method: + * + * - `iterateFiles(patterns)` + * Iterate files which are matched by given patterns together with the + * corresponded configuration. This is for `CLIEngine#executeOnFiles()`. + * While iterating files, it loads the configuration file of each directory + * before iterate files on the directory, so we can use the configuration + * files to determine target files. + * + * @example + * const enumerator = new FileEnumerator(); + * const linter = new Linter(); + * + * for (const { config, filePath } of enumerator.iterateFiles(["*.js"])) { + * const code = fs.readFileSync(filePath, "utf8"); + * const messages = linter.verify(code, config, filePath); + * + * console.log(messages); + * } + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("node:fs"); +const path = require("node:path"); +const getGlobParent = require("glob-parent"); +const isGlob = require("is-glob"); +const escapeRegExp = require("escape-string-regexp"); +const { Minimatch } = require("minimatch"); + +const { + Legacy: { + IgnorePattern, + CascadingConfigArrayFactory + } +} = require("@eslint/eslintrc"); +const debug = require("debug")("eslint:file-enumerator"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const minimatchOpts = { dot: true, matchBase: true }; +const dotfilesPattern = /(?:(?:^\.)|(?:[/\\]\.))[^/\\.].*/u; +const NONE = 0; +const IGNORED_SILENTLY = 1; +const IGNORED = 2; + +// For VSCode intellisense +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} FileEnumeratorOptions + * @property {CascadingConfigArrayFactory} [configArrayFactory] The factory for config arrays. + * @property {string} [cwd] The base directory to start lookup. + * @property {string[]} [extensions] The extensions to match files for directory patterns. + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} [ignore] The flag to check ignored files. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + */ + +/** + * @typedef {Object} FileAndConfig + * @property {string} filePath The path to a target file. + * @property {ConfigArray} config The config entries of that file. + * @property {boolean} ignored If `true` then this file should be ignored and warned because it was directly specified. + */ + +/** + * @typedef {Object} FileEntry + * @property {string} filePath The path to a target file. + * @property {ConfigArray} config The config entries of that file. + * @property {NONE|IGNORED_SILENTLY|IGNORED} flag The flag. + * - `NONE` means the file is a target file. + * - `IGNORED_SILENTLY` means the file should be ignored silently. + * - `IGNORED` means the file should be ignored and warned because it was directly specified. + */ + +/** + * @typedef {Object} FileEnumeratorInternalSlots + * @property {CascadingConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {RegExp|null} extensionRegExp The RegExp to test if a string ends with specific file extensions. + * @property {boolean} globInputPaths Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} ignoreFlag The flag to check ignored files. + * @property {(filePath:string, dot:boolean) => boolean} defaultIgnores The default predicate function to ignore files. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Check if a string is a glob pattern or not. + * @param {string} pattern A glob pattern. + * @returns {boolean} `true` if the string is a glob pattern. + */ +function isGlobPattern(pattern) { + return isGlob(path.sep === "\\" ? pattern.replace(/\\/gu, "/") : pattern); +} + +/** + * Get stats of a given path. + * @param {string} filePath The path to target file. + * @throws {Error} As may be thrown by `fs.statSync`. + * @returns {fs.Stats|null} The stats. + * @private + */ +function statSafeSync(filePath) { + try { + return fs.statSync(filePath); + } catch (error) { + + /* c8 ignore next */ + if (error.code !== "ENOENT") { + throw error; + } + return null; + } +} + +/** + * Get filenames in a given path to a directory. + * @param {string} directoryPath The path to target directory. + * @throws {Error} As may be thrown by `fs.readdirSync`. + * @returns {import("fs").Dirent[]} The filenames. + * @private + */ +function readdirSafeSync(directoryPath) { + try { + return fs.readdirSync(directoryPath, { withFileTypes: true }); + } catch (error) { + + /* c8 ignore next */ + if (error.code !== "ENOENT") { + throw error; + } + return []; + } +} + +/** + * Create a `RegExp` object to detect extensions. + * @param {string[] | null} extensions The extensions to create. + * @returns {RegExp | null} The created `RegExp` object or null. + */ +function createExtensionRegExp(extensions) { + if (extensions) { + const normalizedExts = extensions.map(ext => escapeRegExp( + ext.startsWith(".") + ? ext.slice(1) + : ext + )); + + return new RegExp( + `.\\.(?:${normalizedExts.join("|")})$`, + "u" + ); + } + return null; +} + +/** + * The error type when no files match a glob. + */ +class NoFilesFoundError extends Error { + + /** + * @param {string} pattern The glob pattern which was not found. + * @param {boolean} globDisabled If `true` then the pattern was a glob pattern, but glob was disabled. + */ + constructor(pattern, globDisabled) { + super(`No files matching '${pattern}' were found${globDisabled ? " (glob was disabled)" : ""}.`); + this.messageTemplate = "file-not-found"; + this.messageData = { pattern, globDisabled }; + } +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class AllFilesIgnoredError extends Error { + + /** + * @param {string} pattern The glob pattern which was not found. + */ + constructor(pattern) { + super(`All files matched by '${pattern}' are ignored.`); + this.messageTemplate = "all-files-ignored"; + this.messageData = { pattern }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class FileEnumerator { + + /** + * Initialize this enumerator. + * @param {FileEnumeratorOptions} options The options. + */ + constructor({ + cwd = process.cwd(), + configArrayFactory = new CascadingConfigArrayFactory({ + cwd, + getEslintRecommendedConfig: () => require("@eslint/js").configs.recommended, + getEslintAllConfig: () => require("@eslint/js").configs.all + }), + extensions = null, + globInputPaths = true, + errorOnUnmatchedPattern = true, + ignore = true + } = {}) { + internalSlotsMap.set(this, { + configArrayFactory, + cwd, + defaultIgnores: IgnorePattern.createDefaultIgnore(cwd), + extensionRegExp: createExtensionRegExp(extensions), + globInputPaths, + errorOnUnmatchedPattern, + ignoreFlag: ignore + }); + } + + /** + * Check if a given file is target or not. + * @param {string} filePath The path to a candidate file. + * @param {ConfigArray} [providedConfig] Optional. The configuration for the file. + * @returns {boolean} `true` if the file is a target. + */ + isTargetPath(filePath, providedConfig) { + const { + configArrayFactory, + extensionRegExp + } = internalSlotsMap.get(this); + + // If `--ext` option is present, use it. + if (extensionRegExp) { + return extensionRegExp.test(filePath); + } + + // `.js` file is target by default. + if (filePath.endsWith(".js")) { + return true; + } + + // use `overrides[].files` to check additional targets. + const config = + providedConfig || + configArrayFactory.getConfigArrayForFile( + filePath, + { ignoreNotFoundError: true } + ); + + return config.isAdditionalTargetPath(filePath); + } + + /** + * Iterate files which are matched by given glob patterns. + * @param {string|string[]} patternOrPatterns The glob patterns to iterate files. + * @throws {NoFilesFoundError|AllFilesIgnoredError} On an unmatched pattern. + * @returns {IterableIterator} The found files. + */ + *iterateFiles(patternOrPatterns) { + const { globInputPaths, errorOnUnmatchedPattern } = internalSlotsMap.get(this); + const patterns = Array.isArray(patternOrPatterns) + ? patternOrPatterns + : [patternOrPatterns]; + + debug("Start to iterate files: %o", patterns); + + // The set of paths to remove duplicate. + const set = new Set(); + + for (const pattern of patterns) { + let foundRegardlessOfIgnored = false; + let found = false; + + // Skip empty string. + if (!pattern) { + continue; + } + + // Iterate files of this pattern. + for (const { config, filePath, flag } of this._iterateFiles(pattern)) { + foundRegardlessOfIgnored = true; + if (flag === IGNORED_SILENTLY) { + continue; + } + found = true; + + // Remove duplicate paths while yielding paths. + if (!set.has(filePath)) { + set.add(filePath); + yield { + config, + filePath, + ignored: flag === IGNORED + }; + } + } + + // Raise an error if any files were not found. + if (errorOnUnmatchedPattern) { + if (!foundRegardlessOfIgnored) { + throw new NoFilesFoundError( + pattern, + !globInputPaths && isGlob(pattern) + ); + } + if (!found) { + throw new AllFilesIgnoredError(pattern); + } + } + } + + debug(`Complete iterating files: ${JSON.stringify(patterns)}`); + } + + /** + * Iterate files which are matched by a given glob pattern. + * @param {string} pattern The glob pattern to iterate files. + * @returns {IterableIterator} The found files. + */ + _iterateFiles(pattern) { + const { cwd, globInputPaths } = internalSlotsMap.get(this); + const absolutePath = path.resolve(cwd, pattern); + const isDot = dotfilesPattern.test(pattern); + const stat = statSafeSync(absolutePath); + + if (stat && stat.isDirectory()) { + return this._iterateFilesWithDirectory(absolutePath, isDot); + } + if (stat && stat.isFile()) { + return this._iterateFilesWithFile(absolutePath); + } + if (globInputPaths && isGlobPattern(pattern)) { + return this._iterateFilesWithGlob(pattern, isDot); + } + + return []; + } + + /** + * Iterate a file which is matched by a given path. + * @param {string} filePath The path to the target file. + * @returns {IterableIterator} The found files. + * @private + */ + _iterateFilesWithFile(filePath) { + debug(`File: ${filePath}`); + + const { configArrayFactory } = internalSlotsMap.get(this); + const config = configArrayFactory.getConfigArrayForFile(filePath); + const ignored = this._isIgnoredFile(filePath, { config, direct: true }); + const flag = ignored ? IGNORED : NONE; + + return [{ config, filePath, flag }]; + } + + /** + * Iterate files in a given path. + * @param {string} directoryPath The path to the target directory. + * @param {boolean} dotfiles If `true` then it doesn't skip dot files by default. + * @returns {IterableIterator} The found files. + * @private + */ + _iterateFilesWithDirectory(directoryPath, dotfiles) { + debug(`Directory: ${directoryPath}`); + + return this._iterateFilesRecursive( + directoryPath, + { dotfiles, recursive: true, selector: null } + ); + } + + /** + * Iterate files which are matched by a given glob pattern. + * @param {string} pattern The glob pattern to iterate files. + * @param {boolean} dotfiles If `true` then it doesn't skip dot files by default. + * @returns {IterableIterator} The found files. + * @private + */ + _iterateFilesWithGlob(pattern, dotfiles) { + debug(`Glob: ${pattern}`); + + const { cwd } = internalSlotsMap.get(this); + const directoryPath = path.resolve(cwd, getGlobParent(pattern)); + const absolutePath = path.resolve(cwd, pattern); + const globPart = absolutePath.slice(directoryPath.length + 1); + + /* + * recursive if there are `**` or path separators in the glob part. + * Otherwise, patterns such as `src/*.js`, it doesn't need recursive. + */ + const recursive = /\*\*|\/|\\/u.test(globPart); + const selector = new Minimatch(absolutePath, minimatchOpts); + + debug(`recursive? ${recursive}`); + + return this._iterateFilesRecursive( + directoryPath, + { dotfiles, recursive, selector } + ); + } + + /** + * Iterate files in a given path. + * @param {string} directoryPath The path to the target directory. + * @param {Object} options The options to iterate files. + * @param {boolean} [options.dotfiles] If `true` then it doesn't skip dot files by default. + * @param {boolean} [options.recursive] If `true` then it dives into sub directories. + * @param {InstanceType} [options.selector] The matcher to choose files. + * @returns {IterableIterator} The found files. + * @private + */ + *_iterateFilesRecursive(directoryPath, options) { + debug(`Enter the directory: ${directoryPath}`); + const { configArrayFactory } = internalSlotsMap.get(this); + + /** @type {ConfigArray|null} */ + let config = null; + + // Enumerate the files of this directory. + for (const entry of readdirSafeSync(directoryPath)) { + const filePath = path.join(directoryPath, entry.name); + const fileInfo = entry.isSymbolicLink() ? statSafeSync(filePath) : entry; + + if (!fileInfo) { + continue; + } + + // Check if the file is matched. + if (fileInfo.isFile()) { + if (!config) { + config = configArrayFactory.getConfigArrayForFile( + filePath, + + /* + * We must ignore `ConfigurationNotFoundError` at this + * point because we don't know if target files exist in + * this directory. + */ + { ignoreNotFoundError: true } + ); + } + const matched = options.selector + + // Started with a glob pattern; choose by the pattern. + ? options.selector.match(filePath) + + // Started with a directory path; choose by file extensions. + : this.isTargetPath(filePath, config); + + if (matched) { + const ignored = this._isIgnoredFile(filePath, { ...options, config }); + const flag = ignored ? IGNORED_SILENTLY : NONE; + + debug(`Yield: ${entry.name}${ignored ? " but ignored" : ""}`); + yield { + config: configArrayFactory.getConfigArrayForFile(filePath), + filePath, + flag + }; + } else { + debug(`Didn't match: ${entry.name}`); + } + + // Dive into the sub directory. + } else if (options.recursive && fileInfo.isDirectory()) { + if (!config) { + config = configArrayFactory.getConfigArrayForFile( + filePath, + { ignoreNotFoundError: true } + ); + } + const ignored = this._isIgnoredFile( + filePath + path.sep, + { ...options, config } + ); + + if (!ignored) { + yield* this._iterateFilesRecursive(filePath, options); + } + } + } + + debug(`Leave the directory: ${directoryPath}`); + } + + /** + * Check if a given file should be ignored. + * @param {string} filePath The path to a file to check. + * @param {Object} options Options + * @param {ConfigArray} [options.config] The config for this file. + * @param {boolean} [options.dotfiles] If `true` then this is not ignore dot files by default. + * @param {boolean} [options.direct] If `true` then this is a direct specified file. + * @returns {boolean} `true` if the file should be ignored. + * @private + */ + _isIgnoredFile(filePath, { + config: providedConfig, + dotfiles = false, + direct = false + }) { + const { + configArrayFactory, + defaultIgnores, + ignoreFlag + } = internalSlotsMap.get(this); + + if (ignoreFlag) { + const config = + providedConfig || + configArrayFactory.getConfigArrayForFile( + filePath, + { ignoreNotFoundError: true } + ); + const ignores = + config.extractConfig(filePath).ignores || defaultIgnores; + + return ignores(filePath, dotfiles); + } + + return !direct && defaultIgnores(filePath, dotfiles); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { FileEnumerator }; diff --git a/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json b/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json new file mode 100644 index 0000000..4cc61ae --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json @@ -0,0 +1,18 @@ +[ + { + "name": "html", + "description": "Outputs results to HTML. The `html` formatter is useful for visual presentation in the browser." + }, + { + "name": "json-with-metadata", + "description": "Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint." + }, + { + "name": "json", + "description": "Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint." + }, + { + "name": "stylish", + "description": "Human-readable output format. This is the default formatter." + } +] diff --git a/node_modules/eslint/lib/cli-engine/formatters/html.js b/node_modules/eslint/lib/cli-engine/formatters/html.js new file mode 100644 index 0000000..1aa66fc --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/html.js @@ -0,0 +1,351 @@ +/** + * @fileoverview HTML reporter + * @author Julian Laval + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const encodeHTML = (function() { + const encodeHTMLRules = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" + }; + const matchHTML = /[&<>"']/ug; + + return function(code) { + return code + ? code.toString().replace(matchHTML, m => encodeHTMLRules[m] || m) + : ""; + }; +}()); + +/** + * Get the final HTML document. + * @param {Object} it data for the document. + * @returns {string} HTML document. + */ +function pageTemplate(it) { + const { reportColor, reportSummary, date, results } = it; + + return ` + + + + + ESLint Report + + + + + +
+

ESLint Report

+
+ ${reportSummary} - Generated on ${date} +
+
+ + + ${results} + +
+ + + +`.trimStart(); +} + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +/** + * Renders text along the template of x problems (x errors, x warnings) + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {string} The formatted string, pluralized where necessary + */ +function renderSummary(totalErrors, totalWarnings) { + const totalProblems = totalErrors + totalWarnings; + let renderedText = `${totalProblems} ${pluralize("problem", totalProblems)}`; + + if (totalProblems !== 0) { + renderedText += ` (${totalErrors} ${pluralize("error", totalErrors)}, ${totalWarnings} ${pluralize("warning", totalWarnings)})`; + } + return renderedText; +} + +/** + * Get the color based on whether there are errors/warnings... + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {int} The color code (0 = green, 1 = yellow, 2 = red) + */ +function renderColor(totalErrors, totalWarnings) { + if (totalErrors !== 0) { + return 2; + } + if (totalWarnings !== 0) { + return 1; + } + return 0; +} + +/** + * Get HTML (table row) describing a single message. + * @param {Object} it data for the message. + * @returns {string} HTML (table row) describing the message. + */ +function messageTemplate(it) { + const { + parentIndex, + lineNumber, + columnNumber, + severityNumber, + severityName, + message, + ruleUrl, + ruleId + } = it; + + return ` + + ${lineNumber}:${columnNumber} + ${severityName} + ${encodeHTML(message)} + + ${ruleId ? ruleId : ""} + + +`.trimStart(); +} + +/** + * Get HTML (table rows) describing the messages. + * @param {Array} messages Messages. + * @param {int} parentIndex Index of the parent HTML row. + * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. + * @returns {string} HTML (table rows) describing the messages. + */ +function renderMessages(messages, parentIndex, rulesMeta) { + + /** + * Get HTML (table row) describing a message. + * @param {Object} message Message. + * @returns {string} HTML (table row) describing a message. + */ + return messages.map(message => { + const lineNumber = message.line || 0; + const columnNumber = message.column || 0; + let ruleUrl; + + if (rulesMeta) { + const meta = rulesMeta[message.ruleId]; + + if (meta && meta.docs && meta.docs.url) { + ruleUrl = meta.docs.url; + } + } + + return messageTemplate({ + parentIndex, + lineNumber, + columnNumber, + severityNumber: message.severity, + severityName: message.severity === 1 ? "Warning" : "Error", + message: message.message, + ruleId: message.ruleId, + ruleUrl + }); + }).join("\n"); +} + +/** + * Get HTML (table row) describing the result for a single file. + * @param {Object} it data for the file. + * @returns {string} HTML (table row) describing the result for the file. + */ +function resultTemplate(it) { + const { color, index, filePath, summary } = it; + + return ` + + + [+] ${encodeHTML(filePath)} + ${encodeHTML(summary)} + + +`.trimStart(); +} + +/** + * Render the results. + * @param {Array} results Test results. + * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. + * @returns {string} HTML string describing the results. + */ +function renderResults(results, rulesMeta) { + return results.map((result, index) => resultTemplate({ + index, + color: renderColor(result.errorCount, result.warningCount), + filePath: result.filePath, + summary: renderSummary(result.errorCount, result.warningCount) + }) + renderMessages(result.messages, index, rulesMeta)).join("\n"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results, data) { + let totalErrors, + totalWarnings; + + const metaData = data ? data.rulesMeta : {}; + + totalErrors = 0; + totalWarnings = 0; + + // Iterate over results to get totals + results.forEach(result => { + totalErrors += result.errorCount; + totalWarnings += result.warningCount; + }); + + return pageTemplate({ + date: new Date(), + reportColor: renderColor(totalErrors, totalWarnings), + reportSummary: renderSummary(totalErrors, totalWarnings), + results: renderResults(results, metaData) + }); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js b/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js new file mode 100644 index 0000000..6899471 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js @@ -0,0 +1,16 @@ +/** + * @fileoverview JSON reporter, including rules metadata + * @author Chris Meyer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results, data) { + return JSON.stringify({ + results, + metadata: data + }); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/json.js b/node_modules/eslint/lib/cli-engine/formatters/json.js new file mode 100644 index 0000000..82138af --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/json.js @@ -0,0 +1,13 @@ +/** + * @fileoverview JSON reporter + * @author Burak Yigit Kaya aka BYK + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + return JSON.stringify(results); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/stylish.js b/node_modules/eslint/lib/cli-engine/formatters/stylish.js new file mode 100644 index 0000000..a5cf39b --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/stylish.js @@ -0,0 +1,101 @@ +/** + * @fileoverview Stylish reporter + * @author Sindre Sorhus + */ +"use strict"; + +const chalk = require("chalk"), + util = require("node:util"), + table = require("../../shared/text-table"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "\n", + errorCount = 0, + warningCount = 0, + fixableErrorCount = 0, + fixableWarningCount = 0, + summaryColor = "yellow"; + + results.forEach(result => { + const messages = result.messages; + + if (messages.length === 0) { + return; + } + + errorCount += result.errorCount; + warningCount += result.warningCount; + fixableErrorCount += result.fixableErrorCount; + fixableWarningCount += result.fixableWarningCount; + + output += `${chalk.underline(result.filePath)}\n`; + + output += `${table( + messages.map(message => { + let messageType; + + if (message.fatal || message.severity === 2) { + messageType = chalk.red("error"); + summaryColor = "red"; + } else { + messageType = chalk.yellow("warning"); + } + + return [ + "", + String(message.line || 0), + String(message.column || 0), + messageType, + message.message.replace(/([^ ])\.$/u, "$1"), + chalk.dim(message.ruleId || "") + ]; + }), + { + align: ["", "r", "l"], + stringLength(str) { + return util.stripVTControlCharacters(str).length; + } + } + ).split("\n").map(el => el.replace(/(\d+)\s+(\d+)/u, (m, p1, p2) => chalk.dim(`${p1}:${p2}`))).join("\n")}\n\n`; + }); + + const total = errorCount + warningCount; + + if (total > 0) { + output += chalk[summaryColor].bold([ + "\u2716 ", total, pluralize(" problem", total), + " (", errorCount, pluralize(" error", errorCount), ", ", + warningCount, pluralize(" warning", warningCount), ")\n" + ].join("")); + + if (fixableErrorCount > 0 || fixableWarningCount > 0) { + output += chalk[summaryColor].bold([ + " ", fixableErrorCount, pluralize(" error", fixableErrorCount), " and ", + fixableWarningCount, pluralize(" warning", fixableWarningCount), + " potentially fixable with the `--fix` option.\n" + ].join("")); + } + } + + // Resets output color, for prevent change on top level + return total > 0 ? chalk.reset(output) : ""; +}; diff --git a/node_modules/eslint/lib/cli-engine/hash.js b/node_modules/eslint/lib/cli-engine/hash.js new file mode 100644 index 0000000..8e46773 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/hash.js @@ -0,0 +1,35 @@ +/** + * @fileoverview Defining the hashing function in one place. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const murmur = require("imurmurhash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * hash the given string + * @param {string} str the string to hash + * @returns {string} the hash + */ +function hash(str) { + return murmur(str).result().toString(36); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = hash; diff --git a/node_modules/eslint/lib/cli-engine/index.js b/node_modules/eslint/lib/cli-engine/index.js new file mode 100644 index 0000000..52e45a6 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const { CLIEngine } = require("./cli-engine"); + +module.exports = { + CLIEngine +}; diff --git a/node_modules/eslint/lib/cli-engine/lint-result-cache.js b/node_modules/eslint/lib/cli-engine/lint-result-cache.js new file mode 100644 index 0000000..320362d --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/lint-result-cache.js @@ -0,0 +1,203 @@ +/** + * @fileoverview Utility for caching lint results. + * @author Kevin Partington + */ +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const fs = require("node:fs"); +const fileEntryCache = require("file-entry-cache"); +const stringify = require("json-stable-stringify-without-jsonify"); +const pkg = require("../../package.json"); +const assert = require("../shared/assert"); +const hash = require("./hash"); + +const debug = require("debug")("eslint:lint-result-cache"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const configHashCache = new WeakMap(); +const nodeVersion = process && process.version; + +const validCacheStrategies = ["metadata", "content"]; +const invalidCacheStrategyErrorMessage = `Cache strategy must be one of: ${validCacheStrategies + .map(strategy => `"${strategy}"`) + .join(", ")}`; + +/** + * Tests whether a provided cacheStrategy is valid + * @param {string} cacheStrategy The cache strategy to use + * @returns {boolean} true if `cacheStrategy` is one of `validCacheStrategies`; false otherwise + */ +function isValidCacheStrategy(cacheStrategy) { + return ( + validCacheStrategies.includes(cacheStrategy) + ); +} + +/** + * Calculates the hash of the config + * @param {ConfigArray} config The config. + * @returns {string} The hash of the config + */ +function hashOfConfigFor(config) { + if (!configHashCache.has(config)) { + configHashCache.set(config, hash(`${pkg.version}_${nodeVersion}_${stringify(config)}`)); + } + + return configHashCache.get(config); +} + +//----------------------------------------------------------------------------- +// Public Interface +//----------------------------------------------------------------------------- + +/** + * Lint result cache. This wraps around the file-entry-cache module, + * transparently removing properties that are difficult or expensive to + * serialize and adding them back in on retrieval. + */ +class LintResultCache { + + /** + * Creates a new LintResultCache instance. + * @param {string} cacheFileLocation The cache file location. + * @param {"metadata" | "content"} cacheStrategy The cache strategy to use. + */ + constructor(cacheFileLocation, cacheStrategy) { + assert(cacheFileLocation, "Cache file location is required"); + assert(cacheStrategy, "Cache strategy is required"); + assert( + isValidCacheStrategy(cacheStrategy), + invalidCacheStrategyErrorMessage + ); + + debug(`Caching results to ${cacheFileLocation}`); + + const useChecksum = cacheStrategy === "content"; + + debug( + `Using "${cacheStrategy}" strategy to detect changes` + ); + + this.fileEntryCache = fileEntryCache.create( + cacheFileLocation, + void 0, + useChecksum + ); + this.cacheFileLocation = cacheFileLocation; + } + + /** + * Retrieve cached lint results for a given file path, if present in the + * cache. If the file is present and has not been changed, rebuild any + * missing result information. + * @param {string} filePath The file for which to retrieve lint results. + * @param {ConfigArray} config The config of the file. + * @returns {Object|null} The rebuilt lint results, or null if the file is + * changed or not in the filesystem. + */ + getCachedLintResults(filePath, config) { + + /* + * Cached lint results are valid if and only if: + * 1. The file is present in the filesystem + * 2. The file has not changed since the time it was previously linted + * 3. The ESLint configuration has not changed since the time the file + * was previously linted + * If any of these are not true, we will not reuse the lint results. + */ + const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); + const hashOfConfig = hashOfConfigFor(config); + const changed = + fileDescriptor.changed || + fileDescriptor.meta.hashOfConfig !== hashOfConfig; + + if (fileDescriptor.notFound) { + debug(`File not found on the file system: ${filePath}`); + return null; + } + + if (changed) { + debug(`Cache entry not found or no longer valid: ${filePath}`); + return null; + } + + const cachedResults = fileDescriptor.meta.results; + + // Just in case, not sure if this can ever happen. + if (!cachedResults) { + return cachedResults; + } + + /* + * Shallow clone the object to ensure that any properties added or modified afterwards + * will not be accidentally stored in the cache file when `reconcile()` is called. + * https://github.com/eslint/eslint/issues/13507 + * All intentional changes to the cache file must be done through `setCachedLintResults()`. + */ + const results = { ...cachedResults }; + + // If source is present but null, need to reread the file from the filesystem. + if (results.source === null) { + debug(`Rereading cached result source from filesystem: ${filePath}`); + results.source = fs.readFileSync(filePath, "utf-8"); + } + + return results; + } + + /** + * Set the cached lint results for a given file path, after removing any + * information that will be both unnecessary and difficult to serialize. + * Avoids caching results with an "output" property (meaning fixes were + * applied), to prevent potentially incorrect results if fixes are not + * written to disk. + * @param {string} filePath The file for which to set lint results. + * @param {ConfigArray} config The config of the file. + * @param {Object} result The lint result to be set for the file. + * @returns {void} + */ + setCachedLintResults(filePath, config, result) { + if (result && Object.hasOwn(result, "output")) { + return; + } + + const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); + + if (fileDescriptor && !fileDescriptor.notFound) { + debug(`Updating cached result: ${filePath}`); + + // Serialize the result, except that we want to remove the file source if present. + const resultToSerialize = Object.assign({}, result); + + /* + * Set result.source to null. + * In `getCachedLintResults`, if source is explicitly null, we will + * read the file from the filesystem to set the value again. + */ + if (Object.hasOwn(resultToSerialize, "source")) { + resultToSerialize.source = null; + } + + fileDescriptor.meta.results = resultToSerialize; + fileDescriptor.meta.hashOfConfig = hashOfConfigFor(config); + } + } + + /** + * Persists the in-memory cache to disk. + * @returns {void} + */ + reconcile() { + debug(`Persisting cached results: ${this.cacheFileLocation}`); + this.fileEntryCache.reconcile(); + } +} + +module.exports = LintResultCache; diff --git a/node_modules/eslint/lib/cli-engine/load-rules.js b/node_modules/eslint/lib/cli-engine/load-rules.js new file mode 100644 index 0000000..a58f954 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/load-rules.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Module for loading rules from files and directories. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("node:fs"), + path = require("node:path"); + +const rulesDirCache = {}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Load all rule modules from specified directory. + * @param {string} relativeRulesDir Path to rules directory, may be relative. + * @param {string} cwd Current working directory + * @returns {Object} Loaded rule modules. + */ +module.exports = function(relativeRulesDir, cwd) { + const rulesDir = path.resolve(cwd, relativeRulesDir); + + // cache will help performance as IO operation are expensive + if (rulesDirCache[rulesDir]) { + return rulesDirCache[rulesDir]; + } + + const rules = Object.create(null); + + fs.readdirSync(rulesDir).forEach(file => { + if (path.extname(file) !== ".js") { + return; + } + rules[file.slice(0, -3)] = require(path.join(rulesDir, file)); + }); + rulesDirCache[rulesDir] = rules; + + return rules; +}; diff --git a/node_modules/eslint/lib/cli.js b/node_modules/eslint/lib/cli.js new file mode 100644 index 0000000..1238efd --- /dev/null +++ b/node_modules/eslint/lib/cli.js @@ -0,0 +1,578 @@ +/** + * @fileoverview Main CLI object. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * NOTE: The CLI object should *not* call process.exit() directly. It should only return + * exit codes. This allows other programs to use the CLI object and still control + * when the program exits. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("node:fs"), + path = require("node:path"), + { promisify } = require("node:util"), + { LegacyESLint } = require("./eslint"), + { ESLint, shouldUseFlatConfig, locateConfigFileToUse } = require("./eslint/eslint"), + createCLIOptions = require("./options"), + log = require("./shared/logging"), + RuntimeInfo = require("./shared/runtime-info"), + { normalizeSeverityToString } = require("./shared/severity"); +const { Legacy: { naming } } = require("@eslint/eslintrc"); +const { ModuleImporter } = require("@humanwhocodes/module-importer"); +const debug = require("debug")("eslint:cli"); + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("./eslint/eslint").ESLintOptions} ESLintOptions */ +/** @typedef {import("./eslint/eslint").LintMessage} LintMessage */ +/** @typedef {import("./eslint/eslint").LintResult} LintResult */ +/** @typedef {import("./options").ParsedCLIOptions} ParsedCLIOptions */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").ResultsMeta} ResultsMeta */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const mkdir = promisify(fs.mkdir); +const stat = promisify(fs.stat); +const writeFile = promisify(fs.writeFile); + +/** + * Loads plugins with the specified names. + * @param {{ "import": (name: string) => Promise }} importer An object with an `import` method called once for each plugin. + * @param {string[]} pluginNames The names of the plugins to be loaded, with or without the "eslint-plugin-" prefix. + * @returns {Promise>} A mapping of plugin short names to implementations. + */ +async function loadPlugins(importer, pluginNames) { + const plugins = {}; + + await Promise.all(pluginNames.map(async pluginName => { + + const longName = naming.normalizePackageName(pluginName, "eslint-plugin"); + const module = await importer.import(longName); + + if (!("default" in module)) { + throw new Error(`"${longName}" cannot be used with the \`--plugin\` option because its default module does not provide a \`default\` export`); + } + + const shortName = naming.getShorthandName(pluginName, "eslint-plugin"); + + plugins[shortName] = module.default; + })); + + return plugins; +} + +/** + * Predicate function for whether or not to apply fixes in quiet mode. + * If a message is a warning, do not apply a fix. + * @param {LintMessage} message The lint result. + * @returns {boolean} True if the lint message is an error (and thus should be + * autofixed), false otherwise. + */ +function quietFixPredicate(message) { + return message.severity === 2; +} + +/** + * Predicate function for whether or not to run a rule in quiet mode. + * If a rule is set to warning, do not run it. + * @param {{ ruleId: string; severity: number; }} rule The rule id and severity. + * @returns {boolean} True if the lint rule should run, false otherwise. + */ +function quietRuleFilter(rule) { + return rule.severity === 2; +} + +/** + * Translates the CLI options into the options expected by the ESLint constructor. + * @param {ParsedCLIOptions} cliOptions The CLI options to translate. + * @param {"flat"|"eslintrc"} [configType="eslintrc"] The format of the + * config to generate. + * @returns {Promise} The options object for the ESLint constructor. + * @private + */ +async function translateOptions({ + cache, + cacheFile, + cacheLocation, + cacheStrategy, + config, + configLookup, + env, + errorOnUnmatchedPattern, + eslintrc, + ext, + fix, + fixDryRun, + fixType, + flag, + global, + ignore, + ignorePath, + ignorePattern, + inlineConfig, + parser, + parserOptions, + plugin, + quiet, + reportUnusedDisableDirectives, + reportUnusedDisableDirectivesSeverity, + reportUnusedInlineConfigs, + resolvePluginsRelativeTo, + rule, + rulesdir, + stats, + warnIgnored, + passOnNoPatterns, + maxWarnings +}, configType) { + + let overrideConfig, overrideConfigFile; + const importer = new ModuleImporter(); + + if (configType === "flat") { + overrideConfigFile = (typeof config === "string") ? config : !configLookup; + if (overrideConfigFile === false) { + overrideConfigFile = void 0; + } + + const languageOptions = {}; + + if (global) { + languageOptions.globals = global.reduce((obj, name) => { + if (name.endsWith(":true")) { + obj[name.slice(0, -5)] = "writable"; + } else { + obj[name] = "readonly"; + } + return obj; + }, {}); + } + + if (parserOptions) { + languageOptions.parserOptions = parserOptions; + } + + if (parser) { + languageOptions.parser = await importer.import(parser); + } + + overrideConfig = [{ + ...Object.keys(languageOptions).length > 0 ? { languageOptions } : {}, + rules: rule ? rule : {} + }]; + + if (reportUnusedDisableDirectives || reportUnusedDisableDirectivesSeverity !== void 0) { + overrideConfig[0].linterOptions = { + reportUnusedDisableDirectives: reportUnusedDisableDirectives + ? "error" + : normalizeSeverityToString(reportUnusedDisableDirectivesSeverity) + }; + } + + if (reportUnusedInlineConfigs !== void 0) { + overrideConfig[0].linterOptions = { + ...overrideConfig[0].linterOptions, + reportUnusedInlineConfigs: normalizeSeverityToString(reportUnusedInlineConfigs) + }; + } + + if (plugin) { + overrideConfig[0].plugins = await loadPlugins(importer, plugin); + } + + if (ext) { + overrideConfig.push({ + files: ext.map(extension => `**/*${extension.startsWith(".") ? "" : "."}${extension}`) + }); + } + + } else { + overrideConfigFile = config; + + overrideConfig = { + env: env && env.reduce((obj, name) => { + obj[name] = true; + return obj; + }, {}), + globals: global && global.reduce((obj, name) => { + if (name.endsWith(":true")) { + obj[name.slice(0, -5)] = "writable"; + } else { + obj[name] = "readonly"; + } + return obj; + }, {}), + ignorePatterns: ignorePattern, + parser, + parserOptions, + plugins: plugin, + rules: rule + }; + } + + const options = { + allowInlineConfig: inlineConfig, + cache, + cacheLocation: cacheLocation || cacheFile, + cacheStrategy, + errorOnUnmatchedPattern, + fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true), + fixTypes: fixType, + ignore, + overrideConfig, + overrideConfigFile, + passOnNoPatterns + }; + + if (configType === "flat") { + options.ignorePatterns = ignorePattern; + options.stats = stats; + options.warnIgnored = warnIgnored; + options.flags = flag; + + /* + * For performance reasons rules not marked as 'error' are filtered out in quiet mode. As maxWarnings + * requires rules set to 'warn' to be run, we only filter out 'warn' rules if maxWarnings is not specified. + */ + options.ruleFilter = quiet && maxWarnings === -1 ? quietRuleFilter : () => true; + } else { + options.resolvePluginsRelativeTo = resolvePluginsRelativeTo; + options.rulePaths = rulesdir; + options.useEslintrc = eslintrc; + options.extensions = ext; + options.ignorePath = ignorePath; + if (reportUnusedDisableDirectives || reportUnusedDisableDirectivesSeverity !== void 0) { + options.reportUnusedDisableDirectives = reportUnusedDisableDirectives + ? "error" + : normalizeSeverityToString(reportUnusedDisableDirectivesSeverity); + } + } + + return options; +} + +/** + * Count error messages. + * @param {LintResult[]} results The lint results. + * @returns {{errorCount:number;fatalErrorCount:number,warningCount:number}} The number of error messages. + */ +function countErrors(results) { + let errorCount = 0; + let fatalErrorCount = 0; + let warningCount = 0; + + for (const result of results) { + errorCount += result.errorCount; + fatalErrorCount += result.fatalErrorCount; + warningCount += result.warningCount; + } + + return { errorCount, fatalErrorCount, warningCount }; +} + +/** + * Check if a given file path is a directory or not. + * @param {string} filePath The path to a file to check. + * @returns {Promise} `true` if the given path is a directory. + */ +async function isDirectory(filePath) { + try { + return (await stat(filePath)).isDirectory(); + } catch (error) { + if (error.code === "ENOENT" || error.code === "ENOTDIR") { + return false; + } + throw error; + } +} + +/** + * Outputs the results of the linting. + * @param {ESLint} engine The ESLint instance to use. + * @param {LintResult[]} results The results to print. + * @param {string} format The name of the formatter to use or the path to the formatter. + * @param {string} outputFile The path for the output file. + * @param {ResultsMeta} resultsMeta Warning count and max threshold. + * @returns {Promise} True if the printing succeeds, false if not. + * @private + */ +async function printResults(engine, results, format, outputFile, resultsMeta) { + let formatter; + + try { + formatter = await engine.loadFormatter(format); + } catch (e) { + log.error(e.message); + return false; + } + + const output = await formatter.format(results, resultsMeta); + + if (outputFile) { + const filePath = path.resolve(process.cwd(), outputFile); + + if (await isDirectory(filePath)) { + log.error("Cannot write to output file path, it is a directory: %s", outputFile); + return false; + } + + try { + await mkdir(path.dirname(filePath), { recursive: true }); + await writeFile(filePath, output); + } catch (ex) { + log.error("There was a problem writing the output file:\n%s", ex); + return false; + } + } else if (output) { + log.info(output); + } + + return true; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Encapsulates all CLI behavior for eslint. Makes it easier to test as well as + * for other Node.js programs to effectively run the CLI. + */ +const cli = { + + /** + * Calculates the command string for the --inspect-config operation. + * @param {string} configFile The path to the config file to inspect. + * @returns {Promise} The command string to execute. + */ + async calculateInspectConfigFlags(configFile) { + + // find the config file + const { + configFilePath, + basePath + } = await locateConfigFileToUse({ cwd: process.cwd(), configFile }); + + return ["--config", configFilePath, "--basePath", basePath]; + }, + + /** + * Executes the CLI based on an array of arguments that is passed in. + * @param {string|Array|Object} args The arguments to process. + * @param {string} [text] The text to lint (used for TTY). + * @param {boolean} [allowFlatConfig=true] Whether or not to allow flat config. + * @returns {Promise} The exit code for the operation. + */ + async execute(args, text, allowFlatConfig = true) { + if (Array.isArray(args)) { + debug("CLI args: %o", args.slice(2)); + } + + /* + * Before doing anything, we need to see if we are using a + * flat config file. If so, then we need to change the way command + * line args are parsed. This is temporary, and when we fully + * switch to flat config we can remove this logic. + */ + + const usingFlatConfig = allowFlatConfig && await shouldUseFlatConfig(); + + debug("Using flat config?", usingFlatConfig); + + if (allowFlatConfig && !usingFlatConfig) { + process.emitWarning("You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.", "ESLintRCWarning"); + } + + const CLIOptions = createCLIOptions(usingFlatConfig); + + /** @type {ParsedCLIOptions} */ + let options; + + try { + options = CLIOptions.parse(args); + } catch (error) { + debug("Error parsing CLI options:", error.message); + + let errorMessage = error.message; + + if (usingFlatConfig) { + errorMessage += "\nYou're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details."; + } + + log.error(errorMessage); + return 2; + } + + const files = options._; + const useStdin = typeof text === "string"; + + if (options.help) { + log.info(CLIOptions.generateHelp()); + return 0; + } + if (options.version) { + log.info(RuntimeInfo.version()); + return 0; + } + if (options.envInfo) { + try { + log.info(RuntimeInfo.environment()); + return 0; + } catch (err) { + debug("Error retrieving environment info"); + log.error(err.message); + return 2; + } + } + + if (options.printConfig) { + if (files.length) { + log.error("The --print-config option must be used with exactly one file name."); + return 2; + } + if (useStdin) { + log.error("The --print-config option is not available for piped-in code."); + return 2; + } + + const engine = usingFlatConfig + ? new ESLint(await translateOptions(options, "flat")) + : new LegacyESLint(await translateOptions(options)); + const fileConfig = + await engine.calculateConfigForFile(options.printConfig); + + log.info(JSON.stringify(fileConfig, null, " ")); + return 0; + } + + if (options.inspectConfig) { + + log.info("You can also run this command directly using 'npx @eslint/config-inspector@latest' in the same directory as your configuration file."); + + try { + const flatOptions = await translateOptions(options, "flat"); + const spawn = require("cross-spawn"); + const flags = await cli.calculateInspectConfigFlags(flatOptions.overrideConfigFile); + + spawn.sync("npx", ["@eslint/config-inspector@latest", ...flags], { encoding: "utf8", stdio: "inherit" }); + } catch (error) { + log.error(error); + return 2; + } + + return 0; + } + + debug(`Running on ${useStdin ? "text" : "files"}`); + + if (options.fix && options.fixDryRun) { + log.error("The --fix option and the --fix-dry-run option cannot be used together."); + return 2; + } + if (useStdin && options.fix) { + log.error("The --fix option is not available for piped-in code; use --fix-dry-run instead."); + return 2; + } + if (options.fixType && !options.fix && !options.fixDryRun) { + log.error("The --fix-type option requires either --fix or --fix-dry-run."); + return 2; + } + + if (options.reportUnusedDisableDirectives && options.reportUnusedDisableDirectivesSeverity !== void 0) { + log.error("The --report-unused-disable-directives option and the --report-unused-disable-directives-severity option cannot be used together."); + return 2; + } + + if (usingFlatConfig && options.ext) { + + // Passing `--ext ""` results in `options.ext` being an empty array. + if (options.ext.length === 0) { + log.error("The --ext option value cannot be empty."); + return 2; + } + + // Passing `--ext ,ts` results in an empty string at index 0. Passing `--ext ts,,tsx` results in an empty string at index 1. + const emptyStringIndex = options.ext.indexOf(""); + + if (emptyStringIndex >= 0) { + log.error(`The --ext option arguments cannot be empty strings. Found an empty string at index ${emptyStringIndex}.`); + return 2; + } + } + + const ActiveESLint = usingFlatConfig ? ESLint : LegacyESLint; + const eslintOptions = await translateOptions(options, usingFlatConfig ? "flat" : "eslintrc"); + const engine = new ActiveESLint(eslintOptions); + let results; + + if (useStdin) { + results = await engine.lintText(text, { + filePath: options.stdinFilename, + + // flatConfig respects CLI flag and constructor warnIgnored, eslintrc forces true for backwards compatibility + warnIgnored: usingFlatConfig ? void 0 : true + }); + } else { + results = await engine.lintFiles(files); + } + + if (options.fix) { + debug("Fix mode enabled - applying fixes"); + await ActiveESLint.outputFixes(results); + } + + let resultsToPrint = results; + + if (options.quiet) { + debug("Quiet mode enabled - filtering out warnings"); + resultsToPrint = ActiveESLint.getErrorResults(resultsToPrint); + } + + const resultCounts = countErrors(results); + const tooManyWarnings = options.maxWarnings >= 0 && resultCounts.warningCount > options.maxWarnings; + const resultsMeta = tooManyWarnings + ? { + maxWarningsExceeded: { + maxWarnings: options.maxWarnings, + foundWarnings: resultCounts.warningCount + } + } + : {}; + + if (await printResults(engine, resultsToPrint, options.format, options.outputFile, resultsMeta)) { + + // Errors and warnings from the original unfiltered results should determine the exit code + const shouldExitForFatalErrors = + options.exitOnFatalError && resultCounts.fatalErrorCount > 0; + + if (!resultCounts.errorCount && tooManyWarnings) { + log.error( + "ESLint found too many warnings (maximum: %s).", + options.maxWarnings + ); + } + + if (shouldExitForFatalErrors) { + return 2; + } + + return (resultCounts.errorCount || tooManyWarnings) ? 1 : 0; + } + + return 2; + } +}; + +module.exports = cli; diff --git a/node_modules/eslint/lib/config/config-loader.js b/node_modules/eslint/lib/config/config-loader.js new file mode 100644 index 0000000..0f4a3d9 --- /dev/null +++ b/node_modules/eslint/lib/config/config-loader.js @@ -0,0 +1,736 @@ +/** + * @fileoverview Utility to load config files + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("node:path"); +const fs = require("node:fs/promises"); +const findUp = require("find-up"); +const { pathToFileURL } = require("node:url"); +const debug = require("debug")("eslint:config-loader"); +const { FlatConfigArray } = require("./flat-config-array"); + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** + * @typedef {import("../shared/types").FlatConfigObject} FlatConfigObject + * @typedef {import("../shared/types").FlatConfigArray} FlatConfigArray + * @typedef {Object} ConfigLoaderOptions + * @property {string|false|undefined} configFile The path to the config file to use. + * @property {string} cwd The current working directory. + * @property {boolean} ignoreEnabled Indicates if ignore patterns should be honored. + * @property {FlatConfigArray} [baseConfig] The base config to use. + * @property {Array} [defaultConfigs] The default configs to use. + * @property {Array} [ignorePatterns] The ignore patterns to use. + * @property {FlatConfigObject|Array} overrideConfig The override config to use. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const FLAT_CONFIG_FILENAMES = [ + "eslint.config.js", + "eslint.config.mjs", + "eslint.config.cjs", + "eslint.config.ts", + "eslint.config.mts", + "eslint.config.cts" +]; + +const importedConfigFileModificationTime = new Map(); + +/** + * Asserts that the given file path is valid. + * @param {string} filePath The file path to check. + * @returns {void} + * @throws {Error} If `filePath` is not a non-empty string. + */ +function assertValidFilePath(filePath) { + if (!filePath || typeof filePath !== "string") { + throw new Error("'filePath' must be a non-empty string"); + } +} + +/** + * Asserts that a configuration exists. A configuration exists if any + * of the following are true: + * - `configFilePath` is defined. + * - `useConfigFile` is `false`. + * @param {string|undefined} configFilePath The path to the config file. + * @param {ConfigLoaderOptions} loaderOptions The options to use when loading configuration files. + * @returns {void} + * @throws {Error} If no configuration exists. + */ +function assertConfigurationExists(configFilePath, loaderOptions) { + + const { + configFile: useConfigFile + } = loaderOptions; + + if (!configFilePath && useConfigFile !== false) { + const error = new Error("Could not find config file."); + + error.messageTemplate = "config-file-missing"; + throw error; + } + +} + +/** + * Check if the file is a TypeScript file. + * @param {string} filePath The file path to check. + * @returns {boolean} `true` if the file is a TypeScript file, `false` if it's not. + */ +function isFileTS(filePath) { + const fileExtension = path.extname(filePath); + + return /^\.[mc]?ts$/u.test(fileExtension); +} + +/** + * Check if ESLint is running in Bun. + * @returns {boolean} `true` if the ESLint is running Bun, `false` if it's not. + */ +function isRunningInBun() { + return !!globalThis.Bun; +} + +/** + * Check if ESLint is running in Deno. + * @returns {boolean} `true` if the ESLint is running in Deno, `false` if it's not. + */ +function isRunningInDeno() { + return !!globalThis.Deno; +} + +/** + * Load the config array from the given filename. + * @param {string} filePath The filename to load from. + * @returns {Promise} The config loaded from the config file. + */ +async function loadConfigFile(filePath) { + + debug(`Loading config from ${filePath}`); + + const fileURL = pathToFileURL(filePath); + + debug(`Config file URL is ${fileURL}`); + + const mtime = (await fs.stat(filePath)).mtime.getTime(); + + /* + * Append a query with the config file's modification time (`mtime`) in order + * to import the current version of the config file. Without the query, `import()` would + * cache the config file module by the pathname only, and then always return + * the same version (the one that was actual when the module was imported for the first time). + * + * This ensures that the config file module is loaded and executed again + * if it has been changed since the last time it was imported. + * If it hasn't been changed, `import()` will just return the cached version. + * + * Note that we should not overuse queries (e.g., by appending the current time + * to always reload the config file module) as that could cause memory leaks + * because entries are never removed from the import cache. + */ + fileURL.searchParams.append("mtime", mtime); + + /* + * With queries, we can bypass the import cache. However, when import-ing a CJS module, + * Node.js uses the require infrastructure under the hood. That includes the require cache, + * which caches the config file module by its file path (queries have no effect). + * Therefore, we also need to clear the require cache before importing the config file module. + * In order to get the same behavior with ESM and CJS config files, in particular - to reload + * the config file only if it has been changed, we track file modification times and clear + * the require cache only if the file has been changed. + */ + if (importedConfigFileModificationTime.get(filePath) !== mtime) { + delete require.cache[filePath]; + } + + const isTS = isFileTS(filePath); + const isBun = isRunningInBun(); + const isDeno = isRunningInDeno(); + + /* + * If we are dealing with a TypeScript file, then we need to use `jiti` to load it + * in Node.js. Deno and Bun both allow native importing of TypeScript files. + * + * When Node.js supports native TypeScript imports, we can remove this check. + */ + if (isTS && !isDeno && !isBun) { + + // eslint-disable-next-line no-use-before-define -- `ConfigLoader.loadJiti` can be overwritten for testing + const { createJiti } = await ConfigLoader.loadJiti().catch(() => { + throw new Error("The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it."); + }); + + // `createJiti` was added in jiti v2. + if (typeof createJiti !== "function") { + throw new Error("You are using an outdated version of the 'jiti' library. Please update to the latest version of 'jiti' to ensure compatibility and access to the latest features."); + } + + /* + * Disabling `moduleCache` allows us to reload a + * config file when the last modified timestamp changes. + */ + + const jiti = createJiti(__filename, { moduleCache: false, interopDefault: false }); + const config = await jiti.import(fileURL.href); + + importedConfigFileModificationTime.set(filePath, mtime); + + return config?.default ?? config; + } + + + // fallback to normal runtime behavior + + const config = (await import(fileURL)).default; + + importedConfigFileModificationTime.set(filePath, mtime); + + return config; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Encapsulates the loading and caching of configuration files when looking up + * from the file being linted. + */ +class ConfigLoader { + + /** + * Map of config file paths to the config arrays for those directories. + * @type {Map>} + */ + #configArrays = new Map(); + + /** + * Map of absolute directory names to the config file paths for those directories. + * @type {Map>} + */ + #configFilePaths = new Map(); + + /** + * The options to use when loading configuration files. + * @type {ConfigLoaderOptions} + */ + #options; + + /** + * Creates a new instance. + * @param {ConfigLoaderOptions} options The options to use when loading configuration files. + */ + constructor(options) { + this.#options = options; + } + + /** + * Determines which config file to use. This is determined by seeing if an + * override config file was specified, and if so, using it; otherwise, as long + * as override config file is not explicitly set to `false`, it will search + * upwards from `fromDirectory` for a file named `eslint.config.js`. + * @param {string} fromDirectory The directory from which to start searching. + * @returns {Promise<{configFilePath:string|undefined,basePath:string}>} Location information for + * the config file. + */ + async #locateConfigFileToUse(fromDirectory) { + + // check cache first + if (this.#configFilePaths.has(fromDirectory)) { + return this.#configFilePaths.get(fromDirectory); + } + + const resultPromise = ConfigLoader.locateConfigFileToUse({ + useConfigFile: this.#options.configFile, + cwd: this.#options.cwd, + fromDirectory + }); + + // ensure `ConfigLoader.locateConfigFileToUse` is called only once for `fromDirectory` + this.#configFilePaths.set(fromDirectory, resultPromise); + + // Unwrap the promise. This is primarily for the sync `getCachedConfigArrayForPath` method. + const result = await resultPromise; + + this.#configFilePaths.set(fromDirectory, result); + + return result; + } + + /** + * Calculates the config array for this run based on inputs. + * @param {string} configFilePath The absolute path to the config file to use if not overridden. + * @param {string} basePath The base path to use for relative paths in the config file. + * @returns {Promise} The config array for `eslint`. + */ + async #calculateConfigArray(configFilePath, basePath) { + + // check for cached version first + if (this.#configArrays.has(configFilePath)) { + return this.#configArrays.get(configFilePath); + } + + const configsPromise = ConfigLoader.calculateConfigArray(configFilePath, basePath, this.#options); + + // ensure `ConfigLoader.calculateConfigArray` is called only once for `configFilePath` + this.#configArrays.set(configFilePath, configsPromise); + + // Unwrap the promise. This is primarily for the sync `getCachedConfigArrayForPath` method. + const configs = await configsPromise; + + this.#configArrays.set(configFilePath, configs); + + return configs; + } + + /** + * Returns the config file path for the given directory or file. This will either use + * the override config file that was specified in the constructor options or + * search for a config file from the directory. + * @param {string} fileOrDirPath The file or directory path to get the config file path for. + * @returns {Promise} The config file path or `undefined` if not found. + * @throws {Error} If `fileOrDirPath` is not a non-empty string. + * @throws {Error} If `fileOrDirPath` is not an absolute path. + */ + async findConfigFileForPath(fileOrDirPath) { + + assertValidFilePath(fileOrDirPath); + + const absoluteDirPath = path.resolve(this.#options.cwd, path.dirname(fileOrDirPath)); + const { configFilePath } = await this.#locateConfigFileToUse(absoluteDirPath); + + return configFilePath; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file or directory to retrieve config for. + * @returns {Promise} A configuration object for the file + * or `undefined` if there is no configuration data for the file. + * @throws {Error} If no configuration for `filePath` exists. + */ + async loadConfigArrayForFile(filePath) { + + assertValidFilePath(filePath); + + debug(`Calculating config for file ${filePath}`); + + const configFilePath = await this.findConfigFileForPath(filePath); + + assertConfigurationExists(configFilePath, this.#options); + + return this.loadConfigArrayForDirectory(filePath); + } + + /** + * Returns a configuration object for the given directory based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} dirPath The path of the directory to retrieve config for. + * @returns {Promise} A configuration object for the directory + * or `undefined` if there is no configuration data for the directory. + */ + async loadConfigArrayForDirectory(dirPath) { + + assertValidFilePath(dirPath); + + debug(`Calculating config for directory ${dirPath}`); + + const absoluteDirPath = path.resolve(this.#options.cwd, path.dirname(dirPath)); + const { configFilePath, basePath } = await this.#locateConfigFileToUse(absoluteDirPath); + + debug(`Using config file ${configFilePath} and base path ${basePath}`); + return this.#calculateConfigArray(configFilePath, basePath); + } + + /** + * Returns a configuration array for the given file based on the CLI options. + * This is a synchronous operation and does not read any files from disk. It's + * intended to be used in locations where we know the config file has already + * been loaded and we just need to get the configuration for a file. + * @param {string} filePath The path of the file to retrieve a config object for. + * @returns {ConfigData|undefined} A configuration object for the file + * or `undefined` if there is no configuration data for the file. + * @throws {Error} If `filePath` is not a non-empty string. + * @throws {Error} If `filePath` is not an absolute path. + * @throws {Error} If the config file was not already loaded. + */ + getCachedConfigArrayForFile(filePath) { + assertValidFilePath(filePath); + + debug(`Looking up cached config for ${filePath}`); + + return this.getCachedConfigArrayForPath(path.dirname(filePath)); + } + + /** + * Returns a configuration array for the given directory based on the CLI options. + * This is a synchronous operation and does not read any files from disk. It's + * intended to be used in locations where we know the config file has already + * been loaded and we just need to get the configuration for a file. + * @param {string} fileOrDirPath The path of the directory to retrieve a config object for. + * @returns {ConfigData|undefined} A configuration object for the directory + * or `undefined` if there is no configuration data for the directory. + * @throws {Error} If `dirPath` is not a non-empty string. + * @throws {Error} If `dirPath` is not an absolute path. + * @throws {Error} If the config file was not already loaded. + */ + getCachedConfigArrayForPath(fileOrDirPath) { + assertValidFilePath(fileOrDirPath); + + debug(`Looking up cached config for ${fileOrDirPath}`); + + const absoluteDirPath = path.resolve(this.#options.cwd, fileOrDirPath); + + if (!this.#configFilePaths.has(absoluteDirPath)) { + throw new Error(`Could not find config file for ${fileOrDirPath}`); + } + + const configFilePathInfo = this.#configFilePaths.get(absoluteDirPath); + + if (typeof configFilePathInfo.then === "function") { + throw new Error(`Config file path for ${fileOrDirPath} has not yet been calculated or an error occurred during the calculation`); + } + + const { configFilePath } = configFilePathInfo; + + const configArray = this.#configArrays.get(configFilePath); + + if (!configArray || typeof configArray.then === "function") { + throw new Error(`Config array for ${fileOrDirPath} has not yet been calculated or an error occurred during the calculation`); + } + + return configArray; + } + + /** + * Used to import the jiti dependency. This method is exposed internally for testing purposes. + * @returns {Promise>} A promise that fulfills with a module object + * or rejects with an error if jiti is not found. + */ + static loadJiti() { + return import("jiti"); + } + + /** + * Determines which config file to use. This is determined by seeing if an + * override config file was specified, and if so, using it; otherwise, as long + * as override config file is not explicitly set to `false`, it will search + * upwards from `fromDirectory` for a file named `eslint.config.js`. + * This method is exposed internally for testing purposes. + * @param {Object} [options] the options object + * @param {string|false|undefined} options.useConfigFile The path to the config file to use. + * @param {string} options.cwd Path to a directory that should be considered as the current working directory. + * @param {string} [options.fromDirectory] The directory from which to start searching. Defaults to `cwd`. + * @returns {Promise<{configFilePath:string|undefined,basePath:string}>} Location information for + * the config file. + */ + static async locateConfigFileToUse({ useConfigFile, cwd, fromDirectory = cwd }) { + + // determine where to load config file from + let configFilePath; + let basePath = cwd; + + if (typeof useConfigFile === "string") { + debug(`Override config file path is ${useConfigFile}`); + configFilePath = path.resolve(cwd, useConfigFile); + basePath = cwd; + } else if (useConfigFile !== false) { + debug("Searching for eslint.config.js"); + configFilePath = await findUp( + FLAT_CONFIG_FILENAMES, + { cwd: fromDirectory } + ); + + if (configFilePath) { + basePath = path.dirname(configFilePath); + } + + } + + return { + configFilePath, + basePath + }; + + } + + /** + * Calculates the config array for this run based on inputs. + * This method is exposed internally for testing purposes. + * @param {string} configFilePath The absolute path to the config file to use if not overridden. + * @param {string} basePath The base path to use for relative paths in the config file. + * @param {ConfigLoaderOptions} options The options to use when loading configuration files. + * @returns {Promise} The config array for `eslint`. + */ + static async calculateConfigArray(configFilePath, basePath, options) { + + const { + cwd, + baseConfig, + ignoreEnabled, + ignorePatterns, + overrideConfig, + defaultConfigs = [] + } = options; + + debug(`Calculating config array from config file ${configFilePath} and base path ${basePath}`); + + const configs = new FlatConfigArray(baseConfig || [], { basePath, shouldIgnore: ignoreEnabled }); + + // load config file + if (configFilePath) { + + debug(`Loading config file ${configFilePath}`); + const fileConfig = await loadConfigFile(configFilePath); + + /* + * It's possible that a config file could be empty or else + * have an empty object or array. In this case, we want to + * warn the user that they have an empty config. + * + * An empty CommonJS file exports an empty object while + * an empty ESM file exports undefined. + */ + + let emptyConfig = typeof fileConfig === "undefined"; + + debug(`Config file ${configFilePath} is ${emptyConfig ? "empty" : "not empty"}`); + + if (!emptyConfig) { + if (Array.isArray(fileConfig)) { + if (fileConfig.length === 0) { + debug(`Config file ${configFilePath} is an empty array`); + emptyConfig = true; + } else { + configs.push(...fileConfig); + } + } else { + if (typeof fileConfig === "object" && fileConfig !== null && Object.keys(fileConfig).length === 0) { + debug(`Config file ${configFilePath} is an empty object`); + emptyConfig = true; + } else { + configs.push(fileConfig); + } + } + } + + if (emptyConfig) { + globalThis.process?.emitWarning?.(`Running ESLint with an empty config (from ${configFilePath}). Please double-check that this is what you want. If you want to run ESLint with an empty config, export [{}] to remove this warning.`, "ESLintEmptyConfigWarning"); + } + + } + + // add in any configured defaults + configs.push(...defaultConfigs); + + // append command line ignore patterns + if (ignorePatterns && ignorePatterns.length > 0) { + + let relativeIgnorePatterns; + + /* + * If the config file basePath is different than the cwd, then + * the ignore patterns won't work correctly. Here, we adjust the + * ignore pattern to include the correct relative path. Patterns + * passed as `ignorePatterns` are relative to the cwd, whereas + * the config file basePath can be an ancestor of the cwd. + */ + if (basePath === cwd) { + relativeIgnorePatterns = ignorePatterns; + } else { + + // relative path must only have Unix-style separators + const relativeIgnorePath = path.relative(basePath, cwd).replace(/\\/gu, "/"); + + relativeIgnorePatterns = ignorePatterns.map(pattern => { + const negated = pattern.startsWith("!"); + const basePattern = negated ? pattern.slice(1) : pattern; + + return (negated ? "!" : "") + + path.posix.join(relativeIgnorePath, basePattern); + }); + } + + /* + * Ignore patterns are added to the end of the config array + * so they can override default ignores. + */ + configs.push({ + ignores: relativeIgnorePatterns + }); + } + + if (overrideConfig) { + if (Array.isArray(overrideConfig)) { + configs.push(...overrideConfig); + } else { + configs.push(overrideConfig); + } + } + + await configs.normalize(); + + return configs; + } + +} + +/** + * Encapsulates the loading and caching of configuration files when looking up + * from the current working directory. + */ +class LegacyConfigLoader extends ConfigLoader { + + /** + * The options to use when loading configuration files. + * @type {ConfigLoaderOptions} + */ + #options; + + /** + * The cached config file path for this instance. + * @type {Promise<{configFilePath:string,basePath:string}|undefined>} + */ + #configFilePath; + + /** + * The cached config array for this instance. + * @type {FlatConfigArray|Promise} + */ + #configArray; + + /** + * Creates a new instance. + * @param {ConfigLoaderOptions} options The options to use when loading configuration files. + */ + constructor(options) { + super(options); + this.#options = options; + } + + /** + * Determines which config file to use. This is determined by seeing if an + * override config file was specified, and if so, using it; otherwise, as long + * as override config file is not explicitly set to `false`, it will search + * upwards from the cwd for a file named `eslint.config.js`. + * @returns {Promise<{configFilePath:string|undefined,basePath:string}>} Location information for + * the config file. + */ + #locateConfigFileToUse() { + if (!this.#configFilePath) { + this.#configFilePath = ConfigLoader.locateConfigFileToUse({ + useConfigFile: this.#options.configFile, + cwd: this.#options.cwd + }); + } + + return this.#configFilePath; + } + + /** + * Calculates the config array for this run based on inputs. + * @param {string} configFilePath The absolute path to the config file to use if not overridden. + * @param {string} basePath The base path to use for relative paths in the config file. + * @returns {Promise} The config array for `eslint`. + */ + async #calculateConfigArray(configFilePath, basePath) { + + // check for cached version first + if (this.#configArray) { + return this.#configArray; + } + + // ensure `ConfigLoader.calculateConfigArray` is called only once + this.#configArray = ConfigLoader.calculateConfigArray(configFilePath, basePath, this.#options); + + // Unwrap the promise. This is primarily for the sync `getCachedConfigArrayForPath` method. + this.#configArray = await this.#configArray; + + return this.#configArray; + } + + + /** + * Returns the config file path for the given directory. This will either use + * the override config file that was specified in the constructor options or + * search for a config file from the directory of the file being linted. + * @param {string} dirPath The directory path to get the config file path for. + * @returns {Promise} The config file path or `undefined` if not found. + * @throws {Error} If `fileOrDirPath` is not a non-empty string. + * @throws {Error} If `fileOrDirPath` is not an absolute path. + */ + async findConfigFileForPath(dirPath) { + + assertValidFilePath(dirPath); + + const { configFilePath } = await this.#locateConfigFileToUse(); + + return configFilePath; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} dirPath The path of the directory to retrieve config for. + * @returns {Promise} A configuration object for the file + * or `undefined` if there is no configuration data for the file. + */ + async loadConfigArrayForDirectory(dirPath) { + + assertValidFilePath(dirPath); + + debug(`[Legacy]: Calculating config for ${dirPath}`); + + const { configFilePath, basePath } = await this.#locateConfigFileToUse(); + + debug(`[Legacy]: Using config file ${configFilePath} and base path ${basePath}`); + return this.#calculateConfigArray(configFilePath, basePath); + } + + /** + * Returns a configuration array for the given directory based on the CLI options. + * This is a synchronous operation and does not read any files from disk. It's + * intended to be used in locations where we know the config file has already + * been loaded and we just need to get the configuration for a file. + * @param {string} dirPath The path of the directory to retrieve a config object for. + * @returns {ConfigData|undefined} A configuration object for the file + * or `undefined` if there is no configuration data for the file. + * @throws {Error} If `dirPath` is not a non-empty string. + * @throws {Error} If `dirPath` is not an absolute path. + * @throws {Error} If the config file was not already loaded. + */ + getCachedConfigArrayForPath(dirPath) { + assertValidFilePath(dirPath); + + debug(`[Legacy]: Looking up cached config for ${dirPath}`); + + if (!this.#configArray) { + throw new Error(`Could not find config file for ${dirPath}`); + } + + if (typeof this.#configArray.then === "function") { + throw new Error(`Config array for ${dirPath} has not yet been calculated or an error occurred during the calculation`); + } + + return this.#configArray; + } +} + +module.exports = { ConfigLoader, LegacyConfigLoader }; diff --git a/node_modules/eslint/lib/config/config.js b/node_modules/eslint/lib/config/config.js new file mode 100644 index 0000000..d75b6d6 --- /dev/null +++ b/node_modules/eslint/lib/config/config.js @@ -0,0 +1,302 @@ +/** + * @fileoverview The `Config` class + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { deepMergeArrays } = require("../shared/deep-merge-arrays"); +const { getRuleFromConfig } = require("./flat-config-helpers"); +const { flatConfigSchema, hasMethod } = require("./flat-config-schema"); +const { RuleValidator } = require("./rule-validator"); +const { ObjectSchema } = require("@eslint/config-array"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const ruleValidator = new RuleValidator(); + +const severities = new Map([ + [0, 0], + [1, 1], + [2, 2], + ["off", 0], + ["warn", 1], + ["error", 2] +]); + +/** + * Splits a plugin identifier in the form a/b/c into two parts: a/b and c. + * @param {string} identifier The identifier to parse. + * @returns {{objectName: string, pluginName: string}} The parts of the plugin + * name. + */ +function splitPluginIdentifier(identifier) { + const parts = identifier.split("/"); + + return { + objectName: parts.pop(), + pluginName: parts.join("/") + }; +} + +/** + * Returns the name of an object in the config by reading its `meta` key. + * @param {Object} object The object to check. + * @returns {string?} The name of the object if found or `null` if there + * is no name. + */ +function getObjectId(object) { + + // first check old-style name + let name = object.name; + + if (!name) { + + if (!object.meta) { + return null; + } + + name = object.meta.name; + + if (!name) { + return null; + } + } + + // now check for old-style version + let version = object.version; + + if (!version) { + version = object.meta && object.meta.version; + } + + // if there's a version then append that + if (version) { + return `${name}@${version}`; + } + + return name; +} + +/** + * Converts a languageOptions object to a JSON representation. + * @param {Record} languageOptions The options to create a JSON + * representation of. + * @param {string} objectKey The key of the object being converted. + * @returns {Record} The JSON representation of the languageOptions. + * @throws {TypeError} If a function is found in the languageOptions. + */ +function languageOptionsToJSON(languageOptions, objectKey = "languageOptions") { + + const result = {}; + + for (const [key, value] of Object.entries(languageOptions)) { + if (value) { + if (typeof value === "object") { + const name = getObjectId(value); + + if (name && hasMethod(value)) { + result[key] = name; + } else { + result[key] = languageOptionsToJSON(value, key); + } + continue; + } + + if (typeof value === "function") { + const error = new TypeError(`Cannot serialize key "${key}" in ${objectKey}: Function values are not supported.`); + + error.messageTemplate = "config-serialize-function"; + error.messageData = { key, objectKey }; + + throw error; + } + + } + + result[key] = value; + } + + return result; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Represents a normalized configuration object. + */ +class Config { + + /** + * The name to use for the language when serializing to JSON. + * @type {string|undefined} + */ + #languageName; + + /** + * The name to use for the processor when serializing to JSON. + * @type {string|undefined} + */ + #processorName; + + /** + * Creates a new instance. + * @param {Object} config The configuration object. + */ + constructor(config) { + + const { plugins, language, languageOptions, processor, ...otherKeys } = config; + + // Validate config object + const schema = new ObjectSchema(flatConfigSchema); + + schema.validate(config); + + // first, copy all the other keys over + Object.assign(this, otherKeys); + + // ensure that a language is specified + if (!language) { + throw new TypeError("Key 'language' is required."); + } + + // copy the rest over + this.plugins = plugins; + this.language = language; + + // Check language value + const { pluginName: languagePluginName, objectName: localLanguageName } = splitPluginIdentifier(language); + + this.#languageName = language; + + if (!plugins || !plugins[languagePluginName] || !plugins[languagePluginName].languages || !plugins[languagePluginName].languages[localLanguageName]) { + throw new TypeError(`Key "language": Could not find "${localLanguageName}" in plugin "${languagePluginName}".`); + } + + this.language = plugins[languagePluginName].languages[localLanguageName]; + + if (this.language.defaultLanguageOptions ?? languageOptions) { + this.languageOptions = flatConfigSchema.languageOptions.merge( + this.language.defaultLanguageOptions, + languageOptions + ); + } else { + this.languageOptions = {}; + } + + // Validate language options + try { + this.language.validateLanguageOptions(this.languageOptions); + } catch (error) { + throw new TypeError(`Key "languageOptions": ${error.message}`, { cause: error }); + } + + // Normalize language options if necessary + if (this.language.normalizeLanguageOptions) { + this.languageOptions = this.language.normalizeLanguageOptions(this.languageOptions); + } + + // Check processor value + if (processor) { + this.processor = processor; + + if (typeof processor === "string") { + const { pluginName, objectName: localProcessorName } = splitPluginIdentifier(processor); + + this.#processorName = processor; + + if (!plugins || !plugins[pluginName] || !plugins[pluginName].processors || !plugins[pluginName].processors[localProcessorName]) { + throw new TypeError(`Key "processor": Could not find "${localProcessorName}" in plugin "${pluginName}".`); + } + + this.processor = plugins[pluginName].processors[localProcessorName]; + } else if (typeof processor === "object") { + this.#processorName = getObjectId(processor); + this.processor = processor; + } else { + throw new TypeError("Key 'processor' must be a string or an object."); + } + } + + // Process the rules + if (this.rules) { + this.#normalizeRulesConfig(); + ruleValidator.validate(this); + } + } + + /** + * Converts the configuration to a JSON representation. + * @returns {Record} The JSON representation of the configuration. + * @throws {Error} If the configuration cannot be serialized. + */ + toJSON() { + + if (this.processor && !this.#processorName) { + throw new Error("Could not serialize processor object (missing 'meta' object)."); + } + + if (!this.#languageName) { + throw new Error("Could not serialize language object (missing 'meta' object)."); + } + + return { + ...this, + plugins: Object.entries(this.plugins).map(([namespace, plugin]) => { + + const pluginId = getObjectId(plugin); + + if (!pluginId) { + return namespace; + } + + return `${namespace}:${pluginId}`; + }), + language: this.#languageName, + languageOptions: languageOptionsToJSON(this.languageOptions), + processor: this.#processorName + }; + } + + /** + * Normalizes the rules configuration. Ensures that each rule config is + * an array and that the severity is a number. Applies meta.defaultOptions. + * This function modifies `this.rules`. + * @returns {void} + */ + #normalizeRulesConfig() { + for (const [ruleId, originalConfig] of Object.entries(this.rules)) { + + // ensure rule config is an array + let ruleConfig = Array.isArray(originalConfig) + ? originalConfig + : [originalConfig]; + + // normalize severity + ruleConfig[0] = severities.get(ruleConfig[0]); + + const rule = getRuleFromConfig(ruleId, this); + + // apply meta.defaultOptions + const slicedOptions = ruleConfig.slice(1); + const mergedOptions = deepMergeArrays(rule?.meta?.defaultOptions, slicedOptions); + + if (mergedOptions.length) { + ruleConfig = [ruleConfig[0], ...mergedOptions]; + } + + this.rules[ruleId] = ruleConfig; + } + } +} + +module.exports = { Config }; diff --git a/node_modules/eslint/lib/config/default-config.js b/node_modules/eslint/lib/config/default-config.js new file mode 100644 index 0000000..1b4ec45 --- /dev/null +++ b/node_modules/eslint/lib/config/default-config.js @@ -0,0 +1,69 @@ +/** + * @fileoverview Default configuration + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const Rules = require("../rules"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +exports.defaultConfig = Object.freeze([ + { + plugins: { + "@": { + + languages: { + js: require("../languages/js") + }, + + /* + * Because we try to delay loading rules until absolutely + * necessary, a proxy allows us to hook into the lazy-loading + * aspect of the rules map while still keeping all of the + * relevant configuration inside of the config array. + */ + rules: new Proxy({}, { + get(target, property) { + return Rules.get(property); + }, + + has(target, property) { + return Rules.has(property); + } + }) + } + }, + language: "@/js", + linterOptions: { + reportUnusedDisableDirectives: 1 + } + }, + + // default ignores are listed here + { + ignores: [ + "**/node_modules/", + ".git/" + ] + }, + + // intentionally empty config to ensure these files are globbed by default + { + files: ["**/*.js", "**/*.mjs"] + }, + { + files: ["**/*.cjs"], + languageOptions: { + sourceType: "commonjs", + ecmaVersion: "latest" + } + } +]); diff --git a/node_modules/eslint/lib/config/flat-config-array.js b/node_modules/eslint/lib/config/flat-config-array.js new file mode 100644 index 0000000..7c91101 --- /dev/null +++ b/node_modules/eslint/lib/config/flat-config-array.js @@ -0,0 +1,222 @@ +/** + * @fileoverview Flat Config Array + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { ConfigArray, ConfigArraySymbol } = require("@eslint/config-array"); +const { flatConfigSchema } = require("./flat-config-schema"); +const { defaultConfig } = require("./default-config"); +const { Config } = require("./config"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Fields that are considered metadata and not part of the config object. + */ +const META_FIELDS = new Set(["name"]); + +/** + * Wraps a config error with details about where the error occurred. + * @param {Error} error The original error. + * @param {number} originalLength The original length of the config array. + * @param {number} baseLength The length of the base config. + * @returns {TypeError} The new error with details. + */ +function wrapConfigErrorWithDetails(error, originalLength, baseLength) { + + let location = "user-defined"; + let configIndex = error.index; + + /* + * A config array is set up in this order: + * 1. Base config + * 2. Original configs + * 3. User-defined configs + * 4. CLI-defined configs + * + * So we need to adjust the index to account for the base config. + * + * - If the index is less than the base length, it's in the base config + * (as specified by `baseConfig` argument to `FlatConfigArray` constructor). + * - If the index is greater than the base length but less than the original + * length + base length, it's in the original config. The original config + * is passed to the `FlatConfigArray` constructor as the first argument. + * - Otherwise, it's in the user-defined config, which is loaded from the + * config file and merged with any command-line options. + */ + if (error.index < baseLength) { + location = "base"; + } else if (error.index < originalLength + baseLength) { + location = "original"; + configIndex = error.index - baseLength; + } else { + configIndex = error.index - originalLength - baseLength; + } + + return new TypeError( + `${error.message.slice(0, -1)} at ${location} index ${configIndex}.`, + { cause: error } + ); +} + + +const originalBaseConfig = Symbol("originalBaseConfig"); +const originalLength = Symbol("originalLength"); +const baseLength = Symbol("baseLength"); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Represents an array containing configuration information for ESLint. + */ +class FlatConfigArray extends ConfigArray { + + /** + * Creates a new instance. + * @param {*[]} configs An array of configuration information. + * @param {{basePath: string, shouldIgnore: boolean, baseConfig: FlatConfig}} options The options + * to use for the config array instance. + */ + constructor(configs, { + basePath, + shouldIgnore = true, + baseConfig = defaultConfig + } = {}) { + super(configs, { + basePath, + schema: flatConfigSchema + }); + + /** + * The original length of the array before any modifications. + * @type {number} + */ + this[originalLength] = this.length; + + if (baseConfig[Symbol.iterator]) { + this.unshift(...baseConfig); + } else { + this.unshift(baseConfig); + } + + /** + * The length of the array after applying the base config. + * @type {number} + */ + this[baseLength] = this.length - this[originalLength]; + + /** + * The base config used to build the config array. + * @type {Array} + */ + this[originalBaseConfig] = baseConfig; + Object.defineProperty(this, originalBaseConfig, { writable: false }); + + /** + * Determines if `ignores` fields should be honored. + * If true, then all `ignores` fields are honored. + * if false, then only `ignores` fields in the baseConfig are honored. + * @type {boolean} + */ + this.shouldIgnore = shouldIgnore; + Object.defineProperty(this, "shouldIgnore", { writable: false }); + } + + /** + * Normalizes the array by calling the superclass method and catching/rethrowing + * any ConfigError exceptions with additional details. + * @param {any} [context] The context to use to normalize the array. + * @returns {Promise} A promise that resolves when the array is normalized. + */ + normalize(context) { + return super.normalize(context) + .catch(error => { + if (error.name === "ConfigError") { + throw wrapConfigErrorWithDetails(error, this[originalLength], this[baseLength]); + } + + throw error; + + }); + } + + /** + * Normalizes the array by calling the superclass method and catching/rethrowing + * any ConfigError exceptions with additional details. + * @param {any} [context] The context to use to normalize the array. + * @returns {FlatConfigArray} The current instance. + * @throws {TypeError} If the config is invalid. + */ + normalizeSync(context) { + + try { + + return super.normalizeSync(context); + + } catch (error) { + + if (error.name === "ConfigError") { + throw wrapConfigErrorWithDetails(error, this[originalLength], this[baseLength]); + } + + throw error; + + } + + } + + /* eslint-disable class-methods-use-this -- Desired as instance method */ + /** + * Replaces a config with another config to allow us to put strings + * in the config array that will be replaced by objects before + * normalization. + * @param {Object} config The config to preprocess. + * @returns {Object} The preprocessed config. + */ + [ConfigArraySymbol.preprocessConfig](config) { + + /* + * If a config object has `ignores` and no other non-meta fields, then it's an object + * for global ignores. If `shouldIgnore` is false, that object shouldn't apply, + * so we'll remove its `ignores`. + */ + if ( + !this.shouldIgnore && + !this[originalBaseConfig].includes(config) && + config.ignores && + Object.keys(config).filter(key => !META_FIELDS.has(key)).length === 1 + ) { + /* eslint-disable-next-line no-unused-vars -- need to strip off other keys */ + const { ignores, ...otherKeys } = config; + + return otherKeys; + } + + return config; + } + + /** + * Finalizes the config by replacing plugin references with their objects + * and validating rule option schemas. + * @param {Object} config The config to finalize. + * @returns {Object} The finalized config. + * @throws {TypeError} If the config is invalid. + */ + [ConfigArraySymbol.finalizeConfig](config) { + return new Config(config); + } + /* eslint-enable class-methods-use-this -- Desired as instance method */ + +} + +exports.FlatConfigArray = FlatConfigArray; diff --git a/node_modules/eslint/lib/config/flat-config-helpers.js b/node_modules/eslint/lib/config/flat-config-helpers.js new file mode 100644 index 0000000..a904a0d --- /dev/null +++ b/node_modules/eslint/lib/config/flat-config-helpers.js @@ -0,0 +1,128 @@ +/** + * @fileoverview Shared functions to work with configs. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").Rule} Rule */ + +//------------------------------------------------------------------------------ +// Private Members +//------------------------------------------------------------------------------ + +// JSON schema that disallows passing any options +const noOptionsSchema = Object.freeze({ + type: "array", + minItems: 0, + maxItems: 0 +}); + +//----------------------------------------------------------------------------- +// Functions +//----------------------------------------------------------------------------- + +/** + * Parses a ruleId into its plugin and rule parts. + * @param {string} ruleId The rule ID to parse. + * @returns {{pluginName:string,ruleName:string}} The plugin and rule + * parts of the ruleId; + */ +function parseRuleId(ruleId) { + let pluginName, ruleName; + + // distinguish between core rules and plugin rules + if (ruleId.includes("/")) { + + // mimic scoped npm packages + if (ruleId.startsWith("@")) { + pluginName = ruleId.slice(0, ruleId.lastIndexOf("/")); + } else { + pluginName = ruleId.slice(0, ruleId.indexOf("/")); + } + + ruleName = ruleId.slice(pluginName.length + 1); + } else { + pluginName = "@"; + ruleName = ruleId; + } + + return { + pluginName, + ruleName + }; +} + +/** + * Retrieves a rule instance from a given config based on the ruleId. + * @param {string} ruleId The rule ID to look for. + * @param {FlatConfig} config The config to search. + * @returns {import("../shared/types").Rule|undefined} The rule if found + * or undefined if not. + */ +function getRuleFromConfig(ruleId, config) { + const { pluginName, ruleName } = parseRuleId(ruleId); + + return config.plugins?.[pluginName]?.rules?.[ruleName]; +} + +/** + * Gets a complete options schema for a rule. + * @param {Rule} rule A rule object + * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`. + * @returns {Object|null} JSON Schema for the rule's options. `null` if `meta.schema` is `false`. + */ +function getRuleOptionsSchema(rule) { + + if (!rule.meta) { + return { ...noOptionsSchema }; // default if `meta.schema` is not specified + } + + const schema = rule.meta.schema; + + if (typeof schema === "undefined") { + return { ...noOptionsSchema }; // default if `meta.schema` is not specified + } + + // `schema:false` is an allowed explicit opt-out of options validation for the rule + if (schema === false) { + return null; + } + + if (typeof schema !== "object" || schema === null) { + throw new TypeError("Rule's `meta.schema` must be an array or object"); + } + + // ESLint-specific array form needs to be converted into a valid JSON Schema definition + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + + // `schema:[]` is an explicit way to specify that the rule does not accept any options + return { ...noOptionsSchema }; + } + + // `schema:` is assumed to be a valid JSON Schema definition + return schema; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + parseRuleId, + getRuleFromConfig, + getRuleOptionsSchema +}; diff --git a/node_modules/eslint/lib/config/flat-config-schema.js b/node_modules/eslint/lib/config/flat-config-schema.js new file mode 100644 index 0000000..0b6a1f9 --- /dev/null +++ b/node_modules/eslint/lib/config/flat-config-schema.js @@ -0,0 +1,591 @@ +/** + * @fileoverview Flat config schema + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { normalizeSeverityToNumber } = require("../shared/severity"); + +//----------------------------------------------------------------------------- +// Type Definitions +//----------------------------------------------------------------------------- + +/** + * @typedef ObjectPropertySchema + * @property {Function|string} merge The function or name of the function to call + * to merge multiple objects with this property. + * @property {Function|string} validate The function or name of the function to call + * to validate the value of this property. + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const ruleSeverities = new Map([ + [0, 0], ["off", 0], + [1, 1], ["warn", 1], + [2, 2], ["error", 2] +]); + +/** + * Check if a value is a non-null object. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(value) { + return typeof value === "object" && value !== null; +} + +/** + * Check if a value is a non-null non-array object. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is a non-null non-array object. + */ +function isNonArrayObject(value) { + return isNonNullObject(value) && !Array.isArray(value); +} + +/** + * Check if a value is undefined. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is undefined. + */ +function isUndefined(value) { + return typeof value === "undefined"; +} + +/** + * Deeply merges two non-array objects. + * @param {Object} first The base object. + * @param {Object} second The overrides object. + * @param {Map>} [mergeMap] Maps the combination of first and second arguments to a merged result. + * @returns {Object} An object with properties from both first and second. + */ +function deepMerge(first, second, mergeMap = new Map()) { + + let secondMergeMap = mergeMap.get(first); + + if (secondMergeMap) { + const result = secondMergeMap.get(second); + + if (result) { + + // If this combination of first and second arguments has been already visited, return the previously created result. + return result; + } + } else { + secondMergeMap = new Map(); + mergeMap.set(first, secondMergeMap); + } + + /* + * First create a result object where properties from the second object + * overwrite properties from the first. This sets up a baseline to use + * later rather than needing to inspect and change every property + * individually. + */ + const result = { + ...first, + ...second + }; + + delete result.__proto__; // eslint-disable-line no-proto -- don't merge own property "__proto__" + + // Store the pending result for this combination of first and second arguments. + secondMergeMap.set(second, result); + + for (const key of Object.keys(second)) { + + // avoid hairy edge case + if (key === "__proto__" || !Object.prototype.propertyIsEnumerable.call(first, key)) { + continue; + } + + const firstValue = first[key]; + const secondValue = second[key]; + + if (isNonArrayObject(firstValue) && isNonArrayObject(secondValue)) { + result[key] = deepMerge(firstValue, secondValue, mergeMap); + } else if (isUndefined(secondValue)) { + result[key] = firstValue; + } + } + + return result; + +} + +/** + * Normalizes the rule options config for a given rule by ensuring that + * it is an array and that the first item is 0, 1, or 2. + * @param {Array|string|number} ruleOptions The rule options config. + * @returns {Array} An array of rule options. + */ +function normalizeRuleOptions(ruleOptions) { + + const finalOptions = Array.isArray(ruleOptions) + ? ruleOptions.slice(0) + : [ruleOptions]; + + finalOptions[0] = ruleSeverities.get(finalOptions[0]); + return structuredClone(finalOptions); +} + +/** + * Determines if an object has any methods. + * @param {Object} object The object to check. + * @returns {boolean} `true` if the object has any methods. + */ +function hasMethod(object) { + + for (const key of Object.keys(object)) { + + if (typeof object[key] === "function") { + return true; + } + } + + return false; +} + +//----------------------------------------------------------------------------- +// Assertions +//----------------------------------------------------------------------------- + +/** + * The error type when a rule's options are configured with an invalid type. + */ +class InvalidRuleOptionsError extends Error { + + /** + * @param {string} ruleId Rule name being configured. + * @param {any} value The invalid value. + */ + constructor(ruleId, value) { + super(`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`); + this.messageTemplate = "invalid-rule-options"; + this.messageData = { ruleId, value }; + } +} + +/** + * Validates that a value is a valid rule options entry. + * @param {string} ruleId Rule name being configured. + * @param {any} value The value to check. + * @returns {void} + * @throws {InvalidRuleOptionsError} If the value isn't a valid rule options. + */ +function assertIsRuleOptions(ruleId, value) { + if (typeof value !== "string" && typeof value !== "number" && !Array.isArray(value)) { + throw new InvalidRuleOptionsError(ruleId, value); + } +} + +/** + * The error type when a rule's severity is invalid. + */ +class InvalidRuleSeverityError extends Error { + + /** + * @param {string} ruleId Rule name being configured. + * @param {any} value The invalid value. + */ + constructor(ruleId, value) { + super(`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`); + this.messageTemplate = "invalid-rule-severity"; + this.messageData = { ruleId, value }; + } +} + +/** + * Validates that a value is valid rule severity. + * @param {string} ruleId Rule name being configured. + * @param {any} value The value to check. + * @returns {void} + * @throws {InvalidRuleSeverityError} If the value isn't a valid rule severity. + */ +function assertIsRuleSeverity(ruleId, value) { + const severity = ruleSeverities.get(value); + + if (typeof severity === "undefined") { + throw new InvalidRuleSeverityError(ruleId, value); + } +} + +/** + * Validates that a given string is the form pluginName/objectName. + * @param {string} value The string to check. + * @returns {void} + * @throws {TypeError} If the string isn't in the correct format. + */ +function assertIsPluginMemberName(value) { + if (!/[@a-z0-9-_$]+(?:\/(?:[a-z0-9-_$]+))+$/iu.test(value)) { + throw new TypeError(`Expected string in the form "pluginName/objectName" but found "${value}".`); + } +} + +/** + * Validates that a value is an object. + * @param {any} value The value to check. + * @returns {void} + * @throws {TypeError} If the value isn't an object. + */ +function assertIsObject(value) { + if (!isNonNullObject(value)) { + throw new TypeError("Expected an object."); + } +} + +/** + * The error type when there's an eslintrc-style options in a flat config. + */ +class IncompatibleKeyError extends Error { + + /** + * @param {string} key The invalid key. + */ + constructor(key) { + super("This appears to be in eslintrc format rather than flat config format."); + this.messageTemplate = "eslintrc-incompat"; + this.messageData = { key }; + } +} + +/** + * The error type when there's an eslintrc-style plugins array found. + */ +class IncompatiblePluginsError extends Error { + + /** + * Creates a new instance. + * @param {Array} plugins The plugins array. + */ + constructor(plugins) { + super("This appears to be in eslintrc format (array of strings) rather than flat config format (object)."); + this.messageTemplate = "eslintrc-plugins"; + this.messageData = { plugins }; + } +} + + +//----------------------------------------------------------------------------- +// Low-Level Schemas +//----------------------------------------------------------------------------- + +/** @type {ObjectPropertySchema} */ +const booleanSchema = { + merge: "replace", + validate: "boolean" +}; + +const ALLOWED_SEVERITIES = new Set(["error", "warn", "off", 2, 1, 0]); + +/** @type {ObjectPropertySchema} */ +const disableDirectiveSeveritySchema = { + merge(first, second) { + const value = second === void 0 ? first : second; + + if (typeof value === "boolean") { + return value ? "warn" : "off"; + } + + return normalizeSeverityToNumber(value); + }, + validate(value) { + if (!(ALLOWED_SEVERITIES.has(value) || typeof value === "boolean")) { + throw new TypeError("Expected one of: \"error\", \"warn\", \"off\", 0, 1, 2, or a boolean."); + } + } +}; + +/** @type {ObjectPropertySchema} */ +const unusedInlineConfigsSeveritySchema = { + merge(first, second) { + const value = second === void 0 ? first : second; + + return normalizeSeverityToNumber(value); + }, + validate(value) { + if (!ALLOWED_SEVERITIES.has(value)) { + throw new TypeError("Expected one of: \"error\", \"warn\", \"off\", 0, 1, or 2."); + } + } +}; + +/** @type {ObjectPropertySchema} */ +const deepObjectAssignSchema = { + merge(first = {}, second = {}) { + return deepMerge(first, second); + }, + validate: "object" +}; + + +//----------------------------------------------------------------------------- +// High-Level Schemas +//----------------------------------------------------------------------------- + +/** @type {ObjectPropertySchema} */ +const languageOptionsSchema = { + merge(first = {}, second = {}) { + + const result = deepMerge(first, second); + + for (const [key, value] of Object.entries(result)) { + + /* + * Special case: Because the `parser` property is an object, it should + * not be deep merged. Instead, it should be replaced if it exists in + * the second object. To make this more generic, we just check for + * objects with methods and replace them if they exist in the second + * object. + */ + if (isNonArrayObject(value)) { + if (hasMethod(value)) { + result[key] = second[key] ?? first[key]; + continue; + } + + // for other objects, make sure we aren't reusing the same object + result[key] = { ...result[key] }; + continue; + } + + } + + return result; + }, + validate: "object" +}; + +/** @type {ObjectPropertySchema} */ +const languageSchema = { + merge: "replace", + validate: assertIsPluginMemberName +}; + +/** @type {ObjectPropertySchema} */ +const pluginsSchema = { + merge(first = {}, second = {}) { + const keys = new Set([...Object.keys(first), ...Object.keys(second)]); + const result = {}; + + // manually validate that plugins are not redefined + for (const key of keys) { + + // avoid hairy edge case + if (key === "__proto__") { + continue; + } + + if (key in first && key in second && first[key] !== second[key]) { + throw new TypeError(`Cannot redefine plugin "${key}".`); + } + + result[key] = second[key] || first[key]; + } + + return result; + }, + validate(value) { + + // first check the value to be sure it's an object + if (value === null || typeof value !== "object") { + throw new TypeError("Expected an object."); + } + + // make sure it's not an array, which would mean eslintrc-style is used + if (Array.isArray(value)) { + throw new IncompatiblePluginsError(value); + } + + // second check the keys to make sure they are objects + for (const key of Object.keys(value)) { + + // avoid hairy edge case + if (key === "__proto__") { + continue; + } + + if (value[key] === null || typeof value[key] !== "object") { + throw new TypeError(`Key "${key}": Expected an object.`); + } + } + } +}; + +/** @type {ObjectPropertySchema} */ +const processorSchema = { + merge: "replace", + validate(value) { + if (typeof value === "string") { + assertIsPluginMemberName(value); + } else if (value && typeof value === "object") { + if (typeof value.preprocess !== "function" || typeof value.postprocess !== "function") { + throw new TypeError("Object must have a preprocess() and a postprocess() method."); + } + } else { + throw new TypeError("Expected an object or a string."); + } + } +}; + +/** @type {ObjectPropertySchema} */ +const rulesSchema = { + merge(first = {}, second = {}) { + + const result = { + ...first, + ...second + }; + + + for (const ruleId of Object.keys(result)) { + + try { + + // avoid hairy edge case + if (ruleId === "__proto__") { + + /* eslint-disable-next-line no-proto -- Though deprecated, may still be present */ + delete result.__proto__; + continue; + } + + result[ruleId] = normalizeRuleOptions(result[ruleId]); + + /* + * If either rule config is missing, then the correct + * config is already present and we just need to normalize + * the severity. + */ + if (!(ruleId in first) || !(ruleId in second)) { + continue; + } + + const firstRuleOptions = normalizeRuleOptions(first[ruleId]); + const secondRuleOptions = normalizeRuleOptions(second[ruleId]); + + /* + * If the second rule config only has a severity (length of 1), + * then use that severity and keep the rest of the options from + * the first rule config. + */ + if (secondRuleOptions.length === 1) { + result[ruleId] = [secondRuleOptions[0], ...firstRuleOptions.slice(1)]; + continue; + } + + /* + * In any other situation, then the second rule config takes + * precedence. That means the value at `result[ruleId]` is + * already correct and no further work is necessary. + */ + } catch (ex) { + throw new Error(`Key "${ruleId}": ${ex.message}`, { cause: ex }); + } + + } + + return result; + + + }, + + validate(value) { + assertIsObject(value); + + /* + * We are not checking the rule schema here because there is no + * guarantee that the rule definition is present at this point. Instead + * we wait and check the rule schema during the finalization step + * of calculating a config. + */ + for (const ruleId of Object.keys(value)) { + + // avoid hairy edge case + if (ruleId === "__proto__") { + continue; + } + + const ruleOptions = value[ruleId]; + + assertIsRuleOptions(ruleId, ruleOptions); + + if (Array.isArray(ruleOptions)) { + assertIsRuleSeverity(ruleId, ruleOptions[0]); + } else { + assertIsRuleSeverity(ruleId, ruleOptions); + } + } + } +}; + +/** + * Creates a schema that always throws an error. Useful for warning + * about eslintrc-style keys. + * @param {string} key The eslintrc key to create a schema for. + * @returns {ObjectPropertySchema} The schema. + */ +function createEslintrcErrorSchema(key) { + return { + merge: "replace", + validate() { + throw new IncompatibleKeyError(key); + } + }; +} + +const eslintrcKeys = [ + "env", + "extends", + "globals", + "ignorePatterns", + "noInlineConfig", + "overrides", + "parser", + "parserOptions", + "reportUnusedDisableDirectives", + "root" +]; + +//----------------------------------------------------------------------------- +// Full schema +//----------------------------------------------------------------------------- + +const flatConfigSchema = { + + // eslintrc-style keys that should always error + ...Object.fromEntries(eslintrcKeys.map(key => [key, createEslintrcErrorSchema(key)])), + + // flat config keys + settings: deepObjectAssignSchema, + linterOptions: { + schema: { + noInlineConfig: booleanSchema, + reportUnusedDisableDirectives: disableDirectiveSeveritySchema, + reportUnusedInlineConfigs: unusedInlineConfigsSeveritySchema + } + }, + language: languageSchema, + languageOptions: languageOptionsSchema, + processor: processorSchema, + plugins: pluginsSchema, + rules: rulesSchema +}; + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + flatConfigSchema, + hasMethod, + assertIsRuleSeverity +}; diff --git a/node_modules/eslint/lib/config/rule-validator.js b/node_modules/eslint/lib/config/rule-validator.js new file mode 100644 index 0000000..3f8462d --- /dev/null +++ b/node_modules/eslint/lib/config/rule-validator.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule Validator + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const ajvImport = require("../shared/ajv"); +const ajv = ajvImport(); +const { + parseRuleId, + getRuleFromConfig, + getRuleOptionsSchema +} = require("./flat-config-helpers"); +const ruleReplacements = require("../../conf/replacements.json"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Throws a helpful error when a rule cannot be found. + * @param {Object} ruleId The rule identifier. + * @param {string} ruleId.pluginName The ID of the rule to find. + * @param {string} ruleId.ruleName The ID of the rule to find. + * @param {Object} config The config to search in. + * @throws {TypeError} For missing plugin or rule. + * @returns {void} + */ +function throwRuleNotFoundError({ pluginName, ruleName }, config) { + + const ruleId = pluginName === "@" ? ruleName : `${pluginName}/${ruleName}`; + + const errorMessageHeader = `Key "rules": Key "${ruleId}"`; + + let errorMessage = `${errorMessageHeader}: Could not find plugin "${pluginName}" in configuration.`; + + const missingPluginErrorMessage = errorMessage; + + // if the plugin exists then we need to check if the rule exists + if (config.plugins && config.plugins[pluginName]) { + const replacementRuleName = ruleReplacements.rules[ruleName]; + + if (pluginName === "@" && replacementRuleName) { + + errorMessage = `${errorMessageHeader}: Rule "${ruleName}" was removed and replaced by "${replacementRuleName}".`; + + } else { + + errorMessage = `${errorMessageHeader}: Could not find "${ruleName}" in plugin "${pluginName}".`; + + // otherwise, let's see if we can find the rule name elsewhere + for (const [otherPluginName, otherPlugin] of Object.entries(config.plugins)) { + if (otherPlugin.rules && otherPlugin.rules[ruleName]) { + errorMessage += ` Did you mean "${otherPluginName}/${ruleName}"?`; + break; + } + } + + } + + // falls through to throw error + } + + const error = new TypeError(errorMessage); + + if (errorMessage === missingPluginErrorMessage) { + error.messageTemplate = "config-plugin-missing"; + error.messageData = { pluginName, ruleId }; + } + + throw error; +} + +/** + * The error type when a rule has an invalid `meta.schema`. + */ +class InvalidRuleOptionsSchemaError extends Error { + + /** + * Creates a new instance. + * @param {string} ruleId Id of the rule that has an invalid `meta.schema`. + * @param {Error} processingError Error caught while processing the `meta.schema`. + */ + constructor(ruleId, processingError) { + super( + `Error while processing options validation schema of rule '${ruleId}': ${processingError.message}`, + { cause: processingError } + ); + this.code = "ESLINT_INVALID_RULE_OPTIONS_SCHEMA"; + } +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Implements validation functionality for the rules portion of a config. + */ +class RuleValidator { + + /** + * Creates a new instance. + */ + constructor() { + + /** + * A collection of compiled validators for rules that have already + * been validated. + * @type {WeakMap} + */ + this.validators = new WeakMap(); + } + + /** + * Validates all of the rule configurations in a config against each + * rule's schema. + * @param {Object} config The full config to validate. This object must + * contain both the rules section and the plugins section. + * @returns {void} + * @throws {Error} If a rule's configuration does not match its schema. + */ + validate(config) { + + if (!config.rules) { + return; + } + + for (const [ruleId, ruleOptions] of Object.entries(config.rules)) { + + // check for edge case + if (ruleId === "__proto__") { + continue; + } + + /* + * If a rule is disabled, we don't do any validation. This allows + * users to safely set any value to 0 or "off" without worrying + * that it will cause a validation error. + * + * Note: ruleOptions is always an array at this point because + * this validation occurs after FlatConfigArray has merged and + * normalized values. + */ + if (ruleOptions[0] === 0) { + continue; + } + + const rule = getRuleFromConfig(ruleId, config); + + if (!rule) { + throwRuleNotFoundError(parseRuleId(ruleId), config); + } + + // Precompile and cache validator the first time + if (!this.validators.has(rule)) { + try { + const schema = getRuleOptionsSchema(rule); + + if (schema) { + this.validators.set(rule, ajv.compile(schema)); + } + } catch (err) { + throw new InvalidRuleOptionsSchemaError(ruleId, err); + } + } + + const validateRule = this.validators.get(rule); + + if (validateRule) { + + validateRule(ruleOptions.slice(1)); + + if (validateRule.errors) { + throw new Error(`Key "rules": Key "${ruleId}":\n${ + validateRule.errors.map( + error => { + if ( + error.keyword === "additionalProperties" && + error.schema === false && + typeof error.parentSchema?.properties === "object" && + typeof error.params?.additionalProperty === "string" + ) { + const expectedProperties = Object.keys(error.parentSchema.properties).map(property => `"${property}"`); + + return `\tValue ${JSON.stringify(error.data)} ${error.message}.\n\t\tUnexpected property "${error.params.additionalProperty}". Expected properties: ${expectedProperties.join(", ")}.\n`; + } + + return `\tValue ${JSON.stringify(error.data)} ${error.message}.\n`; + } + ).join("") + }`); + } + } + } + } +} + +exports.RuleValidator = RuleValidator; diff --git a/node_modules/eslint/lib/eslint/eslint-helpers.js b/node_modules/eslint/lib/eslint/eslint-helpers.js new file mode 100644 index 0000000..c844510 --- /dev/null +++ b/node_modules/eslint/lib/eslint/eslint-helpers.js @@ -0,0 +1,965 @@ +/** + * @fileoverview Helper functions for ESLint class + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const path = require("node:path"); +const fs = require("node:fs"); +const fsp = fs.promises; +const isGlob = require("is-glob"); +const hash = require("../cli-engine/hash"); +const minimatch = require("minimatch"); +const globParent = require("glob-parent"); + +//----------------------------------------------------------------------------- +// Fixup references +//----------------------------------------------------------------------------- + +const Minimatch = minimatch.Minimatch; +const MINIMATCH_OPTIONS = { dot: true }; + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** + * @typedef {Object} GlobSearch + * @property {Array} patterns The normalized patterns to use for a search. + * @property {Array} rawPatterns The patterns as entered by the user + * before doing any normalization. + */ + +//----------------------------------------------------------------------------- +// Errors +//----------------------------------------------------------------------------- + +/** + * The error type when no files match a glob. + */ +class NoFilesFoundError extends Error { + + /** + * @param {string} pattern The glob pattern which was not found. + * @param {boolean} globEnabled If `false` then the pattern was a glob pattern, but glob was disabled. + */ + constructor(pattern, globEnabled) { + super(`No files matching '${pattern}' were found${!globEnabled ? " (glob was disabled)" : ""}.`); + this.messageTemplate = "file-not-found"; + this.messageData = { pattern, globDisabled: !globEnabled }; + } +} + +/** + * The error type when a search fails to match multiple patterns. + */ +class UnmatchedSearchPatternsError extends Error { + + /** + * @param {Object} options The options for the error. + * @param {string} options.basePath The directory that was searched. + * @param {Array} options.unmatchedPatterns The glob patterns + * which were not found. + * @param {Array} options.patterns The glob patterns that were + * searched. + * @param {Array} options.rawPatterns The raw glob patterns that + * were searched. + */ + constructor({ basePath, unmatchedPatterns, patterns, rawPatterns }) { + super(`No files matching '${rawPatterns}' in '${basePath}' were found.`); + this.basePath = basePath; + this.unmatchedPatterns = unmatchedPatterns; + this.patterns = patterns; + this.rawPatterns = rawPatterns; + } +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class AllFilesIgnoredError extends Error { + + /** + * @param {string} pattern The glob pattern which was not found. + */ + constructor(pattern) { + super(`All files matched by '${pattern}' are ignored.`); + this.messageTemplate = "all-matched-files-ignored"; + this.messageData = { pattern }; + } +} + + +//----------------------------------------------------------------------------- +// General Helpers +//----------------------------------------------------------------------------- + +/** + * Check if a given value is a non-empty string or not. + * @param {any} value The value to check. + * @returns {boolean} `true` if `value` is a non-empty string. + */ +function isNonEmptyString(value) { + return typeof value === "string" && value.trim() !== ""; +} + +/** + * Check if a given value is an array of non-empty strings or not. + * @param {any} value The value to check. + * @returns {boolean} `true` if `value` is an array of non-empty strings. + */ +function isArrayOfNonEmptyString(value) { + return Array.isArray(value) && value.length && value.every(isNonEmptyString); +} + +/** + * Check if a given value is an empty array or an array of non-empty strings. + * @param {any} value The value to check. + * @returns {boolean} `true` if `value` is an empty array or an array of non-empty + * strings. + */ +function isEmptyArrayOrArrayOfNonEmptyString(value) { + return Array.isArray(value) && value.every(isNonEmptyString); +} + +//----------------------------------------------------------------------------- +// File-related Helpers +//----------------------------------------------------------------------------- + +/** + * Normalizes slashes in a file pattern to posix-style. + * @param {string} pattern The pattern to replace slashes in. + * @returns {string} The pattern with slashes normalized. + */ +function normalizeToPosix(pattern) { + return pattern.replace(/\\/gu, "/"); +} + +/** + * Check if a string is a glob pattern or not. + * @param {string} pattern A glob pattern. + * @returns {boolean} `true` if the string is a glob pattern. + */ +function isGlobPattern(pattern) { + return isGlob(path.sep === "\\" ? normalizeToPosix(pattern) : pattern); +} + + +/** + * Determines if a given glob pattern will return any results. + * Used primarily to help with useful error messages. + * @param {Object} options The options for the function. + * @param {string} options.basePath The directory to search. + * @param {string} options.pattern An absolute path glob pattern to match. + * @returns {Promise} True if there is a glob match, false if not. + */ +async function globMatch({ basePath, pattern }) { + + let found = false; + const { hfs } = await import("@humanfs/node"); + const patternToUse = normalizeToPosix(path.relative(basePath, pattern)); + + const matcher = new Minimatch(patternToUse, MINIMATCH_OPTIONS); + + const walkSettings = { + + directoryFilter(entry) { + return !found && matcher.match(entry.path, true); + }, + + entryFilter(entry) { + if (found || entry.isDirectory) { + return false; + } + + if (matcher.match(entry.path)) { + found = true; + return true; + } + + return false; + } + }; + + if (await hfs.isDirectory(basePath)) { + return hfs.walk(basePath, walkSettings).next().then(() => found); + } + + return found; +} + +/** + * Searches a directory looking for matching glob patterns. This uses + * the config array's logic to determine if a directory or file should + * be ignored, so it is consistent with how ignoring works throughout + * ESLint. + * @param {Object} options The options for this function. + * @param {string} options.basePath The directory to search. + * @param {Array} options.patterns An array of absolute path glob patterns + * to match. + * @param {Array} options.rawPatterns An array of glob patterns + * as the user inputted them. Used for errors. + * @param {ConfigLoader|LegacyConfigLoader} options.configLoader The config array to use for + * determining what to ignore. + * @param {boolean} options.errorOnUnmatchedPattern Determines if an error + * should be thrown when a pattern is unmatched. + * @returns {Promise>} An array of matching file paths + * or an empty array if there are no matches. + * @throws {UnmatchedSearchPatternsError} If there is a pattern that doesn't + * match any files. + */ +async function globSearch({ + basePath, + patterns, + rawPatterns, + configLoader, + errorOnUnmatchedPattern +}) { + + if (patterns.length === 0) { + return []; + } + + /* + * In this section we are converting the patterns into Minimatch + * instances for performance reasons. Because we are doing the same + * matches repeatedly, it's best to compile those patterns once and + * reuse them multiple times. + * + * To do that, we convert any patterns with an absolute path into a + * relative path and normalize it to Posix-style slashes. We also keep + * track of the relative patterns to map them back to the original + * patterns, which we need in order to throw an error if there are any + * unmatched patterns. + */ + const relativeToPatterns = new Map(); + const matchers = patterns.map((pattern, i) => { + const patternToUse = normalizeToPosix(path.relative(basePath, pattern)); + + relativeToPatterns.set(patternToUse, patterns[i]); + + return new Minimatch(patternToUse, MINIMATCH_OPTIONS); + }); + + /* + * We track unmatched patterns because we may want to throw an error when + * they occur. To start, this set is initialized with all of the patterns. + * Every time a match occurs, the pattern is removed from the set, making + * it easy to tell if we have any unmatched patterns left at the end of + * search. + */ + const unmatchedPatterns = new Set([...relativeToPatterns.keys()]); + const { hfs } = await import("@humanfs/node"); + + const walk = hfs.walk( + basePath, + { + async directoryFilter(entry) { + + if (!matchers.some(matcher => matcher.match(entry.path, true))) { + return false; + } + + const absolutePath = path.resolve(basePath, entry.path); + const configs = await configLoader.loadConfigArrayForDirectory(absolutePath); + + return !configs.isDirectoryIgnored(absolutePath); + }, + async entryFilter(entry) { + const absolutePath = path.resolve(basePath, entry.path); + + // entries may be directories or files so filter out directories + if (entry.isDirectory) { + return false; + } + + const configs = await configLoader.loadConfigArrayForFile(absolutePath); + const config = configs.getConfig(absolutePath); + + /* + * Optimization: We need to track when patterns are left unmatched + * and so we use `unmatchedPatterns` to do that. There is a bit of + * complexity here because the same file can be matched by more than + * one pattern. So, when we start, we actually need to test every + * pattern against every file. Once we know there are no remaining + * unmatched patterns, then we can switch to just looking for the + * first matching pattern for improved speed. + */ + const matchesPattern = unmatchedPatterns.size > 0 + ? matchers.reduce((previousValue, matcher) => { + const pathMatches = matcher.match(entry.path); + + /* + * We updated the unmatched patterns set only if the path + * matches and the file has a config. If the file has no + * config, that means there wasn't a match for the + * pattern so it should not be removed. + * + * Performance note: `getConfig()` aggressively caches + * results so there is no performance penalty for calling + * it multiple times with the same argument. + */ + if (pathMatches && config) { + unmatchedPatterns.delete(matcher.pattern); + } + + return pathMatches || previousValue; + }, false) + : matchers.some(matcher => matcher.match(entry.path)); + + return matchesPattern && config !== void 0; + } + } + ); + + const filePaths = []; + + if (await hfs.isDirectory(basePath)) { + for await (const entry of walk) { + filePaths.push(path.resolve(basePath, entry.path)); + } + } + + // now check to see if we have any unmatched patterns + if (errorOnUnmatchedPattern && unmatchedPatterns.size > 0) { + throw new UnmatchedSearchPatternsError({ + basePath, + unmatchedPatterns: [...unmatchedPatterns].map( + pattern => relativeToPatterns.get(pattern) + ), + patterns, + rawPatterns + }); + } + + return filePaths; +} + +/** + * Throws an error for unmatched patterns. The error will only contain information about the first one. + * Checks to see if there are any ignored results for a given search. + * @param {Object} options The options for this function. + * @param {string} options.basePath The directory to search. + * @param {Array} options.patterns An array of glob patterns + * that were used in the original search. + * @param {Array} options.rawPatterns An array of glob patterns + * as the user inputted them. Used for errors. + * @param {Array} options.unmatchedPatterns A non-empty array of absolute path glob patterns + * that were unmatched in the original search. + * @returns {void} Always throws an error. + * @throws {NoFilesFoundError} If the first unmatched pattern + * doesn't match any files even when there are no ignores. + * @throws {AllFilesIgnoredError} If the first unmatched pattern + * matches some files when there are no ignores. + */ +async function throwErrorForUnmatchedPatterns({ + basePath, + patterns, + rawPatterns, + unmatchedPatterns +}) { + + const pattern = unmatchedPatterns[0]; + const rawPattern = rawPatterns[patterns.indexOf(pattern)]; + + const patternHasMatch = await globMatch({ + basePath, + pattern + }); + + if (patternHasMatch) { + throw new AllFilesIgnoredError(rawPattern); + } + + // if we get here there are truly no matches + throw new NoFilesFoundError(rawPattern, true); +} + +/** + * Performs multiple glob searches in parallel. + * @param {Object} options The options for this function. + * @param {Map} options.searches + * A map of absolute path glob patterns to match. + * @param {ConfigLoader|LegacyConfigLoader} options.configLoader The config loader to use for + * determining what to ignore. + * @param {boolean} options.errorOnUnmatchedPattern Determines if an + * unmatched glob pattern should throw an error. + * @returns {Promise>} An array of matching file paths + * or an empty array if there are no matches. + */ +async function globMultiSearch({ searches, configLoader, errorOnUnmatchedPattern }) { + + /* + * For convenience, we normalized the search map into an array of objects. + * Next, we filter out all searches that have no patterns. This happens + * primarily for the cwd, which is prepopulated in the searches map as an + * optimization. However, if it has no patterns, it means all patterns + * occur outside of the cwd and we can safely filter out that search. + */ + const normalizedSearches = [...searches].map( + ([basePath, { patterns, rawPatterns }]) => ({ basePath, patterns, rawPatterns }) + ).filter(({ patterns }) => patterns.length > 0); + + const results = await Promise.allSettled( + normalizedSearches.map( + ({ basePath, patterns, rawPatterns }) => globSearch({ + basePath, + patterns, + rawPatterns, + configLoader, + errorOnUnmatchedPattern + }) + ) + ); + + /* + * The first loop handles errors from the glob searches. Since we can't + * use `await` inside `flatMap`, we process errors separately in this loop. + * This results in two iterations over `results`, but since the length is + * less than or equal to the number of globs and directories passed on the + * command line, the performance impact should be minimal. + */ + for (let i = 0; i < results.length; i++) { + + const result = results[i]; + const currentSearch = normalizedSearches[i]; + + if (result.status === "fulfilled") { + continue; + } + + // if we make it here then there was an error + const error = result.reason; + + // unexpected errors should be re-thrown + if (!error.basePath) { + throw error; + } + + if (errorOnUnmatchedPattern) { + + await throwErrorForUnmatchedPatterns({ + ...currentSearch, + unmatchedPatterns: error.unmatchedPatterns + }); + + } + + } + + // second loop for `fulfulled` results + return results.flatMap(result => result.value); + +} + +/** + * Finds all files matching the options specified. + * @param {Object} args The arguments objects. + * @param {Array} args.patterns An array of glob patterns. + * @param {boolean} args.globInputPaths true to interpret glob patterns, + * false to not interpret glob patterns. + * @param {string} args.cwd The current working directory to find from. + * @param {ConfigLoader|LegacyConfigLoader} args.configLoader The config loeader for the current run. + * @param {boolean} args.errorOnUnmatchedPattern Determines if an unmatched pattern + * should throw an error. + * @returns {Promise>} The fully resolved file paths. + * @throws {AllFilesIgnoredError} If there are no results due to an ignore pattern. + * @throws {NoFilesFoundError} If no files matched the given patterns. + */ +async function findFiles({ + patterns, + globInputPaths, + cwd, + configLoader, + errorOnUnmatchedPattern +}) { + + const results = []; + const missingPatterns = []; + let globbyPatterns = []; + let rawPatterns = []; + const searches = new Map([[cwd, { patterns: globbyPatterns, rawPatterns: [] }]]); + + /* + * This part is a bit involved because we need to account for + * the different ways that the patterns can match directories. + * For each different way, we need to decide if we should look + * for a config file or just use the default config. (Directories + * without a config file always use the default config.) + * + * Here are the cases: + * + * 1. A directory is passed directly (e.g., "subdir"). In this case, we + * can assume that the user intends to lint this directory and we should + * not look for a config file in the parent directory, because the only + * reason to do that would be to ignore this directory (which we already + * know we don't want to do). Instead, we use the default config until we + * get to the directory that was passed, at which point we start looking + * for config files again. + * + * 2. A dot (".") or star ("*"). In this case, we want to read + * the config file in the current directory because the user is + * explicitly asking to lint the current directory. Note that "." + * will traverse into subdirectories while "*" will not. + * + * 3. A directory is passed in the form of "subdir/subsubdir". + * In this case, we don't want to look for a config file in the + * parent directory ("subdir"). We can skip looking for a config + * file until `entry.depth` is greater than 1 because there's no + * way that the pattern can match `entry.path` yet. + * + * 4. A directory glob pattern is passed (e.g., "subd*"). We want + * this case to act like case 2 because it's unclear whether or not + * any particular directory is meant to be traversed. + * + * 5. A recursive glob pattern is passed (e.g., "**"). We want this + * case to act like case 2. + */ + + // check to see if we have explicit files and directories + const filePaths = patterns.map(filePath => path.resolve(cwd, filePath)); + const stats = await Promise.all( + filePaths.map( + filePath => fsp.stat(filePath).catch(() => { }) + ) + ); + + stats.forEach((stat, index) => { + + const filePath = filePaths[index]; + const pattern = normalizeToPosix(patterns[index]); + + if (stat) { + + // files are added directly to the list + if (stat.isFile()) { + results.push(filePath); + } + + // directories need extensions attached + if (stat.isDirectory()) { + + if (!searches.has(filePath)) { + searches.set(filePath, { patterns: [], rawPatterns: [] }); + } + ({ patterns: globbyPatterns, rawPatterns } = searches.get(filePath)); + + globbyPatterns.push(`${normalizeToPosix(filePath)}/**`); + rawPatterns.push(pattern); + } + + return; + } + + // save patterns for later use based on whether globs are enabled + if (globInputPaths && isGlobPattern(pattern)) { + + /* + * We are grouping patterns by their glob parent. This is done to + * make it easier to determine when a config file should be loaded. + */ + + const basePath = path.resolve(cwd, globParent(pattern)); + + if (!searches.has(basePath)) { + searches.set(basePath, { patterns: [], rawPatterns: [] }); + } + ({ patterns: globbyPatterns, rawPatterns } = searches.get(basePath)); + + globbyPatterns.push(filePath); + rawPatterns.push(pattern); + } else { + missingPatterns.push(pattern); + } + }); + + // there were patterns that didn't match anything, tell the user + if (errorOnUnmatchedPattern && missingPatterns.length) { + throw new NoFilesFoundError(missingPatterns[0], globInputPaths); + } + + // now we are safe to do the search + const globbyResults = await globMultiSearch({ + searches, + configLoader, + errorOnUnmatchedPattern + }); + + return [ + ...new Set([ + ...results, + ...globbyResults + ]) + ]; +} + +//----------------------------------------------------------------------------- +// Results-related Helpers +//----------------------------------------------------------------------------- + +/** + * Checks if the given message is an error message. + * @param {LintMessage} message The message to check. + * @returns {boolean} Whether or not the message is an error message. + * @private + */ +function isErrorMessage(message) { + return message.severity === 2; +} + +/** + * Returns result with warning by ignore settings + * @param {string} filePath Absolute file path of checked code + * @param {string} baseDir Absolute path of base directory + * @param {"ignored"|"external"|"unconfigured"} configStatus A status that determines why the file is ignored + * @returns {LintResult} Result with single warning + * @private + */ +function createIgnoreResult(filePath, baseDir, configStatus) { + let message; + + switch (configStatus) { + case "external": + message = "File ignored because outside of base path."; + break; + case "unconfigured": + message = "File ignored because no matching configuration was supplied."; + break; + default: + { + const isInNodeModules = baseDir && path.dirname(path.relative(baseDir, filePath)).split(path.sep).includes("node_modules"); + + if (isInNodeModules) { + message = "File ignored by default because it is located under the node_modules directory. Use ignore pattern \"!**/node_modules/\" to disable file ignore settings or use \"--no-warn-ignored\" to suppress this warning."; + } else { + message = "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to disable file ignore settings or use \"--no-warn-ignored\" to suppress this warning."; + } + } + break; + } + + return { + filePath, + messages: [ + { + ruleId: null, + fatal: false, + severity: 1, + message, + nodeType: null + } + ], + suppressedMessages: [], + errorCount: 0, + warningCount: 1, + fatalErrorCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }; +} + +//----------------------------------------------------------------------------- +// Options-related Helpers +//----------------------------------------------------------------------------- + + +/** + * Check if a given value is a valid fix type or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is valid fix type. + */ +function isFixType(x) { + return x === "directive" || x === "problem" || x === "suggestion" || x === "layout"; +} + +/** + * Check if a given value is an array of fix types or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of fix types. + */ +function isFixTypeArray(x) { + return Array.isArray(x) && x.every(isFixType); +} + +/** + * The error for invalid options. + */ +class ESLintInvalidOptionsError extends Error { + constructor(messages) { + super(`Invalid Options:\n- ${messages.join("\n- ")}`); + this.code = "ESLINT_INVALID_OPTIONS"; + Error.captureStackTrace(this, ESLintInvalidOptionsError); + } +} + +/** + * Validates and normalizes options for the wrapped CLIEngine instance. + * @param {ESLintOptions} options The options to process. + * @throws {ESLintInvalidOptionsError} If of any of a variety of type errors. + * @returns {ESLintOptions} The normalized options. + */ +function processOptions({ + allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored. + baseConfig = null, + cache = false, + cacheLocation = ".eslintcache", + cacheStrategy = "metadata", + cwd = process.cwd(), + errorOnUnmatchedPattern = true, + fix = false, + fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property. + flags = [], + globInputPaths = true, + ignore = true, + ignorePatterns = null, + overrideConfig = null, + overrideConfigFile = null, + plugins = {}, + stats = false, + warnIgnored = true, + passOnNoPatterns = false, + ruleFilter = () => true, + ...unknownOptions +}) { + const errors = []; + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length >= 1) { + errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`); + if (unknownOptionKeys.includes("cacheFile")) { + errors.push("'cacheFile' has been removed. Please use the 'cacheLocation' option instead."); + } + if (unknownOptionKeys.includes("configFile")) { + errors.push("'configFile' has been removed. Please use the 'overrideConfigFile' option instead."); + } + if (unknownOptionKeys.includes("envs")) { + errors.push("'envs' has been removed."); + } + if (unknownOptionKeys.includes("extensions")) { + errors.push("'extensions' has been removed."); + } + if (unknownOptionKeys.includes("resolvePluginsRelativeTo")) { + errors.push("'resolvePluginsRelativeTo' has been removed."); + } + if (unknownOptionKeys.includes("globals")) { + errors.push("'globals' has been removed. Please use the 'overrideConfig.languageOptions.globals' option instead."); + } + if (unknownOptionKeys.includes("ignorePath")) { + errors.push("'ignorePath' has been removed."); + } + if (unknownOptionKeys.includes("ignorePattern")) { + errors.push("'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead."); + } + if (unknownOptionKeys.includes("parser")) { + errors.push("'parser' has been removed. Please use the 'overrideConfig.languageOptions.parser' option instead."); + } + if (unknownOptionKeys.includes("parserOptions")) { + errors.push("'parserOptions' has been removed. Please use the 'overrideConfig.languageOptions.parserOptions' option instead."); + } + if (unknownOptionKeys.includes("rules")) { + errors.push("'rules' has been removed. Please use the 'overrideConfig.rules' option instead."); + } + if (unknownOptionKeys.includes("rulePaths")) { + errors.push("'rulePaths' has been removed. Please define your rules using plugins."); + } + if (unknownOptionKeys.includes("reportUnusedDisableDirectives")) { + errors.push("'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead."); + } + } + if (typeof allowInlineConfig !== "boolean") { + errors.push("'allowInlineConfig' must be a boolean."); + } + if (typeof baseConfig !== "object") { + errors.push("'baseConfig' must be an object or null."); + } + if (typeof cache !== "boolean") { + errors.push("'cache' must be a boolean."); + } + if (!isNonEmptyString(cacheLocation)) { + errors.push("'cacheLocation' must be a non-empty string."); + } + if ( + cacheStrategy !== "metadata" && + cacheStrategy !== "content" + ) { + errors.push("'cacheStrategy' must be any of \"metadata\", \"content\"."); + } + if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) { + errors.push("'cwd' must be an absolute path."); + } + if (typeof errorOnUnmatchedPattern !== "boolean") { + errors.push("'errorOnUnmatchedPattern' must be a boolean."); + } + if (typeof fix !== "boolean" && typeof fix !== "function") { + errors.push("'fix' must be a boolean or a function."); + } + if (fixTypes !== null && !isFixTypeArray(fixTypes)) { + errors.push("'fixTypes' must be an array of any of \"directive\", \"problem\", \"suggestion\", and \"layout\"."); + } + if (!isEmptyArrayOrArrayOfNonEmptyString(flags)) { + errors.push("'flags' must be an array of non-empty strings."); + } + if (typeof globInputPaths !== "boolean") { + errors.push("'globInputPaths' must be a boolean."); + } + if (typeof ignore !== "boolean") { + errors.push("'ignore' must be a boolean."); + } + if (!isEmptyArrayOrArrayOfNonEmptyString(ignorePatterns) && ignorePatterns !== null) { + errors.push("'ignorePatterns' must be an array of non-empty strings or null."); + } + if (typeof overrideConfig !== "object") { + errors.push("'overrideConfig' must be an object or null."); + } + if (!isNonEmptyString(overrideConfigFile) && overrideConfigFile !== null && overrideConfigFile !== true) { + errors.push("'overrideConfigFile' must be a non-empty string, null, or true."); + } + if (typeof passOnNoPatterns !== "boolean") { + errors.push("'passOnNoPatterns' must be a boolean."); + } + if (typeof plugins !== "object") { + errors.push("'plugins' must be an object or null."); + } else if (plugins !== null && Object.keys(plugins).includes("")) { + errors.push("'plugins' must not include an empty string."); + } + if (Array.isArray(plugins)) { + errors.push("'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead."); + } + if (typeof stats !== "boolean") { + errors.push("'stats' must be a boolean."); + } + if (typeof warnIgnored !== "boolean") { + errors.push("'warnIgnored' must be a boolean."); + } + if (typeof ruleFilter !== "function") { + errors.push("'ruleFilter' must be a function."); + } + if (errors.length > 0) { + throw new ESLintInvalidOptionsError(errors); + } + + return { + allowInlineConfig, + baseConfig, + cache, + cacheLocation, + cacheStrategy, + + // when overrideConfigFile is true that means don't do config file lookup + configFile: overrideConfigFile === true ? false : overrideConfigFile, + overrideConfig, + cwd: path.normalize(cwd), + errorOnUnmatchedPattern, + fix, + fixTypes, + flags: [...flags], + globInputPaths, + ignore, + ignorePatterns, + stats, + passOnNoPatterns, + warnIgnored, + ruleFilter + }; +} + + +//----------------------------------------------------------------------------- +// Cache-related helpers +//----------------------------------------------------------------------------- + +/** + * return the cacheFile to be used by eslint, based on whether the provided parameter is + * a directory or looks like a directory (ends in `path.sep`), in which case the file + * name will be the `cacheFile/.cache_hashOfCWD` + * + * if cacheFile points to a file or looks like a file then in will just use that file + * @param {string} cacheFile The name of file to be used to store the cache + * @param {string} cwd Current working directory + * @returns {string} the resolved path to the cache file + */ +function getCacheFile(cacheFile, cwd) { + + /* + * make sure the path separators are normalized for the environment/os + * keeping the trailing path separator if present + */ + const normalizedCacheFile = path.normalize(cacheFile); + + const resolvedCacheFile = path.resolve(cwd, normalizedCacheFile); + const looksLikeADirectory = normalizedCacheFile.slice(-1) === path.sep; + + /** + * return the name for the cache file in case the provided parameter is a directory + * @returns {string} the resolved path to the cacheFile + */ + function getCacheFileForDirectory() { + return path.join(resolvedCacheFile, `.cache_${hash(cwd)}`); + } + + let fileStats; + + try { + fileStats = fs.lstatSync(resolvedCacheFile); + } catch { + fileStats = null; + } + + + /* + * in case the file exists we need to verify if the provided path + * is a directory or a file. If it is a directory we want to create a file + * inside that directory + */ + if (fileStats) { + + /* + * is a directory or is a file, but the original file the user provided + * looks like a directory but `path.resolve` removed the `last path.sep` + * so we need to still treat this like a directory + */ + if (fileStats.isDirectory() || looksLikeADirectory) { + return getCacheFileForDirectory(); + } + + // is file so just use that file + return resolvedCacheFile; + } + + /* + * here we known the file or directory doesn't exist, + * so we will try to infer if its a directory if it looks like a directory + * for the current operating system. + */ + + // if the last character passed is a path separator we assume is a directory + if (looksLikeADirectory) { + return getCacheFileForDirectory(); + } + + return resolvedCacheFile; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + findFiles, + + isNonEmptyString, + isArrayOfNonEmptyString, + + createIgnoreResult, + isErrorMessage, + + processOptions, + + getCacheFile +}; diff --git a/node_modules/eslint/lib/eslint/eslint.js b/node_modules/eslint/lib/eslint/eslint.js new file mode 100644 index 0000000..7661faf --- /dev/null +++ b/node_modules/eslint/lib/eslint/eslint.js @@ -0,0 +1,1124 @@ +/** + * @fileoverview Main class using flat config + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("node:fs/promises"); +const { existsSync } = require("node:fs"); +const path = require("node:path"); +const { version } = require("../../package.json"); +const { Linter } = require("../linter"); +const { getRuleFromConfig } = require("../config/flat-config-helpers"); +const { defaultConfig } = require("../config/default-config"); +const { + Legacy: { + ConfigOps: { + getRuleSeverity + }, + ModuleResolver, + naming + } +} = require("@eslint/eslintrc"); + +const { + findFiles, + getCacheFile, + + isNonEmptyString, + isArrayOfNonEmptyString, + + createIgnoreResult, + isErrorMessage, + + processOptions +} = require("./eslint-helpers"); +const { pathToFileURL } = require("node:url"); +const LintResultCache = require("../cli-engine/lint-result-cache"); +const { Retrier } = require("@humanwhocodes/retry"); +const { ConfigLoader, LegacyConfigLoader } = require("../config/config-loader"); + +/* + * This is necessary to allow overwriting writeFile for testing purposes. + * We can just use fs/promises once we drop Node.js 12 support. + */ + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +// For VSCode IntelliSense +/** @typedef {import("../cli-engine/cli-engine").ConfigArray} ConfigArray */ +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").LintResult} LintResult */ +/** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("../shared/types").ResultsMeta} ResultsMeta */ +/** @typedef {import("../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {ReturnType} ExtractedConfig */ +/** @typedef {import('../cli-engine/cli-engine').CLIEngine} CLIEngine */ +/** @typedef {import('./legacy-eslint').CLIEngineLintReport} CLIEngineLintReport */ + +/** + * The options with which to configure the ESLint instance. + * @typedef {Object} ESLintOptions + * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments. + * @property {ConfigData|Array} [baseConfig] Base config, extended by all configs used with this instance + * @property {boolean} [cache] Enable result caching. + * @property {string} [cacheLocation] The cache file to use instead of .eslintcache. + * @property {"metadata" | "content"} [cacheStrategy] The strategy used to detect changed files. + * @property {string} [cwd] The value to use for the current working directory. + * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`. + * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean. + * @property {string[]} [fixTypes] Array of rule types to apply fixes for. + * @property {string[]} [flags] Array of feature flags to enable. + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} [ignore] False disables all ignore patterns except for the default ones. + * @property {string[]} [ignorePatterns] Ignore file patterns to use in addition to config ignores. These patterns are relative to `cwd`. + * @property {ConfigData|Array} [overrideConfig] Override config, overrides all configs used with this instance + * @property {boolean|string} [overrideConfigFile] Searches for default config file when falsy; + * doesn't do any config file lookup when `true`; considered to be a config filename + * when a string. + * @property {Record} [plugins] An array of plugin implementations. + * @property {boolean} [stats] True enables added statistics on lint results. + * @property {boolean} [warnIgnored] Show warnings when the file list includes ignored files + * @property {boolean} [passOnNoPatterns=false] When set to true, missing patterns cause + * the linting operation to short circuit and not report any failures. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:eslint"); +const privateMembers = new WeakMap(); +const removedFormatters = new Set([ + "checkstyle", + "codeframe", + "compact", + "jslint-xml", + "junit", + "table", + "tap", + "unix", + "visualstudio" +]); + +/** + * It will calculate the error and warning count for collection of messages per file + * @param {LintMessage[]} messages Collection of messages + * @returns {Object} Contains the stats + * @private + */ +function calculateStatsPerFile(messages) { + const stat = { + errorCount: 0, + fatalErrorCount: 0, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }; + + for (let i = 0; i < messages.length; i++) { + const message = messages[i]; + + if (message.fatal || message.severity === 2) { + stat.errorCount++; + if (message.fatal) { + stat.fatalErrorCount++; + } + if (message.fix) { + stat.fixableErrorCount++; + } + } else { + stat.warningCount++; + if (message.fix) { + stat.fixableWarningCount++; + } + } + } + return stat; +} + +/** + * Create rulesMeta object. + * @param {Map} rules a map of rules from which to generate the object. + * @returns {Object} metadata for all enabled rules. + */ +function createRulesMeta(rules) { + return Array.from(rules).reduce((retVal, [id, rule]) => { + retVal[id] = rule.meta; + return retVal; + }, {}); +} + +/** + * Return the absolute path of a file named `"__placeholder__.js"` in a given directory. + * This is used as a replacement for a missing file path. + * @param {string} cwd An absolute directory path. + * @returns {string} The absolute path of a file named `"__placeholder__.js"` in the given directory. + */ +function getPlaceholderPath(cwd) { + return path.join(cwd, "__placeholder__.js"); +} + +/** @type {WeakMap} */ +const usedDeprecatedRulesCache = new WeakMap(); + +/** + * Create used deprecated rule list. + * @param {CLIEngine} eslint The CLIEngine instance. + * @param {string} maybeFilePath The absolute path to a lint target file or `""`. + * @returns {DeprecatedRuleInfo[]} The used deprecated rule list. + */ +function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) { + const { + options: { cwd }, + configLoader + } = privateMembers.get(eslint); + const filePath = path.isAbsolute(maybeFilePath) + ? maybeFilePath + : getPlaceholderPath(cwd); + const configs = configLoader.getCachedConfigArrayForFile(filePath); + const config = configs.getConfig(filePath); + + // Most files use the same config, so cache it. + if (config && !usedDeprecatedRulesCache.has(config)) { + const retv = []; + + if (config.rules) { + for (const [ruleId, ruleConf] of Object.entries(config.rules)) { + if (getRuleSeverity(ruleConf) === 0) { + continue; + } + const rule = getRuleFromConfig(ruleId, config); + const meta = rule && rule.meta; + + if (meta && meta.deprecated) { + const usesNewFormat = typeof meta.deprecated === "object"; + + retv.push({ + ruleId, + replacedBy: usesNewFormat ? meta.deprecated.replacedBy?.map(replacement => `${replacement.plugin?.name !== void 0 ? `${naming.getShorthandName(replacement.plugin.name, "eslint-plugin")}/` : ""}${replacement.rule?.name ?? ""}`) ?? [] : meta.replacedBy || [], + info: usesNewFormat ? meta.deprecated : void 0 + }); + } + } + } + + + usedDeprecatedRulesCache.set(config, Object.freeze(retv)); + } + + return config ? usedDeprecatedRulesCache.get(config) : Object.freeze([]); +} + +/** + * Processes the linting results generated by a CLIEngine linting report to + * match the ESLint class's API. + * @param {CLIEngine} eslint The CLIEngine instance. + * @param {CLIEngineLintReport} report The CLIEngine linting report to process. + * @returns {LintResult[]} The processed linting results. + */ +function processLintReport(eslint, { results }) { + const descriptor = { + configurable: true, + enumerable: true, + get() { + return getOrFindUsedDeprecatedRules(eslint, this.filePath); + } + }; + + for (const result of results) { + Object.defineProperty(result, "usedDeprecatedRules", descriptor); + } + + return results; +} + +/** + * An Array.prototype.sort() compatible compare function to order results by their file path. + * @param {LintResult} a The first lint result. + * @param {LintResult} b The second lint result. + * @returns {number} An integer representing the order in which the two results should occur. + */ +function compareResultsByFilePath(a, b) { + if (a.filePath < b.filePath) { + return -1; + } + + if (a.filePath > b.filePath) { + return 1; + } + + return 0; +} + + +/** + * Determines which config file to use. This is determined by seeing if an + * override config file was passed, and if so, using it; otherwise, as long + * as override config file is not explicitly set to `false`, it will search + * upwards from the cwd for a file named `eslint.config.js`. + * + * This function is used primarily by the `--inspect-config` option. For now, + * we will maintain the existing behavior, which is to search up from the cwd. + * @param {ESLintOptions} options The ESLint instance options. + * @returns {Promise<{configFilePath:string|undefined;basePath:string}>} Location information for + * the config file. + */ +async function locateConfigFileToUse({ configFile, cwd }) { + + const configLoader = new ConfigLoader({ + cwd, + configFile + }); + + const configFilePath = await configLoader.findConfigFileForPath(path.join(cwd, "__placeholder__.js")); + + if (!configFilePath) { + throw new Error("No ESLint configuration file was found."); + } + + return { + configFilePath, + basePath: configFile ? cwd : path.dirname(configFilePath) + }; +} + +/** + * Processes an source code using ESLint. + * @param {Object} config The config object. + * @param {string} config.text The source code to verify. + * @param {string} config.cwd The path to the current working directory. + * @param {string|undefined} config.filePath The path to the file of `text`. If this is undefined, it uses ``. + * @param {FlatConfigArray} config.configs The config. + * @param {boolean} config.fix If `true` then it does fix. + * @param {boolean} config.allowInlineConfig If `true` then it uses directive comments. + * @param {Function} config.ruleFilter A predicate function to filter which rules should be run. + * @param {boolean} config.stats If `true`, then if reports extra statistics with the lint results. + * @param {Linter} config.linter The linter instance to verify. + * @returns {LintResult} The result of linting. + * @private + */ +function verifyText({ + text, + cwd, + filePath: providedFilePath, + configs, + fix, + allowInlineConfig, + ruleFilter, + stats, + linter +}) { + const filePath = providedFilePath || ""; + + debug(`Lint ${filePath}`); + + /* + * Verify. + * `config.extractConfig(filePath)` requires an absolute path, but `linter` + * doesn't know CWD, so it gives `linter` an absolute path always. + */ + const filePathToVerify = filePath === "" ? getPlaceholderPath(cwd) : filePath; + const { fixed, messages, output } = linter.verifyAndFix( + text, + configs, + { + allowInlineConfig, + filename: filePathToVerify, + fix, + ruleFilter, + stats, + + /** + * Check if the linter should adopt a given code block or not. + * @param {string} blockFilename The virtual filename of a code block. + * @returns {boolean} `true` if the linter should adopt the code block. + */ + filterCodeBlock(blockFilename) { + return configs.getConfig(blockFilename) !== void 0; + } + } + ); + + // Tweak and return. + const result = { + filePath: filePath === "" ? filePath : path.resolve(filePath), + messages, + suppressedMessages: linter.getSuppressedMessages(), + ...calculateStatsPerFile(messages) + }; + + if (fixed) { + result.output = output; + } + + if ( + result.errorCount + result.warningCount > 0 && + typeof result.output === "undefined" + ) { + result.source = text; + } + + if (stats) { + result.stats = { + times: linter.getTimes(), + fixPasses: linter.getFixPassCount() + }; + } + + return result; +} + +/** + * Checks whether a message's rule type should be fixed. + * @param {LintMessage} message The message to check. + * @param {FlatConfig} config The config for the file that generated the message. + * @param {string[]} fixTypes An array of fix types to check. + * @returns {boolean} Whether the message should be fixed. + */ +function shouldMessageBeFixed(message, config, fixTypes) { + if (!message.ruleId) { + return fixTypes.has("directive"); + } + + const rule = message.ruleId && getRuleFromConfig(message.ruleId, config); + + return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type)); +} + +/** + * Creates an error to be thrown when an array of results passed to `getRulesMetaForResults` was not created by the current engine. + * @returns {TypeError} An error object. + */ +function createExtraneousResultsError() { + return new TypeError("Results object was not created from this ESLint instance."); +} + +/** + * Creates a fixer function based on the provided fix, fixTypesSet, and config. + * @param {Function|boolean} fix The original fix option. + * @param {Set} fixTypesSet A set of fix types to filter messages for fixing. + * @param {FlatConfig} config The config for the file that generated the message. + * @returns {Function|boolean} The fixer function or the original fix value. + */ +function getFixerForFixTypes(fix, fixTypesSet, config) { + if (!fix || !fixTypesSet) { + return fix; + } + + const originalFix = (typeof fix === "function") ? fix : () => true; + + return message => shouldMessageBeFixed(message, config, fixTypesSet) && originalFix(message); +} + +//----------------------------------------------------------------------------- +// Main API +//----------------------------------------------------------------------------- + +/** + * Primary Node.js API for ESLint. + */ +class ESLint { + + /** + * The type of configuration used by this class. + * @type {string} + */ + static configType = "flat"; + + /** + * The loader to use for finding config files. + * @type {ConfigLoader|LegacyConfigLoader} + */ + #configLoader; + + /** + * Creates a new instance of the main ESLint API. + * @param {ESLintOptions} options The options for this instance. + */ + constructor(options = {}) { + + const defaultConfigs = []; + const processedOptions = processOptions(options); + const linter = new Linter({ + cwd: processedOptions.cwd, + configType: "flat", + flags: processedOptions.flags + }); + + const cacheFilePath = getCacheFile( + processedOptions.cacheLocation, + processedOptions.cwd + ); + + const lintResultCache = processedOptions.cache + ? new LintResultCache(cacheFilePath, processedOptions.cacheStrategy) + : null; + + const configLoaderOptions = { + cwd: processedOptions.cwd, + baseConfig: processedOptions.baseConfig, + overrideConfig: processedOptions.overrideConfig, + configFile: processedOptions.configFile, + ignoreEnabled: processedOptions.ignore, + ignorePatterns: processedOptions.ignorePatterns, + defaultConfigs + }; + + this.#configLoader = linter.hasFlag("unstable_config_lookup_from_file") + ? new ConfigLoader(configLoaderOptions) + : new LegacyConfigLoader(configLoaderOptions); + + debug(`Using config loader ${this.#configLoader.constructor.name}`); + + privateMembers.set(this, { + options: processedOptions, + linter, + cacheFilePath, + lintResultCache, + defaultConfigs, + configs: null, + configLoader: this.#configLoader + }); + + + /** + * If additional plugins are passed in, add that to the default + * configs for this instance. + */ + if (options.plugins) { + + const plugins = {}; + + for (const [pluginName, plugin] of Object.entries(options.plugins)) { + plugins[naming.getShorthandName(pluginName, "eslint-plugin")] = plugin; + } + + defaultConfigs.push({ + plugins + }); + } + + // Check for the .eslintignore file, and warn if it's present. + if (existsSync(path.resolve(processedOptions.cwd, ".eslintignore"))) { + process.emitWarning( + "The \".eslintignore\" file is no longer supported. Switch to using the \"ignores\" property in \"eslint.config.js\": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files", + "ESLintIgnoreWarning" + ); + } + } + + /** + * The version text. + * @type {string} + */ + static get version() { + return version; + } + + /** + * The default configuration that ESLint uses internally. This is provided for tooling that wants to calculate configurations using the same defaults as ESLint. + * Keep in mind that the default configuration may change from version to version, so you shouldn't rely on any particular keys or values to be present. + * @type {ConfigArray} + */ + static get defaultConfig() { + return defaultConfig; + } + + /** + * Outputs fixes from the given results to files. + * @param {LintResult[]} results The lint results. + * @returns {Promise} Returns a promise that is used to track side effects. + */ + static async outputFixes(results) { + if (!Array.isArray(results)) { + throw new Error("'results' must be an array"); + } + + await Promise.all( + results + .filter(result => { + if (typeof result !== "object" || result === null) { + throw new Error("'results' must include only objects"); + } + return ( + typeof result.output === "string" && + path.isAbsolute(result.filePath) + ); + }) + .map(r => fs.writeFile(r.filePath, r.output)) + ); + } + + /** + * Returns results that only contains errors. + * @param {LintResult[]} results The results to filter. + * @returns {LintResult[]} The filtered results. + */ + static getErrorResults(results) { + const filtered = []; + + results.forEach(result => { + const filteredMessages = result.messages.filter(isErrorMessage); + const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage); + + if (filteredMessages.length > 0) { + filtered.push({ + ...result, + messages: filteredMessages, + suppressedMessages: filteredSuppressedMessages, + errorCount: filteredMessages.length, + warningCount: 0, + fixableErrorCount: result.fixableErrorCount, + fixableWarningCount: 0 + }); + } + }); + + return filtered; + } + + /** + * Returns meta objects for each rule represented in the lint results. + * @param {LintResult[]} results The results to fetch rules meta for. + * @returns {Object} A mapping of ruleIds to rule meta objects. + * @throws {TypeError} When the results object wasn't created from this ESLint instance. + * @throws {TypeError} When a plugin or rule is missing. + */ + getRulesMetaForResults(results) { + + // short-circuit simple case + if (results.length === 0) { + return {}; + } + + const resultRules = new Map(); + const { + configLoader, + options: { cwd } + } = privateMembers.get(this); + + for (const result of results) { + + /* + * Normalize filename for . + */ + const filePath = result.filePath === "" + ? getPlaceholderPath(cwd) : result.filePath; + const allMessages = result.messages.concat(result.suppressedMessages); + + for (const { ruleId } of allMessages) { + if (!ruleId) { + continue; + } + + /* + * All of the plugin and rule information is contained within the + * calculated config for the given file. + */ + let configs; + + try { + configs = configLoader.getCachedConfigArrayForFile(filePath); + } catch { + throw createExtraneousResultsError(); + } + + const config = configs.getConfig(filePath); + + if (!config) { + throw createExtraneousResultsError(); + } + const rule = getRuleFromConfig(ruleId, config); + + // ignore unknown rules + if (rule) { + resultRules.set(ruleId, rule); + } + } + } + + return createRulesMeta(resultRules); + } + + /** + * Indicates if the given feature flag is enabled for this instance. + * @param {string} flag The feature flag to check. + * @returns {boolean} `true` if the feature flag is enabled, `false` if not. + */ + hasFlag(flag) { + + // note: Linter does validation of the flags + return privateMembers.get(this).linter.hasFlag(flag); + } + + /** + * Executes the current configuration on an array of file and directory names. + * @param {string|string[]} patterns An array of file and directory names. + * @returns {Promise} The results of linting the file patterns given. + */ + async lintFiles(patterns) { + + let normalizedPatterns = patterns; + const { + cacheFilePath, + lintResultCache, + linter, + options: eslintOptions + } = privateMembers.get(this); + + /* + * Special cases: + * 1. `patterns` is an empty string + * 2. `patterns` is an empty array + * + * In both cases, we use the cwd as the directory to lint. + */ + if (patterns === "" || Array.isArray(patterns) && patterns.length === 0) { + + /* + * Special case: If `passOnNoPatterns` is true, then we just exit + * without doing any work. + */ + if (eslintOptions.passOnNoPatterns) { + return []; + } + + normalizedPatterns = ["."]; + } else { + + if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) { + throw new Error("'patterns' must be a non-empty string or an array of non-empty strings"); + } + + if (typeof patterns === "string") { + normalizedPatterns = [patterns]; + } + } + + debug(`Using file patterns: ${normalizedPatterns}`); + + const { + allowInlineConfig, + cache, + cwd, + fix, + fixTypes, + ruleFilter, + stats, + globInputPaths, + errorOnUnmatchedPattern, + warnIgnored + } = eslintOptions; + const startTime = Date.now(); + const fixTypesSet = fixTypes ? new Set(fixTypes) : null; + + // Delete cache file; should this be done here? + if (!cache && cacheFilePath) { + debug(`Deleting cache file at ${cacheFilePath}`); + + try { + await fs.unlink(cacheFilePath); + } catch (error) { + const errorCode = error && error.code; + + // Ignore errors when no such file exists or file system is read only (and cache file does not exist) + if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !existsSync(cacheFilePath))) { + throw error; + } + } + } + + const filePaths = await findFiles({ + patterns: normalizedPatterns, + cwd, + globInputPaths, + configLoader: this.#configLoader, + errorOnUnmatchedPattern + }); + const controller = new AbortController(); + const retryCodes = new Set(["ENFILE", "EMFILE"]); + const retrier = new Retrier(error => retryCodes.has(error.code), { concurrency: 100 }); + + debug(`${filePaths.length} files found in: ${Date.now() - startTime}ms`); + + /* + * Because we need to process multiple files, including reading from disk, + * it is most efficient to start by reading each file via promises so that + * they can be done in parallel. Then, we can lint the returned text. This + * ensures we are waiting the minimum amount of time in between lints. + */ + const results = await Promise.all( + + filePaths.map(async filePath => { + + const configs = await this.#configLoader.loadConfigArrayForFile(filePath); + const config = configs.getConfig(filePath); + + /* + * If a filename was entered that cannot be matched + * to a config, then notify the user. + */ + if (!config) { + if (warnIgnored) { + const configStatus = configs.getConfigStatus(filePath); + + return createIgnoreResult(filePath, cwd, configStatus); + } + + return void 0; + } + + // Skip if there is cached result. + if (lintResultCache) { + const cachedResult = + lintResultCache.getCachedLintResults(filePath, config); + + if (cachedResult) { + const hadMessages = + cachedResult.messages && + cachedResult.messages.length > 0; + + if (hadMessages && fix) { + debug(`Reprocessing cached file to allow autofix: ${filePath}`); + } else { + debug(`Skipping file since it hasn't changed: ${filePath}`); + return cachedResult; + } + } + } + + + // set up fixer for fixTypes if necessary + const fixer = getFixerForFixTypes(fix, fixTypesSet, config); + + return retrier.retry(() => fs.readFile(filePath, { encoding: "utf8", signal: controller.signal }) + .then(text => { + + // fail immediately if an error occurred in another file + controller.signal.throwIfAborted(); + + // do the linting + const result = verifyText({ + text, + filePath, + configs, + cwd, + fix: fixer, + allowInlineConfig, + ruleFilter, + stats, + linter + }); + + /* + * Store the lint result in the LintResultCache. + * NOTE: The LintResultCache will remove the file source and any + * other properties that are difficult to serialize, and will + * hydrate those properties back in on future lint runs. + */ + if (lintResultCache) { + lintResultCache.setCachedLintResults(filePath, config, result); + } + + return result; + }), { signal: controller.signal }) + .catch(error => { + controller.abort(error); + throw error; + }); + }) + ); + + // Persist the cache to disk. + if (lintResultCache) { + lintResultCache.reconcile(); + } + + const finalResults = results.filter(result => !!result); + + return processLintReport(this, { + results: finalResults + }); + } + + /** + * Executes the current configuration on text. + * @param {string} code A string of JavaScript code to lint. + * @param {Object} [options] The options. + * @param {string} [options.filePath] The path to the file of the source code. + * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path. + * @returns {Promise} The results of linting the string of code given. + */ + async lintText(code, options = {}) { + + // Parameter validation + + if (typeof code !== "string") { + throw new Error("'code' must be a string"); + } + + if (typeof options !== "object") { + throw new Error("'options' must be an object, null, or undefined"); + } + + // Options validation + + const { + filePath, + warnIgnored, + ...unknownOptions + } = options || {}; + + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length > 0) { + throw new Error(`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`); + } + + if (filePath !== void 0 && !isNonEmptyString(filePath)) { + throw new Error("'options.filePath' must be a non-empty string or undefined"); + } + + if (typeof warnIgnored !== "boolean" && typeof warnIgnored !== "undefined") { + throw new Error("'options.warnIgnored' must be a boolean or undefined"); + } + + // Now we can get down to linting + + const { + linter, + options: eslintOptions + } = privateMembers.get(this); + const { + allowInlineConfig, + cwd, + fix, + fixTypes, + warnIgnored: constructorWarnIgnored, + ruleFilter, + stats + } = eslintOptions; + const results = []; + const startTime = Date.now(); + const fixTypesSet = fixTypes ? new Set(fixTypes) : null; + const resolvedFilename = path.resolve(cwd, filePath || "__placeholder__.js"); + const configs = await this.#configLoader.loadConfigArrayForFile(resolvedFilename); + const configStatus = configs?.getConfigStatus(resolvedFilename) ?? "unconfigured"; + + // Clear the last used config arrays. + if (resolvedFilename && configStatus !== "matched") { + const shouldWarnIgnored = typeof warnIgnored === "boolean" ? warnIgnored : constructorWarnIgnored; + + if (shouldWarnIgnored) { + results.push(createIgnoreResult(resolvedFilename, cwd, configStatus)); + } + } else { + + const config = configs.getConfig(resolvedFilename); + const fixer = getFixerForFixTypes(fix, fixTypesSet, config); + + // Do lint. + results.push(verifyText({ + text: code, + filePath: resolvedFilename.endsWith("__placeholder__.js") ? "" : resolvedFilename, + configs, + cwd, + fix: fixer, + allowInlineConfig, + ruleFilter, + stats, + linter + })); + } + + debug(`Linting complete in: ${Date.now() - startTime}ms`); + + return processLintReport(this, { + results + }); + + } + + /** + * Returns the formatter representing the given formatter name. + * @param {string} [name] The name of the formatter to load. + * The following values are allowed: + * - `undefined` ... Load `stylish` builtin formatter. + * - A builtin formatter name ... Load the builtin formatter. + * - A third-party formatter name: + * - `foo` → `eslint-formatter-foo` + * - `@foo` → `@foo/eslint-formatter` + * - `@foo/bar` → `@foo/eslint-formatter-bar` + * - A file path ... Load the file. + * @returns {Promise} A promise resolving to the formatter object. + * This promise will be rejected if the given formatter was not found or not + * a function. + */ + async loadFormatter(name = "stylish") { + if (typeof name !== "string") { + throw new Error("'name' must be a string"); + } + + // replace \ with / for Windows compatibility + const normalizedFormatName = name.replace(/\\/gu, "/"); + const namespace = naming.getNamespaceFromTerm(normalizedFormatName); + + // grab our options + const { cwd } = privateMembers.get(this).options; + + + let formatterPath; + + // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) + if (!namespace && normalizedFormatName.includes("/")) { + formatterPath = path.resolve(cwd, normalizedFormatName); + } else { + try { + const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter"); + + // TODO: This is pretty dirty...would be nice to clean up at some point. + formatterPath = ModuleResolver.resolve(npmFormat, getPlaceholderPath(cwd)); + } catch { + formatterPath = path.resolve(__dirname, "../", "cli-engine", "formatters", `${normalizedFormatName}.js`); + } + } + + let formatter; + + try { + formatter = (await import(pathToFileURL(formatterPath))).default; + } catch (ex) { + + // check for formatters that have been removed + if (removedFormatters.has(name)) { + ex.message = `The ${name} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${name}\``; + } else { + ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; + } + + throw ex; + } + + + if (typeof formatter !== "function") { + throw new TypeError(`Formatter must be a function, but got a ${typeof formatter}.`); + } + + const eslint = this; + + return { + + /** + * The main formatter method. + * @param {LintResult[]} results The lint results to format. + * @param {ResultsMeta} resultsMeta Warning count and max threshold. + * @returns {string} The formatted lint results. + */ + format(results, resultsMeta) { + let rulesMeta = null; + + results.sort(compareResultsByFilePath); + + return formatter(results, { + ...resultsMeta, + cwd, + get rulesMeta() { + if (!rulesMeta) { + rulesMeta = eslint.getRulesMetaForResults(results); + } + + return rulesMeta; + } + }); + } + }; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file to retrieve a config object for. + * @returns {Promise} A configuration object for the file + * or `undefined` if there is no configuration data for the object. + */ + async calculateConfigForFile(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const options = privateMembers.get(this).options; + const absolutePath = path.resolve(options.cwd, filePath); + const configs = await this.#configLoader.loadConfigArrayForFile(absolutePath); + + if (!configs) { + const error = new Error("Could not find config file."); + + error.messageTemplate = "config-file-missing"; + throw error; + } + + return configs.getConfig(absolutePath); + } + + /** + * Finds the config file being used by this instance based on the options + * passed to the constructor. + * @param {string} [filePath] The path of the file to find the config file for. + * @returns {Promise} The path to the config file being used or + * `undefined` if no config file is being used. + */ + findConfigFile(filePath) { + const options = privateMembers.get(this).options; + + /* + * Because the new config lookup scheme skips the current directory + * and looks into the parent directories, we need to use a placeholder + * directory to ensure the file in cwd is checked. + */ + const fakeCwd = path.join(options.cwd, "__placeholder__"); + + return this.#configLoader.findConfigFileForPath(filePath ?? fakeCwd) + .catch(() => void 0); + } + + /** + * Checks if a given path is ignored by ESLint. + * @param {string} filePath The path of the file to check. + * @returns {Promise} Whether or not the given path is ignored. + */ + async isPathIgnored(filePath) { + const config = await this.calculateConfigForFile(filePath); + + return config === void 0; + } +} + +/** + * Returns whether flat config should be used. + * @returns {Promise} Whether flat config should be used. + */ +async function shouldUseFlatConfig() { + return (process.env.ESLINT_USE_FLAT_CONFIG !== "false"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + ESLint, + shouldUseFlatConfig, + locateConfigFileToUse +}; diff --git a/node_modules/eslint/lib/eslint/index.js b/node_modules/eslint/lib/eslint/index.js new file mode 100644 index 0000000..b7c52a4 --- /dev/null +++ b/node_modules/eslint/lib/eslint/index.js @@ -0,0 +1,9 @@ +"use strict"; + +const { ESLint } = require("./eslint"); +const { LegacyESLint } = require("./legacy-eslint"); + +module.exports = { + ESLint, + LegacyESLint +}; diff --git a/node_modules/eslint/lib/eslint/legacy-eslint.js b/node_modules/eslint/lib/eslint/legacy-eslint.js new file mode 100644 index 0000000..f282e58 --- /dev/null +++ b/node_modules/eslint/lib/eslint/legacy-eslint.js @@ -0,0 +1,742 @@ +/** + * @fileoverview Main API Class + * @author Kai Cataldo + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("node:path"); +const fs = require("node:fs"); +const { promisify } = require("node:util"); +const { CLIEngine, getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); +const BuiltinRules = require("../rules"); +const { + Legacy: { + ConfigOps: { + getRuleSeverity + } + } +} = require("@eslint/eslintrc"); +const { version } = require("../../package.json"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../cli-engine/cli-engine").LintReport} CLIEngineLintReport */ +/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {import("../shared/types").LintResult} LintResult */ +/** @typedef {import("../shared/types").ResultsMeta} ResultsMeta */ + +/** + * The main formatter object. + * @typedef LoadedFormatter + * @property {(results: LintResult[], resultsMeta: ResultsMeta) => string | Promise} format format function. + */ + +/** + * The options with which to configure the LegacyESLint instance. + * @typedef {Object} LegacyESLintOptions + * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments. + * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this instance + * @property {boolean} [cache] Enable result caching. + * @property {string} [cacheLocation] The cache file to use instead of .eslintcache. + * @property {"metadata" | "content"} [cacheStrategy] The strategy used to detect changed files. + * @property {string} [cwd] The value to use for the current working directory. + * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`. + * @property {string[]} [extensions] An array of file extensions to check. + * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean. + * @property {string[]} [fixTypes] Array of rule types to apply fixes for. + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} [ignore] False disables use of .eslintignore. + * @property {string} [ignorePath] The ignore file to use instead of .eslintignore. + * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance + * @property {string} [overrideConfigFile] The configuration file to use. + * @property {Record|null} [plugins] Preloaded plugins. This is a map-like object, keys are plugin IDs and each value is implementation. + * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives. + * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD. + * @property {string[]} [rulePaths] An array of directories to load custom rules from. + * @property {boolean} [useEslintrc] False disables looking for .eslintrc.* files. + * @property {boolean} [passOnNoPatterns=false] When set to true, missing patterns cause + * the linting operation to short circuit and not report any failures. + */ + +/** + * A rules metadata object. + * @typedef {Object} RulesMeta + * @property {string} id The plugin ID. + * @property {Object} definition The plugin definition. + */ + +/** + * Private members for the `ESLint` instance. + * @typedef {Object} ESLintPrivateMembers + * @property {CLIEngine} cliEngine The wrapped CLIEngine instance. + * @property {LegacyESLintOptions} options The options used to instantiate the ESLint instance. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const writeFile = promisify(fs.writeFile); + +/** + * The map with which to store private class members. + * @type {WeakMap} + */ +const privateMembersMap = new WeakMap(); + +/** + * Check if a given value is a non-empty string or not. + * @param {any} value The value to check. + * @returns {boolean} `true` if `value` is a non-empty string. + */ +function isNonEmptyString(value) { + return typeof value === "string" && value.trim() !== ""; +} + +/** + * Check if a given value is an array of non-empty strings or not. + * @param {any} value The value to check. + * @returns {boolean} `true` if `value` is an array of non-empty strings. + */ +function isArrayOfNonEmptyString(value) { + return Array.isArray(value) && value.length && value.every(isNonEmptyString); +} + +/** + * Check if a given value is an empty array or an array of non-empty strings. + * @param {any} value The value to check. + * @returns {boolean} `true` if `value` is an empty array or an array of non-empty + * strings. + */ +function isEmptyArrayOrArrayOfNonEmptyString(value) { + return Array.isArray(value) && value.every(isNonEmptyString); +} + +/** + * Check if a given value is a valid fix type or not. + * @param {any} value The value to check. + * @returns {boolean} `true` if `value` is valid fix type. + */ +function isFixType(value) { + return value === "directive" || value === "problem" || value === "suggestion" || value === "layout"; +} + +/** + * Check if a given value is an array of fix types or not. + * @param {any} value The value to check. + * @returns {boolean} `true` if `value` is an array of fix types. + */ +function isFixTypeArray(value) { + return Array.isArray(value) && value.every(isFixType); +} + +/** + * The error for invalid options. + */ +class ESLintInvalidOptionsError extends Error { + constructor(messages) { + super(`Invalid Options:\n- ${messages.join("\n- ")}`); + this.code = "ESLINT_INVALID_OPTIONS"; + Error.captureStackTrace(this, ESLintInvalidOptionsError); + } +} + +/** + * Validates and normalizes options for the wrapped CLIEngine instance. + * @param {LegacyESLintOptions} options The options to process. + * @throws {ESLintInvalidOptionsError} If of any of a variety of type errors. + * @returns {LegacyESLintOptions} The normalized options. + */ +function processOptions({ + allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored. + baseConfig = null, + cache = false, + cacheLocation = ".eslintcache", + cacheStrategy = "metadata", + cwd = process.cwd(), + errorOnUnmatchedPattern = true, + extensions = null, // ← should be null by default because if it's an array then it suppresses RFC20 feature. + fix = false, + fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property. + flags, /* eslint-disable-line no-unused-vars -- leaving for compatibility with ESLint#hasFlag */ + globInputPaths = true, + ignore = true, + ignorePath = null, // ← should be null by default because if it's a string then it may throw ENOENT. + overrideConfig = null, + overrideConfigFile = null, + plugins = {}, + reportUnusedDisableDirectives = null, // ← should be null by default because if it's a string then it overrides the 'reportUnusedDisableDirectives' setting in config files. And we cannot use `overrideConfig.reportUnusedDisableDirectives` instead because we cannot configure the `error` severity with that. + resolvePluginsRelativeTo = null, // ← should be null by default because if it's a string then it suppresses RFC47 feature. + rulePaths = [], + useEslintrc = true, + passOnNoPatterns = false, + ...unknownOptions +}) { + const errors = []; + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length >= 1) { + errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`); + if (unknownOptionKeys.includes("cacheFile")) { + errors.push("'cacheFile' has been removed. Please use the 'cacheLocation' option instead."); + } + if (unknownOptionKeys.includes("configFile")) { + errors.push("'configFile' has been removed. Please use the 'overrideConfigFile' option instead."); + } + if (unknownOptionKeys.includes("envs")) { + errors.push("'envs' has been removed. Please use the 'overrideConfig.env' option instead."); + } + if (unknownOptionKeys.includes("globals")) { + errors.push("'globals' has been removed. Please use the 'overrideConfig.globals' option instead."); + } + if (unknownOptionKeys.includes("ignorePattern")) { + errors.push("'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead."); + } + if (unknownOptionKeys.includes("parser")) { + errors.push("'parser' has been removed. Please use the 'overrideConfig.parser' option instead."); + } + if (unknownOptionKeys.includes("parserOptions")) { + errors.push("'parserOptions' has been removed. Please use the 'overrideConfig.parserOptions' option instead."); + } + if (unknownOptionKeys.includes("rules")) { + errors.push("'rules' has been removed. Please use the 'overrideConfig.rules' option instead."); + } + } + if (typeof allowInlineConfig !== "boolean") { + errors.push("'allowInlineConfig' must be a boolean."); + } + if (typeof baseConfig !== "object") { + errors.push("'baseConfig' must be an object or null."); + } + if (typeof cache !== "boolean") { + errors.push("'cache' must be a boolean."); + } + if (!isNonEmptyString(cacheLocation)) { + errors.push("'cacheLocation' must be a non-empty string."); + } + if ( + cacheStrategy !== "metadata" && + cacheStrategy !== "content" + ) { + errors.push("'cacheStrategy' must be any of \"metadata\", \"content\"."); + } + if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) { + errors.push("'cwd' must be an absolute path."); + } + if (typeof errorOnUnmatchedPattern !== "boolean") { + errors.push("'errorOnUnmatchedPattern' must be a boolean."); + } + if (!isEmptyArrayOrArrayOfNonEmptyString(extensions) && extensions !== null) { + errors.push("'extensions' must be an array of non-empty strings or null."); + } + if (typeof fix !== "boolean" && typeof fix !== "function") { + errors.push("'fix' must be a boolean or a function."); + } + if (fixTypes !== null && !isFixTypeArray(fixTypes)) { + errors.push("'fixTypes' must be an array of any of \"directive\", \"problem\", \"suggestion\", and \"layout\"."); + } + if (typeof globInputPaths !== "boolean") { + errors.push("'globInputPaths' must be a boolean."); + } + if (typeof ignore !== "boolean") { + errors.push("'ignore' must be a boolean."); + } + if (!isNonEmptyString(ignorePath) && ignorePath !== null) { + errors.push("'ignorePath' must be a non-empty string or null."); + } + if (typeof overrideConfig !== "object") { + errors.push("'overrideConfig' must be an object or null."); + } + if (!isNonEmptyString(overrideConfigFile) && overrideConfigFile !== null) { + errors.push("'overrideConfigFile' must be a non-empty string or null."); + } + if (typeof plugins !== "object") { + errors.push("'plugins' must be an object or null."); + } else if (plugins !== null && Object.keys(plugins).includes("")) { + errors.push("'plugins' must not include an empty string."); + } + if (Array.isArray(plugins)) { + errors.push("'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead."); + } + if ( + reportUnusedDisableDirectives !== "error" && + reportUnusedDisableDirectives !== "warn" && + reportUnusedDisableDirectives !== "off" && + reportUnusedDisableDirectives !== null + ) { + errors.push("'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null."); + } + if ( + !isNonEmptyString(resolvePluginsRelativeTo) && + resolvePluginsRelativeTo !== null + ) { + errors.push("'resolvePluginsRelativeTo' must be a non-empty string or null."); + } + if (!isEmptyArrayOrArrayOfNonEmptyString(rulePaths)) { + errors.push("'rulePaths' must be an array of non-empty strings."); + } + if (typeof useEslintrc !== "boolean") { + errors.push("'useEslintrc' must be a boolean."); + } + if (typeof passOnNoPatterns !== "boolean") { + errors.push("'passOnNoPatterns' must be a boolean."); + } + + if (errors.length > 0) { + throw new ESLintInvalidOptionsError(errors); + } + + return { + allowInlineConfig, + baseConfig, + cache, + cacheLocation, + cacheStrategy, + configFile: overrideConfigFile, + cwd: path.normalize(cwd), + errorOnUnmatchedPattern, + extensions, + fix, + fixTypes, + flags: [], // LegacyESLint does not support flags, so just ignore them. + globInputPaths, + ignore, + ignorePath, + reportUnusedDisableDirectives, + resolvePluginsRelativeTo, + rulePaths, + useEslintrc, + passOnNoPatterns + }; +} + +/** + * Check if a value has one or more properties and that value is not undefined. + * @param {any} obj The value to check. + * @returns {boolean} `true` if `obj` has one or more properties that that value is not undefined. + */ +function hasDefinedProperty(obj) { + if (typeof obj === "object" && obj !== null) { + for (const key in obj) { + if (typeof obj[key] !== "undefined") { + return true; + } + } + } + return false; +} + +/** + * Create rulesMeta object. + * @param {Map} rules a map of rules from which to generate the object. + * @returns {Object} metadata for all enabled rules. + */ +function createRulesMeta(rules) { + return Array.from(rules).reduce((retVal, [id, rule]) => { + retVal[id] = rule.meta; + return retVal; + }, {}); +} + +/** @type {WeakMap} */ +const usedDeprecatedRulesCache = new WeakMap(); + +/** + * Create used deprecated rule list. + * @param {CLIEngine} cliEngine The CLIEngine instance. + * @param {string} maybeFilePath The absolute path to a lint target file or `""`. + * @returns {DeprecatedRuleInfo[]} The used deprecated rule list. + */ +function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) { + const { + configArrayFactory, + options: { cwd } + } = getCLIEngineInternalSlots(cliEngine); + const filePath = path.isAbsolute(maybeFilePath) + ? maybeFilePath + : path.join(cwd, "__placeholder__.js"); + const configArray = configArrayFactory.getConfigArrayForFile(filePath); + const config = configArray.extractConfig(filePath); + + // Most files use the same config, so cache it. + if (!usedDeprecatedRulesCache.has(config)) { + const pluginRules = configArray.pluginRules; + const retv = []; + + for (const [ruleId, ruleConf] of Object.entries(config.rules)) { + if (getRuleSeverity(ruleConf) === 0) { + continue; + } + const rule = pluginRules.get(ruleId) || BuiltinRules.get(ruleId); + const meta = rule && rule.meta; + + if (meta && meta.deprecated) { + retv.push({ ruleId, replacedBy: meta.replacedBy || [] }); + } + } + + usedDeprecatedRulesCache.set(config, Object.freeze(retv)); + } + + return usedDeprecatedRulesCache.get(config); +} + +/** + * Processes the linting results generated by a CLIEngine linting report to + * match the ESLint class's API. + * @param {CLIEngine} cliEngine The CLIEngine instance. + * @param {CLIEngineLintReport} report The CLIEngine linting report to process. + * @returns {LintResult[]} The processed linting results. + */ +function processCLIEngineLintReport(cliEngine, { results }) { + const descriptor = { + configurable: true, + enumerable: true, + get() { + return getOrFindUsedDeprecatedRules(cliEngine, this.filePath); + } + }; + + for (const result of results) { + Object.defineProperty(result, "usedDeprecatedRules", descriptor); + } + + return results; +} + +/** + * An Array.prototype.sort() compatible compare function to order results by their file path. + * @param {LintResult} a The first lint result. + * @param {LintResult} b The second lint result. + * @returns {number} An integer representing the order in which the two results should occur. + */ +function compareResultsByFilePath(a, b) { + if (a.filePath < b.filePath) { + return -1; + } + + if (a.filePath > b.filePath) { + return 1; + } + + return 0; +} + +/** + * Main API. + */ +class LegacyESLint { + + /** + * The type of configuration used by this class. + * @type {string} + */ + static configType = "eslintrc"; + + /** + * Creates a new instance of the main ESLint API. + * @param {LegacyESLintOptions} options The options for this instance. + */ + constructor(options = {}) { + const processedOptions = processOptions(options); + const cliEngine = new CLIEngine(processedOptions, { preloadedPlugins: options.plugins }); + const { + configArrayFactory, + lastConfigArrays + } = getCLIEngineInternalSlots(cliEngine); + let updated = false; + + /* + * Address `overrideConfig` to set override config. + * Operate the `configArrayFactory` internal slot directly because this + * functionality doesn't exist as the public API of CLIEngine. + */ + if (hasDefinedProperty(options.overrideConfig)) { + configArrayFactory.setOverrideConfig(options.overrideConfig); + updated = true; + } + + // Update caches. + if (updated) { + configArrayFactory.clearCache(); + lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile(); + } + + // Initialize private properties. + privateMembersMap.set(this, { + cliEngine, + options: processedOptions + }); + } + + /** + * The version text. + * @type {string} + */ + static get version() { + return version; + } + + /** + * Outputs fixes from the given results to files. + * @param {LintResult[]} results The lint results. + * @returns {Promise} Returns a promise that is used to track side effects. + */ + static async outputFixes(results) { + if (!Array.isArray(results)) { + throw new Error("'results' must be an array"); + } + + await Promise.all( + results + .filter(result => { + if (typeof result !== "object" || result === null) { + throw new Error("'results' must include only objects"); + } + return ( + typeof result.output === "string" && + path.isAbsolute(result.filePath) + ); + }) + .map(r => writeFile(r.filePath, r.output)) + ); + } + + /** + * Returns results that only contains errors. + * @param {LintResult[]} results The results to filter. + * @returns {LintResult[]} The filtered results. + */ + static getErrorResults(results) { + return CLIEngine.getErrorResults(results); + } + + /** + * Returns meta objects for each rule represented in the lint results. + * @param {LintResult[]} results The results to fetch rules meta for. + * @returns {Object} A mapping of ruleIds to rule meta objects. + */ + getRulesMetaForResults(results) { + + const resultRuleIds = new Set(); + + // first gather all ruleIds from all results + + for (const result of results) { + for (const { ruleId } of result.messages) { + resultRuleIds.add(ruleId); + } + for (const { ruleId } of result.suppressedMessages) { + resultRuleIds.add(ruleId); + } + } + + // create a map of all rules in the results + + const { cliEngine } = privateMembersMap.get(this); + const rules = cliEngine.getRules(); + const resultRules = new Map(); + + for (const [ruleId, rule] of rules) { + if (resultRuleIds.has(ruleId)) { + resultRules.set(ruleId, rule); + } + } + + return createRulesMeta(resultRules); + + } + + /* eslint-disable no-unused-vars, class-methods-use-this -- leaving for compatibility with ESLint#hasFlag */ + /** + * Indicates if the given feature flag is enabled for this instance. For this + * class, this always returns `false` because it does not support feature flags. + * @param {string} flag The feature flag to check. + * @returns {boolean} Always false. + */ + hasFlag(flag) { + return false; + } + /* eslint-enable no-unused-vars, class-methods-use-this -- reenable rules for the rest of the file */ + + /** + * Executes the current configuration on an array of file and directory names. + * @param {string[]} patterns An array of file and directory names. + * @returns {Promise} The results of linting the file patterns given. + */ + async lintFiles(patterns) { + const { cliEngine, options } = privateMembersMap.get(this); + + if (options.passOnNoPatterns && (patterns === "" || (Array.isArray(patterns) && patterns.length === 0))) { + return []; + } + + if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) { + throw new Error("'patterns' must be a non-empty string or an array of non-empty strings"); + } + + return processCLIEngineLintReport( + cliEngine, + cliEngine.executeOnFiles(patterns) + ); + } + + /** + * Executes the current configuration on text. + * @param {string} code A string of JavaScript code to lint. + * @param {Object} [options] The options. + * @param {string} [options.filePath] The path to the file of the source code. + * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path. + * @returns {Promise} The results of linting the string of code given. + */ + async lintText(code, options = {}) { + if (typeof code !== "string") { + throw new Error("'code' must be a string"); + } + if (typeof options !== "object") { + throw new Error("'options' must be an object, null, or undefined"); + } + const { + filePath, + warnIgnored = false, + ...unknownOptions + } = options || {}; + + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length > 0) { + throw new Error(`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`); + } + + if (filePath !== void 0 && !isNonEmptyString(filePath)) { + throw new Error("'options.filePath' must be a non-empty string or undefined"); + } + if (typeof warnIgnored !== "boolean") { + throw new Error("'options.warnIgnored' must be a boolean or undefined"); + } + + const { cliEngine } = privateMembersMap.get(this); + + return processCLIEngineLintReport( + cliEngine, + cliEngine.executeOnText(code, filePath, warnIgnored) + ); + } + + /** + * Returns the formatter representing the given formatter name. + * @param {string} [name] The name of the formatter to load. + * The following values are allowed: + * - `undefined` ... Load `stylish` builtin formatter. + * - A builtin formatter name ... Load the builtin formatter. + * - A third-party formatter name: + * - `foo` → `eslint-formatter-foo` + * - `@foo` → `@foo/eslint-formatter` + * - `@foo/bar` → `@foo/eslint-formatter-bar` + * - A file path ... Load the file. + * @returns {Promise} A promise resolving to the formatter object. + * This promise will be rejected if the given formatter was not found or not + * a function. + */ + async loadFormatter(name = "stylish") { + if (typeof name !== "string") { + throw new Error("'name' must be a string"); + } + + const { cliEngine, options } = privateMembersMap.get(this); + const formatter = cliEngine.getFormatter(name); + + if (typeof formatter !== "function") { + throw new Error(`Formatter must be a function, but got a ${typeof formatter}.`); + } + + return { + + /** + * The main formatter method. + * @param {LintResult[]} results The lint results to format. + * @param {ResultsMeta} resultsMeta Warning count and max threshold. + * @returns {string | Promise} The formatted lint results. + */ + format(results, resultsMeta) { + let rulesMeta = null; + + results.sort(compareResultsByFilePath); + + return formatter(results, { + ...resultsMeta, + get cwd() { + return options.cwd; + }, + get rulesMeta() { + if (!rulesMeta) { + rulesMeta = createRulesMeta(cliEngine.getRules()); + } + + return rulesMeta; + } + }); + } + }; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file to retrieve a config object for. + * @returns {Promise} A configuration object for the file. + */ + async calculateConfigForFile(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const { cliEngine } = privateMembersMap.get(this); + + return cliEngine.getConfigForFile(filePath); + } + + /** + * Checks if a given path is ignored by ESLint. + * @param {string} filePath The path of the file to check. + * @returns {Promise} Whether or not the given path is ignored. + */ + async isPathIgnored(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const { cliEngine } = privateMembersMap.get(this); + + return cliEngine.isPathIgnored(filePath); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + LegacyESLint, + + /** + * Get the private class members of a given ESLint instance for tests. + * @param {ESLint} instance The ESLint instance to get. + * @returns {ESLintPrivateMembers} The instance's private class members. + */ + getESLintPrivateMembers(instance) { + return privateMembersMap.get(instance); + } +}; diff --git a/node_modules/eslint/lib/languages/js/index.js b/node_modules/eslint/lib/languages/js/index.js new file mode 100644 index 0000000..98d72a5 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/index.js @@ -0,0 +1,336 @@ +/** + * @fileoverview JavaScript Language Object + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { SourceCode } = require("./source-code"); +const createDebug = require("debug"); +const astUtils = require("../../shared/ast-utils"); +const espree = require("espree"); +const eslintScope = require("eslint-scope"); +const evk = require("eslint-visitor-keys"); +const { validateLanguageOptions } = require("./validate-language-options"); +const { LATEST_ECMA_VERSION } = require("../../../conf/ecma-version"); + +//----------------------------------------------------------------------------- +// Type Definitions +//----------------------------------------------------------------------------- + +/** @typedef {import("@eslint/core").File} File */ +/** @typedef {import("@eslint/core").Language} Language */ +/** @typedef {import("@eslint/core").OkParseResult} OkParseResult */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const debug = createDebug("eslint:languages:js"); +const DEFAULT_ECMA_VERSION = 5; +const parserSymbol = Symbol.for("eslint.RuleTester.parser"); + +/** + * Analyze scope of the given AST. + * @param {ASTNode} ast The `Program` node to analyze. + * @param {LanguageOptions} languageOptions The parser options. + * @param {Record} visitorKeys The visitor keys. + * @returns {ScopeManager} The analysis result. + */ +function analyzeScope(ast, languageOptions, visitorKeys) { + const parserOptions = languageOptions.parserOptions; + const ecmaFeatures = parserOptions.ecmaFeatures || {}; + const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION; + + return eslintScope.analyze(ast, { + ignoreEval: true, + nodejsScope: ecmaFeatures.globalReturn, + impliedStrict: ecmaFeatures.impliedStrict, + ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6, + sourceType: languageOptions.sourceType || "script", + childVisitorKeys: visitorKeys || evk.KEYS, + fallback: evk.getKeys + }); +} + +/** + * Determines if a given object is Espree. + * @param {Object} parser The parser to check. + * @returns {boolean} True if the parser is Espree or false if not. + */ +function isEspree(parser) { + return !!(parser === espree || parser[parserSymbol] === espree); +} + +/** + * Normalize ECMAScript version from the initial config into languageOptions (year) + * format. + * @param {any} [ecmaVersion] ECMAScript version from the initial config + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersionForLanguageOptions(ecmaVersion) { + + switch (ecmaVersion) { + case 3: + return 3; + + // void 0 = no ecmaVersion specified so use the default + case 5: + case void 0: + return 5; + + default: + if (typeof ecmaVersion === "number") { + return ecmaVersion >= 2015 ? ecmaVersion : ecmaVersion + 2009; + } + } + + /* + * We default to the latest supported ecmaVersion for everything else. + * Remember, this is for languageOptions.ecmaVersion, which sets the version + * that is used for a number of processes inside of ESLint. It's normally + * safe to assume people want the latest unless otherwise specified. + */ + return LATEST_ECMA_VERSION; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * @type {Language} + */ +module.exports = { + + fileType: "text", + lineStart: 1, + columnStart: 0, + nodeTypeKey: "type", + visitorKeys: evk.KEYS, + + defaultLanguageOptions: { + sourceType: "module", + ecmaVersion: "latest", + parser: espree, + parserOptions: {} + }, + + validateLanguageOptions, + + /** + * Normalizes the language options. + * @param {Object} languageOptions The language options to normalize. + * @returns {Object} The normalized language options. + */ + normalizeLanguageOptions(languageOptions) { + + languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions( + languageOptions.ecmaVersion + ); + + // Espree expects this information to be passed in + if (isEspree(languageOptions.parser)) { + const parserOptions = languageOptions.parserOptions; + + if (languageOptions.sourceType) { + + parserOptions.sourceType = languageOptions.sourceType; + + if ( + parserOptions.sourceType === "module" && + parserOptions.ecmaFeatures && + parserOptions.ecmaFeatures.globalReturn + ) { + parserOptions.ecmaFeatures.globalReturn = false; + } + } + } + + return languageOptions; + + }, + + /** + * Determines if a given node matches a given selector class. + * @param {string} className The class name to check. + * @param {ASTNode} node The node to check. + * @param {Array} ancestry The ancestry of the node. + * @returns {boolean} True if there's a match, false if not. + * @throws {Error} When an unknown class name is passed. + */ + matchesSelectorClass(className, node, ancestry) { + + /* + * Copyright (c) 2013, Joel Feenstra + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the ESQuery nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL JOEL FEENSTRA BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + switch (className.toLowerCase()) { + + case "statement": + if (node.type.slice(-9) === "Statement") { + return true; + } + + // fallthrough: interface Declaration <: Statement { } + + case "declaration": + return node.type.slice(-11) === "Declaration"; + + case "pattern": + if (node.type.slice(-7) === "Pattern") { + return true; + } + + // fallthrough: interface Expression <: Node, Pattern { } + + case "expression": + return node.type.slice(-10) === "Expression" || + node.type.slice(-7) === "Literal" || + ( + node.type === "Identifier" && + (ancestry.length === 0 || ancestry[0].type !== "MetaProperty") + ) || + node.type === "MetaProperty"; + + case "function": + return node.type === "FunctionDeclaration" || + node.type === "FunctionExpression" || + node.type === "ArrowFunctionExpression"; + + default: + throw new Error(`Unknown class name: ${className}`); + } + }, + + /** + * Parses the given file into an AST. + * @param {File} file The virtual file to parse. + * @param {Object} options Additional options passed from ESLint. + * @param {LanguageOptions} options.languageOptions The language options. + * @returns {Object} The result of parsing. + */ + parse(file, { languageOptions }) { + + // Note: BOM already removed + const { body: text, path: filePath } = file; + const textToParse = text.replace(astUtils.shebangPattern, (match, captured) => `//${captured}`); + const { ecmaVersion, sourceType, parser } = languageOptions; + const parserOptions = Object.assign( + { ecmaVersion, sourceType }, + languageOptions.parserOptions, + { + loc: true, + range: true, + raw: true, + tokens: true, + comment: true, + eslintVisitorKeys: true, + eslintScopeManager: true, + filePath + } + ); + + /* + * Check for parsing errors first. If there's a parsing error, nothing + * else can happen. However, a parsing error does not throw an error + * from this method - it's just considered a fatal error message, a + * problem that ESLint identified just like any other. + */ + try { + debug("Parsing:", filePath); + const parseResult = (typeof parser.parseForESLint === "function") + ? parser.parseForESLint(textToParse, parserOptions) + : { ast: parser.parse(textToParse, parserOptions) }; + + debug("Parsing successful:", filePath); + + const { + ast, + services: parserServices = {}, + visitorKeys = evk.KEYS, + scopeManager + } = parseResult; + + return { + ok: true, + ast, + parserServices, + visitorKeys, + scopeManager + }; + } catch (ex) { + + // If the message includes a leading line number, strip it: + const message = ex.message.replace(/^line \d+:/iu, "").trim(); + + debug("%s\n%s", message, ex.stack); + + return { + ok: false, + errors: [{ + message, + line: ex.lineNumber, + column: ex.column + }] + }; + } + + }, + + /** + * Creates a new `SourceCode` object from the given information. + * @param {File} file The virtual file to create a `SourceCode` object from. + * @param {OkParseResult} parseResult The result returned from `parse()`. + * @param {Object} options Additional options passed from ESLint. + * @param {LanguageOptions} options.languageOptions The language options. + * @returns {SourceCode} The new `SourceCode` object. + */ + createSourceCode(file, parseResult, { languageOptions }) { + + const { body: text, path: filePath, bom: hasBOM } = file; + const { ast, parserServices, visitorKeys } = parseResult; + + debug("Scope analysis:", filePath); + const scopeManager = parseResult.scopeManager || analyzeScope(ast, languageOptions, visitorKeys); + + debug("Scope analysis successful:", filePath); + + return new SourceCode({ + text, + ast, + hasBOM, + parserServices, + scopeManager, + visitorKeys + }); + } + +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/index.js b/node_modules/eslint/lib/languages/js/source-code/index.js new file mode 100644 index 0000000..1ecfbe4 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const SourceCode = require("./source-code"); + +module.exports = { + SourceCode +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/source-code.js b/node_modules/eslint/lib/languages/js/source-code/source-code.js new file mode 100644 index 0000000..9c073fa --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/source-code.js @@ -0,0 +1,1202 @@ +/** + * @fileoverview Abstraction of JavaScript source code. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + { isCommentToken } = require("@eslint-community/eslint-utils"), + TokenStore = require("./token-store"), + astUtils = require("../../../shared/ast-utils"), + Traverser = require("../../../shared/traverser"), + globals = require("../../../../conf/globals"), + { + directivesPattern + } = require("../../../shared/directives"), + + CodePathAnalyzer = require("../../../linter/code-path-analysis/code-path-analyzer"), + createEmitter = require("../../../linter/safe-emitter"), + { ConfigCommentParser, VisitNodeStep, CallMethodStep, Directive } = require("@eslint/plugin-kit"), + + eslintScope = require("eslint-scope"); + +//------------------------------------------------------------------------------ +// Type Definitions +//------------------------------------------------------------------------------ + +/** @typedef {import("eslint-scope").Variable} Variable */ +/** @typedef {import("eslint-scope").Scope} Scope */ +/** @typedef {import("@eslint/core").SourceCode} ISourceCode */ +/** @typedef {import("@eslint/core").Directive} IDirective */ +/** @typedef {import("@eslint/core").TraversalStep} ITraversalStep */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const commentParser = new ConfigCommentParser(); + +const CODE_PATH_EVENTS = [ + "onCodePathStart", + "onCodePathEnd", + "onCodePathSegmentStart", + "onCodePathSegmentEnd", + "onCodePathSegmentLoop", + "onUnreachableCodePathSegmentStart", + "onUnreachableCodePathSegmentEnd" +]; + +/** + * Validates that the given AST has the required information. + * @param {ASTNode} ast The Program node of the AST to check. + * @throws {Error} If the AST doesn't contain the correct information. + * @returns {void} + * @private + */ +function validate(ast) { + if (!ast.tokens) { + throw new Error("AST is missing the tokens array."); + } + + if (!ast.comments) { + throw new Error("AST is missing the comments array."); + } + + if (!ast.loc) { + throw new Error("AST is missing location information."); + } + + if (!ast.range) { + throw new Error("AST is missing range information"); + } +} + +/** + * Retrieves globals for the given ecmaVersion. + * @param {number} ecmaVersion The version to retrieve globals for. + * @returns {Object} The globals for the given ecmaVersion. + */ +function getGlobalsForEcmaVersion(ecmaVersion) { + + switch (ecmaVersion) { + case 3: + return globals.es3; + + case 5: + return globals.es5; + + default: + if (ecmaVersion < 2015) { + return globals[`es${ecmaVersion + 2009}`]; + } + + return globals[`es${ecmaVersion}`]; + } +} + +/** + * Check to see if its a ES6 export declaration. + * @param {ASTNode} astNode An AST node. + * @returns {boolean} whether the given node represents an export declaration. + * @private + */ +function looksLikeExport(astNode) { + return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" || + astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier"; +} + +/** + * Merges two sorted lists into a larger sorted list in O(n) time. + * @param {Token[]} tokens The list of tokens. + * @param {Token[]} comments The list of comments. + * @returns {Token[]} A sorted list of tokens and comments. + * @private + */ +function sortedMerge(tokens, comments) { + const result = []; + let tokenIndex = 0; + let commentIndex = 0; + + while (tokenIndex < tokens.length || commentIndex < comments.length) { + if (commentIndex >= comments.length || tokenIndex < tokens.length && tokens[tokenIndex].range[0] < comments[commentIndex].range[0]) { + result.push(tokens[tokenIndex++]); + } else { + result.push(comments[commentIndex++]); + } + } + + return result; +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +/** + * Determines if two nodes or tokens overlap. + * @param {ASTNode|Token} first The first node or token to check. + * @param {ASTNode|Token} second The second node or token to check. + * @returns {boolean} True if the two nodes or tokens overlap. + * @private + */ +function nodesOrTokensOverlap(first, second) { + return (first.range[0] <= second.range[0] && first.range[1] >= second.range[0]) || + (second.range[0] <= first.range[0] && second.range[1] >= first.range[0]); +} + +/** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * @param {SourceCode} sourceCode The source code object. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @param {boolean} checkInsideOfJSXText If `true` is present, check inside of JSXText tokens for backward compatibility. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @public + */ +function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) { + if (nodesOrTokensOverlap(first, second)) { + return false; + } + + const [startingNodeOrToken, endingNodeOrToken] = first.range[1] <= second.range[0] + ? [first, second] + : [second, first]; + const firstToken = sourceCode.getLastToken(startingNodeOrToken) || startingNodeOrToken; + const finalToken = sourceCode.getFirstToken(endingNodeOrToken) || endingNodeOrToken; + let currentToken = firstToken; + + while (currentToken !== finalToken) { + const nextToken = sourceCode.getTokenAfter(currentToken, { includeComments: true }); + + if ( + currentToken.range[1] !== nextToken.range[0] || + + /* + * For backward compatibility, check spaces in JSXText. + * https://github.com/eslint/eslint/issues/12614 + */ + ( + checkInsideOfJSXText && + nextToken !== finalToken && + nextToken.type === "JSXText" && + /\s/u.test(nextToken.value) + ) + ) { + return true; + } + + currentToken = nextToken; + } + + return false; +} + +//----------------------------------------------------------------------------- +// Directive Comments +//----------------------------------------------------------------------------- + +/** + * Ensures that variables representing built-in properties of the Global Object, + * and any globals declared by special block comments, are present in the global + * scope. + * @param {Scope} globalScope The global scope. + * @param {Object|undefined} configGlobals The globals declared in configuration + * @param {Object|undefined} inlineGlobals The globals declared in the source code + * @returns {void} + */ +function addDeclaredGlobals(globalScope, configGlobals = {}, inlineGlobals = {}) { + + // Define configured global variables. + for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(inlineGlobals)])) { + + /* + * `normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would + * typically be caught when validating a config anyway (validity for inline global comments is checked separately). + */ + const configValue = configGlobals[id] === void 0 ? void 0 : normalizeConfigGlobal(configGlobals[id]); + const commentValue = inlineGlobals[id] && inlineGlobals[id].value; + const value = commentValue || configValue; + const sourceComments = inlineGlobals[id] && inlineGlobals[id].comments; + + if (value === "off") { + continue; + } + + let variable = globalScope.set.get(id); + + if (!variable) { + variable = new eslintScope.Variable(id, globalScope); + + globalScope.variables.push(variable); + globalScope.set.set(id, variable); + } + + variable.eslintImplicitGlobalSetting = configValue; + variable.eslintExplicitGlobal = sourceComments !== void 0; + variable.eslintExplicitGlobalComments = sourceComments; + variable.writeable = (value === "writable"); + } + + /* + * "through" contains all references which definitions cannot be found. + * Since we augment the global scope using configuration, we need to update + * references and remove the ones that were added by configuration. + */ + globalScope.through = globalScope.through.filter(reference => { + const name = reference.identifier.name; + const variable = globalScope.set.get(name); + + if (variable) { + + /* + * Links the variable and the reference. + * And this reference is removed from `Scope#through`. + */ + reference.resolved = variable; + variable.references.push(reference); + + return false; + } + + return true; + }); +} + +/** + * Sets the given variable names as exported so they won't be triggered by + * the `no-unused-vars` rule. + * @param {eslint.Scope} globalScope The global scope to define exports in. + * @param {Record} variables An object whose keys are the variable + * names to export. + * @returns {void} + */ +function markExportedVariables(globalScope, variables) { + + Object.keys(variables).forEach(name => { + const variable = globalScope.set.get(name); + + if (variable) { + variable.eslintUsed = true; + variable.eslintExported = true; + } + }); + +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +const caches = Symbol("caches"); + +/** + * Represents parsed source code. + * @implements {ISourceCode} + */ +class SourceCode extends TokenStore { + + /** + * The cache of steps that were taken while traversing the source code. + * @type {Array} + */ + #steps; + + /** + * Creates a new instance. + * @param {string|Object} textOrConfig The source code text or config object. + * @param {string} textOrConfig.text The source code text. + * @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + * @param {boolean} textOrConfig.hasBOM Indicates if the text has a Unicode BOM. + * @param {Object|null} textOrConfig.parserServices The parser services. + * @param {ScopeManager|null} textOrConfig.scopeManager The scope of this source code. + * @param {Object|null} textOrConfig.visitorKeys The visitor keys to traverse AST. + * @param {ASTNode} [astIfNoConfig] The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + */ + constructor(textOrConfig, astIfNoConfig) { + let text, hasBOM, ast, parserServices, scopeManager, visitorKeys; + + // Process overloading of arguments + if (typeof textOrConfig === "string") { + text = textOrConfig; + ast = astIfNoConfig; + hasBOM = false; + } else if (typeof textOrConfig === "object" && textOrConfig !== null) { + text = textOrConfig.text; + ast = textOrConfig.ast; + hasBOM = textOrConfig.hasBOM; + parserServices = textOrConfig.parserServices; + scopeManager = textOrConfig.scopeManager; + visitorKeys = textOrConfig.visitorKeys; + } + + validate(ast); + super(ast.tokens, ast.comments); + + /** + * General purpose caching for the class. + */ + this[caches] = new Map([ + ["scopes", new WeakMap()], + ["vars", new Map()], + ["configNodes", void 0] + ]); + + /** + * Indicates if the AST is ESTree compatible. + * @type {boolean} + */ + this.isESTree = ast.type === "Program"; + + /* + * Backwards compatibility for BOM handling. + * + * The `hasBOM` property has been available on the `SourceCode` object + * for a long time and is used to indicate if the source contains a BOM. + * The linter strips the BOM and just passes the `hasBOM` property to the + * `SourceCode` constructor to make it easier for languages to not deal with + * the BOM. + * + * However, the text passed in to the `SourceCode` constructor might still + * have a BOM if the constructor is called outside of the linter, so we still + * need to check for the BOM in the text. + */ + const textHasBOM = text.charCodeAt(0) === 0xFEFF; + + /** + * The flag to indicate that the source code has Unicode BOM. + * @type {boolean} + */ + this.hasBOM = textHasBOM || !!hasBOM; + + /** + * The original text source code. + * BOM was stripped from this text. + * @type {string} + */ + this.text = (textHasBOM ? text.slice(1) : text); + + /** + * The parsed AST for the source code. + * @type {ASTNode} + */ + this.ast = ast; + + /** + * The parser services of this source code. + * @type {Object} + */ + this.parserServices = parserServices || {}; + + /** + * The scope of this source code. + * @type {ScopeManager|null} + */ + this.scopeManager = scopeManager || null; + + /** + * The visitor keys to traverse AST. + * @type {Object} + */ + this.visitorKeys = visitorKeys || Traverser.DEFAULT_VISITOR_KEYS; + + // Check the source text for the presence of a shebang since it is parsed as a standard line comment. + const shebangMatched = this.text.match(astUtils.shebangPattern); + const hasShebang = shebangMatched && ast.comments.length && ast.comments[0].value === shebangMatched[1]; + + if (hasShebang) { + ast.comments[0].type = "Shebang"; + } + + this.tokensAndComments = sortedMerge(ast.tokens, ast.comments); + + /** + * The source code split into lines according to ECMA-262 specification. + * This is done to avoid each rule needing to do so separately. + * @type {string[]} + */ + this.lines = []; + this.lineStartIndices = [0]; + + const lineEndingPattern = astUtils.createGlobalLinebreakMatcher(); + let match; + + /* + * Previously, this was implemented using a regex that + * matched a sequence of non-linebreak characters followed by a + * linebreak, then adding the lengths of the matches. However, + * this caused a catastrophic backtracking issue when the end + * of a file contained a large number of non-newline characters. + * To avoid this, the current implementation just matches newlines + * and uses match.index to get the correct line start indices. + */ + while ((match = lineEndingPattern.exec(this.text))) { + this.lines.push(this.text.slice(this.lineStartIndices.at(-1), match.index)); + this.lineStartIndices.push(match.index + match[0].length); + } + this.lines.push(this.text.slice(this.lineStartIndices.at(-1))); + + // don't allow further modification of this object + Object.freeze(this); + Object.freeze(this.lines); + } + + /** + * Split the source code into multiple lines based on the line delimiters. + * @param {string} text Source code as a string. + * @returns {string[]} Array of source code lines. + * @public + */ + static splitLines(text) { + return text.split(astUtils.createGlobalLinebreakMatcher()); + } + + /** + * Gets the source code for the given node. + * @param {ASTNode} [node] The AST node to get the text for. + * @param {int} [beforeCount] The number of characters before the node to retrieve. + * @param {int} [afterCount] The number of characters after the node to retrieve. + * @returns {string} The text representing the AST node. + * @public + */ + getText(node, beforeCount, afterCount) { + if (node) { + return this.text.slice(Math.max(node.range[0] - (beforeCount || 0), 0), + node.range[1] + (afterCount || 0)); + } + return this.text; + } + + /** + * Gets the entire source text split into an array of lines. + * @returns {Array} The source text as an array of lines. + * @public + */ + getLines() { + return this.lines; + } + + /** + * Retrieves an array containing all comments in the source code. + * @returns {ASTNode[]} An array of comment nodes. + * @public + */ + getAllComments() { + return this.ast.comments; + } + + /** + * Retrieves the JSDoc comment for a given node. + * @param {ASTNode} node The AST node to get the comment for. + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @public + * @deprecated + */ + getJSDocComment(node) { + + /** + * Checks for the presence of a JSDoc comment for the given node and returns it. + * @param {ASTNode} astNode The AST node to get the comment for. + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @private + */ + const findJSDocComment = astNode => { + const tokenBefore = this.getTokenBefore(astNode, { includeComments: true }); + + if ( + tokenBefore && + isCommentToken(tokenBefore) && + tokenBefore.type === "Block" && + tokenBefore.value.charAt(0) === "*" && + astNode.loc.start.line - tokenBefore.loc.end.line <= 1 + ) { + return tokenBefore; + } + + return null; + }; + let parent = node.parent; + + switch (node.type) { + case "ClassDeclaration": + case "FunctionDeclaration": + return findJSDocComment(looksLikeExport(parent) ? parent : node); + + case "ClassExpression": + return findJSDocComment(parent.parent); + + case "ArrowFunctionExpression": + case "FunctionExpression": + if (parent.type !== "CallExpression" && parent.type !== "NewExpression") { + while ( + !this.getCommentsBefore(parent).length && + !/Function/u.test(parent.type) && + parent.type !== "MethodDefinition" && + parent.type !== "Property" + ) { + parent = parent.parent; + + if (!parent) { + break; + } + } + + if (parent && parent.type !== "FunctionDeclaration" && parent.type !== "Program") { + return findJSDocComment(parent); + } + } + + return findJSDocComment(node); + + // falls through + default: + return null; + } + } + + /** + * Gets the deepest node containing a range index. + * @param {int} index Range index of the desired node. + * @returns {ASTNode} The node if found or null if not found. + * @public + */ + getNodeByRangeIndex(index) { + let result = null; + + Traverser.traverse(this.ast, { + visitorKeys: this.visitorKeys, + enter(node) { + if (node.range[0] <= index && index < node.range[1]) { + result = node; + } else { + this.skip(); + } + }, + leave(node) { + if (node === result) { + this.break(); + } + } + }); + + return result; + } + + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @public + */ + isSpaceBetween(first, second) { + return isSpaceBetween(this, first, second, false); + } + + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * For backward compatibility, this method returns true if there are + * `JSXText` tokens that contain whitespaces between the two. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @deprecated in favor of isSpaceBetween(). + * @public + */ + isSpaceBetweenTokens(first, second) { + return isSpaceBetween(this, first, second, true); + } + + /** + * Converts a source text index into a (line, column) pair. + * @param {number} index The index of a character in a file + * @throws {TypeError} If non-numeric index or index out of range. + * @returns {Object} A {line, column} location object with a 0-indexed column + * @public + */ + getLocFromIndex(index) { + if (typeof index !== "number") { + throw new TypeError("Expected `index` to be a number."); + } + + if (index < 0 || index > this.text.length) { + throw new RangeError(`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`); + } + + /* + * For an argument of this.text.length, return the location one "spot" past the last character + * of the file. If the last character is a linebreak, the location will be column 0 of the next + * line; otherwise, the location will be in the next column on the same line. + * + * See getIndexFromLoc for the motivation for this special case. + */ + if (index === this.text.length) { + return { line: this.lines.length, column: this.lines.at(-1).length }; + } + + /* + * To figure out which line index is on, determine the last place at which index could + * be inserted into lineStartIndices to keep the list sorted. + */ + const lineNumber = index >= this.lineStartIndices.at(-1) + ? this.lineStartIndices.length + : this.lineStartIndices.findIndex(el => index < el); + + return { line: lineNumber, column: index - this.lineStartIndices[lineNumber - 1] }; + } + + /** + * Converts a (line, column) pair into a range index. + * @param {Object} loc A line/column location + * @param {number} loc.line The line number of the location (1-indexed) + * @param {number} loc.column The column number of the location (0-indexed) + * @throws {TypeError|RangeError} If `loc` is not an object with a numeric + * `line` and `column`, if the `line` is less than or equal to zero or + * the line or column is out of the expected range. + * @returns {number} The range index of the location in the file. + * @public + */ + getIndexFromLoc(loc) { + if (typeof loc !== "object" || typeof loc.line !== "number" || typeof loc.column !== "number") { + throw new TypeError("Expected `loc` to be an object with numeric `line` and `column` properties."); + } + + if (loc.line <= 0) { + throw new RangeError(`Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`); + } + + if (loc.line > this.lineStartIndices.length) { + throw new RangeError(`Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`); + } + + const lineStartIndex = this.lineStartIndices[loc.line - 1]; + const lineEndIndex = loc.line === this.lineStartIndices.length ? this.text.length : this.lineStartIndices[loc.line]; + const positionIndex = lineStartIndex + loc.column; + + /* + * By design, getIndexFromLoc({ line: lineNum, column: 0 }) should return the start index of + * the given line, provided that the line number is valid element of this.lines. Since the + * last element of this.lines is an empty string for files with trailing newlines, add a + * special case where getting the index for the first location after the end of the file + * will return the length of the file, rather than throwing an error. This allows rules to + * use getIndexFromLoc consistently without worrying about edge cases at the end of a file. + */ + if ( + loc.line === this.lineStartIndices.length && positionIndex > lineEndIndex || + loc.line < this.lineStartIndices.length && positionIndex >= lineEndIndex + ) { + throw new RangeError(`Column number out of range (column ${loc.column} requested, but the length of line ${loc.line} is ${lineEndIndex - lineStartIndex}).`); + } + + return positionIndex; + } + + /** + * Gets the scope for the given node + * @param {ASTNode} currentNode The node to get the scope of + * @returns {Scope} The scope information for this node + * @throws {TypeError} If the `currentNode` argument is missing. + */ + getScope(currentNode) { + + if (!currentNode) { + throw new TypeError("Missing required argument: node."); + } + + // check cache first + const cache = this[caches].get("scopes"); + const cachedScope = cache.get(currentNode); + + if (cachedScope) { + return cachedScope; + } + + // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. + const inner = currentNode.type !== "Program"; + + for (let node = currentNode; node; node = node.parent) { + const scope = this.scopeManager.acquire(node, inner); + + if (scope) { + if (scope.type === "function-expression-name") { + cache.set(currentNode, scope.childScopes[0]); + return scope.childScopes[0]; + } + + cache.set(currentNode, scope); + return scope; + } + } + + cache.set(currentNode, this.scopeManager.scopes[0]); + return this.scopeManager.scopes[0]; + } + + /** + * Get the variables that `node` defines. + * This is a convenience method that passes through + * to the same method on the `scopeManager`. + * @param {ASTNode} node The node for which the variables are obtained. + * @returns {Array} An array of variable nodes representing + * the variables that `node` defines. + */ + getDeclaredVariables(node) { + return this.scopeManager.getDeclaredVariables(node); + } + + /* eslint-disable class-methods-use-this -- node is owned by SourceCode */ + /** + * Gets all the ancestors of a given node + * @param {ASTNode} node The node + * @returns {Array} All the ancestor nodes in the AST, not including the provided node, starting + * from the root node at index 0 and going inwards to the parent node. + * @throws {TypeError} When `node` is missing. + */ + getAncestors(node) { + + if (!node) { + throw new TypeError("Missing required argument: node."); + } + + const ancestorsStartingAtParent = []; + + for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) { + ancestorsStartingAtParent.push(ancestor); + } + + return ancestorsStartingAtParent.reverse(); + } + + /** + * Returns the location of the given node or token. + * @param {ASTNode|Token} nodeOrToken The node or token to get the location of. + * @returns {SourceLocation} The location of the node or token. + */ + getLoc(nodeOrToken) { + return nodeOrToken.loc; + } + + /** + * Returns the range of the given node or token. + * @param {ASTNode|Token} nodeOrToken The node or token to get the range of. + * @returns {[number, number]} The range of the node or token. + */ + getRange(nodeOrToken) { + return nodeOrToken.range; + } + + /* eslint-enable class-methods-use-this -- node is owned by SourceCode */ + + /** + * Marks a variable as used in the current scope + * @param {string} name The name of the variable to mark as used. + * @param {ASTNode} [refNode] The closest node to the variable reference. + * @returns {boolean} True if the variable was found and marked as used, false if not. + */ + markVariableAsUsed(name, refNode = this.ast) { + + const currentScope = this.getScope(refNode); + let initialScope = currentScope; + + /* + * When we are in an ESM or CommonJS module, we need to start searching + * from the top-level scope, not the global scope. For ESM the top-level + * scope is the module scope; for CommonJS the top-level scope is the + * outer function scope. + * + * Without this check, we might miss a variable declared with `var` at + * the top-level because it won't exist in the global scope. + */ + if ( + currentScope.type === "global" && + currentScope.childScopes.length > 0 && + + // top-level scopes refer to a `Program` node + currentScope.childScopes[0].block === this.ast + ) { + initialScope = currentScope.childScopes[0]; + } + + for (let scope = initialScope; scope; scope = scope.upper) { + const variable = scope.variables.find(scopeVar => scopeVar.name === name); + + if (variable) { + variable.eslintUsed = true; + return true; + } + } + + return false; + } + + + /** + * Returns an array of all inline configuration nodes found in the + * source code. + * @returns {Array} An array of all inline configuration nodes. + */ + getInlineConfigNodes() { + + // check the cache first + let configNodes = this[caches].get("configNodes"); + + if (configNodes) { + return configNodes; + } + + // calculate fresh config nodes + configNodes = this.ast.comments.filter(comment => { + + // shebang comments are never directives + if (comment.type === "Shebang") { + return false; + } + + const directive = commentParser.parseDirective(comment.value); + + if (!directive) { + return false; + } + + if (!directivesPattern.test(directive.label)) { + return false; + } + + // only certain comment types are supported as line comments + return comment.type !== "Line" || !!/^eslint-disable-(next-)?line$/u.test(directive.label); + }); + + this[caches].set("configNodes", configNodes); + + return configNodes; + } + + /** + * Returns an all directive nodes that enable or disable rules along with any problems + * encountered while parsing the directives. + * @returns {{problems:Array,directives:Array}} Information + * that ESLint needs to further process the directives. + */ + getDisableDirectives() { + + // check the cache first + const cachedDirectives = this[caches].get("disableDirectives"); + + if (cachedDirectives) { + return cachedDirectives; + } + + const problems = []; + const directives = []; + + this.getInlineConfigNodes().forEach(comment => { + + // Step 1: Parse the directive + const { + label, + value, + justification: justificationPart + } = commentParser.parseDirective(comment.value); + + // Step 2: Extract the directive value + const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(label); + + if (comment.type === "Line" && !lineCommentSupported) { + return; + } + + // Step 3: Validate the directive does not span multiple lines + if (label === "eslint-disable-line" && comment.loc.start.line !== comment.loc.end.line) { + const message = `${label} comment should not span multiple lines.`; + + problems.push({ + ruleId: null, + message, + loc: comment.loc + }); + return; + } + + // Step 4: Extract the directive value and create the Directive object + switch (label) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = label.slice("eslint-".length); + + directives.push(new Directive({ + type: directiveType, + node: comment, + value, + justification: justificationPart + })); + } + + // no default + } + }); + + const result = { problems, directives }; + + this[caches].set("disableDirectives", result); + + return result; + } + + /** + * Applies language options sent in from the core. + * @param {Object} languageOptions The language options for this run. + * @returns {void} + */ + applyLanguageOptions(languageOptions) { + + /* + * Add configured globals and language globals + * + * Using Object.assign instead of object spread for performance reasons + * https://github.com/eslint/eslint/issues/16302 + */ + const configGlobals = Object.assign( + Object.create(null), // https://github.com/eslint/eslint/issues/18363 + getGlobalsForEcmaVersion(languageOptions.ecmaVersion), + languageOptions.sourceType === "commonjs" ? globals.commonjs : void 0, + languageOptions.globals + ); + const varsCache = this[caches].get("vars"); + + varsCache.set("configGlobals", configGlobals); + } + + /** + * Applies configuration found inside of the source code. This method is only + * called when ESLint is running with inline configuration allowed. + * @returns {{problems:Array,configs:{config:FlatConfigArray,loc:Location}}} Information + * that ESLint needs to further process the inline configuration. + */ + applyInlineConfig() { + + const problems = []; + const configs = []; + const exportedVariables = {}; + const inlineGlobals = Object.create(null); + + this.getInlineConfigNodes().forEach(comment => { + + const { label, value } = commentParser.parseDirective(comment.value); + + switch (label) { + case "exported": + Object.assign(exportedVariables, commentParser.parseListConfig(value)); + break; + + case "globals": + case "global": + for (const [id, idSetting] of Object.entries(commentParser.parseStringConfig(value))) { + let normalizedValue; + + try { + normalizedValue = normalizeConfigGlobal(idSetting); + } catch (err) { + problems.push({ + ruleId: null, + loc: comment.loc, + message: err.message + }); + continue; + } + + if (inlineGlobals[id]) { + inlineGlobals[id].comments.push(comment); + inlineGlobals[id].value = normalizedValue; + } else { + inlineGlobals[id] = { + comments: [comment], + value: normalizedValue + }; + } + } + break; + + case "eslint": { + const parseResult = commentParser.parseJSONLikeConfig(value); + + if (parseResult.ok) { + configs.push({ + config: { + rules: parseResult.config + }, + loc: comment.loc + }); + } else { + problems.push({ + ruleId: null, + loc: comment.loc, + message: parseResult.error.message + }); + } + + break; + } + + // no default + } + }); + + // save all the new variables for later + const varsCache = this[caches].get("vars"); + + varsCache.set("inlineGlobals", inlineGlobals); + varsCache.set("exportedVariables", exportedVariables); + + return { + configs, + problems + }; + } + + /** + * Called by ESLint core to indicate that it has finished providing + * information. We now add in all the missing variables and ensure that + * state-changing methods cannot be called by rules. + * @returns {void} + */ + finalize() { + + const varsCache = this[caches].get("vars"); + const configGlobals = varsCache.get("configGlobals"); + const inlineGlobals = varsCache.get("inlineGlobals"); + const exportedVariables = varsCache.get("exportedVariables"); + const globalScope = this.scopeManager.scopes[0]; + + addDeclaredGlobals(globalScope, configGlobals, inlineGlobals); + + if (exportedVariables) { + markExportedVariables(globalScope, exportedVariables); + } + + } + + /** + * Traverse the source code and return the steps that were taken. + * @returns {Array} The steps that were taken while traversing the source code. + */ + traverse() { + + // Because the AST doesn't mutate, we can cache the steps + if (this.#steps) { + return this.#steps; + } + + const steps = this.#steps = []; + + /* + * This logic works for any AST, not just ESTree. Because ESLint has allowed + * custom parsers to return any AST, we need to ensure that the traversal + * logic works for any AST. + */ + const emitter = createEmitter(); + let analyzer = { + enterNode(node) { + steps.push(new VisitNodeStep({ + target: node, + phase: 1, + args: [node, node.parent] + })); + }, + leaveNode(node) { + steps.push(new VisitNodeStep({ + target: node, + phase: 2, + args: [node, node.parent] + })); + }, + emitter + }; + + /* + * We do code path analysis for ESTree only. Code path analysis is not + * necessary for other ASTs, and it's also not possible to do for other + * ASTs because the necessary information is not available. + * + * Generally speaking, we can tell that the AST is an ESTree if it has a + * Program node at the top level. This is not a perfect heuristic, but it + * is good enough for now. + */ + if (this.isESTree) { + analyzer = new CodePathAnalyzer(analyzer); + + CODE_PATH_EVENTS.forEach(eventName => { + emitter.on(eventName, (...args) => { + steps.push(new CallMethodStep({ + target: eventName, + args + })); + }); + }); + } + + /* + * The actual AST traversal is done by the `Traverser` class. This class + * is responsible for walking the AST and calling the appropriate methods + * on the `analyzer` object, which is appropriate for the given AST. + */ + Traverser.traverse(this.ast, { + enter(node, parent) { + + // save the parent node on a property for backwards compatibility + node.parent = parent; + + analyzer.enterNode(node); + }, + leave(node) { + analyzer.leaveNode(node); + }, + visitorKeys: this.visitorKeys + }); + + return steps; + } +} + +module.exports = SourceCode; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js new file mode 100644 index 0000000..7255a62 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Define the cursor which iterates tokens and comments in reverse. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens and comments in reverse. + */ +module.exports = class BackwardTokenCommentCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.comments = comments; + this.tokenIndex = utils.getLastIndex(tokens, indexMap, endLoc); + this.commentIndex = utils.search(comments, endLoc) - 1; + this.border = startLoc; + } + + /** @inheritdoc */ + moveNext() { + const token = (this.tokenIndex >= 0) ? this.tokens[this.tokenIndex] : null; + const comment = (this.commentIndex >= 0) ? this.comments[this.commentIndex] : null; + + if (token && (!comment || token.range[1] > comment.range[1])) { + this.current = token; + this.tokenIndex -= 1; + } else if (comment) { + this.current = comment; + this.commentIndex -= 1; + } else { + this.current = null; + } + + return Boolean(this.current) && (this.border === -1 || this.current.range[0] >= this.border); + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js new file mode 100644 index 0000000..d3469c9 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Define the cursor which iterates tokens only in reverse. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const { getLastIndex, getFirstIndex } = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only in reverse. + */ +module.exports = class BackwardTokenCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.index = getLastIndex(tokens, indexMap, endLoc); + this.indexEnd = getFirstIndex(tokens, indexMap, startLoc); + } + + /** @inheritdoc */ + moveNext() { + if (this.index >= this.indexEnd) { + this.current = this.tokens[this.index]; + this.index -= 1; + return true; + } + return false; + } + + /* + * + * Shorthand for performance. + * + */ + + /** @inheritdoc */ + getOneToken() { + return (this.index >= this.indexEnd) ? this.tokens[this.index] : null; + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js new file mode 100644 index 0000000..0b72600 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Define the abstract class about cursors which iterate tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The abstract class about cursors which iterate tokens. + * + * This class has 2 abstract methods. + * + * - `current: Token | Comment | null` ... The current token. + * - `moveNext(): boolean` ... Moves this cursor to the next token. If the next token didn't exist, it returns `false`. + * + * This is similar to ES2015 Iterators. + * However, Iterators were slow (at 2017-01), so I created this class as similar to C# IEnumerable. + * + * There are the following known sub classes. + * + * - ForwardTokenCursor .......... The cursor which iterates tokens only. + * - BackwardTokenCursor ......... The cursor which iterates tokens only in reverse. + * - ForwardTokenCommentCursor ... The cursor which iterates tokens and comments. + * - BackwardTokenCommentCursor .. The cursor which iterates tokens and comments in reverse. + * - DecorativeCursor + * - FilterCursor ............ The cursor which ignores the specified tokens. + * - SkipCursor .............. The cursor which ignores the first few tokens. + * - LimitCursor ............. The cursor which limits the count of tokens. + * + */ +module.exports = class Cursor { + + /** + * Initializes this cursor. + */ + constructor() { + this.current = null; + } + + /** + * Gets the first token. + * This consumes this cursor. + * @returns {Token|Comment} The first token or null. + */ + getOneToken() { + return this.moveNext() ? this.current : null; + } + + /** + * Gets the first tokens. + * This consumes this cursor. + * @returns {(Token|Comment)[]} All tokens. + */ + getAllTokens() { + const tokens = []; + + while (this.moveNext()) { + tokens.push(this.current); + } + + return tokens; + } + + /** + * Moves this cursor to the next token. + * @returns {boolean} `true` if the next token exists. + * @abstract + */ + /* c8 ignore next */ + moveNext() { // eslint-disable-line class-methods-use-this -- Unused + throw new Error("Not implemented."); + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js b/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js new file mode 100644 index 0000000..f2676f1 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js @@ -0,0 +1,92 @@ +/** + * @fileoverview Define 2 token factories; forward and backward. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const BackwardTokenCommentCursor = require("./backward-token-comment-cursor"); +const BackwardTokenCursor = require("./backward-token-cursor"); +const FilterCursor = require("./filter-cursor"); +const ForwardTokenCommentCursor = require("./forward-token-comment-cursor"); +const ForwardTokenCursor = require("./forward-token-cursor"); +const LimitCursor = require("./limit-cursor"); +const SkipCursor = require("./skip-cursor"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * The cursor factory. + * @private + */ +class CursorFactory { + + /** + * Initializes this cursor. + * @param {Function} TokenCursor The class of the cursor which iterates tokens only. + * @param {Function} TokenCommentCursor The class of the cursor which iterates the mix of tokens and comments. + */ + constructor(TokenCursor, TokenCommentCursor) { + this.TokenCursor = TokenCursor; + this.TokenCommentCursor = TokenCommentCursor; + } + + /** + * Creates a base cursor instance that can be decorated by createCursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @returns {Cursor} The created base cursor. + */ + createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments) { + const Cursor = includeComments ? this.TokenCommentCursor : this.TokenCursor; + + return new Cursor(tokens, comments, indexMap, startLoc, endLoc); + } + + /** + * Creates a cursor that iterates tokens with normalized options. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @param {Function|null} filter The predicate function to choose tokens. + * @param {number} skip The count of tokens the cursor skips. + * @param {number} count The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + */ + createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, count) { + let cursor = this.createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments); + + if (filter) { + cursor = new FilterCursor(cursor, filter); + } + if (skip >= 1) { + cursor = new SkipCursor(cursor, skip); + } + if (count >= 0) { + cursor = new LimitCursor(cursor, count); + } + + return cursor; + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +module.exports = { + forward: new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor), + backward: new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor) +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js new file mode 100644 index 0000000..3ee7b0b --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Define the abstract class about cursors which manipulate another cursor. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The abstract class about cursors which manipulate another cursor. + */ +module.exports = class DecorativeCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + */ + constructor(cursor) { + super(); + this.cursor = cursor; + } + + /** @inheritdoc */ + moveNext() { + const retv = this.cursor.moveNext(); + + this.current = this.cursor.current; + + return retv; + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js new file mode 100644 index 0000000..08c4f22 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Define the cursor which ignores specified tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which ignores specified tokens. + */ +module.exports = class FilterCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {Function} predicate The predicate function to decide tokens this cursor iterates. + */ + constructor(cursor, predicate) { + super(cursor); + this.predicate = predicate; + } + + /** @inheritdoc */ + moveNext() { + const predicate = this.predicate; + + while (super.moveNext()) { + if (predicate(this.current)) { + return true; + } + } + return false; + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js new file mode 100644 index 0000000..8aa46c2 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Define the cursor which iterates tokens and comments. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const { getFirstIndex, search } = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens and comments. + */ +module.exports = class ForwardTokenCommentCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.comments = comments; + this.tokenIndex = getFirstIndex(tokens, indexMap, startLoc); + this.commentIndex = search(comments, startLoc); + this.border = endLoc; + } + + /** @inheritdoc */ + moveNext() { + const token = (this.tokenIndex < this.tokens.length) ? this.tokens[this.tokenIndex] : null; + const comment = (this.commentIndex < this.comments.length) ? this.comments[this.commentIndex] : null; + + if (token && (!comment || token.range[0] < comment.range[0])) { + this.current = token; + this.tokenIndex += 1; + } else if (comment) { + this.current = comment; + this.commentIndex += 1; + } else { + this.current = null; + } + + return Boolean(this.current) && (this.border === -1 || this.current.range[1] <= this.border); + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js new file mode 100644 index 0000000..9305cbe --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Define the cursor which iterates tokens only. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const { getFirstIndex, getLastIndex } = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only. + */ +module.exports = class ForwardTokenCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.index = getFirstIndex(tokens, indexMap, startLoc); + this.indexEnd = getLastIndex(tokens, indexMap, endLoc); + } + + /** @inheritdoc */ + moveNext() { + if (this.index <= this.indexEnd) { + this.current = this.tokens[this.index]; + this.index += 1; + return true; + } + return false; + } + + /* + * + * Shorthand for performance. + * + */ + + /** @inheritdoc */ + getOneToken() { + return (this.index <= this.indexEnd) ? this.tokens[this.index] : null; + } + + /** @inheritdoc */ + getAllTokens() { + return this.tokens.slice(this.index, this.indexEnd + 1); + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/index.js b/node_modules/eslint/lib/languages/js/source-code/token-store/index.js new file mode 100644 index 0000000..d44191a --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/index.js @@ -0,0 +1,627 @@ +/** + * @fileoverview Object to handle access and retrieval of tokens. + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { isCommentToken } = require("@eslint-community/eslint-utils"); +const assert = require("../../../../shared/assert"); +const cursors = require("./cursors"); +const ForwardTokenCursor = require("./forward-token-cursor"); +const PaddedTokenCursor = require("./padded-token-cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TOKENS = Symbol("tokens"); +const COMMENTS = Symbol("comments"); +const INDEX_MAP = Symbol("indexMap"); + +/** + * Creates the map from locations to indices in `tokens`. + * + * The first/last location of tokens is mapped to the index of the token. + * The first/last location of comments is mapped to the index of the next token of each comment. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @returns {Object} The map from locations to indices in `tokens`. + * @private + */ +function createIndexMap(tokens, comments) { + const map = Object.create(null); + let tokenIndex = 0; + let commentIndex = 0; + let nextStart; + let range; + + while (tokenIndex < tokens.length || commentIndex < comments.length) { + nextStart = (commentIndex < comments.length) ? comments[commentIndex].range[0] : Number.MAX_SAFE_INTEGER; + while (tokenIndex < tokens.length && (range = tokens[tokenIndex].range)[0] < nextStart) { + map[range[0]] = tokenIndex; + map[range[1] - 1] = tokenIndex; + tokenIndex += 1; + } + + nextStart = (tokenIndex < tokens.length) ? tokens[tokenIndex].range[0] : Number.MAX_SAFE_INTEGER; + while (commentIndex < comments.length && (range = comments[commentIndex].range)[0] < nextStart) { + map[range[0]] = tokenIndex; + map[range[1] - 1] = tokenIndex; + commentIndex += 1; + } + } + + return map; +} + +/** + * Creates the cursor iterates tokens with options. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.skip=0] The count of tokens the cursor skips. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithSkip(factory, tokens, comments, indexMap, startLoc, endLoc, opts) { + let includeComments = false; + let skip = 0; + let filter = null; + + if (typeof opts === "number") { + skip = opts | 0; + } else if (typeof opts === "function") { + filter = opts; + } else if (opts) { + includeComments = !!opts.includeComments; + skip = opts.skip | 0; + filter = opts.filter || null; + } + assert(skip >= 0, "options.skip should be zero or a positive integer."); + assert(!filter || typeof filter === "function", "options.filter should be a function."); + + return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, -1); +} + +/** + * Creates the cursor iterates tokens with options. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithCount(factory, tokens, comments, indexMap, startLoc, endLoc, opts) { + let includeComments = false; + let count = 0; + let countExists = false; + let filter = null; + + if (typeof opts === "number") { + count = opts | 0; + countExists = true; + } else if (typeof opts === "function") { + filter = opts; + } else if (opts) { + includeComments = !!opts.includeComments; + count = opts.count | 0; + countExists = typeof opts.count === "number"; + filter = opts.filter || null; + } + assert(count >= 0, "options.count should be zero or a positive integer."); + assert(!filter || typeof filter === "function", "options.filter should be a function."); + + return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, 0, countExists ? count : -1); +} + +/** + * Creates the cursor iterates tokens with options. + * This is overload function of the below. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {Function|Object} opts The option object. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + * @private + */ +/** + * Creates the cursor iterates tokens with options. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {boolean} [afterCount=0] The number of tokens after the node to retrieve. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { + if (typeof beforeCount === "undefined" && typeof afterCount === "undefined") { + return new ForwardTokenCursor(tokens, comments, indexMap, startLoc, endLoc); + } + if (typeof beforeCount === "number" || typeof beforeCount === "undefined") { + return new PaddedTokenCursor(tokens, comments, indexMap, startLoc, endLoc, beforeCount | 0, afterCount | 0); + } + return createCursorWithCount(cursors.forward, tokens, comments, indexMap, startLoc, endLoc, beforeCount); +} + +/** + * Gets comment tokens that are adjacent to the current cursor position. + * @param {Cursor} cursor A cursor instance. + * @returns {Array} An array of comment tokens adjacent to the current cursor position. + * @private + */ +function getAdjacentCommentTokensFromCursor(cursor) { + const tokens = []; + let currentToken = cursor.getOneToken(); + + while (currentToken && isCommentToken(currentToken)) { + tokens.push(currentToken); + currentToken = cursor.getOneToken(); + } + + return tokens; +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The token store. + * + * This class provides methods to get tokens by locations as fast as possible. + * The methods are a part of public API, so we should be careful if it changes this class. + * + * People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens. + * Also people can get a mix of tokens and comments in O(log k), the k is the number of comments. + * Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost. + * This uses binary-searching instead for comments. + */ +module.exports = class TokenStore { + + /** + * Initializes this token store. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + */ + constructor(tokens, comments) { + this[TOKENS] = tokens; + this[COMMENTS] = comments; + this[INDEX_MAP] = createIndexMap(tokens, comments); + } + + //-------------------------------------------------------------------------- + // Gets single token. + //-------------------------------------------------------------------------- + + /** + * Gets the token starting at the specified index. + * @param {number} offset Index of the start of the token's range. + * @param {Object} [options=0] The option object. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @returns {Token|null} The token starting at index, or null if no such token. + */ + getTokenByRangeStart(offset, options) { + const includeComments = options && options.includeComments; + const token = cursors.forward.createBaseCursor( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + offset, + -1, + includeComments + ).getOneToken(); + + if (token && token.range[0] === offset) { + return token; + } + return null; + } + + /** + * Gets the first token of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.skip=0] The count of tokens the cursor skips. + * @returns {Token|null} An object representing the token. + */ + getFirstToken(node, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getOneToken(); + } + + /** + * Gets the last token of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getLastToken(node, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getOneToken(); + } + + /** + * Gets the token that precedes a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getTokenBefore(node, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + node.range[0], + options + ).getOneToken(); + } + + /** + * Gets the token that follows a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getTokenAfter(node, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[1], + -1, + options + ).getOneToken(); + } + + /** + * Gets the first token between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getFirstTokenBetween(left, right, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getOneToken(); + } + + /** + * Gets the last token between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getLastTokenBetween(left, right, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getOneToken(); + } + + /** + * Gets the token that precedes a given node or token in the token stream. + * This is defined for backward compatibility. Use `includeComments` option instead. + * TODO: We have a plan to remove this in a future major version. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number} [skip=0] A number of tokens to skip. + * @returns {Token|null} An object representing the token. + * @deprecated + */ + getTokenOrCommentBefore(node, skip) { + return this.getTokenBefore(node, { includeComments: true, skip }); + } + + /** + * Gets the token that follows a given node or token in the token stream. + * This is defined for backward compatibility. Use `includeComments` option instead. + * TODO: We have a plan to remove this in a future major version. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number} [skip=0] A number of tokens to skip. + * @returns {Token|null} An object representing the token. + * @deprecated + */ + getTokenOrCommentAfter(node, skip) { + return this.getTokenAfter(node, { includeComments: true, skip }); + } + + //-------------------------------------------------------------------------- + // Gets multiple tokens. + //-------------------------------------------------------------------------- + + /** + * Gets the first `count` tokens of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Tokens. + */ + getFirstTokens(node, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getAllTokens(); + } + + /** + * Gets the last `count` tokens of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getLastTokens(node, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getAllTokens().reverse(); + } + + /** + * Gets the `count` tokens that precedes a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getTokensBefore(node, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + node.range[0], + options + ).getAllTokens().reverse(); + } + + /** + * Gets the `count` tokens that follows a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getTokensAfter(node, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[1], + -1, + options + ).getAllTokens(); + } + + /** + * Gets the first `count` tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens between left and right. + */ + getFirstTokensBetween(left, right, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getAllTokens(); + } + + /** + * Gets the last `count` tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens between left and right. + */ + getLastTokensBetween(left, right, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getAllTokens().reverse(); + } + + /** + * Gets all tokens that are related to the given node. + * @param {ASTNode} node The AST node. + * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Array of objects representing tokens. + */ + /** + * Gets all tokens that are related to the given node. + * @param {ASTNode} node The AST node. + * @param {int} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {int} [afterCount=0] The number of tokens after the node to retrieve. + * @returns {Token[]} Array of objects representing tokens. + */ + getTokens(node, beforeCount, afterCount) { + return createCursorWithPadding( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + beforeCount, + afterCount + ).getAllTokens(); + } + + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Tokens between left and right. + */ + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {int} [padding=0] Number of extra tokens on either side of center. + * @returns {Token[]} Tokens between left and right. + */ + getTokensBetween(left, right, padding) { + return createCursorWithPadding( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + padding, + padding + ).getAllTokens(); + } + + //-------------------------------------------------------------------------- + // Others. + //-------------------------------------------------------------------------- + + /** + * Checks whether any comments exist or not between the given 2 nodes. + * @param {ASTNode} left The node to check. + * @param {ASTNode} right The node to check. + * @returns {boolean} `true` if one or more comments exist. + */ + commentsExistBetween(left, right) { + const index = utils.search(this[COMMENTS], left.range[1]); + + return ( + index < this[COMMENTS].length && + this[COMMENTS][index].range[1] <= right.range[0] + ); + } + + /** + * Gets all comment tokens directly before the given node or token. + * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsBefore(nodeOrToken) { + const cursor = createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + nodeOrToken.range[0], + { includeComments: true } + ); + + return getAdjacentCommentTokensFromCursor(cursor).reverse(); + } + + /** + * Gets all comment tokens directly after the given node or token. + * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsAfter(nodeOrToken) { + const cursor = createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + nodeOrToken.range[1], + -1, + { includeComments: true } + ); + + return getAdjacentCommentTokensFromCursor(cursor); + } + + /** + * Gets all comment tokens inside the given node. + * @param {ASTNode} node The AST node to get the comments for. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsInside(node) { + return this.getTokens(node, { + includeComments: true, + filter: isCommentToken + }); + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js new file mode 100644 index 0000000..0fd92a7 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js @@ -0,0 +1,40 @@ +/** + * @fileoverview Define the cursor which limits the number of tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which limits the number of tokens. + */ +module.exports = class LimitCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor iterates. + */ + constructor(cursor, count) { + super(cursor); + this.count = count; + } + + /** @inheritdoc */ + moveNext() { + if (this.count > 0) { + this.count -= 1; + return super.moveNext(); + } + return false; + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js new file mode 100644 index 0000000..89349fa --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js @@ -0,0 +1,38 @@ +/** + * @fileoverview Define the cursor which iterates tokens only, with inflated range. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const ForwardTokenCursor = require("./forward-token-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only, with inflated range. + * This is for the backward compatibility of padding options. + */ +module.exports = class PaddedTokenCursor extends ForwardTokenCursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} beforeCount The number of tokens this cursor iterates before start. + * @param {number} afterCount The number of tokens this cursor iterates after end. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { + super(tokens, comments, indexMap, startLoc, endLoc); + this.index = Math.max(0, this.index - beforeCount); + this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCount); + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js b/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js new file mode 100644 index 0000000..f068f53 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Define the cursor which ignores the first few tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which ignores the first few tokens. + */ +module.exports = class SkipCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor skips. + */ + constructor(cursor, count) { + super(cursor); + this.count = count; + } + + /** @inheritdoc */ + moveNext() { + while (this.count > 0) { + this.count -= 1; + if (!super.moveNext()) { + return false; + } + } + return super.moveNext(); + } +}; diff --git a/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js b/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js new file mode 100644 index 0000000..3e01470 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js @@ -0,0 +1,107 @@ +/** + * @fileoverview Define utility functions for token store. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * Finds the index of the first token which is after the given location. + * If it was not found, this returns `tokens.length`. + * @param {(Token|Comment)[]} tokens It searches the token in this list. + * @param {number} location The location to search. + * @returns {number} The found index or `tokens.length`. + */ +exports.search = function search(tokens, location) { + for (let minIndex = 0, maxIndex = tokens.length - 1; minIndex <= maxIndex;) { + + /* + * Calculate the index in the middle between minIndex and maxIndex. + * `| 0` is used to round a fractional value down to the nearest integer: this is similar to + * using `Math.trunc()` or `Math.floor()`, but performance tests have shown this method to + * be faster. + */ + const index = (minIndex + maxIndex) / 2 | 0; + const token = tokens[index]; + const tokenStartLocation = token.range[0]; + + if (location <= tokenStartLocation) { + if (index === minIndex) { + return index; + } + maxIndex = index; + } else { + minIndex = index + 1; + } + } + return tokens.length; +}; + +/** + * Gets the index of the `startLoc` in `tokens`. + * `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} startLoc The location to get an index. + * @returns {number} The index. + */ +exports.getFirstIndex = function getFirstIndex(tokens, indexMap, startLoc) { + if (startLoc in indexMap) { + return indexMap[startLoc]; + } + if ((startLoc - 1) in indexMap) { + const index = indexMap[startLoc - 1]; + const token = tokens[index]; + + // If the mapped index is out of bounds, the returned cursor index will point after the end of the tokens array. + if (!token) { + return tokens.length; + } + + /* + * For the map of "comment's location -> token's index", it points the next token of a comment. + * In that case, +1 is unnecessary. + */ + if (token.range[0] >= startLoc) { + return index; + } + return index + 1; + } + return 0; +}; + +/** + * Gets the index of the `endLoc` in `tokens`. + * The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} endLoc The location to get an index. + * @returns {number} The index. + */ +exports.getLastIndex = function getLastIndex(tokens, indexMap, endLoc) { + if (endLoc in indexMap) { + return indexMap[endLoc] - 1; + } + if ((endLoc - 1) in indexMap) { + const index = indexMap[endLoc - 1]; + const token = tokens[index]; + + // If the mapped index is out of bounds, the returned cursor index will point before the end of the tokens array. + if (!token) { + return tokens.length - 1; + } + + /* + * For the map of "comment's location -> token's index", it points the next token of a comment. + * In that case, -1 is necessary. + */ + if (token.range[1] > endLoc) { + return index - 1; + } + return index; + } + return tokens.length - 1; +}; diff --git a/node_modules/eslint/lib/languages/js/validate-language-options.js b/node_modules/eslint/lib/languages/js/validate-language-options.js new file mode 100644 index 0000000..ba1e5e3 --- /dev/null +++ b/node_modules/eslint/lib/languages/js/validate-language-options.js @@ -0,0 +1,181 @@ +/** + * @fileoverview The schema to validate language options + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Data +//----------------------------------------------------------------------------- + +const globalVariablesValues = new Set([ + true, "true", "writable", "writeable", + false, "false", "readonly", "readable", null, + "off" +]); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Check if a value is a non-null object. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(value) { + return typeof value === "object" && value !== null; +} + +/** + * Check if a value is a non-null non-array object. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is a non-null non-array object. + */ +function isNonArrayObject(value) { + return isNonNullObject(value) && !Array.isArray(value); +} + +/** + * Check if a value is undefined. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is undefined. + */ +function isUndefined(value) { + return typeof value === "undefined"; +} + +//----------------------------------------------------------------------------- +// Schemas +//----------------------------------------------------------------------------- + +/** + * Validates the ecmaVersion property. + * @param {string|number} ecmaVersion The value to check. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ +function validateEcmaVersion(ecmaVersion) { + + if (isUndefined(ecmaVersion)) { + throw new TypeError("Key \"ecmaVersion\": Expected an \"ecmaVersion\" property."); + } + + if (typeof ecmaVersion !== "number" && ecmaVersion !== "latest") { + throw new TypeError("Key \"ecmaVersion\": Expected a number or \"latest\"."); + } + +} + +/** + * Validates the sourceType property. + * @param {string} sourceType The value to check. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ +function validateSourceType(sourceType) { + + if (typeof sourceType !== "string" || !/^(?:script|module|commonjs)$/u.test(sourceType)) { + throw new TypeError("Key \"sourceType\": Expected \"script\", \"module\", or \"commonjs\"."); + } + +} + +/** + * Validates the globals property. + * @param {Object} globals The value to check. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ +function validateGlobals(globals) { + + if (!isNonArrayObject(globals)) { + throw new TypeError("Key \"globals\": Expected an object."); + } + + for (const key of Object.keys(globals)) { + + // avoid hairy edge case + if (key === "__proto__") { + continue; + } + + if (key !== key.trim()) { + throw new TypeError(`Key "globals": Global "${key}" has leading or trailing whitespace.`); + } + + if (!globalVariablesValues.has(globals[key])) { + throw new TypeError(`Key "globals": Key "${key}": Expected "readonly", "writable", or "off".`); + } + } +} + +/** + * Validates the parser property. + * @param {Object} parser The value to check. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ +function validateParser(parser) { + + if (!parser || typeof parser !== "object" || + (typeof parser.parse !== "function" && typeof parser.parseForESLint !== "function") + ) { + throw new TypeError("Key \"parser\": Expected object with parse() or parseForESLint() method."); + } + +} + +/** + * Validates the language options. + * @param {Object} languageOptions The language options to validate. + * @returns {void} + * @throws {TypeError} If the language options are invalid. + */ +function validateLanguageOptions(languageOptions) { + + if (!isNonArrayObject(languageOptions)) { + throw new TypeError("Expected an object."); + } + + const { + ecmaVersion, + sourceType, + globals, + parser, + parserOptions, + ...otherOptions + } = languageOptions; + + if ("ecmaVersion" in languageOptions) { + validateEcmaVersion(ecmaVersion); + } + + if ("sourceType" in languageOptions) { + validateSourceType(sourceType); + } + + if ("globals" in languageOptions) { + validateGlobals(globals); + } + + if ("parser" in languageOptions) { + validateParser(parser); + } + + if ("parserOptions" in languageOptions) { + if (!isNonArrayObject(parserOptions)) { + throw new TypeError("Key \"parserOptions\": Expected an object."); + } + } + + const otherOptionKeys = Object.keys(otherOptions); + + if (otherOptionKeys.length > 0) { + throw new TypeError(`Unexpected key "${otherOptionKeys[0]}" found.`); + } + +} + +module.exports = { validateLanguageOptions }; diff --git a/node_modules/eslint/lib/linter/apply-disable-directives.js b/node_modules/eslint/lib/linter/apply-disable-directives.js new file mode 100644 index 0000000..1f07447 --- /dev/null +++ b/node_modules/eslint/lib/linter/apply-disable-directives.js @@ -0,0 +1,502 @@ +/** + * @fileoverview A module that filters reported problems based on `eslint-disable` and `eslint-enable` comments + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("@eslint/core").Language} Language */ +/** @typedef {import("@eslint/core").Position} Position */ +/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */ + +//------------------------------------------------------------------------------ +// Module Definition +//------------------------------------------------------------------------------ + +const escapeRegExp = require("escape-string-regexp"); +const { + Legacy: { + ConfigOps + } +} = require("@eslint/eslintrc/universal"); + +/** + * Compares the locations of two objects in a source file + * @param {Position} itemA The first object + * @param {Position} itemB The second object + * @returns {number} A value less than 1 if itemA appears before itemB in the source file, greater than 1 if + * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location. + */ +function compareLocations(itemA, itemB) { + return itemA.line - itemB.line || itemA.column - itemB.column; +} + +/** + * Groups a set of directives into sub-arrays by their parent comment. + * @param {Iterable} directives Unused directives to be removed. + * @returns {Directive[][]} Directives grouped by their parent comment. + */ +function groupByParentDirective(directives) { + const groups = new Map(); + + for (const directive of directives) { + const { unprocessedDirective: { parentDirective } } = directive; + + if (groups.has(parentDirective)) { + groups.get(parentDirective).push(directive); + } else { + groups.set(parentDirective, [directive]); + } + } + + return [...groups.values()]; +} + +/** + * Creates removal details for a set of directives within the same comment. + * @param {Directive[]} directives Unused directives to be removed. + * @param {{node: Token, value: string}} parentDirective Data about the backing directive. + * @param {SourceCode} sourceCode The source code object for the file being linted. + * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems. + */ +function createIndividualDirectivesRemoval(directives, parentDirective, sourceCode) { + + /* + * Get the list of the rules text without any surrounding whitespace. In order to preserve the original + * formatting, we don't want to change that whitespace. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ + const listText = parentDirective.value.trim(); + + // Calculate where it starts in the source code text + const listStart = sourceCode.text.indexOf(listText, sourceCode.getRange(parentDirective.node)[0]); + + /* + * We can assume that `listText` contains multiple elements. + * Otherwise, this function wouldn't be called - if there is + * only one rule in the list, then the whole comment must be removed. + */ + + return directives.map(directive => { + const { ruleId } = directive; + + const regex = new RegExp(String.raw`(?:^|\s*,\s*)(?['"]?)${escapeRegExp(ruleId)}\k(?:\s*,\s*|$)`, "u"); + const match = regex.exec(listText); + const matchedText = match[0]; + const matchStart = listStart + match.index; + const matchEnd = matchStart + matchedText.length; + + const firstIndexOfComma = matchedText.indexOf(","); + const lastIndexOfComma = matchedText.lastIndexOf(","); + + let removalStart, removalEnd; + + if (firstIndexOfComma !== lastIndexOfComma) { + + /* + * Since there are two commas, this must one of the elements in the middle of the list. + * Matched range starts where the previous rule name ends, and ends where the next rule name starts. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^^^^ + * + * We want to remove only the content between the two commas, and also one of the commas. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^ + */ + removalStart = matchStart + firstIndexOfComma; + removalEnd = matchStart + lastIndexOfComma; + + } else { + + /* + * This is either the first element or the last element. + * + * If this is the first element, matched range starts where the first rule name starts + * and ends where the second rule name starts. This is exactly the range we want + * to remove so that the second rule name will start where the first one was starting + * and thus preserve the original formatting. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^ + * + * Similarly, if this is the last element, we've already matched the range we want to + * remove. The previous rule name will end where the last one was ending, relative + * to the content on the right side. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^^^ + */ + removalStart = matchStart; + removalEnd = matchEnd; + } + + return { + description: `'${ruleId}'`, + fix: { + range: [ + removalStart, + removalEnd + ], + text: "" + }, + unprocessedDirective: directive.unprocessedDirective + }; + }); +} + +/** + * Creates a description of deleting an entire unused disable directive. + * @param {Directive[]} directives Unused directives to be removed. + * @param {Token} node The backing Comment token. + * @param {SourceCode} sourceCode The source code object for the file being linted. + * @returns {{ description, fix, unprocessedDirective }} Details for later creation of an output problem. + */ +function createDirectiveRemoval(directives, node, sourceCode) { + const range = sourceCode.getRange(node); + const ruleIds = directives.filter(directive => directive.ruleId).map(directive => `'${directive.ruleId}'`); + + return { + description: ruleIds.length <= 2 + ? ruleIds.join(" or ") + : `${ruleIds.slice(0, ruleIds.length - 1).join(", ")}, or ${ruleIds.at(-1)}`, + fix: { + range, + text: " " + }, + unprocessedDirective: directives[0].unprocessedDirective + }; +} + +/** + * Parses details from directives to create output Problems. + * @param {Iterable} allDirectives Unused directives to be removed. + * @param {SourceCode} sourceCode The source code object for the file being linted. + * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems. + */ +function processUnusedDirectives(allDirectives, sourceCode) { + const directiveGroups = groupByParentDirective(allDirectives); + + return directiveGroups.flatMap( + directives => { + const { parentDirective } = directives[0].unprocessedDirective; + const remainingRuleIds = new Set(parentDirective.ruleIds); + + for (const directive of directives) { + remainingRuleIds.delete(directive.ruleId); + } + + return remainingRuleIds.size + ? createIndividualDirectivesRemoval(directives, parentDirective, sourceCode) + : [createDirectiveRemoval(directives, parentDirective.node, sourceCode)]; + } + ); +} + +/** + * Collect eslint-enable comments that are removing suppressions by eslint-disable comments. + * @param {Directive[]} directives The directives to check. + * @returns {Set} The used eslint-enable comments + */ +function collectUsedEnableDirectives(directives) { + + /** + * A Map of `eslint-enable` keyed by ruleIds that may be marked as used. + * If `eslint-enable` does not have a ruleId, the key will be `null`. + * @type {Map} + */ + const enabledRules = new Map(); + + /** + * A Set of `eslint-enable` marked as used. + * It is also the return value of `collectUsedEnableDirectives` function. + * @type {Set} + */ + const usedEnableDirectives = new Set(); + + /* + * Checks the directives backwards to see if the encountered `eslint-enable` is used by the previous `eslint-disable`, + * and if so, stores the `eslint-enable` in `usedEnableDirectives`. + */ + for (let index = directives.length - 1; index >= 0; index--) { + const directive = directives[index]; + + if (directive.type === "disable") { + if (enabledRules.size === 0) { + continue; + } + if (directive.ruleId === null) { + + // If encounter `eslint-disable` without ruleId, + // mark all `eslint-enable` currently held in enabledRules as used. + // e.g. + // /* eslint-disable */ <- current directive + // /* eslint-enable rule-id1 */ <- used + // /* eslint-enable rule-id2 */ <- used + // /* eslint-enable */ <- used + for (const enableDirective of enabledRules.values()) { + usedEnableDirectives.add(enableDirective); + } + enabledRules.clear(); + } else { + const enableDirective = enabledRules.get(directive.ruleId); + + if (enableDirective) { + + // If encounter `eslint-disable` with ruleId, and there is an `eslint-enable` with the same ruleId in enabledRules, + // mark `eslint-enable` with ruleId as used. + // e.g. + // /* eslint-disable rule-id */ <- current directive + // /* eslint-enable rule-id */ <- used + usedEnableDirectives.add(enableDirective); + } else { + const enabledDirectiveWithoutRuleId = enabledRules.get(null); + + if (enabledDirectiveWithoutRuleId) { + + // If encounter `eslint-disable` with ruleId, and there is no `eslint-enable` with the same ruleId in enabledRules, + // mark `eslint-enable` without ruleId as used. + // e.g. + // /* eslint-disable rule-id */ <- current directive + // /* eslint-enable */ <- used + usedEnableDirectives.add(enabledDirectiveWithoutRuleId); + } + } + } + } else if (directive.type === "enable") { + if (directive.ruleId === null) { + + // If encounter `eslint-enable` without ruleId, the `eslint-enable` that follows it are unused. + // So clear enabledRules. + // e.g. + // /* eslint-enable */ <- current directive + // /* eslint-enable rule-id *// <- unused + // /* eslint-enable */ <- unused + enabledRules.clear(); + enabledRules.set(null, directive); + } else { + enabledRules.set(directive.ruleId, directive); + } + } + } + return usedEnableDirectives; +} + +/** + * This is the same as the exported function, except that it + * doesn't handle disable-line and disable-next-line directives, and it always reports unused + * disable directives. + * @param {Object} options options for applying directives. This is the same as the options + * for the exported function, except that `reportUnusedDisableDirectives` is not supported + * (this function always reports unused disable directives). + * @returns {{problems: LintMessage[], unusedDirectives: LintMessage[]}} An object with a list + * of problems (including suppressed ones) and unused eslint-disable directives + */ +function applyDirectives(options) { + const problems = []; + const usedDisableDirectives = new Set(); + const { sourceCode } = options; + + for (const problem of options.problems) { + let disableDirectivesForProblem = []; + let nextDirectiveIndex = 0; + + while ( + nextDirectiveIndex < options.directives.length && + compareLocations(options.directives[nextDirectiveIndex], problem) <= 0 + ) { + const directive = options.directives[nextDirectiveIndex++]; + + if (directive.ruleId === null || directive.ruleId === problem.ruleId) { + switch (directive.type) { + case "disable": + disableDirectivesForProblem.push(directive); + break; + + case "enable": + disableDirectivesForProblem = []; + break; + + // no default + } + } + } + + if (disableDirectivesForProblem.length > 0) { + const suppressions = disableDirectivesForProblem.map(directive => ({ + kind: "directive", + justification: directive.unprocessedDirective.justification + })); + + if (problem.suppressions) { + problem.suppressions = problem.suppressions.concat(suppressions); + } else { + problem.suppressions = suppressions; + usedDisableDirectives.add(disableDirectivesForProblem.at(-1)); + } + } + + problems.push(problem); + } + + const unusedDisableDirectivesToReport = options.directives + .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive) && !options.rulesToIgnore.has(directive.ruleId)); + + + const unusedEnableDirectivesToReport = new Set( + options.directives.filter(directive => directive.unprocessedDirective.type === "enable" && !options.rulesToIgnore.has(directive.ruleId)) + ); + + /* + * If directives has the eslint-enable directive, + * check whether the eslint-enable comment is used. + */ + if (unusedEnableDirectivesToReport.size > 0) { + for (const directive of collectUsedEnableDirectives(options.directives)) { + unusedEnableDirectivesToReport.delete(directive); + } + } + + const processed = processUnusedDirectives(unusedDisableDirectivesToReport, sourceCode) + .concat(processUnusedDirectives(unusedEnableDirectivesToReport, sourceCode)); + const columnOffset = options.language.columnStart === 1 ? 0 : 1; + const lineOffset = options.language.lineStart === 1 ? 0 : 1; + + const unusedDirectives = processed + .map(({ description, fix, unprocessedDirective }) => { + const { parentDirective, type, line, column } = unprocessedDirective; + + let message; + + if (type === "enable") { + message = description + ? `Unused eslint-enable directive (no matching eslint-disable directives were found for ${description}).` + : "Unused eslint-enable directive (no matching eslint-disable directives were found)."; + } else { + message = description + ? `Unused eslint-disable directive (no problems were reported from ${description}).` + : "Unused eslint-disable directive (no problems were reported)."; + } + + const loc = sourceCode.getLoc(parentDirective.node); + + return { + ruleId: null, + message, + line: type === "disable-next-line" ? loc.start.line + lineOffset : line, + column: type === "disable-next-line" ? loc.start.column + columnOffset : column, + severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2, + nodeType: null, + ...options.disableFixes ? {} : { fix } + }; + }); + + return { problems, unusedDirectives }; +} + +/** + * Given a list of directive comments (i.e. metadata about eslint-disable and eslint-enable comments) and a list + * of reported problems, adds the suppression information to the problems. + * @param {Object} options Information about directives and problems + * @param {Language} options.language The language being linted. + * @param {SourceCode} options.sourceCode The source code object for the file being linted. + * @param {{ + * type: ("disable"|"enable"|"disable-line"|"disable-next-line"), + * ruleId: (string|null), + * line: number, + * column: number, + * justification: string + * }} options.directives Directive comments found in the file, with one-based columns. + * Two directive comments can only have the same location if they also have the same type (e.g. a single eslint-disable + * comment for two different rules is represented as two directives). + * @param {{ruleId: (string|null), line: number, column: number}[]} options.problems + * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns. + * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives + * @param {RulesConfig} options.configuredRules The rules configuration. + * @param {Function} options.ruleFilter A predicate function to filter which rules should be executed. + * @param {boolean} options.disableFixes If true, it doesn't make `fix` properties. + * @returns {{ruleId: (string|null), line: number, column: number, suppressions?: {kind: string, justification: string}}[]} + * An object with a list of reported problems, the suppressed of which contain the suppression information. + */ +module.exports = ({ language, sourceCode, directives, disableFixes, problems, configuredRules, ruleFilter, reportUnusedDisableDirectives = "off" }) => { + const blockDirectives = directives + .filter(directive => directive.type === "disable" || directive.type === "enable") + .map(directive => Object.assign({}, directive, { unprocessedDirective: directive })) + .sort(compareLocations); + + const lineDirectives = directives.flatMap(directive => { + switch (directive.type) { + case "disable": + case "enable": + return []; + + case "disable-line": + return [ + { type: "disable", line: directive.line, column: 1, ruleId: directive.ruleId, unprocessedDirective: directive }, + { type: "enable", line: directive.line + 1, column: 0, ruleId: directive.ruleId, unprocessedDirective: directive } + ]; + + case "disable-next-line": + return [ + { type: "disable", line: directive.line + 1, column: 1, ruleId: directive.ruleId, unprocessedDirective: directive }, + { type: "enable", line: directive.line + 2, column: 0, ruleId: directive.ruleId, unprocessedDirective: directive } + ]; + + default: + throw new TypeError(`Unrecognized directive type '${directive.type}'`); + } + }).sort(compareLocations); + + // This determines a list of rules that are not being run by the given ruleFilter, if present. + const rulesToIgnore = configuredRules && ruleFilter + ? new Set(Object.keys(configuredRules).filter(ruleId => { + const severity = ConfigOps.getRuleSeverity(configuredRules[ruleId]); + + // Ignore for disabled rules. + if (severity === 0) { + return false; + } + + return !ruleFilter({ severity, ruleId }); + })) + : new Set(); + + // If no ruleId is supplied that means this directive is applied to all rules, so we can't determine if it's unused if any rules are filtered out. + if (rulesToIgnore.size > 0) { + rulesToIgnore.add(null); + } + + const blockDirectivesResult = applyDirectives({ + language, + sourceCode, + problems, + directives: blockDirectives, + disableFixes, + reportUnusedDisableDirectives, + rulesToIgnore + }); + const lineDirectivesResult = applyDirectives({ + language, + sourceCode, + problems: blockDirectivesResult.problems, + directives: lineDirectives, + disableFixes, + reportUnusedDisableDirectives, + rulesToIgnore + }); + + return reportUnusedDisableDirectives !== "off" + ? lineDirectivesResult.problems + .concat(blockDirectivesResult.unusedDirectives) + .concat(lineDirectivesResult.unusedDirectives) + .sort(compareLocations) + : lineDirectivesResult.problems; +}; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js new file mode 100644 index 0000000..baa6e99 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js @@ -0,0 +1,851 @@ +/** + * @fileoverview A class of the code path analyzer. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("../../shared/assert"), + { breakableTypePattern } = require("../../shared/ast-utils"), + CodePath = require("./code-path"), + CodePathSegment = require("./code-path-segment"), + IdGenerator = require("./id-generator"), + debug = require("./debug-helpers"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a `case` node (not `default` node). + * @param {ASTNode} node A `SwitchCase` node to check. + * @returns {boolean} `true` if the node is a `case` node (not `default` node). + */ +function isCaseNode(node) { + return Boolean(node.test); +} + +/** + * Checks if a given node appears as the value of a PropertyDefinition node. + * @param {ASTNode} node THe node to check. + * @returns {boolean} `true` if the node is a PropertyDefinition value, + * false if not. + */ +function isPropertyDefinitionValue(node) { + const parent = node.parent; + + return parent && parent.type === "PropertyDefinition" && parent.value === node; +} + +/** + * Checks whether the given logical operator is taken into account for the code + * path analysis. + * @param {string} operator The operator found in the LogicalExpression node + * @returns {boolean} `true` if the operator is "&&" or "||" or "??" + */ +function isHandledLogicalOperator(operator) { + return operator === "&&" || operator === "||" || operator === "??"; +} + +/** + * Checks whether the given assignment operator is a logical assignment operator. + * Logical assignments are taken into account for the code path analysis + * because of their short-circuiting semantics. + * @param {string} operator The operator found in the AssignmentExpression node + * @returns {boolean} `true` if the operator is "&&=" or "||=" or "??=" + */ +function isLogicalAssignmentOperator(operator) { + return operator === "&&=" || operator === "||=" || operator === "??="; +} + +/** + * Gets the label if the parent node of a given node is a LabeledStatement. + * @param {ASTNode} node A node to get. + * @returns {string|null} The label or `null`. + */ +function getLabel(node) { + if (node.parent.type === "LabeledStatement") { + return node.parent.label.name; + } + return null; +} + +/** + * Checks whether or not a given logical expression node goes different path + * between the `true` case and the `false` case. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a test of a choice statement. + */ +function isForkingByTrueOrFalse(node) { + const parent = node.parent; + + switch (parent.type) { + case "ConditionalExpression": + case "IfStatement": + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + return parent.test === node; + + case "LogicalExpression": + return isHandledLogicalOperator(parent.operator); + + case "AssignmentExpression": + return isLogicalAssignmentOperator(parent.operator); + + default: + return false; + } +} + +/** + * Gets the boolean value of a given literal node. + * + * This is used to detect infinity loops (e.g. `while (true) {}`). + * Statements preceded by an infinity loop are unreachable if the loop didn't + * have any `break` statement. + * @param {ASTNode} node A node to get. + * @returns {boolean|undefined} a boolean value if the node is a Literal node, + * otherwise `undefined`. + */ +function getBooleanValueIfSimpleConstant(node) { + if (node.type === "Literal") { + return Boolean(node.value); + } + return void 0; +} + +/** + * Checks that a given identifier node is a reference or not. + * + * This is used to detect the first throwable node in a `try` block. + * @param {ASTNode} node An Identifier node to check. + * @returns {boolean} `true` if the node is a reference. + */ +function isIdentifierReference(node) { + const parent = node.parent; + + switch (parent.type) { + case "LabeledStatement": + case "BreakStatement": + case "ContinueStatement": + case "ArrayPattern": + case "RestElement": + case "ImportSpecifier": + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "CatchClause": + return false; + + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ClassDeclaration": + case "ClassExpression": + case "VariableDeclarator": + return parent.id !== node; + + case "Property": + case "PropertyDefinition": + case "MethodDefinition": + return ( + parent.key !== node || + parent.computed || + parent.shorthand + ); + + case "AssignmentPattern": + return parent.key !== node; + + default: + return true; + } +} + +/** + * Updates the current segment with the head segment. + * This is similar to local branches and tracking branches of git. + * + * To separate the current and the head is in order to not make useless segments. + * + * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd" + * events are fired. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function forwardCurrentToHead(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + const currentSegments = state.currentSegments; + const headSegments = state.headSegments; + const end = Math.max(currentSegments.length, headSegments.length); + let i, currentSegment, headSegment; + + // Fires leaving events. + for (i = 0; i < end; ++i) { + currentSegment = currentSegments[i]; + headSegment = headSegments[i]; + + if (currentSegment !== headSegment && currentSegment) { + + const eventName = currentSegment.reachable + ? "onCodePathSegmentEnd" + : "onUnreachableCodePathSegmentEnd"; + + debug.dump(`${eventName} ${currentSegment.id}`); + + analyzer.emitter.emit( + eventName, + currentSegment, + node + ); + } + } + + // Update state. + state.currentSegments = headSegments; + + // Fires entering events. + for (i = 0; i < end; ++i) { + currentSegment = currentSegments[i]; + headSegment = headSegments[i]; + + if (currentSegment !== headSegment && headSegment) { + + const eventName = headSegment.reachable + ? "onCodePathSegmentStart" + : "onUnreachableCodePathSegmentStart"; + + debug.dump(`${eventName} ${headSegment.id}`); + CodePathSegment.markUsed(headSegment); + analyzer.emitter.emit( + eventName, + headSegment, + node + ); + } + } + +} + +/** + * Updates the current segment with empty. + * This is called at the last of functions or the program. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function leaveFromCurrentSegment(analyzer, node) { + const state = CodePath.getState(analyzer.codePath); + const currentSegments = state.currentSegments; + + for (let i = 0; i < currentSegments.length; ++i) { + const currentSegment = currentSegments[i]; + const eventName = currentSegment.reachable + ? "onCodePathSegmentEnd" + : "onUnreachableCodePathSegmentEnd"; + + debug.dump(`${eventName} ${currentSegment.id}`); + + analyzer.emitter.emit( + eventName, + currentSegment, + node + ); + } + + state.currentSegments = []; +} + +/** + * Updates the code path due to the position of a given node in the parent node + * thereof. + * + * For example, if the node is `parent.consequent`, this creates a fork from the + * current path. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function preprocess(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + const parent = node.parent; + + switch (parent.type) { + + // The `arguments.length == 0` case is in `postprocess` function. + case "CallExpression": + if (parent.optional === true && parent.arguments.length >= 1 && parent.arguments[0] === node) { + state.makeOptionalRight(); + } + break; + case "MemberExpression": + if (parent.optional === true && parent.property === node) { + state.makeOptionalRight(); + } + break; + + case "LogicalExpression": + if ( + parent.right === node && + isHandledLogicalOperator(parent.operator) + ) { + state.makeLogicalRight(); + } + break; + + case "AssignmentExpression": + if ( + parent.right === node && + isLogicalAssignmentOperator(parent.operator) + ) { + state.makeLogicalRight(); + } + break; + + case "ConditionalExpression": + case "IfStatement": + + /* + * Fork if this node is at `consequent`/`alternate`. + * `popForkContext()` exists at `IfStatement:exit` and + * `ConditionalExpression:exit`. + */ + if (parent.consequent === node) { + state.makeIfConsequent(); + } else if (parent.alternate === node) { + state.makeIfAlternate(); + } + break; + + case "SwitchCase": + if (parent.consequent[0] === node) { + state.makeSwitchCaseBody(false, !parent.test); + } + break; + + case "TryStatement": + if (parent.handler === node) { + state.makeCatchBlock(); + } else if (parent.finalizer === node) { + state.makeFinallyBlock(); + } + break; + + case "WhileStatement": + if (parent.test === node) { + state.makeWhileTest(getBooleanValueIfSimpleConstant(node)); + } else { + assert(parent.body === node); + state.makeWhileBody(); + } + break; + + case "DoWhileStatement": + if (parent.body === node) { + state.makeDoWhileBody(); + } else { + assert(parent.test === node); + state.makeDoWhileTest(getBooleanValueIfSimpleConstant(node)); + } + break; + + case "ForStatement": + if (parent.test === node) { + state.makeForTest(getBooleanValueIfSimpleConstant(node)); + } else if (parent.update === node) { + state.makeForUpdate(); + } else if (parent.body === node) { + state.makeForBody(); + } + break; + + case "ForInStatement": + case "ForOfStatement": + if (parent.left === node) { + state.makeForInOfLeft(); + } else if (parent.right === node) { + state.makeForInOfRight(); + } else { + assert(parent.body === node); + state.makeForInOfBody(); + } + break; + + case "AssignmentPattern": + + /* + * Fork if this node is at `right`. + * `left` is executed always, so it uses the current path. + * `popForkContext()` exists at `AssignmentPattern:exit`. + */ + if (parent.right === node) { + state.pushForkContext(); + state.forkBypassPath(); + state.forkPath(); + } + break; + + default: + break; + } +} + +/** + * Updates the code path due to the type of a given node in entering. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function processCodePathToEnter(analyzer, node) { + let codePath = analyzer.codePath; + let state = codePath && CodePath.getState(codePath); + const parent = node.parent; + + /** + * Creates a new code path and trigger the onCodePathStart event + * based on the currently selected node. + * @param {string} origin The reason the code path was started. + * @returns {void} + */ + function startCodePath(origin) { + if (codePath) { + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); + } + + // Create the code path of this scope. + codePath = analyzer.codePath = new CodePath({ + id: analyzer.idGenerator.next(), + origin, + upper: codePath, + onLooped: analyzer.onLooped + }); + state = CodePath.getState(codePath); + + // Emits onCodePathStart events. + debug.dump(`onCodePathStart ${codePath.id}`); + analyzer.emitter.emit("onCodePathStart", codePath, node); + } + + /* + * Special case: The right side of class field initializer is considered + * to be its own function, so we need to start a new code path in this + * case. + */ + if (isPropertyDefinitionValue(node)) { + startCodePath("class-field-initializer"); + + /* + * Intentional fall through because `node` needs to also be + * processed by the code below. For example, if we have: + * + * class Foo { + * a = () => {} + * } + * + * In this case, we also need start a second code path. + */ + + } + + switch (node.type) { + case "Program": + startCodePath("program"); + break; + + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + startCodePath("function"); + break; + + case "StaticBlock": + startCodePath("class-static-block"); + break; + + case "ChainExpression": + state.pushChainContext(); + break; + case "CallExpression": + if (node.optional === true) { + state.makeOptionalNode(); + } + break; + case "MemberExpression": + if (node.optional === true) { + state.makeOptionalNode(); + } + break; + + case "LogicalExpression": + if (isHandledLogicalOperator(node.operator)) { + state.pushChoiceContext( + node.operator, + isForkingByTrueOrFalse(node) + ); + } + break; + + case "AssignmentExpression": + if (isLogicalAssignmentOperator(node.operator)) { + state.pushChoiceContext( + node.operator.slice(0, -1), // removes `=` from the end + isForkingByTrueOrFalse(node) + ); + } + break; + + case "ConditionalExpression": + case "IfStatement": + state.pushChoiceContext("test", false); + break; + + case "SwitchStatement": + state.pushSwitchContext( + node.cases.some(isCaseNode), + getLabel(node) + ); + break; + + case "TryStatement": + state.pushTryContext(Boolean(node.finalizer)); + break; + + case "SwitchCase": + + /* + * Fork if this node is after the 2st node in `cases`. + * It's similar to `else` blocks. + * The next `test` node is processed in this path. + */ + if (parent.discriminant !== node && parent.cases[0] !== node) { + state.forkPath(); + } + break; + + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + state.pushLoopContext(node.type, getLabel(node)); + break; + + case "LabeledStatement": + if (!breakableTypePattern.test(node.body.type)) { + state.pushBreakContext(false, node.label.name); + } + break; + + default: + break; + } + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); +} + +/** + * Updates the code path due to the type of a given node in leaving. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function processCodePathToExit(analyzer, node) { + + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + let dontForward = false; + + switch (node.type) { + case "ChainExpression": + state.popChainContext(); + break; + + case "IfStatement": + case "ConditionalExpression": + state.popChoiceContext(); + break; + + case "LogicalExpression": + if (isHandledLogicalOperator(node.operator)) { + state.popChoiceContext(); + } + break; + + case "AssignmentExpression": + if (isLogicalAssignmentOperator(node.operator)) { + state.popChoiceContext(); + } + break; + + case "SwitchStatement": + state.popSwitchContext(); + break; + + case "SwitchCase": + + /* + * This is the same as the process at the 1st `consequent` node in + * `preprocess` function. + * Must do if this `consequent` is empty. + */ + if (node.consequent.length === 0) { + state.makeSwitchCaseBody(true, !node.test); + } + if (state.forkContext.reachable) { + dontForward = true; + } + break; + + case "TryStatement": + state.popTryContext(); + break; + + case "BreakStatement": + forwardCurrentToHead(analyzer, node); + state.makeBreak(node.label && node.label.name); + dontForward = true; + break; + + case "ContinueStatement": + forwardCurrentToHead(analyzer, node); + state.makeContinue(node.label && node.label.name); + dontForward = true; + break; + + case "ReturnStatement": + forwardCurrentToHead(analyzer, node); + state.makeReturn(); + dontForward = true; + break; + + case "ThrowStatement": + forwardCurrentToHead(analyzer, node); + state.makeThrow(); + dontForward = true; + break; + + case "Identifier": + if (isIdentifierReference(node)) { + state.makeFirstThrowablePathInTryBlock(); + dontForward = true; + } + break; + + case "CallExpression": + case "ImportExpression": + case "MemberExpression": + case "NewExpression": + case "YieldExpression": + state.makeFirstThrowablePathInTryBlock(); + break; + + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + state.popLoopContext(); + break; + + case "AssignmentPattern": + state.popForkContext(); + break; + + case "LabeledStatement": + if (!breakableTypePattern.test(node.body.type)) { + state.popBreakContext(); + } + break; + + default: + break; + } + + // Emits onCodePathSegmentStart events if updated. + if (!dontForward) { + forwardCurrentToHead(analyzer, node); + } + debug.dumpState(node, state, true); +} + +/** + * Updates the code path to finalize the current code path. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function postprocess(analyzer, node) { + + /** + * Ends the code path for the current node. + * @returns {void} + */ + function endCodePath() { + let codePath = analyzer.codePath; + + // Mark the current path as the final node. + CodePath.getState(codePath).makeFinal(); + + // Emits onCodePathSegmentEnd event of the current segments. + leaveFromCurrentSegment(analyzer, node); + + // Emits onCodePathEnd event of this code path. + debug.dump(`onCodePathEnd ${codePath.id}`); + analyzer.emitter.emit("onCodePathEnd", codePath, node); + debug.dumpDot(codePath); + + codePath = analyzer.codePath = analyzer.codePath.upper; + if (codePath) { + debug.dumpState(node, CodePath.getState(codePath), true); + } + + } + + switch (node.type) { + case "Program": + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "StaticBlock": { + endCodePath(); + break; + } + + // The `arguments.length >= 1` case is in `preprocess` function. + case "CallExpression": + if (node.optional === true && node.arguments.length === 0) { + CodePath.getState(analyzer.codePath).makeOptionalRight(); + } + break; + + default: + break; + } + + /* + * Special case: The right side of class field initializer is considered + * to be its own function, so we need to end a code path in this + * case. + * + * We need to check after the other checks in order to close the + * code paths in the correct order for code like this: + * + * + * class Foo { + * a = () => {} + * } + * + * In this case, The ArrowFunctionExpression code path is closed first + * and then we need to close the code path for the PropertyDefinition + * value. + */ + if (isPropertyDefinitionValue(node)) { + endCodePath(); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The class to analyze code paths. + * This class implements the EventGenerator interface. + */ +class CodePathAnalyzer { + + /** + * @param {EventGenerator} eventGenerator An event generator to wrap. + */ + constructor(eventGenerator) { + this.original = eventGenerator; + this.emitter = eventGenerator.emitter; + this.codePath = null; + this.idGenerator = new IdGenerator("s"); + this.currentNode = null; + this.onLooped = this.onLooped.bind(this); + } + + /** + * Does the process to enter a given AST node. + * This updates state of analysis and calls `enterNode` of the wrapped. + * @param {ASTNode} node A node which is entering. + * @returns {void} + */ + enterNode(node) { + this.currentNode = node; + + // Updates the code path due to node's position in its parent node. + if (node.parent) { + preprocess(this, node); + } + + /* + * Updates the code path. + * And emits onCodePathStart/onCodePathSegmentStart events. + */ + processCodePathToEnter(this, node); + + // Emits node events. + this.original.enterNode(node); + + this.currentNode = null; + } + + /** + * Does the process to leave a given AST node. + * This updates state of analysis and calls `leaveNode` of the wrapped. + * @param {ASTNode} node A node which is leaving. + * @returns {void} + */ + leaveNode(node) { + this.currentNode = node; + + /* + * Updates the code path. + * And emits onCodePathStart/onCodePathSegmentStart events. + */ + processCodePathToExit(this, node); + + // Emits node events. + this.original.leaveNode(node); + + // Emits the last onCodePathStart/onCodePathSegmentStart events. + postprocess(this, node); + + this.currentNode = null; + } + + /** + * This is called on a code path looped. + * Then this raises a looped event. + * @param {CodePathSegment} fromSegment A segment of prev. + * @param {CodePathSegment} toSegment A segment of next. + * @returns {void} + */ + onLooped(fromSegment, toSegment) { + if (fromSegment.reachable && toSegment.reachable) { + debug.dump(`onCodePathSegmentLoop ${fromSegment.id} -> ${toSegment.id}`); + this.emitter.emit( + "onCodePathSegmentLoop", + fromSegment, + toSegment, + this.currentNode + ); + } + } +} + +module.exports = CodePathAnalyzer; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js new file mode 100644 index 0000000..3b8dbb4 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js @@ -0,0 +1,263 @@ +/** + * @fileoverview The CodePathSegment class. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("./debug-helpers"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A code path segment. + * + * Each segment is arranged in a series of linked lists (implemented by arrays) + * that keep track of the previous and next segments in a code path. In this way, + * you can navigate between all segments in any code path so long as you have a + * reference to any segment in that code path. + * + * When first created, the segment is in a detached state, meaning that it knows the + * segments that came before it but those segments don't know that this new segment + * follows it. Only when `CodePathSegment#markUsed()` is called on a segment does it + * officially become part of the code path by updating the previous segments to know + * that this new segment follows. + */ +class CodePathSegment { + + /** + * Creates a new instance. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * This array includes unreachable segments. + * @param {boolean} reachable A flag which shows this is reachable. + */ + constructor(id, allPrevSegments, reachable) { + + /** + * The identifier of this code path. + * Rules use it to store additional information of each rule. + * @type {string} + */ + this.id = id; + + /** + * An array of the next reachable segments. + * @type {CodePathSegment[]} + */ + this.nextSegments = []; + + /** + * An array of the previous reachable segments. + * @type {CodePathSegment[]} + */ + this.prevSegments = allPrevSegments.filter(isReachable); + + /** + * An array of all next segments including reachable and unreachable. + * @type {CodePathSegment[]} + */ + this.allNextSegments = []; + + /** + * An array of all previous segments including reachable and unreachable. + * @type {CodePathSegment[]} + */ + this.allPrevSegments = allPrevSegments; + + /** + * A flag which shows this is reachable. + * @type {boolean} + */ + this.reachable = reachable; + + // Internal data. + Object.defineProperty(this, "internal", { + value: { + + // determines if the segment has been attached to the code path + used: false, + + // array of previous segments coming from the end of a loop + loopedPrevSegments: [] + } + }); + + /* c8 ignore start */ + if (debug.enabled) { + this.internal.nodes = []; + }/* c8 ignore stop */ + } + + /** + * Checks a given previous segment is coming from the end of a loop. + * @param {CodePathSegment} segment A previous segment to check. + * @returns {boolean} `true` if the segment is coming from the end of a loop. + */ + isLoopedPrevSegment(segment) { + return this.internal.loopedPrevSegments.includes(segment); + } + + /** + * Creates the root segment. + * @param {string} id An identifier. + * @returns {CodePathSegment} The created segment. + */ + static newRoot(id) { + return new CodePathSegment(id, [], true); + } + + /** + * Creates a new segment and appends it after the given segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments + * to append to. + * @returns {CodePathSegment} The created segment. + */ + static newNext(id, allPrevSegments) { + return new CodePathSegment( + id, + CodePathSegment.flattenUnusedSegments(allPrevSegments), + allPrevSegments.some(isReachable) + ); + } + + /** + * Creates an unreachable segment and appends it after the given segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newUnreachable(id, allPrevSegments) { + const segment = new CodePathSegment(id, CodePathSegment.flattenUnusedSegments(allPrevSegments), false); + + /* + * In `if (a) return a; foo();` case, the unreachable segment preceded by + * the return statement is not used but must not be removed. + */ + CodePathSegment.markUsed(segment); + + return segment; + } + + /** + * Creates a segment that follows given segments. + * This factory method does not connect with `allPrevSegments`. + * But this inherits `reachable` flag. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newDisconnected(id, allPrevSegments) { + return new CodePathSegment(id, [], allPrevSegments.some(isReachable)); + } + + /** + * Marks a given segment as used. + * + * And this function registers the segment into the previous segments as a next. + * @param {CodePathSegment} segment A segment to mark. + * @returns {void} + */ + static markUsed(segment) { + if (segment.internal.used) { + return; + } + segment.internal.used = true; + + let i; + + if (segment.reachable) { + + /* + * If the segment is reachable, then it's officially part of the + * code path. This loops through all previous segments to update + * their list of next segments. Because the segment is reachable, + * it's added to both `nextSegments` and `allNextSegments`. + */ + for (i = 0; i < segment.allPrevSegments.length; ++i) { + const prevSegment = segment.allPrevSegments[i]; + + prevSegment.allNextSegments.push(segment); + prevSegment.nextSegments.push(segment); + } + } else { + + /* + * If the segment is not reachable, then it's not officially part of the + * code path. This loops through all previous segments to update + * their list of next segments. Because the segment is not reachable, + * it's added only to `allNextSegments`. + */ + for (i = 0; i < segment.allPrevSegments.length; ++i) { + segment.allPrevSegments[i].allNextSegments.push(segment); + } + } + } + + /** + * Marks a previous segment as looped. + * @param {CodePathSegment} segment A segment. + * @param {CodePathSegment} prevSegment A previous segment to mark. + * @returns {void} + */ + static markPrevSegmentAsLooped(segment, prevSegment) { + segment.internal.loopedPrevSegments.push(prevSegment); + } + + /** + * Creates a new array based on an array of segments. If any segment in the + * array is unused, then it is replaced by all of its previous segments. + * All used segments are returned as-is without replacement. + * @param {CodePathSegment[]} segments The array of segments to flatten. + * @returns {CodePathSegment[]} The flattened array. + */ + static flattenUnusedSegments(segments) { + const done = new Set(); + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + // Ignores duplicated. + if (done.has(segment)) { + continue; + } + + // Use previous segments if unused. + if (!segment.internal.used) { + for (let j = 0; j < segment.allPrevSegments.length; ++j) { + const prevSegment = segment.allPrevSegments[j]; + + if (!done.has(prevSegment)) { + done.add(prevSegment); + } + } + } else { + done.add(segment); + } + } + + return [...done]; + } +} + +module.exports = CodePathSegment; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js new file mode 100644 index 0000000..2b0dc2b --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js @@ -0,0 +1,2348 @@ +/** + * @fileoverview A class to manage state of generating a code path. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const CodePathSegment = require("./code-path-segment"), + ForkContext = require("./fork-context"); + +//----------------------------------------------------------------------------- +// Contexts +//----------------------------------------------------------------------------- + +/** + * Represents the context in which a `break` statement can be used. + * + * A `break` statement without a label is only valid in a few places in + * JavaScript: any type of loop or a `switch` statement. Otherwise, `break` + * without a label causes a syntax error. For these contexts, `breakable` is + * set to `true` to indicate that a `break` without a label is valid. + * + * However, a `break` statement with a label is also valid inside of a labeled + * statement. For example, this is valid: + * + * a : { + * break a; + * } + * + * The `breakable` property is set false for labeled statements to indicate + * that `break` without a label is invalid. + */ +class BreakContext { + + /** + * Creates a new instance. + * @param {BreakContext} upperContext The previous `BreakContext`. + * @param {boolean} breakable Indicates if we are inside a statement where + * `break` without a label will exit the statement. + * @param {string|null} label The label for the statement. + * @param {ForkContext} forkContext The current fork context. + */ + constructor(upperContext, breakable, label, forkContext) { + + /** + * The previous `BreakContext` + * @type {BreakContext} + */ + this.upper = upperContext; + + /** + * Indicates if we are inside a statement where `break` without a label + * will exit the statement. + * @type {boolean} + */ + this.breakable = breakable; + + /** + * The label associated with the statement. + * @type {string|null} + */ + this.label = label; + + /** + * The fork context for the `break`. + * @type {ForkContext} + */ + this.brokenForkContext = ForkContext.newEmpty(forkContext); + } +} + +/** + * Represents the context for `ChainExpression` nodes. + */ +class ChainContext { + + /** + * Creates a new instance. + * @param {ChainContext} upperContext The previous `ChainContext`. + */ + constructor(upperContext) { + + /** + * The previous `ChainContext` + * @type {ChainContext} + */ + this.upper = upperContext; + + /** + * The number of choice contexts inside of the `ChainContext`. + * @type {number} + */ + this.choiceContextCount = 0; + + } +} + +/** + * Represents a choice in the code path. + * + * Choices are created by logical operators such as `&&`, loops, conditionals, + * and `if` statements. This is the point at which the code path has a choice of + * which direction to go. + * + * The result of a choice might be in the left (test) expression of another choice, + * and in that case, may create a new fork. For example, `a || b` is a choice + * but does not create a new fork because the result of the expression is + * not used as the test expression in another expression. In this case, + * `isForkingAsResult` is false. In the expression `a || b || c`, the `a || b` + * expression appears as the test expression for `|| c`, so the + * result of `a || b` creates a fork because execution may or may not + * continue to `|| c`. `isForkingAsResult` for `a || b` in this case is true + * while `isForkingAsResult` for `|| c` is false. (`isForkingAsResult` is always + * false for `if` statements, conditional expressions, and loops.) + * + * All of the choices except one (`??`) operate on a true/false fork, meaning if + * true go one way and if false go the other (tracked by `trueForkContext` and + * `falseForkContext`). The `??` operator doesn't operate on true/false because + * the left expression is evaluated to be nullish or not, so only if nullish do + * we fork to the right expression (tracked by `nullishForkContext`). + */ +class ChoiceContext { + + /** + * Creates a new instance. + * @param {ChoiceContext} upperContext The previous `ChoiceContext`. + * @param {string} kind The kind of choice. If it's a logical or assignment expression, this + * is `"&&"` or `"||"` or `"??"`; if it's an `if` statement or + * conditional expression, this is `"test"`; otherwise, this is `"loop"`. + * @param {boolean} isForkingAsResult Indicates if the result of the choice + * creates a fork. + * @param {ForkContext} forkContext The containing `ForkContext`. + */ + constructor(upperContext, kind, isForkingAsResult, forkContext) { + + /** + * The previous `ChoiceContext` + * @type {ChoiceContext} + */ + this.upper = upperContext; + + /** + * The kind of choice. If it's a logical or assignment expression, this + * is `"&&"` or `"||"` or `"??"`; if it's an `if` statement or + * conditional expression, this is `"test"`; otherwise, this is `"loop"`. + * @type {string} + */ + this.kind = kind; + + /** + * Indicates if the result of the choice forks the code path. + * @type {boolean} + */ + this.isForkingAsResult = isForkingAsResult; + + /** + * The fork context for the `true` path of the choice. + * @type {ForkContext} + */ + this.trueForkContext = ForkContext.newEmpty(forkContext); + + /** + * The fork context for the `false` path of the choice. + * @type {ForkContext} + */ + this.falseForkContext = ForkContext.newEmpty(forkContext); + + /** + * The fork context for when the choice result is `null` or `undefined`. + * @type {ForkContext} + */ + this.nullishForkContext = ForkContext.newEmpty(forkContext); + + /** + * Indicates if any of `trueForkContext`, `falseForkContext`, or + * `nullishForkContext` have been updated with segments from a child context. + * @type {boolean} + */ + this.processed = false; + } + +} + +/** + * Base class for all loop contexts. + */ +class LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string} type The AST node's `type` for the loop. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, type, label, breakContext) { + + /** + * The previous `LoopContext`. + * @type {LoopContext} + */ + this.upper = upperContext; + + /** + * The AST node's `type` for the loop. + * @type {string} + */ + this.type = type; + + /** + * The label for the loop from an enclosing `LabeledStatement`. + * @type {string|null} + */ + this.label = label; + + /** + * The fork context for when `break` is encountered. + * @type {ForkContext} + */ + this.brokenForkContext = breakContext.brokenForkContext; + } +} + +/** + * Represents the context for a `while` loop. + */ +class WhileLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, label, breakContext) { + super(upperContext, "WhileStatement", label, breakContext); + + /** + * The hardcoded literal boolean test condition for + * the loop. Used to catch infinite or skipped loops. + * @type {boolean|undefined} + */ + this.test = void 0; + + /** + * The segments representing the test condition where `continue` will + * jump to. The test condition will typically have just one segment but + * it's possible for there to be more than one. + * @type {Array|null} + */ + this.continueDestSegments = null; + } +} + +/** + * Represents the context for a `do-while` loop. + */ +class DoWhileLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + * @param {ForkContext} forkContext The enclosing fork context. + */ + constructor(upperContext, label, breakContext, forkContext) { + super(upperContext, "DoWhileStatement", label, breakContext); + + /** + * The hardcoded literal boolean test condition for + * the loop. Used to catch infinite or skipped loops. + * @type {boolean|undefined} + */ + this.test = void 0; + + /** + * The segments at the start of the loop body. This is the only loop + * where the test comes at the end, so the first iteration always + * happens and we need a reference to the first statements. + * @type {Array|null} + */ + this.entrySegments = null; + + /** + * The fork context to follow when a `continue` is found. + * @type {ForkContext} + */ + this.continueForkContext = ForkContext.newEmpty(forkContext); + } +} + +/** + * Represents the context for a `for` loop. + */ +class ForLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, label, breakContext) { + super(upperContext, "ForStatement", label, breakContext); + + /** + * The hardcoded literal boolean test condition for + * the loop. Used to catch infinite or skipped loops. + * @type {boolean|undefined} + */ + this.test = void 0; + + /** + * The end of the init expression. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * an init expression. + * @type {Array|null} + */ + this.endOfInitSegments = null; + + /** + * The start of the test expression. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * a test expression. + * @type {Array|null} + */ + this.testSegments = null; + + /** + * The end of the test expression. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * a test expression. + * @type {Array|null} + */ + this.endOfTestSegments = null; + + /** + * The start of the update expression. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * an update expression. + * @type {Array|null} + */ + this.updateSegments = null; + + /** + * The end of the update expresion. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * an update expression. + * @type {Array|null} + */ + this.endOfUpdateSegments = null; + + /** + * The segments representing the test condition where `continue` will + * jump to. The test condition will typically have just one segment but + * it's possible for there to be more than one. This may change during the + * lifetime of the instance as we traverse the loop because some loops + * don't have an update expression. When there is an update expression, this + * will end up pointing to that expression; otherwise it will end up pointing + * to the test expression. + * @type {Array|null} + */ + this.continueDestSegments = null; + } +} + +/** + * Represents the context for a `for-in` loop. + * + * Terminology: + * - "left" means the part of the loop to the left of the `in` keyword. For + * example, in `for (var x in y)`, the left is `var x`. + * - "right" means the part of the loop to the right of the `in` keyword. For + * example, in `for (var x in y)`, the right is `y`. + */ +class ForInLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, label, breakContext) { + super(upperContext, "ForInStatement", label, breakContext); + + /** + * The segments that came immediately before the start of the loop. + * This allows you to traverse backwards out of the loop into the + * surrounding code. This is necessary to evaluate the right expression + * correctly, as it must be evaluated in the same way as the left + * expression, but the pointer to these segments would otherwise be + * lost if not stored on the instance. Once the right expression has + * been evaluated, this property is no longer used. + * @type {Array|null} + */ + this.prevSegments = null; + + /** + * Segments representing the start of everything to the left of the + * `in` keyword. This can be used to move forward towards + * `endOfLeftSegments`. `leftSegments` and `endOfLeftSegments` are + * effectively the head and tail of a doubly-linked list. + * @type {Array|null} + */ + this.leftSegments = null; + + /** + * Segments representing the end of everything to the left of the + * `in` keyword. This can be used to move backward towards `leftSegments`. + * `leftSegments` and `endOfLeftSegments` are effectively the head + * and tail of a doubly-linked list. + * @type {Array|null} + */ + this.endOfLeftSegments = null; + + /** + * The segments representing the left expression where `continue` will + * jump to. In `for-in` loops, `continue` must always re-execute the + * left expression each time through the loop. This contains the same + * segments as `leftSegments`, but is duplicated here so each loop + * context has the same property pointing to where `continue` should + * end up. + * @type {Array|null} + */ + this.continueDestSegments = null; + } +} + +/** + * Represents the context for a `for-of` loop. + */ +class ForOfLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, label, breakContext) { + super(upperContext, "ForOfStatement", label, breakContext); + + /** + * The segments that came immediately before the start of the loop. + * This allows you to traverse backwards out of the loop into the + * surrounding code. This is necessary to evaluate the right expression + * correctly, as it must be evaluated in the same way as the left + * expression, but the pointer to these segments would otherwise be + * lost if not stored on the instance. Once the right expression has + * been evaluated, this property is no longer used. + * @type {Array|null} + */ + this.prevSegments = null; + + /** + * Segments representing the start of everything to the left of the + * `of` keyword. This can be used to move forward towards + * `endOfLeftSegments`. `leftSegments` and `endOfLeftSegments` are + * effectively the head and tail of a doubly-linked list. + * @type {Array|null} + */ + this.leftSegments = null; + + /** + * Segments representing the end of everything to the left of the + * `of` keyword. This can be used to move backward towards `leftSegments`. + * `leftSegments` and `endOfLeftSegments` are effectively the head + * and tail of a doubly-linked list. + * @type {Array|null} + */ + this.endOfLeftSegments = null; + + /** + * The segments representing the left expression where `continue` will + * jump to. In `for-in` loops, `continue` must always re-execute the + * left expression each time through the loop. This contains the same + * segments as `leftSegments`, but is duplicated here so each loop + * context has the same property pointing to where `continue` should + * end up. + * @type {Array|null} + */ + this.continueDestSegments = null; + } +} + +/** + * Represents the context for any loop. + * @typedef {WhileLoopContext|DoWhileLoopContext|ForLoopContext|ForInLoopContext|ForOfLoopContext} LoopContext + */ + +/** + * Represents the context for a `switch` statement. + */ +class SwitchContext { + + /** + * Creates a new instance. + * @param {SwitchContext} upperContext The previous context. + * @param {boolean} hasCase Indicates if there is at least one `case` statement. + * `default` doesn't count. + */ + constructor(upperContext, hasCase) { + + /** + * The previous context. + * @type {SwitchContext} + */ + this.upper = upperContext; + + /** + * Indicates if there is at least one `case` statement. `default` doesn't count. + * @type {boolean} + */ + this.hasCase = hasCase; + + /** + * The `default` keyword. + * @type {Array|null} + */ + this.defaultSegments = null; + + /** + * The default case body starting segments. + * @type {Array|null} + */ + this.defaultBodySegments = null; + + /** + * Indicates if a `default` case and is empty exists. + * @type {boolean} + */ + this.foundEmptyDefault = false; + + /** + * Indicates that a `default` exists and is the last case. + * @type {boolean} + */ + this.lastIsDefault = false; + + /** + * The number of fork contexts created. This is equivalent to the + * number of `case` statements plus a `default` statement (if present). + * @type {number} + */ + this.forkCount = 0; + } +} + +/** + * Represents the context for a `try` statement. + */ +class TryContext { + + /** + * Creates a new instance. + * @param {TryContext} upperContext The previous context. + * @param {boolean} hasFinalizer Indicates if the `try` statement has a + * `finally` block. + * @param {ForkContext} forkContext The enclosing fork context. + */ + constructor(upperContext, hasFinalizer, forkContext) { + + /** + * The previous context. + * @type {TryContext} + */ + this.upper = upperContext; + + /** + * Indicates if the `try` statement has a `finally` block. + * @type {boolean} + */ + this.hasFinalizer = hasFinalizer; + + /** + * Tracks the traversal position inside of the `try` statement. This is + * used to help determine the context necessary to create paths because + * a `try` statement may or may not have `catch` or `finally` blocks, + * and code paths behave differently in those blocks. + * @type {"try"|"catch"|"finally"} + */ + this.position = "try"; + + /** + * If the `try` statement has a `finally` block, this affects how a + * `return` statement behaves in the `try` block. Without `finally`, + * `return` behaves as usual and doesn't require a fork; with `finally`, + * `return` forks into the `finally` block, so we need a fork context + * to track it. + * @type {ForkContext|null} + */ + this.returnedForkContext = hasFinalizer + ? ForkContext.newEmpty(forkContext) + : null; + + /** + * When a `throw` occurs inside of a `try` block, the code path forks + * into the `catch` or `finally` blocks, and this fork context tracks + * that path. + * @type {ForkContext} + */ + this.thrownForkContext = ForkContext.newEmpty(forkContext); + + /** + * Indicates if the last segment in the `try` block is reachable. + * @type {boolean} + */ + this.lastOfTryIsReachable = false; + + /** + * Indicates if the last segment in the `catch` block is reachable. + * @type {boolean} + */ + this.lastOfCatchIsReachable = false; + } +} + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Adds given segments into the `dest` array. + * If the `others` array does not include the given segments, adds to the `all` + * array as well. + * + * This adds only reachable and used segments. + * @param {CodePathSegment[]} dest A destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} others Another destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} all The unified destination array (`finalSegments`). + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ +function addToReturnedOrThrown(dest, others, all, segments) { + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + dest.push(segment); + if (!others.includes(segment)) { + all.push(segment); + } + } +} + +/** + * Gets a loop context for a `continue` statement based on a given label. + * @param {CodePathState} state The state to search within. + * @param {string|null} label The label of a `continue` statement. + * @returns {LoopContext} A loop-context for a `continue` statement. + */ +function getContinueContext(state, label) { + if (!label) { + return state.loopContext; + } + + let context = state.loopContext; + + while (context) { + if (context.label === label) { + return context; + } + context = context.upper; + } + + /* c8 ignore next */ + return null; +} + +/** + * Gets a context for a `break` statement. + * @param {CodePathState} state The state to search within. + * @param {string|null} label The label of a `break` statement. + * @returns {BreakContext} A context for a `break` statement. + */ +function getBreakContext(state, label) { + let context = state.breakContext; + + while (context) { + if (label ? context.label === label : context.breakable) { + return context; + } + context = context.upper; + } + + /* c8 ignore next */ + return null; +} + +/** + * Gets a context for a `return` statement. There is just one special case: + * if there is a `try` statement with a `finally` block, because that alters + * how `return` behaves; otherwise, this just passes through the given state. + * @param {CodePathState} state The state to search within + * @returns {TryContext|CodePathState} A context for a `return` statement. + */ +function getReturnContext(state) { + let context = state.tryContext; + + while (context) { + if (context.hasFinalizer && context.position !== "finally") { + return context; + } + context = context.upper; + } + + return state; +} + +/** + * Gets a context for a `throw` statement. There is just one special case: + * if there is a `try` statement with a `finally` block and we are inside of + * a `catch` because that changes how `throw` behaves; otherwise, this just + * passes through the given state. + * @param {CodePathState} state The state to search within. + * @returns {TryContext|CodePathState} A context for a `throw` statement. + */ +function getThrowContext(state) { + let context = state.tryContext; + + while (context) { + if (context.position === "try" || + (context.hasFinalizer && context.position === "catch") + ) { + return context; + } + context = context.upper; + } + + return state; +} + +/** + * Removes a given value from a given array. + * @param {any[]} elements An array to remove the specific element. + * @param {any} value The value to be removed. + * @returns {void} + */ +function removeFromArray(elements, value) { + elements.splice(elements.indexOf(value), 1); +} + +/** + * Disconnect given segments. + * + * This is used in a process for switch statements. + * If there is the "default" chunk before other cases, the order is different + * between node's and running's. + * @param {CodePathSegment[]} prevSegments Forward segments to disconnect. + * @param {CodePathSegment[]} nextSegments Backward segments to disconnect. + * @returns {void} + */ +function disconnectSegments(prevSegments, nextSegments) { + for (let i = 0; i < prevSegments.length; ++i) { + const prevSegment = prevSegments[i]; + const nextSegment = nextSegments[i]; + + removeFromArray(prevSegment.nextSegments, nextSegment); + removeFromArray(prevSegment.allNextSegments, nextSegment); + removeFromArray(nextSegment.prevSegments, prevSegment); + removeFromArray(nextSegment.allPrevSegments, prevSegment); + } +} + +/** + * Creates looping path between two arrays of segments, ensuring that there are + * paths going between matching segments in the arrays. + * @param {CodePathState} state The state to operate on. + * @param {CodePathSegment[]} unflattenedFromSegments Segments which are source. + * @param {CodePathSegment[]} unflattenedToSegments Segments which are destination. + * @returns {void} + */ +function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) { + + const fromSegments = CodePathSegment.flattenUnusedSegments(unflattenedFromSegments); + const toSegments = CodePathSegment.flattenUnusedSegments(unflattenedToSegments); + const end = Math.min(fromSegments.length, toSegments.length); + + /* + * This loop effectively updates a doubly-linked list between two collections + * of segments making sure that segments in the same array indices are + * combined to create a path. + */ + for (let i = 0; i < end; ++i) { + + // get the segments in matching array indices + const fromSegment = fromSegments[i]; + const toSegment = toSegments[i]; + + /* + * If the destination segment is reachable, then create a path from the + * source segment to the destination segment. + */ + if (toSegment.reachable) { + fromSegment.nextSegments.push(toSegment); + } + + /* + * If the source segment is reachable, then create a path from the + * destination segment back to the source segment. + */ + if (fromSegment.reachable) { + toSegment.prevSegments.push(fromSegment); + } + + /* + * Also update the arrays that don't care if the segments are reachable + * or not. This should always happen regardless of anything else. + */ + fromSegment.allNextSegments.push(toSegment); + toSegment.allPrevSegments.push(fromSegment); + + /* + * If the destination segment has at least two previous segments in its + * path then that means there was one previous segment before this iteration + * of the loop was executed. So, we need to mark the source segment as + * looped. + */ + if (toSegment.allPrevSegments.length >= 2) { + CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment); + } + + // let the code path analyzer know that there's been a loop created + state.notifyLooped(fromSegment, toSegment); + } +} + +/** + * Finalizes segments of `test` chunk of a ForStatement. + * + * - Adds `false` paths to paths which are leaving from the loop. + * - Sets `true` paths to paths which go to the body. + * @param {LoopContext} context A loop context to modify. + * @param {ChoiceContext} choiceContext A choice context of this loop. + * @param {CodePathSegment[]} head The current head paths. + * @returns {void} + */ +function finalizeTestSegmentsOfFor(context, choiceContext, head) { + + /* + * If this choice context doesn't already contain paths from a + * child context, then add the current head to each potential path. + */ + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(head); + choiceContext.falseForkContext.add(head); + choiceContext.nullishForkContext.add(head); + } + + /* + * If the test condition isn't a hardcoded truthy value, then `break` + * must follow the same path as if the test condition is false. To represent + * that, we append the path for when the loop test is false (represented by + * `falseForkContext`) to the `brokenForkContext`. + */ + if (context.test !== true) { + context.brokenForkContext.addAll(choiceContext.falseForkContext); + } + + context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A class which manages state to analyze code paths. + */ +class CodePathState { + + /** + * Creates a new instance. + * @param {IdGenerator} idGenerator An id generator to generate id for code + * path segments. + * @param {Function} onLooped A callback function to notify looping. + */ + constructor(idGenerator, onLooped) { + + /** + * The ID generator to use when creating new segments. + * @type {IdGenerator} + */ + this.idGenerator = idGenerator; + + /** + * A callback function to call when there is a loop. + * @type {Function} + */ + this.notifyLooped = onLooped; + + /** + * The root fork context for this state. + * @type {ForkContext} + */ + this.forkContext = ForkContext.newRoot(idGenerator); + + /** + * Context for logical expressions, conditional expressions, `if` statements, + * and loops. + * @type {ChoiceContext} + */ + this.choiceContext = null; + + /** + * Context for `switch` statements. + * @type {SwitchContext} + */ + this.switchContext = null; + + /** + * Context for `try` statements. + * @type {TryContext} + */ + this.tryContext = null; + + /** + * Context for loop statements. + * @type {LoopContext} + */ + this.loopContext = null; + + /** + * Context for `break` statements. + * @type {BreakContext} + */ + this.breakContext = null; + + /** + * Context for `ChainExpression` nodes. + * @type {ChainContext} + */ + this.chainContext = null; + + /** + * An array that tracks the current segments in the state. The array + * starts empty and segments are added with each `onCodePathSegmentStart` + * event and removed with each `onCodePathSegmentEnd` event. Effectively, + * this is tracking the code path segment traversal as the state is + * modified. + * @type {Array} + */ + this.currentSegments = []; + + /** + * Tracks the starting segment for this path. This value never changes. + * @type {CodePathSegment} + */ + this.initialSegment = this.forkContext.head[0]; + + /** + * The final segments of the code path which are either `return` or `throw`. + * This is a union of the segments in `returnedForkContext` and `thrownForkContext`. + * @type {Array} + */ + this.finalSegments = []; + + /** + * The final segments of the code path which are `return`. These + * segments are also contained in `finalSegments`. + * @type {Array} + */ + this.returnedForkContext = []; + + /** + * The final segments of the code path which are `throw`. These + * segments are also contained in `finalSegments`. + * @type {Array} + */ + this.thrownForkContext = []; + + /* + * We add an `add` method so that these look more like fork contexts and + * can be used interchangeably when a fork context is needed to add more + * segments to a path. + * + * Ultimately, we want anything added to `returned` or `thrown` to also + * be added to `final`. We only add reachable and used segments to these + * arrays. + */ + const final = this.finalSegments; + const returned = this.returnedForkContext; + const thrown = this.thrownForkContext; + + returned.add = addToReturnedOrThrown.bind(null, returned, thrown, final); + thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final); + } + + /** + * A passthrough property exposing the current pointer as part of the API. + * @type {CodePathSegment[]} + */ + get headSegments() { + return this.forkContext.head; + } + + /** + * The parent forking context. + * This is used for the root of new forks. + * @type {ForkContext} + */ + get parentForkContext() { + const current = this.forkContext; + + return current && current.upper; + } + + /** + * Creates and stacks new forking context. + * @param {boolean} forkLeavingPath A flag which shows being in a + * "finally" block. + * @returns {ForkContext} The created context. + */ + pushForkContext(forkLeavingPath) { + this.forkContext = ForkContext.newEmpty( + this.forkContext, + forkLeavingPath + ); + + return this.forkContext; + } + + /** + * Pops and merges the last forking context. + * @returns {ForkContext} The last context. + */ + popForkContext() { + const lastContext = this.forkContext; + + this.forkContext = lastContext.upper; + this.forkContext.replaceHead(lastContext.makeNext(0, -1)); + + return lastContext; + } + + /** + * Creates a new path. + * @returns {void} + */ + forkPath() { + this.forkContext.add(this.parentForkContext.makeNext(-1, -1)); + } + + /** + * Creates a bypass path. + * This is used for such as IfStatement which does not have "else" chunk. + * @returns {void} + */ + forkBypassPath() { + this.forkContext.add(this.parentForkContext.head); + } + + //-------------------------------------------------------------------------- + // ConditionalExpression, LogicalExpression, IfStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context for ConditionalExpression, LogicalExpression, AssignmentExpression (logical assignments only), + * IfStatement, WhileStatement, DoWhileStatement, or ForStatement. + * + * LogicalExpressions have cases that it goes different paths between the + * `true` case and the `false` case. + * + * For Example: + * + * if (a || b) { + * foo(); + * } else { + * bar(); + * } + * + * In this case, `b` is evaluated always in the code path of the `else` + * block, but it's not so in the code path of the `if` block. + * So there are 3 paths. + * + * a -> foo(); + * a -> b -> foo(); + * a -> b -> bar(); + * @param {string} kind A kind string. + * If the new context is LogicalExpression's or AssignmentExpression's, this is `"&&"` or `"||"` or `"??"`. + * If it's IfStatement's or ConditionalExpression's, this is `"test"`. + * Otherwise, this is `"loop"`. + * @param {boolean} isForkingAsResult Indicates if the result of the choice + * creates a fork. + * @returns {void} + */ + pushChoiceContext(kind, isForkingAsResult) { + this.choiceContext = new ChoiceContext(this.choiceContext, kind, isForkingAsResult, this.forkContext); + } + + /** + * Pops the last choice context and finalizes it. + * This is called upon leaving a node that represents a choice. + * @throws {Error} (Unreachable.) + * @returns {ChoiceContext} The popped context. + */ + popChoiceContext() { + const poppedChoiceContext = this.choiceContext; + const forkContext = this.forkContext; + const head = forkContext.head; + + this.choiceContext = poppedChoiceContext.upper; + + switch (poppedChoiceContext.kind) { + case "&&": + case "||": + case "??": + + /* + * The `head` are the path of the right-hand operand. + * If we haven't previously added segments from child contexts, + * then we add these segments to all possible forks. + */ + if (!poppedChoiceContext.processed) { + poppedChoiceContext.trueForkContext.add(head); + poppedChoiceContext.falseForkContext.add(head); + poppedChoiceContext.nullishForkContext.add(head); + } + + /* + * If this context is the left (test) expression for another choice + * context, such as `a || b` in the expression `a || b || c`, + * then we take the segments for this context and move them up + * to the parent context. + */ + if (poppedChoiceContext.isForkingAsResult) { + const parentContext = this.choiceContext; + + parentContext.trueForkContext.addAll(poppedChoiceContext.trueForkContext); + parentContext.falseForkContext.addAll(poppedChoiceContext.falseForkContext); + parentContext.nullishForkContext.addAll(poppedChoiceContext.nullishForkContext); + parentContext.processed = true; + + // Exit early so we don't collapse all paths into one. + return poppedChoiceContext; + } + + break; + + case "test": + if (!poppedChoiceContext.processed) { + + /* + * The head segments are the path of the `if` block here. + * Updates the `true` path with the end of the `if` block. + */ + poppedChoiceContext.trueForkContext.clear(); + poppedChoiceContext.trueForkContext.add(head); + } else { + + /* + * The head segments are the path of the `else` block here. + * Updates the `false` path with the end of the `else` + * block. + */ + poppedChoiceContext.falseForkContext.clear(); + poppedChoiceContext.falseForkContext.add(head); + } + + break; + + case "loop": + + /* + * Loops are addressed in `popLoopContext()` so just return + * the context without modification. + */ + return poppedChoiceContext; + + /* c8 ignore next */ + default: + throw new Error("unreachable"); + } + + /* + * Merge the true path with the false path to create a single path. + */ + const combinedForkContext = poppedChoiceContext.trueForkContext; + + combinedForkContext.addAll(poppedChoiceContext.falseForkContext); + forkContext.replaceHead(combinedForkContext.makeNext(0, -1)); + + return poppedChoiceContext; + } + + /** + * Creates a code path segment to represent right-hand operand of a logical + * expression. + * This is called in the preprocessing phase when entering a node. + * @throws {Error} (Unreachable.) + * @returns {void} + */ + makeLogicalRight() { + const currentChoiceContext = this.choiceContext; + const forkContext = this.forkContext; + + if (currentChoiceContext.processed) { + + /* + * This context was already assigned segments from a child + * choice context. In this case, we are concerned only about + * the path that does not short-circuit and so ends up on the + * right-hand operand of the logical expression. + */ + let prevForkContext; + + switch (currentChoiceContext.kind) { + case "&&": // if true then go to the right-hand side. + prevForkContext = currentChoiceContext.trueForkContext; + break; + case "||": // if false then go to the right-hand side. + prevForkContext = currentChoiceContext.falseForkContext; + break; + case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's nullishForkContext. + prevForkContext = currentChoiceContext.nullishForkContext; + break; + default: + throw new Error("unreachable"); + } + + /* + * Create the segment for the right-hand operand of the logical expression + * and adjust the fork context pointer to point there. The right-hand segment + * is added at the end of all segments in `prevForkContext`. + */ + forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + + /* + * We no longer need this list of segments. + * + * Reset `processed` because we've removed the segments from the child + * choice context. This allows `popChoiceContext()` to continue adding + * segments later. + */ + prevForkContext.clear(); + currentChoiceContext.processed = false; + + } else { + + /* + * This choice context was not assigned segments from a child + * choice context, which means that it's a terminal logical + * expression. + * + * `head` is the segments for the left-hand operand of the + * logical expression. + * + * Each of the fork contexts below are empty at this point. We choose + * the path(s) that will short-circuit and add the segment for the + * left-hand operand to it. Ultimately, this will be the only segment + * in that path due to the short-circuting, so we are just seeding + * these paths to start. + */ + switch (currentChoiceContext.kind) { + case "&&": + + /* + * In most contexts, when a && expression evaluates to false, + * it short circuits, so we need to account for that by setting + * the `falseForkContext` to the left operand. + * + * When a && expression is the left-hand operand for a ?? + * expression, such as `(a && b) ?? c`, a nullish value will + * also short-circuit in a different way than a false value, + * so we also set the `nullishForkContext` to the left operand. + * This path is only used with a ?? expression and is thrown + * away for any other type of logical expression, so it's safe + * to always add. + */ + currentChoiceContext.falseForkContext.add(forkContext.head); + currentChoiceContext.nullishForkContext.add(forkContext.head); + break; + case "||": // the true path can short-circuit. + currentChoiceContext.trueForkContext.add(forkContext.head); + break; + case "??": // both can short-circuit. + currentChoiceContext.trueForkContext.add(forkContext.head); + currentChoiceContext.falseForkContext.add(forkContext.head); + break; + default: + throw new Error("unreachable"); + } + + /* + * Create the segment for the right-hand operand of the logical expression + * and adjust the fork context pointer to point there. + */ + forkContext.replaceHead(forkContext.makeNext(-1, -1)); + } + } + + /** + * Makes a code path segment of the `if` block. + * @returns {void} + */ + makeIfConsequent() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + /* + * If any result were not transferred from child contexts, + * this sets the head segments to both cases. + * The head segments are the path of the test expression. + */ + if (!context.processed) { + context.trueForkContext.add(forkContext.head); + context.falseForkContext.add(forkContext.head); + context.nullishForkContext.add(forkContext.head); + } + + context.processed = false; + + // Creates new path from the `true` case. + forkContext.replaceHead( + context.trueForkContext.makeNext(0, -1) + ); + } + + /** + * Makes a code path segment of the `else` block. + * @returns {void} + */ + makeIfAlternate() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + /* + * The head segments are the path of the `if` block. + * Updates the `true` path with the end of the `if` block. + */ + context.trueForkContext.clear(); + context.trueForkContext.add(forkContext.head); + context.processed = true; + + // Creates new path from the `false` case. + forkContext.replaceHead( + context.falseForkContext.makeNext(0, -1) + ); + } + + //-------------------------------------------------------------------------- + // ChainExpression + //-------------------------------------------------------------------------- + + /** + * Pushes a new `ChainExpression` context to the stack. This method is + * called when entering a `ChainExpression` node. A chain context is used to + * count forking in the optional chain then merge them on the exiting from the + * `ChainExpression` node. + * @returns {void} + */ + pushChainContext() { + this.chainContext = new ChainContext(this.chainContext); + } + + /** + * Pop a `ChainExpression` context from the stack. This method is called on + * exiting from each `ChainExpression` node. This merges all forks of the + * last optional chaining. + * @returns {void} + */ + popChainContext() { + const context = this.chainContext; + + this.chainContext = context.upper; + + // pop all choice contexts of this. + for (let i = context.choiceContextCount; i > 0; --i) { + this.popChoiceContext(); + } + } + + /** + * Create a choice context for optional access. + * This method is called on entering to each `(Call|Member)Expression[optional=true]` node. + * This creates a choice context as similar to `LogicalExpression[operator="??"]` node. + * @returns {void} + */ + makeOptionalNode() { + if (this.chainContext) { + this.chainContext.choiceContextCount += 1; + this.pushChoiceContext("??", false); + } + } + + /** + * Create a fork. + * This method is called on entering to the `arguments|property` property of each `(Call|Member)Expression` node. + * @returns {void} + */ + makeOptionalRight() { + if (this.chainContext) { + this.makeLogicalRight(); + } + } + + //-------------------------------------------------------------------------- + // SwitchStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context object of SwitchStatement and stacks it. + * @param {boolean} hasCase `true` if the switch statement has one or more + * case parts. + * @param {string|null} label The label text. + * @returns {void} + */ + pushSwitchContext(hasCase, label) { + this.switchContext = new SwitchContext(this.switchContext, hasCase); + this.pushBreakContext(true, label); + } + + /** + * Pops the last context of SwitchStatement and finalizes it. + * + * - Disposes all forking stack for `case` and `default`. + * - Creates the next code path segment from `context.brokenForkContext`. + * - If the last `SwitchCase` node is not a `default` part, creates a path + * to the `default` body. + * @returns {void} + */ + popSwitchContext() { + const context = this.switchContext; + + this.switchContext = context.upper; + + const forkContext = this.forkContext; + const brokenForkContext = this.popBreakContext().brokenForkContext; + + if (context.forkCount === 0) { + + /* + * When there is only one `default` chunk and there is one or more + * `break` statements, even if forks are nothing, it needs to merge + * those. + */ + if (!brokenForkContext.empty) { + brokenForkContext.add(forkContext.makeNext(-1, -1)); + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + + return; + } + + const lastSegments = forkContext.head; + + this.forkBypassPath(); + const lastCaseSegments = forkContext.head; + + /* + * `brokenForkContext` is used to make the next segment. + * It must add the last segment into `brokenForkContext`. + */ + brokenForkContext.add(lastSegments); + + /* + * Any value that doesn't match a `case` test should flow to the default + * case. That happens normally when the default case is last in the `switch`, + * but if it's not, we need to rewire some of the paths to be correct. + */ + if (!context.lastIsDefault) { + if (context.defaultBodySegments) { + + /* + * There is a non-empty default case, so remove the path from the `default` + * label to its body for an accurate representation. + */ + disconnectSegments(context.defaultSegments, context.defaultBodySegments); + + /* + * Connect the path from the last non-default case to the body of the + * default case. + */ + makeLooped(this, lastCaseSegments, context.defaultBodySegments); + + } else { + + /* + * There is no default case, so we treat this as if the last case + * had a `break` in it. + */ + brokenForkContext.add(lastCaseSegments); + } + } + + // Traverse up to the original fork context for the `switch` statement + for (let i = 0; i < context.forkCount; ++i) { + this.forkContext = this.forkContext.upper; + } + + /* + * Creates a path from all `brokenForkContext` paths. + * This is a path after `switch` statement. + */ + this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + + /** + * Makes a code path segment for a `SwitchCase` node. + * @param {boolean} isCaseBodyEmpty `true` if the body is empty. + * @param {boolean} isDefaultCase `true` if the body is the default case. + * @returns {void} + */ + makeSwitchCaseBody(isCaseBodyEmpty, isDefaultCase) { + const context = this.switchContext; + + if (!context.hasCase) { + return; + } + + /* + * Merge forks. + * The parent fork context has two segments. + * Those are from the current `case` and the body of the previous case. + */ + const parentForkContext = this.forkContext; + const forkContext = this.pushForkContext(); + + forkContext.add(parentForkContext.makeNext(0, -1)); + + /* + * Add information about the default case. + * + * The purpose of this is to identify the starting segments for the + * default case to make sure there is a path there. + */ + if (isDefaultCase) { + + /* + * This is the default case in the `switch`. + * + * We first save the current pointer as `defaultSegments` to point + * to the `default` keyword. + */ + context.defaultSegments = parentForkContext.head; + + /* + * If the body of the case is empty then we just set + * `foundEmptyDefault` to true; otherwise, we save a reference + * to the current pointer as `defaultBodySegments`. + */ + if (isCaseBodyEmpty) { + context.foundEmptyDefault = true; + } else { + context.defaultBodySegments = forkContext.head; + } + + } else { + + /* + * This is not the default case in the `switch`. + * + * If it's not empty and there is already an empty default case found, + * that means the default case actually comes before this case, + * and that it will fall through to this case. So, we can now + * ignore the previous default case (reset `foundEmptyDefault` to false) + * and set `defaultBodySegments` to the current segments because this is + * effectively the new default case. + */ + if (!isCaseBodyEmpty && context.foundEmptyDefault) { + context.foundEmptyDefault = false; + context.defaultBodySegments = forkContext.head; + } + } + + // keep track if the default case ends up last + context.lastIsDefault = isDefaultCase; + context.forkCount += 1; + } + + //-------------------------------------------------------------------------- + // TryStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context object of TryStatement and stacks it. + * @param {boolean} hasFinalizer `true` if the try statement has a + * `finally` block. + * @returns {void} + */ + pushTryContext(hasFinalizer) { + this.tryContext = new TryContext(this.tryContext, hasFinalizer, this.forkContext); + } + + /** + * Pops the last context of TryStatement and finalizes it. + * @returns {void} + */ + popTryContext() { + const context = this.tryContext; + + this.tryContext = context.upper; + + /* + * If we're inside the `catch` block, that means there is no `finally`, + * so we can process the `try` and `catch` blocks the simple way and + * merge their two paths. + */ + if (context.position === "catch") { + this.popForkContext(); + return; + } + + /* + * The following process is executed only when there is a `finally` + * block. + */ + + const originalReturnedForkContext = context.returnedForkContext; + const originalThrownForkContext = context.thrownForkContext; + + // no `return` or `throw` in `try` or `catch` so there's nothing left to do + if (originalReturnedForkContext.empty && originalThrownForkContext.empty) { + return; + } + + /* + * The following process is executed only when there is a `finally` + * block and there was a `return` or `throw` in the `try` or `catch` + * blocks. + */ + + // Separate head to normal paths and leaving paths. + const headSegments = this.forkContext.head; + + this.forkContext = this.forkContext.upper; + const normalSegments = headSegments.slice(0, headSegments.length / 2 | 0); + const leavingSegments = headSegments.slice(headSegments.length / 2 | 0); + + // Forwards the leaving path to upper contexts. + if (!originalReturnedForkContext.empty) { + getReturnContext(this).returnedForkContext.add(leavingSegments); + } + if (!originalThrownForkContext.empty) { + getThrowContext(this).thrownForkContext.add(leavingSegments); + } + + // Sets the normal path as the next. + this.forkContext.replaceHead(normalSegments); + + /* + * If both paths of the `try` block and the `catch` block are + * unreachable, the next path becomes unreachable as well. + */ + if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable) { + this.forkContext.makeUnreachable(); + } + } + + /** + * Makes a code path segment for a `catch` block. + * @returns {void} + */ + makeCatchBlock() { + const context = this.tryContext; + const forkContext = this.forkContext; + const originalThrownForkContext = context.thrownForkContext; + + /* + * We are now in a catch block so we need to update the context + * with that information. This includes creating a new fork + * context in case we encounter any `throw` statements here. + */ + context.position = "catch"; + context.thrownForkContext = ForkContext.newEmpty(forkContext); + context.lastOfTryIsReachable = forkContext.reachable; + + // Merge the thrown paths from the `try` and `catch` blocks + originalThrownForkContext.add(forkContext.head); + const thrownSegments = originalThrownForkContext.makeNext(0, -1); + + // Fork to a bypass and the merged thrown path. + this.pushForkContext(); + this.forkBypassPath(); + this.forkContext.add(thrownSegments); + } + + /** + * Makes a code path segment for a `finally` block. + * + * In the `finally` block, parallel paths are created. The parallel paths + * are used as leaving-paths. The leaving-paths are paths from `return` + * statements and `throw` statements in a `try` block or a `catch` block. + * @returns {void} + */ + makeFinallyBlock() { + const context = this.tryContext; + let forkContext = this.forkContext; + const originalReturnedForkContext = context.returnedForkContext; + const originalThrownForContext = context.thrownForkContext; + const headOfLeavingSegments = forkContext.head; + + // Update state. + if (context.position === "catch") { + + // Merges two paths from the `try` block and `catch` block. + this.popForkContext(); + forkContext = this.forkContext; + + context.lastOfCatchIsReachable = forkContext.reachable; + } else { + context.lastOfTryIsReachable = forkContext.reachable; + } + + + context.position = "finally"; + + /* + * If there was no `return` or `throw` in either the `try` or `catch` + * blocks, then there's no further code paths to create for `finally`. + */ + if (originalReturnedForkContext.empty && originalThrownForContext.empty) { + + // This path does not leave. + return; + } + + /* + * Create a parallel segment from merging returned and thrown. + * This segment will leave at the end of this `finally` block. + */ + const segments = forkContext.makeNext(-1, -1); + + for (let i = 0; i < forkContext.count; ++i) { + const prevSegsOfLeavingSegment = [headOfLeavingSegments[i]]; + + for (let j = 0; j < originalReturnedForkContext.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(originalReturnedForkContext.segmentsList[j][i]); + } + for (let j = 0; j < originalThrownForContext.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(originalThrownForContext.segmentsList[j][i]); + } + + segments.push( + CodePathSegment.newNext( + this.idGenerator.next(), + prevSegsOfLeavingSegment + ) + ); + } + + this.pushForkContext(true); + this.forkContext.add(segments); + } + + /** + * Makes a code path segment from the first throwable node to the `catch` + * block or the `finally` block. + * @returns {void} + */ + makeFirstThrowablePathInTryBlock() { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getThrowContext(this); + + if (context === this || + context.position !== "try" || + !context.thrownForkContext.empty + ) { + return; + } + + context.thrownForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeNext(-1, -1)); + } + + //-------------------------------------------------------------------------- + // Loop Statements + //-------------------------------------------------------------------------- + + /** + * Creates a context object of a loop statement and stacks it. + * @param {string} type The type of the node which was triggered. One of + * `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`, + * and `ForStatement`. + * @param {string|null} label A label of the node which was triggered. + * @throws {Error} (Unreachable - unknown type.) + * @returns {void} + */ + pushLoopContext(type, label) { + const forkContext = this.forkContext; + + // All loops need a path to account for `break` statements + const breakContext = this.pushBreakContext(true, label); + + switch (type) { + case "WhileStatement": + this.pushChoiceContext("loop", false); + this.loopContext = new WhileLoopContext(this.loopContext, label, breakContext); + break; + + case "DoWhileStatement": + this.pushChoiceContext("loop", false); + this.loopContext = new DoWhileLoopContext(this.loopContext, label, breakContext, forkContext); + break; + + case "ForStatement": + this.pushChoiceContext("loop", false); + this.loopContext = new ForLoopContext(this.loopContext, label, breakContext); + break; + + case "ForInStatement": + this.loopContext = new ForInLoopContext(this.loopContext, label, breakContext); + break; + + case "ForOfStatement": + this.loopContext = new ForOfLoopContext(this.loopContext, label, breakContext); + break; + + /* c8 ignore next */ + default: + throw new Error(`unknown type: "${type}"`); + } + } + + /** + * Pops the last context of a loop statement and finalizes it. + * @throws {Error} (Unreachable - unknown type.) + * @returns {void} + */ + popLoopContext() { + const context = this.loopContext; + + this.loopContext = context.upper; + + const forkContext = this.forkContext; + const brokenForkContext = this.popBreakContext().brokenForkContext; + + // Creates a looped path. + switch (context.type) { + case "WhileStatement": + case "ForStatement": + this.popChoiceContext(); + + /* + * Creates the path from the end of the loop body up to the + * location where `continue` would jump to. + */ + makeLooped( + this, + forkContext.head, + context.continueDestSegments + ); + break; + + case "DoWhileStatement": { + const choiceContext = this.popChoiceContext(); + + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(forkContext.head); + choiceContext.falseForkContext.add(forkContext.head); + } + + /* + * If this isn't a hardcoded `true` condition, then `break` + * should continue down the path as if the condition evaluated + * to false. + */ + if (context.test !== true) { + brokenForkContext.addAll(choiceContext.falseForkContext); + } + + /* + * When the condition is true, the loop continues back to the top, + * so create a path from each possible true condition back to the + * top of the loop. + */ + const segmentsList = choiceContext.trueForkContext.segmentsList; + + for (let i = 0; i < segmentsList.length; ++i) { + makeLooped( + this, + segmentsList[i], + context.entrySegments + ); + } + break; + } + + case "ForInStatement": + case "ForOfStatement": + brokenForkContext.add(forkContext.head); + + /* + * Creates the path from the end of the loop body up to the + * left expression (left of `in` or `of`) of the loop. + */ + makeLooped( + this, + forkContext.head, + context.leftSegments + ); + break; + + /* c8 ignore next */ + default: + throw new Error("unreachable"); + } + + /* + * If there wasn't a `break` statement in the loop, then we're at + * the end of the loop's path, so we make an unreachable segment + * to mark that. + * + * If there was a `break` statement, then we continue on into the + * `brokenForkContext`. + */ + if (brokenForkContext.empty) { + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } else { + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + } + + /** + * Makes a code path segment for the test part of a WhileStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeWhileTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + const testSegments = forkContext.makeNext(0, -1); + + // Update state. + context.test = test; + context.continueDestSegments = testSegments; + forkContext.replaceHead(testSegments); + } + + /** + * Makes a code path segment for the body part of a WhileStatement. + * @returns {void} + */ + makeWhileBody() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(forkContext.head); + choiceContext.falseForkContext.add(forkContext.head); + } + + /* + * If this isn't a hardcoded `true` condition, then `break` + * should continue down the path as if the condition evaluated + * to false. + */ + if (context.test !== true) { + context.brokenForkContext.addAll(choiceContext.falseForkContext); + } + forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1)); + } + + /** + * Makes a code path segment for the body part of a DoWhileStatement. + * @returns {void} + */ + makeDoWhileBody() { + const context = this.loopContext; + const forkContext = this.forkContext; + const bodySegments = forkContext.makeNext(-1, -1); + + // Update state. + context.entrySegments = bodySegments; + forkContext.replaceHead(bodySegments); + } + + /** + * Makes a code path segment for the test part of a DoWhileStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeDoWhileTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + + context.test = test; + + /* + * If there is a `continue` statement in the loop then `continueForkContext` + * won't be empty. We wire up the path from `continue` to the loop + * test condition and then continue the traversal in the root fork context. + */ + if (!context.continueForkContext.empty) { + context.continueForkContext.add(forkContext.head); + const testSegments = context.continueForkContext.makeNext(0, -1); + + forkContext.replaceHead(testSegments); + } + } + + /** + * Makes a code path segment for the test part of a ForStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeForTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + const endOfInitSegments = forkContext.head; + const testSegments = forkContext.makeNext(-1, -1); + + /* + * Update the state. + * + * The `continueDestSegments` are set to `testSegments` because we + * don't yet know if there is an update expression in this loop. So, + * from what we already know at this point, a `continue` statement + * will jump back to the test expression. + */ + context.test = test; + context.endOfInitSegments = endOfInitSegments; + context.continueDestSegments = context.testSegments = testSegments; + forkContext.replaceHead(testSegments); + } + + /** + * Makes a code path segment for the update part of a ForStatement. + * @returns {void} + */ + makeForUpdate() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + // Make the next paths of the test. + if (context.testSegments) { + finalizeTestSegmentsOfFor( + context, + choiceContext, + forkContext.head + ); + } else { + context.endOfInitSegments = forkContext.head; + } + + /* + * Update the state. + * + * The `continueDestSegments` are now set to `updateSegments` because we + * know there is an update expression in this loop. So, a `continue` statement + * in the loop will jump to the update expression first, and then to any + * test expression the loop might have. + */ + const updateSegments = forkContext.makeDisconnected(-1, -1); + + context.continueDestSegments = context.updateSegments = updateSegments; + forkContext.replaceHead(updateSegments); + } + + /** + * Makes a code path segment for the body part of a ForStatement. + * @returns {void} + */ + makeForBody() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + /* + * Determine what to do based on which part of the `for` loop are present. + * 1. If there is an update expression, then `updateSegments` is not null and + * we need to assign `endOfUpdateSegments`, and if there is a test + * expression, we then need to create the looped path to get back to + * the test condition. + * 2. If there is no update expression but there is a test expression, + * then we only need to update the test segment information. + * 3. If there is no update expression and no test expression, then we + * just save `endOfInitSegments`. + */ + if (context.updateSegments) { + context.endOfUpdateSegments = forkContext.head; + + /* + * In a `for` loop that has both an update expression and a test + * condition, execution flows from the test expression into the + * loop body, to the update expression, and then back to the test + * expression to determine if the loop should continue. + * + * To account for that, we need to make a path from the end of the + * update expression to the start of the test expression. This is + * effectively what creates the loop in the code path. + */ + if (context.testSegments) { + makeLooped( + this, + context.endOfUpdateSegments, + context.testSegments + ); + } + } else if (context.testSegments) { + finalizeTestSegmentsOfFor( + context, + choiceContext, + forkContext.head + ); + } else { + context.endOfInitSegments = forkContext.head; + } + + let bodySegments = context.endOfTestSegments; + + /* + * If there is a test condition, then there `endOfTestSegments` is also + * the start of the loop body. If there isn't a test condition then + * `bodySegments` will be null and we need to look elsewhere to find + * the start of the body. + * + * The body starts at the end of the init expression and ends at the end + * of the update expression, so we use those locations to determine the + * body segments. + */ + if (!bodySegments) { + + const prevForkContext = ForkContext.newEmpty(forkContext); + + prevForkContext.add(context.endOfInitSegments); + if (context.endOfUpdateSegments) { + prevForkContext.add(context.endOfUpdateSegments); + } + + bodySegments = prevForkContext.makeNext(0, -1); + } + + /* + * If there was no test condition and no update expression, then + * `continueDestSegments` will be null. In that case, a + * `continue` should skip directly to the body of the loop. + * Otherwise, we want to keep the current `continueDestSegments`. + */ + context.continueDestSegments = context.continueDestSegments || bodySegments; + + // move pointer to the body + forkContext.replaceHead(bodySegments); + } + + /** + * Makes a code path segment for the left part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfLeft() { + const context = this.loopContext; + const forkContext = this.forkContext; + const leftSegments = forkContext.makeDisconnected(-1, -1); + + // Update state. + context.prevSegments = forkContext.head; + context.leftSegments = context.continueDestSegments = leftSegments; + forkContext.replaceHead(leftSegments); + } + + /** + * Makes a code path segment for the right part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfRight() { + const context = this.loopContext; + const forkContext = this.forkContext; + const temp = ForkContext.newEmpty(forkContext); + + temp.add(context.prevSegments); + const rightSegments = temp.makeNext(-1, -1); + + // Update state. + context.endOfLeftSegments = forkContext.head; + forkContext.replaceHead(rightSegments); + } + + /** + * Makes a code path segment for the body part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfBody() { + const context = this.loopContext; + const forkContext = this.forkContext; + const temp = ForkContext.newEmpty(forkContext); + + temp.add(context.endOfLeftSegments); + const bodySegments = temp.makeNext(-1, -1); + + // Make a path: `right` -> `left`. + makeLooped(this, forkContext.head, context.leftSegments); + + // Update state. + context.brokenForkContext.add(forkContext.head); + forkContext.replaceHead(bodySegments); + } + + //-------------------------------------------------------------------------- + // Control Statements + //-------------------------------------------------------------------------- + + /** + * Creates new context in which a `break` statement can be used. This occurs inside of a loop, + * labeled statement, or switch statement. + * @param {boolean} breakable Indicates if we are inside a statement where + * `break` without a label will exit the statement. + * @param {string|null} label The label associated with the statement. + * @returns {BreakContext} The new context. + */ + pushBreakContext(breakable, label) { + this.breakContext = new BreakContext(this.breakContext, breakable, label, this.forkContext); + return this.breakContext; + } + + /** + * Removes the top item of the break context stack. + * @returns {Object} The removed context. + */ + popBreakContext() { + const context = this.breakContext; + const forkContext = this.forkContext; + + this.breakContext = context.upper; + + // Process this context here for other than switches and loops. + if (!context.breakable) { + const brokenForkContext = context.brokenForkContext; + + if (!brokenForkContext.empty) { + brokenForkContext.add(forkContext.head); + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + } + + return context; + } + + /** + * Makes a path for a `break` statement. + * + * It registers the head segment to a context of `break`. + * It makes new unreachable segment, then it set the head with the segment. + * @param {string|null} label A label of the break statement. + * @returns {void} + */ + makeBreak(label) { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getBreakContext(this, label); + + + if (context) { + context.brokenForkContext.add(forkContext.head); + } + + /* c8 ignore next */ + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + + /** + * Makes a path for a `continue` statement. + * + * It makes a looping path. + * It makes new unreachable segment, then it set the head with the segment. + * @param {string|null} label A label of the continue statement. + * @returns {void} + */ + makeContinue(label) { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getContinueContext(this, label); + + if (context) { + if (context.continueDestSegments) { + makeLooped(this, forkContext.head, context.continueDestSegments); + + // If the context is a for-in/of loop, this affects a break also. + if (context.type === "ForInStatement" || + context.type === "ForOfStatement" + ) { + context.brokenForkContext.add(forkContext.head); + } + } else { + context.continueForkContext.add(forkContext.head); + } + } + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + + /** + * Makes a path for a `return` statement. + * + * It registers the head segment to a context of `return`. + * It makes new unreachable segment, then it set the head with the segment. + * @returns {void} + */ + makeReturn() { + const forkContext = this.forkContext; + + if (forkContext.reachable) { + getReturnContext(this).returnedForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + } + + /** + * Makes a path for a `throw` statement. + * + * It registers the head segment to a context of `throw`. + * It makes new unreachable segment, then it set the head with the segment. + * @returns {void} + */ + makeThrow() { + const forkContext = this.forkContext; + + if (forkContext.reachable) { + getThrowContext(this).thrownForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + } + + /** + * Makes the final path. + * @returns {void} + */ + makeFinal() { + const segments = this.currentSegments; + + if (segments.length > 0 && segments[0].reachable) { + this.returnedForkContext.add(segments); + } + } +} + +module.exports = CodePathState; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path.js new file mode 100644 index 0000000..8c438e2 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path.js @@ -0,0 +1,344 @@ +/** + * @fileoverview A class of the code path. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const CodePathState = require("./code-path-state"); +const IdGenerator = require("./id-generator"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A code path. + */ +class CodePath { + + /** + * Creates a new instance. + * @param {Object} options Options for the function (see below). + * @param {string} options.id An identifier. + * @param {string} options.origin The type of code path origin. + * @param {CodePath|null} options.upper The code path of the upper function scope. + * @param {Function} options.onLooped A callback function to notify looping. + */ + constructor({ id, origin, upper, onLooped }) { + + /** + * The identifier of this code path. + * Rules use it to store additional information of each rule. + * @type {string} + */ + this.id = id; + + /** + * The reason that this code path was started. May be "program", + * "function", "class-field-initializer", or "class-static-block". + * @type {string} + */ + this.origin = origin; + + /** + * The code path of the upper function scope. + * @type {CodePath|null} + */ + this.upper = upper; + + /** + * The code paths of nested function scopes. + * @type {CodePath[]} + */ + this.childCodePaths = []; + + // Initializes internal state. + Object.defineProperty( + this, + "internal", + { value: new CodePathState(new IdGenerator(`${id}_`), onLooped) } + ); + + // Adds this into `childCodePaths` of `upper`. + if (upper) { + upper.childCodePaths.push(this); + } + } + + /** + * Gets the state of a given code path. + * @param {CodePath} codePath A code path to get. + * @returns {CodePathState} The state of the code path. + */ + static getState(codePath) { + return codePath.internal; + } + + /** + * The initial code path segment. This is the segment that is at the head + * of the code path. + * This is a passthrough to the underlying `CodePathState`. + * @type {CodePathSegment} + */ + get initialSegment() { + return this.internal.initialSegment; + } + + /** + * Final code path segments. These are the terminal (tail) segments in the + * code path, which is the combination of `returnedSegments` and `thrownSegments`. + * All segments in this array are reachable. + * This is a passthrough to the underlying `CodePathState`. + * @type {CodePathSegment[]} + */ + get finalSegments() { + return this.internal.finalSegments; + } + + /** + * Final code path segments that represent normal completion of the code path. + * For functions, this means both explicit `return` statements and implicit returns, + * such as the last reachable segment in a function that does not have an + * explicit `return` as this implicitly returns `undefined`. For scripts, + * modules, class field initializers, and class static blocks, this means + * all lines of code have been executed. + * These segments are also present in `finalSegments`. + * This is a passthrough to the underlying `CodePathState`. + * @type {CodePathSegment[]} + */ + get returnedSegments() { + return this.internal.returnedForkContext; + } + + /** + * Final code path segments that represent `throw` statements. + * This is a passthrough to the underlying `CodePathState`. + * These segments are also present in `finalSegments`. + * @type {CodePathSegment[]} + */ + get thrownSegments() { + return this.internal.thrownForkContext; + } + + /** + * Traverses all segments in this code path. + * + * codePath.traverseSegments((segment, controller) => { + * // do something. + * }); + * + * This method enumerates segments in order from the head. + * + * The `controller` argument has two methods: + * + * - `skip()` - skips the following segments in this branch + * - `break()` - skips all following segments in the traversal + * + * A note on the parameters: the `options` argument is optional. This means + * the first argument might be an options object or the callback function. + * @param {Object} [optionsOrCallback] Optional first and last segments to traverse. + * @param {CodePathSegment} [optionsOrCallback.first] The first segment to traverse. + * @param {CodePathSegment} [optionsOrCallback.last] The last segment to traverse. + * @param {Function} callback A callback function. + * @returns {void} + */ + traverseSegments(optionsOrCallback, callback) { + + // normalize the arguments into a callback and options + let resolvedOptions; + let resolvedCallback; + + if (typeof optionsOrCallback === "function") { + resolvedCallback = optionsOrCallback; + resolvedOptions = {}; + } else { + resolvedOptions = optionsOrCallback || {}; + resolvedCallback = callback; + } + + // determine where to start traversing from based on the options + const startSegment = resolvedOptions.first || this.internal.initialSegment; + const lastSegment = resolvedOptions.last; + + // set up initial location information + let record; + let index; + let end; + let segment = null; + + // segments that have already been visited during traversal + const visited = new Set(); + + // tracks the traversal steps + const stack = [[startSegment, 0]]; + + // segments that have been skipped during traversal + const skipped = new Set(); + + // indicates if we exited early from the traversal + let broken = false; + + /** + * Maintains traversal state. + */ + const controller = { + + /** + * Skip the following segments in this branch. + * @returns {void} + */ + skip() { + skipped.add(segment); + }, + + /** + * Stop traversal completely - do not traverse to any + * other segments. + * @returns {void} + */ + break() { + broken = true; + } + }; + + /** + * Checks if a given previous segment has been visited. + * @param {CodePathSegment} prevSegment A previous segment to check. + * @returns {boolean} `true` if the segment has been visited. + */ + function isVisited(prevSegment) { + return ( + visited.has(prevSegment) || + segment.isLoopedPrevSegment(prevSegment) + ); + } + + /** + * Checks if a given previous segment has been skipped. + * @param {CodePathSegment} prevSegment A previous segment to check. + * @returns {boolean} `true` if the segment has been skipped. + */ + function isSkipped(prevSegment) { + return ( + skipped.has(prevSegment) || + segment.isLoopedPrevSegment(prevSegment) + ); + } + + // the traversal + while (stack.length > 0) { + + /* + * This isn't a pure stack. We use the top record all the time + * but don't always pop it off. The record is popped only if + * one of the following is true: + * + * 1) We have already visited the segment. + * 2) We have not visited *all* of the previous segments. + * 3) We have traversed past the available next segments. + * + * Otherwise, we just read the value and sometimes modify the + * record as we traverse. + */ + record = stack.at(-1); + segment = record[0]; + index = record[1]; + + if (index === 0) { + + // Skip if this segment has been visited already. + if (visited.has(segment)) { + stack.pop(); + continue; + } + + // Skip if all previous segments have not been visited. + if (segment !== startSegment && + segment.prevSegments.length > 0 && + !segment.prevSegments.every(isVisited) + ) { + stack.pop(); + continue; + } + + visited.add(segment); + + + // Skips the segment if all previous segments have been skipped. + const shouldSkip = ( + skipped.size > 0 && + segment.prevSegments.length > 0 && + segment.prevSegments.every(isSkipped) + ); + + /* + * If the most recent segment hasn't been skipped, then we call + * the callback, passing in the segment and the controller. + */ + if (!shouldSkip) { + resolvedCallback.call(this, segment, controller); + + // exit if we're at the last segment + if (segment === lastSegment) { + controller.skip(); + } + + /* + * If the previous statement was executed, or if the callback + * called a method on the controller, we might need to exit the + * loop, so check for that and break accordingly. + */ + if (broken) { + break; + } + } else { + + // If the most recent segment has been skipped, then mark it as skipped. + skipped.add(segment); + } + } + + // Update the stack. + end = segment.nextSegments.length - 1; + if (index < end) { + + /* + * If we haven't yet visited all of the next segments, update + * the current top record on the stack to the next index to visit + * and then push a record for the current segment on top. + * + * Setting the current top record's index lets us know how many + * times we've been here and ensures that the segment won't be + * reprocessed (because we only process segments with an index + * of 0). + */ + record[1] += 1; + stack.push([segment.nextSegments[index], 0]); + } else if (index === end) { + + /* + * If we are at the last next segment, then reset the top record + * in the stack to next segment and set its index to 0 so it will + * be processed next. + */ + record[0] = segment.nextSegments[index]; + record[1] = 0; + } else { + + /* + * If index > end, that means we have no more segments that need + * processing. So, we pop that record off of the stack in order to + * continue traversing at the next level up. + */ + stack.pop(); + } + } + } +} + +module.exports = CodePath; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js b/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js new file mode 100644 index 0000000..c0e01a8 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js @@ -0,0 +1,203 @@ +/** + * @fileoverview Helpers to debug for code path analysis. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:code-path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets id of a given segment. + * @param {CodePathSegment} segment A segment to get. + * @returns {string} Id of the segment. + */ +/* c8 ignore next */ +function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc -- Ignoring + return segment.id + (segment.reachable ? "" : "!"); +} + +/** + * Get string for the given node and operation. + * @param {ASTNode} node The node to convert. + * @param {"enter" | "exit" | undefined} label The operation label. + * @returns {string} The string representation. + */ +function nodeToString(node, label) { + const suffix = label ? `:${label}` : ""; + + switch (node.type) { + case "Identifier": return `${node.type}${suffix} (${node.name})`; + case "Literal": return `${node.type}${suffix} (${node.value})`; + default: return `${node.type}${suffix}`; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + /** + * A flag that debug dumping is enabled or not. + * @type {boolean} + */ + enabled: debug.enabled, + + /** + * Dumps given objects. + * @param {...any} args objects to dump. + * @returns {void} + */ + dump: debug, + + /** + * Dumps the current analyzing state. + * @param {ASTNode} node A node to dump. + * @param {CodePathState} state A state to dump. + * @param {boolean} leaving A flag whether or not it's leaving + * @returns {void} + */ + dumpState: !debug.enabled ? debug : /* c8 ignore next */ function(node, state, leaving) { + for (let i = 0; i < state.currentSegments.length; ++i) { + const segInternal = state.currentSegments[i].internal; + + if (leaving) { + const last = segInternal.nodes.length - 1; + + if (last >= 0 && segInternal.nodes[last] === nodeToString(node, "enter")) { + segInternal.nodes[last] = nodeToString(node, void 0); + } else { + segInternal.nodes.push(nodeToString(node, "exit")); + } + } else { + segInternal.nodes.push(nodeToString(node, "enter")); + } + } + + debug([ + `${state.currentSegments.map(getId).join(",")})`, + `${node.type}${leaving ? ":exit" : ""}` + ].join(" ")); + }, + + /** + * Dumps a DOT code of a given code path. + * The DOT code can be visualized with Graphvis. + * @param {CodePath} codePath A code path to dump. + * @returns {void} + * @see http://www.graphviz.org + * @see http://www.webgraphviz.com + */ + dumpDot: !debug.enabled ? debug : /* c8 ignore next */ function(codePath) { + let text = + "\n" + + "digraph {\n" + + "node[shape=box,style=\"rounded,filled\",fillcolor=white];\n" + + "initial[label=\"\",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; + + if (codePath.returnedSegments.length > 0) { + text += "final[label=\"\",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; + } + if (codePath.thrownSegments.length > 0) { + text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize=true];\n"; + } + + const traceMap = Object.create(null); + const arrows = this.makeDotArrows(codePath, traceMap); + + for (const id in traceMap) { // eslint-disable-line guard-for-in -- Want ability to traverse prototype + const segment = traceMap[id]; + + text += `${id}[`; + + if (segment.reachable) { + text += "label=\""; + } else { + text += "style=\"rounded,dashed,filled\",fillcolor=\"#FF9800\",label=\"<>\\n"; + } + + if (segment.internal.nodes.length > 0) { + text += segment.internal.nodes.join("\\n"); + } else { + text += "????"; + } + + text += "\"];\n"; + } + + text += `${arrows}\n`; + text += "}"; + debug("DOT", text); + }, + + /** + * Makes a DOT code of a given code path. + * The DOT code can be visualized with Graphvis. + * @param {CodePath} codePath A code path to make DOT. + * @param {Object} traceMap Optional. A map to check whether or not segments had been done. + * @returns {string} A DOT code of the code path. + */ + makeDotArrows(codePath, traceMap) { + const stack = [[codePath.initialSegment, 0]]; + const done = traceMap || Object.create(null); + let lastId = codePath.initialSegment.id; + let text = `initial->${codePath.initialSegment.id}`; + + while (stack.length > 0) { + const item = stack.pop(); + const segment = item[0]; + const index = item[1]; + + if (done[segment.id] && index === 0) { + continue; + } + done[segment.id] = segment; + + const nextSegment = segment.allNextSegments[index]; + + if (!nextSegment) { + continue; + } + + if (lastId === segment.id) { + text += `->${nextSegment.id}`; + } else { + text += `;\n${segment.id}->${nextSegment.id}`; + } + lastId = nextSegment.id; + + stack.unshift([segment, 1 + index]); + stack.push([nextSegment, 0]); + } + + codePath.returnedSegments.forEach(finalSegment => { + if (lastId === finalSegment.id) { + text += "->final"; + } else { + text += `;\n${finalSegment.id}->final`; + } + lastId = null; + }); + + codePath.thrownSegments.forEach(finalSegment => { + if (lastId === finalSegment.id) { + text += "->thrown"; + } else { + text += `;\n${finalSegment.id}->thrown`; + } + lastId = null; + }); + + return `${text};`; + } +}; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js b/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js new file mode 100644 index 0000000..d6598be --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js @@ -0,0 +1,349 @@ +/** + * @fileoverview A class to operate forking. + * + * This is state of forking. + * This has a fork list and manages it. + * + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("../../shared/assert"), + CodePathSegment = require("./code-path-segment"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether or not a given segment is reachable. + * @param {CodePathSegment} segment The segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Creates a new segment for each fork in the given context and appends it + * to the end of the specified range of segments. Ultimately, this ends up calling + * `new CodePathSegment()` for each of the forks using the `create` argument + * as a wrapper around special behavior. + * + * The `startIndex` and `endIndex` arguments specify a range of segments in + * `context` that should become `allPrevSegments` for the newly created + * `CodePathSegment` objects. + * + * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and + * `end` is `-1`, this creates two new segments, `[g, h]`. This `g` is appended to + * the end of the path from `a`, `c`, and `e`. This `h` is appended to the end of + * `b`, `d`, and `f`. + * @param {ForkContext} context An instance from which the previous segments + * will be obtained. + * @param {number} startIndex The index of the first segment in the context + * that should be specified as previous segments for the newly created segments. + * @param {number} endIndex The index of the last segment in the context + * that should be specified as previous segments for the newly created segments. + * @param {Function} create A function that creates new `CodePathSegment` + * instances in a particular way. See the `CodePathSegment.new*` methods. + * @returns {Array} An array of the newly-created segments. + */ +function createSegments(context, startIndex, endIndex, create) { + + /** @type {Array>} */ + const list = context.segmentsList; + + /* + * Both `startIndex` and `endIndex` work the same way: if the number is zero + * or more, then the number is used as-is. If the number is negative, + * then that number is added to the length of the segments list to + * determine the index to use. That means -1 for either argument + * is the last element, -2 is the second to last, and so on. + * + * So if `startIndex` is 0, `endIndex` is -1, and `list.length` is 3, the + * effective `startIndex` is 0 and the effective `endIndex` is 2, so this function + * will include items at indices 0, 1, and 2. + * + * Therefore, if `startIndex` is -1 and `endIndex` is -1, that means we'll only + * be using the last segment in `list`. + */ + const normalizedBegin = startIndex >= 0 ? startIndex : list.length + startIndex; + const normalizedEnd = endIndex >= 0 ? endIndex : list.length + endIndex; + + /** @type {Array} */ + const segments = []; + + for (let i = 0; i < context.count; ++i) { + + // this is passed into `new CodePathSegment` to add to code path. + const allPrevSegments = []; + + for (let j = normalizedBegin; j <= normalizedEnd; ++j) { + allPrevSegments.push(list[j][i]); + } + + // note: `create` is just a wrapper that augments `new CodePathSegment`. + segments.push(create(context.idGenerator.next(), allPrevSegments)); + } + + return segments; +} + +/** + * Inside of a `finally` block we end up with two parallel paths. If the code path + * exits by a control statement (such as `break` or `continue`) from the `finally` + * block, then we need to merge the remaining parallel paths back into one. + * @param {ForkContext} context The fork context to work on. + * @param {Array} segments Segments to merge. + * @returns {Array} The merged segments. + */ +function mergeExtraSegments(context, segments) { + let currentSegments = segments; + + /* + * We need to ensure that the array returned from this function contains no more + * than the number of segments that the context allows. `context.count` indicates + * how many items should be in the returned array to ensure that the new segment + * entries will line up with the already existing segment entries. + */ + while (currentSegments.length > context.count) { + const merged = []; + + /* + * Because `context.count` is a factor of 2 inside of a `finally` block, + * we can divide the segment count by 2 to merge the paths together. + * This loops through each segment in the list and creates a new `CodePathSegment` + * that has the segment and the segment two slots away as previous segments. + * + * If `currentSegments` is [a,b,c,d], this will create new segments e and f, such + * that: + * + * When `i` is 0: + * a->e + * c->e + * + * When `i` is 1: + * b->f + * d->f + */ + for (let i = 0, length = Math.floor(currentSegments.length / 2); i < length; ++i) { + merged.push(CodePathSegment.newNext( + context.idGenerator.next(), + [currentSegments[i], currentSegments[i + length]] + )); + } + + /* + * Go through the loop condition one more time to see if we have the + * number of segments for the context. If not, we'll keep merging paths + * of the merged segments until we get there. + */ + currentSegments = merged; + } + + return currentSegments; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Manages the forking of code paths. + */ +class ForkContext { + + /** + * Creates a new instance. + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @param {ForkContext|null} upper The preceding fork context. + * @param {number} count The number of parallel segments in each element + * of `segmentsList`. + */ + constructor(idGenerator, upper, count) { + + /** + * The ID generator that will generate segment IDs for any new + * segments that are created. + * @type {IdGenerator} + */ + this.idGenerator = idGenerator; + + /** + * The preceding fork context. + * @type {ForkContext|null} + */ + this.upper = upper; + + /** + * The number of elements in each element of `segmentsList`. In most + * cases, this is 1 but can be 2 when there is a `finally` present, + * which forks the code path outside of normal flow. In the case of nested + * `finally` blocks, this can be a multiple of 2. + * @type {number} + */ + this.count = count; + + /** + * The segments within this context. Each element in this array has + * `count` elements that represent one step in each fork. For example, + * when `segmentsList` is `[[a, b], [c, d], [e, f]]`, there is one path + * a->c->e and one path b->d->f, and `count` is 2 because each element + * is an array with two elements. + * @type {Array>} + */ + this.segmentsList = []; + } + + /** + * The segments that begin this fork context. + * @type {Array} + */ + get head() { + const list = this.segmentsList; + + return list.length === 0 ? [] : list.at(-1); + } + + /** + * Indicates if the context contains no segments. + * @type {boolean} + */ + get empty() { + return this.segmentsList.length === 0; + } + + /** + * Indicates if there are any segments that are reachable. + * @type {boolean} + */ + get reachable() { + const segments = this.head; + + return segments.length > 0 && segments.some(isReachable); + } + + /** + * Creates new segments in this context and appends them to the end of the + * already existing `CodePathSegment`s specified by `startIndex` and + * `endIndex`. + * @param {number} startIndex The index of the first segment in the context + * that should be specified as previous segments for the newly created segments. + * @param {number} endIndex The index of the last segment in the context + * that should be specified as previous segments for the newly created segments. + * @returns {Array} An array of the newly created segments. + */ + makeNext(startIndex, endIndex) { + return createSegments(this, startIndex, endIndex, CodePathSegment.newNext); + } + + /** + * Creates new unreachable segments in this context and appends them to the end of the + * already existing `CodePathSegment`s specified by `startIndex` and + * `endIndex`. + * @param {number} startIndex The index of the first segment in the context + * that should be specified as previous segments for the newly created segments. + * @param {number} endIndex The index of the last segment in the context + * that should be specified as previous segments for the newly created segments. + * @returns {Array} An array of the newly created segments. + */ + makeUnreachable(startIndex, endIndex) { + return createSegments(this, startIndex, endIndex, CodePathSegment.newUnreachable); + } + + /** + * Creates new segments in this context and does not append them to the end + * of the already existing `CodePathSegment`s specified by `startIndex` and + * `endIndex`. The `startIndex` and `endIndex` are only used to determine if + * the new segments should be reachable. If any of the segments in this range + * are reachable then the new segments are also reachable; otherwise, the new + * segments are unreachable. + * @param {number} startIndex The index of the first segment in the context + * that should be considered for reachability. + * @param {number} endIndex The index of the last segment in the context + * that should be considered for reachability. + * @returns {Array} An array of the newly created segments. + */ + makeDisconnected(startIndex, endIndex) { + return createSegments(this, startIndex, endIndex, CodePathSegment.newDisconnected); + } + + /** + * Adds segments to the head of this context. + * @param {Array} segments The segments to add. + * @returns {void} + */ + add(segments) { + assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); + this.segmentsList.push(mergeExtraSegments(this, segments)); + } + + /** + * Replaces the head segments with the given segments. + * The current head segments are removed. + * @param {Array} replacementHeadSegments The new head segments. + * @returns {void} + */ + replaceHead(replacementHeadSegments) { + assert( + replacementHeadSegments.length >= this.count, + `${replacementHeadSegments.length} >= ${this.count}` + ); + this.segmentsList.splice(-1, 1, mergeExtraSegments(this, replacementHeadSegments)); + } + + /** + * Adds all segments of a given fork context into this context. + * @param {ForkContext} otherForkContext The fork context to add from. + * @returns {void} + */ + addAll(otherForkContext) { + assert(otherForkContext.count === this.count); + this.segmentsList.push(...otherForkContext.segmentsList); + } + + /** + * Clears all segments in this context. + * @returns {void} + */ + clear() { + this.segmentsList = []; + } + + /** + * Creates a new root context, meaning that there are no parent + * fork contexts. + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @returns {ForkContext} New fork context. + */ + static newRoot(idGenerator) { + const context = new ForkContext(idGenerator, null, 1); + + context.add([CodePathSegment.newRoot(idGenerator.next())]); + + return context; + } + + /** + * Creates an empty fork context preceded by a given context. + * @param {ForkContext} parentContext The parent fork context. + * @param {boolean} shouldForkLeavingPath Indicates that we are inside of + * a `finally` block and should therefore fork the path that leaves + * `finally`. + * @returns {ForkContext} New fork context. + */ + static newEmpty(parentContext, shouldForkLeavingPath) { + return new ForkContext( + parentContext.idGenerator, + parentContext, + (shouldForkLeavingPath ? 2 : 1) * parentContext.count + ); + } +} + +module.exports = ForkContext; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js b/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js new file mode 100644 index 0000000..b580104 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js @@ -0,0 +1,45 @@ +/** + * @fileoverview A class of identifiers generator for code path segments. + * + * Each rule uses the identifier of code path segments to store additional + * information of the code path. + * + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A generator for unique ids. + */ +class IdGenerator { + + /** + * @param {string} prefix Optional. A prefix of generated ids. + */ + constructor(prefix) { + this.prefix = String(prefix); + this.n = 0; + } + + /** + * Generates id. + * @returns {string} A generated id. + */ + next() { + this.n = 1 + this.n | 0; + + /* c8 ignore start */ + if (this.n < 0) { + this.n = 1; + }/* c8 ignore stop */ + + return this.prefix + this.n; + } +} + +module.exports = IdGenerator; diff --git a/node_modules/eslint/lib/linter/file-context.js b/node_modules/eslint/lib/linter/file-context.js new file mode 100644 index 0000000..b669472 --- /dev/null +++ b/node_modules/eslint/lib/linter/file-context.js @@ -0,0 +1,134 @@ +/** + * @fileoverview The FileContext class. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/** + * Represents a file context that the linter can use to lint a file. + */ +class FileContext { + + /** + * The current working directory. + * @type {string} + */ + cwd; + + /** + * The filename of the file being linted. + * @type {string} + */ + filename; + + /** + * The physical filename of the file being linted. + * @type {string} + */ + physicalFilename; + + /** + * The source code of the file being linted. + * @type {SourceCode} + */ + sourceCode; + + /** + * The parser options for the file being linted. + * @type {Record} + * @deprecated Use `languageOptions` instead. + */ + parserOptions; + + /** + * The path to the parser used to parse this file. + * @type {string} + * @deprecated No longer supported. + */ + parserPath; + + /** + * The language options used when parsing this file. + * @type {Record} + */ + languageOptions; + + /** + * The settings for the file being linted. + * @type {Record} + */ + settings; + + /** + * Creates a new instance. + * @param {Object} config The configuration object for the file context. + * @param {string} config.cwd The current working directory. + * @param {string} config.filename The filename of the file being linted. + * @param {string} config.physicalFilename The physical filename of the file being linted. + * @param {SourceCode} config.sourceCode The source code of the file being linted. + * @param {Record} config.parserOptions The parser options for the file being linted. + * @param {string} config.parserPath The path to the parser used to parse this file. + * @param {Record} config.languageOptions The language options used when parsing this file. + * @param {Record} config.settings The settings for the file being linted. + */ + constructor({ + cwd, + filename, + physicalFilename, + sourceCode, + parserOptions, + parserPath, + languageOptions, + settings + }) { + this.cwd = cwd; + this.filename = filename; + this.physicalFilename = physicalFilename; + this.sourceCode = sourceCode; + this.parserOptions = parserOptions; + this.parserPath = parserPath; + this.languageOptions = languageOptions; + this.settings = settings; + + Object.freeze(this); + } + + /** + * Gets the current working directory. + * @returns {string} The current working directory. + * @deprecated Use `cwd` instead. + */ + getCwd() { + return this.cwd; + } + + /** + * Gets the filename of the file being linted. + * @returns {string} The filename of the file being linted. + * @deprecated Use `filename` instead. + */ + getFilename() { + return this.filename; + } + + /** + * Gets the physical filename of the file being linted. + * @returns {string} The physical filename of the file being linted. + * @deprecated Use `physicalFilename` instead. + */ + getPhysicalFilename() { + return this.physicalFilename; + } + + /** + * Gets the source code of the file being linted. + * @returns {SourceCode} The source code of the file being linted. + * @deprecated Use `sourceCode` instead. + */ + getSourceCode() { + return this.sourceCode; + } +} + +exports.FileContext = FileContext; diff --git a/node_modules/eslint/lib/linter/index.js b/node_modules/eslint/lib/linter/index.js new file mode 100644 index 0000000..9e53977 --- /dev/null +++ b/node_modules/eslint/lib/linter/index.js @@ -0,0 +1,11 @@ +"use strict"; + +const { Linter } = require("./linter"); +const SourceCodeFixer = require("./source-code-fixer"); + +module.exports = { + Linter, + + // For testers. + SourceCodeFixer +}; diff --git a/node_modules/eslint/lib/linter/interpolate.js b/node_modules/eslint/lib/linter/interpolate.js new file mode 100644 index 0000000..5f4ff92 --- /dev/null +++ b/node_modules/eslint/lib/linter/interpolate.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Interpolate keys from an object into a string with {{ }} markers. + * @author Jed Fox + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Returns a global expression matching placeholders in messages. + * @returns {RegExp} Global regular expression matching placeholders + */ +function getPlaceholderMatcher() { + return /\{\{([^{}]+?)\}\}/gu; +} + +/** + * Replaces {{ placeholders }} in the message with the provided data. + * Does not replace placeholders not available in the data. + * @param {string} text Original message with potential placeholders + * @param {Record} data Map of placeholder name to its value + * @returns {string} Message with replaced placeholders + */ +function interpolate(text, data) { + if (!data) { + return text; + } + + const matcher = getPlaceholderMatcher(); + + // Substitution content for any {{ }} markers. + return text.replace(matcher, (fullMatch, termWithWhitespace) => { + const term = termWithWhitespace.trim(); + + if (term in data) { + return data[term]; + } + + // Preserve old behavior: If parameter name not provided, don't replace it. + return fullMatch; + }); +} + +module.exports = { + getPlaceholderMatcher, + interpolate +}; diff --git a/node_modules/eslint/lib/linter/linter.js b/node_modules/eslint/lib/linter/linter.js new file mode 100644 index 0000000..6db9c13 --- /dev/null +++ b/node_modules/eslint/lib/linter/linter.js @@ -0,0 +1,2497 @@ +/** + * @fileoverview Main Linter Class + * @author Gyandeep Singh + * @author aladdin-add + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + path = require("node:path"), + eslintScope = require("eslint-scope"), + evk = require("eslint-visitor-keys"), + espree = require("espree"), + merge = require("lodash.merge"), + pkg = require("../../package.json"), + { + Legacy: { + ConfigOps, + ConfigValidator, + environments: BuiltInEnvironments + } + } = require("@eslint/eslintrc/universal"), + Traverser = require("../shared/traverser"), + { SourceCode } = require("../languages/js/source-code"), + applyDisableDirectives = require("./apply-disable-directives"), + { ConfigCommentParser } = require("@eslint/plugin-kit"), + NodeEventGenerator = require("./node-event-generator"), + createReportTranslator = require("./report-translator"), + Rules = require("./rules"), + createEmitter = require("./safe-emitter"), + SourceCodeFixer = require("./source-code-fixer"), + timing = require("./timing"), + ruleReplacements = require("../../conf/replacements.json"); +const { getRuleFromConfig } = require("../config/flat-config-helpers"); +const { FlatConfigArray } = require("../config/flat-config-array"); +const { startTime, endTime } = require("../shared/stats"); +const { RuleValidator } = require("../config/rule-validator"); +const { assertIsRuleSeverity } = require("../config/flat-config-schema"); +const { normalizeSeverityToString, normalizeSeverityToNumber } = require("../shared/severity"); +const { deepMergeArrays } = require("../shared/deep-merge-arrays"); +const jslang = require("../languages/js"); +const { activeFlags, inactiveFlags, getInactivityReasonMessage } = require("../shared/flags"); +const debug = require("debug")("eslint:linter"); +const MAX_AUTOFIX_PASSES = 10; +const DEFAULT_PARSER_NAME = "espree"; +const DEFAULT_ECMA_VERSION = 5; +const commentParser = new ConfigCommentParser(); +const DEFAULT_ERROR_LOC = { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } }; +const parserSymbol = Symbol.for("eslint.RuleTester.parser"); +const { LATEST_ECMA_VERSION } = require("../../conf/ecma-version"); +const { VFile } = require("./vfile"); +const { ParserService } = require("../services/parser-service"); +const { FileContext } = require("./file-context"); +const { ProcessorService } = require("../services/processor-service"); +const { containsDifferentProperty } = require("../shared/option-utils"); +const STEP_KIND_VISIT = 1; +const STEP_KIND_CALL = 2; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").Environment} Environment */ +/** @typedef {import("../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */ +/** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").LanguageOptions} LanguageOptions */ +/** @typedef {import("../shared/types").Processor} Processor */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {import("../shared/types").Times} Times */ +/** @typedef {import("@eslint/core").Language} Language */ +/** @typedef {import("@eslint/core").RuleSeverity} RuleSeverity */ +/** @typedef {import("@eslint/core").RuleConfig} RuleConfig */ +/** @typedef {import("../types").Linter.StringSeverity} StringSeverity */ + + +/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ +/** + * @template T + * @typedef {{ [P in keyof T]-?: T[P] }} Required + */ +/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ + +/** + * @typedef {Object} DisableDirective + * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type Type of directive + * @property {number} line The line number + * @property {number} column The column number + * @property {(string|null)} ruleId The rule ID + * @property {string} justification The justification of directive + */ + +/** + * The private data for `Linter` instance. + * @typedef {Object} LinterInternalSlots + * @property {ConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used. + * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used. + * @property {SuppressedLintMessage[]} lastSuppressedMessages The `SuppressedLintMessage[]` instance that the last `verify()` call produced. + * @property {Map} parserMap The loaded parsers. + * @property {Times} times The times spent on applying a rule to a file (see `stats` option). + * @property {Rules} ruleMap The loaded rules. + */ + +/** + * @typedef {Object} VerifyOptions + * @property {boolean} [allowInlineConfig] Allow/disallow inline comments' ability + * to change config once it is set. Defaults to true if not supplied. + * Useful if you want to validate JS without comments overriding rules. + * @property {boolean} [disableFixes] if `true` then the linter doesn't make `fix` + * properties into the lint result. + * @property {string} [filename] the filename of the source code. + * @property {boolean | "off" | "warn" | "error"} [reportUnusedDisableDirectives] Adds reported errors for + * unused `eslint-disable` directives. + * @property {Function} [ruleFilter] A predicate function that determines whether a given rule should run. + */ + +/** + * @typedef {Object} ProcessorOptions + * @property {(filename:string, text:string) => boolean} [filterCodeBlock] the + * predicate function that selects adopt code blocks. + * @property {Processor.postprocess} [postprocess] postprocessor for report + * messages. If provided, this should accept an array of the message lists + * for each code block returned from the preprocessor, apply a mapping to + * the messages as appropriate, and return a one-dimensional array of + * messages. + * @property {Processor.preprocess} [preprocess] preprocessor for source text. + * If provided, this should accept a string of source text, and return an + * array of code blocks to lint. + */ + +/** + * @typedef {Object} FixOptions + * @property {boolean | ((message: LintMessage) => boolean)} [fix] Determines + * whether fixes should be applied. + */ + +/** + * @typedef {Object} InternalOptions + * @property {string | null} warnInlineConfig The config name what `noInlineConfig` setting came from. If `noInlineConfig` setting didn't exist, this is null. If this is a config name, then the linter warns directive comments. + * @property {StringSeverity} reportUnusedDisableDirectives Severity to report unused disable directives, if not "off" (boolean values were normalized). + * @property {StringSeverity} reportUnusedInlineConfigs Severity to report unused inline configs, if not "off". + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if a given object is Espree. + * @param {Object} parser The parser to check. + * @returns {boolean} True if the parser is Espree or false if not. + */ +function isEspree(parser) { + return !!(parser === espree || parser[parserSymbol] === espree); +} + +/** + * Ensures that variables representing built-in properties of the Global Object, + * and any globals declared by special block comments, are present in the global + * scope. + * @param {Scope} globalScope The global scope. + * @param {Object} configGlobals The globals declared in configuration + * @param {{exportedVariables: Object, enabledGlobals: Object}} commentDirectives Directives from comment configuration + * @returns {void} + */ +function addDeclaredGlobals(globalScope, configGlobals, { exportedVariables, enabledGlobals }) { + + // Define configured global variables. + for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(enabledGlobals)])) { + + /* + * `ConfigOps.normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would + * typically be caught when validating a config anyway (validity for inline global comments is checked separately). + */ + const configValue = configGlobals[id] === void 0 ? void 0 : ConfigOps.normalizeConfigGlobal(configGlobals[id]); + const commentValue = enabledGlobals[id] && enabledGlobals[id].value; + const value = commentValue || configValue; + const sourceComments = enabledGlobals[id] && enabledGlobals[id].comments; + + if (value === "off") { + continue; + } + + let variable = globalScope.set.get(id); + + if (!variable) { + variable = new eslintScope.Variable(id, globalScope); + + globalScope.variables.push(variable); + globalScope.set.set(id, variable); + } + + variable.eslintImplicitGlobalSetting = configValue; + variable.eslintExplicitGlobal = sourceComments !== void 0; + variable.eslintExplicitGlobalComments = sourceComments; + variable.writeable = (value === "writable"); + } + + // mark all exported variables as such + Object.keys(exportedVariables).forEach(name => { + const variable = globalScope.set.get(name); + + if (variable) { + variable.eslintUsed = true; + variable.eslintExported = true; + } + }); + + /* + * "through" contains all references which definitions cannot be found. + * Since we augment the global scope using configuration, we need to update + * references and remove the ones that were added by configuration. + */ + globalScope.through = globalScope.through.filter(reference => { + const name = reference.identifier.name; + const variable = globalScope.set.get(name); + + if (variable) { + + /* + * Links the variable and the reference. + * And this reference is removed from `Scope#through`. + */ + reference.resolved = variable; + variable.references.push(reference); + + return false; + } + + return true; + }); +} + +/** + * creates a missing-rule message. + * @param {string} ruleId the ruleId to create + * @returns {string} created error message + * @private + */ +function createMissingRuleMessage(ruleId) { + return Object.hasOwn(ruleReplacements.rules, ruleId) + ? `Rule '${ruleId}' was removed and replaced by: ${ruleReplacements.rules[ruleId].join(", ")}` + : `Definition for rule '${ruleId}' was not found.`; +} + +/** + * Updates a given location based on the language offsets. This allows us to + * change 0-based locations to 1-based locations. We always want ESLint + * reporting lines and columns starting from 1. + * @param {Object} location The location to update. + * @param {number} location.line The starting line number. + * @param {number} location.column The starting column number. + * @param {number} [location.endLine] The ending line number. + * @param {number} [location.endColumn] The ending column number. + * @param {Language} language The language to use to adjust the location information. + * @returns {Object} The updated location. + */ +function updateLocationInformation({ line, column, endLine, endColumn }, language) { + + const columnOffset = language.columnStart === 1 ? 0 : 1; + const lineOffset = language.lineStart === 1 ? 0 : 1; + + // calculate separately to account for undefined + const finalEndLine = endLine === void 0 ? endLine : endLine + lineOffset; + const finalEndColumn = endColumn === void 0 ? endColumn : endColumn + columnOffset; + + return { + line: line + lineOffset, + column: column + columnOffset, + endLine: finalEndLine, + endColumn: finalEndColumn + }; +} + +/** + * creates a linting problem + * @param {Object} options to create linting error + * @param {string} [options.ruleId] the ruleId to report + * @param {Object} [options.loc] the loc to report + * @param {string} [options.message] the error message to report + * @param {RuleSeverity} [options.severity] the error message to report + * @param {Language} [options.language] the language to use to adjust the location information + * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId. + * @private + */ +function createLintingProblem(options) { + const { + ruleId = null, + loc = DEFAULT_ERROR_LOC, + message = createMissingRuleMessage(options.ruleId), + severity = 2, + + // fallback for eslintrc mode + language = { + columnStart: 0, + lineStart: 1 + } + } = options; + + return { + ruleId, + message, + ...updateLocationInformation({ + line: loc.start.line, + column: loc.start.column, + endLine: loc.end.line, + endColumn: loc.end.column + }, language), + severity, + nodeType: null + }; +} + +/** + * Wraps the value in an Array if it isn't already one. + * @template T + * @param {T|T[]} value Value to be wrapped. + * @returns {Array} The value as an array. + */ +function asArray(value) { + return Array.isArray(value) ? value : [value]; +} + +/** + * Pushes a problem to inlineConfigProblems if ruleOptions are redundant. + * @param {ConfigData} config Provided config. + * @param {Object} loc A line/column location + * @param {Array} problems Problems that may be added to. + * @param {string} ruleId The rule ID. + * @param {Array} ruleOptions The rule options, merged with the config's. + * @param {Array} ruleOptionsInline The rule options from the comment. + * @param {"error"|"warn"} severity The severity to report. + * @returns {void} + */ +function addProblemIfSameSeverityAndOptions(config, loc, problems, ruleId, ruleOptions, ruleOptionsInline, severity) { + const existingConfigRaw = config.rules?.[ruleId]; + const existingConfig = existingConfigRaw ? asArray(existingConfigRaw) : ["off"]; + const existingSeverity = normalizeSeverityToString(existingConfig[0]); + const inlineSeverity = normalizeSeverityToString(ruleOptions[0]); + const sameSeverity = existingSeverity === inlineSeverity; + + if (!sameSeverity) { + return; + } + + const alreadyConfigured = existingConfigRaw + ? `is already configured to '${existingSeverity}'` + : "is not enabled so can't be turned off"; + let message; + + if ((existingConfig.length === 1 && ruleOptions.length === 1) || existingSeverity === "off") { + message = `Unused inline config ('${ruleId}' ${alreadyConfigured}).`; + } else if (!containsDifferentProperty(ruleOptions.slice(1), existingConfig.slice(1))) { + message = ruleOptionsInline.length === 1 + ? `Unused inline config ('${ruleId}' ${alreadyConfigured}).` + : `Unused inline config ('${ruleId}' ${alreadyConfigured} with the same options).`; + } + + if (message) { + problems.push(createLintingProblem({ + ruleId: null, + message, + loc, + language: config.language, + severity: normalizeSeverityToNumber(severity) + })); + } +} + +/** + * Creates a collection of disable directives from a comment + * @param {Object} options to create disable directives + * @param {("disable"|"enable"|"disable-line"|"disable-next-line")} options.type The type of directive comment + * @param {string} options.value The value after the directive in the comment + * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`) + * @param {string} options.justification The justification of the directive + * @param {ASTNode|token} options.node The Comment node/token. + * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules + * @param {Language} language The language to use to adjust the location information. + * @param {SourceCode} sourceCode The SourceCode object to get comments from. + * @returns {Object} Directives and problems from the comment + */ +function createDisableDirectives({ type, value, justification, node }, ruleMapper, language, sourceCode) { + const ruleIds = Object.keys(commentParser.parseListConfig(value)); + const directiveRules = ruleIds.length ? ruleIds : [null]; + const result = { + directives: [], // valid disable directives + directiveProblems: [] // problems in directives + }; + const parentDirective = { node, value, ruleIds }; + + for (const ruleId of directiveRules) { + + const loc = sourceCode.getLoc(node); + + // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/) + if (ruleId === null || !!ruleMapper(ruleId)) { + + + if (type === "disable-next-line") { + const { line, column } = updateLocationInformation( + loc.end, + language + ); + + result.directives.push({ + parentDirective, + type, + line, + column, + ruleId, + justification + }); + } else { + const { line, column } = updateLocationInformation( + loc.start, + language + ); + + result.directives.push({ + parentDirective, + type, + line, + column, + ruleId, + justification + }); + } + } else { + result.directiveProblems.push(createLintingProblem({ ruleId, loc, language })); + } + } + return result; +} + +/** + * Parses comments in file to extract file-specific config of rules, globals + * and environments and merges them with global config; also code blocks + * where reporting is disabled or enabled and merges them with reporting config. + * @param {SourceCode} sourceCode The SourceCode object to get comments from. + * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules + * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from. + * @param {ConfigData} config Provided config. + * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: LintMessage[], disableDirectives: DisableDirective[]}} + * A collection of the directive comments that were found, along with any problems that occurred when parsing + */ +function getDirectiveComments(sourceCode, ruleMapper, warnInlineConfig, config) { + const configuredRules = {}; + const enabledGlobals = Object.create(null); + const exportedVariables = {}; + const problems = []; + const disableDirectives = []; + const validator = new ConfigValidator({ + builtInRules: Rules + }); + + sourceCode.getInlineConfigNodes().filter(token => token.type !== "Shebang").forEach(comment => { + + const directive = commentParser.parseDirective(comment.value); + + if (!directive) { + return; + } + + const { + label, + value, + justification: justificationPart + } = directive; + + const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(label); + + if (comment.type === "Line" && !lineCommentSupported) { + return; + } + + const loc = sourceCode.getLoc(comment); + + if (warnInlineConfig) { + const kind = comment.type === "Block" ? `/*${label}*/` : `//${label}`; + + problems.push(createLintingProblem({ + ruleId: null, + message: `'${kind}' has no effect because you have 'noInlineConfig' setting in ${warnInlineConfig}.`, + loc, + severity: 1 + })); + return; + } + + if (label === "eslint-disable-line" && loc.start.line !== loc.end.line) { + const message = `${label} comment should not span multiple lines.`; + + problems.push(createLintingProblem({ + ruleId: null, + message, + loc + })); + return; + } + + switch (label) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = label.slice("eslint-".length); + const { directives, directiveProblems } = createDisableDirectives({ + type: directiveType, + value, + justification: justificationPart, + node: comment + }, ruleMapper, jslang, sourceCode); + + disableDirectives.push(...directives); + problems.push(...directiveProblems); + break; + } + + case "exported": + Object.assign(exportedVariables, commentParser.parseListConfig(value)); + break; + + case "globals": + case "global": + for (const [id, idSetting] of Object.entries(commentParser.parseStringConfig(value))) { + let normalizedValue; + + try { + normalizedValue = ConfigOps.normalizeConfigGlobal(idSetting); + } catch (err) { + problems.push(createLintingProblem({ + ruleId: null, + loc, + message: err.message + })); + continue; + } + + if (enabledGlobals[id]) { + enabledGlobals[id].comments.push(comment); + enabledGlobals[id].value = normalizedValue; + } else { + enabledGlobals[id] = { + comments: [comment], + value: normalizedValue + }; + } + } + break; + + case "eslint": { + const parseResult = commentParser.parseJSONLikeConfig(value); + + if (parseResult.ok) { + Object.keys(parseResult.config).forEach(name => { + const rule = ruleMapper(name); + const ruleValue = parseResult.config[name]; + + if (!rule) { + problems.push(createLintingProblem({ ruleId: name, loc })); + return; + } + + if (Object.hasOwn(configuredRules, name)) { + problems.push(createLintingProblem({ + message: `Rule "${name}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`, + loc + })); + return; + } + + let ruleOptions = asArray(ruleValue); + + /* + * If the rule was already configured, inline rule configuration that + * only has severity should retain options from the config and just override the severity. + * + * Example: + * + * { + * rules: { + * curly: ["error", "multi"] + * } + * } + * + * /* eslint curly: ["warn"] * / + * + * Results in: + * + * curly: ["warn", "multi"] + */ + if ( + + /* + * If inline config for the rule has only severity + */ + ruleOptions.length === 1 && + + /* + * And the rule was already configured + */ + config.rules && Object.hasOwn(config.rules, name) + ) { + + /* + * Then use severity from the inline config and options from the provided config + */ + ruleOptions = [ + ruleOptions[0], // severity from the inline config + ...asArray(config.rules[name]).slice(1) // options from the provided config + ]; + } + + try { + validator.validateRuleOptions(rule, name, ruleOptions); + } catch (err) { + + /* + * If the rule has invalid `meta.schema`, throw the error because + * this is not an invalid inline configuration but an invalid rule. + */ + if (err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA") { + throw err; + } + + problems.push(createLintingProblem({ + ruleId: name, + message: err.message, + loc + })); + + // do not apply the config, if found invalid options. + return; + } + + configuredRules[name] = ruleOptions; + }); + } else { + const problem = createLintingProblem({ + ruleId: null, + loc, + message: parseResult.error.message + }); + + problem.fatal = true; + problems.push(problem); + } + + break; + } + + // no default + } + }); + + return { + configuredRules, + enabledGlobals, + exportedVariables, + problems, + disableDirectives + }; +} + +/** + * Parses comments in file to extract disable directives. + * @param {SourceCode} sourceCode The SourceCode object to get comments from. + * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules + * @param {Language} language The language to use to adjust the location information + * @returns {{problems: LintMessage[], disableDirectives: DisableDirective[]}} + * A collection of the directive comments that were found, along with any problems that occurred when parsing + */ +function getDirectiveCommentsForFlatConfig(sourceCode, ruleMapper, language) { + const disableDirectives = []; + const problems = []; + + if (sourceCode.getDisableDirectives) { + const { + directives: directivesSources, + problems: directivesProblems + } = sourceCode.getDisableDirectives(); + + problems.push(...directivesProblems.map(directiveProblem => createLintingProblem({ + ...directiveProblem, + language + }))); + + directivesSources.forEach(directive => { + const { directives, directiveProblems } = createDisableDirectives(directive, ruleMapper, language, sourceCode); + + disableDirectives.push(...directives); + problems.push(...directiveProblems); + }); + } + + return { + problems, + disableDirectives + }; +} + +/** + * Normalize ECMAScript version from the initial config + * @param {Parser} parser The parser which uses this options. + * @param {number} ecmaVersion ECMAScript version from the initial config + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(parser, ecmaVersion) { + + if (isEspree(parser)) { + if (ecmaVersion === "latest") { + return espree.latestEcmaVersion; + } + } + + /* + * Calculate ECMAScript edition number from official year version starting with + * ES2015, which corresponds with ES6 (or a difference of 2009). + */ + return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion; +} + +/** + * Normalize ECMAScript version from the initial config into languageOptions (year) + * format. + * @param {any} [ecmaVersion] ECMAScript version from the initial config + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersionForLanguageOptions(ecmaVersion) { + + switch (ecmaVersion) { + case 3: + return 3; + + // void 0 = no ecmaVersion specified so use the default + case 5: + case void 0: + return 5; + + default: + if (typeof ecmaVersion === "number") { + return ecmaVersion >= 2015 ? ecmaVersion : ecmaVersion + 2009; + } + } + + /* + * We default to the latest supported ecmaVersion for everything else. + * Remember, this is for languageOptions.ecmaVersion, which sets the version + * that is used for a number of processes inside of ESLint. It's normally + * safe to assume people want the latest unless otherwise specified. + */ + return LATEST_ECMA_VERSION; +} + +const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)(?:\*\/|$)/gsu; + +/** + * Checks whether or not there is a comment which has "eslint-env *" in a given text. + * @param {string} text A source code text to check. + * @returns {Object|null} A result of parseListConfig() with "eslint-env *" comment. + */ +function findEslintEnv(text) { + let match, retv; + + eslintEnvPattern.lastIndex = 0; + + while ((match = eslintEnvPattern.exec(text)) !== null) { + if (match[0].endsWith("*/")) { + retv = Object.assign( + retv || {}, + commentParser.parseListConfig(commentParser.parseDirective(match[0].slice(2, -2)).value) + ); + } + } + + return retv; +} + +/** + * Convert "/path/to/" to "". + * `CLIEngine#executeOnText()` method gives "/path/to/" if the filename + * was omitted because `configArray.extractConfig()` requires an absolute path. + * But the linter should pass `` to `RuleContext#filename` in that + * case. + * Also, code blocks can have their virtual filename. If the parent filename was + * ``, the virtual filename is `/0_foo.js` or something like (i.e., + * it's not an absolute path). + * @param {string} filename The filename to normalize. + * @returns {string} The normalized filename. + */ +function normalizeFilename(filename) { + const parts = filename.split(path.sep); + const index = parts.lastIndexOf(""); + + return index === -1 ? filename : parts.slice(index).join(path.sep); +} + +/** + * Normalizes the possible options for `linter.verify` and `linter.verifyAndFix` to a + * consistent shape. + * @param {VerifyOptions} providedOptions Options + * @param {ConfigData} config Config. + * @returns {Required & InternalOptions} Normalized options + */ +function normalizeVerifyOptions(providedOptions, config) { + + const linterOptions = config.linterOptions || config; + + // .noInlineConfig for eslintrc, .linterOptions.noInlineConfig for flat + const disableInlineConfig = linterOptions.noInlineConfig === true; + const ignoreInlineConfig = providedOptions.allowInlineConfig === false; + const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig + ? ` (${config.configNameOfNoInlineConfig})` + : ""; + + let reportUnusedDisableDirectives = providedOptions.reportUnusedDisableDirectives; + + if (typeof reportUnusedDisableDirectives === "boolean") { + reportUnusedDisableDirectives = reportUnusedDisableDirectives ? "error" : "off"; + } + if (typeof reportUnusedDisableDirectives !== "string") { + if (typeof linterOptions.reportUnusedDisableDirectives === "boolean") { + reportUnusedDisableDirectives = linterOptions.reportUnusedDisableDirectives ? "warn" : "off"; + } else { + reportUnusedDisableDirectives = linterOptions.reportUnusedDisableDirectives === void 0 ? "off" : normalizeSeverityToString(linterOptions.reportUnusedDisableDirectives); + } + } + + const reportUnusedInlineConfigs = linterOptions.reportUnusedInlineConfigs === void 0 ? "off" : normalizeSeverityToString(linterOptions.reportUnusedInlineConfigs); + + let ruleFilter = providedOptions.ruleFilter; + + if (typeof ruleFilter !== "function") { + ruleFilter = () => true; + } + + return { + filename: normalizeFilename(providedOptions.filename || ""), + allowInlineConfig: !ignoreInlineConfig, + warnInlineConfig: disableInlineConfig && !ignoreInlineConfig + ? `your config${configNameOfNoInlineConfig}` + : null, + reportUnusedDisableDirectives, + reportUnusedInlineConfigs, + disableFixes: Boolean(providedOptions.disableFixes), + stats: providedOptions.stats, + ruleFilter + }; +} + +/** + * Combines the provided parserOptions with the options from environments + * @param {Parser} parser The parser which uses this options. + * @param {ParserOptions} providedOptions The provided 'parserOptions' key in a config + * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments + * @returns {ParserOptions} Resulting parser options after merge + */ +function resolveParserOptions(parser, providedOptions, enabledEnvironments) { + + const parserOptionsFromEnv = enabledEnvironments + .filter(env => env.parserOptions) + .reduce((parserOptions, env) => merge(parserOptions, env.parserOptions), {}); + const mergedParserOptions = merge(parserOptionsFromEnv, providedOptions || {}); + const isModule = mergedParserOptions.sourceType === "module"; + + if (isModule) { + + /* + * can't have global return inside of modules + * TODO: espree validate parserOptions.globalReturn when sourceType is setting to module.(@aladdin-add) + */ + mergedParserOptions.ecmaFeatures = Object.assign({}, mergedParserOptions.ecmaFeatures, { globalReturn: false }); + } + + mergedParserOptions.ecmaVersion = normalizeEcmaVersion(parser, mergedParserOptions.ecmaVersion); + + return mergedParserOptions; +} + +/** + * Converts parserOptions to languageOptions for backwards compatibility with eslintrc. + * @param {ConfigData} config Config object. + * @param {Object} config.globals Global variable definitions. + * @param {Parser} config.parser The parser to use. + * @param {ParserOptions} config.parserOptions The parserOptions to use. + * @returns {LanguageOptions} The languageOptions equivalent. + */ +function createLanguageOptions({ globals: configuredGlobals, parser, parserOptions }) { + + const { + ecmaVersion, + sourceType + } = parserOptions; + + return { + globals: configuredGlobals, + ecmaVersion: normalizeEcmaVersionForLanguageOptions(ecmaVersion), + sourceType, + parser, + parserOptions + }; +} + +/** + * Combines the provided globals object with the globals from environments + * @param {Record} providedGlobals The 'globals' key in a config + * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments + * @returns {Record} The resolved globals object + */ +function resolveGlobals(providedGlobals, enabledEnvironments) { + return Object.assign( + Object.create(null), + ...enabledEnvironments.filter(env => env.globals).map(env => env.globals), + providedGlobals + ); +} + +/** + * Store time measurements in map + * @param {number} time Time measurement + * @param {Object} timeOpts Options relating which time was measured + * @param {WeakMap} slots Linter internal slots map + * @returns {void} + */ +function storeTime(time, timeOpts, slots) { + const { type, key } = timeOpts; + + if (!slots.times) { + slots.times = { passes: [{}] }; + } + + const passIndex = slots.fixPasses; + + if (passIndex > slots.times.passes.length - 1) { + slots.times.passes.push({}); + } + + if (key) { + slots.times.passes[passIndex][type] ??= {}; + slots.times.passes[passIndex][type][key] ??= { total: 0 }; + slots.times.passes[passIndex][type][key].total += time; + } else { + slots.times.passes[passIndex][type] ??= { total: 0 }; + slots.times.passes[passIndex][type].total += time; + } +} + +/** + * Get the options for a rule (not including severity), if any + * @param {RuleConfig} ruleConfig rule configuration + * @param {Object|undefined} defaultOptions rule.meta.defaultOptions + * @returns {Array} of rule options, empty Array if none + */ +function getRuleOptions(ruleConfig, defaultOptions) { + if (Array.isArray(ruleConfig)) { + return deepMergeArrays(defaultOptions, ruleConfig.slice(1)); + } + return defaultOptions ?? []; +} + +/** + * Analyze scope of the given AST. + * @param {ASTNode} ast The `Program` node to analyze. + * @param {LanguageOptions} languageOptions The parser options. + * @param {Record} visitorKeys The visitor keys. + * @returns {ScopeManager} The analysis result. + */ +function analyzeScope(ast, languageOptions, visitorKeys) { + const parserOptions = languageOptions.parserOptions; + const ecmaFeatures = parserOptions.ecmaFeatures || {}; + const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION; + + return eslintScope.analyze(ast, { + ignoreEval: true, + nodejsScope: ecmaFeatures.globalReturn, + impliedStrict: ecmaFeatures.impliedStrict, + ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6, + sourceType: languageOptions.sourceType || "script", + childVisitorKeys: visitorKeys || evk.KEYS, + fallback: Traverser.getKeys + }); +} + +/** + * Runs a rule, and gets its listeners + * @param {Rule} rule A rule object + * @param {Context} ruleContext The context that should be passed to the rule + * @throws {TypeError} If `rule` is not an object with a `create` method + * @throws {any} Any error during the rule's `create` + * @returns {Object} A map of selector listeners provided by the rule + */ +function createRuleListeners(rule, ruleContext) { + + if (!rule || typeof rule !== "object" || typeof rule.create !== "function") { + throw new TypeError(`Error while loading rule '${ruleContext.id}': Rule must be an object with a \`create\` method`); + } + + try { + return rule.create(ruleContext); + } catch (ex) { + ex.message = `Error while loading rule '${ruleContext.id}': ${ex.message}`; + throw ex; + } +} + +/** + * Runs the given rules on the given SourceCode object + * @param {SourceCode} sourceCode A SourceCode object for the given text + * @param {Object} configuredRules The rules configuration + * @param {function(string): Rule} ruleMapper A mapper function from rule names to rules + * @param {string | undefined} parserName The name of the parser in the config + * @param {Language} language The language object used for parsing. + * @param {LanguageOptions} languageOptions The options for parsing the code. + * @param {Object} settings The settings that were enabled in the config + * @param {string} filename The reported filename of the code + * @param {boolean} applyDefaultOptions If true, apply rules' meta.defaultOptions in computing their config options. + * @param {boolean} disableFixes If true, it doesn't make `fix` properties. + * @param {string | undefined} cwd cwd of the cli + * @param {string} physicalFilename The full path of the file on disk without any code block information + * @param {Function} ruleFilter A predicate function to filter which rules should be executed. + * @param {boolean} stats If true, stats are collected appended to the result + * @param {WeakMap} slots InternalSlotsMap of linter + * @returns {LintMessage[]} An array of reported problems + * @throws {Error} If traversal into a node fails. + */ +function runRules( + sourceCode, + configuredRules, + ruleMapper, + parserName, + language, + languageOptions, + settings, + filename, + applyDefaultOptions, + disableFixes, + cwd, + physicalFilename, + ruleFilter, + stats, + slots +) { + const emitter = createEmitter(); + + // must happen first to assign all node.parent properties + const eventQueue = sourceCode.traverse(); + + /* + * Create a frozen object with the ruleContext properties and methods that are shared by all rules. + * All rule contexts will inherit from this object. This avoids the performance penalty of copying all the + * properties once for each rule. + */ + const sharedTraversalContext = new FileContext({ + cwd, + filename, + physicalFilename: physicalFilename || filename, + sourceCode, + parserOptions: { + ...languageOptions.parserOptions + }, + parserPath: parserName, + languageOptions, + settings + }); + + const lintingProblems = []; + + Object.keys(configuredRules).forEach(ruleId => { + const severity = ConfigOps.getRuleSeverity(configuredRules[ruleId]); + + // not load disabled rules + if (severity === 0) { + return; + } + + if (ruleFilter && !ruleFilter({ ruleId, severity })) { + return; + } + + const rule = ruleMapper(ruleId); + + if (!rule) { + lintingProblems.push(createLintingProblem({ ruleId, language })); + return; + } + + const messageIds = rule.meta && rule.meta.messages; + let reportTranslator = null; + const ruleContext = Object.freeze( + Object.assign( + Object.create(sharedTraversalContext), + { + id: ruleId, + options: getRuleOptions(configuredRules[ruleId], applyDefaultOptions ? rule.meta?.defaultOptions : void 0), + report(...args) { + + /* + * Create a report translator lazily. + * In a vast majority of cases, any given rule reports zero errors on a given + * piece of code. Creating a translator lazily avoids the performance cost of + * creating a new translator function for each rule that usually doesn't get + * called. + * + * Using lazy report translators improves end-to-end performance by about 3% + * with Node 8.4.0. + */ + if (reportTranslator === null) { + reportTranslator = createReportTranslator({ + ruleId, + severity, + sourceCode, + messageIds, + disableFixes, + language + }); + } + const problem = reportTranslator(...args); + + if (problem.fix && !(rule.meta && rule.meta.fixable)) { + throw new Error("Fixable rules must set the `meta.fixable` property to \"code\" or \"whitespace\"."); + } + if (problem.suggestions && !(rule.meta && rule.meta.hasSuggestions === true)) { + if (rule.meta && rule.meta.docs && typeof rule.meta.docs.suggestion !== "undefined") { + + // Encourage migration from the former property name. + throw new Error("Rules with suggestions must set the `meta.hasSuggestions` property to `true`. `meta.docs.suggestion` is ignored by ESLint."); + } + throw new Error("Rules with suggestions must set the `meta.hasSuggestions` property to `true`."); + } + lintingProblems.push(problem); + } + } + ) + ); + + const ruleListenersReturn = (timing.enabled || stats) + ? timing.time(ruleId, createRuleListeners, stats)(rule, ruleContext) : createRuleListeners(rule, ruleContext); + + const ruleListeners = stats ? ruleListenersReturn.result : ruleListenersReturn; + + if (stats) { + storeTime(ruleListenersReturn.tdiff, { type: "rules", key: ruleId }, slots); + } + + /** + * Include `ruleId` in error logs + * @param {Function} ruleListener A rule method that listens for a node. + * @returns {Function} ruleListener wrapped in error handler + */ + function addRuleErrorHandler(ruleListener) { + return function ruleErrorHandler(...listenerArgs) { + try { + const ruleListenerReturn = ruleListener(...listenerArgs); + + const ruleListenerResult = stats ? ruleListenerReturn.result : ruleListenerReturn; + + if (stats) { + storeTime(ruleListenerReturn.tdiff, { type: "rules", key: ruleId }, slots); + } + + return ruleListenerResult; + } catch (e) { + e.ruleId = ruleId; + throw e; + } + }; + } + + if (typeof ruleListeners === "undefined" || ruleListeners === null) { + throw new Error(`The create() function for rule '${ruleId}' did not return an object.`); + } + + // add all the selectors from the rule as listeners + Object.keys(ruleListeners).forEach(selector => { + const ruleListener = (timing.enabled || stats) + ? timing.time(ruleId, ruleListeners[selector], stats) : ruleListeners[selector]; + + emitter.on( + selector, + addRuleErrorHandler(ruleListener) + ); + }); + }); + + const eventGenerator = new NodeEventGenerator(emitter, { + visitorKeys: sourceCode.visitorKeys ?? language.visitorKeys, + fallback: Traverser.getKeys, + matchClass: language.matchesSelectorClass ?? (() => false), + nodeTypeKey: language.nodeTypeKey + }); + + for (const step of eventQueue) { + switch (step.kind) { + case STEP_KIND_VISIT: { + try { + if (step.phase === 1) { + eventGenerator.enterNode(step.target); + } else { + eventGenerator.leaveNode(step.target); + } + } catch (err) { + err.currentNode = step.target; + throw err; + } + break; + } + + case STEP_KIND_CALL: { + emitter.emit(step.target, ...step.args); + break; + } + + default: + throw new Error(`Invalid traversal step found: "${step.type}".`); + } + + } + + return lintingProblems; +} + +/** + * Ensure the source code to be a string. + * @param {string|SourceCode} textOrSourceCode The text or source code object. + * @returns {string} The source code text. + */ +function ensureText(textOrSourceCode) { + if (typeof textOrSourceCode === "object") { + const { hasBOM, text } = textOrSourceCode; + const bom = hasBOM ? "\uFEFF" : ""; + + return bom + text; + } + + return String(textOrSourceCode); +} + +/** + * Get an environment. + * @param {LinterInternalSlots} slots The internal slots of Linter. + * @param {string} envId The environment ID to get. + * @returns {Environment|null} The environment. + */ +function getEnv(slots, envId) { + return ( + (slots.lastConfigArray && slots.lastConfigArray.pluginEnvironments.get(envId)) || + BuiltInEnvironments.get(envId) || + null + ); +} + +/** + * Get a rule. + * @param {LinterInternalSlots} slots The internal slots of Linter. + * @param {string} ruleId The rule ID to get. + * @returns {Rule|null} The rule. + */ +function getRule(slots, ruleId) { + return ( + (slots.lastConfigArray && slots.lastConfigArray.pluginRules.get(ruleId)) || + slots.ruleMap.get(ruleId) + ); +} + +/** + * Normalize the value of the cwd + * @param {string | undefined} cwd raw value of the cwd, path to a directory that should be considered as the current working directory, can be undefined. + * @returns {string | undefined} normalized cwd + */ +function normalizeCwd(cwd) { + if (cwd) { + return cwd; + } + if (typeof process === "object") { + return process.cwd(); + } + + // It's more explicit to assign the undefined + // eslint-disable-next-line no-undefined -- Consistently returning a value + return undefined; +} + +/** + * The map to store private data. + * @type {WeakMap} + */ +const internalSlotsMap = new WeakMap(); + +/** + * Throws an error when the given linter is in flat config mode. + * @param {Linter} linter The linter to check. + * @returns {void} + * @throws {Error} If the linter is in flat config mode. + */ +function assertEslintrcConfig(linter) { + const { configType } = internalSlotsMap.get(linter); + + if (configType === "flat") { + throw new Error("This method cannot be used with flat config. Add your entries directly into the config array."); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object that is responsible for verifying JavaScript text + * @name Linter + */ +class Linter { + + /** + * Initialize the Linter. + * @param {Object} [config] the config object + * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. + * @param {Array} [config.flags] the feature flags to enable. + * @param {"flat"|"eslintrc"} [config.configType="flat"] the type of config used. + */ + constructor({ cwd, configType = "flat", flags = [] } = {}) { + + const processedFlags = []; + + flags.forEach(flag => { + if (inactiveFlags.has(flag)) { + const inactiveFlagData = inactiveFlags.get(flag); + const inactivityReason = getInactivityReasonMessage(inactiveFlagData); + + if (typeof inactiveFlagData.replacedBy === "undefined") { + throw new Error(`The flag '${flag}' is inactive: ${inactivityReason}`); + } + + // if there's a replacement, enable it instead of original + if (typeof inactiveFlagData.replacedBy === "string") { + processedFlags.push(inactiveFlagData.replacedBy); + } + + globalThis.process?.emitWarning?.( + `The flag '${flag}' is inactive: ${inactivityReason}`, + `ESLintInactiveFlag_${flag}` + ); + + return; + } + + if (!activeFlags.has(flag)) { + throw new Error(`Unknown flag '${flag}'.`); + } + + processedFlags.push(flag); + }); + + internalSlotsMap.set(this, { + cwd: normalizeCwd(cwd), + flags: processedFlags, + lastConfigArray: null, + lastSourceCode: null, + lastSuppressedMessages: [], + configType, // TODO: Remove after flat config conversion + parserMap: new Map([["espree", espree]]), + ruleMap: new Rules() + }); + + this.version = pkg.version; + } + + /** + * Getter for package version. + * @static + * @returns {string} The version from package.json. + */ + static get version() { + return pkg.version; + } + + /** + * Indicates if the given feature flag is enabled for this instance. + * @param {string} flag The feature flag to check. + * @returns {boolean} `true` if the feature flag is enabled, `false` if not. + */ + hasFlag(flag) { + return internalSlotsMap.get(this).flags.includes(flag); + } + + /** + * Lint using eslintrc and without processors. + * @param {VFile} file The file to lint. + * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything. + * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. + * @throws {Error} If during rule execution. + * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages. + */ + #eslintrcVerifyWithoutProcessors(file, providedConfig, providedOptions) { + + const slots = internalSlotsMap.get(this); + const config = providedConfig || {}; + const options = normalizeVerifyOptions(providedOptions, config); + + // Resolve parser. + let parserName = DEFAULT_PARSER_NAME; + let parser = espree; + + if (typeof config.parser === "object" && config.parser !== null) { + parserName = config.parser.filePath; + parser = config.parser.definition; + } else if (typeof config.parser === "string") { + if (!slots.parserMap.has(config.parser)) { + return [{ + ruleId: null, + fatal: true, + severity: 2, + message: `Configured parser '${config.parser}' was not found.`, + line: 0, + column: 0, + nodeType: null + }]; + } + parserName = config.parser; + parser = slots.parserMap.get(config.parser); + } + + // search and apply "eslint-env *". + const envInFile = options.allowInlineConfig && !options.warnInlineConfig + ? findEslintEnv(file.body) + : {}; + const resolvedEnvConfig = Object.assign({ builtin: true }, config.env, envInFile); + const enabledEnvs = Object.keys(resolvedEnvConfig) + .filter(envName => resolvedEnvConfig[envName]) + .map(envName => getEnv(slots, envName)) + .filter(env => env); + + const parserOptions = resolveParserOptions(parser, config.parserOptions || {}, enabledEnvs); + const configuredGlobals = resolveGlobals(config.globals || {}, enabledEnvs); + const settings = config.settings || {}; + const languageOptions = createLanguageOptions({ + globals: config.globals, + parser, + parserOptions + }); + + if (!slots.lastSourceCode) { + let t; + + if (options.stats) { + t = startTime(); + } + + const parserService = new ParserService(); + const parseResult = parserService.parseSync( + file, + { + language: jslang, + languageOptions + } + ); + + if (options.stats) { + const time = endTime(t); + const timeOpts = { type: "parse" }; + + storeTime(time, timeOpts, slots); + } + + if (!parseResult.ok) { + return parseResult.errors; + } + + slots.lastSourceCode = parseResult.sourceCode; + } else { + + /* + * If the given source code object as the first argument does not have scopeManager, analyze the scope. + * This is for backward compatibility (SourceCode is frozen so it cannot rebind). + */ + if (!slots.lastSourceCode.scopeManager) { + slots.lastSourceCode = new SourceCode({ + text: slots.lastSourceCode.text, + ast: slots.lastSourceCode.ast, + hasBOM: slots.lastSourceCode.hasBOM, + parserServices: slots.lastSourceCode.parserServices, + visitorKeys: slots.lastSourceCode.visitorKeys, + scopeManager: analyzeScope(slots.lastSourceCode.ast, languageOptions) + }); + } + } + + const sourceCode = slots.lastSourceCode; + const commentDirectives = options.allowInlineConfig + ? getDirectiveComments(sourceCode, ruleId => getRule(slots, ruleId), options.warnInlineConfig, config) + : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] }; + + addDeclaredGlobals( + sourceCode.scopeManager.scopes[0], + configuredGlobals, + { exportedVariables: commentDirectives.exportedVariables, enabledGlobals: commentDirectives.enabledGlobals } + ); + + const configuredRules = Object.assign({}, config.rules, commentDirectives.configuredRules); + + let lintingProblems; + + try { + lintingProblems = runRules( + sourceCode, + configuredRules, + ruleId => getRule(slots, ruleId), + parserName, + jslang, + languageOptions, + settings, + options.filename, + true, + options.disableFixes, + slots.cwd, + providedOptions.physicalFilename, + null, + options.stats, + slots + ); + } catch (err) { + err.message += `\nOccurred while linting ${options.filename}`; + debug("An error occurred while traversing"); + debug("Filename:", options.filename); + if (err.currentNode) { + const { line } = sourceCode.getLoc(err.currentNode).start; + + debug("Line:", line); + err.message += `:${line}`; + } + debug("Parser Options:", parserOptions); + debug("Parser Path:", parserName); + debug("Settings:", settings); + + if (err.ruleId) { + err.message += `\nRule: "${err.ruleId}"`; + } + + throw err; + } + + return applyDisableDirectives({ + language: jslang, + sourceCode, + directives: commentDirectives.disableDirectives, + disableFixes: options.disableFixes, + problems: lintingProblems + .concat(commentDirectives.problems) + .sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column), + reportUnusedDisableDirectives: options.reportUnusedDisableDirectives + }); + + } + + /** + * Same as linter.verify, except without support for processors. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything. + * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. + * @throws {Error} If during rule execution. + * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages. + */ + _verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { + const slots = internalSlotsMap.get(this); + const filename = normalizeFilename(providedOptions.filename || ""); + let text; + + // evaluate arguments + if (typeof textOrSourceCode === "string") { + slots.lastSourceCode = null; + text = textOrSourceCode; + } else { + slots.lastSourceCode = textOrSourceCode; + text = textOrSourceCode.text; + } + + const file = new VFile(filename, text, { + physicalPath: providedOptions.physicalFilename + }); + + return this.#eslintrcVerifyWithoutProcessors(file, providedConfig, providedOptions); + } + + /** + * Verifies the text against the rules specified by the second argument. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {ConfigData|ConfigArray} config An ESLintConfig instance to configure everything. + * @param {(string|(VerifyOptions&ProcessorOptions))} [filenameOrOptions] The optional filename of the file being checked. + * If this is not set, the filename will default to '' in the rule context. If + * an object, then it has "filename", "allowInlineConfig", and some properties. + * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages. + */ + verify(textOrSourceCode, config, filenameOrOptions) { + debug("Verify"); + + const { configType, cwd } = internalSlotsMap.get(this); + + const options = typeof filenameOrOptions === "string" + ? { filename: filenameOrOptions } + : filenameOrOptions || {}; + + const configToUse = config ?? {}; + + if (configType !== "eslintrc") { + + /* + * Because of how Webpack packages up the files, we can't + * compare directly to `FlatConfigArray` using `instanceof` + * because it's not the same `FlatConfigArray` as in the tests. + * So, we work around it by assuming an array is, in fact, a + * `FlatConfigArray` if it has a `getConfig()` method. + */ + let configArray = configToUse; + + if (!Array.isArray(configToUse) || typeof configToUse.getConfig !== "function") { + configArray = new FlatConfigArray(configToUse, { basePath: cwd }); + configArray.normalizeSync(); + } + + return this._distinguishSuppressedMessages(this._verifyWithFlatConfigArray(textOrSourceCode, configArray, options, true)); + } + + if (typeof configToUse.extractConfig === "function") { + return this._distinguishSuppressedMessages(this._verifyWithConfigArray(textOrSourceCode, configToUse, options)); + } + + /* + * If we get to here, it means `config` is just an object rather + * than a config array so we can go right into linting. + */ + + /* + * `Linter` doesn't support `overrides` property in configuration. + * So we cannot apply multiple processors. + */ + if (options.preprocess || options.postprocess) { + return this._distinguishSuppressedMessages(this._verifyWithProcessor(textOrSourceCode, configToUse, options)); + } + return this._distinguishSuppressedMessages(this._verifyWithoutProcessors(textOrSourceCode, configToUse, options)); + } + + /** + * Verify with a processor. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {FlatConfig} config The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @param {FlatConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. + * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. + */ + _verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, options, configForRecursive) { + const slots = internalSlotsMap.get(this); + const filename = options.filename || ""; + const filenameToExpose = normalizeFilename(filename); + const physicalFilename = options.physicalFilename || filenameToExpose; + const text = ensureText(textOrSourceCode); + const file = new VFile(filenameToExpose, text, { + physicalPath: physicalFilename + }); + + const preprocess = options.preprocess || (rawText => [rawText]); + const postprocess = options.postprocess || (messagesList => messagesList.flat()); + + const processorService = new ProcessorService(); + const preprocessResult = processorService.preprocessSync(file, { + processor: { + preprocess, + postprocess + } + }); + + if (!preprocessResult.ok) { + return preprocessResult.errors; + } + + const filterCodeBlock = + options.filterCodeBlock || + (blockFilename => blockFilename.endsWith(".js")); + const originalExtname = path.extname(filename); + const { files } = preprocessResult; + + const messageLists = files.map(block => { + debug("A code block was found: %o", block.path || "(unnamed)"); + + // Keep the legacy behavior. + if (typeof block === "string") { + return this._verifyWithFlatConfigArrayAndWithoutProcessors(block, config, options); + } + + // Skip this block if filtered. + if (!filterCodeBlock(block.path, block.body)) { + debug("This code block was skipped."); + return []; + } + + // Resolve configuration again if the file content or extension was changed. + if (configForRecursive && (text !== block.rawBody || path.extname(block.path) !== originalExtname)) { + debug("Resolving configuration again because the file content or extension was changed."); + return this._verifyWithFlatConfigArray( + block.rawBody, + configForRecursive, + { ...options, filename: block.path, physicalFilename: block.physicalPath } + ); + } + + slots.lastSourceCode = null; + + // Does lint. + return this.#flatVerifyWithoutProcessors( + block, + config, + { ...options, filename: block.path, physicalFilename: block.physicalPath } + ); + }); + + return processorService.postprocessSync(file, messageLists, { + processor: { + preprocess, + postprocess + } + }); + } + + /** + * Verify using flat config and without any processors. + * @param {VFile} file The file to lint. + * @param {FlatConfig} providedConfig An ESLintConfig instance to configure everything. + * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. + * @throws {Error} If during rule execution. + * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages. + */ + #flatVerifyWithoutProcessors(file, providedConfig, providedOptions) { + + const slots = internalSlotsMap.get(this); + const config = providedConfig || {}; + const { settings = {}, languageOptions } = config; + const options = normalizeVerifyOptions(providedOptions, config); + + if (!slots.lastSourceCode) { + let t; + + if (options.stats) { + t = startTime(); + } + + const parserService = new ParserService(); + const parseResult = parserService.parseSync( + file, + config + ); + + if (options.stats) { + const time = endTime(t); + + storeTime(time, { type: "parse" }, slots); + } + + if (!parseResult.ok) { + return parseResult.errors; + } + + slots.lastSourceCode = parseResult.sourceCode; + } else { + + /* + * If the given source code object as the first argument does not have scopeManager, analyze the scope. + * This is for backward compatibility (SourceCode is frozen so it cannot rebind). + * + * We check explicitly for `null` to ensure that this is a JS-flavored language. + * For non-JS languages we don't want to do this. + * + * TODO: Remove this check when we stop exporting the `SourceCode` object. + */ + if (slots.lastSourceCode.scopeManager === null) { + slots.lastSourceCode = new SourceCode({ + text: slots.lastSourceCode.text, + ast: slots.lastSourceCode.ast, + hasBOM: slots.lastSourceCode.hasBOM, + parserServices: slots.lastSourceCode.parserServices, + visitorKeys: slots.lastSourceCode.visitorKeys, + scopeManager: analyzeScope(slots.lastSourceCode.ast, languageOptions) + }); + } + } + + const sourceCode = slots.lastSourceCode; + + /* + * Make adjustments based on the language options. For JavaScript, + * this is primarily about adding variables into the global scope + * to account for ecmaVersion and configured globals. + */ + sourceCode.applyLanguageOptions?.(languageOptions); + + const mergedInlineConfig = { + rules: {} + }; + const inlineConfigProblems = []; + + /* + * Inline config can be either enabled or disabled. If disabled, it's possible + * to detect the inline config and emit a warning (though this is not required). + * So we first check to see if inline config is allowed at all, and if so, we + * need to check if it's a warning or not. + */ + if (options.allowInlineConfig) { + + // if inline config should warn then add the warnings + if (options.warnInlineConfig) { + if (sourceCode.getInlineConfigNodes) { + sourceCode.getInlineConfigNodes().forEach(node => { + + const loc = sourceCode.getLoc(node); + const range = sourceCode.getRange(node); + + inlineConfigProblems.push(createLintingProblem({ + ruleId: null, + message: `'${sourceCode.text.slice(range[0], range[1])}' has no effect because you have 'noInlineConfig' setting in ${options.warnInlineConfig}.`, + loc, + severity: 1, + language: config.language + })); + + }); + } + } else { + const inlineConfigResult = sourceCode.applyInlineConfig?.(); + + if (inlineConfigResult) { + inlineConfigProblems.push( + ...inlineConfigResult.problems + .map(problem => createLintingProblem({ ...problem, language: config.language })) + .map(problem => { + problem.fatal = true; + return problem; + }) + ); + + // next we need to verify information about the specified rules + const ruleValidator = new RuleValidator(); + + for (const { config: inlineConfig, loc } of inlineConfigResult.configs) { + + Object.keys(inlineConfig.rules).forEach(ruleId => { + const rule = getRuleFromConfig(ruleId, config); + const ruleValue = inlineConfig.rules[ruleId]; + + if (!rule) { + inlineConfigProblems.push(createLintingProblem({ + ruleId, + loc, + language: config.language + })); + return; + } + + if (Object.hasOwn(mergedInlineConfig.rules, ruleId)) { + inlineConfigProblems.push(createLintingProblem({ + message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`, + loc, + language: config.language + })); + return; + } + + try { + + const ruleOptionsInline = asArray(ruleValue); + let ruleOptions = ruleOptionsInline; + + assertIsRuleSeverity(ruleId, ruleOptions[0]); + + /* + * If the rule was already configured, inline rule configuration that + * only has severity should retain options from the config and just override the severity. + * + * Example: + * + * { + * rules: { + * curly: ["error", "multi"] + * } + * } + * + * /* eslint curly: ["warn"] * / + * + * Results in: + * + * curly: ["warn", "multi"] + */ + + let shouldValidateOptions = true; + + if ( + + /* + * If inline config for the rule has only severity + */ + ruleOptions.length === 1 && + + /* + * And the rule was already configured + */ + config.rules && Object.hasOwn(config.rules, ruleId) + ) { + + /* + * Then use severity from the inline config and options from the provided config + */ + ruleOptions = [ + ruleOptions[0], // severity from the inline config + ...config.rules[ruleId].slice(1) // options from the provided config + ]; + + // if the rule was enabled, the options have already been validated + if (config.rules[ruleId][0] > 0) { + shouldValidateOptions = false; + } + } else { + + /** + * Since we know the user provided options, apply defaults on top of them + */ + const slicedOptions = ruleOptions.slice(1); + const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, slicedOptions); + + if (mergedOptions.length) { + ruleOptions = [ruleOptions[0], ...mergedOptions]; + } + } + + if (options.reportUnusedInlineConfigs !== "off") { + addProblemIfSameSeverityAndOptions( + config, loc, inlineConfigProblems, ruleId, ruleOptions, ruleOptionsInline, options.reportUnusedInlineConfigs + ); + } + + if (shouldValidateOptions) { + ruleValidator.validate({ + plugins: config.plugins, + rules: { + [ruleId]: ruleOptions + } + }); + } + + mergedInlineConfig.rules[ruleId] = ruleOptions; + } catch (err) { + + /* + * If the rule has invalid `meta.schema`, throw the error because + * this is not an invalid inline configuration but an invalid rule. + */ + if (err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA") { + throw err; + } + + let baseMessage = err.message.slice( + err.message.startsWith("Key \"rules\":") + ? err.message.indexOf(":", 12) + 1 + : err.message.indexOf(":") + 1 + ).trim(); + + if (err.messageTemplate) { + baseMessage += ` You passed "${ruleValue}".`; + } + + inlineConfigProblems.push(createLintingProblem({ + ruleId, + message: `Inline configuration for rule "${ruleId}" is invalid:\n\t${baseMessage}\n`, + loc, + language: config.language + })); + } + }); + } + } + } + } + + const commentDirectives = options.allowInlineConfig && !options.warnInlineConfig + ? getDirectiveCommentsForFlatConfig( + sourceCode, + ruleId => getRuleFromConfig(ruleId, config), + config.language + ) + : { problems: [], disableDirectives: [] }; + + const configuredRules = Object.assign({}, config.rules, mergedInlineConfig.rules); + + let lintingProblems; + + sourceCode.finalize?.(); + + try { + lintingProblems = runRules( + sourceCode, + configuredRules, + ruleId => getRuleFromConfig(ruleId, config), + void 0, + config.language, + languageOptions, + settings, + options.filename, + false, + options.disableFixes, + slots.cwd, + providedOptions.physicalFilename, + options.ruleFilter, + options.stats, + slots + ); + } catch (err) { + err.message += `\nOccurred while linting ${options.filename}`; + debug("An error occurred while traversing"); + debug("Filename:", options.filename); + if (err.currentNode) { + const { line } = sourceCode.getLoc(err.currentNode).start; + + debug("Line:", line); + err.message += `:${line}`; + } + debug("Parser Options:", languageOptions.parserOptions); + + // debug("Parser Path:", parserName); + debug("Settings:", settings); + + if (err.ruleId) { + err.message += `\nRule: "${err.ruleId}"`; + } + + throw err; + } + + return applyDisableDirectives({ + language: config.language, + sourceCode, + directives: commentDirectives.disableDirectives, + disableFixes: options.disableFixes, + problems: lintingProblems + .concat(commentDirectives.problems) + .concat(inlineConfigProblems) + .sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column), + reportUnusedDisableDirectives: options.reportUnusedDisableDirectives, + ruleFilter: options.ruleFilter, + configuredRules + }); + + + } + + /** + * Same as linter.verify, except without support for processors. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {FlatConfig} providedConfig An ESLintConfig instance to configure everything. + * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. + * @throws {Error} If during rule execution. + * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages. + */ + _verifyWithFlatConfigArrayAndWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { + const slots = internalSlotsMap.get(this); + const filename = normalizeFilename(providedOptions.filename || ""); + let text; + + // evaluate arguments + if (typeof textOrSourceCode === "string") { + slots.lastSourceCode = null; + text = textOrSourceCode; + } else { + slots.lastSourceCode = textOrSourceCode; + text = textOrSourceCode.text; + } + + const file = new VFile(filename, text, { + physicalPath: providedOptions.physicalFilename + }); + + return this.#flatVerifyWithoutProcessors(file, providedConfig, providedOptions); + } + + /** + * Verify a given code with `ConfigArray`. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {ConfigArray} configArray The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. + */ + _verifyWithConfigArray(textOrSourceCode, configArray, options) { + debug("With ConfigArray: %s", options.filename); + + // Store the config array in order to get plugin envs and rules later. + internalSlotsMap.get(this).lastConfigArray = configArray; + + // Extract the final config for this file. + const config = configArray.extractConfig(options.filename); + const processor = + config.processor && + configArray.pluginProcessors.get(config.processor); + + // Verify. + if (processor) { + debug("Apply the processor: %o", config.processor); + const { preprocess, postprocess, supportsAutofix } = processor; + const disableFixes = options.disableFixes || !supportsAutofix; + + return this._verifyWithProcessor( + textOrSourceCode, + config, + { ...options, disableFixes, postprocess, preprocess }, + configArray + ); + } + return this._verifyWithoutProcessors(textOrSourceCode, config, options); + } + + /** + * Verify a given code with a flat config. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {FlatConfigArray} configArray The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @param {boolean} [firstCall=false] Indicates if this is being called directly + * from verify(). (TODO: Remove once eslintrc is removed.) + * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. + */ + _verifyWithFlatConfigArray(textOrSourceCode, configArray, options, firstCall = false) { + debug("With flat config: %s", options.filename); + + // we need a filename to match configs against + const filename = options.filename || "__placeholder__.js"; + + // Store the config array in order to get plugin envs and rules later. + internalSlotsMap.get(this).lastConfigArray = configArray; + const config = configArray.getConfig(filename); + + if (!config) { + return [ + { + ruleId: null, + severity: 1, + message: `No matching configuration found for ${filename}.`, + line: 0, + column: 0, + nodeType: null + } + ]; + } + + // Verify. + if (config.processor) { + debug("Apply the processor: %o", config.processor); + const { preprocess, postprocess, supportsAutofix } = config.processor; + const disableFixes = options.disableFixes || !supportsAutofix; + + return this._verifyWithFlatConfigArrayAndProcessor( + textOrSourceCode, + config, + { ...options, filename, disableFixes, postprocess, preprocess }, + configArray + ); + } + + // check for options-based processing + if (firstCall && (options.preprocess || options.postprocess)) { + return this._verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, options); + } + + return this._verifyWithFlatConfigArrayAndWithoutProcessors(textOrSourceCode, config, options); + } + + /** + * Verify with a processor. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {ConfigData|ExtractedConfig} config The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @param {ConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. + * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. + */ + _verifyWithProcessor(textOrSourceCode, config, options, configForRecursive) { + const slots = internalSlotsMap.get(this); + const filename = options.filename || ""; + const filenameToExpose = normalizeFilename(filename); + const physicalFilename = options.physicalFilename || filenameToExpose; + const text = ensureText(textOrSourceCode); + const file = new VFile(filenameToExpose, text, { + physicalPath: physicalFilename + }); + + const preprocess = options.preprocess || (rawText => [rawText]); + const postprocess = options.postprocess || (messagesList => messagesList.flat()); + + const processorService = new ProcessorService(); + const preprocessResult = processorService.preprocessSync(file, { + processor: { + preprocess, + postprocess + } + }); + + if (!preprocessResult.ok) { + return preprocessResult.errors; + } + + const filterCodeBlock = + options.filterCodeBlock || + (blockFilePath => blockFilePath.endsWith(".js")); + const originalExtname = path.extname(filename); + + const { files } = preprocessResult; + + const messageLists = files.map(block => { + debug("A code block was found: %o", block.path ?? "(unnamed)"); + + // Keep the legacy behavior. + if (typeof block === "string") { + return this._verifyWithoutProcessors(block, config, options); + } + + // Skip this block if filtered. + if (!filterCodeBlock(block.path, block.body)) { + debug("This code block was skipped."); + return []; + } + + // Resolve configuration again if the file content or extension was changed. + if (configForRecursive && (text !== block.rawBody || path.extname(block.path) !== originalExtname)) { + debug("Resolving configuration again because the file content or extension was changed."); + return this._verifyWithConfigArray( + block.rawBody, + configForRecursive, + { ...options, filename: block.path, physicalFilename: block.physicalPath } + ); + } + + slots.lastSourceCode = null; + + // Does lint. + return this.#eslintrcVerifyWithoutProcessors( + block, + config, + { ...options, filename: block.path, physicalFilename: block.physicalPath } + ); + }); + + return processorService.postprocessSync(file, messageLists, { + processor: { + preprocess, + postprocess + } + }); + + } + + /** + * Given a list of reported problems, distinguish problems between normal messages and suppressed messages. + * The normal messages will be returned and the suppressed messages will be stored as lastSuppressedMessages. + * @param {Array} problems A list of reported problems. + * @returns {LintMessage[]} A list of LintMessage. + */ + _distinguishSuppressedMessages(problems) { + const messages = []; + const suppressedMessages = []; + const slots = internalSlotsMap.get(this); + + for (const problem of problems) { + if (problem.suppressions) { + suppressedMessages.push(problem); + } else { + messages.push(problem); + } + } + + slots.lastSuppressedMessages = suppressedMessages; + + return messages; + } + + /** + * Gets the SourceCode object representing the parsed source. + * @returns {SourceCode} The SourceCode object. + */ + getSourceCode() { + return internalSlotsMap.get(this).lastSourceCode; + } + + /** + * Gets the times spent on (parsing, fixing, linting) a file. + * @returns {LintTimes} The times. + */ + getTimes() { + return internalSlotsMap.get(this).times ?? { passes: [] }; + } + + /** + * Gets the number of autofix passes that were made in the last run. + * @returns {number} The number of autofix passes. + */ + getFixPassCount() { + return internalSlotsMap.get(this).fixPasses ?? 0; + } + + /** + * Gets the list of SuppressedLintMessage produced in the last running. + * @returns {SuppressedLintMessage[]} The list of SuppressedLintMessage + */ + getSuppressedMessages() { + return internalSlotsMap.get(this).lastSuppressedMessages; + } + + /** + * Defines a new linting rule. + * @param {string} ruleId A unique rule identifier + * @param {Rule} rule A rule object + * @returns {void} + */ + defineRule(ruleId, rule) { + assertEslintrcConfig(this); + internalSlotsMap.get(this).ruleMap.define(ruleId, rule); + } + + /** + * Defines many new linting rules. + * @param {Record} rulesToDefine map from unique rule identifier to rule + * @returns {void} + */ + defineRules(rulesToDefine) { + assertEslintrcConfig(this); + Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => { + this.defineRule(ruleId, rulesToDefine[ruleId]); + }); + } + + /** + * Gets an object with all loaded rules. + * @returns {Map} All loaded rules + */ + getRules() { + assertEslintrcConfig(this); + const { lastConfigArray, ruleMap } = internalSlotsMap.get(this); + + return new Map(function *() { + yield* ruleMap; + + if (lastConfigArray) { + yield* lastConfigArray.pluginRules; + } + }()); + } + + /** + * Define a new parser module + * @param {string} parserId Name of the parser + * @param {Parser} parserModule The parser object + * @returns {void} + */ + defineParser(parserId, parserModule) { + assertEslintrcConfig(this); + internalSlotsMap.get(this).parserMap.set(parserId, parserModule); + } + + /** + * Performs multiple autofix passes over the text until as many fixes as possible + * have been applied. + * @param {string} text The source text to apply fixes to. + * @param {ConfigData|ConfigArray|FlatConfigArray} config The ESLint config object to use. + * @param {VerifyOptions&ProcessorOptions&FixOptions} options The ESLint options object to use. + * @returns {{fixed:boolean,messages:LintMessage[],output:string}} The result of the fix operation as returned from the + * SourceCodeFixer. + */ + verifyAndFix(text, config, options) { + let messages, + fixedResult, + fixed = false, + passNumber = 0, + currentText = text; + const debugTextDescription = options && options.filename || `${text.slice(0, 10)}...`; + const shouldFix = options && typeof options.fix !== "undefined" ? options.fix : true; + const stats = options?.stats; + + /** + * This loop continues until one of the following is true: + * + * 1. No more fixes have been applied. + * 2. Ten passes have been made. + * + * That means anytime a fix is successfully applied, there will be another pass. + * Essentially, guaranteeing a minimum of two passes. + */ + const slots = internalSlotsMap.get(this); + + // Remove lint times from the last run. + if (stats) { + delete slots.times; + slots.fixPasses = 0; + } + + do { + passNumber++; + let tTotal; + + if (stats) { + tTotal = startTime(); + } + + debug(`Linting code for ${debugTextDescription} (pass ${passNumber})`); + messages = this.verify(currentText, config, options); + + debug(`Generating fixed text for ${debugTextDescription} (pass ${passNumber})`); + let t; + + if (stats) { + t = startTime(); + } + + fixedResult = SourceCodeFixer.applyFixes(currentText, messages, shouldFix); + + if (stats) { + + if (fixedResult.fixed) { + const time = endTime(t); + + storeTime(time, { type: "fix" }, slots); + slots.fixPasses++; + } else { + storeTime(0, { type: "fix" }, slots); + } + } + + /* + * stop if there are any syntax errors. + * 'fixedResult.output' is a empty string. + */ + if (messages.length === 1 && messages[0].fatal) { + break; + } + + // keep track if any fixes were ever applied - important for return value + fixed = fixed || fixedResult.fixed; + + // update to use the fixed output instead of the original text + currentText = fixedResult.output; + + if (stats) { + tTotal = endTime(tTotal); + const passIndex = slots.times.passes.length - 1; + + slots.times.passes[passIndex].total = tTotal; + } + + } while ( + fixedResult.fixed && + passNumber < MAX_AUTOFIX_PASSES + ); + + /* + * If the last result had fixes, we need to lint again to be sure we have + * the most up-to-date information. + */ + if (fixedResult.fixed) { + let tTotal; + + if (stats) { + tTotal = startTime(); + } + + fixedResult.messages = this.verify(currentText, config, options); + + if (stats) { + storeTime(0, { type: "fix" }, slots); + slots.times.passes.at(-1).total = endTime(tTotal); + } + } + + // ensure the last result properly reflects if fixes were done + fixedResult.fixed = fixed; + fixedResult.output = currentText; + + return fixedResult; + } +} + +module.exports = { + Linter, + + /** + * Get the internal slots of a given Linter instance for tests. + * @param {Linter} instance The Linter instance to get. + * @returns {LinterInternalSlots} The internal slots. + */ + getLinterInternalSlots(instance) { + return internalSlotsMap.get(instance); + } +}; diff --git a/node_modules/eslint/lib/linter/node-event-generator.js b/node_modules/eslint/lib/linter/node-event-generator.js new file mode 100644 index 0000000..0eb2f8d --- /dev/null +++ b/node_modules/eslint/lib/linter/node-event-generator.js @@ -0,0 +1,352 @@ +/** + * @fileoverview The event generator for AST nodes. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const esquery = require("esquery"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An object describing an AST selector + * @typedef {Object} ASTSelector + * @property {string} rawSelector The string that was parsed into this selector + * @property {boolean} isExit `true` if this should be emitted when exiting the node rather than when entering + * @property {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector + * @property {string[]|null} listenerTypes A list of node types that could possibly cause the selector to match, + * or `null` if all node types could cause a match + * @property {number} attributeCount The total number of classes, pseudo-classes, and attribute queries in this selector + * @property {number} identifierCount The total number of identifier queries in this selector + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Computes the union of one or more arrays + * @param {...any[]} arrays One or more arrays to union + * @returns {any[]} The union of the input arrays + */ +function union(...arrays) { + return [...new Set(arrays.flat())]; +} + +/** + * Computes the intersection of one or more arrays + * @param {...any[]} arrays One or more arrays to intersect + * @returns {any[]} The intersection of the input arrays + */ +function intersection(...arrays) { + if (arrays.length === 0) { + return []; + } + + let result = [...new Set(arrays[0])]; + + for (const array of arrays.slice(1)) { + result = result.filter(x => array.includes(x)); + } + return result; +} + +/** + * Gets the possible types of a selector + * @param {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector + * @returns {string[]|null} The node types that could possibly trigger this selector, or `null` if all node types could trigger it + */ +function getPossibleTypes(parsedSelector) { + switch (parsedSelector.type) { + case "identifier": + return [parsedSelector.value]; + + case "matches": { + const typesForComponents = parsedSelector.selectors.map(getPossibleTypes); + + if (typesForComponents.every(Boolean)) { + return union(...typesForComponents); + } + return null; + } + + case "compound": { + const typesForComponents = parsedSelector.selectors.map(getPossibleTypes).filter(typesForComponent => typesForComponent); + + // If all of the components could match any type, then the compound could also match any type. + if (!typesForComponents.length) { + return null; + } + + /* + * If at least one of the components could only match a particular type, the compound could only match + * the intersection of those types. + */ + return intersection(...typesForComponents); + } + + case "child": + case "descendant": + case "sibling": + case "adjacent": + return getPossibleTypes(parsedSelector.right); + + case "class": + if (parsedSelector.name === "function") { + return ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]; + } + + return null; + + default: + return null; + + } +} + +/** + * Counts the number of class, pseudo-class, and attribute queries in this selector + * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior + * @returns {number} The number of class, pseudo-class, and attribute queries in this selector + */ +function countClassAttributes(parsedSelector) { + switch (parsedSelector.type) { + case "child": + case "descendant": + case "sibling": + case "adjacent": + return countClassAttributes(parsedSelector.left) + countClassAttributes(parsedSelector.right); + + case "compound": + case "not": + case "matches": + return parsedSelector.selectors.reduce((sum, childSelector) => sum + countClassAttributes(childSelector), 0); + + case "attribute": + case "field": + case "nth-child": + case "nth-last-child": + return 1; + + default: + return 0; + } +} + +/** + * Counts the number of identifier queries in this selector + * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior + * @returns {number} The number of identifier queries + */ +function countIdentifiers(parsedSelector) { + switch (parsedSelector.type) { + case "child": + case "descendant": + case "sibling": + case "adjacent": + return countIdentifiers(parsedSelector.left) + countIdentifiers(parsedSelector.right); + + case "compound": + case "not": + case "matches": + return parsedSelector.selectors.reduce((sum, childSelector) => sum + countIdentifiers(childSelector), 0); + + case "identifier": + return 1; + + default: + return 0; + } +} + +/** + * Compares the specificity of two selector objects, with CSS-like rules. + * @param {ASTSelector} selectorA An AST selector descriptor + * @param {ASTSelector} selectorB Another AST selector descriptor + * @returns {number} + * a value less than 0 if selectorA is less specific than selectorB + * a value greater than 0 if selectorA is more specific than selectorB + * a value less than 0 if selectorA and selectorB have the same specificity, and selectorA <= selectorB alphabetically + * a value greater than 0 if selectorA and selectorB have the same specificity, and selectorA > selectorB alphabetically + */ +function compareSpecificity(selectorA, selectorB) { + return selectorA.attributeCount - selectorB.attributeCount || + selectorA.identifierCount - selectorB.identifierCount || + (selectorA.rawSelector <= selectorB.rawSelector ? -1 : 1); +} + +/** + * Parses a raw selector string, and throws a useful error if parsing fails. + * @param {string} rawSelector A raw AST selector + * @returns {Object} An object (from esquery) describing the matching behavior of this selector + * @throws {Error} An error if the selector is invalid + */ +function tryParseSelector(rawSelector) { + try { + return esquery.parse(rawSelector.replace(/:exit$/u, "")); + } catch (err) { + if (err.location && err.location.start && typeof err.location.start.offset === "number") { + throw new SyntaxError(`Syntax error in selector "${rawSelector}" at position ${err.location.start.offset}: ${err.message}`); + } + throw err; + } +} + +const selectorCache = new Map(); + +/** + * Parses a raw selector string, and returns the parsed selector along with specificity and type information. + * @param {string} rawSelector A raw AST selector + * @returns {ASTSelector} A selector descriptor + */ +function parseSelector(rawSelector) { + if (selectorCache.has(rawSelector)) { + return selectorCache.get(rawSelector); + } + + const parsedSelector = tryParseSelector(rawSelector); + + const result = { + rawSelector, + isExit: rawSelector.endsWith(":exit"), + parsedSelector, + listenerTypes: getPossibleTypes(parsedSelector), + attributeCount: countClassAttributes(parsedSelector), + identifierCount: countIdentifiers(parsedSelector) + }; + + selectorCache.set(rawSelector, result); + return result; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The event generator for AST nodes. + * This implements below interface. + * + * ```ts + * interface EventGenerator { + * emitter: SafeEmitter; + * enterNode(node: ASTNode): void; + * leaveNode(node: ASTNode): void; + * } + * ``` + */ +class NodeEventGenerator { + + /** + * @param {SafeEmitter} emitter + * An SafeEmitter which is the destination of events. This emitter must already + * have registered listeners for all of the events that it needs to listen for. + * (See lib/linter/safe-emitter.js for more details on `SafeEmitter`.) + * @param {ESQueryOptions} esqueryOptions `esquery` options for traversing custom nodes. + * @returns {NodeEventGenerator} new instance + */ + constructor(emitter, esqueryOptions) { + this.emitter = emitter; + this.esqueryOptions = esqueryOptions; + this.currentAncestry = []; + this.enterSelectorsByNodeType = new Map(); + this.exitSelectorsByNodeType = new Map(); + this.anyTypeEnterSelectors = []; + this.anyTypeExitSelectors = []; + + emitter.eventNames().forEach(rawSelector => { + const selector = parseSelector(rawSelector); + + if (selector.listenerTypes) { + const typeMap = selector.isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType; + + selector.listenerTypes.forEach(nodeType => { + if (!typeMap.has(nodeType)) { + typeMap.set(nodeType, []); + } + typeMap.get(nodeType).push(selector); + }); + return; + } + const selectors = selector.isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors; + + selectors.push(selector); + }); + + this.anyTypeEnterSelectors.sort(compareSpecificity); + this.anyTypeExitSelectors.sort(compareSpecificity); + this.enterSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity)); + this.exitSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity)); + } + + /** + * Checks a selector against a node, and emits it if it matches + * @param {ASTNode} node The node to check + * @param {ASTSelector} selector An AST selector descriptor + * @returns {void} + */ + applySelector(node, selector) { + if (esquery.matches(node, selector.parsedSelector, this.currentAncestry, this.esqueryOptions)) { + this.emitter.emit(selector.rawSelector, node); + } + } + + /** + * Applies all appropriate selectors to a node, in specificity order + * @param {ASTNode} node The node to check + * @param {boolean} isExit `false` if the node is currently being entered, `true` if it's currently being exited + * @returns {void} + */ + applySelectors(node, isExit) { + const selectorsByNodeType = (isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType).get(node.type) || []; + const anyTypeSelectors = isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors; + + /* + * selectorsByNodeType and anyTypeSelectors were already sorted by specificity in the constructor. + * Iterate through each of them, applying selectors in the right order. + */ + let selectorsByTypeIndex = 0; + let anyTypeSelectorsIndex = 0; + + while (selectorsByTypeIndex < selectorsByNodeType.length || anyTypeSelectorsIndex < anyTypeSelectors.length) { + if ( + selectorsByTypeIndex >= selectorsByNodeType.length || + anyTypeSelectorsIndex < anyTypeSelectors.length && + compareSpecificity(anyTypeSelectors[anyTypeSelectorsIndex], selectorsByNodeType[selectorsByTypeIndex]) < 0 + ) { + this.applySelector(node, anyTypeSelectors[anyTypeSelectorsIndex++]); + } else { + this.applySelector(node, selectorsByNodeType[selectorsByTypeIndex++]); + } + } + } + + /** + * Emits an event of entering AST node. + * @param {ASTNode} node A node which was entered. + * @returns {void} + */ + enterNode(node) { + this.applySelectors(node, false); + this.currentAncestry.unshift(node); + } + + /** + * Emits an event of leaving AST node. + * @param {ASTNode} node A node which was left. + * @returns {void} + */ + leaveNode(node) { + this.currentAncestry.shift(); + this.applySelectors(node, true); + } +} + +module.exports = NodeEventGenerator; diff --git a/node_modules/eslint/lib/linter/report-translator.js b/node_modules/eslint/lib/linter/report-translator.js new file mode 100644 index 0000000..e0a4630 --- /dev/null +++ b/node_modules/eslint/lib/linter/report-translator.js @@ -0,0 +1,376 @@ +/** + * @fileoverview A helper that translates context.report() calls from the rule API into generic problem objects + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("../shared/assert"); +const { RuleFixer } = require("./rule-fixer"); +const { interpolate } = require("./interpolate"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").LintMessage} LintMessage */ + +/** + * An error message description + * @typedef {Object} MessageDescriptor + * @property {ASTNode} [node] The reported node + * @property {Location} loc The location of the problem. + * @property {string} message The problem message. + * @property {Object} [data] Optional data to use to fill in placeholders in the + * message. + * @property {Function} [fix] The function to call that creates a fix command. + * @property {Array<{desc?: string, messageId?: string, fix: Function}>} suggest Suggestion descriptions and functions to create a the associated fixes. + */ + +//------------------------------------------------------------------------------ +// Module Definition +//------------------------------------------------------------------------------ + + +/** + * Translates a multi-argument context.report() call into a single object argument call + * @param {...*} args A list of arguments passed to `context.report` + * @returns {MessageDescriptor} A normalized object containing report information + */ +function normalizeMultiArgReportCall(...args) { + + // If there is one argument, it is considered to be a new-style call already. + if (args.length === 1) { + + // Shallow clone the object to avoid surprises if reusing the descriptor + return Object.assign({}, args[0]); + } + + // If the second argument is a string, the arguments are interpreted as [node, message, data, fix]. + if (typeof args[1] === "string") { + return { + node: args[0], + message: args[1], + data: args[2], + fix: args[3] + }; + } + + // Otherwise, the arguments are interpreted as [node, loc, message, data, fix]. + return { + node: args[0], + loc: args[1], + message: args[2], + data: args[3], + fix: args[4] + }; +} + +/** + * Asserts that either a loc or a node was provided, and the node is valid if it was provided. + * @param {MessageDescriptor} descriptor A descriptor to validate + * @returns {void} + * @throws AssertionError if neither a node nor a loc was provided, or if the node is not an object + */ +function assertValidNodeInfo(descriptor) { + if (descriptor.node) { + assert(typeof descriptor.node === "object", "Node must be an object"); + } else { + assert(descriptor.loc, "Node must be provided when reporting error if location is not provided"); + } +} + +/** + * Normalizes a MessageDescriptor to always have a `loc` with `start` and `end` properties + * @param {MessageDescriptor} descriptor A descriptor for the report from a rule. + * @returns {{start: Location, end: (Location|null)}} An updated location that infers the `start` and `end` properties + * from the `node` of the original descriptor, or infers the `start` from the `loc` of the original descriptor. + */ +function normalizeReportLoc(descriptor) { + if (descriptor.loc.start) { + return descriptor.loc; + } + return { start: descriptor.loc, end: null }; +} + +/** + * Clones the given fix object. + * @param {Fix|null} fix The fix to clone. + * @returns {Fix|null} Deep cloned fix object or `null` if `null` or `undefined` was passed in. + */ +function cloneFix(fix) { + if (!fix) { + return null; + } + + return { + range: [fix.range[0], fix.range[1]], + text: fix.text + }; +} + +/** + * Check that a fix has a valid range. + * @param {Fix|null} fix The fix to validate. + * @returns {void} + */ +function assertValidFix(fix) { + if (fix) { + assert(fix.range && typeof fix.range[0] === "number" && typeof fix.range[1] === "number", `Fix has invalid range: ${JSON.stringify(fix, null, 2)}`); + } +} + +/** + * Compares items in a fixes array by range. + * @param {Fix} a The first message. + * @param {Fix} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareFixesByRange(a, b) { + return a.range[0] - b.range[0] || a.range[1] - b.range[1]; +} + +/** + * Merges the given fixes array into one. + * @param {Fix[]} fixes The fixes to merge. + * @param {SourceCode} sourceCode The source code object to get the text between fixes. + * @returns {{text: string, range: number[]}} The merged fixes + */ +function mergeFixes(fixes, sourceCode) { + for (const fix of fixes) { + assertValidFix(fix); + } + + if (fixes.length === 0) { + return null; + } + if (fixes.length === 1) { + return cloneFix(fixes[0]); + } + + fixes.sort(compareFixesByRange); + + const originalText = sourceCode.text; + const start = fixes[0].range[0]; + const end = fixes.at(-1).range[1]; + let text = ""; + let lastPos = Number.MIN_SAFE_INTEGER; + + for (const fix of fixes) { + assert(fix.range[0] >= lastPos, "Fix objects must not be overlapped in a report."); + + if (fix.range[0] >= 0) { + text += originalText.slice(Math.max(0, start, lastPos), fix.range[0]); + } + text += fix.text; + lastPos = fix.range[1]; + } + text += originalText.slice(Math.max(0, start, lastPos), end); + + return { range: [start, end], text }; +} + +/** + * Gets one fix object from the given descriptor. + * If the descriptor retrieves multiple fixes, this merges those to one. + * @param {MessageDescriptor} descriptor The report descriptor. + * @param {SourceCode} sourceCode The source code object to get text between fixes. + * @returns {({text: string, range: number[]}|null)} The fix for the descriptor + */ +function normalizeFixes(descriptor, sourceCode) { + if (typeof descriptor.fix !== "function") { + return null; + } + + const ruleFixer = new RuleFixer({ sourceCode }); + + // @type {null | Fix | Fix[] | IterableIterator} + const fix = descriptor.fix(ruleFixer); + + // Merge to one. + if (fix && Symbol.iterator in fix) { + return mergeFixes(Array.from(fix), sourceCode); + } + + assertValidFix(fix); + return cloneFix(fix); +} + +/** + * Gets an array of suggestion objects from the given descriptor. + * @param {MessageDescriptor} descriptor The report descriptor. + * @param {SourceCode} sourceCode The source code object to get text between fixes. + * @param {Object} messages Object of meta messages for the rule. + * @returns {Array} The suggestions for the descriptor + */ +function mapSuggestions(descriptor, sourceCode, messages) { + if (!descriptor.suggest || !Array.isArray(descriptor.suggest)) { + return []; + } + + return descriptor.suggest + .map(suggestInfo => { + const computedDesc = suggestInfo.desc || messages[suggestInfo.messageId]; + + return { + ...suggestInfo, + desc: interpolate(computedDesc, suggestInfo.data), + fix: normalizeFixes(suggestInfo, sourceCode) + }; + }) + + // Remove suggestions that didn't provide a fix + .filter(({ fix }) => fix); +} + +/** + * Creates information about the report from a descriptor + * @param {Object} options Information about the problem + * @param {string} options.ruleId Rule ID + * @param {(0|1|2)} options.severity Rule severity + * @param {(ASTNode|null)} options.node Node + * @param {string} options.message Error message + * @param {string} [options.messageId] The error message ID. + * @param {{start: SourceLocation, end: (SourceLocation|null)}} options.loc Start and end location + * @param {{text: string, range: (number[]|null)}} options.fix The fix object + * @param {Array<{text: string, range: (number[]|null)}>} options.suggestions The array of suggestions objects + * @param {Language} [options.language] The language to use to adjust line and column offsets. + * @returns {LintMessage} Information about the report + */ +function createProblem(options) { + const { language } = options; + + // calculate offsets based on the language in use + const columnOffset = language.columnStart === 1 ? 0 : 1; + const lineOffset = language.lineStart === 1 ? 0 : 1; + + const problem = { + ruleId: options.ruleId, + severity: options.severity, + message: options.message, + line: options.loc.start.line + lineOffset, + column: options.loc.start.column + columnOffset, + nodeType: options.node && options.node.type || null + }; + + /* + * If this isn’t in the conditional, some of the tests fail + * because `messageId` is present in the problem object + */ + if (options.messageId) { + problem.messageId = options.messageId; + } + + if (options.loc.end) { + problem.endLine = options.loc.end.line + lineOffset; + problem.endColumn = options.loc.end.column + columnOffset; + } + + if (options.fix) { + problem.fix = options.fix; + } + + if (options.suggestions && options.suggestions.length > 0) { + problem.suggestions = options.suggestions; + } + + return problem; +} + +/** + * Validates that suggestions are properly defined. Throws if an error is detected. + * @param {Array<{ desc?: string, messageId?: string }>} suggest The incoming suggest data. + * @param {Object} messages Object of meta messages for the rule. + * @returns {void} + */ +function validateSuggestions(suggest, messages) { + if (suggest && Array.isArray(suggest)) { + suggest.forEach(suggestion => { + if (suggestion.messageId) { + const { messageId } = suggestion; + + if (!messages) { + throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}', but no messages were present in the rule metadata.`); + } + + if (!messages[messageId]) { + throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`); + } + + if (suggestion.desc) { + throw new TypeError("context.report() called with a suggest option that defines both a 'messageId' and an 'desc'. Please only pass one."); + } + } else if (!suggestion.desc) { + throw new TypeError("context.report() called with a suggest option that doesn't have either a `desc` or `messageId`"); + } + + if (typeof suggestion.fix !== "function") { + throw new TypeError(`context.report() called with a suggest option without a fix function. See: ${suggestion}`); + } + }); + } +} + +/** + * Returns a function that converts the arguments of a `context.report` call from a rule into a reported + * problem for the Node.js API. + * @param {{ruleId: string, severity: number, sourceCode: SourceCode, messageIds: Object, disableFixes: boolean, language:Language}} metadata Metadata for the reported problem + * @returns {function(...args): LintMessage} Function that returns information about the report + */ + +module.exports = function createReportTranslator(metadata) { + + /* + * `createReportTranslator` gets called once per enabled rule per file. It needs to be very performant. + * The report translator itself (i.e. the function that `createReportTranslator` returns) gets + * called every time a rule reports a problem, which happens much less frequently (usually, the vast + * majority of rules don't report any problems for a given file). + */ + return (...args) => { + const descriptor = normalizeMultiArgReportCall(...args); + const messages = metadata.messageIds; + const { sourceCode } = metadata; + + assertValidNodeInfo(descriptor); + + let computedMessage; + + if (descriptor.messageId) { + if (!messages) { + throw new TypeError("context.report() called with a messageId, but no messages were present in the rule metadata."); + } + const id = descriptor.messageId; + + if (descriptor.message) { + throw new TypeError("context.report() called with a message and a messageId. Please only pass one."); + } + if (!messages || !Object.hasOwn(messages, id)) { + throw new TypeError(`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`); + } + computedMessage = messages[id]; + } else if (descriptor.message) { + computedMessage = descriptor.message; + } else { + throw new TypeError("Missing `message` property in report() call; add a message that describes the linting problem."); + } + + validateSuggestions(descriptor.suggest, messages); + + return createProblem({ + ruleId: metadata.ruleId, + severity: metadata.severity, + node: descriptor.node, + message: interpolate(computedMessage, descriptor.data), + messageId: descriptor.messageId, + loc: descriptor.loc ? normalizeReportLoc(descriptor) : sourceCode.getLoc(descriptor.node), + fix: metadata.disableFixes ? null : normalizeFixes(descriptor, sourceCode), + suggestions: metadata.disableFixes ? [] : mapSuggestions(descriptor, sourceCode, messages), + language: metadata.language + }); + }; +}; diff --git a/node_modules/eslint/lib/linter/rule-fixer.js b/node_modules/eslint/lib/linter/rule-fixer.js new file mode 100644 index 0000000..f9c45fe --- /dev/null +++ b/node_modules/eslint/lib/linter/rule-fixer.js @@ -0,0 +1,163 @@ +/** + * @fileoverview An object that creates fix commands for rules. + * @author Nicholas C. Zakas + */ +"use strict"; + +/* eslint class-methods-use-this: off -- Methods desired on instance */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Creates a fix command that inserts text at the specified index in the source text. + * @param {int} index The 0-based index at which to insert the new text. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + * @private + */ +function insertTextAt(index, text) { + return { + range: [index, index], + text + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Creates code fixing commands for rules. + */ +class RuleFixer { + + /** + * The source code object representing the text to be fixed. + * @type {SourceCode} + */ + #sourceCode; + + /** + * Creates a new instance. + * @param {Object} options The options for the fixer. + * @param {SourceCode} options.sourceCode The source code object representing the text to be fixed. + */ + constructor({ sourceCode }) { + this.#sourceCode = sourceCode; + } + + /** + * Creates a fix command that inserts text after the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert after. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfter(nodeOrToken, text) { + const range = this.#sourceCode.getRange(nodeOrToken); + + return this.insertTextAfterRange(range, text); + } + + /** + * Creates a fix command that inserts text after the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfterRange(range, text) { + return insertTextAt(range[1], text); + } + + /** + * Creates a fix command that inserts text before the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert before. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBefore(nodeOrToken, text) { + const range = this.#sourceCode.getRange(nodeOrToken); + + return this.insertTextBeforeRange(range, text); + } + + /** + * Creates a fix command that inserts text before the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBeforeRange(range, text) { + return insertTextAt(range[0], text); + } + + /** + * Creates a fix command that replaces text at the node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceText(nodeOrToken, text) { + const range = this.#sourceCode.getRange(nodeOrToken); + + return this.replaceTextRange(range, text); + } + + /** + * Creates a fix command that replaces text at the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceTextRange(range, text) { + return { + range, + text + }; + } + + /** + * Creates a fix command that removes the node or token from the source. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove(nodeOrToken) { + const range = this.#sourceCode.getRange(nodeOrToken); + + return this.removeRange(range); + } + + /** + * Creates a fix command that removes the specified range of text from the source. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to remove, first item is start of range, second + * is end of range. + * @returns {Object} The fix command. + */ + removeRange(range) { + return { + range, + text: "" + }; + } +} + + +module.exports = { RuleFixer }; diff --git a/node_modules/eslint/lib/linter/rules.js b/node_modules/eslint/lib/linter/rules.js new file mode 100644 index 0000000..bb8e368 --- /dev/null +++ b/node_modules/eslint/lib/linter/rules.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Defines a storage for rules. + * @author Nicholas C. Zakas + * @author aladdin-add + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const builtInRules = require("../rules"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").Rule} Rule */ + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A storage for rules. + */ +class Rules { + constructor() { + this._rules = Object.create(null); + } + + /** + * Registers a rule module for rule id in storage. + * @param {string} ruleId Rule id (file name). + * @param {Rule} rule Rule object. + * @returns {void} + */ + define(ruleId, rule) { + this._rules[ruleId] = rule; + } + + /** + * Access rule handler by id (file name). + * @param {string} ruleId Rule id (file name). + * @returns {Rule} Rule object. + */ + get(ruleId) { + if (typeof this._rules[ruleId] === "string") { + this.define(ruleId, require(this._rules[ruleId])); + } + if (this._rules[ruleId]) { + return this._rules[ruleId]; + } + if (builtInRules.has(ruleId)) { + return builtInRules.get(ruleId); + } + + return null; + } + + *[Symbol.iterator]() { + yield* builtInRules; + + for (const ruleId of Object.keys(this._rules)) { + yield [ruleId, this.get(ruleId)]; + } + } +} + +module.exports = Rules; diff --git a/node_modules/eslint/lib/linter/safe-emitter.js b/node_modules/eslint/lib/linter/safe-emitter.js new file mode 100644 index 0000000..f4837c1 --- /dev/null +++ b/node_modules/eslint/lib/linter/safe-emitter.js @@ -0,0 +1,52 @@ +/** + * @fileoverview A variant of EventEmitter which does not give listeners information about each other + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An event emitter + * @typedef {Object} SafeEmitter + * @property {(eventName: string, listenerFunc: Function) => void} on Adds a listener for a given event name + * @property {(eventName: string, arg1?: any, arg2?: any, arg3?: any) => void} emit Emits an event with a given name. + * This calls all the listeners that were listening for that name, with `arg1`, `arg2`, and `arg3` as arguments. + * @property {function(): string[]} eventNames Gets the list of event names that have registered listeners. + */ + +/** + * Creates an object which can listen for and emit events. + * This is similar to the EventEmitter API in Node's standard library, but it has a few differences. + * The goal is to allow multiple modules to attach arbitrary listeners to the same emitter, without + * letting the modules know about each other at all. + * 1. It has no special keys like `error` and `newListener`, which would allow modules to detect when + * another module throws an error or registers a listener. + * 2. It calls listener functions without any `this` value. (`EventEmitter` calls listeners with a + * `this` value of the emitter instance, which would give listeners access to other listeners.) + * @returns {SafeEmitter} An emitter + */ +module.exports = () => { + const listeners = Object.create(null); + + return Object.freeze({ + on(eventName, listener) { + if (eventName in listeners) { + listeners[eventName].push(listener); + } else { + listeners[eventName] = [listener]; + } + }, + emit(eventName, ...args) { + if (eventName in listeners) { + listeners[eventName].forEach(listener => listener(...args)); + } + }, + eventNames() { + return Object.keys(listeners); + } + }); +}; diff --git a/node_modules/eslint/lib/linter/source-code-fixer.js b/node_modules/eslint/lib/linter/source-code-fixer.js new file mode 100644 index 0000000..35de514 --- /dev/null +++ b/node_modules/eslint/lib/linter/source-code-fixer.js @@ -0,0 +1,152 @@ +/** + * @fileoverview An object that caches and applies source code fixes. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:source-code-fixer"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const BOM = "\uFEFF"; + +/** + * Compares items in a messages array by range. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByFixRange(a, b) { + return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1]; +} + +/** + * Compares items in a messages array by line and column. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByLocation(a, b) { + return a.line - b.line || a.column - b.column; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Utility for apply fixes to source code. + * @constructor + */ +function SourceCodeFixer() { + Object.freeze(this); +} + +/** + * Applies the fixes specified by the messages to the given text. Tries to be + * smart about the fixes and won't apply fixes over the same area in the text. + * @param {string} sourceText The text to apply the changes to. + * @param {Message[]} messages The array of messages reported by ESLint. + * @param {boolean|Function} [shouldFix=true] Determines whether each message should be fixed + * @returns {Object} An object containing the fixed text and any unfixed messages. + */ +SourceCodeFixer.applyFixes = function(sourceText, messages, shouldFix) { + debug("Applying fixes"); + + if (shouldFix === false) { + debug("shouldFix parameter was false, not attempting fixes"); + return { + fixed: false, + messages, + output: sourceText + }; + } + + // clone the array + const remainingMessages = [], + fixes = [], + bom = sourceText.startsWith(BOM) ? BOM : "", + text = bom ? sourceText.slice(1) : sourceText; + let lastPos = Number.NEGATIVE_INFINITY, + output = bom; + + /** + * Try to use the 'fix' from a problem. + * @param {Message} problem The message object to apply fixes from + * @returns {boolean} Whether fix was successfully applied + */ + function attemptFix(problem) { + const fix = problem.fix; + const start = fix.range[0]; + const end = fix.range[1]; + + // Remain it as a problem if it's overlapped or it's a negative range + if (lastPos >= start || start > end) { + remainingMessages.push(problem); + return false; + } + + // Remove BOM. + if ((start < 0 && end >= 0) || (start === 0 && fix.text.startsWith(BOM))) { + output = ""; + } + + // Make output to this fix. + output += text.slice(Math.max(0, lastPos), Math.max(0, start)); + output += fix.text; + lastPos = end; + return true; + } + + messages.forEach(problem => { + if (Object.hasOwn(problem, "fix") && problem.fix) { + fixes.push(problem); + } else { + remainingMessages.push(problem); + } + }); + + if (fixes.length) { + debug("Found fixes to apply"); + let fixesWereApplied = false; + + for (const problem of fixes.sort(compareMessagesByFixRange)) { + if (typeof shouldFix !== "function" || shouldFix(problem)) { + attemptFix(problem); + + /* + * The only time attemptFix will fail is if a previous fix was + * applied which conflicts with it. So we can mark this as true. + */ + fixesWereApplied = true; + } else { + remainingMessages.push(problem); + } + } + output += text.slice(Math.max(0, lastPos)); + + return { + fixed: fixesWereApplied, + messages: remainingMessages.sort(compareMessagesByLocation), + output + }; + } + + debug("No fixes to apply"); + return { + fixed: false, + messages, + output: bom + text + }; + +}; + +module.exports = SourceCodeFixer; diff --git a/node_modules/eslint/lib/linter/timing.js b/node_modules/eslint/lib/linter/timing.js new file mode 100644 index 0000000..232c5f4 --- /dev/null +++ b/node_modules/eslint/lib/linter/timing.js @@ -0,0 +1,169 @@ +/** + * @fileoverview Tracks performance of individual rules. + * @author Brandon Mills + */ + +"use strict"; + +const { startTime, endTime } = require("../shared/stats"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/* c8 ignore next */ +/** + * Align the string to left + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ +function alignLeft(str, len, ch) { + return str + new Array(len - str.length + 1).join(ch || " "); +} + +/* c8 ignore next */ +/** + * Align the string to right + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ +function alignRight(str, len, ch) { + return new Array(len - str.length + 1).join(ch || " ") + str; +} + +//------------------------------------------------------------------------------ +// Module definition +//------------------------------------------------------------------------------ + +const enabled = !!process.env.TIMING; + +const HEADERS = ["Rule", "Time (ms)", "Relative"]; +const ALIGN = [alignLeft, alignRight, alignRight]; + +/** + * Decide how many rules to show in the output list. + * @returns {number} the number of rules to show + */ +function getListSize() { + const MINIMUM_SIZE = 10; + + if (typeof process.env.TIMING !== "string") { + return MINIMUM_SIZE; + } + + if (process.env.TIMING.toLowerCase() === "all") { + return Number.POSITIVE_INFINITY; + } + + const TIMING_ENV_VAR_AS_INTEGER = Number.parseInt(process.env.TIMING, 10); + + return TIMING_ENV_VAR_AS_INTEGER > 10 ? TIMING_ENV_VAR_AS_INTEGER : MINIMUM_SIZE; +} + +/* c8 ignore next */ +/** + * display the data + * @param {Object} data Data object to be displayed + * @returns {void} prints modified string with console.log + * @private + */ +function display(data) { + let total = 0; + const rows = Object.keys(data) + .map(key => { + const time = data[key]; + + total += time; + return [key, time]; + }) + .sort((a, b) => b[1] - a[1]) + .slice(0, getListSize()); + + rows.forEach(row => { + row.push(`${(row[1] * 100 / total).toFixed(1)}%`); + row[1] = row[1].toFixed(3); + }); + + rows.unshift(HEADERS); + + const widths = []; + + rows.forEach(row => { + const len = row.length; + + for (let i = 0; i < len; i++) { + const n = row[i].length; + + if (!widths[i] || n > widths[i]) { + widths[i] = n; + } + } + }); + + const table = rows.map(row => ( + row + .map((cell, index) => ALIGN[index](cell, widths[index])) + .join(" | ") + )); + + table.splice(1, 0, widths.map((width, index) => { + const extraAlignment = index !== 0 && index !== widths.length - 1 ? 2 : 1; + + return ALIGN[index](":", width + extraAlignment, "-"); + }).join("|")); + + console.log(table.join("\n")); // eslint-disable-line no-console -- Debugging function +} + +/* c8 ignore next */ +module.exports = (function() { + + const data = Object.create(null); + + /** + * Time the run + * @param {any} key key from the data object + * @param {Function} fn function to be called + * @param {boolean} stats if 'stats' is true, return the result and the time difference + * @returns {Function} function to be executed + * @private + */ + function time(key, fn, stats) { + + return function(...args) { + + const t = startTime(); + const result = fn(...args); + const tdiff = endTime(t); + + if (enabled) { + if (typeof data[key] === "undefined") { + data[key] = 0; + } + + data[key] += tdiff; + } + + return stats ? { result, tdiff } : result; + }; + } + + if (enabled) { + process.on("exit", () => { + display(data); + }); + } + + return { + time, + enabled, + getListSize + }; + +}()); diff --git a/node_modules/eslint/lib/linter/vfile.js b/node_modules/eslint/lib/linter/vfile.js new file mode 100644 index 0000000..bb2da0a --- /dev/null +++ b/node_modules/eslint/lib/linter/vfile.js @@ -0,0 +1,118 @@ +/** + * @fileoverview Virtual file + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Type Definitions +//----------------------------------------------------------------------------- + +/** @typedef {import("@eslint/core").File} File */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if a given value has a byte order mark (BOM). + * @param {string|Uint8Array} value The value to check. + * @returns {boolean} `true` if the value has a BOM, `false` otherwise. + */ +function hasUnicodeBOM(value) { + return typeof value === "string" + ? value.charCodeAt(0) === 0xFEFF + : value[0] === 0xEF && value[1] === 0xBB && value[2] === 0xBF; +} + +/** + * Strips Unicode BOM from the given value. + * @param {string|Uint8Array} value The value to remove the BOM from. + * @returns {string|Uint8Array} The stripped value. + */ +function stripUnicodeBOM(value) { + + if (!hasUnicodeBOM(value)) { + return value; + } + + if (typeof value === "string") { + + /* + * Check Unicode BOM. + * In JavaScript, string data is stored as UTF-16, so BOM is 0xFEFF. + * http://www.ecma-international.org/ecma-262/6.0/#sec-unicode-format-control-characters + */ + return value.slice(1); + } + + /* + * In a Uint8Array, the BOM is represented by three bytes: 0xEF, 0xBB, and 0xBF, + * so we can just remove the first three bytes. + */ + return value.slice(3); +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * Represents a virtual file inside of ESLint. + * @implements {File} + */ +class VFile { + + /** + * The file path including any processor-created virtual path. + * @type {string} + * @readonly + */ + path; + + /** + * The file path on disk. + * @type {string} + * @readonly + */ + physicalPath; + + /** + * The file contents. + * @type {string|Uint8Array} + * @readonly + */ + body; + + /** + * The raw body of the file, including a BOM if present. + * @type {string|Uint8Array} + * @readonly + */ + rawBody; + + /** + * Indicates whether the file has a byte order mark (BOM). + * @type {boolean} + * @readonly + */ + bom; + + /** + * Creates a new instance. + * @param {string} path The file path. + * @param {string|Uint8Array} body The file contents. + * @param {Object} [options] Additional options. + * @param {string} [options.physicalPath] The file path on disk. + */ + constructor(path, body, { physicalPath } = {}) { + this.path = path; + this.physicalPath = physicalPath ?? path; + this.bom = hasUnicodeBOM(body); + this.body = stripUnicodeBOM(body); + this.rawBody = body; + } +} + +module.exports = { VFile }; diff --git a/node_modules/eslint/lib/options.js b/node_modules/eslint/lib/options.js new file mode 100644 index 0000000..51d077f --- /dev/null +++ b/node_modules/eslint/lib/options.js @@ -0,0 +1,461 @@ +/** + * @fileoverview Options configuration for optionator. + * @author George Zahariev + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const optionator = require("optionator"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * The options object parsed by Optionator. + * @typedef {Object} ParsedCLIOptions + * @property {boolean} cache Only check changed files + * @property {string} cacheFile Path to the cache file. Deprecated: use --cache-location + * @property {string} [cacheLocation] Path to the cache file or directory + * @property {"metadata" | "content"} cacheStrategy Strategy to use for detecting changed files in the cache + * @property {boolean} [color] Force enabling/disabling of color + * @property {string} [config] Use this configuration, overriding .eslintrc.* config options if present + * @property {boolean} debug Output debugging information + * @property {string[]} [env] Specify environments + * @property {boolean} envInfo Output execution environment information + * @property {boolean} errorOnUnmatchedPattern Prevent errors when pattern is unmatched + * @property {boolean} eslintrc Disable use of configuration from .eslintrc.* + * @property {string[]} [ext] Specify JavaScript file extensions + * @property {string[]} [flag] Feature flags + * @property {boolean} fix Automatically fix problems + * @property {boolean} fixDryRun Automatically fix problems without saving the changes to the file system + * @property {("directive" | "problem" | "suggestion" | "layout")[]} [fixType] Specify the types of fixes to apply (directive, problem, suggestion, layout) + * @property {string} format Use a specific output format + * @property {string[]} [global] Define global variables + * @property {boolean} [help] Show help + * @property {boolean} ignore Disable use of ignore files and patterns + * @property {string} [ignorePath] Specify path of ignore file + * @property {string[]} [ignorePattern] Patterns of files to ignore. In eslintrc mode, these are in addition to `.eslintignore` + * @property {boolean} init Run config initialization wizard + * @property {boolean} inlineConfig Prevent comments from changing config or rules + * @property {number} maxWarnings Number of warnings to trigger nonzero exit code + * @property {string} [outputFile] Specify file to write report to + * @property {string} [parser] Specify the parser to be used + * @property {Object} [parserOptions] Specify parser options + * @property {string[]} [plugin] Specify plugins + * @property {string} [printConfig] Print the configuration for the given file + * @property {boolean | undefined} reportUnusedDisableDirectives Adds reported errors for unused eslint-disable and eslint-enable directives + * @property {string | undefined} reportUnusedDisableDirectivesSeverity A severity string indicating if and how unused disable and enable directives should be tracked and reported. + * @property {string} [resolvePluginsRelativeTo] A folder where plugins should be resolved from, CWD by default + * @property {Object} [rule] Specify rules + * @property {string[]} [rulesdir] Load additional rules from this directory. Deprecated: Use rules from plugins + * @property {boolean} stdin Lint code provided on + * @property {string} [stdinFilename] Specify filename to process STDIN as + * @property {boolean} quiet Report errors only + * @property {boolean} [version] Output the version number + * @property {boolean} warnIgnored Show warnings when the file list includes ignored files + * @property {boolean} [passOnNoPatterns=false] When set to true, missing patterns cause + * the linting operation to short circuit and not report any failures. + * @property {string[]} _ Positional filenames or patterns + * @property {boolean} [stats] Report additional statistics + */ + +//------------------------------------------------------------------------------ +// Initialization and Public Interface +//------------------------------------------------------------------------------ + +// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)" + +/** + * Creates the CLI options for ESLint. + * @param {boolean} usingFlatConfig Indicates if flat config is being used. + * @returns {Object} The optionator instance. + */ +module.exports = function(usingFlatConfig) { + + let lookupFlag; + + if (usingFlatConfig) { + lookupFlag = { + option: "config-lookup", + type: "Boolean", + default: "true", + description: "Disable look up for eslint.config.js" + }; + } else { + lookupFlag = { + option: "eslintrc", + type: "Boolean", + default: "true", + description: "Disable use of configuration from .eslintrc.*" + }; + } + + let envFlag; + + if (!usingFlatConfig) { + envFlag = { + option: "env", + type: "[String]", + description: "Specify environments" + }; + } + + let inspectConfigFlag; + + if (usingFlatConfig) { + inspectConfigFlag = { + option: "inspect-config", + type: "Boolean", + description: "Open the config inspector with the current configuration" + }; + } + + let extFlag; + + if (!usingFlatConfig) { + extFlag = { + option: "ext", + type: "[String]", + description: "Specify JavaScript file extensions" + }; + } else { + extFlag = { + option: "ext", + type: "[String]", + description: "Specify additional file extensions to lint" + }; + } + + let resolvePluginsFlag; + + if (!usingFlatConfig) { + resolvePluginsFlag = { + option: "resolve-plugins-relative-to", + type: "path::String", + description: "A folder where plugins should be resolved from, CWD by default" + }; + } + + let rulesDirFlag; + + if (!usingFlatConfig) { + rulesDirFlag = { + option: "rulesdir", + type: "[path::String]", + description: "Load additional rules from this directory. Deprecated: Use rules from plugins" + }; + } + + let ignorePathFlag; + + if (!usingFlatConfig) { + ignorePathFlag = { + option: "ignore-path", + type: "path::String", + description: "Specify path of ignore file" + }; + } + + let statsFlag; + + if (usingFlatConfig) { + statsFlag = { + option: "stats", + type: "Boolean", + default: "false", + description: "Add statistics to the lint report" + }; + } + + let warnIgnoredFlag; + + if (usingFlatConfig) { + warnIgnoredFlag = { + option: "warn-ignored", + type: "Boolean", + default: "true", + description: "Suppress warnings when the file list includes ignored files" + }; + } + + let flagFlag; + + if (usingFlatConfig) { + flagFlag = { + option: "flag", + type: "[String]", + description: "Enable a feature flag" + }; + } + + let reportUnusedInlineConfigsFlag; + + if (usingFlatConfig) { + reportUnusedInlineConfigsFlag = { + option: "report-unused-inline-configs", + type: "String", + default: void 0, + description: "Adds reported errors for unused eslint inline config comments", + enum: ["off", "warn", "error", "0", "1", "2"] + }; + } + + return optionator({ + prepend: "eslint [options] file.js [file.js] [dir]", + defaults: { + concatRepeatedArrays: true, + mergeRepeatedObjects: true + }, + options: [ + { + heading: "Basic configuration" + }, + lookupFlag, + { + option: "config", + alias: "c", + type: "path::String", + description: usingFlatConfig + ? "Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs" + : "Use this configuration, overriding .eslintrc.* config options if present" + }, + inspectConfigFlag, + envFlag, + extFlag, + { + option: "global", + type: "[String]", + description: "Define global variables" + }, + { + option: "parser", + type: "String", + description: "Specify the parser to be used" + }, + { + option: "parser-options", + type: "Object", + description: "Specify parser options" + }, + resolvePluginsFlag, + { + heading: "Specify Rules and Plugins" + }, + { + option: "plugin", + type: "[String]", + description: "Specify plugins" + }, + { + option: "rule", + type: "Object", + description: "Specify rules" + }, + rulesDirFlag, + { + heading: "Fix Problems" + }, + { + option: "fix", + type: "Boolean", + default: false, + description: "Automatically fix problems" + }, + { + option: "fix-dry-run", + type: "Boolean", + default: false, + description: "Automatically fix problems without saving the changes to the file system" + }, + { + option: "fix-type", + type: "Array", + description: "Specify the types of fixes to apply (directive, problem, suggestion, layout)" + }, + { + heading: "Ignore Files" + }, + ignorePathFlag, + { + option: "ignore", + type: "Boolean", + default: "true", + description: "Disable use of ignore files and patterns" + }, + { + option: "ignore-pattern", + type: "[String]", + description: `Patterns of files to ignore${usingFlatConfig ? "" : " (in addition to those in .eslintignore)"}`, + concatRepeatedArrays: [true, { + oneValuePerFlag: true + }] + }, + { + heading: "Use stdin" + }, + { + option: "stdin", + type: "Boolean", + default: "false", + description: "Lint code provided on " + }, + { + option: "stdin-filename", + type: "String", + description: "Specify filename to process STDIN as" + }, + { + heading: "Handle Warnings" + }, + { + option: "quiet", + type: "Boolean", + default: "false", + description: "Report errors only" + }, + { + option: "max-warnings", + type: "Int", + default: "-1", + description: "Number of warnings to trigger nonzero exit code" + }, + { + heading: "Output" + }, + { + option: "output-file", + alias: "o", + type: "path::String", + description: "Specify file to write report to" + }, + { + option: "format", + alias: "f", + type: "String", + default: "stylish", + description: "Use a specific output format" + }, + { + option: "color", + type: "Boolean", + alias: "no-color", + description: "Force enabling/disabling of color" + }, + { + heading: "Inline configuration comments" + }, + { + option: "inline-config", + type: "Boolean", + default: "true", + description: "Prevent comments from changing config or rules" + }, + { + option: "report-unused-disable-directives", + type: "Boolean", + default: void 0, + description: "Adds reported errors for unused eslint-disable and eslint-enable directives" + }, + { + option: "report-unused-disable-directives-severity", + type: "String", + default: void 0, + description: "Chooses severity level for reporting unused eslint-disable and eslint-enable directives", + enum: ["off", "warn", "error", "0", "1", "2"] + }, + reportUnusedInlineConfigsFlag, + { + heading: "Caching" + }, + { + option: "cache", + type: "Boolean", + default: "false", + description: "Only check changed files" + }, + { + option: "cache-file", + type: "path::String", + default: ".eslintcache", + description: "Path to the cache file. Deprecated: use --cache-location" + }, + { + option: "cache-location", + type: "path::String", + description: "Path to the cache file or directory" + }, + { + option: "cache-strategy", + dependsOn: ["cache"], + type: "String", + default: "metadata", + enum: ["metadata", "content"], + description: "Strategy to use for detecting changed files in the cache" + }, + { + heading: "Miscellaneous" + }, + { + option: "init", + type: "Boolean", + default: "false", + description: "Run config initialization wizard" + }, + { + option: "env-info", + type: "Boolean", + default: "false", + description: "Output execution environment information" + }, + { + option: "error-on-unmatched-pattern", + type: "Boolean", + default: "true", + description: "Prevent errors when pattern is unmatched" + }, + { + option: "exit-on-fatal-error", + type: "Boolean", + default: "false", + description: "Exit with exit code 2 in case of fatal error" + }, + warnIgnoredFlag, + { + option: "pass-on-no-patterns", + type: "Boolean", + default: false, + description: "Exit with exit code 0 in case no file patterns are passed" + }, + { + option: "debug", + type: "Boolean", + default: false, + description: "Output debugging information" + }, + { + option: "help", + alias: "h", + type: "Boolean", + description: "Show help" + }, + { + option: "version", + alias: "v", + type: "Boolean", + description: "Output the version number" + }, + { + option: "print-config", + type: "path::String", + description: "Print the configuration for the given file" + }, + statsFlag, + flagFlag + ].filter(value => !!value) + }); +}; diff --git a/node_modules/eslint/lib/rule-tester/index.js b/node_modules/eslint/lib/rule-tester/index.js new file mode 100644 index 0000000..58f67ee --- /dev/null +++ b/node_modules/eslint/lib/rule-tester/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const RuleTester = require("./rule-tester"); + +module.exports = { + RuleTester +}; diff --git a/node_modules/eslint/lib/rule-tester/rule-tester.js b/node_modules/eslint/lib/rule-tester/rule-tester.js new file mode 100644 index 0000000..4ffcfed --- /dev/null +++ b/node_modules/eslint/lib/rule-tester/rule-tester.js @@ -0,0 +1,1307 @@ +/** + * @fileoverview Mocha/Jest test wrapper + * @author Ilya Volodin + */ +"use strict"; + +/* globals describe, it -- Mocha globals */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + assert = require("node:assert"), + util = require("node:util"), + path = require("node:path"), + equal = require("fast-deep-equal"), + Traverser = require("../shared/traverser"), + { getRuleOptionsSchema } = require("../config/flat-config-helpers"), + { Linter, SourceCodeFixer } = require("../linter"), + { interpolate, getPlaceholderMatcher } = require("../linter/interpolate"), + stringify = require("json-stable-stringify-without-jsonify"); + +const { FlatConfigArray } = require("../config/flat-config-array"); +const { defaultConfig } = require("../config/default-config"); + +const ajv = require("../shared/ajv")({ strictDefaults: true }); + +const parserSymbol = Symbol.for("eslint.RuleTester.parser"); +const { ConfigArraySymbol } = require("@eslint/config-array"); +const { isSerializable } = require("../shared/serialization"); + +const jslang = require("../languages/js"); +const { SourceCode } = require("../languages/js/source-code"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").Parser} Parser */ +/** @typedef {import("../shared/types").LanguageOptions} LanguageOptions */ +/** @typedef {import("../shared/types").Rule} Rule */ + + +/** + * A test case that is expected to pass lint. + * @typedef {Object} ValidTestCase + * @property {string} [name] Name for the test case. + * @property {string} code Code for the test case. + * @property {any[]} [options] Options for the test case. + * @property {Function} [before] Function to execute before testing the case. + * @property {Function} [after] Function to execute after testing the case regardless of its result. + * @property {LanguageOptions} [languageOptions] The language options to use in the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {boolean} [only] Run only this test case or the subset of test cases with this property. + */ + +/** + * A test case that is expected to fail lint. + * @typedef {Object} InvalidTestCase + * @property {string} [name] Name for the test case. + * @property {string} code Code for the test case. + * @property {number | Array} errors Expected errors. + * @property {string | null} [output] The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. + * @property {any[]} [options] Options for the test case. + * @property {Function} [before] Function to execute before testing the case. + * @property {Function} [after] Function to execute after testing the case regardless of its result. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {LanguageOptions} [languageOptions] The language options to use in the test case. + * @property {boolean} [only] Run only this test case or the subset of test cases with this property. + */ + +/** + * A description of a reported error used in a rule tester test. + * @typedef {Object} TestCaseError + * @property {string | RegExp} [message] Message. + * @property {string} [messageId] Message ID. + * @property {string} [type] The type of the reported AST node. + * @property {{ [name: string]: string }} [data] The data used to fill the message template. + * @property {number} [line] The 1-based line number of the reported start location. + * @property {number} [column] The 1-based column number of the reported start location. + * @property {number} [endLine] The 1-based line number of the reported end location. + * @property {number} [endColumn] The 1-based column number of the reported end location. + */ + +//------------------------------------------------------------------------------ +// Private Members +//------------------------------------------------------------------------------ + +/* + * testerDefaultConfig must not be modified as it allows to reset the tester to + * the initial default configuration + */ +const testerDefaultConfig = { rules: {} }; + +/* + * RuleTester uses this config as its default. This can be overwritten via + * setDefaultConfig(). + */ +let sharedDefaultConfig = { rules: {} }; + +/* + * List every parameters possible on a test case that are not related to eslint + * configuration + */ +const RuleTesterParameters = [ + "name", + "code", + "filename", + "options", + "before", + "after", + "errors", + "output", + "only" +]; + +/* + * All allowed property names in error objects. + */ +const errorObjectParameters = new Set([ + "message", + "messageId", + "data", + "type", + "line", + "column", + "endLine", + "endColumn", + "suggestions" +]); +const friendlyErrorObjectParameterList = `[${[...errorObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +/* + * All allowed property names in suggestion objects. + */ +const suggestionObjectParameters = new Set([ + "desc", + "messageId", + "data", + "output" +]); +const friendlySuggestionObjectParameterList = `[${[...suggestionObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +/* + * Ignored test case properties when checking for test case duplicates. + */ +const duplicationIgnoredParameters = new Set([ + "name", + "errors", + "output" +]); + +const forbiddenMethods = [ + "applyInlineConfig", + "applyLanguageOptions", + "finalize" +]; + +/** @type {Map} */ +const forbiddenMethodCalls = new Map(forbiddenMethods.map(methodName => ([methodName, new WeakSet()]))); + +const hasOwnProperty = Function.call.bind(Object.hasOwnProperty); + +/** + * Clones a given value deeply. + * Note: This ignores `parent` property. + * @param {any} x A value to clone. + * @returns {any} A cloned value. + */ +function cloneDeeplyExcludesParent(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + return x.map(cloneDeeplyExcludesParent); + } + + const retv = {}; + + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + retv[key] = cloneDeeplyExcludesParent(x[key]); + } + } + + return retv; + } + + return x; +} + +/** + * Freezes a given value deeply. + * @param {any} x A value to freeze. + * @returns {void} + */ +function freezeDeeply(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + x.forEach(freezeDeeply); + } else { + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + freezeDeeply(x[key]); + } + } + } + Object.freeze(x); + } +} + +/** + * Replace control characters by `\u00xx` form. + * @param {string} text The text to sanitize. + * @returns {string} The sanitized text. + */ +function sanitize(text) { + if (typeof text !== "string") { + return ""; + } + return text.replace( + /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex -- Escaping controls + c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}` + ); +} + +/** + * Define `start`/`end` properties as throwing error. + * @param {string} objName Object name used for error messages. + * @param {ASTNode} node The node to define. + * @returns {void} + */ +function defineStartEndAsError(objName, node) { + Object.defineProperties(node, { + start: { + get() { + throw new Error(`Use ${objName}.range[0] instead of ${objName}.start`); + }, + configurable: true, + enumerable: false + }, + end: { + get() { + throw new Error(`Use ${objName}.range[1] instead of ${objName}.end`); + }, + configurable: true, + enumerable: false + } + }); +} + + +/** + * Define `start`/`end` properties of all nodes of the given AST as throwing error. + * @param {ASTNode} ast The root node to errorize `start`/`end` properties. + * @param {Object} [visitorKeys] Visitor keys to be used for traversing the given ast. + * @returns {void} + */ +function defineStartEndAsErrorInTree(ast, visitorKeys) { + Traverser.traverse(ast, { visitorKeys, enter: defineStartEndAsError.bind(null, "node") }); + ast.tokens.forEach(defineStartEndAsError.bind(null, "token")); + ast.comments.forEach(defineStartEndAsError.bind(null, "token")); +} + +/** + * Wraps the given parser in order to intercept and modify return values from the `parse` and `parseForESLint` methods, for test purposes. + * In particular, to modify ast nodes, tokens and comments to throw on access to their `start` and `end` properties. + * @param {Parser} parser Parser object. + * @returns {Parser} Wrapped parser object. + */ +function wrapParser(parser) { + + if (typeof parser.parseForESLint === "function") { + return { + [parserSymbol]: parser, + parseForESLint(...args) { + const ret = parser.parseForESLint(...args); + + defineStartEndAsErrorInTree(ret.ast, ret.visitorKeys); + return ret; + } + }; + } + + return { + [parserSymbol]: parser, + parse(...args) { + const ast = parser.parse(...args); + + defineStartEndAsErrorInTree(ast); + return ast; + } + }; +} + +/** + * Function to replace forbidden `SourceCode` methods. Allows just one call per method. + * @param {string} methodName The name of the method to forbid. + * @param {Function} prototype The prototype with the original method to call. + * @returns {Function} The function that throws the error. + */ +function throwForbiddenMethodError(methodName, prototype) { + + const original = prototype[methodName]; + + return function(...args) { + + const called = forbiddenMethodCalls.get(methodName); + + /* eslint-disable no-invalid-this -- needed to operate as a method. */ + if (!called.has(this)) { + called.add(this); + + return original.apply(this, args); + } + /* eslint-enable no-invalid-this -- not needed past this point */ + + throw new Error( + `\`SourceCode#${methodName}()\` cannot be called inside a rule.` + ); + }; +} + +/** + * Extracts names of {{ placeholders }} from the reported message. + * @param {string} message Reported message + * @returns {string[]} Array of placeholder names + */ +function getMessagePlaceholders(message) { + const matcher = getPlaceholderMatcher(); + + return Array.from(message.matchAll(matcher), ([, name]) => name.trim()); +} + +/** + * Returns the placeholders in the reported messages but + * only includes the placeholders available in the raw message and not in the provided data. + * @param {string} message The reported message + * @param {string} raw The raw message specified in the rule meta.messages + * @param {undefined|Record} data The passed + * @returns {string[]} Missing placeholder names + */ +function getUnsubstitutedMessagePlaceholders(message, raw, data = {}) { + const unsubstituted = getMessagePlaceholders(message); + + if (unsubstituted.length === 0) { + return []; + } + + // Remove false positives by only counting placeholders in the raw message, which were not provided in the data matcher or added with a data property + const known = getMessagePlaceholders(raw); + const provided = Object.keys(data); + + return unsubstituted.filter(name => known.includes(name) && !provided.includes(name)); +} + +const metaSchemaDescription = ` +\t- If the rule has options, set \`meta.schema\` to an array or non-empty object to enable options validation. +\t- If the rule doesn't have options, omit \`meta.schema\` to enforce that no options can be passed to the rule. +\t- You can also set \`meta.schema\` to \`false\` to opt-out of options validation (not recommended). + +\thttps://eslint.org/docs/latest/extend/custom-rules#options-schemas +`; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +// default separators for testing +const DESCRIBE = Symbol("describe"); +const IT = Symbol("it"); +const IT_ONLY = Symbol("itOnly"); + +/** + * This is `it` default handler if `it` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @throws {Error} Any error upon execution of `method`. + * @returns {any} Returned value of `method`. + */ +function itDefaultHandler(text, method) { + try { + return method.call(this); + } catch (err) { + if (err instanceof assert.AssertionError) { + err.message += ` (${util.inspect(err.actual)} ${err.operator} ${util.inspect(err.expected)})`; + } + throw err; + } +} + +/** + * This is `describe` default handler if `describe` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @returns {any} Returned value of `method`. + */ +function describeDefaultHandler(text, method) { + return method.call(this); +} + +/** + * Mocha test wrapper. + */ +class RuleTester { + + /** + * Creates a new instance of RuleTester. + * @param {Object} [testerConfig] Optional, extra configuration for the tester + */ + constructor(testerConfig = {}) { + + /** + * The configuration to use for this tester. Combination of the tester + * configuration and the default configuration. + * @type {Object} + */ + this.testerConfig = [ + sharedDefaultConfig, + testerConfig, + { rules: { "rule-tester/validate-ast": "error" } } + ]; + + this.linter = new Linter({ configType: "flat" }); + } + + /** + * Set the configuration to use for all future tests + * @param {Object} config the configuration to use. + * @throws {TypeError} If non-object config. + * @returns {void} + */ + static setDefaultConfig(config) { + if (typeof config !== "object" || config === null) { + throw new TypeError("RuleTester.setDefaultConfig: config must be an object"); + } + sharedDefaultConfig = config; + + // Make sure the rules object exists since it is assumed to exist later + sharedDefaultConfig.rules = sharedDefaultConfig.rules || {}; + } + + /** + * Get the current configuration used for all tests + * @returns {Object} the current configuration + */ + static getDefaultConfig() { + return sharedDefaultConfig; + } + + /** + * Reset the configuration to the initial configuration of the tester removing + * any changes made until now. + * @returns {void} + */ + static resetDefaultConfig() { + sharedDefaultConfig = { + rules: { + ...testerDefaultConfig.rules + } + }; + } + + + /* + * If people use `mocha test.js --watch` command, `describe` and `it` function + * instances are different for each execution. So `describe` and `it` should get fresh instance + * always. + */ + static get describe() { + return ( + this[DESCRIBE] || + (typeof describe === "function" ? describe : describeDefaultHandler) + ); + } + + static set describe(value) { + this[DESCRIBE] = value; + } + + static get it() { + return ( + this[IT] || + (typeof it === "function" ? it : itDefaultHandler) + ); + } + + static set it(value) { + this[IT] = value; + } + + /** + * Adds the `only` property to a test to run it in isolation. + * @param {string | ValidTestCase | InvalidTestCase} item A single test to run by itself. + * @returns {ValidTestCase | InvalidTestCase} The test with `only` set. + */ + static only(item) { + if (typeof item === "string") { + return { code: item, only: true }; + } + + return { ...item, only: true }; + } + + static get itOnly() { + if (typeof this[IT_ONLY] === "function") { + return this[IT_ONLY]; + } + if (typeof this[IT] === "function" && typeof this[IT].only === "function") { + return Function.bind.call(this[IT].only, this[IT]); + } + if (typeof it === "function" && typeof it.only === "function") { + return Function.bind.call(it.only, it); + } + + if (typeof this[DESCRIBE] === "function" || typeof this[IT] === "function") { + throw new Error( + "Set `RuleTester.itOnly` to use `only` with a custom test framework.\n" + + "See https://eslint.org/docs/latest/integrate/nodejs-api#customizing-ruletester for more." + ); + } + if (typeof it === "function") { + throw new Error("The current test framework does not support exclusive tests with `only`."); + } + throw new Error("To use `only`, use RuleTester with a test framework that provides `it.only()` like Mocha."); + } + + static set itOnly(value) { + this[IT_ONLY] = value; + } + + + /** + * Adds a new rule test to execute. + * @param {string} ruleName The name of the rule to run. + * @param {Rule} rule The rule to test. + * @param {{ + * valid: (ValidTestCase | string)[], + * invalid: InvalidTestCase[] + * }} test The collection of tests to run. + * @throws {TypeError|Error} If `rule` is not an object with a `create` method, + * or if non-object `test`, or if a required scenario of the given type is missing. + * @returns {void} + */ + run(ruleName, rule, test) { + + const testerConfig = this.testerConfig, + requiredScenarios = ["valid", "invalid"], + scenarioErrors = [], + linter = this.linter, + ruleId = `rule-to-test/${ruleName}`; + + const seenValidTestCases = new Set(); + const seenInvalidTestCases = new Set(); + + if (!rule || typeof rule !== "object" || typeof rule.create !== "function") { + throw new TypeError("Rule must be an object with a `create` method"); + } + + if (!test || typeof test !== "object") { + throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`); + } + + requiredScenarios.forEach(scenarioType => { + if (!test[scenarioType]) { + scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`); + } + }); + + if (scenarioErrors.length > 0) { + throw new Error([ + `Test Scenarios for rule ${ruleName} is invalid:` + ].concat(scenarioErrors).join("\n")); + } + + const baseConfig = [ + { files: ["**"] }, // Make sure the default config matches for all files + { + plugins: { + + // copy root plugin over + "@": { + + /* + * Parsers are wrapped to detect more errors, so this needs + * to be a new object for each call to run(), otherwise the + * parsers will be wrapped multiple times. + */ + parsers: { + ...defaultConfig[0].plugins["@"].parsers + }, + + /* + * The rules key on the default plugin is a proxy to lazy-load + * just the rules that are needed. So, don't create a new object + * here, just use the default one to keep that performance + * enhancement. + */ + rules: defaultConfig[0].plugins["@"].rules, + languages: defaultConfig[0].plugins["@"].languages + }, + "rule-to-test": { + rules: { + [ruleName]: Object.assign({}, rule, { + + // Create a wrapper rule that freezes the `context` properties. + create(context) { + freezeDeeply(context.options); + freezeDeeply(context.settings); + freezeDeeply(context.parserOptions); + + // freezeDeeply(context.languageOptions); + + return rule.create(context); + } + }) + } + } + }, + language: defaultConfig[0].language + }, + ...defaultConfig.slice(1) + ]; + + /** + * Runs a hook on the given item when it's assigned to the given property + * @param {string|Object} item Item to run the hook on + * @param {string} prop The property having the hook assigned to + * @throws {Error} If the property is not a function or that function throws an error + * @returns {void} + * @private + */ + function runHook(item, prop) { + if (typeof item === "object" && hasOwnProperty(item, prop)) { + assert.strictEqual(typeof item[prop], "function", `Optional test case property '${prop}' must be a function`); + item[prop](); + } + } + + /** + * Run the rule for the given item + * @param {string|Object} item Item to run the rule against + * @throws {Error} If an invalid schema. + * @returns {Object} Eslint run result + * @private + */ + function runRuleForItem(item) { + const flatConfigArrayOptions = { + baseConfig + }; + + if (item.filename) { + flatConfigArrayOptions.basePath = path.parse(item.filename).root || void 0; + } + + const configs = new FlatConfigArray(testerConfig, flatConfigArrayOptions); + + /* + * Modify the returned config so that the parser is wrapped to catch + * access of the start/end properties. This method is called just + * once per code snippet being tested, so each test case gets a clean + * parser. + */ + configs[ConfigArraySymbol.finalizeConfig] = function(...args) { + + // can't do super here :( + const proto = Object.getPrototypeOf(this); + const calculatedConfig = proto[ConfigArraySymbol.finalizeConfig].apply(this, args); + + // wrap the parser to catch start/end property access + if (calculatedConfig.language === jslang) { + calculatedConfig.languageOptions.parser = wrapParser(calculatedConfig.languageOptions.parser); + } + + return calculatedConfig; + }; + + let code, filename, output, beforeAST, afterAST; + + if (typeof item === "string") { + code = item; + } else { + code = item.code; + + /* + * Assumes everything on the item is a config except for the + * parameters used by this tester + */ + const itemConfig = { ...item }; + + for (const parameter of RuleTesterParameters) { + delete itemConfig[parameter]; + } + + /* + * Create the config object from the tester config and this item + * specific configurations. + */ + configs.push(itemConfig); + } + + if (hasOwnProperty(item, "only")) { + assert.ok(typeof item.only === "boolean", "Optional test case property 'only' must be a boolean"); + } + if (hasOwnProperty(item, "filename")) { + assert.ok(typeof item.filename === "string", "Optional test case property 'filename' must be a string"); + filename = item.filename; + } + + let ruleConfig = 1; + + if (hasOwnProperty(item, "options")) { + assert(Array.isArray(item.options), "options must be an array"); + ruleConfig = [1, ...item.options]; + } + + configs.push({ + rules: { + [ruleId]: ruleConfig + } + }); + + let schema; + + try { + schema = getRuleOptionsSchema(rule); + } catch (err) { + err.message += metaSchemaDescription; + throw err; + } + + /* + * Check and throw an error if the schema is an empty object (`schema:{}`), because such schema + * doesn't validate or enforce anything and is therefore considered a possible error. If the intent + * was to skip options validation, `schema:false` should be set instead (explicit opt-out). + * + * For this purpose, a schema object is considered empty if it doesn't have any own enumerable string-keyed + * properties. While `ajv.compile()` does use enumerable properties from the prototype chain as well, + * it caches compiled schemas by serializing only own enumerable properties, so it's generally not a good idea + * to use inherited properties in schemas because schemas that differ only in inherited properties would end up + * having the same cache entry that would be correct for only one of them. + * + * At this point, `schema` can only be an object or `null`. + */ + if (schema && Object.keys(schema).length === 0) { + throw new Error(`\`schema: {}\` is a no-op${metaSchemaDescription}`); + } + + /* + * Setup AST getters. + * The goal is to check whether or not AST was modified when + * running the rule under test. + */ + configs.push({ + plugins: { + "rule-tester": { + rules: { + "validate-ast": { + create() { + return { + Program(node) { + beforeAST = cloneDeeplyExcludesParent(node); + }, + "Program:exit"(node) { + afterAST = node; + } + }; + } + } + } + } + } + }); + + if (schema) { + ajv.validateSchema(schema); + + if (ajv.errors) { + const errors = ajv.errors.map(error => { + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `\t${field}: ${error.message}`; + }).join("\n"); + + throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]); + } + + /* + * `ajv.validateSchema` checks for errors in the structure of the schema (by comparing the schema against a "meta-schema"), + * and it reports those errors individually. However, there are other types of schema errors that only occur when compiling + * the schema (e.g. using invalid defaults in a schema), and only one of these errors can be reported at a time. As a result, + * the schema is compiled here separately from checking for `validateSchema` errors. + */ + try { + ajv.compile(schema); + } catch (err) { + throw new Error(`Schema for rule ${ruleName} is invalid: ${err.message}`); + } + } + + // check for validation errors + try { + configs.normalizeSync(); + configs.getConfig("test.js"); + } catch (error) { + error.message = `ESLint configuration in rule-tester is invalid: ${error.message}`; + throw error; + } + + // Verify the code. + const { applyLanguageOptions, applyInlineConfig, finalize } = SourceCode.prototype; + let messages; + + try { + forbiddenMethods.forEach(methodName => { + SourceCode.prototype[methodName] = throwForbiddenMethodError(methodName, SourceCode.prototype); + }); + + messages = linter.verify(code, configs, filename); + } finally { + SourceCode.prototype.applyInlineConfig = applyInlineConfig; + SourceCode.prototype.applyLanguageOptions = applyLanguageOptions; + SourceCode.prototype.finalize = finalize; + } + + + const fatalErrorMessage = messages.find(m => m.fatal); + + assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`); + + // Verify if autofix makes a syntax error or not. + if (messages.some(m => m.fix)) { + output = SourceCodeFixer.applyFixes(code, messages).output; + const errorMessageInFix = linter.verify(output, configs, filename).find(m => m.fatal); + + assert(!errorMessageInFix, [ + "A fatal parsing error occurred in autofix.", + `Error: ${errorMessageInFix && errorMessageInFix.message}`, + "Autofix output:", + output + ].join("\n")); + } else { + output = code; + } + + return { + messages, + output, + beforeAST, + afterAST: cloneDeeplyExcludesParent(afterAST), + configs, + filename + }; + } + + /** + * Check if the AST was changed + * @param {ASTNode} beforeAST AST node before running + * @param {ASTNode} afterAST AST node after running + * @returns {void} + * @private + */ + function assertASTDidntChange(beforeAST, afterAST) { + if (!equal(beforeAST, afterAST)) { + assert.fail("Rule should not modify AST."); + } + } + + /** + * Check if this test case is a duplicate of one we have seen before. + * @param {string|Object} item test case object + * @param {Set} seenTestCases set of serialized test cases we have seen so far (managed by this function) + * @returns {void} + * @private + */ + function checkDuplicateTestCase(item, seenTestCases) { + if (!isSerializable(item)) { + + /* + * If we can't serialize a test case (because it contains a function, RegExp, etc), skip the check. + * This might happen with properties like: options, plugins, settings, languageOptions.parser, languageOptions.parserOptions. + */ + return; + } + + const normalizedItem = typeof item === "string" ? { code: item } : item; + const serializedTestCase = stringify(normalizedItem, { + replacer(key, value) { + + // "this" is the currently stringified object --> only ignore top-level properties + return (normalizedItem !== this || !duplicationIgnoredParameters.has(key)) ? value : void 0; + } + }); + + assert( + !seenTestCases.has(serializedTestCase), + "detected duplicate test case" + ); + seenTestCases.add(serializedTestCase); + } + + /** + * Check if the template is valid or not + * all valid cases go through this + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testValidTemplate(item) { + const code = typeof item === "object" ? item.code : item; + + assert.ok(typeof code === "string", "Test case must specify a string value for 'code'"); + if (item.name) { + assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string"); + } + + checkDuplicateTestCase(item, seenValidTestCases); + + const result = runRuleForItem(item); + const messages = result.messages; + + assert.strictEqual(messages.length, 0, util.format("Should have no errors but had %d: %s", + messages.length, + util.inspect(messages))); + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /** + * Asserts that the message matches its expected value. If the expected + * value is a regular expression, it is checked against the actual + * value. + * @param {string} actual Actual value + * @param {string|RegExp} expected Expected value + * @returns {void} + * @private + */ + function assertMessageMatches(actual, expected) { + if (expected instanceof RegExp) { + + // assert.js doesn't have a built-in RegExp match function + assert.ok( + expected.test(actual), + `Expected '${actual}' to match ${expected}` + ); + } else { + assert.strictEqual(actual, expected); + } + } + + /** + * Check if the template is invalid or not + * all invalid cases go through this. + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testInvalidTemplate(item) { + assert.ok(typeof item.code === "string", "Test case must specify a string value for 'code'"); + if (item.name) { + assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string"); + } + assert.ok(item.errors || item.errors === 0, + `Did not specify errors for an invalid test of ${ruleName}`); + + if (Array.isArray(item.errors) && item.errors.length === 0) { + assert.fail("Invalid cases must have at least one error"); + } + + checkDuplicateTestCase(item, seenInvalidTestCases); + + const ruleHasMetaMessages = hasOwnProperty(rule, "meta") && hasOwnProperty(rule.meta, "messages"); + const friendlyIDList = ruleHasMetaMessages ? `[${Object.keys(rule.meta.messages).map(key => `'${key}'`).join(", ")}]` : null; + + const result = runRuleForItem(item); + const messages = result.messages; + + for (const message of messages) { + if (hasOwnProperty(message, "suggestions")) { + + /** @type {Map} */ + const seenMessageIndices = new Map(); + + for (let i = 0; i < message.suggestions.length; i += 1) { + const suggestionMessage = message.suggestions[i].desc; + const previous = seenMessageIndices.get(suggestionMessage); + + assert.ok(!seenMessageIndices.has(suggestionMessage), `Suggestion message '${suggestionMessage}' reported from suggestion ${i} was previously reported by suggestion ${previous}. Suggestion messages should be unique within an error.`); + seenMessageIndices.set(suggestionMessage, i); + } + } + } + + if (typeof item.errors === "number") { + + if (item.errors === 0) { + assert.fail("Invalid cases must have 'error' value greater than 0"); + } + + assert.strictEqual(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s", + item.errors, + item.errors === 1 ? "" : "s", + messages.length, + util.inspect(messages))); + } else { + assert.strictEqual( + messages.length, item.errors.length, util.format( + "Should have %d error%s but had %d: %s", + item.errors.length, + item.errors.length === 1 ? "" : "s", + messages.length, + util.inspect(messages) + ) + ); + + const hasMessageOfThisRule = messages.some(m => m.ruleId === ruleId); + + for (let i = 0, l = item.errors.length; i < l; i++) { + const error = item.errors[i]; + const message = messages[i]; + + assert(hasMessageOfThisRule, "Error rule name should be the same as the name of the rule being tested"); + + if (typeof error === "string" || error instanceof RegExp) { + + // Just an error message. + assertMessageMatches(message.message, error); + assert.ok(message.suggestions === void 0, `Error at index ${i} has suggestions. Please convert the test error into an object and specify 'suggestions' property on it to test suggestions.`); + } else if (typeof error === "object" && error !== null) { + + /* + * Error object. + * This may have a message, messageId, data, node type, line, and/or + * column. + */ + + Object.keys(error).forEach(propertyName => { + assert.ok( + errorObjectParameters.has(propertyName), + `Invalid error property name '${propertyName}'. Expected one of ${friendlyErrorObjectParameterList}.` + ); + }); + + if (hasOwnProperty(error, "message")) { + assert.ok(!hasOwnProperty(error, "messageId"), "Error should not specify both 'message' and a 'messageId'."); + assert.ok(!hasOwnProperty(error, "data"), "Error should not specify both 'data' and 'message'."); + assertMessageMatches(message.message, error.message); + } else if (hasOwnProperty(error, "messageId")) { + assert.ok( + ruleHasMetaMessages, + "Error can not use 'messageId' if rule under test doesn't define 'meta.messages'." + ); + if (!hasOwnProperty(rule.meta.messages, error.messageId)) { + assert(false, `Invalid messageId '${error.messageId}'. Expected one of ${friendlyIDList}.`); + } + assert.strictEqual( + message.messageId, + error.messageId, + `messageId '${message.messageId}' does not match expected messageId '${error.messageId}'.` + ); + + const unsubstitutedPlaceholders = getUnsubstitutedMessagePlaceholders( + message.message, + rule.meta.messages[message.messageId], + error.data + ); + + assert.ok( + unsubstitutedPlaceholders.length === 0, + `The reported message has ${unsubstitutedPlaceholders.length > 1 ? `unsubstituted placeholders: ${unsubstitutedPlaceholders.map(name => `'${name}'`).join(", ")}` : `an unsubstituted placeholder '${unsubstitutedPlaceholders[0]}'`}. Please provide the missing ${unsubstitutedPlaceholders.length > 1 ? "values" : "value"} via the 'data' property in the context.report() call.` + ); + + if (hasOwnProperty(error, "data")) { + + /* + * if data was provided, then directly compare the returned message to a synthetic + * interpolated message using the same message ID and data provided in the test. + * See https://github.com/eslint/eslint/issues/9890 for context. + */ + const unformattedOriginalMessage = rule.meta.messages[error.messageId]; + const rehydratedMessage = interpolate(unformattedOriginalMessage, error.data); + + assert.strictEqual( + message.message, + rehydratedMessage, + `Hydrated message "${rehydratedMessage}" does not match "${message.message}"` + ); + } + } else { + assert.fail("Test error must specify either a 'messageId' or 'message'."); + } + + if (error.type) { + assert.strictEqual(message.nodeType, error.type, `Error type should be ${error.type}, found ${message.nodeType}`); + } + + if (hasOwnProperty(error, "line")) { + assert.strictEqual(message.line, error.line, `Error line should be ${error.line}`); + } + + if (hasOwnProperty(error, "column")) { + assert.strictEqual(message.column, error.column, `Error column should be ${error.column}`); + } + + if (hasOwnProperty(error, "endLine")) { + assert.strictEqual(message.endLine, error.endLine, `Error endLine should be ${error.endLine}`); + } + + if (hasOwnProperty(error, "endColumn")) { + assert.strictEqual(message.endColumn, error.endColumn, `Error endColumn should be ${error.endColumn}`); + } + + assert.ok(!message.suggestions || hasOwnProperty(error, "suggestions"), `Error at index ${i} has suggestions. Please specify 'suggestions' property on the test error object.`); + if (hasOwnProperty(error, "suggestions")) { + + // Support asserting there are no suggestions + const expectsSuggestions = Array.isArray(error.suggestions) ? error.suggestions.length > 0 : Boolean(error.suggestions); + const hasSuggestions = message.suggestions !== void 0; + + if (!hasSuggestions && expectsSuggestions) { + assert.ok(!error.suggestions, `Error should have suggestions on error with message: "${message.message}"`); + } else if (hasSuggestions) { + assert.ok(expectsSuggestions, `Error should have no suggestions on error with message: "${message.message}"`); + if (typeof error.suggestions === "number") { + assert.strictEqual(message.suggestions.length, error.suggestions, `Error should have ${error.suggestions} suggestions. Instead found ${message.suggestions.length} suggestions`); + } else if (Array.isArray(error.suggestions)) { + assert.strictEqual(message.suggestions.length, error.suggestions.length, `Error should have ${error.suggestions.length} suggestions. Instead found ${message.suggestions.length} suggestions`); + + error.suggestions.forEach((expectedSuggestion, index) => { + assert.ok( + typeof expectedSuggestion === "object" && expectedSuggestion !== null, + "Test suggestion in 'suggestions' array must be an object." + ); + Object.keys(expectedSuggestion).forEach(propertyName => { + assert.ok( + suggestionObjectParameters.has(propertyName), + `Invalid suggestion property name '${propertyName}'. Expected one of ${friendlySuggestionObjectParameterList}.` + ); + }); + + const actualSuggestion = message.suggestions[index]; + const suggestionPrefix = `Error Suggestion at index ${index}:`; + + if (hasOwnProperty(expectedSuggestion, "desc")) { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test should not specify both 'desc' and 'data'.` + ); + assert.ok( + !hasOwnProperty(expectedSuggestion, "messageId"), + `${suggestionPrefix} Test should not specify both 'desc' and 'messageId'.` + ); + assert.strictEqual( + actualSuggestion.desc, + expectedSuggestion.desc, + `${suggestionPrefix} desc should be "${expectedSuggestion.desc}" but got "${actualSuggestion.desc}" instead.` + ); + } else if (hasOwnProperty(expectedSuggestion, "messageId")) { + assert.ok( + ruleHasMetaMessages, + `${suggestionPrefix} Test can not use 'messageId' if rule under test doesn't define 'meta.messages'.` + ); + assert.ok( + hasOwnProperty(rule.meta.messages, expectedSuggestion.messageId), + `${suggestionPrefix} Test has invalid messageId '${expectedSuggestion.messageId}', the rule under test allows only one of ${friendlyIDList}.` + ); + assert.strictEqual( + actualSuggestion.messageId, + expectedSuggestion.messageId, + `${suggestionPrefix} messageId should be '${expectedSuggestion.messageId}' but got '${actualSuggestion.messageId}' instead.` + ); + + const unsubstitutedPlaceholders = getUnsubstitutedMessagePlaceholders( + actualSuggestion.desc, + rule.meta.messages[expectedSuggestion.messageId], + expectedSuggestion.data + ); + + assert.ok( + unsubstitutedPlaceholders.length === 0, + `The message of the suggestion has ${unsubstitutedPlaceholders.length > 1 ? `unsubstituted placeholders: ${unsubstitutedPlaceholders.map(name => `'${name}'`).join(", ")}` : `an unsubstituted placeholder '${unsubstitutedPlaceholders[0]}'`}. Please provide the missing ${unsubstitutedPlaceholders.length > 1 ? "values" : "value"} via the 'data' property for the suggestion in the context.report() call.` + ); + + if (hasOwnProperty(expectedSuggestion, "data")) { + const unformattedMetaMessage = rule.meta.messages[expectedSuggestion.messageId]; + const rehydratedDesc = interpolate(unformattedMetaMessage, expectedSuggestion.data); + + assert.strictEqual( + actualSuggestion.desc, + rehydratedDesc, + `${suggestionPrefix} Hydrated test desc "${rehydratedDesc}" does not match received desc "${actualSuggestion.desc}".` + ); + } + } else if (hasOwnProperty(expectedSuggestion, "data")) { + assert.fail( + `${suggestionPrefix} Test must specify 'messageId' if 'data' is used.` + ); + } else { + assert.fail( + `${suggestionPrefix} Test must specify either 'messageId' or 'desc'.` + ); + } + + assert.ok(hasOwnProperty(expectedSuggestion, "output"), `${suggestionPrefix} The "output" property is required.`); + const codeWithAppliedSuggestion = SourceCodeFixer.applyFixes(item.code, [actualSuggestion]).output; + + // Verify if suggestion fix makes a syntax error or not. + const errorMessageInSuggestion = + linter.verify(codeWithAppliedSuggestion, result.configs, result.filename).find(m => m.fatal); + + assert(!errorMessageInSuggestion, [ + "A fatal parsing error occurred in suggestion fix.", + `Error: ${errorMessageInSuggestion && errorMessageInSuggestion.message}`, + "Suggestion output:", + codeWithAppliedSuggestion + ].join("\n")); + + assert.strictEqual(codeWithAppliedSuggestion, expectedSuggestion.output, `Expected the applied suggestion fix to match the test suggestion output for suggestion at index: ${index} on error with message: "${message.message}"`); + assert.notStrictEqual(expectedSuggestion.output, item.code, `The output of a suggestion should differ from the original source code for suggestion at index: ${index} on error with message: "${message.message}"`); + }); + } else { + assert.fail("Test error object property 'suggestions' should be an array or a number"); + } + } + } + } else { + + // Message was an unexpected type + assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`); + } + } + } + + if (hasOwnProperty(item, "output")) { + if (item.output === null) { + assert.strictEqual( + result.output, + item.code, + "Expected no autofixes to be suggested" + ); + } else { + assert.strictEqual(result.output, item.output, "Output is incorrect."); + assert.notStrictEqual(item.code, item.output, "Test property 'output' matches 'code'. If no autofix is expected, then omit the 'output' property or set it to null."); + } + } else { + assert.strictEqual( + result.output, + item.code, + "The rule fixed the code. Please add 'output' property." + ); + } + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /* + * This creates a mocha test suite and pipes all supplied info through + * one of the templates above. + * The test suites for valid/invalid are created conditionally as + * test runners (eg. vitest) fail for empty test suites. + */ + this.constructor.describe(ruleName, () => { + if (test.valid.length > 0) { + this.constructor.describe("valid", () => { + test.valid.forEach(valid => { + this.constructor[valid.only ? "itOnly" : "it"]( + sanitize(typeof valid === "object" ? valid.name || valid.code : valid), + () => { + try { + runHook(valid, "before"); + testValidTemplate(valid); + } finally { + runHook(valid, "after"); + } + } + ); + }); + }); + } + + if (test.invalid.length > 0) { + this.constructor.describe("invalid", () => { + test.invalid.forEach(invalid => { + this.constructor[invalid.only ? "itOnly" : "it"]( + sanitize(invalid.name || invalid.code), + () => { + try { + runHook(invalid, "before"); + testInvalidTemplate(invalid); + } finally { + runHook(invalid, "after"); + } + } + ); + }); + }); + } + }); + } +} + +RuleTester[DESCRIBE] = RuleTester[IT] = RuleTester[IT_ONLY] = null; + +module.exports = RuleTester; diff --git a/node_modules/eslint/lib/rules/accessor-pairs.js b/node_modules/eslint/lib/rules/accessor-pairs.js new file mode 100644 index 0000000..e95c7d0 --- /dev/null +++ b/node_modules/eslint/lib/rules/accessor-pairs.js @@ -0,0 +1,350 @@ +/** + * @fileoverview Rule to enforce getter and setter pairs in objects and classes. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + +/** + * Checks whether or not a given node is an argument of a specified method call. + * @param {ASTNode} node A node to check. + * @param {number} index An expected index of the node in arguments. + * @param {string} object An expected name of the object of the method. + * @param {string} property An expected name of the method. + * @returns {boolean} `true` if the node is an argument of the specified method call. + */ +function isArgumentOfMethodCall(node, index, object, property) { + const parent = node.parent; + + return ( + parent.type === "CallExpression" && + astUtils.isSpecificMemberAccess(parent.callee, object, property) && + parent.arguments[index] === node + ); +} + +/** + * Checks whether or not a given node is a property descriptor. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node) { + + // Object.defineProperty(obj, "foo", {set: ...}) + if (isArgumentOfMethodCall(node, 2, "Object", "defineProperty") || + isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty") + ) { + return true; + } + + /* + * Object.defineProperties(obj, {foo: {set: ...}}) + * Object.create(proto, {foo: {set: ...}}) + */ + const grandparent = node.parent.parent; + + return grandparent.type === "ObjectExpression" && ( + isArgumentOfMethodCall(grandparent, 1, "Object", "create") || + isArgumentOfMethodCall(grandparent, 1, "Object", "defineProperties") + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + enforceForClassMembers: true, + getWithoutSet: false, + setWithoutGet: true + }], + + docs: { + description: "Enforce getter and setter pairs in objects and classes", + recommended: false, + url: "https://eslint.org/docs/latest/rules/accessor-pairs" + }, + + schema: [{ + type: "object", + properties: { + getWithoutSet: { + type: "boolean" + }, + setWithoutGet: { + type: "boolean" + }, + enforceForClassMembers: { + type: "boolean" + } + }, + additionalProperties: false + }], + + messages: { + missingGetterInPropertyDescriptor: "Getter is not present in property descriptor.", + missingSetterInPropertyDescriptor: "Setter is not present in property descriptor.", + missingGetterInObjectLiteral: "Getter is not present for {{ name }}.", + missingSetterInObjectLiteral: "Setter is not present for {{ name }}.", + missingGetterInClass: "Getter is not present for class {{ name }}.", + missingSetterInClass: "Setter is not present for class {{ name }}." + } + }, + create(context) { + const [{ + getWithoutSet: checkGetWithoutSet, + setWithoutGet: checkSetWithoutGet, + enforceForClassMembers + }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Reports the given node. + * @param {ASTNode} node The node to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function report(node, messageKind) { + if (node.type === "Property") { + context.report({ + node, + messageId: `${messageKind}InObjectLiteral`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else if (node.type === "MethodDefinition") { + context.report({ + node, + messageId: `${messageKind}InClass`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else { + context.report({ + node, + messageId: `${messageKind}InPropertyDescriptor` + }); + } + } + + /** + * Reports each of the nodes in the given list using the same messageId. + * @param {ASTNode[]} nodes Nodes to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function reportList(nodes, messageKind) { + for (const node of nodes) { + report(node, messageKind); + } + } + + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @returns {void} + * @private + */ + function checkList(nodes) { + const accessors = []; + let found = false; + + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + + if (isAccessorKind(node)) { + + // Creates a new `AccessorData` object for the given getter or setter node. + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + // Merges the given `AccessorData` object into the given accessors list. + for (let j = 0; j < accessors.length; j++) { + const accessor = accessors[j]; + + if (areEqualKeys(accessor.key, key)) { + accessor.getters.push(...node.kind === "get" ? [node] : []); + accessor.setters.push(...node.kind === "set" ? [node] : []); + found = true; + break; + } + } + if (!found) { + accessors.push({ + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }); + } + found = false; + } + } + + for (const { getters, setters } of accessors) { + if (checkSetWithoutGet && setters.length && !getters.length) { + reportList(setters, "missingGetter"); + } + if (checkGetWithoutSet && getters.length && !setters.length) { + reportList(getters, "missingSetter"); + } + } + } + + /** + * Checks accessor pairs in an object literal. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectLiteral(node) { + checkList(node.properties.filter(p => p.type === "Property")); + } + + /** + * Checks accessor pairs in a property descriptor. + * @param {ASTNode} node Property descriptor `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkPropertyDescriptor(node) { + const namesToCheck = new Set(node.properties + .filter(p => p.type === "Property" && p.kind === "init" && !p.computed) + .map(({ key }) => key.name)); + + const hasGetter = namesToCheck.has("get"); + const hasSetter = namesToCheck.has("set"); + + if (checkSetWithoutGet && hasSetter && !hasGetter) { + report(node, "missingGetter"); + } + if (checkGetWithoutSet && hasGetter && !hasSetter) { + report(node, "missingSetter"); + } + } + + /** + * Checks the given object expression as an object literal and as a possible property descriptor. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectExpression(node) { + checkObjectLiteral(node); + if (isPropertyDescriptor(node)) { + checkPropertyDescriptor(node); + } + } + + /** + * Checks the given class body. + * @param {ASTNode} node `ClassBody` node to check. + * @returns {void} + * @private + */ + function checkClassBody(node) { + const methodDefinitions = node.body.filter(m => m.type === "MethodDefinition"); + + checkList(methodDefinitions.filter(m => m.static)); + checkList(methodDefinitions.filter(m => !m.static)); + } + + const listeners = {}; + + if (checkSetWithoutGet || checkGetWithoutSet) { + listeners.ObjectExpression = checkObjectExpression; + if (enforceForClassMembers) { + listeners.ClassBody = checkClassBody; + } + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/array-bracket-newline.js b/node_modules/eslint/lib/rules/array-bracket-newline.js new file mode 100644 index 0000000..328ca05 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-bracket-newline.js @@ -0,0 +1,279 @@ +/** + * @fileoverview Rule to enforce linebreaks after open and before close array brackets + * @author Jan Peer Stöcklmair + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "array-bracket-newline", + url: "https://eslint.style/rules/js/array-bracket-newline" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce linebreaks after opening and before closing array brackets", + recommended: false, + url: "https://eslint.org/docs/latest/rules/array-bracket-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consistent"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minItems: { + type: ["integer", "null"], + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedOpeningLinebreak: "There should be no linebreak after '['.", + unexpectedClosingLinebreak: "There should be no linebreak before ']'.", + missingOpeningLinebreak: "A linebreak is required after '['.", + missingClosingLinebreak: "A linebreak is required before ']'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} option An option value to parse. + * @returns {{multiline: boolean, minItems: number}} Normalized option object. + */ + function normalizeOptionValue(option) { + let consistent = false; + let multiline = false; + let minItems; + + if (option) { + if (option === "consistent") { + consistent = true; + minItems = Number.POSITIVE_INFINITY; + } else if (option === "always" || option.minItems === 0) { + minItems = 0; + } else if (option === "never") { + minItems = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(option.multiline); + minItems = option.minItems || Number.POSITIVE_INFINITY; + } + } else { + consistent = false; + multiline = true; + minItems = Number.POSITIVE_INFINITY; + } + + return { consistent, multiline, minItems }; + } + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. + */ + function normalizeOptions(options) { + const value = normalizeOptionValue(options); + + return { ArrayExpression: value, ArrayPattern: value }; + } + + /** + * Reports that there shouldn't be a linebreak after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "unexpectedOpeningLinebreak", + fix(fixer) { + const nextToken = sourceCode.getTokenAfter(token, { includeComments: true }); + + if (astUtils.isCommentToken(nextToken)) { + return null; + } + + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a linebreak before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "unexpectedClosingLinebreak", + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(token, { includeComments: true }); + + if (astUtils.isCommentToken(previousToken)) { + return null; + } + + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a linebreak after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingOpeningLinebreak", + fix(fixer) { + return fixer.insertTextAfter(token, "\n"); + } + }); + } + + /** + * Reports that there should be a linebreak before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingClosingLinebreak", + fix(fixer) { + return fixer.insertTextBefore(token, "\n"); + } + }); + } + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ArrayExpression node or an ArrayPattern node. + * @returns {void} + */ + function check(node) { + const elements = node.elements; + const normalizedOptions = normalizeOptions(context.options[0]); + const options = normalizedOptions[node.type]; + const openBracket = sourceCode.getFirstToken(node); + const closeBracket = sourceCode.getLastToken(node); + const firstIncComment = sourceCode.getTokenAfter(openBracket, { includeComments: true }); + const lastIncComment = sourceCode.getTokenBefore(closeBracket, { includeComments: true }); + const first = sourceCode.getTokenAfter(openBracket); + const last = sourceCode.getTokenBefore(closeBracket); + + const needsLinebreaks = ( + elements.length >= options.minItems || + ( + options.multiline && + elements.length > 0 && + firstIncComment.loc.start.line !== lastIncComment.loc.end.line + ) || + ( + elements.length === 0 && + firstIncComment.type === "Block" && + firstIncComment.loc.start.line !== lastIncComment.loc.end.line && + firstIncComment === lastIncComment + ) || + ( + options.consistent && + openBracket.loc.end.line !== first.loc.start.line + ) + ); + + /* + * Use tokens or comments to check multiline or not. + * But use only tokens to check whether linebreaks are needed. + * This allows: + * var arr = [ // eslint-disable-line foo + * 'a' + * ] + */ + + if (needsLinebreaks) { + if (astUtils.isTokenOnSameLine(openBracket, first)) { + reportRequiredBeginningLinebreak(node, openBracket); + } + if (astUtils.isTokenOnSameLine(last, closeBracket)) { + reportRequiredEndingLinebreak(node, closeBracket); + } + } else { + if (!astUtils.isTokenOnSameLine(openBracket, first)) { + reportNoBeginningLinebreak(node, openBracket); + } + if (!astUtils.isTokenOnSameLine(last, closeBracket)) { + reportNoEndingLinebreak(node, closeBracket); + } + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + ArrayPattern: check, + ArrayExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-bracket-spacing.js b/node_modules/eslint/lib/rules/array-bracket-spacing.js new file mode 100644 index 0000000..f61addb --- /dev/null +++ b/node_modules/eslint/lib/rules/array-bracket-spacing.js @@ -0,0 +1,262 @@ +/** + * @fileoverview Disallows or enforces spaces inside of array brackets. + * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "array-bracket-spacing", + url: "https://eslint.style/rules/js/array-bracket-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing inside array brackets", + recommended: false, + url: "https://eslint.org/docs/latest/rules/array-bracket-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + singleValue: { + type: "boolean" + }, + objectsInArrays: { + type: "boolean" + }, + arraysInArrays: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceAfter: "There should be no space after '{{tokenValue}}'.", + unexpectedSpaceBefore: "There should be no space before '{{tokenValue}}'.", + missingSpaceAfter: "A space is required after '{{tokenValue}}'.", + missingSpaceBefore: "A space is required before '{{tokenValue}}'." + } + }, + create(context) { + const spaced = context.options[0] === "always", + sourceCode = context.sourceCode; + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + const options = { + spaced, + singleElementException: isOptionSet("singleValue"), + objectsInArraysException: isOptionSet("objectsInArrays"), + arraysInArraysException: isOptionSet("arraysInArrays") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + const nextToken = sourceCode.getTokenAfter(token); + + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + const previousToken = sourceCode.getTokenBefore(token); + + context.report({ + node, + loc: { start: previousToken.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if a node is an object type + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an object type. + */ + function isObjectType(node) { + return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern"); + } + + /** + * Determines if a node is an array type + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an array type. + */ + function isArrayType(node) { + return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + } + + /** + * Validates the spacing around array brackets + * @param {ASTNode} node The node we're checking for spacing + * @returns {void} + */ + function validateArraySpacing(node) { + if (options.spaced && node.elements.length === 0) { + return; + } + + const first = sourceCode.getFirstToken(node), + second = sourceCode.getFirstToken(node, 1), + last = node.typeAnnotation + ? sourceCode.getTokenBefore(node.typeAnnotation) + : sourceCode.getLastToken(node), + penultimate = sourceCode.getTokenBefore(last), + firstElement = node.elements[0], + lastElement = node.elements.at(-1); + + const openingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(firstElement) || + options.arraysInArraysException && isArrayType(firstElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + const closingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(lastElement) || + options.arraysInArraysException && isArrayType(lastElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + if (astUtils.isTokenOnSameLine(first, second)) { + if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) { + reportNoBeginningSpace(node, first); + } + } + + if (first !== penultimate && astUtils.isTokenOnSameLine(penultimate, last)) { + if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ArrayPattern: validateArraySpacing, + ArrayExpression: validateArraySpacing + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-callback-return.js b/node_modules/eslint/lib/rules/array-callback-return.js new file mode 100644 index 0000000..974fea8 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-callback-return.js @@ -0,0 +1,448 @@ +/** + * @fileoverview Rule to enforce return statements in callbacks of array's methods + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; +const TARGET_METHODS = /^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort|toSorted)$/u; + +/** + * Checks a given node is a member access which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a member access which has + * the specified name's property. The node may be a `(Chain|Member)Expression` node. + */ +function isTargetMethod(node) { + return astUtils.isSpecificMemberAccess(node, null, TARGET_METHODS); +} + +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + +/** + * Returns a human-legible description of an array method + * @param {string} arrayMethodName A method name to fully qualify + * @returns {string} the method name prefixed with `Array.` if it is a class method, + * or else `Array.prototype.` if it is an instance method. + */ +function fullMethodName(arrayMethodName) { + if (["from", "of", "isArray"].includes(arrayMethodName)) { + return "Array.".concat(arrayMethodName); + } + return "Array.prototype.".concat(arrayMethodName); +} + +/** + * Checks whether or not a given node is a function expression which is the + * callback of an array method, returning the method name. + * @param {ASTNode} node A node to check. This is one of + * FunctionExpression or ArrowFunctionExpression. + * @returns {string} The method name if the node is a callback method, + * null otherwise. + */ +function getArrayMethodName(node) { + let currentNode = node; + + while (currentNode) { + const parent = currentNode.parent; + + switch (parent.type) { + + /* + * Looks up the destination. e.g., + * foo.every(nativeFoo || function foo() { ... }); + */ + case "LogicalExpression": + case "ConditionalExpression": + case "ChainExpression": + currentNode = parent; + break; + + /* + * If the upper function is IIFE, checks the destination of the return value. + * e.g. + * foo.every((function() { + * // setup... + * return function callback() { ... }; + * })()); + */ + case "ReturnStatement": { + const func = astUtils.getUpperFunction(parent); + + if (func === null || !astUtils.isCallee(func)) { + return null; + } + currentNode = func.parent; + break; + } + + /* + * e.g. + * Array.from([], function() {}); + * list.every(function() {}); + */ + case "CallExpression": + if (astUtils.isArrayFromMethod(parent.callee)) { + if ( + parent.arguments.length >= 2 && + parent.arguments[1] === currentNode + ) { + return "from"; + } + } + if (isTargetMethod(parent.callee)) { + if ( + parent.arguments.length >= 1 && + parent.arguments[0] === currentNode + ) { + return astUtils.getStaticPropertyName(parent.callee); + } + } + return null; + + // Otherwise this node is not target. + default: + return null; + } + } + + /* c8 ignore next */ + return null; +} + +/** + * Checks if the given node is a void expression. + * @param {ASTNode} node The node to check. + * @returns {boolean} - `true` if the node is a void expression + */ +function isExpressionVoid(node) { + return node.type === "UnaryExpression" && node.operator === "void"; +} + +/** + * Fixes the linting error by prepending "void " to the given node + * @param {Object} sourceCode context given by context.sourceCode + * @param {ASTNode} node The node to fix. + * @param {Object} fixer The fixer object provided by ESLint. + * @returns {Array} - An array of fix objects to apply to the node. + */ +function voidPrependFixer(sourceCode, node, fixer) { + + const requiresParens = + + // prepending `void ` will fail if the node has a lower precedence than void + astUtils.getPrecedence(node) < astUtils.getPrecedence({ type: "UnaryExpression", operator: "void" }) && + + // check if there are parentheses around the node to avoid redundant parentheses + !astUtils.isParenthesised(sourceCode, node); + + // avoid parentheses issues + const returnOrArrowToken = sourceCode.getTokenBefore( + node, + node.parent.type === "ArrowFunctionExpression" + ? astUtils.isArrowToken + + // isReturnToken + : token => token.type === "Keyword" && token.value === "return" + ); + + const firstToken = sourceCode.getTokenAfter(returnOrArrowToken); + + const prependSpace = + + // is return token, as => allows void to be adjacent + returnOrArrowToken.value === "return" && + + // If two tokens (return and "(") are adjacent + returnOrArrowToken.range[1] === firstToken.range[0]; + + return [ + fixer.insertTextBefore(firstToken, `${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`), + fixer.insertTextAfter(node, requiresParens ? ")" : "") + ]; +} + +/** + * Fixes the linting error by `wrapping {}` around the given node's body. + * @param {Object} sourceCode context given by context.sourceCode + * @param {ASTNode} node The node to fix. + * @param {Object} fixer The fixer object provided by ESLint. + * @returns {Array} - An array of fix objects to apply to the node. + */ +function curlyWrapFixer(sourceCode, node, fixer) { + const arrowToken = sourceCode.getTokenBefore(node.body, astUtils.isArrowToken); + const firstToken = sourceCode.getTokenAfter(arrowToken); + const lastToken = sourceCode.getLastToken(node); + + return [ + fixer.insertTextBefore(firstToken, "{"), + fixer.insertTextAfter(lastToken, "}") + ]; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + allowImplicit: false, + checkForEach: false, + allowVoid: false + }], + + docs: { + description: "Enforce `return` statements in callbacks of array methods", + recommended: false, + url: "https://eslint.org/docs/latest/rules/array-callback-return" + }, + + // eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- false positive + hasSuggestions: true, + + schema: [ + { + type: "object", + properties: { + allowImplicit: { + type: "boolean" + }, + checkForEach: { + type: "boolean" + }, + allowVoid: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + expectedAtEnd: "{{arrayMethodName}}() expects a value to be returned at the end of {{name}}.", + expectedInside: "{{arrayMethodName}}() expects a return value from {{name}}.", + expectedReturnValue: "{{arrayMethodName}}() expects a return value from {{name}}.", + expectedNoReturnValue: "{{arrayMethodName}}() expects no useless return value from {{name}}.", + wrapBraces: "Wrap the expression in `{}`.", + prependVoid: "Prepend `void` to the expression." + } + }, + + create(context) { + const [options] = context.options; + const sourceCode = context.sourceCode; + + let funcInfo = { + arrayMethodName: null, + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false, + node: null + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + + if (!funcInfo.shouldCheck) { + return; + } + + const messageAndSuggestions = { messageId: "", suggest: [] }; + + if (funcInfo.arrayMethodName === "forEach") { + if (options.checkForEach && node.type === "ArrowFunctionExpression" && node.expression) { + + if (options.allowVoid) { + if (isExpressionVoid(node.body)) { + return; + } + + messageAndSuggestions.messageId = "expectedNoReturnValue"; + messageAndSuggestions.suggest = [ + { + messageId: "wrapBraces", + fix(fixer) { + return curlyWrapFixer(sourceCode, node, fixer); + } + }, + { + messageId: "prependVoid", + fix(fixer) { + return voidPrependFixer(sourceCode, node.body, fixer); + } + } + ]; + } else { + messageAndSuggestions.messageId = "expectedNoReturnValue"; + messageAndSuggestions.suggest = [{ + messageId: "wrapBraces", + fix(fixer) { + return curlyWrapFixer(sourceCode, node, fixer); + } + }]; + } + } + } else { + if (node.body.type === "BlockStatement" && isAnySegmentReachable(funcInfo.currentSegments)) { + messageAndSuggestions.messageId = funcInfo.hasReturn ? "expectedAtEnd" : "expectedInside"; + } + } + + if (messageAndSuggestions.messageId) { + const name = astUtils.getFunctionNameWithKind(node); + + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: messageAndSuggestions.messageId, + data: { name, arrayMethodName: fullMethodName(funcInfo.arrayMethodName) }, + suggest: messageAndSuggestions.suggest.length !== 0 ? messageAndSuggestions.suggest : null + }); + } + } + + return { + + // Stacks this function's information. + onCodePathStart(codePath, node) { + + let methodName = null; + + if (TARGET_NODE_TYPE.test(node.type)) { + methodName = getArrayMethodName(node); + } + + funcInfo = { + arrayMethodName: methodName, + upper: funcInfo, + codePath, + hasReturn: false, + shouldCheck: + methodName && + !node.async && + !node.generator, + node, + currentSegments: new Set() + }; + }, + + // Pops this function's information. + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + + // Checks the return statement is valid. + ReturnStatement(node) { + + if (!funcInfo.shouldCheck) { + return; + } + + funcInfo.hasReturn = true; + + const messageAndSuggestions = { messageId: "", suggest: [] }; + + if (funcInfo.arrayMethodName === "forEach") { + + // if checkForEach: true, returning a value at any path inside a forEach is not allowed + if (options.checkForEach && node.argument) { + + if (options.allowVoid) { + if (isExpressionVoid(node.argument)) { + return; + } + + messageAndSuggestions.messageId = "expectedNoReturnValue"; + messageAndSuggestions.suggest = [{ + messageId: "prependVoid", + fix(fixer) { + return voidPrependFixer(sourceCode, node.argument, fixer); + } + }]; + } else { + messageAndSuggestions.messageId = "expectedNoReturnValue"; + } + } + } else { + + // if allowImplicit: false, should also check node.argument + if (!options.allowImplicit && !node.argument) { + messageAndSuggestions.messageId = "expectedReturnValue"; + } + } + + if (messageAndSuggestions.messageId) { + context.report({ + node, + messageId: messageAndSuggestions.messageId, + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node), + arrayMethodName: fullMethodName(funcInfo.arrayMethodName) + }, + suggest: messageAndSuggestions.suggest.length !== 0 ? messageAndSuggestions.suggest : null + }); + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-element-newline.js b/node_modules/eslint/lib/rules/array-element-newline.js new file mode 100644 index 0000000..dc73959 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-element-newline.js @@ -0,0 +1,329 @@ +/** + * @fileoverview Rule to enforce line breaks after each array element + * @author Jan Peer Stöcklmair + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "array-element-newline", + url: "https://eslint.style/rules/js/array-element-newline" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce line breaks after each array element", + recommended: false, + url: "https://eslint.org/docs/latest/rules/array-element-newline" + }, + + fixable: "whitespace", + + schema: { + definitions: { + basicConfig: { + oneOf: [ + { + enum: ["always", "never", "consistent"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minItems: { + type: ["integer", "null"], + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + }, + type: "array", + items: [ + { + oneOf: [ + { + $ref: "#/definitions/basicConfig" + }, + { + type: "object", + properties: { + ArrayExpression: { + $ref: "#/definitions/basicConfig" + }, + ArrayPattern: { + $ref: "#/definitions/basicConfig" + } + }, + additionalProperties: false, + minProperties: 1 + } + ] + } + ] + }, + + messages: { + unexpectedLineBreak: "There should be no linebreak here.", + missingLineBreak: "There should be a linebreak after this element." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} providedOption An option value to parse. + * @returns {{multiline: boolean, minItems: number}} Normalized option object. + */ + function normalizeOptionValue(providedOption) { + let consistent = false; + let multiline = false; + let minItems; + + const option = providedOption || "always"; + + if (!option || option === "always" || option.minItems === 0) { + minItems = 0; + } else if (option === "never") { + minItems = Number.POSITIVE_INFINITY; + } else if (option === "consistent") { + consistent = true; + minItems = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(option.multiline); + minItems = option.minItems || Number.POSITIVE_INFINITY; + } + + return { consistent, multiline, minItems }; + } + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. + */ + function normalizeOptions(options) { + if (options && (options.ArrayExpression || options.ArrayPattern)) { + let expressionOptions, patternOptions; + + if (options.ArrayExpression) { + expressionOptions = normalizeOptionValue(options.ArrayExpression); + } + + if (options.ArrayPattern) { + patternOptions = normalizeOptionValue(options.ArrayPattern); + } + + return { ArrayExpression: expressionOptions, ArrayPattern: patternOptions }; + } + + const value = normalizeOptionValue(options); + + return { ArrayExpression: value, ArrayPattern: value }; + } + + /** + * Reports that there shouldn't be a line break after the first token + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoLineBreak(token) { + const tokenBefore = sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + loc: { + start: tokenBefore.loc.end, + end: token.loc.start + }, + messageId: "unexpectedLineBreak", + fix(fixer) { + if (astUtils.isCommentToken(tokenBefore)) { + return null; + } + + if (!astUtils.isTokenOnSameLine(tokenBefore, token)) { + return fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " "); + } + + /* + * This will check if the comma is on the same line as the next element + * Following array: + * [ + * 1 + * , 2 + * , 3 + * ] + * + * will be fixed to: + * [ + * 1, 2, 3 + * ] + */ + const twoTokensBefore = sourceCode.getTokenBefore(tokenBefore, { includeComments: true }); + + if (astUtils.isCommentToken(twoTokensBefore)) { + return null; + } + + return fixer.replaceTextRange([twoTokensBefore.range[1], tokenBefore.range[0]], ""); + + } + }); + } + + /** + * Reports that there should be a line break after the first token + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredLineBreak(token) { + const tokenBefore = sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + loc: { + start: tokenBefore.loc.end, + end: token.loc.start + }, + messageId: "missingLineBreak", + fix(fixer) { + return fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n"); + } + }); + } + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ObjectExpression node or an ObjectPattern node. + * @returns {void} + */ + function check(node) { + const elements = node.elements; + const normalizedOptions = normalizeOptions(context.options[0]); + const options = normalizedOptions[node.type]; + + if (!options) { + return; + } + + let elementBreak = false; + + /* + * MULTILINE: true + * loop through every element and check + * if at least one element has linebreaks inside + * this ensures that following is not valid (due to elements are on the same line): + * + * [ + * 1, + * 2, + * 3 + * ] + */ + if (options.multiline) { + elementBreak = elements + .filter(element => element !== null) + .some(element => element.loc.start.line !== element.loc.end.line); + } + + let linebreaksCount = 0; + + for (let i = 0; i < node.elements.length; i++) { + const element = node.elements[i]; + + const previousElement = elements[i - 1]; + + if (i === 0 || element === null || previousElement === null) { + continue; + } + + const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); + const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); + const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); + + if (!astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + linebreaksCount++; + } + } + + const needsLinebreaks = ( + elements.length >= options.minItems || + ( + options.multiline && + elementBreak + ) || + ( + options.consistent && + linebreaksCount > 0 && + linebreaksCount < node.elements.length + ) + ); + + elements.forEach((element, i) => { + const previousElement = elements[i - 1]; + + if (i === 0 || element === null || previousElement === null) { + return; + } + + const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); + const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); + const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); + + if (needsLinebreaks) { + if (astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + reportRequiredLineBreak(firstTokenOfCurrentElement); + } + } else { + if (!astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + reportNoLineBreak(firstTokenOfCurrentElement); + } + } + }); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + ArrayPattern: check, + ArrayExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-body-style.js b/node_modules/eslint/lib/rules/arrow-body-style.js new file mode 100644 index 0000000..4a652dc --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-body-style.js @@ -0,0 +1,299 @@ +/** + * @fileoverview Rule to require braces in arrow function body. + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["as-needed"], + + docs: { + description: "Require braces around arrow function bodies", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/arrow-body-style" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["as-needed"] + }, + { + type: "object", + properties: { + requireReturnForObjectLiteral: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + + messages: { + unexpectedOtherBlock: "Unexpected block statement surrounding arrow body.", + unexpectedEmptyBlock: "Unexpected block statement surrounding arrow body; put a value of `undefined` immediately after the `=>`.", + unexpectedObjectBlock: "Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`.", + unexpectedSingleBlock: "Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.", + expectedBlock: "Expected block statement surrounding arrow body." + } + }, + + create(context) { + const options = context.options; + const always = options[0] === "always"; + const asNeeded = options[0] === "as-needed"; + const never = options[0] === "never"; + const requireReturnForObjectLiteral = options[1] && options[1].requireReturnForObjectLiteral; + const sourceCode = context.sourceCode; + let funcInfo = null; + + /** + * Checks whether the given node has ASI problem or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if it changes semantics if `;` or `}` followed by the token are removed. + */ + function hasASIProblem(token) { + return token && token.type === "Punctuator" && /^[([/`+-]/u.test(token.value); + } + + /** + * Gets the closing parenthesis by the given node. + * @param {ASTNode} node first node after an opening parenthesis. + * @returns {Token} The found closing parenthesis token. + */ + function findClosingParen(node) { + let nodeToCheck = node; + + while (!astUtils.isParenthesised(sourceCode, nodeToCheck)) { + nodeToCheck = nodeToCheck.parent; + } + return sourceCode.getTokenAfter(nodeToCheck); + } + + /** + * Check whether the node is inside of a for loop's init + * @param {ASTNode} node node is inside for loop + * @returns {boolean} `true` if the node is inside of a for loop, else `false` + */ + function isInsideForLoopInitializer(node) { + if (node && node.parent) { + if (node.parent.type === "ForStatement" && node.parent.init === node) { + return true; + } + return isInsideForLoopInitializer(node.parent); + } + return false; + } + + /** + * Determines whether a arrow function body needs braces + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function validate(node) { + const arrowBody = node.body; + + if (arrowBody.type === "BlockStatement") { + const blockBody = arrowBody.body; + + if (blockBody.length !== 1 && !never) { + return; + } + + if (asNeeded && requireReturnForObjectLiteral && blockBody[0].type === "ReturnStatement" && + blockBody[0].argument && blockBody[0].argument.type === "ObjectExpression") { + return; + } + + if (never || asNeeded && blockBody[0].type === "ReturnStatement") { + let messageId; + + if (blockBody.length === 0) { + messageId = "unexpectedEmptyBlock"; + } else if (blockBody.length > 1 || blockBody[0].type !== "ReturnStatement") { + messageId = "unexpectedOtherBlock"; + } else if (blockBody[0].argument === null) { + messageId = "unexpectedSingleBlock"; + } else if (astUtils.isOpeningBraceToken(sourceCode.getFirstToken(blockBody[0], { skip: 1 }))) { + messageId = "unexpectedObjectBlock"; + } else { + messageId = "unexpectedSingleBlock"; + } + + context.report({ + node, + loc: arrowBody.loc, + messageId, + fix(fixer) { + const fixes = []; + + if (blockBody.length !== 1 || + blockBody[0].type !== "ReturnStatement" || + !blockBody[0].argument || + hasASIProblem(sourceCode.getTokenAfter(arrowBody)) + ) { + return fixes; + } + + const openingBrace = sourceCode.getFirstToken(arrowBody); + const closingBrace = sourceCode.getLastToken(arrowBody); + const firstValueToken = sourceCode.getFirstToken(blockBody[0], 1); + const lastValueToken = sourceCode.getLastToken(blockBody[0]); + const commentsExist = + sourceCode.commentsExistBetween(openingBrace, firstValueToken) || + sourceCode.commentsExistBetween(lastValueToken, closingBrace); + + /* + * Remove tokens around the return value. + * If comments don't exist, remove extra spaces as well. + */ + if (commentsExist) { + fixes.push( + fixer.remove(openingBrace), + fixer.remove(closingBrace), + fixer.remove(sourceCode.getTokenAfter(openingBrace)) // return keyword + ); + } else { + fixes.push( + fixer.removeRange([openingBrace.range[0], firstValueToken.range[0]]), + fixer.removeRange([lastValueToken.range[1], closingBrace.range[1]]) + ); + } + + /* + * If the first token of the return value is `{` or the return value is a sequence expression, + * enclose the return value by parentheses to avoid syntax error. + */ + if (astUtils.isOpeningBraceToken(firstValueToken) || blockBody[0].argument.type === "SequenceExpression" || (funcInfo.hasInOperator && isInsideForLoopInitializer(node))) { + if (!astUtils.isParenthesised(sourceCode, blockBody[0].argument)) { + fixes.push( + fixer.insertTextBefore(firstValueToken, "("), + fixer.insertTextAfter(lastValueToken, ")") + ); + } + } + + /* + * If the last token of the return statement is semicolon, remove it. + * Non-block arrow body is an expression, not a statement. + */ + if (astUtils.isSemicolonToken(lastValueToken)) { + fixes.push(fixer.remove(lastValueToken)); + } + + return fixes; + } + }); + } + } else { + if (always || (asNeeded && requireReturnForObjectLiteral && arrowBody.type === "ObjectExpression")) { + context.report({ + node, + loc: arrowBody.loc, + messageId: "expectedBlock", + fix(fixer) { + const fixes = []; + const arrowToken = sourceCode.getTokenBefore(arrowBody, astUtils.isArrowToken); + const [firstTokenAfterArrow, secondTokenAfterArrow] = sourceCode.getTokensAfter(arrowToken, { count: 2 }); + const lastToken = sourceCode.getLastToken(node); + + let parenthesisedObjectLiteral = null; + + if ( + astUtils.isOpeningParenToken(firstTokenAfterArrow) && + astUtils.isOpeningBraceToken(secondTokenAfterArrow) + ) { + const braceNode = sourceCode.getNodeByRangeIndex(secondTokenAfterArrow.range[0]); + + if (braceNode.type === "ObjectExpression") { + parenthesisedObjectLiteral = braceNode; + } + } + + // If the value is object literal, remove parentheses which were forced by syntax. + if (parenthesisedObjectLiteral) { + const openingParenToken = firstTokenAfterArrow; + const openingBraceToken = secondTokenAfterArrow; + + if (astUtils.isTokenOnSameLine(openingParenToken, openingBraceToken)) { + fixes.push(fixer.replaceText(openingParenToken, "{return ")); + } else { + + // Avoid ASI + fixes.push( + fixer.replaceText(openingParenToken, "{"), + fixer.insertTextBefore(openingBraceToken, "return ") + ); + } + + // Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo() + fixes.push(fixer.remove(findClosingParen(parenthesisedObjectLiteral))); + fixes.push(fixer.insertTextAfter(lastToken, "}")); + + } else { + fixes.push(fixer.insertTextBefore(firstTokenAfterArrow, "{return ")); + fixes.push(fixer.insertTextAfter(lastToken, "}")); + } + + return fixes; + } + }); + } + } + } + + return { + "BinaryExpression[operator='in']"() { + let info = funcInfo; + + while (info) { + info.hasInOperator = true; + info = info.upper; + } + }, + ArrowFunctionExpression() { + funcInfo = { + upper: funcInfo, + hasInOperator: false + }; + }, + "ArrowFunctionExpression:exit"(node) { + validate(node); + funcInfo = funcInfo.upper; + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-parens.js b/node_modules/eslint/lib/rules/arrow-parens.js new file mode 100644 index 0000000..2d09416 --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-parens.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to require parens in arrow function arguments. + * @author Jxck + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given arrow function has block body. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {boolean} `true` if the function has block body. + */ +function hasBlockBody(node) { + return node.body.type === "BlockStatement"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "arrow-parens", + url: "https://eslint.style/rules/js/arrow-parens" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require parentheses around arrow function arguments", + recommended: false, + url: "https://eslint.org/docs/latest/rules/arrow-parens" + }, + + fixable: "code", + + schema: [ + { + enum: ["always", "as-needed"] + }, + { + type: "object", + properties: { + requireForBlockBody: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedParens: "Unexpected parentheses around single function argument.", + expectedParens: "Expected parentheses around arrow function argument.", + + unexpectedParensInline: "Unexpected parentheses around single function argument having a body with no curly braces.", + expectedParensBlock: "Expected parentheses around arrow function argument having a body with curly braces." + } + }, + + create(context) { + const asNeeded = context.options[0] === "as-needed"; + const requireForBlockBody = asNeeded && context.options[1] && context.options[1].requireForBlockBody === true; + + const sourceCode = context.sourceCode; + + /** + * Finds opening paren of parameters for the given arrow function, if it exists. + * It is assumed that the given arrow function has exactly one parameter. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {Token|null} the opening paren, or `null` if the given arrow function doesn't have parens of parameters. + */ + function findOpeningParenOfParams(node) { + const tokenBeforeParams = sourceCode.getTokenBefore(node.params[0]); + + if ( + tokenBeforeParams && + astUtils.isOpeningParenToken(tokenBeforeParams) && + node.range[0] <= tokenBeforeParams.range[0] + ) { + return tokenBeforeParams; + } + + return null; + } + + /** + * Finds closing paren of parameters for the given arrow function. + * It is assumed that the given arrow function has parens of parameters and that it has exactly one parameter. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {Token} the closing paren of parameters. + */ + function getClosingParenOfParams(node) { + return sourceCode.getTokenAfter(node.params[0], astUtils.isClosingParenToken); + } + + /** + * Determines whether the given arrow function has comments inside parens of parameters. + * It is assumed that the given arrow function has parens of parameters. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @param {Token} openingParen Opening paren of parameters. + * @returns {boolean} `true` if the function has at least one comment inside of parens of parameters. + */ + function hasCommentsInParensOfParams(node, openingParen) { + return sourceCode.commentsExistBetween(openingParen, getClosingParenOfParams(node)); + } + + /** + * Determines whether the given arrow function has unexpected tokens before opening paren of parameters, + * in which case it will be assumed that the existing parens of parameters are necessary. + * Only tokens within the range of the arrow function (tokens that are part of the arrow function) are taken into account. + * Example: (a) => b + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @param {Token} openingParen Opening paren of parameters. + * @returns {boolean} `true` if the function has at least one unexpected token. + */ + function hasUnexpectedTokensBeforeOpeningParen(node, openingParen) { + const expectedCount = node.async ? 1 : 0; + + return sourceCode.getFirstToken(node, { skip: expectedCount }) !== openingParen; + } + + return { + "ArrowFunctionExpression[params.length=1]"(node) { + const shouldHaveParens = !asNeeded || requireForBlockBody && hasBlockBody(node); + const openingParen = findOpeningParenOfParams(node); + const hasParens = openingParen !== null; + const [param] = node.params; + + if (shouldHaveParens && !hasParens) { + context.report({ + node, + messageId: requireForBlockBody ? "expectedParensBlock" : "expectedParens", + loc: param.loc, + *fix(fixer) { + yield fixer.insertTextBefore(param, "("); + yield fixer.insertTextAfter(param, ")"); + } + }); + } + + if ( + !shouldHaveParens && + hasParens && + param.type === "Identifier" && + !param.typeAnnotation && + !node.returnType && + !hasCommentsInParensOfParams(node, openingParen) && + !hasUnexpectedTokensBeforeOpeningParen(node, openingParen) + ) { + context.report({ + node, + messageId: requireForBlockBody ? "unexpectedParensInline" : "unexpectedParens", + loc: param.loc, + *fix(fixer) { + const tokenBeforeOpeningParen = sourceCode.getTokenBefore(openingParen); + const closingParen = getClosingParenOfParams(node); + + if ( + tokenBeforeOpeningParen && + tokenBeforeOpeningParen.range[1] === openingParen.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeOpeningParen, sourceCode.getFirstToken(param)) + ) { + yield fixer.insertTextBefore(openingParen, " "); + } + + // remove parens, whitespace inside parens, and possible trailing comma + yield fixer.removeRange([openingParen.range[0], param.range[0]]); + yield fixer.removeRange([param.range[1], closingParen.range[1]]); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-spacing.js b/node_modules/eslint/lib/rules/arrow-spacing.js new file mode 100644 index 0000000..93d9763 --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-spacing.js @@ -0,0 +1,182 @@ +/** + * @fileoverview Rule to define spacing before/after arrow function's arrow. + * @author Jxck + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "arrow-spacing", + url: "https://eslint.style/rules/js/arrow-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing before and after the arrow in arrow functions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/arrow-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: true + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + expectedBefore: "Missing space before =>.", + unexpectedBefore: "Unexpected space before =>.", + + expectedAfter: "Missing space after =>.", + unexpectedAfter: "Unexpected space after =>." + } + }, + + create(context) { + + // merge rules with default + const rule = Object.assign({}, context.options[0]); + + rule.before = rule.before !== false; + rule.after = rule.after !== false; + + const sourceCode = context.sourceCode; + + /** + * Get tokens of arrow(`=>`) and before/after arrow. + * @param {ASTNode} node The arrow function node. + * @returns {Object} Tokens of arrow and before/after arrow. + */ + function getTokens(node) { + const arrow = sourceCode.getTokenBefore(node.body, astUtils.isArrowToken); + + return { + before: sourceCode.getTokenBefore(arrow), + arrow, + after: sourceCode.getTokenAfter(arrow) + }; + } + + /** + * Count spaces before/after arrow(`=>`) token. + * @param {Object} tokens Tokens before/after arrow. + * @returns {Object} count of space before/after arrow. + */ + function countSpaces(tokens) { + const before = tokens.arrow.range[0] - tokens.before.range[1]; + const after = tokens.after.range[0] - tokens.arrow.range[1]; + + return { before, after }; + } + + /** + * Determines whether space(s) before after arrow(`=>`) is satisfy rule. + * if before/after value is `true`, there should be space(s). + * if before/after value is `false`, there should be no space. + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function spaces(node) { + const tokens = getTokens(node); + const countSpace = countSpaces(tokens); + + if (rule.before) { + + // should be space(s) before arrow + if (countSpace.before === 0) { + context.report({ + node: tokens.before, + messageId: "expectedBefore", + fix(fixer) { + return fixer.insertTextBefore(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space before arrow + if (countSpace.before > 0) { + context.report({ + node: tokens.before, + messageId: "unexpectedBefore", + fix(fixer) { + return fixer.removeRange([tokens.before.range[1], tokens.arrow.range[0]]); + } + }); + } + } + + if (rule.after) { + + // should be space(s) after arrow + if (countSpace.after === 0) { + context.report({ + node: tokens.after, + messageId: "expectedAfter", + fix(fixer) { + return fixer.insertTextAfter(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space after arrow + if (countSpace.after > 0) { + context.report({ + node: tokens.after, + messageId: "unexpectedAfter", + fix(fixer) { + return fixer.removeRange([tokens.arrow.range[1], tokens.after.range[0]]); + } + }); + } + } + } + + return { + ArrowFunctionExpression: spaces + }; + } +}; diff --git a/node_modules/eslint/lib/rules/block-scoped-var.js b/node_modules/eslint/lib/rules/block-scoped-var.js new file mode 100644 index 0000000..d65fc07 --- /dev/null +++ b/node_modules/eslint/lib/rules/block-scoped-var.js @@ -0,0 +1,135 @@ +/** + * @fileoverview Rule to check for "block scoped" variables by binding context + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce the use of variables within the scope they are defined", + recommended: false, + url: "https://eslint.org/docs/latest/rules/block-scoped-var" + }, + + schema: [], + + messages: { + outOfScope: "'{{name}}' declared on line {{definitionLine}} column {{definitionColumn}} is used outside of binding context." + } + }, + + create(context) { + let stack = []; + const sourceCode = context.sourceCode; + + /** + * Makes a block scope. + * @param {ASTNode} node A node of a scope. + * @returns {void} + */ + function enterScope(node) { + stack.push(node.range); + } + + /** + * Pops the last block scope. + * @returns {void} + */ + function exitScope() { + stack.pop(); + } + + /** + * Reports a given reference. + * @param {eslint-scope.Reference} reference A reference to report. + * @param {eslint-scope.Definition} definition A definition for which to report reference. + * @returns {void} + */ + function report(reference, definition) { + const identifier = reference.identifier; + const definitionPosition = definition.name.loc.start; + + context.report({ + node: identifier, + messageId: "outOfScope", + data: { + name: identifier.name, + definitionLine: definitionPosition.line, + definitionColumn: definitionPosition.column + 1 + } + }); + } + + /** + * Finds and reports references which are outside of valid scopes. + * @param {ASTNode} node A node to get variables. + * @returns {void} + */ + function checkForVariables(node) { + if (node.kind !== "var") { + return; + } + + // Defines a predicate to check whether or not a given reference is outside of valid scope. + const scopeRange = stack.at(-1); + + /** + * Check if a reference is out of scope + * @param {ASTNode} reference node to examine + * @returns {boolean} True is its outside the scope + * @private + */ + function isOutsideOfScope(reference) { + const idRange = reference.identifier.range; + + return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1]; + } + + // Gets declared variables, and checks its references. + const variables = sourceCode.getDeclaredVariables(node); + + for (let i = 0; i < variables.length; ++i) { + + // Reports. + variables[i] + .references + .filter(isOutsideOfScope) + .forEach(ref => report(ref, variables[i].defs.find(def => def.parent === node))); + } + } + + return { + Program(node) { + stack = [node.range]; + }, + + // Manages scopes. + BlockStatement: enterScope, + "BlockStatement:exit": exitScope, + ForStatement: enterScope, + "ForStatement:exit": exitScope, + ForInStatement: enterScope, + "ForInStatement:exit": exitScope, + ForOfStatement: enterScope, + "ForOfStatement:exit": exitScope, + SwitchStatement: enterScope, + "SwitchStatement:exit": exitScope, + CatchClause: enterScope, + "CatchClause:exit": exitScope, + StaticBlock: enterScope, + "StaticBlock:exit": exitScope, + + // Finds and reports references which are outside of valid scope. + VariableDeclaration: checkForVariables + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/block-spacing.js b/node_modules/eslint/lib/rules/block-spacing.js new file mode 100644 index 0000000..98e80bb --- /dev/null +++ b/node_modules/eslint/lib/rules/block-spacing.js @@ -0,0 +1,192 @@ +/** + * @fileoverview A rule to disallow or enforce spaces inside of single line blocks. + * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const util = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "block-spacing", + url: "https://eslint.style/rules/js/block-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Disallow or enforce spaces inside of blocks after opening block and before closing block", + recommended: false, + url: "https://eslint.org/docs/latest/rules/block-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + + messages: { + missing: "Requires a space {{location}} '{{token}}'.", + extra: "Unexpected space(s) {{location}} '{{token}}'." + } + }, + + create(context) { + const always = (context.options[0] !== "never"), + messageId = always ? "missing" : "extra", + sourceCode = context.sourceCode; + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to get. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + if (node.cases.length > 0) { + return sourceCode.getTokenBefore(node.cases[0]); + } + return sourceCode.getLastToken(node, 1); + } + + if (node.type === "StaticBlock") { + return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token + } + + // "BlockStatement" + return sourceCode.getFirstToken(node); + } + + /** + * Checks whether or not: + * - given tokens are on same line. + * - there is/isn't a space between given tokens. + * @param {Token} left A token to check. + * @param {Token} right The token which is next to `left`. + * @returns {boolean} + * When the option is `"always"`, `true` if there are one or more spaces between given tokens. + * When the option is `"never"`, `true` if there are not any spaces between given tokens. + * If given tokens are not on same line, it's always `true`. + */ + function isValid(left, right) { + return ( + !util.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === always + ); + } + + /** + * Checks and reports invalid spacing style inside braces. + * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to check. + * @returns {void} + */ + function checkSpacingInsideBraces(node) { + + // Gets braces and the first/last token of content. + const openBrace = getOpenBrace(node); + const closeBrace = sourceCode.getLastToken(node); + const firstToken = sourceCode.getTokenAfter(openBrace, { includeComments: true }); + const lastToken = sourceCode.getTokenBefore(closeBrace, { includeComments: true }); + + // Skip if the node is invalid or empty. + if (openBrace.type !== "Punctuator" || + openBrace.value !== "{" || + closeBrace.type !== "Punctuator" || + closeBrace.value !== "}" || + firstToken === closeBrace + ) { + return; + } + + // Skip line comments for option never + if (!always && firstToken.type === "Line") { + return; + } + + // Check. + if (!isValid(openBrace, firstToken)) { + let loc = openBrace.loc; + + if (messageId === "extra") { + loc = { + start: openBrace.loc.end, + end: firstToken.loc.start + }; + } + + context.report({ + node, + loc, + messageId, + data: { + location: "after", + token: openBrace.value + }, + fix(fixer) { + if (always) { + return fixer.insertTextBefore(firstToken, " "); + } + + return fixer.removeRange([openBrace.range[1], firstToken.range[0]]); + } + }); + } + if (!isValid(lastToken, closeBrace)) { + let loc = closeBrace.loc; + + if (messageId === "extra") { + loc = { + start: lastToken.loc.end, + end: closeBrace.loc.start + }; + } + context.report({ + node, + loc, + messageId, + data: { + location: "before", + token: closeBrace.value + }, + fix(fixer) { + if (always) { + return fixer.insertTextAfter(lastToken, " "); + } + + return fixer.removeRange([lastToken.range[1], closeBrace.range[0]]); + } + }); + } + } + + return { + BlockStatement: checkSpacingInsideBraces, + StaticBlock: checkSpacingInsideBraces, + SwitchStatement: checkSpacingInsideBraces + }; + } +}; diff --git a/node_modules/eslint/lib/rules/brace-style.js b/node_modules/eslint/lib/rules/brace-style.js new file mode 100644 index 0000000..f4fc0fd --- /dev/null +++ b/node_modules/eslint/lib/rules/brace-style.js @@ -0,0 +1,215 @@ +/** + * @fileoverview Rule to flag block statements that do not use the one true brace style + * @author Ian Christian Myers + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "brace-style", + url: "https://eslint.style/rules/js/brace-style" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent brace style for blocks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/brace-style" + }, + + schema: [ + { + enum: ["1tbs", "stroustrup", "allman"] + }, + { + type: "object", + properties: { + allowSingleLine: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "whitespace", + + messages: { + nextLineOpen: "Opening curly brace does not appear on the same line as controlling statement.", + sameLineOpen: "Opening curly brace appears on the same line as controlling statement.", + blockSameLine: "Statement inside of curly braces should be on next line.", + nextLineClose: "Closing curly brace does not appear on the same line as the subsequent block.", + singleLineClose: "Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.", + sameLineClose: "Closing curly brace appears on the same line as the subsequent block." + } + }, + + create(context) { + const style = context.options[0] || "1tbs", + params = context.options[1] || {}, + sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Fixes a place where a newline unexpectedly appears + * @param {Token} firstToken The token before the unexpected newline + * @param {Token} secondToken The token after the unexpected newline + * @returns {Function} A fixer function to remove the newlines between the tokens + */ + function removeNewlineBetween(firstToken, secondToken) { + const textRange = [firstToken.range[1], secondToken.range[0]]; + const textBetween = sourceCode.text.slice(textRange[0], textRange[1]); + + // Don't do a fix if there is a comment between the tokens + if (textBetween.trim()) { + return null; + } + return fixer => fixer.replaceTextRange(textRange, " "); + } + + /** + * Validates a pair of curly brackets based on the user's config + * @param {Token} openingCurly The opening curly bracket + * @param {Token} closingCurly The closing curly bracket + * @returns {void} + */ + function validateCurlyPair(openingCurly, closingCurly) { + const tokenBeforeOpeningCurly = sourceCode.getTokenBefore(openingCurly); + const tokenAfterOpeningCurly = sourceCode.getTokenAfter(openingCurly); + const tokenBeforeClosingCurly = sourceCode.getTokenBefore(closingCurly); + const singleLineException = params.allowSingleLine && astUtils.isTokenOnSameLine(openingCurly, closingCurly); + + if (style !== "allman" && !astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly)) { + context.report({ + node: openingCurly, + messageId: "nextLineOpen", + fix: removeNewlineBetween(tokenBeforeOpeningCurly, openingCurly) + }); + } + + if (style === "allman" && astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly) && !singleLineException) { + context.report({ + node: openingCurly, + messageId: "sameLineOpen", + fix: fixer => fixer.insertTextBefore(openingCurly, "\n") + }); + } + + if (astUtils.isTokenOnSameLine(openingCurly, tokenAfterOpeningCurly) && tokenAfterOpeningCurly !== closingCurly && !singleLineException) { + context.report({ + node: openingCurly, + messageId: "blockSameLine", + fix: fixer => fixer.insertTextAfter(openingCurly, "\n") + }); + } + + if (tokenBeforeClosingCurly !== openingCurly && !singleLineException && astUtils.isTokenOnSameLine(tokenBeforeClosingCurly, closingCurly)) { + context.report({ + node: closingCurly, + messageId: "singleLineClose", + fix: fixer => fixer.insertTextBefore(closingCurly, "\n") + }); + } + } + + /** + * Validates the location of a token that appears before a keyword (e.g. a newline before `else`) + * @param {Token} curlyToken The closing curly token. This is assumed to precede a keyword token (such as `else` or `finally`). + * @returns {void} + */ + function validateCurlyBeforeKeyword(curlyToken) { + const keywordToken = sourceCode.getTokenAfter(curlyToken); + + if (style === "1tbs" && !astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { + context.report({ + node: curlyToken, + messageId: "nextLineClose", + fix: removeNewlineBetween(curlyToken, keywordToken) + }); + } + + if (style !== "1tbs" && astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { + context.report({ + node: curlyToken, + messageId: "sameLineClose", + fix: fixer => fixer.insertTextAfter(curlyToken, "\n") + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + BlockStatement(node) { + if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) { + validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); + } + }, + StaticBlock(node) { + validateCurlyPair( + sourceCode.getFirstToken(node, { skip: 1 }), // skip the `static` token + sourceCode.getLastToken(node) + ); + }, + ClassBody(node) { + validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); + }, + SwitchStatement(node) { + const closingCurly = sourceCode.getLastToken(node); + const openingCurly = sourceCode.getTokenBefore(node.cases.length ? node.cases[0] : closingCurly); + + validateCurlyPair(openingCurly, closingCurly); + }, + IfStatement(node) { + if (node.consequent.type === "BlockStatement" && node.alternate) { + + // Handle the keyword after the `if` block (before `else`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.consequent)); + } + }, + TryStatement(node) { + + // Handle the keyword after the `try` block (before `catch` or `finally`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.block)); + + if (node.handler && node.finalizer) { + + // Handle the keyword after the `catch` block (before `finally`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.handler.body)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/callback-return.js b/node_modules/eslint/lib/rules/callback-return.js new file mode 100644 index 0000000..4f4579a --- /dev/null +++ b/node_modules/eslint/lib/rules/callback-return.js @@ -0,0 +1,203 @@ +/** + * @fileoverview Enforce return after a callback. + * @author Jamund Ferguson + * @deprecated in ESLint v7.0.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "callback-return", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/callback-return.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Require `return` statements after callbacks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/callback-return" + }, + + schema: [{ + type: "array", + items: { type: "string" } + }], + + messages: { + missingReturn: "Expected return with your callback function." + } + }, + + create(context) { + + const callbacks = context.options[0] || ["callback", "cb", "next"], + sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Find the closest parent matching a list of types. + * @param {ASTNode} node The node whose parents we are searching + * @param {Array} types The node types to match + * @returns {ASTNode} The matched node or undefined. + */ + function findClosestParentOfType(node, types) { + if (!node.parent) { + return null; + } + if (!types.includes(node.parent.type)) { + return findClosestParentOfType(node.parent, types); + } + return node.parent; + } + + /** + * Check to see if a node contains only identifiers + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the node contains only identifiers + */ + function containsOnlyIdentifiers(node) { + if (node.type === "Identifier") { + return true; + } + + if (node.type === "MemberExpression") { + if (node.object.type === "Identifier") { + return true; + } + if (node.object.type === "MemberExpression") { + return containsOnlyIdentifiers(node.object); + } + } + + return false; + } + + /** + * Check to see if a CallExpression is in our callback list. + * @param {ASTNode} node The node to check against our callback names list. + * @returns {boolean} Whether or not this function matches our callback name. + */ + function isCallback(node) { + return containsOnlyIdentifiers(node.callee) && callbacks.includes(sourceCode.getText(node.callee)); + } + + /** + * Determines whether or not the callback is part of a callback expression. + * @param {ASTNode} node The callback node + * @param {ASTNode} parentNode The expression node + * @returns {boolean} Whether or not this is part of a callback expression + */ + function isCallbackExpression(node, parentNode) { + + // ensure the parent node exists and is an expression + if (!parentNode || parentNode.type !== "ExpressionStatement") { + return false; + } + + // cb() + if (parentNode.expression === node) { + return true; + } + + // special case for cb && cb() and similar + if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") { + if (parentNode.expression.right === node) { + return true; + } + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + CallExpression(node) { + + // if we're not a callback we can return + if (!isCallback(node)) { + return; + } + + // find the closest block, return or loop + const closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {}; + + // if our parent is a return we know we're ok + if (closestBlock.type === "ReturnStatement") { + return; + } + + // arrow functions don't always have blocks and implicitly return + if (closestBlock.type === "ArrowFunctionExpression") { + return; + } + + // block statements are part of functions and most if statements + if (closestBlock.type === "BlockStatement") { + + // find the last item in the block + const lastItem = closestBlock.body.at(-1); + + // if the callback is the last thing in a block that might be ok + if (isCallbackExpression(node, lastItem)) { + + const parentType = closestBlock.parent.type; + + // but only if the block is part of a function + if (parentType === "FunctionExpression" || + parentType === "FunctionDeclaration" || + parentType === "ArrowFunctionExpression" + ) { + return; + } + + } + + // ending a block with a return is also ok + if (lastItem.type === "ReturnStatement") { + + // but only if the callback is immediately before + if (isCallbackExpression(node, closestBlock.body.at(-2))) { + return; + } + } + + } + + // as long as you're the child of a function at this point you should be asked to return + if (findClosestParentOfType(node, ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"])) { + context.report({ node, messageId: "missingReturn" }); + } + + } + + }; + } +}; diff --git a/node_modules/eslint/lib/rules/camelcase.js b/node_modules/eslint/lib/rules/camelcase.js new file mode 100644 index 0000000..7bc75ea --- /dev/null +++ b/node_modules/eslint/lib/rules/camelcase.js @@ -0,0 +1,411 @@ +/** + * @fileoverview Rule to flag non-camelcased identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allow: [], + ignoreDestructuring: false, + ignoreGlobals: false, + ignoreImports: false, + properties: "always" + }], + + docs: { + description: "Enforce camelcase naming convention", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/camelcase" + }, + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { + type: "boolean" + }, + ignoreImports: { + type: "boolean" + }, + ignoreGlobals: { + type: "boolean" + }, + properties: { + enum: ["always", "never"] + }, + allow: { + type: "array", + items: { + type: "string" + }, + minItems: 0, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + notCamelCase: "Identifier '{{name}}' is not in camel case.", + notCamelCasePrivate: "#{{name}} is not in camel case." + } + }, + + create(context) { + const [{ + allow, + ignoreDestructuring, + ignoreGlobals, + ignoreImports, + properties + }] = context.options; + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reported = new Set(); + + /** + * Checks if a string contains an underscore and isn't all upper-case + * @param {string} name The string to check. + * @returns {boolean} if the string is underscored + * @private + */ + function isUnderscored(name) { + const nameBody = name.replace(/^_+|_+$/gu, ""); + + // if there's an underscore, it might be A_CONSTANT, which is okay + return nameBody.includes("_") && nameBody !== nameBody.toUpperCase(); + } + + /** + * Checks if a string match the ignore list + * @param {string} name The string to check. + * @returns {boolean} if the string is ignored + * @private + */ + function isAllowed(name) { + return allow.some( + entry => name === entry || name.match(new RegExp(entry, "u")) + ); + } + + /** + * Checks if a given name is good or not. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is good. + * @private + */ + function isGoodName(name) { + return !isUnderscored(name) || isAllowed(name); + } + + /** + * Checks if a given identifier reference or member expression is an assignment + * target. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is an assignment target. + */ + function isAssignmentTarget(node) { + const parent = node.parent; + + switch (parent.type) { + case "AssignmentExpression": + case "AssignmentPattern": + return parent.left === node; + + case "Property": + return ( + parent.parent.type === "ObjectPattern" && + parent.value === node + ); + case "ArrayPattern": + case "RestElement": + return true; + + default: + return false; + } + } + + /** + * Checks if a given binding identifier uses the original name as-is. + * - If it's in object destructuring or object expression, the original name is its property name. + * - If it's in import declaration, the original name is its exported name. + * @param {ASTNode} node The `Identifier` node to check. + * @returns {boolean} `true` if the identifier uses the original name as-is. + */ + function equalsToOriginalName(node) { + const localName = node.name; + const valueNode = node.parent.type === "AssignmentPattern" + ? node.parent + : node; + const parent = valueNode.parent; + + switch (parent.type) { + case "Property": + return ( + (parent.parent.type === "ObjectPattern" || parent.parent.type === "ObjectExpression") && + parent.value === valueNode && + !parent.computed && + parent.key.type === "Identifier" && + parent.key.name === localName + ); + + case "ImportSpecifier": + return ( + parent.local === node && + astUtils.getModuleExportName(parent.imported) === localName + ); + + default: + return false; + } + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (reported.has(node.range[0])) { + return; + } + reported.add(node.range[0]); + + // Report it. + context.report({ + node, + messageId: node.type === "PrivateIdentifier" + ? "notCamelCasePrivate" + : "notCamelCase", + data: { name: node.name } + }); + } + + /** + * Reports an identifier reference or a binding identifier. + * @param {ASTNode} node The `Identifier` node to report. + * @returns {void} + */ + function reportReferenceId(node) { + + /* + * For backward compatibility, if it's in callings then ignore it. + * Not sure why it is. + */ + if ( + node.parent.type === "CallExpression" || + node.parent.type === "NewExpression" + ) { + return; + } + + /* + * For backward compatibility, if it's a default value of + * destructuring/parameters then ignore it. + * Not sure why it is. + */ + if ( + node.parent.type === "AssignmentPattern" && + node.parent.right === node + ) { + return; + } + + /* + * The `ignoreDestructuring` flag skips the identifiers that uses + * the property name as-is. + */ + if (ignoreDestructuring && equalsToOriginalName(node)) { + return; + } + + /* + * Import attribute keys are always ignored + */ + if (astUtils.isImportAttributeKey(node)) { + return; + } + + report(node); + } + + return { + + // Report camelcase of global variable references ------------------ + Program(node) { + const scope = sourceCode.getScope(node); + + if (!ignoreGlobals) { + + // Defined globals in config files or directive comments. + for (const variable of scope.variables) { + if ( + variable.identifiers.length > 0 || + isGoodName(variable.name) + ) { + continue; + } + for (const reference of variable.references) { + + /* + * For backward compatibility, this rule reports read-only + * references as well. + */ + reportReferenceId(reference.identifier); + } + } + } + + // Undefined globals. + for (const reference of scope.through) { + const id = reference.identifier; + + if (isGoodName(id.name) || astUtils.isImportAttributeKey(id)) { + continue; + } + + /* + * For backward compatibility, this rule reports read-only + * references as well. + */ + reportReferenceId(id); + } + }, + + // Report camelcase of declared variables -------------------------- + [[ + "VariableDeclaration", + "FunctionDeclaration", + "FunctionExpression", + "ArrowFunctionExpression", + "ClassDeclaration", + "ClassExpression", + "CatchClause" + ]](node) { + for (const variable of sourceCode.getDeclaredVariables(node)) { + if (isGoodName(variable.name)) { + continue; + } + const id = variable.identifiers[0]; + + // Report declaration. + if (!(ignoreDestructuring && equalsToOriginalName(id))) { + report(id); + } + + /* + * For backward compatibility, report references as well. + * It looks unnecessary because declarations are reported. + */ + for (const reference of variable.references) { + if (reference.init) { + continue; // Skip the write references of initializers. + } + reportReferenceId(reference.identifier); + } + } + }, + + // Report camelcase in properties ---------------------------------- + [[ + "ObjectExpression > Property[computed!=true] > Identifier.key", + "MethodDefinition[computed!=true] > Identifier.key", + "PropertyDefinition[computed!=true] > Identifier.key", + "MethodDefinition > PrivateIdentifier.key", + "PropertyDefinition > PrivateIdentifier.key" + ]](node) { + if (properties === "never" || astUtils.isImportAttributeKey(node) || isGoodName(node.name)) { + return; + } + report(node); + }, + "MemberExpression[computed!=true] > Identifier.property"(node) { + if ( + properties === "never" || + !isAssignmentTarget(node.parent) || // ← ignore read-only references. + isGoodName(node.name) + ) { + return; + } + report(node); + }, + + // Report camelcase in import -------------------------------------- + ImportDeclaration(node) { + for (const variable of sourceCode.getDeclaredVariables(node)) { + if (isGoodName(variable.name)) { + continue; + } + const id = variable.identifiers[0]; + + // Report declaration. + if (!(ignoreImports && equalsToOriginalName(id))) { + report(id); + } + + /* + * For backward compatibility, report references as well. + * It looks unnecessary because declarations are reported. + */ + for (const reference of variable.references) { + reportReferenceId(reference.identifier); + } + } + }, + + // Report camelcase in re-export ----------------------------------- + [[ + "ExportAllDeclaration > Identifier.exported", + "ExportSpecifier > Identifier.exported" + ]](node) { + if (isGoodName(node.name)) { + return; + } + report(node); + }, + + // Report camelcase in labels -------------------------------------- + [[ + "LabeledStatement > Identifier.label", + + /* + * For backward compatibility, report references as well. + * It looks unnecessary because declarations are reported. + */ + "BreakStatement > Identifier.label", + "ContinueStatement > Identifier.label" + ]](node) { + if (isGoodName(node.name)) { + return; + } + report(node); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/capitalized-comments.js b/node_modules/eslint/lib/rules/capitalized-comments.js new file mode 100644 index 0000000..7964636 --- /dev/null +++ b/node_modules/eslint/lib/rules/capitalized-comments.js @@ -0,0 +1,304 @@ +/** + * @fileoverview enforce or disallow capitalization of the first letter of a comment + * @author Kevin Partington + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN, + WHITESPACE = /\s/gu, + MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u, // TODO: Combine w/ max-len pattern? + LETTER_PATTERN = /\p{L}/u; + +/* + * Base schema body for defining the basic capitalization rule, ignorePattern, + * and ignoreInlineComments values. + * This can be used in a few different ways in the actual schema. + */ +const SCHEMA_BODY = { + type: "object", + properties: { + ignorePattern: { + type: "string" + }, + ignoreInlineComments: { + type: "boolean" + }, + ignoreConsecutiveComments: { + type: "boolean" + } + }, + additionalProperties: false +}; +const DEFAULTS = { + ignorePattern: "", + ignoreInlineComments: false, + ignoreConsecutiveComments: false +}; + +/** + * Get normalized options for either block or line comments from the given + * user-provided options. + * - If the user-provided options is just a string, returns a normalized + * set of options using default values for all other options. + * - If the user-provided options is an object, then a normalized option + * set is returned. Options specified in overrides will take priority + * over options specified in the main options object, which will in + * turn take priority over the rule's defaults. + * @param {Object|string} rawOptions The user-provided options. + * @param {string} which Either "line" or "block". + * @returns {Object} The normalized options. + */ +function getNormalizedOptions(rawOptions, which) { + return Object.assign({}, DEFAULTS, rawOptions[which] || rawOptions); +} + +/** + * Get normalized options for block and line comments. + * @param {Object|string} rawOptions The user-provided options. + * @returns {Object} An object with "Line" and "Block" keys and corresponding + * normalized options objects. + */ +function getAllNormalizedOptions(rawOptions = {}) { + return { + Line: getNormalizedOptions(rawOptions, "line"), + Block: getNormalizedOptions(rawOptions, "block") + }; +} + +/** + * Creates a regular expression for each ignorePattern defined in the rule + * options. + * + * This is done in order to avoid invoking the RegExp constructor repeatedly. + * @param {Object} normalizedOptions The normalized rule options. + * @returns {void} + */ +function createRegExpForIgnorePatterns(normalizedOptions) { + Object.keys(normalizedOptions).forEach(key => { + const ignorePatternStr = normalizedOptions[key].ignorePattern; + + if (ignorePatternStr) { + const regExp = RegExp(`^\\s*(?:${ignorePatternStr})`, "u"); + + normalizedOptions[key].ignorePatternRegExp = regExp; + } + }); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce or disallow capitalization of the first letter of a comment", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/capitalized-comments" + }, + + fixable: "code", + + schema: [ + { enum: ["always", "never"] }, + { + oneOf: [ + SCHEMA_BODY, + { + type: "object", + properties: { + line: SCHEMA_BODY, + block: SCHEMA_BODY + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedLowercaseComment: "Comments should not begin with a lowercase character.", + unexpectedUppercaseComment: "Comments should not begin with an uppercase character." + } + }, + + create(context) { + + const capitalize = context.options[0] || "always", + normalizedOptions = getAllNormalizedOptions(context.options[1]), + sourceCode = context.sourceCode; + + createRegExpForIgnorePatterns(normalizedOptions); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks whether a comment is an inline comment. + * + * For the purpose of this rule, a comment is inline if: + * 1. The comment is preceded by a token on the same line; and + * 2. The command is followed by a token on the same line. + * + * Note that the comment itself need not be single-line! + * + * Also, it follows from this definition that only block comments can + * be considered as possibly inline. This is because line comments + * would consume any following tokens on the same line as the comment. + * @param {ASTNode} comment The comment node to check. + * @returns {boolean} True if the comment is an inline comment, false + * otherwise. + */ + function isInlineComment(comment) { + const previousToken = sourceCode.getTokenBefore(comment, { includeComments: true }), + nextToken = sourceCode.getTokenAfter(comment, { includeComments: true }); + + return Boolean( + previousToken && + nextToken && + comment.loc.start.line === previousToken.loc.end.line && + comment.loc.end.line === nextToken.loc.start.line + ); + } + + /** + * Determine if a comment follows another comment. + * @param {ASTNode} comment The comment to check. + * @returns {boolean} True if the comment follows a valid comment. + */ + function isConsecutiveComment(comment) { + const previousTokenOrComment = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return Boolean( + previousTokenOrComment && + ["Block", "Line"].includes(previousTokenOrComment.type) + ); + } + + /** + * Check a comment to determine if it is valid for this rule. + * @param {ASTNode} comment The comment node to process. + * @param {Object} options The options for checking this comment. + * @returns {boolean} True if the comment is valid, false otherwise. + */ + function isCommentValid(comment, options) { + + // 1. Check for default ignore pattern. + if (DEFAULT_IGNORE_PATTERN.test(comment.value)) { + return true; + } + + // 2. Check for custom ignore pattern. + const commentWithoutAsterisks = comment.value + .replace(/\*/gu, ""); + + if (options.ignorePatternRegExp && options.ignorePatternRegExp.test(commentWithoutAsterisks)) { + return true; + } + + // 3. Check for inline comments. + if (options.ignoreInlineComments && isInlineComment(comment)) { + return true; + } + + // 4. Is this a consecutive comment (and are we tolerating those)? + if (options.ignoreConsecutiveComments && isConsecutiveComment(comment)) { + return true; + } + + // 5. Does the comment start with a possible URL? + if (MAYBE_URL.test(commentWithoutAsterisks)) { + return true; + } + + // 6. Is the initial word character a letter? + const commentWordCharsOnly = commentWithoutAsterisks + .replace(WHITESPACE, ""); + + if (commentWordCharsOnly.length === 0) { + return true; + } + + // Get the first Unicode character (1 or 2 code units). + const [firstWordChar] = commentWordCharsOnly; + + if (!LETTER_PATTERN.test(firstWordChar)) { + return true; + } + + // 7. Check the case of the initial word character. + const isUppercase = firstWordChar !== firstWordChar.toLocaleLowerCase(), + isLowercase = firstWordChar !== firstWordChar.toLocaleUpperCase(); + + if (capitalize === "always" && isLowercase) { + return false; + } + if (capitalize === "never" && isUppercase) { + return false; + } + + return true; + } + + /** + * Process a comment to determine if it needs to be reported. + * @param {ASTNode} comment The comment node to process. + * @returns {void} + */ + function processComment(comment) { + const options = normalizedOptions[comment.type], + commentValid = isCommentValid(comment, options); + + if (!commentValid) { + const messageId = capitalize === "always" + ? "unexpectedLowercaseComment" + : "unexpectedUppercaseComment"; + + context.report({ + node: null, // Intentionally using loc instead + loc: comment.loc, + messageId, + fix(fixer) { + const match = comment.value.match(LETTER_PATTERN); + const char = match[0]; + + // Offset match.index by 2 to account for the first 2 characters that start the comment (// or /*) + const charIndex = comment.range[0] + match.index + 2; + + return fixer.replaceTextRange( + [charIndex, charIndex + char.length], + capitalize === "always" ? char.toLocaleUpperCase() : char.toLocaleLowerCase() + ); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(processComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/class-methods-use-this.js b/node_modules/eslint/lib/rules/class-methods-use-this.js new file mode 100644 index 0000000..1105463 --- /dev/null +++ b/node_modules/eslint/lib/rules/class-methods-use-this.js @@ -0,0 +1,191 @@ +/** + * @fileoverview Rule to enforce that all class methods use 'this'. + * @author Patrick Williams + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + enforceForClassFields: true, + exceptMethods: [] + }], + + docs: { + description: "Enforce that class methods utilize `this`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/class-methods-use-this" + }, + + schema: [{ + type: "object", + properties: { + exceptMethods: { + type: "array", + items: { + type: "string" + } + }, + enforceForClassFields: { + type: "boolean" + } + }, + additionalProperties: false + }], + + messages: { + missingThis: "Expected 'this' to be used by class {{name}}." + } + }, + create(context) { + const [options] = context.options; + const { enforceForClassFields } = options; + const exceptMethods = new Set(options.exceptMethods); + + const stack = []; + + /** + * Push `this` used flag initialized with `false` onto the stack. + * @returns {void} + */ + function pushContext() { + stack.push(false); + } + + /** + * Pop `this` used flag from the stack. + * @returns {boolean | undefined} `this` used flag + */ + function popContext() { + return stack.pop(); + } + + /** + * Initializes the current context to false and pushes it onto the stack. + * These booleans represent whether 'this' has been used in the context. + * @returns {void} + * @private + */ + function enterFunction() { + pushContext(); + } + + /** + * Check if the node is an instance method + * @param {ASTNode} node node to check + * @returns {boolean} True if its an instance method + * @private + */ + function isInstanceMethod(node) { + switch (node.type) { + case "MethodDefinition": + return !node.static && node.kind !== "constructor"; + case "PropertyDefinition": + return !node.static && enforceForClassFields; + default: + return false; + } + } + + /** + * Check if the node is an instance method not excluded by config + * @param {ASTNode} node node to check + * @returns {boolean} True if it is an instance method, and not excluded by config + * @private + */ + function isIncludedInstanceMethod(node) { + if (isInstanceMethod(node)) { + if (node.computed) { + return true; + } + + const hashIfNeeded = node.key.type === "PrivateIdentifier" ? "#" : ""; + const name = node.key.type === "Literal" + ? astUtils.getStaticStringValue(node.key) + : (node.key.name || ""); + + return !exceptMethods.has(hashIfNeeded + name); + } + return false; + } + + /** + * Checks if we are leaving a function that is a method, and reports if 'this' has not been used. + * Static methods and the constructor are exempt. + * Then pops the context off the stack. + * @param {ASTNode} node A function node that was entered. + * @returns {void} + * @private + */ + function exitFunction(node) { + const methodUsesThis = popContext(); + + if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) { + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, context.sourceCode), + messageId: "missingThis", + data: { + name: astUtils.getFunctionNameWithKind(node) + } + }); + } + } + + /** + * Mark the current context as having used 'this'. + * @returns {void} + * @private + */ + function markThisUsed() { + if (stack.length) { + stack[stack.length - 1] = true; + } + } + + return { + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + + /* + * Class field value are implicit functions. + */ + "PropertyDefinition > *.key:exit": pushContext, + "PropertyDefinition:exit": popContext, + + /* + * Class static blocks are implicit functions. They aren't required to use `this`, + * but we have to push context so that it captures any use of `this` in the static block + * separately from enclosing contexts, because static blocks have their own `this` and it + * shouldn't count as used `this` in enclosing contexts. + */ + StaticBlock: pushContext, + "StaticBlock:exit": popContext, + + ThisExpression: markThisUsed, + Super: markThisUsed, + ...( + enforceForClassFields && { + "PropertyDefinition > ArrowFunctionExpression.value": enterFunction, + "PropertyDefinition > ArrowFunctionExpression.value:exit": exitFunction + } + ) + }; + } +}; diff --git a/node_modules/eslint/lib/rules/comma-dangle.js b/node_modules/eslint/lib/rules/comma-dangle.js new file mode 100644 index 0000000..9af7379 --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-dangle.js @@ -0,0 +1,391 @@ +/** + * @fileoverview Rule to forbid or enforce dangling commas. + * @author Ian Christian Myers + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_OPTIONS = Object.freeze({ + arrays: "never", + objects: "never", + imports: "never", + exports: "never", + functions: "never" +}); + +/** + * Checks whether or not a trailing comma is allowed in a given node. + * If the `lastItem` is `RestElement` or `RestProperty`, it disallows trailing commas. + * @param {ASTNode} lastItem The node of the last element in the given node. + * @returns {boolean} `true` if a trailing comma is allowed. + */ +function isTrailingCommaAllowed(lastItem) { + return !( + lastItem.type === "RestElement" || + lastItem.type === "RestProperty" || + lastItem.type === "ExperimentalRestProperty" + ); +} + +/** + * Normalize option value. + * @param {string|Object|undefined} optionValue The 1st option value to normalize. + * @param {number} ecmaVersion The normalized ECMAScript version. + * @returns {Object} The normalized option value. + */ +function normalizeOptions(optionValue, ecmaVersion) { + if (typeof optionValue === "string") { + return { + arrays: optionValue, + objects: optionValue, + imports: optionValue, + exports: optionValue, + functions: ecmaVersion < 2017 ? "ignore" : optionValue + }; + } + if (typeof optionValue === "object" && optionValue !== null) { + return { + arrays: optionValue.arrays || DEFAULT_OPTIONS.arrays, + objects: optionValue.objects || DEFAULT_OPTIONS.objects, + imports: optionValue.imports || DEFAULT_OPTIONS.imports, + exports: optionValue.exports || DEFAULT_OPTIONS.exports, + functions: optionValue.functions || DEFAULT_OPTIONS.functions + }; + } + + return DEFAULT_OPTIONS; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "comma-dangle", + url: "https://eslint.style/rules/js/comma-dangle" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow trailing commas", + recommended: false, + url: "https://eslint.org/docs/latest/rules/comma-dangle" + }, + + fixable: "code", + + schema: { + definitions: { + value: { + enum: [ + "always-multiline", + "always", + "never", + "only-multiline" + ] + }, + valueWithIgnore: { + enum: [ + "always-multiline", + "always", + "ignore", + "never", + "only-multiline" + ] + } + }, + type: "array", + items: [ + { + oneOf: [ + { + $ref: "#/definitions/value" + }, + { + type: "object", + properties: { + arrays: { $ref: "#/definitions/valueWithIgnore" }, + objects: { $ref: "#/definitions/valueWithIgnore" }, + imports: { $ref: "#/definitions/valueWithIgnore" }, + exports: { $ref: "#/definitions/valueWithIgnore" }, + functions: { $ref: "#/definitions/valueWithIgnore" } + }, + additionalProperties: false + } + ] + } + ], + additionalItems: false + }, + + messages: { + unexpected: "Unexpected trailing comma.", + missing: "Missing trailing comma." + } + }, + + create(context) { + const options = normalizeOptions(context.options[0], context.languageOptions.ecmaVersion); + + const sourceCode = context.sourceCode; + + /** + * Gets the last item of the given node. + * @param {ASTNode} node The node to get. + * @returns {ASTNode|null} The last node or null. + */ + function getLastItem(node) { + + /** + * Returns the last element of an array + * @param {any[]} array The input array + * @returns {any} The last element + */ + function last(array) { + return array.at(-1); + } + + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + return last(node.properties); + case "ArrayExpression": + case "ArrayPattern": + return last(node.elements); + case "ImportDeclaration": + case "ExportNamedDeclaration": + return last(node.specifiers); + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + return last(node.params); + case "CallExpression": + case "NewExpression": + return last(node.arguments); + default: + return null; + } + } + + /** + * Gets the trailing comma token of the given node. + * If the trailing comma does not exist, this returns the token which is + * the insertion point of the trailing comma token. + * @param {ASTNode} node The node to get. + * @param {ASTNode} lastItem The last item of the node. + * @returns {Token} The trailing comma token or the insertion point. + */ + function getTrailingToken(node, lastItem) { + switch (node.type) { + case "ObjectExpression": + case "ArrayExpression": + case "CallExpression": + case "NewExpression": + return sourceCode.getLastToken(node, 1); + default: { + const nextToken = sourceCode.getTokenAfter(lastItem); + + if (astUtils.isCommaToken(nextToken)) { + return nextToken; + } + return sourceCode.getLastToken(lastItem); + } + } + } + + /** + * Checks whether or not a given node is multiline. + * This rule handles a given node as multiline when the closing parenthesis + * and the last element are not on the same line. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is multiline. + */ + function isMultiline(node) { + const lastItem = getLastItem(node); + + if (!lastItem) { + return false; + } + + const penultimateToken = getTrailingToken(node, lastItem); + const lastToken = sourceCode.getTokenAfter(penultimateToken); + + return lastToken.loc.end.line !== penultimateToken.loc.end.line; + } + + /** + * Reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forbidTrailingComma(node) { + const lastItem = getLastItem(node); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + + const trailingToken = getTrailingToken(node, lastItem); + + if (astUtils.isCommaToken(trailingToken)) { + context.report({ + node: lastItem, + loc: trailingToken.loc, + messageId: "unexpected", + *fix(fixer) { + yield fixer.remove(trailingToken); + + /* + * Extend the range of the fix to include surrounding tokens to ensure + * that the element after which the comma is removed stays _last_. + * This intentionally makes conflicts in fix ranges with rules that may be + * adding or removing elements in the same autofix pass. + * https://github.com/eslint/eslint/issues/15660 + */ + yield fixer.insertTextBefore(sourceCode.getTokenBefore(trailingToken), ""); + yield fixer.insertTextAfter(sourceCode.getTokenAfter(trailingToken), ""); + } + }); + } + } + + /** + * Reports the last element of a given node if it does not have a trailing + * comma. + * + * If a given node is `ArrayPattern` which has `RestElement`, the trailing + * comma is disallowed, so report if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingComma(node) { + const lastItem = getLastItem(node); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + if (!isTrailingCommaAllowed(lastItem)) { + forbidTrailingComma(node); + return; + } + + const trailingToken = getTrailingToken(node, lastItem); + + if (trailingToken.value !== ",") { + context.report({ + node: lastItem, + loc: { + start: trailingToken.loc.end, + end: astUtils.getNextLocation(sourceCode, trailingToken.loc.end) + }, + messageId: "missing", + *fix(fixer) { + yield fixer.insertTextAfter(trailingToken, ","); + + /* + * Extend the range of the fix to include surrounding tokens to ensure + * that the element after which the comma is inserted stays _last_. + * This intentionally makes conflicts in fix ranges with rules that may be + * adding or removing elements in the same autofix pass. + * https://github.com/eslint/eslint/issues/15660 + */ + yield fixer.insertTextBefore(trailingToken, ""); + yield fixer.insertTextAfter(sourceCode.getTokenAfter(trailingToken), ""); + } + }); + } + } + + /** + * If a given node is multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingCommaIfMultiline(node) { + if (isMultiline(node)) { + forceTrailingComma(node); + } else { + forbidTrailingComma(node); + } + } + + /** + * Only if a given node is not multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function allowTrailingCommaIfMultiline(node) { + if (!isMultiline(node)) { + forbidTrailingComma(node); + } + } + + const predicate = { + always: forceTrailingComma, + "always-multiline": forceTrailingCommaIfMultiline, + "only-multiline": allowTrailingCommaIfMultiline, + never: forbidTrailingComma, + ignore() {} + }; + + return { + ObjectExpression: predicate[options.objects], + ObjectPattern: predicate[options.objects], + + ArrayExpression: predicate[options.arrays], + ArrayPattern: predicate[options.arrays], + + ImportDeclaration: predicate[options.imports], + + ExportNamedDeclaration: predicate[options.exports], + + FunctionDeclaration: predicate[options.functions], + FunctionExpression: predicate[options.functions], + ArrowFunctionExpression: predicate[options.functions], + CallExpression: predicate[options.functions], + NewExpression: predicate[options.functions] + }; + } +}; diff --git a/node_modules/eslint/lib/rules/comma-spacing.js b/node_modules/eslint/lib/rules/comma-spacing.js new file mode 100644 index 0000000..85f2566 --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-spacing.js @@ -0,0 +1,210 @@ +/** + * @fileoverview Comma spacing - validates spacing before and after comma + * @author Vignesh Anand aka vegetableman. + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "comma-spacing", + url: "https://eslint.style/rules/js/comma-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing before and after commas", + recommended: false, + url: "https://eslint.org/docs/latest/rules/comma-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: false + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + missing: "A space is required {{loc}} ','.", + unexpected: "There should be no space {{loc}} ','." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + const tokensAndComments = sourceCode.tokensAndComments; + + const options = { + before: context.options[0] ? context.options[0].before : false, + after: context.options[0] ? context.options[0].after : true + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // list of comma tokens to ignore for the check of leading whitespace + const commaTokensToIgnore = []; + + /** + * Reports a spacing error with an appropriate message. + * @param {ASTNode} node The binary expression node to report. + * @param {string} loc Is the error "before" or "after" the comma? + * @param {ASTNode} otherNode The node at the left or right of `node` + * @returns {void} + * @private + */ + function report(node, loc, otherNode) { + context.report({ + node, + fix(fixer) { + if (options[loc]) { + if (loc === "before") { + return fixer.insertTextBefore(node, " "); + } + return fixer.insertTextAfter(node, " "); + + } + let start, end; + const newText = ""; + + if (loc === "before") { + start = otherNode.range[1]; + end = node.range[0]; + } else { + start = node.range[1]; + end = otherNode.range[0]; + } + + return fixer.replaceTextRange([start, end], newText); + + }, + messageId: options[loc] ? "missing" : "unexpected", + data: { + loc + } + }); + } + + /** + * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list. + * @param {ASTNode} node An ArrayExpression or ArrayPattern node. + * @returns {void} + */ + function addNullElementsToIgnoreList(node) { + let previousToken = sourceCode.getFirstToken(node); + + node.elements.forEach(element => { + let token; + + if (element === null) { + token = sourceCode.getTokenAfter(previousToken); + + if (astUtils.isCommaToken(token)) { + commaTokensToIgnore.push(token); + } + } else { + token = sourceCode.getTokenAfter(element); + } + + previousToken = token; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "Program:exit"() { + tokensAndComments.forEach((token, i) => { + + if (!astUtils.isCommaToken(token)) { + return; + } + + const previousToken = tokensAndComments[i - 1]; + const nextToken = tokensAndComments[i + 1]; + + if ( + previousToken && + !astUtils.isCommaToken(previousToken) && // ignore spacing between two commas + + /* + * `commaTokensToIgnore` are ending commas of `null` elements (array holes/elisions). + * In addition to spacing between two commas, this can also ignore: + * + * - Spacing after `[` (controlled by array-bracket-spacing) + * Example: [ , ] + * ^ + * - Spacing after a comment (for backwards compatibility, this was possibly unintentional) + * Example: [a, /* * / ,] + * ^ + */ + !commaTokensToIgnore.includes(token) && + + astUtils.isTokenOnSameLine(previousToken, token) && + options.before !== sourceCode.isSpaceBetweenTokens(previousToken, token) + ) { + report(token, "before", previousToken); + } + + if ( + nextToken && + !astUtils.isCommaToken(nextToken) && // ignore spacing between two commas + !astUtils.isClosingParenToken(nextToken) && // controlled by space-in-parens + !astUtils.isClosingBracketToken(nextToken) && // controlled by array-bracket-spacing + !astUtils.isClosingBraceToken(nextToken) && // controlled by object-curly-spacing + !(!options.after && nextToken.type === "Line") && // special case, allow space before line comment + astUtils.isTokenOnSameLine(token, nextToken) && + options.after !== sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + report(token, "after", nextToken); + } + }); + }, + ArrayExpression: addNullElementsToIgnoreList, + ArrayPattern: addNullElementsToIgnoreList + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/comma-style.js b/node_modules/eslint/lib/rules/comma-style.js new file mode 100644 index 0000000..372385c --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-style.js @@ -0,0 +1,332 @@ +/** + * @fileoverview Comma style - enforces comma styles of two types: last and first + * @author Vignesh Anand aka vegetableman + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "comma-style", + url: "https://eslint.style/rules/js/comma-style" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent comma style", + recommended: false, + url: "https://eslint.org/docs/latest/rules/comma-style" + }, + + fixable: "code", + + schema: [ + { + enum: ["first", "last"] + }, + { + type: "object", + properties: { + exceptions: { + type: "object", + additionalProperties: { + type: "boolean" + } + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedLineBeforeAndAfterComma: "Bad line breaking before and after ','.", + expectedCommaFirst: "',' should be placed first.", + expectedCommaLast: "',' should be placed last." + } + }, + + create(context) { + const style = context.options[0] || "last", + sourceCode = context.sourceCode; + const exceptions = { + ArrayPattern: true, + ArrowFunctionExpression: true, + CallExpression: true, + FunctionDeclaration: true, + FunctionExpression: true, + ImportDeclaration: true, + ObjectPattern: true, + NewExpression: true + }; + + if (context.options.length === 2 && Object.hasOwn(context.options[1], "exceptions")) { + const keys = Object.keys(context.options[1].exceptions); + + for (let i = 0; i < keys.length; i++) { + exceptions[keys[i]] = context.options[1].exceptions[keys[i]]; + } + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Modified text based on the style + * @param {string} styleType Style type + * @param {string} text Source code text + * @returns {string} modified text + * @private + */ + function getReplacedText(styleType, text) { + switch (styleType) { + case "between": + return `,${text.replace(astUtils.LINEBREAK_MATCHER, "")}`; + + case "first": + return `${text},`; + + case "last": + return `,${text}`; + + default: + return ""; + } + } + + /** + * Determines the fixer function for a given style. + * @param {string} styleType comma style + * @param {ASTNode} previousItemToken The token to check. + * @param {ASTNode} commaToken The token to check. + * @param {ASTNode} currentItemToken The token to check. + * @returns {Function} Fixer function + * @private + */ + function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) { + const text = + sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) + + sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]); + const range = [previousItemToken.range[1], currentItemToken.range[0]]; + + return function(fixer) { + return fixer.replaceTextRange(range, getReplacedText(styleType, text)); + }; + } + + /** + * Validates the spacing around single items in lists. + * @param {Token} previousItemToken The last token from the previous item. + * @param {Token} commaToken The token representing the comma. + * @param {Token} currentItemToken The first token of the current item. + * @param {Token} reportItem The item to use when reporting an error. + * @returns {void} + * @private + */ + function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) { + + // if single line + if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + + // do nothing. + + } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + + const comment = sourceCode.getCommentsAfter(commaToken)[0]; + const styleType = comment && comment.type === "Block" && astUtils.isTokenOnSameLine(commaToken, comment) + ? style + : "between"; + + // lone comma + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "unexpectedLineBeforeAndAfterComma", + fix: getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) + }); + + } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { + + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "expectedCommaFirst", + fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken) + }); + + } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { + + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "expectedCommaLast", + fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken) + }); + } + } + + /** + * Checks the comma placement with regards to a declaration/property/element + * @param {ASTNode} node The binary expression node to check + * @param {string} property The property of the node containing child nodes. + * @private + * @returns {void} + */ + function validateComma(node, property) { + const items = node[property], + arrayLiteral = (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + + if (items.length > 1 || arrayLiteral) { + + // seed as opening [ + let previousItemToken = sourceCode.getFirstToken(node); + + items.forEach(item => { + const commaToken = item ? sourceCode.getTokenBefore(item) : previousItemToken, + currentItemToken = item ? sourceCode.getFirstToken(item) : sourceCode.getTokenAfter(commaToken), + reportItem = item || currentItemToken; + + /* + * This works by comparing three token locations: + * - previousItemToken is the last token of the previous item + * - commaToken is the location of the comma before the current item + * - currentItemToken is the first token of the current item + * + * These values get switched around if item is undefined. + * previousItemToken will refer to the last token not belonging + * to the current item, which could be a comma or an opening + * square bracket. currentItemToken could be a comma. + * + * All comparisons are done based on these tokens directly, so + * they are always valid regardless of an undefined item. + */ + if (astUtils.isCommaToken(commaToken)) { + validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem); + } + + if (item) { + const tokenAfterItem = sourceCode.getTokenAfter(item, astUtils.isNotClosingParenToken); + + previousItemToken = tokenAfterItem + ? sourceCode.getTokenBefore(tokenAfterItem) + : sourceCode.ast.tokens.at(-1); + } else { + previousItemToken = currentItemToken; + } + }); + + /* + * Special case for array literals that have empty last items, such + * as [ 1, 2, ]. These arrays only have two items show up in the + * AST, so we need to look at the token to verify that there's no + * dangling comma. + */ + if (arrayLiteral) { + + const lastToken = sourceCode.getLastToken(node), + nextToLastToken = sourceCode.getTokenBefore(lastToken); + + if (astUtils.isCommaToken(nextToLastToken)) { + validateCommaItemSpacing( + sourceCode.getTokenBefore(nextToLastToken), + nextToLastToken, + lastToken, + lastToken + ); + } + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + const nodes = {}; + + if (!exceptions.VariableDeclaration) { + nodes.VariableDeclaration = function(node) { + validateComma(node, "declarations"); + }; + } + if (!exceptions.ObjectExpression) { + nodes.ObjectExpression = function(node) { + validateComma(node, "properties"); + }; + } + if (!exceptions.ObjectPattern) { + nodes.ObjectPattern = function(node) { + validateComma(node, "properties"); + }; + } + if (!exceptions.ArrayExpression) { + nodes.ArrayExpression = function(node) { + validateComma(node, "elements"); + }; + } + if (!exceptions.ArrayPattern) { + nodes.ArrayPattern = function(node) { + validateComma(node, "elements"); + }; + } + if (!exceptions.FunctionDeclaration) { + nodes.FunctionDeclaration = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.FunctionExpression) { + nodes.FunctionExpression = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.ArrowFunctionExpression) { + nodes.ArrowFunctionExpression = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.CallExpression) { + nodes.CallExpression = function(node) { + validateComma(node, "arguments"); + }; + } + if (!exceptions.ImportDeclaration) { + nodes.ImportDeclaration = function(node) { + validateComma(node, "specifiers"); + }; + } + if (!exceptions.NewExpression) { + nodes.NewExpression = function(node) { + validateComma(node, "arguments"); + }; + } + + return nodes; + } +}; diff --git a/node_modules/eslint/lib/rules/complexity.js b/node_modules/eslint/lib/rules/complexity.js new file mode 100644 index 0000000..7358fe1 --- /dev/null +++ b/node_modules/eslint/lib/rules/complexity.js @@ -0,0 +1,192 @@ +/** + * @fileoverview Counts the cyclomatic complexity of each function of the script. See http://en.wikipedia.org/wiki/Cyclomatic_complexity. + * Counts the number of if, conditional, for, while, try, switch/case, + * @author Patrick Brosset + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const THRESHOLD_DEFAULT = 20; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [THRESHOLD_DEFAULT], + + docs: { + description: "Enforce a maximum cyclomatic complexity allowed in a program", + recommended: false, + url: "https://eslint.org/docs/latest/rules/complexity" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + }, + variant: { + enum: ["classic", "modified"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + complex: "{{name}} has a complexity of {{complexity}}. Maximum allowed is {{max}}." + } + }, + + create(context) { + const option = context.options[0]; + let threshold = THRESHOLD_DEFAULT; + let VARIANT = "classic"; + + if (typeof option === "object") { + if (Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max")) { + threshold = option.maximum || option.max; + } + + if (Object.hasOwn(option, "variant")) { + VARIANT = option.variant; + } + } else if (typeof option === "number") { + threshold = option; + } + + const IS_MODIFIED_COMPLEXITY = VARIANT === "modified"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // Using a stack to store complexity per code path + const complexities = []; + + /** + * Increase the complexity of the code path in context + * @returns {void} + * @private + */ + function increaseComplexity() { + complexities[complexities.length - 1]++; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + onCodePathStart() { + + // The initial complexity is 1, representing one execution path in the CodePath + complexities.push(1); + }, + + // Each branching in the code adds 1 to the complexity + CatchClause: increaseComplexity, + ConditionalExpression: increaseComplexity, + LogicalExpression: increaseComplexity, + ForStatement: increaseComplexity, + ForInStatement: increaseComplexity, + ForOfStatement: increaseComplexity, + IfStatement: increaseComplexity, + WhileStatement: increaseComplexity, + DoWhileStatement: increaseComplexity, + AssignmentPattern: increaseComplexity, + + // Avoid `default` + "SwitchCase[test]": () => IS_MODIFIED_COMPLEXITY || increaseComplexity(), + SwitchStatement: () => IS_MODIFIED_COMPLEXITY && increaseComplexity(), + + // Logical assignment operators have short-circuiting behavior + AssignmentExpression(node) { + if (astUtils.isLogicalAssignmentOperator(node.operator)) { + increaseComplexity(); + } + }, + + MemberExpression(node) { + if (node.optional === true) { + increaseComplexity(); + } + }, + + CallExpression(node) { + if (node.optional === true) { + increaseComplexity(); + } + }, + + onCodePathEnd(codePath, node) { + const complexity = complexities.pop(); + + /* + * This rule only evaluates complexity of functions, so "program" is excluded. + * Class field initializers and class static blocks are implicit functions. Therefore, + * they shouldn't contribute to the enclosing function's complexity, but their + * own complexity should be evaluated. + */ + if ( + codePath.origin !== "function" && + codePath.origin !== "class-field-initializer" && + codePath.origin !== "class-static-block" + ) { + return; + } + + if (complexity > threshold) { + let name; + + if (codePath.origin === "class-field-initializer") { + name = "class field initializer"; + } else if (codePath.origin === "class-static-block") { + name = "class static block"; + } else { + name = astUtils.getFunctionNameWithKind(node); + } + + context.report({ + node, + messageId: "complex", + data: { + name: upperCaseFirst(name), + complexity, + max: threshold + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/computed-property-spacing.js b/node_modules/eslint/lib/rules/computed-property-spacing.js new file mode 100644 index 0000000..3e5455e --- /dev/null +++ b/node_modules/eslint/lib/rules/computed-property-spacing.js @@ -0,0 +1,226 @@ +/** + * @fileoverview Disallows or enforces spaces inside computed properties. + * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "computed-property-spacing", + url: "https://eslint.style/rules/js/computed-property-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing inside computed property brackets", + recommended: false, + url: "https://eslint.org/docs/latest/rules/computed-property-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + enforceForClassMembers: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceBefore: "There should be no space before '{{tokenValue}}'.", + unexpectedSpaceAfter: "There should be no space after '{{tokenValue}}'.", + + missingSpaceBefore: "A space is required before '{{tokenValue}}'.", + missingSpaceAfter: "A space is required after '{{tokenValue}}'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never" + const enforceForClassMembers = !context.options[1] || context.options[1].enforceForClassMembers; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenAfter The token after `token`. + * @returns {void} + */ + function reportNoBeginningSpace(node, token, tokenAfter) { + context.report({ + node, + loc: { start: token.loc.end, end: tokenAfter.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenBefore The token before `token`. + * @returns {void} + */ + function reportNoEndingSpace(node, token, tokenBefore) { + context.report({ + node, + loc: { start: tokenBefore.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Returns a function that checks the spacing of a node on the property name + * that was passed in. + * @param {string} propertyName The property on the node to check for spacing + * @returns {Function} A function that will check spacing on a node + */ + function checkSpacing(propertyName) { + return function(node) { + if (!node.computed) { + return; + } + + const property = node[propertyName]; + + const before = sourceCode.getTokenBefore(property, astUtils.isOpeningBracketToken), + first = sourceCode.getTokenAfter(before, { includeComments: true }), + after = sourceCode.getTokenAfter(property, astUtils.isClosingBracketToken), + last = sourceCode.getTokenBefore(after, { includeComments: true }); + + if (astUtils.isTokenOnSameLine(before, first)) { + if (propertyNameMustBeSpaced) { + if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) { + reportRequiredBeginningSpace(node, before); + } + } else { + if (sourceCode.isSpaceBetweenTokens(before, first)) { + reportNoBeginningSpace(node, before, first); + } + } + } + + if (astUtils.isTokenOnSameLine(last, after)) { + if (propertyNameMustBeSpaced) { + if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) { + reportRequiredEndingSpace(node, after); + } + } else { + if (sourceCode.isSpaceBetweenTokens(last, after)) { + reportNoEndingSpace(node, after, last); + } + } + } + }; + } + + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + const listeners = { + Property: checkSpacing("key"), + MemberExpression: checkSpacing("property") + }; + + if (enforceForClassMembers) { + listeners.MethodDefinition = + listeners.PropertyDefinition = listeners.Property; + } + + return listeners; + + } +}; diff --git a/node_modules/eslint/lib/rules/consistent-return.js b/node_modules/eslint/lib/rules/consistent-return.js new file mode 100644 index 0000000..f31c2e1 --- /dev/null +++ b/node_modules/eslint/lib/rules/consistent-return.js @@ -0,0 +1,210 @@ +/** + * @fileoverview Rule to flag consistent return values + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks all segments in a set and returns true if all are unreachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if all segments are unreachable; false otherwise. + */ +function areAllSegmentsUnreachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return false; + } + } + + return true; +} + +/** + * Checks whether a given node is a `constructor` method in an ES6 class + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node is a `constructor` method + */ +function isClassConstructor(node) { + return node.type === "FunctionExpression" && + node.parent && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require `return` statements to either always or never specify values", + recommended: false, + url: "https://eslint.org/docs/latest/rules/consistent-return" + }, + + schema: [{ + type: "object", + properties: { + treatUndefinedAsUnspecified: { + type: "boolean" + } + }, + additionalProperties: false + }], + + defaultOptions: [{ treatUndefinedAsUnspecified: false }], + + messages: { + missingReturn: "Expected to return a value at the end of {{name}}.", + missingReturnValue: "{{name}} expected a return value.", + unexpectedReturnValue: "{{name}} expected no return value." + } + }, + + create(context) { + const [{ treatUndefinedAsUnspecified }] = context.options; + let funcInfo = null; + + /** + * Checks whether of not the implicit returning is consistent if the last + * code path segment is reachable. + * @param {ASTNode} node A program/function node to check. + * @returns {void} + */ + function checkLastSegment(node) { + let loc, name; + + /* + * Skip if it expected no return value or unreachable. + * When unreachable, all paths are returned or thrown. + */ + if (!funcInfo.hasReturnValue || + areAllSegmentsUnreachable(funcInfo.currentSegments) || + astUtils.isES5Constructor(node) || + isClassConstructor(node) + ) { + return; + } + + // Adjust a location and a message. + if (node.type === "Program") { + + // The head of program. + loc = { line: 1, column: 0 }; + name = "program"; + } else if (node.type === "ArrowFunctionExpression") { + + // `=>` token + loc = context.sourceCode.getTokenBefore(node.body, astUtils.isArrowToken).loc; + } else if ( + node.parent.type === "MethodDefinition" || + (node.parent.type === "Property" && node.parent.method) + ) { + + // Method name. + loc = node.parent.key.loc; + } else { + + // Function name or `function` keyword. + loc = (node.id || context.sourceCode.getFirstToken(node)).loc; + } + + if (!name) { + name = astUtils.getFunctionNameWithKind(node); + } + + // Reports. + context.report({ + node, + loc, + messageId: "missingReturn", + data: { name } + }); + } + + return { + + // Initializes/Disposes state of each code path. + onCodePathStart(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath, + hasReturn: false, + hasReturnValue: false, + messageId: "", + node, + currentSegments: new Set() + }; + }, + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + + // Reports a given return statement if it's inconsistent. + ReturnStatement(node) { + const argument = node.argument; + let hasReturnValue = Boolean(argument); + + if (treatUndefinedAsUnspecified && hasReturnValue) { + hasReturnValue = !astUtils.isSpecificId(argument, "undefined") && argument.operator !== "void"; + } + + if (!funcInfo.hasReturn) { + funcInfo.hasReturn = true; + funcInfo.hasReturnValue = hasReturnValue; + funcInfo.messageId = hasReturnValue ? "missingReturnValue" : "unexpectedReturnValue"; + funcInfo.data = { + name: funcInfo.node.type === "Program" + ? "Program" + : upperCaseFirst(astUtils.getFunctionNameWithKind(funcInfo.node)) + }; + } else if (funcInfo.hasReturnValue !== hasReturnValue) { + context.report({ + node, + messageId: funcInfo.messageId, + data: funcInfo.data + }); + } + }, + + // Reports a given program/function if the implicit returning is not consistent. + "Program:exit": checkLastSegment, + "FunctionDeclaration:exit": checkLastSegment, + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/consistent-this.js b/node_modules/eslint/lib/rules/consistent-this.js new file mode 100644 index 0000000..732de7b --- /dev/null +++ b/node_modules/eslint/lib/rules/consistent-this.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Rule to enforce consistent naming of "this" context variables + * @author Raphael Pigulla + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce consistent naming when capturing the current execution context", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/consistent-this" + }, + + schema: { + type: "array", + items: { + type: "string", + minLength: 1 + }, + uniqueItems: true + }, + + defaultOptions: ["that"], + + messages: { + aliasNotAssignedToThis: "Designated alias '{{name}}' is not assigned to 'this'.", + unexpectedAlias: "Unexpected alias '{{name}}' for 'this'." + } + }, + + create(context) { + const aliases = context.options; + const sourceCode = context.sourceCode; + + /** + * Reports that a variable declarator or assignment expression is assigning + * a non-'this' value to the specified alias. + * @param {ASTNode} node The assigning node. + * @param {string} name the name of the alias that was incorrectly used. + * @returns {void} + */ + function reportBadAssignment(node, name) { + context.report({ node, messageId: "aliasNotAssignedToThis", data: { name } }); + } + + /** + * Checks that an assignment to an identifier only assigns 'this' to the + * appropriate alias, and the alias is only assigned to 'this'. + * @param {ASTNode} node The assigning node. + * @param {Identifier} name The name of the variable assigned to. + * @param {Expression} value The value of the assignment. + * @returns {void} + */ + function checkAssignment(node, name, value) { + const isThis = value.type === "ThisExpression"; + + if (aliases.includes(name)) { + if (!isThis || node.operator && node.operator !== "=") { + reportBadAssignment(node, name); + } + } else if (isThis) { + context.report({ node, messageId: "unexpectedAlias", data: { name } }); + } + } + + /** + * Ensures that a variable declaration of the alias in a program or function + * is assigned to the correct value. + * @param {string} alias alias the check the assignment of. + * @param {Object} scope scope of the current code we are checking. + * @private + * @returns {void} + */ + function checkWasAssigned(alias, scope) { + const variable = scope.set.get(alias); + + if (!variable) { + return; + } + + if (variable.defs.some(def => def.node.type === "VariableDeclarator" && + def.node.init !== null)) { + return; + } + + /* + * The alias has been declared and not assigned: check it was + * assigned later in the same scope. + */ + if (!variable.references.some(reference => { + const write = reference.writeExpr; + + return ( + reference.from === scope && + write && write.type === "ThisExpression" && + write.parent.operator === "=" + ); + })) { + variable.defs.map(def => def.node).forEach(node => { + reportBadAssignment(node, alias); + }); + } + } + + /** + * Check each alias to ensure that is was assigned to the correct value. + * @param {ASTNode} node The node that represents the scope to check. + * @returns {void} + */ + function ensureWasAssigned(node) { + const scope = sourceCode.getScope(node); + + // if this is program scope we also need to check module scope + const extraScope = node.type === "Program" && node.sourceType === "module" + ? scope.childScopes[0] + : null; + + aliases.forEach(alias => { + checkWasAssigned(alias, scope); + + if (extraScope) { + checkWasAssigned(alias, extraScope); + } + }); + } + + return { + "Program:exit": ensureWasAssigned, + "FunctionExpression:exit": ensureWasAssigned, + "FunctionDeclaration:exit": ensureWasAssigned, + + VariableDeclarator(node) { + const id = node.id; + const isDestructuring = + id.type === "ArrayPattern" || id.type === "ObjectPattern"; + + if (node.init !== null && !isDestructuring) { + checkAssignment(node, id.name, node.init); + } + }, + + AssignmentExpression(node) { + if (node.left.type === "Identifier") { + checkAssignment(node, node.left.name, node.right); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/constructor-super.js b/node_modules/eslint/lib/rules/constructor-super.js new file mode 100644 index 0000000..6f46278 --- /dev/null +++ b/node_modules/eslint/lib/rules/constructor-super.js @@ -0,0 +1,445 @@ +/** + * @fileoverview A rule to verify `super()` callings in constructor. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + +/** + * Checks whether a given node can be a constructor or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node can be a constructor. + */ +function isPossibleConstructor(node) { + if (!node) { + return false; + } + + switch (node.type) { + case "ClassExpression": + case "FunctionExpression": + case "ThisExpression": + case "MemberExpression": + case "CallExpression": + case "NewExpression": + case "ChainExpression": + case "YieldExpression": + case "TaggedTemplateExpression": + case "MetaProperty": + return true; + + case "Identifier": + return node.name !== "undefined"; + + case "AssignmentExpression": + if (["=", "&&="].includes(node.operator)) { + return isPossibleConstructor(node.right); + } + + if (["||=", "??="].includes(node.operator)) { + return ( + isPossibleConstructor(node.left) || + isPossibleConstructor(node.right) + ); + } + + /** + * All other assignment operators are mathematical assignment operators (arithmetic or bitwise). + * An assignment expression with a mathematical operator can either evaluate to a primitive value, + * or throw, depending on the operands. Thus, it cannot evaluate to a constructor function. + */ + return false; + + case "LogicalExpression": + + /* + * If the && operator short-circuits, the left side was falsy and therefore not a constructor, and if + * it doesn't short-circuit, it takes the value from the right side, so the right side must always be a + * possible constructor. A future improvement could verify that the left side could be truthy by + * excluding falsy literals. + */ + if (node.operator === "&&") { + return isPossibleConstructor(node.right); + } + + return ( + isPossibleConstructor(node.left) || + isPossibleConstructor(node.right) + ); + + case "ConditionalExpression": + return ( + isPossibleConstructor(node.alternate) || + isPossibleConstructor(node.consequent) + ); + + case "SequenceExpression": { + const lastExpression = node.expressions.at(-1); + + return isPossibleConstructor(lastExpression); + } + + default: + return false; + } +} + +/** + * A class to store information about a code path segment. + */ +class SegmentInfo { + + /** + * Indicates if super() is called in all code paths. + * @type {boolean} + */ + calledInEveryPaths = false; + + /** + * Indicates if super() is called in any code paths. + * @type {boolean} + */ + calledInSomePaths = false; + + /** + * The nodes which have been validated and don't need to be reconsidered. + * @type {ASTNode[]} + */ + validNodes = []; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Require `super()` calls in constructors", + recommended: true, + url: "https://eslint.org/docs/latest/rules/constructor-super" + }, + + schema: [], + + messages: { + missingSome: "Lacked a call of 'super()' in some code paths.", + missingAll: "Expected to call 'super()'.", + + duplicate: "Unexpected duplicate 'super()'.", + badSuper: "Unexpected 'super()' because 'super' is not a constructor." + } + }, + + create(context) { + + /* + * {{hasExtends: boolean, scope: Scope, codePath: CodePath}[]} + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether own class has a valid `extends` + * part. + * - scope: The scope of own class. + * - codePath: The code path object of the constructor. + */ + let funcInfo = null; + + /** + * @type {Record} + */ + const segInfoMap = Object.create(null); + + /** + * Gets the flag which shows `super()` is called in some paths. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in some paths + */ + function isCalledInSomePath(segment) { + return segment.reachable && segInfoMap[segment.id].calledInSomePaths; + } + + /** + * Determines if a segment has been seen in the traversal. + * @param {CodePathSegment} segment A code path segment to check. + * @returns {boolean} `true` if the segment has been seen. + */ + function hasSegmentBeenSeen(segment) { + return !!segInfoMap[segment.id]; + } + + /** + * Gets the flag which shows `super()` is called in all paths. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in all paths. + */ + function isCalledInEveryPath(segment) { + return segment.reachable && segInfoMap[segment.id].calledInEveryPaths; + } + + return { + + /** + * Stacks a constructor information. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathStart(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + const classNode = node.parent.parent.parent; + const superClass = classNode.superClass; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean(superClass), + superIsConstructor: isPossibleConstructor(superClass), + codePath, + currentSegments: new Set() + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + superIsConstructor: false, + codePath, + currentSegments: new Set() + }; + } + }, + + /** + * Pops a constructor information. + * And reports if `super()` lacked. + * @param {CodePath} codePath A code path which was ended. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathEnd(codePath, node) { + const hasExtends = funcInfo.hasExtends; + + // Pop. + funcInfo = funcInfo.upper; + + if (!hasExtends) { + return; + } + + // Reports if `super()` lacked. + const returnedSegments = codePath.returnedSegments; + const calledInEveryPaths = returnedSegments.every(isCalledInEveryPath); + const calledInSomePaths = returnedSegments.some(isCalledInSomePath); + + if (!calledInEveryPaths) { + context.report({ + messageId: calledInSomePaths + ? "missingSome" + : "missingAll", + node: node.parent + }); + } + }, + + /** + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment A code path segment to initialize. + * @param {CodePathSegment} node Node that starts the segment. + * @returns {void} + */ + onCodePathSegmentStart(segment, node) { + + funcInfo.currentSegments.add(segment); + + if (!(funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Initialize info. + const info = segInfoMap[segment.id] = new SegmentInfo(); + + const seenPrevSegments = segment.prevSegments.filter(hasSegmentBeenSeen); + + // When there are previous segments, aggregates these. + if (seenPrevSegments.length > 0) { + info.calledInSomePaths = seenPrevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = seenPrevSegments.every(isCalledInEveryPath); + } + + /* + * ForStatement > *.update segments are a special case as they are created in advance, + * without seen previous segments. Since they logically don't affect `calledInEveryPaths` + * calculations, and they can never be a lone previous segment of another one, we'll set + * their `calledInEveryPaths` to `true` to effectively ignore them in those calculations. + * . + */ + if (node.parent && node.parent.type === "ForStatement" && node.parent.update === node) { + info.calledInEveryPaths = true; + } + }, + + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment A code path segment of the head + * of a loop. + * @returns {void} + */ + onCodePathSegmentLoop(fromSegment, toSegment) { + if (!(funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + funcInfo.codePath.traverseSegments( + { first: toSegment, last: fromSegment }, + (segment, controller) => { + const info = segInfoMap[segment.id]; + + // skip segments after the loop + if (!info) { + controller.skip(); + return; + } + + const seenPrevSegments = segment.prevSegments.filter(hasSegmentBeenSeen); + const calledInSomePreviousPaths = seenPrevSegments.some(isCalledInSomePath); + const calledInEveryPreviousPaths = seenPrevSegments.every(isCalledInEveryPath); + + info.calledInSomePaths ||= calledInSomePreviousPaths; + info.calledInEveryPaths ||= calledInEveryPreviousPaths; + + // If flags become true anew, reports the valid nodes. + if (calledInSomePreviousPaths) { + const nodes = info.validNodes; + + info.validNodes = []; + + for (let i = 0; i < nodes.length; ++i) { + const node = nodes[i]; + + context.report({ + messageId: "duplicate", + node + }); + } + } + } + ); + }, + + /** + * Checks for a call of `super()`. + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + "CallExpression:exit"(node) { + if (!(funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Skips except `super()`. + if (node.callee.type !== "Super") { + return; + } + + // Reports if needed. + const segments = funcInfo.currentSegments; + let duplicate = false; + let info = null; + + for (const segment of segments) { + + if (segment.reachable) { + info = segInfoMap[segment.id]; + + duplicate = duplicate || info.calledInSomePaths; + info.calledInSomePaths = info.calledInEveryPaths = true; + } + } + + if (info) { + if (duplicate) { + context.report({ + messageId: "duplicate", + node + }); + } else if (!funcInfo.superIsConstructor) { + context.report({ + messageId: "badSuper", + node + }); + } else { + info.validNodes.push(node); + } + } + }, + + /** + * Set the mark to the returned path as `super()` was called. + * @param {ASTNode} node A ReturnStatement node to check. + * @returns {void} + */ + ReturnStatement(node) { + if (!(funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Skips if no argument. + if (!node.argument) { + return; + } + + // Returning argument is a substitute of 'super()'. + const segments = funcInfo.currentSegments; + + for (const segment of segments) { + + if (segment.reachable) { + const info = segInfoMap[segment.id]; + + info.calledInSomePaths = info.calledInEveryPaths = true; + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/curly.js b/node_modules/eslint/lib/rules/curly.js new file mode 100644 index 0000000..c08b7e3 --- /dev/null +++ b/node_modules/eslint/lib/rules/curly.js @@ -0,0 +1,350 @@ +/** + * @fileoverview Rule to flag statements without curly braces + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce consistent brace style for all control statements", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/curly" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["all"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["multi", "multi-line", "multi-or-nest"] + }, + { + enum: ["consistent"] + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + defaultOptions: ["all"], + + fixable: "code", + + messages: { + missingCurlyAfter: "Expected { after '{{name}}'.", + missingCurlyAfterCondition: "Expected { after '{{name}}' condition.", + unexpectedCurlyAfter: "Unnecessary { after '{{name}}'.", + unexpectedCurlyAfterCondition: "Unnecessary { after '{{name}}' condition." + } + }, + + create(context) { + const multiOnly = (context.options[0] === "multi"); + const multiLine = (context.options[0] === "multi-line"); + const multiOrNest = (context.options[0] === "multi-or-nest"); + const consistent = (context.options[1] === "consistent"); + + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines if a given node is a one-liner that's on the same line as it's preceding code. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code. + * @private + */ + function isCollapsedOneLiner(node) { + const before = sourceCode.getTokenBefore(node); + const last = sourceCode.getLastToken(node); + const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last; + + return before.loc.start.line === lastExcludingSemicolon.loc.end.line; + } + + /** + * Determines if a given node is a one-liner. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner. + * @private + */ + function isOneLiner(node) { + if (node.type === "EmptyStatement") { + return true; + } + + const first = sourceCode.getFirstToken(node); + const last = sourceCode.getLastToken(node); + const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last; + + return first.loc.start.line === lastExcludingSemicolon.loc.end.line; + } + + /** + * Determines if a semicolon needs to be inserted after removing a set of curly brackets, in order to avoid a SyntaxError. + * @param {Token} closingBracket The } token + * @returns {boolean} `true` if a semicolon needs to be inserted after the last statement in the block. + */ + function needsSemicolon(closingBracket) { + const tokenBefore = sourceCode.getTokenBefore(closingBracket); + const tokenAfter = sourceCode.getTokenAfter(closingBracket); + const lastBlockNode = sourceCode.getNodeByRangeIndex(tokenBefore.range[0]); + + if (astUtils.isSemicolonToken(tokenBefore)) { + + // If the last statement already has a semicolon, don't add another one. + return false; + } + + if (!tokenAfter) { + + // If there are no statements after this block, there is no need to add a semicolon. + return false; + } + + if (lastBlockNode.type === "BlockStatement" && lastBlockNode.parent.type !== "FunctionExpression" && lastBlockNode.parent.type !== "ArrowFunctionExpression") { + + /* + * If the last node surrounded by curly brackets is a BlockStatement (other than a FunctionExpression or an ArrowFunctionExpression), + * don't insert a semicolon. Otherwise, the semicolon would be parsed as a separate statement, which would cause + * a SyntaxError if it was followed by `else`. + */ + return false; + } + + if (tokenBefore.loc.end.line === tokenAfter.loc.start.line) { + + // If the next token is on the same line, insert a semicolon. + return true; + } + + if (/^[([/`+-]/u.test(tokenAfter.value)) { + + // If the next token starts with a character that would disrupt ASI, insert a semicolon. + return true; + } + + if (tokenBefore.type === "Punctuator" && (tokenBefore.value === "++" || tokenBefore.value === "--")) { + + // If the last token is ++ or --, insert a semicolon to avoid disrupting ASI. + return true; + } + + // Otherwise, do not insert a semicolon. + return false; + } + + /** + * Prepares to check the body of a node to see if it's a block statement. + * @param {ASTNode} node The node to report if there's a problem. + * @param {ASTNode} body The body node to check for blocks. + * @param {string} name The name to report if there's a problem. + * @param {{ condition: boolean }} opts Options to pass to the report functions + * @returns {Object} a prepared check object, with "actual", "expected", "check" properties. + * "actual" will be `true` or `false` whether the body is already a block statement. + * "expected" will be `true` or `false` if the body should be a block statement or not, or + * `null` if it doesn't matter, depending on the rule options. It can be modified to change + * the final behavior of "check". + * "check" will be a function reporting appropriate problems depending on the other + * properties. + */ + function prepareCheck(node, body, name, opts) { + const hasBlock = (body.type === "BlockStatement"); + let expected = null; + + if (hasBlock && (body.body.length !== 1 || astUtils.areBracesNecessary(body, sourceCode))) { + expected = true; + } else if (multiOnly) { + expected = false; + } else if (multiLine) { + if (!isCollapsedOneLiner(body)) { + expected = true; + } + + // otherwise, the body is allowed to have braces or not to have braces + + } else if (multiOrNest) { + if (hasBlock) { + const statement = body.body[0]; + const leadingCommentsInBlock = sourceCode.getCommentsBefore(statement); + + expected = !isOneLiner(statement) || leadingCommentsInBlock.length > 0; + } else { + expected = !isOneLiner(body); + } + } else { + + // default "all" + expected = true; + } + + return { + actual: hasBlock, + expected, + check() { + if (this.expected !== null && this.expected !== this.actual) { + if (this.expected) { + context.report({ + node, + loc: body.loc, + messageId: opts && opts.condition ? "missingCurlyAfterCondition" : "missingCurlyAfter", + data: { + name + }, + fix: fixer => fixer.replaceText(body, `{${sourceCode.getText(body)}}`) + }); + } else { + context.report({ + node, + loc: body.loc, + messageId: opts && opts.condition ? "unexpectedCurlyAfterCondition" : "unexpectedCurlyAfter", + data: { + name + }, + fix(fixer) { + + /* + * `do while` expressions sometimes need a space to be inserted after `do`. + * e.g. `do{foo()} while (bar)` should be corrected to `do foo() while (bar)` + */ + const needsPrecedingSpace = node.type === "DoWhileStatement" && + sourceCode.getTokenBefore(body).range[1] === body.range[0] && + !astUtils.canTokensBeAdjacent("do", sourceCode.getFirstToken(body, { skip: 1 })); + + const openingBracket = sourceCode.getFirstToken(body); + const closingBracket = sourceCode.getLastToken(body); + const lastTokenInBlock = sourceCode.getTokenBefore(closingBracket); + + if (needsSemicolon(closingBracket)) { + + /* + * If removing braces would cause a SyntaxError due to multiple statements on the same line (or + * change the semantics of the code due to ASI), don't perform a fix. + */ + return null; + } + + const resultingBodyText = sourceCode.getText().slice(openingBracket.range[1], lastTokenInBlock.range[0]) + + sourceCode.getText(lastTokenInBlock) + + sourceCode.getText().slice(lastTokenInBlock.range[1], closingBracket.range[0]); + + return fixer.replaceText(body, (needsPrecedingSpace ? " " : "") + resultingBodyText); + } + }); + } + } + } + }; + } + + /** + * Prepares to check the bodies of a "if", "else if" and "else" chain. + * @param {ASTNode} node The first IfStatement node of the chain. + * @returns {Object[]} prepared checks for each body of the chain. See `prepareCheck` for more + * information. + */ + function prepareIfChecks(node) { + const preparedChecks = []; + + for (let currentNode = node; currentNode; currentNode = currentNode.alternate) { + preparedChecks.push(prepareCheck(currentNode, currentNode.consequent, "if", { condition: true })); + if (currentNode.alternate && currentNode.alternate.type !== "IfStatement") { + preparedChecks.push(prepareCheck(currentNode, currentNode.alternate, "else")); + break; + } + } + + if (consistent) { + + /* + * If any node should have or already have braces, make sure they + * all have braces. + * If all nodes shouldn't have braces, make sure they don't. + */ + const expected = preparedChecks.some(preparedCheck => { + if (preparedCheck.expected !== null) { + return preparedCheck.expected; + } + return preparedCheck.actual; + }); + + preparedChecks.forEach(preparedCheck => { + preparedCheck.expected = expected; + }); + } + + return preparedChecks; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + IfStatement(node) { + const parent = node.parent; + const isElseIf = parent.type === "IfStatement" && parent.alternate === node; + + if (!isElseIf) { + + // This is a top `if`, check the whole `if-else-if` chain + prepareIfChecks(node).forEach(preparedCheck => { + preparedCheck.check(); + }); + } + + // Skip `else if`, it's already checked (when the top `if` was visited) + }, + + WhileStatement(node) { + prepareCheck(node, node.body, "while", { condition: true }).check(); + }, + + DoWhileStatement(node) { + prepareCheck(node, node.body, "do").check(); + }, + + ForStatement(node) { + prepareCheck(node, node.body, "for", { condition: true }).check(); + }, + + ForInStatement(node) { + prepareCheck(node, node.body, "for-in").check(); + }, + + ForOfStatement(node) { + prepareCheck(node, node.body, "for-of").check(); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-case-last.js b/node_modules/eslint/lib/rules/default-case-last.js new file mode 100644 index 0000000..3a47078 --- /dev/null +++ b/node_modules/eslint/lib/rules/default-case-last.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Rule to enforce `default` clauses in `switch` statements to be last + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce `default` clauses in `switch` statements to be last", + recommended: false, + url: "https://eslint.org/docs/latest/rules/default-case-last" + }, + + schema: [], + + messages: { + notLast: "Default clause should be the last clause." + } + }, + + create(context) { + return { + SwitchStatement(node) { + const cases = node.cases, + indexOfDefault = cases.findIndex(c => c.test === null); + + if (indexOfDefault !== -1 && indexOfDefault !== cases.length - 1) { + const defaultClause = cases[indexOfDefault]; + + context.report({ node: defaultClause, messageId: "notLast" }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-case.js b/node_modules/eslint/lib/rules/default-case.js new file mode 100644 index 0000000..9fa7acd --- /dev/null +++ b/node_modules/eslint/lib/rules/default-case.js @@ -0,0 +1,99 @@ +/** + * @fileoverview require default case in switch statements + * @author Aliaksei Shytkin + */ +"use strict"; + +const DEFAULT_COMMENT_PATTERN = /^no default$/iu; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{}], + + docs: { + description: "Require `default` cases in `switch` statements", + recommended: false, + url: "https://eslint.org/docs/latest/rules/default-case" + }, + + schema: [{ + type: "object", + properties: { + commentPattern: { + type: "string" + } + }, + additionalProperties: false + }], + + messages: { + missingDefaultCase: "Expected a default case." + } + }, + + create(context) { + const [options] = context.options; + const commentPattern = options.commentPattern + ? new RegExp(options.commentPattern, "u") + : DEFAULT_COMMENT_PATTERN; + + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Shortcut to get last element of array + * @param {*[]} collection Array + * @returns {any} Last element + */ + function last(collection) { + return collection.at(-1); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + SwitchStatement(node) { + + if (!node.cases.length) { + + /* + * skip check of empty switch because there is no easy way + * to extract comments inside it now + */ + return; + } + + const hasDefault = node.cases.some(v => v.test === null); + + if (!hasDefault) { + + let comment; + + const lastCase = last(node.cases); + const comments = sourceCode.getCommentsAfter(lastCase); + + if (comments.length) { + comment = last(comments); + } + + if (!comment || !commentPattern.test(comment.value.trim())) { + context.report({ node, messageId: "missingDefaultCase" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-param-last.js b/node_modules/eslint/lib/rules/default-param-last.js new file mode 100644 index 0000000..e1260c1 --- /dev/null +++ b/node_modules/eslint/lib/rules/default-param-last.js @@ -0,0 +1,63 @@ +/** + * @fileoverview enforce default parameters to be last + * @author Chiawen Chen + */ + +"use strict"; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce default parameters to be last", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/default-param-last" + }, + + schema: [], + + messages: { + shouldBeLast: "Default parameters should be last." + } + }, + + create(context) { + + /** + * Handler for function contexts. + * @param {ASTNode} node function node + * @returns {void} + */ + function handleFunction(node) { + let hasSeenPlainParam = false; + + for (let i = node.params.length - 1; i >= 0; i -= 1) { + const param = node.params[i]; + + if ( + param.type !== "AssignmentPattern" && + param.type !== "RestElement" + ) { + hasSeenPlainParam = true; + continue; + } + + if (hasSeenPlainParam && param.type === "AssignmentPattern") { + context.report({ + node: param, + messageId: "shouldBeLast" + }); + } + } + } + + return { + FunctionDeclaration: handleFunction, + FunctionExpression: handleFunction, + ArrowFunctionExpression: handleFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/dot-location.js b/node_modules/eslint/lib/rules/dot-location.js new file mode 100644 index 0000000..39b8a92 --- /dev/null +++ b/node_modules/eslint/lib/rules/dot-location.js @@ -0,0 +1,126 @@ +/** + * @fileoverview Validates newlines before and after dots + * @author Greg Cochard + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "dot-location", + url: "https://eslint.style/rules/js/dot-location" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent newlines before and after dots", + recommended: false, + url: "https://eslint.org/docs/latest/rules/dot-location" + }, + + schema: [ + { + enum: ["object", "property"] + } + ], + + fixable: "code", + + messages: { + expectedDotAfterObject: "Expected dot to be on same line as object.", + expectedDotBeforeProperty: "Expected dot to be on same line as property." + } + }, + + create(context) { + + const config = context.options[0]; + + // default to onObject if no preference is passed + const onObject = config === "object" || !config; + + const sourceCode = context.sourceCode; + + /** + * Reports if the dot between object and property is on the correct location. + * @param {ASTNode} node The `MemberExpression` node. + * @returns {void} + */ + function checkDotLocation(node) { + const property = node.property; + const dotToken = sourceCode.getTokenBefore(property); + + if (onObject) { + + // `obj` expression can be parenthesized, but those paren tokens are not a part of the `obj` node. + const tokenBeforeDot = sourceCode.getTokenBefore(dotToken); + + if (!astUtils.isTokenOnSameLine(tokenBeforeDot, dotToken)) { + context.report({ + node, + loc: dotToken.loc, + messageId: "expectedDotAfterObject", + *fix(fixer) { + if (dotToken.value.startsWith(".") && astUtils.isDecimalIntegerNumericToken(tokenBeforeDot)) { + yield fixer.insertTextAfter(tokenBeforeDot, ` ${dotToken.value}`); + } else { + yield fixer.insertTextAfter(tokenBeforeDot, dotToken.value); + } + yield fixer.remove(dotToken); + } + }); + } + } else if (!astUtils.isTokenOnSameLine(dotToken, property)) { + context.report({ + node, + loc: dotToken.loc, + messageId: "expectedDotBeforeProperty", + *fix(fixer) { + yield fixer.remove(dotToken); + yield fixer.insertTextBefore(property, dotToken.value); + } + }); + } + } + + /** + * Checks the spacing of the dot within a member expression. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNode(node) { + if (!node.computed) { + checkDotLocation(node); + } + } + + return { + MemberExpression: checkNode + }; + } +}; diff --git a/node_modules/eslint/lib/rules/dot-notation.js b/node_modules/eslint/lib/rules/dot-notation.js new file mode 100644 index 0000000..30537ae --- /dev/null +++ b/node_modules/eslint/lib/rules/dot-notation.js @@ -0,0 +1,180 @@ +/** + * @fileoverview Rule to warn about using dot notation instead of square bracket notation when possible. + * @author Josh Perez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u; + +// `null` literal must be handled separately. +const literalTypesToCheck = new Set(["string", "boolean"]); + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allowKeywords: true, + allowPattern: "" + }], + + docs: { + description: "Enforce dot notation whenever possible", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/dot-notation" + }, + + schema: [ + { + type: "object", + properties: { + allowKeywords: { + type: "boolean" + }, + allowPattern: { + type: "string" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + useDot: "[{{key}}] is better written in dot notation.", + useBrackets: ".{{key}} is a syntax error." + } + }, + + create(context) { + const [options] = context.options; + const allowKeywords = options.allowKeywords; + const sourceCode = context.sourceCode; + + let allowPattern; + + if (options.allowPattern) { + allowPattern = new RegExp(options.allowPattern, "u"); + } + + /** + * Check if the property is valid dot notation + * @param {ASTNode} node The dot notation node + * @param {string} value Value which is to be checked + * @returns {void} + */ + function checkComputedProperty(node, value) { + if ( + validIdentifier.test(value) && + (allowKeywords || !keywords.includes(String(value))) && + !(allowPattern && allowPattern.test(value)) + ) { + const formattedValue = node.property.type === "Literal" ? JSON.stringify(value) : `\`${value}\``; + + context.report({ + node: node.property, + messageId: "useDot", + data: { + key: formattedValue + }, + *fix(fixer) { + const leftBracket = sourceCode.getTokenAfter(node.object, astUtils.isOpeningBracketToken); + const rightBracket = sourceCode.getLastToken(node); + const nextToken = sourceCode.getTokenAfter(node); + + // Don't perform any fixes if there are comments inside the brackets. + if (sourceCode.commentsExistBetween(leftBracket, rightBracket)) { + return; + } + + // Replace the brackets by an identifier. + if (!node.optional) { + yield fixer.insertTextBefore( + leftBracket, + astUtils.isDecimalInteger(node.object) ? " ." : "." + ); + } + yield fixer.replaceTextRange( + [leftBracket.range[0], rightBracket.range[1]], + value + ); + + // Insert a space after the property if it will be connected to the next token. + if ( + nextToken && + rightBracket.range[1] === nextToken.range[0] && + !astUtils.canTokensBeAdjacent(String(value), nextToken) + ) { + yield fixer.insertTextAfter(node, " "); + } + } + }); + } + } + + return { + MemberExpression(node) { + if ( + node.computed && + node.property.type === "Literal" && + (literalTypesToCheck.has(typeof node.property.value) || astUtils.isNullLiteral(node.property)) + ) { + checkComputedProperty(node, node.property.value); + } + if ( + node.computed && + astUtils.isStaticTemplateLiteral(node.property) + ) { + checkComputedProperty(node, node.property.quasis[0].value.cooked); + } + if ( + !allowKeywords && + !node.computed && + node.property.type === "Identifier" && + keywords.includes(String(node.property.name)) + ) { + context.report({ + node: node.property, + messageId: "useBrackets", + data: { + key: node.property.name + }, + *fix(fixer) { + const dotToken = sourceCode.getTokenBefore(node.property); + + // A statement that starts with `let[` is parsed as a destructuring variable declaration, not a MemberExpression. + if (node.object.type === "Identifier" && node.object.name === "let" && !node.optional) { + return; + } + + // Don't perform any fixes if there are comments between the dot and the property name. + if (sourceCode.commentsExistBetween(dotToken, node.property)) { + return; + } + + // Replace the identifier to brackets. + if (!node.optional) { + yield fixer.remove(dotToken); + } + yield fixer.replaceText(node.property, `["${node.property.name}"]`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/eol-last.js b/node_modules/eslint/lib/rules/eol-last.js new file mode 100644 index 0000000..45ff593 --- /dev/null +++ b/node_modules/eslint/lib/rules/eol-last.js @@ -0,0 +1,133 @@ +/** + * @fileoverview Require or disallow newline at the end of files + * @author Nodeca Team + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "eol-last", + url: "https://eslint.style/rules/js/eol-last" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow newline at the end of files", + recommended: false, + url: "https://eslint.org/docs/latest/rules/eol-last" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "unix", "windows"] + } + ], + + messages: { + missing: "Newline required at end of file but not found.", + unexpected: "Newline not allowed at end of file." + } + }, + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkBadEOF(node) { + const sourceCode = context.sourceCode, + src = sourceCode.getText(), + lastLine = sourceCode.lines.at(-1), + location = { + column: lastLine.length, + line: sourceCode.lines.length + }, + LF = "\n", + CRLF = `\r${LF}`, + endsWithNewline = src.endsWith(LF); + + /* + * Empty source is always valid: No content in file so we don't + * need to lint for a newline on the last line of content. + */ + if (!src.length) { + return; + } + + let mode = context.options[0] || "always", + appendCRLF = false; + + if (mode === "unix") { + + // `"unix"` should behave exactly as `"always"` + mode = "always"; + } + if (mode === "windows") { + + // `"windows"` should behave exactly as `"always"`, but append CRLF in the fixer for backwards compatibility + mode = "always"; + appendCRLF = true; + } + if (mode === "always" && !endsWithNewline) { + + // File is not newline-terminated, but should be + context.report({ + node, + loc: location, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfterRange([0, src.length], appendCRLF ? CRLF : LF); + } + }); + } else if (mode === "never" && endsWithNewline) { + + const secondLastLine = sourceCode.lines.at(-2); + + // File is newline-terminated, but shouldn't be + context.report({ + node, + loc: { + start: { line: sourceCode.lines.length - 1, column: secondLastLine.length }, + end: { line: sourceCode.lines.length, column: 0 } + }, + messageId: "unexpected", + fix(fixer) { + const finalEOLs = /(?:\r?\n)+$/u, + match = finalEOLs.exec(sourceCode.text), + start = match.index, + end = sourceCode.text.length; + + return fixer.replaceTextRange([start, end], ""); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/eqeqeq.js b/node_modules/eslint/lib/rules/eqeqeq.js new file mode 100644 index 0000000..12b1e80 --- /dev/null +++ b/node_modules/eslint/lib/rules/eqeqeq.js @@ -0,0 +1,174 @@ +/** + * @fileoverview Rule to flag statements that use != and == instead of !== and === + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require the use of `===` and `!==`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/eqeqeq" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + null: { + enum: ["always", "never", "ignore"] + } + }, + additionalProperties: false + } + ], + additionalItems: false + }, + { + type: "array", + items: [ + { + enum: ["smart", "allow-null"] + } + ], + additionalItems: false + } + ] + }, + + fixable: "code", + + messages: { + unexpected: "Expected '{{expectedOperator}}' and instead saw '{{actualOperator}}'." + } + }, + + create(context) { + const config = context.options[0] || "always"; + const options = context.options[1] || {}; + const sourceCode = context.sourceCode; + + const nullOption = (config === "always") + ? options.null || "always" + : "ignore"; + const enforceRuleForNull = (nullOption === "always"); + const enforceInverseRuleForNull = (nullOption === "never"); + + /** + * Checks if an expression is a typeof expression + * @param {ASTNode} node The node to check + * @returns {boolean} if the node is a typeof expression + */ + function isTypeOf(node) { + return node.type === "UnaryExpression" && node.operator === "typeof"; + } + + /** + * Checks if either operand of a binary expression is a typeof operation + * @param {ASTNode} node The node to check + * @returns {boolean} if one of the operands is typeof + * @private + */ + function isTypeOfBinary(node) { + return isTypeOf(node.left) || isTypeOf(node.right); + } + + /** + * Checks if operands are literals of the same type (via typeof) + * @param {ASTNode} node The node to check + * @returns {boolean} if operands are of same type + * @private + */ + function areLiteralsAndSameType(node) { + return node.left.type === "Literal" && node.right.type === "Literal" && + typeof node.left.value === typeof node.right.value; + } + + /** + * Checks if one of the operands is a literal null + * @param {ASTNode} node The node to check + * @returns {boolean} if operands are null + * @private + */ + function isNullCheck(node) { + return astUtils.isNullLiteral(node.right) || astUtils.isNullLiteral(node.left); + } + + /** + * Reports a message for this rule. + * @param {ASTNode} node The binary expression node that was checked + * @param {string} expectedOperator The operator that was expected (either '==', '!=', '===', or '!==') + * @returns {void} + * @private + */ + function report(node, expectedOperator) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + + context.report({ + node, + loc: operatorToken.loc, + messageId: "unexpected", + data: { expectedOperator, actualOperator: node.operator }, + fix(fixer) { + + // If the comparison is a `typeof` comparison or both sides are literals with the same type, then it's safe to fix. + if (isTypeOfBinary(node) || areLiteralsAndSameType(node)) { + return fixer.replaceText(operatorToken, expectedOperator); + } + return null; + } + }); + } + + return { + BinaryExpression(node) { + const isNull = isNullCheck(node); + + if (node.operator !== "==" && node.operator !== "!=") { + if (enforceInverseRuleForNull && isNull) { + report(node, node.operator.slice(0, -1)); + } + return; + } + + if (config === "smart" && (isTypeOfBinary(node) || + areLiteralsAndSameType(node) || isNull)) { + return; + } + + if (!enforceRuleForNull && isNull) { + return; + } + + report(node, `${node.operator}=`); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/for-direction.js b/node_modules/eslint/lib/rules/for-direction.js new file mode 100644 index 0000000..f386d83 --- /dev/null +++ b/node_modules/eslint/lib/rules/for-direction.js @@ -0,0 +1,140 @@ +/** + * @fileoverview enforce `for` loop update clause moving the counter in the right direction.(for-direction) + * @author Aladdin-ADD + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticValue } = require("@eslint-community/eslint-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Enforce `for` loop update clause moving the counter in the right direction", + recommended: true, + url: "https://eslint.org/docs/latest/rules/for-direction" + }, + + fixable: null, + schema: [], + + messages: { + incorrectDirection: "The update clause in this loop moves the variable in the wrong direction." + } + }, + + create(context) { + const { sourceCode } = context; + + /** + * report an error. + * @param {ASTNode} node the node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "incorrectDirection" + }); + } + + /** + * check the right side of the assignment + * @param {ASTNode} update UpdateExpression to check + * @param {int} dir expected direction that could either be turned around or invalidated + * @returns {int} return dir, the negated dir, or zero if the counter does not change or the direction is not clear + */ + function getRightDirection(update, dir) { + const staticValue = getStaticValue(update.right, sourceCode.getScope(update)); + + if (staticValue && ["bigint", "boolean", "number"].includes(typeof staticValue.value)) { + const sign = Math.sign(Number(staticValue.value)) || 0; // convert NaN to 0 + + return dir * sign; + } + return 0; + } + + /** + * check UpdateExpression add/sub the counter + * @param {ASTNode} update UpdateExpression to check + * @param {string} counter variable name to check + * @returns {int} if add return 1, if sub return -1, if nochange, return 0 + */ + function getUpdateDirection(update, counter) { + if (update.argument.type === "Identifier" && update.argument.name === counter) { + if (update.operator === "++") { + return 1; + } + if (update.operator === "--") { + return -1; + } + } + return 0; + } + + /** + * check AssignmentExpression add/sub the counter + * @param {ASTNode} update AssignmentExpression to check + * @param {string} counter variable name to check + * @returns {int} if add return 1, if sub return -1, if nochange, return 0 + */ + function getAssignmentDirection(update, counter) { + if (update.left.name === counter) { + if (update.operator === "+=") { + return getRightDirection(update, 1); + } + if (update.operator === "-=") { + return getRightDirection(update, -1); + } + } + return 0; + } + + return { + ForStatement(node) { + + if (node.test && node.test.type === "BinaryExpression" && node.update) { + for (const counterPosition of ["left", "right"]) { + if (node.test[counterPosition].type !== "Identifier") { + continue; + } + + const counter = node.test[counterPosition].name; + const operator = node.test.operator; + const update = node.update; + + let wrongDirection; + + if (operator === "<" || operator === "<=") { + wrongDirection = counterPosition === "left" ? -1 : 1; + } else if (operator === ">" || operator === ">=") { + wrongDirection = counterPosition === "left" ? 1 : -1; + } else { + return; + } + + if (update.type === "UpdateExpression") { + if (getUpdateDirection(update, counter) === wrongDirection) { + report(node); + } + } else if (update.type === "AssignmentExpression" && getAssignmentDirection(update, counter) === wrongDirection) { + report(node); + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-call-spacing.js b/node_modules/eslint/lib/rules/func-call-spacing.js new file mode 100644 index 0000000..4757b7a --- /dev/null +++ b/node_modules/eslint/lib/rules/func-call-spacing.js @@ -0,0 +1,251 @@ +/** + * @fileoverview Rule to control spacing within function calls + * @author Matt DuVall + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "function-call-spacing", + url: "https://eslint.style/rules/js/function-call-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow spacing between function identifiers and their invocations", + recommended: false, + url: "https://eslint.org/docs/latest/rules/func-call-spacing" + }, + + fixable: "whitespace", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + allowNewlines: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + unexpectedWhitespace: "Unexpected whitespace between function name and paren.", + unexpectedNewline: "Unexpected newline between function name and paren.", + missing: "Missing space between function name and paren." + } + }, + + create(context) { + + const never = context.options[0] !== "always"; + const allowNewlines = !never && context.options[1] && context.options[1].allowNewlines; + const sourceCode = context.sourceCode; + const text = sourceCode.getText(); + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @param {Token} leftToken The last token of the callee. This may be the closing parenthesis that encloses the callee. + * @param {Token} rightToken Tha first token of the arguments. this is the opening parenthesis that encloses the arguments. + * @returns {void} + * @private + */ + function checkSpacing(node, leftToken, rightToken) { + const textBetweenTokens = text.slice(leftToken.range[1], rightToken.range[0]).replace(/\/\*.*?\*\//gu, ""); + const hasWhitespace = /\s/u.test(textBetweenTokens); + const hasNewline = hasWhitespace && astUtils.LINEBREAK_MATCHER.test(textBetweenTokens); + + /* + * never allowNewlines hasWhitespace hasNewline message + * F F F F Missing space between function name and paren. + * F F F T (Invalid `!hasWhitespace && hasNewline`) + * F F T T Unexpected newline between function name and paren. + * F F T F (OK) + * F T T F (OK) + * F T T T (OK) + * F T F T (Invalid `!hasWhitespace && hasNewline`) + * F T F F Missing space between function name and paren. + * T T F F (Invalid `never && allowNewlines`) + * T T F T (Invalid `!hasWhitespace && hasNewline`) + * T T T T (Invalid `never && allowNewlines`) + * T T T F (Invalid `never && allowNewlines`) + * T F T F Unexpected space between function name and paren. + * T F T T Unexpected space between function name and paren. + * T F F T (Invalid `!hasWhitespace && hasNewline`) + * T F F F (OK) + * + * T T Unexpected space between function name and paren. + * F F Missing space between function name and paren. + * F F T Unexpected newline between function name and paren. + */ + + if (never && hasWhitespace) { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: { + line: rightToken.loc.start.line, + column: rightToken.loc.start.column - 1 + } + }, + messageId: "unexpectedWhitespace", + fix(fixer) { + + // Don't remove comments. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + // If `?.` exists, it doesn't hide no-unexpected-multiline errors + if (node.optional) { + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], "?."); + } + + /* + * Only autofix if there is no newline + * https://github.com/eslint/eslint/issues/7787 + */ + if (hasNewline) { + return null; + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } else if (!never && !hasWhitespace) { + context.report({ + node, + loc: { + start: { + line: leftToken.loc.end.line, + column: leftToken.loc.end.column - 1 + }, + end: rightToken.loc.start + }, + messageId: "missing", + fix(fixer) { + if (node.optional) { + return null; // Not sure if inserting a space to either before/after `?.` token. + } + return fixer.insertTextBefore(rightToken, " "); + } + }); + } else if (!never && !allowNewlines && hasNewline) { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start + }, + messageId: "unexpectedNewline", + fix(fixer) { + + /* + * Only autofix if there is no newline + * https://github.com/eslint/eslint/issues/7787 + * But if `?.` exists, it doesn't hide no-unexpected-multiline errors + */ + if (!node.optional) { + return null; + } + + // Don't remove comments. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + const range = [leftToken.range[1], rightToken.range[0]]; + const qdToken = sourceCode.getTokenAfter(leftToken); + + if (qdToken.range[0] === leftToken.range[1]) { + return fixer.replaceTextRange(range, "?. "); + } + if (qdToken.range[1] === rightToken.range[0]) { + return fixer.replaceTextRange(range, " ?."); + } + return fixer.replaceTextRange(range, " ?. "); + } + }); + } + } + + return { + "CallExpression, NewExpression"(node) { + const lastToken = sourceCode.getLastToken(node); + const lastCalleeToken = sourceCode.getLastToken(node.callee); + const parenToken = sourceCode.getFirstTokenBetween(lastCalleeToken, lastToken, astUtils.isOpeningParenToken); + const prevToken = parenToken && sourceCode.getTokenBefore(parenToken, astUtils.isNotQuestionDotToken); + + // Parens in NewExpression are optional + if (!(parenToken && parenToken.range[1] < node.range[1])) { + return; + } + + checkSpacing(node, prevToken, parenToken); + }, + + ImportExpression(node) { + const leftToken = sourceCode.getFirstToken(node); + const rightToken = sourceCode.getTokenAfter(leftToken); + + checkSpacing(node, leftToken, rightToken); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/func-name-matching.js b/node_modules/eslint/lib/rules/func-name-matching.js new file mode 100644 index 0000000..b71e6e6 --- /dev/null +++ b/node_modules/eslint/lib/rules/func-name-matching.js @@ -0,0 +1,254 @@ +/** + * @fileoverview Rule to require function names to match the name of the variable or property to which they are assigned. + * @author Annie Zhang, Pavel Strashkin + */ + +"use strict"; + +//-------------------------------------------------------------------------- +// Requirements +//-------------------------------------------------------------------------- + +const astUtils = require("./utils/ast-utils"); +const esutils = require("esutils"); + +//-------------------------------------------------------------------------- +// Helpers +//-------------------------------------------------------------------------- + +/** + * Determines if a pattern is `module.exports` or `module["exports"]` + * @param {ASTNode} pattern The left side of the AssignmentExpression + * @returns {boolean} True if the pattern is `module.exports` or `module["exports"]` + */ +function isModuleExports(pattern) { + if (pattern.type === "MemberExpression" && pattern.object.type === "Identifier" && pattern.object.name === "module") { + + // module.exports + if (pattern.property.type === "Identifier" && pattern.property.name === "exports") { + return true; + } + + // module["exports"] + if (pattern.property.type === "Literal" && pattern.property.value === "exports") { + return true; + } + } + return false; +} + +/** + * Determines if a string name is a valid identifier + * @param {string} name The string to be checked + * @param {int} ecmaVersion The ECMAScript version if specified in the parserOptions config + * @returns {boolean} True if the string is a valid identifier + */ +function isIdentifier(name, ecmaVersion) { + if (ecmaVersion >= 2015) { + return esutils.keyword.isIdentifierES6(name); + } + return esutils.keyword.isIdentifierES5(name); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const alwaysOrNever = { enum: ["always", "never"] }; +const optionsObject = { + type: "object", + properties: { + considerPropertyDescriptor: { + type: "boolean" + }, + includeCommonJSModuleExports: { + type: "boolean" + } + }, + additionalProperties: false +}; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require function names to match the name of the variable or property to which they are assigned", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/func-name-matching" + }, + + schema: { + anyOf: [{ + type: "array", + additionalItems: false, + items: [alwaysOrNever, optionsObject] + }, { + type: "array", + additionalItems: false, + items: [optionsObject] + }] + }, + + messages: { + matchProperty: "Function name `{{funcName}}` should match property name `{{name}}`.", + matchVariable: "Function name `{{funcName}}` should match variable name `{{name}}`.", + notMatchProperty: "Function name `{{funcName}}` should not match property name `{{name}}`.", + notMatchVariable: "Function name `{{funcName}}` should not match variable name `{{name}}`." + } + }, + + create(context) { + const options = (typeof context.options[0] === "object" ? context.options[0] : context.options[1]) || {}; + const nameMatches = typeof context.options[0] === "string" ? context.options[0] : "always"; + const considerPropertyDescriptor = options.considerPropertyDescriptor; + const includeModuleExports = options.includeCommonJSModuleExports; + const ecmaVersion = context.languageOptions.ecmaVersion; + + /** + * Check whether node is a certain CallExpression. + * @param {string} objName object name + * @param {string} funcName function name + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if node matches CallExpression + */ + function isPropertyCall(objName, funcName, node) { + if (!node) { + return false; + } + return node.type === "CallExpression" && astUtils.isSpecificMemberAccess(node.callee, objName, funcName); + } + + /** + * Compares identifiers based on the nameMatches option + * @param {string} x the first identifier + * @param {string} y the second identifier + * @returns {boolean} whether the two identifiers should warn. + */ + function shouldWarn(x, y) { + return (nameMatches === "always" && x !== y) || (nameMatches === "never" && x === y); + } + + /** + * Reports + * @param {ASTNode} node The node to report + * @param {string} name The variable or property name + * @param {string} funcName The function name + * @param {boolean} isProp True if the reported node is a property assignment + * @returns {void} + */ + function report(node, name, funcName, isProp) { + let messageId; + + if (nameMatches === "always" && isProp) { + messageId = "matchProperty"; + } else if (nameMatches === "always") { + messageId = "matchVariable"; + } else if (isProp) { + messageId = "notMatchProperty"; + } else { + messageId = "notMatchVariable"; + } + context.report({ + node, + messageId, + data: { + name, + funcName + } + }); + } + + /** + * Determines whether a given node is a string literal + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the node is a string literal + */ + function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclarator(node) { + if (!node.init || node.init.type !== "FunctionExpression" || node.id.type !== "Identifier") { + return; + } + if (node.init.id && shouldWarn(node.id.name, node.init.id.name)) { + report(node, node.id.name, node.init.id.name, false); + } + }, + + AssignmentExpression(node) { + if ( + node.right.type !== "FunctionExpression" || + (node.left.computed && node.left.property.type !== "Literal") || + (!includeModuleExports && isModuleExports(node.left)) || + (node.left.type !== "Identifier" && node.left.type !== "MemberExpression") + ) { + return; + } + + const isProp = node.left.type === "MemberExpression"; + const name = isProp ? astUtils.getStaticPropertyName(node.left) : node.left.name; + + if (node.right.id && name && isIdentifier(name) && shouldWarn(name, node.right.id.name)) { + report(node, name, node.right.id.name, isProp); + } + }, + + "Property, PropertyDefinition[value]"(node) { + if (!(node.value.type === "FunctionExpression" && node.value.id)) { + return; + } + + if (node.key.type === "Identifier" && !node.computed) { + const functionName = node.value.id.name; + let propertyName = node.key.name; + + if ( + considerPropertyDescriptor && + propertyName === "value" && + node.parent.type === "ObjectExpression" + ) { + if (isPropertyCall("Object", "defineProperty", node.parent.parent) || isPropertyCall("Reflect", "defineProperty", node.parent.parent)) { + const property = node.parent.parent.arguments[1]; + + if (isStringLiteral(property) && shouldWarn(property.value, functionName)) { + report(node, property.value, functionName, true); + } + } else if (isPropertyCall("Object", "defineProperties", node.parent.parent.parent.parent)) { + propertyName = node.parent.parent.key.name; + if (!node.parent.parent.computed && shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (isPropertyCall("Object", "create", node.parent.parent.parent.parent)) { + propertyName = node.parent.parent.key.name; + if (!node.parent.parent.computed && shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + return; + } + + if ( + isStringLiteral(node.key) && + isIdentifier(node.key.value, ecmaVersion) && + shouldWarn(node.key.value, node.value.id.name) + ) { + report(node, node.key.value, node.value.id.name, true); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-names.js b/node_modules/eslint/lib/rules/func-names.js new file mode 100644 index 0000000..6990f0c --- /dev/null +++ b/node_modules/eslint/lib/rules/func-names.js @@ -0,0 +1,191 @@ +/** + * @fileoverview Rule to warn when a function expression does not have a name. + * @author Kyle T. Nunery + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +/** + * Checks whether or not a given variable is a function name. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["always", {}], + + docs: { + description: "Require or disallow named `function` expressions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/func-names" + }, + + schema: { + definitions: { + value: { + enum: [ + "always", + "as-needed", + "never" + ] + } + }, + items: [ + { + $ref: "#/definitions/value" + }, + { + type: "object", + properties: { + generators: { + $ref: "#/definitions/value" + } + }, + additionalProperties: false + } + ] + }, + + messages: { + unnamed: "Unexpected unnamed {{name}}.", + named: "Unexpected named {{name}}." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Returns the config option for the given node. + * @param {ASTNode} node A node to get the config for. + * @returns {string} The config option. + */ + function getConfigForNode(node) { + if ( + node.generator && + context.options[1].generators + ) { + return context.options[1].generators; + } + + return context.options[0]; + } + + /** + * Determines whether the current FunctionExpression node is a get, set, or + * shorthand method in an object literal or a class. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is a get, set, or shorthand method. + */ + function isObjectOrClassMethod(node) { + const parent = node.parent; + + return (parent.type === "MethodDefinition" || ( + parent.type === "Property" && ( + parent.method || + parent.kind === "get" || + parent.kind === "set" + ) + )); + } + + /** + * Determines whether the current FunctionExpression node has a name that would be + * inferred from context in a conforming ES6 environment. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node would have a name assigned automatically. + */ + function hasInferredName(node) { + const parent = node.parent; + + return isObjectOrClassMethod(node) || + (parent.type === "VariableDeclarator" && parent.id.type === "Identifier" && parent.init === node) || + (parent.type === "Property" && parent.value === node) || + (parent.type === "PropertyDefinition" && parent.value === node) || + (parent.type === "AssignmentExpression" && parent.left.type === "Identifier" && parent.right === node) || + (parent.type === "AssignmentPattern" && parent.left.type === "Identifier" && parent.right === node); + } + + /** + * Reports that an unnamed function should be named + * @param {ASTNode} node The node to report in the event of an error. + * @returns {void} + */ + function reportUnexpectedUnnamedFunction(node) { + context.report({ + node, + messageId: "unnamed", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + + /** + * Reports that a named function should be unnamed + * @param {ASTNode} node The node to report in the event of an error. + * @returns {void} + */ + function reportUnexpectedNamedFunction(node) { + context.report({ + node, + messageId: "named", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + + /** + * The listener for function nodes. + * @param {ASTNode} node function node + * @returns {void} + */ + function handleFunction(node) { + + // Skip recursive functions. + const nameVar = sourceCode.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + const hasName = Boolean(node.id && node.id.name); + const config = getConfigForNode(node); + + if (config === "never") { + if (hasName && node.type !== "FunctionDeclaration") { + reportUnexpectedNamedFunction(node); + } + } else if (config === "as-needed") { + if (!hasName && !hasInferredName(node)) { + reportUnexpectedUnnamedFunction(node); + } + } else { + if (!hasName && !isObjectOrClassMethod(node)) { + reportUnexpectedUnnamedFunction(node); + } + } + } + + return { + "FunctionExpression:exit": handleFunction, + "ExportDefaultDeclaration > FunctionDeclaration": handleFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-style.js b/node_modules/eslint/lib/rules/func-style.js new file mode 100644 index 0000000..be22983 --- /dev/null +++ b/node_modules/eslint/lib/rules/func-style.js @@ -0,0 +1,139 @@ +/** + * @fileoverview Rule to enforce a particular function style + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["expression", { + allowArrowFunctions: false, + overrides: {} + }], + + docs: { + description: "Enforce the consistent use of either `function` declarations or expressions assigned to variables", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/func-style" + }, + + schema: [ + { + enum: ["declaration", "expression"] + }, + { + type: "object", + properties: { + allowArrowFunctions: { + type: "boolean" + }, + overrides: { + type: "object", + properties: { + namedExports: { + enum: ["declaration", "expression", "ignore"] + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + expression: "Expected a function expression.", + declaration: "Expected a function declaration." + } + }, + + create(context) { + const [style, { allowArrowFunctions, overrides }] = context.options; + const enforceDeclarations = (style === "declaration"); + const { namedExports: exportFunctionStyle } = overrides; + const stack = []; + + const nodesToCheck = { + FunctionDeclaration(node) { + stack.push(false); + + if ( + !enforceDeclarations && + node.parent.type !== "ExportDefaultDeclaration" && + (typeof exportFunctionStyle === "undefined" || node.parent.type !== "ExportNamedDeclaration") + ) { + context.report({ node, messageId: "expression" }); + } + + if (node.parent.type === "ExportNamedDeclaration" && exportFunctionStyle === "expression") { + context.report({ node, messageId: "expression" }); + } + }, + "FunctionDeclaration:exit"() { + stack.pop(); + }, + + FunctionExpression(node) { + stack.push(false); + + if ( + enforceDeclarations && + node.parent.type === "VariableDeclarator" && + (typeof exportFunctionStyle === "undefined" || node.parent.parent.parent.type !== "ExportNamedDeclaration") + ) { + context.report({ node: node.parent, messageId: "declaration" }); + } + + if ( + node.parent.type === "VariableDeclarator" && node.parent.parent.parent.type === "ExportNamedDeclaration" && + exportFunctionStyle === "declaration" + ) { + context.report({ node: node.parent, messageId: "declaration" }); + } + }, + "FunctionExpression:exit"() { + stack.pop(); + }, + + "ThisExpression, Super"() { + if (stack.length > 0) { + stack[stack.length - 1] = true; + } + } + }; + + if (!allowArrowFunctions) { + nodesToCheck.ArrowFunctionExpression = function() { + stack.push(false); + }; + + nodesToCheck["ArrowFunctionExpression:exit"] = function(node) { + const hasThisOrSuperExpr = stack.pop(); + + if (!hasThisOrSuperExpr && node.parent.type === "VariableDeclarator") { + if ( + enforceDeclarations && + (typeof exportFunctionStyle === "undefined" || node.parent.parent.parent.type !== "ExportNamedDeclaration") + ) { + context.report({ node: node.parent, messageId: "declaration" }); + } + + if (node.parent.parent.parent.type === "ExportNamedDeclaration" && exportFunctionStyle === "declaration") { + context.report({ node: node.parent, messageId: "declaration" }); + } + } + }; + } + + return nodesToCheck; + + } +}; diff --git a/node_modules/eslint/lib/rules/function-call-argument-newline.js b/node_modules/eslint/lib/rules/function-call-argument-newline.js new file mode 100644 index 0000000..2a4f0b9 --- /dev/null +++ b/node_modules/eslint/lib/rules/function-call-argument-newline.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Rule to enforce line breaks between arguments of a function call + * @author Alexey Gonchar + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "function-call-argument-newline", + url: "https://eslint.style/rules/js/function-call-argument-newline" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce line breaks between arguments of a function call", + recommended: false, + url: "https://eslint.org/docs/latest/rules/function-call-argument-newline" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "consistent"] + } + ], + + messages: { + unexpectedLineBreak: "There should be no line break here.", + missingLineBreak: "There should be a line break after this argument." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + const checkers = { + unexpected: { + messageId: "unexpectedLineBreak", + check: (prevToken, currentToken) => prevToken.loc.end.line !== currentToken.loc.start.line, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " ") + }, + missing: { + messageId: "missingLineBreak", + check: (prevToken, currentToken) => prevToken.loc.end.line === currentToken.loc.start.line, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n") + } + }; + + /** + * Check all arguments for line breaks in the CallExpression + * @param {CallExpression} node node to evaluate + * @param {{ messageId: string, check: Function }} checker selected checker + * @returns {void} + * @private + */ + function checkArguments(node, checker) { + for (let i = 1; i < node.arguments.length; i++) { + const prevArgToken = sourceCode.getLastToken(node.arguments[i - 1]); + const currentArgToken = sourceCode.getFirstToken(node.arguments[i]); + + if (checker.check(prevArgToken, currentArgToken)) { + const tokenBefore = sourceCode.getTokenBefore( + currentArgToken, + { includeComments: true } + ); + + const hasLineCommentBefore = tokenBefore.type === "Line"; + + context.report({ + node, + loc: { + start: tokenBefore.loc.end, + end: currentArgToken.loc.start + }, + messageId: checker.messageId, + fix: hasLineCommentBefore ? null : checker.createFix(currentArgToken, tokenBefore) + }); + } + } + } + + /** + * Check if open space is present in a function name + * @param {CallExpression} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if (node.arguments.length < 2) { + return; + } + + const option = context.options[0] || "always"; + + if (option === "never") { + checkArguments(node, checkers.unexpected); + } else if (option === "always") { + checkArguments(node, checkers.missing); + } else if (option === "consistent") { + const firstArgToken = sourceCode.getLastToken(node.arguments[0]); + const secondArgToken = sourceCode.getFirstToken(node.arguments[1]); + + if (firstArgToken.loc.end.line === secondArgToken.loc.start.line) { + checkArguments(node, checkers.unexpected); + } else { + checkArguments(node, checkers.missing); + } + } + } + + return { + CallExpression: check, + NewExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/function-paren-newline.js b/node_modules/eslint/lib/rules/function-paren-newline.js new file mode 100644 index 0000000..bf3845e --- /dev/null +++ b/node_modules/eslint/lib/rules/function-paren-newline.js @@ -0,0 +1,310 @@ +/** + * @fileoverview enforce consistent line breaks inside function parentheses + * @author Teddy Katz + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "function-paren-newline", + url: "https://eslint.style/rules/js/function-paren-newline" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent line breaks inside function parentheses", + recommended: false, + url: "https://eslint.org/docs/latest/rules/function-paren-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consistent", "multiline", "multiline-arguments"] + }, + { + type: "object", + properties: { + minItems: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + expectedBefore: "Expected newline before ')'.", + expectedAfter: "Expected newline after '('.", + expectedBetween: "Expected newline between arguments/params.", + unexpectedBefore: "Unexpected newline before ')'.", + unexpectedAfter: "Unexpected newline after '('." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const rawOption = context.options[0] || "multiline"; + const multilineOption = rawOption === "multiline"; + const multilineArgumentsOption = rawOption === "multiline-arguments"; + const consistentOption = rawOption === "consistent"; + let minItems; + + if (typeof rawOption === "object") { + minItems = rawOption.minItems; + } else if (rawOption === "always") { + minItems = 0; + } else if (rawOption === "never") { + minItems = Infinity; + } else { + minItems = null; + } + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Determines whether there should be newlines inside function parens + * @param {ASTNode[]} elements The arguments or parameters in the list + * @param {boolean} hasLeftNewline `true` if the left paren has a newline in the current code. + * @returns {boolean} `true` if there should be newlines inside the function parens + */ + function shouldHaveNewlines(elements, hasLeftNewline) { + if (multilineArgumentsOption && elements.length === 1) { + return hasLeftNewline; + } + if (multilineOption || multilineArgumentsOption) { + return elements.some((element, index) => index !== elements.length - 1 && element.loc.end.line !== elements[index + 1].loc.start.line); + } + if (consistentOption) { + return hasLeftNewline; + } + return elements.length >= minItems; + } + + /** + * Validates parens + * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode[]} elements The arguments or parameters in the list + * @returns {void} + */ + function validateParens(parens, elements) { + const leftParen = parens.leftParen; + const rightParen = parens.rightParen; + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen); + const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen); + const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen); + const hasRightNewline = !astUtils.isTokenOnSameLine(tokenBeforeRightParen, rightParen); + const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline); + + if (hasLeftNewline && !needsNewlines) { + context.report({ + node: leftParen, + messageId: "unexpectedAfter", + fix(fixer) { + return sourceCode.getText().slice(leftParen.range[1], tokenAfterLeftParen.range[0]).trim() + + // If there is a comment between the ( and the first element, don't do a fix. + ? null + : fixer.removeRange([leftParen.range[1], tokenAfterLeftParen.range[0]]); + } + }); + } else if (!hasLeftNewline && needsNewlines) { + context.report({ + node: leftParen, + messageId: "expectedAfter", + fix: fixer => fixer.insertTextAfter(leftParen, "\n") + }); + } + + if (hasRightNewline && !needsNewlines) { + context.report({ + node: rightParen, + messageId: "unexpectedBefore", + fix(fixer) { + return sourceCode.getText().slice(tokenBeforeRightParen.range[1], rightParen.range[0]).trim() + + // If there is a comment between the last element and the ), don't do a fix. + ? null + : fixer.removeRange([tokenBeforeRightParen.range[1], rightParen.range[0]]); + } + }); + } else if (!hasRightNewline && needsNewlines) { + context.report({ + node: rightParen, + messageId: "expectedBefore", + fix: fixer => fixer.insertTextBefore(rightParen, "\n") + }); + } + } + + /** + * Validates a list of arguments or parameters + * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode[]} elements The arguments or parameters in the list + * @returns {void} + */ + function validateArguments(parens, elements) { + const leftParen = parens.leftParen; + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen); + const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen); + const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline); + + for (let i = 0; i <= elements.length - 2; i++) { + const currentElement = elements[i]; + const nextElement = elements[i + 1]; + const hasNewLine = currentElement.loc.end.line !== nextElement.loc.start.line; + + if (!hasNewLine && needsNewlines) { + context.report({ + node: currentElement, + messageId: "expectedBetween", + fix: fixer => fixer.insertTextBefore(nextElement, "\n") + }); + } + } + } + + /** + * Gets the left paren and right paren tokens of a node. + * @param {ASTNode} node The node with parens + * @throws {TypeError} Unexpected node type. + * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token. + * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression + * with a single parameter) + */ + function getParenTokens(node) { + switch (node.type) { + case "NewExpression": + if (!node.arguments.length && + !( + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) && + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) && + node.callee.range[1] < node.range[1] + ) + ) { + + // If the NewExpression does not have parens (e.g. `new Foo`), return null. + return null; + } + + // falls through + + case "CallExpression": + return { + leftParen: sourceCode.getTokenAfter(node.callee, astUtils.isOpeningParenToken), + rightParen: sourceCode.getLastToken(node) + }; + + case "FunctionDeclaration": + case "FunctionExpression": { + const leftParen = sourceCode.getFirstToken(node, astUtils.isOpeningParenToken); + const rightParen = node.params.length + ? sourceCode.getTokenAfter(node.params.at(-1), astUtils.isClosingParenToken) + : sourceCode.getTokenAfter(leftParen); + + return { leftParen, rightParen }; + } + + case "ArrowFunctionExpression": { + const firstToken = sourceCode.getFirstToken(node, { skip: (node.async ? 1 : 0) }); + + if (!astUtils.isOpeningParenToken(firstToken)) { + + // If the ArrowFunctionExpression has a single param without parens, return null. + return null; + } + + const rightParen = node.params.length + ? sourceCode.getTokenAfter(node.params.at(-1), astUtils.isClosingParenToken) + : sourceCode.getTokenAfter(firstToken); + + return { + leftParen: firstToken, + rightParen + }; + } + + case "ImportExpression": { + const leftParen = sourceCode.getFirstToken(node, 1); + const rightParen = sourceCode.getLastToken(node); + + return { leftParen, rightParen }; + } + + default: + throw new TypeError(`unexpected node with type ${node.type}`); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + [[ + "ArrowFunctionExpression", + "CallExpression", + "FunctionDeclaration", + "FunctionExpression", + "ImportExpression", + "NewExpression" + ]](node) { + const parens = getParenTokens(node); + let params; + + if (node.type === "ImportExpression") { + params = [node.source]; + } else if (astUtils.isFunction(node)) { + params = node.params; + } else { + params = node.arguments; + } + + if (parens) { + validateParens(parens, params); + + if (multilineArgumentsOption) { + validateArguments(parens, params); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/generator-star-spacing.js b/node_modules/eslint/lib/rules/generator-star-spacing.js new file mode 100644 index 0000000..9aeb7c8 --- /dev/null +++ b/node_modules/eslint/lib/rules/generator-star-spacing.js @@ -0,0 +1,227 @@ +/** + * @fileoverview Rule to check the spacing around the * in generator functions. + * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const OVERRIDE_SCHEMA = { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + } + ] +}; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "generator-star-spacing", + url: "https://eslint.style/rules/js/generator-star-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing around `*` operators in generator functions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/generator-star-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" }, + named: OVERRIDE_SCHEMA, + anonymous: OVERRIDE_SCHEMA, + method: OVERRIDE_SCHEMA + }, + additionalProperties: false + } + ] + } + ], + + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } + }, + + create(context) { + + const optionDefinitions = { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }; + + /** + * Returns resolved option definitions based on an option and defaults + * @param {any} option The option object or string value + * @param {Object} defaults The defaults to use if options are not present + * @returns {Object} the resolved object definition + */ + function optionToDefinition(option, defaults) { + if (!option) { + return defaults; + } + + return typeof option === "string" + ? optionDefinitions[option] + : Object.assign({}, defaults, option); + } + + const modes = (function(option) { + const defaults = optionToDefinition(option, optionDefinitions.before); + + return { + named: optionToDefinition(option.named, defaults), + anonymous: optionToDefinition(option.anonymous, defaults), + method: optionToDefinition(option.method, defaults) + }; + }(context.options[0] || {})); + + const sourceCode = context.sourceCode; + + /** + * Checks if the given token is a star token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a star token. + */ + function isStarToken(token) { + return token.value === "*" && token.type === "Punctuator"; + } + + /** + * Gets the generator star token of the given function node. + * @param {ASTNode} node The function node to get. + * @returns {Token} Found star token. + */ + function getStarToken(node) { + return sourceCode.getFirstToken( + (node.parent.method || node.parent.type === "MethodDefinition") ? node.parent : node, + isStarToken + ); + } + + /** + * capitalize a given string. + * @param {string} str the given string. + * @returns {string} the capitalized string. + */ + function capitalize(str) { + return str[0].toUpperCase() + str.slice(1); + } + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} kind Either "named", "anonymous", or "method" + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(kind, side, leftToken, rightToken) { + if (!!(rightToken.range[0] - leftToken.range[1]) !== modes[kind][side]) { + const after = leftToken.value === "*"; + const spaceRequired = modes[kind][side]; + const node = after ? leftToken : rightToken; + const messageId = `${spaceRequired ? "missing" : "unexpected"}${capitalize(side)}`; + + context.report({ + node, + messageId, + fix(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a generator function. + * @param {ASTNode} node A function expression or declaration node. + * @returns {void} + */ + function checkFunction(node) { + if (!node.generator) { + return; + } + + const starToken = getStarToken(node); + const prevToken = sourceCode.getTokenBefore(starToken); + const nextToken = sourceCode.getTokenAfter(starToken); + + let kind = "named"; + + if (node.parent.type === "MethodDefinition" || (node.parent.type === "Property" && node.parent.method)) { + kind = "method"; + } else if (!node.id) { + kind = "anonymous"; + } + + // Only check before when preceded by `function`|`static` keyword + if (!(kind === "method" && starToken === sourceCode.getFirstToken(node.parent))) { + checkSpacing(kind, "before", prevToken, starToken); + } + + checkSpacing(kind, "after", starToken, nextToken); + } + + return { + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/getter-return.js b/node_modules/eslint/lib/rules/getter-return.js new file mode 100644 index 0000000..f012876 --- /dev/null +++ b/node_modules/eslint/lib/rules/getter-return.js @@ -0,0 +1,206 @@ +/** + * @fileoverview Enforces that a return statement is present in property getters. + * @author Aladdin-ADD(hh_2013@foxmail.com) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; + +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + allowImplicit: false + }], + + docs: { + description: "Enforce `return` statements in getters", + recommended: true, + url: "https://eslint.org/docs/latest/rules/getter-return" + }, + + fixable: null, + + schema: [ + { + type: "object", + properties: { + allowImplicit: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + expected: "Expected to return a value in {{name}}.", + expectedAlways: "Expected {{name}} to always return a value." + } + }, + + create(context) { + const [{ allowImplicit }] = context.options; + const sourceCode = context.sourceCode; + + let funcInfo = { + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false, + node: null, + currentSegments: [] + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + if (funcInfo.shouldCheck && + isAnySegmentReachable(funcInfo.currentSegments) + ) { + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: funcInfo.hasReturn ? "expectedAlways" : "expected", + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node) + } + }); + } + } + + /** + * Checks whether a node means a getter function. + * @param {ASTNode} node a node to check. + * @returns {boolean} if node means a getter, return true; else return false. + */ + function isGetter(node) { + const parent = node.parent; + + if (TARGET_NODE_TYPE.test(node.type) && node.body.type === "BlockStatement") { + if (parent.kind === "get") { + return true; + } + if (parent.type === "Property" && astUtils.getStaticPropertyName(parent) === "get" && parent.parent.type === "ObjectExpression") { + + // Object.defineProperty() or Reflect.defineProperty() + if (parent.parent.parent.type === "CallExpression") { + const callNode = parent.parent.parent.callee; + + if (astUtils.isSpecificMemberAccess(callNode, "Object", "defineProperty") || + astUtils.isSpecificMemberAccess(callNode, "Reflect", "defineProperty")) { + return true; + } + } + + // Object.defineProperties() or Object.create() + if (parent.parent.parent.type === "Property" && + parent.parent.parent.parent.type === "ObjectExpression" && + parent.parent.parent.parent.parent.type === "CallExpression") { + const callNode = parent.parent.parent.parent.parent.callee; + + return astUtils.isSpecificMemberAccess(callNode, "Object", "defineProperties") || + astUtils.isSpecificMemberAccess(callNode, "Object", "create"); + } + } + } + return false; + } + return { + + // Stacks this function's information. + onCodePathStart(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath, + hasReturn: false, + shouldCheck: isGetter(node), + node, + currentSegments: new Set() + }; + }, + + // Pops this function's information. + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + // Checks the return statement is valid. + ReturnStatement(node) { + if (funcInfo.shouldCheck) { + funcInfo.hasReturn = true; + + // if allowImplicit: false, should also check node.argument + if (!allowImplicit && !node.argument) { + context.report({ + node, + messageId: "expected", + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node) + } + }); + } + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/global-require.js b/node_modules/eslint/lib/rules/global-require.js new file mode 100644 index 0000000..b395cad --- /dev/null +++ b/node_modules/eslint/lib/rules/global-require.js @@ -0,0 +1,106 @@ +/** + * @fileoverview Rule for disallowing require() outside of the top-level module context + * @author Jamund Ferguson + * @deprecated in ESLint v7.0.0 + */ + +"use strict"; + +const ACCEPTABLE_PARENTS = new Set([ + "AssignmentExpression", + "VariableDeclarator", + "MemberExpression", + "ExpressionStatement", + "CallExpression", + "ConditionalExpression", + "Program", + "VariableDeclaration", + "ChainExpression" +]); + +/** + * Finds the eslint-scope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]); + + if (references.length === 1) { + return references[0]; + } + + /* c8 ignore next */ + return null; + +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {ASTNode} node The identifier node to check. + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + const reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "global-require", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/global-require.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Require `require()` calls to be placed at top-level module scope", + recommended: false, + url: "https://eslint.org/docs/latest/rules/global-require" + }, + + schema: [], + messages: { + unexpected: "Unexpected require()." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + CallExpression(node) { + const currentScope = sourceCode.getScope(node); + + if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) { + const isGoodRequire = sourceCode.getAncestors(node).every(parent => ACCEPTABLE_PARENTS.has(parent.type)); + + if (!isGoodRequire) { + context.report({ node, messageId: "unexpected" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/grouped-accessor-pairs.js b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js new file mode 100644 index 0000000..cd627b4 --- /dev/null +++ b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js @@ -0,0 +1,217 @@ +/** + * @fileoverview Rule to require grouped accessor pairs in object literals and classes + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["anyOrder"], + + docs: { + description: "Require grouped accessor pairs in object literals and classes", + recommended: false, + url: "https://eslint.org/docs/latest/rules/grouped-accessor-pairs" + }, + + schema: [ + { + enum: ["anyOrder", "getBeforeSet", "setBeforeGet"] + } + ], + + messages: { + notGrouped: "Accessor pair {{ formerName }} and {{ latterName }} should be grouped.", + invalidOrder: "Expected {{ latterName }} to be before {{ formerName }}." + } + }, + + create(context) { + const [order] = context.options; + const sourceCode = context.sourceCode; + + /** + * Reports the given accessor pair. + * @param {string} messageId messageId to report. + * @param {ASTNode} formerNode getter/setter node that is defined before `latterNode`. + * @param {ASTNode} latterNode getter/setter node that is defined after `formerNode`. + * @returns {void} + * @private + */ + function report(messageId, formerNode, latterNode) { + context.report({ + node: latterNode, + messageId, + loc: astUtils.getFunctionHeadLoc(latterNode.value, sourceCode), + data: { + formerName: astUtils.getFunctionNameWithKind(formerNode.value), + latterName: astUtils.getFunctionNameWithKind(latterNode.value) + } + }); + } + + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @param {Function} shouldCheck – Predicate that returns `true` if the node should be checked. + * @returns {void} + * @private + */ + function checkList(nodes, shouldCheck) { + const accessors = []; + let found = false; + + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + + if (shouldCheck(node) && isAccessorKind(node)) { + + // Creates a new `AccessorData` object for the given getter or setter node. + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + // Merges the given `AccessorData` object into the given accessors list. + for (let j = 0; j < accessors.length; j++) { + const accessor = accessors[j]; + + if (areEqualKeys(accessor.key, key)) { + accessor.getters.push(...node.kind === "get" ? [node] : []); + accessor.setters.push(...node.kind === "set" ? [node] : []); + found = true; + break; + } + } + if (!found) { + accessors.push({ + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }); + } + found = false; + } + } + + for (const { getters, setters } of accessors) { + + // Don't report accessor properties that have duplicate getters or setters. + if (getters.length === 1 && setters.length === 1) { + const [getter] = getters, + [setter] = setters, + getterIndex = nodes.indexOf(getter), + setterIndex = nodes.indexOf(setter), + formerNode = getterIndex < setterIndex ? getter : setter, + latterNode = getterIndex < setterIndex ? setter : getter; + + if (Math.abs(getterIndex - setterIndex) > 1) { + report("notGrouped", formerNode, latterNode); + } else if ( + (order === "getBeforeSet" && getterIndex > setterIndex) || + (order === "setBeforeGet" && getterIndex < setterIndex) + ) { + report("invalidOrder", formerNode, latterNode); + } + } + } + } + + return { + ObjectExpression(node) { + checkList(node.properties, n => n.type === "Property"); + }, + ClassBody(node) { + checkList(node.body, n => n.type === "MethodDefinition" && !n.static); + checkList(node.body, n => n.type === "MethodDefinition" && n.static); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/guard-for-in.js b/node_modules/eslint/lib/rules/guard-for-in.js new file mode 100644 index 0000000..d6e70d0 --- /dev/null +++ b/node_modules/eslint/lib/rules/guard-for-in.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag for-in loops without if statements inside + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require `for-in` loops to include an `if` statement", + recommended: false, + url: "https://eslint.org/docs/latest/rules/guard-for-in" + }, + + schema: [], + messages: { + wrap: "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype." + } + }, + + create(context) { + + return { + + ForInStatement(node) { + const body = node.body; + + // empty statement + if (body.type === "EmptyStatement") { + return; + } + + // if statement + if (body.type === "IfStatement") { + return; + } + + // empty block + if (body.type === "BlockStatement" && body.body.length === 0) { + return; + } + + // block with just if statement + if (body.type === "BlockStatement" && body.body.length === 1 && body.body[0].type === "IfStatement") { + return; + } + + // block that starts with if statement + if (body.type === "BlockStatement" && body.body.length >= 1 && body.body[0].type === "IfStatement") { + const i = body.body[0]; + + // ... whose consequent is a continue + if (i.consequent.type === "ContinueStatement") { + return; + } + + // ... whose consequent is a block that contains only a continue + if (i.consequent.type === "BlockStatement" && i.consequent.body.length === 1 && i.consequent.body[0].type === "ContinueStatement") { + return; + } + } + + context.report({ node, messageId: "wrap" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/handle-callback-err.js b/node_modules/eslint/lib/rules/handle-callback-err.js new file mode 100644 index 0000000..6d7d046 --- /dev/null +++ b/node_modules/eslint/lib/rules/handle-callback-err.js @@ -0,0 +1,117 @@ +/** + * @fileoverview Ensure handling of errors when we know they exist. + * @author Jamund Ferguson + * @deprecated in ESLint v7.0.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "handle-callback-err", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/handle-callback-err.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Require error handling in callbacks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/handle-callback-err" + }, + + schema: [ + { + type: "string" + } + ], + messages: { + expected: "Expected error to be handled." + } + }, + + create(context) { + + const errorArgument = context.options[0] || "err"; + const sourceCode = context.sourceCode; + + /** + * Checks if the given argument should be interpreted as a regexp pattern. + * @param {string} stringToCheck The string which should be checked. + * @returns {boolean} Whether or not the string should be interpreted as a pattern. + */ + function isPattern(stringToCheck) { + const firstChar = stringToCheck[0]; + + return firstChar === "^"; + } + + /** + * Checks if the given name matches the configured error argument. + * @param {string} name The name which should be compared. + * @returns {boolean} Whether or not the given name matches the configured error variable name. + */ + function matchesConfiguredErrorName(name) { + if (isPattern(errorArgument)) { + const regexp = new RegExp(errorArgument, "u"); + + return regexp.test(name); + } + return name === errorArgument; + } + + /** + * Get the parameters of a given function scope. + * @param {Object} scope The function scope. + * @returns {Array} All parameters of the given scope. + */ + function getParameters(scope) { + return scope.variables.filter(variable => variable.defs[0] && variable.defs[0].type === "Parameter"); + } + + /** + * Check to see if we're handling the error object properly. + * @param {ASTNode} node The AST node to check. + * @returns {void} + */ + function checkForError(node) { + const scope = sourceCode.getScope(node), + parameters = getParameters(scope), + firstParameter = parameters[0]; + + if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) { + if (firstParameter.references.length === 0) { + context.report({ node, messageId: "expected" }); + } + } + } + + return { + FunctionDeclaration: checkForError, + FunctionExpression: checkForError, + ArrowFunctionExpression: checkForError + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/id-blacklist.js b/node_modules/eslint/lib/rules/id-blacklist.js new file mode 100644 index 0000000..354e4bb --- /dev/null +++ b/node_modules/eslint/lib/rules/id-blacklist.js @@ -0,0 +1,258 @@ +/** + * @fileoverview Rule that warns when identifier names that are + * specified in the configuration are used. + * @author Keith Cirkel (http://keithcirkel.co.uk) + * @deprecated in ESLint v7.5.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given node represents assignment target in a normal assignment or destructuring. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is assignment target. + */ +function isAssignmentTarget(node) { + const parent = node.parent; + + return ( + + // normal assignment + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // destructuring + parent.type === "ArrayPattern" || + parent.type === "RestElement" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Checks whether the given node represents an imported name that is renamed in the same import/export specifier. + * + * Examples: + * import { a as b } from 'mod'; // node `a` is renamed import + * export { a as b } from 'mod'; // node `a` is renamed import + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed import. + */ +function isRenamedImport(node) { + const parent = node.parent; + + return ( + ( + parent.type === "ImportSpecifier" && + parent.imported !== parent.local && + parent.imported === node + ) || + ( + parent.type === "ExportSpecifier" && + parent.parent.source && // re-export + parent.local !== parent.exported && + parent.local === node + ) + ); +} + +/** + * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring. + * + * Examples: + * const { a : b } = foo; // node `a` is renamed node. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring. + */ +function isRenamedInDestructuring(node) { + const parent = node.parent; + + return ( + ( + !parent.computed && + parent.type === "Property" && + parent.parent.type === "ObjectPattern" && + parent.value !== node && + parent.key === node + ) + ); +} + +/** + * Checks whether the given node represents shorthand definition of a property in an object literal. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a shorthand property definition. + */ +function isShorthandPropertyDefinition(node) { + const parent = node.parent; + + return ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + parent.shorthand + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "The rule was renamed.", + url: "https://eslint.org/blog/2020/07/eslint-v7.5.0-released/#deprecating-id-blacklist", + deprecatedSince: "7.5.0", + availableUntil: null, + replacedBy: [ + { + rule: { + name: "id-denylist", + url: "https://eslint.org/docs/rules/id-denylist" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Disallow specified identifiers", + recommended: false, + url: "https://eslint.org/docs/latest/rules/id-blacklist" + }, + + schema: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + messages: { + restricted: "Identifier '{{name}}' is restricted." + } + }, + + create(context) { + + const denyList = new Set(context.options); + const reportedNodes = new Set(); + const sourceCode = context.sourceCode; + + let globalScope; + + /** + * Checks whether the given name is restricted. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is restricted. + * @private + */ + function isRestricted(name) { + return denyList.has(name); + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Determines whether the given node should be checked. + * @param {ASTNode} node `Identifier` node. + * @returns {boolean} `true` if the node should be checked. + */ + function shouldCheck(node) { + const parent = node.parent; + + /* + * Member access has special rules for checking property names. + * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over. + * Write access isn't allowed, because it potentially creates a new property with a restricted name. + */ + if ( + parent.type === "MemberExpression" && + parent.property === node && + !parent.computed + ) { + return isAssignmentTarget(parent); + } + + return ( + parent.type !== "CallExpression" && + parent.type !== "NewExpression" && + !isRenamedImport(node) && + !isRenamedInDestructuring(node) && + !( + isReferenceToGlobalVariable(node) && + !isShorthandPropertyDefinition(node) + ) + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + + /* + * We used the range instead of the node because it's possible + * for the same identifier to be represented by two different + * nodes, with the most clear example being shorthand properties: + * { foo } + * In this case, "foo" is represented by one node for the name + * and one for the value. The only way to know they are the same + * is to look at the range. + */ + if (!reportedNodes.has(node.range.toString())) { + context.report({ + node, + messageId: "restricted", + data: { + name: node.name + } + }); + reportedNodes.add(node.range.toString()); + } + + } + + return { + + Program(node) { + globalScope = sourceCode.getScope(node); + }, + + Identifier(node) { + if (isRestricted(node.name) && shouldCheck(node)) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-denylist.js b/node_modules/eslint/lib/rules/id-denylist.js new file mode 100644 index 0000000..8441c64 --- /dev/null +++ b/node_modules/eslint/lib/rules/id-denylist.js @@ -0,0 +1,242 @@ +/** + * @fileoverview Rule that warns when identifier names that are + * specified in the configuration are used. + * @author Keith Cirkel (http://keithcirkel.co.uk) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given node represents assignment target in a normal assignment or destructuring. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is assignment target. + */ +function isAssignmentTarget(node) { + const parent = node.parent; + + return ( + + // normal assignment + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // destructuring + parent.type === "ArrayPattern" || + parent.type === "RestElement" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Checks whether the given node represents an imported name that is renamed in the same import/export specifier. + * + * Examples: + * import { a as b } from 'mod'; // node `a` is renamed import + * export { a as b } from 'mod'; // node `a` is renamed import + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed import. + */ +function isRenamedImport(node) { + const parent = node.parent; + + return ( + ( + parent.type === "ImportSpecifier" && + parent.imported !== parent.local && + parent.imported === node + ) || + ( + parent.type === "ExportSpecifier" && + parent.parent.source && // re-export + parent.local !== parent.exported && + parent.local === node + ) + ); +} + +/** + * Checks whether the given node is an ObjectPattern destructuring. + * + * Examples: + * const { a : b } = foo; + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is in an ObjectPattern destructuring. + */ +function isPropertyNameInDestructuring(node) { + const parent = node.parent; + + return ( + ( + !parent.computed && + parent.type === "Property" && + parent.parent.type === "ObjectPattern" && + parent.key === node + ) + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [], + + docs: { + description: "Disallow specified identifiers", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/id-denylist" + }, + + schema: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + messages: { + restricted: "Identifier '{{name}}' is restricted.", + restrictedPrivate: "Identifier '#{{name}}' is restricted." + } + }, + + create(context) { + const denyList = new Set(context.options); + const reportedNodes = new Set(); + const sourceCode = context.sourceCode; + + let globalScope; + + /** + * Checks whether the given name is restricted. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is restricted. + * @private + */ + function isRestricted(name) { + return denyList.has(name); + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Determines whether the given node should be checked. + * @param {ASTNode} node `Identifier` node. + * @returns {boolean} `true` if the node should be checked. + */ + function shouldCheck(node) { + + // Import attributes are defined by environments, so naming conventions shouldn't apply to them + if (astUtils.isImportAttributeKey(node)) { + return false; + } + + const parent = node.parent; + + /* + * Member access has special rules for checking property names. + * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over. + * Write access isn't allowed, because it potentially creates a new property with a restricted name. + */ + if ( + parent.type === "MemberExpression" && + parent.property === node && + !parent.computed + ) { + return isAssignmentTarget(parent); + } + + return ( + parent.type !== "CallExpression" && + parent.type !== "NewExpression" && + !isRenamedImport(node) && + !isPropertyNameInDestructuring(node) && + !isReferenceToGlobalVariable(node) + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + + /* + * We used the range instead of the node because it's possible + * for the same identifier to be represented by two different + * nodes, with the most clear example being shorthand properties: + * { foo } + * In this case, "foo" is represented by one node for the name + * and one for the value. The only way to know they are the same + * is to look at the range. + */ + if (!reportedNodes.has(node.range.toString())) { + const isPrivate = node.type === "PrivateIdentifier"; + + context.report({ + node, + messageId: isPrivate ? "restrictedPrivate" : "restricted", + data: { + name: node.name + } + }); + reportedNodes.add(node.range.toString()); + } + } + + return { + + Program(node) { + globalScope = sourceCode.getScope(node); + }, + + [[ + "Identifier", + "PrivateIdentifier" + ]](node) { + if (isRestricted(node.name) && shouldCheck(node)) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-length.js b/node_modules/eslint/lib/rules/id-length.js new file mode 100644 index 0000000..7007636 --- /dev/null +++ b/node_modules/eslint/lib/rules/id-length.js @@ -0,0 +1,191 @@ +/** + * @fileoverview Rule that warns when identifier names are shorter or longer + * than the values provided in configuration. + * @author Burak Yigit Kaya aka BYK + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getGraphemeCount } = require("../shared/string-utils"); +const { getModuleExportName, isImportAttributeKey } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + exceptionPatterns: [], + exceptions: [], + min: 2, + properties: "always" + }], + + docs: { + description: "Enforce minimum and maximum identifier lengths", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/id-length" + }, + + schema: [ + { + type: "object", + properties: { + min: { + type: "integer" + }, + max: { + type: "integer" + }, + exceptions: { + type: "array", + uniqueItems: true, + items: { + type: "string" + } + }, + exceptionPatterns: { + type: "array", + uniqueItems: true, + items: { + type: "string" + } + }, + properties: { + enum: ["always", "never"] + } + }, + additionalProperties: false + } + ], + messages: { + tooShort: "Identifier name '{{name}}' is too short (< {{min}}).", + tooShortPrivate: "Identifier name '#{{name}}' is too short (< {{min}}).", + tooLong: "Identifier name '{{name}}' is too long (> {{max}}).", + tooLongPrivate: "Identifier name #'{{name}}' is too long (> {{max}})." + } + }, + + create(context) { + const [options] = context.options; + const { max: maxLength = Infinity, min: minLength } = options; + const properties = options.properties !== "never"; + const exceptions = new Set(options.exceptions); + const exceptionPatterns = options.exceptionPatterns.map(pattern => new RegExp(pattern, "u")); + const reportedNodes = new Set(); + + /** + * Checks if a string matches the provided exception patterns + * @param {string} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function matchesExceptionPattern(name) { + return exceptionPatterns.some(pattern => pattern.test(name)); + } + + const SUPPORTED_EXPRESSIONS = { + MemberExpression: properties && function(parent) { + return !parent.computed && ( + + // regular property assignment + (parent.parent.left === parent && parent.parent.type === "AssignmentExpression" || + + // or the last identifier in an ObjectPattern destructuring + parent.parent.type === "Property" && parent.parent.value === parent && + parent.parent.parent.type === "ObjectPattern" && parent.parent.parent.parent.left === parent.parent.parent) + ); + }, + AssignmentPattern(parent, node) { + return parent.left === node; + }, + VariableDeclarator(parent, node) { + return parent.id === node; + }, + Property(parent, node) { + + if (parent.parent.type === "ObjectPattern") { + const isKeyAndValueSame = parent.value.name === parent.key.name; + + return ( + !isKeyAndValueSame && parent.value === node || + isKeyAndValueSame && parent.key === node && properties + ); + } + return properties && !isImportAttributeKey(node) && !parent.computed && parent.key.name === node.name; + }, + ImportSpecifier(parent, node) { + return ( + parent.local === node && + getModuleExportName(parent.imported) !== getModuleExportName(parent.local) + ); + }, + ImportDefaultSpecifier: true, + ImportNamespaceSpecifier: true, + RestElement: true, + FunctionExpression: true, + ArrowFunctionExpression: true, + ClassDeclaration: true, + FunctionDeclaration: true, + MethodDefinition: true, + PropertyDefinition: true, + CatchClause: true, + ArrayPattern: true + }; + + return { + [[ + "Identifier", + "PrivateIdentifier" + ]](node) { + const name = node.name; + const parent = node.parent; + + const nameLength = getGraphemeCount(name); + + const isShort = nameLength < minLength; + const isLong = nameLength > maxLength; + + if (!(isShort || isLong) || exceptions.has(name) || matchesExceptionPattern(name)) { + return; // Nothing to report + } + + const isValidExpression = SUPPORTED_EXPRESSIONS[parent.type]; + + /* + * We used the range instead of the node because it's possible + * for the same identifier to be represented by two different + * nodes, with the most clear example being shorthand properties: + * { foo } + * In this case, "foo" is represented by one node for the name + * and one for the value. The only way to know they are the same + * is to look at the range. + */ + if (isValidExpression && !reportedNodes.has(node.range.toString()) && (isValidExpression === true || isValidExpression(parent, node))) { + reportedNodes.add(node.range.toString()); + + let messageId = isShort ? "tooShort" : "tooLong"; + + if (node.type === "PrivateIdentifier") { + messageId += "Private"; + } + + context.report({ + node, + messageId, + data: { name, min: minLength, max: maxLength } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-match.js b/node_modules/eslint/lib/rules/id-match.js new file mode 100644 index 0000000..c099deb --- /dev/null +++ b/node_modules/eslint/lib/rules/id-match.js @@ -0,0 +1,308 @@ +/** + * @fileoverview Rule to flag non-matching identifiers + * @author Matthieu Larcher + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["^.+$", { + classFields: false, + ignoreDestructuring: false, + onlyDeclarations: false, + properties: false + }], + + docs: { + description: "Require identifiers to match a specified regular expression", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/id-match" + }, + + schema: [ + { + type: "string" + }, + { + type: "object", + properties: { + properties: { + type: "boolean" + }, + classFields: { + type: "boolean" + }, + onlyDeclarations: { + type: "boolean" + }, + ignoreDestructuring: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + notMatch: "Identifier '{{name}}' does not match the pattern '{{pattern}}'.", + notMatchPrivate: "Identifier '#{{name}}' does not match the pattern '{{pattern}}'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Options + //-------------------------------------------------------------------------- + const [pattern, { + classFields: checkClassFields, + ignoreDestructuring, + onlyDeclarations, + properties: checkProperties + }] = context.options; + const regexp = new RegExp(pattern, "u"); + + const sourceCode = context.sourceCode; + let globalScope; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reportedNodes = new Set(); + const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + const DECLARATION_TYPES = new Set(["FunctionDeclaration", "VariableDeclarator"]); + const IMPORT_TYPES = new Set(["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"]); + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Checks if a string matches the provided pattern + * @param {string} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function isInvalid(name) { + return !regexp.test(name); + } + + /** + * Checks if a parent of a node is an ObjectPattern. + * @param {ASTNode} node The node to check. + * @returns {boolean} if the node is inside an ObjectPattern + * @private + */ + function isInsideObjectPattern(node) { + let { parent } = node; + + while (parent) { + if (parent.type === "ObjectPattern") { + return true; + } + + parent = parent.parent; + } + + return false; + } + + /** + * Verifies if we should report an error or not based on the effective + * parent node and the identifier name. + * @param {ASTNode} effectiveParent The effective parent node of the node to be reported + * @param {string} name The identifier name of the identifier node + * @returns {boolean} whether an error should be reported or not + */ + function shouldReport(effectiveParent, name) { + return (!onlyDeclarations || DECLARATION_TYPES.has(effectiveParent.type)) && + !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && isInvalid(name); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + + /* + * We used the range instead of the node because it's possible + * for the same identifier to be represented by two different + * nodes, with the most clear example being shorthand properties: + * { foo } + * In this case, "foo" is represented by one node for the name + * and one for the value. The only way to know they are the same + * is to look at the range. + */ + if (!reportedNodes.has(node.range.toString())) { + + const messageId = (node.type === "PrivateIdentifier") + ? "notMatchPrivate" : "notMatch"; + + context.report({ + node, + messageId, + data: { + name: node.name, + pattern + } + }); + reportedNodes.add(node.range.toString()); + } + } + + return { + + Program(node) { + globalScope = sourceCode.getScope(node); + }, + + Identifier(node) { + const name = node.name, + parent = node.parent, + effectiveParent = (parent.type === "MemberExpression") ? parent.parent : parent; + + if (isReferenceToGlobalVariable(node) || astUtils.isImportAttributeKey(node)) { + return; + } + + if (parent.type === "MemberExpression") { + + if (!checkProperties) { + return; + } + + // Always check object names + if (parent.object.type === "Identifier" && + parent.object.name === name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions left side's assigned variable id + } else if (effectiveParent.type === "AssignmentExpression" && + effectiveParent.left.type === "MemberExpression" && + effectiveParent.left.property.name === node.name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && effectiveParent.right.type !== "MemberExpression") { + if (isInvalid(name)) { + report(node); + } + } + + // For https://github.com/eslint/eslint/issues/15123 + } else if ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + parent.key === node && + !parent.computed + ) { + if (checkProperties && isInvalid(name)) { + report(node); + } + + /* + * Properties have their own rules, and + * AssignmentPattern nodes can be treated like Properties: + * e.g.: const { no_camelcased = false } = bar; + */ + } else if (parent.type === "Property" || parent.type === "AssignmentPattern") { + + if (parent.parent && parent.parent.type === "ObjectPattern") { + if (!ignoreDestructuring && parent.shorthand && parent.value.left && isInvalid(name)) { + report(node); + } + + const assignmentKeyEqualsValue = parent.key.name === parent.value.name; + + // prevent checking righthand side of destructured object + if (!assignmentKeyEqualsValue && parent.key === node) { + return; + } + + const valueIsInvalid = parent.value.name && isInvalid(name); + + // ignore destructuring if the option is set, unless a new identifier is created + if (valueIsInvalid && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + report(node); + } + } + + // never check properties or always ignore destructuring + if ((!checkProperties && !parent.computed) || (ignoreDestructuring && isInsideObjectPattern(node))) { + return; + } + + // don't check right hand side of AssignmentExpression to prevent duplicate warnings + if (parent.right !== node && shouldReport(effectiveParent, name)) { + report(node); + } + + // Check if it's an import specifier + } else if (IMPORT_TYPES.has(parent.type)) { + + // Report only if the local imported identifier is invalid + if (parent.local && parent.local.name === node.name && isInvalid(name)) { + report(node); + } + + } else if (parent.type === "PropertyDefinition") { + + if (checkClassFields && isInvalid(name)) { + report(node); + } + + // Report anything that is invalid that isn't a CallExpression + } else if (shouldReport(effectiveParent, name)) { + report(node); + } + }, + + "PrivateIdentifier"(node) { + + const isClassField = node.parent.type === "PropertyDefinition"; + + if (isClassField && !checkClassFields) { + return; + } + + if (isInvalid(node.name)) { + report(node); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js new file mode 100644 index 0000000..c24a30c --- /dev/null +++ b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js @@ -0,0 +1,102 @@ +/** + * @fileoverview enforce the location of arrow function bodies + * @author Sharmila Jesupaul + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +const { isCommentToken, isNotOpeningParenToken } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "implicit-arrow-linebreak", + url: "https://eslint.style/rules/js/implicit-arrow-linebreak" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce the location of arrow function bodies", + recommended: false, + url: "https://eslint.org/docs/latest/rules/implicit-arrow-linebreak" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["beside", "below"] + } + ], + messages: { + expected: "Expected a linebreak before this expression.", + unexpected: "Expected no linebreak before this expression." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const option = context.options[0] || "beside"; + + /** + * Validates the location of an arrow function body + * @param {ASTNode} node The arrow function body + * @returns {void} + */ + function validateExpression(node) { + if (node.body.type === "BlockStatement") { + return; + } + + const arrowToken = sourceCode.getTokenBefore(node.body, isNotOpeningParenToken); + const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken); + + if (arrowToken.loc.end.line === firstTokenOfBody.loc.start.line && option === "below") { + context.report({ + node: firstTokenOfBody, + messageId: "expected", + fix: fixer => fixer.insertTextBefore(firstTokenOfBody, "\n") + }); + } else if (arrowToken.loc.end.line !== firstTokenOfBody.loc.start.line && option === "beside") { + context.report({ + node: firstTokenOfBody, + messageId: "unexpected", + fix(fixer) { + if (sourceCode.getFirstTokenBetween(arrowToken, firstTokenOfBody, { includeComments: true, filter: isCommentToken })) { + return null; + } + + return fixer.replaceTextRange([arrowToken.range[1], firstTokenOfBody.range[0]], " "); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + return { + ArrowFunctionExpression: node => validateExpression(node) + }; + } +}; diff --git a/node_modules/eslint/lib/rules/indent-legacy.js b/node_modules/eslint/lib/rules/indent-legacy.js new file mode 100644 index 0000000..0d1149f --- /dev/null +++ b/node_modules/eslint/lib/rules/indent-legacy.js @@ -0,0 +1,1142 @@ +/** + * @fileoverview This option sets a specific tab width for your code + * + * This rule has been ported and modified from nodeca. + * @author Vitaly Puzrin + * @author Gyandeep Singh + * @deprecated in ESLint v4.0.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +// this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. +/* c8 ignore next */ +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "Enforce consistent indentation", + recommended: false, + url: "https://eslint.org/docs/latest/rules/indent-legacy" + }, + + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "4.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "indent", + url: "https://eslint.style/rules/js/indent" + } + } + ] + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["tab"] + }, + { + type: "integer", + minimum: 0 + } + ] + }, + { + type: "object", + properties: { + SwitchCase: { + type: "integer", + minimum: 0 + }, + VariableDeclarator: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + var: { + type: "integer", + minimum: 0 + }, + let: { + type: "integer", + minimum: 0 + }, + const: { + type: "integer", + minimum: 0 + } + } + } + ] + }, + outerIIFEBody: { + type: "integer", + minimum: 0 + }, + MemberExpression: { + type: "integer", + minimum: 0 + }, + FunctionDeclaration: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + body: { + type: "integer", + minimum: 0 + } + } + }, + FunctionExpression: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + body: { + type: "integer", + minimum: 0 + } + } + }, + CallExpression: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + } + } + }, + ArrayExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + ObjectExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + } + }, + additionalProperties: false + } + ], + messages: { + expected: "Expected indentation of {{expected}} but found {{actual}}." + } + }, + + create(context) { + const DEFAULT_VARIABLE_INDENT = 1; + const DEFAULT_PARAMETER_INDENT = null; // For backwards compatibility, don't check parameter indentation unless specified in the config + const DEFAULT_FUNCTION_BODY_INDENT = 1; + + let indentType = "space"; + let indentSize = 4; + const options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + }, + outerIIFEBody: null, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT + }, + ArrayExpression: 1, + ObjectExpression: 1 + }; + + const sourceCode = context.sourceCode; + + if (context.options.length) { + if (context.options[0] === "tab") { + indentSize = 1; + indentType = "tab"; + } else /* c8 ignore start */ if (typeof context.options[0] === "number") { + indentSize = context.options[0]; + indentType = "space"; + }/* c8 ignore stop */ + + if (context.options[1]) { + const opts = context.options[1]; + + options.SwitchCase = opts.SwitchCase || 0; + const variableDeclaratorRules = opts.VariableDeclarator; + + if (typeof variableDeclaratorRules === "number") { + options.VariableDeclarator = { + var: variableDeclaratorRules, + let: variableDeclaratorRules, + const: variableDeclaratorRules + }; + } else if (typeof variableDeclaratorRules === "object") { + Object.assign(options.VariableDeclarator, variableDeclaratorRules); + } + + if (typeof opts.outerIIFEBody === "number") { + options.outerIIFEBody = opts.outerIIFEBody; + } + + if (typeof opts.MemberExpression === "number") { + options.MemberExpression = opts.MemberExpression; + } + + if (typeof opts.FunctionDeclaration === "object") { + Object.assign(options.FunctionDeclaration, opts.FunctionDeclaration); + } + + if (typeof opts.FunctionExpression === "object") { + Object.assign(options.FunctionExpression, opts.FunctionExpression); + } + + if (typeof opts.CallExpression === "object") { + Object.assign(options.CallExpression, opts.CallExpression); + } + + if (typeof opts.ArrayExpression === "number" || typeof opts.ArrayExpression === "string") { + options.ArrayExpression = opts.ArrayExpression; + } + + if (typeof opts.ObjectExpression === "number" || typeof opts.ObjectExpression === "string") { + options.ObjectExpression = opts.ObjectExpression; + } + } + } + + const caseIndentStore = {}; + + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param {int} expectedAmount The expected amount of indentation characters for this line + * @param {int} actualSpaces The actual number of indentation spaces that were found on this line + * @param {int} actualTabs The actual number of indentation tabs that were found on this line + * @returns {string} An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" + let foundStatement; + + if (actualSpaces > 0 && actualTabs > 0) { + foundStatement = `${actualSpaces} ${foundSpacesWord} and ${actualTabs} ${foundTabsWord}`; // e.g. "1 space and 2 tabs" + } else if (actualSpaces > 0) { + + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; + } else if (actualTabs > 0) { + foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } else { + foundStatement = "0"; + } + return { + expected: expectedStatement, + actual: foundStatement + }; + } + + /** + * Reports a given indent violation + * @param {ASTNode} node Node violating the indent rule + * @param {int} needed Expected indentation character count + * @param {int} gottenSpaces Indentation space count in the actual node/code + * @param {int} gottenTabs Indentation tab count in the actual node/code + * @param {Object} [loc] Error line and column location + * @param {boolean} isLastNodeCheck Is the error for last node check + * @returns {void} + */ + function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck) { + if (gottenSpaces && gottenTabs) { + + // To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs. + return; + } + + const desiredIndent = (indentType === "space" ? " " : "\t").repeat(needed); + + const textRange = isLastNodeCheck + ? [node.range[1] - node.loc.end.column, node.range[1] - node.loc.end.column + gottenSpaces + gottenTabs] + : [node.range[0] - node.loc.start.column, node.range[0] - node.loc.start.column + gottenSpaces + gottenTabs]; + + context.report({ + node, + loc, + messageId: "expected", + data: createErrorMessageData(needed, gottenSpaces, gottenTabs), + fix: fixer => fixer.replaceTextRange(textRange, desiredIndent) + }); + } + + /** + * Get the actual indent of node + * @param {ASTNode|Token} node Node to examine + * @param {boolean} [byLastLine=false] get indent of node's last line + * @returns {Object} The node's indent. Contains keys `space` and `tab`, representing the indent of each character. Also + * contains keys `goodChar` and `badChar`, where `goodChar` is the amount of the user's desired indentation character, and + * `badChar` is the amount of the other indentation character. + */ + function getNodeIndent(node, byLastLine) { + const token = byLastLine ? sourceCode.getLastToken(node) : sourceCode.getFirstToken(node); + const srcCharsBeforeNode = sourceCode.getText(token, token.loc.start.column).split(""); + const indentChars = srcCharsBeforeNode.slice(0, srcCharsBeforeNode.findIndex(char => char !== " " && char !== "\t")); + const spaces = indentChars.filter(char => char === " ").length; + const tabs = indentChars.filter(char => char === "\t").length; + + return { + space: spaces, + tab: tabs, + goodChar: indentType === "space" ? spaces : tabs, + badChar: indentType === "space" ? tabs : spaces + }; + } + + /** + * Checks node is the first in its own start line. By default it looks by start line. + * @param {ASTNode} node The node to check + * @param {boolean} [byEndLocation=false] Lookup based on start position or end + * @returns {boolean} true if its the first in the its start line + */ + function isNodeFirstInLine(node, byEndLocation) { + const firstToken = byEndLocation === true ? sourceCode.getLastToken(node, 1) : sourceCode.getTokenBefore(node), + startLine = byEndLocation === true ? node.loc.end.line : node.loc.start.line, + endLine = firstToken ? firstToken.loc.end.line : -1; + + return startLine !== endLine; + } + + /** + * Check indent for node + * @param {ASTNode} node Node to check + * @param {int} neededIndent needed indent + * @returns {void} + */ + function checkNodeIndent(node, neededIndent) { + const actualIndent = getNodeIndent(node, false); + + if ( + node.type !== "ArrayExpression" && + node.type !== "ObjectExpression" && + (actualIndent.goodChar !== neededIndent || actualIndent.badChar !== 0) && + isNodeFirstInLine(node) + ) { + report(node, neededIndent, actualIndent.space, actualIndent.tab); + } + + if (node.type === "IfStatement" && node.alternate) { + const elseToken = sourceCode.getTokenBefore(node.alternate); + + checkNodeIndent(elseToken, neededIndent); + + if (!isNodeFirstInLine(node.alternate)) { + checkNodeIndent(node.alternate, neededIndent); + } + } + + if (node.type === "TryStatement" && node.handler) { + const catchToken = sourceCode.getFirstToken(node.handler); + + checkNodeIndent(catchToken, neededIndent); + } + + if (node.type === "TryStatement" && node.finalizer) { + const finallyToken = sourceCode.getTokenBefore(node.finalizer); + + checkNodeIndent(finallyToken, neededIndent); + } + + if (node.type === "DoWhileStatement") { + const whileToken = sourceCode.getTokenAfter(node.body); + + checkNodeIndent(whileToken, neededIndent); + } + } + + /** + * Check indent for nodes list + * @param {ASTNode[]} nodes list of node objects + * @param {int} indent needed indent + * @returns {void} + */ + function checkNodesIndent(nodes, indent) { + nodes.forEach(node => checkNodeIndent(node, indent)); + } + + /** + * Check last node line indent this detects, that block closed correctly + * @param {ASTNode} node Node to examine + * @param {int} lastLineIndent needed indent + * @returns {void} + */ + function checkLastNodeLineIndent(node, lastLineIndent) { + const lastToken = sourceCode.getLastToken(node); + const endIndent = getNodeIndent(lastToken, true); + + if ((endIndent.goodChar !== lastLineIndent || endIndent.badChar !== 0) && isNodeFirstInLine(node, true)) { + report( + node, + lastLineIndent, + endIndent.space, + endIndent.tab, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); + } + } + + /** + * Check last node line indent this detects, that block closed correctly + * This function for more complicated return statement case, where closing parenthesis may be followed by ';' + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent first line needed indent + * @returns {void} + */ + function checkLastReturnStatementLineIndent(node, firstLineIndent) { + + /* + * in case if return statement ends with ');' we have traverse back to ')' + * otherwise we'll measure indent for ';' and replace ')' + */ + const lastToken = sourceCode.getLastToken(node, astUtils.isClosingParenToken); + const textBeforeClosingParenthesis = sourceCode.getText(lastToken, lastToken.loc.start.column).slice(0, -1); + + if (textBeforeClosingParenthesis.trim()) { + + // There are tokens before the closing paren, don't report this case + return; + } + + const endIndent = getNodeIndent(lastToken, true); + + if (endIndent.goodChar !== firstLineIndent) { + report( + node, + firstLineIndent, + endIndent.space, + endIndent.tab, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); + } + } + + /** + * Check first node line indent is correct + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent needed indent + * @returns {void} + */ + function checkFirstNodeLineIndent(node, firstLineIndent) { + const startIndent = getNodeIndent(node, false); + + if ((startIndent.goodChar !== firstLineIndent || startIndent.badChar !== 0) && isNodeFirstInLine(node)) { + report( + node, + firstLineIndent, + startIndent.space, + startIndent.tab, + { line: node.loc.start.line, column: node.loc.start.column } + ); + } + } + + /** + * Returns a parent node of given node based on a specified type + * if not present then return null + * @param {ASTNode} node node to examine + * @param {string} type type that is being looked for + * @param {string} stopAtList end points for the evaluating code + * @returns {ASTNode|void} if found then node otherwise null + */ + function getParentNodeByType(node, type, stopAtList) { + let parent = node.parent; + const stopAtSet = new Set(stopAtList || ["Program"]); + + while (parent.type !== type && !stopAtSet.has(parent.type) && parent.type !== "Program") { + parent = parent.parent; + } + + return parent.type === type ? parent : null; + } + + /** + * Returns the VariableDeclarator based on the current node + * if not present then return null + * @param {ASTNode} node node to examine + * @returns {ASTNode|void} if found then node otherwise null + */ + function getVariableDeclaratorNode(node) { + return getParentNodeByType(node, "VariableDeclarator"); + } + + /** + * Check to see if the node is part of the multi-line variable declaration. + * Also if its on the same line as the varNode + * @param {ASTNode} node node to check + * @param {ASTNode} varNode variable declaration node to check against + * @returns {boolean} True if all the above condition satisfy + */ + function isNodeInVarOnTop(node, varNode) { + return varNode && + varNode.parent.loc.start.line === node.loc.start.line && + varNode.parent.declarations.length > 1; + } + + /** + * Check to see if the argument before the callee node is multi-line and + * there should only be 1 argument before the callee node + * @param {ASTNode} node node to check + * @returns {boolean} True if arguments are multi-line + */ + function isArgBeforeCalleeNodeMultiline(node) { + const parent = node.parent; + + if (parent.arguments.length >= 2 && parent.arguments[1] === node) { + return parent.arguments[0].loc.end.line > parent.arguments[0].loc.start.line; + } + + return false; + } + + /** + * Check to see if the node is a file level IIFE + * @param {ASTNode} node The function node to check. + * @returns {boolean} True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + const parent = node.parent; + let stmt = parent.parent; + + /* + * Verify that the node is an IIEF + */ + if ( + parent.type !== "CallExpression" || + parent.callee !== node) { + + return false; + } + + /* + * Navigate legal ancestors to determine whether this IIEF is outer + */ + while ( + stmt.type === "UnaryExpression" && ( + stmt.operator === "!" || + stmt.operator === "~" || + stmt.operator === "+" || + stmt.operator === "-") || + stmt.type === "AssignmentExpression" || + stmt.type === "LogicalExpression" || + stmt.type === "SequenceExpression" || + stmt.type === "VariableDeclarator") { + + stmt = stmt.parent; + } + + return (( + stmt.type === "ExpressionStatement" || + stmt.type === "VariableDeclaration") && + stmt.parent && stmt.parent.type === "Program" + ); + } + + /** + * Check indent for function block content + * @param {ASTNode} node A BlockStatement node that is inside of a function. + * @returns {void} + */ + function checkIndentInFunctionBlock(node) { + + /* + * Search first caller in chain. + * Ex.: + * + * Models <- Identifier + * .User + * .find() + * .exec(function() { + * // function body + * }); + * + * Looks for 'Models' + */ + const calleeNode = node.parent; // FunctionExpression + let indent; + + if (calleeNode.parent && + (calleeNode.parent.type === "Property" || + calleeNode.parent.type === "ArrayExpression")) { + + // If function is part of array or object, comma can be put at left + indent = getNodeIndent(calleeNode, false).goodChar; + } else { + + // If function is standalone, simple calculate indent + indent = getNodeIndent(calleeNode).goodChar; + } + + if (calleeNode.parent.type === "CallExpression") { + const calleeParent = calleeNode.parent; + + if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") { + if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) { + indent = getNodeIndent(calleeParent).goodChar; + } + } else { + if (isArgBeforeCalleeNodeMultiline(calleeNode) && + calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line && + !isNodeFirstInLine(calleeNode)) { + indent = getNodeIndent(calleeParent).goodChar; + } + } + } + + /* + * function body indent should be indent + indent size, unless this + * is a FunctionDeclaration, FunctionExpression, or outer IIFE and the corresponding options are enabled. + */ + let functionOffset = indentSize; + + if (options.outerIIFEBody !== null && isOuterIIFE(calleeNode)) { + functionOffset = options.outerIIFEBody * indentSize; + } else if (calleeNode.type === "FunctionExpression") { + functionOffset = options.FunctionExpression.body * indentSize; + } else if (calleeNode.type === "FunctionDeclaration") { + functionOffset = options.FunctionDeclaration.body * indentSize; + } + indent += functionOffset; + + // check if the node is inside a variable + const parentVarNode = getVariableDeclaratorNode(node); + + if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) { + indent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + if (node.body.length > 0) { + checkNodesIndent(node.body, indent); + } + + checkLastNodeLineIndent(node, indent - functionOffset); + } + + + /** + * Checks if the given node starts and ends on the same line + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the block starts and ends on the same line. + */ + function isSingleLineNode(node) { + const lastToken = sourceCode.getLastToken(node), + startLine = node.loc.start.line, + endLine = lastToken.loc.end.line; + + return startLine === endLine; + } + + /** + * Check indent for array block content or object block content + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkIndentInArrayOrObjectBlock(node) { + + // Skip inline + if (isSingleLineNode(node)) { + return; + } + + let elements = (node.type === "ArrayExpression") ? node.elements : node.properties; + + // filter out empty elements example would be [ , 2] so remove first element as espree considers it as null + elements = elements.filter(elem => elem !== null); + + let nodeIndent; + let elementsIndent; + const parentVarNode = getVariableDeclaratorNode(node); + + // TODO - come up with a better strategy in future + if (isNodeFirstInLine(node)) { + const parent = node.parent; + + nodeIndent = getNodeIndent(parent).goodChar; + if (!parentVarNode || parentVarNode.loc.start.line !== node.loc.start.line) { + if (parent.type !== "VariableDeclarator" || parentVarNode === parentVarNode.parent.declarations[0]) { + if (parent.type === "VariableDeclarator" && parentVarNode.loc.start.line === parent.loc.start.line) { + nodeIndent += (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]); + } else if (parent.type === "ObjectExpression" || parent.type === "ArrayExpression") { + const parentElements = node.parent.type === "ObjectExpression" ? node.parent.properties : node.parent.elements; + + if (parentElements[0] && + parentElements[0].loc.start.line === parent.loc.start.line && + parentElements[0].loc.end.line !== parent.loc.start.line) { + + /* + * If the first element of the array spans multiple lines, don't increase the expected indentation of the rest. + * e.g. [{ + * foo: 1 + * }, + * { + * bar: 1 + * }] + * the second object is not indented. + */ + } else if (typeof options[parent.type] === "number") { + nodeIndent += options[parent.type] * indentSize; + } else { + nodeIndent = parentElements[0].loc.start.column; + } + } else if (parent.type === "CallExpression" || parent.type === "NewExpression") { + if (typeof options.CallExpression.arguments === "number") { + nodeIndent += options.CallExpression.arguments * indentSize; + } else if (options.CallExpression.arguments === "first") { + if (parent.arguments.includes(node)) { + nodeIndent = parent.arguments[0].loc.start.column; + } + } else { + nodeIndent += indentSize; + } + } else if (parent.type === "LogicalExpression" || parent.type === "ArrowFunctionExpression") { + nodeIndent += indentSize; + } + } + } + + checkFirstNodeLineIndent(node, nodeIndent); + } else { + nodeIndent = getNodeIndent(node).goodChar; + } + + if (options[node.type] === "first") { + elementsIndent = elements.length ? elements[0].loc.start.column : 0; // If there are no elements, elementsIndent doesn't matter. + } else { + elementsIndent = nodeIndent + indentSize * options[node.type]; + } + + /* + * Check if the node is a multiple variable declaration; if so, then + * make sure indentation takes that into account. + */ + if (isNodeInVarOnTop(node, parentVarNode)) { + elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + checkNodesIndent(elements, elementsIndent); + + if (elements.length > 0) { + + // Skip last block line check if last item in same line + if (elements.at(-1).loc.end.line === node.loc.end.line) { + return; + } + } + + checkLastNodeLineIndent(node, nodeIndent + + (isNodeInVarOnTop(node, parentVarNode) ? options.VariableDeclarator[parentVarNode.parent.kind] * indentSize : 0)); + } + + /** + * Check if the node or node body is a BlockStatement or not + * @param {ASTNode} node node to test + * @returns {boolean} True if it or its body is a block statement + */ + function isNodeBodyBlock(node) { + return node.type === "BlockStatement" || node.type === "ClassBody" || (node.body && node.body.type === "BlockStatement") || + (node.consequent && node.consequent.type === "BlockStatement"); + } + + /** + * Check indentation for blocks + * @param {ASTNode} node node to check + * @returns {void} + */ + function blockIndentationCheck(node) { + + // Skip inline blocks + if (isSingleLineNode(node)) { + return; + } + + if (node.parent && ( + node.parent.type === "FunctionExpression" || + node.parent.type === "FunctionDeclaration" || + node.parent.type === "ArrowFunctionExpression") + ) { + checkIndentInFunctionBlock(node); + return; + } + + let indent; + let nodesToCheck; + + /* + * For this statements we should check indent from statement beginning, + * not from the beginning of the block. + */ + const statementsWithProperties = [ + "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement", "ClassDeclaration", "TryStatement" + ]; + + if (node.parent && statementsWithProperties.includes(node.parent.type) && isNodeBodyBlock(node)) { + indent = getNodeIndent(node.parent).goodChar; + } else if (node.parent && node.parent.type === "CatchClause") { + indent = getNodeIndent(node.parent.parent).goodChar; + } else { + indent = getNodeIndent(node).goodChar; + } + + if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") { + nodesToCheck = [node.consequent]; + } else if (Array.isArray(node.body)) { + nodesToCheck = node.body; + } else { + nodesToCheck = [node.body]; + } + + if (nodesToCheck.length > 0) { + checkNodesIndent(nodesToCheck, indent + indentSize); + } + + if (node.type === "BlockStatement") { + checkLastNodeLineIndent(node, indent); + } + } + + /** + * Filter out the elements which are on the same line of each other or the node. + * basically have only 1 elements from each line except the variable declaration line. + * @param {ASTNode} node Variable declaration node + * @returns {ASTNode[]} Filtered elements + */ + function filterOutSameLineVars(node) { + return node.declarations.reduce((finalCollection, elem) => { + const lastElem = finalCollection.at(-1); + + if ((elem.loc.start.line !== node.loc.start.line && !lastElem) || + (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) { + finalCollection.push(elem); + } + + return finalCollection; + }, []); + } + + /** + * Check indentation for variable declarations + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkIndentInVariableDeclarations(node) { + const elements = filterOutSameLineVars(node); + const nodeIndent = getNodeIndent(node).goodChar; + const lastElement = elements.at(-1); + + const elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind]; + + checkNodesIndent(elements, elementsIndent); + + // Only check the last line if there is any token after the last item + if (sourceCode.getLastToken(node).loc.end.line <= lastElement.loc.end.line) { + return; + } + + const tokenBeforeLastElement = sourceCode.getTokenBefore(lastElement); + + if (tokenBeforeLastElement.value === ",") { + + // Special case for comma-first syntax where the semicolon is indented + checkLastNodeLineIndent(node, getNodeIndent(tokenBeforeLastElement).goodChar); + } else { + checkLastNodeLineIndent(node, elementsIndent - indentSize); + } + } + + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function blockLessNodes(node) { + if (node.body.type !== "BlockStatement") { + blockIndentationCheck(node); + } + } + + /** + * Returns the expected indentation for the case statement + * @param {ASTNode} node node to examine + * @param {int} [providedSwitchIndent] indent for switch statement + * @returns {int} indent size + */ + function expectedCaseIndent(node, providedSwitchIndent) { + const switchNode = (node.type === "SwitchStatement") ? node : node.parent; + const switchIndent = typeof providedSwitchIndent === "undefined" + ? getNodeIndent(switchNode).goodChar + : providedSwitchIndent; + let caseIndent; + + if (caseIndentStore[switchNode.loc.start.line]) { + return caseIndentStore[switchNode.loc.start.line]; + } + + if (switchNode.cases.length > 0 && options.SwitchCase === 0) { + caseIndent = switchIndent; + } else { + caseIndent = switchIndent + (indentSize * options.SwitchCase); + } + + caseIndentStore[switchNode.loc.start.line] = caseIndent; + return caseIndent; + + } + + /** + * Checks whether a return statement is wrapped in () + * @param {ASTNode} node node to examine + * @returns {boolean} the result + */ + function isWrappedInParenthesis(node) { + const regex = /^return\s*?\(\s*?\);*?/u; + + const statementWithoutArgument = sourceCode.getText(node).replace( + sourceCode.getText(node.argument), "" + ); + + return regex.test(statementWithoutArgument); + } + + return { + Program(node) { + if (node.body.length > 0) { + + // Root nodes should have no indent + checkNodesIndent(node.body, getNodeIndent(node).goodChar); + } + }, + + ClassBody: blockIndentationCheck, + + BlockStatement: blockIndentationCheck, + + WhileStatement: blockLessNodes, + + ForStatement: blockLessNodes, + + ForInStatement: blockLessNodes, + + ForOfStatement: blockLessNodes, + + DoWhileStatement: blockLessNodes, + + IfStatement(node) { + if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) { + blockIndentationCheck(node); + } + }, + + VariableDeclaration(node) { + if (node.declarations.at(-1).loc.start.line > node.declarations[0].loc.start.line) { + checkIndentInVariableDeclarations(node); + } + }, + + ObjectExpression(node) { + checkIndentInArrayOrObjectBlock(node); + }, + + ArrayExpression(node) { + checkIndentInArrayOrObjectBlock(node); + }, + + MemberExpression(node) { + + if (typeof options.MemberExpression === "undefined") { + return; + } + + if (isSingleLineNode(node)) { + return; + } + + /* + * The typical layout of variable declarations and assignments + * alter the expectation of correct indentation. Skip them. + * TODO: Add appropriate configuration options for variable + * declarations and assignments. + */ + if (getParentNodeByType(node, "VariableDeclarator", ["FunctionExpression", "ArrowFunctionExpression"])) { + return; + } + + if (getParentNodeByType(node, "AssignmentExpression", ["FunctionExpression"])) { + return; + } + + const propertyIndent = getNodeIndent(node).goodChar + indentSize * options.MemberExpression; + + const checkNodes = [node.property]; + + const dot = sourceCode.getTokenBefore(node.property); + + if (dot.type === "Punctuator" && dot.value === ".") { + checkNodes.push(dot); + } + + checkNodesIndent(checkNodes, propertyIndent); + }, + + SwitchStatement(node) { + + // Switch is not a 'BlockStatement' + const switchIndent = getNodeIndent(node).goodChar; + const caseIndent = expectedCaseIndent(node, switchIndent); + + checkNodesIndent(node.cases, caseIndent); + + + checkLastNodeLineIndent(node, switchIndent); + }, + + SwitchCase(node) { + + // Skip inline cases + if (isSingleLineNode(node)) { + return; + } + const caseIndent = expectedCaseIndent(node); + + checkNodesIndent(node.consequent, caseIndent + indentSize); + }, + + FunctionDeclaration(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.FunctionDeclaration.parameters === "first" && node.params.length) { + checkNodesIndent(node.params.slice(1), node.params[0].loc.start.column); + } else if (options.FunctionDeclaration.parameters !== null) { + checkNodesIndent(node.params, getNodeIndent(node).goodChar + indentSize * options.FunctionDeclaration.parameters); + } + }, + + FunctionExpression(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.FunctionExpression.parameters === "first" && node.params.length) { + checkNodesIndent(node.params.slice(1), node.params[0].loc.start.column); + } else if (options.FunctionExpression.parameters !== null) { + checkNodesIndent(node.params, getNodeIndent(node).goodChar + indentSize * options.FunctionExpression.parameters); + } + }, + + ReturnStatement(node) { + if (isSingleLineNode(node)) { + return; + } + + const firstLineIndent = getNodeIndent(node).goodChar; + + // in case if return statement is wrapped in parenthesis + if (isWrappedInParenthesis(node)) { + checkLastReturnStatementLineIndent(node, firstLineIndent); + } else { + checkNodeIndent(node, firstLineIndent); + } + }, + + CallExpression(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.CallExpression.arguments === "first" && node.arguments.length) { + checkNodesIndent(node.arguments.slice(1), node.arguments[0].loc.start.column); + } else if (options.CallExpression.arguments !== null) { + checkNodesIndent(node.arguments, getNodeIndent(node).goodChar + indentSize * options.CallExpression.arguments); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/indent.js b/node_modules/eslint/lib/rules/indent.js new file mode 100644 index 0000000..6b0d579 --- /dev/null +++ b/node_modules/eslint/lib/rules/indent.js @@ -0,0 +1,1821 @@ +/** + * @fileoverview This rule sets a specific indentation style and width for your code + * + * @author Teddy Katz + * @author Vitaly Puzrin + * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const KNOWN_NODES = new Set([ + "AssignmentExpression", + "AssignmentPattern", + "ArrayExpression", + "ArrayPattern", + "ArrowFunctionExpression", + "AwaitExpression", + "BlockStatement", + "BinaryExpression", + "BreakStatement", + "CallExpression", + "CatchClause", + "ChainExpression", + "ClassBody", + "ClassDeclaration", + "ClassExpression", + "ConditionalExpression", + "ContinueStatement", + "DoWhileStatement", + "DebuggerStatement", + "EmptyStatement", + "ExperimentalRestProperty", + "ExperimentalSpreadProperty", + "ExpressionStatement", + "ForStatement", + "ForInStatement", + "ForOfStatement", + "FunctionDeclaration", + "FunctionExpression", + "Identifier", + "IfStatement", + "Literal", + "LabeledStatement", + "LogicalExpression", + "MemberExpression", + "MetaProperty", + "MethodDefinition", + "NewExpression", + "ObjectExpression", + "ObjectPattern", + "PrivateIdentifier", + "Program", + "Property", + "PropertyDefinition", + "RestElement", + "ReturnStatement", + "SequenceExpression", + "SpreadElement", + "StaticBlock", + "Super", + "SwitchCase", + "SwitchStatement", + "TaggedTemplateExpression", + "TemplateElement", + "TemplateLiteral", + "ThisExpression", + "ThrowStatement", + "TryStatement", + "UnaryExpression", + "UpdateExpression", + "VariableDeclaration", + "VariableDeclarator", + "WhileStatement", + "WithStatement", + "YieldExpression", + "JSXFragment", + "JSXOpeningFragment", + "JSXClosingFragment", + "JSXIdentifier", + "JSXNamespacedName", + "JSXMemberExpression", + "JSXEmptyExpression", + "JSXExpressionContainer", + "JSXElement", + "JSXClosingElement", + "JSXOpeningElement", + "JSXAttribute", + "JSXSpreadAttribute", + "JSXText", + "ExportDefaultDeclaration", + "ExportNamedDeclaration", + "ExportAllDeclaration", + "ExportSpecifier", + "ImportDeclaration", + "ImportSpecifier", + "ImportDefaultSpecifier", + "ImportNamespaceSpecifier", + "ImportExpression" +]); + +/* + * General rule strategy: + * 1. An OffsetStorage instance stores a map of desired offsets, where each token has a specified offset from another + * specified token or to the first column. + * 2. As the AST is traversed, modify the desired offsets of tokens accordingly. For example, when entering a + * BlockStatement, offset all of the tokens in the BlockStatement by 1 indent level from the opening curly + * brace of the BlockStatement. + * 3. After traversing the AST, calculate the expected indentation levels of every token according to the + * OffsetStorage container. + * 4. For each line, compare the expected indentation of the first token to the actual indentation in the file, + * and report the token if the two values are not equal. + */ + + +/** + * A mutable map that stores (key, value) pairs. The keys are numeric indices, and must be unique. + * This is intended to be a generic wrapper around a map with non-negative integer keys, so that the underlying implementation + * can easily be swapped out. + */ +class IndexMap { + + /** + * Creates an empty map + * @param {number} maxKey The maximum key + */ + constructor(maxKey) { + + // Initializing the array with the maximum expected size avoids dynamic reallocations that could degrade performance. + this._values = Array(maxKey + 1); + } + + /** + * Inserts an entry into the map. + * @param {number} key The entry's key + * @param {any} value The entry's value + * @returns {void} + */ + insert(key, value) { + this._values[key] = value; + } + + /** + * Finds the value of the entry with the largest key less than or equal to the provided key + * @param {number} key The provided key + * @returns {*|undefined} The value of the found entry, or undefined if no such entry exists. + */ + findLastNotAfter(key) { + const values = this._values; + + for (let index = key; index >= 0; index--) { + const value = values[index]; + + if (value) { + return value; + } + } + return void 0; + } + + /** + * Deletes all of the keys in the interval [start, end) + * @param {number} start The start of the range + * @param {number} end The end of the range + * @returns {void} + */ + deleteRange(start, end) { + this._values.fill(void 0, start, end); + } +} + +/** + * A helper class to get token-based info related to indentation + */ +class TokenInfo { + + /** + * @param {SourceCode} sourceCode A SourceCode object + */ + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.firstTokensByLineNumber = new Map(); + const tokens = sourceCode.tokensAndComments; + + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + + if (!this.firstTokensByLineNumber.has(token.loc.start.line)) { + this.firstTokensByLineNumber.set(token.loc.start.line, token); + } + if (!this.firstTokensByLineNumber.has(token.loc.end.line) && sourceCode.text.slice(token.range[1] - token.loc.end.column, token.range[1]).trim()) { + this.firstTokensByLineNumber.set(token.loc.end.line, token); + } + } + } + + /** + * Gets the first token on a given token's line + * @param {Token|ASTNode} token a node or token + * @returns {Token} The first token on the given line + */ + getFirstTokenOfLine(token) { + return this.firstTokensByLineNumber.get(token.loc.start.line); + } + + /** + * Determines whether a token is the first token in its line + * @param {Token} token The token + * @returns {boolean} `true` if the token is the first on its line + */ + isFirstTokenOfLine(token) { + return this.getFirstTokenOfLine(token) === token; + } + + /** + * Get the actual indent of a token + * @param {Token} token Token to examine. This should be the first token on its line. + * @returns {string} The indentation characters that precede the token + */ + getTokenIndent(token) { + return this.sourceCode.text.slice(token.range[0] - token.loc.start.column, token.range[0]); + } +} + +/** + * A class to store information on desired offsets of tokens from each other + */ +class OffsetStorage { + + /** + * @param {TokenInfo} tokenInfo a TokenInfo instance + * @param {number} indentSize The desired size of each indentation level + * @param {string} indentType The indentation character + * @param {number} maxIndex The maximum end index of any token + */ + constructor(tokenInfo, indentSize, indentType, maxIndex) { + this._tokenInfo = tokenInfo; + this._indentSize = indentSize; + this._indentType = indentType; + + this._indexMap = new IndexMap(maxIndex); + this._indexMap.insert(0, { offset: 0, from: null, force: false }); + + this._lockedFirstTokens = new WeakMap(); + this._desiredIndentCache = new WeakMap(); + this._ignoredTokens = new WeakSet(); + } + + _getOffsetDescriptor(token) { + return this._indexMap.findLastNotAfter(token.range[0]); + } + + /** + * Sets the offset column of token B to match the offset column of token A. + * - **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In + * most cases, `setDesiredOffset` should be used instead. + * @param {Token} baseToken The first token + * @param {Token} offsetToken The second token, whose offset should be matched to the first token + * @returns {void} + */ + matchOffsetOf(baseToken, offsetToken) { + + /* + * lockedFirstTokens is a map from a token whose indentation is controlled by the "first" option to + * the token that it depends on. For example, with the `ArrayExpression: first` option, the first + * token of each element in the array after the first will be mapped to the first token of the first + * element. The desired indentation of each of these tokens is computed based on the desired indentation + * of the "first" element, rather than through the normal offset mechanism. + */ + this._lockedFirstTokens.set(offsetToken, baseToken); + } + + /** + * Sets the desired offset of a token. + * + * This uses a line-based offset collapsing behavior to handle tokens on the same line. + * For example, consider the following two cases: + * + * ( + * [ + * bar + * ] + * ) + * + * ([ + * bar + * ]) + * + * Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from + * the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is + * the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces) + * from the start of its line. + * + * However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level + * between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the + * `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented + * by 1 indent level from the start of the line. + * + * This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node, + * without needing to check which lines those tokens are on. + * + * Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive + * behavior can occur. For example, consider the following cases: + * + * foo( + * ). + * bar( + * baz + * ) + * + * foo( + * ).bar( + * baz + * ) + * + * Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz` + * should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz` + * being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no + * collapsing would occur). + * + * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and + * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed + * in the second case. + * @param {Token} token The token + * @param {Token} fromToken The token that `token` should be offset from + * @param {number} offset The desired indent level + * @returns {void} + */ + setDesiredOffset(token, fromToken, offset) { + return this.setDesiredOffsets(token.range, fromToken, offset); + } + + /** + * Sets the desired offset of all tokens in a range + * It's common for node listeners in this file to need to apply the same offset to a large, contiguous range of tokens. + * Moreover, the offset of any given token is usually updated multiple times (roughly once for each node that contains + * it). This means that the offset of each token is updated O(AST depth) times. + * It would not be performant to store and update the offsets for each token independently, because the rule would end + * up having a time complexity of O(number of tokens * AST depth), which is quite slow for large files. + * + * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following + * list could represent the state of the offset tree at a given point: + * + * - Tokens starting in the interval [0, 15) are aligned with the beginning of the file + * - Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token + * - Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token + * - Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token + * - Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token + * + * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using: + * `setDesiredOffsets([30, 43], fooToken, 1);` + * @param {[number, number]} range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied. + * @param {Token} fromToken The token that this is offset from + * @param {number} offset The desired indent level + * @param {boolean} force `true` if this offset should not use the normal collapsing behavior. This should almost always be false. + * @returns {void} + */ + setDesiredOffsets(range, fromToken, offset, force) { + + /* + * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset + * descriptor. The tree for the example above would have the following nodes: + * + * * key: 0, value: { offset: 0, from: null } + * * key: 15, value: { offset: 1, from: barToken } + * * key: 30, value: { offset: 1, from: fooToken } + * * key: 43, value: { offset: 2, from: barToken } + * * key: 820, value: { offset: 1, from: bazToken } + * + * To find the offset descriptor for any given token, one needs to find the node with the largest key + * which is <= token.start. To make this operation fast, the nodes are stored in a map indexed by key. + */ + + const descriptorToInsert = { offset, from: fromToken, force }; + + const descriptorAfterRange = this._indexMap.findLastNotAfter(range[1]); + + const fromTokenIsInRange = fromToken && fromToken.range[0] >= range[0] && fromToken.range[1] <= range[1]; + const fromTokenDescriptor = fromTokenIsInRange && this._getOffsetDescriptor(fromToken); + + // First, remove any existing nodes in the range from the map. + this._indexMap.deleteRange(range[0] + 1, range[1]); + + // Insert a new node into the map for this range + this._indexMap.insert(range[0], descriptorToInsert); + + /* + * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously, + * even if it's in the current range. + */ + if (fromTokenIsInRange) { + this._indexMap.insert(fromToken.range[0], fromTokenDescriptor); + this._indexMap.insert(fromToken.range[1], descriptorToInsert); + } + + /* + * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following + * tokens the same as it was before. + */ + this._indexMap.insert(range[1], descriptorAfterRange); + } + + /** + * Gets the desired indent of a token + * @param {Token} token The token + * @returns {string} The desired indent of the token + */ + getDesiredIndent(token) { + if (!this._desiredIndentCache.has(token)) { + + if (this._ignoredTokens.has(token)) { + + /* + * If the token is ignored, use the actual indent of the token as the desired indent. + * This ensures that no errors are reported for this token. + */ + this._desiredIndentCache.set( + token, + this._tokenInfo.getTokenIndent(token) + ); + } else if (this._lockedFirstTokens.has(token)) { + const firstToken = this._lockedFirstTokens.get(token); + + this._desiredIndentCache.set( + token, + + // (indentation for the first element's line) + this.getDesiredIndent(this._tokenInfo.getFirstTokenOfLine(firstToken)) + + + // (space between the start of the first element's line and the first element) + this._indentType.repeat(firstToken.loc.start.column - this._tokenInfo.getFirstTokenOfLine(firstToken).loc.start.column) + ); + } else { + const offsetInfo = this._getOffsetDescriptor(token); + const offset = ( + offsetInfo.from && + offsetInfo.from.loc.start.line === token.loc.start.line && + !/^\s*?\n/u.test(token.value) && + !offsetInfo.force + ) ? 0 : offsetInfo.offset * this._indentSize; + + this._desiredIndentCache.set( + token, + (offsetInfo.from ? this.getDesiredIndent(offsetInfo.from) : "") + this._indentType.repeat(offset) + ); + } + } + return this._desiredIndentCache.get(token); + } + + /** + * Ignores a token, preventing it from being reported. + * @param {Token} token The token + * @returns {void} + */ + ignoreToken(token) { + if (this._tokenInfo.isFirstTokenOfLine(token)) { + this._ignoredTokens.add(token); + } + } + + /** + * Gets the first token that the given token's indentation is dependent on + * @param {Token} token The token + * @returns {Token} The token that the given token depends on, or `null` if the given token is at the top level + */ + getFirstDependency(token) { + return this._getOffsetDescriptor(token).from; + } +} + +const ELEMENT_LIST_SCHEMA = { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first", "off"] + } + ] +}; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "indent", + url: "https://eslint.style/rules/js/indent" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent indentation", + recommended: false, + url: "https://eslint.org/docs/latest/rules/indent" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["tab"] + }, + { + type: "integer", + minimum: 0 + } + ] + }, + { + type: "object", + properties: { + SwitchCase: { + type: "integer", + minimum: 0, + default: 0 + }, + VariableDeclarator: { + oneOf: [ + ELEMENT_LIST_SCHEMA, + { + type: "object", + properties: { + var: ELEMENT_LIST_SCHEMA, + let: ELEMENT_LIST_SCHEMA, + const: ELEMENT_LIST_SCHEMA + }, + additionalProperties: false + } + ] + }, + outerIIFEBody: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["off"] + } + ] + }, + MemberExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["off"] + } + ] + }, + FunctionDeclaration: { + type: "object", + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + FunctionExpression: { + type: "object", + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + StaticBlock: { + type: "object", + properties: { + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + CallExpression: { + type: "object", + properties: { + arguments: ELEMENT_LIST_SCHEMA + }, + additionalProperties: false + }, + ArrayExpression: ELEMENT_LIST_SCHEMA, + ObjectExpression: ELEMENT_LIST_SCHEMA, + ImportDeclaration: ELEMENT_LIST_SCHEMA, + flatTernaryExpressions: { + type: "boolean", + default: false + }, + offsetTernaryExpressions: { + type: "boolean", + default: false + }, + ignoredNodes: { + type: "array", + items: { + type: "string", + not: { + pattern: ":exit$" + } + } + }, + ignoreComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + wrongIndentation: "Expected indentation of {{expected}} but found {{actual}}." + } + }, + + create(context) { + const DEFAULT_VARIABLE_INDENT = 1; + const DEFAULT_PARAMETER_INDENT = 1; + const DEFAULT_FUNCTION_BODY_INDENT = 1; + + let indentType = "space"; + let indentSize = 4; + const options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + }, + outerIIFEBody: 1, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + StaticBlock: { + body: DEFAULT_FUNCTION_BODY_INDENT + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT + }, + MemberExpression: 1, + ArrayExpression: 1, + ObjectExpression: 1, + ImportDeclaration: 1, + flatTernaryExpressions: false, + ignoredNodes: [], + ignoreComments: false + }; + + if (context.options.length) { + if (context.options[0] === "tab") { + indentSize = 1; + indentType = "tab"; + } else { + indentSize = context.options[0]; + indentType = "space"; + } + + if (context.options[1]) { + Object.assign(options, context.options[1]); + + if (typeof options.VariableDeclarator === "number" || options.VariableDeclarator === "first") { + options.VariableDeclarator = { + var: options.VariableDeclarator, + let: options.VariableDeclarator, + const: options.VariableDeclarator + }; + } + } + } + + const sourceCode = context.sourceCode; + const tokenInfo = new TokenInfo(sourceCode); + const offsets = new OffsetStorage(tokenInfo, indentSize, indentType === "space" ? " " : "\t", sourceCode.text.length); + const parameterParens = new WeakSet(); + + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param {int} expectedAmount The expected amount of indentation characters for this line + * @param {int} actualSpaces The actual number of indentation spaces that were found on this line + * @param {int} actualTabs The actual number of indentation tabs that were found on this line + * @returns {string} An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" + let foundStatement; + + if (actualSpaces > 0) { + + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; + } else if (actualTabs > 0) { + foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } else { + foundStatement = "0"; + } + return { + expected: expectedStatement, + actual: foundStatement + }; + } + + /** + * Reports a given indent violation + * @param {Token} token Token violating the indent rule + * @param {string} neededIndent Expected indentation string + * @returns {void} + */ + function report(token, neededIndent) { + const actualIndent = Array.from(tokenInfo.getTokenIndent(token)); + const numSpaces = actualIndent.filter(char => char === " ").length; + const numTabs = actualIndent.filter(char => char === "\t").length; + + context.report({ + node: token, + messageId: "wrongIndentation", + data: createErrorMessageData(neededIndent.length, numSpaces, numTabs), + loc: { + start: { line: token.loc.start.line, column: 0 }, + end: { line: token.loc.start.line, column: token.loc.start.column } + }, + fix(fixer) { + const range = [token.range[0] - token.loc.start.column, token.range[0]]; + const newText = neededIndent; + + return fixer.replaceTextRange(range, newText); + } + }); + } + + /** + * Checks if a token's indentation is correct + * @param {Token} token Token to examine + * @param {string} desiredIndent Desired indentation of the string + * @returns {boolean} `true` if the token's indentation is correct + */ + function validateTokenIndent(token, desiredIndent) { + const indentation = tokenInfo.getTokenIndent(token); + + return indentation === desiredIndent || + + // To avoid conflicts with no-mixed-spaces-and-tabs, don't report mixed spaces and tabs. + indentation.includes(" ") && indentation.includes("\t"); + } + + /** + * Check to see if the node is a file level IIFE + * @param {ASTNode} node The function node to check. + * @returns {boolean} True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + + /* + * Verify that the node is an IIFE + */ + if (!node.parent || node.parent.type !== "CallExpression" || node.parent.callee !== node) { + return false; + } + + /* + * Navigate legal ancestors to determine whether this IIFE is outer. + * A "legal ancestor" is an expression or statement that causes the function to get executed immediately. + * For example, `!(function(){})()` is an outer IIFE even though it is preceded by a ! operator. + */ + let statement = node.parent && node.parent.parent; + + while ( + statement.type === "UnaryExpression" && ["!", "~", "+", "-"].includes(statement.operator) || + statement.type === "AssignmentExpression" || + statement.type === "LogicalExpression" || + statement.type === "SequenceExpression" || + statement.type === "VariableDeclarator" + ) { + statement = statement.parent; + } + + return (statement.type === "ExpressionStatement" || statement.type === "VariableDeclaration") && statement.parent.type === "Program"; + } + + /** + * Counts the number of linebreaks that follow the last non-whitespace character in a string + * @param {string} string The string to check + * @returns {number} The number of JavaScript linebreaks that follow the last non-whitespace character, + * or the total number of linebreaks if the string is all whitespace. + */ + function countTrailingLinebreaks(string) { + const trailingWhitespace = string.match(/\s*$/u)[0]; + const linebreakMatches = trailingWhitespace.match(astUtils.createGlobalLinebreakMatcher()); + + return linebreakMatches === null ? 0 : linebreakMatches.length; + } + + /** + * Check indentation for lists of elements (arrays, objects, function params) + * @param {ASTNode[]} elements List of elements that should be offset + * @param {Token} startToken The start token of the list that element should be aligned against, e.g. '[' + * @param {Token} endToken The end token of the list, e.g. ']' + * @param {number|string} offset The amount that the elements should be offset + * @returns {void} + */ + function addElementListIndent(elements, startToken, endToken, offset) { + + /** + * Gets the first token of a given element, including surrounding parentheses. + * @param {ASTNode} element A node in the `elements` list + * @returns {Token} The first token of this element + */ + function getFirstToken(element) { + let token = sourceCode.getTokenBefore(element); + + while (astUtils.isOpeningParenToken(token) && token !== startToken) { + token = sourceCode.getTokenBefore(token); + } + return sourceCode.getTokenAfter(token); + } + + // Run through all the tokens in the list, and offset them by one indent level (mainly for comments, other things will end up overridden) + offsets.setDesiredOffsets( + [startToken.range[1], endToken.range[0]], + startToken, + typeof offset === "number" ? offset : 1 + ); + offsets.setDesiredOffset(endToken, startToken, 0); + + // If the preference is "first" but there is no first element (e.g. sparse arrays w/ empty first slot), fall back to 1 level. + if (offset === "first" && elements.length && !elements[0]) { + return; + } + elements.forEach((element, index) => { + if (!element) { + + // Skip holes in arrays + return; + } + if (offset === "off") { + + // Ignore the first token of every element if the "off" option is used + offsets.ignoreToken(getFirstToken(element)); + } + + // Offset the following elements correctly relative to the first element + if (index === 0) { + return; + } + if (offset === "first" && tokenInfo.isFirstTokenOfLine(getFirstToken(element))) { + offsets.matchOffsetOf(getFirstToken(elements[0]), getFirstToken(element)); + } else { + const previousElement = elements[index - 1]; + const firstTokenOfPreviousElement = previousElement && getFirstToken(previousElement); + const previousElementLastToken = previousElement && sourceCode.getLastToken(previousElement); + + if ( + previousElement && + previousElementLastToken.loc.end.line - countTrailingLinebreaks(previousElementLastToken.value) > startToken.loc.end.line + ) { + offsets.setDesiredOffsets( + [previousElement.range[1], element.range[1]], + firstTokenOfPreviousElement, + 0 + ); + } + } + }); + } + + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function addBlocklessNodeIndent(node) { + if (node.type !== "BlockStatement") { + const lastParentToken = sourceCode.getTokenBefore(node, astUtils.isNotOpeningParenToken); + + let firstBodyToken = sourceCode.getFirstToken(node); + let lastBodyToken = sourceCode.getLastToken(node); + + while ( + astUtils.isOpeningParenToken(sourceCode.getTokenBefore(firstBodyToken)) && + astUtils.isClosingParenToken(sourceCode.getTokenAfter(lastBodyToken)) + ) { + firstBodyToken = sourceCode.getTokenBefore(firstBodyToken); + lastBodyToken = sourceCode.getTokenAfter(lastBodyToken); + } + + offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1); + } + } + + /** + * Checks the indentation for nodes that are like function calls (`CallExpression` and `NewExpression`) + * @param {ASTNode} node A CallExpression or NewExpression node + * @returns {void} + */ + function addFunctionCallIndent(node) { + let openingParen; + + if (node.arguments.length) { + openingParen = sourceCode.getFirstTokenBetween(node.callee, node.arguments[0], astUtils.isOpeningParenToken); + } else { + openingParen = sourceCode.getLastToken(node, 1); + } + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + + /* + * If `?.` token exists, set desired offset for that. + * This logic is copied from `MemberExpression`'s. + */ + if (node.optional) { + const dotToken = sourceCode.getTokenAfter(node.callee, astUtils.isQuestionDotToken); + const calleeParenCount = sourceCode.getTokensBetween(node.callee, dotToken, { filter: astUtils.isClosingParenToken }).length; + const firstTokenOfCallee = calleeParenCount + ? sourceCode.getTokenBefore(node.callee, { skip: calleeParenCount - 1 }) + : sourceCode.getFirstToken(node.callee); + const lastTokenOfCallee = sourceCode.getTokenBefore(dotToken); + const offsetBase = lastTokenOfCallee.loc.end.line === openingParen.loc.start.line + ? lastTokenOfCallee + : firstTokenOfCallee; + + offsets.setDesiredOffset(dotToken, offsetBase, 1); + } + + const offsetAfterToken = node.callee.type === "TaggedTemplateExpression" ? sourceCode.getFirstToken(node.callee.quasi) : openingParen; + const offsetToken = sourceCode.getTokenBefore(offsetAfterToken); + + offsets.setDesiredOffset(openingParen, offsetToken, 0); + + addElementListIndent(node.arguments, openingParen, closingParen, options.CallExpression.arguments); + } + + /** + * Checks the indentation of parenthesized values, given a list of tokens in a program + * @param {Token[]} tokens A list of tokens + * @returns {void} + */ + function addParensIndent(tokens) { + const parenStack = []; + const parenPairs = []; + + for (let i = 0; i < tokens.length; i++) { + const nextToken = tokens[i]; + + if (astUtils.isOpeningParenToken(nextToken)) { + parenStack.push(nextToken); + } else if (astUtils.isClosingParenToken(nextToken)) { + parenPairs.push({ left: parenStack.pop(), right: nextToken }); + } + } + + for (let i = parenPairs.length - 1; i >= 0; i--) { + const leftParen = parenPairs[i].left; + const rightParen = parenPairs[i].right; + + // We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments. + if (!parameterParens.has(leftParen) && !parameterParens.has(rightParen)) { + const parenthesizedTokens = new Set(sourceCode.getTokensBetween(leftParen, rightParen)); + + parenthesizedTokens.forEach(token => { + if (!parenthesizedTokens.has(offsets.getFirstDependency(token))) { + offsets.setDesiredOffset(token, leftParen, 1); + } + }); + } + + offsets.setDesiredOffset(rightParen, leftParen, 0); + } + } + + /** + * Ignore all tokens within an unknown node whose offset do not depend + * on another token's offset within the unknown node + * @param {ASTNode} node Unknown Node + * @returns {void} + */ + function ignoreNode(node) { + const unknownNodeTokens = new Set(sourceCode.getTokens(node, { includeComments: true })); + + unknownNodeTokens.forEach(token => { + if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) { + const firstTokenOfLine = tokenInfo.getFirstTokenOfLine(token); + + if (token === firstTokenOfLine) { + offsets.ignoreToken(token); + } else { + offsets.setDesiredOffset(token, firstTokenOfLine, 0); + } + } + }); + } + + /** + * Check whether the given token is on the first line of a statement. + * @param {Token} token The token to check. + * @param {ASTNode} leafNode The expression node that the token belongs directly. + * @returns {boolean} `true` if the token is on the first line of a statement. + */ + function isOnFirstLineOfStatement(token, leafNode) { + let node = leafNode; + + while (node.parent && !node.parent.type.endsWith("Statement") && !node.parent.type.endsWith("Declaration")) { + node = node.parent; + } + node = node.parent; + + return !node || node.loc.start.line === token.loc.start.line; + } + + /** + * Check whether there are any blank (whitespace-only) lines between + * two tokens on separate lines. + * @param {Token} firstToken The first token. + * @param {Token} secondToken The second token. + * @returns {boolean} `true` if the tokens are on separate lines and + * there exists a blank line between them, `false` otherwise. + */ + function hasBlankLinesBetween(firstToken, secondToken) { + const firstTokenLine = firstToken.loc.end.line; + const secondTokenLine = secondToken.loc.start.line; + + if (firstTokenLine === secondTokenLine || firstTokenLine === secondTokenLine - 1) { + return false; + } + + for (let line = firstTokenLine + 1; line < secondTokenLine; ++line) { + if (!tokenInfo.firstTokensByLineNumber.has(line)) { + return true; + } + } + + return false; + } + + const ignoredNodeFirstTokens = new Set(); + + const baseOffsetListeners = { + "ArrayExpression, ArrayPattern"(node) { + const openingBracket = sourceCode.getFirstToken(node); + const closingBracket = sourceCode.getTokenAfter([...node.elements].reverse().find(_ => _) || openingBracket, astUtils.isClosingBracketToken); + + addElementListIndent(node.elements, openingBracket, closingBracket, options.ArrayExpression); + }, + + "ObjectExpression, ObjectPattern"(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getTokenAfter( + node.properties.length ? node.properties.at(-1) : openingCurly, + astUtils.isClosingBraceToken + ); + + addElementListIndent(node.properties, openingCurly, closingCurly, options.ObjectExpression); + }, + + ArrowFunctionExpression(node) { + const maybeOpeningParen = sourceCode.getFirstToken(node, { skip: node.async ? 1 : 0 }); + + if (astUtils.isOpeningParenToken(maybeOpeningParen)) { + const openingParen = maybeOpeningParen; + const closingParen = sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options.FunctionExpression.parameters); + } + + addBlocklessNodeIndent(node.body); + }, + + AssignmentExpression(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + + offsets.setDesiredOffsets([operator.range[0], node.range[1]], sourceCode.getLastToken(node.left), 1); + offsets.ignoreToken(operator); + offsets.ignoreToken(sourceCode.getTokenAfter(operator)); + }, + + "BinaryExpression, LogicalExpression"(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + + /* + * For backwards compatibility, don't check BinaryExpression indents, e.g. + * var foo = bar && + * baz; + */ + + const tokenAfterOperator = sourceCode.getTokenAfter(operator); + + offsets.ignoreToken(operator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffset(tokenAfterOperator, operator, 0); + }, + + "BlockStatement, ClassBody"(node) { + let blockIndentLevel; + + if (node.parent && isOuterIIFE(node.parent)) { + blockIndentLevel = options.outerIIFEBody; + } else if (node.parent && (node.parent.type === "FunctionExpression" || node.parent.type === "ArrowFunctionExpression")) { + blockIndentLevel = options.FunctionExpression.body; + } else if (node.parent && node.parent.type === "FunctionDeclaration") { + blockIndentLevel = options.FunctionDeclaration.body; + } else { + blockIndentLevel = 1; + } + + /* + * For blocks that aren't lone statements, ensure that the opening curly brace + * is aligned with the parent. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) { + offsets.setDesiredOffset(sourceCode.getFirstToken(node), sourceCode.getFirstToken(node.parent), 0); + } + + addElementListIndent(node.body, sourceCode.getFirstToken(node), sourceCode.getLastToken(node), blockIndentLevel); + }, + + CallExpression: addFunctionCallIndent, + + "ClassDeclaration[superClass], ClassExpression[superClass]"(node) { + const classToken = sourceCode.getFirstToken(node); + const extendsToken = sourceCode.getTokenBefore(node.superClass, astUtils.isNotOpeningParenToken); + + offsets.setDesiredOffsets([extendsToken.range[0], node.body.range[0]], classToken, 1); + }, + + ConditionalExpression(node) { + const firstToken = sourceCode.getFirstToken(node); + + // `flatTernaryExpressions` option is for the following style: + // var a = + // foo > 0 ? bar : + // foo < 0 ? baz : + // /*else*/ qiz ; + if (!options.flatTernaryExpressions || + !astUtils.isTokenOnSameLine(node.test, node.consequent) || + isOnFirstLineOfStatement(firstToken, node) + ) { + const questionMarkToken = sourceCode.getFirstTokenBetween(node.test, node.consequent, token => token.type === "Punctuator" && token.value === "?"); + const colonToken = sourceCode.getFirstTokenBetween(node.consequent, node.alternate, token => token.type === "Punctuator" && token.value === ":"); + + const firstConsequentToken = sourceCode.getTokenAfter(questionMarkToken); + const lastConsequentToken = sourceCode.getTokenBefore(colonToken); + const firstAlternateToken = sourceCode.getTokenAfter(colonToken); + + offsets.setDesiredOffset(questionMarkToken, firstToken, 1); + offsets.setDesiredOffset(colonToken, firstToken, 1); + + offsets.setDesiredOffset(firstConsequentToken, firstToken, firstConsequentToken.type === "Punctuator" && + options.offsetTernaryExpressions ? 2 : 1); + + /* + * The alternate and the consequent should usually have the same indentation. + * If they share part of a line, align the alternate against the first token of the consequent. + * This allows the alternate to be indented correctly in cases like this: + * foo ? ( + * bar + * ) : ( // this '(' is aligned with the '(' above, so it's considered to be aligned with `foo` + * baz // as a result, `baz` is offset by 1 rather than 2 + * ) + */ + if (lastConsequentToken.loc.end.line === firstAlternateToken.loc.start.line) { + offsets.setDesiredOffset(firstAlternateToken, firstConsequentToken, 0); + } else { + + /** + * If the alternate and consequent do not share part of a line, offset the alternate from the first + * token of the conditional expression. For example: + * foo ? bar + * : baz + * + * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up + * having no expected indentation. + */ + offsets.setDesiredOffset(firstAlternateToken, firstToken, firstAlternateToken.type === "Punctuator" && + options.offsetTernaryExpressions ? 2 : 1); + } + } + }, + + "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement, WithStatement": node => addBlocklessNodeIndent(node.body), + + ExportNamedDeclaration(node) { + if (node.declaration === null) { + const closingCurly = sourceCode.getLastToken(node, astUtils.isClosingBraceToken); + + // Indent the specifiers in `export {foo, bar, baz}` + addElementListIndent(node.specifiers, sourceCode.getFirstToken(node, { skip: 1 }), closingCurly, 1); + + if (node.source) { + + // Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'` + offsets.setDesiredOffsets([closingCurly.range[1], node.range[1]], sourceCode.getFirstToken(node), 1); + } + } + }, + + ForStatement(node) { + const forOpeningParen = sourceCode.getFirstToken(node, 1); + + if (node.init) { + offsets.setDesiredOffsets(node.init.range, forOpeningParen, 1); + } + if (node.test) { + offsets.setDesiredOffsets(node.test.range, forOpeningParen, 1); + } + if (node.update) { + offsets.setDesiredOffsets(node.update.range, forOpeningParen, 1); + } + addBlocklessNodeIndent(node.body); + }, + + "FunctionDeclaration, FunctionExpression"(node) { + const closingParen = sourceCode.getTokenBefore(node.body); + const openingParen = sourceCode.getTokenBefore(node.params.length ? node.params[0] : closingParen); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options[node.type].parameters); + }, + + IfStatement(node) { + addBlocklessNodeIndent(node.consequent); + if (node.alternate) { + addBlocklessNodeIndent(node.alternate); + } + }, + + /* + * For blockless nodes with semicolon-first style, don't indent the semicolon. + * e.g. + * if (foo) + * bar() + * ; [1, 2, 3].map(foo) + * + * Traversal into the node sets indentation of the semicolon, so we need to override it on exit. + */ + ":matches(DoWhileStatement, ForStatement, ForInStatement, ForOfStatement, IfStatement, WhileStatement, WithStatement):exit"(node) { + let nodesToCheck; + + if (node.type === "IfStatement") { + nodesToCheck = [node.consequent]; + if (node.alternate) { + nodesToCheck.push(node.alternate); + } + } else { + nodesToCheck = [node.body]; + } + + for (const nodeToCheck of nodesToCheck) { + const lastToken = sourceCode.getLastToken(nodeToCheck); + + if (astUtils.isSemicolonToken(lastToken)) { + const tokenBeforeLast = sourceCode.getTokenBefore(lastToken); + const tokenAfterLast = sourceCode.getTokenAfter(lastToken); + + // override indentation of `;` only if its line looks like a semicolon-first style line + if ( + !astUtils.isTokenOnSameLine(tokenBeforeLast, lastToken) && + tokenAfterLast && + astUtils.isTokenOnSameLine(lastToken, tokenAfterLast) + ) { + offsets.setDesiredOffset( + lastToken, + sourceCode.getFirstToken(node), + 0 + ); + } + } + } + }, + + ImportDeclaration(node) { + if (node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) { + const openingCurly = sourceCode.getFirstToken(node, astUtils.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node, astUtils.isClosingBraceToken); + + addElementListIndent(node.specifiers.filter(specifier => specifier.type === "ImportSpecifier"), openingCurly, closingCurly, options.ImportDeclaration); + } + + const fromToken = sourceCode.getLastToken(node, token => token.type === "Identifier" && token.value === "from"); + const sourceToken = sourceCode.getLastToken(node, token => token.type === "String"); + const semiToken = sourceCode.getLastToken(node, token => token.type === "Punctuator" && token.value === ";"); + + if (fromToken) { + const end = semiToken && semiToken.range[1] === sourceToken.range[1] ? node.range[1] : sourceToken.range[1]; + + offsets.setDesiredOffsets([fromToken.range[0], end], sourceCode.getFirstToken(node), 1); + } + }, + + ImportExpression(node) { + const openingParen = sourceCode.getFirstToken(node, 1); + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + offsets.setDesiredOffset(openingParen, sourceCode.getTokenBefore(openingParen), 0); + + addElementListIndent([node.source], openingParen, closingParen, options.CallExpression.arguments); + }, + + "MemberExpression, JSXMemberExpression, MetaProperty"(node) { + const object = node.type === "MetaProperty" ? node.meta : node.object; + const firstNonObjectToken = sourceCode.getFirstTokenBetween(object, node.property, astUtils.isNotClosingParenToken); + const secondNonObjectToken = sourceCode.getTokenAfter(firstNonObjectToken); + + const objectParenCount = sourceCode.getTokensBetween(object, node.property, { filter: astUtils.isClosingParenToken }).length; + const firstObjectToken = objectParenCount + ? sourceCode.getTokenBefore(object, { skip: objectParenCount - 1 }) + : sourceCode.getFirstToken(object); + const lastObjectToken = sourceCode.getTokenBefore(firstNonObjectToken); + const firstPropertyToken = node.computed ? firstNonObjectToken : secondNonObjectToken; + + if (node.computed) { + + // For computed MemberExpressions, match the closing bracket with the opening bracket. + offsets.setDesiredOffset(sourceCode.getLastToken(node), firstNonObjectToken, 0); + offsets.setDesiredOffsets(node.property.range, firstNonObjectToken, 1); + } + + /* + * If the object ends on the same line that the property starts, match against the last token + * of the object, to ensure that the MemberExpression is not indented. + * + * Otherwise, match against the first token of the object, e.g. + * foo + * .bar + * .baz // <-- offset by 1 from `foo` + */ + const offsetBase = lastObjectToken.loc.end.line === firstPropertyToken.loc.start.line + ? lastObjectToken + : firstObjectToken; + + if (typeof options.MemberExpression === "number") { + + // Match the dot (for non-computed properties) or the opening bracket (for computed properties) against the object. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, options.MemberExpression); + + /* + * For computed MemberExpressions, match the first token of the property against the opening bracket. + * Otherwise, match the first token of the property against the object. + */ + offsets.setDesiredOffset(secondNonObjectToken, node.computed ? firstNonObjectToken : offsetBase, options.MemberExpression); + } else { + + // If the MemberExpression option is off, ignore the dot and the first token of the property. + offsets.ignoreToken(firstNonObjectToken); + offsets.ignoreToken(secondNonObjectToken); + + // To ignore the property indentation, ensure that the property tokens depend on the ignored tokens. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, 0); + offsets.setDesiredOffset(secondNonObjectToken, firstNonObjectToken, 0); + } + }, + + NewExpression(node) { + + // Only indent the arguments if the NewExpression has parens (e.g. `new Foo(bar)` or `new Foo()`, but not `new Foo` + if (node.arguments.length > 0 || + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) && + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, 1))) { + addFunctionCallIndent(node); + } + }, + + Property(node) { + if (!node.shorthand && !node.method && node.kind === "init") { + const colon = sourceCode.getFirstTokenBetween(node.key, node.value, astUtils.isColonToken); + + offsets.ignoreToken(sourceCode.getTokenAfter(colon)); + } + }, + + PropertyDefinition(node) { + const firstToken = sourceCode.getFirstToken(node); + const maybeSemicolonToken = sourceCode.getLastToken(node); + let keyLastToken; + + // Indent key. + if (node.computed) { + const bracketTokenL = sourceCode.getTokenBefore(node.key, astUtils.isOpeningBracketToken); + const bracketTokenR = keyLastToken = sourceCode.getTokenAfter(node.key, astUtils.isClosingBracketToken); + const keyRange = [bracketTokenL.range[1], bracketTokenR.range[0]]; + + if (bracketTokenL !== firstToken) { + offsets.setDesiredOffset(bracketTokenL, firstToken, 0); + } + offsets.setDesiredOffsets(keyRange, bracketTokenL, 1); + offsets.setDesiredOffset(bracketTokenR, bracketTokenL, 0); + } else { + const idToken = keyLastToken = sourceCode.getFirstToken(node.key); + + if (idToken !== firstToken) { + offsets.setDesiredOffset(idToken, firstToken, 1); + } + } + + // Indent initializer. + if (node.value) { + const eqToken = sourceCode.getTokenBefore(node.value, astUtils.isEqToken); + const valueToken = sourceCode.getTokenAfter(eqToken); + + offsets.setDesiredOffset(eqToken, keyLastToken, 1); + offsets.setDesiredOffset(valueToken, eqToken, 1); + if (astUtils.isSemicolonToken(maybeSemicolonToken)) { + offsets.setDesiredOffset(maybeSemicolonToken, eqToken, 1); + } + } else if (astUtils.isSemicolonToken(maybeSemicolonToken)) { + offsets.setDesiredOffset(maybeSemicolonToken, keyLastToken, 1); + } + }, + + StaticBlock(node) { + const openingCurly = sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token + const closingCurly = sourceCode.getLastToken(node); + + addElementListIndent(node.body, openingCurly, closingCurly, options.StaticBlock.body); + }, + + SwitchStatement(node) { + const openingCurly = sourceCode.getTokenAfter(node.discriminant, astUtils.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets([openingCurly.range[1], closingCurly.range[0]], openingCurly, options.SwitchCase); + + if (node.cases.length) { + sourceCode.getTokensBetween( + node.cases.at(-1), + closingCurly, + { includeComments: true, filter: astUtils.isCommentToken } + ).forEach(token => offsets.ignoreToken(token)); + } + }, + + SwitchCase(node) { + if (!(node.consequent.length === 1 && node.consequent[0].type === "BlockStatement")) { + const caseKeyword = sourceCode.getFirstToken(node); + const tokenAfterCurrentCase = sourceCode.getTokenAfter(node); + + offsets.setDesiredOffsets([caseKeyword.range[1], tokenAfterCurrentCase.range[0]], caseKeyword, 1); + } + }, + + TemplateLiteral(node) { + node.expressions.forEach((expression, index) => { + const previousQuasi = node.quasis[index]; + const nextQuasi = node.quasis[index + 1]; + const tokenToAlignFrom = previousQuasi.loc.start.line === previousQuasi.loc.end.line + ? sourceCode.getFirstToken(previousQuasi) + : null; + + offsets.setDesiredOffsets([previousQuasi.range[1], nextQuasi.range[0]], tokenToAlignFrom, 1); + offsets.setDesiredOffset(sourceCode.getFirstToken(nextQuasi), tokenToAlignFrom, 0); + }); + }, + + VariableDeclaration(node) { + let variableIndent = Object.hasOwn(options.VariableDeclarator, node.kind) + ? options.VariableDeclarator[node.kind] + : DEFAULT_VARIABLE_INDENT; + + const firstToken = sourceCode.getFirstToken(node), + lastToken = sourceCode.getLastToken(node); + + if (options.VariableDeclarator[node.kind] === "first") { + if (node.declarations.length > 1) { + addElementListIndent( + node.declarations, + firstToken, + lastToken, + "first" + ); + return; + } + + variableIndent = DEFAULT_VARIABLE_INDENT; + } + + if (node.declarations.at(-1).loc.start.line > node.loc.start.line) { + + /* + * VariableDeclarator indentation is a bit different from other forms of indentation, in that the + * indentation of an opening bracket sometimes won't match that of a closing bracket. For example, + * the following indentations are correct: + * + * var foo = { + * ok: true + * }; + * + * var foo = { + * ok: true, + * }, + * bar = 1; + * + * Account for when exiting the AST (after indentations have already been set for the nodes in + * the declaration) by manually increasing the indentation level of the tokens in this declarator + * on the same line as the start of the declaration, provided that there are declarators that + * follow this one. + */ + offsets.setDesiredOffsets(node.range, firstToken, variableIndent, true); + } else { + offsets.setDesiredOffsets(node.range, firstToken, variableIndent); + } + + if (astUtils.isSemicolonToken(lastToken)) { + offsets.ignoreToken(lastToken); + } + }, + + VariableDeclarator(node) { + if (node.init) { + const equalOperator = sourceCode.getTokenBefore(node.init, astUtils.isNotOpeningParenToken); + const tokenAfterOperator = sourceCode.getTokenAfter(equalOperator); + + offsets.ignoreToken(equalOperator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffsets([tokenAfterOperator.range[0], node.range[1]], equalOperator, 1); + offsets.setDesiredOffset(equalOperator, sourceCode.getLastToken(node.id), 0); + } + }, + + "JSXAttribute[value]"(node) { + const equalsToken = sourceCode.getFirstTokenBetween(node.name, node.value, token => token.type === "Punctuator" && token.value === "="); + + offsets.setDesiredOffsets([equalsToken.range[0], node.value.range[1]], sourceCode.getFirstToken(node.name), 1); + }, + + JSXElement(node) { + if (node.closingElement) { + addElementListIndent(node.children, sourceCode.getFirstToken(node.openingElement), sourceCode.getFirstToken(node.closingElement), 1); + } + }, + + JSXOpeningElement(node) { + const firstToken = sourceCode.getFirstToken(node); + let closingToken; + + if (node.selfClosing) { + closingToken = sourceCode.getLastToken(node, { skip: 1 }); + offsets.setDesiredOffset(sourceCode.getLastToken(node), closingToken, 0); + } else { + closingToken = sourceCode.getLastToken(node); + } + offsets.setDesiredOffsets(node.name.range, sourceCode.getFirstToken(node)); + addElementListIndent(node.attributes, firstToken, closingToken, 1); + }, + + JSXClosingElement(node) { + const firstToken = sourceCode.getFirstToken(node); + + offsets.setDesiredOffsets(node.name.range, firstToken, 1); + }, + + JSXFragment(node) { + const firstOpeningToken = sourceCode.getFirstToken(node.openingFragment); + const firstClosingToken = sourceCode.getFirstToken(node.closingFragment); + + addElementListIndent(node.children, firstOpeningToken, firstClosingToken, 1); + }, + + JSXOpeningFragment(node) { + const firstToken = sourceCode.getFirstToken(node); + const closingToken = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets(node.range, firstToken, 1); + offsets.matchOffsetOf(firstToken, closingToken); + }, + + JSXClosingFragment(node) { + const firstToken = sourceCode.getFirstToken(node); + const slashToken = sourceCode.getLastToken(node, { skip: 1 }); + const closingToken = sourceCode.getLastToken(node); + const tokenToMatch = astUtils.isTokenOnSameLine(slashToken, closingToken) ? slashToken : closingToken; + + offsets.setDesiredOffsets(node.range, firstToken, 1); + offsets.matchOffsetOf(firstToken, tokenToMatch); + }, + + JSXExpressionContainer(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets( + [openingCurly.range[1], closingCurly.range[0]], + openingCurly, + 1 + ); + }, + + JSXSpreadAttribute(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets( + [openingCurly.range[1], closingCurly.range[0]], + openingCurly, + 1 + ); + }, + + "*"(node) { + const firstToken = sourceCode.getFirstToken(node); + + // Ensure that the children of every node are indented at least as much as the first token. + if (firstToken && !ignoredNodeFirstTokens.has(firstToken)) { + offsets.setDesiredOffsets(node.range, firstToken, 0); + } + } + }; + + const listenerCallQueue = []; + + /* + * To ignore the indentation of a node: + * 1. Don't call the node's listener when entering it (if it has a listener) + * 2. Don't set any offsets against the first token of the node. + * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets. + */ + const offsetListeners = {}; + + for (const [selector, listener] of Object.entries(baseOffsetListeners)) { + + /* + * Offset listener calls are deferred until traversal is finished, and are called as + * part of the final `Program:exit` listener. This is necessary because a node might + * be matched by multiple selectors. + * + * Example: Suppose there is an offset listener for `Identifier`, and the user has + * specified in configuration that `MemberExpression > Identifier` should be ignored. + * Due to selector specificity rules, the `Identifier` listener will get called first. However, + * if a given Identifier node is supposed to be ignored, then the `Identifier` offset listener + * should not have been called at all. Without doing extra selector matching, we don't know + * whether the Identifier matches the `MemberExpression > Identifier` selector until the + * `MemberExpression > Identifier` listener is called. + * + * To avoid this, the `Identifier` listener isn't called until traversal finishes and all + * ignored nodes are known. + */ + offsetListeners[selector] = node => listenerCallQueue.push({ listener, node }); + } + + // For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set. + const ignoredNodes = new Set(); + + /** + * Ignores a node + * @param {ASTNode} node The node to ignore + * @returns {void} + */ + function addToIgnoredNodes(node) { + ignoredNodes.add(node); + ignoredNodeFirstTokens.add(sourceCode.getFirstToken(node)); + } + + const ignoredNodeListeners = options.ignoredNodes.reduce( + (listeners, ignoredSelector) => Object.assign(listeners, { [ignoredSelector]: addToIgnoredNodes }), + {} + ); + + /* + * Join the listeners, and add a listener to verify that all tokens actually have the correct indentation + * at the end. + * + * Using Object.assign will cause some offset listeners to be overwritten if the same selector also appears + * in `ignoredNodeListeners`. This isn't a problem because all of the matching nodes will be ignored, + * so those listeners wouldn't be called anyway. + */ + return Object.assign( + offsetListeners, + ignoredNodeListeners, + { + "*:exit"(node) { + + // If a node's type is nonstandard, we can't tell how its children should be offset, so ignore it. + if (!KNOWN_NODES.has(node.type)) { + addToIgnoredNodes(node); + } + }, + "Program:exit"() { + + // If ignoreComments option is enabled, ignore all comment tokens. + if (options.ignoreComments) { + sourceCode.getAllComments() + .forEach(comment => offsets.ignoreToken(comment)); + } + + // Invoke the queued offset listeners for the nodes that aren't ignored. + for (let i = 0; i < listenerCallQueue.length; i++) { + const nodeInfo = listenerCallQueue[i]; + + if (!ignoredNodes.has(nodeInfo.node)) { + nodeInfo.listener(nodeInfo.node); + } + } + + // Update the offsets for ignored nodes to prevent their child tokens from being reported. + ignoredNodes.forEach(ignoreNode); + + addParensIndent(sourceCode.ast.tokens); + + /* + * Create a Map from (tokenOrComment) => (precedingToken). + * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly. + */ + const precedingTokens = new WeakMap(); + + for (let i = 0; i < sourceCode.ast.comments.length; i++) { + const comment = sourceCode.ast.comments[i]; + + const tokenOrCommentBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + const hasToken = precedingTokens.has(tokenOrCommentBefore) ? precedingTokens.get(tokenOrCommentBefore) : tokenOrCommentBefore; + + precedingTokens.set(comment, hasToken); + } + + for (let i = 1; i < sourceCode.lines.length + 1; i++) { + + if (!tokenInfo.firstTokensByLineNumber.has(i)) { + + // Don't check indentation on blank lines + continue; + } + + const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get(i); + + if (firstTokenOfLine.loc.start.line !== i) { + + // Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice. + continue; + } + + if (astUtils.isCommentToken(firstTokenOfLine)) { + const tokenBefore = precedingTokens.get(firstTokenOfLine); + const tokenAfter = tokenBefore ? sourceCode.getTokenAfter(tokenBefore) : sourceCode.ast.tokens[0]; + const mayAlignWithBefore = tokenBefore && !hasBlankLinesBetween(tokenBefore, firstTokenOfLine); + const mayAlignWithAfter = tokenAfter && !hasBlankLinesBetween(firstTokenOfLine, tokenAfter); + + /* + * If a comment precedes a line that begins with a semicolon token, align to that token, i.e. + * + * let foo + * // comment + * ;(async () => {})() + */ + if (tokenAfter && astUtils.isSemicolonToken(tokenAfter) && !astUtils.isTokenOnSameLine(firstTokenOfLine, tokenAfter)) { + offsets.setDesiredOffset(firstTokenOfLine, tokenAfter, 0); + } + + // If a comment matches the expected indentation of the token immediately before or after, don't report it. + if ( + mayAlignWithBefore && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenBefore)) || + mayAlignWithAfter && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenAfter)) + ) { + continue; + } + } + + // If the token matches the expected indentation, don't report it. + if (validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine))) { + continue; + } + + // Otherwise, report the token/comment. + report(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine)); + } + } + } + ); + } +}; diff --git a/node_modules/eslint/lib/rules/index.js b/node_modules/eslint/lib/rules/index.js new file mode 100644 index 0000000..5ff7b6f --- /dev/null +++ b/node_modules/eslint/lib/rules/index.js @@ -0,0 +1,305 @@ +/** + * @fileoverview Collects the built-in rules into a map structure so that they can be imported all at once and without + * using the file-system directly. + * @author Peter (Somogyvari) Metz + */ + +"use strict"; + +/* eslint sort-keys: ["error", "asc"] -- More readable for long list */ + +const { LazyLoadingRuleMap } = require("./utils/lazy-loading-rule-map"); + +/** @type {Map} */ +module.exports = new LazyLoadingRuleMap(Object.entries({ + "accessor-pairs": () => require("./accessor-pairs"), + "array-bracket-newline": () => require("./array-bracket-newline"), + "array-bracket-spacing": () => require("./array-bracket-spacing"), + "array-callback-return": () => require("./array-callback-return"), + "array-element-newline": () => require("./array-element-newline"), + "arrow-body-style": () => require("./arrow-body-style"), + "arrow-parens": () => require("./arrow-parens"), + "arrow-spacing": () => require("./arrow-spacing"), + "block-scoped-var": () => require("./block-scoped-var"), + "block-spacing": () => require("./block-spacing"), + "brace-style": () => require("./brace-style"), + "callback-return": () => require("./callback-return"), + camelcase: () => require("./camelcase"), + "capitalized-comments": () => require("./capitalized-comments"), + "class-methods-use-this": () => require("./class-methods-use-this"), + "comma-dangle": () => require("./comma-dangle"), + "comma-spacing": () => require("./comma-spacing"), + "comma-style": () => require("./comma-style"), + complexity: () => require("./complexity"), + "computed-property-spacing": () => require("./computed-property-spacing"), + "consistent-return": () => require("./consistent-return"), + "consistent-this": () => require("./consistent-this"), + "constructor-super": () => require("./constructor-super"), + curly: () => require("./curly"), + "default-case": () => require("./default-case"), + "default-case-last": () => require("./default-case-last"), + "default-param-last": () => require("./default-param-last"), + "dot-location": () => require("./dot-location"), + "dot-notation": () => require("./dot-notation"), + "eol-last": () => require("./eol-last"), + eqeqeq: () => require("./eqeqeq"), + "for-direction": () => require("./for-direction"), + "func-call-spacing": () => require("./func-call-spacing"), + "func-name-matching": () => require("./func-name-matching"), + "func-names": () => require("./func-names"), + "func-style": () => require("./func-style"), + "function-call-argument-newline": () => require("./function-call-argument-newline"), + "function-paren-newline": () => require("./function-paren-newline"), + "generator-star-spacing": () => require("./generator-star-spacing"), + "getter-return": () => require("./getter-return"), + "global-require": () => require("./global-require"), + "grouped-accessor-pairs": () => require("./grouped-accessor-pairs"), + "guard-for-in": () => require("./guard-for-in"), + "handle-callback-err": () => require("./handle-callback-err"), + "id-blacklist": () => require("./id-blacklist"), + "id-denylist": () => require("./id-denylist"), + "id-length": () => require("./id-length"), + "id-match": () => require("./id-match"), + "implicit-arrow-linebreak": () => require("./implicit-arrow-linebreak"), + indent: () => require("./indent"), + "indent-legacy": () => require("./indent-legacy"), + "init-declarations": () => require("./init-declarations"), + "jsx-quotes": () => require("./jsx-quotes"), + "key-spacing": () => require("./key-spacing"), + "keyword-spacing": () => require("./keyword-spacing"), + "line-comment-position": () => require("./line-comment-position"), + "linebreak-style": () => require("./linebreak-style"), + "lines-around-comment": () => require("./lines-around-comment"), + "lines-around-directive": () => require("./lines-around-directive"), + "lines-between-class-members": () => require("./lines-between-class-members"), + "logical-assignment-operators": () => require("./logical-assignment-operators"), + "max-classes-per-file": () => require("./max-classes-per-file"), + "max-depth": () => require("./max-depth"), + "max-len": () => require("./max-len"), + "max-lines": () => require("./max-lines"), + "max-lines-per-function": () => require("./max-lines-per-function"), + "max-nested-callbacks": () => require("./max-nested-callbacks"), + "max-params": () => require("./max-params"), + "max-statements": () => require("./max-statements"), + "max-statements-per-line": () => require("./max-statements-per-line"), + "multiline-comment-style": () => require("./multiline-comment-style"), + "multiline-ternary": () => require("./multiline-ternary"), + "new-cap": () => require("./new-cap"), + "new-parens": () => require("./new-parens"), + "newline-after-var": () => require("./newline-after-var"), + "newline-before-return": () => require("./newline-before-return"), + "newline-per-chained-call": () => require("./newline-per-chained-call"), + "no-alert": () => require("./no-alert"), + "no-array-constructor": () => require("./no-array-constructor"), + "no-async-promise-executor": () => require("./no-async-promise-executor"), + "no-await-in-loop": () => require("./no-await-in-loop"), + "no-bitwise": () => require("./no-bitwise"), + "no-buffer-constructor": () => require("./no-buffer-constructor"), + "no-caller": () => require("./no-caller"), + "no-case-declarations": () => require("./no-case-declarations"), + "no-catch-shadow": () => require("./no-catch-shadow"), + "no-class-assign": () => require("./no-class-assign"), + "no-compare-neg-zero": () => require("./no-compare-neg-zero"), + "no-cond-assign": () => require("./no-cond-assign"), + "no-confusing-arrow": () => require("./no-confusing-arrow"), + "no-console": () => require("./no-console"), + "no-const-assign": () => require("./no-const-assign"), + "no-constant-binary-expression": () => require("./no-constant-binary-expression"), + "no-constant-condition": () => require("./no-constant-condition"), + "no-constructor-return": () => require("./no-constructor-return"), + "no-continue": () => require("./no-continue"), + "no-control-regex": () => require("./no-control-regex"), + "no-debugger": () => require("./no-debugger"), + "no-delete-var": () => require("./no-delete-var"), + "no-div-regex": () => require("./no-div-regex"), + "no-dupe-args": () => require("./no-dupe-args"), + "no-dupe-class-members": () => require("./no-dupe-class-members"), + "no-dupe-else-if": () => require("./no-dupe-else-if"), + "no-dupe-keys": () => require("./no-dupe-keys"), + "no-duplicate-case": () => require("./no-duplicate-case"), + "no-duplicate-imports": () => require("./no-duplicate-imports"), + "no-else-return": () => require("./no-else-return"), + "no-empty": () => require("./no-empty"), + "no-empty-character-class": () => require("./no-empty-character-class"), + "no-empty-function": () => require("./no-empty-function"), + "no-empty-pattern": () => require("./no-empty-pattern"), + "no-empty-static-block": () => require("./no-empty-static-block"), + "no-eq-null": () => require("./no-eq-null"), + "no-eval": () => require("./no-eval"), + "no-ex-assign": () => require("./no-ex-assign"), + "no-extend-native": () => require("./no-extend-native"), + "no-extra-bind": () => require("./no-extra-bind"), + "no-extra-boolean-cast": () => require("./no-extra-boolean-cast"), + "no-extra-label": () => require("./no-extra-label"), + "no-extra-parens": () => require("./no-extra-parens"), + "no-extra-semi": () => require("./no-extra-semi"), + "no-fallthrough": () => require("./no-fallthrough"), + "no-floating-decimal": () => require("./no-floating-decimal"), + "no-func-assign": () => require("./no-func-assign"), + "no-global-assign": () => require("./no-global-assign"), + "no-implicit-coercion": () => require("./no-implicit-coercion"), + "no-implicit-globals": () => require("./no-implicit-globals"), + "no-implied-eval": () => require("./no-implied-eval"), + "no-import-assign": () => require("./no-import-assign"), + "no-inline-comments": () => require("./no-inline-comments"), + "no-inner-declarations": () => require("./no-inner-declarations"), + "no-invalid-regexp": () => require("./no-invalid-regexp"), + "no-invalid-this": () => require("./no-invalid-this"), + "no-irregular-whitespace": () => require("./no-irregular-whitespace"), + "no-iterator": () => require("./no-iterator"), + "no-label-var": () => require("./no-label-var"), + "no-labels": () => require("./no-labels"), + "no-lone-blocks": () => require("./no-lone-blocks"), + "no-lonely-if": () => require("./no-lonely-if"), + "no-loop-func": () => require("./no-loop-func"), + "no-loss-of-precision": () => require("./no-loss-of-precision"), + "no-magic-numbers": () => require("./no-magic-numbers"), + "no-misleading-character-class": () => require("./no-misleading-character-class"), + "no-mixed-operators": () => require("./no-mixed-operators"), + "no-mixed-requires": () => require("./no-mixed-requires"), + "no-mixed-spaces-and-tabs": () => require("./no-mixed-spaces-and-tabs"), + "no-multi-assign": () => require("./no-multi-assign"), + "no-multi-spaces": () => require("./no-multi-spaces"), + "no-multi-str": () => require("./no-multi-str"), + "no-multiple-empty-lines": () => require("./no-multiple-empty-lines"), + "no-native-reassign": () => require("./no-native-reassign"), + "no-negated-condition": () => require("./no-negated-condition"), + "no-negated-in-lhs": () => require("./no-negated-in-lhs"), + "no-nested-ternary": () => require("./no-nested-ternary"), + "no-new": () => require("./no-new"), + "no-new-func": () => require("./no-new-func"), + "no-new-native-nonconstructor": () => require("./no-new-native-nonconstructor"), + "no-new-object": () => require("./no-new-object"), + "no-new-require": () => require("./no-new-require"), + "no-new-symbol": () => require("./no-new-symbol"), + "no-new-wrappers": () => require("./no-new-wrappers"), + "no-nonoctal-decimal-escape": () => require("./no-nonoctal-decimal-escape"), + "no-obj-calls": () => require("./no-obj-calls"), + "no-object-constructor": () => require("./no-object-constructor"), + "no-octal": () => require("./no-octal"), + "no-octal-escape": () => require("./no-octal-escape"), + "no-param-reassign": () => require("./no-param-reassign"), + "no-path-concat": () => require("./no-path-concat"), + "no-plusplus": () => require("./no-plusplus"), + "no-process-env": () => require("./no-process-env"), + "no-process-exit": () => require("./no-process-exit"), + "no-promise-executor-return": () => require("./no-promise-executor-return"), + "no-proto": () => require("./no-proto"), + "no-prototype-builtins": () => require("./no-prototype-builtins"), + "no-redeclare": () => require("./no-redeclare"), + "no-regex-spaces": () => require("./no-regex-spaces"), + "no-restricted-exports": () => require("./no-restricted-exports"), + "no-restricted-globals": () => require("./no-restricted-globals"), + "no-restricted-imports": () => require("./no-restricted-imports"), + "no-restricted-modules": () => require("./no-restricted-modules"), + "no-restricted-properties": () => require("./no-restricted-properties"), + "no-restricted-syntax": () => require("./no-restricted-syntax"), + "no-return-assign": () => require("./no-return-assign"), + "no-return-await": () => require("./no-return-await"), + "no-script-url": () => require("./no-script-url"), + "no-self-assign": () => require("./no-self-assign"), + "no-self-compare": () => require("./no-self-compare"), + "no-sequences": () => require("./no-sequences"), + "no-setter-return": () => require("./no-setter-return"), + "no-shadow": () => require("./no-shadow"), + "no-shadow-restricted-names": () => require("./no-shadow-restricted-names"), + "no-spaced-func": () => require("./no-spaced-func"), + "no-sparse-arrays": () => require("./no-sparse-arrays"), + "no-sync": () => require("./no-sync"), + "no-tabs": () => require("./no-tabs"), + "no-template-curly-in-string": () => require("./no-template-curly-in-string"), + "no-ternary": () => require("./no-ternary"), + "no-this-before-super": () => require("./no-this-before-super"), + "no-throw-literal": () => require("./no-throw-literal"), + "no-trailing-spaces": () => require("./no-trailing-spaces"), + "no-undef": () => require("./no-undef"), + "no-undef-init": () => require("./no-undef-init"), + "no-undefined": () => require("./no-undefined"), + "no-underscore-dangle": () => require("./no-underscore-dangle"), + "no-unexpected-multiline": () => require("./no-unexpected-multiline"), + "no-unmodified-loop-condition": () => require("./no-unmodified-loop-condition"), + "no-unneeded-ternary": () => require("./no-unneeded-ternary"), + "no-unreachable": () => require("./no-unreachable"), + "no-unreachable-loop": () => require("./no-unreachable-loop"), + "no-unsafe-finally": () => require("./no-unsafe-finally"), + "no-unsafe-negation": () => require("./no-unsafe-negation"), + "no-unsafe-optional-chaining": () => require("./no-unsafe-optional-chaining"), + "no-unused-expressions": () => require("./no-unused-expressions"), + "no-unused-labels": () => require("./no-unused-labels"), + "no-unused-private-class-members": () => require("./no-unused-private-class-members"), + "no-unused-vars": () => require("./no-unused-vars"), + "no-use-before-define": () => require("./no-use-before-define"), + "no-useless-assignment": () => require("./no-useless-assignment"), + "no-useless-backreference": () => require("./no-useless-backreference"), + "no-useless-call": () => require("./no-useless-call"), + "no-useless-catch": () => require("./no-useless-catch"), + "no-useless-computed-key": () => require("./no-useless-computed-key"), + "no-useless-concat": () => require("./no-useless-concat"), + "no-useless-constructor": () => require("./no-useless-constructor"), + "no-useless-escape": () => require("./no-useless-escape"), + "no-useless-rename": () => require("./no-useless-rename"), + "no-useless-return": () => require("./no-useless-return"), + "no-var": () => require("./no-var"), + "no-void": () => require("./no-void"), + "no-warning-comments": () => require("./no-warning-comments"), + "no-whitespace-before-property": () => require("./no-whitespace-before-property"), + "no-with": () => require("./no-with"), + "nonblock-statement-body-position": () => require("./nonblock-statement-body-position"), + "object-curly-newline": () => require("./object-curly-newline"), + "object-curly-spacing": () => require("./object-curly-spacing"), + "object-property-newline": () => require("./object-property-newline"), + "object-shorthand": () => require("./object-shorthand"), + "one-var": () => require("./one-var"), + "one-var-declaration-per-line": () => require("./one-var-declaration-per-line"), + "operator-assignment": () => require("./operator-assignment"), + "operator-linebreak": () => require("./operator-linebreak"), + "padded-blocks": () => require("./padded-blocks"), + "padding-line-between-statements": () => require("./padding-line-between-statements"), + "prefer-arrow-callback": () => require("./prefer-arrow-callback"), + "prefer-const": () => require("./prefer-const"), + "prefer-destructuring": () => require("./prefer-destructuring"), + "prefer-exponentiation-operator": () => require("./prefer-exponentiation-operator"), + "prefer-named-capture-group": () => require("./prefer-named-capture-group"), + "prefer-numeric-literals": () => require("./prefer-numeric-literals"), + "prefer-object-has-own": () => require("./prefer-object-has-own"), + "prefer-object-spread": () => require("./prefer-object-spread"), + "prefer-promise-reject-errors": () => require("./prefer-promise-reject-errors"), + "prefer-reflect": () => require("./prefer-reflect"), + "prefer-regex-literals": () => require("./prefer-regex-literals"), + "prefer-rest-params": () => require("./prefer-rest-params"), + "prefer-spread": () => require("./prefer-spread"), + "prefer-template": () => require("./prefer-template"), + "quote-props": () => require("./quote-props"), + quotes: () => require("./quotes"), + radix: () => require("./radix"), + "require-atomic-updates": () => require("./require-atomic-updates"), + "require-await": () => require("./require-await"), + "require-unicode-regexp": () => require("./require-unicode-regexp"), + "require-yield": () => require("./require-yield"), + "rest-spread-spacing": () => require("./rest-spread-spacing"), + semi: () => require("./semi"), + "semi-spacing": () => require("./semi-spacing"), + "semi-style": () => require("./semi-style"), + "sort-imports": () => require("./sort-imports"), + "sort-keys": () => require("./sort-keys"), + "sort-vars": () => require("./sort-vars"), + "space-before-blocks": () => require("./space-before-blocks"), + "space-before-function-paren": () => require("./space-before-function-paren"), + "space-in-parens": () => require("./space-in-parens"), + "space-infix-ops": () => require("./space-infix-ops"), + "space-unary-ops": () => require("./space-unary-ops"), + "spaced-comment": () => require("./spaced-comment"), + strict: () => require("./strict"), + "switch-colon-spacing": () => require("./switch-colon-spacing"), + "symbol-description": () => require("./symbol-description"), + "template-curly-spacing": () => require("./template-curly-spacing"), + "template-tag-spacing": () => require("./template-tag-spacing"), + "unicode-bom": () => require("./unicode-bom"), + "use-isnan": () => require("./use-isnan"), + "valid-typeof": () => require("./valid-typeof"), + "vars-on-top": () => require("./vars-on-top"), + "wrap-iife": () => require("./wrap-iife"), + "wrap-regex": () => require("./wrap-regex"), + "yield-star-spacing": () => require("./yield-star-spacing"), + yoda: () => require("./yoda") +})); diff --git a/node_modules/eslint/lib/rules/init-declarations.js b/node_modules/eslint/lib/rules/init-declarations.js new file mode 100644 index 0000000..6ed83ee --- /dev/null +++ b/node_modules/eslint/lib/rules/init-declarations.js @@ -0,0 +1,140 @@ +/** + * @fileoverview A rule to control the style of variable initializations. + * @author Colin Ihrig + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a for loop. + * @param {ASTNode} block A node to check. + * @returns {boolean} `true` when the node is a for loop. + */ +function isForLoop(block) { + return block.type === "ForInStatement" || + block.type === "ForOfStatement" || + block.type === "ForStatement"; +} + +/** + * Checks whether or not a given declarator node has its initializer. + * @param {ASTNode} node A declarator node to check. + * @returns {boolean} `true` when the node has its initializer. + */ +function isInitialized(node) { + const declaration = node.parent; + const block = declaration.parent; + + if (isForLoop(block)) { + if (block.type === "ForStatement") { + return block.init === declaration; + } + return block.left === declaration; + } + return Boolean(node.init); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require or disallow initialization in variable declarations", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/init-declarations" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["never"] + }, + { + type: "object", + properties: { + ignoreForLoopInit: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + messages: { + initialized: "Variable '{{idName}}' should be initialized on declaration.", + notInitialized: "Variable '{{idName}}' should not be initialized on declaration." + } + }, + + create(context) { + + const MODE_ALWAYS = "always", + MODE_NEVER = "never"; + + const mode = context.options[0] || MODE_ALWAYS; + const params = context.options[1] || {}; + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration:exit"(node) { + + const kind = node.kind, + declarations = node.declarations; + + for (let i = 0; i < declarations.length; ++i) { + const declaration = declarations[i], + id = declaration.id, + initialized = isInitialized(declaration), + isIgnoredForLoop = params.ignoreForLoopInit && isForLoop(node.parent); + let messageId = ""; + + if (mode === MODE_ALWAYS && !initialized) { + messageId = "initialized"; + } else if (mode === MODE_NEVER && kind !== "const" && initialized && !isIgnoredForLoop) { + messageId = "notInitialized"; + } + + if (id.type === "Identifier" && messageId) { + context.report({ + node: declaration, + messageId, + data: { + idName: id.name + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/jsx-quotes.js b/node_modules/eslint/lib/rules/jsx-quotes.js new file mode 100644 index 0000000..c6fd301 --- /dev/null +++ b/node_modules/eslint/lib/rules/jsx-quotes.js @@ -0,0 +1,116 @@ +/** + * @fileoverview A rule to ensure consistent quotes used in jsx syntax. + * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const QUOTE_SETTINGS = { + "prefer-double": { + quote: "\"", + description: "singlequote", + convert(str) { + return str.replace(/'/gu, "\""); + } + }, + "prefer-single": { + quote: "'", + description: "doublequote", + convert(str) { + return str.replace(/"/gu, "'"); + } + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "jsx-quotes", + url: "https://eslint.style/rules/js/jsx-quotes" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce the consistent use of either double or single quotes in JSX attributes", + recommended: false, + url: "https://eslint.org/docs/latest/rules/jsx-quotes" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["prefer-single", "prefer-double"] + } + ], + messages: { + unexpected: "Unexpected usage of {{description}}." + } + }, + + create(context) { + const quoteOption = context.options[0] || "prefer-double", + setting = QUOTE_SETTINGS[quoteOption]; + + /** + * Checks if the given string literal node uses the expected quotes + * @param {ASTNode} node A string literal node. + * @returns {boolean} Whether or not the string literal used the expected quotes. + * @public + */ + function usesExpectedQuotes(node) { + return node.value.includes(setting.quote) || astUtils.isSurroundedBy(node.raw, setting.quote); + } + + return { + JSXAttribute(node) { + const attributeValue = node.value; + + if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) { + context.report({ + node: attributeValue, + messageId: "unexpected", + data: { + description: setting.description + }, + fix(fixer) { + return fixer.replaceText(attributeValue, setting.convert(attributeValue.raw)); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/key-spacing.js b/node_modules/eslint/lib/rules/key-spacing.js new file mode 100644 index 0000000..f43c182 --- /dev/null +++ b/node_modules/eslint/lib/rules/key-spacing.js @@ -0,0 +1,705 @@ +/** + * @fileoverview Rule to specify spacing of object literal keys and values + * @author Brandon Mills + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { getGraphemeCount } = require("../shared/string-utils"); + +/** + * Checks whether a string contains a line terminator as defined in + * http://www.ecma-international.org/ecma-262/5.1/#sec-7.3 + * @param {string} str String to test. + * @returns {boolean} True if str contains a line terminator. + */ +function containsLineTerminator(str) { + return astUtils.LINEBREAK_MATCHER.test(str); +} + +/** + * Gets the last element of an array. + * @param {Array} arr An array. + * @returns {any} Last element of arr. + */ +function last(arr) { + return arr.at(-1); +} + +/** + * Checks whether a node is contained on a single line. + * @param {ASTNode} node AST Node being evaluated. + * @returns {boolean} True if the node is a single line. + */ +function isSingleLine(node) { + return (node.loc.end.line === node.loc.start.line); +} + +/** + * Checks whether the properties on a single line. + * @param {ASTNode[]} properties List of Property AST nodes. + * @returns {boolean} True if all properties is on a single line. + */ +function isSingleLineProperties(properties) { + const [firstProp] = properties, + lastProp = last(properties); + + return firstProp.loc.start.line === lastProp.loc.end.line; +} + +/** + * Initializes a single option property from the configuration with defaults for undefined values + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptionProperty(toOptions, fromOptions) { + toOptions.mode = fromOptions.mode || "strict"; + + // Set value of beforeColon + if (typeof fromOptions.beforeColon !== "undefined") { + toOptions.beforeColon = +fromOptions.beforeColon; + } else { + toOptions.beforeColon = 0; + } + + // Set value of afterColon + if (typeof fromOptions.afterColon !== "undefined") { + toOptions.afterColon = +fromOptions.afterColon; + } else { + toOptions.afterColon = 1; + } + + // Set align if exists + if (typeof fromOptions.align !== "undefined") { + if (typeof fromOptions.align === "object") { + toOptions.align = fromOptions.align; + } else { // "string" + toOptions.align = { + on: fromOptions.align, + mode: toOptions.mode, + beforeColon: toOptions.beforeColon, + afterColon: toOptions.afterColon + }; + } + } + + return toOptions; +} + +/** + * Initializes all the option values (singleLine, multiLine and align) from the configuration with defaults for undefined values + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptions(toOptions, fromOptions) { + if (typeof fromOptions.align === "object") { + + // Initialize the alignment configuration + toOptions.align = initOptionProperty({}, fromOptions.align); + toOptions.align.on = fromOptions.align.on || "colon"; + toOptions.align.mode = fromOptions.align.mode || "strict"; + + toOptions.multiLine = initOptionProperty({}, (fromOptions.multiLine || fromOptions)); + toOptions.singleLine = initOptionProperty({}, (fromOptions.singleLine || fromOptions)); + + } else { // string or undefined + toOptions.multiLine = initOptionProperty({}, (fromOptions.multiLine || fromOptions)); + toOptions.singleLine = initOptionProperty({}, (fromOptions.singleLine || fromOptions)); + + // If alignment options are defined in multiLine, pull them out into the general align configuration + if (toOptions.multiLine.align) { + toOptions.align = { + on: toOptions.multiLine.align.on, + mode: toOptions.multiLine.align.mode || toOptions.multiLine.mode, + beforeColon: toOptions.multiLine.align.beforeColon, + afterColon: toOptions.multiLine.align.afterColon + }; + } + } + + return toOptions; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "key-spacing", + url: "https://eslint.style/rules/js/key-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing between keys and values in object literal properties", + recommended: false, + url: "https://eslint.org/docs/latest/rules/key-spacing" + }, + + fixable: "whitespace", + + schema: [{ + anyOf: [ + { + type: "object", + properties: { + align: { + anyOf: [ + { + enum: ["colon", "value"] + }, + { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + singleLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + multiLine: { + type: "object", + properties: { + align: { + anyOf: [ + { + enum: ["colon", "value"] + }, + { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + singleLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + multiLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + align: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ] + }], + messages: { + extraKey: "Extra space after {{computed}}key '{{key}}'.", + extraValue: "Extra space before value for {{computed}}key '{{key}}'.", + missingKey: "Missing space after {{computed}}key '{{key}}'.", + missingValue: "Missing space before value for {{computed}}key '{{key}}'." + } + }, + + create(context) { + + /** + * OPTIONS + * "key-spacing": [2, { + * beforeColon: false, + * afterColon: true, + * align: "colon" // Optional, or "value" + * } + */ + const options = context.options[0] || {}, + ruleOptions = initOptions({}, options), + multiLineOptions = ruleOptions.multiLine, + singleLineOptions = ruleOptions.singleLine, + alignmentOptions = ruleOptions.align || null; + + const sourceCode = context.sourceCode; + + /** + * Determines if the given property is key-value property. + * @param {ASTNode} property Property node to check. + * @returns {boolean} Whether the property is a key-value property. + */ + function isKeyValueProperty(property) { + return !( + (property.method || + property.shorthand || + property.kind !== "init" || property.type !== "Property") // Could be "ExperimentalSpreadProperty" or "SpreadElement" + ); + } + + /** + * Starting from the given node (a property.key node here) looks forward + * until it finds the colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The colon punctuator. + */ + function getNextColon(node) { + return sourceCode.getTokenAfter(node, astUtils.isColonToken); + } + + /** + * Starting from the given node (a property.key node here) looks forward + * until it finds the last token before a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The last token before a colon punctuator. + */ + function getLastTokenBeforeColon(node) { + const colonToken = getNextColon(node); + + return sourceCode.getTokenBefore(colonToken); + } + + /** + * Starting from the given node (a property.key node here) looks forward + * until it finds the first token after a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The first token after a colon punctuator. + */ + function getFirstTokenAfterColon(node) { + const colonToken = getNextColon(node); + + return sourceCode.getTokenAfter(colonToken); + } + + /** + * Checks whether a property is a member of the property group it follows. + * @param {ASTNode} lastMember The last Property known to be in the group. + * @param {ASTNode} candidate The next Property that might be in the group. + * @returns {boolean} True if the candidate property is part of the group. + */ + function continuesPropertyGroup(lastMember, candidate) { + const groupEndLine = lastMember.loc.start.line, + candidateValueStartLine = (isKeyValueProperty(candidate) ? getFirstTokenAfterColon(candidate.key) : candidate).loc.start.line; + + if (candidateValueStartLine - groupEndLine <= 1) { + return true; + } + + /* + * Check that the first comment is adjacent to the end of the group, the + * last comment is adjacent to the candidate property, and that successive + * comments are adjacent to each other. + */ + const leadingComments = sourceCode.getCommentsBefore(candidate); + + if ( + leadingComments.length && + leadingComments[0].loc.start.line - groupEndLine <= 1 && + candidateValueStartLine - last(leadingComments).loc.end.line <= 1 + ) { + for (let i = 1; i < leadingComments.length; i++) { + if (leadingComments[i].loc.start.line - leadingComments[i - 1].loc.end.line > 1) { + return false; + } + } + return true; + } + + return false; + } + + /** + * Gets an object literal property's key as the identifier name or string value. + * @param {ASTNode} property Property node whose key to retrieve. + * @returns {string} The property's key. + */ + function getKey(property) { + const key = property.key; + + if (property.computed) { + return sourceCode.getText().slice(key.range[0], key.range[1]); + } + return astUtils.getStaticPropertyName(property); + } + + /** + * Reports an appropriately-formatted error if spacing is incorrect on one + * side of the colon. + * @param {ASTNode} property Key-value pair in an object literal. + * @param {string} side Side being verified - either "key" or "value". + * @param {string} whitespace Actual whitespace string. + * @param {int} expected Expected whitespace length. + * @param {string} mode Value of the mode as "strict" or "minimum" + * @returns {void} + */ + function report(property, side, whitespace, expected, mode) { + const diff = whitespace.length - expected; + + if (( + diff && mode === "strict" || + diff < 0 && mode === "minimum" || + diff > 0 && !expected && mode === "minimum") && + !(expected && containsLineTerminator(whitespace)) + ) { + const nextColon = getNextColon(property.key), + tokenBeforeColon = sourceCode.getTokenBefore(nextColon, { includeComments: true }), + tokenAfterColon = sourceCode.getTokenAfter(nextColon, { includeComments: true }), + isKeySide = side === "key", + isExtra = diff > 0, + diffAbs = Math.abs(diff), + spaces = Array(diffAbs + 1).join(" "); + + const locStart = isKeySide ? tokenBeforeColon.loc.end : nextColon.loc.start; + const locEnd = isKeySide ? nextColon.loc.start : tokenAfterColon.loc.start; + const missingLoc = isKeySide ? tokenBeforeColon.loc : tokenAfterColon.loc; + const loc = isExtra ? { start: locStart, end: locEnd } : missingLoc; + + let fix; + + if (isExtra) { + let range; + + // Remove whitespace + if (isKeySide) { + range = [tokenBeforeColon.range[1], tokenBeforeColon.range[1] + diffAbs]; + } else { + range = [tokenAfterColon.range[0] - diffAbs, tokenAfterColon.range[0]]; + } + fix = function(fixer) { + return fixer.removeRange(range); + }; + } else { + + // Add whitespace + if (isKeySide) { + fix = function(fixer) { + return fixer.insertTextAfter(tokenBeforeColon, spaces); + }; + } else { + fix = function(fixer) { + return fixer.insertTextBefore(tokenAfterColon, spaces); + }; + } + } + + let messageId; + + if (isExtra) { + messageId = side === "key" ? "extraKey" : "extraValue"; + } else { + messageId = side === "key" ? "missingKey" : "missingValue"; + } + + context.report({ + node: property[side], + loc, + messageId, + data: { + computed: property.computed ? "computed " : "", + key: getKey(property) + }, + fix + }); + } + } + + /** + * Gets the number of characters in a key, including quotes around string + * keys and braces around computed property keys. + * @param {ASTNode} property Property of on object literal. + * @returns {int} Width of the key. + */ + function getKeyWidth(property) { + const startToken = sourceCode.getFirstToken(property); + const endToken = getLastTokenBeforeColon(property.key); + + return getGraphemeCount(sourceCode.getText().slice(startToken.range[0], endToken.range[1])); + } + + /** + * Gets the whitespace around the colon in an object literal property. + * @param {ASTNode} property Property node from an object literal. + * @returns {Object} Whitespace before and after the property's colon. + */ + function getPropertyWhitespace(property) { + const whitespace = /(\s*):(\s*)/u.exec(sourceCode.getText().slice( + property.key.range[1], property.value.range[0] + )); + + if (whitespace) { + return { + beforeColon: whitespace[1], + afterColon: whitespace[2] + }; + } + return null; + } + + /** + * Creates groups of properties. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {Array} Groups of property AST node lists. + */ + function createGroups(node) { + if (node.properties.length === 1) { + return [node.properties]; + } + + return node.properties.reduce((groups, property) => { + const currentGroup = last(groups), + prev = last(currentGroup); + + if (!prev || continuesPropertyGroup(prev, property)) { + currentGroup.push(property); + } else { + groups.push([property]); + } + + return groups; + }, [ + [] + ]); + } + + /** + * Verifies correct vertical alignment of a group of properties. + * @param {ASTNode[]} properties List of Property AST nodes. + * @returns {void} + */ + function verifyGroupAlignment(properties) { + const length = properties.length, + widths = properties.map(getKeyWidth), // Width of keys, including quotes + align = alignmentOptions.on; // "value" or "colon" + let targetWidth = Math.max(...widths), + beforeColon, afterColon, mode; + + if (alignmentOptions && length > 1) { // When aligning values within a group, use the alignment configuration. + beforeColon = alignmentOptions.beforeColon; + afterColon = alignmentOptions.afterColon; + mode = alignmentOptions.mode; + } else { + beforeColon = multiLineOptions.beforeColon; + afterColon = multiLineOptions.afterColon; + mode = alignmentOptions.mode; + } + + // Conditionally include one space before or after colon + targetWidth += (align === "colon" ? beforeColon : afterColon); + + for (let i = 0; i < length; i++) { + const property = properties[i]; + const whitespace = getPropertyWhitespace(property); + + if (whitespace) { // Object literal getters/setters lack a colon + const width = widths[i]; + + if (align === "value") { + report(property, "key", whitespace.beforeColon, beforeColon, mode); + report(property, "value", whitespace.afterColon, targetWidth - width, mode); + } else { // align = "colon" + report(property, "key", whitespace.beforeColon, targetWidth - width, mode); + report(property, "value", whitespace.afterColon, afterColon, mode); + } + } + } + } + + /** + * Verifies spacing of property conforms to specified options. + * @param {ASTNode} node Property node being evaluated. + * @param {Object} lineOptions Configured singleLine or multiLine options + * @returns {void} + */ + function verifySpacing(node, lineOptions) { + const actual = getPropertyWhitespace(node); + + if (actual) { // Object literal getters/setters lack colons + report(node, "key", actual.beforeColon, lineOptions.beforeColon, lineOptions.mode); + report(node, "value", actual.afterColon, lineOptions.afterColon, lineOptions.mode); + } + } + + /** + * Verifies spacing of each property in a list. + * @param {ASTNode[]} properties List of Property AST nodes. + * @param {Object} lineOptions Configured singleLine or multiLine options + * @returns {void} + */ + function verifyListSpacing(properties, lineOptions) { + const length = properties.length; + + for (let i = 0; i < length; i++) { + verifySpacing(properties[i], lineOptions); + } + } + + /** + * Verifies vertical alignment, taking into account groups of properties. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {void} + */ + function verifyAlignment(node) { + createGroups(node).forEach(group => { + const properties = group.filter(isKeyValueProperty); + + if (properties.length > 0 && isSingleLineProperties(properties)) { + verifyListSpacing(properties, multiLineOptions); + } else { + verifyGroupAlignment(properties); + } + }); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + if (alignmentOptions) { // Verify vertical alignment + + return { + ObjectExpression(node) { + if (isSingleLine(node)) { + verifyListSpacing(node.properties.filter(isKeyValueProperty), singleLineOptions); + } else { + verifyAlignment(node); + } + } + }; + + } + + // Obey beforeColon and afterColon in each property as configured + return { + Property(node) { + verifySpacing(node, isSingleLine(node.parent) ? singleLineOptions : multiLineOptions); + } + }; + + + } +}; diff --git a/node_modules/eslint/lib/rules/keyword-spacing.js b/node_modules/eslint/lib/rules/keyword-spacing.js new file mode 100644 index 0000000..663e1c1 --- /dev/null +++ b/node_modules/eslint/lib/rules/keyword-spacing.js @@ -0,0 +1,658 @@ +/** + * @fileoverview Rule to enforce spacing before and after keywords. + * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const PREV_TOKEN = /^[)\]}>]$/u; +const NEXT_TOKEN = /^(?:[([{<~!]|\+\+?|--?)$/u; +const PREV_TOKEN_M = /^[)\]}>*]$/u; +const NEXT_TOKEN_M = /^[{*]$/u; +const TEMPLATE_OPEN_PAREN = /\$\{$/u; +const TEMPLATE_CLOSE_PAREN = /^\}/u; +const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template|PrivateIdentifier)$/u; +const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of", "set", "yield"]); + +// check duplications. +(function() { + KEYS.sort(); + for (let i = 1; i < KEYS.length; ++i) { + if (KEYS[i] === KEYS[i - 1]) { + throw new Error(`Duplication was found in the keyword list: ${KEYS[i]}`); + } + } +}()); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given token is a "Template" token ends with "${". + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is a "Template" token ends with "${". + */ +function isOpenParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_OPEN_PAREN.test(token.value); +} + +/** + * Checks whether or not a given token is a "Template" token starts with "}". + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is a "Template" token starts with "}". + */ +function isCloseParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_CLOSE_PAREN.test(token.value); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "keyword-spacing", + url: "https://eslint.style/rules/js/keyword-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing before and after keywords", + recommended: false, + url: "https://eslint.org/docs/latest/rules/keyword-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { type: "boolean", default: true }, + after: { type: "boolean", default: true }, + overrides: { + type: "object", + properties: KEYS.reduce((retv, key) => { + retv[key] = { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + }; + return retv; + }, {}), + additionalProperties: false + } + }, + additionalProperties: false + } + ], + messages: { + expectedBefore: "Expected space(s) before \"{{value}}\".", + expectedAfter: "Expected space(s) after \"{{value}}\".", + unexpectedBefore: "Unexpected space(s) before \"{{value}}\".", + unexpectedAfter: "Unexpected space(s) after \"{{value}}\"." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + const tokensToIgnore = new WeakSet(); + + /** + * Reports a given token if there are not space(s) before the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. + * @returns {void} + */ + function expectSpaceBefore(token, pattern) { + const prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + !tokensToIgnore.has(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + !sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: token.loc, + messageId: "expectedBefore", + data: token, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) before the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. + * @returns {void} + */ + function unexpectSpaceBefore(token, pattern) { + const prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + !tokensToIgnore.has(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: { start: prevToken.loc.end, end: token.loc.start }, + messageId: "unexpectedBefore", + data: token, + fix(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + } + + /** + * Reports a given token if there are not space(s) after the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. + * @returns {void} + */ + function expectSpaceAfter(token, pattern) { + const nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + !tokensToIgnore.has(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + !sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + context.report({ + loc: token.loc, + messageId: "expectedAfter", + data: token, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) after the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. + * @returns {void} + */ + function unexpectSpaceAfter(token, pattern) { + const nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + !tokensToIgnore.has(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + + context.report({ + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedAfter", + data: token, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + } + + /** + * Parses the option object and determines check methods for each keyword. + * @param {Object|undefined} options The option object to parse. + * @returns {Object} - Normalized option object. + * Keys are keywords (there are for every keyword). + * Values are instances of `{"before": function, "after": function}`. + */ + function parseOptions(options = {}) { + const before = options.before !== false; + const after = options.after !== false; + const defaultValue = { + before: before ? expectSpaceBefore : unexpectSpaceBefore, + after: after ? expectSpaceAfter : unexpectSpaceAfter + }; + const overrides = (options && options.overrides) || {}; + const retv = Object.create(null); + + for (let i = 0; i < KEYS.length; ++i) { + const key = KEYS[i]; + const override = overrides[key]; + + if (override) { + const thisBefore = ("before" in override) ? override.before : before; + const thisAfter = ("after" in override) ? override.after : after; + + retv[key] = { + before: thisBefore ? expectSpaceBefore : unexpectSpaceBefore, + after: thisAfter ? expectSpaceAfter : unexpectSpaceAfter + }; + } else { + retv[key] = defaultValue; + } + } + + return retv; + } + + const checkMethodMap = parseOptions(context.options[0]); + + /** + * Reports a given token if usage of spacing followed by the token is + * invalid. + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the previous + * token to check. + * @returns {void} + */ + function checkSpacingBefore(token, pattern) { + checkMethodMap[token.value].before(token, pattern || PREV_TOKEN); + } + + /** + * Reports a given token if usage of spacing preceded by the token is + * invalid. + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the next + * token to check. + * @returns {void} + */ + function checkSpacingAfter(token, pattern) { + checkMethodMap[token.value].after(token, pattern || NEXT_TOKEN); + } + + /** + * Reports a given token if usage of spacing around the token is invalid. + * @param {Token} token A token to report. + * @returns {void} + */ + function checkSpacingAround(token) { + checkSpacingBefore(token); + checkSpacingAfter(token); + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing around the token is invalid. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingAroundFirstToken(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingAround(firstToken); + } + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing followed by the token is invalid. + * + * This is used for unary operators (e.g. `typeof`), `function`, and `super`. + * Other rules are handling usage of spacing preceded by those keywords. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingBeforeFirstToken(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports the previous token of a given node if the token is a keyword and + * usage of spacing around the token is invalid. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingAroundTokenBefore(node) { + if (node) { + const token = sourceCode.getTokenBefore(node, astUtils.isKeywordToken); + + checkSpacingAround(token); + } + } + + /** + * Reports `async` or `function` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForFunction(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && + ((firstToken.type === "Keyword" && firstToken.value === "function") || + firstToken.value === "async") + ) { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports `class` and `extends` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForClass(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.superClass); + } + + /** + * Reports `if` and `else` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForIfStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.alternate); + } + + /** + * Reports `try`, `catch`, and `finally` keywords of a given node if usage + * of spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForTryStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundFirstToken(node.handler); + checkSpacingAroundTokenBefore(node.finalizer); + } + + /** + * Reports `do` and `while` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForDoWhileStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.test); + } + + /** + * Reports `for` and `in` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForForInStatement(node) { + checkSpacingAroundFirstToken(node); + + const inToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); + const previousToken = sourceCode.getTokenBefore(inToken); + + if (previousToken.type !== "PrivateIdentifier") { + checkSpacingBefore(inToken); + } + + checkSpacingAfter(inToken); + } + + /** + * Reports `for` and `of` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForForOfStatement(node) { + if (node.await) { + checkSpacingBefore(sourceCode.getFirstToken(node, 0)); + checkSpacingAfter(sourceCode.getFirstToken(node, 1)); + } else { + checkSpacingAroundFirstToken(node); + } + + const ofToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); + const previousToken = sourceCode.getTokenBefore(ofToken); + + if (previousToken.type !== "PrivateIdentifier") { + checkSpacingBefore(ofToken); + } + + checkSpacingAfter(ofToken); + } + + /** + * Reports `import`, `export`, `as`, and `from` keywords of a given node if + * usage of spacing around those keywords is invalid. + * + * This rule handles the `*` token in module declarations. + * + * import*as A from "./a"; /*error Expected space(s) after "import". + * error Expected space(s) before "as". + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForModuleDeclaration(node) { + const firstToken = sourceCode.getFirstToken(node); + + checkSpacingBefore(firstToken, PREV_TOKEN_M); + checkSpacingAfter(firstToken, NEXT_TOKEN_M); + + if (node.type === "ExportDefaultDeclaration") { + checkSpacingAround(sourceCode.getTokenAfter(firstToken)); + } + + if (node.type === "ExportAllDeclaration" && node.exported) { + const asToken = sourceCode.getTokenBefore(node.exported); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + checkSpacingAfter(asToken, NEXT_TOKEN_M); + } + + if (node.source) { + const fromToken = sourceCode.getTokenBefore(node.source); + + checkSpacingBefore(fromToken, PREV_TOKEN_M); + checkSpacingAfter(fromToken, NEXT_TOKEN_M); + } + } + + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * @param {ASTNode} node An `ImportSpecifier` node to check. + * @returns {void} + */ + function checkSpacingForImportSpecifier(node) { + if (node.imported.range[0] !== node.local.range[0]) { + const asToken = sourceCode.getTokenBefore(node.local); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + } + + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * @param {ASTNode} node An `ExportSpecifier` node to check. + * @returns {void} + */ + function checkSpacingForExportSpecifier(node) { + if (node.local.range[0] !== node.exported.range[0]) { + const asToken = sourceCode.getTokenBefore(node.exported); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + checkSpacingAfter(asToken, NEXT_TOKEN_M); + } + } + + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForImportNamespaceSpecifier(node) { + const asToken = sourceCode.getFirstToken(node, 1); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + + /** + * Reports `static`, `get`, and `set` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @throws {Error} If unable to find token get, set, or async beside method name. + * @returns {void} + */ + function checkSpacingForProperty(node) { + if (node.static) { + checkSpacingAroundFirstToken(node); + } + if (node.kind === "get" || + node.kind === "set" || + ( + (node.method || node.type === "MethodDefinition") && + node.value.async + ) + ) { + const token = sourceCode.getTokenBefore( + node.key, + tok => { + switch (tok.value) { + case "get": + case "set": + case "async": + return true; + default: + return false; + } + } + ); + + if (!token) { + throw new Error("Failed to find token get, set, or async beside method name"); + } + + + checkSpacingAround(token); + } + } + + /** + * Reports `await` keyword of a given node if usage of spacing before + * this keyword is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForAwaitExpression(node) { + checkSpacingBefore(sourceCode.getFirstToken(node)); + } + + return { + + // Statements + DebuggerStatement: checkSpacingAroundFirstToken, + WithStatement: checkSpacingAroundFirstToken, + + // Statements - Control flow + BreakStatement: checkSpacingAroundFirstToken, + ContinueStatement: checkSpacingAroundFirstToken, + ReturnStatement: checkSpacingAroundFirstToken, + ThrowStatement: checkSpacingAroundFirstToken, + TryStatement: checkSpacingForTryStatement, + + // Statements - Choice + IfStatement: checkSpacingForIfStatement, + SwitchStatement: checkSpacingAroundFirstToken, + SwitchCase: checkSpacingAroundFirstToken, + + // Statements - Loops + DoWhileStatement: checkSpacingForDoWhileStatement, + ForInStatement: checkSpacingForForInStatement, + ForOfStatement: checkSpacingForForOfStatement, + ForStatement: checkSpacingAroundFirstToken, + WhileStatement: checkSpacingAroundFirstToken, + + // Statements - Declarations + ClassDeclaration: checkSpacingForClass, + ExportNamedDeclaration: checkSpacingForModuleDeclaration, + ExportDefaultDeclaration: checkSpacingForModuleDeclaration, + ExportAllDeclaration: checkSpacingForModuleDeclaration, + FunctionDeclaration: checkSpacingForFunction, + ImportDeclaration: checkSpacingForModuleDeclaration, + VariableDeclaration: checkSpacingAroundFirstToken, + + // Expressions + ArrowFunctionExpression: checkSpacingForFunction, + AwaitExpression: checkSpacingForAwaitExpression, + ClassExpression: checkSpacingForClass, + FunctionExpression: checkSpacingForFunction, + NewExpression: checkSpacingBeforeFirstToken, + Super: checkSpacingBeforeFirstToken, + ThisExpression: checkSpacingBeforeFirstToken, + UnaryExpression: checkSpacingBeforeFirstToken, + YieldExpression: checkSpacingBeforeFirstToken, + + // Others + ImportSpecifier: checkSpacingForImportSpecifier, + ExportSpecifier: checkSpacingForExportSpecifier, + ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier, + MethodDefinition: checkSpacingForProperty, + PropertyDefinition: checkSpacingForProperty, + StaticBlock: checkSpacingAroundFirstToken, + Property: checkSpacingForProperty, + + // To avoid conflicts with `space-infix-ops`, e.g. `a > this.b` + "BinaryExpression[operator='>']"(node) { + const operatorToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); + + tokensToIgnore.add(operatorToken); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/line-comment-position.js b/node_modules/eslint/lib/rules/line-comment-position.js new file mode 100644 index 0000000..0e38341 --- /dev/null +++ b/node_modules/eslint/lib/rules/line-comment-position.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Rule to enforce the position of line comments + * @author Alberto Rodríguez + * @deprecated in ESLint v9.3.0 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "9.3.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "line-comment-position", + url: "https://eslint.style/rules/js/line-comment-position" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce position of line comments", + recommended: false, + url: "https://eslint.org/docs/latest/rules/line-comment-position" + }, + + schema: [ + { + oneOf: [ + { + enum: ["above", "beside"] + }, + { + type: "object", + properties: { + position: { + enum: ["above", "beside"] + }, + ignorePattern: { + type: "string" + }, + applyDefaultPatterns: { + type: "boolean" + }, + applyDefaultIgnorePatterns: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + above: "Expected comment to be above code.", + beside: "Expected comment to be beside code." + } + }, + + create(context) { + const options = context.options[0]; + + let above, + ignorePattern, + applyDefaultIgnorePatterns = true; + + if (!options || typeof options === "string") { + above = !options || options === "above"; + + } else { + above = !options.position || options.position === "above"; + ignorePattern = options.ignorePattern; + + if (Object.hasOwn(options, "applyDefaultIgnorePatterns")) { + applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns; + } else { + applyDefaultIgnorePatterns = options.applyDefaultPatterns !== false; + } + } + + const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; + const fallThroughRegExp = /^\s*falls?\s?through/u; + const customIgnoreRegExp = new RegExp(ignorePattern, "u"); + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type === "Line").forEach(node => { + if (applyDefaultIgnorePatterns && (defaultIgnoreRegExp.test(node.value) || fallThroughRegExp.test(node.value))) { + return; + } + + if (ignorePattern && customIgnoreRegExp.test(node.value)) { + return; + } + + const previous = sourceCode.getTokenBefore(node, { includeComments: true }); + const isOnSameLine = previous && previous.loc.end.line === node.loc.start.line; + + if (above) { + if (isOnSameLine) { + context.report({ + node, + messageId: "above" + }); + } + } else { + if (!isOnSameLine) { + context.report({ + node, + messageId: "beside" + }); + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/linebreak-style.js b/node_modules/eslint/lib/rules/linebreak-style.js new file mode 100644 index 0000000..0e8155a --- /dev/null +++ b/node_modules/eslint/lib/rules/linebreak-style.js @@ -0,0 +1,126 @@ +/** + * @fileoverview Rule to enforce a single linebreak style. + * @author Erik Mueller + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "linebreak-style", + url: "https://eslint.style/rules/js/linebreak-style" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent linebreak style", + recommended: false, + url: "https://eslint.org/docs/latest/rules/linebreak-style" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["unix", "windows"] + } + ], + messages: { + expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.", + expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Builds a fix function that replaces text at the specified range in the source text. + * @param {int[]} range The range to replace + * @param {string} text The text to insert. + * @returns {Function} Fixer function + * @private + */ + function createFix(range, text) { + return function(fixer) { + return fixer.replaceTextRange(range, text); + }; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkForLinebreakStyle(node) { + const linebreakStyle = context.options[0] || "unix", + expectedLF = linebreakStyle === "unix", + expectedLFChars = expectedLF ? "\n" : "\r\n", + source = sourceCode.getText(), + pattern = astUtils.createGlobalLinebreakMatcher(); + let match; + + let i = 0; + + while ((match = pattern.exec(source)) !== null) { + i++; + if (match[0] === expectedLFChars) { + continue; + } + + const index = match.index; + const range = [index, index + match[0].length]; + + context.report({ + node, + loc: { + start: { + line: i, + column: sourceCode.lines[i - 1].length + }, + end: { + line: i + 1, + column: 0 + } + }, + messageId: expectedLF ? "expectedLF" : "expectedCRLF", + fix: createFix(range, expectedLFChars) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-around-comment.js b/node_modules/eslint/lib/rules/lines-around-comment.js new file mode 100644 index 0000000..2906e99 --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-around-comment.js @@ -0,0 +1,489 @@ +/** + * @fileoverview Enforces empty lines around comments. + * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Return an array with any line numbers that are empty. + * @param {Array} lines An array of each line of the file. + * @returns {Array} An array of line numbers. + */ +function getEmptyLineNums(lines) { + const emptyLines = lines.map((line, i) => ({ + code: line.trim(), + num: i + 1 + })).filter(line => !line.code).map(line => line.num); + + return emptyLines; +} + +/** + * Return an array with any line numbers that contain comments. + * @param {Array} comments An array of comment tokens. + * @returns {Array} An array of line numbers. + */ +function getCommentLineNums(comments) { + const lines = []; + + comments.forEach(token => { + const start = token.loc.start.line; + const end = token.loc.end.line; + + lines.push(start, end); + }); + return lines; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "lines-around-comment", + url: "https://eslint.style/rules/js/lines-around-comment" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require empty lines around comments", + recommended: false, + url: "https://eslint.org/docs/latest/rules/lines-around-comment" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + beforeBlockComment: { + type: "boolean", + default: true + }, + afterBlockComment: { + type: "boolean", + default: false + }, + beforeLineComment: { + type: "boolean", + default: false + }, + afterLineComment: { + type: "boolean", + default: false + }, + allowBlockStart: { + type: "boolean", + default: false + }, + allowBlockEnd: { + type: "boolean", + default: false + }, + allowClassStart: { + type: "boolean" + }, + allowClassEnd: { + type: "boolean" + }, + allowObjectStart: { + type: "boolean" + }, + allowObjectEnd: { + type: "boolean" + }, + allowArrayStart: { + type: "boolean" + }, + allowArrayEnd: { + type: "boolean" + }, + ignorePattern: { + type: "string" + }, + applyDefaultIgnorePatterns: { + type: "boolean" + }, + afterHashbangComment: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + after: "Expected line after comment.", + before: "Expected line before comment." + } + }, + + create(context) { + + const options = Object.assign({}, context.options[0]); + const ignorePattern = options.ignorePattern; + const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; + const customIgnoreRegExp = new RegExp(ignorePattern, "u"); + const applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns !== false; + + options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true; + + const sourceCode = context.sourceCode; + + const lines = sourceCode.lines, + numLines = lines.length + 1, + comments = sourceCode.getAllComments(), + commentLines = getCommentLineNums(comments), + emptyLines = getEmptyLineNums(lines), + commentAndEmptyLines = new Set(commentLines.concat(emptyLines)); + + /** + * Returns whether or not comments are on lines starting with or ending with code + * @param {token} token The comment token to check. + * @returns {boolean} True if the comment is not alone. + */ + function codeAroundComment(token) { + let currentToken = token; + + do { + currentToken = sourceCode.getTokenBefore(currentToken, { includeComments: true }); + } while (currentToken && astUtils.isCommentToken(currentToken)); + + if (currentToken && astUtils.isTokenOnSameLine(currentToken, token)) { + return true; + } + + currentToken = token; + do { + currentToken = sourceCode.getTokenAfter(currentToken, { includeComments: true }); + } while (currentToken && astUtils.isCommentToken(currentToken)); + + if (currentToken && astUtils.isTokenOnSameLine(token, currentToken)) { + return true; + } + + return false; + } + + /** + * Returns whether or not comments are inside a node type or not. + * @param {ASTNode} parent The Comment parent node. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is inside nodeType. + */ + function isParentNodeType(parent, nodeType) { + return parent.type === nodeType || + (parent.body && parent.body.type === nodeType) || + (parent.consequent && parent.consequent.type === nodeType); + } + + /** + * Returns the parent node that contains the given token. + * @param {token} token The token to check. + * @returns {ASTNode|null} The parent node that contains the given token. + */ + function getParentNodeOfToken(token) { + const node = sourceCode.getNodeByRangeIndex(token.range[0]); + + /* + * For the purpose of this rule, the comment token is in a `StaticBlock` node only + * if it's inside the braces of that `StaticBlock` node. + * + * Example where this function returns `null`: + * + * static + * // comment + * { + * } + * + * Example where this function returns `StaticBlock` node: + * + * static + * { + * // comment + * } + * + */ + if (node && node.type === "StaticBlock") { + const openingBrace = sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token + + return token.range[0] >= openingBrace.range[0] + ? node + : null; + } + + return node; + } + + /** + * Returns whether or not comments are at the parent start or not. + * @param {token} token The Comment token. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent start. + */ + function isCommentAtParentStart(token, nodeType) { + const parent = getParentNodeOfToken(token); + + if (parent && isParentNodeType(parent, nodeType)) { + let parentStartNodeOrToken = parent; + + if (parent.type === "StaticBlock") { + parentStartNodeOrToken = sourceCode.getFirstToken(parent, { skip: 1 }); // opening brace of the static block + } else if (parent.type === "SwitchStatement") { + parentStartNodeOrToken = sourceCode.getTokenAfter(parent.discriminant, { + filter: astUtils.isOpeningBraceToken + }); // opening brace of the switch statement + } + + return token.loc.start.line - parentStartNodeOrToken.loc.start.line === 1; + } + + return false; + } + + /** + * Returns whether or not comments are at the parent end or not. + * @param {token} token The Comment token. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent end. + */ + function isCommentAtParentEnd(token, nodeType) { + const parent = getParentNodeOfToken(token); + + return !!parent && isParentNodeType(parent, nodeType) && + parent.loc.end.line - token.loc.end.line === 1; + } + + /** + * Returns whether or not comments are at the block start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at block start. + */ + function isCommentAtBlockStart(token) { + return ( + isCommentAtParentStart(token, "ClassBody") || + isCommentAtParentStart(token, "BlockStatement") || + isCommentAtParentStart(token, "StaticBlock") || + isCommentAtParentStart(token, "SwitchCase") || + isCommentAtParentStart(token, "SwitchStatement") + ); + } + + /** + * Returns whether or not comments are at the block end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at block end. + */ + function isCommentAtBlockEnd(token) { + return ( + isCommentAtParentEnd(token, "ClassBody") || + isCommentAtParentEnd(token, "BlockStatement") || + isCommentAtParentEnd(token, "StaticBlock") || + isCommentAtParentEnd(token, "SwitchCase") || + isCommentAtParentEnd(token, "SwitchStatement") + ); + } + + /** + * Returns whether or not comments are at the class start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at class start. + */ + function isCommentAtClassStart(token) { + return isCommentAtParentStart(token, "ClassBody"); + } + + /** + * Returns whether or not comments are at the class end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at class end. + */ + function isCommentAtClassEnd(token) { + return isCommentAtParentEnd(token, "ClassBody"); + } + + /** + * Returns whether or not comments are at the object start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at object start. + */ + function isCommentAtObjectStart(token) { + return isCommentAtParentStart(token, "ObjectExpression") || isCommentAtParentStart(token, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the object end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at object end. + */ + function isCommentAtObjectEnd(token) { + return isCommentAtParentEnd(token, "ObjectExpression") || isCommentAtParentEnd(token, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the array start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at array start. + */ + function isCommentAtArrayStart(token) { + return isCommentAtParentStart(token, "ArrayExpression") || isCommentAtParentStart(token, "ArrayPattern"); + } + + /** + * Returns whether or not comments are at the array end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at array end. + */ + function isCommentAtArrayEnd(token) { + return isCommentAtParentEnd(token, "ArrayExpression") || isCommentAtParentEnd(token, "ArrayPattern"); + } + + /** + * Checks if a comment token has lines around it (ignores inline comments) + * @param {token} token The Comment token. + * @param {Object} opts Options to determine the newline. + * @param {boolean} opts.after Should have a newline after this line. + * @param {boolean} opts.before Should have a newline before this line. + * @returns {void} + */ + function checkForEmptyLine(token, opts) { + if (applyDefaultIgnorePatterns && defaultIgnoreRegExp.test(token.value)) { + return; + } + + if (ignorePattern && customIgnoreRegExp.test(token.value)) { + return; + } + + let after = opts.after, + before = opts.before; + + const prevLineNum = token.loc.start.line - 1, + nextLineNum = token.loc.end.line + 1, + commentIsNotAlone = codeAroundComment(token); + + const blockStartAllowed = options.allowBlockStart && + isCommentAtBlockStart(token) && + !(options.allowClassStart === false && + isCommentAtClassStart(token)), + blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(token) && !(options.allowClassEnd === false && isCommentAtClassEnd(token)), + classStartAllowed = options.allowClassStart && isCommentAtClassStart(token), + classEndAllowed = options.allowClassEnd && isCommentAtClassEnd(token), + objectStartAllowed = options.allowObjectStart && isCommentAtObjectStart(token), + objectEndAllowed = options.allowObjectEnd && isCommentAtObjectEnd(token), + arrayStartAllowed = options.allowArrayStart && isCommentAtArrayStart(token), + arrayEndAllowed = options.allowArrayEnd && isCommentAtArrayEnd(token); + + const exceptionStartAllowed = blockStartAllowed || classStartAllowed || objectStartAllowed || arrayStartAllowed; + const exceptionEndAllowed = blockEndAllowed || classEndAllowed || objectEndAllowed || arrayEndAllowed; + + // ignore top of the file and bottom of the file + if (prevLineNum < 1) { + before = false; + } + if (nextLineNum >= numLines) { + after = false; + } + + // we ignore all inline comments + if (commentIsNotAlone) { + return; + } + + const previousTokenOrComment = sourceCode.getTokenBefore(token, { includeComments: true }); + const nextTokenOrComment = sourceCode.getTokenAfter(token, { includeComments: true }); + + // check for newline before + if (!exceptionStartAllowed && before && !commentAndEmptyLines.has(prevLineNum) && + !(astUtils.isCommentToken(previousTokenOrComment) && astUtils.isTokenOnSameLine(previousTokenOrComment, token))) { + const lineStart = token.range[0] - token.loc.start.column; + const range = [lineStart, lineStart]; + + context.report({ + node: token, + messageId: "before", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\n"); + } + }); + } + + // check for newline after + if (!exceptionEndAllowed && after && !commentAndEmptyLines.has(nextLineNum) && + !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) { + context.report({ + node: token, + messageId: "after", + fix(fixer) { + return fixer.insertTextAfter(token, "\n"); + } + }); + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + comments.forEach(token => { + if (token.type === "Line") { + if (options.beforeLineComment || options.afterLineComment) { + checkForEmptyLine(token, { + after: options.afterLineComment, + before: options.beforeLineComment + }); + } + } else if (token.type === "Block") { + if (options.beforeBlockComment || options.afterBlockComment) { + checkForEmptyLine(token, { + after: options.afterBlockComment, + before: options.beforeBlockComment + }); + } + } else if (token.type === "Shebang") { + if (options.afterHashbangComment) { + checkForEmptyLine(token, { + after: options.afterHashbangComment, + before: false + }); + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-around-directive.js b/node_modules/eslint/lib/rules/lines-around-directive.js new file mode 100644 index 0000000..91040c8 --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-around-directive.js @@ -0,0 +1,219 @@ +/** + * @fileoverview Require or disallow newlines around directives. + * @author Kai Cataldo + * @deprecated in ESLint v4.0.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "Require or disallow newlines around directives", + recommended: false, + url: "https://eslint.org/docs/latest/rules/lines-around-directive" + }, + + schema: [{ + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + before: { + enum: ["always", "never"] + }, + after: { + enum: ["always", "never"] + } + }, + additionalProperties: false, + minProperties: 2 + } + ] + }], + + fixable: "whitespace", + messages: { + expected: "Expected newline {{location}} \"{{value}}\" directive.", + unexpected: "Unexpected newline {{location}} \"{{value}}\" directive." + }, + deprecated: { + message: "The rule was replaced with a more general rule.", + url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/", + deprecatedSince: "4.0.0", + availableUntil: null, + replacedBy: [ + { + message: "The new rule moved to a plugin.", + url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "padding-line-between-statements", + url: "https://eslint.style/rules/js/padding-line-between-statements" + } + } + ] + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const config = context.options[0] || "always"; + const expectLineBefore = typeof config === "string" ? config : config.before; + const expectLineAfter = typeof config === "string" ? config : config.after; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if node is preceded by a blank newline. + * @param {ASTNode} node Node to check. + * @returns {boolean} Whether or not the passed in node is preceded by a blank newline. + */ + function hasNewlineBefore(node) { + const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true }); + const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0; + + return node.loc.start.line - tokenLineBefore >= 2; + } + + /** + * Gets the last token of a node that is on the same line as the rest of the node. + * This will usually be the last token of the node, but it will be the second-to-last token if the node has a trailing + * semicolon on a different line. + * @param {ASTNode} node A directive node + * @returns {Token} The last token of the node on the line + */ + function getLastTokenOnLine(node) { + const lastToken = sourceCode.getLastToken(node); + const secondToLastToken = sourceCode.getTokenBefore(lastToken); + + return astUtils.isSemicolonToken(lastToken) && lastToken.loc.start.line > secondToLastToken.loc.end.line + ? secondToLastToken + : lastToken; + } + + /** + * Check if node is followed by a blank newline. + * @param {ASTNode} node Node to check. + * @returns {boolean} Whether or not the passed in node is followed by a blank newline. + */ + function hasNewlineAfter(node) { + const lastToken = getLastTokenOnLine(node); + const tokenAfter = sourceCode.getTokenAfter(lastToken, { includeComments: true }); + + return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2; + } + + /** + * Report errors for newlines around directives. + * @param {ASTNode} node Node to check. + * @param {string} location Whether the error was found before or after the directive. + * @param {boolean} expected Whether or not a newline was expected or unexpected. + * @returns {void} + */ + function reportError(node, location, expected) { + context.report({ + node, + messageId: expected ? "expected" : "unexpected", + data: { + value: node.expression.value, + location + }, + fix(fixer) { + const lastToken = getLastTokenOnLine(node); + + if (expected) { + return location === "before" ? fixer.insertTextBefore(node, "\n") : fixer.insertTextAfter(lastToken, "\n"); + } + return fixer.removeRange(location === "before" ? [node.range[0] - 1, node.range[0]] : [lastToken.range[1], lastToken.range[1] + 1]); + } + }); + } + + /** + * Check lines around directives in node + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkDirectives(node) { + const directives = astUtils.getDirectivePrologue(node); + + if (!directives.length) { + return; + } + + const firstDirective = directives[0]; + const leadingComments = sourceCode.getCommentsBefore(firstDirective); + + /* + * Only check before the first directive if it is preceded by a comment or if it is at the top of + * the file and expectLineBefore is set to "never". This is to not force a newline at the top of + * the file if there are no comments as well as for compatibility with padded-blocks. + */ + if (leadingComments.length) { + if (expectLineBefore === "always" && !hasNewlineBefore(firstDirective)) { + reportError(firstDirective, "before", true); + } + + if (expectLineBefore === "never" && hasNewlineBefore(firstDirective)) { + reportError(firstDirective, "before", false); + } + } else if ( + node.type === "Program" && + expectLineBefore === "never" && + !leadingComments.length && + hasNewlineBefore(firstDirective) + ) { + reportError(firstDirective, "before", false); + } + + const lastDirective = directives.at(-1); + const statements = node.type === "Program" ? node.body : node.body.body; + + /* + * Do not check after the last directive if the body only + * contains a directive prologue and isn't followed by a comment to ensure + * this rule behaves well with padded-blocks. + */ + if (lastDirective === statements.at(-1) && !lastDirective.trailingComments) { + return; + } + + if (expectLineAfter === "always" && !hasNewlineAfter(lastDirective)) { + reportError(lastDirective, "after", true); + } + + if (expectLineAfter === "never" && hasNewlineAfter(lastDirective)) { + reportError(lastDirective, "after", false); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: checkDirectives, + FunctionDeclaration: checkDirectives, + FunctionExpression: checkDirectives, + ArrowFunctionExpression: checkDirectives + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-between-class-members.js b/node_modules/eslint/lib/rules/lines-between-class-members.js new file mode 100644 index 0000000..effbe7c --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-between-class-members.js @@ -0,0 +1,287 @@ +/** + * @fileoverview Rule to check empty newline between class members + * @author 薛定谔的猫 + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Types of class members. + * Those have `test` method to check it matches to the given class member. + * @private + */ +const ClassMemberTypes = { + "*": { test: () => true }, + field: { test: node => node.type === "PropertyDefinition" }, + method: { test: node => node.type === "MethodDefinition" } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "lines-between-class-members", + url: "https://eslint.style/rules/js/lines-between-class-members" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow an empty line between class members", + recommended: false, + url: "https://eslint.org/docs/latest/rules/lines-between-class-members" + }, + + fixable: "whitespace", + + schema: [ + { + anyOf: [ + { + type: "object", + properties: { + enforce: { + type: "array", + items: { + type: "object", + properties: { + blankLine: { enum: ["always", "never"] }, + prev: { enum: ["method", "field", "*"] }, + next: { enum: ["method", "field", "*"] } + }, + additionalProperties: false, + required: ["blankLine", "prev", "next"] + }, + minItems: 1 + } + }, + additionalProperties: false, + required: ["enforce"] + }, + { + enum: ["always", "never"] + } + ] + }, + { + type: "object", + properties: { + exceptAfterSingleLine: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + never: "Unexpected blank line between class members.", + always: "Expected blank line between class members." + } + }, + + create(context) { + + const options = []; + + options[0] = context.options[0] || "always"; + options[1] = context.options[1] || { exceptAfterSingleLine: false }; + + const configureList = typeof options[0] === "object" ? options[0].enforce : [{ blankLine: options[0], prev: "*", next: "*" }]; + const sourceCode = context.sourceCode; + + /** + * Gets a pair of tokens that should be used to check lines between two class member nodes. + * + * In most cases, this returns the very last token of the current node and + * the very first token of the next node. + * For example: + * + * class C { + * x = 1; // curLast: `;` nextFirst: `in` + * in = 2 + * } + * + * There is only one exception. If the given node ends with a semicolon, and it looks like + * a semicolon-less style's semicolon - one that is not on the same line as the preceding + * token, but is on the line where the next class member starts - this returns the preceding + * token and the semicolon as boundary tokens. + * For example: + * + * class C { + * x = 1 // curLast: `1` nextFirst: `;` + * ;in = 2 + * } + * When determining the desired layout of the code, we should treat this semicolon as + * a part of the next class member node instead of the one it technically belongs to. + * @param {ASTNode} curNode Current class member node. + * @param {ASTNode} nextNode Next class member node. + * @returns {Token} The actual last token of `node`. + * @private + */ + function getBoundaryTokens(curNode, nextNode) { + const lastToken = sourceCode.getLastToken(curNode); + const prevToken = sourceCode.getTokenBefore(lastToken); + const nextToken = sourceCode.getFirstToken(nextNode); // skip possible lone `;` between nodes + + const isSemicolonLessStyle = ( + astUtils.isSemicolonToken(lastToken) && + !astUtils.isTokenOnSameLine(prevToken, lastToken) && + astUtils.isTokenOnSameLine(lastToken, nextToken) + ); + + return isSemicolonLessStyle + ? { curLast: prevToken, nextFirst: lastToken } + : { curLast: lastToken, nextFirst: nextToken }; + } + + /** + * Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member. + * @param {Token} prevLastToken The last token in the previous member node. + * @param {Token} nextFirstToken The first token in the next member node. + * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens. + * @returns {Token} The last token among the consecutive tokens. + */ + function findLastConsecutiveTokenAfter(prevLastToken, nextFirstToken, maxLine) { + const after = sourceCode.getTokenAfter(prevLastToken, { includeComments: true }); + + if (after !== nextFirstToken && after.loc.start.line - prevLastToken.loc.end.line <= maxLine) { + return findLastConsecutiveTokenAfter(after, nextFirstToken, maxLine); + } + return prevLastToken; + } + + /** + * Return the first token among the consecutive tokens that have no exceed max line difference in between, after the last token in the previous member. + * @param {Token} nextFirstToken The first token in the next member node. + * @param {Token} prevLastToken The last token in the previous member node. + * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens. + * @returns {Token} The first token among the consecutive tokens. + */ + function findFirstConsecutiveTokenBefore(nextFirstToken, prevLastToken, maxLine) { + const before = sourceCode.getTokenBefore(nextFirstToken, { includeComments: true }); + + if (before !== prevLastToken && nextFirstToken.loc.start.line - before.loc.end.line <= maxLine) { + return findFirstConsecutiveTokenBefore(before, prevLastToken, maxLine); + } + return nextFirstToken; + } + + /** + * Checks if there is a token or comment between two tokens. + * @param {Token} before The token before. + * @param {Token} after The token after. + * @returns {boolean} True if there is a token or comment between two tokens. + */ + function hasTokenOrCommentBetween(before, after) { + return sourceCode.getTokensBetween(before, after, { includeComments: true }).length !== 0; + } + + /** + * Checks whether the given node matches the given type. + * @param {ASTNode} node The class member node to check. + * @param {string} type The class member type to check. + * @returns {boolean} `true` if the class member node matched the type. + * @private + */ + function match(node, type) { + return ClassMemberTypes[type].test(node); + } + + /** + * Finds the last matched configuration from the configureList. + * @param {ASTNode} prevNode The previous node to match. + * @param {ASTNode} nextNode The current node to match. + * @returns {string|null} Padding type or `null` if no matches were found. + * @private + */ + function getPaddingType(prevNode, nextNode) { + for (let i = configureList.length - 1; i >= 0; --i) { + const configure = configureList[i]; + const matched = + match(prevNode, configure.prev) && + match(nextNode, configure.next); + + if (matched) { + return configure.blankLine; + } + } + return null; + } + + return { + ClassBody(node) { + const body = node.body; + + for (let i = 0; i < body.length - 1; i++) { + const curFirst = sourceCode.getFirstToken(body[i]); + const { curLast, nextFirst } = getBoundaryTokens(body[i], body[i + 1]); + const isMulti = !astUtils.isTokenOnSameLine(curFirst, curLast); + const skip = !isMulti && options[1].exceptAfterSingleLine; + const beforePadding = findLastConsecutiveTokenAfter(curLast, nextFirst, 1); + const afterPadding = findFirstConsecutiveTokenBefore(nextFirst, curLast, 1); + const isPadded = afterPadding.loc.start.line - beforePadding.loc.end.line > 1; + const hasTokenInPadding = hasTokenOrCommentBetween(beforePadding, afterPadding); + const curLineLastToken = findLastConsecutiveTokenAfter(curLast, nextFirst, 0); + const paddingType = getPaddingType(body[i], body[i + 1]); + + if (paddingType === "never" && isPadded) { + context.report({ + node: body[i + 1], + messageId: "never", + + fix(fixer) { + if (hasTokenInPadding) { + return null; + } + return fixer.replaceTextRange([beforePadding.range[1], afterPadding.range[0]], "\n"); + } + }); + } else if (paddingType === "always" && !skip && !isPadded) { + context.report({ + node: body[i + 1], + messageId: "always", + + fix(fixer) { + if (hasTokenInPadding) { + return null; + } + return fixer.insertTextAfter(curLineLastToken, "\n"); + } + }); + } + + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/logical-assignment-operators.js b/node_modules/eslint/lib/rules/logical-assignment-operators.js new file mode 100644 index 0000000..d2070be --- /dev/null +++ b/node_modules/eslint/lib/rules/logical-assignment-operators.js @@ -0,0 +1,505 @@ +/** + * @fileoverview Rule to replace assignment expressions with logical operator assignment + * @author Daniel Martens + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const baseTypes = new Set(["Identifier", "Super", "ThisExpression"]); + +/** + * Returns true iff either "undefined" or a void expression (eg. "void 0") + * @param {ASTNode} expression Expression to check + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff "undefined" or "void ..." + */ +function isUndefined(expression, scope) { + if (expression.type === "Identifier" && expression.name === "undefined") { + return astUtils.isReferenceToGlobalVariable(scope, expression); + } + + return expression.type === "UnaryExpression" && + expression.operator === "void" && + expression.argument.type === "Literal" && + expression.argument.value === 0; +} + +/** + * Returns true iff the reference is either an identifier or member expression + * @param {ASTNode} expression Expression to check + * @returns {boolean} True for identifiers and member expressions + */ +function isReference(expression) { + return (expression.type === "Identifier" && expression.name !== "undefined") || + expression.type === "MemberExpression"; +} + +/** + * Returns true iff the expression checks for nullish with loose equals. + * Examples: value == null, value == void 0 + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff implicit nullish comparison + */ +function isImplicitNullishComparison(expression, scope) { + if (expression.type !== "BinaryExpression" || expression.operator !== "==") { + return false; + } + + const reference = isReference(expression.left) ? "left" : "right"; + const nullish = reference === "left" ? "right" : "left"; + + return isReference(expression[reference]) && + (astUtils.isNullLiteral(expression[nullish]) || isUndefined(expression[nullish], scope)); +} + +/** + * Condition with two equal comparisons. + * @param {ASTNode} expression Condition + * @returns {boolean} True iff matches ? === ? || ? === ? + */ +function isDoubleComparison(expression) { + return expression.type === "LogicalExpression" && + expression.operator === "||" && + expression.left.type === "BinaryExpression" && + expression.left.operator === "===" && + expression.right.type === "BinaryExpression" && + expression.right.operator === "==="; +} + +/** + * Returns true iff the expression checks for undefined and null. + * Example: value === null || value === undefined + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff explicit nullish comparison + */ +function isExplicitNullishComparison(expression, scope) { + if (!isDoubleComparison(expression)) { + return false; + } + const leftReference = isReference(expression.left.left) ? "left" : "right"; + const leftNullish = leftReference === "left" ? "right" : "left"; + const rightReference = isReference(expression.right.left) ? "left" : "right"; + const rightNullish = rightReference === "left" ? "right" : "left"; + + return astUtils.isSameReference(expression.left[leftReference], expression.right[rightReference]) && + ((astUtils.isNullLiteral(expression.left[leftNullish]) && isUndefined(expression.right[rightNullish], scope)) || + (isUndefined(expression.left[leftNullish], scope) && astUtils.isNullLiteral(expression.right[rightNullish]))); +} + +/** + * Returns true for Boolean(arg) calls + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} Whether the expression is a boolean cast + */ +function isBooleanCast(expression, scope) { + return expression.type === "CallExpression" && + expression.callee.name === "Boolean" && + expression.arguments.length === 1 && + astUtils.isReferenceToGlobalVariable(scope, expression.callee); +} + +/** + * Returns true for: + * truthiness checks: value, Boolean(value), !!value + * falsiness checks: !value, !Boolean(value) + * nullish checks: value == null, value === undefined || value === null + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {?{ reference: ASTNode, operator: '??'|'||'|'&&'}} Null if not a known existence + */ +function getExistence(expression, scope) { + const isNegated = expression.type === "UnaryExpression" && expression.operator === "!"; + const base = isNegated ? expression.argument : expression; + + switch (true) { + case isReference(base): + return { reference: base, operator: isNegated ? "||" : "&&" }; + case base.type === "UnaryExpression" && base.operator === "!" && isReference(base.argument): + return { reference: base.argument, operator: "&&" }; + case isBooleanCast(base, scope) && isReference(base.arguments[0]): + return { reference: base.arguments[0], operator: isNegated ? "||" : "&&" }; + case isImplicitNullishComparison(expression, scope): + return { reference: isReference(expression.left) ? expression.left : expression.right, operator: "??" }; + case isExplicitNullishComparison(expression, scope): + return { reference: isReference(expression.left.left) ? expression.left.left : expression.left.right, operator: "??" }; + default: return null; + } +} + +/** + * Returns true iff the node is inside a with block + * @param {ASTNode} node Node to check + * @returns {boolean} True iff passed node is inside a with block + */ +function isInsideWithBlock(node) { + if (node.type === "Program") { + return false; + } + + return node.parent.type === "WithStatement" && node.parent.body === node ? true : isInsideWithBlock(node.parent); +} + +/** + * Gets the leftmost operand of a consecutive logical expression. + * @param {SourceCode} sourceCode The ESLint source code object + * @param {LogicalExpression} node LogicalExpression + * @returns {Expression} Leftmost operand + */ +function getLeftmostOperand(sourceCode, node) { + let left = node.left; + + while (left.type === "LogicalExpression" && left.operator === node.operator) { + + if (astUtils.isParenthesised(sourceCode, left)) { + + /* + * It should have associativity, + * but ignore it if use parentheses to make the evaluation order clear. + */ + return left; + } + left = left.left; + } + return left; + +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require or disallow logical assignment operator shorthand", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/logical-assignment-operators" + }, + + schema: { + type: "array", + oneOf: [{ + items: [ + { const: "always" }, + { + type: "object", + properties: { + enforceForIfStatements: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, // 0 for allowing passing no options + maxItems: 2 + }, { + items: [{ const: "never" }], + minItems: 1, + maxItems: 1 + }] + }, + fixable: "code", + hasSuggestions: true, + messages: { + assignment: "Assignment (=) can be replaced with operator assignment ({{operator}}).", + useLogicalOperator: "Convert this assignment to use the operator {{ operator }}.", + logical: "Logical expression can be replaced with an assignment ({{ operator }}).", + convertLogical: "Replace this logical expression with an assignment with the operator {{ operator }}.", + if: "'if' statement can be replaced with a logical operator assignment with operator {{ operator }}.", + convertIf: "Replace this 'if' statement with a logical assignment with operator {{ operator }}.", + unexpected: "Unexpected logical operator assignment ({{operator}}) shorthand.", + separate: "Separate the logical assignment into an assignment with a logical operator." + } + }, + + create(context) { + const mode = context.options[0] === "never" ? "never" : "always"; + const checkIf = mode === "always" && context.options.length > 1 && context.options[1].enforceForIfStatements; + const sourceCode = context.sourceCode; + const isStrict = sourceCode.getScope(sourceCode.ast).isStrict; + + /** + * Returns false if the access could be a getter + * @param {ASTNode} node Assignment expression + * @returns {boolean} True iff the fix is safe + */ + function cannotBeGetter(node) { + return node.type === "Identifier" && + (isStrict || !isInsideWithBlock(node)); + } + + /** + * Check whether only a single property is accessed + * @param {ASTNode} node reference + * @returns {boolean} True iff a single property is accessed + */ + function accessesSingleProperty(node) { + if (!isStrict && isInsideWithBlock(node)) { + return node.type === "Identifier"; + } + + return node.type === "MemberExpression" && + baseTypes.has(node.object.type) && + (!node.computed || (node.property.type !== "MemberExpression" && node.property.type !== "ChainExpression")); + } + + /** + * Adds a fixer or suggestion whether on the fix is safe. + * @param {{ messageId: string, node: ASTNode }} descriptor Report descriptor without fix or suggest + * @param {{ messageId: string, fix: Function }} suggestion Adds the fix or the whole suggestion as only element in "suggest" to suggestion + * @param {boolean} shouldBeFixed Fix iff the condition is true + * @returns {Object} Descriptor with either an added fix or suggestion + */ + function createConditionalFixer(descriptor, suggestion, shouldBeFixed) { + if (shouldBeFixed) { + return { + ...descriptor, + fix: suggestion.fix + }; + } + + return { + ...descriptor, + suggest: [suggestion] + }; + } + + + /** + * Returns the operator token for assignments and binary expressions + * @param {ASTNode} node AssignmentExpression or BinaryExpression + * @returns {import('eslint').AST.Token} Operator token between the left and right expression + */ + function getOperatorToken(node) { + return sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + } + + if (mode === "never") { + return { + + // foo ||= bar + "AssignmentExpression"(assignment) { + if (!astUtils.isLogicalAssignmentOperator(assignment.operator)) { + return; + } + + const descriptor = { + messageId: "unexpected", + node: assignment, + data: { operator: assignment.operator } + }; + const suggestion = { + messageId: "separate", + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(assignment).length > 0) { + return; + } + + const operatorToken = getOperatorToken(assignment); + + // -> foo = bar + yield ruleFixer.replaceText(operatorToken, "="); + + const assignmentText = sourceCode.getText(assignment.left); + const operator = assignment.operator.slice(0, -1); + + // -> foo = foo || bar + yield ruleFixer.insertTextAfter(operatorToken, ` ${assignmentText} ${operator}`); + + const precedence = astUtils.getPrecedence(assignment.right) <= astUtils.getPrecedence({ type: "LogicalExpression", operator }); + + // ?? and || / && cannot be mixed but have same precedence + const mixed = assignment.operator === "??=" && astUtils.isLogicalExpression(assignment.right); + + if (!astUtils.isParenthesised(sourceCode, assignment.right) && (precedence || mixed)) { + + // -> foo = foo || (bar) + yield ruleFixer.insertTextBefore(assignment.right, "("); + yield ruleFixer.insertTextAfter(assignment.right, ")"); + } + } + }; + + context.report(createConditionalFixer(descriptor, suggestion, cannotBeGetter(assignment.left))); + } + }; + } + + return { + + // foo = foo || bar + "AssignmentExpression[operator='='][right.type='LogicalExpression']"(assignment) { + const leftOperand = getLeftmostOperand(sourceCode, assignment.right); + + if (!astUtils.isSameReference(assignment.left, leftOperand) + ) { + return; + } + + const descriptor = { + messageId: "assignment", + node: assignment, + data: { operator: `${assignment.right.operator}=` } + }; + const suggestion = { + messageId: "useLogicalOperator", + data: { operator: `${assignment.right.operator}=` }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(assignment).length > 0) { + return; + } + + // No need for parenthesis around the assignment based on precedence as the precedence stays the same even with changed operator + const assignmentOperatorToken = getOperatorToken(assignment); + + // -> foo ||= foo || bar + yield ruleFixer.insertTextBefore(assignmentOperatorToken, assignment.right.operator); + + // -> foo ||= bar + const logicalOperatorToken = getOperatorToken(leftOperand.parent); + const firstRightOperandToken = sourceCode.getTokenAfter(logicalOperatorToken); + + yield ruleFixer.removeRange([leftOperand.parent.range[0], firstRightOperandToken.range[0]]); + } + }; + + context.report(createConditionalFixer(descriptor, suggestion, cannotBeGetter(assignment.left))); + }, + + // foo || (foo = bar) + 'LogicalExpression[right.type="AssignmentExpression"][right.operator="="]'(logical) { + + // Right side has to be parenthesized, otherwise would be parsed as (foo || foo) = bar which is illegal + if (isReference(logical.left) && astUtils.isSameReference(logical.left, logical.right.left)) { + const descriptor = { + messageId: "logical", + node: logical, + data: { operator: `${logical.operator}=` } + }; + const suggestion = { + messageId: "convertLogical", + data: { operator: `${logical.operator}=` }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(logical).length > 0) { + return; + } + + const parentPrecedence = astUtils.getPrecedence(logical.parent); + const requiresOuterParenthesis = logical.parent.type !== "ExpressionStatement" && ( + parentPrecedence === -1 || + astUtils.getPrecedence({ type: "AssignmentExpression" }) < parentPrecedence + ); + + if (!astUtils.isParenthesised(sourceCode, logical) && requiresOuterParenthesis) { + yield ruleFixer.insertTextBefore(logical, "("); + yield ruleFixer.insertTextAfter(logical, ")"); + } + + // Also removes all opening parenthesis + yield ruleFixer.removeRange([logical.range[0], logical.right.range[0]]); // -> foo = bar) + + // Also removes all ending parenthesis + yield ruleFixer.removeRange([logical.right.range[1], logical.range[1]]); // -> foo = bar + + const operatorToken = getOperatorToken(logical.right); + + yield ruleFixer.insertTextBefore(operatorToken, logical.operator); // -> foo ||= bar + } + }; + const fix = cannotBeGetter(logical.left) || accessesSingleProperty(logical.left); + + context.report(createConditionalFixer(descriptor, suggestion, fix)); + } + }, + + // if (foo) foo = bar + "IfStatement[alternate=null]"(ifNode) { + if (!checkIf) { + return; + } + + const hasBody = ifNode.consequent.type === "BlockStatement"; + + if (hasBody && ifNode.consequent.body.length !== 1) { + return; + } + + const body = hasBody ? ifNode.consequent.body[0] : ifNode.consequent; + const scope = sourceCode.getScope(ifNode); + const existence = getExistence(ifNode.test, scope); + + if ( + body.type === "ExpressionStatement" && + body.expression.type === "AssignmentExpression" && + body.expression.operator === "=" && + existence !== null && + astUtils.isSameReference(existence.reference, body.expression.left) + ) { + const descriptor = { + messageId: "if", + node: ifNode, + data: { operator: `${existence.operator}=` } + }; + const suggestion = { + messageId: "convertIf", + data: { operator: `${existence.operator}=` }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(ifNode).length > 0) { + return; + } + + const firstBodyToken = sourceCode.getFirstToken(body); + const prevToken = sourceCode.getTokenBefore(ifNode); + + if ( + prevToken !== null && + prevToken.value !== ";" && + prevToken.value !== "{" && + firstBodyToken.type !== "Identifier" && + firstBodyToken.type !== "Keyword" + ) { + + // Do not fix if the fixed statement could be part of the previous statement (eg. fn() if (a == null) (a) = b --> fn()(a) ??= b) + return; + } + + + const operatorToken = getOperatorToken(body.expression); + + yield ruleFixer.insertTextBefore(operatorToken, existence.operator); // -> if (foo) foo ||= bar + + yield ruleFixer.removeRange([ifNode.range[0], body.range[0]]); // -> foo ||= bar + + yield ruleFixer.removeRange([body.range[1], ifNode.range[1]]); // -> foo ||= bar, only present if "if" had a body + + const nextToken = sourceCode.getTokenAfter(body.expression); + + if (hasBody && (nextToken !== null && nextToken.value !== ";")) { + yield ruleFixer.insertTextAfter(ifNode, ";"); + } + } + }; + const shouldBeFixed = cannotBeGetter(existence.reference) || + (ifNode.test.type !== "LogicalExpression" && accessesSingleProperty(existence.reference)); + + context.report(createConditionalFixer(descriptor, suggestion, shouldBeFixed)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-classes-per-file.js b/node_modules/eslint/lib/rules/max-classes-per-file.js new file mode 100644 index 0000000..241e060 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-classes-per-file.js @@ -0,0 +1,89 @@ +/** + * @fileoverview Enforce a maximum number of classes per file + * @author James Garbutt + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce a maximum number of classes per file", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-classes-per-file" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 1 + }, + { + type: "object", + properties: { + ignoreExpressions: { + type: "boolean" + }, + max: { + type: "integer", + minimum: 1 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + maximumExceeded: "File has too many classes ({{ classCount }}). Maximum allowed is {{ max }}." + } + }, + create(context) { + const [option = {}] = context.options; + const [ignoreExpressions, max] = typeof option === "number" + ? [false, option || 1] + : [option.ignoreExpressions, option.max || 1]; + + let classCount = 0; + + return { + Program() { + classCount = 0; + }, + "Program:exit"(node) { + if (classCount > max) { + context.report({ + node, + messageId: "maximumExceeded", + data: { + classCount, + max + } + }); + } + }, + "ClassDeclaration"() { + classCount++; + }, + "ClassExpression"() { + if (!ignoreExpressions) { + classCount++; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-depth.js b/node_modules/eslint/lib/rules/max-depth.js new file mode 100644 index 0000000..e92c6b4 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-depth.js @@ -0,0 +1,156 @@ +/** + * @fileoverview A rule to set the maximum depth block can be nested in a function. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce a maximum depth that blocks can be nested", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-depth" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + tooDeeply: "Blocks are nested too deeply ({{depth}}). Maximum allowed is {{maxDepth}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = [], + option = context.options[0]; + let maxDepth = 4; + + if ( + typeof option === "object" && + (Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max")) + ) { + maxDepth = option.maximum || option.max; + } + if (typeof option === "number") { + maxDepth = option; + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push(0); + } + + /** + * When parsing is done then pop out the reference + * @returns {void} + * @private + */ + function endFunction() { + functionStack.pop(); + } + + /** + * Save the block and Evaluate the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function pushBlock(node) { + const len = ++functionStack[functionStack.length - 1]; + + if (len > maxDepth) { + context.report({ node, messageId: "tooDeeply", data: { depth: len, maxDepth } }); + } + } + + /** + * Pop the saved block + * @returns {void} + * @private + */ + function popBlock() { + functionStack[functionStack.length - 1]--; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: startFunction, + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + StaticBlock: startFunction, + + IfStatement(node) { + if (node.parent.type !== "IfStatement") { + pushBlock(node); + } + }, + SwitchStatement: pushBlock, + TryStatement: pushBlock, + DoWhileStatement: pushBlock, + WhileStatement: pushBlock, + WithStatement: pushBlock, + ForStatement: pushBlock, + ForInStatement: pushBlock, + ForOfStatement: pushBlock, + + "IfStatement:exit": popBlock, + "SwitchStatement:exit": popBlock, + "TryStatement:exit": popBlock, + "DoWhileStatement:exit": popBlock, + "WhileStatement:exit": popBlock, + "WithStatement:exit": popBlock, + "ForStatement:exit": popBlock, + "ForInStatement:exit": popBlock, + "ForOfStatement:exit": popBlock, + + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + "StaticBlock:exit": endFunction, + "Program:exit": endFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-len.js b/node_modules/eslint/lib/rules/max-len.js new file mode 100644 index 0000000..80b92b7 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-len.js @@ -0,0 +1,458 @@ +/** + * @fileoverview Rule to check for max length on a line. + * @author Matt DuVall + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const OPTIONS_SCHEMA = { + type: "object", + properties: { + code: { + type: "integer", + minimum: 0 + }, + comments: { + type: "integer", + minimum: 0 + }, + tabWidth: { + type: "integer", + minimum: 0 + }, + ignorePattern: { + type: "string" + }, + ignoreComments: { + type: "boolean" + }, + ignoreStrings: { + type: "boolean" + }, + ignoreUrls: { + type: "boolean" + }, + ignoreTemplateLiterals: { + type: "boolean" + }, + ignoreRegExpLiterals: { + type: "boolean" + }, + ignoreTrailingComments: { + type: "boolean" + } + }, + additionalProperties: false +}; + +const OPTIONS_OR_INTEGER_SCHEMA = { + anyOf: [ + OPTIONS_SCHEMA, + { + type: "integer", + minimum: 0 + } + ] +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "max-len", + url: "https://eslint.style/rules/js/max-len" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce a maximum line length", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-len" + }, + + schema: [ + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_SCHEMA + ], + messages: { + max: "This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.", + maxComment: "This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}." + } + }, + + create(context) { + + /* + * Inspired by http://tools.ietf.org/html/rfc3986#appendix-B, however: + * - They're matching an entire string that we know is a URI + * - We're matching part of a string where we think there *might* be a URL + * - We're only concerned about URLs, as picking out any URI would cause + * too many false positives + * - We don't care about matching the entire URL, any small segment is fine + */ + const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u; + + const sourceCode = context.sourceCode; + + /** + * Computes the length of a line that may contain tabs. The width of each + * tab will be the number of spaces to the next tab stop. + * @param {string} line The line. + * @param {int} tabWidth The width of each tab stop in spaces. + * @returns {int} The computed line length. + * @private + */ + function computeLineLength(line, tabWidth) { + let extraCharacterCount = 0; + + line.replace(/\t/gu, (match, offset) => { + const totalOffset = offset + extraCharacterCount, + previousTabStopOffset = tabWidth ? totalOffset % tabWidth : 0, + spaceCount = tabWidth - previousTabStopOffset; + + extraCharacterCount += spaceCount - 1; // -1 for the replaced tab + }); + return Array.from(line).length + extraCharacterCount; + } + + // The options object must be the last option specified… + const options = Object.assign({}, context.options.at(-1)); + + // …but max code length… + if (typeof context.options[0] === "number") { + options.code = context.options[0]; + } + + // …and tabWidth can be optionally specified directly as integers. + if (typeof context.options[1] === "number") { + options.tabWidth = context.options[1]; + } + + const maxLength = typeof options.code === "number" ? options.code : 80, + tabWidth = typeof options.tabWidth === "number" ? options.tabWidth : 4, + ignoreComments = !!options.ignoreComments, + ignoreStrings = !!options.ignoreStrings, + ignoreTemplateLiterals = !!options.ignoreTemplateLiterals, + ignoreRegExpLiterals = !!options.ignoreRegExpLiterals, + ignoreTrailingComments = !!options.ignoreTrailingComments || !!options.ignoreComments, + ignoreUrls = !!options.ignoreUrls, + maxCommentLength = options.comments; + let ignorePattern = options.ignorePattern || null; + + if (ignorePattern) { + ignorePattern = new RegExp(ignorePattern, "u"); + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tells if a given comment is trailing: it starts on the current line and + * extends to or past the end of the current line. + * @param {string} line The source line we want to check for a trailing comment on + * @param {number} lineNumber The one-indexed line number for line + * @param {ASTNode} comment The comment to inspect + * @returns {boolean} If the comment is trailing on the given line + */ + function isTrailingComment(line, lineNumber, comment) { + return comment && + (comment.loc.start.line === lineNumber && lineNumber <= comment.loc.end.line) && + (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length); + } + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + const start = comment.loc.start, + end = comment.loc.end, + isFirstTokenOnLine = !line.slice(0, comment.loc.start.column).trim(); + + return comment && + (start.line < lineNumber || (start.line === lineNumber && isFirstTokenOnLine)) && + (end.line > lineNumber || (end.line === lineNumber && end.column === line.length)); + } + + /** + * Check if a node is a JSXEmptyExpression contained in a single line JSXExpressionContainer. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is a JSXEmptyExpression contained in a single line JSXExpressionContainer. + */ + function isJSXEmptyExpressionInSingleLineContainer(node) { + if (!node || !node.parent || node.type !== "JSXEmptyExpression" || node.parent.type !== "JSXExpressionContainer") { + return false; + } + + const parent = node.parent; + + return parent.loc.start.line === parent.loc.end.line; + } + + /** + * Gets the line after the comment and any remaining trailing whitespace is + * stripped. + * @param {string} line The source line with a trailing comment + * @param {ASTNode} comment The comment to remove + * @returns {string} Line without comment and trailing whitespace + */ + function stripTrailingComment(line, comment) { + + // loc.column is zero-indexed + return line.slice(0, comment.loc.start.column).replace(/\s+$/u, ""); + } + + /** + * Ensure that an array exists at [key] on `object`, and add `value` to it. + * @param {Object} object the object to mutate + * @param {string} key the object's key + * @param {any} value the value to add + * @returns {void} + * @private + */ + function ensureArrayAndPush(object, key, value) { + if (!Array.isArray(object[key])) { + object[key] = []; + } + object[key].push(value); + } + + /** + * Retrieves an array containing all strings (" or ') in the source code. + * @returns {ASTNode[]} An array of string nodes. + */ + function getAllStrings() { + return sourceCode.ast.tokens.filter(token => (token.type === "String" || + (token.type === "JSXText" && sourceCode.getNodeByRangeIndex(token.range[0] - 1).type === "JSXAttribute"))); + } + + /** + * Retrieves an array containing all template literals in the source code. + * @returns {ASTNode[]} An array of template literal nodes. + */ + function getAllTemplateLiterals() { + return sourceCode.ast.tokens.filter(token => token.type === "Template"); + } + + + /** + * Retrieves an array containing all RegExp literals in the source code. + * @returns {ASTNode[]} An array of RegExp literal nodes. + */ + function getAllRegExpLiterals() { + return sourceCode.ast.tokens.filter(token => token.type === "RegularExpression"); + } + + /** + * + * reduce an array of AST nodes by line number, both start and end. + * @param {ASTNode[]} arr array of AST nodes + * @returns {Object} accululated AST nodes + */ + function groupArrayByLineNumber(arr) { + const obj = {}; + + for (let i = 0; i < arr.length; i++) { + const node = arr[i]; + + for (let j = node.loc.start.line; j <= node.loc.end.line; ++j) { + ensureArrayAndPush(obj, j, node); + } + } + return obj; + } + + /** + * Returns an array of all comments in the source code. + * If the element in the array is a JSXEmptyExpression contained with a single line JSXExpressionContainer, + * the element is changed with JSXExpressionContainer node. + * @returns {ASTNode[]} An array of comment nodes + */ + function getAllComments() { + const comments = []; + + sourceCode.getAllComments() + .forEach(commentNode => { + const containingNode = sourceCode.getNodeByRangeIndex(commentNode.range[0]); + + if (isJSXEmptyExpressionInSingleLineContainer(containingNode)) { + + // push a unique node only + if (comments.at(-1) !== containingNode.parent) { + comments.push(containingNode.parent); + } + } else { + comments.push(commentNode); + } + }); + + return comments; + } + + /** + * Check the program for max length + * @param {ASTNode} node Node to examine + * @returns {void} + * @private + */ + function checkProgramForMaxLength(node) { + + // split (honors line-ending) + const lines = sourceCode.lines, + + // list of comments to ignore + comments = ignoreComments || maxCommentLength || ignoreTrailingComments ? getAllComments() : []; + + // we iterate over comments in parallel with the lines + let commentsIndex = 0; + + const strings = getAllStrings(); + const stringsByLine = groupArrayByLineNumber(strings); + + const templateLiterals = getAllTemplateLiterals(); + const templateLiteralsByLine = groupArrayByLineNumber(templateLiterals); + + const regExpLiterals = getAllRegExpLiterals(); + const regExpLiteralsByLine = groupArrayByLineNumber(regExpLiterals); + + lines.forEach((line, i) => { + + // i is zero-indexed, line numbers are one-indexed + const lineNumber = i + 1; + + /* + * if we're checking comment length; we need to know whether this + * line is a comment + */ + let lineIsComment = false; + let textToMeasure; + + /* + * We can short-circuit the comment checks if we're already out of + * comments to check. + */ + if (commentsIndex < comments.length) { + let comment; + + // iterate over comments until we find one past the current line + do { + comment = comments[++commentsIndex]; + } while (comment && comment.loc.start.line <= lineNumber); + + // and step back by one + comment = comments[--commentsIndex]; + + if (isFullLineComment(line, lineNumber, comment)) { + lineIsComment = true; + textToMeasure = line; + } else if (ignoreTrailingComments && isTrailingComment(line, lineNumber, comment)) { + textToMeasure = stripTrailingComment(line, comment); + + // ignore multiple trailing comments in the same line + let lastIndex = commentsIndex; + + while (isTrailingComment(textToMeasure, lineNumber, comments[--lastIndex])) { + textToMeasure = stripTrailingComment(textToMeasure, comments[lastIndex]); + } + } else { + textToMeasure = line; + } + } else { + textToMeasure = line; + } + if (ignorePattern && ignorePattern.test(textToMeasure) || + ignoreUrls && URL_REGEXP.test(textToMeasure) || + ignoreStrings && stringsByLine[lineNumber] || + ignoreTemplateLiterals && templateLiteralsByLine[lineNumber] || + ignoreRegExpLiterals && regExpLiteralsByLine[lineNumber] + ) { + + // ignore this line + return; + } + + const lineLength = computeLineLength(textToMeasure, tabWidth); + const commentLengthApplies = lineIsComment && maxCommentLength; + + if (lineIsComment && ignoreComments) { + return; + } + + const loc = { + start: { + line: lineNumber, + column: 0 + }, + end: { + line: lineNumber, + column: textToMeasure.length + } + }; + + if (commentLengthApplies) { + if (lineLength > maxCommentLength) { + context.report({ + node, + loc, + messageId: "maxComment", + data: { + lineLength, + maxCommentLength + } + }); + } + } else if (lineLength > maxLength) { + context.report({ + node, + loc, + messageId: "max", + data: { + lineLength, + maxLength + } + }); + } + }); + } + + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: checkProgramForMaxLength + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-lines-per-function.js b/node_modules/eslint/lib/rules/max-lines-per-function.js new file mode 100644 index 0000000..f981922 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-lines-per-function.js @@ -0,0 +1,213 @@ +/** + * @fileoverview A rule to set the maximum number of line of code in a function. + * @author Pete Ward + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const OPTIONS_SCHEMA = { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + skipComments: { + type: "boolean" + }, + skipBlankLines: { + type: "boolean" + }, + IIFEs: { + type: "boolean" + } + }, + additionalProperties: false +}; + +const OPTIONS_OR_INTEGER_SCHEMA = { + oneOf: [ + OPTIONS_SCHEMA, + { + type: "integer", + minimum: 1 + } + ] +}; + +/** + * Given a list of comment nodes, return a map with numeric keys (source code line numbers) and comment token values. + * @param {Array} comments An array of comment nodes. + * @returns {Map} A map with numeric keys (source code line numbers) and comment token values. + */ +function getCommentLineNumbers(comments) { + const map = new Map(); + + comments.forEach(comment => { + for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) { + map.set(i, comment); + } + }); + return map; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce a maximum number of lines of code in a function", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-lines-per-function" + }, + + schema: [ + OPTIONS_OR_INTEGER_SCHEMA + ], + messages: { + exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const lines = sourceCode.lines; + + const option = context.options[0]; + let maxLines = 50; + let skipComments = false; + let skipBlankLines = false; + let IIFEs = false; + + if (typeof option === "object") { + maxLines = typeof option.max === "number" ? option.max : 50; + skipComments = !!option.skipComments; + skipBlankLines = !!option.skipBlankLines; + IIFEs = !!option.IIFEs; + } else if (typeof option === "number") { + maxLines = option; + } + + const commentLineNumbers = getCommentLineNumbers(sourceCode.getAllComments()); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + const start = comment.loc.start, + end = comment.loc.end, + isFirstTokenOnLine = start.line === lineNumber && !line.slice(0, start.column).trim(), + isLastTokenOnLine = end.line === lineNumber && !line.slice(end.column).trim(); + + return comment && + (start.line < lineNumber || isFirstTokenOnLine) && + (end.line > lineNumber || isLastTokenOnLine); + } + + /** + * Identifies is a node is a FunctionExpression which is part of an IIFE + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's an IIFE + */ + function isIIFE(node) { + return (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") && node.parent && node.parent.type === "CallExpression" && node.parent.callee === node; + } + + /** + * Identifies is a node is a FunctionExpression which is embedded within a MethodDefinition or Property + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's a FunctionExpression embedded within a MethodDefinition or Property + */ + function isEmbedded(node) { + if (!node.parent) { + return false; + } + if (node !== node.parent.value) { + return false; + } + if (node.parent.type === "MethodDefinition") { + return true; + } + if (node.parent.type === "Property") { + return node.parent.method === true || node.parent.kind === "get" || node.parent.kind === "set"; + } + return false; + } + + /** + * Count the lines in the function + * @param {ASTNode} funcNode Function AST node + * @returns {void} + * @private + */ + function processFunction(funcNode) { + const node = isEmbedded(funcNode) ? funcNode.parent : funcNode; + + if (!IIFEs && isIIFE(node)) { + return; + } + let lineCount = 0; + + for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) { + const line = lines[i]; + + if (skipComments) { + if (commentLineNumbers.has(i + 1) && isFullLineComment(line, i + 1, commentLineNumbers.get(i + 1))) { + continue; + } + } + + if (skipBlankLines) { + if (line.match(/^\s*$/u)) { + continue; + } + } + + lineCount++; + } + + if (lineCount > maxLines) { + const name = upperCaseFirst(astUtils.getFunctionNameWithKind(funcNode)); + + context.report({ + node, + messageId: "exceed", + data: { name, lineCount, maxLines } + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: processFunction, + FunctionExpression: processFunction, + ArrowFunctionExpression: processFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-lines.js b/node_modules/eslint/lib/rules/max-lines.js new file mode 100644 index 0000000..d821579 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-lines.js @@ -0,0 +1,193 @@ +/** + * @fileoverview enforce a maximum file length + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Creates an array of numbers from `start` up to, but not including, `end` + * @param {number} start The start of the range + * @param {number} end The end of the range + * @returns {number[]} The range of numbers + */ +function range(start, end) { + return [...Array(end - start).keys()].map(x => x + start); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce a maximum number of lines per file", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-lines" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + skipComments: { + type: "boolean" + }, + skipBlankLines: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: + "File has too many lines ({{actual}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + const option = context.options[0]; + let max = 300; + + if ( + typeof option === "object" && + Object.hasOwn(option, "max") + ) { + max = option.max; + } else if (typeof option === "number") { + max = option; + } + + const skipComments = option && option.skipComments; + const skipBlankLines = option && option.skipBlankLines; + + const sourceCode = context.sourceCode; + + /** + * Returns whether or not a token is a comment node type + * @param {Token} token The token to check + * @returns {boolean} True if the token is a comment node + */ + function isCommentNodeType(token) { + return token && (token.type === "Block" || token.type === "Line"); + } + + /** + * Returns the line numbers of a comment that don't have any code on the same line + * @param {Node} comment The comment node to check + * @returns {number[]} The line numbers + */ + function getLinesWithoutCode(comment) { + let start = comment.loc.start.line; + let end = comment.loc.end.line; + + let token; + + token = comment; + do { + token = sourceCode.getTokenBefore(token, { + includeComments: true + }); + } while (isCommentNodeType(token)); + + if (token && astUtils.isTokenOnSameLine(token, comment)) { + start += 1; + } + + token = comment; + do { + token = sourceCode.getTokenAfter(token, { + includeComments: true + }); + } while (isCommentNodeType(token)); + + if (token && astUtils.isTokenOnSameLine(comment, token)) { + end -= 1; + } + + if (start <= end) { + return range(start, end + 1); + } + return []; + } + + return { + "Program:exit"() { + let lines = sourceCode.lines.map((text, i) => ({ + lineNumber: i + 1, + text + })); + + /* + * If file ends with a linebreak, `sourceCode.lines` will have one extra empty line at the end. + * That isn't a real line, so we shouldn't count it. + */ + if (lines.length > 1 && lines.at(-1).text === "") { + lines.pop(); + } + + if (skipBlankLines) { + lines = lines.filter(l => l.text.trim() !== ""); + } + + if (skipComments) { + const comments = sourceCode.getAllComments(); + + const commentLines = new Set(comments.flatMap(getLinesWithoutCode)); + + lines = lines.filter( + l => !commentLines.has(l.lineNumber) + ); + } + + if (lines.length > max) { + const loc = { + start: { + line: lines[max].lineNumber, + column: 0 + }, + end: { + line: sourceCode.lines.length, + column: sourceCode.lines.at(-1).length + } + }; + + context.report({ + loc, + messageId: "exceed", + data: { + max, + actual: lines.length + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-nested-callbacks.js b/node_modules/eslint/lib/rules/max-nested-callbacks.js new file mode 100644 index 0000000..448c0bd --- /dev/null +++ b/node_modules/eslint/lib/rules/max-nested-callbacks.js @@ -0,0 +1,117 @@ +/** + * @fileoverview Rule to enforce a maximum number of nested callbacks. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce a maximum depth that callbacks can be nested", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-nested-callbacks" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Constants + //-------------------------------------------------------------------------- + const option = context.options[0]; + let THRESHOLD = 10; + + if ( + typeof option === "object" && + (Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max")) + ) { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { + THRESHOLD = option; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const callbackStack = []; + + /** + * Checks a given function node for too many callbacks. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkFunction(node) { + const parent = node.parent; + + if (parent.type === "CallExpression") { + callbackStack.push(node); + } + + if (callbackStack.length > THRESHOLD) { + const opts = { num: callbackStack.length, max: THRESHOLD }; + + context.report({ node, messageId: "exceed", data: opts }); + } + } + + /** + * Pops the call stack. + * @returns {void} + * @private + */ + function popStack() { + callbackStack.pop(); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + ArrowFunctionExpression: checkFunction, + "ArrowFunctionExpression:exit": popStack, + + FunctionExpression: checkFunction, + "FunctionExpression:exit": popStack + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-params.js b/node_modules/eslint/lib/rules/max-params.js new file mode 100644 index 0000000..eb043ab --- /dev/null +++ b/node_modules/eslint/lib/rules/max-params.js @@ -0,0 +1,102 @@ +/** + * @fileoverview Rule to flag when a function has too many parameters + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce a maximum number of parameters in function definitions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-params" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const option = context.options[0]; + let numParams = 3; + + if ( + typeof option === "object" && + (Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max")) + ) { + numParams = option.maximum || option.max; + } + if (typeof option === "number") { + numParams = option; + } + + /** + * Checks a function to see if it has too many parameters. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkFunction(node) { + if (node.params.length > numParams) { + context.report({ + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + node, + messageId: "exceed", + data: { + name: upperCaseFirst(astUtils.getFunctionNameWithKind(node)), + count: node.params.length, + max: numParams + } + }); + } + } + + return { + FunctionDeclaration: checkFunction, + ArrowFunctionExpression: checkFunction, + FunctionExpression: checkFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-statements-per-line.js b/node_modules/eslint/lib/rules/max-statements-per-line.js new file mode 100644 index 0000000..ec3961a --- /dev/null +++ b/node_modules/eslint/lib/rules/max-statements-per-line.js @@ -0,0 +1,217 @@ +/** + * @fileoverview Specify the maximum number of statements allowed per line. + * @author Kenneth Williams + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "max-statements-per-line", + url: "https://eslint.style/rules/js/max-statements-per-line" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce a maximum number of statements allowed per line", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-statements-per-line" + }, + + schema: [ + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 1, + default: 1 + } + }, + additionalProperties: false + } + ], + messages: { + exceed: "This line has {{numberOfStatementsOnThisLine}} {{statements}}. Maximum allowed is {{maxStatementsPerLine}}." + } + }, + + create(context) { + + const sourceCode = context.sourceCode, + options = context.options[0] || {}, + maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1; + + let lastStatementLine = 0, + numberOfStatementsOnThisLine = 0, + firstExtraStatement; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const SINGLE_CHILD_ALLOWED = /^(?:(?:DoWhile|For|ForIn|ForOf|If|Labeled|While)Statement|Export(?:Default|Named)Declaration)$/u; + + /** + * Reports with the first extra statement, and clears it. + * @returns {void} + */ + function reportFirstExtraStatementAndClear() { + if (firstExtraStatement) { + context.report({ + node: firstExtraStatement, + messageId: "exceed", + data: { + numberOfStatementsOnThisLine, + maxStatementsPerLine, + statements: numberOfStatementsOnThisLine === 1 ? "statement" : "statements" + } + }); + } + firstExtraStatement = null; + } + + /** + * Gets the actual last token of a given node. + * @param {ASTNode} node A node to get. This is a node except EmptyStatement. + * @returns {Token} The actual last token. + */ + function getActualLastToken(node) { + return sourceCode.getLastToken(node, astUtils.isNotSemicolonToken); + } + + /** + * Addresses a given node. + * It updates the state of this rule, then reports the node if the node violated this rule. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function enterStatement(node) { + const line = node.loc.start.line; + + /* + * Skip to allow non-block statements if this is direct child of control statements. + * `if (a) foo();` is counted as 1. + * But `if (a) foo(); else foo();` should be counted as 2. + */ + if (SINGLE_CHILD_ALLOWED.test(node.parent.type) && + node.parent.alternate !== node + ) { + return; + } + + // Update state. + if (line === lastStatementLine) { + numberOfStatementsOnThisLine += 1; + } else { + reportFirstExtraStatementAndClear(); + numberOfStatementsOnThisLine = 1; + lastStatementLine = line; + } + + // Reports if the node violated this rule. + if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) { + firstExtraStatement = firstExtraStatement || node; + } + } + + /** + * Updates the state of this rule with the end line of leaving node to check with the next statement. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function leaveStatement(node) { + const line = getActualLastToken(node).loc.end.line; + + // Update state. + if (line !== lastStatementLine) { + reportFirstExtraStatementAndClear(); + numberOfStatementsOnThisLine = 1; + lastStatementLine = line; + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + BreakStatement: enterStatement, + ClassDeclaration: enterStatement, + ContinueStatement: enterStatement, + DebuggerStatement: enterStatement, + DoWhileStatement: enterStatement, + ExpressionStatement: enterStatement, + ForInStatement: enterStatement, + ForOfStatement: enterStatement, + ForStatement: enterStatement, + FunctionDeclaration: enterStatement, + IfStatement: enterStatement, + ImportDeclaration: enterStatement, + LabeledStatement: enterStatement, + ReturnStatement: enterStatement, + SwitchStatement: enterStatement, + ThrowStatement: enterStatement, + TryStatement: enterStatement, + VariableDeclaration: enterStatement, + WhileStatement: enterStatement, + WithStatement: enterStatement, + ExportNamedDeclaration: enterStatement, + ExportDefaultDeclaration: enterStatement, + ExportAllDeclaration: enterStatement, + + "BreakStatement:exit": leaveStatement, + "ClassDeclaration:exit": leaveStatement, + "ContinueStatement:exit": leaveStatement, + "DebuggerStatement:exit": leaveStatement, + "DoWhileStatement:exit": leaveStatement, + "ExpressionStatement:exit": leaveStatement, + "ForInStatement:exit": leaveStatement, + "ForOfStatement:exit": leaveStatement, + "ForStatement:exit": leaveStatement, + "FunctionDeclaration:exit": leaveStatement, + "IfStatement:exit": leaveStatement, + "ImportDeclaration:exit": leaveStatement, + "LabeledStatement:exit": leaveStatement, + "ReturnStatement:exit": leaveStatement, + "SwitchStatement:exit": leaveStatement, + "ThrowStatement:exit": leaveStatement, + "TryStatement:exit": leaveStatement, + "VariableDeclaration:exit": leaveStatement, + "WhileStatement:exit": leaveStatement, + "WithStatement:exit": leaveStatement, + "ExportNamedDeclaration:exit": leaveStatement, + "ExportDefaultDeclaration:exit": leaveStatement, + "ExportAllDeclaration:exit": leaveStatement, + "Program:exit": reportFirstExtraStatementAndClear + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-statements.js b/node_modules/eslint/lib/rules/max-statements.js new file mode 100644 index 0000000..96d5ea7 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-statements.js @@ -0,0 +1,184 @@ +/** + * @fileoverview A rule to set the maximum number of statements in a function. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce a maximum number of statements allowed in function blocks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/max-statements" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + }, + { + type: "object", + properties: { + ignoreTopLevelFunctions: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + exceed: "{{name}} has too many statements ({{count}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = [], + option = context.options[0], + ignoreTopLevelFunctions = context.options[1] && context.options[1].ignoreTopLevelFunctions || false, + topLevelFunctions = []; + let maxStatements = 10; + + if ( + typeof option === "object" && + (Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max")) + ) { + maxStatements = option.maximum || option.max; + } else if (typeof option === "number") { + maxStatements = option; + } + + /** + * Reports a node if it has too many statements + * @param {ASTNode} node node to evaluate + * @param {int} count Number of statements in node + * @param {int} max Maximum number of statements allowed + * @returns {void} + * @private + */ + function reportIfTooManyStatements(node, count, max) { + if (count > max) { + const name = upperCaseFirst(astUtils.getFunctionNameWithKind(node)); + + context.report({ + node, + messageId: "exceed", + data: { name, count, max } + }); + } + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push(0); + } + + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function endFunction(node) { + const count = functionStack.pop(); + + /* + * This rule does not apply to class static blocks, but we have to track them so + * that statements in them do not count as statements in the enclosing function. + */ + if (node.type === "StaticBlock") { + return; + } + + if (ignoreTopLevelFunctions && functionStack.length === 0) { + topLevelFunctions.push({ node, count }); + } else { + reportIfTooManyStatements(node, count, maxStatements); + } + } + + /** + * Increment the count of the functions + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function countStatements(node) { + functionStack[functionStack.length - 1] += node.body.length; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + StaticBlock: startFunction, + + BlockStatement: countStatements, + + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + "StaticBlock:exit": endFunction, + + "Program:exit"() { + if (topLevelFunctions.length === 1) { + return; + } + + topLevelFunctions.forEach(element => { + const count = element.count; + const node = element.node; + + reportIfTooManyStatements(node, count, maxStatements); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/multiline-comment-style.js b/node_modules/eslint/lib/rules/multiline-comment-style.js new file mode 100644 index 0000000..e7a1af6 --- /dev/null +++ b/node_modules/eslint/lib/rules/multiline-comment-style.js @@ -0,0 +1,494 @@ +/** + * @fileoverview enforce a particular style for multiline comments + * @author Teddy Katz + * @deprecated in ESLint v9.3.0 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "9.3.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "multiline-comment-style", + url: "https://eslint.style/rules/js/multiline-comment-style" + } + } + ] + }, + type: "suggestion", + docs: { + description: "Enforce a particular style for multiline comments", + recommended: false, + url: "https://eslint.org/docs/latest/rules/multiline-comment-style" + }, + + fixable: "whitespace", + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["starred-block", "bare-block"] + } + ], + additionalItems: false + }, + { + type: "array", + items: [ + { + enum: ["separate-lines"] + }, + { + type: "object", + properties: { + checkJSDoc: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + additionalItems: false + } + ] + }, + messages: { + expectedBlock: "Expected a block comment instead of consecutive line comments.", + expectedBareBlock: "Expected a block comment without padding stars.", + startNewline: "Expected a linebreak after '/*'.", + endNewline: "Expected a linebreak before '*/'.", + missingStar: "Expected a '*' at the start of this line.", + alignment: "Expected this line to be aligned with the start of the comment.", + expectedLines: "Expected multiple line comments instead of a block comment." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const option = context.options[0] || "starred-block"; + const params = context.options[1] || {}; + const checkJSDoc = !!params.checkJSDoc; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks if a comment line is starred. + * @param {string} line A string representing a comment line. + * @returns {boolean} Whether or not the comment line is starred. + */ + function isStarredCommentLine(line) { + return /^\s*\*/u.test(line); + } + + /** + * Checks if a comment group is in starred-block form. + * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment. + * @returns {boolean} Whether or not the comment group is in starred block form. + */ + function isStarredBlockComment([firstComment]) { + if (firstComment.type !== "Block") { + return false; + } + + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + + // The first and last lines can only contain whitespace. + return lines.length > 0 && lines.every((line, i) => (i === 0 || i === lines.length - 1 ? /^\s*$/u : /^\s*\*/u).test(line)); + } + + /** + * Checks if a comment group is in JSDoc form. + * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment. + * @returns {boolean} Whether or not the comment group is in JSDoc form. + */ + function isJSDocComment([firstComment]) { + if (firstComment.type !== "Block") { + return false; + } + + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + + return /^\*\s*$/u.test(lines[0]) && + lines.slice(1, -1).every(line => /^\s* /u.test(line)) && + /^\s*$/u.test(lines.at(-1)); + } + + /** + * Processes a comment group that is currently in separate-line form, calculating the offset for each line. + * @param {Token[]} commentGroup A group of comments containing multiple line comments. + * @returns {string[]} An array of the processed lines. + */ + function processSeparateLineComments(commentGroup) { + const allLinesHaveLeadingSpace = commentGroup + .map(({ value }) => value) + .filter(line => line.trim().length) + .every(line => line.startsWith(" ")); + + return commentGroup.map(({ value }) => (allLinesHaveLeadingSpace ? value.replace(/^ /u, "") : value)); + } + + /** + * Processes a comment group that is currently in starred-block form, calculating the offset for each line. + * @param {Token} comment A single block comment token in starred-block form. + * @returns {string[]} An array of the processed lines. + */ + function processStarredBlockComment(comment) { + const lines = comment.value.split(astUtils.LINEBREAK_MATCHER) + .filter((line, i, linesArr) => !(i === 0 || i === linesArr.length - 1)) + .map(line => line.replace(/^\s*$/u, "")); + const allLinesHaveLeadingSpace = lines + .map(line => line.replace(/\s*\*/u, "")) + .filter(line => line.trim().length) + .every(line => line.startsWith(" ")); + + return lines.map(line => line.replace(allLinesHaveLeadingSpace ? /\s*\* ?/u : /\s*\*/u, "")); + } + + /** + * Processes a comment group that is currently in bare-block form, calculating the offset for each line. + * @param {Token} comment A single block comment token in bare-block form. + * @returns {string[]} An array of the processed lines. + */ + function processBareBlockComment(comment) { + const lines = comment.value.split(astUtils.LINEBREAK_MATCHER).map(line => line.replace(/^\s*$/u, "")); + const leadingWhitespace = `${sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0])} `; + let offset = ""; + + /* + * Calculate the offset of the least indented line and use that as the basis for offsetting all the lines. + * The first line should not be checked because it is inline with the opening block comment delimiter. + */ + for (const [i, line] of lines.entries()) { + if (!line.trim().length || i === 0) { + continue; + } + + const [, lineOffset] = line.match(/^(\s*\*?\s*)/u); + + if (lineOffset.length < leadingWhitespace.length) { + const newOffset = leadingWhitespace.slice(lineOffset.length - leadingWhitespace.length); + + if (newOffset.length > offset.length) { + offset = newOffset; + } + } + } + + return lines.map(line => { + const match = line.match(/^(\s*\*?\s*)(.*)/u); + const [, lineOffset, lineContents] = match; + + if (lineOffset.length > leadingWhitespace.length) { + return `${lineOffset.slice(leadingWhitespace.length - (offset.length + lineOffset.length))}${lineContents}`; + } + + if (lineOffset.length < leadingWhitespace.length) { + return `${lineOffset.slice(leadingWhitespace.length)}${lineContents}`; + } + + return lineContents; + }); + } + + /** + * Gets a list of comment lines in a group, formatting leading whitespace as necessary. + * @param {Token[]} commentGroup A group of comments containing either multiple line comments or a single block comment. + * @returns {string[]} A list of comment lines. + */ + function getCommentLines(commentGroup) { + const [firstComment] = commentGroup; + + if (firstComment.type === "Line") { + return processSeparateLineComments(commentGroup); + } + + if (isStarredBlockComment(commentGroup)) { + return processStarredBlockComment(firstComment); + } + + return processBareBlockComment(firstComment); + } + + /** + * Gets the initial offset (whitespace) from the beginning of a line to a given comment token. + * @param {Token} comment The token to check. + * @returns {string} The offset from the beginning of a line to the token. + */ + function getInitialOffset(comment) { + return sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0]); + } + + /** + * Converts a comment into starred-block form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in starred-block form, excluding start and end markers + */ + function convertToStarredBlock(firstComment, commentLinesList) { + const initialOffset = getInitialOffset(firstComment); + + return `/*\n${commentLinesList.map(line => `${initialOffset} * ${line}`).join("\n")}\n${initialOffset} */`; + } + + /** + * Converts a comment into separate-line form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in separate-line form + */ + function convertToSeparateLines(firstComment, commentLinesList) { + return commentLinesList.map(line => `// ${line}`).join(`\n${getInitialOffset(firstComment)}`); + } + + /** + * Converts a comment into bare-block form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in bare-block form + */ + function convertToBlock(firstComment, commentLinesList) { + return `/* ${commentLinesList.join(`\n${getInitialOffset(firstComment)} `)} */`; + } + + /** + * Each method checks a group of comments to see if it's valid according to the given option. + * @param {Token[]} commentGroup A list of comments that appear together. This will either contain a single + * block comment or multiple line comments. + * @returns {void} + */ + const commentGroupCheckers = { + "starred-block"(commentGroup) { + const [firstComment] = commentGroup; + const commentLines = getCommentLines(commentGroup); + + if (commentLines.some(value => value.includes("*/"))) { + return; + } + + if (commentGroup.length > 1) { + context.report({ + loc: { + start: firstComment.loc.start, + end: commentGroup.at(-1).loc.end + }, + messageId: "expectedBlock", + fix(fixer) { + const range = [firstComment.range[0], commentGroup.at(-1).range[1]]; + + return commentLines.some(value => value.startsWith("/")) + ? null + : fixer.replaceTextRange(range, convertToStarredBlock(firstComment, commentLines)); + } + }); + } else { + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + const expectedLeadingWhitespace = getInitialOffset(firstComment); + const expectedLinePrefix = `${expectedLeadingWhitespace} *`; + + if (!/^\*?\s*$/u.test(lines[0])) { + const start = firstComment.value.startsWith("*") ? firstComment.range[0] + 1 : firstComment.range[0]; + + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "startNewline", + fix: fixer => fixer.insertTextAfterRange([start, start + 2], `\n${expectedLinePrefix}`) + }); + } + + if (!/^\s*$/u.test(lines.at(-1))) { + context.report({ + loc: { + start: { line: firstComment.loc.end.line, column: firstComment.loc.end.column - 2 }, + end: firstComment.loc.end + }, + messageId: "endNewline", + fix: fixer => fixer.replaceTextRange([firstComment.range[1] - 2, firstComment.range[1]], `\n${expectedLinePrefix}/`) + }); + } + + for (let lineNumber = firstComment.loc.start.line + 1; lineNumber <= firstComment.loc.end.line; lineNumber++) { + const lineText = sourceCode.lines[lineNumber - 1]; + const errorType = isStarredCommentLine(lineText) + ? "alignment" + : "missingStar"; + + if (!lineText.startsWith(expectedLinePrefix)) { + context.report({ + loc: { + start: { line: lineNumber, column: 0 }, + end: { line: lineNumber, column: lineText.length } + }, + messageId: errorType, + fix(fixer) { + const lineStartIndex = sourceCode.getIndexFromLoc({ line: lineNumber, column: 0 }); + + if (errorType === "alignment") { + const [, commentTextPrefix = ""] = lineText.match(/^(\s*\*)/u) || []; + const commentTextStartIndex = lineStartIndex + commentTextPrefix.length; + + return fixer.replaceTextRange([lineStartIndex, commentTextStartIndex], expectedLinePrefix); + } + + const [, commentTextPrefix = ""] = lineText.match(/^(\s*)/u) || []; + const commentTextStartIndex = lineStartIndex + commentTextPrefix.length; + let offset; + + for (const [idx, line] of lines.entries()) { + if (!/\S+/u.test(line)) { + continue; + } + + const lineTextToAlignWith = sourceCode.lines[firstComment.loc.start.line - 1 + idx]; + const [, prefix = "", initialOffset = ""] = lineTextToAlignWith.match(/^(\s*(?:\/?\*)?(\s*))/u) || []; + + offset = `${commentTextPrefix.slice(prefix.length)}${initialOffset}`; + + if (/^\s*\//u.test(lineText) && offset.length === 0) { + offset += " "; + } + break; + } + + return fixer.replaceTextRange([lineStartIndex, commentTextStartIndex], `${expectedLinePrefix}${offset}`); + } + }); + } + } + } + }, + "separate-lines"(commentGroup) { + const [firstComment] = commentGroup; + + const isJSDoc = isJSDocComment(commentGroup); + + if (firstComment.type !== "Block" || (!checkJSDoc && isJSDoc)) { + return; + } + + let commentLines = getCommentLines(commentGroup); + + if (isJSDoc) { + commentLines = commentLines.slice(1, commentLines.length - 1); + } + + const tokenAfter = sourceCode.getTokenAfter(firstComment, { includeComments: true }); + + if (tokenAfter && firstComment.loc.end.line === tokenAfter.loc.start.line) { + return; + } + + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "expectedLines", + fix(fixer) { + return fixer.replaceText(firstComment, convertToSeparateLines(firstComment, commentLines)); + } + }); + }, + "bare-block"(commentGroup) { + if (isJSDocComment(commentGroup)) { + return; + } + + const [firstComment] = commentGroup; + const commentLines = getCommentLines(commentGroup); + + // Disallows consecutive line comments in favor of using a block comment. + if (firstComment.type === "Line" && commentLines.length > 1 && + !commentLines.some(value => value.includes("*/"))) { + context.report({ + loc: { + start: firstComment.loc.start, + end: commentGroup.at(-1).loc.end + }, + messageId: "expectedBlock", + fix(fixer) { + return fixer.replaceTextRange( + [firstComment.range[0], commentGroup.at(-1).range[1]], + convertToBlock(firstComment, commentLines) + ); + } + }); + } + + // Prohibits block comments from having a * at the beginning of each line. + if (isStarredBlockComment(commentGroup)) { + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "expectedBareBlock", + fix(fixer) { + return fixer.replaceText(firstComment, convertToBlock(firstComment, commentLines)); + } + }); + } + } + }; + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + Program() { + return sourceCode.getAllComments() + .filter(comment => comment.type !== "Shebang") + .filter(comment => !astUtils.COMMENTS_IGNORE_PATTERN.test(comment.value)) + .filter(comment => { + const tokenBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return !tokenBefore || tokenBefore.loc.end.line < comment.loc.start.line; + }) + .reduce((commentGroups, comment, index, commentList) => { + const tokenBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + if ( + comment.type === "Line" && + index && commentList[index - 1].type === "Line" && + tokenBefore && tokenBefore.loc.end.line === comment.loc.start.line - 1 && + tokenBefore === commentList[index - 1] + ) { + commentGroups.at(-1).push(comment); + } else { + commentGroups.push([comment]); + } + + return commentGroups; + }, []) + .filter(commentGroup => !(commentGroup.length === 1 && commentGroup[0].loc.start.line === commentGroup[0].loc.end.line)) + .forEach(commentGroupCheckers[option]); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/multiline-ternary.js b/node_modules/eslint/lib/rules/multiline-ternary.js new file mode 100644 index 0000000..828b395 --- /dev/null +++ b/node_modules/eslint/lib/rules/multiline-ternary.js @@ -0,0 +1,192 @@ +/** + * @fileoverview Enforce newlines between operands of ternary expressions + * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "multiline-ternary", + url: "https://eslint.style/rules/js/multiline-ternary" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce newlines between operands of ternary expressions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/multiline-ternary" + }, + + schema: [ + { + enum: ["always", "always-multiline", "never"] + } + ], + + messages: { + expectedTestCons: "Expected newline between test and consequent of ternary expression.", + expectedConsAlt: "Expected newline between consequent and alternate of ternary expression.", + unexpectedTestCons: "Unexpected newline between test and consequent of ternary expression.", + unexpectedConsAlt: "Unexpected newline between consequent and alternate of ternary expression." + }, + + fixable: "whitespace" + }, + + create(context) { + const sourceCode = context.sourceCode; + const option = context.options[0]; + const multiline = option !== "never"; + const allowSingleLine = option === "always-multiline"; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ConditionalExpression(node) { + const questionToken = sourceCode.getTokenAfter(node.test, astUtils.isNotClosingParenToken); + const colonToken = sourceCode.getTokenAfter(node.consequent, astUtils.isNotClosingParenToken); + + const firstTokenOfTest = sourceCode.getFirstToken(node); + const lastTokenOfTest = sourceCode.getTokenBefore(questionToken); + const firstTokenOfConsequent = sourceCode.getTokenAfter(questionToken); + const lastTokenOfConsequent = sourceCode.getTokenBefore(colonToken); + const firstTokenOfAlternate = sourceCode.getTokenAfter(colonToken); + + const areTestAndConsequentOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, firstTokenOfConsequent); + const areConsequentAndAlternateOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, firstTokenOfAlternate); + + const hasComments = !!sourceCode.getCommentsInside(node).length; + + if (!multiline) { + if (!areTestAndConsequentOnSameLine) { + context.report({ + node: node.test, + loc: { + start: firstTokenOfTest.loc.start, + end: lastTokenOfTest.loc.end + }, + messageId: "unexpectedTestCons", + fix(fixer) { + if (hasComments) { + return null; + } + const fixers = []; + const areTestAndQuestionOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, questionToken); + const areQuestionAndConsOnSameLine = astUtils.isTokenOnSameLine(questionToken, firstTokenOfConsequent); + + if (!areTestAndQuestionOnSameLine) { + fixers.push(fixer.removeRange([lastTokenOfTest.range[1], questionToken.range[0]])); + } + if (!areQuestionAndConsOnSameLine) { + fixers.push(fixer.removeRange([questionToken.range[1], firstTokenOfConsequent.range[0]])); + } + + return fixers; + } + }); + } + + if (!areConsequentAndAlternateOnSameLine) { + context.report({ + node: node.consequent, + loc: { + start: firstTokenOfConsequent.loc.start, + end: lastTokenOfConsequent.loc.end + }, + messageId: "unexpectedConsAlt", + fix(fixer) { + if (hasComments) { + return null; + } + const fixers = []; + const areConsAndColonOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, colonToken); + const areColonAndAltOnSameLine = astUtils.isTokenOnSameLine(colonToken, firstTokenOfAlternate); + + if (!areConsAndColonOnSameLine) { + fixers.push(fixer.removeRange([lastTokenOfConsequent.range[1], colonToken.range[0]])); + } + if (!areColonAndAltOnSameLine) { + fixers.push(fixer.removeRange([colonToken.range[1], firstTokenOfAlternate.range[0]])); + } + + return fixers; + } + }); + } + } else { + if (allowSingleLine && node.loc.start.line === node.loc.end.line) { + return; + } + + if (areTestAndConsequentOnSameLine) { + context.report({ + node: node.test, + loc: { + start: firstTokenOfTest.loc.start, + end: lastTokenOfTest.loc.end + }, + messageId: "expectedTestCons", + fix: fixer => (hasComments ? null : ( + fixer.replaceTextRange( + [ + lastTokenOfTest.range[1], + questionToken.range[0] + ], + "\n" + ) + )) + }); + } + + if (areConsequentAndAlternateOnSameLine) { + context.report({ + node: node.consequent, + loc: { + start: firstTokenOfConsequent.loc.start, + end: lastTokenOfConsequent.loc.end + }, + messageId: "expectedConsAlt", + fix: (fixer => (hasComments ? null : ( + fixer.replaceTextRange( + [ + lastTokenOfConsequent.range[1], + colonToken.range[0] + ], + "\n" + ) + ))) + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/new-cap.js b/node_modules/eslint/lib/rules/new-cap.js new file mode 100644 index 0000000..c57997a --- /dev/null +++ b/node_modules/eslint/lib/rules/new-cap.js @@ -0,0 +1,257 @@ +/** + * @fileoverview Rule to flag use of constructors without capital letters + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const CAPS_ALLOWED = [ + "Array", + "Boolean", + "Date", + "Error", + "Function", + "Number", + "Object", + "RegExp", + "String", + "Symbol", + "BigInt" +]; + +/** + * A reducer function to invert an array to an Object mapping the string form of the key, to `true`. + * @param {Object} map Accumulator object for the reduce. + * @param {string} key Object key to set to `true`. + * @returns {Object} Returns the updated Object for further reduction. + */ +function invert(map, key) { + map[key] = true; + return map; +} + +/** + * Creates an object with the cap is new exceptions as its keys and true as their values. + * @param {Object} config Rule configuration + * @returns {Object} Object with cap is new exceptions. + */ +function calculateCapIsNewExceptions(config) { + const capIsNewExceptions = Array.from(new Set([...config.capIsNewExceptions, ...CAPS_ALLOWED])); + + return capIsNewExceptions.reduce(invert, {}); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require constructor names to begin with a capital letter", + recommended: false, + url: "https://eslint.org/docs/latest/rules/new-cap" + }, + + schema: [ + { + type: "object", + properties: { + newIsCap: { + type: "boolean" + }, + capIsNew: { + type: "boolean" + }, + newIsCapExceptions: { + type: "array", + items: { + type: "string" + } + }, + newIsCapExceptionPattern: { + type: "string" + }, + capIsNewExceptions: { + type: "array", + items: { + type: "string" + } + }, + capIsNewExceptionPattern: { + type: "string" + }, + properties: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + defaultOptions: [{ + capIsNew: true, + capIsNewExceptions: CAPS_ALLOWED, + newIsCap: true, + newIsCapExceptions: [], + properties: true + }], + + messages: { + upper: "A function with a name starting with an uppercase letter should only be used as a constructor.", + lower: "A constructor name should not start with a lowercase letter." + } + }, + + create(context) { + const [config] = context.options; + const skipProperties = !config.properties; + + const newIsCapExceptions = config.newIsCapExceptions.reduce(invert, {}); + const newIsCapExceptionPattern = config.newIsCapExceptionPattern ? new RegExp(config.newIsCapExceptionPattern, "u") : null; + + const capIsNewExceptions = calculateCapIsNewExceptions(config); + const capIsNewExceptionPattern = config.capIsNewExceptionPattern ? new RegExp(config.capIsNewExceptionPattern, "u") : null; + + const listeners = {}; + + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Get exact callee name from expression + * @param {ASTNode} node CallExpression or NewExpression node + * @returns {string} name + */ + function extractNameFromExpression(node) { + return node.callee.type === "Identifier" + ? node.callee.name + : astUtils.getStaticPropertyName(node.callee) || ""; + } + + /** + * Returns the capitalization state of the string - + * Whether the first character is uppercase, lowercase, or non-alphabetic + * @param {string} str String + * @returns {string} capitalization state: "non-alpha", "lower", or "upper" + */ + function getCap(str) { + const firstChar = str.charAt(0); + + const firstCharLower = firstChar.toLowerCase(); + const firstCharUpper = firstChar.toUpperCase(); + + if (firstCharLower === firstCharUpper) { + + // char has no uppercase variant, so it's non-alphabetic + return "non-alpha"; + } + if (firstChar === firstCharLower) { + return "lower"; + } + return "upper"; + + } + + /** + * Check if capitalization is allowed for a CallExpression + * @param {Object} allowedMap Object mapping calleeName to a Boolean + * @param {ASTNode} node CallExpression node + * @param {string} calleeName Capitalized callee name from a CallExpression + * @param {Object} pattern RegExp object from options pattern + * @returns {boolean} Returns true if the callee may be capitalized + */ + function isCapAllowed(allowedMap, node, calleeName, pattern) { + const sourceText = sourceCode.getText(node.callee); + + if (allowedMap[calleeName] || allowedMap[sourceText]) { + return true; + } + + if (pattern && pattern.test(sourceText)) { + return true; + } + + const callee = astUtils.skipChainExpression(node.callee); + + if (calleeName === "UTC" && callee.type === "MemberExpression") { + + // allow if callee is Date.UTC + return callee.object.type === "Identifier" && + callee.object.name === "Date"; + } + + return skipProperties && callee.type === "MemberExpression"; + } + + /** + * Reports the given messageId for the given node. The location will be the start of the property or the callee. + * @param {ASTNode} node CallExpression or NewExpression node. + * @param {string} messageId The messageId to report. + * @returns {void} + */ + function report(node, messageId) { + let callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "MemberExpression") { + callee = callee.property; + } + + context.report({ node, loc: callee.loc, messageId }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + if (config.newIsCap) { + listeners.NewExpression = function(node) { + + const constructorName = extractNameFromExpression(node); + + if (constructorName) { + const capitalization = getCap(constructorName); + const isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName, newIsCapExceptionPattern); + + if (!isAllowed) { + report(node, "lower"); + } + } + }; + } + + if (config.capIsNew) { + listeners.CallExpression = function(node) { + + const calleeName = extractNameFromExpression(node); + + if (calleeName) { + const capitalization = getCap(calleeName); + const isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName, capIsNewExceptionPattern); + + if (!isAllowed) { + report(node, "upper"); + } + } + }; + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/new-parens.js b/node_modules/eslint/lib/rules/new-parens.js new file mode 100644 index 0000000..062ecf5 --- /dev/null +++ b/node_modules/eslint/lib/rules/new-parens.js @@ -0,0 +1,111 @@ +/** + * @fileoverview Rule to flag when using constructor without parentheses + * @author Ilya Volodin + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "new-parens", + url: "https://eslint.style/rules/js/new-parens" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce or disallow parentheses when invoking a constructor with no arguments", + recommended: false, + url: "https://eslint.org/docs/latest/rules/new-parens" + }, + + fixable: "code", + schema: [ + { + enum: ["always", "never"] + } + ], + messages: { + missing: "Missing '()' invoking a constructor.", + unnecessary: "Unnecessary '()' invoking a constructor with no arguments." + } + }, + + create(context) { + const options = context.options; + const always = options[0] !== "never"; // Default is always + + const sourceCode = context.sourceCode; + + return { + NewExpression(node) { + if (node.arguments.length !== 0) { + return; // if there are arguments, there have to be parens + } + + const lastToken = sourceCode.getLastToken(node); + const hasLastParen = lastToken && astUtils.isClosingParenToken(lastToken); + + // `hasParens` is true only if the new expression ends with its own parens, e.g., new new foo() does not end with its own parens + const hasParens = hasLastParen && + astUtils.isOpeningParenToken(sourceCode.getTokenBefore(lastToken)) && + node.callee.range[1] < node.range[1]; + + if (always) { + if (!hasParens) { + context.report({ + node, + messageId: "missing", + fix: fixer => fixer.insertTextAfter(node, "()") + }); + } + } else { + if (hasParens) { + context.report({ + node, + messageId: "unnecessary", + fix: fixer => [ + fixer.remove(sourceCode.getTokenBefore(lastToken)), + fixer.remove(lastToken), + fixer.insertTextBefore(node, "("), + fixer.insertTextAfter(node, ")") + ] + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/newline-after-var.js b/node_modules/eslint/lib/rules/newline-after-var.js new file mode 100644 index 0000000..755c5d5 --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-after-var.js @@ -0,0 +1,270 @@ +/** + * @fileoverview Rule to check empty newline after "var" statement + * @author Gopal Venkatesan + * @deprecated in ESLint v4.0.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "Require or disallow an empty line after variable declarations", + recommended: false, + url: "https://eslint.org/docs/latest/rules/newline-after-var" + }, + schema: [ + { + enum: ["never", "always"] + } + ], + fixable: "whitespace", + messages: { + expected: "Expected blank line after variable declarations.", + unexpected: "Unexpected blank line after variable declarations." + }, + + deprecated: { + message: "The rule was replaced with a more general rule.", + url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/", + deprecatedSince: "4.0.0", + availableUntil: null, + replacedBy: [ + { + message: "The new rule moved to a plugin.", + url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "padding-line-between-statements", + url: "https://eslint.style/rules/js/padding-line-between-statements" + } + } + ] + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + // Default `mode` to "always". + const mode = context.options[0] === "never" ? "never" : "always"; + + // Cache starting and ending line numbers of comments for faster lookup + const commentEndLine = sourceCode.getAllComments().reduce((result, token) => { + result[token.loc.start.line] = token.loc.end.line; + return result; + }, {}); + + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Gets a token from the given node to compare line to the next statement. + * + * In general, the token is the last token of the node. However, the token is the second last token if the following conditions satisfy. + * + * - The last token is semicolon. + * - The semicolon is on a different line from the previous token of the semicolon. + * + * This behavior would address semicolon-less style code. e.g.: + * + * var foo = 1 + * + * ;(a || b).doSomething() + * @param {ASTNode} node The node to get. + * @returns {Token} The token to compare line to the next statement. + */ + function getLastToken(node) { + const lastToken = sourceCode.getLastToken(node); + + if (lastToken.type === "Punctuator" && lastToken.value === ";") { + const prevToken = sourceCode.getTokenBefore(lastToken); + + if (prevToken.loc.end.line !== lastToken.loc.start.line) { + return prevToken; + } + } + + return lastToken; + } + + /** + * Determine if provided keyword is a variable declaration + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a type of var + */ + function isVar(keyword) { + return keyword === "var" || keyword === "let" || keyword === "const"; + } + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Determine if provided keyword is an export specifiers + * @private + * @param {string} nodeType nodeType to test + * @returns {boolean} True if `nodeType` is an export specifier + */ + function isExportSpecifier(nodeType) { + return nodeType === "ExportNamedDeclaration" || nodeType === "ExportSpecifier" || + nodeType === "ExportDefaultDeclaration" || nodeType === "ExportAllDeclaration"; + } + + /** + * Determine if provided node is the last of their parent block. + * @private + * @param {ASTNode} node node to test + * @returns {boolean} True if `node` is last of their parent block. + */ + function isLastNode(node) { + const token = sourceCode.getTokenAfter(node); + + return !token || (token.type === "Punctuator" && token.value === "}"); + } + + /** + * Gets the last line of a group of consecutive comments + * @param {number} commentStartLine The starting line of the group + * @returns {number} The number of the last comment line of the group + */ + function getLastCommentLineOfBlock(commentStartLine) { + const currentCommentEnd = commentEndLine[commentStartLine]; + + return commentEndLine[currentCommentEnd + 1] ? getLastCommentLineOfBlock(currentCommentEnd + 1) : currentCommentEnd; + } + + /** + * Determine if a token starts more than one line after a comment ends + * @param {token} token The token being checked + * @param {integer} commentStartLine The line number on which the comment starts + * @returns {boolean} True if `token` does not start immediately after a comment + */ + function hasBlankLineAfterComment(token, commentStartLine) { + return token.loc.start.line > getLastCommentLineOfBlock(commentStartLine) + 1; + } + + /** + * Checks that a blank line exists after a variable declaration when mode is + * set to "always", or checks that there is no blank line when mode is set + * to "never" + * @private + * @param {ASTNode} node `VariableDeclaration` node to test + * @returns {void} + */ + function checkForBlankLine(node) { + + /* + * lastToken is the last token on the node's line. It will usually also be the last token of the node, but it will + * sometimes be second-last if there is a semicolon on a different line. + */ + const lastToken = getLastToken(node), + + /* + * If lastToken is the last token of the node, nextToken should be the token after the node. Otherwise, nextToken + * is the last token of the node. + */ + nextToken = lastToken === sourceCode.getLastToken(node) ? sourceCode.getTokenAfter(node) : sourceCode.getLastToken(node), + nextLineNum = lastToken.loc.end.line + 1; + + // Ignore if there is no following statement + if (!nextToken) { + return; + } + + // Ignore if parent of node is a for variant + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + // Ignore if parent of node is an export specifier + if (isExportSpecifier(node.parent.type)) { + return; + } + + /* + * Some coding styles use multiple `var` statements, so do nothing if + * the next token is a `var` statement. + */ + if (nextToken.type === "Keyword" && isVar(nextToken.value)) { + return; + } + + // Ignore if it is last statement in a block + if (isLastNode(node)) { + return; + } + + // Next statement is not a `var`... + const noNextLineToken = nextToken.loc.start.line > nextLineNum; + const hasNextLineComment = (typeof commentEndLine[nextLineNum] !== "undefined"); + + if (mode === "never" && noNextLineToken && !hasNextLineComment) { + context.report({ + node, + messageId: "unexpected", + fix(fixer) { + const linesBetween = sourceCode.getText().slice(lastToken.range[1], nextToken.range[0]).split(astUtils.LINEBREAK_MATCHER); + + return fixer.replaceTextRange([lastToken.range[1], nextToken.range[0]], `${linesBetween.slice(0, -1).join("")}\n${linesBetween.at(-1)}`); + } + }); + } + + // Token on the next line, or comment without blank line + if ( + mode === "always" && ( + !noNextLineToken || + hasNextLineComment && !hasBlankLineAfterComment(nextToken, nextLineNum) + ) + ) { + context.report({ + node, + messageId: "expected", + fix(fixer) { + if ((noNextLineToken ? getLastCommentLineOfBlock(nextLineNum) : lastToken.loc.end.line) === nextToken.loc.start.line) { + return fixer.insertTextBefore(nextToken, "\n\n"); + } + + return fixer.insertTextBeforeRange([nextToken.range[0] - nextToken.loc.start.column, nextToken.range[1]], "\n"); + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForBlankLine + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/newline-before-return.js b/node_modules/eslint/lib/rules/newline-before-return.js new file mode 100644 index 0000000..6aa74c1 --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-before-return.js @@ -0,0 +1,235 @@ +/** + * @fileoverview Rule to require newlines before `return` statement + * @author Kai Cataldo + * @deprecated in ESLint v4.0.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "Require an empty line before `return` statements", + recommended: false, + url: "https://eslint.org/docs/latest/rules/newline-before-return" + }, + + fixable: "whitespace", + schema: [], + messages: { + expected: "Expected newline before return statement." + }, + + deprecated: { + message: "The rule was replaced with a more general rule.", + url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/", + deprecatedSince: "4.0.0", + availableUntil: null, + replacedBy: [ + { + message: "The new rule moved to a plugin.", + url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "padding-line-between-statements", + url: "https://eslint.style/rules/js/padding-line-between-statements" + } + } + ] + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tests whether node is preceded by supplied tokens + * @param {ASTNode} node node to check + * @param {Array} testTokens array of tokens to test against + * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens + * @private + */ + function isPrecededByTokens(node, testTokens) { + const tokenBefore = sourceCode.getTokenBefore(node); + + return testTokens.includes(tokenBefore.value); + } + + /** + * Checks whether node is the first node after statement or in block + * @param {ASTNode} node node to check + * @returns {boolean} Whether or not the node is the first node after statement or in block + * @private + */ + function isFirstNode(node) { + const parentType = node.parent.type; + + if (node.parent.body) { + return Array.isArray(node.parent.body) + ? node.parent.body[0] === node + : node.parent.body === node; + } + + if (parentType === "IfStatement") { + return isPrecededByTokens(node, ["else", ")"]); + } + if (parentType === "DoWhileStatement") { + return isPrecededByTokens(node, ["do"]); + } + if (parentType === "SwitchCase") { + return isPrecededByTokens(node, [":"]); + } + return isPrecededByTokens(node, [")"]); + + } + + /** + * Returns the number of lines of comments that precede the node + * @param {ASTNode} node node to check for overlapping comments + * @param {number} lineNumTokenBefore line number of previous token, to check for overlapping comments + * @returns {number} Number of lines of comments that precede the node + * @private + */ + function calcCommentLines(node, lineNumTokenBefore) { + const comments = sourceCode.getCommentsBefore(node); + let numLinesComments = 0; + + if (!comments.length) { + return numLinesComments; + } + + comments.forEach(comment => { + numLinesComments++; + + if (comment.type === "Block") { + numLinesComments += comment.loc.end.line - comment.loc.start.line; + } + + // avoid counting lines with inline comments twice + if (comment.loc.start.line === lineNumTokenBefore) { + numLinesComments--; + } + + if (comment.loc.end.line === node.loc.start.line) { + numLinesComments--; + } + }); + + return numLinesComments; + } + + /** + * Returns the line number of the token before the node that is passed in as an argument + * @param {ASTNode} node The node to use as the start of the calculation + * @returns {number} Line number of the token before `node` + * @private + */ + function getLineNumberOfTokenBefore(node) { + const tokenBefore = sourceCode.getTokenBefore(node); + let lineNumTokenBefore; + + /** + * Global return (at the beginning of a script) is a special case. + * If there is no token before `return`, then we expect no line + * break before the return. Comments are allowed to occupy lines + * before the global return, just no blank lines. + * Setting lineNumTokenBefore to zero in that case results in the + * desired behavior. + */ + if (tokenBefore) { + lineNumTokenBefore = tokenBefore.loc.end.line; + } else { + lineNumTokenBefore = 0; // global return at beginning of script + } + + return lineNumTokenBefore; + } + + /** + * Checks whether node is preceded by a newline + * @param {ASTNode} node node to check + * @returns {boolean} Whether or not the node is preceded by a newline + * @private + */ + function hasNewlineBefore(node) { + const lineNumNode = node.loc.start.line; + const lineNumTokenBefore = getLineNumberOfTokenBefore(node); + const commentLines = calcCommentLines(node, lineNumTokenBefore); + + return (lineNumNode - lineNumTokenBefore - commentLines) > 1; + } + + /** + * Checks whether it is safe to apply a fix to a given return statement. + * + * The fix is not considered safe if the given return statement has leading comments, + * as we cannot safely determine if the newline should be added before or after the comments. + * For more information, see: https://github.com/eslint/eslint/issues/5958#issuecomment-222767211 + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if it can fix the node. + * @private + */ + function canFix(node) { + const leadingComments = sourceCode.getCommentsBefore(node); + const lastLeadingComment = leadingComments.at(-1); + const tokenBefore = sourceCode.getTokenBefore(node); + + if (leadingComments.length === 0) { + return true; + } + + /* + * if the last leading comment ends in the same line as the previous token and + * does not share a line with the `return` node, we can consider it safe to fix. + * Example: + * function a() { + * var b; //comment + * return; + * } + */ + if (lastLeadingComment.loc.end.line === tokenBefore.loc.end.line && + lastLeadingComment.loc.end.line !== node.loc.start.line) { + return true; + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ReturnStatement(node) { + if (!isFirstNode(node) && !hasNewlineBefore(node)) { + context.report({ + node, + messageId: "expected", + fix(fixer) { + if (canFix(node)) { + const tokenBefore = sourceCode.getTokenBefore(node); + const newlines = node.loc.start.line === tokenBefore.loc.end.line ? "\n\n" : "\n"; + + return fixer.insertTextBefore(node, newlines); + } + return null; + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/newline-per-chained-call.js b/node_modules/eslint/lib/rules/newline-per-chained-call.js new file mode 100644 index 0000000..7da017e --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-per-chained-call.js @@ -0,0 +1,144 @@ +/** + * @fileoverview Rule to ensure newline per method call when chaining calls + * @author Rajendra Patil + * @author Burak Yigit Kaya + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "newline-per-chained-call", + url: "https://eslint.style/rules/js/newline-per-chained-call" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require a newline after each call in a method chain", + recommended: false, + url: "https://eslint.org/docs/latest/rules/newline-per-chained-call" + }, + + fixable: "whitespace", + + schema: [{ + type: "object", + properties: { + ignoreChainWithDepth: { + type: "integer", + minimum: 1, + maximum: 10, + default: 2 + } + }, + additionalProperties: false + }], + messages: { + expected: "Expected line break before `{{callee}}`." + } + }, + + create(context) { + + const options = context.options[0] || {}, + ignoreChainWithDepth = options.ignoreChainWithDepth || 2; + + const sourceCode = context.sourceCode; + + /** + * Get the prefix of a given MemberExpression node. + * If the MemberExpression node is a computed value it returns a + * left bracket. If not it returns a period. + * @param {ASTNode} node A MemberExpression node to get + * @returns {string} The prefix of the node. + */ + function getPrefix(node) { + if (node.computed) { + if (node.optional) { + return "?.["; + } + return "["; + } + if (node.optional) { + return "?."; + } + return "."; + } + + /** + * Gets the property text of a given MemberExpression node. + * If the text is multiline, this returns only the first line. + * @param {ASTNode} node A MemberExpression node to get. + * @returns {string} The property text of the node. + */ + function getPropertyText(node) { + const prefix = getPrefix(node); + const lines = sourceCode.getText(node.property).split(astUtils.LINEBREAK_MATCHER); + const suffix = node.computed && lines.length === 1 ? "]" : ""; + + return prefix + lines[0] + suffix; + } + + return { + "CallExpression:exit"(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type !== "MemberExpression") { + return; + } + + let parent = astUtils.skipChainExpression(callee.object); + let depth = 1; + + while (parent && parent.callee) { + depth += 1; + parent = astUtils.skipChainExpression(astUtils.skipChainExpression(parent.callee).object); + } + + if (depth > ignoreChainWithDepth && astUtils.isTokenOnSameLine(callee.object, callee.property)) { + const firstTokenAfterObject = sourceCode.getTokenAfter(callee.object, astUtils.isNotClosingParenToken); + + context.report({ + node: callee.property, + loc: { + start: firstTokenAfterObject.loc.start, + end: callee.loc.end + }, + messageId: "expected", + data: { + callee: getPropertyText(callee) + }, + fix(fixer) { + return fixer.insertTextBefore(firstTokenAfterObject, "\n"); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-alert.js b/node_modules/eslint/lib/rules/no-alert.js new file mode 100644 index 0000000..cc87285 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-alert.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Rule to flag use of alert, confirm, prompt + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + getStaticPropertyName: getPropertyName, + getVariableByName, + skipChainExpression +} = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given name is a prohibited identifier. + * @param {string} name The name to check + * @returns {boolean} Whether or not the name is prohibited. + */ +function isProhibitedIdentifier(name) { + return /^(alert|confirm|prompt)$/u.test(name); +} + +/** + * Finds the eslint-scope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]); + + if (references.length === 1) { + return references[0]; + } + return null; +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {string} node The identifier node to check + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + const reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +/** + * Checks if the given identifier node is a ThisExpression in the global scope or the global window property. + * @param {Object} scope The current scope. + * @param {string} node The identifier node to check + * @returns {boolean} Whether or not the node is a reference to the global object. + */ +function isGlobalThisReferenceOrGlobalWindow(scope, node) { + if (scope.type === "global" && node.type === "ThisExpression") { + return true; + } + if ( + node.type === "Identifier" && + ( + node.name === "window" || + (node.name === "globalThis" && getVariableByName(scope, "globalThis")) + ) + ) { + return !isShadowed(scope, node); + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow the use of `alert`, `confirm`, and `prompt`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-alert" + }, + + schema: [], + + messages: { + unexpected: "Unexpected {{name}}." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + CallExpression(node) { + const callee = skipChainExpression(node.callee), + currentScope = sourceCode.getScope(node); + + // without window. + if (callee.type === "Identifier") { + const name = callee.name; + + if (!isShadowed(currentScope, callee) && isProhibitedIdentifier(callee.name)) { + context.report({ + node, + messageId: "unexpected", + data: { name } + }); + } + + } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, callee.object)) { + const name = getPropertyName(callee); + + if (isProhibitedIdentifier(name)) { + context.report({ + node, + messageId: "unexpected", + data: { name } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-array-constructor.js b/node_modules/eslint/lib/rules/no-array-constructor.js new file mode 100644 index 0000000..f56b687 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-array-constructor.js @@ -0,0 +1,133 @@ +/** + * @fileoverview Disallow construction of dense arrays using the Array constructor + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + getVariableByName, + isClosingParenToken, + isOpeningParenToken, + isStartOfExpressionStatement, + needsPrecedingSemicolon +} = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `Array` constructors", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-array-constructor" + }, + + hasSuggestions: true, + + schema: [], + + messages: { + preferLiteral: "The array literal notation [] is preferable.", + useLiteral: "Replace with an array literal.", + useLiteralAfterSemicolon: "Replace with an array literal, add preceding semicolon." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Gets the text between the calling parentheses of a CallExpression or NewExpression. + * @param {ASTNode} node A CallExpression or NewExpression node. + * @returns {string} The text between the calling parentheses, or an empty string if there are none. + */ + function getArgumentsText(node) { + const lastToken = sourceCode.getLastToken(node); + + if (!isClosingParenToken(lastToken)) { + return ""; + } + + let firstToken = node.callee; + + do { + firstToken = sourceCode.getTokenAfter(firstToken); + if (!firstToken || firstToken === lastToken) { + return ""; + } + } while (!isOpeningParenToken(firstToken)); + + return sourceCode.text.slice(firstToken.range[1], lastToken.range[0]); + } + + /** + * Disallow construction of dense arrays using the Array constructor + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if ( + node.callee.type !== "Identifier" || + node.callee.name !== "Array" || + node.arguments.length === 1 && + node.arguments[0].type !== "SpreadElement") { + return; + } + + const variable = getVariableByName(sourceCode.getScope(node), "Array"); + + /* + * Check if `Array` is a predefined global variable: predefined globals have no declarations, + * meaning that the `identifiers` list of the variable object is empty. + */ + if (variable && variable.identifiers.length === 0) { + const argsText = getArgumentsText(node); + let fixText; + let messageId; + + /* + * Check if the suggested change should include a preceding semicolon or not. + * Due to JavaScript's ASI rules, a missing semicolon may be inserted automatically + * before an expression like `Array()` or `new Array()`, but not when the expression + * is changed into an array literal like `[]`. + */ + if (isStartOfExpressionStatement(node) && needsPrecedingSemicolon(sourceCode, node)) { + fixText = `;[${argsText}]`; + messageId = "useLiteralAfterSemicolon"; + } else { + fixText = `[${argsText}]`; + messageId = "useLiteral"; + } + + context.report({ + node, + messageId: "preferLiteral", + suggest: [ + { + messageId, + fix: fixer => fixer.replaceText(node, fixText) + } + ] + }); + } + } + + return { + CallExpression: check, + NewExpression: check + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-async-promise-executor.js b/node_modules/eslint/lib/rules/no-async-promise-executor.js new file mode 100644 index 0000000..ea6c851 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-async-promise-executor.js @@ -0,0 +1,39 @@ +/** + * @fileoverview disallow using an async function as a Promise executor + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow using an async function as a Promise executor", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-async-promise-executor" + }, + + fixable: null, + schema: [], + messages: { + async: "Promise executor functions should not be async." + } + }, + + create(context) { + return { + "NewExpression[callee.name='Promise'][arguments.0.async=true]"(node) { + context.report({ + node: context.sourceCode.getFirstToken(node.arguments[0], token => token.value === "async"), + messageId: "async" + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-await-in-loop.js b/node_modules/eslint/lib/rules/no-await-in-loop.js new file mode 100644 index 0000000..20230de --- /dev/null +++ b/node_modules/eslint/lib/rules/no-await-in-loop.js @@ -0,0 +1,106 @@ +/** + * @fileoverview Rule to disallow uses of await inside of loops. + * @author Nat Mote (nmote) + */ +"use strict"; + +/** + * Check whether it should stop traversing ancestors at the given node. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if it should stop traversing. + */ +function isBoundary(node) { + const t = node.type; + + return ( + t === "FunctionDeclaration" || + t === "FunctionExpression" || + t === "ArrowFunctionExpression" || + + /* + * Don't report the await expressions on for-await-of loop since it's + * asynchronous iteration intentionally. + */ + (t === "ForOfStatement" && node.await === true) + ); +} + +/** + * Check whether the given node is in loop. + * @param {ASTNode} node A node to check. + * @param {ASTNode} parent A parent node to check. + * @returns {boolean} `true` if the node is in loop. + */ +function isLooped(node, parent) { + switch (parent.type) { + case "ForStatement": + return ( + node === parent.test || + node === parent.update || + node === parent.body + ); + + case "ForOfStatement": + case "ForInStatement": + return node === parent.body; + + case "WhileStatement": + case "DoWhileStatement": + return node === parent.test || node === parent.body; + + default: + return false; + } +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow `await` inside of loops", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-await-in-loop" + }, + + schema: [], + + messages: { + unexpectedAwait: "Unexpected `await` inside a loop." + } + }, + create(context) { + + /** + * Validate an await expression. + * @param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate. + * @returns {void} + */ + function validate(awaitNode) { + if (awaitNode.type === "ForOfStatement" && !awaitNode.await) { + return; + } + + let node = awaitNode; + let parent = node.parent; + + while (parent && !isBoundary(parent)) { + if (isLooped(node, parent)) { + context.report({ + node: awaitNode, + messageId: "unexpectedAwait" + }); + return; + } + node = parent; + parent = parent.parent; + } + } + + return { + AwaitExpression: validate, + ForOfStatement: validate + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-bitwise.js b/node_modules/eslint/lib/rules/no-bitwise.js new file mode 100644 index 0000000..7943266 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-bitwise.js @@ -0,0 +1,121 @@ +/** + * @fileoverview Rule to flag bitwise identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * + * Set of bitwise operators. + * + */ +const BITWISE_OPERATORS = [ + "^", "|", "&", "<<", ">>", ">>>", + "^=", "|=", "&=", "<<=", ">>=", ">>>=", + "~" +]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allow: [], + int32Hint: false + }], + + docs: { + description: "Disallow bitwise operators", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-bitwise" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + enum: BITWISE_OPERATORS + }, + uniqueItems: true + }, + int32Hint: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected use of '{{operator}}'." + } + }, + + create(context) { + const [{ allow: allowed, int32Hint }] = context.options; + + /** + * Reports an unexpected use of a bitwise operator. + * @param {ASTNode} node Node which contains the bitwise operator. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "unexpected", data: { operator: node.operator } }); + } + + /** + * Checks if the given node has a bitwise operator. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function hasBitwiseOperator(node) { + return BITWISE_OPERATORS.includes(node.operator); + } + + /** + * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function allowedOperator(node) { + return allowed.includes(node.operator); + } + + /** + * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0" + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is used in integer typecasting. + */ + function isInt32Hint(node) { + return int32Hint && node.operator === "|" && node.right && + node.right.type === "Literal" && node.right.value === 0; + } + + /** + * Report if the given node contains a bitwise operator. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNodeForBitwiseOperator(node) { + if (hasBitwiseOperator(node) && !allowedOperator(node) && !isInt32Hint(node)) { + report(node); + } + } + + return { + AssignmentExpression: checkNodeForBitwiseOperator, + BinaryExpression: checkNodeForBitwiseOperator, + UnaryExpression: checkNodeForBitwiseOperator + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-buffer-constructor.js b/node_modules/eslint/lib/rules/no-buffer-constructor.js new file mode 100644 index 0000000..ba60292 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-buffer-constructor.js @@ -0,0 +1,66 @@ +/** + * @fileoverview disallow use of the Buffer() constructor + * @author Teddy Katz + * @deprecated in ESLint v7.0.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "no-deprecated-api", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-deprecated-api.md" + } + } + ] + }, + + type: "problem", + + docs: { + description: "Disallow use of the `Buffer()` constructor", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-buffer-constructor" + }, + + schema: [], + + messages: { + deprecated: "{{expr}} is deprecated. Use Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe() instead." + } + }, + + create(context) { + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + "CallExpression[callee.name='Buffer'], NewExpression[callee.name='Buffer']"(node) { + context.report({ + node, + messageId: "deprecated", + data: { expr: node.type === "CallExpression" ? "Buffer()" : "new Buffer()" } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-caller.js b/node_modules/eslint/lib/rules/no-caller.js new file mode 100644 index 0000000..3e61a8e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-caller.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Rule to flag use of arguments.callee and arguments.caller. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow the use of `arguments.caller` or `arguments.callee`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-caller" + }, + + schema: [], + + messages: { + unexpected: "Avoid arguments.{{prop}}." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + const objectName = node.object.name, + propertyName = node.property.name; + + if (objectName === "arguments" && !node.computed && propertyName && propertyName.match(/^calle[er]$/u)) { + context.report({ node, messageId: "unexpected", data: { prop: propertyName } }); + } + + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-case-declarations.js b/node_modules/eslint/lib/rules/no-case-declarations.js new file mode 100644 index 0000000..55f82e2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-case-declarations.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag use of an lexical declarations inside a case clause + * @author Erik Arvidsson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow lexical declarations in case clauses", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-case-declarations" + }, + + hasSuggestions: true, + + schema: [], + + messages: { + addBrackets: "Add {} brackets around the case block.", + unexpected: "Unexpected lexical declaration in case block." + } + }, + + create(context) { + + /** + * Checks whether or not a node is a lexical declaration. + * @param {ASTNode} node A direct child statement of a switch case. + * @returns {boolean} Whether or not the node is a lexical declaration. + */ + function isLexicalDeclaration(node) { + switch (node.type) { + case "FunctionDeclaration": + case "ClassDeclaration": + return true; + case "VariableDeclaration": + return node.kind !== "var"; + default: + return false; + } + } + + return { + SwitchCase(node) { + for (let i = 0; i < node.consequent.length; i++) { + const statement = node.consequent[i]; + + if (isLexicalDeclaration(statement)) { + context.report({ + node: statement, + messageId: "unexpected", + suggest: [ + { + messageId: "addBrackets", + fix: fixer => [ + fixer.insertTextBefore(node.consequent[0], "{ "), + fixer.insertTextAfter(node.consequent.at(-1), " }") + ] + } + ] + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-catch-shadow.js b/node_modules/eslint/lib/rules/no-catch-shadow.js new file mode 100644 index 0000000..407b92e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-catch-shadow.js @@ -0,0 +1,93 @@ +/** + * @fileoverview Rule to flag variable leak in CatchClauses in IE 8 and earlier + * @author Ian Christian Myers + * @deprecated in ESLint v5.1.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `catch` clause parameters from shadowing variables in the outer scope", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-catch-shadow" + }, + + deprecated: { + message: "This rule was renamed.", + url: "https://eslint.org/blog/2018/07/eslint-v5.1.0-released/", + deprecatedSince: "5.1.0", + availableUntil: null, + replacedBy: [ + { + rule: { + name: "no-shadow", + url: "https://eslint.org/docs/rules/no-shadow" + } + } + ] + }, + schema: [], + + messages: { + mutable: "Value of '{{name}}' may be overwritten in IE 8 and earlier." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the parameters are been shadowed + * @param {Object} scope current scope + * @param {string} name parameter name + * @returns {boolean} True is its been shadowed + */ + function paramIsShadowing(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + "CatchClause[param!=null]"(node) { + let scope = sourceCode.getScope(node); + + /* + * When ecmaVersion >= 6, CatchClause creates its own scope + * so start from one upper scope to exclude the current node + */ + if (scope.block === node) { + scope = scope.upper; + } + + if (paramIsShadowing(scope, node.param.name)) { + context.report({ node, messageId: "mutable", data: { name: node.param.name } }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-class-assign.js b/node_modules/eslint/lib/rules/no-class-assign.js new file mode 100644 index 0000000..49f3b84 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-class-assign.js @@ -0,0 +1,63 @@ +/** + * @fileoverview A rule to disallow modifying variables of class declarations + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow reassigning class members", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-class-assign" + }, + + schema: [], + + messages: { + class: "'{{name}}' is a class." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "class", data: { name: reference.identifier.name } }); + + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {ASTNode} node A ClassDeclaration/ClassExpression node to check. + * @returns {void} + */ + function checkForClass(node) { + sourceCode.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + ClassDeclaration: checkForClass, + ClassExpression: checkForClass + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-compare-neg-zero.js b/node_modules/eslint/lib/rules/no-compare-neg-zero.js new file mode 100644 index 0000000..42e4a37 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-compare-neg-zero.js @@ -0,0 +1,60 @@ +/** + * @fileoverview The rule should warn against code that tries to compare against -0. + * @author Aladdin-ADD + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow comparing against `-0`", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-compare-neg-zero" + }, + + fixable: null, + schema: [], + + messages: { + unexpected: "Do not use the '{{operator}}' operator to compare against -0." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks a given node is -0 + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is -0. + */ + function isNegZero(node) { + return node.type === "UnaryExpression" && node.operator === "-" && node.argument.type === "Literal" && node.argument.value === 0; + } + const OPERATORS_TO_CHECK = new Set([">", ">=", "<", "<=", "==", "===", "!=", "!=="]); + + return { + BinaryExpression(node) { + if (OPERATORS_TO_CHECK.has(node.operator)) { + if (isNegZero(node.left) || isNegZero(node.right)) { + context.report({ + node, + messageId: "unexpected", + data: { operator: node.operator } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-cond-assign.js b/node_modules/eslint/lib/rules/no-cond-assign.js new file mode 100644 index 0000000..6d4135d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-cond-assign.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Rule to flag assignment in a conditional statement's test expression + * @author Stephen Murray + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TEST_CONDITION_PARENT_TYPES = new Set(["IfStatement", "WhileStatement", "DoWhileStatement", "ForStatement", "ConditionalExpression"]); + +const NODE_DESCRIPTIONS = { + DoWhileStatement: "a 'do...while' statement", + ForStatement: "a 'for' statement", + IfStatement: "an 'if' statement", + WhileStatement: "a 'while' statement" +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: ["except-parens"], + + docs: { + description: "Disallow assignment operators in conditional expressions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-cond-assign" + }, + + schema: [ + { + enum: ["except-parens", "always"] + } + ], + + messages: { + unexpected: "Unexpected assignment within {{type}}.", + + // must match JSHint's error message + missing: "Expected a conditional expression and instead saw an assignment." + } + }, + + create(context) { + const [prohibitAssign] = context.options; + const sourceCode = context.sourceCode; + + /** + * Check whether an AST node is the test expression for a conditional statement. + * @param {!Object} node The node to test. + * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`. + */ + function isConditionalTestExpression(node) { + return node.parent && + TEST_CONDITION_PARENT_TYPES.has(node.parent.type) && + node === node.parent.test; + } + + /** + * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement. + * @param {!Object} node The node to use at the start of the search. + * @returns {?Object} The closest ancestor node that represents a conditional statement. + */ + function findConditionalAncestor(node) { + let currentAncestor = node; + + do { + if (isConditionalTestExpression(currentAncestor)) { + return currentAncestor.parent; + } + } while ((currentAncestor = currentAncestor.parent) && !astUtils.isFunction(currentAncestor)); + + return null; + } + + /** + * Check whether the code represented by an AST node is enclosed in two sets of parentheses. + * @param {!Object} node The node to test. + * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`. + */ + function isParenthesisedTwice(node) { + const previousToken = sourceCode.getTokenBefore(node, 1), + nextToken = sourceCode.getTokenAfter(node, 1); + + return astUtils.isParenthesised(sourceCode, node) && + previousToken && astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && + astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + } + + /** + * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses. + * @param {!Object} node The node for the conditional statement. + * @returns {void} + */ + function testForAssign(node) { + if (node.test && + (node.test.type === "AssignmentExpression") && + (node.type === "ForStatement" + ? !astUtils.isParenthesised(sourceCode, node.test) + : !isParenthesisedTwice(node.test) + ) + ) { + + context.report({ + node: node.test, + messageId: "missing" + }); + } + } + + /** + * Check whether an assignment expression is descended from a conditional statement's test expression. + * @param {!Object} node The node for the assignment expression. + * @returns {void} + */ + function testForConditionalAncestor(node) { + const ancestor = findConditionalAncestor(node); + + if (ancestor) { + context.report({ + node, + messageId: "unexpected", + data: { + type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type + } + }); + } + } + + if (prohibitAssign === "always") { + return { + AssignmentExpression: testForConditionalAncestor + }; + } + + return { + DoWhileStatement: testForAssign, + ForStatement: testForAssign, + IfStatement: testForAssign, + WhileStatement: testForAssign, + ConditionalExpression: testForAssign + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-confusing-arrow.js b/node_modules/eslint/lib/rules/no-confusing-arrow.js new file mode 100644 index 0000000..8d9a4d8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-confusing-arrow.js @@ -0,0 +1,110 @@ +/** + * @fileoverview A rule to warn against using arrow functions when they could be + * confused with comparisons + * @author Jxck + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a conditional expression. + * @param {ASTNode} node node to test + * @returns {boolean} `true` if the node is a conditional expression. + */ +function isConditional(node) { + return node && node.type === "ConditionalExpression"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-confusing-arrow", + url: "https://eslint.style/rules/js/no-confusing-arrow" + } + } + ] + }, + type: "suggestion", + + docs: { + description: "Disallow arrow functions where they could be confused with comparisons", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-confusing-arrow" + }, + + fixable: "code", + + schema: [{ + type: "object", + properties: { + allowParens: { type: "boolean", default: true }, + onlyOneSimpleParam: { type: "boolean", default: false } + }, + additionalProperties: false + }], + + messages: { + confusing: "Arrow function used ambiguously with a conditional expression." + } + }, + + create(context) { + const config = context.options[0] || {}; + const allowParens = config.allowParens || (config.allowParens === void 0); + const onlyOneSimpleParam = config.onlyOneSimpleParam; + const sourceCode = context.sourceCode; + + + /** + * Reports if an arrow function contains an ambiguous conditional. + * @param {ASTNode} node A node to check and report. + * @returns {void} + */ + function checkArrowFunc(node) { + const body = node.body; + + if (isConditional(body) && + !(allowParens && astUtils.isParenthesised(sourceCode, body)) && + !(onlyOneSimpleParam && !(node.params.length === 1 && node.params[0].type === "Identifier"))) { + context.report({ + node, + messageId: "confusing", + fix(fixer) { + + // if `allowParens` is not set to true don't bother wrapping in parens + return allowParens && fixer.replaceText(node.body, `(${sourceCode.getText(node.body)})`); + } + }); + } + } + + return { + ArrowFunctionExpression: checkArrowFunc + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-console.js b/node_modules/eslint/lib/rules/no-console.js new file mode 100644 index 0000000..7d11b48 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-console.js @@ -0,0 +1,210 @@ +/** + * @fileoverview Rule to flag use of console object + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{}], + + docs: { + description: "Disallow the use of `console`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-console" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + hasSuggestions: true, + + messages: { + unexpected: "Unexpected console statement.", + limited: "Unexpected console statement. Only these console methods are allowed: {{ allowed }}.", + removeConsole: "Remove the console.{{ propertyName }}()." + } + }, + + create(context) { + const [{ allow: allowed = [] }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Checks whether the given reference is 'console' or not. + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is 'console'. + */ + function isConsole(reference) { + const id = reference.identifier; + + return id && id.name === "console"; + } + + /** + * Checks whether the property name of the given MemberExpression node + * is allowed by options or not. + * @param {ASTNode} node The MemberExpression node to check. + * @returns {boolean} `true` if the property name of the node is allowed. + */ + function isAllowed(node) { + const propertyName = astUtils.getStaticPropertyName(node); + + return propertyName && allowed.includes(propertyName); + } + + /** + * Checks whether the given reference is a member access which is not + * allowed by options or not. + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is a member access which + * is not allowed by options. + */ + function isMemberAccessExceptAllowed(reference) { + const node = reference.identifier; + const parent = node.parent; + + return ( + parent.type === "MemberExpression" && + parent.object === node && + !isAllowed(parent) + ); + } + + /** + * Checks if removing the ExpressionStatement node will cause ASI to + * break. + * eg. + * foo() + * console.log(); + * [1, 2, 3].forEach(a => doSomething(a)) + * + * Removing the console.log(); statement should leave two statements, but + * here the two statements will become one because [ causes continuation after + * foo(). + * @param {ASTNode} node The ExpressionStatement node to check. + * @returns {boolean} `true` if ASI will break after removing the ExpressionStatement + * node. + */ + function maybeAsiHazard(node) { + const SAFE_TOKENS_BEFORE = /^[:;{]$/u; // One of :;{ + const UNSAFE_CHARS_AFTER = /^[-[(/+`]/u; // One of [(/+-` + + const tokenBefore = sourceCode.getTokenBefore(node); + const tokenAfter = sourceCode.getTokenAfter(node); + + return ( + Boolean(tokenAfter) && + UNSAFE_CHARS_AFTER.test(tokenAfter.value) && + tokenAfter.value !== "++" && + tokenAfter.value !== "--" && + Boolean(tokenBefore) && + !SAFE_TOKENS_BEFORE.test(tokenBefore.value) + ); + } + + /** + * Checks if the MemberExpression node's parent.parent.parent is a + * Program, BlockStatement, StaticBlock, or SwitchCase node. This check + * is necessary to avoid providing a suggestion that might cause a syntax error. + * + * eg. if (a) console.log(b), removing console.log() here will lead to a + * syntax error. + * if (a) { console.log(b) }, removing console.log() here is acceptable. + * + * Additionally, it checks if the callee of the CallExpression node is + * the node itself. + * + * eg. foo(console.log), cannot provide a suggestion here. + * @param {ASTNode} node The MemberExpression node to check. + * @returns {boolean} `true` if a suggestion can be provided for a node. + */ + function canProvideSuggestions(node) { + return ( + node.parent.type === "CallExpression" && + node.parent.callee === node && + node.parent.parent.type === "ExpressionStatement" && + astUtils.STATEMENT_LIST_PARENTS.has(node.parent.parent.parent.type) && + !maybeAsiHazard(node.parent.parent) + ); + } + + /** + * Reports the given reference as a violation. + * @param {eslint-scope.Reference} reference The reference to report. + * @returns {void} + */ + function report(reference) { + const node = reference.identifier.parent; + + const propertyName = astUtils.getStaticPropertyName(node); + + context.report({ + node, + loc: node.loc, + messageId: allowed.length ? "limited" : "unexpected", + data: { allowed: allowed.join(", ") }, + suggest: canProvideSuggestions(node) + ? [{ + messageId: "removeConsole", + data: { propertyName }, + fix(fixer) { + return fixer.remove(node.parent.parent); + } + }] + : [] + }); + } + + return { + "Program:exit"(node) { + const scope = sourceCode.getScope(node); + const consoleVar = astUtils.getVariableByName(scope, "console"); + const shadowed = consoleVar && consoleVar.defs.length > 0; + + /* + * 'scope.through' includes all references to undefined + * variables. If the variable 'console' is not defined, it uses + * 'scope.through'. + */ + const references = consoleVar + ? consoleVar.references + : scope.through.filter(isConsole); + + if (!shadowed) { + references + .filter(isMemberAccessExceptAllowed) + .forEach(report); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-const-assign.js b/node_modules/eslint/lib/rules/no-const-assign.js new file mode 100644 index 0000000..0ceaf7e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-const-assign.js @@ -0,0 +1,56 @@ +/** + * @fileoverview A rule to disallow modifying variables that are declared using `const` + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow reassigning `const` variables", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-const-assign" + }, + + schema: [], + + messages: { + const: "'{{name}}' is constant." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "const", data: { name: reference.identifier.name } }); + }); + } + + return { + VariableDeclaration(node) { + if (node.kind === "const") { + sourceCode.getDeclaredVariables(node).forEach(checkVariable); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-constant-binary-expression.js b/node_modules/eslint/lib/rules/no-constant-binary-expression.js new file mode 100644 index 0000000..bc8f073 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-constant-binary-expression.js @@ -0,0 +1,508 @@ +/** + * @fileoverview Rule to flag constant comparisons and logical expressions that always/never short circuit + * @author Jordan Eldredge + */ + +"use strict"; + +const { isNullLiteral, isConstant, isReferenceToGlobalVariable, isLogicalAssignmentOperator, ECMASCRIPT_GLOBALS } = require("./utils/ast-utils"); + +const NUMERIC_OR_STRING_BINARY_OPERATORS = new Set(["+", "-", "*", "/", "%", "|", "^", "&", "**", "<<", ">>", ">>>"]); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is `null` or `undefined`. Similar to the one + * found in ast-utils.js, but this one correctly handles the edge case that + * `undefined` has been redefined. + * @param {Scope} scope Scope in which the expression was found. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `null` or `undefined`. + * @public + */ +function isNullOrUndefined(scope, node) { + return ( + isNullLiteral(node) || + (node.type === "Identifier" && node.name === "undefined" && isReferenceToGlobalVariable(scope, node)) || + (node.type === "UnaryExpression" && node.operator === "void") + ); +} + +/** + * Test if an AST node has a statically knowable constant nullishness. Meaning, + * it will always resolve to a constant value of either: `null`, `undefined` + * or not `null` _or_ `undefined`. An expression that can vary between those + * three states at runtime would return `false`. + * @param {Scope} scope The scope in which the node was found. + * @param {ASTNode} node The AST node being tested. + * @param {boolean} nonNullish if `true` then nullish values are not considered constant. + * @returns {boolean} Does `node` have constant nullishness? + */ +function hasConstantNullishness(scope, node, nonNullish) { + if (nonNullish && isNullOrUndefined(scope, node)) { + return false; + } + + switch (node.type) { + case "ObjectExpression": // Objects are never nullish + case "ArrayExpression": // Arrays are never nullish + case "ArrowFunctionExpression": // Functions never nullish + case "FunctionExpression": // Functions are never nullish + case "ClassExpression": // Classes are never nullish + case "NewExpression": // Objects are never nullish + case "Literal": // Nullish, or non-nullish, literals never change + case "TemplateLiteral": // A string is never nullish + case "UpdateExpression": // Numbers are never nullish + case "BinaryExpression": // Numbers, strings, or booleans are never nullish + return true; + case "CallExpression": { + if (node.callee.type !== "Identifier") { + return false; + } + const functionName = node.callee.name; + + return (functionName === "Boolean" || functionName === "String" || functionName === "Number") && + isReferenceToGlobalVariable(scope, node.callee); + } + case "LogicalExpression": { + return node.operator === "??" && hasConstantNullishness(scope, node.right, true); + } + case "AssignmentExpression": + if (node.operator === "=") { + return hasConstantNullishness(scope, node.right, nonNullish); + } + + /* + * Handling short-circuiting assignment operators would require + * walking the scope. We won't attempt that (for now...) / + */ + if (isLogicalAssignmentOperator(node.operator)) { + return false; + } + + /* + * The remaining assignment expressions all result in a numeric or + * string (non-nullish) value: + * "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=" + */ + + return true; + case "UnaryExpression": + + /* + * "void" Always returns `undefined` + * "typeof" All types are strings, and thus non-nullish + * "!" Boolean is never nullish + * "delete" Returns a boolean, which is never nullish + * Math operators always return numbers or strings, neither of which + * are non-nullish "+", "-", "~" + */ + + return true; + case "SequenceExpression": { + const last = node.expressions.at(-1); + + return hasConstantNullishness(scope, last, nonNullish); + } + case "Identifier": + return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. + case "JSXFragment": + return false; + default: + return false; + } +} + +/** + * Test if an AST node is a boolean value that never changes. Specifically we + * test for: + * 1. Literal booleans (`true` or `false`) + * 2. Unary `!` expressions with a constant value + * 3. Constant booleans created via the `Boolean` global function + * @param {Scope} scope The scope in which the node was found. + * @param {ASTNode} node The node to test + * @returns {boolean} Is `node` guaranteed to be a boolean? + */ +function isStaticBoolean(scope, node) { + switch (node.type) { + case "Literal": + return typeof node.value === "boolean"; + case "CallExpression": + return node.callee.type === "Identifier" && node.callee.name === "Boolean" && + isReferenceToGlobalVariable(scope, node.callee) && + (node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)); + case "UnaryExpression": + return node.operator === "!" && isConstant(scope, node.argument, true); + default: + return false; + } +} + + +/** + * Test if an AST node will always give the same result when compared to a + * boolean value. Note that comparison to boolean values is different than + * truthiness. + * https://262.ecma-international.org/5.1/#sec-11.9.3 + * + * JavaScript `==` operator works by converting the boolean to `1` (true) or + * `+0` (false) and then checks the values `==` equality to that number. + * @param {Scope} scope The scope in which node was found. + * @param {ASTNode} node The node to test. + * @returns {boolean} Will `node` always coerce to the same boolean value? + */ +function hasConstantLooseBooleanComparison(scope, node) { + switch (node.type) { + case "ObjectExpression": + case "ClassExpression": + + /** + * In theory objects like: + * + * `{toString: () => a}` + * `{valueOf: () => a}` + * + * Or a classes like: + * + * `class { static toString() { return a } }` + * `class { static valueOf() { return a } }` + * + * Are not constant verifiably when `inBooleanPosition` is + * false, but it's an edge case we've opted not to handle. + */ + return true; + case "ArrayExpression": { + const nonSpreadElements = node.elements.filter(e => + + // Elements can be `null` in sparse arrays: `[,,]`; + e !== null && e.type !== "SpreadElement"); + + + /* + * Possible future direction if needed: We could check if the + * single value would result in variable boolean comparison. + * For now we will err on the side of caution since `[x]` could + * evaluate to `[0]` or `[1]`. + */ + return node.elements.length === 0 || nonSpreadElements.length > 1; + } + case "ArrowFunctionExpression": + case "FunctionExpression": + return true; + case "UnaryExpression": + if (node.operator === "void" || // Always returns `undefined` + node.operator === "typeof" // All `typeof` strings, when coerced to number, are not 0 or 1. + ) { + return true; + } + if (node.operator === "!") { + return isConstant(scope, node.argument, true); + } + + /* + * We won't try to reason about +, -, ~, or delete + * In theory, for the mathematical operators, we could look at the + * argument and try to determine if it coerces to a constant numeric + * value. + */ + return false; + case "NewExpression": // Objects might have custom `.valueOf` or `.toString`. + return false; + case "CallExpression": { + if (node.callee.type === "Identifier" && + node.callee.name === "Boolean" && + isReferenceToGlobalVariable(scope, node.callee) + ) { + return node.arguments.length === 0 || isConstant(scope, node.arguments[0], true); + } + return false; + } + case "Literal": // True or false, literals never change + return true; + case "Identifier": + return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + case "TemplateLiteral": + + /* + * In theory we could try to check if the quasi are sufficient to + * prove that the expression will always be true, but it would be + * tricky to get right. For example: `000.${foo}000` + */ + return node.expressions.length === 0; + case "AssignmentExpression": + if (node.operator === "=") { + return hasConstantLooseBooleanComparison(scope, node.right); + } + + /* + * Handling short-circuiting assignment operators would require + * walking the scope. We won't attempt that (for now...) + * + * The remaining assignment expressions all result in a numeric or + * string (non-nullish) values which could be truthy or falsy: + * "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=" + */ + return false; + case "SequenceExpression": { + const last = node.expressions.at(-1); + + return hasConstantLooseBooleanComparison(scope, last); + } + case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. + case "JSXFragment": + return false; + default: + return false; + } +} + + +/** + * Test if an AST node will always give the same result when _strictly_ compared + * to a boolean value. This can happen if the expression can never be boolean, or + * if it is always the same boolean value. + * @param {Scope} scope The scope in which the node was found. + * @param {ASTNode} node The node to test + * @returns {boolean} Will `node` always give the same result when compared to a + * static boolean value? + */ +function hasConstantStrictBooleanComparison(scope, node) { + switch (node.type) { + case "ObjectExpression": // Objects are not booleans + case "ArrayExpression": // Arrays are not booleans + case "ArrowFunctionExpression": // Functions are not booleans + case "FunctionExpression": + case "ClassExpression": // Classes are not booleans + case "NewExpression": // Objects are not booleans + case "TemplateLiteral": // Strings are not booleans + case "Literal": // True, false, or not boolean, literals never change. + case "UpdateExpression": // Numbers are not booleans + return true; + case "BinaryExpression": + return NUMERIC_OR_STRING_BINARY_OPERATORS.has(node.operator); + case "UnaryExpression": { + if (node.operator === "delete") { + return false; + } + if (node.operator === "!") { + return isConstant(scope, node.argument, true); + } + + /* + * The remaining operators return either strings or numbers, neither + * of which are boolean. + */ + return true; + } + case "SequenceExpression": { + const last = node.expressions.at(-1); + + return hasConstantStrictBooleanComparison(scope, last); + } + case "Identifier": + return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + case "AssignmentExpression": + if (node.operator === "=") { + return hasConstantStrictBooleanComparison(scope, node.right); + } + + /* + * Handling short-circuiting assignment operators would require + * walking the scope. We won't attempt that (for now...) + */ + if (isLogicalAssignmentOperator(node.operator)) { + return false; + } + + /* + * The remaining assignment expressions all result in either a number + * or a string, neither of which can ever be boolean. + */ + return true; + case "CallExpression": { + if (node.callee.type !== "Identifier") { + return false; + } + const functionName = node.callee.name; + + if ( + (functionName === "String" || functionName === "Number") && + isReferenceToGlobalVariable(scope, node.callee) + ) { + return true; + } + if (functionName === "Boolean" && isReferenceToGlobalVariable(scope, node.callee)) { + return ( + node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)); + } + return false; + } + case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. + case "JSXFragment": + return false; + default: + return false; + } +} + +/** + * Test if an AST node will always result in a newly constructed object + * @param {Scope} scope The scope in which the node was found. + * @param {ASTNode} node The node to test + * @returns {boolean} Will `node` always be new? + */ +function isAlwaysNew(scope, node) { + switch (node.type) { + case "ObjectExpression": + case "ArrayExpression": + case "ArrowFunctionExpression": + case "FunctionExpression": + case "ClassExpression": + return true; + case "NewExpression": { + if (node.callee.type !== "Identifier") { + return false; + } + + /* + * All the built-in constructors are always new, but + * user-defined constructors could return a sentinel + * object. + * + * Catching these is especially useful for primitive constructors + * which return boxed values, a surprising gotcha' in JavaScript. + */ + return Object.hasOwn(ECMASCRIPT_GLOBALS, node.callee.name) && + isReferenceToGlobalVariable(scope, node.callee); + } + case "Literal": + + // Regular expressions are objects, and thus always new + return typeof node.regex === "object"; + case "SequenceExpression": { + const last = node.expressions.at(-1); + + return isAlwaysNew(scope, last); + } + case "AssignmentExpression": + if (node.operator === "=") { + return isAlwaysNew(scope, node.right); + } + return false; + case "ConditionalExpression": + return isAlwaysNew(scope, node.consequent) && isAlwaysNew(scope, node.alternate); + case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. + case "JSXFragment": + return false; + default: + return false; + } +} + +/** + * Checks if one operand will cause the result to be constant. + * @param {Scope} scope Scope in which the expression was found. + * @param {ASTNode} a One side of the expression + * @param {ASTNode} b The other side of the expression + * @param {string} operator The binary expression operator + * @returns {ASTNode | null} The node which will cause the expression to have a constant result. + */ +function findBinaryExpressionConstantOperand(scope, a, b, operator) { + if (operator === "==" || operator === "!=") { + if ( + (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b, false)) || + (isStaticBoolean(scope, a) && hasConstantLooseBooleanComparison(scope, b)) + ) { + return b; + } + } else if (operator === "===" || operator === "!==") { + if ( + (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b, false)) || + (isStaticBoolean(scope, a) && hasConstantStrictBooleanComparison(scope, b)) + ) { + return b; + } + } + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + docs: { + description: "Disallow expressions where the operation doesn't affect the value", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-constant-binary-expression" + }, + schema: [], + messages: { + constantBinaryOperand: "Unexpected constant binary expression. Compares constantly with the {{otherSide}}-hand side of the `{{operator}}`.", + constantShortCircuit: "Unexpected constant {{property}} on the left-hand side of a `{{operator}}` expression.", + alwaysNew: "Unexpected comparison to newly constructed object. These two values can never be equal.", + bothAlwaysNew: "Unexpected comparison of two newly constructed objects. These two values can never be equal." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + LogicalExpression(node) { + const { operator, left } = node; + const scope = sourceCode.getScope(node); + + if ((operator === "&&" || operator === "||") && isConstant(scope, left, true)) { + context.report({ node: left, messageId: "constantShortCircuit", data: { property: "truthiness", operator } }); + } else if (operator === "??" && hasConstantNullishness(scope, left, false)) { + context.report({ node: left, messageId: "constantShortCircuit", data: { property: "nullishness", operator } }); + } + }, + BinaryExpression(node) { + const scope = sourceCode.getScope(node); + const { right, left, operator } = node; + const rightConstantOperand = findBinaryExpressionConstantOperand(scope, left, right, operator); + const leftConstantOperand = findBinaryExpressionConstantOperand(scope, right, left, operator); + + if (rightConstantOperand) { + context.report({ node: rightConstantOperand, messageId: "constantBinaryOperand", data: { operator, otherSide: "left" } }); + } else if (leftConstantOperand) { + context.report({ node: leftConstantOperand, messageId: "constantBinaryOperand", data: { operator, otherSide: "right" } }); + } else if (operator === "===" || operator === "!==") { + if (isAlwaysNew(scope, left)) { + context.report({ node: left, messageId: "alwaysNew" }); + } else if (isAlwaysNew(scope, right)) { + context.report({ node: right, messageId: "alwaysNew" }); + } + } else if (operator === "==" || operator === "!=") { + + /* + * If both sides are "new", then both sides are objects and + * therefore they will be compared by reference even with `==` + * equality. + */ + if (isAlwaysNew(scope, left) && isAlwaysNew(scope, right)) { + context.report({ node: left, messageId: "bothAlwaysNew" }); + } + } + + } + + /* + * In theory we could handle short-circuiting assignment operators, + * for some constant values, but that would require walking the + * scope to find the value of the variable being assigned. This is + * dependant on https://github.com/eslint/eslint/issues/13776 + * + * AssignmentExpression() {}, + */ + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-constant-condition.js b/node_modules/eslint/lib/rules/no-constant-condition.js new file mode 100644 index 0000000..1514b54 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-constant-condition.js @@ -0,0 +1,162 @@ +/** + * @fileoverview Rule to flag use constant conditions + * @author Christian Schulz + */ + +"use strict"; + +const { isConstant } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ checkLoops: "allExceptWhileTrue" }], + + docs: { + description: "Disallow constant expressions in conditions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-constant-condition" + }, + + schema: [ + { + type: "object", + properties: { + checkLoops: { + enum: ["all", "allExceptWhileTrue", "none", true, false] + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected constant condition." + } + }, + + create(context) { + const loopSetStack = []; + const sourceCode = context.sourceCode; + let [{ checkLoops }] = context.options; + + if (checkLoops === true) { + checkLoops = "all"; + } else if (checkLoops === false) { + checkLoops = "none"; + } + + let loopsInCurrentScope = new Set(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tracks when the given node contains a constant condition. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function trackConstantConditionLoop(node) { + if (node.test && isConstant(sourceCode.getScope(node), node.test, true)) { + loopsInCurrentScope.add(node); + } + } + + /** + * Reports when the set contains the given constant condition node + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkConstantConditionLoopInSet(node) { + if (loopsInCurrentScope.has(node)) { + loopsInCurrentScope.delete(node); + context.report({ node: node.test, messageId: "unexpected" }); + } + } + + /** + * Reports when the given node contains a constant condition. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function reportIfConstant(node) { + if (node.test && isConstant(sourceCode.getScope(node), node.test, true)) { + context.report({ node: node.test, messageId: "unexpected" }); + } + } + + /** + * Stores current set of constant loops in loopSetStack temporarily + * and uses a new set to track constant loops + * @returns {void} + * @private + */ + function enterFunction() { + loopSetStack.push(loopsInCurrentScope); + loopsInCurrentScope = new Set(); + } + + /** + * Reports when the set still contains stored constant conditions + * @returns {void} + * @private + */ + function exitFunction() { + loopsInCurrentScope = loopSetStack.pop(); + } + + /** + * Checks node when checkLoops option is enabled + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkLoop(node) { + if (checkLoops === "all" || checkLoops === "allExceptWhileTrue") { + trackConstantConditionLoop(node); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ConditionalExpression: reportIfConstant, + IfStatement: reportIfConstant, + WhileStatement(node) { + if (node.test.type === "Literal" && node.test.value === true && checkLoops === "allExceptWhileTrue") { + return; + } + + checkLoop(node); + }, + "WhileStatement:exit": checkConstantConditionLoopInSet, + DoWhileStatement: checkLoop, + "DoWhileStatement:exit": checkConstantConditionLoopInSet, + ForStatement: checkLoop, + "ForStatement > .test": node => checkLoop(node.parent), + "ForStatement:exit": checkConstantConditionLoopInSet, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + YieldExpression: () => loopsInCurrentScope.clear() + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-constructor-return.js b/node_modules/eslint/lib/rules/no-constructor-return.js new file mode 100644 index 0000000..e9ef738 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-constructor-return.js @@ -0,0 +1,62 @@ +/** + * @fileoverview Rule to disallow returning value from constructor. + * @author Pig Fang + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow returning value from constructor", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-constructor-return" + }, + + schema: [], + + fixable: null, + + messages: { + unexpected: "Unexpected return statement in constructor." + } + }, + + create(context) { + const stack = []; + + return { + onCodePathStart(_, node) { + stack.push(node); + }, + onCodePathEnd() { + stack.pop(); + }, + ReturnStatement(node) { + const last = stack.at(-1); + + if (!last.parent) { + return; + } + + if ( + last.parent.type === "MethodDefinition" && + last.parent.kind === "constructor" && + node.argument + ) { + context.report({ + node, + messageId: "unexpected" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-continue.js b/node_modules/eslint/lib/rules/no-continue.js new file mode 100644 index 0000000..c1b6d75 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-continue.js @@ -0,0 +1,40 @@ +/** + * @fileoverview Rule to flag use of continue statement + * @author Borislav Zhivkov + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `continue` statements", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-continue" + }, + + schema: [], + + messages: { + unexpected: "Unexpected use of continue statement." + } + }, + + create(context) { + + return { + ContinueStatement(node) { + context.report({ node, messageId: "unexpected" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-control-regex.js b/node_modules/eslint/lib/rules/no-control-regex.js new file mode 100644 index 0000000..dc412fc --- /dev/null +++ b/node_modules/eslint/lib/rules/no-control-regex.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Rule to forbid control characters from regular expressions. + * @author Nicholas C. Zakas + */ + +"use strict"; + +const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator; +const collector = new (class { + constructor() { + this._source = ""; + this._controlChars = []; + this._validator = new RegExpValidator(this); + } + + onPatternEnter() { + + /* + * `RegExpValidator` may parse the pattern twice in one `validatePattern`. + * So `this._controlChars` should be cleared here as well. + * + * For example, the `/(?\x1f)/` regex will parse the pattern twice. + * This is based on the content described in Annex B. + * If the regex contains a `GroupName` and the `u` flag is not used, `ParseText` will be called twice. + * See https://tc39.es/ecma262/2023/multipage/additional-ecmascript-features-for-web-browsers.html#sec-parsepattern-annexb + */ + this._controlChars = []; + } + + onCharacter(start, end, cp) { + if (cp >= 0x00 && + cp <= 0x1F && + ( + this._source.codePointAt(start) === cp || + this._source.slice(start, end).startsWith("\\x") || + this._source.slice(start, end).startsWith("\\u") + ) + ) { + this._controlChars.push(`\\x${`0${cp.toString(16)}`.slice(-2)}`); + } + } + + collectControlChars(regexpStr, flags) { + const uFlag = typeof flags === "string" && flags.includes("u"); + const vFlag = typeof flags === "string" && flags.includes("v"); + + this._controlChars = []; + this._source = regexpStr; + + try { + this._validator.validatePattern(regexpStr, void 0, void 0, { unicode: uFlag, unicodeSets: vFlag }); // Call onCharacter hook + } catch { + + // Ignore syntax errors in RegExp. + } + return this._controlChars; + } +})(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow control characters in regular expressions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-control-regex" + }, + + schema: [], + + messages: { + unexpected: "Unexpected control character(s) in regular expression: {{controlChars}}." + } + }, + + create(context) { + + /** + * Get the regex expression + * @param {ASTNode} node `Literal` node to evaluate + * @returns {{ pattern: string, flags: string | null } | null} Regex if found (the given node is either a regex literal + * or a string literal that is the pattern argument of a RegExp constructor call). Otherwise `null`. If flags cannot be determined, + * the `flags` property will be `null`. + * @private + */ + function getRegExp(node) { + if (node.regex) { + return node.regex; + } + if (typeof node.value === "string" && + (node.parent.type === "NewExpression" || node.parent.type === "CallExpression") && + node.parent.callee.type === "Identifier" && + node.parent.callee.name === "RegExp" && + node.parent.arguments[0] === node + ) { + const pattern = node.value; + const flags = + node.parent.arguments.length > 1 && + node.parent.arguments[1].type === "Literal" && + typeof node.parent.arguments[1].value === "string" + ? node.parent.arguments[1].value + : null; + + return { pattern, flags }; + } + + return null; + } + + return { + Literal(node) { + const regExp = getRegExp(node); + + if (regExp) { + const { pattern, flags } = regExp; + const controlCharacters = collector.collectControlChars(pattern, flags); + + if (controlCharacters.length > 0) { + context.report({ + node, + messageId: "unexpected", + data: { + controlChars: controlCharacters.join(", ") + } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-debugger.js b/node_modules/eslint/lib/rules/no-debugger.js new file mode 100644 index 0000000..f698435 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-debugger.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to flag use of a debugger statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow the use of `debugger`", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-debugger" + }, + + fixable: null, + schema: [], + + messages: { + unexpected: "Unexpected 'debugger' statement." + } + }, + + create(context) { + + return { + DebuggerStatement(node) { + context.report({ + node, + messageId: "unexpected" + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-delete-var.js b/node_modules/eslint/lib/rules/no-delete-var.js new file mode 100644 index 0000000..126603c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-delete-var.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Rule to flag when deleting variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow deleting variables", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-delete-var" + }, + + schema: [], + + messages: { + unexpected: "Variables should not be deleted." + } + }, + + create(context) { + + return { + + UnaryExpression(node) { + if (node.operator === "delete" && node.argument.type === "Identifier") { + context.report({ node, messageId: "unexpected" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-div-regex.js b/node_modules/eslint/lib/rules/no-div-regex.js new file mode 100644 index 0000000..24e6f89 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-div-regex.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Rule to check for ambiguous div operator in regexes + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow equal signs explicitly at the beginning of regular expressions", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-div-regex" + }, + + fixable: "code", + + schema: [], + + messages: { + unexpected: "A regular expression literal can be confused with '/='." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node); + + if (token.type === "RegularExpression" && token.value[1] === "=") { + context.report({ + node, + messageId: "unexpected", + fix(fixer) { + return fixer.replaceTextRange([token.range[0] + 1, token.range[0] + 2], "[=]"); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-args.js b/node_modules/eslint/lib/rules/no-dupe-args.js new file mode 100644 index 0000000..c04ede5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-args.js @@ -0,0 +1,82 @@ +/** + * @fileoverview Rule to flag duplicate arguments + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow duplicate arguments in `function` definitions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-dupe-args" + }, + + schema: [], + + messages: { + unexpected: "Duplicate param '{{name}}'." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whether or not a given definition is a parameter's. + * @param {eslint-scope.DefEntry} def A definition to check. + * @returns {boolean} `true` if the definition is a parameter's. + */ + function isParameter(def) { + return def.type === "Parameter"; + } + + /** + * Determines if a given node has duplicate parameters. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkParams(node) { + const variables = sourceCode.getDeclaredVariables(node); + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + // Checks and reports duplications. + const defs = variable.defs.filter(isParameter); + + if (defs.length >= 2) { + context.report({ + node, + messageId: "unexpected", + data: { name: variable.name } + }); + } + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: checkParams, + FunctionExpression: checkParams + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-class-members.js b/node_modules/eslint/lib/rules/no-dupe-class-members.js new file mode 100644 index 0000000..c335532 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-class-members.js @@ -0,0 +1,104 @@ +/** + * @fileoverview A rule to disallow duplicate name in class members. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow duplicate class members", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-dupe-class-members" + }, + + schema: [], + + messages: { + unexpected: "Duplicate name '{{name}}'." + } + }, + + create(context) { + let stack = []; + + /** + * Gets state of a given member name. + * @param {string} name A name of a member. + * @param {boolean} isStatic A flag which specifies that is a static member. + * @returns {Object} A state of a given member name. + * - retv.init {boolean} A flag which shows the name is declared as normal member. + * - retv.get {boolean} A flag which shows the name is declared as getter. + * - retv.set {boolean} A flag which shows the name is declared as setter. + */ + function getState(name, isStatic) { + const stateMap = stack.at(-1); + const key = `$${name}`; // to avoid "__proto__". + + if (!stateMap[key]) { + stateMap[key] = { + nonStatic: { init: false, get: false, set: false }, + static: { init: false, get: false, set: false } + }; + } + + return stateMap[key][isStatic ? "static" : "nonStatic"]; + } + + return { + + // Initializes the stack of state of member declarations. + Program() { + stack = []; + }, + + // Initializes state of member declarations for the class. + ClassBody() { + stack.push(Object.create(null)); + }, + + // Disposes the state for the class. + "ClassBody:exit"() { + stack.pop(); + }, + + // Reports the node if its name has been declared already. + "MethodDefinition, PropertyDefinition"(node) { + const name = astUtils.getStaticPropertyName(node); + const kind = node.type === "MethodDefinition" ? node.kind : "field"; + + if (name === null || kind === "constructor") { + return; + } + + const state = getState(name, node.static); + let isDuplicate; + + if (kind === "get") { + isDuplicate = (state.init || state.get); + state.get = true; + } else if (kind === "set") { + isDuplicate = (state.init || state.set); + state.set = true; + } else { + isDuplicate = (state.init || state.get || state.set); + state.init = true; + } + + if (isDuplicate) { + context.report({ node, messageId: "unexpected", data: { name } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-else-if.js b/node_modules/eslint/lib/rules/no-dupe-else-if.js new file mode 100644 index 0000000..60f436d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-else-if.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to disallow duplicate conditions in if-else-if chains + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the first given array is a subset of the second given array. + * @param {Function} comparator A function to compare two elements, should return `true` if they are equal. + * @param {Array} arrA The array to compare from. + * @param {Array} arrB The array to compare against. + * @returns {boolean} `true` if the array `arrA` is a subset of the array `arrB`. + */ +function isSubsetByComparator(comparator, arrA, arrB) { + return arrA.every(a => arrB.some(b => comparator(a, b))); +} + +/** + * Splits the given node by the given logical operator. + * @param {string} operator Logical operator `||` or `&&`. + * @param {ASTNode} node The node to split. + * @returns {ASTNode[]} Array of conditions that makes the node when joined by the operator. + */ +function splitByLogicalOperator(operator, node) { + if (node.type === "LogicalExpression" && node.operator === operator) { + return [...splitByLogicalOperator(operator, node.left), ...splitByLogicalOperator(operator, node.right)]; + } + return [node]; +} + +const splitByOr = splitByLogicalOperator.bind(null, "||"); +const splitByAnd = splitByLogicalOperator.bind(null, "&&"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow duplicate conditions in if-else-if chains", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-dupe-else-if" + }, + + schema: [], + + messages: { + unexpected: "This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Determines whether the two given nodes are considered to be equal. In particular, given that the nodes + * represent expressions in a boolean context, `||` and `&&` can be considered as commutative operators. + * @param {ASTNode} a First node. + * @param {ASTNode} b Second node. + * @returns {boolean} `true` if the nodes are considered to be equal. + */ + function equal(a, b) { + if (a.type !== b.type) { + return false; + } + + if ( + a.type === "LogicalExpression" && + (a.operator === "||" || a.operator === "&&") && + a.operator === b.operator + ) { + return equal(a.left, b.left) && equal(a.right, b.right) || + equal(a.left, b.right) && equal(a.right, b.left); + } + + return astUtils.equalTokens(a, b, sourceCode); + } + + const isSubset = isSubsetByComparator.bind(null, equal); + + return { + IfStatement(node) { + const test = node.test, + conditionsToCheck = test.type === "LogicalExpression" && test.operator === "&&" + ? [test, ...splitByAnd(test)] + : [test]; + let current = node, + listToCheck = conditionsToCheck.map(c => splitByOr(c).map(splitByAnd)); + + while (current.parent && current.parent.type === "IfStatement" && current.parent.alternate === current) { + current = current.parent; + + const currentOrOperands = splitByOr(current.test).map(splitByAnd); + + listToCheck = listToCheck.map(orOperands => orOperands.filter( + orOperand => !currentOrOperands.some(currentOrOperand => isSubset(currentOrOperand, orOperand)) + )); + + if (listToCheck.some(orOperands => orOperands.length === 0)) { + context.report({ node: test, messageId: "unexpected" }); + break; + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-keys.js b/node_modules/eslint/lib/rules/no-dupe-keys.js new file mode 100644 index 0000000..980b004 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-keys.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Rule to flag use of duplicate keys in an object. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const GET_KIND = /^(?:init|get)$/u; +const SET_KIND = /^(?:init|set)$/u; + +/** + * The class which stores properties' information of an object. + */ +class ObjectInfo { + + /** + * @param {ObjectInfo|null} upper The information of the outer object. + * @param {ASTNode} node The ObjectExpression node of this information. + */ + constructor(upper, node) { + this.upper = upper; + this.node = node; + this.properties = new Map(); + } + + /** + * Gets the information of the given Property node. + * @param {ASTNode} node The Property node to get. + * @returns {{get: boolean, set: boolean}} The information of the property. + */ + getPropertyInfo(node) { + const name = astUtils.getStaticPropertyName(node); + + if (!this.properties.has(name)) { + this.properties.set(name, { get: false, set: false }); + } + return this.properties.get(name); + } + + /** + * Checks whether the given property has been defined already or not. + * @param {ASTNode} node The Property node to check. + * @returns {boolean} `true` if the property has been defined. + */ + isPropertyDefined(node) { + const entry = this.getPropertyInfo(node); + + return ( + (GET_KIND.test(node.kind) && entry.get) || + (SET_KIND.test(node.kind) && entry.set) + ); + } + + /** + * Defines the given property. + * @param {ASTNode} node The Property node to define. + * @returns {void} + */ + defineProperty(node) { + const entry = this.getPropertyInfo(node); + + if (GET_KIND.test(node.kind)) { + entry.get = true; + } + if (SET_KIND.test(node.kind)) { + entry.set = true; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow duplicate keys in object literals", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-dupe-keys" + }, + + schema: [], + + messages: { + unexpected: "Duplicate key '{{name}}'." + } + }, + + create(context) { + let info = null; + + return { + ObjectExpression(node) { + info = new ObjectInfo(info, node); + }, + "ObjectExpression:exit"() { + info = info.upper; + }, + + Property(node) { + const name = astUtils.getStaticPropertyName(node); + + // Skip destructuring. + if (node.parent.type !== "ObjectExpression") { + return; + } + + // Skip if the name is not static. + if (name === null) { + return; + } + + // Reports if the name is defined already. + if (info.isPropertyDefined(node)) { + context.report({ + node: info.node, + loc: node.key.loc, + messageId: "unexpected", + data: { name } + }); + } + + // Update info. + info.defineProperty(node); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-duplicate-case.js b/node_modules/eslint/lib/rules/no-duplicate-case.js new file mode 100644 index 0000000..839f357 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-duplicate-case.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Rule to disallow a duplicate case label. + * @author Dieter Oberkofler + * @author Burak Yigit Kaya + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow duplicate case labels", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-duplicate-case" + }, + + schema: [], + + messages: { + unexpected: "Duplicate case label." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Determines whether the two given nodes are considered to be equal. + * @param {ASTNode} a First node. + * @param {ASTNode} b Second node. + * @returns {boolean} `true` if the nodes are considered to be equal. + */ + function equal(a, b) { + if (a.type !== b.type) { + return false; + } + + return astUtils.equalTokens(a, b, sourceCode); + } + return { + SwitchStatement(node) { + const previousTests = []; + + for (const switchCase of node.cases) { + if (switchCase.test) { + const test = switchCase.test; + + if (previousTests.some(previousTest => equal(previousTest, test))) { + context.report({ node: switchCase, messageId: "unexpected" }); + } else { + previousTests.push(test); + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-duplicate-imports.js b/node_modules/eslint/lib/rules/no-duplicate-imports.js new file mode 100644 index 0000000..1bc52cf --- /dev/null +++ b/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -0,0 +1,293 @@ +/** + * @fileoverview Restrict usage of duplicate imports. + * @author Simen Bekkhus + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const NAMED_TYPES = ["ImportSpecifier", "ExportSpecifier"]; +const NAMESPACE_TYPES = [ + "ImportNamespaceSpecifier", + "ExportNamespaceSpecifier" +]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Check if an import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier). + * @param {string} importExportType An import/export type to check. + * @param {string} type Can be "named" or "namespace" + * @returns {boolean} True if import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier) and false if it doesn't. + */ +function isImportExportSpecifier(importExportType, type) { + const arrayToCheck = type === "named" ? NAMED_TYPES : NAMESPACE_TYPES; + + return arrayToCheck.includes(importExportType); +} + +/** + * Return the type of (import|export). + * @param {ASTNode} node A node to get. + * @returns {string} The type of the (import|export). + */ +function getImportExportType(node) { + if (node.specifiers && node.specifiers.length > 0) { + const nodeSpecifiers = node.specifiers; + const index = nodeSpecifiers.findIndex( + ({ type }) => + isImportExportSpecifier(type, "named") || + isImportExportSpecifier(type, "namespace") + ); + const i = index > -1 ? index : 0; + + return nodeSpecifiers[i].type; + } + if (node.type === "ExportAllDeclaration") { + if (node.exported) { + return "ExportNamespaceSpecifier"; + } + return "ExportAll"; + } + return "SideEffectImport"; +} + +/** + * Returns a boolean indicates if two (import|export) can be merged + * @param {ASTNode} node1 A node to check. + * @param {ASTNode} node2 A node to check. + * @returns {boolean} True if two (import|export) can be merged, false if they can't. + */ +function isImportExportCanBeMerged(node1, node2) { + const importExportType1 = getImportExportType(node1); + const importExportType2 = getImportExportType(node2); + + if ( + (importExportType1 === "ExportAll" && + importExportType2 !== "ExportAll" && + importExportType2 !== "SideEffectImport") || + (importExportType1 !== "ExportAll" && + importExportType1 !== "SideEffectImport" && + importExportType2 === "ExportAll") + ) { + return false; + } + if ( + (isImportExportSpecifier(importExportType1, "namespace") && + isImportExportSpecifier(importExportType2, "named")) || + (isImportExportSpecifier(importExportType2, "namespace") && + isImportExportSpecifier(importExportType1, "named")) + ) { + return false; + } + return true; +} + +/** + * Returns a boolean if we should report (import|export). + * @param {ASTNode} node A node to be reported or not. + * @param {[ASTNode]} previousNodes An array contains previous nodes of the module imported or exported. + * @returns {boolean} True if the (import|export) should be reported. + */ +function shouldReportImportExport(node, previousNodes) { + let i = 0; + + while (i < previousNodes.length) { + if (isImportExportCanBeMerged(node, previousNodes[i])) { + return true; + } + i++; + } + return false; +} + +/** + * Returns array contains only nodes with declarations types equal to type. + * @param {[{node: ASTNode, declarationType: string}]} nodes An array contains objects, each object contains a node and a declaration type. + * @param {string} type Declaration type. + * @returns {[ASTNode]} An array contains only nodes with declarations types equal to type. + */ +function getNodesByDeclarationType(nodes, type) { + return nodes + .filter(({ declarationType }) => declarationType === type) + .map(({ node }) => node); +} + +/** + * Returns the name of the module imported or re-exported. + * @param {ASTNode} node A node to get. + * @returns {string} The name of the module, or empty string if no name. + */ +function getModule(node) { + if (node && node.source && node.source.value) { + return node.source.value.trim(); + } + return ""; +} + +/** + * Checks if the (import|export) can be merged with at least one import or one export, and reports if so. + * @param {RuleContext} context The ESLint rule context object. + * @param {ASTNode} node A node to get. + * @param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type. + * @param {string} declarationType A declaration type can be an import or export. + * @param {boolean} includeExports Whether or not to check for exports in addition to imports. + * @returns {void} No return value. + */ +function checkAndReport( + context, + node, + modules, + declarationType, + includeExports +) { + const module = getModule(node); + + if (modules.has(module)) { + const previousNodes = modules.get(module); + const messagesIds = []; + const importNodes = getNodesByDeclarationType(previousNodes, "import"); + let exportNodes; + + if (includeExports) { + exportNodes = getNodesByDeclarationType(previousNodes, "export"); + } + if (declarationType === "import") { + if (shouldReportImportExport(node, importNodes)) { + messagesIds.push("import"); + } + if (includeExports) { + if (shouldReportImportExport(node, exportNodes)) { + messagesIds.push("importAs"); + } + } + } else if (declarationType === "export") { + if (shouldReportImportExport(node, exportNodes)) { + messagesIds.push("export"); + } + if (shouldReportImportExport(node, importNodes)) { + messagesIds.push("exportAs"); + } + } + messagesIds.forEach(messageId => + context.report({ + node, + messageId, + data: { + module + } + })); + } +} + +/** + * @callback nodeCallback + * @param {ASTNode} node A node to handle. + */ + +/** + * Returns a function handling the (imports|exports) of a given file + * @param {RuleContext} context The ESLint rule context object. + * @param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type. + * @param {string} declarationType A declaration type can be an import or export. + * @param {boolean} includeExports Whether or not to check for exports in addition to imports. + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleImportsExports( + context, + modules, + declarationType, + includeExports +) { + return function(node) { + const module = getModule(node); + + if (module) { + checkAndReport( + context, + node, + modules, + declarationType, + includeExports + ); + const currentNode = { node, declarationType }; + let nodes = [currentNode]; + + if (modules.has(module)) { + const previousNodes = modules.get(module); + + nodes = [...previousNodes, currentNode]; + } + modules.set(module, nodes); + } + }; +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + includeExports: false + }], + + docs: { + description: "Disallow duplicate module imports", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-duplicate-imports" + }, + + schema: [ + { + type: "object", + properties: { + includeExports: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + import: "'{{module}}' import is duplicated.", + importAs: "'{{module}}' import is duplicated as export.", + export: "'{{module}}' export is duplicated.", + exportAs: "'{{module}}' export is duplicated as import." + } + }, + + create(context) { + const [{ includeExports }] = context.options; + const modules = new Map(); + const handlers = { + ImportDeclaration: handleImportsExports( + context, + modules, + "import", + includeExports + ) + }; + + if (includeExports) { + handlers.ExportNamedDeclaration = handleImportsExports( + context, + modules, + "export", + includeExports + ); + handlers.ExportAllDeclaration = handleImportsExports( + context, + modules, + "export", + includeExports + ); + } + return handlers; + } +}; diff --git a/node_modules/eslint/lib/rules/no-else-return.js b/node_modules/eslint/lib/rules/no-else-return.js new file mode 100644 index 0000000..e4653d4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-else-return.js @@ -0,0 +1,405 @@ +/** + * @fileoverview Rule to flag `else` after a `return` in `if` + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const FixTracker = require("./utils/fix-tracker"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ allowElseIf: true }], + + docs: { + description: "Disallow `else` blocks after `return` statements in `if` statements", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-else-return" + }, + + schema: [{ + type: "object", + properties: { + allowElseIf: { + type: "boolean" + } + }, + additionalProperties: false + }], + + fixable: "code", + + messages: { + unexpected: "Unnecessary 'else' after 'return'." + } + }, + + create(context) { + const [{ allowElseIf }] = context.options; + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whether the given names can be safely used to declare block-scoped variables + * in the given scope. Name collisions can produce redeclaration syntax errors, + * or silently change references and modify behavior of the original code. + * + * This is not a generic function. In particular, it is assumed that the scope is a function scope or + * a function's inner scope, and that the names can be valid identifiers in the given scope. + * @param {string[]} names Array of variable names. + * @param {eslint-scope.Scope} scope Function scope or a function's inner scope. + * @returns {boolean} True if all names can be safely declared, false otherwise. + */ + function isSafeToDeclare(names, scope) { + + if (names.length === 0) { + return true; + } + + const functionScope = scope.variableScope; + + /* + * If this is a function scope, scope.variables will contain parameters, implicit variables such as "arguments", + * all function-scoped variables ('var'), and block-scoped variables defined in the scope. + * If this is an inner scope, scope.variables will contain block-scoped variables defined in the scope. + * + * Redeclaring any of these would cause a syntax error, except for the implicit variables. + */ + const declaredVariables = scope.variables.filter(({ defs }) => defs.length > 0); + + if (declaredVariables.some(({ name }) => names.includes(name))) { + return false; + } + + // Redeclaring a catch variable would also cause a syntax error. + if (scope !== functionScope && scope.upper.type === "catch") { + if (scope.upper.variables.some(({ name }) => names.includes(name))) { + return false; + } + } + + /* + * Redeclaring an implicit variable, such as "arguments", would not cause a syntax error. + * However, if the variable was used, declaring a new one with the same name would change references + * and modify behavior. + */ + const usedImplicitVariables = scope.variables.filter(({ defs, references }) => + defs.length === 0 && references.length > 0); + + if (usedImplicitVariables.some(({ name }) => names.includes(name))) { + return false; + } + + /* + * Declaring a variable with a name that was already used to reference a variable from an upper scope + * would change references and modify behavior. + */ + if (scope.through.some(t => names.includes(t.identifier.name))) { + return false; + } + + /* + * If the scope is an inner scope (not the function scope), an uninitialized `var` variable declared inside + * the scope node (directly or in one of its descendants) is neither declared nor 'through' in the scope. + * + * For example, this would be a syntax error "Identifier 'a' has already been declared": + * function foo() { if (bar) { let a; if (baz) { var a; } } } + */ + if (scope !== functionScope) { + const scopeNodeRange = scope.block.range; + const variablesToCheck = functionScope.variables.filter(({ name }) => names.includes(name)); + + if (variablesToCheck.some(v => v.defs.some(({ node: { range } }) => + scopeNodeRange[0] <= range[0] && range[1] <= scopeNodeRange[1]))) { + return false; + } + } + + return true; + } + + + /** + * Checks whether the removal of `else` and its braces is safe from variable name collisions. + * @param {Node} node The 'else' node. + * @param {eslint-scope.Scope} scope The scope in which the node and the whole 'if' statement is. + * @returns {boolean} True if it is safe, false otherwise. + */ + function isSafeFromNameCollisions(node, scope) { + + if (node.type === "FunctionDeclaration") { + + // Conditional function declaration. Scope and hoisting are unpredictable, different engines work differently. + return false; + } + + if (node.type !== "BlockStatement") { + return true; + } + + const elseBlockScope = scope.childScopes.find(({ block }) => block === node); + + if (!elseBlockScope) { + + // ecmaVersion < 6, `else` block statement cannot have its own scope, no possible collisions. + return true; + } + + /* + * elseBlockScope is supposed to merge into its upper scope. elseBlockScope.variables array contains + * only block-scoped variables (such as let and const variables or class and function declarations) + * defined directly in the elseBlockScope. These are exactly the only names that could cause collisions. + */ + const namesToCheck = elseBlockScope.variables.map(({ name }) => name); + + return isSafeToDeclare(namesToCheck, scope); + } + + /** + * Display the context report if rule is violated + * @param {Node} elseNode The 'else' node + * @returns {void} + */ + function displayReport(elseNode) { + const currentScope = sourceCode.getScope(elseNode.parent); + + context.report({ + node: elseNode, + messageId: "unexpected", + fix(fixer) { + + if (!isSafeFromNameCollisions(elseNode, currentScope)) { + return null; + } + + const startToken = sourceCode.getFirstToken(elseNode); + const elseToken = sourceCode.getTokenBefore(startToken); + const source = sourceCode.getText(elseNode); + const lastIfToken = sourceCode.getTokenBefore(elseToken); + let fixedSource, firstTokenOfElseBlock; + + if (startToken.type === "Punctuator" && startToken.value === "{") { + firstTokenOfElseBlock = sourceCode.getTokenAfter(startToken); + } else { + firstTokenOfElseBlock = startToken; + } + + /* + * If the if block does not have curly braces and does not end in a semicolon + * and the else block starts with (, [, /, +, ` or -, then it is not + * safe to remove the else keyword, because ASI will not add a semicolon + * after the if block + */ + const ifBlockMaybeUnsafe = elseNode.parent.consequent.type !== "BlockStatement" && lastIfToken.value !== ";"; + const elseBlockUnsafe = /^[([/+`-]/u.test(firstTokenOfElseBlock.value); + + if (ifBlockMaybeUnsafe && elseBlockUnsafe) { + return null; + } + + const endToken = sourceCode.getLastToken(elseNode); + const lastTokenOfElseBlock = sourceCode.getTokenBefore(endToken); + + if (lastTokenOfElseBlock.value !== ";") { + const nextToken = sourceCode.getTokenAfter(endToken); + + const nextTokenUnsafe = nextToken && /^[([/+`-]/u.test(nextToken.value); + const nextTokenOnSameLine = nextToken && nextToken.loc.start.line === lastTokenOfElseBlock.loc.start.line; + + /* + * If the else block contents does not end in a semicolon, + * and the else block starts with (, [, /, +, ` or -, then it is not + * safe to remove the else block, because ASI will not add a semicolon + * after the remaining else block contents + */ + if (nextTokenUnsafe || (nextTokenOnSameLine && nextToken.value !== "}")) { + return null; + } + } + + if (startToken.type === "Punctuator" && startToken.value === "{") { + fixedSource = source.slice(1, -1); + } else { + fixedSource = source; + } + + /* + * Extend the replacement range to include the entire + * function to avoid conflicting with no-useless-return. + * https://github.com/eslint/eslint/issues/8026 + * + * Also, to avoid name collisions between two else blocks. + */ + return new FixTracker(fixer, sourceCode) + .retainEnclosingFunction(elseNode) + .replaceTextRange([elseToken.range[0], elseNode.range[1]], fixedSource); + } + }); + } + + /** + * Check to see if the node is a ReturnStatement + * @param {Node} node The node being evaluated + * @returns {boolean} True if node is a return + */ + function checkForReturn(node) { + return node.type === "ReturnStatement"; + } + + /** + * Naive return checking, does not iterate through the whole + * BlockStatement because we make the assumption that the ReturnStatement + * will be the last node in the body of the BlockStatement. + * @param {Node} node The consequent/alternate node + * @returns {boolean} True if it has a return + */ + function naiveHasReturn(node) { + if (node.type === "BlockStatement") { + const body = node.body, + lastChildNode = body.at(-1); + + return lastChildNode && checkForReturn(lastChildNode); + } + return checkForReturn(node); + } + + /** + * Check to see if the node is valid for evaluation, + * meaning it has an else. + * @param {Node} node The node being evaluated + * @returns {boolean} True if the node is valid + */ + function hasElse(node) { + return node.alternate && node.consequent; + } + + /** + * If the consequent is an IfStatement, check to see if it has an else + * and both its consequent and alternate path return, meaning this is + * a nested case of rule violation. If-Else not considered currently. + * @param {Node} node The consequent node + * @returns {boolean} True if this is a nested rule violation + */ + function checkForIf(node) { + return node.type === "IfStatement" && hasElse(node) && + naiveHasReturn(node.alternate) && naiveHasReturn(node.consequent); + } + + /** + * Check the consequent/body node to make sure it is not + * a ReturnStatement or an IfStatement that returns on both + * code paths. + * @param {Node} node The consequent or body node + * @returns {boolean} `true` if it is a Return/If node that always returns. + */ + function checkForReturnOrIf(node) { + return checkForReturn(node) || checkForIf(node); + } + + + /** + * Check whether a node returns in every codepath. + * @param {Node} node The node to be checked + * @returns {boolean} `true` if it returns on every codepath. + */ + function alwaysReturns(node) { + if (node.type === "BlockStatement") { + + // If we have a BlockStatement, check each consequent body node. + return node.body.some(checkForReturnOrIf); + } + + /* + * If not a block statement, make sure the consequent isn't a + * ReturnStatement or an IfStatement with returns on both paths. + */ + return checkForReturnOrIf(node); + } + + + /** + * Check the if statement, but don't catch else-if blocks. + * @returns {void} + * @param {Node} node The node for the if statement to check + * @private + */ + function checkIfWithoutElse(node) { + const parent = node.parent; + + /* + * Fixing this would require splitting one statement into two, so no error should + * be reported if this node is in a position where only one statement is allowed. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) { + return; + } + + const consequents = []; + let alternate; + + for (let currentNode = node; currentNode.type === "IfStatement"; currentNode = currentNode.alternate) { + if (!currentNode.alternate) { + return; + } + consequents.push(currentNode.consequent); + alternate = currentNode.alternate; + } + + if (consequents.every(alwaysReturns)) { + displayReport(alternate); + } + } + + /** + * Check the if statement + * @returns {void} + * @param {Node} node The node for the if statement to check + * @private + */ + function checkIfWithElse(node) { + const parent = node.parent; + + + /* + * Fixing this would require splitting one statement into two, so no error should + * be reported if this node is in a position where only one statement is allowed. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) { + return; + } + + const alternate = node.alternate; + + if (alternate && alwaysReturns(node.consequent)) { + displayReport(alternate); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + "IfStatement:exit": allowElseIf ? checkIfWithoutElse : checkIfWithElse + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-character-class.js b/node_modules/eslint/lib/rules/no-empty-character-class.js new file mode 100644 index 0000000..5c84102 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-character-class.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag the use of empty character classes in regular expressions + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new RegExpParser(); +const QUICK_TEST_REGEX = /\[\]/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow empty character classes in regular expressions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-empty-character-class" + }, + + schema: [], + + messages: { + unexpected: "Empty class." + } + }, + + create(context) { + return { + "Literal[regex]"(node) { + const { pattern, flags } = node.regex; + + if (!QUICK_TEST_REGEX.test(pattern)) { + return; + } + + let regExpAST; + + try { + regExpAST = parser.parsePattern(pattern, 0, pattern.length, { + unicode: flags.includes("u"), + unicodeSets: flags.includes("v") + }); + } catch { + + // Ignore regular expressions that regexpp cannot parse + return; + } + + visitRegExpAST(regExpAST, { + onCharacterClassEnter(characterClass) { + if (!characterClass.negate && characterClass.elements.length === 0) { + context.report({ node, messageId: "unexpected" }); + } + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-function.js b/node_modules/eslint/lib/rules/no-empty-function.js new file mode 100644 index 0000000..16e611b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-function.js @@ -0,0 +1,167 @@ +/** + * @fileoverview Rule to disallow empty functions. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const ALLOW_OPTIONS = Object.freeze([ + "functions", + "arrowFunctions", + "generatorFunctions", + "methods", + "generatorMethods", + "getters", + "setters", + "constructors", + "asyncFunctions", + "asyncMethods" +]); + +/** + * Gets the kind of a given function node. + * @param {ASTNode} node A function node to get. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {string} The kind of the function. This is one of "functions", + * "arrowFunctions", "generatorFunctions", "asyncFunctions", "methods", + * "generatorMethods", "asyncMethods", "getters", "setters", and + * "constructors". + */ +function getKind(node) { + const parent = node.parent; + let kind; + + if (node.type === "ArrowFunctionExpression") { + return "arrowFunctions"; + } + + // Detects main kind. + if (parent.type === "Property") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + kind = parent.method ? "methods" : "functions"; + + } else if (parent.type === "MethodDefinition") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + if (parent.kind === "constructor") { + return "constructors"; + } + kind = "methods"; + + } else { + kind = "functions"; + } + + // Detects prefix. + let prefix; + + if (node.generator) { + prefix = "generator"; + } else if (node.async) { + prefix = "async"; + } else { + return kind; + } + return prefix + kind[0].toUpperCase() + kind.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ allow: [] }], + + docs: { + description: "Disallow empty functions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-empty-function" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { enum: ALLOW_OPTIONS }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected empty {{name}}." + } + }, + + create(context) { + const [{ allow }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Reports a given function node if the node matches the following patterns. + * + * - Not allowed by options. + * - The body is empty. + * - The body doesn't have any comments. + * @param {ASTNode} node A function node to report. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {void} + */ + function reportIfEmpty(node) { + const kind = getKind(node); + const name = astUtils.getFunctionNameWithKind(node); + const innerComments = sourceCode.getTokens(node.body, { + includeComments: true, + filter: astUtils.isCommentToken + }); + + if (!allow.includes(kind) && + node.body.type === "BlockStatement" && + node.body.body.length === 0 && + innerComments.length === 0 + ) { + context.report({ + node, + loc: node.body.loc, + messageId: "unexpected", + data: { name } + }); + } + } + + return { + ArrowFunctionExpression: reportIfEmpty, + FunctionDeclaration: reportIfEmpty, + FunctionExpression: reportIfEmpty + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-pattern.js b/node_modules/eslint/lib/rules/no-empty-pattern.js new file mode 100644 index 0000000..eb81d8a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-pattern.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to disallow an empty pattern + * @author Alberto Rodríguez + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + allowObjectPatternsAsParameters: false + }], + + docs: { + description: "Disallow empty destructuring patterns", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-empty-pattern" + }, + + schema: [ + { + type: "object", + properties: { + allowObjectPatternsAsParameters: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected empty {{type}} pattern." + } + }, + + create(context) { + const [{ allowObjectPatternsAsParameters }] = context.options; + + return { + ObjectPattern(node) { + + if (node.properties.length > 0) { + return; + } + + // Allow {} and {} = {} empty object patterns as parameters when allowObjectPatternsAsParameters is true + if ( + allowObjectPatternsAsParameters && + ( + astUtils.isFunction(node.parent) || + ( + node.parent.type === "AssignmentPattern" && + astUtils.isFunction(node.parent.parent) && + node.parent.right.type === "ObjectExpression" && + node.parent.right.properties.length === 0 + ) + ) + ) { + return; + } + + context.report({ node, messageId: "unexpected", data: { type: "object" } }); + }, + ArrayPattern(node) { + if (node.elements.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "array" } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-static-block.js b/node_modules/eslint/lib/rules/no-empty-static-block.js new file mode 100644 index 0000000..558c4fa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-static-block.js @@ -0,0 +1,47 @@ +/** + * @fileoverview Rule to disallow empty static blocks. + * @author Sosuke Suzuki + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow empty static blocks", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-empty-static-block" + }, + + schema: [], + + messages: { + unexpected: "Unexpected empty static block." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + StaticBlock(node) { + if (node.body.length === 0) { + const closingBrace = sourceCode.getLastToken(node); + + if (sourceCode.getCommentsBefore(closingBrace).length === 0) { + context.report({ + node, + messageId: "unexpected" + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty.js b/node_modules/eslint/lib/rules/no-empty.js new file mode 100644 index 0000000..b5df621 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty.js @@ -0,0 +1,104 @@ +/** + * @fileoverview Rule to flag use of an empty block statement + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + hasSuggestions: true, + type: "suggestion", + + defaultOptions: [{ + allowEmptyCatch: false + }], + + docs: { + description: "Disallow empty block statements", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-empty" + }, + + schema: [ + { + type: "object", + properties: { + allowEmptyCatch: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Empty {{type}} statement.", + suggestComment: "Add comment inside empty {{type}} statement." + } + }, + + create(context) { + const [{ allowEmptyCatch }] = context.options; + const sourceCode = context.sourceCode; + + return { + BlockStatement(node) { + + // if the body is not empty, we can just return immediately + if (node.body.length !== 0) { + return; + } + + // a function is generally allowed to be empty + if (astUtils.isFunction(node.parent)) { + return; + } + + if (allowEmptyCatch && node.parent.type === "CatchClause") { + return; + } + + // any other block is only allowed to be empty, if it contains a comment + if (sourceCode.getCommentsInside(node).length > 0) { + return; + } + + context.report({ + node, + messageId: "unexpected", + data: { type: "block" }, + suggest: [ + { + messageId: "suggestComment", + data: { type: "block" }, + fix(fixer) { + const range = [node.range[0] + 1, node.range[1] - 1]; + + return fixer.replaceTextRange(range, " /* empty */ "); + } + } + ] + }); + }, + + SwitchStatement(node) { + + if (typeof node.cases === "undefined" || node.cases.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "switch" } }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-eq-null.js b/node_modules/eslint/lib/rules/no-eq-null.js new file mode 100644 index 0000000..9252907 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-eq-null.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Rule to flag comparisons to null without a type-checking + * operator. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `null` comparisons without type-checking operators", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-eq-null" + }, + + schema: [], + + messages: { + unexpected: "Use '===' to compare with null." + } + }, + + create(context) { + + return { + + BinaryExpression(node) { + const badOperator = node.operator === "==" || node.operator === "!="; + + if (node.right.type === "Literal" && node.right.raw === "null" && badOperator || + node.left.type === "Literal" && node.left.raw === "null" && badOperator) { + context.report({ node, messageId: "unexpected" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-eval.js b/node_modules/eslint/lib/rules/no-eval.js new file mode 100644 index 0000000..bb35d4e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-eval.js @@ -0,0 +1,287 @@ +/** + * @fileoverview Rule to flag use of eval() statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const candidatesOfGlobalObject = Object.freeze([ + "global", + "window", + "globalThis" +]); + +/** + * Checks a given node is a MemberExpression node which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. + * @returns {boolean} `true` if the node is a MemberExpression node which has + * the specified name's property + */ +function isMember(node, name) { + return astUtils.isSpecificMemberAccess(node, null, name); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allowIndirect: false + }], + + docs: { + description: "Disallow the use of `eval()`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-eval" + }, + + schema: [ + { + type: "object", + properties: { + allowIndirect: { type: "boolean" } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "eval can be harmful." + } + }, + + create(context) { + const [{ allowIndirect }] = context.options; + const sourceCode = context.sourceCode; + let funcInfo = null; + + /** + * Pushes a `this` scope (non-arrow function, class static block, or class field initializer) information to the stack. + * Top-level scopes are handled separately. + * + * This is used in order to check whether or not `this` binding is a + * reference to the global object. + * @param {ASTNode} node A node of the scope. + * For functions, this is one of FunctionDeclaration, FunctionExpression. + * For class static blocks, this is StaticBlock. + * For class field initializers, this can be any node that is PropertyDefinition#value. + * @returns {void} + */ + function enterThisScope(node) { + const strict = sourceCode.getScope(node).isStrict; + + funcInfo = { + upper: funcInfo, + node, + strict, + isTopLevelOfScript: false, + defaultThis: false, + initialized: strict + }; + } + + /** + * Pops a variable scope from the stack. + * @returns {void} + */ + function exitThisScope() { + funcInfo = funcInfo.upper; + } + + /** + * Reports a given node. + * + * `node` is `Identifier` or `MemberExpression`. + * The parent of `node` might be `CallExpression`. + * + * The location of the report is always `eval` `Identifier` (or possibly + * `Literal`). The type of the report is `CallExpression` if the parent is + * `CallExpression`. Otherwise, it's the given node type. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function report(node) { + const parent = node.parent; + const locationNode = node.type === "MemberExpression" + ? node.property + : node; + + const reportNode = parent.type === "CallExpression" && parent.callee === node + ? parent + : node; + + context.report({ + node: reportNode, + loc: locationNode.loc, + messageId: "unexpected" + }); + } + + /** + * Reports accesses of `eval` via the global object. + * @param {eslint-scope.Scope} globalScope The global scope. + * @returns {void} + */ + function reportAccessingEvalViaGlobalObject(globalScope) { + for (let i = 0; i < candidatesOfGlobalObject.length; ++i) { + const name = candidatesOfGlobalObject[i]; + const variable = astUtils.getVariableByName(globalScope, name); + + if (!variable) { + continue; + } + + const references = variable.references; + + for (let j = 0; j < references.length; ++j) { + const identifier = references[j].identifier; + let node = identifier.parent; + + // To detect code like `window.window.eval`. + while (isMember(node, name)) { + node = node.parent; + } + + // Reports. + if (isMember(node, "eval")) { + report(node); + } + } + } + } + + /** + * Reports all accesses of `eval` (excludes direct calls to eval). + * @param {eslint-scope.Scope} globalScope The global scope. + * @returns {void} + */ + function reportAccessingEval(globalScope) { + const variable = astUtils.getVariableByName(globalScope, "eval"); + + if (!variable) { + return; + } + + const references = variable.references; + + for (let i = 0; i < references.length; ++i) { + const reference = references[i]; + const id = reference.identifier; + + if (id.name === "eval" && !astUtils.isCallee(id)) { + + // Is accessing to eval (excludes direct calls to eval) + report(id); + } + } + } + + if (allowIndirect) { + + // Checks only direct calls to eval. It's simple! + return { + "CallExpression:exit"(node) { + const callee = node.callee; + + /* + * Optional call (`eval?.("code")`) is not direct eval. + * The direct eval is only step 6.a.vi of https://tc39.es/ecma262/#sec-function-calls-runtime-semantics-evaluation + * But the optional call is https://tc39.es/ecma262/#sec-optional-chaining-chain-evaluation + */ + if (!node.optional && astUtils.isSpecificId(callee, "eval")) { + report(callee); + } + } + }; + } + + return { + "CallExpression:exit"(node) { + const callee = node.callee; + + if (astUtils.isSpecificId(callee, "eval")) { + report(callee); + } + }, + + Program(node) { + const scope = sourceCode.getScope(node), + features = context.parserOptions.ecmaFeatures || {}, + strict = + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict), + isTopLevelOfScript = node.sourceType !== "module" && !features.globalReturn; + + funcInfo = { + upper: null, + node, + strict, + isTopLevelOfScript, + defaultThis: true, + initialized: true + }; + }, + + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + + exitThisScope(); + reportAccessingEval(globalScope); + reportAccessingEvalViaGlobalObject(globalScope); + }, + + FunctionDeclaration: enterThisScope, + "FunctionDeclaration:exit": exitThisScope, + FunctionExpression: enterThisScope, + "FunctionExpression:exit": exitThisScope, + "PropertyDefinition > *.value": enterThisScope, + "PropertyDefinition > *.value:exit": exitThisScope, + StaticBlock: enterThisScope, + "StaticBlock:exit": exitThisScope, + + ThisExpression(node) { + if (!isMember(node.parent, "eval")) { + return; + } + + /* + * `this.eval` is found. + * Checks whether or not the value of `this` is the global object. + */ + if (!funcInfo.initialized) { + funcInfo.initialized = true; + funcInfo.defaultThis = astUtils.isDefaultThisBinding( + funcInfo.node, + sourceCode + ); + } + + // `this` at the top level of scripts always refers to the global object + if (funcInfo.isTopLevelOfScript || (!funcInfo.strict && funcInfo.defaultThis)) { + + // `this.eval` is possible built-in `eval`. + report(node.parent); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-ex-assign.js b/node_modules/eslint/lib/rules/no-ex-assign.js new file mode 100644 index 0000000..d0e9feb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-ex-assign.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Rule to flag assignment of the exception parameter + * @author Stephen Murray + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow reassigning exceptions in `catch` clauses", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-ex-assign" + }, + + schema: [], + + messages: { + unexpected: "Do not assign to the exception parameter." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "unexpected" }); + }); + } + + return { + CatchClause(node) { + sourceCode.getDeclaredVariables(node).forEach(checkVariable); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extend-native.js b/node_modules/eslint/lib/rules/no-extend-native.js new file mode 100644 index 0000000..7164c09 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extend-native.js @@ -0,0 +1,178 @@ +/** + * @fileoverview Rule to flag adding properties to native object's prototypes. + * @author David Nelson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ exceptions: [] }], + + docs: { + description: "Disallow extending native types", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-extend-native" + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "{{builtin}} prototype is read only, properties should not be added." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const exceptions = new Set(context.options[0].exceptions); + const modifiedBuiltins = new Set( + Object.keys(astUtils.ECMASCRIPT_GLOBALS) + .filter(builtin => builtin[0].toUpperCase() === builtin[0]) + .filter(builtin => !exceptions.has(builtin)) + ); + + /** + * Reports a lint error for the given node. + * @param {ASTNode} node The node to report. + * @param {string} builtin The name of the native builtin being extended. + * @returns {void} + */ + function reportNode(node, builtin) { + context.report({ + node, + messageId: "unexpected", + data: { + builtin + } + }); + } + + /** + * Check to see if the `prototype` property of the given object + * identifier node is being accessed. + * @param {ASTNode} identifierNode The Identifier representing the object + * to check. + * @returns {boolean} True if the identifier is the object of a + * MemberExpression and its `prototype` property is being accessed, + * false otherwise. + */ + function isPrototypePropertyAccessed(identifierNode) { + return Boolean( + identifierNode && + identifierNode.parent && + identifierNode.parent.type === "MemberExpression" && + identifierNode.parent.object === identifierNode && + astUtils.getStaticPropertyName(identifierNode.parent) === "prototype" + ); + } + + /** + * Check if it's an assignment to the property of the given node. + * Example: `*.prop = 0` // the `*` is the given node. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if an assignment to the property of the node. + */ + function isAssigningToPropertyOf(node) { + return ( + node.parent.type === "MemberExpression" && + node.parent.object === node && + node.parent.parent.type === "AssignmentExpression" && + node.parent.parent.left === node.parent + ); + } + + /** + * Checks if the given node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`. + */ + function isInDefinePropertyCall(node) { + return ( + node.parent.type === "CallExpression" && + node.parent.arguments[0] === node && + astUtils.isSpecificMemberAccess(node.parent.callee, "Object", /^definePropert(?:y|ies)$/u) + ); + } + + /** + * Check to see if object prototype access is part of a prototype + * extension. There are three ways a prototype can be extended: + * 1. Assignment to prototype property (Object.prototype.foo = 1) + * 2. Object.defineProperty()/Object.defineProperties() on a prototype + * If prototype extension is detected, report the AssignmentExpression + * or CallExpression node. + * @param {ASTNode} identifierNode The Identifier representing the object + * which prototype is being accessed and possibly extended. + * @returns {void} + */ + function checkAndReportPrototypeExtension(identifierNode) { + if (!isPrototypePropertyAccessed(identifierNode)) { + return; // This is not `*.prototype` access. + } + + /* + * `identifierNode.parent` is a MemberExpression `*.prototype`. + * If it's an optional member access, it may be wrapped by a `ChainExpression` node. + */ + const prototypeNode = + identifierNode.parent.parent.type === "ChainExpression" + ? identifierNode.parent.parent + : identifierNode.parent; + + if (isAssigningToPropertyOf(prototypeNode)) { + + // `*.prototype` -> MemberExpression -> AssignmentExpression + reportNode(prototypeNode.parent.parent, identifierNode.name); + } else if (isInDefinePropertyCall(prototypeNode)) { + + // `*.prototype` -> CallExpression + reportNode(prototypeNode.parent, identifierNode.name); + } + } + + return { + + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + + modifiedBuiltins.forEach(builtin => { + const builtinVar = globalScope.set.get(builtin); + + if (builtinVar && builtinVar.references) { + builtinVar.references + .map(ref => ref.identifier) + .forEach(checkAndReportPrototypeExtension); + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-bind.js b/node_modules/eslint/lib/rules/no-extra-bind.js new file mode 100644 index 0000000..e1e72b0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-bind.js @@ -0,0 +1,213 @@ +/** + * @fileoverview Rule to flag unnecessary bind calls + * @author Bence Dányi + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SIDE_EFFECT_FREE_NODE_TYPES = new Set(["Literal", "Identifier", "ThisExpression", "FunctionExpression"]); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unnecessary calls to `.bind()`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-extra-bind" + }, + + schema: [], + fixable: "code", + + messages: { + unexpected: "The function binding is unnecessary." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + let scopeInfo = null; + + /** + * Checks if a node is free of side effects. + * + * This check is stricter than it needs to be, in order to keep the implementation simple. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is known to be side-effect free, false otherwise. + */ + function isSideEffectFree(node) { + return SIDE_EFFECT_FREE_NODE_TYPES.has(node.type); + } + + /** + * Reports a given function node. + * @param {ASTNode} node A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {void} + */ + function report(node) { + const memberNode = node.parent; + const callNode = memberNode.parent.type === "ChainExpression" + ? memberNode.parent.parent + : memberNode.parent; + + context.report({ + node: callNode, + messageId: "unexpected", + loc: memberNode.property.loc, + + fix(fixer) { + if (!isSideEffectFree(callNode.arguments[0])) { + return null; + } + + /* + * The list of the first/last token pair of a removal range. + * This is two parts because closing parentheses may exist between the method name and arguments. + * E.g. `(function(){}.bind ) (obj)` + * ^^^^^ ^^^^^ < removal ranges + * E.g. `(function(){}?.['bind'] ) ?.(obj)` + * ^^^^^^^^^^ ^^^^^^^ < removal ranges + */ + const tokenPairs = [ + [ + + // `.`, `?.`, or `[` token. + sourceCode.getTokenAfter( + memberNode.object, + astUtils.isNotClosingParenToken + ), + + // property name or `]` token. + sourceCode.getLastToken(memberNode) + ], + [ + + // `?.` or `(` token of arguments. + sourceCode.getTokenAfter( + memberNode, + astUtils.isNotClosingParenToken + ), + + // `)` token of arguments. + sourceCode.getLastToken(callNode) + ] + ]; + const firstTokenToRemove = tokenPairs[0][0]; + const lastTokenToRemove = tokenPairs[1][1]; + + if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { + return null; + } + + return tokenPairs.map(([start, end]) => + fixer.removeRange([start.range[0], end.range[1]])); + } + }); + } + + /** + * Checks whether or not a given function node is the callee of `.bind()` + * method. + * + * e.g. `(function() {}.bind(foo))` + * @param {ASTNode} node A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {boolean} `true` if the node is the callee of `.bind()` method. + */ + function isCalleeOfBindMethod(node) { + if (!astUtils.isSpecificMemberAccess(node.parent, null, "bind")) { + return false; + } + + // The node of `*.bind` member access. + const bindNode = node.parent.parent.type === "ChainExpression" + ? node.parent.parent + : node.parent; + + return ( + bindNode.parent.type === "CallExpression" && + bindNode.parent.callee === bindNode && + bindNode.parent.arguments.length === 1 && + bindNode.parent.arguments[0].type !== "SpreadElement" + ); + } + + /** + * Adds a scope information object to the stack. + * @param {ASTNode} node A node to add. This node is a FunctionExpression + * or a FunctionDeclaration node. + * @returns {void} + */ + function enterFunction(node) { + scopeInfo = { + isBound: isCalleeOfBindMethod(node), + thisFound: false, + upper: scopeInfo + }; + } + + /** + * Removes the scope information object from the top of the stack. + * At the same time, this reports the function node if the function has + * `.bind()` and the `this` keywords found. + * @param {ASTNode} node A node to remove. This node is a + * FunctionExpression or a FunctionDeclaration node. + * @returns {void} + */ + function exitFunction(node) { + if (scopeInfo.isBound && !scopeInfo.thisFound) { + report(node); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Reports a given arrow function if the function is callee of `.bind()` + * method. + * @param {ASTNode} node A node to report. This node is an + * ArrowFunctionExpression. + * @returns {void} + */ + function exitArrowFunction(node) { + if (isCalleeOfBindMethod(node)) { + report(node); + } + } + + /** + * Set the mark as the `this` keyword was found in this scope. + * @returns {void} + */ + function markAsThisFound() { + if (scopeInfo) { + scopeInfo.thisFound = true; + } + } + + return { + "ArrowFunctionExpression:exit": exitArrowFunction, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + ThisExpression: markAsThisFound + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-boolean-cast.js b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js new file mode 100644 index 0000000..63450c3 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js @@ -0,0 +1,370 @@ +/** + * @fileoverview Rule to flag unnecessary double negation in Boolean contexts + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const eslintUtils = require("@eslint-community/eslint-utils"); + +const precedence = astUtils.getPrecedence; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{}], + + docs: { + description: "Disallow unnecessary boolean casts", + recommended: true, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-extra-boolean-cast" + }, + + schema: [{ + anyOf: [ + { + type: "object", + properties: { + enforceForInnerExpressions: { + type: "boolean" + } + }, + additionalProperties: false + }, + + // deprecated + { + type: "object", + properties: { + enforceForLogicalOperands: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }], + fixable: "code", + + messages: { + unexpectedCall: "Redundant Boolean call.", + unexpectedNegation: "Redundant double negation." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const [{ enforceForLogicalOperands, enforceForInnerExpressions }] = context.options; + + // Node types which have a test which will coerce values to booleans. + const BOOLEAN_NODE_TYPES = new Set([ + "IfStatement", + "DoWhileStatement", + "WhileStatement", + "ConditionalExpression", + "ForStatement" + ]); + + /** + * Check if a node is a Boolean function or constructor. + * @param {ASTNode} node the node + * @returns {boolean} If the node is Boolean function or constructor + */ + function isBooleanFunctionOrConstructorCall(node) { + + // Boolean() and new Boolean() + return (node.type === "CallExpression" || node.type === "NewExpression") && + node.callee.type === "Identifier" && + node.callee.name === "Boolean"; + } + + /** + * Check if a node is in a context where its value would be coerced to a boolean at runtime. + * @param {ASTNode} node The node + * @returns {boolean} If it is in a boolean context + */ + function isInBooleanContext(node) { + return ( + (isBooleanFunctionOrConstructorCall(node.parent) && + node === node.parent.arguments[0]) || + + (BOOLEAN_NODE_TYPES.has(node.parent.type) && + node === node.parent.test) || + + // ! + (node.parent.type === "UnaryExpression" && + node.parent.operator === "!") + ); + } + + /** + * Checks whether the node is a context that should report an error + * Acts recursively if it is in a logical context + * @param {ASTNode} node the node + * @returns {boolean} If the node is in one of the flagged contexts + */ + function isInFlaggedContext(node) { + if (node.parent.type === "ChainExpression") { + return isInFlaggedContext(node.parent); + } + + /* + * legacy behavior - enforceForLogicalOperands will only recurse on + * logical expressions, not on other contexts. + * enforceForInnerExpressions will recurse on logical expressions + * as well as the other recursive syntaxes. + */ + + if (enforceForLogicalOperands || enforceForInnerExpressions) { + if (node.parent.type === "LogicalExpression") { + if (node.parent.operator === "||" || node.parent.operator === "&&") { + return isInFlaggedContext(node.parent); + } + + // Check the right hand side of a `??` operator. + if (enforceForInnerExpressions && + node.parent.operator === "??" && + node.parent.right === node + ) { + return isInFlaggedContext(node.parent); + } + } + } + + if (enforceForInnerExpressions) { + if ( + node.parent.type === "ConditionalExpression" && + (node.parent.consequent === node || node.parent.alternate === node) + ) { + return isInFlaggedContext(node.parent); + } + + /* + * Check last expression only in a sequence, i.e. if ((1, 2, Boolean(3))) {}, since + * the others don't affect the result of the expression. + */ + if ( + node.parent.type === "SequenceExpression" && + node.parent.expressions.at(-1) === node + ) { + return isInFlaggedContext(node.parent); + } + + } + + return isInBooleanContext(node); + } + + + /** + * Check if a node has comments inside. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if it has comments inside. + */ + function hasCommentsInside(node) { + return Boolean(sourceCode.getCommentsInside(node).length); + } + + /** + * Checks if the given node is wrapped in grouping parentheses. Parentheses for constructs such as if() don't count. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is parenthesized. + * @private + */ + function isParenthesized(node) { + return eslintUtils.isParenthesized(1, node, sourceCode); + } + + /** + * Determines whether the given node needs to be parenthesized when replacing the previous node. + * It assumes that `previousNode` is the node to be reported by this rule, so it has a limited list + * of possible parent node types. By the same assumption, the node's role in a particular parent is already known. + * @param {ASTNode} previousNode Previous node. + * @param {ASTNode} node The node to check. + * @throws {Error} (Unreachable.) + * @returns {boolean} `true` if the node needs to be parenthesized. + */ + function needsParens(previousNode, node) { + if (previousNode.parent.type === "ChainExpression") { + return needsParens(previousNode.parent, node); + } + + if (isParenthesized(previousNode)) { + + // parentheses around the previous node will stay, so there is no need for an additional pair + return false; + } + + // parent of the previous node will become parent of the replacement node + const parent = previousNode.parent; + + switch (parent.type) { + case "CallExpression": + case "NewExpression": + return node.type === "SequenceExpression"; + case "IfStatement": + case "DoWhileStatement": + case "WhileStatement": + case "ForStatement": + case "SequenceExpression": + return false; + case "ConditionalExpression": + if (previousNode === parent.test) { + return precedence(node) <= precedence(parent); + } + if (previousNode === parent.consequent || previousNode === parent.alternate) { + return precedence(node) < precedence({ type: "AssignmentExpression" }); + } + + /* c8 ignore next */ + throw new Error("Ternary child must be test, consequent, or alternate."); + case "UnaryExpression": + return precedence(node) < precedence(parent); + case "LogicalExpression": + if (astUtils.isMixedLogicalAndCoalesceExpressions(node, parent)) { + return true; + } + if (previousNode === parent.left) { + return precedence(node) < precedence(parent); + } + return precedence(node) <= precedence(parent); + + /* c8 ignore next */ + default: + throw new Error(`Unexpected parent type: ${parent.type}`); + } + } + + return { + UnaryExpression(node) { + const parent = node.parent; + + + // Exit early if it's guaranteed not to match + if (node.operator !== "!" || + parent.type !== "UnaryExpression" || + parent.operator !== "!") { + return; + } + + + if (isInFlaggedContext(parent)) { + context.report({ + node: parent, + messageId: "unexpectedNegation", + fix(fixer) { + if (hasCommentsInside(parent)) { + return null; + } + + if (needsParens(parent, node.argument)) { + return fixer.replaceText(parent, `(${sourceCode.getText(node.argument)})`); + } + + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + const firstReplacementToken = sourceCode.getFirstToken(node.argument); + + if ( + tokenBefore && + tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstReplacementToken) + ) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + sourceCode.getText(node.argument)); + } + }); + } + }, + + CallExpression(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "Boolean") { + return; + } + + if (isInFlaggedContext(node)) { + context.report({ + node, + messageId: "unexpectedCall", + fix(fixer) { + const parent = node.parent; + + if (node.arguments.length === 0) { + if (parent.type === "UnaryExpression" && parent.operator === "!") { + + /* + * !Boolean() -> true + */ + + if (hasCommentsInside(parent)) { + return null; + } + + const replacement = "true"; + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + + if ( + tokenBefore && + tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + replacement); + } + + /* + * Boolean() -> false + */ + + if (hasCommentsInside(node)) { + return null; + } + + return fixer.replaceText(node, "false"); + } + + if (node.arguments.length === 1) { + const argument = node.arguments[0]; + + if (argument.type === "SpreadElement" || hasCommentsInside(node)) { + return null; + } + + /* + * Boolean(expression) -> expression + */ + + if (needsParens(node, argument)) { + return fixer.replaceText(node, `(${sourceCode.getText(argument)})`); + } + + return fixer.replaceText(node, sourceCode.getText(argument)); + } + + // two or more arguments + return null; + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-label.js b/node_modules/eslint/lib/rules/no-extra-label.js new file mode 100644 index 0000000..11986c9 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-label.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Rule to disallow unnecessary labels + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unnecessary labels", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-extra-label" + }, + + schema: [], + fixable: "code", + + messages: { + unexpected: "This label '{{name}}' is unnecessary." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + let scopeInfo = null; + + /** + * Creates a new scope with a breakable statement. + * @param {ASTNode} node A node to create. This is a BreakableStatement. + * @returns {void} + */ + function enterBreakableStatement(node) { + scopeInfo = { + label: node.parent.type === "LabeledStatement" ? node.parent.label : null, + breakable: true, + upper: scopeInfo + }; + } + + /** + * Removes the top scope of the stack. + * @returns {void} + */ + function exitBreakableStatement() { + scopeInfo = scopeInfo.upper; + } + + /** + * Creates a new scope with a labeled statement. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `enterBreakableStatement` function. + * @param {ASTNode} node A node to create. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = { + label: node.label, + breakable: false, + upper: scopeInfo + }; + } + } + + /** + * Removes the top scope of the stack. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `exitBreakableStatement` function. + * @param {ASTNode} node A node. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = scopeInfo.upper; + } + } + + /** + * Reports a given control node if it's unnecessary. + * @param {ASTNode} node A node. This is a BreakStatement or a + * ContinueStatement. + * @returns {void} + */ + function reportIfUnnecessary(node) { + if (!node.label) { + return; + } + + const labelNode = node.label; + + for (let info = scopeInfo; info !== null; info = info.upper) { + if (info.breakable || info.label && info.label.name === labelNode.name) { + if (info.breakable && info.label && info.label.name === labelNode.name) { + context.report({ + node: labelNode, + messageId: "unexpected", + data: labelNode, + fix(fixer) { + const breakOrContinueToken = sourceCode.getFirstToken(node); + + if (sourceCode.commentsExistBetween(breakOrContinueToken, labelNode)) { + return null; + } + + return fixer.removeRange([breakOrContinueToken.range[1], labelNode.range[1]]); + } + }); + } + return; + } + } + } + + return { + WhileStatement: enterBreakableStatement, + "WhileStatement:exit": exitBreakableStatement, + DoWhileStatement: enterBreakableStatement, + "DoWhileStatement:exit": exitBreakableStatement, + ForStatement: enterBreakableStatement, + "ForStatement:exit": exitBreakableStatement, + ForInStatement: enterBreakableStatement, + "ForInStatement:exit": exitBreakableStatement, + ForOfStatement: enterBreakableStatement, + "ForOfStatement:exit": exitBreakableStatement, + SwitchStatement: enterBreakableStatement, + "SwitchStatement:exit": exitBreakableStatement, + LabeledStatement: enterLabeledStatement, + "LabeledStatement:exit": exitLabeledStatement, + BreakStatement: reportIfUnnecessary, + ContinueStatement: reportIfUnnecessary + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-parens.js b/node_modules/eslint/lib/rules/no-extra-parens.js new file mode 100644 index 0000000..bb3481a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-parens.js @@ -0,0 +1,1340 @@ +/** + * @fileoverview Disallow parenthesising higher precedence subexpressions. + * @author Michael Ficarra + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const { isParenthesized: isParenthesizedRaw } = require("@eslint-community/eslint-utils"); +const astUtils = require("./utils/ast-utils.js"); + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-extra-parens", + url: "https://eslint.style/rules/js/no-extra-parens" + } + } + ] + }, + type: "layout", + + docs: { + description: "Disallow unnecessary parentheses", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-extra-parens" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["functions"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["all"] + }, + { + type: "object", + properties: { + conditionalAssign: { type: "boolean" }, + ternaryOperandBinaryExpressions: { type: "boolean" }, + nestedBinaryExpressions: { type: "boolean" }, + returnAssign: { type: "boolean" }, + ignoreJSX: { enum: ["none", "all", "single-line", "multi-line"] }, + enforceForArrowConditionals: { type: "boolean" }, + enforceForSequenceExpressions: { type: "boolean" }, + enforceForNewInMemberExpressions: { type: "boolean" }, + enforceForFunctionPrototypeMethods: { type: "boolean" }, + allowParensAfterCommentPattern: { type: "string" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + unexpected: "Unnecessary parentheses around expression." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + const tokensToIgnore = new WeakSet(); + const precedence = astUtils.getPrecedence; + const ALL_NODES = context.options[0] !== "functions"; + const EXCEPT_COND_ASSIGN = ALL_NODES && context.options[1] && context.options[1].conditionalAssign === false; + const EXCEPT_COND_TERNARY = ALL_NODES && context.options[1] && context.options[1].ternaryOperandBinaryExpressions === false; + const NESTED_BINARY = ALL_NODES && context.options[1] && context.options[1].nestedBinaryExpressions === false; + const EXCEPT_RETURN_ASSIGN = ALL_NODES && context.options[1] && context.options[1].returnAssign === false; + const IGNORE_JSX = ALL_NODES && context.options[1] && context.options[1].ignoreJSX; + const IGNORE_ARROW_CONDITIONALS = ALL_NODES && context.options[1] && + context.options[1].enforceForArrowConditionals === false; + const IGNORE_SEQUENCE_EXPRESSIONS = ALL_NODES && context.options[1] && + context.options[1].enforceForSequenceExpressions === false; + const IGNORE_NEW_IN_MEMBER_EXPR = ALL_NODES && context.options[1] && + context.options[1].enforceForNewInMemberExpressions === false; + const IGNORE_FUNCTION_PROTOTYPE_METHODS = ALL_NODES && context.options[1] && + context.options[1].enforceForFunctionPrototypeMethods === false; + const ALLOW_PARENS_AFTER_COMMENT_PATTERN = ALL_NODES && context.options[1] && context.options[1].allowParensAfterCommentPattern; + + const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({ type: "AssignmentExpression" }); + const PRECEDENCE_OF_UPDATE_EXPR = precedence({ type: "UpdateExpression" }); + + let reportsBuffer; + + /** + * Determines whether the given node is a `call` or `apply` method call, invoked directly on a `FunctionExpression` node. + * Example: function(){}.call() + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is an immediate `call` or `apply` method call. + * @private + */ + function isImmediateFunctionPrototypeMethodCall(node) { + const callNode = astUtils.skipChainExpression(node); + + if (callNode.type !== "CallExpression") { + return false; + } + const callee = astUtils.skipChainExpression(callNode.callee); + + return ( + callee.type === "MemberExpression" && + callee.object.type === "FunctionExpression" && + ["call", "apply"].includes(astUtils.getStaticPropertyName(callee)) + ); + } + + /** + * Determines if this rule should be enforced for a node given the current configuration. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the rule should be enforced for this node. + * @private + */ + function ruleApplies(node) { + if (node.type === "JSXElement" || node.type === "JSXFragment") { + const isSingleLine = node.loc.start.line === node.loc.end.line; + + switch (IGNORE_JSX) { + + // Exclude this JSX element from linting + case "all": + return false; + + // Exclude this JSX element if it is multi-line element + case "multi-line": + return isSingleLine; + + // Exclude this JSX element if it is single-line element + case "single-line": + return !isSingleLine; + + // Nothing special to be done for JSX elements + case "none": + break; + + // no default + } + } + + if (node.type === "SequenceExpression" && IGNORE_SEQUENCE_EXPRESSIONS) { + return false; + } + + if (isImmediateFunctionPrototypeMethodCall(node) && IGNORE_FUNCTION_PROTOTYPE_METHODS) { + return false; + } + + return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"; + } + + /** + * Determines if a node is surrounded by parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ + function isParenthesised(node) { + return isParenthesizedRaw(1, node, sourceCode); + } + + /** + * Determines if a node is surrounded by parentheses twice. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is doubly parenthesised. + * @private + */ + function isParenthesisedTwice(node) { + return isParenthesizedRaw(2, node, sourceCode); + } + + /** + * Determines if a node is surrounded by (potentially) invalid parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParens(node) { + return ruleApplies(node) && isParenthesised(node); + } + + /** + * Determines if a node that is expected to be parenthesised is surrounded by + * (potentially) invalid extra parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. + * @private + */ + function hasDoubleExcessParens(node) { + return ruleApplies(node) && isParenthesisedTwice(node); + } + + /** + * Determines if a node that is expected to be parenthesised is surrounded by + * (potentially) invalid extra parentheses with considering precedence level of the node. + * If the preference level of the node is not higher or equal to precedence lower limit, it also checks + * whether the node is surrounded by parentheses twice or not. + * @param {ASTNode} node The node to be checked. + * @param {number} precedenceLowerLimit The lower limit of precedence. + * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. + * @private + */ + function hasExcessParensWithPrecedence(node, precedenceLowerLimit) { + if (ruleApplies(node) && isParenthesised(node)) { + if ( + precedence(node) >= precedenceLowerLimit || + isParenthesisedTwice(node) + ) { + return true; + } + } + return false; + } + + /** + * Determines if a node test expression is allowed to have a parenthesised assignment + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isCondAssignException(node) { + return EXCEPT_COND_ASSIGN && node.test.type === "AssignmentExpression"; + } + + /** + * Determines if a node is in a return statement + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is in a return statement. + * @private + */ + function isInReturnStatement(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if ( + currentNode.type === "ReturnStatement" || + (currentNode.type === "ArrowFunctionExpression" && currentNode.body.type !== "BlockStatement") + ) { + return true; + } + } + + return false; + } + + /** + * Determines if a constructor function is newed-up with parens + * @param {ASTNode} newExpression The NewExpression node to be checked. + * @returns {boolean} True if the constructor is called with parens. + * @private + */ + function isNewExpressionWithParens(newExpression) { + const lastToken = sourceCode.getLastToken(newExpression); + const penultimateToken = sourceCode.getTokenBefore(lastToken); + + return newExpression.arguments.length > 0 || + ( + + // The expression should end with its own parens, e.g., new new foo() is not a new expression with parens + astUtils.isOpeningParenToken(penultimateToken) && + astUtils.isClosingParenToken(lastToken) && + newExpression.callee.range[1] < newExpression.range[1] + ); + } + + /** + * Determines if a node is or contains an assignment expression + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is or contains an assignment expression. + * @private + */ + function containsAssignment(node) { + if (node.type === "AssignmentExpression") { + return true; + } + if (node.type === "ConditionalExpression" && + (node.consequent.type === "AssignmentExpression" || node.alternate.type === "AssignmentExpression")) { + return true; + } + if ((node.left && node.left.type === "AssignmentExpression") || + (node.right && node.right.type === "AssignmentExpression")) { + return true; + } + + return false; + } + + /** + * Determines if a node is contained by or is itself a return statement and is allowed to have a parenthesised assignment + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isReturnAssignException(node) { + if (!EXCEPT_RETURN_ASSIGN || !isInReturnStatement(node)) { + return false; + } + + if (node.type === "ReturnStatement") { + return node.argument && containsAssignment(node.argument); + } + if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { + return containsAssignment(node.body); + } + return containsAssignment(node); + + } + + /** + * Determines if a node following a [no LineTerminator here] restriction is + * surrounded by (potentially) invalid extra parentheses. + * @param {Token} token The token preceding the [no LineTerminator here] restriction. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParensNoLineTerminator(token, node) { + if (token.loc.end.line === node.loc.start.line) { + return hasExcessParens(node); + } + + return hasDoubleExcessParens(node); + } + + /** + * Determines whether a node should be preceded by an additional space when removing parens + * @param {ASTNode} node node to evaluate; must be surrounded by parentheses + * @returns {boolean} `true` if a space should be inserted before the node + * @private + */ + function requiresLeadingSpace(node) { + const leftParenToken = sourceCode.getTokenBefore(node); + const tokenBeforeLeftParen = sourceCode.getTokenBefore(leftParenToken, { includeComments: true }); + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParenToken, { includeComments: true }); + + return tokenBeforeLeftParen && + tokenBeforeLeftParen.range[1] === leftParenToken.range[0] && + leftParenToken.range[1] === tokenAfterLeftParen.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeLeftParen, tokenAfterLeftParen); + } + + /** + * Determines whether a node should be followed by an additional space when removing parens + * @param {ASTNode} node node to evaluate; must be surrounded by parentheses + * @returns {boolean} `true` if a space should be inserted after the node + * @private + */ + function requiresTrailingSpace(node) { + const nextTwoTokens = sourceCode.getTokensAfter(node, { count: 2 }); + const rightParenToken = nextTwoTokens[0]; + const tokenAfterRightParen = nextTwoTokens[1]; + const tokenBeforeRightParen = sourceCode.getLastToken(node); + + return rightParenToken && tokenAfterRightParen && + !sourceCode.isSpaceBetweenTokens(rightParenToken, tokenAfterRightParen) && + !astUtils.canTokensBeAdjacent(tokenBeforeRightParen, tokenAfterRightParen); + } + + /** + * Determines if a given expression node is an IIFE + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the given node is an IIFE + */ + function isIIFE(node) { + const maybeCallNode = astUtils.skipChainExpression(node); + + return maybeCallNode.type === "CallExpression" && maybeCallNode.callee.type === "FunctionExpression"; + } + + /** + * Determines if the given node can be the assignment target in destructuring or the LHS of an assignment. + * This is to avoid an autofix that could change behavior because parsers mistakenly allow invalid syntax, + * such as `(a = b) = c` and `[(a = b) = c] = []`. Ideally, this function shouldn't be necessary. + * @param {ASTNode} [node] The node to check + * @returns {boolean} `true` if the given node can be a valid assignment target + */ + function canBeAssignmentTarget(node) { + return node && (node.type === "Identifier" || node.type === "MemberExpression"); + } + + /** + * Checks if a node is fixable. + * A node is fixable if removing a single pair of surrounding parentheses does not turn it + * into a directive after fixing other nodes. + * Almost all nodes are fixable, except if all of the following conditions are met: + * The node is a string Literal + * It has a single pair of parentheses + * It is the only child of an ExpressionStatement + * @param {ASTNode} node The node to evaluate. + * @returns {boolean} Whether or not the node is fixable. + * @private + */ + function isFixable(node) { + + // if it's not a string literal it can be autofixed + if (node.type !== "Literal" || typeof node.value !== "string") { + return true; + } + if (isParenthesisedTwice(node)) { + return true; + } + return !astUtils.isTopLevelExpressionStatement(node.parent); + } + + /** + * Report the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function report(node) { + const leftParenToken = sourceCode.getTokenBefore(node); + const rightParenToken = sourceCode.getTokenAfter(node); + + if (!isParenthesisedTwice(node)) { + if (tokensToIgnore.has(sourceCode.getFirstToken(node))) { + return; + } + + if (isIIFE(node) && !isParenthesised(node.callee)) { + return; + } + + if (ALLOW_PARENS_AFTER_COMMENT_PATTERN) { + const commentsBeforeLeftParenToken = sourceCode.getCommentsBefore(leftParenToken); + const totalCommentsBeforeLeftParenTokenCount = commentsBeforeLeftParenToken.length; + const ignorePattern = new RegExp(ALLOW_PARENS_AFTER_COMMENT_PATTERN, "u"); + + if ( + totalCommentsBeforeLeftParenTokenCount > 0 && + ignorePattern.test(commentsBeforeLeftParenToken[totalCommentsBeforeLeftParenTokenCount - 1].value) + ) { + return; + } + } + } + + /** + * Finishes reporting + * @returns {void} + * @private + */ + function finishReport() { + context.report({ + node, + loc: leftParenToken.loc, + messageId: "unexpected", + fix: isFixable(node) + ? fixer => { + const parenthesizedSource = sourceCode.text.slice(leftParenToken.range[1], rightParenToken.range[0]); + + return fixer.replaceTextRange([ + leftParenToken.range[0], + rightParenToken.range[1] + ], (requiresLeadingSpace(node) ? " " : "") + parenthesizedSource + (requiresTrailingSpace(node) ? " " : "")); + } + : null + }); + } + + if (reportsBuffer) { + reportsBuffer.reports.push({ node, finishReport }); + return; + } + + finishReport(); + } + + /** + * Evaluate a argument of the node. + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkArgumentWithPrecedence(node) { + if (hasExcessParensWithPrecedence(node.argument, precedence(node))) { + report(node.argument); + } + } + + /** + * Check if a member expression contains a call expression + * @param {ASTNode} node MemberExpression node to evaluate + * @returns {boolean} true if found, false if not + */ + function doesMemberExpressionContainCallExpression(node) { + let currentNode = node.object; + let currentNodeType = node.object.type; + + while (currentNodeType === "MemberExpression") { + currentNode = currentNode.object; + currentNodeType = currentNode.type; + } + + return currentNodeType === "CallExpression"; + } + + /** + * Evaluate a new call + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkCallNew(node) { + const callee = node.callee; + + if (hasExcessParensWithPrecedence(callee, precedence(node))) { + if ( + hasDoubleExcessParens(callee) || + !( + isIIFE(node) || + + // (new A)(); new (new A)(); + ( + callee.type === "NewExpression" && + !isNewExpressionWithParens(callee) && + !( + node.type === "NewExpression" && + !isNewExpressionWithParens(node) + ) + ) || + + // new (a().b)(); new (a.b().c); + ( + node.type === "NewExpression" && + callee.type === "MemberExpression" && + doesMemberExpressionContainCallExpression(callee) + ) || + + // (a?.b)(); (a?.())(); + ( + !node.optional && + callee.type === "ChainExpression" + ) + ) + ) { + report(node.callee); + } + } + node.arguments + .filter(arg => hasExcessParensWithPrecedence(arg, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(report); + } + + /** + * Evaluate binary logicals + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkBinaryLogical(node) { + const prec = precedence(node); + const leftPrecedence = precedence(node.left); + const rightPrecedence = precedence(node.right); + const isExponentiation = node.operator === "**"; + const shouldSkipLeft = NESTED_BINARY && (node.left.type === "BinaryExpression" || node.left.type === "LogicalExpression"); + const shouldSkipRight = NESTED_BINARY && (node.right.type === "BinaryExpression" || node.right.type === "LogicalExpression"); + + if (!shouldSkipLeft && hasExcessParens(node.left)) { + if ( + !(["AwaitExpression", "UnaryExpression"].includes(node.left.type) && isExponentiation) && + !astUtils.isMixedLogicalAndCoalesceExpressions(node.left, node) && + (leftPrecedence > prec || (leftPrecedence === prec && !isExponentiation)) || + isParenthesisedTwice(node.left) + ) { + report(node.left); + } + } + + if (!shouldSkipRight && hasExcessParens(node.right)) { + if ( + !astUtils.isMixedLogicalAndCoalesceExpressions(node.right, node) && + (rightPrecedence > prec || (rightPrecedence === prec && isExponentiation)) || + isParenthesisedTwice(node.right) + ) { + report(node.right); + } + } + } + + /** + * Check the parentheses around the super class of the given class definition. + * @param {ASTNode} node The node of class declarations to check. + * @returns {void} + */ + function checkClass(node) { + if (!node.superClass) { + return; + } + + /* + * If `node.superClass` is a LeftHandSideExpression, parentheses are extra. + * Otherwise, parentheses are needed. + */ + const hasExtraParens = precedence(node.superClass) > PRECEDENCE_OF_UPDATE_EXPR + ? hasExcessParens(node.superClass) + : hasDoubleExcessParens(node.superClass); + + if (hasExtraParens) { + report(node.superClass); + } + } + + /** + * Check the parentheses around the argument of the given spread operator. + * @param {ASTNode} node The node of spread elements/properties to check. + * @returns {void} + */ + function checkSpreadOperator(node) { + if (hasExcessParensWithPrecedence(node.argument, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.argument); + } + } + + /** + * Checks the parentheses for an ExpressionStatement or ExportDefaultDeclaration + * @param {ASTNode} node The ExpressionStatement.expression or ExportDefaultDeclaration.declaration node + * @returns {void} + */ + function checkExpressionOrExportStatement(node) { + const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node); + const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken); + const thirdToken = secondToken ? sourceCode.getTokenAfter(secondToken) : null; + const tokenAfterClosingParens = secondToken ? sourceCode.getTokenAfter(secondToken, astUtils.isNotClosingParenToken) : null; + + if ( + astUtils.isOpeningParenToken(firstToken) && + ( + astUtils.isOpeningBraceToken(secondToken) || + secondToken.type === "Keyword" && ( + secondToken.value === "function" || + secondToken.value === "class" || + secondToken.value === "let" && + tokenAfterClosingParens && + ( + astUtils.isOpeningBracketToken(tokenAfterClosingParens) || + tokenAfterClosingParens.type === "Identifier" + ) + ) || + secondToken && secondToken.type === "Identifier" && secondToken.value === "async" && thirdToken && thirdToken.type === "Keyword" && thirdToken.value === "function" + ) + ) { + tokensToIgnore.add(secondToken); + } + + const hasExtraParens = node.parent.type === "ExportDefaultDeclaration" + ? hasExcessParensWithPrecedence(node, PRECEDENCE_OF_ASSIGNMENT_EXPR) + : hasExcessParens(node); + + if (hasExtraParens) { + report(node); + } + } + + /** + * Finds the path from the given node to the specified ancestor. + * @param {ASTNode} node First node in the path. + * @param {ASTNode} ancestor Last node in the path. + * @returns {ASTNode[]} Path, including both nodes. + * @throws {Error} If the given node does not have the specified ancestor. + */ + function pathToAncestor(node, ancestor) { + const path = [node]; + let currentNode = node; + + while (currentNode !== ancestor) { + + currentNode = currentNode.parent; + + /* c8 ignore start */ + if (currentNode === null) { + throw new Error("Nodes are not in the ancestor-descendant relationship."); + }/* c8 ignore stop */ + + path.push(currentNode); + } + + return path; + } + + /** + * Finds the path from the given node to the specified descendant. + * @param {ASTNode} node First node in the path. + * @param {ASTNode} descendant Last node in the path. + * @returns {ASTNode[]} Path, including both nodes. + * @throws {Error} If the given node does not have the specified descendant. + */ + function pathToDescendant(node, descendant) { + return pathToAncestor(descendant, node).reverse(); + } + + /** + * Checks whether the syntax of the given ancestor of an 'in' expression inside a for-loop initializer + * is preventing the 'in' keyword from being interpreted as a part of an ill-formed for-in loop. + * @param {ASTNode} node Ancestor of an 'in' expression. + * @param {ASTNode} child Child of the node, ancestor of the same 'in' expression or the 'in' expression itself. + * @returns {boolean} True if the keyword 'in' would be interpreted as the 'in' operator, without any parenthesis. + */ + function isSafelyEnclosingInExpression(node, child) { + switch (node.type) { + case "ArrayExpression": + case "ArrayPattern": + case "BlockStatement": + case "ObjectExpression": + case "ObjectPattern": + case "TemplateLiteral": + return true; + case "ArrowFunctionExpression": + case "FunctionExpression": + return node.params.includes(child); + case "CallExpression": + case "NewExpression": + return node.arguments.includes(child); + case "MemberExpression": + return node.computed && node.property === child; + case "ConditionalExpression": + return node.consequent === child; + default: + return false; + } + } + + /** + * Starts a new reports buffering. Warnings will be stored in a buffer instead of being reported immediately. + * An additional logic that requires multiple nodes (e.g. a whole subtree) may dismiss some of the stored warnings. + * @returns {void} + */ + function startNewReportsBuffering() { + reportsBuffer = { + upper: reportsBuffer, + inExpressionNodes: [], + reports: [] + }; + } + + /** + * Ends the current reports buffering. + * @returns {void} + */ + function endCurrentReportsBuffering() { + const { upper, inExpressionNodes, reports } = reportsBuffer; + + if (upper) { + upper.inExpressionNodes.push(...inExpressionNodes); + upper.reports.push(...reports); + } else { + + // flush remaining reports + reports.forEach(({ finishReport }) => finishReport()); + } + + reportsBuffer = upper; + } + + /** + * Checks whether the given node is in the current reports buffer. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is in the current buffer, false otherwise. + */ + function isInCurrentReportsBuffer(node) { + return reportsBuffer.reports.some(r => r.node === node); + } + + /** + * Removes the given node from the current reports buffer. + * @param {ASTNode} node Node to remove. + * @returns {void} + */ + function removeFromCurrentReportsBuffer(node) { + reportsBuffer.reports = reportsBuffer.reports.filter(r => r.node !== node); + } + + /** + * Checks whether a node is a MemberExpression at NewExpression's callee. + * @param {ASTNode} node node to check. + * @returns {boolean} True if the node is a MemberExpression at NewExpression's callee. false otherwise. + */ + function isMemberExpInNewCallee(node) { + if (node.type === "MemberExpression") { + return node.parent.type === "NewExpression" && node.parent.callee === node + ? true + : node.parent.object === node && isMemberExpInNewCallee(node.parent); + } + return false; + } + + /** + * Checks if the left-hand side of an assignment is an identifier, the operator is one of + * `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous class or function. + * + * As per https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation, an + * assignment involving one of the operators `=`, `&&=`, `||=` or `??=` where the right-hand + * side is an anonymous class or function and the left-hand side is an *unparenthesized* + * identifier has different semantics than other assignments. + * Specifically, when an expression like `foo = function () {}` is evaluated, `foo.name` + * will be set to the string "foo", i.e. the identifier name. The same thing does not happen + * when evaluating `(foo) = function () {}`. + * Since the parenthesizing of the identifier in the left-hand side is significant in this + * special case, the parentheses, if present, should not be flagged as unnecessary. + * @param {ASTNode} node an AssignmentExpression node. + * @returns {boolean} `true` if the left-hand side of the assignment is an identifier, the + * operator is one of `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous + * class or function; otherwise, `false`. + */ + function isAnonymousFunctionAssignmentException({ left, operator, right }) { + if (left.type === "Identifier" && ["=", "&&=", "||=", "??="].includes(operator)) { + const rhsType = right.type; + + if (rhsType === "ArrowFunctionExpression") { + return true; + } + if ((rhsType === "FunctionExpression" || rhsType === "ClassExpression") && !right.id) { + return true; + } + } + return false; + } + + return { + ArrayExpression(node) { + node.elements + .filter(e => e && hasExcessParensWithPrecedence(e, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(report); + }, + + ArrayPattern(node) { + node.elements + .filter(e => canBeAssignmentTarget(e) && hasExcessParens(e)) + .forEach(report); + }, + + ArrowFunctionExpression(node) { + if (isReturnAssignException(node)) { + return; + } + + if (node.body.type === "ConditionalExpression" && + IGNORE_ARROW_CONDITIONALS + ) { + return; + } + + if (node.body.type !== "BlockStatement") { + const firstBodyToken = sourceCode.getFirstToken(node.body, astUtils.isNotOpeningParenToken); + const tokenBeforeFirst = sourceCode.getTokenBefore(firstBodyToken); + + if (astUtils.isOpeningParenToken(tokenBeforeFirst) && astUtils.isOpeningBraceToken(firstBodyToken)) { + tokensToIgnore.add(firstBodyToken); + } + if (hasExcessParensWithPrecedence(node.body, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.body); + } + } + }, + + AssignmentExpression(node) { + if (canBeAssignmentTarget(node.left) && hasExcessParens(node.left) && + (!isAnonymousFunctionAssignmentException(node) || isParenthesisedTwice(node.left))) { + report(node.left); + } + + if (!isReturnAssignException(node) && hasExcessParensWithPrecedence(node.right, precedence(node))) { + report(node.right); + } + }, + + BinaryExpression(node) { + if (reportsBuffer && node.operator === "in") { + reportsBuffer.inExpressionNodes.push(node); + } + + checkBinaryLogical(node); + }, + + CallExpression: checkCallNew, + + ConditionalExpression(node) { + if (isReturnAssignException(node)) { + return; + } + + const availableTypes = new Set(["BinaryExpression", "LogicalExpression"]); + + if ( + !(EXCEPT_COND_TERNARY && availableTypes.has(node.test.type)) && + !isCondAssignException(node) && + hasExcessParensWithPrecedence(node.test, precedence({ type: "LogicalExpression", operator: "||" })) + ) { + report(node.test); + } + + if ( + !(EXCEPT_COND_TERNARY && availableTypes.has(node.consequent.type)) && + hasExcessParensWithPrecedence(node.consequent, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.consequent); + } + + if ( + !(EXCEPT_COND_TERNARY && availableTypes.has(node.alternate.type)) && + hasExcessParensWithPrecedence(node.alternate, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.alternate); + } + }, + + DoWhileStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + ExportDefaultDeclaration: node => checkExpressionOrExportStatement(node.declaration), + ExpressionStatement: node => checkExpressionOrExportStatement(node.expression), + + ForInStatement(node) { + if (node.left.type !== "VariableDeclaration") { + const firstLeftToken = sourceCode.getFirstToken(node.left, astUtils.isNotOpeningParenToken); + + if ( + firstLeftToken.value === "let" && + astUtils.isOpeningBracketToken( + sourceCode.getTokenAfter(firstLeftToken, astUtils.isNotClosingParenToken) + ) + ) { + + // ForInStatement#left expression cannot start with `let[`. + tokensToIgnore.add(firstLeftToken); + } + } + + if (hasExcessParens(node.left)) { + report(node.left); + } + + if (hasExcessParens(node.right)) { + report(node.right); + } + }, + + ForOfStatement(node) { + if (node.left.type !== "VariableDeclaration") { + const firstLeftToken = sourceCode.getFirstToken(node.left, astUtils.isNotOpeningParenToken); + + if (firstLeftToken.value === "let") { + + // ForOfStatement#left expression cannot start with `let`. + tokensToIgnore.add(firstLeftToken); + } + } + + if (hasExcessParens(node.left)) { + report(node.left); + } + + if (hasExcessParensWithPrecedence(node.right, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.right); + } + }, + + ForStatement(node) { + if (node.test && hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + + if (node.update && hasExcessParens(node.update)) { + report(node.update); + } + + if (node.init) { + + if (node.init.type !== "VariableDeclaration") { + const firstToken = sourceCode.getFirstToken(node.init, astUtils.isNotOpeningParenToken); + + if ( + firstToken.value === "let" && + astUtils.isOpeningBracketToken( + sourceCode.getTokenAfter(firstToken, astUtils.isNotClosingParenToken) + ) + ) { + + // ForStatement#init expression cannot start with `let[`. + tokensToIgnore.add(firstToken); + } + } + + startNewReportsBuffering(); + + if (hasExcessParens(node.init)) { + report(node.init); + } + } + }, + + "ForStatement > *.init:exit"(node) { + + /* + * Removing parentheses around `in` expressions might change semantics and cause errors. + * + * For example, this valid for loop: + * for (let a = (b in c); ;); + * after removing parentheses would be treated as an invalid for-in loop: + * for (let a = b in c; ;); + */ + + if (reportsBuffer.reports.length) { + reportsBuffer.inExpressionNodes.forEach(inExpressionNode => { + const path = pathToDescendant(node, inExpressionNode); + let nodeToExclude; + + for (let i = 0; i < path.length; i++) { + const pathNode = path[i]; + + if (i < path.length - 1) { + const nextPathNode = path[i + 1]; + + if (isSafelyEnclosingInExpression(pathNode, nextPathNode)) { + + // The 'in' expression in safely enclosed by the syntax of its ancestor nodes (e.g. by '{}' or '[]'). + return; + } + } + + if (isParenthesised(pathNode)) { + if (isInCurrentReportsBuffer(pathNode)) { + + // This node was supposed to be reported, but parentheses might be necessary. + + if (isParenthesisedTwice(pathNode)) { + + /* + * This node is parenthesised twice, it certainly has at least one pair of `extra` parentheses. + * If the --fix option is on, the current fixing iteration will remove only one pair of parentheses. + * The remaining pair is safely enclosing the 'in' expression. + */ + return; + } + + // Exclude the outermost node only. + if (!nodeToExclude) { + nodeToExclude = pathNode; + } + + // Don't break the loop here, there might be some safe nodes or parentheses that will stay inside. + + } else { + + // This node will stay parenthesised, the 'in' expression in safely enclosed by '()'. + return; + } + } + } + + // Exclude the node from the list (i.e. treat parentheses as necessary) + removeFromCurrentReportsBuffer(nodeToExclude); + }); + } + + endCurrentReportsBuffering(); + }, + + IfStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + ImportExpression(node) { + const { source } = node; + + if (source.type === "SequenceExpression") { + if (hasDoubleExcessParens(source)) { + report(source); + } + } else if (hasExcessParens(source)) { + report(source); + } + }, + + LogicalExpression: checkBinaryLogical, + + MemberExpression(node) { + const shouldAllowWrapOnce = isMemberExpInNewCallee(node) && + doesMemberExpressionContainCallExpression(node); + const nodeObjHasExcessParens = shouldAllowWrapOnce + ? hasDoubleExcessParens(node.object) + : hasExcessParens(node.object) && + !( + isImmediateFunctionPrototypeMethodCall(node.parent) && + node.parent.callee === node && + IGNORE_FUNCTION_PROTOTYPE_METHODS + ); + + if ( + nodeObjHasExcessParens && + precedence(node.object) >= precedence(node) && + ( + node.computed || + !( + astUtils.isDecimalInteger(node.object) || + + // RegExp literal is allowed to have parens (#1589) + (node.object.type === "Literal" && node.object.regex) + ) + ) + ) { + report(node.object); + } + + if (nodeObjHasExcessParens && + node.object.type === "CallExpression" + ) { + report(node.object); + } + + if (nodeObjHasExcessParens && + !IGNORE_NEW_IN_MEMBER_EXPR && + node.object.type === "NewExpression" && + isNewExpressionWithParens(node.object)) { + report(node.object); + } + + if (nodeObjHasExcessParens && + node.optional && + node.object.type === "ChainExpression" + ) { + report(node.object); + } + + if (node.computed && hasExcessParens(node.property)) { + report(node.property); + } + }, + + "MethodDefinition[computed=true]"(node) { + if (hasExcessParensWithPrecedence(node.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.key); + } + }, + + NewExpression: checkCallNew, + + ObjectExpression(node) { + node.properties + .filter(property => property.value && hasExcessParensWithPrecedence(property.value, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(property => report(property.value)); + }, + + ObjectPattern(node) { + node.properties + .filter(property => { + const value = property.value; + + return canBeAssignmentTarget(value) && hasExcessParens(value); + }).forEach(property => report(property.value)); + }, + + Property(node) { + if (node.computed) { + const { key } = node; + + if (key && hasExcessParensWithPrecedence(key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(key); + } + } + }, + + PropertyDefinition(node) { + if (node.computed && hasExcessParensWithPrecedence(node.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.key); + } + + if (node.value && hasExcessParensWithPrecedence(node.value, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.value); + } + }, + + RestElement(node) { + const argument = node.argument; + + if (canBeAssignmentTarget(argument) && hasExcessParens(argument)) { + report(argument); + } + }, + + ReturnStatement(node) { + const returnToken = sourceCode.getFirstToken(node); + + if (isReturnAssignException(node)) { + return; + } + + if (node.argument && + hasExcessParensNoLineTerminator(returnToken, node.argument) && + + // RegExp literal is allowed to have parens (#1589) + !(node.argument.type === "Literal" && node.argument.regex)) { + report(node.argument); + } + }, + + SequenceExpression(node) { + const precedenceOfNode = precedence(node); + + node.expressions + .filter(e => hasExcessParensWithPrecedence(e, precedenceOfNode)) + .forEach(report); + }, + + SwitchCase(node) { + if (node.test && hasExcessParens(node.test)) { + report(node.test); + } + }, + + SwitchStatement(node) { + if (hasExcessParens(node.discriminant)) { + report(node.discriminant); + } + }, + + ThrowStatement(node) { + const throwToken = sourceCode.getFirstToken(node); + + if (hasExcessParensNoLineTerminator(throwToken, node.argument)) { + report(node.argument); + } + }, + + UnaryExpression: checkArgumentWithPrecedence, + UpdateExpression(node) { + if (node.prefix) { + checkArgumentWithPrecedence(node); + } else { + const { argument } = node; + const operatorToken = sourceCode.getLastToken(node); + + if (argument.loc.end.line === operatorToken.loc.start.line) { + checkArgumentWithPrecedence(node); + } else { + if (hasDoubleExcessParens(argument)) { + report(argument); + } + } + } + }, + AwaitExpression: checkArgumentWithPrecedence, + + VariableDeclarator(node) { + if ( + node.init && hasExcessParensWithPrecedence(node.init, PRECEDENCE_OF_ASSIGNMENT_EXPR) && + + // RegExp literal is allowed to have parens (#1589) + !(node.init.type === "Literal" && node.init.regex) + ) { + report(node.init); + } + }, + + WhileStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + WithStatement(node) { + if (hasExcessParens(node.object)) { + report(node.object); + } + }, + + YieldExpression(node) { + if (node.argument) { + const yieldToken = sourceCode.getFirstToken(node); + + if ((precedence(node.argument) >= precedence(node) && + hasExcessParensNoLineTerminator(yieldToken, node.argument)) || + hasDoubleExcessParens(node.argument)) { + report(node.argument); + } + } + }, + + ClassDeclaration: checkClass, + ClassExpression: checkClass, + + SpreadElement: checkSpreadOperator, + SpreadProperty: checkSpreadOperator, + ExperimentalSpreadProperty: checkSpreadOperator, + + TemplateLiteral(node) { + node.expressions + .filter(e => e && hasExcessParens(e)) + .forEach(report); + }, + + AssignmentPattern(node) { + const { left, right } = node; + + if (canBeAssignmentTarget(left) && hasExcessParens(left)) { + report(left); + } + + if (right && hasExcessParensWithPrecedence(right, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(right); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-semi.js b/node_modules/eslint/lib/rules/no-extra-semi.js new file mode 100644 index 0000000..bd7d73f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-semi.js @@ -0,0 +1,165 @@ +/** + * @fileoverview Rule to flag use of unnecessary semicolons + * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-extra-semi", + url: "https://eslint.style/rules/js/no-extra-semi" + } + } + ] + }, + type: "suggestion", + + docs: { + description: "Disallow unnecessary semicolons", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-extra-semi" + }, + + fixable: "code", + schema: [], + + messages: { + unexpected: "Unnecessary semicolon." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Checks if a node or token is fixable. + * A node is fixable if it can be removed without turning a subsequent statement into a directive after fixing other nodes. + * @param {Token} nodeOrToken The node or token to check. + * @returns {boolean} Whether or not the node is fixable. + */ + function isFixable(nodeOrToken) { + const nextToken = sourceCode.getTokenAfter(nodeOrToken); + + if (!nextToken || nextToken.type !== "String") { + return true; + } + const stringNode = sourceCode.getNodeByRangeIndex(nextToken.range[0]); + + return !astUtils.isTopLevelExpressionStatement(stringNode.parent); + } + + /** + * Reports an unnecessary semicolon error. + * @param {Node|Token} nodeOrToken A node or a token to be reported. + * @returns {void} + */ + function report(nodeOrToken) { + context.report({ + node: nodeOrToken, + messageId: "unexpected", + fix: isFixable(nodeOrToken) + ? fixer => + + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with semi. + * https://github.com/eslint/eslint/issues/7928 + */ + new FixTracker(fixer, context.sourceCode) + .retainSurroundingTokens(nodeOrToken) + .remove(nodeOrToken) + : null + }); + } + + /** + * Checks for a part of a class body. + * This checks tokens from a specified token to a next MethodDefinition or the end of class body. + * @param {Token} firstToken The first token to check. + * @returns {void} + */ + function checkForPartOfClassBody(firstToken) { + for (let token = firstToken; + token.type === "Punctuator" && !astUtils.isClosingBraceToken(token); + token = sourceCode.getTokenAfter(token) + ) { + if (astUtils.isSemicolonToken(token)) { + report(token); + } + } + } + + return { + + /** + * Reports this empty statement, except if the parent node is a loop. + * @param {Node} node A EmptyStatement node to be reported. + * @returns {void} + */ + EmptyStatement(node) { + const parent = node.parent, + allowedParentTypes = [ + "ForStatement", + "ForInStatement", + "ForOfStatement", + "WhileStatement", + "DoWhileStatement", + "IfStatement", + "LabeledStatement", + "WithStatement" + ]; + + if (!allowedParentTypes.includes(parent.type)) { + report(node); + } + }, + + /** + * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body. + * @param {Node} node A ClassBody node to check. + * @returns {void} + */ + ClassBody(node) { + checkForPartOfClassBody(sourceCode.getFirstToken(node, 1)); // 0 is `{`. + }, + + /** + * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body. + * @param {Node} node A MethodDefinition node of the start point. + * @returns {void} + */ + "MethodDefinition, PropertyDefinition, StaticBlock"(node) { + checkForPartOfClassBody(sourceCode.getTokenAfter(node)); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-fallthrough.js b/node_modules/eslint/lib/rules/no-fallthrough.js new file mode 100644 index 0000000..1057aae --- /dev/null +++ b/node_modules/eslint/lib/rules/no-fallthrough.js @@ -0,0 +1,218 @@ +/** + * @fileoverview Rule to flag fall-through cases in switch statements. + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { directivesPattern } = require("../shared/directives"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; + +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + +/** + * Checks whether or not a given comment string is really a fallthrough comment and not an ESLint directive. + * @param {string} comment The comment string to check. + * @param {RegExp} fallthroughCommentPattern The regular expression used for checking for fallthrough comments. + * @returns {boolean} `true` if the comment string is truly a fallthrough comment. + */ +function isFallThroughComment(comment, fallthroughCommentPattern) { + return fallthroughCommentPattern.test(comment) && !directivesPattern.test(comment.trim()); +} + +/** + * Checks whether or not a given case has a fallthrough comment. + * @param {ASTNode} caseWhichFallsThrough SwitchCase node which falls through. + * @param {ASTNode} subsequentCase The case after caseWhichFallsThrough. + * @param {RuleContext} context A rule context which stores comments. + * @param {RegExp} fallthroughCommentPattern A pattern to match comment to. + * @returns {null | object} the comment if the case has a valid fallthrough comment, otherwise null + */ +function getFallthroughComment(caseWhichFallsThrough, subsequentCase, context, fallthroughCommentPattern) { + const sourceCode = context.sourceCode; + + if (caseWhichFallsThrough.consequent.length === 1 && caseWhichFallsThrough.consequent[0].type === "BlockStatement") { + const trailingCloseBrace = sourceCode.getLastToken(caseWhichFallsThrough.consequent[0]); + const commentInBlock = sourceCode.getCommentsBefore(trailingCloseBrace).pop(); + + if (commentInBlock && isFallThroughComment(commentInBlock.value, fallthroughCommentPattern)) { + return commentInBlock; + } + } + + const comment = sourceCode.getCommentsBefore(subsequentCase).pop(); + + if (comment && isFallThroughComment(comment.value, fallthroughCommentPattern)) { + return comment; + } + + return null; +} + +/** + * Checks whether a node and a token are separated by blank lines + * @param {ASTNode} node The node to check + * @param {Token} token The token to compare against + * @returns {boolean} `true` if there are blank lines between node and token + */ +function hasBlankLinesBetween(node, token) { + return token.loc.start.line > node.loc.end.line + 1; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + allowEmptyCase: false, + reportUnusedFallthroughComment: false + }], + + docs: { + description: "Disallow fallthrough of `case` statements", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-fallthrough" + }, + + schema: [ + { + type: "object", + properties: { + commentPattern: { + type: "string" + }, + allowEmptyCase: { + type: "boolean" + }, + reportUnusedFallthroughComment: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + unusedFallthroughComment: "Found a comment that would permit fallthrough, but case cannot fall through.", + case: "Expected a 'break' statement before 'case'.", + default: "Expected a 'break' statement before 'default'." + } + }, + + create(context) { + const codePathSegments = []; + let currentCodePathSegments = new Set(); + const sourceCode = context.sourceCode; + const [{ allowEmptyCase, commentPattern, reportUnusedFallthroughComment }] = context.options; + const fallthroughCommentPattern = commentPattern + ? new RegExp(commentPattern, "u") + : DEFAULT_FALLTHROUGH_COMMENT; + + /* + * We need to use leading comments of the next SwitchCase node because + * trailing comments is wrong if semicolons are omitted. + */ + let previousCase = null; + + return { + + onCodePathStart() { + codePathSegments.push(currentCodePathSegments); + currentCodePathSegments = new Set(); + }, + + onCodePathEnd() { + currentCodePathSegments = codePathSegments.pop(); + }, + + onUnreachableCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, + + onCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + + SwitchCase(node) { + + /* + * Checks whether or not there is a fallthrough comment. + * And reports the previous fallthrough node if that does not exist. + */ + + if (previousCase && previousCase.node.parent === node.parent) { + const previousCaseFallthroughComment = getFallthroughComment(previousCase.node, node, context, fallthroughCommentPattern); + + if (previousCase.isFallthrough && !(previousCaseFallthroughComment)) { + context.report({ + messageId: node.test ? "case" : "default", + node + }); + } else if (reportUnusedFallthroughComment && !previousCase.isSwitchExitReachable && previousCaseFallthroughComment) { + context.report({ + messageId: "unusedFallthroughComment", + node: previousCaseFallthroughComment + }); + } + + } + previousCase = null; + }, + + "SwitchCase:exit"(node) { + const nextToken = sourceCode.getTokenAfter(node); + + /* + * `reachable` meant fall through because statements preceded by + * `break`, `return`, or `throw` are unreachable. + * And allows empty cases and the last case. + */ + const isSwitchExitReachable = isAnySegmentReachable(currentCodePathSegments); + const isFallthrough = isSwitchExitReachable && (node.consequent.length > 0 || (!allowEmptyCase && hasBlankLinesBetween(node, nextToken))) && + node.parent.cases.at(-1) !== node; + + previousCase = { + node, + isSwitchExitReachable, + isFallthrough + }; + + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-floating-decimal.js b/node_modules/eslint/lib/rules/no-floating-decimal.js new file mode 100644 index 0000000..72f916b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-floating-decimal.js @@ -0,0 +1,91 @@ +/** + * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal + * @author James Allardice + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-floating-decimal", + url: "https://eslint.style/rules/js/no-floating-decimal" + } + } + ] + }, + type: "suggestion", + + docs: { + description: "Disallow leading or trailing decimal points in numeric literals", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-floating-decimal" + }, + + schema: [], + fixable: "code", + messages: { + leading: "A leading decimal point can be confused with a dot.", + trailing: "A trailing decimal point can be confused with a dot." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + Literal(node) { + + if (typeof node.value === "number") { + if (node.raw.startsWith(".")) { + context.report({ + node, + messageId: "leading", + fix(fixer) { + const tokenBefore = sourceCode.getTokenBefore(node); + const needsSpaceBefore = tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, `0${node.raw}`); + + return fixer.insertTextBefore(node, needsSpaceBefore ? " 0" : "0"); + } + }); + } + if (node.raw.indexOf(".") === node.raw.length - 1) { + context.report({ + node, + messageId: "trailing", + fix: fixer => fixer.insertTextAfter(node, "0") + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-func-assign.js b/node_modules/eslint/lib/rules/no-func-assign.js new file mode 100644 index 0000000..8084af6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-func-assign.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to flag use of function declaration identifiers as variables. + * @author Ian Christian Myers + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow reassigning `function` declarations", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-func-assign" + }, + + schema: [], + + messages: { + isAFunction: "'{{name}}' is a function." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Reports a reference if is non initializer and writable. + * @param {References} references Collection of reference to check. + * @returns {void} + */ + function checkReference(references) { + astUtils.getModifyingReferences(references).forEach(reference => { + context.report({ + node: reference.identifier, + messageId: "isAFunction", + data: { + name: reference.identifier.name + } + }); + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "FunctionName") { + checkReference(variable.references); + } + } + + /** + * Checks parameters of a given function node. + * @param {ASTNode} node A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + sourceCode.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + FunctionDeclaration: checkForFunction, + FunctionExpression: checkForFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-global-assign.js b/node_modules/eslint/lib/rules/no-global-assign.js new file mode 100644 index 0000000..0a6f65e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-global-assign.js @@ -0,0 +1,96 @@ +/** + * @fileoverview Rule to disallow assignments to native objects or read-only global variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ exceptions: [] }], + + docs: { + description: "Disallow assignments to native objects or read-only global variables", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-global-assign" + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { type: "string" }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + globalShouldNotBeModified: "Read-only global '{{name}}' should not be modified." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const [{ exceptions }] = context.options; + + /** + * Reports write references. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + messageId: "globalShouldNotBeModified", + data: { + name: identifier.name + } + }); + } + } + + /** + * Reports write references if a given variable is read-only builtin. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && !exceptions.includes(variable.name)) { + variable.references.forEach(checkReference); + } + } + + return { + Program(node) { + const globalScope = sourceCode.getScope(node); + + globalScope.variables.forEach(checkVariable); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-implicit-coercion.js b/node_modules/eslint/lib/rules/no-implicit-coercion.js new file mode 100644 index 0000000..a1eab14 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implicit-coercion.js @@ -0,0 +1,412 @@ +/** + * @fileoverview A rule to disallow the type conversions with shorter notations. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/u; +const ALLOWABLE_OPERATORS = ["~", "!!", "+", "- -", "-", "*"]; + +/** + * Checks whether or not a node is a double logical negating. + * @param {ASTNode} node An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a double logical negating. + */ +function isDoubleLogicalNegating(node) { + return ( + node.operator === "!" && + node.argument.type === "UnaryExpression" && + node.argument.operator === "!" + ); +} + +/** + * Checks whether or not a node is a binary negating of `.indexOf()` method calling. + * @param {ASTNode} node An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling. + */ +function isBinaryNegatingOfIndexOf(node) { + if (node.operator !== "~") { + return false; + } + const callNode = astUtils.skipChainExpression(node.argument); + + return ( + callNode.type === "CallExpression" && + astUtils.isSpecificMemberAccess(callNode.callee, null, INDEX_OF_PATTERN) + ); +} + +/** + * Checks whether or not a node is a multiplying by one. + * @param {BinaryExpression} node A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a multiplying by one. + */ +function isMultiplyByOne(node) { + return node.operator === "*" && ( + node.left.type === "Literal" && node.left.value === 1 || + node.right.type === "Literal" && node.right.value === 1 + ); +} + +/** + * Checks whether the given node logically represents multiplication by a fraction of `1`. + * For example, `a * 1` in `a * 1 / b` is technically multiplication by `1`, but the + * whole expression can be logically interpreted as `a * (1 / b)` rather than `(a * 1) / b`. + * @param {BinaryExpression} node A BinaryExpression node to check. + * @param {SourceCode} sourceCode The source code object. + * @returns {boolean} Whether or not the node is a multiplying by a fraction of `1`. + */ +function isMultiplyByFractionOfOne(node, sourceCode) { + return node.type === "BinaryExpression" && + node.operator === "*" && + (node.right.type === "Literal" && node.right.value === 1) && + node.parent.type === "BinaryExpression" && + node.parent.operator === "/" && + node.parent.left === node && + !astUtils.isParenthesised(sourceCode, node); +} + +/** + * Checks whether the result of a node is numeric or not + * @param {ASTNode} node The node to test + * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call + */ +function isNumeric(node) { + return ( + node.type === "Literal" && typeof node.value === "number" || + node.type === "CallExpression" && ( + node.callee.name === "Number" || + node.callee.name === "parseInt" || + node.callee.name === "parseFloat" + ) + ); +} + +/** + * Returns the first non-numeric operand in a BinaryExpression. Designed to be + * used from bottom to up since it walks up the BinaryExpression trees using + * node.parent to find the result. + * @param {BinaryExpression} node The BinaryExpression node to be walked up on + * @returns {ASTNode|null} The first non-numeric item in the BinaryExpression tree or null + */ +function getNonNumericOperand(node) { + const left = node.left, + right = node.right; + + if (right.type !== "BinaryExpression" && !isNumeric(right)) { + return right; + } + + if (left.type !== "BinaryExpression" && !isNumeric(left)) { + return left; + } + + return null; +} + +/** + * Checks whether an expression evaluates to a string. + * @param {ASTNode} node node that represents the expression to check. + * @returns {boolean} Whether or not the expression evaluates to a string. + */ +function isStringType(node) { + return astUtils.isStringLiteral(node) || + ( + node.type === "CallExpression" && + node.callee.type === "Identifier" && + node.callee.name === "String" + ); +} + +/** + * Checks whether a node is an empty string literal or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the passed in node is an + * empty string literal or not. + */ +function isEmptyString(node) { + return astUtils.isStringLiteral(node) && (node.value === "" || (node.type === "TemplateLiteral" && node.quasis.length === 1 && node.quasis[0].value.cooked === "")); +} + +/** + * Checks whether or not a node is a concatenating with an empty string. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a concatenating with an empty string. + */ +function isConcatWithEmptyString(node) { + return node.operator === "+" && ( + (isEmptyString(node.left) && !isStringType(node.right)) || + (isEmptyString(node.right) && !isStringType(node.left)) + ); +} + +/** + * Checks whether or not a node is appended with an empty string. + * @param {ASTNode} node An AssignmentExpression node to check. + * @returns {boolean} Whether or not the node is appended with an empty string. + */ +function isAppendEmptyString(node) { + return node.operator === "+=" && isEmptyString(node.right); +} + +/** + * Returns the operand that is not an empty string from a flagged BinaryExpression. + * @param {ASTNode} node The flagged BinaryExpression node to check. + * @returns {ASTNode} The operand that is not an empty string from a flagged BinaryExpression. + */ +function getNonEmptyOperand(node) { + return isEmptyString(node.left) ? node.right : node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + hasSuggestions: true, + type: "suggestion", + + docs: { + description: "Disallow shorthand type conversions", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-implicit-coercion" + }, + + fixable: "code", + + schema: [{ + type: "object", + properties: { + boolean: { + type: "boolean" + }, + number: { + type: "boolean" + }, + string: { + type: "boolean" + }, + disallowTemplateShorthand: { + type: "boolean" + }, + allow: { + type: "array", + items: { + enum: ALLOWABLE_OPERATORS + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + defaultOptions: [{ + allow: [], + boolean: true, + disallowTemplateShorthand: false, + number: true, + string: true + }], + + messages: { + implicitCoercion: "Unexpected implicit coercion encountered. Use `{{recommendation}}` instead.", + useRecommendation: "Use `{{recommendation}}` instead." + } + }, + + create(context) { + const [options] = context.options; + const sourceCode = context.sourceCode; + + /** + * Reports an error and autofixes the node + * @param {ASTNode} node An ast node to report the error on. + * @param {string} recommendation The recommended code for the issue + * @param {bool} shouldSuggest Whether this report should offer a suggestion + * @param {bool} shouldFix Whether this report should fix the node + * @returns {void} + */ + function report(node, recommendation, shouldSuggest, shouldFix) { + + /** + * Fix function + * @param {RuleFixer} fixer The fixer to fix. + * @returns {Fix} The fix object. + */ + function fix(fixer) { + const tokenBefore = sourceCode.getTokenBefore(node); + + if ( + tokenBefore?.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, recommendation) + ) { + return fixer.replaceText(node, ` ${recommendation}`); + } + + return fixer.replaceText(node, recommendation); + } + + context.report({ + node, + messageId: "implicitCoercion", + data: { recommendation }, + fix(fixer) { + if (!shouldFix) { + return null; + } + + return fix(fixer); + }, + suggest: [ + { + messageId: "useRecommendation", + data: { recommendation }, + fix(fixer) { + if (shouldFix || !shouldSuggest) { + return null; + } + + return fix(fixer); + } + } + ] + }); + } + + return { + UnaryExpression(node) { + let operatorAllowed; + + // !!foo + operatorAllowed = options.allow.includes("!!"); + if (!operatorAllowed && options.boolean && isDoubleLogicalNegating(node)) { + const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`; + const variable = astUtils.getVariableByName(sourceCode.getScope(node), "Boolean"); + const booleanExists = variable?.identifiers.length === 0; + + report(node, recommendation, true, booleanExists); + } + + // ~foo.indexOf(bar) + operatorAllowed = options.allow.includes("~"); + if (!operatorAllowed && options.boolean && isBinaryNegatingOfIndexOf(node)) { + + // `foo?.indexOf(bar) !== -1` will be true (== found) if the `foo` is nullish. So use `>= 0` in that case. + const comparison = node.argument.type === "ChainExpression" ? ">= 0" : "!== -1"; + const recommendation = `${sourceCode.getText(node.argument)} ${comparison}`; + + report(node, recommendation, false, false); + } + + // +foo + operatorAllowed = options.allow.includes("+"); + if (!operatorAllowed && options.number && node.operator === "+" && !isNumeric(node.argument)) { + const recommendation = `Number(${sourceCode.getText(node.argument)})`; + + report(node, recommendation, true, false); + } + + // -(-foo) + operatorAllowed = options.allow.includes("- -"); + if (!operatorAllowed && options.number && node.operator === "-" && node.argument.type === "UnaryExpression" && node.argument.operator === "-" && !isNumeric(node.argument.argument)) { + const recommendation = `Number(${sourceCode.getText(node.argument.argument)})`; + + report(node, recommendation, true, false); + } + }, + + // Use `:exit` to prevent double reporting + "BinaryExpression:exit"(node) { + let operatorAllowed; + + // 1 * foo + operatorAllowed = options.allow.includes("*"); + const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && !isMultiplyByFractionOfOne(node, sourceCode) && + getNonNumericOperand(node); + + if (nonNumericOperand) { + const recommendation = `Number(${sourceCode.getText(nonNumericOperand)})`; + + report(node, recommendation, true, false); + } + + // foo - 0 + operatorAllowed = options.allow.includes("-"); + if (!operatorAllowed && options.number && node.operator === "-" && node.right.type === "Literal" && node.right.value === 0 && !isNumeric(node.left)) { + const recommendation = `Number(${sourceCode.getText(node.left)})`; + + report(node, recommendation, true, false); + } + + // "" + foo + operatorAllowed = options.allow.includes("+"); + if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) { + const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`; + + report(node, recommendation, true, false); + } + }, + + AssignmentExpression(node) { + + // foo += "" + const operatorAllowed = options.allow.includes("+"); + + if (!operatorAllowed && options.string && isAppendEmptyString(node)) { + const code = sourceCode.getText(getNonEmptyOperand(node)); + const recommendation = `${code} = String(${code})`; + + report(node, recommendation, true, false); + } + }, + + TemplateLiteral(node) { + if (!options.disallowTemplateShorthand) { + return; + } + + // tag`${foo}` + if (node.parent.type === "TaggedTemplateExpression") { + return; + } + + // `` or `${foo}${bar}` + if (node.expressions.length !== 1) { + return; + } + + + // `prefix${foo}` + if (node.quasis[0].value.cooked !== "") { + return; + } + + // `${foo}postfix` + if (node.quasis[1].value.cooked !== "") { + return; + } + + // if the expression is already a string, then this isn't a coercion + if (isStringType(node.expressions[0])) { + return; + } + + const code = sourceCode.getText(node.expressions[0]); + const recommendation = `String(${code})`; + + report(node, recommendation, true, false); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-implicit-globals.js b/node_modules/eslint/lib/rules/no-implicit-globals.js new file mode 100644 index 0000000..0ed96e8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implicit-globals.js @@ -0,0 +1,148 @@ +/** + * @fileoverview Rule to check for implicit global variables, functions and classes. + * @author Joshua Peek + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + lexicalBindings: false + }], + + docs: { + description: "Disallow declarations in the global scope", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-implicit-globals" + }, + + schema: [{ + type: "object", + properties: { + lexicalBindings: { + type: "boolean" + } + }, + additionalProperties: false + }], + + messages: { + globalNonLexicalBinding: "Unexpected {{kind}} declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable.", + globalLexicalBinding: "Unexpected {{kind}} declaration in the global scope, wrap in a block or in an IIFE.", + globalVariableLeak: "Global variable leak, declare the variable if it is intended to be local.", + assignmentToReadonlyGlobal: "Unexpected assignment to read-only global variable.", + redeclarationOfReadonlyGlobal: "Unexpected redeclaration of read-only global variable." + } + }, + + create(context) { + const [{ lexicalBindings: checkLexicalBindings }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Reports the node. + * @param {ASTNode} node Node to report. + * @param {string} messageId Id of the message to report. + * @param {string|undefined} kind Declaration kind, can be 'var', 'const', 'let', function or class. + * @returns {void} + */ + function report(node, messageId, kind) { + context.report({ + node, + messageId, + data: { + kind + } + }); + } + + return { + Program(node) { + const scope = sourceCode.getScope(node); + + scope.variables.forEach(variable => { + + // Only ESLint global variables have the `writable` key. + const isReadonlyEslintGlobalVariable = variable.writeable === false; + const isWritableEslintGlobalVariable = variable.writeable === true; + + if (isWritableEslintGlobalVariable) { + + // Everything is allowed with writable ESLint global variables. + return; + } + + // Variables exported by "exported" block comments + if (variable.eslintExported) { + return; + } + + variable.defs.forEach(def => { + const defNode = def.node; + + if (def.type === "FunctionName" || (def.type === "Variable" && def.parent.kind === "var")) { + if (isReadonlyEslintGlobalVariable) { + report(defNode, "redeclarationOfReadonlyGlobal"); + } else { + report( + defNode, + "globalNonLexicalBinding", + def.type === "FunctionName" ? "function" : `'${def.parent.kind}'` + ); + } + } + + if (checkLexicalBindings) { + if (def.type === "ClassName" || + (def.type === "Variable" && (def.parent.kind === "let" || def.parent.kind === "const"))) { + if (isReadonlyEslintGlobalVariable) { + report(defNode, "redeclarationOfReadonlyGlobal"); + } else { + report( + defNode, + "globalLexicalBinding", + def.type === "ClassName" ? "class" : `'${def.parent.kind}'` + ); + } + } + } + }); + }); + + // Undeclared assigned variables. + scope.implicit.variables.forEach(variable => { + const scopeVariable = scope.set.get(variable.name); + let messageId; + + if (scopeVariable) { + + // ESLint global variable + if (scopeVariable.writeable) { + return; + } + messageId = "assignmentToReadonlyGlobal"; + + } else { + + // Reference to an unknown variable, possible global leak. + messageId = "globalVariableLeak"; + } + + // def.node is an AssignmentExpression, ForInStatement or ForOfStatement. + variable.defs.forEach(def => { + report(def.node, messageId); + }); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-implied-eval.js b/node_modules/eslint/lib/rules/no-implied-eval.js new file mode 100644 index 0000000..9a84f8c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implied-eval.js @@ -0,0 +1,132 @@ +/** + * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { getStaticValue } = require("@eslint-community/eslint-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow the use of `eval()`-like methods", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-implied-eval" + }, + + schema: [], + + messages: { + impliedEval: "Implied eval. Consider passing a function instead of a string." + } + }, + + create(context) { + const GLOBAL_CANDIDATES = Object.freeze(["global", "window", "globalThis"]); + const EVAL_LIKE_FUNC_PATTERN = /^(?:set(?:Interval|Timeout)|execScript)$/u; + const sourceCode = context.sourceCode; + + /** + * Checks whether a node is evaluated as a string or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is evaluated as a string. + */ + function isEvaluatedString(node) { + if ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ) { + return true; + } + if (node.type === "BinaryExpression" && node.operator === "+") { + return isEvaluatedString(node.left) || isEvaluatedString(node.right); + } + return false; + } + + /** + * Reports if the `CallExpression` node has evaluated argument. + * @param {ASTNode} node A CallExpression to check. + * @returns {void} + */ + function reportImpliedEvalCallExpression(node) { + const [firstArgument] = node.arguments; + + if (firstArgument) { + + const staticValue = getStaticValue(firstArgument, sourceCode.getScope(node)); + const isStaticString = staticValue && typeof staticValue.value === "string"; + const isString = isStaticString || isEvaluatedString(firstArgument); + + if (isString) { + context.report({ + node, + messageId: "impliedEval" + }); + } + } + + } + + /** + * Reports calls of `implied eval` via the global references. + * @param {Variable} globalVar A global variable to check. + * @returns {void} + */ + function reportImpliedEvalViaGlobal(globalVar) { + const { references, name } = globalVar; + + references.forEach(ref => { + const identifier = ref.identifier; + let node = identifier.parent; + + while (astUtils.isSpecificMemberAccess(node, null, name)) { + node = node.parent; + } + + if (astUtils.isSpecificMemberAccess(node, null, EVAL_LIKE_FUNC_PATTERN)) { + const calleeNode = node.parent.type === "ChainExpression" ? node.parent : node; + const parent = calleeNode.parent; + + if (parent.type === "CallExpression" && parent.callee === calleeNode) { + reportImpliedEvalCallExpression(parent); + } + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + CallExpression(node) { + if (astUtils.isSpecificId(node.callee, EVAL_LIKE_FUNC_PATTERN)) { + reportImpliedEvalCallExpression(node); + } + }, + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + + GLOBAL_CANDIDATES + .map(candidate => astUtils.getVariableByName(globalScope, candidate)) + .filter(globalVar => !!globalVar && globalVar.defs.length === 0) + .forEach(reportImpliedEvalViaGlobal); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-import-assign.js b/node_modules/eslint/lib/rules/no-import-assign.js new file mode 100644 index 0000000..c699886 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-import-assign.js @@ -0,0 +1,241 @@ +/** + * @fileoverview Rule to flag updates of imported bindings. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const { findVariable } = require("@eslint-community/eslint-utils"); +const astUtils = require("./utils/ast-utils"); + +const WellKnownMutationFunctions = { + Object: /^(?:assign|definePropert(?:y|ies)|freeze|setPrototypeOf)$/u, + Reflect: /^(?:(?:define|delete)Property|set(?:PrototypeOf)?)$/u +}; + +/** + * Check if a given node is LHS of an assignment node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is LHS. + */ +function isAssignmentLeft(node) { + const { parent } = node; + + return ( + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // Destructuring assignments + parent.type === "ArrayPattern" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + parent.type === "RestElement" || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Check if a given node is the operand of mutation unary operator. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is the operand of mutation unary operator. + */ +function isOperandOfMutationUnaryOperator(node) { + const argumentNode = node.parent.type === "ChainExpression" + ? node.parent + : node; + const { parent } = argumentNode; + + return ( + ( + parent.type === "UpdateExpression" && + parent.argument === argumentNode + ) || + ( + parent.type === "UnaryExpression" && + parent.operator === "delete" && + parent.argument === argumentNode + ) + ); +} + +/** + * Check if a given node is the iteration variable of `for-in`/`for-of` syntax. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is the iteration variable. + */ +function isIterationVariable(node) { + const { parent } = node; + + return ( + ( + parent.type === "ForInStatement" && + parent.left === node + ) || + ( + parent.type === "ForOfStatement" && + parent.left === node + ) + ); +} + +/** + * Check if a given node is at the first argument of a well-known mutation function. + * - `Object.assign` + * - `Object.defineProperty` + * - `Object.defineProperties` + * - `Object.freeze` + * - `Object.setPrototypeOf` + * - `Reflect.defineProperty` + * - `Reflect.deleteProperty` + * - `Reflect.set` + * - `Reflect.setPrototypeOf` + * @param {ASTNode} node The node to check. + * @param {Scope} scope A `escope.Scope` object to find variable (whichever). + * @returns {boolean} `true` if the node is at the first argument of a well-known mutation function. + */ +function isArgumentOfWellKnownMutationFunction(node, scope) { + const { parent } = node; + + if (parent.type !== "CallExpression" || parent.arguments[0] !== node) { + return false; + } + const callee = astUtils.skipChainExpression(parent.callee); + + if ( + !astUtils.isSpecificMemberAccess(callee, "Object", WellKnownMutationFunctions.Object) && + !astUtils.isSpecificMemberAccess(callee, "Reflect", WellKnownMutationFunctions.Reflect) + ) { + return false; + } + const variable = findVariable(scope, callee.object); + + return variable !== null && variable.scope.type === "global"; +} + +/** + * Check if the identifier node is placed at to update members. + * @param {ASTNode} id The Identifier node to check. + * @param {Scope} scope A `escope.Scope` object to find variable (whichever). + * @returns {boolean} `true` if the member of `id` was updated. + */ +function isMemberWrite(id, scope) { + const { parent } = id; + + return ( + ( + parent.type === "MemberExpression" && + parent.object === id && + ( + isAssignmentLeft(parent) || + isOperandOfMutationUnaryOperator(parent) || + isIterationVariable(parent) + ) + ) || + isArgumentOfWellKnownMutationFunction(id, scope) + ); +} + +/** + * Get the mutation node. + * @param {ASTNode} id The Identifier node to get. + * @returns {ASTNode} The mutation node. + */ +function getWriteNode(id) { + let node = id.parent; + + while ( + node && + node.type !== "AssignmentExpression" && + node.type !== "UpdateExpression" && + node.type !== "UnaryExpression" && + node.type !== "CallExpression" && + node.type !== "ForInStatement" && + node.type !== "ForOfStatement" + ) { + node = node.parent; + } + + return node || id; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow assigning to imported bindings", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-import-assign" + }, + + schema: [], + + messages: { + readonly: "'{{name}}' is read-only.", + readonlyMember: "The members of '{{name}}' are read-only." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + ImportDeclaration(node) { + const scope = sourceCode.getScope(node); + + for (const variable of sourceCode.getDeclaredVariables(node)) { + const shouldCheckMembers = variable.defs.some( + d => d.node.type === "ImportNamespaceSpecifier" + ); + let prevIdNode = null; + + for (const reference of variable.references) { + const idNode = reference.identifier; + + /* + * AssignmentPattern (e.g. `[a = 0] = b`) makes two write + * references for the same identifier. This should skip + * the one of the two in order to prevent redundant reports. + */ + if (idNode === prevIdNode) { + continue; + } + prevIdNode = idNode; + + if (reference.isWrite()) { + context.report({ + node: getWriteNode(idNode), + messageId: "readonly", + data: { name: idNode.name } + }); + } else if (shouldCheckMembers && isMemberWrite(idNode, scope)) { + context.report({ + node: getWriteNode(idNode), + messageId: "readonlyMember", + data: { name: idNode.name } + }); + } + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-inline-comments.js b/node_modules/eslint/lib/rules/no-inline-comments.js new file mode 100644 index 0000000..cc34dac --- /dev/null +++ b/node_modules/eslint/lib/rules/no-inline-comments.js @@ -0,0 +1,109 @@ +/** + * @fileoverview Enforces or disallows inline comments. + * @author Greg Cochard + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{}], + + docs: { + description: "Disallow inline comments after code", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-inline-comments" + }, + + schema: [ + { + type: "object", + properties: { + ignorePattern: { + type: "string" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedInlineComment: "Unexpected comment inline with code." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const [{ ignorePattern }] = context.options; + const customIgnoreRegExp = ignorePattern && new RegExp(ignorePattern, "u"); + + /** + * Will check that comments are not on lines starting with or ending with code + * @param {ASTNode} node The comment node to check + * @private + * @returns {void} + */ + function testCodeAroundComment(node) { + + const startLine = String(sourceCode.lines[node.loc.start.line - 1]), + endLine = String(sourceCode.lines[node.loc.end.line - 1]), + preamble = startLine.slice(0, node.loc.start.column).trim(), + postamble = endLine.slice(node.loc.end.column).trim(), + isPreambleEmpty = !preamble, + isPostambleEmpty = !postamble; + + // Nothing on both sides + if (isPreambleEmpty && isPostambleEmpty) { + return; + } + + // Matches the ignore pattern + if (customIgnoreRegExp && customIgnoreRegExp.test(node.value)) { + return; + } + + // JSX Exception + if ( + (isPreambleEmpty || preamble === "{") && + (isPostambleEmpty || postamble === "}") + ) { + const enclosingNode = sourceCode.getNodeByRangeIndex(node.range[0]); + + if (enclosingNode && enclosingNode.type === "JSXEmptyExpression") { + return; + } + } + + // Don't report ESLint directive comments + if (astUtils.isDirectiveComment(node)) { + return; + } + + context.report({ + node, + messageId: "unexpectedInlineComment" + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + sourceCode.getAllComments() + .filter(token => token.type !== "Shebang") + .forEach(testCodeAroundComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-inner-declarations.js b/node_modules/eslint/lib/rules/no-inner-declarations.js new file mode 100644 index 0000000..c90b9fa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-inner-declarations.js @@ -0,0 +1,133 @@ +/** + * @fileoverview Rule to enforce declarations in program or function body root. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const validParent = new Set(["Program", "StaticBlock", "ExportNamedDeclaration", "ExportDefaultDeclaration"]); +const validBlockStatementParent = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]); + +/** + * Finds the nearest enclosing context where this rule allows declarations and returns its description. + * @param {ASTNode} node Node to search from. + * @returns {string} Description. One of "program", "function body", "class static block body". + */ +function getAllowedBodyDescription(node) { + let { parent } = node; + + while (parent) { + + if (parent.type === "StaticBlock") { + return "class static block body"; + } + + if (astUtils.isFunction(parent)) { + return "function body"; + } + + ({ parent } = parent); + } + + return "program"; +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: ["functions", { blockScopedFunctions: "allow" }], + + docs: { + description: "Disallow variable or `function` declarations in nested blocks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-inner-declarations" + }, + + schema: [ + { + enum: ["functions", "both"] + }, + { + type: "object", + properties: { + blockScopedFunctions: { + enum: ["allow", "disallow"] + } + }, + additionalProperties: false + } + ], + + messages: { + moveDeclToRoot: "Move {{type}} declaration to {{body}} root." + } + }, + + create(context) { + const both = context.options[0] === "both"; + const { blockScopedFunctions } = context.options[1]; + + const sourceCode = context.sourceCode; + const ecmaVersion = context.languageOptions.ecmaVersion; + + /** + * Ensure that a given node is at a program or function body's root. + * @param {ASTNode} node Declaration node to check. + * @returns {void} + */ + function check(node) { + const parent = node.parent; + + if ( + parent.type === "BlockStatement" && validBlockStatementParent.has(parent.parent.type) + ) { + return; + } + + if (validParent.has(parent.type)) { + return; + } + + context.report({ + node, + messageId: "moveDeclToRoot", + data: { + type: (node.type === "FunctionDeclaration" ? "function" : "variable"), + body: getAllowedBodyDescription(node) + } + }); + } + + return { + + FunctionDeclaration(node) { + const isInStrictCode = sourceCode.getScope(node).upper.isStrict; + + if (blockScopedFunctions === "allow" && ecmaVersion >= 2015 && isInStrictCode) { + return; + } + + check(node); + }, + VariableDeclaration(node) { + if (both && node.kind === "var") { + check(node); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-invalid-regexp.js b/node_modules/eslint/lib/rules/no-invalid-regexp.js new file mode 100644 index 0000000..635bd66 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-invalid-regexp.js @@ -0,0 +1,211 @@ +/** + * @fileoverview Validate strings passed to the RegExp constructor + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator; +const validator = new RegExpValidator(); +const validFlags = "dgimsuvy"; +const undefined1 = void 0; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{}], + + docs: { + description: "Disallow invalid regular expression strings in `RegExp` constructors", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-invalid-regexp" + }, + + schema: [{ + type: "object", + properties: { + allowConstructorFlags: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }], + + messages: { + regexMessage: "{{message}}." + } + }, + + create(context) { + const [{ allowConstructorFlags }] = context.options; + let allowedFlags = []; + + if (allowConstructorFlags) { + const temp = allowConstructorFlags.join("").replace(new RegExp(`[${validFlags}]`, "gu"), ""); + + if (temp) { + allowedFlags = [...new Set(temp)]; + } + } + + /** + * Reports error with the provided message. + * @param {ASTNode} node The node holding the invalid RegExp + * @param {string} message The message to report. + * @returns {void} + */ + function report(node, message) { + context.report({ + node, + messageId: "regexMessage", + data: { message } + }); + } + + /** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ + function isString(node) { + return node && node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Gets flags of a regular expression created by the given `RegExp()` or `new RegExp()` call + * Examples: + * new RegExp(".") // => "" + * new RegExp(".", "gu") // => "gu" + * new RegExp(".", flags) // => null + * @param {ASTNode} node `CallExpression` or `NewExpression` node + * @returns {string|null} flags if they can be determined, `null` otherwise + * @private + */ + function getFlags(node) { + if (node.arguments.length < 2) { + return ""; + } + + if (isString(node.arguments[1])) { + return node.arguments[1].value; + } + + return null; + } + + /** + * Check syntax error in a given pattern. + * @param {string} pattern The RegExp pattern to validate. + * @param {Object} flags The RegExp flags to validate. + * @param {boolean} [flags.unicode] The Unicode flag. + * @param {boolean} [flags.unicodeSets] The UnicodeSets flag. + * @returns {string|null} The syntax error. + */ + function validateRegExpPattern(pattern, flags) { + try { + validator.validatePattern(pattern, undefined1, undefined1, flags); + return null; + } catch (err) { + return err.message; + } + } + + /** + * Check syntax error in a given flags. + * @param {string|null} flags The RegExp flags to validate. + * @param {string|null} flagsToCheck The RegExp invalid flags. + * @param {string} allFlags all valid and allowed flags. + * @returns {string|null} The syntax error. + */ + function validateRegExpFlags(flags, flagsToCheck, allFlags) { + const duplicateFlags = []; + + if (typeof flagsToCheck === "string") { + for (const flag of flagsToCheck) { + if (allFlags.includes(flag)) { + duplicateFlags.push(flag); + } + } + } + + /* + * `regexpp` checks the combination of `u` and `v` flags when parsing `Pattern` according to `ecma262`, + * but this rule may check only the flag when the pattern is unidentifiable, so check it here. + * https://tc39.es/ecma262/multipage/text-processing.html#sec-parsepattern + */ + if (flags && flags.includes("u") && flags.includes("v")) { + return "Regex 'u' and 'v' flags cannot be used together"; + } + + if (duplicateFlags.length > 0) { + return `Duplicate flags ('${duplicateFlags.join("")}') supplied to RegExp constructor`; + } + + if (!flagsToCheck) { + return null; + } + + return `Invalid flags supplied to RegExp constructor '${flagsToCheck}'`; + } + + return { + "CallExpression, NewExpression"(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "RegExp") { + return; + } + + const flags = getFlags(node); + let flagsToCheck = flags; + const allFlags = allowedFlags.length > 0 ? validFlags.split("").concat(allowedFlags) : validFlags.split(""); + + if (flags) { + allFlags.forEach(flag => { + flagsToCheck = flagsToCheck.replace(flag, ""); + }); + } + + let message = validateRegExpFlags(flags, flagsToCheck, allFlags); + + if (message) { + report(node, message); + return; + } + + if (!isString(node.arguments[0])) { + return; + } + + const pattern = node.arguments[0].value; + + message = ( + + // If flags are unknown, report the regex only if its pattern is invalid both with and without the "u" flag + flags === null + ? ( + validateRegExpPattern(pattern, { unicode: true, unicodeSets: false }) && + validateRegExpPattern(pattern, { unicode: false, unicodeSets: true }) && + validateRegExpPattern(pattern, { unicode: false, unicodeSets: false }) + ) + : validateRegExpPattern(pattern, { unicode: flags.includes("u"), unicodeSets: flags.includes("v") }) + ); + + if (message) { + report(node, message); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-invalid-this.js b/node_modules/eslint/lib/rules/no-invalid-this.js new file mode 100644 index 0000000..0a7b9e4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-invalid-this.js @@ -0,0 +1,150 @@ +/** + * @fileoverview A rule to disallow `this` keywords in contexts where the value of `this` is `undefined`. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given code path is a code path with lexical `this` binding. + * That is, if `this` within the code path refers to `this` of surrounding code path. + * @param {CodePath} codePath Code path. + * @param {ASTNode} node Node that started the code path. + * @returns {boolean} `true` if it is a code path with lexical `this` binding. + */ +function isCodePathWithLexicalThis(codePath, node) { + return codePath.origin === "function" && node.type === "ArrowFunctionExpression"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ capIsConstructor: true }], + + docs: { + description: "Disallow use of `this` in contexts where the value of `this` is `undefined`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-invalid-this" + }, + + schema: [ + { + type: "object", + properties: { + capIsConstructor: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedThis: "Unexpected 'this'." + } + }, + + create(context) { + const [{ capIsConstructor }] = context.options; + const stack = [], + sourceCode = context.sourceCode; + + /** + * Gets the current checking context. + * + * The return value has a flag that whether or not `this` keyword is valid. + * The flag is initialized when got at the first time. + * @returns {{valid: boolean}} + * an object which has a flag that whether or not `this` keyword is valid. + */ + stack.getCurrent = function() { + const current = this.at(-1); + + if (!current.init) { + current.init = true; + current.valid = !astUtils.isDefaultThisBinding( + current.node, + sourceCode, + { capIsConstructor } + ); + } + return current; + }; + + return { + + onCodePathStart(codePath, node) { + if (isCodePathWithLexicalThis(codePath, node)) { + return; + } + + if (codePath.origin === "program") { + const scope = sourceCode.getScope(node); + const features = context.languageOptions.parserOptions.ecmaFeatures || {}; + + // `this` at the top level of scripts always refers to the global object + stack.push({ + init: true, + node, + valid: !( + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict) + ) + }); + + return; + } + + /* + * `init: false` means that `valid` isn't determined yet. + * Most functions don't use `this`, and the calculation for `valid` + * is relatively costly, so we'll calculate it lazily when the first + * `this` within the function is traversed. A special case are non-strict + * functions, because `this` refers to the global object and therefore is + * always valid, so we can set `init: true` right away. + */ + stack.push({ + init: !sourceCode.getScope(node).isStrict, + node, + valid: true + }); + }, + + onCodePathEnd(codePath, node) { + if (isCodePathWithLexicalThis(codePath, node)) { + return; + } + + stack.pop(); + }, + + // Reports if `this` of the current context is invalid. + ThisExpression(node) { + const current = stack.getCurrent(); + + if (current && !current.valid) { + context.report({ + node, + messageId: "unexpectedThis" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-irregular-whitespace.js b/node_modules/eslint/lib/rules/no-irregular-whitespace.js new file mode 100644 index 0000000..3069db1 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-irregular-whitespace.js @@ -0,0 +1,278 @@ +/** + * @fileoverview Rule to disallow whitespace that is not a tab or space, whitespace inside strings and comments are allowed + * @author Jonathan Kingston + * @author Christophe Porteneuve + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u; +const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mgu; +const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/mgu; +const LINE_BREAK = astUtils.createGlobalLinebreakMatcher(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + skipComments: false, + skipJSXText: false, + skipRegExps: false, + skipStrings: true, + skipTemplates: false + }], + + docs: { + description: "Disallow irregular whitespace", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-irregular-whitespace" + }, + + schema: [ + { + type: "object", + properties: { + skipComments: { + type: "boolean" + }, + skipStrings: { + type: "boolean" + }, + skipTemplates: { + type: "boolean" + }, + skipRegExps: { + type: "boolean" + }, + skipJSXText: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + noIrregularWhitespace: "Irregular whitespace not allowed." + } + }, + + create(context) { + const [{ + skipComments, + skipStrings, + skipRegExps, + skipTemplates, + skipJSXText + }] = context.options; + + const sourceCode = context.sourceCode; + const commentNodes = sourceCode.getAllComments(); + + // Module store of errors that we have found + let errors = []; + + /** + * Removes errors that occur inside the given node + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeWhitespaceError(node) { + const locStart = node.loc.start; + const locEnd = node.loc.end; + + errors = errors.filter(({ loc: { start: errorLocStart } }) => ( + errorLocStart.line < locStart.line || + errorLocStart.line === locStart.line && errorLocStart.column < locStart.column || + errorLocStart.line === locEnd.line && errorLocStart.column >= locEnd.column || + errorLocStart.line > locEnd.line + )); + } + + /** + * Checks literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInLiteral(node) { + const shouldCheckStrings = skipStrings && (typeof node.value === "string"); + const shouldCheckRegExps = skipRegExps && Boolean(node.regex); + + if (shouldCheckStrings || shouldCheckRegExps) { + + // If we have irregular characters remove them from the errors list + if (ALL_IRREGULARS.test(node.raw)) { + removeWhitespaceError(node); + } + } + } + + /** + * Checks template string literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInTemplateLiteral(node) { + if (typeof node.value.raw === "string") { + if (ALL_IRREGULARS.test(node.value.raw)) { + removeWhitespaceError(node); + } + } + } + + /** + * Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInComment(node) { + if (ALL_IRREGULARS.test(node.value)) { + removeWhitespaceError(node); + } + } + + /** + * Checks JSX nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInJSXText(node) { + if (ALL_IRREGULARS.test(node.raw)) { + removeWhitespaceError(node); + } + } + + /** + * Checks the program source for irregular whitespace + * @param {ASTNode} node The program node + * @returns {void} + * @private + */ + function checkForIrregularWhitespace(node) { + const sourceLines = sourceCode.lines; + + sourceLines.forEach((sourceLine, lineIndex) => { + const lineNumber = lineIndex + 1; + let match; + + while ((match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null) { + errors.push({ + node, + messageId: "noIrregularWhitespace", + loc: { + start: { + line: lineNumber, + column: match.index + }, + end: { + line: lineNumber, + column: match.index + match[0].length + } + } + }); + } + }); + } + + /** + * Checks the program source for irregular line terminators + * @param {ASTNode} node The program node + * @returns {void} + * @private + */ + function checkForIrregularLineTerminators(node) { + const source = sourceCode.getText(), + sourceLines = sourceCode.lines, + linebreaks = source.match(LINE_BREAK); + let lastLineIndex = -1, + match; + + while ((match = IRREGULAR_LINE_TERMINATORS.exec(source)) !== null) { + const lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0; + + errors.push({ + node, + messageId: "noIrregularWhitespace", + loc: { + start: { + line: lineIndex + 1, + column: sourceLines[lineIndex].length + }, + end: { + line: lineIndex + 2, + column: 0 + } + } + }); + + lastLineIndex = lineIndex; + } + } + + /** + * A no-op function to act as placeholder for comment accumulation when the `skipComments` option is `false`. + * @returns {void} + * @private + */ + function noop() { } + + const nodes = {}; + + if (ALL_IRREGULARS.test(sourceCode.getText())) { + nodes.Program = function(node) { + + /* + * As we can easily fire warnings for all white space issues with + * all the source its simpler to fire them here. + * This means we can check all the application code without having + * to worry about issues caused in the parser tokens. + * When writing this code also evaluating per node was missing out + * connecting tokens in some cases. + * We can later filter the errors when they are found to be not an + * issue in nodes we don't care about. + */ + checkForIrregularWhitespace(node); + checkForIrregularLineTerminators(node); + }; + + nodes.Literal = removeInvalidNodeErrorsInLiteral; + nodes.TemplateElement = skipTemplates ? removeInvalidNodeErrorsInTemplateLiteral : noop; + nodes.JSXText = skipJSXText ? removeInvalidNodeErrorsInJSXText : noop; + nodes["Program:exit"] = function() { + if (skipComments) { + + // First strip errors occurring in comment nodes. + commentNodes.forEach(removeInvalidNodeErrorsInComment); + } + + // If we have any errors remaining report on them + errors.forEach(error => context.report(error)); + }; + } else { + nodes.Program = noop; + } + + return nodes; + } +}; diff --git a/node_modules/eslint/lib/rules/no-iterator.js b/node_modules/eslint/lib/rules/no-iterator.js new file mode 100644 index 0000000..dcd9683 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-iterator.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to flag usage of __iterator__ property + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticPropertyName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow the use of the `__iterator__` property", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-iterator" + }, + + schema: [], + + messages: { + noIterator: "Reserved name '__iterator__'." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + + if (getStaticPropertyName(node) === "__iterator__") { + context.report({ + node, + messageId: "noIterator" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-label-var.js b/node_modules/eslint/lib/rules/no-label-var.js new file mode 100644 index 0000000..31dee3b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-label-var.js @@ -0,0 +1,81 @@ +/** + * @fileoverview Rule to flag labels that are the same as an identifier + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow labels that share a name with a variable", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-label-var" + }, + + schema: [], + + messages: { + identifierClashWithLabel: "Found identifier with same name as label." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the identifier is present inside current scope + * @param {Object} scope current scope + * @param {string} name To evaluate + * @returns {boolean} True if its present + * @private + */ + function findIdentifier(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + LabeledStatement(node) { + + // Fetch the innermost scope. + const scope = sourceCode.getScope(node); + + /* + * Recursively find the identifier walking up the scope, starting + * with the innermost scope. + */ + if (findIdentifier(scope, node.label.name)) { + context.report({ + node, + messageId: "identifierClashWithLabel" + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-labels.js b/node_modules/eslint/lib/rules/no-labels.js new file mode 100644 index 0000000..2b96c92 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-labels.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Disallow Labeled Statements + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allowLoop: false, + allowSwitch: false + }], + + docs: { + description: "Disallow labeled statements", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-labels" + }, + + schema: [ + { + type: "object", + properties: { + allowLoop: { + type: "boolean" + }, + allowSwitch: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedLabel: "Unexpected labeled statement.", + unexpectedLabelInBreak: "Unexpected label in break statement.", + unexpectedLabelInContinue: "Unexpected label in continue statement." + } + }, + + create(context) { + const [{ allowLoop, allowSwitch }] = context.options; + let scopeInfo = null; + + /** + * Gets the kind of a given node. + * @param {ASTNode} node A node to get. + * @returns {string} The kind of the node. + */ + function getBodyKind(node) { + if (astUtils.isLoop(node)) { + return "loop"; + } + if (node.type === "SwitchStatement") { + return "switch"; + } + return "other"; + } + + /** + * Checks whether the label of a given kind is allowed or not. + * @param {string} kind A kind to check. + * @returns {boolean} `true` if the kind is allowed. + */ + function isAllowed(kind) { + switch (kind) { + case "loop": return allowLoop; + case "switch": return allowSwitch; + default: return false; + } + } + + /** + * Checks whether a given name is a label of a loop or not. + * @param {string} label A name of a label to check. + * @returns {boolean} `true` if the name is a label of a loop. + */ + function getKind(label) { + let info = scopeInfo; + + while (info) { + if (info.label === label) { + return info.kind; + } + info = info.upper; + } + + /* c8 ignore next */ + return "other"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + LabeledStatement(node) { + scopeInfo = { + label: node.label.name, + kind: getBodyKind(node.body), + upper: scopeInfo + }; + }, + + "LabeledStatement:exit"(node) { + if (!isAllowed(scopeInfo.kind)) { + context.report({ + node, + messageId: "unexpectedLabel" + }); + } + + scopeInfo = scopeInfo.upper; + }, + + BreakStatement(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node, + messageId: "unexpectedLabelInBreak" + }); + } + }, + + ContinueStatement(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node, + messageId: "unexpectedLabelInContinue" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-lone-blocks.js b/node_modules/eslint/lib/rules/no-lone-blocks.js new file mode 100644 index 0000000..2e27089 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-lone-blocks.js @@ -0,0 +1,136 @@ +/** + * @fileoverview Rule to flag blocks with no reason to exist + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unnecessary nested blocks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-lone-blocks" + }, + + schema: [], + + messages: { + redundantBlock: "Block is redundant.", + redundantNestedBlock: "Nested block is redundant." + } + }, + + create(context) { + + // A stack of lone blocks to be checked for block-level bindings + const loneBlocks = []; + let ruleDef; + const sourceCode = context.sourceCode; + + /** + * Reports a node as invalid. + * @param {ASTNode} node The node to be reported. + * @returns {void} + */ + function report(node) { + const messageId = node.parent.type === "BlockStatement" || node.parent.type === "StaticBlock" + ? "redundantNestedBlock" + : "redundantBlock"; + + context.report({ + node, + messageId + }); + } + + /** + * Checks for any occurrence of a BlockStatement in a place where lists of statements can appear + * @param {ASTNode} node The node to check + * @returns {boolean} True if the node is a lone block. + */ + function isLoneBlock(node) { + return node.parent.type === "BlockStatement" || + node.parent.type === "StaticBlock" || + node.parent.type === "Program" || + + // Don't report blocks in switch cases if the block is the only statement of the case. + node.parent.type === "SwitchCase" && !(node.parent.consequent[0] === node && node.parent.consequent.length === 1); + } + + /** + * Checks the enclosing block of the current node for block-level bindings, + * and "marks it" as valid if any. + * @param {ASTNode} node The current node to check. + * @returns {void} + */ + function markLoneBlock(node) { + if (loneBlocks.length === 0) { + return; + } + + const block = node.parent; + + if (loneBlocks.at(-1) === block) { + loneBlocks.pop(); + } + } + + // Default rule definition: report all lone blocks + ruleDef = { + BlockStatement(node) { + if (isLoneBlock(node)) { + report(node); + } + } + }; + + // ES6: report blocks without block-level bindings, or that's only child of another block + if (context.languageOptions.ecmaVersion >= 2015) { + ruleDef = { + BlockStatement(node) { + if (isLoneBlock(node)) { + loneBlocks.push(node); + } + }, + "BlockStatement:exit"(node) { + if (loneBlocks.length > 0 && loneBlocks.at(-1) === node) { + loneBlocks.pop(); + report(node); + } else if ( + ( + node.parent.type === "BlockStatement" || + node.parent.type === "StaticBlock" + ) && + node.parent.body.length === 1 + ) { + report(node); + } + } + }; + + ruleDef.VariableDeclaration = function(node) { + if (node.kind !== "var") { + markLoneBlock(node); + } + }; + + ruleDef.FunctionDeclaration = function(node) { + if (sourceCode.getScope(node).isStrict) { + markLoneBlock(node); + } + }; + + ruleDef.ClassDeclaration = markLoneBlock; + } + + return ruleDef; + } +}; diff --git a/node_modules/eslint/lib/rules/no-lonely-if.js b/node_modules/eslint/lib/rules/no-lonely-if.js new file mode 100644 index 0000000..f66b794 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-lonely-if.js @@ -0,0 +1,95 @@ +/** + * @fileoverview Rule to disallow if as the only statement in an else block + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `if` statements as the only statement in `else` blocks", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-lonely-if" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedLonelyIf: "Unexpected if as the only statement in an else block." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + IfStatement(node) { + const parent = node.parent, + grandparent = parent.parent; + + if (parent && parent.type === "BlockStatement" && + parent.body.length === 1 && !astUtils.areBracesNecessary(parent, sourceCode) && + grandparent && grandparent.type === "IfStatement" && + parent === grandparent.alternate) { + context.report({ + node, + messageId: "unexpectedLonelyIf", + fix(fixer) { + const openingElseCurly = sourceCode.getFirstToken(parent); + const closingElseCurly = sourceCode.getLastToken(parent); + const elseKeyword = sourceCode.getTokenBefore(openingElseCurly); + const tokenAfterElseBlock = sourceCode.getTokenAfter(closingElseCurly); + const lastIfToken = sourceCode.getLastToken(node.consequent); + const sourceText = sourceCode.getText(); + + if (sourceText.slice(openingElseCurly.range[1], + node.range[0]).trim() || sourceText.slice(node.range[1], closingElseCurly.range[0]).trim()) { + + // Don't fix if there are any non-whitespace characters interfering (e.g. comments) + return null; + } + + if ( + node.consequent.type !== "BlockStatement" && lastIfToken.value !== ";" && tokenAfterElseBlock && + ( + node.consequent.loc.end.line === tokenAfterElseBlock.loc.start.line || + /^[([/+`-]/u.test(tokenAfterElseBlock.value) || + lastIfToken.value === "++" || + lastIfToken.value === "--" + ) + ) { + + /* + * If the `if` statement has no block, and is not followed by a semicolon, make sure that fixing + * the issue would not change semantics due to ASI. If this would happen, don't do a fix. + */ + return null; + } + + return fixer.replaceTextRange( + [openingElseCurly.range[0], closingElseCurly.range[1]], + (elseKeyword.range[1] === openingElseCurly.range[0] ? " " : "") + sourceCode.getText(node) + ); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-loop-func.js b/node_modules/eslint/lib/rules/no-loop-func.js new file mode 100644 index 0000000..ba372db --- /dev/null +++ b/node_modules/eslint/lib/rules/no-loop-func.js @@ -0,0 +1,238 @@ +/** + * @fileoverview Rule to flag creation of function inside a loop + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + + +/** + * Identifies is a node is a FunctionExpression which is part of an IIFE + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's an IIFE + */ +function isIIFE(node) { + return (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") && node.parent && node.parent.type === "CallExpression" && node.parent.callee === node; +} + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow function declarations that contain unsafe references inside loop statements", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-loop-func" + }, + + schema: [], + + messages: { + unsafeRefs: "Function declared in a loop contains unsafe references to variable(s) {{ varNames }}." + } + }, + + create(context) { + + const SKIPPED_IIFE_NODES = new Set(); + const sourceCode = context.sourceCode; + + /** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those, with the exception of IIFE. + * `Scope.through` contains references of nested functions. + * @param {ASTNode} node An AST node to get. + * @returns {ASTNode|null} The containing loop node of the specified node, or + * `null`. + */ + function getContainingLoopNode(node) { + for (let currentNode = node; currentNode.parent; currentNode = currentNode.parent) { + const parent = currentNode.parent; + + switch (parent.type) { + case "WhileStatement": + case "DoWhileStatement": + return parent; + + case "ForStatement": + + // `init` is outside of the loop. + if (parent.init !== currentNode) { + return parent; + } + break; + + case "ForInStatement": + case "ForOfStatement": + + // `right` is outside of the loop. + if (parent.right !== currentNode) { + return parent; + } + break; + + case "ArrowFunctionExpression": + case "FunctionExpression": + case "FunctionDeclaration": + + // We need to check nested functions only in case of IIFE. + if (SKIPPED_IIFE_NODES.has(parent)) { + break; + } + + return null; + default: + break; + } + } + + return null; + } + + /** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * @param {ASTNode} node A node to get. This is a loop node. + * @param {ASTNode|null} excludedNode A node that the result node should not + * include. + * @returns {ASTNode} The most outer loop node. + */ + function getTopLoopNode(node, excludedNode) { + const border = excludedNode ? excludedNode.range[1] : 0; + let retv = node; + let containingLoopNode = node; + + while (containingLoopNode && containingLoopNode.range[0] >= border) { + retv = containingLoopNode; + containingLoopNode = getContainingLoopNode(containingLoopNode); + } + + return retv; + } + + /** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * @param {ASTNode} loopNode A containing loop node. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is safe or not. + */ + function isSafe(loopNode, reference) { + const variable = reference.resolved; + const definition = variable && variable.defs[0]; + const declaration = definition && definition.parent; + const kind = (declaration && declaration.type === "VariableDeclaration") + ? declaration.kind + : ""; + + // Variables which are declared by `const` is safe. + if (kind === "const") { + return true; + } + + /* + * Variables which are declared by `let` in the loop is safe. + * It's a different instance from the next loop step's. + */ + if (kind === "let" && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1] + ) { + return true; + } + + /* + * WriteReferences which exist after this border are unsafe because those + * can modify the variable. + */ + const border = getTopLoopNode( + loopNode, + (kind === "let") ? declaration : null + ).range[0]; + + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * @param {eslint-scope.Reference} upperRef A reference to check. + * @returns {boolean} `true` if the reference is safe. + */ + function isSafeReference(upperRef) { + const id = upperRef.identifier; + + return ( + !upperRef.isWrite() || + variable.scope.variableScope === upperRef.from.variableScope && + id.range[0] < border + ); + } + + return Boolean(variable) && variable.references.every(isSafeReference); + } + + /** + * Reports functions which match the following condition: + * + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * @param {ASTNode} node The AST node to check. + * @returns {void} + */ + function checkForLoops(node) { + const loopNode = getContainingLoopNode(node); + + if (!loopNode) { + return; + } + + const references = sourceCode.getScope(node).through; + + // Check if the function is not asynchronous or a generator function + if (!(node.async || node.generator)) { + if (isIIFE(node)) { + + const isFunctionExpression = node.type === "FunctionExpression"; + + // Check if the function is referenced elsewhere in the code + const isFunctionReferenced = isFunctionExpression && node.id ? references.some(r => r.identifier.name === node.id.name) : false; + + if (!isFunctionReferenced) { + SKIPPED_IIFE_NODES.add(node); + return; + } + } + } + + const unsafeRefs = references.filter(r => r.resolved && !isSafe(loopNode, r)).map(r => r.identifier.name); + + if (unsafeRefs.length > 0) { + context.report({ + node, + messageId: "unsafeRefs", + data: { varNames: `'${unsafeRefs.join("', '")}'` } + }); + } + } + + return { + ArrowFunctionExpression: checkForLoops, + FunctionExpression: checkForLoops, + FunctionDeclaration: checkForLoops + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-loss-of-precision.js b/node_modules/eslint/lib/rules/no-loss-of-precision.js new file mode 100644 index 0000000..c50d8a8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-loss-of-precision.js @@ -0,0 +1,214 @@ +/** + * @fileoverview Rule to flag numbers that will lose significant figure precision at runtime + * @author Jacob Moore + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow literal numbers that lose precision", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-loss-of-precision" + }, + schema: [], + messages: { + noLossOfPrecision: "This number literal will lose precision at runtime." + } + }, + + create(context) { + + /** + * Returns whether the node is number literal + * @param {Node} node the node literal being evaluated + * @returns {boolean} true if the node is a number literal + */ + function isNumber(node) { + return typeof node.value === "number"; + } + + /** + * Gets the source code of the given number literal. Removes `_` numeric separators from the result. + * @param {Node} node the number `Literal` node + * @returns {string} raw source code of the literal, without numeric separators + */ + function getRaw(node) { + return node.raw.replace(/_/gu, ""); + } + + /** + * Checks whether the number is base ten + * @param {ASTNode} node the node being evaluated + * @returns {boolean} true if the node is in base ten + */ + function isBaseTen(node) { + const prefixes = ["0x", "0X", "0b", "0B", "0o", "0O"]; + + return prefixes.every(prefix => !node.raw.startsWith(prefix)) && + !/^0[0-7]+$/u.test(node.raw); + } + + /** + * Checks that the user-intended non-base ten number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function notBaseTenLosesPrecision(node) { + const rawString = getRaw(node).toUpperCase(); + let base; + + if (rawString.startsWith("0B")) { + base = 2; + } else if (rawString.startsWith("0X")) { + base = 16; + } else { + base = 8; + } + + return !rawString.endsWith(node.value.toString(base).toUpperCase()); + } + + /** + * Adds a decimal point to the numeric string at index 1 + * @param {string} stringNumber the numeric string without any decimal point + * @returns {string} the numeric string with a decimal point in the proper place + */ + function addDecimalPointToNumber(stringNumber) { + return `${stringNumber[0]}.${stringNumber.slice(1)}`; + } + + /** + * Returns the number stripped of leading zeros + * @param {string} numberAsString the string representation of the number + * @returns {string} the stripped string + */ + function removeLeadingZeros(numberAsString) { + for (let i = 0; i < numberAsString.length; i++) { + if (numberAsString[i] !== "0") { + return numberAsString.slice(i); + } + } + return numberAsString; + } + + /** + * Returns the number stripped of trailing zeros + * @param {string} numberAsString the string representation of the number + * @returns {string} the stripped string + */ + function removeTrailingZeros(numberAsString) { + for (let i = numberAsString.length - 1; i >= 0; i--) { + if (numberAsString[i] !== "0") { + return numberAsString.slice(0, i + 1); + } + } + return numberAsString; + } + + /** + * Converts an integer to an object containing the integer's coefficient and order of magnitude + * @param {string} stringInteger the string representation of the integer being converted + * @returns {Object} the object containing the integer's coefficient and order of magnitude + */ + function normalizeInteger(stringInteger) { + const significantDigits = removeTrailingZeros(removeLeadingZeros(stringInteger)); + + return { + magnitude: stringInteger.startsWith("0") ? stringInteger.length - 2 : stringInteger.length - 1, + coefficient: addDecimalPointToNumber(significantDigits) + }; + } + + /** + * + * Converts a float to an object containing the floats's coefficient and order of magnitude + * @param {string} stringFloat the string representation of the float being converted + * @returns {Object} the object containing the integer's coefficient and order of magnitude + */ + function normalizeFloat(stringFloat) { + const trimmedFloat = removeLeadingZeros(stringFloat); + + if (trimmedFloat.startsWith(".")) { + const decimalDigits = trimmedFloat.slice(1); + const significantDigits = removeLeadingZeros(decimalDigits); + + return { + magnitude: significantDigits.length - decimalDigits.length - 1, + coefficient: addDecimalPointToNumber(significantDigits) + }; + + } + return { + magnitude: trimmedFloat.indexOf(".") - 1, + coefficient: addDecimalPointToNumber(trimmedFloat.replace(".", "")) + + }; + } + + /** + * Converts a base ten number to proper scientific notation + * @param {string} stringNumber the string representation of the base ten number to be converted + * @returns {string} the number converted to scientific notation + */ + function convertNumberToScientificNotation(stringNumber) { + const splitNumber = stringNumber.replace("E", "e").split("e"); + const originalCoefficient = splitNumber[0]; + const normalizedNumber = stringNumber.includes(".") ? normalizeFloat(originalCoefficient) + : normalizeInteger(originalCoefficient); + const normalizedCoefficient = normalizedNumber.coefficient; + const magnitude = splitNumber.length > 1 ? (parseInt(splitNumber[1], 10) + normalizedNumber.magnitude) + : normalizedNumber.magnitude; + + return `${normalizedCoefficient}e${magnitude}`; + } + + /** + * Checks that the user-intended base ten number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function baseTenLosesPrecision(node) { + const normalizedRawNumber = convertNumberToScientificNotation(getRaw(node)); + const requestedPrecision = normalizedRawNumber.split("e")[0].replace(".", "").length; + + if (requestedPrecision > 100) { + return true; + } + const storedNumber = node.value.toPrecision(requestedPrecision); + const normalizedStoredNumber = convertNumberToScientificNotation(storedNumber); + + return normalizedRawNumber !== normalizedStoredNumber; + } + + + /** + * Checks that the user-intended number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function losesPrecision(node) { + return isBaseTen(node) ? baseTenLosesPrecision(node) : notBaseTenLosesPrecision(node); + } + + + return { + Literal(node) { + if (node.value && isNumber(node) && losesPrecision(node)) { + context.report({ + messageId: "noLossOfPrecision", + node + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-magic-numbers.js b/node_modules/eslint/lib/rules/no-magic-numbers.js new file mode 100644 index 0000000..4cda74d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -0,0 +1,244 @@ +/** + * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js) + * @author Vincent Lemeunier + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +// Maximum array length by the ECMAScript Specification. +const MAX_ARRAY_LENGTH = 2 ** 32 - 1; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Convert the value to bigint if it's a string. Otherwise return the value as-is. + * @param {bigint|number|string} x The value to normalize. + * @returns {bigint|number} The normalized value. + */ +function normalizeIgnoreValue(x) { + if (typeof x === "string") { + return BigInt(x.slice(0, -1)); + } + return x; +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow magic numbers", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-magic-numbers" + }, + + schema: [{ + type: "object", + properties: { + detectObjects: { + type: "boolean", + default: false + }, + enforceConst: { + type: "boolean", + default: false + }, + ignore: { + type: "array", + items: { + anyOf: [ + { type: "number" }, + { type: "string", pattern: "^[+-]?(?:0|[1-9][0-9]*)n$" } + ] + }, + uniqueItems: true + }, + ignoreArrayIndexes: { + type: "boolean", + default: false + }, + ignoreDefaultValues: { + type: "boolean", + default: false + }, + ignoreClassFieldInitialValues: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + useConst: "Number constants declarations must use 'const'.", + noMagic: "No magic number: {{raw}}." + } + }, + + create(context) { + const config = context.options[0] || {}, + detectObjects = !!config.detectObjects, + enforceConst = !!config.enforceConst, + ignore = new Set((config.ignore || []).map(normalizeIgnoreValue)), + ignoreArrayIndexes = !!config.ignoreArrayIndexes, + ignoreDefaultValues = !!config.ignoreDefaultValues, + ignoreClassFieldInitialValues = !!config.ignoreClassFieldInitialValues; + + const okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"]; + + /** + * Returns whether the rule is configured to ignore the given value + * @param {bigint|number} value The value to check + * @returns {boolean} true if the value is ignored + */ + function isIgnoredValue(value) { + return ignore.has(value); + } + + /** + * Returns whether the number is a default value assignment. + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the number is a default value + */ + function isDefaultValue(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "AssignmentPattern" && parent.right === fullNumberNode; + } + + /** + * Returns whether the number is the initial value of a class field. + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the number is the initial value of a class field. + */ + function isClassFieldInitialValue(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "PropertyDefinition" && parent.value === fullNumberNode; + } + + /** + * Returns whether the given node is used as a radix within parseInt() or Number.parseInt() + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the node is radix + */ + function isParseIntRadix(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "CallExpression" && fullNumberNode === parent.arguments[1] && + ( + astUtils.isSpecificId(parent.callee, "parseInt") || + astUtils.isSpecificMemberAccess(parent.callee, "Number", "parseInt") + ); + } + + /** + * Returns whether the given node is a direct child of a JSX node. + * In particular, it aims to detect numbers used as prop values in JSX tags. + * Example: + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the node is a JSX number + */ + function isJSXNumber(fullNumberNode) { + return fullNumberNode.parent.type.indexOf("JSX") === 0; + } + + /** + * Returns whether the given node is used as an array index. + * Value must coerce to a valid array index name: "0", "1", "2" ... "4294967294". + * + * All other values, like "-1", "2.5", or "4294967295", are just "normal" object properties, + * which can be created and accessed on an array in addition to the array index properties, + * but they don't affect array's length and are not considered by methods such as .map(), .forEach() etc. + * + * The maximum array length by the specification is 2 ** 32 - 1 = 4294967295, + * thus the maximum valid index is 2 ** 32 - 2 = 4294967294. + * + * All notations are allowed, as long as the value coerces to one of "0", "1", "2" ... "4294967294". + * + * Valid examples: + * a[0], a[1], a[1.2e1], a[0xAB], a[0n], a[1n] + * a[-0] (same as a[0] because -0 coerces to "0") + * a[-0n] (-0n evaluates to 0n) + * + * Invalid examples: + * a[-1], a[-0xAB], a[-1n], a[2.5], a[1.23e1], a[12e-1] + * a[4294967295] (above the max index, it's an access to a regular property a["4294967295"]) + * a[999999999999999999999] (even if it wasn't above the max index, it would be a["1e+21"]) + * a[1e310] (same as a["Infinity"]) + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @param {bigint|number} value Value expressed by the fullNumberNode + * @returns {boolean} true if the node is a valid array index + */ + function isArrayIndex(fullNumberNode, value) { + const parent = fullNumberNode.parent; + + return parent.type === "MemberExpression" && parent.property === fullNumberNode && + (Number.isInteger(value) || typeof value === "bigint") && + value >= 0 && value < MAX_ARRAY_LENGTH; + } + + return { + Literal(node) { + if (!astUtils.isNumericLiteral(node)) { + return; + } + + let fullNumberNode; + let value; + let raw; + + // Treat unary minus as a part of the number + if (node.parent.type === "UnaryExpression" && node.parent.operator === "-") { + fullNumberNode = node.parent; + value = -node.value; + raw = `-${node.raw}`; + } else { + fullNumberNode = node; + value = node.value; + raw = node.raw; + } + + const parent = fullNumberNode.parent; + + // Always allow radix arguments and JSX props + if ( + isIgnoredValue(value) || + (ignoreDefaultValues && isDefaultValue(fullNumberNode)) || + (ignoreClassFieldInitialValues && isClassFieldInitialValue(fullNumberNode)) || + isParseIntRadix(fullNumberNode) || + isJSXNumber(fullNumberNode) || + (ignoreArrayIndexes && isArrayIndex(fullNumberNode, value)) + ) { + return; + } + + if (parent.type === "VariableDeclarator") { + if (enforceConst && parent.parent.kind !== "const") { + context.report({ + node: fullNumberNode, + messageId: "useConst" + }); + } + } else if ( + !okTypes.includes(parent.type) || + (parent.type === "AssignmentExpression" && parent.left.type === "Identifier") + ) { + context.report({ + node: fullNumberNode, + messageId: "noMagic", + data: { + raw + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-misleading-character-class.js b/node_modules/eslint/lib/rules/no-misleading-character-class.js new file mode 100644 index 0000000..d10e081 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-misleading-character-class.js @@ -0,0 +1,537 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStaticValue, + getStringIfConstant +} = require("@eslint-community/eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); +const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair } = require("./utils/unicode"); +const astUtils = require("./utils/ast-utils.js"); +const { isValidWithUnicodeFlag } = require("./utils/regular-expressions"); +const { parseStringLiteral, parseTemplateToken } = require("./utils/char-source"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * @typedef {import('@eslint-community/regexpp').AST.Character} Character + * @typedef {import('@eslint-community/regexpp').AST.CharacterClassElement} CharacterClassElement + */ + +/** + * Iterate character sequences of a given nodes. + * + * CharacterClassRange syntax can steal a part of character sequence, + * so this function reverts CharacterClassRange syntax and restore the sequence. + * @param {CharacterClassElement[]} nodes The node list to iterate character sequences. + * @returns {IterableIterator} The list of character sequences. + */ +function *iterateCharacterSequence(nodes) { + + /** @type {Character[]} */ + let seq = []; + + for (const node of nodes) { + switch (node.type) { + case "Character": + seq.push(node); + break; + + case "CharacterClassRange": + seq.push(node.min); + yield seq; + seq = [node.max]; + break; + + case "CharacterSet": + case "CharacterClass": // [[]] nesting character class + case "ClassStringDisjunction": // \q{...} + case "ExpressionCharacterClass": // [A--B] + if (seq.length > 0) { + yield seq; + seq = []; + } + break; + + // no default + } + } + + if (seq.length > 0) { + yield seq; + } +} + +/** + * Checks whether the given character node is a Unicode code point escape or not. + * @param {Character} char the character node to check. + * @returns {boolean} `true` if the character node is a Unicode code point escape. + */ +function isUnicodeCodePointEscape(char) { + return /^\\u\{[\da-f]+\}$/iu.test(char.raw); +} + +/** + * Each function returns matched characters if it detects that kind of problem. + * @type {Record IterableIterator>} + */ +const findCharacterSequences = { + *surrogatePairWithoutUFlag(chars) { + for (const [index, char] of chars.entries()) { + const previous = chars[index - 1]; + + if ( + previous && char && + isSurrogatePair(previous.value, char.value) && + !isUnicodeCodePointEscape(previous) && + !isUnicodeCodePointEscape(char) + ) { + yield [previous, char]; + } + } + }, + + *surrogatePair(chars) { + for (const [index, char] of chars.entries()) { + const previous = chars[index - 1]; + + if ( + previous && char && + isSurrogatePair(previous.value, char.value) && + ( + isUnicodeCodePointEscape(previous) || + isUnicodeCodePointEscape(char) + ) + ) { + yield [previous, char]; + } + } + }, + + *combiningClass(chars, unfilteredChars) { + + /* + * When `allowEscape` is `true`, a combined character should only be allowed if the combining mark appears as an escape sequence. + * This means that the base character should be considered even if it's escaped. + */ + for (const [index, char] of chars.entries()) { + const previous = unfilteredChars[index - 1]; + + if ( + previous && char && + isCombiningCharacter(char.value) && + !isCombiningCharacter(previous.value) + ) { + yield [previous, char]; + } + } + }, + + *emojiModifier(chars) { + for (const [index, char] of chars.entries()) { + const previous = chars[index - 1]; + + if ( + previous && char && + isEmojiModifier(char.value) && + !isEmojiModifier(previous.value) + ) { + yield [previous, char]; + } + } + }, + + *regionalIndicatorSymbol(chars) { + for (const [index, char] of chars.entries()) { + const previous = chars[index - 1]; + + if ( + previous && char && + isRegionalIndicatorSymbol(char.value) && + isRegionalIndicatorSymbol(previous.value) + ) { + yield [previous, char]; + } + } + }, + + *zwj(chars) { + let sequence = null; + + for (const [index, char] of chars.entries()) { + const previous = chars[index - 1]; + const next = chars[index + 1]; + + if ( + previous && char && next && + char.value === 0x200d && + previous.value !== 0x200d && + next.value !== 0x200d + ) { + if (sequence) { + if (sequence.at(-1) === previous) { + sequence.push(char, next); // append to the sequence + } else { + yield sequence; + sequence = chars.slice(index - 1, index + 2); + } + } else { + sequence = chars.slice(index - 1, index + 2); + } + } + } + + if (sequence) { + yield sequence; + } + } +}; + +const kinds = Object.keys(findCharacterSequences); + +/** + * Gets the value of the given node if it's a static value other than a regular expression object, + * or the node's `regex` property. + * The purpose of this method is to provide a replacement for `getStaticValue` in environments where certain regular expressions cannot be evaluated. + * A known example is Node.js 18 which does not support the `v` flag. + * Calling `getStaticValue` on a regular expression node with the `v` flag on Node.js 18 always returns `null`. + * A limitation of this method is that it can only detect a regular expression if the specified node is itself a regular expression literal node. + * @param {ASTNode | undefined} node The node to be inspected. + * @param {Scope} initialScope Scope to start finding variables. This function tries to resolve identifier references which are in the given scope. + * @returns {{ value: any } | { regex: { pattern: string, flags: string } } | null} The static value of the node, or `null`. + */ +function getStaticValueOrRegex(node, initialScope) { + if (!node) { + return null; + } + if (node.type === "Literal" && node.regex) { + return { regex: node.regex }; + } + + const staticValue = getStaticValue(node, initialScope); + + if (staticValue?.value instanceof RegExp) { + return null; + } + return staticValue; +} + +/** + * Checks whether a specified regexpp character is represented as an acceptable escape sequence. + * This function requires the source text of the character to be known. + * @param {Character} char Character to check. + * @param {string} charSource Source text of the character to check. + * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence. + */ +function checkForAcceptableEscape(char, charSource) { + if (!charSource.startsWith("\\")) { + return false; + } + const match = /(?<=^\\+).$/su.exec(charSource); + + return match?.[0] !== String.fromCodePoint(char.value); +} + +/** + * Checks whether a specified regexpp character is represented as an acceptable escape sequence. + * This function works with characters that are produced by a string or template literal. + * It requires the source text and the CodeUnit list of the literal to be known. + * @param {Character} char Character to check. + * @param {string} nodeSource Source text of the string or template literal that produces the character. + * @param {CodeUnit[]} codeUnits List of CodeUnit objects of the literal that produces the character. + * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence. + */ +function checkForAcceptableEscapeInString(char, nodeSource, codeUnits) { + const firstIndex = char.start; + const lastIndex = char.end - 1; + const start = codeUnits[firstIndex].start; + const end = codeUnits[lastIndex].end; + const charSource = nodeSource.slice(start, end); + + return checkForAcceptableEscape(char, charSource); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow characters which are made with multiple code points in character class syntax", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-misleading-character-class" + }, + + hasSuggestions: true, + + schema: [ + { + type: "object", + properties: { + allowEscape: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + surrogatePairWithoutUFlag: "Unexpected surrogate pair in character class. Use 'u' flag.", + surrogatePair: "Unexpected surrogate pair in character class.", + combiningClass: "Unexpected combined character in character class.", + emojiModifier: "Unexpected modified Emoji in character class.", + regionalIndicatorSymbol: "Unexpected national flag in character class.", + zwj: "Unexpected joined character sequence in character class.", + suggestUnicodeFlag: "Add unicode 'u' flag to regex." + } + }, + create(context) { + const allowEscape = context.options[0]?.allowEscape; + const sourceCode = context.sourceCode; + const parser = new RegExpParser(); + const checkedPatternNodes = new Set(); + + /** + * Verify a given regular expression. + * @param {Node} node The node to report. + * @param {string} pattern The regular expression pattern to verify. + * @param {string} flags The flags of the regular expression. + * @param {Function} unicodeFixer Fixer for missing "u" flag. + * @returns {void} + */ + function verify(node, pattern, flags, unicodeFixer) { + let patternNode; + + try { + patternNode = parser.parsePattern( + pattern, + 0, + pattern.length, + { + unicode: flags.includes("u"), + unicodeSets: flags.includes("v") + } + ); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + let codeUnits = null; + + /** + * Checks whether a specified regexpp character is represented as an acceptable escape sequence. + * For the purposes of this rule, an escape sequence is considered acceptable if it consists of one or more backslashes followed by the character being escaped. + * @param {Character} char Character to check. + * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence. + */ + function isAcceptableEscapeSequence(char) { + if (node.type === "Literal" && node.regex) { + return checkForAcceptableEscape(char, char.raw); + } + if (node.type === "Literal" && typeof node.value === "string") { + const nodeSource = node.raw; + + codeUnits ??= parseStringLiteral(nodeSource); + + return checkForAcceptableEscapeInString(char, nodeSource, codeUnits); + } + if (astUtils.isStaticTemplateLiteral(node)) { + const nodeSource = sourceCode.getText(node); + + codeUnits ??= parseTemplateToken(nodeSource); + + return checkForAcceptableEscapeInString(char, nodeSource, codeUnits); + } + return false; + } + + const foundKindMatches = new Map(); + + visitRegExpAST(patternNode, { + onCharacterClassEnter(ccNode) { + for (const unfilteredChars of iterateCharacterSequence(ccNode.elements)) { + let chars; + + if (allowEscape) { + + // Replace escape sequences with null to avoid having them flagged. + chars = unfilteredChars.map(char => (isAcceptableEscapeSequence(char) ? null : char)); + } else { + chars = unfilteredChars; + } + for (const kind of kinds) { + const matches = findCharacterSequences[kind](chars, unfilteredChars); + + if (foundKindMatches.has(kind)) { + foundKindMatches.get(kind).push(...matches); + } else { + foundKindMatches.set(kind, [...matches]); + } + } + } + } + }); + + /** + * Finds the report loc(s) for a range of matches. + * Only literals and expression-less templates generate granular errors. + * @param {Character[][]} matches Lists of individual characters being reported on. + * @returns {Location[]} locs for context.report. + * @see https://github.com/eslint/eslint/pull/17515 + */ + function getNodeReportLocations(matches) { + if (!astUtils.isStaticTemplateLiteral(node) && node.type !== "Literal") { + return matches.length ? [node.loc] : []; + } + return matches.map(chars => { + const firstIndex = chars[0].start; + const lastIndex = chars.at(-1).end - 1; + let start; + let end; + + if (node.type === "TemplateLiteral") { + const source = sourceCode.getText(node); + const offset = node.range[0]; + + codeUnits ??= parseTemplateToken(source); + start = offset + codeUnits[firstIndex].start; + end = offset + codeUnits[lastIndex].end; + } else if (typeof node.value === "string") { // String Literal + const source = node.raw; + const offset = node.range[0]; + + codeUnits ??= parseStringLiteral(source); + start = offset + codeUnits[firstIndex].start; + end = offset + codeUnits[lastIndex].end; + } else { // RegExp Literal + const offset = node.range[0] + 1; // Add 1 to skip the leading slash. + + start = offset + firstIndex; + end = offset + lastIndex + 1; + } + + return { + start: sourceCode.getLocFromIndex(start), + end: sourceCode.getLocFromIndex(end) + }; + }); + } + + for (const [kind, matches] of foundKindMatches) { + let suggest; + + if (kind === "surrogatePairWithoutUFlag") { + suggest = [{ + messageId: "suggestUnicodeFlag", + fix: unicodeFixer + }]; + } + + const locs = getNodeReportLocations(matches); + + for (const loc of locs) { + context.report({ + node, + loc, + messageId: kind, + suggest + }); + } + } + } + + return { + "Literal[regex]"(node) { + if (checkedPatternNodes.has(node)) { + return; + } + verify(node, node.regex.pattern, node.regex.flags, fixer => { + if (!isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, node.regex.pattern)) { + return null; + } + + return fixer.insertTextAfter(node, "u"); + }); + }, + "Program"(node) { + const scope = sourceCode.getScope(node); + const tracker = new ReferenceTracker(scope); + + /* + * Iterate calls of RegExp. + * E.g., `new RegExp()`, `RegExp()`, `new window.RegExp()`, + * `const {RegExp: a} = window; new a()`, etc... + */ + for (const { node: refNode } of tracker.iterateGlobalReferences({ + RegExp: { [CALL]: true, [CONSTRUCT]: true } + })) { + let pattern, flags; + const [patternNode, flagsNode] = refNode.arguments; + const evaluatedPattern = getStaticValueOrRegex(patternNode, scope); + + if (!evaluatedPattern) { + continue; + } + if (flagsNode) { + if (evaluatedPattern.regex) { + pattern = evaluatedPattern.regex.pattern; + checkedPatternNodes.add(patternNode); + } else { + pattern = String(evaluatedPattern.value); + } + flags = getStringIfConstant(flagsNode, scope); + } else { + if (evaluatedPattern.regex) { + continue; + } + pattern = String(evaluatedPattern.value); + flags = ""; + } + + if (typeof flags === "string") { + verify(patternNode, pattern, flags, fixer => { + + if (!isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, pattern)) { + return null; + } + + if (refNode.arguments.length === 1) { + const penultimateToken = sourceCode.getLastToken(refNode, { skip: 1 }); // skip closing parenthesis + + return fixer.insertTextAfter( + penultimateToken, + astUtils.isCommaToken(penultimateToken) + ? ' "u",' + : ', "u"' + ); + } + + if ((flagsNode.type === "Literal" && typeof flagsNode.value === "string") || flagsNode.type === "TemplateLiteral") { + const range = [flagsNode.range[0], flagsNode.range[1] - 1]; + + return fixer.insertTextAfterRange(range, "u"); + } + + return null; + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-operators.js b/node_modules/eslint/lib/rules/no-mixed-operators.js new file mode 100644 index 0000000..e2c8883 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -0,0 +1,247 @@ +/** + * @fileoverview Rule to disallow mixed binary operators. + * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const ARITHMETIC_OPERATORS = ["+", "-", "*", "/", "%", "**"]; +const BITWISE_OPERATORS = ["&", "|", "^", "~", "<<", ">>", ">>>"]; +const COMPARISON_OPERATORS = ["==", "!=", "===", "!==", ">", ">=", "<", "<="]; +const LOGICAL_OPERATORS = ["&&", "||"]; +const RELATIONAL_OPERATORS = ["in", "instanceof"]; +const TERNARY_OPERATOR = ["?:"]; +const COALESCE_OPERATOR = ["??"]; +const ALL_OPERATORS = [].concat( + ARITHMETIC_OPERATORS, + BITWISE_OPERATORS, + COMPARISON_OPERATORS, + LOGICAL_OPERATORS, + RELATIONAL_OPERATORS, + TERNARY_OPERATOR, + COALESCE_OPERATOR +); +const DEFAULT_GROUPS = [ + ARITHMETIC_OPERATORS, + BITWISE_OPERATORS, + COMPARISON_OPERATORS, + LOGICAL_OPERATORS, + RELATIONAL_OPERATORS +]; +const TARGET_NODE_TYPE = /^(?:Binary|Logical|Conditional)Expression$/u; + +/** + * Normalizes options. + * @param {Object|undefined} options A options object to normalize. + * @returns {Object} Normalized option object. + */ +function normalizeOptions(options = {}) { + const hasGroups = options.groups && options.groups.length > 0; + const groups = hasGroups ? options.groups : DEFAULT_GROUPS; + const allowSamePrecedence = options.allowSamePrecedence !== false; + + return { + groups, + allowSamePrecedence + }; +} + +/** + * Checks whether any group which includes both given operator exists or not. + * @param {Array} groups A list of groups to check. + * @param {string} left An operator. + * @param {string} right Another operator. + * @returns {boolean} `true` if such group existed. + */ +function includesBothInAGroup(groups, left, right) { + return groups.some(group => group.includes(left) && group.includes(right)); +} + +/** + * Checks whether the given node is a conditional expression and returns the test node else the left node. + * @param {ASTNode} node A node which can be a BinaryExpression or a LogicalExpression node. + * This parent node can be BinaryExpression, LogicalExpression + * , or a ConditionalExpression node + * @returns {ASTNode} node the appropriate node(left or test). + */ +function getChildNode(node) { + return node.type === "ConditionalExpression" ? node.test : node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-mixed-operators", + url: "https://eslint.style/rules/js/no-mixed-operators" + } + } + ] + }, + type: "suggestion", + + docs: { + description: "Disallow mixed binary operators", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-mixed-operators" + }, + + schema: [ + { + type: "object", + properties: { + groups: { + type: "array", + items: { + type: "array", + items: { enum: ALL_OPERATORS }, + minItems: 2, + uniqueItems: true + }, + uniqueItems: true + }, + allowSamePrecedence: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'. Use parentheses to clarify the intended order of operations." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const options = normalizeOptions(context.options[0]); + + /** + * Checks whether a given node should be ignored by options or not. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {boolean} `true` if the node should be ignored. + */ + function shouldIgnore(node) { + const a = node; + const b = node.parent; + + return ( + !includesBothInAGroup(options.groups, a.operator, b.type === "ConditionalExpression" ? "?:" : b.operator) || + ( + options.allowSamePrecedence && + astUtils.getPrecedence(a) === astUtils.getPrecedence(b) + ) + ); + } + + /** + * Checks whether the operator of a given node is mixed with parent + * node's operator or not. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {boolean} `true` if the node was mixed. + */ + function isMixedWithParent(node) { + + return ( + node.operator !== node.parent.operator && + !astUtils.isParenthesised(sourceCode, node) + ); + } + + /** + * Gets the operator token of a given node. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. + * @returns {Token} The operator token of the node. + */ + function getOperatorToken(node) { + return sourceCode.getTokenAfter(getChildNode(node), astUtils.isNotClosingParenToken); + } + + /** + * Reports both the operator of a given node and the operator of the + * parent node. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {void} + */ + function reportBothOperators(node) { + const parent = node.parent; + const left = (getChildNode(parent) === node) ? node : parent; + const right = (getChildNode(parent) !== node) ? node : parent; + const data = { + leftOperator: left.operator || "?:", + rightOperator: right.operator || "?:" + }; + + context.report({ + node: left, + loc: getOperatorToken(left).loc, + messageId: "unexpectedMixedOperator", + data + }); + context.report({ + node: right, + loc: getOperatorToken(right).loc, + messageId: "unexpectedMixedOperator", + data + }); + } + + /** + * Checks between the operator of this node and the operator of the + * parent node. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function check(node) { + if ( + TARGET_NODE_TYPE.test(node.parent.type) && + isMixedWithParent(node) && + !shouldIgnore(node) + ) { + reportBothOperators(node); + } + } + + return { + BinaryExpression: check, + LogicalExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-requires.js b/node_modules/eslint/lib/rules/no-mixed-requires.js new file mode 100644 index 0000000..9665c1d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-requires.js @@ -0,0 +1,254 @@ +/** + * @fileoverview Rule to enforce grouped require statements for Node.JS + * @author Raphael Pigulla + * @deprecated in ESLint v7.0.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "no-mixed-requires", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-mixed-requires.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Disallow `require` calls to be mixed with regular variable declarations", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-mixed-requires" + }, + + schema: [ + { + oneOf: [ + { + type: "boolean" + }, + { + type: "object", + properties: { + grouping: { + type: "boolean" + }, + allowCall: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + noMixRequire: "Do not mix 'require' and other declarations.", + noMixCoreModuleFileComputed: "Do not mix core, module, file and computed requires." + } + }, + + create(context) { + + const options = context.options[0]; + let grouping = false, + allowCall = false; + + if (typeof options === "object") { + grouping = options.grouping; + allowCall = options.allowCall; + } else { + grouping = !!options; + } + + /** + * Returns the list of built-in modules. + * @returns {string[]} An array of built-in Node.js modules. + */ + function getBuiltinModules() { + + /* + * This list is generated using: + * `require("repl")._builtinLibs.concat('repl').sort()` + * This particular list is as per nodejs v0.12.2 and iojs v0.7.1 + */ + return [ + "assert", "buffer", "child_process", "cluster", "crypto", + "dgram", "dns", "domain", "events", "fs", "http", "https", + "net", "os", "path", "punycode", "querystring", "readline", + "repl", "smalloc", "stream", "string_decoder", "tls", "tty", + "url", "util", "v8", "vm", "zlib" + ]; + } + + const BUILTIN_MODULES = getBuiltinModules(); + + const DECL_REQUIRE = "require", + DECL_UNINITIALIZED = "uninitialized", + DECL_OTHER = "other"; + + const REQ_CORE = "core", + REQ_FILE = "file", + REQ_MODULE = "module", + REQ_COMPUTED = "computed"; + + /** + * Determines the type of a declaration statement. + * @param {ASTNode} initExpression The init node of the VariableDeclarator. + * @returns {string} The type of declaration represented by the expression. + */ + function getDeclarationType(initExpression) { + if (!initExpression) { + + // "var x;" + return DECL_UNINITIALIZED; + } + + if (initExpression.type === "CallExpression" && + initExpression.callee.type === "Identifier" && + initExpression.callee.name === "require" + ) { + + // "var x = require('util');" + return DECL_REQUIRE; + } + if (allowCall && + initExpression.type === "CallExpression" && + initExpression.callee.type === "CallExpression" + ) { + + // "var x = require('diagnose')('sub-module');" + return getDeclarationType(initExpression.callee); + } + if (initExpression.type === "MemberExpression") { + + // "var x = require('glob').Glob;" + return getDeclarationType(initExpression.object); + } + + // "var x = 42;" + return DECL_OTHER; + } + + /** + * Determines the type of module that is loaded via require. + * @param {ASTNode} initExpression The init node of the VariableDeclarator. + * @returns {string} The module type. + */ + function inferModuleType(initExpression) { + if (initExpression.type === "MemberExpression") { + + // "var x = require('glob').Glob;" + return inferModuleType(initExpression.object); + } + if (initExpression.arguments.length === 0) { + + // "var x = require();" + return REQ_COMPUTED; + } + + const arg = initExpression.arguments[0]; + + if (arg.type !== "Literal" || typeof arg.value !== "string") { + + // "var x = require(42);" + return REQ_COMPUTED; + } + + if (BUILTIN_MODULES.includes(arg.value)) { + + // "var fs = require('fs');" + return REQ_CORE; + } + if (/^\.{0,2}\//u.test(arg.value)) { + + // "var utils = require('./utils');" + return REQ_FILE; + } + + // "var async = require('async');" + return REQ_MODULE; + + } + + /** + * Check if the list of variable declarations is mixed, i.e. whether it + * contains both require and other declarations. + * @param {ASTNode} declarations The list of VariableDeclarators. + * @returns {boolean} True if the declarations are mixed, false if not. + */ + function isMixed(declarations) { + const contains = {}; + + declarations.forEach(declaration => { + const type = getDeclarationType(declaration.init); + + contains[type] = true; + }); + + return !!( + contains[DECL_REQUIRE] && + (contains[DECL_UNINITIALIZED] || contains[DECL_OTHER]) + ); + } + + /** + * Check if all require declarations in the given list are of the same + * type. + * @param {ASTNode} declarations The list of VariableDeclarators. + * @returns {boolean} True if the declarations are grouped, false if not. + */ + function isGrouped(declarations) { + const found = {}; + + declarations.forEach(declaration => { + if (getDeclarationType(declaration.init) === DECL_REQUIRE) { + found[inferModuleType(declaration.init)] = true; + } + }); + + return Object.keys(found).length <= 1; + } + + + return { + + VariableDeclaration(node) { + + if (isMixed(node.declarations)) { + context.report({ + node, + messageId: "noMixRequire" + }); + } else if (grouping && !isGrouped(node.declarations)) { + context.report({ + node, + messageId: "noMixCoreModuleFileComputed" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js new file mode 100644 index 0000000..d379b04 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js @@ -0,0 +1,134 @@ +/** + * @fileoverview Disallow mixed spaces and tabs for indentation + * @author Jary Niebur + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-mixed-spaces-and-tabs", + url: "https://eslint.style/rules/js/no-mixed-spaces-and-tabs" + } + } + ] + }, + type: "layout", + + docs: { + description: "Disallow mixed spaces and tabs for indentation", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs" + }, + + schema: [ + { + enum: ["smart-tabs", true, false] + } + ], + + messages: { + mixedSpacesAndTabs: "Mixed spaces and tabs." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + let smartTabs; + + switch (context.options[0]) { + case true: // Support old syntax, maybe add deprecation warning here + case "smart-tabs": + smartTabs = true; + break; + default: + smartTabs = false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + "Program:exit"(node) { + const lines = sourceCode.lines, + comments = sourceCode.getAllComments(), + ignoredCommentLines = new Set(); + + // Add all lines except the first ones. + comments.forEach(comment => { + for (let i = comment.loc.start.line + 1; i <= comment.loc.end.line; i++) { + ignoredCommentLines.add(i); + } + }); + + /* + * At least one space followed by a tab + * or the reverse before non-tab/-space + * characters begin. + */ + let regex = /^(?=( +|\t+))\1(?:\t| )/u; + + if (smartTabs) { + + /* + * At least one space followed by a tab + * before non-tab/-space characters begin. + */ + regex = /^(?=(\t*))\1(?=( +))\2\t/u; + } + + lines.forEach((line, i) => { + const match = regex.exec(line); + + if (match) { + const lineNumber = i + 1; + const loc = { + start: { + line: lineNumber, + column: match[0].length - 2 + }, + end: { + line: lineNumber, + column: match[0].length + } + }; + + if (!ignoredCommentLines.has(lineNumber)) { + const containingNode = sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(loc.start)); + + if (!(containingNode && ["Literal", "TemplateElement"].includes(containingNode.type))) { + context.report({ + node, + loc, + messageId: "mixedSpacesAndTabs" + }); + } + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-assign.js b/node_modules/eslint/lib/rules/no-multi-assign.js new file mode 100644 index 0000000..6e45592 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-assign.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to check use of chained assignment expressions + * @author Stewart Rand + */ + +"use strict"; + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + ignoreNonDeclaration: false + }], + + docs: { + description: "Disallow use of chained assignment expressions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-multi-assign" + }, + + schema: [{ + type: "object", + properties: { + ignoreNonDeclaration: { + type: "boolean" + } + }, + additionalProperties: false + }], + + messages: { + unexpectedChain: "Unexpected chained assignment." + } + }, + + create(context) { + const [{ ignoreNonDeclaration }] = context.options; + const selectors = [ + "VariableDeclarator > AssignmentExpression.init", + "PropertyDefinition > AssignmentExpression.value" + ]; + + if (!ignoreNonDeclaration) { + selectors.push("AssignmentExpression > AssignmentExpression.right"); + } + + return { + [selectors](node) { + context.report({ + node, + messageId: "unexpectedChain" + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-spaces.js b/node_modules/eslint/lib/rules/no-multi-spaces.js new file mode 100644 index 0000000..997b171 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-spaces.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Disallow use of multiple spaces. + * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-multi-spaces", + url: "https://eslint.style/rules/js/no-multi-spaces" + } + } + ] + }, + type: "layout", + + docs: { + description: "Disallow multiple spaces", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-multi-spaces" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "object", + patternProperties: { + "^([A-Z][a-z]*)+$": { + type: "boolean" + } + }, + additionalProperties: false + }, + ignoreEOLComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + multipleSpaces: "Multiple spaces found before '{{displayValue}}'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const options = context.options[0] || {}; + const ignoreEOLComments = options.ignoreEOLComments; + const exceptions = Object.assign({ Property: true }, options.exceptions); + const hasExceptions = Object.keys(exceptions).some(key => exceptions[key]); + + /** + * Formats value of given comment token for error message by truncating its length. + * @param {Token} token comment token + * @returns {string} formatted value + * @private + */ + function formatReportedCommentValue(token) { + const valueLines = token.value.split("\n"); + const value = valueLines[0]; + const formattedValue = `${value.slice(0, 12)}...`; + + return valueLines.length === 1 && value.length <= 12 ? value : formattedValue; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + sourceCode.tokensAndComments.forEach((leftToken, leftIndex, tokensAndComments) => { + if (leftIndex === tokensAndComments.length - 1) { + return; + } + const rightToken = tokensAndComments[leftIndex + 1]; + + // Ignore tokens that don't have 2 spaces between them or are on different lines + if ( + !sourceCode.text.slice(leftToken.range[1], rightToken.range[0]).includes(" ") || + leftToken.loc.end.line < rightToken.loc.start.line + ) { + return; + } + + // Ignore comments that are the last token on their line if `ignoreEOLComments` is active. + if ( + ignoreEOLComments && + astUtils.isCommentToken(rightToken) && + ( + leftIndex === tokensAndComments.length - 2 || + rightToken.loc.end.line < tokensAndComments[leftIndex + 2].loc.start.line + ) + ) { + return; + } + + // Ignore tokens that are in a node in the "exceptions" object + if (hasExceptions) { + const parentNode = sourceCode.getNodeByRangeIndex(rightToken.range[0] - 1); + + if (parentNode && exceptions[parentNode.type]) { + return; + } + } + + let displayValue; + + if (rightToken.type === "Block") { + displayValue = `/*${formatReportedCommentValue(rightToken)}*/`; + } else if (rightToken.type === "Line") { + displayValue = `//${formatReportedCommentValue(rightToken)}`; + } else { + displayValue = rightToken.value; + } + + context.report({ + node: rightToken, + loc: { start: leftToken.loc.end, end: rightToken.loc.start }, + messageId: "multipleSpaces", + data: { displayValue }, + fix: fixer => fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " ") + }); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-str.js b/node_modules/eslint/lib/rules/no-multi-str.js new file mode 100644 index 0000000..f58e2d4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-str.js @@ -0,0 +1,66 @@ +/** + * @fileoverview Rule to flag when using multiline strings + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow multiline strings", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-multi-str" + }, + + schema: [], + + messages: { + multilineString: "Multiline support is limited to browsers supporting ES5 only." + } + }, + + create(context) { + + /** + * Determines if a given node is part of JSX syntax. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a JSX node, false if not. + * @private + */ + function isJSXElement(node) { + return node.type.indexOf("JSX") === 0; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + Literal(node) { + if (astUtils.LINEBREAK_MATCHER.test(node.raw) && !isJSXElement(node.parent)) { + context.report({ + node, + messageId: "multilineString" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multiple-empty-lines.js b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js new file mode 100644 index 0000000..4837851 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js @@ -0,0 +1,172 @@ +/** + * @fileoverview Disallows multiple blank lines. + * implementation adapted from the no-trailing-spaces rule. + * @author Greg Cochard + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-multiple-empty-lines", + url: "https://eslint.style/rules/js/no-multiple-empty-lines" + } + } + ] + }, + type: "layout", + + docs: { + description: "Disallow multiple empty lines", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-multiple-empty-lines" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + maxEOF: { + type: "integer", + minimum: 0 + }, + maxBOF: { + type: "integer", + minimum: 0 + } + }, + required: ["max"], + additionalProperties: false + } + ], + + messages: { + blankBeginningOfFile: "Too many blank lines at the beginning of file. Max of {{max}} allowed.", + blankEndOfFile: "Too many blank lines at the end of file. Max of {{max}} allowed.", + consecutiveBlank: "More than {{max}} blank {{pluralizedLines}} not allowed." + } + }, + + create(context) { + + // Use options.max or 2 as default + let max = 2, + maxEOF = max, + maxBOF = max; + + if (context.options.length) { + max = context.options[0].max; + maxEOF = typeof context.options[0].maxEOF !== "undefined" ? context.options[0].maxEOF : max; + maxBOF = typeof context.options[0].maxBOF !== "undefined" ? context.options[0].maxBOF : max; + } + + const sourceCode = context.sourceCode; + + // Swallow the final newline, as some editors add it automatically and we don't want it to cause an issue + const allLines = sourceCode.lines.at(-1) === "" ? sourceCode.lines.slice(0, -1) : sourceCode.lines; + const templateLiteralLines = new Set(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + TemplateLiteral(node) { + node.quasis.forEach(literalPart => { + + // Empty lines have a semantic meaning if they're inside template literals. Don't count these as empty lines. + for (let ignoredLine = literalPart.loc.start.line; ignoredLine < literalPart.loc.end.line; ignoredLine++) { + templateLiteralLines.add(ignoredLine); + } + }); + }, + "Program:exit"(node) { + return allLines + + // Given a list of lines, first get a list of line numbers that are non-empty. + .reduce((nonEmptyLineNumbers, line, index) => { + if (line.trim() || templateLiteralLines.has(index + 1)) { + nonEmptyLineNumbers.push(index + 1); + } + return nonEmptyLineNumbers; + }, []) + + // Add a value at the end to allow trailing empty lines to be checked. + .concat(allLines.length + 1) + + // Given two line numbers of non-empty lines, report the lines between if the difference is too large. + .reduce((lastLineNumber, lineNumber) => { + let messageId, maxAllowed; + + if (lastLineNumber === 0) { + messageId = "blankBeginningOfFile"; + maxAllowed = maxBOF; + } else if (lineNumber === allLines.length + 1) { + messageId = "blankEndOfFile"; + maxAllowed = maxEOF; + } else { + messageId = "consecutiveBlank"; + maxAllowed = max; + } + + if (lineNumber - lastLineNumber - 1 > maxAllowed) { + context.report({ + node, + loc: { + start: { line: lastLineNumber + maxAllowed + 1, column: 0 }, + end: { line: lineNumber, column: 0 } + }, + messageId, + data: { + max: maxAllowed, + pluralizedLines: maxAllowed === 1 ? "line" : "lines" + }, + fix(fixer) { + const rangeStart = sourceCode.getIndexFromLoc({ line: lastLineNumber + 1, column: 0 }); + + /* + * The end of the removal range is usually the start index of the next line. + * However, at the end of the file there is no next line, so the end of the + * range is just the length of the text. + */ + const lineNumberAfterRemovedLines = lineNumber - maxAllowed; + const rangeEnd = lineNumberAfterRemovedLines <= allLines.length + ? sourceCode.getIndexFromLoc({ line: lineNumberAfterRemovedLines, column: 0 }) + : sourceCode.text.length; + + return fixer.removeRange([rangeStart, rangeEnd]); + } + }); + } + + return lineNumber; + }, 0); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-native-reassign.js b/node_modules/eslint/lib/rules/no-native-reassign.js new file mode 100644 index 0000000..02728f2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-native-reassign.js @@ -0,0 +1,109 @@ +/** + * @fileoverview Rule to disallow assignments to native objects or read-only global variables + * @author Ilya Volodin + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow assignments to native objects or read-only global variables", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-native-reassign" + }, + + deprecated: { + message: "Renamed rule", + url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules", + deprecatedSince: "3.3.0", + availableUntil: null, + replacedBy: [ + { + rule: { + name: "no-global-assign", + url: "https://eslint.org/docs/rules/no-global-assign" + } + } + ] + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { type: "string" }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + nativeReassign: "Read-only global '{{name}}' should not be modified." + } + }, + + create(context) { + const config = context.options[0]; + const exceptions = (config && config.exceptions) || []; + const sourceCode = context.sourceCode; + + /** + * Reports write references. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + messageId: "nativeReassign", + data: identifier + }); + } + } + + /** + * Reports write references if a given variable is read-only builtin. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && !exceptions.includes(variable.name)) { + variable.references.forEach(checkReference); + } + } + + return { + Program(node) { + const globalScope = sourceCode.getScope(node); + + globalScope.variables.forEach(checkVariable); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-negated-condition.js b/node_modules/eslint/lib/rules/no-negated-condition.js new file mode 100644 index 0000000..641123d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-negated-condition.js @@ -0,0 +1,96 @@ +/** + * @fileoverview Rule to disallow a negated condition + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow negated conditions", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-negated-condition" + }, + + schema: [], + + messages: { + unexpectedNegated: "Unexpected negated condition." + } + }, + + create(context) { + + /** + * Determines if a given node is an if-else without a condition on the else + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has an else without an if. + * @private + */ + function hasElseWithoutCondition(node) { + return node.alternate && node.alternate.type !== "IfStatement"; + } + + /** + * Determines if a given node is a negated unary expression + * @param {Object} test The test object to check. + * @returns {boolean} True if the node is a negated unary expression. + * @private + */ + function isNegatedUnaryExpression(test) { + return test.type === "UnaryExpression" && test.operator === "!"; + } + + /** + * Determines if a given node is a negated binary expression + * @param {Test} test The test to check. + * @returns {boolean} True if the node is a negated binary expression. + * @private + */ + function isNegatedBinaryExpression(test) { + return test.type === "BinaryExpression" && + (test.operator === "!=" || test.operator === "!=="); + } + + /** + * Determines if a given node has a negated if expression + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has a negated if expression. + * @private + */ + function isNegatedIf(node) { + return isNegatedUnaryExpression(node.test) || isNegatedBinaryExpression(node.test); + } + + return { + IfStatement(node) { + if (!hasElseWithoutCondition(node)) { + return; + } + + if (isNegatedIf(node)) { + context.report({ + node, + messageId: "unexpectedNegated" + }); + } + }, + ConditionalExpression(node) { + if (isNegatedIf(node)) { + context.report({ + node, + messageId: "unexpectedNegated" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-negated-in-lhs.js b/node_modules/eslint/lib/rules/no-negated-in-lhs.js new file mode 100644 index 0000000..7f06ea0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-negated-in-lhs.js @@ -0,0 +1,57 @@ +/** + * @fileoverview A rule to disallow negated left operands of the `in` operator + * @author Michael Ficarra + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow negating the left operand in `in` expressions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-negated-in-lhs" + }, + + deprecated: { + message: "Renamed rule", + url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules", + deprecatedSince: "3.3.0", + availableUntil: null, + replacedBy: [ + { + rule: { + name: "no-unsafe-negation", + url: "https://eslint.org/docs/rules/no-unsafe-negation" + } + } + ] + }, + schema: [], + + messages: { + negatedLHS: "The 'in' expression's left operand is negated." + } + }, + + create(context) { + + return { + + BinaryExpression(node) { + if (node.operator === "in" && node.left.type === "UnaryExpression" && node.left.operator === "!") { + context.report({ node, messageId: "negatedLHS" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-nested-ternary.js b/node_modules/eslint/lib/rules/no-nested-ternary.js new file mode 100644 index 0000000..cf26f28 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-nested-ternary.js @@ -0,0 +1,45 @@ +/** + * @fileoverview Rule to flag nested ternary expressions + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow nested ternary expressions", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-nested-ternary" + }, + + schema: [], + + messages: { + noNestedTernary: "Do not nest ternary expressions." + } + }, + + create(context) { + + return { + ConditionalExpression(node) { + if (node.alternate.type === "ConditionalExpression" || + node.consequent.type === "ConditionalExpression") { + context.report({ + node, + messageId: "noNestedTernary" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-func.js b/node_modules/eslint/lib/rules/no-new-func.js new file mode 100644 index 0000000..d58b2d7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-func.js @@ -0,0 +1,87 @@ +/** + * @fileoverview Rule to flag when using new Function + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const callMethods = new Set(["apply", "bind", "call"]); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `new` operators with the `Function` object", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-new-func" + }, + + schema: [], + + messages: { + noFunctionConstructor: "The Function constructor is eval." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + const variable = globalScope.set.get("Function"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const idNode = ref.identifier; + const { parent } = idNode; + let evalNode; + + if (parent) { + if (idNode === parent.callee && ( + parent.type === "NewExpression" || + parent.type === "CallExpression" + )) { + evalNode = parent; + } else if ( + parent.type === "MemberExpression" && + idNode === parent.object && + callMethods.has(astUtils.getStaticPropertyName(parent)) + ) { + const maybeCallee = parent.parent.type === "ChainExpression" ? parent.parent : parent; + + if (maybeCallee.parent.type === "CallExpression" && maybeCallee.parent.callee === maybeCallee) { + evalNode = maybeCallee.parent; + } + } + } + + if (evalNode) { + context.report({ + node: evalNode, + messageId: "noFunctionConstructor" + }); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js b/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js new file mode 100644 index 0000000..699390d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js @@ -0,0 +1,66 @@ +/** + * @fileoverview Rule to disallow use of the new operator with global non-constructor functions + * @author Sosuke Suzuki + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const nonConstructorGlobalFunctionNames = ["Symbol", "BigInt"]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow `new` operators with global non-constructor functions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-new-native-nonconstructor" + }, + + schema: [], + + messages: { + noNewNonconstructor: "`{{name}}` cannot be called as a constructor." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + return { + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + + for (const nonConstructorName of nonConstructorGlobalFunctionNames) { + const variable = globalScope.set.get(nonConstructorName); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const idNode = ref.identifier; + const parent = idNode.parent; + + if (parent && parent.type === "NewExpression" && parent.callee === idNode) { + context.report({ + node: idNode, + messageId: "noNewNonconstructor", + data: { name: nonConstructorName } + }); + } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-object.js b/node_modules/eslint/lib/rules/no-new-object.js new file mode 100644 index 0000000..62b4aed --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-object.js @@ -0,0 +1,76 @@ +/** + * @fileoverview A rule to disallow calls to the Object constructor + * @author Matt DuVall + * @deprecated in ESLint v8.50.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `Object` constructors", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-new-object" + }, + + deprecated: { + message: "The new rule flags more situations where object literal syntax can be used, and it does not report a problem when the `Object` constructor is invoked with an argument.", + url: "https://eslint.org/blog/2023/09/eslint-v8.50.0-released/", + deprecatedSince: "8.50.0", + availableUntil: null, + replacedBy: [ + { + rule: { + name: "no-object-constructor", + url: "https://eslint.org/docs/rules/no-object-constructor" + } + } + ] + }, + + schema: [], + + messages: { + preferLiteral: "The object literal notation {} is preferable." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + return { + NewExpression(node) { + const variable = astUtils.getVariableByName( + sourceCode.getScope(node), + node.callee.name + ); + + if (variable && variable.identifiers.length > 0) { + return; + } + + if (node.callee.name === "Object") { + context.report({ + node, + messageId: "preferLiteral" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-require.js b/node_modules/eslint/lib/rules/no-new-require.js new file mode 100644 index 0000000..0168ccd --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-require.js @@ -0,0 +1,66 @@ +/** + * @fileoverview Rule to disallow use of new operator with the `require` function + * @author Wil Moore III + * @deprecated in ESLint v7.0.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "no-new-require", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-new-require.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Disallow `new` operators with calls to `require`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-new-require" + }, + + schema: [], + + messages: { + noNewRequire: "Unexpected use of new with require." + } + }, + + create(context) { + + return { + + NewExpression(node) { + if (node.callee.type === "Identifier" && node.callee.name === "require") { + context.report({ + node, + messageId: "noNewRequire" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-symbol.js b/node_modules/eslint/lib/rules/no-new-symbol.js new file mode 100644 index 0000000..18146fa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-symbol.js @@ -0,0 +1,72 @@ +/** + * @fileoverview Rule to disallow use of the new operator with the `Symbol` object + * @author Alberto Rodríguez + * @deprecated in ESLint v9.0.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow `new` operators with the `Symbol` object", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-new-symbol" + }, + + deprecated: { + message: "The rule was replaced with a more general rule.", + url: "https://eslint.org/docs/latest/use/migrate-to-9.0.0#eslint-recommended", + deprecatedSince: "9.0.0", + availableUntil: null, + replacedBy: [ + { + rule: { + name: "no-new-native-nonconstructor", + url: "https://eslint.org/docs/latest/rules/no-new-native-nonconstructor" + } + } + ] + }, + + schema: [], + + messages: { + noNewSymbol: "`Symbol` cannot be called as a constructor." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + return { + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + const variable = globalScope.set.get("Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const idNode = ref.identifier; + const parent = idNode.parent; + + if (parent && parent.type === "NewExpression" && parent.callee === idNode) { + context.report({ + node: idNode, + messageId: "noNewSymbol" + }); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-wrappers.js b/node_modules/eslint/lib/rules/no-new-wrappers.js new file mode 100644 index 0000000..5050a98 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-wrappers.js @@ -0,0 +1,60 @@ +/** + * @fileoverview Rule to flag when using constructor for wrapper objects + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getVariableByName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `new` operators with the `String`, `Number`, and `Boolean` objects", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-new-wrappers" + }, + + schema: [], + + messages: { + noConstructor: "Do not use {{fn}} as a constructor." + } + }, + + create(context) { + const { sourceCode } = context; + + return { + + NewExpression(node) { + const wrapperObjects = ["String", "Number", "Boolean"]; + const { name } = node.callee; + + if (wrapperObjects.includes(name)) { + const variable = getVariableByName(sourceCode.getScope(node), name); + + if (variable && variable.identifiers.length === 0) { + context.report({ + node, + messageId: "noConstructor", + data: { fn: name } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new.js b/node_modules/eslint/lib/rules/no-new.js new file mode 100644 index 0000000..9e20bad --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to flag statements with function invocation preceded by + * "new" and not part of assignment + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `new` operators outside of assignments or comparisons", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-new" + }, + + schema: [], + + messages: { + noNewStatement: "Do not use 'new' for side effects." + } + }, + + create(context) { + + return { + "ExpressionStatement > NewExpression"(node) { + context.report({ + node: node.parent, + messageId: "noNewStatement" + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js b/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js new file mode 100644 index 0000000..5939390 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js @@ -0,0 +1,148 @@ +/** + * @fileoverview Rule to disallow `\8` and `\9` escape sequences in string literals. + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const QUICK_TEST_REGEX = /\\[89]/u; + +/** + * Returns unicode escape sequence that represents the given character. + * @param {string} character A single code unit. + * @returns {string} "\uXXXX" sequence. + */ +function getUnicodeEscape(character) { + return `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `\\8` and `\\9` escape sequences in string literals", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape" + }, + + hasSuggestions: true, + + schema: [], + + messages: { + decimalEscape: "Don't use '{{decimalEscape}}' escape sequence.", + + // suggestions + refactor: "Replace '{{original}}' with '{{replacement}}'. This maintains the current functionality.", + escapeBackslash: "Replace '{{original}}' with '{{replacement}}' to include the actual backslash character." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Creates a new Suggestion object. + * @param {string} messageId "refactor" or "escapeBackslash". + * @param {int[]} range The range to replace. + * @param {string} replacement New text for the range. + * @returns {Object} Suggestion + */ + function createSuggestion(messageId, range, replacement) { + return { + messageId, + data: { + original: sourceCode.getText().slice(...range), + replacement + }, + fix(fixer) { + return fixer.replaceTextRange(range, replacement); + } + }; + } + + return { + Literal(node) { + if (typeof node.value !== "string") { + return; + } + + if (!QUICK_TEST_REGEX.test(node.raw)) { + return; + } + + const regex = /(?:[^\\]|(?\\.))*?(?\\[89])/suy; + let match; + + while ((match = regex.exec(node.raw))) { + const { previousEscape, decimalEscape } = match.groups; + const decimalEscapeRangeEnd = node.range[0] + match.index + match[0].length; + const decimalEscapeRangeStart = decimalEscapeRangeEnd - decimalEscape.length; + const decimalEscapeRange = [decimalEscapeRangeStart, decimalEscapeRangeEnd]; + const suggest = []; + + // When `regex` is matched, `previousEscape` can only capture characters adjacent to `decimalEscape` + if (previousEscape === "\\0") { + + /* + * Now we have a NULL escape "\0" immediately followed by a decimal escape, e.g.: "\0\8". + * Fixing this to "\08" would turn "\0" into a legacy octal escape. To avoid producing + * an octal escape while fixing a decimal escape, we provide different suggestions. + */ + suggest.push( + createSuggestion( // "\0\8" -> "\u00008" + "refactor", + [decimalEscapeRangeStart - previousEscape.length, decimalEscapeRangeEnd], + `${getUnicodeEscape("\0")}${decimalEscape[1]}` + ), + createSuggestion( // "\8" -> "\u0038" + "refactor", + decimalEscapeRange, + getUnicodeEscape(decimalEscape[1]) + ) + ); + } else { + suggest.push( + createSuggestion( // "\8" -> "8" + "refactor", + decimalEscapeRange, + decimalEscape[1] + ) + ); + } + + suggest.push( + createSuggestion( // "\8" -> "\\8" + "escapeBackslash", + decimalEscapeRange, + `\\${decimalEscape}` + ) + ); + + context.report({ + node, + loc: { + start: sourceCode.getLocFromIndex(decimalEscapeRangeStart), + end: sourceCode.getLocFromIndex(decimalEscapeRangeEnd) + }, + messageId: "decimalEscape", + data: { + decimalEscape + }, + suggest + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-obj-calls.js b/node_modules/eslint/lib/rules/no-obj-calls.js new file mode 100644 index 0000000..ee767ea --- /dev/null +++ b/node_modules/eslint/lib/rules/no-obj-calls.js @@ -0,0 +1,86 @@ +/** + * @fileoverview Rule to flag use of an object property of the global object (Math and JSON) as a function + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CALL, CONSTRUCT, ReferenceTracker } = require("@eslint-community/eslint-utils"); +const getPropertyName = require("./utils/ast-utils").getStaticPropertyName; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const nonCallableGlobals = ["Atomics", "JSON", "Math", "Reflect", "Intl"]; + +/** + * Returns the name of the node to report + * @param {ASTNode} node A node to report + * @returns {string} name to report + */ +function getReportNodeName(node) { + if (node.type === "ChainExpression") { + return getReportNodeName(node.expression); + } + if (node.type === "MemberExpression") { + return getPropertyName(node); + } + return node.name; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow calling global object properties as functions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-obj-calls" + }, + + schema: [], + + messages: { + unexpectedCall: "'{{name}}' is not a function.", + unexpectedRefCall: "'{{name}}' is reference to '{{ref}}', which is not a function." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + return { + Program(node) { + const scope = sourceCode.getScope(node); + const tracker = new ReferenceTracker(scope); + const traceMap = {}; + + for (const g of nonCallableGlobals) { + traceMap[g] = { + [CALL]: true, + [CONSTRUCT]: true + }; + } + + for (const { node: refNode, path } of tracker.iterateGlobalReferences(traceMap)) { + const name = getReportNodeName(refNode.callee); + const ref = path[0]; + const messageId = name === ref ? "unexpectedCall" : "unexpectedRefCall"; + + context.report({ node: refNode, messageId, data: { name, ref } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-object-constructor.js b/node_modules/eslint/lib/rules/no-object-constructor.js new file mode 100644 index 0000000..8875ec2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-object-constructor.js @@ -0,0 +1,117 @@ +/** + * @fileoverview Rule to disallow calls to the `Object` constructor without an argument + * @author Francesco Trotta + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + getVariableByName, + isArrowToken, + isStartOfExpressionStatement, + needsPrecedingSemicolon +} = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow calls to the `Object` constructor without an argument", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-object-constructor" + }, + + hasSuggestions: true, + + schema: [], + + messages: { + preferLiteral: "The object literal notation {} is preferable.", + useLiteral: "Replace with '{{replacement}}'.", + useLiteralAfterSemicolon: "Replace with '{{replacement}}', add preceding semicolon." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Determines whether or not an object literal that replaces a specified node needs to be enclosed in parentheses. + * @param {ASTNode} node The node to be replaced. + * @returns {boolean} Whether or not parentheses around the object literal are required. + */ + function needsParentheses(node) { + if (isStartOfExpressionStatement(node)) { + return true; + } + + const prevToken = sourceCode.getTokenBefore(node); + + if (prevToken && isArrowToken(prevToken)) { + return true; + } + + return false; + } + + /** + * Reports on nodes where the `Object` constructor is called without arguments. + * @param {ASTNode} node The node to evaluate. + * @returns {void} + */ + function check(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "Object" || node.arguments.length) { + return; + } + + const variable = getVariableByName(sourceCode.getScope(node), "Object"); + + if (variable && variable.identifiers.length === 0) { + let replacement; + let fixText; + let messageId = "useLiteral"; + + if (needsParentheses(node)) { + replacement = "({})"; + if (needsPrecedingSemicolon(sourceCode, node)) { + fixText = ";({})"; + messageId = "useLiteralAfterSemicolon"; + } else { + fixText = "({})"; + } + } else { + replacement = fixText = "{}"; + } + + context.report({ + node, + messageId: "preferLiteral", + suggest: [ + { + messageId, + data: { replacement }, + fix: fixer => fixer.replaceText(node, fixText) + } + ] + }); + } + } + + return { + CallExpression: check, + NewExpression: check + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-octal-escape.js b/node_modules/eslint/lib/rules/no-octal-escape.js new file mode 100644 index 0000000..6924d54 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-octal-escape.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Rule to flag octal escape sequences in string literals. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow octal escape sequences in string literals", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-octal-escape" + }, + + schema: [], + + messages: { + octalEscapeSequence: "Don't use octal: '\\{{sequence}}'. Use '\\u....' instead." + } + }, + + create(context) { + + return { + + Literal(node) { + if (typeof node.value !== "string") { + return; + } + + // \0 represents a valid NULL character if it isn't followed by a digit. + const match = node.raw.match( + /^(?:[^\\]|\\.)*?\\([0-3][0-7]{1,2}|[4-7][0-7]|0(?=[89])|[1-7])/su + ); + + if (match) { + context.report({ + node, + messageId: "octalEscapeSequence", + data: { sequence: match[1] } + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-octal.js b/node_modules/eslint/lib/rules/no-octal.js new file mode 100644 index 0000000..dc02769 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-octal.js @@ -0,0 +1,45 @@ +/** + * @fileoverview Rule to flag when initializing octal literal + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow octal literals", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-octal" + }, + + schema: [], + + messages: { + noOctal: "Octal literals should not be used." + } + }, + + create(context) { + + return { + + Literal(node) { + if (typeof node.value === "number" && /^0[0-9]/u.test(node.raw)) { + context.report({ + node, + messageId: "noOctal" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-param-reassign.js b/node_modules/eslint/lib/rules/no-param-reassign.js new file mode 100644 index 0000000..4f6c6f5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-param-reassign.js @@ -0,0 +1,230 @@ +/** + * @fileoverview Disallow reassigning function parameters. + * @author Nat Burns + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/u; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow reassigning function parameters", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-param-reassign" + }, + + schema: [ + { + oneOf: [ + { + type: "object", + properties: { + props: { + enum: [false] + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + props: { + enum: [true] + }, + ignorePropertyModificationsFor: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + ignorePropertyModificationsForRegex: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + assignmentToFunctionParam: "Assignment to function parameter '{{name}}'.", + assignmentToFunctionParamProp: "Assignment to property of function parameter '{{name}}'." + } + }, + + create(context) { + const props = context.options[0] && context.options[0].props; + const ignoredPropertyAssignmentsFor = context.options[0] && context.options[0].ignorePropertyModificationsFor || []; + const ignoredPropertyAssignmentsForRegex = context.options[0] && context.options[0].ignorePropertyModificationsForRegex || []; + const sourceCode = context.sourceCode; + + /** + * Checks whether or not the reference modifies properties of its variable. + * @param {Reference} reference A reference to check. + * @returns {boolean} Whether or not the reference modifies properties of its variable. + */ + function isModifyingProp(reference) { + let node = reference.identifier; + let parent = node.parent; + + while (parent && (!stopNodePattern.test(parent.type) || + parent.type === "ForInStatement" || parent.type === "ForOfStatement")) { + switch (parent.type) { + + // e.g. foo.a = 0; + case "AssignmentExpression": + return parent.left === node; + + // e.g. ++foo.a; + case "UpdateExpression": + return true; + + // e.g. delete foo.a; + case "UnaryExpression": + if (parent.operator === "delete") { + return true; + } + break; + + // e.g. for (foo.a in b) {} + case "ForInStatement": + case "ForOfStatement": + if (parent.left === node) { + return true; + } + + // this is a stop node for parent.right and parent.body + return false; + + // EXCLUDES: e.g. cache.get(foo.a).b = 0; + case "CallExpression": + if (parent.callee !== node) { + return false; + } + break; + + // EXCLUDES: e.g. cache[foo.a] = 0; + case "MemberExpression": + if (parent.property === node) { + return false; + } + break; + + // EXCLUDES: e.g. ({ [foo]: a }) = bar; + case "Property": + if (parent.key === node) { + return false; + } + + break; + + // EXCLUDES: e.g. (foo ? a : b).c = bar; + case "ConditionalExpression": + if (parent.test === node) { + return false; + } + + break; + + // no default + } + + node = parent; + parent = node.parent; + } + + return false; + } + + /** + * Tests that an identifier name matches any of the ignored property assignments. + * First we test strings in ignoredPropertyAssignmentsFor. + * Then we instantiate and test RegExp objects from ignoredPropertyAssignmentsForRegex strings. + * @param {string} identifierName A string that describes the name of an identifier to + * ignore property assignments for. + * @returns {boolean} Whether the string matches an ignored property assignment regular expression or not. + */ + function isIgnoredPropertyAssignment(identifierName) { + return ignoredPropertyAssignmentsFor.includes(identifierName) || + ignoredPropertyAssignmentsForRegex.some(ignored => new RegExp(ignored, "u").test(identifierName)); + } + + /** + * Reports a reference if is non initializer and writable. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (identifier && + !reference.init && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + if (reference.isWrite()) { + context.report({ + node: identifier, + messageId: "assignmentToFunctionParam", + data: { name: identifier.name } + }); + } else if (props && isModifyingProp(reference) && !isIgnoredPropertyAssignment(identifier.name)) { + context.report({ + node: identifier, + messageId: "assignmentToFunctionParamProp", + data: { name: identifier.name } + }); + } + } + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "Parameter") { + variable.references.forEach(checkReference); + } + } + + /** + * Checks parameters of a given function node. + * @param {ASTNode} node A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + sourceCode.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + + // `:exit` is needed for the `node.parent` property of identifier nodes. + "FunctionDeclaration:exit": checkForFunction, + "FunctionExpression:exit": checkForFunction, + "ArrowFunctionExpression:exit": checkForFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-path-concat.js b/node_modules/eslint/lib/rules/no-path-concat.js new file mode 100644 index 0000000..3051648 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-path-concat.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Disallow string concatenation when using __dirname and __filename + * @author Nicholas C. Zakas + * @deprecated in ESLint v7.0.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "no-path-concat", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-path-concat.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Disallow string concatenation with `__dirname` and `__filename`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-path-concat" + }, + + schema: [], + + messages: { + usePathFunctions: "Use path.join() or path.resolve() instead of + to create paths." + } + }, + + create(context) { + + const MATCHER = /^__(?:dir|file)name$/u; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + BinaryExpression(node) { + + const left = node.left, + right = node.right; + + if (node.operator === "+" && + ((left.type === "Identifier" && MATCHER.test(left.name)) || + (right.type === "Identifier" && MATCHER.test(right.name))) + ) { + + context.report({ + node, + messageId: "usePathFunctions" + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-plusplus.js b/node_modules/eslint/lib/rules/no-plusplus.js new file mode 100644 index 0000000..8a1d6ad --- /dev/null +++ b/node_modules/eslint/lib/rules/no-plusplus.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Rule to flag use of unary increment and decrement operators. + * @author Ian Christian Myers + * @author Brody McKee (github.com/mrmckeb) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is the update node of a `ForStatement`. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `ForStatement` update. + */ +function isForStatementUpdate(node) { + const parent = node.parent; + + return parent.type === "ForStatement" && parent.update === node; +} + +/** + * Determines whether the given node is considered to be a for loop "afterthought" by the logic of this rule. + * In particular, it returns `true` if the given node is either: + * - The update node of a `ForStatement`: for (;; i++) {} + * - An operand of a sequence expression that is the update node: for (;; foo(), i++) {} + * - An operand of a sequence expression that is child of another sequence expression, etc., + * up to the sequence expression that is the update node: for (;; foo(), (bar(), (baz(), i++))) {} + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a for loop afterthought. + */ +function isForLoopAfterthought(node) { + const parent = node.parent; + + if (parent.type === "SequenceExpression") { + return isForLoopAfterthought(parent); + } + + return isForStatementUpdate(node); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allowForLoopAfterthoughts: false + }], + + docs: { + description: "Disallow the unary operators `++` and `--`", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-plusplus" + }, + + schema: [ + { + type: "object", + properties: { + allowForLoopAfterthoughts: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedUnaryOp: "Unary operator '{{operator}}' used." + } + }, + + create(context) { + const [{ allowForLoopAfterthoughts }] = context.options; + + return { + + UpdateExpression(node) { + if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) { + return; + } + + context.report({ + node, + messageId: "unexpectedUnaryOp", + data: { + operator: node.operator + } + }); + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-process-env.js b/node_modules/eslint/lib/rules/no-process-env.js new file mode 100644 index 0000000..a5ab059 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-process-env.js @@ -0,0 +1,67 @@ +/** + * @fileoverview Disallow the use of process.env() + * @author Vignesh Anand + * @deprecated in ESLint v7.0.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "no-process-env", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-process-env.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Disallow the use of `process.env`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-process-env" + }, + + schema: [], + + messages: { + unexpectedProcessEnv: "Unexpected use of process.env." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + const objectName = node.object.name, + propertyName = node.property.name; + + if (objectName === "process" && !node.computed && propertyName && propertyName === "env") { + context.report({ node, messageId: "unexpectedProcessEnv" }); + } + + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-process-exit.js b/node_modules/eslint/lib/rules/no-process-exit.js new file mode 100644 index 0000000..72acca7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-process-exit.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Disallow the use of process.exit() + * @author Nicholas C. Zakas + * @deprecated in ESLint v7.0.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "no-process-exit", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-process-exit.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Disallow the use of `process.exit()`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-process-exit" + }, + + schema: [], + + messages: { + noProcessExit: "Don't use process.exit(); throw an error instead." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(node) { + context.report({ node: node.parent, messageId: "noProcessExit" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-promise-executor-return.js b/node_modules/eslint/lib/rules/no-promise-executor-return.js new file mode 100644 index 0000000..a056f6d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-promise-executor-return.js @@ -0,0 +1,263 @@ +/** + * @fileoverview Rule to disallow returning values from Promise executor functions + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { findVariable } = require("@eslint-community/eslint-utils"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const functionTypesToCheck = new Set(["ArrowFunctionExpression", "FunctionExpression"]); + +/** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ +function isGlobalReference(node, scope) { + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; +} + +/** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ +function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + return upper; +} + +/** + * Determines whether the given function node is used as a Promise executor. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Function's own scope. + * @returns {boolean} `true` if the node is a Promise executor. + */ +function isPromiseExecutor(node, scope) { + const parent = node.parent; + + return parent.type === "NewExpression" && + parent.arguments[0] === node && + parent.callee.type === "Identifier" && + parent.callee.name === "Promise" && + isGlobalReference(parent.callee, getOuterScope(scope)); +} + +/** + * Checks if the given node is a void expression. + * @param {ASTNode} node The node to check. + * @returns {boolean} - `true` if the node is a void expression + */ +function expressionIsVoid(node) { + return node.type === "UnaryExpression" && node.operator === "void"; +} + +/** + * Fixes the linting error by prepending "void " to the given node + * @param {Object} sourceCode context given by context.sourceCode + * @param {ASTNode} node The node to fix. + * @param {Object} fixer The fixer object provided by ESLint. + * @returns {Array} - An array of fix objects to apply to the node. + */ +function voidPrependFixer(sourceCode, node, fixer) { + + const requiresParens = + + // prepending `void ` will fail if the node has a lower precedence than void + astUtils.getPrecedence(node) < astUtils.getPrecedence({ type: "UnaryExpression", operator: "void" }) && + + // check if there are parentheses around the node to avoid redundant parentheses + !astUtils.isParenthesised(sourceCode, node); + + // avoid parentheses issues + const returnOrArrowToken = sourceCode.getTokenBefore( + node, + node.parent.type === "ArrowFunctionExpression" + ? astUtils.isArrowToken + + // isReturnToken + : token => token.type === "Keyword" && token.value === "return" + ); + + const firstToken = sourceCode.getTokenAfter(returnOrArrowToken); + + const prependSpace = + + // is return token, as => allows void to be adjacent + returnOrArrowToken.value === "return" && + + // If two tokens (return and "(") are adjacent + returnOrArrowToken.range[1] === firstToken.range[0]; + + return [ + fixer.insertTextBefore(firstToken, `${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`), + fixer.insertTextAfter(node, requiresParens ? ")" : "") + ]; +} + +/** + * Fixes the linting error by `wrapping {}` around the given node's body. + * @param {Object} sourceCode context given by context.sourceCode + * @param {ASTNode} node The node to fix. + * @param {Object} fixer The fixer object provided by ESLint. + * @returns {Array} - An array of fix objects to apply to the node. + */ +function curlyWrapFixer(sourceCode, node, fixer) { + + // https://github.com/eslint/eslint/pull/17282#issuecomment-1592795923 + const arrowToken = sourceCode.getTokenBefore(node.body, astUtils.isArrowToken); + const firstToken = sourceCode.getTokenAfter(arrowToken); + const lastToken = sourceCode.getLastToken(node); + + return [ + fixer.insertTextBefore(firstToken, "{"), + fixer.insertTextAfter(lastToken, "}") + ]; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + allowVoid: false + }], + + docs: { + description: "Disallow returning values from Promise executor functions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-promise-executor-return" + }, + + hasSuggestions: true, + + schema: [{ + type: "object", + properties: { + allowVoid: { + type: "boolean" + } + }, + additionalProperties: false + }], + + messages: { + returnsValue: "Return values from promise executor functions cannot be read.", + + // arrow and function suggestions + prependVoid: "Prepend `void` to the expression.", + + // only arrow suggestions + wrapBraces: "Wrap the expression in `{}`." + } + }, + + create(context) { + let funcInfo = null; + const sourceCode = context.sourceCode; + const [{ allowVoid }] = context.options; + + return { + + onCodePathStart(_, node) { + funcInfo = { + upper: funcInfo, + shouldCheck: + functionTypesToCheck.has(node.type) && + isPromiseExecutor(node, sourceCode.getScope(node)) + }; + + if (// Is a Promise executor + funcInfo.shouldCheck && + node.type === "ArrowFunctionExpression" && + node.expression && + + // Except void + !(allowVoid && expressionIsVoid(node.body)) + ) { + const suggest = []; + + // prevent useless refactors + if (allowVoid) { + suggest.push({ + messageId: "prependVoid", + fix(fixer) { + return voidPrependFixer(sourceCode, node.body, fixer); + } + }); + } + + // Do not suggest wrapping an unnamed FunctionExpression in braces as that would be invalid syntax. + if (!(node.body.type === "FunctionExpression" && !node.body.id)) { + suggest.push({ + messageId: "wrapBraces", + fix(fixer) { + return curlyWrapFixer(sourceCode, node, fixer); + } + }); + } + + context.report({ + node: node.body, + messageId: "returnsValue", + suggest + }); + } + }, + + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + ReturnStatement(node) { + if (!(funcInfo.shouldCheck && node.argument)) { + return; + } + + // node is `return ` + if (!allowVoid) { + context.report({ node, messageId: "returnsValue" }); + return; + } + + if (expressionIsVoid(node.argument)) { + return; + } + + // allowVoid && !expressionIsVoid + context.report({ + node, + messageId: "returnsValue", + suggest: [{ + messageId: "prependVoid", + fix(fixer) { + return voidPrependFixer(sourceCode, node.argument, fixer); + } + }] + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-proto.js b/node_modules/eslint/lib/rules/no-proto.js new file mode 100644 index 0000000..28320d5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-proto.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag usage of __proto__ property + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticPropertyName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow the use of the `__proto__` property", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-proto" + }, + + schema: [], + + messages: { + unexpectedProto: "The '__proto__' property is deprecated." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + if (getStaticPropertyName(node) === "__proto__") { + context.report({ node, messageId: "unexpectedProto" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-prototype-builtins.js b/node_modules/eslint/lib/rules/no-prototype-builtins.js new file mode 100644 index 0000000..b61e585 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-prototype-builtins.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Rule to disallow use of Object.prototype builtins on objects + * @author Andrew Levine + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Returns true if the node or any of the objects + * to the left of it in the member/call chain is optional. + * + * e.g. `a?.b`, `a?.b.c`, `a?.()`, `a()?.()` + * @param {ASTNode} node The expression to check + * @returns {boolean} `true` if there is a short-circuiting optional `?.` + * in the same option chain to the left of this call or member expression, + * or the node itself is an optional call or member `?.`. + */ +function isAfterOptional(node) { + let leftNode; + + if (node.type === "MemberExpression") { + leftNode = node.object; + } else if (node.type === "CallExpression") { + leftNode = node.callee; + } else { + return false; + } + if (node.optional) { + return true; + } + return isAfterOptional(leftNode); +} + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow calling some `Object.prototype` methods directly on objects", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-prototype-builtins" + }, + + hasSuggestions: true, + + schema: [], + + messages: { + prototypeBuildIn: "Do not access Object.prototype method '{{prop}}' from target object.", + callObjectPrototype: "Call Object.prototype.{{prop}} explicitly." + } + }, + + create(context) { + const DISALLOWED_PROPS = new Set([ + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable" + ]); + + /** + * Reports if a disallowed property is used in a CallExpression + * @param {ASTNode} node The CallExpression node. + * @returns {void} + */ + function disallowBuiltIns(node) { + + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type !== "MemberExpression") { + return; + } + + const propName = astUtils.getStaticPropertyName(callee); + + if (propName !== null && DISALLOWED_PROPS.has(propName)) { + context.report({ + messageId: "prototypeBuildIn", + loc: callee.property.loc, + data: { prop: propName }, + node, + suggest: [ + { + messageId: "callObjectPrototype", + data: { prop: propName }, + fix(fixer) { + const sourceCode = context.sourceCode; + + /* + * A call after an optional chain (e.g. a?.b.hasOwnProperty(c)) + * must be fixed manually because the call can be short-circuited + */ + if (isAfterOptional(node)) { + return null; + } + + /* + * A call on a ChainExpression (e.g. (a?.hasOwnProperty)(c)) will trigger + * no-unsafe-optional-chaining which should be fixed before this suggestion + */ + if (node.callee.type === "ChainExpression") { + return null; + } + + const objectVariable = astUtils.getVariableByName(sourceCode.getScope(node), "Object"); + + /* + * We can't use Object if the global Object was shadowed, + * or Object does not exist in the global scope for some reason + */ + if (!objectVariable || objectVariable.scope.type !== "global" || objectVariable.defs.length > 0) { + return null; + } + + let objectText = sourceCode.getText(callee.object); + + if (astUtils.getPrecedence(callee.object) <= astUtils.getPrecedence({ type: "SequenceExpression" })) { + objectText = `(${objectText})`; + } + + const openParenToken = sourceCode.getTokenAfter( + node.callee, + astUtils.isOpeningParenToken + ); + const isEmptyParameters = node.arguments.length === 0; + const delim = isEmptyParameters ? "" : ", "; + const fixes = [ + fixer.replaceText(callee, `Object.prototype.${propName}.call`), + fixer.insertTextAfter(openParenToken, objectText + delim) + ]; + + return fixes; + } + } + ] + }); + } + } + + return { + CallExpression: disallowBuiltIns + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-redeclare.js b/node_modules/eslint/lib/rules/no-redeclare.js new file mode 100644 index 0000000..94a3c21 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-redeclare.js @@ -0,0 +1,171 @@ +/** + * @fileoverview Rule to flag when the same variable is declared more then once. + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ builtinGlobals: true }], + + docs: { + description: "Disallow variable redeclaration", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-redeclare" + }, + + messages: { + redeclared: "'{{id}}' is already defined.", + redeclaredAsBuiltin: "'{{id}}' is already defined as a built-in global variable.", + redeclaredBySyntax: "'{{id}}' is already defined by a variable declaration." + }, + + schema: [ + { + type: "object", + properties: { + builtinGlobals: { type: "boolean" } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const [{ builtinGlobals }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Iterate declarations of a given variable. + * @param {escope.variable} variable The variable object to iterate declarations. + * @returns {IterableIterator<{type:string,node:ASTNode,loc:SourceLocation}>} The declarations. + */ + function *iterateDeclarations(variable) { + if (builtinGlobals && ( + variable.eslintImplicitGlobalSetting === "readonly" || + variable.eslintImplicitGlobalSetting === "writable" + )) { + yield { type: "builtin" }; + } + + for (const id of variable.identifiers) { + yield { type: "syntax", node: id, loc: id.loc }; + } + + if (variable.eslintExplicitGlobalComments) { + for (const comment of variable.eslintExplicitGlobalComments) { + yield { + type: "comment", + node: comment, + loc: astUtils.getNameLocationInGlobalDirectiveComment( + sourceCode, + comment, + variable.name + ) + }; + } + } + } + + /** + * Find variables in a given scope and flag redeclared ones. + * @param {Scope} scope An eslint-scope scope object. + * @returns {void} + * @private + */ + function findVariablesInScope(scope) { + for (const variable of scope.variables) { + const [ + declaration, + ...extraDeclarations + ] = iterateDeclarations(variable); + + if (extraDeclarations.length === 0) { + continue; + } + + /* + * If the type of a declaration is different from the type of + * the first declaration, it shows the location of the first + * declaration. + */ + const detailMessageId = declaration.type === "builtin" + ? "redeclaredAsBuiltin" + : "redeclaredBySyntax"; + const data = { id: variable.name }; + + // Report extra declarations. + for (const { type, node, loc } of extraDeclarations) { + const messageId = type === declaration.type + ? "redeclared" + : detailMessageId; + + context.report({ node, loc, messageId, data }); + } + } + } + + /** + * Find variables in the current scope. + * @param {ASTNode} node The node of the current scope. + * @returns {void} + * @private + */ + function checkForBlock(node) { + const scope = sourceCode.getScope(node); + + /* + * In ES5, some node type such as `BlockStatement` doesn't have that scope. + * `scope.block` is a different node in such a case. + */ + if (scope.block === node) { + findVariablesInScope(scope); + } + } + + return { + Program(node) { + const scope = sourceCode.getScope(node); + + findVariablesInScope(scope); + + // Node.js or ES modules has a special scope. + if ( + scope.type === "global" && + scope.childScopes[0] && + + // The special scope's block is the Program node. + scope.block === scope.childScopes[0].block + ) { + findVariablesInScope(scope.childScopes[0]); + } + }, + + FunctionDeclaration: checkForBlock, + FunctionExpression: checkForBlock, + ArrowFunctionExpression: checkForBlock, + + StaticBlock: checkForBlock, + + BlockStatement: checkForBlock, + ForStatement: checkForBlock, + ForInStatement: checkForBlock, + ForOfStatement: checkForBlock, + SwitchStatement: checkForBlock + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-regex-spaces.js b/node_modules/eslint/lib/rules/no-regex-spaces.js new file mode 100644 index 0000000..cb25010 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-regex-spaces.js @@ -0,0 +1,197 @@ +/** + * @fileoverview Rule to count multiple spaces in regular expressions + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const regexpp = require("@eslint-community/regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const regExpParser = new regexpp.RegExpParser(); +const DOUBLE_SPACE = / {2}/u; + +/** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ +function isString(node) { + return node && node.type === "Literal" && typeof node.value === "string"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow multiple spaces in regular expressions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-regex-spaces" + }, + + schema: [], + fixable: "code", + + messages: { + multipleSpaces: "Spaces are hard to count. Use {{{length}}}." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Validate regular expression + * @param {ASTNode} nodeToReport Node to report. + * @param {string} pattern Regular expression pattern to validate. + * @param {string} rawPattern Raw representation of the pattern in the source code. + * @param {number} rawPatternStartRange Start range of the pattern in the source code. + * @param {string} flags Regular expression flags. + * @returns {void} + * @private + */ + function checkRegex(nodeToReport, pattern, rawPattern, rawPatternStartRange, flags) { + + // Skip if there are no consecutive spaces in the source code, to avoid reporting e.g., RegExp(' \ '). + if (!DOUBLE_SPACE.test(rawPattern)) { + return; + } + + const characterClassNodes = []; + let regExpAST; + + try { + regExpAST = regExpParser.parsePattern(pattern, 0, pattern.length, { unicode: flags.includes("u"), unicodeSets: flags.includes("v") }); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + regexpp.visitRegExpAST(regExpAST, { + onCharacterClassEnter(ccNode) { + characterClassNodes.push(ccNode); + } + }); + + const spacesPattern = /( {2,})(?: [+*{?]|[^+*{?]|$)/gu; + let match; + + while ((match = spacesPattern.exec(pattern))) { + const { 1: { length }, index } = match; + + // Report only consecutive spaces that are not in character classes. + if ( + characterClassNodes.every(({ start, end }) => index < start || end <= index) + ) { + context.report({ + node: nodeToReport, + messageId: "multipleSpaces", + data: { length }, + fix(fixer) { + if (pattern !== rawPattern) { + return null; + } + return fixer.replaceTextRange( + [rawPatternStartRange + index, rawPatternStartRange + index + length], + ` {${length}}` + ); + } + }); + + // Report only the first occurrence of consecutive spaces + return; + } + } + } + + /** + * Validate regular expression literals + * @param {ASTNode} node node to validate + * @returns {void} + * @private + */ + function checkLiteral(node) { + if (node.regex) { + const pattern = node.regex.pattern; + const rawPattern = node.raw.slice(1, node.raw.lastIndexOf("/")); + const rawPatternStartRange = node.range[0] + 1; + const flags = node.regex.flags; + + checkRegex( + node, + pattern, + rawPattern, + rawPatternStartRange, + flags + ); + } + } + + /** + * Validate strings passed to the RegExp constructor + * @param {ASTNode} node node to validate + * @returns {void} + * @private + */ + function checkFunction(node) { + const scope = sourceCode.getScope(node); + const regExpVar = astUtils.getVariableByName(scope, "RegExp"); + const shadowed = regExpVar && regExpVar.defs.length > 0; + const patternNode = node.arguments[0]; + + if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(patternNode) && !shadowed) { + const pattern = patternNode.value; + const rawPattern = patternNode.raw.slice(1, -1); + const rawPatternStartRange = patternNode.range[0] + 1; + let flags; + + if (node.arguments.length < 2) { + + // It has no flags. + flags = ""; + } else { + const flagsNode = node.arguments[1]; + + if (isString(flagsNode)) { + flags = flagsNode.value; + } else { + + // The flags cannot be determined. + return; + } + } + + checkRegex( + node, + pattern, + rawPattern, + rawPatternStartRange, + flags + ); + } + } + + return { + Literal: checkLiteral, + CallExpression: checkFunction, + NewExpression: checkFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-exports.js b/node_modules/eslint/lib/rules/no-restricted-exports.js new file mode 100644 index 0000000..8da2f2d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-exports.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to disallow specified names in exports + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow specified names in exports", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-restricted-exports" + }, + + schema: [{ + anyOf: [ + { + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + restrictedNamedExportsPattern: { type: "string" } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string", + pattern: "^(?!default$)" + }, + uniqueItems: true + }, + restrictedNamedExportsPattern: { type: "string" }, + restrictDefaultExports: { + type: "object", + properties: { + + // Allow/Disallow `export default foo; export default 42; export default function foo() {}` format + direct: { + type: "boolean" + }, + + // Allow/Disallow `export { foo as default };` declarations + named: { + type: "boolean" + }, + + // Allow/Disallow `export { default } from "mod"; export { default as default } from "mod";` declarations + defaultFrom: { + type: "boolean" + }, + + // Allow/Disallow `export { foo as default } from "mod";` declarations + namedFrom: { + type: "boolean" + }, + + // Allow/Disallow `export * as default from "mod"`; declarations + namespaceFrom: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ] + }], + + messages: { + restrictedNamed: "'{{name}}' is restricted from being used as an exported name.", + restrictedDefault: "Exporting 'default' is restricted." + } + }, + + create(context) { + + const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports); + const restrictedNamePattern = context.options[0] && context.options[0].restrictedNamedExportsPattern; + const restrictDefaultExports = context.options[0] && context.options[0].restrictDefaultExports; + const sourceCode = context.sourceCode; + + /** + * Checks and reports given exported name. + * @param {ASTNode} node exported `Identifier` or string `Literal` node to check. + * @returns {void} + */ + function checkExportedName(node) { + const name = astUtils.getModuleExportName(node); + + let matchesRestrictedNamePattern = false; + + if (restrictedNamePattern && name !== "default") { + const patternRegex = new RegExp(restrictedNamePattern, "u"); + + matchesRestrictedNamePattern = patternRegex.test(name); + } + + if (matchesRestrictedNamePattern || restrictedNames.has(name)) { + context.report({ + node, + messageId: "restrictedNamed", + data: { name } + }); + return; + } + + if (name === "default") { + if (node.parent.type === "ExportAllDeclaration") { + if (restrictDefaultExports && restrictDefaultExports.namespaceFrom) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + + } else { // ExportSpecifier + const isSourceSpecified = !!node.parent.parent.source; + const specifierLocalName = astUtils.getModuleExportName(node.parent.local); + + if (!isSourceSpecified && restrictDefaultExports && restrictDefaultExports.named) { + context.report({ + node, + messageId: "restrictedDefault" + }); + return; + } + + if (isSourceSpecified && restrictDefaultExports) { + if ( + (specifierLocalName === "default" && restrictDefaultExports.defaultFrom) || + (specifierLocalName !== "default" && restrictDefaultExports.namedFrom) + ) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + } + } + } + } + + return { + ExportAllDeclaration(node) { + if (node.exported) { + checkExportedName(node.exported); + } + }, + + ExportDefaultDeclaration(node) { + if (restrictDefaultExports && restrictDefaultExports.direct) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + }, + + ExportNamedDeclaration(node) { + const declaration = node.declaration; + + if (declaration) { + if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") { + checkExportedName(declaration.id); + } else if (declaration.type === "VariableDeclaration") { + sourceCode.getDeclaredVariables(declaration) + .map(v => v.defs.find(d => d.parent === declaration)) + .map(d => d.name) // Identifier nodes + .forEach(checkExportedName); + } + } else { + node.specifiers + .map(s => s.exported) + .forEach(checkExportedName); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-globals.js b/node_modules/eslint/lib/rules/no-restricted-globals.js new file mode 100644 index 0000000..060d50a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-globals.js @@ -0,0 +1,124 @@ +/** + * @fileoverview Restrict usage of specified globals. + * @author Benoît Zugmeyer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow specified global variables", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-restricted-globals" + }, + + schema: { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { type: "string" } + }, + required: ["name"], + additionalProperties: false + } + ] + }, + uniqueItems: true, + minItems: 0 + }, + + messages: { + defaultMessage: "Unexpected use of '{{name}}'.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + customMessage: "Unexpected use of '{{name}}'. {{customMessage}}" + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + // If no globals are restricted, we don't need to do anything + if (context.options.length === 0) { + return {}; + } + + const restrictedGlobalMessages = context.options.reduce((memo, option) => { + if (typeof option === "string") { + memo[option] = null; + } else { + memo[option.name] = option.message; + } + + return memo; + }, {}); + + /** + * Report a variable to be used as a restricted global. + * @param {Reference} reference the variable reference + * @returns {void} + * @private + */ + function reportReference(reference) { + const name = reference.identifier.name, + customMessage = restrictedGlobalMessages[name], + messageId = customMessage + ? "customMessage" + : "defaultMessage"; + + context.report({ + node: reference.identifier, + messageId, + data: { + name, + customMessage + } + }); + } + + /** + * Check if the given name is a restricted global name. + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted global or not + * @private + */ + function isRestricted(name) { + return Object.hasOwn(restrictedGlobalMessages, name); + } + + return { + Program(node) { + const scope = sourceCode.getScope(node); + + // Report variables declared elsewhere (ex: variables defined as "global" by eslint) + scope.variables.forEach(variable => { + if (!variable.defs.length && isRestricted(variable.name)) { + variable.references.forEach(reportReference); + } + }); + + // Report variables not declared at all + scope.through.forEach(reference => { + if (isRestricted(reference.identifier.name)) { + reportReference(reference); + } + }); + + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-imports.js b/node_modules/eslint/lib/rules/no-restricted-imports.js new file mode 100644 index 0000000..5fd4744 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -0,0 +1,563 @@ +/** + * @fileoverview Restrict usage of specified node imports. + * @author Guy Ellis + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const ignore = require("ignore"); + +const arrayOfStringsOrObjects = { + type: "array", + items: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { + type: "string", + minLength: 1 + }, + importNames: { + type: "array", + items: { + type: "string" + } + }, + allowImportNames: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false, + required: ["name"], + not: { required: ["importNames", "allowImportNames"] } + } + ] + }, + uniqueItems: true +}; + +const arrayOfStringsOrObjectPatterns = { + anyOf: [ + { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + { + type: "array", + items: { + type: "object", + properties: { + importNames: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + allowImportNames: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + group: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + regex: { + type: "string" + }, + importNamePattern: { + type: "string" + }, + allowImportNamePattern: { + type: "string" + }, + message: { + type: "string", + minLength: 1 + }, + caseSensitive: { + type: "boolean" + } + }, + additionalProperties: false, + not: { + anyOf: [ + { required: ["importNames", "allowImportNames"] }, + { required: ["importNamePattern", "allowImportNamePattern"] }, + { required: ["importNames", "allowImportNamePattern"] }, + { required: ["importNamePattern", "allowImportNames"] }, + { required: ["allowImportNames", "allowImportNamePattern"] } + ] + }, + oneOf: [ + { required: ["group"] }, + { required: ["regex"] } + ] + }, + uniqueItems: true + } + ] +}; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow specified modules when loaded by `import`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-restricted-imports" + }, + + messages: { + path: "'{{importSource}}' import is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + pathWithCustomMessage: "'{{importSource}}' import is restricted from being used. {{customMessage}}", + + patterns: "'{{importSource}}' import is restricted from being used by a pattern.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternWithCustomMessage: "'{{importSource}}' import is restricted from being used by a pattern. {{customMessage}}", + + patternAndImportName: "'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternAndImportNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}", + + patternAndEverything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern.", + + patternAndEverythingWithRegexImportName: "* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternAndEverythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternAndEverythingWithRegexImportNameAndCustomMessage: "* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used. {{customMessage}}", + + everything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + everythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted. {{customMessage}}", + + importName: "'{{importName}}' import from '{{importSource}}' is restricted.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + importNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted. {{customMessage}}", + + allowedImportName: "'{{importName}}' import from '{{importSource}}' is restricted because only '{{allowedImportNames}}' import(s) is/are allowed.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + allowedImportNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted because only '{{allowedImportNames}}' import(s) is/are allowed. {{customMessage}}", + + everythingWithAllowImportNames: "* import is invalid because only '{{allowedImportNames}}' from '{{importSource}}' is/are allowed.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + everythingWithAllowImportNamesAndCustomMessage: "* import is invalid because only '{{allowedImportNames}}' from '{{importSource}}' is/are allowed. {{customMessage}}", + + allowedImportNamePattern: "'{{importName}}' import from '{{importSource}}' is restricted because only imports that match the pattern '{{allowedImportNamePattern}}' are allowed from '{{importSource}}'.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + allowedImportNamePatternWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted because only imports that match the pattern '{{allowedImportNamePattern}}' are allowed from '{{importSource}}'. {{customMessage}}", + + everythingWithAllowedImportNamePattern: "* import is invalid because only imports that match the pattern '{{allowedImportNamePattern}}' from '{{importSource}}' are allowed.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + everythingWithAllowedImportNamePatternWithCustomMessage: "* import is invalid because only imports that match the pattern '{{allowedImportNamePattern}}' from '{{importSource}}' are allowed. {{customMessage}}" + }, + + schema: { + anyOf: [ + arrayOfStringsOrObjects, + { + type: "array", + items: [{ + type: "object", + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStringsOrObjectPatterns + }, + additionalProperties: false + }], + additionalItems: false + } + ] + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const options = Array.isArray(context.options) ? context.options : []; + const isPathAndPatternsObject = + typeof options[0] === "object" && + (Object.hasOwn(options[0], "paths") || Object.hasOwn(options[0], "patterns")); + + const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; + const groupedRestrictedPaths = restrictedPaths.reduce((memo, importSource) => { + const path = typeof importSource === "string" + ? importSource + : importSource.name; + + if (!memo[path]) { + memo[path] = []; + } + + if (typeof importSource === "string") { + memo[path].push({}); + } else { + memo[path].push({ + message: importSource.message, + importNames: importSource.importNames, + allowImportNames: importSource.allowImportNames + }); + } + return memo; + }, Object.create(null)); + + // Handle patterns too, either as strings or groups + let restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + // standardize to array of objects if we have an array of strings + if (restrictedPatterns.length > 0 && typeof restrictedPatterns[0] === "string") { + restrictedPatterns = [{ group: restrictedPatterns }]; + } + + // relative paths are supported for this rule + const restrictedPatternGroups = restrictedPatterns.map( + ({ group, regex, message, caseSensitive, importNames, importNamePattern, allowImportNames, allowImportNamePattern }) => ( + { + ...(group ? { matcher: ignore({ allowRelativePaths: true, ignorecase: !caseSensitive }).add(group) } : {}), + ...(typeof regex === "string" ? { regexMatcher: new RegExp(regex, caseSensitive ? "u" : "iu") } : {}), + customMessage: message, + importNames, + importNamePattern, + allowImportNames, + allowImportNamePattern + } + ) + ); + + // if no imports are restricted we don't need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatternGroups.length === 0) { + return {}; + } + + /** + * Report a restricted path. + * @param {string} importSource path of the import + * @param {Map} importNames Map of import names that are being imported + * @param {node} node representing the restricted path reference + * @returns {void} + * @private + */ + function checkRestrictedPathAndReport(importSource, importNames, node) { + if (!Object.hasOwn(groupedRestrictedPaths, importSource)) { + return; + } + + groupedRestrictedPaths[importSource].forEach(restrictedPathEntry => { + const customMessage = restrictedPathEntry.message; + const restrictedImportNames = restrictedPathEntry.importNames; + const allowedImportNames = restrictedPathEntry.allowImportNames; + + if (!restrictedImportNames && !allowedImportNames) { + context.report({ + node, + messageId: customMessage ? "pathWithCustomMessage" : "path", + data: { + importSource, + customMessage + } + }); + + return; + } + + importNames.forEach((specifiers, importName) => { + if (importName === "*") { + const [specifier] = specifiers; + + if (restrictedImportNames) { + context.report({ + node, + messageId: customMessage ? "everythingWithCustomMessage" : "everything", + loc: specifier.loc, + data: { + importSource, + importNames: restrictedImportNames, + customMessage + } + }); + } else if (allowedImportNames) { + context.report({ + node, + messageId: customMessage ? "everythingWithAllowImportNamesAndCustomMessage" : "everythingWithAllowImportNames", + loc: specifier.loc, + data: { + importSource, + allowedImportNames, + customMessage + } + }); + } + + return; + } + + if (restrictedImportNames && restrictedImportNames.includes(importName)) { + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "importNameWithCustomMessage" : "importName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName + } + }); + }); + } + + if (allowedImportNames && !allowedImportNames.includes(importName)) { + specifiers.forEach(specifier => { + context.report({ + node, + loc: specifier.loc, + messageId: customMessage ? "allowedImportNameWithCustomMessage" : "allowedImportName", + data: { + importSource, + customMessage, + importName, + allowedImportNames + } + }); + }); + } + }); + }); + } + + /** + * Report a restricted path specifically for patterns. + * @param {node} node representing the restricted path reference + * @param {Object} group contains an Ignore instance for paths, the customMessage to show on failure, + * and any restricted import names that have been specified in the config + * @param {Map} importNames Map of import names that are being imported + * @returns {void} + * @private + */ + function reportPathForPatterns(node, group, importNames) { + const importSource = node.source.value.trim(); + + const customMessage = group.customMessage; + const restrictedImportNames = group.importNames; + const restrictedImportNamePattern = group.importNamePattern ? new RegExp(group.importNamePattern, "u") : null; + const allowedImportNames = group.allowImportNames; + const allowedImportNamePattern = group.allowImportNamePattern ? new RegExp(group.allowImportNamePattern, "u") : null; + + /** + * If we are not restricting to any specific import names and just the pattern itself, + * report the error and move on + */ + if (!restrictedImportNames && !allowedImportNames && !restrictedImportNamePattern && !allowedImportNamePattern) { + context.report({ + node, + messageId: customMessage ? "patternWithCustomMessage" : "patterns", + data: { + importSource, + customMessage + } + }); + return; + } + + importNames.forEach((specifiers, importName) => { + if (importName === "*") { + const [specifier] = specifiers; + + if (restrictedImportNames) { + context.report({ + node, + messageId: customMessage ? "patternAndEverythingWithCustomMessage" : "patternAndEverything", + loc: specifier.loc, + data: { + importSource, + importNames: restrictedImportNames, + customMessage + } + }); + } else if (allowedImportNames) { + context.report({ + node, + messageId: customMessage ? "everythingWithAllowImportNamesAndCustomMessage" : "everythingWithAllowImportNames", + loc: specifier.loc, + data: { + importSource, + allowedImportNames, + customMessage + } + }); + } else if (allowedImportNamePattern) { + context.report({ + node, + messageId: customMessage ? "everythingWithAllowedImportNamePatternWithCustomMessage" : "everythingWithAllowedImportNamePattern", + loc: specifier.loc, + data: { + importSource, + allowedImportNamePattern, + customMessage + } + }); + } else { + context.report({ + node, + messageId: customMessage ? "patternAndEverythingWithRegexImportNameAndCustomMessage" : "patternAndEverythingWithRegexImportName", + loc: specifier.loc, + data: { + importSource, + importNames: restrictedImportNamePattern, + customMessage + } + }); + } + + return; + } + + if ( + (restrictedImportNames && restrictedImportNames.includes(importName)) || + (restrictedImportNamePattern && restrictedImportNamePattern.test(importName)) + ) { + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "patternAndImportNameWithCustomMessage" : "patternAndImportName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName + } + }); + }); + } + + if (allowedImportNames && !allowedImportNames.includes(importName)) { + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "allowedImportNameWithCustomMessage" : "allowedImportName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName, + allowedImportNames + } + }); + }); + } else if (allowedImportNamePattern && !allowedImportNamePattern.test(importName)) { + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "allowedImportNamePatternWithCustomMessage" : "allowedImportNamePattern", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName, + allowedImportNamePattern + } + }); + }); + } + }); + } + + /** + * Check if the given importSource is restricted by a pattern. + * @param {string} importSource path of the import + * @param {Object} group contains a Ignore instance for paths, and the customMessage to show if it fails + * @returns {boolean} whether the variable is a restricted pattern or not + * @private + */ + function isRestrictedPattern(importSource, group) { + return group.regexMatcher ? group.regexMatcher.test(importSource) : group.matcher.ignores(importSource); + } + + /** + * Checks a node to see if any problems should be reported. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkNode(node) { + const importSource = node.source.value.trim(); + const importNames = new Map(); + + if (node.type === "ExportAllDeclaration") { + const starToken = sourceCode.getFirstToken(node, 1); + + importNames.set("*", [{ loc: starToken.loc }]); + } else if (node.specifiers) { + for (const specifier of node.specifiers) { + let name; + const specifierData = { loc: specifier.loc }; + + if (specifier.type === "ImportDefaultSpecifier") { + name = "default"; + } else if (specifier.type === "ImportNamespaceSpecifier") { + name = "*"; + } else if (specifier.imported) { + name = astUtils.getModuleExportName(specifier.imported); + } else if (specifier.local) { + name = astUtils.getModuleExportName(specifier.local); + } + + if (typeof name === "string") { + if (importNames.has(name)) { + importNames.get(name).push(specifierData); + } else { + importNames.set(name, [specifierData]); + } + } + } + } + + checkRestrictedPathAndReport(importSource, importNames, node); + restrictedPatternGroups.forEach(group => { + if (isRestrictedPattern(importSource, group)) { + reportPathForPatterns(node, group, importNames); + } + }); + } + + return { + ImportDeclaration: checkNode, + ExportNamedDeclaration(node) { + if (node.source) { + checkNode(node); + } + }, + ExportAllDeclaration: checkNode + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-modules.js b/node_modules/eslint/lib/rules/no-restricted-modules.js new file mode 100644 index 0000000..8fe1f9b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-modules.js @@ -0,0 +1,229 @@ +/** + * @fileoverview Restrict usage of specified node modules. + * @author Christian Schulz + * @deprecated in ESLint v7.0.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const ignore = require("ignore"); + +const arrayOfStrings = { + type: "array", + items: { type: "string" }, + uniqueItems: true +}; + +const arrayOfStringsOrObjects = { + type: "array", + items: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { + type: "string", + minLength: 1 + } + }, + additionalProperties: false, + required: ["name"] + } + ] + }, + uniqueItems: true +}; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "no-restricted-require", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-restricted-require.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Disallow specified modules when loaded by `require`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-restricted-modules" + }, + + schema: { + anyOf: [ + arrayOfStringsOrObjects, + { + type: "array", + items: { + type: "object", + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStrings + }, + additionalProperties: false + }, + additionalItems: false + } + ] + }, + + messages: { + defaultMessage: "'{{name}}' module is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + customMessage: "'{{name}}' module is restricted from being used. {{customMessage}}", + patternMessage: "'{{name}}' module is restricted from being used by a pattern." + } + }, + + create(context) { + const options = Array.isArray(context.options) ? context.options : []; + const isPathAndPatternsObject = + typeof options[0] === "object" && + (Object.hasOwn(options[0], "paths") || Object.hasOwn(options[0], "patterns")); + + const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; + const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + const restrictedPathMessages = restrictedPaths.reduce((memo, importName) => { + if (typeof importName === "string") { + memo[importName] = null; + } else { + memo[importName.name] = importName.message; + } + return memo; + }, {}); + + // if no imports are restricted we don't need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { + return {}; + } + + // relative paths are supported for this rule + const ig = ignore({ allowRelativePaths: true }).add(restrictedPatterns); + + + /** + * Function to check if a node is a string literal. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a string literal. + */ + function isStringLiteral(node) { + return node && node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Function to check if a node is a require call. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a require call. + */ + function isRequireCall(node) { + return node.callee.type === "Identifier" && node.callee.name === "require"; + } + + /** + * Extract string from Literal or TemplateLiteral node + * @param {ASTNode} node The node to extract from + * @returns {string|null} Extracted string or null if node doesn't represent a string + */ + function getFirstArgumentString(node) { + if (isStringLiteral(node)) { + return node.value.trim(); + } + + if (astUtils.isStaticTemplateLiteral(node)) { + return node.quasis[0].value.cooked.trim(); + } + + return null; + } + + /** + * Report a restricted path. + * @param {node} node representing the restricted path reference + * @param {string} name restricted path + * @returns {void} + * @private + */ + function reportPath(node, name) { + const customMessage = restrictedPathMessages[name]; + const messageId = customMessage + ? "customMessage" + : "defaultMessage"; + + context.report({ + node, + messageId, + data: { + name, + customMessage + } + }); + } + + /** + * Check if the given name is a restricted path name + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted path or not + * @private + */ + function isRestrictedPath(name) { + return Object.hasOwn(restrictedPathMessages, name); + } + + return { + CallExpression(node) { + if (isRequireCall(node)) { + + // node has arguments + if (node.arguments.length) { + const name = getFirstArgumentString(node.arguments[0]); + + // if first argument is a string literal or a static string template literal + if (name) { + + // check if argument value is in restricted modules array + if (isRestrictedPath(name)) { + reportPath(node, name); + } + + if (restrictedPatterns.length > 0 && ig.ignores(name)) { + context.report({ + node, + messageId: "patternMessage", + data: { name } + }); + } + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-properties.js b/node_modules/eslint/lib/rules/no-restricted-properties.js new file mode 100644 index 0000000..acd178a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-properties.js @@ -0,0 +1,168 @@ +/** + * @fileoverview Rule to disallow certain object properties + * @author Will Klein & Eli White + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow certain properties on certain objects", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-restricted-properties" + }, + + schema: { + type: "array", + items: { + anyOf: [ // `object` and `property` are both optional, but at least one of them must be provided. + { + type: "object", + properties: { + object: { + type: "string" + }, + property: { + type: "string" + }, + message: { + type: "string" + } + }, + additionalProperties: false, + required: ["object"] + }, + { + type: "object", + properties: { + object: { + type: "string" + }, + property: { + type: "string" + }, + message: { + type: "string" + } + }, + additionalProperties: false, + required: ["property"] + } + ] + }, + uniqueItems: true + }, + + messages: { + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + restrictedObjectProperty: "'{{objectName}}.{{propertyName}}' is restricted from being used.{{message}}", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + restrictedProperty: "'{{propertyName}}' is restricted from being used.{{message}}" + } + }, + + create(context) { + const restrictedCalls = context.options; + + if (restrictedCalls.length === 0) { + return {}; + } + + const restrictedProperties = new Map(); + const globallyRestrictedObjects = new Map(); + const globallyRestrictedProperties = new Map(); + + restrictedCalls.forEach(option => { + const objectName = option.object; + const propertyName = option.property; + + if (typeof objectName === "undefined") { + globallyRestrictedProperties.set(propertyName, { message: option.message }); + } else if (typeof propertyName === "undefined") { + globallyRestrictedObjects.set(objectName, { message: option.message }); + } else { + if (!restrictedProperties.has(objectName)) { + restrictedProperties.set(objectName, new Map()); + } + + restrictedProperties.get(objectName).set(propertyName, { + message: option.message + }); + } + }); + + /** + * Checks to see whether a property access is restricted, and reports it if so. + * @param {ASTNode} node The node to report + * @param {string} objectName The name of the object + * @param {string} propertyName The name of the property + * @returns {undefined} + */ + function checkPropertyAccess(node, objectName, propertyName) { + if (propertyName === null) { + return; + } + const matchedObject = restrictedProperties.get(objectName); + const matchedObjectProperty = matchedObject ? matchedObject.get(propertyName) : globallyRestrictedObjects.get(objectName); + const globalMatchedProperty = globallyRestrictedProperties.get(propertyName); + + if (matchedObjectProperty) { + const message = matchedObjectProperty.message ? ` ${matchedObjectProperty.message}` : ""; + + context.report({ + node, + messageId: "restrictedObjectProperty", + data: { + objectName, + propertyName, + message + } + }); + } else if (globalMatchedProperty) { + const message = globalMatchedProperty.message ? ` ${globalMatchedProperty.message}` : ""; + + context.report({ + node, + messageId: "restrictedProperty", + data: { + propertyName, + message + } + }); + } + } + + return { + MemberExpression(node) { + checkPropertyAccess(node, node.object && node.object.name, astUtils.getStaticPropertyName(node)); + }, + ObjectPattern(node) { + let objectName = null; + + if (node.parent.type === "VariableDeclarator") { + if (node.parent.init && node.parent.init.type === "Identifier") { + objectName = node.parent.init.name; + } + } else if (node.parent.type === "AssignmentExpression" || node.parent.type === "AssignmentPattern") { + if (node.parent.right.type === "Identifier") { + objectName = node.parent.right.name; + } + } + + node.properties.forEach(property => { + checkPropertyAccess(node, objectName, astUtils.getStaticPropertyName(property)); + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-syntax.js b/node_modules/eslint/lib/rules/no-restricted-syntax.js new file mode 100644 index 0000000..930882c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-syntax.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Rule to flag use of certain node types + * @author Burak Yigit Kaya + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow specified syntax", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-restricted-syntax" + }, + + schema: { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + selector: { type: "string" }, + message: { type: "string" } + }, + required: ["selector"], + additionalProperties: false + } + ] + }, + uniqueItems: true, + minItems: 0 + }, + + messages: { + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + restrictedSyntax: "{{message}}" + } + }, + + create(context) { + return context.options.reduce((result, selectorOrObject) => { + const isStringFormat = (typeof selectorOrObject === "string"); + const hasCustomMessage = !isStringFormat && Boolean(selectorOrObject.message); + + const selector = isStringFormat ? selectorOrObject : selectorOrObject.selector; + const message = hasCustomMessage ? selectorOrObject.message : `Using '${selector}' is not allowed.`; + + return Object.assign(result, { + [selector](node) { + context.report({ + node, + messageId: "restrictedSyntax", + data: { message } + }); + } + }); + }, {}); + + } +}; diff --git a/node_modules/eslint/lib/rules/no-return-assign.js b/node_modules/eslint/lib/rules/no-return-assign.js new file mode 100644 index 0000000..7c1f00e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-return-assign.js @@ -0,0 +1,82 @@ +/** + * @fileoverview Rule to flag when return statement contains assignment + * @author Ilya Volodin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_TYPE = /^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionExpression|ClassExpression)$/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["except-parens"], + + docs: { + description: "Disallow assignment operators in `return` statements", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-return-assign" + }, + + schema: [ + { + enum: ["except-parens", "always"] + } + ], + + messages: { + returnAssignment: "Return statement should not contain assignment.", + arrowAssignment: "Arrow function should not return assignment." + } + }, + + create(context) { + const always = context.options[0] !== "except-parens"; + const sourceCode = context.sourceCode; + + return { + AssignmentExpression(node) { + if (!always && astUtils.isParenthesised(sourceCode, node)) { + return; + } + + let currentChild = node; + let parent = currentChild.parent; + + // Find ReturnStatement or ArrowFunctionExpression in ancestors. + while (parent && !SENTINEL_TYPE.test(parent.type)) { + currentChild = parent; + parent = parent.parent; + } + + // Reports. + if (parent && parent.type === "ReturnStatement") { + context.report({ + node: parent, + messageId: "returnAssignment" + }); + } else if (parent && parent.type === "ArrowFunctionExpression" && parent.body === currentChild) { + context.report({ + node: parent, + messageId: "arrowAssignment" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-return-await.js b/node_modules/eslint/lib/rules/no-return-await.js new file mode 100644 index 0000000..e51ee9f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-return-await.js @@ -0,0 +1,139 @@ +/** + * @fileoverview Disallows unnecessary `return await` + * @author Jordan Harband + * @deprecated in ESLint v8.46.0 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + hasSuggestions: true, + type: "suggestion", + + docs: { + description: "Disallow unnecessary `return await`", + + recommended: false, + + url: "https://eslint.org/docs/latest/rules/no-return-await" + }, + + fixable: null, + + deprecated: { + message: "The original assumption of the rule no longer holds true because of engine optimization.", + url: "https://eslint.org/docs/latest/rules/no-return-await", + deprecatedSince: "8.46.0", + availableUntil: null, + replacedBy: [] + }, + + schema: [ + ], + + messages: { + removeAwait: "Remove redundant `await`.", + redundantUseOfAwait: "Redundant use of `await` on a return value." + } + }, + + create(context) { + + /** + * Reports a found unnecessary `await` expression. + * @param {ASTNode} node The node representing the `await` expression to report + * @returns {void} + */ + function reportUnnecessaryAwait(node) { + context.report({ + node: context.sourceCode.getFirstToken(node), + loc: node.loc, + messageId: "redundantUseOfAwait", + suggest: [ + { + messageId: "removeAwait", + fix(fixer) { + const sourceCode = context.sourceCode; + const [awaitToken, tokenAfterAwait] = sourceCode.getFirstTokens(node, 2); + + const areAwaitAndAwaitedExpressionOnTheSameLine = awaitToken.loc.start.line === tokenAfterAwait.loc.start.line; + + if (!areAwaitAndAwaitedExpressionOnTheSameLine) { + return null; + } + + const [startOfAwait, endOfAwait] = awaitToken.range; + + const characterAfterAwait = sourceCode.text[endOfAwait]; + const trimLength = characterAfterAwait === " " ? 1 : 0; + + const range = [startOfAwait, endOfAwait + trimLength]; + + return fixer.removeRange(range); + } + } + ] + + }); + } + + /** + * Determines whether a thrown error from this node will be caught/handled within this function rather than immediately halting + * this function. For example, a statement in a `try` block will always have an error handler. A statement in + * a `catch` block will only have an error handler if there is also a `finally` block. + * @param {ASTNode} node A node representing a location where an could be thrown + * @returns {boolean} `true` if a thrown error will be caught/handled in this function + */ + function hasErrorHandler(node) { + let ancestor = node; + + while (!astUtils.isFunction(ancestor) && ancestor.type !== "Program") { + if (ancestor.parent.type === "TryStatement" && (ancestor === ancestor.parent.block || ancestor === ancestor.parent.handler && ancestor.parent.finalizer)) { + return true; + } + ancestor = ancestor.parent; + } + return false; + } + + /** + * Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression, + * an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position. + * @param {ASTNode} node A node representing the `await` expression to check + * @returns {boolean} The checking result + */ + function isInTailCallPosition(node) { + if (node.parent.type === "ArrowFunctionExpression") { + return true; + } + if (node.parent.type === "ReturnStatement") { + return !hasErrorHandler(node.parent); + } + if (node.parent.type === "ConditionalExpression" && (node === node.parent.consequent || node === node.parent.alternate)) { + return isInTailCallPosition(node.parent); + } + if (node.parent.type === "LogicalExpression" && node === node.parent.right) { + return isInTailCallPosition(node.parent); + } + if (node.parent.type === "SequenceExpression" && node === node.parent.expressions.at(-1)) { + return isInTailCallPosition(node.parent); + } + return false; + } + + return { + AwaitExpression(node) { + if (isInTailCallPosition(node) && !hasErrorHandler(node)) { + reportUnnecessaryAwait(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-script-url.js b/node_modules/eslint/lib/rules/no-script-url.js new file mode 100644 index 0000000..607c768 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-script-url.js @@ -0,0 +1,61 @@ +/** + * @fileoverview Rule to disallow `javascript:` URLs + * @author Ilya Volodin + */ +/* eslint no-script-url: 0 -- Code is checking to report such URLs */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `javascript:` URLs", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-script-url" + }, + + schema: [], + + messages: { + unexpectedScriptURL: "Script URL is a form of eval." + } + }, + + create(context) { + + /** + * Check whether a node's static value starts with `javascript:` or not. + * And report an error for unexpected script URL. + * @param {ASTNode} node node to check + * @returns {void} + */ + function check(node) { + const value = astUtils.getStaticStringValue(node); + + if (typeof value === "string" && value.toLowerCase().indexOf("javascript:") === 0) { + context.report({ node, messageId: "unexpectedScriptURL" }); + } + } + return { + Literal(node) { + if (node.value && typeof node.value === "string") { + check(node); + } + }, + TemplateLiteral(node) { + if (!(node.parent && node.parent.type === "TaggedTemplateExpression")) { + check(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-self-assign.js b/node_modules/eslint/lib/rules/no-self-assign.js new file mode 100644 index 0000000..91b928e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-self-assign.js @@ -0,0 +1,184 @@ +/** + * @fileoverview Rule to disallow assignments where both sides are exactly the same + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SPACES = /\s+/gu; + +/** + * Traverses 2 Pattern nodes in parallel, then reports self-assignments. + * @param {ASTNode|null} left A left node to traverse. This is a Pattern or + * a Property. + * @param {ASTNode|null} right A right node to traverse. This is a Pattern or + * a Property. + * @param {boolean} props The flag to check member expressions as well. + * @param {Function} report A callback function to report. + * @returns {void} + */ +function eachSelfAssignment(left, right, props, report) { + if (!left || !right) { + + // do nothing + } else if ( + left.type === "Identifier" && + right.type === "Identifier" && + left.name === right.name + ) { + report(right); + } else if ( + left.type === "ArrayPattern" && + right.type === "ArrayExpression" + ) { + const end = Math.min(left.elements.length, right.elements.length); + + for (let i = 0; i < end; ++i) { + const leftElement = left.elements[i]; + const rightElement = right.elements[i]; + + // Avoid cases such as [...a] = [...a, 1] + if ( + leftElement && + leftElement.type === "RestElement" && + i < right.elements.length - 1 + ) { + break; + } + + eachSelfAssignment(leftElement, rightElement, props, report); + + // After a spread element, those indices are unknown. + if (rightElement && rightElement.type === "SpreadElement") { + break; + } + } + } else if ( + left.type === "RestElement" && + right.type === "SpreadElement" + ) { + eachSelfAssignment(left.argument, right.argument, props, report); + } else if ( + left.type === "ObjectPattern" && + right.type === "ObjectExpression" && + right.properties.length >= 1 + ) { + + /* + * Gets the index of the last spread property. + * It's possible to overwrite properties followed by it. + */ + let startJ = 0; + + for (let i = right.properties.length - 1; i >= 0; --i) { + const propType = right.properties[i].type; + + if (propType === "SpreadElement" || propType === "ExperimentalSpreadProperty") { + startJ = i + 1; + break; + } + } + + for (let i = 0; i < left.properties.length; ++i) { + for (let j = startJ; j < right.properties.length; ++j) { + eachSelfAssignment( + left.properties[i], + right.properties[j], + props, + report + ); + } + } + } else if ( + left.type === "Property" && + right.type === "Property" && + right.kind === "init" && + !right.method + ) { + const leftName = astUtils.getStaticPropertyName(left); + + if (leftName !== null && leftName === astUtils.getStaticPropertyName(right)) { + eachSelfAssignment(left.value, right.value, props, report); + } + } else if ( + props && + astUtils.skipChainExpression(left).type === "MemberExpression" && + astUtils.skipChainExpression(right).type === "MemberExpression" && + astUtils.isSameReference(left, right) + ) { + report(right); + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ props: true }], + + docs: { + description: "Disallow assignments where both sides are exactly the same", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-self-assign" + }, + + schema: [ + { + type: "object", + properties: { + props: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + selfAssignment: "'{{name}}' is assigned to itself." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const [{ props }] = context.options; + + /** + * Reports a given node as self assignments. + * @param {ASTNode} node A node to report. This is an Identifier node. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "selfAssignment", + data: { + name: sourceCode.getText(node).replace(SPACES, "") + } + }); + } + + return { + AssignmentExpression(node) { + if (["=", "&&=", "||=", "??="].includes(node.operator)) { + eachSelfAssignment(node.left, node.right, props, report); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-self-compare.js b/node_modules/eslint/lib/rules/no-self-compare.js new file mode 100644 index 0000000..3b076eb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-self-compare.js @@ -0,0 +1,60 @@ +/** + * @fileoverview Rule to flag comparison where left part is the same as the right + * part. + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow comparisons where both sides are exactly the same", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-self-compare" + }, + + schema: [], + + messages: { + comparingToSelf: "Comparing to itself is potentially pointless." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Determines whether two nodes are composed of the same tokens. + * @param {ASTNode} nodeA The first node + * @param {ASTNode} nodeB The second node + * @returns {boolean} true if the nodes have identical token representations + */ + function hasSameTokens(nodeA, nodeB) { + const tokensA = sourceCode.getTokens(nodeA); + const tokensB = sourceCode.getTokens(nodeB); + + return tokensA.length === tokensB.length && + tokensA.every((token, index) => token.type === tokensB[index].type && token.value === tokensB[index].value); + } + + return { + + BinaryExpression(node) { + const operators = new Set(["===", "==", "!==", "!=", ">", "<", ">=", "<="]); + + if (operators.has(node.operator) && hasSameTokens(node.left, node.right)) { + context.report({ node, messageId: "comparingToSelf" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sequences.js b/node_modules/eslint/lib/rules/no-sequences.js new file mode 100644 index 0000000..5843b7a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sequences.js @@ -0,0 +1,139 @@ +/** + * @fileoverview Rule to flag use of comma operator + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow comma operators", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-sequences" + }, + + schema: [{ + type: "object", + properties: { + allowInParentheses: { + type: "boolean" + } + }, + additionalProperties: false + }], + + defaultOptions: [{ + allowInParentheses: true + }], + + messages: { + unexpectedCommaExpression: "Unexpected use of comma operator." + } + }, + + create(context) { + const [{ allowInParentheses }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Parts of the grammar that are required to have parens. + */ + const parenthesized = { + DoWhileStatement: "test", + IfStatement: "test", + SwitchStatement: "discriminant", + WhileStatement: "test", + WithStatement: "object", + ArrowFunctionExpression: "body" + + /* + * Omitting CallExpression - commas are parsed as argument separators + * Omitting NewExpression - commas are parsed as argument separators + * Omitting ForInStatement - parts aren't individually parenthesised + * Omitting ForStatement - parts aren't individually parenthesised + */ + }; + + /** + * Determines whether a node is required by the grammar to be wrapped in + * parens, e.g. the test of an if statement. + * @param {ASTNode} node The AST node + * @returns {boolean} True if parens around node belong to parent node. + */ + function requiresExtraParens(node) { + return node.parent && parenthesized[node.parent.type] && + node === node.parent[parenthesized[node.parent.type]]; + } + + /** + * Check if a node is wrapped in parens. + * @param {ASTNode} node The AST node + * @returns {boolean} True if the node has a paren on each side. + */ + function isParenthesised(node) { + return astUtils.isParenthesised(sourceCode, node); + } + + /** + * Check if a node is wrapped in two levels of parens. + * @param {ASTNode} node The AST node + * @returns {boolean} True if two parens surround the node on each side. + */ + function isParenthesisedTwice(node) { + const previousToken = sourceCode.getTokenBefore(node, 1), + nextToken = sourceCode.getTokenAfter(node, 1); + + return isParenthesised(node) && previousToken && nextToken && + astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && + astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + } + + return { + SequenceExpression(node) { + + // Always allow sequences in for statement update + if (node.parent.type === "ForStatement" && + (node === node.parent.init || node === node.parent.update)) { + return; + } + + // Wrapping a sequence in extra parens indicates intent + if (allowInParentheses) { + if (requiresExtraParens(node)) { + if (isParenthesisedTwice(node)) { + return; + } + } else { + if (isParenthesised(node)) { + return; + } + } + } + + const firstCommaToken = sourceCode.getTokenAfter(node.expressions[0], astUtils.isCommaToken); + + context.report({ node, loc: firstCommaToken.loc, messageId: "unexpectedCommaExpression" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-setter-return.js b/node_modules/eslint/lib/rules/no-setter-return.js new file mode 100644 index 0000000..a5abaaa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-setter-return.js @@ -0,0 +1,226 @@ +/** + * @fileoverview Rule to disallow returning values from setters + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { findVariable } = require("@eslint-community/eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ +function isGlobalReference(node, scope) { + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; +} + +/** + * Determines whether the given node is an argument of the specified global method call, at the given `index` position. + * E.g., for given `index === 1`, this function checks for `objectName.methodName(foo, node)`, where objectName is a global variable. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @param {string} objectName Name of the global object. + * @param {string} methodName Name of the method. + * @param {number} index The given position. + * @returns {boolean} `true` if the node is argument at the given position. + */ +function isArgumentOfGlobalMethodCall(node, scope, objectName, methodName, index) { + const callNode = node.parent; + + return callNode.type === "CallExpression" && + callNode.arguments[index] === node && + astUtils.isSpecificMemberAccess(callNode.callee, objectName, methodName) && + isGlobalReference(astUtils.skipChainExpression(callNode.callee).object, scope); +} + +/** + * Determines whether the given node is used as a property descriptor. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node, scope) { + if ( + isArgumentOfGlobalMethodCall(node, scope, "Object", "defineProperty", 2) || + isArgumentOfGlobalMethodCall(node, scope, "Reflect", "defineProperty", 2) + ) { + return true; + } + + const parent = node.parent; + + if ( + parent.type === "Property" && + parent.value === node + ) { + const grandparent = parent.parent; + + if ( + grandparent.type === "ObjectExpression" && + ( + isArgumentOfGlobalMethodCall(grandparent, scope, "Object", "create", 1) || + isArgumentOfGlobalMethodCall(grandparent, scope, "Object", "defineProperties", 1) + ) + ) { + return true; + } + } + + return false; +} + +/** + * Determines whether the given function node is used as a setter function. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} `true` if the node is a setter. + */ +function isSetter(node, scope) { + const parent = node.parent; + + if ( + (parent.type === "Property" || parent.type === "MethodDefinition") && + parent.kind === "set" && + parent.value === node + ) { + + // Setter in an object literal or in a class + return true; + } + + if ( + parent.type === "Property" && + parent.value === node && + astUtils.getStaticPropertyName(parent) === "set" && + parent.parent.type === "ObjectExpression" && + isPropertyDescriptor(parent.parent, scope) + ) { + + // Setter in a property descriptor + return true; + } + + return false; +} + +/** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ +function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + + return upper; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow returning values from setters", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-setter-return" + }, + + schema: [], + + messages: { + returnsValue: "Setter cannot return a value." + } + }, + + create(context) { + let funcInfo = null; + const sourceCode = context.sourceCode; + + /** + * Creates and pushes to the stack a function info object for the given function node. + * @param {ASTNode} node The function node. + * @returns {void} + */ + function enterFunction(node) { + const outerScope = getOuterScope(sourceCode.getScope(node)); + + funcInfo = { + upper: funcInfo, + isSetter: isSetter(node, outerScope) + }; + } + + /** + * Pops the current function info object from the stack. + * @returns {void} + */ + function exitFunction() { + funcInfo = funcInfo.upper; + } + + /** + * Reports the given node. + * @param {ASTNode} node Node to report. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "returnsValue" }); + } + + return { + + /* + * Function declarations cannot be setters, but we still have to track them in the `funcInfo` stack to avoid + * false positives, because a ReturnStatement node can belong to a function declaration inside a setter. + * + * Note: A previously declared function can be referenced and actually used as a setter in a property descriptor, + * but that's out of scope for this rule. + */ + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression(node) { + enterFunction(node); + + if (funcInfo.isSetter && node.expression) { + + // { set: foo => bar } property descriptor. Report implicit return 'bar' as the equivalent for a return statement. + report(node.body); + } + }, + + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + "ArrowFunctionExpression:exit": exitFunction, + + ReturnStatement(node) { + + // Global returns (e.g., at the top level of a Node module) don't have `funcInfo`. + if (funcInfo && funcInfo.isSetter && node.argument) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-shadow-restricted-names.js b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js new file mode 100644 index 0000000..cdf96ce --- /dev/null +++ b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js @@ -0,0 +1,75 @@ +/** + * @fileoverview Disallow shadowing of NaN, undefined, and Infinity (ES5 section 15.1.1) + * @author Michael Ficarra + */ +"use strict"; + +/** + * Determines if a variable safely shadows undefined. + * This is the case when a variable named `undefined` is never assigned to a value (i.e. it always shares the same value + * as the global). + * @param {eslintScope.Variable} variable The variable to check + * @returns {boolean} true if this variable safely shadows `undefined` + */ +function safelyShadowsUndefined(variable) { + return variable.name === "undefined" && + variable.references.every(ref => !ref.isWrite()) && + variable.defs.every(def => def.node.type === "VariableDeclarator" && def.node.init === null); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow identifiers from shadowing restricted names", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-shadow-restricted-names" + }, + + schema: [], + + messages: { + shadowingRestrictedName: "Shadowing of global property '{{name}}'." + } + }, + + create(context) { + + + const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]); + const sourceCode = context.sourceCode; + + // Track reported nodes to avoid duplicate reports. For example, on class declarations. + const reportedNodes = new Set(); + + return { + "VariableDeclaration, :function, CatchClause, ImportDeclaration, ClassDeclaration, ClassExpression"(node) { + for (const variable of sourceCode.getDeclaredVariables(node)) { + if (variable.defs.length > 0 && RESTRICTED.has(variable.name) && !safelyShadowsUndefined(variable)) { + for (const def of variable.defs) { + const nodeToReport = def.name; + + if (!reportedNodes.has(nodeToReport)) { + reportedNodes.add(nodeToReport); + context.report({ + node: nodeToReport, + messageId: "shadowingRestrictedName", + data: { + name: variable.name + } + }); + } + } + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-shadow.js b/node_modules/eslint/lib/rules/no-shadow.js new file mode 100644 index 0000000..67e9695 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-shadow.js @@ -0,0 +1,342 @@ +/** + * @fileoverview Rule to flag on declaring variables already declared in the outer scope + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const FUNC_EXPR_NODE_TYPES = new Set(["ArrowFunctionExpression", "FunctionExpression"]); +const CALL_EXPR_NODE_TYPE = new Set(["CallExpression"]); +const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u; +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allow: [], + builtinGlobals: false, + hoist: "functions", + ignoreOnInitialization: false + }], + + docs: { + description: "Disallow variable declarations from shadowing variables declared in the outer scope", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-shadow" + }, + + schema: [ + { + type: "object", + properties: { + builtinGlobals: { type: "boolean" }, + hoist: { enum: ["all", "functions", "never"] }, + allow: { + type: "array", + items: { + type: "string" + } + }, + ignoreOnInitialization: { type: "boolean" } + }, + additionalProperties: false + } + ], + + messages: { + noShadow: "'{{name}}' is already declared in the upper scope on line {{shadowedLine}} column {{shadowedColumn}}.", + noShadowGlobal: "'{{name}}' is already a global variable." + } + }, + + create(context) { + const [{ + builtinGlobals, + hoist, + allow, + ignoreOnInitialization + }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Checks whether or not a given location is inside of the range of a given node. + * @param {ASTNode} node An node to check. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of the range of the node. + */ + function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; + } + + /** + * Searches from the current node through its ancestry to find a matching node. + * @param {ASTNode} node a node to get. + * @param {(node: ASTNode) => boolean} match a callback that checks whether or not the node verifies its condition or not. + * @returns {ASTNode|null} the matching node. + */ + function findSelfOrAncestor(node, match) { + let currentNode = node; + + while (currentNode && !match(currentNode)) { + currentNode = currentNode.parent; + } + return currentNode; + } + + /** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ + function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + return upper; + } + + /** + * Checks if a variable and a shadowedVariable have the same init pattern ancestor. + * @param {Object} variable a variable to check. + * @param {Object} shadowedVariable a shadowedVariable to check. + * @returns {boolean} Whether or not the variable and the shadowedVariable have the same init pattern ancestor. + */ + function isInitPatternNode(variable, shadowedVariable) { + const outerDef = shadowedVariable.defs[0]; + + if (!outerDef) { + return false; + } + + const { variableScope } = variable.scope; + + + if (!(FUNC_EXPR_NODE_TYPES.has(variableScope.block.type) && getOuterScope(variableScope) === shadowedVariable.scope)) { + return false; + } + + const fun = variableScope.block; + const { parent } = fun; + + const callExpression = findSelfOrAncestor( + parent, + node => CALL_EXPR_NODE_TYPE.has(node.type) + ); + + if (!callExpression) { + return false; + } + + let node = outerDef.name; + const location = callExpression.range[1]; + + while (node) { + if (node.type === "VariableDeclarator") { + if (isInRange(node.init, location)) { + return true; + } + if (FOR_IN_OF_TYPE.test(node.parent.parent.type) && + isInRange(node.parent.parent.right, location) + ) { + return true; + } + break; + } else if (node.type === "AssignmentPattern") { + if (isInRange(node.right, location)) { + return true; + } + } else if (SENTINEL_TYPE.test(node.type)) { + break; + } + + node = node.parent; + } + + return false; + } + + /** + * Check if variable name is allowed. + * @param {ASTNode} variable The variable to check. + * @returns {boolean} Whether or not the variable name is allowed. + */ + function isAllowed(variable) { + return allow.includes(variable.name); + } + + /** + * Checks if a variable of the class name in the class scope of ClassDeclaration. + * + * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param {Object} variable The variable to check. + * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration. + */ + function isDuplicatedClassNameVariable(variable) { + const block = variable.scope.block; + + return block.type === "ClassDeclaration" && block.id === variable.identifiers[0]; + } + + /** + * Checks if a variable is inside the initializer of scopeVar. + * + * To avoid reporting at declarations such as `var a = function a() {};`. + * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. + * @param {Object} variable The variable to check. + * @param {Object} scopeVar The scope variable to look for. + * @returns {boolean} Whether or not the variable is inside initializer of scopeVar. + */ + function isOnInitializer(variable, scopeVar) { + const outerScope = scopeVar.scope; + const outerDef = scopeVar.defs[0]; + const outer = outerDef && outerDef.parent && outerDef.parent.range; + const innerScope = variable.scope; + const innerDef = variable.defs[0]; + const inner = innerDef && innerDef.name.range; + + return ( + outer && + inner && + outer[0] < inner[0] && + inner[1] < outer[1] && + ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") && + outerScope === innerScope.upper + ); + } + + /** + * Get a range of a variable's identifier node. + * @param {Object} variable The variable to get. + * @returns {Array|undefined} The range of the variable's identifier node. + */ + function getNameRange(variable) { + const def = variable.defs[0]; + + return def && def.name.range; + } + + /** + * Get declared line and column of a variable. + * @param {eslint-scope.Variable} variable The variable to get. + * @returns {Object} The declared line and column of the variable. + */ + function getDeclaredLocation(variable) { + const identifier = variable.identifiers[0]; + let obj; + + if (identifier) { + obj = { + global: false, + line: identifier.loc.start.line, + column: identifier.loc.start.column + 1 + }; + } else { + obj = { + global: true + }; + } + return obj; + } + + /** + * Checks if a variable is in TDZ of scopeVar. + * @param {Object} variable The variable to check. + * @param {Object} scopeVar The variable of TDZ. + * @returns {boolean} Whether or not the variable is in TDZ of scopeVar. + */ + function isInTdz(variable, scopeVar) { + const outerDef = scopeVar.defs[0]; + const inner = getNameRange(variable); + const outer = getNameRange(scopeVar); + + return ( + inner && + outer && + inner[1] < outer[0] && + + // Excepts FunctionDeclaration if is {"hoist":"function"}. + (hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration") + ); + } + + /** + * Checks the current context for shadowed variables. + * @param {Scope} scope Fixme + * @returns {void} + */ + function checkForShadows(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration. + if (variable.identifiers.length === 0 || + isDuplicatedClassNameVariable(variable) || + isAllowed(variable) + ) { + continue; + } + + // Gets shadowed variable. + const shadowed = astUtils.getVariableByName(scope.upper, variable.name); + + if (shadowed && + (shadowed.identifiers.length > 0 || (builtinGlobals && "writeable" in shadowed)) && + !isOnInitializer(variable, shadowed) && + !(ignoreOnInitialization && isInitPatternNode(variable, shadowed)) && + !(hoist !== "all" && isInTdz(variable, shadowed)) + ) { + const location = getDeclaredLocation(shadowed); + const messageId = location.global ? "noShadowGlobal" : "noShadow"; + const data = { name: variable.name }; + + if (!location.global) { + data.shadowedLine = location.line; + data.shadowedColumn = location.column; + } + context.report({ + node: variable.identifiers[0], + messageId, + data + }); + } + } + } + + return { + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + const stack = globalScope.childScopes.slice(); + + while (stack.length) { + const scope = stack.pop(); + + stack.push(...scope.childScopes); + checkForShadows(scope); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-spaced-func.js b/node_modules/eslint/lib/rules/no-spaced-func.js new file mode 100644 index 0000000..a210391 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-spaced-func.js @@ -0,0 +1,100 @@ +/** + * @fileoverview Rule to check that spaced function application + * @author Matt DuVall + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "Disallow spacing between function identifiers and their applications (deprecated)", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-spaced-func" + }, + + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules", + deprecatedSince: "3.3.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "function-call-spacing", + url: "https://eslint.style/rules/js/function-call-spacing" + } + } + ] + }, + + fixable: "whitespace", + schema: [], + + messages: { + noSpacedFunction: "Unexpected space between function name and paren." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function detectOpenSpaces(node) { + const lastCalleeToken = sourceCode.getLastToken(node.callee); + let prevToken = lastCalleeToken, + parenToken = sourceCode.getTokenAfter(lastCalleeToken); + + // advances to an open parenthesis. + while ( + parenToken && + parenToken.range[1] < node.range[1] && + parenToken.value !== "(" + ) { + prevToken = parenToken; + parenToken = sourceCode.getTokenAfter(parenToken); + } + + // look for a space between the callee and the open paren + if (parenToken && + parenToken.range[1] < node.range[1] && + sourceCode.isSpaceBetweenTokens(prevToken, parenToken) + ) { + context.report({ + node, + loc: lastCalleeToken.loc.start, + messageId: "noSpacedFunction", + fix(fixer) { + return fixer.removeRange([prevToken.range[1], parenToken.range[0]]); + } + }); + } + } + + return { + CallExpression: detectOpenSpaces, + NewExpression: detectOpenSpaces + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sparse-arrays.js b/node_modules/eslint/lib/rules/no-sparse-arrays.js new file mode 100644 index 0000000..6d24842 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sparse-arrays.js @@ -0,0 +1,73 @@ +/** + * @fileoverview Disallow sparse arrays + * @author Nicholas C. Zakas + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow sparse arrays", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-sparse-arrays" + }, + + schema: [], + + messages: { + unexpectedSparseArray: "Unexpected comma in middle of array." + } + }, + + create(context) { + + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + ArrayExpression(node) { + if (!node.elements.includes(null)) { + return; + } + + const { sourceCode } = context; + let commaToken; + + for (const [index, element] of node.elements.entries()) { + if (index === node.elements.length - 1 && element) { + return; + } + + commaToken = sourceCode.getTokenAfter( + element ?? commaToken ?? sourceCode.getFirstToken(node), + astUtils.isCommaToken + ); + + if (element) { + continue; + } + + context.report({ + node, + loc: commaToken.loc, + messageId: "unexpectedSparseArray" + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sync.js b/node_modules/eslint/lib/rules/no-sync.js new file mode 100644 index 0000000..b8f5c2c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sync.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to check for properties whose identifier ends with the string Sync + * @author Matt DuVall + * @deprecated in ESLint v7.0.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Node.js rules were moved out of ESLint core.", + url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules", + deprecatedSince: "7.0.0", + availableUntil: null, + replacedBy: [ + { + message: "eslint-plugin-n now maintains deprecated Node.js-related rules.", + plugin: { + name: "eslint-plugin-n", + url: "https://github.com/eslint-community/eslint-plugin-n" + }, + rule: { + name: "no-sync", + url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-sync.md" + } + } + ] + }, + + type: "suggestion", + + docs: { + description: "Disallow synchronous methods", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-sync" + }, + + schema: [ + { + type: "object", + properties: { + allowAtRootLevel: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + noSync: "Unexpected sync method: '{{propertyName}}'." + } + }, + + create(context) { + const selector = context.options[0] && context.options[0].allowAtRootLevel + ? ":function MemberExpression[property.name=/.*Sync$/]" + : "MemberExpression[property.name=/.*Sync$/]"; + + return { + [selector](node) { + context.report({ + node, + messageId: "noSync", + data: { + propertyName: node.property.name + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-tabs.js b/node_modules/eslint/lib/rules/no-tabs.js new file mode 100644 index 0000000..e38262f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-tabs.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Rule to check for tabs inside a file + * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const tabRegex = /\t+/gu; +const anyNonWhitespaceRegex = /\S/u; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-tabs", + url: "https://eslint.style/rules/js/no-tabs" + } + } + ] + }, + type: "layout", + + docs: { + description: "Disallow all tabs", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-tabs" + }, + schema: [{ + type: "object", + properties: { + allowIndentationTabs: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + unexpectedTab: "Unexpected tab character." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const allowIndentationTabs = context.options && context.options[0] && context.options[0].allowIndentationTabs; + + return { + Program(node) { + sourceCode.getLines().forEach((line, index) => { + let match; + + while ((match = tabRegex.exec(line)) !== null) { + if (allowIndentationTabs && !anyNonWhitespaceRegex.test(line.slice(0, match.index))) { + continue; + } + + context.report({ + node, + loc: { + start: { + line: index + 1, + column: match.index + }, + end: { + line: index + 1, + column: match.index + match[0].length + } + }, + messageId: "unexpectedTab" + }); + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-template-curly-in-string.js b/node_modules/eslint/lib/rules/no-template-curly-in-string.js new file mode 100644 index 0000000..92b4c1c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-template-curly-in-string.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Warn when using template string syntax in regular strings + * @author Jeroen Engels + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow template literal placeholder syntax in regular strings", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-template-curly-in-string" + }, + + schema: [], + + messages: { + unexpectedTemplateExpression: "Unexpected template string expression." + } + }, + + create(context) { + const regex = /\$\{[^}]+\}/u; + + return { + Literal(node) { + if (typeof node.value === "string" && regex.test(node.value)) { + context.report({ + node, + messageId: "unexpectedTemplateExpression" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-ternary.js b/node_modules/eslint/lib/rules/no-ternary.js new file mode 100644 index 0000000..26c00ff --- /dev/null +++ b/node_modules/eslint/lib/rules/no-ternary.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Rule to flag use of ternary operators. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow ternary operators", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-ternary" + }, + + schema: [], + + messages: { + noTernaryOperator: "Ternary operator used." + } + }, + + create(context) { + + return { + + ConditionalExpression(node) { + context.report({ node, messageId: "noTernaryOperator" }); + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-this-before-super.js b/node_modules/eslint/lib/rules/no-this-before-super.js new file mode 100644 index 0000000..01e355a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-this-before-super.js @@ -0,0 +1,363 @@ +/** + * @fileoverview A rule to disallow using `this`/`super` before `super()`. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + +/* + * Information for each code path segment. + * - superCalled: The flag which shows `super()` called in all code paths. + * - invalidNodes: The array of invalid ThisExpression and Super nodes. + */ +/** + * + */ +class SegmentInfo { + + /** + * Indicates whether `super()` is called in all code paths. + * @type {boolean} + */ + superCalled = false; + + /** + * The array of invalid ThisExpression and Super nodes. + * @type {ASTNode[]} + */ + invalidNodes = []; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow `this`/`super` before calling `super()` in constructors", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-this-before-super" + }, + + schema: [], + + messages: { + noBeforeSuper: "'{{kind}}' is not allowed before 'super()'." + } + }, + + create(context) { + + /* + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether the owner class has a valid + * `extends` part. + * - scope: The scope of the owner class. + * - codePath: The code path of this constructor. + */ + let funcInfo = null; + + /** @type {Record} */ + let segInfoMap = Object.create(null); + + /** + * Gets whether or not `super()` is called in a given code path segment. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} `true` if `super()` is called. + */ + function isCalled(segment) { + return !segment.reachable || segInfoMap[segment.id]?.superCalled; + } + + /** + * Checks whether or not this is in a constructor. + * @returns {boolean} `true` if this is in a constructor. + */ + function isInConstructorOfDerivedClass() { + return Boolean(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends); + } + + /** + * Determines if every segment in a set has been called. + * @param {Set} segments The segments to search. + * @returns {boolean} True if every segment has been called; false otherwise. + */ + function isEverySegmentCalled(segments) { + for (const segment of segments) { + if (!isCalled(segment)) { + return false; + } + } + + return true; + } + + /** + * Checks whether or not this is before `super()` is called. + * @returns {boolean} `true` if this is before `super()` is called. + */ + function isBeforeCallOfSuper() { + return ( + isInConstructorOfDerivedClass() && + !isEverySegmentCalled(funcInfo.currentSegments) + ); + } + + /** + * Sets a given node as invalid. + * @param {ASTNode} node A node to set as invalid. This is one of + * a ThisExpression and a Super. + * @returns {void} + */ + function setInvalid(node) { + const segments = funcInfo.currentSegments; + + for (const segment of segments) { + if (segment.reachable) { + segInfoMap[segment.id].invalidNodes.push(node); + } + } + } + + /** + * Sets the current segment as `super` was called. + * @returns {void} + */ + function setSuperCalled() { + const segments = funcInfo.currentSegments; + + for (const segment of segments) { + if (segment.reachable) { + segInfoMap[segment.id].superCalled = true; + } + } + } + + return { + + /** + * Adds information of a constructor into the stack. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathStart(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + const classNode = node.parent.parent.parent; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean( + classNode.superClass && + !astUtils.isNullOrUndefined(classNode.superClass) + ), + codePath, + currentSegments: new Set() + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + codePath, + currentSegments: new Set() + }; + } + }, + + /** + * Removes the top of stack item. + * + * And this traverses all segments of this code path then reports every + * invalid node. + * @param {CodePath} codePath A code path which was ended. + * @returns {void} + */ + onCodePathEnd(codePath) { + const isDerivedClass = funcInfo.hasExtends; + + funcInfo = funcInfo.upper; + if (!isDerivedClass) { + return; + } + + /** + * A collection of nodes to avoid duplicate reports. + * @type {Set} + */ + const reported = new Set(); + + codePath.traverseSegments((segment, controller) => { + const info = segInfoMap[segment.id]; + const invalidNodes = info.invalidNodes + .filter( + + /* + * Avoid duplicate reports. + * When there is a `finally`, invalidNodes may contain already reported node. + */ + node => !reported.has(node) + ); + + for (const invalidNode of invalidNodes) { + reported.add(invalidNode); + + context.report({ + messageId: "noBeforeSuper", + node: invalidNode, + data: { + kind: invalidNode.type === "Super" ? "super" : "this" + } + }); + } + + if (info.superCalled) { + controller.skip(); + } + }); + }, + + /** + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment A code path segment to initialize. + * @returns {void} + */ + onCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + + if (!isInConstructorOfDerivedClass()) { + return; + } + + // Initialize info. + segInfoMap[segment.id] = { + superCalled: ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ), + invalidNodes: [] + }; + }, + + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment A code path segment of the head + * of a loop. + * @returns {void} + */ + onCodePathSegmentLoop(fromSegment, toSegment) { + if (!isInConstructorOfDerivedClass()) { + return; + } + + // Update information inside of the loop. + funcInfo.codePath.traverseSegments( + { first: toSegment, last: fromSegment }, + (segment, controller) => { + const info = segInfoMap[segment.id] ?? new SegmentInfo(); + + if (info.superCalled) { + controller.skip(); + } else if ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ) { + info.superCalled = true; + } + + segInfoMap[segment.id] = info; + } + ); + }, + + /** + * Reports if this is before `super()`. + * @param {ASTNode} node A target node. + * @returns {void} + */ + ThisExpression(node) { + if (isBeforeCallOfSuper()) { + setInvalid(node); + } + }, + + /** + * Reports if this is before `super()`. + * @param {ASTNode} node A target node. + * @returns {void} + */ + Super(node) { + if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) { + setInvalid(node); + } + }, + + /** + * Marks `super()` called. + * @param {ASTNode} node A target node. + * @returns {void} + */ + "CallExpression:exit"(node) { + if (node.callee.type === "Super" && isBeforeCallOfSuper()) { + setSuperCalled(); + } + }, + + /** + * Resets state. + * @returns {void} + */ + "Program:exit"() { + segInfoMap = Object.create(null); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-throw-literal.js b/node_modules/eslint/lib/rules/no-throw-literal.js new file mode 100644 index 0000000..07a0df6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-throw-literal.js @@ -0,0 +1,51 @@ +/** + * @fileoverview Rule to restrict what can be thrown as an exception. + * @author Dieter Oberkofler + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow throwing literals as exceptions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-throw-literal" + }, + + schema: [], + + messages: { + object: "Expected an error object to be thrown.", + undef: "Do not throw undefined." + } + }, + + create(context) { + + return { + + ThrowStatement(node) { + if (!astUtils.couldBeError(node.argument)) { + context.report({ node, messageId: "object" }); + } else if (node.argument.type === "Identifier") { + if (node.argument.name === "undefined") { + context.report({ node, messageId: "undef" }); + } + } + + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-trailing-spaces.js b/node_modules/eslint/lib/rules/no-trailing-spaces.js new file mode 100644 index 0000000..7cdc310 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-trailing-spaces.js @@ -0,0 +1,210 @@ +/** + * @fileoverview Disallow trailing spaces at the end of lines. + * @author Nodeca Team + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-trailing-spaces", + url: "https://eslint.style/rules/js/no-trailing-spaces" + } + } + ] + }, + type: "layout", + + docs: { + description: "Disallow trailing whitespace at the end of lines", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-trailing-spaces" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + skipBlankLines: { + type: "boolean", + default: false + }, + ignoreComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + trailingSpace: "Trailing spaces not allowed." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + const BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u3000]", + SKIP_BLANK = `^${BLANK_CLASS}*$`, + NONBLANK = `${BLANK_CLASS}+$`; + + const options = context.options[0] || {}, + skipBlankLines = options.skipBlankLines || false, + ignoreComments = options.ignoreComments || false; + + /** + * Report the error message + * @param {ASTNode} node node to report + * @param {int[]} location range information + * @param {int[]} fixRange Range based on the whole program + * @returns {void} + */ + function report(node, location, fixRange) { + + /* + * Passing node is a bit dirty, because message data will contain big + * text in `source`. But... who cares :) ? + * One more kludge will not make worse the bloody wizardry of this + * plugin. + */ + context.report({ + node, + loc: location, + messageId: "trailingSpace", + fix(fixer) { + return fixer.removeRange(fixRange); + } + }); + } + + /** + * Given a list of comment nodes, return the line numbers for those comments. + * @param {Array} comments An array of comment nodes. + * @returns {number[]} An array of line numbers containing comments. + */ + function getCommentLineNumbers(comments) { + const lines = new Set(); + + comments.forEach(comment => { + const endLine = comment.type === "Block" + ? comment.loc.end.line - 1 + : comment.loc.end.line; + + for (let i = comment.loc.start.line; i <= endLine; i++) { + lines.add(i); + } + }); + + return lines; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program: function checkTrailingSpaces(node) { + + /* + * Let's hack. Since Espree does not return whitespace nodes, + * fetch the source code and do matching via regexps. + */ + + const re = new RegExp(NONBLANK, "u"), + skipMatch = new RegExp(SKIP_BLANK, "u"), + lines = sourceCode.lines, + linebreaks = sourceCode.getText().match(astUtils.createGlobalLinebreakMatcher()), + comments = sourceCode.getAllComments(), + commentLineNumbers = getCommentLineNumbers(comments); + + let totalLength = 0; + + for (let i = 0, ii = lines.length; i < ii; i++) { + const lineNumber = i + 1; + + /* + * Always add linebreak length to line length to accommodate for line break (\n or \r\n) + * Because during the fix time they also reserve one spot in the array. + * Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF) + */ + const linebreakLength = linebreaks && linebreaks[i] ? linebreaks[i].length : 1; + const lineLength = lines[i].length + linebreakLength; + + const matches = re.exec(lines[i]); + + if (matches) { + const location = { + start: { + line: lineNumber, + column: matches.index + }, + end: { + line: lineNumber, + column: lineLength - linebreakLength + } + }; + + const rangeStart = totalLength + location.start.column; + const rangeEnd = totalLength + location.end.column; + const containingNode = sourceCode.getNodeByRangeIndex(rangeStart); + + if (containingNode && containingNode.type === "TemplateElement" && + rangeStart > containingNode.parent.range[0] && + rangeEnd < containingNode.parent.range[1]) { + totalLength += lineLength; + continue; + } + + /* + * If the line has only whitespace, and skipBlankLines + * is true, don't report it + */ + if (skipBlankLines && skipMatch.test(lines[i])) { + totalLength += lineLength; + continue; + } + + const fixRange = [rangeStart, rangeEnd]; + + if (!ignoreComments || !commentLineNumbers.has(lineNumber)) { + report(node, location, fixRange); + } + } + + totalLength += lineLength; + } + } + + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-undef-init.js b/node_modules/eslint/lib/rules/no-undef-init.js new file mode 100644 index 0000000..e16793b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undef-init.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag when initializing to undefined + * @author Ilya Volodin + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow initializing variables to `undefined`", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-undef-init" + }, + + schema: [], + fixable: "code", + + messages: { + unnecessaryUndefinedInit: "It's not necessary to initialize '{{name}}' to undefined." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + return { + + VariableDeclarator(node) { + const name = sourceCode.getText(node.id), + init = node.init && node.init.name, + scope = sourceCode.getScope(node), + undefinedVar = astUtils.getVariableByName(scope, "undefined"), + shadowed = undefinedVar && undefinedVar.defs.length > 0, + lastToken = sourceCode.getLastToken(node); + + if (init === "undefined" && node.parent.kind !== "const" && !shadowed) { + context.report({ + node, + messageId: "unnecessaryUndefinedInit", + data: { name }, + fix(fixer) { + if (node.parent.kind === "var") { + return null; + } + + if (node.id.type === "ArrayPattern" || node.id.type === "ObjectPattern") { + + // Don't fix destructuring assignment to `undefined`. + return null; + } + + if (sourceCode.commentsExistBetween(node.id, lastToken)) { + return null; + } + + return fixer.removeRange([node.id.range[1], node.range[1]]); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-undef.js b/node_modules/eslint/lib/rules/no-undef.js new file mode 100644 index 0000000..b11a3d4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undef.js @@ -0,0 +1,81 @@ +/** + * @fileoverview Rule to flag references to undeclared variables. + * @author Mark Macdonald + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given node is the argument of a typeof operator. + * @param {ASTNode} node The AST node being checked. + * @returns {boolean} Whether or not the node is the argument of a typeof operator. + */ +function hasTypeOfOperator(node) { + const parent = node.parent; + + return parent.type === "UnaryExpression" && parent.operator === "typeof"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + typeof: false + }], + + docs: { + description: "Disallow the use of undeclared variables unless mentioned in `/*global */` comments", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-undef" + }, + + schema: [ + { + type: "object", + properties: { + typeof: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + undef: "'{{name}}' is not defined." + } + }, + + create(context) { + const [{ typeof: considerTypeOf }] = context.options; + const sourceCode = context.sourceCode; + + return { + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + + globalScope.through.forEach(ref => { + const identifier = ref.identifier; + + if (!considerTypeOf && hasTypeOfOperator(identifier)) { + return; + } + + context.report({ + node: identifier, + messageId: "undef", + data: identifier + }); + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-undefined.js b/node_modules/eslint/lib/rules/no-undefined.js new file mode 100644 index 0000000..4fa7699 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undefined.js @@ -0,0 +1,87 @@ +/** + * @fileoverview Rule to flag references to the undefined variable. + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow the use of `undefined` as an identifier", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-undefined" + }, + + schema: [], + + messages: { + unexpectedUndefined: "Unexpected use of undefined." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Report an invalid "undefined" identifier node. + * @param {ASTNode} node The node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "unexpectedUndefined" + }); + } + + /** + * Checks the given scope for references to `undefined` and reports + * all references found. + * @param {eslint-scope.Scope} scope The scope to check. + * @returns {void} + */ + function checkScope(scope) { + const undefinedVar = scope.set.get("undefined"); + + if (!undefinedVar) { + return; + } + + const references = undefinedVar.references; + + const defs = undefinedVar.defs; + + // Report non-initializing references (those are covered in defs below) + references + .filter(ref => !ref.init) + .forEach(ref => report(ref.identifier)); + + defs.forEach(def => report(def.name)); + } + + return { + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + + const stack = [globalScope]; + + while (stack.length) { + const scope = stack.pop(); + + stack.push(...scope.childScopes); + checkScope(scope); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-underscore-dangle.js b/node_modules/eslint/lib/rules/no-underscore-dangle.js new file mode 100644 index 0000000..702027d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-underscore-dangle.js @@ -0,0 +1,340 @@ +/** + * @fileoverview Rule to flag dangling underscores in variable declarations. + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allow: [], + allowAfterSuper: false, + allowAfterThis: false, + allowAfterThisConstructor: false, + allowFunctionParams: true, + allowInArrayDestructuring: true, + allowInObjectDestructuring: true, + enforceInClassFields: false, + enforceInMethodNames: false + }], + + docs: { + description: "Disallow dangling underscores in identifiers", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-underscore-dangle" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + type: "string" + } + }, + allowAfterThis: { + type: "boolean" + }, + allowAfterSuper: { + type: "boolean" + }, + allowAfterThisConstructor: { + type: "boolean" + }, + enforceInMethodNames: { + type: "boolean" + }, + allowFunctionParams: { + type: "boolean" + }, + enforceInClassFields: { + type: "boolean" + }, + allowInArrayDestructuring: { + type: "boolean" + }, + allowInObjectDestructuring: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedUnderscore: "Unexpected dangling '_' in '{{identifier}}'." + } + }, + + create(context) { + const [{ + allow, + allowAfterSuper, + allowAfterThis, + allowAfterThisConstructor, + allowFunctionParams, + allowInArrayDestructuring, + allowInObjectDestructuring, + enforceInClassFields, + enforceInMethodNames + }] = context.options; + const sourceCode = context.sourceCode; + + //------------------------------------------------------------------------- + // Helpers + //------------------------------------------------------------------------- + + /** + * Check if identifier is present inside the allowed option + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function isAllowed(identifier) { + return allow.includes(identifier); + } + + /** + * Check if identifier has a dangling underscore + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function hasDanglingUnderscore(identifier) { + const len = identifier.length; + + return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_"); + } + + /** + * Check if identifier is a special case member expression + * @param {string} identifier name of the node + * @returns {boolean} true if its is a special case + * @private + */ + function isSpecialCaseIdentifierForMemberExpression(identifier) { + return identifier === "__proto__"; + } + + /** + * Check if identifier is a special case variable expression + * @param {string} identifier name of the node + * @returns {boolean} true if its is a special case + * @private + */ + function isSpecialCaseIdentifierInVariableExpression(identifier) { + + // Checks for the underscore library usage here + return identifier === "_"; + } + + /** + * Check if a node is a member reference of this.constructor + * @param {ASTNode} node node to evaluate + * @returns {boolean} true if it is a reference on this.constructor + * @private + */ + function isThisConstructorReference(node) { + return node.object.type === "MemberExpression" && + node.object.property.name === "constructor" && + node.object.object.type === "ThisExpression"; + } + + /** + * Check if function parameter has a dangling underscore. + * @param {ASTNode} node function node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInFunctionParameters(node) { + if (!allowFunctionParams) { + node.params.forEach(param => { + const { type } = param; + let nodeToCheck; + + if (type === "RestElement") { + nodeToCheck = param.argument; + } else if (type === "AssignmentPattern") { + nodeToCheck = param.left; + } else { + nodeToCheck = param; + } + + if (nodeToCheck.type === "Identifier") { + const identifier = nodeToCheck.name; + + if (hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node: param, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + }); + } + } + + /** + * Check if function has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInFunction(node) { + if (node.type === "FunctionDeclaration" && node.id) { + const identifier = node.id.name; + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + checkForDanglingUnderscoreInFunctionParameters(node); + } + + + /** + * Check if variable expression has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInVariableExpression(node) { + sourceCode.getDeclaredVariables(node).forEach(variable => { + const definition = variable.defs.find(def => def.node === node); + const identifierNode = definition.name; + const identifier = identifierNode.name; + let parent = identifierNode.parent; + + while (!["VariableDeclarator", "ArrayPattern", "ObjectPattern"].includes(parent.type)) { + parent = parent.parent; + } + + if ( + hasDanglingUnderscore(identifier) && + !isSpecialCaseIdentifierInVariableExpression(identifier) && + !isAllowed(identifier) && + !(allowInArrayDestructuring && parent.type === "ArrayPattern") && + !(allowInObjectDestructuring && parent.type === "ObjectPattern") + ) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + }); + } + + /** + * Check if member expression has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInMemberExpression(node) { + const identifier = node.property.name, + isMemberOfThis = node.object.type === "ThisExpression", + isMemberOfSuper = node.object.type === "Super", + isMemberOfThisConstructor = isThisConstructorReference(node); + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && + !(isMemberOfThis && allowAfterThis) && + !(isMemberOfSuper && allowAfterSuper) && + !(isMemberOfThisConstructor && allowAfterThisConstructor) && + !isSpecialCaseIdentifierForMemberExpression(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + /** + * Check if method declaration or method property has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInMethod(node) { + const identifier = node.key.name; + const isMethod = node.type === "MethodDefinition" || node.type === "Property" && node.method; + + if (typeof identifier !== "undefined" && enforceInMethodNames && isMethod && hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier: node.key.type === "PrivateIdentifier" + ? `#${identifier}` + : identifier + } + }); + } + } + + /** + * Check if a class field has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInClassField(node) { + const identifier = node.key.name; + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && + enforceInClassFields && + !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier: node.key.type === "PrivateIdentifier" + ? `#${identifier}` + : identifier + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: checkForDanglingUnderscoreInFunction, + VariableDeclarator: checkForDanglingUnderscoreInVariableExpression, + MemberExpression: checkForDanglingUnderscoreInMemberExpression, + MethodDefinition: checkForDanglingUnderscoreInMethod, + PropertyDefinition: checkForDanglingUnderscoreInClassField, + Property: checkForDanglingUnderscoreInMethod, + FunctionExpression: checkForDanglingUnderscoreInFunction, + ArrowFunctionExpression: checkForDanglingUnderscoreInFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-unexpected-multiline.js b/node_modules/eslint/lib/rules/no-unexpected-multiline.js new file mode 100644 index 0000000..810c08b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unexpected-multiline.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not. + * @author Glen Mailer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow confusing multiline expressions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unexpected-multiline" + }, + + schema: [], + messages: { + function: "Unexpected newline between function and ( of function call.", + property: "Unexpected newline between object and [ of property access.", + taggedTemplate: "Unexpected newline between template tag and template literal.", + division: "Unexpected newline between numerator and division operator." + } + }, + + create(context) { + + const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u; + + const sourceCode = context.sourceCode; + + /** + * Check to see if there is a newline between the node and the following open bracket + * line's expression + * @param {ASTNode} node The node to check. + * @param {string} messageId The error messageId to use. + * @returns {void} + * @private + */ + function checkForBreakAfter(node, messageId) { + const openParen = sourceCode.getTokenAfter(node, astUtils.isNotClosingParenToken); + const nodeExpressionEnd = sourceCode.getTokenBefore(openParen); + + if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) { + context.report({ + node, + loc: openParen.loc, + messageId + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + MemberExpression(node) { + if (!node.computed || node.optional) { + return; + } + checkForBreakAfter(node.object, "property"); + }, + + TaggedTemplateExpression(node) { + const { quasi } = node; + + // handles common tags, parenthesized tags, and typescript's generic type arguments + const tokenBefore = sourceCode.getTokenBefore(quasi); + + if (tokenBefore.loc.end.line !== quasi.loc.start.line) { + context.report({ + node, + loc: { + start: quasi.loc.start, + end: { + line: quasi.loc.start.line, + column: quasi.loc.start.column + 1 + } + }, + messageId: "taggedTemplate" + }); + } + }, + + CallExpression(node) { + if (node.arguments.length === 0 || node.optional) { + return; + } + checkForBreakAfter(node.callee, "function"); + }, + + "BinaryExpression[operator='/'] > BinaryExpression[operator='/'].left"(node) { + const secondSlash = sourceCode.getTokenAfter(node, token => token.value === "/"); + const tokenAfterOperator = sourceCode.getTokenAfter(secondSlash); + + if ( + tokenAfterOperator.type === "Identifier" && + REGEX_FLAG_MATCHER.test(tokenAfterOperator.value) && + secondSlash.range[1] === tokenAfterOperator.range[0] + ) { + checkForBreakAfter(node.left, "division"); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js new file mode 100644 index 0000000..768a155 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js @@ -0,0 +1,360 @@ +/** + * @fileoverview Rule to disallow use of unmodified expressions in loop conditions + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Traverser = require("../shared/traverser"), + astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_PATTERN = /(?:(?:Call|Class|Function|Member|New|Yield)Expression|Statement|Declaration)$/u; +const LOOP_PATTERN = /^(?:DoWhile|For|While)Statement$/u; // for-in/of statements don't have `test` property. +const GROUP_PATTERN = /^(?:BinaryExpression|ConditionalExpression)$/u; +const SKIP_PATTERN = /^(?:ArrowFunction|Class|Function)Expression$/u; +const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u; + +/** + * @typedef {Object} LoopConditionInfo + * @property {eslint-scope.Reference} reference - The reference. + * @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes + * that the reference is belonging to. + * @property {Function} isInLoop - The predicate which checks a given reference + * is in this loop. + * @property {boolean} modified - The flag that the reference is modified in + * this loop. + */ + +/** + * Checks whether or not a given reference is a write reference. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is a write reference. + */ +function isWriteReference(reference) { + if (reference.init) { + const def = reference.resolved && reference.resolved.defs[0]; + + if (!def || def.type !== "Variable" || def.parent.kind !== "var") { + return false; + } + } + return reference.isWrite(); +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag. + * @param {LoopConditionInfo} condition A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodified(condition) { + return !condition.modified; +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag and does not have the group this condition belongs to. + * @param {LoopConditionInfo} condition A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodifiedAndNotBelongToGroup(condition) { + return !(condition.modified || condition.group); +} + +/** + * Checks whether or not a given reference is inside of a given node. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the node. + */ +function isInRange(node, reference) { + const or = node.range; + const ir = reference.identifier.range; + + return or[0] <= ir[0] && ir[1] <= or[1]; +} + +/** + * Checks whether or not a given reference is inside of a loop node's condition. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the loop node's + * condition. + */ +const isInLoop = { + WhileStatement: isInRange, + DoWhileStatement: isInRange, + ForStatement(node, reference) { + return ( + isInRange(node, reference) && + !(node.init && isInRange(node.init, reference)) + ); + } +}; + +/** + * Gets the function which encloses a given reference. + * This supports only FunctionDeclaration. + * @param {eslint-scope.Reference} reference A reference to get. + * @returns {ASTNode|null} The function node or null. + */ +function getEncloseFunctionDeclaration(reference) { + let node = reference.identifier; + + while (node) { + if (node.type === "FunctionDeclaration") { + return node.id ? node : null; + } + + node = node.parent; + } + + return null; +} + +/** + * Updates the "modified" flags of given loop conditions with given modifiers. + * @param {LoopConditionInfo[]} conditions The loop conditions to be updated. + * @param {eslint-scope.Reference[]} modifiers The references to update. + * @returns {void} + */ +function updateModifiedFlag(conditions, modifiers) { + + for (let i = 0; i < conditions.length; ++i) { + const condition = conditions[i]; + + for (let j = 0; !condition.modified && j < modifiers.length; ++j) { + const modifier = modifiers[j]; + let funcNode, funcVar; + + /* + * Besides checking for the condition being in the loop, we want to + * check the function that this modifier is belonging to is called + * in the loop. + * FIXME: This should probably be extracted to a function. + */ + const inLoop = condition.isInLoop(modifier) || Boolean( + (funcNode = getEncloseFunctionDeclaration(modifier)) && + (funcVar = astUtils.getVariableByName(modifier.from.upper, funcNode.id.name)) && + funcVar.references.some(condition.isInLoop) + ); + + condition.modified = inLoop; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow unmodified loop conditions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-unmodified-loop-condition" + }, + + schema: [], + + messages: { + loopConditionNotModified: "'{{name}}' is not modified in this loop." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + let groupMap = null; + + /** + * Reports a given condition info. + * @param {LoopConditionInfo} condition A loop condition info to report. + * @returns {void} + */ + function report(condition) { + const node = condition.reference.identifier; + + context.report({ + node, + messageId: "loopConditionNotModified", + data: node + }); + } + + /** + * Registers given conditions to the group the condition belongs to. + * @param {LoopConditionInfo[]} conditions A loop condition info to + * register. + * @returns {void} + */ + function registerConditionsToGroup(conditions) { + for (let i = 0; i < conditions.length; ++i) { + const condition = conditions[i]; + + if (condition.group) { + let group = groupMap.get(condition.group); + + if (!group) { + group = []; + groupMap.set(condition.group, group); + } + group.push(condition); + } + } + } + + /** + * Reports references which are inside of unmodified groups. + * @param {LoopConditionInfo[]} conditions A loop condition info to report. + * @returns {void} + */ + function checkConditionsInGroup(conditions) { + if (conditions.every(isUnmodified)) { + conditions.forEach(report); + } + } + + /** + * Checks whether or not a given group node has any dynamic elements. + * @param {ASTNode} root A node to check. + * This node is one of BinaryExpression or ConditionalExpression. + * @returns {boolean} `true` if the node is dynamic. + */ + function hasDynamicExpressions(root) { + let retv = false; + + Traverser.traverse(root, { + visitorKeys: sourceCode.visitorKeys, + enter(node) { + if (DYNAMIC_PATTERN.test(node.type)) { + retv = true; + this.break(); + } else if (SKIP_PATTERN.test(node.type)) { + this.skip(); + } + } + }); + + return retv; + } + + /** + * Creates the loop condition information from a given reference. + * @param {eslint-scope.Reference} reference A reference to create. + * @returns {LoopConditionInfo|null} Created loop condition info, or null. + */ + function toLoopCondition(reference) { + if (reference.init) { + return null; + } + + let group = null; + let child = reference.identifier; + let node = child.parent; + + while (node) { + if (SENTINEL_PATTERN.test(node.type)) { + if (LOOP_PATTERN.test(node.type) && node.test === child) { + + // This reference is inside of a loop condition. + return { + reference, + group, + isInLoop: isInLoop[node.type].bind(null, node), + modified: false + }; + } + + // This reference is outside of a loop condition. + break; + } + + /* + * If it's inside of a group, OK if either operand is modified. + * So stores the group this reference belongs to. + */ + if (GROUP_PATTERN.test(node.type)) { + + // If this expression is dynamic, no need to check. + if (hasDynamicExpressions(node)) { + break; + } else { + group = node; + } + } + + child = node; + node = node.parent; + } + + return null; + } + + /** + * Finds unmodified references which are inside of a loop condition. + * Then reports the references which are outside of groups. + * @param {eslint-scope.Variable} variable A variable to report. + * @returns {void} + */ + function checkReferences(variable) { + + // Gets references that exist in loop conditions. + const conditions = variable + .references + .map(toLoopCondition) + .filter(Boolean); + + if (conditions.length === 0) { + return; + } + + // Registers the conditions to belonging groups. + registerConditionsToGroup(conditions); + + // Check the conditions are modified. + const modifiers = variable.references.filter(isWriteReference); + + if (modifiers.length > 0) { + updateModifiedFlag(conditions, modifiers); + } + + /* + * Reports the conditions which are not belonging to groups. + * Others will be reported after all variables are done. + */ + conditions + .filter(isUnmodifiedAndNotBelongToGroup) + .forEach(report); + } + + return { + "Program:exit"(node) { + const queue = [sourceCode.getScope(node)]; + + groupMap = new Map(); + + let scope; + + while ((scope = queue.pop())) { + queue.push(...scope.childScopes); + scope.variables.forEach(checkReferences); + } + + groupMap.forEach(checkConditionsInGroup); + groupMap = null; + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/node_modules/eslint/lib/rules/no-unneeded-ternary.js new file mode 100644 index 0000000..c64c147 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unneeded-ternary.js @@ -0,0 +1,167 @@ +/** + * @fileoverview Rule to flag no-unneeded-ternary + * @author Gyandeep Singh + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +// Operators that always result in a boolean value +const BOOLEAN_OPERATORS = new Set(["==", "===", "!=", "!==", ">", ">=", "<", "<=", "in", "instanceof"]); +const OPERATOR_INVERSES = { + "==": "!=", + "!=": "==", + "===": "!==", + "!==": "===" + + // Operators like < and >= are not true inverses, since both will return false with NaN. +}; +const OR_PRECEDENCE = astUtils.getPrecedence({ type: "LogicalExpression", operator: "||" }); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ defaultAssignment: true }], + + docs: { + description: "Disallow ternary operators when simpler alternatives exist", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-unneeded-ternary" + }, + + schema: [ + { + type: "object", + properties: { + defaultAssignment: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + unnecessaryConditionalExpression: "Unnecessary use of boolean literals in conditional expression.", + unnecessaryConditionalAssignment: "Unnecessary use of conditional expression for default assignment." + } + }, + + create(context) { + const [{ defaultAssignment }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Test if the node is a boolean literal + * @param {ASTNode} node The node to report. + * @returns {boolean} True if the its a boolean literal + * @private + */ + function isBooleanLiteral(node) { + return node.type === "Literal" && typeof node.value === "boolean"; + } + + /** + * Creates an expression that represents the boolean inverse of the expression represented by the original node + * @param {ASTNode} node A node representing an expression + * @returns {string} A string representing an inverted expression + */ + function invertExpression(node) { + if (node.type === "BinaryExpression" && Object.hasOwn(OPERATOR_INVERSES, node.operator)) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + const text = sourceCode.getText(); + + return text.slice(node.range[0], + operatorToken.range[0]) + OPERATOR_INVERSES[node.operator] + text.slice(operatorToken.range[1], node.range[1]); + } + + if (astUtils.getPrecedence(node) < astUtils.getPrecedence({ type: "UnaryExpression" })) { + return `!(${astUtils.getParenthesisedText(sourceCode, node)})`; + } + return `!${astUtils.getParenthesisedText(sourceCode, node)}`; + } + + /** + * Tests if a given node always evaluates to a boolean value + * @param {ASTNode} node An expression node + * @returns {boolean} True if it is determined that the node will always evaluate to a boolean value + */ + function isBooleanExpression(node) { + return node.type === "BinaryExpression" && BOOLEAN_OPERATORS.has(node.operator) || + node.type === "UnaryExpression" && node.operator === "!"; + } + + /** + * Test if the node matches the pattern id ? id : expression + * @param {ASTNode} node The ConditionalExpression to check. + * @returns {boolean} True if the pattern is matched, and false otherwise + * @private + */ + function matchesDefaultAssignment(node) { + return node.test.type === "Identifier" && + node.consequent.type === "Identifier" && + node.test.name === node.consequent.name; + } + + return { + + ConditionalExpression(node) { + if (isBooleanLiteral(node.alternate) && isBooleanLiteral(node.consequent)) { + context.report({ + node, + messageId: "unnecessaryConditionalExpression", + fix(fixer) { + if (node.consequent.value === node.alternate.value) { + + // Replace `foo ? true : true` with just `true`, but don't replace `foo() ? true : true` + return node.test.type === "Identifier" ? fixer.replaceText(node, node.consequent.value.toString()) : null; + } + if (node.alternate.value) { + + // Replace `foo() ? false : true` with `!(foo())` + return fixer.replaceText(node, invertExpression(node.test)); + } + + // Replace `foo ? true : false` with `foo` if `foo` is guaranteed to be a boolean, or `!!foo` otherwise. + + return fixer.replaceText(node, isBooleanExpression(node.test) ? astUtils.getParenthesisedText(sourceCode, node.test) : `!${invertExpression(node.test)}`); + } + }); + } else if (!defaultAssignment && matchesDefaultAssignment(node)) { + context.report({ + node, + messageId: "unnecessaryConditionalAssignment", + fix(fixer) { + const shouldParenthesizeAlternate = + ( + astUtils.getPrecedence(node.alternate) < OR_PRECEDENCE || + astUtils.isCoalesceExpression(node.alternate) + ) && + !astUtils.isParenthesised(sourceCode, node.alternate); + const alternateText = shouldParenthesizeAlternate + ? `(${sourceCode.getText(node.alternate)})` + : astUtils.getParenthesisedText(sourceCode, node.alternate); + const testText = astUtils.getParenthesisedText(sourceCode, node.test); + + return fixer.replaceText(node, `${testText} || ${alternateText}`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unreachable-loop.js b/node_modules/eslint/lib/rules/no-unreachable-loop.js new file mode 100644 index 0000000..f5507ec --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unreachable-loop.js @@ -0,0 +1,187 @@ +/** + * @fileoverview Rule to disallow loops with a body that allows only one iteration + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const allLoopTypes = ["WhileStatement", "DoWhileStatement", "ForStatement", "ForInStatement", "ForOfStatement"]; + +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + +/** + * Determines whether the given node is the first node in the code path to which a loop statement + * 'loops' for the next iteration. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a looping target. + */ +function isLoopingTarget(node) { + const parent = node.parent; + + if (parent) { + switch (parent.type) { + case "WhileStatement": + return node === parent.test; + case "DoWhileStatement": + return node === parent.body; + case "ForStatement": + return node === (parent.update || parent.test || parent.body); + case "ForInStatement": + case "ForOfStatement": + return node === parent.left; + + // no default + } + } + + return false; +} + +/** + * Creates an array with elements from the first given array that are not included in the second given array. + * @param {Array} arrA The array to compare from. + * @param {Array} arrB The array to compare against. + * @returns {Array} a new array that represents `arrA \ arrB`. + */ +function getDifference(arrA, arrB) { + return arrA.filter(a => !arrB.includes(a)); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ ignore: [] }], + + docs: { + description: "Disallow loops with a body that allows only one iteration", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-unreachable-loop" + }, + + schema: [{ + type: "object", + properties: { + ignore: { + type: "array", + items: { + enum: allLoopTypes + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + invalid: "Invalid loop. Its body allows only one iteration." + } + }, + + create(context) { + const [{ ignore: ignoredLoopTypes }] = context.options; + const loopTypesToCheck = getDifference(allLoopTypes, ignoredLoopTypes), + loopSelector = loopTypesToCheck.join(","), + loopsByTargetSegments = new Map(), + loopsToReport = new Set(); + + const codePathSegments = []; + let currentCodePathSegments = new Set(); + + return { + + onCodePathStart() { + codePathSegments.push(currentCodePathSegments); + currentCodePathSegments = new Set(); + }, + + onCodePathEnd() { + currentCodePathSegments = codePathSegments.pop(); + }, + + onUnreachableCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentStart(segment, node) { + + currentCodePathSegments.add(segment); + + if (isLoopingTarget(node)) { + const loop = node.parent; + + loopsByTargetSegments.set(segment, loop); + } + }, + + onCodePathSegmentLoop(_, toSegment, node) { + const loop = loopsByTargetSegments.get(toSegment); + + /** + * The second iteration is reachable, meaning that the loop is valid by the logic of this rule, + * only if there is at least one loop event with the appropriate target (which has been already + * determined in the `loopsByTargetSegments` map), raised from either: + * + * - the end of the loop's body (in which case `node === loop`) + * - a `continue` statement + * + * This condition skips loop events raised from `ForInStatement > .right` and `ForOfStatement > .right` nodes. + */ + if (node === loop || node.type === "ContinueStatement") { + + // Removes loop if it exists in the set. Otherwise, `Set#delete` has no effect and doesn't throw. + loopsToReport.delete(loop); + } + }, + + [loopSelector](node) { + + /** + * Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise. + * For unreachable segments, the code path analysis does not raise events required for this implementation. + */ + if (isAnySegmentReachable(currentCodePathSegments)) { + loopsToReport.add(node); + } + }, + + + "Program:exit"() { + loopsToReport.forEach( + node => context.report({ node, messageId: "invalid" }) + ); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unreachable.js b/node_modules/eslint/lib/rules/no-unreachable.js new file mode 100644 index 0000000..0cf750e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unreachable.js @@ -0,0 +1,293 @@ +/** + * @fileoverview Checks for unreachable code due to return, throws, break, and continue. + * @author Joel Feenstra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * @typedef {Object} ConstructorInfo + * @property {ConstructorInfo | null} upper Info about the constructor that encloses this constructor. + * @property {boolean} hasSuperCall The flag about having `super()` expressions. + */ + +/** + * Checks whether or not a given variable declarator has the initializer. + * @param {ASTNode} node A VariableDeclarator node to check. + * @returns {boolean} `true` if the node has the initializer. + */ +function isInitialized(node) { + return Boolean(node.init); +} + +/** + * Checks all segments in a set and returns true if all are unreachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if all segments are unreachable; false otherwise. + */ +function areAllSegmentsUnreachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return false; + } + } + + return true; +} + +/** + * The class to distinguish consecutive unreachable statements. + */ +class ConsecutiveRange { + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.startNode = null; + this.endNode = null; + } + + /** + * The location object of this range. + * @type {Object} + */ + get location() { + return { + start: this.startNode.loc.start, + end: this.endNode.loc.end + }; + } + + /** + * `true` if this range is empty. + * @type {boolean} + */ + get isEmpty() { + return !(this.startNode && this.endNode); + } + + /** + * Checks whether the given node is inside of this range. + * @param {ASTNode|Token} node The node to check. + * @returns {boolean} `true` if the node is inside of this range. + */ + contains(node) { + return ( + node.range[0] >= this.startNode.range[0] && + node.range[1] <= this.endNode.range[1] + ); + } + + /** + * Checks whether the given node is consecutive to this range. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is consecutive to this range. + */ + isConsecutive(node) { + return this.contains(this.sourceCode.getTokenBefore(node)); + } + + /** + * Merges the given node to this range. + * @param {ASTNode} node The node to merge. + * @returns {void} + */ + merge(node) { + this.endNode = node; + } + + /** + * Resets this range by the given node or null. + * @param {ASTNode|null} node The node to reset, or null. + * @returns {void} + */ + reset(node) { + this.startNode = this.endNode = node; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unreachable" + }, + + schema: [], + + messages: { + unreachableCode: "Unreachable code." + } + }, + + create(context) { + + /** @type {ConstructorInfo | null} */ + let constructorInfo = null; + + /** @type {ConsecutiveRange} */ + const range = new ConsecutiveRange(context.sourceCode); + + /** @type {Array>} */ + const codePathSegments = []; + + /** @type {Set} */ + let currentCodePathSegments = new Set(); + + /** + * Reports a given node if it's unreachable. + * @param {ASTNode} node A statement node to report. + * @returns {void} + */ + function reportIfUnreachable(node) { + let nextNode = null; + + if (node && (node.type === "PropertyDefinition" || areAllSegmentsUnreachable(currentCodePathSegments))) { + + // Store this statement to distinguish consecutive statements. + if (range.isEmpty) { + range.reset(node); + return; + } + + // Skip if this statement is inside of the current range. + if (range.contains(node)) { + return; + } + + // Merge if this statement is consecutive to the current range. + if (range.isConsecutive(node)) { + range.merge(node); + return; + } + + nextNode = node; + } + + /* + * Report the current range since this statement is reachable or is + * not consecutive to the current range. + */ + if (!range.isEmpty) { + context.report({ + messageId: "unreachableCode", + loc: range.location, + node: range.startNode + }); + } + + // Update the current range. + range.reset(nextNode); + } + + return { + + // Manages the current code path. + onCodePathStart() { + codePathSegments.push(currentCodePathSegments); + currentCodePathSegments = new Set(); + }, + + onCodePathEnd() { + currentCodePathSegments = codePathSegments.pop(); + }, + + onUnreachableCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, + + // Registers for all statement nodes (excludes FunctionDeclaration). + BlockStatement: reportIfUnreachable, + BreakStatement: reportIfUnreachable, + ClassDeclaration: reportIfUnreachable, + ContinueStatement: reportIfUnreachable, + DebuggerStatement: reportIfUnreachable, + DoWhileStatement: reportIfUnreachable, + ExpressionStatement: reportIfUnreachable, + ForInStatement: reportIfUnreachable, + ForOfStatement: reportIfUnreachable, + ForStatement: reportIfUnreachable, + IfStatement: reportIfUnreachable, + ImportDeclaration: reportIfUnreachable, + LabeledStatement: reportIfUnreachable, + ReturnStatement: reportIfUnreachable, + SwitchStatement: reportIfUnreachable, + ThrowStatement: reportIfUnreachable, + TryStatement: reportIfUnreachable, + + VariableDeclaration(node) { + if (node.kind !== "var" || node.declarations.some(isInitialized)) { + reportIfUnreachable(node); + } + }, + + WhileStatement: reportIfUnreachable, + WithStatement: reportIfUnreachable, + ExportNamedDeclaration: reportIfUnreachable, + ExportDefaultDeclaration: reportIfUnreachable, + ExportAllDeclaration: reportIfUnreachable, + + "Program:exit"() { + reportIfUnreachable(); + }, + + /* + * Instance fields defined in a subclass are never created if the constructor of the subclass + * doesn't call `super()`, so their definitions are unreachable code. + */ + "MethodDefinition[kind='constructor']"() { + constructorInfo = { + upper: constructorInfo, + hasSuperCall: false + }; + }, + "MethodDefinition[kind='constructor']:exit"(node) { + const { hasSuperCall } = constructorInfo; + + constructorInfo = constructorInfo.upper; + + // skip typescript constructors without the body + if (!node.value.body) { + return; + } + + const classDefinition = node.parent.parent; + + if (classDefinition.superClass && !hasSuperCall) { + for (const element of classDefinition.body.body) { + if (element.type === "PropertyDefinition" && !element.static) { + reportIfUnreachable(element); + } + } + } + }, + "CallExpression > Super.callee"() { + if (constructorInfo) { + constructorInfo.hasSuperCall = true; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unsafe-finally.js b/node_modules/eslint/lib/rules/no-unsafe-finally.js new file mode 100644 index 0000000..ebd2432 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unsafe-finally.js @@ -0,0 +1,111 @@ +/** + * @fileoverview Rule to flag unsafe statements in finally block + * @author Onur Temizkan + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_NODE_TYPE_RETURN_THROW = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression)$/u; +const SENTINEL_NODE_TYPE_BREAK = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement|SwitchStatement)$/u; +const SENTINEL_NODE_TYPE_CONTINUE = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement)$/u; + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow control flow statements in `finally` blocks", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unsafe-finally" + }, + + schema: [], + + messages: { + unsafeUsage: "Unsafe usage of {{nodeType}}." + } + }, + create(context) { + + /** + * Checks if the node is the finalizer of a TryStatement + * @param {ASTNode} node node to check. + * @returns {boolean} - true if the node is the finalizer of a TryStatement + */ + function isFinallyBlock(node) { + return node.parent.type === "TryStatement" && node.parent.finalizer === node; + } + + /** + * Climbs up the tree if the node is not a sentinel node + * @param {ASTNode} node node to check. + * @param {string} label label of the break or continue statement + * @returns {boolean} - return whether the node is a finally block or a sentinel node + */ + function isInFinallyBlock(node, label) { + let labelInside = false; + let sentinelNodeType; + + if (node.type === "BreakStatement" && !node.label) { + sentinelNodeType = SENTINEL_NODE_TYPE_BREAK; + } else if (node.type === "ContinueStatement") { + sentinelNodeType = SENTINEL_NODE_TYPE_CONTINUE; + } else { + sentinelNodeType = SENTINEL_NODE_TYPE_RETURN_THROW; + } + + for ( + let currentNode = node; + currentNode && !sentinelNodeType.test(currentNode.type); + currentNode = currentNode.parent + ) { + if (currentNode.parent.label && label && (currentNode.parent.label.name === label.name)) { + labelInside = true; + } + if (isFinallyBlock(currentNode)) { + if (label && labelInside) { + return false; + } + return true; + } + } + return false; + } + + /** + * Checks whether the possibly-unsafe statement is inside a finally block. + * @param {ASTNode} node node to check. + * @returns {void} + */ + function check(node) { + if (isInFinallyBlock(node, node.label)) { + context.report({ + messageId: "unsafeUsage", + data: { + nodeType: node.type + }, + node, + line: node.loc.line, + column: node.loc.column + }); + } + } + + return { + ReturnStatement: check, + ThrowStatement: check, + BreakStatement: check, + ContinueStatement: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unsafe-negation.js b/node_modules/eslint/lib/rules/no-unsafe-negation.js new file mode 100644 index 0000000..10f4a53 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unsafe-negation.js @@ -0,0 +1,130 @@ +/** + * @fileoverview Rule to disallow negating the left operand of relational operators + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given operator is `in` or `instanceof` + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is `in` or `instanceof` + */ +function isInOrInstanceOfOperator(op) { + return op === "in" || op === "instanceof"; +} + +/** + * Checks whether the given operator is an ordering relational operator or not. + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is an ordering relational operator. + */ +function isOrderingRelationalOperator(op) { + return op === "<" || op === ">" || op === ">=" || op === "<="; +} + +/** + * Checks whether the given node is a logical negation expression or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a logical negation expression. + */ +function isNegation(node) { + return node.type === "UnaryExpression" && node.operator === "!"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + enforceForOrderingRelations: false + }], + + docs: { + description: "Disallow negating the left operand of relational operators", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unsafe-negation" + }, + + hasSuggestions: true, + + schema: [ + { + type: "object", + properties: { + enforceForOrderingRelations: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + fixable: null, + + messages: { + unexpected: "Unexpected negating the left operand of '{{operator}}' operator.", + suggestNegatedExpression: "Negate '{{operator}}' expression instead of its left operand. This changes the current behavior.", + suggestParenthesisedNegation: "Wrap negation in '()' to make the intention explicit. This preserves the current behavior." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const [{ enforceForOrderingRelations }] = context.options; + + return { + BinaryExpression(node) { + const operator = node.operator; + const orderingRelationRuleApplies = enforceForOrderingRelations && isOrderingRelationalOperator(operator); + + if ( + (isInOrInstanceOfOperator(operator) || orderingRelationRuleApplies) && + isNegation(node.left) && + !astUtils.isParenthesised(sourceCode, node.left) + ) { + context.report({ + node, + loc: node.left.loc, + messageId: "unexpected", + data: { operator }, + suggest: [ + { + messageId: "suggestNegatedExpression", + data: { operator }, + fix(fixer) { + const negationToken = sourceCode.getFirstToken(node.left); + const fixRange = [negationToken.range[1], node.range[1]]; + const text = sourceCode.text.slice(fixRange[0], fixRange[1]); + + return fixer.replaceTextRange(fixRange, `(${text})`); + } + }, + { + messageId: "suggestParenthesisedNegation", + fix(fixer) { + return fixer.replaceText(node.left, `(${sourceCode.getText(node.left)})`); + } + } + ] + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js b/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js new file mode 100644 index 0000000..c5d1f99 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js @@ -0,0 +1,207 @@ +/** + * @fileoverview Rule to disallow unsafe optional chaining + * @author Yeon JuAn + */ + +"use strict"; + +const UNSAFE_ARITHMETIC_OPERATORS = new Set(["+", "-", "/", "*", "%", "**"]); +const UNSAFE_ASSIGNMENT_OPERATORS = new Set(["+=", "-=", "/=", "*=", "%=", "**="]); +const UNSAFE_RELATIONAL_OPERATORS = new Set(["in", "instanceof"]); + +/** + * Checks whether a node is a destructuring pattern or not + * @param {ASTNode} node node to check + * @returns {boolean} `true` if a node is a destructuring pattern, otherwise `false` + */ +function isDestructuringPattern(node) { + return node.type === "ObjectPattern" || node.type === "ArrayPattern"; +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + disallowArithmeticOperators: false + }], + + docs: { + description: "Disallow use of optional chaining in contexts where the `undefined` value is not allowed", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining" + }, + schema: [{ + type: "object", + properties: { + disallowArithmeticOperators: { + type: "boolean" + } + }, + additionalProperties: false + }], + fixable: null, + messages: { + unsafeOptionalChain: "Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError.", + unsafeArithmetic: "Unsafe arithmetic operation on optional chaining. It can result in NaN." + } + }, + + create(context) { + const [{ disallowArithmeticOperators }] = context.options; + + /** + * Reports unsafe usage of optional chaining + * @param {ASTNode} node node to report + * @returns {void} + */ + function reportUnsafeUsage(node) { + context.report({ + messageId: "unsafeOptionalChain", + node + }); + } + + /** + * Reports unsafe arithmetic operation on optional chaining + * @param {ASTNode} node node to report + * @returns {void} + */ + function reportUnsafeArithmetic(node) { + context.report({ + messageId: "unsafeArithmetic", + node + }); + } + + /** + * Checks and reports if a node can short-circuit with `undefined` by optional chaining. + * @param {ASTNode} [node] node to check + * @param {Function} reportFunc report function + * @returns {void} + */ + function checkUndefinedShortCircuit(node, reportFunc) { + if (!node) { + return; + } + switch (node.type) { + case "LogicalExpression": + if (node.operator === "||" || node.operator === "??") { + checkUndefinedShortCircuit(node.right, reportFunc); + } else if (node.operator === "&&") { + checkUndefinedShortCircuit(node.left, reportFunc); + checkUndefinedShortCircuit(node.right, reportFunc); + } + break; + case "SequenceExpression": + checkUndefinedShortCircuit( + node.expressions.at(-1), + reportFunc + ); + break; + case "ConditionalExpression": + checkUndefinedShortCircuit(node.consequent, reportFunc); + checkUndefinedShortCircuit(node.alternate, reportFunc); + break; + case "AwaitExpression": + checkUndefinedShortCircuit(node.argument, reportFunc); + break; + case "ChainExpression": + reportFunc(node); + break; + default: + break; + } + } + + /** + * Checks unsafe usage of optional chaining + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkUnsafeUsage(node) { + checkUndefinedShortCircuit(node, reportUnsafeUsage); + } + + /** + * Checks unsafe arithmetic operations on optional chaining + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkUnsafeArithmetic(node) { + checkUndefinedShortCircuit(node, reportUnsafeArithmetic); + } + + return { + "AssignmentExpression, AssignmentPattern"(node) { + if (isDestructuringPattern(node.left)) { + checkUnsafeUsage(node.right); + } + }, + "ClassDeclaration, ClassExpression"(node) { + checkUnsafeUsage(node.superClass); + }, + CallExpression(node) { + if (!node.optional) { + checkUnsafeUsage(node.callee); + } + }, + NewExpression(node) { + checkUnsafeUsage(node.callee); + }, + VariableDeclarator(node) { + if (isDestructuringPattern(node.id)) { + checkUnsafeUsage(node.init); + } + }, + MemberExpression(node) { + if (!node.optional) { + checkUnsafeUsage(node.object); + } + }, + TaggedTemplateExpression(node) { + checkUnsafeUsage(node.tag); + }, + ForOfStatement(node) { + checkUnsafeUsage(node.right); + }, + SpreadElement(node) { + if (node.parent && node.parent.type !== "ObjectExpression") { + checkUnsafeUsage(node.argument); + } + }, + BinaryExpression(node) { + if (UNSAFE_RELATIONAL_OPERATORS.has(node.operator)) { + checkUnsafeUsage(node.right); + } + if ( + disallowArithmeticOperators && + UNSAFE_ARITHMETIC_OPERATORS.has(node.operator) + ) { + checkUnsafeArithmetic(node.right); + checkUnsafeArithmetic(node.left); + } + }, + WithStatement(node) { + checkUnsafeUsage(node.object); + }, + UnaryExpression(node) { + if ( + disallowArithmeticOperators && + UNSAFE_ARITHMETIC_OPERATORS.has(node.operator) + ) { + checkUnsafeArithmetic(node.argument); + } + }, + AssignmentExpression(node) { + if ( + disallowArithmeticOperators && + UNSAFE_ASSIGNMENT_OPERATORS.has(node.operator) + ) { + checkUnsafeArithmetic(node.right); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-expressions.js b/node_modules/eslint/lib/rules/no-unused-expressions.js new file mode 100644 index 0000000..fd1437c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-expressions.js @@ -0,0 +1,190 @@ +/** + * @fileoverview Flag expressions in statement position that do not side effect + * @author Michael Ficarra + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns `true`. + * @returns {boolean} `true`. + */ +function alwaysTrue() { + return true; +} + +/** + * Returns `false`. + * @returns {boolean} `false`. + */ +function alwaysFalse() { + return false; +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unused expressions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-unused-expressions" + }, + + schema: [ + { + type: "object", + properties: { + allowShortCircuit: { + type: "boolean" + }, + allowTernary: { + type: "boolean" + }, + allowTaggedTemplates: { + type: "boolean" + }, + enforceForJSX: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + defaultOptions: [{ + allowShortCircuit: false, + allowTernary: false, + allowTaggedTemplates: false, + enforceForJSX: false + }], + + messages: { + unusedExpression: "Expected an assignment or function call and instead saw an expression." + } + }, + + create(context) { + const [{ + allowShortCircuit, + allowTernary, + allowTaggedTemplates, + enforceForJSX + }] = context.options; + + /** + * Has AST suggesting a directive. + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === "ExpressionStatement" && + node.expression.type === "Literal" && typeof node.expression.value === "string"; + } + + /** + * Gets the leading sequence of members in a list that pass the predicate. + * @param {Function} predicate ([a] -> Boolean) the function used to make the determination + * @param {a[]} list the input list + * @returns {a[]} the leading sequence of members in the given list that pass the given predicate + */ + function takeWhile(predicate, list) { + for (let i = 0; i < list.length; ++i) { + if (!predicate(list[i])) { + return list.slice(0, i); + } + } + return list.slice(); + } + + /** + * Gets leading directives nodes in a Node body. + * @param {ASTNode} node a Program or BlockStatement node + * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body + */ + function directives(node) { + return takeWhile(looksLikeDirective, node.body); + } + + /** + * Detect if a Node is a directive. + * @param {ASTNode} node any node + * @returns {boolean} whether the given node is considered a directive in its current position + */ + function isDirective(node) { + + /** + * https://tc39.es/ecma262/#directive-prologue + * + * Only `FunctionBody`, `ScriptBody` and `ModuleBody` can have directive prologue. + * Class static blocks do not have directive prologue. + */ + return astUtils.isTopLevelExpressionStatement(node) && directives(node.parent).includes(node); + } + + /** + * The member functions return `true` if the type has no side-effects. + * Unknown nodes are handled as `false`, then this rule ignores those. + */ + const Checker = Object.assign(Object.create(null), { + isDisallowed(node) { + return (Checker[node.type] || alwaysFalse)(node); + }, + + ArrayExpression: alwaysTrue, + ArrowFunctionExpression: alwaysTrue, + BinaryExpression: alwaysTrue, + ChainExpression(node) { + return Checker.isDisallowed(node.expression); + }, + ClassExpression: alwaysTrue, + ConditionalExpression(node) { + if (allowTernary) { + return Checker.isDisallowed(node.consequent) || Checker.isDisallowed(node.alternate); + } + return true; + }, + FunctionExpression: alwaysTrue, + Identifier: alwaysTrue, + JSXElement() { + return enforceForJSX; + }, + JSXFragment() { + return enforceForJSX; + }, + Literal: alwaysTrue, + LogicalExpression(node) { + if (allowShortCircuit) { + return Checker.isDisallowed(node.right); + } + return true; + }, + MemberExpression: alwaysTrue, + MetaProperty: alwaysTrue, + ObjectExpression: alwaysTrue, + SequenceExpression: alwaysTrue, + TaggedTemplateExpression() { + return !allowTaggedTemplates; + }, + TemplateLiteral: alwaysTrue, + ThisExpression: alwaysTrue, + UnaryExpression(node) { + return node.operator !== "void" && node.operator !== "delete"; + } + }); + + return { + ExpressionStatement(node) { + if (Checker.isDisallowed(node.expression) && !isDirective(node)) { + context.report({ node, messageId: "unusedExpression" }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-labels.js b/node_modules/eslint/lib/rules/no-unused-labels.js new file mode 100644 index 0000000..be06b32 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-labels.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Rule to disallow unused labels. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unused labels", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unused-labels" + }, + + schema: [], + + fixable: "code", + + messages: { + unused: "'{{name}}:' is defined but never used." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + let scopeInfo = null; + + /** + * Adds a scope info to the stack. + * @param {ASTNode} node A node to add. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledScope(node) { + scopeInfo = { + label: node.label.name, + used: false, + upper: scopeInfo + }; + } + + /** + * Checks if a `LabeledStatement` node is fixable. + * For a node to be fixable, there must be no comments between the label and the body. + * Furthermore, is must be possible to remove the label without turning the body statement into a + * directive after other fixes are applied. + * @param {ASTNode} node The node to evaluate. + * @returns {boolean} Whether or not the node is fixable. + */ + function isFixable(node) { + + /* + * Only perform a fix if there are no comments between the label and the body. This will be the case + * when there is exactly one token/comment (the ":") between the label and the body. + */ + if (sourceCode.getTokenAfter(node.label, { includeComments: true }) !== + sourceCode.getTokenBefore(node.body, { includeComments: true })) { + return false; + } + + // Looking for the node's deepest ancestor which is not a `LabeledStatement`. + let ancestor = node.parent; + + while (ancestor.type === "LabeledStatement") { + ancestor = ancestor.parent; + } + + if (ancestor.type === "Program" || + (ancestor.type === "BlockStatement" && astUtils.isFunction(ancestor.parent))) { + const { body } = node; + + if (body.type === "ExpressionStatement" && + ((body.expression.type === "Literal" && typeof body.expression.value === "string") || + astUtils.isStaticTemplateLiteral(body.expression))) { + return false; // potential directive + } + } + return true; + } + + /** + * Removes the top of the stack. + * At the same time, this reports the label if it's never used. + * @param {ASTNode} node A node to report. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledScope(node) { + if (!scopeInfo.used) { + context.report({ + node: node.label, + messageId: "unused", + data: node.label, + fix: isFixable(node) ? fixer => fixer.removeRange([node.range[0], node.body.range[0]]) : null + }); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Marks the label of a given node as used. + * @param {ASTNode} node A node to mark. This is a BreakStatement or + * ContinueStatement. + * @returns {void} + */ + function markAsUsed(node) { + if (!node.label) { + return; + } + + const label = node.label.name; + let info = scopeInfo; + + while (info) { + if (info.label === label) { + info.used = true; + break; + } + info = info.upper; + } + } + + return { + LabeledStatement: enterLabeledScope, + "LabeledStatement:exit": exitLabeledScope, + BreakStatement: markAsUsed, + ContinueStatement: markAsUsed + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-private-class-members.js b/node_modules/eslint/lib/rules/no-unused-private-class-members.js new file mode 100644 index 0000000..bc05cd2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-private-class-members.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Rule to flag declared but unused private class members + * @author Tim van der Lippe + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow unused private class members", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unused-private-class-members" + }, + + schema: [], + + messages: { + unusedPrivateClassMember: "'{{classMemberName}}' is defined but never used." + } + }, + + create(context) { + const trackedClasses = []; + + /** + * Check whether the current node is in a write only assignment. + * @param {ASTNode} privateIdentifierNode Node referring to a private identifier + * @returns {boolean} Whether the node is in a write only assignment + * @private + */ + function isWriteOnlyAssignment(privateIdentifierNode) { + const parentStatement = privateIdentifierNode.parent.parent; + const isAssignmentExpression = parentStatement.type === "AssignmentExpression"; + + if (!isAssignmentExpression && + parentStatement.type !== "ForInStatement" && + parentStatement.type !== "ForOfStatement" && + parentStatement.type !== "AssignmentPattern") { + return false; + } + + // It is a write-only usage, since we still allow usages on the right for reads + if (parentStatement.left !== privateIdentifierNode.parent) { + return false; + } + + // For any other operator (such as '+=') we still consider it a read operation + if (isAssignmentExpression && parentStatement.operator !== "=") { + + /* + * However, if the read operation is "discarded" in an empty statement, then + * we consider it write only. + */ + return parentStatement.parent.type === "ExpressionStatement"; + } + + return true; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + // Collect all declared members up front and assume they are all unused + ClassBody(classBodyNode) { + const privateMembers = new Map(); + + trackedClasses.unshift(privateMembers); + for (const bodyMember of classBodyNode.body) { + if (bodyMember.type === "PropertyDefinition" || bodyMember.type === "MethodDefinition") { + if (bodyMember.key.type === "PrivateIdentifier") { + privateMembers.set(bodyMember.key.name, { + declaredNode: bodyMember, + isAccessor: bodyMember.type === "MethodDefinition" && + (bodyMember.kind === "set" || bodyMember.kind === "get") + }); + } + } + } + }, + + /* + * Process all usages of the private identifier and remove a member from + * `declaredAndUnusedPrivateMembers` if we deem it used. + */ + PrivateIdentifier(privateIdentifierNode) { + const classBody = trackedClasses.find(classProperties => classProperties.has(privateIdentifierNode.name)); + + // Can't happen, as it is a parser to have a missing class body, but let's code defensively here. + if (!classBody) { + return; + } + + // In case any other usage was already detected, we can short circuit the logic here. + const memberDefinition = classBody.get(privateIdentifierNode.name); + + if (memberDefinition.isUsed) { + return; + } + + // The definition of the class member itself + if (privateIdentifierNode.parent.type === "PropertyDefinition" || + privateIdentifierNode.parent.type === "MethodDefinition") { + return; + } + + /* + * Any usage of an accessor is considered a read, as the getter/setter can have + * side-effects in its definition. + */ + if (memberDefinition.isAccessor) { + memberDefinition.isUsed = true; + return; + } + + // Any assignments to this member, except for assignments that also read + if (isWriteOnlyAssignment(privateIdentifierNode)) { + return; + } + + const wrappingExpressionType = privateIdentifierNode.parent.parent.type; + const parentOfWrappingExpressionType = privateIdentifierNode.parent.parent.parent.type; + + // A statement which only increments (`this.#x++;`) + if (wrappingExpressionType === "UpdateExpression" && + parentOfWrappingExpressionType === "ExpressionStatement") { + return; + } + + /* + * ({ x: this.#usedInDestructuring } = bar); + * + * But should treat the following as a read: + * ({ [this.#x]: a } = foo); + */ + if (wrappingExpressionType === "Property" && + parentOfWrappingExpressionType === "ObjectPattern" && + privateIdentifierNode.parent.parent.value === privateIdentifierNode.parent) { + return; + } + + // [...this.#unusedInRestPattern] = bar; + if (wrappingExpressionType === "RestElement") { + return; + } + + // [this.#unusedInAssignmentPattern] = bar; + if (wrappingExpressionType === "ArrayPattern") { + return; + } + + /* + * We can't delete the memberDefinition, as we need to keep track of which member we are marking as used. + * In the case of nested classes, we only mark the first member we encounter as used. If you were to delete + * the member, then any subsequent usage could incorrectly mark the member of an encapsulating parent class + * as used, which is incorrect. + */ + memberDefinition.isUsed = true; + }, + + /* + * Post-process the class members and report any remaining members. + * Since private members can only be accessed in the current class context, + * we can safely assume that all usages are within the current class body. + */ + "ClassBody:exit"() { + const unusedPrivateMembers = trackedClasses.shift(); + + for (const [classMemberName, { declaredNode, isUsed }] of unusedPrivateMembers.entries()) { + if (isUsed) { + continue; + } + context.report({ + node: declaredNode, + loc: declaredNode.key.loc, + messageId: "unusedPrivateClassMember", + data: { + classMemberName: `#${classMemberName}` + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-vars.js b/node_modules/eslint/lib/rules/no-unused-vars.js new file mode 100644 index 0000000..5b7a8d0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-vars.js @@ -0,0 +1,1492 @@ +/** + * @fileoverview Rule to flag declared but unused variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * A simple name for the types of variables that this rule supports + * @typedef {'array-destructure'|'catch-clause'|'parameter'|'variable'} VariableType + */ + +/** + * Bag of data used for formatting the `unusedVar` lint message. + * @typedef {Object} UnusedVarMessageData + * @property {string} varName The name of the unused var. + * @property {'defined'|'assigned a value'} action Description of the vars state. + * @property {string} additional Any additional info to be appended at the end. + */ + +/** + * Bag of data used for formatting the `usedIgnoredVar` lint message. + * @typedef {Object} UsedIgnoredVarMessageData + * @property {string} varName The name of the unused var. + * @property {string} additional Any additional info to be appended at the end. + */ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow unused variables", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unused-vars" + }, + + hasSuggestions: true, + + schema: [ + { + oneOf: [ + { + enum: ["all", "local"] + }, + { + type: "object", + properties: { + vars: { + enum: ["all", "local"] + }, + varsIgnorePattern: { + type: "string" + }, + args: { + enum: ["all", "after-used", "none"] + }, + ignoreRestSiblings: { + type: "boolean" + }, + argsIgnorePattern: { + type: "string" + }, + caughtErrors: { + enum: ["all", "none"] + }, + caughtErrorsIgnorePattern: { + type: "string" + }, + destructuredArrayIgnorePattern: { + type: "string" + }, + ignoreClassWithStaticInitBlock: { + type: "boolean" + }, + reportUsedIgnorePattern: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}.", + usedIgnoredVar: "'{{varName}}' is marked as ignored but is used{{additional}}.", + removeVar: "Remove unused variable '{{varName}}'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + const REST_PROPERTY_TYPE = /^(?:RestElement|(?:Experimental)?RestProperty)$/u; + + const config = { + vars: "all", + args: "after-used", + ignoreRestSiblings: false, + caughtErrors: "all", + ignoreClassWithStaticInitBlock: false, + reportUsedIgnorePattern: false + }; + + const firstOption = context.options[0]; + + if (firstOption) { + if (typeof firstOption === "string") { + config.vars = firstOption; + } else { + config.vars = firstOption.vars || config.vars; + config.args = firstOption.args || config.args; + config.ignoreRestSiblings = firstOption.ignoreRestSiblings || config.ignoreRestSiblings; + config.caughtErrors = firstOption.caughtErrors || config.caughtErrors; + config.ignoreClassWithStaticInitBlock = firstOption.ignoreClassWithStaticInitBlock || config.ignoreClassWithStaticInitBlock; + config.reportUsedIgnorePattern = firstOption.reportUsedIgnorePattern || config.reportUsedIgnorePattern; + + if (firstOption.varsIgnorePattern) { + config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern, "u"); + } + + if (firstOption.argsIgnorePattern) { + config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern, "u"); + } + + if (firstOption.caughtErrorsIgnorePattern) { + config.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, "u"); + } + + if (firstOption.destructuredArrayIgnorePattern) { + config.destructuredArrayIgnorePattern = new RegExp(firstOption.destructuredArrayIgnorePattern, "u"); + } + } + } + + /** + * Determines what variable type a def is. + * @param {Object} def the declaration to check + * @returns {VariableType} a simple name for the types of variables that this rule supports + */ + function defToVariableType(def) { + + /* + * This `destructuredArrayIgnorePattern` error report works differently from the catch + * clause and parameter error reports. _Both_ the `varsIgnorePattern` and the + * `destructuredArrayIgnorePattern` will be checked for array destructuring. However, + * for the purposes of the report, the currently defined behavior is to only inform the + * user of the `destructuredArrayIgnorePattern` if it's present (regardless of the fact + * that the `varsIgnorePattern` would also apply). If it's not present, the user will be + * informed of the `varsIgnorePattern`, assuming that's present. + */ + if (config.destructuredArrayIgnorePattern && def.name.parent.type === "ArrayPattern") { + return "array-destructure"; + } + + switch (def.type) { + case "CatchClause": + return "catch-clause"; + case "Parameter": + return "parameter"; + + default: + return "variable"; + } + } + + /** + * Gets a given variable's description and configured ignore pattern + * based on the provided variableType + * @param {VariableType} variableType a simple name for the types of variables that this rule supports + * @throws {Error} (Unreachable) + * @returns {[string | undefined, string | undefined]} the given variable's description and + * ignore pattern + */ + function getVariableDescription(variableType) { + let pattern; + let variableDescription; + + switch (variableType) { + case "array-destructure": + pattern = config.destructuredArrayIgnorePattern; + variableDescription = "elements of array destructuring"; + break; + + case "catch-clause": + pattern = config.caughtErrorsIgnorePattern; + variableDescription = "caught errors"; + break; + + case "parameter": + pattern = config.argsIgnorePattern; + variableDescription = "args"; + break; + + case "variable": + pattern = config.varsIgnorePattern; + variableDescription = "vars"; + break; + + default: + throw new Error(`Unexpected variable type: ${variableType}`); + } + + if (pattern) { + pattern = pattern.toString(); + } + + return [variableDescription, pattern]; + } + + /** + * Generates the message data about the variable being defined and unused, + * including the ignore pattern if configured. + * @param {Variable} unusedVar eslint-scope variable object. + * @returns {UnusedVarMessageData} The message data to be used with this unused variable. + */ + function getDefinedMessageData(unusedVar) { + const def = unusedVar.defs && unusedVar.defs[0]; + let additionalMessageData = ""; + + if (def) { + const [variableDescription, pattern] = getVariableDescription(defToVariableType(def)); + + if (pattern && variableDescription) { + additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`; + } + } + + return { + varName: unusedVar.name, + action: "defined", + additional: additionalMessageData + }; + } + + /** + * Generate the warning message about the variable being + * assigned and unused, including the ignore pattern if configured. + * @param {Variable} unusedVar eslint-scope variable object. + * @returns {UnusedVarMessageData} The message data to be used with this unused variable. + */ + function getAssignedMessageData(unusedVar) { + const def = unusedVar.defs && unusedVar.defs[0]; + let additionalMessageData = ""; + + if (def) { + const [variableDescription, pattern] = getVariableDescription(defToVariableType(def)); + + if (pattern && variableDescription) { + additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`; + } + } + + return { + varName: unusedVar.name, + action: "assigned a value", + additional: additionalMessageData + }; + } + + /** + * Generate the warning message about a variable being used even though + * it is marked as being ignored. + * @param {Variable} variable eslint-scope variable object + * @param {VariableType} variableType a simple name for the types of variables that this rule supports + * @returns {UsedIgnoredVarMessageData} The message data to be used with + * this used ignored variable. + */ + function getUsedIgnoredMessageData(variable, variableType) { + const [variableDescription, pattern] = getVariableDescription(variableType); + + let additionalMessageData = ""; + + if (pattern && variableDescription) { + additionalMessageData = `. Used ${variableDescription} must not match ${pattern}`; + } + + return { + varName: variable.name, + additional: additionalMessageData + }; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const STATEMENT_TYPE = /(?:Statement|Declaration)$/u; + + /** + * Determines if a given variable is being exported from a module. + * @param {Variable} variable eslint-scope variable object. + * @returns {boolean} True if the variable is exported, false if not. + * @private + */ + function isExported(variable) { + + const definition = variable.defs[0]; + + if (definition) { + + let node = definition.node; + + if (node.type === "VariableDeclarator") { + node = node.parent; + } else if (definition.type === "Parameter") { + return false; + } + + return node.parent.type.indexOf("Export") === 0; + } + return false; + + } + + /** + * Checks whether a node is a sibling of the rest property or not. + * @param {ASTNode} node a node to check + * @returns {boolean} True if the node is a sibling of the rest property, otherwise false. + */ + function hasRestSibling(node) { + return node.type === "Property" && + node.parent.type === "ObjectPattern" && + REST_PROPERTY_TYPE.test(node.parent.properties.at(-1).type); + } + + /** + * Determines if a variable has a sibling rest property + * @param {Variable} variable eslint-scope variable object. + * @returns {boolean} True if the variable has a sibling rest property, false if not. + * @private + */ + function hasRestSpreadSibling(variable) { + if (config.ignoreRestSiblings) { + const hasRestSiblingDefinition = variable.defs.some(def => hasRestSibling(def.name.parent)); + const hasRestSiblingReference = variable.references.some(ref => hasRestSibling(ref.identifier.parent)); + + return hasRestSiblingDefinition || hasRestSiblingReference; + } + + return false; + } + + /** + * Determines if a reference is a read operation. + * @param {Reference} ref An eslint-scope Reference + * @returns {boolean} whether the given reference represents a read operation + * @private + */ + function isReadRef(ref) { + return ref.isRead(); + } + + /** + * Determine if an identifier is referencing an enclosing function name. + * @param {Reference} ref The reference to check. + * @param {ASTNode[]} nodes The candidate function nodes. + * @returns {boolean} True if it's a self-reference, false if not. + * @private + */ + function isSelfReference(ref, nodes) { + let scope = ref.from; + + while (scope) { + if (nodes.includes(scope.block)) { + return true; + } + + scope = scope.upper; + } + + return false; + } + + /** + * Gets a list of function definitions for a specified variable. + * @param {Variable} variable eslint-scope variable object. + * @returns {ASTNode[]} Function nodes. + * @private + */ + function getFunctionDefinitions(variable) { + const functionDefinitions = []; + + variable.defs.forEach(def => { + const { type, node } = def; + + // FunctionDeclarations + if (type === "FunctionName") { + functionDefinitions.push(node); + } + + // FunctionExpressions + if (type === "Variable" && node.init && + (node.init.type === "FunctionExpression" || node.init.type === "ArrowFunctionExpression")) { + functionDefinitions.push(node.init); + } + }); + return functionDefinitions; + } + + /** + * Checks the position of given nodes. + * @param {ASTNode} inner A node which is expected as inside. + * @param {ASTNode} outer A node which is expected as outside. + * @returns {boolean} `true` if the `inner` node exists in the `outer` node. + * @private + */ + function isInside(inner, outer) { + return ( + inner.range[0] >= outer.range[0] && + inner.range[1] <= outer.range[1] + ); + } + + /** + * Checks whether a given node is unused expression or not. + * @param {ASTNode} node The node itself + * @returns {boolean} The node is an unused expression. + * @private + */ + function isUnusedExpression(node) { + const parent = node.parent; + + if (parent.type === "ExpressionStatement") { + return true; + } + + if (parent.type === "SequenceExpression") { + const isLastExpression = parent.expressions.at(-1) === node; + + if (!isLastExpression) { + return true; + } + return isUnusedExpression(parent); + } + + return false; + } + + /** + * If a given reference is left-hand side of an assignment, this gets + * the right-hand side node of the assignment. + * + * In the following cases, this returns null. + * + * - The reference is not the LHS of an assignment expression. + * - The reference is inside of a loop. + * - The reference is inside of a function scope which is different from + * the declaration. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} prevRhsNode The previous RHS node. + * @returns {ASTNode|null} The RHS node or null. + * @private + */ + function getRhsNode(ref, prevRhsNode) { + const id = ref.identifier; + const parent = id.parent; + const refScope = ref.from.variableScope; + const varScope = ref.resolved.scope.variableScope; + const canBeUsedLater = refScope !== varScope || astUtils.isInLoop(id); + + /* + * Inherits the previous node if this reference is in the node. + * This is for `a = a + a`-like code. + */ + if (prevRhsNode && isInside(id, prevRhsNode)) { + return prevRhsNode; + } + + if (parent.type === "AssignmentExpression" && + isUnusedExpression(parent) && + id === parent.left && + !canBeUsedLater + ) { + return parent.right; + } + return null; + } + + /** + * Checks whether a given function node is stored to somewhere or not. + * If the function node is stored, the function can be used later. + * @param {ASTNode} funcNode A function node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} `true` if under the following conditions: + * - the funcNode is assigned to a variable. + * - the funcNode is bound as an argument of a function call. + * - the function is bound to a property and the object satisfies above conditions. + * @private + */ + function isStorableFunction(funcNode, rhsNode) { + let node = funcNode; + let parent = funcNode.parent; + + while (parent && isInside(parent, rhsNode)) { + switch (parent.type) { + case "SequenceExpression": + if (parent.expressions.at(-1) !== node) { + return false; + } + break; + + case "CallExpression": + case "NewExpression": + return parent.callee !== node; + + case "AssignmentExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + return true; + + default: + if (STATEMENT_TYPE.test(parent.type)) { + + /* + * If it encountered statements, this is a complex pattern. + * Since analyzing complex patterns is hard, this returns `true` to avoid false positive. + */ + return true; + } + } + + node = parent; + parent = parent.parent; + } + + return false; + } + + /** + * Checks whether a given Identifier node exists inside of a function node which can be used later. + * + * "can be used later" means: + * - the function is assigned to a variable. + * - the function is bound to a property and the object can be used later. + * - the function is bound as an argument of a function call. + * + * If a reference exists in a function which can be used later, the reference is read when the function is called. + * @param {ASTNode} id An Identifier node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} `true` if the `id` node exists inside of a function node which can be used later. + * @private + */ + function isInsideOfStorableFunction(id, rhsNode) { + const funcNode = astUtils.getUpperFunction(id); + + return ( + funcNode && + isInside(funcNode, rhsNode) && + isStorableFunction(funcNode, rhsNode) + ); + } + + /** + * Checks whether a given reference is a read to update itself or not. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} The reference is a read to update itself. + * @private + */ + function isReadForItself(ref, rhsNode) { + const id = ref.identifier; + const parent = id.parent; + + return ref.isRead() && ( + + // self update. e.g. `a += 1`, `a++` + ( + ( + parent.type === "AssignmentExpression" && + parent.left === id && + isUnusedExpression(parent) && + !astUtils.isLogicalAssignmentOperator(parent.operator) + ) || + ( + parent.type === "UpdateExpression" && + isUnusedExpression(parent) + ) + ) || + + // in RHS of an assignment for itself. e.g. `a = a + 1` + ( + rhsNode && + isInside(id, rhsNode) && + !isInsideOfStorableFunction(id, rhsNode) + ) + ); + } + + /** + * Determine if an identifier is used either in for-in or for-of loops. + * @param {Reference} ref The reference to check. + * @returns {boolean} whether reference is used in the for-in loops + * @private + */ + function isForInOfRef(ref) { + let target = ref.identifier.parent; + + + // "for (var ...) { return; }" + if (target.type === "VariableDeclarator") { + target = target.parent.parent; + } + + if (target.type !== "ForInStatement" && target.type !== "ForOfStatement") { + return false; + } + + // "for (...) { return; }" + if (target.body.type === "BlockStatement") { + target = target.body.body[0]; + + // "for (...) return;" + } else { + target = target.body; + } + + // For empty loop body + if (!target) { + return false; + } + + return target.type === "ReturnStatement"; + } + + /** + * Determines if the variable is used. + * @param {Variable} variable The variable to check. + * @returns {boolean} True if the variable is used + * @private + */ + function isUsedVariable(variable) { + if (variable.eslintUsed) { + return true; + } + + const functionNodes = getFunctionDefinitions(variable); + const isFunctionDefinition = functionNodes.length > 0; + + let rhsNode = null; + + return variable.references.some(ref => { + if (isForInOfRef(ref)) { + return true; + } + + const forItself = isReadForItself(ref, rhsNode); + + rhsNode = getRhsNode(ref, rhsNode); + + return ( + isReadRef(ref) && + !forItself && + !(isFunctionDefinition && isSelfReference(ref, functionNodes)) + ); + }); + } + + /** + * Checks whether the given variable is after the last used parameter. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is defined after the last + * used parameter. + */ + function isAfterLastUsedArg(variable) { + const def = variable.defs[0]; + const params = sourceCode.getDeclaredVariables(def.node); + const posteriorParams = params.slice(params.indexOf(variable) + 1); + + // If any used parameters occur after this parameter, do not report. + return !posteriorParams.some(v => v.references.length > 0 || v.eslintUsed); + } + + /** + * Gets an array of variables without read references. + * @param {Scope} scope an eslint-scope Scope object. + * @param {Variable[]} unusedVars an array that saving result. + * @returns {Variable[]} unused variables of the scope and descendant scopes. + * @private + */ + function collectUnusedVariables(scope, unusedVars) { + const variables = scope.variables; + const childScopes = scope.childScopes; + let i, l; + + if (scope.type !== "global" || config.vars === "all") { + for (i = 0, l = variables.length; i < l; ++i) { + const variable = variables[i]; + + // skip a variable of class itself name in the class scope + if (scope.type === "class" && scope.block.id === variable.identifiers[0]) { + continue; + } + + // skip function expression names + if (scope.functionExpressionScope) { + continue; + } + + // skip variables marked with markVariableAsUsed() + if (!config.reportUsedIgnorePattern && variable.eslintUsed) { + continue; + } + + // skip implicit "arguments" variable + if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) { + continue; + } + + // explicit global variables don't have definitions. + const def = variable.defs[0]; + + if (def) { + const type = def.type; + const refUsedInArrayPatterns = variable.references.some(ref => ref.identifier.parent.type === "ArrayPattern"); + + // skip elements of array destructuring patterns + if ( + ( + def.name.parent.type === "ArrayPattern" || + refUsedInArrayPatterns + ) && + config.destructuredArrayIgnorePattern && + config.destructuredArrayIgnorePattern.test(def.name.name) + ) { + if (config.reportUsedIgnorePattern && isUsedVariable(variable)) { + context.report({ + node: def.name, + messageId: "usedIgnoredVar", + data: getUsedIgnoredMessageData(variable, "array-destructure") + }); + } + + continue; + } + + if (type === "ClassName") { + const hasStaticBlock = def.node.body.body.some(node => node.type === "StaticBlock"); + + if (config.ignoreClassWithStaticInitBlock && hasStaticBlock) { + continue; + } + } + + // skip catch variables + if (type === "CatchClause") { + if (config.caughtErrors === "none") { + continue; + } + + // skip ignored parameters + if (config.caughtErrorsIgnorePattern && config.caughtErrorsIgnorePattern.test(def.name.name)) { + if (config.reportUsedIgnorePattern && isUsedVariable(variable)) { + context.report({ + node: def.name, + messageId: "usedIgnoredVar", + data: getUsedIgnoredMessageData(variable, "catch-clause") + }); + } + + continue; + } + } else if (type === "Parameter") { + + // skip any setter argument + if ((def.node.parent.type === "Property" || def.node.parent.type === "MethodDefinition") && def.node.parent.kind === "set") { + continue; + } + + // if "args" option is "none", skip any parameter + if (config.args === "none") { + continue; + } + + // skip ignored parameters + if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) { + if (config.reportUsedIgnorePattern && isUsedVariable(variable)) { + context.report({ + node: def.name, + messageId: "usedIgnoredVar", + data: getUsedIgnoredMessageData(variable, "parameter") + }); + } + + continue; + } + + // if "args" option is "after-used", skip used variables + if (config.args === "after-used" && astUtils.isFunction(def.name.parent) && !isAfterLastUsedArg(variable)) { + continue; + } + } else { + + // skip ignored variables + if (config.varsIgnorePattern && config.varsIgnorePattern.test(def.name.name)) { + if (config.reportUsedIgnorePattern && isUsedVariable(variable)) { + context.report({ + node: def.name, + messageId: "usedIgnoredVar", + data: getUsedIgnoredMessageData(variable, "variable") + }); + } + + continue; + } + } + } + + if (!isUsedVariable(variable) && !isExported(variable) && !hasRestSpreadSibling(variable)) { + unusedVars.push(variable); + } + } + } + + for (i = 0, l = childScopes.length; i < l; ++i) { + collectUnusedVariables(childScopes[i], unusedVars); + } + + return unusedVars; + } + + /** + * fixes unused variables + * @param {Object} fixer fixer object + * @param {Object} unusedVar unused variable to fix + * @returns {Object} fixer object + */ + function handleFixes(fixer, unusedVar) { + const id = unusedVar.identifiers[0]; + const parent = id.parent; + const parentType = parent.type; + const tokenBefore = sourceCode.getTokenBefore(id); + const tokenAfter = sourceCode.getTokenAfter(id); + const isFunction = astUtils.isFunction; + const isLoop = astUtils.isLoop; + const allWriteReferences = unusedVar.references.filter(ref => ref.isWrite()); + + /** + * get range from token before of a given node + * @param {ASTNode} node node of identifier + * @param {number} skips number of token to skip + * @returns {number} start range of token before the identifier + */ + function getPreviousTokenStart(node, skips) { + return sourceCode.getTokenBefore(node, skips).range[0]; + } + + /** + * get range to token after of a given node + * @param {ASTNode} node node of identifier + * @param {number} skips number of token to skip + * @returns {number} end range of token after the identifier + */ + function getNextTokenEnd(node, skips) { + return sourceCode.getTokenAfter(node, skips).range[1]; + } + + /** + * get the value of token before of a given node + * @param {ASTNode} node node of identifier + * @returns {string} value of token before the identifier + */ + function getTokenBeforeValue(node) { + return sourceCode.getTokenBefore(node).value; + } + + /** + * get the value of token after of a given node + * @param {ASTNode} node node of identifier + * @returns {string} value of token after the identifier + */ + function getTokenAfterValue(node) { + return sourceCode.getTokenAfter(node).value; + } + + /** + * Check if an array has a single element with null as other element. + * @param {ASTNode} node ArrayPattern node + * @returns {boolean} true if array has single element with other null elements + */ + function hasSingleElement(node) { + return node.elements.filter(e => e !== null).length === 1; + } + + /** + * check whether import specifier has an import of particular type + * @param {ASTNode} node ImportDeclaration node + * @param {string} type type of import to check + * @returns {boolean} true if import specifier has import of specified type + */ + function hasImportOfCertainType(node, type) { + return node.specifiers.some(e => e.type === type); + } + + /** + * Check whether declaration is safe to remove or not + * @param {ASTNode} nextToken next token of unused variable + * @param {ASTNode} prevToken previous token of unused variable + * @returns {boolean} true if declaration is not safe to remove + */ + function isDeclarationNotSafeToRemove(nextToken, prevToken) { + return ( + (nextToken.type === "String") || + ( + prevToken && + !astUtils.isSemicolonToken(prevToken) && + !astUtils.isOpeningBraceToken(prevToken) + ) + ); + } + + /** + * give fixes for unused variables in function parameters + * @param {ASTNode} node node to check + * @returns {Object} fixer object + */ + function fixFunctionParameters(node) { + const parentNode = node.parent; + + if (isFunction(parentNode)) { + + // remove unused function parameter if there is only a single parameter + if (parentNode.params.length === 1) { + return fixer.removeRange(node.range); + } + + // remove first unused function parameter when there are multiple parameters + if (getTokenBeforeValue(node) === "(" && getTokenAfterValue(node) === ",") { + return fixer.removeRange([node.range[0], getNextTokenEnd(node)]); + } + + // remove unused function parameters except first one when there are multiple parameters + return fixer.removeRange([getPreviousTokenStart(node), node.range[1]]); + } + + return null; + } + + /** + * fix unused variable declarations and function parameters + * @param {ASTNode} node parent node to identifier + * @returns {Object} fixer object + */ + function fixVariables(node) { + const parentNode = node.parent; + + // remove unused declared variables such as var a = b; or var a = b, c; + if (parentNode.type === "VariableDeclarator") { + + // skip variable in for (const [ foo ] of bar); + if (isLoop(parentNode.parent.parent)) { + return null; + } + + /* + * remove unused declared variable with single declaration such as 'var a = b;' + * remove complete declaration when there is an unused variable in 'const { a } = foo;', same for arrays. + */ + if (parentNode.parent.declarations.length === 1) { + + // if next token is a string it could become a directive if node is removed -> no suggestion. + const nextToken = sourceCode.getTokenAfter(parentNode.parent); + + // if previous token exists and is not ";" or "{" not sure about ASI rules -> no suggestion. + const prevToken = sourceCode.getTokenBefore(parentNode.parent); + + if (nextToken && isDeclarationNotSafeToRemove(nextToken, prevToken)) { + return null; + } + + return fixer.removeRange(parentNode.parent.range); + } + + /* + * remove unused declared variable with multiple declaration except first one such as 'var a = b, c = d;' + * fix 'let bar = "hello", { a } = foo;' to 'let bar = "hello";' if 'a' is unused, same for arrays. + */ + if (getTokenBeforeValue(parentNode) === ",") { + return fixer.removeRange([getPreviousTokenStart(parentNode), parentNode.range[1]]); + } + + /* + * remove first unused declared variable when there are multiple declarations + * fix 'let { a } = foo, bar = "hello";' to 'let bar = "hello";' if 'a' is unused, same for arrays. + */ + return fixer.removeRange([parentNode.range[0], getNextTokenEnd(parentNode)]); + } + + // fixes [{a: {k}}], [{a: [k]}] + if (getTokenBeforeValue(node) === ":") { + if (parentNode.parent.type === "ObjectPattern") { + // eslint-disable-next-line no-use-before-define -- due to interdependency of functions + return fixObjectWithValueSeparator(node); + } + } + + // fix unused function parameters + return fixFunctionParameters(node); + } + + /** + * fix nested object like { a: { b } } + * @param {ASTNode} node parent node to check + * @returns {Object} fixer object + */ + function fixNestedObjectVariable(node) { + const parentNode = node.parent; + + // fix for { a: { b: { c: { d } } } } + if ( + parentNode.parent.parent.parent.type === "ObjectPattern" && + parentNode.parent.properties.length === 1 + ) { + return fixNestedObjectVariable(parentNode.parent); + } + + // fix for { a: { b } } + if (parentNode.parent.type === "ObjectPattern") { + + // fix for unused variables in dectructured object with single property in variable decalartion and function parameter + if (parentNode.parent.properties.length === 1) { + return fixVariables(parentNode.parent); + } + + // fix for first unused property when there are multiple properties such as '{ a: { b }, c }' + if (getTokenBeforeValue(parentNode) === "{") { + return fixer.removeRange( + [parentNode.range[0], getNextTokenEnd(parentNode)] + ); + } + + // fix for unused property except first one when there are multiple properties such as '{ k, a: { b } }' + return fixer.removeRange([getPreviousTokenStart(parentNode), parentNode.range[1]]); + } + + return null; + } + + /** + * fix unused variables in array and nested array + * @param {ASTNode} node parent node to check + * @returns {Object} fixer object + */ + function fixNestedArrayVariable(node) { + const parentNode = node.parent; + + // fix for nested arrays [[ a ]] + if (parentNode.parent.type === "ArrayPattern" && hasSingleElement(parentNode)) { + return fixNestedArrayVariable(parentNode); + } + + if (hasSingleElement(parentNode)) { + + // fixes { a: [{ b }] } or { a: [[ b ]] } + if (getTokenBeforeValue(parentNode) === ":") { + return fixVariables(parentNode); + } + + // fixes [a, ...[[ b ]]] or [a, ...[{ b }]] + if (parentNode.parent.type === "RestElement") { + // eslint-disable-next-line no-use-before-define -- due to interdependency of functions + return fixRestInPattern(parentNode.parent); + } + + // fix unused variables in destructured array in variable declaration or function parameter + return fixVariables(parentNode); + } + + // remove last unused array element + if ( + getTokenBeforeValue(node) === "," && + getTokenAfterValue(node) === "]" + ) { + return fixer.removeRange([getPreviousTokenStart(node), node.range[1]]); + } + + // remove unused array element + return fixer.removeRange(node.range); + } + + /** + * fix cases like {a: {k}} or {a: [k]} + * @param {ASTNode} node parent node to check + * @returns {Object} fixer object + */ + function fixObjectWithValueSeparator(node) { + const parentNode = node.parent.parent; + + // fix cases like [{a : { b }}] or [{a : [ b ]}] + if ( + parentNode.parent.type === "ArrayPattern" && + parentNode.properties.length === 1 + ) { + return fixNestedArrayVariable(parentNode); + } + + // fix cases like {a: {k}} or {a: [k]} + return fixNestedObjectVariable(node); + } + + /** + * fix ...[[a]] or ...[{a}] like patterns + * @param {ASTNode} node parent node to check + * @returns {Object} fixer object + */ + function fixRestInPattern(node) { + const parentNode = node.parent; + + // fix ...[[a]] or ...[{a}] in function parameters + if (isFunction(parentNode)) { + if (parentNode.params.length === 1) { + return fixer.removeRange(node.range); + } + + return fixer.removeRange([getPreviousTokenStart(node), node.range[1]]); + } + + // fix rest in nested array pattern like [[a, ...[b]]] + if (parentNode.type === "ArrayPattern") { + + // fix [[...[b]]] + if (hasSingleElement(parentNode)) { + if (parentNode.parent.type === "ArrayPattern") { + return fixNestedArrayVariable(parentNode); + } + + // fix 'const [...[b]] = foo; and function foo([...[b]]) {} + return fixVariables(parentNode); + } + + // fix [[a, ...[b]]] + return fixer.removeRange([getPreviousTokenStart(node), node.range[1]]); + } + + return null; + } + + // skip fix when variable has references that would be left behind + if (allWriteReferences.some(ref => ref.identifier.range[0] !== id.range[0])) { + return null; + } + + // remove declared variables such as var a; or var a, b; + if (parentType === "VariableDeclarator") { + if (parent.parent.declarations.length === 1) { + + // prevent fix of variable in forOf and forIn loops. + if (isLoop(parent.parent.parent) && parent.parent.parent.body !== parent.parent) { + return null; + } + + // removes only variable not semicolon in 'if (foo()) var bar;' or in 'loops' or in 'with' statement. + if ( + parent.parent.parent.type === "IfStatement" || + isLoop(parent.parent.parent) || + (parent.parent.parent.type === "WithStatement" && parent.parent.parent.body === parent.parent) + ) { + return fixer.replaceText(parent.parent, ";"); + } + + // if next token is a string it could become a directive if node is removed -> no suggestion. + const nextToken = sourceCode.getTokenAfter(parent.parent); + + // if previous token exists and is not ";" or "{" not sure about ASI rules -> no suggestion. + const prevToken = sourceCode.getTokenBefore(parent.parent); + + if (nextToken && isDeclarationNotSafeToRemove(nextToken, prevToken)) { + return null; + } + + // remove unused declared variable with single declaration like 'var a = b;' + return fixer.removeRange(parent.parent.range); + } + + // remove unused declared variable with multiple declaration except first one like 'var a = b, c = d;' + if (tokenBefore.value === ",") { + return fixer.removeRange([tokenBefore.range[0], parent.range[1]]); + } + + // remove first unused declared variable when there are multiple declarations + return fixer.removeRange([parent.range[0], getNextTokenEnd(parent)]); + } + + // remove variables in object patterns + if (parent.parent.type === "ObjectPattern") { + if (parent.parent.properties.length === 1) { + + // fix [a, ...{b}] + if (parent.parent.parent.type === "RestElement") { + return fixRestInPattern(parent.parent.parent); + } + + // fix [{ a }] + if (parent.parent.parent.type === "ArrayPattern") { + return fixNestedArrayVariable(parent.parent); + } + + /* + * var {a} = foo; + * function a({a}) {} + * fix const { a: { b } } = foo; + */ + return fixVariables(parent.parent); + } + + // fix const { a:b } = foo; + if (tokenBefore.value === ":") { + + // remove first unused variable in const { a:b } = foo; + if (getTokenBeforeValue(parent) === "{" && getTokenAfterValue(parent) === ",") { + return fixer.removeRange([parent.range[0], getNextTokenEnd(parent)]); + } + + // remove unused variables in const { a: b, c: d } = foo; except first one + return fixer.removeRange([getPreviousTokenStart(parent), id.range[1]]); + } + } + + // remove unused variables inside an array + if (parentType === "ArrayPattern") { + if (hasSingleElement(parent)) { + + // fix [a, ...[b]] + if (parent.parent.type === "RestElement") { + return fixRestInPattern(parent.parent); + } + + // fix [ [a] ] + if (parent.parent.type === "ArrayPattern") { + return fixNestedArrayVariable(parent); + } + + /* + * fix var [a] = foo; + * fix function foo([a]) {} + * fix const { a: [b] } = foo; + */ + return fixVariables(parent); + } + + // if "a" is unused in [a, b ,c] fixes to [, b, c] + if (tokenBefore.value === "," && tokenAfter.value === ",") { + return fixer.removeRange(id.range); + } + } + + // remove unused rest elements + if (parentType === "RestElement") { + + // fix [a, ...rest] + if (parent.parent.type === "ArrayPattern") { + if (hasSingleElement(parent.parent)) { + + // fix [[...rest]] when there is only rest element + if ( + parent.parent.parent.type === "ArrayPattern" + ) { + return fixNestedArrayVariable(parent.parent); + } + + // fix 'const [...rest] = foo;' and 'function foo([...rest]) {}' + return fixVariables(parent.parent); + } + + // fix [a, ...rest] + return fixer.removeRange([getPreviousTokenStart(id, 1), id.range[1]]); + } + + // fix { a, ...rest} + if (parent.parent.type === "ObjectPattern") { + + // fix 'const {...rest} = foo;' and 'function foo({...rest}) {}' + if (parent.parent.properties.length === 1) { + return fixVariables(parent.parent); + } + + // fix { a, ...rest} when there are multiple properties + return fixer.removeRange([getPreviousTokenStart(id, 1), id.range[1]]); + } + + // fix function foo(...rest) {} + if (isFunction(parent.parent)) { + + // remove unused rest in function parameter if there is only single parameter + if (parent.parent.params.length === 1) { + return fixer.removeRange(parent.range); + } + + // remove unused rest in function parameter if there multiple parameter + return fixer.removeRange([getPreviousTokenStart(parent), parent.range[1]]); + } + } + + if (parentType === "AssignmentPattern") { + + // fix [a = aDefault] + if (parent.parent.type === "ArrayPattern") { + return fixNestedArrayVariable(parent); + } + + // fix {a = aDefault} + if (parent.parent.parent.type === "ObjectPattern") { + if (parent.parent.parent.properties.length === 1) { + + // fixes [{a = aDefault}] + if (parent.parent.parent.parent.type === "ArrayPattern") { + return fixNestedArrayVariable(parent.parent.parent); + } + + // fix 'const {a = aDefault} = foo;' and 'function foo({a = aDefault}) {}' + return fixVariables(parent.parent.parent); + } + + // fix unused 'a' in {a = aDefault} if it is the first property + if ( + getTokenBeforeValue(parent.parent) === "{" && + getTokenAfterValue(parent.parent) === "," + ) { + return fixer.removeRange([parent.parent.range[0], getNextTokenEnd(parent.parent)]); + } + + // fix unused 'b' in {a, b = aDefault} if it is not the first property + return fixer.removeRange([getPreviousTokenStart(parent.parent), parent.parent.range[1]]); + } + + // fix unused assignment patterns in function parameters + if (isFunction(parent.parent)) { + return fixFunctionParameters(parent); + } + } + + // remove unused functions + if (parentType === "FunctionDeclaration" && parent.id === id) { + return fixer.removeRange(parent.range); + } + + // remove unused default import + if (parentType === "ImportDefaultSpecifier") { + + // remove unused default import when there are not other imports + if ( + !hasImportOfCertainType(parent.parent, "ImportSpecifier") && + !hasImportOfCertainType(parent.parent, "ImportNamespaceSpecifier") + ) { + return fixer.removeRange([parent.range[0], parent.parent.source.range[0]]); + } + + // remove unused default import when there are other imports also + return fixer.removeRange([id.range[0], tokenAfter.range[1]]); + } + + if (parentType === "ImportSpecifier") { + + // remove unused imports when there is a single import + if (parent.parent.specifiers.filter(e => e.type === "ImportSpecifier").length === 1) { + + // remove unused import when there is no default import + if (!hasImportOfCertainType(parent.parent, "ImportDefaultSpecifier")) { + return fixer.removeRange(parent.parent.range); + } + + // fixes "import foo from 'module';" to "import 'module';" + return fixer.removeRange([getPreviousTokenStart(parent, 1), tokenAfter.range[1]]); + } + + if (getTokenBeforeValue(parent) === "{") { + return fixer.removeRange([parent.range[0], getNextTokenEnd(parent)]); + } + + return fixer.removeRange([getPreviousTokenStart(parent), parent.range[1]]); + } + + if (parentType === "ImportNamespaceSpecifier") { + if (hasImportOfCertainType(parent.parent, "ImportDefaultSpecifier")) { + return fixer.removeRange([getPreviousTokenStart(parent), parent.range[1]]); + } + + // fixes "import * as foo from 'module';" to "import 'module';" + return fixer.removeRange([parent.range[0], parent.parent.source.range[0]]); + } + + // skip error in catch(error) variable + if (parentType === "CatchClause") { + return null; + } + + // remove unused declared classes + if (parentType === "ClassDeclaration") { + return fixer.removeRange(parent.range); + } + + // remove unused varible that is in a sequence [a,b] fixes to [a] + if (tokenBefore?.value === ",") { + return fixer.removeRange([tokenBefore.range[0], id.range[1]]); + } + + // remove unused varible that is in a sequence inside function arguments and object pattern + if (tokenAfter.value === ",") { + + // fix function foo(a, b) {} + if (tokenBefore.value === "(") { + return fixer.removeRange([id.range[0], tokenAfter.range[1]]); + } + + // fix const {a, b} = foo; + if (tokenBefore.value === "{") { + return fixer.removeRange([id.range[0], tokenAfter.range[1]]); + } + } + + if (parentType === "ArrowFunctionExpression" && parent.params.length === 1 && tokenAfter?.value !== ")") { + return fixer.replaceText(id, "()"); + } + + return fixer.removeRange(id.range); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "Program:exit"(programNode) { + const unusedVars = collectUnusedVariables(sourceCode.getScope(programNode), []); + + for (let i = 0, l = unusedVars.length; i < l; ++i) { + const unusedVar = unusedVars[i]; + + // Report the first declaration. + if (unusedVar.defs.length > 0) { + + // report last write reference, https://github.com/eslint/eslint/issues/14324 + const writeReferences = unusedVar.references.filter(ref => ref.isWrite() && ref.from.variableScope === unusedVar.scope.variableScope); + + let referenceToReport; + + if (writeReferences.length > 0) { + referenceToReport = writeReferences.at(-1); + } + + context.report({ + node: referenceToReport ? referenceToReport.identifier : unusedVar.identifiers[0], + messageId: "unusedVar", + data: unusedVar.references.some(ref => ref.isWrite()) + ? getAssignedMessageData(unusedVar) + : getDefinedMessageData(unusedVar), + suggest: [ + { + messageId: "removeVar", + data: { + varName: unusedVar.name + }, + fix(fixer) { + return handleFixes(fixer, unusedVar); + } + } + ] + }); + + // If there are no regular declaration, report the first `/*globals*/` comment directive. + } else if (unusedVar.eslintExplicitGlobalComments) { + const directiveComment = unusedVar.eslintExplicitGlobalComments[0]; + + context.report({ + node: programNode, + loc: astUtils.getNameLocationInGlobalDirectiveComment(sourceCode, directiveComment, unusedVar.name), + messageId: "unusedVar", + data: getDefinedMessageData(unusedVar) + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-use-before-define.js b/node_modules/eslint/lib/rules/no-use-before-define.js new file mode 100644 index 0000000..59510d8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-use-before-define.js @@ -0,0 +1,350 @@ +/** + * @fileoverview Rule to flag use of variables before they are defined + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u; +const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u; + +/** + * Parses a given value as options. + * @param {any} options A value to parse. + * @returns {Object} The parsed options. + */ +function parseOptions(options) { + if (typeof options === "object" && options !== null) { + return options; + } + + const functions = + typeof options === "string" + ? options !== "nofunc" + : true; + + return { functions, classes: true, variables: true, allowNamedExports: false }; +} + +/** + * Checks whether or not a given location is inside of the range of a given node. + * @param {ASTNode} node An node to check. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of the range of the node. + */ +function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; +} + +/** + * Checks whether or not a given location is inside of the range of a class static initializer. + * Static initializers are static blocks and initializers of static fields. + * @param {ASTNode} node `ClassBody` node to check static initializers. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of a class static initializer. + */ +function isInClassStaticInitializerRange(node, location) { + return node.body.some(classMember => ( + ( + classMember.type === "StaticBlock" && + isInRange(classMember, location) + ) || + ( + classMember.type === "PropertyDefinition" && + classMember.static && + classMember.value && + isInRange(classMember.value, location) + ) + )); +} + +/** + * Checks whether a given scope is the scope of a class static initializer. + * Static initializers are static blocks and initializers of static fields. + * @param {eslint-scope.Scope} scope A scope to check. + * @returns {boolean} `true` if the scope is a class static initializer scope. + */ +function isClassStaticInitializerScope(scope) { + if (scope.type === "class-static-block") { + return true; + } + + if (scope.type === "class-field-initializer") { + + // `scope.block` is PropertyDefinition#value node + const propertyDefinition = scope.block.parent; + + return propertyDefinition.static; + } + + return false; +} + +/** + * Checks whether a given reference is evaluated in an execution context + * that isn't the one where the variable it refers to is defined. + * Execution contexts are: + * - top-level + * - functions + * - class field initializers (implicit functions) + * - class static blocks (implicit functions) + * Static class field initializers and class static blocks are automatically run during the class definition evaluation, + * and therefore we'll consider them as a part of the parent execution context. + * Example: + * + * const x = 1; + * + * x; // returns `false` + * () => x; // returns `true` + * + * class C { + * field = x; // returns `true` + * static field = x; // returns `false` + * + * method() { + * x; // returns `true` + * } + * + * static method() { + * x; // returns `true` + * } + * + * static { + * x; // returns `false` + * } + * } + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is from a separate execution context. + */ +function isFromSeparateExecutionContext(reference) { + const variable = reference.resolved; + let scope = reference.from; + + // Scope#variableScope represents execution context + while (variable.scope.variableScope !== scope.variableScope) { + if (isClassStaticInitializerScope(scope.variableScope)) { + scope = scope.variableScope.upper; + } else { + return true; + } + } + + return false; +} + +/** + * Checks whether or not a given reference is evaluated during the initialization of its variable. + * + * This returns `true` in the following cases: + * + * var a = a + * var [a = a] = list + * var {a = a} = obj + * for (var a in a) {} + * for (var a of a) {} + * var C = class { [C]; }; + * var C = class { static foo = C; }; + * var C = class { static { foo = C; } }; + * class C extends C {} + * class C extends (class { static foo = C; }) {} + * class C { [C]; } + * @param {Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is evaluated during the initialization. + */ +function isEvaluatedDuringInitialization(reference) { + if (isFromSeparateExecutionContext(reference)) { + + /* + * Even if the reference appears in the initializer, it isn't evaluated during the initialization. + * For example, `const x = () => x;` is valid. + */ + return false; + } + + const location = reference.identifier.range[1]; + const definition = reference.resolved.defs[0]; + + if (definition.type === "ClassName") { + + // `ClassDeclaration` or `ClassExpression` + const classDefinition = definition.node; + + return ( + isInRange(classDefinition, location) && + + /* + * Class binding is initialized before running static initializers. + * For example, `class C { static foo = C; static { bar = C; } }` is valid. + */ + !isInClassStaticInitializerRange(classDefinition.body, location) + ); + } + + let node = definition.name.parent; + + while (node) { + if (node.type === "VariableDeclarator") { + if (isInRange(node.init, location)) { + return true; + } + if (FOR_IN_OF_TYPE.test(node.parent.parent.type) && + isInRange(node.parent.parent.right, location) + ) { + return true; + } + break; + } else if (node.type === "AssignmentPattern") { + if (isInRange(node.right, location)) { + return true; + } + } else if (SENTINEL_TYPE.test(node.type)) { + break; + } + + node = node.parent; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow the use of variables before they are defined", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-use-before-define" + }, + + schema: [ + { + oneOf: [ + { + enum: ["nofunc"] + }, + { + type: "object", + properties: { + functions: { type: "boolean" }, + classes: { type: "boolean" }, + variables: { type: "boolean" }, + allowNamedExports: { type: "boolean" } + }, + additionalProperties: false + } + ] + } + ], + + defaultOptions: [{ + classes: true, + functions: true, + variables: true, + allowNamedExports: false + }], + + messages: { + usedBeforeDefined: "'{{name}}' was used before it was defined." + } + }, + + create(context) { + const options = parseOptions(context.options[0]); + const sourceCode = context.sourceCode; + + /** + * Determines whether a given reference should be checked. + * + * Returns `false` if the reference is: + * - initialization's (e.g., `let a = 1`). + * - referring to an undefined variable (i.e., if it's an unresolved reference). + * - referring to a variable that is defined, but not in the given source code + * (e.g., global environment variable or `arguments` in functions). + * - allowed by options. + * @param {eslint-scope.Reference} reference The reference + * @returns {boolean} `true` if the reference should be checked + */ + function shouldCheck(reference) { + if (reference.init) { + return false; + } + + const { identifier } = reference; + + if ( + options.allowNamedExports && + identifier.parent.type === "ExportSpecifier" && + identifier.parent.local === identifier + ) { + return false; + } + + const variable = reference.resolved; + + if (!variable || variable.defs.length === 0) { + return false; + } + + const definitionType = variable.defs[0].type; + + if (!options.functions && definitionType === "FunctionName") { + return false; + } + + if ( + ( + !options.variables && definitionType === "Variable" || + !options.classes && definitionType === "ClassName" + ) && + + // don't skip checking the reference if it's in the same execution context, because of TDZ + isFromSeparateExecutionContext(reference) + ) { + return false; + } + + return true; + } + + /** + * Finds and validates all references in a given scope and its child scopes. + * @param {eslint-scope.Scope} scope The scope object. + * @returns {void} + */ + function checkReferencesInScope(scope) { + scope.references.filter(shouldCheck).forEach(reference => { + const variable = reference.resolved; + const definitionIdentifier = variable.defs[0].name; + + if ( + reference.identifier.range[1] < definitionIdentifier.range[1] || + isEvaluatedDuringInitialization(reference) + ) { + context.report({ + node: reference.identifier, + messageId: "usedBeforeDefined", + data: reference.identifier + }); + } + }); + + scope.childScopes.forEach(checkReferencesInScope); + } + + return { + Program(node) { + checkReferencesInScope(sourceCode.getScope(node)); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-assignment.js b/node_modules/eslint/lib/rules/no-useless-assignment.js new file mode 100644 index 0000000..90cc1c5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-assignment.js @@ -0,0 +1,575 @@ +/** + * @fileoverview A rule to disallow unnecessary assignments`. + * @author Yosuke Ota + */ + +"use strict"; + +const { findVariable } = require("@eslint-community/eslint-utils"); + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("estree").Node} ASTNode */ +/** @typedef {import("estree").Pattern} Pattern */ +/** @typedef {import("estree").Identifier} Identifier */ +/** @typedef {import("estree").VariableDeclarator} VariableDeclarator */ +/** @typedef {import("estree").AssignmentExpression} AssignmentExpression */ +/** @typedef {import("estree").UpdateExpression} UpdateExpression */ +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("eslint-scope").Scope} Scope */ +/** @typedef {import("eslint-scope").Variable} Variable */ +/** @typedef {import("../linter/code-path-analysis/code-path")} CodePath */ +/** @typedef {import("../linter/code-path-analysis/code-path-segment")} CodePathSegment */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Extract identifier from the given pattern node used on the left-hand side of the assignment. + * @param {Pattern} pattern The pattern node to extract identifier + * @returns {Iterable} The extracted identifier + */ +function *extractIdentifiersFromPattern(pattern) { + switch (pattern.type) { + case "Identifier": + yield pattern; + return; + case "ObjectPattern": + for (const property of pattern.properties) { + yield* extractIdentifiersFromPattern(property.type === "Property" ? property.value : property); + } + return; + case "ArrayPattern": + for (const element of pattern.elements) { + if (!element) { + continue; + } + yield* extractIdentifiersFromPattern(element); + } + return; + case "RestElement": + yield* extractIdentifiersFromPattern(pattern.argument); + return; + case "AssignmentPattern": + yield* extractIdentifiersFromPattern(pattern.left); + + // no default + } +} + + +/** + * Checks whether the given identifier node is evaluated after the assignment identifier. + * @param {AssignmentInfo} assignment The assignment info. + * @param {Identifier} identifier The identifier to check. + * @returns {boolean} `true` if the given identifier node is evaluated after the assignment identifier. + */ +function isIdentifierEvaluatedAfterAssignment(assignment, identifier) { + if (identifier.range[0] < assignment.identifier.range[1]) { + return false; + } + if ( + assignment.expression && + assignment.expression.range[0] <= identifier.range[0] && + identifier.range[1] <= assignment.expression.range[1] + ) { + + /* + * The identifier node is in an expression that is evaluated before the assignment. + * e.g. x = id; + * ^^ identifier to check + * ^ assignment identifier + */ + return false; + } + + /* + * e.g. + * x = 42; id; + * ^^ identifier to check + * ^ assignment identifier + * let { x, y = id } = obj; + * ^^ identifier to check + * ^ assignment identifier + */ + return true; +} + +/** + * Checks whether the given identifier node is used between the assigned identifier and the equal sign. + * + * e.g. let { x, y = x } = obj; + * ^ identifier to check + * ^ assigned identifier + * @param {AssignmentInfo} assignment The assignment info. + * @param {Identifier} identifier The identifier to check. + * @returns {boolean} `true` if the given identifier node is used between the assigned identifier and the equal sign. + */ +function isIdentifierUsedBetweenAssignedAndEqualSign(assignment, identifier) { + if (!assignment.expression) { + return false; + } + return ( + assignment.identifier.range[1] <= identifier.range[0] && + identifier.range[1] <= assignment.expression.range[0] + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow variable assignments when the value is not used", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-useless-assignment" + }, + + schema: [], + + messages: { + unnecessaryAssignment: "This assigned value is not used in subsequent statements." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * @typedef {Object} ScopeStack + * @property {CodePath} codePath The code path of this scope stack. + * @property {Scope} scope The scope of this scope stack. + * @property {ScopeStack} upper The upper scope stack. + * @property {Record} segments The map of ScopeStackSegmentInfo. + * @property {Set} currentSegments The current CodePathSegments. + * @property {Map} assignments The map of list of AssignmentInfo for each variable. + */ + /** + * @typedef {Object} ScopeStackSegmentInfo + * @property {CodePathSegment} segment The code path segment. + * @property {Identifier|null} first The first identifier that appears within the segment. + * @property {Identifier|null} last The last identifier that appears within the segment. + * `first` and `last` are used to determine whether an identifier exists within the segment position range. + * Since it is used as a range of segments, we should originally hold all nodes, not just identifiers, + * but since the only nodes to be judged are identifiers, it is sufficient to have a range of identifiers. + */ + /** + * @typedef {Object} AssignmentInfo + * @property {Variable} variable The variable that is assigned. + * @property {Identifier} identifier The identifier that is assigned. + * @property {VariableDeclarator|AssignmentExpression|UpdateExpression} node The node where the variable was updated. + * @property {Expression|null} expression The expression that is evaluated before the assignment. + * @property {CodePathSegment[]} segments The code path segments where the assignment was made. + */ + + /** @type {ScopeStack} */ + let scopeStack = null; + + /** @type {Set} */ + const codePathStartScopes = new Set(); + + /** + * Gets the scope of code path start from given scope + * @param {Scope} scope The initial scope + * @returns {Scope} The scope of code path start + * @throws {Error} Unexpected error + */ + function getCodePathStartScope(scope) { + let target = scope; + + while (target) { + if (codePathStartScopes.has(target)) { + return target; + } + target = target.upper; + } + + // Should be unreachable + return null; + } + + /** + * Verify the given scope stack. + * @param {ScopeStack} target The scope stack to verify. + * @returns {void} + */ + function verify(target) { + + /** + * Checks whether the given identifier is used in the segment. + * @param {CodePathSegment} segment The code path segment. + * @param {Identifier} identifier The identifier to check. + * @returns {boolean} `true` if the identifier is used in the segment. + */ + function isIdentifierUsedInSegment(segment, identifier) { + const segmentInfo = target.segments[segment.id]; + + return ( + segmentInfo.first && + segmentInfo.last && + segmentInfo.first.range[0] <= identifier.range[0] && + identifier.range[1] <= segmentInfo.last.range[1] + ); + } + + /** + * Verifies whether the given assignment info is an used assignment. + * Report if it is an unused assignment. + * @param {AssignmentInfo} targetAssignment The assignment info to verify. + * @param {AssignmentInfo[]} allAssignments The list of all assignment info for variables. + * @returns {void} + */ + function verifyAssignmentIsUsed(targetAssignment, allAssignments) { + + /** + * @typedef {Object} SubsequentSegmentData + * @property {CodePathSegment} segment The code path segment + * @property {AssignmentInfo} [assignment] The first occurrence of the assignment within the segment. + * There is no need to check if the variable is used after this assignment, + * as the value it was assigned will be used. + */ + + /** + * Information used in `getSubsequentSegments()`. + * To avoid unnecessary iterations, cache information that has already been iterated over, + * and if additional iterations are needed, start iterating from the retained position. + */ + const subsequentSegmentData = { + + /** + * Cache of subsequent segment information list that have already been iterated. + * @type {SubsequentSegmentData[]} + */ + results: [], + + /** + * Subsequent segments that have already been iterated on. Used to avoid infinite loops. + * @type {Set} + */ + subsequentSegments: new Set(), + + /** + * Unexplored code path segment. + * If additional iterations are needed, consume this information and iterate. + * @type {CodePathSegment[]} + */ + queueSegments: targetAssignment.segments.flatMap(segment => segment.nextSegments) + }; + + + /** + * Gets the subsequent segments from the segment of + * the assignment currently being validated (targetAssignment). + * @returns {Iterable} the subsequent segments + */ + function *getSubsequentSegments() { + yield* subsequentSegmentData.results; + + while (subsequentSegmentData.queueSegments.length > 0) { + const nextSegment = subsequentSegmentData.queueSegments.shift(); + + if (subsequentSegmentData.subsequentSegments.has(nextSegment)) { + continue; + } + subsequentSegmentData.subsequentSegments.add(nextSegment); + + const assignmentInSegment = allAssignments + .find(otherAssignment => ( + otherAssignment.segments.includes(nextSegment) && + !isIdentifierUsedBetweenAssignedAndEqualSign(otherAssignment, targetAssignment.identifier) + )); + + if (!assignmentInSegment) { + + /* + * Stores the next segment to explore. + * If `assignmentInSegment` exists, + * we are guarding it because we don't need to explore the next segment. + */ + subsequentSegmentData.queueSegments.push(...nextSegment.nextSegments); + } + + /** @type {SubsequentSegmentData} */ + const result = { + segment: nextSegment, + assignment: assignmentInSegment + }; + + subsequentSegmentData.results.push(result); + yield result; + } + } + + + if (targetAssignment.variable.references.some(ref => ref.identifier.type !== "Identifier")) { + + /** + * Skip checking for a variable that has at least one non-identifier reference. + * It's generated by plugins and cannot be handled reliably in the core rule. + */ + return; + } + + const readReferences = targetAssignment.variable.references.filter(reference => reference.isRead()); + + if (!readReferences.length) { + + /* + * It is not just an unnecessary assignment, but an unnecessary (unused) variable + * and thus should not be reported by this rule because it is reported by `no-unused-vars`. + */ + return; + } + + /** + * Other assignment on the current segment and after current assignment. + */ + const otherAssignmentAfterTargetAssignment = allAssignments + .find(assignment => { + if ( + assignment === targetAssignment || + assignment.segments.length && assignment.segments.every(segment => !targetAssignment.segments.includes(segment)) + ) { + return false; + } + if (isIdentifierEvaluatedAfterAssignment(targetAssignment, assignment.identifier)) { + return true; + } + if ( + assignment.expression && + assignment.expression.range[0] <= targetAssignment.identifier.range[0] && + targetAssignment.identifier.range[1] <= assignment.expression.range[1] + ) { + + /* + * The target assignment is in an expression that is evaluated before the assignment. + * e.g. x=(x=1); + * ^^^ targetAssignment + * ^^^^^^^ assignment + */ + return true; + } + + return false; + }); + + for (const reference of readReferences) { + + /* + * If the scope of the reference is outside the current code path scope, + * we cannot track whether this assignment is not used. + * For example, it can also be called asynchronously. + */ + if (target.scope !== getCodePathStartScope(reference.from)) { + return; + } + + // Checks if it is used in the same segment as the target assignment. + if ( + isIdentifierEvaluatedAfterAssignment(targetAssignment, reference.identifier) && + ( + isIdentifierUsedBetweenAssignedAndEqualSign(targetAssignment, reference.identifier) || + targetAssignment.segments.some(segment => isIdentifierUsedInSegment(segment, reference.identifier)) + ) + ) { + + if ( + otherAssignmentAfterTargetAssignment && + isIdentifierEvaluatedAfterAssignment(otherAssignmentAfterTargetAssignment, reference.identifier) + ) { + + // There was another assignment before the reference. Therefore, it has not been used yet. + continue; + } + + // Uses in statements after the written identifier. + return; + } + + if (otherAssignmentAfterTargetAssignment) { + + /* + * The assignment was followed by another assignment in the same segment. + * Therefore, there is no need to check the next segment. + */ + continue; + } + + // Check subsequent segments. + for (const subsequentSegment of getSubsequentSegments()) { + if (isIdentifierUsedInSegment(subsequentSegment.segment, reference.identifier)) { + if ( + subsequentSegment.assignment && + isIdentifierEvaluatedAfterAssignment(subsequentSegment.assignment, reference.identifier) + ) { + + // There was another assignment before the reference. Therefore, it has not been used yet. + continue; + } + + // It is used + return; + } + } + } + context.report({ + node: targetAssignment.identifier, + messageId: "unnecessaryAssignment" + }); + } + + // Verify that each assignment in the code path is used. + for (const assignments of target.assignments.values()) { + assignments.sort((a, b) => a.identifier.range[0] - b.identifier.range[0]); + for (const assignment of assignments) { + verifyAssignmentIsUsed(assignment, assignments); + } + } + } + + return { + onCodePathStart(codePath, node) { + const scope = sourceCode.getScope(node); + + scopeStack = { + upper: scopeStack, + codePath, + scope, + segments: Object.create(null), + currentSegments: new Set(), + assignments: new Map() + }; + codePathStartScopes.add(scopeStack.scope); + }, + onCodePathEnd() { + verify(scopeStack); + + scopeStack = scopeStack.upper; + }, + onCodePathSegmentStart(segment) { + const segmentInfo = { segment, first: null, last: null }; + + scopeStack.segments[segment.id] = segmentInfo; + scopeStack.currentSegments.add(segment); + }, + onCodePathSegmentEnd(segment) { + scopeStack.currentSegments.delete(segment); + }, + Identifier(node) { + for (const segment of scopeStack.currentSegments) { + const segmentInfo = scopeStack.segments[segment.id]; + + if (!segmentInfo.first) { + segmentInfo.first = node; + } + segmentInfo.last = node; + } + }, + ":matches(VariableDeclarator[init!=null], AssignmentExpression, UpdateExpression):exit"(node) { + if (scopeStack.currentSegments.size === 0) { + + // Ignore unreachable segments + return; + } + + const assignments = scopeStack.assignments; + + let pattern; + let expression = null; + + if (node.type === "VariableDeclarator") { + pattern = node.id; + expression = node.init; + } else if (node.type === "AssignmentExpression") { + pattern = node.left; + expression = node.right; + } else { // UpdateExpression + pattern = node.argument; + } + + for (const identifier of extractIdentifiersFromPattern(pattern)) { + const scope = sourceCode.getScope(identifier); + + /** @type {Variable} */ + const variable = findVariable(scope, identifier); + + if (!variable) { + continue; + } + + // We don't know where global variables are used. + if (variable.scope.type === "global" && variable.defs.length === 0) { + continue; + } + + /* + * If the scope of the variable is outside the current code path scope, + * we cannot track whether this assignment is not used. + */ + if (scopeStack.scope !== getCodePathStartScope(variable.scope)) { + continue; + } + + // Variables marked by `markVariableAsUsed()` or + // exported by "exported" block comment. + if (variable.eslintUsed) { + continue; + } + + // Variables exported by ESM export syntax + if (variable.scope.type === "module") { + if ( + variable.defs + .some(def => ( + (def.type === "Variable" && def.parent.parent.type === "ExportNamedDeclaration") || + ( + def.type === "FunctionName" && + ( + def.node.parent.type === "ExportNamedDeclaration" || + def.node.parent.type === "ExportDefaultDeclaration" + ) + ) || + ( + def.type === "ClassName" && + ( + def.node.parent.type === "ExportNamedDeclaration" || + def.node.parent.type === "ExportDefaultDeclaration" + ) + ) + )) + ) { + continue; + } + if (variable.references.some(reference => reference.identifier.parent.type === "ExportSpecifier")) { + + // It have `export { ... }` reference. + continue; + } + } + + let list = assignments.get(variable); + + if (!list) { + list = []; + assignments.set(variable, list); + } + list.push({ + variable, + identifier, + node, + expression, + segments: [...scopeStack.currentSegments] + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-backreference.js b/node_modules/eslint/lib/rules/no-useless-backreference.js new file mode 100644 index 0000000..d41a898 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-backreference.js @@ -0,0 +1,244 @@ +/** + * @fileoverview Rule to disallow useless backreferences in regular expressions + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("@eslint-community/eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new RegExpParser(); + +/** + * Finds the path from the given `regexpp` AST node to the root node. + * @param {regexpp.Node} node Node. + * @returns {regexpp.Node[]} Array that starts with the given node and ends with the root node. + */ +function getPathToRoot(node) { + const path = []; + let current = node; + + do { + path.push(current); + current = current.parent; + } while (current); + + return path; +} + +/** + * Determines whether the given `regexpp` AST node is a lookaround node. + * @param {regexpp.Node} node Node. + * @returns {boolean} `true` if it is a lookaround node. + */ +function isLookaround(node) { + return node.type === "Assertion" && + (node.kind === "lookahead" || node.kind === "lookbehind"); +} + +/** + * Determines whether the given `regexpp` AST node is a negative lookaround node. + * @param {regexpp.Node} node Node. + * @returns {boolean} `true` if it is a negative lookaround node. + */ +function isNegativeLookaround(node) { + return isLookaround(node) && node.negate; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow useless backreferences in regular expressions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-useless-backreference" + }, + + schema: [], + + messages: { + nested: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} from within that group.", + forward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which appears later in the pattern.", + backward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which appears before in the same lookbehind.", + disjunctive: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which is in another alternative.", + intoNegativeLookaround: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which is in a negative lookaround." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Checks and reports useless backreferences in the given regular expression. + * @param {ASTNode} node Node that represents regular expression. A regex literal or RegExp constructor call. + * @param {string} pattern Regular expression pattern. + * @param {string} flags Regular expression flags. + * @returns {void} + */ + function checkRegex(node, pattern, flags) { + let regExpAST; + + try { + regExpAST = parser.parsePattern(pattern, 0, pattern.length, { unicode: flags.includes("u"), unicodeSets: flags.includes("v") }); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + visitRegExpAST(regExpAST, { + onBackreferenceEnter(bref) { + const groups = [bref.resolved].flat(), + brefPath = getPathToRoot(bref); + + const problems = groups.map(group => { + const groupPath = getPathToRoot(group); + + if (brefPath.includes(group)) { + + // group is bref's ancestor => bref is nested ('nested reference') => group hasn't matched yet when bref starts to match. + return { + messageId: "nested", + group + }; + } + + + // Start from the root to find the lowest common ancestor. + let i = brefPath.length - 1, + j = groupPath.length - 1; + + do { + i--; + j--; + } while (brefPath[i] === groupPath[j]); + + const indexOfLowestCommonAncestor = j + 1, + groupCut = groupPath.slice(0, indexOfLowestCommonAncestor), + commonPath = groupPath.slice(indexOfLowestCommonAncestor), + lowestCommonLookaround = commonPath.find(isLookaround), + isMatchingBackward = lowestCommonLookaround && lowestCommonLookaround.kind === "lookbehind"; + + if (groupCut.at(-1).type === "Alternative") { + + // group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive. + return { + messageId: "disjunctive", + group + }; + } + if (!isMatchingBackward && bref.end <= group.start) { + + // bref is left, group is right ('forward reference') => group hasn't matched yet when bref starts to match. + return { + messageId: "forward", + group + }; + } + if (isMatchingBackward && group.end <= bref.start) { + + // the opposite of the previous when the regex is matching backward in a lookbehind context. + return { + messageId: "backward", + group + }; + } + if (groupCut.some(isNegativeLookaround)) { + + // group is in a negative lookaround which isn't bref's ancestor => group has already failed when bref starts to match. + return { + messageId: "intoNegativeLookaround", + group + }; + } + + return null; + }); + + if (problems.length === 0 || problems.some(problem => !problem)) { + + // If there are no problems or no problems with any group then do not report it. + return; + } + + let problemsToReport; + + // Gets problems that appear in the same disjunction. + const problemsInSameDisjunction = problems.filter(problem => problem.messageId !== "disjunctive"); + + if (problemsInSameDisjunction.length) { + + // Only report problems that appear in the same disjunction. + problemsToReport = problemsInSameDisjunction; + } else { + + // If all groups appear in different disjunctions, report it. + problemsToReport = problems; + } + + const [{ messageId, group }, ...other] = problemsToReport; + let otherGroups = ""; + + if (other.length === 1) { + otherGroups = " and another group"; + } else if (other.length > 1) { + otherGroups = ` and other ${other.length} groups`; + } + context.report({ + node, + messageId, + data: { + bref: bref.raw, + group: group.raw, + otherGroups + } + }); + } + }); + } + + return { + "Literal[regex]"(node) { + const { pattern, flags } = node.regex; + + checkRegex(node, pattern, flags); + }, + Program(node) { + const scope = sourceCode.getScope(node), + tracker = new ReferenceTracker(scope), + traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node: refNode } of tracker.iterateGlobalReferences(traceMap)) { + const [patternNode, flagsNode] = refNode.arguments, + pattern = getStringIfConstant(patternNode, scope), + flags = getStringIfConstant(flagsNode, scope); + + if (typeof pattern === "string") { + checkRegex(refNode, pattern, flags || ""); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-call.js b/node_modules/eslint/lib/rules/no-useless-call.js new file mode 100644 index 0000000..dea2b47 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-call.js @@ -0,0 +1,90 @@ +/** + * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.call()`/`.apply()`. + * @param {ASTNode} node A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`. + */ +function isCallOrNonVariadicApply(node) { + const callee = astUtils.skipChainExpression(node.callee); + + return ( + callee.type === "MemberExpression" && + callee.property.type === "Identifier" && + callee.computed === false && + ( + (callee.property.name === "call" && node.arguments.length >= 1) || + (callee.property.name === "apply" && node.arguments.length === 2 && node.arguments[1].type === "ArrayExpression") + ) + ); +} + + +/** + * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.call()`/`.apply()`. + * @param {SourceCode} sourceCode The ESLint source code object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, sourceCode) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return astUtils.equalTokens(expectedThis, thisArg, sourceCode); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unnecessary calls to `.call()` and `.apply()`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-useless-call" + }, + + schema: [], + + messages: { + unnecessaryCall: "Unnecessary '.{{name}}()'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + CallExpression(node) { + if (!isCallOrNonVariadicApply(node)) { + return; + } + + const callee = astUtils.skipChainExpression(node.callee); + const applied = astUtils.skipChainExpression(callee.object); + const expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + const thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, sourceCode)) { + context.report({ node, messageId: "unnecessaryCall", data: { name: callee.property.name } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-catch.js b/node_modules/eslint/lib/rules/no-useless-catch.js new file mode 100644 index 0000000..e02013d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-catch.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Reports useless `catch` clauses that just rethrow their error. + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unnecessary `catch` clauses", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-useless-catch" + }, + + schema: [], + + messages: { + unnecessaryCatchClause: "Unnecessary catch clause.", + unnecessaryCatch: "Unnecessary try/catch wrapper." + } + }, + + create(context) { + return { + CatchClause(node) { + if ( + node.param && + node.param.type === "Identifier" && + node.body.body.length && + node.body.body[0].type === "ThrowStatement" && + node.body.body[0].argument.type === "Identifier" && + node.body.body[0].argument.name === node.param.name + ) { + if (node.parent.finalizer) { + context.report({ + node, + messageId: "unnecessaryCatchClause" + }); + } else { + context.report({ + node: node.parent, + messageId: "unnecessaryCatch" + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-computed-key.js b/node_modules/eslint/lib/rules/no-useless-computed-key.js new file mode 100644 index 0000000..3f537ca --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-computed-key.js @@ -0,0 +1,175 @@ +/** + * @fileoverview Rule to disallow unnecessary computed property keys in object literals + * @author Burak Yigit Kaya + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the computed key syntax is unnecessarily used for the given node. + * In particular, it determines whether removing the square brackets and using the content between them + * directly as the key (e.g. ['foo'] -> 'foo') would produce valid syntax and preserve the same behavior. + * Valid non-computed keys are only: identifiers, number literals and string literals. + * Only literals can preserve the same behavior, with a few exceptions for specific node types: + * Property + * - { ["__proto__"]: foo } defines a property named "__proto__" + * { "__proto__": foo } defines object's prototype + * PropertyDefinition + * - class C { ["constructor"]; } defines an instance field named "constructor" + * class C { "constructor"; } produces a parsing error + * - class C { static ["constructor"]; } defines a static field named "constructor" + * class C { static "constructor"; } produces a parsing error + * - class C { static ["prototype"]; } produces a runtime error (doesn't break the whole script) + * class C { static "prototype"; } produces a parsing error (breaks the whole script) + * MethodDefinition + * - class C { ["constructor"]() {} } defines a prototype method named "constructor" + * class C { "constructor"() {} } defines the constructor + * - class C { static ["prototype"]() {} } produces a runtime error (doesn't break the whole script) + * class C { static "prototype"() {} } produces a parsing error (breaks the whole script) + * @param {ASTNode} node The node to check. It can be `Property`, `PropertyDefinition` or `MethodDefinition`. + * @throws {Error} (Unreachable.) + * @returns {void} `true` if the node has useless computed key. + */ +function hasUselessComputedKey(node) { + if (!node.computed) { + return false; + } + + const { key } = node; + + if (key.type !== "Literal") { + return false; + } + + const { value } = key; + + if (typeof value !== "number" && typeof value !== "string") { + return false; + } + + switch (node.type) { + case "Property": + if (node.parent.type === "ObjectExpression") { + return value !== "__proto__"; + } + return true; + + case "PropertyDefinition": + if (node.static) { + return value !== "constructor" && value !== "prototype"; + } + + return value !== "constructor"; + + case "MethodDefinition": + if (node.static) { + return value !== "prototype"; + } + + return value !== "constructor"; + + /* c8 ignore next */ + default: + throw new Error(`Unexpected node type: ${node.type}`); + } + +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + enforceForClassMembers: true + }], + + docs: { + description: "Disallow unnecessary computed property keys in objects and classes", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-useless-computed-key" + }, + + schema: [{ + type: "object", + properties: { + enforceForClassMembers: { + type: "boolean" + } + }, + additionalProperties: false + }], + fixable: "code", + + messages: { + unnecessarilyComputedProperty: "Unnecessarily computed property [{{property}}] found." + } + }, + create(context) { + const sourceCode = context.sourceCode; + const [{ enforceForClassMembers }] = context.options; + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function check(node) { + if (hasUselessComputedKey(node)) { + const { key } = node; + + context.report({ + node, + messageId: "unnecessarilyComputedProperty", + data: { property: sourceCode.getText(key) }, + fix(fixer) { + const leftSquareBracket = sourceCode.getTokenBefore(key, astUtils.isOpeningBracketToken); + const rightSquareBracket = sourceCode.getTokenAfter(key, astUtils.isClosingBracketToken); + + // If there are comments between the brackets and the property name, don't do a fix. + if (sourceCode.commentsExistBetween(leftSquareBracket, rightSquareBracket)) { + return null; + } + + const tokenBeforeLeftBracket = sourceCode.getTokenBefore(leftSquareBracket); + + // Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} }) + const needsSpaceBeforeKey = tokenBeforeLeftBracket.range[1] === leftSquareBracket.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeLeftBracket, sourceCode.getFirstToken(key)); + + const replacementKey = (needsSpaceBeforeKey ? " " : "") + key.raw; + + return fixer.replaceTextRange([leftSquareBracket.range[0], rightSquareBracket.range[1]], replacementKey); + } + }); + } + } + + /** + * A no-op function to act as placeholder for checking a node when the `enforceForClassMembers` option is `false`. + * @returns {void} + * @private + */ + function noop() {} + + return { + Property: check, + MethodDefinition: enforceForClassMembers ? check : noop, + PropertyDefinition: enforceForClassMembers ? check : noop + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-concat.js b/node_modules/eslint/lib/rules/no-useless-concat.js new file mode 100644 index 0000000..b25ed25 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-concat.js @@ -0,0 +1,116 @@ +/** + * @fileoverview disallow unnecessary concatenation of template strings + * @author Henry Zhu + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Checks if the given token is a `+` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `+` token. + */ +function isConcatOperatorToken(token) { + return token.value === "+" && token.type === "Punctuator"; +} + +/** + * Get's the right most node on the left side of a BinaryExpression with + operator. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getLeft(node) { + let left = node.left; + + while (isConcatenation(left)) { + left = left.right; + } + return left; +} + +/** + * Get's the left most node on the right side of a BinaryExpression with + operator. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getRight(node) { + let right = node.right; + + while (isConcatenation(right)) { + right = right.left; + } + return right; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unnecessary concatenation of literals or template literals", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-useless-concat" + }, + + schema: [], + + messages: { + unexpectedConcat: "Unexpected string concatenation of literals." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + BinaryExpression(node) { + + // check if not concatenation + if (node.operator !== "+") { + return; + } + + // account for the `foo + "a" + "b"` case + const left = getLeft(node); + const right = getRight(node); + + if (astUtils.isStringLiteral(left) && + astUtils.isStringLiteral(right) && + astUtils.isTokenOnSameLine(left, right) + ) { + const operatorToken = sourceCode.getFirstTokenBetween(left, right, isConcatOperatorToken); + + context.report({ + node, + loc: operatorToken.loc, + messageId: "unexpectedConcat" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-constructor.js b/node_modules/eslint/lib/rules/no-useless-constructor.js new file mode 100644 index 0000000..2c063ca --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-constructor.js @@ -0,0 +1,205 @@ +/** + * @fileoverview Rule to flag the use of redundant constructors in classes. + * @author Alberto Rodríguez + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a given array of statements is a single call of `super`. + * @param {ASTNode[]} body An array of statements to check. + * @returns {boolean} `true` if the body is a single call of `super`. + */ +function isSingleSuperCall(body) { + return ( + body.length === 1 && + body[0].type === "ExpressionStatement" && + body[0].expression.type === "CallExpression" && + body[0].expression.callee.type === "Super" + ); +} + +/** + * Checks whether a given node is a pattern which doesn't have any side effects. + * Default parameters and Destructuring parameters can have side effects. + * @param {ASTNode} node A pattern node. + * @returns {boolean} `true` if the node doesn't have any side effects. + */ +function isSimple(node) { + return node.type === "Identifier" || node.type === "RestElement"; +} + +/** + * Checks whether a given array of expressions is `...arguments` or not. + * `super(...arguments)` passes all arguments through. + * @param {ASTNode[]} superArgs An array of expressions to check. + * @returns {boolean} `true` if the superArgs is `...arguments`. + */ +function isSpreadArguments(superArgs) { + return ( + superArgs.length === 1 && + superArgs[0].type === "SpreadElement" && + superArgs[0].argument.type === "Identifier" && + superArgs[0].argument.name === "arguments" + ); +} + +/** + * Checks whether given 2 nodes are identifiers which have the same name or not. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes are identifiers which have the same + * name. + */ +function isValidIdentifierPair(ctorParam, superArg) { + return ( + ctorParam.type === "Identifier" && + superArg.type === "Identifier" && + ctorParam.name === superArg.name + ); +} + +/** + * Checks whether given 2 nodes are a rest/spread pair which has the same values. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes are a rest/spread pair which has the + * same values. + */ +function isValidRestSpreadPair(ctorParam, superArg) { + return ( + ctorParam.type === "RestElement" && + superArg.type === "SpreadElement" && + isValidIdentifierPair(ctorParam.argument, superArg.argument) + ); +} + +/** + * Checks whether given 2 nodes have the same value or not. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes have the same value or not. + */ +function isValidPair(ctorParam, superArg) { + return ( + isValidIdentifierPair(ctorParam, superArg) || + isValidRestSpreadPair(ctorParam, superArg) + ); +} + +/** + * Checks whether the parameters of a constructor and the arguments of `super()` + * have the same values or not. + * @param {ASTNode} ctorParams The parameters of a constructor to check. + * @param {ASTNode} superArgs The arguments of `super()` to check. + * @returns {boolean} `true` if those have the same values. + */ +function isPassingThrough(ctorParams, superArgs) { + if (ctorParams.length !== superArgs.length) { + return false; + } + + for (let i = 0; i < ctorParams.length; ++i) { + if (!isValidPair(ctorParams[i], superArgs[i])) { + return false; + } + } + + return true; +} + +/** + * Checks whether the constructor body is a redundant super call. + * @param {Array} body constructor body content. + * @param {Array} ctorParams The params to check against super call. + * @returns {boolean} true if the constructor body is redundant + */ +function isRedundantSuperCall(body, ctorParams) { + return ( + isSingleSuperCall(body) && + ctorParams.every(isSimple) && + ( + isSpreadArguments(body[0].expression.arguments) || + isPassingThrough(ctorParams, body[0].expression.arguments) + ) + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unnecessary constructors", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-useless-constructor" + }, + + hasSuggestions: true, + + schema: [], + + messages: { + noUselessConstructor: "Useless constructor.", + removeConstructor: "Remove the constructor." + } + }, + + create(context) { + + /** + * Checks whether a node is a redundant constructor + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkForConstructor(node) { + if (node.kind !== "constructor") { + return; + } + + /* + * Prevent crashing on parsers which do not require class constructor + * to have a body, e.g. typescript and flow + */ + if (!node.value.body) { + return; + } + + const body = node.value.body.body; + const ctorParams = node.value.params; + const superClass = node.parent.parent.superClass; + + if (superClass ? isRedundantSuperCall(body, ctorParams) : (body.length === 0)) { + context.report({ + node, + messageId: "noUselessConstructor", + suggest: [ + { + messageId: "removeConstructor", + *fix(fixer) { + const nextToken = context.sourceCode.getTokenAfter(node); + const addSemiColon = nextToken.type === "Punctuator" && nextToken.value === "[" && astUtils.needsPrecedingSemicolon(context.sourceCode, node); + + yield fixer.replaceText(node, addSemiColon ? ";" : ""); + } + } + ] + }); + } + } + + return { + MethodDefinition: checkForConstructor + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-escape.js b/node_modules/eslint/lib/rules/no-useless-escape.js new file mode 100644 index 0000000..0e0f6f0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-escape.js @@ -0,0 +1,333 @@ +/** + * @fileoverview Look for useless escapes in strings and regexes + * @author Onur Temizkan + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); +const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); + +/** + * @typedef {import('@eslint-community/regexpp').AST.CharacterClass} CharacterClass + * @typedef {import('@eslint-community/regexpp').AST.ExpressionCharacterClass} ExpressionCharacterClass + */ +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns the union of two sets. + * @param {Set} setA The first set + * @param {Set} setB The second set + * @returns {Set} The union of the two sets + */ +function union(setA, setB) { + return new Set(function *() { + yield* setA; + yield* setB; + }()); +} + +const VALID_STRING_ESCAPES = union(new Set("\\nrvtbfux"), astUtils.LINEBREAKS); +const REGEX_GENERAL_ESCAPES = new Set("\\bcdDfnpPrsStvwWxu0123456789]"); +const REGEX_NON_CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("^/.$*+?[{}|()Bk")); + +/* + * Set of characters that require escaping in character classes in `unicodeSets` mode. + * ( ) [ ] { } / - \ | are ClassSetSyntaxCharacter + */ +const REGEX_CLASSSET_CHARACTER_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("q/[{}|()-")); + +/* + * A single character set of ClassSetReservedDoublePunctuator. + * && !! ## $$ %% ** ++ ,, .. :: ;; << == >> ?? @@ ^^ `` ~~ are ClassSetReservedDoublePunctuator + */ +const REGEX_CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR = new Set("!#$%&*+,.:;<=>?@^`~"); + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow unnecessary escape characters", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-useless-escape" + }, + + hasSuggestions: true, + + messages: { + unnecessaryEscape: "Unnecessary escape character: \\{{character}}.", + removeEscape: "Remove the `\\`. This maintains the current functionality.", + removeEscapeDoNotKeepSemantics: "Remove the `\\` if it was inserted by mistake.", + escapeBackslash: "Replace the `\\` with `\\\\` to include the actual backslash character." + }, + + schema: [] + }, + + create(context) { + const sourceCode = context.sourceCode; + const parser = new RegExpParser(); + + /** + * Reports a node + * @param {ASTNode} node The node to report + * @param {number} startOffset The backslash's offset from the start of the node + * @param {string} character The uselessly escaped character (not including the backslash) + * @param {boolean} [disableEscapeBackslashSuggest] `true` if escapeBackslash suggestion should be turned off. + * @returns {void} + */ + function report(node, startOffset, character, disableEscapeBackslashSuggest) { + const rangeStart = node.range[0] + startOffset; + const range = [rangeStart, rangeStart + 1]; + const start = sourceCode.getLocFromIndex(rangeStart); + + context.report({ + node, + loc: { + start, + end: { line: start.line, column: start.column + 1 } + }, + messageId: "unnecessaryEscape", + data: { character }, + suggest: [ + { + + // Removing unnecessary `\` characters in a directive is not guaranteed to maintain functionality. + messageId: astUtils.isDirective(node.parent) + ? "removeEscapeDoNotKeepSemantics" : "removeEscape", + fix(fixer) { + return fixer.removeRange(range); + } + }, + ...disableEscapeBackslashSuggest + ? [] + : [ + { + messageId: "escapeBackslash", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\\"); + } + } + ] + ] + }); + } + + /** + * Checks if the escape character in given string slice is unnecessary. + * @private + * @param {ASTNode} node node to validate. + * @param {string} match string slice to validate. + * @returns {void} + */ + function validateString(node, match) { + const isTemplateElement = node.type === "TemplateElement"; + const escapedChar = match[0][1]; + let isUnnecessaryEscape = !VALID_STRING_ESCAPES.has(escapedChar); + let isQuoteEscape; + + if (isTemplateElement) { + isQuoteEscape = escapedChar === "`"; + + if (escapedChar === "$") { + + // Warn if `\$` is not followed by `{` + isUnnecessaryEscape = match.input[match.index + 2] !== "{"; + } else if (escapedChar === "{") { + + /* + * Warn if `\{` is not preceded by `$`. If preceded by `$`, escaping + * is necessary and the rule should not warn. If preceded by `/$`, the rule + * will warn for the `/$` instead, as it is the first unnecessarily escaped character. + */ + isUnnecessaryEscape = match.input[match.index - 1] !== "$"; + } + } else { + isQuoteEscape = escapedChar === node.raw[0]; + } + + if (isUnnecessaryEscape && !isQuoteEscape) { + report(node, match.index, match[0].slice(1)); + } + } + + /** + * Checks if the escape character in given regexp is unnecessary. + * @private + * @param {ASTNode} node node to validate. + * @returns {void} + */ + function validateRegExp(node) { + const { pattern, flags } = node.regex; + let patternNode; + const unicode = flags.includes("u"); + const unicodeSets = flags.includes("v"); + + try { + patternNode = parser.parsePattern(pattern, 0, pattern.length, { unicode, unicodeSets }); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + /** @type {(CharacterClass | ExpressionCharacterClass)[]} */ + const characterClassStack = []; + + visitRegExpAST(patternNode, { + onCharacterClassEnter: characterClassNode => characterClassStack.unshift(characterClassNode), + onCharacterClassLeave: () => characterClassStack.shift(), + onExpressionCharacterClassEnter: characterClassNode => characterClassStack.unshift(characterClassNode), + onExpressionCharacterClassLeave: () => characterClassStack.shift(), + onCharacterEnter(characterNode) { + if (!characterNode.raw.startsWith("\\")) { + + // It's not an escaped character. + return; + } + + const escapedChar = characterNode.raw.slice(1); + + if (escapedChar !== String.fromCodePoint(characterNode.value)) { + + // It's a valid escape. + return; + } + let allowedEscapes; + + if (characterClassStack.length) { + allowedEscapes = unicodeSets ? REGEX_CLASSSET_CHARACTER_ESCAPES : REGEX_GENERAL_ESCAPES; + } else { + allowedEscapes = REGEX_NON_CHARCLASS_ESCAPES; + } + if (allowedEscapes.has(escapedChar)) { + return; + } + + const reportedIndex = characterNode.start + 1; + let disableEscapeBackslashSuggest = false; + + if (characterClassStack.length) { + const characterClassNode = characterClassStack[0]; + + if (escapedChar === "^") { + + /* + * The '^' character is also a special case; it must always be escaped outside of character classes, but + * it only needs to be escaped in character classes if it's at the beginning of the character class. To + * account for this, consider it to be a valid escape character outside of character classes, and filter + * out '^' characters that appear at the start of a character class. + */ + if (characterClassNode.start + 1 === characterNode.start) { + + return; + } + } + if (!unicodeSets) { + if (escapedChar === "-") { + + /* + * The '-' character is a special case, because it's only valid to escape it if it's in a character + * class, and is not at either edge of the character class. To account for this, don't consider '-' + * characters to be valid in general, and filter out '-' characters that appear in the middle of a + * character class. + */ + if (characterClassNode.start + 1 !== characterNode.start && characterNode.end !== characterClassNode.end - 1) { + + return; + } + } + } else { // unicodeSets mode + if (REGEX_CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR.has(escapedChar)) { + + // Escaping is valid if it is a ClassSetReservedDoublePunctuator. + if (pattern[characterNode.end] === escapedChar) { + return; + } + if (pattern[characterNode.start - 1] === escapedChar) { + if (escapedChar !== "^") { + return; + } + + // If the previous character is a `negate` caret(`^`), escape to caret is unnecessary. + + if (!characterClassNode.negate) { + return; + } + const negateCaretIndex = characterClassNode.start + 1; + + if (negateCaretIndex < characterNode.start - 1) { + return; + } + } + } + + if (characterNode.parent.type === "ClassIntersection" || characterNode.parent.type === "ClassSubtraction") { + disableEscapeBackslashSuggest = true; + } + } + } + + report( + node, + reportedIndex, + escapedChar, + disableEscapeBackslashSuggest + ); + } + }); + } + + /** + * Checks if a node has an escape. + * @param {ASTNode} node node to check. + * @returns {void} + */ + function check(node) { + const isTemplateElement = node.type === "TemplateElement"; + + if ( + isTemplateElement && + node.parent && + node.parent.parent && + node.parent.parent.type === "TaggedTemplateExpression" && + node.parent === node.parent.parent.quasi + ) { + + // Don't report tagged template literals, because the backslash character is accessible to the tag function. + return; + } + + if (typeof node.value === "string" || isTemplateElement) { + + /* + * JSXAttribute doesn't have any escape sequence: https://facebook.github.io/jsx/. + * In addition, backticks are not supported by JSX yet: https://github.com/facebook/jsx/issues/25. + */ + if (node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment") { + return; + } + + const value = isTemplateElement ? sourceCode.getText(node) : node.raw; + const pattern = /\\[^\d]/gu; + let match; + + while ((match = pattern.exec(value))) { + validateString(node, match); + } + } else if (node.regex) { + validateRegExp(node); + } + + } + + return { + Literal: check, + TemplateElement: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-rename.js b/node_modules/eslint/lib/rules/no-useless-rename.js new file mode 100644 index 0000000..2bde823 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-rename.js @@ -0,0 +1,175 @@ +/** + * @fileoverview Disallow renaming import, export, and destructured assignments to the same name. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + ignoreDestructuring: false, + ignoreImport: false, + ignoreExport: false + }], + + docs: { + description: "Disallow renaming import, export, and destructured assignments to the same name", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-useless-rename" + }, + + fixable: "code", + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { type: "boolean" }, + ignoreImport: { type: "boolean" }, + ignoreExport: { type: "boolean" } + }, + additionalProperties: false + } + ], + + messages: { + unnecessarilyRenamed: "{{type}} {{name}} unnecessarily renamed." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const [{ ignoreDestructuring, ignoreImport, ignoreExport }] = context.options; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports error for unnecessarily renamed assignments + * @param {ASTNode} node node to report + * @param {ASTNode} initial node with initial name value + * @param {string} type the type of the offending node + * @returns {void} + */ + function reportError(node, initial, type) { + const name = initial.type === "Identifier" ? initial.name : initial.value; + + return context.report({ + node, + messageId: "unnecessarilyRenamed", + data: { + name, + type + }, + fix(fixer) { + const replacementNode = node.type === "Property" ? node.value : node.local; + + if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(replacementNode).length) { + return null; + } + + // Don't autofix code such as `({foo: (foo) = a} = obj);`, parens are not allowed in shorthand properties. + if ( + replacementNode.type === "AssignmentPattern" && + astUtils.isParenthesised(sourceCode, replacementNode.left) + ) { + return null; + } + + return fixer.replaceText(node, sourceCode.getText(replacementNode)); + } + }); + } + + /** + * Checks whether a destructured assignment is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkDestructured(node) { + if (ignoreDestructuring) { + return; + } + + for (const property of node.properties) { + + /** + * Properties using shorthand syntax and rest elements can not be renamed. + * If the property is computed, we have no idea if a rename is useless or not. + */ + if (property.type !== "Property" || property.shorthand || property.computed) { + continue; + } + + const key = (property.key.type === "Identifier" && property.key.name) || (property.key.type === "Literal" && property.key.value); + const renamedKey = property.value.type === "AssignmentPattern" ? property.value.left.name : property.value.name; + + if (key === renamedKey) { + reportError(property, property.key, "Destructuring assignment"); + } + } + } + + /** + * Checks whether an import is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkImport(node) { + if (ignoreImport) { + return; + } + + if ( + node.imported.range[0] !== node.local.range[0] && + astUtils.getModuleExportName(node.imported) === node.local.name + ) { + reportError(node, node.imported, "Import"); + } + } + + /** + * Checks whether an export is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkExport(node) { + if (ignoreExport) { + return; + } + + if ( + node.local.range[0] !== node.exported.range[0] && + astUtils.getModuleExportName(node.local) === astUtils.getModuleExportName(node.exported) + ) { + reportError(node, node.local, "Export"); + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ObjectPattern: checkDestructured, + ImportSpecifier: checkImport, + ExportSpecifier: checkExport + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-return.js b/node_modules/eslint/lib/rules/no-useless-return.js new file mode 100644 index 0000000..1f85cdb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-return.js @@ -0,0 +1,369 @@ +/** + * @fileoverview Disallow redundant return statements + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + FixTracker = require("./utils/fix-tracker"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Removes the given element from the array. + * @param {Array} array The source array to remove. + * @param {any} element The target item to remove. + * @returns {void} + */ +function remove(array, element) { + const index = array.indexOf(element); + + if (index !== -1) { + array.splice(index, 1); + } +} + +/** + * Checks whether it can remove the given return statement or not. + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if the node is removable. + */ +function isRemovable(node) { + return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type); +} + +/** + * Checks whether the given return statement is in a `finally` block or not. + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if the node is in a `finally` block. + */ +function isInFinally(node) { + for ( + let currentNode = node; + currentNode && currentNode.parent && !astUtils.isFunction(currentNode); + currentNode = currentNode.parent + ) { + if (currentNode.parent.type === "TryStatement" && currentNode.parent.finalizer === currentNode) { + return true; + } + } + + return false; +} + +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow redundant return statements", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-useless-return" + }, + + fixable: "code", + schema: [], + + messages: { + unnecessaryReturn: "Unnecessary return statement." + } + }, + + create(context) { + const segmentInfoMap = new WeakMap(); + const sourceCode = context.sourceCode; + let scopeInfo = null; + + /** + * Checks whether the given segment is terminated by a return statement or not. + * @param {CodePathSegment} segment The segment to check. + * @returns {boolean} `true` if the segment is terminated by a return statement, or if it's still a part of unreachable. + */ + function isReturned(segment) { + const info = segmentInfoMap.get(segment); + + return !info || info.returned; + } + + /** + * Collects useless return statements from the given previous segments. + * + * A previous segment may be an unreachable segment. + * In that case, the information object of the unreachable segment is not + * initialized because `onCodePathSegmentStart` event is not notified for + * unreachable segments. + * This goes to the previous segments of the unreachable segment recursively + * if the unreachable segment was generated by a return statement. Otherwise, + * this ignores the unreachable segment. + * + * This behavior would simulate code paths for the case that the return + * statement does not exist. + * @param {ASTNode[]} uselessReturns The collected return statements. + * @param {CodePathSegment[]} prevSegments The previous segments to traverse. + * @param {WeakSet} [providedTraversedSegments] A set of segments that have already been traversed in this call + * @returns {ASTNode[]} `uselessReturns`. + */ + function getUselessReturns(uselessReturns, prevSegments, providedTraversedSegments) { + const traversedSegments = providedTraversedSegments || new WeakSet(); + + for (const segment of prevSegments) { + if (!segment.reachable) { + if (!traversedSegments.has(segment)) { + traversedSegments.add(segment); + getUselessReturns( + uselessReturns, + segment.allPrevSegments.filter(isReturned), + traversedSegments + ); + } + continue; + } + + if (segmentInfoMap.has(segment)) { + uselessReturns.push(...segmentInfoMap.get(segment).uselessReturns); + } + } + + return uselessReturns; + } + + /** + * Removes the return statements on the given segment from the useless return + * statement list. + * + * This segment may be an unreachable segment. + * In that case, the information object of the unreachable segment is not + * initialized because `onCodePathSegmentStart` event is not notified for + * unreachable segments. + * This goes to the previous segments of the unreachable segment recursively + * if the unreachable segment was generated by a return statement. Otherwise, + * this ignores the unreachable segment. + * + * This behavior would simulate code paths for the case that the return + * statement does not exist. + * @param {CodePathSegment} segment The segment to get return statements. + * @param {Set} usedUnreachableSegments A set of segments that have already been traversed in this call. + * @returns {void} + */ + function markReturnStatementsOnSegmentAsUsed(segment, usedUnreachableSegments) { + if (!segment.reachable) { + usedUnreachableSegments.add(segment); + segment.allPrevSegments + .filter(isReturned) + .filter(prevSegment => !usedUnreachableSegments.has(prevSegment)) + .forEach(prevSegment => markReturnStatementsOnSegmentAsUsed(prevSegment, usedUnreachableSegments)); + return; + } + + const info = segmentInfoMap.get(segment); + + if (!info) { + return; + } + + info.uselessReturns = info.uselessReturns.filter(node => { + if (scopeInfo.traversedTryBlockStatements && scopeInfo.traversedTryBlockStatements.length > 0) { + const returnInitialRange = node.range[0]; + const returnFinalRange = node.range[1]; + + const areBlocksInRange = scopeInfo.traversedTryBlockStatements.some(tryBlockStatement => { + const blockInitialRange = tryBlockStatement.range[0]; + const blockFinalRange = tryBlockStatement.range[1]; + + return ( + returnInitialRange >= blockInitialRange && + returnFinalRange <= blockFinalRange + ); + }); + + if (areBlocksInRange) { + return true; + } + } + + remove(scopeInfo.uselessReturns, node); + return false; + }); + } + + /** + * Removes the return statements on the current segments from the useless + * return statement list. + * + * This function will be called at every statement except FunctionDeclaration, + * BlockStatement, and BreakStatement. + * + * - FunctionDeclarations are always executed whether it's returned or not. + * - BlockStatements do nothing. + * - BreakStatements go the next merely. + * @returns {void} + */ + function markReturnStatementsOnCurrentSegmentsAsUsed() { + scopeInfo + .currentSegments + .forEach(segment => markReturnStatementsOnSegmentAsUsed(segment, new Set())); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + // Makes and pushes a new scope information. + onCodePathStart(codePath) { + scopeInfo = { + upper: scopeInfo, + uselessReturns: [], + traversedTryBlockStatements: [], + codePath, + currentSegments: new Set() + }; + }, + + // Reports useless return statements if exist. + onCodePathEnd() { + for (const node of scopeInfo.uselessReturns) { + context.report({ + node, + loc: node.loc, + messageId: "unnecessaryReturn", + fix(fixer) { + if (isRemovable(node) && !sourceCode.getCommentsInside(node).length) { + + /* + * Extend the replacement range to include the + * entire function to avoid conflicting with + * no-else-return. + * https://github.com/eslint/eslint/issues/8026 + */ + return new FixTracker(fixer, sourceCode) + .retainEnclosingFunction(node) + .remove(node); + } + return null; + } + }); + } + + scopeInfo = scopeInfo.upper; + }, + + /* + * Initializes segments. + * NOTE: This event is notified for only reachable segments. + */ + onCodePathSegmentStart(segment) { + scopeInfo.currentSegments.add(segment); + + const info = { + uselessReturns: getUselessReturns([], segment.allPrevSegments), + returned: false + }; + + // Stores the info. + segmentInfoMap.set(segment, info); + }, + + onUnreachableCodePathSegmentStart(segment) { + scopeInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + scopeInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + scopeInfo.currentSegments.delete(segment); + }, + + // Adds ReturnStatement node to check whether it's useless or not. + ReturnStatement(node) { + if (node.argument) { + markReturnStatementsOnCurrentSegmentsAsUsed(); + } + if ( + node.argument || + astUtils.isInLoop(node) || + isInFinally(node) || + + // Ignore `return` statements in unreachable places (https://github.com/eslint/eslint/issues/11647). + !isAnySegmentReachable(scopeInfo.currentSegments) + ) { + return; + } + + for (const segment of scopeInfo.currentSegments) { + const info = segmentInfoMap.get(segment); + + if (info) { + info.uselessReturns.push(node); + info.returned = true; + } + } + scopeInfo.uselessReturns.push(node); + }, + + "TryStatement > BlockStatement.block:exit"(node) { + scopeInfo.traversedTryBlockStatements.push(node); + }, + + "TryStatement:exit"() { + scopeInfo.traversedTryBlockStatements.pop(); + }, + + /* + * Registers for all statement nodes except FunctionDeclaration, BlockStatement, BreakStatement. + * Removes return statements of the current segments from the useless return statement list. + */ + ClassDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ContinueStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + DebuggerStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + DoWhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + EmptyStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ExpressionStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForInStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForOfStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + IfStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ImportDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + LabeledStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + SwitchStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ThrowStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + TryStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + VariableDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + WhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + WithStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportNamedDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportDefaultDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportAllDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-var.js b/node_modules/eslint/lib/rules/no-var.js new file mode 100644 index 0000000..d45a91a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-var.js @@ -0,0 +1,334 @@ +/** + * @fileoverview Rule to check for the usage of var. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Check whether a given variable is a global variable or not. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is a global variable. + */ +function isGlobal(variable) { + return Boolean(variable.scope) && variable.scope.type === "global"; +} + +/** + * Finds the nearest function scope or global scope walking up the scope + * hierarchy. + * @param {eslint-scope.Scope} scope The scope to traverse. + * @returns {eslint-scope.Scope} a function scope or global scope containing the given + * scope. + */ +function getEnclosingFunctionScope(scope) { + let currentScope = scope; + + while (currentScope.type !== "function" && currentScope.type !== "global") { + currentScope = currentScope.upper; + } + return currentScope; +} + +/** + * Checks whether the given variable has any references from a more specific + * function expression (i.e. a closure). + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is used from a closure. + */ +function isReferencedInClosure(variable) { + const enclosingFunctionScope = getEnclosingFunctionScope(variable.scope); + + return variable.references.some(reference => + getEnclosingFunctionScope(reference.from) !== enclosingFunctionScope); +} + +/** + * Checks whether the given node is the assignee of a loop. + * @param {ASTNode} node A VariableDeclaration node to check. + * @returns {boolean} `true` if the declaration is assigned as part of loop + * iteration. + */ +function isLoopAssignee(node) { + return (node.parent.type === "ForOfStatement" || node.parent.type === "ForInStatement") && + node === node.parent.left; +} + +/** + * Checks whether the given variable declaration is immediately initialized. + * @param {ASTNode} node A VariableDeclaration node to check. + * @returns {boolean} `true` if the declaration has an initializer. + */ +function isDeclarationInitialized(node) { + return node.declarations.every(declarator => declarator.init !== null); +} + +const SCOPE_NODE_TYPE = /^(?:Program|BlockStatement|SwitchStatement|ForStatement|ForInStatement|ForOfStatement)$/u; + +/** + * Gets the scope node which directly contains a given node. + * @param {ASTNode} node A node to get. This is a `VariableDeclaration` or + * an `Identifier`. + * @returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`, + * `SwitchStatement`, `ForStatement`, `ForInStatement`, and + * `ForOfStatement`. + */ +function getScopeNode(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if (SCOPE_NODE_TYPE.test(currentNode.type)) { + return currentNode; + } + } + + /* c8 ignore next */ + return null; +} + +/** + * Checks whether a given variable is redeclared or not. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is redeclared. + */ +function isRedeclared(variable) { + return variable.defs.length >= 2; +} + +/** + * Checks whether a given variable is used from outside of the specified scope. + * @param {ASTNode} scopeNode A scope node to check. + * @returns {Function} The predicate function which checks whether a given + * variable is used from outside of the specified scope. + */ +function isUsedFromOutsideOf(scopeNode) { + + /** + * Checks whether a given reference is inside of the specified scope or not. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the specified + * scope. + */ + function isOutsideOfScope(reference) { + const scope = scopeNode.range; + const id = reference.identifier.range; + + return id[0] < scope[0] || id[1] > scope[1]; + } + + return function(variable) { + return variable.references.some(isOutsideOfScope); + }; +} + +/** + * Creates the predicate function which checks whether a variable has their references in TDZ. + * + * The predicate function would return `true`: + * + * - if a reference is before the declarator. E.g. (var a = b, b = 1;)(var {a = b, b} = {};) + * - if a reference is in the expression of their default value. E.g. (var {a = a} = {};) + * - if a reference is in the expression of their initializer. E.g. (var a = a;) + * @param {ASTNode} node The initializer node of VariableDeclarator. + * @returns {Function} The predicate function. + * @private + */ +function hasReferenceInTDZ(node) { + const initStart = node.range[0]; + const initEnd = node.range[1]; + + return variable => { + const id = variable.defs[0].name; + const idStart = id.range[0]; + const defaultValue = (id.parent.type === "AssignmentPattern" ? id.parent.right : null); + const defaultStart = defaultValue && defaultValue.range[0]; + const defaultEnd = defaultValue && defaultValue.range[1]; + + return variable.references.some(reference => { + const start = reference.identifier.range[0]; + const end = reference.identifier.range[1]; + + return !reference.init && ( + start < idStart || + (defaultValue !== null && start >= defaultStart && end <= defaultEnd) || + (!astUtils.isFunction(node) && start >= initStart && end <= initEnd) + ); + }); + }; +} + +/** + * Checks whether a given variable has name that is allowed for 'var' declarations, + * but disallowed for `let` declarations. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable has a disallowed name. + */ +function hasNameDisallowedForLetDeclarations(variable) { + return variable.name === "let"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require `let` or `const` instead of `var`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-var" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedVar: "Unexpected var, use let or const instead." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Checks whether the variables which are defined by the given declarator node have their references in TDZ. + * @param {ASTNode} declarator The VariableDeclarator node to check. + * @returns {boolean} `true` if one of the variables which are defined by the given declarator node have their references in TDZ. + */ + function hasSelfReferenceInTDZ(declarator) { + if (!declarator.init) { + return false; + } + const variables = sourceCode.getDeclaredVariables(declarator); + + return variables.some(hasReferenceInTDZ(declarator.init)); + } + + /** + * Checks whether it can fix a given variable declaration or not. + * It cannot fix if the following cases: + * + * - A variable is a global variable. + * - A variable is declared on a SwitchCase node. + * - A variable is redeclared. + * - A variable is used from outside the scope. + * - A variable is used from a closure within a loop. + * - A variable might be used before it is assigned within a loop. + * - A variable might be used in TDZ. + * - A variable is declared in statement position (e.g. a single-line `IfStatement`) + * - A variable has name that is disallowed for `let` declarations. + * + * ## A variable is declared on a SwitchCase node. + * + * If this rule modifies 'var' declarations on a SwitchCase node, it + * would generate the warnings of 'no-case-declarations' rule. And the + * 'eslint:recommended' preset includes 'no-case-declarations' rule, so + * this rule doesn't modify those declarations. + * + * ## A variable is redeclared. + * + * The language spec disallows redeclarations of `let` declarations. + * Those variables would cause syntax errors. + * + * ## A variable is used from outside the scope. + * + * The language spec disallows accesses from outside of the scope for + * `let` declarations. Those variables would cause reference errors. + * + * ## A variable is used from a closure within a loop. + * + * A `var` declaration within a loop shares the same variable instance + * across all loop iterations, while a `let` declaration creates a new + * instance for each iteration. This means if a variable in a loop is + * referenced by any closure, changing it from `var` to `let` would + * change the behavior in a way that is generally unsafe. + * + * ## A variable might be used before it is assigned within a loop. + * + * Within a loop, a `let` declaration without an initializer will be + * initialized to null, while a `var` declaration will retain its value + * from the previous iteration, so it is only safe to change `var` to + * `let` if we can statically determine that the variable is always + * assigned a value before its first access in the loop body. To keep + * the implementation simple, we only convert `var` to `let` within + * loops when the variable is a loop assignee or the declaration has an + * initializer. + * @param {ASTNode} node A variable declaration node to check. + * @returns {boolean} `true` if it can fix the node. + */ + function canFix(node) { + const variables = sourceCode.getDeclaredVariables(node); + const scopeNode = getScopeNode(node); + + if (node.parent.type === "SwitchCase" || + node.declarations.some(hasSelfReferenceInTDZ) || + variables.some(isGlobal) || + variables.some(isRedeclared) || + variables.some(isUsedFromOutsideOf(scopeNode)) || + variables.some(hasNameDisallowedForLetDeclarations) + ) { + return false; + } + + if (astUtils.isInLoop(node)) { + if (variables.some(isReferencedInClosure)) { + return false; + } + if (!isLoopAssignee(node) && !isDeclarationInitialized(node)) { + return false; + } + } + + if ( + !isLoopAssignee(node) && + !(node.parent.type === "ForStatement" && node.parent.init === node) && + !astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type) + ) { + + // If the declaration is not in a block, e.g. `if (foo) var bar = 1;`, then it can't be fixed. + return false; + } + + return true; + } + + /** + * Reports a given variable declaration node. + * @param {ASTNode} node A variable declaration node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "unexpectedVar", + + fix(fixer) { + const varToken = sourceCode.getFirstToken(node, { filter: t => t.value === "var" }); + + return canFix(node) + ? fixer.replaceText(varToken, "let") + : null; + } + }); + } + + return { + "VariableDeclaration:exit"(node) { + if (node.kind === "var") { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-void.js b/node_modules/eslint/lib/rules/no-void.js new file mode 100644 index 0000000..0ac8288 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-void.js @@ -0,0 +1,67 @@ +/** + * @fileoverview Rule to disallow use of void operator. + * @author Mike Sidorov + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allowAsStatement: false + }], + + docs: { + description: "Disallow `void` operators", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-void" + }, + + messages: { + noVoid: "Expected 'undefined' and instead saw 'void'." + }, + + schema: [ + { + type: "object", + properties: { + allowAsStatement: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const [{ allowAsStatement }] = context.options; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + 'UnaryExpression[operator="void"]'(node) { + if ( + allowAsStatement && + node.parent && + node.parent.type === "ExpressionStatement" + ) { + return; + } + context.report({ + node, + messageId: "noVoid" + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-warning-comments.js b/node_modules/eslint/lib/rules/no-warning-comments.js new file mode 100644 index 0000000..0e6a2f2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-warning-comments.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule that warns about used warning comments + * @author Alexander Schmidt + */ + +"use strict"; + +const escapeRegExp = require("escape-string-regexp"); +const astUtils = require("./utils/ast-utils"); + +const CHAR_LIMIT = 40; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + location: "start", + terms: ["todo", "fixme", "xxx"] + }], + + docs: { + description: "Disallow specified warning terms in comments", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/no-warning-comments" + }, + + schema: [ + { + type: "object", + properties: { + terms: { + type: "array", + items: { + type: "string" + } + }, + location: { + enum: ["start", "anywhere"] + }, + decoration: { + type: "array", + items: { + type: "string", + pattern: "^\\S$" + }, + minItems: 1, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedComment: "Unexpected '{{matchedTerm}}' comment: '{{comment}}'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const [{ decoration, location, terms: warningTerms }] = context.options; + const escapedDecoration = escapeRegExp(decoration ? decoration.join("") : ""); + const selfConfigRegEx = /\bno-warning-comments\b/u; + + /** + * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified + * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not + * require word boundaries on that side. + * @param {string} term A term to convert to a RegExp + * @returns {RegExp} The term converted to a RegExp + */ + function convertToRegExp(term) { + const escaped = escapeRegExp(term); + + /* + * When matching at the start, ignore leading whitespace, and + * there's no need to worry about word boundaries. + * + * These expressions for the prefix and suffix are designed as follows: + * ^ handles any terms at the beginning of a comment. + * e.g. terms ["TODO"] matches `//TODO something` + * $ handles any terms at the end of a comment + * e.g. terms ["TODO"] matches `// something TODO` + * \b handles terms preceded/followed by word boundary + * e.g. terms: ["!FIX", "FIX!"] matches `// FIX!something` or `// something!FIX` + * terms: ["FIX"] matches `// FIX!` or `// !FIX`, but not `// fixed or affix` + * + * For location start: + * [\s]* handles optional leading spaces + * e.g. terms ["TODO"] matches `// TODO something` + * [\s\*]* (where "\*" is the escaped string of decoration) + * handles optional leading spaces or decoration characters (for "start" location only) + * e.g. terms ["TODO"] matches `/**** TODO something ... ` + */ + const wordBoundary = "\\b"; + + let prefix = ""; + + if (location === "start") { + prefix = `^[\\s${escapedDecoration}]*`; + } else if (/^\w/u.test(term)) { + prefix = wordBoundary; + } + + const suffix = /\w$/u.test(term) ? wordBoundary : ""; + const flags = "iu"; // Case-insensitive with Unicode case folding. + + /* + * For location "start", the typical regex is: + * /^[\s]*ESCAPED_TERM\b/iu. + * Or if decoration characters are specified (e.g. "*"), then any of + * those characters may appear in any order at the start: + * /^[\s\*]*ESCAPED_TERM\b/iu. + * + * For location "anywhere" the typical regex is + * /\bESCAPED_TERM\b/iu + * + * If it starts or ends with non-word character, the prefix and suffix are empty, respectively. + */ + return new RegExp(`${prefix}${escaped}${suffix}`, flags); + } + + const warningRegExps = warningTerms.map(convertToRegExp); + + /** + * Checks the specified comment for matches of the configured warning terms and returns the matches. + * @param {string} comment The comment which is checked. + * @returns {Array} All matched warning terms for this comment. + */ + function commentContainsWarningTerm(comment) { + const matches = []; + + warningRegExps.forEach((regex, index) => { + if (regex.test(comment)) { + matches.push(warningTerms[index]); + } + }); + + return matches; + } + + /** + * Checks the specified node for matching warning comments and reports them. + * @param {ASTNode} node The AST node being checked. + * @returns {void} undefined. + */ + function checkComment(node) { + const comment = node.value; + + if ( + astUtils.isDirectiveComment(node) && + selfConfigRegEx.test(comment) + ) { + return; + } + + const matches = commentContainsWarningTerm(comment); + + matches.forEach(matchedTerm => { + let commentToDisplay = ""; + let truncated = false; + + for (const c of comment.trim().split(/\s+/u)) { + const tmp = commentToDisplay ? `${commentToDisplay} ${c}` : c; + + if (tmp.length <= CHAR_LIMIT) { + commentToDisplay = tmp; + } else { + truncated = true; + break; + } + } + + context.report({ + node, + messageId: "unexpectedComment", + data: { + matchedTerm, + comment: `${commentToDisplay}${ + truncated ? "..." : "" + }` + } + }); + }); + } + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments + .filter(token => token.type !== "Shebang") + .forEach(checkComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-whitespace-before-property.js b/node_modules/eslint/lib/rules/no-whitespace-before-property.js new file mode 100644 index 0000000..4cc77b5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-whitespace-before-property.js @@ -0,0 +1,134 @@ +/** + * @fileoverview Rule to disallow whitespace before properties + * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "no-whitespace-before-property", + url: "https://eslint.style/rules/js/no-whitespace-before-property" + } + } + ] + }, + type: "layout", + + docs: { + description: "Disallow whitespace before properties", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-whitespace-before-property" + }, + + fixable: "whitespace", + schema: [], + + messages: { + unexpectedWhitespace: "Unexpected whitespace before property {{propName}}." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports whitespace before property token + * @param {ASTNode} node the node to report in the event of an error + * @param {Token} leftToken the left token + * @param {Token} rightToken the right token + * @returns {void} + * @private + */ + function reportError(node, leftToken, rightToken) { + context.report({ + node, + messageId: "unexpectedWhitespace", + data: { + propName: sourceCode.getText(node.property) + }, + fix(fixer) { + let replacementText = ""; + + if (!node.computed && !node.optional && astUtils.isDecimalInteger(node.object)) { + + /* + * If the object is a number literal, fixing it to something like 5.toString() would cause a SyntaxError. + * Don't fix this case. + */ + return null; + } + + // Don't fix if comments exist. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + if (node.optional) { + replacementText = "?."; + } else if (!node.computed) { + replacementText = "."; + } + + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], replacementText); + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + MemberExpression(node) { + let rightToken; + let leftToken; + + if (!astUtils.isTokenOnSameLine(node.object, node.property)) { + return; + } + + if (node.computed) { + rightToken = sourceCode.getTokenBefore(node.property, astUtils.isOpeningBracketToken); + leftToken = sourceCode.getTokenBefore(rightToken, node.optional ? 1 : 0); + } else { + rightToken = sourceCode.getFirstToken(node.property); + leftToken = sourceCode.getTokenBefore(rightToken, 1); + } + + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) { + reportError(node, leftToken, rightToken); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-with.js b/node_modules/eslint/lib/rules/no-with.js new file mode 100644 index 0000000..0fb2c45 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-with.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Rule to flag use of with statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `with` statements", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-with" + }, + + schema: [], + + messages: { + unexpectedWith: "Unexpected use of 'with' statement." + } + }, + + create(context) { + + return { + WithStatement(node) { + context.report({ node, messageId: "unexpectedWith" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/nonblock-statement-body-position.js b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js new file mode 100644 index 0000000..add4c7d --- /dev/null +++ b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js @@ -0,0 +1,145 @@ +/** + * @fileoverview enforce the location of single-line statements + * @author Teddy Katz + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const POSITION_SCHEMA = { enum: ["beside", "below", "any"] }; + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "nonblock-statement-body-position", + url: "https://eslint.style/rules/js/nonblock-statement-body-position" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce the location of single-line statements", + recommended: false, + url: "https://eslint.org/docs/latest/rules/nonblock-statement-body-position" + }, + + fixable: "whitespace", + + schema: [ + POSITION_SCHEMA, + { + properties: { + overrides: { + properties: { + if: POSITION_SCHEMA, + else: POSITION_SCHEMA, + while: POSITION_SCHEMA, + do: POSITION_SCHEMA, + for: POSITION_SCHEMA + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + expectNoLinebreak: "Expected no linebreak before this statement.", + expectLinebreak: "Expected a linebreak before this statement." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Gets the applicable preference for a particular keyword + * @param {string} keywordName The name of a keyword, e.g. 'if' + * @returns {string} The applicable option for the keyword, e.g. 'beside' + */ + function getOption(keywordName) { + return context.options[1] && context.options[1].overrides && context.options[1].overrides[keywordName] || + context.options[0] || + "beside"; + } + + /** + * Validates the location of a single-line statement + * @param {ASTNode} node The single-line statement + * @param {string} keywordName The applicable keyword name for the single-line statement + * @returns {void} + */ + function validateStatement(node, keywordName) { + const option = getOption(keywordName); + + if (node.type === "BlockStatement" || option === "any") { + return; + } + + const tokenBefore = sourceCode.getTokenBefore(node); + + if (tokenBefore.loc.end.line === node.loc.start.line && option === "below") { + context.report({ + node, + messageId: "expectLinebreak", + fix: fixer => fixer.insertTextBefore(node, "\n") + }); + } else if (tokenBefore.loc.end.line !== node.loc.start.line && option === "beside") { + context.report({ + node, + messageId: "expectNoLinebreak", + fix(fixer) { + if (sourceCode.getText().slice(tokenBefore.range[1], node.range[0]).trim()) { + return null; + } + return fixer.replaceTextRange([tokenBefore.range[1], node.range[0]], " "); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + IfStatement(node) { + validateStatement(node.consequent, "if"); + + // Check the `else` node, but don't check 'else if' statements. + if (node.alternate && node.alternate.type !== "IfStatement") { + validateStatement(node.alternate, "else"); + } + }, + WhileStatement: node => validateStatement(node.body, "while"), + DoWhileStatement: node => validateStatement(node.body, "do"), + ForStatement: node => validateStatement(node.body, "for"), + ForInStatement: node => validateStatement(node.body, "for"), + ForOfStatement: node => validateStatement(node.body, "for") + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-curly-newline.js b/node_modules/eslint/lib/rules/object-curly-newline.js new file mode 100644 index 0000000..69717e5 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-curly-newline.js @@ -0,0 +1,342 @@ +/** + * @fileoverview Rule to require or disallow line breaks inside braces. + * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Schema objects. +const OPTION_VALUE = { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minProperties: { + type: "integer", + minimum: 0 + }, + consistent: { + type: "boolean" + } + }, + additionalProperties: false, + minProperties: 1 + } + ] +}; + +/** + * Normalizes a given option value. + * @param {string|Object|undefined} value An option value to parse. + * @returns {{multiline: boolean, minProperties: number, consistent: boolean}} Normalized option object. + */ +function normalizeOptionValue(value) { + let multiline = false; + let minProperties = Number.POSITIVE_INFINITY; + let consistent = false; + + if (value) { + if (value === "always") { + minProperties = 0; + } else if (value === "never") { + minProperties = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(value.multiline); + minProperties = value.minProperties || Number.POSITIVE_INFINITY; + consistent = Boolean(value.consistent); + } + } else { + consistent = true; + } + + return { multiline, minProperties, consistent }; +} + +/** + * Checks if a value is an object. + * @param {any} value The value to check + * @returns {boolean} `true` if the value is an object, otherwise `false` + */ +function isObject(value) { + return typeof value === "object" && value !== null; +} + +/** + * Checks if an option is a node-specific option + * @param {any} option The option to check + * @returns {boolean} `true` if the option is node-specific, otherwise `false` + */ +function isNodeSpecificOption(option) { + return isObject(option) || typeof option === "string"; +} + +/** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ + * ObjectExpression: {multiline: boolean, minProperties: number, consistent: boolean}, + * ObjectPattern: {multiline: boolean, minProperties: number, consistent: boolean}, + * ImportDeclaration: {multiline: boolean, minProperties: number, consistent: boolean}, + * ExportNamedDeclaration : {multiline: boolean, minProperties: number, consistent: boolean} + * }} Normalized option object. + */ +function normalizeOptions(options) { + if (isObject(options) && Object.values(options).some(isNodeSpecificOption)) { + return { + ObjectExpression: normalizeOptionValue(options.ObjectExpression), + ObjectPattern: normalizeOptionValue(options.ObjectPattern), + ImportDeclaration: normalizeOptionValue(options.ImportDeclaration), + ExportNamedDeclaration: normalizeOptionValue(options.ExportDeclaration) + }; + } + + const value = normalizeOptionValue(options); + + return { ObjectExpression: value, ObjectPattern: value, ImportDeclaration: value, ExportNamedDeclaration: value }; +} + +/** + * Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration + * node needs to be checked for missing line breaks + * @param {ASTNode} node Node under inspection + * @param {Object} options option specific to node type + * @param {Token} first First object property + * @param {Token} last Last object property + * @returns {boolean} `true` if node needs to be checked for missing line breaks + */ +function areLineBreaksRequired(node, options, first, last) { + let objectProperties; + + if (node.type === "ObjectExpression" || node.type === "ObjectPattern") { + objectProperties = node.properties; + } else { + + // is ImportDeclaration or ExportNamedDeclaration + objectProperties = node.specifiers + .filter(s => s.type === "ImportSpecifier" || s.type === "ExportSpecifier"); + } + + return objectProperties.length >= options.minProperties || + ( + options.multiline && + objectProperties.length > 0 && + first.loc.start.line !== last.loc.end.line + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "object-curly-newline", + url: "https://eslint.style/rules/js/object-curly-newline" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent line breaks after opening and before closing braces", + recommended: false, + url: "https://eslint.org/docs/latest/rules/object-curly-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + OPTION_VALUE, + { + type: "object", + properties: { + ObjectExpression: OPTION_VALUE, + ObjectPattern: OPTION_VALUE, + ImportDeclaration: OPTION_VALUE, + ExportDeclaration: OPTION_VALUE + }, + additionalProperties: false, + minProperties: 1 + } + ] + } + ], + + messages: { + unexpectedLinebreakBeforeClosingBrace: "Unexpected line break before this closing brace.", + unexpectedLinebreakAfterOpeningBrace: "Unexpected line break after this opening brace.", + expectedLinebreakBeforeClosingBrace: "Expected a line break before this closing brace.", + expectedLinebreakAfterOpeningBrace: "Expected a line break after this opening brace." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const normalizedOptions = normalizeOptions(context.options[0]); + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node. + * @returns {void} + */ + function check(node) { + const options = normalizedOptions[node.type]; + + if ( + (node.type === "ImportDeclaration" && + !node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) || + (node.type === "ExportNamedDeclaration" && + !node.specifiers.some(specifier => specifier.type === "ExportSpecifier")) + ) { + return; + } + + const openBrace = sourceCode.getFirstToken(node, token => token.value === "{"); + + let closeBrace; + + if (node.typeAnnotation) { + closeBrace = sourceCode.getTokenBefore(node.typeAnnotation); + } else { + closeBrace = sourceCode.getLastToken(node, token => token.value === "}"); + } + + let first = sourceCode.getTokenAfter(openBrace, { includeComments: true }); + let last = sourceCode.getTokenBefore(closeBrace, { includeComments: true }); + + const needsLineBreaks = areLineBreaksRequired(node, options, first, last); + + const hasCommentsFirstToken = astUtils.isCommentToken(first); + const hasCommentsLastToken = astUtils.isCommentToken(last); + + /* + * Use tokens or comments to check multiline or not. + * But use only tokens to check whether line breaks are needed. + * This allows: + * var obj = { // eslint-disable-line foo + * a: 1 + * } + */ + first = sourceCode.getTokenAfter(openBrace); + last = sourceCode.getTokenBefore(closeBrace); + + if (needsLineBreaks) { + if (astUtils.isTokenOnSameLine(openBrace, first)) { + context.report({ + messageId: "expectedLinebreakAfterOpeningBrace", + node, + loc: openBrace.loc, + fix(fixer) { + if (hasCommentsFirstToken) { + return null; + } + + return fixer.insertTextAfter(openBrace, "\n"); + } + }); + } + if (astUtils.isTokenOnSameLine(last, closeBrace)) { + context.report({ + messageId: "expectedLinebreakBeforeClosingBrace", + node, + loc: closeBrace.loc, + fix(fixer) { + if (hasCommentsLastToken) { + return null; + } + + return fixer.insertTextBefore(closeBrace, "\n"); + } + }); + } + } else { + const consistent = options.consistent; + const hasLineBreakBetweenOpenBraceAndFirst = !astUtils.isTokenOnSameLine(openBrace, first); + const hasLineBreakBetweenCloseBraceAndLast = !astUtils.isTokenOnSameLine(last, closeBrace); + + if ( + (!consistent && hasLineBreakBetweenOpenBraceAndFirst) || + (consistent && hasLineBreakBetweenOpenBraceAndFirst && !hasLineBreakBetweenCloseBraceAndLast) + ) { + context.report({ + messageId: "unexpectedLinebreakAfterOpeningBrace", + node, + loc: openBrace.loc, + fix(fixer) { + if (hasCommentsFirstToken) { + return null; + } + + return fixer.removeRange([ + openBrace.range[1], + first.range[0] + ]); + } + }); + } + if ( + (!consistent && hasLineBreakBetweenCloseBraceAndLast) || + (consistent && !hasLineBreakBetweenOpenBraceAndFirst && hasLineBreakBetweenCloseBraceAndLast) + ) { + context.report({ + messageId: "unexpectedLinebreakBeforeClosingBrace", + node, + loc: closeBrace.loc, + fix(fixer) { + if (hasCommentsLastToken) { + return null; + } + + return fixer.removeRange([ + last.range[1], + closeBrace.range[0] + ]); + } + }); + } + } + } + + return { + ObjectExpression: check, + ObjectPattern: check, + ImportDeclaration: check, + ExportNamedDeclaration: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-curly-spacing.js b/node_modules/eslint/lib/rules/object-curly-spacing.js new file mode 100644 index 0000000..42d6555 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-curly-spacing.js @@ -0,0 +1,329 @@ +/** + * @fileoverview Disallows or enforces spaces inside of object literals. + * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "object-curly-spacing", + url: "https://eslint.style/rules/js/object-curly-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing inside braces", + recommended: false, + url: "https://eslint.org/docs/latest/rules/object-curly-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + arraysInObjects: { + type: "boolean" + }, + objectsInObjects: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + requireSpaceBefore: "A space is required before '{{token}}'.", + requireSpaceAfter: "A space is required after '{{token}}'.", + unexpectedSpaceBefore: "There should be no space before '{{token}}'.", + unexpectedSpaceAfter: "There should be no space after '{{token}}'." + } + }, + + create(context) { + const spaced = context.options[0] === "always", + sourceCode = context.sourceCode; + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + const options = { + spaced, + arraysInObjectsException: isOptionSet("arraysInObjects"), + objectsInObjectsException: isOptionSet("objectsInObjects") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + const nextToken = context.sourceCode.getTokenAfter(token, { includeComments: true }); + + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + token: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + const previousToken = context.sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + node, + loc: { start: previousToken.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + token: token.value + }, + fix(fixer) { + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "requireSpaceAfter", + data: { + token: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "requireSpaceBefore", + data: { + token: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if spacing in curly braces is valid. + * @param {ASTNode} node The AST node to check. + * @param {Token} first The first token to check (should be the opening brace) + * @param {Token} second The second token to check (should be first after the opening brace) + * @param {Token} penultimate The penultimate token to check (should be last before closing brace) + * @param {Token} last The last token to check (should be closing brace) + * @returns {void} + */ + function validateBraceSpacing(node, first, second, penultimate, last) { + if (astUtils.isTokenOnSameLine(first, second)) { + const firstSpaced = sourceCode.isSpaceBetweenTokens(first, second); + + if (options.spaced && !firstSpaced) { + reportRequiredBeginningSpace(node, first); + } + if (!options.spaced && firstSpaced && second.type !== "Line") { + reportNoBeginningSpace(node, first); + } + } + + if (astUtils.isTokenOnSameLine(penultimate, last)) { + const shouldCheckPenultimate = ( + options.arraysInObjectsException && astUtils.isClosingBracketToken(penultimate) || + options.objectsInObjectsException && astUtils.isClosingBraceToken(penultimate) + ); + const penultimateType = shouldCheckPenultimate && sourceCode.getNodeByRangeIndex(penultimate.range[0]).type; + + const closingCurlyBraceMustBeSpaced = ( + options.arraysInObjectsException && penultimateType === "ArrayExpression" || + options.objectsInObjectsException && (penultimateType === "ObjectExpression" || penultimateType === "ObjectPattern") + ) ? !options.spaced : options.spaced; + + const lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last); + + if (closingCurlyBraceMustBeSpaced && !lastSpaced) { + reportRequiredEndingSpace(node, last); + } + if (!closingCurlyBraceMustBeSpaced && lastSpaced) { + reportNoEndingSpace(node, last); + } + } + } + + /** + * Gets '}' token of an object node. + * + * Because the last token of object patterns might be a type annotation, + * this traverses tokens preceded by the last property, then returns the + * first '}' token. + * @param {ASTNode} node The node to get. This node is an + * ObjectExpression or an ObjectPattern. And this node has one or + * more properties. + * @returns {Token} '}' token. + */ + function getClosingBraceOfObject(node) { + const lastProperty = node.properties.at(-1); + + return sourceCode.getTokenAfter(lastProperty, astUtils.isClosingBraceToken); + } + + /** + * Reports a given object node if spacing in curly braces is invalid. + * @param {ASTNode} node An ObjectExpression or ObjectPattern node to check. + * @returns {void} + */ + function checkForObject(node) { + if (node.properties.length === 0) { + return; + } + + const first = sourceCode.getFirstToken(node), + last = getClosingBraceOfObject(node), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + /** + * Reports a given import node if spacing in curly braces is invalid. + * @param {ASTNode} node An ImportDeclaration node to check. + * @returns {void} + */ + function checkForImport(node) { + if (node.specifiers.length === 0) { + return; + } + + let firstSpecifier = node.specifiers[0]; + const lastSpecifier = node.specifiers.at(-1); + + if (lastSpecifier.type !== "ImportSpecifier") { + return; + } + if (firstSpecifier.type !== "ImportSpecifier") { + firstSpecifier = node.specifiers[1]; + } + + const first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier, astUtils.isNotCommaToken), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + /** + * Reports a given export node if spacing in curly braces is invalid. + * @param {ASTNode} node An ExportNamedDeclaration node to check. + * @returns {void} + */ + function checkForExport(node) { + if (node.specifiers.length === 0) { + return; + } + + const firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers.at(-1), + first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier, astUtils.isNotCommaToken), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + // var {x} = y; + ObjectPattern: checkForObject, + + // var y = {x: 'y'} + ObjectExpression: checkForObject, + + // import {y} from 'x'; + ImportDeclaration: checkForImport, + + // export {name} from 'yo'; + ExportNamedDeclaration: checkForExport + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/object-property-newline.js b/node_modules/eslint/lib/rules/object-property-newline.js new file mode 100644 index 0000000..1549ad7 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-property-newline.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Rule to enforce placing object properties on separate lines. + * @author Vitor Balocco + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "object-property-newline", + url: "https://eslint.style/rules/js/object-property-newline" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce placing object properties on separate lines", + recommended: false, + url: "https://eslint.org/docs/latest/rules/object-property-newline" + }, + + schema: [ + { + type: "object", + properties: { + allowAllPropertiesOnSameLine: { + type: "boolean", + default: false + }, + allowMultiplePropertiesPerLine: { // Deprecated + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "whitespace", + + messages: { + propertiesOnNewlineAll: "Object properties must go on a new line if they aren't all on the same line.", + propertiesOnNewline: "Object properties must go on a new line." + } + }, + + create(context) { + const allowSameLine = context.options[0] && ( + (context.options[0].allowAllPropertiesOnSameLine || context.options[0].allowMultiplePropertiesPerLine /* Deprecated */) + ); + const messageId = allowSameLine + ? "propertiesOnNewlineAll" + : "propertiesOnNewline"; + + const sourceCode = context.sourceCode; + + return { + ObjectExpression(node) { + if (allowSameLine) { + if (node.properties.length > 1) { + const firstTokenOfFirstProperty = sourceCode.getFirstToken(node.properties[0]); + const lastTokenOfLastProperty = sourceCode.getLastToken(node.properties.at(-1)); + + if (firstTokenOfFirstProperty.loc.end.line === lastTokenOfLastProperty.loc.start.line) { + + // All keys and values are on the same line + return; + } + } + } + + for (let i = 1; i < node.properties.length; i++) { + const lastTokenOfPreviousProperty = sourceCode.getLastToken(node.properties[i - 1]); + const firstTokenOfCurrentProperty = sourceCode.getFirstToken(node.properties[i]); + + if (lastTokenOfPreviousProperty.loc.end.line === firstTokenOfCurrentProperty.loc.start.line) { + context.report({ + node, + loc: firstTokenOfCurrentProperty.loc, + messageId, + fix(fixer) { + const comma = sourceCode.getTokenBefore(firstTokenOfCurrentProperty); + const rangeAfterComma = [comma.range[1], firstTokenOfCurrentProperty.range[0]]; + + // Don't perform a fix if there are any comments between the comma and the next property. + if (sourceCode.text.slice(rangeAfterComma[0], rangeAfterComma[1]).trim()) { + return null; + } + + return fixer.replaceTextRange(rangeAfterComma, "\n"); + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-shorthand.js b/node_modules/eslint/lib/rules/object-shorthand.js new file mode 100644 index 0000000..35428ac --- /dev/null +++ b/node_modules/eslint/lib/rules/object-shorthand.js @@ -0,0 +1,522 @@ +/** + * @fileoverview Rule to enforce concise object methods and properties. + * @author Jamund Ferguson + */ + +"use strict"; + +const OPTIONS = { + always: "always", + never: "never", + methods: "methods", + properties: "properties", + consistent: "consistent", + consistentAsNeeded: "consistent-as-needed" +}; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require or disallow method and property shorthand syntax for object literals", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/object-shorthand" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "methods", "properties", "never", "consistent", "consistent-as-needed"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always", "methods", "properties"] + }, + { + type: "object", + properties: { + avoidQuotes: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + }, + { + type: "array", + items: [ + { + enum: ["always", "methods"] + }, + { + type: "object", + properties: { + ignoreConstructors: { + type: "boolean" + }, + methodsIgnorePattern: { + type: "string" + }, + avoidQuotes: { + type: "boolean" + }, + avoidExplicitReturnArrows: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + expectedAllPropertiesShorthanded: "Expected shorthand for all properties.", + expectedLiteralMethodLongform: "Expected longform method syntax for string literal keys.", + expectedPropertyShorthand: "Expected property shorthand.", + expectedPropertyLongform: "Expected longform property syntax.", + expectedMethodShorthand: "Expected method shorthand.", + expectedMethodLongform: "Expected longform method syntax.", + unexpectedMix: "Unexpected mix of shorthand and non-shorthand properties." + } + }, + + create(context) { + const APPLY = context.options[0] || OPTIONS.always; + const APPLY_TO_METHODS = APPLY === OPTIONS.methods || APPLY === OPTIONS.always; + const APPLY_TO_PROPS = APPLY === OPTIONS.properties || APPLY === OPTIONS.always; + const APPLY_NEVER = APPLY === OPTIONS.never; + const APPLY_CONSISTENT = APPLY === OPTIONS.consistent; + const APPLY_CONSISTENT_AS_NEEDED = APPLY === OPTIONS.consistentAsNeeded; + + const PARAMS = context.options[1] || {}; + const IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors; + const METHODS_IGNORE_PATTERN = PARAMS.methodsIgnorePattern + ? new RegExp(PARAMS.methodsIgnorePattern, "u") + : null; + const AVOID_QUOTES = PARAMS.avoidQuotes; + const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows; + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const CTOR_PREFIX_REGEX = /[^_$0-9]/u; + + /** + * Determines if the first character of the name is a capital letter. + * @param {string} name The name of the node to evaluate. + * @returns {boolean} True if the first character of the property name is a capital letter, false if not. + * @private + */ + function isConstructor(name) { + const match = CTOR_PREFIX_REGEX.exec(name); + + // Not a constructor if name has no characters apart from '_', '$' and digits e.g. '_', '$$', '_8' + if (!match) { + return false; + } + + const firstChar = name.charAt(match.index); + + return firstChar === firstChar.toUpperCase(); + } + + /** + * Determines if the property can have a shorthand form. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the property can have a shorthand form + * @private + */ + function canHaveShorthand(property) { + return (property.kind !== "set" && property.kind !== "get" && property.type !== "SpreadElement" && property.type !== "SpreadProperty" && property.type !== "ExperimentalSpreadProperty"); + } + + /** + * Checks whether a node is a string literal. + * @param {ASTNode} node Any AST node. + * @returns {boolean} `true` if it is a string literal. + */ + function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Determines if the property is a shorthand or not. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the property is considered shorthand, false if not. + * @private + */ + function isShorthand(property) { + + // property.method is true when `{a(){}}`. + return (property.shorthand || property.method); + } + + /** + * Determines if the property's key and method or value are named equally. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the key and value are named equally, false if not. + * @private + */ + function isRedundant(property) { + const value = property.value; + + if (value.type === "FunctionExpression") { + return !value.id; // Only anonymous should be shorthand method. + } + if (value.type === "Identifier") { + return astUtils.getStaticPropertyName(property) === value.name; + } + + return false; + } + + /** + * Ensures that an object's properties are consistently shorthand, or not shorthand at all. + * @param {ASTNode} node Property AST node + * @param {boolean} checkRedundancy Whether to check longform redundancy + * @returns {void} + */ + function checkConsistency(node, checkRedundancy) { + + // We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand. + const properties = node.properties.filter(canHaveShorthand); + + // Do we still have properties left after filtering the getters and setters? + if (properties.length > 0) { + const shorthandProperties = properties.filter(isShorthand); + + /* + * If we do not have an equal number of longform properties as + * shorthand properties, we are using the annotations inconsistently + */ + if (shorthandProperties.length !== properties.length) { + + // We have at least 1 shorthand property + if (shorthandProperties.length > 0) { + context.report({ node, messageId: "unexpectedMix" }); + } else if (checkRedundancy) { + + /* + * If all properties of the object contain a method or value with a name matching it's key, + * all the keys are redundant. + */ + const canAlwaysUseShorthand = properties.every(isRedundant); + + if (canAlwaysUseShorthand) { + context.report({ node, messageId: "expectedAllPropertiesShorthanded" }); + } + } + } + } + } + + /** + * Fixes a FunctionExpression node by making it into a shorthand property. + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A `Property` node that has a `FunctionExpression` or `ArrowFunctionExpression` as its value + * @returns {Object} A fix for this node + */ + function makeFunctionShorthand(fixer, node) { + const firstKeyToken = node.computed + ? sourceCode.getFirstToken(node, astUtils.isOpeningBracketToken) + : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed + ? sourceCode.getFirstTokenBetween(node.key, node.value, astUtils.isClosingBracketToken) + : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken.range[0], lastKeyToken.range[1]); + let keyPrefix = ""; + + // key: /* */ () => {} + if (sourceCode.commentsExistBetween(lastKeyToken, node.value)) { + return null; + } + + if (node.value.async) { + keyPrefix += "async "; + } + if (node.value.generator) { + keyPrefix += "*"; + } + + const fixRange = [firstKeyToken.range[0], node.range[1]]; + const methodPrefix = keyPrefix + keyText; + + if (node.value.type === "FunctionExpression") { + const functionToken = sourceCode.getTokens(node.value).find(token => token.type === "Keyword" && token.value === "function"); + const tokenBeforeParams = node.value.generator ? sourceCode.getTokenAfter(functionToken) : functionToken; + + return fixer.replaceTextRange( + fixRange, + methodPrefix + sourceCode.text.slice(tokenBeforeParams.range[1], node.value.range[1]) + ); + } + + const arrowToken = sourceCode.getTokenBefore(node.value.body, astUtils.isArrowToken); + const fnBody = sourceCode.text.slice(arrowToken.range[1], node.value.range[1]); + + // First token should not be `async` + const firstValueToken = sourceCode.getFirstToken(node.value, { + skip: node.value.async ? 1 : 0 + }); + + const sliceStart = firstValueToken.range[0]; + const sliceEnd = sourceCode.getTokenBefore(arrowToken).range[1]; + const shouldAddParens = node.value.params.length === 1 && node.value.params[0].range[0] === sliceStart; + + const oldParamText = sourceCode.text.slice(sliceStart, sliceEnd); + const newParamText = shouldAddParens ? `(${oldParamText})` : oldParamText; + + return fixer.replaceTextRange( + fixRange, + methodPrefix + newParamText + fnBody + ); + } + + /** + * Fixes a FunctionExpression node by making it into a longform property. + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A `Property` node that has a `FunctionExpression` as its value + * @returns {Object} A fix for this node + */ + function makeFunctionLongform(fixer, node) { + const firstKeyToken = node.computed ? sourceCode.getTokens(node).find(token => token.value === "[") : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed ? sourceCode.getTokensBetween(node.key, node.value).find(token => token.value === "]") : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken.range[0], lastKeyToken.range[1]); + let functionHeader = "function"; + + if (node.value.async) { + functionHeader = `async ${functionHeader}`; + } + if (node.value.generator) { + functionHeader = `${functionHeader}*`; + } + + return fixer.replaceTextRange([node.range[0], lastKeyToken.range[1]], `${keyText}: ${functionHeader}`); + } + + /* + * To determine whether a given arrow function has a lexical identifier (`this`, `arguments`, `super`, or `new.target`), + * create a stack of functions that define these identifiers (i.e. all functions except arrow functions) as the AST is + * traversed. Whenever a new function is encountered, create a new entry on the stack (corresponding to a different lexical + * scope of `this`), and whenever a function is exited, pop that entry off the stack. When an arrow function is entered, + * keep a reference to it on the current stack entry, and remove that reference when the arrow function is exited. + * When a lexical identifier is encountered, mark all the arrow functions on the current stack entry by adding them + * to an `arrowsWithLexicalIdentifiers` set. Any arrow function in that set will not be reported by this rule, + * because converting it into a method would change the value of one of the lexical identifiers. + */ + const lexicalScopeStack = []; + const arrowsWithLexicalIdentifiers = new WeakSet(); + const argumentsIdentifiers = new WeakSet(); + + /** + * Enters a function. This creates a new lexical identifier scope, so a new Set of arrow functions is pushed onto the stack. + * Also, this marks all `arguments` identifiers so that they can be detected later. + * @param {ASTNode} node The node representing the function. + * @returns {void} + */ + function enterFunction(node) { + lexicalScopeStack.unshift(new Set()); + sourceCode.getScope(node).variables.filter(variable => variable.name === "arguments").forEach(variable => { + variable.references.map(ref => ref.identifier).forEach(identifier => argumentsIdentifiers.add(identifier)); + }); + } + + /** + * Exits a function. This pops the current set of arrow functions off the lexical scope stack. + * @returns {void} + */ + function exitFunction() { + lexicalScopeStack.shift(); + } + + /** + * Marks the current function as having a lexical keyword. This implies that all arrow functions + * in the current lexical scope contain a reference to this lexical keyword. + * @returns {void} + */ + function reportLexicalIdentifier() { + lexicalScopeStack[0].forEach(arrowFunction => arrowsWithLexicalIdentifiers.add(arrowFunction)); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: enterFunction, + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + "Program:exit": exitFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + + ArrowFunctionExpression(node) { + lexicalScopeStack[0].add(node); + }, + "ArrowFunctionExpression:exit"(node) { + lexicalScopeStack[0].delete(node); + }, + + ThisExpression: reportLexicalIdentifier, + Super: reportLexicalIdentifier, + MetaProperty(node) { + if (node.meta.name === "new" && node.property.name === "target") { + reportLexicalIdentifier(); + } + }, + Identifier(node) { + if (argumentsIdentifiers.has(node)) { + reportLexicalIdentifier(); + } + }, + + ObjectExpression(node) { + if (APPLY_CONSISTENT) { + checkConsistency(node, false); + } else if (APPLY_CONSISTENT_AS_NEEDED) { + checkConsistency(node, true); + } + }, + + "Property:exit"(node) { + const isConciseProperty = node.method || node.shorthand; + + // Ignore destructuring assignment + if (node.parent.type === "ObjectPattern") { + return; + } + + // getters and setters are ignored + if (node.kind === "get" || node.kind === "set") { + return; + } + + // only computed methods can fail the following checks + if (node.computed && node.value.type !== "FunctionExpression" && node.value.type !== "ArrowFunctionExpression") { + return; + } + + //-------------------------------------------------------------- + // Checks for property/method shorthand. + if (isConciseProperty) { + if (node.method && (APPLY_NEVER || AVOID_QUOTES && isStringLiteral(node.key))) { + const messageId = APPLY_NEVER ? "expectedMethodLongform" : "expectedLiteralMethodLongform"; + + // { x() {} } should be written as { x: function() {} } + context.report({ + node, + messageId, + fix: fixer => makeFunctionLongform(fixer, node) + }); + } else if (APPLY_NEVER) { + + // { x } should be written as { x: x } + context.report({ + node, + messageId: "expectedPropertyLongform", + fix: fixer => fixer.insertTextAfter(node.key, `: ${node.key.name}`) + }); + } + } else if (APPLY_TO_METHODS && !node.value.id && (node.value.type === "FunctionExpression" || node.value.type === "ArrowFunctionExpression")) { + if (IGNORE_CONSTRUCTORS && node.key.type === "Identifier" && isConstructor(node.key.name)) { + return; + } + + if (METHODS_IGNORE_PATTERN) { + const propertyName = astUtils.getStaticPropertyName(node); + + if (propertyName !== null && METHODS_IGNORE_PATTERN.test(propertyName)) { + return; + } + } + + if (AVOID_QUOTES && isStringLiteral(node.key)) { + return; + } + + // {[x]: function(){}} should be written as {[x]() {}} + if (node.value.type === "FunctionExpression" || + node.value.type === "ArrowFunctionExpression" && + node.value.body.type === "BlockStatement" && + AVOID_EXPLICIT_RETURN_ARROWS && + !arrowsWithLexicalIdentifiers.has(node.value) + ) { + context.report({ + node, + messageId: "expectedMethodShorthand", + fix: fixer => makeFunctionShorthand(fixer, node) + }); + } + } else if (node.value.type === "Identifier" && node.key.name === node.value.name && APPLY_TO_PROPS) { + + // {x: x} should be written as {x} + context.report({ + node, + messageId: "expectedPropertyShorthand", + fix(fixer) { + + // x: /* */ x + // x: (/* */ x) + if (sourceCode.getCommentsInside(node).length > 0) { + return null; + } + + return fixer.replaceText(node, node.value.name); + } + }); + } else if (node.value.type === "Identifier" && node.key.type === "Literal" && node.key.value === node.value.name && APPLY_TO_PROPS) { + if (AVOID_QUOTES) { + return; + } + + // {"x": x} should be written as {x} + context.report({ + node, + messageId: "expectedPropertyShorthand", + fix(fixer) { + + // "x": /* */ x + // "x": (/* */ x) + if (sourceCode.getCommentsInside(node).length > 0) { + return null; + } + + return fixer.replaceText(node, node.value.name); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/one-var-declaration-per-line.js b/node_modules/eslint/lib/rules/one-var-declaration-per-line.js new file mode 100644 index 0000000..e3ed6c8 --- /dev/null +++ b/node_modules/eslint/lib/rules/one-var-declaration-per-line.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to check multiple var declarations per line + * @author Alberto Rodríguez + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "one-var-declaration-per-line", + url: "https://eslint.style/rules/js/one-var-declaration-per-line" + } + } + ] + }, + type: "suggestion", + + docs: { + description: "Require or disallow newlines around variable declarations", + recommended: false, + url: "https://eslint.org/docs/latest/rules/one-var-declaration-per-line" + }, + + schema: [ + { + enum: ["always", "initializations"] + } + ], + + fixable: "whitespace", + + messages: { + expectVarOnNewline: "Expected variable declaration to be on a new line." + } + }, + + create(context) { + + const always = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Checks newlines around variable declarations. + * @private + * @param {ASTNode} node `VariableDeclaration` node to test + * @returns {void} + */ + function checkForNewLine(node) { + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + const declarations = node.declarations; + let prev; + + declarations.forEach(current => { + if (prev && prev.loc.end.line === current.loc.start.line) { + if (always || prev.init || current.init) { + context.report({ + node, + messageId: "expectVarOnNewline", + loc: current.loc, + fix: fixer => fixer.insertTextBefore(current, "\n") + }); + } + } + prev = current; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForNewLine + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/one-var.js b/node_modules/eslint/lib/rules/one-var.js new file mode 100644 index 0000000..e81b5a5 --- /dev/null +++ b/node_modules/eslint/lib/rules/one-var.js @@ -0,0 +1,568 @@ +/** + * @fileoverview A rule to control the use of single variable declarations. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is in a statement list. + * @param {ASTNode} node node to check + * @returns {boolean} `true` if the given node is in a statement list + */ +function isInStatementList(node) { + return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce variables to be declared either together or separately in functions", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/one-var" + }, + + fixable: "code", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consecutive"] + }, + { + type: "object", + properties: { + separateRequires: { + type: "boolean" + }, + var: { + enum: ["always", "never", "consecutive"] + }, + let: { + enum: ["always", "never", "consecutive"] + }, + const: { + enum: ["always", "never", "consecutive"] + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + initialized: { + enum: ["always", "never", "consecutive"] + }, + uninitialized: { + enum: ["always", "never", "consecutive"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + combineUninitialized: "Combine this with the previous '{{type}}' statement with uninitialized variables.", + combineInitialized: "Combine this with the previous '{{type}}' statement with initialized variables.", + splitUninitialized: "Split uninitialized '{{type}}' declarations into multiple statements.", + splitInitialized: "Split initialized '{{type}}' declarations into multiple statements.", + splitRequires: "Split requires to be separated into a single block.", + combine: "Combine this with the previous '{{type}}' statement.", + split: "Split '{{type}}' declarations into multiple statements." + } + }, + + create(context) { + const MODE_ALWAYS = "always"; + const MODE_NEVER = "never"; + const MODE_CONSECUTIVE = "consecutive"; + const mode = context.options[0] || MODE_ALWAYS; + + const options = {}; + + if (typeof mode === "string") { // simple options configuration with just a string + options.var = { uninitialized: mode, initialized: mode }; + options.let = { uninitialized: mode, initialized: mode }; + options.const = { uninitialized: mode, initialized: mode }; + } else if (typeof mode === "object") { // options configuration is an object + options.separateRequires = !!mode.separateRequires; + options.var = { uninitialized: mode.var, initialized: mode.var }; + options.let = { uninitialized: mode.let, initialized: mode.let }; + options.const = { uninitialized: mode.const, initialized: mode.const }; + if (Object.hasOwn(mode, "uninitialized")) { + options.var.uninitialized = mode.uninitialized; + options.let.uninitialized = mode.uninitialized; + options.const.uninitialized = mode.uninitialized; + } + if (Object.hasOwn(mode, "initialized")) { + options.var.initialized = mode.initialized; + options.let.initialized = mode.initialized; + options.const.initialized = mode.initialized; + } + } + + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = []; + const blockStack = []; + + /** + * Increments the blockStack counter. + * @returns {void} + * @private + */ + function startBlock() { + blockStack.push({ + let: { initialized: false, uninitialized: false }, + const: { initialized: false, uninitialized: false } + }); + } + + /** + * Increments the functionStack counter. + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push({ initialized: false, uninitialized: false }); + startBlock(); + } + + /** + * Decrements the blockStack counter. + * @returns {void} + * @private + */ + function endBlock() { + blockStack.pop(); + } + + /** + * Decrements the functionStack counter. + * @returns {void} + * @private + */ + function endFunction() { + functionStack.pop(); + endBlock(); + } + + /** + * Check if a variable declaration is a require. + * @param {ASTNode} decl variable declaration Node + * @returns {bool} if decl is a require, return true; else return false. + * @private + */ + function isRequire(decl) { + return decl.init && decl.init.type === "CallExpression" && decl.init.callee.name === "require"; + } + + /** + * Records whether initialized/uninitialized/required variables are defined in current scope. + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {ASTNode[]} declarations List of declarations + * @param {Object} currentScope The scope being investigated + * @returns {void} + * @private + */ + function recordTypes(statementType, declarations, currentScope) { + for (let i = 0; i < declarations.length; i++) { + if (declarations[i].init === null) { + if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) { + currentScope.uninitialized = true; + } + } else { + if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) { + if (options.separateRequires && isRequire(declarations[i])) { + currentScope.required = true; + } else { + currentScope.initialized = true; + } + } + } + } + } + + /** + * Determines the current scope (function or block) + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @returns {Object} The scope associated with statementType + */ + function getCurrentScope(statementType) { + let currentScope; + + if (statementType === "var") { + currentScope = functionStack.at(-1); + } else if (statementType === "let") { + currentScope = blockStack.at(-1).let; + } else if (statementType === "const") { + currentScope = blockStack.at(-1).const; + } + return currentScope; + } + + /** + * Counts the number of initialized and uninitialized declarations in a list of declarations + * @param {ASTNode[]} declarations List of declarations + * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations + * @private + */ + function countDeclarations(declarations) { + const counts = { uninitialized: 0, initialized: 0 }; + + for (let i = 0; i < declarations.length; i++) { + if (declarations[i].init === null) { + counts.uninitialized++; + } else { + counts.initialized++; + } + } + return counts; + } + + /** + * Determines if there is more than one var statement in the current scope. + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {ASTNode[]} declarations List of declarations + * @returns {boolean} Returns true if it is the first var declaration, false if not. + * @private + */ + function hasOnlyOneStatement(statementType, declarations) { + + const declarationCounts = countDeclarations(declarations); + const currentOptions = options[statementType] || {}; + const currentScope = getCurrentScope(statementType); + const hasRequires = declarations.some(isRequire); + + if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) { + if (currentScope.uninitialized || currentScope.initialized) { + if (!hasRequires) { + return false; + } + } + } + + if (declarationCounts.uninitialized > 0) { + if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) { + return false; + } + } + if (declarationCounts.initialized > 0) { + if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) { + if (!hasRequires) { + return false; + } + } + } + if (currentScope.required && hasRequires) { + return false; + } + recordTypes(statementType, declarations, currentScope); + return true; + } + + /** + * Fixer to join VariableDeclaration's into a single declaration + * @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join + * @returns {Function} The fixer function + */ + function joinDeclarations(declarations) { + const declaration = declarations[0]; + const body = Array.isArray(declaration.parent.parent.body) ? declaration.parent.parent.body : []; + const currentIndex = body.findIndex(node => node.range[0] === declaration.parent.range[0]); + const previousNode = body[currentIndex - 1]; + + return fixer => { + const type = sourceCode.getTokenBefore(declaration); + const prevSemi = sourceCode.getTokenBefore(type); + const res = []; + + if (previousNode && previousNode.kind === sourceCode.getText(type)) { + if (prevSemi.value === ";") { + res.push(fixer.replaceText(prevSemi, ",")); + } else { + res.push(fixer.insertTextAfter(prevSemi, ",")); + } + res.push(fixer.replaceText(type, "")); + } + + return res; + }; + } + + /** + * Fixer to split a VariableDeclaration into individual declarations + * @param {VariableDeclaration} declaration The `VariableDeclaration` to split + * @returns {Function|null} The fixer function + */ + function splitDeclarations(declaration) { + const { parent } = declaration; + + // don't autofix code such as: if (foo) var x, y; + if (!isInStatementList(parent.type === "ExportNamedDeclaration" ? parent : declaration)) { + return null; + } + + return fixer => declaration.declarations.map(declarator => { + const tokenAfterDeclarator = sourceCode.getTokenAfter(declarator); + + if (tokenAfterDeclarator === null) { + return null; + } + + const afterComma = sourceCode.getTokenAfter(tokenAfterDeclarator, { includeComments: true }); + + if (tokenAfterDeclarator.value !== ",") { + return null; + } + + const exportPlacement = declaration.parent.type === "ExportNamedDeclaration" ? "export " : ""; + + /* + * `var x,y` + * tokenAfterDeclarator ^^ afterComma + */ + if (afterComma.range[0] === tokenAfterDeclarator.range[1]) { + return fixer.replaceText(tokenAfterDeclarator, `; ${exportPlacement}${declaration.kind} `); + } + + /* + * `var x, + * tokenAfterDeclarator ^ + * y` + * ^ afterComma + */ + if ( + afterComma.loc.start.line > tokenAfterDeclarator.loc.end.line || + afterComma.type === "Line" || + afterComma.type === "Block" + ) { + let lastComment = afterComma; + + while (lastComment.type === "Line" || lastComment.type === "Block") { + lastComment = sourceCode.getTokenAfter(lastComment, { includeComments: true }); + } + + return fixer.replaceTextRange( + [tokenAfterDeclarator.range[0], lastComment.range[0]], + `;${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}${exportPlacement}${declaration.kind} ` + ); + } + + return fixer.replaceText(tokenAfterDeclarator, `; ${exportPlacement}${declaration.kind}`); + }).filter(x => x); + } + + /** + * Checks a given VariableDeclaration node for errors. + * @param {ASTNode} node The VariableDeclaration node to check + * @returns {void} + * @private + */ + function checkVariableDeclaration(node) { + const parent = node.parent; + const type = node.kind; + + if (!options[type]) { + return; + } + + const declarations = node.declarations; + const declarationCounts = countDeclarations(declarations); + const mixedRequires = declarations.some(isRequire) && !declarations.every(isRequire); + + if (options[type].initialized === MODE_ALWAYS) { + if (options.separateRequires && mixedRequires) { + context.report({ + node, + messageId: "splitRequires" + }); + } + } + + // consecutive + const nodeIndex = (parent.body && parent.body.length > 0 && parent.body.indexOf(node)) || 0; + + if (nodeIndex > 0) { + const previousNode = parent.body[nodeIndex - 1]; + const isPreviousNodeDeclaration = previousNode.type === "VariableDeclaration"; + const declarationsWithPrevious = declarations.concat(previousNode.declarations || []); + + if ( + isPreviousNodeDeclaration && + previousNode.kind === type && + !(declarationsWithPrevious.some(isRequire) && !declarationsWithPrevious.every(isRequire)) + ) { + const previousDeclCounts = countDeclarations(previousNode.declarations); + + if (options[type].initialized === MODE_CONSECUTIVE && options[type].uninitialized === MODE_CONSECUTIVE) { + context.report({ + node, + messageId: "combine", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else if (options[type].initialized === MODE_CONSECUTIVE && declarationCounts.initialized > 0 && previousDeclCounts.initialized > 0) { + context.report({ + node, + messageId: "combineInitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else if (options[type].uninitialized === MODE_CONSECUTIVE && + declarationCounts.uninitialized > 0 && + previousDeclCounts.uninitialized > 0) { + context.report({ + node, + messageId: "combineUninitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + } + } + + // always + if (!hasOnlyOneStatement(type, declarations)) { + if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) { + context.report({ + node, + messageId: "combine", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else { + if (options[type].initialized === MODE_ALWAYS && declarationCounts.initialized > 0) { + context.report({ + node, + messageId: "combineInitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + if (options[type].uninitialized === MODE_ALWAYS && declarationCounts.uninitialized > 0) { + if (node.parent.left === node && (node.parent.type === "ForInStatement" || node.parent.type === "ForOfStatement")) { + return; + } + context.report({ + node, + messageId: "combineUninitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + } + } + + // never + if (parent.type !== "ForStatement" || parent.init !== node) { + const totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized; + + if (totalDeclarations > 1) { + if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) { + + // both initialized and uninitialized + context.report({ + node, + messageId: "split", + data: { + type + }, + fix: splitDeclarations(node) + }); + } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) { + + // initialized + context.report({ + node, + messageId: "splitInitialized", + data: { + type + }, + fix: splitDeclarations(node) + }); + } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) { + + // uninitialized + context.report({ + node, + messageId: "splitUninitialized", + data: { + type + }, + fix: splitDeclarations(node) + }); + } + } + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: startFunction, + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + StaticBlock: startFunction, // StaticBlock creates a new scope for `var` variables + + BlockStatement: startBlock, + ForStatement: startBlock, + ForInStatement: startBlock, + ForOfStatement: startBlock, + SwitchStatement: startBlock, + VariableDeclaration: checkVariableDeclaration, + "ForStatement:exit": endBlock, + "ForOfStatement:exit": endBlock, + "ForInStatement:exit": endBlock, + "SwitchStatement:exit": endBlock, + "BlockStatement:exit": endBlock, + + "Program:exit": endFunction, + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + "StaticBlock:exit": endFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/operator-assignment.js b/node_modules/eslint/lib/rules/operator-assignment.js new file mode 100644 index 0000000..00619a3 --- /dev/null +++ b/node_modules/eslint/lib/rules/operator-assignment.js @@ -0,0 +1,212 @@ +/** + * @fileoverview Rule to replace assignment expressions with operator assignment + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether an operator is commutative and has an operator assignment + * shorthand form. + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is commutative and has a + * shorthand form. + */ +function isCommutativeOperatorWithShorthand(operator) { + return ["*", "&", "^", "|"].includes(operator); +} + +/** + * Checks whether an operator is not commutative and has an operator assignment + * shorthand form. + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is not commutative and has + * a shorthand form. + */ +function isNonCommutativeOperatorWithShorthand(operator) { + return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].includes(operator); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Determines if the left side of a node can be safely fixed (i.e. if it activates the same getters/setters and) + * toString calls regardless of whether assignment shorthand is used) + * @param {ASTNode} node The node on the left side of the expression + * @returns {boolean} `true` if the node can be fixed + */ +function canBeFixed(node) { + return ( + node.type === "Identifier" || + ( + node.type === "MemberExpression" && + (node.object.type === "Identifier" || node.object.type === "ThisExpression") && + (!node.computed || node.property.type === "Literal") + ) + ); +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["always"], + + docs: { + description: "Require or disallow assignment operator shorthand where possible", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/operator-assignment" + }, + + schema: [ + { + enum: ["always", "never"] + } + ], + + fixable: "code", + messages: { + replaced: "Assignment (=) can be replaced with operator assignment ({{operator}}).", + unexpected: "Unexpected operator assignment ({{operator}}) shorthand." + } + }, + + create(context) { + const never = context.options[0] === "never"; + const sourceCode = context.sourceCode; + + /** + * Returns the operator token of an AssignmentExpression or BinaryExpression + * @param {ASTNode} node An AssignmentExpression or BinaryExpression node + * @returns {Token} The operator token in the node + */ + function getOperatorToken(node) { + return sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + } + + /** + * Ensures that an assignment uses the shorthand form where possible. + * @param {ASTNode} node An AssignmentExpression node. + * @returns {void} + */ + function verify(node) { + if (node.operator !== "=" || node.right.type !== "BinaryExpression") { + return; + } + + const left = node.left; + const expr = node.right; + const operator = expr.operator; + + if (isCommutativeOperatorWithShorthand(operator) || isNonCommutativeOperatorWithShorthand(operator)) { + const replacementOperator = `${operator}=`; + + if (astUtils.isSameReference(left, expr.left, true)) { + context.report({ + node, + messageId: "replaced", + data: { operator: replacementOperator }, + fix(fixer) { + if (canBeFixed(left) && canBeFixed(expr.left)) { + const equalsToken = getOperatorToken(node); + const operatorToken = getOperatorToken(expr); + const leftText = sourceCode.getText().slice(node.range[0], equalsToken.range[0]); + const rightText = sourceCode.getText().slice(operatorToken.range[1], node.right.range[1]); + + // Check for comments that would be removed. + if (sourceCode.commentsExistBetween(equalsToken, operatorToken)) { + return null; + } + + return fixer.replaceText(node, `${leftText}${replacementOperator}${rightText}`); + } + return null; + } + }); + } else if (astUtils.isSameReference(left, expr.right, true) && isCommutativeOperatorWithShorthand(operator)) { + + /* + * This case can't be fixed safely. + * If `a` and `b` both have custom valueOf() behavior, then fixing `a = b * a` to `a *= b` would + * change the execution order of the valueOf() functions. + */ + context.report({ + node, + messageId: "replaced", + data: { operator: replacementOperator } + }); + } + } + } + + /** + * Warns if an assignment expression uses operator assignment shorthand. + * @param {ASTNode} node An AssignmentExpression node. + * @returns {void} + */ + function prohibit(node) { + if (node.operator !== "=" && !astUtils.isLogicalAssignmentOperator(node.operator)) { + context.report({ + node, + messageId: "unexpected", + data: { operator: node.operator }, + fix(fixer) { + if (canBeFixed(node.left)) { + const firstToken = sourceCode.getFirstToken(node); + const operatorToken = getOperatorToken(node); + const leftText = sourceCode.getText().slice(node.range[0], operatorToken.range[0]); + const newOperator = node.operator.slice(0, -1); + let rightText; + + // Check for comments that would be duplicated. + if (sourceCode.commentsExistBetween(firstToken, operatorToken)) { + return null; + } + + // If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side. + if ( + astUtils.getPrecedence(node.right) <= astUtils.getPrecedence({ type: "BinaryExpression", operator: newOperator }) && + !astUtils.isParenthesised(sourceCode, node.right) + ) { + rightText = `${sourceCode.text.slice(operatorToken.range[1], node.right.range[0])}(${sourceCode.getText(node.right)})`; + } else { + const tokenAfterOperator = sourceCode.getTokenAfter(operatorToken, { includeComments: true }); + let rightTextPrefix = ""; + + if ( + operatorToken.range[1] === tokenAfterOperator.range[0] && + !astUtils.canTokensBeAdjacent({ type: "Punctuator", value: newOperator }, tokenAfterOperator) + ) { + rightTextPrefix = " "; // foo+=+bar -> foo= foo+ +bar + } + + rightText = `${rightTextPrefix}${sourceCode.text.slice(operatorToken.range[1], node.range[1])}`; + } + + return fixer.replaceText(node, `${leftText}= ${leftText}${newOperator}${rightText}`); + } + return null; + } + }); + } + } + + return { + AssignmentExpression: !never ? verify : prohibit + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/operator-linebreak.js b/node_modules/eslint/lib/rules/operator-linebreak.js new file mode 100644 index 0000000..835a400 --- /dev/null +++ b/node_modules/eslint/lib/rules/operator-linebreak.js @@ -0,0 +1,271 @@ +/** + * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before + * @author Benoît Zugmeyer + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "operator-linebreak", + url: "https://eslint.style/rules/js/operator-linebreak" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent linebreak style for operators", + recommended: false, + url: "https://eslint.org/docs/latest/rules/operator-linebreak" + }, + + schema: [ + { + enum: ["after", "before", "none", null] + }, + { + type: "object", + properties: { + overrides: { + type: "object", + additionalProperties: { + enum: ["after", "before", "none", "ignore"] + } + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + operatorAtBeginning: "'{{operator}}' should be placed at the beginning of the line.", + operatorAtEnd: "'{{operator}}' should be placed at the end of the line.", + badLinebreak: "Bad line breaking before and after '{{operator}}'.", + noLinebreak: "There should be no line break before or after '{{operator}}'." + } + }, + + create(context) { + + const usedDefaultGlobal = !context.options[0]; + const globalStyle = context.options[0] || "after"; + const options = context.options[1] || {}; + const styleOverrides = options.overrides ? Object.assign({}, options.overrides) : {}; + + if (usedDefaultGlobal && !styleOverrides["?"]) { + styleOverrides["?"] = "before"; + } + + if (usedDefaultGlobal && !styleOverrides[":"]) { + styleOverrides[":"] = "before"; + } + + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Gets a fixer function to fix rule issues + * @param {Token} operatorToken The operator token of an expression + * @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none' + * @returns {Function} A fixer function + */ + function getFixer(operatorToken, desiredStyle) { + return fixer => { + const tokenBefore = sourceCode.getTokenBefore(operatorToken); + const tokenAfter = sourceCode.getTokenAfter(operatorToken); + const textBefore = sourceCode.text.slice(tokenBefore.range[1], operatorToken.range[0]); + const textAfter = sourceCode.text.slice(operatorToken.range[1], tokenAfter.range[0]); + const hasLinebreakBefore = !astUtils.isTokenOnSameLine(tokenBefore, operatorToken); + const hasLinebreakAfter = !astUtils.isTokenOnSameLine(operatorToken, tokenAfter); + let newTextBefore, newTextAfter; + + if (hasLinebreakBefore !== hasLinebreakAfter && desiredStyle !== "none") { + + // If there is a comment before and after the operator, don't do a fix. + if (sourceCode.getTokenBefore(operatorToken, { includeComments: true }) !== tokenBefore && + sourceCode.getTokenAfter(operatorToken, { includeComments: true }) !== tokenAfter) { + + return null; + } + + /* + * If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator. + * foo && + * bar + * would get fixed to + * foo + * && bar + */ + newTextBefore = textAfter; + newTextAfter = textBefore; + } else { + const LINEBREAK_REGEX = astUtils.createGlobalLinebreakMatcher(); + + // Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings. + newTextBefore = desiredStyle === "before" || textBefore.trim() ? textBefore : textBefore.replace(LINEBREAK_REGEX, ""); + newTextAfter = desiredStyle === "after" || textAfter.trim() ? textAfter : textAfter.replace(LINEBREAK_REGEX, ""); + + // If there was no change (due to interfering comments), don't output a fix. + if (newTextBefore === textBefore && newTextAfter === textAfter) { + return null; + } + } + + if (newTextAfter === "" && tokenAfter.type === "Punctuator" && "+-".includes(operatorToken.value) && tokenAfter.value === operatorToken.value) { + + // To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-. + newTextAfter += " "; + } + + return fixer.replaceTextRange([tokenBefore.range[1], tokenAfter.range[0]], newTextBefore + operatorToken.value + newTextAfter); + }; + } + + /** + * Checks the operator placement + * @param {ASTNode} node The node to check + * @param {ASTNode} rightSide The node that comes after the operator in `node` + * @param {string} operator The operator + * @private + * @returns {void} + */ + function validateNode(node, rightSide, operator) { + + /* + * Find the operator token by searching from the right side, because between the left side and the operator + * there could be additional tokens from type annotations. Search specifically for the token which + * value equals the operator, in order to skip possible opening parentheses before the right side node. + */ + const operatorToken = sourceCode.getTokenBefore(rightSide, token => token.value === operator); + const leftToken = sourceCode.getTokenBefore(operatorToken); + const rightToken = sourceCode.getTokenAfter(operatorToken); + const operatorStyleOverride = styleOverrides[operator]; + const style = operatorStyleOverride || globalStyle; + const fix = getFixer(operatorToken, style); + + // if single line + if (astUtils.isTokenOnSameLine(leftToken, operatorToken) && + astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + // do nothing. + + } else if (operatorStyleOverride !== "ignore" && !astUtils.isTokenOnSameLine(leftToken, operatorToken) && + !astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + // lone operator + context.report({ + node, + loc: operatorToken.loc, + messageId: "badLinebreak", + data: { + operator + }, + fix + }); + + } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "operatorAtBeginning", + data: { + operator + }, + fix + }); + + } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "operatorAtEnd", + data: { + operator + }, + fix + }); + + } else if (style === "none") { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "noLinebreak", + data: { + operator + }, + fix + }); + + } + } + + /** + * Validates a binary expression using `validateNode` + * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated + * @returns {void} + */ + function validateBinaryExpression(node) { + validateNode(node, node.right, node.operator); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + BinaryExpression: validateBinaryExpression, + LogicalExpression: validateBinaryExpression, + AssignmentExpression: validateBinaryExpression, + VariableDeclarator(node) { + if (node.init) { + validateNode(node, node.init, "="); + } + }, + PropertyDefinition(node) { + if (node.value) { + validateNode(node, node.value, "="); + } + }, + ConditionalExpression(node) { + validateNode(node, node.consequent, "?"); + validateNode(node, node.alternate, ":"); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/padded-blocks.js b/node_modules/eslint/lib/rules/padded-blocks.js new file mode 100644 index 0000000..9093d55 --- /dev/null +++ b/node_modules/eslint/lib/rules/padded-blocks.js @@ -0,0 +1,328 @@ +/** + * @fileoverview A rule to ensure blank lines within blocks. + * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "padded-blocks", + url: "https://eslint.style/rules/js/padded-blocks" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow padding within blocks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/padded-blocks" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + blocks: { + enum: ["always", "never"] + }, + switches: { + enum: ["always", "never"] + }, + classes: { + enum: ["always", "never"] + } + }, + additionalProperties: false, + minProperties: 1 + } + ] + }, + { + type: "object", + properties: { + allowSingleLineBlocks: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + alwaysPadBlock: "Block must be padded by blank lines.", + neverPadBlock: "Block must not be padded by blank lines." + } + }, + + create(context) { + const options = {}; + const typeOptions = context.options[0] || "always"; + const exceptOptions = context.options[1] || {}; + + if (typeof typeOptions === "string") { + const shouldHavePadding = typeOptions === "always"; + + options.blocks = shouldHavePadding; + options.switches = shouldHavePadding; + options.classes = shouldHavePadding; + } else { + if (Object.hasOwn(typeOptions, "blocks")) { + options.blocks = typeOptions.blocks === "always"; + } + if (Object.hasOwn(typeOptions, "switches")) { + options.switches = typeOptions.switches === "always"; + } + if (Object.hasOwn(typeOptions, "classes")) { + options.classes = typeOptions.classes === "always"; + } + } + + if (Object.hasOwn(exceptOptions, "allowSingleLineBlocks")) { + options.allowSingleLineBlocks = exceptOptions.allowSingleLineBlocks === true; + } + + const sourceCode = context.sourceCode; + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node A BlockStatement or SwitchStatement node from which to get the open brace. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + return sourceCode.getTokenBefore(node.cases[0]); + } + + if (node.type === "StaticBlock") { + return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token + } + + // `BlockStatement` or `ClassBody` + return sourceCode.getFirstToken(node); + } + + /** + * Checks if the given parameter is a comment node + * @param {ASTNode|Token} node An AST node or token + * @returns {boolean} True if node is a comment + */ + function isComment(node) { + return node.type === "Line" || node.type === "Block"; + } + + /** + * Checks if there is padding between two tokens + * @param {Token} first The first token + * @param {Token} second The second token + * @returns {boolean} True if there is at least a line between the tokens + */ + function isPaddingBetweenTokens(first, second) { + return second.loc.start.line - first.loc.end.line >= 2; + } + + + /** + * Checks if the given token has a blank line after it. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is followed by a blank line. + */ + function getFirstBlockToken(token) { + let prev, + first = token; + + do { + prev = first; + first = sourceCode.getTokenAfter(first, { includeComments: true }); + } while (isComment(first) && first.loc.start.line === prev.loc.end.line); + + return first; + } + + /** + * Checks if the given token is preceded by a blank line. + * @param {Token} token The token to check + * @returns {boolean} Whether or not the token is preceded by a blank line + */ + function getLastBlockToken(token) { + let last = token, + next; + + do { + next = last; + last = sourceCode.getTokenBefore(last, { includeComments: true }); + } while (isComment(last) && last.loc.end.line === next.loc.start.line); + + return last; + } + + /** + * Checks if a node should be padded, according to the rule config. + * @param {ASTNode} node The AST node to check. + * @throws {Error} (Unreachable) + * @returns {boolean} True if the node should be padded, false otherwise. + */ + function requirePaddingFor(node) { + switch (node.type) { + case "BlockStatement": + case "StaticBlock": + return options.blocks; + case "SwitchStatement": + return options.switches; + case "ClassBody": + return options.classes; + + /* c8 ignore next */ + default: + throw new Error("unreachable"); + } + } + + /** + * Checks the given BlockStatement node to be padded if the block is not empty. + * @param {ASTNode} node The AST node of a BlockStatement. + * @returns {void} undefined. + */ + function checkPadding(node) { + const openBrace = getOpenBrace(node), + firstBlockToken = getFirstBlockToken(openBrace), + tokenBeforeFirst = sourceCode.getTokenBefore(firstBlockToken, { includeComments: true }), + closeBrace = sourceCode.getLastToken(node), + lastBlockToken = getLastBlockToken(closeBrace), + tokenAfterLast = sourceCode.getTokenAfter(lastBlockToken, { includeComments: true }), + blockHasTopPadding = isPaddingBetweenTokens(tokenBeforeFirst, firstBlockToken), + blockHasBottomPadding = isPaddingBetweenTokens(lastBlockToken, tokenAfterLast); + + if (options.allowSingleLineBlocks && astUtils.isTokenOnSameLine(tokenBeforeFirst, tokenAfterLast)) { + return; + } + + if (requirePaddingFor(node)) { + + if (!blockHasTopPadding) { + context.report({ + node, + loc: { + start: tokenBeforeFirst.loc.start, + end: firstBlockToken.loc.start + }, + fix(fixer) { + return fixer.insertTextAfter(tokenBeforeFirst, "\n"); + }, + messageId: "alwaysPadBlock" + }); + } + if (!blockHasBottomPadding) { + context.report({ + node, + loc: { + end: tokenAfterLast.loc.start, + start: lastBlockToken.loc.end + }, + fix(fixer) { + return fixer.insertTextBefore(tokenAfterLast, "\n"); + }, + messageId: "alwaysPadBlock" + }); + } + } else { + if (blockHasTopPadding) { + + context.report({ + node, + loc: { + start: tokenBeforeFirst.loc.start, + end: firstBlockToken.loc.start + }, + fix(fixer) { + return fixer.replaceTextRange([tokenBeforeFirst.range[1], firstBlockToken.range[0] - firstBlockToken.loc.start.column], "\n"); + }, + messageId: "neverPadBlock" + }); + } + + if (blockHasBottomPadding) { + + context.report({ + node, + loc: { + end: tokenAfterLast.loc.start, + start: lastBlockToken.loc.end + }, + messageId: "neverPadBlock", + fix(fixer) { + return fixer.replaceTextRange([lastBlockToken.range[1], tokenAfterLast.range[0] - tokenAfterLast.loc.start.column], "\n"); + } + }); + } + } + } + + const rule = {}; + + if (Object.hasOwn(options, "switches")) { + rule.SwitchStatement = function(node) { + if (node.cases.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (Object.hasOwn(options, "blocks")) { + rule.BlockStatement = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + rule.StaticBlock = rule.BlockStatement; + } + + if (Object.hasOwn(options, "classes")) { + rule.ClassBody = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + return rule; + } +}; diff --git a/node_modules/eslint/lib/rules/padding-line-between-statements.js b/node_modules/eslint/lib/rules/padding-line-between-statements.js new file mode 100644 index 0000000..b0421e5 --- /dev/null +++ b/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -0,0 +1,608 @@ +/** + * @fileoverview Rule to require or disallow newlines between statements + * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const LT = `[${Array.from(astUtils.LINEBREAKS).join("")}]`; +const PADDING_LINE_SEQUENCE = new RegExp( + String.raw`^(\s*?${LT})\s*${LT}(\s*;?)$`, + "u" +); +const CJS_EXPORT = /^(?:module\s*\.\s*)?exports(?:\s*\.|\s*\[|$)/u; +const CJS_IMPORT = /^require\(/u; + +/** + * Creates tester which check if a node starts with specific keyword. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newKeywordTester(keyword) { + return { + test: (node, sourceCode) => + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans a single line. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newSinglelineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line === node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans multiple lines. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newMultilineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node is specific type. + * @param {string} type The node type to test. + * @returns {Object} the created tester. + * @private + */ +function newNodeTypeTester(type) { + return { + test: node => + node.type === type + }; +} + +/** + * Checks the given node is an expression statement of IIFE. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is an expression statement of IIFE. + * @private + */ +function isIIFEStatement(node) { + if (node.type === "ExpressionStatement") { + let call = astUtils.skipChainExpression(node.expression); + + if (call.type === "UnaryExpression") { + call = astUtils.skipChainExpression(call.argument); + } + return call.type === "CallExpression" && astUtils.isFunction(call.callee); + } + return false; +} + +/** + * Checks whether the given node is a block-like statement. + * This checks the last token of the node is the closing brace of a block. + * @param {SourceCode} sourceCode The source code to get tokens. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a block-like statement. + * @private + */ +function isBlockLikeStatement(sourceCode, node) { + + // do-while with a block is a block-like statement. + if (node.type === "DoWhileStatement" && node.body.type === "BlockStatement") { + return true; + } + + /* + * IIFE is a block-like statement specially from + * JSCS#disallowPaddingNewLinesAfterBlocks. + */ + if (isIIFEStatement(node)) { + return true; + } + + // Checks the last token is a closing brace of blocks. + const lastToken = sourceCode.getLastToken(node, astUtils.isNotSemicolonToken); + const belongingNode = lastToken && astUtils.isClosingBraceToken(lastToken) + ? sourceCode.getNodeByRangeIndex(lastToken.range[0]) + : null; + + return Boolean(belongingNode) && ( + belongingNode.type === "BlockStatement" || + belongingNode.type === "SwitchStatement" + ); +} + +/** + * Gets the actual last token. + * + * If a semicolon is semicolon-less style's semicolon, this ignores it. + * For example: + * + * foo() + * ;[1, 2, 3].forEach(bar) + * @param {SourceCode} sourceCode The source code to get tokens. + * @param {ASTNode} node The node to get. + * @returns {Token} The actual last token. + * @private + */ +function getActualLastToken(sourceCode, node) { + const semiToken = sourceCode.getLastToken(node); + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const isSemicolonLessStyle = Boolean( + prevToken && + nextToken && + prevToken.range[0] >= node.range[0] && + astUtils.isSemicolonToken(semiToken) && + semiToken.loc.start.line !== prevToken.loc.end.line && + semiToken.loc.end.line === nextToken.loc.start.line + ); + + return isSemicolonLessStyle ? prevToken : semiToken; +} + +/** + * This returns the concatenation of the first 2 captured strings. + * @param {string} _ Unused. Whole matched string. + * @param {string} trailingSpaces The trailing spaces of the first line. + * @param {string} indentSpaces The indentation spaces of the last line. + * @returns {string} The concatenation of trailingSpaces and indentSpaces. + * @private + */ +function replacerToRemovePaddingLines(_, trailingSpaces, indentSpaces) { + return trailingSpaces + indentSpaces; +} + +/** + * Check and report statements for `any` configuration. + * It does nothing. + * @returns {void} + * @private + */ +function verifyForAny() { +} + +/** + * Check and report statements for `never` configuration. + * This autofix removes blank lines between the given 2 statements. + * However, if comments exist between 2 blank lines, it does not remove those + * blank lines automatically. + * @param {RuleContext} context The rule context to report. + * @param {ASTNode} _ Unused. The previous node to check. + * @param {ASTNode} nextNode The next node to check. + * @param {Array} paddingLines The array of token pairs that blank + * lines exist between the pair. + * @returns {void} + * @private + */ +function verifyForNever(context, _, nextNode, paddingLines) { + if (paddingLines.length === 0) { + return; + } + + context.report({ + node: nextNode, + messageId: "unexpectedBlankLine", + fix(fixer) { + if (paddingLines.length >= 2) { + return null; + } + + const prevToken = paddingLines[0][0]; + const nextToken = paddingLines[0][1]; + const start = prevToken.range[1]; + const end = nextToken.range[0]; + const text = context.sourceCode.text + .slice(start, end) + .replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines); + + return fixer.replaceTextRange([start, end], text); + } + }); +} + +/** + * Check and report statements for `always` configuration. + * This autofix inserts a blank line between the given 2 statements. + * If the `prevNode` has trailing comments, it inserts a blank line after the + * trailing comments. + * @param {RuleContext} context The rule context to report. + * @param {ASTNode} prevNode The previous node to check. + * @param {ASTNode} nextNode The next node to check. + * @param {Array} paddingLines The array of token pairs that blank + * lines exist between the pair. + * @returns {void} + * @private + */ +function verifyForAlways(context, prevNode, nextNode, paddingLines) { + if (paddingLines.length > 0) { + return; + } + + context.report({ + node: nextNode, + messageId: "expectedBlankLine", + fix(fixer) { + const sourceCode = context.sourceCode; + let prevToken = getActualLastToken(sourceCode, prevNode); + const nextToken = sourceCode.getFirstTokenBetween( + prevToken, + nextNode, + { + includeComments: true, + + /** + * Skip the trailing comments of the previous node. + * This inserts a blank line after the last trailing comment. + * + * For example: + * + * foo(); // trailing comment. + * // comment. + * bar(); + * + * Get fixed to: + * + * foo(); // trailing comment. + * + * // comment. + * bar(); + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is not a trailing comment. + * @private + */ + filter(token) { + if (astUtils.isTokenOnSameLine(prevToken, token)) { + prevToken = token; + return false; + } + return true; + } + } + ) || nextNode; + const insertText = astUtils.isTokenOnSameLine(prevToken, nextToken) + ? "\n\n" + : "\n"; + + return fixer.insertTextAfter(prevToken, insertText); + } + }); +} + +/** + * Types of blank lines. + * `any`, `never`, and `always` are defined. + * Those have `verify` method to check and report statements. + * @private + */ +const PaddingTypes = { + any: { verify: verifyForAny }, + never: { verify: verifyForNever }, + always: { verify: verifyForAlways } +}; + +/** + * Types of statements. + * Those have `test` method to check it matches to the given statement. + * @private + */ +const StatementTypes = { + "*": { test: () => true }, + "block-like": { + test: (node, sourceCode) => isBlockLikeStatement(sourceCode, node) + }, + "cjs-export": { + test: (node, sourceCode) => + node.type === "ExpressionStatement" && + node.expression.type === "AssignmentExpression" && + CJS_EXPORT.test(sourceCode.getText(node.expression.left)) + }, + "cjs-import": { + test: (node, sourceCode) => + node.type === "VariableDeclaration" && + node.declarations.length > 0 && + Boolean(node.declarations[0].init) && + CJS_IMPORT.test(sourceCode.getText(node.declarations[0].init)) + }, + directive: { + test: astUtils.isDirective + }, + expression: { + test: node => node.type === "ExpressionStatement" && !astUtils.isDirective(node) + }, + iife: { + test: isIIFEStatement + }, + "multiline-block-like": { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + isBlockLikeStatement(sourceCode, node) + }, + "multiline-expression": { + test: node => + node.loc.start.line !== node.loc.end.line && + node.type === "ExpressionStatement" && + !astUtils.isDirective(node) + }, + + "multiline-const": newMultilineKeywordTester("const"), + "multiline-let": newMultilineKeywordTester("let"), + "multiline-var": newMultilineKeywordTester("var"), + "singleline-const": newSinglelineKeywordTester("const"), + "singleline-let": newSinglelineKeywordTester("let"), + "singleline-var": newSinglelineKeywordTester("var"), + + block: newNodeTypeTester("BlockStatement"), + empty: newNodeTypeTester("EmptyStatement"), + function: newNodeTypeTester("FunctionDeclaration"), + + break: newKeywordTester("break"), + case: newKeywordTester("case"), + class: newKeywordTester("class"), + const: newKeywordTester("const"), + continue: newKeywordTester("continue"), + debugger: newKeywordTester("debugger"), + default: newKeywordTester("default"), + do: newKeywordTester("do"), + export: newKeywordTester("export"), + for: newKeywordTester("for"), + if: newKeywordTester("if"), + import: newKeywordTester("import"), + let: newKeywordTester("let"), + return: newKeywordTester("return"), + switch: newKeywordTester("switch"), + throw: newKeywordTester("throw"), + try: newKeywordTester("try"), + var: newKeywordTester("var"), + while: newKeywordTester("while"), + with: newKeywordTester("with") +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "padding-line-between-statements", + url: "https://eslint.style/rules/js/padding-line-between-statements" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow padding lines between statements", + recommended: false, + url: "https://eslint.org/docs/latest/rules/padding-line-between-statements" + }, + + fixable: "whitespace", + + schema: { + definitions: { + paddingType: { + enum: Object.keys(PaddingTypes) + }, + statementType: { + anyOf: [ + { enum: Object.keys(StatementTypes) }, + { + type: "array", + items: { enum: Object.keys(StatementTypes) }, + minItems: 1, + uniqueItems: true + } + ] + } + }, + type: "array", + items: { + type: "object", + properties: { + blankLine: { $ref: "#/definitions/paddingType" }, + prev: { $ref: "#/definitions/statementType" }, + next: { $ref: "#/definitions/statementType" } + }, + additionalProperties: false, + required: ["blankLine", "prev", "next"] + } + }, + + messages: { + unexpectedBlankLine: "Unexpected blank line before this statement.", + expectedBlankLine: "Expected blank line before this statement." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const configureList = context.options || []; + let scopeInfo = null; + + /** + * Processes to enter to new scope. + * This manages the current previous statement. + * @returns {void} + * @private + */ + function enterScope() { + scopeInfo = { + upper: scopeInfo, + prevNode: null + }; + } + + /** + * Processes to exit from the current scope. + * @returns {void} + * @private + */ + function exitScope() { + scopeInfo = scopeInfo.upper; + } + + /** + * Checks whether the given node matches the given type. + * @param {ASTNode} node The statement node to check. + * @param {string|string[]} type The statement type to check. + * @returns {boolean} `true` if the statement node matched the type. + * @private + */ + function match(node, type) { + let innerStatementNode = node; + + while (innerStatementNode.type === "LabeledStatement") { + innerStatementNode = innerStatementNode.body; + } + if (Array.isArray(type)) { + return type.some(match.bind(null, innerStatementNode)); + } + return StatementTypes[type].test(innerStatementNode, sourceCode); + } + + /** + * Finds the last matched configure from configureList. + * @param {ASTNode} prevNode The previous statement to match. + * @param {ASTNode} nextNode The current statement to match. + * @returns {Object} The tester of the last matched configure. + * @private + */ + function getPaddingType(prevNode, nextNode) { + for (let i = configureList.length - 1; i >= 0; --i) { + const configure = configureList[i]; + const matched = + match(prevNode, configure.prev) && + match(nextNode, configure.next); + + if (matched) { + return PaddingTypes[configure.blankLine]; + } + } + return PaddingTypes.any; + } + + /** + * Gets padding line sequences between the given 2 statements. + * Comments are separators of the padding line sequences. + * @param {ASTNode} prevNode The previous statement to count. + * @param {ASTNode} nextNode The current statement to count. + * @returns {Array} The array of token pairs. + * @private + */ + function getPaddingLineSequences(prevNode, nextNode) { + const pairs = []; + let prevToken = getActualLastToken(sourceCode, prevNode); + + if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) { + do { + const token = sourceCode.getTokenAfter( + prevToken, + { includeComments: true } + ); + + if (token.loc.start.line - prevToken.loc.end.line >= 2) { + pairs.push([prevToken, token]); + } + prevToken = token; + + } while (prevToken.range[0] < nextNode.range[0]); + } + + return pairs; + } + + /** + * Verify padding lines between the given node and the previous node. + * @param {ASTNode} node The node to verify. + * @returns {void} + * @private + */ + function verify(node) { + const parentType = node.parent.type; + const validParent = + astUtils.STATEMENT_LIST_PARENTS.has(parentType) || + parentType === "SwitchStatement"; + + if (!validParent) { + return; + } + + // Save this node as the current previous statement. + const prevNode = scopeInfo.prevNode; + + // Verify. + if (prevNode) { + const type = getPaddingType(prevNode, node); + const paddingLines = getPaddingLineSequences(prevNode, node); + + type.verify(context, prevNode, node, paddingLines); + } + + scopeInfo.prevNode = node; + } + + /** + * Verify padding lines between the given node and the previous node. + * Then process to enter to new scope. + * @param {ASTNode} node The node to verify. + * @returns {void} + * @private + */ + function verifyThenEnterScope(node) { + verify(node); + enterScope(); + } + + return { + Program: enterScope, + BlockStatement: enterScope, + SwitchStatement: enterScope, + StaticBlock: enterScope, + "Program:exit": exitScope, + "BlockStatement:exit": exitScope, + "SwitchStatement:exit": exitScope, + "StaticBlock:exit": exitScope, + + ":statement": verify, + + SwitchCase: verifyThenEnterScope, + "SwitchCase:exit": exitScope + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/node_modules/eslint/lib/rules/prefer-arrow-callback.js new file mode 100644 index 0000000..982246e --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-arrow-callback.js @@ -0,0 +1,379 @@ +/** + * @fileoverview A rule to suggest using arrow functions as callbacks. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given variable is a function name. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given MetaProperty node equals to a given value. + * @param {ASTNode} node A MetaProperty node to check. + * @param {string} metaName The name of `MetaProperty.meta`. + * @param {string} propertyName The name of `MetaProperty.property`. + * @returns {boolean} `true` if the node is the specific value. + */ +function checkMetaProperty(node, metaName, propertyName) { + return node.meta.name === metaName && node.property.name === propertyName; +} + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {eslint-scope.Scope} scope A scope to get. + * @returns {eslint-scope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + if (variable.name === "arguments") { + + /* + * If there was a parameter which is named "arguments", the + * implicit "arguments" is not defined. + * So does fast return with null. + */ + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* c8 ignore next */ + return null; +} + +/** + * Checks whether or not a given node is a callback. + * @param {ASTNode} node A node to check. + * @throws {Error} (Unreachable.) + * @returns {Object} + * {boolean} retv.isCallback - `true` if the node is a callback. + * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. + */ +function getCallbackInfo(node) { + const retv = { isCallback: false, isLexicalThis: false }; + let currentNode = node; + let parent = node.parent; + let bound = false; + + while (currentNode) { + switch (parent.type) { + + // Checks parents recursively. + + case "LogicalExpression": + case "ChainExpression": + case "ConditionalExpression": + break; + + // Checks whether the parent node is `.bind(this)` call. + case "MemberExpression": + if ( + parent.object === currentNode && + !parent.property.computed && + parent.property.type === "Identifier" && + parent.property.name === "bind" + ) { + const maybeCallee = parent.parent.type === "ChainExpression" + ? parent.parent + : parent; + + if (astUtils.isCallee(maybeCallee)) { + if (!bound) { + bound = true; // Use only the first `.bind()` to make `isLexicalThis` value. + retv.isLexicalThis = ( + maybeCallee.parent.arguments.length === 1 && + maybeCallee.parent.arguments[0].type === "ThisExpression" + ); + } + parent = maybeCallee.parent; + } else { + return retv; + } + } else { + return retv; + } + break; + + // Checks whether the node is a callback. + case "CallExpression": + case "NewExpression": + if (parent.callee !== currentNode) { + retv.isCallback = true; + } + return retv; + + default: + return retv; + } + + currentNode = parent; + parent = parent.parent; + } + + /* c8 ignore next */ + throw new Error("unreachable"); +} + +/** + * Checks whether a simple list of parameters contains any duplicates. This does not handle complex + * parameter lists (e.g. with destructuring), since complex parameter lists are a SyntaxError with duplicate + * parameter names anyway. Instead, it always returns `false` for complex parameter lists. + * @param {ASTNode[]} paramsList The list of parameters for a function + * @returns {boolean} `true` if the list of parameters contains any duplicates + */ +function hasDuplicateParams(paramsList) { + return paramsList.every(param => param.type === "Identifier") && paramsList.length !== new Set(paramsList.map(param => param.name)).size; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ allowNamedFunctions: false, allowUnboundThis: true }], + + docs: { + description: "Require using arrow functions for callbacks", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/prefer-arrow-callback" + }, + + schema: [ + { + type: "object", + properties: { + allowNamedFunctions: { + type: "boolean" + }, + allowUnboundThis: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + preferArrowCallback: "Unexpected function expression." + } + }, + + create(context) { + const [{ allowNamedFunctions, allowUnboundThis }] = context.options; + const sourceCode = context.sourceCode; + + /* + * {Array<{this: boolean, super: boolean, meta: boolean}>} + * - this - A flag which shows there are one or more ThisExpression. + * - super - A flag which shows there are one or more Super. + * - meta - A flag which shows there are one or more MethProperty. + */ + let stack = []; + + /** + * Pushes new function scope with all `false` flags. + * @returns {void} + */ + function enterScope() { + stack.push({ this: false, super: false, meta: false }); + } + + /** + * Pops a function scope from the stack. + * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope. + */ + function exitScope() { + return stack.pop(); + } + + return { + + // Reset internal state. + Program() { + stack = []; + }, + + // If there are below, it cannot replace with arrow functions merely. + ThisExpression() { + const info = stack.at(-1); + + if (info) { + info.this = true; + } + }, + + Super() { + const info = stack.at(-1); + + if (info) { + info.super = true; + } + }, + + MetaProperty(node) { + const info = stack.at(-1); + + if (info && checkMetaProperty(node, "new", "target")) { + info.meta = true; + } + }, + + // To skip nested scopes. + FunctionDeclaration: enterScope, + "FunctionDeclaration:exit": exitScope, + + // Main. + FunctionExpression: enterScope, + "FunctionExpression:exit"(node) { + const scopeInfo = exitScope(); + + // Skip named function expressions + if (allowNamedFunctions && node.id && node.id.name) { + return; + } + + // Skip generators. + if (node.generator) { + return; + } + + // Skip recursive functions. + const nameVar = sourceCode.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + // Skip if it's using arguments. + const variable = getVariableOfArguments(sourceCode.getScope(node)); + + if (variable && variable.references.length > 0) { + return; + } + + // Reports if it's a callback which can replace with arrows. + const callbackInfo = getCallbackInfo(node); + + if (callbackInfo.isCallback && + (!allowUnboundThis || !scopeInfo.this || callbackInfo.isLexicalThis) && + !scopeInfo.super && + !scopeInfo.meta + ) { + context.report({ + node, + messageId: "preferArrowCallback", + *fix(fixer) { + if ((!callbackInfo.isLexicalThis && scopeInfo.this) || hasDuplicateParams(node.params)) { + + /* + * If the callback function does not have .bind(this) and contains a reference to `this`, there + * is no way to determine what `this` should be, so don't perform any fixes. + * If the callback function has duplicates in its list of parameters (possible in sloppy mode), + * don't replace it with an arrow function, because this is a SyntaxError with arrow functions. + */ + return; + } + + // Remove `.bind(this)` if exists. + if (callbackInfo.isLexicalThis) { + const memberNode = node.parent; + + /* + * If `.bind(this)` exists but the parent is not `.bind(this)`, don't remove it automatically. + * E.g. `(foo || function(){}).bind(this)` + */ + if (memberNode.type !== "MemberExpression") { + return; + } + + const callNode = memberNode.parent; + const firstTokenToRemove = sourceCode.getTokenAfter(memberNode.object, astUtils.isNotClosingParenToken); + const lastTokenToRemove = sourceCode.getLastToken(callNode); + + /* + * If the member expression is parenthesized, don't remove the right paren. + * E.g. `(function(){}.bind)(this)` + * ^^^^^^^^^^^^ + */ + if (astUtils.isParenthesised(sourceCode, memberNode)) { + return; + } + + // If comments exist in the `.bind(this)`, don't remove those. + if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { + return; + } + + yield fixer.removeRange([firstTokenToRemove.range[0], lastTokenToRemove.range[1]]); + } + + // Convert the function expression to an arrow function. + const functionToken = sourceCode.getFirstToken(node, node.async ? 1 : 0); + const leftParenToken = sourceCode.getTokenAfter(functionToken, astUtils.isOpeningParenToken); + const tokenBeforeBody = sourceCode.getTokenBefore(node.body); + + if (sourceCode.commentsExistBetween(functionToken, leftParenToken)) { + + // Remove only extra tokens to keep comments. + yield fixer.remove(functionToken); + if (node.id) { + yield fixer.remove(node.id); + } + } else { + + // Remove extra tokens and spaces. + yield fixer.removeRange([functionToken.range[0], leftParenToken.range[0]]); + } + yield fixer.insertTextAfter(tokenBeforeBody, " =>"); + + // Get the node that will become the new arrow function. + let replacedNode = callbackInfo.isLexicalThis ? node.parent.parent : node; + + if (replacedNode.type === "ChainExpression") { + replacedNode = replacedNode.parent; + } + + /* + * If the replaced node is part of a BinaryExpression, LogicalExpression, or MemberExpression, then + * the arrow function needs to be parenthesized, because `foo || () => {}` is invalid syntax even + * though `foo || function() {}` is valid. + */ + if ( + replacedNode.parent.type !== "CallExpression" && + replacedNode.parent.type !== "ConditionalExpression" && + !astUtils.isParenthesised(sourceCode, replacedNode) && + !astUtils.isParenthesised(sourceCode, node) + ) { + yield fixer.insertTextBefore(replacedNode, "("); + yield fixer.insertTextAfter(replacedNode, ")"); + } + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-const.js b/node_modules/eslint/lib/rules/prefer-const.js new file mode 100644 index 0000000..b495fcc --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-const.js @@ -0,0 +1,505 @@ +/** + * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PATTERN_TYPE = /^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u; +const DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|StaticBlock|SwitchCase)$/u; +const DESTRUCTURING_HOST_TYPE = /^(?:VariableDeclarator|AssignmentExpression)$/u; + +/** + * Checks whether a given node is located at `ForStatement.init` or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is located at `ForStatement.init`. + */ +function isInitOfForStatement(node) { + return node.parent.type === "ForStatement" && node.parent.init === node; +} + +/** + * Checks whether a given Identifier node becomes a VariableDeclaration or not. + * @param {ASTNode} identifier An Identifier node to check. + * @returns {boolean} `true` if the node can become a VariableDeclaration. + */ +function canBecomeVariableDeclaration(identifier) { + let node = identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + return ( + node.type === "VariableDeclarator" || + ( + node.type === "AssignmentExpression" && + node.parent.type === "ExpressionStatement" && + DECLARATION_HOST_TYPE.test(node.parent.parent.type) + ) + ); +} + +/** + * Checks if an property or element is from outer scope or function parameters + * in destructing pattern. + * @param {string} name A variable name to be checked. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @returns {boolean} Indicates if the variable is from outer scope or function parameters. + */ +function isOuterVariableInDestructing(name, initScope) { + + if (initScope.through.some(ref => ref.resolved && ref.resolved.name === name)) { + return true; + } + + const variable = astUtils.getVariableByName(initScope, name); + + if (variable !== null) { + return variable.defs.some(def => def.type === "Parameter"); + } + + return false; +} + +/** + * Gets the VariableDeclarator/AssignmentExpression node that a given reference + * belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * @param {eslint-scope.Reference} reference A reference to get. + * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or + * null. + */ +function getDestructuringHost(reference) { + if (!reference.isWrite()) { + return null; + } + let node = reference.identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + if (!DESTRUCTURING_HOST_TYPE.test(node.type)) { + return null; + } + return node; +} + +/** + * Determines if a destructuring assignment node contains + * any MemberExpression nodes. This is used to determine if a + * variable that is only written once using destructuring can be + * safely converted into a const declaration. + * @param {ASTNode} node The ObjectPattern or ArrayPattern node to check. + * @returns {boolean} True if the destructuring pattern contains + * a MemberExpression, false if not. + */ +function hasMemberExpressionAssignment(node) { + switch (node.type) { + case "ObjectPattern": + return node.properties.some(prop => { + if (prop) { + + /* + * Spread elements have an argument property while + * others have a value property. Because different + * parsers use different node types for spread elements, + * we just check if there is an argument property. + */ + return hasMemberExpressionAssignment(prop.argument || prop.value); + } + + return false; + }); + + case "ArrayPattern": + return node.elements.some(element => { + if (element) { + return hasMemberExpressionAssignment(element); + } + + return false; + }); + + case "AssignmentPattern": + return hasMemberExpressionAssignment(node.left); + + case "MemberExpression": + return true; + + // no default + } + + return false; +} + +/** + * Gets an identifier node of a given variable. + * + * If the initialization exists or one or more reading references exist before + * the first assignment, the identifier node is the node of the declaration. + * Otherwise, the identifier node is the node of the first assignment. + * + * If the variable should not change to const, this function returns null. + * - If the variable is reassigned. + * - If the variable is never initialized nor assigned. + * - If the variable is initialized in a different scope from the declaration. + * - If the unique assignment of the variable cannot change to a declaration. + * e.g. `if (a) b = 1` / `return (b = 1)` + * - If the variable is declared in the global scope and `eslintUsed` is `true`. + * `/*exported foo` directive comment makes such variables. This rule does not + * warn such variables because this rule cannot distinguish whether the + * exported variables are reassigned or not. + * @param {eslint-scope.Variable} variable A variable to get. + * @param {boolean} ignoreReadBeforeAssign + * The value of `ignoreReadBeforeAssign` option. + * @returns {ASTNode|null} + * An Identifier node if the variable should change to const. + * Otherwise, null. + */ +function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { + if (variable.eslintUsed && variable.scope.type === "global") { + return null; + } + + // Finds the unique WriteReference. + let writer = null; + let isReadBeforeInit = false; + const references = variable.references; + + for (let i = 0; i < references.length; ++i) { + const reference = references[i]; + + if (reference.isWrite()) { + const isReassigned = ( + writer !== null && + writer.identifier !== reference.identifier + ); + + if (isReassigned) { + return null; + } + + const destructuringHost = getDestructuringHost(reference); + + if (destructuringHost !== null && destructuringHost.left !== void 0) { + const leftNode = destructuringHost.left; + let hasOuterVariables = false, + hasNonIdentifiers = false; + + if (leftNode.type === "ObjectPattern") { + const properties = leftNode.properties; + + hasOuterVariables = properties + .filter(prop => prop.value) + .map(prop => prop.value.name) + .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + + } else if (leftNode.type === "ArrayPattern") { + const elements = leftNode.elements; + + hasOuterVariables = elements + .map(element => element && element.name) + .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + } + + if (hasOuterVariables || hasNonIdentifiers) { + return null; + } + + } + + writer = reference; + + } else if (reference.isRead() && writer === null) { + if (ignoreReadBeforeAssign) { + return null; + } + isReadBeforeInit = true; + } + } + + /* + * If the assignment is from a different scope, ignore it. + * If the assignment cannot change to a declaration, ignore it. + */ + const shouldBeConst = ( + writer !== null && + writer.from === variable.scope && + canBecomeVariableDeclaration(writer.identifier) + ); + + if (!shouldBeConst) { + return null; + } + + if (isReadBeforeInit) { + return variable.defs[0].name; + } + + return writer.identifier; +} + +/** + * Groups by the VariableDeclarator/AssignmentExpression node that each + * reference of given variables belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * @param {eslint-scope.Variable[]} variables Variables to group by destructuring. + * @param {boolean} ignoreReadBeforeAssign + * The value of `ignoreReadBeforeAssign` option. + * @returns {Map} Grouped identifier nodes. + */ +function groupByDestructuring(variables, ignoreReadBeforeAssign) { + const identifierMap = new Map(); + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + const references = variable.references; + const identifier = getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign); + let prevId = null; + + for (let j = 0; j < references.length; ++j) { + const reference = references[j]; + const id = reference.identifier; + + /* + * Avoid counting a reference twice or more for default values of + * destructuring. + */ + if (id === prevId) { + continue; + } + prevId = id; + + // Add the identifier node into the destructuring group. + const group = getDestructuringHost(reference); + + if (group) { + if (identifierMap.has(group)) { + identifierMap.get(group).push(identifier); + } else { + identifierMap.set(group, [identifier]); + } + } + } + } + + return identifierMap; +} + +/** + * Finds the nearest parent of node with a given type. + * @param {ASTNode} node The node to search from. + * @param {string} type The type field of the parent node. + * @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise. + * @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists. + */ +function findUp(node, type, shouldStop) { + if (!node || shouldStop(node)) { + return null; + } + if (node.type === type) { + return node; + } + return findUp(node.parent, type, shouldStop); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + destructuring: "any", + ignoreReadBeforeAssign: false + }], + + docs: { + description: "Require `const` declarations for variables that are never reassigned after declared", + recommended: false, + url: "https://eslint.org/docs/latest/rules/prefer-const" + }, + + fixable: "code", + + schema: [ + { + type: "object", + properties: { + destructuring: { enum: ["any", "all"] }, + ignoreReadBeforeAssign: { type: "boolean" } + }, + additionalProperties: false + } + ], + messages: { + useConst: "'{{name}}' is never reassigned. Use 'const' instead." + } + }, + + create(context) { + const [{ destructuring, ignoreReadBeforeAssign }] = context.options; + const shouldMatchAnyDestructuredVariable = destructuring !== "all"; + const sourceCode = context.sourceCode; + const variables = []; + let reportCount = 0; + let checkedId = null; + let checkedName = ""; + + + /** + * Reports given identifier nodes if all of the nodes should be declared + * as const. + * + * The argument 'nodes' is an array of Identifier nodes. + * This node is the result of 'getIdentifierIfShouldBeConst()', so it's + * nullable. In simple declaration or assignment cases, the length of + * the array is 1. In destructuring cases, the length of the array can + * be 2 or more. + * @param {(eslint-scope.Reference|null)[]} nodes + * References which are grouped by destructuring to report. + * @returns {void} + */ + function checkGroup(nodes) { + const nodesToReport = nodes.filter(Boolean); + + if (nodes.length && (shouldMatchAnyDestructuredVariable || nodesToReport.length === nodes.length)) { + const varDeclParent = findUp(nodes[0], "VariableDeclaration", parentNode => parentNode.type.endsWith("Statement")); + const isVarDecParentNull = varDeclParent === null; + + if (!isVarDecParentNull && varDeclParent.declarations.length > 0) { + const firstDeclaration = varDeclParent.declarations[0]; + + if (firstDeclaration.init) { + const firstDecParent = firstDeclaration.init.parent; + + /* + * First we check the declaration type and then depending on + * if the type is a "VariableDeclarator" or its an "ObjectPattern" + * we compare the name and id from the first identifier, if the names are different + * we assign the new name, id and reset the count of reportCount and nodeCount in + * order to check each block for the number of reported errors and base our fix + * based on comparing nodes.length and nodesToReport.length. + */ + + if (firstDecParent.type === "VariableDeclarator") { + + if (firstDecParent.id.name !== checkedName) { + checkedName = firstDecParent.id.name; + reportCount = 0; + } + + if (firstDecParent.id.type === "ObjectPattern") { + if (firstDecParent.init.name !== checkedName) { + checkedName = firstDecParent.init.name; + reportCount = 0; + } + } + + if (firstDecParent.id !== checkedId) { + checkedId = firstDecParent.id; + reportCount = 0; + } + } + } + } + + let shouldFix = varDeclParent && + + // Don't do a fix unless all variables in the declarations are initialized (or it's in a for-in or for-of loop) + (varDeclParent.parent.type === "ForInStatement" || varDeclParent.parent.type === "ForOfStatement" || + varDeclParent.declarations.every(declaration => declaration.init)) && + + /* + * If options.destructuring is "all", then this warning will not occur unless + * every assignment in the destructuring should be const. In that case, it's safe + * to apply the fix. + */ + nodesToReport.length === nodes.length; + + if (!isVarDecParentNull && varDeclParent.declarations && varDeclParent.declarations.length !== 1) { + + if (varDeclParent && varDeclParent.declarations && varDeclParent.declarations.length >= 1) { + + /* + * Add nodesToReport.length to a count, then comparing the count to the length + * of the declarations in the current block. + */ + + reportCount += nodesToReport.length; + + let totalDeclarationsCount = 0; + + varDeclParent.declarations.forEach(declaration => { + if (declaration.id.type === "ObjectPattern") { + totalDeclarationsCount += declaration.id.properties.length; + } else if (declaration.id.type === "ArrayPattern") { + totalDeclarationsCount += declaration.id.elements.length; + } else { + totalDeclarationsCount += 1; + } + }); + + shouldFix = shouldFix && (reportCount === totalDeclarationsCount); + } + } + + nodesToReport.forEach(node => { + context.report({ + node, + messageId: "useConst", + data: node, + fix: shouldFix + ? fixer => { + const letKeywordToken = sourceCode.getFirstToken(varDeclParent, t => t.value === varDeclParent.kind); + + /** + * Extend the replacement range to the whole declaration, + * in order to prevent other fixes in the same pass + * https://github.com/eslint/eslint/issues/13899 + */ + return new FixTracker(fixer, sourceCode) + .retainRange(varDeclParent.range) + .replaceTextRange(letKeywordToken.range, "const"); + } + : null + }); + }); + } + } + + return { + "Program:exit"() { + groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(checkGroup); + }, + + VariableDeclaration(node) { + if (node.kind === "let" && !isInitOfForStatement(node)) { + variables.push(...sourceCode.getDeclaredVariables(node)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-destructuring.js b/node_modules/eslint/lib/rules/prefer-destructuring.js new file mode 100644 index 0000000..c0af567 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -0,0 +1,302 @@ +/** + * @fileoverview Prefer destructuring from arrays and objects + * @author Alex LaFroscia + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PRECEDENCE_OF_ASSIGNMENT_EXPR = astUtils.getPrecedence({ type: "AssignmentExpression" }); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require destructuring from arrays and/or objects", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/prefer-destructuring" + }, + + fixable: "code", + + schema: [ + { + + /* + * old support {array: Boolean, object: Boolean} + * new support {VariableDeclarator: {}, AssignmentExpression: {}} + */ + oneOf: [ + { + type: "object", + properties: { + VariableDeclarator: { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + }, + AssignmentExpression: { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + { + type: "object", + properties: { + enforceForRenamedProperties: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + preferDestructuring: "Use {{type}} destructuring." + } + }, + create(context) { + + const enabledTypes = context.options[0]; + const enforceForRenamedProperties = context.options[1] && context.options[1].enforceForRenamedProperties; + let normalizedOptions = { + VariableDeclarator: { array: true, object: true }, + AssignmentExpression: { array: true, object: true } + }; + + if (enabledTypes) { + normalizedOptions = typeof enabledTypes.array !== "undefined" || typeof enabledTypes.object !== "undefined" + ? { VariableDeclarator: enabledTypes, AssignmentExpression: enabledTypes } + : enabledTypes; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks if destructuring type should be checked. + * @param {string} nodeType "AssignmentExpression" or "VariableDeclarator" + * @param {string} destructuringType "array" or "object" + * @returns {boolean} `true` if the destructuring type should be checked for the given node + */ + function shouldCheck(nodeType, destructuringType) { + return normalizedOptions && + normalizedOptions[nodeType] && + normalizedOptions[nodeType][destructuringType]; + } + + /** + * Determines if the given node is accessing an array index + * + * This is used to differentiate array index access from object property + * access. + * @param {ASTNode} node the node to evaluate + * @returns {boolean} whether or not the node is an integer + */ + function isArrayIndexAccess(node) { + return Number.isInteger(node.property.value); + } + + /** + * Report that the given node should use destructuring + * @param {ASTNode} reportNode the node to report + * @param {string} type the type of destructuring that should have been done + * @param {Function|null} fix the fix function or null to pass to context.report + * @returns {void} + */ + function report(reportNode, type, fix) { + context.report({ + node: reportNode, + messageId: "preferDestructuring", + data: { type }, + fix + }); + } + + /** + * Determines if a node should be fixed into object destructuring + * + * The fixer only fixes the simplest case of object destructuring, + * like: `let x = a.x`; + * + * Assignment expression is not fixed. + * Array destructuring is not fixed. + * Renamed property is not fixed. + * @param {ASTNode} node the node to evaluate + * @returns {boolean} whether or not the node should be fixed + */ + function shouldFix(node) { + return node.type === "VariableDeclarator" && + node.id.type === "Identifier" && + node.init.type === "MemberExpression" && + !node.init.computed && + node.init.property.type === "Identifier" && + node.id.name === node.init.property.name; + } + + /** + * Fix a node into object destructuring. + * This function only handles the simplest case of object destructuring, + * see {@link shouldFix}. + * @param {SourceCodeFixer} fixer the fixer object + * @param {ASTNode} node the node to be fixed. + * @returns {Object} a fix for the node + */ + function fixIntoObjectDestructuring(fixer, node) { + const rightNode = node.init; + const sourceCode = context.sourceCode; + + // Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved. + if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(rightNode.object).length) { + return null; + } + + let objectText = sourceCode.getText(rightNode.object); + + if (astUtils.getPrecedence(rightNode.object) < PRECEDENCE_OF_ASSIGNMENT_EXPR) { + objectText = `(${objectText})`; + } + + return fixer.replaceText( + node, + `{${rightNode.property.name}} = ${objectText}` + ); + } + + /** + * Check that the `prefer-destructuring` rules are followed based on the + * given left- and right-hand side of the assignment. + * + * Pulled out into a separate method so that VariableDeclarators and + * AssignmentExpressions can share the same verification logic. + * @param {ASTNode} leftNode the left-hand side of the assignment + * @param {ASTNode} rightNode the right-hand side of the assignment + * @param {ASTNode} reportNode the node to report the error on + * @returns {void} + */ + function performCheck(leftNode, rightNode, reportNode) { + if ( + rightNode.type !== "MemberExpression" || + rightNode.object.type === "Super" || + rightNode.property.type === "PrivateIdentifier" + ) { + return; + } + + if (isArrayIndexAccess(rightNode)) { + if (shouldCheck(reportNode.type, "array")) { + report(reportNode, "array", null); + } + return; + } + + const fix = shouldFix(reportNode) + ? fixer => fixIntoObjectDestructuring(fixer, reportNode) + : null; + + if (shouldCheck(reportNode.type, "object") && enforceForRenamedProperties) { + report(reportNode, "object", fix); + return; + } + + if (shouldCheck(reportNode.type, "object")) { + const property = rightNode.property; + + if ( + (property.type === "Literal" && leftNode.name === property.value) || + (property.type === "Identifier" && leftNode.name === property.name && !rightNode.computed) + ) { + report(reportNode, "object", fix); + } + } + } + + /** + * Check if a given variable declarator is coming from an property access + * that should be using destructuring instead + * @param {ASTNode} node the variable declarator to check + * @returns {void} + */ + function checkVariableDeclarator(node) { + + // Skip if variable is declared without assignment + if (!node.init) { + return; + } + + // We only care about member expressions past this point + if (node.init.type !== "MemberExpression") { + return; + } + + performCheck(node.id, node.init, node); + } + + /** + * Run the `prefer-destructuring` check on an AssignmentExpression + * @param {ASTNode} node the AssignmentExpression node + * @returns {void} + */ + function checkAssignmentExpression(node) { + if (node.operator === "=") { + performCheck(node.left, node.right, node); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclarator: checkVariableDeclarator, + AssignmentExpression: checkAssignmentExpression + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js b/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js new file mode 100644 index 0000000..cc9b51f --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js @@ -0,0 +1,192 @@ +/** + * @fileoverview Rule to disallow Math.pow in favor of the ** operator + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PRECEDENCE_OF_EXPONENTIATION_EXPR = astUtils.getPrecedence({ type: "BinaryExpression", operator: "**" }); + +/** + * Determines whether the given node needs parens if used as the base in an exponentiation binary expression. + * @param {ASTNode} base The node to check. + * @returns {boolean} `true` if the node needs to be parenthesised. + */ +function doesBaseNeedParens(base) { + return ( + + // '**' is right-associative, parens are needed when Math.pow(a ** b, c) is converted to (a ** b) ** c + astUtils.getPrecedence(base) <= PRECEDENCE_OF_EXPONENTIATION_EXPR || + + // An unary operator cannot be used immediately before an exponentiation expression + base.type === "AwaitExpression" || + base.type === "UnaryExpression" + ); +} + +/** + * Determines whether the given node needs parens if used as the exponent in an exponentiation binary expression. + * @param {ASTNode} exponent The node to check. + * @returns {boolean} `true` if the node needs to be parenthesised. + */ +function doesExponentNeedParens(exponent) { + + // '**' is right-associative, there is no need for parens when Math.pow(a, b ** c) is converted to a ** b ** c + return astUtils.getPrecedence(exponent) < PRECEDENCE_OF_EXPONENTIATION_EXPR; +} + +/** + * Determines whether an exponentiation binary expression at the place of the given node would need parens. + * @param {ASTNode} node A node that would be replaced by an exponentiation binary expression. + * @param {SourceCode} sourceCode A SourceCode object. + * @returns {boolean} `true` if the expression needs to be parenthesised. + */ +function doesExponentiationExpressionNeedParens(node, sourceCode) { + const parent = node.parent.type === "ChainExpression" ? node.parent.parent : node.parent; + + const parentPrecedence = astUtils.getPrecedence(parent); + const needsParens = ( + parent.type === "ClassDeclaration" || + ( + parent.type.endsWith("Expression") && + (parentPrecedence === -1 || parentPrecedence >= PRECEDENCE_OF_EXPONENTIATION_EXPR) && + !(parent.type === "BinaryExpression" && parent.operator === "**" && parent.right === node) && + !((parent.type === "CallExpression" || parent.type === "NewExpression") && parent.arguments.includes(node)) && + !(parent.type === "MemberExpression" && parent.computed && parent.property === node) && + !(parent.type === "ArrayExpression") + ) + ); + + return needsParens && !astUtils.isParenthesised(sourceCode, node); +} + +/** + * Optionally parenthesizes given text. + * @param {string} text The text to parenthesize. + * @param {boolean} shouldParenthesize If `true`, the text will be parenthesised. + * @returns {string} parenthesised or unchanged text. + */ +function parenthesizeIfShould(text, shouldParenthesize) { + return shouldParenthesize ? `(${text})` : text; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow the use of `Math.pow` in favor of the `**` operator", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/prefer-exponentiation-operator" + }, + + schema: [], + fixable: "code", + + messages: { + useExponentiation: "Use the '**' operator instead of 'Math.pow'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Reports the given node. + * @param {ASTNode} node 'Math.pow()' node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "useExponentiation", + fix(fixer) { + if ( + node.arguments.length !== 2 || + node.arguments.some(arg => arg.type === "SpreadElement") || + sourceCode.getCommentsInside(node).length > 0 + ) { + return null; + } + + const base = node.arguments[0], + exponent = node.arguments[1], + baseText = sourceCode.getText(base), + exponentText = sourceCode.getText(exponent), + shouldParenthesizeBase = doesBaseNeedParens(base), + shouldParenthesizeExponent = doesExponentNeedParens(exponent), + shouldParenthesizeAll = doesExponentiationExpressionNeedParens(node, sourceCode); + + let prefix = "", + suffix = ""; + + if (!shouldParenthesizeAll) { + if (!shouldParenthesizeBase) { + const firstReplacementToken = sourceCode.getFirstToken(base), + tokenBefore = sourceCode.getTokenBefore(node); + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstReplacementToken) + ) { + prefix = " "; // a+Math.pow(++b, c) -> a+ ++b**c + } + } + if (!shouldParenthesizeExponent) { + const lastReplacementToken = sourceCode.getLastToken(exponent), + tokenAfter = sourceCode.getTokenAfter(node); + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(lastReplacementToken, tokenAfter) + ) { + suffix = " "; // Math.pow(a, b)in c -> a**b in c + } + } + } + + const baseReplacement = parenthesizeIfShould(baseText, shouldParenthesizeBase), + exponentReplacement = parenthesizeIfShould(exponentText, shouldParenthesizeExponent), + replacement = parenthesizeIfShould(`${baseReplacement}**${exponentReplacement}`, shouldParenthesizeAll); + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); + } + }); + } + + return { + Program(node) { + const scope = sourceCode.getScope(node); + const tracker = new ReferenceTracker(scope); + const trackMap = { + Math: { + pow: { [CALL]: true } + } + }; + + for (const { node: refNode } of tracker.iterateGlobalReferences(trackMap)) { + report(refNode); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-named-capture-group.js b/node_modules/eslint/lib/rules/prefer-named-capture-group.js new file mode 100644 index 0000000..a82ee1f --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-named-capture-group.js @@ -0,0 +1,178 @@ +/** + * @fileoverview Rule to enforce requiring named capture groups in regular expression. + * @author Pig Fang + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStringIfConstant +} = require("@eslint-community/eslint-utils"); +const regexpp = require("@eslint-community/regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new regexpp.RegExpParser(); + +/** + * Creates fixer suggestions for the regex, if statically determinable. + * @param {number} groupStart Starting index of the regex group. + * @param {string} pattern The regular expression pattern to be checked. + * @param {string} rawText Source text of the regexNode. + * @param {ASTNode} regexNode AST node which contains the regular expression. + * @returns {Array} Fixer suggestions for the regex, if statically determinable. + */ +function suggestIfPossible(groupStart, pattern, rawText, regexNode) { + switch (regexNode.type) { + case "Literal": + if (typeof regexNode.value === "string" && rawText.includes("\\")) { + return null; + } + break; + case "TemplateLiteral": + if (regexNode.expressions.length || rawText.slice(1, -1) !== pattern) { + return null; + } + break; + default: + return null; + } + + const start = regexNode.range[0] + groupStart + 2; + + return [ + { + fix(fixer) { + const existingTemps = pattern.match(/temp\d+/gu) || []; + const highestTempCount = existingTemps.reduce( + (previous, next) => + Math.max(previous, Number(next.slice("temp".length))), + 0 + ); + + return fixer.insertTextBeforeRange( + [start, start], + `?` + ); + }, + messageId: "addGroupName" + }, + { + fix(fixer) { + return fixer.insertTextBeforeRange( + [start, start], + "?:" + ); + }, + messageId: "addNonCapture" + } + ]; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce using named capture group in regular expression", + recommended: false, + url: "https://eslint.org/docs/latest/rules/prefer-named-capture-group" + }, + + hasSuggestions: true, + + schema: [], + + messages: { + addGroupName: "Add name to capture group.", + addNonCapture: "Convert group to non-capturing.", + required: "Capture group '{{group}}' should be converted to a named or non-capturing group." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + /** + * Function to check regular expression. + * @param {string} pattern The regular expression pattern to be checked. + * @param {ASTNode} node AST node which contains the regular expression or a call/new expression. + * @param {ASTNode} regexNode AST node which contains the regular expression. + * @param {string|null} flags The regular expression flags to be checked. + * @returns {void} + */ + function checkRegex(pattern, node, regexNode, flags) { + let ast; + + try { + ast = parser.parsePattern(pattern, 0, pattern.length, { + unicode: Boolean(flags && flags.includes("u")), + unicodeSets: Boolean(flags && flags.includes("v")) + }); + } catch { + + // ignore regex syntax errors + return; + } + + regexpp.visitRegExpAST(ast, { + onCapturingGroupEnter(group) { + if (!group.name) { + const rawText = sourceCode.getText(regexNode); + const suggest = suggestIfPossible(group.start, pattern, rawText, regexNode); + + context.report({ + node, + messageId: "required", + data: { + group: group.raw + }, + suggest + }); + } + } + }); + } + + return { + Literal(node) { + if (node.regex) { + checkRegex(node.regex.pattern, node, node, node.regex.flags); + } + }, + Program(node) { + const scope = sourceCode.getScope(node); + const tracker = new ReferenceTracker(scope); + const traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node: refNode } of tracker.iterateGlobalReferences(traceMap)) { + const regex = getStringIfConstant(refNode.arguments[0]); + const flags = getStringIfConstant(refNode.arguments[1]); + + if (regex) { + checkRegex(regex, refNode, refNode.arguments[0], flags); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-numeric-literals.js b/node_modules/eslint/lib/rules/prefer-numeric-literals.js new file mode 100644 index 0000000..4233b59 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-numeric-literals.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Rule to disallow `parseInt()` in favor of binary, octal, and hexadecimal literals + * @author Annie Zhang, Henry Zhu + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const radixMap = new Map([ + [2, { system: "binary", literalPrefix: "0b" }], + [8, { system: "octal", literalPrefix: "0o" }], + [16, { system: "hexadecimal", literalPrefix: "0x" }] +]); + +/** + * Checks to see if a CallExpression's callee node is `parseInt` or + * `Number.parseInt`. + * @param {ASTNode} calleeNode The callee node to evaluate. + * @returns {boolean} True if the callee is `parseInt` or `Number.parseInt`, + * false otherwise. + */ +function isParseInt(calleeNode) { + return ( + astUtils.isSpecificId(calleeNode, "parseInt") || + astUtils.isSpecificMemberAccess(calleeNode, "Number", "parseInt") + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/prefer-numeric-literals" + }, + + schema: [], + + messages: { + useLiteral: "Use {{system}} literals instead of {{functionName}}()." + }, + + fixable: "code" + }, + + create(context) { + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + "CallExpression[arguments.length=2]"(node) { + const [strNode, radixNode] = node.arguments, + str = astUtils.getStaticStringValue(strNode), + radix = radixNode.value; + + if ( + str !== null && + astUtils.isStringLiteral(strNode) && + radixNode.type === "Literal" && + typeof radix === "number" && + radixMap.has(radix) && + isParseInt(node.callee) + ) { + + const { system, literalPrefix } = radixMap.get(radix); + + context.report({ + node, + messageId: "useLiteral", + data: { + system, + functionName: sourceCode.getText(node.callee) + }, + fix(fixer) { + if (sourceCode.getCommentsInside(node).length) { + return null; + } + + const replacement = `${literalPrefix}${str}`; + + if (+replacement !== parseInt(str, radix)) { + + /* + * If the newly-produced literal would be invalid, (e.g. 0b1234), + * or it would yield an incorrect parseInt result for some other reason, don't make a fix. + * + * If `str` had numeric separators, `+replacement` will evaluate to `NaN` because unary `+` + * per the specification doesn't support numeric separators. Thus, the above condition will be `true` + * (`NaN !== anything` is always `true`) regardless of the `parseInt(str, radix)` value. + * Consequently, no autofixes will be made. This is correct behavior because `parseInt` also + * doesn't support numeric separators, but it does parse part of the string before the first `_`, + * so the autofix would be invalid: + * + * parseInt("1_1", 2) // === 1 + * 0b1_1 // === 3 + */ + return null; + } + + const tokenBefore = sourceCode.getTokenBefore(node), + tokenAfter = sourceCode.getTokenAfter(node); + let prefix = "", + suffix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(replacement, tokenAfter) + ) { + suffix = " "; + } + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-object-has-own.js b/node_modules/eslint/lib/rules/prefer-object-has-own.js new file mode 100644 index 0000000..97ea64f --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-object-has-own.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Prefers Object.hasOwn() instead of Object.prototype.hasOwnProperty.call() + * @author Nitin Kumar + * @author Gautam Arora + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given node is considered to be an access to a property of `Object.prototype`. + * @param {ASTNode} node `MemberExpression` node to evaluate. + * @returns {boolean} `true` if `node.object` is `Object`, `Object.prototype`, or `{}` (empty 'ObjectExpression' node). + */ +function hasLeftHandObject(node) { + + /* + * ({}).hasOwnProperty.call(obj, prop) - `true` + * ({ foo }.hasOwnProperty.call(obj, prop)) - `false`, object literal should be empty + */ + if (node.object.type === "ObjectExpression" && node.object.properties.length === 0) { + return true; + } + + const objectNodeToCheck = node.object.type === "MemberExpression" && astUtils.getStaticPropertyName(node.object) === "prototype" ? node.object.object : node.object; + + if (objectNodeToCheck.type === "Identifier" && objectNodeToCheck.name === "Object") { + return true; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + docs: { + description: + "Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/prefer-object-has-own" + }, + schema: [], + messages: { + useHasOwn: "Use 'Object.hasOwn()' instead of 'Object.prototype.hasOwnProperty.call()'." + }, + fixable: "code" + }, + create(context) { + + const sourceCode = context.sourceCode; + + return { + CallExpression(node) { + if (!(node.callee.type === "MemberExpression" && node.callee.object.type === "MemberExpression")) { + return; + } + + const calleePropertyName = astUtils.getStaticPropertyName(node.callee); + const objectPropertyName = astUtils.getStaticPropertyName(node.callee.object); + const isObject = hasLeftHandObject(node.callee.object); + + // check `Object` scope + const scope = sourceCode.getScope(node); + const variable = astUtils.getVariableByName(scope, "Object"); + + if ( + calleePropertyName === "call" && + objectPropertyName === "hasOwnProperty" && + isObject && + variable && variable.scope.type === "global" + ) { + context.report({ + node, + messageId: "useHasOwn", + fix(fixer) { + + if (sourceCode.getCommentsInside(node.callee).length > 0) { + return null; + } + + const tokenJustBeforeNode = sourceCode.getTokenBefore(node.callee, { includeComments: true }); + + // for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335 + if ( + tokenJustBeforeNode && + tokenJustBeforeNode.range[1] === node.callee.range[0] && + !astUtils.canTokensBeAdjacent(tokenJustBeforeNode, "Object.hasOwn") + ) { + return fixer.replaceText(node.callee, " Object.hasOwn"); + } + + return fixer.replaceText(node.callee, "Object.hasOwn"); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-object-spread.js b/node_modules/eslint/lib/rules/prefer-object-spread.js new file mode 100644 index 0000000..eb282dc --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-object-spread.js @@ -0,0 +1,299 @@ +/** + * @fileoverview Rule to disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead + * @author Sharmila Jesupaul + */ + +"use strict"; + +const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils"); +const { + isCommaToken, + isOpeningParenToken, + isClosingParenToken, + isParenthesised +} = require("./utils/ast-utils"); + +const ANY_SPACE = /\s/u; + +/** + * Helper that checks if the Object.assign call has array spread + * @param {ASTNode} node The node that the rule warns on + * @returns {boolean} - Returns true if the Object.assign call has array spread + */ +function hasArraySpread(node) { + return node.arguments.some(arg => arg.type === "SpreadElement"); +} + +/** + * Determines whether the given node is an accessor property (getter/setter). + * @param {ASTNode} node Node to check. + * @returns {boolean} `true` if the node is a getter or a setter. + */ +function isAccessorProperty(node) { + return node.type === "Property" && + (node.kind === "get" || node.kind === "set"); +} + +/** + * Determines whether the given object expression node has accessor properties (getters/setters). + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {boolean} `true` if the node has at least one getter/setter. + */ +function hasAccessors(node) { + return node.properties.some(isAccessorProperty); +} + +/** + * Determines whether the given call expression node has object expression arguments with accessor properties (getters/setters). + * @param {ASTNode} node `CallExpression` node to check. + * @returns {boolean} `true` if the node has at least one argument that is an object expression with at least one getter/setter. + */ +function hasArgumentsWithAccessors(node) { + return node.arguments + .filter(arg => arg.type === "ObjectExpression") + .some(hasAccessors); +} + +/** + * Helper that checks if the node needs parentheses to be valid JS. + * The default is to wrap the node in parentheses to avoid parsing errors. + * @param {ASTNode} node The node that the rule warns on + * @param {Object} sourceCode in context sourcecode object + * @returns {boolean} - Returns true if the node needs parentheses + */ +function needsParens(node, sourceCode) { + const parent = node.parent; + + switch (parent.type) { + case "VariableDeclarator": + case "ArrayExpression": + case "ReturnStatement": + case "CallExpression": + case "Property": + return false; + case "AssignmentExpression": + return parent.left === node && !isParenthesised(sourceCode, node); + default: + return !isParenthesised(sourceCode, node); + } +} + +/** + * Determines if an argument needs parentheses. The default is to not add parens. + * @param {ASTNode} node The node to be checked. + * @param {Object} sourceCode in context sourcecode object + * @returns {boolean} True if the node needs parentheses + */ +function argNeedsParens(node, sourceCode) { + switch (node.type) { + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "ConditionalExpression": + return !isParenthesised(sourceCode, node); + default: + return false; + } +} + +/** + * Get the parenthesis tokens of a given ObjectExpression node. + * This includes the braces of the object literal and enclosing parentheses. + * @param {ASTNode} node The node to get. + * @param {Token} leftArgumentListParen The opening paren token of the argument list. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token[]} The parenthesis tokens of the node. This is sorted by the location. + */ +function getParenTokens(node, leftArgumentListParen, sourceCode) { + const parens = [sourceCode.getFirstToken(node), sourceCode.getLastToken(node)]; + let leftNext = sourceCode.getTokenBefore(node); + let rightNext = sourceCode.getTokenAfter(node); + + // Note: don't include the parens of the argument list. + while ( + leftNext && + rightNext && + leftNext.range[0] > leftArgumentListParen.range[0] && + isOpeningParenToken(leftNext) && + isClosingParenToken(rightNext) + ) { + parens.push(leftNext, rightNext); + leftNext = sourceCode.getTokenBefore(leftNext); + rightNext = sourceCode.getTokenAfter(rightNext); + } + + return parens.sort((a, b) => a.range[0] - b.range[0]); +} + +/** + * Get the range of a given token and around whitespaces. + * @param {Token} token The token to get range. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {number} The end of the range of the token and around whitespaces. + */ +function getStartWithSpaces(token, sourceCode) { + const text = sourceCode.text; + let start = token.range[0]; + + // If the previous token is a line comment then skip this step to avoid commenting this token out. + { + const prevToken = sourceCode.getTokenBefore(token, { includeComments: true }); + + if (prevToken && prevToken.type === "Line") { + return start; + } + } + + // Detect spaces before the token. + while (ANY_SPACE.test(text[start - 1] || "")) { + start -= 1; + } + + return start; +} + +/** + * Get the range of a given token and around whitespaces. + * @param {Token} token The token to get range. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {number} The start of the range of the token and around whitespaces. + */ +function getEndWithSpaces(token, sourceCode) { + const text = sourceCode.text; + let end = token.range[1]; + + // Detect spaces after the token. + while (ANY_SPACE.test(text[end] || "")) { + end += 1; + } + + return end; +} + +/** + * Autofixes the Object.assign call to use an object spread instead. + * @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call + * @param {string} sourceCode sourceCode of the Object.assign call + * @returns {Function} autofixer - replaces the Object.assign with a spread object. + */ +function defineFixer(node, sourceCode) { + return function *(fixer) { + const leftParen = sourceCode.getTokenAfter(node.callee, isOpeningParenToken); + const rightParen = sourceCode.getLastToken(node); + + // Remove everything before the opening paren: callee `Object.assign`, type arguments, and whitespace between the callee and the paren. + yield fixer.removeRange([node.range[0], leftParen.range[0]]); + + // Replace the parens of argument list to braces. + if (needsParens(node, sourceCode)) { + yield fixer.replaceText(leftParen, "({"); + yield fixer.replaceText(rightParen, "})"); + } else { + yield fixer.replaceText(leftParen, "{"); + yield fixer.replaceText(rightParen, "}"); + } + + // Process arguments. + for (const argNode of node.arguments) { + const innerParens = getParenTokens(argNode, leftParen, sourceCode); + const left = innerParens.shift(); + const right = innerParens.pop(); + + if (argNode.type === "ObjectExpression") { + const maybeTrailingComma = sourceCode.getLastToken(argNode, 1); + const maybeArgumentComma = sourceCode.getTokenAfter(right); + + /* + * Make bare this object literal. + * And remove spaces inside of the braces for better formatting. + */ + for (const innerParen of innerParens) { + yield fixer.remove(innerParen); + } + const leftRange = [left.range[0], getEndWithSpaces(left, sourceCode)]; + const rightRange = [ + Math.max(getStartWithSpaces(right, sourceCode), leftRange[1]), // Ensure ranges don't overlap + right.range[1] + ]; + + yield fixer.removeRange(leftRange); + yield fixer.removeRange(rightRange); + + // Remove the comma of this argument if it's duplication. + if ( + (argNode.properties.length === 0 || isCommaToken(maybeTrailingComma)) && + isCommaToken(maybeArgumentComma) + ) { + yield fixer.remove(maybeArgumentComma); + } + } else { + + // Make spread. + if (argNeedsParens(argNode, sourceCode)) { + yield fixer.insertTextBefore(left, "...("); + yield fixer.insertTextAfter(right, ")"); + } else { + yield fixer.insertTextBefore(left, "..."); + } + } + } + }; +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: + "Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/prefer-object-spread" + }, + + schema: [], + fixable: "code", + + messages: { + useSpreadMessage: "Use an object spread instead of `Object.assign` eg: `{ ...foo }`.", + useLiteralMessage: "Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + Program(node) { + const scope = sourceCode.getScope(node); + const tracker = new ReferenceTracker(scope); + const trackMap = { + Object: { + assign: { [CALL]: true } + } + }; + + // Iterate all calls of `Object.assign` (only of the global variable `Object`). + for (const { node: refNode } of tracker.iterateGlobalReferences(trackMap)) { + if ( + refNode.arguments.length >= 1 && + refNode.arguments[0].type === "ObjectExpression" && + !hasArraySpread(refNode) && + !( + refNode.arguments.length > 1 && + hasArgumentsWithAccessors(refNode) + ) + ) { + const messageId = refNode.arguments.length === 1 + ? "useLiteralMessage" + : "useSpreadMessage"; + const fix = defineFixer(refNode, sourceCode); + + context.report({ node: refNode, messageId, fix }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js new file mode 100644 index 0000000..276b422 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js @@ -0,0 +1,136 @@ +/** + * @fileoverview restrict values that can be used as Promise rejection reasons + * @author Teddy Katz + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allowEmptyReject: false + }], + + docs: { + description: "Require using Error objects as Promise rejection reasons", + recommended: false, + url: "https://eslint.org/docs/latest/rules/prefer-promise-reject-errors" + }, + + fixable: null, + + schema: [ + { + type: "object", + properties: { + allowEmptyReject: { type: "boolean" } + }, + additionalProperties: false + } + ], + + messages: { + rejectAnError: "Expected the Promise rejection reason to be an Error." + } + }, + + create(context) { + + const [{ allowEmptyReject }] = context.options; + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks the argument of a reject() or Promise.reject() CallExpression, and reports it if it can't be an Error + * @param {ASTNode} callExpression A CallExpression node which is used to reject a Promise + * @returns {void} + */ + function checkRejectCall(callExpression) { + if (!callExpression.arguments.length && allowEmptyReject) { + return; + } + if ( + !callExpression.arguments.length || + !astUtils.couldBeError(callExpression.arguments[0]) || + callExpression.arguments[0].type === "Identifier" && callExpression.arguments[0].name === "undefined" + ) { + context.report({ + node: callExpression, + messageId: "rejectAnError" + }); + } + } + + /** + * Determines whether a function call is a Promise.reject() call + * @param {ASTNode} node A CallExpression node + * @returns {boolean} `true` if the call is a Promise.reject() call + */ + function isPromiseRejectCall(node) { + return astUtils.isSpecificMemberAccess(node.callee, "Promise", "reject"); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + // Check `Promise.reject(value)` calls. + CallExpression(node) { + if (isPromiseRejectCall(node)) { + checkRejectCall(node); + } + }, + + /* + * Check for `new Promise((resolve, reject) => {})`, and check for reject() calls. + * This function is run on "NewExpression:exit" instead of "NewExpression" to ensure that + * the nodes in the expression already have the `parent` property. + */ + "NewExpression:exit"(node) { + if ( + node.callee.type === "Identifier" && node.callee.name === "Promise" && + node.arguments.length && astUtils.isFunction(node.arguments[0]) && + node.arguments[0].params.length > 1 && node.arguments[0].params[1].type === "Identifier" + ) { + sourceCode.getDeclaredVariables(node.arguments[0]) + + /* + * Find the first variable that matches the second parameter's name. + * If the first parameter has the same name as the second parameter, then the variable will actually + * be "declared" when the first parameter is evaluated, but then it will be immediately overwritten + * by the second parameter. It's not possible for an expression with the variable to be evaluated before + * the variable is overwritten, because functions with duplicate parameters cannot have destructuring or + * default assignments in their parameter lists. Therefore, it's not necessary to explicitly account for + * this case. + */ + .find(variable => variable.name === node.arguments[0].params[1].name) + + // Get the references to that variable. + .references + + // Only check the references that read the parameter's value. + .filter(ref => ref.isRead()) + + // Only check the references that are used as the callee in a function call, e.g. `reject(foo)`. + .filter(ref => ref.identifier.parent.type === "CallExpression" && ref.identifier === ref.identifier.parent.callee) + + // Check the argument of the function call to determine whether it's an Error. + .forEach(ref => checkRejectCall(ref.identifier.parent)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-reflect.js b/node_modules/eslint/lib/rules/prefer-reflect.js new file mode 100644 index 0000000..a6f69bd --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-reflect.js @@ -0,0 +1,131 @@ +/** + * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods + * @author Keith Cirkel + * @deprecated in ESLint v3.9.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require `Reflect` methods where applicable", + recommended: false, + url: "https://eslint.org/docs/latest/rules/prefer-reflect" + }, + + deprecated: { + message: "The original intention of this rule was misguided.", + url: "https://eslint.org/docs/latest/rules/prefer-reflect", + deprecatedSince: "3.9.0", + availableUntil: null, + replacedBy: [] + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + enum: [ + "apply", + "call", + "delete", + "defineProperty", + "getOwnPropertyDescriptor", + "getPrototypeOf", + "setPrototypeOf", + "isExtensible", + "getOwnPropertyNames", + "preventExtensions" + ] + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + preferReflect: "Avoid using {{existing}}, instead use {{substitute}}." + } + }, + + create(context) { + const existingNames = { + apply: "Function.prototype.apply", + call: "Function.prototype.call", + defineProperty: "Object.defineProperty", + getOwnPropertyDescriptor: "Object.getOwnPropertyDescriptor", + getPrototypeOf: "Object.getPrototypeOf", + setPrototypeOf: "Object.setPrototypeOf", + isExtensible: "Object.isExtensible", + getOwnPropertyNames: "Object.getOwnPropertyNames", + preventExtensions: "Object.preventExtensions" + }; + + const reflectSubstitutes = { + apply: "Reflect.apply", + call: "Reflect.apply", + defineProperty: "Reflect.defineProperty", + getOwnPropertyDescriptor: "Reflect.getOwnPropertyDescriptor", + getPrototypeOf: "Reflect.getPrototypeOf", + setPrototypeOf: "Reflect.setPrototypeOf", + isExtensible: "Reflect.isExtensible", + getOwnPropertyNames: "Reflect.getOwnPropertyNames", + preventExtensions: "Reflect.preventExtensions" + }; + + const exceptions = (context.options[0] || {}).exceptions || []; + + /** + * Reports the Reflect violation based on the `existing` and `substitute` + * @param {Object} node The node that violates the rule. + * @param {string} existing The existing method name that has been used. + * @param {string} substitute The Reflect substitute that should be used. + * @returns {void} + */ + function report(node, existing, substitute) { + context.report({ + node, + messageId: "preferReflect", + data: { + existing, + substitute + } + }); + } + + return { + CallExpression(node) { + const methodName = (node.callee.property || {}).name; + const isReflectCall = (node.callee.object || {}).name === "Reflect"; + const hasReflectSubstitute = Object.hasOwn(reflectSubstitutes, methodName); + const userConfiguredException = exceptions.includes(methodName); + + if (hasReflectSubstitute && !isReflectCall && !userConfiguredException) { + report(node, existingNames[methodName], reflectSubstitutes[methodName]); + } + }, + UnaryExpression(node) { + const isDeleteOperator = node.operator === "delete"; + const targetsIdentifier = node.argument.type === "Identifier"; + const userConfiguredException = exceptions.includes("delete"); + + if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) { + report(node, "the delete keyword", "Reflect.deleteProperty"); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-regex-literals.js b/node_modules/eslint/lib/rules/prefer-regex-literals.js new file mode 100644 index 0000000..f760102 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-regex-literals.js @@ -0,0 +1,510 @@ +/** + * @fileoverview Rule to disallow use of the `RegExp` constructor in favor of regular expression literals + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("@eslint-community/eslint-utils"); +const { RegExpValidator, visitRegExpAST, RegExpParser } = require("@eslint-community/regexpp"); +const { canTokensBeAdjacent } = require("./utils/ast-utils"); +const { REGEXPP_LATEST_ECMA_VERSION } = require("./utils/regular-expressions"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is a string literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a string literal. + */ +function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; +} + +/** + * Determines whether the given node is a regex literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a regex literal. + */ +function isRegexLiteral(node) { + return node.type === "Literal" && Object.hasOwn(node, "regex"); +} + +const validPrecedingTokens = new Set([ + "(", + ";", + "[", + ",", + "=", + "+", + "*", + "-", + "?", + "~", + "%", + "**", + "!", + "typeof", + "instanceof", + "&&", + "||", + "??", + "return", + "...", + "delete", + "void", + "in", + "<", + ">", + "<=", + ">=", + "==", + "===", + "!=", + "!==", + "<<", + ">>", + ">>>", + "&", + "|", + "^", + ":", + "{", + "=>", + "*=", + "<<=", + ">>=", + ">>>=", + "^=", + "|=", + "&=", + "??=", + "||=", + "&&=", + "**=", + "+=", + "-=", + "/=", + "%=", + "/", + "do", + "break", + "continue", + "debugger", + "case", + "throw" +]); + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + disallowRedundantWrapping: false + }], + + docs: { + description: "Disallow use of the `RegExp` constructor in favor of regular expression literals", + recommended: false, + url: "https://eslint.org/docs/latest/rules/prefer-regex-literals" + }, + + hasSuggestions: true, + + schema: [ + { + type: "object", + properties: { + disallowRedundantWrapping: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor.", + replaceWithLiteral: "Replace with an equivalent regular expression literal.", + replaceWithLiteralAndFlags: "Replace with an equivalent regular expression literal with flags '{{ flags }}'.", + replaceWithIntendedLiteralAndFlags: "Replace with a regular expression literal with flags '{{ flags }}'.", + unexpectedRedundantRegExp: "Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.", + unexpectedRedundantRegExpWithFlags: "Use regular expression literal with flags instead of the 'RegExp' constructor." + } + }, + + create(context) { + const [{ disallowRedundantWrapping }] = context.options; + const sourceCode = context.sourceCode; + + /** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ + function isGlobalReference(node) { + const scope = sourceCode.getScope(node); + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; + } + + /** + * Determines whether the given node is a String.raw`` tagged template expression + * with a static template literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is String.raw`` with a static template. + */ + function isStringRawTaggedStaticTemplateLiteral(node) { + return node.type === "TaggedTemplateExpression" && + astUtils.isSpecificMemberAccess(node.tag, "String", "raw") && + isGlobalReference(astUtils.skipChainExpression(node.tag).object) && + astUtils.isStaticTemplateLiteral(node.quasi); + } + + /** + * Gets the value of a string + * @param {ASTNode} node The node to get the string of. + * @returns {string|null} The value of the node. + */ + function getStringValue(node) { + if (isStringLiteral(node)) { + return node.value; + } + + if (astUtils.isStaticTemplateLiteral(node)) { + return node.quasis[0].value.cooked; + } + + if (isStringRawTaggedStaticTemplateLiteral(node)) { + return node.quasi.quasis[0].value.raw; + } + + return null; + } + + /** + * Determines whether the given node is considered to be a static string by the logic of this rule. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a static string. + */ + function isStaticString(node) { + return isStringLiteral(node) || + astUtils.isStaticTemplateLiteral(node) || + isStringRawTaggedStaticTemplateLiteral(node); + } + + /** + * Determines whether the relevant arguments of the given are all static string literals. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if all arguments are static strings. + */ + function hasOnlyStaticStringArguments(node) { + const args = node.arguments; + + if ((args.length === 1 || args.length === 2) && args.every(isStaticString)) { + return true; + } + + return false; + } + + /** + * Determines whether the arguments of the given node indicate that a regex literal is unnecessarily wrapped. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node already contains a regex literal argument. + */ + function isUnnecessarilyWrappedRegexLiteral(node) { + const args = node.arguments; + + if (args.length === 1 && isRegexLiteral(args[0])) { + return true; + } + + if (args.length === 2 && isRegexLiteral(args[0]) && isStaticString(args[1])) { + return true; + } + + return false; + } + + /** + * Returns a ecmaVersion compatible for regexpp. + * @param {number} ecmaVersion The ecmaVersion to convert. + * @returns {import("@eslint-community/regexpp/ecma-versions").EcmaVersion} The resulting ecmaVersion compatible for regexpp. + */ + function getRegexppEcmaVersion(ecmaVersion) { + if (ecmaVersion <= 5) { + return 5; + } + return Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION); + } + + const regexppEcmaVersion = getRegexppEcmaVersion(context.languageOptions.ecmaVersion); + + /** + * Makes a character escaped or else returns null. + * @param {string} character The character to escape. + * @returns {string} The resulting escaped character. + */ + function resolveEscapes(character) { + switch (character) { + case "\n": + case "\\\n": + return "\\n"; + + case "\r": + case "\\\r": + return "\\r"; + + case "\t": + case "\\\t": + return "\\t"; + + case "\v": + case "\\\v": + return "\\v"; + + case "\f": + case "\\\f": + return "\\f"; + + case "/": + return "\\/"; + + default: + return null; + } + } + + /** + * Checks whether the given regex and flags are valid for the ecma version or not. + * @param {string} pattern The regex pattern to check. + * @param {string | undefined} flags The regex flags to check. + * @returns {boolean} True if the given regex pattern and flags are valid for the ecma version. + */ + function isValidRegexForEcmaVersion(pattern, flags) { + const validator = new RegExpValidator({ ecmaVersion: regexppEcmaVersion }); + + try { + validator.validatePattern(pattern, 0, pattern.length, { + unicode: flags ? flags.includes("u") : false, + unicodeSets: flags ? flags.includes("v") : false + }); + if (flags) { + validator.validateFlags(flags); + } + return true; + } catch { + return false; + } + } + + /** + * Checks whether two given regex flags contain the same flags or not. + * @param {string} flagsA The regex flags. + * @param {string} flagsB The regex flags. + * @returns {boolean} True if two regex flags contain same flags. + */ + function areFlagsEqual(flagsA, flagsB) { + return [...flagsA].sort().join("") === [...flagsB].sort().join(""); + } + + + /** + * Merges two regex flags. + * @param {string} flagsA The regex flags. + * @param {string} flagsB The regex flags. + * @returns {string} The merged regex flags. + */ + function mergeRegexFlags(flagsA, flagsB) { + const flagsSet = new Set([ + ...flagsA, + ...flagsB + ]); + + return [...flagsSet].join(""); + } + + /** + * Checks whether a give node can be fixed to the given regex pattern and flags. + * @param {ASTNode} node The node to check. + * @param {string} pattern The regex pattern to check. + * @param {string} flags The regex flags + * @returns {boolean} True if a node can be fixed to the given regex pattern and flags. + */ + function canFixTo(node, pattern, flags) { + const tokenBefore = sourceCode.getTokenBefore(node); + + return sourceCode.getCommentsInside(node).length === 0 && + (!tokenBefore || validPrecedingTokens.has(tokenBefore.value)) && + isValidRegexForEcmaVersion(pattern, flags); + } + + /** + * Returns a safe output code considering the before and after tokens. + * @param {ASTNode} node The regex node. + * @param {string} newRegExpValue The new regex expression value. + * @returns {string} The output code. + */ + function getSafeOutput(node, newRegExpValue) { + const tokenBefore = sourceCode.getTokenBefore(node); + const tokenAfter = sourceCode.getTokenAfter(node); + + return (tokenBefore && !canTokensBeAdjacent(tokenBefore, newRegExpValue) && tokenBefore.range[1] === node.range[0] ? " " : "") + + newRegExpValue + + (tokenAfter && !canTokensBeAdjacent(newRegExpValue, tokenAfter) && node.range[1] === tokenAfter.range[0] ? " " : ""); + + } + + return { + Program(node) { + const scope = sourceCode.getScope(node); + const tracker = new ReferenceTracker(scope); + const traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node: refNode } of tracker.iterateGlobalReferences(traceMap)) { + if (disallowRedundantWrapping && isUnnecessarilyWrappedRegexLiteral(refNode)) { + const regexNode = refNode.arguments[0]; + + if (refNode.arguments.length === 2) { + const suggests = []; + + const argFlags = getStringValue(refNode.arguments[1]) || ""; + + if (canFixTo(refNode, regexNode.regex.pattern, argFlags)) { + suggests.push({ + messageId: "replaceWithLiteralAndFlags", + pattern: regexNode.regex.pattern, + flags: argFlags + }); + } + + const literalFlags = regexNode.regex.flags || ""; + const mergedFlags = mergeRegexFlags(literalFlags, argFlags); + + if ( + !areFlagsEqual(mergedFlags, argFlags) && + canFixTo(refNode, regexNode.regex.pattern, mergedFlags) + ) { + suggests.push({ + messageId: "replaceWithIntendedLiteralAndFlags", + pattern: regexNode.regex.pattern, + flags: mergedFlags + }); + } + + context.report({ + node: refNode, + messageId: "unexpectedRedundantRegExpWithFlags", + suggest: suggests.map(({ flags, pattern, messageId }) => ({ + messageId, + data: { + flags + }, + fix(fixer) { + return fixer.replaceText(refNode, getSafeOutput(refNode, `/${pattern}/${flags}`)); + } + })) + }); + } else { + const outputs = []; + + if (canFixTo(refNode, regexNode.regex.pattern, regexNode.regex.flags)) { + outputs.push(sourceCode.getText(regexNode)); + } + + + context.report({ + node: refNode, + messageId: "unexpectedRedundantRegExp", + suggest: outputs.map(output => ({ + messageId: "replaceWithLiteral", + fix(fixer) { + return fixer.replaceText( + refNode, + getSafeOutput(refNode, output) + ); + } + })) + }); + } + } else if (hasOnlyStaticStringArguments(refNode)) { + let regexContent = getStringValue(refNode.arguments[0]); + let noFix = false; + let flags; + + if (refNode.arguments[1]) { + flags = getStringValue(refNode.arguments[1]); + } + + if (!canFixTo(refNode, regexContent, flags)) { + noFix = true; + } + + if (!/^[-a-zA-Z0-9\\[\](){} \t\r\n\v\f!@#$%^&*+^_=/~`.> accumulator + sourceText.slice(token.range[1], allTokens[index + 1].range[0]), ""); + } + + /** + * Returns a template literal form of the given node. + * @param {ASTNode} currentNode A node that should be converted to a template literal + * @param {string} textBeforeNode Text that should appear before the node + * @param {string} textAfterNode Text that should appear after the node + * @returns {string} A string form of this node, represented as a template literal + */ + function getTemplateLiteral(currentNode, textBeforeNode, textAfterNode) { + if (currentNode.type === "Literal" && typeof currentNode.value === "string") { + + /* + * If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted + * as a template placeholder. However, if the code already contains a backslash before the ${ or ` + * for some reason, don't add another backslash, because that would change the meaning of the code (it would cause + * an actual backslash character to appear before the dollar sign). + */ + return `\`${currentNode.raw.slice(1, -1).replace(/\\*(\$\{|`)/gu, matched => { + if (matched.lastIndexOf("\\") % 2) { + return `\\${matched}`; + } + return matched; + + // Unescape any quotes that appear in the original Literal that no longer need to be escaped. + }).replace(new RegExp(`\\\\${currentNode.raw[0]}`, "gu"), currentNode.raw[0])}\``; + } + + if (currentNode.type === "TemplateLiteral") { + return sourceCode.getText(currentNode); + } + + if (isConcatenation(currentNode) && hasStringLiteral(currentNode)) { + const plusSign = sourceCode.getFirstTokenBetween(currentNode.left, currentNode.right, token => token.value === "+"); + const textBeforePlus = getTextBetween(currentNode.left, plusSign); + const textAfterPlus = getTextBetween(plusSign, currentNode.right); + const leftEndsWithCurly = endsWithTemplateCurly(currentNode.left); + const rightStartsWithCurly = startsWithTemplateCurly(currentNode.right); + + if (leftEndsWithCurly) { + + // If the left side of the expression ends with a template curly, add the extra text to the end of the curly bracket. + // `foo${bar}` /* comment */ + 'baz' --> `foo${bar /* comment */ }${baz}` + return getTemplateLiteral(currentNode.left, textBeforeNode, textBeforePlus + textAfterPlus).slice(0, -1) + + getTemplateLiteral(currentNode.right, null, textAfterNode).slice(1); + } + if (rightStartsWithCurly) { + + // Otherwise, if the right side of the expression starts with a template curly, add the text there. + // 'foo' /* comment */ + `${bar}baz` --> `foo${ /* comment */ bar}baz` + return getTemplateLiteral(currentNode.left, textBeforeNode, null).slice(0, -1) + + getTemplateLiteral(currentNode.right, textBeforePlus + textAfterPlus, textAfterNode).slice(1); + } + + /* + * Otherwise, these nodes should not be combined into a template curly, since there is nowhere to put + * the text between them. + */ + return `${getTemplateLiteral(currentNode.left, textBeforeNode, null)}${textBeforePlus}+${textAfterPlus}${getTemplateLiteral(currentNode.right, textAfterNode, null)}`; + } + + return `\`\${${textBeforeNode || ""}${sourceCode.getText(currentNode)}${textAfterNode || ""}}\``; + } + + /** + * Returns a fixer object that converts a non-string binary expression to a template literal + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A node that should be converted to a template literal + * @returns {Object} A fix for this binary expression + */ + function fixNonStringBinaryExpression(fixer, node) { + const topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + if (hasOctalOrNonOctalDecimalEscapeSequence(topBinaryExpr)) { + return null; + } + + return fixer.replaceText(topBinaryExpr, getTemplateLiteral(topBinaryExpr, null, null)); + } + + /** + * Reports if a given node is string concatenation with non string literals. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkForStringConcat(node) { + if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) { + return; + } + + const topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + // Checks whether or not this node had been checked already. + if (done[topBinaryExpr.range[0]]) { + return; + } + done[topBinaryExpr.range[0]] = true; + + if (hasNonStringLiteral(topBinaryExpr)) { + context.report({ + node: topBinaryExpr, + messageId: "unexpectedStringConcatenation", + fix: fixer => fixNonStringBinaryExpression(fixer, node) + }); + } + } + + return { + Program() { + done = Object.create(null); + }, + + Literal: checkForStringConcat, + TemplateLiteral: checkForStringConcat + }; + } +}; diff --git a/node_modules/eslint/lib/rules/quote-props.js b/node_modules/eslint/lib/rules/quote-props.js new file mode 100644 index 0000000..cd43988 --- /dev/null +++ b/node_modules/eslint/lib/rules/quote-props.js @@ -0,0 +1,328 @@ +/** + * @fileoverview Rule to flag non-quoted property names in object literals. + * @author Mathias Bynens + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const espree = require("espree"); +const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "quote-props", + url: "https://eslint.style/rules/js/quote-props" + } + } + ] + }, + type: "suggestion", + + docs: { + description: "Require quotes around object literal property names", + recommended: false, + url: "https://eslint.org/docs/latest/rules/quote-props" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + }, + { + type: "object", + properties: { + keywords: { + type: "boolean" + }, + unnecessary: { + type: "boolean" + }, + numbers: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + messages: { + requireQuotesDueToReservedWord: "Properties should be quoted as '{{property}}' is a reserved word.", + inconsistentlyQuotedProperty: "Inconsistently quoted property '{{key}}' found.", + unnecessarilyQuotedProperty: "Unnecessarily quoted property '{{property}}' found.", + unquotedReservedProperty: "Unquoted reserved word '{{property}}' used as key.", + unquotedNumericProperty: "Unquoted number literal '{{property}}' used as key.", + unquotedPropertyFound: "Unquoted property '{{property}}' found.", + redundantQuoting: "Properties shouldn't be quoted as all quotes are redundant." + } + }, + + create(context) { + + const MODE = context.options[0], + KEYWORDS = context.options[1] && context.options[1].keywords, + CHECK_UNNECESSARY = !context.options[1] || context.options[1].unnecessary !== false, + NUMBERS = context.options[1] && context.options[1].numbers, + + sourceCode = context.sourceCode; + + + /** + * Checks whether a certain string constitutes an ES3 token + * @param {string} tokenStr The string to be checked. + * @returns {boolean} `true` if it is an ES3 token. + */ + function isKeyword(tokenStr) { + return keywords.includes(tokenStr); + } + + /** + * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary) + * @param {string} rawKey The raw key value from the source + * @param {espreeTokens} tokens The espree-tokenized node key + * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked + * @returns {boolean} Whether or not a key has redundant quotes. + * @private + */ + function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) { + return tokens.length === 1 && tokens[0].start === 0 && tokens[0].end === rawKey.length && + (["Identifier", "Keyword", "Null", "Boolean"].includes(tokens[0].type) || + (tokens[0].type === "Numeric" && !skipNumberLiterals && String(+tokens[0].value) === tokens[0].value)); + } + + /** + * Returns a string representation of a property node with quotes removed + * @param {ASTNode} key Key AST Node, which may or may not be quoted + * @returns {string} A replacement string for this property + */ + function getUnquotedKey(key) { + return key.type === "Identifier" ? key.name : key.value; + } + + /** + * Returns a string representation of a property node with quotes added + * @param {ASTNode} key Key AST Node, which may or may not be quoted + * @returns {string} A replacement string for this property + */ + function getQuotedKey(key) { + if (key.type === "Literal" && typeof key.value === "string") { + + // If the key is already a string literal, don't replace the quotes with double quotes. + return sourceCode.getText(key); + } + + // Otherwise, the key is either an identifier or a number literal. + return `"${key.type === "Identifier" ? key.name : key.value}"`; + } + + /** + * Ensures that a property's key is quoted only when necessary + * @param {ASTNode} node Property AST node + * @returns {void} + */ + function checkUnnecessaryQuotes(node) { + const key = node.key; + + if (node.method || node.computed || node.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + let tokens; + + try { + tokens = espree.tokenize(key.value); + } catch { + return; + } + + if (tokens.length !== 1) { + return; + } + + const isKeywordToken = isKeyword(tokens[0].value); + + if (isKeywordToken && KEYWORDS) { + return; + } + + if (CHECK_UNNECESSARY && areQuotesRedundant(key.value, tokens, NUMBERS)) { + context.report({ + node, + messageId: "unnecessarilyQuotedProperty", + data: { property: key.value }, + fix: fixer => fixer.replaceText(key, getUnquotedKey(key)) + }); + } + } else if (KEYWORDS && key.type === "Identifier" && isKeyword(key.name)) { + context.report({ + node, + messageId: "unquotedReservedProperty", + data: { property: key.name }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } else if (NUMBERS && key.type === "Literal" && astUtils.isNumericLiteral(key)) { + context.report({ + node, + messageId: "unquotedNumericProperty", + data: { property: key.value }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } + } + + /** + * Ensures that a property's key is quoted + * @param {ASTNode} node Property AST node + * @returns {void} + */ + function checkOmittedQuotes(node) { + const key = node.key; + + if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) { + context.report({ + node, + messageId: "unquotedPropertyFound", + data: { property: key.name || key.value }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } + } + + /** + * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes + * @param {ASTNode} node Property AST node + * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy + * @returns {void} + */ + function checkConsistency(node, checkQuotesRedundancy) { + const quotedProps = [], + unquotedProps = []; + let keywordKeyName = null, + necessaryQuotes = false; + + node.properties.forEach(property => { + const key = property.key; + + if (!key || property.method || property.computed || property.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + + quotedProps.push(property); + + if (checkQuotesRedundancy) { + let tokens; + + try { + tokens = espree.tokenize(key.value); + } catch { + necessaryQuotes = true; + return; + } + + necessaryQuotes = necessaryQuotes || !areQuotesRedundant(key.value, tokens) || KEYWORDS && isKeyword(tokens[0].value); + } + } else if (KEYWORDS && checkQuotesRedundancy && key.type === "Identifier" && isKeyword(key.name)) { + unquotedProps.push(property); + necessaryQuotes = true; + keywordKeyName = key.name; + } else { + unquotedProps.push(property); + } + }); + + if (checkQuotesRedundancy && quotedProps.length && !necessaryQuotes) { + quotedProps.forEach(property => { + context.report({ + node: property, + messageId: "redundantQuoting", + fix: fixer => fixer.replaceText(property.key, getUnquotedKey(property.key)) + }); + }); + } else if (unquotedProps.length && keywordKeyName) { + unquotedProps.forEach(property => { + context.report({ + node: property, + messageId: "requireQuotesDueToReservedWord", + data: { property: keywordKeyName }, + fix: fixer => fixer.replaceText(property.key, getQuotedKey(property.key)) + }); + }); + } else if (quotedProps.length && unquotedProps.length) { + unquotedProps.forEach(property => { + context.report({ + node: property, + messageId: "inconsistentlyQuotedProperty", + data: { key: property.key.name || property.key.value }, + fix: fixer => fixer.replaceText(property.key, getQuotedKey(property.key)) + }); + }); + } + } + + return { + Property(node) { + if (MODE === "always" || !MODE) { + checkOmittedQuotes(node); + } + if (MODE === "as-needed") { + checkUnnecessaryQuotes(node); + } + }, + ObjectExpression(node) { + if (MODE === "consistent") { + checkConsistency(node, false); + } + if (MODE === "consistent-as-needed") { + checkConsistency(node, true); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/quotes.js b/node_modules/eslint/lib/rules/quotes.js new file mode 100644 index 0000000..fd754c2 --- /dev/null +++ b/node_modules/eslint/lib/rules/quotes.js @@ -0,0 +1,368 @@ +/** + * @fileoverview A rule to choose between single and double quote marks + * @author Matt DuVall , Brandon Payton + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const QUOTE_SETTINGS = { + double: { + quote: "\"", + alternateQuote: "'", + description: "doublequote" + }, + single: { + quote: "'", + alternateQuote: "\"", + description: "singlequote" + }, + backtick: { + quote: "`", + alternateQuote: "\"", + description: "backtick" + } +}; + +// An unescaped newline is a newline preceded by an even number of backslashes. +const UNESCAPED_LINEBREAK_PATTERN = new RegExp(String.raw`(^|[^\\])(\\\\)*[${Array.from(astUtils.LINEBREAKS).join("")}]`, "u"); + +/** + * Switches quoting of javascript string between ' " and ` + * escaping and unescaping as necessary. + * Only escaping of the minimal set of characters is changed. + * Note: escaping of newlines when switching from backtick to other quotes is not handled. + * @param {string} str A string to convert. + * @returns {string} The string with changed quotes. + * @private + */ +QUOTE_SETTINGS.double.convert = +QUOTE_SETTINGS.single.convert = +QUOTE_SETTINGS.backtick.convert = function(str) { + const newQuote = this.quote; + const oldQuote = str[0]; + + if (newQuote === oldQuote) { + return str; + } + return newQuote + str.slice(1, -1).replace(/\\(\$\{|\r\n?|\n|.)|["'`]|\$\{|(\r\n?|\n)/gu, (match, escaped, newline) => { + if (escaped === oldQuote || oldQuote === "`" && escaped === "${") { + return escaped; // unescape + } + if (match === newQuote || newQuote === "`" && match === "${") { + return `\\${match}`; // escape + } + if (newline && oldQuote === "`") { + return "\\n"; // escape newlines + } + return match; + }) + newQuote; +}; + +const AVOID_ESCAPE = "avoid-escape"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "quotes", + url: "https://eslint.style/rules/js/quotes" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce the consistent use of either backticks, double, or single quotes", + recommended: false, + url: "https://eslint.org/docs/latest/rules/quotes" + }, + + fixable: "code", + + schema: [ + { + enum: ["single", "double", "backtick"] + }, + { + anyOf: [ + { + enum: ["avoid-escape"] + }, + { + type: "object", + properties: { + avoidEscape: { + type: "boolean" + }, + allowTemplateLiterals: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + wrongQuotes: "Strings must use {{description}}." + } + }, + + create(context) { + + const quoteOption = context.options[0], + settings = QUOTE_SETTINGS[quoteOption || "double"], + options = context.options[1], + allowTemplateLiterals = options && options.allowTemplateLiterals === true, + sourceCode = context.sourceCode; + let avoidEscape = options && options.avoidEscape === true; + + // deprecated + if (options === AVOID_ESCAPE) { + avoidEscape = true; + } + + /** + * Determines if a given node is part of JSX syntax. + * + * This function returns `true` in the following cases: + * + * - `
` ... If the literal is an attribute value, the parent of the literal is `JSXAttribute`. + * - `
foo
` ... If the literal is a text content, the parent of the literal is `JSXElement`. + * - `<>foo` ... If the literal is a text content, the parent of the literal is `JSXFragment`. + * + * In particular, this function returns `false` in the following cases: + * + * - `
` + * - `
{"foo"}
` + * + * In both cases, inside of the braces is handled as normal JavaScript. + * The braces are `JSXExpressionContainer` nodes. + * @param {ASTNode} node The Literal node to check. + * @returns {boolean} True if the node is a part of JSX, false if not. + * @private + */ + function isJSXLiteral(node) { + return node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment"; + } + + /** + * Checks whether or not a given node is a directive. + * The directive is a `ExpressionStatement` which has only a string literal not surrounded by + * parentheses. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a directive. + * @private + */ + function isDirective(node) { + return ( + node.type === "ExpressionStatement" && + node.expression.type === "Literal" && + typeof node.expression.value === "string" && + !astUtils.isParenthesised(sourceCode, node.expression) + ); + } + + /** + * Checks whether a specified node is either part of, or immediately follows a (possibly empty) directive prologue. + * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive} + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether a specified node is either part of, or immediately follows a (possibly empty) directive prologue. + * @private + */ + function isExpressionInOrJustAfterDirectivePrologue(node) { + if (!astUtils.isTopLevelExpressionStatement(node.parent)) { + return false; + } + const block = node.parent.parent; + + // Check the node is at a prologue. + for (let i = 0; i < block.body.length; ++i) { + const statement = block.body[i]; + + if (statement === node.parent) { + return true; + } + if (!isDirective(statement)) { + break; + } + } + + return false; + } + + /** + * Checks whether or not a given node is allowed as non backtick. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is allowed as non backtick. + * @private + */ + function isAllowedAsNonBacktick(node) { + const parent = node.parent; + + switch (parent.type) { + + // Directive Prologues. + case "ExpressionStatement": + return !astUtils.isParenthesised(sourceCode, node) && isExpressionInOrJustAfterDirectivePrologue(node); + + // LiteralPropertyName. + case "Property": + case "PropertyDefinition": + case "MethodDefinition": + return parent.key === node && !parent.computed; + + // ModuleSpecifier. + case "ImportDeclaration": + case "ExportNamedDeclaration": + return parent.source === node; + + // ModuleExportName or ModuleSpecifier. + case "ExportAllDeclaration": + return parent.exported === node || parent.source === node; + + // ModuleExportName. + case "ImportSpecifier": + return parent.imported === node; + + // ModuleExportName. + case "ExportSpecifier": + return parent.local === node || parent.exported === node; + + // Others don't allow. + default: + return false; + } + } + + /** + * Checks whether or not a given TemplateLiteral node is actually using any of the special features provided by template literal strings. + * @param {ASTNode} node A TemplateLiteral node to check. + * @returns {boolean} Whether or not the TemplateLiteral node is using any of the special features provided by template literal strings. + * @private + */ + function isUsingFeatureOfTemplateLiteral(node) { + const hasTag = node.parent.type === "TaggedTemplateExpression" && node === node.parent.quasi; + + if (hasTag) { + return true; + } + + const hasStringInterpolation = node.expressions.length > 0; + + if (hasStringInterpolation) { + return true; + } + + const isMultilineString = node.quasis.length >= 1 && UNESCAPED_LINEBREAK_PATTERN.test(node.quasis[0].value.raw); + + if (isMultilineString) { + return true; + } + + return false; + } + + return { + + Literal(node) { + const val = node.value, + rawVal = node.raw; + + if (settings && typeof val === "string") { + let isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) || + isJSXLiteral(node) || + astUtils.isSurroundedBy(rawVal, settings.quote); + + if (!isValid && avoidEscape) { + isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.includes(settings.quote); + } + + if (!isValid) { + context.report({ + node, + messageId: "wrongQuotes", + data: { + description: settings.description + }, + fix(fixer) { + if (quoteOption === "backtick" && astUtils.hasOctalOrNonOctalDecimalEscapeSequence(rawVal)) { + + /* + * An octal or non-octal decimal escape sequence in a template literal would + * produce syntax error, even in non-strict mode. + */ + return null; + } + + return fixer.replaceText(node, settings.convert(node.raw)); + } + }); + } + } + }, + + TemplateLiteral(node) { + + // Don't throw an error if backticks are expected or a template literal feature is in use. + if ( + allowTemplateLiterals || + quoteOption === "backtick" || + isUsingFeatureOfTemplateLiteral(node) + ) { + return; + } + + context.report({ + node, + messageId: "wrongQuotes", + data: { + description: settings.description + }, + fix(fixer) { + if (astUtils.isTopLevelExpressionStatement(node.parent) && !astUtils.isParenthesised(sourceCode, node)) { + + /* + * TemplateLiterals aren't actually directives, but fixing them might turn + * them into directives and change the behavior of the code. + */ + return null; + } + return fixer.replaceText(node, settings.convert(sourceCode.getText(node))); + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/radix.js b/node_modules/eslint/lib/rules/radix.js new file mode 100644 index 0000000..6d37d18 --- /dev/null +++ b/node_modules/eslint/lib/rules/radix.js @@ -0,0 +1,200 @@ +/** + * @fileoverview Rule to flag use of parseInt without a radix argument + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const MODE_ALWAYS = "always", + MODE_AS_NEEDED = "as-needed"; + +const validRadixValues = new Set(Array.from({ length: 37 - 2 }, (_, index) => index + 2)); + +/** + * Checks whether a given variable is shadowed or not. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is shadowed. + */ +function isShadowed(variable) { + return variable.defs.length >= 1; +} + +/** + * Checks whether a given node is a MemberExpression of `parseInt` method or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a MemberExpression of `parseInt` + * method. + */ +function isParseIntMethod(node) { + return ( + node.type === "MemberExpression" && + !node.computed && + node.property.type === "Identifier" && + node.property.name === "parseInt" + ); +} + +/** + * Checks whether a given node is a valid value of radix or not. + * + * The following values are invalid. + * + * - A literal except integers between 2 and 36. + * - undefined. + * @param {ASTNode} radix A node of radix to check. + * @returns {boolean} `true` if the node is valid. + */ +function isValidRadix(radix) { + return !( + (radix.type === "Literal" && !validRadixValues.has(radix.value)) || + (radix.type === "Identifier" && radix.name === "undefined") + ); +} + +/** + * Checks whether a given node is a default value of radix or not. + * @param {ASTNode} radix A node of radix to check. + * @returns {boolean} `true` if the node is the literal node of `10`. + */ +function isDefaultRadix(radix) { + return radix.type === "Literal" && radix.value === 10; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [MODE_ALWAYS], + + docs: { + description: "Enforce the consistent use of the radix argument when using `parseInt()`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/radix" + }, + + hasSuggestions: true, + + schema: [ + { + enum: ["always", "as-needed"] + } + ], + + messages: { + missingParameters: "Missing parameters.", + redundantRadix: "Redundant radix parameter.", + missingRadix: "Missing radix parameter.", + invalidRadix: "Invalid radix parameter, must be an integer between 2 and 36.", + addRadixParameter10: "Add radix parameter `10` for parsing decimal numbers." + } + }, + + create(context) { + const [mode] = context.options; + const sourceCode = context.sourceCode; + + /** + * Checks the arguments of a given CallExpression node and reports it if it + * offends this rule. + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + function checkArguments(node) { + const args = node.arguments; + + switch (args.length) { + case 0: + context.report({ + node, + messageId: "missingParameters" + }); + break; + + case 1: + if (mode === MODE_ALWAYS) { + context.report({ + node, + messageId: "missingRadix", + suggest: [ + { + messageId: "addRadixParameter10", + fix(fixer) { + const tokens = sourceCode.getTokens(node); + const lastToken = tokens.at(-1); // Parenthesis. + const secondToLastToken = tokens.at(-2); // May or may not be a comma. + const hasTrailingComma = secondToLastToken.type === "Punctuator" && secondToLastToken.value === ","; + + return fixer.insertTextBefore(lastToken, hasTrailingComma ? " 10," : ", 10"); + } + } + ] + }); + } + break; + + default: + if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) { + context.report({ + node, + messageId: "redundantRadix" + }); + } else if (!isValidRadix(args[1])) { + context.report({ + node, + messageId: "invalidRadix" + }); + } + break; + } + } + + return { + "Program:exit"(node) { + const scope = sourceCode.getScope(node); + let variable; + + // Check `parseInt()` + variable = astUtils.getVariableByName(scope, "parseInt"); + if (variable && !isShadowed(variable)) { + variable.references.forEach(reference => { + const idNode = reference.identifier; + + if (astUtils.isCallee(idNode)) { + checkArguments(idNode.parent); + } + }); + } + + // Check `Number.parseInt()` + variable = astUtils.getVariableByName(scope, "Number"); + if (variable && !isShadowed(variable)) { + variable.references.forEach(reference => { + const parentNode = reference.identifier.parent; + const maybeCallee = parentNode.parent.type === "ChainExpression" + ? parentNode.parent + : parentNode; + + if (isParseIntMethod(parentNode) && astUtils.isCallee(maybeCallee)) { + checkArguments(maybeCallee.parent); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-atomic-updates.js b/node_modules/eslint/lib/rules/require-atomic-updates.js new file mode 100644 index 0000000..5de58f7 --- /dev/null +++ b/node_modules/eslint/lib/rules/require-atomic-updates.js @@ -0,0 +1,334 @@ +/** + * @fileoverview disallow assignments that can lead to race conditions due to usage of `await` or `yield` + * @author Teddy Katz + * @author Toru Nagashima + */ +"use strict"; + +/** + * Make the map from identifiers to each reference. + * @param {escope.Scope} scope The scope to get references. + * @param {Map} [outReferenceMap] The map from identifier nodes to each reference object. + * @returns {Map} `referenceMap`. + */ +function createReferenceMap(scope, outReferenceMap = new Map()) { + for (const reference of scope.references) { + if (reference.resolved === null) { + continue; + } + + outReferenceMap.set(reference.identifier, reference); + } + for (const childScope of scope.childScopes) { + if (childScope.type !== "function") { + createReferenceMap(childScope, outReferenceMap); + } + } + + return outReferenceMap; +} + +/** + * Get `reference.writeExpr` of a given reference. + * If it's the read reference of MemberExpression in LHS, returns RHS in order to address `a.b = await a` + * @param {escope.Reference} reference The reference to get. + * @returns {Expression|null} The `reference.writeExpr`. + */ +function getWriteExpr(reference) { + if (reference.writeExpr) { + return reference.writeExpr; + } + let node = reference.identifier; + + while (node) { + const t = node.parent.type; + + if (t === "AssignmentExpression" && node.parent.left === node) { + return node.parent.right; + } + if (t === "MemberExpression" && node.parent.object === node) { + node = node.parent; + continue; + } + + break; + } + + return null; +} + +/** + * Checks if an expression is a variable that can only be observed within the given function. + * @param {Variable|null} variable The variable to check + * @param {boolean} isMemberAccess If `true` then this is a member access. + * @returns {boolean} `true` if the variable is local to the given function, and is never referenced in a closure. + */ +function isLocalVariableWithoutEscape(variable, isMemberAccess) { + if (!variable) { + return false; // A global variable which was not defined. + } + + // If the reference is a property access and the variable is a parameter, it handles the variable is not local. + if (isMemberAccess && variable.defs.some(d => d.type === "Parameter")) { + return false; + } + + const functionScope = variable.scope.variableScope; + + return variable.references.every(reference => + reference.from.variableScope === functionScope); +} + +/** + * Represents segment information. + */ +class SegmentInfo { + constructor() { + this.info = new WeakMap(); + } + + /** + * Initialize the segment information. + * @param {PathSegment} segment The segment to initialize. + * @returns {void} + */ + initialize(segment) { + const outdatedReadVariables = new Set(); + const freshReadVariables = new Set(); + + for (const prevSegment of segment.prevSegments) { + const info = this.info.get(prevSegment); + + if (info) { + info.outdatedReadVariables.forEach(Set.prototype.add, outdatedReadVariables); + info.freshReadVariables.forEach(Set.prototype.add, freshReadVariables); + } + } + + this.info.set(segment, { outdatedReadVariables, freshReadVariables }); + } + + /** + * Mark a given variable as read on given segments. + * @param {PathSegment[]} segments The segments that it read the variable on. + * @param {Variable} variable The variable to be read. + * @returns {void} + */ + markAsRead(segments, variable) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info) { + info.freshReadVariables.add(variable); + + // If a variable is freshly read again, then it's no more out-dated. + info.outdatedReadVariables.delete(variable); + } + } + } + + /** + * Move `freshReadVariables` to `outdatedReadVariables`. + * @param {PathSegment[]} segments The segments to process. + * @returns {void} + */ + makeOutdated(segments) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info) { + info.freshReadVariables.forEach(Set.prototype.add, info.outdatedReadVariables); + info.freshReadVariables.clear(); + } + } + } + + /** + * Check if a given variable is outdated on the current segments. + * @param {PathSegment[]} segments The current segments. + * @param {Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is outdated on the segments. + */ + isOutdated(segments, variable) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info && info.outdatedReadVariables.has(variable)) { + return true; + } + } + return false; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + allowProperties: false + }], + + docs: { + description: "Disallow assignments that can lead to race conditions due to usage of `await` or `yield`", + recommended: false, + url: "https://eslint.org/docs/latest/rules/require-atomic-updates" + }, + + fixable: null, + + schema: [{ + type: "object", + properties: { + allowProperties: { + type: "boolean" + } + }, + additionalProperties: false + }], + + messages: { + nonAtomicUpdate: "Possible race condition: `{{value}}` might be reassigned based on an outdated value of `{{value}}`.", + nonAtomicObjectUpdate: "Possible race condition: `{{value}}` might be assigned based on an outdated state of `{{object}}`." + } + }, + + create(context) { + const [{ allowProperties }] = context.options; + + const sourceCode = context.sourceCode; + const assignmentReferences = new Map(); + const segmentInfo = new SegmentInfo(); + let stack = null; + + return { + onCodePathStart(codePath, node) { + const scope = sourceCode.getScope(node); + const shouldVerify = + scope.type === "function" && + (scope.block.async || scope.block.generator); + + stack = { + upper: stack, + codePath, + referenceMap: shouldVerify ? createReferenceMap(scope) : null, + currentSegments: new Set() + }; + }, + onCodePathEnd() { + stack = stack.upper; + }, + + // Initialize the segment information. + onCodePathSegmentStart(segment) { + segmentInfo.initialize(segment); + stack.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentStart(segment) { + stack.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + stack.currentSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + stack.currentSegments.delete(segment); + }, + + + // Handle references to prepare verification. + Identifier(node) { + const { referenceMap } = stack; + const reference = referenceMap && referenceMap.get(node); + + // Ignore if this is not a valid variable reference. + if (!reference) { + return; + } + const variable = reference.resolved; + const writeExpr = getWriteExpr(reference); + const isMemberAccess = reference.identifier.parent.type === "MemberExpression"; + + // Add a fresh read variable. + if (reference.isRead() && !(writeExpr && writeExpr.parent.operator === "=")) { + segmentInfo.markAsRead(stack.currentSegments, variable); + } + + /* + * Register the variable to verify after ESLint traversed the `writeExpr` node + * if this reference is an assignment to a variable which is referred from other closure. + */ + if (writeExpr && + writeExpr.parent.right === writeExpr && // ← exclude variable declarations. + !isLocalVariableWithoutEscape(variable, isMemberAccess) + ) { + let refs = assignmentReferences.get(writeExpr); + + if (!refs) { + refs = []; + assignmentReferences.set(writeExpr, refs); + } + + refs.push(reference); + } + }, + + /* + * Verify assignments. + * If the reference exists in `outdatedReadVariables` list, report it. + */ + ":expression:exit"(node) { + + // referenceMap exists if this is in a resumable function scope. + if (!stack.referenceMap) { + return; + } + + // Mark the read variables on this code path as outdated. + if (node.type === "AwaitExpression" || node.type === "YieldExpression") { + segmentInfo.makeOutdated(stack.currentSegments); + } + + // Verify. + const references = assignmentReferences.get(node); + + if (references) { + assignmentReferences.delete(node); + + for (const reference of references) { + const variable = reference.resolved; + + if (segmentInfo.isOutdated(stack.currentSegments, variable)) { + if (node.parent.left === reference.identifier) { + context.report({ + node: node.parent, + messageId: "nonAtomicUpdate", + data: { + value: variable.name + } + }); + } else if (!allowProperties) { + context.report({ + node: node.parent, + messageId: "nonAtomicObjectUpdate", + data: { + value: sourceCode.getText(node.parent.left), + object: variable.name + } + }); + } + + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-await.js b/node_modules/eslint/lib/rules/require-await.js new file mode 100644 index 0000000..2a5159d --- /dev/null +++ b/node_modules/eslint/lib/rules/require-await.js @@ -0,0 +1,147 @@ +/** + * @fileoverview Rule to disallow async functions which have no `await` expression. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Capitalize the 1st letter of the given text. + * @param {string} text The text to capitalize. + * @returns {string} The text that the 1st letter was capitalized. + */ +function capitalizeFirstLetter(text) { + return text[0].toUpperCase() + text.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow async functions which have no `await` expression", + recommended: false, + url: "https://eslint.org/docs/latest/rules/require-await" + }, + + schema: [], + + messages: { + missingAwait: "{{name}} has no 'await' expression.", + removeAsync: "Remove 'async'." + }, + + hasSuggestions: true + }, + + create(context) { + const sourceCode = context.sourceCode; + let scopeInfo = null; + + /** + * Push the scope info object to the stack. + * @returns {void} + */ + function enterFunction() { + scopeInfo = { + upper: scopeInfo, + hasAwait: false + }; + } + + /** + * Pop the top scope info object from the stack. + * Also, it reports the function if needed. + * @param {ASTNode} node The node to report. + * @returns {void} + */ + function exitFunction(node) { + if (!node.generator && node.async && !scopeInfo.hasAwait && !astUtils.isEmptyFunction(node)) { + + /* + * If the function belongs to a method definition or + * property, then the function's range may not include the + * `async` keyword and we should look at the parent instead. + */ + const nodeWithAsyncKeyword = + (node.parent.type === "MethodDefinition" && node.parent.value === node) || + (node.parent.type === "Property" && node.parent.method && node.parent.value === node) + ? node.parent + : node; + + const asyncToken = sourceCode.getFirstToken(nodeWithAsyncKeyword, token => token.value === "async"); + const asyncRange = [asyncToken.range[0], sourceCode.getTokenAfter(asyncToken, { includeComments: true }).range[0]]; + + /* + * Removing the `async` keyword can cause parsing errors if the current + * statement is relying on automatic semicolon insertion. If ASI is currently + * being used, then we should replace the `async` keyword with a semicolon. + */ + const nextToken = sourceCode.getTokenAfter(asyncToken); + const addSemiColon = + nextToken.type === "Punctuator" && + (nextToken.value === "[" || nextToken.value === "(") && + (nodeWithAsyncKeyword.type === "MethodDefinition" || astUtils.isStartOfExpressionStatement(nodeWithAsyncKeyword)) && + astUtils.needsPrecedingSemicolon(sourceCode, nodeWithAsyncKeyword); + + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: "missingAwait", + data: { + name: capitalizeFirstLetter( + astUtils.getFunctionNameWithKind(node) + ) + }, + suggest: [{ + messageId: "removeAsync", + fix: fixer => fixer.replaceTextRange(asyncRange, addSemiColon ? ";" : "") + }] + }); + } + + scopeInfo = scopeInfo.upper; + } + + return { + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + "ArrowFunctionExpression:exit": exitFunction, + + AwaitExpression() { + if (!scopeInfo) { + return; + } + + scopeInfo.hasAwait = true; + }, + ForOfStatement(node) { + if (!scopeInfo) { + return; + } + + if (node.await) { + scopeInfo.hasAwait = true; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-unicode-regexp.js b/node_modules/eslint/lib/rules/require-unicode-regexp.js new file mode 100644 index 0000000..04edc90 --- /dev/null +++ b/node_modules/eslint/lib/rules/require-unicode-regexp.js @@ -0,0 +1,210 @@ +/** + * @fileoverview Rule to enforce the use of `u` or `v` flag on regular expressions. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStringIfConstant +} = require("@eslint-community/eslint-utils"); +const astUtils = require("./utils/ast-utils.js"); +const { isValidWithUnicodeFlag } = require("./utils/regular-expressions"); + +/** + * Checks whether the flag configuration should be treated as a missing flag. + * @param {"u"|"v"|undefined} requireFlag A particular flag to require + * @param {string} flags The regex flags + * @returns {boolean} Whether the flag configuration results in a missing flag. + */ +function checkFlags(requireFlag, flags) { + let missingFlag; + + if (requireFlag === "v") { + missingFlag = !flags.includes("v"); + } else if (requireFlag === "u") { + missingFlag = !flags.includes("u"); + } else { + missingFlag = !flags.includes("u") && !flags.includes("v"); + } + + return missingFlag; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Enforce the use of `u` or `v` flag on regular expressions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/require-unicode-regexp" + }, + + hasSuggestions: true, + + messages: { + addUFlag: "Add the 'u' flag.", + addVFlag: "Add the 'v' flag.", + requireUFlag: "Use the 'u' flag.", + requireVFlag: "Use the 'v' flag." + }, + + schema: [ + { + type: "object", + properties: { + requireFlag: { + enum: ["u", "v"] + } + }, + additionalProperties: false + } + ] + }, + + create(context) { + + const sourceCode = context.sourceCode; + + const { + requireFlag + } = context.options[0] ?? {}; + + return { + "Literal[regex]"(node) { + const flags = node.regex.flags || ""; + + const missingFlag = checkFlags(requireFlag, flags); + + if (missingFlag) { + context.report({ + messageId: requireFlag === "v" ? "requireVFlag" : "requireUFlag", + node, + suggest: isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, node.regex.pattern, requireFlag) + ? [ + { + fix(fixer) { + const replaceFlag = requireFlag ?? "u"; + const regex = sourceCode.getText(node); + const slashPos = regex.lastIndexOf("/"); + + if (requireFlag) { + const flag = requireFlag === "u" ? "v" : "u"; + + if (regex.includes(flag, slashPos)) { + return fixer.replaceText( + node, + regex.slice(0, slashPos) + + regex.slice(slashPos).replace(flag, requireFlag) + ); + } + } + + return fixer.insertTextAfter(node, replaceFlag); + }, + messageId: requireFlag === "v" ? "addVFlag" : "addUFlag" + } + ] + : null + }); + } + }, + + Program(node) { + const scope = sourceCode.getScope(node); + const tracker = new ReferenceTracker(scope); + const trackMap = { + RegExp: { [CALL]: true, [CONSTRUCT]: true } + }; + + for (const { node: refNode } of tracker.iterateGlobalReferences(trackMap)) { + const [patternNode, flagsNode] = refNode.arguments; + + if (patternNode && patternNode.type === "SpreadElement") { + continue; + } + const pattern = getStringIfConstant(patternNode, scope); + const flags = getStringIfConstant(flagsNode, scope); + + let missingFlag = !flagsNode; + + if (typeof flags === "string") { + missingFlag = checkFlags(requireFlag, flags); + } + + if (missingFlag) { + context.report({ + messageId: requireFlag === "v" ? "requireVFlag" : "requireUFlag", + node: refNode, + suggest: typeof pattern === "string" && isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, pattern, requireFlag) + ? [ + { + fix(fixer) { + const replaceFlag = requireFlag ?? "u"; + + if (flagsNode) { + if ((flagsNode.type === "Literal" && typeof flagsNode.value === "string") || flagsNode.type === "TemplateLiteral") { + const flagsNodeText = sourceCode.getText(flagsNode); + const flag = requireFlag === "u" ? "v" : "u"; + + if (flags.includes(flag)) { + + // Avoid replacing "u" in escapes like `\uXXXX` + if (flagsNode.type === "Literal" && flagsNode.raw.includes("\\")) { + return null; + } + + // Avoid replacing "u" in expressions like "`${regularFlags}g`" + if (flagsNode.type === "TemplateLiteral" && ( + flagsNode.expressions.length || + flagsNode.quasis.some(({ value: { raw } }) => raw.includes("\\")) + )) { + return null; + } + + return fixer.replaceText(flagsNode, flagsNodeText.replace(flag, replaceFlag)); + } + + return fixer.replaceText(flagsNode, [ + flagsNodeText.slice(0, flagsNodeText.length - 1), + flagsNodeText.slice(flagsNodeText.length - 1) + ].join(replaceFlag)); + } + + // We intentionally don't suggest concatenating + "u" to non-literals + return null; + } + + const penultimateToken = sourceCode.getLastToken(refNode, { skip: 1 }); // skip closing parenthesis + + return fixer.insertTextAfter( + penultimateToken, + astUtils.isCommaToken(penultimateToken) + ? ` "${replaceFlag}",` + : `, "${replaceFlag}"` + ); + }, + messageId: requireFlag === "v" ? "addVFlag" : "addUFlag" + } + ] + : null + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-yield.js b/node_modules/eslint/lib/rules/require-yield.js new file mode 100644 index 0000000..f801af0 --- /dev/null +++ b/node_modules/eslint/lib/rules/require-yield.js @@ -0,0 +1,77 @@ +/** + * @fileoverview Rule to flag the generator functions that does not have yield. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require generator functions to contain `yield`", + recommended: true, + url: "https://eslint.org/docs/latest/rules/require-yield" + }, + + schema: [], + + messages: { + missingYield: "This generator function does not have 'yield'." + } + }, + + create(context) { + const stack = []; + + /** + * If the node is a generator function, start counting `yield` keywords. + * @param {Node} node A function node to check. + * @returns {void} + */ + function beginChecking(node) { + if (node.generator) { + stack.push(0); + } + } + + /** + * If the node is a generator function, end counting `yield` keywords, then + * reports result. + * @param {Node} node A function node to check. + * @returns {void} + */ + function endChecking(node) { + if (!node.generator) { + return; + } + + const countYield = stack.pop(); + + if (countYield === 0 && node.body.body.length > 0) { + context.report({ node, messageId: "missingYield" }); + } + } + + return { + FunctionDeclaration: beginChecking, + "FunctionDeclaration:exit": endChecking, + FunctionExpression: beginChecking, + "FunctionExpression:exit": endChecking, + + // Increases the count of `yield` keyword. + YieldExpression() { + + if (stack.length > 0) { + stack[stack.length - 1] += 1; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/rest-spread-spacing.js b/node_modules/eslint/lib/rules/rest-spread-spacing.js new file mode 100644 index 0000000..e6ba3ad --- /dev/null +++ b/node_modules/eslint/lib/rules/rest-spread-spacing.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Enforce spacing between rest and spread operators and their expressions. + * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "rest-spread-spacing", + url: "https://eslint.style/rules/js/rest-spread-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce spacing between rest and spread operators and their expressions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/rest-spread-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + } + ], + + messages: { + unexpectedWhitespace: "Unexpected whitespace after {{type}} operator.", + expectedWhitespace: "Expected whitespace after {{type}} operator." + } + }, + + create(context) { + const sourceCode = context.sourceCode, + alwaysSpace = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whitespace between rest/spread operators and their expressions + * @param {ASTNode} node The node to check + * @returns {void} + */ + function checkWhiteSpace(node) { + const operator = sourceCode.getFirstToken(node), + nextToken = sourceCode.getTokenAfter(operator), + hasWhitespace = sourceCode.isSpaceBetweenTokens(operator, nextToken); + let type; + + switch (node.type) { + case "SpreadElement": + type = "spread"; + if (node.parent.type === "ObjectExpression") { + type += " property"; + } + break; + case "RestElement": + type = "rest"; + if (node.parent.type === "ObjectPattern") { + type += " property"; + } + break; + case "ExperimentalSpreadProperty": + type = "spread property"; + break; + case "ExperimentalRestProperty": + type = "rest property"; + break; + default: + return; + } + + if (alwaysSpace && !hasWhitespace) { + context.report({ + node, + loc: operator.loc, + messageId: "expectedWhitespace", + data: { + type + }, + fix(fixer) { + return fixer.replaceTextRange([operator.range[1], nextToken.range[0]], " "); + } + }); + } else if (!alwaysSpace && hasWhitespace) { + context.report({ + node, + loc: { + start: operator.loc.end, + end: nextToken.loc.start + }, + messageId: "unexpectedWhitespace", + data: { + type + }, + fix(fixer) { + return fixer.removeRange([operator.range[1], nextToken.range[0]]); + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + SpreadElement: checkWhiteSpace, + RestElement: checkWhiteSpace, + ExperimentalSpreadProperty: checkWhiteSpace, + ExperimentalRestProperty: checkWhiteSpace + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi-spacing.js b/node_modules/eslint/lib/rules/semi-spacing.js new file mode 100644 index 0000000..d47bc1a --- /dev/null +++ b/node_modules/eslint/lib/rules/semi-spacing.js @@ -0,0 +1,266 @@ +/** + * @fileoverview Validates spacing before and after semicolon + * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "semi-spacing", + url: "https://eslint.style/rules/js/semi-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing before and after semicolons", + recommended: false, + url: "https://eslint.org/docs/latest/rules/semi-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: false + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedWhitespaceBefore: "Unexpected whitespace before semicolon.", + unexpectedWhitespaceAfter: "Unexpected whitespace after semicolon.", + missingWhitespaceBefore: "Missing whitespace before semicolon.", + missingWhitespaceAfter: "Missing whitespace after semicolon." + } + }, + + create(context) { + + const config = context.options[0], + sourceCode = context.sourceCode; + let requireSpaceBefore = false, + requireSpaceAfter = true; + + if (typeof config === "object") { + requireSpaceBefore = config.before; + requireSpaceAfter = config.after; + } + + /** + * Checks if a given token has leading whitespace. + * @param {Object} token The token to check. + * @returns {boolean} True if the given token has leading space, false if not. + */ + function hasLeadingSpace(token) { + const tokenBefore = sourceCode.getTokenBefore(token); + + return tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token); + } + + /** + * Checks if a given token has trailing whitespace. + * @param {Object} token The token to check. + * @returns {boolean} True if the given token has trailing space, false if not. + */ + function hasTrailingSpace(token) { + const tokenAfter = sourceCode.getTokenAfter(token); + + return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter); + } + + /** + * Checks if the given token is the last token in its line. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the last in its line. + */ + function isLastTokenInCurrentLine(token) { + const tokenAfter = sourceCode.getTokenAfter(token); + + return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter)); + } + + /** + * Checks if the given token is the first token in its line + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the first in its line. + */ + function isFirstTokenInCurrentLine(token) { + const tokenBefore = sourceCode.getTokenBefore(token); + + return !(tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore)); + } + + /** + * Checks if the next token of a given token is a closing parenthesis. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis. + */ + function isBeforeClosingParen(token) { + const nextToken = sourceCode.getTokenAfter(token); + + return (nextToken && astUtils.isClosingBraceToken(nextToken) || astUtils.isClosingParenToken(nextToken)); + } + + /** + * Report location example : + * + * for unexpected space `before` + * + * var a = 'b' ; + * ^^^ + * + * for unexpected space `after` + * + * var a = 'b'; c = 10; + * ^^ + * + * Reports if the given token has invalid spacing. + * @param {Token} token The semicolon token to check. + * @param {ASTNode} node The corresponding node of the token. + * @returns {void} + */ + function checkSemicolonSpacing(token, node) { + if (astUtils.isSemicolonToken(token)) { + if (hasLeadingSpace(token)) { + if (!requireSpaceBefore) { + const tokenBefore = sourceCode.getTokenBefore(token); + const loc = { + start: tokenBefore.loc.end, + end: token.loc.start + }; + + context.report({ + node, + loc, + messageId: "unexpectedWhitespaceBefore", + fix(fixer) { + + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); + } + } else { + if (requireSpaceBefore) { + const loc = token.loc; + + context.report({ + node, + loc, + messageId: "missingWhitespaceBefore", + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) { + if (hasTrailingSpace(token)) { + if (!requireSpaceAfter) { + const tokenAfter = sourceCode.getTokenAfter(token); + const loc = { + start: token.loc.end, + end: tokenAfter.loc.start + }; + + context.report({ + node, + loc, + messageId: "unexpectedWhitespaceAfter", + fix(fixer) { + + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); + } + } else { + if (requireSpaceAfter) { + const loc = token.loc; + + context.report({ + node, + loc, + messageId: "missingWhitespaceAfter", + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + } + } + } + + /** + * Checks the spacing of the semicolon with the assumption that the last token is the semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNode(node) { + const token = sourceCode.getLastToken(node); + + checkSemicolonSpacing(token, node); + } + + return { + VariableDeclaration: checkNode, + ExpressionStatement: checkNode, + BreakStatement: checkNode, + ContinueStatement: checkNode, + DebuggerStatement: checkNode, + DoWhileStatement: checkNode, + ReturnStatement: checkNode, + ThrowStatement: checkNode, + ImportDeclaration: checkNode, + ExportNamedDeclaration: checkNode, + ExportAllDeclaration: checkNode, + ExportDefaultDeclaration: checkNode, + ForStatement(node) { + if (node.init) { + checkSemicolonSpacing(sourceCode.getTokenAfter(node.init), node); + } + + if (node.test) { + checkSemicolonSpacing(sourceCode.getTokenAfter(node.test), node); + } + }, + PropertyDefinition: checkNode + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi-style.js b/node_modules/eslint/lib/rules/semi-style.js new file mode 100644 index 0000000..6826198 --- /dev/null +++ b/node_modules/eslint/lib/rules/semi-style.js @@ -0,0 +1,176 @@ +/** + * @fileoverview Rule to enforce location of semicolons. + * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const SELECTOR = [ + "BreakStatement", "ContinueStatement", "DebuggerStatement", + "DoWhileStatement", "ExportAllDeclaration", + "ExportDefaultDeclaration", "ExportNamedDeclaration", + "ExpressionStatement", "ImportDeclaration", "ReturnStatement", + "ThrowStatement", "VariableDeclaration", "PropertyDefinition" +].join(","); + +/** + * Get the child node list of a given node. + * This returns `BlockStatement#body`, `StaticBlock#body`, `Program#body`, + * `ClassBody#body`, or `SwitchCase#consequent`. + * This is used to check whether a node is the first/last child. + * @param {Node} node A node to get child node list. + * @returns {Node[]|null} The child node list. + */ +function getChildren(node) { + const t = node.type; + + if ( + t === "BlockStatement" || + t === "StaticBlock" || + t === "Program" || + t === "ClassBody" + ) { + return node.body; + } + if (t === "SwitchCase") { + return node.consequent; + } + return null; +} + +/** + * Check whether a given node is the last statement in the parent block. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is the last statement in the parent block. + */ +function isLastChild(node) { + const t = node.parent.type; + + if (t === "IfStatement" && node.parent.consequent === node && node.parent.alternate) { // before `else` keyword. + return true; + } + if (t === "DoWhileStatement") { // before `while` keyword. + return true; + } + const nodeList = getChildren(node.parent); + + return nodeList !== null && nodeList.at(-1) === node; // before `}` or etc. +} + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "semi-style", + url: "https://eslint.style/rules/js/semi-style" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce location of semicolons", + recommended: false, + url: "https://eslint.org/docs/latest/rules/semi-style" + }, + + schema: [{ enum: ["last", "first"] }], + fixable: "whitespace", + + messages: { + expectedSemiColon: "Expected this semicolon to be at {{pos}}." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const option = context.options[0] || "last"; + + /** + * Check the given semicolon token. + * @param {Token} semiToken The semicolon token to check. + * @param {"first"|"last"} expected The expected location to check. + * @returns {void} + */ + function check(semiToken, expected) { + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const prevIsSameLine = !prevToken || astUtils.isTokenOnSameLine(prevToken, semiToken); + const nextIsSameLine = !nextToken || astUtils.isTokenOnSameLine(semiToken, nextToken); + + if ((expected === "last" && !prevIsSameLine) || (expected === "first" && !nextIsSameLine)) { + context.report({ + loc: semiToken.loc, + messageId: "expectedSemiColon", + data: { + pos: (expected === "last") + ? "the end of the previous line" + : "the beginning of the next line" + }, + fix(fixer) { + if (prevToken && nextToken && sourceCode.commentsExistBetween(prevToken, nextToken)) { + return null; + } + + const start = prevToken ? prevToken.range[1] : semiToken.range[0]; + const end = nextToken ? nextToken.range[0] : semiToken.range[1]; + const text = (expected === "last") ? ";\n" : "\n;"; + + return fixer.replaceTextRange([start, end], text); + } + }); + } + } + + return { + [SELECTOR](node) { + if (option === "first" && isLastChild(node)) { + return; + } + + const lastToken = sourceCode.getLastToken(node); + + if (astUtils.isSemicolonToken(lastToken)) { + check(lastToken, option); + } + }, + + ForStatement(node) { + const firstSemi = node.init && sourceCode.getTokenAfter(node.init, astUtils.isSemicolonToken); + const secondSemi = node.test && sourceCode.getTokenAfter(node.test, astUtils.isSemicolonToken); + + if (firstSemi) { + check(firstSemi, "last"); + } + if (secondSemi) { + check(secondSemi, "last"); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi.js b/node_modules/eslint/lib/rules/semi.js new file mode 100644 index 0000000..db04b99 --- /dev/null +++ b/node_modules/eslint/lib/rules/semi.js @@ -0,0 +1,456 @@ +/** + * @fileoverview Rule to flag missing semicolons. + * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "semi", + url: "https://eslint.style/rules/js/semi" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow semicolons instead of ASI", + recommended: false, + url: "https://eslint.org/docs/latest/rules/semi" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + }, + { + type: "object", + properties: { + beforeStatementContinuationChars: { + enum: ["always", "any", "never"] + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + omitLastInOneLineBlock: { type: "boolean" }, + omitLastInOneLineClassBody: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + missingSemi: "Missing semicolon.", + extraSemi: "Extra semicolon." + } + }, + + create(context) { + + const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-` + const unsafeClassFieldNames = new Set(["get", "set", "static"]); + const unsafeClassFieldFollowers = new Set(["*", "in", "instanceof"]); + const options = context.options[1]; + const never = context.options[0] === "never"; + const exceptOneLine = Boolean(options && options.omitLastInOneLineBlock); + const exceptOneLineClassBody = Boolean(options && options.omitLastInOneLineClassBody); + const beforeStatementContinuationChars = options && options.beforeStatementContinuationChars || "any"; + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports a semicolon error with appropriate location and message. + * @param {ASTNode} node The node with an extra or missing semicolon. + * @param {boolean} missing True if the semicolon is missing. + * @returns {void} + */ + function report(node, missing) { + const lastToken = sourceCode.getLastToken(node); + let messageId, + fix, + loc; + + if (!missing) { + messageId = "missingSemi"; + loc = { + start: lastToken.loc.end, + end: astUtils.getNextLocation(sourceCode, lastToken.loc.end) + }; + fix = function(fixer) { + return fixer.insertTextAfter(lastToken, ";"); + }; + } else { + messageId = "extraSemi"; + loc = lastToken.loc; + fix = function(fixer) { + + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with no-extra-semi. + * https://github.com/eslint/eslint/issues/7928 + */ + return new FixTracker(fixer, sourceCode) + .retainSurroundingTokens(lastToken) + .remove(lastToken); + }; + } + + context.report({ + node, + loc, + messageId, + fix + }); + + } + + /** + * Check whether a given semicolon token is redundant. + * @param {Token} semiToken A semicolon token to check. + * @returns {boolean} `true` if the next token is `;` or `}`. + */ + function isRedundantSemi(semiToken) { + const nextToken = sourceCode.getTokenAfter(semiToken); + + return ( + !nextToken || + astUtils.isClosingBraceToken(nextToken) || + astUtils.isSemicolonToken(nextToken) + ); + } + + /** + * Check whether a given token is the closing brace of an arrow function. + * @param {Token} lastToken A token to check. + * @returns {boolean} `true` if the token is the closing brace of an arrow function. + */ + function isEndOfArrowBlock(lastToken) { + if (!astUtils.isClosingBraceToken(lastToken)) { + return false; + } + const node = sourceCode.getNodeByRangeIndex(lastToken.range[0]); + + return ( + node.type === "BlockStatement" && + node.parent.type === "ArrowFunctionExpression" + ); + } + + /** + * Checks if a given PropertyDefinition node followed by a semicolon + * can safely remove that semicolon. It is not to safe to remove if + * the class field name is "get", "set", or "static", or if + * followed by a generator method. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node cannot have the semicolon + * removed. + */ + function maybeClassFieldAsiHazard(node) { + + if (node.type !== "PropertyDefinition") { + return false; + } + + /* + * Computed property names and non-identifiers are always safe + * as they can be distinguished from keywords easily. + */ + const needsNameCheck = !node.computed && node.key.type === "Identifier"; + + /* + * Certain names are problematic unless they also have a + * a way to distinguish between keywords and property + * names. + */ + if (needsNameCheck && unsafeClassFieldNames.has(node.key.name)) { + + /* + * Special case: If the field name is `static`, + * it is only valid if the field is marked as static, + * so "static static" is okay but "static" is not. + */ + const isStaticStatic = node.static && node.key.name === "static"; + + /* + * For other unsafe names, we only care if there is no + * initializer. No initializer = hazard. + */ + if (!isStaticStatic && !node.value) { + return true; + } + } + + const followingToken = sourceCode.getTokenAfter(node); + + return unsafeClassFieldFollowers.has(followingToken.value); + } + + /** + * Check whether a given node is on the same line with the next token. + * @param {Node} node A statement node to check. + * @returns {boolean} `true` if the node is on the same line with the next token. + */ + function isOnSameLineWithNextToken(node) { + const prevToken = sourceCode.getLastToken(node, 1); + const nextToken = sourceCode.getTokenAfter(node); + + return !!nextToken && astUtils.isTokenOnSameLine(prevToken, nextToken); + } + + /** + * Check whether a given node can connect the next line if the next line is unreliable. + * @param {Node} node A statement node to check. + * @returns {boolean} `true` if the node can connect the next line. + */ + function maybeAsiHazardAfter(node) { + const t = node.type; + + if (t === "DoWhileStatement" || + t === "BreakStatement" || + t === "ContinueStatement" || + t === "DebuggerStatement" || + t === "ImportDeclaration" || + t === "ExportAllDeclaration" + ) { + return false; + } + if (t === "ReturnStatement") { + return Boolean(node.argument); + } + if (t === "ExportNamedDeclaration") { + return Boolean(node.declaration); + } + if (isEndOfArrowBlock(sourceCode.getLastToken(node, 1))) { + return false; + } + + return true; + } + + /** + * Check whether a given token can connect the previous statement. + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is one of `[`, `(`, `/`, `+`, `-`, ```, `++`, and `--`. + */ + function maybeAsiHazardBefore(token) { + return ( + Boolean(token) && + OPT_OUT_PATTERN.test(token.value) && + token.value !== "++" && + token.value !== "--" + ); + } + + /** + * Check if the semicolon of a given node is unnecessary, only true if: + * - next token is a valid statement divider (`;` or `}`). + * - next token is on a new line and the node is not connectable to the new line. + * @param {Node} node A statement node to check. + * @returns {boolean} whether the semicolon is unnecessary. + */ + function canRemoveSemicolon(node) { + if (isRedundantSemi(sourceCode.getLastToken(node))) { + return true; // `;;` or `;}` + } + if (maybeClassFieldAsiHazard(node)) { + return false; + } + if (isOnSameLineWithNextToken(node)) { + return false; // One liner. + } + + // continuation characters should not apply to class fields + if ( + node.type !== "PropertyDefinition" && + beforeStatementContinuationChars === "never" && + !maybeAsiHazardAfter(node) + ) { + return true; // ASI works. This statement doesn't connect to the next. + } + if (!maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { + return true; // ASI works. The next token doesn't connect to this statement. + } + + return false; + } + + /** + * Checks a node to see if it's the last item in a one-liner block. + * Block is any `BlockStatement` or `StaticBlock` node. Block is a one-liner if its + * braces (and consequently everything between them) are on the same line. + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is the last item in a one-liner block. + */ + function isLastInOneLinerBlock(node) { + const parent = node.parent; + const nextToken = sourceCode.getTokenAfter(node); + + if (!nextToken || nextToken.value !== "}") { + return false; + } + + if (parent.type === "BlockStatement") { + return parent.loc.start.line === parent.loc.end.line; + } + + if (parent.type === "StaticBlock") { + const openingBrace = sourceCode.getFirstToken(parent, { skip: 1 }); // skip the `static` token + + return openingBrace.loc.start.line === parent.loc.end.line; + } + + return false; + } + + /** + * Checks a node to see if it's the last item in a one-liner `ClassBody` node. + * ClassBody is a one-liner if its braces (and consequently everything between them) are on the same line. + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is the last item in a one-liner ClassBody. + */ + function isLastInOneLinerClassBody(node) { + const parent = node.parent; + const nextToken = sourceCode.getTokenAfter(node); + + if (!nextToken || nextToken.value !== "}") { + return false; + } + + if (parent.type === "ClassBody") { + return parent.loc.start.line === parent.loc.end.line; + } + + return false; + } + + /** + * Checks a node to see if it's followed by a semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolon(node) { + const isSemi = astUtils.isSemicolonToken(sourceCode.getLastToken(node)); + + if (never) { + if (isSemi && canRemoveSemicolon(node)) { + report(node, true); + } else if ( + !isSemi && beforeStatementContinuationChars === "always" && + node.type !== "PropertyDefinition" && + maybeAsiHazardBefore(sourceCode.getTokenAfter(node)) + ) { + report(node); + } + } else { + const oneLinerBlock = (exceptOneLine && isLastInOneLinerBlock(node)); + const oneLinerClassBody = (exceptOneLineClassBody && isLastInOneLinerClassBody(node)); + const oneLinerBlockOrClassBody = oneLinerBlock || oneLinerClassBody; + + if (isSemi && oneLinerBlockOrClassBody) { + report(node, true); + } else if (!isSemi && !oneLinerBlockOrClassBody) { + report(node); + } + } + } + + /** + * Checks to see if there's a semicolon after a variable declaration. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolonForVariableDeclaration(node) { + const parent = node.parent; + + if ((parent.type !== "ForStatement" || parent.init !== node) && + (!/^For(?:In|Of)Statement/u.test(parent.type) || parent.left !== node) + ) { + checkForSemicolon(node); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForSemicolonForVariableDeclaration, + ExpressionStatement: checkForSemicolon, + ReturnStatement: checkForSemicolon, + ThrowStatement: checkForSemicolon, + DoWhileStatement: checkForSemicolon, + DebuggerStatement: checkForSemicolon, + BreakStatement: checkForSemicolon, + ContinueStatement: checkForSemicolon, + ImportDeclaration: checkForSemicolon, + ExportAllDeclaration: checkForSemicolon, + ExportNamedDeclaration(node) { + if (!node.declaration) { + checkForSemicolon(node); + } + }, + ExportDefaultDeclaration(node) { + if (!/(?:Class|Function)Declaration/u.test(node.declaration.type)) { + checkForSemicolon(node); + } + }, + PropertyDefinition: checkForSemicolon + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/sort-imports.js b/node_modules/eslint/lib/rules/sort-imports.js new file mode 100644 index 0000000..b355da9 --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-imports.js @@ -0,0 +1,246 @@ +/** + * @fileoverview Rule to enforce sorted `import` declarations within modules + * @author Christian Schuller + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + allowSeparatedGroups: false, + ignoreCase: false, + ignoreDeclarationSort: false, + ignoreMemberSort: false, + memberSyntaxSortOrder: ["none", "all", "multiple", "single"] + }], + + docs: { + description: "Enforce sorted `import` declarations within modules", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/sort-imports" + }, + + schema: [ + { + type: "object", + properties: { + ignoreCase: { + type: "boolean" + }, + memberSyntaxSortOrder: { + type: "array", + items: { + enum: ["none", "all", "multiple", "single"] + }, + uniqueItems: true, + minItems: 4, + maxItems: 4 + }, + ignoreDeclarationSort: { + type: "boolean" + }, + ignoreMemberSort: { + type: "boolean" + }, + allowSeparatedGroups: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + sortImportsAlphabetically: "Imports should be sorted alphabetically.", + sortMembersAlphabetically: "Member '{{memberName}}' of the import declaration should be sorted alphabetically.", + unexpectedSyntaxOrder: "Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax." + } + }, + + create(context) { + const [{ + ignoreCase, + ignoreDeclarationSort, + ignoreMemberSort, + memberSyntaxSortOrder, + allowSeparatedGroups + }] = context.options; + const sourceCode = context.sourceCode; + let previousDeclaration = null; + + /** + * Gets the used member syntax style. + * + * import "my-module.js" --> none + * import * as myModule from "my-module.js" --> all + * import {myMember} from "my-module.js" --> single + * import {foo, bar} from "my-module.js" --> multiple + * @param {ASTNode} node the ImportDeclaration node. + * @returns {string} used member parameter style, ["all", "multiple", "single"] + */ + function usedMemberSyntax(node) { + if (node.specifiers.length === 0) { + return "none"; + } + if (node.specifiers[0].type === "ImportNamespaceSpecifier") { + return "all"; + } + if (node.specifiers.length === 1) { + return "single"; + } + return "multiple"; + + } + + /** + * Gets the group by member parameter index for given declaration. + * @param {ASTNode} node the ImportDeclaration node. + * @returns {number} the declaration group by member index. + */ + function getMemberParameterGroupIndex(node) { + return memberSyntaxSortOrder.indexOf(usedMemberSyntax(node)); + } + + /** + * Gets the local name of the first imported module. + * @param {ASTNode} node the ImportDeclaration node. + * @returns {?string} the local name of the first imported module. + */ + function getFirstLocalMemberName(node) { + if (node.specifiers[0]) { + return node.specifiers[0].local.name; + } + return null; + + } + + /** + * Calculates number of lines between two nodes. It is assumed that the given `left` node appears before + * the given `right` node in the source code. Lines are counted from the end of the `left` node till the + * start of the `right` node. If the given nodes are on the same line, it returns `0`, same as if they were + * on two consecutive lines. + * @param {ASTNode} left node that appears before the given `right` node. + * @param {ASTNode} right node that appears after the given `left` node. + * @returns {number} number of lines between nodes. + */ + function getNumberOfLinesBetween(left, right) { + return Math.max(right.loc.start.line - left.loc.end.line - 1, 0); + } + + return { + ImportDeclaration(node) { + if (!ignoreDeclarationSort) { + if ( + previousDeclaration && + allowSeparatedGroups && + getNumberOfLinesBetween(previousDeclaration, node) > 0 + ) { + + // reset declaration sort + previousDeclaration = null; + } + + if (previousDeclaration) { + const currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node), + previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration); + let currentLocalMemberName = getFirstLocalMemberName(node), + previousLocalMemberName = getFirstLocalMemberName(previousDeclaration); + + if (ignoreCase) { + previousLocalMemberName = previousLocalMemberName && previousLocalMemberName.toLowerCase(); + currentLocalMemberName = currentLocalMemberName && currentLocalMemberName.toLowerCase(); + } + + /* + * When the current declaration uses a different member syntax, + * then check if the ordering is correct. + * Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name. + */ + if (currentMemberSyntaxGroupIndex !== previousMemberSyntaxGroupIndex) { + if (currentMemberSyntaxGroupIndex < previousMemberSyntaxGroupIndex) { + context.report({ + node, + messageId: "unexpectedSyntaxOrder", + data: { + syntaxA: memberSyntaxSortOrder[currentMemberSyntaxGroupIndex], + syntaxB: memberSyntaxSortOrder[previousMemberSyntaxGroupIndex] + } + }); + } + } else { + if (previousLocalMemberName && + currentLocalMemberName && + currentLocalMemberName < previousLocalMemberName + ) { + context.report({ + node, + messageId: "sortImportsAlphabetically" + }); + } + } + } + + previousDeclaration = node; + } + + if (!ignoreMemberSort) { + const importSpecifiers = node.specifiers.filter(specifier => specifier.type === "ImportSpecifier"); + const getSortableName = ignoreCase ? specifier => specifier.local.name.toLowerCase() : specifier => specifier.local.name; + const firstUnsortedIndex = importSpecifiers.map(getSortableName).findIndex((name, index, array) => array[index - 1] > name); + + if (firstUnsortedIndex !== -1) { + context.report({ + node: importSpecifiers[firstUnsortedIndex], + messageId: "sortMembersAlphabetically", + data: { memberName: importSpecifiers[firstUnsortedIndex].local.name }, + fix(fixer) { + if (importSpecifiers.some(specifier => + sourceCode.getCommentsBefore(specifier).length || sourceCode.getCommentsAfter(specifier).length)) { + + // If there are comments in the ImportSpecifier list, don't rearrange the specifiers. + return null; + } + + return fixer.replaceTextRange( + [importSpecifiers[0].range[0], importSpecifiers.at(-1).range[1]], + importSpecifiers + + // Clone the importSpecifiers array to avoid mutating it + .slice() + + // Sort the array into the desired order + .sort((specifierA, specifierB) => { + const aName = getSortableName(specifierA); + const bName = getSortableName(specifierB); + + return aName > bName ? 1 : -1; + }) + + // Build a string out of the sorted list of import specifiers and the text between the originals + .reduce((sourceText, specifier, index) => { + const textAfterSpecifier = index === importSpecifiers.length - 1 + ? "" + : sourceCode.getText().slice(importSpecifiers[index].range[1], importSpecifiers[index + 1].range[0]); + + return sourceText + sourceCode.getText(specifier) + textAfterSpecifier; + }, "") + ); + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/sort-keys.js b/node_modules/eslint/lib/rules/sort-keys.js new file mode 100644 index 0000000..4793260 --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-keys.js @@ -0,0 +1,237 @@ +/** + * @fileoverview Rule to require object keys to be sorted + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + naturalCompare = require("natural-compare"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the property name of the given `Property` node. + * + * - If the property's key is an `Identifier` node, this returns the key's name + * whether it's a computed property or not. + * - If the property has a static name, this returns the static name. + * - Otherwise, this returns null. + * @param {ASTNode} node The `Property` node to get. + * @returns {string|null} The property name or null. + * @private + */ +function getPropertyName(node) { + const staticName = astUtils.getStaticPropertyName(node); + + if (staticName !== null) { + return staticName; + } + + return node.key.name || null; +} + +/** + * Functions which check that the given 2 names are in specific order. + * + * Postfix `I` is meant insensitive. + * Postfix `N` is meant natural. + * @private + */ +const isValidOrders = { + asc(a, b) { + return a <= b; + }, + ascI(a, b) { + return a.toLowerCase() <= b.toLowerCase(); + }, + ascN(a, b) { + return naturalCompare(a, b) <= 0; + }, + ascIN(a, b) { + return naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0; + }, + desc(a, b) { + return isValidOrders.asc(b, a); + }, + descI(a, b) { + return isValidOrders.ascI(b, a); + }, + descN(a, b) { + return isValidOrders.ascN(b, a); + }, + descIN(a, b) { + return isValidOrders.ascIN(b, a); + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["asc", { + allowLineSeparatedGroups: false, + caseSensitive: true, + ignoreComputedKeys: false, + minKeys: 2, + natural: false + }], + + docs: { + description: "Require object keys to be sorted", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/sort-keys" + }, + + schema: [ + { + enum: ["asc", "desc"] + }, + { + type: "object", + properties: { + caseSensitive: { + type: "boolean" + }, + natural: { + type: "boolean" + }, + minKeys: { + type: "integer", + minimum: 2 + }, + allowLineSeparatedGroups: { + type: "boolean" + }, + ignoreComputedKeys: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + sortKeys: "Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'." + } + }, + + create(context) { + const [order, { caseSensitive, natural, minKeys, allowLineSeparatedGroups, ignoreComputedKeys }] = context.options; + const insensitive = !caseSensitive; + const isValidOrder = isValidOrders[ + order + (insensitive ? "I" : "") + (natural ? "N" : "") + ]; + + // The stack to save the previous property's name for each object literals. + let stack = null; + const sourceCode = context.sourceCode; + + return { + ObjectExpression(node) { + stack = { + upper: stack, + prevNode: null, + prevBlankLine: false, + prevName: null, + numKeys: node.properties.length + }; + }, + + "ObjectExpression:exit"() { + stack = stack.upper; + }, + + SpreadElement(node) { + if (node.parent.type === "ObjectExpression") { + stack.prevName = null; + } + }, + + Property(node) { + if (node.parent.type === "ObjectPattern") { + return; + } + + if (ignoreComputedKeys && node.computed) { + stack.prevName = null; // reset sort + return; + } + + const prevName = stack.prevName; + const numKeys = stack.numKeys; + const thisName = getPropertyName(node); + + // Get tokens between current node and previous node + const tokens = stack.prevNode && sourceCode + .getTokensBetween(stack.prevNode, node, { includeComments: true }); + + let isBlankLineBetweenNodes = stack.prevBlankLine; + + if (tokens) { + + // check blank line between tokens + tokens.forEach((token, index) => { + const previousToken = tokens[index - 1]; + + if (previousToken && (token.loc.start.line - previousToken.loc.end.line > 1)) { + isBlankLineBetweenNodes = true; + } + }); + + // check blank line between the current node and the last token + if (!isBlankLineBetweenNodes && (node.loc.start.line - tokens.at(-1).loc.end.line > 1)) { + isBlankLineBetweenNodes = true; + } + + // check blank line between the first token and the previous node + if (!isBlankLineBetweenNodes && (tokens[0].loc.start.line - stack.prevNode.loc.end.line > 1)) { + isBlankLineBetweenNodes = true; + } + } + + stack.prevNode = node; + + if (thisName !== null) { + stack.prevName = thisName; + } + + if (allowLineSeparatedGroups && isBlankLineBetweenNodes) { + stack.prevBlankLine = thisName === null; + return; + } + + if (prevName === null || thisName === null || numKeys < minKeys) { + return; + } + + if (!isValidOrder(prevName, thisName)) { + context.report({ + node, + loc: node.key.loc, + messageId: "sortKeys", + data: { + thisName, + prevName, + order, + insensitive: insensitive ? "insensitive " : "", + natural: natural ? "natural " : "" + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/sort-vars.js b/node_modules/eslint/lib/rules/sort-vars.js new file mode 100644 index 0000000..cc22061 --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-vars.js @@ -0,0 +1,106 @@ +/** + * @fileoverview Rule to require sorting of variables within a single Variable Declaration block + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: [{ + ignoreCase: false + }], + + docs: { + description: "Require variables within the same declaration block to be sorted", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/sort-vars" + }, + + schema: [ + { + type: "object", + properties: { + ignoreCase: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + sortVars: "Variables within the same declaration block should be sorted alphabetically." + } + }, + + create(context) { + const [{ ignoreCase }] = context.options; + const sourceCode = context.sourceCode; + + return { + VariableDeclaration(node) { + const idDeclarations = node.declarations.filter(decl => decl.id.type === "Identifier"); + const getSortableName = ignoreCase ? decl => decl.id.name.toLowerCase() : decl => decl.id.name; + const unfixable = idDeclarations.some(decl => decl.init !== null && decl.init.type !== "Literal"); + let fixed = false; + + idDeclarations.slice(1).reduce((memo, decl) => { + const lastVariableName = getSortableName(memo), + currentVariableName = getSortableName(decl); + + if (currentVariableName < lastVariableName) { + context.report({ + node: decl, + messageId: "sortVars", + fix(fixer) { + if (unfixable || fixed) { + return null; + } + return fixer.replaceTextRange( + [idDeclarations[0].range[0], idDeclarations.at(-1).range[1]], + idDeclarations + + // Clone the idDeclarations array to avoid mutating it + .slice() + + // Sort the array into the desired order + .sort((declA, declB) => { + const aName = getSortableName(declA); + const bName = getSortableName(declB); + + return aName > bName ? 1 : -1; + }) + + // Build a string out of the sorted list of identifier declarations and the text between the originals + .reduce((sourceText, identifier, index) => { + const textAfterIdentifier = index === idDeclarations.length - 1 + ? "" + : sourceCode.getText().slice(idDeclarations[index].range[1], idDeclarations[index + 1].range[0]); + + return sourceText + sourceCode.getText(identifier) + textAfterIdentifier; + }, "") + + ); + } + }); + fixed = true; + return memo; + } + return decl; + + }, idDeclarations[0]); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-before-blocks.js b/node_modules/eslint/lib/rules/space-before-blocks.js new file mode 100644 index 0000000..0e173ea --- /dev/null +++ b/node_modules/eslint/lib/rules/space-before-blocks.js @@ -0,0 +1,222 @@ +/** + * @fileoverview A rule to ensure whitespace before blocks. + * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given node represents the body of a function. + * @param {ASTNode} node the node to check. + * @returns {boolean} `true` if the node is function body. + */ +function isFunctionBody(node) { + const parent = node.parent; + + return ( + node.type === "BlockStatement" && + astUtils.isFunction(parent) && + parent.body === node + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "space-before-blocks", + url: "https://eslint.style/rules/js/space-before-blocks" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing before blocks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/space-before-blocks" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + keywords: { + enum: ["always", "never", "off"] + }, + functions: { + enum: ["always", "never", "off"] + }, + classes: { + enum: ["always", "never", "off"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedSpace: "Unexpected space before opening brace.", + missingSpace: "Missing space before opening brace." + } + }, + + create(context) { + const config = context.options[0], + sourceCode = context.sourceCode; + let alwaysFunctions = true, + alwaysKeywords = true, + alwaysClasses = true, + neverFunctions = false, + neverKeywords = false, + neverClasses = false; + + if (typeof config === "object") { + alwaysFunctions = config.functions === "always"; + alwaysKeywords = config.keywords === "always"; + alwaysClasses = config.classes === "always"; + neverFunctions = config.functions === "never"; + neverKeywords = config.keywords === "never"; + neverClasses = config.classes === "never"; + } else if (config === "never") { + alwaysFunctions = false; + alwaysKeywords = false; + alwaysClasses = false; + neverFunctions = true; + neverKeywords = true; + neverClasses = true; + } + + /** + * Checks whether the spacing before the given block is already controlled by another rule: + * - `arrow-spacing` checks spaces after `=>`. + * - `keyword-spacing` checks spaces after keywords in certain contexts. + * - `switch-colon-spacing` checks spaces after `:` of switch cases. + * @param {Token} precedingToken first token before the block. + * @param {ASTNode|Token} node `BlockStatement` node or `{` token of a `SwitchStatement` node. + * @returns {boolean} `true` if requiring or disallowing spaces before the given block could produce conflicts with other rules. + */ + function isConflicted(precedingToken, node) { + return ( + astUtils.isArrowToken(precedingToken) || + ( + astUtils.isKeywordToken(precedingToken) && + !isFunctionBody(node) + ) || + ( + astUtils.isColonToken(precedingToken) && + node.parent && + node.parent.type === "SwitchCase" && + precedingToken === astUtils.getSwitchCaseColonToken(node.parent, sourceCode) + ) + ); + } + + /** + * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line. + * @param {ASTNode|Token} node The AST node of a BlockStatement. + * @returns {void} undefined. + */ + function checkPrecedingSpace(node) { + const precedingToken = sourceCode.getTokenBefore(node); + + if (precedingToken && !isConflicted(precedingToken, node) && astUtils.isTokenOnSameLine(precedingToken, node)) { + const hasSpace = sourceCode.isSpaceBetweenTokens(precedingToken, node); + let requireSpace; + let requireNoSpace; + + if (isFunctionBody(node)) { + requireSpace = alwaysFunctions; + requireNoSpace = neverFunctions; + } else if (node.type === "ClassBody") { + requireSpace = alwaysClasses; + requireNoSpace = neverClasses; + } else { + requireSpace = alwaysKeywords; + requireNoSpace = neverKeywords; + } + + if (requireSpace && !hasSpace) { + context.report({ + node, + messageId: "missingSpace", + fix(fixer) { + return fixer.insertTextBefore(node, " "); + } + }); + } else if (requireNoSpace && hasSpace) { + context.report({ + node, + messageId: "unexpectedSpace", + fix(fixer) { + return fixer.removeRange([precedingToken.range[1], node.range[0]]); + } + }); + } + } + } + + /** + * Checks if the CaseBlock of an given SwitchStatement node has a preceding space. + * @param {ASTNode} node The node of a SwitchStatement. + * @returns {void} undefined. + */ + function checkSpaceBeforeCaseBlock(node) { + const cases = node.cases; + let openingBrace; + + if (cases.length > 0) { + openingBrace = sourceCode.getTokenBefore(cases[0]); + } else { + openingBrace = sourceCode.getLastToken(node, 1); + } + + checkPrecedingSpace(openingBrace); + } + + return { + BlockStatement: checkPrecedingSpace, + ClassBody: checkPrecedingSpace, + SwitchStatement: checkSpaceBeforeCaseBlock + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/space-before-function-paren.js b/node_modules/eslint/lib/rules/space-before-function-paren.js new file mode 100644 index 0000000..0897c3b --- /dev/null +++ b/node_modules/eslint/lib/rules/space-before-function-paren.js @@ -0,0 +1,185 @@ +/** + * @fileoverview Rule to validate spacing before function paren. + * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "space-before-function-paren", + url: "https://eslint.style/rules/js/space-before-function-paren" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing before `function` definition opening parenthesis", + recommended: false, + url: "https://eslint.org/docs/latest/rules/space-before-function-paren" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + anonymous: { + enum: ["always", "never", "ignore"] + }, + named: { + enum: ["always", "never", "ignore"] + }, + asyncArrow: { + enum: ["always", "never", "ignore"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedSpace: "Unexpected space before function parentheses.", + missingSpace: "Missing space before function parentheses." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const baseConfig = typeof context.options[0] === "string" ? context.options[0] : "always"; + const overrideConfig = typeof context.options[0] === "object" ? context.options[0] : {}; + + /** + * Determines whether a function has a name. + * @param {ASTNode} node The function node. + * @returns {boolean} Whether the function has a name. + */ + function isNamedFunction(node) { + if (node.id) { + return true; + } + + const parent = node.parent; + + return parent.type === "MethodDefinition" || + (parent.type === "Property" && + ( + parent.kind === "get" || + parent.kind === "set" || + parent.method + ) + ); + } + + /** + * Gets the config for a given function + * @param {ASTNode} node The function node + * @returns {string} "always", "never", or "ignore" + */ + function getConfigForFunction(node) { + if (node.type === "ArrowFunctionExpression") { + + // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar + if (node.async && astUtils.isOpeningParenToken(sourceCode.getFirstToken(node, { skip: 1 }))) { + return overrideConfig.asyncArrow || baseConfig; + } + } else if (isNamedFunction(node)) { + return overrideConfig.named || baseConfig; + + // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + } else if (!node.generator) { + return overrideConfig.anonymous || baseConfig; + } + + return "ignore"; + } + + /** + * Checks the parens of a function node + * @param {ASTNode} node A function node + * @returns {void} + */ + function checkFunction(node) { + const functionConfig = getConfigForFunction(node); + + if (functionConfig === "ignore") { + return; + } + + const rightToken = sourceCode.getFirstToken(node, astUtils.isOpeningParenToken); + const leftToken = sourceCode.getTokenBefore(rightToken); + const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); + + if (hasSpacing && functionConfig === "never") { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start + }, + messageId: "unexpectedSpace", + fix(fixer) { + const comments = sourceCode.getCommentsBefore(rightToken); + + // Don't fix anything if there's a single line comment between the left and the right token + if (comments.some(comment => comment.type === "Line")) { + return null; + } + return fixer.replaceTextRange( + [leftToken.range[1], rightToken.range[0]], + comments.reduce((text, comment) => text + sourceCode.getText(comment), "") + ); + } + }); + } else if (!hasSpacing && functionConfig === "always") { + context.report({ + node, + loc: rightToken.loc, + messageId: "missingSpace", + fix: fixer => fixer.insertTextAfter(leftToken, " ") + }); + } + } + + return { + ArrowFunctionExpression: checkFunction, + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-in-parens.js b/node_modules/eslint/lib/rules/space-in-parens.js new file mode 100644 index 0000000..7cbda1f --- /dev/null +++ b/node_modules/eslint/lib/rules/space-in-parens.js @@ -0,0 +1,303 @@ +/** + * @fileoverview Disallows or enforces spaces inside of parentheses. + * @author Jonathan Rajavuori + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "space-in-parens", + url: "https://eslint.style/rules/js/space-in-parens" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing inside parentheses", + recommended: false, + url: "https://eslint.org/docs/latest/rules/space-in-parens" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + enum: ["{}", "[]", "()", "empty"] + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + missingOpeningSpace: "There must be a space after this paren.", + missingClosingSpace: "There must be a space before this paren.", + rejectedOpeningSpace: "There should be no space after this paren.", + rejectedClosingSpace: "There should be no space before this paren." + } + }, + + create(context) { + const ALWAYS = context.options[0] === "always", + exceptionsArrayOptions = (context.options[1] && context.options[1].exceptions) || [], + options = {}; + + let exceptions; + + if (exceptionsArrayOptions.length) { + options.braceException = exceptionsArrayOptions.includes("{}"); + options.bracketException = exceptionsArrayOptions.includes("[]"); + options.parenException = exceptionsArrayOptions.includes("()"); + options.empty = exceptionsArrayOptions.includes("empty"); + } + + /** + * Produces an object with the opener and closer exception values + * @returns {Object} `openers` and `closers` exception values + * @private + */ + function getExceptions() { + const openers = [], + closers = []; + + if (options.braceException) { + openers.push("{"); + closers.push("}"); + } + + if (options.bracketException) { + openers.push("["); + closers.push("]"); + } + + if (options.parenException) { + openers.push("("); + closers.push(")"); + } + + if (options.empty) { + openers.push(")"); + closers.push("("); + } + + return { + openers, + closers + }; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + /** + * Determines if a token is one of the exceptions for the opener paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the opener paren + */ + function isOpenerException(token) { + return exceptions.openers.includes(token.value); + } + + /** + * Determines if a token is one of the exceptions for the closer paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the closer paren + */ + function isCloserException(token) { + return exceptions.closers.includes(token.value); + } + + /** + * Determines if an opening paren is immediately followed by a required space + * @param {Object} openingParenToken The paren token + * @param {Object} tokenAfterOpeningParen The token after it + * @returns {boolean} True if the opening paren is missing a required space + */ + function openerMissingSpace(openingParenToken, tokenAfterOpeningParen) { + if (sourceCode.isSpaceBetweenTokens(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (!options.empty && astUtils.isClosingParenToken(tokenAfterOpeningParen)) { + return false; + } + + if (ALWAYS) { + return !isOpenerException(tokenAfterOpeningParen); + } + return isOpenerException(tokenAfterOpeningParen); + } + + /** + * Determines if an opening paren is immediately followed by a disallowed space + * @param {Object} openingParenToken The paren token + * @param {Object} tokenAfterOpeningParen The token after it + * @returns {boolean} True if the opening paren has a disallowed space + */ + function openerRejectsSpace(openingParenToken, tokenAfterOpeningParen) { + if (!astUtils.isTokenOnSameLine(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (tokenAfterOpeningParen.type === "Line") { + return false; + } + + if (!sourceCode.isSpaceBetweenTokens(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (ALWAYS) { + return isOpenerException(tokenAfterOpeningParen); + } + return !isOpenerException(tokenAfterOpeningParen); + } + + /** + * Determines if a closing paren is immediately preceded by a required space + * @param {Object} tokenBeforeClosingParen The token before the paren + * @param {Object} closingParenToken The paren token + * @returns {boolean} True if the closing paren is missing a required space + */ + function closerMissingSpace(tokenBeforeClosingParen, closingParenToken) { + if (sourceCode.isSpaceBetweenTokens(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (!options.empty && astUtils.isOpeningParenToken(tokenBeforeClosingParen)) { + return false; + } + + if (ALWAYS) { + return !isCloserException(tokenBeforeClosingParen); + } + return isCloserException(tokenBeforeClosingParen); + } + + /** + * Determines if a closer paren is immediately preceded by a disallowed space + * @param {Object} tokenBeforeClosingParen The token before the paren + * @param {Object} closingParenToken The paren token + * @returns {boolean} True if the closing paren has a disallowed space + */ + function closerRejectsSpace(tokenBeforeClosingParen, closingParenToken) { + if (!astUtils.isTokenOnSameLine(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (!sourceCode.isSpaceBetweenTokens(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (ALWAYS) { + return isCloserException(tokenBeforeClosingParen); + } + return !isCloserException(tokenBeforeClosingParen); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkParenSpaces(node) { + exceptions = getExceptions(); + const tokens = sourceCode.tokensAndComments; + + tokens.forEach((token, i) => { + const prevToken = tokens[i - 1]; + const nextToken = tokens[i + 1]; + + // if token is not an opening or closing paren token, do nothing + if (!astUtils.isOpeningParenToken(token) && !astUtils.isClosingParenToken(token)) { + return; + } + + // if token is an opening paren and is not followed by a required space + if (token.value === "(" && openerMissingSpace(token, nextToken)) { + context.report({ + node, + loc: token.loc, + messageId: "missingOpeningSpace", + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + // if token is an opening paren and is followed by a disallowed space + if (token.value === "(" && openerRejectsSpace(token, nextToken)) { + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "rejectedOpeningSpace", + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + // if token is a closing paren and is not preceded by a required space + if (token.value === ")" && closerMissingSpace(prevToken, token)) { + context.report({ + node, + loc: token.loc, + messageId: "missingClosingSpace", + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + // if token is a closing paren and is preceded by a disallowed space + if (token.value === ")" && closerRejectsSpace(prevToken, token)) { + context.report({ + node, + loc: { start: prevToken.loc.end, end: token.loc.start }, + messageId: "rejectedClosingSpace", + fix(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-infix-ops.js b/node_modules/eslint/lib/rules/space-infix-ops.js new file mode 100644 index 0000000..b8ac4a0 --- /dev/null +++ b/node_modules/eslint/lib/rules/space-infix-ops.js @@ -0,0 +1,216 @@ +/** + * @fileoverview Require spaces around infix operators + * @author Michael Ficarra + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +const { isEqToken } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "space-infix-ops", + url: "https://eslint.style/rules/js/space-infix-ops" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require spacing around infix operators", + recommended: false, + url: "https://eslint.org/docs/latest/rules/space-infix-ops" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + int32Hint: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + missingSpace: "Operator '{{operator}}' must be spaced." + } + }, + + create(context) { + const int32Hint = context.options[0] ? context.options[0].int32Hint === true : false; + const sourceCode = context.sourceCode; + + /** + * Returns the first token which violates the rule + * @param {ASTNode} left The left node of the main node + * @param {ASTNode} right The right node of the main node + * @param {string} op The operator of the main node + * @returns {Object} The violator token or null + * @private + */ + function getFirstNonSpacedToken(left, right, op) { + const operator = sourceCode.getFirstTokenBetween(left, right, token => token.value === op); + const prev = sourceCode.getTokenBefore(operator); + const next = sourceCode.getTokenAfter(operator); + + if (!sourceCode.isSpaceBetweenTokens(prev, operator) || !sourceCode.isSpaceBetweenTokens(operator, next)) { + return operator; + } + + return null; + } + + /** + * Reports an AST node as a rule violation + * @param {ASTNode} mainNode The node to report + * @param {Object} culpritToken The token which has a problem + * @returns {void} + * @private + */ + function report(mainNode, culpritToken) { + context.report({ + node: mainNode, + loc: culpritToken.loc, + messageId: "missingSpace", + data: { + operator: culpritToken.value + }, + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(culpritToken); + const afterToken = sourceCode.getTokenAfter(culpritToken); + let fixString = ""; + + if (culpritToken.range[0] - previousToken.range[1] === 0) { + fixString = " "; + } + + fixString += culpritToken.value; + + if (afterToken.range[0] - culpritToken.range[1] === 0) { + fixString += " "; + } + + return fixer.replaceText(culpritToken, fixString); + } + }); + } + + /** + * Check if the node is binary then report + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkBinary(node) { + const leftNode = (node.left.typeAnnotation) ? node.left.typeAnnotation : node.left; + const rightNode = node.right; + + // search for = in AssignmentPattern nodes + const operator = node.operator || "="; + + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, operator); + + if (nonSpacedNode) { + if (!(int32Hint && sourceCode.getText(node).endsWith("|0"))) { + report(node, nonSpacedNode); + } + } + } + + /** + * Check if the node is conditional + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkConditional(node) { + const nonSpacedConsequentNode = getFirstNonSpacedToken(node.test, node.consequent, "?"); + const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":"); + + if (nonSpacedConsequentNode) { + report(node, nonSpacedConsequentNode); + } + + if (nonSpacedAlternateNode) { + report(node, nonSpacedAlternateNode); + } + } + + /** + * Check if the node is a variable + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkVar(node) { + const leftNode = (node.id.typeAnnotation) ? node.id.typeAnnotation : node.id; + const rightNode = node.init; + + if (rightNode) { + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "="); + + if (nonSpacedNode) { + report(node, nonSpacedNode); + } + } + } + + return { + AssignmentExpression: checkBinary, + AssignmentPattern: checkBinary, + BinaryExpression: checkBinary, + LogicalExpression: checkBinary, + ConditionalExpression: checkConditional, + VariableDeclarator: checkVar, + + PropertyDefinition(node) { + if (!node.value) { + return; + } + + /* + * Because of computed properties and type annotations, some + * tokens may exist between `node.key` and `=`. + * Therefore, find the `=` from the right. + */ + const operatorToken = sourceCode.getTokenBefore(node.value, isEqToken); + const leftToken = sourceCode.getTokenBefore(operatorToken); + const rightToken = sourceCode.getTokenAfter(operatorToken); + + if ( + !sourceCode.isSpaceBetweenTokens(leftToken, operatorToken) || + !sourceCode.isSpaceBetweenTokens(operatorToken, rightToken) + ) { + report(node, operatorToken); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/space-unary-ops.js b/node_modules/eslint/lib/rules/space-unary-ops.js new file mode 100644 index 0000000..876fb88 --- /dev/null +++ b/node_modules/eslint/lib/rules/space-unary-ops.js @@ -0,0 +1,342 @@ +/** + * @fileoverview This rule should require or disallow spaces before or after unary operations. + * @author Marcin Kumorek + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "space-unary-ops", + url: "https://eslint.style/rules/js/space-unary-ops" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce consistent spacing before or after unary operators", + recommended: false, + url: "https://eslint.org/docs/latest/rules/space-unary-ops" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + words: { + type: "boolean", + default: true + }, + nonwords: { + type: "boolean", + default: false + }, + overrides: { + type: "object", + additionalProperties: { + type: "boolean" + } + } + }, + additionalProperties: false + } + ], + messages: { + unexpectedBefore: "Unexpected space before unary operator '{{operator}}'.", + unexpectedAfter: "Unexpected space after unary operator '{{operator}}'.", + unexpectedAfterWord: "Unexpected space after unary word operator '{{word}}'.", + wordOperator: "Unary word operator '{{word}}' must be followed by whitespace.", + operator: "Unary operator '{{operator}}' must be followed by whitespace.", + beforeUnaryExpressions: "Space is required before unary expressions '{{token}}'." + } + }, + + create(context) { + const options = context.options[0] || { words: true, nonwords: false }; + + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the node is the first "!" in a "!!" convert to Boolean expression + * @param {ASTnode} node AST node + * @returns {boolean} Whether or not the node is first "!" in "!!" + */ + function isFirstBangInBangBangExpression(node) { + return node && node.type === "UnaryExpression" && node.argument.operator === "!" && + node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!"; + } + + /** + * Checks if an override exists for a given operator. + * @param {string} operator Operator + * @returns {boolean} Whether or not an override has been provided for the operator + */ + function overrideExistsForOperator(operator) { + return options.overrides && Object.hasOwn(options.overrides, operator); + } + + /** + * Gets the value that the override was set to for this operator + * @param {string} operator Operator + * @returns {boolean} Whether or not an override enforces a space with this operator + */ + function overrideEnforcesSpaces(operator) { + return options.overrides[operator]; + } + + /** + * Verify Unary Word Operator has spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordHasSpaces(node, firstToken, secondToken, word) { + if (secondToken.range[0] === firstToken.range[1]) { + context.report({ + node, + messageId: "wordOperator", + data: { + word + }, + fix(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } + + /** + * Verify Unary Word Operator doesn't have spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) { + if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedAfterWord", + data: { + word + }, + fix(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + + /** + * Check Unary Word Operators for spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) { + if (overrideExistsForOperator(word)) { + if (overrideEnforcesSpaces(word)) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } else if (options.words) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } + + /** + * Verifies YieldExpressions satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpacesAfterYield(node) { + const tokens = sourceCode.getFirstTokens(node, 3), + word = "yield"; + + if (!node.argument || node.delegate) { + return; + } + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word); + } + + /** + * Verifies AwaitExpressions satisfy spacing requirements + * @param {ASTNode} node AwaitExpression AST node + * @returns {void} + */ + function checkForSpacesAfterAwait(node) { + const tokens = sourceCode.getFirstTokens(node, 3); + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], "await"); + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {Object} firstToken First token in the expression + * @param {Object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (isFirstBangInBangBangExpression(node)) { + return; + } + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node, + messageId: "operator", + data: { + operator: firstToken.value + }, + fix(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } else { + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node, + messageId: "beforeUnaryExpressions", + data: { + token: secondToken.value + }, + fix(fixer) { + return fixer.insertTextBefore(secondToken, " "); + } + }); + } + } + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {Object} firstToken First token in the expression + * @param {Object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedAfter", + data: { + operator: firstToken.value + }, + fix(fixer) { + if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + return null; + } + }); + } + } else { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedBefore", + data: { + operator: secondToken.value + }, + fix(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpaces(node) { + const tokens = node.type === "UpdateExpression" && !node.prefix + ? sourceCode.getLastTokens(node, 2) + : sourceCode.getFirstTokens(node, 2); + const firstToken = tokens[0]; + const secondToken = tokens[1]; + + if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") { + checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, firstToken.value); + return; + } + + const operator = node.prefix ? tokens[0].value : tokens[1].value; + + if (overrideExistsForOperator(operator)) { + if (overrideEnforcesSpaces(operator)) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); + } else { + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); + } + } else if (options.nonwords) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); + } else { + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + UnaryExpression: checkForSpaces, + UpdateExpression: checkForSpaces, + NewExpression: checkForSpaces, + YieldExpression: checkForSpacesAfterYield, + AwaitExpression: checkForSpacesAfterAwait + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/spaced-comment.js b/node_modules/eslint/lib/rules/spaced-comment.js new file mode 100644 index 0000000..3cdc5f9 --- /dev/null +++ b/node_modules/eslint/lib/rules/spaced-comment.js @@ -0,0 +1,403 @@ +/** + * @fileoverview Source code for spaced-comments rule + * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 + */ +"use strict"; + +const escapeRegExp = require("escape-string-regexp"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Escapes the control characters of a given string. + * @param {string} s A string to escape. + * @returns {string} An escaped string. + */ +function escape(s) { + return `(?:${escapeRegExp(s)})`; +} + +/** + * Escapes the control characters of a given string. + * And adds a repeat flag. + * @param {string} s A string to escape. + * @returns {string} An escaped string. + */ +function escapeAndRepeat(s) { + return `${escape(s)}+`; +} + +/** + * Parses `markers` option. + * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments. + * @param {string[]} [markers] A marker list. + * @returns {string[]} A marker list. + */ +function parseMarkersOption(markers) { + + // `*` is a marker for JSDoc comments. + if (!markers.includes("*")) { + return markers.concat("*"); + } + + return markers; +} + +/** + * Creates string pattern for exceptions. + * Generated pattern: + * + * 1. A space or an exception pattern sequence. + * @param {string[]} exceptions An exception pattern list. + * @returns {string} A regular expression string for exceptions. + */ +function createExceptionsPattern(exceptions) { + let pattern = ""; + + /* + * A space or an exception pattern sequence. + * [] ==> "\s" + * ["-"] ==> "(?:\s|\-+$)" + * ["-", "="] ==> "(?:\s|(?:\-+|=+)$)" + * ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24) + */ + if (exceptions.length === 0) { + + // a space. + pattern += "\\s"; + } else { + + // a space or... + pattern += "(?:\\s|"; + + if (exceptions.length === 1) { + + // a sequence of the exception pattern. + pattern += escapeAndRepeat(exceptions[0]); + } else { + + // a sequence of one of the exception patterns. + pattern += "(?:"; + pattern += exceptions.map(escapeAndRepeat).join("|"); + pattern += ")"; + } + pattern += `(?:$|[${Array.from(astUtils.LINEBREAKS).join("")}]))`; + } + + return pattern; +} + +/** + * Creates RegExp object for `always` mode. + * Generated pattern for beginning of comment: + * + * 1. First, a marker or nothing. + * 2. Next, a space or an exception pattern sequence. + * @param {string[]} markers A marker list. + * @param {string[]} exceptions An exception pattern list. + * @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode. + */ +function createAlwaysStylePattern(markers, exceptions) { + let pattern = "^"; + + /* + * A marker or nothing. + * ["*"] ==> "\*?" + * ["*", "!"] ==> "(?:\*|!)?" + * ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F + */ + if (markers.length === 1) { + + // the marker. + pattern += escape(markers[0]); + } else { + + // one of markers. + pattern += "(?:"; + pattern += markers.map(escape).join("|"); + pattern += ")"; + } + + pattern += "?"; // or nothing. + pattern += createExceptionsPattern(exceptions); + + return new RegExp(pattern, "u"); +} + +/** + * Creates RegExp object for `never` mode. + * Generated pattern for beginning of comment: + * + * 1. First, a marker or nothing (captured). + * 2. Next, a space or a tab. + * @param {string[]} markers A marker list. + * @returns {RegExp} A RegExp object for `never` mode. + */ +function createNeverStylePattern(markers) { + const pattern = `^(${markers.map(escape).join("|")})?[ \t]+`; + + return new RegExp(pattern, "u"); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "spaced-comment", + url: "https://eslint.style/rules/js/spaced-comment" + } + } + ] + }, + type: "suggestion", + + docs: { + description: "Enforce consistent spacing after the `//` or `/*` in a comment", + recommended: false, + url: "https://eslint.org/docs/latest/rules/spaced-comment" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + }, + line: { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }, + block: { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + }, + balanced: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceAfterMarker: "Unexpected space or tab after marker ({{refChar}}) in comment.", + expectedExceptionAfter: "Expected exception block, space or tab after '{{refChar}}' in comment.", + unexpectedSpaceBefore: "Unexpected space or tab before '*/' in comment.", + unexpectedSpaceAfter: "Unexpected space or tab after '{{refChar}}' in comment.", + expectedSpaceBefore: "Expected space or tab before '*/' in comment.", + expectedSpaceAfter: "Expected space or tab after '{{refChar}}' in comment." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + // Unless the first option is never, require a space + const requireSpace = context.options[0] !== "never"; + + /* + * Parse the second options. + * If markers don't include `"*"`, it's added automatically for JSDoc + * comments. + */ + const config = context.options[1] || {}; + const balanced = config.block && config.block.balanced; + + const styleRules = ["block", "line"].reduce((rule, type) => { + const markers = parseMarkersOption(config[type] && config[type].markers || config.markers || []); + const exceptions = config[type] && config[type].exceptions || config.exceptions || []; + const endNeverPattern = "[ \t]+$"; + + // Create RegExp object for valid patterns. + rule[type] = { + beginRegex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers), + endRegex: balanced && requireSpace ? new RegExp(`${createExceptionsPattern(exceptions)}$`, "u") : new RegExp(endNeverPattern, "u"), + hasExceptions: exceptions.length > 0, + captureMarker: new RegExp(`^(${markers.map(escape).join("|")})`, "u"), + markers: new Set(markers) + }; + + return rule; + }, {}); + + /** + * Reports a beginning spacing error with an appropriate message. + * @param {ASTNode} node A comment node to check. + * @param {string} messageId An error message to report. + * @param {Array} match An array of match results for markers. + * @param {string} refChar Character used for reference in the error message. + * @returns {void} + */ + function reportBegin(node, messageId, match, refChar) { + const type = node.type.toLowerCase(), + commentIdentifier = type === "block" ? "/*" : "//"; + + context.report({ + node, + fix(fixer) { + const start = node.range[0]; + let end = start + 2; + + if (requireSpace) { + if (match) { + end += match[0].length; + } + return fixer.insertTextAfterRange([start, end], " "); + } + end += match[0].length; + return fixer.replaceTextRange([start, end], commentIdentifier + (match[1] ? match[1] : "")); + + }, + messageId, + data: { refChar } + }); + } + + /** + * Reports an ending spacing error with an appropriate message. + * @param {ASTNode} node A comment node to check. + * @param {string} messageId An error message to report. + * @param {string} match An array of the matched whitespace characters. + * @returns {void} + */ + function reportEnd(node, messageId, match) { + context.report({ + node, + fix(fixer) { + if (requireSpace) { + return fixer.insertTextAfterRange([node.range[0], node.range[1] - 2], " "); + } + const end = node.range[1] - 2, + start = end - match[0].length; + + return fixer.replaceTextRange([start, end], ""); + + }, + messageId + }); + } + + /** + * Reports a given comment if it's invalid. + * @param {ASTNode} node a comment node to check. + * @returns {void} + */ + function checkCommentForSpace(node) { + const type = node.type.toLowerCase(), + rule = styleRules[type], + commentIdentifier = type === "block" ? "/*" : "//"; + + // Ignores empty comments and comments that consist only of a marker. + if (node.value.length === 0 || rule.markers.has(node.value)) { + return; + } + + const beginMatch = rule.beginRegex.exec(node.value); + const endMatch = rule.endRegex.exec(node.value); + + // Checks. + if (requireSpace) { + if (!beginMatch) { + const hasMarker = rule.captureMarker.exec(node.value); + const marker = hasMarker ? commentIdentifier + hasMarker[0] : commentIdentifier; + + if (rule.hasExceptions) { + reportBegin(node, "expectedExceptionAfter", hasMarker, marker); + } else { + reportBegin(node, "expectedSpaceAfter", hasMarker, marker); + } + } + + if (balanced && type === "block" && !endMatch) { + reportEnd(node, "expectedSpaceBefore"); + } + } else { + if (beginMatch) { + if (!beginMatch[1]) { + reportBegin(node, "unexpectedSpaceAfter", beginMatch, commentIdentifier); + } else { + reportBegin(node, "unexpectedSpaceAfterMarker", beginMatch, beginMatch[1]); + } + } + + if (balanced && type === "block" && endMatch) { + reportEnd(node, "unexpectedSpaceBefore", endMatch); + } + } + } + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(checkCommentForSpace); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/strict.js b/node_modules/eslint/lib/rules/strict.js new file mode 100644 index 0000000..198bf85 --- /dev/null +++ b/node_modules/eslint/lib/rules/strict.js @@ -0,0 +1,278 @@ +/** + * @fileoverview Rule to control usage of strict mode directives. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets all of the Use Strict Directives in the Directive Prologue of a group of + * statements. + * @param {ASTNode[]} statements Statements in the program or function body. + * @returns {ASTNode[]} All of the Use Strict Directives. + */ +function getUseStrictDirectives(statements) { + const directives = []; + + for (let i = 0; i < statements.length; i++) { + const statement = statements[i]; + + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + statement.expression.value === "use strict" + ) { + directives[i] = statement; + } else { + break; + } + } + + return directives; +} + +/** + * Checks whether a given parameter is a simple parameter. + * @param {ASTNode} node A pattern node to check. + * @returns {boolean} `true` if the node is an Identifier node. + */ +function isSimpleParameter(node) { + return node.type === "Identifier"; +} + +/** + * Checks whether a given parameter list is a simple parameter list. + * @param {ASTNode[]} params A parameter list to check. + * @returns {boolean} `true` if the every parameter is an Identifier node. + */ +function isSimpleParameterList(params) { + return params.every(isSimpleParameter); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["safe"], + + docs: { + description: "Require or disallow strict mode directives", + recommended: false, + url: "https://eslint.org/docs/latest/rules/strict" + }, + + schema: [ + { + enum: ["never", "global", "function", "safe"] + } + ], + + fixable: "code", + messages: { + function: "Use the function form of 'use strict'.", + global: "Use the global form of 'use strict'.", + multiple: "Multiple 'use strict' directives.", + never: "Strict mode is not permitted.", + unnecessary: "Unnecessary 'use strict' directive.", + module: "'use strict' is unnecessary inside of modules.", + implied: "'use strict' is unnecessary when implied strict mode is enabled.", + unnecessaryInClasses: "'use strict' is unnecessary inside of classes.", + nonSimpleParameterList: "'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.", + wrap: "Wrap {{name}} in a function with 'use strict' directive." + } + }, + + create(context) { + const ecmaFeatures = context.parserOptions.ecmaFeatures || {}, + scopes = [], + classScopes = []; + let [mode] = context.options; + + if (ecmaFeatures.impliedStrict) { + mode = "implied"; + } else if (mode === "safe") { + mode = ecmaFeatures.globalReturn || context.languageOptions.sourceType === "commonjs" ? "global" : "function"; + } + + /** + * Determines whether a reported error should be fixed, depending on the error type. + * @param {string} errorType The type of error + * @returns {boolean} `true` if the reported error should be fixed + */ + function shouldFix(errorType) { + return errorType === "multiple" || errorType === "unnecessary" || errorType === "module" || errorType === "implied" || errorType === "unnecessaryInClasses"; + } + + /** + * Gets a fixer function to remove a given 'use strict' directive. + * @param {ASTNode} node The directive that should be removed + * @returns {Function} A fixer function + */ + function getFixFunction(node) { + return fixer => fixer.remove(node); + } + + /** + * Report a slice of an array of nodes with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} start Index to start from. + * @param {string} end Index to end before. + * @param {string} messageId Message to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportSlice(nodes, start, end, messageId, fix) { + nodes.slice(start, end).forEach(node => { + context.report({ node, messageId, fix: fix ? getFixFunction(node) : null }); + }); + } + + /** + * Report all nodes in an array with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} messageId Message id to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportAll(nodes, messageId, fix) { + reportSlice(nodes, 0, nodes.length, messageId, fix); + } + + /** + * Report all nodes in an array, except the first, with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} messageId Message id to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportAllExceptFirst(nodes, messageId, fix) { + reportSlice(nodes, 1, nodes.length, messageId, fix); + } + + /** + * Entering a function in 'function' mode pushes a new nested scope onto the + * stack. The new scope is true if the nested function is strict mode code. + * @param {ASTNode} node The function declaration or expression. + * @param {ASTNode[]} useStrictDirectives The Use Strict Directives of the node. + * @returns {void} + */ + function enterFunctionInFunctionMode(node, useStrictDirectives) { + const isInClass = classScopes.length > 0, + isParentGlobal = scopes.length === 0 && classScopes.length === 0, + isParentStrict = scopes.length > 0 && scopes.at(-1), + isStrict = useStrictDirectives.length > 0; + + if (isStrict) { + if (!isSimpleParameterList(node.params)) { + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + } else if (isParentStrict) { + context.report({ node: useStrictDirectives[0], messageId: "unnecessary", fix: getFixFunction(useStrictDirectives[0]) }); + } else if (isInClass) { + context.report({ node: useStrictDirectives[0], messageId: "unnecessaryInClasses", fix: getFixFunction(useStrictDirectives[0]) }); + } + + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } else if (isParentGlobal) { + if (isSimpleParameterList(node.params)) { + context.report({ node, messageId: "function" }); + } else { + context.report({ + node, + messageId: "wrap", + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + } + + scopes.push(isParentStrict || isStrict); + } + + /** + * Exiting a function in 'function' mode pops its scope off the stack. + * @returns {void} + */ + function exitFunctionInFunctionMode() { + scopes.pop(); + } + + /** + * Enter a function and either: + * - Push a new nested scope onto the stack (in 'function' mode). + * - Report all the Use Strict Directives (in the other modes). + * @param {ASTNode} node The function declaration or expression. + * @returns {void} + */ + function enterFunction(node) { + const isBlock = node.body.type === "BlockStatement", + useStrictDirectives = isBlock + ? getUseStrictDirectives(node.body.body) : []; + + if (mode === "function") { + enterFunctionInFunctionMode(node, useStrictDirectives); + } else if (useStrictDirectives.length > 0) { + if (isSimpleParameterList(node.params)) { + reportAll(useStrictDirectives, mode, shouldFix(mode)); + } else { + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } + } + } + + const rule = { + Program(node) { + const useStrictDirectives = getUseStrictDirectives(node.body); + + if (node.sourceType === "module") { + mode = "module"; + } + + if (mode === "global") { + if (node.body.length > 0 && useStrictDirectives.length === 0) { + context.report({ node, messageId: "global" }); + } + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } else { + reportAll(useStrictDirectives, mode, shouldFix(mode)); + } + }, + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction + }; + + if (mode === "function") { + Object.assign(rule, { + + // Inside of class bodies are always strict mode. + ClassBody() { + classScopes.push(true); + }, + "ClassBody:exit"() { + classScopes.pop(); + }, + + "FunctionDeclaration:exit": exitFunctionInFunctionMode, + "FunctionExpression:exit": exitFunctionInFunctionMode, + "ArrowFunctionExpression:exit": exitFunctionInFunctionMode + }); + } + + return rule; + } +}; diff --git a/node_modules/eslint/lib/rules/switch-colon-spacing.js b/node_modules/eslint/lib/rules/switch-colon-spacing.js new file mode 100644 index 0000000..b482f2e --- /dev/null +++ b/node_modules/eslint/lib/rules/switch-colon-spacing.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Rule to enforce spacing around colons of switch statements. + * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "switch-colon-spacing", + url: "https://eslint.style/rules/js/switch-colon-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Enforce spacing around colons of switch statements", + recommended: false, + url: "https://eslint.org/docs/latest/rules/switch-colon-spacing" + }, + + schema: [ + { + type: "object", + properties: { + before: { type: "boolean", default: false }, + after: { type: "boolean", default: true } + }, + additionalProperties: false + } + ], + fixable: "whitespace", + messages: { + expectedBefore: "Expected space(s) before this colon.", + expectedAfter: "Expected space(s) after this colon.", + unexpectedBefore: "Unexpected space(s) before this colon.", + unexpectedAfter: "Unexpected space(s) after this colon." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const options = context.options[0] || {}; + const beforeSpacing = options.before === true; // false by default + const afterSpacing = options.after !== false; // true by default + + /** + * Check whether the spacing between the given 2 tokens is valid or not. + * @param {Token} left The left token to check. + * @param {Token} right The right token to check. + * @param {boolean} expected The expected spacing to check. `true` if there should be a space. + * @returns {boolean} `true` if the spacing between the tokens is valid. + */ + function isValidSpacing(left, right, expected) { + return ( + astUtils.isClosingBraceToken(right) || + !astUtils.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === expected + ); + } + + /** + * Check whether comments exist between the given 2 tokens. + * @param {Token} left The left token to check. + * @param {Token} right The right token to check. + * @returns {boolean} `true` if comments exist between the given 2 tokens. + */ + function commentsExistBetween(left, right) { + return sourceCode.getFirstTokenBetween( + left, + right, + { + includeComments: true, + filter: astUtils.isCommentToken + } + ) !== null; + } + + /** + * Fix the spacing between the given 2 tokens. + * @param {RuleFixer} fixer The fixer to fix. + * @param {Token} left The left token of fix range. + * @param {Token} right The right token of fix range. + * @param {boolean} spacing The spacing style. `true` if there should be a space. + * @returns {Fix|null} The fix object. + */ + function fix(fixer, left, right, spacing) { + if (commentsExistBetween(left, right)) { + return null; + } + if (spacing) { + return fixer.insertTextAfter(left, " "); + } + return fixer.removeRange([left.range[1], right.range[0]]); + } + + return { + SwitchCase(node) { + const colonToken = astUtils.getSwitchCaseColonToken(node, sourceCode); + const beforeToken = sourceCode.getTokenBefore(colonToken); + const afterToken = sourceCode.getTokenAfter(colonToken); + + if (!isValidSpacing(beforeToken, colonToken, beforeSpacing)) { + context.report({ + node, + loc: colonToken.loc, + messageId: beforeSpacing ? "expectedBefore" : "unexpectedBefore", + fix: fixer => fix(fixer, beforeToken, colonToken, beforeSpacing) + }); + } + if (!isValidSpacing(colonToken, afterToken, afterSpacing)) { + context.report({ + node, + loc: colonToken.loc, + messageId: afterSpacing ? "expectedAfter" : "unexpectedAfter", + fix: fixer => fix(fixer, colonToken, afterToken, afterSpacing) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/symbol-description.js b/node_modules/eslint/lib/rules/symbol-description.js new file mode 100644 index 0000000..4528f09 --- /dev/null +++ b/node_modules/eslint/lib/rules/symbol-description.js @@ -0,0 +1,73 @@ +/** + * @fileoverview Rule to enforce description with the `Symbol` object + * @author Jarek Rencz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require symbol descriptions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/symbol-description" + }, + fixable: null, + schema: [], + messages: { + expected: "Expected Symbol to have a description." + } + }, + + create(context) { + + const sourceCode = context.sourceCode; + + /** + * Reports if node does not conform the rule in case rule is set to + * report missing description + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + function checkArgument(node) { + if (node.arguments.length === 0) { + context.report({ + node, + messageId: "expected" + }); + } + } + + return { + "Program:exit"(node) { + const scope = sourceCode.getScope(node); + const variable = astUtils.getVariableByName(scope, "Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(reference => { + const idNode = reference.identifier; + + if (astUtils.isCallee(idNode)) { + checkArgument(idNode.parent); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/template-curly-spacing.js b/node_modules/eslint/lib/rules/template-curly-spacing.js new file mode 100644 index 0000000..2112efa --- /dev/null +++ b/node_modules/eslint/lib/rules/template-curly-spacing.js @@ -0,0 +1,162 @@ +/** + * @fileoverview Rule to enforce spacing around embedded expressions of template strings + * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "template-curly-spacing", + url: "https://eslint.style/rules/js/template-curly-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow spacing around embedded expressions of template strings", + recommended: false, + url: "https://eslint.org/docs/latest/rules/template-curly-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + messages: { + expectedBefore: "Expected space(s) before '}'.", + expectedAfter: "Expected space(s) after '${'.", + unexpectedBefore: "Unexpected space(s) before '}'.", + unexpectedAfter: "Unexpected space(s) after '${'." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + const always = context.options[0] === "always"; + + /** + * Checks spacing before `}` of a given token. + * @param {Token} token A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingBefore(token) { + if (!token.value.startsWith("}")) { + return; // starts with a backtick, this is the first template element in the template literal + } + + const prevToken = sourceCode.getTokenBefore(token, { includeComments: true }), + hasSpace = sourceCode.isSpaceBetween(prevToken, token); + + if (!astUtils.isTokenOnSameLine(prevToken, token)) { + return; + } + + if (always && !hasSpace) { + context.report({ + loc: { + start: token.loc.start, + end: { + line: token.loc.start.line, + column: token.loc.start.column + 1 + } + }, + messageId: "expectedBefore", + fix: fixer => fixer.insertTextBefore(token, " ") + }); + } + + if (!always && hasSpace) { + context.report({ + loc: { + start: prevToken.loc.end, + end: token.loc.start + }, + messageId: "unexpectedBefore", + fix: fixer => fixer.removeRange([prevToken.range[1], token.range[0]]) + }); + } + } + + /** + * Checks spacing after `${` of a given token. + * @param {Token} token A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingAfter(token) { + if (!token.value.endsWith("${")) { + return; // ends with a backtick, this is the last template element in the template literal + } + + const nextToken = sourceCode.getTokenAfter(token, { includeComments: true }), + hasSpace = sourceCode.isSpaceBetween(token, nextToken); + + if (!astUtils.isTokenOnSameLine(token, nextToken)) { + return; + } + + if (always && !hasSpace) { + context.report({ + loc: { + start: { + line: token.loc.end.line, + column: token.loc.end.column - 2 + }, + end: token.loc.end + }, + messageId: "expectedAfter", + fix: fixer => fixer.insertTextAfter(token, " ") + }); + } + + if (!always && hasSpace) { + context.report({ + loc: { + start: token.loc.end, + end: nextToken.loc.start + }, + messageId: "unexpectedAfter", + fix: fixer => fixer.removeRange([token.range[1], nextToken.range[0]]) + }); + } + } + + return { + TemplateElement(node) { + const token = sourceCode.getFirstToken(node); + + checkSpacingBefore(token); + checkSpacingAfter(token); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/template-tag-spacing.js b/node_modules/eslint/lib/rules/template-tag-spacing.js new file mode 100644 index 0000000..3026461 --- /dev/null +++ b/node_modules/eslint/lib/rules/template-tag-spacing.js @@ -0,0 +1,111 @@ +/** + * @fileoverview Rule to check spacing between template tags and their literals + * @author Jonathan Wilsson + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "template-tag-spacing", + url: "https://eslint.style/rules/js/template-tag-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow spacing between template tags and their literals", + recommended: false, + url: "https://eslint.org/docs/latest/rules/template-tag-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + messages: { + unexpected: "Unexpected space between template tag and template literal.", + missing: "Missing space between template tag and template literal." + } + }, + + create(context) { + const never = context.options[0] !== "always"; + const sourceCode = context.sourceCode; + + /** + * Check if a space is present between a template tag and its literal + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkSpacing(node) { + const tagToken = sourceCode.getTokenBefore(node.quasi); + const literalToken = sourceCode.getFirstToken(node.quasi); + const hasWhitespace = sourceCode.isSpaceBetweenTokens(tagToken, literalToken); + + if (never && hasWhitespace) { + context.report({ + node, + loc: { + start: tagToken.loc.end, + end: literalToken.loc.start + }, + messageId: "unexpected", + fix(fixer) { + const comments = sourceCode.getCommentsBefore(node.quasi); + + // Don't fix anything if there's a single line comment after the template tag + if (comments.some(comment => comment.type === "Line")) { + return null; + } + + return fixer.replaceTextRange( + [tagToken.range[1], literalToken.range[0]], + comments.reduce((text, comment) => text + sourceCode.getText(comment), "") + ); + } + }); + } else if (!never && !hasWhitespace) { + context.report({ + node, + loc: { + start: node.loc.start, + end: literalToken.loc.start + }, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfter(tagToken, " "); + } + }); + } + } + + return { + TaggedTemplateExpression: checkSpacing + }; + } +}; diff --git a/node_modules/eslint/lib/rules/unicode-bom.js b/node_modules/eslint/lib/rules/unicode-bom.js new file mode 100644 index 0000000..15c7ad7 --- /dev/null +++ b/node_modules/eslint/lib/rules/unicode-bom.js @@ -0,0 +1,75 @@ +/** + * @fileoverview Require or disallow Unicode BOM + * @author Andrew Johnston + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "layout", + + defaultOptions: ["never"], + + docs: { + description: "Require or disallow Unicode byte order mark (BOM)", + recommended: false, + url: "https://eslint.org/docs/latest/rules/unicode-bom" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + } + ], + messages: { + expected: "Expected Unicode BOM (Byte Order Mark).", + unexpected: "Unexpected Unicode BOM (Byte Order Mark)." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program: function checkUnicodeBOM(node) { + + const sourceCode = context.sourceCode, + location = { column: 0, line: 1 }; + const [requireBOM] = context.options; + + if (!sourceCode.hasBOM && (requireBOM === "always")) { + context.report({ + node, + loc: location, + messageId: "expected", + fix(fixer) { + return fixer.insertTextBeforeRange([0, 1], "\uFEFF"); + } + }); + } else if (sourceCode.hasBOM && (requireBOM === "never")) { + context.report({ + node, + loc: location, + messageId: "unexpected", + fix(fixer) { + return fixer.removeRange([-1, 0]); + } + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/use-isnan.js b/node_modules/eslint/lib/rules/use-isnan.js new file mode 100644 index 0000000..046b912 --- /dev/null +++ b/node_modules/eslint/lib/rules/use-isnan.js @@ -0,0 +1,237 @@ +/** + * @fileoverview Rule to flag comparisons to the value NaN + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given node is a NaN `Identifier` node. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is 'NaN' identifier. + */ +function isNaNIdentifier(node) { + if (!node) { + return false; + } + + const nodeToCheck = node.type === "SequenceExpression" + ? node.expressions.at(-1) + : node; + + return ( + astUtils.isSpecificId(nodeToCheck, "NaN") || + astUtils.isSpecificMemberAccess(nodeToCheck, "Number", "NaN") + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + hasSuggestions: true, + type: "problem", + + docs: { + description: "Require calls to `isNaN()` when checking for `NaN`", + recommended: true, + url: "https://eslint.org/docs/latest/rules/use-isnan" + }, + + schema: [ + { + type: "object", + properties: { + enforceForSwitchCase: { + type: "boolean" + }, + enforceForIndexOf: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + defaultOptions: [{ + enforceForIndexOf: false, + enforceForSwitchCase: true + }], + + messages: { + comparisonWithNaN: "Use the isNaN function to compare with NaN.", + switchNaN: "'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.", + caseNaN: "'case NaN' can never match. Use Number.isNaN before the switch.", + indexOfNaN: "Array prototype method '{{ methodName }}' cannot find NaN.", + replaceWithIsNaN: "Replace with Number.isNaN.", + replaceWithCastingAndIsNaN: "Replace with Number.isNaN and cast to a Number.", + replaceWithFindIndex: "Replace with Array.prototype.{{ methodName }}." + } + }, + + create(context) { + + const [{ enforceForIndexOf, enforceForSwitchCase }] = context.options; + const sourceCode = context.sourceCode; + + const fixableOperators = new Set(["==", "===", "!=", "!=="]); + const castableOperators = new Set(["==", "!="]); + + /** + * Get a fixer for a binary expression that compares to NaN. + * @param {ASTNode} node The node to fix. + * @param {function(string): string} wrapValue A function that wraps the compared value with a fix. + * @returns {function(Fixer): Fix} The fixer function. + */ + function getBinaryExpressionFixer(node, wrapValue) { + return fixer => { + const comparedValue = isNaNIdentifier(node.left) ? node.right : node.left; + const shouldWrap = comparedValue.type === "SequenceExpression"; + const shouldNegate = node.operator[0] === "!"; + + const negation = shouldNegate ? "!" : ""; + let comparedValueText = sourceCode.getText(comparedValue); + + if (shouldWrap) { + comparedValueText = `(${comparedValueText})`; + } + + const fixedValue = wrapValue(comparedValueText); + + return fixer.replaceText(node, `${negation}${fixedValue}`); + }; + } + + /** + * Checks the given `BinaryExpression` node for `foo === NaN` and other comparisons. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkBinaryExpression(node) { + if ( + /^(?:[<>]|[!=]=)=?$/u.test(node.operator) && + (isNaNIdentifier(node.left) || isNaNIdentifier(node.right)) + ) { + const suggestedFixes = []; + const NaNNode = isNaNIdentifier(node.left) ? node.left : node.right; + + const isSequenceExpression = NaNNode.type === "SequenceExpression"; + const isSuggestable = fixableOperators.has(node.operator) && !isSequenceExpression; + const isCastable = castableOperators.has(node.operator); + + if (isSuggestable) { + suggestedFixes.push({ + messageId: "replaceWithIsNaN", + fix: getBinaryExpressionFixer(node, value => `Number.isNaN(${value})`) + }); + + if (isCastable) { + suggestedFixes.push({ + messageId: "replaceWithCastingAndIsNaN", + fix: getBinaryExpressionFixer(node, value => `Number.isNaN(Number(${value}))`) + }); + } + } + + context.report({ + node, + messageId: "comparisonWithNaN", + suggest: suggestedFixes + }); + } + } + + /** + * Checks the discriminant and all case clauses of the given `SwitchStatement` node for `switch(NaN)` and `case NaN:` + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkSwitchStatement(node) { + if (isNaNIdentifier(node.discriminant)) { + context.report({ node, messageId: "switchNaN" }); + } + + for (const switchCase of node.cases) { + if (isNaNIdentifier(switchCase.test)) { + context.report({ node: switchCase, messageId: "caseNaN" }); + } + } + } + + /** + * Checks the given `CallExpression` node for `.indexOf(NaN)` and `.lastIndexOf(NaN)`. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkCallExpression(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "MemberExpression") { + const methodName = astUtils.getStaticPropertyName(callee); + + if ( + (methodName === "indexOf" || methodName === "lastIndexOf") && + node.arguments.length <= 2 && + isNaNIdentifier(node.arguments[0]) + ) { + + /* + * To retain side effects, it's essential to address `NaN` beforehand, which + * is not possible with fixes like `arr.findIndex(Number.isNaN)`. + */ + const isSuggestable = node.arguments[0].type !== "SequenceExpression" && !node.arguments[1]; + const suggestedFixes = []; + + if (isSuggestable) { + const shouldWrap = callee.computed; + const findIndexMethod = methodName === "indexOf" ? "findIndex" : "findLastIndex"; + const propertyName = shouldWrap ? `"${findIndexMethod}"` : findIndexMethod; + + suggestedFixes.push({ + messageId: "replaceWithFindIndex", + data: { methodName: findIndexMethod }, + fix: fixer => [ + fixer.replaceText(callee.property, propertyName), + fixer.replaceText(node.arguments[0], "Number.isNaN") + ] + }); + } + + context.report({ + node, + messageId: "indexOfNaN", + data: { methodName }, + suggest: suggestedFixes + }); + } + } + } + + const listeners = { + BinaryExpression: checkBinaryExpression + }; + + if (enforceForSwitchCase) { + listeners.SwitchStatement = checkSwitchStatement; + } + + if (enforceForIndexOf) { + listeners.CallExpression = checkCallExpression; + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/utils/ast-utils.js b/node_modules/eslint/lib/rules/utils/ast-utils.js new file mode 100644 index 0000000..7a93da1 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -0,0 +1,2476 @@ +/** + * @fileoverview Common utils for AST. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { KEYS: eslintVisitorKeys } = require("eslint-visitor-keys"); +const esutils = require("esutils"); +const espree = require("espree"); +const escapeRegExp = require("escape-string-regexp"); +const { + breakableTypePattern, + createGlobalLinebreakMatcher, + lineBreakPattern, + shebangPattern +} = require("../../shared/ast-utils"); +const globals = require("../../../conf/globals"); +const { LATEST_ECMA_VERSION } = require("../../../conf/ecma-version"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/u; +const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/u; +const arrayMethodWithThisArgPattern = /^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|some)$/u; +const arrayOrTypedArrayPattern = /Array$/u; +const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/u; +const thisTagPattern = /^[\s*]*@this/mu; + + +const COMMENTS_IGNORE_PATTERN = /^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u; +const ESLINT_DIRECTIVE_PATTERN = /^(?:eslint[- ]|(?:globals?|exported) )/u; +const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]); + +// A set of node types that can contain a list of statements +const STATEMENT_LIST_PARENTS = new Set(["Program", "BlockStatement", "StaticBlock", "SwitchCase"]); + +const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u; + +// Tests the presence of at least one LegacyOctalEscapeSequence or NonOctalDecimalEscapeSequence in a raw string +const OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN = /^(?:[^\\]|\\.)*\\(?:[1-9]|0[0-9])/su; + +const LOGICAL_ASSIGNMENT_OPERATORS = new Set(["&&=", "||=", "??="]); + +/** + * All builtin global variables defined in the latest ECMAScript specification. + * @type {Record} Key is the name of the variable. Value is `true` if the variable is considered writable, `false` otherwise. + */ +const ECMASCRIPT_GLOBALS = globals[`es${LATEST_ECMA_VERSION}`]; + +/** + * Checks reference if is non initializer and writable. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {boolean} Success/Failure + * @private + */ +function isModifyingReference(reference, index, references) { + const identifier = reference.identifier; + + /* + * Destructuring assignments can have multiple default value, so + * possibly there are multiple writeable references for the same + * identifier. + */ + const modifyingDifferentIdentifier = index === 0 || + references[index - 1].identifier !== identifier; + + return (identifier && + reference.init === false && + reference.isWrite() && + modifyingDifferentIdentifier + ); +} + +/** + * Checks whether the given string starts with uppercase or not. + * @param {string} s The string to check. + * @returns {boolean} `true` if the string starts with uppercase. + */ +function startsWithUpperCase(s) { + return s[0] !== s[0].toLocaleLowerCase(); +} + +/** + * Checks whether or not a node is a constructor. + * @param {ASTNode} node A function node to check. + * @returns {boolean} Whether or not a node is a constructor. + */ +function isES5Constructor(node) { + return (node.id && startsWithUpperCase(node.id.name)); +} + +/** + * Finds a function node from ancestors of a node. + * @param {ASTNode} node A start node to find. + * @returns {Node|null} A found function node. + */ +function getUpperFunction(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if (anyFunctionPattern.test(currentNode.type)) { + return currentNode; + } + } + return null; +} + +/** + * Checks whether a given node is a function node or not. + * The following types are function nodes: + * + * - ArrowFunctionExpression + * - FunctionDeclaration + * - FunctionExpression + * @param {ASTNode|null} node A node to check. + * @returns {boolean} `true` if the node is a function node. + */ +function isFunction(node) { + return Boolean(node && anyFunctionPattern.test(node.type)); +} + +/** + * Checks whether a given node is a loop node or not. + * The following types are loop nodes: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - WhileStatement + * @param {ASTNode|null} node A node to check. + * @returns {boolean} `true` if the node is a loop node. + */ +function isLoop(node) { + return Boolean(node && anyLoopPattern.test(node.type)); +} + +/** + * Checks whether the given node is in a loop or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is in a loop. + */ +function isInLoop(node) { + for (let currentNode = node; currentNode && !isFunction(currentNode); currentNode = currentNode.parent) { + if (isLoop(currentNode)) { + return true; + } + } + + return false; +} + +/** + * Determines whether the given node is a `null` literal. + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the node is a `null` literal + */ +function isNullLiteral(node) { + + /* + * Checking `node.value === null` does not guarantee that a literal is a null literal. + * When parsing values that cannot be represented in the current environment (e.g. unicode + * regexes in Node 4), `node.value` is set to `null` because it wouldn't be possible to + * set `node.value` to a unicode regex. To make sure a literal is actually `null`, check + * `node.regex` instead. Also see: https://github.com/eslint/eslint/issues/8020 + */ + return node.type === "Literal" && node.value === null && !node.regex && !node.bigint; +} + +/** + * Checks whether or not a node is `null` or `undefined`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `null` or `undefined`. + * @public + */ +function isNullOrUndefined(node) { + return ( + isNullLiteral(node) || + (node.type === "Identifier" && node.name === "undefined") || + (node.type === "UnaryExpression" && node.operator === "void") + ); +} + +/** + * Checks whether or not a node is callee. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is callee. + */ +function isCallee(node) { + return node.parent.type === "CallExpression" && node.parent.callee === node; +} + +/** + * Returns the result of the string conversion applied to the evaluated value of the given expression node, + * if it can be determined statically. + * + * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only. + * In all other cases, this function returns `null`. + * @param {ASTNode} node Expression node. + * @returns {string|null} String value if it can be determined. Otherwise, `null`. + */ +function getStaticStringValue(node) { + switch (node.type) { + case "Literal": + if (node.value === null) { + if (isNullLiteral(node)) { + return String(node.value); // "null" + } + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}`; + } + if (node.bigint) { + return node.bigint; + } + + // Otherwise, this is an unknown literal. The function will return null. + + } else { + return String(node.value); + } + break; + case "TemplateLiteral": + if (node.expressions.length === 0 && node.quasis.length === 1) { + return node.quasis[0].value.cooked; + } + break; + + // no default + } + + return null; +} + +/** + * Gets the property name of a given node. + * The node can be a MemberExpression, a Property, or a MethodDefinition. + * + * If the name is dynamic, this returns `null`. + * + * For examples: + * + * a.b // => "b" + * a["b"] // => "b" + * a['b'] // => "b" + * a[`b`] // => "b" + * a[100] // => "100" + * a[b] // => null + * a["a" + "b"] // => null + * a[tag`b`] // => null + * a[`${b}`] // => null + * + * let a = {b: 1} // => "b" + * let a = {["b"]: 1} // => "b" + * let a = {['b']: 1} // => "b" + * let a = {[`b`]: 1} // => "b" + * let a = {[100]: 1} // => "100" + * let a = {[b]: 1} // => null + * let a = {["a" + "b"]: 1} // => null + * let a = {[tag`b`]: 1} // => null + * let a = {[`${b}`]: 1} // => null + * @param {ASTNode} node The node to get. + * @returns {string|null} The property name if static. Otherwise, null. + */ +function getStaticPropertyName(node) { + let prop; + + switch (node && node.type) { + case "ChainExpression": + return getStaticPropertyName(node.expression); + + case "Property": + case "PropertyDefinition": + case "MethodDefinition": + prop = node.key; + break; + + case "MemberExpression": + prop = node.property; + break; + + // no default + } + + if (prop) { + if (prop.type === "Identifier" && !node.computed) { + return prop.name; + } + + return getStaticStringValue(prop); + } + + return null; +} + +/** + * Retrieve `ChainExpression#expression` value if the given node a `ChainExpression` node. Otherwise, pass through it. + * @param {ASTNode} node The node to address. + * @returns {ASTNode} The `ChainExpression#expression` value if the node is a `ChainExpression` node. Otherwise, the node. + */ +function skipChainExpression(node) { + return node && node.type === "ChainExpression" ? node.expression : node; +} + +/** + * Check if the `actual` is an expected value. + * @param {string} actual The string value to check. + * @param {string | RegExp} expected The expected string value or pattern. + * @returns {boolean} `true` if the `actual` is an expected value. + */ +function checkText(actual, expected) { + return typeof expected === "string" + ? actual === expected + : expected.test(actual); +} + +/** + * Check if a given node is an Identifier node with a given name. + * @param {ASTNode} node The node to check. + * @param {string | RegExp} name The expected name or the expected pattern of the object name. + * @returns {boolean} `true` if the node is an Identifier node with the name. + */ +function isSpecificId(node, name) { + return node.type === "Identifier" && checkText(node.name, name); +} + +/** + * Check if a given node is member access with a given object name and property name pair. + * This is regardless of optional or not. + * @param {ASTNode} node The node to check. + * @param {string | RegExp | null} objectName The expected name or the expected pattern of the object name. If this is nullish, this method doesn't check object. + * @param {string | RegExp | null} propertyName The expected name or the expected pattern of the property name. If this is nullish, this method doesn't check property. + * @returns {boolean} `true` if the node is member access with the object name and property name pair. + * The node is a `MemberExpression` or `ChainExpression`. + */ +function isSpecificMemberAccess(node, objectName, propertyName) { + const checkNode = skipChainExpression(node); + + if (checkNode.type !== "MemberExpression") { + return false; + } + + if (objectName && !isSpecificId(checkNode.object, objectName)) { + return false; + } + + if (propertyName) { + const actualPropertyName = getStaticPropertyName(checkNode); + + if (typeof actualPropertyName !== "string" || !checkText(actualPropertyName, propertyName)) { + return false; + } + } + + return true; +} + +/** + * Check if two literal nodes are the same value. + * @param {ASTNode} left The Literal node to compare. + * @param {ASTNode} right The other Literal node to compare. + * @returns {boolean} `true` if the two literal nodes are the same value. + */ +function equalLiteralValue(left, right) { + + // RegExp literal. + if (left.regex || right.regex) { + return Boolean( + left.regex && + right.regex && + left.regex.pattern === right.regex.pattern && + left.regex.flags === right.regex.flags + ); + } + + // BigInt literal. + if (left.bigint || right.bigint) { + return left.bigint === right.bigint; + } + + return left.value === right.value; +} + +/** + * Check if two expressions reference the same value. For example: + * a = a + * a.b = a.b + * a[0] = a[0] + * a['b'] = a['b'] + * @param {ASTNode} left The left side of the comparison. + * @param {ASTNode} right The right side of the comparison. + * @param {boolean} [disableStaticComputedKey] Don't address `a.b` and `a["b"]` are the same if `true`. For backward compatibility. + * @returns {boolean} `true` if both sides match and reference the same value. + */ +function isSameReference(left, right, disableStaticComputedKey = false) { + if (left.type !== right.type) { + + // Handle `a.b` and `a?.b` are samely. + if (left.type === "ChainExpression") { + return isSameReference(left.expression, right, disableStaticComputedKey); + } + if (right.type === "ChainExpression") { + return isSameReference(left, right.expression, disableStaticComputedKey); + } + + return false; + } + + switch (left.type) { + case "Super": + case "ThisExpression": + return true; + + case "Identifier": + case "PrivateIdentifier": + return left.name === right.name; + case "Literal": + return equalLiteralValue(left, right); + + case "ChainExpression": + return isSameReference(left.expression, right.expression, disableStaticComputedKey); + + case "MemberExpression": { + if (!disableStaticComputedKey) { + const nameA = getStaticPropertyName(left); + + // x.y = x["y"] + if (nameA !== null) { + return ( + isSameReference(left.object, right.object, disableStaticComputedKey) && + nameA === getStaticPropertyName(right) + ); + } + } + + /* + * x[0] = x[0] + * x[y] = x[y] + * x.y = x.y + */ + return ( + left.computed === right.computed && + isSameReference(left.object, right.object, disableStaticComputedKey) && + isSameReference(left.property, right.property, disableStaticComputedKey) + ); + } + + default: + return false; + } +} + +/** + * Checks whether or not a node is `Reflect.apply`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `Reflect.apply`. + */ +function isReflectApply(node) { + return isSpecificMemberAccess(node, "Reflect", "apply"); +} + +/** + * Checks whether or not a node is `Array.from`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `Array.from`. + */ +function isArrayFromMethod(node) { + return isSpecificMemberAccess(node, arrayOrTypedArrayPattern, "from"); +} + +/** + * Checks whether or not a node is a method which expects a function as a first argument, and `thisArg` as a second argument. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a method which expects a function as a first argument, and `thisArg` as a second argument. + */ +function isMethodWhichHasThisArg(node) { + return isSpecificMemberAccess(node, null, arrayMethodWithThisArgPattern); +} + +/** + * Creates the negate function of the given function. + * @param {Function} f The function to negate. + * @returns {Function} Negated function. + */ +function negate(f) { + return token => !f(token); +} + +/** + * Checks whether or not a node has a `@this` tag in its comments. + * @param {ASTNode} node A node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. + * @returns {boolean} Whether or not the node has a `@this` tag in its comments. + */ +function hasJSDocThisTag(node, sourceCode) { + const jsdocComment = sourceCode.getJSDocComment(node); + + if (jsdocComment && thisTagPattern.test(jsdocComment.value)) { + return true; + } + + // Checks `@this` in its leading comments for callbacks, + // because callbacks don't have its JSDoc comment. + // e.g. + // sinon.test(/* @this sinon.Sandbox */function() { this.spy(); }); + return sourceCode.getCommentsBefore(node).some(comment => thisTagPattern.test(comment.value)); +} + +/** + * Determines if a node is surrounded by parentheses. + * @param {SourceCode} sourceCode The ESLint source code object + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ +function isParenthesised(sourceCode, node) { + const previousToken = sourceCode.getTokenBefore(node), + nextToken = sourceCode.getTokenAfter(node); + + return Boolean(previousToken && nextToken) && + previousToken.value === "(" && previousToken.range[1] <= node.range[0] && + nextToken.value === ")" && nextToken.range[0] >= node.range[1]; +} + +/** + * Checks if the given token is a `=` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `=` token. + */ +function isEqToken(token) { + return token.value === "=" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an arrow token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an arrow token. + */ +function isArrowToken(token) { + return token.value === "=>" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a comma token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a comma token. + */ +function isCommaToken(token) { + return token.value === "," && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a dot token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a dot token. + */ +function isDotToken(token) { + return token.value === "." && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a `?.` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `?.` token. + */ +function isQuestionDotToken(token) { + return token.value === "?." && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a semicolon token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a semicolon token. + */ +function isSemicolonToken(token) { + return token.value === ";" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a colon token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a colon token. + */ +function isColonToken(token) { + return token.value === ":" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening parenthesis token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening parenthesis token. + */ +function isOpeningParenToken(token) { + return token.value === "(" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing parenthesis token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing parenthesis token. + */ +function isClosingParenToken(token) { + return token.value === ")" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening square bracket token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening square bracket token. + */ +function isOpeningBracketToken(token) { + return token.value === "[" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing square bracket token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing square bracket token. + */ +function isClosingBracketToken(token) { + return token.value === "]" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening brace token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening brace token. + */ +function isOpeningBraceToken(token) { + return token.value === "{" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing brace token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing brace token. + */ +function isClosingBraceToken(token) { + return token.value === "}" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a comment token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +function isCommentToken(token) { + return token.type === "Line" || token.type === "Block" || token.type === "Shebang"; +} + +/** + * Checks if the given token is a keyword token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a keyword token. + */ +function isKeywordToken(token) { + return token.type === "Keyword"; +} + +/** + * Gets the `(` token of the given function node. + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token} `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + + // If the node is an arrow function and doesn't have parens, this returns the identifier of the first param. + if (node.type === "ArrowFunctionExpression" && node.params.length === 1) { + const argToken = sourceCode.getFirstToken(node.params[0]); + const maybeParenToken = sourceCode.getTokenBefore(argToken); + + return isOpeningParenToken(maybeParenToken) ? maybeParenToken : argToken; + } + + // Otherwise, returns paren. + return node.id + ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) + : sourceCode.getFirstToken(node, isOpeningParenToken); +} + +/** + * Checks whether or not the tokens of two given nodes are same. + * @param {ASTNode} left A node 1 to compare. + * @param {ASTNode} right A node 2 to compare. + * @param {SourceCode} sourceCode The ESLint source code object. + * @returns {boolean} the source code for the given node. + */ +function equalTokens(left, right, sourceCode) { + const tokensL = sourceCode.getTokens(left); + const tokensR = sourceCode.getTokens(right); + + if (tokensL.length !== tokensR.length) { + return false; + } + for (let i = 0; i < tokensL.length; ++i) { + if (tokensL[i].type !== tokensR[i].type || + tokensL[i].value !== tokensR[i].value + ) { + return false; + } + } + + return true; +} + +/** + * Check if the given node is a true logical expression or not. + * + * The three binary expressions logical-or (`||`), logical-and (`&&`), and + * coalesce (`??`) are known as `ShortCircuitExpression`. + * But ESTree represents those by `LogicalExpression` node. + * + * This function rejects coalesce expressions of `LogicalExpression` node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `&&` or `||`. + * @see https://tc39.es/ecma262/#prod-ShortCircuitExpression + */ +function isLogicalExpression(node) { + return ( + node.type === "LogicalExpression" && + (node.operator === "&&" || node.operator === "||") + ); +} + +/** + * Check if the given node is a nullish coalescing expression or not. + * + * The three binary expressions logical-or (`||`), logical-and (`&&`), and + * coalesce (`??`) are known as `ShortCircuitExpression`. + * But ESTree represents those by `LogicalExpression` node. + * + * This function finds only coalesce expressions of `LogicalExpression` node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `??`. + */ +function isCoalesceExpression(node) { + return node.type === "LogicalExpression" && node.operator === "??"; +} + +/** + * Check if given two nodes are the pair of a logical expression and a coalesce expression. + * @param {ASTNode} left A node to check. + * @param {ASTNode} right Another node to check. + * @returns {boolean} `true` if the two nodes are the pair of a logical expression and a coalesce expression. + */ +function isMixedLogicalAndCoalesceExpressions(left, right) { + return ( + (isLogicalExpression(left) && isCoalesceExpression(right)) || + (isCoalesceExpression(left) && isLogicalExpression(right)) + ); +} + +/** + * Checks if the given operator is a logical assignment operator. + * @param {string} operator The operator to check. + * @returns {boolean} `true` if the operator is a logical assignment operator. + */ +function isLogicalAssignmentOperator(operator) { + return LOGICAL_ASSIGNMENT_OPERATORS.has(operator); +} + +/** + * Get the colon token of the given SwitchCase node. + * @param {ASTNode} node The SwitchCase node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token} The colon token of the node. + */ +function getSwitchCaseColonToken(node, sourceCode) { + if (node.test) { + return sourceCode.getTokenAfter(node.test, isColonToken); + } + return sourceCode.getFirstToken(node, 1); +} + +/** + * Gets ESM module export name represented by the given node. + * @param {ASTNode} node `Identifier` or string `Literal` node in a position + * that represents a module export name: + * - `ImportSpecifier#imported` + * - `ExportSpecifier#local` (if it is a re-export from another module) + * - `ExportSpecifier#exported` + * - `ExportAllDeclaration#exported` + * @returns {string} The module export name. + */ +function getModuleExportName(node) { + if (node.type === "Identifier") { + return node.name; + } + + // string literal + return node.value; +} + +/** + * Returns literal's value converted to the Boolean type + * @param {ASTNode} node any `Literal` node + * @returns {boolean | null} `true` when node is truthy, `false` when node is falsy, + * `null` when it cannot be determined. + */ +function getBooleanValue(node) { + if (node.value === null) { + + /* + * it might be a null literal or bigint/regex literal in unsupported environments . + * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#regexpliteral + * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es2020.md#bigintliteral + */ + + if (node.raw === "null") { + return false; + } + + // regex is always truthy + if (typeof node.regex === "object") { + return true; + } + + return null; + } + + return !!node.value; +} + +/** + * Checks if a branch node of LogicalExpression short circuits the whole condition + * @param {ASTNode} node The branch of main condition which needs to be checked + * @param {string} operator The operator of the main LogicalExpression. + * @returns {boolean} true when condition short circuits whole condition + */ +function isLogicalIdentity(node, operator) { + switch (node.type) { + case "Literal": + return (operator === "||" && getBooleanValue(node) === true) || + (operator === "&&" && getBooleanValue(node) === false); + + case "UnaryExpression": + return (operator === "&&" && node.operator === "void"); + + case "LogicalExpression": + + /* + * handles `a && false || b` + * `false` is an identity element of `&&` but not `||` + */ + return operator === node.operator && + ( + isLogicalIdentity(node.left, operator) || + isLogicalIdentity(node.right, operator) + ); + + case "AssignmentExpression": + return ["||=", "&&="].includes(node.operator) && + operator === node.operator.slice(0, -1) && + isLogicalIdentity(node.right, operator); + + // no default + } + return false; +} + +/** + * Checks if an identifier is a reference to a global variable. + * @param {Scope} scope The scope in which the identifier is referenced. + * @param {ASTNode} node An identifier node to check. + * @returns {boolean} `true` if the identifier is a reference to a global variable. + */ +function isReferenceToGlobalVariable(scope, node) { + const reference = scope.references.find(ref => ref.identifier === node); + + return Boolean( + reference && + reference.resolved && + reference.resolved.scope.type === "global" && + reference.resolved.defs.length === 0 + ); +} + + +/** + * Checks if a node has a constant truthiness value. + * @param {Scope} scope Scope in which the node appears. + * @param {ASTNode} node The AST node to check. + * @param {boolean} inBooleanPosition `true` if checking the test of a + * condition. `false` in all other cases. When `false`, checks if -- for + * both string and number -- if coerced to that type, the value will + * be constant. + * @returns {boolean} true when node's truthiness is constant + * @private + */ +function isConstant(scope, node, inBooleanPosition) { + + // node.elements can return null values in the case of sparse arrays ex. [,] + if (!node) { + return true; + } + switch (node.type) { + case "Literal": + case "ArrowFunctionExpression": + case "FunctionExpression": + return true; + case "ClassExpression": + case "ObjectExpression": + + /** + * In theory objects like: + * + * `{toString: () => a}` + * `{valueOf: () => a}` + * + * Or a classes like: + * + * `class { static toString() { return a } }` + * `class { static valueOf() { return a } }` + * + * Are not constant verifiably when `inBooleanPosition` is + * false, but it's an edge case we've opted not to handle. + */ + return true; + case "TemplateLiteral": + return (inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length)) || + node.expressions.every(exp => isConstant(scope, exp, false)); + + case "ArrayExpression": { + if (!inBooleanPosition) { + return node.elements.every(element => isConstant(scope, element, false)); + } + return true; + } + + case "UnaryExpression": + if ( + node.operator === "void" || + node.operator === "typeof" && inBooleanPosition + ) { + return true; + } + + if (node.operator === "!") { + return isConstant(scope, node.argument, true); + } + + return isConstant(scope, node.argument, false); + + case "BinaryExpression": + return isConstant(scope, node.left, false) && + isConstant(scope, node.right, false) && + node.operator !== "in"; + + case "LogicalExpression": { + const isLeftConstant = isConstant(scope, node.left, inBooleanPosition); + const isRightConstant = isConstant(scope, node.right, inBooleanPosition); + const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator)); + const isRightShortCircuit = (inBooleanPosition && isRightConstant && isLogicalIdentity(node.right, node.operator)); + + return (isLeftConstant && isRightConstant) || + isLeftShortCircuit || + isRightShortCircuit; + } + case "NewExpression": + return inBooleanPosition; + case "AssignmentExpression": + if (node.operator === "=") { + return isConstant(scope, node.right, inBooleanPosition); + } + + if (["||=", "&&="].includes(node.operator) && inBooleanPosition) { + return isLogicalIdentity(node.right, node.operator.slice(0, -1)); + } + + return false; + + case "SequenceExpression": + return isConstant(scope, node.expressions.at(-1), inBooleanPosition); + case "SpreadElement": + return isConstant(scope, node.argument, inBooleanPosition); + case "CallExpression": + if (node.callee.type === "Identifier" && node.callee.name === "Boolean") { + if (node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)) { + return isReferenceToGlobalVariable(scope, node.callee); + } + } + return false; + case "Identifier": + return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + + // no default + } + return false; +} + +/** + * Checks whether a node is an ExpressionStatement at the top level of a file or function body. + * A top-level ExpressionStatement node is a directive if it contains a single unparenthesized + * string literal and if it occurs either as the first sibling or immediately after another + * directive. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an ExpressionStatement at the top level of a + * file or function body. + */ +function isTopLevelExpressionStatement(node) { + if (node.type !== "ExpressionStatement") { + return false; + } + const parent = node.parent; + + return parent.type === "Program" || (parent.type === "BlockStatement" && isFunction(parent.parent)); + +} + +/** + * Check whether the given node is a part of a directive prologue or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a part of directive prologue. + */ +function isDirective(node) { + return node.type === "ExpressionStatement" && typeof node.directive === "string"; +} + +/** + * Tests if a node appears at the beginning of an ancestor ExpressionStatement node. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether the node appears at the beginning of an ancestor ExpressionStatement node. + */ +function isStartOfExpressionStatement(node) { + const start = node.range[0]; + let ancestor = node; + + while ((ancestor = ancestor.parent) && ancestor.range[0] === start) { + if (ancestor.type === "ExpressionStatement") { + return true; + } + } + return false; +} + +/** + * Determines whether an opening parenthesis `(`, bracket `[` or backtick ``` ` ``` needs to be preceded by a semicolon. + * This opening parenthesis or bracket should be at the start of an `ExpressionStatement`, a `MethodDefinition` or at + * the start of the body of an `ArrowFunctionExpression`. + * @type {(sourceCode: SourceCode, node: ASTNode) => boolean} + * @param {SourceCode} sourceCode The source code object. + * @param {ASTNode} node A node at the position where an opening parenthesis or bracket will be inserted. + * @returns {boolean} Whether a semicolon is required before the opening parenthesis or bracket. + */ +let needsPrecedingSemicolon; + +{ + const BREAK_OR_CONTINUE = new Set(["BreakStatement", "ContinueStatement"]); + + // Declaration types that cannot be continued by a punctuator when ending with a string Literal that is a direct child. + const DECLARATIONS = new Set(["ExportAllDeclaration", "ExportNamedDeclaration", "ImportDeclaration"]); + + const IDENTIFIER_OR_KEYWORD = new Set(["Identifier", "Keyword"]); + + // Keywords that can immediately precede an ExpressionStatement node, mapped to the their node types. + const NODE_TYPES_BY_KEYWORD = { + __proto__: null, + break: "BreakStatement", + continue: "ContinueStatement", + debugger: "DebuggerStatement", + do: "DoWhileStatement", + else: "IfStatement", + return: "ReturnStatement", + yield: "YieldExpression" + }; + + /* + * Before an opening parenthesis, postfix `++` and `--` always trigger ASI; + * the tokens `:`, `;`, `{` and `=>` don't expect a semicolon, as that would count as an empty statement. + */ + const PUNCTUATORS = new Set([":", ";", "{", "=>", "++", "--"]); + + /* + * Statements that can contain an `ExpressionStatement` after a closing parenthesis. + * DoWhileStatement is an exception in that it always triggers ASI after the closing parenthesis. + */ + const STATEMENTS = new Set([ + "DoWhileStatement", + "ForInStatement", + "ForOfStatement", + "ForStatement", + "IfStatement", + "WhileStatement", + "WithStatement" + ]); + + needsPrecedingSemicolon = + function(sourceCode, node) { + const prevToken = sourceCode.getTokenBefore(node); + + if (!prevToken || prevToken.type === "Punctuator" && PUNCTUATORS.has(prevToken.value)) { + return false; + } + + const prevNode = sourceCode.getNodeByRangeIndex(prevToken.range[0]); + + if (isClosingParenToken(prevToken)) { + return !STATEMENTS.has(prevNode.type); + } + + if (isClosingBraceToken(prevToken)) { + return ( + prevNode.type === "BlockStatement" && prevNode.parent.type === "FunctionExpression" && prevNode.parent.parent.type !== "MethodDefinition" || + prevNode.type === "ClassBody" && prevNode.parent.type === "ClassExpression" || + prevNode.type === "ObjectExpression" + ); + } + + if (IDENTIFIER_OR_KEYWORD.has(prevToken.type)) { + if (BREAK_OR_CONTINUE.has(prevNode.parent.type)) { + return false; + } + + const keyword = prevToken.value; + const nodeType = NODE_TYPES_BY_KEYWORD[keyword]; + + return prevNode.type !== nodeType; + } + + if (prevToken.type === "String") { + return !DECLARATIONS.has(prevNode.parent.type); + } + + return true; + }; +} + +/** + * Checks if a node is used as an import attribute key, either in a static or dynamic import. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether the node is used as an import attribute key. + */ +function isImportAttributeKey(node) { + const { parent } = node; + + // static import/re-export + if (parent.type === "ImportAttribute" && parent.key === node) { + return true; + } + + // dynamic import + if ( + parent.type === "Property" && + !parent.computed && + (parent.key === node || parent.value === node && parent.shorthand && !parent.method) && + parent.parent.type === "ObjectExpression" + ) { + const objectExpression = parent.parent; + const objectExpressionParent = objectExpression.parent; + + if ( + objectExpressionParent.type === "ImportExpression" && + objectExpressionParent.options === objectExpression + ) { + return true; + } + + // nested key + if ( + objectExpressionParent.type === "Property" && + objectExpressionParent.value === objectExpression + ) { + return isImportAttributeKey(objectExpressionParent.key); + } + } + + return false; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + COMMENTS_IGNORE_PATTERN, + LINEBREAKS, + LINEBREAK_MATCHER: lineBreakPattern, + SHEBANG_MATCHER: shebangPattern, + STATEMENT_LIST_PARENTS, + ECMASCRIPT_GLOBALS, + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left The left token object. + * @param {Object} right The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + * @public + */ + isTokenOnSameLine(left, right) { + return left.loc.end.line === right.loc.start.line; + }, + + isNullOrUndefined, + isCallee, + isES5Constructor, + getUpperFunction, + isFunction, + isLoop, + isInLoop, + isArrayFromMethod, + isParenthesised, + createGlobalLinebreakMatcher, + equalTokens, + + isArrowToken, + isClosingBraceToken, + isClosingBracketToken, + isClosingParenToken, + isColonToken, + isCommaToken, + isCommentToken, + isDotToken, + isQuestionDotToken, + isKeywordToken, + isNotClosingBraceToken: negate(isClosingBraceToken), + isNotClosingBracketToken: negate(isClosingBracketToken), + isNotClosingParenToken: negate(isClosingParenToken), + isNotColonToken: negate(isColonToken), + isNotCommaToken: negate(isCommaToken), + isNotDotToken: negate(isDotToken), + isNotQuestionDotToken: negate(isQuestionDotToken), + isNotOpeningBraceToken: negate(isOpeningBraceToken), + isNotOpeningBracketToken: negate(isOpeningBracketToken), + isNotOpeningParenToken: negate(isOpeningParenToken), + isNotSemicolonToken: negate(isSemicolonToken), + isOpeningBraceToken, + isOpeningBracketToken, + isOpeningParenToken, + isSemicolonToken, + isEqToken, + + /** + * Checks whether or not a given node is a string literal. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a string literal. + */ + isStringLiteral(node) { + return ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ); + }, + + /** + * Checks whether a given node is a breakable statement or not. + * The node is breakable if the node is one of the following type: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - SwitchStatement + * - WhileStatement + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is breakable. + */ + isBreakableStatement(node) { + return breakableTypePattern.test(node.type); + }, + + /** + * Gets references which are non initializer and writable. + * @param {Reference[]} references An array of references. + * @returns {Reference[]} An array of only references which are non initializer and writable. + * @public + */ + getModifyingReferences(references) { + return references.filter(isModifyingReference); + }, + + /** + * Validate that a string passed in is surrounded by the specified character + * @param {string} val The text to check. + * @param {string} character The character to see if it's surrounded by. + * @returns {boolean} True if the text is surrounded by the character, false if not. + * @private + */ + isSurroundedBy(val, character) { + return val[0] === character && val.at(-1) === character; + }, + + /** + * Returns whether the provided node is an ESLint directive comment or not + * @param {Line|Block} node The comment token to be checked + * @returns {boolean} `true` if the node is an ESLint directive comment + */ + isDirectiveComment(node) { + const comment = node.value.trim(); + + return ( + node.type === "Line" && comment.startsWith("eslint-") || + node.type === "Block" && ESLINT_DIRECTIVE_PATTERN.test(comment) + ); + }, + + /** + * Gets the trailing statement of a given node. + * + * if (code) + * consequent; + * + * When taking this `IfStatement`, returns `consequent;` statement. + * @param {ASTNode} A node to get. + * @returns {ASTNode|null} The trailing statement's node. + */ + getTrailingStatement: esutils.ast.trailingStatement, + + /** + * Finds the variable by a given name in a given scope and its upper scopes. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @param {string} name A variable name to find. + * @returns {eslint-scope.Variable|null} A found variable or `null`. + */ + getVariableByName(initScope, name) { + let scope = initScope; + + while (scope) { + const variable = scope.set.get(name); + + if (variable) { + return variable; + } + + scope = scope.upper; + } + + return null; + }, + + /** + * Checks whether or not a given function node is the default `this` binding. + * + * First, this checks the node: + * + * - The given node is not in `PropertyDefinition#value` position. + * - The given node is not `StaticBlock`. + * - The function name does not start with uppercase. It's a convention to capitalize the names + * of constructor functions. This check is not performed if `capIsConstructor` is set to `false`. + * - The function does not have a JSDoc comment that has a @this tag. + * + * Next, this checks the location of the node. + * If the location is below, this judges `this` is valid. + * + * - The location is not on an object literal. + * - The location is not assigned to a variable which starts with an uppercase letter. Applies to anonymous + * functions only, as the name of the variable is considered to be the name of the function in this case. + * This check is not performed if `capIsConstructor` is set to `false`. + * - The location is not on an ES2015 class. + * - Its `bind`/`call`/`apply` method is not called directly. + * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given. + * @param {ASTNode} node A function node to check. It also can be an implicit function, like `StaticBlock` + * or any expression that is `PropertyDefinition#value` node. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. + * @param {boolean} [capIsConstructor = true] `false` disables the assumption that functions which name starts + * with an uppercase or are assigned to a variable which name starts with an uppercase are constructors. + * @returns {boolean} The function node is the default `this` binding. + */ + isDefaultThisBinding(node, sourceCode, { capIsConstructor = true } = {}) { + + /* + * Class field initializers are implicit functions, but ESTree doesn't have the AST node of field initializers. + * Therefore, A expression node at `PropertyDefinition#value` is a function. + * In this case, `this` is always not default binding. + */ + if (node.parent.type === "PropertyDefinition" && node.parent.value === node) { + return false; + } + + // Class static blocks are implicit functions. In this case, `this` is always not default binding. + if (node.type === "StaticBlock") { + return false; + } + + if ( + (capIsConstructor && isES5Constructor(node)) || + hasJSDocThisTag(node, sourceCode) + ) { + return false; + } + const isAnonymous = node.id === null; + let currentNode = node; + + while (currentNode) { + const parent = currentNode.parent; + + switch (parent.type) { + + /* + * Looks up the destination. + * e.g., obj.foo = nativeFoo || function foo() { ... }; + */ + case "LogicalExpression": + case "ConditionalExpression": + case "ChainExpression": + currentNode = parent; + break; + + /* + * If the upper function is IIFE, checks the destination of the return value. + * e.g. + * obj.foo = (function() { + * // setup... + * return function foo() { ... }; + * })(); + * obj.foo = (() => + * function foo() { ... } + * )(); + */ + case "ReturnStatement": { + const func = getUpperFunction(parent); + + if (func === null || !isCallee(func)) { + return true; + } + currentNode = func.parent; + break; + } + case "ArrowFunctionExpression": + if (currentNode !== parent.body || !isCallee(parent)) { + return true; + } + currentNode = parent.parent; + break; + + /* + * e.g. + * var obj = { foo() { ... } }; + * var obj = { foo: function() { ... } }; + * class A { constructor() { ... } } + * class A { foo() { ... } } + * class A { get foo() { ... } } + * class A { set foo() { ... } } + * class A { static foo() { ... } } + * class A { foo = function() { ... } } + */ + case "Property": + case "PropertyDefinition": + case "MethodDefinition": + return parent.value !== currentNode; + + /* + * e.g. + * obj.foo = function foo() { ... }; + * Foo = function() { ... }; + * [obj.foo = function foo() { ... }] = a; + * [Foo = function() { ... }] = a; + */ + case "AssignmentExpression": + case "AssignmentPattern": + if (parent.left.type === "MemberExpression") { + return false; + } + if ( + capIsConstructor && + isAnonymous && + parent.left.type === "Identifier" && + startsWithUpperCase(parent.left.name) + ) { + return false; + } + return true; + + /* + * e.g. + * var Foo = function() { ... }; + */ + case "VariableDeclarator": + return !( + capIsConstructor && + isAnonymous && + parent.init === currentNode && + parent.id.type === "Identifier" && + startsWithUpperCase(parent.id.name) + ); + + /* + * e.g. + * var foo = function foo() { ... }.bind(obj); + * (function foo() { ... }).call(obj); + * (function foo() { ... }).apply(obj, []); + */ + case "MemberExpression": + if ( + parent.object === currentNode && + isSpecificMemberAccess(parent, null, bindOrCallOrApplyPattern) + ) { + const maybeCalleeNode = parent.parent.type === "ChainExpression" + ? parent.parent + : parent; + + return !( + isCallee(maybeCalleeNode) && + maybeCalleeNode.parent.arguments.length >= 1 && + !isNullOrUndefined(maybeCalleeNode.parent.arguments[0]) + ); + } + return true; + + /* + * e.g. + * Reflect.apply(function() {}, obj, []); + * Array.from([], function() {}, obj); + * list.forEach(function() {}, obj); + */ + case "CallExpression": + if (isReflectApply(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[0] !== currentNode || + isNullOrUndefined(parent.arguments[1]) + ); + } + if (isArrayFromMethod(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[1] !== currentNode || + isNullOrUndefined(parent.arguments[2]) + ); + } + if (isMethodWhichHasThisArg(parent.callee)) { + return ( + parent.arguments.length !== 2 || + parent.arguments[0] !== currentNode || + isNullOrUndefined(parent.arguments[1]) + ); + } + return true; + + // Otherwise `this` is default. + default: + return true; + } + } + + /* c8 ignore next */ + return true; + }, + + /** + * Get the precedence level based on the node type + * @param {ASTNode} node node to evaluate + * @returns {int} precedence level + * @private + */ + getPrecedence(node) { + switch (node.type) { + case "SequenceExpression": + return 0; + + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "YieldExpression": + return 1; + + case "ConditionalExpression": + return 3; + + case "LogicalExpression": + switch (node.operator) { + case "||": + case "??": + return 4; + case "&&": + return 5; + + // no default + } + + /* falls through */ + + case "BinaryExpression": + + switch (node.operator) { + case "|": + return 6; + case "^": + return 7; + case "&": + return 8; + case "==": + case "!=": + case "===": + case "!==": + return 9; + case "<": + case "<=": + case ">": + case ">=": + case "in": + case "instanceof": + return 10; + case "<<": + case ">>": + case ">>>": + return 11; + case "+": + case "-": + return 12; + case "*": + case "/": + case "%": + return 13; + case "**": + return 15; + + // no default + } + + /* falls through */ + + case "UnaryExpression": + case "AwaitExpression": + return 16; + + case "UpdateExpression": + return 17; + + case "CallExpression": + case "ChainExpression": + case "ImportExpression": + return 18; + + case "NewExpression": + return 19; + + default: + if (node.type in eslintVisitorKeys) { + return 20; + } + + /* + * if the node is not a standard node that we know about, then assume it has the lowest precedence + * this will mean that rules will wrap unknown nodes in parentheses where applicable instead of + * unwrapping them and potentially changing the meaning of the code or introducing a syntax error. + */ + return -1; + } + }, + + /** + * Checks whether the given node is an empty block node or not. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is an empty block. + */ + isEmptyBlock(node) { + return Boolean(node && node.type === "BlockStatement" && node.body.length === 0); + }, + + /** + * Checks whether the given node is an empty function node or not. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is an empty function. + */ + isEmptyFunction(node) { + return isFunction(node) && module.exports.isEmptyBlock(node.body); + }, + + /** + * Get directives from directive prologue of a Program or Function node. + * @param {ASTNode} node The node to check. + * @returns {ASTNode[]} The directives found in the directive prologue. + */ + getDirectivePrologue(node) { + const directives = []; + + // Directive prologues only occur at the top of files or functions. + if ( + node.type === "Program" || + node.type === "FunctionDeclaration" || + node.type === "FunctionExpression" || + + /* + * Do not check arrow functions with implicit return. + * `() => "use strict";` returns the string `"use strict"`. + */ + (node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement") + ) { + const statements = node.type === "Program" ? node.body : node.body.body; + + for (const statement of statements) { + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" + ) { + directives.push(statement); + } else { + break; + } + } + } + + return directives; + }, + + /** + * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added + * after the node will be parsed as a decimal point, rather than a property-access dot. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if this node is a decimal integer. + * @example + * + * 0 // true + * 5 // true + * 50 // true + * 5_000 // true + * 1_234_56 // true + * 08 // true + * 0192 // true + * 5. // false + * .5 // false + * 5.0 // false + * 5.00_00 // false + * 05 // false + * 0x5 // false + * 0b101 // false + * 0b11_01 // false + * 0o5 // false + * 5e0 // false + * 5e1_000 // false + * 5n // false + * 1_000n // false + * "5" // false + * + */ + isDecimalInteger(node) { + return node.type === "Literal" && typeof node.value === "number" && + DECIMAL_INTEGER_PATTERN.test(node.raw); + }, + + /** + * Determines whether this token is a decimal integer numeric token. + * This is similar to isDecimalInteger(), but for tokens. + * @param {Token} token The token to check. + * @returns {boolean} `true` if this token is a decimal integer. + */ + isDecimalIntegerNumericToken(token) { + return token.type === "Numeric" && DECIMAL_INTEGER_PATTERN.test(token.value); + }, + + /** + * Gets the name and kind of the given function node. + * + * - `function foo() {}` .................... `function 'foo'` + * - `(function foo() {})` .................. `function 'foo'` + * - `(function() {})` ...................... `function` + * - `function* foo() {}` ................... `generator function 'foo'` + * - `(function* foo() {})` ................. `generator function 'foo'` + * - `(function*() {})` ..................... `generator function` + * - `() => {}` ............................. `arrow function` + * - `async () => {}` ....................... `async arrow function` + * - `({ foo: function foo() {} })` ......... `method 'foo'` + * - `({ foo: function() {} })` ............. `method 'foo'` + * - `({ ['foo']: function() {} })` ......... `method 'foo'` + * - `({ [foo]: function() {} })` ........... `method` + * - `({ foo() {} })` ....................... `method 'foo'` + * - `({ foo: function* foo() {} })` ........ `generator method 'foo'` + * - `({ foo: function*() {} })` ............ `generator method 'foo'` + * - `({ ['foo']: function*() {} })` ........ `generator method 'foo'` + * - `({ [foo]: function*() {} })` .......... `generator method` + * - `({ *foo() {} })` ...................... `generator method 'foo'` + * - `({ foo: async function foo() {} })` ... `async method 'foo'` + * - `({ foo: async function() {} })` ....... `async method 'foo'` + * - `({ ['foo']: async function() {} })` ... `async method 'foo'` + * - `({ [foo]: async function() {} })` ..... `async method` + * - `({ async foo() {} })` ................. `async method 'foo'` + * - `({ get foo() {} })` ................... `getter 'foo'` + * - `({ set foo(a) {} })` .................. `setter 'foo'` + * - `class A { constructor() {} }` ......... `constructor` + * - `class A { foo() {} }` ................. `method 'foo'` + * - `class A { *foo() {} }` ................ `generator method 'foo'` + * - `class A { async foo() {} }` ........... `async method 'foo'` + * - `class A { ['foo']() {} }` ............. `method 'foo'` + * - `class A { *['foo']() {} }` ............ `generator method 'foo'` + * - `class A { async ['foo']() {} }` ....... `async method 'foo'` + * - `class A { [foo]() {} }` ............... `method` + * - `class A { *[foo]() {} }` .............. `generator method` + * - `class A { async [foo]() {} }` ......... `async method` + * - `class A { get foo() {} }` ............. `getter 'foo'` + * - `class A { set foo(a) {} }` ............ `setter 'foo'` + * - `class A { static foo() {} }` .......... `static method 'foo'` + * - `class A { static *foo() {} }` ......... `static generator method 'foo'` + * - `class A { static async foo() {} }` .... `static async method 'foo'` + * - `class A { static get foo() {} }` ...... `static getter 'foo'` + * - `class A { static set foo(a) {} }` ..... `static setter 'foo'` + * - `class A { foo = () => {}; }` .......... `method 'foo'` + * - `class A { foo = function() {}; }` ..... `method 'foo'` + * - `class A { foo = function bar() {}; }` . `method 'foo'` + * - `class A { static foo = () => {}; }` ... `static method 'foo'` + * - `class A { '#foo' = () => {}; }` ....... `method '#foo'` + * - `class A { #foo = () => {}; }` ......... `private method #foo` + * - `class A { static #foo = () => {}; }` .. `static private method #foo` + * - `class A { '#foo'() {} }` .............. `method '#foo'` + * - `class A { #foo() {} }` ................ `private method #foo` + * - `class A { static #foo() {} }` ......... `static private method #foo` + * @param {ASTNode} node The function node to get. + * @returns {string} The name and kind of the function node. + */ + getFunctionNameWithKind(node) { + const parent = node.parent; + const tokens = []; + + if (parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { + + // The proposal uses `static` word consistently before visibility words: https://github.com/tc39/proposal-static-class-features + if (parent.static) { + tokens.push("static"); + } + if (!parent.computed && parent.key.type === "PrivateIdentifier") { + tokens.push("private"); + } + } + if (node.async) { + tokens.push("async"); + } + if (node.generator) { + tokens.push("generator"); + } + + if (parent.type === "Property" || parent.type === "MethodDefinition") { + if (parent.kind === "constructor") { + return "constructor"; + } + if (parent.kind === "get") { + tokens.push("getter"); + } else if (parent.kind === "set") { + tokens.push("setter"); + } else { + tokens.push("method"); + } + } else if (parent.type === "PropertyDefinition") { + tokens.push("method"); + } else { + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow"); + } + tokens.push("function"); + } + + if (parent.type === "Property" || parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { + if (!parent.computed && parent.key.type === "PrivateIdentifier") { + tokens.push(`#${parent.key.name}`); + } else { + const name = getStaticPropertyName(parent); + + if (name !== null) { + tokens.push(`'${name}'`); + } else if (node.id) { + tokens.push(`'${node.id.name}'`); + } + } + } else if (node.id) { + tokens.push(`'${node.id.name}'`); + } + + return tokens.join(" "); + }, + + /** + * Gets the location of the given function node for reporting. + * + * - `function foo() {}` + * ^^^^^^^^^^^^ + * - `(function foo() {})` + * ^^^^^^^^^^^^ + * - `(function() {})` + * ^^^^^^^^ + * - `function* foo() {}` + * ^^^^^^^^^^^^^ + * - `(function* foo() {})` + * ^^^^^^^^^^^^^ + * - `(function*() {})` + * ^^^^^^^^^ + * - `() => {}` + * ^^ + * - `async () => {}` + * ^^ + * - `({ foo: function foo() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ foo: function() {} })` + * ^^^^^^^^^^^^^ + * - `({ ['foo']: function() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function() {} })` + * ^^^^^^^^^^^^^^^ + * - `({ foo() {} })` + * ^^^ + * - `({ foo: function* foo() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ foo: function*() {} })` + * ^^^^^^^^^^^^^^ + * - `({ ['foo']: function*() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function*() {} })` + * ^^^^^^^^^^^^^^^^ + * - `({ *foo() {} })` + * ^^^^ + * - `({ foo: async function foo() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ foo: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^ + * - `({ ['foo']: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `({ async foo() {} })` + * ^^^^^^^^^ + * - `({ get foo() {} })` + * ^^^^^^^ + * - `({ set foo(a) {} })` + * ^^^^^^^ + * - `class A { constructor() {} }` + * ^^^^^^^^^^^ + * - `class A { foo() {} }` + * ^^^ + * - `class A { *foo() {} }` + * ^^^^ + * - `class A { async foo() {} }` + * ^^^^^^^^^ + * - `class A { ['foo']() {} }` + * ^^^^^^^ + * - `class A { *['foo']() {} }` + * ^^^^^^^^ + * - `class A { async ['foo']() {} }` + * ^^^^^^^^^^^^^ + * - `class A { [foo]() {} }` + * ^^^^^ + * - `class A { *[foo]() {} }` + * ^^^^^^ + * - `class A { async [foo]() {} }` + * ^^^^^^^^^^^ + * - `class A { get foo() {} }` + * ^^^^^^^ + * - `class A { set foo(a) {} }` + * ^^^^^^^ + * - `class A { static foo() {} }` + * ^^^^^^^^^^ + * - `class A { static *foo() {} }` + * ^^^^^^^^^^^ + * - `class A { static async foo() {} }` + * ^^^^^^^^^^^^^^^^ + * - `class A { static get foo() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static set foo(a) {} }` + * ^^^^^^^^^^^^^^ + * - `class A { foo = function() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static foo = function() {} }` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `class A { foo = (a, b) => {} }` + * ^^^^^^ + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {string} The location of the function node for reporting. + */ + getFunctionHeadLoc(node, sourceCode) { + const parent = node.parent; + let start; + let end; + + if (parent.type === "Property" || parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else if (node.type === "ArrowFunctionExpression") { + const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); + + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + + return { + start: Object.assign({}, start), + end: Object.assign({}, end) + }; + }, + + /** + * Gets next location when the result is not out of bound, otherwise returns null. + * + * Assumptions: + * + * - The given location represents a valid location in the given source code. + * - Columns are 0-based. + * - Lines are 1-based. + * - Column immediately after the last character in a line (not incl. linebreaks) is considered to be a valid location. + * - If the source code ends with a linebreak, `sourceCode.lines` array will have an extra element (empty string) at the end. + * The start (column 0) of that extra line is considered to be a valid location. + * + * Examples of successive locations (line, column): + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> null + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null + * + * code: a + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (3, 0) -> null + * + * code: + * locations: (1, 0) -> (2, 0) -> null + * + * code: + * locations: (1, 0) -> null + * @param {SourceCode} sourceCode The sourceCode + * @param {{line: number, column: number}} location The location + * @returns {{line: number, column: number} | null} Next location + */ + getNextLocation(sourceCode, { line, column }) { + if (column < sourceCode.lines[line - 1].length) { + return { + line, + column: column + 1 + }; + } + + if (line < sourceCode.lines.length) { + return { + line: line + 1, + column: 0 + }; + } + + return null; + }, + + /** + * Gets the parenthesized text of a node. This is similar to sourceCode.getText(node), but it also includes any parentheses + * surrounding the node. + * @param {SourceCode} sourceCode The source code object + * @param {ASTNode} node An expression node + * @returns {string} The text representing the node, with all surrounding parentheses included + */ + getParenthesisedText(sourceCode, node) { + let leftToken = sourceCode.getFirstToken(node); + let rightToken = sourceCode.getLastToken(node); + + while ( + sourceCode.getTokenBefore(leftToken) && + sourceCode.getTokenBefore(leftToken).type === "Punctuator" && + sourceCode.getTokenBefore(leftToken).value === "(" && + sourceCode.getTokenAfter(rightToken) && + sourceCode.getTokenAfter(rightToken).type === "Punctuator" && + sourceCode.getTokenAfter(rightToken).value === ")" + ) { + leftToken = sourceCode.getTokenBefore(leftToken); + rightToken = sourceCode.getTokenAfter(rightToken); + } + + return sourceCode.getText().slice(leftToken.range[0], rightToken.range[1]); + }, + + /** + * Determine if a node has a possibility to be an Error object + * @param {ASTNode} node ASTNode to check + * @returns {boolean} True if there is a chance it contains an Error obj + */ + couldBeError(node) { + switch (node.type) { + case "Identifier": + case "CallExpression": + case "NewExpression": + case "MemberExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + case "AwaitExpression": + case "ChainExpression": + return true; // possibly an error object. + + case "AssignmentExpression": + if (["=", "&&="].includes(node.operator)) { + return module.exports.couldBeError(node.right); + } + + if (["||=", "??="].includes(node.operator)) { + return module.exports.couldBeError(node.left) || module.exports.couldBeError(node.right); + } + + /** + * All other assignment operators are mathematical assignment operators (arithmetic or bitwise). + * An assignment expression with a mathematical operator can either evaluate to a primitive value, + * or throw, depending on the operands. Thus, it cannot evaluate to an `Error` object. + */ + return false; + + case "SequenceExpression": { + const exprs = node.expressions; + + return exprs.length !== 0 && module.exports.couldBeError(exprs.at(-1)); + } + + case "LogicalExpression": + + /* + * If the && operator short-circuits, the left side was falsy and therefore not an error, and if it + * doesn't short-circuit, it takes the value from the right side, so the right side must always be + * a plausible error. A future improvement could verify that the left side could be truthy by + * excluding falsy literals. + */ + if (node.operator === "&&") { + return module.exports.couldBeError(node.right); + } + + return module.exports.couldBeError(node.left) || module.exports.couldBeError(node.right); + + case "ConditionalExpression": + return module.exports.couldBeError(node.consequent) || module.exports.couldBeError(node.alternate); + + default: + return false; + } + }, + + /** + * Check if a given node is a numeric literal or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a number or bigint literal. + */ + isNumericLiteral(node) { + return ( + node.type === "Literal" && + (typeof node.value === "number" || Boolean(node.bigint)) + ); + }, + + /** + * Determines whether two tokens can safely be placed next to each other without merging into a single token + * @param {Token|string} leftValue The left token. If this is a string, it will be tokenized and the last token will be used. + * @param {Token|string} rightValue The right token. If this is a string, it will be tokenized and the first token will be used. + * @returns {boolean} If the tokens cannot be safely placed next to each other, returns `false`. If the tokens can be placed + * next to each other, behavior is undefined (although it should return `true` in most cases). + */ + canTokensBeAdjacent(leftValue, rightValue) { + const espreeOptions = { + ecmaVersion: espree.latestEcmaVersion, + comment: true, + range: true + }; + + let leftToken; + + if (typeof leftValue === "string") { + let tokens; + + try { + tokens = espree.tokenize(leftValue, espreeOptions); + } catch { + return false; + } + + const comments = tokens.comments; + + leftToken = tokens.at(-1); + if (comments.length) { + const lastComment = comments.at(-1); + + if (!leftToken || lastComment.range[0] > leftToken.range[0]) { + leftToken = lastComment; + } + } + } else { + leftToken = leftValue; + } + + /* + * If a hashbang comment was passed as a token object from SourceCode, + * its type will be "Shebang" because of the way ESLint itself handles hashbangs. + * If a hashbang comment was passed in a string and then tokenized in this function, + * its type will be "Hashbang" because of the way Espree tokenizes hashbangs. + */ + if (leftToken.type === "Shebang" || leftToken.type === "Hashbang") { + return false; + } + + let rightToken; + + if (typeof rightValue === "string") { + let tokens; + + try { + tokens = espree.tokenize(rightValue, espreeOptions); + } catch { + return false; + } + + const comments = tokens.comments; + + rightToken = tokens[0]; + if (comments.length) { + const firstComment = comments[0]; + + if (!rightToken || firstComment.range[0] < rightToken.range[0]) { + rightToken = firstComment; + } + } + } else { + rightToken = rightValue; + } + + if (leftToken.type === "Punctuator" || rightToken.type === "Punctuator") { + if (leftToken.type === "Punctuator" && rightToken.type === "Punctuator") { + const PLUS_TOKENS = new Set(["+", "++"]); + const MINUS_TOKENS = new Set(["-", "--"]); + + return !( + PLUS_TOKENS.has(leftToken.value) && PLUS_TOKENS.has(rightToken.value) || + MINUS_TOKENS.has(leftToken.value) && MINUS_TOKENS.has(rightToken.value) + ); + } + if (leftToken.type === "Punctuator" && leftToken.value === "/") { + return !["Block", "Line", "RegularExpression"].includes(rightToken.type); + } + return true; + } + + if ( + leftToken.type === "String" || rightToken.type === "String" || + leftToken.type === "Template" || rightToken.type === "Template" + ) { + return true; + } + + if (leftToken.type !== "Numeric" && rightToken.type === "Numeric" && rightToken.value.startsWith(".")) { + return true; + } + + if (leftToken.type === "Block" || rightToken.type === "Block" || rightToken.type === "Line") { + return true; + } + + if (rightToken.type === "PrivateIdentifier") { + return true; + } + + return false; + }, + + /** + * Get the `loc` object of a given name in a `/*globals` directive comment. + * @param {SourceCode} sourceCode The source code to convert index to loc. + * @param {Comment} comment The `/*globals` directive comment which include the name. + * @param {string} name The name to find. + * @returns {SourceLocation} The `loc` object. + */ + getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { + const namePattern = new RegExp(`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`, "gu"); + + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf("global") + 6; + + // Search a given variable name. + const match = namePattern.exec(comment.value); + + // Convert the index to loc. + const start = sourceCode.getLocFromIndex( + comment.range[0] + + "/*".length + + (match ? match.index + 1 : 0) + ); + const end = { + line: start.line, + column: start.column + (match ? name.length : 1) + }; + + return { start, end }; + }, + + /** + * Determines whether the given raw string contains an octal escape sequence + * or a non-octal decimal escape sequence ("\8", "\9"). + * + * "\1", "\2" ... "\7", "\8", "\9" + * "\00", "\01" ... "\07", "\08", "\09" + * + * "\0", when not followed by a digit, is not an octal escape sequence. + * @param {string} rawString A string in its raw representation. + * @returns {boolean} `true` if the string contains at least one octal escape sequence + * or at least one non-octal decimal escape sequence. + */ + hasOctalOrNonOctalDecimalEscapeSequence(rawString) { + return OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN.test(rawString); + }, + + /** + * Determines whether the given node is a template literal without expressions. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a template literal without expressions. + */ + isStaticTemplateLiteral(node) { + return node.type === "TemplateLiteral" && node.expressions.length === 0; + }, + + /** + * Determines whether the existing curly braces around the single statement are necessary to preserve the semantics of the code. + * The braces, which make the given block body, are necessary in either of the following situations: + * + * 1. The statement is a lexical declaration. + * 2. Without the braces, an `if` within the statement would become associated with an `else` after the closing brace: + * + * if (a) { + * if (b) + * foo(); + * } + * else + * bar(); + * + * if (a) + * while (b) + * while (c) { + * while (d) + * if (e) + * while(f) + * foo(); + * } + * else + * bar(); + * @param {ASTNode} node `BlockStatement` body with exactly one statement directly inside. The statement can have its own nested statements. + * @param {SourceCode} sourceCode The source code + * @returns {boolean} `true` if the braces are necessary - removing them (replacing the given `BlockStatement` body with its single statement content) + * would change the semantics of the code or produce a syntax error. + */ + areBracesNecessary(node, sourceCode) { + + /** + * Determines if the given node is a lexical declaration (let, const, function, or class) + * @param {ASTNode} nodeToCheck The node to check + * @returns {boolean} True if the node is a lexical declaration + * @private + */ + function isLexicalDeclaration(nodeToCheck) { + if (nodeToCheck.type === "VariableDeclaration") { + return nodeToCheck.kind === "const" || nodeToCheck.kind === "let"; + } + + return nodeToCheck.type === "FunctionDeclaration" || nodeToCheck.type === "ClassDeclaration"; + } + + + /** + * Checks if the given token is an `else` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an `else` token. + */ + function isElseKeywordToken(token) { + return token.value === "else" && token.type === "Keyword"; + } + + /** + * Determines whether the given node has an `else` keyword token as the first token after. + * @param {ASTNode} nodeToCheck The node to check. + * @returns {boolean} `true` if the node is followed by an `else` keyword token. + */ + function isFollowedByElseKeyword(nodeToCheck) { + const nextToken = sourceCode.getTokenAfter(nodeToCheck); + + return Boolean(nextToken) && isElseKeywordToken(nextToken); + } + + /** + * Determines whether the code represented by the given node contains an `if` statement + * that would become associated with an `else` keyword directly appended to that code. + * + * Examples where it returns `true`: + * + * if (a) + * foo(); + * + * if (a) { + * foo(); + * } + * + * if (a) + * foo(); + * else if (b) + * bar(); + * + * while (a) + * if (b) + * if(c) + * foo(); + * else + * bar(); + * + * Examples where it returns `false`: + * + * if (a) + * foo(); + * else + * bar(); + * + * while (a) { + * if (b) + * if(c) + * foo(); + * else + * bar(); + * } + * + * while (a) + * if (b) { + * if(c) + * foo(); + * } + * else + * bar(); + * @param {ASTNode} nodeToCheck Node representing the code to check. + * @returns {boolean} `true` if an `if` statement within the code would become associated with an `else` appended to that code. + */ + function hasUnsafeIf(nodeToCheck) { + switch (nodeToCheck.type) { + case "IfStatement": + if (!nodeToCheck.alternate) { + return true; + } + return hasUnsafeIf(nodeToCheck.alternate); + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + case "LabeledStatement": + case "WithStatement": + case "WhileStatement": + return hasUnsafeIf(nodeToCheck.body); + default: + return false; + } + } + + const statement = node.body[0]; + + return isLexicalDeclaration(statement) || + hasUnsafeIf(statement) && isFollowedByElseKeyword(node); + }, + + isReferenceToGlobalVariable, + isLogicalExpression, + isCoalesceExpression, + isMixedLogicalAndCoalesceExpressions, + isNullLiteral, + getStaticStringValue, + getStaticPropertyName, + skipChainExpression, + isSpecificId, + isSpecificMemberAccess, + equalLiteralValue, + isSameReference, + isLogicalAssignmentOperator, + getSwitchCaseColonToken, + getModuleExportName, + isConstant, + isTopLevelExpressionStatement, + isDirective, + isStartOfExpressionStatement, + needsPrecedingSemicolon, + isImportAttributeKey +}; diff --git a/node_modules/eslint/lib/rules/utils/char-source.js b/node_modules/eslint/lib/rules/utils/char-source.js new file mode 100644 index 0000000..7073862 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/char-source.js @@ -0,0 +1,240 @@ +/** + * @fileoverview Utility functions to locate the source text of each code unit in the value of a string literal or template token. + * @author Francesco Trotta + */ + +"use strict"; + +/** + * Represents a code unit produced by the evaluation of a JavaScript common token like a string + * literal or template token. + */ +class CodeUnit { + constructor(start, source) { + this.start = start; + this.source = source; + } + + get end() { + return this.start + this.length; + } + + get length() { + return this.source.length; + } +} + +/** + * An object used to keep track of the position in a source text where the next characters will be read. + */ +class TextReader { + constructor(source) { + this.source = source; + this.pos = 0; + } + + /** + * Advances the reading position of the specified number of characters. + * @param {number} length Number of characters to advance. + * @returns {void} + */ + advance(length) { + this.pos += length; + } + + /** + * Reads characters from the source. + * @param {number} [offset=0] The offset where reading starts, relative to the current position. + * @param {number} [length=1] Number of characters to read. + * @returns {string} A substring of source characters. + */ + read(offset = 0, length = 1) { + const start = offset + this.pos; + + return this.source.slice(start, start + length); + } +} + +const SIMPLE_ESCAPE_SEQUENCES = +{ __proto__: null, b: "\b", f: "\f", n: "\n", r: "\r", t: "\t", v: "\v" }; + +/** + * Reads a hex escape sequence. + * @param {TextReader} reader The reader should be positioned on the first hexadecimal digit. + * @param {number} length The number of hexadecimal digits. + * @returns {string} A code unit. + */ +function readHexSequence(reader, length) { + const str = reader.read(0, length); + const charCode = parseInt(str, 16); + + reader.advance(length); + return String.fromCharCode(charCode); +} + +/** + * Reads a Unicode escape sequence. + * @param {TextReader} reader The reader should be positioned after the "u". + * @returns {string} A code unit. + */ +function readUnicodeSequence(reader) { + const regExp = /\{(?[\dA-Fa-f]+)\}/uy; + + regExp.lastIndex = reader.pos; + const match = regExp.exec(reader.source); + + if (match) { + const codePoint = parseInt(match.groups.hexDigits, 16); + + reader.pos = regExp.lastIndex; + return String.fromCodePoint(codePoint); + } + return readHexSequence(reader, 4); +} + +/** + * Reads an octal escape sequence. + * @param {TextReader} reader The reader should be positioned after the first octal digit. + * @param {number} maxLength The maximum number of octal digits. + * @returns {string} A code unit. + */ +function readOctalSequence(reader, maxLength) { + const [octalStr] = reader.read(-1, maxLength).match(/^[0-7]+/u); + + reader.advance(octalStr.length - 1); + const octal = parseInt(octalStr, 8); + + return String.fromCharCode(octal); +} + +/** + * Reads an escape sequence or line continuation. + * @param {TextReader} reader The reader should be positioned on the backslash. + * @returns {string} A string of zero, one or two code units. + */ +function readEscapeSequenceOrLineContinuation(reader) { + const char = reader.read(1); + + reader.advance(2); + const unitChar = SIMPLE_ESCAPE_SEQUENCES[char]; + + if (unitChar) { + return unitChar; + } + switch (char) { + case "x": + return readHexSequence(reader, 2); + case "u": + return readUnicodeSequence(reader); + case "\r": + if (reader.read() === "\n") { + reader.advance(1); + } + + // fallthrough + case "\n": + case "\u2028": + case "\u2029": + return ""; + case "0": + case "1": + case "2": + case "3": + return readOctalSequence(reader, 3); + case "4": + case "5": + case "6": + case "7": + return readOctalSequence(reader, 2); + default: + return char; + } +} + +/** + * Reads an escape sequence or line continuation and generates the respective `CodeUnit` elements. + * @param {TextReader} reader The reader should be positioned on the backslash. + * @returns {Generator} Zero, one or two `CodeUnit` elements. + */ +function *mapEscapeSequenceOrLineContinuation(reader) { + const start = reader.pos; + const str = readEscapeSequenceOrLineContinuation(reader); + const end = reader.pos; + const source = reader.source.slice(start, end); + + switch (str.length) { + case 0: + break; + case 1: + yield new CodeUnit(start, source); + break; + default: + yield new CodeUnit(start, source); + yield new CodeUnit(start, source); + break; + } +} + +/** + * Parses a string literal. + * @param {string} source The string literal to parse, including the delimiting quotes. + * @returns {CodeUnit[]} A list of code units produced by the string literal. + */ +function parseStringLiteral(source) { + const reader = new TextReader(source); + const quote = reader.read(); + + reader.advance(1); + const codeUnits = []; + + for (;;) { + const char = reader.read(); + + if (char === quote) { + break; + } + if (char === "\\") { + codeUnits.push(...mapEscapeSequenceOrLineContinuation(reader)); + } else { + codeUnits.push(new CodeUnit(reader.pos, char)); + reader.advance(1); + } + } + return codeUnits; +} + +/** + * Parses a template token. + * @param {string} source The template token to parse, including the delimiting sequences `` ` ``, `${` and `}`. + * @returns {CodeUnit[]} A list of code units produced by the template token. + */ +function parseTemplateToken(source) { + const reader = new TextReader(source); + + reader.advance(1); + const codeUnits = []; + + for (;;) { + const char = reader.read(); + + if (char === "`" || char === "$" && reader.read(1) === "{") { + break; + } + if (char === "\\") { + codeUnits.push(...mapEscapeSequenceOrLineContinuation(reader)); + } else { + let unitSource; + + if (char === "\r" && reader.read(1) === "\n") { + unitSource = "\r\n"; + } else { + unitSource = char; + } + codeUnits.push(new CodeUnit(reader.pos, unitSource)); + reader.advance(unitSource.length); + } + } + return codeUnits; +} + +module.exports = { parseStringLiteral, parseTemplateToken }; diff --git a/node_modules/eslint/lib/rules/utils/fix-tracker.js b/node_modules/eslint/lib/rules/utils/fix-tracker.js new file mode 100644 index 0000000..589870b --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/fix-tracker.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Helper class to aid in constructing fix commands. + * @author Alan Pierce + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./ast-utils"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A helper class to combine fix options into a fix command. Currently, it + * exposes some "retain" methods that extend the range of the text being + * replaced so that other fixes won't touch that region in the same pass. + */ +class FixTracker { + + /** + * Create a new FixTracker. + * @param {ruleFixer} fixer A ruleFixer instance. + * @param {SourceCode} sourceCode A SourceCode object for the current code. + */ + constructor(fixer, sourceCode) { + this.fixer = fixer; + this.sourceCode = sourceCode; + this.retainedRange = null; + } + + /** + * Mark the given range as "retained", meaning that other fixes may not + * may not modify this region in the same pass. + * @param {int[]} range The range to retain. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainRange(range) { + this.retainedRange = range; + return this; + } + + /** + * Given a node, find the function containing it (or the entire program) and + * mark it as retained, meaning that other fixes may not modify it in this + * pass. This is useful for avoiding conflicts in fixes that modify control + * flow. + * @param {ASTNode} node The node to use as a starting point. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainEnclosingFunction(node) { + const functionNode = astUtils.getUpperFunction(node); + + return this.retainRange(functionNode ? functionNode.range : this.sourceCode.ast.range); + } + + /** + * Given a node or token, find the token before and afterward, and mark that + * range as retained, meaning that other fixes may not modify it in this + * pass. This is useful for avoiding conflicts in fixes that make a small + * change to the code where the AST should not be changed. + * @param {ASTNode|Token} nodeOrToken The node or token to use as a starting + * point. The token to the left and right are use in the range. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainSurroundingTokens(nodeOrToken) { + const tokenBefore = this.sourceCode.getTokenBefore(nodeOrToken) || nodeOrToken; + const tokenAfter = this.sourceCode.getTokenAfter(nodeOrToken) || nodeOrToken; + + return this.retainRange([tokenBefore.range[0], tokenAfter.range[1]]); + } + + /** + * Create a fix command that replaces the given range with the given text, + * accounting for any retained ranges. + * @param {int[]} range The range to remove in the fix. + * @param {string} text The text to insert in place of the range. + * @returns {Object} The fix command. + */ + replaceTextRange(range, text) { + let actualRange; + + if (this.retainedRange) { + actualRange = [ + Math.min(this.retainedRange[0], range[0]), + Math.max(this.retainedRange[1], range[1]) + ]; + } else { + actualRange = range; + } + + return this.fixer.replaceTextRange( + actualRange, + this.sourceCode.text.slice(actualRange[0], range[0]) + + text + + this.sourceCode.text.slice(range[1], actualRange[1]) + ); + } + + /** + * Create a fix command that removes the given node or token, accounting for + * any retained ranges. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove(nodeOrToken) { + return this.replaceTextRange(nodeOrToken.range, ""); + } +} + +module.exports = FixTracker; diff --git a/node_modules/eslint/lib/rules/utils/keywords.js b/node_modules/eslint/lib/rules/utils/keywords.js new file mode 100644 index 0000000..3fbb777 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/keywords.js @@ -0,0 +1,67 @@ +/** + * @fileoverview A shared list of ES3 keywords. + * @author Josh Perez + */ +"use strict"; + +module.exports = [ + "abstract", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "double", + "else", + "enum", + "export", + "extends", + "false", + "final", + "finally", + "float", + "for", + "function", + "goto", + "if", + "implements", + "import", + "in", + "instanceof", + "int", + "interface", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "typeof", + "var", + "void", + "volatile", + "while", + "with" +]; diff --git a/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js b/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js new file mode 100644 index 0000000..3fa5d83 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js @@ -0,0 +1,115 @@ +/** + * @fileoverview `Map` to load rules lazily. + * @author Toru Nagashima + */ +"use strict"; + +const debug = require("debug")("eslint:rules"); + +/** @typedef {import("../../shared/types").Rule} Rule */ + +/** + * The `Map` object that loads each rule when it's accessed. + * @example + * const rules = new LazyLoadingRuleMap([ + * ["eqeqeq", () => require("eqeqeq")], + * ["semi", () => require("semi")], + * ["no-unused-vars", () => require("no-unused-vars")] + * ]); + * + * rules.get("semi"); // call `() => require("semi")` here. + * + * @extends {Map Rule>} + */ +class LazyLoadingRuleMap extends Map { + + /** + * Initialize this map. + * @param {Array<[string, function(): Rule]>} loaders The rule loaders. + */ + constructor(loaders) { + let remaining = loaders.length; + + super( + debug.enabled + ? loaders.map(([ruleId, load]) => { + let cache = null; + + return [ + ruleId, + () => { + if (!cache) { + debug("Loading rule %o (remaining=%d)", ruleId, --remaining); + cache = load(); + } + return cache; + } + ]; + }) + : loaders + ); + + // `super(...iterable)` uses `this.set()`, so disable it here. + Object.defineProperty(LazyLoadingRuleMap.prototype, "set", { + configurable: true, + value: void 0 + }); + } + + /** + * Get a rule. + * Each rule will be loaded on the first access. + * @param {string} ruleId The rule ID to get. + * @returns {Rule|undefined} The rule. + */ + get(ruleId) { + const load = super.get(ruleId); + + return load && load(); + } + + /** + * Iterate rules. + * @returns {IterableIterator} Rules. + */ + *values() { + for (const load of super.values()) { + yield load(); + } + } + + /** + * Iterate rules. + * @returns {IterableIterator<[string, Rule]>} Rules. + */ + *entries() { + for (const [ruleId, load] of super.entries()) { + yield [ruleId, load()]; + } + } + + /** + * Call a function with each rule. + * @param {Function} callbackFn The callback function. + * @param {any} [thisArg] The object to pass to `this` of the callback function. + * @returns {void} + */ + forEach(callbackFn, thisArg) { + for (const [ruleId, load] of super.entries()) { + callbackFn.call(thisArg, load(), ruleId, this); + } + } +} + +// Forbid mutation. +Object.defineProperties(LazyLoadingRuleMap.prototype, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + [Symbol.iterator]: { + configurable: true, + writable: true, + value: LazyLoadingRuleMap.prototype.entries + } +}); + +module.exports = { LazyLoadingRuleMap }; diff --git a/node_modules/eslint/lib/rules/utils/regular-expressions.js b/node_modules/eslint/lib/rules/utils/regular-expressions.js new file mode 100644 index 0000000..82fdd9b --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/regular-expressions.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Common utils for regular expressions. + * @author Josh Goldberg + * @author Toru Nagashima + */ + +"use strict"; + +const { RegExpValidator } = require("@eslint-community/regexpp"); + +const REGEXPP_LATEST_ECMA_VERSION = 2025; + +/** + * Checks if the given regular expression pattern would be valid with the `u` flag. + * @param {number} ecmaVersion ECMAScript version to parse in. + * @param {string} pattern The regular expression pattern to verify. + * @param {"u"|"v"} flag The type of Unicode flag + * @returns {boolean} `true` if the pattern would be valid with the `u` flag. + * `false` if the pattern would be invalid with the `u` flag or the configured + * ecmaVersion doesn't support the `u` flag. + */ +function isValidWithUnicodeFlag(ecmaVersion, pattern, flag = "u") { + if (flag === "u" && ecmaVersion <= 5) { // ecmaVersion <= 5 doesn't support the 'u' flag + return false; + } + if (flag === "v" && ecmaVersion <= 2023) { + return false; + } + + const validator = new RegExpValidator({ + ecmaVersion: Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION) + }); + + try { + validator.validatePattern(pattern, void 0, void 0, flag === "u" ? { + unicode: /* uFlag = */ true + } : { + unicodeSets: true + }); + } catch { + return false; + } + + return true; +} + +module.exports = { + isValidWithUnicodeFlag, + REGEXPP_LATEST_ECMA_VERSION +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/index.js b/node_modules/eslint/lib/rules/utils/unicode/index.js new file mode 100644 index 0000000..d35d812 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/index.js @@ -0,0 +1,16 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +const isCombiningCharacter = require("./is-combining-character"); +const isEmojiModifier = require("./is-emoji-modifier"); +const isRegionalIndicatorSymbol = require("./is-regional-indicator-symbol"); +const isSurrogatePair = require("./is-surrogate-pair"); + +module.exports = { + isCombiningCharacter, + isEmojiModifier, + isRegionalIndicatorSymbol, + isSurrogatePair +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js b/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js new file mode 100644 index 0000000..0498b99 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is a combining mark or not. + * @param {number} codePoint The character code to check. + * @returns {boolean} `true` if the character belongs to the category, any of `Mc`, `Me`, and `Mn`. + */ +module.exports = function isCombiningCharacter(codePoint) { + return /^[\p{Mc}\p{Me}\p{Mn}]$/u.test(String.fromCodePoint(codePoint)); +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js b/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js new file mode 100644 index 0000000..1bd5f55 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is an emoji modifier. + * @param {number} code The character code to check. + * @returns {boolean} `true` if the character is an emoji modifier. + */ +module.exports = function isEmojiModifier(code) { + return code >= 0x1F3FB && code <= 0x1F3FF; +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js b/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js new file mode 100644 index 0000000..c48ed46 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is a regional indicator symbol. + * @param {number} code The character code to check. + * @returns {boolean} `true` if the character is a regional indicator symbol. + */ +module.exports = function isRegionalIndicatorSymbol(code) { + return code >= 0x1F1E6 && code <= 0x1F1FF; +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js b/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js new file mode 100644 index 0000000..b8e5c1c --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js @@ -0,0 +1,14 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether given two characters are a surrogate pair. + * @param {number} lead The code of the lead character. + * @param {number} tail The code of the tail character. + * @returns {boolean} `true` if the character pair is a surrogate pair. + */ +module.exports = function isSurrogatePair(lead, tail) { + return lead >= 0xD800 && lead < 0xDC00 && tail >= 0xDC00 && tail < 0xE000; +}; diff --git a/node_modules/eslint/lib/rules/valid-typeof.js b/node_modules/eslint/lib/rules/valid-typeof.js new file mode 100644 index 0000000..eff4d94 --- /dev/null +++ b/node_modules/eslint/lib/rules/valid-typeof.js @@ -0,0 +1,129 @@ +/** + * @fileoverview Ensures that the results of typeof are compared against a valid string + * @author Ian Christian Myers + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + defaultOptions: [{ + requireStringLiterals: false + }], + + docs: { + description: "Enforce comparing `typeof` expressions against valid strings", + recommended: true, + url: "https://eslint.org/docs/latest/rules/valid-typeof" + }, + + hasSuggestions: true, + + schema: [ + { + type: "object", + properties: { + requireStringLiterals: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + invalidValue: "Invalid typeof comparison value.", + notString: "Typeof comparisons should be to string literals.", + suggestString: 'Use `"{{type}}"` instead of `{{type}}`.' + } + }, + + create(context) { + const VALID_TYPES = new Set(["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"]), + OPERATORS = new Set(["==", "===", "!=", "!=="]); + const sourceCode = context.sourceCode; + const [{ requireStringLiterals }] = context.options; + + let globalScope; + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Determines whether a node is a typeof expression. + * @param {ASTNode} node The node + * @returns {boolean} `true` if the node is a typeof expression + */ + function isTypeofExpression(node) { + return node.type === "UnaryExpression" && node.operator === "typeof"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program(node) { + globalScope = sourceCode.getScope(node); + }, + + UnaryExpression(node) { + if (isTypeofExpression(node)) { + const { parent } = node; + + if (parent.type === "BinaryExpression" && OPERATORS.has(parent.operator)) { + const sibling = parent.left === node ? parent.right : parent.left; + + if (sibling.type === "Literal" || astUtils.isStaticTemplateLiteral(sibling)) { + const value = sibling.type === "Literal" ? sibling.value : sibling.quasis[0].value.cooked; + + if (!VALID_TYPES.has(value)) { + context.report({ node: sibling, messageId: "invalidValue" }); + } + } else if (sibling.type === "Identifier" && sibling.name === "undefined" && isReferenceToGlobalVariable(sibling)) { + context.report({ + node: sibling, + messageId: requireStringLiterals ? "notString" : "invalidValue", + suggest: [ + { + messageId: "suggestString", + data: { type: "undefined" }, + fix(fixer) { + return fixer.replaceText(sibling, '"undefined"'); + } + } + ] + }); + } else if (requireStringLiterals && !isTypeofExpression(sibling)) { + context.report({ node: sibling, messageId: "notString" }); + } + } + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/vars-on-top.js b/node_modules/eslint/lib/rules/vars-on-top.js new file mode 100644 index 0000000..ccb36c4 --- /dev/null +++ b/node_modules/eslint/lib/rules/vars-on-top.js @@ -0,0 +1,158 @@ +/** + * @fileoverview Rule to enforce var declarations are only at the top of a function. + * @author Danny Fritz + * @author Gyandeep Singh + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require `var` declarations be placed at the top of their containing scope", + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/vars-on-top" + }, + + schema: [], + messages: { + top: "All 'var' declarations must be at the top of the function scope." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Has AST suggesting a directive. + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === "ExpressionStatement" && + node.expression.type === "Literal" && typeof node.expression.value === "string"; + } + + /** + * Check to see if its a ES6 import declaration + * @param {ASTNode} node any node + * @returns {boolean} whether the given node represents a import declaration + */ + function looksLikeImport(node) { + return node.type === "ImportDeclaration" || node.type === "ImportSpecifier" || + node.type === "ImportDefaultSpecifier" || node.type === "ImportNamespaceSpecifier"; + } + + /** + * Checks whether a given node is a variable declaration or not. + * @param {ASTNode} node any node + * @returns {boolean} `true` if the node is a variable declaration. + */ + function isVariableDeclaration(node) { + return ( + node.type === "VariableDeclaration" || + ( + node.type === "ExportNamedDeclaration" && + node.declaration && + node.declaration.type === "VariableDeclaration" + ) + ); + } + + /** + * Checks whether this variable is on top of the block body + * @param {ASTNode} node The node to check + * @param {ASTNode[]} statements collection of ASTNodes for the parent node block + * @returns {boolean} True if var is on top otherwise false + */ + function isVarOnTop(node, statements) { + const l = statements.length; + let i = 0; + + // Skip over directives and imports. Static blocks don't have either. + if (node.parent.type !== "StaticBlock") { + for (; i < l; ++i) { + if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) { + break; + } + } + } + + for (; i < l; ++i) { + if (!isVariableDeclaration(statements[i])) { + return false; + } + if (statements[i] === node) { + return true; + } + } + + return false; + } + + /** + * Checks whether variable is on top at the global level + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node + * @returns {void} + */ + function globalVarCheck(node, parent) { + if (!isVarOnTop(node, parent.body)) { + context.report({ node, messageId: "top" }); + } + } + + /** + * Checks whether variable is on top at functional block scope level + * @param {ASTNode} node The node to check + * @returns {void} + */ + function blockScopeVarCheck(node) { + const { parent } = node; + + if ( + parent.type === "BlockStatement" && + /Function/u.test(parent.parent.type) && + isVarOnTop(node, parent.body) + ) { + return; + } + + if ( + parent.type === "StaticBlock" && + isVarOnTop(node, parent.body) + ) { + return; + } + + context.report({ node, messageId: "top" }); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration[kind='var']"(node) { + if (node.parent.type === "ExportNamedDeclaration") { + globalVarCheck(node.parent, node.parent.parent); + } else if (node.parent.type === "Program") { + globalVarCheck(node, node.parent); + } else { + blockScopeVarCheck(node); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/wrap-iife.js b/node_modules/eslint/lib/rules/wrap-iife.js new file mode 100644 index 0000000..1a5cc8a --- /dev/null +++ b/node_modules/eslint/lib/rules/wrap-iife.js @@ -0,0 +1,225 @@ +/** + * @fileoverview Rule to flag when IIFE is not wrapped in parens + * @author Ilya Volodin + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const eslintUtils = require("@eslint-community/eslint-utils"); + +//---------------------------------------------------------------------- +// Helpers +//---------------------------------------------------------------------- + +/** + * Check if the given node is callee of a `NewExpression` node + * @param {ASTNode} node node to check + * @returns {boolean} True if the node is callee of a `NewExpression` node + * @private + */ +function isCalleeOfNewExpression(node) { + const maybeCallee = node.parent.type === "ChainExpression" + ? node.parent + : node; + + return ( + maybeCallee.parent.type === "NewExpression" && + maybeCallee.parent.callee === maybeCallee + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "wrap-iife", + url: "https://eslint.style/rules/js/wrap-iife" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require parentheses around immediate `function` invocations", + recommended: false, + url: "https://eslint.org/docs/latest/rules/wrap-iife" + }, + + schema: [ + { + enum: ["outside", "inside", "any"] + }, + { + type: "object", + properties: { + functionPrototypeMethods: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + wrapInvocation: "Wrap an immediate function invocation in parentheses.", + wrapExpression: "Wrap only the function expression in parens.", + moveInvocation: "Move the invocation into the parens that contain the function." + } + }, + + create(context) { + + const style = context.options[0] || "outside"; + const includeFunctionPrototypeMethods = context.options[1] && context.options[1].functionPrototypeMethods; + + const sourceCode = context.sourceCode; + + /** + * Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if() + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped in any parens + * @private + */ + function isWrappedInAnyParens(node) { + return astUtils.isParenthesised(sourceCode, node); + } + + /** + * Check if the node is wrapped in grouping (). Parens for constructs such as if() don't count + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped in grouping parens + * @private + */ + function isWrappedInGroupingParens(node) { + return eslintUtils.isParenthesized(1, node, sourceCode); + } + + /** + * Get the function node from an IIFE + * @param {ASTNode} node node to evaluate + * @returns {ASTNode} node that is the function expression of the given IIFE, or null if none exist + */ + function getFunctionNodeFromIIFE(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "FunctionExpression") { + return callee; + } + + if (includeFunctionPrototypeMethods && + callee.type === "MemberExpression" && + callee.object.type === "FunctionExpression" && + (astUtils.getStaticPropertyName(callee) === "call" || astUtils.getStaticPropertyName(callee) === "apply") + ) { + return callee.object; + } + + return null; + } + + + return { + CallExpression(node) { + const innerNode = getFunctionNodeFromIIFE(node); + + if (!innerNode) { + return; + } + + const isCallExpressionWrapped = isWrappedInAnyParens(node), + isFunctionExpressionWrapped = isWrappedInAnyParens(innerNode); + + if (!isCallExpressionWrapped && !isFunctionExpressionWrapped) { + context.report({ + node, + messageId: "wrapInvocation", + fix(fixer) { + const nodeToSurround = style === "inside" ? innerNode : node; + + return fixer.replaceText(nodeToSurround, `(${sourceCode.getText(nodeToSurround)})`); + } + }); + } else if (style === "inside" && !isFunctionExpressionWrapped) { + context.report({ + node, + messageId: "wrapExpression", + fix(fixer) { + + // The outer call expression will always be wrapped at this point. + + if (isWrappedInGroupingParens(node) && !isCalleeOfNewExpression(node)) { + + /* + * Parenthesize the function expression and remove unnecessary grouping parens around the call expression. + * Replace the range between the end of the function expression and the end of the call expression. + * for example, in `(function(foo) {}(bar))`, the range `(bar))` should get replaced with `)(bar)`. + */ + + const parenAfter = sourceCode.getTokenAfter(node); + + return fixer.replaceTextRange( + [innerNode.range[1], parenAfter.range[1]], + `)${sourceCode.getText().slice(innerNode.range[1], parenAfter.range[0])}` + ); + } + + /* + * Call expression is wrapped in mandatory parens such as if(), or in necessary grouping parens. + * These parens cannot be removed, so just parenthesize the function expression. + */ + + return fixer.replaceText(innerNode, `(${sourceCode.getText(innerNode)})`); + } + }); + } else if (style === "outside" && !isCallExpressionWrapped) { + context.report({ + node, + messageId: "moveInvocation", + fix(fixer) { + + /* + * The inner function expression will always be wrapped at this point. + * It's only necessary to replace the range between the end of the function expression + * and the call expression. For example, in `(function(foo) {})(bar)`, the range `)(bar)` + * should get replaced with `(bar))`. + */ + const parenAfter = sourceCode.getTokenAfter(innerNode); + + return fixer.replaceTextRange( + [parenAfter.range[0], node.range[1]], + `${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})` + ); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/wrap-regex.js b/node_modules/eslint/lib/rules/wrap-regex.js new file mode 100644 index 0000000..5d9cf45 --- /dev/null +++ b/node_modules/eslint/lib/rules/wrap-regex.js @@ -0,0 +1,79 @@ +/** + * @fileoverview Rule to flag when regex literals are not wrapped in parens + * @author Matt DuVall + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "wrap-regex", + url: "https://eslint.style/rules/js/wrap-regex" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require parenthesis around regex literals", + recommended: false, + url: "https://eslint.org/docs/latest/rules/wrap-regex" + }, + + schema: [], + fixable: "code", + + messages: { + requireParens: "Wrap the regexp literal in parens to disambiguate the slash." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node), + nodeType = token.type; + + if (nodeType === "RegularExpression") { + const beforeToken = sourceCode.getTokenBefore(node); + const afterToken = sourceCode.getTokenAfter(node); + const { parent } = node; + + if (parent.type === "MemberExpression" && parent.object === node && + !(beforeToken && beforeToken.value === "(" && afterToken && afterToken.value === ")")) { + context.report({ + node, + messageId: "requireParens", + fix: fixer => fixer.replaceText(node, `(${sourceCode.getText(node)})`) + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/yield-star-spacing.js b/node_modules/eslint/lib/rules/yield-star-spacing.js new file mode 100644 index 0000000..dee9b53 --- /dev/null +++ b/node_modules/eslint/lib/rules/yield-star-spacing.js @@ -0,0 +1,148 @@ +/** + * @fileoverview Rule to check the spacing around the * in yield* expressions. + * @author Bryan Smith + * @deprecated in ESLint v8.53.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + deprecated: { + message: "Formatting rules are being moved out of ESLint core.", + url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", + deprecatedSince: "8.53.0", + availableUntil: "10.0.0", + replacedBy: [ + { + message: "ESLint Stylistic now maintains deprecated stylistic core rules.", + url: "https://eslint.style/guide/migration", + plugin: { + name: "@stylistic/eslint-plugin-js", + url: "https://eslint.style/packages/js" + }, + rule: { + name: "yield-star-spacing", + url: "https://eslint.style/rules/js/yield-star-spacing" + } + } + ] + }, + type: "layout", + + docs: { + description: "Require or disallow spacing around the `*` in `yield*` expressions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/yield-star-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + } + ] + } + ], + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } + }, + + create(context) { + const sourceCode = context.sourceCode; + + const mode = (function(option) { + if (!option || typeof option === "string") { + return { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }[option || "after"]; + } + return option; + }(context.options[0])); + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(side, leftToken, rightToken) { + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken) !== mode[side]) { + const after = leftToken.value === "*"; + const spaceRequired = mode[side]; + const node = after ? leftToken : rightToken; + let messageId; + + if (spaceRequired) { + messageId = side === "before" ? "missingBefore" : "missingAfter"; + } else { + messageId = side === "before" ? "unexpectedBefore" : "unexpectedAfter"; + } + + context.report({ + node, + messageId, + fix(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a yield* expression. + * @param {ASTNode} node A yield expression node. + * @returns {void} + */ + function checkExpression(node) { + if (!node.delegate) { + return; + } + + const tokens = sourceCode.getFirstTokens(node, 3); + const yieldToken = tokens[0]; + const starToken = tokens[1]; + const nextToken = tokens[2]; + + checkSpacing("before", yieldToken, starToken); + checkSpacing("after", starToken, nextToken); + } + + return { + YieldExpression: checkExpression + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/yoda.js b/node_modules/eslint/lib/rules/yoda.js new file mode 100644 index 0000000..2f7bfff --- /dev/null +++ b/node_modules/eslint/lib/rules/yoda.js @@ -0,0 +1,351 @@ +/** + * @fileoverview Rule to require or disallow yoda comparisons + * @author Nicholas C. Zakas + */ +"use strict"; + +//-------------------------------------------------------------------------- +// Requirements +//-------------------------------------------------------------------------- + +const astUtils = require("./utils/ast-utils"); + +//-------------------------------------------------------------------------- +// Helpers +//-------------------------------------------------------------------------- + +/** + * Determines whether an operator is a comparison operator. + * @param {string} operator The operator to check. + * @returns {boolean} Whether or not it is a comparison operator. + */ +function isComparisonOperator(operator) { + return /^(==|===|!=|!==|<|>|<=|>=)$/u.test(operator); +} + +/** + * Determines whether an operator is an equality operator. + * @param {string} operator The operator to check. + * @returns {boolean} Whether or not it is an equality operator. + */ +function isEqualityOperator(operator) { + return /^(==|===)$/u.test(operator); +} + +/** + * Determines whether an operator is one used in a range test. + * Allowed operators are `<` and `<=`. + * @param {string} operator The operator to check. + * @returns {boolean} Whether the operator is used in range tests. + */ +function isRangeTestOperator(operator) { + return ["<", "<="].includes(operator); +} + +/** + * Determines whether a non-Literal node is a negative number that should be + * treated as if it were a single Literal node. + * @param {ASTNode} node Node to test. + * @returns {boolean} True if the node is a negative number that looks like a + * real literal and should be treated as such. + */ +function isNegativeNumericLiteral(node) { + return ( + node.type === "UnaryExpression" && + node.operator === "-" && + node.prefix && + astUtils.isNumericLiteral(node.argument) + ); +} + +/** + * Determines whether a non-Literal node should be treated as a single Literal node. + * @param {ASTNode} node Node to test + * @returns {boolean} True if the node should be treated as a single Literal node. + */ +function looksLikeLiteral(node) { + return isNegativeNumericLiteral(node) || astUtils.isStaticTemplateLiteral(node); +} + +/** + * Attempts to derive a Literal node from nodes that are treated like literals. + * @param {ASTNode} node Node to normalize. + * @returns {ASTNode} One of the following options. + * 1. The original node if the node is already a Literal + * 2. A normalized Literal node with the negative number as the value if the + * node represents a negative number literal. + * 3. A normalized Literal node with the string as the value if the node is + * a Template Literal without expression. + * 4. Otherwise `null`. + */ +function getNormalizedLiteral(node) { + if (node.type === "Literal") { + return node; + } + + if (isNegativeNumericLiteral(node)) { + return { + type: "Literal", + value: -node.argument.value, + raw: `-${node.argument.value}` + }; + } + + if (astUtils.isStaticTemplateLiteral(node)) { + return { + type: "Literal", + value: node.quasis[0].value.cooked, + raw: node.quasis[0].value.raw + }; + } + + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + defaultOptions: ["never", { + exceptRange: false, + onlyEquality: false + }], + + docs: { + description: 'Require or disallow "Yoda" conditions', + recommended: false, + frozen: true, + url: "https://eslint.org/docs/latest/rules/yoda" + }, + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptRange: { + type: "boolean" + }, + onlyEquality: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + expected: + "Expected literal to be on the {{expectedSide}} side of {{operator}}." + } + }, + + create(context) { + const [when, { exceptRange, onlyEquality }] = context.options; + const always = when === "always"; + const sourceCode = context.sourceCode; + + /** + * Determines whether node represents a range test. + * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside" + * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and + * both operators must be `<` or `<=`. Finally, the literal on the left side + * must be less than or equal to the literal on the right side so that the + * test makes any sense. + * @param {ASTNode} node LogicalExpression node to test. + * @returns {boolean} Whether node is a range test. + */ + function isRangeTest(node) { + const left = node.left, + right = node.right; + + /** + * Determines whether node is of the form `0 <= x && x < 1`. + * @returns {boolean} Whether node is a "between" range test. + */ + function isBetweenTest() { + if (node.operator === "&&" && astUtils.isSameReference(left.right, right.left)) { + const leftLiteral = getNormalizedLiteral(left.left); + const rightLiteral = getNormalizedLiteral(right.right); + + if (leftLiteral === null && rightLiteral === null) { + return false; + } + + if (rightLiteral === null || leftLiteral === null) { + return true; + } + + if (leftLiteral.value <= rightLiteral.value) { + return true; + } + } + return false; + } + + /** + * Determines whether node is of the form `x < 0 || 1 <= x`. + * @returns {boolean} Whether node is an "outside" range test. + */ + function isOutsideTest() { + if (node.operator === "||" && astUtils.isSameReference(left.left, right.right)) { + const leftLiteral = getNormalizedLiteral(left.right); + const rightLiteral = getNormalizedLiteral(right.left); + + if (leftLiteral === null && rightLiteral === null) { + return false; + } + + if (rightLiteral === null || leftLiteral === null) { + return true; + } + + if (leftLiteral.value <= rightLiteral.value) { + return true; + } + } + + return false; + } + + /** + * Determines whether node is wrapped in parentheses. + * @returns {boolean} Whether node is preceded immediately by an open + * paren token and followed immediately by a close + * paren token. + */ + function isParenWrapped() { + return astUtils.isParenthesised(sourceCode, node); + } + + return ( + node.type === "LogicalExpression" && + left.type === "BinaryExpression" && + right.type === "BinaryExpression" && + isRangeTestOperator(left.operator) && + isRangeTestOperator(right.operator) && + (isBetweenTest() || isOutsideTest()) && + isParenWrapped() + ); + } + + const OPERATOR_FLIP_MAP = { + "===": "===", + "!==": "!==", + "==": "==", + "!=": "!=", + "<": ">", + ">": "<", + "<=": ">=", + ">=": "<=" + }; + + /** + * Returns a string representation of a BinaryExpression node with its sides/operator flipped around. + * @param {ASTNode} node The BinaryExpression node + * @returns {string} A string representation of the node with the sides and operator flipped + */ + function getFlippedString(node) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + const lastLeftToken = sourceCode.getTokenBefore(operatorToken); + const firstRightToken = sourceCode.getTokenAfter(operatorToken); + + const source = sourceCode.getText(); + + const leftText = source.slice( + node.range[0], + lastLeftToken.range[1] + ); + const textBeforeOperator = source.slice( + lastLeftToken.range[1], + operatorToken.range[0] + ); + const textAfterOperator = source.slice( + operatorToken.range[1], + firstRightToken.range[0] + ); + const rightText = source.slice( + firstRightToken.range[0], + node.range[1] + ); + + const tokenBefore = sourceCode.getTokenBefore(node); + const tokenAfter = sourceCode.getTokenAfter(node); + let prefix = ""; + let suffix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken) + ) { + prefix = " "; + } + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(lastLeftToken, tokenAfter) + ) { + suffix = " "; + } + + return ( + prefix + + rightText + + textBeforeOperator + + OPERATOR_FLIP_MAP[operatorToken.value] + + textAfterOperator + + leftText + + suffix + ); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + BinaryExpression(node) { + const expectedLiteral = always ? node.left : node.right; + const expectedNonLiteral = always ? node.right : node.left; + + // If `expectedLiteral` is not a literal, and `expectedNonLiteral` is a literal, raise an error. + if ( + (expectedNonLiteral.type === "Literal" || + looksLikeLiteral(expectedNonLiteral)) && + !( + expectedLiteral.type === "Literal" || + looksLikeLiteral(expectedLiteral) + ) && + !(!isEqualityOperator(node.operator) && onlyEquality) && + isComparisonOperator(node.operator) && + !(exceptRange && isRangeTest(node.parent)) + ) { + context.report({ + node, + messageId: "expected", + data: { + operator: node.operator, + expectedSide: always ? "left" : "right" + }, + fix: fixer => + fixer.replaceText(node, getFlippedString(node)) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/services/parser-service.js b/node_modules/eslint/lib/services/parser-service.js new file mode 100644 index 0000000..c138b83 --- /dev/null +++ b/node_modules/eslint/lib/services/parser-service.js @@ -0,0 +1,65 @@ +/** + * @fileoverview ESLint Parser + * @author Nicholas C. Zakas + */ +/* eslint class-methods-use-this: off -- Anticipate future constructor arguments. */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** @typedef {import("../linter/vfile.js").VFile} VFile */ +/** @typedef {import("@eslint/core").Language} Language */ +/** @typedef {import("@eslint/core").LanguageOptions} LanguageOptions */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * The parser for ESLint. + */ +class ParserService { + + /** + * Parses the given file synchronously. + * @param {VFile} file The file to parse. + * @param {{language:Language,languageOptions:LanguageOptions}} config The configuration to use. + * @returns {Object} An object with the parsed source code or errors. + * @throws {Error} If the parser returns a promise. + */ + parseSync(file, config) { + + const { language, languageOptions } = config; + const result = language.parse(file, { languageOptions }); + + if (typeof result.then === "function") { + throw new Error("Unsupported: Language parser returned a promise."); + } + + if (result.ok) { + return { + ok: true, + sourceCode: language.createSourceCode(file, result, { languageOptions }) + }; + } + + // if we made it to here there was an error + return { + ok: false, + errors: result.errors.map(error => ({ + ruleId: null, + nodeType: null, + fatal: true, + severity: 2, + message: `Parsing error: ${error.message}`, + line: error.line, + column: error.column + })) + }; + } +} + +module.exports = { ParserService }; diff --git a/node_modules/eslint/lib/services/processor-service.js b/node_modules/eslint/lib/services/processor-service.js new file mode 100644 index 0000000..403b97c --- /dev/null +++ b/node_modules/eslint/lib/services/processor-service.js @@ -0,0 +1,109 @@ +/** + * @fileoverview ESLint Processor Service + * @author Nicholas C. Zakas + */ +/* eslint class-methods-use-this: off -- Anticipate future constructor arguments. */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const path = require("node:path"); +const { VFile } = require("../linter/vfile.js"); + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** @typedef {import("../shared/types.js").LintMessage} LintMessage */ +/** @typedef {import("../linter/vfile.js").VFile} VFile */ +/** @typedef {import("@eslint/core").Language} Language */ +/** @typedef {import("@eslint/core").LanguageOptions} LanguageOptions */ +/** @typedef {import("eslint").Linter.Processor} Processor */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * The service that applies processors to files. + */ +class ProcessorService { + + /** + * Preprocesses the given file synchronously. + * @param {VFile} file The file to preprocess. + * @param {{processor:Processor}} config The configuration to use. + * @returns {{ok:boolean, files?: Array, errors?: Array}} An array of preprocessed files or errors. + * @throws {Error} If the preprocessor returns a promise. + */ + preprocessSync(file, config) { + + const { processor } = config; + let blocks; + + try { + blocks = processor.preprocess(file.rawBody, file.path); + } catch (ex) { + + // If the message includes a leading line number, strip it: + const message = `Preprocessing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`; + + return { + ok: false, + errors: [ + { + ruleId: null, + fatal: true, + severity: 2, + message, + line: ex.lineNumber, + column: ex.column, + nodeType: null + } + ] + }; + } + + if (typeof blocks.then === "function") { + throw new Error("Unsupported: Preprocessor returned a promise."); + } + + return { + ok: true, + files: blocks.map((block, i) => { + + // Legacy behavior: return the block as a string + if (typeof block === "string") { + return block; + } + + const filePath = path.join(file.path, `${i}_${block.filename}`); + + return new VFile(filePath, block.text, { + physicalPath: file.physicalPath + }); + }) + }; + + } + + /** + * Postprocesses the given messages synchronously. + * @param {VFile} file The file to postprocess. + * @param {LintMessage[][]} messages The messages to postprocess. + * @param {{processor:Processor}} config The configuration to use. + * @returns {LintMessage[]} The postprocessed messages. + */ + postprocessSync(file, messages, config) { + + const { processor } = config; + + return processor.postprocess(messages, file.path); + } + +} + +module.exports = { ProcessorService }; diff --git a/node_modules/eslint/lib/shared/ajv.js b/node_modules/eslint/lib/shared/ajv.js new file mode 100644 index 0000000..f4f6a62 --- /dev/null +++ b/node_modules/eslint/lib/shared/ajv.js @@ -0,0 +1,34 @@ +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Ajv = require("ajv"), + metaSchema = require("ajv/lib/refs/json-schema-draft-04.json"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = (additionalOptions = {}) => { + const ajv = new Ajv({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle -- Ajv's API + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; diff --git a/node_modules/eslint/lib/shared/assert.js b/node_modules/eslint/lib/shared/assert.js new file mode 100644 index 0000000..00bbe07 --- /dev/null +++ b/node_modules/eslint/lib/shared/assert.js @@ -0,0 +1,22 @@ +/** + * @fileoverview Assertion utilities equivalent to the Node.js node:asserts module. + * @author Josh Goldberg + */ + +"use strict"; + +/** + * Throws an error if the input is not truthy. + * @param {unknown} value The input that is checked for being truthy. + * @param {string} message Message to throw if the input is not truthy. + * @returns {void} + * @throws {Error} When the condition is not truthy. + */ +function ok(value, message = "Assertion failed.") { + if (!value) { + throw new Error(message); + } +} + + +module.exports = ok; diff --git a/node_modules/eslint/lib/shared/ast-utils.js b/node_modules/eslint/lib/shared/ast-utils.js new file mode 100644 index 0000000..4ebd49c --- /dev/null +++ b/node_modules/eslint/lib/shared/ast-utils.js @@ -0,0 +1,29 @@ +/** + * @fileoverview Common utils for AST. + * + * This file contains only shared items for core and rules. + * If you make a utility for rules, please see `../rules/utils/ast-utils.js`. + * + * @author Toru Nagashima + */ +"use strict"; + +const breakableTypePattern = /^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/u; +const lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u; +const shebangPattern = /^#!([^\r\n]+)/u; + +/** + * Creates a version of the `lineBreakPattern` regex with the global flag. + * Global regexes are mutable, so this needs to be a function instead of a constant. + * @returns {RegExp} A global regular expression that matches line terminators + */ +function createGlobalLinebreakMatcher() { + return new RegExp(lineBreakPattern.source, "gu"); +} + +module.exports = { + breakableTypePattern, + lineBreakPattern, + createGlobalLinebreakMatcher, + shebangPattern +}; diff --git a/node_modules/eslint/lib/shared/deep-merge-arrays.js b/node_modules/eslint/lib/shared/deep-merge-arrays.js new file mode 100644 index 0000000..d34149d --- /dev/null +++ b/node_modules/eslint/lib/shared/deep-merge-arrays.js @@ -0,0 +1,60 @@ +/** + * @fileoverview Applies default rule options + * @author JoshuaKGoldberg + */ + +"use strict"; + +/** + * Check if the variable contains an object strictly rejecting arrays + * @param {unknown} value an object + * @returns {boolean} Whether value is an object + */ +function isObjectNotArray(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + +/** + * Deeply merges second on top of first, creating a new {} object if needed. + * @param {T} first Base, default value. + * @param {U} second User-specified value. + * @returns {T | U | (T & U)} Merged equivalent of second on top of first. + */ +function deepMergeObjects(first, second) { + if (second === void 0) { + return first; + } + + if (!isObjectNotArray(first) || !isObjectNotArray(second)) { + return second; + } + + const result = { ...first, ...second }; + + for (const key of Object.keys(second)) { + if (Object.prototype.propertyIsEnumerable.call(first, key)) { + result[key] = deepMergeObjects(first[key], second[key]); + } + } + + return result; +} + +/** + * Deeply merges second on top of first, creating a new [] array if needed. + * @param {T[]} first Base, default values. + * @param {U[]} second User-specified values. + * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first. + */ +function deepMergeArrays(first, second) { + if (!first || !second) { + return second || first || []; + } + + return [ + ...first.map((value, i) => deepMergeObjects(value, i < second.length ? second[i] : void 0)), + ...second.slice(first.length) + ]; +} + +module.exports = { deepMergeArrays }; diff --git a/node_modules/eslint/lib/shared/directives.js b/node_modules/eslint/lib/shared/directives.js new file mode 100644 index 0000000..ff67b00 --- /dev/null +++ b/node_modules/eslint/lib/shared/directives.js @@ -0,0 +1,15 @@ +/** + * @fileoverview Common utils for directives. + * + * This file contains only shared items for directives. + * If you make a utility for rules, please see `../rules/utils/ast-utils.js`. + * + * @author gfyoung + */ +"use strict"; + +const directivesPattern = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u; + +module.exports = { + directivesPattern +}; diff --git a/node_modules/eslint/lib/shared/flags.js b/node_modules/eslint/lib/shared/flags.js new file mode 100644 index 0000000..7a232d2 --- /dev/null +++ b/node_modules/eslint/lib/shared/flags.js @@ -0,0 +1,66 @@ +/** + * @fileoverview Shared flags for ESLint. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * @typedef {Object} InactiveFlagData + * @property {string} description Flag description + * @property {string | null} [replacedBy] Can be either: + * - An active flag (string) that enables the same feature. + * - `null` if the feature is now enabled by default. + * - Omitted if the feature has been abandoned. + */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * The set of flags that change ESLint behavior with a description. + * @type {Map} + */ +const activeFlags = new Map([ + ["test_only", "Used only for testing."], + ["unstable_config_lookup_from_file", "Look up `eslint.config.js` from the file being linted."] +]); + +/** + * The set of flags that used to be active. + * @type {Map} + */ +const inactiveFlags = new Map([ + ["test_only_replaced", { description: "Used only for testing flags that have been replaced by other flags.", replacedBy: "test_only" }], + ["test_only_enabled_by_default", { description: "Used only for testing flags whose features have been enabled by default.", replacedBy: null }], + ["test_only_abandoned", { description: "Used only for testing flags whose features have been abandoned." }], + ["unstable_ts_config", { description: "Enable TypeScript configuration files.", replacedBy: null }] +]); + +/** + * Creates a message that describes the reason the flag is inactive. + * @param {InactiveFlagData} inactiveFlagData Data for the inactive flag. + * @returns {string} Message describing the reason the flag is inactive. + */ +function getInactivityReasonMessage({ replacedBy }) { + if (typeof replacedBy === "undefined") { + return "This feature has been abandoned."; + } + + if (typeof replacedBy === "string") { + return `This flag has been renamed '${replacedBy}' to reflect its stabilization. Please use '${replacedBy}' instead.`; + } + + // null + return "This feature is now enabled by default."; +} + +module.exports = { + activeFlags, + inactiveFlags, + getInactivityReasonMessage +}; diff --git a/node_modules/eslint/lib/shared/logging.js b/node_modules/eslint/lib/shared/logging.js new file mode 100644 index 0000000..9310e58 --- /dev/null +++ b/node_modules/eslint/lib/shared/logging.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Handle logging for ESLint + * @author Gyandeep Singh + */ + +"use strict"; + +/* eslint no-console: "off" -- Logging util */ + +/* c8 ignore next */ +module.exports = { + + /** + * Cover for console.info + * @param {...any} args The elements to log. + * @returns {void} + */ + info(...args) { + console.log(...args); + }, + + /** + * Cover for console.warn + * @param {...any} args The elements to log. + * @returns {void} + */ + warn(...args) { + console.warn(...args); + }, + + /** + * Cover for console.error + * @param {...any} args The elements to log. + * @returns {void} + */ + error(...args) { + console.error(...args); + } +}; diff --git a/node_modules/eslint/lib/shared/option-utils.js b/node_modules/eslint/lib/shared/option-utils.js new file mode 100644 index 0000000..0053a3a --- /dev/null +++ b/node_modules/eslint/lib/shared/option-utils.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Utilities to operate on option objects. + * @author Josh Goldberg + */ + +"use strict"; + +/** + * Determines whether any of input's properties are different + * from values that already exist in original. + * @template T + * @param {Partial} input New value. + * @param {T} original Original value. + * @returns {boolean} Whether input includes an explicit difference. + */ +function containsDifferentProperty(input, original) { + if (input === original) { + return false; + } + + if ( + typeof input !== typeof original || + Array.isArray(input) !== Array.isArray(original) + ) { + return true; + } + + if (Array.isArray(input)) { + return ( + input.length !== original.length || + input.some((value, i) => + containsDifferentProperty(value, original[i])) + ); + } + + if (typeof input === "object") { + if (input === null || original === null) { + return true; + } + + const inputKeys = Object.keys(input); + const originalKeys = Object.keys(original); + + return inputKeys.length !== originalKeys.length || inputKeys.some( + inputKey => + !Object.hasOwn(original, inputKey) || + containsDifferentProperty(input[inputKey], original[inputKey]) + ); + } + + return true; +} + +module.exports = { + containsDifferentProperty +}; diff --git a/node_modules/eslint/lib/shared/runtime-info.js b/node_modules/eslint/lib/shared/runtime-info.js new file mode 100644 index 0000000..29de6fc --- /dev/null +++ b/node_modules/eslint/lib/shared/runtime-info.js @@ -0,0 +1,168 @@ +/** + * @fileoverview Utility to get information about the execution environment. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("node:path"); +const spawn = require("cross-spawn"); +const os = require("node:os"); +const log = require("../shared/logging"); +const packageJson = require("../../package.json"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Generates and returns execution environment information. + * @returns {string} A string that contains execution environment information. + */ +function environment() { + const cache = new Map(); + + /** + * Checks if a path is a child of a directory. + * @param {string} parentPath The parent path to check. + * @param {string} childPath The path to check. + * @returns {boolean} Whether or not the given path is a child of a directory. + */ + function isChildOfDirectory(parentPath, childPath) { + return !path.relative(parentPath, childPath).startsWith(".."); + } + + /** + * Synchronously executes a shell command and formats the result. + * @param {string} cmd The command to execute. + * @param {Array} args The arguments to be executed with the command. + * @throws {Error} As may be collected by `cross-spawn.sync`. + * @returns {string} The version returned by the command. + */ + function execCommand(cmd, args) { + const key = [cmd, ...args].join(" "); + + if (cache.has(key)) { + return cache.get(key); + } + + const process = spawn.sync(cmd, args, { encoding: "utf8" }); + + if (process.error) { + throw process.error; + } + + const result = process.stdout.trim(); + + cache.set(key, result); + return result; + } + + /** + * Normalizes a version number. + * @param {string} versionStr The string to normalize. + * @returns {string} The normalized version number. + */ + function normalizeVersionStr(versionStr) { + return versionStr.startsWith("v") ? versionStr : `v${versionStr}`; + } + + /** + * Gets bin version. + * @param {string} bin The bin to check. + * @throws {Error} As may be collected by `cross-spawn.sync`. + * @returns {string} The normalized version returned by the command. + */ + function getBinVersion(bin) { + const binArgs = ["--version"]; + + try { + return normalizeVersionStr(execCommand(bin, binArgs)); + } catch (e) { + log.error(`Error finding ${bin} version running the command \`${bin} ${binArgs.join(" ")}\``); + throw e; + } + } + + /** + * Gets installed npm package version. + * @param {string} pkg The package to check. + * @param {boolean} global Whether to check globally or not. + * @throws {Error} As may be collected by `cross-spawn.sync`. + * @returns {string} The normalized version returned by the command. + */ + function getNpmPackageVersion(pkg, { global = false } = {}) { + const npmBinArgs = ["bin", "-g"]; + const npmLsArgs = ["ls", "--depth=0", "--json", pkg]; + + if (global) { + npmLsArgs.push("-g"); + } + + try { + const parsedStdout = JSON.parse(execCommand("npm", npmLsArgs)); + + /* + * Checking globally returns an empty JSON object, while local checks + * include the name and version of the local project. + */ + if (Object.keys(parsedStdout).length === 0 || !(parsedStdout.dependencies && parsedStdout.dependencies.eslint)) { + return "Not found"; + } + + const [, processBinPath] = process.argv; + let npmBinPath; + + try { + npmBinPath = execCommand("npm", npmBinArgs); + } catch (e) { + log.error(`Error finding npm binary path when running command \`npm ${npmBinArgs.join(" ")}\``); + throw e; + } + + const isGlobal = isChildOfDirectory(npmBinPath, processBinPath); + let pkgVersion = parsedStdout.dependencies.eslint.version; + + if ((global && isGlobal) || (!global && !isGlobal)) { + pkgVersion += " (Currently used)"; + } + + return normalizeVersionStr(pkgVersion); + } catch (e) { + log.error(`Error finding ${pkg} version running the command \`npm ${npmLsArgs.join(" ")}\``); + throw e; + } + } + + return [ + "Environment Info:", + "", + `Node version: ${getBinVersion("node")}`, + `npm version: ${getBinVersion("npm")}`, + `Local ESLint version: ${getNpmPackageVersion("eslint", { global: false })}`, + `Global ESLint version: ${getNpmPackageVersion("eslint", { global: true })}`, + `Operating System: ${os.platform()} ${os.release()}` + ].join("\n"); +} + +/** + * Returns version of currently executing ESLint. + * @returns {string} The version from the currently executing ESLint's package.json. + */ +function version() { + return `v${packageJson.version}`; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + __esModule: true, // Indicate intent for imports, remove ambiguity for Knip (see: https://github.com/eslint/eslint/pull/18005#discussion_r1484422616) + environment, + version +}; diff --git a/node_modules/eslint/lib/shared/serialization.js b/node_modules/eslint/lib/shared/serialization.js new file mode 100644 index 0000000..69f5710 --- /dev/null +++ b/node_modules/eslint/lib/shared/serialization.js @@ -0,0 +1,55 @@ +/** + * @fileoverview Serialization utils. + * @author Bryan Mishkin + */ + +"use strict"; + +/** + * Check if a value is a primitive or plain object created by the Object constructor. + * @param {any} val the value to check + * @returns {boolean} true if so + * @private + */ +function isSerializablePrimitiveOrPlainObject(val) { + return ( + val === null || + typeof val === "string" || + typeof val === "boolean" || + typeof val === "number" || + (typeof val === "object" && val.constructor === Object) || + Array.isArray(val) + ); +} + +/** + * Check if a value is serializable. + * Functions or objects like RegExp cannot be serialized by JSON.stringify(). + * Inspired by: https://stackoverflow.com/questions/30579940/reliable-way-to-check-if-objects-is-serializable-in-javascript + * @param {any} val the value + * @returns {boolean} true if the value is serializable + */ +function isSerializable(val) { + if (!isSerializablePrimitiveOrPlainObject(val)) { + return false; + } + if (typeof val === "object") { + for (const property in val) { + if (Object.hasOwn(val, property)) { + if (!isSerializablePrimitiveOrPlainObject(val[property])) { + return false; + } + if (typeof val[property] === "object") { + if (!isSerializable(val[property])) { + return false; + } + } + } + } + } + return true; +} + +module.exports = { + isSerializable +}; diff --git a/node_modules/eslint/lib/shared/severity.js b/node_modules/eslint/lib/shared/severity.js new file mode 100644 index 0000000..6b21469 --- /dev/null +++ b/node_modules/eslint/lib/shared/severity.js @@ -0,0 +1,49 @@ +/** + * @fileoverview Helpers for severity values (e.g. normalizing different types). + * @author Bryan Mishkin + */ + +"use strict"; + +/** + * Convert severity value of different types to a string. + * @param {string|number} severity severity value + * @throws error if severity is invalid + * @returns {string} severity string + */ +function normalizeSeverityToString(severity) { + if ([2, "2", "error"].includes(severity)) { + return "error"; + } + if ([1, "1", "warn"].includes(severity)) { + return "warn"; + } + if ([0, "0", "off"].includes(severity)) { + return "off"; + } + throw new Error(`Invalid severity value: ${severity}`); +} + +/** + * Convert severity value of different types to a number. + * @param {string|number} severity severity value + * @throws error if severity is invalid + * @returns {number} severity number + */ +function normalizeSeverityToNumber(severity) { + if ([2, "2", "error"].includes(severity)) { + return 2; + } + if ([1, "1", "warn"].includes(severity)) { + return 1; + } + if ([0, "0", "off"].includes(severity)) { + return 0; + } + throw new Error(`Invalid severity value: ${severity}`); +} + +module.exports = { + normalizeSeverityToString, + normalizeSeverityToNumber +}; diff --git a/node_modules/eslint/lib/shared/stats.js b/node_modules/eslint/lib/shared/stats.js new file mode 100644 index 0000000..c5d4d18 --- /dev/null +++ b/node_modules/eslint/lib/shared/stats.js @@ -0,0 +1,30 @@ +/** + * @fileoverview Provides helper functions to start/stop the time measurements + * that are provided by the ESLint 'stats' option. + * @author Mara Kiefer + */ +"use strict"; + +/** + * Start time measurement + * @returns {[number, number]} t variable for tracking time + */ +function startTime() { + return process.hrtime(); +} + +/** + * End time measurement + * @param {[number, number]} t Variable for tracking time + * @returns {number} The measured time in milliseconds + */ +function endTime(t) { + const time = process.hrtime(t); + + return time[0] * 1e3 + time[1] / 1e6; +} + +module.exports = { + startTime, + endTime +}; diff --git a/node_modules/eslint/lib/shared/string-utils.js b/node_modules/eslint/lib/shared/string-utils.js new file mode 100644 index 0000000..31d0df9 --- /dev/null +++ b/node_modules/eslint/lib/shared/string-utils.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Utilities to operate on strings. + * @author Stephen Wade + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// eslint-disable-next-line no-control-regex -- intentionally including control characters +const ASCII_REGEX = /^[\u0000-\u007f]*$/u; + +/** @type {Intl.Segmenter | undefined} */ +let segmenter; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Converts the first letter of a string to uppercase. + * @param {string} string The string to operate on + * @returns {string} The converted string + */ +function upperCaseFirst(string) { + if (string.length <= 1) { + return string.toUpperCase(); + } + return string[0].toUpperCase() + string.slice(1); +} + +/** + * Counts graphemes in a given string. + * @param {string} value A string to count graphemes. + * @returns {number} The number of graphemes in `value`. + */ +function getGraphemeCount(value) { + if (ASCII_REGEX.test(value)) { + return value.length; + } + + segmenter ??= new Intl.Segmenter("en-US"); // en-US locale should be supported everywhere + let graphemeCount = 0; + + // eslint-disable-next-line no-unused-vars -- for-of needs a variable + for (const unused of segmenter.segment(value)) { + graphemeCount++; + } + + return graphemeCount; +} + +module.exports = { + upperCaseFirst, + getGraphemeCount +}; diff --git a/node_modules/eslint/lib/shared/text-table.js b/node_modules/eslint/lib/shared/text-table.js new file mode 100644 index 0000000..ddd137d --- /dev/null +++ b/node_modules/eslint/lib/shared/text-table.js @@ -0,0 +1,67 @@ +/** + * @fileoverview Optimized version of the `text-table` npm module to improve performance by replacing inefficient regex-based + * whitespace trimming with a modern built-in method. + * + * This modification addresses a performance issue reported in https://github.com/eslint/eslint/issues/18709 + * + * The `text-table` module is published under the MIT License. For the original source, refer to: + * https://www.npmjs.com/package/text-table. + */ + +/* + * + * This software is released under the MIT license: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +"use strict"; + +module.exports = function(rows_, opts) { + const hsep = " "; + const align = opts.align; + const stringLength = opts.stringLength; + + const sizes = rows_.reduce((acc, row) => { + row.forEach((c, ix) => { + const n = stringLength(c); + + if (!acc[ix] || n > acc[ix]) { + acc[ix] = n; + } + }); + return acc; + }, []); + + return rows_ + .map(row => + row + .map((c, ix) => { + const n = sizes[ix] - stringLength(c) || 0; + const s = Array(Math.max(n + 1, 1)).join(" "); + + if (align[ix] === "r") { + return s + c; + } + + return c + s; + }) + .join(hsep) + .trimEnd()) + .join("\n"); +}; diff --git a/node_modules/eslint/lib/shared/traverser.js b/node_modules/eslint/lib/shared/traverser.js new file mode 100644 index 0000000..38b4e21 --- /dev/null +++ b/node_modules/eslint/lib/shared/traverser.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Traverser to traverse AST trees. + * @author Nicholas C. Zakas + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const vk = require("eslint-visitor-keys"); +const debug = require("debug")("eslint:traverser"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Do nothing. + * @returns {void} + */ +function noop() { + + // do nothing. +} + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string"; +} + +/** + * Get the visitor keys of a given node. + * @param {Object} visitorKeys The map of visitor keys. + * @param {ASTNode} node The node to get their visitor keys. + * @returns {string[]} The visitor keys of the node. + */ +function getVisitorKeys(visitorKeys, node) { + let keys = visitorKeys[node.type]; + + if (!keys) { + keys = vk.getKeys(node); + debug("Unknown node type \"%s\": Estimated visitor keys %j", node.type, keys); + } + + return keys; +} + +/** + * The traverser class to traverse AST trees. + */ +class Traverser { + constructor() { + this._current = null; + this._parents = []; + this._skipped = false; + this._broken = false; + this._visitorKeys = null; + this._enter = null; + this._leave = null; + } + + /** + * Gives current node. + * @returns {ASTNode} The current node. + */ + current() { + return this._current; + } + + /** + * Gives a copy of the ancestor nodes. + * @returns {ASTNode[]} The ancestor nodes. + */ + parents() { + return this._parents.slice(0); + } + + /** + * Break the current traversal. + * @returns {void} + */ + break() { + this._broken = true; + } + + /** + * Skip child nodes for the current traversal. + * @returns {void} + */ + skip() { + this._skipped = true; + } + + /** + * Traverse the given AST tree. + * @param {ASTNode} node The root node to traverse. + * @param {Object} options The option object. + * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`. + * @param {Function} [options.enter=noop] The callback function which is called on entering each node. + * @param {Function} [options.leave=noop] The callback function which is called on leaving each node. + * @returns {void} + */ + traverse(node, options) { + this._current = null; + this._parents = []; + this._skipped = false; + this._broken = false; + this._visitorKeys = options.visitorKeys || vk.KEYS; + this._enter = options.enter || noop; + this._leave = options.leave || noop; + this._traverse(node, null); + } + + /** + * Traverse the given AST tree recursively. + * @param {ASTNode} node The current node. + * @param {ASTNode|null} parent The parent node. + * @returns {void} + * @private + */ + _traverse(node, parent) { + if (!isNode(node)) { + return; + } + + this._current = node; + this._skipped = false; + this._enter(node, parent); + + if (!this._skipped && !this._broken) { + const keys = getVisitorKeys(this._visitorKeys, node); + + if (keys.length >= 1) { + this._parents.push(node); + for (let i = 0; i < keys.length && !this._broken; ++i) { + const child = node[keys[i]]; + + if (Array.isArray(child)) { + for (let j = 0; j < child.length && !this._broken; ++j) { + this._traverse(child[j], node); + } + } else { + this._traverse(child, node); + } + } + this._parents.pop(); + } + } + + if (!this._broken) { + this._leave(node, parent); + } + + this._current = parent; + } + + /** + * Calculates the keys to use for traversal. + * @param {ASTNode} node The node to read keys from. + * @returns {string[]} An array of keys to visit on the node. + * @private + */ + static getKeys(node) { + return vk.getKeys(node); + } + + /** + * Traverse the given AST tree. + * @param {ASTNode} node The root node to traverse. + * @param {Object} options The option object. + * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`. + * @param {Function} [options.enter=noop] The callback function which is called on entering each node. + * @param {Function} [options.leave=noop] The callback function which is called on leaving each node. + * @returns {void} + */ + static traverse(node, options) { + new Traverser().traverse(node, options); + } + + /** + * The default visitor keys. + * @type {Object} + */ + static get DEFAULT_VISITOR_KEYS() { + return vk.KEYS; + } +} + +module.exports = Traverser; diff --git a/node_modules/eslint/lib/shared/types.js b/node_modules/eslint/lib/shared/types.js new file mode 100644 index 0000000..6602fad --- /dev/null +++ b/node_modules/eslint/lib/shared/types.js @@ -0,0 +1,269 @@ +/** + * @fileoverview Define common types for input completion. + * @author Toru Nagashima + */ +"use strict"; + +/** @type {any} */ +module.exports = {}; + +/** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */ +/** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */ +/** @typedef {SeverityConf | [SeverityConf, ...any[]]} RuleConf */ + +/** + * @typedef {Object} EcmaFeatures + * @property {boolean} [globalReturn] Enabling `return` statements at the top-level. + * @property {boolean} [jsx] Enabling JSX syntax. + * @property {boolean} [impliedStrict] Enabling strict mode always. + */ + +/** + * @typedef {Object} ParserOptions + * @property {EcmaFeatures} [ecmaFeatures] The optional features. + * @property {3|5|6|7|8|9|10|11|12|13|14|15|16|2015|2016|2017|2018|2019|2020|2021|2022|2023|2024|2025} [ecmaVersion] The ECMAScript version (or revision number). + * @property {"script"|"module"} [sourceType] The source code type. + * @property {boolean} [allowReserved] Allowing the use of reserved words as identifiers in ES3. + */ + +/** + * @typedef {Object} LanguageOptions + * @property {number|"latest"} [ecmaVersion] The ECMAScript version (or revision number). + * @property {Record} [globals] The global variable settings. + * @property {"script"|"module"|"commonjs"} [sourceType] The source code type. + * @property {string|Object} [parser] The parser to use. + * @property {Object} [parserOptions] The parser options to use. + */ + +/** + * @typedef {Object} ConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {Record} [globals] The global variable settings. + * @property {string | string[]} [ignorePatterns] The glob patterns that ignore to lint. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {boolean} [root] The root flag. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} OverrideConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [excludedFiles] The glob patterns for excluded files. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {string | string[]} files The glob patterns for target files. + * @property {Record} [globals] The global variable settings. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} ParseResult + * @property {Object} ast The AST. + * @property {ScopeManager} [scopeManager] The scope manager of the AST. + * @property {Record} [services] The services that the parser provides. + * @property {Record} [visitorKeys] The visitor keys of the AST. + */ + +/** + * @typedef {Object} Parser + * @property {(text:string, options:ParserOptions) => Object} parse The definition of global variables. + * @property {(text:string, options:ParserOptions) => ParseResult} [parseForESLint] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} Environment + * @property {Record} [globals] The definition of global variables. + * @property {ParserOptions} [parserOptions] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} LintMessage + * @property {number|undefined} column The 1-based column number. + * @property {number} [endColumn] The 1-based column number of the end location. + * @property {number} [endLine] The 1-based line number of the end location. + * @property {boolean} [fatal] If `true` then this is a fatal error. + * @property {{range:[number,number], text:string}} [fix] Information for autofix. + * @property {number|undefined} line The 1-based line number. + * @property {string} message The error message. + * @property {string} [messageId] The ID of the message in the rule's meta. + * @property {(string|null)} nodeType Type of node + * @property {string|null} ruleId The ID of the rule which makes this message. + * @property {0|1|2} severity The severity of this message. + * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. + */ + +/** + * @typedef {Object} SuppressedLintMessage + * @property {number|undefined} column The 1-based column number. + * @property {number} [endColumn] The 1-based column number of the end location. + * @property {number} [endLine] The 1-based line number of the end location. + * @property {boolean} [fatal] If `true` then this is a fatal error. + * @property {{range:[number,number], text:string}} [fix] Information for autofix. + * @property {number|undefined} line The 1-based line number. + * @property {string} message The error message. + * @property {string} [messageId] The ID of the message in the rule's meta. + * @property {(string|null)} nodeType Type of node + * @property {string|null} ruleId The ID of the rule which makes this message. + * @property {0|1|2} severity The severity of this message. + * @property {Array<{kind: string, justification: string}>} suppressions The suppression info. + * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. + */ + +/** + * @typedef {Object} SuggestionResult + * @property {string} desc A short description. + * @property {string} [messageId] Id referencing a message for the description. + * @property {{ text: string, range: number[] }} fix fix result info + */ + +/** + * @typedef {Object} Processor + * @property {(text:string, filename:string) => Array} [preprocess] The function to extract code blocks. + * @property {(messagesList:LintMessage[][], filename:string) => LintMessage[]} [postprocess] The function to merge messages. + * @property {boolean} [supportsAutofix] If `true` then it means the processor supports autofix. + */ + +/** + * @typedef {Object} RuleMetaDocs + * @property {string} description The description of the rule. + * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset. + * @property {string} url The URL of the rule documentation. + */ + +/** + * @typedef {Object} DeprecatedInfo + * @property {string} [message] General message presented to the user + * @property {string} [url] URL to more information about this deprecation in general + * @property {ReplacedByInfo[]} [replacedBy] Potential replacements for the rule + * @property {string} [deprecatedSince] Version since the rule is deprecated + * @property {?string} [availableUntil] Version until it is available or null if indefinite + */ + +/** + * @typedef {Object} ReplacedByInfo + * @property {string} [message] General message presented to the user + * @property {string} [url] URL to more information about this replacement in general + * @property {{ name?: string, url?: string }} [plugin] Use "eslint" for a core rule. Omit if the rule is in the same plugin. + * @property {{ name?: string, url?: string }} [rule] Name and information of the replacement rule + */ + +/** + * @typedef {Object} RuleMeta + * @property {boolean|DeprecatedInfo} [deprecated] If `true` then the rule has been deprecated. + * @property {Array} [defaultOptions] Default options for the rule. + * @property {RuleMetaDocs} docs The document information of the rule. + * @property {"code"|"whitespace"} [fixable] The autofix type. + * @property {boolean} [hasSuggestions] If `true` then the rule provides suggestions. + * @property {Record} [messages] The messages the rule reports. + * @property {string[]} [replacedBy] The IDs of the alternative rules. + * @property {Array|Object} schema The option schema of the rule. + * @property {"problem"|"suggestion"|"layout"} type The rule type. + */ + +/** + * @typedef {Object} Rule + * @property {Function} create The factory of the rule. + * @property {RuleMeta} meta The meta data of the rule. + */ + +/** + * @typedef {Object} Plugin + * @property {Record} [configs] The definition of plugin configs. + * @property {Record} [environments] The definition of plugin environments. + * @property {Record} [processors] The definition of plugin processors. + * @property {Record} [rules] The definition of plugin rules. + */ + +/** + * Information of deprecated rules. + * @typedef {Object} DeprecatedRuleInfo + * @property {string} ruleId The rule ID. + * @property {string[]} replacedBy The rule IDs that replace this deprecated rule. + * @property {DeprecatedInfo} [info] The raw deprecated info provided by rule. Unset if `deprecated` is a boolean. + */ + +/** + * A linting result. + * @typedef {Object} LintResult + * @property {string} filePath The path to the file that was linted. + * @property {LintMessage[]} messages All of the messages for the result. + * @property {SuppressedLintMessage[]} suppressedMessages All of the suppressed messages for the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} fatalErrorCount Number of fatal errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {Stats} [stats] The performance statistics collected with the `stats` flag. + * @property {string} [source] The source code of the file that was linted. + * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible. + * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules. + */ + +/** + * Performance statistics + * @typedef {Object} Stats + * @property {number} fixPasses The number of times ESLint has applied at least one fix after linting. + * @property {Times} times The times spent on (parsing, fixing, linting) a file. + */ + +/** + * Performance Times for each ESLint pass + * @typedef {Object} Times + * @property {TimePass[]} passes Time passes + */ + +/** + * @typedef {Object} TimePass + * @property {ParseTime} parse The parse object containing all parse time information. + * @property {Record} [rules] The rules object containing all lint time information for each rule. + * @property {FixTime} fix The parse object containing all fix time information. + * @property {number} total The total time that is spent on (parsing, fixing, linting) a file. + */ +/** + * @typedef {Object} ParseTime + * @property {number} total The total time that is spent when parsing a file. + */ +/** + * @typedef {Object} RuleTime + * @property {number} total The total time that is spent on a rule. + */ +/** + * @typedef {Object} FixTime + * @property {number} total The total time that is spent on applying fixes to the code. + */ + +/** + * Information provided when the maximum warning threshold is exceeded. + * @typedef {Object} MaxWarningsExceeded + * @property {number} maxWarnings Number of warnings to trigger nonzero exit code. + * @property {number} foundWarnings Number of warnings found while linting. + */ + +/** + * Metadata about results for formatters. + * @typedef {Object} ResultsMeta + * @property {MaxWarningsExceeded} [maxWarningsExceeded] Present if the maxWarnings threshold was exceeded. + */ + +/** + * A formatter function. + * @callback FormatterFunction + * @param {LintResult[]} results The list of linting results. + * @param {{cwd: string, maxWarningsExceeded?: MaxWarningsExceeded, rulesMeta: Record}} context A context object. + * @returns {string | Promise} Formatted text. + */ diff --git a/node_modules/eslint/lib/universal.js b/node_modules/eslint/lib/universal.js new file mode 100644 index 0000000..51bac58 --- /dev/null +++ b/node_modules/eslint/lib/universal.js @@ -0,0 +1,10 @@ +/** + * @fileoverview exports for browsers + * @author 唯然 + */ + +"use strict"; + +const { Linter } = require("./linter/linter"); + +module.exports = { Linter }; diff --git a/node_modules/eslint/lib/unsupported-api.js b/node_modules/eslint/lib/unsupported-api.js new file mode 100644 index 0000000..1feb18f --- /dev/null +++ b/node_modules/eslint/lib/unsupported-api.js @@ -0,0 +1,29 @@ +/** + * @fileoverview APIs that are not officially supported by ESLint. + * These APIs may change or be removed at any time. Use at your + * own risk. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { FileEnumerator } = require("./cli-engine/file-enumerator"); +const { ESLint: FlatESLint, shouldUseFlatConfig } = require("./eslint/eslint"); +const { LegacyESLint } = require("./eslint/legacy-eslint"); +const builtinRules = require("./rules"); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + builtinRules, + FlatESLint, + shouldUseFlatConfig, + FileEnumerator, + LegacyESLint +}; diff --git a/node_modules/eslint/messages/all-files-ignored.js b/node_modules/eslint/messages/all-files-ignored.js new file mode 100644 index 0000000..70877a4 --- /dev/null +++ b/node_modules/eslint/messages/all-files-ignored.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function(it) { + const { pattern } = it; + + return ` +You are linting "${pattern}", but all of the files matching the glob pattern "${pattern}" are ignored. + +If you don't want to lint these files, remove the pattern "${pattern}" from the list of arguments passed to ESLint. + +If you do want to lint these files, try the following solutions: + +* Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored. +* Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/all-matched-files-ignored.js b/node_modules/eslint/messages/all-matched-files-ignored.js new file mode 100644 index 0000000..b568bec --- /dev/null +++ b/node_modules/eslint/messages/all-matched-files-ignored.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = function(it) { + const { pattern } = it; + + return ` +You are linting "${pattern}", but all of the files matching the glob pattern "${pattern}" are ignored. + +If you don't want to lint these files, remove the pattern "${pattern}" from the list of arguments passed to ESLint. + +If you do want to lint these files, explicitly list one or more of the files from this glob that you'd like to lint to see more details about why they are ignored. + + * If the file is ignored because of a matching ignore pattern, check global ignores in your config file. + https://eslint.org/docs/latest/use/configure/ignore + + * If the file is ignored because no matching configuration was supplied, check file patterns in your config file. + https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-with-arbitrary-extensions + + * If the file is ignored because it is located outside of the base path, change the location of your config file to be in a parent directory. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/config-file-missing.js b/node_modules/eslint/messages/config-file-missing.js new file mode 100644 index 0000000..a416a87 --- /dev/null +++ b/node_modules/eslint/messages/config-file-missing.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function() { + return ` +ESLint couldn't find an eslint.config.(js|mjs|cjs) file. + +From ESLint v9.0.0, the default configuration file is now eslint.config.js. +If you are using a .eslintrc.* file, please follow the migration guide +to update your configuration file to the new format: + +https://eslint.org/docs/latest/use/configure/migration-guide + +If you still have problems after following the migration guide, please stop by +https://eslint.org/chat/help to chat with the team. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/config-plugin-missing.js b/node_modules/eslint/messages/config-plugin-missing.js new file mode 100644 index 0000000..20695c5 --- /dev/null +++ b/node_modules/eslint/messages/config-plugin-missing.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function(it) { + const { pluginName, ruleId } = it; + + return ` +A configuration object specifies rule "${ruleId}", but could not find plugin "${pluginName}". + +Common causes of this problem include: + +1. The "${pluginName}" plugin is not defined in your configuration file. +2. The "${pluginName}" plugin is not defined within the same configuration object in which the "${ruleId}" rule is applied. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/config-serialize-function.js b/node_modules/eslint/messages/config-serialize-function.js new file mode 100644 index 0000000..eefc155 --- /dev/null +++ b/node_modules/eslint/messages/config-serialize-function.js @@ -0,0 +1,28 @@ +"use strict"; + +module.exports = function({ key, objectKey }) { + + // special case for parsers + const isParser = objectKey === "parser" && (key === "parse" || key === "parseForESLint"); + const parserMessage = ` + This typically happens when you're using a custom parser that does not +provide a "meta" property, which is how ESLint determines the serialized +representation. Please open an issue with the maintainer of the custom parser +and share this link: + +https://eslint.org/docs/latest/extend/custom-parsers#meta-data-in-custom-parsers +`.trim(); + + return ` +The requested operation requires ESLint to serialize configuration data, +but the configuration key "${objectKey}.${key}" contains a function value, +which cannot be serialized. + +${ + isParser ? parserMessage : "Please double-check your configuration for errors." +} + +If you still have problems, please stop by https://eslint.org/chat/help to chat +with the team. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/eslintrc-incompat.js b/node_modules/eslint/messages/eslintrc-incompat.js new file mode 100644 index 0000000..b89c39b --- /dev/null +++ b/node_modules/eslint/messages/eslintrc-incompat.js @@ -0,0 +1,119 @@ +"use strict"; + +/* eslint consistent-return: 0 -- no default case */ + +const messages = { + + env: ` +A config object is using the "env" key, which is not supported in flat config system. + +Flat config uses "languageOptions.globals" to define global variables for your files. + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options + +If you're not using "env" directly (it may be coming from a plugin), please see the following: +https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config +`, + + extends: ` +A config object is using the "extends" key, which is not supported in flat config system. + +Instead of "extends", you can include config objects that you'd like to extend from directly in the flat config array. + +If you're using "extends" in your config file, please see the following: +https://eslint.org/docs/latest/use/configure/migration-guide#predefined-and-shareable-configs + +If you're not using "extends" directly (it may be coming from a plugin), please see the following: +https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config +`, + + globals: ` +A config object is using the "globals" key, which is not supported in flat config system. + +Flat config uses "languageOptions.globals" to define global variables for your files. + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options + +If you're not using "globals" directly (it may be coming from a plugin), please see the following: +https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config +`, + + ignorePatterns: ` +A config object is using the "ignorePatterns" key, which is not supported in flat config system. + +Flat config uses "ignores" to specify files to ignore. + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files + +If you're not using "ignorePatterns" directly (it may be coming from a plugin), please see the following: +https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config +`, + + noInlineConfig: ` +A config object is using the "noInlineConfig" key, which is not supported in flat config system. + +Flat config uses "linterOptions.noInlineConfig" to specify files to ignore. + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#linter-options +`, + + overrides: ` +A config object is using the "overrides" key, which is not supported in flat config system. + +Flat config is an array that acts like the eslintrc "overrides" array. + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#glob-based-configs + +If you're not using "overrides" directly (it may be coming from a plugin), please see the following: +https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config +`, + + parser: ` +A config object is using the "parser" key, which is not supported in flat config system. + +Flat config uses "languageOptions.parser" to override the default parser. + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#custom-parsers + +If you're not using "parser" directly (it may be coming from a plugin), please see the following: +https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config +`, + + parserOptions: ` +A config object is using the "parserOptions" key, which is not supported in flat config system. + +Flat config uses "languageOptions.parserOptions" to specify parser options. + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options + +If you're not using "parserOptions" directly (it may be coming from a plugin), please see the following: +https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config +`, + + reportUnusedDisableDirectives: ` +A config object is using the "reportUnusedDisableDirectives" key, which is not supported in flat config system. + +Flat config uses "linterOptions.reportUnusedDisableDirectives" to specify files to ignore. + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#linter-options +`, + + root: ` +A config object is using the "root" key, which is not supported in flat config system. + +Flat configs always act as if they are the root config file, so this key can be safely removed. +` +}; + +module.exports = function({ key }) { + + return messages[key].trim(); +}; diff --git a/node_modules/eslint/messages/eslintrc-plugins.js b/node_modules/eslint/messages/eslintrc-plugins.js new file mode 100644 index 0000000..cd0c803 --- /dev/null +++ b/node_modules/eslint/messages/eslintrc-plugins.js @@ -0,0 +1,28 @@ +"use strict"; + +module.exports = function({ plugins }) { + + const isArrayOfStrings = typeof plugins[0] === "string"; + + return ` +A config object has a "plugins" key defined as an array${isArrayOfStrings ? " of strings" : ""}. It looks something like this: + + { + "plugins": ${JSON.stringify(plugins)} + } + +Flat config requires "plugins" to be an object, like this: + + { + plugins: { + ${isArrayOfStrings && plugins[0] ? plugins[0] : "namespace"}: pluginObject + } + } + +Please see the following page for information on how to convert your config object into the correct format: +https://eslint.org/docs/latest/use/configure/migration-guide#importing-plugins-and-custom-parsers + +If you're using a shareable config that you cannot rewrite in flat config format, then use the compatibility utility: +https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config +`; +}; diff --git a/node_modules/eslint/messages/extend-config-missing.js b/node_modules/eslint/messages/extend-config-missing.js new file mode 100644 index 0000000..5b3498f --- /dev/null +++ b/node_modules/eslint/messages/extend-config-missing.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function(it) { + const { configName, importerName } = it; + + return ` +ESLint couldn't find the config "${configName}" to extend from. Please check that the name of the config is correct. + +The config "${configName}" was referenced from the config file in "${importerName}". + +If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/failed-to-read-json.js b/node_modules/eslint/messages/failed-to-read-json.js new file mode 100644 index 0000000..e7c6cb5 --- /dev/null +++ b/node_modules/eslint/messages/failed-to-read-json.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function(it) { + const { path, message } = it; + + return ` +Failed to read JSON file at ${path}: + +${message} +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/file-not-found.js b/node_modules/eslint/messages/file-not-found.js new file mode 100644 index 0000000..1a62fcf --- /dev/null +++ b/node_modules/eslint/messages/file-not-found.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function(it) { + const { pattern, globDisabled } = it; + + return ` +No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found. +Please check for typing mistakes in the pattern. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/invalid-rule-options.js b/node_modules/eslint/messages/invalid-rule-options.js new file mode 100644 index 0000000..9a8acc9 --- /dev/null +++ b/node_modules/eslint/messages/invalid-rule-options.js @@ -0,0 +1,17 @@ +"use strict"; + +const { stringifyValueForError } = require("./shared"); + +module.exports = function({ ruleId, value }) { + return ` +Configuration for rule "${ruleId}" is invalid. Each rule must have a severity ("off", 0, "warn", 1, "error", or 2) and may be followed by additional options for the rule. + +You passed '${stringifyValueForError(value, 4)}', which doesn't contain a valid severity. + +If you're attempting to configure rule options, perhaps you meant: + + "${ruleId}": ["error", ${stringifyValueForError(value, 8)}] + +See https://eslint.org/docs/latest/use/configure/rules#using-configuration-files for configuring rules. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/invalid-rule-severity.js b/node_modules/eslint/messages/invalid-rule-severity.js new file mode 100644 index 0000000..3f13183 --- /dev/null +++ b/node_modules/eslint/messages/invalid-rule-severity.js @@ -0,0 +1,13 @@ +"use strict"; + +const { stringifyValueForError } = require("./shared"); + +module.exports = function({ ruleId, value }) { + return ` +Configuration for rule "${ruleId}" is invalid. Expected severity of "off", 0, "warn", 1, "error", or 2. + +You passed '${stringifyValueForError(value, 4)}'. + +See https://eslint.org/docs/latest/use/configure/rules#using-configuration-files for configuring rules. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/no-config-found.js b/node_modules/eslint/messages/no-config-found.js new file mode 100644 index 0000000..64b93ed --- /dev/null +++ b/node_modules/eslint/messages/no-config-found.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function(it) { + const { directoryPath } = it; + + return ` +ESLint couldn't find a configuration file. To set up a configuration file for this project, please run: + + npm init @eslint/config@latest + +ESLint looked for configuration files in ${directoryPath} and its ancestors. If it found none, it then looked in your home directory. + +If you think you already have a configuration file or if you need more help, please stop by the ESLint Discord server: https://eslint.org/chat +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/plugin-conflict.js b/node_modules/eslint/messages/plugin-conflict.js new file mode 100644 index 0000000..4113a53 --- /dev/null +++ b/node_modules/eslint/messages/plugin-conflict.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = function(it) { + const { pluginId, plugins } = it; + + let result = `ESLint couldn't determine the plugin "${pluginId}" uniquely. +`; + + for (const { filePath, importerName } of plugins) { + result += ` +- ${filePath} (loaded in "${importerName}")`; + } + + result += ` + +Please remove the "plugins" setting from either config or remove either plugin installation. + +If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting. +`; + + return result; +}; diff --git a/node_modules/eslint/messages/plugin-invalid.js b/node_modules/eslint/messages/plugin-invalid.js new file mode 100644 index 0000000..4c60e41 --- /dev/null +++ b/node_modules/eslint/messages/plugin-invalid.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function(it) { + const { configName, importerName } = it; + + return ` +"${configName}" is invalid syntax for a config specifier. + +* If your intention is to extend from a configuration exported from the plugin, add the configuration name after a slash: e.g. "${configName}/myConfig". +* If this is the name of a shareable config instead of a plugin, remove the "plugin:" prefix: i.e. "${configName.slice("plugin:".length)}". + +"${configName}" was referenced from the config file in "${importerName}". + +If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/plugin-missing.js b/node_modules/eslint/messages/plugin-missing.js new file mode 100644 index 0000000..366ec45 --- /dev/null +++ b/node_modules/eslint/messages/plugin-missing.js @@ -0,0 +1,19 @@ +"use strict"; + +module.exports = function(it) { + const { pluginName, resolvePluginsRelativeTo, importerName } = it; + + return ` +ESLint couldn't find the plugin "${pluginName}". + +(The package "${pluginName}" was not found when loaded as a Node module from the directory "${resolvePluginsRelativeTo}".) + +It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: + + npm install ${pluginName}@latest --save-dev + +The plugin "${pluginName}" was referenced from the config file in "${importerName}". + +If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/print-config-with-directory-path.js b/node_modules/eslint/messages/print-config-with-directory-path.js new file mode 100644 index 0000000..4559c8d --- /dev/null +++ b/node_modules/eslint/messages/print-config-with-directory-path.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function() { + return ` +The '--print-config' CLI option requires a path to a source code file rather than a directory. +See also: https://eslint.org/docs/latest/use/command-line-interface#--print-config +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/shared.js b/node_modules/eslint/messages/shared.js new file mode 100644 index 0000000..8c6e9b9 --- /dev/null +++ b/node_modules/eslint/messages/shared.js @@ -0,0 +1,18 @@ +/** + * @fileoverview Shared utilities for error messages. + * @author Josh Goldberg + */ + +"use strict"; + +/** + * Converts a value to a string that may be printed in errors. + * @param {any} value The invalid value. + * @param {number} indentation How many spaces to indent + * @returns {string} The value, stringified. + */ +function stringifyValueForError(value, indentation) { + return value ? JSON.stringify(value, null, 4).replace(/\n/gu, `\n${" ".repeat(indentation)}`) : `${value}`; +} + +module.exports = { stringifyValueForError }; diff --git a/node_modules/eslint/messages/whitespace-found.js b/node_modules/eslint/messages/whitespace-found.js new file mode 100644 index 0000000..8a801bc --- /dev/null +++ b/node_modules/eslint/messages/whitespace-found.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function(it) { + const { pluginName } = it; + + return ` +ESLint couldn't find the plugin "${pluginName}". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name. + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. +`.trimStart(); +}; diff --git a/node_modules/eslint/package.json b/node_modules/eslint/package.json new file mode 100644 index 0000000..e25951b --- /dev/null +++ b/node_modules/eslint/package.json @@ -0,0 +1,221 @@ +{ + "name": "eslint", + "version": "9.21.0", + "author": "Nicholas C. Zakas ", + "description": "An AST-based pattern checker for JavaScript.", + "type": "commonjs", + "bin": { + "eslint": "./bin/eslint.js" + }, + "main": "./lib/api.js", + "types": "./lib/types/index.d.ts", + "exports": { + ".": { + "types": "./lib/types/index.d.ts", + "default": "./lib/api.js" + }, + "./package.json": "./package.json", + "./use-at-your-own-risk": { + "types": "./lib/types/use-at-your-own-risk.d.ts", + "default": "./lib/unsupported-api.js" + }, + "./rules": { + "types": "./lib/types/rules/index.d.ts" + }, + "./universal": { + "types": "./lib/types/universal.d.ts", + "default": "./lib/universal.js" + } + }, + "typesVersions": { + "*": { + "use-at-your-own-risk": [ + "./lib/types/use-at-your-own-risk.d.ts" + ], + "rules": [ + "./lib/types/rules/index.d.ts" + ], + "universal": [ + "./lib/types/universal.d.ts" + ] + } + }, + "scripts": { + "build:docs:update-links": "node tools/fetch-docs-links.js", + "build:site": "node Makefile.js gensite", + "build:webpack": "node Makefile.js webpack", + "build:readme": "node tools/update-readme.js", + "build:rules-index": "node Makefile.js generateRuleIndexPage", + "lint": "trunk check --no-fix --ignore=docs/**/*.js -a --filter=eslint && trunk check --no-fix --ignore=docs/**/*.js", + "lint:docs:js": "trunk check --no-fix --ignore=** --ignore=!docs/**/*.js -a --filter=eslint && trunk check --no-fix --ignore=** --ignore=!docs/**/*.js", + "lint:docs:rule-examples": "node Makefile.js checkRuleExamples", + "lint:unused": "knip", + "lint:fix": "trunk check -y --ignore=docs/**/*.js -a --filter=eslint && trunk check -y --ignore=docs/**/*.js", + "lint:fix:docs:js": "trunk check -y --ignore=** --ignore=!docs/**/*.js -a --flter=eslint && trunk check -y --ignore=** --ignore=!docs/**/*.js", + "lint:rule-types": "node tools/update-rule-type-headers.js --check", + "lint:types": "attw --pack", + "release:generate:alpha": "node Makefile.js generatePrerelease -- alpha", + "release:generate:beta": "node Makefile.js generatePrerelease -- beta", + "release:generate:latest": "node Makefile.js generateRelease -- latest", + "release:generate:maintenance": "node Makefile.js generateRelease -- maintenance", + "release:generate:rc": "node Makefile.js generatePrerelease -- rc", + "release:publish": "node Makefile.js publishRelease", + "test": "node Makefile.js test", + "test:browser": "node Makefile.js wdio", + "test:cli": "mocha", + "test:fuzz": "node Makefile.js fuzz", + "test:performance": "node Makefile.js perf", + "test:emfile": "node tools/check-emfile-handling.js", + "test:types": "tsc -p tests/lib/types/tsconfig.json" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.js": "trunk check --fix --filter=eslint", + "*.md": "trunk check --fix --filter=markdownlint", + "lib/rules/*.js": [ + "node tools/update-eslint-all.js", + "node tools/update-rule-type-headers.js", + "git add packages/js/src/configs/eslint-all.js \"lib/types/rules/*.ts\"" + ], + "docs/src/rules/*.md": [ + "node tools/check-rule-examples.js", + "node tools/fetch-docs-links.js", + "git add docs/src/_data/further_reading_links.json" + ], + "docs/**/*.svg": "trunk check --fix --filter=svgo" + }, + "files": [ + "LICENSE", + "README.md", + "bin", + "conf", + "lib", + "messages" + ], + "repository": "eslint/eslint", + "funding": "https://eslint.org/donate", + "homepage": "https://eslint.org", + "bugs": "https://github.com/eslint/eslint/issues/", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "9.21.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.0", + "@babel/core": "^7.4.3", + "@babel/preset-env": "^7.4.3", + "@eslint/json": "^0.10.0", + "@trunkio/launcher": "^1.3.0", + "@types/node": "^20.11.5", + "@typescript-eslint/parser": "^8.4.0", + "@wdio/browser-runner": "^9.2.4", + "@wdio/cli": "^9.2.4", + "@wdio/concise-reporter": "^9.2.2", + "@wdio/mocha-framework": "^9.2.2", + "babel-loader": "^8.0.5", + "c8": "^7.12.0", + "chai": "^4.0.1", + "cheerio": "^0.22.0", + "common-tags": "^1.8.0", + "core-js": "^3.1.3", + "ejs": "^3.0.2", + "eslint": "file:.", + "eslint-config-eslint": "file:packages/eslint-config-eslint", + "eslint-plugin-eslint-plugin": "^6.0.0", + "eslint-plugin-expect-type": "^0.6.0", + "eslint-plugin-yml": "^1.14.0", + "eslint-release": "^3.3.0", + "eslint-rule-composer": "^0.3.0", + "eslump": "^3.0.0", + "esprima": "^4.0.1", + "fast-glob": "^3.2.11", + "fs-teardown": "^0.1.3", + "glob": "^10.0.0", + "globals": "^15.0.0", + "got": "^11.8.3", + "gray-matter": "^4.0.3", + "jiti": "^2.1.0", + "knip": "^5.32.0", + "lint-staged": "^11.0.0", + "load-perf": "^0.2.0", + "markdown-it": "^12.2.0", + "markdown-it-container": "^3.0.0", + "marked": "^4.0.8", + "metascraper": "^5.25.7", + "metascraper-description": "^5.25.7", + "metascraper-image": "^5.29.3", + "metascraper-logo": "^5.25.7", + "metascraper-logo-favicon": "^5.25.7", + "metascraper-title": "^5.25.7", + "mocha": "^10.7.3", + "node-polyfill-webpack-plugin": "^1.0.3", + "npm-license": "^0.3.3", + "pirates": "^4.0.5", + "progress": "^2.0.3", + "proxyquire": "^2.0.1", + "recast": "^0.23.0", + "regenerator-runtime": "^0.14.0", + "rollup-plugin-node-polyfills": "^0.2.1", + "semver": "^7.5.3", + "shelljs": "^0.8.5", + "sinon": "^11.0.0", + "typescript": "^5.3.3", + "vite-plugin-commonjs": "^0.10.0", + "webpack": "^5.23.0", + "webpack-cli": "^4.5.0", + "yorkie": "^2.0.0" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + }, + "keywords": [ + "ast", + "lint", + "javascript", + "ecmascript", + "espree" + ], + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } +} diff --git a/node_modules/espree/LICENSE b/node_modules/espree/LICENSE new file mode 100644 index 0000000..b18469f --- /dev/null +++ b/node_modules/espree/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) Open JS Foundation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/espree/README.md b/node_modules/espree/README.md new file mode 100644 index 0000000..b971ea5 --- /dev/null +++ b/node_modules/espree/README.md @@ -0,0 +1,261 @@ +[![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree) +[![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree) +[![Build Status](https://github.com/eslint/js/workflows/CI/badge.svg)](https://github.com/js/espree/actions) +[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE) + +# Espree + +Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of [Acorn](https://github.com/ternjs/acorn), which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima. + +## Usage + +Install: + +``` +npm i espree +``` + +To use in an ESM file: + +```js +import * as espree from "espree"; + +const ast = espree.parse(code); +``` + +To use in a Common JS file: + +```js +const espree = require("espree"); + +const ast = espree.parse(code); +``` + +## API + +### `parse()` + +`parse` parses the given code and returns a abstract syntax tree (AST). It takes two parameters. + +- `code` [string]() - the code which needs to be parsed. +- `options (Optional)` [Object]() - read more about this [here](#options). + +```js +import * as espree from "espree"; + +const ast = espree.parse(code); +``` + +**Example :** + +```js +const ast = espree.parse('let foo = "bar"', { ecmaVersion: 6 }); +console.log(ast); +``` + +
Output +

+ +``` +Node { + type: 'Program', + start: 0, + end: 15, + body: [ + Node { + type: 'VariableDeclaration', + start: 0, + end: 15, + declarations: [Array], + kind: 'let' + } + ], + sourceType: 'script' +} +``` + +

+
+ +### `tokenize()` + +`tokenize` returns the tokens of a given code. It takes two parameters. + +- `code` [string]() - the code which needs to be parsed. +- `options (Optional)` [Object]() - read more about this [here](#options). + +Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array + +**Example :** + +```js +import * as espree from "espree"; + +const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 }); +console.log(tokens); +``` + +
Output +

+ +``` +Token { type: 'Keyword', value: 'let', start: 0, end: 3 }, +Token { type: 'Identifier', value: 'foo', start: 4, end: 7 }, +Token { type: 'Punctuator', value: '=', start: 8, end: 9 }, +Token { type: 'String', value: '"bar"', start: 10, end: 15 } +``` + +

+
+ +### `version` + +Returns the current `espree` version + +### `VisitorKeys` + +Returns all visitor keys for traversing the AST from [eslint-visitor-keys](https://github.com/eslint/js/tree/main/packages/eslint-visitor-keys) + +### `latestEcmaVersion` + +Returns the latest ECMAScript supported by `espree` + +### `supportedEcmaVersions` + +Returns an array of all supported ECMAScript versions + +## Options + +```js +const options = { + // attach range information to each node + range: false, + + // attach line/column location information to each node + loc: false, + + // create a top-level comments array containing all comments + comment: false, + + // create a top-level tokens array containing all tokens + tokens: false, + + // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 or 16 to specify the version of ECMAScript syntax you want to use. + // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14), 2024 (same as 15) or 2025 (same as 16) to use the year-based naming. + // You can also set "latest" to use the most recently supported version. + ecmaVersion: 3, + + allowReserved: true, // only allowed when ecmaVersion is 3 + + // specify which type of script you're parsing ("script", "module", or "commonjs") + sourceType: "script", + + // specify additional language features + ecmaFeatures: { + + // enable JSX parsing + jsx: false, + + // enable return in global scope (set to true automatically when sourceType is "commonjs") + globalReturn: false, + + // enable implied strict mode (if ecmaVersion >= 5) + impliedStrict: false + } +} +``` + +## Esprima Compatibility Going Forward + +The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the [ESTree](https://github.com/estree/estree) API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same. + +Espree may also deviate from Esprima in the interface it exposes. + +## Contributing + +Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/js/issues). + +Espree is licensed under a permissive BSD 2-clause license. + +## Security Policy + +We work hard to ensure that Espree is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). + +## Build Commands + +* `npm test` - run all tests +* `npm run lint` - run all linting + +## Differences from Espree 2.x + +* The `tokenize()` method does not use `ecmaFeatures`. Any string will be tokenized completely based on ECMAScript 6 semantics. +* Trailing whitespace no longer is counted as part of a node. +* `let` and `const` declarations are no longer parsed by default. You must opt-in by using an `ecmaVersion` newer than `5` or setting `sourceType` to `module`. +* The `esparse` and `esvalidate` binary scripts have been removed. +* There is no `tolerant` option. We will investigate adding this back in the future. + +## Known Incompatibilities + +In an effort to help those wanting to transition from other parsers to Espree, the following is a list of noteworthy incompatibilities with other parsers. These are known differences that we do not intend to change. + +### Esprima 1.2.2 + +* Esprima counts trailing whitespace as part of each AST node while Espree does not. In Espree, the end of a node is where the last token occurs. +* Espree does not parse `let` and `const` declarations by default. +* Error messages returned for parsing errors are different. +* There are two addition properties on every node and token: `start` and `end`. These represent the same data as `range` and are used internally by Acorn. + +### Esprima 2.x + +* Esprima 2.x uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2. + +## Frequently Asked Questions + +### Why another parser + +[ESLint](http://eslint.org) had been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development increased dramatically and Esprima had fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that caused our users frustration. + +We decided the only way for us to move forward was to create our own parser, bringing us inline with JSHint and JSLint, and allowing us to keep implementing new features as we need them. We chose to fork Esprima instead of starting from scratch in order to move as quickly as possible with a compatible API. + +With Espree 2.0.0, we are no longer a fork of Esprima but rather a translation layer between Acorn and Esprima syntax. This allows us to put work back into a community-supported parser (Acorn) that is continuing to grow and evolve while maintaining an Esprima-compatible parser for those utilities still built on Esprima. + +### Have you tried working with Esprima? + +Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima and will continue to do so. However, there are some different philosophies around how the projects work that need to be worked through. The initial goal was to have Espree track Esprima and eventually merge the two back together, but we ultimately decided that building on top of Acorn was a better choice due to Acorn's plugin support. + +### Why don't you just use Acorn? + +Acorn is a great JavaScript parser that produces an AST that is compatible with Esprima. Unfortunately, ESLint relies on more than just the AST to do its job. It relies on Esprima's tokens and comment attachment features to get a complete picture of the source code. We investigated switching to Acorn, but the inconsistencies between Esprima and Acorn created too much work for a project like ESLint. + +We are building on top of Acorn, however, so that we can contribute back and help make Acorn even better. + +### What ECMAScript features do you support? + +Espree supports all ECMAScript 2024 features and partially supports ECMAScript 2025 features. + +Because ECMAScript 2025 is still under development, we are implementing features as they are finalized. Currently, Espree supports: + +* [RegExp Duplicate named capturing groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups) + +See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized. + +### How do you determine which experimental features to support? + +In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features. + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

trunk.io

Silver Sponsors

+

JetBrains Liftoff American Express Workleap

Bronze Sponsors

+

WordHint Anagram Solver Icons8 Discord GitBook Nx HeroCoders

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/node_modules/espree/dist/espree.cjs b/node_modules/espree/dist/espree.cjs new file mode 100644 index 0000000..c944a21 --- /dev/null +++ b/node_modules/espree/dist/espree.cjs @@ -0,0 +1,939 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var acorn = require('acorn'); +var jsx = require('acorn-jsx'); +var visitorKeys = require('eslint-visitor-keys'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n["default"] = e; + return Object.freeze(n); +} + +var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn); +var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx); +var visitorKeys__namespace = /*#__PURE__*/_interopNamespace(visitorKeys); + +/** + * @fileoverview Translates tokens between Acorn format and Esprima format. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + + +// Esprima Token Types +const Token = { + Boolean: "Boolean", + EOF: "", + Identifier: "Identifier", + PrivateIdentifier: "PrivateIdentifier", + Keyword: "Keyword", + Null: "Null", + Numeric: "Numeric", + Punctuator: "Punctuator", + String: "String", + RegularExpression: "RegularExpression", + Template: "Template", + JSXIdentifier: "JSXIdentifier", + JSXText: "JSXText" +}; + +/** + * Converts part of a template into an Esprima token. + * @param {AcornToken[]} tokens The Acorn tokens representing the template. + * @param {string} code The source code. + * @returns {EsprimaToken} The Esprima equivalent of the template token. + * @private + */ +function convertTemplatePart(tokens, code) { + const firstToken = tokens[0], + lastTemplateToken = tokens.at(-1); + + const token = { + type: Token.Template, + value: code.slice(firstToken.start, lastTemplateToken.end) + }; + + if (firstToken.loc) { + token.loc = { + start: firstToken.loc.start, + end: lastTemplateToken.loc.end + }; + } + + if (firstToken.range) { + token.start = firstToken.range[0]; + token.end = lastTemplateToken.range[1]; + token.range = [token.start, token.end]; + } + + return token; +} + +/** + * Contains logic to translate Acorn tokens into Esprima tokens. + * @param {Object} acornTokTypes The Acorn token types. + * @param {string} code The source code Acorn is parsing. This is necessary + * to correct the "value" property of some tokens. + * @constructor + */ +function TokenTranslator(acornTokTypes, code) { + + // token types + this._acornTokTypes = acornTokTypes; + + // token buffer for templates + this._tokens = []; + + // track the last curly brace + this._curlyBrace = null; + + // the source code + this._code = code; + +} + +TokenTranslator.prototype = { + constructor: TokenTranslator, + + /** + * Translates a single Esprima token to a single Acorn token. This may be + * inaccurate due to how templates are handled differently in Esprima and + * Acorn, but should be accurate for all other tokens. + * @param {AcornToken} token The Acorn token to translate. + * @param {Object} extra Espree extra object. + * @returns {EsprimaToken} The Esprima version of the token. + */ + translate(token, extra) { + + const type = token.type, + tt = this._acornTokTypes; + + if (type === tt.name) { + token.type = Token.Identifier; + + // TODO: See if this is an Acorn bug + if (token.value === "static") { + token.type = Token.Keyword; + } + + if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { + token.type = Token.Keyword; + } + + } else if (type === tt.privateId) { + token.type = Token.PrivateIdentifier; + + } else if (type === tt.semi || type === tt.comma || + type === tt.parenL || type === tt.parenR || + type === tt.braceL || type === tt.braceR || + type === tt.dot || type === tt.bracketL || + type === tt.colon || type === tt.question || + type === tt.bracketR || type === tt.ellipsis || + type === tt.arrow || type === tt.jsxTagStart || + type === tt.incDec || type === tt.starstar || + type === tt.jsxTagEnd || type === tt.prefix || + type === tt.questionDot || + (type.binop && !type.keyword) || + type.isAssign) { + + token.type = Token.Punctuator; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.jsxName) { + token.type = Token.JSXIdentifier; + } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { + token.type = Token.JSXText; + } else if (type.keyword) { + if (type.keyword === "true" || type.keyword === "false") { + token.type = Token.Boolean; + } else if (type.keyword === "null") { + token.type = Token.Null; + } else { + token.type = Token.Keyword; + } + } else if (type === tt.num) { + token.type = Token.Numeric; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.string) { + + if (extra.jsxAttrValueToken) { + extra.jsxAttrValueToken = false; + token.type = Token.JSXText; + } else { + token.type = Token.String; + } + + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.regexp) { + token.type = Token.RegularExpression; + const value = token.value; + + token.regex = { + flags: value.flags, + pattern: value.pattern + }; + token.value = `/${value.pattern}/${value.flags}`; + } + + return token; + }, + + /** + * Function to call during Acorn's onToken handler. + * @param {AcornToken} token The Acorn token. + * @param {Object} extra The Espree extra object. + * @returns {void} + */ + onToken(token, extra) { + + const tt = this._acornTokTypes, + tokens = extra.tokens, + templateTokens = this._tokens; + + /** + * Flushes the buffered template tokens and resets the template + * tracking. + * @returns {void} + * @private + */ + const translateTemplateTokens = () => { + tokens.push(convertTemplatePart(this._tokens, this._code)); + this._tokens = []; + }; + + if (token.type === tt.eof) { + + // might be one last curlyBrace + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + return; + } + + if (token.type === tt.backQuote) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + templateTokens.push(token); + + // it's the end + if (templateTokens.length > 1) { + translateTemplateTokens(); + } + + return; + } + if (token.type === tt.dollarBraceL) { + templateTokens.push(token); + translateTemplateTokens(); + return; + } + if (token.type === tt.braceR) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + // store new curly for later + this._curlyBrace = token; + return; + } + if (token.type === tt.template || token.type === tt.invalidTemplate) { + if (this._curlyBrace) { + templateTokens.push(this._curlyBrace); + this._curlyBrace = null; + } + + templateTokens.push(token); + return; + } + + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + tokens.push(this.translate(token, extra)); + } +}; + +/** + * @fileoverview A collection of methods for processing Espree's options. + * @author Kai Cataldo + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SUPPORTED_VERSIONS = [ + 3, + 5, + 6, // 2015 + 7, // 2016 + 8, // 2017 + 9, // 2018 + 10, // 2019 + 11, // 2020 + 12, // 2021 + 13, // 2022 + 14, // 2023 + 15, // 2024 + 16 // 2025 +]; + +/** + * Get the latest ECMAScript version supported by Espree. + * @returns {number} The latest ECMAScript version. + */ +function getLatestEcmaVersion() { + return SUPPORTED_VERSIONS.at(-1); +} + +/** + * Get the list of ECMAScript versions supported by Espree. + * @returns {number[]} An array containing the supported ECMAScript versions. + */ +function getSupportedEcmaVersions() { + return [...SUPPORTED_VERSIONS]; +} + +/** + * Normalize ECMAScript version from the initial config + * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config + * @throws {Error} throws an error if the ecmaVersion is invalid. + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(ecmaVersion = 5) { + + let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion; + + if (typeof version !== "number") { + throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`); + } + + // Calculate ECMAScript edition number from official year version starting with + // ES2015, which corresponds with ES6 (or a difference of 2009). + if (version >= 2015) { + version -= 2009; + } + + if (!SUPPORTED_VERSIONS.includes(version)) { + throw new Error("Invalid ecmaVersion."); + } + + return version; +} + +/** + * Normalize sourceType from the initial config + * @param {string} sourceType to normalize + * @throws {Error} throw an error if sourceType is invalid + * @returns {string} normalized sourceType + */ +function normalizeSourceType(sourceType = "script") { + if (sourceType === "script" || sourceType === "module") { + return sourceType; + } + + if (sourceType === "commonjs") { + return "script"; + } + + throw new Error("Invalid sourceType."); +} + +/** + * Normalize parserOptions + * @param {Object} options the parser options to normalize + * @throws {Error} throw an error if found invalid option. + * @returns {Object} normalized options + */ +function normalizeOptions(options) { + const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); + const sourceType = normalizeSourceType(options.sourceType); + const ranges = options.range === true; + const locations = options.loc === true; + + if (ecmaVersion !== 3 && options.allowReserved) { + + // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed + throw new Error("`allowReserved` is only supported when ecmaVersion is 3"); + } + if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") { + throw new Error("`allowReserved`, when present, must be `true` or `false`"); + } + const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false; + const ecmaFeatures = options.ecmaFeatures || {}; + const allowReturnOutsideFunction = options.sourceType === "commonjs" || + Boolean(ecmaFeatures.globalReturn); + + if (sourceType === "module" && ecmaVersion < 6) { + throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); + } + + return Object.assign({}, options, { + ecmaVersion, + sourceType, + ranges, + locations, + allowReserved, + allowReturnOutsideFunction + }); +} + +/* eslint no-param-reassign: 0 -- stylistic choice */ + + +const STATE = Symbol("espree's internal state"); +const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); + + +/** + * Converts an Acorn comment to a Esprima comment. + * @param {boolean} block True if it's a block comment, false if not. + * @param {string} text The text of the comment. + * @param {int} start The index at which the comment starts. + * @param {int} end The index at which the comment ends. + * @param {Location} startLoc The location at which the comment starts. + * @param {Location} endLoc The location at which the comment ends. + * @param {string} code The source code being parsed. + * @returns {Object} The comment object. + * @private + */ +function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) { + let type; + + if (block) { + type = "Block"; + } else if (code.slice(start, start + 2) === "#!") { + type = "Hashbang"; + } else { + type = "Line"; + } + + const comment = { + type, + value: text + }; + + if (typeof start === "number") { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + + if (typeof startLoc === "object") { + comment.loc = { + start: startLoc, + end: endLoc + }; + } + + return comment; +} + +var espree = () => Parser => { + const tokTypes = Object.assign({}, Parser.acorn.tokTypes); + + if (Parser.acornJsx) { + Object.assign(tokTypes, Parser.acornJsx.tokTypes); + } + + return class Espree extends Parser { + constructor(opts, code) { + if (typeof opts !== "object" || opts === null) { + opts = {}; + } + if (typeof code !== "string" && !(code instanceof String)) { + code = String(code); + } + + // save original source type in case of commonjs + const originalSourceType = opts.sourceType; + const options = normalizeOptions(opts); + const ecmaFeatures = options.ecmaFeatures || {}; + const tokenTranslator = + options.tokens === true + ? new TokenTranslator(tokTypes, code) + : null; + + /* + * Data that is unique to Espree and is not represented internally + * in Acorn. + * + * For ES2023 hashbangs, Espree will call `onComment()` during the + * constructor, so we must define state before having access to + * `this`. + */ + const state = { + originalSourceType: originalSourceType || options.sourceType, + tokens: tokenTranslator ? [] : null, + comments: options.comment === true ? [] : null, + impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5, + ecmaVersion: options.ecmaVersion, + jsxAttrValueToken: false, + lastToken: null, + templateElements: [] + }; + + // Initialize acorn parser. + super({ + + // do not use spread, because we don't want to pass any unknown options to acorn + ecmaVersion: options.ecmaVersion, + sourceType: options.sourceType, + ranges: options.ranges, + locations: options.locations, + allowReserved: options.allowReserved, + + // Truthy value is true for backward compatibility. + allowReturnOutsideFunction: options.allowReturnOutsideFunction, + + // Collect tokens + onToken(token) { + if (tokenTranslator) { + + // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. + tokenTranslator.onToken(token, state); + } + if (token.type !== tokTypes.eof) { + state.lastToken = token; + } + }, + + // Collect comments + onComment(block, text, start, end, startLoc, endLoc) { + if (state.comments) { + const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code); + + state.comments.push(comment); + } + } + }, code); + + /* + * We put all of this data into a symbol property as a way to avoid + * potential naming conflicts with future versions of Acorn. + */ + this[STATE] = state; + } + + tokenize() { + do { + this.next(); + } while (this.type !== tokTypes.eof); + + // Consume the final eof token + this.next(); + + const extra = this[STATE]; + const tokens = extra.tokens; + + if (extra.comments) { + tokens.comments = extra.comments; + } + + return tokens; + } + + finishNode(...args) { + const result = super.finishNode(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + finishNodeAt(...args) { + const result = super.finishNodeAt(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + parse() { + const extra = this[STATE]; + const program = super.parse(); + + program.sourceType = extra.originalSourceType; + + if (extra.comments) { + program.comments = extra.comments; + } + if (extra.tokens) { + program.tokens = extra.tokens; + } + + /* + * Adjust opening and closing position of program to match Esprima. + * Acorn always starts programs at range 0 whereas Esprima starts at the + * first AST node's start (the only real difference is when there's leading + * whitespace or leading comments). Acorn also counts trailing whitespace + * as part of the program whereas Esprima only counts up to the last token. + */ + if (program.body.length) { + const [firstNode] = program.body; + + if (program.range) { + program.range[0] = firstNode.range[0]; + } + if (program.loc) { + program.loc.start = firstNode.loc.start; + } + program.start = firstNode.start; + } + if (extra.lastToken) { + if (program.range) { + program.range[1] = extra.lastToken.range[1]; + } + if (program.loc) { + program.loc.end = extra.lastToken.loc.end; + } + program.end = extra.lastToken.end; + } + + + /* + * https://github.com/eslint/espree/issues/349 + * Ensure that template elements have correct range information. + * This is one location where Acorn produces a different value + * for its start and end properties vs. the values present in the + * range property. In order to avoid confusion, we set the start + * and end properties to the values that are present in range. + * This is done here, instead of in finishNode(), because Acorn + * uses the values of start and end internally while parsing, making + * it dangerous to change those values while parsing is ongoing. + * By waiting until the end of parsing, we can safely change these + * values without affect any other part of the process. + */ + this[STATE].templateElements.forEach(templateElement => { + const startOffset = -1; + const endOffset = templateElement.tail ? 1 : 2; + + templateElement.start += startOffset; + templateElement.end += endOffset; + + if (templateElement.range) { + templateElement.range[0] += startOffset; + templateElement.range[1] += endOffset; + } + + if (templateElement.loc) { + templateElement.loc.start.column += startOffset; + templateElement.loc.end.column += endOffset; + } + }); + + return program; + } + + parseTopLevel(node) { + if (this[STATE].impliedStrict) { + this.strict = true; + } + return super.parseTopLevel(node); + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raise(pos, message) { + const loc = Parser.acorn.getLineInfo(this.input, pos); + const err = new SyntaxError(message); + + err.index = pos; + err.lineNumber = loc.line; + err.column = loc.column + 1; // acorn uses 0-based columns + throw err; + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raiseRecoverable(pos, message) { + this.raise(pos, message); + } + + /** + * Overwrites the default unexpected method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + unexpected(pos) { + let message = "Unexpected token"; + + if (pos !== null && pos !== void 0) { + this.pos = pos; + + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; + } + } + + this.nextToken(); + } + + if (this.end > this.start) { + message += ` ${this.input.slice(this.start, this.end)}`; + } + + this.raise(this.start, message); + } + + /* + * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX + * uses regular tt.string without any distinction between this and regular JS + * strings. As such, we intercept an attempt to read a JSX string and set a flag + * on extra so that when tokens are converted, the next token will be switched + * to JSXText via onToken. + */ + jsx_readString(quote) { // eslint-disable-line camelcase -- required by API + const result = super.jsx_readString(quote); + + if (this.type === tokTypes.string) { + this[STATE].jsxAttrValueToken = true; + } + return result; + } + + /** + * Performs last-minute Esprima-specific compatibility checks and fixes. + * @param {ASTNode} result The node to check. + * @returns {ASTNode} The finished node. + */ + [ESPRIMA_FINISH_NODE](result) { + + // Acorn doesn't count the opening and closing backticks as part of templates + // so we have to adjust ranges/locations appropriately. + if (result.type === "TemplateElement") { + + // save template element references to fix start/end later + this[STATE].templateElements.push(result); + } + + if (result.type.includes("Function") && !result.generator) { + result.generator = false; + } + + return result; + } + }; +}; + +const version$1 = "10.3.0"; + +/** + * @fileoverview Main Espree file that converts Acorn into Esprima output. + * + * This file contains code from the following MIT-licensed projects: + * 1. Acorn + * 2. Babylon + * 3. Babel-ESLint + * + * This file also contains code from Esprima, which is BSD licensed. + * + * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS) + * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS) + * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +// To initialize lazily. +const parsers = { + _regular: null, + _jsx: null, + + get regular() { + if (this._regular === null) { + this._regular = acorn__namespace.Parser.extend(espree()); + } + return this._regular; + }, + + get jsx() { + if (this._jsx === null) { + this._jsx = acorn__namespace.Parser.extend(jsx__default["default"](), espree()); + } + return this._jsx; + }, + + get(options) { + const useJsx = Boolean( + options && + options.ecmaFeatures && + options.ecmaFeatures.jsx + ); + + return useJsx ? this.jsx : this.regular; + } +}; + +//------------------------------------------------------------------------------ +// Tokenizer +//------------------------------------------------------------------------------ + +/** + * Tokenizes the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {Token[]} An array of tokens. + * @throws {SyntaxError} If the input code is invalid. + * @private + */ +function tokenize(code, options) { + const Parser = parsers.get(options); + + // Ensure to collect tokens. + if (!options || options.tokens !== true) { + options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice + } + + return new Parser(options, code).tokenize(); +} + +//------------------------------------------------------------------------------ +// Parser +//------------------------------------------------------------------------------ + +/** + * Parses the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {ASTNode} The "Program" AST node. + * @throws {SyntaxError} If the input code is invalid. + */ +function parse(code, options) { + const Parser = parsers.get(options); + + return new Parser(options, code).parse(); +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +const version = version$1; +const name = "espree"; + +/* istanbul ignore next */ +const VisitorKeys = (function() { + return visitorKeys__namespace.KEYS; +}()); + +// Derive node types from VisitorKeys +/* istanbul ignore next */ +const Syntax = (function() { + let key, + types = {}; + + if (typeof Object.create === "function") { + types = Object.create(null); + } + + for (key in VisitorKeys) { + if (Object.hasOwn(VisitorKeys, key)) { + types[key] = key; + } + } + + if (typeof Object.freeze === "function") { + Object.freeze(types); + } + + return types; +}()); + +const latestEcmaVersion = getLatestEcmaVersion(); + +const supportedEcmaVersions = getSupportedEcmaVersions(); + +exports.Syntax = Syntax; +exports.VisitorKeys = VisitorKeys; +exports.latestEcmaVersion = latestEcmaVersion; +exports.name = name; +exports.parse = parse; +exports.supportedEcmaVersions = supportedEcmaVersions; +exports.tokenize = tokenize; +exports.version = version; diff --git a/node_modules/espree/espree.js b/node_modules/espree/espree.js new file mode 100644 index 0000000..15e0ce5 --- /dev/null +++ b/node_modules/espree/espree.js @@ -0,0 +1,174 @@ +/** + * @fileoverview Main Espree file that converts Acorn into Esprima output. + * + * This file contains code from the following MIT-licensed projects: + * 1. Acorn + * 2. Babylon + * 3. Babel-ESLint + * + * This file also contains code from Esprima, which is BSD licensed. + * + * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS) + * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS) + * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +import * as acorn from "acorn"; +import jsx from "acorn-jsx"; +import espree from "./lib/espree.js"; +import espreeVersion from "./lib/version.js"; +import * as visitorKeys from "eslint-visitor-keys"; +import { getLatestEcmaVersion, getSupportedEcmaVersions } from "./lib/options.js"; + + +// To initialize lazily. +const parsers = { + _regular: null, + _jsx: null, + + get regular() { + if (this._regular === null) { + this._regular = acorn.Parser.extend(espree()); + } + return this._regular; + }, + + get jsx() { + if (this._jsx === null) { + this._jsx = acorn.Parser.extend(jsx(), espree()); + } + return this._jsx; + }, + + get(options) { + const useJsx = Boolean( + options && + options.ecmaFeatures && + options.ecmaFeatures.jsx + ); + + return useJsx ? this.jsx : this.regular; + } +}; + +//------------------------------------------------------------------------------ +// Tokenizer +//------------------------------------------------------------------------------ + +/** + * Tokenizes the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {Token[]} An array of tokens. + * @throws {SyntaxError} If the input code is invalid. + * @private + */ +export function tokenize(code, options) { + const Parser = parsers.get(options); + + // Ensure to collect tokens. + if (!options || options.tokens !== true) { + options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice + } + + return new Parser(options, code).tokenize(); +} + +//------------------------------------------------------------------------------ +// Parser +//------------------------------------------------------------------------------ + +/** + * Parses the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {ASTNode} The "Program" AST node. + * @throws {SyntaxError} If the input code is invalid. + */ +export function parse(code, options) { + const Parser = parsers.get(options); + + return new Parser(options, code).parse(); +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +export const version = espreeVersion; +export const name = "espree"; + +/* istanbul ignore next */ +export const VisitorKeys = (function() { + return visitorKeys.KEYS; +}()); + +// Derive node types from VisitorKeys +/* istanbul ignore next */ +export const Syntax = (function() { + let key, + types = {}; + + if (typeof Object.create === "function") { + types = Object.create(null); + } + + for (key in VisitorKeys) { + if (Object.hasOwn(VisitorKeys, key)) { + types[key] = key; + } + } + + if (typeof Object.freeze === "function") { + Object.freeze(types); + } + + return types; +}()); + +export const latestEcmaVersion = getLatestEcmaVersion(); + +export const supportedEcmaVersions = getSupportedEcmaVersions(); diff --git a/node_modules/espree/lib/espree.js b/node_modules/espree/lib/espree.js new file mode 100644 index 0000000..2be1b56 --- /dev/null +++ b/node_modules/espree/lib/espree.js @@ -0,0 +1,349 @@ +/* eslint no-param-reassign: 0 -- stylistic choice */ + +import TokenTranslator from "./token-translator.js"; +import { normalizeOptions } from "./options.js"; + + +const STATE = Symbol("espree's internal state"); +const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); + + +/** + * Converts an Acorn comment to a Esprima comment. + * @param {boolean} block True if it's a block comment, false if not. + * @param {string} text The text of the comment. + * @param {int} start The index at which the comment starts. + * @param {int} end The index at which the comment ends. + * @param {Location} startLoc The location at which the comment starts. + * @param {Location} endLoc The location at which the comment ends. + * @param {string} code The source code being parsed. + * @returns {Object} The comment object. + * @private + */ +function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) { + let type; + + if (block) { + type = "Block"; + } else if (code.slice(start, start + 2) === "#!") { + type = "Hashbang"; + } else { + type = "Line"; + } + + const comment = { + type, + value: text + }; + + if (typeof start === "number") { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + + if (typeof startLoc === "object") { + comment.loc = { + start: startLoc, + end: endLoc + }; + } + + return comment; +} + +export default () => Parser => { + const tokTypes = Object.assign({}, Parser.acorn.tokTypes); + + if (Parser.acornJsx) { + Object.assign(tokTypes, Parser.acornJsx.tokTypes); + } + + return class Espree extends Parser { + constructor(opts, code) { + if (typeof opts !== "object" || opts === null) { + opts = {}; + } + if (typeof code !== "string" && !(code instanceof String)) { + code = String(code); + } + + // save original source type in case of commonjs + const originalSourceType = opts.sourceType; + const options = normalizeOptions(opts); + const ecmaFeatures = options.ecmaFeatures || {}; + const tokenTranslator = + options.tokens === true + ? new TokenTranslator(tokTypes, code) + : null; + + /* + * Data that is unique to Espree and is not represented internally + * in Acorn. + * + * For ES2023 hashbangs, Espree will call `onComment()` during the + * constructor, so we must define state before having access to + * `this`. + */ + const state = { + originalSourceType: originalSourceType || options.sourceType, + tokens: tokenTranslator ? [] : null, + comments: options.comment === true ? [] : null, + impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5, + ecmaVersion: options.ecmaVersion, + jsxAttrValueToken: false, + lastToken: null, + templateElements: [] + }; + + // Initialize acorn parser. + super({ + + // do not use spread, because we don't want to pass any unknown options to acorn + ecmaVersion: options.ecmaVersion, + sourceType: options.sourceType, + ranges: options.ranges, + locations: options.locations, + allowReserved: options.allowReserved, + + // Truthy value is true for backward compatibility. + allowReturnOutsideFunction: options.allowReturnOutsideFunction, + + // Collect tokens + onToken(token) { + if (tokenTranslator) { + + // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. + tokenTranslator.onToken(token, state); + } + if (token.type !== tokTypes.eof) { + state.lastToken = token; + } + }, + + // Collect comments + onComment(block, text, start, end, startLoc, endLoc) { + if (state.comments) { + const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code); + + state.comments.push(comment); + } + } + }, code); + + /* + * We put all of this data into a symbol property as a way to avoid + * potential naming conflicts with future versions of Acorn. + */ + this[STATE] = state; + } + + tokenize() { + do { + this.next(); + } while (this.type !== tokTypes.eof); + + // Consume the final eof token + this.next(); + + const extra = this[STATE]; + const tokens = extra.tokens; + + if (extra.comments) { + tokens.comments = extra.comments; + } + + return tokens; + } + + finishNode(...args) { + const result = super.finishNode(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + finishNodeAt(...args) { + const result = super.finishNodeAt(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + parse() { + const extra = this[STATE]; + const program = super.parse(); + + program.sourceType = extra.originalSourceType; + + if (extra.comments) { + program.comments = extra.comments; + } + if (extra.tokens) { + program.tokens = extra.tokens; + } + + /* + * Adjust opening and closing position of program to match Esprima. + * Acorn always starts programs at range 0 whereas Esprima starts at the + * first AST node's start (the only real difference is when there's leading + * whitespace or leading comments). Acorn also counts trailing whitespace + * as part of the program whereas Esprima only counts up to the last token. + */ + if (program.body.length) { + const [firstNode] = program.body; + + if (program.range) { + program.range[0] = firstNode.range[0]; + } + if (program.loc) { + program.loc.start = firstNode.loc.start; + } + program.start = firstNode.start; + } + if (extra.lastToken) { + if (program.range) { + program.range[1] = extra.lastToken.range[1]; + } + if (program.loc) { + program.loc.end = extra.lastToken.loc.end; + } + program.end = extra.lastToken.end; + } + + + /* + * https://github.com/eslint/espree/issues/349 + * Ensure that template elements have correct range information. + * This is one location where Acorn produces a different value + * for its start and end properties vs. the values present in the + * range property. In order to avoid confusion, we set the start + * and end properties to the values that are present in range. + * This is done here, instead of in finishNode(), because Acorn + * uses the values of start and end internally while parsing, making + * it dangerous to change those values while parsing is ongoing. + * By waiting until the end of parsing, we can safely change these + * values without affect any other part of the process. + */ + this[STATE].templateElements.forEach(templateElement => { + const startOffset = -1; + const endOffset = templateElement.tail ? 1 : 2; + + templateElement.start += startOffset; + templateElement.end += endOffset; + + if (templateElement.range) { + templateElement.range[0] += startOffset; + templateElement.range[1] += endOffset; + } + + if (templateElement.loc) { + templateElement.loc.start.column += startOffset; + templateElement.loc.end.column += endOffset; + } + }); + + return program; + } + + parseTopLevel(node) { + if (this[STATE].impliedStrict) { + this.strict = true; + } + return super.parseTopLevel(node); + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raise(pos, message) { + const loc = Parser.acorn.getLineInfo(this.input, pos); + const err = new SyntaxError(message); + + err.index = pos; + err.lineNumber = loc.line; + err.column = loc.column + 1; // acorn uses 0-based columns + throw err; + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raiseRecoverable(pos, message) { + this.raise(pos, message); + } + + /** + * Overwrites the default unexpected method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + unexpected(pos) { + let message = "Unexpected token"; + + if (pos !== null && pos !== void 0) { + this.pos = pos; + + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; + } + } + + this.nextToken(); + } + + if (this.end > this.start) { + message += ` ${this.input.slice(this.start, this.end)}`; + } + + this.raise(this.start, message); + } + + /* + * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX + * uses regular tt.string without any distinction between this and regular JS + * strings. As such, we intercept an attempt to read a JSX string and set a flag + * on extra so that when tokens are converted, the next token will be switched + * to JSXText via onToken. + */ + jsx_readString(quote) { // eslint-disable-line camelcase -- required by API + const result = super.jsx_readString(quote); + + if (this.type === tokTypes.string) { + this[STATE].jsxAttrValueToken = true; + } + return result; + } + + /** + * Performs last-minute Esprima-specific compatibility checks and fixes. + * @param {ASTNode} result The node to check. + * @returns {ASTNode} The finished node. + */ + [ESPRIMA_FINISH_NODE](result) { + + // Acorn doesn't count the opening and closing backticks as part of templates + // so we have to adjust ranges/locations appropriately. + if (result.type === "TemplateElement") { + + // save template element references to fix start/end later + this[STATE].templateElements.push(result); + } + + if (result.type.includes("Function") && !result.generator) { + result.generator = false; + } + + return result; + } + }; +}; diff --git a/node_modules/espree/lib/features.js b/node_modules/espree/lib/features.js new file mode 100644 index 0000000..31467d2 --- /dev/null +++ b/node_modules/espree/lib/features.js @@ -0,0 +1,27 @@ +/** + * @fileoverview The list of feature flags supported by the parser and their default + * settings. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +export default { + + // React JSX parsing + jsx: false, + + // allow return statement in global scope + globalReturn: false, + + // allow implied strict mode + impliedStrict: false +}; diff --git a/node_modules/espree/lib/options.js b/node_modules/espree/lib/options.js new file mode 100644 index 0000000..2cdfb68 --- /dev/null +++ b/node_modules/espree/lib/options.js @@ -0,0 +1,124 @@ +/** + * @fileoverview A collection of methods for processing Espree's options. + * @author Kai Cataldo + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SUPPORTED_VERSIONS = [ + 3, + 5, + 6, // 2015 + 7, // 2016 + 8, // 2017 + 9, // 2018 + 10, // 2019 + 11, // 2020 + 12, // 2021 + 13, // 2022 + 14, // 2023 + 15, // 2024 + 16 // 2025 +]; + +/** + * Get the latest ECMAScript version supported by Espree. + * @returns {number} The latest ECMAScript version. + */ +export function getLatestEcmaVersion() { + return SUPPORTED_VERSIONS.at(-1); +} + +/** + * Get the list of ECMAScript versions supported by Espree. + * @returns {number[]} An array containing the supported ECMAScript versions. + */ +export function getSupportedEcmaVersions() { + return [...SUPPORTED_VERSIONS]; +} + +/** + * Normalize ECMAScript version from the initial config + * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config + * @throws {Error} throws an error if the ecmaVersion is invalid. + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(ecmaVersion = 5) { + + let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion; + + if (typeof version !== "number") { + throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`); + } + + // Calculate ECMAScript edition number from official year version starting with + // ES2015, which corresponds with ES6 (or a difference of 2009). + if (version >= 2015) { + version -= 2009; + } + + if (!SUPPORTED_VERSIONS.includes(version)) { + throw new Error("Invalid ecmaVersion."); + } + + return version; +} + +/** + * Normalize sourceType from the initial config + * @param {string} sourceType to normalize + * @throws {Error} throw an error if sourceType is invalid + * @returns {string} normalized sourceType + */ +function normalizeSourceType(sourceType = "script") { + if (sourceType === "script" || sourceType === "module") { + return sourceType; + } + + if (sourceType === "commonjs") { + return "script"; + } + + throw new Error("Invalid sourceType."); +} + +/** + * Normalize parserOptions + * @param {Object} options the parser options to normalize + * @throws {Error} throw an error if found invalid option. + * @returns {Object} normalized options + */ +export function normalizeOptions(options) { + const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); + const sourceType = normalizeSourceType(options.sourceType); + const ranges = options.range === true; + const locations = options.loc === true; + + if (ecmaVersion !== 3 && options.allowReserved) { + + // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed + throw new Error("`allowReserved` is only supported when ecmaVersion is 3"); + } + if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") { + throw new Error("`allowReserved`, when present, must be `true` or `false`"); + } + const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false; + const ecmaFeatures = options.ecmaFeatures || {}; + const allowReturnOutsideFunction = options.sourceType === "commonjs" || + Boolean(ecmaFeatures.globalReturn); + + if (sourceType === "module" && ecmaVersion < 6) { + throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); + } + + return Object.assign({}, options, { + ecmaVersion, + sourceType, + ranges, + locations, + allowReserved, + allowReturnOutsideFunction + }); +} diff --git a/node_modules/espree/lib/token-translator.js b/node_modules/espree/lib/token-translator.js new file mode 100644 index 0000000..6daf865 --- /dev/null +++ b/node_modules/espree/lib/token-translator.js @@ -0,0 +1,263 @@ +/** + * @fileoverview Translates tokens between Acorn format and Esprima format. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + + +// Esprima Token Types +const Token = { + Boolean: "Boolean", + EOF: "", + Identifier: "Identifier", + PrivateIdentifier: "PrivateIdentifier", + Keyword: "Keyword", + Null: "Null", + Numeric: "Numeric", + Punctuator: "Punctuator", + String: "String", + RegularExpression: "RegularExpression", + Template: "Template", + JSXIdentifier: "JSXIdentifier", + JSXText: "JSXText" +}; + +/** + * Converts part of a template into an Esprima token. + * @param {AcornToken[]} tokens The Acorn tokens representing the template. + * @param {string} code The source code. + * @returns {EsprimaToken} The Esprima equivalent of the template token. + * @private + */ +function convertTemplatePart(tokens, code) { + const firstToken = tokens[0], + lastTemplateToken = tokens.at(-1); + + const token = { + type: Token.Template, + value: code.slice(firstToken.start, lastTemplateToken.end) + }; + + if (firstToken.loc) { + token.loc = { + start: firstToken.loc.start, + end: lastTemplateToken.loc.end + }; + } + + if (firstToken.range) { + token.start = firstToken.range[0]; + token.end = lastTemplateToken.range[1]; + token.range = [token.start, token.end]; + } + + return token; +} + +/** + * Contains logic to translate Acorn tokens into Esprima tokens. + * @param {Object} acornTokTypes The Acorn token types. + * @param {string} code The source code Acorn is parsing. This is necessary + * to correct the "value" property of some tokens. + * @constructor + */ +function TokenTranslator(acornTokTypes, code) { + + // token types + this._acornTokTypes = acornTokTypes; + + // token buffer for templates + this._tokens = []; + + // track the last curly brace + this._curlyBrace = null; + + // the source code + this._code = code; + +} + +TokenTranslator.prototype = { + constructor: TokenTranslator, + + /** + * Translates a single Esprima token to a single Acorn token. This may be + * inaccurate due to how templates are handled differently in Esprima and + * Acorn, but should be accurate for all other tokens. + * @param {AcornToken} token The Acorn token to translate. + * @param {Object} extra Espree extra object. + * @returns {EsprimaToken} The Esprima version of the token. + */ + translate(token, extra) { + + const type = token.type, + tt = this._acornTokTypes; + + if (type === tt.name) { + token.type = Token.Identifier; + + // TODO: See if this is an Acorn bug + if (token.value === "static") { + token.type = Token.Keyword; + } + + if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { + token.type = Token.Keyword; + } + + } else if (type === tt.privateId) { + token.type = Token.PrivateIdentifier; + + } else if (type === tt.semi || type === tt.comma || + type === tt.parenL || type === tt.parenR || + type === tt.braceL || type === tt.braceR || + type === tt.dot || type === tt.bracketL || + type === tt.colon || type === tt.question || + type === tt.bracketR || type === tt.ellipsis || + type === tt.arrow || type === tt.jsxTagStart || + type === tt.incDec || type === tt.starstar || + type === tt.jsxTagEnd || type === tt.prefix || + type === tt.questionDot || + (type.binop && !type.keyword) || + type.isAssign) { + + token.type = Token.Punctuator; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.jsxName) { + token.type = Token.JSXIdentifier; + } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { + token.type = Token.JSXText; + } else if (type.keyword) { + if (type.keyword === "true" || type.keyword === "false") { + token.type = Token.Boolean; + } else if (type.keyword === "null") { + token.type = Token.Null; + } else { + token.type = Token.Keyword; + } + } else if (type === tt.num) { + token.type = Token.Numeric; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.string) { + + if (extra.jsxAttrValueToken) { + extra.jsxAttrValueToken = false; + token.type = Token.JSXText; + } else { + token.type = Token.String; + } + + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.regexp) { + token.type = Token.RegularExpression; + const value = token.value; + + token.regex = { + flags: value.flags, + pattern: value.pattern + }; + token.value = `/${value.pattern}/${value.flags}`; + } + + return token; + }, + + /** + * Function to call during Acorn's onToken handler. + * @param {AcornToken} token The Acorn token. + * @param {Object} extra The Espree extra object. + * @returns {void} + */ + onToken(token, extra) { + + const tt = this._acornTokTypes, + tokens = extra.tokens, + templateTokens = this._tokens; + + /** + * Flushes the buffered template tokens and resets the template + * tracking. + * @returns {void} + * @private + */ + const translateTemplateTokens = () => { + tokens.push(convertTemplatePart(this._tokens, this._code)); + this._tokens = []; + }; + + if (token.type === tt.eof) { + + // might be one last curlyBrace + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + return; + } + + if (token.type === tt.backQuote) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + templateTokens.push(token); + + // it's the end + if (templateTokens.length > 1) { + translateTemplateTokens(); + } + + return; + } + if (token.type === tt.dollarBraceL) { + templateTokens.push(token); + translateTemplateTokens(); + return; + } + if (token.type === tt.braceR) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + // store new curly for later + this._curlyBrace = token; + return; + } + if (token.type === tt.template || token.type === tt.invalidTemplate) { + if (this._curlyBrace) { + templateTokens.push(this._curlyBrace); + this._curlyBrace = null; + } + + templateTokens.push(token); + return; + } + + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + tokens.push(this.translate(token, extra)); + } +}; + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +export default TokenTranslator; diff --git a/node_modules/espree/lib/version.js b/node_modules/espree/lib/version.js new file mode 100644 index 0000000..22a4206 --- /dev/null +++ b/node_modules/espree/lib/version.js @@ -0,0 +1,3 @@ +const version = "10.3.0"; + +export default version; diff --git a/node_modules/espree/package.json b/node_modules/espree/package.json new file mode 100644 index 0000000..ca08d88 --- /dev/null +++ b/node_modules/espree/package.json @@ -0,0 +1,75 @@ +{ + "name": "espree", + "description": "An Esprima-compatible JavaScript parser built on Acorn", + "author": "Nicholas C. Zakas ", + "homepage": "https://github.com/eslint/js/blob/main/packages/espree/README.md", + "main": "dist/espree.cjs", + "type": "module", + "exports": { + ".": [ + { + "import": "./espree.js", + "require": "./dist/espree.cjs", + "default": "./dist/espree.cjs" + }, + "./dist/espree.cjs" + ], + "./package.json": "./package.json" + }, + "version": "10.3.0", + "files": [ + "lib", + "dist/espree.cjs", + "espree.js" + ], + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": "eslint/js", + "bugs": { + "url": "https://github.com/eslint/js/issues" + }, + "funding": "https://opencollective.com/eslint", + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^28.0.0", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.3.0", + "c8": "^7.11.0", + "eslint-release": "^3.2.0", + "esprima-fb": "^8001.2001.0-dev-harmony-fb", + "mocha": "^9.2.2", + "npm-run-all2": "^6.2.2", + "rollup": "^2.79.1", + "shelljs": "^0.8.5" + }, + "keywords": [ + "ast", + "ecmascript", + "javascript", + "parser", + "syntax", + "acorn" + ], + "scripts": { + "build": "rollup -c rollup.config.js", + "build:debug": "npm run build -- -m", + "build:docs": "node tools/sync-docs.js", + "build:update-version": "node tools/update-version.js", + "prepublishOnly": "npm run build:update-version && npm run build", + "pretest": "npm run build", + "release:generate:latest": "eslint-generate-release", + "release:generate:alpha": "eslint-generate-prerelease alpha", + "release:generate:beta": "eslint-generate-prerelease beta", + "release:generate:rc": "eslint-generate-prerelease rc", + "release:publish": "eslint-publish-release", + "test": "npm-run-all -s test:*", + "test:cjs": "mocha --color --reporter progress --timeout 30000 tests/lib/commonjs.cjs", + "test:esm": "c8 mocha --color --reporter progress --timeout 30000 'tests/lib/**/*.js'" + } +} diff --git a/node_modules/esquery/README.md b/node_modules/esquery/README.md new file mode 100644 index 0000000..16809a7 --- /dev/null +++ b/node_modules/esquery/README.md @@ -0,0 +1,27 @@ +ESQuery is a library for querying the AST output by Esprima for patterns of syntax using a CSS style selector system. Check out the demo: + +[demo](https://estools.github.io/esquery/) + +The following selectors are supported: +* AST node type: `ForStatement` +* [wildcard](http://dev.w3.org/csswg/selectors4/#universal-selector): `*` +* [attribute existence](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr]` +* [attribute value](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr="foo"]` or `[attr=123]` +* attribute regex: `[attr=/foo.*/]` or (with flags) `[attr=/foo.*/is]` +* attribute conditions: `[attr!="foo"]`, `[attr>2]`, `[attr<3]`, `[attr>=2]`, or `[attr<=3]` +* nested attribute: `[attr.level2="foo"]` +* field: `FunctionDeclaration > Identifier.id` +* [First](http://dev.w3.org/csswg/selectors4/#the-first-child-pseudo) or [last](http://dev.w3.org/csswg/selectors4/#the-last-child-pseudo) child: `:first-child` or `:last-child` +* [nth-child](http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo) (no ax+b support): `:nth-child(2)` +* [nth-last-child](http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo) (no ax+b support): `:nth-last-child(1)` +* [descendant](http://dev.w3.org/csswg/selectors4/#descendant-combinators): `ancestor descendant` +* [child](http://dev.w3.org/csswg/selectors4/#child-combinators): `parent > child` +* [following sibling](http://dev.w3.org/csswg/selectors4/#general-sibling-combinators): `node ~ sibling` +* [adjacent sibling](http://dev.w3.org/csswg/selectors4/#adjacent-sibling-combinators): `node + adjacent` +* [negation](http://dev.w3.org/csswg/selectors4/#negation-pseudo): `:not(ForStatement)` +* [has](https://drafts.csswg.org/selectors-4/#has-pseudo): `:has(ForStatement)`, `:has(> ForStatement)` +* [matches-any](http://dev.w3.org/csswg/selectors4/#matches): `:matches([attr] > :first-child, :last-child)` +* [subject indicator](http://dev.w3.org/csswg/selectors4/#subject): `!IfStatement > [name="foo"]` +* class of AST node: `:statement`, `:expression`, `:declaration`, `:function`, or `:pattern` + +[![Build Status](https://travis-ci.org/estools/esquery.png?branch=master)](https://travis-ci.org/estools/esquery) diff --git a/node_modules/esquery/dist/esquery.esm.js b/node_modules/esquery/dist/esquery.esm.js new file mode 100644 index 0000000..61caaba --- /dev/null +++ b/node_modules/esquery/dist/esquery.esm.js @@ -0,0 +1,4172 @@ +function _iterableToArrayLimit(arr, i) { + var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; + if (null != _i) { + var _s, + _e, + _x, + _r, + _arr = [], + _n = !0, + _d = !1; + try { + if (_x = (_i = _i.call(arr)).next, 0 === i) { + if (Object(_i) !== _i) return; + _n = !1; + } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); + } catch (err) { + _d = !0, _e = err; + } finally { + try { + if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; + } finally { + if (_d) throw _e; + } + } + return _arr; + } +} +function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); +} +function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); +} +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); +} +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; +} +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var estraverse = createCommonjsModule(function (module, exports) { + /* + Copyright (C) 2012-2013 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + /*jslint vars:false, bitwise:true*/ + /*jshint indent:4*/ + /*global exports:true*/ + (function clone(exports) { + + var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE; + function deepCopy(obj) { + var ret = {}, + key, + val; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + val = obj[key]; + if (typeof val === 'object' && val !== null) { + ret[key] = deepCopy(val); + } else { + ret[key] = val; + } + } + } + return ret; + } + + // based on LLVM libc++ upper_bound / lower_bound + // MIT License + + function upperBound(array, func) { + var diff, len, i, current; + len = array.length; + i = 0; + while (len) { + diff = len >>> 1; + current = i + diff; + if (func(array[current])) { + len = diff; + } else { + i = current + 1; + len -= diff + 1; + } + } + return i; + } + Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', + // CAUTION: It's deferred to ES7. + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ChainExpression: 'ChainExpression', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ComprehensionBlock: 'ComprehensionBlock', + // CAUTION: It's deferred to ES7. + ComprehensionExpression: 'ComprehensionExpression', + // CAUTION: It's deferred to ES7. + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DirectiveStatement: 'DirectiveStatement', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GeneratorExpression: 'GeneratorExpression', + // CAUTION: It's deferred to ES7. + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + ModuleSpecifier: 'ModuleSpecifier', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + PrivateIdentifier: 'PrivateIdentifier', + Program: 'Program', + Property: 'Property', + PropertyDefinition: 'PropertyDefinition', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + VisitorKeys = { + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AwaitExpression: ['argument'], + // CAUTION: It's deferred to ES7. + BlockStatement: ['body'], + BinaryExpression: ['left', 'right'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ChainExpression: ['expression'], + ClassBody: ['body'], + ClassDeclaration: ['id', 'superClass', 'body'], + ClassExpression: ['id', 'superClass', 'body'], + ComprehensionBlock: ['left', 'right'], + // CAUTION: It's deferred to ES7. + ComprehensionExpression: ['blocks', 'filter', 'body'], + // CAUTION: It's deferred to ES7. + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['source'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], + ExportSpecifier: ['exported', 'local'], + ExpressionStatement: ['expression'], + ForStatement: ['init', 'test', 'update', 'body'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + GeneratorExpression: ['blocks', 'filter', 'body'], + // CAUTION: It's deferred to ES7. + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], + ImportDeclaration: ['specifiers', 'source'], + ImportDefaultSpecifier: ['local'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + Literal: [], + LabeledStatement: ['label', 'body'], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['key', 'value'], + ModuleSpecifier: [], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + PrivateIdentifier: [], + Program: ['body'], + Property: ['key', 'value'], + PropertyDefinition: ['key', 'value'], + RestElement: ['argument'], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + Super: [], + SwitchStatement: ['discriminant', 'cases'], + SwitchCase: ['test', 'consequent'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + WithStatement: ['object', 'body'], + YieldExpression: ['argument'] + }; + + // unique id + BREAK = {}; + SKIP = {}; + REMOVE = {}; + VisitorOption = { + Break: BREAK, + Skip: SKIP, + Remove: REMOVE + }; + function Reference(parent, key) { + this.parent = parent; + this.key = key; + } + Reference.prototype.replace = function replace(node) { + this.parent[this.key] = node; + }; + Reference.prototype.remove = function remove() { + if (Array.isArray(this.parent)) { + this.parent.splice(this.key, 1); + return true; + } else { + this.replace(null); + return false; + } + }; + function Element(node, path, wrap, ref) { + this.node = node; + this.path = path; + this.wrap = wrap; + this.ref = ref; + } + function Controller() {} + + // API: + // return property path array from root to current node + Controller.prototype.path = function path() { + var i, iz, j, jz, result, element; + function addToPath(result, path) { + if (Array.isArray(path)) { + for (j = 0, jz = path.length; j < jz; ++j) { + result.push(path[j]); + } + } else { + result.push(path); + } + } + + // root node + if (!this.__current.path) { + return null; + } + + // first node is sentinel, second node is root element + result = []; + for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { + element = this.__leavelist[i]; + addToPath(result, element.path); + } + addToPath(result, this.__current.path); + return result; + }; + + // API: + // return type of current node + Controller.prototype.type = function () { + var node = this.current(); + return node.type || this.__current.wrap; + }; + + // API: + // return array of parent elements + Controller.prototype.parents = function parents() { + var i, iz, result; + + // first node is sentinel + result = []; + for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { + result.push(this.__leavelist[i].node); + } + return result; + }; + + // API: + // return current node + Controller.prototype.current = function current() { + return this.__current.node; + }; + Controller.prototype.__execute = function __execute(callback, element) { + var previous, result; + result = undefined; + previous = this.__current; + this.__current = element; + this.__state = null; + if (callback) { + result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); + } + this.__current = previous; + return result; + }; + + // API: + // notify control skip / break + Controller.prototype.notify = function notify(flag) { + this.__state = flag; + }; + + // API: + // skip child nodes of current node + Controller.prototype.skip = function () { + this.notify(SKIP); + }; + + // API: + // break traversals + Controller.prototype['break'] = function () { + this.notify(BREAK); + }; + + // API: + // remove node + Controller.prototype.remove = function () { + this.notify(REMOVE); + }; + Controller.prototype.__initialize = function (root, visitor) { + this.visitor = visitor; + this.root = root; + this.__worklist = []; + this.__leavelist = []; + this.__current = null; + this.__state = null; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + this.__keys = VisitorKeys; + if (visitor.keys) { + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); + } + }; + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + function isProperty(nodeType, key) { + return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; + } + function candidateExistsInLeaveList(leavelist, candidate) { + for (var i = leavelist.length - 1; i >= 0; --i) { + if (leavelist[i].node === candidate) { + return true; + } + } + return false; + } + Controller.prototype.traverse = function traverse(root, visitor) { + var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel; + this.__initialize(root, visitor); + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + worklist.push(new Element(root, null, null, null)); + leavelist.push(new Element(null, null, null, null)); + while (worklist.length) { + element = worklist.pop(); + if (element === sentinel) { + element = leavelist.pop(); + ret = this.__execute(visitor.leave, element); + if (this.__state === BREAK || ret === BREAK) { + return; + } + continue; + } + if (element.node) { + ret = this.__execute(visitor.enter, element); + if (this.__state === BREAK || ret === BREAK) { + return; + } + worklist.push(sentinel); + leavelist.push(element); + if (this.__state === SKIP || ret === SKIP) { + continue; + } + node = element.node; + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (candidateExistsInLeaveList(leavelist, candidate[current2])) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', null); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, null); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + if (candidateExistsInLeaveList(leavelist, candidate)) { + continue; + } + worklist.push(new Element(candidate, key, null, null)); + } + } + } + } + }; + Controller.prototype.replace = function replace(root, visitor) { + var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key; + function removeElem(element) { + var i, key, nextElem, parent; + if (element.ref.remove()) { + // When the reference is an element of an array. + key = element.ref.key; + parent = element.ref.parent; + + // If removed from array, then decrease following items' keys. + i = worklist.length; + while (i--) { + nextElem = worklist[i]; + if (nextElem.ref && nextElem.ref.parent === parent) { + if (nextElem.ref.key < key) { + break; + } + --nextElem.ref.key; + } + } + } + } + this.__initialize(root, visitor); + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + outer = { + root: root + }; + element = new Element(root, null, null, new Reference(outer, 'root')); + worklist.push(element); + leavelist.push(element); + while (worklist.length) { + element = worklist.pop(); + if (element === sentinel) { + element = leavelist.pop(); + target = this.__execute(visitor.leave, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + } + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + } + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + continue; + } + target = this.__execute(visitor.enter, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + element.node = target; + } + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + element.node = null; + } + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + + // node may be null + node = element.node; + if (!node) { + continue; + } + worklist.push(sentinel); + leavelist.push(element); + if (this.__state === SKIP || target === SKIP) { + continue; + } + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, new Reference(node, key))); + } + } + } + return outer.root; + }; + function traverse(root, visitor) { + var controller = new Controller(); + return controller.traverse(root, visitor); + } + function replace(root, visitor) { + var controller = new Controller(); + return controller.replace(root, visitor); + } + function extendCommentRange(comment, tokens) { + var target; + target = upperBound(tokens, function search(token) { + return token.range[0] > comment.range[0]; + }); + comment.extendedRange = [comment.range[0], comment.range[1]]; + if (target !== tokens.length) { + comment.extendedRange[1] = tokens[target].range[0]; + } + target -= 1; + if (target >= 0) { + comment.extendedRange[0] = tokens[target].range[1]; + } + return comment; + } + function attachComments(tree, providedComments, tokens) { + // At first, we should calculate extended comment ranges. + var comments = [], + comment, + len, + i, + cursor; + if (!tree.range) { + throw new Error('attachComments needs range information'); + } + + // tokens array is empty, we attach comments to tree as 'leadingComments' + if (!tokens.length) { + if (providedComments.length) { + for (i = 0, len = providedComments.length; i < len; i += 1) { + comment = deepCopy(providedComments[i]); + comment.extendedRange = [0, tree.range[0]]; + comments.push(comment); + } + tree.leadingComments = comments; + } + return tree; + } + for (i = 0, len = providedComments.length; i < len; i += 1) { + comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); + } + + // This is based on John Freeman's implementation. + cursor = 0; + traverse(tree, { + enter: function (node) { + var comment; + while (cursor < comments.length) { + comment = comments[cursor]; + if (comment.extendedRange[1] > node.range[0]) { + break; + } + if (comment.extendedRange[1] === node.range[0]) { + if (!node.leadingComments) { + node.leadingComments = []; + } + node.leadingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + cursor = 0; + traverse(tree, { + leave: function (node) { + var comment; + while (cursor < comments.length) { + comment = comments[cursor]; + if (node.range[1] < comment.extendedRange[0]) { + break; + } + if (node.range[1] === comment.extendedRange[0]) { + if (!node.trailingComments) { + node.trailingComments = []; + } + node.trailingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + return tree; + } + exports.Syntax = Syntax; + exports.traverse = traverse; + exports.replace = replace; + exports.attachComments = attachComments; + exports.VisitorKeys = VisitorKeys; + exports.VisitorOption = VisitorOption; + exports.Controller = Controller; + exports.cloneEnvironment = function () { + return clone({}); + }; + return exports; + })(exports); + /* vim: set sw=4 ts=4 et tw=80 : */ +}); + +var parser = createCommonjsModule(function (module) { + /* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ + (function (root, factory) { + if ( module.exports) { + module.exports = factory(); + } + })(commonjsGlobal, function () { + + function peg$subclass(child, parent) { + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); + } + } + peg$subclass(peg$SyntaxError, Error); + peg$SyntaxError.buildMessage = function (expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function literal(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, + "class": function _class(expectation) { + var escapedParts = "", + i; + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]); + } + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + any: function any(expectation) { + return "any character"; + }, + end: function end(expectation) { + return "end of input"; + }, + other: function other(expectation) { + return expectation.description; + } + }; + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + function literalEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + function classEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, + j; + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); + } + descriptions.sort(); + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + descriptions.length = j; + } + switch (descriptions.length) { + case 1: + return descriptions[0]; + case 2: + return descriptions[0] + " or " + descriptions[1]; + default: + return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; + } + } + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; + }; + function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + var peg$FAILED = {}, + peg$startRuleFunctions = { + start: peg$parsestart + }, + peg$startRuleFunction = peg$parsestart, + peg$c0 = function peg$c0(ss) { + return ss.length === 1 ? ss[0] : { + type: 'matches', + selectors: ss + }; + }, + peg$c1 = function peg$c1() { + return void 0; + }, + peg$c2 = " ", + peg$c3 = peg$literalExpectation(" ", false), + peg$c4 = /^[^ [\],():#!=><~+.]/, + peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false), + peg$c6 = function peg$c6(i) { + return i.join(''); + }, + peg$c7 = ">", + peg$c8 = peg$literalExpectation(">", false), + peg$c9 = function peg$c9() { + return 'child'; + }, + peg$c10 = "~", + peg$c11 = peg$literalExpectation("~", false), + peg$c12 = function peg$c12() { + return 'sibling'; + }, + peg$c13 = "+", + peg$c14 = peg$literalExpectation("+", false), + peg$c15 = function peg$c15() { + return 'adjacent'; + }, + peg$c16 = function peg$c16() { + return 'descendant'; + }, + peg$c17 = ",", + peg$c18 = peg$literalExpectation(",", false), + peg$c19 = function peg$c19(s, ss) { + return [s].concat(ss.map(function (s) { + return s[3]; + })); + }, + peg$c20 = function peg$c20(op, s) { + if (!op) return s; + return { + type: op, + left: { + type: 'exactNode' + }, + right: s + }; + }, + peg$c21 = function peg$c21(a, ops) { + return ops.reduce(function (memo, rhs) { + return { + type: rhs[0], + left: memo, + right: rhs[1] + }; + }, a); + }, + peg$c22 = "!", + peg$c23 = peg$literalExpectation("!", false), + peg$c24 = function peg$c24(subject, as) { + var b = as.length === 1 ? as[0] : { + type: 'compound', + selectors: as + }; + if (subject) b.subject = true; + return b; + }, + peg$c25 = "*", + peg$c26 = peg$literalExpectation("*", false), + peg$c27 = function peg$c27(a) { + return { + type: 'wildcard', + value: a + }; + }, + peg$c28 = "#", + peg$c29 = peg$literalExpectation("#", false), + peg$c30 = function peg$c30(i) { + return { + type: 'identifier', + value: i + }; + }, + peg$c31 = "[", + peg$c32 = peg$literalExpectation("[", false), + peg$c33 = "]", + peg$c34 = peg$literalExpectation("]", false), + peg$c35 = function peg$c35(v) { + return v; + }, + peg$c36 = /^[>", "<", "!"], false, false), + peg$c38 = "=", + peg$c39 = peg$literalExpectation("=", false), + peg$c40 = function peg$c40(a) { + return (a || '') + '='; + }, + peg$c41 = /^[><]/, + peg$c42 = peg$classExpectation([">", "<"], false, false), + peg$c43 = ".", + peg$c44 = peg$literalExpectation(".", false), + peg$c45 = function peg$c45(a, as) { + return [].concat.apply([a], as).join(''); + }, + peg$c46 = function peg$c46(name, op, value) { + return { + type: 'attribute', + name: name, + operator: op, + value: value + }; + }, + peg$c47 = function peg$c47(name) { + return { + type: 'attribute', + name: name + }; + }, + peg$c48 = "\"", + peg$c49 = peg$literalExpectation("\"", false), + peg$c50 = /^[^\\"]/, + peg$c51 = peg$classExpectation(["\\", "\""], true, false), + peg$c52 = "\\", + peg$c53 = peg$literalExpectation("\\", false), + peg$c54 = peg$anyExpectation(), + peg$c55 = function peg$c55(a, b) { + return a + b; + }, + peg$c56 = function peg$c56(d) { + return { + type: 'literal', + value: strUnescape(d.join('')) + }; + }, + peg$c57 = "'", + peg$c58 = peg$literalExpectation("'", false), + peg$c59 = /^[^\\']/, + peg$c60 = peg$classExpectation(["\\", "'"], true, false), + peg$c61 = /^[0-9]/, + peg$c62 = peg$classExpectation([["0", "9"]], false, false), + peg$c63 = function peg$c63(a, b) { + // Can use `a.flat().join('')` once supported + var leadingDecimals = a ? [].concat.apply([], a).join('') : ''; + return { + type: 'literal', + value: parseFloat(leadingDecimals + b.join('')) + }; + }, + peg$c64 = function peg$c64(i) { + return { + type: 'literal', + value: i + }; + }, + peg$c65 = "type(", + peg$c66 = peg$literalExpectation("type(", false), + peg$c67 = /^[^ )]/, + peg$c68 = peg$classExpectation([" ", ")"], true, false), + peg$c69 = ")", + peg$c70 = peg$literalExpectation(")", false), + peg$c71 = function peg$c71(t) { + return { + type: 'type', + value: t.join('') + }; + }, + peg$c72 = /^[imsu]/, + peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false), + peg$c74 = "/", + peg$c75 = peg$literalExpectation("/", false), + peg$c76 = /^[^\/]/, + peg$c77 = peg$classExpectation(["/"], true, false), + peg$c78 = function peg$c78(d, flgs) { + return { + type: 'regexp', + value: new RegExp(d.join(''), flgs ? flgs.join('') : '') + }; + }, + peg$c79 = function peg$c79(i, is) { + return { + type: 'field', + name: is.reduce(function (memo, p) { + return memo + p[0] + p[1]; + }, i) + }; + }, + peg$c80 = ":not(", + peg$c81 = peg$literalExpectation(":not(", false), + peg$c82 = function peg$c82(ss) { + return { + type: 'not', + selectors: ss + }; + }, + peg$c83 = ":matches(", + peg$c84 = peg$literalExpectation(":matches(", false), + peg$c85 = function peg$c85(ss) { + return { + type: 'matches', + selectors: ss + }; + }, + peg$c86 = ":has(", + peg$c87 = peg$literalExpectation(":has(", false), + peg$c88 = function peg$c88(ss) { + return { + type: 'has', + selectors: ss + }; + }, + peg$c89 = ":first-child", + peg$c90 = peg$literalExpectation(":first-child", false), + peg$c91 = function peg$c91() { + return nth(1); + }, + peg$c92 = ":last-child", + peg$c93 = peg$literalExpectation(":last-child", false), + peg$c94 = function peg$c94() { + return nthLast(1); + }, + peg$c95 = ":nth-child(", + peg$c96 = peg$literalExpectation(":nth-child(", false), + peg$c97 = function peg$c97(n) { + return nth(parseInt(n.join(''), 10)); + }, + peg$c98 = ":nth-last-child(", + peg$c99 = peg$literalExpectation(":nth-last-child(", false), + peg$c100 = function peg$c100(n) { + return nthLast(parseInt(n.join(''), 10)); + }, + peg$c101 = ":", + peg$c102 = peg$literalExpectation(":", false), + peg$c103 = function peg$c103(c) { + return { + type: 'class', + name: c + }; + }, + peg$currPos = 0, + peg$posDetailsCache = [{ + line: 1, + column: 1 + }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$resultsCache = {}, + peg$result; + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + function peg$literalExpectation(text, ignoreCase) { + return { + type: "literal", + text: text, + ignoreCase: ignoreCase + }; + } + function peg$classExpectation(parts, inverted, ignoreCase) { + return { + type: "class", + parts: parts, + inverted: inverted, + ignoreCase: ignoreCase + }; + } + function peg$anyExpectation() { + return { + type: "any" + }; + } + function peg$endExpectation() { + return { + type: "end" + }; + } + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], + p; + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; + } + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + p++; + } + peg$posDetailsCache[pos] = details; + return details; + } + } + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { + return; + } + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + peg$maxFailExpected.push(expected); + } + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location); + } + function peg$parsestart() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 0, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseselectors(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c0(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s1 = peg$c1(); + } + s0 = s1; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parse_() { + var s0, s1; + var key = peg$currPos * 32 + 1, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + while (s1 !== peg$FAILED) { + s0.push(s1); + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseidentifierName() { + var s0, s1, s2; + var key = peg$currPos * 32 + 2, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c5); + } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c5); + } + } + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s1 = peg$c6(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsebinaryOp() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 3, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 62) { + s2 = peg$c7; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c8); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c9(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 126) { + s2 = peg$c10; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c11); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c12(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 43) { + s2 = peg$c13; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c14); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c15(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s1 = peg$c16(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehasSelectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 32 + 4, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsehasSelector(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehasSelector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehasSelector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseselectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 32 + 5, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseselector(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehasSelector() { + var s0, s1, s2; + var key = peg$currPos * 32 + 6, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsebinaryOp(); + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseselector(); + if (s2 !== peg$FAILED) { + s1 = peg$c20(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseselector() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 7, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsesequence(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c21(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsesequence() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 8, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c23); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseatom(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseatom(); + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + s1 = peg$c24(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseatom() { + var s0; + var key = peg$currPos * 32 + 9, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsewildcard(); + if (s0 === peg$FAILED) { + s0 = peg$parseidentifier(); + if (s0 === peg$FAILED) { + s0 = peg$parseattr(); + if (s0 === peg$FAILED) { + s0 = peg$parsefield(); + if (s0 === peg$FAILED) { + s0 = peg$parsenegation(); + if (s0 === peg$FAILED) { + s0 = peg$parsematches(); + if (s0 === peg$FAILED) { + s0 = peg$parsehas(); + if (s0 === peg$FAILED) { + s0 = peg$parsefirstChild(); + if (s0 === peg$FAILED) { + s0 = peg$parselastChild(); + if (s0 === peg$FAILED) { + s0 = peg$parsenthChild(); + if (s0 === peg$FAILED) { + s0 = peg$parsenthLastChild(); + if (s0 === peg$FAILED) { + s0 = peg$parseclass(); + } + } + } + } + } + } + } + } + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsewildcard() { + var s0, s1; + var key = peg$currPos * 32 + 10, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c26); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c27(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseidentifier() { + var s0, s1, s2; + var key = peg$currPos * 32 + 11, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c28; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c29); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s1 = peg$c30(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattr() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 12, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c31; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c32); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrValue(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s5 = peg$c33; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c34); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c35(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrOps() { + var s0, s1, s2; + var key = peg$currPos * 32 + 13, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (peg$c36.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c37); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c39); + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c40(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + if (peg$c41.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + { + peg$fail(peg$c42); + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrEqOps() { + var s0, s1, s2; + var key = peg$currPos * 32 + 14, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c23); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c39); + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c40(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrName() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 15, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c43; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c43; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c45(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrValue() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 16, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrEqOps(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsetype(); + if (s5 === peg$FAILED) { + s5 = peg$parseregex(); + } + if (s5 !== peg$FAILED) { + s1 = peg$c46(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrOps(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsestring(); + if (s5 === peg$FAILED) { + s5 = peg$parsenumber(); + if (s5 === peg$FAILED) { + s5 = peg$parsepath(); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c46(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s1 = peg$c47(s1); + } + s0 = s1; + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsestring() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 17, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c49); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c51); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c51); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c48; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c49); + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c56(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c57; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c58); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c59.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c60); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c59.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c60); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c57; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c58); + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c56(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenumber() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 18, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s3 = peg$c43; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + s1 = peg$c63(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsepath() { + var s0, s1; + var key = peg$currPos * 32 + 19, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + s1 = peg$c64(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsetype() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 20, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c65) { + s1 = peg$c65; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c66); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c67.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c68); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c67.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c68); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c71(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseflags() { + var s0, s1; + var key = peg$currPos * 32 + 21, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = []; + if (peg$c72.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c73); + } + } + if (s1 !== peg$FAILED) { + while (s1 !== peg$FAILED) { + s0.push(s1); + if (peg$c72.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c73); + } + } + } + } else { + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseregex() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 32 + 22, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c74; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c75); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c77); + } + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c76.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c77); + } + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c75); + } + } + if (s3 !== peg$FAILED) { + s4 = peg$parseflags(); + if (s4 === peg$FAILED) { + s4 = null; + } + if (s4 !== peg$FAILED) { + s1 = peg$c78(s2, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsefield() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 32 + 23, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c43; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c79(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenegation() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 24, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c80) { + s1 = peg$c80; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c81); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c82(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsematches() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 25, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 9) === peg$c83) { + s1 = peg$c83; + peg$currPos += 9; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c84); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c85(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehas() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 26, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c86) { + s1 = peg$c86; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c87); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parsehasSelectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c88(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsefirstChild() { + var s0, s1; + var key = peg$currPos * 32 + 27, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 12) === peg$c89) { + s1 = peg$c89; + peg$currPos += 12; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c90); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c91(); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parselastChild() { + var s0, s1; + var key = peg$currPos * 32 + 28, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 11) === peg$c92) { + s1 = peg$c92; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c93); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c94(); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenthChild() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 29, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 11) === peg$c95) { + s1 = peg$c95; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c96); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c97(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenthLastChild() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 30, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 16) === peg$c98) { + s1 = peg$c98; + peg$currPos += 16; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c99); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c100(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseclass() { + var s0, s1, s2; + var key = peg$currPos * 32 + 31, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c101; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c102); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s1 = peg$c103(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function nth(n) { + return { + type: 'nth-child', + index: { + type: 'literal', + value: n + } + }; + } + function nthLast(n) { + return { + type: 'nth-last-child', + index: { + type: 'literal', + value: n + } + }; + } + function strUnescape(s) { + return s.replace(/\\(.)/g, function (match, ch) { + switch (ch) { + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'v': + return '\v'; + default: + return ch; + } + }); + } + peg$result = peg$startRuleFunction(); + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)); + } + } + return { + SyntaxError: peg$SyntaxError, + parse: peg$parse + }; + }); +}); + +/** +* @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side +*/ + +var LEFT_SIDE = 'LEFT_SIDE'; +var RIGHT_SIDE = 'RIGHT_SIDE'; + +/** + * @external AST + * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html + */ + +/** + * One of the rules of `grammar.pegjs` + * @typedef {PlainObject} SelectorAST + * @see grammar.pegjs +*/ + +/** + * The `sequence` production of `grammar.pegjs` + * @typedef {PlainObject} SelectorSequenceAST +*/ + +/** + * Get the value of a property which may be multiple levels down + * in the object. + * @param {?PlainObject} obj + * @param {string[]} keys + * @returns {undefined|boolean|string|number|external:AST} + */ +function getPath(obj, keys) { + for (var i = 0; i < keys.length; ++i) { + if (obj == null) { + return obj; + } + obj = obj[keys[i]]; + } + return obj; +} + +/** + * Determine whether `node` can be reached by following `path`, + * starting at `ancestor`. + * @param {?external:AST} node + * @param {?external:AST} ancestor + * @param {string[]} path + * @param {Integer} fromPathIndex + * @returns {boolean} + */ +function inPath(node, ancestor, path, fromPathIndex) { + var current = ancestor; + for (var i = fromPathIndex; i < path.length; ++i) { + if (current == null) { + return false; + } + var field = current[path[i]]; + if (Array.isArray(field)) { + for (var k = 0; k < field.length; ++k) { + if (inPath(node, field[k], path, i + 1)) { + return true; + } + } + return false; + } + current = field; + } + return node === current; +} + +/** + * A generated matcher function for a selector. + * @callback SelectorMatcher + * @param {?SelectorAST} selector + * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] + * @returns {void} +*/ + +/** + * A WeakMap for holding cached matcher functions for selectors. + * @type {WeakMap} +*/ +var MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap() : null; + +/** + * Look up a matcher function for `selector` in the cache. + * If it does not exist, generate it with `generateMatcher` and add it to the cache. + * In engines without WeakMap, the caching is skipped and matchers are generated with every call. + * @param {?SelectorAST} selector + * @returns {SelectorMatcher} + */ +function getMatcher(selector) { + if (selector == null) { + return function () { + return true; + }; + } + if (MATCHER_CACHE != null) { + var matcher = MATCHER_CACHE.get(selector); + if (matcher != null) { + return matcher; + } + matcher = generateMatcher(selector); + MATCHER_CACHE.set(selector, matcher); + return matcher; + } + return generateMatcher(selector); +} + +/** + * Create a matcher function for `selector`, + * @param {?SelectorAST} selector + * @returns {SelectorMatcher} + */ +function generateMatcher(selector) { + switch (selector.type) { + case 'wildcard': + return function () { + return true; + }; + case 'identifier': + { + var value = selector.value.toLowerCase(); + return function (node, ancestry, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + return value === node[nodeTypeKey].toLowerCase(); + }; + } + case 'exactNode': + return function (node, ancestry) { + return ancestry.length === 0; + }; + case 'field': + { + var path = selector.name.split('.'); + return function (node, ancestry) { + var ancestor = ancestry[path.length - 1]; + return inPath(node, ancestor, path, 0); + }; + } + case 'matches': + { + var matchers = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < matchers.length; ++i) { + if (matchers[i](node, ancestry, options)) { + return true; + } + } + return false; + }; + } + case 'compound': + { + var _matchers = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < _matchers.length; ++i) { + if (!_matchers[i](node, ancestry, options)) { + return false; + } + } + return true; + }; + } + case 'not': + { + var _matchers2 = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < _matchers2.length; ++i) { + if (_matchers2[i](node, ancestry, options)) { + return false; + } + } + return true; + }; + } + case 'has': + { + var _matchers3 = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + var result = false; + var a = []; + estraverse.traverse(node, { + enter: function enter(node, parent) { + if (parent != null) { + a.unshift(parent); + } + for (var i = 0; i < _matchers3.length; ++i) { + if (_matchers3[i](node, a, options)) { + result = true; + this["break"](); + return; + } + } + }, + leave: function leave() { + a.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + return result; + }; + } + case 'child': + { + var left = getMatcher(selector.left); + var right = getMatcher(selector.right); + return function (node, ancestry, options) { + if (ancestry.length > 0 && right(node, ancestry, options)) { + return left(ancestry[0], ancestry.slice(1), options); + } + return false; + }; + } + case 'descendant': + { + var _left = getMatcher(selector.left); + var _right = getMatcher(selector.right); + return function (node, ancestry, options) { + if (_right(node, ancestry, options)) { + for (var i = 0, l = ancestry.length; i < l; ++i) { + if (_left(ancestry[i], ancestry.slice(i + 1), options)) { + return true; + } + } + } + return false; + }; + } + case 'attribute': + { + var _path = selector.name.split('.'); + switch (selector.operator) { + case void 0: + return function (node) { + return getPath(node, _path) != null; + }; + case '=': + switch (selector.value.type) { + case 'regexp': + return function (node) { + var p = getPath(node, _path); + return typeof p === 'string' && selector.value.value.test(p); + }; + case 'literal': + { + var literal = "".concat(selector.value.value); + return function (node) { + return literal === "".concat(getPath(node, _path)); + }; + } + case 'type': + return function (node) { + return selector.value.value === _typeof(getPath(node, _path)); + }; + } + throw new Error("Unknown selector value type: ".concat(selector.value.type)); + case '!=': + switch (selector.value.type) { + case 'regexp': + return function (node) { + return !selector.value.value.test(getPath(node, _path)); + }; + case 'literal': + { + var _literal = "".concat(selector.value.value); + return function (node) { + return _literal !== "".concat(getPath(node, _path)); + }; + } + case 'type': + return function (node) { + return selector.value.value !== _typeof(getPath(node, _path)); + }; + } + throw new Error("Unknown selector value type: ".concat(selector.value.type)); + case '<=': + return function (node) { + return getPath(node, _path) <= selector.value.value; + }; + case '<': + return function (node) { + return getPath(node, _path) < selector.value.value; + }; + case '>': + return function (node) { + return getPath(node, _path) > selector.value.value; + }; + case '>=': + return function (node) { + return getPath(node, _path) >= selector.value.value; + }; + } + throw new Error("Unknown operator: ".concat(selector.operator)); + } + case 'sibling': + { + var _left2 = getMatcher(selector.left); + var _right2 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right2(node, ancestry, options) && sibling(node, _left2, ancestry, LEFT_SIDE, options) || selector.left.subject && _left2(node, ancestry, options) && sibling(node, _right2, ancestry, RIGHT_SIDE, options); + }; + } + case 'adjacent': + { + var _left3 = getMatcher(selector.left); + var _right3 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right3(node, ancestry, options) && adjacent(node, _left3, ancestry, LEFT_SIDE, options) || selector.right.subject && _left3(node, ancestry, options) && adjacent(node, _right3, ancestry, RIGHT_SIDE, options); + }; + } + case 'nth-child': + { + var nth = selector.index.value; + var _right4 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right4(node, ancestry, options) && nthChild(node, ancestry, nth, options); + }; + } + case 'nth-last-child': + { + var _nth = -selector.index.value; + var _right5 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right5(node, ancestry, options) && nthChild(node, ancestry, _nth, options); + }; + } + case 'class': + { + var name = selector.name.toLowerCase(); + return function (node, ancestry, options) { + if (options && options.matchClass) { + return options.matchClass(selector.name, node, ancestry); + } + if (options && options.nodeTypeKey) return false; + switch (name) { + case 'statement': + if (node.type.slice(-9) === 'Statement') return true; + // fallthrough: interface Declaration <: Statement { } + case 'declaration': + return node.type.slice(-11) === 'Declaration'; + case 'pattern': + if (node.type.slice(-7) === 'Pattern') return true; + // fallthrough: interface Expression <: Node, Pattern { } + case 'expression': + return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty'; + case 'function': + return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'; + } + throw new Error("Unknown class name: ".concat(selector.name)); + }; + } + } + throw new Error("Unknown selector type: ".concat(selector.type)); +} + +/** + * @callback TraverseOptionFallback + * @param {external:AST} node The given node. + * @returns {string[]} An array of visitor keys for the given node. + */ + +/** + * @callback ClassMatcher + * @param {string} className The name of the class to match. + * @param {external:AST} node The node to match against. + * @param {Array} ancestry The ancestry of the node. + * @returns {boolean} True if the node matches the class, false if not. + */ + +/** + * @typedef {object} ESQueryOptions + * @property {string} [nodeTypeKey="type"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery. + * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node. + * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes. + * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes. + */ + +/** + * Given a `node` and its ancestors, determine if `node` is matched + * by `selector`. + * @param {?external:AST} node + * @param {?SelectorAST} selector + * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] + * @throws {Error} Unknowns (operator, class name, selector type, or + * selector value type) + * @returns {boolean} + */ +function matches(node, selector, ancestry, options) { + if (!selector) { + return true; + } + if (!node) { + return false; + } + if (!ancestry) { + ancestry = []; + } + return getMatcher(selector)(node, ancestry, options); +} + +/** + * Get visitor keys of a given node. + * @param {external:AST} node The AST node to get keys. + * @param {ESQueryOptions|undefined} options + * @returns {string[]} Visitor keys of the node. + */ +function getVisitorKeys(node, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + var nodeType = node[nodeTypeKey]; + if (options && options.visitorKeys && options.visitorKeys[nodeType]) { + return options.visitorKeys[nodeType]; + } + if (estraverse.VisitorKeys[nodeType]) { + return estraverse.VisitorKeys[nodeType]; + } + if (options && typeof options.fallback === 'function') { + return options.fallback(node); + } + // 'iteration' fallback + return Object.keys(node).filter(function (key) { + return key !== nodeTypeKey; + }); +} + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} node The value to check. + * @param {ESQueryOptions|undefined} options The options to use. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(node, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + return node !== null && _typeof(node) === 'object' && typeof node[nodeTypeKey] === 'string'; +} + +/** + * Determines if the given node has a sibling that matches the + * given selector matcher. + * @param {external:AST} node + * @param {SelectorMatcher} matcher + * @param {external:AST[]} ancestry + * @param {Side} side + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ +function sibling(node, matcher, ancestry, side, options) { + var _ancestry = _slicedToArray(ancestry, 1), + parent = _ancestry[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var startIndex = listProp.indexOf(node); + if (startIndex < 0) { + continue; + } + var lowerBound = void 0, + upperBound = void 0; + if (side === LEFT_SIDE) { + lowerBound = 0; + upperBound = startIndex; + } else { + lowerBound = startIndex + 1; + upperBound = listProp.length; + } + for (var k = lowerBound; k < upperBound; ++k) { + if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) { + return true; + } + } + } + } + return false; +} + +/** + * Determines if the given node has an adjacent sibling that matches + * the given selector matcher. + * @param {external:AST} node + * @param {SelectorMatcher} matcher + * @param {external:AST[]} ancestry + * @param {Side} side + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ +function adjacent(node, matcher, ancestry, side, options) { + var _ancestry2 = _slicedToArray(ancestry, 1), + parent = _ancestry2[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); + if (idx < 0) { + continue; + } + if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) { + return true; + } + if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) { + return true; + } + } + } + return false; +} + +/** + * Determines if the given node is the `nth` child. + * If `nth` is negative then the position is counted + * from the end of the list of children. + * @param {external:AST} node + * @param {external:AST[]} ancestry + * @param {Integer} nth + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ +function nthChild(node, ancestry, nth, options) { + if (nth === 0) { + return false; + } + var _ancestry3 = _slicedToArray(ancestry, 1), + parent = _ancestry3[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var idx = nth < 0 ? listProp.length + nth : nth - 1; + if (idx >= 0 && idx < listProp.length && listProp[idx] === node) { + return true; + } + } + } + return false; +} + +/** + * For each selector node marked as a subject, find the portion of the + * selector that the subject must match. + * @param {SelectorAST} selector + * @param {SelectorAST} [ancestor] Defaults to `selector` + * @returns {SelectorAST[]} + */ +function subjects(selector, ancestor) { + if (selector == null || _typeof(selector) != 'object') { + return []; + } + if (ancestor == null) { + ancestor = selector; + } + var results = selector.subject ? [ancestor] : []; + var keys = Object.keys(selector); + for (var i = 0; i < keys.length; ++i) { + var p = keys[i]; + var sel = selector[p]; + results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor))); + } + return results; +} + +/** +* @callback TraverseVisitor +* @param {?external:AST} node +* @param {?external:AST} parent +* @param {external:AST[]} ancestry +*/ + +/** + * From a JS AST and a selector AST, collect all JS AST nodes that + * match the selector. + * @param {external:AST} ast + * @param {?SelectorAST} selector + * @param {TraverseVisitor} visitor + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ +function traverse(ast, selector, visitor, options) { + if (!selector) { + return; + } + var ancestry = []; + var matcher = getMatcher(selector); + var altSubjects = subjects(selector).map(getMatcher); + estraverse.traverse(ast, { + enter: function enter(node, parent) { + if (parent != null) { + ancestry.unshift(parent); + } + if (matcher(node, ancestry, options)) { + if (altSubjects.length) { + for (var i = 0, l = altSubjects.length; i < l; ++i) { + if (altSubjects[i](node, ancestry, options)) { + visitor(node, parent, ancestry); + } + for (var k = 0, m = ancestry.length; k < m; ++k) { + var succeedingAncestry = ancestry.slice(k + 1); + if (altSubjects[i](ancestry[k], succeedingAncestry, options)) { + visitor(ancestry[k], parent, succeedingAncestry); + } + } + } + } else { + visitor(node, parent, ancestry); + } + } + }, + leave: function leave() { + ancestry.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); +} + +/** + * From a JS AST and a selector AST, collect all JS AST nodes that + * match the selector. + * @param {external:AST} ast + * @param {?SelectorAST} selector + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ +function match(ast, selector, options) { + var results = []; + traverse(ast, selector, function (node) { + results.push(node); + }, options); + return results; +} + +/** + * Parse a selector string and return its AST. + * @param {string} selector + * @returns {SelectorAST} + */ +function parse(selector) { + return parser.parse(selector); +} + +/** + * Query the code AST using the selector string. + * @param {external:AST} ast + * @param {string} selector + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ +function query(ast, selector, options) { + return match(ast, parse(selector), options); +} +query.parse = parse; +query.match = match; +query.traverse = traverse; +query.matches = matches; +query.query = query; + +export default query; diff --git a/node_modules/esquery/dist/esquery.esm.min.js b/node_modules/esquery/dist/esquery.esm.min.js new file mode 100644 index 0000000..ca723b8 --- /dev/null +++ b/node_modules/esquery/dist/esquery.esm.min.js @@ -0,0 +1,2 @@ +function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--r)if(e[r].node===t)return!0;return!1}function d(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:i={},Remove:s={}},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r=0;)if(v=s[f=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]&&!y(n,v[m])){if(h(u,x[d]))o=new c(v[m],[f,m],"Property",null);else{if(!p(v[m]))continue;o=new c(v[m],[f,m],null,null)}r.push(o)}}else if(p(v)){if(y(n,v))continue;r.push(new c(v,f,null,null))}}}else if(o=n.pop(),l=this.__execute(t.leave,o),this.__state===a||l===a)return},f.prototype.replace=function(e,t){var r,n,o,u,f,y,d,m,x,v,g,A,E;function b(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key=0;)if(v=o[E=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]){if(h(u,x[d]))y=new c(v[m],[E,m],"Property",new l(v,m));else{if(!p(v[m]))continue;y=new c(v[m],[E,m],null,new l(v,m))}r.push(y)}}else p(v)&&r.push(new c(v,E,null,new l(o,E)))}}else if(y=n.pop(),void 0!==(f=this.__execute(t.leave,y))&&f!==a&&f!==i&&f!==s&&y.ref.replace(f),this.__state!==s&&f!==s||b(y),this.__state===a||f===a)return A.root;return A.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var o,a,i,s,l=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(i=0,a=t.length;ie.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,d(e,{leave:function(e){for(var t;se.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)})),s=a((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t0){for(t=1,n=1;t<~+.]/,p=pe([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=fe(">",!1),y=fe("~",!1),d=fe("+",!1),m=fe(",",!1),x=function(e,t){return[e].concat(t.map((function(e){return e[3]})))},v=fe("!",!1),g=fe("*",!1),A=fe("#",!1),E=fe("[",!1),b=fe("]",!1),S=/^[>","<","!"],!1,!1),C=fe("=",!1),w=function(e){return(e||"")+"="},P=/^[><]/,k=pe([">","<"],!1,!1),D=fe(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=fe('"',!1),T=/^[^\\"]/,F=pe(["\\",'"'],!0,!1),R=fe("\\",!1),O={type:"any"},L=function(e,t){return e+t},M=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},B=fe("'",!1),U=/^[^\\']/,K=pe(["\\","'"],!0,!1),N=/^[0-9]/,W=pe([["0","9"]],!1,!1),V=fe("type(",!1),q=/^[^ )]/,G=pe([" ",")"],!0,!1),z=fe(")",!1),H=/^[imsu]/,Y=pe(["i","m","s","u"],!1,!1),$=fe("/",!1),J=/^[^\/]/,Q=pe(["/"],!0,!1),X=fe(":not(",!1),Z=fe(":matches(",!1),ee=fe(":has(",!1),te=fe(":first-child",!1),re=fe(":last-child",!1),ne=fe(":nth-child(",!1),oe=fe(":nth-last-child(",!1),ae=fe(":",!1),ie=0,se=[{line:1,column:1}],ue=0,le=[],ce={};if("startRule"in r){if(!(r.startRule in u))throw new Error("Can't start parsing from rule \""+r.startRule+'".');l=u[r.startRule]}function fe(e,t){return{type:"literal",text:e,ignoreCase:t}}function pe(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function he(e){var r,n=se[e];if(n)return n;for(r=e-1;!se[r];)r--;for(n={line:(n=se[r]).line,column:n.column};rue&&(ue=ie,le=[]),le.push(e))}function me(){var e,t,r,n,o=32*ie+0,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,(t=xe())!==s&&(r=Ae())!==s&&xe()!==s?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(ie=e,e=s),e===s&&(e=ie,(t=xe())!==s&&(t=void 0),e=t),ce[o]={nextPos:ie,result:e},e)}function xe(){var e,r,n=32*ie+1,o=ce[n];if(o)return ie=o.nextPos,o.result;for(e=[],32===t.charCodeAt(ie)?(r=" ",ie++):(r=s,de(c));r!==s;)e.push(r),32===t.charCodeAt(ie)?(r=" ",ie++):(r=s,de(c));return ce[n]={nextPos:ie,result:e},e}function ve(){var e,r,n,o=32*ie+2,a=ce[o];if(a)return ie=a.nextPos,a.result;if(r=[],f.test(t.charAt(ie))?(n=t.charAt(ie),ie++):(n=s,de(p)),n!==s)for(;n!==s;)r.push(n),f.test(t.charAt(ie))?(n=t.charAt(ie),ie++):(n=s,de(p));else r=s;return r!==s&&(r=r.join("")),e=r,ce[o]={nextPos:ie,result:e},e}function ge(){var e,r,n,o=32*ie+3,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,(r=xe())!==s?(62===t.charCodeAt(ie)?(n=">",ie++):(n=s,de(h)),n!==s&&xe()!==s?e=r="child":(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,(r=xe())!==s?(126===t.charCodeAt(ie)?(n="~",ie++):(n=s,de(y)),n!==s&&xe()!==s?e=r="sibling":(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,(r=xe())!==s?(43===t.charCodeAt(ie)?(n="+",ie++):(n=s,de(d)),n!==s&&xe()!==s?e=r="adjacent":(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,32===t.charCodeAt(ie)?(r=" ",ie++):(r=s,de(c)),r!==s&&(n=xe())!==s?e=r="descendant":(ie=e,e=s)))),ce[o]={nextPos:ie,result:e},e)}function Ae(){var e,r,n,o,a,i,u,l,c=32*ie+5,f=ce[c];if(f)return ie=f.nextPos,f.result;if(e=ie,(r=be())!==s){for(n=[],o=ie,(a=xe())!==s?(44===t.charCodeAt(ie)?(i=",",ie++):(i=s,de(m)),i!==s&&(u=xe())!==s&&(l=be())!==s?o=a=[a,i,u,l]:(ie=o,o=s)):(ie=o,o=s);o!==s;)n.push(o),o=ie,(a=xe())!==s?(44===t.charCodeAt(ie)?(i=",",ie++):(i=s,de(m)),i!==s&&(u=xe())!==s&&(l=be())!==s?o=a=[a,i,u,l]:(ie=o,o=s)):(ie=o,o=s);n!==s?e=r=x(r,n):(ie=e,e=s)}else ie=e,e=s;return ce[c]={nextPos:ie,result:e},e}function Ee(){var e,t,r,n,o,a=32*ie+6,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,(t=ge())===s&&(t=null),t!==s&&(r=be())!==s?(o=r,e=t=(n=t)?{type:n,left:{type:"exactNode"},right:o}:o):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}function be(){var e,t,r,n,o,a,i,u=32*ie+7,l=ce[u];if(l)return ie=l.nextPos,l.result;if(e=ie,(t=Se())!==s){for(r=[],n=ie,(o=ge())!==s&&(a=Se())!==s?n=o=[o,a]:(ie=n,n=s);n!==s;)r.push(n),n=ie,(o=ge())!==s&&(a=Se())!==s?n=o=[o,a]:(ie=n,n=s);r!==s?(i=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),i)):(ie=e,e=s)}else ie=e,e=s;return ce[u]={nextPos:ie,result:e},e}function Se(){var e,r,n,o,a,i,u,l=32*ie+8,c=ce[l];if(c)return ie=c.nextPos,c.result;if(e=ie,33===t.charCodeAt(ie)?(r="!",ie++):(r=s,de(v)),r===s&&(r=null),r!==s){if(n=[],(o=_e())!==s)for(;o!==s;)n.push(o),o=_e();else n=s;n!==s?(a=r,u=1===(i=n).length?i[0]:{type:"compound",selectors:i},a&&(u.subject=!0),e=r=u):(ie=e,e=s)}else ie=e,e=s;return ce[l]={nextPos:ie,result:e},e}function _e(){var e,r=32*ie+9,n=ce[r];return n?(ie=n.nextPos,n.result):((e=function(){var e,r,n=32*ie+10,o=ce[n];return o?(ie=o.nextPos,o.result):(42===t.charCodeAt(ie)?(r="*",ie++):(r=s,de(g)),r!==s&&(r={type:"wildcard",value:r}),e=r,ce[n]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o=32*ie+11,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,35===t.charCodeAt(ie)?(r="#",ie++):(r=s,de(A)),r===s&&(r=null),r!==s&&(n=ve())!==s?e=r={type:"identifier",value:n}:(ie=e,e=s),ce[o]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=32*ie+12,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,91===t.charCodeAt(ie)?(r="[",ie++):(r=s,de(E)),r!==s&&xe()!==s&&(n=function(){var e,r,n,o,a=32*ie+16,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,(r=Ce())!==s&&xe()!==s&&(n=function(){var e,r,n,o=32*ie+14,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,33===t.charCodeAt(ie)?(r="!",ie++):(r=s,de(v)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ie)?(n="=",ie++):(n=s,de(C)),n!==s?(r=w(r),e=r):(ie=e,e=s)):(ie=e,e=s),ce[o]={nextPos:ie,result:e},e)}())!==s&&xe()!==s?((o=function(){var e,r,n,o,a,i=32*ie+20,u=ce[i];if(u)return ie=u.nextPos,u.result;if(e=ie,"type("===t.substr(ie,5)?(r="type(",ie+=5):(r=s,de(V)),r!==s)if(xe()!==s){if(n=[],q.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(G)),o!==s)for(;o!==s;)n.push(o),q.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(G));else n=s;n!==s&&(o=xe())!==s?(41===t.charCodeAt(ie)?(a=")",ie++):(a=s,de(z)),a!==s?(r={type:"type",value:n.join("")},e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;else ie=e,e=s;return ce[i]={nextPos:ie,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,u=32*ie+22,l=ce[u];if(l)return ie=l.nextPos,l.result;if(e=ie,47===t.charCodeAt(ie)?(r="/",ie++):(r=s,de($)),r!==s){if(n=[],J.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(Q)),o!==s)for(;o!==s;)n.push(o),J.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(Q));else n=s;n!==s?(47===t.charCodeAt(ie)?(o="/",ie++):(o=s,de($)),o!==s?((a=function(){var e,r,n=32*ie+21,o=ce[n];if(o)return ie=o.nextPos,o.result;if(e=[],H.test(t.charAt(ie))?(r=t.charAt(ie),ie++):(r=s,de(Y)),r!==s)for(;r!==s;)e.push(r),H.test(t.charAt(ie))?(r=t.charAt(ie),ie++):(r=s,de(Y));else e=s;return ce[n]={nextPos:ie,result:e},e}())===s&&(a=null),a!==s?(i=a,r={type:"regexp",value:new RegExp(n.join(""),i?i.join(""):"")},e=r):(ie=e,e=s)):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;return ce[u]={nextPos:ie,result:e},e}()),o!==s?(r=I(r,n,o),e=r):(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,(r=Ce())!==s&&xe()!==s&&(n=function(){var e,r,n,o=32*ie+13,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,S.test(t.charAt(ie))?(r=t.charAt(ie),ie++):(r=s,de(_)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ie)?(n="=",ie++):(n=s,de(C)),n!==s?(r=w(r),e=r):(ie=e,e=s)):(ie=e,e=s),e===s&&(P.test(t.charAt(ie))?(e=t.charAt(ie),ie++):(e=s,de(k))),ce[o]={nextPos:ie,result:e},e)}())!==s&&xe()!==s?((o=function(){var e,r,n,o,a,i,u=32*ie+17,l=ce[u];if(l)return ie=l.nextPos,l.result;if(e=ie,34===t.charCodeAt(ie)?(r='"',ie++):(r=s,de(j)),r!==s){for(n=[],T.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(F)),o===s&&(o=ie,92===t.charCodeAt(ie)?(a="\\",ie++):(a=s,de(R)),a!==s?(t.length>ie?(i=t.charAt(ie),ie++):(i=s,de(O)),i!==s?(a=L(a,i),o=a):(ie=o,o=s)):(ie=o,o=s));o!==s;)n.push(o),T.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(F)),o===s&&(o=ie,92===t.charCodeAt(ie)?(a="\\",ie++):(a=s,de(R)),a!==s?(t.length>ie?(i=t.charAt(ie),ie++):(i=s,de(O)),i!==s?(a=L(a,i),o=a):(ie=o,o=s)):(ie=o,o=s));n!==s?(34===t.charCodeAt(ie)?(o='"',ie++):(o=s,de(j)),o!==s?(r=M(n),e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;if(e===s)if(e=ie,39===t.charCodeAt(ie)?(r="'",ie++):(r=s,de(B)),r!==s){for(n=[],U.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(K)),o===s&&(o=ie,92===t.charCodeAt(ie)?(a="\\",ie++):(a=s,de(R)),a!==s?(t.length>ie?(i=t.charAt(ie),ie++):(i=s,de(O)),i!==s?(a=L(a,i),o=a):(ie=o,o=s)):(ie=o,o=s));o!==s;)n.push(o),U.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(K)),o===s&&(o=ie,92===t.charCodeAt(ie)?(a="\\",ie++):(a=s,de(R)),a!==s?(t.length>ie?(i=t.charAt(ie),ie++):(i=s,de(O)),i!==s?(a=L(a,i),o=a):(ie=o,o=s)):(ie=o,o=s));n!==s?(39===t.charCodeAt(ie)?(o="'",ie++):(o=s,de(B)),o!==s?(r=M(n),e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;return ce[u]={nextPos:ie,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,u,l=32*ie+18,c=ce[l];if(c)return ie=c.nextPos,c.result;for(e=ie,r=ie,n=[],N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));o!==s;)n.push(o),N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));if(n!==s?(46===t.charCodeAt(ie)?(o=".",ie++):(o=s,de(D)),o!==s?r=n=[n,o]:(ie=r,r=s)):(ie=r,r=s),r===s&&(r=null),r!==s){if(n=[],N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));else n=s;n!==s?(i=n,u=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(u+i.join(""))},e=r):(ie=e,e=s)}else ie=e,e=s;return ce[l]={nextPos:ie,result:e},e}())===s&&(o=function(){var e,t,r=32*ie+19,n=ce[r];return n?(ie=n.nextPos,n.result):((t=ve())!==s&&(t={type:"literal",value:t}),e=t,ce[r]={nextPos:ie,result:e},e)}()),o!==s?(r=I(r,n,o),e=r):(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,(r=Ce())!==s&&(r={type:"attribute",name:r}),e=r)),ce[a]={nextPos:ie,result:e},e)}())!==s&&xe()!==s?(93===t.charCodeAt(ie)?(o="]",ie++):(o=s,de(b)),o!==s?e=r=n:(ie=e,e=s)):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i,u,l,c=32*ie+23,f=ce[c];if(f)return ie=f.nextPos,f.result;if(e=ie,46===t.charCodeAt(ie)?(r=".",ie++):(r=s,de(D)),r!==s)if((n=ve())!==s){for(o=[],a=ie,46===t.charCodeAt(ie)?(i=".",ie++):(i=s,de(D)),i!==s&&(u=ve())!==s?a=i=[i,u]:(ie=a,a=s);a!==s;)o.push(a),a=ie,46===t.charCodeAt(ie)?(i=".",ie++):(i=s,de(D)),i!==s&&(u=ve())!==s?a=i=[i,u]:(ie=a,a=s);o!==s?(l=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),l)},e=r):(ie=e,e=s)}else ie=e,e=s;else ie=e,e=s;return ce[c]={nextPos:ie,result:e},e}())===s&&(e=function(){var e,r,n,o,a=32*ie+24,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,":not("===t.substr(ie,5)?(r=":not(",ie+=5):(r=s,de(X)),r!==s&&xe()!==s&&(n=Ae())!==s&&xe()!==s?(41===t.charCodeAt(ie)?(o=")",ie++):(o=s,de(z)),o!==s?e=r={type:"not",selectors:n}:(ie=e,e=s)):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=32*ie+25,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,":matches("===t.substr(ie,9)?(r=":matches(",ie+=9):(r=s,de(Z)),r!==s&&xe()!==s&&(n=Ae())!==s&&xe()!==s?(41===t.charCodeAt(ie)?(o=")",ie++):(o=s,de(z)),o!==s?e=r={type:"matches",selectors:n}:(ie=e,e=s)):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=32*ie+26,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,":has("===t.substr(ie,5)?(r=":has(",ie+=5):(r=s,de(ee)),r!==s&&xe()!==s&&(n=function(){var e,r,n,o,a,i,u,l,c=32*ie+4,f=ce[c];if(f)return ie=f.nextPos,f.result;if(e=ie,(r=Ee())!==s){for(n=[],o=ie,(a=xe())!==s?(44===t.charCodeAt(ie)?(i=",",ie++):(i=s,de(m)),i!==s&&(u=xe())!==s&&(l=Ee())!==s?o=a=[a,i,u,l]:(ie=o,o=s)):(ie=o,o=s);o!==s;)n.push(o),o=ie,(a=xe())!==s?(44===t.charCodeAt(ie)?(i=",",ie++):(i=s,de(m)),i!==s&&(u=xe())!==s&&(l=Ee())!==s?o=a=[a,i,u,l]:(ie=o,o=s)):(ie=o,o=s);n!==s?e=r=x(r,n):(ie=e,e=s)}else ie=e,e=s;return ce[c]={nextPos:ie,result:e},e}())!==s&&xe()!==s?(41===t.charCodeAt(ie)?(o=")",ie++):(o=s,de(z)),o!==s?e=r={type:"has",selectors:n}:(ie=e,e=s)):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n=32*ie+27,o=ce[n];return o?(ie=o.nextPos,o.result):(":first-child"===t.substr(ie,12)?(r=":first-child",ie+=12):(r=s,de(te)),r!==s&&(r=we(1)),e=r,ce[n]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n=32*ie+28,o=ce[n];return o?(ie=o.nextPos,o.result):(":last-child"===t.substr(ie,11)?(r=":last-child",ie+=11):(r=s,de(re)),r!==s&&(r=Pe(1)),e=r,ce[n]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i=32*ie+29,u=ce[i];if(u)return ie=u.nextPos,u.result;if(e=ie,":nth-child("===t.substr(ie,11)?(r=":nth-child(",ie+=11):(r=s,de(ne)),r!==s)if(xe()!==s){if(n=[],N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));else n=s;n!==s&&(o=xe())!==s?(41===t.charCodeAt(ie)?(a=")",ie++):(a=s,de(z)),a!==s?(r=we(parseInt(n.join(""),10)),e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;else ie=e,e=s;return ce[i]={nextPos:ie,result:e},e}())===s&&(e=function(){var e,r,n,o,a,i=32*ie+30,u=ce[i];if(u)return ie=u.nextPos,u.result;if(e=ie,":nth-last-child("===t.substr(ie,16)?(r=":nth-last-child(",ie+=16):(r=s,de(oe)),r!==s)if(xe()!==s){if(n=[],N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));else n=s;n!==s&&(o=xe())!==s?(41===t.charCodeAt(ie)?(a=")",ie++):(a=s,de(z)),a!==s?(r=Pe(parseInt(n.join(""),10)),e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;else ie=e,e=s;return ce[i]={nextPos:ie,result:e},e}())===s&&(e=function(){var e,r,n,o=32*ie+31,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,58===t.charCodeAt(ie)?(r=":",ie++):(r=s,de(ae)),r!==s&&(n=ve())!==s?e=r={type:"class",name:n}:(ie=e,e=s),ce[o]={nextPos:ie,result:e},e)}()),ce[r]={nextPos:ie,result:e},e)}function Ce(){var e,r,n,o,a,i,u,l,c=32*ie+15,f=ce[c];if(f)return ie=f.nextPos,f.result;if(e=ie,(r=ve())!==s){for(n=[],o=ie,46===t.charCodeAt(ie)?(a=".",ie++):(a=s,de(D)),a!==s&&(i=ve())!==s?o=a=[a,i]:(ie=o,o=s);o!==s;)n.push(o),o=ie,46===t.charCodeAt(ie)?(a=".",ie++):(a=s,de(D)),a!==s&&(i=ve())!==s?o=a=[a,i]:(ie=o,o=s);n!==s?(u=r,l=n,e=r=[].concat.apply([u],l).join("")):(ie=e,e=s)}else ie=e,e=s;return ce[c]={nextPos:ie,result:e},e}function we(e){return{type:"nth-child",index:{type:"literal",value:e}}}function Pe(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=l())!==s&&ie===t.length)return n;throw n!==s&&ie0&&p(e,t,r))&&f(t[0],t.slice(1),r)};case"descendant":var h=c(t.left),x=c(t.right);return function(e,t,r){if(x(e,t,r))for(var n=0,o=t.length;n":return function(e){return u(e,v)>t.value.value};case">=":return function(e){return u(e,v)>=t.value.value}}throw new Error("Unknown operator: ".concat(t.operator));case"sibling":var E=c(t.left),b=c(t.right);return function(e,r,n){return b(e,r,n)&&y(e,E,r,"LEFT_SIDE",n)||t.left.subject&&E(e,r,n)&&y(e,b,r,"RIGHT_SIDE",n)};case"adjacent":var S=c(t.left),_=c(t.right);return function(e,r,n){return _(e,r,n)&&d(e,S,r,"LEFT_SIDE",n)||t.right.subject&&S(e,r,n)&&d(e,_,r,"RIGHT_SIDE",n)};case"nth-child":var C=t.index.value,w=c(t.right);return function(e,t,r){return w(e,t,r)&&m(e,t,C,r)};case"nth-last-child":var P=-t.index.value,k=c(t.right);return function(e,t,r){return k(e,t,r)&&m(e,t,P,r)};case"class":var D=t.name.toLowerCase();return function(e,r,n){if(n&&n.matchClass)return n.matchClass(t.name,e,r);if(n&&n.nodeTypeKey)return!1;switch(D){case"statement":if("Statement"===e.type.slice(-9))return!0;case"declaration":return"Declaration"===e.type.slice(-11);case"pattern":if("Pattern"===e.type.slice(-7))return!0;case"expression":return"Expression"===e.type.slice(-10)||"Literal"===e.type.slice(-7)||"Identifier"===e.type&&(0===r.length||"MetaProperty"!==r[0].type)||"MetaProperty"===e.type;case"function":return"FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type}throw new Error("Unknown class name: ".concat(t.name))}}throw new Error("Unknown selector type: ".concat(t.type))}function p(e,t){var r=t&&t.nodeTypeKey||"type",n=e[r];return t&&t.visitorKeys&&t.visitorKeys[n]?t.visitorKeys[n]:i.VisitorKeys[n]?i.VisitorKeys[n]:t&&"function"==typeof t.fallback?t.fallback(e):Object.keys(e).filter((function(e){return e!==r}))}function h(t,r){var n=r&&r.nodeTypeKey||"type";return null!==t&&"object"===e(t)&&"string"==typeof t[n]}function y(e,r,n,o,a){var i=t(n,1)[0];if(!i)return!1;for(var s=p(i,a),u=0;u0&&h(l[c-1],a)&&r(l[c-1],n,a))return!0;if("RIGHT_SIDE"===o&&c=0&&l\n Copyright (C) 2012 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/*jslint vars:false, bitwise:true*/\n/*jshint indent:4*/\n/*global exports:true*/\n(function clone(exports) {\n 'use strict';\n\n var Syntax,\n VisitorOption,\n VisitorKeys,\n BREAK,\n SKIP,\n REMOVE;\n\n function deepCopy(obj) {\n var ret = {}, key, val;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n val = obj[key];\n if (typeof val === 'object' && val !== null) {\n ret[key] = deepCopy(val);\n } else {\n ret[key] = val;\n }\n }\n }\n return ret;\n }\n\n // based on LLVM libc++ upper_bound / lower_bound\n // MIT License\n\n function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n AssignmentPattern: 'AssignmentPattern',\n ArrayExpression: 'ArrayExpression',\n ArrayPattern: 'ArrayPattern',\n ArrowFunctionExpression: 'ArrowFunctionExpression',\n AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ChainExpression: 'ChainExpression',\n ClassBody: 'ClassBody',\n ClassDeclaration: 'ClassDeclaration',\n ClassExpression: 'ClassExpression',\n ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7.\n ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7.\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DebuggerStatement: 'DebuggerStatement',\n DirectiveStatement: 'DirectiveStatement',\n DoWhileStatement: 'DoWhileStatement',\n EmptyStatement: 'EmptyStatement',\n ExportAllDeclaration: 'ExportAllDeclaration',\n ExportDefaultDeclaration: 'ExportDefaultDeclaration',\n ExportNamedDeclaration: 'ExportNamedDeclaration',\n ExportSpecifier: 'ExportSpecifier',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n ForOfStatement: 'ForOfStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7.\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n ImportExpression: 'ImportExpression',\n ImportDeclaration: 'ImportDeclaration',\n ImportDefaultSpecifier: 'ImportDefaultSpecifier',\n ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',\n ImportSpecifier: 'ImportSpecifier',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n MetaProperty: 'MetaProperty',\n MethodDefinition: 'MethodDefinition',\n ModuleSpecifier: 'ModuleSpecifier',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n ObjectPattern: 'ObjectPattern',\n PrivateIdentifier: 'PrivateIdentifier',\n Program: 'Program',\n Property: 'Property',\n PropertyDefinition: 'PropertyDefinition',\n RestElement: 'RestElement',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SpreadElement: 'SpreadElement',\n Super: 'Super',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n TaggedTemplateExpression: 'TaggedTemplateExpression',\n TemplateElement: 'TemplateElement',\n TemplateLiteral: 'TemplateLiteral',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement',\n YieldExpression: 'YieldExpression'\n };\n\n VisitorKeys = {\n AssignmentExpression: ['left', 'right'],\n AssignmentPattern: ['left', 'right'],\n ArrayExpression: ['elements'],\n ArrayPattern: ['elements'],\n ArrowFunctionExpression: ['params', 'body'],\n AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.\n BlockStatement: ['body'],\n BinaryExpression: ['left', 'right'],\n BreakStatement: ['label'],\n CallExpression: ['callee', 'arguments'],\n CatchClause: ['param', 'body'],\n ChainExpression: ['expression'],\n ClassBody: ['body'],\n ClassDeclaration: ['id', 'superClass', 'body'],\n ClassExpression: ['id', 'superClass', 'body'],\n ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7.\n ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.\n ConditionalExpression: ['test', 'consequent', 'alternate'],\n ContinueStatement: ['label'],\n DebuggerStatement: [],\n DirectiveStatement: [],\n DoWhileStatement: ['body', 'test'],\n EmptyStatement: [],\n ExportAllDeclaration: ['source'],\n ExportDefaultDeclaration: ['declaration'],\n ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],\n ExportSpecifier: ['exported', 'local'],\n ExpressionStatement: ['expression'],\n ForStatement: ['init', 'test', 'update', 'body'],\n ForInStatement: ['left', 'right', 'body'],\n ForOfStatement: ['left', 'right', 'body'],\n FunctionDeclaration: ['id', 'params', 'body'],\n FunctionExpression: ['id', 'params', 'body'],\n GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.\n Identifier: [],\n IfStatement: ['test', 'consequent', 'alternate'],\n ImportExpression: ['source'],\n ImportDeclaration: ['specifiers', 'source'],\n ImportDefaultSpecifier: ['local'],\n ImportNamespaceSpecifier: ['local'],\n ImportSpecifier: ['imported', 'local'],\n Literal: [],\n LabeledStatement: ['label', 'body'],\n LogicalExpression: ['left', 'right'],\n MemberExpression: ['object', 'property'],\n MetaProperty: ['meta', 'property'],\n MethodDefinition: ['key', 'value'],\n ModuleSpecifier: [],\n NewExpression: ['callee', 'arguments'],\n ObjectExpression: ['properties'],\n ObjectPattern: ['properties'],\n PrivateIdentifier: [],\n Program: ['body'],\n Property: ['key', 'value'],\n PropertyDefinition: ['key', 'value'],\n RestElement: [ 'argument' ],\n ReturnStatement: ['argument'],\n SequenceExpression: ['expressions'],\n SpreadElement: ['argument'],\n Super: [],\n SwitchStatement: ['discriminant', 'cases'],\n SwitchCase: ['test', 'consequent'],\n TaggedTemplateExpression: ['tag', 'quasi'],\n TemplateElement: [],\n TemplateLiteral: ['quasis', 'expressions'],\n ThisExpression: [],\n ThrowStatement: ['argument'],\n TryStatement: ['block', 'handler', 'finalizer'],\n UnaryExpression: ['argument'],\n UpdateExpression: ['argument'],\n VariableDeclaration: ['declarations'],\n VariableDeclarator: ['id', 'init'],\n WhileStatement: ['test', 'body'],\n WithStatement: ['object', 'body'],\n YieldExpression: ['argument']\n };\n\n // unique id\n BREAK = {};\n SKIP = {};\n REMOVE = {};\n\n VisitorOption = {\n Break: BREAK,\n Skip: SKIP,\n Remove: REMOVE\n };\n\n function Reference(parent, key) {\n this.parent = parent;\n this.key = key;\n }\n\n Reference.prototype.replace = function replace(node) {\n this.parent[this.key] = node;\n };\n\n Reference.prototype.remove = function remove() {\n if (Array.isArray(this.parent)) {\n this.parent.splice(this.key, 1);\n return true;\n } else {\n this.replace(null);\n return false;\n }\n };\n\n function Element(node, path, wrap, ref) {\n this.node = node;\n this.path = path;\n this.wrap = wrap;\n this.ref = ref;\n }\n\n function Controller() { }\n\n // API:\n // return property path array from root to current node\n Controller.prototype.path = function path() {\n var i, iz, j, jz, result, element;\n\n function addToPath(result, path) {\n if (Array.isArray(path)) {\n for (j = 0, jz = path.length; j < jz; ++j) {\n result.push(path[j]);\n }\n } else {\n result.push(path);\n }\n }\n\n // root node\n if (!this.__current.path) {\n return null;\n }\n\n // first node is sentinel, second node is root element\n result = [];\n for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {\n element = this.__leavelist[i];\n addToPath(result, element.path);\n }\n addToPath(result, this.__current.path);\n return result;\n };\n\n // API:\n // return type of current node\n Controller.prototype.type = function () {\n var node = this.current();\n return node.type || this.__current.wrap;\n };\n\n // API:\n // return array of parent elements\n Controller.prototype.parents = function parents() {\n var i, iz, result;\n\n // first node is sentinel\n result = [];\n for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {\n result.push(this.__leavelist[i].node);\n }\n\n return result;\n };\n\n // API:\n // return current node\n Controller.prototype.current = function current() {\n return this.__current.node;\n };\n\n Controller.prototype.__execute = function __execute(callback, element) {\n var previous, result;\n\n result = undefined;\n\n previous = this.__current;\n this.__current = element;\n this.__state = null;\n if (callback) {\n result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);\n }\n this.__current = previous;\n\n return result;\n };\n\n // API:\n // notify control skip / break\n Controller.prototype.notify = function notify(flag) {\n this.__state = flag;\n };\n\n // API:\n // skip child nodes of current node\n Controller.prototype.skip = function () {\n this.notify(SKIP);\n };\n\n // API:\n // break traversals\n Controller.prototype['break'] = function () {\n this.notify(BREAK);\n };\n\n // API:\n // remove node\n Controller.prototype.remove = function () {\n this.notify(REMOVE);\n };\n\n Controller.prototype.__initialize = function(root, visitor) {\n this.visitor = visitor;\n this.root = root;\n this.__worklist = [];\n this.__leavelist = [];\n this.__current = null;\n this.__state = null;\n this.__fallback = null;\n if (visitor.fallback === 'iteration') {\n this.__fallback = Object.keys;\n } else if (typeof visitor.fallback === 'function') {\n this.__fallback = visitor.fallback;\n }\n\n this.__keys = VisitorKeys;\n if (visitor.keys) {\n this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);\n }\n };\n\n function isNode(node) {\n if (node == null) {\n return false;\n }\n return typeof node === 'object' && typeof node.type === 'string';\n }\n\n function isProperty(nodeType, key) {\n return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;\n }\n \n function candidateExistsInLeaveList(leavelist, candidate) {\n for (var i = leavelist.length - 1; i >= 0; --i) {\n if (leavelist[i].node === candidate) {\n return true;\n }\n }\n return false;\n }\n\n Controller.prototype.traverse = function traverse(root, visitor) {\n var worklist,\n leavelist,\n element,\n node,\n nodeType,\n ret,\n key,\n current,\n current2,\n candidates,\n candidate,\n sentinel;\n\n this.__initialize(root, visitor);\n\n sentinel = {};\n\n // reference\n worklist = this.__worklist;\n leavelist = this.__leavelist;\n\n // initialize\n worklist.push(new Element(root, null, null, null));\n leavelist.push(new Element(null, null, null, null));\n\n while (worklist.length) {\n element = worklist.pop();\n\n if (element === sentinel) {\n element = leavelist.pop();\n\n ret = this.__execute(visitor.leave, element);\n\n if (this.__state === BREAK || ret === BREAK) {\n return;\n }\n continue;\n }\n\n if (element.node) {\n\n ret = this.__execute(visitor.enter, element);\n\n if (this.__state === BREAK || ret === BREAK) {\n return;\n }\n\n worklist.push(sentinel);\n leavelist.push(element);\n\n if (this.__state === SKIP || ret === SKIP) {\n continue;\n }\n\n node = element.node;\n nodeType = node.type || element.wrap;\n candidates = this.__keys[nodeType];\n if (!candidates) {\n if (this.__fallback) {\n candidates = this.__fallback(node);\n } else {\n throw new Error('Unknown node type ' + nodeType + '.');\n }\n }\n\n current = candidates.length;\n while ((current -= 1) >= 0) {\n key = candidates[current];\n candidate = node[key];\n if (!candidate) {\n continue;\n }\n\n if (Array.isArray(candidate)) {\n current2 = candidate.length;\n while ((current2 -= 1) >= 0) {\n if (!candidate[current2]) {\n continue;\n }\n\n if (candidateExistsInLeaveList(leavelist, candidate[current2])) {\n continue;\n }\n\n if (isProperty(nodeType, candidates[current])) {\n element = new Element(candidate[current2], [key, current2], 'Property', null);\n } else if (isNode(candidate[current2])) {\n element = new Element(candidate[current2], [key, current2], null, null);\n } else {\n continue;\n }\n worklist.push(element);\n }\n } else if (isNode(candidate)) {\n if (candidateExistsInLeaveList(leavelist, candidate)) {\n continue;\n }\n\n worklist.push(new Element(candidate, key, null, null));\n }\n }\n }\n }\n };\n\n Controller.prototype.replace = function replace(root, visitor) {\n var worklist,\n leavelist,\n node,\n nodeType,\n target,\n element,\n current,\n current2,\n candidates,\n candidate,\n sentinel,\n outer,\n key;\n\n function removeElem(element) {\n var i,\n key,\n nextElem,\n parent;\n\n if (element.ref.remove()) {\n // When the reference is an element of an array.\n key = element.ref.key;\n parent = element.ref.parent;\n\n // If removed from array, then decrease following items' keys.\n i = worklist.length;\n while (i--) {\n nextElem = worklist[i];\n if (nextElem.ref && nextElem.ref.parent === parent) {\n if (nextElem.ref.key < key) {\n break;\n }\n --nextElem.ref.key;\n }\n }\n }\n }\n\n this.__initialize(root, visitor);\n\n sentinel = {};\n\n // reference\n worklist = this.__worklist;\n leavelist = this.__leavelist;\n\n // initialize\n outer = {\n root: root\n };\n element = new Element(root, null, null, new Reference(outer, 'root'));\n worklist.push(element);\n leavelist.push(element);\n\n while (worklist.length) {\n element = worklist.pop();\n\n if (element === sentinel) {\n element = leavelist.pop();\n\n target = this.__execute(visitor.leave, element);\n\n // node may be replaced with null,\n // so distinguish between undefined and null in this place\n if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {\n // replace\n element.ref.replace(target);\n }\n\n if (this.__state === REMOVE || target === REMOVE) {\n removeElem(element);\n }\n\n if (this.__state === BREAK || target === BREAK) {\n return outer.root;\n }\n continue;\n }\n\n target = this.__execute(visitor.enter, element);\n\n // node may be replaced with null,\n // so distinguish between undefined and null in this place\n if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {\n // replace\n element.ref.replace(target);\n element.node = target;\n }\n\n if (this.__state === REMOVE || target === REMOVE) {\n removeElem(element);\n element.node = null;\n }\n\n if (this.__state === BREAK || target === BREAK) {\n return outer.root;\n }\n\n // node may be null\n node = element.node;\n if (!node) {\n continue;\n }\n\n worklist.push(sentinel);\n leavelist.push(element);\n\n if (this.__state === SKIP || target === SKIP) {\n continue;\n }\n\n nodeType = node.type || element.wrap;\n candidates = this.__keys[nodeType];\n if (!candidates) {\n if (this.__fallback) {\n candidates = this.__fallback(node);\n } else {\n throw new Error('Unknown node type ' + nodeType + '.');\n }\n }\n\n current = candidates.length;\n while ((current -= 1) >= 0) {\n key = candidates[current];\n candidate = node[key];\n if (!candidate) {\n continue;\n }\n\n if (Array.isArray(candidate)) {\n current2 = candidate.length;\n while ((current2 -= 1) >= 0) {\n if (!candidate[current2]) {\n continue;\n }\n if (isProperty(nodeType, candidates[current])) {\n element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));\n } else if (isNode(candidate[current2])) {\n element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));\n } else {\n continue;\n }\n worklist.push(element);\n }\n } else if (isNode(candidate)) {\n worklist.push(new Element(candidate, key, null, new Reference(node, key)));\n }\n }\n }\n\n return outer.root;\n };\n\n function traverse(root, visitor) {\n var controller = new Controller();\n return controller.traverse(root, visitor);\n }\n\n function replace(root, visitor) {\n var controller = new Controller();\n return controller.replace(root, visitor);\n }\n\n function extendCommentRange(comment, tokens) {\n var target;\n\n target = upperBound(tokens, function search(token) {\n return token.range[0] > comment.range[0];\n });\n\n comment.extendedRange = [comment.range[0], comment.range[1]];\n\n if (target !== tokens.length) {\n comment.extendedRange[1] = tokens[target].range[0];\n }\n\n target -= 1;\n if (target >= 0) {\n comment.extendedRange[0] = tokens[target].range[1];\n }\n\n return comment;\n }\n\n function attachComments(tree, providedComments, tokens) {\n // At first, we should calculate extended comment ranges.\n var comments = [], comment, len, i, cursor;\n\n if (!tree.range) {\n throw new Error('attachComments needs range information');\n }\n\n // tokens array is empty, we attach comments to tree as 'leadingComments'\n if (!tokens.length) {\n if (providedComments.length) {\n for (i = 0, len = providedComments.length; i < len; i += 1) {\n comment = deepCopy(providedComments[i]);\n comment.extendedRange = [0, tree.range[0]];\n comments.push(comment);\n }\n tree.leadingComments = comments;\n }\n return tree;\n }\n\n for (i = 0, len = providedComments.length; i < len; i += 1) {\n comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));\n }\n\n // This is based on John Freeman's implementation.\n cursor = 0;\n traverse(tree, {\n enter: function (node) {\n var comment;\n\n while (cursor < comments.length) {\n comment = comments[cursor];\n if (comment.extendedRange[1] > node.range[0]) {\n break;\n }\n\n if (comment.extendedRange[1] === node.range[0]) {\n if (!node.leadingComments) {\n node.leadingComments = [];\n }\n node.leadingComments.push(comment);\n comments.splice(cursor, 1);\n } else {\n cursor += 1;\n }\n }\n\n // already out of owned node\n if (cursor === comments.length) {\n return VisitorOption.Break;\n }\n\n if (comments[cursor].extendedRange[0] > node.range[1]) {\n return VisitorOption.Skip;\n }\n }\n });\n\n cursor = 0;\n traverse(tree, {\n leave: function (node) {\n var comment;\n\n while (cursor < comments.length) {\n comment = comments[cursor];\n if (node.range[1] < comment.extendedRange[0]) {\n break;\n }\n\n if (node.range[1] === comment.extendedRange[0]) {\n if (!node.trailingComments) {\n node.trailingComments = [];\n }\n node.trailingComments.push(comment);\n comments.splice(cursor, 1);\n } else {\n cursor += 1;\n }\n }\n\n // already out of owned node\n if (cursor === comments.length) {\n return VisitorOption.Break;\n }\n\n if (comments[cursor].extendedRange[0] > node.range[1]) {\n return VisitorOption.Skip;\n }\n }\n });\n\n return tree;\n }\n\n exports.Syntax = Syntax;\n exports.traverse = traverse;\n exports.replace = replace;\n exports.attachComments = attachComments;\n exports.VisitorKeys = VisitorKeys;\n exports.VisitorOption = VisitorOption;\n exports.Controller = Controller;\n exports.cloneEnvironment = function () { return clone({}); };\n\n return exports;\n}(exports));\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function(root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n }\n})(this, function() {\n \"use strict\";\n\n function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }\n\n function peg$SyntaxError(message, expected, found, location) {\n this.message = message;\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(this, peg$SyntaxError);\n }\n }\n\n peg$subclass(peg$SyntaxError, Error);\n\n peg$SyntaxError.buildMessage = function(expected, found) {\n var DESCRIBE_EXPECTATION_FNS = {\n literal: function(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n \"class\": function(expectation) {\n var escapedParts = \"\",\n i;\n\n for (i = 0; i < expectation.parts.length; i++) {\n escapedParts += expectation.parts[i] instanceof Array\n ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n : classEscape(expectation.parts[i]);\n }\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n },\n\n any: function(expectation) {\n return \"any character\";\n },\n\n end: function(expectation) {\n return \"end of input\";\n },\n\n other: function(expectation) {\n return expectation.description;\n }\n };\n\n function hex(ch) {\n return ch.charCodeAt(0).toString(16).toUpperCase();\n }\n\n function literalEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function classEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\]/g, '\\\\]')\n .replace(/\\^/g, '\\\\^')\n .replace(/-/g, '\\\\-')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n var descriptions = new Array(expected.length),\n i, j;\n\n for (i = 0; i < expected.length; i++) {\n descriptions[i] = describeExpectation(expected[i]);\n }\n\n descriptions.sort();\n\n if (descriptions.length > 0) {\n for (i = 1, j = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n };\n\n function peg$parse(input, options) {\n options = options !== void 0 ? options : {};\n\n var peg$FAILED = {},\n\n peg$startRuleFunctions = { start: peg$parsestart },\n peg$startRuleFunction = peg$parsestart,\n\n peg$c0 = function(ss) {\n return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };\n },\n peg$c1 = function() { return void 0; },\n peg$c2 = \" \",\n peg$c3 = peg$literalExpectation(\" \", false),\n peg$c4 = /^[^ [\\],():#!=><~+.]/,\n peg$c5 = peg$classExpectation([\" \", \"[\", \"]\", \",\", \"(\", \")\", \":\", \"#\", \"!\", \"=\", \">\", \"<\", \"~\", \"+\", \".\"], true, false),\n peg$c6 = function(i) { return i.join(''); },\n peg$c7 = \">\",\n peg$c8 = peg$literalExpectation(\">\", false),\n peg$c9 = function() { return 'child'; },\n peg$c10 = \"~\",\n peg$c11 = peg$literalExpectation(\"~\", false),\n peg$c12 = function() { return 'sibling'; },\n peg$c13 = \"+\",\n peg$c14 = peg$literalExpectation(\"+\", false),\n peg$c15 = function() { return 'adjacent'; },\n peg$c16 = function() { return 'descendant'; },\n peg$c17 = \",\",\n peg$c18 = peg$literalExpectation(\",\", false),\n peg$c19 = function(s, ss) {\n return [s].concat(ss.map(function (s) { return s[3]; }));\n },\n peg$c20 = function(op, s) {\n if (!op) return s;\n return { type: op, left: { type: 'exactNode' }, right: s };\n },\n peg$c21 = function(a, ops) {\n return ops.reduce(function (memo, rhs) {\n return { type: rhs[0], left: memo, right: rhs[1] };\n }, a);\n },\n peg$c22 = \"!\",\n peg$c23 = peg$literalExpectation(\"!\", false),\n peg$c24 = function(subject, as) {\n const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };\n if(subject) b.subject = true;\n return b;\n },\n peg$c25 = \"*\",\n peg$c26 = peg$literalExpectation(\"*\", false),\n peg$c27 = function(a) { return { type: 'wildcard', value: a }; },\n peg$c28 = \"#\",\n peg$c29 = peg$literalExpectation(\"#\", false),\n peg$c30 = function(i) { return { type: 'identifier', value: i }; },\n peg$c31 = \"[\",\n peg$c32 = peg$literalExpectation(\"[\", false),\n peg$c33 = \"]\",\n peg$c34 = peg$literalExpectation(\"]\", false),\n peg$c35 = function(v) { return v; },\n peg$c36 = /^[>\", \"<\", \"!\"], false, false),\n peg$c38 = \"=\",\n peg$c39 = peg$literalExpectation(\"=\", false),\n peg$c40 = function(a) { return (a || '') + '='; },\n peg$c41 = /^[><]/,\n peg$c42 = peg$classExpectation([\">\", \"<\"], false, false),\n peg$c43 = \".\",\n peg$c44 = peg$literalExpectation(\".\", false),\n peg$c45 = function(a, as) {\n return [].concat.apply([a], as).join('');\n },\n peg$c46 = function(name, op, value) {\n return { type: 'attribute', name: name, operator: op, value: value };\n },\n peg$c47 = function(name) { return { type: 'attribute', name: name }; },\n peg$c48 = \"\\\"\",\n peg$c49 = peg$literalExpectation(\"\\\"\", false),\n peg$c50 = /^[^\\\\\"]/,\n peg$c51 = peg$classExpectation([\"\\\\\", \"\\\"\"], true, false),\n peg$c52 = \"\\\\\",\n peg$c53 = peg$literalExpectation(\"\\\\\", false),\n peg$c54 = peg$anyExpectation(),\n peg$c55 = function(a, b) { return a + b; },\n peg$c56 = function(d) {\n return { type: 'literal', value: strUnescape(d.join('')) };\n },\n peg$c57 = \"'\",\n peg$c58 = peg$literalExpectation(\"'\", false),\n peg$c59 = /^[^\\\\']/,\n peg$c60 = peg$classExpectation([\"\\\\\", \"'\"], true, false),\n peg$c61 = /^[0-9]/,\n peg$c62 = peg$classExpectation([[\"0\", \"9\"]], false, false),\n peg$c63 = function(a, b) {\n // Can use `a.flat().join('')` once supported\n const leadingDecimals = a ? [].concat.apply([], a).join('') : '';\n return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };\n },\n peg$c64 = function(i) { return { type: 'literal', value: i }; },\n peg$c65 = \"type(\",\n peg$c66 = peg$literalExpectation(\"type(\", false),\n peg$c67 = /^[^ )]/,\n peg$c68 = peg$classExpectation([\" \", \")\"], true, false),\n peg$c69 = \")\",\n peg$c70 = peg$literalExpectation(\")\", false),\n peg$c71 = function(t) { return { type: 'type', value: t.join('') }; },\n peg$c72 = /^[imsu]/,\n peg$c73 = peg$classExpectation([\"i\", \"m\", \"s\", \"u\"], false, false),\n peg$c74 = \"/\",\n peg$c75 = peg$literalExpectation(\"/\", false),\n peg$c76 = /^[^\\/]/,\n peg$c77 = peg$classExpectation([\"/\"], true, false),\n peg$c78 = function(d, flgs) { return {\n type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') };\n },\n peg$c79 = function(i, is) {\n return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};\n },\n peg$c80 = \":not(\",\n peg$c81 = peg$literalExpectation(\":not(\", false),\n peg$c82 = function(ss) { return { type: 'not', selectors: ss }; },\n peg$c83 = \":matches(\",\n peg$c84 = peg$literalExpectation(\":matches(\", false),\n peg$c85 = function(ss) { return { type: 'matches', selectors: ss }; },\n peg$c86 = \":has(\",\n peg$c87 = peg$literalExpectation(\":has(\", false),\n peg$c88 = function(ss) { return { type: 'has', selectors: ss }; },\n peg$c89 = \":first-child\",\n peg$c90 = peg$literalExpectation(\":first-child\", false),\n peg$c91 = function() { return nth(1); },\n peg$c92 = \":last-child\",\n peg$c93 = peg$literalExpectation(\":last-child\", false),\n peg$c94 = function() { return nthLast(1); },\n peg$c95 = \":nth-child(\",\n peg$c96 = peg$literalExpectation(\":nth-child(\", false),\n peg$c97 = function(n) { return nth(parseInt(n.join(''), 10)); },\n peg$c98 = \":nth-last-child(\",\n peg$c99 = peg$literalExpectation(\":nth-last-child(\", false),\n peg$c100 = function(n) { return nthLast(parseInt(n.join(''), 10)); },\n peg$c101 = \":\",\n peg$c102 = peg$literalExpectation(\":\", false),\n peg$c103 = function(c) {\n return { type: 'class', name: c };\n },\n\n peg$currPos = 0,\n peg$savedPos = 0,\n peg$posDetailsCache = [{ line: 1, column: 1 }],\n peg$maxFailPos = 0,\n peg$maxFailExpected = [],\n peg$silentFails = 0,\n\n peg$resultsCache = {},\n\n peg$result;\n\n if (\"startRule\" in options) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase) {\n return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description: description };\n }\n\n function peg$computePosDetails(pos) {\n var details = peg$posDetailsCache[pos], p;\n\n if (details) {\n return details;\n } else {\n p = pos - 1;\n while (!peg$posDetailsCache[p]) {\n p--;\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos) {\n var startPosDetails = peg$computePosDetails(startPos),\n endPosDetails = peg$computePosDetails(endPos);\n\n return {\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parsestart() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 0,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseselectors();\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c1();\n }\n s0 = s1;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parse_() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 1,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseidentifierName() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 2,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c4.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c5); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c4.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c5); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c6(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsebinaryOp() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 3,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 62) {\n s2 = peg$c7;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c8); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c9();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 126) {\n s2 = peg$c10;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c12();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 43) {\n s2 = peg$c13;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c14); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c15();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c16();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehasSelectors() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n var key = peg$currPos * 32 + 4,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsehasSelector();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parsehasSelector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parsehasSelector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c19(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseselectors() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n var key = peg$currPos * 32 + 5,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseselector();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseselector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseselector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c19(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehasSelector() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 6,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsebinaryOp();\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseselector();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c20(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseselector() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 7,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsesequence();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parsebinaryOp();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsesequence();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parsebinaryOp();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsesequence();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c21(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsesequence() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 8,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 33) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseatom();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseatom();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c24(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseatom() {\n var s0;\n\n var key = peg$currPos * 32 + 9,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$parsewildcard();\n if (s0 === peg$FAILED) {\n s0 = peg$parseidentifier();\n if (s0 === peg$FAILED) {\n s0 = peg$parseattr();\n if (s0 === peg$FAILED) {\n s0 = peg$parsefield();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenegation();\n if (s0 === peg$FAILED) {\n s0 = peg$parsematches();\n if (s0 === peg$FAILED) {\n s0 = peg$parsehas();\n if (s0 === peg$FAILED) {\n s0 = peg$parsefirstChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parselastChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenthChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenthLastChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parseclass();\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsewildcard() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 10,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 42) {\n s1 = peg$c25;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c26); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c27(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseidentifier() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 11,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c28;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c29); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c30(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattr() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 12,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c31;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c32); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrValue();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s5 = peg$c33;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c34); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c35(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrOps() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 13,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (peg$c36.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c37); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 61) {\n s2 = peg$c38;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c39); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c40(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n if (peg$c41.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c42); }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrEqOps() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 14,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 33) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 61) {\n s2 = peg$c38;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c39); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c40(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrName() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 15,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseidentifierName();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c43;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseidentifierName();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c43;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseidentifierName();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c45(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrValue() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 16,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrEqOps();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsetype();\n if (s5 === peg$FAILED) {\n s5 = peg$parseregex();\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c46(s1, s3, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrOps();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsestring();\n if (s5 === peg$FAILED) {\n s5 = peg$parsenumber();\n if (s5 === peg$FAILED) {\n s5 = peg$parsepath();\n }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c46(s1, s3, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c47(s1);\n }\n s0 = s1;\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsestring() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 17,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c48;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c49); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c50.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c51); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c50.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c51); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c48;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c49); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c56(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c57;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c58); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c59.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c60); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c59.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c60); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c57;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c58); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c56(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenumber() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 18,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s3 = peg$c43;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c63(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsepath() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 19,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseidentifierName();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c64(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsetype() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 20,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c65) {\n s1 = peg$c65;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c66); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c67.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c68); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c67.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c68); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c71(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseflags() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 21,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = [];\n if (peg$c72.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c73); }\n }\n if (s1 !== peg$FAILED) {\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (peg$c72.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c73); }\n }\n }\n } else {\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseregex() {\n var s0, s1, s2, s3, s4;\n\n var key = peg$currPos * 32 + 22,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 47) {\n s1 = peg$c74;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c75); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c76.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c77); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c76.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c77); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 47) {\n s3 = peg$c74;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c75); }\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parseflags();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c78(s2, s4);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsefield() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n var key = peg$currPos * 32 + 23,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s1 = peg$c43;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c43;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseidentifierName();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c43;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseidentifierName();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c79(s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenegation() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 24,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c80) {\n s1 = peg$c80;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c81); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseselectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c82(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsematches() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 25,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 9) === peg$c83) {\n s1 = peg$c83;\n peg$currPos += 9;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c84); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseselectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c85(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehas() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 26,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c86) {\n s1 = peg$c86;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c87); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parsehasSelectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c88(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsefirstChild() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 27,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 12) === peg$c89) {\n s1 = peg$c89;\n peg$currPos += 12;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c91();\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parselastChild() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 28,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 11) === peg$c92) {\n s1 = peg$c92;\n peg$currPos += 11;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c93); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c94();\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenthChild() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 29,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 11) === peg$c95) {\n s1 = peg$c95;\n peg$currPos += 11;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c96); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c97(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenthLastChild() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 30,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 16) === peg$c98) {\n s1 = peg$c98;\n peg$currPos += 16;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c99); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c100(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseclass() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 31,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 58) {\n s1 = peg$c101;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c102); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c103(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n\n function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }\n function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }\n function strUnescape(s) {\n return s.replace(/\\\\(.)/g, function(match, ch) {\n switch(ch) {\n case 'b': return '\\b';\n case 'f': return '\\f';\n case 'n': return '\\n';\n case 'r': return '\\r';\n case 't': return '\\t';\n case 'v': return '\\v';\n default: return ch;\n }\n });\n }\n\n\n peg$result = peg$startRuleFunction();\n\n if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n return peg$result;\n } else {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n }\n\n return {\n SyntaxError: peg$SyntaxError,\n parse: peg$parse\n };\n});\n","/* vim: set sw=4 sts=4 : */\nimport estraverse from 'estraverse';\nimport parser from './parser.js';\n\n/**\n* @typedef {\"LEFT_SIDE\"|\"RIGHT_SIDE\"} Side\n*/\n\nconst LEFT_SIDE = 'LEFT_SIDE';\nconst RIGHT_SIDE = 'RIGHT_SIDE';\n\n/**\n * @external AST\n * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html\n */\n\n/**\n * One of the rules of `grammar.pegjs`\n * @typedef {PlainObject} SelectorAST\n * @see grammar.pegjs\n*/\n\n/**\n * The `sequence` production of `grammar.pegjs`\n * @typedef {PlainObject} SelectorSequenceAST\n*/\n\n/**\n * Get the value of a property which may be multiple levels down\n * in the object.\n * @param {?PlainObject} obj\n * @param {string[]} keys\n * @returns {undefined|boolean|string|number|external:AST}\n */\nfunction getPath(obj, keys) {\n for (let i = 0; i < keys.length; ++i) {\n if (obj == null) { return obj; }\n obj = obj[keys[i]];\n }\n return obj;\n}\n\n/**\n * Determine whether `node` can be reached by following `path`,\n * starting at `ancestor`.\n * @param {?external:AST} node\n * @param {?external:AST} ancestor\n * @param {string[]} path\n * @param {Integer} fromPathIndex\n * @returns {boolean}\n */\nfunction inPath(node, ancestor, path, fromPathIndex) {\n let current = ancestor;\n for (let i = fromPathIndex; i < path.length; ++i) {\n if (current == null) {\n return false;\n }\n const field = current[path[i]];\n if (Array.isArray(field)) {\n for (let k = 0; k < field.length; ++k) {\n if (inPath(node, field[k], path, i + 1)) {\n return true;\n }\n }\n return false;\n }\n current = field;\n }\n return node === current;\n}\n\n/**\n * A generated matcher function for a selector.\n * @callback SelectorMatcher\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @returns {void}\n*/\n\n/**\n * A WeakMap for holding cached matcher functions for selectors.\n * @type {WeakMap}\n*/\nconst MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap : null;\n\n/**\n * Look up a matcher function for `selector` in the cache.\n * If it does not exist, generate it with `generateMatcher` and add it to the cache.\n * In engines without WeakMap, the caching is skipped and matchers are generated with every call.\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction getMatcher(selector) {\n if (selector == null) {\n return () => true;\n }\n\n if (MATCHER_CACHE != null) {\n let matcher = MATCHER_CACHE.get(selector);\n if (matcher != null) {\n return matcher;\n }\n matcher = generateMatcher(selector);\n MATCHER_CACHE.set(selector, matcher);\n return matcher;\n }\n\n return generateMatcher(selector);\n}\n\n/**\n * Create a matcher function for `selector`,\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction generateMatcher(selector) {\n switch(selector.type) {\n case 'wildcard':\n return () => true;\n\n case 'identifier': {\n const value = selector.value.toLowerCase();\n return (node, ancestry, options) => {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n return value === node[nodeTypeKey].toLowerCase();\n };\n }\n\n case 'exactNode':\n return (node, ancestry) => {\n return ancestry.length === 0;\n };\n\n case 'field': {\n const path = selector.name.split('.');\n return (node, ancestry) => {\n const ancestor = ancestry[path.length - 1];\n return inPath(node, ancestor, path, 0);\n };\n }\n\n case 'matches': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, ancestry, options)) { return true; }\n }\n return false;\n };\n }\n\n case 'compound': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (!matchers[i](node, ancestry, options)) { return false; }\n }\n return true;\n };\n }\n\n case 'not': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, ancestry, options)) { return false; }\n }\n return true;\n };\n }\n\n case 'has': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n let result = false;\n\n const a = [];\n estraverse.traverse(node, {\n enter (node, parent) {\n if (parent != null) { a.unshift(parent); }\n\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, a, options)) {\n result = true;\n this.break();\n return;\n }\n }\n },\n leave () { a.shift(); },\n keys: options && options.visitorKeys,\n fallback: options && options.fallback || 'iteration'\n });\n\n return result;\n };\n }\n\n case 'child': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) => {\n if (ancestry.length > 0 && right(node, ancestry, options)) {\n return left(ancestry[0], ancestry.slice(1), options);\n }\n return false;\n };\n }\n\n case 'descendant': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) => {\n if (right(node, ancestry, options)) {\n for (let i = 0, l = ancestry.length; i < l; ++i) {\n if (left(ancestry[i], ancestry.slice(i + 1), options)) {\n return true;\n }\n }\n }\n return false;\n };\n }\n\n case 'attribute': {\n const path = selector.name.split('.');\n switch (selector.operator) {\n case void 0:\n return (node) => getPath(node, path) != null;\n case '=':\n switch (selector.value.type) {\n case 'regexp':\n return (node) => {\n const p = getPath(node, path);\n return typeof p === 'string' && selector.value.value.test(p);\n };\n case 'literal': {\n const literal = `${selector.value.value}`;\n return (node) => literal === `${getPath(node, path)}`;\n }\n case 'type':\n return (node) => selector.value.value === typeof getPath(node, path);\n }\n throw new Error(`Unknown selector value type: ${selector.value.type}`);\n case '!=':\n switch (selector.value.type) {\n case 'regexp':\n return (node) => !selector.value.value.test(getPath(node, path));\n case 'literal': {\n const literal = `${selector.value.value}`;\n return (node) => literal !== `${getPath(node, path)}`;\n }\n case 'type':\n return (node) => selector.value.value !== typeof getPath(node, path);\n }\n throw new Error(`Unknown selector value type: ${selector.value.type}`);\n case '<=':\n return (node) => getPath(node, path) <= selector.value.value;\n case '<':\n return (node) => getPath(node, path) < selector.value.value;\n case '>':\n return (node) => getPath(node, path) > selector.value.value;\n case '>=':\n return (node) => getPath(node, path) >= selector.value.value;\n }\n throw new Error(`Unknown operator: ${selector.operator}`);\n }\n\n case 'sibling': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n sibling(node, left, ancestry, LEFT_SIDE, options) ||\n selector.left.subject &&\n left(node, ancestry, options) &&\n sibling(node, right, ancestry, RIGHT_SIDE, options);\n }\n\n case 'adjacent': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n adjacent(node, left, ancestry, LEFT_SIDE, options) ||\n selector.right.subject &&\n left(node, ancestry, options) &&\n adjacent(node, right, ancestry, RIGHT_SIDE, options);\n }\n\n case 'nth-child': {\n const nth = selector.index.value;\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n nthChild(node, ancestry, nth, options);\n }\n\n case 'nth-last-child': {\n const nth = -selector.index.value;\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n nthChild(node, ancestry, nth, options);\n }\n\n case 'class': {\n \n const name = selector.name.toLowerCase();\n\n return (node, ancestry, options) => {\n \n if (options && options.matchClass) {\n return options.matchClass(selector.name, node, ancestry);\n }\n \n if (options && options.nodeTypeKey) return false; \n\n switch(name){\n case 'statement':\n if(node.type.slice(-9) === 'Statement') return true;\n // fallthrough: interface Declaration <: Statement { }\n case 'declaration':\n return node.type.slice(-11) === 'Declaration';\n case 'pattern':\n if(node.type.slice(-7) === 'Pattern') return true;\n // fallthrough: interface Expression <: Node, Pattern { }\n case 'expression':\n return node.type.slice(-10) === 'Expression' ||\n node.type.slice(-7) === 'Literal' ||\n (\n node.type === 'Identifier' &&\n (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')\n ) ||\n node.type === 'MetaProperty';\n case 'function':\n return node.type === 'FunctionDeclaration' ||\n node.type === 'FunctionExpression' ||\n node.type === 'ArrowFunctionExpression';\n }\n throw new Error(`Unknown class name: ${selector.name}`);\n };\n }\n }\n\n throw new Error(`Unknown selector type: ${selector.type}`);\n}\n\n/**\n * @callback TraverseOptionFallback\n * @param {external:AST} node The given node.\n * @returns {string[]} An array of visitor keys for the given node.\n */\n\n/**\n * @callback ClassMatcher\n * @param {string} className The name of the class to match.\n * @param {external:AST} node The node to match against.\n * @param {Array} ancestry The ancestry of the node.\n * @returns {boolean} True if the node matches the class, false if not.\n */\n\n/**\n * @typedef {object} ESQueryOptions\n * @property {string} [nodeTypeKey=\"type\"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.\n * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.\n * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.\n * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.\n */\n\n/**\n * Given a `node` and its ancestors, determine if `node` is matched\n * by `selector`.\n * @param {?external:AST} node\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @throws {Error} Unknowns (operator, class name, selector type, or\n * selector value type)\n * @returns {boolean}\n */\nfunction matches(node, selector, ancestry, options) {\n if (!selector) { return true; }\n if (!node) { return false; }\n if (!ancestry) { ancestry = []; }\n\n return getMatcher(selector)(node, ancestry, options);\n}\n\n/**\n * Get visitor keys of a given node.\n * @param {external:AST} node The AST node to get keys.\n * @param {ESQueryOptions|undefined} options\n * @returns {string[]} Visitor keys of the node.\n */\nfunction getVisitorKeys(node, options) {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n\n const nodeType = node[nodeTypeKey];\n if (options && options.visitorKeys && options.visitorKeys[nodeType]) {\n return options.visitorKeys[nodeType];\n }\n if (estraverse.VisitorKeys[nodeType]) {\n return estraverse.VisitorKeys[nodeType];\n }\n if (options && typeof options.fallback === 'function') {\n return options.fallback(node);\n }\n // 'iteration' fallback\n return Object.keys(node).filter(function (key) {\n return key !== nodeTypeKey;\n });\n}\n\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} node The value to check.\n * @param {ESQueryOptions|undefined} options The options to use.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(node, options) {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n return node !== null && typeof node === 'object' && typeof node[nodeTypeKey] === 'string';\n}\n\n/**\n * Determines if the given node has a sibling that matches the\n * given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction sibling(node, matcher, ancestry, side, options) {\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)) {\n const startIndex = listProp.indexOf(node);\n if (startIndex < 0) { continue; }\n let lowerBound, upperBound;\n if (side === LEFT_SIDE) {\n lowerBound = 0;\n upperBound = startIndex;\n } else {\n lowerBound = startIndex + 1;\n upperBound = listProp.length;\n }\n for (let k = lowerBound; k < upperBound; ++k) {\n if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Determines if the given node has an adjacent sibling that matches\n * the given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction adjacent(node, matcher, ancestry, side, options) {\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)) {\n const idx = listProp.indexOf(node);\n if (idx < 0) { continue; }\n if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {\n return true;\n }\n if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Determines if the given node is the `nth` child.\n * If `nth` is negative then the position is counted\n * from the end of the list of children.\n * @param {external:AST} node\n * @param {external:AST[]} ancestry\n * @param {Integer} nth\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction nthChild(node, ancestry, nth, options) {\n if (nth === 0) { return false; }\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)){\n const idx = nth < 0 ? listProp.length + nth : nth - 1;\n if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * For each selector node marked as a subject, find the portion of the\n * selector that the subject must match.\n * @param {SelectorAST} selector\n * @param {SelectorAST} [ancestor] Defaults to `selector`\n * @returns {SelectorAST[]}\n */\nfunction subjects(selector, ancestor) {\n if (selector == null || typeof selector != 'object') { return []; }\n if (ancestor == null) { ancestor = selector; }\n const results = selector.subject ? [ancestor] : [];\n const keys = Object.keys(selector);\n for (let i = 0; i < keys.length; ++i) {\n const p = keys[i];\n const sel = selector[p];\n results.push(...subjects(sel, p === 'left' ? sel : ancestor));\n }\n return results;\n}\n\n/**\n* @callback TraverseVisitor\n* @param {?external:AST} node\n* @param {?external:AST} parent\n* @param {external:AST[]} ancestry\n*/\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {TraverseVisitor} visitor\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction traverse(ast, selector, visitor, options) {\n if (!selector) { return; }\n const ancestry = [];\n const matcher = getMatcher(selector);\n const altSubjects = subjects(selector).map(getMatcher);\n estraverse.traverse(ast, {\n enter (node, parent) {\n if (parent != null) { ancestry.unshift(parent); }\n if (matcher(node, ancestry, options)) {\n if (altSubjects.length) {\n for (let i = 0, l = altSubjects.length; i < l; ++i) {\n if (altSubjects[i](node, ancestry, options)) {\n visitor(node, parent, ancestry);\n }\n for (let k = 0, m = ancestry.length; k < m; ++k) {\n const succeedingAncestry = ancestry.slice(k + 1);\n if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {\n visitor(ancestry[k], parent, succeedingAncestry);\n }\n }\n }\n } else {\n visitor(node, parent, ancestry);\n }\n }\n },\n leave () { ancestry.shift(); },\n keys: options && options.visitorKeys,\n fallback: options && options.fallback || 'iteration'\n });\n}\n\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction match(ast, selector, options) {\n const results = [];\n traverse(ast, selector, function (node) {\n results.push(node);\n }, options);\n return results;\n}\n\n/**\n * Parse a selector string and return its AST.\n * @param {string} selector\n * @returns {SelectorAST}\n */\nfunction parse(selector) {\n return parser.parse(selector);\n}\n\n/**\n * Query the code AST using the selector string.\n * @param {external:AST} ast\n * @param {string} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction query(ast, selector, options) {\n return match(ast, parse(selector), options);\n}\n\nquery.parse = parse;\nquery.match = match;\nquery.traverse = traverse;\nquery.matches = matches;\nquery.query = query;\n\nexport default query;\n"],"names":["clone","exports","Syntax","VisitorOption","VisitorKeys","BREAK","SKIP","REMOVE","deepCopy","obj","key","val","ret","hasOwnProperty","Reference","parent","this","Element","node","path","wrap","ref","Controller","isNode","type","isProperty","nodeType","ObjectExpression","ObjectPattern","candidateExistsInLeaveList","leavelist","candidate","i","length","traverse","root","visitor","extendCommentRange","comment","tokens","target","array","func","diff","len","current","upperBound","token","range","extendedRange","AssignmentExpression","AssignmentPattern","ArrayExpression","ArrayPattern","ArrowFunctionExpression","AwaitExpression","BlockStatement","BinaryExpression","BreakStatement","CallExpression","CatchClause","ChainExpression","ClassBody","ClassDeclaration","ClassExpression","ComprehensionBlock","ComprehensionExpression","ConditionalExpression","ContinueStatement","DebuggerStatement","DirectiveStatement","DoWhileStatement","EmptyStatement","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExportSpecifier","ExpressionStatement","ForStatement","ForInStatement","ForOfStatement","FunctionDeclaration","FunctionExpression","GeneratorExpression","Identifier","IfStatement","ImportExpression","ImportDeclaration","ImportDefaultSpecifier","ImportNamespaceSpecifier","ImportSpecifier","Literal","LabeledStatement","LogicalExpression","MemberExpression","MetaProperty","MethodDefinition","ModuleSpecifier","NewExpression","PrivateIdentifier","Program","Property","PropertyDefinition","RestElement","ReturnStatement","SequenceExpression","SpreadElement","Super","SwitchStatement","SwitchCase","TaggedTemplateExpression","TemplateElement","TemplateLiteral","ThisExpression","ThrowStatement","TryStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarator","WhileStatement","WithStatement","YieldExpression","Break","Skip","Remove","prototype","replace","remove","Array","isArray","splice","iz","j","jz","result","addToPath","push","__current","__leavelist","parents","__execute","callback","element","previous","undefined","__state","call","notify","flag","skip","__initialize","__worklist","__fallback","fallback","Object","keys","__keys","assign","create","worklist","current2","candidates","sentinel","pop","enter","Error","leave","outer","removeElem","nextElem","attachComments","tree","providedComments","cursor","comments","leadingComments","trailingComments","cloneEnvironment","module","peg$SyntaxError","message","expected","found","location","name","captureStackTrace","child","ctor","constructor","peg$subclass","buildMessage","DESCRIBE_EXPECTATION_FNS","literal","expectation","literalEscape","text","class","escapedParts","parts","classEscape","inverted","any","end","other","description","hex","ch","charCodeAt","toString","toUpperCase","s","descriptions","sort","slice","join","describeExpected","describeFound","SyntaxError","parse","input","options","peg$result","peg$FAILED","peg$startRuleFunctions","start","peg$parsestart","peg$startRuleFunction","peg$c3","peg$literalExpectation","peg$c4","peg$c5","peg$classExpectation","peg$c8","peg$c11","peg$c14","peg$c18","peg$c19","ss","concat","map","peg$c23","peg$c26","peg$c29","peg$c32","peg$c34","peg$c36","peg$c37","peg$c39","peg$c40","a","peg$c41","peg$c42","peg$c44","peg$c46","op","value","operator","peg$c49","peg$c50","peg$c51","peg$c53","peg$c54","peg$c55","b","peg$c56","d","match","peg$c58","peg$c59","peg$c60","peg$c61","peg$c62","peg$c66","peg$c67","peg$c68","peg$c70","peg$c72","peg$c73","peg$c75","peg$c76","peg$c77","peg$c81","peg$c84","peg$c87","peg$c90","peg$c93","peg$c96","peg$c99","peg$c102","peg$currPos","peg$posDetailsCache","line","column","peg$maxFailPos","peg$maxFailExpected","peg$silentFails","startRule","ignoreCase","peg$computePosDetails","pos","p","details","peg$computeLocation","startPos","endPos","startPosDetails","endPosDetails","offset","peg$fail","s0","s1","s2","cached","peg$resultsCache","nextPos","peg$parse_","peg$parseselectors","selectors","peg$c1","peg$parseidentifierName","test","charAt","peg$parsebinaryOp","s3","s4","s5","s6","s7","peg$parseselector","peg$parsehasSelector","left","right","peg$parsesequence","reduce","memo","rhs","subject","as","peg$parseatom","peg$parsewildcard","peg$parseidentifier","peg$parseattrName","peg$parseattrEqOps","substr","peg$parsetype","flgs","peg$parseflags","RegExp","peg$parseregex","peg$parseattrOps","peg$parsestring","leadingDecimals","apply","parseFloat","peg$parsenumber","peg$parsepath","peg$parseattrValue","peg$parseattr","peg$parsefield","peg$parsenegation","peg$parsematches","peg$parsehasSelectors","peg$parsehas","nth","peg$parsefirstChild","nthLast","peg$parselastChild","parseInt","peg$parsenthChild","peg$parsenthLastChild","peg$parseclass","n","index","factory","getPath","MATCHER_CACHE","WeakMap","getMatcher","selector","matcher","get","generateMatcher","set","toLowerCase","ancestry","nodeTypeKey","split","inPath","ancestor","fromPathIndex","field","k","matchers","estraverse","unshift","shift","visitorKeys","l","sibling","adjacent","nthChild","matchClass","getVisitorKeys","filter","_typeof","side","listProp","startIndex","indexOf","lowerBound","idx","ast","altSubjects","subjects","results","sel","m","succeedingAncestry","parser","query","matches"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/esquery/dist/esquery.js b/node_modules/esquery/dist/esquery.js new file mode 100644 index 0000000..ace6061 --- /dev/null +++ b/node_modules/esquery/dist/esquery.js @@ -0,0 +1,4180 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.esquery = factory()); +}(this, (function () { 'use strict'; + + function _iterableToArrayLimit(arr, i) { + var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; + if (null != _i) { + var _s, + _e, + _x, + _r, + _arr = [], + _n = !0, + _d = !1; + try { + if (_x = (_i = _i.call(arr)).next, 0 === i) { + if (Object(_i) !== _i) return; + _n = !1; + } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); + } catch (err) { + _d = !0, _e = err; + } finally { + try { + if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; + } finally { + if (_d) throw _e; + } + } + return _arr; + } + } + function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); + } + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var estraverse = createCommonjsModule(function (module, exports) { + /* + Copyright (C) 2012-2013 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + /*jslint vars:false, bitwise:true*/ + /*jshint indent:4*/ + /*global exports:true*/ + (function clone(exports) { + + var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE; + function deepCopy(obj) { + var ret = {}, + key, + val; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + val = obj[key]; + if (typeof val === 'object' && val !== null) { + ret[key] = deepCopy(val); + } else { + ret[key] = val; + } + } + } + return ret; + } + + // based on LLVM libc++ upper_bound / lower_bound + // MIT License + + function upperBound(array, func) { + var diff, len, i, current; + len = array.length; + i = 0; + while (len) { + diff = len >>> 1; + current = i + diff; + if (func(array[current])) { + len = diff; + } else { + i = current + 1; + len -= diff + 1; + } + } + return i; + } + Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', + // CAUTION: It's deferred to ES7. + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ChainExpression: 'ChainExpression', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ComprehensionBlock: 'ComprehensionBlock', + // CAUTION: It's deferred to ES7. + ComprehensionExpression: 'ComprehensionExpression', + // CAUTION: It's deferred to ES7. + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DirectiveStatement: 'DirectiveStatement', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GeneratorExpression: 'GeneratorExpression', + // CAUTION: It's deferred to ES7. + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + ModuleSpecifier: 'ModuleSpecifier', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + PrivateIdentifier: 'PrivateIdentifier', + Program: 'Program', + Property: 'Property', + PropertyDefinition: 'PropertyDefinition', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + VisitorKeys = { + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AwaitExpression: ['argument'], + // CAUTION: It's deferred to ES7. + BlockStatement: ['body'], + BinaryExpression: ['left', 'right'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ChainExpression: ['expression'], + ClassBody: ['body'], + ClassDeclaration: ['id', 'superClass', 'body'], + ClassExpression: ['id', 'superClass', 'body'], + ComprehensionBlock: ['left', 'right'], + // CAUTION: It's deferred to ES7. + ComprehensionExpression: ['blocks', 'filter', 'body'], + // CAUTION: It's deferred to ES7. + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['source'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], + ExportSpecifier: ['exported', 'local'], + ExpressionStatement: ['expression'], + ForStatement: ['init', 'test', 'update', 'body'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + GeneratorExpression: ['blocks', 'filter', 'body'], + // CAUTION: It's deferred to ES7. + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], + ImportDeclaration: ['specifiers', 'source'], + ImportDefaultSpecifier: ['local'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + Literal: [], + LabeledStatement: ['label', 'body'], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['key', 'value'], + ModuleSpecifier: [], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + PrivateIdentifier: [], + Program: ['body'], + Property: ['key', 'value'], + PropertyDefinition: ['key', 'value'], + RestElement: ['argument'], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + Super: [], + SwitchStatement: ['discriminant', 'cases'], + SwitchCase: ['test', 'consequent'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + WithStatement: ['object', 'body'], + YieldExpression: ['argument'] + }; + + // unique id + BREAK = {}; + SKIP = {}; + REMOVE = {}; + VisitorOption = { + Break: BREAK, + Skip: SKIP, + Remove: REMOVE + }; + function Reference(parent, key) { + this.parent = parent; + this.key = key; + } + Reference.prototype.replace = function replace(node) { + this.parent[this.key] = node; + }; + Reference.prototype.remove = function remove() { + if (Array.isArray(this.parent)) { + this.parent.splice(this.key, 1); + return true; + } else { + this.replace(null); + return false; + } + }; + function Element(node, path, wrap, ref) { + this.node = node; + this.path = path; + this.wrap = wrap; + this.ref = ref; + } + function Controller() {} + + // API: + // return property path array from root to current node + Controller.prototype.path = function path() { + var i, iz, j, jz, result, element; + function addToPath(result, path) { + if (Array.isArray(path)) { + for (j = 0, jz = path.length; j < jz; ++j) { + result.push(path[j]); + } + } else { + result.push(path); + } + } + + // root node + if (!this.__current.path) { + return null; + } + + // first node is sentinel, second node is root element + result = []; + for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { + element = this.__leavelist[i]; + addToPath(result, element.path); + } + addToPath(result, this.__current.path); + return result; + }; + + // API: + // return type of current node + Controller.prototype.type = function () { + var node = this.current(); + return node.type || this.__current.wrap; + }; + + // API: + // return array of parent elements + Controller.prototype.parents = function parents() { + var i, iz, result; + + // first node is sentinel + result = []; + for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { + result.push(this.__leavelist[i].node); + } + return result; + }; + + // API: + // return current node + Controller.prototype.current = function current() { + return this.__current.node; + }; + Controller.prototype.__execute = function __execute(callback, element) { + var previous, result; + result = undefined; + previous = this.__current; + this.__current = element; + this.__state = null; + if (callback) { + result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); + } + this.__current = previous; + return result; + }; + + // API: + // notify control skip / break + Controller.prototype.notify = function notify(flag) { + this.__state = flag; + }; + + // API: + // skip child nodes of current node + Controller.prototype.skip = function () { + this.notify(SKIP); + }; + + // API: + // break traversals + Controller.prototype['break'] = function () { + this.notify(BREAK); + }; + + // API: + // remove node + Controller.prototype.remove = function () { + this.notify(REMOVE); + }; + Controller.prototype.__initialize = function (root, visitor) { + this.visitor = visitor; + this.root = root; + this.__worklist = []; + this.__leavelist = []; + this.__current = null; + this.__state = null; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + this.__keys = VisitorKeys; + if (visitor.keys) { + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); + } + }; + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + function isProperty(nodeType, key) { + return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; + } + function candidateExistsInLeaveList(leavelist, candidate) { + for (var i = leavelist.length - 1; i >= 0; --i) { + if (leavelist[i].node === candidate) { + return true; + } + } + return false; + } + Controller.prototype.traverse = function traverse(root, visitor) { + var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel; + this.__initialize(root, visitor); + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + worklist.push(new Element(root, null, null, null)); + leavelist.push(new Element(null, null, null, null)); + while (worklist.length) { + element = worklist.pop(); + if (element === sentinel) { + element = leavelist.pop(); + ret = this.__execute(visitor.leave, element); + if (this.__state === BREAK || ret === BREAK) { + return; + } + continue; + } + if (element.node) { + ret = this.__execute(visitor.enter, element); + if (this.__state === BREAK || ret === BREAK) { + return; + } + worklist.push(sentinel); + leavelist.push(element); + if (this.__state === SKIP || ret === SKIP) { + continue; + } + node = element.node; + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (candidateExistsInLeaveList(leavelist, candidate[current2])) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', null); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, null); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + if (candidateExistsInLeaveList(leavelist, candidate)) { + continue; + } + worklist.push(new Element(candidate, key, null, null)); + } + } + } + } + }; + Controller.prototype.replace = function replace(root, visitor) { + var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key; + function removeElem(element) { + var i, key, nextElem, parent; + if (element.ref.remove()) { + // When the reference is an element of an array. + key = element.ref.key; + parent = element.ref.parent; + + // If removed from array, then decrease following items' keys. + i = worklist.length; + while (i--) { + nextElem = worklist[i]; + if (nextElem.ref && nextElem.ref.parent === parent) { + if (nextElem.ref.key < key) { + break; + } + --nextElem.ref.key; + } + } + } + } + this.__initialize(root, visitor); + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + outer = { + root: root + }; + element = new Element(root, null, null, new Reference(outer, 'root')); + worklist.push(element); + leavelist.push(element); + while (worklist.length) { + element = worklist.pop(); + if (element === sentinel) { + element = leavelist.pop(); + target = this.__execute(visitor.leave, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + } + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + } + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + continue; + } + target = this.__execute(visitor.enter, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + element.node = target; + } + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + element.node = null; + } + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + + // node may be null + node = element.node; + if (!node) { + continue; + } + worklist.push(sentinel); + leavelist.push(element); + if (this.__state === SKIP || target === SKIP) { + continue; + } + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, new Reference(node, key))); + } + } + } + return outer.root; + }; + function traverse(root, visitor) { + var controller = new Controller(); + return controller.traverse(root, visitor); + } + function replace(root, visitor) { + var controller = new Controller(); + return controller.replace(root, visitor); + } + function extendCommentRange(comment, tokens) { + var target; + target = upperBound(tokens, function search(token) { + return token.range[0] > comment.range[0]; + }); + comment.extendedRange = [comment.range[0], comment.range[1]]; + if (target !== tokens.length) { + comment.extendedRange[1] = tokens[target].range[0]; + } + target -= 1; + if (target >= 0) { + comment.extendedRange[0] = tokens[target].range[1]; + } + return comment; + } + function attachComments(tree, providedComments, tokens) { + // At first, we should calculate extended comment ranges. + var comments = [], + comment, + len, + i, + cursor; + if (!tree.range) { + throw new Error('attachComments needs range information'); + } + + // tokens array is empty, we attach comments to tree as 'leadingComments' + if (!tokens.length) { + if (providedComments.length) { + for (i = 0, len = providedComments.length; i < len; i += 1) { + comment = deepCopy(providedComments[i]); + comment.extendedRange = [0, tree.range[0]]; + comments.push(comment); + } + tree.leadingComments = comments; + } + return tree; + } + for (i = 0, len = providedComments.length; i < len; i += 1) { + comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); + } + + // This is based on John Freeman's implementation. + cursor = 0; + traverse(tree, { + enter: function (node) { + var comment; + while (cursor < comments.length) { + comment = comments[cursor]; + if (comment.extendedRange[1] > node.range[0]) { + break; + } + if (comment.extendedRange[1] === node.range[0]) { + if (!node.leadingComments) { + node.leadingComments = []; + } + node.leadingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + cursor = 0; + traverse(tree, { + leave: function (node) { + var comment; + while (cursor < comments.length) { + comment = comments[cursor]; + if (node.range[1] < comment.extendedRange[0]) { + break; + } + if (node.range[1] === comment.extendedRange[0]) { + if (!node.trailingComments) { + node.trailingComments = []; + } + node.trailingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + return tree; + } + exports.Syntax = Syntax; + exports.traverse = traverse; + exports.replace = replace; + exports.attachComments = attachComments; + exports.VisitorKeys = VisitorKeys; + exports.VisitorOption = VisitorOption; + exports.Controller = Controller; + exports.cloneEnvironment = function () { + return clone({}); + }; + return exports; + })(exports); + /* vim: set sw=4 ts=4 et tw=80 : */ + }); + + var parser = createCommonjsModule(function (module) { + /* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ + (function (root, factory) { + if ( module.exports) { + module.exports = factory(); + } + })(commonjsGlobal, function () { + + function peg$subclass(child, parent) { + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); + } + } + peg$subclass(peg$SyntaxError, Error); + peg$SyntaxError.buildMessage = function (expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function literal(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, + "class": function _class(expectation) { + var escapedParts = "", + i; + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]); + } + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + any: function any(expectation) { + return "any character"; + }, + end: function end(expectation) { + return "end of input"; + }, + other: function other(expectation) { + return expectation.description; + } + }; + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + function literalEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + function classEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, + j; + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); + } + descriptions.sort(); + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + descriptions.length = j; + } + switch (descriptions.length) { + case 1: + return descriptions[0]; + case 2: + return descriptions[0] + " or " + descriptions[1]; + default: + return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; + } + } + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; + }; + function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + var peg$FAILED = {}, + peg$startRuleFunctions = { + start: peg$parsestart + }, + peg$startRuleFunction = peg$parsestart, + peg$c0 = function peg$c0(ss) { + return ss.length === 1 ? ss[0] : { + type: 'matches', + selectors: ss + }; + }, + peg$c1 = function peg$c1() { + return void 0; + }, + peg$c2 = " ", + peg$c3 = peg$literalExpectation(" ", false), + peg$c4 = /^[^ [\],():#!=><~+.]/, + peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false), + peg$c6 = function peg$c6(i) { + return i.join(''); + }, + peg$c7 = ">", + peg$c8 = peg$literalExpectation(">", false), + peg$c9 = function peg$c9() { + return 'child'; + }, + peg$c10 = "~", + peg$c11 = peg$literalExpectation("~", false), + peg$c12 = function peg$c12() { + return 'sibling'; + }, + peg$c13 = "+", + peg$c14 = peg$literalExpectation("+", false), + peg$c15 = function peg$c15() { + return 'adjacent'; + }, + peg$c16 = function peg$c16() { + return 'descendant'; + }, + peg$c17 = ",", + peg$c18 = peg$literalExpectation(",", false), + peg$c19 = function peg$c19(s, ss) { + return [s].concat(ss.map(function (s) { + return s[3]; + })); + }, + peg$c20 = function peg$c20(op, s) { + if (!op) return s; + return { + type: op, + left: { + type: 'exactNode' + }, + right: s + }; + }, + peg$c21 = function peg$c21(a, ops) { + return ops.reduce(function (memo, rhs) { + return { + type: rhs[0], + left: memo, + right: rhs[1] + }; + }, a); + }, + peg$c22 = "!", + peg$c23 = peg$literalExpectation("!", false), + peg$c24 = function peg$c24(subject, as) { + var b = as.length === 1 ? as[0] : { + type: 'compound', + selectors: as + }; + if (subject) b.subject = true; + return b; + }, + peg$c25 = "*", + peg$c26 = peg$literalExpectation("*", false), + peg$c27 = function peg$c27(a) { + return { + type: 'wildcard', + value: a + }; + }, + peg$c28 = "#", + peg$c29 = peg$literalExpectation("#", false), + peg$c30 = function peg$c30(i) { + return { + type: 'identifier', + value: i + }; + }, + peg$c31 = "[", + peg$c32 = peg$literalExpectation("[", false), + peg$c33 = "]", + peg$c34 = peg$literalExpectation("]", false), + peg$c35 = function peg$c35(v) { + return v; + }, + peg$c36 = /^[>", "<", "!"], false, false), + peg$c38 = "=", + peg$c39 = peg$literalExpectation("=", false), + peg$c40 = function peg$c40(a) { + return (a || '') + '='; + }, + peg$c41 = /^[><]/, + peg$c42 = peg$classExpectation([">", "<"], false, false), + peg$c43 = ".", + peg$c44 = peg$literalExpectation(".", false), + peg$c45 = function peg$c45(a, as) { + return [].concat.apply([a], as).join(''); + }, + peg$c46 = function peg$c46(name, op, value) { + return { + type: 'attribute', + name: name, + operator: op, + value: value + }; + }, + peg$c47 = function peg$c47(name) { + return { + type: 'attribute', + name: name + }; + }, + peg$c48 = "\"", + peg$c49 = peg$literalExpectation("\"", false), + peg$c50 = /^[^\\"]/, + peg$c51 = peg$classExpectation(["\\", "\""], true, false), + peg$c52 = "\\", + peg$c53 = peg$literalExpectation("\\", false), + peg$c54 = peg$anyExpectation(), + peg$c55 = function peg$c55(a, b) { + return a + b; + }, + peg$c56 = function peg$c56(d) { + return { + type: 'literal', + value: strUnescape(d.join('')) + }; + }, + peg$c57 = "'", + peg$c58 = peg$literalExpectation("'", false), + peg$c59 = /^[^\\']/, + peg$c60 = peg$classExpectation(["\\", "'"], true, false), + peg$c61 = /^[0-9]/, + peg$c62 = peg$classExpectation([["0", "9"]], false, false), + peg$c63 = function peg$c63(a, b) { + // Can use `a.flat().join('')` once supported + var leadingDecimals = a ? [].concat.apply([], a).join('') : ''; + return { + type: 'literal', + value: parseFloat(leadingDecimals + b.join('')) + }; + }, + peg$c64 = function peg$c64(i) { + return { + type: 'literal', + value: i + }; + }, + peg$c65 = "type(", + peg$c66 = peg$literalExpectation("type(", false), + peg$c67 = /^[^ )]/, + peg$c68 = peg$classExpectation([" ", ")"], true, false), + peg$c69 = ")", + peg$c70 = peg$literalExpectation(")", false), + peg$c71 = function peg$c71(t) { + return { + type: 'type', + value: t.join('') + }; + }, + peg$c72 = /^[imsu]/, + peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false), + peg$c74 = "/", + peg$c75 = peg$literalExpectation("/", false), + peg$c76 = /^[^\/]/, + peg$c77 = peg$classExpectation(["/"], true, false), + peg$c78 = function peg$c78(d, flgs) { + return { + type: 'regexp', + value: new RegExp(d.join(''), flgs ? flgs.join('') : '') + }; + }, + peg$c79 = function peg$c79(i, is) { + return { + type: 'field', + name: is.reduce(function (memo, p) { + return memo + p[0] + p[1]; + }, i) + }; + }, + peg$c80 = ":not(", + peg$c81 = peg$literalExpectation(":not(", false), + peg$c82 = function peg$c82(ss) { + return { + type: 'not', + selectors: ss + }; + }, + peg$c83 = ":matches(", + peg$c84 = peg$literalExpectation(":matches(", false), + peg$c85 = function peg$c85(ss) { + return { + type: 'matches', + selectors: ss + }; + }, + peg$c86 = ":has(", + peg$c87 = peg$literalExpectation(":has(", false), + peg$c88 = function peg$c88(ss) { + return { + type: 'has', + selectors: ss + }; + }, + peg$c89 = ":first-child", + peg$c90 = peg$literalExpectation(":first-child", false), + peg$c91 = function peg$c91() { + return nth(1); + }, + peg$c92 = ":last-child", + peg$c93 = peg$literalExpectation(":last-child", false), + peg$c94 = function peg$c94() { + return nthLast(1); + }, + peg$c95 = ":nth-child(", + peg$c96 = peg$literalExpectation(":nth-child(", false), + peg$c97 = function peg$c97(n) { + return nth(parseInt(n.join(''), 10)); + }, + peg$c98 = ":nth-last-child(", + peg$c99 = peg$literalExpectation(":nth-last-child(", false), + peg$c100 = function peg$c100(n) { + return nthLast(parseInt(n.join(''), 10)); + }, + peg$c101 = ":", + peg$c102 = peg$literalExpectation(":", false), + peg$c103 = function peg$c103(c) { + return { + type: 'class', + name: c + }; + }, + peg$currPos = 0, + peg$posDetailsCache = [{ + line: 1, + column: 1 + }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$resultsCache = {}, + peg$result; + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + function peg$literalExpectation(text, ignoreCase) { + return { + type: "literal", + text: text, + ignoreCase: ignoreCase + }; + } + function peg$classExpectation(parts, inverted, ignoreCase) { + return { + type: "class", + parts: parts, + inverted: inverted, + ignoreCase: ignoreCase + }; + } + function peg$anyExpectation() { + return { + type: "any" + }; + } + function peg$endExpectation() { + return { + type: "end" + }; + } + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], + p; + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; + } + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + p++; + } + peg$posDetailsCache[pos] = details; + return details; + } + } + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { + return; + } + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + peg$maxFailExpected.push(expected); + } + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location); + } + function peg$parsestart() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 0, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseselectors(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c0(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s1 = peg$c1(); + } + s0 = s1; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parse_() { + var s0, s1; + var key = peg$currPos * 32 + 1, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + while (s1 !== peg$FAILED) { + s0.push(s1); + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseidentifierName() { + var s0, s1, s2; + var key = peg$currPos * 32 + 2, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c5); + } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c5); + } + } + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s1 = peg$c6(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsebinaryOp() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 3, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 62) { + s2 = peg$c7; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c8); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c9(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 126) { + s2 = peg$c10; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c11); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c12(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 43) { + s2 = peg$c13; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c14); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c15(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s1 = peg$c16(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehasSelectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 32 + 4, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsehasSelector(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehasSelector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehasSelector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseselectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 32 + 5, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseselector(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehasSelector() { + var s0, s1, s2; + var key = peg$currPos * 32 + 6, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsebinaryOp(); + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseselector(); + if (s2 !== peg$FAILED) { + s1 = peg$c20(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseselector() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 7, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsesequence(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c21(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsesequence() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 8, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c23); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseatom(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseatom(); + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + s1 = peg$c24(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseatom() { + var s0; + var key = peg$currPos * 32 + 9, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsewildcard(); + if (s0 === peg$FAILED) { + s0 = peg$parseidentifier(); + if (s0 === peg$FAILED) { + s0 = peg$parseattr(); + if (s0 === peg$FAILED) { + s0 = peg$parsefield(); + if (s0 === peg$FAILED) { + s0 = peg$parsenegation(); + if (s0 === peg$FAILED) { + s0 = peg$parsematches(); + if (s0 === peg$FAILED) { + s0 = peg$parsehas(); + if (s0 === peg$FAILED) { + s0 = peg$parsefirstChild(); + if (s0 === peg$FAILED) { + s0 = peg$parselastChild(); + if (s0 === peg$FAILED) { + s0 = peg$parsenthChild(); + if (s0 === peg$FAILED) { + s0 = peg$parsenthLastChild(); + if (s0 === peg$FAILED) { + s0 = peg$parseclass(); + } + } + } + } + } + } + } + } + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsewildcard() { + var s0, s1; + var key = peg$currPos * 32 + 10, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c26); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c27(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseidentifier() { + var s0, s1, s2; + var key = peg$currPos * 32 + 11, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c28; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c29); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s1 = peg$c30(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattr() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 12, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c31; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c32); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrValue(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s5 = peg$c33; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c34); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c35(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrOps() { + var s0, s1, s2; + var key = peg$currPos * 32 + 13, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (peg$c36.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c37); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c39); + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c40(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + if (peg$c41.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + { + peg$fail(peg$c42); + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrEqOps() { + var s0, s1, s2; + var key = peg$currPos * 32 + 14, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c23); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c39); + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c40(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrName() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 15, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c43; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c43; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c45(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrValue() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 16, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrEqOps(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsetype(); + if (s5 === peg$FAILED) { + s5 = peg$parseregex(); + } + if (s5 !== peg$FAILED) { + s1 = peg$c46(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrOps(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsestring(); + if (s5 === peg$FAILED) { + s5 = peg$parsenumber(); + if (s5 === peg$FAILED) { + s5 = peg$parsepath(); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c46(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s1 = peg$c47(s1); + } + s0 = s1; + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsestring() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 17, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c49); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c51); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c51); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c48; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c49); + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c56(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c57; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c58); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c59.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c60); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c59.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c60); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c57; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c58); + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c56(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenumber() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 18, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s3 = peg$c43; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + s1 = peg$c63(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsepath() { + var s0, s1; + var key = peg$currPos * 32 + 19, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + s1 = peg$c64(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsetype() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 20, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c65) { + s1 = peg$c65; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c66); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c67.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c68); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c67.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c68); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c71(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseflags() { + var s0, s1; + var key = peg$currPos * 32 + 21, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = []; + if (peg$c72.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c73); + } + } + if (s1 !== peg$FAILED) { + while (s1 !== peg$FAILED) { + s0.push(s1); + if (peg$c72.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c73); + } + } + } + } else { + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseregex() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 32 + 22, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c74; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c75); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c77); + } + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c76.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c77); + } + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c75); + } + } + if (s3 !== peg$FAILED) { + s4 = peg$parseflags(); + if (s4 === peg$FAILED) { + s4 = null; + } + if (s4 !== peg$FAILED) { + s1 = peg$c78(s2, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsefield() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 32 + 23, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c43; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c79(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenegation() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 24, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c80) { + s1 = peg$c80; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c81); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c82(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsematches() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 25, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 9) === peg$c83) { + s1 = peg$c83; + peg$currPos += 9; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c84); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c85(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehas() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 26, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c86) { + s1 = peg$c86; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c87); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parsehasSelectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c88(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsefirstChild() { + var s0, s1; + var key = peg$currPos * 32 + 27, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 12) === peg$c89) { + s1 = peg$c89; + peg$currPos += 12; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c90); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c91(); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parselastChild() { + var s0, s1; + var key = peg$currPos * 32 + 28, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 11) === peg$c92) { + s1 = peg$c92; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c93); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c94(); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenthChild() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 29, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 11) === peg$c95) { + s1 = peg$c95; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c96); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c97(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenthLastChild() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 30, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 16) === peg$c98) { + s1 = peg$c98; + peg$currPos += 16; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c99); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c100(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseclass() { + var s0, s1, s2; + var key = peg$currPos * 32 + 31, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c101; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c102); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s1 = peg$c103(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function nth(n) { + return { + type: 'nth-child', + index: { + type: 'literal', + value: n + } + }; + } + function nthLast(n) { + return { + type: 'nth-last-child', + index: { + type: 'literal', + value: n + } + }; + } + function strUnescape(s) { + return s.replace(/\\(.)/g, function (match, ch) { + switch (ch) { + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'v': + return '\v'; + default: + return ch; + } + }); + } + peg$result = peg$startRuleFunction(); + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)); + } + } + return { + SyntaxError: peg$SyntaxError, + parse: peg$parse + }; + }); + }); + + /** + * @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side + */ + + var LEFT_SIDE = 'LEFT_SIDE'; + var RIGHT_SIDE = 'RIGHT_SIDE'; + + /** + * @external AST + * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html + */ + + /** + * One of the rules of `grammar.pegjs` + * @typedef {PlainObject} SelectorAST + * @see grammar.pegjs + */ + + /** + * The `sequence` production of `grammar.pegjs` + * @typedef {PlainObject} SelectorSequenceAST + */ + + /** + * Get the value of a property which may be multiple levels down + * in the object. + * @param {?PlainObject} obj + * @param {string[]} keys + * @returns {undefined|boolean|string|number|external:AST} + */ + function getPath(obj, keys) { + for (var i = 0; i < keys.length; ++i) { + if (obj == null) { + return obj; + } + obj = obj[keys[i]]; + } + return obj; + } + + /** + * Determine whether `node` can be reached by following `path`, + * starting at `ancestor`. + * @param {?external:AST} node + * @param {?external:AST} ancestor + * @param {string[]} path + * @param {Integer} fromPathIndex + * @returns {boolean} + */ + function inPath(node, ancestor, path, fromPathIndex) { + var current = ancestor; + for (var i = fromPathIndex; i < path.length; ++i) { + if (current == null) { + return false; + } + var field = current[path[i]]; + if (Array.isArray(field)) { + for (var k = 0; k < field.length; ++k) { + if (inPath(node, field[k], path, i + 1)) { + return true; + } + } + return false; + } + current = field; + } + return node === current; + } + + /** + * A generated matcher function for a selector. + * @callback SelectorMatcher + * @param {?SelectorAST} selector + * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] + * @returns {void} + */ + + /** + * A WeakMap for holding cached matcher functions for selectors. + * @type {WeakMap} + */ + var MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap() : null; + + /** + * Look up a matcher function for `selector` in the cache. + * If it does not exist, generate it with `generateMatcher` and add it to the cache. + * In engines without WeakMap, the caching is skipped and matchers are generated with every call. + * @param {?SelectorAST} selector + * @returns {SelectorMatcher} + */ + function getMatcher(selector) { + if (selector == null) { + return function () { + return true; + }; + } + if (MATCHER_CACHE != null) { + var matcher = MATCHER_CACHE.get(selector); + if (matcher != null) { + return matcher; + } + matcher = generateMatcher(selector); + MATCHER_CACHE.set(selector, matcher); + return matcher; + } + return generateMatcher(selector); + } + + /** + * Create a matcher function for `selector`, + * @param {?SelectorAST} selector + * @returns {SelectorMatcher} + */ + function generateMatcher(selector) { + switch (selector.type) { + case 'wildcard': + return function () { + return true; + }; + case 'identifier': + { + var value = selector.value.toLowerCase(); + return function (node, ancestry, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + return value === node[nodeTypeKey].toLowerCase(); + }; + } + case 'exactNode': + return function (node, ancestry) { + return ancestry.length === 0; + }; + case 'field': + { + var path = selector.name.split('.'); + return function (node, ancestry) { + var ancestor = ancestry[path.length - 1]; + return inPath(node, ancestor, path, 0); + }; + } + case 'matches': + { + var matchers = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < matchers.length; ++i) { + if (matchers[i](node, ancestry, options)) { + return true; + } + } + return false; + }; + } + case 'compound': + { + var _matchers = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < _matchers.length; ++i) { + if (!_matchers[i](node, ancestry, options)) { + return false; + } + } + return true; + }; + } + case 'not': + { + var _matchers2 = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < _matchers2.length; ++i) { + if (_matchers2[i](node, ancestry, options)) { + return false; + } + } + return true; + }; + } + case 'has': + { + var _matchers3 = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + var result = false; + var a = []; + estraverse.traverse(node, { + enter: function enter(node, parent) { + if (parent != null) { + a.unshift(parent); + } + for (var i = 0; i < _matchers3.length; ++i) { + if (_matchers3[i](node, a, options)) { + result = true; + this["break"](); + return; + } + } + }, + leave: function leave() { + a.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + return result; + }; + } + case 'child': + { + var left = getMatcher(selector.left); + var right = getMatcher(selector.right); + return function (node, ancestry, options) { + if (ancestry.length > 0 && right(node, ancestry, options)) { + return left(ancestry[0], ancestry.slice(1), options); + } + return false; + }; + } + case 'descendant': + { + var _left = getMatcher(selector.left); + var _right = getMatcher(selector.right); + return function (node, ancestry, options) { + if (_right(node, ancestry, options)) { + for (var i = 0, l = ancestry.length; i < l; ++i) { + if (_left(ancestry[i], ancestry.slice(i + 1), options)) { + return true; + } + } + } + return false; + }; + } + case 'attribute': + { + var _path = selector.name.split('.'); + switch (selector.operator) { + case void 0: + return function (node) { + return getPath(node, _path) != null; + }; + case '=': + switch (selector.value.type) { + case 'regexp': + return function (node) { + var p = getPath(node, _path); + return typeof p === 'string' && selector.value.value.test(p); + }; + case 'literal': + { + var literal = "".concat(selector.value.value); + return function (node) { + return literal === "".concat(getPath(node, _path)); + }; + } + case 'type': + return function (node) { + return selector.value.value === _typeof(getPath(node, _path)); + }; + } + throw new Error("Unknown selector value type: ".concat(selector.value.type)); + case '!=': + switch (selector.value.type) { + case 'regexp': + return function (node) { + return !selector.value.value.test(getPath(node, _path)); + }; + case 'literal': + { + var _literal = "".concat(selector.value.value); + return function (node) { + return _literal !== "".concat(getPath(node, _path)); + }; + } + case 'type': + return function (node) { + return selector.value.value !== _typeof(getPath(node, _path)); + }; + } + throw new Error("Unknown selector value type: ".concat(selector.value.type)); + case '<=': + return function (node) { + return getPath(node, _path) <= selector.value.value; + }; + case '<': + return function (node) { + return getPath(node, _path) < selector.value.value; + }; + case '>': + return function (node) { + return getPath(node, _path) > selector.value.value; + }; + case '>=': + return function (node) { + return getPath(node, _path) >= selector.value.value; + }; + } + throw new Error("Unknown operator: ".concat(selector.operator)); + } + case 'sibling': + { + var _left2 = getMatcher(selector.left); + var _right2 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right2(node, ancestry, options) && sibling(node, _left2, ancestry, LEFT_SIDE, options) || selector.left.subject && _left2(node, ancestry, options) && sibling(node, _right2, ancestry, RIGHT_SIDE, options); + }; + } + case 'adjacent': + { + var _left3 = getMatcher(selector.left); + var _right3 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right3(node, ancestry, options) && adjacent(node, _left3, ancestry, LEFT_SIDE, options) || selector.right.subject && _left3(node, ancestry, options) && adjacent(node, _right3, ancestry, RIGHT_SIDE, options); + }; + } + case 'nth-child': + { + var nth = selector.index.value; + var _right4 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right4(node, ancestry, options) && nthChild(node, ancestry, nth, options); + }; + } + case 'nth-last-child': + { + var _nth = -selector.index.value; + var _right5 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right5(node, ancestry, options) && nthChild(node, ancestry, _nth, options); + }; + } + case 'class': + { + var name = selector.name.toLowerCase(); + return function (node, ancestry, options) { + if (options && options.matchClass) { + return options.matchClass(selector.name, node, ancestry); + } + if (options && options.nodeTypeKey) return false; + switch (name) { + case 'statement': + if (node.type.slice(-9) === 'Statement') return true; + // fallthrough: interface Declaration <: Statement { } + case 'declaration': + return node.type.slice(-11) === 'Declaration'; + case 'pattern': + if (node.type.slice(-7) === 'Pattern') return true; + // fallthrough: interface Expression <: Node, Pattern { } + case 'expression': + return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty'; + case 'function': + return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'; + } + throw new Error("Unknown class name: ".concat(selector.name)); + }; + } + } + throw new Error("Unknown selector type: ".concat(selector.type)); + } + + /** + * @callback TraverseOptionFallback + * @param {external:AST} node The given node. + * @returns {string[]} An array of visitor keys for the given node. + */ + + /** + * @callback ClassMatcher + * @param {string} className The name of the class to match. + * @param {external:AST} node The node to match against. + * @param {Array} ancestry The ancestry of the node. + * @returns {boolean} True if the node matches the class, false if not. + */ + + /** + * @typedef {object} ESQueryOptions + * @property {string} [nodeTypeKey="type"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery. + * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node. + * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes. + * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes. + */ + + /** + * Given a `node` and its ancestors, determine if `node` is matched + * by `selector`. + * @param {?external:AST} node + * @param {?SelectorAST} selector + * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] + * @throws {Error} Unknowns (operator, class name, selector type, or + * selector value type) + * @returns {boolean} + */ + function matches(node, selector, ancestry, options) { + if (!selector) { + return true; + } + if (!node) { + return false; + } + if (!ancestry) { + ancestry = []; + } + return getMatcher(selector)(node, ancestry, options); + } + + /** + * Get visitor keys of a given node. + * @param {external:AST} node The AST node to get keys. + * @param {ESQueryOptions|undefined} options + * @returns {string[]} Visitor keys of the node. + */ + function getVisitorKeys(node, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + var nodeType = node[nodeTypeKey]; + if (options && options.visitorKeys && options.visitorKeys[nodeType]) { + return options.visitorKeys[nodeType]; + } + if (estraverse.VisitorKeys[nodeType]) { + return estraverse.VisitorKeys[nodeType]; + } + if (options && typeof options.fallback === 'function') { + return options.fallback(node); + } + // 'iteration' fallback + return Object.keys(node).filter(function (key) { + return key !== nodeTypeKey; + }); + } + + /** + * Check whether the given value is an ASTNode or not. + * @param {any} node The value to check. + * @param {ESQueryOptions|undefined} options The options to use. + * @returns {boolean} `true` if the value is an ASTNode. + */ + function isNode(node, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + return node !== null && _typeof(node) === 'object' && typeof node[nodeTypeKey] === 'string'; + } + + /** + * Determines if the given node has a sibling that matches the + * given selector matcher. + * @param {external:AST} node + * @param {SelectorMatcher} matcher + * @param {external:AST[]} ancestry + * @param {Side} side + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + function sibling(node, matcher, ancestry, side, options) { + var _ancestry = _slicedToArray(ancestry, 1), + parent = _ancestry[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var startIndex = listProp.indexOf(node); + if (startIndex < 0) { + continue; + } + var lowerBound = void 0, + upperBound = void 0; + if (side === LEFT_SIDE) { + lowerBound = 0; + upperBound = startIndex; + } else { + lowerBound = startIndex + 1; + upperBound = listProp.length; + } + for (var k = lowerBound; k < upperBound; ++k) { + if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) { + return true; + } + } + } + } + return false; + } + + /** + * Determines if the given node has an adjacent sibling that matches + * the given selector matcher. + * @param {external:AST} node + * @param {SelectorMatcher} matcher + * @param {external:AST[]} ancestry + * @param {Side} side + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + function adjacent(node, matcher, ancestry, side, options) { + var _ancestry2 = _slicedToArray(ancestry, 1), + parent = _ancestry2[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); + if (idx < 0) { + continue; + } + if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) { + return true; + } + if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) { + return true; + } + } + } + return false; + } + + /** + * Determines if the given node is the `nth` child. + * If `nth` is negative then the position is counted + * from the end of the list of children. + * @param {external:AST} node + * @param {external:AST[]} ancestry + * @param {Integer} nth + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + function nthChild(node, ancestry, nth, options) { + if (nth === 0) { + return false; + } + var _ancestry3 = _slicedToArray(ancestry, 1), + parent = _ancestry3[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var idx = nth < 0 ? listProp.length + nth : nth - 1; + if (idx >= 0 && idx < listProp.length && listProp[idx] === node) { + return true; + } + } + } + return false; + } + + /** + * For each selector node marked as a subject, find the portion of the + * selector that the subject must match. + * @param {SelectorAST} selector + * @param {SelectorAST} [ancestor] Defaults to `selector` + * @returns {SelectorAST[]} + */ + function subjects(selector, ancestor) { + if (selector == null || _typeof(selector) != 'object') { + return []; + } + if (ancestor == null) { + ancestor = selector; + } + var results = selector.subject ? [ancestor] : []; + var keys = Object.keys(selector); + for (var i = 0; i < keys.length; ++i) { + var p = keys[i]; + var sel = selector[p]; + results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor))); + } + return results; + } + + /** + * @callback TraverseVisitor + * @param {?external:AST} node + * @param {?external:AST} parent + * @param {external:AST[]} ancestry + */ + + /** + * From a JS AST and a selector AST, collect all JS AST nodes that + * match the selector. + * @param {external:AST} ast + * @param {?SelectorAST} selector + * @param {TraverseVisitor} visitor + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + function traverse(ast, selector, visitor, options) { + if (!selector) { + return; + } + var ancestry = []; + var matcher = getMatcher(selector); + var altSubjects = subjects(selector).map(getMatcher); + estraverse.traverse(ast, { + enter: function enter(node, parent) { + if (parent != null) { + ancestry.unshift(parent); + } + if (matcher(node, ancestry, options)) { + if (altSubjects.length) { + for (var i = 0, l = altSubjects.length; i < l; ++i) { + if (altSubjects[i](node, ancestry, options)) { + visitor(node, parent, ancestry); + } + for (var k = 0, m = ancestry.length; k < m; ++k) { + var succeedingAncestry = ancestry.slice(k + 1); + if (altSubjects[i](ancestry[k], succeedingAncestry, options)) { + visitor(ancestry[k], parent, succeedingAncestry); + } + } + } + } else { + visitor(node, parent, ancestry); + } + } + }, + leave: function leave() { + ancestry.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + } + + /** + * From a JS AST and a selector AST, collect all JS AST nodes that + * match the selector. + * @param {external:AST} ast + * @param {?SelectorAST} selector + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + function match(ast, selector, options) { + var results = []; + traverse(ast, selector, function (node) { + results.push(node); + }, options); + return results; + } + + /** + * Parse a selector string and return its AST. + * @param {string} selector + * @returns {SelectorAST} + */ + function parse(selector) { + return parser.parse(selector); + } + + /** + * Query the code AST using the selector string. + * @param {external:AST} ast + * @param {string} selector + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + function query(ast, selector, options) { + return match(ast, parse(selector), options); + } + query.parse = parse; + query.match = match; + query.traverse = traverse; + query.matches = matches; + query.query = query; + + return query; + +}))); diff --git a/node_modules/esquery/dist/esquery.lite.js b/node_modules/esquery/dist/esquery.lite.js new file mode 100644 index 0000000..170c933 --- /dev/null +++ b/node_modules/esquery/dist/esquery.lite.js @@ -0,0 +1,3470 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('estraverse')) : + typeof define === 'function' && define.amd ? define(['estraverse'], factory) : + (global = global || self, global.esquery = factory(global.estraverse)); +}(this, (function (estraverse) { 'use strict'; + + estraverse = estraverse && Object.prototype.hasOwnProperty.call(estraverse, 'default') ? estraverse['default'] : estraverse; + + function _iterableToArrayLimit(arr, i) { + var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; + if (null != _i) { + var _s, + _e, + _x, + _r, + _arr = [], + _n = !0, + _d = !1; + try { + if (_x = (_i = _i.call(arr)).next, 0 === i) { + if (Object(_i) !== _i) return; + _n = !1; + } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); + } catch (err) { + _d = !0, _e = err; + } finally { + try { + if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; + } finally { + if (_d) throw _e; + } + } + return _arr; + } + } + function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); + } + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var parser = createCommonjsModule(function (module) { + /* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ + (function (root, factory) { + if ( module.exports) { + module.exports = factory(); + } + })(commonjsGlobal, function () { + + function peg$subclass(child, parent) { + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); + } + } + peg$subclass(peg$SyntaxError, Error); + peg$SyntaxError.buildMessage = function (expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function literal(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, + "class": function _class(expectation) { + var escapedParts = "", + i; + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]); + } + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + any: function any(expectation) { + return "any character"; + }, + end: function end(expectation) { + return "end of input"; + }, + other: function other(expectation) { + return expectation.description; + } + }; + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + function literalEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + function classEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, + j; + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); + } + descriptions.sort(); + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + descriptions.length = j; + } + switch (descriptions.length) { + case 1: + return descriptions[0]; + case 2: + return descriptions[0] + " or " + descriptions[1]; + default: + return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; + } + } + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; + }; + function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + var peg$FAILED = {}, + peg$startRuleFunctions = { + start: peg$parsestart + }, + peg$startRuleFunction = peg$parsestart, + peg$c0 = function peg$c0(ss) { + return ss.length === 1 ? ss[0] : { + type: 'matches', + selectors: ss + }; + }, + peg$c1 = function peg$c1() { + return void 0; + }, + peg$c2 = " ", + peg$c3 = peg$literalExpectation(" ", false), + peg$c4 = /^[^ [\],():#!=><~+.]/, + peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false), + peg$c6 = function peg$c6(i) { + return i.join(''); + }, + peg$c7 = ">", + peg$c8 = peg$literalExpectation(">", false), + peg$c9 = function peg$c9() { + return 'child'; + }, + peg$c10 = "~", + peg$c11 = peg$literalExpectation("~", false), + peg$c12 = function peg$c12() { + return 'sibling'; + }, + peg$c13 = "+", + peg$c14 = peg$literalExpectation("+", false), + peg$c15 = function peg$c15() { + return 'adjacent'; + }, + peg$c16 = function peg$c16() { + return 'descendant'; + }, + peg$c17 = ",", + peg$c18 = peg$literalExpectation(",", false), + peg$c19 = function peg$c19(s, ss) { + return [s].concat(ss.map(function (s) { + return s[3]; + })); + }, + peg$c20 = function peg$c20(op, s) { + if (!op) return s; + return { + type: op, + left: { + type: 'exactNode' + }, + right: s + }; + }, + peg$c21 = function peg$c21(a, ops) { + return ops.reduce(function (memo, rhs) { + return { + type: rhs[0], + left: memo, + right: rhs[1] + }; + }, a); + }, + peg$c22 = "!", + peg$c23 = peg$literalExpectation("!", false), + peg$c24 = function peg$c24(subject, as) { + var b = as.length === 1 ? as[0] : { + type: 'compound', + selectors: as + }; + if (subject) b.subject = true; + return b; + }, + peg$c25 = "*", + peg$c26 = peg$literalExpectation("*", false), + peg$c27 = function peg$c27(a) { + return { + type: 'wildcard', + value: a + }; + }, + peg$c28 = "#", + peg$c29 = peg$literalExpectation("#", false), + peg$c30 = function peg$c30(i) { + return { + type: 'identifier', + value: i + }; + }, + peg$c31 = "[", + peg$c32 = peg$literalExpectation("[", false), + peg$c33 = "]", + peg$c34 = peg$literalExpectation("]", false), + peg$c35 = function peg$c35(v) { + return v; + }, + peg$c36 = /^[>", "<", "!"], false, false), + peg$c38 = "=", + peg$c39 = peg$literalExpectation("=", false), + peg$c40 = function peg$c40(a) { + return (a || '') + '='; + }, + peg$c41 = /^[><]/, + peg$c42 = peg$classExpectation([">", "<"], false, false), + peg$c43 = ".", + peg$c44 = peg$literalExpectation(".", false), + peg$c45 = function peg$c45(a, as) { + return [].concat.apply([a], as).join(''); + }, + peg$c46 = function peg$c46(name, op, value) { + return { + type: 'attribute', + name: name, + operator: op, + value: value + }; + }, + peg$c47 = function peg$c47(name) { + return { + type: 'attribute', + name: name + }; + }, + peg$c48 = "\"", + peg$c49 = peg$literalExpectation("\"", false), + peg$c50 = /^[^\\"]/, + peg$c51 = peg$classExpectation(["\\", "\""], true, false), + peg$c52 = "\\", + peg$c53 = peg$literalExpectation("\\", false), + peg$c54 = peg$anyExpectation(), + peg$c55 = function peg$c55(a, b) { + return a + b; + }, + peg$c56 = function peg$c56(d) { + return { + type: 'literal', + value: strUnescape(d.join('')) + }; + }, + peg$c57 = "'", + peg$c58 = peg$literalExpectation("'", false), + peg$c59 = /^[^\\']/, + peg$c60 = peg$classExpectation(["\\", "'"], true, false), + peg$c61 = /^[0-9]/, + peg$c62 = peg$classExpectation([["0", "9"]], false, false), + peg$c63 = function peg$c63(a, b) { + // Can use `a.flat().join('')` once supported + var leadingDecimals = a ? [].concat.apply([], a).join('') : ''; + return { + type: 'literal', + value: parseFloat(leadingDecimals + b.join('')) + }; + }, + peg$c64 = function peg$c64(i) { + return { + type: 'literal', + value: i + }; + }, + peg$c65 = "type(", + peg$c66 = peg$literalExpectation("type(", false), + peg$c67 = /^[^ )]/, + peg$c68 = peg$classExpectation([" ", ")"], true, false), + peg$c69 = ")", + peg$c70 = peg$literalExpectation(")", false), + peg$c71 = function peg$c71(t) { + return { + type: 'type', + value: t.join('') + }; + }, + peg$c72 = /^[imsu]/, + peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false), + peg$c74 = "/", + peg$c75 = peg$literalExpectation("/", false), + peg$c76 = /^[^\/]/, + peg$c77 = peg$classExpectation(["/"], true, false), + peg$c78 = function peg$c78(d, flgs) { + return { + type: 'regexp', + value: new RegExp(d.join(''), flgs ? flgs.join('') : '') + }; + }, + peg$c79 = function peg$c79(i, is) { + return { + type: 'field', + name: is.reduce(function (memo, p) { + return memo + p[0] + p[1]; + }, i) + }; + }, + peg$c80 = ":not(", + peg$c81 = peg$literalExpectation(":not(", false), + peg$c82 = function peg$c82(ss) { + return { + type: 'not', + selectors: ss + }; + }, + peg$c83 = ":matches(", + peg$c84 = peg$literalExpectation(":matches(", false), + peg$c85 = function peg$c85(ss) { + return { + type: 'matches', + selectors: ss + }; + }, + peg$c86 = ":has(", + peg$c87 = peg$literalExpectation(":has(", false), + peg$c88 = function peg$c88(ss) { + return { + type: 'has', + selectors: ss + }; + }, + peg$c89 = ":first-child", + peg$c90 = peg$literalExpectation(":first-child", false), + peg$c91 = function peg$c91() { + return nth(1); + }, + peg$c92 = ":last-child", + peg$c93 = peg$literalExpectation(":last-child", false), + peg$c94 = function peg$c94() { + return nthLast(1); + }, + peg$c95 = ":nth-child(", + peg$c96 = peg$literalExpectation(":nth-child(", false), + peg$c97 = function peg$c97(n) { + return nth(parseInt(n.join(''), 10)); + }, + peg$c98 = ":nth-last-child(", + peg$c99 = peg$literalExpectation(":nth-last-child(", false), + peg$c100 = function peg$c100(n) { + return nthLast(parseInt(n.join(''), 10)); + }, + peg$c101 = ":", + peg$c102 = peg$literalExpectation(":", false), + peg$c103 = function peg$c103(c) { + return { + type: 'class', + name: c + }; + }, + peg$currPos = 0, + peg$posDetailsCache = [{ + line: 1, + column: 1 + }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$resultsCache = {}, + peg$result; + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + function peg$literalExpectation(text, ignoreCase) { + return { + type: "literal", + text: text, + ignoreCase: ignoreCase + }; + } + function peg$classExpectation(parts, inverted, ignoreCase) { + return { + type: "class", + parts: parts, + inverted: inverted, + ignoreCase: ignoreCase + }; + } + function peg$anyExpectation() { + return { + type: "any" + }; + } + function peg$endExpectation() { + return { + type: "end" + }; + } + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], + p; + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; + } + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + p++; + } + peg$posDetailsCache[pos] = details; + return details; + } + } + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { + return; + } + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + peg$maxFailExpected.push(expected); + } + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location); + } + function peg$parsestart() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 0, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseselectors(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c0(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s1 = peg$c1(); + } + s0 = s1; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parse_() { + var s0, s1; + var key = peg$currPos * 32 + 1, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + while (s1 !== peg$FAILED) { + s0.push(s1); + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseidentifierName() { + var s0, s1, s2; + var key = peg$currPos * 32 + 2, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c5); + } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c5); + } + } + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s1 = peg$c6(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsebinaryOp() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 3, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 62) { + s2 = peg$c7; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c8); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c9(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 126) { + s2 = peg$c10; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c11); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c12(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 43) { + s2 = peg$c13; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c14); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s1 = peg$c15(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c3); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s1 = peg$c16(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehasSelectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 32 + 4, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsehasSelector(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehasSelector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehasSelector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseselectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 32 + 5, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseselector(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c18); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehasSelector() { + var s0, s1, s2; + var key = peg$currPos * 32 + 6, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsebinaryOp(); + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseselector(); + if (s2 !== peg$FAILED) { + s1 = peg$c20(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseselector() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 7, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsesequence(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c21(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsesequence() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 8, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c23); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseatom(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseatom(); + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + s1 = peg$c24(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseatom() { + var s0; + var key = peg$currPos * 32 + 9, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsewildcard(); + if (s0 === peg$FAILED) { + s0 = peg$parseidentifier(); + if (s0 === peg$FAILED) { + s0 = peg$parseattr(); + if (s0 === peg$FAILED) { + s0 = peg$parsefield(); + if (s0 === peg$FAILED) { + s0 = peg$parsenegation(); + if (s0 === peg$FAILED) { + s0 = peg$parsematches(); + if (s0 === peg$FAILED) { + s0 = peg$parsehas(); + if (s0 === peg$FAILED) { + s0 = peg$parsefirstChild(); + if (s0 === peg$FAILED) { + s0 = peg$parselastChild(); + if (s0 === peg$FAILED) { + s0 = peg$parsenthChild(); + if (s0 === peg$FAILED) { + s0 = peg$parsenthLastChild(); + if (s0 === peg$FAILED) { + s0 = peg$parseclass(); + } + } + } + } + } + } + } + } + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsewildcard() { + var s0, s1; + var key = peg$currPos * 32 + 10, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c26); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c27(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseidentifier() { + var s0, s1, s2; + var key = peg$currPos * 32 + 11, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c28; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c29); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s1 = peg$c30(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattr() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 12, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c31; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c32); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrValue(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s5 = peg$c33; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c34); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c35(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrOps() { + var s0, s1, s2; + var key = peg$currPos * 32 + 13, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (peg$c36.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c37); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c39); + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c40(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + if (peg$c41.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + { + peg$fail(peg$c42); + } + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrEqOps() { + var s0, s1, s2; + var key = peg$currPos * 32 + 14, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c23); + } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + { + peg$fail(peg$c39); + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c40(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrName() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 15, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c43; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c43; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + s1 = peg$c45(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseattrValue() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 16, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrEqOps(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsetype(); + if (s5 === peg$FAILED) { + s5 = peg$parseregex(); + } + if (s5 !== peg$FAILED) { + s1 = peg$c46(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrOps(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsestring(); + if (s5 === peg$FAILED) { + s5 = peg$parsenumber(); + if (s5 === peg$FAILED) { + s5 = peg$parsepath(); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c46(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s1 = peg$c47(s1); + } + s0 = s1; + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsestring() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 17, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c49); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c51); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c51); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c48; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c49); + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c56(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c57; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c58); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c59.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c60); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c59.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c60); + } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c53); + } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c54); + } + } + if (s5 !== peg$FAILED) { + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c57; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c58); + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c56(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenumber() { + var s0, s1, s2, s3; + var key = peg$currPos * 32 + 18, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s3 = peg$c43; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + s1 = peg$c63(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsepath() { + var s0, s1; + var key = peg$currPos * 32 + 19, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + s1 = peg$c64(s1); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsetype() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 20, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c65) { + s1 = peg$c65; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c66); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c67.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c68); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c67.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c68); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c71(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseflags() { + var s0, s1; + var key = peg$currPos * 32 + 21, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = []; + if (peg$c72.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c73); + } + } + if (s1 !== peg$FAILED) { + while (s1 !== peg$FAILED) { + s0.push(s1); + if (peg$c72.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c73); + } + } + } + } else { + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseregex() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 32 + 22, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c74; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c75); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c77); + } + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c76.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c77); + } + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = peg$FAILED; + { + peg$fail(peg$c75); + } + } + if (s3 !== peg$FAILED) { + s4 = peg$parseflags(); + if (s4 === peg$FAILED) { + s4 = null; + } + if (s4 !== peg$FAILED) { + s1 = peg$c78(s2, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsefield() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 32 + 23, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c43; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c44); + } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } + if (s3 !== peg$FAILED) { + s1 = peg$c79(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenegation() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 24, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c80) { + s1 = peg$c80; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c81); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c82(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsematches() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 25, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 9) === peg$c83) { + s1 = peg$c83; + peg$currPos += 9; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c84); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c85(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsehas() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 26, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c86) { + s1 = peg$c86; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c87); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parsehasSelectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c88(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsefirstChild() { + var s0, s1; + var key = peg$currPos * 32 + 27, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 12) === peg$c89) { + s1 = peg$c89; + peg$currPos += 12; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c90); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c91(); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parselastChild() { + var s0, s1; + var key = peg$currPos * 32 + 28, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 11) === peg$c92) { + s1 = peg$c92; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c93); + } + } + if (s1 !== peg$FAILED) { + s1 = peg$c94(); + } + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenthChild() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 29, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 11) === peg$c95) { + s1 = peg$c95; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c96); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c97(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parsenthLastChild() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 32 + 30, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 16) === peg$c98) { + s1 = peg$c98; + peg$currPos += 16; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c99); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + { + peg$fail(peg$c62); + } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + { + peg$fail(peg$c70); + } + } + if (s5 !== peg$FAILED) { + s1 = peg$c100(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function peg$parseclass() { + var s0, s1, s2; + var key = peg$currPos * 32 + 31, + cached = peg$resultsCache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c101; + peg$currPos++; + } else { + s1 = peg$FAILED; + { + peg$fail(peg$c102); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s1 = peg$c103(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + function nth(n) { + return { + type: 'nth-child', + index: { + type: 'literal', + value: n + } + }; + } + function nthLast(n) { + return { + type: 'nth-last-child', + index: { + type: 'literal', + value: n + } + }; + } + function strUnescape(s) { + return s.replace(/\\(.)/g, function (match, ch) { + switch (ch) { + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'v': + return '\v'; + default: + return ch; + } + }); + } + peg$result = peg$startRuleFunction(); + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)); + } + } + return { + SyntaxError: peg$SyntaxError, + parse: peg$parse + }; + }); + }); + + /** + * @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side + */ + + var LEFT_SIDE = 'LEFT_SIDE'; + var RIGHT_SIDE = 'RIGHT_SIDE'; + + /** + * @external AST + * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html + */ + + /** + * One of the rules of `grammar.pegjs` + * @typedef {PlainObject} SelectorAST + * @see grammar.pegjs + */ + + /** + * The `sequence` production of `grammar.pegjs` + * @typedef {PlainObject} SelectorSequenceAST + */ + + /** + * Get the value of a property which may be multiple levels down + * in the object. + * @param {?PlainObject} obj + * @param {string[]} keys + * @returns {undefined|boolean|string|number|external:AST} + */ + function getPath(obj, keys) { + for (var i = 0; i < keys.length; ++i) { + if (obj == null) { + return obj; + } + obj = obj[keys[i]]; + } + return obj; + } + + /** + * Determine whether `node` can be reached by following `path`, + * starting at `ancestor`. + * @param {?external:AST} node + * @param {?external:AST} ancestor + * @param {string[]} path + * @param {Integer} fromPathIndex + * @returns {boolean} + */ + function inPath(node, ancestor, path, fromPathIndex) { + var current = ancestor; + for (var i = fromPathIndex; i < path.length; ++i) { + if (current == null) { + return false; + } + var field = current[path[i]]; + if (Array.isArray(field)) { + for (var k = 0; k < field.length; ++k) { + if (inPath(node, field[k], path, i + 1)) { + return true; + } + } + return false; + } + current = field; + } + return node === current; + } + + /** + * A generated matcher function for a selector. + * @callback SelectorMatcher + * @param {?SelectorAST} selector + * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] + * @returns {void} + */ + + /** + * A WeakMap for holding cached matcher functions for selectors. + * @type {WeakMap} + */ + var MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap() : null; + + /** + * Look up a matcher function for `selector` in the cache. + * If it does not exist, generate it with `generateMatcher` and add it to the cache. + * In engines without WeakMap, the caching is skipped and matchers are generated with every call. + * @param {?SelectorAST} selector + * @returns {SelectorMatcher} + */ + function getMatcher(selector) { + if (selector == null) { + return function () { + return true; + }; + } + if (MATCHER_CACHE != null) { + var matcher = MATCHER_CACHE.get(selector); + if (matcher != null) { + return matcher; + } + matcher = generateMatcher(selector); + MATCHER_CACHE.set(selector, matcher); + return matcher; + } + return generateMatcher(selector); + } + + /** + * Create a matcher function for `selector`, + * @param {?SelectorAST} selector + * @returns {SelectorMatcher} + */ + function generateMatcher(selector) { + switch (selector.type) { + case 'wildcard': + return function () { + return true; + }; + case 'identifier': + { + var value = selector.value.toLowerCase(); + return function (node, ancestry, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + return value === node[nodeTypeKey].toLowerCase(); + }; + } + case 'exactNode': + return function (node, ancestry) { + return ancestry.length === 0; + }; + case 'field': + { + var path = selector.name.split('.'); + return function (node, ancestry) { + var ancestor = ancestry[path.length - 1]; + return inPath(node, ancestor, path, 0); + }; + } + case 'matches': + { + var matchers = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < matchers.length; ++i) { + if (matchers[i](node, ancestry, options)) { + return true; + } + } + return false; + }; + } + case 'compound': + { + var _matchers = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < _matchers.length; ++i) { + if (!_matchers[i](node, ancestry, options)) { + return false; + } + } + return true; + }; + } + case 'not': + { + var _matchers2 = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + for (var i = 0; i < _matchers2.length; ++i) { + if (_matchers2[i](node, ancestry, options)) { + return false; + } + } + return true; + }; + } + case 'has': + { + var _matchers3 = selector.selectors.map(getMatcher); + return function (node, ancestry, options) { + var result = false; + var a = []; + estraverse.traverse(node, { + enter: function enter(node, parent) { + if (parent != null) { + a.unshift(parent); + } + for (var i = 0; i < _matchers3.length; ++i) { + if (_matchers3[i](node, a, options)) { + result = true; + this["break"](); + return; + } + } + }, + leave: function leave() { + a.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + return result; + }; + } + case 'child': + { + var left = getMatcher(selector.left); + var right = getMatcher(selector.right); + return function (node, ancestry, options) { + if (ancestry.length > 0 && right(node, ancestry, options)) { + return left(ancestry[0], ancestry.slice(1), options); + } + return false; + }; + } + case 'descendant': + { + var _left = getMatcher(selector.left); + var _right = getMatcher(selector.right); + return function (node, ancestry, options) { + if (_right(node, ancestry, options)) { + for (var i = 0, l = ancestry.length; i < l; ++i) { + if (_left(ancestry[i], ancestry.slice(i + 1), options)) { + return true; + } + } + } + return false; + }; + } + case 'attribute': + { + var _path = selector.name.split('.'); + switch (selector.operator) { + case void 0: + return function (node) { + return getPath(node, _path) != null; + }; + case '=': + switch (selector.value.type) { + case 'regexp': + return function (node) { + var p = getPath(node, _path); + return typeof p === 'string' && selector.value.value.test(p); + }; + case 'literal': + { + var literal = "".concat(selector.value.value); + return function (node) { + return literal === "".concat(getPath(node, _path)); + }; + } + case 'type': + return function (node) { + return selector.value.value === _typeof(getPath(node, _path)); + }; + } + throw new Error("Unknown selector value type: ".concat(selector.value.type)); + case '!=': + switch (selector.value.type) { + case 'regexp': + return function (node) { + return !selector.value.value.test(getPath(node, _path)); + }; + case 'literal': + { + var _literal = "".concat(selector.value.value); + return function (node) { + return _literal !== "".concat(getPath(node, _path)); + }; + } + case 'type': + return function (node) { + return selector.value.value !== _typeof(getPath(node, _path)); + }; + } + throw new Error("Unknown selector value type: ".concat(selector.value.type)); + case '<=': + return function (node) { + return getPath(node, _path) <= selector.value.value; + }; + case '<': + return function (node) { + return getPath(node, _path) < selector.value.value; + }; + case '>': + return function (node) { + return getPath(node, _path) > selector.value.value; + }; + case '>=': + return function (node) { + return getPath(node, _path) >= selector.value.value; + }; + } + throw new Error("Unknown operator: ".concat(selector.operator)); + } + case 'sibling': + { + var _left2 = getMatcher(selector.left); + var _right2 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right2(node, ancestry, options) && sibling(node, _left2, ancestry, LEFT_SIDE, options) || selector.left.subject && _left2(node, ancestry, options) && sibling(node, _right2, ancestry, RIGHT_SIDE, options); + }; + } + case 'adjacent': + { + var _left3 = getMatcher(selector.left); + var _right3 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right3(node, ancestry, options) && adjacent(node, _left3, ancestry, LEFT_SIDE, options) || selector.right.subject && _left3(node, ancestry, options) && adjacent(node, _right3, ancestry, RIGHT_SIDE, options); + }; + } + case 'nth-child': + { + var nth = selector.index.value; + var _right4 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right4(node, ancestry, options) && nthChild(node, ancestry, nth, options); + }; + } + case 'nth-last-child': + { + var _nth = -selector.index.value; + var _right5 = getMatcher(selector.right); + return function (node, ancestry, options) { + return _right5(node, ancestry, options) && nthChild(node, ancestry, _nth, options); + }; + } + case 'class': + { + var name = selector.name.toLowerCase(); + return function (node, ancestry, options) { + if (options && options.matchClass) { + return options.matchClass(selector.name, node, ancestry); + } + if (options && options.nodeTypeKey) return false; + switch (name) { + case 'statement': + if (node.type.slice(-9) === 'Statement') return true; + // fallthrough: interface Declaration <: Statement { } + case 'declaration': + return node.type.slice(-11) === 'Declaration'; + case 'pattern': + if (node.type.slice(-7) === 'Pattern') return true; + // fallthrough: interface Expression <: Node, Pattern { } + case 'expression': + return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty'; + case 'function': + return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'; + } + throw new Error("Unknown class name: ".concat(selector.name)); + }; + } + } + throw new Error("Unknown selector type: ".concat(selector.type)); + } + + /** + * @callback TraverseOptionFallback + * @param {external:AST} node The given node. + * @returns {string[]} An array of visitor keys for the given node. + */ + + /** + * @callback ClassMatcher + * @param {string} className The name of the class to match. + * @param {external:AST} node The node to match against. + * @param {Array} ancestry The ancestry of the node. + * @returns {boolean} True if the node matches the class, false if not. + */ + + /** + * @typedef {object} ESQueryOptions + * @property {string} [nodeTypeKey="type"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery. + * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node. + * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes. + * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes. + */ + + /** + * Given a `node` and its ancestors, determine if `node` is matched + * by `selector`. + * @param {?external:AST} node + * @param {?SelectorAST} selector + * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] + * @throws {Error} Unknowns (operator, class name, selector type, or + * selector value type) + * @returns {boolean} + */ + function matches(node, selector, ancestry, options) { + if (!selector) { + return true; + } + if (!node) { + return false; + } + if (!ancestry) { + ancestry = []; + } + return getMatcher(selector)(node, ancestry, options); + } + + /** + * Get visitor keys of a given node. + * @param {external:AST} node The AST node to get keys. + * @param {ESQueryOptions|undefined} options + * @returns {string[]} Visitor keys of the node. + */ + function getVisitorKeys(node, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + var nodeType = node[nodeTypeKey]; + if (options && options.visitorKeys && options.visitorKeys[nodeType]) { + return options.visitorKeys[nodeType]; + } + if (estraverse.VisitorKeys[nodeType]) { + return estraverse.VisitorKeys[nodeType]; + } + if (options && typeof options.fallback === 'function') { + return options.fallback(node); + } + // 'iteration' fallback + return Object.keys(node).filter(function (key) { + return key !== nodeTypeKey; + }); + } + + /** + * Check whether the given value is an ASTNode or not. + * @param {any} node The value to check. + * @param {ESQueryOptions|undefined} options The options to use. + * @returns {boolean} `true` if the value is an ASTNode. + */ + function isNode(node, options) { + var nodeTypeKey = options && options.nodeTypeKey || 'type'; + return node !== null && _typeof(node) === 'object' && typeof node[nodeTypeKey] === 'string'; + } + + /** + * Determines if the given node has a sibling that matches the + * given selector matcher. + * @param {external:AST} node + * @param {SelectorMatcher} matcher + * @param {external:AST[]} ancestry + * @param {Side} side + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + function sibling(node, matcher, ancestry, side, options) { + var _ancestry = _slicedToArray(ancestry, 1), + parent = _ancestry[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var startIndex = listProp.indexOf(node); + if (startIndex < 0) { + continue; + } + var lowerBound = void 0, + upperBound = void 0; + if (side === LEFT_SIDE) { + lowerBound = 0; + upperBound = startIndex; + } else { + lowerBound = startIndex + 1; + upperBound = listProp.length; + } + for (var k = lowerBound; k < upperBound; ++k) { + if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) { + return true; + } + } + } + } + return false; + } + + /** + * Determines if the given node has an adjacent sibling that matches + * the given selector matcher. + * @param {external:AST} node + * @param {SelectorMatcher} matcher + * @param {external:AST[]} ancestry + * @param {Side} side + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + function adjacent(node, matcher, ancestry, side, options) { + var _ancestry2 = _slicedToArray(ancestry, 1), + parent = _ancestry2[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); + if (idx < 0) { + continue; + } + if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) { + return true; + } + if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) { + return true; + } + } + } + return false; + } + + /** + * Determines if the given node is the `nth` child. + * If `nth` is negative then the position is counted + * from the end of the list of children. + * @param {external:AST} node + * @param {external:AST[]} ancestry + * @param {Integer} nth + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + function nthChild(node, ancestry, nth, options) { + if (nth === 0) { + return false; + } + var _ancestry3 = _slicedToArray(ancestry, 1), + parent = _ancestry3[0]; + if (!parent) { + return false; + } + var keys = getVisitorKeys(parent, options); + for (var i = 0; i < keys.length; ++i) { + var listProp = parent[keys[i]]; + if (Array.isArray(listProp)) { + var idx = nth < 0 ? listProp.length + nth : nth - 1; + if (idx >= 0 && idx < listProp.length && listProp[idx] === node) { + return true; + } + } + } + return false; + } + + /** + * For each selector node marked as a subject, find the portion of the + * selector that the subject must match. + * @param {SelectorAST} selector + * @param {SelectorAST} [ancestor] Defaults to `selector` + * @returns {SelectorAST[]} + */ + function subjects(selector, ancestor) { + if (selector == null || _typeof(selector) != 'object') { + return []; + } + if (ancestor == null) { + ancestor = selector; + } + var results = selector.subject ? [ancestor] : []; + var keys = Object.keys(selector); + for (var i = 0; i < keys.length; ++i) { + var p = keys[i]; + var sel = selector[p]; + results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor))); + } + return results; + } + + /** + * @callback TraverseVisitor + * @param {?external:AST} node + * @param {?external:AST} parent + * @param {external:AST[]} ancestry + */ + + /** + * From a JS AST and a selector AST, collect all JS AST nodes that + * match the selector. + * @param {external:AST} ast + * @param {?SelectorAST} selector + * @param {TraverseVisitor} visitor + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + function traverse(ast, selector, visitor, options) { + if (!selector) { + return; + } + var ancestry = []; + var matcher = getMatcher(selector); + var altSubjects = subjects(selector).map(getMatcher); + estraverse.traverse(ast, { + enter: function enter(node, parent) { + if (parent != null) { + ancestry.unshift(parent); + } + if (matcher(node, ancestry, options)) { + if (altSubjects.length) { + for (var i = 0, l = altSubjects.length; i < l; ++i) { + if (altSubjects[i](node, ancestry, options)) { + visitor(node, parent, ancestry); + } + for (var k = 0, m = ancestry.length; k < m; ++k) { + var succeedingAncestry = ancestry.slice(k + 1); + if (altSubjects[i](ancestry[k], succeedingAncestry, options)) { + visitor(ancestry[k], parent, succeedingAncestry); + } + } + } + } else { + visitor(node, parent, ancestry); + } + } + }, + leave: function leave() { + ancestry.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + } + + /** + * From a JS AST and a selector AST, collect all JS AST nodes that + * match the selector. + * @param {external:AST} ast + * @param {?SelectorAST} selector + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + function match(ast, selector, options) { + var results = []; + traverse(ast, selector, function (node) { + results.push(node); + }, options); + return results; + } + + /** + * Parse a selector string and return its AST. + * @param {string} selector + * @returns {SelectorAST} + */ + function parse(selector) { + return parser.parse(selector); + } + + /** + * Query the code AST using the selector string. + * @param {external:AST} ast + * @param {string} selector + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + function query(ast, selector, options) { + return match(ast, parse(selector), options); + } + query.parse = parse; + query.match = match; + query.traverse = traverse; + query.matches = matches; + query.query = query; + + return query; + +}))); diff --git a/node_modules/esquery/dist/esquery.lite.min.js b/node_modules/esquery/dist/esquery.lite.min.js new file mode 100644 index 0000000..80dd64e --- /dev/null +++ b/node_modules/esquery/dist/esquery.lite.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("estraverse")):"function"==typeof define&&define.amd?define(["estraverse"],e):(t=t||self).esquery=e(t.estraverse)}(this,(function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,u,o,a,s=[],c=!0,i=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){i=!0,u=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(i)throw u}}return s}}(t,e)||u(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){for(e=1,n=1;e<~+.]/,h=ht([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),p=ft(">",!1),v=ft("~",!1),y=ft("+",!1),d=ft(",",!1),A=function(t,e){return[t].concat(e.map((function(t){return t[3]})))},x=ft("!",!1),g=ft("*",!1),m=ft("#",!1),P=ft("[",!1),b=ft("]",!1),C=/^[>","<","!"],!1,!1),j=ft("=",!1),E=function(t){return(t||"")+"="},S=/^[><]/,k=ht([">","<"],!1,!1),I=ft(".",!1),T=function(t,e,r){return{type:"attribute",name:t,operator:e,value:r}},F=ft('"',!1),K=/^[^\\"]/,O=ht(["\\",'"'],!0,!1),D=ft("\\",!1),L={type:"any"},R=function(t,e){return t+e},M=function(t){return{type:"literal",value:(e=t.join(""),e.replace(/\\(.)/g,(function(t,e){switch(e){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return e}})))};var e},U=ft("'",!1),_=/^[^\\']/,q=ht(["\\","'"],!0,!1),G=/^[0-9]/,H=ht([["0","9"]],!1,!1),N=ft("type(",!1),V=/^[^ )]/,W=ht([" ",")"],!0,!1),$=ft(")",!1),z=/^[imsu]/,B=ht(["i","m","s","u"],!1,!1),J=ft("/",!1),Q=/^[^\/]/,X=ht(["/"],!0,!1),Y=ft(":not(",!1),Z=ft(":matches(",!1),tt=ft(":has(",!1),et=ft(":first-child",!1),rt=ft(":last-child",!1),nt=ft(":nth-child(",!1),ut=ft(":nth-last-child(",!1),ot=ft(":",!1),at=0,st=[{line:1,column:1}],ct=0,it=[],lt={};if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');i=c[r.startRule]}function ft(t,e){return{type:"literal",text:t,ignoreCase:e}}function ht(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function pt(t){var r,n=st[t];if(n)return n;for(r=t-1;!st[r];)r--;for(n={line:(n=st[r]).line,column:n.column};rct&&(ct=at,it=[]),it.push(t))}function dt(){var t,e,r,n,u=32*at+0,o=lt[u];return o?(at=o.nextPos,o.result):(t=at,(e=At())!==s&&(r=mt())!==s&&At()!==s?t=e=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(at=t,t=s),t===s&&(t=at,(e=At())!==s&&(e=void 0),t=e),lt[u]={nextPos:at,result:t},t)}function At(){var t,r,n=32*at+1,u=lt[n];if(u)return at=u.nextPos,u.result;for(t=[],32===e.charCodeAt(at)?(r=" ",at++):(r=s,yt(l));r!==s;)t.push(r),32===e.charCodeAt(at)?(r=" ",at++):(r=s,yt(l));return lt[n]={nextPos:at,result:t},t}function xt(){var t,r,n,u=32*at+2,o=lt[u];if(o)return at=o.nextPos,o.result;if(r=[],f.test(e.charAt(at))?(n=e.charAt(at),at++):(n=s,yt(h)),n!==s)for(;n!==s;)r.push(n),f.test(e.charAt(at))?(n=e.charAt(at),at++):(n=s,yt(h));else r=s;return r!==s&&(r=r.join("")),t=r,lt[u]={nextPos:at,result:t},t}function gt(){var t,r,n,u=32*at+3,o=lt[u];return o?(at=o.nextPos,o.result):(t=at,(r=At())!==s?(62===e.charCodeAt(at)?(n=">",at++):(n=s,yt(p)),n!==s&&At()!==s?t=r="child":(at=t,t=s)):(at=t,t=s),t===s&&(t=at,(r=At())!==s?(126===e.charCodeAt(at)?(n="~",at++):(n=s,yt(v)),n!==s&&At()!==s?t=r="sibling":(at=t,t=s)):(at=t,t=s),t===s&&(t=at,(r=At())!==s?(43===e.charCodeAt(at)?(n="+",at++):(n=s,yt(y)),n!==s&&At()!==s?t=r="adjacent":(at=t,t=s)):(at=t,t=s),t===s&&(t=at,32===e.charCodeAt(at)?(r=" ",at++):(r=s,yt(l)),r!==s&&(n=At())!==s?t=r="descendant":(at=t,t=s)))),lt[u]={nextPos:at,result:t},t)}function mt(){var t,r,n,u,o,a,c,i,l=32*at+5,f=lt[l];if(f)return at=f.nextPos,f.result;if(t=at,(r=bt())!==s){for(n=[],u=at,(o=At())!==s?(44===e.charCodeAt(at)?(a=",",at++):(a=s,yt(d)),a!==s&&(c=At())!==s&&(i=bt())!==s?u=o=[o,a,c,i]:(at=u,u=s)):(at=u,u=s);u!==s;)n.push(u),u=at,(o=At())!==s?(44===e.charCodeAt(at)?(a=",",at++):(a=s,yt(d)),a!==s&&(c=At())!==s&&(i=bt())!==s?u=o=[o,a,c,i]:(at=u,u=s)):(at=u,u=s);n!==s?t=r=A(r,n):(at=t,t=s)}else at=t,t=s;return lt[l]={nextPos:at,result:t},t}function Pt(){var t,e,r,n,u,o=32*at+6,a=lt[o];return a?(at=a.nextPos,a.result):(t=at,(e=gt())===s&&(e=null),e!==s&&(r=bt())!==s?(u=r,t=e=(n=e)?{type:n,left:{type:"exactNode"},right:u}:u):(at=t,t=s),lt[o]={nextPos:at,result:t},t)}function bt(){var t,e,r,n,u,o,a,c=32*at+7,i=lt[c];if(i)return at=i.nextPos,i.result;if(t=at,(e=Ct())!==s){for(r=[],n=at,(u=gt())!==s&&(o=Ct())!==s?n=u=[u,o]:(at=n,n=s);n!==s;)r.push(n),n=at,(u=gt())!==s&&(o=Ct())!==s?n=u=[u,o]:(at=n,n=s);r!==s?(a=e,t=e=r.reduce((function(t,e){return{type:e[0],left:t,right:e[1]}}),a)):(at=t,t=s)}else at=t,t=s;return lt[c]={nextPos:at,result:t},t}function Ct(){var t,r,n,u,o,a,c,i=32*at+8,l=lt[i];if(l)return at=l.nextPos,l.result;if(t=at,33===e.charCodeAt(at)?(r="!",at++):(r=s,yt(x)),r===s&&(r=null),r!==s){if(n=[],(u=wt())!==s)for(;u!==s;)n.push(u),u=wt();else n=s;n!==s?(o=r,c=1===(a=n).length?a[0]:{type:"compound",selectors:a},o&&(c.subject=!0),t=r=c):(at=t,t=s)}else at=t,t=s;return lt[i]={nextPos:at,result:t},t}function wt(){var t,r=32*at+9,n=lt[r];return n?(at=n.nextPos,n.result):((t=function(){var t,r,n=32*at+10,u=lt[n];return u?(at=u.nextPos,u.result):(42===e.charCodeAt(at)?(r="*",at++):(r=s,yt(g)),r!==s&&(r={type:"wildcard",value:r}),t=r,lt[n]={nextPos:at,result:t},t)}())===s&&(t=function(){var t,r,n,u=32*at+11,o=lt[u];return o?(at=o.nextPos,o.result):(t=at,35===e.charCodeAt(at)?(r="#",at++):(r=s,yt(m)),r===s&&(r=null),r!==s&&(n=xt())!==s?t=r={type:"identifier",value:n}:(at=t,t=s),lt[u]={nextPos:at,result:t},t)}())===s&&(t=function(){var t,r,n,u,o=32*at+12,a=lt[o];return a?(at=a.nextPos,a.result):(t=at,91===e.charCodeAt(at)?(r="[",at++):(r=s,yt(P)),r!==s&&At()!==s&&(n=function(){var t,r,n,u,o=32*at+16,a=lt[o];return a?(at=a.nextPos,a.result):(t=at,(r=jt())!==s&&At()!==s&&(n=function(){var t,r,n,u=32*at+14,o=lt[u];return o?(at=o.nextPos,o.result):(t=at,33===e.charCodeAt(at)?(r="!",at++):(r=s,yt(x)),r===s&&(r=null),r!==s?(61===e.charCodeAt(at)?(n="=",at++):(n=s,yt(j)),n!==s?(r=E(r),t=r):(at=t,t=s)):(at=t,t=s),lt[u]={nextPos:at,result:t},t)}())!==s&&At()!==s?((u=function(){var t,r,n,u,o,a=32*at+20,c=lt[a];if(c)return at=c.nextPos,c.result;if(t=at,"type("===e.substr(at,5)?(r="type(",at+=5):(r=s,yt(N)),r!==s)if(At()!==s){if(n=[],V.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(W)),u!==s)for(;u!==s;)n.push(u),V.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(W));else n=s;n!==s&&(u=At())!==s?(41===e.charCodeAt(at)?(o=")",at++):(o=s,yt($)),o!==s?(r={type:"type",value:n.join("")},t=r):(at=t,t=s)):(at=t,t=s)}else at=t,t=s;else at=t,t=s;return lt[a]={nextPos:at,result:t},t}())===s&&(u=function(){var t,r,n,u,o,a,c=32*at+22,i=lt[c];if(i)return at=i.nextPos,i.result;if(t=at,47===e.charCodeAt(at)?(r="/",at++):(r=s,yt(J)),r!==s){if(n=[],Q.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(X)),u!==s)for(;u!==s;)n.push(u),Q.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(X));else n=s;n!==s?(47===e.charCodeAt(at)?(u="/",at++):(u=s,yt(J)),u!==s?((o=function(){var t,r,n=32*at+21,u=lt[n];if(u)return at=u.nextPos,u.result;if(t=[],z.test(e.charAt(at))?(r=e.charAt(at),at++):(r=s,yt(B)),r!==s)for(;r!==s;)t.push(r),z.test(e.charAt(at))?(r=e.charAt(at),at++):(r=s,yt(B));else t=s;return lt[n]={nextPos:at,result:t},t}())===s&&(o=null),o!==s?(a=o,r={type:"regexp",value:new RegExp(n.join(""),a?a.join(""):"")},t=r):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)}else at=t,t=s;return lt[c]={nextPos:at,result:t},t}()),u!==s?(r=T(r,n,u),t=r):(at=t,t=s)):(at=t,t=s),t===s&&(t=at,(r=jt())!==s&&At()!==s&&(n=function(){var t,r,n,u=32*at+13,o=lt[u];return o?(at=o.nextPos,o.result):(t=at,C.test(e.charAt(at))?(r=e.charAt(at),at++):(r=s,yt(w)),r===s&&(r=null),r!==s?(61===e.charCodeAt(at)?(n="=",at++):(n=s,yt(j)),n!==s?(r=E(r),t=r):(at=t,t=s)):(at=t,t=s),t===s&&(S.test(e.charAt(at))?(t=e.charAt(at),at++):(t=s,yt(k))),lt[u]={nextPos:at,result:t},t)}())!==s&&At()!==s?((u=function(){var t,r,n,u,o,a,c=32*at+17,i=lt[c];if(i)return at=i.nextPos,i.result;if(t=at,34===e.charCodeAt(at)?(r='"',at++):(r=s,yt(F)),r!==s){for(n=[],K.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(O)),u===s&&(u=at,92===e.charCodeAt(at)?(o="\\",at++):(o=s,yt(D)),o!==s?(e.length>at?(a=e.charAt(at),at++):(a=s,yt(L)),a!==s?(o=R(o,a),u=o):(at=u,u=s)):(at=u,u=s));u!==s;)n.push(u),K.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(O)),u===s&&(u=at,92===e.charCodeAt(at)?(o="\\",at++):(o=s,yt(D)),o!==s?(e.length>at?(a=e.charAt(at),at++):(a=s,yt(L)),a!==s?(o=R(o,a),u=o):(at=u,u=s)):(at=u,u=s));n!==s?(34===e.charCodeAt(at)?(u='"',at++):(u=s,yt(F)),u!==s?(r=M(n),t=r):(at=t,t=s)):(at=t,t=s)}else at=t,t=s;if(t===s)if(t=at,39===e.charCodeAt(at)?(r="'",at++):(r=s,yt(U)),r!==s){for(n=[],_.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(q)),u===s&&(u=at,92===e.charCodeAt(at)?(o="\\",at++):(o=s,yt(D)),o!==s?(e.length>at?(a=e.charAt(at),at++):(a=s,yt(L)),a!==s?(o=R(o,a),u=o):(at=u,u=s)):(at=u,u=s));u!==s;)n.push(u),_.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(q)),u===s&&(u=at,92===e.charCodeAt(at)?(o="\\",at++):(o=s,yt(D)),o!==s?(e.length>at?(a=e.charAt(at),at++):(a=s,yt(L)),a!==s?(o=R(o,a),u=o):(at=u,u=s)):(at=u,u=s));n!==s?(39===e.charCodeAt(at)?(u="'",at++):(u=s,yt(U)),u!==s?(r=M(n),t=r):(at=t,t=s)):(at=t,t=s)}else at=t,t=s;return lt[c]={nextPos:at,result:t},t}())===s&&(u=function(){var t,r,n,u,o,a,c,i=32*at+18,l=lt[i];if(l)return at=l.nextPos,l.result;for(t=at,r=at,n=[],G.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(H));u!==s;)n.push(u),G.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(H));if(n!==s?(46===e.charCodeAt(at)?(u=".",at++):(u=s,yt(I)),u!==s?r=n=[n,u]:(at=r,r=s)):(at=r,r=s),r===s&&(r=null),r!==s){if(n=[],G.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(H)),u!==s)for(;u!==s;)n.push(u),G.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(H));else n=s;n!==s?(a=n,c=(o=r)?[].concat.apply([],o).join(""):"",r={type:"literal",value:parseFloat(c+a.join(""))},t=r):(at=t,t=s)}else at=t,t=s;return lt[i]={nextPos:at,result:t},t}())===s&&(u=function(){var t,e,r=32*at+19,n=lt[r];return n?(at=n.nextPos,n.result):((e=xt())!==s&&(e={type:"literal",value:e}),t=e,lt[r]={nextPos:at,result:t},t)}()),u!==s?(r=T(r,n,u),t=r):(at=t,t=s)):(at=t,t=s),t===s&&(t=at,(r=jt())!==s&&(r={type:"attribute",name:r}),t=r)),lt[o]={nextPos:at,result:t},t)}())!==s&&At()!==s?(93===e.charCodeAt(at)?(u="]",at++):(u=s,yt(b)),u!==s?t=r=n:(at=t,t=s)):(at=t,t=s),lt[o]={nextPos:at,result:t},t)}())===s&&(t=function(){var t,r,n,u,o,a,c,i,l=32*at+23,f=lt[l];if(f)return at=f.nextPos,f.result;if(t=at,46===e.charCodeAt(at)?(r=".",at++):(r=s,yt(I)),r!==s)if((n=xt())!==s){for(u=[],o=at,46===e.charCodeAt(at)?(a=".",at++):(a=s,yt(I)),a!==s&&(c=xt())!==s?o=a=[a,c]:(at=o,o=s);o!==s;)u.push(o),o=at,46===e.charCodeAt(at)?(a=".",at++):(a=s,yt(I)),a!==s&&(c=xt())!==s?o=a=[a,c]:(at=o,o=s);u!==s?(i=n,r={type:"field",name:u.reduce((function(t,e){return t+e[0]+e[1]}),i)},t=r):(at=t,t=s)}else at=t,t=s;else at=t,t=s;return lt[l]={nextPos:at,result:t},t}())===s&&(t=function(){var t,r,n,u,o=32*at+24,a=lt[o];return a?(at=a.nextPos,a.result):(t=at,":not("===e.substr(at,5)?(r=":not(",at+=5):(r=s,yt(Y)),r!==s&&At()!==s&&(n=mt())!==s&&At()!==s?(41===e.charCodeAt(at)?(u=")",at++):(u=s,yt($)),u!==s?t=r={type:"not",selectors:n}:(at=t,t=s)):(at=t,t=s),lt[o]={nextPos:at,result:t},t)}())===s&&(t=function(){var t,r,n,u,o=32*at+25,a=lt[o];return a?(at=a.nextPos,a.result):(t=at,":matches("===e.substr(at,9)?(r=":matches(",at+=9):(r=s,yt(Z)),r!==s&&At()!==s&&(n=mt())!==s&&At()!==s?(41===e.charCodeAt(at)?(u=")",at++):(u=s,yt($)),u!==s?t=r={type:"matches",selectors:n}:(at=t,t=s)):(at=t,t=s),lt[o]={nextPos:at,result:t},t)}())===s&&(t=function(){var t,r,n,u,o=32*at+26,a=lt[o];return a?(at=a.nextPos,a.result):(t=at,":has("===e.substr(at,5)?(r=":has(",at+=5):(r=s,yt(tt)),r!==s&&At()!==s&&(n=function(){var t,r,n,u,o,a,c,i,l=32*at+4,f=lt[l];if(f)return at=f.nextPos,f.result;if(t=at,(r=Pt())!==s){for(n=[],u=at,(o=At())!==s?(44===e.charCodeAt(at)?(a=",",at++):(a=s,yt(d)),a!==s&&(c=At())!==s&&(i=Pt())!==s?u=o=[o,a,c,i]:(at=u,u=s)):(at=u,u=s);u!==s;)n.push(u),u=at,(o=At())!==s?(44===e.charCodeAt(at)?(a=",",at++):(a=s,yt(d)),a!==s&&(c=At())!==s&&(i=Pt())!==s?u=o=[o,a,c,i]:(at=u,u=s)):(at=u,u=s);n!==s?t=r=A(r,n):(at=t,t=s)}else at=t,t=s;return lt[l]={nextPos:at,result:t},t}())!==s&&At()!==s?(41===e.charCodeAt(at)?(u=")",at++):(u=s,yt($)),u!==s?t=r={type:"has",selectors:n}:(at=t,t=s)):(at=t,t=s),lt[o]={nextPos:at,result:t},t)}())===s&&(t=function(){var t,r,n=32*at+27,u=lt[n];return u?(at=u.nextPos,u.result):(":first-child"===e.substr(at,12)?(r=":first-child",at+=12):(r=s,yt(et)),r!==s&&(r=Et(1)),t=r,lt[n]={nextPos:at,result:t},t)}())===s&&(t=function(){var t,r,n=32*at+28,u=lt[n];return u?(at=u.nextPos,u.result):(":last-child"===e.substr(at,11)?(r=":last-child",at+=11):(r=s,yt(rt)),r!==s&&(r=St(1)),t=r,lt[n]={nextPos:at,result:t},t)}())===s&&(t=function(){var t,r,n,u,o,a=32*at+29,c=lt[a];if(c)return at=c.nextPos,c.result;if(t=at,":nth-child("===e.substr(at,11)?(r=":nth-child(",at+=11):(r=s,yt(nt)),r!==s)if(At()!==s){if(n=[],G.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(H)),u!==s)for(;u!==s;)n.push(u),G.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(H));else n=s;n!==s&&(u=At())!==s?(41===e.charCodeAt(at)?(o=")",at++):(o=s,yt($)),o!==s?(r=Et(parseInt(n.join(""),10)),t=r):(at=t,t=s)):(at=t,t=s)}else at=t,t=s;else at=t,t=s;return lt[a]={nextPos:at,result:t},t}())===s&&(t=function(){var t,r,n,u,o,a=32*at+30,c=lt[a];if(c)return at=c.nextPos,c.result;if(t=at,":nth-last-child("===e.substr(at,16)?(r=":nth-last-child(",at+=16):(r=s,yt(ut)),r!==s)if(At()!==s){if(n=[],G.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(H)),u!==s)for(;u!==s;)n.push(u),G.test(e.charAt(at))?(u=e.charAt(at),at++):(u=s,yt(H));else n=s;n!==s&&(u=At())!==s?(41===e.charCodeAt(at)?(o=")",at++):(o=s,yt($)),o!==s?(r=St(parseInt(n.join(""),10)),t=r):(at=t,t=s)):(at=t,t=s)}else at=t,t=s;else at=t,t=s;return lt[a]={nextPos:at,result:t},t}())===s&&(t=function(){var t,r,n,u=32*at+31,o=lt[u];return o?(at=o.nextPos,o.result):(t=at,58===e.charCodeAt(at)?(r=":",at++):(r=s,yt(ot)),r!==s&&(n=xt())!==s?t=r={type:"class",name:n}:(at=t,t=s),lt[u]={nextPos:at,result:t},t)}()),lt[r]={nextPos:at,result:t},t)}function jt(){var t,r,n,u,o,a,c,i,l=32*at+15,f=lt[l];if(f)return at=f.nextPos,f.result;if(t=at,(r=xt())!==s){for(n=[],u=at,46===e.charCodeAt(at)?(o=".",at++):(o=s,yt(I)),o!==s&&(a=xt())!==s?u=o=[o,a]:(at=u,u=s);u!==s;)n.push(u),u=at,46===e.charCodeAt(at)?(o=".",at++):(o=s,yt(I)),o!==s&&(a=xt())!==s?u=o=[o,a]:(at=u,u=s);n!==s?(c=r,i=n,t=r=[].concat.apply([c],i).join("")):(at=t,t=s)}else at=t,t=s;return lt[l]={nextPos:at,result:t},t}function Et(t){return{type:"nth-child",index:{type:"literal",value:t}}}function St(t){return{type:"nth-last-child",index:{type:"literal",value:t}}}if((n=i())!==s&&at===e.length)return n;throw n!==s&&at0&&h(t,e,r))&&f(e[0],e.slice(1),r)};case"descendant":var d=i(r.left),A=i(r.right);return function(t,e,r){if(A(t,e,r))for(var n=0,u=e.length;n":return function(t){return s(t,x)>r.value.value};case">=":return function(t){return s(t,x)>=r.value.value}}throw new Error("Unknown operator: ".concat(r.operator));case"sibling":var P=i(r.left),b=i(r.right);return function(t,e,n){return b(t,e,n)&&p(t,P,e,"LEFT_SIDE",n)||r.left.subject&&P(t,e,n)&&p(t,b,e,"RIGHT_SIDE",n)};case"adjacent":var C=i(r.left),w=i(r.right);return function(t,e,n){return w(t,e,n)&&v(t,C,e,"LEFT_SIDE",n)||r.right.subject&&C(t,e,n)&&v(t,w,e,"RIGHT_SIDE",n)};case"nth-child":var j=r.index.value,E=i(r.right);return function(t,e,r){return E(t,e,r)&&y(t,e,j,r)};case"nth-last-child":var S=-r.index.value,k=i(r.right);return function(t,e,r){return k(t,e,r)&&y(t,e,S,r)};case"class":var I=r.name.toLowerCase();return function(t,e,n){if(n&&n.matchClass)return n.matchClass(r.name,t,e);if(n&&n.nodeTypeKey)return!1;switch(I){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===e.length||"MetaProperty"!==e[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(r.name))}}throw new Error("Unknown selector type: ".concat(r.type))}function f(e,r){var n=r&&r.nodeTypeKey||"type",u=e[n];return r&&r.visitorKeys&&r.visitorKeys[u]?r.visitorKeys[u]:t.VisitorKeys[u]?t.VisitorKeys[u]:r&&"function"==typeof r.fallback?r.fallback(e):Object.keys(e).filter((function(t){return t!==n}))}function h(t,r){var n=r&&r.nodeTypeKey||"type";return null!==t&&"object"===e(t)&&"string"==typeof t[n]}function p(t,e,n,u,o){var a=r(n,1)[0];if(!a)return!1;for(var s=f(a,o),c=0;c0&&h(i[l-1],o)&&e(i[l-1],n,o))return!0;if("RIGHT_SIDE"===u&&l=0&&i 0) {\n for (i = 1, j = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n };\n\n function peg$parse(input, options) {\n options = options !== void 0 ? options : {};\n\n var peg$FAILED = {},\n\n peg$startRuleFunctions = { start: peg$parsestart },\n peg$startRuleFunction = peg$parsestart,\n\n peg$c0 = function(ss) {\n return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };\n },\n peg$c1 = function() { return void 0; },\n peg$c2 = \" \",\n peg$c3 = peg$literalExpectation(\" \", false),\n peg$c4 = /^[^ [\\],():#!=><~+.]/,\n peg$c5 = peg$classExpectation([\" \", \"[\", \"]\", \",\", \"(\", \")\", \":\", \"#\", \"!\", \"=\", \">\", \"<\", \"~\", \"+\", \".\"], true, false),\n peg$c6 = function(i) { return i.join(''); },\n peg$c7 = \">\",\n peg$c8 = peg$literalExpectation(\">\", false),\n peg$c9 = function() { return 'child'; },\n peg$c10 = \"~\",\n peg$c11 = peg$literalExpectation(\"~\", false),\n peg$c12 = function() { return 'sibling'; },\n peg$c13 = \"+\",\n peg$c14 = peg$literalExpectation(\"+\", false),\n peg$c15 = function() { return 'adjacent'; },\n peg$c16 = function() { return 'descendant'; },\n peg$c17 = \",\",\n peg$c18 = peg$literalExpectation(\",\", false),\n peg$c19 = function(s, ss) {\n return [s].concat(ss.map(function (s) { return s[3]; }));\n },\n peg$c20 = function(op, s) {\n if (!op) return s;\n return { type: op, left: { type: 'exactNode' }, right: s };\n },\n peg$c21 = function(a, ops) {\n return ops.reduce(function (memo, rhs) {\n return { type: rhs[0], left: memo, right: rhs[1] };\n }, a);\n },\n peg$c22 = \"!\",\n peg$c23 = peg$literalExpectation(\"!\", false),\n peg$c24 = function(subject, as) {\n const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };\n if(subject) b.subject = true;\n return b;\n },\n peg$c25 = \"*\",\n peg$c26 = peg$literalExpectation(\"*\", false),\n peg$c27 = function(a) { return { type: 'wildcard', value: a }; },\n peg$c28 = \"#\",\n peg$c29 = peg$literalExpectation(\"#\", false),\n peg$c30 = function(i) { return { type: 'identifier', value: i }; },\n peg$c31 = \"[\",\n peg$c32 = peg$literalExpectation(\"[\", false),\n peg$c33 = \"]\",\n peg$c34 = peg$literalExpectation(\"]\", false),\n peg$c35 = function(v) { return v; },\n peg$c36 = /^[>\", \"<\", \"!\"], false, false),\n peg$c38 = \"=\",\n peg$c39 = peg$literalExpectation(\"=\", false),\n peg$c40 = function(a) { return (a || '') + '='; },\n peg$c41 = /^[><]/,\n peg$c42 = peg$classExpectation([\">\", \"<\"], false, false),\n peg$c43 = \".\",\n peg$c44 = peg$literalExpectation(\".\", false),\n peg$c45 = function(a, as) {\n return [].concat.apply([a], as).join('');\n },\n peg$c46 = function(name, op, value) {\n return { type: 'attribute', name: name, operator: op, value: value };\n },\n peg$c47 = function(name) { return { type: 'attribute', name: name }; },\n peg$c48 = \"\\\"\",\n peg$c49 = peg$literalExpectation(\"\\\"\", false),\n peg$c50 = /^[^\\\\\"]/,\n peg$c51 = peg$classExpectation([\"\\\\\", \"\\\"\"], true, false),\n peg$c52 = \"\\\\\",\n peg$c53 = peg$literalExpectation(\"\\\\\", false),\n peg$c54 = peg$anyExpectation(),\n peg$c55 = function(a, b) { return a + b; },\n peg$c56 = function(d) {\n return { type: 'literal', value: strUnescape(d.join('')) };\n },\n peg$c57 = \"'\",\n peg$c58 = peg$literalExpectation(\"'\", false),\n peg$c59 = /^[^\\\\']/,\n peg$c60 = peg$classExpectation([\"\\\\\", \"'\"], true, false),\n peg$c61 = /^[0-9]/,\n peg$c62 = peg$classExpectation([[\"0\", \"9\"]], false, false),\n peg$c63 = function(a, b) {\n // Can use `a.flat().join('')` once supported\n const leadingDecimals = a ? [].concat.apply([], a).join('') : '';\n return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };\n },\n peg$c64 = function(i) { return { type: 'literal', value: i }; },\n peg$c65 = \"type(\",\n peg$c66 = peg$literalExpectation(\"type(\", false),\n peg$c67 = /^[^ )]/,\n peg$c68 = peg$classExpectation([\" \", \")\"], true, false),\n peg$c69 = \")\",\n peg$c70 = peg$literalExpectation(\")\", false),\n peg$c71 = function(t) { return { type: 'type', value: t.join('') }; },\n peg$c72 = /^[imsu]/,\n peg$c73 = peg$classExpectation([\"i\", \"m\", \"s\", \"u\"], false, false),\n peg$c74 = \"/\",\n peg$c75 = peg$literalExpectation(\"/\", false),\n peg$c76 = /^[^\\/]/,\n peg$c77 = peg$classExpectation([\"/\"], true, false),\n peg$c78 = function(d, flgs) { return {\n type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') };\n },\n peg$c79 = function(i, is) {\n return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};\n },\n peg$c80 = \":not(\",\n peg$c81 = peg$literalExpectation(\":not(\", false),\n peg$c82 = function(ss) { return { type: 'not', selectors: ss }; },\n peg$c83 = \":matches(\",\n peg$c84 = peg$literalExpectation(\":matches(\", false),\n peg$c85 = function(ss) { return { type: 'matches', selectors: ss }; },\n peg$c86 = \":has(\",\n peg$c87 = peg$literalExpectation(\":has(\", false),\n peg$c88 = function(ss) { return { type: 'has', selectors: ss }; },\n peg$c89 = \":first-child\",\n peg$c90 = peg$literalExpectation(\":first-child\", false),\n peg$c91 = function() { return nth(1); },\n peg$c92 = \":last-child\",\n peg$c93 = peg$literalExpectation(\":last-child\", false),\n peg$c94 = function() { return nthLast(1); },\n peg$c95 = \":nth-child(\",\n peg$c96 = peg$literalExpectation(\":nth-child(\", false),\n peg$c97 = function(n) { return nth(parseInt(n.join(''), 10)); },\n peg$c98 = \":nth-last-child(\",\n peg$c99 = peg$literalExpectation(\":nth-last-child(\", false),\n peg$c100 = function(n) { return nthLast(parseInt(n.join(''), 10)); },\n peg$c101 = \":\",\n peg$c102 = peg$literalExpectation(\":\", false),\n peg$c103 = function(c) {\n return { type: 'class', name: c };\n },\n\n peg$currPos = 0,\n peg$savedPos = 0,\n peg$posDetailsCache = [{ line: 1, column: 1 }],\n peg$maxFailPos = 0,\n peg$maxFailExpected = [],\n peg$silentFails = 0,\n\n peg$resultsCache = {},\n\n peg$result;\n\n if (\"startRule\" in options) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase) {\n return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description: description };\n }\n\n function peg$computePosDetails(pos) {\n var details = peg$posDetailsCache[pos], p;\n\n if (details) {\n return details;\n } else {\n p = pos - 1;\n while (!peg$posDetailsCache[p]) {\n p--;\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos) {\n var startPosDetails = peg$computePosDetails(startPos),\n endPosDetails = peg$computePosDetails(endPos);\n\n return {\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parsestart() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 0,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseselectors();\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c1();\n }\n s0 = s1;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parse_() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 1,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseidentifierName() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 2,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c4.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c5); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c4.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c5); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c6(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsebinaryOp() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 3,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 62) {\n s2 = peg$c7;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c8); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c9();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 126) {\n s2 = peg$c10;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c12();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 43) {\n s2 = peg$c13;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c14); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c15();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c16();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehasSelectors() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n var key = peg$currPos * 32 + 4,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsehasSelector();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parsehasSelector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parsehasSelector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c19(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseselectors() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n var key = peg$currPos * 32 + 5,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseselector();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseselector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseselector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c19(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehasSelector() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 6,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsebinaryOp();\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseselector();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c20(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseselector() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 7,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsesequence();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parsebinaryOp();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsesequence();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parsebinaryOp();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsesequence();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c21(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsesequence() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 8,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 33) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseatom();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseatom();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c24(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseatom() {\n var s0;\n\n var key = peg$currPos * 32 + 9,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$parsewildcard();\n if (s0 === peg$FAILED) {\n s0 = peg$parseidentifier();\n if (s0 === peg$FAILED) {\n s0 = peg$parseattr();\n if (s0 === peg$FAILED) {\n s0 = peg$parsefield();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenegation();\n if (s0 === peg$FAILED) {\n s0 = peg$parsematches();\n if (s0 === peg$FAILED) {\n s0 = peg$parsehas();\n if (s0 === peg$FAILED) {\n s0 = peg$parsefirstChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parselastChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenthChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenthLastChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parseclass();\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsewildcard() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 10,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 42) {\n s1 = peg$c25;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c26); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c27(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseidentifier() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 11,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c28;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c29); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c30(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattr() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 12,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c31;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c32); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrValue();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s5 = peg$c33;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c34); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c35(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrOps() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 13,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (peg$c36.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c37); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 61) {\n s2 = peg$c38;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c39); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c40(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n if (peg$c41.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c42); }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrEqOps() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 14,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 33) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 61) {\n s2 = peg$c38;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c39); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c40(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrName() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 15,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseidentifierName();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c43;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseidentifierName();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c43;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseidentifierName();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c45(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrValue() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 16,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrEqOps();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsetype();\n if (s5 === peg$FAILED) {\n s5 = peg$parseregex();\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c46(s1, s3, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrOps();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsestring();\n if (s5 === peg$FAILED) {\n s5 = peg$parsenumber();\n if (s5 === peg$FAILED) {\n s5 = peg$parsepath();\n }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c46(s1, s3, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c47(s1);\n }\n s0 = s1;\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsestring() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 17,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c48;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c49); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c50.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c51); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c50.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c51); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c48;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c49); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c56(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c57;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c58); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c59.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c60); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c59.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c60); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c57;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c58); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c56(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenumber() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 18,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s3 = peg$c43;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c63(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsepath() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 19,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseidentifierName();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c64(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsetype() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 20,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c65) {\n s1 = peg$c65;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c66); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c67.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c68); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c67.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c68); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c71(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseflags() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 21,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = [];\n if (peg$c72.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c73); }\n }\n if (s1 !== peg$FAILED) {\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (peg$c72.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c73); }\n }\n }\n } else {\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseregex() {\n var s0, s1, s2, s3, s4;\n\n var key = peg$currPos * 32 + 22,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 47) {\n s1 = peg$c74;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c75); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c76.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c77); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c76.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c77); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 47) {\n s3 = peg$c74;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c75); }\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parseflags();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c78(s2, s4);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsefield() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n var key = peg$currPos * 32 + 23,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s1 = peg$c43;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c43;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseidentifierName();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c43;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseidentifierName();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c79(s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenegation() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 24,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c80) {\n s1 = peg$c80;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c81); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseselectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c82(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsematches() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 25,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 9) === peg$c83) {\n s1 = peg$c83;\n peg$currPos += 9;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c84); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseselectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c85(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehas() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 26,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c86) {\n s1 = peg$c86;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c87); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parsehasSelectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c88(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsefirstChild() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 27,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 12) === peg$c89) {\n s1 = peg$c89;\n peg$currPos += 12;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c91();\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parselastChild() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 28,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 11) === peg$c92) {\n s1 = peg$c92;\n peg$currPos += 11;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c93); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c94();\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenthChild() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 29,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 11) === peg$c95) {\n s1 = peg$c95;\n peg$currPos += 11;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c96); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c97(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenthLastChild() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 30,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 16) === peg$c98) {\n s1 = peg$c98;\n peg$currPos += 16;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c99); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c100(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseclass() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 31,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 58) {\n s1 = peg$c101;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c102); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c103(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n\n function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }\n function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }\n function strUnescape(s) {\n return s.replace(/\\\\(.)/g, function(match, ch) {\n switch(ch) {\n case 'b': return '\\b';\n case 'f': return '\\f';\n case 'n': return '\\n';\n case 'r': return '\\r';\n case 't': return '\\t';\n case 'v': return '\\v';\n default: return ch;\n }\n });\n }\n\n\n peg$result = peg$startRuleFunction();\n\n if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n return peg$result;\n } else {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n }\n\n return {\n SyntaxError: peg$SyntaxError,\n parse: peg$parse\n };\n});\n","/* vim: set sw=4 sts=4 : */\nimport estraverse from 'estraverse';\nimport parser from './parser.js';\n\n/**\n* @typedef {\"LEFT_SIDE\"|\"RIGHT_SIDE\"} Side\n*/\n\nconst LEFT_SIDE = 'LEFT_SIDE';\nconst RIGHT_SIDE = 'RIGHT_SIDE';\n\n/**\n * @external AST\n * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html\n */\n\n/**\n * One of the rules of `grammar.pegjs`\n * @typedef {PlainObject} SelectorAST\n * @see grammar.pegjs\n*/\n\n/**\n * The `sequence` production of `grammar.pegjs`\n * @typedef {PlainObject} SelectorSequenceAST\n*/\n\n/**\n * Get the value of a property which may be multiple levels down\n * in the object.\n * @param {?PlainObject} obj\n * @param {string[]} keys\n * @returns {undefined|boolean|string|number|external:AST}\n */\nfunction getPath(obj, keys) {\n for (let i = 0; i < keys.length; ++i) {\n if (obj == null) { return obj; }\n obj = obj[keys[i]];\n }\n return obj;\n}\n\n/**\n * Determine whether `node` can be reached by following `path`,\n * starting at `ancestor`.\n * @param {?external:AST} node\n * @param {?external:AST} ancestor\n * @param {string[]} path\n * @param {Integer} fromPathIndex\n * @returns {boolean}\n */\nfunction inPath(node, ancestor, path, fromPathIndex) {\n let current = ancestor;\n for (let i = fromPathIndex; i < path.length; ++i) {\n if (current == null) {\n return false;\n }\n const field = current[path[i]];\n if (Array.isArray(field)) {\n for (let k = 0; k < field.length; ++k) {\n if (inPath(node, field[k], path, i + 1)) {\n return true;\n }\n }\n return false;\n }\n current = field;\n }\n return node === current;\n}\n\n/**\n * A generated matcher function for a selector.\n * @callback SelectorMatcher\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @returns {void}\n*/\n\n/**\n * A WeakMap for holding cached matcher functions for selectors.\n * @type {WeakMap}\n*/\nconst MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap : null;\n\n/**\n * Look up a matcher function for `selector` in the cache.\n * If it does not exist, generate it with `generateMatcher` and add it to the cache.\n * In engines without WeakMap, the caching is skipped and matchers are generated with every call.\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction getMatcher(selector) {\n if (selector == null) {\n return () => true;\n }\n\n if (MATCHER_CACHE != null) {\n let matcher = MATCHER_CACHE.get(selector);\n if (matcher != null) {\n return matcher;\n }\n matcher = generateMatcher(selector);\n MATCHER_CACHE.set(selector, matcher);\n return matcher;\n }\n\n return generateMatcher(selector);\n}\n\n/**\n * Create a matcher function for `selector`,\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction generateMatcher(selector) {\n switch(selector.type) {\n case 'wildcard':\n return () => true;\n\n case 'identifier': {\n const value = selector.value.toLowerCase();\n return (node, ancestry, options) => {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n return value === node[nodeTypeKey].toLowerCase();\n };\n }\n\n case 'exactNode':\n return (node, ancestry) => {\n return ancestry.length === 0;\n };\n\n case 'field': {\n const path = selector.name.split('.');\n return (node, ancestry) => {\n const ancestor = ancestry[path.length - 1];\n return inPath(node, ancestor, path, 0);\n };\n }\n\n case 'matches': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, ancestry, options)) { return true; }\n }\n return false;\n };\n }\n\n case 'compound': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (!matchers[i](node, ancestry, options)) { return false; }\n }\n return true;\n };\n }\n\n case 'not': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, ancestry, options)) { return false; }\n }\n return true;\n };\n }\n\n case 'has': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n let result = false;\n\n const a = [];\n estraverse.traverse(node, {\n enter (node, parent) {\n if (parent != null) { a.unshift(parent); }\n\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, a, options)) {\n result = true;\n this.break();\n return;\n }\n }\n },\n leave () { a.shift(); },\n keys: options && options.visitorKeys,\n fallback: options && options.fallback || 'iteration'\n });\n\n return result;\n };\n }\n\n case 'child': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) => {\n if (ancestry.length > 0 && right(node, ancestry, options)) {\n return left(ancestry[0], ancestry.slice(1), options);\n }\n return false;\n };\n }\n\n case 'descendant': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) => {\n if (right(node, ancestry, options)) {\n for (let i = 0, l = ancestry.length; i < l; ++i) {\n if (left(ancestry[i], ancestry.slice(i + 1), options)) {\n return true;\n }\n }\n }\n return false;\n };\n }\n\n case 'attribute': {\n const path = selector.name.split('.');\n switch (selector.operator) {\n case void 0:\n return (node) => getPath(node, path) != null;\n case '=':\n switch (selector.value.type) {\n case 'regexp':\n return (node) => {\n const p = getPath(node, path);\n return typeof p === 'string' && selector.value.value.test(p);\n };\n case 'literal': {\n const literal = `${selector.value.value}`;\n return (node) => literal === `${getPath(node, path)}`;\n }\n case 'type':\n return (node) => selector.value.value === typeof getPath(node, path);\n }\n throw new Error(`Unknown selector value type: ${selector.value.type}`);\n case '!=':\n switch (selector.value.type) {\n case 'regexp':\n return (node) => !selector.value.value.test(getPath(node, path));\n case 'literal': {\n const literal = `${selector.value.value}`;\n return (node) => literal !== `${getPath(node, path)}`;\n }\n case 'type':\n return (node) => selector.value.value !== typeof getPath(node, path);\n }\n throw new Error(`Unknown selector value type: ${selector.value.type}`);\n case '<=':\n return (node) => getPath(node, path) <= selector.value.value;\n case '<':\n return (node) => getPath(node, path) < selector.value.value;\n case '>':\n return (node) => getPath(node, path) > selector.value.value;\n case '>=':\n return (node) => getPath(node, path) >= selector.value.value;\n }\n throw new Error(`Unknown operator: ${selector.operator}`);\n }\n\n case 'sibling': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n sibling(node, left, ancestry, LEFT_SIDE, options) ||\n selector.left.subject &&\n left(node, ancestry, options) &&\n sibling(node, right, ancestry, RIGHT_SIDE, options);\n }\n\n case 'adjacent': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n adjacent(node, left, ancestry, LEFT_SIDE, options) ||\n selector.right.subject &&\n left(node, ancestry, options) &&\n adjacent(node, right, ancestry, RIGHT_SIDE, options);\n }\n\n case 'nth-child': {\n const nth = selector.index.value;\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n nthChild(node, ancestry, nth, options);\n }\n\n case 'nth-last-child': {\n const nth = -selector.index.value;\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n nthChild(node, ancestry, nth, options);\n }\n\n case 'class': {\n \n const name = selector.name.toLowerCase();\n\n return (node, ancestry, options) => {\n \n if (options && options.matchClass) {\n return options.matchClass(selector.name, node, ancestry);\n }\n \n if (options && options.nodeTypeKey) return false; \n\n switch(name){\n case 'statement':\n if(node.type.slice(-9) === 'Statement') return true;\n // fallthrough: interface Declaration <: Statement { }\n case 'declaration':\n return node.type.slice(-11) === 'Declaration';\n case 'pattern':\n if(node.type.slice(-7) === 'Pattern') return true;\n // fallthrough: interface Expression <: Node, Pattern { }\n case 'expression':\n return node.type.slice(-10) === 'Expression' ||\n node.type.slice(-7) === 'Literal' ||\n (\n node.type === 'Identifier' &&\n (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')\n ) ||\n node.type === 'MetaProperty';\n case 'function':\n return node.type === 'FunctionDeclaration' ||\n node.type === 'FunctionExpression' ||\n node.type === 'ArrowFunctionExpression';\n }\n throw new Error(`Unknown class name: ${selector.name}`);\n };\n }\n }\n\n throw new Error(`Unknown selector type: ${selector.type}`);\n}\n\n/**\n * @callback TraverseOptionFallback\n * @param {external:AST} node The given node.\n * @returns {string[]} An array of visitor keys for the given node.\n */\n\n/**\n * @callback ClassMatcher\n * @param {string} className The name of the class to match.\n * @param {external:AST} node The node to match against.\n * @param {Array} ancestry The ancestry of the node.\n * @returns {boolean} True if the node matches the class, false if not.\n */\n\n/**\n * @typedef {object} ESQueryOptions\n * @property {string} [nodeTypeKey=\"type\"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.\n * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.\n * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.\n * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.\n */\n\n/**\n * Given a `node` and its ancestors, determine if `node` is matched\n * by `selector`.\n * @param {?external:AST} node\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @throws {Error} Unknowns (operator, class name, selector type, or\n * selector value type)\n * @returns {boolean}\n */\nfunction matches(node, selector, ancestry, options) {\n if (!selector) { return true; }\n if (!node) { return false; }\n if (!ancestry) { ancestry = []; }\n\n return getMatcher(selector)(node, ancestry, options);\n}\n\n/**\n * Get visitor keys of a given node.\n * @param {external:AST} node The AST node to get keys.\n * @param {ESQueryOptions|undefined} options\n * @returns {string[]} Visitor keys of the node.\n */\nfunction getVisitorKeys(node, options) {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n\n const nodeType = node[nodeTypeKey];\n if (options && options.visitorKeys && options.visitorKeys[nodeType]) {\n return options.visitorKeys[nodeType];\n }\n if (estraverse.VisitorKeys[nodeType]) {\n return estraverse.VisitorKeys[nodeType];\n }\n if (options && typeof options.fallback === 'function') {\n return options.fallback(node);\n }\n // 'iteration' fallback\n return Object.keys(node).filter(function (key) {\n return key !== nodeTypeKey;\n });\n}\n\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} node The value to check.\n * @param {ESQueryOptions|undefined} options The options to use.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(node, options) {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n return node !== null && typeof node === 'object' && typeof node[nodeTypeKey] === 'string';\n}\n\n/**\n * Determines if the given node has a sibling that matches the\n * given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction sibling(node, matcher, ancestry, side, options) {\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)) {\n const startIndex = listProp.indexOf(node);\n if (startIndex < 0) { continue; }\n let lowerBound, upperBound;\n if (side === LEFT_SIDE) {\n lowerBound = 0;\n upperBound = startIndex;\n } else {\n lowerBound = startIndex + 1;\n upperBound = listProp.length;\n }\n for (let k = lowerBound; k < upperBound; ++k) {\n if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Determines if the given node has an adjacent sibling that matches\n * the given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction adjacent(node, matcher, ancestry, side, options) {\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)) {\n const idx = listProp.indexOf(node);\n if (idx < 0) { continue; }\n if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {\n return true;\n }\n if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Determines if the given node is the `nth` child.\n * If `nth` is negative then the position is counted\n * from the end of the list of children.\n * @param {external:AST} node\n * @param {external:AST[]} ancestry\n * @param {Integer} nth\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction nthChild(node, ancestry, nth, options) {\n if (nth === 0) { return false; }\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)){\n const idx = nth < 0 ? listProp.length + nth : nth - 1;\n if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * For each selector node marked as a subject, find the portion of the\n * selector that the subject must match.\n * @param {SelectorAST} selector\n * @param {SelectorAST} [ancestor] Defaults to `selector`\n * @returns {SelectorAST[]}\n */\nfunction subjects(selector, ancestor) {\n if (selector == null || typeof selector != 'object') { return []; }\n if (ancestor == null) { ancestor = selector; }\n const results = selector.subject ? [ancestor] : [];\n const keys = Object.keys(selector);\n for (let i = 0; i < keys.length; ++i) {\n const p = keys[i];\n const sel = selector[p];\n results.push(...subjects(sel, p === 'left' ? sel : ancestor));\n }\n return results;\n}\n\n/**\n* @callback TraverseVisitor\n* @param {?external:AST} node\n* @param {?external:AST} parent\n* @param {external:AST[]} ancestry\n*/\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {TraverseVisitor} visitor\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction traverse(ast, selector, visitor, options) {\n if (!selector) { return; }\n const ancestry = [];\n const matcher = getMatcher(selector);\n const altSubjects = subjects(selector).map(getMatcher);\n estraverse.traverse(ast, {\n enter (node, parent) {\n if (parent != null) { ancestry.unshift(parent); }\n if (matcher(node, ancestry, options)) {\n if (altSubjects.length) {\n for (let i = 0, l = altSubjects.length; i < l; ++i) {\n if (altSubjects[i](node, ancestry, options)) {\n visitor(node, parent, ancestry);\n }\n for (let k = 0, m = ancestry.length; k < m; ++k) {\n const succeedingAncestry = ancestry.slice(k + 1);\n if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {\n visitor(ancestry[k], parent, succeedingAncestry);\n }\n }\n }\n } else {\n visitor(node, parent, ancestry);\n }\n }\n },\n leave () { ancestry.shift(); },\n keys: options && options.visitorKeys,\n fallback: options && options.fallback || 'iteration'\n });\n}\n\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction match(ast, selector, options) {\n const results = [];\n traverse(ast, selector, function (node) {\n results.push(node);\n }, options);\n return results;\n}\n\n/**\n * Parse a selector string and return its AST.\n * @param {string} selector\n * @returns {SelectorAST}\n */\nfunction parse(selector) {\n return parser.parse(selector);\n}\n\n/**\n * Query the code AST using the selector string.\n * @param {external:AST} ast\n * @param {string} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction query(ast, selector, options) {\n return match(ast, parse(selector), options);\n}\n\nquery.parse = parse;\nquery.match = match;\nquery.traverse = traverse;\nquery.matches = matches;\nquery.query = query;\n\nexport default query;\n"],"names":["module","exports","peg$SyntaxError","message","expected","found","location","this","name","Error","captureStackTrace","child","parent","ctor","constructor","prototype","peg$subclass","buildMessage","DESCRIBE_EXPECTATION_FNS","literal","expectation","literalEscape","text","class","i","escapedParts","parts","length","Array","classEscape","inverted","any","end","other","description","hex","ch","charCodeAt","toString","toUpperCase","s","replace","j","descriptions","type","sort","slice","join","describeExpected","describeFound","SyntaxError","parse","input","options","peg$result","peg$FAILED","peg$startRuleFunctions","start","peg$parsestart","peg$startRuleFunction","peg$c3","peg$literalExpectation","peg$c4","peg$c5","peg$classExpectation","peg$c8","peg$c11","peg$c14","peg$c18","peg$c19","ss","concat","map","peg$c23","peg$c26","peg$c29","peg$c32","peg$c34","peg$c36","peg$c37","peg$c39","peg$c40","a","peg$c41","peg$c42","peg$c44","peg$c46","op","value","operator","peg$c49","peg$c50","peg$c51","peg$c53","peg$c54","peg$c55","b","peg$c56","d","match","peg$c58","peg$c59","peg$c60","peg$c61","peg$c62","peg$c66","peg$c67","peg$c68","peg$c70","peg$c72","peg$c73","peg$c75","peg$c76","peg$c77","peg$c81","peg$c84","peg$c87","peg$c90","peg$c93","peg$c96","peg$c99","peg$c102","peg$currPos","peg$posDetailsCache","line","column","peg$maxFailPos","peg$maxFailExpected","peg$resultsCache","startRule","ignoreCase","peg$computePosDetails","pos","p","details","peg$computeLocation","startPos","endPos","startPosDetails","endPosDetails","offset","peg$fail","push","s0","s1","s2","key","cached","nextPos","result","peg$parse_","peg$parseselectors","selectors","peg$c1","peg$parseidentifierName","test","charAt","peg$parsebinaryOp","s3","s4","s5","s6","s7","peg$parseselector","peg$parsehasSelector","left","right","peg$parsesequence","reduce","memo","rhs","subject","as","peg$parseatom","peg$parsewildcard","peg$parseidentifier","peg$parseattrName","peg$parseattrEqOps","substr","peg$parsetype","flgs","peg$parseflags","RegExp","peg$parseregex","peg$parseattrOps","peg$parsestring","leadingDecimals","apply","parseFloat","peg$parsenumber","peg$parsepath","peg$parseattrValue","peg$parseattr","peg$parsefield","peg$parsenegation","peg$parsematches","peg$parsehasSelectors","peg$parsehas","nth","peg$parsefirstChild","nthLast","peg$parselastChild","parseInt","peg$parsenthChild","peg$parsenthLastChild","peg$parseclass","n","index","factory","getPath","obj","keys","MATCHER_CACHE","WeakMap","getMatcher","selector","matcher","get","generateMatcher","set","toLowerCase","node","ancestry","nodeTypeKey","path","split","inPath","ancestor","fromPathIndex","current","field","isArray","k","matchers","estraverse","traverse","enter","unshift","leave","shift","visitorKeys","fallback","l","sibling","adjacent","nthChild","matchClass","getVisitorKeys","nodeType","VisitorKeys","Object","filter","isNode","_typeof","side","listProp","startIndex","indexOf","lowerBound","upperBound","idx","ast","visitor","altSubjects","subjects","results","sel","m","succeedingAncestry","parser","query","matches"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/esquery/dist/esquery.min.js b/node_modules/esquery/dist/esquery.min.js new file mode 100644 index 0000000..6ec6c9b --- /dev/null +++ b/node_modules/esquery/dist/esquery.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).esquery=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--r)if(e[r].node===t)return!0;return!1}function d(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:i={},Remove:s={}},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r=0;)if(v=s[f=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]&&!y(n,v[m])){if(h(u,x[d]))o=new c(v[m],[f,m],"Property",null);else{if(!p(v[m]))continue;o=new c(v[m],[f,m],null,null)}r.push(o)}}else if(p(v)){if(y(n,v))continue;r.push(new c(v,f,null,null))}}}else if(o=n.pop(),l=this.__execute(t.leave,o),this.__state===a||l===a)return},f.prototype.replace=function(e,t){var r,n,o,u,f,y,d,m,x,v,g,A,E;function b(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key=0;)if(v=o[E=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]){if(h(u,x[d]))y=new c(v[m],[E,m],"Property",new l(v,m));else{if(!p(v[m]))continue;y=new c(v[m],[E,m],null,new l(v,m))}r.push(y)}}else p(v)&&r.push(new c(v,E,null,new l(o,E)))}}else if(y=n.pop(),void 0!==(f=this.__execute(t.leave,y))&&f!==a&&f!==i&&f!==s&&y.ref.replace(f),this.__state!==s&&f!==s||b(y),this.__state===a||f===a)return A.root;return A.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var o,a,i,s,l=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(i=0,a=t.length;ie.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,d(e,{leave:function(e){for(var t;se.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)})),s=a((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t0){for(t=1,n=1;t<~+.]/,p=pe([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=fe(">",!1),y=fe("~",!1),d=fe("+",!1),m=fe(",",!1),x=function(e,t){return[e].concat(t.map((function(e){return e[3]})))},v=fe("!",!1),g=fe("*",!1),A=fe("#",!1),E=fe("[",!1),b=fe("]",!1),S=/^[>","<","!"],!1,!1),C=fe("=",!1),w=function(e){return(e||"")+"="},P=/^[><]/,k=pe([">","<"],!1,!1),D=fe(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=fe('"',!1),T=/^[^\\"]/,F=pe(["\\",'"'],!0,!1),R=fe("\\",!1),O={type:"any"},L=function(e,t){return e+t},M=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},B=fe("'",!1),U=/^[^\\']/,K=pe(["\\","'"],!0,!1),N=/^[0-9]/,W=pe([["0","9"]],!1,!1),q=fe("type(",!1),V=/^[^ )]/,G=pe([" ",")"],!0,!1),z=fe(")",!1),H=/^[imsu]/,Y=pe(["i","m","s","u"],!1,!1),$=fe("/",!1),J=/^[^\/]/,Q=pe(["/"],!0,!1),X=fe(":not(",!1),Z=fe(":matches(",!1),ee=fe(":has(",!1),te=fe(":first-child",!1),re=fe(":last-child",!1),ne=fe(":nth-child(",!1),oe=fe(":nth-last-child(",!1),ae=fe(":",!1),ie=0,se=[{line:1,column:1}],ue=0,le=[],ce={};if("startRule"in r){if(!(r.startRule in u))throw new Error("Can't start parsing from rule \""+r.startRule+'".');l=u[r.startRule]}function fe(e,t){return{type:"literal",text:e,ignoreCase:t}}function pe(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function he(e){var r,n=se[e];if(n)return n;for(r=e-1;!se[r];)r--;for(n={line:(n=se[r]).line,column:n.column};rue&&(ue=ie,le=[]),le.push(e))}function me(){var e,t,r,n,o=32*ie+0,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,(t=xe())!==s&&(r=Ae())!==s&&xe()!==s?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(ie=e,e=s),e===s&&(e=ie,(t=xe())!==s&&(t=void 0),e=t),ce[o]={nextPos:ie,result:e},e)}function xe(){var e,r,n=32*ie+1,o=ce[n];if(o)return ie=o.nextPos,o.result;for(e=[],32===t.charCodeAt(ie)?(r=" ",ie++):(r=s,de(c));r!==s;)e.push(r),32===t.charCodeAt(ie)?(r=" ",ie++):(r=s,de(c));return ce[n]={nextPos:ie,result:e},e}function ve(){var e,r,n,o=32*ie+2,a=ce[o];if(a)return ie=a.nextPos,a.result;if(r=[],f.test(t.charAt(ie))?(n=t.charAt(ie),ie++):(n=s,de(p)),n!==s)for(;n!==s;)r.push(n),f.test(t.charAt(ie))?(n=t.charAt(ie),ie++):(n=s,de(p));else r=s;return r!==s&&(r=r.join("")),e=r,ce[o]={nextPos:ie,result:e},e}function ge(){var e,r,n,o=32*ie+3,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,(r=xe())!==s?(62===t.charCodeAt(ie)?(n=">",ie++):(n=s,de(h)),n!==s&&xe()!==s?e=r="child":(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,(r=xe())!==s?(126===t.charCodeAt(ie)?(n="~",ie++):(n=s,de(y)),n!==s&&xe()!==s?e=r="sibling":(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,(r=xe())!==s?(43===t.charCodeAt(ie)?(n="+",ie++):(n=s,de(d)),n!==s&&xe()!==s?e=r="adjacent":(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,32===t.charCodeAt(ie)?(r=" ",ie++):(r=s,de(c)),r!==s&&(n=xe())!==s?e=r="descendant":(ie=e,e=s)))),ce[o]={nextPos:ie,result:e},e)}function Ae(){var e,r,n,o,a,i,u,l,c=32*ie+5,f=ce[c];if(f)return ie=f.nextPos,f.result;if(e=ie,(r=be())!==s){for(n=[],o=ie,(a=xe())!==s?(44===t.charCodeAt(ie)?(i=",",ie++):(i=s,de(m)),i!==s&&(u=xe())!==s&&(l=be())!==s?o=a=[a,i,u,l]:(ie=o,o=s)):(ie=o,o=s);o!==s;)n.push(o),o=ie,(a=xe())!==s?(44===t.charCodeAt(ie)?(i=",",ie++):(i=s,de(m)),i!==s&&(u=xe())!==s&&(l=be())!==s?o=a=[a,i,u,l]:(ie=o,o=s)):(ie=o,o=s);n!==s?e=r=x(r,n):(ie=e,e=s)}else ie=e,e=s;return ce[c]={nextPos:ie,result:e},e}function Ee(){var e,t,r,n,o,a=32*ie+6,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,(t=ge())===s&&(t=null),t!==s&&(r=be())!==s?(o=r,e=t=(n=t)?{type:n,left:{type:"exactNode"},right:o}:o):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}function be(){var e,t,r,n,o,a,i,u=32*ie+7,l=ce[u];if(l)return ie=l.nextPos,l.result;if(e=ie,(t=Se())!==s){for(r=[],n=ie,(o=ge())!==s&&(a=Se())!==s?n=o=[o,a]:(ie=n,n=s);n!==s;)r.push(n),n=ie,(o=ge())!==s&&(a=Se())!==s?n=o=[o,a]:(ie=n,n=s);r!==s?(i=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),i)):(ie=e,e=s)}else ie=e,e=s;return ce[u]={nextPos:ie,result:e},e}function Se(){var e,r,n,o,a,i,u,l=32*ie+8,c=ce[l];if(c)return ie=c.nextPos,c.result;if(e=ie,33===t.charCodeAt(ie)?(r="!",ie++):(r=s,de(v)),r===s&&(r=null),r!==s){if(n=[],(o=_e())!==s)for(;o!==s;)n.push(o),o=_e();else n=s;n!==s?(a=r,u=1===(i=n).length?i[0]:{type:"compound",selectors:i},a&&(u.subject=!0),e=r=u):(ie=e,e=s)}else ie=e,e=s;return ce[l]={nextPos:ie,result:e},e}function _e(){var e,r=32*ie+9,n=ce[r];return n?(ie=n.nextPos,n.result):((e=function(){var e,r,n=32*ie+10,o=ce[n];return o?(ie=o.nextPos,o.result):(42===t.charCodeAt(ie)?(r="*",ie++):(r=s,de(g)),r!==s&&(r={type:"wildcard",value:r}),e=r,ce[n]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o=32*ie+11,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,35===t.charCodeAt(ie)?(r="#",ie++):(r=s,de(A)),r===s&&(r=null),r!==s&&(n=ve())!==s?e=r={type:"identifier",value:n}:(ie=e,e=s),ce[o]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=32*ie+12,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,91===t.charCodeAt(ie)?(r="[",ie++):(r=s,de(E)),r!==s&&xe()!==s&&(n=function(){var e,r,n,o,a=32*ie+16,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,(r=Ce())!==s&&xe()!==s&&(n=function(){var e,r,n,o=32*ie+14,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,33===t.charCodeAt(ie)?(r="!",ie++):(r=s,de(v)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ie)?(n="=",ie++):(n=s,de(C)),n!==s?(r=w(r),e=r):(ie=e,e=s)):(ie=e,e=s),ce[o]={nextPos:ie,result:e},e)}())!==s&&xe()!==s?((o=function(){var e,r,n,o,a,i=32*ie+20,u=ce[i];if(u)return ie=u.nextPos,u.result;if(e=ie,"type("===t.substr(ie,5)?(r="type(",ie+=5):(r=s,de(q)),r!==s)if(xe()!==s){if(n=[],V.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(G)),o!==s)for(;o!==s;)n.push(o),V.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(G));else n=s;n!==s&&(o=xe())!==s?(41===t.charCodeAt(ie)?(a=")",ie++):(a=s,de(z)),a!==s?(r={type:"type",value:n.join("")},e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;else ie=e,e=s;return ce[i]={nextPos:ie,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,u=32*ie+22,l=ce[u];if(l)return ie=l.nextPos,l.result;if(e=ie,47===t.charCodeAt(ie)?(r="/",ie++):(r=s,de($)),r!==s){if(n=[],J.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(Q)),o!==s)for(;o!==s;)n.push(o),J.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(Q));else n=s;n!==s?(47===t.charCodeAt(ie)?(o="/",ie++):(o=s,de($)),o!==s?((a=function(){var e,r,n=32*ie+21,o=ce[n];if(o)return ie=o.nextPos,o.result;if(e=[],H.test(t.charAt(ie))?(r=t.charAt(ie),ie++):(r=s,de(Y)),r!==s)for(;r!==s;)e.push(r),H.test(t.charAt(ie))?(r=t.charAt(ie),ie++):(r=s,de(Y));else e=s;return ce[n]={nextPos:ie,result:e},e}())===s&&(a=null),a!==s?(i=a,r={type:"regexp",value:new RegExp(n.join(""),i?i.join(""):"")},e=r):(ie=e,e=s)):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;return ce[u]={nextPos:ie,result:e},e}()),o!==s?(r=I(r,n,o),e=r):(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,(r=Ce())!==s&&xe()!==s&&(n=function(){var e,r,n,o=32*ie+13,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,S.test(t.charAt(ie))?(r=t.charAt(ie),ie++):(r=s,de(_)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ie)?(n="=",ie++):(n=s,de(C)),n!==s?(r=w(r),e=r):(ie=e,e=s)):(ie=e,e=s),e===s&&(P.test(t.charAt(ie))?(e=t.charAt(ie),ie++):(e=s,de(k))),ce[o]={nextPos:ie,result:e},e)}())!==s&&xe()!==s?((o=function(){var e,r,n,o,a,i,u=32*ie+17,l=ce[u];if(l)return ie=l.nextPos,l.result;if(e=ie,34===t.charCodeAt(ie)?(r='"',ie++):(r=s,de(j)),r!==s){for(n=[],T.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(F)),o===s&&(o=ie,92===t.charCodeAt(ie)?(a="\\",ie++):(a=s,de(R)),a!==s?(t.length>ie?(i=t.charAt(ie),ie++):(i=s,de(O)),i!==s?(a=L(a,i),o=a):(ie=o,o=s)):(ie=o,o=s));o!==s;)n.push(o),T.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(F)),o===s&&(o=ie,92===t.charCodeAt(ie)?(a="\\",ie++):(a=s,de(R)),a!==s?(t.length>ie?(i=t.charAt(ie),ie++):(i=s,de(O)),i!==s?(a=L(a,i),o=a):(ie=o,o=s)):(ie=o,o=s));n!==s?(34===t.charCodeAt(ie)?(o='"',ie++):(o=s,de(j)),o!==s?(r=M(n),e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;if(e===s)if(e=ie,39===t.charCodeAt(ie)?(r="'",ie++):(r=s,de(B)),r!==s){for(n=[],U.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(K)),o===s&&(o=ie,92===t.charCodeAt(ie)?(a="\\",ie++):(a=s,de(R)),a!==s?(t.length>ie?(i=t.charAt(ie),ie++):(i=s,de(O)),i!==s?(a=L(a,i),o=a):(ie=o,o=s)):(ie=o,o=s));o!==s;)n.push(o),U.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(K)),o===s&&(o=ie,92===t.charCodeAt(ie)?(a="\\",ie++):(a=s,de(R)),a!==s?(t.length>ie?(i=t.charAt(ie),ie++):(i=s,de(O)),i!==s?(a=L(a,i),o=a):(ie=o,o=s)):(ie=o,o=s));n!==s?(39===t.charCodeAt(ie)?(o="'",ie++):(o=s,de(B)),o!==s?(r=M(n),e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;return ce[u]={nextPos:ie,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,u,l=32*ie+18,c=ce[l];if(c)return ie=c.nextPos,c.result;for(e=ie,r=ie,n=[],N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));o!==s;)n.push(o),N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));if(n!==s?(46===t.charCodeAt(ie)?(o=".",ie++):(o=s,de(D)),o!==s?r=n=[n,o]:(ie=r,r=s)):(ie=r,r=s),r===s&&(r=null),r!==s){if(n=[],N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));else n=s;n!==s?(i=n,u=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(u+i.join(""))},e=r):(ie=e,e=s)}else ie=e,e=s;return ce[l]={nextPos:ie,result:e},e}())===s&&(o=function(){var e,t,r=32*ie+19,n=ce[r];return n?(ie=n.nextPos,n.result):((t=ve())!==s&&(t={type:"literal",value:t}),e=t,ce[r]={nextPos:ie,result:e},e)}()),o!==s?(r=I(r,n,o),e=r):(ie=e,e=s)):(ie=e,e=s),e===s&&(e=ie,(r=Ce())!==s&&(r={type:"attribute",name:r}),e=r)),ce[a]={nextPos:ie,result:e},e)}())!==s&&xe()!==s?(93===t.charCodeAt(ie)?(o="]",ie++):(o=s,de(b)),o!==s?e=r=n:(ie=e,e=s)):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i,u,l,c=32*ie+23,f=ce[c];if(f)return ie=f.nextPos,f.result;if(e=ie,46===t.charCodeAt(ie)?(r=".",ie++):(r=s,de(D)),r!==s)if((n=ve())!==s){for(o=[],a=ie,46===t.charCodeAt(ie)?(i=".",ie++):(i=s,de(D)),i!==s&&(u=ve())!==s?a=i=[i,u]:(ie=a,a=s);a!==s;)o.push(a),a=ie,46===t.charCodeAt(ie)?(i=".",ie++):(i=s,de(D)),i!==s&&(u=ve())!==s?a=i=[i,u]:(ie=a,a=s);o!==s?(l=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),l)},e=r):(ie=e,e=s)}else ie=e,e=s;else ie=e,e=s;return ce[c]={nextPos:ie,result:e},e}())===s&&(e=function(){var e,r,n,o,a=32*ie+24,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,":not("===t.substr(ie,5)?(r=":not(",ie+=5):(r=s,de(X)),r!==s&&xe()!==s&&(n=Ae())!==s&&xe()!==s?(41===t.charCodeAt(ie)?(o=")",ie++):(o=s,de(z)),o!==s?e=r={type:"not",selectors:n}:(ie=e,e=s)):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=32*ie+25,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,":matches("===t.substr(ie,9)?(r=":matches(",ie+=9):(r=s,de(Z)),r!==s&&xe()!==s&&(n=Ae())!==s&&xe()!==s?(41===t.charCodeAt(ie)?(o=")",ie++):(o=s,de(z)),o!==s?e=r={type:"matches",selectors:n}:(ie=e,e=s)):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=32*ie+26,i=ce[a];return i?(ie=i.nextPos,i.result):(e=ie,":has("===t.substr(ie,5)?(r=":has(",ie+=5):(r=s,de(ee)),r!==s&&xe()!==s&&(n=function(){var e,r,n,o,a,i,u,l,c=32*ie+4,f=ce[c];if(f)return ie=f.nextPos,f.result;if(e=ie,(r=Ee())!==s){for(n=[],o=ie,(a=xe())!==s?(44===t.charCodeAt(ie)?(i=",",ie++):(i=s,de(m)),i!==s&&(u=xe())!==s&&(l=Ee())!==s?o=a=[a,i,u,l]:(ie=o,o=s)):(ie=o,o=s);o!==s;)n.push(o),o=ie,(a=xe())!==s?(44===t.charCodeAt(ie)?(i=",",ie++):(i=s,de(m)),i!==s&&(u=xe())!==s&&(l=Ee())!==s?o=a=[a,i,u,l]:(ie=o,o=s)):(ie=o,o=s);n!==s?e=r=x(r,n):(ie=e,e=s)}else ie=e,e=s;return ce[c]={nextPos:ie,result:e},e}())!==s&&xe()!==s?(41===t.charCodeAt(ie)?(o=")",ie++):(o=s,de(z)),o!==s?e=r={type:"has",selectors:n}:(ie=e,e=s)):(ie=e,e=s),ce[a]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n=32*ie+27,o=ce[n];return o?(ie=o.nextPos,o.result):(":first-child"===t.substr(ie,12)?(r=":first-child",ie+=12):(r=s,de(te)),r!==s&&(r=we(1)),e=r,ce[n]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n=32*ie+28,o=ce[n];return o?(ie=o.nextPos,o.result):(":last-child"===t.substr(ie,11)?(r=":last-child",ie+=11):(r=s,de(re)),r!==s&&(r=Pe(1)),e=r,ce[n]={nextPos:ie,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i=32*ie+29,u=ce[i];if(u)return ie=u.nextPos,u.result;if(e=ie,":nth-child("===t.substr(ie,11)?(r=":nth-child(",ie+=11):(r=s,de(ne)),r!==s)if(xe()!==s){if(n=[],N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));else n=s;n!==s&&(o=xe())!==s?(41===t.charCodeAt(ie)?(a=")",ie++):(a=s,de(z)),a!==s?(r=we(parseInt(n.join(""),10)),e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;else ie=e,e=s;return ce[i]={nextPos:ie,result:e},e}())===s&&(e=function(){var e,r,n,o,a,i=32*ie+30,u=ce[i];if(u)return ie=u.nextPos,u.result;if(e=ie,":nth-last-child("===t.substr(ie,16)?(r=":nth-last-child(",ie+=16):(r=s,de(oe)),r!==s)if(xe()!==s){if(n=[],N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ie))?(o=t.charAt(ie),ie++):(o=s,de(W));else n=s;n!==s&&(o=xe())!==s?(41===t.charCodeAt(ie)?(a=")",ie++):(a=s,de(z)),a!==s?(r=Pe(parseInt(n.join(""),10)),e=r):(ie=e,e=s)):(ie=e,e=s)}else ie=e,e=s;else ie=e,e=s;return ce[i]={nextPos:ie,result:e},e}())===s&&(e=function(){var e,r,n,o=32*ie+31,a=ce[o];return a?(ie=a.nextPos,a.result):(e=ie,58===t.charCodeAt(ie)?(r=":",ie++):(r=s,de(ae)),r!==s&&(n=ve())!==s?e=r={type:"class",name:n}:(ie=e,e=s),ce[o]={nextPos:ie,result:e},e)}()),ce[r]={nextPos:ie,result:e},e)}function Ce(){var e,r,n,o,a,i,u,l,c=32*ie+15,f=ce[c];if(f)return ie=f.nextPos,f.result;if(e=ie,(r=ve())!==s){for(n=[],o=ie,46===t.charCodeAt(ie)?(a=".",ie++):(a=s,de(D)),a!==s&&(i=ve())!==s?o=a=[a,i]:(ie=o,o=s);o!==s;)n.push(o),o=ie,46===t.charCodeAt(ie)?(a=".",ie++):(a=s,de(D)),a!==s&&(i=ve())!==s?o=a=[a,i]:(ie=o,o=s);n!==s?(u=r,l=n,e=r=[].concat.apply([u],l).join("")):(ie=e,e=s)}else ie=e,e=s;return ce[c]={nextPos:ie,result:e},e}function we(e){return{type:"nth-child",index:{type:"literal",value:e}}}function Pe(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=l())!==s&&ie===t.length)return n;throw n!==s&&ie0&&p(e,t,r))&&f(t[0],t.slice(1),r)};case"descendant":var h=c(t.left),x=c(t.right);return function(e,t,r){if(x(e,t,r))for(var n=0,o=t.length;n":return function(e){return u(e,v)>t.value.value};case">=":return function(e){return u(e,v)>=t.value.value}}throw new Error("Unknown operator: ".concat(t.operator));case"sibling":var E=c(t.left),b=c(t.right);return function(e,r,n){return b(e,r,n)&&y(e,E,r,"LEFT_SIDE",n)||t.left.subject&&E(e,r,n)&&y(e,b,r,"RIGHT_SIDE",n)};case"adjacent":var S=c(t.left),_=c(t.right);return function(e,r,n){return _(e,r,n)&&d(e,S,r,"LEFT_SIDE",n)||t.right.subject&&S(e,r,n)&&d(e,_,r,"RIGHT_SIDE",n)};case"nth-child":var C=t.index.value,w=c(t.right);return function(e,t,r){return w(e,t,r)&&m(e,t,C,r)};case"nth-last-child":var P=-t.index.value,k=c(t.right);return function(e,t,r){return k(e,t,r)&&m(e,t,P,r)};case"class":var D=t.name.toLowerCase();return function(e,r,n){if(n&&n.matchClass)return n.matchClass(t.name,e,r);if(n&&n.nodeTypeKey)return!1;switch(D){case"statement":if("Statement"===e.type.slice(-9))return!0;case"declaration":return"Declaration"===e.type.slice(-11);case"pattern":if("Pattern"===e.type.slice(-7))return!0;case"expression":return"Expression"===e.type.slice(-10)||"Literal"===e.type.slice(-7)||"Identifier"===e.type&&(0===r.length||"MetaProperty"!==r[0].type)||"MetaProperty"===e.type;case"function":return"FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type}throw new Error("Unknown class name: ".concat(t.name))}}throw new Error("Unknown selector type: ".concat(t.type))}function p(e,t){var r=t&&t.nodeTypeKey||"type",n=e[r];return t&&t.visitorKeys&&t.visitorKeys[n]?t.visitorKeys[n]:i.VisitorKeys[n]?i.VisitorKeys[n]:t&&"function"==typeof t.fallback?t.fallback(e):Object.keys(e).filter((function(e){return e!==r}))}function h(t,r){var n=r&&r.nodeTypeKey||"type";return null!==t&&"object"===e(t)&&"string"==typeof t[n]}function y(e,r,n,o,a){var i=t(n,1)[0];if(!i)return!1;for(var s=p(i,a),u=0;u0&&h(l[c-1],a)&&r(l[c-1],n,a))return!0;if("RIGHT_SIDE"===o&&c=0&&l\n Copyright (C) 2012 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/*jslint vars:false, bitwise:true*/\n/*jshint indent:4*/\n/*global exports:true*/\n(function clone(exports) {\n 'use strict';\n\n var Syntax,\n VisitorOption,\n VisitorKeys,\n BREAK,\n SKIP,\n REMOVE;\n\n function deepCopy(obj) {\n var ret = {}, key, val;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n val = obj[key];\n if (typeof val === 'object' && val !== null) {\n ret[key] = deepCopy(val);\n } else {\n ret[key] = val;\n }\n }\n }\n return ret;\n }\n\n // based on LLVM libc++ upper_bound / lower_bound\n // MIT License\n\n function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n AssignmentPattern: 'AssignmentPattern',\n ArrayExpression: 'ArrayExpression',\n ArrayPattern: 'ArrayPattern',\n ArrowFunctionExpression: 'ArrowFunctionExpression',\n AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ChainExpression: 'ChainExpression',\n ClassBody: 'ClassBody',\n ClassDeclaration: 'ClassDeclaration',\n ClassExpression: 'ClassExpression',\n ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7.\n ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7.\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DebuggerStatement: 'DebuggerStatement',\n DirectiveStatement: 'DirectiveStatement',\n DoWhileStatement: 'DoWhileStatement',\n EmptyStatement: 'EmptyStatement',\n ExportAllDeclaration: 'ExportAllDeclaration',\n ExportDefaultDeclaration: 'ExportDefaultDeclaration',\n ExportNamedDeclaration: 'ExportNamedDeclaration',\n ExportSpecifier: 'ExportSpecifier',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n ForOfStatement: 'ForOfStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7.\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n ImportExpression: 'ImportExpression',\n ImportDeclaration: 'ImportDeclaration',\n ImportDefaultSpecifier: 'ImportDefaultSpecifier',\n ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',\n ImportSpecifier: 'ImportSpecifier',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n MetaProperty: 'MetaProperty',\n MethodDefinition: 'MethodDefinition',\n ModuleSpecifier: 'ModuleSpecifier',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n ObjectPattern: 'ObjectPattern',\n PrivateIdentifier: 'PrivateIdentifier',\n Program: 'Program',\n Property: 'Property',\n PropertyDefinition: 'PropertyDefinition',\n RestElement: 'RestElement',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SpreadElement: 'SpreadElement',\n Super: 'Super',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n TaggedTemplateExpression: 'TaggedTemplateExpression',\n TemplateElement: 'TemplateElement',\n TemplateLiteral: 'TemplateLiteral',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement',\n YieldExpression: 'YieldExpression'\n };\n\n VisitorKeys = {\n AssignmentExpression: ['left', 'right'],\n AssignmentPattern: ['left', 'right'],\n ArrayExpression: ['elements'],\n ArrayPattern: ['elements'],\n ArrowFunctionExpression: ['params', 'body'],\n AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.\n BlockStatement: ['body'],\n BinaryExpression: ['left', 'right'],\n BreakStatement: ['label'],\n CallExpression: ['callee', 'arguments'],\n CatchClause: ['param', 'body'],\n ChainExpression: ['expression'],\n ClassBody: ['body'],\n ClassDeclaration: ['id', 'superClass', 'body'],\n ClassExpression: ['id', 'superClass', 'body'],\n ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7.\n ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.\n ConditionalExpression: ['test', 'consequent', 'alternate'],\n ContinueStatement: ['label'],\n DebuggerStatement: [],\n DirectiveStatement: [],\n DoWhileStatement: ['body', 'test'],\n EmptyStatement: [],\n ExportAllDeclaration: ['source'],\n ExportDefaultDeclaration: ['declaration'],\n ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],\n ExportSpecifier: ['exported', 'local'],\n ExpressionStatement: ['expression'],\n ForStatement: ['init', 'test', 'update', 'body'],\n ForInStatement: ['left', 'right', 'body'],\n ForOfStatement: ['left', 'right', 'body'],\n FunctionDeclaration: ['id', 'params', 'body'],\n FunctionExpression: ['id', 'params', 'body'],\n GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.\n Identifier: [],\n IfStatement: ['test', 'consequent', 'alternate'],\n ImportExpression: ['source'],\n ImportDeclaration: ['specifiers', 'source'],\n ImportDefaultSpecifier: ['local'],\n ImportNamespaceSpecifier: ['local'],\n ImportSpecifier: ['imported', 'local'],\n Literal: [],\n LabeledStatement: ['label', 'body'],\n LogicalExpression: ['left', 'right'],\n MemberExpression: ['object', 'property'],\n MetaProperty: ['meta', 'property'],\n MethodDefinition: ['key', 'value'],\n ModuleSpecifier: [],\n NewExpression: ['callee', 'arguments'],\n ObjectExpression: ['properties'],\n ObjectPattern: ['properties'],\n PrivateIdentifier: [],\n Program: ['body'],\n Property: ['key', 'value'],\n PropertyDefinition: ['key', 'value'],\n RestElement: [ 'argument' ],\n ReturnStatement: ['argument'],\n SequenceExpression: ['expressions'],\n SpreadElement: ['argument'],\n Super: [],\n SwitchStatement: ['discriminant', 'cases'],\n SwitchCase: ['test', 'consequent'],\n TaggedTemplateExpression: ['tag', 'quasi'],\n TemplateElement: [],\n TemplateLiteral: ['quasis', 'expressions'],\n ThisExpression: [],\n ThrowStatement: ['argument'],\n TryStatement: ['block', 'handler', 'finalizer'],\n UnaryExpression: ['argument'],\n UpdateExpression: ['argument'],\n VariableDeclaration: ['declarations'],\n VariableDeclarator: ['id', 'init'],\n WhileStatement: ['test', 'body'],\n WithStatement: ['object', 'body'],\n YieldExpression: ['argument']\n };\n\n // unique id\n BREAK = {};\n SKIP = {};\n REMOVE = {};\n\n VisitorOption = {\n Break: BREAK,\n Skip: SKIP,\n Remove: REMOVE\n };\n\n function Reference(parent, key) {\n this.parent = parent;\n this.key = key;\n }\n\n Reference.prototype.replace = function replace(node) {\n this.parent[this.key] = node;\n };\n\n Reference.prototype.remove = function remove() {\n if (Array.isArray(this.parent)) {\n this.parent.splice(this.key, 1);\n return true;\n } else {\n this.replace(null);\n return false;\n }\n };\n\n function Element(node, path, wrap, ref) {\n this.node = node;\n this.path = path;\n this.wrap = wrap;\n this.ref = ref;\n }\n\n function Controller() { }\n\n // API:\n // return property path array from root to current node\n Controller.prototype.path = function path() {\n var i, iz, j, jz, result, element;\n\n function addToPath(result, path) {\n if (Array.isArray(path)) {\n for (j = 0, jz = path.length; j < jz; ++j) {\n result.push(path[j]);\n }\n } else {\n result.push(path);\n }\n }\n\n // root node\n if (!this.__current.path) {\n return null;\n }\n\n // first node is sentinel, second node is root element\n result = [];\n for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {\n element = this.__leavelist[i];\n addToPath(result, element.path);\n }\n addToPath(result, this.__current.path);\n return result;\n };\n\n // API:\n // return type of current node\n Controller.prototype.type = function () {\n var node = this.current();\n return node.type || this.__current.wrap;\n };\n\n // API:\n // return array of parent elements\n Controller.prototype.parents = function parents() {\n var i, iz, result;\n\n // first node is sentinel\n result = [];\n for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {\n result.push(this.__leavelist[i].node);\n }\n\n return result;\n };\n\n // API:\n // return current node\n Controller.prototype.current = function current() {\n return this.__current.node;\n };\n\n Controller.prototype.__execute = function __execute(callback, element) {\n var previous, result;\n\n result = undefined;\n\n previous = this.__current;\n this.__current = element;\n this.__state = null;\n if (callback) {\n result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);\n }\n this.__current = previous;\n\n return result;\n };\n\n // API:\n // notify control skip / break\n Controller.prototype.notify = function notify(flag) {\n this.__state = flag;\n };\n\n // API:\n // skip child nodes of current node\n Controller.prototype.skip = function () {\n this.notify(SKIP);\n };\n\n // API:\n // break traversals\n Controller.prototype['break'] = function () {\n this.notify(BREAK);\n };\n\n // API:\n // remove node\n Controller.prototype.remove = function () {\n this.notify(REMOVE);\n };\n\n Controller.prototype.__initialize = function(root, visitor) {\n this.visitor = visitor;\n this.root = root;\n this.__worklist = [];\n this.__leavelist = [];\n this.__current = null;\n this.__state = null;\n this.__fallback = null;\n if (visitor.fallback === 'iteration') {\n this.__fallback = Object.keys;\n } else if (typeof visitor.fallback === 'function') {\n this.__fallback = visitor.fallback;\n }\n\n this.__keys = VisitorKeys;\n if (visitor.keys) {\n this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);\n }\n };\n\n function isNode(node) {\n if (node == null) {\n return false;\n }\n return typeof node === 'object' && typeof node.type === 'string';\n }\n\n function isProperty(nodeType, key) {\n return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;\n }\n \n function candidateExistsInLeaveList(leavelist, candidate) {\n for (var i = leavelist.length - 1; i >= 0; --i) {\n if (leavelist[i].node === candidate) {\n return true;\n }\n }\n return false;\n }\n\n Controller.prototype.traverse = function traverse(root, visitor) {\n var worklist,\n leavelist,\n element,\n node,\n nodeType,\n ret,\n key,\n current,\n current2,\n candidates,\n candidate,\n sentinel;\n\n this.__initialize(root, visitor);\n\n sentinel = {};\n\n // reference\n worklist = this.__worklist;\n leavelist = this.__leavelist;\n\n // initialize\n worklist.push(new Element(root, null, null, null));\n leavelist.push(new Element(null, null, null, null));\n\n while (worklist.length) {\n element = worklist.pop();\n\n if (element === sentinel) {\n element = leavelist.pop();\n\n ret = this.__execute(visitor.leave, element);\n\n if (this.__state === BREAK || ret === BREAK) {\n return;\n }\n continue;\n }\n\n if (element.node) {\n\n ret = this.__execute(visitor.enter, element);\n\n if (this.__state === BREAK || ret === BREAK) {\n return;\n }\n\n worklist.push(sentinel);\n leavelist.push(element);\n\n if (this.__state === SKIP || ret === SKIP) {\n continue;\n }\n\n node = element.node;\n nodeType = node.type || element.wrap;\n candidates = this.__keys[nodeType];\n if (!candidates) {\n if (this.__fallback) {\n candidates = this.__fallback(node);\n } else {\n throw new Error('Unknown node type ' + nodeType + '.');\n }\n }\n\n current = candidates.length;\n while ((current -= 1) >= 0) {\n key = candidates[current];\n candidate = node[key];\n if (!candidate) {\n continue;\n }\n\n if (Array.isArray(candidate)) {\n current2 = candidate.length;\n while ((current2 -= 1) >= 0) {\n if (!candidate[current2]) {\n continue;\n }\n\n if (candidateExistsInLeaveList(leavelist, candidate[current2])) {\n continue;\n }\n\n if (isProperty(nodeType, candidates[current])) {\n element = new Element(candidate[current2], [key, current2], 'Property', null);\n } else if (isNode(candidate[current2])) {\n element = new Element(candidate[current2], [key, current2], null, null);\n } else {\n continue;\n }\n worklist.push(element);\n }\n } else if (isNode(candidate)) {\n if (candidateExistsInLeaveList(leavelist, candidate)) {\n continue;\n }\n\n worklist.push(new Element(candidate, key, null, null));\n }\n }\n }\n }\n };\n\n Controller.prototype.replace = function replace(root, visitor) {\n var worklist,\n leavelist,\n node,\n nodeType,\n target,\n element,\n current,\n current2,\n candidates,\n candidate,\n sentinel,\n outer,\n key;\n\n function removeElem(element) {\n var i,\n key,\n nextElem,\n parent;\n\n if (element.ref.remove()) {\n // When the reference is an element of an array.\n key = element.ref.key;\n parent = element.ref.parent;\n\n // If removed from array, then decrease following items' keys.\n i = worklist.length;\n while (i--) {\n nextElem = worklist[i];\n if (nextElem.ref && nextElem.ref.parent === parent) {\n if (nextElem.ref.key < key) {\n break;\n }\n --nextElem.ref.key;\n }\n }\n }\n }\n\n this.__initialize(root, visitor);\n\n sentinel = {};\n\n // reference\n worklist = this.__worklist;\n leavelist = this.__leavelist;\n\n // initialize\n outer = {\n root: root\n };\n element = new Element(root, null, null, new Reference(outer, 'root'));\n worklist.push(element);\n leavelist.push(element);\n\n while (worklist.length) {\n element = worklist.pop();\n\n if (element === sentinel) {\n element = leavelist.pop();\n\n target = this.__execute(visitor.leave, element);\n\n // node may be replaced with null,\n // so distinguish between undefined and null in this place\n if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {\n // replace\n element.ref.replace(target);\n }\n\n if (this.__state === REMOVE || target === REMOVE) {\n removeElem(element);\n }\n\n if (this.__state === BREAK || target === BREAK) {\n return outer.root;\n }\n continue;\n }\n\n target = this.__execute(visitor.enter, element);\n\n // node may be replaced with null,\n // so distinguish between undefined and null in this place\n if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {\n // replace\n element.ref.replace(target);\n element.node = target;\n }\n\n if (this.__state === REMOVE || target === REMOVE) {\n removeElem(element);\n element.node = null;\n }\n\n if (this.__state === BREAK || target === BREAK) {\n return outer.root;\n }\n\n // node may be null\n node = element.node;\n if (!node) {\n continue;\n }\n\n worklist.push(sentinel);\n leavelist.push(element);\n\n if (this.__state === SKIP || target === SKIP) {\n continue;\n }\n\n nodeType = node.type || element.wrap;\n candidates = this.__keys[nodeType];\n if (!candidates) {\n if (this.__fallback) {\n candidates = this.__fallback(node);\n } else {\n throw new Error('Unknown node type ' + nodeType + '.');\n }\n }\n\n current = candidates.length;\n while ((current -= 1) >= 0) {\n key = candidates[current];\n candidate = node[key];\n if (!candidate) {\n continue;\n }\n\n if (Array.isArray(candidate)) {\n current2 = candidate.length;\n while ((current2 -= 1) >= 0) {\n if (!candidate[current2]) {\n continue;\n }\n if (isProperty(nodeType, candidates[current])) {\n element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));\n } else if (isNode(candidate[current2])) {\n element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));\n } else {\n continue;\n }\n worklist.push(element);\n }\n } else if (isNode(candidate)) {\n worklist.push(new Element(candidate, key, null, new Reference(node, key)));\n }\n }\n }\n\n return outer.root;\n };\n\n function traverse(root, visitor) {\n var controller = new Controller();\n return controller.traverse(root, visitor);\n }\n\n function replace(root, visitor) {\n var controller = new Controller();\n return controller.replace(root, visitor);\n }\n\n function extendCommentRange(comment, tokens) {\n var target;\n\n target = upperBound(tokens, function search(token) {\n return token.range[0] > comment.range[0];\n });\n\n comment.extendedRange = [comment.range[0], comment.range[1]];\n\n if (target !== tokens.length) {\n comment.extendedRange[1] = tokens[target].range[0];\n }\n\n target -= 1;\n if (target >= 0) {\n comment.extendedRange[0] = tokens[target].range[1];\n }\n\n return comment;\n }\n\n function attachComments(tree, providedComments, tokens) {\n // At first, we should calculate extended comment ranges.\n var comments = [], comment, len, i, cursor;\n\n if (!tree.range) {\n throw new Error('attachComments needs range information');\n }\n\n // tokens array is empty, we attach comments to tree as 'leadingComments'\n if (!tokens.length) {\n if (providedComments.length) {\n for (i = 0, len = providedComments.length; i < len; i += 1) {\n comment = deepCopy(providedComments[i]);\n comment.extendedRange = [0, tree.range[0]];\n comments.push(comment);\n }\n tree.leadingComments = comments;\n }\n return tree;\n }\n\n for (i = 0, len = providedComments.length; i < len; i += 1) {\n comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));\n }\n\n // This is based on John Freeman's implementation.\n cursor = 0;\n traverse(tree, {\n enter: function (node) {\n var comment;\n\n while (cursor < comments.length) {\n comment = comments[cursor];\n if (comment.extendedRange[1] > node.range[0]) {\n break;\n }\n\n if (comment.extendedRange[1] === node.range[0]) {\n if (!node.leadingComments) {\n node.leadingComments = [];\n }\n node.leadingComments.push(comment);\n comments.splice(cursor, 1);\n } else {\n cursor += 1;\n }\n }\n\n // already out of owned node\n if (cursor === comments.length) {\n return VisitorOption.Break;\n }\n\n if (comments[cursor].extendedRange[0] > node.range[1]) {\n return VisitorOption.Skip;\n }\n }\n });\n\n cursor = 0;\n traverse(tree, {\n leave: function (node) {\n var comment;\n\n while (cursor < comments.length) {\n comment = comments[cursor];\n if (node.range[1] < comment.extendedRange[0]) {\n break;\n }\n\n if (node.range[1] === comment.extendedRange[0]) {\n if (!node.trailingComments) {\n node.trailingComments = [];\n }\n node.trailingComments.push(comment);\n comments.splice(cursor, 1);\n } else {\n cursor += 1;\n }\n }\n\n // already out of owned node\n if (cursor === comments.length) {\n return VisitorOption.Break;\n }\n\n if (comments[cursor].extendedRange[0] > node.range[1]) {\n return VisitorOption.Skip;\n }\n }\n });\n\n return tree;\n }\n\n exports.Syntax = Syntax;\n exports.traverse = traverse;\n exports.replace = replace;\n exports.attachComments = attachComments;\n exports.VisitorKeys = VisitorKeys;\n exports.VisitorOption = VisitorOption;\n exports.Controller = Controller;\n exports.cloneEnvironment = function () { return clone({}); };\n\n return exports;\n}(exports));\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function(root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n }\n})(this, function() {\n \"use strict\";\n\n function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }\n\n function peg$SyntaxError(message, expected, found, location) {\n this.message = message;\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(this, peg$SyntaxError);\n }\n }\n\n peg$subclass(peg$SyntaxError, Error);\n\n peg$SyntaxError.buildMessage = function(expected, found) {\n var DESCRIBE_EXPECTATION_FNS = {\n literal: function(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n \"class\": function(expectation) {\n var escapedParts = \"\",\n i;\n\n for (i = 0; i < expectation.parts.length; i++) {\n escapedParts += expectation.parts[i] instanceof Array\n ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n : classEscape(expectation.parts[i]);\n }\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n },\n\n any: function(expectation) {\n return \"any character\";\n },\n\n end: function(expectation) {\n return \"end of input\";\n },\n\n other: function(expectation) {\n return expectation.description;\n }\n };\n\n function hex(ch) {\n return ch.charCodeAt(0).toString(16).toUpperCase();\n }\n\n function literalEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function classEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\]/g, '\\\\]')\n .replace(/\\^/g, '\\\\^')\n .replace(/-/g, '\\\\-')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n var descriptions = new Array(expected.length),\n i, j;\n\n for (i = 0; i < expected.length; i++) {\n descriptions[i] = describeExpectation(expected[i]);\n }\n\n descriptions.sort();\n\n if (descriptions.length > 0) {\n for (i = 1, j = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n };\n\n function peg$parse(input, options) {\n options = options !== void 0 ? options : {};\n\n var peg$FAILED = {},\n\n peg$startRuleFunctions = { start: peg$parsestart },\n peg$startRuleFunction = peg$parsestart,\n\n peg$c0 = function(ss) {\n return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };\n },\n peg$c1 = function() { return void 0; },\n peg$c2 = \" \",\n peg$c3 = peg$literalExpectation(\" \", false),\n peg$c4 = /^[^ [\\],():#!=><~+.]/,\n peg$c5 = peg$classExpectation([\" \", \"[\", \"]\", \",\", \"(\", \")\", \":\", \"#\", \"!\", \"=\", \">\", \"<\", \"~\", \"+\", \".\"], true, false),\n peg$c6 = function(i) { return i.join(''); },\n peg$c7 = \">\",\n peg$c8 = peg$literalExpectation(\">\", false),\n peg$c9 = function() { return 'child'; },\n peg$c10 = \"~\",\n peg$c11 = peg$literalExpectation(\"~\", false),\n peg$c12 = function() { return 'sibling'; },\n peg$c13 = \"+\",\n peg$c14 = peg$literalExpectation(\"+\", false),\n peg$c15 = function() { return 'adjacent'; },\n peg$c16 = function() { return 'descendant'; },\n peg$c17 = \",\",\n peg$c18 = peg$literalExpectation(\",\", false),\n peg$c19 = function(s, ss) {\n return [s].concat(ss.map(function (s) { return s[3]; }));\n },\n peg$c20 = function(op, s) {\n if (!op) return s;\n return { type: op, left: { type: 'exactNode' }, right: s };\n },\n peg$c21 = function(a, ops) {\n return ops.reduce(function (memo, rhs) {\n return { type: rhs[0], left: memo, right: rhs[1] };\n }, a);\n },\n peg$c22 = \"!\",\n peg$c23 = peg$literalExpectation(\"!\", false),\n peg$c24 = function(subject, as) {\n const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };\n if(subject) b.subject = true;\n return b;\n },\n peg$c25 = \"*\",\n peg$c26 = peg$literalExpectation(\"*\", false),\n peg$c27 = function(a) { return { type: 'wildcard', value: a }; },\n peg$c28 = \"#\",\n peg$c29 = peg$literalExpectation(\"#\", false),\n peg$c30 = function(i) { return { type: 'identifier', value: i }; },\n peg$c31 = \"[\",\n peg$c32 = peg$literalExpectation(\"[\", false),\n peg$c33 = \"]\",\n peg$c34 = peg$literalExpectation(\"]\", false),\n peg$c35 = function(v) { return v; },\n peg$c36 = /^[>\", \"<\", \"!\"], false, false),\n peg$c38 = \"=\",\n peg$c39 = peg$literalExpectation(\"=\", false),\n peg$c40 = function(a) { return (a || '') + '='; },\n peg$c41 = /^[><]/,\n peg$c42 = peg$classExpectation([\">\", \"<\"], false, false),\n peg$c43 = \".\",\n peg$c44 = peg$literalExpectation(\".\", false),\n peg$c45 = function(a, as) {\n return [].concat.apply([a], as).join('');\n },\n peg$c46 = function(name, op, value) {\n return { type: 'attribute', name: name, operator: op, value: value };\n },\n peg$c47 = function(name) { return { type: 'attribute', name: name }; },\n peg$c48 = \"\\\"\",\n peg$c49 = peg$literalExpectation(\"\\\"\", false),\n peg$c50 = /^[^\\\\\"]/,\n peg$c51 = peg$classExpectation([\"\\\\\", \"\\\"\"], true, false),\n peg$c52 = \"\\\\\",\n peg$c53 = peg$literalExpectation(\"\\\\\", false),\n peg$c54 = peg$anyExpectation(),\n peg$c55 = function(a, b) { return a + b; },\n peg$c56 = function(d) {\n return { type: 'literal', value: strUnescape(d.join('')) };\n },\n peg$c57 = \"'\",\n peg$c58 = peg$literalExpectation(\"'\", false),\n peg$c59 = /^[^\\\\']/,\n peg$c60 = peg$classExpectation([\"\\\\\", \"'\"], true, false),\n peg$c61 = /^[0-9]/,\n peg$c62 = peg$classExpectation([[\"0\", \"9\"]], false, false),\n peg$c63 = function(a, b) {\n // Can use `a.flat().join('')` once supported\n const leadingDecimals = a ? [].concat.apply([], a).join('') : '';\n return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };\n },\n peg$c64 = function(i) { return { type: 'literal', value: i }; },\n peg$c65 = \"type(\",\n peg$c66 = peg$literalExpectation(\"type(\", false),\n peg$c67 = /^[^ )]/,\n peg$c68 = peg$classExpectation([\" \", \")\"], true, false),\n peg$c69 = \")\",\n peg$c70 = peg$literalExpectation(\")\", false),\n peg$c71 = function(t) { return { type: 'type', value: t.join('') }; },\n peg$c72 = /^[imsu]/,\n peg$c73 = peg$classExpectation([\"i\", \"m\", \"s\", \"u\"], false, false),\n peg$c74 = \"/\",\n peg$c75 = peg$literalExpectation(\"/\", false),\n peg$c76 = /^[^\\/]/,\n peg$c77 = peg$classExpectation([\"/\"], true, false),\n peg$c78 = function(d, flgs) { return {\n type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') };\n },\n peg$c79 = function(i, is) {\n return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};\n },\n peg$c80 = \":not(\",\n peg$c81 = peg$literalExpectation(\":not(\", false),\n peg$c82 = function(ss) { return { type: 'not', selectors: ss }; },\n peg$c83 = \":matches(\",\n peg$c84 = peg$literalExpectation(\":matches(\", false),\n peg$c85 = function(ss) { return { type: 'matches', selectors: ss }; },\n peg$c86 = \":has(\",\n peg$c87 = peg$literalExpectation(\":has(\", false),\n peg$c88 = function(ss) { return { type: 'has', selectors: ss }; },\n peg$c89 = \":first-child\",\n peg$c90 = peg$literalExpectation(\":first-child\", false),\n peg$c91 = function() { return nth(1); },\n peg$c92 = \":last-child\",\n peg$c93 = peg$literalExpectation(\":last-child\", false),\n peg$c94 = function() { return nthLast(1); },\n peg$c95 = \":nth-child(\",\n peg$c96 = peg$literalExpectation(\":nth-child(\", false),\n peg$c97 = function(n) { return nth(parseInt(n.join(''), 10)); },\n peg$c98 = \":nth-last-child(\",\n peg$c99 = peg$literalExpectation(\":nth-last-child(\", false),\n peg$c100 = function(n) { return nthLast(parseInt(n.join(''), 10)); },\n peg$c101 = \":\",\n peg$c102 = peg$literalExpectation(\":\", false),\n peg$c103 = function(c) {\n return { type: 'class', name: c };\n },\n\n peg$currPos = 0,\n peg$savedPos = 0,\n peg$posDetailsCache = [{ line: 1, column: 1 }],\n peg$maxFailPos = 0,\n peg$maxFailExpected = [],\n peg$silentFails = 0,\n\n peg$resultsCache = {},\n\n peg$result;\n\n if (\"startRule\" in options) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase) {\n return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description: description };\n }\n\n function peg$computePosDetails(pos) {\n var details = peg$posDetailsCache[pos], p;\n\n if (details) {\n return details;\n } else {\n p = pos - 1;\n while (!peg$posDetailsCache[p]) {\n p--;\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos) {\n var startPosDetails = peg$computePosDetails(startPos),\n endPosDetails = peg$computePosDetails(endPos);\n\n return {\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parsestart() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 0,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseselectors();\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c1();\n }\n s0 = s1;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parse_() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 1,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseidentifierName() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 2,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c4.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c5); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c4.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c5); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c6(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsebinaryOp() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 3,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 62) {\n s2 = peg$c7;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c8); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c9();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 126) {\n s2 = peg$c10;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c12();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 43) {\n s2 = peg$c13;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c14); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parse_();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c15();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c3); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c16();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehasSelectors() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n var key = peg$currPos * 32 + 4,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsehasSelector();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parsehasSelector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parsehasSelector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c19(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseselectors() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n var key = peg$currPos * 32 + 5,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseselector();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseselector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c17;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseselector();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c19(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehasSelector() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 6,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsebinaryOp();\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseselector();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c20(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseselector() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 7,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parsesequence();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parsebinaryOp();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsesequence();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parsebinaryOp();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsesequence();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c21(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsesequence() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 8,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 33) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseatom();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseatom();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c24(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseatom() {\n var s0;\n\n var key = peg$currPos * 32 + 9,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$parsewildcard();\n if (s0 === peg$FAILED) {\n s0 = peg$parseidentifier();\n if (s0 === peg$FAILED) {\n s0 = peg$parseattr();\n if (s0 === peg$FAILED) {\n s0 = peg$parsefield();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenegation();\n if (s0 === peg$FAILED) {\n s0 = peg$parsematches();\n if (s0 === peg$FAILED) {\n s0 = peg$parsehas();\n if (s0 === peg$FAILED) {\n s0 = peg$parsefirstChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parselastChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenthChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenthLastChild();\n if (s0 === peg$FAILED) {\n s0 = peg$parseclass();\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsewildcard() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 10,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 42) {\n s1 = peg$c25;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c26); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c27(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseidentifier() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 11,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c28;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c29); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c30(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattr() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 12,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c31;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c32); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrValue();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s5 = peg$c33;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c34); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c35(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrOps() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 13,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (peg$c36.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c37); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 61) {\n s2 = peg$c38;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c39); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c40(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n if (peg$c41.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c42); }\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrEqOps() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 14,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 33) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 61) {\n s2 = peg$c38;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c39); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c40(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrName() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 15,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseidentifierName();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c43;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseidentifierName();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c43;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseidentifierName();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c45(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseattrValue() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 16,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrEqOps();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsetype();\n if (s5 === peg$FAILED) {\n s5 = peg$parseregex();\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c46(s1, s3, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseattrOps();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsestring();\n if (s5 === peg$FAILED) {\n s5 = peg$parsenumber();\n if (s5 === peg$FAILED) {\n s5 = peg$parsepath();\n }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c46(s1, s3, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseattrName();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c47(s1);\n }\n s0 = s1;\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsestring() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 17,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c48;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c49); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c50.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c51); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c50.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c51); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c48;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c49); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c56(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c57;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c58); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c59.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c60); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c59.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c60); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s4 = peg$c52;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c53); }\n }\n if (s4 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c54); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c55(s4, s5);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c57;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c58); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c56(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenumber() {\n var s0, s1, s2, s3;\n\n var key = peg$currPos * 32 + 18,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s3 = peg$c43;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c63(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsepath() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 19,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n s1 = peg$parseidentifierName();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c64(s1);\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsetype() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 20,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c65) {\n s1 = peg$c65;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c66); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c67.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c68); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c67.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c68); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c71(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseflags() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 21,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = [];\n if (peg$c72.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c73); }\n }\n if (s1 !== peg$FAILED) {\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (peg$c72.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c73); }\n }\n }\n } else {\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseregex() {\n var s0, s1, s2, s3, s4;\n\n var key = peg$currPos * 32 + 22,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 47) {\n s1 = peg$c74;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c75); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c76.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c77); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c76.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c77); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 47) {\n s3 = peg$c74;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c75); }\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parseflags();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c78(s2, s4);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsefield() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n var key = peg$currPos * 32 + 23,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s1 = peg$c43;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c43;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseidentifierName();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c43;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c44); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseidentifierName();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c79(s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenegation() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 24,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c80) {\n s1 = peg$c80;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c81); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseselectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c82(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsematches() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 25,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 9) === peg$c83) {\n s1 = peg$c83;\n peg$currPos += 9;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c84); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseselectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c85(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsehas() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 26,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c86) {\n s1 = peg$c86;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c87); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parsehasSelectors();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c88(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsefirstChild() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 27,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 12) === peg$c89) {\n s1 = peg$c89;\n peg$currPos += 12;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c91();\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parselastChild() {\n var s0, s1;\n\n var key = peg$currPos * 32 + 28,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 11) === peg$c92) {\n s1 = peg$c92;\n peg$currPos += 11;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c93); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c94();\n }\n s0 = s1;\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenthChild() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 29,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 11) === peg$c95) {\n s1 = peg$c95;\n peg$currPos += 11;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c96); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c97(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parsenthLastChild() {\n var s0, s1, s2, s3, s4, s5;\n\n var key = peg$currPos * 32 + 30,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 16) === peg$c98) {\n s1 = peg$c98;\n peg$currPos += 16;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c99); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c61.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c69;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c70); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c100(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n function peg$parseclass() {\n var s0, s1, s2;\n\n var key = peg$currPos * 32 + 31,\n cached = peg$resultsCache[key];\n\n if (cached) {\n peg$currPos = cached.nextPos;\n\n return cached.result;\n }\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 58) {\n s1 = peg$c101;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c102); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseidentifierName();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c103(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n return s0;\n }\n\n\n function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }\n function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }\n function strUnescape(s) {\n return s.replace(/\\\\(.)/g, function(match, ch) {\n switch(ch) {\n case 'b': return '\\b';\n case 'f': return '\\f';\n case 'n': return '\\n';\n case 'r': return '\\r';\n case 't': return '\\t';\n case 'v': return '\\v';\n default: return ch;\n }\n });\n }\n\n\n peg$result = peg$startRuleFunction();\n\n if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n return peg$result;\n } else {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n }\n\n return {\n SyntaxError: peg$SyntaxError,\n parse: peg$parse\n };\n});\n","/* vim: set sw=4 sts=4 : */\nimport estraverse from 'estraverse';\nimport parser from './parser.js';\n\n/**\n* @typedef {\"LEFT_SIDE\"|\"RIGHT_SIDE\"} Side\n*/\n\nconst LEFT_SIDE = 'LEFT_SIDE';\nconst RIGHT_SIDE = 'RIGHT_SIDE';\n\n/**\n * @external AST\n * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html\n */\n\n/**\n * One of the rules of `grammar.pegjs`\n * @typedef {PlainObject} SelectorAST\n * @see grammar.pegjs\n*/\n\n/**\n * The `sequence` production of `grammar.pegjs`\n * @typedef {PlainObject} SelectorSequenceAST\n*/\n\n/**\n * Get the value of a property which may be multiple levels down\n * in the object.\n * @param {?PlainObject} obj\n * @param {string[]} keys\n * @returns {undefined|boolean|string|number|external:AST}\n */\nfunction getPath(obj, keys) {\n for (let i = 0; i < keys.length; ++i) {\n if (obj == null) { return obj; }\n obj = obj[keys[i]];\n }\n return obj;\n}\n\n/**\n * Determine whether `node` can be reached by following `path`,\n * starting at `ancestor`.\n * @param {?external:AST} node\n * @param {?external:AST} ancestor\n * @param {string[]} path\n * @param {Integer} fromPathIndex\n * @returns {boolean}\n */\nfunction inPath(node, ancestor, path, fromPathIndex) {\n let current = ancestor;\n for (let i = fromPathIndex; i < path.length; ++i) {\n if (current == null) {\n return false;\n }\n const field = current[path[i]];\n if (Array.isArray(field)) {\n for (let k = 0; k < field.length; ++k) {\n if (inPath(node, field[k], path, i + 1)) {\n return true;\n }\n }\n return false;\n }\n current = field;\n }\n return node === current;\n}\n\n/**\n * A generated matcher function for a selector.\n * @callback SelectorMatcher\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @returns {void}\n*/\n\n/**\n * A WeakMap for holding cached matcher functions for selectors.\n * @type {WeakMap}\n*/\nconst MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap : null;\n\n/**\n * Look up a matcher function for `selector` in the cache.\n * If it does not exist, generate it with `generateMatcher` and add it to the cache.\n * In engines without WeakMap, the caching is skipped and matchers are generated with every call.\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction getMatcher(selector) {\n if (selector == null) {\n return () => true;\n }\n\n if (MATCHER_CACHE != null) {\n let matcher = MATCHER_CACHE.get(selector);\n if (matcher != null) {\n return matcher;\n }\n matcher = generateMatcher(selector);\n MATCHER_CACHE.set(selector, matcher);\n return matcher;\n }\n\n return generateMatcher(selector);\n}\n\n/**\n * Create a matcher function for `selector`,\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction generateMatcher(selector) {\n switch(selector.type) {\n case 'wildcard':\n return () => true;\n\n case 'identifier': {\n const value = selector.value.toLowerCase();\n return (node, ancestry, options) => {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n return value === node[nodeTypeKey].toLowerCase();\n };\n }\n\n case 'exactNode':\n return (node, ancestry) => {\n return ancestry.length === 0;\n };\n\n case 'field': {\n const path = selector.name.split('.');\n return (node, ancestry) => {\n const ancestor = ancestry[path.length - 1];\n return inPath(node, ancestor, path, 0);\n };\n }\n\n case 'matches': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, ancestry, options)) { return true; }\n }\n return false;\n };\n }\n\n case 'compound': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (!matchers[i](node, ancestry, options)) { return false; }\n }\n return true;\n };\n }\n\n case 'not': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, ancestry, options)) { return false; }\n }\n return true;\n };\n }\n\n case 'has': {\n const matchers = selector.selectors.map(getMatcher);\n return (node, ancestry, options) => {\n let result = false;\n\n const a = [];\n estraverse.traverse(node, {\n enter (node, parent) {\n if (parent != null) { a.unshift(parent); }\n\n for (let i = 0; i < matchers.length; ++i) {\n if (matchers[i](node, a, options)) {\n result = true;\n this.break();\n return;\n }\n }\n },\n leave () { a.shift(); },\n keys: options && options.visitorKeys,\n fallback: options && options.fallback || 'iteration'\n });\n\n return result;\n };\n }\n\n case 'child': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) => {\n if (ancestry.length > 0 && right(node, ancestry, options)) {\n return left(ancestry[0], ancestry.slice(1), options);\n }\n return false;\n };\n }\n\n case 'descendant': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) => {\n if (right(node, ancestry, options)) {\n for (let i = 0, l = ancestry.length; i < l; ++i) {\n if (left(ancestry[i], ancestry.slice(i + 1), options)) {\n return true;\n }\n }\n }\n return false;\n };\n }\n\n case 'attribute': {\n const path = selector.name.split('.');\n switch (selector.operator) {\n case void 0:\n return (node) => getPath(node, path) != null;\n case '=':\n switch (selector.value.type) {\n case 'regexp':\n return (node) => {\n const p = getPath(node, path);\n return typeof p === 'string' && selector.value.value.test(p);\n };\n case 'literal': {\n const literal = `${selector.value.value}`;\n return (node) => literal === `${getPath(node, path)}`;\n }\n case 'type':\n return (node) => selector.value.value === typeof getPath(node, path);\n }\n throw new Error(`Unknown selector value type: ${selector.value.type}`);\n case '!=':\n switch (selector.value.type) {\n case 'regexp':\n return (node) => !selector.value.value.test(getPath(node, path));\n case 'literal': {\n const literal = `${selector.value.value}`;\n return (node) => literal !== `${getPath(node, path)}`;\n }\n case 'type':\n return (node) => selector.value.value !== typeof getPath(node, path);\n }\n throw new Error(`Unknown selector value type: ${selector.value.type}`);\n case '<=':\n return (node) => getPath(node, path) <= selector.value.value;\n case '<':\n return (node) => getPath(node, path) < selector.value.value;\n case '>':\n return (node) => getPath(node, path) > selector.value.value;\n case '>=':\n return (node) => getPath(node, path) >= selector.value.value;\n }\n throw new Error(`Unknown operator: ${selector.operator}`);\n }\n\n case 'sibling': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n sibling(node, left, ancestry, LEFT_SIDE, options) ||\n selector.left.subject &&\n left(node, ancestry, options) &&\n sibling(node, right, ancestry, RIGHT_SIDE, options);\n }\n\n case 'adjacent': {\n const left = getMatcher(selector.left);\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n adjacent(node, left, ancestry, LEFT_SIDE, options) ||\n selector.right.subject &&\n left(node, ancestry, options) &&\n adjacent(node, right, ancestry, RIGHT_SIDE, options);\n }\n\n case 'nth-child': {\n const nth = selector.index.value;\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n nthChild(node, ancestry, nth, options);\n }\n\n case 'nth-last-child': {\n const nth = -selector.index.value;\n const right = getMatcher(selector.right);\n return (node, ancestry, options) =>\n right(node, ancestry, options) &&\n nthChild(node, ancestry, nth, options);\n }\n\n case 'class': {\n \n const name = selector.name.toLowerCase();\n\n return (node, ancestry, options) => {\n \n if (options && options.matchClass) {\n return options.matchClass(selector.name, node, ancestry);\n }\n \n if (options && options.nodeTypeKey) return false; \n\n switch(name){\n case 'statement':\n if(node.type.slice(-9) === 'Statement') return true;\n // fallthrough: interface Declaration <: Statement { }\n case 'declaration':\n return node.type.slice(-11) === 'Declaration';\n case 'pattern':\n if(node.type.slice(-7) === 'Pattern') return true;\n // fallthrough: interface Expression <: Node, Pattern { }\n case 'expression':\n return node.type.slice(-10) === 'Expression' ||\n node.type.slice(-7) === 'Literal' ||\n (\n node.type === 'Identifier' &&\n (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')\n ) ||\n node.type === 'MetaProperty';\n case 'function':\n return node.type === 'FunctionDeclaration' ||\n node.type === 'FunctionExpression' ||\n node.type === 'ArrowFunctionExpression';\n }\n throw new Error(`Unknown class name: ${selector.name}`);\n };\n }\n }\n\n throw new Error(`Unknown selector type: ${selector.type}`);\n}\n\n/**\n * @callback TraverseOptionFallback\n * @param {external:AST} node The given node.\n * @returns {string[]} An array of visitor keys for the given node.\n */\n\n/**\n * @callback ClassMatcher\n * @param {string} className The name of the class to match.\n * @param {external:AST} node The node to match against.\n * @param {Array} ancestry The ancestry of the node.\n * @returns {boolean} True if the node matches the class, false if not.\n */\n\n/**\n * @typedef {object} ESQueryOptions\n * @property {string} [nodeTypeKey=\"type\"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.\n * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.\n * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.\n * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.\n */\n\n/**\n * Given a `node` and its ancestors, determine if `node` is matched\n * by `selector`.\n * @param {?external:AST} node\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @throws {Error} Unknowns (operator, class name, selector type, or\n * selector value type)\n * @returns {boolean}\n */\nfunction matches(node, selector, ancestry, options) {\n if (!selector) { return true; }\n if (!node) { return false; }\n if (!ancestry) { ancestry = []; }\n\n return getMatcher(selector)(node, ancestry, options);\n}\n\n/**\n * Get visitor keys of a given node.\n * @param {external:AST} node The AST node to get keys.\n * @param {ESQueryOptions|undefined} options\n * @returns {string[]} Visitor keys of the node.\n */\nfunction getVisitorKeys(node, options) {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n\n const nodeType = node[nodeTypeKey];\n if (options && options.visitorKeys && options.visitorKeys[nodeType]) {\n return options.visitorKeys[nodeType];\n }\n if (estraverse.VisitorKeys[nodeType]) {\n return estraverse.VisitorKeys[nodeType];\n }\n if (options && typeof options.fallback === 'function') {\n return options.fallback(node);\n }\n // 'iteration' fallback\n return Object.keys(node).filter(function (key) {\n return key !== nodeTypeKey;\n });\n}\n\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} node The value to check.\n * @param {ESQueryOptions|undefined} options The options to use.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(node, options) {\n const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n return node !== null && typeof node === 'object' && typeof node[nodeTypeKey] === 'string';\n}\n\n/**\n * Determines if the given node has a sibling that matches the\n * given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction sibling(node, matcher, ancestry, side, options) {\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)) {\n const startIndex = listProp.indexOf(node);\n if (startIndex < 0) { continue; }\n let lowerBound, upperBound;\n if (side === LEFT_SIDE) {\n lowerBound = 0;\n upperBound = startIndex;\n } else {\n lowerBound = startIndex + 1;\n upperBound = listProp.length;\n }\n for (let k = lowerBound; k < upperBound; ++k) {\n if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Determines if the given node has an adjacent sibling that matches\n * the given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction adjacent(node, matcher, ancestry, side, options) {\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)) {\n const idx = listProp.indexOf(node);\n if (idx < 0) { continue; }\n if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {\n return true;\n }\n if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Determines if the given node is the `nth` child.\n * If `nth` is negative then the position is counted\n * from the end of the list of children.\n * @param {external:AST} node\n * @param {external:AST[]} ancestry\n * @param {Integer} nth\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction nthChild(node, ancestry, nth, options) {\n if (nth === 0) { return false; }\n const [parent] = ancestry;\n if (!parent) { return false; }\n const keys = getVisitorKeys(parent, options);\n for (let i = 0; i < keys.length; ++i) {\n const listProp = parent[keys[i]];\n if (Array.isArray(listProp)){\n const idx = nth < 0 ? listProp.length + nth : nth - 1;\n if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * For each selector node marked as a subject, find the portion of the\n * selector that the subject must match.\n * @param {SelectorAST} selector\n * @param {SelectorAST} [ancestor] Defaults to `selector`\n * @returns {SelectorAST[]}\n */\nfunction subjects(selector, ancestor) {\n if (selector == null || typeof selector != 'object') { return []; }\n if (ancestor == null) { ancestor = selector; }\n const results = selector.subject ? [ancestor] : [];\n const keys = Object.keys(selector);\n for (let i = 0; i < keys.length; ++i) {\n const p = keys[i];\n const sel = selector[p];\n results.push(...subjects(sel, p === 'left' ? sel : ancestor));\n }\n return results;\n}\n\n/**\n* @callback TraverseVisitor\n* @param {?external:AST} node\n* @param {?external:AST} parent\n* @param {external:AST[]} ancestry\n*/\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {TraverseVisitor} visitor\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction traverse(ast, selector, visitor, options) {\n if (!selector) { return; }\n const ancestry = [];\n const matcher = getMatcher(selector);\n const altSubjects = subjects(selector).map(getMatcher);\n estraverse.traverse(ast, {\n enter (node, parent) {\n if (parent != null) { ancestry.unshift(parent); }\n if (matcher(node, ancestry, options)) {\n if (altSubjects.length) {\n for (let i = 0, l = altSubjects.length; i < l; ++i) {\n if (altSubjects[i](node, ancestry, options)) {\n visitor(node, parent, ancestry);\n }\n for (let k = 0, m = ancestry.length; k < m; ++k) {\n const succeedingAncestry = ancestry.slice(k + 1);\n if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {\n visitor(ancestry[k], parent, succeedingAncestry);\n }\n }\n }\n } else {\n visitor(node, parent, ancestry);\n }\n }\n },\n leave () { ancestry.shift(); },\n keys: options && options.visitorKeys,\n fallback: options && options.fallback || 'iteration'\n });\n}\n\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction match(ast, selector, options) {\n const results = [];\n traverse(ast, selector, function (node) {\n results.push(node);\n }, options);\n return results;\n}\n\n/**\n * Parse a selector string and return its AST.\n * @param {string} selector\n * @returns {SelectorAST}\n */\nfunction parse(selector) {\n return parser.parse(selector);\n}\n\n/**\n * Query the code AST using the selector string.\n * @param {external:AST} ast\n * @param {string} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction query(ast, selector, options) {\n return match(ast, parse(selector), options);\n}\n\nquery.parse = parse;\nquery.match = match;\nquery.traverse = traverse;\nquery.matches = matches;\nquery.query = query;\n\nexport default query;\n"],"names":["clone","exports","Syntax","VisitorOption","VisitorKeys","BREAK","SKIP","REMOVE","deepCopy","obj","key","val","ret","hasOwnProperty","Reference","parent","this","Element","node","path","wrap","ref","Controller","isNode","type","isProperty","nodeType","ObjectExpression","ObjectPattern","candidateExistsInLeaveList","leavelist","candidate","i","length","traverse","root","visitor","extendCommentRange","comment","tokens","target","array","func","diff","len","current","upperBound","token","range","extendedRange","AssignmentExpression","AssignmentPattern","ArrayExpression","ArrayPattern","ArrowFunctionExpression","AwaitExpression","BlockStatement","BinaryExpression","BreakStatement","CallExpression","CatchClause","ChainExpression","ClassBody","ClassDeclaration","ClassExpression","ComprehensionBlock","ComprehensionExpression","ConditionalExpression","ContinueStatement","DebuggerStatement","DirectiveStatement","DoWhileStatement","EmptyStatement","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExportSpecifier","ExpressionStatement","ForStatement","ForInStatement","ForOfStatement","FunctionDeclaration","FunctionExpression","GeneratorExpression","Identifier","IfStatement","ImportExpression","ImportDeclaration","ImportDefaultSpecifier","ImportNamespaceSpecifier","ImportSpecifier","Literal","LabeledStatement","LogicalExpression","MemberExpression","MetaProperty","MethodDefinition","ModuleSpecifier","NewExpression","PrivateIdentifier","Program","Property","PropertyDefinition","RestElement","ReturnStatement","SequenceExpression","SpreadElement","Super","SwitchStatement","SwitchCase","TaggedTemplateExpression","TemplateElement","TemplateLiteral","ThisExpression","ThrowStatement","TryStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarator","WhileStatement","WithStatement","YieldExpression","Break","Skip","Remove","prototype","replace","remove","Array","isArray","splice","iz","j","jz","result","addToPath","push","__current","__leavelist","parents","__execute","callback","element","previous","undefined","__state","call","notify","flag","skip","__initialize","__worklist","__fallback","fallback","Object","keys","__keys","assign","create","worklist","current2","candidates","sentinel","pop","enter","Error","leave","outer","removeElem","nextElem","attachComments","tree","providedComments","cursor","comments","leadingComments","trailingComments","cloneEnvironment","module","peg$SyntaxError","message","expected","found","location","name","captureStackTrace","child","ctor","constructor","peg$subclass","buildMessage","DESCRIBE_EXPECTATION_FNS","literal","expectation","literalEscape","text","class","escapedParts","parts","classEscape","inverted","any","end","other","description","hex","ch","charCodeAt","toString","toUpperCase","s","descriptions","sort","slice","join","describeExpected","describeFound","SyntaxError","parse","input","options","peg$result","peg$FAILED","peg$startRuleFunctions","start","peg$parsestart","peg$startRuleFunction","peg$c3","peg$literalExpectation","peg$c4","peg$c5","peg$classExpectation","peg$c8","peg$c11","peg$c14","peg$c18","peg$c19","ss","concat","map","peg$c23","peg$c26","peg$c29","peg$c32","peg$c34","peg$c36","peg$c37","peg$c39","peg$c40","a","peg$c41","peg$c42","peg$c44","peg$c46","op","value","operator","peg$c49","peg$c50","peg$c51","peg$c53","peg$c54","peg$c55","b","peg$c56","d","match","peg$c58","peg$c59","peg$c60","peg$c61","peg$c62","peg$c66","peg$c67","peg$c68","peg$c70","peg$c72","peg$c73","peg$c75","peg$c76","peg$c77","peg$c81","peg$c84","peg$c87","peg$c90","peg$c93","peg$c96","peg$c99","peg$c102","peg$currPos","peg$posDetailsCache","line","column","peg$maxFailPos","peg$maxFailExpected","peg$silentFails","startRule","ignoreCase","peg$computePosDetails","pos","p","details","peg$computeLocation","startPos","endPos","startPosDetails","endPosDetails","offset","peg$fail","s0","s1","s2","cached","peg$resultsCache","nextPos","peg$parse_","peg$parseselectors","selectors","peg$c1","peg$parseidentifierName","test","charAt","peg$parsebinaryOp","s3","s4","s5","s6","s7","peg$parseselector","peg$parsehasSelector","left","right","peg$parsesequence","reduce","memo","rhs","subject","as","peg$parseatom","peg$parsewildcard","peg$parseidentifier","peg$parseattrName","peg$parseattrEqOps","substr","peg$parsetype","flgs","peg$parseflags","RegExp","peg$parseregex","peg$parseattrOps","peg$parsestring","leadingDecimals","apply","parseFloat","peg$parsenumber","peg$parsepath","peg$parseattrValue","peg$parseattr","peg$parsefield","peg$parsenegation","peg$parsematches","peg$parsehasSelectors","peg$parsehas","nth","peg$parsefirstChild","nthLast","peg$parselastChild","parseInt","peg$parsenthChild","peg$parsenthLastChild","peg$parseclass","n","index","factory","getPath","MATCHER_CACHE","WeakMap","getMatcher","selector","matcher","get","generateMatcher","set","toLowerCase","ancestry","nodeTypeKey","split","inPath","ancestor","fromPathIndex","field","k","matchers","estraverse","unshift","shift","visitorKeys","l","sibling","adjacent","nthChild","matchClass","getVisitorKeys","filter","_typeof","side","listProp","startIndex","indexOf","lowerBound","idx","ast","altSubjects","subjects","results","sel","m","succeedingAncestry","parser","query","matches"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/esquery/license.txt b/node_modules/esquery/license.txt new file mode 100644 index 0000000..52f915e --- /dev/null +++ b/node_modules/esquery/license.txt @@ -0,0 +1,24 @@ +Copyright (c) 2013, Joel Feenstra +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the ESQuery nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL JOEL FEENSTRA BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esquery/package.json b/node_modules/esquery/package.json new file mode 100644 index 0000000..5e314b3 --- /dev/null +++ b/node_modules/esquery/package.json @@ -0,0 +1,78 @@ +{ + "name": "esquery", + "version": "1.6.0", + "author": "Joel Feenstra ", + "contributors": [], + "description": "A query library for ECMAScript AST using a CSS selector like query language.", + "main": "dist/esquery.min.js", + "module": "dist/esquery.esm.min.js", + "files": [ + "dist/*.js", + "dist/*.map", + "parser.js", + "license.txt", + "README.md" + ], + "nyc": { + "branches": 100, + "lines": 100, + "functions": 100, + "statements": 100, + "reporter": [ + "html", + "text" + ], + "exclude": [ + "parser.js", + "dist", + "tests" + ] + }, + "scripts": { + "prepublishOnly": "npm run build && npm test", + "build:parser": "rm parser.js && pegjs --cache --format umd -o \"parser.js\" \"grammar.pegjs\"", + "build:browser": "rollup -c", + "build": "npm run build:parser && npm run build:browser", + "mocha": "mocha --require chai/register-assert --require @babel/register tests", + "test": "nyc npm run mocha && npm run lint", + "test:ci": "npm run mocha", + "lint": "eslint ." + }, + "repository": { + "type": "git", + "url": "https://github.com/estools/esquery.git" + }, + "bugs": "https://github.com/estools/esquery/issues", + "homepage": "https://github.com/estools/esquery/", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "query" + ], + "devDependencies": { + "@babel/core": "^7.9.0", + "@babel/preset-env": "^7.9.5", + "@babel/register": "^7.9.0", + "@rollup/plugin-commonjs": "^11.1.0", + "@rollup/plugin-json": "^4.0.2", + "@rollup/plugin-node-resolve": "^7.1.3", + "babel-plugin-transform-es2017-object-entries": "0.0.5", + "chai": "4.2.0", + "eslint": "^6.8.0", + "esprima": "~4.0.1", + "mocha": "7.1.1", + "nyc": "^15.0.1", + "pegjs": "~0.10.0", + "rollup": "^1.32.1", + "rollup-plugin-babel": "^4.4.0", + "rollup-plugin-terser": "^5.3.0" + }, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10" + }, + "dependencies": { + "estraverse": "^5.1.0" + } +} diff --git a/node_modules/esquery/parser.js b/node_modules/esquery/parser.js new file mode 100644 index 0000000..eac0a00 --- /dev/null +++ b/node_modules/esquery/parser.js @@ -0,0 +1,2694 @@ +/* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([], factory); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(); + } +})(this, function() { + "use strict"; + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); + } + } + + peg$subclass(peg$SyntaxError, Error); + + peg$SyntaxError.buildMessage = function(expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, + + "class": function(expectation) { + var escapedParts = "", + i; + + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array + ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) + : classEscape(expectation.parts[i]); + } + + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + + any: function(expectation) { + return "any character"; + }, + + end: function(expectation) { + return "end of input"; + }, + + other: function(expectation) { + return expectation.description; + } + }; + + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + + function literalEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } + + function classEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/\]/g, '\\]') + .replace(/\^/g, '\\^') + .replace(/-/g, '\\-') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } + + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, j; + + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); + } + + descriptions.sort(); + + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + descriptions.length = j; + } + + switch (descriptions.length) { + case 1: + return descriptions[0]; + + case 2: + return descriptions[0] + " or " + descriptions[1]; + + default: + return descriptions.slice(0, -1).join(", ") + + ", or " + + descriptions[descriptions.length - 1]; + } + } + + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } + + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; + }; + + function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + + var peg$FAILED = {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = function(ss) { + return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss }; + }, + peg$c1 = function() { return void 0; }, + peg$c2 = " ", + peg$c3 = peg$literalExpectation(" ", false), + peg$c4 = /^[^ [\],():#!=><~+.]/, + peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false), + peg$c6 = function(i) { return i.join(''); }, + peg$c7 = ">", + peg$c8 = peg$literalExpectation(">", false), + peg$c9 = function() { return 'child'; }, + peg$c10 = "~", + peg$c11 = peg$literalExpectation("~", false), + peg$c12 = function() { return 'sibling'; }, + peg$c13 = "+", + peg$c14 = peg$literalExpectation("+", false), + peg$c15 = function() { return 'adjacent'; }, + peg$c16 = function() { return 'descendant'; }, + peg$c17 = ",", + peg$c18 = peg$literalExpectation(",", false), + peg$c19 = function(s, ss) { + return [s].concat(ss.map(function (s) { return s[3]; })); + }, + peg$c20 = function(op, s) { + if (!op) return s; + return { type: op, left: { type: 'exactNode' }, right: s }; + }, + peg$c21 = function(a, ops) { + return ops.reduce(function (memo, rhs) { + return { type: rhs[0], left: memo, right: rhs[1] }; + }, a); + }, + peg$c22 = "!", + peg$c23 = peg$literalExpectation("!", false), + peg$c24 = function(subject, as) { + const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as }; + if(subject) b.subject = true; + return b; + }, + peg$c25 = "*", + peg$c26 = peg$literalExpectation("*", false), + peg$c27 = function(a) { return { type: 'wildcard', value: a }; }, + peg$c28 = "#", + peg$c29 = peg$literalExpectation("#", false), + peg$c30 = function(i) { return { type: 'identifier', value: i }; }, + peg$c31 = "[", + peg$c32 = peg$literalExpectation("[", false), + peg$c33 = "]", + peg$c34 = peg$literalExpectation("]", false), + peg$c35 = function(v) { return v; }, + peg$c36 = /^[>", "<", "!"], false, false), + peg$c38 = "=", + peg$c39 = peg$literalExpectation("=", false), + peg$c40 = function(a) { return (a || '') + '='; }, + peg$c41 = /^[><]/, + peg$c42 = peg$classExpectation([">", "<"], false, false), + peg$c43 = ".", + peg$c44 = peg$literalExpectation(".", false), + peg$c45 = function(a, as) { + return [].concat.apply([a], as).join(''); + }, + peg$c46 = function(name, op, value) { + return { type: 'attribute', name: name, operator: op, value: value }; + }, + peg$c47 = function(name) { return { type: 'attribute', name: name }; }, + peg$c48 = "\"", + peg$c49 = peg$literalExpectation("\"", false), + peg$c50 = /^[^\\"]/, + peg$c51 = peg$classExpectation(["\\", "\""], true, false), + peg$c52 = "\\", + peg$c53 = peg$literalExpectation("\\", false), + peg$c54 = peg$anyExpectation(), + peg$c55 = function(a, b) { return a + b; }, + peg$c56 = function(d) { + return { type: 'literal', value: strUnescape(d.join('')) }; + }, + peg$c57 = "'", + peg$c58 = peg$literalExpectation("'", false), + peg$c59 = /^[^\\']/, + peg$c60 = peg$classExpectation(["\\", "'"], true, false), + peg$c61 = /^[0-9]/, + peg$c62 = peg$classExpectation([["0", "9"]], false, false), + peg$c63 = function(a, b) { + // Can use `a.flat().join('')` once supported + const leadingDecimals = a ? [].concat.apply([], a).join('') : ''; + return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) }; + }, + peg$c64 = function(i) { return { type: 'literal', value: i }; }, + peg$c65 = "type(", + peg$c66 = peg$literalExpectation("type(", false), + peg$c67 = /^[^ )]/, + peg$c68 = peg$classExpectation([" ", ")"], true, false), + peg$c69 = ")", + peg$c70 = peg$literalExpectation(")", false), + peg$c71 = function(t) { return { type: 'type', value: t.join('') }; }, + peg$c72 = /^[imsu]/, + peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false), + peg$c74 = "/", + peg$c75 = peg$literalExpectation("/", false), + peg$c76 = /^[^\/]/, + peg$c77 = peg$classExpectation(["/"], true, false), + peg$c78 = function(d, flgs) { return { + type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') }; + }, + peg$c79 = function(i, is) { + return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)}; + }, + peg$c80 = ":not(", + peg$c81 = peg$literalExpectation(":not(", false), + peg$c82 = function(ss) { return { type: 'not', selectors: ss }; }, + peg$c83 = ":matches(", + peg$c84 = peg$literalExpectation(":matches(", false), + peg$c85 = function(ss) { return { type: 'matches', selectors: ss }; }, + peg$c86 = ":has(", + peg$c87 = peg$literalExpectation(":has(", false), + peg$c88 = function(ss) { return { type: 'has', selectors: ss }; }, + peg$c89 = ":first-child", + peg$c90 = peg$literalExpectation(":first-child", false), + peg$c91 = function() { return nth(1); }, + peg$c92 = ":last-child", + peg$c93 = peg$literalExpectation(":last-child", false), + peg$c94 = function() { return nthLast(1); }, + peg$c95 = ":nth-child(", + peg$c96 = peg$literalExpectation(":nth-child(", false), + peg$c97 = function(n) { return nth(parseInt(n.join(''), 10)); }, + peg$c98 = ":nth-last-child(", + peg$c99 = peg$literalExpectation(":nth-last-child(", false), + peg$c100 = function(n) { return nthLast(parseInt(n.join(''), 10)); }, + peg$c101 = ":", + peg$c102 = peg$literalExpectation(":", false), + peg$c103 = function(c) { + return { type: 'class', name: c }; + }, + + peg$currPos = 0, + peg$savedPos = 0, + peg$posDetailsCache = [{ line: 1, column: 1 }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$resultsCache = {}, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$savedPos, peg$currPos); + } + + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); + } + + function expected(description, location) { + location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) + + throw peg$buildStructuredError( + [peg$otherExpectation(description)], + input.substring(peg$savedPos, peg$currPos), + location + ); + } + + function error(message, location) { + location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) + + throw peg$buildSimpleError(message, location); + } + + function peg$literalExpectation(text, ignoreCase) { + return { type: "literal", text: text, ignoreCase: ignoreCase }; + } + + function peg$classExpectation(parts, inverted, ignoreCase) { + return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; + } + + function peg$anyExpectation() { + return { type: "any" }; + } + + function peg$endExpectation() { + return { type: "end" }; + } + + function peg$otherExpectation(description) { + return { type: "other", description: description }; + } + + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], p; + + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; + } + + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; + } + + peg$posDetailsCache[pos] = details; + return details; + } + } + + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildSimpleError(message, location) { + return new peg$SyntaxError(message, null, null, location); + } + + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError( + peg$SyntaxError.buildMessage(expected, found), + expected, + found, + location + ); + } + + function peg$parsestart() { + var s0, s1, s2, s3; + + var key = peg$currPos * 32 + 0, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseselectors(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c0(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c1(); + } + s0 = s1; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parse_() { + var s0, s1; + + var key = peg$currPos * 32 + 1, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c3); } + } + while (s1 !== peg$FAILED) { + s0.push(s1); + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c3); } + } + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseidentifierName() { + var s0, s1, s2; + + var key = peg$currPos * 32 + 2, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = []; + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c6(s1); + } + s0 = s1; + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsebinaryOp() { + var s0, s1, s2, s3; + + var key = peg$currPos * 32 + 3, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 62) { + s2 = peg$c7; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c9(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 126) { + s2 = peg$c10; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c12(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 43) { + s2 = peg$c13; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c15(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c3); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c16(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + } + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsehasSelectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + var key = peg$currPos * 32 + 4, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parsehasSelector(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehasSelector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehasSelector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseselectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + var key = peg$currPos * 32 + 5, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parseselector(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsehasSelector() { + var s0, s1, s2; + + var key = peg$currPos * 32 + 6, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parsebinaryOp(); + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseselector(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c20(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseselector() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 7, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parsesequence(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c21(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsesequence() { + var s0, s1, s2, s3; + + var key = peg$currPos * 32 + 8, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseatom(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseatom(); + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c24(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseatom() { + var s0; + + var key = peg$currPos * 32 + 9, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$parsewildcard(); + if (s0 === peg$FAILED) { + s0 = peg$parseidentifier(); + if (s0 === peg$FAILED) { + s0 = peg$parseattr(); + if (s0 === peg$FAILED) { + s0 = peg$parsefield(); + if (s0 === peg$FAILED) { + s0 = peg$parsenegation(); + if (s0 === peg$FAILED) { + s0 = peg$parsematches(); + if (s0 === peg$FAILED) { + s0 = peg$parsehas(); + if (s0 === peg$FAILED) { + s0 = peg$parsefirstChild(); + if (s0 === peg$FAILED) { + s0 = peg$parselastChild(); + if (s0 === peg$FAILED) { + s0 = peg$parsenthChild(); + if (s0 === peg$FAILED) { + s0 = peg$parsenthLastChild(); + if (s0 === peg$FAILED) { + s0 = peg$parseclass(); + } + } + } + } + } + } + } + } + } + } + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsewildcard() { + var s0, s1; + + var key = peg$currPos * 32 + 10, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c27(s1); + } + s0 = s1; + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseidentifier() { + var s0, s1, s2; + + var key = peg$currPos * 32 + 11, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c28; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c29); } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c30(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseattr() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 12, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c31; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c32); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrValue(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s5 = peg$c33; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c35(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseattrOps() { + var s0, s1, s2; + + var key = peg$currPos * 32 + 13, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (peg$c36.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c40(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + if (peg$c41.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c42); } + } + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseattrEqOps() { + var s0, s1, s2; + + var key = peg$currPos * 32 + 14, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c40(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseattrName() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 15, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c43; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c44); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c43; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c44); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c45(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseattrValue() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 16, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrEqOps(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsetype(); + if (s5 === peg$FAILED) { + s5 = peg$parseregex(); + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c46(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseattrOps(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsestring(); + if (s5 === peg$FAILED) { + s5 = peg$parsenumber(); + if (s5 === peg$FAILED) { + s5 = peg$parsepath(); + } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c46(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c47(s1); + } + s0 = s1; + } + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 17, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c48; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c56(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c57; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c59.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c59.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s3 === peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c52; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c55(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c57; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c56(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsenumber() { + var s0, s1, s2, s3; + + var key = peg$currPos * 32 + 18, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s3 = peg$c43; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c44); } + } + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c63(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsepath() { + var s0, s1; + + var key = peg$currPos * 32 + 19, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c64(s1); + } + s0 = s1; + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsetype() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 20, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c65) { + s1 = peg$c65; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c67.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c67.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c71(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseflags() { + var s0, s1; + + var key = peg$currPos * 32 + 21, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = []; + if (peg$c72.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s1 !== peg$FAILED) { + while (s1 !== peg$FAILED) { + s0.push(s1); + if (peg$c72.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + } + } else { + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseregex() { + var s0, s1, s2, s3, s4; + + var key = peg$currPos * 32 + 22, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c74; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s1 !== peg$FAILED) { + s2 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + if (peg$c76.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parseflags(); + if (s4 === peg$FAILED) { + s4 = null; + } + if (s4 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c78(s2, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsefield() { + var s0, s1, s2, s3, s4, s5, s6; + + var key = peg$currPos * 32 + 23, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c43; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c44); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c44); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c43; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c44); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c79(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsenegation() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 24, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c80) { + s1 = peg$c80; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c82(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsematches() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 25, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.substr(peg$currPos, 9) === peg$c83) { + s1 = peg$c83; + peg$currPos += 9; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c85(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsehas() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 26, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c86) { + s1 = peg$c86; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parsehasSelectors(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c88(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsefirstChild() { + var s0, s1; + + var key = peg$currPos * 32 + 27, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.substr(peg$currPos, 12) === peg$c89) { + s1 = peg$c89; + peg$currPos += 12; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c90); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c91(); + } + s0 = s1; + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parselastChild() { + var s0, s1; + + var key = peg$currPos * 32 + 28, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.substr(peg$currPos, 11) === peg$c92) { + s1 = peg$c92; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c93); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c94(); + } + s0 = s1; + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsenthChild() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 29, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.substr(peg$currPos, 11) === peg$c95) { + s1 = peg$c95; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c97(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parsenthLastChild() { + var s0, s1, s2, s3, s4, s5; + + var key = peg$currPos * 32 + 30, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.substr(peg$currPos, 16) === peg$c98) { + s1 = peg$c98; + peg$currPos += 16; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + if (peg$c61.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c69; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c100(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseclass() { + var s0, s1, s2; + + var key = peg$currPos * 32 + 31, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c101; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c103(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + + function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; } + function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; } + function strUnescape(s) { + return s.replace(/\\(.)/g, function(match, ch) { + switch(ch) { + case 'b': return '\b'; + case 'f': return '\f'; + case 'n': return '\n'; + case 'r': return '\r'; + case 't': return '\t'; + case 'v': return '\v'; + default: return ch; + } + }); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + + throw peg$buildStructuredError( + peg$maxFailExpected, + peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, + peg$maxFailPos < input.length + ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) + : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) + ); + } + } + + return { + SyntaxError: peg$SyntaxError, + parse: peg$parse + }; +}); diff --git a/node_modules/esrecurse/README.md b/node_modules/esrecurse/README.md new file mode 100644 index 0000000..ffea6b4 --- /dev/null +++ b/node_modules/esrecurse/README.md @@ -0,0 +1,171 @@ +### Esrecurse [![Build Status](https://travis-ci.org/estools/esrecurse.svg?branch=master)](https://travis-ci.org/estools/esrecurse) + +Esrecurse ([esrecurse](https://github.com/estools/esrecurse)) is +[ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm) +recursive traversing functionality. + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +esrecurse.visit(ast, { + XXXStatement: function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); + } +}); +``` + +We can use `Visitor` instance. + +```javascript +var visitor = new esrecurse.Visitor({ + XXXStatement: function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); + } +}); + +visitor.visit(ast); +``` + +We can inherit `Visitor` instance easily. + +```javascript +class Derived extends esrecurse.Visitor { + constructor() + { + super(null); + } + + XXXStatement(node) { + } +} +``` + +```javascript +function DerivedVisitor() { + esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); +} +util.inherits(DerivedVisitor, esrecurse.Visitor); +DerivedVisitor.prototype.XXXStatement = function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); +}; +``` + +And you can invoke default visiting operation inside custom visit operation. + +```javascript +function DerivedVisitor() { + esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); +} +util.inherits(DerivedVisitor, esrecurse.Visitor); +DerivedVisitor.prototype.XXXStatement = function (node) { + // do something... + this.visitChildren(node); +}; +``` + +The `childVisitorKeys` option does customize the behaviour of `this.visitChildren(node)`. +We can use user-defined node types. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + // Extending the existing traversing rules. + childVisitorKeys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } + } +); +``` + +We can use the `fallback` option as well. +If the `fallback` option is `"iteration"`, `esrecurse` would visit all enumerable properties of unknown nodes. +Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). + +```javascript +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + fallback: 'iteration' + } +); +``` + +If the `fallback` option is a function, `esrecurse` calls this function to determine the enumerable properties of unknown nodes. +Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). + +```javascript +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + fallback: function (node) { + return Object.keys(node).filter(function(key) { + return key !== 'argument' + }); + } + } +); +``` + +### License + +Copyright (C) 2014 [Yusuke Suzuki](https://github.com/Constellation) + (twitter: [@Constellation](https://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esrecurse/esrecurse.js b/node_modules/esrecurse/esrecurse.js new file mode 100644 index 0000000..15d57df --- /dev/null +++ b/node_modules/esrecurse/esrecurse.js @@ -0,0 +1,117 @@ +/* + Copyright (C) 2014 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +(function () { + 'use strict'; + + var estraverse = require('estraverse'); + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; + } + + function Visitor(visitor, options) { + options = options || {}; + + this.__visitor = visitor || this; + this.__childVisitorKeys = options.childVisitorKeys + ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) + : estraverse.VisitorKeys; + if (options.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof options.fallback === 'function') { + this.__fallback = options.fallback; + } + } + + /* Default method for visiting children. + * When you need to call default visiting operation inside custom visiting + * operation, you can use it with `this.visitChildren(node)`. + */ + Visitor.prototype.visitChildren = function (node) { + var type, children, i, iz, j, jz, child; + + if (node == null) { + return; + } + + type = node.type || estraverse.Syntax.Property; + + children = this.__childVisitorKeys[type]; + if (!children) { + if (this.__fallback) { + children = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + type + '.'); + } + } + + for (i = 0, iz = children.length; i < iz; ++i) { + child = node[children[i]]; + if (child) { + if (Array.isArray(child)) { + for (j = 0, jz = child.length; j < jz; ++j) { + if (child[j]) { + if (isNode(child[j]) || isProperty(type, children[i])) { + this.visit(child[j]); + } + } + } + } else if (isNode(child)) { + this.visit(child); + } + } + } + }; + + /* Dispatching node. */ + Visitor.prototype.visit = function (node) { + var type; + + if (node == null) { + return; + } + + type = node.type || estraverse.Syntax.Property; + if (this.__visitor[type]) { + this.__visitor[type].call(this, node); + return; + } + this.visitChildren(node); + }; + + exports.version = require('./package.json').version; + exports.Visitor = Visitor; + exports.visit = function (node, visitor, options) { + var v = new Visitor(visitor, options); + v.visit(node); + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esrecurse/gulpfile.babel.js b/node_modules/esrecurse/gulpfile.babel.js new file mode 100644 index 0000000..aa881c9 --- /dev/null +++ b/node_modules/esrecurse/gulpfile.babel.js @@ -0,0 +1,92 @@ +// Copyright (C) 2014 Yusuke Suzuki +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import gulp from 'gulp'; +import mocha from 'gulp-mocha'; +import eslint from 'gulp-eslint'; +import minimist from 'minimist'; +import git from 'gulp-git'; +import bump from 'gulp-bump'; +import filter from 'gulp-filter'; +import tagVersion from 'gulp-tag-version'; +import 'babel-register'; + +const SOURCE = [ + '*.js' +]; + +let ESLINT_OPTION = { + parser: 'babel-eslint', + parserOptions: { + 'sourceType': 'module' + }, + rules: { + 'quotes': 0, + 'eqeqeq': 0, + 'no-use-before-define': 0, + 'no-shadow': 0, + 'no-new': 0, + 'no-underscore-dangle': 0, + 'no-multi-spaces': 0, + 'no-native-reassign': 0, + 'no-loop-func': 0 + }, + env: { + 'node': true + } +}; + +gulp.task('test', function() { + let options = minimist(process.argv.slice(2), { + string: 'test', + default: { + test: 'test/*.js' + } + } + ); + return gulp.src(options.test).pipe(mocha({reporter: 'spec'})); +}); + +gulp.task('lint', () => + gulp.src(SOURCE) + .pipe(eslint(ESLINT_OPTION)) + .pipe(eslint.formatEach('stylish', process.stderr)) + .pipe(eslint.failOnError()) +); + +let inc = importance => + gulp.src(['./package.json']) + .pipe(bump({type: importance})) + .pipe(gulp.dest('./')) + .pipe(git.commit('Bumps package version')) + .pipe(filter('package.json')) + .pipe(tagVersion({ + prefix: '' + })) +; + +gulp.task('travis', [ 'lint', 'test' ]); +gulp.task('default', [ 'travis' ]); + +gulp.task('patch', [ ], () => inc('patch')); +gulp.task('minor', [ ], () => inc('minor')); +gulp.task('major', [ ], () => inc('major')); diff --git a/node_modules/esrecurse/package.json b/node_modules/esrecurse/package.json new file mode 100755 index 0000000..dec5b1b --- /dev/null +++ b/node_modules/esrecurse/package.json @@ -0,0 +1,52 @@ +{ + "name": "esrecurse", + "description": "ECMAScript AST recursive visitor", + "homepage": "https://github.com/estools/esrecurse", + "main": "esrecurse.js", + "version": "4.3.0", + "engines": { + "node": ">=4.0" + }, + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "https://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/estools/esrecurse.git" + }, + "dependencies": { + "estraverse": "^5.2.0" + }, + "devDependencies": { + "babel-cli": "^6.24.1", + "babel-eslint": "^7.2.3", + "babel-preset-es2015": "^6.24.1", + "babel-register": "^6.24.1", + "chai": "^4.0.2", + "esprima": "^4.0.0", + "gulp": "^3.9.0", + "gulp-bump": "^2.7.0", + "gulp-eslint": "^4.0.0", + "gulp-filter": "^5.0.0", + "gulp-git": "^2.4.1", + "gulp-mocha": "^4.3.1", + "gulp-tag-version": "^1.2.1", + "jsdoc": "^3.3.0-alpha10", + "minimist": "^1.1.0" + }, + "license": "BSD-2-Clause", + "scripts": { + "test": "gulp travis", + "unit-test": "gulp test", + "lint": "gulp lint" + }, + "babel": { + "presets": [ + "es2015" + ] + } +} diff --git a/node_modules/estraverse/LICENSE.BSD b/node_modules/estraverse/LICENSE.BSD new file mode 100644 index 0000000..3e580c3 --- /dev/null +++ b/node_modules/estraverse/LICENSE.BSD @@ -0,0 +1,19 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/estraverse/README.md b/node_modules/estraverse/README.md new file mode 100644 index 0000000..ccd3377 --- /dev/null +++ b/node_modules/estraverse/README.md @@ -0,0 +1,153 @@ +### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) + +Estraverse ([estraverse](http://github.com/estools/estraverse)) is +[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +traversal functions from [esmangle project](http://github.com/estools/esmangle). + +### Documentation + +You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +estraverse.traverse(ast, { + enter: function (node, parent) { + if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') + return estraverse.VisitorOption.Skip; + }, + leave: function (node, parent) { + if (node.type == 'VariableDeclarator') + console.log(node.id.name); + } +}); +``` + +We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. + +```javascript +estraverse.traverse(ast, { + enter: function (node) { + this.break(); + } +}); +``` + +And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. + +```javascript +result = estraverse.replace(tree, { + enter: function (node) { + // Replace it with replaced. + if (node.type === 'Literal') + return replaced; + } +}); +``` + +By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Extending the existing traversing rules. + keys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } +}); +``` + +By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Iterating the child **nodes** of unknown nodes. + fallback: 'iteration' +}); +``` + +When `visitor.fallback` is a function, we can determine which keys to visit on each node. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Skip the `argument` property of each node + fallback: function(node) { + return Object.keys(node).filter(function(key) { + return key !== 'argument'; + }); + } +}); +``` + +### License + +Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/estraverse/estraverse.js b/node_modules/estraverse/estraverse.js new file mode 100644 index 0000000..f0d9af9 --- /dev/null +++ b/node_modules/estraverse/estraverse.js @@ -0,0 +1,805 @@ +/* + Copyright (C) 2012-2013 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/*jslint vars:false, bitwise:true*/ +/*jshint indent:4*/ +/*global exports:true*/ +(function clone(exports) { + 'use strict'; + + var Syntax, + VisitorOption, + VisitorKeys, + BREAK, + SKIP, + REMOVE; + + function deepCopy(obj) { + var ret = {}, key, val; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + val = obj[key]; + if (typeof val === 'object' && val !== null) { + ret[key] = deepCopy(val); + } else { + ret[key] = val; + } + } + } + return ret; + } + + // based on LLVM libc++ upper_bound / lower_bound + // MIT License + + function upperBound(array, func) { + var diff, len, i, current; + + len = array.length; + i = 0; + + while (len) { + diff = len >>> 1; + current = i + diff; + if (func(array[current])) { + len = diff; + } else { + i = current + 1; + len -= diff + 1; + } + } + return i; + } + + Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ChainExpression: 'ChainExpression', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. + ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DirectiveStatement: 'DirectiveStatement', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + ModuleSpecifier: 'ModuleSpecifier', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + PrivateIdentifier: 'PrivateIdentifier', + Program: 'Program', + Property: 'Property', + PropertyDefinition: 'PropertyDefinition', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + VisitorKeys = { + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. + BlockStatement: ['body'], + BinaryExpression: ['left', 'right'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ChainExpression: ['expression'], + ClassBody: ['body'], + ClassDeclaration: ['id', 'superClass', 'body'], + ClassExpression: ['id', 'superClass', 'body'], + ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. + ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['source'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], + ExportSpecifier: ['exported', 'local'], + ExpressionStatement: ['expression'], + ForStatement: ['init', 'test', 'update', 'body'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], + ImportDeclaration: ['specifiers', 'source'], + ImportDefaultSpecifier: ['local'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + Literal: [], + LabeledStatement: ['label', 'body'], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['key', 'value'], + ModuleSpecifier: [], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + PrivateIdentifier: [], + Program: ['body'], + Property: ['key', 'value'], + PropertyDefinition: ['key', 'value'], + RestElement: [ 'argument' ], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + Super: [], + SwitchStatement: ['discriminant', 'cases'], + SwitchCase: ['test', 'consequent'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + WithStatement: ['object', 'body'], + YieldExpression: ['argument'] + }; + + // unique id + BREAK = {}; + SKIP = {}; + REMOVE = {}; + + VisitorOption = { + Break: BREAK, + Skip: SKIP, + Remove: REMOVE + }; + + function Reference(parent, key) { + this.parent = parent; + this.key = key; + } + + Reference.prototype.replace = function replace(node) { + this.parent[this.key] = node; + }; + + Reference.prototype.remove = function remove() { + if (Array.isArray(this.parent)) { + this.parent.splice(this.key, 1); + return true; + } else { + this.replace(null); + return false; + } + }; + + function Element(node, path, wrap, ref) { + this.node = node; + this.path = path; + this.wrap = wrap; + this.ref = ref; + } + + function Controller() { } + + // API: + // return property path array from root to current node + Controller.prototype.path = function path() { + var i, iz, j, jz, result, element; + + function addToPath(result, path) { + if (Array.isArray(path)) { + for (j = 0, jz = path.length; j < jz; ++j) { + result.push(path[j]); + } + } else { + result.push(path); + } + } + + // root node + if (!this.__current.path) { + return null; + } + + // first node is sentinel, second node is root element + result = []; + for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { + element = this.__leavelist[i]; + addToPath(result, element.path); + } + addToPath(result, this.__current.path); + return result; + }; + + // API: + // return type of current node + Controller.prototype.type = function () { + var node = this.current(); + return node.type || this.__current.wrap; + }; + + // API: + // return array of parent elements + Controller.prototype.parents = function parents() { + var i, iz, result; + + // first node is sentinel + result = []; + for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { + result.push(this.__leavelist[i].node); + } + + return result; + }; + + // API: + // return current node + Controller.prototype.current = function current() { + return this.__current.node; + }; + + Controller.prototype.__execute = function __execute(callback, element) { + var previous, result; + + result = undefined; + + previous = this.__current; + this.__current = element; + this.__state = null; + if (callback) { + result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); + } + this.__current = previous; + + return result; + }; + + // API: + // notify control skip / break + Controller.prototype.notify = function notify(flag) { + this.__state = flag; + }; + + // API: + // skip child nodes of current node + Controller.prototype.skip = function () { + this.notify(SKIP); + }; + + // API: + // break traversals + Controller.prototype['break'] = function () { + this.notify(BREAK); + }; + + // API: + // remove node + Controller.prototype.remove = function () { + this.notify(REMOVE); + }; + + Controller.prototype.__initialize = function(root, visitor) { + this.visitor = visitor; + this.root = root; + this.__worklist = []; + this.__leavelist = []; + this.__current = null; + this.__state = null; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + + this.__keys = VisitorKeys; + if (visitor.keys) { + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); + } + }; + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; + } + + function candidateExistsInLeaveList(leavelist, candidate) { + for (var i = leavelist.length - 1; i >= 0; --i) { + if (leavelist[i].node === candidate) { + return true; + } + } + return false; + } + + Controller.prototype.traverse = function traverse(root, visitor) { + var worklist, + leavelist, + element, + node, + nodeType, + ret, + key, + current, + current2, + candidates, + candidate, + sentinel; + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + worklist.push(new Element(root, null, null, null)); + leavelist.push(new Element(null, null, null, null)); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + ret = this.__execute(visitor.leave, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + continue; + } + + if (element.node) { + + ret = this.__execute(visitor.enter, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || ret === SKIP) { + continue; + } + + node = element.node; + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + + if (candidateExistsInLeaveList(leavelist, candidate[current2])) { + continue; + } + + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', null); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, null); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + if (candidateExistsInLeaveList(leavelist, candidate)) { + continue; + } + + worklist.push(new Element(candidate, key, null, null)); + } + } + } + } + }; + + Controller.prototype.replace = function replace(root, visitor) { + var worklist, + leavelist, + node, + nodeType, + target, + element, + current, + current2, + candidates, + candidate, + sentinel, + outer, + key; + + function removeElem(element) { + var i, + key, + nextElem, + parent; + + if (element.ref.remove()) { + // When the reference is an element of an array. + key = element.ref.key; + parent = element.ref.parent; + + // If removed from array, then decrease following items' keys. + i = worklist.length; + while (i--) { + nextElem = worklist[i]; + if (nextElem.ref && nextElem.ref.parent === parent) { + if (nextElem.ref.key < key) { + break; + } + --nextElem.ref.key; + } + } + } + } + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + outer = { + root: root + }; + element = new Element(root, null, null, new Reference(outer, 'root')); + worklist.push(element); + leavelist.push(element); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + target = this.__execute(visitor.leave, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + continue; + } + + target = this.__execute(visitor.enter, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + element.node = target; + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + element.node = null; + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + + // node may be null + node = element.node; + if (!node) { + continue; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || target === SKIP) { + continue; + } + + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, new Reference(node, key))); + } + } + } + + return outer.root; + }; + + function traverse(root, visitor) { + var controller = new Controller(); + return controller.traverse(root, visitor); + } + + function replace(root, visitor) { + var controller = new Controller(); + return controller.replace(root, visitor); + } + + function extendCommentRange(comment, tokens) { + var target; + + target = upperBound(tokens, function search(token) { + return token.range[0] > comment.range[0]; + }); + + comment.extendedRange = [comment.range[0], comment.range[1]]; + + if (target !== tokens.length) { + comment.extendedRange[1] = tokens[target].range[0]; + } + + target -= 1; + if (target >= 0) { + comment.extendedRange[0] = tokens[target].range[1]; + } + + return comment; + } + + function attachComments(tree, providedComments, tokens) { + // At first, we should calculate extended comment ranges. + var comments = [], comment, len, i, cursor; + + if (!tree.range) { + throw new Error('attachComments needs range information'); + } + + // tokens array is empty, we attach comments to tree as 'leadingComments' + if (!tokens.length) { + if (providedComments.length) { + for (i = 0, len = providedComments.length; i < len; i += 1) { + comment = deepCopy(providedComments[i]); + comment.extendedRange = [0, tree.range[0]]; + comments.push(comment); + } + tree.leadingComments = comments; + } + return tree; + } + + for (i = 0, len = providedComments.length; i < len; i += 1) { + comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); + } + + // This is based on John Freeman's implementation. + cursor = 0; + traverse(tree, { + enter: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (comment.extendedRange[1] > node.range[0]) { + break; + } + + if (comment.extendedRange[1] === node.range[0]) { + if (!node.leadingComments) { + node.leadingComments = []; + } + node.leadingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + cursor = 0; + traverse(tree, { + leave: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (node.range[1] < comment.extendedRange[0]) { + break; + } + + if (node.range[1] === comment.extendedRange[0]) { + if (!node.trailingComments) { + node.trailingComments = []; + } + node.trailingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + return tree; + } + + exports.Syntax = Syntax; + exports.traverse = traverse; + exports.replace = replace; + exports.attachComments = attachComments; + exports.VisitorKeys = VisitorKeys; + exports.VisitorOption = VisitorOption; + exports.Controller = Controller; + exports.cloneEnvironment = function () { return clone({}); }; + + return exports; +}(exports)); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/estraverse/gulpfile.js b/node_modules/estraverse/gulpfile.js new file mode 100644 index 0000000..8772bbc --- /dev/null +++ b/node_modules/estraverse/gulpfile.js @@ -0,0 +1,70 @@ +/* + Copyright (C) 2014 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +'use strict'; + +var gulp = require('gulp'), + git = require('gulp-git'), + bump = require('gulp-bump'), + filter = require('gulp-filter'), + tagVersion = require('gulp-tag-version'); + +var TEST = [ 'test/*.js' ]; +var POWERED = [ 'powered-test/*.js' ]; +var SOURCE = [ 'src/**/*.js' ]; + +/** + * Bumping version number and tagging the repository with it. + * Please read http://semver.org/ + * + * You can use the commands + * + * gulp patch # makes v0.1.0 -> v0.1.1 + * gulp feature # makes v0.1.1 -> v0.2.0 + * gulp release # makes v0.2.1 -> v1.0.0 + * + * To bump the version numbers accordingly after you did a patch, + * introduced a feature or made a backwards-incompatible release. + */ + +function inc(importance) { + // get all the files to bump version in + return gulp.src(['./package.json']) + // bump the version number in those files + .pipe(bump({type: importance})) + // save it back to filesystem + .pipe(gulp.dest('./')) + // commit the changed version number + .pipe(git.commit('Bumps package version')) + // read only one file to get the version number + .pipe(filter('package.json')) + // **tag it in the repository** + .pipe(tagVersion({ + prefix: '' + })); +} + +gulp.task('patch', [ ], function () { return inc('patch'); }) +gulp.task('minor', [ ], function () { return inc('minor'); }) +gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/node_modules/estraverse/package.json b/node_modules/estraverse/package.json new file mode 100644 index 0000000..a863218 --- /dev/null +++ b/node_modules/estraverse/package.json @@ -0,0 +1,40 @@ +{ + "name": "estraverse", + "description": "ECMAScript JS AST traversal functions", + "homepage": "https://github.com/estools/estraverse", + "main": "estraverse.js", + "version": "5.3.0", + "engines": { + "node": ">=4.0" + }, + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "http://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/estools/estraverse.git" + }, + "devDependencies": { + "babel-preset-env": "^1.6.1", + "babel-register": "^6.3.13", + "chai": "^2.1.1", + "espree": "^1.11.0", + "gulp": "^3.8.10", + "gulp-bump": "^0.2.2", + "gulp-filter": "^2.0.0", + "gulp-git": "^1.0.1", + "gulp-tag-version": "^1.3.0", + "jshint": "^2.5.6", + "mocha": "^2.1.0" + }, + "license": "BSD-2-Clause", + "scripts": { + "test": "npm run-script lint && npm run-script unit-test", + "lint": "jshint estraverse.js", + "unit-test": "mocha --compilers js:babel-register" + } +} diff --git a/node_modules/esutils/LICENSE.BSD b/node_modules/esutils/LICENSE.BSD new file mode 100644 index 0000000..3e580c3 --- /dev/null +++ b/node_modules/esutils/LICENSE.BSD @@ -0,0 +1,19 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esutils/README.md b/node_modules/esutils/README.md new file mode 100644 index 0000000..517526c --- /dev/null +++ b/node_modules/esutils/README.md @@ -0,0 +1,174 @@ +### esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils) +esutils ([esutils](http://github.com/estools/esutils)) is +utility box for ECMAScript language tools. + +### API + +### ast + +#### ast.isExpression(node) + +Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section +[11](https://es5.github.io/#x11). + +#### ast.isStatement(node) + +Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section +[12](https://es5.github.io/#x12). + +#### ast.isIterationStatement(node) + +Returns true if `node` is an IterationStatement as defined in ECMA262 edition +5.1 section [12.6](https://es5.github.io/#x12.6). + +#### ast.isSourceElement(node) + +Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1 +section [14](https://es5.github.io/#x14). + +#### ast.trailingStatement(node) + +Returns `Statement?` if `node` has trailing `Statement`. +```js +if (cond) + consequent; +``` +When taking this `IfStatement`, returns `consequent;` statement. + +#### ast.isProblematicIfStatement(node) + +Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code. +```js +{ + type: 'IfStatement', + consequent: { + type: 'WithStatement', + body: { + type: 'IfStatement', + consequent: {type: 'EmptyStatement'} + } + }, + alternate: {type: 'EmptyStatement'} +} +``` +The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`. + + +### code + +#### code.isDecimalDigit(code) + +Return true if provided code is decimal digit. + +#### code.isHexDigit(code) + +Return true if provided code is hexadecimal digit. + +#### code.isOctalDigit(code) + +Return true if provided code is octal digit. + +#### code.isWhiteSpace(code) + +Return true if provided code is white space. White space characters are formally defined in ECMA262. + +#### code.isLineTerminator(code) + +Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262. + +#### code.isIdentifierStart(code) + +Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262. + +#### code.isIdentifierPart(code) + +Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262. + +### keyword + +#### keyword.isKeywordES5(id, strict) + +Returns `true` if provided identifier string is a Keyword or Future Reserved Word +in ECMA262 edition 5.1. They are formally defined in ECMA262 sections +[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2), +respectively. If the `strict` flag is truthy, this function additionally checks whether +`id` is a Keyword or Future Reserved Word under strict mode. + +#### keyword.isKeywordES6(id, strict) + +Returns `true` if provided identifier string is a Keyword or Future Reserved Word +in ECMA262 edition 6. They are formally defined in ECMA262 sections +[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and +[11.6.2.2](http://ecma-international.org/ecma-262/6.0/#sec-future-reserved-words), +respectively. If the `strict` flag is truthy, this function additionally checks whether +`id` is a Keyword or Future Reserved Word under strict mode. + +#### keyword.isReservedWordES5(id, strict) + +Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1. +They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1). +If the `strict` flag is truthy, this function additionally checks whether `id` +is a Reserved Word under strict mode. + +#### keyword.isReservedWordES6(id, strict) + +Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. +They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words). +If the `strict` flag is truthy, this function additionally checks whether `id` +is a Reserved Word under strict mode. + +#### keyword.isRestrictedWord(id) + +Returns `true` if provided identifier string is one of `eval` or `arguments`. +They are restricted in strict mode code throughout ECMA262 edition 5.1 and +in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors). + +#### keyword.isIdentifierNameES5(id) + +Return true if provided identifier string is an IdentifierName as specified in +ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). + +#### keyword.isIdentifierNameES6(id) + +Return true if provided identifier string is an IdentifierName as specified in +ECMA262 edition 6 section [11.6](http://ecma-international.org/ecma-262/6.0/#sec-names-and-keywords). + +#### keyword.isIdentifierES5(id, strict) + +Return true if provided identifier string is an Identifier as specified in +ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict` +flag is truthy, this function additionally checks whether `id` is an Identifier +under strict mode. + +#### keyword.isIdentifierES6(id, strict) + +Return true if provided identifier string is an Identifier as specified in +ECMA262 edition 6 section [12.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers). +If the `strict` flag is truthy, this function additionally checks whether `id` +is an Identifier under strict mode. + +### License + +Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esutils/lib/ast.js b/node_modules/esutils/lib/ast.js new file mode 100644 index 0000000..8faadae --- /dev/null +++ b/node_modules/esutils/lib/ast.js @@ -0,0 +1,144 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + function isExpression(node) { + if (node == null) { return false; } + switch (node.type) { + case 'ArrayExpression': + case 'AssignmentExpression': + case 'BinaryExpression': + case 'CallExpression': + case 'ConditionalExpression': + case 'FunctionExpression': + case 'Identifier': + case 'Literal': + case 'LogicalExpression': + case 'MemberExpression': + case 'NewExpression': + case 'ObjectExpression': + case 'SequenceExpression': + case 'ThisExpression': + case 'UnaryExpression': + case 'UpdateExpression': + return true; + } + return false; + } + + function isIterationStatement(node) { + if (node == null) { return false; } + switch (node.type) { + case 'DoWhileStatement': + case 'ForInStatement': + case 'ForStatement': + case 'WhileStatement': + return true; + } + return false; + } + + function isStatement(node) { + if (node == null) { return false; } + switch (node.type) { + case 'BlockStatement': + case 'BreakStatement': + case 'ContinueStatement': + case 'DebuggerStatement': + case 'DoWhileStatement': + case 'EmptyStatement': + case 'ExpressionStatement': + case 'ForInStatement': + case 'ForStatement': + case 'IfStatement': + case 'LabeledStatement': + case 'ReturnStatement': + case 'SwitchStatement': + case 'ThrowStatement': + case 'TryStatement': + case 'VariableDeclaration': + case 'WhileStatement': + case 'WithStatement': + return true; + } + return false; + } + + function isSourceElement(node) { + return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; + } + + function trailingStatement(node) { + switch (node.type) { + case 'IfStatement': + if (node.alternate != null) { + return node.alternate; + } + return node.consequent; + + case 'LabeledStatement': + case 'ForStatement': + case 'ForInStatement': + case 'WhileStatement': + case 'WithStatement': + return node.body; + } + return null; + } + + function isProblematicIfStatement(node) { + var current; + + if (node.type !== 'IfStatement') { + return false; + } + if (node.alternate == null) { + return false; + } + current = node.consequent; + do { + if (current.type === 'IfStatement') { + if (current.alternate == null) { + return true; + } + } + current = trailingStatement(current); + } while (current); + + return false; + } + + module.exports = { + isExpression: isExpression, + isStatement: isStatement, + isIterationStatement: isIterationStatement, + isSourceElement: isSourceElement, + isProblematicIfStatement: isProblematicIfStatement, + + trailingStatement: trailingStatement + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esutils/lib/code.js b/node_modules/esutils/lib/code.js new file mode 100644 index 0000000..23136af --- /dev/null +++ b/node_modules/esutils/lib/code.js @@ -0,0 +1,135 @@ +/* + Copyright (C) 2013-2014 Yusuke Suzuki + Copyright (C) 2014 Ivan Nikulin + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; + + // See `tools/generate-identifier-regex.js`. + ES5Regex = { + // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, + // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + }; + + ES6Regex = { + // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, + // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + + function isDecimalDigit(ch) { + return 0x30 <= ch && ch <= 0x39; // 0..9 + } + + function isHexDigit(ch) { + return 0x30 <= ch && ch <= 0x39 || // 0..9 + 0x61 <= ch && ch <= 0x66 || // a..f + 0x41 <= ch && ch <= 0x46; // A..F + } + + function isOctalDigit(ch) { + return ch >= 0x30 && ch <= 0x37; // 0..7 + } + + // 7.2 White Space + + NON_ASCII_WHITESPACES = [ + 0x1680, + 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, + 0x202F, 0x205F, + 0x3000, + 0xFEFF + ]; + + function isWhiteSpace(ch) { + return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || + ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; + } + + // 7.3 Line Terminators + + function isLineTerminator(ch) { + return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; + } + + // 7.6 Identifier Names and Identifiers + + function fromCodePoint(cp) { + if (cp <= 0xFFFF) { return String.fromCharCode(cp); } + var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); + var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00); + return cu1 + cu2; + } + + IDENTIFIER_START = new Array(0x80); + for(ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_START[ch] = + ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + IDENTIFIER_PART = new Array(0x80); + for(ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_PART[ch] = + ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch >= 0x30 && ch <= 0x39 || // 0..9 + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + function isIdentifierStartES5(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES5(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + function isIdentifierStartES6(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES6(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + module.exports = { + isDecimalDigit: isDecimalDigit, + isHexDigit: isHexDigit, + isOctalDigit: isOctalDigit, + isWhiteSpace: isWhiteSpace, + isLineTerminator: isLineTerminator, + isIdentifierStartES5: isIdentifierStartES5, + isIdentifierPartES5: isIdentifierPartES5, + isIdentifierStartES6: isIdentifierStartES6, + isIdentifierPartES6: isIdentifierPartES6 + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esutils/lib/keyword.js b/node_modules/esutils/lib/keyword.js new file mode 100644 index 0000000..13c8c6a --- /dev/null +++ b/node_modules/esutils/lib/keyword.js @@ -0,0 +1,165 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + var code = require('./code'); + + function isStrictModeReservedWordES6(id) { + switch (id) { + case 'implements': + case 'interface': + case 'package': + case 'private': + case 'protected': + case 'public': + case 'static': + case 'let': + return true; + default: + return false; + } + } + + function isKeywordES5(id, strict) { + // yield should not be treated as keyword under non-strict mode. + if (!strict && id === 'yield') { + return false; + } + return isKeywordES6(id, strict); + } + + function isKeywordES6(id, strict) { + if (strict && isStrictModeReservedWordES6(id)) { + return true; + } + + switch (id.length) { + case 2: + return (id === 'if') || (id === 'in') || (id === 'do'); + case 3: + return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); + case 4: + return (id === 'this') || (id === 'else') || (id === 'case') || + (id === 'void') || (id === 'with') || (id === 'enum'); + case 5: + return (id === 'while') || (id === 'break') || (id === 'catch') || + (id === 'throw') || (id === 'const') || (id === 'yield') || + (id === 'class') || (id === 'super'); + case 6: + return (id === 'return') || (id === 'typeof') || (id === 'delete') || + (id === 'switch') || (id === 'export') || (id === 'import'); + case 7: + return (id === 'default') || (id === 'finally') || (id === 'extends'); + case 8: + return (id === 'function') || (id === 'continue') || (id === 'debugger'); + case 10: + return (id === 'instanceof'); + default: + return false; + } + } + + function isReservedWordES5(id, strict) { + return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); + } + + function isReservedWordES6(id, strict) { + return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); + } + + function isRestrictedWord(id) { + return id === 'eval' || id === 'arguments'; + } + + function isIdentifierNameES5(id) { + var i, iz, ch; + + if (id.length === 0) { return false; } + + ch = id.charCodeAt(0); + if (!code.isIdentifierStartES5(ch)) { + return false; + } + + for (i = 1, iz = id.length; i < iz; ++i) { + ch = id.charCodeAt(i); + if (!code.isIdentifierPartES5(ch)) { + return false; + } + } + return true; + } + + function decodeUtf16(lead, trail) { + return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + } + + function isIdentifierNameES6(id) { + var i, iz, ch, lowCh, check; + + if (id.length === 0) { return false; } + + check = code.isIdentifierStartES6; + for (i = 0, iz = id.length; i < iz; ++i) { + ch = id.charCodeAt(i); + if (0xD800 <= ch && ch <= 0xDBFF) { + ++i; + if (i >= iz) { return false; } + lowCh = id.charCodeAt(i); + if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { + return false; + } + ch = decodeUtf16(ch, lowCh); + } + if (!check(ch)) { + return false; + } + check = code.isIdentifierPartES6; + } + return true; + } + + function isIdentifierES5(id, strict) { + return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); + } + + function isIdentifierES6(id, strict) { + return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); + } + + module.exports = { + isKeywordES5: isKeywordES5, + isKeywordES6: isKeywordES6, + isReservedWordES5: isReservedWordES5, + isReservedWordES6: isReservedWordES6, + isRestrictedWord: isRestrictedWord, + isIdentifierNameES5: isIdentifierNameES5, + isIdentifierNameES6: isIdentifierNameES6, + isIdentifierES5: isIdentifierES5, + isIdentifierES6: isIdentifierES6 + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esutils/lib/utils.js b/node_modules/esutils/lib/utils.js new file mode 100644 index 0000000..ce18faa --- /dev/null +++ b/node_modules/esutils/lib/utils.js @@ -0,0 +1,33 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +(function () { + 'use strict'; + + exports.ast = require('./ast'); + exports.code = require('./code'); + exports.keyword = require('./keyword'); +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esutils/package.json b/node_modules/esutils/package.json new file mode 100644 index 0000000..8396f4c --- /dev/null +++ b/node_modules/esutils/package.json @@ -0,0 +1,44 @@ +{ + "name": "esutils", + "description": "utility box for ECMAScript language tools", + "homepage": "https://github.com/estools/esutils", + "main": "lib/utils.js", + "version": "2.0.3", + "engines": { + "node": ">=0.10.0" + }, + "directories": { + "lib": "./lib" + }, + "files": [ + "LICENSE.BSD", + "README.md", + "lib" + ], + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "http://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/estools/esutils.git" + }, + "devDependencies": { + "chai": "~1.7.2", + "coffee-script": "~1.6.3", + "jshint": "2.6.3", + "mocha": "~2.2.1", + "regenerate": "~1.3.1", + "unicode-9.0.0": "~0.7.0" + }, + "license": "BSD-2-Clause", + "scripts": { + "test": "npm run-script lint && npm run-script unit-test", + "lint": "jshint lib/*.js", + "unit-test": "mocha --compilers coffee:coffee-script -R spec", + "generate-regex": "node tools/generate-identifier-regex.js" + } +} diff --git a/node_modules/fast-deep-equal/LICENSE b/node_modules/fast-deep-equal/LICENSE new file mode 100644 index 0000000..7f15435 --- /dev/null +++ b/node_modules/fast-deep-equal/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/fast-deep-equal/README.md b/node_modules/fast-deep-equal/README.md new file mode 100644 index 0000000..d3f4ffc --- /dev/null +++ b/node_modules/fast-deep-equal/README.md @@ -0,0 +1,96 @@ +# fast-deep-equal +The fastest deep equal with ES6 Map, Set and Typed arrays support. + +[![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal) +[![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal) +[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master) + + +## Install + +```bash +npm install fast-deep-equal +``` + + +## Features + +- ES5 compatible +- works in node.js (8+) and browsers (IE9+) +- checks equality of Date and RegExp objects by value. + +ES6 equal (`require('fast-deep-equal/es6')`) also supports: +- Maps +- Sets +- Typed arrays + + +## Usage + +```javascript +var equal = require('fast-deep-equal'); +console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true +``` + +To support ES6 Maps, Sets and Typed arrays equality use: + +```javascript +var equal = require('fast-deep-equal/es6'); +console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true +``` + +To use with React (avoiding the traversal of React elements' _owner +property that contains circular references and is not needed when +comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)): + +```javascript +var equal = require('fast-deep-equal/react'); +var equal = require('fast-deep-equal/es6/react'); +``` + + +## Performance benchmark + +Node.js v12.6.0: + +``` +fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled) +fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled) +fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled) +nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled) +shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled) +underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled) +lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled) +deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled) +deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled) +ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled) +util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled) +assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled) + +The fastest is fast-deep-equal +``` + +To run benchmark (requires node.js 6+): + +```bash +npm run benchmark +``` + +__Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application. + + +## Enterprise support + +fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. + + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. + + +## License + +[MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE) diff --git a/node_modules/fast-deep-equal/es6/index.js b/node_modules/fast-deep-equal/es6/index.js new file mode 100644 index 0000000..d980be2 --- /dev/null +++ b/node_modules/fast-deep-equal/es6/index.js @@ -0,0 +1,72 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + if ((a instanceof Map) && (b instanceof Map)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + for (i of a.entries()) + if (!equal(i[1], b.get(i[0]))) return false; + return true; + } + + if ((a instanceof Set) && (b instanceof Set)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + return true; + } + + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (a[i] !== b[i]) return false; + return true; + } + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/node_modules/fast-deep-equal/es6/react.js b/node_modules/fast-deep-equal/es6/react.js new file mode 100644 index 0000000..98e2f9b --- /dev/null +++ b/node_modules/fast-deep-equal/es6/react.js @@ -0,0 +1,79 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + if ((a instanceof Map) && (b instanceof Map)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + for (i of a.entries()) + if (!equal(i[1], b.get(i[0]))) return false; + return true; + } + + if ((a instanceof Set) && (b instanceof Set)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + return true; + } + + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (a[i] !== b[i]) return false; + return true; + } + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (key === '_owner' && a.$$typeof) { + // React-specific: avoid traversing React elements' _owner. + // _owner contains circular references + // and is not needed when comparing the actual elements (and not their owners) + continue; + } + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/node_modules/fast-deep-equal/index.js b/node_modules/fast-deep-equal/index.js new file mode 100644 index 0000000..30dd1ba --- /dev/null +++ b/node_modules/fast-deep-equal/index.js @@ -0,0 +1,46 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/node_modules/fast-deep-equal/package.json b/node_modules/fast-deep-equal/package.json new file mode 100644 index 0000000..3cfe66c --- /dev/null +++ b/node_modules/fast-deep-equal/package.json @@ -0,0 +1,61 @@ +{ + "name": "fast-deep-equal", + "version": "3.1.3", + "description": "Fast deep equal", + "main": "index.js", + "scripts": { + "eslint": "eslint *.js benchmark/*.js spec/*.js", + "build": "node build", + "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./", + "test-spec": "mocha spec/*.spec.js -R spec", + "test-cov": "nyc npm run test-spec", + "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts", + "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov", + "prepublish": "npm run build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" + }, + "keywords": [ + "fast", + "equal", + "deep-equal" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/epoberezkin/fast-deep-equal/issues" + }, + "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", + "devDependencies": { + "coveralls": "^3.1.0", + "dot": "^1.1.2", + "eslint": "^7.2.0", + "mocha": "^7.2.0", + "nyc": "^15.1.0", + "pre-commit": "^1.2.2", + "react": "^16.12.0", + "react-test-renderer": "^16.12.0", + "sinon": "^9.0.2", + "typescript": "^3.9.5" + }, + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "files": [ + "index.js", + "index.d.ts", + "react.js", + "react.d.ts", + "es6/" + ], + "types": "index.d.ts" +} diff --git a/node_modules/fast-deep-equal/react.js b/node_modules/fast-deep-equal/react.js new file mode 100644 index 0000000..3489b98 --- /dev/null +++ b/node_modules/fast-deep-equal/react.js @@ -0,0 +1,53 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (key === '_owner' && a.$$typeof) { + // React-specific: avoid traversing React elements' _owner. + // _owner contains circular references + // and is not needed when comparing the actual elements (and not their owners) + continue; + } + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/node_modules/fast-glob/LICENSE b/node_modules/fast-glob/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/fast-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/fast-glob/README.md b/node_modules/fast-glob/README.md new file mode 100644 index 0000000..1d7843a --- /dev/null +++ b/node_modules/fast-glob/README.md @@ -0,0 +1,830 @@ +# fast-glob + +> It's a very fast and efficient [glob][glob_definition] library for [Node.js][node_js]. + +This package provides methods for traversing the file system and returning pathnames that matched a defined set of a specified pattern according to the rules used by the Unix Bash shell with some simplifications, meanwhile results are returned in **arbitrary order**. Quick, simple, effective. + +## Table of Contents + +
+Details + +* [Highlights](#highlights) +* [Old and modern mode](#old-and-modern-mode) +* [Pattern syntax](#pattern-syntax) + * [Basic syntax](#basic-syntax) + * [Advanced syntax](#advanced-syntax) +* [Installation](#installation) +* [API](#api) + * [Asynchronous](#asynchronous) + * [Synchronous](#synchronous) + * [Stream](#stream) + * [patterns](#patterns) + * [[options]](#options) + * [Helpers](#helpers) + * [generateTasks](#generatetaskspatterns-options) + * [isDynamicPattern](#isdynamicpatternpattern-options) + * [escapePath](#escapepathpath) + * [convertPathToPattern](#convertpathtopatternpath) +* [Options](#options-3) + * [Common](#common) + * [concurrency](#concurrency) + * [cwd](#cwd) + * [deep](#deep) + * [followSymbolicLinks](#followsymboliclinks) + * [fs](#fs) + * [ignore](#ignore) + * [suppressErrors](#suppresserrors) + * [throwErrorOnBrokenSymbolicLink](#throwerroronbrokensymboliclink) + * [Output control](#output-control) + * [absolute](#absolute) + * [markDirectories](#markdirectories) + * [objectMode](#objectmode) + * [onlyDirectories](#onlydirectories) + * [onlyFiles](#onlyfiles) + * [stats](#stats) + * [unique](#unique) + * [Matching control](#matching-control) + * [braceExpansion](#braceexpansion) + * [caseSensitiveMatch](#casesensitivematch) + * [dot](#dot) + * [extglob](#extglob) + * [globstar](#globstar) + * [baseNameMatch](#basenamematch) +* [FAQ](#faq) + * [What is a static or dynamic pattern?](#what-is-a-static-or-dynamic-pattern) + * [How to write patterns on Windows?](#how-to-write-patterns-on-windows) + * [Why are parentheses match wrong?](#why-are-parentheses-match-wrong) + * [How to exclude directory from reading?](#how-to-exclude-directory-from-reading) + * [How to use UNC path?](#how-to-use-unc-path) + * [Compatible with `node-glob`?](#compatible-with-node-glob) +* [Benchmarks](#benchmarks) + * [Server](#server) + * [Nettop](#nettop) +* [Changelog](#changelog) +* [License](#license) + +
+ +## Highlights + +* Fast. Probably the fastest. +* Supports multiple and negative patterns. +* Synchronous, Promise and Stream API. +* Object mode. Can return more than just strings. +* Error-tolerant. + +## Old and modern mode + +This package works in two modes, depending on the environment in which it is used. + +* **Old mode**. Node.js below 10.10 or when the [`stats`](#stats) option is *enabled*. +* **Modern mode**. Node.js 10.10+ and the [`stats`](#stats) option is *disabled*. + +The modern mode is faster. Learn more about the [internal mechanism][nodelib_fs_scandir_old_and_modern_modern]. + +## Pattern syntax + +> :warning: Always use forward-slashes in glob expressions (patterns and [`ignore`](#ignore) option). Use backslashes for escaping characters. + +There is more than one form of syntax: basic and advanced. Below is a brief overview of the supported features. Also pay attention to our [FAQ](#faq). + +> :book: This package uses [`micromatch`][micromatch] as a library for pattern matching. + +### Basic syntax + +* An asterisk (`*`) — matches everything except slashes (path separators), hidden files (names starting with `.`). +* A double star or globstar (`**`) — matches zero or more directories. +* Question mark (`?`) – matches any single character except slashes (path separators). +* Sequence (`[seq]`) — matches any character in sequence. + +> :book: A few additional words about the [basic matching behavior][picomatch_matching_behavior]. + +Some examples: + +* `src/**/*.js` — matches all files in the `src` directory (any level of nesting) that have the `.js` extension. +* `src/*.??` — matches all files in the `src` directory (only first level of nesting) that have a two-character extension. +* `file-[01].js` — matches files: `file-0.js`, `file-1.js`. + +### Advanced syntax + +* [Escapes characters][micromatch_backslashes] (`\\`) — matching special characters (`$^*+?()[]`) as literals. +* [POSIX character classes][picomatch_posix_brackets] (`[[:digit:]]`). +* [Extended globs][micromatch_extglobs] (`?(pattern-list)`). +* [Bash style brace expansions][micromatch_braces] (`{}`). +* [Regexp character classes][micromatch_regex_character_classes] (`[1-5]`). +* [Regex groups][regular_expressions_brackets] (`(a|b)`). + +> :book: A few additional words about the [advanced matching behavior][micromatch_extended_globbing]. + +Some examples: + +* `src/**/*.{css,scss}` — matches all files in the `src` directory (any level of nesting) that have the `.css` or `.scss` extension. +* `file-[[:digit:]].js` — matches files: `file-0.js`, `file-1.js`, …, `file-9.js`. +* `file-{1..3}.js` — matches files: `file-1.js`, `file-2.js`, `file-3.js`. +* `file-(1|2)` — matches files: `file-1.js`, `file-2.js`. + +## Installation + +```console +npm install fast-glob +``` + +## API + +### Asynchronous + +```js +fg(patterns, [options]) +fg.async(patterns, [options]) +fg.glob(patterns, [options]) +``` + +Returns a `Promise` with an array of matching entries. + +```js +const fg = require('fast-glob'); + +const entries = await fg(['.editorconfig', '**/index.js'], { dot: true }); + +// ['.editorconfig', 'services/index.js'] +``` + +### Synchronous + +```js +fg.sync(patterns, [options]) +fg.globSync(patterns, [options]) +``` + +Returns an array of matching entries. + +```js +const fg = require('fast-glob'); + +const entries = fg.sync(['.editorconfig', '**/index.js'], { dot: true }); + +// ['.editorconfig', 'services/index.js'] +``` + +### Stream + +```js +fg.stream(patterns, [options]) +fg.globStream(patterns, [options]) +``` + +Returns a [`ReadableStream`][node_js_stream_readable_streams] when the `data` event will be emitted with matching entry. + +```js +const fg = require('fast-glob'); + +const stream = fg.stream(['.editorconfig', '**/index.js'], { dot: true }); + +for await (const entry of stream) { + // .editorconfig + // services/index.js +} +``` + +#### patterns + +* Required: `true` +* Type: `string | string[]` + +Any correct pattern(s). + +> :1234: [Pattern syntax](#pattern-syntax) +> +> :warning: This package does not respect the order of patterns. First, all the negative patterns are applied, and only then the positive patterns. If you want to get a certain order of records, use sorting or split calls. + +#### [options] + +* Required: `false` +* Type: [`Options`](#options-3) + +See [Options](#options-3) section. + +### Helpers + +#### `generateTasks(patterns, [options])` + +Returns the internal representation of patterns ([`Task`](./src/managers/tasks.ts) is a combining patterns by base directory). + +```js +fg.generateTasks('*'); + +[{ + base: '.', // Parent directory for all patterns inside this task + dynamic: true, // Dynamic or static patterns are in this task + patterns: ['*'], + positive: ['*'], + negative: [] +}] +``` + +##### patterns + +* Required: `true` +* Type: `string | string[]` + +Any correct pattern(s). + +##### [options] + +* Required: `false` +* Type: [`Options`](#options-3) + +See [Options](#options-3) section. + +#### `isDynamicPattern(pattern, [options])` + +Returns `true` if the passed pattern is a dynamic pattern. + +> :1234: [What is a static or dynamic pattern?](#what-is-a-static-or-dynamic-pattern) + +```js +fg.isDynamicPattern('*'); // true +fg.isDynamicPattern('abc'); // false +``` + +##### pattern + +* Required: `true` +* Type: `string` + +Any correct pattern. + +##### [options] + +* Required: `false` +* Type: [`Options`](#options-3) + +See [Options](#options-3) section. + +#### `escapePath(path)` + +Returns the path with escaped special characters depending on the platform. + +* Posix: + * `*?|(){}[]`; + * `!` at the beginning of line; + * `@+!` before the opening parenthesis; + * `\\` before non-special characters; +* Windows: + * `(){}[]` + * `!` at the beginning of line; + * `@+!` before the opening parenthesis; + * Characters like `*?|` cannot be used in the path ([windows_naming_conventions][windows_naming_conventions]), so they will not be escaped; + +```js +fg.escapePath('!abc'); +// \\!abc +fg.escapePath('[OpenSource] mrmlnc – fast-glob (Deluxe Edition) 2014') + '/*.flac' +// \\[OpenSource\\] mrmlnc – fast-glob \\(Deluxe Edition\\) 2014/*.flac + +fg.posix.escapePath('C:\\Program Files (x86)\\**\\*'); +// C:\\\\Program Files \\(x86\\)\\*\\*\\* +fg.win32.escapePath('C:\\Program Files (x86)\\**\\*'); +// Windows: C:\\Program Files \\(x86\\)\\**\\* +``` + +#### `convertPathToPattern(path)` + +Converts a path to a pattern depending on the platform, including special character escaping. + +* Posix. Works similarly to the `fg.posix.escapePath` method. +* Windows. Works similarly to the `fg.win32.escapePath` method, additionally converting backslashes to forward slashes in cases where they are not escape characters (`!()+@{}[]`). + +```js +fg.convertPathToPattern('[OpenSource] mrmlnc – fast-glob (Deluxe Edition) 2014') + '/*.flac'; +// \\[OpenSource\\] mrmlnc – fast-glob \\(Deluxe Edition\\) 2014/*.flac + +fg.convertPathToPattern('C:/Program Files (x86)/**/*'); +// Posix: C:/Program Files \\(x86\\)/\\*\\*/\\* +// Windows: C:/Program Files \\(x86\\)/**/* + +fg.convertPathToPattern('C:\\Program Files (x86)\\**\\*'); +// Posix: C:\\\\Program Files \\(x86\\)\\*\\*\\* +// Windows: C:/Program Files \\(x86\\)/**/* + +fg.posix.convertPathToPattern('\\\\?\\c:\\Program Files (x86)') + '/**/*'; +// Posix: \\\\\\?\\\\c:\\\\Program Files \\(x86\\)/**/* (broken pattern) +fg.win32.convertPathToPattern('\\\\?\\c:\\Program Files (x86)') + '/**/*'; +// Windows: //?/c:/Program Files \\(x86\\)/**/* +``` + +## Options + +### Common options + +#### concurrency + +* Type: `number` +* Default: `os.cpus().length` + +Specifies the maximum number of concurrent requests from a reader to read directories. + +> :book: The higher the number, the higher the performance and load on the file system. If you want to read in quiet mode, set the value to a comfortable number or `1`. + +
+ +More details + +In Node, there are [two types of threads][nodejs_thread_pool]: Event Loop (code) and a Thread Pool (fs, dns, …). The thread pool size controlled by the `UV_THREADPOOL_SIZE` environment variable. Its default size is 4 ([documentation][libuv_thread_pool]). The pool is one for all tasks within a single Node process. + +Any code can make 4 real concurrent accesses to the file system. The rest of the FS requests will wait in the queue. + +> :book: Each new instance of FG in the same Node process will use the same Thread pool. + +But this package also has the `concurrency` option. This option allows you to control the number of concurrent accesses to the FS at the package level. By default, this package has a value equal to the number of cores available for the current Node process. This allows you to set a value smaller than the pool size (`concurrency: 1`) or, conversely, to prepare tasks for the pool queue more quickly (`concurrency: Number.POSITIVE_INFINITY`). + +So, in fact, this package can **only make 4 concurrent requests to the FS**. You can increase this value by using an environment variable (`UV_THREADPOOL_SIZE`), but in practice this does not give a multiple advantage. + +
+ +#### cwd + +* Type: `string` +* Default: `process.cwd()` + +The current working directory in which to search. + +#### deep + +* Type: `number` +* Default: `Infinity` + +Specifies the maximum depth of a read directory relative to the start directory. + +For example, you have the following tree: + +```js +dir/ +└── one/ // 1 + └── two/ // 2 + └── file.js // 3 +``` + +```js +// With base directory +fg.sync('dir/**', { onlyFiles: false, deep: 1 }); // ['dir/one'] +fg.sync('dir/**', { onlyFiles: false, deep: 2 }); // ['dir/one', 'dir/one/two'] + +// With cwd option +fg.sync('**', { onlyFiles: false, cwd: 'dir', deep: 1 }); // ['one'] +fg.sync('**', { onlyFiles: false, cwd: 'dir', deep: 2 }); // ['one', 'one/two'] +``` + +> :book: If you specify a pattern with some base directory, this directory will not participate in the calculation of the depth of the found directories. Think of it as a [`cwd`](#cwd) option. + +#### followSymbolicLinks + +* Type: `boolean` +* Default: `true` + +Indicates whether to traverse descendants of symbolic link directories when expanding `**` patterns. + +> :book: Note that this option does not affect the base directory of the pattern. For example, if `./a` is a symlink to directory `./b` and you specified `['./a**', './b/**']` patterns, then directory `./a` will still be read. + +> :book: If the [`stats`](#stats) option is specified, the information about the symbolic link (`fs.lstat`) will be replaced with information about the entry (`fs.stat`) behind it. + +#### fs + +* Type: `FileSystemAdapter` +* Default: `fs.*` + +Custom implementation of methods for working with the file system. Supports objects with enumerable properties only. + +```ts +export interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; + readdir?: typeof fs.readdir; + readdirSync?: typeof fs.readdirSync; +} +``` + +#### ignore + +* Type: `string[]` +* Default: `[]` + +An array of glob patterns to exclude matches. This is an alternative way to use negative patterns. + +```js +dir/ +├── package-lock.json +└── package.json +``` + +```js +fg.sync(['*.json', '!package-lock.json']); // ['package.json'] +fg.sync('*.json', { ignore: ['package-lock.json'] }); // ['package.json'] +``` + +#### suppressErrors + +* Type: `boolean` +* Default: `false` + +By default this package suppress only `ENOENT` errors. Set to `true` to suppress any error. + +> :book: Can be useful when the directory has entries with a special level of access. + +#### throwErrorOnBrokenSymbolicLink + +* Type: `boolean` +* Default: `false` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +> :book: This option has no effect on errors when reading the symbolic link directory. + +### Output control + +#### absolute + +* Type: `boolean` +* Default: `false` + +Return the absolute path for entries. + +```js +fg.sync('*.js', { absolute: false }); // ['index.js'] +fg.sync('*.js', { absolute: true }); // ['/home/user/index.js'] +``` + +> :book: This option is required if you want to use negative patterns with absolute path, for example, `!${__dirname}/*.js`. + +#### markDirectories + +* Type: `boolean` +* Default: `false` + +Mark the directory path with the final slash. + +```js +fg.sync('*', { onlyFiles: false, markDirectories: false }); // ['index.js', 'controllers'] +fg.sync('*', { onlyFiles: false, markDirectories: true }); // ['index.js', 'controllers/'] +``` + +#### objectMode + +* Type: `boolean` +* Default: `false` + +Returns objects (instead of strings) describing entries. + +```js +fg.sync('*', { objectMode: false }); // ['src/index.js'] +fg.sync('*', { objectMode: true }); // [{ name: 'index.js', path: 'src/index.js', dirent: }] +``` + +The object has the following fields: + +* name (`string`) — the last part of the path (basename) +* path (`string`) — full path relative to the pattern base directory +* dirent ([`fs.Dirent`][node_js_fs_class_fs_dirent]) — instance of `fs.Dirent` + +> :book: An object is an internal representation of entry, so getting it does not affect performance. + +#### onlyDirectories + +* Type: `boolean` +* Default: `false` + +Return only directories. + +```js +fg.sync('*', { onlyDirectories: false }); // ['index.js', 'src'] +fg.sync('*', { onlyDirectories: true }); // ['src'] +``` + +> :book: If `true`, the [`onlyFiles`](#onlyfiles) option is automatically `false`. + +#### onlyFiles + +* Type: `boolean` +* Default: `true` + +Return only files. + +```js +fg.sync('*', { onlyFiles: false }); // ['index.js', 'src'] +fg.sync('*', { onlyFiles: true }); // ['index.js'] +``` + +#### stats + +* Type: `boolean` +* Default: `false` + +Enables an [object mode](#objectmode) with an additional field: + +* stats ([`fs.Stats`][node_js_fs_class_fs_stats]) — instance of `fs.Stats` + +```js +fg.sync('*', { stats: false }); // ['src/index.js'] +fg.sync('*', { stats: true }); // [{ name: 'index.js', path: 'src/index.js', dirent: , stats: }] +``` + +> :book: Returns `fs.stat` instead of `fs.lstat` for symbolic links when the [`followSymbolicLinks`](#followsymboliclinks) option is specified. +> +> :warning: Unlike [object mode](#objectmode) this mode requires additional calls to the file system. On average, this mode is slower at least twice. See [old and modern mode](#old-and-modern-mode) for more details. + +#### unique + +* Type: `boolean` +* Default: `true` + +Ensures that the returned entries are unique. + +```js +fg.sync(['*.json', 'package.json'], { unique: false }); // ['package.json', 'package.json'] +fg.sync(['*.json', 'package.json'], { unique: true }); // ['package.json'] +``` + +If `true` and similar entries are found, the result is the first found. + +### Matching control + +#### braceExpansion + +* Type: `boolean` +* Default: `true` + +Enables Bash-like brace expansion. + +> :1234: [Syntax description][bash_hackers_syntax_expansion_brace] or more [detailed description][micromatch_braces]. + +```js +dir/ +├── abd +├── acd +└── a{b,c}d +``` + +```js +fg.sync('a{b,c}d', { braceExpansion: false }); // ['a{b,c}d'] +fg.sync('a{b,c}d', { braceExpansion: true }); // ['abd', 'acd'] +``` + +#### caseSensitiveMatch + +* Type: `boolean` +* Default: `true` + +Enables a [case-sensitive][wikipedia_case_sensitivity] mode for matching files. + +```js +dir/ +├── file.txt +└── File.txt +``` + +```js +fg.sync('file.txt', { caseSensitiveMatch: false }); // ['file.txt', 'File.txt'] +fg.sync('file.txt', { caseSensitiveMatch: true }); // ['file.txt'] +``` + +#### dot + +* Type: `boolean` +* Default: `false` + +Allow patterns to match entries that begin with a period (`.`). + +> :book: Note that an explicit dot in a portion of the pattern will always match dot files. + +```js +dir/ +├── .editorconfig +└── package.json +``` + +```js +fg.sync('*', { dot: false }); // ['package.json'] +fg.sync('*', { dot: true }); // ['.editorconfig', 'package.json'] +``` + +#### extglob + +* Type: `boolean` +* Default: `true` + +Enables Bash-like `extglob` functionality. + +> :1234: [Syntax description][micromatch_extglobs]. + +```js +dir/ +├── README.md +└── package.json +``` + +```js +fg.sync('*.+(json|md)', { extglob: false }); // [] +fg.sync('*.+(json|md)', { extglob: true }); // ['README.md', 'package.json'] +``` + +#### globstar + +* Type: `boolean` +* Default: `true` + +Enables recursively repeats a pattern containing `**`. If `false`, `**` behaves exactly like `*`. + +```js +dir/ +└── a + └── b +``` + +```js +fg.sync('**', { onlyFiles: false, globstar: false }); // ['a'] +fg.sync('**', { onlyFiles: false, globstar: true }); // ['a', 'a/b'] +``` + +#### baseNameMatch + +* Type: `boolean` +* Default: `false` + +If set to `true`, then patterns without slashes will be matched against the basename of the path if it contains slashes. + +```js +dir/ +└── one/ + └── file.md +``` + +```js +fg.sync('*.md', { baseNameMatch: false }); // [] +fg.sync('*.md', { baseNameMatch: true }); // ['one/file.md'] +``` + +## FAQ + +## What is a static or dynamic pattern? + +All patterns can be divided into two types: + +* **static**. A pattern is considered static if it can be used to get an entry on the file system without using matching mechanisms. For example, the `file.js` pattern is a static pattern because we can just verify that it exists on the file system. +* **dynamic**. A pattern is considered dynamic if it cannot be used directly to find occurrences without using a matching mechanisms. For example, the `*` pattern is a dynamic pattern because we cannot use this pattern directly. + +A pattern is considered dynamic if it contains the following characters (`…` — any characters or their absence) or options: + +* The [`caseSensitiveMatch`](#casesensitivematch) option is disabled +* `\\` (the escape character) +* `*`, `?`, `!` (at the beginning of line) +* `[…]` +* `(…|…)` +* `@(…)`, `!(…)`, `*(…)`, `?(…)`, `+(…)` (respects the [`extglob`](#extglob) option) +* `{…,…}`, `{…..…}` (respects the [`braceExpansion`](#braceexpansion) option) + +## How to write patterns on Windows? + +Always use forward-slashes in glob expressions (patterns and [`ignore`](#ignore) option). Use backslashes for escaping characters. With the [`cwd`](#cwd) option use a convenient format. + +**Bad** + +```ts +[ + 'directory\\*', + path.join(process.cwd(), '**') +] +``` + +**Good** + +```ts +[ + 'directory/*', + fg.convertPathToPattern(process.cwd()) + '/**' +] +``` + +> :book: Use the [`.convertPathToPattern`](#convertpathtopatternpath) package to convert Windows-style path to a Unix-style path. + +Read more about [matching with backslashes][micromatch_backslashes]. + +## Why are parentheses match wrong? + +```js +dir/ +└── (special-*file).txt +``` + +```js +fg.sync(['(special-*file).txt']) // [] +``` + +Refers to Bash. You need to escape special characters: + +```js +fg.sync(['\\(special-*file\\).txt']) // ['(special-*file).txt'] +``` + +Read more about [matching special characters as literals][picomatch_matching_special_characters_as_literals]. Or use the [`.escapePath`](#escapepathpath). + +## How to exclude directory from reading? + +You can use a negative pattern like this: `!**/node_modules` or `!**/node_modules/**`. Also you can use [`ignore`](#ignore) option. Just look at the example below. + +```js +first/ +├── file.md +└── second/ + └── file.txt +``` + +If you don't want to read the `second` directory, you must write the following pattern: `!**/second` or `!**/second/**`. + +```js +fg.sync(['**/*.md', '!**/second']); // ['first/file.md'] +fg.sync(['**/*.md'], { ignore: ['**/second/**'] }); // ['first/file.md'] +``` + +> :warning: When you write `!**/second/**/*` it means that the directory will be **read**, but all the entries will not be included in the results. + +You have to understand that if you write the pattern to exclude directories, then the directory will not be read under any circumstances. + +## How to use UNC path? + +You cannot use [Uniform Naming Convention (UNC)][unc_path] paths as patterns (due to syntax) directly, but you can use them as [`cwd`](#cwd) directory or use the `fg.convertPathToPattern` method. + +```ts +// cwd +fg.sync('*', { cwd: '\\\\?\\C:\\Python27' /* or //?/C:/Python27 */ }); +fg.sync('Python27/*', { cwd: '\\\\?\\C:\\' /* or //?/C:/ */ }); + +// .convertPathToPattern +fg.sync(fg.convertPathToPattern('\\\\?\\c:\\Python27') + '/*'); +``` + +## Compatible with `node-glob`? + +| node-glob | fast-glob | +| :----------: | :-------: | +| `cwd` | [`cwd`](#cwd) | +| `root` | – | +| `dot` | [`dot`](#dot) | +| `nomount` | – | +| `mark` | [`markDirectories`](#markdirectories) | +| `nosort` | – | +| `nounique` | [`unique`](#unique) | +| `nobrace` | [`braceExpansion`](#braceexpansion) | +| `noglobstar` | [`globstar`](#globstar) | +| `noext` | [`extglob`](#extglob) | +| `nocase` | [`caseSensitiveMatch`](#casesensitivematch) | +| `matchBase` | [`baseNameMatch`](#basenamematch) | +| `nodir` | [`onlyFiles`](#onlyfiles) | +| `ignore` | [`ignore`](#ignore) | +| `follow` | [`followSymbolicLinks`](#followsymboliclinks) | +| `realpath` | – | +| `absolute` | [`absolute`](#absolute) | + +## Benchmarks + +You can see results [here](https://github.com/mrmlnc/fast-glob/actions/workflows/benchmark.yml?query=branch%3Amaster) for every commit into the `main` branch. + +* **Product benchmark** – comparison with the main competitors. +* **Regress benchmark** – regression between the current version and the version from the npm registry. + +## Changelog + +See the [Releases section of our GitHub project][github_releases] for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. + +[bash_hackers_syntax_expansion_brace]: https://wiki.bash-hackers.org/syntax/expansion/brace +[github_releases]: https://github.com/mrmlnc/fast-glob/releases +[glob_definition]: https://en.wikipedia.org/wiki/Glob_(programming) +[glob_linux_man]: http://man7.org/linux/man-pages/man3/glob.3.html +[micromatch_backslashes]: https://github.com/micromatch/micromatch#backslashes +[micromatch_braces]: https://github.com/micromatch/braces +[micromatch_extended_globbing]: https://github.com/micromatch/micromatch#extended-globbing +[micromatch_extglobs]: https://github.com/micromatch/micromatch#extglobs +[micromatch_regex_character_classes]: https://github.com/micromatch/micromatch#regex-character-classes +[micromatch]: https://github.com/micromatch/micromatch +[node_js_fs_class_fs_dirent]: https://nodejs.org/api/fs.html#fs_class_fs_dirent +[node_js_fs_class_fs_stats]: https://nodejs.org/api/fs.html#fs_class_fs_stats +[node_js_stream_readable_streams]: https://nodejs.org/api/stream.html#stream_readable_streams +[node_js]: https://nodejs.org/en +[nodelib_fs_scandir_old_and_modern_modern]: https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode +[npm_normalize_path]: https://www.npmjs.com/package/normalize-path +[npm_unixify]: https://www.npmjs.com/package/unixify +[picomatch_matching_behavior]: https://github.com/micromatch/picomatch#matching-behavior-vs-bash +[picomatch_matching_special_characters_as_literals]: https://github.com/micromatch/picomatch#matching-special-characters-as-literals +[picomatch_posix_brackets]: https://github.com/micromatch/picomatch#posix-brackets +[regular_expressions_brackets]: https://www.regular-expressions.info/brackets.html +[unc_path]: https://learn.microsoft.com/openspecs/windows_protocols/ms-dtyp/62e862f4-2a51-452e-8eeb-dc4ff5ee33cc +[wikipedia_case_sensitivity]: https://en.wikipedia.org/wiki/Case_sensitivity +[nodejs_thread_pool]: https://nodejs.org/en/docs/guides/dont-block-the-event-loop +[libuv_thread_pool]: http://docs.libuv.org/en/v1.x/threadpool.html +[windows_naming_conventions]: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions diff --git a/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md b/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md new file mode 100644 index 0000000..fb9de96 --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md @@ -0,0 +1,110 @@ +### [5.1.2](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2) (2021-03-06) + + +### Bug Fixes + +* eliminate ReDoS ([#36](https://github.com/gulpjs/glob-parent/issues/36)) ([f923116](https://github.com/gulpjs/glob-parent/commit/f9231168b0041fea3f8f954b3cceb56269fc6366)) + +### [5.1.1](https://github.com/gulpjs/glob-parent/compare/v5.1.0...v5.1.1) (2021-01-27) + + +### Bug Fixes + +* unescape exclamation mark ([#26](https://github.com/gulpjs/glob-parent/issues/26)) ([a98874f](https://github.com/gulpjs/glob-parent/commit/a98874f1a59e407f4fb1beb0db4efa8392da60bb)) + +## [5.1.0](https://github.com/gulpjs/glob-parent/compare/v5.0.0...v5.1.0) (2021-01-27) + + +### Features + +* add `flipBackslashes` option to disable auto conversion of slashes (closes [#24](https://github.com/gulpjs/glob-parent/issues/24)) ([#25](https://github.com/gulpjs/glob-parent/issues/25)) ([eecf91d](https://github.com/gulpjs/glob-parent/commit/eecf91d5e3834ed78aee39c4eaaae654d76b87b3)) + +## [5.0.0](https://github.com/gulpjs/glob-parent/compare/v4.0.0...v5.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* Drop support for node <6 & bump dependencies + +### Miscellaneous Chores + +* Drop support for node <6 & bump dependencies ([896c0c0](https://github.com/gulpjs/glob-parent/commit/896c0c00b4e7362f60b96e7fc295ae929245255a)) + +## [4.0.0](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v4.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* question marks are valid path characters on Windows so avoid flagging as a glob when alone +* Update is-glob dependency + +### Features + +* hoist regexps and strings for performance gains ([4a80667](https://github.com/gulpjs/glob-parent/commit/4a80667c69355c76a572a5892b0f133c8e1f457e)) +* question marks are valid path characters on Windows so avoid flagging as a glob when alone ([2a551dd](https://github.com/gulpjs/glob-parent/commit/2a551dd0dc3235e78bf3c94843d4107072d17841)) +* Update is-glob dependency ([e41fcd8](https://github.com/gulpjs/glob-parent/commit/e41fcd895d1f7bc617dba45c9d935a7949b9c281)) + +## [3.1.0](https://github.com/gulpjs/glob-parent/compare/v3.0.1...v3.1.0) (2021-01-27) + + +### Features + +* allow basic win32 backslash use ([272afa5](https://github.com/gulpjs/glob-parent/commit/272afa5fd070fc0f796386a5993d4ee4a846988b)) +* handle extglobs (parentheses) containing separators ([7db1bdb](https://github.com/gulpjs/glob-parent/commit/7db1bdb0756e55fd14619e8ce31aa31b17b117fd)) +* new approach to braces/brackets handling ([8269bd8](https://github.com/gulpjs/glob-parent/commit/8269bd89290d99fac9395a354fb56fdcdb80f0be)) +* pre-process braces/brackets sections ([9ef8a87](https://github.com/gulpjs/glob-parent/commit/9ef8a87f66b1a43d0591e7a8e4fc5a18415ee388)) +* preserve escaped brace/bracket at end of string ([8cfb0ba](https://github.com/gulpjs/glob-parent/commit/8cfb0ba84202d51571340dcbaf61b79d16a26c76)) + + +### Bug Fixes + +* trailing escaped square brackets ([99ec9fe](https://github.com/gulpjs/glob-parent/commit/99ec9fecc60ee488ded20a94dd4f18b4f55c4ccf)) + +### [3.0.1](https://github.com/gulpjs/glob-parent/compare/v3.0.0...v3.0.1) (2021-01-27) + + +### Features + +* use path-dirname ponyfill ([cdbea5f](https://github.com/gulpjs/glob-parent/commit/cdbea5f32a58a54e001a75ddd7c0fccd4776aacc)) + + +### Bug Fixes + +* unescape glob-escaped dirnames on output ([598c533](https://github.com/gulpjs/glob-parent/commit/598c533bdf49c1428bc063aa9b8db40c5a86b030)) + +## [3.0.0](https://github.com/gulpjs/glob-parent/compare/v2.0.0...v3.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* update is-glob dependency + +### Features + +* update is-glob dependency ([5c5f8ef](https://github.com/gulpjs/glob-parent/commit/5c5f8efcee362a8e7638cf8220666acd8784f6bd)) + +## [2.0.0](https://github.com/gulpjs/glob-parent/compare/v1.3.0...v2.0.0) (2021-01-27) + + +### Features + +* move up to dirname regardless of glob characters ([f97fb83](https://github.com/gulpjs/glob-parent/commit/f97fb83be2e0a9fc8d3b760e789d2ecadd6aa0c2)) + +## [1.3.0](https://github.com/gulpjs/glob-parent/compare/v1.2.0...v1.3.0) (2021-01-27) + +## [1.2.0](https://github.com/gulpjs/glob-parent/compare/v1.1.0...v1.2.0) (2021-01-27) + + +### Reverts + +* feat: make regex test strings smaller ([dc80fa9](https://github.com/gulpjs/glob-parent/commit/dc80fa9658dca20549cfeba44bbd37d5246fcce0)) + +## [1.1.0](https://github.com/gulpjs/glob-parent/compare/v1.0.0...v1.1.0) (2021-01-27) + + +### Features + +* make regex test strings smaller ([cd83220](https://github.com/gulpjs/glob-parent/commit/cd832208638f45169f986d80fcf66e401f35d233)) + +## 1.0.0 (2021-01-27) + diff --git a/node_modules/fast-glob/node_modules/glob-parent/LICENSE b/node_modules/fast-glob/node_modules/glob-parent/LICENSE new file mode 100644 index 0000000..63222d7 --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015, 2019 Elan Shanker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fast-glob/node_modules/glob-parent/README.md b/node_modules/fast-glob/node_modules/glob-parent/README.md new file mode 100644 index 0000000..36a2793 --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/README.md @@ -0,0 +1,137 @@ +

+ + + +

+ +# glob-parent + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Extract the non-magic parent path from a glob string. + +## Usage + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## API + +### `globParent(maybeGlobString, [options])` + +Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. + +#### options + +```js +{ + // Disables the automatic conversion of slashes for Windows + flipBackslashes: true +} +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) unless used as a path segment alone +- `*` (asterisk) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/') // 'foo' +globParent('foo/\\[bar]/') // 'foo/[bar]' +``` + +## Limitations + +### Braces & Brackets +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +### Windows +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]') // 'foo ' +globParent('foo \\[bar]*') // 'foo ' + +// GOOD +globParent('./foo \\[bar]') // 'foo [bar]' +globParent('./foo \\[bar]*') // '.' +``` + +## License + +ISC + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets + +[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg +[npm-url]: https://www.npmjs.com/package/glob-parent +[npm-image]: https://img.shields.io/npm/v/glob-parent.svg + +[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master +[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master + +[travis-url]: https://travis-ci.org/gulpjs/glob-parent +[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/fast-glob/node_modules/glob-parent/index.js b/node_modules/fast-glob/node_modules/glob-parent/index.js new file mode 100644 index 0000000..09e257e --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/index.js @@ -0,0 +1,42 @@ +'use strict'; + +var isGlob = require('is-glob'); +var pathPosixDirname = require('path').posix.dirname; +var isWin32 = require('os').platform() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; diff --git a/node_modules/fast-glob/node_modules/glob-parent/package.json b/node_modules/fast-glob/node_modules/glob-parent/package.json new file mode 100644 index 0000000..125c971 --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/package.json @@ -0,0 +1,48 @@ +{ + "name": "glob-parent", + "version": "5.1.2", + "description": "Extract the non-magic parent path from a glob string.", + "author": "Gulp Team (https://gulpjs.com/)", + "contributors": [ + "Elan Shanker (https://github.com/es128)", + "Blaine Bublitz " + ], + "repository": "gulpjs/glob-parent", + "license": "ISC", + "engines": { + "node": ">= 6" + }, + "main": "index.js", + "files": [ + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only", + "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "dependencies": { + "is-glob": "^4.0.1" + }, + "devDependencies": { + "coveralls": "^3.0.11", + "eslint": "^2.13.1", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "mocha": "^6.0.2", + "nyc": "^13.3.0" + }, + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ] +} diff --git a/node_modules/fast-glob/package.json b/node_modules/fast-glob/package.json new file mode 100644 index 0000000..e910de9 --- /dev/null +++ b/node_modules/fast-glob/package.json @@ -0,0 +1,81 @@ +{ + "name": "fast-glob", + "version": "3.3.3", + "description": "It's a very fast and efficient glob library for Node.js", + "license": "MIT", + "repository": "mrmlnc/fast-glob", + "author": { + "name": "Denis Malinochkin", + "url": "https://mrmlnc.com" + }, + "engines": { + "node": ">=8.6.0" + }, + "main": "out/index.js", + "typings": "out/index.d.ts", + "files": [ + "out", + "!out/{benchmark,tests}", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "keywords": [ + "glob", + "patterns", + "fast", + "implementation" + ], + "devDependencies": { + "@nodelib/fs.macchiato": "^1.0.1", + "@types/glob-parent": "^5.1.0", + "@types/merge2": "^1.1.4", + "@types/micromatch": "^4.0.0", + "@types/mocha": "^5.2.7", + "@types/node": "^14.18.53", + "@types/picomatch": "^2.3.0", + "@types/sinon": "^7.5.0", + "bencho": "^0.1.1", + "eslint": "^6.5.1", + "eslint-config-mrmlnc": "^1.1.0", + "execa": "^7.1.1", + "fast-glob": "^3.0.4", + "fdir": "6.0.1", + "glob": "^10.0.0", + "hereby": "^1.8.1", + "mocha": "^6.2.1", + "rimraf": "^5.0.0", + "sinon": "^7.5.0", + "snap-shot-it": "^7.9.10", + "typescript": "^4.9.5" + }, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "scripts": { + "clean": "rimraf out", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "test:e2e": "mocha \"out/**/*.e2e.js\" -s 0", + "test:e2e:sync": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(sync\\)\"", + "test:e2e:async": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(async\\)\"", + "test:e2e:stream": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(stream\\)\"", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile -- -- --sourceMap --watch", + "bench:async": "npm run bench:product:async && npm run bench:regression:async", + "bench:stream": "npm run bench:product:stream && npm run bench:regression:stream", + "bench:sync": "npm run bench:product:sync && npm run bench:regression:sync", + "bench:product": "npm run bench:product:async && npm run bench:product:sync && npm run bench:product:stream", + "bench:product:async": "hereby bench:product:async", + "bench:product:sync": "hereby bench:product:sync", + "bench:product:stream": "hereby bench:product:stream", + "bench:regression": "npm run bench:regression:async && npm run bench:regression:sync && npm run bench:regression:stream", + "bench:regression:async": "hereby bench:regression:async", + "bench:regression:sync": "hereby bench:regression:sync", + "bench:regression:stream": "hereby bench:regression:stream" + } +} diff --git a/node_modules/fast-json-stable-stringify/LICENSE b/node_modules/fast-json-stable-stringify/LICENSE new file mode 100644 index 0000000..c932223 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/LICENSE @@ -0,0 +1,21 @@ +This software is released under the MIT license: + +Copyright (c) 2017 Evgeny Poberezkin +Copyright (c) 2013 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fast-json-stable-stringify/README.md b/node_modules/fast-json-stable-stringify/README.md new file mode 100644 index 0000000..02cf49f --- /dev/null +++ b/node_modules/fast-json-stable-stringify/README.md @@ -0,0 +1,131 @@ +# fast-json-stable-stringify + +Deterministic `JSON.stringify()` - a faster version of [@substack](https://github.com/substack)'s json-stable-strigify without [jsonify](https://github.com/substack/jsonify). + +You can also pass in a custom comparison function. + +[![Build Status](https://travis-ci.org/epoberezkin/fast-json-stable-stringify.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-json-stable-stringify) +[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-json-stable-stringify/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-json-stable-stringify?branch=master) + +# example + +``` js +var stringify = require('fast-json-stable-stringify'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); +``` + +output: + +``` +{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} +``` + + +# methods + +``` js +var stringify = require('fast-json-stable-stringify') +``` + +## var str = stringify(obj, opts) + +Return a deterministic stringified string `str` from the object `obj`. + + +## options + +### cmp + +If `opts` is given, you can supply an `opts.cmp` to have a custom comparison +function for object keys. Your function `opts.cmp` is called with these +parameters: + +``` js +opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) +``` + +For example, to sort on the object key names in reverse order you could write: + +``` js +var stringify = require('fast-json-stable-stringify'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); +``` + +which results in the output string: + +``` +{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} +``` + +Or if you wanted to sort on the object values in reverse order, you could write: + +``` +var stringify = require('fast-json-stable-stringify'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); +``` + +which outputs: + +``` +{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} +``` + +### cycles + +Pass `true` in `opts.cycles` to stringify circular property as `__cycle__` - the result will not be a valid JSON string in this case. + +TypeError will be thrown in case of circular object without this option. + + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install fast-json-stable-stringify +``` + + +# benchmark + +To run benchmark (requires Node.js 6+): +``` +node benchmark +``` + +Results: +``` +fast-json-stable-stringify x 17,189 ops/sec ±1.43% (83 runs sampled) +json-stable-stringify x 13,634 ops/sec ±1.39% (85 runs sampled) +fast-stable-stringify x 20,212 ops/sec ±1.20% (84 runs sampled) +faster-stable-stringify x 15,549 ops/sec ±1.12% (84 runs sampled) +The fastest is fast-stable-stringify +``` + + +## Enterprise support + +fast-json-stable-stringify package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-json-stable-stringify?utm_source=npm-fast-json-stable-stringify&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. + + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. + + +# license + +[MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE) diff --git a/node_modules/fast-json-stable-stringify/benchmark/index.js b/node_modules/fast-json-stable-stringify/benchmark/index.js new file mode 100644 index 0000000..e725f9f --- /dev/null +++ b/node_modules/fast-json-stable-stringify/benchmark/index.js @@ -0,0 +1,31 @@ +'use strict'; + +const Benchmark = require('benchmark'); +const suite = new Benchmark.Suite; +const testData = require('./test.json'); + + +const stringifyPackages = { + // 'JSON.stringify': JSON.stringify, + 'fast-json-stable-stringify': require('../index'), + 'json-stable-stringify': true, + 'fast-stable-stringify': true, + 'faster-stable-stringify': true +}; + + +for (const name in stringifyPackages) { + let func = stringifyPackages[name]; + if (func === true) func = require(name); + + suite.add(name, function() { + func(testData); + }); +} + +suite + .on('cycle', (event) => console.log(String(event.target))) + .on('complete', function () { + console.log('The fastest is ' + this.filter('fastest').map('name')); + }) + .run({async: true}); diff --git a/node_modules/fast-json-stable-stringify/benchmark/test.json b/node_modules/fast-json-stable-stringify/benchmark/test.json new file mode 100644 index 0000000..c9118c1 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/benchmark/test.json @@ -0,0 +1,137 @@ +[ + { + "_id": "59ef4a83ee8364808d761beb", + "index": 0, + "guid": "e50ffae9-7128-4148-9ee5-40c3fc523c5d", + "isActive": false, + "balance": "$2,341.81", + "picture": "http://placehold.it/32x32", + "age": 28, + "eyeColor": "brown", + "name": "Carey Savage", + "gender": "female", + "company": "VERAQ", + "email": "careysavage@veraq.com", + "phone": "+1 (897) 574-3014", + "address": "458 Willow Street, Henrietta, California, 7234", + "about": "Nisi reprehenderit nulla ad officia pariatur non dolore laboris irure cupidatat laborum. Minim eu ex Lorem adipisicing exercitation irure minim sunt est enim mollit incididunt voluptate nulla. Ut mollit anim reprehenderit et aliqua ex esse aliquip. Aute sit duis deserunt do incididunt consequat minim qui dolor commodo deserunt et voluptate.\r\n", + "registered": "2014-05-21T01:56:51 -01:00", + "latitude": 63.89502, + "longitude": 62.369807, + "tags": [ + "nostrud", + "nisi", + "consectetur", + "ullamco", + "cupidatat", + "culpa", + "commodo" + ], + "friends": [ + { + "id": 0, + "name": "Henry Walls" + }, + { + "id": 1, + "name": "Janice Baker" + }, + { + "id": 2, + "name": "Russell Bush" + } + ], + "greeting": "Hello, Carey Savage! You have 4 unread messages.", + "favoriteFruit": "banana" + }, + { + "_id": "59ef4a83ff5774a691454e89", + "index": 1, + "guid": "2bee9efc-4095-4c2e-87ef-d08c8054c89d", + "isActive": true, + "balance": "$1,618.15", + "picture": "http://placehold.it/32x32", + "age": 35, + "eyeColor": "blue", + "name": "Elinor Pearson", + "gender": "female", + "company": "FLEXIGEN", + "email": "elinorpearson@flexigen.com", + "phone": "+1 (923) 548-3751", + "address": "600 Bayview Avenue, Draper, Montana, 3088", + "about": "Mollit commodo ea sit Lorem velit. Irure anim esse Lorem sint quis officia ut. Aliqua nisi dolore in aute deserunt mollit ex ea in mollit.\r\n", + "registered": "2017-04-22T07:58:41 -01:00", + "latitude": -87.824919, + "longitude": 69.538927, + "tags": [ + "fugiat", + "labore", + "proident", + "quis", + "eiusmod", + "qui", + "est" + ], + "friends": [ + { + "id": 0, + "name": "Massey Wagner" + }, + { + "id": 1, + "name": "Marcella Ferrell" + }, + { + "id": 2, + "name": "Evans Mckee" + } + ], + "greeting": "Hello, Elinor Pearson! You have 3 unread messages.", + "favoriteFruit": "strawberry" + }, + { + "_id": "59ef4a839ec8a4be4430b36b", + "index": 2, + "guid": "ddd6e8c0-95bd-416d-8b46-a768d6363809", + "isActive": false, + "balance": "$2,046.95", + "picture": "http://placehold.it/32x32", + "age": 40, + "eyeColor": "green", + "name": "Irwin Davidson", + "gender": "male", + "company": "DANJA", + "email": "irwindavidson@danja.com", + "phone": "+1 (883) 537-2041", + "address": "439 Cook Street, Chapin, Kentucky, 7398", + "about": "Irure velit non commodo aliqua exercitation ut nostrud minim magna. Dolor ad ad ut irure eu. Non pariatur dolor eiusmod ipsum do et exercitation cillum. Et amet laboris minim eiusmod ullamco magna ea reprehenderit proident sunt.\r\n", + "registered": "2016-09-01T07:49:08 -01:00", + "latitude": -49.803812, + "longitude": 104.93279, + "tags": [ + "consequat", + "enim", + "quis", + "magna", + "est", + "culpa", + "tempor" + ], + "friends": [ + { + "id": 0, + "name": "Ruth Hansen" + }, + { + "id": 1, + "name": "Kathrine Austin" + }, + { + "id": 2, + "name": "Rivera Munoz" + } + ], + "greeting": "Hello, Irwin Davidson! You have 2 unread messages.", + "favoriteFruit": "banana" + } +] diff --git a/node_modules/fast-json-stable-stringify/example/key_cmp.js b/node_modules/fast-json-stable-stringify/example/key_cmp.js new file mode 100644 index 0000000..d5f6675 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/key_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/fast-json-stable-stringify/example/nested.js b/node_modules/fast-json-stable-stringify/example/nested.js new file mode 100644 index 0000000..9a672fc --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/nested.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/fast-json-stable-stringify/example/str.js b/node_modules/fast-json-stable-stringify/example/str.js new file mode 100644 index 0000000..9b4b3cd --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/str.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 6, b: [4,5], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/fast-json-stable-stringify/example/value_cmp.js b/node_modules/fast-json-stable-stringify/example/value_cmp.js new file mode 100644 index 0000000..09f1c5f --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/value_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/fast-json-stable-stringify/index.js b/node_modules/fast-json-stable-stringify/index.js new file mode 100644 index 0000000..c44e6a4 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/index.js @@ -0,0 +1,59 @@ +'use strict'; + +module.exports = function (data, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (node) { + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + if (node === undefined) return; + if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; + if (typeof node !== 'object') return JSON.stringify(node); + + var i, out; + if (Array.isArray(node)) { + out = '['; + for (i = 0; i < node.length; i++) { + if (i) out += ','; + out += stringify(node[i]) || 'null'; + } + return out + ']'; + } + + if (node === null) return 'null'; + + if (seen.indexOf(node) !== -1) { + if (cycles) return JSON.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + + var seenIndex = seen.push(node) - 1; + var keys = Object.keys(node).sort(cmp && cmp(node)); + out = ''; + for (i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node[key]); + + if (!value) continue; + if (out) out += ','; + out += JSON.stringify(key) + ':' + value; + } + seen.splice(seenIndex, 1); + return '{' + out + '}'; + })(data); +}; diff --git a/node_modules/fast-json-stable-stringify/package.json b/node_modules/fast-json-stable-stringify/package.json new file mode 100644 index 0000000..ad2c8bf --- /dev/null +++ b/node_modules/fast-json-stable-stringify/package.json @@ -0,0 +1,52 @@ +{ + "name": "fast-json-stable-stringify", + "version": "2.1.0", + "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify", + "main": "index.js", + "types": "index.d.ts", + "dependencies": {}, + "devDependencies": { + "benchmark": "^2.1.4", + "coveralls": "^3.0.0", + "eslint": "^6.7.0", + "fast-stable-stringify": "latest", + "faster-stable-stringify": "latest", + "json-stable-stringify": "latest", + "nyc": "^14.1.0", + "pre-commit": "^1.2.2", + "tape": "^4.11.0" + }, + "scripts": { + "eslint": "eslint index.js test", + "test-spec": "tape test/*.js", + "test": "npm run eslint && nyc npm run test-spec" + }, + "repository": { + "type": "git", + "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git" + }, + "homepage": "https://github.com/epoberezkin/fast-json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "stable" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "nyc": { + "exclude": [ + "test", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + } +} diff --git a/node_modules/fast-json-stable-stringify/test/cmp.js b/node_modules/fast-json-stable-stringify/test/cmp.js new file mode 100644 index 0000000..4efd6b5 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/cmp.js @@ -0,0 +1,13 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('custom comparison function', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; + }); + t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/nested.js b/node_modules/fast-json-stable-stringify/test/nested.js new file mode 100644 index 0000000..167a358 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/nested.js @@ -0,0 +1,44 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('nested', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); +}); + +test('cyclic (default)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + try { + stringify(one); + } catch (ex) { + t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); + } +}); + +test('cyclic (specifically allowed)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); +}); + +test('repeated non-cyclic value', function(t) { + t.plan(1); + var one = { x: 1 }; + var two = { a: one, b: one }; + t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); +}); + +test('acyclic but with reused obj-property pointers', function (t) { + t.plan(1); + var x = { a: 1 }; + var y = { b: x, c: x }; + t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/str.js b/node_modules/fast-json-stable-stringify/test/str.js new file mode 100644 index 0000000..99a9ade --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/str.js @@ -0,0 +1,46 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('simple object', function (t) { + t.plan(1); + var obj = { c: 6, b: [4,5], a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); +}); + +test('object with undefined', function (t) { + t.plan(1); + var obj = { a: 3, z: undefined }; + t.equal(stringify(obj), '{"a":3}'); +}); + +test('object with null', function (t) { + t.plan(1); + var obj = { a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"z":null}'); +}); + +test('object with NaN and Infinity', function (t) { + t.plan(1); + var obj = { a: 3, b: NaN, c: Infinity }; + t.equal(stringify(obj), '{"a":3,"b":null,"c":null}'); +}); + +test('array with undefined', function (t) { + t.plan(1); + var obj = [4, undefined, 6]; + t.equal(stringify(obj), '[4,null,6]'); +}); + +test('object with empty string', function (t) { + t.plan(1); + var obj = { a: 3, z: '' }; + t.equal(stringify(obj), '{"a":3,"z":""}'); +}); + +test('array with empty string', function (t) { + t.plan(1); + var obj = [4, '', 6]; + t.equal(stringify(obj), '[4,"",6]'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/to-json.js b/node_modules/fast-json-stable-stringify/test/to-json.js new file mode 100644 index 0000000..2fb2cfa --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/to-json.js @@ -0,0 +1,22 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('toJSON function', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; + t.equal(stringify(obj), '{"one":1}' ); +}); + +test('toJSON returns string', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; + t.equal(stringify(obj), '"one"'); +}); + +test('toJSON returns array', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; + t.equal(stringify(obj), '["one"]'); +}); diff --git a/node_modules/fast-levenshtein/LICENSE.md b/node_modules/fast-levenshtein/LICENSE.md new file mode 100644 index 0000000..6212406 --- /dev/null +++ b/node_modules/fast-levenshtein/LICENSE.md @@ -0,0 +1,25 @@ +(MIT License) + +Copyright (c) 2013 [Ramesh Nair](http://www.hiddentao.com/) + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/fast-levenshtein/README.md b/node_modules/fast-levenshtein/README.md new file mode 100644 index 0000000..a778995 --- /dev/null +++ b/node_modules/fast-levenshtein/README.md @@ -0,0 +1,104 @@ +# fast-levenshtein - Levenshtein algorithm in Javascript + +[![Build Status](https://secure.travis-ci.org/hiddentao/fast-levenshtein.png)](http://travis-ci.org/hiddentao/fast-levenshtein) +[![NPM module](https://badge.fury.io/js/fast-levenshtein.png)](https://badge.fury.io/js/fast-levenshtein) +[![NPM downloads](https://img.shields.io/npm/dm/fast-levenshtein.svg?maxAge=2592000)](https://www.npmjs.com/package/fast-levenshtein) +[![Follow on Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/hiddentao) + +An efficient Javascript implementation of the [Levenshtein algorithm](http://en.wikipedia.org/wiki/Levenshtein_distance) with locale-specific collator support. + +## Features + +* Works in node.js and in the browser. +* Better performance than other implementations by not needing to store the whole matrix ([more info](http://www.codeproject.com/Articles/13525/Fast-memory-efficient-Levenshtein-algorithm)). +* Locale-sensitive string comparisions if needed. +* Comprehensive test suite and performance benchmark. +* Small: <1 KB minified and gzipped + +## Installation + +### node.js + +Install using [npm](http://npmjs.org/): + +```bash +$ npm install fast-levenshtein +``` + +### Browser + +Using bower: + +```bash +$ bower install fast-levenshtein +``` + +If you are not using any module loader system then the API will then be accessible via the `window.Levenshtein` object. + +## Examples + +**Default usage** + +```javascript +var levenshtein = require('fast-levenshtein'); + +var distance = levenshtein.get('back', 'book'); // 2 +var distance = levenshtein.get('我愛你', '我叫你'); // 1 +``` + +**Locale-sensitive string comparisons** + +It supports using [Intl.Collator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator) for locale-sensitive string comparisons: + +```javascript +var levenshtein = require('fast-levenshtein'); + +levenshtein.get('mikailovitch', 'Mikhaïlovitch', { useCollator: true}); +// 1 +``` + +## Building and Testing + +To build the code and run the tests: + +```bash +$ npm install -g grunt-cli +$ npm install +$ npm run build +``` + +## Performance + +_Thanks to [Titus Wormer](https://github.com/wooorm) for [encouraging me](https://github.com/hiddentao/fast-levenshtein/issues/1) to do this._ + +Benchmarked against other node.js levenshtein distance modules (on Macbook Air 2012, Core i7, 8GB RAM): + +```bash +Running suite Implementation comparison [benchmark/speed.js]... +>> levenshtein-edit-distance x 234 ops/sec ±3.02% (73 runs sampled) +>> levenshtein-component x 422 ops/sec ±4.38% (83 runs sampled) +>> levenshtein-deltas x 283 ops/sec ±3.83% (78 runs sampled) +>> natural x 255 ops/sec ±0.76% (88 runs sampled) +>> levenshtein x 180 ops/sec ±3.55% (86 runs sampled) +>> fast-levenshtein x 1,792 ops/sec ±2.72% (95 runs sampled) +Benchmark done. +Fastest test is fast-levenshtein at 4.2x faster than levenshtein-component +``` + +You can run this benchmark yourself by doing: + +```bash +$ npm install +$ npm run build +$ npm run benchmark +``` + +## Contributing + +If you wish to submit a pull request please update and/or create new tests for any changes you make and ensure the grunt build passes. + +See [CONTRIBUTING.md](https://github.com/hiddentao/fast-levenshtein/blob/master/CONTRIBUTING.md) for details. + +## License + +MIT - see [LICENSE.md](https://github.com/hiddentao/fast-levenshtein/blob/master/LICENSE.md) diff --git a/node_modules/fast-levenshtein/levenshtein.js b/node_modules/fast-levenshtein/levenshtein.js new file mode 100644 index 0000000..dbe3628 --- /dev/null +++ b/node_modules/fast-levenshtein/levenshtein.js @@ -0,0 +1,136 @@ +(function() { + 'use strict'; + + var collator; + try { + collator = (typeof Intl !== "undefined" && typeof Intl.Collator !== "undefined") ? Intl.Collator("generic", { sensitivity: "base" }) : null; + } catch (err){ + console.log("Collator could not be initialized and wouldn't be used"); + } + // arrays to re-use + var prevRow = [], + str2Char = []; + + /** + * Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance. + */ + var Levenshtein = { + /** + * Calculate levenshtein distance of the two strings. + * + * @param str1 String the first string. + * @param str2 String the second string. + * @param [options] Additional options. + * @param [options.useCollator] Use `Intl.Collator` for locale-sensitive string comparison. + * @return Integer the levenshtein distance (0 and above). + */ + get: function(str1, str2, options) { + var useCollator = (options && collator && options.useCollator); + + var str1Len = str1.length, + str2Len = str2.length; + + // base cases + if (str1Len === 0) return str2Len; + if (str2Len === 0) return str1Len; + + // two rows + var curCol, nextCol, i, j, tmp; + + // initialise previous row + for (i=0; i tmp) { + nextCol = tmp; + } + // deletion + tmp = prevRow[j + 1] + 1; + if (nextCol > tmp) { + nextCol = tmp; + } + + // copy current col value into previous (in preparation for next iteration) + prevRow[j] = curCol; + } + + // copy last col value into previous (in preparation for next iteration) + prevRow[j] = nextCol; + } + } + else { + // calculate current row distance from previous row without collator + for (i = 0; i < str1Len; ++i) { + nextCol = i + 1; + + for (j = 0; j < str2Len; ++j) { + curCol = nextCol; + + // substution + strCmp = str1.charCodeAt(i) === str2Char[j]; + + nextCol = prevRow[j] + (strCmp ? 0 : 1); + + // insertion + tmp = curCol + 1; + if (nextCol > tmp) { + nextCol = tmp; + } + // deletion + tmp = prevRow[j + 1] + 1; + if (nextCol > tmp) { + nextCol = tmp; + } + + // copy current col value into previous (in preparation for next iteration) + prevRow[j] = curCol; + } + + // copy last col value into previous (in preparation for next iteration) + prevRow[j] = nextCol; + } + } + return nextCol; + } + + }; + + // amd + if (typeof define !== "undefined" && define !== null && define.amd) { + define(function() { + return Levenshtein; + }); + } + // commonjs + else if (typeof module !== "undefined" && module !== null && typeof exports !== "undefined" && module.exports === exports) { + module.exports = Levenshtein; + } + // web worker + else if (typeof self !== "undefined" && typeof self.postMessage === 'function' && typeof self.importScripts === 'function') { + self.Levenshtein = Levenshtein; + } + // browser main thread + else if (typeof window !== "undefined" && window !== null) { + window.Levenshtein = Levenshtein; + } +}()); + diff --git a/node_modules/fast-levenshtein/package.json b/node_modules/fast-levenshtein/package.json new file mode 100644 index 0000000..5b4736d --- /dev/null +++ b/node_modules/fast-levenshtein/package.json @@ -0,0 +1,39 @@ +{ + "name": "fast-levenshtein", + "version": "2.0.6", + "description": "Efficient implementation of Levenshtein algorithm with locale-specific collator support.", + "main": "levenshtein.js", + "files": [ + "levenshtein.js" + ], + "scripts": { + "build": "grunt build", + "prepublish": "npm run build", + "benchmark": "grunt benchmark", + "test": "mocha" + }, + "devDependencies": { + "chai": "~1.5.0", + "grunt": "~0.4.1", + "grunt-benchmark": "~0.2.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-jshint": "~0.4.3", + "grunt-contrib-uglify": "~0.2.0", + "grunt-mocha-test": "~0.2.2", + "grunt-npm-install": "~0.1.0", + "load-grunt-tasks": "~0.6.0", + "lodash": "^4.0.1", + "mocha": "~1.9.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/hiddentao/fast-levenshtein.git" + }, + "keywords": [ + "levenshtein", + "distance", + "string" + ], + "author": "Ramesh Nair (http://www.hiddentao.com/)", + "license": "MIT" +} diff --git a/node_modules/fastq/LICENSE b/node_modules/fastq/LICENSE new file mode 100644 index 0000000..27c7bb4 --- /dev/null +++ b/node_modules/fastq/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015-2020, Matteo Collina + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fastq/README.md b/node_modules/fastq/README.md new file mode 100644 index 0000000..1644111 --- /dev/null +++ b/node_modules/fastq/README.md @@ -0,0 +1,312 @@ +# fastq + +![ci][ci-url] +[![npm version][npm-badge]][npm-url] + +Fast, in memory work queue. + +Benchmarks (1 million tasks): + +* setImmediate: 812ms +* fastq: 854ms +* async.queue: 1298ms +* neoAsync.queue: 1249ms + +Obtained on node 12.16.1, on a dedicated server. + +If you need zero-overhead series function call, check out +[fastseries](http://npm.im/fastseries). For zero-overhead parallel +function call, check out [fastparallel](http://npm.im/fastparallel). + +[![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard) + + * Installation + * Usage + * API + * Licence & copyright + +## Install + +`npm i fastq --save` + +## Usage (callback API) + +```js +'use strict' + +const queue = require('fastq')(worker, 1) + +queue.push(42, function (err, result) { + if (err) { throw err } + console.log('the result is', result) +}) + +function worker (arg, cb) { + cb(null, arg * 2) +} +``` + +## Usage (promise API) + +```js +const queue = require('fastq').promise(worker, 1) + +async function worker (arg) { + return arg * 2 +} + +async function run () { + const result = await queue.push(42) + console.log('the result is', result) +} + +run() +``` + +### Setting "this" + +```js +'use strict' + +const that = { hello: 'world' } +const queue = require('fastq')(that, worker, 1) + +queue.push(42, function (err, result) { + if (err) { throw err } + console.log(this) + console.log('the result is', result) +}) + +function worker (arg, cb) { + console.log(this) + cb(null, arg * 2) +} +``` + +### Using with TypeScript (callback API) + +```ts +'use strict' + +import * as fastq from "fastq"; +import type { queue, done } from "fastq"; + +type Task = { + id: number +} + +const q: queue = fastq(worker, 1) + +q.push({ id: 42}) + +function worker (arg: Task, cb: done) { + console.log(arg.id) + cb(null) +} +``` + +### Using with TypeScript (promise API) + +```ts +'use strict' + +import * as fastq from "fastq"; +import type { queueAsPromised } from "fastq"; + +type Task = { + id: number +} + +const q: queueAsPromised = fastq.promise(asyncWorker, 1) + +q.push({ id: 42}).catch((err) => console.error(err)) + +async function asyncWorker (arg: Task): Promise { + // No need for a try-catch block, fastq handles errors automatically + console.log(arg.id) +} +``` + +## API + +* fastqueue() +* queue#push() +* queue#unshift() +* queue#pause() +* queue#resume() +* queue#idle() +* queue#length() +* queue#getQueue() +* queue#kill() +* queue#killAndDrain() +* queue#error() +* queue#concurrency +* queue#drain +* queue#empty +* queue#saturated +* fastqueue.promise() + +------------------------------------------------------- + +### fastqueue([that], worker, concurrency) + +Creates a new queue. + +Arguments: + +* `that`, optional context of the `worker` function. +* `worker`, worker function, it would be called with `that` as `this`, + if that is specified. +* `concurrency`, number of concurrent tasks that could be executed in + parallel. + +------------------------------------------------------- + +### queue.push(task, done) + +Add a task at the end of the queue. `done(err, result)` will be called +when the task was processed. + +------------------------------------------------------- + +### queue.unshift(task, done) + +Add a task at the beginning of the queue. `done(err, result)` will be called +when the task was processed. + +------------------------------------------------------- + +### queue.pause() + +Pause the processing of tasks. Currently worked tasks are not +stopped. + +------------------------------------------------------- + +### queue.resume() + +Resume the processing of tasks. + +------------------------------------------------------- + +### queue.idle() + +Returns `false` if there are tasks being processed or waiting to be processed. +`true` otherwise. + +------------------------------------------------------- + +### queue.length() + +Returns the number of tasks waiting to be processed (in the queue). + +------------------------------------------------------- + +### queue.getQueue() + +Returns all the tasks be processed (in the queue). Returns empty array when there are no tasks + +------------------------------------------------------- + +### queue.kill() + +Removes all tasks waiting to be processed, and reset `drain` to an empty +function. + +------------------------------------------------------- + +### queue.killAndDrain() + +Same than `kill` but the `drain` function will be called before reset to empty. + +------------------------------------------------------- + +### queue.error(handler) + +Set a global error handler. `handler(err, task)` will be called +each time a task is completed, `err` will be not null if the task has thrown an error. + +------------------------------------------------------- + +### queue.concurrency + +Property that returns the number of concurrent tasks that could be executed in +parallel. It can be altered at runtime. + +------------------------------------------------------- + +### queue.paused + +Property (Read-Only) that returns `true` when the queue is in a paused state. + +------------------------------------------------------- + +### queue.drain + +Function that will be called when the last +item from the queue has been processed by a worker. +It can be altered at runtime. + +------------------------------------------------------- + +### queue.empty + +Function that will be called when the last +item from the queue has been assigned to a worker. +It can be altered at runtime. + +------------------------------------------------------- + +### queue.saturated + +Function that will be called when the queue hits the concurrency +limit. +It can be altered at runtime. + +------------------------------------------------------- + +### fastqueue.promise([that], worker(arg), concurrency) + +Creates a new queue with `Promise` apis. It also offers all the methods +and properties of the object returned by [`fastqueue`](#fastqueue) with the modified +[`push`](#pushPromise) and [`unshift`](#unshiftPromise) methods. + +Node v10+ is required to use the promisified version. + +Arguments: +* `that`, optional context of the `worker` function. +* `worker`, worker function, it would be called with `that` as `this`, + if that is specified. It MUST return a `Promise`. +* `concurrency`, number of concurrent tasks that could be executed in + parallel. + + +#### queue.push(task) => Promise + +Add a task at the end of the queue. The returned `Promise` will be fulfilled (rejected) +when the task is completed successfully (unsuccessfully). + +This promise could be ignored as it will not lead to a `'unhandledRejection'`. + + +#### queue.unshift(task) => Promise + +Add a task at the beginning of the queue. The returned `Promise` will be fulfilled (rejected) +when the task is completed successfully (unsuccessfully). + +This promise could be ignored as it will not lead to a `'unhandledRejection'`. + + +#### queue.drained() => Promise + +Wait for the queue to be drained. The returned `Promise` will be resolved when all tasks in the queue have been processed by a worker. + +This promise could be ignored as it will not lead to a `'unhandledRejection'`. + +## License + +ISC + +[ci-url]: https://github.com/mcollina/fastq/workflows/ci/badge.svg +[npm-badge]: https://badge.fury.io/js/fastq.svg +[npm-url]: https://badge.fury.io/js/fastq diff --git a/node_modules/fastq/SECURITY.md b/node_modules/fastq/SECURITY.md new file mode 100644 index 0000000..dd9f1d5 --- /dev/null +++ b/node_modules/fastq/SECURITY.md @@ -0,0 +1,15 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 1.x | :white_check_mark: | +| < 1.0 | :x: | + +## Reporting a Vulnerability + +Please report all vulnerabilities at [https://github.com/mcollina/fastq/security](https://github.com/mcollina/fastq/security). diff --git a/node_modules/fastq/bench.js b/node_modules/fastq/bench.js new file mode 100644 index 0000000..4eaa829 --- /dev/null +++ b/node_modules/fastq/bench.js @@ -0,0 +1,66 @@ +'use strict' + +const max = 1000000 +const fastqueue = require('./')(worker, 1) +const { promisify } = require('util') +const immediate = promisify(setImmediate) +const qPromise = require('./').promise(immediate, 1) +const async = require('async') +const neo = require('neo-async') +const asyncqueue = async.queue(worker, 1) +const neoqueue = neo.queue(worker, 1) + +function bench (func, done) { + const key = max + '*' + func.name + let count = -1 + + console.time(key) + end() + + function end () { + if (++count < max) { + func(end) + } else { + console.timeEnd(key) + if (done) { + done() + } + } + } +} + +function benchFastQ (done) { + fastqueue.push(42, done) +} + +function benchAsyncQueue (done) { + asyncqueue.push(42, done) +} + +function benchNeoQueue (done) { + neoqueue.push(42, done) +} + +function worker (arg, cb) { + setImmediate(cb) +} + +function benchSetImmediate (cb) { + worker(42, cb) +} + +function benchFastQPromise (done) { + qPromise.push(42).then(function () { done() }, done) +} + +function runBench (done) { + async.eachSeries([ + benchSetImmediate, + benchFastQ, + benchNeoQueue, + benchAsyncQueue, + benchFastQPromise + ], bench, done) +} + +runBench(runBench) diff --git a/node_modules/fastq/example.js b/node_modules/fastq/example.js new file mode 100644 index 0000000..665fdc8 --- /dev/null +++ b/node_modules/fastq/example.js @@ -0,0 +1,14 @@ +'use strict' + +/* eslint-disable no-var */ + +var queue = require('./')(worker, 1) + +queue.push(42, function (err, result) { + if (err) { throw err } + console.log('the result is', result) +}) + +function worker (arg, cb) { + cb(null, 42 * 2) +} diff --git a/node_modules/fastq/example.mjs b/node_modules/fastq/example.mjs new file mode 100644 index 0000000..81be789 --- /dev/null +++ b/node_modules/fastq/example.mjs @@ -0,0 +1,11 @@ +import { promise as queueAsPromised } from './queue.js' + +/* eslint-disable */ + +const queue = queueAsPromised(worker, 1) + +console.log('the result is', await queue.push(42)) + +async function worker (arg) { + return 42 * 2 +} diff --git a/node_modules/fastq/package.json b/node_modules/fastq/package.json new file mode 100644 index 0000000..989151f --- /dev/null +++ b/node_modules/fastq/package.json @@ -0,0 +1,53 @@ +{ + "name": "fastq", + "version": "1.19.1", + "description": "Fast, in memory work queue", + "main": "queue.js", + "scripts": { + "lint": "standard --verbose | snazzy", + "unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test/test.js test/promise.js", + "coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js test/promise.js", + "test:report": "npm run lint && npm run unit:report", + "test": "npm run lint && npm run unit", + "typescript": "tsc --project ./test/tsconfig.json", + "legacy": "tape test/test.js" + }, + "pre-commit": [ + "test", + "typescript" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/fastq.git" + }, + "keywords": [ + "fast", + "queue", + "async", + "worker" + ], + "author": "Matteo Collina ", + "license": "ISC", + "bugs": { + "url": "https://github.com/mcollina/fastq/issues" + }, + "homepage": "https://github.com/mcollina/fastq#readme", + "devDependencies": { + "async": "^3.1.0", + "neo-async": "^2.6.1", + "nyc": "^17.0.0", + "pre-commit": "^1.2.2", + "snazzy": "^9.0.0", + "standard": "^16.0.0", + "tape": "^5.0.0", + "typescript": "^5.0.4" + }, + "dependencies": { + "reusify": "^1.0.4" + }, + "standard": { + "ignore": [ + "example.mjs" + ] + } +} diff --git a/node_modules/fastq/queue.js b/node_modules/fastq/queue.js new file mode 100644 index 0000000..7ea8a31 --- /dev/null +++ b/node_modules/fastq/queue.js @@ -0,0 +1,311 @@ +'use strict' + +/* eslint-disable no-var */ + +var reusify = require('reusify') + +function fastqueue (context, worker, _concurrency) { + if (typeof context === 'function') { + _concurrency = worker + worker = context + context = null + } + + if (!(_concurrency >= 1)) { + throw new Error('fastqueue concurrency must be equal to or greater than 1') + } + + var cache = reusify(Task) + var queueHead = null + var queueTail = null + var _running = 0 + var errorHandler = null + + var self = { + push: push, + drain: noop, + saturated: noop, + pause: pause, + paused: false, + + get concurrency () { + return _concurrency + }, + set concurrency (value) { + if (!(value >= 1)) { + throw new Error('fastqueue concurrency must be equal to or greater than 1') + } + _concurrency = value + + if (self.paused) return + for (; queueHead && _running < _concurrency;) { + _running++ + release() + } + }, + + running: running, + resume: resume, + idle: idle, + length: length, + getQueue: getQueue, + unshift: unshift, + empty: noop, + kill: kill, + killAndDrain: killAndDrain, + error: error + } + + return self + + function running () { + return _running + } + + function pause () { + self.paused = true + } + + function length () { + var current = queueHead + var counter = 0 + + while (current) { + current = current.next + counter++ + } + + return counter + } + + function getQueue () { + var current = queueHead + var tasks = [] + + while (current) { + tasks.push(current.value) + current = current.next + } + + return tasks + } + + function resume () { + if (!self.paused) return + self.paused = false + if (queueHead === null) { + _running++ + release() + return + } + for (; queueHead && _running < _concurrency;) { + _running++ + release() + } + } + + function idle () { + return _running === 0 && self.length() === 0 + } + + function push (value, done) { + var current = cache.get() + + current.context = context + current.release = release + current.value = value + current.callback = done || noop + current.errorHandler = errorHandler + + if (_running >= _concurrency || self.paused) { + if (queueTail) { + queueTail.next = current + queueTail = current + } else { + queueHead = current + queueTail = current + self.saturated() + } + } else { + _running++ + worker.call(context, current.value, current.worked) + } + } + + function unshift (value, done) { + var current = cache.get() + + current.context = context + current.release = release + current.value = value + current.callback = done || noop + current.errorHandler = errorHandler + + if (_running >= _concurrency || self.paused) { + if (queueHead) { + current.next = queueHead + queueHead = current + } else { + queueHead = current + queueTail = current + self.saturated() + } + } else { + _running++ + worker.call(context, current.value, current.worked) + } + } + + function release (holder) { + if (holder) { + cache.release(holder) + } + var next = queueHead + if (next && _running <= _concurrency) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null + } + queueHead = next.next + next.next = null + worker.call(context, next.value, next.worked) + if (queueTail === null) { + self.empty() + } + } else { + _running-- + } + } else if (--_running === 0) { + self.drain() + } + } + + function kill () { + queueHead = null + queueTail = null + self.drain = noop + } + + function killAndDrain () { + queueHead = null + queueTail = null + self.drain() + self.drain = noop + } + + function error (handler) { + errorHandler = handler + } +} + +function noop () {} + +function Task () { + this.value = null + this.callback = noop + this.next = null + this.release = noop + this.context = null + this.errorHandler = null + + var self = this + + this.worked = function worked (err, result) { + var callback = self.callback + var errorHandler = self.errorHandler + var val = self.value + self.value = null + self.callback = noop + if (self.errorHandler) { + errorHandler(err, val) + } + callback.call(self.context, err, result) + self.release(self) + } +} + +function queueAsPromised (context, worker, _concurrency) { + if (typeof context === 'function') { + _concurrency = worker + worker = context + context = null + } + + function asyncWrapper (arg, cb) { + worker.call(this, arg) + .then(function (res) { + cb(null, res) + }, cb) + } + + var queue = fastqueue(context, asyncWrapper, _concurrency) + + var pushCb = queue.push + var unshiftCb = queue.unshift + + queue.push = push + queue.unshift = unshift + queue.drained = drained + + return queue + + function push (value) { + var p = new Promise(function (resolve, reject) { + pushCb(value, function (err, result) { + if (err) { + reject(err) + return + } + resolve(result) + }) + }) + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop) + + return p + } + + function unshift (value) { + var p = new Promise(function (resolve, reject) { + unshiftCb(value, function (err, result) { + if (err) { + reject(err) + return + } + resolve(result) + }) + }) + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop) + + return p + } + + function drained () { + var p = new Promise(function (resolve) { + process.nextTick(function () { + if (queue.idle()) { + resolve() + } else { + var previousDrain = queue.drain + queue.drain = function () { + if (typeof previousDrain === 'function') previousDrain() + resolve() + queue.drain = previousDrain + } + } + }) + }) + + return p + } +} + +module.exports = fastqueue +module.exports.promise = queueAsPromised diff --git a/node_modules/fastq/test/example.ts b/node_modules/fastq/test/example.ts new file mode 100644 index 0000000..a47d441 --- /dev/null +++ b/node_modules/fastq/test/example.ts @@ -0,0 +1,83 @@ +import * as fastq from '../' +import { promise as queueAsPromised } from '../' + +// Basic example + +const queue = fastq(worker, 1) + +queue.push('world', (err, result) => { + if (err) throw err + console.log('the result is', result) +}) + +queue.push('push without cb') + +queue.concurrency + +queue.drain() + +queue.empty = () => undefined + +console.log('the queue tasks are', queue.getQueue()) + +queue.idle() + +queue.kill() + +queue.killAndDrain() + +queue.length + +queue.pause() + +queue.resume() + +queue.running() + +queue.saturated = () => undefined + +queue.unshift('world', (err, result) => { + if (err) throw err + console.log('the result is', result) +}) + +queue.unshift('unshift without cb') + +function worker(task: any, cb: fastq.done) { + cb(null, 'hello ' + task) +} + +// Generics example + +interface GenericsContext { + base: number; +} + +const genericsQueue = fastq({ base: 6 }, genericsWorker, 1) + +genericsQueue.push(7, (err, done) => { + if (err) throw err + console.log('the result is', done) +}) + +genericsQueue.unshift(7, (err, done) => { + if (err) throw err + console.log('the result is', done) +}) + +function genericsWorker(this: GenericsContext, task: number, cb: fastq.done) { + cb(null, 'the meaning of life is ' + (this.base * task)) +} + +const queue2 = queueAsPromised(asyncWorker, 1) + +async function asyncWorker(task: any) { + return 'hello ' + task +} + +async function run () { + await queue.push(42) + await queue.unshift(42) +} + +run() diff --git a/node_modules/fastq/test/promise.js b/node_modules/fastq/test/promise.js new file mode 100644 index 0000000..45349a4 --- /dev/null +++ b/node_modules/fastq/test/promise.js @@ -0,0 +1,291 @@ +'use strict' + +const test = require('tape') +const buildQueue = require('../').promise +const { promisify } = require('util') +const sleep = promisify(setTimeout) +const immediate = promisify(setImmediate) + +test('concurrency', function (t) { + t.plan(2) + t.throws(buildQueue.bind(null, worker, 0)) + t.doesNotThrow(buildQueue.bind(null, worker, 1)) + + async function worker (arg) { + return true + } +}) + +test('worker execution', async function (t) { + const queue = buildQueue(worker, 1) + + const result = await queue.push(42) + + t.equal(result, true, 'result matches') + + async function worker (arg) { + t.equal(arg, 42) + return true + } +}) + +test('limit', async function (t) { + const queue = buildQueue(worker, 1) + + const [res1, res2] = await Promise.all([queue.push(10), queue.push(0)]) + t.equal(res1, 10, 'the result matches') + t.equal(res2, 0, 'the result matches') + + async function worker (arg) { + await sleep(arg) + return arg + } +}) + +test('multiple executions', async function (t) { + const queue = buildQueue(worker, 1) + const toExec = [1, 2, 3, 4, 5] + const expected = ['a', 'b', 'c', 'd', 'e'] + let count = 0 + + await Promise.all(toExec.map(async function (task, i) { + const result = await queue.push(task) + t.equal(result, expected[i], 'the result matches') + })) + + async function worker (arg) { + t.equal(arg, toExec[count], 'arg matches') + return expected[count++] + } +}) + +test('drained', async function (t) { + const queue = buildQueue(worker, 2) + + const toExec = new Array(10).fill(10) + let count = 0 + + async function worker (arg) { + await sleep(arg) + count++ + } + + toExec.forEach(function (i) { + queue.push(i) + }) + + await queue.drained() + + t.equal(count, toExec.length) + + toExec.forEach(function (i) { + queue.push(i) + }) + + await queue.drained() + + t.equal(count, toExec.length * 2) +}) + +test('drained with exception should not throw', async function (t) { + const queue = buildQueue(worker, 2) + + const toExec = new Array(10).fill(10) + + async function worker () { + throw new Error('foo') + } + + toExec.forEach(function (i) { + queue.push(i) + }) + + await queue.drained() +}) + +test('drained with drain function', async function (t) { + let drainCalled = false + const queue = buildQueue(worker, 2) + + queue.drain = function () { + drainCalled = true + } + + const toExec = new Array(10).fill(10) + let count = 0 + + async function worker (arg) { + await sleep(arg) + count++ + } + + toExec.forEach(function () { + queue.push() + }) + + await queue.drained() + + t.equal(count, toExec.length) + t.equal(drainCalled, true) +}) + +test('drained while idle should resolve', async function (t) { + const queue = buildQueue(worker, 2) + + async function worker (arg) { + await sleep(arg) + } + + await queue.drained() +}) + +test('drained while idle should not call the drain function', async function (t) { + let drainCalled = false + const queue = buildQueue(worker, 2) + + queue.drain = function () { + drainCalled = true + } + + async function worker (arg) { + await sleep(arg) + } + + await queue.drained() + + t.equal(drainCalled, false) +}) + +test('set this', async function (t) { + t.plan(1) + const that = {} + const queue = buildQueue(that, worker, 1) + + await queue.push(42) + + async function worker (arg) { + t.equal(this, that, 'this matches') + } +}) + +test('unshift', async function (t) { + const queue = buildQueue(worker, 1) + const expected = [1, 2, 3, 4] + + await Promise.all([ + queue.push(1), + queue.push(4), + queue.unshift(3), + queue.unshift(2) + ]) + + t.is(expected.length, 0) + + async function worker (arg) { + t.equal(expected.shift(), arg, 'tasks come in order') + } +}) + +test('push with worker throwing error', async function (t) { + t.plan(5) + const q = buildQueue(async function (task, cb) { + throw new Error('test error') + }, 1) + q.error(function (err, task) { + t.ok(err instanceof Error, 'global error handler should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + t.equal(task, 42, 'The task executed should be passed') + }) + try { + await q.push(42) + } catch (err) { + t.ok(err instanceof Error, 'push callback should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + } +}) + +test('unshift with worker throwing error', async function (t) { + t.plan(2) + const q = buildQueue(async function (task, cb) { + throw new Error('test error') + }, 1) + try { + await q.unshift(42) + } catch (err) { + t.ok(err instanceof Error, 'push callback should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + } +}) + +test('no unhandledRejection (push)', async function (t) { + function handleRejection () { + t.fail('unhandledRejection') + } + process.once('unhandledRejection', handleRejection) + const q = buildQueue(async function (task, cb) { + throw new Error('test error') + }, 1) + + q.push(42) + + await immediate() + process.removeListener('unhandledRejection', handleRejection) +}) + +test('no unhandledRejection (unshift)', async function (t) { + function handleRejection () { + t.fail('unhandledRejection') + } + process.once('unhandledRejection', handleRejection) + const q = buildQueue(async function (task, cb) { + throw new Error('test error') + }, 1) + + q.unshift(42) + + await immediate() + process.removeListener('unhandledRejection', handleRejection) +}) + +test('drained should resolve after async tasks complete', async function (t) { + const logs = [] + + async function processTask () { + await new Promise(resolve => setTimeout(resolve, 0)) + logs.push('processed') + } + + const queue = buildQueue(processTask, 1) + queue.drain = () => logs.push('called drain') + + queue.drained().then(() => logs.push('drained promise resolved')) + + await Promise.all([ + queue.push(), + queue.push(), + queue.push() + ]) + + t.deepEqual(logs, [ + 'processed', + 'processed', + 'processed', + 'called drain', + 'drained promise resolved' + ], 'events happened in correct order') +}) + +test('drained should handle undefined drain function', async function (t) { + const queue = buildQueue(worker, 1) + + async function worker (arg) { + await sleep(10) + return arg + } + + queue.drain = undefined + queue.push(1) + await queue.drained() + + t.pass('drained resolved successfully with undefined drain') +}) diff --git a/node_modules/fastq/test/test.js b/node_modules/fastq/test/test.js new file mode 100644 index 0000000..79f0f6c --- /dev/null +++ b/node_modules/fastq/test/test.js @@ -0,0 +1,653 @@ +'use strict' + +/* eslint-disable no-var */ + +var test = require('tape') +var buildQueue = require('../') + +test('concurrency', function (t) { + t.plan(6) + t.throws(buildQueue.bind(null, worker, 0)) + t.throws(buildQueue.bind(null, worker, NaN)) + t.doesNotThrow(buildQueue.bind(null, worker, 1)) + + var queue = buildQueue(worker, 1) + t.throws(function () { + queue.concurrency = 0 + }) + t.throws(function () { + queue.concurrency = NaN + }) + t.doesNotThrow(function () { + queue.concurrency = 2 + }) + + function worker (arg, cb) { + cb(null, true) + } +}) + +test('worker execution', function (t) { + t.plan(3) + + var queue = buildQueue(worker, 1) + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + function worker (arg, cb) { + t.equal(arg, 42) + cb(null, true) + } +}) + +test('limit', function (t) { + t.plan(4) + + var expected = [10, 0] + var queue = buildQueue(worker, 1) + + queue.push(10, result) + queue.push(0, result) + + function result (err, arg) { + t.error(err, 'no error') + t.equal(arg, expected.shift(), 'the result matches') + } + + function worker (arg, cb) { + setTimeout(cb, arg, null, arg) + } +}) + +test('multiple executions', function (t) { + t.plan(15) + + var queue = buildQueue(worker, 1) + var toExec = [1, 2, 3, 4, 5] + var count = 0 + + toExec.forEach(function (task) { + queue.push(task, done) + }) + + function done (err, result) { + t.error(err, 'no error') + t.equal(result, toExec[count - 1], 'the result matches') + } + + function worker (arg, cb) { + t.equal(arg, toExec[count], 'arg matches') + count++ + setImmediate(cb, null, arg) + } +}) + +test('multiple executions, one after another', function (t) { + t.plan(15) + + var queue = buildQueue(worker, 1) + var toExec = [1, 2, 3, 4, 5] + var count = 0 + + queue.push(toExec[0], done) + + function done (err, result) { + t.error(err, 'no error') + t.equal(result, toExec[count - 1], 'the result matches') + if (count < toExec.length) { + queue.push(toExec[count], done) + } + } + + function worker (arg, cb) { + t.equal(arg, toExec[count], 'arg matches') + count++ + setImmediate(cb, null, arg) + } +}) + +test('set this', function (t) { + t.plan(3) + + var that = {} + var queue = buildQueue(that, worker, 1) + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(this, that, 'this matches') + }) + + function worker (arg, cb) { + t.equal(this, that, 'this matches') + cb(null, true) + } +}) + +test('drain', function (t) { + t.plan(4) + + var queue = buildQueue(worker, 1) + var worked = false + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + queue.drain = function () { + t.equal(true, worked, 'drained') + } + + function worker (arg, cb) { + t.equal(arg, 42) + worked = true + setImmediate(cb, null, true) + } +}) + +test('pause && resume', function (t) { + t.plan(13) + + var queue = buildQueue(worker, 1) + var worked = false + var expected = [42, 24] + + t.notOk(queue.paused, 'it should not be paused') + + queue.pause() + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + queue.push(24, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + t.notOk(worked, 'it should be paused') + t.ok(queue.paused, 'it should be paused') + + queue.resume() + queue.pause() + queue.resume() + queue.resume() // second resume is a no-op + + function worker (arg, cb) { + t.notOk(queue.paused, 'it should not be paused') + t.ok(queue.running() <= queue.concurrency, 'should respect the concurrency') + t.equal(arg, expected.shift()) + worked = true + process.nextTick(function () { cb(null, true) }) + } +}) + +test('pause in flight && resume', function (t) { + t.plan(16) + + var queue = buildQueue(worker, 1) + var expected = [42, 24, 12] + + t.notOk(queue.paused, 'it should not be paused') + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + t.ok(queue.paused, 'it should be paused') + process.nextTick(function () { + queue.resume() + queue.pause() + queue.resume() + }) + }) + + queue.push(24, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + t.notOk(queue.paused, 'it should not be paused') + }) + + queue.push(12, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + t.notOk(queue.paused, 'it should not be paused') + }) + + queue.pause() + + function worker (arg, cb) { + t.ok(queue.running() <= queue.concurrency, 'should respect the concurrency') + t.equal(arg, expected.shift()) + process.nextTick(function () { cb(null, true) }) + } +}) + +test('altering concurrency', function (t) { + t.plan(24) + + var queue = buildQueue(worker, 1) + + queue.push(24, workDone) + queue.push(24, workDone) + queue.push(24, workDone) + + queue.pause() + + queue.concurrency = 3 // concurrency changes are ignored while paused + queue.concurrency = 2 + + queue.resume() + + t.equal(queue.running(), 2, '2 jobs running') + + queue.concurrency = 3 + + t.equal(queue.running(), 3, '3 jobs running') + + queue.concurrency = 1 + + t.equal(queue.running(), 3, '3 jobs running') // running jobs can't be killed + + queue.push(24, workDone) + queue.push(24, workDone) + queue.push(24, workDone) + queue.push(24, workDone) + + function workDone (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + } + + function worker (arg, cb) { + t.ok(queue.running() <= queue.concurrency, 'should respect the concurrency') + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('idle()', function (t) { + t.plan(12) + + var queue = buildQueue(worker, 1) + + t.ok(queue.idle(), 'queue is idle') + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + t.notOk(queue.idle(), 'queue is not idle') + }) + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + // it will go idle after executing this function + setImmediate(function () { + t.ok(queue.idle(), 'queue is now idle') + }) + }) + + t.notOk(queue.idle(), 'queue is not idle') + + function worker (arg, cb) { + t.notOk(queue.idle(), 'queue is not idle') + t.equal(arg, 42) + setImmediate(cb, null, true) + } +}) + +test('saturated', function (t) { + t.plan(9) + + var queue = buildQueue(worker, 1) + var preworked = 0 + var worked = 0 + + queue.saturated = function () { + t.pass('saturated') + t.equal(preworked, 1, 'started 1 task') + t.equal(worked, 0, 'worked zero task') + } + + queue.push(42, done) + queue.push(42, done) + + function done (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + } + + function worker (arg, cb) { + t.equal(arg, 42) + preworked++ + setImmediate(function () { + worked++ + cb(null, true) + }) + } +}) + +test('length', function (t) { + t.plan(7) + + var queue = buildQueue(worker, 1) + + t.equal(queue.length(), 0, 'nothing waiting') + queue.push(42, done) + t.equal(queue.length(), 0, 'nothing waiting') + queue.push(42, done) + t.equal(queue.length(), 1, 'one task waiting') + queue.push(42, done) + t.equal(queue.length(), 2, 'two tasks waiting') + + function done (err, result) { + t.error(err, 'no error') + } + + function worker (arg, cb) { + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('getQueue', function (t) { + t.plan(10) + + var queue = buildQueue(worker, 1) + + t.equal(queue.getQueue().length, 0, 'nothing waiting') + queue.push(42, done) + t.equal(queue.getQueue().length, 0, 'nothing waiting') + queue.push(42, done) + t.equal(queue.getQueue().length, 1, 'one task waiting') + t.equal(queue.getQueue()[0], 42, 'should be equal') + queue.push(43, done) + t.equal(queue.getQueue().length, 2, 'two tasks waiting') + t.equal(queue.getQueue()[0], 42, 'should be equal') + t.equal(queue.getQueue()[1], 43, 'should be equal') + + function done (err, result) { + t.error(err, 'no error') + } + + function worker (arg, cb) { + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('unshift', function (t) { + t.plan(8) + + var queue = buildQueue(worker, 1) + var expected = [1, 2, 3, 4] + + queue.push(1, done) + queue.push(4, done) + queue.unshift(3, done) + queue.unshift(2, done) + + function done (err, result) { + t.error(err, 'no error') + } + + function worker (arg, cb) { + t.equal(expected.shift(), arg, 'tasks come in order') + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('unshift && empty', function (t) { + t.plan(2) + + var queue = buildQueue(worker, 1) + var completed = false + + queue.pause() + + queue.empty = function () { + t.notOk(completed, 'the task has not completed yet') + } + + queue.unshift(1, done) + + queue.resume() + + function done (err, result) { + completed = true + t.error(err, 'no error') + } + + function worker (arg, cb) { + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('push && empty', function (t) { + t.plan(2) + + var queue = buildQueue(worker, 1) + var completed = false + + queue.pause() + + queue.empty = function () { + t.notOk(completed, 'the task has not completed yet') + } + + queue.push(1, done) + + queue.resume() + + function done (err, result) { + completed = true + t.error(err, 'no error') + } + + function worker (arg, cb) { + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('kill', function (t) { + t.plan(5) + + var queue = buildQueue(worker, 1) + var expected = [1] + + var predrain = queue.drain + + queue.drain = function drain () { + t.fail('drain should never be called') + } + + queue.push(1, done) + queue.push(4, done) + queue.unshift(3, done) + queue.unshift(2, done) + queue.kill() + + function done (err, result) { + t.error(err, 'no error') + setImmediate(function () { + t.equal(queue.length(), 0, 'no queued tasks') + t.equal(queue.running(), 0, 'no running tasks') + t.equal(queue.drain, predrain, 'drain is back to default') + }) + } + + function worker (arg, cb) { + t.equal(expected.shift(), arg, 'tasks come in order') + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('killAndDrain', function (t) { + t.plan(6) + + var queue = buildQueue(worker, 1) + var expected = [1] + + var predrain = queue.drain + + queue.drain = function drain () { + t.pass('drain has been called') + } + + queue.push(1, done) + queue.push(4, done) + queue.unshift(3, done) + queue.unshift(2, done) + queue.killAndDrain() + + function done (err, result) { + t.error(err, 'no error') + setImmediate(function () { + t.equal(queue.length(), 0, 'no queued tasks') + t.equal(queue.running(), 0, 'no running tasks') + t.equal(queue.drain, predrain, 'drain is back to default') + }) + } + + function worker (arg, cb) { + t.equal(expected.shift(), arg, 'tasks come in order') + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('pause && idle', function (t) { + t.plan(11) + + var queue = buildQueue(worker, 1) + var worked = false + + t.notOk(queue.paused, 'it should not be paused') + t.ok(queue.idle(), 'should be idle') + + queue.pause() + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + t.notOk(worked, 'it should be paused') + t.ok(queue.paused, 'it should be paused') + t.notOk(queue.idle(), 'should not be idle') + + queue.resume() + + t.notOk(queue.paused, 'it should not be paused') + t.notOk(queue.idle(), 'it should not be idle') + + function worker (arg, cb) { + t.equal(arg, 42) + worked = true + process.nextTick(cb.bind(null, null, true)) + process.nextTick(function () { + t.ok(queue.idle(), 'is should be idle') + }) + } +}) + +test('push without cb', function (t) { + t.plan(1) + + var queue = buildQueue(worker, 1) + + queue.push(42) + + function worker (arg, cb) { + t.equal(arg, 42) + cb() + } +}) + +test('unshift without cb', function (t) { + t.plan(1) + + var queue = buildQueue(worker, 1) + + queue.unshift(42) + + function worker (arg, cb) { + t.equal(arg, 42) + cb() + } +}) + +test('push with worker throwing error', function (t) { + t.plan(5) + var q = buildQueue(function (task, cb) { + cb(new Error('test error'), null) + }, 1) + q.error(function (err, task) { + t.ok(err instanceof Error, 'global error handler should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + t.equal(task, 42, 'The task executed should be passed') + }) + q.push(42, function (err) { + t.ok(err instanceof Error, 'push callback should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + }) +}) + +test('unshift with worker throwing error', function (t) { + t.plan(5) + var q = buildQueue(function (task, cb) { + cb(new Error('test error'), null) + }, 1) + q.error(function (err, task) { + t.ok(err instanceof Error, 'global error handler should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + t.equal(task, 42, 'The task executed should be passed') + }) + q.unshift(42, function (err) { + t.ok(err instanceof Error, 'unshift callback should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + }) +}) + +test('pause/resume should trigger drain event', function (t) { + t.plan(1) + + var queue = buildQueue(worker, 1) + queue.pause() + queue.drain = function () { + t.pass('drain should be called') + } + + function worker (arg, cb) { + cb(null, true) + } + + queue.resume() +}) + +test('paused flag', function (t) { + t.plan(2) + + var queue = buildQueue(function (arg, cb) { + cb(null) + }, 1) + t.equal(queue.paused, false) + queue.pause() + t.equal(queue.paused, true) +}) diff --git a/node_modules/fastq/test/tsconfig.json b/node_modules/fastq/test/tsconfig.json new file mode 100644 index 0000000..66e16e9 --- /dev/null +++ b/node_modules/fastq/test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "noEmit": true, + "strict": true + }, + "files": [ + "./example.ts" + ] +} diff --git a/node_modules/file-entry-cache/LICENSE b/node_modules/file-entry-cache/LICENSE new file mode 100644 index 0000000..39a8bc4 --- /dev/null +++ b/node_modules/file-entry-cache/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) Roy Riojas & Jared Wray + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/file-entry-cache/README.md b/node_modules/file-entry-cache/README.md new file mode 100644 index 0000000..4f068fe --- /dev/null +++ b/node_modules/file-entry-cache/README.md @@ -0,0 +1,115 @@ +# file-entry-cache +> Super simple cache for file metadata, useful for process that work on a given series of files +> and that only need to repeat the job on the changed ones since the previous run of the process — Edit + +[![NPM Version](https://img.shields.io/npm/v/file-entry-cache.svg?style=flat)](https://npmjs.org/package/file-entry-cache) +[![tests](https://github.com/jaredwray/file-entry-cache/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/jaredwray/file-entry-cache/actions/workflows/tests.yaml) +[![codecov](https://codecov.io/github/jaredwray/file-entry-cache/graph/badge.svg?token=37tZMQE0Sy)](https://codecov.io/github/jaredwray/file-entry-cache) +[![npm](https://img.shields.io/npm/dm/file-entry-cache)](https://npmjs.com/package/file-entry-cache) + + +## install + +```bash +npm i --save file-entry-cache +``` + +## Usage + +The module exposes two functions `create` and `createFromFile`. + +## `create(cacheName, [directory, useCheckSum])` +- **cacheName**: the name of the cache to be created +- **directory**: Optional the directory to load the cache from +- **usecheckSum**: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file. + +## `createFromFile(pathToCache, [useCheckSum])` +- **pathToCache**: the path to the cache file (this combines the cache name and directory) +- **useCheckSum**: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file. + +```js +// loads the cache, if one does not exists for the given +// Id a new one will be prepared to be created +var fileEntryCache = require('file-entry-cache'); + +var cache = fileEntryCache.create('testCache'); + +var files = expand('../fixtures/*.txt'); + +// the first time this method is called, will return all the files +var oFiles = cache.getUpdatedFiles(files); + +// this will persist this to disk checking each file stats and +// updating the meta attributes `size` and `mtime`. +// custom fields could also be added to the meta object and will be persisted +// in order to retrieve them later +cache.reconcile(); + +// use this if you want the non visited file entries to be kept in the cache +// for more than one execution +// +// cache.reconcile( true /* noPrune */) + +// on a second run +var cache2 = fileEntryCache.create('testCache'); + +// will return now only the files that were modified or none +// if no files were modified previous to the execution of this function +var oFiles = cache.getUpdatedFiles(files); + +// if you want to prevent a file from being considered non modified +// something useful if a file failed some sort of validation +// you can then remove the entry from the cache doing +cache.removeEntry('path/to/file'); // path to file should be the same path of the file received on `getUpdatedFiles` +// that will effectively make the file to appear again as modified until the validation is passed. In that +// case you should not remove it from the cache + +// if you need all the files, so you can determine what to do with the changed ones +// you can call +var oFiles = cache.normalizeEntries(files); + +// oFiles will be an array of objects like the following +entry = { + key: 'some/name/file', the path to the file + changed: true, // if the file was changed since previous run + meta: { + size: 3242, // the size of the file + mtime: 231231231, // the modification time of the file + data: {} // some extra field stored for this file (useful to save the result of a transformation on the file + } +} + +``` + +## Motivation for this module + +I needed a super simple and dumb **in-memory cache** with optional disk persistence (write-back cache) in order to make +a script that will beautify files with `esformatter` to execute only on the files that were changed since the last run. + +In doing so the process of beautifying files was reduced from several seconds to a small fraction of a second. + +This module uses [flat-cache](https://www.npmjs.com/package/flat-cache) a super simple `key/value` cache storage with +optional file persistance. + +The main idea is to read the files when the task begins, apply the transforms required, and if the process succeed, +then store the new state of the files. The next time this module request for `getChangedFiles` will return only +the files that were modified. Making the process to end faster. + +This module could also be used by processes that modify the files applying a transform, in that case the result of the +transform could be stored in the `meta` field, of the entries. Anything added to the meta field will be persisted. +Those processes won't need to call `getChangedFiles` they will instead call `normalizeEntries` that will return the +entries with a `changed` field that can be used to determine if the file was changed or not. If it was not changed +the transformed stored data could be used instead of actually applying the transformation, saving time in case of only +a few files changed. + +In the worst case scenario all the files will be processed. In the best case scenario only a few of them will be processed. + +## Important notes +- The values set on the meta attribute of the entries should be `stringify-able` ones if possible, flat-cache uses `circular-json` to try to persist circular structures, but this should be considered experimental. The best results are always obtained with non circular values +- All the changes to the cache state are done to memory first and only persisted after reconcile. + +## License + +MIT + + diff --git a/node_modules/file-entry-cache/cache.js b/node_modules/file-entry-cache/cache.js new file mode 100644 index 0000000..6b15767 --- /dev/null +++ b/node_modules/file-entry-cache/cache.js @@ -0,0 +1,291 @@ +var path = require('path'); +var crypto = require('crypto'); + +module.exports = { + createFromFile: function (filePath, useChecksum) { + var fname = path.basename(filePath); + var dir = path.dirname(filePath); + return this.create(fname, dir, useChecksum); + }, + + create: function (cacheId, _path, useChecksum) { + var fs = require('fs'); + var flatCache = require('flat-cache'); + var cache = flatCache.load(cacheId, _path); + var normalizedEntries = {}; + + var removeNotFoundFiles = function removeNotFoundFiles() { + const cachedEntries = cache.keys(); + // remove not found entries + cachedEntries.forEach(function remover(fPath) { + try { + fs.statSync(fPath); + } catch (err) { + if (err.code === 'ENOENT') { + cache.removeKey(fPath); + } + } + }); + }; + + removeNotFoundFiles(); + + return { + /** + * the flat cache storage used to persist the metadata of the `files + * @type {Object} + */ + cache: cache, + + /** + * Given a buffer, calculate md5 hash of its content. + * @method getHash + * @param {Buffer} buffer buffer to calculate hash on + * @return {String} content hash digest + */ + getHash: function (buffer) { + return crypto.createHash('md5').update(buffer).digest('hex'); + }, + + /** + * Return whether or not a file has changed since last time reconcile was called. + * @method hasFileChanged + * @param {String} file the filepath to check + * @return {Boolean} wheter or not the file has changed + */ + hasFileChanged: function (file) { + return this.getFileDescriptor(file).changed; + }, + + /** + * given an array of file paths it return and object with three arrays: + * - changedFiles: Files that changed since previous run + * - notChangedFiles: Files that haven't change + * - notFoundFiles: Files that were not found, probably deleted + * + * @param {Array} files the files to analyze and compare to the previous seen files + * @return {[type]} [description] + */ + analyzeFiles: function (files) { + var me = this; + files = files || []; + + var res = { + changedFiles: [], + notFoundFiles: [], + notChangedFiles: [], + }; + + me.normalizeEntries(files).forEach(function (entry) { + if (entry.changed) { + res.changedFiles.push(entry.key); + return; + } + if (entry.notFound) { + res.notFoundFiles.push(entry.key); + return; + } + res.notChangedFiles.push(entry.key); + }); + return res; + }, + + getFileDescriptor: function (file) { + var fstat; + + try { + fstat = fs.statSync(file); + } catch (ex) { + this.removeEntry(file); + return { key: file, notFound: true, err: ex }; + } + + if (useChecksum) { + return this._getFileDescriptorUsingChecksum(file); + } + + return this._getFileDescriptorUsingMtimeAndSize(file, fstat); + }, + + _getFileDescriptorUsingMtimeAndSize: function (file, fstat) { + var meta = cache.getKey(file); + var cacheExists = !!meta; + + var cSize = fstat.size; + var cTime = fstat.mtime.getTime(); + + var isDifferentDate; + var isDifferentSize; + + if (!meta) { + meta = { size: cSize, mtime: cTime }; + } else { + isDifferentDate = cTime !== meta.mtime; + isDifferentSize = cSize !== meta.size; + } + + var nEntry = (normalizedEntries[file] = { + key: file, + changed: !cacheExists || isDifferentDate || isDifferentSize, + meta: meta, + }); + + return nEntry; + }, + + _getFileDescriptorUsingChecksum: function (file) { + var meta = cache.getKey(file); + var cacheExists = !!meta; + + var contentBuffer; + try { + contentBuffer = fs.readFileSync(file); + } catch (ex) { + contentBuffer = ''; + } + + var isDifferent = true; + var hash = this.getHash(contentBuffer); + + if (!meta) { + meta = { hash: hash }; + } else { + isDifferent = hash !== meta.hash; + } + + var nEntry = (normalizedEntries[file] = { + key: file, + changed: !cacheExists || isDifferent, + meta: meta, + }); + + return nEntry; + }, + + /** + * Return the list o the files that changed compared + * against the ones stored in the cache + * + * @method getUpdated + * @param files {Array} the array of files to compare against the ones in the cache + * @returns {Array} + */ + getUpdatedFiles: function (files) { + var me = this; + files = files || []; + + return me + .normalizeEntries(files) + .filter(function (entry) { + return entry.changed; + }) + .map(function (entry) { + return entry.key; + }); + }, + + /** + * return the list of files + * @method normalizeEntries + * @param files + * @returns {*} + */ + normalizeEntries: function (files) { + files = files || []; + + var me = this; + var nEntries = files.map(function (file) { + return me.getFileDescriptor(file); + }); + + //normalizeEntries = nEntries; + return nEntries; + }, + + /** + * Remove an entry from the file-entry-cache. Useful to force the file to still be considered + * modified the next time the process is run + * + * @method removeEntry + * @param entryName + */ + removeEntry: function (entryName) { + delete normalizedEntries[entryName]; + cache.removeKey(entryName); + }, + + /** + * Delete the cache file from the disk + * @method deleteCacheFile + */ + deleteCacheFile: function () { + cache.removeCacheFile(); + }, + + /** + * remove the cache from the file and clear the memory cache + */ + destroy: function () { + normalizedEntries = {}; + cache.destroy(); + }, + + _getMetaForFileUsingCheckSum: function (cacheEntry) { + var contentBuffer = fs.readFileSync(cacheEntry.key); + var hash = this.getHash(contentBuffer); + var meta = Object.assign(cacheEntry.meta, { hash: hash }); + delete meta.size; + delete meta.mtime; + return meta; + }, + + _getMetaForFileUsingMtimeAndSize: function (cacheEntry) { + var stat = fs.statSync(cacheEntry.key); + var meta = Object.assign(cacheEntry.meta, { + size: stat.size, + mtime: stat.mtime.getTime(), + }); + delete meta.hash; + return meta; + }, + + /** + * Sync the files and persist them to the cache + * @method reconcile + */ + reconcile: function (noPrune) { + removeNotFoundFiles(); + + noPrune = typeof noPrune === 'undefined' ? true : noPrune; + + var entries = normalizedEntries; + var keys = Object.keys(entries); + + if (keys.length === 0) { + return; + } + + var me = this; + + keys.forEach(function (entryName) { + var cacheEntry = entries[entryName]; + + try { + var meta = useChecksum + ? me._getMetaForFileUsingCheckSum(cacheEntry) + : me._getMetaForFileUsingMtimeAndSize(cacheEntry); + cache.setKey(entryName, meta); + } catch (err) { + // if the file does not exists we don't save it + // other errors are just thrown + if (err.code !== 'ENOENT') { + throw err; + } + } + }); + + cache.save(noPrune); + }, + }; + }, +}; diff --git a/node_modules/file-entry-cache/package.json b/node_modules/file-entry-cache/package.json new file mode 100644 index 0000000..ef63b6f --- /dev/null +++ b/node_modules/file-entry-cache/package.json @@ -0,0 +1,56 @@ +{ + "name": "file-entry-cache", + "version": "8.0.0", + "description": "Super simple cache for file metadata, useful for process that work o a given series of files and that only need to repeat the job on the changed ones since the previous run of the process", + "repository": "jaredwray/file-entry-cache", + "license": "MIT", + "author": { + "name": "Jared Wray", + "url": "https://jaredwray.com" + }, + "main": "cache.js", + "files": [ + "cache.js" + ], + "engines": { + "node": ">=16.0.0" + }, + "scripts": { + "eslint": "eslint --cache --cache-location=node_modules/.cache/ 'cache.js' 'test/**/*.js' 'perf.js'", + "autofix": "npm run eslint -- --fix", + "clean": "rimraf ./node_modules ./package-lock.json ./yarn.lock", + "test": "npm run eslint --silent && c8 mocha -R spec test/specs", + "test:ci": "npm run eslint --silent && c8 --reporter=lcov mocha -R spec test/specs", + "perf": "node perf.js" + }, + "prepush": [ + "npm run eslint --silent" + ], + "precommit": [ + "npm run eslint --silent" + ], + "keywords": [ + "file cache", + "task cache files", + "file cache", + "key par", + "key value", + "cache" + ], + "devDependencies": { + "c8": "^8.0.1", + "chai": "^4.3.10", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-mocha": "^10.2.0", + "eslint-plugin-prettier": "^5.0.1", + "glob-expand": "^0.2.1", + "mocha": "^10.2.0", + "prettier": "^3.1.1", + "rimraf": "^5.0.5", + "write": "^2.0.0" + }, + "dependencies": { + "flat-cache": "^4.0.0" + } +} diff --git a/node_modules/fill-range/LICENSE b/node_modules/fill-range/LICENSE new file mode 100644 index 0000000..9af4a67 --- /dev/null +++ b/node_modules/fill-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fill-range/README.md b/node_modules/fill-range/README.md new file mode 100644 index 0000000..8d756fe --- /dev/null +++ b/node_modules/fill-range/README.md @@ -0,0 +1,237 @@ +# fill-range [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) + +> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex` + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save fill-range +``` + +## Usage + +Expands numbers and letters, optionally using a `step` as the last argument. _(Numbers may be defined as JavaScript numbers or strings)_. + +```js +const fill = require('fill-range'); +// fill(from, to[, step, options]); + +console.log(fill('1', '10')); //=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] +console.log(fill('1', '10', { toRegex: true })); //=> [1-9]|10 +``` + +**Params** + +* `from`: **{String|Number}** the number or letter to start with +* `to`: **{String|Number}** the number or letter to end with +* `step`: **{String|Number|Object|Function}** Optionally pass a [step](#optionsstep) to use. +* `options`: **{Object|Function}**: See all available [options](#options) + +## Examples + +By default, an array of values is returned. + +**Alphabetical ranges** + +```js +console.log(fill('a', 'e')); //=> ['a', 'b', 'c', 'd', 'e'] +console.log(fill('A', 'E')); //=> [ 'A', 'B', 'C', 'D', 'E' ] +``` + +**Numerical ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill('1', '5')); //=> [ 1, 2, 3, 4, 5 ] +``` + +**Negative ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill('-5', '-1')); //=> [ '-5', '-4', '-3', '-2', '-1' ] +console.log(fill('-5', '5')); //=> [ '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5' ] +``` + +**Steps (increments)** + +```js +// numerical ranges with increments +console.log(fill('0', '25', 4)); //=> [ '0', '4', '8', '12', '16', '20', '24' ] +console.log(fill('0', '25', 5)); //=> [ '0', '5', '10', '15', '20', '25' ] +console.log(fill('0', '25', 6)); //=> [ '0', '6', '12', '18', '24' ] + +// alphabetical ranges with increments +console.log(fill('a', 'z', 4)); //=> [ 'a', 'e', 'i', 'm', 'q', 'u', 'y' ] +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 6)); //=> [ 'a', 'g', 'm', 's', 'y' ] +``` + +## Options + +### options.step + +**Type**: `number` (formatted as a string or number) + +**Default**: `undefined` + +**Description**: The increment to use for the range. Can be used with letters or numbers. + +**Example(s)** + +```js +// numbers +console.log(fill('1', '10', 2)); //=> [ '1', '3', '5', '7', '9' ] +console.log(fill('1', '10', 3)); //=> [ '1', '4', '7', '10' ] +console.log(fill('1', '10', 4)); //=> [ '1', '5', '9' ] + +// letters +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 7)); //=> [ 'a', 'h', 'o', 'v' ] +console.log(fill('a', 'z', 9)); //=> [ 'a', 'j', 's' ] +``` + +### options.strictRanges + +**Type**: `boolean` + +**Default**: `false` + +**Description**: By default, `null` is returned when an invalid range is passed. Enable this option to throw a `RangeError` on invalid ranges. + +**Example(s)** + +The following are all invalid: + +```js +fill('1.1', '2'); // decimals not supported in ranges +fill('a', '2'); // incompatible range values +fill(1, 10, 'foo'); // invalid "step" argument +``` + +### options.stringify + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Cast all returned values to strings. By default, integers are returned as numbers. + +**Example(s)** + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill(1, 5, { stringify: true })); //=> [ '1', '2', '3', '4', '5' ] +``` + +### options.toRegex + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Create a regex-compatible source string, instead of expanding values to an array. + +**Example(s)** + +```js +// alphabetical range +console.log(fill('a', 'e', { toRegex: true })); //=> '[a-e]' +// alphabetical with step +console.log(fill('a', 'z', 3, { toRegex: true })); //=> 'a|d|g|j|m|p|s|v|y' +// numerical range +console.log(fill('1', '100', { toRegex: true })); //=> '[1-9]|[1-9][0-9]|100' +// numerical range with zero padding +console.log(fill('000001', '100000', { toRegex: true })); +//=> '0{5}[1-9]|0{4}[1-9][0-9]|0{3}[1-9][0-9]{2}|0{2}[1-9][0-9]{3}|0[1-9][0-9]{4}|100000' +``` + +### options.transform + +**Type**: `function` + +**Default**: `undefined` + +**Description**: Customize each value in the returned array (or [string](#optionstoRegex)). _(you can also pass this function as the last argument to `fill()`)_. + +**Example(s)** + +```js +// add zero padding +console.log(fill(1, 5, value => String(value).padStart(4, '0'))); +//=> ['0001', '0002', '0003', '0004', '0005'] +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 116 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [paulmillr](https://github.com/paulmillr) | +| 2 | [realityking](https://github.com/realityking) | +| 2 | [bluelovers](https://github.com/bluelovers) | +| 1 | [edorivai](https://github.com/edorivai) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)! + + + + + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._ \ No newline at end of file diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js new file mode 100644 index 0000000..ddb212e --- /dev/null +++ b/node_modules/fill-range/index.js @@ -0,0 +1,248 @@ +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +const util = require('util'); +const toRegexRange = require('to-regex-range'); + +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + +const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); +}; + +const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); +}; + +const isNumber = num => Number.isInteger(+num); + +const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; +}; + +const stringify = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; +}; + +const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; +}; + +const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; +}; + +const toSequence = (parts, options, maxLen) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; + + if (parts.positives.length) { + positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|'); + } + + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`; + } + + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + + if (options.wrap) { + return `(${prefix}${result})`; + } + + return result; +}; + +const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } + + let start = String.fromCharCode(a); + if (a === b) return start; + + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; +}; + +const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); +}; + +const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); +}; + +const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; +}; + +const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; +}; + +const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); + + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } + + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; + + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify(start, end, options) === false; + let format = options.transform || transform(toNumber); + + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } + + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options, maxLen) + : toRegex(range, null, { wrap: false, ...options }); + } + + return range; +}; + +const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } + + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } + + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } + + return range; +}; + +const fill = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } + + if (typeof step === 'function') { + return fill(start, end, 1, { transform: step }); + } + + if (isObject(step)) { + return fill(start, end, 0, step); + } + + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } + + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); +}; + +module.exports = fill; diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json new file mode 100644 index 0000000..582357f --- /dev/null +++ b/node_modules/fill-range/package.json @@ -0,0 +1,74 @@ +{ + "name": "fill-range", + "description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", + "version": "7.1.1", + "homepage": "https://github.com/jonschlinkert/fill-range", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Edo Rivai (edo.rivai.nl)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Paul Miller (paulmillr.com)", + "Rouven Weßling (www.rouvenwessling.de)", + "(https://github.com/wtgtybhertgeghgtwtg)" + ], + "repository": "jonschlinkert/fill-range", + "bugs": { + "url": "https://github.com/jonschlinkert/fill-range/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "devDependencies": { + "gulp-format-md": "^2.0.0", + "mocha": "^6.1.1", + "nyc": "^15.1.0" + }, + "keywords": [ + "alpha", + "alphabetical", + "array", + "bash", + "brace", + "expand", + "expansion", + "fill", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "regex", + "sh" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/find-up/index.js b/node_modules/find-up/index.js new file mode 100644 index 0000000..ce564e5 --- /dev/null +++ b/node_modules/find-up/index.js @@ -0,0 +1,89 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); +const pathExists = require('path-exists'); + +const stop = Symbol('findUp.stop'); + +module.exports = async (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = async locateOptions => { + if (typeof name !== 'function') { + return locatePath(paths, locateOptions); + } + + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + // eslint-disable-next-line no-await-in-loop + const foundPath = await runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.sync = (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePath.sync(paths, locateOptions); + } + + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath.sync([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + const foundPath = runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.exists = pathExists; + +module.exports.sync.exists = pathExists.sync; + +module.exports.stop = stop; diff --git a/node_modules/find-up/license b/node_modules/find-up/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/find-up/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/find-up/package.json b/node_modules/find-up/package.json new file mode 100644 index 0000000..56db6dd --- /dev/null +++ b/node_modules/find-up/package.json @@ -0,0 +1,54 @@ +{ + "name": "find-up", + "version": "5.0.0", + "description": "Find a file or directory by walking up parent directories", + "license": "MIT", + "repository": "sindresorhus/find-up", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "walk", + "walking", + "path" + ], + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "is-path-inside": "^2.1.0", + "tempy": "^0.6.0", + "tsd": "^0.13.1", + "xo": "^0.33.0" + } +} diff --git a/node_modules/find-up/readme.md b/node_modules/find-up/readme.md new file mode 100644 index 0000000..7ad908a --- /dev/null +++ b/node_modules/find-up/readme.md @@ -0,0 +1,151 @@ +# find-up [![Build Status](https://travis-ci.com/sindresorhus/find-up.svg?branch=master)](https://travis-ci.com/github/sindresorhus/find-up) + +> Find a file or directory by walking up parent directories + +## Install + +``` +$ npm install find-up +``` + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +`example.js` + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' +})(); +``` + +## API + +### findUp(name, options?) +### findUp(matcher, options?) + +Returns a `Promise` for either the path or `undefined` if it couldn't be found. + +### findUp([...name], options?) + +Returns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found. + +### findUp.sync(name, options?) +### findUp.sync(matcher, options?) + +Returns a path or `undefined` if it couldn't be found. + +### findUp.sync([...name], options?) + +Returns the first path found (by respecting the order of the array) or `undefined` if none could be found. + +#### name + +Type: `string` + +Name of the file or directory to find. + +#### matcher + +Type: `Function` + +A function that will be called with each directory until it returns a `string` with the path, which stops the search, or the root directory has been reached and nothing was found. Useful if you want to match files with certain patterns, set of permissions, or other advanced use-cases. + +When using async mode, the `matcher` may optionally be an async or promise-returning function that returns the path. + +#### options + +Type: `object` + +##### cwd + +Type: `string`\ +Default: `process.cwd()` + +Directory to start from. + +##### type + +Type: `string`\ +Default: `'file'`\ +Values: `'file'` `'directory'` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`\ +Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### findUp.exists(path) + +Returns a `Promise` of whether the path exists. + +### findUp.sync.exists(path) + +Returns a `boolean` of whether the path exists. + +#### path + +Type: `string` + +Path to a file or directory. + +### findUp.stop + +A [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that can be returned by a `matcher` function to stop the search and cause `findUp` to immediately return `undefined`. Useful as a performance optimization in case the current working directory is deeply nested in the filesystem. + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + await findUp(directory => { + return path.basename(directory) === 'work' ? findUp.stop : 'logo.png'; + }); +})(); +``` + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package +- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path + +--- + +
+ + Get professional support for 'find-up' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/flat-cache/LICENSE b/node_modules/flat-cache/LICENSE new file mode 100644 index 0000000..7383a47 --- /dev/null +++ b/node_modules/flat-cache/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) Roy Riojas and Jared Wray + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/flat-cache/README.md b/node_modules/flat-cache/README.md new file mode 100644 index 0000000..3d7793a --- /dev/null +++ b/node_modules/flat-cache/README.md @@ -0,0 +1,77 @@ +# flat-cache + +> A stupidly simple key/value storage using files to persist the data + +[![NPM Version](https://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache) +[![tests](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml) +[![codecov](https://codecov.io/github/jaredwray/flat-cache/branch/master/graph/badge.svg?token=KxR95XT3NF)](https://codecov.io/github/jaredwray/flat-cache) +[![npm](https://img.shields.io/npm/dm/flat-cache)](https://npmjs.com/package/flat-cache) + +## install + +```bash +npm i --save flat-cache +``` + +## Usage + +```js +const flatCache = require('flat-cache'); +// loads the cache, if one does not exists for the given +// Id a new one will be prepared to be created +const cache = flatCache.load('cacheId'); + +// sets a key on the cache +cache.setKey('key', { foo: 'var' }); + +// get a key from the cache +cache.getKey('key'); // { foo: 'var' } + +// fetch the entire persisted object +cache.all(); // { 'key': { foo: 'var' } } + +// remove a key +cache.removeKey('key'); // removes a key from the cache + +// save it to disk +cache.save(); // very important, if you don't save no changes will be persisted. +// cache.save( true /* noPrune */) // can be used to prevent the removal of non visited keys + +// loads the cache from a given directory, if one does +// not exists for the given Id a new one will be prepared to be created +const cache = flatCache.load('cacheId', path.resolve('./path/to/folder')); + +// The following methods are useful to clear the cache +// delete a given cache +flatCache.clearCacheById('cacheId'); // removes the cacheId document if one exists. + +// delete all cache +flatCache.clearAll(); // remove the cache directory +``` + +## Motivation for this module + +I needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make +a script that will beutify files with `esformatter` only execute on the files that were changed since the last run. +To make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value` +storage was needed and Bam! this module was born. + +## Important notes + +- If no directory is especified when the `load` method is called, a folder named `.cache` will be created + inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you + might want to ignore the default `.cache` folder, or specify a custom directory. +- The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references +- All the changes to the cache state are done to memory +- I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module + intentionally dumb and simple +- Non visited keys are removed when `cache.save()` is called. If this is not desired, you can pass `true` to the save call + like: `cache.save( true /* noPrune */ )`. + +## License + +MIT + +## Changelog + +[changelog](./changelog.md) diff --git a/node_modules/flat-cache/changelog.md b/node_modules/flat-cache/changelog.md new file mode 100644 index 0000000..866f950 --- /dev/null +++ b/node_modules/flat-cache/changelog.md @@ -0,0 +1,278 @@ +# flat-cache - Changelog + +## v3.0.4 + +- **Refactoring** + - add files by name to the list of exported files - [89a2698](https://github.com/royriojas/flat-cache/commit/89a2698), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:35:39 + +## v3.0.3 + +- **Bug Fixes** + - Fix wrong eslint command - [f268e42](https://github.com/royriojas/flat-cache/commit/f268e42), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:15:04 + +## v3.0.2 + +- **Refactoring** + + - Update the files paths - [6983a80](https://github.com/royriojas/flat-cache/commit/6983a80), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:58:39 + - Move code to src/ - [18ed6e8](https://github.com/royriojas/flat-cache/commit/18ed6e8), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:57:17 + - Change eslint-cache location - [beed74c](https://github.com/royriojas/flat-cache/commit/beed74c), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:48:32 + +## v3.0.1 + +- **Refactoring** + - Remove unused deps - [8c6d9dc](https://github.com/royriojas/flat-cache/commit/8c6d9dc), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:43:29 + +## v3.0.0 + +- **Refactoring** + - Fix engines - [52b824c](https://github.com/royriojas/flat-cache/commit/52b824c), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:01:52 +- **Other changes** + + - Replace write with combination of mkdir and writeFile ([#49](https://github.com/royriojas/flat-cache/issues/49)) - [ef48276](https://github.com/royriojas/flat-cache/commit/ef48276), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 08/11/2020 00:17:15 + + Node v10 introduced a great "recursive" option for mkdir which allows to + get rid from mkdirp package and easily rewrite "write" package usage + with two function calls. + + https://nodejs.org/api/fs.html#fs_fs_mkdir_path_options_callback + + - Added a testcase for clearAll ([#48](https://github.com/royriojas/flat-cache/issues/48)) - [45b51ca](https://github.com/royriojas/flat-cache/commit/45b51ca), [Aaron Chen](https://github.com/Aaron Chen), 21/05/2020 08:40:03 + - requet node>=10 - [a5c482c](https://github.com/royriojas/flat-cache/commit/a5c482c), [yumetodo](https://github.com/yumetodo), 10/04/2020 23:14:53 + + thanks @SuperITMan + + - Update README.md - [29fe40b](https://github.com/royriojas/flat-cache/commit/29fe40b), [Roy Riojas](https://github.com/Roy Riojas), 10/04/2020 20:08:05 + - reduce vulnerability to 1 - [e9db1b2](https://github.com/royriojas/flat-cache/commit/e9db1b2), [yumetodo](https://github.com/yumetodo), 30/03/2020 11:10:43 + - reduce vulnerabilities dependencies to 8 - [b58d196](https://github.com/royriojas/flat-cache/commit/b58d196), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:54:56 + - use prettier instead of esbeautifier - [03b1db7](https://github.com/royriojas/flat-cache/commit/03b1db7), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:27:14 + - update proxyquire - [c2f048d](https://github.com/royriojas/flat-cache/commit/c2f048d), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:16:16 + - update flatted and mocha - [a0e56da](https://github.com/royriojas/flat-cache/commit/a0e56da), [yumetodo](https://github.com/yumetodo), 30/03/2020 09:46:45 + + mocha > mkdirp is updated + istanble >>> optimist > minimist is not updated + + - drop support node.js < 10 in develop - [beba691](https://github.com/royriojas/flat-cache/commit/beba691), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:31:09 + + see mkdirp + + - npm aufit fix(still remains) - [ce166cb](https://github.com/royriojas/flat-cache/commit/ce166cb), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:18:08 + + 37 vulnerabilities required manual review and could not be updated + + - updtate sinon - [9f2d1b6](https://github.com/royriojas/flat-cache/commit/9f2d1b6), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:17:51 + - apply eslint-plugin-mocha - [07343b5](https://github.com/royriojas/flat-cache/commit/07343b5), [yumetodo](https://github.com/yumetodo), 13/03/2020 22:17:21 + - Less strint version check ([#44](https://github.com/royriojas/flat-cache/issues/44)) - [92aca1c](https://github.com/royriojas/flat-cache/commit/92aca1c), [Wojciech Maj](https://github.com/Wojciech Maj), 13/11/2019 16:18:25 + + - Use ^ version matching for production dependencies + - Run npm audit fix + +- **Bug Fixes** + - update dependencies and use eslint directly - [73fbed2](https://github.com/royriojas/flat-cache/commit/73fbed2), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:17:27 + +## v2.0.1 + +- **Refactoring** + - upgrade node modules to latest versions - [6402ed3](https://github.com/royriojas/flat-cache/commit/6402ed3), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 18:47:05 + +## v2.0.0 + +- **Bug Fixes** + + - upgrade package.json lock file - [8d21c7b](https://github.com/royriojas/flat-cache/commit/8d21c7b), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 17:03:13 + - Use the same versions of node_js that eslint use - [8d23379](https://github.com/royriojas/flat-cache/commit/8d23379), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 16:25:11 + +- **Other changes** + + - Replace circular-json with flatted ([#36](https://github.com/royriojas/flat-cache/issues/36)) - [b93aced](https://github.com/royriojas/flat-cache/commit/b93aced), [C. K. Tang](https://github.com/C. K. Tang), 08/01/2019 17:03:01 + - Change JSON parser from circular-json to flatted & 1 more changes ([#37](https://github.com/royriojas/flat-cache/issues/37)) - [745e65a](https://github.com/royriojas/flat-cache/commit/745e65a), [Andy Chen](https://github.com/Andy Chen), 08/01/2019 16:17:20 + + - Change JSON parser from circular-json to flatted & 1 more changes + - Change JSON parser from circular-json + - Audited 2 vulnerabilities + - Update package.json + - Update Engine require + - There's a bunch of dependencies in this pkg requires node >=4, so I changed it to 4 + - Remove and add node versions + - I have seen this pkg is not available with node 0.12 so I removed it + - I have added a popular used LTS version of node - 10 + +## v1.3.4 + +- **Refactoring** + - Add del.js and utils.js to the list of files to be beautified - [9d0ca9b](https://github.com/royriojas/flat-cache/commit/9d0ca9b), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 12:19:02 + +## v1.3.3 + +- **Refactoring** + - Make sure package-lock.json is up to date - [a7d2598](https://github.com/royriojas/flat-cache/commit/a7d2598), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 11:36:08 +- **Other changes** + + - Removed the need for del ([#33](https://github.com/royriojas/flat-cache/issues/33)) - [c429012](https://github.com/royriojas/flat-cache/commit/c429012), [S. Gilroy](https://github.com/S. Gilroy), 13/11/2018 13:56:37 + + - Removed the need for del + + Removed the need for del as newer versions have broken backwards + compatibility. del mainly uses rimraf for deleting folders + and files, replaceing it with rimraf only is a minimal change. + + - Disable glob on rimraf calls + - Added glob disable to wrong call + - Wrapped rimraf to simplify solution + +## v1.3.2 + +- **Refactoring** + - remove yarn.lock file - [704c6c4](https://github.com/royriojas/flat-cache/commit/704c6c4), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15:41:08 +- **Other changes** + + - replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23))" - [db12d74](https://github.com/royriojas/flat-cache/commit/db12d74), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15:40:39 + + This reverts commit 00f689277a75e85fef28e6a048fad227afc525e6. + +## v1.3.1 + +- **Refactoring** + - upgrade deps to remove some security warnings - [f405719](https://github.com/royriojas/flat-cache/commit/f405719), [Roy Riojas](https://github.com/Roy Riojas), 06/11/2018 12:07:31 +- **Bug Fixes** + - replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23)) - [00f6892](https://github.com/royriojas/flat-cache/commit/00f6892), [Terry](https://github.com/Terry), 05/11/2018 18:44:16 +- **Other changes** + + - update del to v3.0.0 ([#26](https://github.com/royriojas/flat-cache/issues/26)) - [d42883f](https://github.com/royriojas/flat-cache/commit/d42883f), [Patrick Silva](https://github.com/Patrick Silva), 03/11/2018 01:00:44 + + Closes #25 + +## v1.3.0 + +- **Other changes** + + - Added #all method ([#16](https://github.com/royriojas/flat-cache/issues/16)) - [12293be](https://github.com/royriojas/flat-cache/commit/12293be), [Ozair Patel](https://github.com/Ozair Patel), 25/09/2017 14:46:38 + + - Added #all method + - Added #all method test + - Updated readme + - Added yarn.lock + - Added more keys for #all test + - Beautified file + + - fix changelog title style ([#14](https://github.com/royriojas/flat-cache/issues/14)) - [af8338a](https://github.com/royriojas/flat-cache/commit/af8338a), [前端小武](https://github.com/前端小武), 19/12/2016 20:34:48 + +## v1.2.2 + +- **Bug Fixes** + + - Do not crash if cache file is invalid JSON. ([#13](https://github.com/royriojas/flat-cache/issues/13)) - [87beaa6](https://github.com/royriojas/flat-cache/commit/87beaa6), [Roy Riojas](https://github.com/Roy Riojas), 19/12/2016 18:03:35 + + Fixes #12 + + Not sure under which situations a cache file might exist that does + not contain a valid JSON structure, but just in case to cover + the possibility of this happening a try catch block has been added + + If the cache is somehow not valid the cache will be discarded an a + a new cache will be stored instead + +- **Other changes** + + - Added travis ci support for modern node versions ([#11](https://github.com/royriojas/flat-cache/issues/11)) - [1c2b1f7](https://github.com/royriojas/flat-cache/commit/1c2b1f7), [Amila Welihinda](https://github.com/Amila Welihinda), 10/11/2016 23:47:52 + - Bumping `circular-son` version ([#10](https://github.com/royriojas/flat-cache/issues/10)) - [4d5e861](https://github.com/royriojas/flat-cache/commit/4d5e861), [Andrea Giammarchi](https://github.com/Andrea Giammarchi), 02/08/2016 07:13:52 + + As mentioned in https://github.com/WebReflection/circular-json/issues/25 `circular-json` wan't rightly implementing the license field. + + Latest version bump changed only that bit so that ESLint should now be happy. + +## v1.2.1 + +- **Bug Fixes** + - Add missing utils.js file to the package. closes [#8](https://github.com/royriojas/flat-cache/issues/8) - [ec10cf2](https://github.com/royriojas/flat-cache/commit/ec10cf2), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:18:57 + +## v1.2.0 + +- **Documentation** + - Add documentation about noPrune option - [23e11f9](https://github.com/royriojas/flat-cache/commit/23e11f9), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:06:49 + +## v1.0.11 + +- **Features** + + - Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a](https://github.com/royriojas/flat-cache/commit/2c8016a), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:00:29 + - Add json read and write utility based on circular-json - [c31081e](https://github.com/royriojas/flat-cache/commit/c31081e), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:58:17 + +- **Bug Fixes** + + - Remove UTF16 BOM stripping - [4a41e22](https://github.com/royriojas/flat-cache/commit/4a41e22), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:18:06 + + Since we control both writing and reading of JSON stream, there no needs + to handle unicode BOM. + + - Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed](https://github.com/royriojas/flat-cache/commit/cd7aeed), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 11:11:59 + +- **Tests Related fixes** + + - Add missing file from eslint test - [d6fa3c3](https://github.com/royriojas/flat-cache/commit/d6fa3c3), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:15:51 + - Add test for circular json serialization / deserialization - [07d2ddd](https://github.com/royriojas/flat-cache/commit/07d2ddd), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:36 + +- **Refactoring** + - Remove unused read-json-sync - [2be1c24](https://github.com/royriojas/flat-cache/commit/2be1c24), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:18 +- **Build Scripts Changes** + - travis tests on 0.12 and 4x - [3a613fd](https://github.com/royriojas/flat-cache/commit/3a613fd), [royriojas](https://github.com/royriojas), 15/11/2015 14:34:40 + +## v1.0.10 + +- **Build Scripts Changes** + + - add eslint-fix task - [fd29e52](https://github.com/royriojas/flat-cache/commit/fd29e52), [royriojas](https://github.com/royriojas), 01/11/2015 15:04:08 + - make sure the test script also verify beautification and linting of files before running tests - [e94e176](https://github.com/royriojas/flat-cache/commit/e94e176), [royriojas](https://github.com/royriojas), 01/11/2015 11:54:48 + +- **Other changes** + - add clearAll for cacheDir - [97383d9](https://github.com/royriojas/flat-cache/commit/97383d9), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 21:02:18 + +## v1.0.9 + +- **Bug Fixes** + - wrong default values for changelogx user repo name - [7bb52d1](https://github.com/royriojas/flat-cache/commit/7bb52d1), [royriojas](https://github.com/royriojas), 11/09/2015 15:59:30 + +## v1.0.8 + +- **Build Scripts Changes** + - test against node 4 - [c395b66](https://github.com/royriojas/flat-cache/commit/c395b66), [royriojas](https://github.com/royriojas), 11/09/2015 15:51:39 + +## v1.0.7 + +- **Other changes** + - Move dependencies into devDep - [7e47099](https://github.com/royriojas/flat-cache/commit/7e47099), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:10:57 +- **Documentation** + - Add missing changelog link - [f51197a](https://github.com/royriojas/flat-cache/commit/f51197a), [royriojas](https://github.com/royriojas), 11/09/2015 14:48:05 + +## v1.0.6 + +- **Build Scripts Changes** + - Add helpers/code check scripts - [bdb82f3](https://github.com/royriojas/flat-cache/commit/bdb82f3), [royriojas](https://github.com/royriojas), 11/09/2015 14:44:31 + +## v1.0.5 + +- **Documentation** + - better description for the module - [436817f](https://github.com/royriojas/flat-cache/commit/436817f), [royriojas](https://github.com/royriojas), 11/09/2015 14:35:33 +- **Other changes** + - Update dependencies - [be88aa3](https://github.com/royriojas/flat-cache/commit/be88aa3), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 13:47:41 + +## v1.0.4 + +- **Refactoring** + - load a cache file using the full filepath - [b8f68c2](https://github.com/royriojas/flat-cache/commit/b8f68c2), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 04:19:14 +- **Documentation** + - Add documentation about `clearAll` and `clearCacheById` - [13947c1](https://github.com/royriojas/flat-cache/commit/13947c1), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:44:05 +- **Features** + - Add methods to remove the cache documents created - [af40443](https://github.com/royriojas/flat-cache/commit/af40443), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:39:27 + +## v1.0.1 + +- **Other changes** + - Update README.md - [c2b6805](https://github.com/royriojas/flat-cache/commit/c2b6805), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:28:07 + +## v1.0.0 + +- **Refactoring** + - flat-cache v.1.0.0 - [c984274](https://github.com/royriojas/flat-cache/commit/c984274), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:11:50 +- **Other changes** + - Initial commit - [d43cccf](https://github.com/royriojas/flat-cache/commit/d43cccf), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 01:12:16 diff --git a/node_modules/flat-cache/package.json b/node_modules/flat-cache/package.json new file mode 100644 index 0000000..b124883 --- /dev/null +++ b/node_modules/flat-cache/package.json @@ -0,0 +1,63 @@ +{ + "name": "flat-cache", + "version": "4.0.1", + "description": "A stupidly simple key/value storage using files to persist some data", + "repository": "jaredwray/flat-cache", + "license": "MIT", + "author": { + "name": "Jared Wray", + "url": "https://jaredwray.com" + }, + "main": "src/cache.js", + "files": [ + "src/cache.js", + "src/del.js", + "src/utils.js" + ], + "engines": { + "node": ">=16" + }, + "precommit": [ + "npm run verify --silent" + ], + "prepush": [ + "npm run verify --silent" + ], + "scripts": { + "eslint": "eslint --cache --cache-location=node_modules/.cache/ ./src/**/*.js ./test/**/*.js", + "clean": "rimraf ./node_modules ./package-lock.json ./yarn.lock ./coverage", + "eslint-fix": "npm run eslint -- --fix", + "autofix": "npm run eslint-fix", + "check": "npm run eslint", + "verify": "npm run eslint && npm run test:cache", + "test:cache": "c8 mocha -R spec test/specs", + "test:ci:cache": "c8 --reporter=lcov mocha -R spec test/specs", + "test": "npm run verify --silent", + "format": "prettier --write ." + }, + "keywords": [ + "json cache", + "simple cache", + "file cache", + "key par", + "key value", + "cache" + ], + "devDependencies": { + "c8": "^9.1.0", + "chai": "^4.3.10", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-mocha": "^10.2.0", + "glob-expand": "^0.2.1", + "mocha": "^10.3.0", + "prettier": "^3.2.4", + "rimraf": "^5.0.5", + "sinon": "^17.0.1", + "write": "^2.0.0" + }, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + } +} diff --git a/node_modules/flat-cache/src/cache.js b/node_modules/flat-cache/src/cache.js new file mode 100644 index 0000000..b1fdf6d --- /dev/null +++ b/node_modules/flat-cache/src/cache.js @@ -0,0 +1,214 @@ +const path = require('path'); +const fs = require('fs'); +const Keyv = require('keyv'); +const { writeJSON, tryParse } = require('./utils'); +const { del } = require('./del'); + +const cache = { + /** + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted + * then the cache module directory `./cache` will be used instead + * + * @method load + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + */ + load: function (docId, cacheDir) { + const me = this; + me.keyv = new Keyv(); + + me.__visited = {}; + me.__persisted = {}; + + me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, '../.cache/', docId); + + if (fs.existsSync(me._pathToFile)) { + me._persisted = tryParse(me._pathToFile, {}); + } + }, + + get _persisted() { + return this.__persisted; + }, + + set _persisted(value) { + this.__persisted = value; + }, + + get _visited() { + return this.__visited; + }, + + set _visited(value) { + this.__visited = value; + }, + + /** + * Load the cache from the provided file + * @method loadFile + * @param {String} pathToFile the path to the file containing the info for the cache + */ + loadFile: function (pathToFile) { + const me = this; + const dir = path.dirname(pathToFile); + const fName = path.basename(pathToFile); + + me.load(fName, dir); + }, + + /** + * Returns the entire persisted object + * @method all + * @returns {*} + */ + all: function () { + return this._persisted; + }, + + keys: function () { + return Object.keys(this._persisted); + }, + /** + * sets a key to a given value + * @method setKey + * @param key {string} the key to set + * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify + */ + setKey: function (key, value) { + this._visited[key] = true; + this._persisted[key] = value; + }, + /** + * remove a given key from the cache + * @method removeKey + * @param key {String} the key to remove from the object + */ + removeKey: function (key) { + delete this._visited[key]; // esfmt-ignore-line + delete this._persisted[key]; // esfmt-ignore-line + }, + /** + * Return the value of the provided key + * @method getKey + * @param key {String} the name of the key to retrieve + * @returns {*} the value from the key + */ + getKey: function (key) { + this._visited[key] = true; + return this._persisted[key]; + }, + + /** + * Remove keys that were not accessed/set since the + * last time the `prune` method was called. + * @method _prune + * @private + */ + _prune: function () { + const me = this; + const obj = {}; + + const keys = Object.keys(me._visited); + + // no keys visited for either get or set value + if (keys.length === 0) { + return; + } + + keys.forEach(function (key) { + obj[key] = me._persisted[key]; + }); + + me._visited = {}; + me._persisted = obj; + }, + + /** + * Save the state of the cache identified by the docId to disk + * as a JSON structure + * @param [noPrune=false] {Boolean} whether to remove from cache the non visited files + * @method save + */ + save: function (noPrune) { + const me = this; + !noPrune && me._prune(); + writeJSON(me._pathToFile, me._persisted); + }, + + /** + * remove the file where the cache is persisted + * @method removeCacheFile + * @return {Boolean} true or false if the file was successfully deleted + */ + removeCacheFile: function () { + return del(this._pathToFile); + }, + /** + * Destroy the file cache and cache content. + * @method destroy + */ + destroy: function () { + const me = this; + me._visited = {}; + me._persisted = {}; + + me.removeCacheFile(); + }, +}; + +module.exports = { + /** + * Alias for create. Should be considered depreacted. Will be removed in next releases + * + * @method load + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + * @returns {cache} cache instance + */ + load: function (docId, cacheDir) { + return this.create(docId, cacheDir); + }, + + /** + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. + * + * @method create + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + * @returns {cache} cache instance + */ + create: function (docId, cacheDir) { + const obj = Object.create(cache); + obj.load(docId, cacheDir); + return obj; + }, + + createFromFile: function (filePath) { + const obj = Object.create(cache); + obj.loadFile(filePath); + return obj; + }, + /** + * Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly + * + * @method clearCache + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param cacheDir {String} the directory where the cache file was written + * @returns {Boolean} true if the cache folder was deleted. False otherwise + */ + clearCacheById: function (docId, cacheDir) { + const filePath = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, '../.cache/', docId); + return del(filePath); + }, + /** + * Remove all cache stored in the cache directory + * @method clearAll + * @returns {Boolean} true if the cache folder was deleted. False otherwise + */ + clearAll: function (cacheDir) { + const filePath = cacheDir ? path.resolve(cacheDir) : path.resolve(__dirname, '../.cache/'); + return del(filePath); + }, +}; diff --git a/node_modules/flat-cache/src/del.js b/node_modules/flat-cache/src/del.js new file mode 100644 index 0000000..9cd55c3 --- /dev/null +++ b/node_modules/flat-cache/src/del.js @@ -0,0 +1,30 @@ +const fs = require('fs'); +const path = require('path'); + +function del(targetPath) { + if (!fs.existsSync(targetPath)) { + return false; + } + + try { + if (fs.statSync(targetPath).isDirectory()) { + // If it's a directory, delete its contents first + fs.readdirSync(targetPath).forEach(file => { + const curPath = path.join(targetPath, file); + + if (fs.statSync(curPath).isFile()) { + fs.unlinkSync(curPath); // Delete file + } + }); + fs.rmdirSync(targetPath); // Delete the now-empty directory + } else { + fs.unlinkSync(targetPath); // If it's a file, delete it directly + } + + return true; + } catch (error) { + console.error(`Error while deleting ${targetPath}: ${error.message}`); + } +} + +module.exports = { del }; diff --git a/node_modules/flat-cache/src/utils.js b/node_modules/flat-cache/src/utils.js new file mode 100644 index 0000000..c4f75fb --- /dev/null +++ b/node_modules/flat-cache/src/utils.js @@ -0,0 +1,42 @@ +const fs = require('fs'); +const path = require('path'); +const flatted = require('flatted'); + +function tryParse(filePath, defaultValue) { + let result; + try { + result = readJSON(filePath); + } catch (ex) { + result = defaultValue; + } + return result; +} + +/** + * Read json file synchronously using flatted + * + * @param {String} filePath Json filepath + * @returns {*} parse result + */ +function readJSON(filePath) { + return flatted.parse( + fs.readFileSync(filePath, { + encoding: 'utf8', + }) + ); +} + +/** + * Write json file synchronously using circular-json + * + * @param {String} filePath Json filepath + * @param {*} data Object to serialize + */ +function writeJSON(filePath, data) { + fs.mkdirSync(path.dirname(filePath), { + recursive: true, + }); + fs.writeFileSync(filePath, flatted.stringify(data)); +} + +module.exports = { tryParse, readJSON, writeJSON }; diff --git a/node_modules/flatted/LICENSE b/node_modules/flatted/LICENSE new file mode 100644 index 0000000..506dc47 --- /dev/null +++ b/node_modules/flatted/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2018-2020, Andrea Giammarchi, @WebReflection + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/flatted/README.md b/node_modules/flatted/README.md new file mode 100644 index 0000000..f01c4c4 --- /dev/null +++ b/node_modules/flatted/README.md @@ -0,0 +1,115 @@ +# flatted + +[![Downloads](https://img.shields.io/npm/dm/flatted.svg)](https://www.npmjs.com/package/flatted) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/flatted/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/flatted?branch=main) [![Build Status](https://travis-ci.com/WebReflection/flatted.svg?branch=main)](https://travis-ci.com/WebReflection/flatted) [![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC) ![WebReflection status](https://offline.report/status/webreflection.svg) + +![snow flake](./flatted.jpg) + +**Social Media Photo by [Matt Seymour](https://unsplash.com/@mattseymour) on [Unsplash](https://unsplash.com/)** + +A super light (0.5K) and fast circular JSON parser, directly from the creator of [CircularJSON](https://github.com/WebReflection/circular-json/#circularjson). + +Available also for **[PHP](./php/flatted.php)**. + +Available also for **[Python](./python/flatted.py)**. + +- - - + +## Announcement 📣 + +There is a standard approach to recursion and more data-types than what JSON allows, and it's part of the [Structured Clone polyfill](https://github.com/ungap/structured-clone/#readme). + +Beside acting as a polyfill, its `@ungap/structured-clone/json` export provides both `stringify` and `parse`, and it's been tested for being faster than *flatted*, but its produced output is also smaller than *flatted* in general. + +The *@ungap/structured-clone* module is, in short, a drop in replacement for *flatted*, but it's not compatible with *flatted* specialized syntax. + +However, if recursion, as well as more data-types, are what you are after, or interesting for your projects/use cases, consider switching to this new module whenever you can 👍 + +- - - + +```js +npm i flatted +``` + +Usable via [CDN](https://unpkg.com/flatted) or as regular module. + +```js +// ESM +import {parse, stringify, toJSON, fromJSON} from 'flatted'; + +// CJS +const {parse, stringify, toJSON, fromJSON} = require('flatted'); + +const a = [{}]; +a[0].a = a; +a.push(a); + +stringify(a); // [["1","0"],{"a":"0"}] +``` + +## toJSON and fromJSON + +If you'd like to implicitly survive JSON serialization, these two helpers helps: + +```js +import {toJSON, fromJSON} from 'flatted'; + +class RecursiveMap extends Map { + static fromJSON(any) { + return new this(fromJSON(any)); + } + toJSON() { + return toJSON([...this.entries()]); + } +} + +const recursive = new RecursiveMap; +const same = {}; +same.same = same; +recursive.set('same', same); + +const asString = JSON.stringify(recursive); +const asMap = RecursiveMap.fromJSON(JSON.parse(asString)); +asMap.get('same') === asMap.get('same').same; +// true +``` + + +## Flatted VS JSON + +As it is for every other specialized format capable of serializing and deserializing circular data, you should never `JSON.parse(Flatted.stringify(data))`, and you should never `Flatted.parse(JSON.stringify(data))`. + +The only way this could work is to `Flatted.parse(Flatted.stringify(data))`, as it is also for _CircularJSON_ or any other, otherwise there's no granted data integrity. + +Also please note this project serializes and deserializes only data compatible with JSON, so that sockets, or anything else with internal classes different from those allowed by JSON standard, won't be serialized and unserialized as expected. + + +### New in V1: Exact same JSON API + + * Added a [reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Syntax) parameter to `.parse(string, reviver)` and revive your own objects. + * Added a [replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Syntax) and a `space` parameter to `.stringify(object, replacer, space)` for feature parity with JSON signature. + + +### Compatibility +All ECMAScript engines compatible with `Map`, `Set`, `Object.keys`, and `Array.prototype.reduce` will work, even if polyfilled. + + +### How does it work ? +While stringifying, all Objects, including Arrays, and strings, are flattened out and replaced as unique index. `*` + +Once parsed, all indexes will be replaced through the flattened collection. + +`*` represented as string to avoid conflicts with numbers + +```js +// logic example +var a = [{one: 1}, {two: '2'}]; +a[0].a = a; +// a is the main object, will be at index '0' +// {one: 1} is the second object, index '1' +// {two: '2'} the third, in '2', and it has a string +// which will be found at index '3' + +Flatted.stringify(a); +// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"] +// a[one,two] {one: 1, a} {two: '2'} '2' +``` diff --git a/node_modules/flatted/cjs/index.js b/node_modules/flatted/cjs/index.js new file mode 100644 index 0000000..7591f25 --- /dev/null +++ b/node_modules/flatted/cjs/index.js @@ -0,0 +1,125 @@ +'use strict'; +/// + +// (c) 2020-present Andrea Giammarchi + +const {parse: $parse, stringify: $stringify} = JSON; +const {keys} = Object; + +const Primitive = String; // it could be Number +const primitive = 'string'; // it could be 'number' + +const ignore = {}; +const object = 'object'; + +const noop = (_, value) => value; + +const primitives = value => ( + value instanceof Primitive ? Primitive(value) : value +); + +const Primitives = (_, value) => ( + typeof value === primitive ? new Primitive(value) : value +); + +const revive = (input, parsed, output, $) => { + const lazy = []; + for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) { + const k = ke[y]; + const value = output[k]; + if (value instanceof Primitive) { + const tmp = input[value]; + if (typeof tmp === object && !parsed.has(tmp)) { + parsed.add(tmp); + output[k] = ignore; + lazy.push({k, a: [input, parsed, tmp, $]}); + } + else + output[k] = $.call(output, k, tmp); + } + else if (output[k] !== ignore) + output[k] = $.call(output, k, value); + } + for (let {length} = lazy, i = 0; i < length; i++) { + const {k, a} = lazy[i]; + output[k] = $.call(output, k, revive.apply(null, a)); + } + return output; +}; + +const set = (known, input, value) => { + const index = Primitive(input.push(value) - 1); + known.set(value, index); + return index; +}; + +/** + * Converts a specialized flatted string into a JS value. + * @param {string} text + * @param {(this: any, key: string, value: any) => any} [reviver] + * @returns {any} + */ +const parse = (text, reviver) => { + const input = $parse(text, Primitives).map(primitives); + const value = input[0]; + const $ = reviver || noop; + const tmp = typeof value === object && value ? + revive(input, new Set, value, $) : + value; + return $.call({'': tmp}, '', tmp); +}; +exports.parse = parse; + +/** + * Converts a JS value into a specialized flatted string. + * @param {any} value + * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer] + * @param {string | number | undefined} [space] + * @returns {string} + */ +const stringify = (value, replacer, space) => { + const $ = replacer && typeof replacer === object ? + (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) : + (replacer || noop); + const known = new Map; + const input = []; + const output = []; + let i = +set(known, input, $.call({'': value}, '', value)); + let firstRun = !i; + while (i < input.length) { + firstRun = true; + output[i] = $stringify(input[i++], replace, space); + } + return '[' + output.join(',') + ']'; + function replace(key, value) { + if (firstRun) { + firstRun = !firstRun; + return value; + } + const after = $.call(this, key, value); + switch (typeof after) { + case object: + if (after === null) return after; + case primitive: + return known.get(after) || set(known, input, after); + } + return after; + } +}; +exports.stringify = stringify; + +/** + * Converts a generic value into a JSON serializable object without losing recursion. + * @param {any} value + * @returns {any} + */ +const toJSON = value => $parse(stringify(value)); +exports.toJSON = toJSON; + +/** + * Converts a previously serialized object with recursion into a recursive one. + * @param {any} value + * @returns {any} + */ +const fromJSON = value => parse($stringify(value)); +exports.fromJSON = fromJSON; diff --git a/node_modules/flatted/cjs/package.json b/node_modules/flatted/cjs/package.json new file mode 100644 index 0000000..0292b99 --- /dev/null +++ b/node_modules/flatted/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/node_modules/flatted/es.js b/node_modules/flatted/es.js new file mode 100644 index 0000000..42c98ae --- /dev/null +++ b/node_modules/flatted/es.js @@ -0,0 +1 @@ +self.Flatted=function(t){"use strict";const{parse:e,stringify:n}=JSON,{keys:r}=Object,s=String,o="string",c={},l="object",a=(t,e)=>e,f=t=>t instanceof s?s(t):t,i=(t,e)=>typeof e===o?new s(e):e,u=(t,e,n,o)=>{const a=[];for(let f=r(n),{length:i}=f,u=0;u{const r=s(e.push(n)-1);return t.set(n,r),r},y=(t,n)=>{const r=e(t,i).map(f),s=r[0],o=n||a,c=typeof s===l&&s?u(r,new Set,s,o):s;return o.call({"":c},"",c)},g=(t,e,r)=>{const s=e&&typeof e===l?(t,n)=>""===t||-1y(n(t)),t.parse=y,t.stringify=g,t.toJSON=t=>e(g(t)),t}({}); diff --git a/node_modules/flatted/esm.js b/node_modules/flatted/esm.js new file mode 100644 index 0000000..a5d5351 --- /dev/null +++ b/node_modules/flatted/esm.js @@ -0,0 +1 @@ +const{parse:t,stringify:e}=JSON,{keys:n}=Object,l=String,o="string",r={},s="object",c=(t,e)=>e,a=t=>t instanceof l?l(t):t,f=(t,e)=>typeof e===o?new l(e):e,i=(t,e,o,c)=>{const a=[];for(let f=n(o),{length:i}=f,p=0;p{const o=l(e.push(n)-1);return t.set(n,o),o},u=(e,n)=>{const l=t(e,f).map(a),o=l[0],r=n||c,p=typeof o===s&&o?i(l,new Set,o,r):o;return r.call({"":p},"",p)},h=(t,n,l)=>{const r=n&&typeof n===s?(t,e)=>""===t||-1t(h(e)),g=t=>u(e(t));export{g as fromJSON,u as parse,h as stringify,y as toJSON}; diff --git a/node_modules/flatted/esm/index.js b/node_modules/flatted/esm/index.js new file mode 100644 index 0000000..d203851 --- /dev/null +++ b/node_modules/flatted/esm/index.js @@ -0,0 +1,120 @@ +/// + +// (c) 2020-present Andrea Giammarchi + +const {parse: $parse, stringify: $stringify} = JSON; +const {keys} = Object; + +const Primitive = String; // it could be Number +const primitive = 'string'; // it could be 'number' + +const ignore = {}; +const object = 'object'; + +const noop = (_, value) => value; + +const primitives = value => ( + value instanceof Primitive ? Primitive(value) : value +); + +const Primitives = (_, value) => ( + typeof value === primitive ? new Primitive(value) : value +); + +const revive = (input, parsed, output, $) => { + const lazy = []; + for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) { + const k = ke[y]; + const value = output[k]; + if (value instanceof Primitive) { + const tmp = input[value]; + if (typeof tmp === object && !parsed.has(tmp)) { + parsed.add(tmp); + output[k] = ignore; + lazy.push({k, a: [input, parsed, tmp, $]}); + } + else + output[k] = $.call(output, k, tmp); + } + else if (output[k] !== ignore) + output[k] = $.call(output, k, value); + } + for (let {length} = lazy, i = 0; i < length; i++) { + const {k, a} = lazy[i]; + output[k] = $.call(output, k, revive.apply(null, a)); + } + return output; +}; + +const set = (known, input, value) => { + const index = Primitive(input.push(value) - 1); + known.set(value, index); + return index; +}; + +/** + * Converts a specialized flatted string into a JS value. + * @param {string} text + * @param {(this: any, key: string, value: any) => any} [reviver] + * @returns {any} + */ +export const parse = (text, reviver) => { + const input = $parse(text, Primitives).map(primitives); + const value = input[0]; + const $ = reviver || noop; + const tmp = typeof value === object && value ? + revive(input, new Set, value, $) : + value; + return $.call({'': tmp}, '', tmp); +}; + +/** + * Converts a JS value into a specialized flatted string. + * @param {any} value + * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer] + * @param {string | number | undefined} [space] + * @returns {string} + */ +export const stringify = (value, replacer, space) => { + const $ = replacer && typeof replacer === object ? + (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) : + (replacer || noop); + const known = new Map; + const input = []; + const output = []; + let i = +set(known, input, $.call({'': value}, '', value)); + let firstRun = !i; + while (i < input.length) { + firstRun = true; + output[i] = $stringify(input[i++], replace, space); + } + return '[' + output.join(',') + ']'; + function replace(key, value) { + if (firstRun) { + firstRun = !firstRun; + return value; + } + const after = $.call(this, key, value); + switch (typeof after) { + case object: + if (after === null) return after; + case primitive: + return known.get(after) || set(known, input, after); + } + return after; + } +}; + +/** + * Converts a generic value into a JSON serializable object without losing recursion. + * @param {any} value + * @returns {any} + */ +export const toJSON = value => $parse(stringify(value)); + +/** + * Converts a previously serialized object with recursion into a recursive one. + * @param {any} value + * @returns {any} + */ +export const fromJSON = value => parse($stringify(value)); diff --git a/node_modules/flatted/index.js b/node_modules/flatted/index.js new file mode 100644 index 0000000..f40414a --- /dev/null +++ b/node_modules/flatted/index.js @@ -0,0 +1,146 @@ +self.Flatted = (function (exports) { + 'use strict'; + + function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); + } + + /// + + // (c) 2020-present Andrea Giammarchi + + var $parse = JSON.parse, + $stringify = JSON.stringify; + var keys = Object.keys; + var Primitive = String; // it could be Number + var primitive = 'string'; // it could be 'number' + + var ignore = {}; + var object = 'object'; + var noop = function noop(_, value) { + return value; + }; + var primitives = function primitives(value) { + return value instanceof Primitive ? Primitive(value) : value; + }; + var Primitives = function Primitives(_, value) { + return _typeof(value) === primitive ? new Primitive(value) : value; + }; + var _revive = function revive(input, parsed, output, $) { + var lazy = []; + for (var ke = keys(output), length = ke.length, y = 0; y < length; y++) { + var k = ke[y]; + var value = output[k]; + if (value instanceof Primitive) { + var tmp = input[value]; + if (_typeof(tmp) === object && !parsed.has(tmp)) { + parsed.add(tmp); + output[k] = ignore; + lazy.push({ + k: k, + a: [input, parsed, tmp, $] + }); + } else output[k] = $.call(output, k, tmp); + } else if (output[k] !== ignore) output[k] = $.call(output, k, value); + } + for (var _length = lazy.length, i = 0; i < _length; i++) { + var _lazy$i = lazy[i], + _k = _lazy$i.k, + a = _lazy$i.a; + output[_k] = $.call(output, _k, _revive.apply(null, a)); + } + return output; + }; + var set = function set(known, input, value) { + var index = Primitive(input.push(value) - 1); + known.set(value, index); + return index; + }; + + /** + * Converts a specialized flatted string into a JS value. + * @param {string} text + * @param {(this: any, key: string, value: any) => any} [reviver] + * @returns {any} + */ + var parse = function parse(text, reviver) { + var input = $parse(text, Primitives).map(primitives); + var value = input[0]; + var $ = reviver || noop; + var tmp = _typeof(value) === object && value ? _revive(input, new Set(), value, $) : value; + return $.call({ + '': tmp + }, '', tmp); + }; + + /** + * Converts a JS value into a specialized flatted string. + * @param {any} value + * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer] + * @param {string | number | undefined} [space] + * @returns {string} + */ + var stringify = function stringify(value, replacer, space) { + var $ = replacer && _typeof(replacer) === object ? function (k, v) { + return k === '' || -1 < replacer.indexOf(k) ? v : void 0; + } : replacer || noop; + var known = new Map(); + var input = []; + var output = []; + var i = +set(known, input, $.call({ + '': value + }, '', value)); + var firstRun = !i; + while (i < input.length) { + firstRun = true; + output[i] = $stringify(input[i++], replace, space); + } + return '[' + output.join(',') + ']'; + function replace(key, value) { + if (firstRun) { + firstRun = !firstRun; + return value; + } + var after = $.call(this, key, value); + switch (_typeof(after)) { + case object: + if (after === null) return after; + case primitive: + return known.get(after) || set(known, input, after); + } + return after; + } + }; + + /** + * Converts a generic value into a JSON serializable object without losing recursion. + * @param {any} value + * @returns {any} + */ + var toJSON = function toJSON(value) { + return $parse(stringify(value)); + }; + + /** + * Converts a previously serialized object with recursion into a recursive one. + * @param {any} value + * @returns {any} + */ + var fromJSON = function fromJSON(value) { + return parse($stringify(value)); + }; + + exports.fromJSON = fromJSON; + exports.parse = parse; + exports.stringify = stringify; + exports.toJSON = toJSON; + + return exports; + +})({}); diff --git a/node_modules/flatted/min.js b/node_modules/flatted/min.js new file mode 100644 index 0000000..ad049a4 --- /dev/null +++ b/node_modules/flatted/min.js @@ -0,0 +1 @@ +self.Flatted=function(n){"use strict";function t(n){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t(n)}var r=JSON.parse,e=JSON.stringify,o=Object.keys,u=String,f="string",i={},c="object",a=function(n,t){return t},l=function(n){return n instanceof u?u(n):n},s=function(n,r){return t(r)===f?new u(r):r},y=function(n,r,e,f){for(var a=[],l=o(e),s=l.length,p=0;p ./coverage/lcov.info" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/WebReflection/flatted.git" + }, + "files": [ + "LICENSE", + "README.md", + "cjs/", + "es.js", + "esm.js", + "esm/", + "index.js", + "min.js", + "php/flatted.php", + "python/flatted.py", + "types/" + ], + "keywords": [ + "circular", + "JSON", + "fast", + "parser", + "minimal" + ], + "author": "Andrea Giammarchi", + "license": "ISC", + "bugs": { + "url": "https://github.com/WebReflection/flatted/issues" + }, + "homepage": "https://github.com/WebReflection/flatted#readme", + "devDependencies": { + "@babel/core": "^7.26.9", + "@babel/preset-env": "^7.26.9", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-terser": "^0.4.4", + "@ungap/structured-clone": "^1.3.0", + "ascjs": "^6.0.3", + "c8": "^10.1.3", + "circular-json": "^0.5.9", + "circular-json-es6": "^2.0.2", + "jsan": "^3.1.14", + "rollup": "^4.34.8", + "terser": "^5.39.0", + "typescript": "^5.7.3" + }, + "module": "./esm/index.js", + "type": "module", + "exports": { + ".": { + "types": "./types/index.d.ts", + "import": "./esm/index.js", + "default": "./cjs/index.js" + }, + "./esm": "./esm.js", + "./package.json": "./package.json" + }, + "types": "./types/index.d.ts" +} diff --git a/node_modules/flatted/php/flatted.php b/node_modules/flatted/php/flatted.php new file mode 100644 index 0000000..22659f6 --- /dev/null +++ b/node_modules/flatted/php/flatted.php @@ -0,0 +1,156 @@ +value = $value; + } +} + +class Flatted { + + // public utilities + public static function parse($json, $assoc = false, $depth = 512, $options = 0) { + $input = array_map( + 'Flatted::asString', + array_map( + 'Flatted::wrap', + json_decode($json, $assoc, $depth, $options) + ) + ); + $value = &$input[0]; + $set = array(); + $set[] = &$value; + if (is_array($value)) + return Flatted::loop(false, array_keys($value), $input, $set, $value); + if (is_object($value)) + return Flatted::loop(true, Flatted::keys($value), $input, $set, $value); + return $value; + } + + public static function stringify($value, $options = 0, $depth = 512) { + $known = new stdClass; + $known->key = array(); + $known->value = array(); + $input = array(); + $output = array(); + $i = intval(Flatted::index($known, $input, $value)); + while ($i < count($input)) { + $output[$i] = Flatted::transform($known, $input, $input[$i]); + $i++; + } + return json_encode($output, $options, $depth); + } + + // private helpers + private static function asString($value) { + return $value instanceof FlattedString ? $value->value : $value; + } + + private static function index(&$known, &$input, &$value) { + $input[] = &$value; + $index = strval(count($input) - 1); + $known->key[] = &$value; + $known->value[] = &$index; + return $index; + } + + private static function keys(&$value) { + $obj = new ReflectionObject($value); + $props = $obj->getProperties(); + $keys = array(); + foreach ($props as $prop) + $keys[] = $prop->getName(); + return $keys; + } + + private static function loop($obj, $keys, &$input, &$set, &$output) { + foreach ($keys as $key) { + $value = $obj ? $output->$key : $output[$key]; + if ($value instanceof FlattedString) + Flatted::ref($obj, $key, $input[$value->value], $input, $set, $output); + } + return $output; + } + + private static function relate(&$known, &$input, &$value) { + if (is_string($value) || is_array($value) || is_object($value)) { + $key = array_search($value, $known->key, true); + if ($key !== false) + return $known->value[$key]; + return Flatted::index($known, $input, $value); + } + return $value; + } + + private static function ref($obj, &$key, &$value, &$input, &$set, &$output) { + if (is_array($value) && !in_array($value, $set, true)) { + $set[] = $value; + $value = Flatted::loop(false, array_keys($value), $input, $set, $value); + } + elseif (is_object($value) && !in_array($value, $set, true)) { + $set[] = $value; + $value = Flatted::loop(true, Flatted::keys($value), $input, $set, $value); + } + if ($obj) { + $output->$key = &$value; + } + else { + $output[$key] = &$value; + } + } + + private static function transform(&$known, &$input, &$value) { + if (is_array($value)) { + return array_map( + function ($value) use(&$known, &$input) { + return Flatted::relate($known, $input, $value); + }, + $value + ); + } + if (is_object($value)) { + $object = new stdClass; + $keys = Flatted::keys($value); + foreach ($keys as $key) + $object->$key = Flatted::relate($known, $input, $value->$key); + return $object; + } + return $value; + } + + private static function wrap($value) { + if (is_string($value)) { + return new FlattedString($value); + } + if (is_array($value)) { + return array_map('Flatted::wrap', $value); + } + if (is_object($value)) { + $keys = Flatted::keys($value); + foreach ($keys as $key) { + $value->$key = self::wrap($value->$key); + } + } + return $value; + } +} +?> \ No newline at end of file diff --git a/node_modules/flatted/python/flatted.py b/node_modules/flatted/python/flatted.py new file mode 100644 index 0000000..a7e57fc --- /dev/null +++ b/node_modules/flatted/python/flatted.py @@ -0,0 +1,149 @@ +# ISC License +# +# Copyright (c) 2018-2025, Andrea Giammarchi, @WebReflection +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +import json as _json + +class _Known: + def __init__(self): + self.key = [] + self.value = [] + +class _String: + def __init__(self, value): + self.value = value + + +def _array_keys(value): + keys = [] + i = 0 + for _ in value: + keys.append(i) + i += 1 + return keys + +def _object_keys(value): + keys = [] + for key in value: + keys.append(key) + return keys + +def _is_array(value): + return isinstance(value, (list, tuple)) + +def _is_object(value): + return isinstance(value, dict) + +def _is_string(value): + return isinstance(value, str) + +def _index(known, input, value): + input.append(value) + index = str(len(input) - 1) + known.key.append(value) + known.value.append(index) + return index + +def _loop(keys, input, known, output): + for key in keys: + value = output[key] + if isinstance(value, _String): + _ref(key, input[int(value.value)], input, known, output) + + return output + +def _ref(key, value, input, known, output): + if _is_array(value) and value not in known: + known.append(value) + value = _loop(_array_keys(value), input, known, value) + elif _is_object(value) and value not in known: + known.append(value) + value = _loop(_object_keys(value), input, known, value) + + output[key] = value + +def _relate(known, input, value): + if _is_string(value) or _is_array(value) or _is_object(value): + try: + return known.value[known.key.index(value)] + except: + return _index(known, input, value) + + return value + +def _transform(known, input, value): + if _is_array(value): + output = [] + for val in value: + output.append(_relate(known, input, val)) + return output + + if _is_object(value): + obj = {} + for key in value: + obj[key] = _relate(known, input, value[key]) + return obj + + return value + +def _wrap(value): + if _is_string(value): + return _String(value) + + if _is_array(value): + i = 0 + for val in value: + value[i] = _wrap(val) + i += 1 + + elif _is_object(value): + for key in value: + value[key] = _wrap(value[key]) + + return value + +def parse(value, *args, **kwargs): + json = _json.loads(value, *args, **kwargs) + wrapped = [] + for value in json: + wrapped.append(_wrap(value)) + + input = [] + for value in wrapped: + if isinstance(value, _String): + input.append(value.value) + else: + input.append(value) + + value = input[0] + + if _is_array(value): + return _loop(_array_keys(value), input, [value], value) + + if _is_object(value): + return _loop(_object_keys(value), input, [value], value) + + return value + + +def stringify(value, *args, **kwargs): + known = _Known() + input = [] + output = [] + i = int(_index(known, input, value)) + while i < len(input): + output.append(_transform(known, input, input[i])) + i += 1 + return _json.dumps(output, *args, **kwargs) diff --git a/node_modules/glob-parent/LICENSE b/node_modules/glob-parent/LICENSE new file mode 100644 index 0000000..d701b08 --- /dev/null +++ b/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015, 2019 Elan Shanker, 2021 Blaine Bublitz , Eric Schoffstall and other contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob-parent/README.md b/node_modules/glob-parent/README.md new file mode 100644 index 0000000..6ae18a1 --- /dev/null +++ b/node_modules/glob-parent/README.md @@ -0,0 +1,134 @@ +

+ + + +

+ +# glob-parent + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] + +Extract the non-magic parent path from a glob string. + +## Usage + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## API + +### `globParent(maybeGlobString, [options])` + +Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. + +#### options + +```js +{ + // Disables the automatic conversion of slashes for Windows + flipBackslashes: true; +} +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) unless used as a path segment alone +- `*` (asterisk) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/'); // 'foo' +globParent('foo/\\[bar]/'); // 'foo/[bar]' +``` + +## Limitations + +### Braces & Brackets + +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +### Windows + +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext'); // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext'); // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]'); // 'foo ' +globParent('foo \\[bar]*'); // 'foo ' + +// GOOD +globParent('./foo \\[bar]'); // 'foo [bar]' +globParent('./foo \\[bar]*'); // '.' +``` + +## License + +ISC + + +[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/glob-parent +[npm-image]: https://img.shields.io/npm/v/glob-parent.svg?style=flat-square + +[ci-url]: https://github.com/gulpjs/glob-parent/actions?query=workflow:dev +[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/glob-parent/dev?style=flat-square + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg?style=flat-square + + + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets + diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js new file mode 100644 index 0000000..09dde64 --- /dev/null +++ b/node_modules/glob-parent/index.js @@ -0,0 +1,75 @@ +'use strict'; + +var isGlob = require('is-glob'); +var pathPosixDirname = require('path').posix.dirname; +var isWin32 = require('os').platform() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var escaped = /\\([!*?|[\](){}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (isEnclosure(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlobby(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; + +function isEnclosure(str) { + var lastChar = str.slice(-1); + + var enclosureStart; + switch (lastChar) { + case '}': + enclosureStart = '{'; + break; + case ']': + enclosureStart = '['; + break; + default: + return false; + } + + var foundIndex = str.indexOf(enclosureStart); + if (foundIndex < 0) { + return false; + } + + return str.slice(foundIndex + 1, -1).includes(slash); +} + +function isGlobby(str) { + if (/\([^()]+$/.test(str)) { + return true; + } + if (str[0] === '{' || str[0] === '[') { + return true; + } + if (/[^\\][{[]/.test(str)) { + return true; + } + return isGlob(str); +} diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json new file mode 100644 index 0000000..baeab42 --- /dev/null +++ b/node_modules/glob-parent/package.json @@ -0,0 +1,54 @@ +{ + "name": "glob-parent", + "version": "6.0.2", + "description": "Extract the non-magic parent path from a glob string.", + "author": "Gulp Team (https://gulpjs.com/)", + "contributors": [ + "Elan Shanker (https://github.com/es128)", + "Blaine Bublitz " + ], + "repository": "gulpjs/glob-parent", + "license": "ISC", + "engines": { + "node": ">=10.13.0" + }, + "main": "index.js", + "files": [ + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only" + }, + "dependencies": { + "is-glob": "^4.0.3" + }, + "devDependencies": { + "eslint": "^7.0.0", + "eslint-config-gulp": "^5.0.0", + "expect": "^26.0.1", + "mocha": "^7.1.2", + "nyc": "^15.0.1" + }, + "nyc": { + "reporter": [ + "lcov", + "text-summary" + ] + }, + "prettier": { + "singleQuote": true + }, + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ] +} diff --git a/node_modules/globals/globals.json b/node_modules/globals/globals.json new file mode 100644 index 0000000..dc2817d --- /dev/null +++ b/node_modules/globals/globals.json @@ -0,0 +1,3154 @@ +{ + "amd": { + "define": false, + "require": false + }, + "applescript": { + "$": false, + "Application": false, + "Automation": false, + "console": false, + "delay": false, + "Library": false, + "ObjC": false, + "ObjectSpecifier": false, + "Path": false, + "Progress": false, + "Ref": false + }, + "atomtest": { + "advanceClock": false, + "atom": false, + "fakeClearInterval": false, + "fakeClearTimeout": false, + "fakeSetInterval": false, + "fakeSetTimeout": false, + "resetTimeouts": false, + "waitsForPromise": false + }, + "browser": { + "AbortController": false, + "AbortSignal": false, + "AbsoluteOrientationSensor": false, + "AbstractRange": false, + "Accelerometer": false, + "addEventListener": false, + "ai": false, + "AI": false, + "AITextSession": false, + "alert": false, + "AnalyserNode": false, + "Animation": false, + "AnimationEffect": false, + "AnimationEvent": false, + "AnimationPlaybackEvent": false, + "AnimationTimeline": false, + "atob": false, + "Attr": false, + "Audio": false, + "AudioBuffer": false, + "AudioBufferSourceNode": false, + "AudioContext": false, + "AudioData": false, + "AudioDecoder": false, + "AudioDestinationNode": false, + "AudioEncoder": false, + "AudioListener": false, + "AudioNode": false, + "AudioParam": false, + "AudioParamMap": false, + "AudioProcessingEvent": false, + "AudioScheduledSourceNode": false, + "AudioSinkInfo": false, + "AudioWorklet": false, + "AudioWorkletGlobalScope": false, + "AudioWorkletNode": false, + "AudioWorkletProcessor": false, + "AuthenticatorAssertionResponse": false, + "AuthenticatorAttestationResponse": false, + "AuthenticatorResponse": false, + "BackgroundFetchManager": false, + "BackgroundFetchRecord": false, + "BackgroundFetchRegistration": false, + "BarcodeDetector": false, + "BarProp": false, + "BaseAudioContext": false, + "BatteryManager": false, + "BeforeUnloadEvent": false, + "BiquadFilterNode": false, + "Blob": false, + "BlobEvent": false, + "Bluetooth": false, + "BluetoothCharacteristicProperties": false, + "BluetoothDevice": false, + "BluetoothRemoteGATTCharacteristic": false, + "BluetoothRemoteGATTDescriptor": false, + "BluetoothRemoteGATTServer": false, + "BluetoothRemoteGATTService": false, + "BluetoothUUID": false, + "blur": false, + "BroadcastChannel": false, + "BrowserCaptureMediaStreamTrack": false, + "btoa": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "cancelAnimationFrame": false, + "cancelIdleCallback": false, + "CanvasCaptureMediaStream": false, + "CanvasCaptureMediaStreamTrack": false, + "CanvasGradient": false, + "CanvasPattern": false, + "CanvasRenderingContext2D": false, + "CaptureController": false, + "CaretPosition": false, + "CDATASection": false, + "ChannelMergerNode": false, + "ChannelSplitterNode": false, + "ChapterInformation": false, + "CharacterBoundsUpdateEvent": false, + "CharacterData": false, + "clearInterval": false, + "clearTimeout": false, + "clientInformation": false, + "Clipboard": false, + "ClipboardEvent": false, + "ClipboardItem": false, + "close": false, + "closed": false, + "CloseEvent": false, + "CloseWatcher": false, + "Comment": false, + "CompositionEvent": false, + "CompressionStream": false, + "confirm": false, + "console": false, + "ConstantSourceNode": false, + "ContentVisibilityAutoStateChangeEvent": false, + "ConvolverNode": false, + "CookieChangeEvent": false, + "CookieDeprecationLabel": false, + "cookieStore": false, + "CookieStore": false, + "CookieStoreManager": false, + "CountQueuingStrategy": false, + "createImageBitmap": false, + "Credential": false, + "credentialless": false, + "CredentialsContainer": false, + "CropTarget": false, + "crossOriginIsolated": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CSS": false, + "CSSAnimation": false, + "CSSConditionRule": false, + "CSSContainerRule": false, + "CSSCounterStyleRule": false, + "CSSFontFaceRule": false, + "CSSFontFeatureValuesRule": false, + "CSSFontPaletteValuesRule": false, + "CSSGroupingRule": false, + "CSSImageValue": false, + "CSSImportRule": false, + "CSSKeyframeRule": false, + "CSSKeyframesRule": false, + "CSSKeywordValue": false, + "CSSLayerBlockRule": false, + "CSSLayerStatementRule": false, + "CSSMarginRule": false, + "CSSMathClamp": false, + "CSSMathInvert": false, + "CSSMathMax": false, + "CSSMathMin": false, + "CSSMathNegate": false, + "CSSMathProduct": false, + "CSSMathSum": false, + "CSSMathValue": false, + "CSSMatrixComponent": false, + "CSSMediaRule": false, + "CSSNamespaceRule": false, + "CSSNestedDeclarations": false, + "CSSNumericArray": false, + "CSSNumericValue": false, + "CSSPageDescriptors": false, + "CSSPageRule": false, + "CSSPerspective": false, + "CSSPositionTryDescriptors": false, + "CSSPositionTryRule": false, + "CSSPositionValue": false, + "CSSPropertyRule": false, + "CSSRotate": false, + "CSSRule": false, + "CSSRuleList": false, + "CSSScale": false, + "CSSScopeRule": false, + "CSSSkew": false, + "CSSSkewX": false, + "CSSSkewY": false, + "CSSStartingStyleRule": false, + "CSSStyleDeclaration": false, + "CSSStyleRule": false, + "CSSStyleSheet": false, + "CSSStyleValue": false, + "CSSSupportsRule": false, + "CSSTransformComponent": false, + "CSSTransformValue": false, + "CSSTransition": false, + "CSSTranslate": false, + "CSSUnitValue": false, + "CSSUnparsedValue": false, + "CSSVariableReferenceValue": false, + "CSSViewTransitionRule": false, + "currentFrame": false, + "currentTime": false, + "CustomElementRegistry": false, + "customElements": false, + "CustomEvent": false, + "CustomStateSet": false, + "DataTransfer": false, + "DataTransferItem": false, + "DataTransferItemList": false, + "DecompressionStream": false, + "DelayNode": false, + "DelegatedInkTrailPresenter": false, + "DeviceMotionEvent": false, + "DeviceMotionEventAcceleration": false, + "DeviceMotionEventRotationRate": false, + "DeviceOrientationEvent": false, + "devicePixelRatio": false, + "dispatchEvent": false, + "document": false, + "Document": false, + "DocumentFragment": false, + "documentPictureInPicture": false, + "DocumentPictureInPicture": false, + "DocumentPictureInPictureEvent": false, + "DocumentTimeline": false, + "DocumentType": false, + "DOMError": false, + "DOMException": false, + "DOMImplementation": false, + "DOMMatrix": false, + "DOMMatrixReadOnly": false, + "DOMParser": false, + "DOMPoint": false, + "DOMPointReadOnly": false, + "DOMQuad": false, + "DOMRect": false, + "DOMRectList": false, + "DOMRectReadOnly": false, + "DOMStringList": false, + "DOMStringMap": false, + "DOMTokenList": false, + "DragEvent": false, + "DynamicsCompressorNode": false, + "EditContext": false, + "Element": false, + "ElementInternals": false, + "EncodedAudioChunk": false, + "EncodedVideoChunk": false, + "ErrorEvent": false, + "event": false, + "Event": false, + "EventCounts": false, + "EventSource": false, + "EventTarget": false, + "external": false, + "External": false, + "EyeDropper": false, + "FeaturePolicy": false, + "FederatedCredential": false, + "fence": false, + "Fence": false, + "FencedFrameConfig": false, + "fetch": false, + "fetchLater": false, + "FetchLaterResult": false, + "File": false, + "FileList": false, + "FileReader": false, + "FileSystem": false, + "FileSystemDirectoryEntry": false, + "FileSystemDirectoryHandle": false, + "FileSystemDirectoryReader": false, + "FileSystemEntry": false, + "FileSystemFileEntry": false, + "FileSystemFileHandle": false, + "FileSystemHandle": false, + "FileSystemWritableFileStream": false, + "find": false, + "Float16Array": false, + "focus": false, + "FocusEvent": false, + "FontData": false, + "FontFace": false, + "FontFaceSet": false, + "FontFaceSetLoadEvent": false, + "FormData": false, + "FormDataEvent": false, + "FragmentDirective": false, + "frameElement": false, + "frames": false, + "GainNode": false, + "Gamepad": false, + "GamepadAxisMoveEvent": false, + "GamepadButton": false, + "GamepadButtonEvent": false, + "GamepadEvent": false, + "GamepadHapticActuator": false, + "GamepadPose": false, + "Geolocation": false, + "GeolocationCoordinates": false, + "GeolocationPosition": false, + "GeolocationPositionError": false, + "getComputedStyle": false, + "getScreenDetails": false, + "getSelection": false, + "GPU": false, + "GPUAdapter": false, + "GPUAdapterInfo": false, + "GPUBindGroup": false, + "GPUBindGroupLayout": false, + "GPUBuffer": false, + "GPUBufferUsage": false, + "GPUCanvasContext": false, + "GPUColorWrite": false, + "GPUCommandBuffer": false, + "GPUCommandEncoder": false, + "GPUCompilationInfo": false, + "GPUCompilationMessage": false, + "GPUComputePassEncoder": false, + "GPUComputePipeline": false, + "GPUDevice": false, + "GPUDeviceLostInfo": false, + "GPUError": false, + "GPUExternalTexture": false, + "GPUInternalError": false, + "GPUMapMode": false, + "GPUOutOfMemoryError": false, + "GPUPipelineError": false, + "GPUPipelineLayout": false, + "GPUQuerySet": false, + "GPUQueue": false, + "GPURenderBundle": false, + "GPURenderBundleEncoder": false, + "GPURenderPassEncoder": false, + "GPURenderPipeline": false, + "GPUSampler": false, + "GPUShaderModule": false, + "GPUShaderStage": false, + "GPUSupportedFeatures": false, + "GPUSupportedLimits": false, + "GPUTexture": false, + "GPUTextureUsage": false, + "GPUTextureView": false, + "GPUUncapturedErrorEvent": false, + "GPUValidationError": false, + "GravitySensor": false, + "Gyroscope": false, + "HashChangeEvent": false, + "Headers": false, + "HID": false, + "HIDConnectionEvent": false, + "HIDDevice": false, + "HIDInputReportEvent": false, + "Highlight": false, + "HighlightRegistry": false, + "history": false, + "History": false, + "HTMLAllCollection": false, + "HTMLAnchorElement": false, + "HTMLAreaElement": false, + "HTMLAudioElement": false, + "HTMLBaseElement": false, + "HTMLBodyElement": false, + "HTMLBRElement": false, + "HTMLButtonElement": false, + "HTMLCanvasElement": false, + "HTMLCollection": false, + "HTMLDataElement": false, + "HTMLDataListElement": false, + "HTMLDetailsElement": false, + "HTMLDialogElement": false, + "HTMLDirectoryElement": false, + "HTMLDivElement": false, + "HTMLDListElement": false, + "HTMLDocument": false, + "HTMLElement": false, + "HTMLEmbedElement": false, + "HTMLFencedFrameElement": false, + "HTMLFieldSetElement": false, + "HTMLFontElement": false, + "HTMLFormControlsCollection": false, + "HTMLFormElement": false, + "HTMLFrameElement": false, + "HTMLFrameSetElement": false, + "HTMLHeadElement": false, + "HTMLHeadingElement": false, + "HTMLHRElement": false, + "HTMLHtmlElement": false, + "HTMLIFrameElement": false, + "HTMLImageElement": false, + "HTMLInputElement": false, + "HTMLLabelElement": false, + "HTMLLegendElement": false, + "HTMLLIElement": false, + "HTMLLinkElement": false, + "HTMLMapElement": false, + "HTMLMarqueeElement": false, + "HTMLMediaElement": false, + "HTMLMenuElement": false, + "HTMLMetaElement": false, + "HTMLMeterElement": false, + "HTMLModElement": false, + "HTMLObjectElement": false, + "HTMLOListElement": false, + "HTMLOptGroupElement": false, + "HTMLOptionElement": false, + "HTMLOptionsCollection": false, + "HTMLOutputElement": false, + "HTMLParagraphElement": false, + "HTMLParamElement": false, + "HTMLPictureElement": false, + "HTMLPreElement": false, + "HTMLProgressElement": false, + "HTMLQuoteElement": false, + "HTMLScriptElement": false, + "HTMLSelectElement": false, + "HTMLSlotElement": false, + "HTMLSourceElement": false, + "HTMLSpanElement": false, + "HTMLStyleElement": false, + "HTMLTableCaptionElement": false, + "HTMLTableCellElement": false, + "HTMLTableColElement": false, + "HTMLTableElement": false, + "HTMLTableRowElement": false, + "HTMLTableSectionElement": false, + "HTMLTemplateElement": false, + "HTMLTextAreaElement": false, + "HTMLTimeElement": false, + "HTMLTitleElement": false, + "HTMLTrackElement": false, + "HTMLUListElement": false, + "HTMLUnknownElement": false, + "HTMLVideoElement": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "IdentityCredential": false, + "IdentityCredentialError": false, + "IdentityProvider": false, + "IdleDeadline": false, + "IdleDetector": false, + "IIRFilterNode": false, + "Image": false, + "ImageBitmap": false, + "ImageBitmapRenderingContext": false, + "ImageCapture": false, + "ImageData": false, + "ImageDecoder": false, + "ImageTrack": false, + "ImageTrackList": false, + "indexedDB": false, + "Ink": false, + "innerHeight": false, + "innerWidth": false, + "InputDeviceCapabilities": false, + "InputDeviceInfo": false, + "InputEvent": false, + "IntersectionObserver": false, + "IntersectionObserverEntry": false, + "isSecureContext": false, + "Keyboard": false, + "KeyboardEvent": false, + "KeyboardLayoutMap": false, + "KeyframeEffect": false, + "LargestContentfulPaint": false, + "LaunchParams": false, + "launchQueue": false, + "LaunchQueue": false, + "LayoutShift": false, + "LayoutShiftAttribution": false, + "length": false, + "LinearAccelerationSensor": false, + "localStorage": false, + "location": true, + "Location": false, + "locationbar": false, + "Lock": false, + "LockManager": false, + "matchMedia": false, + "MathMLElement": false, + "MediaCapabilities": false, + "MediaCapabilitiesInfo": false, + "MediaDeviceInfo": false, + "MediaDevices": false, + "MediaElementAudioSourceNode": false, + "MediaEncryptedEvent": false, + "MediaError": false, + "MediaKeyError": false, + "MediaKeyMessageEvent": false, + "MediaKeys": false, + "MediaKeySession": false, + "MediaKeyStatusMap": false, + "MediaKeySystemAccess": false, + "MediaList": false, + "MediaMetadata": false, + "MediaQueryList": false, + "MediaQueryListEvent": false, + "MediaRecorder": false, + "MediaRecorderErrorEvent": false, + "MediaSession": false, + "MediaSource": false, + "MediaSourceHandle": false, + "MediaStream": false, + "MediaStreamAudioDestinationNode": false, + "MediaStreamAudioSourceNode": false, + "MediaStreamEvent": false, + "MediaStreamTrack": false, + "MediaStreamTrackAudioSourceNode": false, + "MediaStreamTrackAudioStats": false, + "MediaStreamTrackEvent": false, + "MediaStreamTrackGenerator": false, + "MediaStreamTrackProcessor": false, + "MediaStreamTrackVideoStats": false, + "menubar": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "MIDIAccess": false, + "MIDIConnectionEvent": false, + "MIDIInput": false, + "MIDIInputMap": false, + "MIDIMessageEvent": false, + "MIDIOutput": false, + "MIDIOutputMap": false, + "MIDIPort": false, + "MimeType": false, + "MimeTypeArray": false, + "model": false, + "ModelGenericSession": false, + "ModelManager": false, + "MouseEvent": false, + "moveBy": false, + "moveTo": false, + "MutationEvent": false, + "MutationObserver": false, + "MutationRecord": false, + "name": false, + "NamedNodeMap": false, + "NavigateEvent": false, + "navigation": false, + "Navigation": false, + "NavigationActivation": false, + "NavigationCurrentEntryChangeEvent": false, + "NavigationDestination": false, + "NavigationHistoryEntry": false, + "NavigationPreloadManager": false, + "NavigationTransition": false, + "navigator": false, + "Navigator": false, + "NavigatorLogin": false, + "NavigatorManagedData": false, + "NavigatorUAData": false, + "NetworkInformation": false, + "Node": false, + "NodeFilter": false, + "NodeIterator": false, + "NodeList": false, + "Notification": false, + "NotifyPaintEvent": false, + "NotRestoredReasonDetails": false, + "NotRestoredReasons": false, + "OfflineAudioCompletionEvent": false, + "OfflineAudioContext": false, + "offscreenBuffering": false, + "OffscreenCanvas": false, + "OffscreenCanvasRenderingContext2D": false, + "onabort": true, + "onafterprint": true, + "onanimationcancel": true, + "onanimationend": true, + "onanimationiteration": true, + "onanimationstart": true, + "onappinstalled": true, + "onauxclick": true, + "onbeforeinput": true, + "onbeforeinstallprompt": true, + "onbeforematch": true, + "onbeforeprint": true, + "onbeforetoggle": true, + "onbeforeunload": true, + "onbeforexrselect": true, + "onblur": true, + "oncancel": true, + "oncanplay": true, + "oncanplaythrough": true, + "onchange": true, + "onclick": true, + "onclose": true, + "oncontentvisibilityautostatechange": true, + "oncontextlost": true, + "oncontextmenu": true, + "oncontextrestored": true, + "oncopy": true, + "oncuechange": true, + "oncut": true, + "ondblclick": true, + "ondevicemotion": true, + "ondeviceorientation": true, + "ondeviceorientationabsolute": true, + "ondrag": true, + "ondragend": true, + "ondragenter": true, + "ondragleave": true, + "ondragover": true, + "ondragstart": true, + "ondrop": true, + "ondurationchange": true, + "onemptied": true, + "onended": true, + "onerror": true, + "onfocus": true, + "onformdata": true, + "ongamepadconnected": true, + "ongamepaddisconnected": true, + "ongotpointercapture": true, + "onhashchange": true, + "oninput": true, + "oninvalid": true, + "onkeydown": true, + "onkeypress": true, + "onkeyup": true, + "onlanguagechange": true, + "onload": true, + "onloadeddata": true, + "onloadedmetadata": true, + "onloadstart": true, + "onlostpointercapture": true, + "onmessage": true, + "onmessageerror": true, + "onmousedown": true, + "onmouseenter": true, + "onmouseleave": true, + "onmousemove": true, + "onmouseout": true, + "onmouseover": true, + "onmouseup": true, + "onmousewheel": true, + "onoffline": true, + "ononline": true, + "onpagehide": true, + "onpagereveal": true, + "onpageshow": true, + "onpageswap": true, + "onpaste": true, + "onpause": true, + "onplay": true, + "onplaying": true, + "onpointercancel": true, + "onpointerdown": true, + "onpointerenter": true, + "onpointerleave": true, + "onpointermove": true, + "onpointerout": true, + "onpointerover": true, + "onpointerrawupdate": true, + "onpointerup": true, + "onpopstate": true, + "onprogress": true, + "onratechange": true, + "onrejectionhandled": true, + "onreset": true, + "onresize": true, + "onscroll": true, + "onscrollend": true, + "onscrollsnapchange": true, + "onscrollsnapchanging": true, + "onsearch": true, + "onsecuritypolicyviolation": true, + "onseeked": true, + "onseeking": true, + "onselect": true, + "onselectionchange": true, + "onselectstart": true, + "onslotchange": true, + "onstalled": true, + "onstorage": true, + "onsubmit": true, + "onsuspend": true, + "ontimeupdate": true, + "ontoggle": true, + "ontransitioncancel": true, + "ontransitionend": true, + "ontransitionrun": true, + "ontransitionstart": true, + "onunhandledrejection": true, + "onunload": true, + "onvolumechange": true, + "onwaiting": true, + "onwheel": true, + "open": false, + "opener": false, + "Option": false, + "OrientationSensor": false, + "origin": false, + "originAgentCluster": false, + "OscillatorNode": false, + "OTPCredential": false, + "outerHeight": false, + "outerWidth": false, + "OverconstrainedError": false, + "PageRevealEvent": false, + "PageSwapEvent": false, + "PageTransitionEvent": false, + "pageXOffset": false, + "pageYOffset": false, + "PannerNode": false, + "parent": false, + "PasswordCredential": false, + "Path2D": false, + "PaymentAddress": false, + "PaymentManager": false, + "PaymentMethodChangeEvent": false, + "PaymentRequest": false, + "PaymentRequestUpdateEvent": false, + "PaymentResponse": false, + "performance": false, + "Performance": false, + "PerformanceElementTiming": false, + "PerformanceEntry": false, + "PerformanceEventTiming": false, + "PerformanceLongAnimationFrameTiming": false, + "PerformanceLongTaskTiming": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceNavigationTiming": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformancePaintTiming": false, + "PerformanceResourceTiming": false, + "PerformanceScriptTiming": false, + "PerformanceServerTiming": false, + "PerformanceTiming": false, + "PeriodicSyncManager": false, + "PeriodicWave": false, + "Permissions": false, + "PermissionStatus": false, + "PERSISTENT": false, + "personalbar": false, + "PictureInPictureEvent": false, + "PictureInPictureWindow": false, + "Plugin": false, + "PluginArray": false, + "PointerEvent": false, + "PopStateEvent": false, + "postMessage": false, + "Presentation": false, + "PresentationAvailability": false, + "PresentationConnection": false, + "PresentationConnectionAvailableEvent": false, + "PresentationConnectionCloseEvent": false, + "PresentationConnectionList": false, + "PresentationReceiver": false, + "PresentationRequest": false, + "PressureObserver": false, + "PressureRecord": false, + "print": false, + "ProcessingInstruction": false, + "Profiler": false, + "ProgressEvent": false, + "PromiseRejectionEvent": false, + "prompt": false, + "ProtectedAudience": false, + "PublicKeyCredential": false, + "PushManager": false, + "PushSubscription": false, + "PushSubscriptionOptions": false, + "queryLocalFonts": false, + "queueMicrotask": false, + "RadioNodeList": false, + "Range": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "registerProcessor": false, + "RelativeOrientationSensor": false, + "RemotePlayback": false, + "removeEventListener": false, + "reportError": false, + "ReportingObserver": false, + "Request": false, + "requestAnimationFrame": false, + "requestIdleCallback": false, + "resizeBy": false, + "ResizeObserver": false, + "ResizeObserverEntry": false, + "ResizeObserverSize": false, + "resizeTo": false, + "Response": false, + "RTCCertificate": false, + "RTCDataChannel": false, + "RTCDataChannelEvent": false, + "RTCDtlsTransport": false, + "RTCDTMFSender": false, + "RTCDTMFToneChangeEvent": false, + "RTCEncodedAudioFrame": false, + "RTCEncodedVideoFrame": false, + "RTCError": false, + "RTCErrorEvent": false, + "RTCIceCandidate": false, + "RTCIceTransport": false, + "RTCPeerConnection": false, + "RTCPeerConnectionIceErrorEvent": false, + "RTCPeerConnectionIceEvent": false, + "RTCRtpReceiver": false, + "RTCRtpScriptTransform": false, + "RTCRtpSender": false, + "RTCRtpTransceiver": false, + "RTCSctpTransport": false, + "RTCSessionDescription": false, + "RTCStatsReport": false, + "RTCTrackEvent": false, + "sampleRate": false, + "scheduler": false, + "Scheduler": false, + "Scheduling": false, + "screen": false, + "Screen": false, + "ScreenDetailed": false, + "ScreenDetails": false, + "screenLeft": false, + "ScreenOrientation": false, + "screenTop": false, + "screenX": false, + "screenY": false, + "ScriptProcessorNode": false, + "scroll": false, + "scrollbars": false, + "scrollBy": false, + "ScrollTimeline": false, + "scrollTo": false, + "scrollX": false, + "scrollY": false, + "SecurityPolicyViolationEvent": false, + "Selection": false, + "self": false, + "Sensor": false, + "SensorErrorEvent": false, + "Serial": false, + "SerialPort": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerRegistration": false, + "sessionStorage": false, + "setInterval": false, + "setTimeout": false, + "ShadowRoot": false, + "sharedStorage": false, + "SharedStorage": false, + "SharedStorageWorklet": false, + "SharedWorker": false, + "showDirectoryPicker": false, + "showOpenFilePicker": false, + "showSaveFilePicker": false, + "SnapEvent": false, + "SourceBuffer": false, + "SourceBufferList": false, + "speechSynthesis": false, + "SpeechSynthesis": false, + "SpeechSynthesisErrorEvent": false, + "SpeechSynthesisEvent": false, + "SpeechSynthesisUtterance": false, + "SpeechSynthesisVoice": false, + "StaticRange": false, + "status": false, + "statusbar": false, + "StereoPannerNode": false, + "stop": false, + "Storage": false, + "StorageBucket": false, + "StorageBucketManager": false, + "StorageEvent": false, + "StorageManager": false, + "structuredClone": false, + "styleMedia": false, + "StylePropertyMap": false, + "StylePropertyMapReadOnly": false, + "StyleSheet": false, + "StyleSheetList": false, + "SubmitEvent": false, + "SubtleCrypto": false, + "SVGAElement": false, + "SVGAngle": false, + "SVGAnimatedAngle": false, + "SVGAnimatedBoolean": false, + "SVGAnimatedEnumeration": false, + "SVGAnimatedInteger": false, + "SVGAnimatedLength": false, + "SVGAnimatedLengthList": false, + "SVGAnimatedNumber": false, + "SVGAnimatedNumberList": false, + "SVGAnimatedPreserveAspectRatio": false, + "SVGAnimatedRect": false, + "SVGAnimatedString": false, + "SVGAnimatedTransformList": false, + "SVGAnimateElement": false, + "SVGAnimateMotionElement": false, + "SVGAnimateTransformElement": false, + "SVGAnimationElement": false, + "SVGCircleElement": false, + "SVGClipPathElement": false, + "SVGComponentTransferFunctionElement": false, + "SVGDefsElement": false, + "SVGDescElement": false, + "SVGElement": false, + "SVGEllipseElement": false, + "SVGFEBlendElement": false, + "SVGFEColorMatrixElement": false, + "SVGFEComponentTransferElement": false, + "SVGFECompositeElement": false, + "SVGFEConvolveMatrixElement": false, + "SVGFEDiffuseLightingElement": false, + "SVGFEDisplacementMapElement": false, + "SVGFEDistantLightElement": false, + "SVGFEDropShadowElement": false, + "SVGFEFloodElement": false, + "SVGFEFuncAElement": false, + "SVGFEFuncBElement": false, + "SVGFEFuncGElement": false, + "SVGFEFuncRElement": false, + "SVGFEGaussianBlurElement": false, + "SVGFEImageElement": false, + "SVGFEMergeElement": false, + "SVGFEMergeNodeElement": false, + "SVGFEMorphologyElement": false, + "SVGFEOffsetElement": false, + "SVGFEPointLightElement": false, + "SVGFESpecularLightingElement": false, + "SVGFESpotLightElement": false, + "SVGFETileElement": false, + "SVGFETurbulenceElement": false, + "SVGFilterElement": false, + "SVGForeignObjectElement": false, + "SVGGElement": false, + "SVGGeometryElement": false, + "SVGGradientElement": false, + "SVGGraphicsElement": false, + "SVGImageElement": false, + "SVGLength": false, + "SVGLengthList": false, + "SVGLinearGradientElement": false, + "SVGLineElement": false, + "SVGMarkerElement": false, + "SVGMaskElement": false, + "SVGMatrix": false, + "SVGMetadataElement": false, + "SVGMPathElement": false, + "SVGNumber": false, + "SVGNumberList": false, + "SVGPathElement": false, + "SVGPatternElement": false, + "SVGPoint": false, + "SVGPointList": false, + "SVGPolygonElement": false, + "SVGPolylineElement": false, + "SVGPreserveAspectRatio": false, + "SVGRadialGradientElement": false, + "SVGRect": false, + "SVGRectElement": false, + "SVGScriptElement": false, + "SVGSetElement": false, + "SVGStopElement": false, + "SVGStringList": false, + "SVGStyleElement": false, + "SVGSVGElement": false, + "SVGSwitchElement": false, + "SVGSymbolElement": false, + "SVGTextContentElement": false, + "SVGTextElement": false, + "SVGTextPathElement": false, + "SVGTextPositioningElement": false, + "SVGTitleElement": false, + "SVGTransform": false, + "SVGTransformList": false, + "SVGTSpanElement": false, + "SVGUnitTypes": false, + "SVGUseElement": false, + "SVGViewElement": false, + "SyncManager": false, + "TaskAttributionTiming": false, + "TaskController": false, + "TaskPriorityChangeEvent": false, + "TaskSignal": false, + "TEMPORARY": false, + "Text": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TextEvent": false, + "TextFormat": false, + "TextFormatUpdateEvent": false, + "TextMetrics": false, + "TextTrack": false, + "TextTrackCue": false, + "TextTrackCueList": false, + "TextTrackList": false, + "TextUpdateEvent": false, + "TimeEvent": false, + "TimeRanges": false, + "ToggleEvent": false, + "toolbar": false, + "top": false, + "Touch": false, + "TouchEvent": false, + "TouchList": false, + "TrackEvent": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "TransitionEvent": false, + "TreeWalker": false, + "TrustedHTML": false, + "TrustedScript": false, + "TrustedScriptURL": false, + "TrustedTypePolicy": false, + "TrustedTypePolicyFactory": false, + "trustedTypes": false, + "UIEvent": false, + "URL": false, + "URLPattern": false, + "URLSearchParams": false, + "USB": false, + "USBAlternateInterface": false, + "USBConfiguration": false, + "USBConnectionEvent": false, + "USBDevice": false, + "USBEndpoint": false, + "USBInterface": false, + "USBInTransferResult": false, + "USBIsochronousInTransferPacket": false, + "USBIsochronousInTransferResult": false, + "USBIsochronousOutTransferPacket": false, + "USBIsochronousOutTransferResult": false, + "USBOutTransferResult": false, + "UserActivation": false, + "ValidityState": false, + "VideoColorSpace": false, + "VideoDecoder": false, + "VideoEncoder": false, + "VideoFrame": false, + "VideoPlaybackQuality": false, + "ViewTimeline": false, + "ViewTransition": false, + "ViewTransitionTypeSet": false, + "VirtualKeyboard": false, + "VirtualKeyboardGeometryChangeEvent": false, + "VisibilityStateEntry": false, + "visualViewport": false, + "VisualViewport": false, + "VTTCue": false, + "VTTRegion": false, + "WakeLock": false, + "WakeLockSentinel": false, + "WaveShaperNode": false, + "WebAssembly": false, + "WebGL2RenderingContext": false, + "WebGLActiveInfo": false, + "WebGLBuffer": false, + "WebGLContextEvent": false, + "WebGLFramebuffer": false, + "WebGLObject": false, + "WebGLProgram": false, + "WebGLQuery": false, + "WebGLRenderbuffer": false, + "WebGLRenderingContext": false, + "WebGLSampler": false, + "WebGLShader": false, + "WebGLShaderPrecisionFormat": false, + "WebGLSync": false, + "WebGLTexture": false, + "WebGLTransformFeedback": false, + "WebGLUniformLocation": false, + "WebGLVertexArrayObject": false, + "WebSocket": false, + "WebSocketError": false, + "WebSocketStream": false, + "WebTransport": false, + "WebTransportBidirectionalStream": false, + "WebTransportDatagramDuplexStream": false, + "WebTransportError": false, + "WebTransportReceiveStream": false, + "WebTransportSendStream": false, + "WGSLLanguageFeatures": false, + "WheelEvent": false, + "window": false, + "Window": false, + "WindowControlsOverlay": false, + "WindowControlsOverlayGeometryChangeEvent": false, + "Worker": false, + "Worklet": false, + "WorkletGlobalScope": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false, + "XMLDocument": false, + "XMLHttpRequest": false, + "XMLHttpRequestEventTarget": false, + "XMLHttpRequestUpload": false, + "XMLSerializer": false, + "XPathEvaluator": false, + "XPathExpression": false, + "XPathResult": false, + "XRAnchor": false, + "XRAnchorSet": false, + "XRBoundedReferenceSpace": false, + "XRCamera": false, + "XRCPUDepthInformation": false, + "XRDepthInformation": false, + "XRDOMOverlayState": false, + "XRFrame": false, + "XRHand": false, + "XRHitTestResult": false, + "XRHitTestSource": false, + "XRInputSource": false, + "XRInputSourceArray": false, + "XRInputSourceEvent": false, + "XRInputSourcesChangeEvent": false, + "XRJointPose": false, + "XRJointSpace": false, + "XRLayer": false, + "XRLightEstimate": false, + "XRLightProbe": false, + "XRPose": false, + "XRRay": false, + "XRReferenceSpace": false, + "XRReferenceSpaceEvent": false, + "XRRenderState": false, + "XRRigidTransform": false, + "XRSession": false, + "XRSessionEvent": false, + "XRSpace": false, + "XRSystem": false, + "XRTransientInputHitTestResult": false, + "XRTransientInputHitTestSource": false, + "XRView": false, + "XRViewerPose": false, + "XRViewport": false, + "XRWebGLBinding": false, + "XRWebGLDepthInformation": false, + "XRWebGLLayer": false, + "XSLTProcessor": false + }, + "builtin": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "Iterator": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, + "chai": { + "assert": true, + "expect": true, + "should": true + }, + "commonjs": { + "exports": true, + "global": false, + "module": false, + "require": false + }, + "couch": { + "emit": false, + "exports": false, + "getRow": false, + "log": false, + "module": false, + "provides": false, + "require": false, + "respond": false, + "send": false, + "start": false, + "sum": false + }, + "devtools": { + "$": false, + "$_": false, + "$$": false, + "$0": false, + "$1": false, + "$2": false, + "$3": false, + "$4": false, + "$x": false, + "chrome": false, + "clear": false, + "copy": false, + "debug": false, + "dir": false, + "dirxml": false, + "getEventListeners": false, + "inspect": false, + "keys": false, + "monitor": false, + "monitorEvents": false, + "profile": false, + "profileEnd": false, + "queryObjects": false, + "table": false, + "undebug": false, + "unmonitor": false, + "unmonitorEvents": false, + "values": false + }, + "embertest": { + "andThen": false, + "click": false, + "currentPath": false, + "currentRouteName": false, + "currentURL": false, + "fillIn": false, + "find": false, + "findAll": false, + "findWithAssert": false, + "keyEvent": false, + "pauseTest": false, + "resumeTest": false, + "triggerEvent": false, + "visit": false, + "wait": false + }, + "es2015": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakSet": false + }, + "es2016": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakSet": false + }, + "es2017": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakSet": false + }, + "es2018": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakSet": false + }, + "es2019": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakSet": false + }, + "es2020": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakSet": false + }, + "es2021": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, + "es2022": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, + "es2023": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, + "es2024": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, + "es2025": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "Intl": false, + "isFinite": false, + "isNaN": false, + "Iterator": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, + "es3": { + "Array": false, + "Boolean": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false + }, + "es5": { + "Array": false, + "Boolean": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "JSON": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false + }, + "greasemonkey": { + "cloneInto": false, + "createObjectIn": false, + "exportFunction": false, + "GM": false, + "GM_addElement": false, + "GM_addStyle": false, + "GM_addValueChangeListener": false, + "GM_deleteValue": false, + "GM_download": false, + "GM_getResourceText": false, + "GM_getResourceURL": false, + "GM_getTab": false, + "GM_getTabs": false, + "GM_getValue": false, + "GM_info": false, + "GM_listValues": false, + "GM_log": false, + "GM_notification": false, + "GM_openInTab": false, + "GM_registerMenuCommand": false, + "GM_removeValueChangeListener": false, + "GM_saveTab": false, + "GM_setClipboard": false, + "GM_setValue": false, + "GM_unregisterMenuCommand": false, + "GM_xmlhttpRequest": false, + "unsafeWindow": false + }, + "jasmine": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "expectAsync": false, + "fail": false, + "fdescribe": false, + "fit": false, + "it": false, + "jasmine": false, + "pending": false, + "runs": false, + "spyOn": false, + "spyOnAllFunctions": false, + "spyOnProperty": false, + "waits": false, + "waitsFor": false, + "xdescribe": false, + "xit": false + }, + "jest": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "fit": false, + "it": false, + "jest": false, + "test": false, + "xdescribe": false, + "xit": false, + "xtest": false + }, + "jquery": { + "$": false, + "jQuery": false + }, + "meteor": { + "$": false, + "Accounts": false, + "AccountsClient": false, + "AccountsCommon": false, + "AccountsServer": false, + "App": false, + "Assets": false, + "Blaze": false, + "check": false, + "Cordova": false, + "DDP": false, + "DDPRateLimiter": false, + "DDPServer": false, + "Deps": false, + "EJSON": false, + "Email": false, + "HTTP": false, + "Log": false, + "Match": false, + "Meteor": false, + "Mongo": false, + "MongoInternals": false, + "Npm": false, + "Package": false, + "Plugin": false, + "process": false, + "Random": false, + "ReactiveDict": false, + "ReactiveVar": false, + "Router": false, + "ServiceConfiguration": false, + "Session": false, + "share": false, + "Spacebars": false, + "Template": false, + "Tinytest": false, + "Tracker": false, + "UI": false, + "Utils": false, + "WebApp": false, + "WebAppInternals": false + }, + "mocha": { + "after": false, + "afterEach": false, + "before": false, + "beforeEach": false, + "context": false, + "describe": false, + "it": false, + "mocha": false, + "run": false, + "setup": false, + "specify": false, + "suite": false, + "suiteSetup": false, + "suiteTeardown": false, + "teardown": false, + "test": false, + "xcontext": false, + "xdescribe": false, + "xit": false, + "xspecify": false + }, + "mongo": { + "_isWindows": false, + "_rand": false, + "BulkWriteResult": false, + "cat": false, + "cd": false, + "connect": false, + "db": false, + "getHostName": false, + "getMemInfo": false, + "hostname": false, + "ISODate": false, + "listFiles": false, + "load": false, + "ls": false, + "md5sumFile": false, + "mkdir": false, + "Mongo": false, + "NumberInt": false, + "NumberLong": false, + "ObjectId": false, + "PlanCache": false, + "print": false, + "printjson": false, + "pwd": false, + "quit": false, + "removeFile": false, + "rs": false, + "sh": false, + "UUID": false, + "version": false, + "WriteResult": false + }, + "nashorn": { + "__DIR__": false, + "__FILE__": false, + "__LINE__": false, + "com": false, + "edu": false, + "exit": false, + "java": false, + "Java": false, + "javafx": false, + "JavaImporter": false, + "javax": false, + "JSAdapter": false, + "load": false, + "loadWithNewGlobal": false, + "org": false, + "Packages": false, + "print": false, + "quit": false + }, + "node": { + "__dirname": false, + "__filename": false, + "AbortController": false, + "AbortSignal": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Buffer": false, + "ByteLengthQueuingStrategy": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "CloseEvent": false, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CustomEvent": false, + "DecompressionStream": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "exports": true, + "fetch": false, + "File": false, + "FormData": false, + "global": false, + "Headers": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "module": false, + "navigator": false, + "Navigator": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "process": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "Request": false, + "require": false, + "Response": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "structuredClone": false, + "SubtleCrypto": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "URL": false, + "URLSearchParams": false, + "WebAssembly": false, + "WebSocket": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false + }, + "nodeBuiltin": { + "AbortController": false, + "AbortSignal": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Buffer": false, + "ByteLengthQueuingStrategy": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "CloseEvent": false, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CustomEvent": false, + "DecompressionStream": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "fetch": false, + "File": false, + "FormData": false, + "global": false, + "Headers": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "navigator": false, + "Navigator": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "process": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "Request": false, + "Response": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "structuredClone": false, + "SubtleCrypto": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "URL": false, + "URLSearchParams": false, + "WebAssembly": false, + "WebSocket": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false + }, + "phantomjs": { + "console": true, + "exports": true, + "phantom": true, + "require": true, + "WebPage": true + }, + "prototypejs": { + "$": false, + "$$": false, + "$A": false, + "$break": false, + "$continue": false, + "$F": false, + "$H": false, + "$R": false, + "$w": false, + "Abstract": false, + "Ajax": false, + "Autocompleter": false, + "Builder": false, + "Class": false, + "Control": false, + "Draggable": false, + "Draggables": false, + "Droppables": false, + "Effect": false, + "Element": false, + "Enumerable": false, + "Event": false, + "Field": false, + "Form": false, + "Hash": false, + "Insertion": false, + "ObjectRange": false, + "PeriodicalExecuter": false, + "Position": false, + "Prototype": false, + "Scriptaculous": false, + "Selector": false, + "Sortable": false, + "SortableObserver": false, + "Sound": false, + "Template": false, + "Toggle": false, + "Try": false + }, + "protractor": { + "$": false, + "$$": false, + "browser": false, + "by": false, + "By": false, + "DartObject": false, + "element": false, + "protractor": false + }, + "qunit": { + "asyncTest": false, + "deepEqual": false, + "equal": false, + "expect": false, + "module": false, + "notDeepEqual": false, + "notEqual": false, + "notOk": false, + "notPropEqual": false, + "notStrictEqual": false, + "ok": false, + "propEqual": false, + "QUnit": false, + "raises": false, + "start": false, + "stop": false, + "strictEqual": false, + "test": false, + "throws": false + }, + "rhino": { + "defineClass": false, + "deserialize": false, + "gc": false, + "help": false, + "importClass": false, + "importPackage": false, + "java": false, + "load": false, + "loadClass": false, + "Packages": false, + "print": false, + "quit": false, + "readFile": false, + "readUrl": false, + "runCommand": false, + "seal": false, + "serialize": false, + "spawn": false, + "sync": false, + "toint32": false, + "version": false + }, + "serviceworker": { + "AbortController": false, + "AbortPaymentEvent": false, + "AbortSignal": false, + "addEventListener": false, + "atob": false, + "BackgroundFetchEvent": false, + "BackgroundFetchManager": false, + "BackgroundFetchRecord": false, + "BackgroundFetchRegistration": false, + "BackgroundFetchUpdateUIEvent": false, + "BarcodeDetector": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "CanMakePaymentEvent": false, + "CanvasGradient": false, + "CanvasPattern": false, + "clearInterval": false, + "clearTimeout": false, + "Client": false, + "clients": false, + "Clients": false, + "CloseEvent": false, + "CompressionStream": false, + "console": false, + "cookieStore": false, + "CookieStore": false, + "CookieStoreManager": false, + "CountQueuingStrategy": false, + "createImageBitmap": false, + "CropTarget": false, + "crossOriginIsolated": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CSSSkewX": false, + "CSSSkewY": false, + "CustomEvent": false, + "DecompressionStream": false, + "dispatchEvent": false, + "DOMException": false, + "DOMMatrix": false, + "DOMMatrixReadOnly": false, + "DOMPoint": false, + "DOMPointReadOnly": false, + "DOMQuad": false, + "DOMRect": false, + "DOMRectReadOnly": false, + "DOMStringList": false, + "ErrorEvent": false, + "Event": false, + "EventSource": false, + "EventTarget": false, + "ExtendableCookieChangeEvent": false, + "ExtendableEvent": false, + "ExtendableMessageEvent": false, + "fetch": false, + "FetchEvent": false, + "File": false, + "FileList": false, + "FileReader": false, + "FileSystemDirectoryHandle": false, + "FileSystemFileHandle": false, + "FileSystemHandle": false, + "FileSystemWritableFileStream": false, + "FontFace": false, + "fonts": false, + "FormData": false, + "GPU": false, + "GPUAdapter": false, + "GPUAdapterInfo": false, + "GPUBindGroup": false, + "GPUBindGroupLayout": false, + "GPUBuffer": false, + "GPUBufferUsage": false, + "GPUCanvasContext": false, + "GPUColorWrite": false, + "GPUCommandBuffer": false, + "GPUCommandEncoder": false, + "GPUCompilationInfo": false, + "GPUCompilationMessage": false, + "GPUComputePassEncoder": false, + "GPUComputePipeline": false, + "GPUDevice": false, + "GPUDeviceLostInfo": false, + "GPUError": false, + "GPUExternalTexture": false, + "GPUInternalError": false, + "GPUMapMode": false, + "GPUOutOfMemoryError": false, + "GPUPipelineError": false, + "GPUPipelineLayout": false, + "GPUQuerySet": false, + "GPUQueue": false, + "GPURenderBundle": false, + "GPURenderBundleEncoder": false, + "GPURenderPassEncoder": false, + "GPURenderPipeline": false, + "GPUSampler": false, + "GPUShaderModule": false, + "GPUShaderStage": false, + "GPUSupportedFeatures": false, + "GPUSupportedLimits": false, + "GPUTexture": false, + "GPUTextureUsage": false, + "GPUTextureView": false, + "GPUUncapturedErrorEvent": false, + "GPUValidationError": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageBitmap": false, + "ImageBitmapRenderingContext": false, + "ImageData": false, + "importScripts": false, + "indexedDB": false, + "InstallEvent": false, + "isSecureContext": false, + "location": false, + "Lock": false, + "LockManager": false, + "MediaCapabilities": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "NavigationPreloadManager": false, + "navigator": false, + "NavigatorUAData": false, + "NetworkInformation": false, + "Notification": false, + "NotificationEvent": false, + "OffscreenCanvas": false, + "OffscreenCanvasRenderingContext2D": false, + "onabortpayment": true, + "onactivate": true, + "onbackgroundfetchabort": true, + "onbackgroundfetchclick": true, + "onbackgroundfetchfail": true, + "onbackgroundfetchsuccess": true, + "oncanmakepayment": true, + "oncookiechange": true, + "onerror": true, + "onfetch": true, + "oninstall": true, + "onlanguagechange": true, + "onmessage": true, + "onmessageerror": true, + "onnotificationclick": true, + "onnotificationclose": true, + "onpaymentrequest": true, + "onperiodicsync": true, + "onpush": true, + "onpushsubscriptionchange": true, + "onrejectionhandled": true, + "onsync": true, + "onunhandledrejection": true, + "origin": false, + "Path2D": false, + "PaymentRequestEvent": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "PerformanceServerTiming": false, + "PeriodicSyncEvent": false, + "PeriodicSyncManager": false, + "Permissions": false, + "PermissionStatus": false, + "PromiseRejectionEvent": false, + "PushEvent": false, + "PushManager": false, + "PushMessageData": false, + "PushSubscription": false, + "PushSubscriptionOptions": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "registration": false, + "removeEventListener": false, + "reportError": false, + "ReportingObserver": false, + "Request": false, + "Response": false, + "scheduler": false, + "Scheduler": false, + "SecurityPolicyViolationEvent": false, + "self": false, + "serviceWorker": false, + "ServiceWorker": false, + "ServiceWorkerGlobalScope": false, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "skipWaiting": false, + "StorageBucket": false, + "StorageBucketManager": false, + "StorageManager": false, + "structuredClone": false, + "SubtleCrypto": false, + "SyncEvent": false, + "SyncManager": false, + "TaskController": false, + "TaskPriorityChangeEvent": false, + "TaskSignal": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TextMetrics": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "TrustedHTML": false, + "TrustedScript": false, + "TrustedScriptURL": false, + "TrustedTypePolicy": false, + "TrustedTypePolicyFactory": false, + "trustedTypes": false, + "URL": false, + "URLPattern": false, + "URLSearchParams": false, + "UserActivation": false, + "WebAssembly": false, + "WebGL2RenderingContext": false, + "WebGLActiveInfo": false, + "WebGLBuffer": false, + "WebGLContextEvent": false, + "WebGLFramebuffer": false, + "WebGLObject": false, + "WebGLProgram": false, + "WebGLQuery": false, + "WebGLRenderbuffer": false, + "WebGLRenderingContext": false, + "WebGLSampler": false, + "WebGLShader": false, + "WebGLShaderPrecisionFormat": false, + "WebGLSync": false, + "WebGLTexture": false, + "WebGLTransformFeedback": false, + "WebGLUniformLocation": false, + "WebGLVertexArrayObject": false, + "WebSocket": false, + "WebSocketError": false, + "WebSocketStream": false, + "WebTransport": false, + "WebTransportBidirectionalStream": false, + "WebTransportDatagramDuplexStream": false, + "WebTransportError": false, + "WGSLLanguageFeatures": false, + "WindowClient": false, + "WorkerGlobalScope": false, + "WorkerLocation": false, + "WorkerNavigator": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false + }, + "shared-node-browser": { + "AbortController": false, + "AbortSignal": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "ByteLengthQueuingStrategy": false, + "clearInterval": false, + "clearTimeout": false, + "CloseEvent": false, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CustomEvent": false, + "DecompressionStream": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "fetch": false, + "File": false, + "FormData": false, + "Headers": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "navigator": false, + "Navigator": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "Request": false, + "Response": false, + "setInterval": false, + "setTimeout": false, + "structuredClone": false, + "SubtleCrypto": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "URL": false, + "URLSearchParams": false, + "WebAssembly": false, + "WebSocket": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false + }, + "shelljs": { + "cat": false, + "cd": false, + "chmod": false, + "config": false, + "cp": false, + "dirs": false, + "echo": false, + "env": false, + "error": false, + "exec": false, + "exit": false, + "find": false, + "grep": false, + "head": false, + "ln": false, + "ls": false, + "mkdir": false, + "mv": false, + "popd": false, + "pushd": false, + "pwd": false, + "rm": false, + "sed": false, + "set": false, + "ShellString": false, + "sort": false, + "tail": false, + "tempdir": false, + "test": false, + "touch": false, + "uniq": false, + "which": false + }, + "vitest": { + "afterAll": false, + "afterEach": false, + "assert": false, + "assertType": false, + "beforeAll": false, + "beforeEach": false, + "chai": false, + "describe": false, + "expect": false, + "expectTypeOf": false, + "it": false, + "onTestFailed": false, + "onTestFinished": false, + "suite": false, + "test": false, + "vi": false, + "vitest": false + }, + "webextensions": { + "browser": false, + "chrome": false, + "opr": false + }, + "worker": { + "AbortController": false, + "AbortSignal": false, + "addEventListener": false, + "ai": false, + "atob": false, + "AudioData": false, + "AudioDecoder": false, + "AudioEncoder": false, + "BackgroundFetchManager": false, + "BackgroundFetchRecord": false, + "BackgroundFetchRegistration": false, + "BarcodeDetector": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "cancelAnimationFrame": false, + "CanvasGradient": false, + "CanvasPattern": false, + "clearInterval": false, + "clearTimeout": false, + "close": false, + "CloseEvent": false, + "CompressionStream": false, + "console": false, + "CountQueuingStrategy": false, + "createImageBitmap": false, + "CropTarget": false, + "crossOriginIsolated": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CSSSkewX": false, + "CSSSkewY": false, + "CustomEvent": false, + "DecompressionStream": false, + "DedicatedWorkerGlobalScope": false, + "dispatchEvent": false, + "DOMException": false, + "DOMMatrix": false, + "DOMMatrixReadOnly": false, + "DOMPoint": false, + "DOMPointReadOnly": false, + "DOMQuad": false, + "DOMRect": false, + "DOMRectReadOnly": false, + "DOMStringList": false, + "EncodedAudioChunk": false, + "EncodedVideoChunk": false, + "ErrorEvent": false, + "Event": false, + "EventSource": false, + "EventTarget": false, + "fetch": false, + "File": false, + "FileList": false, + "FileReader": false, + "FileReaderSync": false, + "FileSystemDirectoryHandle": false, + "FileSystemFileHandle": false, + "FileSystemHandle": false, + "FileSystemSyncAccessHandle": false, + "FileSystemWritableFileStream": false, + "FontFace": false, + "fonts": false, + "FormData": false, + "GPU": false, + "GPUAdapter": false, + "GPUAdapterInfo": false, + "GPUBindGroup": false, + "GPUBindGroupLayout": false, + "GPUBuffer": false, + "GPUBufferUsage": false, + "GPUCanvasContext": false, + "GPUColorWrite": false, + "GPUCommandBuffer": false, + "GPUCommandEncoder": false, + "GPUCompilationInfo": false, + "GPUCompilationMessage": false, + "GPUComputePassEncoder": false, + "GPUComputePipeline": false, + "GPUDevice": false, + "GPUDeviceLostInfo": false, + "GPUError": false, + "GPUExternalTexture": false, + "GPUInternalError": false, + "GPUMapMode": false, + "GPUOutOfMemoryError": false, + "GPUPipelineError": false, + "GPUPipelineLayout": false, + "GPUQuerySet": false, + "GPUQueue": false, + "GPURenderBundle": false, + "GPURenderBundleEncoder": false, + "GPURenderPassEncoder": false, + "GPURenderPipeline": false, + "GPUSampler": false, + "GPUShaderModule": false, + "GPUShaderStage": false, + "GPUSupportedFeatures": false, + "GPUSupportedLimits": false, + "GPUTexture": false, + "GPUTextureUsage": false, + "GPUTextureView": false, + "GPUUncapturedErrorEvent": false, + "GPUValidationError": false, + "Headers": false, + "HID": false, + "HIDConnectionEvent": false, + "HIDDevice": false, + "HIDInputReportEvent": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "IdleDetector": false, + "ImageBitmap": false, + "ImageBitmapRenderingContext": false, + "ImageData": false, + "ImageDecoder": false, + "ImageTrack": false, + "ImageTrackList": false, + "importScripts": false, + "indexedDB": false, + "isSecureContext": false, + "location": false, + "Lock": false, + "LockManager": false, + "MediaCapabilities": false, + "MediaSource": false, + "MediaSourceHandle": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "name": false, + "NavigationPreloadManager": false, + "navigator": false, + "NavigatorUAData": false, + "NetworkInformation": false, + "Notification": false, + "OffscreenCanvas": false, + "OffscreenCanvasRenderingContext2D": false, + "onerror": true, + "onlanguagechange": true, + "onmessage": true, + "onmessageerror": true, + "onrejectionhandled": true, + "onunhandledrejection": true, + "origin": false, + "Path2D": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformanceResourceTiming": false, + "PerformanceServerTiming": false, + "PeriodicSyncManager": false, + "Permissions": false, + "PermissionStatus": false, + "PERSISTENT": false, + "postMessage": false, + "PressureObserver": false, + "PressureRecord": false, + "ProgressEvent": false, + "PromiseRejectionEvent": false, + "PushManager": false, + "PushSubscription": false, + "PushSubscriptionOptions": false, + "queueMicrotask": false, + "ReadableByteStreamController": false, + "ReadableStream": false, + "ReadableStreamBYOBReader": false, + "ReadableStreamBYOBRequest": false, + "ReadableStreamDefaultController": false, + "ReadableStreamDefaultReader": false, + "removeEventListener": false, + "reportError": false, + "ReportingObserver": false, + "Request": false, + "requestAnimationFrame": false, + "Response": false, + "RTCDataChannel": false, + "RTCEncodedAudioFrame": false, + "RTCEncodedVideoFrame": false, + "scheduler": false, + "Scheduler": false, + "SecurityPolicyViolationEvent": false, + "self": false, + "Serial": false, + "SerialPort": false, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "SourceBuffer": false, + "SourceBufferList": false, + "StorageBucket": false, + "StorageBucketManager": false, + "StorageManager": false, + "structuredClone": false, + "SubtleCrypto": false, + "SyncManager": false, + "TaskController": false, + "TaskPriorityChangeEvent": false, + "TaskSignal": false, + "TEMPORARY": false, + "TextDecoder": false, + "TextDecoderStream": false, + "TextEncoder": false, + "TextEncoderStream": false, + "TextMetrics": false, + "TransformStream": false, + "TransformStreamDefaultController": false, + "TrustedHTML": false, + "TrustedScript": false, + "TrustedScriptURL": false, + "TrustedTypePolicy": false, + "TrustedTypePolicyFactory": false, + "trustedTypes": false, + "URL": false, + "URLPattern": false, + "URLSearchParams": false, + "USB": false, + "USBAlternateInterface": false, + "USBConfiguration": false, + "USBConnectionEvent": false, + "USBDevice": false, + "USBEndpoint": false, + "USBInterface": false, + "USBInTransferResult": false, + "USBIsochronousInTransferPacket": false, + "USBIsochronousInTransferResult": false, + "USBIsochronousOutTransferPacket": false, + "USBIsochronousOutTransferResult": false, + "USBOutTransferResult": false, + "UserActivation": false, + "VideoColorSpace": false, + "VideoDecoder": false, + "VideoEncoder": false, + "VideoFrame": false, + "WebAssembly": false, + "WebGL2RenderingContext": false, + "WebGLActiveInfo": false, + "WebGLBuffer": false, + "WebGLContextEvent": false, + "WebGLFramebuffer": false, + "WebGLObject": false, + "WebGLProgram": false, + "WebGLQuery": false, + "WebGLRenderbuffer": false, + "WebGLRenderingContext": false, + "WebGLSampler": false, + "WebGLShader": false, + "WebGLShaderPrecisionFormat": false, + "WebGLSync": false, + "WebGLTexture": false, + "WebGLTransformFeedback": false, + "WebGLUniformLocation": false, + "WebGLVertexArrayObject": false, + "webkitRequestFileSystem": false, + "webkitRequestFileSystemSync": false, + "webkitResolveLocalFileSystemSyncURL": false, + "webkitResolveLocalFileSystemURL": false, + "WebSocket": false, + "WebSocketError": false, + "WebSocketStream": false, + "WebTransport": false, + "WebTransportBidirectionalStream": false, + "WebTransportDatagramDuplexStream": false, + "WebTransportError": false, + "WGSLLanguageFeatures": false, + "Worker": false, + "WorkerGlobalScope": false, + "WorkerLocation": false, + "WorkerNavigator": false, + "WritableStream": false, + "WritableStreamDefaultController": false, + "WritableStreamDefaultWriter": false, + "XMLHttpRequest": false, + "XMLHttpRequestEventTarget": false, + "XMLHttpRequestUpload": false + }, + "wsh": { + "ActiveXObject": false, + "CollectGarbage": false, + "Debug": false, + "Enumerator": false, + "GetObject": false, + "RuntimeObject": false, + "ScriptEngine": false, + "ScriptEngineBuildVersion": false, + "ScriptEngineMajorVersion": false, + "ScriptEngineMinorVersion": false, + "VBArray": false, + "WScript": false, + "WSH": false + }, + "yui": { + "YAHOO": false, + "YAHOO_config": false, + "YUI": false, + "YUI_config": false + } +} diff --git a/node_modules/globals/index.js b/node_modules/globals/index.js new file mode 100644 index 0000000..a951582 --- /dev/null +++ b/node_modules/globals/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('./globals.json'); diff --git a/node_modules/globals/license b/node_modules/globals/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/globals/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/globals/package.json b/node_modules/globals/package.json new file mode 100644 index 0000000..8eeb786 --- /dev/null +++ b/node_modules/globals/package.json @@ -0,0 +1,101 @@ +{ + "name": "globals", + "version": "16.0.0", + "description": "Global identifiers from different JavaScript environments", + "license": "MIT", + "repository": "sindresorhus/globals", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "sideEffects": false, + "engines": { + "node": ">=18" + }, + "scripts": { + "test": "npm run build && xo && ava && tsd", + "prepare": "npm run build", + "update": "node scripts/update.mjs", + "update:browser": "node scripts/update.mjs --environment=browser", + "update:builtin": "node scripts/update.mjs --environment=builtin", + "update:nodeBuiltin": "node scripts/update.mjs --environment=nodeBuiltin", + "update:worker": "node scripts/update.mjs --environment=worker", + "update:serviceworker": "node scripts/update.mjs --environment=serviceworker", + "update:shelljs": "node scripts/update.mjs --environment=shelljs", + "update:jest": "node scripts/update.mjs --environment=jest", + "update:vitest": "node scripts/update.mjs --environment=vitest", + "build": "run-s build:data build:types", + "build:data": "node scripts/generate-data.mjs", + "build:types": "node scripts/generate-types.mjs" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "devDependencies": { + "@vitest/eslint-plugin": "^1.1.30", + "ava": "^6.1.3", + "cheerio": "^1.0.0-rc.12", + "eslint-plugin-jest": "^28.8.3", + "execa": "^9.4.0", + "get-port": "^7.1.0", + "npm-run-all2": "^6.2.3", + "outdent": "^0.8.0", + "puppeteer": "^23.4.1", + "shelljs": "^0.8.5", + "tsd": "^0.31.2", + "type-fest": "^4.26.1", + "xo": "^0.59.3" + }, + "xo": { + "rules": { + "unicorn/prefer-module": "off" + }, + "overrides": [ + { + "files": [ + "data/*.mjs" + ], + "rules": { + "import/no-anonymous-default-export": "off", + "camelcase": "off", + "unicorn/filename-case": [ + "error", + { + "cases": { + "camelCase": true, + "kebabCase": true + } + } + ] + } + }, + { + "files": [ + "scripts/*.mjs" + ], + "rules": { + "n/no-unsupported-features/node-builtins": "off" + } + } + ] + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + } +} diff --git a/node_modules/globals/readme.md b/node_modules/globals/readme.md new file mode 100644 index 0000000..3407019 --- /dev/null +++ b/node_modules/globals/readme.md @@ -0,0 +1,42 @@ +# globals + +> Global identifiers from different JavaScript environments + +It's just a [JSON file](globals.json), so you can use it in any environment. + +This package is used by ESLint 8 and earlier. For ESLint 9 and later, you should depend on this package directly in [your ESLint config](https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables). + +## Install + +```sh +npm install globals +``` + +## Usage + +```js +import globals from 'globals'; + +console.log(globals.browser); +/* +{ + addEventListener: false, + applicationCache: false, + ArrayBuffer: false, + atob: false, + … +} +*/ +``` + +Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise. + +For Node.js this package provides two sets of globals: + +- `globals.nodeBuiltin`: Globals available to all code running in Node.js. + These will usually be available as properties on the `globalThis` object and include `process`, `Buffer`, but not CommonJS arguments like `require`. + See: https://nodejs.org/api/globals.html +- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope"). + See: https://nodejs.org/api/modules.html#modules_the_module_scope + +When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references. diff --git a/node_modules/graphemer/CHANGELOG.md b/node_modules/graphemer/CHANGELOG.md new file mode 100644 index 0000000..dc1dd42 --- /dev/null +++ b/node_modules/graphemer/CHANGELOG.md @@ -0,0 +1,30 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.3.0] - 2021-12-13 + +### Added + +- Updated to include support for Unicode 14 + +## [1.2.0] - 2021-01-29 + +### Updated + +- Refactored to increase speed + +## [1.1.0] - 2020-09-14 + +### Added + +- Updated to include support for Unicode 13 + +## [1.0.0] - 2020-09-13 + +- Forked from work by @JLHwung on original `Grapheme-Splitter` library: https://github.com/JLHwung/grapheme-splitter/tree/next +- Converted to Typescript +- Added development and build tooling diff --git a/node_modules/graphemer/LICENSE b/node_modules/graphemer/LICENSE new file mode 100644 index 0000000..51f3831 --- /dev/null +++ b/node_modules/graphemer/LICENSE @@ -0,0 +1,18 @@ +Copyright 2020 Filament (Anomalous Technologies Limited) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/graphemer/README.md b/node_modules/graphemer/README.md new file mode 100644 index 0000000..0ac98ad --- /dev/null +++ b/node_modules/graphemer/README.md @@ -0,0 +1,132 @@ +# Graphemer: Unicode Character Splitter 🪓 + +## Introduction + +This library continues the work of [Grapheme Splitter](https://github.com/orling/grapheme-splitter) and supports the following unicode versions: + +- Unicode 15 and below `[v1.4.0]` +- Unicode 14 and below `[v1.3.0]` +- Unicode 13 and below `[v1.1.0]` +- Unicode 11 and below `[v1.0.0]` (Unicode 10 supported by `grapheme-splitter`) + +In JavaScript there is not always a one-to-one relationship between string characters and what a user would call a separate visual "letter". Some symbols are represented by several characters. This can cause issues when splitting strings and inadvertently cutting a multi-char letter in half, or when you need the actual number of letters in a string. + +For example, emoji characters like "🌷","🎁","💩","😜" and "👍" are represented by two JavaScript characters each (high surrogate and low surrogate). That is, + +```javascript +'🌷'.length == 2; +``` + +The combined emoji are even longer: + +```javascript +'🏳️‍🌈'.length == 6; +``` + +What's more, some languages often include combining marks - characters that are used to modify the letters before them. Common examples are the German letter ü and the Spanish letter ñ. Sometimes they can be represented alternatively both as a single character and as a letter + combining mark, with both forms equally valid: + +```javascript +var two = 'ñ'; // unnormalized two-char n+◌̃, i.e. "\u006E\u0303"; +var one = 'ñ'; // normalized single-char, i.e. "\u00F1" + +console.log(one != two); // prints 'true' +``` + +Unicode normalization, as performed by the popular punycode.js library or ECMAScript 6's String.normalize, can **sometimes** fix those differences and turn two-char sequences into single characters. But it is **not** enough in all cases. Some languages like Hindi make extensive use of combining marks on their letters, that have no dedicated single-codepoint Unicode sequences, due to the sheer number of possible combinations. +For example, the Hindi word "अनुच्छेद" is comprised of 5 letters and 3 combining marks: + +अ + न + ु + च + ् + छ + े + द + +which is in fact just 5 user-perceived letters: + +अ + नु + च् + छे + द + +and which Unicode normalization would not combine properly. +There are also the unusual letter+combining mark combinations which have no dedicated Unicode codepoint. The string Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘ obviously has 5 separate letters, but is in fact comprised of 58 JavaScript characters, most of which are combining marks. + +Enter the `graphemer` library. It can be used to properly split JavaScript strings into what a human user would call separate letters (or "extended grapheme clusters" in Unicode terminology), no matter what their internal representation is. It is an implementation on the [Default Grapheme Cluster Boundary](http://unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table) of [UAX #29](http://www.unicode.org/reports/tr29/). + +## Installation + +Install `graphemer` using the NPM command below: + +``` +$ npm i graphemer +``` + +## Usage + +If you're using [Typescript](https://www.typescriptlang.org/) or a compiler like [Babel](https://babeljs.io/) (or something like Create React App) things are pretty simple; just import, initialize and use! + +```javascript +import Graphemer from 'graphemer'; + +const splitter = new Graphemer(); + +// split the string to an array of grapheme clusters (one string each) +const graphemes = splitter.splitGraphemes(string); + +// iterate the string to an iterable iterator of grapheme clusters (one string each) +const graphemeIterator = splitter.iterateGraphemes(string); + +// or do this if you just need their number +const graphemeCount = splitter.countGraphemes(string); +``` + +If you're using vanilla Node you can use the `require()` method. + +```javascript +const Graphemer = require('graphemer').default; + +const splitter = new Graphemer(); + +const graphemes = splitter.splitGraphemes(string); +``` + +## Examples + +```javascript +import Graphemer from 'graphemer'; + +const splitter = new Graphemer(); + +// plain latin alphabet - nothing spectacular +splitter.splitGraphemes('abcd'); // returns ["a", "b", "c", "d"] + +// two-char emojis and six-char combined emoji +splitter.splitGraphemes('🌷🎁💩😜👍🏳️‍🌈'); // returns ["🌷","🎁","💩","😜","👍","🏳️‍🌈"] + +// diacritics as combining marks, 10 JavaScript chars +splitter.splitGraphemes('Ĺo͂řȩm̅'); // returns ["Ĺ","o͂","ř","ȩ","m̅"] + +// individual Korean characters (Jamo), 4 JavaScript chars +splitter.splitGraphemes('뎌쉐'); // returns ["뎌","쉐"] + +// Hindi text with combining marks, 8 JavaScript chars +splitter.splitGraphemes('अनुच्छेद'); // returns ["अ","नु","च्","छे","द"] + +// demonic multiple combining marks, 75 JavaScript chars +splitter.splitGraphemes('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞'); // returns ["Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍","A̴̵̜̰͔ͫ͗͢","L̠ͨͧͩ͘","G̴̻͈͍͔̹̑͗̎̅͛́","Ǫ̵̹̻̝̳͂̌̌͘","!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞"] +``` + +## TypeScript + +Graphemer is built with TypeScript and, of course, includes type declarations. + +```javascript +import Graphemer from 'graphemer'; + +const splitter = new Graphemer(); + +const split: string[] = splitter.splitGraphemes('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞'); +``` + +## Contributing + +See [Contribution Guide](./CONTRIBUTING.md). + +## Acknowledgements + +This library is a fork of the incredible work done by Orlin Georgiev and Huáng Jùnliàng at https://github.com/orling/grapheme-splitter. + +The original library was heavily influenced by Devon Govett's excellent [grapheme-breaker](https://github.com/devongovett/grapheme-breaker) CoffeeScript library. diff --git a/node_modules/graphemer/lib/Graphemer.d.ts.map b/node_modules/graphemer/lib/Graphemer.d.ts.map new file mode 100644 index 0000000..692b762 --- /dev/null +++ b/node_modules/graphemer/lib/Graphemer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Graphemer.d.ts","sourceRoot":"","sources":["../src/Graphemer.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IA2CvD;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAcrC;;;;OAIG;IACH,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB;IAIhD;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAcnC;;;;OAIG;IACH,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAoySrD;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CA47B9C"} \ No newline at end of file diff --git a/node_modules/graphemer/lib/Graphemer.js b/node_modules/graphemer/lib/Graphemer.js new file mode 100644 index 0000000..8ed00ca --- /dev/null +++ b/node_modules/graphemer/lib/Graphemer.js @@ -0,0 +1,11959 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const boundaries_1 = require("./boundaries"); +const GraphemerHelper_1 = __importDefault(require("./GraphemerHelper")); +const GraphemerIterator_1 = __importDefault(require("./GraphemerIterator")); +class Graphemer { + /** + * Returns the next grapheme break in the string after the given index + * @param string {string} + * @param index {number} + * @returns {number} + */ + static nextBreak(string, index) { + if (index === undefined) { + index = 0; + } + if (index < 0) { + return 0; + } + if (index >= string.length - 1) { + return string.length; + } + const prevCP = GraphemerHelper_1.default.codePointAt(string, index); + const prev = Graphemer.getGraphemeBreakProperty(prevCP); + const prevEmoji = Graphemer.getEmojiProperty(prevCP); + const mid = []; + const midEmoji = []; + for (let i = index + 1; i < string.length; i++) { + // check for already processed low surrogates + if (GraphemerHelper_1.default.isSurrogate(string, i - 1)) { + continue; + } + const nextCP = GraphemerHelper_1.default.codePointAt(string, i); + const next = Graphemer.getGraphemeBreakProperty(nextCP); + const nextEmoji = Graphemer.getEmojiProperty(nextCP); + if (GraphemerHelper_1.default.shouldBreak(prev, mid, next, prevEmoji, midEmoji, nextEmoji)) { + return i; + } + mid.push(next); + midEmoji.push(nextEmoji); + } + return string.length; + } + /** + * Breaks the given string into an array of grapheme clusters + * @param str {string} + * @returns {string[]} + */ + splitGraphemes(str) { + const res = []; + let index = 0; + let brk; + while ((brk = Graphemer.nextBreak(str, index)) < str.length) { + res.push(str.slice(index, brk)); + index = brk; + } + if (index < str.length) { + res.push(str.slice(index)); + } + return res; + } + /** + * Returns an iterator of grapheme clusters in the given string + * @param str {string} + * @returns {GraphemerIterator} + */ + iterateGraphemes(str) { + return new GraphemerIterator_1.default(str, Graphemer.nextBreak); + } + /** + * Returns the number of grapheme clusters in the given string + * @param str {string} + * @returns {number} + */ + countGraphemes(str) { + let count = 0; + let index = 0; + let brk; + while ((brk = Graphemer.nextBreak(str, index)) < str.length) { + index = brk; + count++; + } + if (index < str.length) { + count++; + } + return count; + } + /** + * Given a Unicode code point, determines this symbol's grapheme break property + * @param code {number} Unicode code point + * @returns {number} + */ + static getGraphemeBreakProperty(code) { + // Grapheme break property taken from: + // https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt + // and generated by + // node ./scripts/generate-grapheme-break.js + if (code < 0xbf09) { + if (code < 0xac54) { + if (code < 0x102d) { + if (code < 0xb02) { + if (code < 0x93b) { + if (code < 0x6df) { + if (code < 0x5bf) { + if (code < 0x7f) { + if (code < 0xb) { + if (code < 0xa) { + // Cc [10] .. + if (0x0 <= code && code <= 0x9) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + // Cc + if (0xa === code) { + return boundaries_1.CLUSTER_BREAK.LF; + } + } + } + else { + if (code < 0xd) { + // Cc [2] .. + if (0xb <= code && code <= 0xc) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + if (code < 0xe) { + // Cc + if (0xd === code) { + return boundaries_1.CLUSTER_BREAK.CR; + } + } + else { + // Cc [18] .. + if (0xe <= code && code <= 0x1f) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + } + } + } + else { + if (code < 0x300) { + if (code < 0xad) { + // Cc [33] .. + if (0x7f <= code && code <= 0x9f) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + // Cf SOFT HYPHEN + if (0xad === code) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + } + else { + if (code < 0x483) { + // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X + if (0x300 <= code && code <= 0x36f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x591) { + // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE + // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN + if (0x483 <= code && code <= 0x489) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG + if (0x591 <= code && code <= 0x5bd) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x610) { + if (code < 0x5c4) { + if (code < 0x5c1) { + // Mn HEBREW POINT RAFE + if (0x5bf === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT + if (0x5c1 <= code && code <= 0x5c2) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x5c7) { + // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT + if (0x5c4 <= code && code <= 0x5c5) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x600) { + // Mn HEBREW POINT QAMATS QATAN + if (0x5c7 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE + if (0x600 <= code && code <= 0x605) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + } + } + } + else { + if (code < 0x670) { + if (code < 0x61c) { + // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA + if (0x610 <= code && code <= 0x61a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x64b) { + // Cf ARABIC LETTER MARK + if (0x61c === code) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW + if (0x64b <= code && code <= 0x65f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x6d6) { + // Mn ARABIC LETTER SUPERSCRIPT ALEF + if (0x670 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x6dd) { + // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN + if (0x6d6 <= code && code <= 0x6dc) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cf ARABIC END OF AYAH + if (0x6dd === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + } + } + } + } + } + else { + if (code < 0x81b) { + if (code < 0x730) { + if (code < 0x6ea) { + if (code < 0x6e7) { + // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA + if (0x6df <= code && code <= 0x6e4) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON + if (0x6e7 <= code && code <= 0x6e8) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x70f) { + // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM + if (0x6ea <= code && code <= 0x6ed) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cf SYRIAC ABBREVIATION MARK + if (0x70f === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + // Mn SYRIAC LETTER SUPERSCRIPT ALAPH + if (0x711 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x7eb) { + if (code < 0x7a6) { + // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH + if (0x730 <= code && code <= 0x74a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [11] THAANA ABAFILI..THAANA SUKUN + if (0x7a6 <= code && code <= 0x7b0) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x7fd) { + // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE + if (0x7eb <= code && code <= 0x7f3) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x816) { + // Mn NKO DANTAYALAN + if (0x7fd === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH + if (0x816 <= code && code <= 0x819) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x898) { + if (code < 0x829) { + if (code < 0x825) { + // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A + if (0x81b <= code && code <= 0x823) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U + if (0x825 <= code && code <= 0x827) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x859) { + // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA + if (0x829 <= code && code <= 0x82d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x890) { + // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK + if (0x859 <= code && code <= 0x85b) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cf [2] ARABIC POUND MARK ABOVE..ARABIC PIASTRE MARK ABOVE + if (0x890 <= code && code <= 0x891) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + } + } + } + else { + if (code < 0x8e3) { + if (code < 0x8ca) { + // Mn [8] ARABIC SMALL HIGH WORD AL-JUZ..ARABIC HALF MADDA OVER MADDA + if (0x898 <= code && code <= 0x89f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x8e2) { + // Mn [24] ARABIC SMALL HIGH FARSI YEH..ARABIC SMALL HIGH SIGN SAFHA + if (0x8ca <= code && code <= 0x8e1) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cf ARABIC DISPUTED END OF AYAH + if (0x8e2 === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + } + } + else { + if (code < 0x903) { + // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA + if (0x8e3 <= code && code <= 0x902) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc DEVANAGARI SIGN VISARGA + if (0x903 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn DEVANAGARI VOWEL SIGN OE + if (0x93a === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + else { + if (code < 0xa01) { + if (code < 0x982) { + if (code < 0x94d) { + if (code < 0x93e) { + // Mc DEVANAGARI VOWEL SIGN OOE + if (0x93b === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn DEVANAGARI SIGN NUKTA + if (0x93c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x941) { + // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II + if (0x93e <= code && code <= 0x940) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x949) { + // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI + if (0x941 <= code && code <= 0x948) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU + if (0x949 <= code && code <= 0x94c) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x951) { + if (code < 0x94e) { + // Mn DEVANAGARI SIGN VIRAMA + if (0x94d === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW + if (0x94e <= code && code <= 0x94f) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x962) { + // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE + if (0x951 <= code && code <= 0x957) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x981) { + // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL + if (0x962 <= code && code <= 0x963) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn BENGALI SIGN CANDRABINDU + if (0x981 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x9c7) { + if (code < 0x9be) { + if (code < 0x9bc) { + // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA + if (0x982 <= code && code <= 0x983) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn BENGALI SIGN NUKTA + if (0x9bc === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x9bf) { + // Mc BENGALI VOWEL SIGN AA + if (0x9be === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x9c1) { + // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II + if (0x9bf <= code && code <= 0x9c0) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR + if (0x9c1 <= code && code <= 0x9c4) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x9d7) { + if (code < 0x9cb) { + // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI + if (0x9c7 <= code && code <= 0x9c8) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x9cd) { + // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU + if (0x9cb <= code && code <= 0x9cc) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn BENGALI SIGN VIRAMA + if (0x9cd === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x9e2) { + // Mc BENGALI AU LENGTH MARK + if (0x9d7 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x9fe) { + // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL + if (0x9e2 <= code && code <= 0x9e3) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn BENGALI SANDHI MARK + if (0x9fe === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + else { + if (code < 0xa83) { + if (code < 0xa47) { + if (code < 0xa3c) { + if (code < 0xa03) { + // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI + if (0xa01 <= code && code <= 0xa02) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc GURMUKHI SIGN VISARGA + if (0xa03 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0xa3e) { + // Mn GURMUKHI SIGN NUKTA + if (0xa3c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xa41) { + // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II + if (0xa3e <= code && code <= 0xa40) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU + if (0xa41 <= code && code <= 0xa42) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xa70) { + if (code < 0xa4b) { + // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI + if (0xa47 <= code && code <= 0xa48) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xa51) { + // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA + if (0xa4b <= code && code <= 0xa4d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn GURMUKHI SIGN UDAAT + if (0xa51 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xa75) { + // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK + if (0xa70 <= code && code <= 0xa71) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xa81) { + // Mn GURMUKHI SIGN YAKASH + if (0xa75 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA + if (0xa81 <= code && code <= 0xa82) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0xac9) { + if (code < 0xabe) { + // Mc GUJARATI SIGN VISARGA + if (0xa83 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn GUJARATI SIGN NUKTA + if (0xabc === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xac1) { + // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II + if (0xabe <= code && code <= 0xac0) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xac7) { + // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E + if (0xac1 <= code && code <= 0xac5) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI + if (0xac7 <= code && code <= 0xac8) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xae2) { + if (code < 0xacb) { + // Mc GUJARATI VOWEL SIGN CANDRA O + if (0xac9 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xacd) { + // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU + if (0xacb <= code && code <= 0xacc) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn GUJARATI SIGN VIRAMA + if (0xacd === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xafa) { + // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL + if (0xae2 <= code && code <= 0xae3) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xb01) { + // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE + if (0xafa <= code && code <= 0xaff) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn ORIYA SIGN CANDRABINDU + if (0xb01 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + } + } + else { + if (code < 0xcf3) { + if (code < 0xc04) { + if (code < 0xb82) { + if (code < 0xb47) { + if (code < 0xb3e) { + if (code < 0xb3c) { + // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA + if (0xb02 <= code && code <= 0xb03) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn ORIYA SIGN NUKTA + if (0xb3c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xb40) { + // Mc ORIYA VOWEL SIGN AA + // Mn ORIYA VOWEL SIGN I + if (0xb3e <= code && code <= 0xb3f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xb41) { + // Mc ORIYA VOWEL SIGN II + if (0xb40 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR + if (0xb41 <= code && code <= 0xb44) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xb4d) { + if (code < 0xb4b) { + // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI + if (0xb47 <= code && code <= 0xb48) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU + if (0xb4b <= code && code <= 0xb4c) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0xb55) { + // Mn ORIYA SIGN VIRAMA + if (0xb4d === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xb62) { + // Mn [2] ORIYA SIGN OVERLINE..ORIYA AI LENGTH MARK + // Mc ORIYA AU LENGTH MARK + if (0xb55 <= code && code <= 0xb57) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL + if (0xb62 <= code && code <= 0xb63) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0xbc6) { + if (code < 0xbbf) { + // Mn TAMIL SIGN ANUSVARA + if (0xb82 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc TAMIL VOWEL SIGN AA + if (0xbbe === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xbc0) { + // Mc TAMIL VOWEL SIGN I + if (0xbbf === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xbc1) { + // Mn TAMIL VOWEL SIGN II + if (0xbc0 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU + if (0xbc1 <= code && code <= 0xbc2) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0xbd7) { + if (code < 0xbca) { + // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI + if (0xbc6 <= code && code <= 0xbc8) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xbcd) { + // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU + if (0xbca <= code && code <= 0xbcc) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn TAMIL SIGN VIRAMA + if (0xbcd === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xc00) { + // Mc TAMIL AU LENGTH MARK + if (0xbd7 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xc01) { + // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE + if (0xc00 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA + if (0xc01 <= code && code <= 0xc03) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + } + else { + if (code < 0xcbe) { + if (code < 0xc4a) { + if (code < 0xc3e) { + // Mn TELUGU SIGN COMBINING ANUSVARA ABOVE + if (0xc04 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mn TELUGU SIGN NUKTA + if (0xc3c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xc41) { + // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II + if (0xc3e <= code && code <= 0xc40) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xc46) { + // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR + if (0xc41 <= code && code <= 0xc44) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI + if (0xc46 <= code && code <= 0xc48) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xc81) { + if (code < 0xc55) { + // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA + if (0xc4a <= code && code <= 0xc4d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xc62) { + // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK + if (0xc55 <= code && code <= 0xc56) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL + if (0xc62 <= code && code <= 0xc63) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xc82) { + // Mn KANNADA SIGN CANDRABINDU + if (0xc81 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xcbc) { + // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA + if (0xc82 <= code && code <= 0xc83) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn KANNADA SIGN NUKTA + if (0xcbc === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0xcc6) { + if (code < 0xcc0) { + // Mc KANNADA VOWEL SIGN AA + if (0xcbe === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn KANNADA VOWEL SIGN I + if (0xcbf === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xcc2) { + // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U + if (0xcc0 <= code && code <= 0xcc1) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xcc3) { + // Mc KANNADA VOWEL SIGN UU + if (0xcc2 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR + if (0xcc3 <= code && code <= 0xcc4) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0xccc) { + if (code < 0xcc7) { + // Mn KANNADA VOWEL SIGN E + if (0xcc6 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xcca) { + // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI + if (0xcc7 <= code && code <= 0xcc8) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO + if (0xcca <= code && code <= 0xccb) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0xcd5) { + // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA + if (0xccc <= code && code <= 0xccd) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xce2) { + // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK + if (0xcd5 <= code && code <= 0xcd6) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL + if (0xce2 <= code && code <= 0xce3) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + } + else { + if (code < 0xddf) { + if (code < 0xd4e) { + if (code < 0xd3f) { + if (code < 0xd02) { + if (code < 0xd00) { + // Mc KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT + if (0xcf3 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU + if (0xd00 <= code && code <= 0xd01) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xd3b) { + // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA + if (0xd02 <= code && code <= 0xd03) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xd3e) { + // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA + if (0xd3b <= code && code <= 0xd3c) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc MALAYALAM VOWEL SIGN AA + if (0xd3e === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xd46) { + if (code < 0xd41) { + // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II + if (0xd3f <= code && code <= 0xd40) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR + if (0xd41 <= code && code <= 0xd44) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xd4a) { + // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI + if (0xd46 <= code && code <= 0xd48) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xd4d) { + // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU + if (0xd4a <= code && code <= 0xd4c) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn MALAYALAM SIGN VIRAMA + if (0xd4d === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0xdca) { + if (code < 0xd62) { + // Lo MALAYALAM LETTER DOT REPH + if (0xd4e === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + // Mc MALAYALAM AU LENGTH MARK + if (0xd57 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xd81) { + // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL + if (0xd62 <= code && code <= 0xd63) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xd82) { + // Mn SINHALA SIGN CANDRABINDU + if (0xd81 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA + if (0xd82 <= code && code <= 0xd83) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0xdd2) { + if (code < 0xdcf) { + // Mn SINHALA SIGN AL-LAKUNA + if (0xdca === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xdd0) { + // Mc SINHALA VOWEL SIGN AELA-PILLA + if (0xdcf === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA + if (0xdd0 <= code && code <= 0xdd1) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0xdd6) { + // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA + if (0xdd2 <= code && code <= 0xdd4) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xdd8) { + // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA + if (0xdd6 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA + if (0xdd8 <= code && code <= 0xdde) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + } + else { + if (code < 0xf35) { + if (code < 0xe47) { + if (code < 0xe31) { + if (code < 0xdf2) { + // Mc SINHALA VOWEL SIGN GAYANUKITTA + if (0xddf === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA + if (0xdf2 <= code && code <= 0xdf3) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0xe33) { + // Mn THAI CHARACTER MAI HAN-AKAT + if (0xe31 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xe34) { + // Lo THAI CHARACTER SARA AM + if (0xe33 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU + if (0xe34 <= code && code <= 0xe3a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xeb4) { + if (code < 0xeb1) { + // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN + if (0xe47 <= code && code <= 0xe4e) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn LAO VOWEL SIGN MAI KAN + if (0xeb1 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Lo LAO VOWEL SIGN AM + if (0xeb3 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0xec8) { + // Mn [9] LAO VOWEL SIGN I..LAO SEMIVOWEL SIGN LO + if (0xeb4 <= code && code <= 0xebc) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xf18) { + // Mn [7] LAO TONE MAI EK..LAO YAMAKKAN + if (0xec8 <= code && code <= 0xece) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS + if (0xf18 <= code && code <= 0xf19) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0xf7f) { + if (code < 0xf39) { + // Mn TIBETAN MARK NGAS BZUNG NYI ZLA + if (0xf35 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS + if (0xf37 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xf3e) { + // Mn TIBETAN MARK TSA -PHRU + if (0xf39 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xf71) { + // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES + if (0xf3e <= code && code <= 0xf3f) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO + if (0xf71 <= code && code <= 0xf7e) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xf8d) { + if (code < 0xf80) { + // Mc TIBETAN SIGN RNAM BCAD + if (0xf7f === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xf86) { + // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA + if (0xf80 <= code && code <= 0xf84) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS + if (0xf86 <= code && code <= 0xf87) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xf99) { + // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA + if (0xf8d <= code && code <= 0xf97) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xfc6) { + // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA + if (0xf99 <= code && code <= 0xfbc) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn TIBETAN SYMBOL PADMA GDAN + if (0xfc6 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + } + } + } + else { + if (code < 0x1c24) { + if (code < 0x1930) { + if (code < 0x1732) { + if (code < 0x1082) { + if (code < 0x103d) { + if (code < 0x1032) { + if (code < 0x1031) { + // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU + if (0x102d <= code && code <= 0x1030) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc MYANMAR VOWEL SIGN E + if (0x1031 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x1039) { + // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW + if (0x1032 <= code && code <= 0x1037) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x103b) { + // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT + if (0x1039 <= code && code <= 0x103a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA + if (0x103b <= code && code <= 0x103c) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x1058) { + if (code < 0x1056) { + // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA + if (0x103d <= code && code <= 0x103e) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR + if (0x1056 <= code && code <= 0x1057) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x105e) { + // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL + if (0x1058 <= code && code <= 0x1059) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1071) { + // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA + if (0x105e <= code && code <= 0x1060) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE + if (0x1071 <= code && code <= 0x1074) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x1100) { + if (code < 0x1085) { + // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA + if (0x1082 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc MYANMAR VOWEL SIGN SHAN E + if (0x1084 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x108d) { + // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y + if (0x1085 <= code && code <= 0x1086) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE + if (0x108d === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mn MYANMAR VOWEL SIGN AITON AI + if (0x109d === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x135d) { + if (code < 0x1160) { + // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER + if (0x1100 <= code && code <= 0x115f) { + return boundaries_1.CLUSTER_BREAK.L; + } + } + else { + if (code < 0x11a8) { + // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE + if (0x1160 <= code && code <= 0x11a7) { + return boundaries_1.CLUSTER_BREAK.V; + } + } + else { + // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN + if (0x11a8 <= code && code <= 0x11ff) { + return boundaries_1.CLUSTER_BREAK.T; + } + } + } + } + else { + if (code < 0x1712) { + // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK + if (0x135d <= code && code <= 0x135f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1715) { + // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA + if (0x1712 <= code && code <= 0x1714) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc TAGALOG SIGN PAMUDPOD + if (0x1715 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + } + else { + if (code < 0x17c9) { + if (code < 0x17b6) { + if (code < 0x1752) { + if (code < 0x1734) { + // Mn [2] HANUNOO VOWEL SIGN I..HANUNOO VOWEL SIGN U + if (0x1732 <= code && code <= 0x1733) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc HANUNOO SIGN PAMUDPOD + if (0x1734 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x1772) { + // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U + if (0x1752 <= code && code <= 0x1753) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x17b4) { + // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U + if (0x1772 <= code && code <= 0x1773) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA + if (0x17b4 <= code && code <= 0x17b5) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x17be) { + if (code < 0x17b7) { + // Mc KHMER VOWEL SIGN AA + if (0x17b6 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA + if (0x17b7 <= code && code <= 0x17bd) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x17c6) { + // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU + if (0x17be <= code && code <= 0x17c5) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x17c7) { + // Mn KHMER SIGN NIKAHIT + if (0x17c6 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU + if (0x17c7 <= code && code <= 0x17c8) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + else { + if (code < 0x1885) { + if (code < 0x180b) { + if (code < 0x17dd) { + // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT + if (0x17c9 <= code && code <= 0x17d3) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn KHMER SIGN ATTHACAN + if (0x17dd === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x180e) { + // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE + if (0x180b <= code && code <= 0x180d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cf MONGOLIAN VOWEL SEPARATOR + if (0x180e === code) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + // Mn MONGOLIAN FREE VARIATION SELECTOR FOUR + if (0x180f === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x1923) { + if (code < 0x18a9) { + // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA + if (0x1885 <= code && code <= 0x1886) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1920) { + // Mn MONGOLIAN LETTER ALI GALI DAGALGA + if (0x18a9 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U + if (0x1920 <= code && code <= 0x1922) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x1927) { + // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU + if (0x1923 <= code && code <= 0x1926) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x1929) { + // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O + if (0x1927 <= code && code <= 0x1928) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA + if (0x1929 <= code && code <= 0x192b) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + } + } + else { + if (code < 0x1b3b) { + if (code < 0x1a58) { + if (code < 0x1a19) { + if (code < 0x1933) { + if (code < 0x1932) { + // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA + if (0x1930 <= code && code <= 0x1931) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn LIMBU SMALL LETTER ANUSVARA + if (0x1932 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x1939) { + // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA + if (0x1933 <= code && code <= 0x1938) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x1a17) { + // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I + if (0x1939 <= code && code <= 0x193b) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U + if (0x1a17 <= code && code <= 0x1a18) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x1a55) { + if (code < 0x1a1b) { + // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O + if (0x1a19 <= code && code <= 0x1a1a) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn BUGINESE VOWEL SIGN AE + if (0x1a1b === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x1a56) { + // Mc TAI THAM CONSONANT SIGN MEDIAL RA + if (0x1a55 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn TAI THAM CONSONANT SIGN MEDIAL LA + if (0x1a56 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc TAI THAM CONSONANT SIGN LA TANG LAI + if (0x1a57 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x1a73) { + if (code < 0x1a62) { + if (code < 0x1a60) { + // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA + if (0x1a58 <= code && code <= 0x1a5e) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn TAI THAM SIGN SAKOT + if (0x1a60 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x1a65) { + // Mn TAI THAM VOWEL SIGN MAI SAT + if (0x1a62 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1a6d) { + // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW + if (0x1a65 <= code && code <= 0x1a6c) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI + if (0x1a6d <= code && code <= 0x1a72) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x1b00) { + if (code < 0x1a7f) { + // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN + if (0x1a73 <= code && code <= 0x1a7c) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1ab0) { + // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT + if (0x1a7f === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW + // Me COMBINING PARENTHESES OVERLAY + // Mn [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T + if (0x1ab0 <= code && code <= 0x1ace) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x1b04) { + // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG + if (0x1b00 <= code && code <= 0x1b03) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1b34) { + // Mc BALINESE SIGN BISAH + if (0x1b04 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn BALINESE SIGN REREKAN + // Mc BALINESE VOWEL SIGN TEDUNG + // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA + if (0x1b34 <= code && code <= 0x1b3a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + else { + if (code < 0x1ba8) { + if (code < 0x1b6b) { + if (code < 0x1b3d) { + // Mc BALINESE VOWEL SIGN RA REPA TEDUNG + if (0x1b3b === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn BALINESE VOWEL SIGN LA LENGA + if (0x1b3c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1b42) { + // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG + if (0x1b3d <= code && code <= 0x1b41) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x1b43) { + // Mn BALINESE VOWEL SIGN PEPET + if (0x1b42 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG + if (0x1b43 <= code && code <= 0x1b44) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x1ba1) { + if (code < 0x1b80) { + // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG + if (0x1b6b <= code && code <= 0x1b73) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1b82) { + // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR + if (0x1b80 <= code && code <= 0x1b81) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc SUNDANESE SIGN PANGWISAD + if (0x1b82 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x1ba2) { + // Mc SUNDANESE CONSONANT SIGN PAMINGKAL + if (0x1ba1 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x1ba6) { + // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU + if (0x1ba2 <= code && code <= 0x1ba5) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG + if (0x1ba6 <= code && code <= 0x1ba7) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + else { + if (code < 0x1be8) { + if (code < 0x1bab) { + if (code < 0x1baa) { + // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG + if (0x1ba8 <= code && code <= 0x1ba9) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc SUNDANESE SIGN PAMAAEH + if (0x1baa === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x1be6) { + // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA + if (0x1bab <= code && code <= 0x1bad) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn BATAK SIGN TOMPI + if (0x1be6 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc BATAK VOWEL SIGN E + if (0x1be7 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x1bee) { + if (code < 0x1bea) { + // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE + if (0x1be8 <= code && code <= 0x1be9) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1bed) { + // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O + if (0x1bea <= code && code <= 0x1bec) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn BATAK VOWEL SIGN KARO O + if (0x1bed === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x1bef) { + // Mc BATAK VOWEL SIGN U + if (0x1bee === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x1bf2) { + // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H + if (0x1bef <= code && code <= 0x1bf1) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN + if (0x1bf2 <= code && code <= 0x1bf3) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + } + } + } + else { + if (code < 0xa952) { + if (code < 0x2d7f) { + if (code < 0x1cf7) { + if (code < 0x1cd4) { + if (code < 0x1c34) { + if (code < 0x1c2c) { + // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU + if (0x1c24 <= code && code <= 0x1c2b) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T + if (0x1c2c <= code && code <= 0x1c33) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x1c36) { + // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG + if (0x1c34 <= code && code <= 0x1c35) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x1cd0) { + // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA + if (0x1c36 <= code && code <= 0x1c37) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA + if (0x1cd0 <= code && code <= 0x1cd2) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x1ce2) { + if (code < 0x1ce1) { + // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA + if (0x1cd4 <= code && code <= 0x1ce0) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA + if (0x1ce1 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x1ced) { + // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL + if (0x1ce2 <= code && code <= 0x1ce8) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn VEDIC SIGN TIRYAK + if (0x1ced === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mn VEDIC TONE CANDRA ABOVE + if (0x1cf4 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x200d) { + if (code < 0x1dc0) { + if (code < 0x1cf8) { + // Mc VEDIC SIGN ATIKRAMA + if (0x1cf7 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE + if (0x1cf8 <= code && code <= 0x1cf9) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x200b) { + // Mn [64] COMBINING DOTTED GRAVE ACCENT..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW + if (0x1dc0 <= code && code <= 0x1dff) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cf ZERO WIDTH SPACE + if (0x200b === code) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + // Cf ZERO WIDTH NON-JOINER + if (0x200c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x2060) { + if (code < 0x200e) { + // Cf ZERO WIDTH JOINER + if (0x200d === code) { + return boundaries_1.CLUSTER_BREAK.ZWJ; + } + } + else { + if (code < 0x2028) { + // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK + if (0x200e <= code && code <= 0x200f) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + // Zl LINE SEPARATOR + // Zp PARAGRAPH SEPARATOR + // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE + if (0x2028 <= code && code <= 0x202e) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + } + } + else { + if (code < 0x20d0) { + // Cf [5] WORD JOINER..INVISIBLE PLUS + // Cn + // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES + if (0x2060 <= code && code <= 0x206f) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + if (code < 0x2cef) { + // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE + // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH + // Mn COMBINING LEFT RIGHT ARROW ABOVE + // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE + // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE + if (0x20d0 <= code && code <= 0x20f0) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS + if (0x2cef <= code && code <= 0x2cf1) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + else { + if (code < 0xa823) { + if (code < 0xa674) { + if (code < 0x302a) { + if (code < 0x2de0) { + // Mn TIFINAGH CONSONANT JOINER + if (0x2d7f === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS + if (0x2de0 <= code && code <= 0x2dff) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x3099) { + // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK + // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK + if (0x302a <= code && code <= 0x302f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xa66f) { + // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + if (0x3099 <= code && code <= 0x309a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn COMBINING CYRILLIC VZMET + // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN + if (0xa66f <= code && code <= 0xa672) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xa802) { + if (code < 0xa69e) { + // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK + if (0xa674 <= code && code <= 0xa67d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xa6f0) { + // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E + if (0xa69e <= code && code <= 0xa69f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS + if (0xa6f0 <= code && code <= 0xa6f1) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xa806) { + // Mn SYLOTI NAGRI SIGN DVISVARA + if (0xa802 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn SYLOTI NAGRI SIGN HASANTA + if (0xa806 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mn SYLOTI NAGRI SIGN ANUSVARA + if (0xa80b === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0xa8b4) { + if (code < 0xa827) { + if (code < 0xa825) { + // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I + if (0xa823 <= code && code <= 0xa824) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E + if (0xa825 <= code && code <= 0xa826) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xa82c) { + // Mc SYLOTI NAGRI VOWEL SIGN OO + if (0xa827 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xa880) { + // Mn SYLOTI NAGRI SIGN ALTERNATE HASANTA + if (0xa82c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA + if (0xa880 <= code && code <= 0xa881) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0xa8ff) { + if (code < 0xa8c4) { + // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU + if (0xa8b4 <= code && code <= 0xa8c3) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xa8e0) { + // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU + if (0xa8c4 <= code && code <= 0xa8c5) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA + if (0xa8e0 <= code && code <= 0xa8f1) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xa926) { + // Mn DEVANAGARI VOWEL SIGN AY + if (0xa8ff === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xa947) { + // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU + if (0xa926 <= code && code <= 0xa92d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R + if (0xa947 <= code && code <= 0xa951) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + } + else { + if (code < 0xaab2) { + if (code < 0xa9e5) { + if (code < 0xa9b4) { + if (code < 0xa980) { + if (code < 0xa960) { + // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA + if (0xa952 <= code && code <= 0xa953) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH + if (0xa960 <= code && code <= 0xa97c) { + return boundaries_1.CLUSTER_BREAK.L; + } + } + } + else { + if (code < 0xa983) { + // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR + if (0xa980 <= code && code <= 0xa982) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc JAVANESE SIGN WIGNYAN + if (0xa983 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn JAVANESE SIGN CECAK TELU + if (0xa9b3 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xa9ba) { + if (code < 0xa9b6) { + // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG + if (0xa9b4 <= code && code <= 0xa9b5) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT + if (0xa9b6 <= code && code <= 0xa9b9) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xa9bc) { + // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE + if (0xa9ba <= code && code <= 0xa9bb) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xa9be) { + // Mn [2] JAVANESE VOWEL SIGN PEPET..JAVANESE CONSONANT SIGN KERET + if (0xa9bc <= code && code <= 0xa9bd) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [3] JAVANESE CONSONANT SIGN PENGKAL..JAVANESE PANGKON + if (0xa9be <= code && code <= 0xa9c0) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + else { + if (code < 0xaa35) { + if (code < 0xaa2f) { + if (code < 0xaa29) { + // Mn MYANMAR SIGN SHAN SAW + if (0xa9e5 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE + if (0xaa29 <= code && code <= 0xaa2e) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xaa31) { + // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI + if (0xaa2f <= code && code <= 0xaa30) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0xaa33) { + // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE + if (0xaa31 <= code && code <= 0xaa32) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA + if (0xaa33 <= code && code <= 0xaa34) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0xaa4d) { + if (code < 0xaa43) { + // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA + if (0xaa35 <= code && code <= 0xaa36) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn CHAM CONSONANT SIGN FINAL NG + if (0xaa43 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mn CHAM CONSONANT SIGN FINAL M + if (0xaa4c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xaa7c) { + // Mc CHAM CONSONANT SIGN FINAL H + if (0xaa4d === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn MYANMAR SIGN TAI LAING TONE-2 + if (0xaa7c === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mn TAI VIET MAI KANG + if (0xaab0 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0xabe6) { + if (code < 0xaaec) { + if (code < 0xaabe) { + if (code < 0xaab7) { + // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U + if (0xaab2 <= code && code <= 0xaab4) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA + if (0xaab7 <= code && code <= 0xaab8) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xaac1) { + // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK + if (0xaabe <= code && code <= 0xaabf) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn TAI VIET TONE MAI THO + if (0xaac1 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc MEETEI MAYEK VOWEL SIGN II + if (0xaaeb === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0xaaf6) { + if (code < 0xaaee) { + // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI + if (0xaaec <= code && code <= 0xaaed) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xaaf5) { + // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU + if (0xaaee <= code && code <= 0xaaef) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mc MEETEI MAYEK VOWEL SIGN VISARGA + if (0xaaf5 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0xabe3) { + // Mn MEETEI MAYEK VIRAMA + if (0xaaf6 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xabe5) { + // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP + if (0xabe3 <= code && code <= 0xabe4) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn MEETEI MAYEK VOWEL SIGN ANAP + if (0xabe5 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0xac00) { + if (code < 0xabe9) { + if (code < 0xabe8) { + // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP + if (0xabe6 <= code && code <= 0xabe7) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn MEETEI MAYEK VOWEL SIGN UNAP + if (0xabe8 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0xabec) { + // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG + if (0xabe9 <= code && code <= 0xabea) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mc MEETEI MAYEK LUM IYEK + if (0xabec === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn MEETEI MAYEK APUN IYEK + if (0xabed === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xac1d) { + if (code < 0xac01) { + // Lo HANGUL SYLLABLE GA + if (0xac00 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xac1c) { + // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH + if (0xac01 <= code && code <= 0xac1b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GAE + if (0xac1c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xac38) { + // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH + if (0xac1d <= code && code <= 0xac37) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xac39) { + // Lo HANGUL SYLLABLE GYA + if (0xac38 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH + if (0xac39 <= code && code <= 0xac53) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + } + } + } + else { + if (code < 0xb5a1) { + if (code < 0xb0ed) { + if (code < 0xaea0) { + if (code < 0xad6d) { + if (code < 0xace0) { + if (code < 0xac8d) { + if (code < 0xac70) { + if (code < 0xac55) { + // Lo HANGUL SYLLABLE GYAE + if (0xac54 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH + if (0xac55 <= code && code <= 0xac6f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xac71) { + // Lo HANGUL SYLLABLE GEO + if (0xac70 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xac8c) { + // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH + if (0xac71 <= code && code <= 0xac8b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GE + if (0xac8c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xaca9) { + if (code < 0xaca8) { + // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH + if (0xac8d <= code && code <= 0xaca7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GYEO + if (0xaca8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xacc4) { + // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH + if (0xaca9 <= code && code <= 0xacc3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xacc5) { + // Lo HANGUL SYLLABLE GYE + if (0xacc4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH + if (0xacc5 <= code && code <= 0xacdf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xad19) { + if (code < 0xacfc) { + if (code < 0xace1) { + // Lo HANGUL SYLLABLE GO + if (0xace0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH + if (0xace1 <= code && code <= 0xacfb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xacfd) { + // Lo HANGUL SYLLABLE GWA + if (0xacfc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xad18) { + // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH + if (0xacfd <= code && code <= 0xad17) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GWAE + if (0xad18 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xad50) { + if (code < 0xad34) { + // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH + if (0xad19 <= code && code <= 0xad33) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xad35) { + // Lo HANGUL SYLLABLE GOE + if (0xad34 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH + if (0xad35 <= code && code <= 0xad4f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xad51) { + // Lo HANGUL SYLLABLE GYO + if (0xad50 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xad6c) { + // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH + if (0xad51 <= code && code <= 0xad6b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GU + if (0xad6c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xadf9) { + if (code < 0xadc0) { + if (code < 0xad89) { + if (code < 0xad88) { + // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH + if (0xad6d <= code && code <= 0xad87) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GWEO + if (0xad88 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xada4) { + // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH + if (0xad89 <= code && code <= 0xada3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xada5) { + // Lo HANGUL SYLLABLE GWE + if (0xada4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH + if (0xada5 <= code && code <= 0xadbf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xaddc) { + if (code < 0xadc1) { + // Lo HANGUL SYLLABLE GWI + if (0xadc0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH + if (0xadc1 <= code && code <= 0xaddb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xaddd) { + // Lo HANGUL SYLLABLE GYU + if (0xaddc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xadf8) { + // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH + if (0xaddd <= code && code <= 0xadf7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GEU + if (0xadf8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xae4c) { + if (code < 0xae15) { + if (code < 0xae14) { + // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH + if (0xadf9 <= code && code <= 0xae13) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GYI + if (0xae14 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xae30) { + // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH + if (0xae15 <= code && code <= 0xae2f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xae31) { + // Lo HANGUL SYLLABLE GI + if (0xae30 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH + if (0xae31 <= code && code <= 0xae4b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xae69) { + if (code < 0xae4d) { + // Lo HANGUL SYLLABLE GGA + if (0xae4c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xae68) { + // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH + if (0xae4d <= code && code <= 0xae67) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GGAE + if (0xae68 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xae84) { + // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH + if (0xae69 <= code && code <= 0xae83) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xae85) { + // Lo HANGUL SYLLABLE GGYA + if (0xae84 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH + if (0xae85 <= code && code <= 0xae9f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + else { + if (code < 0xafb9) { + if (code < 0xaf2c) { + if (code < 0xaed9) { + if (code < 0xaebc) { + if (code < 0xaea1) { + // Lo HANGUL SYLLABLE GGYAE + if (0xaea0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH + if (0xaea1 <= code && code <= 0xaebb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xaebd) { + // Lo HANGUL SYLLABLE GGEO + if (0xaebc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xaed8) { + // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH + if (0xaebd <= code && code <= 0xaed7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GGE + if (0xaed8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xaef5) { + if (code < 0xaef4) { + // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH + if (0xaed9 <= code && code <= 0xaef3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GGYEO + if (0xaef4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xaf10) { + // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH + if (0xaef5 <= code && code <= 0xaf0f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xaf11) { + // Lo HANGUL SYLLABLE GGYE + if (0xaf10 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH + if (0xaf11 <= code && code <= 0xaf2b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xaf65) { + if (code < 0xaf48) { + if (code < 0xaf2d) { + // Lo HANGUL SYLLABLE GGO + if (0xaf2c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH + if (0xaf2d <= code && code <= 0xaf47) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xaf49) { + // Lo HANGUL SYLLABLE GGWA + if (0xaf48 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xaf64) { + // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH + if (0xaf49 <= code && code <= 0xaf63) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GGWAE + if (0xaf64 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xaf9c) { + if (code < 0xaf80) { + // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH + if (0xaf65 <= code && code <= 0xaf7f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xaf81) { + // Lo HANGUL SYLLABLE GGOE + if (0xaf80 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH + if (0xaf81 <= code && code <= 0xaf9b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xaf9d) { + // Lo HANGUL SYLLABLE GGYO + if (0xaf9c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xafb8) { + // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH + if (0xaf9d <= code && code <= 0xafb7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GGU + if (0xafb8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xb060) { + if (code < 0xb00c) { + if (code < 0xafd5) { + if (code < 0xafd4) { + // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH + if (0xafb9 <= code && code <= 0xafd3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GGWEO + if (0xafd4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xaff0) { + // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH + if (0xafd5 <= code && code <= 0xafef) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xaff1) { + // Lo HANGUL SYLLABLE GGWE + if (0xaff0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH + if (0xaff1 <= code && code <= 0xb00b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb029) { + if (code < 0xb00d) { + // Lo HANGUL SYLLABLE GGWI + if (0xb00c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb028) { + // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH + if (0xb00d <= code && code <= 0xb027) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE GGYU + if (0xb028 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xb044) { + // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH + if (0xb029 <= code && code <= 0xb043) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb045) { + // Lo HANGUL SYLLABLE GGEU + if (0xb044 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH + if (0xb045 <= code && code <= 0xb05f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xb099) { + if (code < 0xb07c) { + if (code < 0xb061) { + // Lo HANGUL SYLLABLE GGYI + if (0xb060 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH + if (0xb061 <= code && code <= 0xb07b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb07d) { + // Lo HANGUL SYLLABLE GGI + if (0xb07c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb098) { + // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH + if (0xb07d <= code && code <= 0xb097) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NA + if (0xb098 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xb0d0) { + if (code < 0xb0b4) { + // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH + if (0xb099 <= code && code <= 0xb0b3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb0b5) { + // Lo HANGUL SYLLABLE NAE + if (0xb0b4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH + if (0xb0b5 <= code && code <= 0xb0cf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xb0d1) { + // Lo HANGUL SYLLABLE NYA + if (0xb0d0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb0ec) { + // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH + if (0xb0d1 <= code && code <= 0xb0eb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NYAE + if (0xb0ec === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + } + else { + if (code < 0xb354) { + if (code < 0xb220) { + if (code < 0xb179) { + if (code < 0xb140) { + if (code < 0xb109) { + if (code < 0xb108) { + // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH + if (0xb0ed <= code && code <= 0xb107) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NEO + if (0xb108 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb124) { + // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH + if (0xb109 <= code && code <= 0xb123) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb125) { + // Lo HANGUL SYLLABLE NE + if (0xb124 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH + if (0xb125 <= code && code <= 0xb13f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb15c) { + if (code < 0xb141) { + // Lo HANGUL SYLLABLE NYEO + if (0xb140 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH + if (0xb141 <= code && code <= 0xb15b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb15d) { + // Lo HANGUL SYLLABLE NYE + if (0xb15c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb178) { + // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH + if (0xb15d <= code && code <= 0xb177) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NO + if (0xb178 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xb1cc) { + if (code < 0xb195) { + if (code < 0xb194) { + // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH + if (0xb179 <= code && code <= 0xb193) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NWA + if (0xb194 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb1b0) { + // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH + if (0xb195 <= code && code <= 0xb1af) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb1b1) { + // Lo HANGUL SYLLABLE NWAE + if (0xb1b0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH + if (0xb1b1 <= code && code <= 0xb1cb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb1e9) { + if (code < 0xb1cd) { + // Lo HANGUL SYLLABLE NOE + if (0xb1cc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb1e8) { + // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH + if (0xb1cd <= code && code <= 0xb1e7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NYO + if (0xb1e8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xb204) { + // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH + if (0xb1e9 <= code && code <= 0xb203) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb205) { + // Lo HANGUL SYLLABLE NU + if (0xb204 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH + if (0xb205 <= code && code <= 0xb21f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0xb2ad) { + if (code < 0xb259) { + if (code < 0xb23c) { + if (code < 0xb221) { + // Lo HANGUL SYLLABLE NWEO + if (0xb220 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH + if (0xb221 <= code && code <= 0xb23b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb23d) { + // Lo HANGUL SYLLABLE NWE + if (0xb23c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb258) { + // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH + if (0xb23d <= code && code <= 0xb257) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NWI + if (0xb258 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xb290) { + if (code < 0xb274) { + // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH + if (0xb259 <= code && code <= 0xb273) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb275) { + // Lo HANGUL SYLLABLE NYU + if (0xb274 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH + if (0xb275 <= code && code <= 0xb28f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xb291) { + // Lo HANGUL SYLLABLE NEU + if (0xb290 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb2ac) { + // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH + if (0xb291 <= code && code <= 0xb2ab) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NYI + if (0xb2ac === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xb300) { + if (code < 0xb2c9) { + if (code < 0xb2c8) { + // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH + if (0xb2ad <= code && code <= 0xb2c7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE NI + if (0xb2c8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb2e4) { + // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH + if (0xb2c9 <= code && code <= 0xb2e3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb2e5) { + // Lo HANGUL SYLLABLE DA + if (0xb2e4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH + if (0xb2e5 <= code && code <= 0xb2ff) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb31d) { + if (code < 0xb301) { + // Lo HANGUL SYLLABLE DAE + if (0xb300 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb31c) { + // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH + if (0xb301 <= code && code <= 0xb31b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DYA + if (0xb31c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xb338) { + // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH + if (0xb31d <= code && code <= 0xb337) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb339) { + // Lo HANGUL SYLLABLE DYAE + if (0xb338 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH + if (0xb339 <= code && code <= 0xb353) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + else { + if (code < 0xb46d) { + if (code < 0xb3e0) { + if (code < 0xb38d) { + if (code < 0xb370) { + if (code < 0xb355) { + // Lo HANGUL SYLLABLE DEO + if (0xb354 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH + if (0xb355 <= code && code <= 0xb36f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb371) { + // Lo HANGUL SYLLABLE DE + if (0xb370 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb38c) { + // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH + if (0xb371 <= code && code <= 0xb38b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DYEO + if (0xb38c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xb3a9) { + if (code < 0xb3a8) { + // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH + if (0xb38d <= code && code <= 0xb3a7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DYE + if (0xb3a8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb3c4) { + // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH + if (0xb3a9 <= code && code <= 0xb3c3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb3c5) { + // Lo HANGUL SYLLABLE DO + if (0xb3c4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH + if (0xb3c5 <= code && code <= 0xb3df) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xb419) { + if (code < 0xb3fc) { + if (code < 0xb3e1) { + // Lo HANGUL SYLLABLE DWA + if (0xb3e0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH + if (0xb3e1 <= code && code <= 0xb3fb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb3fd) { + // Lo HANGUL SYLLABLE DWAE + if (0xb3fc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb418) { + // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH + if (0xb3fd <= code && code <= 0xb417) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DOE + if (0xb418 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xb450) { + if (code < 0xb434) { + // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH + if (0xb419 <= code && code <= 0xb433) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb435) { + // Lo HANGUL SYLLABLE DYO + if (0xb434 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH + if (0xb435 <= code && code <= 0xb44f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xb451) { + // Lo HANGUL SYLLABLE DU + if (0xb450 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb46c) { + // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH + if (0xb451 <= code && code <= 0xb46b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DWEO + if (0xb46c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xb514) { + if (code < 0xb4c0) { + if (code < 0xb489) { + if (code < 0xb488) { + // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH + if (0xb46d <= code && code <= 0xb487) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DWE + if (0xb488 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb4a4) { + // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH + if (0xb489 <= code && code <= 0xb4a3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb4a5) { + // Lo HANGUL SYLLABLE DWI + if (0xb4a4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH + if (0xb4a5 <= code && code <= 0xb4bf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb4dd) { + if (code < 0xb4c1) { + // Lo HANGUL SYLLABLE DYU + if (0xb4c0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb4dc) { + // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH + if (0xb4c1 <= code && code <= 0xb4db) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DEU + if (0xb4dc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xb4f8) { + // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH + if (0xb4dd <= code && code <= 0xb4f7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb4f9) { + // Lo HANGUL SYLLABLE DYI + if (0xb4f8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH + if (0xb4f9 <= code && code <= 0xb513) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xb54d) { + if (code < 0xb530) { + if (code < 0xb515) { + // Lo HANGUL SYLLABLE DI + if (0xb514 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH + if (0xb515 <= code && code <= 0xb52f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb531) { + // Lo HANGUL SYLLABLE DDA + if (0xb530 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb54c) { + // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH + if (0xb531 <= code && code <= 0xb54b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DDAE + if (0xb54c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xb584) { + if (code < 0xb568) { + // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH + if (0xb54d <= code && code <= 0xb567) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb569) { + // Lo HANGUL SYLLABLE DDYA + if (0xb568 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH + if (0xb569 <= code && code <= 0xb583) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xb585) { + // Lo HANGUL SYLLABLE DDYAE + if (0xb584 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb5a0) { + // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH + if (0xb585 <= code && code <= 0xb59f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DDEO + if (0xb5a0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + } + } + else { + if (code < 0xba55) { + if (code < 0xb808) { + if (code < 0xb6d4) { + if (code < 0xb62d) { + if (code < 0xb5f4) { + if (code < 0xb5bd) { + if (code < 0xb5bc) { + // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH + if (0xb5a1 <= code && code <= 0xb5bb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DDE + if (0xb5bc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb5d8) { + // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH + if (0xb5bd <= code && code <= 0xb5d7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb5d9) { + // Lo HANGUL SYLLABLE DDYEO + if (0xb5d8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH + if (0xb5d9 <= code && code <= 0xb5f3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb610) { + if (code < 0xb5f5) { + // Lo HANGUL SYLLABLE DDYE + if (0xb5f4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH + if (0xb5f5 <= code && code <= 0xb60f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb611) { + // Lo HANGUL SYLLABLE DDO + if (0xb610 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb62c) { + // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH + if (0xb611 <= code && code <= 0xb62b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DDWA + if (0xb62c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xb680) { + if (code < 0xb649) { + if (code < 0xb648) { + // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH + if (0xb62d <= code && code <= 0xb647) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DDWAE + if (0xb648 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb664) { + // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH + if (0xb649 <= code && code <= 0xb663) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb665) { + // Lo HANGUL SYLLABLE DDOE + if (0xb664 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH + if (0xb665 <= code && code <= 0xb67f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb69d) { + if (code < 0xb681) { + // Lo HANGUL SYLLABLE DDYO + if (0xb680 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb69c) { + // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH + if (0xb681 <= code && code <= 0xb69b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DDU + if (0xb69c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xb6b8) { + // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH + if (0xb69d <= code && code <= 0xb6b7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb6b9) { + // Lo HANGUL SYLLABLE DDWEO + if (0xb6b8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH + if (0xb6b9 <= code && code <= 0xb6d3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0xb761) { + if (code < 0xb70d) { + if (code < 0xb6f0) { + if (code < 0xb6d5) { + // Lo HANGUL SYLLABLE DDWE + if (0xb6d4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH + if (0xb6d5 <= code && code <= 0xb6ef) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb6f1) { + // Lo HANGUL SYLLABLE DDWI + if (0xb6f0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb70c) { + // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH + if (0xb6f1 <= code && code <= 0xb70b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DDYU + if (0xb70c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xb744) { + if (code < 0xb728) { + // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH + if (0xb70d <= code && code <= 0xb727) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb729) { + // Lo HANGUL SYLLABLE DDEU + if (0xb728 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH + if (0xb729 <= code && code <= 0xb743) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xb745) { + // Lo HANGUL SYLLABLE DDYI + if (0xb744 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb760) { + // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH + if (0xb745 <= code && code <= 0xb75f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE DDI + if (0xb760 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xb7b4) { + if (code < 0xb77d) { + if (code < 0xb77c) { + // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH + if (0xb761 <= code && code <= 0xb77b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE RA + if (0xb77c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb798) { + // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH + if (0xb77d <= code && code <= 0xb797) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb799) { + // Lo HANGUL SYLLABLE RAE + if (0xb798 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH + if (0xb799 <= code && code <= 0xb7b3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb7d1) { + if (code < 0xb7b5) { + // Lo HANGUL SYLLABLE RYA + if (0xb7b4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb7d0) { + // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH + if (0xb7b5 <= code && code <= 0xb7cf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE RYAE + if (0xb7d0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xb7ec) { + // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH + if (0xb7d1 <= code && code <= 0xb7eb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb7ed) { + // Lo HANGUL SYLLABLE REO + if (0xb7ec === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH + if (0xb7ed <= code && code <= 0xb807) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + else { + if (code < 0xb921) { + if (code < 0xb894) { + if (code < 0xb841) { + if (code < 0xb824) { + if (code < 0xb809) { + // Lo HANGUL SYLLABLE RE + if (0xb808 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH + if (0xb809 <= code && code <= 0xb823) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb825) { + // Lo HANGUL SYLLABLE RYEO + if (0xb824 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb840) { + // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH + if (0xb825 <= code && code <= 0xb83f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE RYE + if (0xb840 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xb85d) { + if (code < 0xb85c) { + // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH + if (0xb841 <= code && code <= 0xb85b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE RO + if (0xb85c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb878) { + // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH + if (0xb85d <= code && code <= 0xb877) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb879) { + // Lo HANGUL SYLLABLE RWA + if (0xb878 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH + if (0xb879 <= code && code <= 0xb893) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xb8cd) { + if (code < 0xb8b0) { + if (code < 0xb895) { + // Lo HANGUL SYLLABLE RWAE + if (0xb894 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH + if (0xb895 <= code && code <= 0xb8af) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb8b1) { + // Lo HANGUL SYLLABLE ROE + if (0xb8b0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb8cc) { + // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH + if (0xb8b1 <= code && code <= 0xb8cb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE RYO + if (0xb8cc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xb904) { + if (code < 0xb8e8) { + // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH + if (0xb8cd <= code && code <= 0xb8e7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb8e9) { + // Lo HANGUL SYLLABLE RU + if (0xb8e8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH + if (0xb8e9 <= code && code <= 0xb903) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xb905) { + // Lo HANGUL SYLLABLE RWEO + if (0xb904 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb920) { + // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH + if (0xb905 <= code && code <= 0xb91f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE RWE + if (0xb920 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xb9c8) { + if (code < 0xb974) { + if (code < 0xb93d) { + if (code < 0xb93c) { + // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH + if (0xb921 <= code && code <= 0xb93b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE RWI + if (0xb93c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xb958) { + // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH + if (0xb93d <= code && code <= 0xb957) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb959) { + // Lo HANGUL SYLLABLE RYU + if (0xb958 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH + if (0xb959 <= code && code <= 0xb973) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xb991) { + if (code < 0xb975) { + // Lo HANGUL SYLLABLE REU + if (0xb974 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xb990) { + // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH + if (0xb975 <= code && code <= 0xb98f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE RYI + if (0xb990 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xb9ac) { + // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH + if (0xb991 <= code && code <= 0xb9ab) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xb9ad) { + // Lo HANGUL SYLLABLE RI + if (0xb9ac === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH + if (0xb9ad <= code && code <= 0xb9c7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xba01) { + if (code < 0xb9e4) { + if (code < 0xb9c9) { + // Lo HANGUL SYLLABLE MA + if (0xb9c8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH + if (0xb9c9 <= code && code <= 0xb9e3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xb9e5) { + // Lo HANGUL SYLLABLE MAE + if (0xb9e4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xba00) { + // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH + if (0xb9e5 <= code && code <= 0xb9ff) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE MYA + if (0xba00 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xba38) { + if (code < 0xba1c) { + // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH + if (0xba01 <= code && code <= 0xba1b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xba1d) { + // Lo HANGUL SYLLABLE MYAE + if (0xba1c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH + if (0xba1d <= code && code <= 0xba37) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xba39) { + // Lo HANGUL SYLLABLE MEO + if (0xba38 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xba54) { + // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH + if (0xba39 <= code && code <= 0xba53) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE ME + if (0xba54 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + } + else { + if (code < 0xbcbc) { + if (code < 0xbb88) { + if (code < 0xbae1) { + if (code < 0xbaa8) { + if (code < 0xba71) { + if (code < 0xba70) { + // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH + if (0xba55 <= code && code <= 0xba6f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE MYEO + if (0xba70 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xba8c) { + // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH + if (0xba71 <= code && code <= 0xba8b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xba8d) { + // Lo HANGUL SYLLABLE MYE + if (0xba8c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH + if (0xba8d <= code && code <= 0xbaa7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xbac4) { + if (code < 0xbaa9) { + // Lo HANGUL SYLLABLE MO + if (0xbaa8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH + if (0xbaa9 <= code && code <= 0xbac3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xbac5) { + // Lo HANGUL SYLLABLE MWA + if (0xbac4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbae0) { + // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH + if (0xbac5 <= code && code <= 0xbadf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE MWAE + if (0xbae0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xbb34) { + if (code < 0xbafd) { + if (code < 0xbafc) { + // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH + if (0xbae1 <= code && code <= 0xbafb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE MOE + if (0xbafc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xbb18) { + // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH + if (0xbafd <= code && code <= 0xbb17) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbb19) { + // Lo HANGUL SYLLABLE MYO + if (0xbb18 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH + if (0xbb19 <= code && code <= 0xbb33) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xbb51) { + if (code < 0xbb35) { + // Lo HANGUL SYLLABLE MU + if (0xbb34 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbb50) { + // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH + if (0xbb35 <= code && code <= 0xbb4f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE MWEO + if (0xbb50 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xbb6c) { + // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH + if (0xbb51 <= code && code <= 0xbb6b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbb6d) { + // Lo HANGUL SYLLABLE MWE + if (0xbb6c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH + if (0xbb6d <= code && code <= 0xbb87) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0xbc15) { + if (code < 0xbbc1) { + if (code < 0xbba4) { + if (code < 0xbb89) { + // Lo HANGUL SYLLABLE MWI + if (0xbb88 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH + if (0xbb89 <= code && code <= 0xbba3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xbba5) { + // Lo HANGUL SYLLABLE MYU + if (0xbba4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbbc0) { + // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH + if (0xbba5 <= code && code <= 0xbbbf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE MEU + if (0xbbc0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xbbf8) { + if (code < 0xbbdc) { + // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH + if (0xbbc1 <= code && code <= 0xbbdb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbbdd) { + // Lo HANGUL SYLLABLE MYI + if (0xbbdc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH + if (0xbbdd <= code && code <= 0xbbf7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xbbf9) { + // Lo HANGUL SYLLABLE MI + if (0xbbf8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbc14) { + // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH + if (0xbbf9 <= code && code <= 0xbc13) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BA + if (0xbc14 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xbc68) { + if (code < 0xbc31) { + if (code < 0xbc30) { + // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH + if (0xbc15 <= code && code <= 0xbc2f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BAE + if (0xbc30 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xbc4c) { + // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH + if (0xbc31 <= code && code <= 0xbc4b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbc4d) { + // Lo HANGUL SYLLABLE BYA + if (0xbc4c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH + if (0xbc4d <= code && code <= 0xbc67) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xbc85) { + if (code < 0xbc69) { + // Lo HANGUL SYLLABLE BYAE + if (0xbc68 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbc84) { + // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH + if (0xbc69 <= code && code <= 0xbc83) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BEO + if (0xbc84 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xbca0) { + // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH + if (0xbc85 <= code && code <= 0xbc9f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbca1) { + // Lo HANGUL SYLLABLE BE + if (0xbca0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH + if (0xbca1 <= code && code <= 0xbcbb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + else { + if (code < 0xbdd5) { + if (code < 0xbd48) { + if (code < 0xbcf5) { + if (code < 0xbcd8) { + if (code < 0xbcbd) { + // Lo HANGUL SYLLABLE BYEO + if (0xbcbc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH + if (0xbcbd <= code && code <= 0xbcd7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xbcd9) { + // Lo HANGUL SYLLABLE BYE + if (0xbcd8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbcf4) { + // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH + if (0xbcd9 <= code && code <= 0xbcf3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BO + if (0xbcf4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xbd11) { + if (code < 0xbd10) { + // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH + if (0xbcf5 <= code && code <= 0xbd0f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BWA + if (0xbd10 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xbd2c) { + // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH + if (0xbd11 <= code && code <= 0xbd2b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbd2d) { + // Lo HANGUL SYLLABLE BWAE + if (0xbd2c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH + if (0xbd2d <= code && code <= 0xbd47) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xbd81) { + if (code < 0xbd64) { + if (code < 0xbd49) { + // Lo HANGUL SYLLABLE BOE + if (0xbd48 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH + if (0xbd49 <= code && code <= 0xbd63) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xbd65) { + // Lo HANGUL SYLLABLE BYO + if (0xbd64 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbd80) { + // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH + if (0xbd65 <= code && code <= 0xbd7f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BU + if (0xbd80 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xbdb8) { + if (code < 0xbd9c) { + // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH + if (0xbd81 <= code && code <= 0xbd9b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbd9d) { + // Lo HANGUL SYLLABLE BWEO + if (0xbd9c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH + if (0xbd9d <= code && code <= 0xbdb7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xbdb9) { + // Lo HANGUL SYLLABLE BWE + if (0xbdb8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbdd4) { + // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH + if (0xbdb9 <= code && code <= 0xbdd3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BWI + if (0xbdd4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xbe7c) { + if (code < 0xbe28) { + if (code < 0xbdf1) { + if (code < 0xbdf0) { + // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH + if (0xbdd5 <= code && code <= 0xbdef) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BYU + if (0xbdf0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xbe0c) { + // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH + if (0xbdf1 <= code && code <= 0xbe0b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbe0d) { + // Lo HANGUL SYLLABLE BEU + if (0xbe0c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH + if (0xbe0d <= code && code <= 0xbe27) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xbe45) { + if (code < 0xbe29) { + // Lo HANGUL SYLLABLE BYI + if (0xbe28 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbe44) { + // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH + if (0xbe29 <= code && code <= 0xbe43) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BI + if (0xbe44 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xbe60) { + // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH + if (0xbe45 <= code && code <= 0xbe5f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbe61) { + // Lo HANGUL SYLLABLE BBA + if (0xbe60 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH + if (0xbe61 <= code && code <= 0xbe7b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xbeb5) { + if (code < 0xbe98) { + if (code < 0xbe7d) { + // Lo HANGUL SYLLABLE BBAE + if (0xbe7c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH + if (0xbe7d <= code && code <= 0xbe97) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xbe99) { + // Lo HANGUL SYLLABLE BBYA + if (0xbe98 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbeb4) { + // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH + if (0xbe99 <= code && code <= 0xbeb3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BBYAE + if (0xbeb4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xbeec) { + if (code < 0xbed0) { + // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH + if (0xbeb5 <= code && code <= 0xbecf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbed1) { + // Lo HANGUL SYLLABLE BBEO + if (0xbed0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH + if (0xbed1 <= code && code <= 0xbeeb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xbeed) { + // Lo HANGUL SYLLABLE BBE + if (0xbeec === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbf08) { + // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH + if (0xbeed <= code && code <= 0xbf07) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BBYEO + if (0xbf08 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + } + } + } + } + else { + if (code < 0xd1d8) { + if (code < 0xc870) { + if (code < 0xc3bc) { + if (code < 0xc155) { + if (code < 0xc03c) { + if (code < 0xbf95) { + if (code < 0xbf5c) { + if (code < 0xbf25) { + if (code < 0xbf24) { + // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH + if (0xbf09 <= code && code <= 0xbf23) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BBYE + if (0xbf24 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xbf40) { + // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH + if (0xbf25 <= code && code <= 0xbf3f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbf41) { + // Lo HANGUL SYLLABLE BBO + if (0xbf40 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH + if (0xbf41 <= code && code <= 0xbf5b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xbf78) { + if (code < 0xbf5d) { + // Lo HANGUL SYLLABLE BBWA + if (0xbf5c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH + if (0xbf5d <= code && code <= 0xbf77) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xbf79) { + // Lo HANGUL SYLLABLE BBWAE + if (0xbf78 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xbf94) { + // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH + if (0xbf79 <= code && code <= 0xbf93) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BBOE + if (0xbf94 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xbfe8) { + if (code < 0xbfb1) { + if (code < 0xbfb0) { + // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH + if (0xbf95 <= code && code <= 0xbfaf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BBYO + if (0xbfb0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xbfcc) { + // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH + if (0xbfb1 <= code && code <= 0xbfcb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xbfcd) { + // Lo HANGUL SYLLABLE BBU + if (0xbfcc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH + if (0xbfcd <= code && code <= 0xbfe7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc005) { + if (code < 0xbfe9) { + // Lo HANGUL SYLLABLE BBWEO + if (0xbfe8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc004) { + // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH + if (0xbfe9 <= code && code <= 0xc003) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BBWE + if (0xc004 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xc020) { + // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH + if (0xc005 <= code && code <= 0xc01f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc021) { + // Lo HANGUL SYLLABLE BBWI + if (0xc020 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH + if (0xc021 <= code && code <= 0xc03b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0xc0c8) { + if (code < 0xc075) { + if (code < 0xc058) { + if (code < 0xc03d) { + // Lo HANGUL SYLLABLE BBYU + if (0xc03c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH + if (0xc03d <= code && code <= 0xc057) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc059) { + // Lo HANGUL SYLLABLE BBEU + if (0xc058 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc074) { + // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH + if (0xc059 <= code && code <= 0xc073) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BBYI + if (0xc074 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc091) { + if (code < 0xc090) { + // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH + if (0xc075 <= code && code <= 0xc08f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE BBI + if (0xc090 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc0ac) { + // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH + if (0xc091 <= code && code <= 0xc0ab) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc0ad) { + // Lo HANGUL SYLLABLE SA + if (0xc0ac === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH + if (0xc0ad <= code && code <= 0xc0c7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xc101) { + if (code < 0xc0e4) { + if (code < 0xc0c9) { + // Lo HANGUL SYLLABLE SAE + if (0xc0c8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH + if (0xc0c9 <= code && code <= 0xc0e3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc0e5) { + // Lo HANGUL SYLLABLE SYA + if (0xc0e4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc100) { + // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH + if (0xc0e5 <= code && code <= 0xc0ff) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SYAE + if (0xc100 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc138) { + if (code < 0xc11c) { + // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH + if (0xc101 <= code && code <= 0xc11b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc11d) { + // Lo HANGUL SYLLABLE SEO + if (0xc11c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH + if (0xc11d <= code && code <= 0xc137) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xc139) { + // Lo HANGUL SYLLABLE SE + if (0xc138 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc154) { + // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH + if (0xc139 <= code && code <= 0xc153) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SYEO + if (0xc154 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + else { + if (code < 0xc288) { + if (code < 0xc1e1) { + if (code < 0xc1a8) { + if (code < 0xc171) { + if (code < 0xc170) { + // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH + if (0xc155 <= code && code <= 0xc16f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SYE + if (0xc170 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc18c) { + // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH + if (0xc171 <= code && code <= 0xc18b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc18d) { + // Lo HANGUL SYLLABLE SO + if (0xc18c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH + if (0xc18d <= code && code <= 0xc1a7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc1c4) { + if (code < 0xc1a9) { + // Lo HANGUL SYLLABLE SWA + if (0xc1a8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH + if (0xc1a9 <= code && code <= 0xc1c3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc1c5) { + // Lo HANGUL SYLLABLE SWAE + if (0xc1c4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc1e0) { + // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH + if (0xc1c5 <= code && code <= 0xc1df) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SOE + if (0xc1e0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xc234) { + if (code < 0xc1fd) { + if (code < 0xc1fc) { + // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH + if (0xc1e1 <= code && code <= 0xc1fb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SYO + if (0xc1fc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc218) { + // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH + if (0xc1fd <= code && code <= 0xc217) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc219) { + // Lo HANGUL SYLLABLE SU + if (0xc218 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH + if (0xc219 <= code && code <= 0xc233) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc251) { + if (code < 0xc235) { + // Lo HANGUL SYLLABLE SWEO + if (0xc234 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc250) { + // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH + if (0xc235 <= code && code <= 0xc24f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SWE + if (0xc250 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xc26c) { + // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH + if (0xc251 <= code && code <= 0xc26b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc26d) { + // Lo HANGUL SYLLABLE SWI + if (0xc26c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH + if (0xc26d <= code && code <= 0xc287) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0xc315) { + if (code < 0xc2c1) { + if (code < 0xc2a4) { + if (code < 0xc289) { + // Lo HANGUL SYLLABLE SYU + if (0xc288 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH + if (0xc289 <= code && code <= 0xc2a3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc2a5) { + // Lo HANGUL SYLLABLE SEU + if (0xc2a4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc2c0) { + // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH + if (0xc2a5 <= code && code <= 0xc2bf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SYI + if (0xc2c0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc2f8) { + if (code < 0xc2dc) { + // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH + if (0xc2c1 <= code && code <= 0xc2db) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc2dd) { + // Lo HANGUL SYLLABLE SI + if (0xc2dc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH + if (0xc2dd <= code && code <= 0xc2f7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xc2f9) { + // Lo HANGUL SYLLABLE SSA + if (0xc2f8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc314) { + // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH + if (0xc2f9 <= code && code <= 0xc313) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SSAE + if (0xc314 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xc368) { + if (code < 0xc331) { + if (code < 0xc330) { + // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH + if (0xc315 <= code && code <= 0xc32f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SSYA + if (0xc330 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc34c) { + // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH + if (0xc331 <= code && code <= 0xc34b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc34d) { + // Lo HANGUL SYLLABLE SSYAE + if (0xc34c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH + if (0xc34d <= code && code <= 0xc367) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc385) { + if (code < 0xc369) { + // Lo HANGUL SYLLABLE SSEO + if (0xc368 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc384) { + // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH + if (0xc369 <= code && code <= 0xc383) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SSE + if (0xc384 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xc3a0) { + // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH + if (0xc385 <= code && code <= 0xc39f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc3a1) { + // Lo HANGUL SYLLABLE SSYEO + if (0xc3a0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH + if (0xc3a1 <= code && code <= 0xc3bb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + } + else { + if (code < 0xc609) { + if (code < 0xc4d5) { + if (code < 0xc448) { + if (code < 0xc3f5) { + if (code < 0xc3d8) { + if (code < 0xc3bd) { + // Lo HANGUL SYLLABLE SSYE + if (0xc3bc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH + if (0xc3bd <= code && code <= 0xc3d7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc3d9) { + // Lo HANGUL SYLLABLE SSO + if (0xc3d8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc3f4) { + // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH + if (0xc3d9 <= code && code <= 0xc3f3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SSWA + if (0xc3f4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc411) { + if (code < 0xc410) { + // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH + if (0xc3f5 <= code && code <= 0xc40f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SSWAE + if (0xc410 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc42c) { + // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH + if (0xc411 <= code && code <= 0xc42b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc42d) { + // Lo HANGUL SYLLABLE SSOE + if (0xc42c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH + if (0xc42d <= code && code <= 0xc447) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xc481) { + if (code < 0xc464) { + if (code < 0xc449) { + // Lo HANGUL SYLLABLE SSYO + if (0xc448 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH + if (0xc449 <= code && code <= 0xc463) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc465) { + // Lo HANGUL SYLLABLE SSU + if (0xc464 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc480) { + // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH + if (0xc465 <= code && code <= 0xc47f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SSWEO + if (0xc480 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc4b8) { + if (code < 0xc49c) { + // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH + if (0xc481 <= code && code <= 0xc49b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc49d) { + // Lo HANGUL SYLLABLE SSWE + if (0xc49c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH + if (0xc49d <= code && code <= 0xc4b7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xc4b9) { + // Lo HANGUL SYLLABLE SSWI + if (0xc4b8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc4d4) { + // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH + if (0xc4b9 <= code && code <= 0xc4d3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SSYU + if (0xc4d4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xc57c) { + if (code < 0xc528) { + if (code < 0xc4f1) { + if (code < 0xc4f0) { + // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH + if (0xc4d5 <= code && code <= 0xc4ef) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE SSEU + if (0xc4f0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc50c) { + // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH + if (0xc4f1 <= code && code <= 0xc50b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc50d) { + // Lo HANGUL SYLLABLE SSYI + if (0xc50c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH + if (0xc50d <= code && code <= 0xc527) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc545) { + if (code < 0xc529) { + // Lo HANGUL SYLLABLE SSI + if (0xc528 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc544) { + // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH + if (0xc529 <= code && code <= 0xc543) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE A + if (0xc544 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xc560) { + // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH + if (0xc545 <= code && code <= 0xc55f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc561) { + // Lo HANGUL SYLLABLE AE + if (0xc560 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH + if (0xc561 <= code && code <= 0xc57b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xc5b5) { + if (code < 0xc598) { + if (code < 0xc57d) { + // Lo HANGUL SYLLABLE YA + if (0xc57c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH + if (0xc57d <= code && code <= 0xc597) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc599) { + // Lo HANGUL SYLLABLE YAE + if (0xc598 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc5b4) { + // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH + if (0xc599 <= code && code <= 0xc5b3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE EO + if (0xc5b4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc5ec) { + if (code < 0xc5d0) { + // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH + if (0xc5b5 <= code && code <= 0xc5cf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc5d1) { + // Lo HANGUL SYLLABLE E + if (0xc5d0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH + if (0xc5d1 <= code && code <= 0xc5eb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xc5ed) { + // Lo HANGUL SYLLABLE YEO + if (0xc5ec === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc608) { + // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH + if (0xc5ed <= code && code <= 0xc607) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE YE + if (0xc608 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + else { + if (code < 0xc73c) { + if (code < 0xc695) { + if (code < 0xc65c) { + if (code < 0xc625) { + if (code < 0xc624) { + // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH + if (0xc609 <= code && code <= 0xc623) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE O + if (0xc624 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc640) { + // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH + if (0xc625 <= code && code <= 0xc63f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc641) { + // Lo HANGUL SYLLABLE WA + if (0xc640 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH + if (0xc641 <= code && code <= 0xc65b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc678) { + if (code < 0xc65d) { + // Lo HANGUL SYLLABLE WAE + if (0xc65c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH + if (0xc65d <= code && code <= 0xc677) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc679) { + // Lo HANGUL SYLLABLE OE + if (0xc678 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc694) { + // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH + if (0xc679 <= code && code <= 0xc693) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE YO + if (0xc694 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xc6e8) { + if (code < 0xc6b1) { + if (code < 0xc6b0) { + // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH + if (0xc695 <= code && code <= 0xc6af) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE U + if (0xc6b0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc6cc) { + // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH + if (0xc6b1 <= code && code <= 0xc6cb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc6cd) { + // Lo HANGUL SYLLABLE WEO + if (0xc6cc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH + if (0xc6cd <= code && code <= 0xc6e7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc705) { + if (code < 0xc6e9) { + // Lo HANGUL SYLLABLE WE + if (0xc6e8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc704) { + // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH + if (0xc6e9 <= code && code <= 0xc703) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE WI + if (0xc704 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xc720) { + // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH + if (0xc705 <= code && code <= 0xc71f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc721) { + // Lo HANGUL SYLLABLE YU + if (0xc720 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH + if (0xc721 <= code && code <= 0xc73b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0xc7c9) { + if (code < 0xc775) { + if (code < 0xc758) { + if (code < 0xc73d) { + // Lo HANGUL SYLLABLE EU + if (0xc73c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH + if (0xc73d <= code && code <= 0xc757) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc759) { + // Lo HANGUL SYLLABLE YI + if (0xc758 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc774) { + // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH + if (0xc759 <= code && code <= 0xc773) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE I + if (0xc774 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc7ac) { + if (code < 0xc790) { + // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH + if (0xc775 <= code && code <= 0xc78f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc791) { + // Lo HANGUL SYLLABLE JA + if (0xc790 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH + if (0xc791 <= code && code <= 0xc7ab) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xc7ad) { + // Lo HANGUL SYLLABLE JAE + if (0xc7ac === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc7c8) { + // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH + if (0xc7ad <= code && code <= 0xc7c7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JYA + if (0xc7c8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xc81c) { + if (code < 0xc7e5) { + if (code < 0xc7e4) { + // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH + if (0xc7c9 <= code && code <= 0xc7e3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JYAE + if (0xc7e4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc800) { + // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH + if (0xc7e5 <= code && code <= 0xc7ff) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc801) { + // Lo HANGUL SYLLABLE JEO + if (0xc800 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH + if (0xc801 <= code && code <= 0xc81b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc839) { + if (code < 0xc81d) { + // Lo HANGUL SYLLABLE JE + if (0xc81c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc838) { + // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH + if (0xc81d <= code && code <= 0xc837) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JYEO + if (0xc838 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xc854) { + // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH + if (0xc839 <= code && code <= 0xc853) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc855) { + // Lo HANGUL SYLLABLE JYE + if (0xc854 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH + if (0xc855 <= code && code <= 0xc86f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + } + } + else { + if (code < 0xcd24) { + if (code < 0xcabd) { + if (code < 0xc989) { + if (code < 0xc8fc) { + if (code < 0xc8a9) { + if (code < 0xc88c) { + if (code < 0xc871) { + // Lo HANGUL SYLLABLE JO + if (0xc870 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH + if (0xc871 <= code && code <= 0xc88b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc88d) { + // Lo HANGUL SYLLABLE JWA + if (0xc88c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc8a8) { + // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH + if (0xc88d <= code && code <= 0xc8a7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JWAE + if (0xc8a8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc8c5) { + if (code < 0xc8c4) { + // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH + if (0xc8a9 <= code && code <= 0xc8c3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JOE + if (0xc8c4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc8e0) { + // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH + if (0xc8c5 <= code && code <= 0xc8df) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc8e1) { + // Lo HANGUL SYLLABLE JYO + if (0xc8e0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH + if (0xc8e1 <= code && code <= 0xc8fb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xc935) { + if (code < 0xc918) { + if (code < 0xc8fd) { + // Lo HANGUL SYLLABLE JU + if (0xc8fc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH + if (0xc8fd <= code && code <= 0xc917) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xc919) { + // Lo HANGUL SYLLABLE JWEO + if (0xc918 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc934) { + // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH + if (0xc919 <= code && code <= 0xc933) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JWE + if (0xc934 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xc96c) { + if (code < 0xc950) { + // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH + if (0xc935 <= code && code <= 0xc94f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc951) { + // Lo HANGUL SYLLABLE JWI + if (0xc950 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH + if (0xc951 <= code && code <= 0xc96b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xc96d) { + // Lo HANGUL SYLLABLE JYU + if (0xc96c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc988) { + // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH + if (0xc96d <= code && code <= 0xc987) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JEU + if (0xc988 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xca30) { + if (code < 0xc9dc) { + if (code < 0xc9a5) { + if (code < 0xc9a4) { + // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH + if (0xc989 <= code && code <= 0xc9a3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JYI + if (0xc9a4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xc9c0) { + // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH + if (0xc9a5 <= code && code <= 0xc9bf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xc9c1) { + // Lo HANGUL SYLLABLE JI + if (0xc9c0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH + if (0xc9c1 <= code && code <= 0xc9db) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xc9f9) { + if (code < 0xc9dd) { + // Lo HANGUL SYLLABLE JJA + if (0xc9dc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xc9f8) { + // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH + if (0xc9dd <= code && code <= 0xc9f7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JJAE + if (0xc9f8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xca14) { + // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH + if (0xc9f9 <= code && code <= 0xca13) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xca15) { + // Lo HANGUL SYLLABLE JJYA + if (0xca14 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH + if (0xca15 <= code && code <= 0xca2f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xca69) { + if (code < 0xca4c) { + if (code < 0xca31) { + // Lo HANGUL SYLLABLE JJYAE + if (0xca30 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH + if (0xca31 <= code && code <= 0xca4b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xca4d) { + // Lo HANGUL SYLLABLE JJEO + if (0xca4c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xca68) { + // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH + if (0xca4d <= code && code <= 0xca67) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JJE + if (0xca68 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xcaa0) { + if (code < 0xca84) { + // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH + if (0xca69 <= code && code <= 0xca83) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xca85) { + // Lo HANGUL SYLLABLE JJYEO + if (0xca84 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH + if (0xca85 <= code && code <= 0xca9f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xcaa1) { + // Lo HANGUL SYLLABLE JJYE + if (0xcaa0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcabc) { + // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH + if (0xcaa1 <= code && code <= 0xcabb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JJO + if (0xcabc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + else { + if (code < 0xcbf0) { + if (code < 0xcb49) { + if (code < 0xcb10) { + if (code < 0xcad9) { + if (code < 0xcad8) { + // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH + if (0xcabd <= code && code <= 0xcad7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JJWA + if (0xcad8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xcaf4) { + // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH + if (0xcad9 <= code && code <= 0xcaf3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcaf5) { + // Lo HANGUL SYLLABLE JJWAE + if (0xcaf4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH + if (0xcaf5 <= code && code <= 0xcb0f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xcb2c) { + if (code < 0xcb11) { + // Lo HANGUL SYLLABLE JJOE + if (0xcb10 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH + if (0xcb11 <= code && code <= 0xcb2b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xcb2d) { + // Lo HANGUL SYLLABLE JJYO + if (0xcb2c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcb48) { + // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH + if (0xcb2d <= code && code <= 0xcb47) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JJU + if (0xcb48 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xcb9c) { + if (code < 0xcb65) { + if (code < 0xcb64) { + // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH + if (0xcb49 <= code && code <= 0xcb63) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JJWEO + if (0xcb64 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xcb80) { + // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH + if (0xcb65 <= code && code <= 0xcb7f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcb81) { + // Lo HANGUL SYLLABLE JJWE + if (0xcb80 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH + if (0xcb81 <= code && code <= 0xcb9b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xcbb9) { + if (code < 0xcb9d) { + // Lo HANGUL SYLLABLE JJWI + if (0xcb9c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcbb8) { + // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH + if (0xcb9d <= code && code <= 0xcbb7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE JJYU + if (0xcbb8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xcbd4) { + // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH + if (0xcbb9 <= code && code <= 0xcbd3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcbd5) { + // Lo HANGUL SYLLABLE JJEU + if (0xcbd4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH + if (0xcbd5 <= code && code <= 0xcbef) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0xcc7d) { + if (code < 0xcc29) { + if (code < 0xcc0c) { + if (code < 0xcbf1) { + // Lo HANGUL SYLLABLE JJYI + if (0xcbf0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH + if (0xcbf1 <= code && code <= 0xcc0b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xcc0d) { + // Lo HANGUL SYLLABLE JJI + if (0xcc0c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcc28) { + // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH + if (0xcc0d <= code && code <= 0xcc27) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE CA + if (0xcc28 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xcc60) { + if (code < 0xcc44) { + // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH + if (0xcc29 <= code && code <= 0xcc43) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcc45) { + // Lo HANGUL SYLLABLE CAE + if (0xcc44 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH + if (0xcc45 <= code && code <= 0xcc5f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xcc61) { + // Lo HANGUL SYLLABLE CYA + if (0xcc60 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcc7c) { + // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH + if (0xcc61 <= code && code <= 0xcc7b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE CYAE + if (0xcc7c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xccd0) { + if (code < 0xcc99) { + if (code < 0xcc98) { + // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH + if (0xcc7d <= code && code <= 0xcc97) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE CEO + if (0xcc98 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xccb4) { + // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH + if (0xcc99 <= code && code <= 0xccb3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xccb5) { + // Lo HANGUL SYLLABLE CE + if (0xccb4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH + if (0xccb5 <= code && code <= 0xcccf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xcced) { + if (code < 0xccd1) { + // Lo HANGUL SYLLABLE CYEO + if (0xccd0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xccec) { + // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH + if (0xccd1 <= code && code <= 0xcceb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE CYE + if (0xccec === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xcd08) { + // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH + if (0xcced <= code && code <= 0xcd07) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcd09) { + // Lo HANGUL SYLLABLE CO + if (0xcd08 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH + if (0xcd09 <= code && code <= 0xcd23) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + } + else { + if (code < 0xcf71) { + if (code < 0xce3d) { + if (code < 0xcdb0) { + if (code < 0xcd5d) { + if (code < 0xcd40) { + if (code < 0xcd25) { + // Lo HANGUL SYLLABLE CWA + if (0xcd24 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH + if (0xcd25 <= code && code <= 0xcd3f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xcd41) { + // Lo HANGUL SYLLABLE CWAE + if (0xcd40 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcd5c) { + // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH + if (0xcd41 <= code && code <= 0xcd5b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE COE + if (0xcd5c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xcd79) { + if (code < 0xcd78) { + // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH + if (0xcd5d <= code && code <= 0xcd77) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE CYO + if (0xcd78 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xcd94) { + // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH + if (0xcd79 <= code && code <= 0xcd93) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcd95) { + // Lo HANGUL SYLLABLE CU + if (0xcd94 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH + if (0xcd95 <= code && code <= 0xcdaf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xcde9) { + if (code < 0xcdcc) { + if (code < 0xcdb1) { + // Lo HANGUL SYLLABLE CWEO + if (0xcdb0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH + if (0xcdb1 <= code && code <= 0xcdcb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xcdcd) { + // Lo HANGUL SYLLABLE CWE + if (0xcdcc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcde8) { + // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH + if (0xcdcd <= code && code <= 0xcde7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE CWI + if (0xcde8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xce20) { + if (code < 0xce04) { + // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH + if (0xcde9 <= code && code <= 0xce03) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xce05) { + // Lo HANGUL SYLLABLE CYU + if (0xce04 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH + if (0xce05 <= code && code <= 0xce1f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xce21) { + // Lo HANGUL SYLLABLE CEU + if (0xce20 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xce3c) { + // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH + if (0xce21 <= code && code <= 0xce3b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE CYI + if (0xce3c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xcee4) { + if (code < 0xce90) { + if (code < 0xce59) { + if (code < 0xce58) { + // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH + if (0xce3d <= code && code <= 0xce57) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE CI + if (0xce58 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xce74) { + // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH + if (0xce59 <= code && code <= 0xce73) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xce75) { + // Lo HANGUL SYLLABLE KA + if (0xce74 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH + if (0xce75 <= code && code <= 0xce8f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xcead) { + if (code < 0xce91) { + // Lo HANGUL SYLLABLE KAE + if (0xce90 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xceac) { + // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH + if (0xce91 <= code && code <= 0xceab) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE KYA + if (0xceac === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xcec8) { + // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH + if (0xcead <= code && code <= 0xcec7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcec9) { + // Lo HANGUL SYLLABLE KYAE + if (0xcec8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH + if (0xcec9 <= code && code <= 0xcee3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xcf1d) { + if (code < 0xcf00) { + if (code < 0xcee5) { + // Lo HANGUL SYLLABLE KEO + if (0xcee4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH + if (0xcee5 <= code && code <= 0xceff) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xcf01) { + // Lo HANGUL SYLLABLE KE + if (0xcf00 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcf1c) { + // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH + if (0xcf01 <= code && code <= 0xcf1b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE KYEO + if (0xcf1c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xcf54) { + if (code < 0xcf38) { + // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH + if (0xcf1d <= code && code <= 0xcf37) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcf39) { + // Lo HANGUL SYLLABLE KYE + if (0xcf38 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH + if (0xcf39 <= code && code <= 0xcf53) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xcf55) { + // Lo HANGUL SYLLABLE KO + if (0xcf54 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcf70) { + // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH + if (0xcf55 <= code && code <= 0xcf6f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE KWA + if (0xcf70 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + else { + if (code < 0xd0a4) { + if (code < 0xcffd) { + if (code < 0xcfc4) { + if (code < 0xcf8d) { + if (code < 0xcf8c) { + // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH + if (0xcf71 <= code && code <= 0xcf8b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE KWAE + if (0xcf8c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xcfa8) { + // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH + if (0xcf8d <= code && code <= 0xcfa7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xcfa9) { + // Lo HANGUL SYLLABLE KOE + if (0xcfa8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH + if (0xcfa9 <= code && code <= 0xcfc3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xcfe0) { + if (code < 0xcfc5) { + // Lo HANGUL SYLLABLE KYO + if (0xcfc4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH + if (0xcfc5 <= code && code <= 0xcfdf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xcfe1) { + // Lo HANGUL SYLLABLE KU + if (0xcfe0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xcffc) { + // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH + if (0xcfe1 <= code && code <= 0xcffb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE KWEO + if (0xcffc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xd050) { + if (code < 0xd019) { + if (code < 0xd018) { + // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH + if (0xcffd <= code && code <= 0xd017) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE KWE + if (0xd018 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd034) { + // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH + if (0xd019 <= code && code <= 0xd033) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd035) { + // Lo HANGUL SYLLABLE KWI + if (0xd034 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH + if (0xd035 <= code && code <= 0xd04f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xd06d) { + if (code < 0xd051) { + // Lo HANGUL SYLLABLE KYU + if (0xd050 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd06c) { + // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH + if (0xd051 <= code && code <= 0xd06b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE KEU + if (0xd06c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xd088) { + // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH + if (0xd06d <= code && code <= 0xd087) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd089) { + // Lo HANGUL SYLLABLE KYI + if (0xd088 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH + if (0xd089 <= code && code <= 0xd0a3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0xd131) { + if (code < 0xd0dd) { + if (code < 0xd0c0) { + if (code < 0xd0a5) { + // Lo HANGUL SYLLABLE KI + if (0xd0a4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH + if (0xd0a5 <= code && code <= 0xd0bf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xd0c1) { + // Lo HANGUL SYLLABLE TA + if (0xd0c0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd0dc) { + // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH + if (0xd0c1 <= code && code <= 0xd0db) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE TAE + if (0xd0dc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xd114) { + if (code < 0xd0f8) { + // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH + if (0xd0dd <= code && code <= 0xd0f7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd0f9) { + // Lo HANGUL SYLLABLE TYA + if (0xd0f8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH + if (0xd0f9 <= code && code <= 0xd113) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xd115) { + // Lo HANGUL SYLLABLE TYAE + if (0xd114 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd130) { + // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH + if (0xd115 <= code && code <= 0xd12f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE TEO + if (0xd130 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xd184) { + if (code < 0xd14d) { + if (code < 0xd14c) { + // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH + if (0xd131 <= code && code <= 0xd14b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE TE + if (0xd14c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd168) { + // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH + if (0xd14d <= code && code <= 0xd167) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd169) { + // Lo HANGUL SYLLABLE TYEO + if (0xd168 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH + if (0xd169 <= code && code <= 0xd183) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xd1a1) { + if (code < 0xd185) { + // Lo HANGUL SYLLABLE TYE + if (0xd184 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd1a0) { + // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH + if (0xd185 <= code && code <= 0xd19f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE TO + if (0xd1a0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xd1bc) { + // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH + if (0xd1a1 <= code && code <= 0xd1bb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd1bd) { + // Lo HANGUL SYLLABLE TWA + if (0xd1bc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH + if (0xd1bd <= code && code <= 0xd1d7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + } + } + } + else { + if (code < 0x1133b) { + if (code < 0xd671) { + if (code < 0xd424) { + if (code < 0xd2f1) { + if (code < 0xd264) { + if (code < 0xd211) { + if (code < 0xd1f4) { + if (code < 0xd1d9) { + // Lo HANGUL SYLLABLE TWAE + if (0xd1d8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH + if (0xd1d9 <= code && code <= 0xd1f3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xd1f5) { + // Lo HANGUL SYLLABLE TOE + if (0xd1f4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd210) { + // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH + if (0xd1f5 <= code && code <= 0xd20f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE TYO + if (0xd210 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xd22d) { + if (code < 0xd22c) { + // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH + if (0xd211 <= code && code <= 0xd22b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE TU + if (0xd22c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd248) { + // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH + if (0xd22d <= code && code <= 0xd247) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd249) { + // Lo HANGUL SYLLABLE TWEO + if (0xd248 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH + if (0xd249 <= code && code <= 0xd263) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xd29d) { + if (code < 0xd280) { + if (code < 0xd265) { + // Lo HANGUL SYLLABLE TWE + if (0xd264 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH + if (0xd265 <= code && code <= 0xd27f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xd281) { + // Lo HANGUL SYLLABLE TWI + if (0xd280 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd29c) { + // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH + if (0xd281 <= code && code <= 0xd29b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE TYU + if (0xd29c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xd2d4) { + if (code < 0xd2b8) { + // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH + if (0xd29d <= code && code <= 0xd2b7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd2b9) { + // Lo HANGUL SYLLABLE TEU + if (0xd2b8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH + if (0xd2b9 <= code && code <= 0xd2d3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xd2d5) { + // Lo HANGUL SYLLABLE TYI + if (0xd2d4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd2f0) { + // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH + if (0xd2d5 <= code && code <= 0xd2ef) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE TI + if (0xd2f0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xd37d) { + if (code < 0xd344) { + if (code < 0xd30d) { + if (code < 0xd30c) { + // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH + if (0xd2f1 <= code && code <= 0xd30b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE PA + if (0xd30c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd328) { + // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH + if (0xd30d <= code && code <= 0xd327) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd329) { + // Lo HANGUL SYLLABLE PAE + if (0xd328 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH + if (0xd329 <= code && code <= 0xd343) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xd360) { + if (code < 0xd345) { + // Lo HANGUL SYLLABLE PYA + if (0xd344 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH + if (0xd345 <= code && code <= 0xd35f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xd361) { + // Lo HANGUL SYLLABLE PYAE + if (0xd360 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd37c) { + // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH + if (0xd361 <= code && code <= 0xd37b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE PEO + if (0xd37c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xd3d0) { + if (code < 0xd399) { + if (code < 0xd398) { + // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH + if (0xd37d <= code && code <= 0xd397) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE PE + if (0xd398 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd3b4) { + // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH + if (0xd399 <= code && code <= 0xd3b3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd3b5) { + // Lo HANGUL SYLLABLE PYEO + if (0xd3b4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH + if (0xd3b5 <= code && code <= 0xd3cf) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xd3ed) { + if (code < 0xd3d1) { + // Lo HANGUL SYLLABLE PYE + if (0xd3d0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd3ec) { + // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH + if (0xd3d1 <= code && code <= 0xd3eb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE PO + if (0xd3ec === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xd408) { + // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH + if (0xd3ed <= code && code <= 0xd407) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd409) { + // Lo HANGUL SYLLABLE PWA + if (0xd408 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH + if (0xd409 <= code && code <= 0xd423) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + } + else { + if (code < 0xd53d) { + if (code < 0xd4b0) { + if (code < 0xd45d) { + if (code < 0xd440) { + if (code < 0xd425) { + // Lo HANGUL SYLLABLE PWAE + if (0xd424 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH + if (0xd425 <= code && code <= 0xd43f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xd441) { + // Lo HANGUL SYLLABLE POE + if (0xd440 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd45c) { + // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH + if (0xd441 <= code && code <= 0xd45b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE PYO + if (0xd45c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xd479) { + if (code < 0xd478) { + // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH + if (0xd45d <= code && code <= 0xd477) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE PU + if (0xd478 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd494) { + // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH + if (0xd479 <= code && code <= 0xd493) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd495) { + // Lo HANGUL SYLLABLE PWEO + if (0xd494 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH + if (0xd495 <= code && code <= 0xd4af) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xd4e9) { + if (code < 0xd4cc) { + if (code < 0xd4b1) { + // Lo HANGUL SYLLABLE PWE + if (0xd4b0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH + if (0xd4b1 <= code && code <= 0xd4cb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xd4cd) { + // Lo HANGUL SYLLABLE PWI + if (0xd4cc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd4e8) { + // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH + if (0xd4cd <= code && code <= 0xd4e7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE PYU + if (0xd4e8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xd520) { + if (code < 0xd504) { + // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH + if (0xd4e9 <= code && code <= 0xd503) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd505) { + // Lo HANGUL SYLLABLE PEU + if (0xd504 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH + if (0xd505 <= code && code <= 0xd51f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xd521) { + // Lo HANGUL SYLLABLE PYI + if (0xd520 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd53c) { + // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH + if (0xd521 <= code && code <= 0xd53b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE PI + if (0xd53c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + else { + if (code < 0xd5e4) { + if (code < 0xd590) { + if (code < 0xd559) { + if (code < 0xd558) { + // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH + if (0xd53d <= code && code <= 0xd557) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE HA + if (0xd558 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd574) { + // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH + if (0xd559 <= code && code <= 0xd573) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd575) { + // Lo HANGUL SYLLABLE HAE + if (0xd574 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH + if (0xd575 <= code && code <= 0xd58f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xd5ad) { + if (code < 0xd591) { + // Lo HANGUL SYLLABLE HYA + if (0xd590 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd5ac) { + // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH + if (0xd591 <= code && code <= 0xd5ab) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE HYAE + if (0xd5ac === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xd5c8) { + // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH + if (0xd5ad <= code && code <= 0xd5c7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd5c9) { + // Lo HANGUL SYLLABLE HEO + if (0xd5c8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH + if (0xd5c9 <= code && code <= 0xd5e3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + else { + if (code < 0xd61d) { + if (code < 0xd600) { + if (code < 0xd5e5) { + // Lo HANGUL SYLLABLE HE + if (0xd5e4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH + if (0xd5e5 <= code && code <= 0xd5ff) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xd601) { + // Lo HANGUL SYLLABLE HYEO + if (0xd600 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd61c) { + // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH + if (0xd601 <= code && code <= 0xd61b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE HYE + if (0xd61c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + else { + if (code < 0xd654) { + if (code < 0xd638) { + // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH + if (0xd61d <= code && code <= 0xd637) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd639) { + // Lo HANGUL SYLLABLE HO + if (0xd638 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH + if (0xd639 <= code && code <= 0xd653) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + else { + if (code < 0xd655) { + // Lo HANGUL SYLLABLE HWA + if (0xd654 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd670) { + // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH + if (0xd655 <= code && code <= 0xd66f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE HWAE + if (0xd670 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + } + } + } + else { + if (code < 0x11000) { + if (code < 0xd7b0) { + if (code < 0xd6fd) { + if (code < 0xd6c4) { + if (code < 0xd68d) { + if (code < 0xd68c) { + // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH + if (0xd671 <= code && code <= 0xd68b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE HOE + if (0xd68c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd6a8) { + // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH + if (0xd68d <= code && code <= 0xd6a7) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd6a9) { + // Lo HANGUL SYLLABLE HYO + if (0xd6a8 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH + if (0xd6a9 <= code && code <= 0xd6c3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xd6e0) { + if (code < 0xd6c5) { + // Lo HANGUL SYLLABLE HU + if (0xd6c4 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH + if (0xd6c5 <= code && code <= 0xd6df) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + else { + if (code < 0xd6e1) { + // Lo HANGUL SYLLABLE HWEO + if (0xd6e0 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd6fc) { + // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH + if (0xd6e1 <= code && code <= 0xd6fb) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE HWE + if (0xd6fc === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + } + } + else { + if (code < 0xd750) { + if (code < 0xd719) { + if (code < 0xd718) { + // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH + if (0xd6fd <= code && code <= 0xd717) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE HWI + if (0xd718 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + else { + if (code < 0xd734) { + // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH + if (0xd719 <= code && code <= 0xd733) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd735) { + // Lo HANGUL SYLLABLE HYU + if (0xd734 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH + if (0xd735 <= code && code <= 0xd74f) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + else { + if (code < 0xd76d) { + if (code < 0xd751) { + // Lo HANGUL SYLLABLE HEU + if (0xd750 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + if (code < 0xd76c) { + // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH + if (0xd751 <= code && code <= 0xd76b) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + // Lo HANGUL SYLLABLE HYI + if (0xd76c === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + } + } + else { + if (code < 0xd788) { + // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH + if (0xd76d <= code && code <= 0xd787) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + else { + if (code < 0xd789) { + // Lo HANGUL SYLLABLE HI + if (0xd788 === code) { + return boundaries_1.CLUSTER_BREAK.LV; + } + } + else { + // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH + if (0xd789 <= code && code <= 0xd7a3) { + return boundaries_1.CLUSTER_BREAK.LVT; + } + } + } + } + } + } + } + else { + if (code < 0x10a01) { + if (code < 0xfeff) { + if (code < 0xfb1e) { + if (code < 0xd7cb) { + // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E + if (0xd7b0 <= code && code <= 0xd7c6) { + return boundaries_1.CLUSTER_BREAK.V; + } + } + else { + // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH + if (0xd7cb <= code && code <= 0xd7fb) { + return boundaries_1.CLUSTER_BREAK.T; + } + } + } + else { + if (code < 0xfe00) { + // Mn HEBREW POINT JUDEO-SPANISH VARIKA + if (0xfb1e === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xfe20) { + // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 + if (0xfe00 <= code && code <= 0xfe0f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF + if (0xfe20 <= code && code <= 0xfe2f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x101fd) { + if (code < 0xff9e) { + // Cf ZERO WIDTH NO-BREAK SPACE + if (0xfeff === code) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + if (code < 0xfff0) { + // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK + if (0xff9e <= code && code <= 0xff9f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cn [9] .. + // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR + if (0xfff0 <= code && code <= 0xfffb) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + } + } + else { + if (code < 0x102e0) { + // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE + if (0x101fd === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x10376) { + // Mn COPTIC EPACT THOUSANDS MARK + if (0x102e0 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII + if (0x10376 <= code && code <= 0x1037a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x10ae5) { + if (code < 0x10a0c) { + if (code < 0x10a05) { + // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R + if (0x10a01 <= code && code <= 0x10a03) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O + if (0x10a05 <= code && code <= 0x10a06) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x10a38) { + // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA + if (0x10a0c <= code && code <= 0x10a0f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x10a3f) { + // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW + if (0x10a38 <= code && code <= 0x10a3a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn KHAROSHTHI VIRAMA + if (0x10a3f === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x10efd) { + if (code < 0x10d24) { + // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW + if (0x10ae5 <= code && code <= 0x10ae6) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x10eab) { + // Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI + if (0x10d24 <= code && code <= 0x10d27) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK + if (0x10eab <= code && code <= 0x10eac) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x10f46) { + // Mn [3] ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA + if (0x10efd <= code && code <= 0x10eff) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x10f82) { + // Mn [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW + if (0x10f46 <= code && code <= 0x10f50) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [4] OLD UYGHUR COMBINING DOT ABOVE..OLD UYGHUR COMBINING TWO DOTS BELOW + if (0x10f82 <= code && code <= 0x10f85) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + } + else { + if (code < 0x11180) { + if (code < 0x110b7) { + if (code < 0x11073) { + if (code < 0x11002) { + // Mc BRAHMI SIGN CANDRABINDU + if (0x11000 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn BRAHMI SIGN ANUSVARA + if (0x11001 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11038) { + // Mc BRAHMI SIGN VISARGA + if (0x11002 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x11070) { + // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA + if (0x11038 <= code && code <= 0x11046) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn BRAHMI SIGN OLD TAMIL VIRAMA + if (0x11070 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x11082) { + if (code < 0x1107f) { + // Mn [2] BRAHMI VOWEL SIGN OLD TAMIL SHORT E..BRAHMI VOWEL SIGN OLD TAMIL SHORT O + if (0x11073 <= code && code <= 0x11074) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA + if (0x1107f <= code && code <= 0x11081) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x110b0) { + // Mc KAITHI SIGN VISARGA + if (0x11082 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x110b3) { + // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II + if (0x110b0 <= code && code <= 0x110b2) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI + if (0x110b3 <= code && code <= 0x110b6) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x11100) { + if (code < 0x110bd) { + if (code < 0x110b9) { + // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU + if (0x110b7 <= code && code <= 0x110b8) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA + if (0x110b9 <= code && code <= 0x110ba) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x110c2) { + // Cf KAITHI NUMBER SIGN + if (0x110bd === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + else { + // Mn KAITHI VOWEL SIGN VOCALIC R + if (0x110c2 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Cf KAITHI NUMBER SIGN ABOVE + if (0x110cd === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + } + } + else { + if (code < 0x1112d) { + if (code < 0x11127) { + // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA + if (0x11100 <= code && code <= 0x11102) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1112c) { + // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU + if (0x11127 <= code && code <= 0x1112b) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc CHAKMA VOWEL SIGN E + if (0x1112c === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x11145) { + // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA + if (0x1112d <= code && code <= 0x11134) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11173) { + // Mc [2] CHAKMA VOWEL SIGN AA..CHAKMA VOWEL SIGN EI + if (0x11145 <= code && code <= 0x11146) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn MAHAJANI SIGN NUKTA + if (0x11173 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + else { + if (code < 0x11232) { + if (code < 0x111c2) { + if (code < 0x111b3) { + if (code < 0x11182) { + // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA + if (0x11180 <= code && code <= 0x11181) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc SHARADA SIGN VISARGA + if (0x11182 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x111b6) { + // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II + if (0x111b3 <= code && code <= 0x111b5) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x111bf) { + // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O + if (0x111b6 <= code && code <= 0x111be) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA + if (0x111bf <= code && code <= 0x111c0) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x111cf) { + if (code < 0x111c9) { + // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA + if (0x111c2 <= code && code <= 0x111c3) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + else { + if (code < 0x111ce) { + // Mn [4] SHARADA SANDHI MARK..SHARADA EXTRA SHORT VOWEL MARK + if (0x111c9 <= code && code <= 0x111cc) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc SHARADA VOWEL SIGN PRISHTHAMATRA E + if (0x111ce === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x1122c) { + // Mn SHARADA SIGN INVERTED CANDRABINDU + if (0x111cf === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1122f) { + // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II + if (0x1122c <= code && code <= 0x1122e) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI + if (0x1122f <= code && code <= 0x11231) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x11241) { + if (code < 0x11235) { + if (code < 0x11234) { + // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU + if (0x11232 <= code && code <= 0x11233) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn KHOJKI SIGN ANUSVARA + if (0x11234 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x11236) { + // Mc KHOJKI SIGN VIRAMA + if (0x11235 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x1123e) { + // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA + if (0x11236 <= code && code <= 0x11237) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn KHOJKI SIGN SUKUN + if (0x1123e === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x112e3) { + if (code < 0x112df) { + // Mn KHOJKI VOWEL SIGN VOCALIC R + if (0x11241 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x112e0) { + // Mn KHUDAWADI SIGN ANUSVARA + if (0x112df === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II + if (0x112e0 <= code && code <= 0x112e2) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x11300) { + // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA + if (0x112e3 <= code && code <= 0x112ea) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11302) { + // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU + if (0x11300 <= code && code <= 0x11301) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA + if (0x11302 <= code && code <= 0x11303) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + } + } + } + } + else { + if (code < 0x11a97) { + if (code < 0x116ab) { + if (code < 0x114b9) { + if (code < 0x11370) { + if (code < 0x11347) { + if (code < 0x1133f) { + if (code < 0x1133e) { + // Mn [2] COMBINING BINDU BELOW..GRANTHA SIGN NUKTA + if (0x1133b <= code && code <= 0x1133c) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc GRANTHA VOWEL SIGN AA + if (0x1133e === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x11340) { + // Mc GRANTHA VOWEL SIGN I + if (0x1133f === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x11341) { + // Mn GRANTHA VOWEL SIGN II + if (0x11340 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR + if (0x11341 <= code && code <= 0x11344) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x11357) { + if (code < 0x1134b) { + // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI + if (0x11347 <= code && code <= 0x11348) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA + if (0x1134b <= code && code <= 0x1134d) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x11362) { + // Mc GRANTHA AU LENGTH MARK + if (0x11357 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11366) { + // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL + if (0x11362 <= code && code <= 0x11363) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX + if (0x11366 <= code && code <= 0x1136c) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x11445) { + if (code < 0x11438) { + if (code < 0x11435) { + // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA + if (0x11370 <= code && code <= 0x11374) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II + if (0x11435 <= code && code <= 0x11437) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x11440) { + // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI + if (0x11438 <= code && code <= 0x1143f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11442) { + // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU + if (0x11440 <= code && code <= 0x11441) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA + if (0x11442 <= code && code <= 0x11444) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x114b0) { + if (code < 0x11446) { + // Mc NEWA SIGN VISARGA + if (0x11445 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn NEWA SIGN NUKTA + if (0x11446 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mn NEWA SANDHI MARK + if (0x1145e === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x114b1) { + // Mc TIRHUTA VOWEL SIGN AA + if (0x114b0 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x114b3) { + // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II + if (0x114b1 <= code && code <= 0x114b2) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL + if (0x114b3 <= code && code <= 0x114b8) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + else { + if (code < 0x115b8) { + if (code < 0x114bf) { + if (code < 0x114bb) { + // Mc TIRHUTA VOWEL SIGN E + if (0x114b9 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn TIRHUTA VOWEL SIGN SHORT E + if (0x114ba === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x114bd) { + // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O + if (0x114bb <= code && code <= 0x114bc) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mc TIRHUTA VOWEL SIGN SHORT O + if (0x114bd === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc TIRHUTA VOWEL SIGN AU + if (0x114be === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x115af) { + if (code < 0x114c1) { + // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA + if (0x114bf <= code && code <= 0x114c0) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x114c2) { + // Mc TIRHUTA SIGN VISARGA + if (0x114c1 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA + if (0x114c2 <= code && code <= 0x114c3) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x115b0) { + // Mc SIDDHAM VOWEL SIGN AA + if (0x115af === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x115b2) { + // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II + if (0x115b0 <= code && code <= 0x115b1) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR + if (0x115b2 <= code && code <= 0x115b5) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x11630) { + if (code < 0x115be) { + if (code < 0x115bc) { + // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU + if (0x115b8 <= code && code <= 0x115bb) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA + if (0x115bc <= code && code <= 0x115bd) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x115bf) { + // Mc SIDDHAM SIGN VISARGA + if (0x115be === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x115dc) { + // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA + if (0x115bf <= code && code <= 0x115c0) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU + if (0x115dc <= code && code <= 0x115dd) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x1163d) { + if (code < 0x11633) { + // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II + if (0x11630 <= code && code <= 0x11632) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x1163b) { + // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI + if (0x11633 <= code && code <= 0x1163a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU + if (0x1163b <= code && code <= 0x1163c) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x1163e) { + // Mn MODI SIGN ANUSVARA + if (0x1163d === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1163f) { + // Mc MODI SIGN VISARGA + if (0x1163e === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA + if (0x1163f <= code && code <= 0x11640) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + } + else { + if (code < 0x1193f) { + if (code < 0x11727) { + if (code < 0x116b6) { + if (code < 0x116ad) { + // Mn TAKRI SIGN ANUSVARA + if (0x116ab === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc TAKRI SIGN VISARGA + if (0x116ac === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x116ae) { + // Mn TAKRI VOWEL SIGN AA + if (0x116ad === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x116b0) { + // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II + if (0x116ae <= code && code <= 0x116af) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU + if (0x116b0 <= code && code <= 0x116b5) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x1171d) { + // Mc TAKRI SIGN VIRAMA + if (0x116b6 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn TAKRI SIGN NUKTA + if (0x116b7 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11722) { + // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA + if (0x1171d <= code && code <= 0x1171f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11726) { + // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU + if (0x11722 <= code && code <= 0x11725) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc AHOM VOWEL SIGN E + if (0x11726 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + else { + if (code < 0x11930) { + if (code < 0x1182f) { + if (code < 0x1182c) { + // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER + if (0x11727 <= code && code <= 0x1172b) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [3] DOGRA VOWEL SIGN AA..DOGRA VOWEL SIGN II + if (0x1182c <= code && code <= 0x1182e) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x11838) { + // Mn [9] DOGRA VOWEL SIGN U..DOGRA SIGN ANUSVARA + if (0x1182f <= code && code <= 0x11837) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11839) { + // Mc DOGRA SIGN VISARGA + if (0x11838 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] DOGRA SIGN VIRAMA..DOGRA SIGN NUKTA + if (0x11839 <= code && code <= 0x1183a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x1193b) { + if (code < 0x11931) { + // Mc DIVES AKURU VOWEL SIGN AA + if (0x11930 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11937) { + // Mc [5] DIVES AKURU VOWEL SIGN I..DIVES AKURU VOWEL SIGN E + if (0x11931 <= code && code <= 0x11935) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mc [2] DIVES AKURU VOWEL SIGN AI..DIVES AKURU VOWEL SIGN O + if (0x11937 <= code && code <= 0x11938) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x1193d) { + // Mn [2] DIVES AKURU SIGN ANUSVARA..DIVES AKURU SIGN CANDRABINDU + if (0x1193b <= code && code <= 0x1193c) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc DIVES AKURU SIGN HALANTA + if (0x1193d === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn DIVES AKURU VIRAMA + if (0x1193e === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x11a01) { + if (code < 0x119d1) { + if (code < 0x11941) { + // Lo DIVES AKURU PREFIXED NASAL SIGN + if (0x1193f === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + // Mc DIVES AKURU MEDIAL YA + if (0x11940 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x11942) { + // Lo DIVES AKURU INITIAL RA + if (0x11941 === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + else { + // Mc DIVES AKURU MEDIAL RA + if (0x11942 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn DIVES AKURU SIGN NUKTA + if (0x11943 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x119dc) { + if (code < 0x119d4) { + // Mc [3] NANDINAGARI VOWEL SIGN AA..NANDINAGARI VOWEL SIGN II + if (0x119d1 <= code && code <= 0x119d3) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x119da) { + // Mn [4] NANDINAGARI VOWEL SIGN U..NANDINAGARI VOWEL SIGN VOCALIC RR + if (0x119d4 <= code && code <= 0x119d7) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [2] NANDINAGARI VOWEL SIGN E..NANDINAGARI VOWEL SIGN AI + if (0x119da <= code && code <= 0x119db) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x119e0) { + // Mc [4] NANDINAGARI VOWEL SIGN O..NANDINAGARI SIGN VISARGA + if (0x119dc <= code && code <= 0x119df) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn NANDINAGARI SIGN VIRAMA + if (0x119e0 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc NANDINAGARI VOWEL SIGN PRISHTHAMATRA E + if (0x119e4 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x11a47) { + if (code < 0x11a39) { + if (code < 0x11a33) { + // Mn [10] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL LENGTH MARK + if (0x11a01 <= code && code <= 0x11a0a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA + if (0x11a33 <= code && code <= 0x11a38) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x11a3a) { + // Mc ZANABAZAR SQUARE SIGN VISARGA + if (0x11a39 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x11a3b) { + // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA + if (0x11a3a === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + else { + // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA + if (0x11a3b <= code && code <= 0x11a3e) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x11a59) { + if (code < 0x11a51) { + // Mn ZANABAZAR SQUARE SUBJOINER + if (0x11a47 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11a57) { + // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE + if (0x11a51 <= code && code <= 0x11a56) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU + if (0x11a57 <= code && code <= 0x11a58) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + else { + if (code < 0x11a84) { + // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK + if (0x11a59 <= code && code <= 0x11a5b) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11a8a) { + // Lo [6] SOYOMBO SIGN JIHVAMULIYA..SOYOMBO CLUSTER-INITIAL LETTER SA + if (0x11a84 <= code && code <= 0x11a89) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + else { + // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA + if (0x11a8a <= code && code <= 0x11a96) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + } + } + else { + if (code < 0x16f51) { + if (code < 0x11d90) { + if (code < 0x11cb1) { + if (code < 0x11c3e) { + if (code < 0x11c2f) { + if (code < 0x11a98) { + // Mc SOYOMBO SIGN VISARGA + if (0x11a97 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER + if (0x11a98 <= code && code <= 0x11a99) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x11c30) { + // Mc BHAIKSUKI VOWEL SIGN AA + if (0x11c2f === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x11c38) { + // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L + if (0x11c30 <= code && code <= 0x11c36) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA + if (0x11c38 <= code && code <= 0x11c3d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x11c92) { + // Mc BHAIKSUKI SIGN VISARGA + if (0x11c3e === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn BHAIKSUKI SIGN VIRAMA + if (0x11c3f === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11ca9) { + // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA + if (0x11c92 <= code && code <= 0x11ca7) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11caa) { + // Mc MARCHEN SUBJOINED LETTER YA + if (0x11ca9 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA + if (0x11caa <= code && code <= 0x11cb0) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x11d3a) { + if (code < 0x11cb4) { + if (code < 0x11cb2) { + // Mc MARCHEN VOWEL SIGN I + if (0x11cb1 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E + if (0x11cb2 <= code && code <= 0x11cb3) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x11cb5) { + // Mc MARCHEN VOWEL SIGN O + if (0x11cb4 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + if (code < 0x11d31) { + // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU + if (0x11cb5 <= code && code <= 0x11cb6) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R + if (0x11d31 <= code && code <= 0x11d36) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x11d46) { + if (code < 0x11d3c) { + // Mn MASARAM GONDI VOWEL SIGN E + if (0x11d3a === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11d3f) { + // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O + if (0x11d3c <= code && code <= 0x11d3d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA + if (0x11d3f <= code && code <= 0x11d45) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x11d47) { + // Lo MASARAM GONDI REPHA + if (0x11d46 === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + else { + if (code < 0x11d8a) { + // Mn MASARAM GONDI RA-KARA + if (0x11d47 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [5] GUNJALA GONDI VOWEL SIGN AA..GUNJALA GONDI VOWEL SIGN UU + if (0x11d8a <= code && code <= 0x11d8e) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + } + else { + if (code < 0x11f36) { + if (code < 0x11ef3) { + if (code < 0x11d95) { + if (code < 0x11d93) { + // Mn [2] GUNJALA GONDI VOWEL SIGN EE..GUNJALA GONDI VOWEL SIGN AI + if (0x11d90 <= code && code <= 0x11d91) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] GUNJALA GONDI VOWEL SIGN OO..GUNJALA GONDI VOWEL SIGN AU + if (0x11d93 <= code && code <= 0x11d94) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x11d96) { + // Mn GUNJALA GONDI SIGN ANUSVARA + if (0x11d95 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc GUNJALA GONDI SIGN VISARGA + if (0x11d96 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn GUNJALA GONDI VIRAMA + if (0x11d97 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x11f02) { + if (code < 0x11ef5) { + // Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U + if (0x11ef3 <= code && code <= 0x11ef4) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x11f00) { + // Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O + if (0x11ef5 <= code && code <= 0x11ef6) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA + if (0x11f00 <= code && code <= 0x11f01) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x11f03) { + // Lo KAWI SIGN REPHA + if (0x11f02 === code) { + return boundaries_1.CLUSTER_BREAK.PREPEND; + } + } + else { + if (code < 0x11f34) { + // Mc KAWI SIGN VISARGA + if (0x11f03 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mc [2] KAWI VOWEL SIGN AA..KAWI VOWEL SIGN ALTERNATE AA + if (0x11f34 <= code && code <= 0x11f35) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + } + else { + if (code < 0x13430) { + if (code < 0x11f40) { + if (code < 0x11f3e) { + // Mn [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R + if (0x11f36 <= code && code <= 0x11f3a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc [2] KAWI VOWEL SIGN E..KAWI VOWEL SIGN AI + if (0x11f3e <= code && code <= 0x11f3f) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x11f41) { + // Mn KAWI VOWEL SIGN EU + if (0x11f40 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc KAWI SIGN KILLER + if (0x11f41 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + // Mn KAWI CONJOINER + if (0x11f42 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x16af0) { + if (code < 0x13440) { + // Cf [16] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE + if (0x13430 <= code && code <= 0x1343f) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + if (code < 0x13447) { + // Mn EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY + if (0x13440 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [15] EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED + if (0x13447 <= code && code <= 0x13455) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x16b30) { + // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE + if (0x16af0 <= code && code <= 0x16af4) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x16f4f) { + // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM + if (0x16b30 <= code && code <= 0x16b36) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn MIAO SIGN CONSONANT MODIFIER BAR + if (0x16f4f === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + } + else { + if (code < 0x1da84) { + if (code < 0x1d167) { + if (code < 0x1bca0) { + if (code < 0x16fe4) { + if (code < 0x16f8f) { + // Mc [55] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN UI + if (0x16f51 <= code && code <= 0x16f87) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW + if (0x16f8f <= code && code <= 0x16f92) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x16ff0) { + // Mn KHITAN SMALL SCRIPT FILLER + if (0x16fe4 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1bc9d) { + // Mc [2] VIETNAMESE ALTERNATE READING MARK CA..VIETNAMESE ALTERNATE READING MARK NHAY + if (0x16ff0 <= code && code <= 0x16ff1) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + else { + // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK + if (0x1bc9d <= code && code <= 0x1bc9e) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x1cf30) { + if (code < 0x1cf00) { + // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP + if (0x1bca0 <= code && code <= 0x1bca3) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + // Mn [46] ZNAMENNY COMBINING MARK GORAZDO NIZKO S KRYZHEM ON LEFT..ZNAMENNY COMBINING MARK KRYZH ON LEFT + if (0x1cf00 <= code && code <= 0x1cf2d) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x1d165) { + // Mn [23] ZNAMENNY COMBINING TONAL RANGE MARK MRACHNO..ZNAMENNY PRIZNAK MODIFIER ROG + if (0x1cf30 <= code && code <= 0x1cf46) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc MUSICAL SYMBOL COMBINING STEM + if (0x1d165 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM + if (0x1d166 === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + } + } + else { + if (code < 0x1d185) { + if (code < 0x1d16e) { + if (code < 0x1d16d) { + // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 + if (0x1d167 <= code && code <= 0x1d169) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT + if (0x1d16d === code) { + return boundaries_1.CLUSTER_BREAK.SPACINGMARK; + } + } + } + else { + if (code < 0x1d173) { + // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 + if (0x1d16e <= code && code <= 0x1d172) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1d17b) { + // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE + if (0x1d173 <= code && code <= 0x1d17a) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE + if (0x1d17b <= code && code <= 0x1d182) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x1da00) { + if (code < 0x1d1aa) { + // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE + if (0x1d185 <= code && code <= 0x1d18b) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1d242) { + // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO + if (0x1d1aa <= code && code <= 0x1d1ad) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME + if (0x1d242 <= code && code <= 0x1d244) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x1da3b) { + // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN + if (0x1da00 <= code && code <= 0x1da36) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1da75) { + // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT + if (0x1da3b <= code && code <= 0x1da6c) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS + if (0x1da75 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + } + else { + if (code < 0x1e2ec) { + if (code < 0x1e01b) { + if (code < 0x1daa1) { + if (code < 0x1da9b) { + // Mn SIGNWRITING LOCATION HEAD NECK + if (0x1da84 === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 + if (0x1da9b <= code && code <= 0x1da9f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x1e000) { + // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 + if (0x1daa1 <= code && code <= 0x1daaf) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1e008) { + // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE + if (0x1e000 <= code && code <= 0x1e006) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU + if (0x1e008 <= code && code <= 0x1e018) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + else { + if (code < 0x1e08f) { + if (code < 0x1e023) { + // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI + if (0x1e01b <= code && code <= 0x1e021) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1e026) { + // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS + if (0x1e023 <= code && code <= 0x1e024) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + if (0x1e026 <= code && code <= 0x1e02a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0x1e130) { + // Mn COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I + if (0x1e08f === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1e2ae) { + // Mn [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D + if (0x1e130 <= code && code <= 0x1e136) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn TOTO SIGN RISING TONE + if (0x1e2ae === code) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + } + } + else { + if (code < 0x1f3fb) { + if (code < 0x1e8d0) { + if (code < 0x1e4ec) { + // Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI + if (0x1e2ec <= code && code <= 0x1e2ef) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Mn [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH + if (0x1e4ec <= code && code <= 0x1e4ef) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + else { + if (code < 0x1e944) { + // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS + if (0x1e8d0 <= code && code <= 0x1e8d6) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0x1f1e6) { + // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA + if (0x1e944 <= code && code <= 0x1e94a) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z + if (0x1f1e6 <= code && code <= 0x1f1ff) { + return boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR; + } + } + } + } + } + else { + if (code < 0xe0080) { + if (code < 0xe0000) { + // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 + if (0x1f3fb <= code && code <= 0x1f3ff) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + if (code < 0xe0020) { + // Cn + // Cf LANGUAGE TAG + // Cn [30] .. + if (0xe0000 <= code && code <= 0xe001f) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + // Cf [96] TAG SPACE..CANCEL TAG + if (0xe0020 <= code && code <= 0xe007f) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + } + } + else { + if (code < 0xe0100) { + // Cn [128] .. + if (0xe0080 <= code && code <= 0xe00ff) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + else { + if (code < 0xe01f0) { + // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + if (0xe0100 <= code && code <= 0xe01ef) { + return boundaries_1.CLUSTER_BREAK.EXTEND; + } + } + else { + // Cn [3600] .. + if (0xe01f0 <= code && code <= 0xe0fff) { + return boundaries_1.CLUSTER_BREAK.CONTROL; + } + } + } + } + } + } + } + } + } + } + } + } + // unlisted code points are treated as a break property of "Other" + return boundaries_1.CLUSTER_BREAK.OTHER; + } + /** + * Given a Unicode code point, returns if symbol is an extended pictographic or some other break + * @param code {number} Unicode code point + * @returns {number} + */ + static getEmojiProperty(code) { + // emoji property taken from: + // https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt + // and generated by + // node ./scripts/generate-emoji-extended-pictographic.js + if (code < 0x27b0) { + if (code < 0x2600) { + if (code < 0x2328) { + if (code < 0x2122) { + if (code < 0x203c) { + // E0.6 [1] (©️) copyright + if (0xa9 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.6 [1] (®️) registered + if (0xae === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [1] (‼️) double exclamation mark + if (0x203c === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.6 [1] (⁉️) exclamation question mark + if (0x2049 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x2194) { + // E0.6 [1] (™️) trade mark + if (0x2122 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.6 [1] (ℹ️) information + if (0x2139 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x21a9) { + // E0.6 [6] (↔️..↙️) left-right arrow..down-left arrow + if (0x2194 <= code && code <= 0x2199) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x231a) { + // E0.6 [2] (↩️..↪️) right arrow curving left..left arrow curving right + if (0x21a9 <= code && code <= 0x21aa) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [2] (⌚..⌛) watch..hourglass done + if (0x231a <= code && code <= 0x231b) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + } + else { + if (code < 0x24c2) { + if (code < 0x23cf) { + // E1.0 [1] (⌨️) keyboard + if (0x2328 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.0 [1] (⎈) HELM SYMBOL + if (0x2388 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x23e9) { + // E1.0 [1] (⏏️) eject button + if (0x23cf === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x23f8) { + // E0.6 [4] (⏩..⏬) fast-forward button..fast down button + // E0.7 [2] (⏭️..⏮️) next track button..last track button + // E1.0 [1] (⏯️) play or pause button + // E0.6 [1] (⏰) alarm clock + // E1.0 [2] (⏱️..⏲️) stopwatch..timer clock + // E0.6 [1] (⏳) hourglass not done + if (0x23e9 <= code && code <= 0x23f3) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.7 [3] (⏸️..⏺️) pause button..record button + if (0x23f8 <= code && code <= 0x23fa) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + else { + if (code < 0x25b6) { + if (code < 0x25aa) { + // E0.6 [1] (Ⓜ️) circled M + if (0x24c2 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [2] (▪️..▫️) black small square..white small square + if (0x25aa <= code && code <= 0x25ab) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x25c0) { + // E0.6 [1] (▶️) play button + if (0x25b6 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x25fb) { + // E0.6 [1] (◀️) reverse button + if (0x25c0 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [4] (◻️..◾) white medium square..black medium-small square + if (0x25fb <= code && code <= 0x25fe) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + } + } + else { + if (code < 0x2733) { + if (code < 0x2714) { + if (code < 0x2614) { + if (code < 0x2607) { + // E0.6 [2] (☀️..☁️) sun..cloud + // E0.7 [2] (☂️..☃️) umbrella..snowman + // E1.0 [1] (☄️) comet + // E0.0 [1] (★) BLACK STAR + if (0x2600 <= code && code <= 0x2605) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.0 [7] (☇..☍) LIGHTNING..OPPOSITION + // E0.6 [1] (☎️) telephone + // E0.0 [2] (☏..☐) WHITE TELEPHONE..BALLOT BOX + // E0.6 [1] (☑️) check box with check + // E0.0 [1] (☒) BALLOT BOX WITH X + if (0x2607 <= code && code <= 0x2612) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x2690) { + // E0.6 [2] (☔..☕) umbrella with rain drops..hot beverage + // E0.0 [2] (☖..☗) WHITE SHOGI PIECE..BLACK SHOGI PIECE + // E1.0 [1] (☘️) shamrock + // E0.0 [4] (☙..☜) REVERSED ROTATED FLORAL HEART BULLET..WHITE LEFT POINTING INDEX + // E0.6 [1] (☝️) index pointing up + // E0.0 [2] (☞..☟) WHITE RIGHT POINTING INDEX..WHITE DOWN POINTING INDEX + // E1.0 [1] (☠️) skull and crossbones + // E0.0 [1] (☡) CAUTION SIGN + // E1.0 [2] (☢️..☣️) radioactive..biohazard + // E0.0 [2] (☤..☥) CADUCEUS..ANKH + // E1.0 [1] (☦️) orthodox cross + // E0.0 [3] (☧..☩) CHI RHO..CROSS OF JERUSALEM + // E0.7 [1] (☪️) star and crescent + // E0.0 [3] (☫..☭) FARSI SYMBOL..HAMMER AND SICKLE + // E1.0 [1] (☮️) peace symbol + // E0.7 [1] (☯️) yin yang + // E0.0 [8] (☰..☷) TRIGRAM FOR HEAVEN..TRIGRAM FOR EARTH + // E0.7 [2] (☸️..☹️) wheel of dharma..frowning face + // E0.6 [1] (☺️) smiling face + // E0.0 [5] (☻..☿) BLACK SMILING FACE..MERCURY + // E4.0 [1] (♀️) female sign + // E0.0 [1] (♁) EARTH + // E4.0 [1] (♂️) male sign + // E0.0 [5] (♃..♇) JUPITER..PLUTO + // E0.6 [12] (♈..♓) Aries..Pisces + // E0.0 [11] (♔..♞) WHITE CHESS KING..BLACK CHESS KNIGHT + // E11.0 [1] (♟️) chess pawn + // E0.6 [1] (♠️) spade suit + // E0.0 [2] (♡..♢) WHITE HEART SUIT..WHITE DIAMOND SUIT + // E0.6 [1] (♣️) club suit + // E0.0 [1] (♤) WHITE SPADE SUIT + // E0.6 [2] (♥️..♦️) heart suit..diamond suit + // E0.0 [1] (♧) WHITE CLUB SUIT + // E0.6 [1] (♨️) hot springs + // E0.0 [18] (♩..♺) QUARTER NOTE..RECYCLING SYMBOL FOR GENERIC MATERIALS + // E0.6 [1] (♻️) recycling symbol + // E0.0 [2] (♼..♽) RECYCLED PAPER SYMBOL..PARTIALLY-RECYCLED PAPER SYMBOL + // E11.0 [1] (♾️) infinity + // E0.6 [1] (♿) wheelchair symbol + // E0.0 [6] (⚀..⚅) DIE FACE-1..DIE FACE-6 + if (0x2614 <= code && code <= 0x2685) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x2708) { + // E0.0 [2] (⚐..⚑) WHITE FLAG..BLACK FLAG + // E1.0 [1] (⚒️) hammer and pick + // E0.6 [1] (⚓) anchor + // E1.0 [1] (⚔️) crossed swords + // E4.0 [1] (⚕️) medical symbol + // E1.0 [2] (⚖️..⚗️) balance scale..alembic + // E0.0 [1] (⚘) FLOWER + // E1.0 [1] (⚙️) gear + // E0.0 [1] (⚚) STAFF OF HERMES + // E1.0 [2] (⚛️..⚜️) atom symbol..fleur-de-lis + // E0.0 [3] (⚝..⚟) OUTLINED WHITE STAR..THREE LINES CONVERGING LEFT + // E0.6 [2] (⚠️..⚡) warning..high voltage + // E0.0 [5] (⚢..⚦) DOUBLED FEMALE SIGN..MALE WITH STROKE SIGN + // E13.0 [1] (⚧️) transgender symbol + // E0.0 [2] (⚨..⚩) VERTICAL MALE WITH STROKE SIGN..HORIZONTAL MALE WITH STROKE SIGN + // E0.6 [2] (⚪..⚫) white circle..black circle + // E0.0 [4] (⚬..⚯) MEDIUM SMALL WHITE CIRCLE..UNMARRIED PARTNERSHIP SYMBOL + // E1.0 [2] (⚰️..⚱️) coffin..funeral urn + // E0.0 [11] (⚲..⚼) NEUTER..SESQUIQUADRATE + // E0.6 [2] (⚽..⚾) soccer ball..baseball + // E0.0 [5] (⚿..⛃) SQUARED KEY..BLACK DRAUGHTS KING + // E0.6 [2] (⛄..⛅) snowman without snow..sun behind cloud + // E0.0 [2] (⛆..⛇) RAIN..BLACK SNOWMAN + // E0.7 [1] (⛈️) cloud with lightning and rain + // E0.0 [5] (⛉..⛍) TURNED WHITE SHOGI PIECE..DISABLED CAR + // E0.6 [1] (⛎) Ophiuchus + // E0.7 [1] (⛏️) pick + // E0.0 [1] (⛐) CAR SLIDING + // E0.7 [1] (⛑️) rescue worker’s helmet + // E0.0 [1] (⛒) CIRCLED CROSSING LANES + // E0.7 [1] (⛓️) chains + // E0.6 [1] (⛔) no entry + // E0.0 [20] (⛕..⛨) ALTERNATE ONE-WAY LEFT WAY TRAFFIC..BLACK CROSS ON SHIELD + // E0.7 [1] (⛩️) shinto shrine + // E0.6 [1] (⛪) church + // E0.0 [5] (⛫..⛯) CASTLE..MAP SYMBOL FOR LIGHTHOUSE + // E0.7 [2] (⛰️..⛱️) mountain..umbrella on ground + // E0.6 [2] (⛲..⛳) fountain..flag in hole + // E0.7 [1] (⛴️) ferry + // E0.6 [1] (⛵) sailboat + // E0.0 [1] (⛶) SQUARE FOUR CORNERS + // E0.7 [3] (⛷️..⛹️) skier..person bouncing ball + // E0.6 [1] (⛺) tent + // E0.0 [2] (⛻..⛼) JAPANESE BANK SYMBOL..HEADSTONE GRAVEYARD SYMBOL + // E0.6 [1] (⛽) fuel pump + // E0.0 [4] (⛾..✁) CUP ON BLACK SQUARE..UPPER BLADE SCISSORS + // E0.6 [1] (✂️) scissors + // E0.0 [2] (✃..✄) LOWER BLADE SCISSORS..WHITE SCISSORS + // E0.6 [1] (✅) check mark button + if (0x2690 <= code && code <= 0x2705) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [5] (✈️..✌️) airplane..victory hand + // E0.7 [1] (✍️) writing hand + // E0.0 [1] (✎) LOWER RIGHT PENCIL + // E0.6 [1] (✏️) pencil + // E0.0 [2] (✐..✑) UPPER RIGHT PENCIL..WHITE NIB + // E0.6 [1] (✒️) black nib + if (0x2708 <= code && code <= 0x2712) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + else { + if (code < 0x271d) { + // E0.6 [1] (✔️) check mark + if (0x2714 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.6 [1] (✖️) multiply + if (0x2716 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x2721) { + // E0.7 [1] (✝️) latin cross + if (0x271d === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.7 [1] (✡️) star of David + if (0x2721 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.6 [1] (✨) sparkles + if (0x2728 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + else { + if (code < 0x2753) { + if (code < 0x2747) { + if (code < 0x2744) { + // E0.6 [2] (✳️..✴️) eight-spoked asterisk..eight-pointed star + if (0x2733 <= code && code <= 0x2734) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [1] (❄️) snowflake + if (0x2744 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x274c) { + // E0.6 [1] (❇️) sparkle + if (0x2747 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [1] (❌) cross mark + if (0x274c === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.6 [1] (❎) cross mark button + if (0x274e === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + else { + if (code < 0x2763) { + if (code < 0x2757) { + // E0.6 [3] (❓..❕) red question mark..white exclamation mark + if (0x2753 <= code && code <= 0x2755) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [1] (❗) red exclamation mark + if (0x2757 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x2795) { + // E1.0 [1] (❣️) heart exclamation + // E0.6 [1] (❤️) red heart + // E0.0 [3] (❥..❧) ROTATED HEAVY BLACK HEART BULLET..ROTATED FLORAL HEART BULLET + if (0x2763 <= code && code <= 0x2767) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x27a1) { + // E0.6 [3] (➕..➗) plus..divide + if (0x2795 <= code && code <= 0x2797) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [1] (➡️) right arrow + if (0x27a1 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + } + } + } + else { + if (code < 0x1f201) { + if (code < 0x3297) { + if (code < 0x2b1b) { + if (code < 0x2934) { + // E0.6 [1] (➰) curly loop + if (0x27b0 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E1.0 [1] (➿) double curly loop + if (0x27bf === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x2b05) { + // E0.6 [2] (⤴️..⤵️) right arrow curving up..right arrow curving down + if (0x2934 <= code && code <= 0x2935) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [3] (⬅️..⬇️) left arrow..down arrow + if (0x2b05 <= code && code <= 0x2b07) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + else { + if (code < 0x2b55) { + if (code < 0x2b50) { + // E0.6 [2] (⬛..⬜) black large square..white large square + if (0x2b1b <= code && code <= 0x2b1c) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [1] (⭐) star + if (0x2b50 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x3030) { + // E0.6 [1] (⭕) hollow red circle + if (0x2b55 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [1] (〰️) wavy dash + if (0x3030 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.6 [1] (〽️) part alternation mark + if (0x303d === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + else { + if (code < 0x1f16c) { + if (code < 0x1f000) { + // E0.6 [1] (㊗️) Japanese “congratulations” button + if (0x3297 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + // E0.6 [1] (㊙️) Japanese “secret” button + if (0x3299 === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x1f10d) { + // E0.0 [4] (🀀..🀃) MAHJONG TILE EAST WIND..MAHJONG TILE NORTH WIND + // E0.6 [1] (🀄) mahjong red dragon + // E0.0 [202] (🀅..🃎) MAHJONG TILE GREEN DRAGON..PLAYING CARD KING OF DIAMONDS + // E0.6 [1] (🃏) joker + // E0.0 [48] (🃐..🃿) .. + if (0x1f000 <= code && code <= 0x1f0ff) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x1f12f) { + // E0.0 [3] (🄍..🄏) CIRCLED ZERO WITH SLASH..CIRCLED DOLLAR SIGN WITH OVERLAID BACKSLASH + if (0x1f10d <= code && code <= 0x1f10f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.0 [1] (🄯) COPYLEFT SYMBOL + if (0x1f12f === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + else { + if (code < 0x1f18e) { + if (code < 0x1f17e) { + // E0.0 [4] (🅬..🅯) RAISED MR SIGN..CIRCLED HUMAN FIGURE + // E0.6 [2] (🅰️..🅱️) A button (blood type)..B button (blood type) + if (0x1f16c <= code && code <= 0x1f171) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [2] (🅾️..🅿️) O button (blood type)..P button + if (0x1f17e <= code && code <= 0x1f17f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x1f191) { + // E0.6 [1] (🆎) AB button (blood type) + if (0x1f18e === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x1f1ad) { + // E0.6 [10] (🆑..🆚) CL button..VS button + if (0x1f191 <= code && code <= 0x1f19a) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.0 [57] (🆭..🇥) MASK WORK SYMBOL.. + if (0x1f1ad <= code && code <= 0x1f1e5) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + } + } + else { + if (code < 0x1f7d5) { + if (code < 0x1f249) { + if (code < 0x1f22f) { + if (code < 0x1f21a) { + // E0.6 [2] (🈁..🈂️) Japanese “here” button..Japanese “service charge” button + // E0.0 [13] (🈃..🈏) .. + if (0x1f201 <= code && code <= 0x1f20f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.6 [1] (🈚) Japanese “free of charge” button + if (0x1f21a === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x1f232) { + // E0.6 [1] (🈯) Japanese “reserved” button + if (0x1f22f === code) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x1f23c) { + // E0.6 [9] (🈲..🈺) Japanese “prohibited” button..Japanese “open for business” button + if (0x1f232 <= code && code <= 0x1f23a) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.0 [4] (🈼..🈿) .. + if (0x1f23c <= code && code <= 0x1f23f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + else { + if (code < 0x1f546) { + if (code < 0x1f400) { + // E0.0 [7] (🉉..🉏) .. + // E0.6 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button + // E0.0 [174] (🉒..🋿) .. + // E0.6 [13] (🌀..🌌) cyclone..milky way + // E0.7 [2] (🌍..🌎) globe showing Europe-Africa..globe showing Americas + // E0.6 [1] (🌏) globe showing Asia-Australia + // E1.0 [1] (🌐) globe with meridians + // E0.6 [1] (🌑) new moon + // E1.0 [1] (🌒) waxing crescent moon + // E0.6 [3] (🌓..🌕) first quarter moon..full moon + // E1.0 [3] (🌖..🌘) waning gibbous moon..waning crescent moon + // E0.6 [1] (🌙) crescent moon + // E1.0 [1] (🌚) new moon face + // E0.6 [1] (🌛) first quarter moon face + // E0.7 [1] (🌜) last quarter moon face + // E1.0 [2] (🌝..🌞) full moon face..sun with face + // E0.6 [2] (🌟..🌠) glowing star..shooting star + // E0.7 [1] (🌡️) thermometer + // E0.0 [2] (🌢..🌣) BLACK DROPLET..WHITE SUN + // E0.7 [9] (🌤️..🌬️) sun behind small cloud..wind face + // E1.0 [3] (🌭..🌯) hot dog..burrito + // E0.6 [2] (🌰..🌱) chestnut..seedling + // E1.0 [2] (🌲..🌳) evergreen tree..deciduous tree + // E0.6 [2] (🌴..🌵) palm tree..cactus + // E0.7 [1] (🌶️) hot pepper + // E0.6 [20] (🌷..🍊) tulip..tangerine + // E1.0 [1] (🍋) lemon + // E0.6 [4] (🍌..🍏) banana..green apple + // E1.0 [1] (🍐) pear + // E0.6 [43] (🍑..🍻) peach..clinking beer mugs + // E1.0 [1] (🍼) baby bottle + // E0.7 [1] (🍽️) fork and knife with plate + // E1.0 [2] (🍾..🍿) bottle with popping cork..popcorn + // E0.6 [20] (🎀..🎓) ribbon..graduation cap + // E0.0 [2] (🎔..🎕) HEART WITH TIP ON THE LEFT..BOUQUET OF FLOWERS + // E0.7 [2] (🎖️..🎗️) military medal..reminder ribbon + // E0.0 [1] (🎘) MUSICAL KEYBOARD WITH JACKS + // E0.7 [3] (🎙️..🎛️) studio microphone..control knobs + // E0.0 [2] (🎜..🎝) BEAMED ASCENDING MUSICAL NOTES..BEAMED DESCENDING MUSICAL NOTES + // E0.7 [2] (🎞️..🎟️) film frames..admission tickets + // E0.6 [37] (🎠..🏄) carousel horse..person surfing + // E1.0 [1] (🏅) sports medal + // E0.6 [1] (🏆) trophy + // E1.0 [1] (🏇) horse racing + // E0.6 [1] (🏈) american football + // E1.0 [1] (🏉) rugby football + // E0.6 [1] (🏊) person swimming + // E0.7 [4] (🏋️..🏎️) person lifting weights..racing car + // E1.0 [5] (🏏..🏓) cricket game..ping pong + // E0.7 [12] (🏔️..🏟️) snow-capped mountain..stadium + // E0.6 [4] (🏠..🏣) house..Japanese post office + // E1.0 [1] (🏤) post office + // E0.6 [12] (🏥..🏰) hospital..castle + // E0.0 [2] (🏱..🏲) WHITE PENNANT..BLACK PENNANT + // E0.7 [1] (🏳️) white flag + // E1.0 [1] (🏴) black flag + // E0.7 [1] (🏵️) rosette + // E0.0 [1] (🏶) BLACK ROSETTE + // E0.7 [1] (🏷️) label + // E1.0 [3] (🏸..🏺) badminton..amphora + if (0x1f249 <= code && code <= 0x1f3fa) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E1.0 [8] (🐀..🐇) rat..rabbit + // E0.7 [1] (🐈) cat + // E1.0 [3] (🐉..🐋) dragon..whale + // E0.6 [3] (🐌..🐎) snail..horse + // E1.0 [2] (🐏..🐐) ram..goat + // E0.6 [2] (🐑..🐒) ewe..monkey + // E1.0 [1] (🐓) rooster + // E0.6 [1] (🐔) chicken + // E0.7 [1] (🐕) dog + // E1.0 [1] (🐖) pig + // E0.6 [19] (🐗..🐩) boar..poodle + // E1.0 [1] (🐪) camel + // E0.6 [20] (🐫..🐾) two-hump camel..paw prints + // E0.7 [1] (🐿️) chipmunk + // E0.6 [1] (👀) eyes + // E0.7 [1] (👁️) eye + // E0.6 [35] (👂..👤) ear..bust in silhouette + // E1.0 [1] (👥) busts in silhouette + // E0.6 [6] (👦..👫) boy..woman and man holding hands + // E1.0 [2] (👬..👭) men holding hands..women holding hands + // E0.6 [63] (👮..💬) police officer..speech balloon + // E1.0 [1] (💭) thought balloon + // E0.6 [8] (💮..💵) white flower..dollar banknote + // E1.0 [2] (💶..💷) euro banknote..pound banknote + // E0.6 [52] (💸..📫) money with wings..closed mailbox with raised flag + // E0.7 [2] (📬..📭) open mailbox with raised flag..open mailbox with lowered flag + // E0.6 [1] (📮) postbox + // E1.0 [1] (📯) postal horn + // E0.6 [5] (📰..📴) newspaper..mobile phone off + // E1.0 [1] (📵) no mobile phones + // E0.6 [2] (📶..📷) antenna bars..camera + // E1.0 [1] (📸) camera with flash + // E0.6 [4] (📹..📼) video camera..videocassette + // E0.7 [1] (📽️) film projector + // E0.0 [1] (📾) PORTABLE STEREO + // E1.0 [4] (📿..🔂) prayer beads..repeat single button + // E0.6 [1] (🔃) clockwise vertical arrows + // E1.0 [4] (🔄..🔇) counterclockwise arrows button..muted speaker + // E0.7 [1] (🔈) speaker low volume + // E1.0 [1] (🔉) speaker medium volume + // E0.6 [11] (🔊..🔔) speaker high volume..bell + // E1.0 [1] (🔕) bell with slash + // E0.6 [22] (🔖..🔫) bookmark..water pistol + // E1.0 [2] (🔬..🔭) microscope..telescope + // E0.6 [16] (🔮..🔽) crystal ball..downwards button + if (0x1f400 <= code && code <= 0x1f53d) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x1f680) { + // E0.0 [3] (🕆..🕈) WHITE LATIN CROSS..CELTIC CROSS + // E0.7 [2] (🕉️..🕊️) om..dove + // E1.0 [4] (🕋..🕎) kaaba..menorah + // E0.0 [1] (🕏) BOWL OF HYGIEIA + // E0.6 [12] (🕐..🕛) one o’clock..twelve o’clock + // E0.7 [12] (🕜..🕧) one-thirty..twelve-thirty + // E0.0 [7] (🕨..🕮) RIGHT SPEAKER..BOOK + // E0.7 [2] (🕯️..🕰️) candle..mantelpiece clock + // E0.0 [2] (🕱..🕲) BLACK SKULL AND CROSSBONES..NO PIRACY + // E0.7 [7] (🕳️..🕹️) hole..joystick + // E3.0 [1] (🕺) man dancing + // E0.0 [12] (🕻..🖆) LEFT HAND TELEPHONE RECEIVER..PEN OVER STAMPED ENVELOPE + // E0.7 [1] (🖇️) linked paperclips + // E0.0 [2] (🖈..🖉) BLACK PUSHPIN..LOWER LEFT PENCIL + // E0.7 [4] (🖊️..🖍️) pen..crayon + // E0.0 [2] (🖎..🖏) LEFT WRITING HAND..TURNED OK HAND SIGN + // E0.7 [1] (🖐️) hand with fingers splayed + // E0.0 [4] (🖑..🖔) REVERSED RAISED HAND WITH FINGERS SPLAYED..REVERSED VICTORY HAND + // E1.0 [2] (🖕..🖖) middle finger..vulcan salute + // E0.0 [13] (🖗..🖣) WHITE DOWN POINTING LEFT HAND INDEX..BLACK DOWN POINTING BACKHAND INDEX + // E3.0 [1] (🖤) black heart + // E0.7 [1] (🖥️) desktop computer + // E0.0 [2] (🖦..🖧) KEYBOARD AND MOUSE..THREE NETWORKED COMPUTERS + // E0.7 [1] (🖨️) printer + // E0.0 [8] (🖩..🖰) POCKET CALCULATOR..TWO BUTTON MOUSE + // E0.7 [2] (🖱️..🖲️) computer mouse..trackball + // E0.0 [9] (🖳..🖻) OLD PERSONAL COMPUTER..DOCUMENT WITH PICTURE + // E0.7 [1] (🖼️) framed picture + // E0.0 [5] (🖽..🗁) FRAME WITH TILES..OPEN FOLDER + // E0.7 [3] (🗂️..🗄️) card index dividers..file cabinet + // E0.0 [12] (🗅..🗐) EMPTY NOTE..PAGES + // E0.7 [3] (🗑️..🗓️) wastebasket..spiral calendar + // E0.0 [8] (🗔..🗛) DESKTOP WINDOW..DECREASE FONT SIZE SYMBOL + // E0.7 [3] (🗜️..🗞️) clamp..rolled-up newspaper + // E0.0 [2] (🗟..🗠) PAGE WITH CIRCLED TEXT..STOCK CHART + // E0.7 [1] (🗡️) dagger + // E0.0 [1] (🗢) LIPS + // E0.7 [1] (🗣️) speaking head + // E0.0 [4] (🗤..🗧) THREE RAYS ABOVE..THREE RAYS RIGHT + // E2.0 [1] (🗨️) left speech bubble + // E0.0 [6] (🗩..🗮) RIGHT SPEECH BUBBLE..LEFT ANGER BUBBLE + // E0.7 [1] (🗯️) right anger bubble + // E0.0 [3] (🗰..🗲) MOOD BUBBLE..LIGHTNING MOOD + // E0.7 [1] (🗳️) ballot box with ballot + // E0.0 [6] (🗴..🗹) BALLOT SCRIPT X..BALLOT BOX WITH BOLD CHECK + // E0.7 [1] (🗺️) world map + // E0.6 [5] (🗻..🗿) mount fuji..moai + // E1.0 [1] (😀) grinning face + // E0.6 [6] (😁..😆) beaming face with smiling eyes..grinning squinting face + // E1.0 [2] (😇..😈) smiling face with halo..smiling face with horns + // E0.6 [5] (😉..😍) winking face..smiling face with heart-eyes + // E1.0 [1] (😎) smiling face with sunglasses + // E0.6 [1] (😏) smirking face + // E0.7 [1] (😐) neutral face + // E1.0 [1] (😑) expressionless face + // E0.6 [3] (😒..😔) unamused face..pensive face + // E1.0 [1] (😕) confused face + // E0.6 [1] (😖) confounded face + // E1.0 [1] (😗) kissing face + // E0.6 [1] (😘) face blowing a kiss + // E1.0 [1] (😙) kissing face with smiling eyes + // E0.6 [1] (😚) kissing face with closed eyes + // E1.0 [1] (😛) face with tongue + // E0.6 [3] (😜..😞) winking face with tongue..disappointed face + // E1.0 [1] (😟) worried face + // E0.6 [6] (😠..😥) angry face..sad but relieved face + // E1.0 [2] (😦..😧) frowning face with open mouth..anguished face + // E0.6 [4] (😨..😫) fearful face..tired face + // E1.0 [1] (😬) grimacing face + // E0.6 [1] (😭) loudly crying face + // E1.0 [2] (😮..😯) face with open mouth..hushed face + // E0.6 [4] (😰..😳) anxious face with sweat..flushed face + // E1.0 [1] (😴) sleeping face + // E0.6 [1] (😵) face with crossed-out eyes + // E1.0 [1] (😶) face without mouth + // E0.6 [10] (😷..🙀) face with medical mask..weary cat + // E1.0 [4] (🙁..🙄) slightly frowning face..face with rolling eyes + // E0.6 [11] (🙅..🙏) person gesturing NO..folded hands + if (0x1f546 <= code && code <= 0x1f64f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x1f774) { + // E0.6 [1] (🚀) rocket + // E1.0 [2] (🚁..🚂) helicopter..locomotive + // E0.6 [3] (🚃..🚅) railway car..bullet train + // E1.0 [1] (🚆) train + // E0.6 [1] (🚇) metro + // E1.0 [1] (🚈) light rail + // E0.6 [1] (🚉) station + // E1.0 [2] (🚊..🚋) tram..tram car + // E0.6 [1] (🚌) bus + // E0.7 [1] (🚍) oncoming bus + // E1.0 [1] (🚎) trolleybus + // E0.6 [1] (🚏) bus stop + // E1.0 [1] (🚐) minibus + // E0.6 [3] (🚑..🚓) ambulance..police car + // E0.7 [1] (🚔) oncoming police car + // E0.6 [1] (🚕) taxi + // E1.0 [1] (🚖) oncoming taxi + // E0.6 [1] (🚗) automobile + // E0.7 [1] (🚘) oncoming automobile + // E0.6 [2] (🚙..🚚) sport utility vehicle..delivery truck + // E1.0 [7] (🚛..🚡) articulated lorry..aerial tramway + // E0.6 [1] (🚢) ship + // E1.0 [1] (🚣) person rowing boat + // E0.6 [2] (🚤..🚥) speedboat..horizontal traffic light + // E1.0 [1] (🚦) vertical traffic light + // E0.6 [7] (🚧..🚭) construction..no smoking + // E1.0 [4] (🚮..🚱) litter in bin sign..non-potable water + // E0.6 [1] (🚲) bicycle + // E1.0 [3] (🚳..🚵) no bicycles..person mountain biking + // E0.6 [1] (🚶) person walking + // E1.0 [2] (🚷..🚸) no pedestrians..children crossing + // E0.6 [6] (🚹..🚾) men’s room..water closet + // E1.0 [1] (🚿) shower + // E0.6 [1] (🛀) person taking bath + // E1.0 [5] (🛁..🛅) bathtub..left luggage + // E0.0 [5] (🛆..🛊) TRIANGLE WITH ROUNDED CORNERS..GIRLS SYMBOL + // E0.7 [1] (🛋️) couch and lamp + // E1.0 [1] (🛌) person in bed + // E0.7 [3] (🛍️..🛏️) shopping bags..bed + // E1.0 [1] (🛐) place of worship + // E3.0 [2] (🛑..🛒) stop sign..shopping cart + // E0.0 [2] (🛓..🛔) STUPA..PAGODA + // E12.0 [1] (🛕) hindu temple + // E13.0 [2] (🛖..🛗) hut..elevator + // E0.0 [4] (🛘..🛛) .. + // E15.0 [1] (🛜) wireless + // E14.0 [3] (🛝..🛟) playground slide..ring buoy + // E0.7 [6] (🛠️..🛥️) hammer and wrench..motor boat + // E0.0 [3] (🛦..🛨) UP-POINTING MILITARY AIRPLANE..UP-POINTING SMALL AIRPLANE + // E0.7 [1] (🛩️) small airplane + // E0.0 [1] (🛪) NORTHEAST-POINTING AIRPLANE + // E1.0 [2] (🛫..🛬) airplane departure..airplane arrival + // E0.0 [3] (🛭..🛯) .. + // E0.7 [1] (🛰️) satellite + // E0.0 [2] (🛱..🛲) ONCOMING FIRE ENGINE..DIESEL LOCOMOTIVE + // E0.7 [1] (🛳️) passenger ship + // E3.0 [3] (🛴..🛶) kick scooter..canoe + // E5.0 [2] (🛷..🛸) sled..flying saucer + // E11.0 [1] (🛹) skateboard + // E12.0 [1] (🛺) auto rickshaw + // E13.0 [2] (🛻..🛼) pickup truck..roller skate + // E0.0 [3] (🛽..🛿) .. + if (0x1f680 <= code && code <= 0x1f6ff) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.0 [12] (🝴..🝿) LOT OF FORTUNE..ORCUS + if (0x1f774 <= code && code <= 0x1f77f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + } + else { + if (code < 0x1f8ae) { + if (code < 0x1f848) { + if (code < 0x1f80c) { + // E0.0 [11] (🟕..🟟) CIRCLED TRIANGLE.. + // E12.0 [12] (🟠..🟫) orange circle..brown square + // E0.0 [4] (🟬..🟯) .. + // E14.0 [1] (🟰) heavy equals sign + // E0.0 [15] (🟱..🟿) .. + if (0x1f7d5 <= code && code <= 0x1f7ff) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.0 [4] (🠌..🠏) .. + if (0x1f80c <= code && code <= 0x1f80f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x1f85a) { + // E0.0 [8] (🡈..🡏) .. + if (0x1f848 <= code && code <= 0x1f84f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x1f888) { + // E0.0 [6] (🡚..🡟) .. + if (0x1f85a <= code && code <= 0x1f85f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.0 [8] (🢈..🢏) .. + if (0x1f888 <= code && code <= 0x1f88f) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + else { + if (code < 0x1f93c) { + if (code < 0x1f90c) { + // E0.0 [82] (🢮..🣿) .. + if (0x1f8ae <= code && code <= 0x1f8ff) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E13.0 [1] (🤌) pinched fingers + // E12.0 [3] (🤍..🤏) white heart..pinching hand + // E1.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns + // E3.0 [6] (🤙..🤞) call me hand..crossed fingers + // E5.0 [1] (🤟) love-you gesture + // E3.0 [8] (🤠..🤧) cowboy hat face..sneezing face + // E5.0 [8] (🤨..🤯) face with raised eyebrow..exploding head + // E3.0 [1] (🤰) pregnant woman + // E5.0 [2] (🤱..🤲) breast-feeding..palms up together + // E3.0 [8] (🤳..🤺) selfie..person fencing + if (0x1f90c <= code && code <= 0x1f93a) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + else { + if (code < 0x1f947) { + // E3.0 [3] (🤼..🤾) people wrestling..person playing handball + // E12.0 [1] (🤿) diving mask + // E3.0 [6] (🥀..🥅) wilted flower..goal net + if (0x1f93c <= code && code <= 0x1f945) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + if (code < 0x1fc00) { + // E3.0 [5] (🥇..🥋) 1st place medal..martial arts uniform + // E5.0 [1] (🥌) curling stone + // E11.0 [3] (🥍..🥏) lacrosse..flying disc + // E3.0 [15] (🥐..🥞) croissant..pancakes + // E5.0 [13] (🥟..🥫) dumpling..canned food + // E11.0 [5] (🥬..🥰) leafy green..smiling face with hearts + // E12.0 [1] (🥱) yawning face + // E13.0 [1] (🥲) smiling face with tear + // E11.0 [4] (🥳..🥶) partying face..cold face + // E13.0 [2] (🥷..🥸) ninja..disguised face + // E14.0 [1] (🥹) face holding back tears + // E11.0 [1] (🥺) pleading face + // E12.0 [1] (🥻) sari + // E11.0 [4] (🥼..🥿) lab coat..flat shoe + // E1.0 [5] (🦀..🦄) crab..unicorn + // E3.0 [13] (🦅..🦑) eagle..squid + // E5.0 [6] (🦒..🦗) giraffe..cricket + // E11.0 [11] (🦘..🦢) kangaroo..swan + // E13.0 [2] (🦣..🦤) mammoth..dodo + // E12.0 [6] (🦥..🦪) sloth..oyster + // E13.0 [3] (🦫..🦭) beaver..seal + // E12.0 [2] (🦮..🦯) guide dog..white cane + // E11.0 [10] (🦰..🦹) red hair..supervillain + // E12.0 [6] (🦺..🦿) safety vest..mechanical leg + // E1.0 [1] (🧀) cheese wedge + // E11.0 [2] (🧁..🧂) cupcake..salt + // E12.0 [8] (🧃..🧊) beverage box..ice + // E13.0 [1] (🧋) bubble tea + // E14.0 [1] (🧌) troll + // E12.0 [3] (🧍..🧏) person standing..deaf person + // E5.0 [23] (🧐..🧦) face with monocle..socks + // E11.0 [25] (🧧..🧿) red envelope..nazar amulet + // E0.0 [112] (🨀..🩯) NEUTRAL CHESS KING.. + // E12.0 [4] (🩰..🩳) ballet shoes..shorts + // E13.0 [1] (🩴) thong sandal + // E15.0 [3] (🩵..🩷) light blue heart..pink heart + // E12.0 [3] (🩸..🩺) drop of blood..stethoscope + // E14.0 [2] (🩻..🩼) x-ray..crutch + // E0.0 [3] (🩽..🩿) .. + // E12.0 [3] (🪀..🪂) yo-yo..parachute + // E13.0 [4] (🪃..🪆) boomerang..nesting dolls + // E15.0 [2] (🪇..🪈) maracas..flute + // E0.0 [7] (🪉..🪏) .. + // E12.0 [6] (🪐..🪕) ringed planet..banjo + // E13.0 [19] (🪖..🪨) military helmet..rock + // E14.0 [4] (🪩..🪬) mirror ball..hamsa + // E15.0 [3] (🪭..🪯) folding hand fan..khanda + // E13.0 [7] (🪰..🪶) fly..feather + // E14.0 [4] (🪷..🪺) lotus..nest with eggs + // E15.0 [3] (🪻..🪽) hyacinth..wing + // E0.0 [1] (🪾) + // E15.0 [1] (🪿) goose + // E13.0 [3] (🫀..🫂) anatomical heart..people hugging + // E14.0 [3] (🫃..🫅) pregnant man..person with crown + // E0.0 [8] (🫆..🫍) .. + // E15.0 [2] (🫎..🫏) moose..donkey + // E13.0 [7] (🫐..🫖) blueberries..teapot + // E14.0 [3] (🫗..🫙) pouring liquid..jar + // E15.0 [2] (🫚..🫛) ginger root..pea pod + // E0.0 [4] (🫜..🫟) .. + // E14.0 [8] (🫠..🫧) melting face..bubbles + // E15.0 [1] (🫨) shaking face + // E0.0 [7] (🫩..🫯) .. + // E14.0 [7] (🫰..🫶) hand with index finger and thumb crossed..heart hands + // E15.0 [2] (🫷..🫸) leftwards pushing hand..rightwards pushing hand + // E0.0 [7] (🫹..🫿) .. + if (0x1f947 <= code && code <= 0x1faff) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + else { + // E0.0[1022] (🰀..🿽) .. + if (0x1fc00 <= code && code <= 0x1fffd) { + return boundaries_1.EXTENDED_PICTOGRAPHIC; + } + } + } + } + } + } + } + } + // unlisted code points are treated as a break property of "Other" + return boundaries_1.CLUSTER_BREAK.OTHER; + } +} +exports.default = Graphemer; diff --git a/node_modules/graphemer/lib/GraphemerHelper.d.ts.map b/node_modules/graphemer/lib/GraphemerHelper.d.ts.map new file mode 100644 index 0000000..369421a --- /dev/null +++ b/node_modules/graphemer/lib/GraphemerHelper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GraphemerHelper.d.ts","sourceRoot":"","sources":["../src/GraphemerHelper.ts"],"names":[],"mappings":"AAUA,cAAM,eAAe;IACnB;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IASrD;;;;;;;OAOG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAgCpD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,WAAW,CAChB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EAAE,EACb,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM;CAyHV;AAED,eAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/graphemer/lib/GraphemerHelper.js b/node_modules/graphemer/lib/GraphemerHelper.js new file mode 100644 index 0000000..9bc71eb --- /dev/null +++ b/node_modules/graphemer/lib/GraphemerHelper.js @@ -0,0 +1,169 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const boundaries_1 = require("./boundaries"); +// BreakTypes +// @type {BreakType} +const NotBreak = 0; +const BreakStart = 1; +const Break = 2; +const BreakLastRegional = 3; +const BreakPenultimateRegional = 4; +class GraphemerHelper { + /** + * Check if the the character at the position {pos} of the string is surrogate + * @param str {string} + * @param pos {number} + * @returns {boolean} + */ + static isSurrogate(str, pos) { + return (0xd800 <= str.charCodeAt(pos) && + str.charCodeAt(pos) <= 0xdbff && + 0xdc00 <= str.charCodeAt(pos + 1) && + str.charCodeAt(pos + 1) <= 0xdfff); + } + /** + * The String.prototype.codePointAt polyfill + * Private function, gets a Unicode code point from a JavaScript UTF-16 string + * handling surrogate pairs appropriately + * @param str {string} + * @param idx {number} + * @returns {number} + */ + static codePointAt(str, idx) { + if (idx === undefined) { + idx = 0; + } + const code = str.charCodeAt(idx); + // if a high surrogate + if (0xd800 <= code && code <= 0xdbff && idx < str.length - 1) { + const hi = code; + const low = str.charCodeAt(idx + 1); + if (0xdc00 <= low && low <= 0xdfff) { + return (hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000; + } + return hi; + } + // if a low surrogate + if (0xdc00 <= code && code <= 0xdfff && idx >= 1) { + const hi = str.charCodeAt(idx - 1); + const low = code; + if (0xd800 <= hi && hi <= 0xdbff) { + return (hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000; + } + return low; + } + // just return the char if an unmatched surrogate half or a + // single-char codepoint + return code; + } + // + /** + * Private function, returns whether a break is allowed between the two given grapheme breaking classes + * Implemented the UAX #29 3.1.1 Grapheme Cluster Boundary Rules on extended grapheme clusters + * @param start {number} + * @param mid {Array} + * @param end {number} + * @param startEmoji {number} + * @param midEmoji {Array} + * @param endEmoji {number} + * @returns {number} + */ + static shouldBreak(start, mid, end, startEmoji, midEmoji, endEmoji) { + const all = [start].concat(mid).concat([end]); + const allEmoji = [startEmoji].concat(midEmoji).concat([endEmoji]); + const previous = all[all.length - 2]; + const next = end; + const nextEmoji = endEmoji; + // Lookahead terminator for: + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + const rIIndex = all.lastIndexOf(boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR); + if (rIIndex > 0 && + all.slice(1, rIIndex).every(function (c) { + return c === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR; + }) && + [boundaries_1.CLUSTER_BREAK.PREPEND, boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR].indexOf(previous) === -1) { + if (all.filter(function (c) { + return c === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR; + }).length % + 2 === + 1) { + return BreakLastRegional; + } + else { + return BreakPenultimateRegional; + } + } + // GB3. CR × LF + if (previous === boundaries_1.CLUSTER_BREAK.CR && next === boundaries_1.CLUSTER_BREAK.LF) { + return NotBreak; + } + // GB4. (Control|CR|LF) ÷ + else if (previous === boundaries_1.CLUSTER_BREAK.CONTROL || + previous === boundaries_1.CLUSTER_BREAK.CR || + previous === boundaries_1.CLUSTER_BREAK.LF) { + return BreakStart; + } + // GB5. ÷ (Control|CR|LF) + else if (next === boundaries_1.CLUSTER_BREAK.CONTROL || + next === boundaries_1.CLUSTER_BREAK.CR || + next === boundaries_1.CLUSTER_BREAK.LF) { + return BreakStart; + } + // GB6. L × (L|V|LV|LVT) + else if (previous === boundaries_1.CLUSTER_BREAK.L && + (next === boundaries_1.CLUSTER_BREAK.L || + next === boundaries_1.CLUSTER_BREAK.V || + next === boundaries_1.CLUSTER_BREAK.LV || + next === boundaries_1.CLUSTER_BREAK.LVT)) { + return NotBreak; + } + // GB7. (LV|V) × (V|T) + else if ((previous === boundaries_1.CLUSTER_BREAK.LV || previous === boundaries_1.CLUSTER_BREAK.V) && + (next === boundaries_1.CLUSTER_BREAK.V || next === boundaries_1.CLUSTER_BREAK.T)) { + return NotBreak; + } + // GB8. (LVT|T) × (T) + else if ((previous === boundaries_1.CLUSTER_BREAK.LVT || previous === boundaries_1.CLUSTER_BREAK.T) && + next === boundaries_1.CLUSTER_BREAK.T) { + return NotBreak; + } + // GB9. × (Extend|ZWJ) + else if (next === boundaries_1.CLUSTER_BREAK.EXTEND || next === boundaries_1.CLUSTER_BREAK.ZWJ) { + return NotBreak; + } + // GB9a. × SpacingMark + else if (next === boundaries_1.CLUSTER_BREAK.SPACINGMARK) { + return NotBreak; + } + // GB9b. Prepend × + else if (previous === boundaries_1.CLUSTER_BREAK.PREPEND) { + return NotBreak; + } + // GB11. \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic} + const previousNonExtendIndex = allEmoji + .slice(0, -1) + .lastIndexOf(boundaries_1.EXTENDED_PICTOGRAPHIC); + if (previousNonExtendIndex !== -1 && + allEmoji[previousNonExtendIndex] === boundaries_1.EXTENDED_PICTOGRAPHIC && + all.slice(previousNonExtendIndex + 1, -2).every(function (c) { + return c === boundaries_1.CLUSTER_BREAK.EXTEND; + }) && + previous === boundaries_1.CLUSTER_BREAK.ZWJ && + nextEmoji === boundaries_1.EXTENDED_PICTOGRAPHIC) { + return NotBreak; + } + // GB12. ^ (RI RI)* RI × RI + // GB13. [^RI] (RI RI)* RI × RI + if (mid.indexOf(boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR) !== -1) { + return Break; + } + if (previous === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR && + next === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR) { + return NotBreak; + } + // GB999. Any ? Any + return BreakStart; + } +} +exports.default = GraphemerHelper; diff --git a/node_modules/graphemer/lib/GraphemerIterator.d.ts.map b/node_modules/graphemer/lib/GraphemerIterator.d.ts.map new file mode 100644 index 0000000..c65f0ee --- /dev/null +++ b/node_modules/graphemer/lib/GraphemerIterator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GraphemerIterator.d.ts","sourceRoot":"","sources":["../src/GraphemerIterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAM,iBAAkB,YAAW,QAAQ,CAAC,MAAM,CAAC;IACjD,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,UAAU,CAAyC;gBAE/C,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM;IAK1E,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB,IAAI;;;;CAcL;AAED,eAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/graphemer/lib/GraphemerIterator.js b/node_modules/graphemer/lib/GraphemerIterator.js new file mode 100644 index 0000000..dd21ce5 --- /dev/null +++ b/node_modules/graphemer/lib/GraphemerIterator.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * GraphemerIterator + * + * Takes a string and a "BreakHandler" method during initialisation + * and creates an iterable object that returns individual graphemes. + * + * @param str {string} + * @return GraphemerIterator + */ +class GraphemerIterator { + constructor(str, nextBreak) { + this._index = 0; + this._str = str; + this._nextBreak = nextBreak; + } + [Symbol.iterator]() { + return this; + } + next() { + let brk; + if ((brk = this._nextBreak(this._str, this._index)) < this._str.length) { + const value = this._str.slice(this._index, brk); + this._index = brk; + return { value: value, done: false }; + } + if (this._index < this._str.length) { + const value = this._str.slice(this._index); + this._index = this._str.length; + return { value: value, done: false }; + } + return { value: undefined, done: true }; + } +} +exports.default = GraphemerIterator; diff --git a/node_modules/graphemer/lib/boundaries.d.ts.map b/node_modules/graphemer/lib/boundaries.d.ts.map new file mode 100644 index 0000000..5bc59ba --- /dev/null +++ b/node_modules/graphemer/lib/boundaries.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"boundaries.d.ts","sourceRoot":"","sources":["../src/boundaries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,aAAa;IACvB,EAAE,IAAI;IACN,EAAE,IAAI;IACN,OAAO,IAAI;IACX,MAAM,IAAI;IACV,kBAAkB,IAAI;IACtB,WAAW,IAAI;IACf,CAAC,IAAI;IACL,CAAC,IAAI;IACL,CAAC,IAAI;IACL,EAAE,IAAI;IACN,GAAG,KAAK;IACR,KAAK,KAAK;IACV,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,UAAU,KAAK;IACf,GAAG,KAAK;IACR,cAAc,KAAK;IACnB,UAAU,KAAK;CAChB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/graphemer/lib/boundaries.js b/node_modules/graphemer/lib/boundaries.js new file mode 100644 index 0000000..2c98c14 --- /dev/null +++ b/node_modules/graphemer/lib/boundaries.js @@ -0,0 +1,38 @@ +"use strict"; +/** + * The Grapheme_Cluster_Break property value + * @see https://www.unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EXTENDED_PICTOGRAPHIC = exports.CLUSTER_BREAK = void 0; +var CLUSTER_BREAK; +(function (CLUSTER_BREAK) { + CLUSTER_BREAK[CLUSTER_BREAK["CR"] = 0] = "CR"; + CLUSTER_BREAK[CLUSTER_BREAK["LF"] = 1] = "LF"; + CLUSTER_BREAK[CLUSTER_BREAK["CONTROL"] = 2] = "CONTROL"; + CLUSTER_BREAK[CLUSTER_BREAK["EXTEND"] = 3] = "EXTEND"; + CLUSTER_BREAK[CLUSTER_BREAK["REGIONAL_INDICATOR"] = 4] = "REGIONAL_INDICATOR"; + CLUSTER_BREAK[CLUSTER_BREAK["SPACINGMARK"] = 5] = "SPACINGMARK"; + CLUSTER_BREAK[CLUSTER_BREAK["L"] = 6] = "L"; + CLUSTER_BREAK[CLUSTER_BREAK["V"] = 7] = "V"; + CLUSTER_BREAK[CLUSTER_BREAK["T"] = 8] = "T"; + CLUSTER_BREAK[CLUSTER_BREAK["LV"] = 9] = "LV"; + CLUSTER_BREAK[CLUSTER_BREAK["LVT"] = 10] = "LVT"; + CLUSTER_BREAK[CLUSTER_BREAK["OTHER"] = 11] = "OTHER"; + CLUSTER_BREAK[CLUSTER_BREAK["PREPEND"] = 12] = "PREPEND"; + CLUSTER_BREAK[CLUSTER_BREAK["E_BASE"] = 13] = "E_BASE"; + CLUSTER_BREAK[CLUSTER_BREAK["E_MODIFIER"] = 14] = "E_MODIFIER"; + CLUSTER_BREAK[CLUSTER_BREAK["ZWJ"] = 15] = "ZWJ"; + CLUSTER_BREAK[CLUSTER_BREAK["GLUE_AFTER_ZWJ"] = 16] = "GLUE_AFTER_ZWJ"; + CLUSTER_BREAK[CLUSTER_BREAK["E_BASE_GAZ"] = 17] = "E_BASE_GAZ"; +})(CLUSTER_BREAK = exports.CLUSTER_BREAK || (exports.CLUSTER_BREAK = {})); +/** + * The Emoji character property is an extension of UCD but shares the same namespace and structure + * @see http://www.unicode.org/reports/tr51/tr51-14.html#Emoji_Properties_and_Data_Files + * + * Here we model Extended_Pictograhpic only to implement UAX #29 GB11 + * \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic} + * + * The Emoji character property should not be mixed with Grapheme_Cluster_Break since they are not exclusive + */ +exports.EXTENDED_PICTOGRAPHIC = 101; diff --git a/node_modules/graphemer/lib/index.d.ts.map b/node_modules/graphemer/lib/index.d.ts.map new file mode 100644 index 0000000..a6bacf9 --- /dev/null +++ b/node_modules/graphemer/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/graphemer/lib/index.js b/node_modules/graphemer/lib/index.js new file mode 100644 index 0000000..548bdd0 --- /dev/null +++ b/node_modules/graphemer/lib/index.js @@ -0,0 +1,7 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Graphemer_1 = __importDefault(require("./Graphemer")); +exports.default = Graphemer_1.default; diff --git a/node_modules/graphemer/package.json b/node_modules/graphemer/package.json new file mode 100644 index 0000000..cf0315d --- /dev/null +++ b/node_modules/graphemer/package.json @@ -0,0 +1,54 @@ +{ + "name": "graphemer", + "version": "1.4.0", + "description": "A JavaScript library that breaks strings into their individual user-perceived characters (including emojis!)", + "homepage": "https://github.com/flmnt/graphemer", + "author": "Matt Davies (https://github.com/mattpauldavies)", + "contributors": [ + "Orlin Georgiev (https://github.com/orling)", + "Huáng Jùnliàng (https://github.com/JLHwung)" + ], + "main": "./lib/index.js", + "types": "./lib/index.d.ts", + "files": [ + "lib" + ], + "license": "MIT", + "keywords": [ + "utf-8", + "strings", + "emoji", + "split" + ], + "scripts": { + "prepublishOnly": "npm run build", + "build": "tsc --project tsconfig.json", + "pretest": "npm run build", + "test": "ts-node node_modules/tape/bin/tape tests/**.ts", + "prettier:check": "prettier --check .", + "prettier:fix": "prettier --write ." + }, + "repository": { + "type": "git", + "url": "https://github.com/flmnt/graphemer.git" + }, + "bugs": "https://github.com/flmnt/graphemer/issues", + "devDependencies": { + "@types/tape": "^4.13.0", + "husky": "^4.3.0", + "lint-staged": "^10.3.0", + "prettier": "^2.1.1", + "tape": "^4.6.3", + "ts-node": "^9.0.0", + "typescript": "^4.0.2" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "pre-push": "npm test" + } + }, + "lint-staged": { + "*.{js,ts,md,json}": "prettier --write" + } +} diff --git a/node_modules/has-flag/index.js b/node_modules/has-flag/index.js new file mode 100644 index 0000000..b6f80b1 --- /dev/null +++ b/node_modules/has-flag/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +}; diff --git a/node_modules/has-flag/license b/node_modules/has-flag/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/has-flag/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/has-flag/package.json b/node_modules/has-flag/package.json new file mode 100644 index 0000000..a9cba4b --- /dev/null +++ b/node_modules/has-flag/package.json @@ -0,0 +1,46 @@ +{ + "name": "has-flag", + "version": "4.0.0", + "description": "Check if argv has a specific flag", + "license": "MIT", + "repository": "sindresorhus/has-flag", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "has", + "check", + "detect", + "contains", + "find", + "flag", + "cli", + "command-line", + "argv", + "process", + "arg", + "args", + "argument", + "arguments", + "getopt", + "minimist", + "optimist" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/has-flag/readme.md b/node_modules/has-flag/readme.md new file mode 100644 index 0000000..3f72dff --- /dev/null +++ b/node_modules/has-flag/readme.md @@ -0,0 +1,89 @@ +# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) + +> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag + +Correctly stops looking after an `--` argument terminator. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + + +## Install + +``` +$ npm install has-flag +``` + + +## Usage + +```js +// foo.js +const hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('f'); +//=> true + +hasFlag('-f'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` + +``` +$ node foo.js -f --unicorn --foo=bar -- --rainbow +``` + + +## API + +### hasFlag(flag, [argv]) + +Returns a boolean for whether the flag exists. + +#### flag + +Type: `string` + +CLI flag to look for. The `--` prefix is optional. + +#### argv + +Type: `string[]`
+Default: `process.argv` + +CLI arguments. + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/ignore/LICENSE-MIT b/node_modules/ignore/LICENSE-MIT new file mode 100644 index 0000000..825533e --- /dev/null +++ b/node_modules/ignore/LICENSE-MIT @@ -0,0 +1,21 @@ +Copyright (c) 2013 Kael Zhang , contributors +http://kael.me/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/ignore/README.md b/node_modules/ignore/README.md new file mode 100644 index 0000000..50d8882 --- /dev/null +++ b/node_modules/ignore/README.md @@ -0,0 +1,412 @@ + + + + + + + + + + + + + +
LinuxOS XWindowsCoverageDownloads
+ + Build Status + + + Windows Build Status + + + Coverage Status + + + npm module downloads per month +
+ +# ignore + +`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the [.gitignore spec 2.22.1](http://git-scm.com/docs/gitignore). + +`ignore` is used by eslint, gitbook and [many others](https://www.npmjs.com/browse/depended/ignore). + +Pay **ATTENTION** that [`minimatch`](https://www.npmjs.org/package/minimatch) (which used by `fstream-ignore`) does not follow the gitignore spec. + +To filter filenames according to a .gitignore file, I recommend this npm package, `ignore`. + +To parse an `.npmignore` file, you should use `minimatch`, because an `.npmignore` file is parsed by npm using `minimatch` and it does not work in the .gitignore way. + +### Tested on + +`ignore` is fully tested, and has more than **five hundreds** of unit tests. + +- Linux + Node: `0.8` - `7.x` +- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. + +Actually, `ignore` does not rely on any versions of node specially. + +Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md). + +## Table Of Main Contents + +- [Usage](#usage) +- [`Pathname` Conventions](#pathname-conventions) +- See Also: + - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. +- [Upgrade Guide](#upgrade-guide) + +## Install + +```sh +npm i ignore +``` + +## Usage + +```js +import ignore from 'ignore' +const ig = ignore().add(['.abc/*', '!.abc/d/']) +``` + +### Filter the given paths + +```js +const paths = [ + '.abc/a.js', // filtered out + '.abc/d/e.js' // included +] + +ig.filter(paths) // ['.abc/d/e.js'] +ig.ignores('.abc/a.js') // true +``` + +### As the filter function + +```js +paths.filter(ig.createFilter()); // ['.abc/d/e.js'] +``` + +### Win32 paths will be handled + +```js +ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) +// if the code above runs on windows, the result will be +// ['.abc\\d\\e.js'] +``` + +## Why another ignore? + +- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. + +- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so + - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. + - `ignore` don't cares about sub-modules of git projects. + +- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: + - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. + - '`**/foo`' should match '`foo`' anywhere. + - Prevent re-including a file if a parent directory of that file is excluded. + - Handle trailing whitespaces: + - `'a '`(one space) should not match `'a '`(two spaces). + - `'a \ '` matches `'a '` + - All test cases are verified with the result of `git check-ignore`. + +# Methods + +## .add(pattern: string | Ignore): this +## .add(patterns: Array): this + +- **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance +- **patterns** `Array` Array of ignore patterns. + +Adds a rule or several rules to the current manager. + +Returns `this` + +Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. + +```js +ignore().add('#abc').ignores('#abc') // false +ignore().add('\\#abc').ignores('#abc') // true +``` + +`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: + +```js +ignore() +.add(fs.readFileSync(filenameOfGitignore).toString()) +.filter(filenames) +``` + +`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. + +## .addIgnoreFile(path) + +REMOVED in `3.x` for now. + +To upgrade `ignore@2.x` up to `3.x`, use + +```js +import fs from 'fs' + +if (fs.existsSync(filename)) { + ignore().add(fs.readFileSync(filename).toString()) +} +``` + +instead. + +## .filter(paths: Array<Pathname>): Array<Pathname> + +```ts +type Pathname = string +``` + +Filters the given array of pathnames, and returns the filtered array. + +- **paths** `Array.` The array of `pathname`s to be filtered. + +### `Pathname` Conventions: + +#### 1. `Pathname` should be a `path.relative()`d pathname + +`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory, + +```js +// WRONG, an error will be thrown +ig.ignores('./abc') + +// WRONG, for it will never happen, and an error will be thrown +// If the gitignore rule locates at the root directory, +// `'/abc'` should be changed to `'abc'`. +// ``` +// path.relative('/', '/abc') -> 'abc' +// ``` +ig.ignores('/abc') + +// WRONG, that it is an absolute path on Windows, an error will be thrown +ig.ignores('C:\\abc') + +// Right +ig.ignores('abc') + +// Right +ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' +``` + +In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules. + +Suppose the dir structure is: + +``` +/path/to/your/repo + |-- a + | |-- a.js + | + |-- .b + | + |-- .c + |-- .DS_store +``` + +Then the `paths` might be like this: + +```js +[ + 'a/a.js' + '.b', + '.c/.DS_store' +] +``` + +#### 2. filenames and dirnames + +`node-ignore` does NO `fs.stat` during path matching, so for the example below: + +```js +// First, we add a ignore pattern to ignore a directory +ig.add('config/') + +// `ig` does NOT know if 'config', in the real world, +// is a normal file, directory or something. + +ig.ignores('config') +// `ig` treats `config` as a file, so it returns `false` + +ig.ignores('config/') +// returns `true` +``` + +Specially for people who develop some library based on `node-ignore`, it is important to understand that. + +Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: + +```js +import glob from 'glob' + +glob('**', { + // Adds a / character to directory matches. + mark: true +}, (err, files) => { + if (err) { + return console.error(err) + } + + let filtered = ignore().add(patterns).filter(files) + console.log(filtered) +}) +``` + +## .ignores(pathname: Pathname): boolean + +> new in 3.2.0 + +Returns `Boolean` whether `pathname` should be ignored. + +```js +ig.ignores('.abc/a.js') // true +``` + +## .createFilter() + +Creates a filter function which could filter an array of paths with `Array.prototype.filter`. + +Returns `function(path)` the filter function. + +## .test(pathname: Pathname) since 5.0.0 + +Returns `TestResult` + +```ts +interface TestResult { + ignored: boolean + // true if the `pathname` is finally unignored by some negative pattern + unignored: boolean +} +``` + +- `{ignored: true, unignored: false}`: the `pathname` is ignored +- `{ignored: false, unignored: true}`: the `pathname` is unignored +- `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules. + +## static `ignore.isPathValid(pathname): boolean` since 5.0.0 + +Check whether the `pathname` is an valid `path.relative()`d path according to the [convention](#1-pathname-should-be-a-pathrelatived-pathname). + +This method is **NOT** used to check if an ignore pattern is valid. + +```js +ignore.isPathValid('./foo') // false +``` + +## ignore(options) + +### `options.ignorecase` since 4.0.0 + +Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (the default value), otherwise case sensitive. + +```js +const ig = ignore({ + ignorecase: false +}) + +ig.add('*.png') + +ig.ignores('*.PNG') // false +``` + +### `options.ignoreCase?: boolean` since 5.2.0 + +Which is alternative to `options.ignoreCase` + +### `options.allowRelativePaths?: boolean` since 5.2.0 + +This option brings backward compatibility with projects which based on `ignore@4.x`. If `options.allowRelativePaths` is `true`, `ignore` will not check whether the given path to be tested is [`path.relative()`d](#pathname-conventions). + +However, passing a relative path, such as `'./foo'` or `'../foo'`, to test if it is ignored or not is not a good practise, which might lead to unexpected behavior + +```js +ignore({ + allowRelativePaths: true +}).ignores('../foo/bar.js') // And it will not throw +``` + +**** + +# Upgrade Guide + +## Upgrade 4.x -> 5.x + +Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, unless `options.allowRelative = true` is passed to the `Ignore` factory. + +While `ignore < 5.0.0` did not make sure what the return value was, as well as + +```ts +.ignores(pathname: Pathname): boolean + +.filter(pathnames: Array): Array + +.createFilter(): (pathname: Pathname) => boolean + +.test(pathname: Pathname): {ignored: boolean, unignored: boolean} +``` + +See the convention [here](#1-pathname-should-be-a-pathrelatived-pathname) for details. + +If there are invalid pathnames, the conversion and filtration should be done by users. + +```js +import {isPathValid} from 'ignore' // introduced in 5.0.0 + +const paths = [ + // invalid + ////////////////// + '', + false, + '../foo', + '.', + ////////////////// + + // valid + 'foo' +] +.filter(isValidPath) + +ig.filter(paths) +``` + +## Upgrade 3.x -> 4.x + +Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6: + +```js +var ignore = require('ignore/legacy') +``` + +## Upgrade 2.x -> 3.x + +- All `options` of 2.x are unnecessary and removed, so just remove them. +- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. +- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. + +**** + +# Collaborators + +- [@whitecolor](https://github.com/whitecolor) *Alex* +- [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé* +- [@azproduction](https://github.com/azproduction) *Mikhail Davydov* +- [@TrySound](https://github.com/TrySound) *Bogdan Chadkin* +- [@JanMattner](https://github.com/JanMattner) *Jan Mattner* +- [@ntwb](https://github.com/ntwb) *Stephen Edgar* +- [@kasperisager](https://github.com/kasperisager) *Kasper Isager* +- [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders* diff --git a/node_modules/ignore/index.js b/node_modules/ignore/index.js new file mode 100644 index 0000000..9f0dbfe --- /dev/null +++ b/node_modules/ignore/index.js @@ -0,0 +1,636 @@ +// A simple implementation of make-array +function makeArray (subject) { + return Array.isArray(subject) + ? subject + : [subject] +} + +const EMPTY = '' +const SPACE = ' ' +const ESCAPE = '\\' +const REGEX_TEST_BLANK_LINE = /^\s+$/ +const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/ +const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/ +const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/ +const REGEX_SPLITALL_CRLF = /\r?\n/g +// /foo, +// ./foo, +// ../foo, +// . +// .. +const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/ + +const SLASH = '/' + +// Do not use ternary expression here, since "istanbul ignore next" is buggy +let TMP_KEY_IGNORE = 'node-ignore' +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol.for('node-ignore') +} +const KEY_IGNORE = TMP_KEY_IGNORE + +const define = (object, key, value) => + Object.defineProperty(object, key, {value}) + +const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g + +const RETURN_FALSE = () => false + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +const sanitizeRange = range => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) + ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : EMPTY +) + +// See fixtures #59 +const cleanRangeBackSlash = slashes => { + const {length} = slashes + return slashes.slice(0, length - length % 2) +} + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +const REPLACERS = [ + + [ + // remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], + + // > Trailing spaces are ignored unless they are quoted with backslash ("\") + [ + // (a\ ) -> (a ) + // (a ) -> (a) + // (a ) -> (a) + // (a \ ) -> (a ) + /((?:\\\\)*?)(\\?\s+)$/, + (_, m1, m2) => m1 + ( + m2.indexOf('\\') === 0 + ? SPACE + : EMPTY + ) + ], + + // replace (\ ) with ' ' + // (\ ) -> ' ' + // (\\ ) -> '\\ ' + // (\\\ ) -> '\\ ' + [ + /(\\+?)\s/g, + (_, m1) => { + const {length} = m1 + return m1.slice(0, length - length % 2) + SPACE + } + ], + + // Escape metacharacters + // which is written down by users but means special for regular expressions. + + // > There are 12 characters with special meanings: + // > - the backslash \, + // > - the caret ^, + // > - the dollar sign $, + // > - the period or dot ., + // > - the vertical bar or pipe symbol |, + // > - the question mark ?, + // > - the asterisk or star *, + // > - the plus sign +, + // > - the opening parenthesis (, + // > - the closing parenthesis ), + // > - and the opening square bracket [, + // > - the opening curly brace {, + // > These special characters are often called "metacharacters". + [ + /[\\$.|*+(){^]/g, + match => `\\${match}` + ], + + [ + // > a question mark (?) matches a single character + /(?!\\)\?/g, + () => '[^/]' + ], + + // leading slash + [ + + // > A leading slash matches the beginning of the pathname. + // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". + // A leading slash matches the beginning of the pathname + /^\//, + () => '^' + ], + + // replace special metacharacter slash after the leading slash + [ + /\//g, + () => '\\/' + ], + + [ + // > A leading "**" followed by a slash means match in all directories. + // > For example, "**/foo" matches file or directory "foo" anywhere, + // > the same as pattern "foo". + // > "**/foo/bar" matches file or directory "bar" anywhere that is directly + // > under directory "foo". + // Notice that the '*'s have been replaced as '\\*' + /^\^*\\\*\\\*\\\//, + + // '**/foo' <-> 'foo' + () => '^(?:.*\\/)?' + ], + + // starting + [ + // there will be no leading '/' + // (which has been replaced by section "leading slash") + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^^])/, + function startingReplacer () { + // If has a slash `/` at the beginning or middle + return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + + // After 2.22.1 (compatible but clearer) + // > If there is a separator at the beginning or middle (or both) + // > of the pattern, then the pattern is relative to the directory + // > level of the particular .gitignore file itself. + // > Otherwise the pattern may also match at any level below + // > the .gitignore level. + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^' + } + ], + + // two globstars + [ + // Use lookahead assertions so that we could match more than one `'/**'` + /\\\/\\\*\\\*(?=\\\/|$)/g, + + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + + // Check if it is not the last `'/**'` + (_, index, str) => index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+' + ], + + // normal intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + + // 'abc.*/' -> go + // 'abc.*' -> skip this rule, + // coz trailing single wildcard will be handed by [trailing wildcard] + /(^|[^\\]+)(\\\*)+(?=.+)/g, + + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + (_, p1, p2) => { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + const unescaped = p2.replace(/\\\*/g, '[^\\/]*') + return p1 + unescaped + } + ], + + [ + // unescape, revert step 3 except for back slash + // For example, if a user escape a '\\*', + // after step 3, the result will be '\\\\\\*' + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE + ], + + [ + // '\\\\' -> '\\' + /\\\\/g, + () => ESCAPE + ], + + [ + // > The range notation, e.g. [a-zA-Z], + // > can be used to match one of the characters in a range. + + // `\` is escaped by step 3 + /(\\)?\[([^\]/]*?)(\\*)($|\])/g, + (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE + // '\\[bar]' -> '\\\\[bar\\]' + ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` + : close === ']' + ? endEscape.length % 2 === 0 + // A normal case, and it is a range notation + // '[bar]' + // '[bar\\\\]' + ? `[${sanitizeRange(range)}${endEscape}]` + // Invalid range notaton + // '[bar\\]' -> '[bar\\\\]' + : '[]' + : '[]' + ], + + // ending + [ + // 'js' will not match 'js.' + // 'ab' will not match 'abc' + /(?:[^*])$/, + + // WTF! + // https://git-scm.com/docs/gitignore + // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) + // which re-fixes #24, #38 + + // > If there is a separator at the end of the pattern then the pattern + // > will only match directories, otherwise the pattern can match both + // > files and directories. + + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + match => /\/$/.test(match) + // foo/ will not match 'foo' + ? `${match}$` + // foo matches 'foo' and 'foo/' + : `${match}(?=$|\\/$)` + ], + + // trailing wildcard + [ + /(\^|\\\/)?\\\*$/, + (_, p1) => { + const prefix = p1 + // '\^': + // '/*' does not match EMPTY + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*' + + return `${prefix}(?=$|\\/$)` + } + ], +] + +// A simple cache, because an ignore rule only has only one certain meaning +const regexCache = Object.create(null) + +// @param {pattern} +const makeRegex = (pattern, ignoreCase) => { + let source = regexCache[pattern] + + if (!source) { + source = REPLACERS.reduce( + (prev, [matcher, replacer]) => + prev.replace(matcher, replacer.bind(pattern)), + pattern + ) + regexCache[pattern] = source + } + + return ignoreCase + ? new RegExp(source, 'i') + : new RegExp(source) +} + +const isString = subject => typeof subject === 'string' + +// > A blank line matches no files, so it can serve as a separator for readability. +const checkPattern = pattern => pattern + && isString(pattern) + && !REGEX_TEST_BLANK_LINE.test(pattern) + && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0 + +const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF) + +class IgnoreRule { + constructor ( + origin, + pattern, + negative, + regex + ) { + this.origin = origin + this.pattern = pattern + this.negative = negative + this.regex = regex + } +} + +const createRule = (pattern, ignoreCase) => { + const origin = pattern + let negative = false + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true + pattern = pattern.substr(1) + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#') + + const regex = makeRegex(pattern, ignoreCase) + + return new IgnoreRule( + origin, + pattern, + negative, + regex + ) +} + +const throwError = (message, Ctor) => { + throw new Ctor(message) +} + +const checkPath = (path, originalPath, doThrow) => { + if (!isString(path)) { + return doThrow( + `path must be a string, but got \`${originalPath}\``, + TypeError + ) + } + + // We don't know if we should ignore EMPTY, so throw + if (!path) { + return doThrow(`path must not be empty`, TypeError) + } + + // Check if it is a relative path + if (checkPath.isNotRelative(path)) { + const r = '`path.relative()`d' + return doThrow( + `path should be a ${r} string, but got "${originalPath}"`, + RangeError + ) + } + + return true +} + +const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path) + +checkPath.isNotRelative = isNotRelative +checkPath.convert = p => p + +class Ignore { + constructor ({ + ignorecase = true, + ignoreCase = ignorecase, + allowRelativePaths = false + } = {}) { + define(this, KEY_IGNORE, true) + + this._rules = [] + this._ignoreCase = ignoreCase + this._allowRelativePaths = allowRelativePaths + this._initCache() + } + + _initCache () { + this._ignoreCache = Object.create(null) + this._testCache = Object.create(null) + } + + _addPattern (pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules) + this._added = true + return + } + + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignoreCase) + this._added = true + this._rules.push(rule) + } + } + + // @param {Array | string | Ignore} pattern + add (pattern) { + this._added = false + + makeArray( + isString(pattern) + ? splitPattern(pattern) + : pattern + ).forEach(this._addPattern, this) + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache() + } + + return this + } + + // legacy + addPattern (pattern) { + return this.add(pattern) + } + + // | ignored : unignored + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X + + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen + + // @param {boolean} whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + + // @returns {TestResult} true if a file is ignored + _testOne (path, checkUnignored) { + let ignored = false + let unignored = false + + this._rules.forEach(rule => { + const {negative} = rule + if ( + unignored === negative && ignored !== unignored + || negative && !ignored && !unignored && !checkUnignored + ) { + return + } + + const matched = rule.regex.test(path) + + if (matched) { + ignored = !negative + unignored = negative + } + }) + + return { + ignored, + unignored + } + } + + // @returns {TestResult} + _test (originalPath, cache, checkUnignored, slices) { + const path = originalPath + // Supports nullable path + && checkPath.convert(originalPath) + + checkPath( + path, + originalPath, + this._allowRelativePaths + ? RETURN_FALSE + : throwError + ) + + return this._t(path, cache, checkUnignored, slices) + } + + _t (path, cache, checkUnignored, slices) { + if (path in cache) { + return cache[path] + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH) + } + + slices.pop() + + // If the path has no parent directory, just test it + if (!slices.length) { + return cache[path] = this._testOne(path, checkUnignored) + } + + const parent = this._t( + slices.join(SLASH) + SLASH, + cache, + checkUnignored, + slices + ) + + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + ? parent + : this._testOne(path, checkUnignored) + } + + ignores (path) { + return this._test(path, this._ignoreCache, false).ignored + } + + createFilter () { + return path => !this.ignores(path) + } + + filter (paths) { + return makeArray(paths).filter(this.createFilter()) + } + + // @returns {TestResult} + test (path) { + return this._test(path, this._testCache, true) + } +} + +const factory = options => new Ignore(options) + +const isPathValid = path => + checkPath(path && checkPath.convert(path), path, RETURN_FALSE) + +factory.isPathValid = isPathValid + +// Fixes typescript +factory.default = factory + +module.exports = factory + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ +if ( + // Detect `process` so that it can run in browsers. + typeof process !== 'undefined' + && ( + process.env && process.env.IGNORE_TEST_WIN32 + || process.platform === 'win32' + ) +) { + /* eslint no-control-regex: "off" */ + const makePosix = str => /^\\\\\?\\/.test(str) + || /["<>|\u0000-\u001F]+/u.test(str) + ? str + : str.replace(/\\/g, '/') + + checkPath.convert = makePosix + + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'd:\\foo' + const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i + checkPath.isNotRelative = path => + REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) + || isNotRelative(path) +} diff --git a/node_modules/ignore/legacy.js b/node_modules/ignore/legacy.js new file mode 100644 index 0000000..de3f66c --- /dev/null +++ b/node_modules/ignore/legacy.js @@ -0,0 +1,559 @@ +"use strict"; + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +// A simple implementation of make-array +function makeArray(subject) { + return Array.isArray(subject) ? subject : [subject]; +} +var EMPTY = ''; +var SPACE = ' '; +var ESCAPE = '\\'; +var REGEX_TEST_BLANK_LINE = /^\s+$/; +var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; +var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; +var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; +var REGEX_SPLITALL_CRLF = /\r?\n/g; +// /foo, +// ./foo, +// ../foo, +// . +// .. +var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; +var SLASH = '/'; + +// Do not use ternary expression here, since "istanbul ignore next" is buggy +var TMP_KEY_IGNORE = 'node-ignore'; +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol["for"]('node-ignore'); +} +var KEY_IGNORE = TMP_KEY_IGNORE; +var define = function define(object, key, value) { + return Object.defineProperty(object, key, { + value: value + }); +}; +var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; +var RETURN_FALSE = function RETURN_FALSE() { + return false; +}; + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +var sanitizeRange = function sanitizeRange(range) { + return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) { + return from.charCodeAt(0) <= to.charCodeAt(0) ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : EMPTY; + }); +}; + +// See fixtures #59 +var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) { + var length = slashes.length; + return slashes.slice(0, length - length % 2); +}; + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +var REPLACERS = [[ +// remove BOM +// TODO: +// Other similar zero-width characters? +/^\uFEFF/, function () { + return EMPTY; +}], +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) +// (a ) -> (a) +// (a ) -> (a) +// (a \ ) -> (a ) +/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) { + return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY); +}], +// replace (\ ) with ' ' +// (\ ) -> ' ' +// (\\ ) -> '\\ ' +// (\\\ ) -> '\\ ' +[/(\\+?)\s/g, function (_, m1) { + var length = m1.length; + return m1.slice(0, length - length % 2) + SPACE; +}], +// Escape metacharacters +// which is written down by users but means special for regular expressions. + +// > There are 12 characters with special meanings: +// > - the backslash \, +// > - the caret ^, +// > - the dollar sign $, +// > - the period or dot ., +// > - the vertical bar or pipe symbol |, +// > - the question mark ?, +// > - the asterisk or star *, +// > - the plus sign +, +// > - the opening parenthesis (, +// > - the closing parenthesis ), +// > - and the opening square bracket [, +// > - the opening curly brace {, +// > These special characters are often called "metacharacters". +[/[\\$.|*+(){^]/g, function (match) { + return "\\".concat(match); +}], [ +// > a question mark (?) matches a single character +/(?!\\)\?/g, function () { + return '[^/]'; +}], +// leading slash +[ +// > A leading slash matches the beginning of the pathname. +// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// A leading slash matches the beginning of the pathname +/^\//, function () { + return '^'; +}], +// replace special metacharacter slash after the leading slash +[/\//g, function () { + return '\\/'; +}], [ +// > A leading "**" followed by a slash means match in all directories. +// > For example, "**/foo" matches file or directory "foo" anywhere, +// > the same as pattern "foo". +// > "**/foo/bar" matches file or directory "bar" anywhere that is directly +// > under directory "foo". +// Notice that the '*'s have been replaced as '\\*' +/^\^*\\\*\\\*\\\//, +// '**/foo' <-> 'foo' +function () { + return '^(?:.*\\/)?'; +}], +// starting +[ +// there will be no leading '/' +// (which has been replaced by section "leading slash") +// If starts with '**', adding a '^' to the regular expression also works +/^(?=[^^])/, function startingReplacer() { + // If has a slash `/` at the beginning or middle + return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + + // After 2.22.1 (compatible but clearer) + // > If there is a separator at the beginning or middle (or both) + // > of the pattern, then the pattern is relative to the directory + // > level of the particular .gitignore file itself. + // > Otherwise the pattern may also match at any level below + // > the .gitignore level. + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^'; +}], +// two globstars +[ +// Use lookahead assertions so that we could match more than one `'/**'` +/\\\/\\\*\\\*(?=\\\/|$)/g, +// Zero, one or several directories +// should not use '*', or it will be replaced by the next replacer + +// Check if it is not the last `'/**'` +function (_, index, str) { + return index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+'; +}], +// normal intermediate wildcards +[ +// Never replace escaped '*' +// ignore rule '\*' will match the path '*' + +// 'abc.*/' -> go +// 'abc.*' -> skip this rule, +// coz trailing single wildcard will be handed by [trailing wildcard] +/(^|[^\\]+)(\\\*)+(?=.+)/g, +// '*.js' matches '.js' +// '*.js' doesn't match 'abc' +function (_, p1, p2) { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + var unescaped = p2.replace(/\\\*/g, '[^\\/]*'); + return p1 + unescaped; +}], [ +// unescape, revert step 3 except for back slash +// For example, if a user escape a '\\*', +// after step 3, the result will be '\\\\\\*' +/\\\\\\(?=[$.|*+(){^])/g, function () { + return ESCAPE; +}], [ +// '\\\\' -> '\\' +/\\\\/g, function () { + return ESCAPE; +}], [ +// > The range notation, e.g. [a-zA-Z], +// > can be used to match one of the characters in a range. + +// `\` is escaped by step 3 +/(\\)?\[([^\]/]*?)(\\*)($|\])/g, function (match, leadEscape, range, endEscape, close) { + return leadEscape === ESCAPE + // '\\[bar]' -> '\\\\[bar\\]' + ? "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close) : close === ']' ? endEscape.length % 2 === 0 + // A normal case, and it is a range notation + // '[bar]' + // '[bar\\\\]' + ? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton + // '[bar\\]' -> '[bar\\\\]' + : '[]' : '[]'; +}], +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*])$/, +// WTF! +// https://git-scm.com/docs/gitignore +// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) +// which re-fixes #24, #38 + +// > If there is a separator at the end of the pattern then the pattern +// > will only match directories, otherwise the pattern can match both +// > files and directories. + +// 'js*' will not match 'a.js' +// 'js/' will not match 'a.js' +// 'js' will match 'a.js' and 'a.js/' +function (match) { + return /\/$/.test(match) + // foo/ will not match 'foo' + ? "".concat(match, "$") // foo matches 'foo' and 'foo/' + : "".concat(match, "(?=$|\\/$)"); +}], +// trailing wildcard +[/(\^|\\\/)?\\\*$/, function (_, p1) { + var prefix = p1 + // '\^': + // '/*' does not match EMPTY + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? "".concat(p1, "[^/]+") // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*'; + return "".concat(prefix, "(?=$|\\/$)"); +}]]; + +// A simple cache, because an ignore rule only has only one certain meaning +var regexCache = Object.create(null); + +// @param {pattern} +var makeRegex = function makeRegex(pattern, ignoreCase) { + var source = regexCache[pattern]; + if (!source) { + source = REPLACERS.reduce(function (prev, _ref) { + var _ref2 = _slicedToArray(_ref, 2), + matcher = _ref2[0], + replacer = _ref2[1]; + return prev.replace(matcher, replacer.bind(pattern)); + }, pattern); + regexCache[pattern] = source; + } + return ignoreCase ? new RegExp(source, 'i') : new RegExp(source); +}; +var isString = function isString(subject) { + return typeof subject === 'string'; +}; + +// > A blank line matches no files, so it can serve as a separator for readability. +var checkPattern = function checkPattern(pattern) { + return pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0; +}; +var splitPattern = function splitPattern(pattern) { + return pattern.split(REGEX_SPLITALL_CRLF); +}; +var IgnoreRule = /*#__PURE__*/_createClass(function IgnoreRule(origin, pattern, negative, regex) { + _classCallCheck(this, IgnoreRule); + this.origin = origin; + this.pattern = pattern; + this.negative = negative; + this.regex = regex; +}); +var createRule = function createRule(pattern, ignoreCase) { + var origin = pattern; + var negative = false; + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true; + pattern = pattern.substr(1); + } + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#'); + var regex = makeRegex(pattern, ignoreCase); + return new IgnoreRule(origin, pattern, negative, regex); +}; +var throwError = function throwError(message, Ctor) { + throw new Ctor(message); +}; +var checkPath = function checkPath(path, originalPath, doThrow) { + if (!isString(path)) { + return doThrow("path must be a string, but got `".concat(originalPath, "`"), TypeError); + } + + // We don't know if we should ignore EMPTY, so throw + if (!path) { + return doThrow("path must not be empty", TypeError); + } + + // Check if it is a relative path + if (checkPath.isNotRelative(path)) { + var r = '`path.relative()`d'; + return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError); + } + return true; +}; +var isNotRelative = function isNotRelative(path) { + return REGEX_TEST_INVALID_PATH.test(path); +}; +checkPath.isNotRelative = isNotRelative; +checkPath.convert = function (p) { + return p; +}; +var Ignore = /*#__PURE__*/function () { + function Ignore() { + var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref3$ignorecase = _ref3.ignorecase, + ignorecase = _ref3$ignorecase === void 0 ? true : _ref3$ignorecase, + _ref3$ignoreCase = _ref3.ignoreCase, + ignoreCase = _ref3$ignoreCase === void 0 ? ignorecase : _ref3$ignoreCase, + _ref3$allowRelativePa = _ref3.allowRelativePaths, + allowRelativePaths = _ref3$allowRelativePa === void 0 ? false : _ref3$allowRelativePa; + _classCallCheck(this, Ignore); + define(this, KEY_IGNORE, true); + this._rules = []; + this._ignoreCase = ignoreCase; + this._allowRelativePaths = allowRelativePaths; + this._initCache(); + } + _createClass(Ignore, [{ + key: "_initCache", + value: function _initCache() { + this._ignoreCache = Object.create(null); + this._testCache = Object.create(null); + } + }, { + key: "_addPattern", + value: function _addPattern(pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + if (checkPattern(pattern)) { + var rule = createRule(pattern, this._ignoreCase); + this._added = true; + this._rules.push(rule); + } + } + + // @param {Array | string | Ignore} pattern + }, { + key: "add", + value: function add(pattern) { + this._added = false; + makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this); + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache(); + } + return this; + } + + // legacy + }, { + key: "addPattern", + value: function addPattern(pattern) { + return this.add(pattern); + } + + // | ignored : unignored + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X + + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen + + // @param {boolean} whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + + // @returns {TestResult} true if a file is ignored + }, { + key: "_testOne", + value: function _testOne(path, checkUnignored) { + var ignored = false; + var unignored = false; + this._rules.forEach(function (rule) { + var negative = rule.negative; + if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { + return; + } + var matched = rule.regex.test(path); + if (matched) { + ignored = !negative; + unignored = negative; + } + }); + return { + ignored: ignored, + unignored: unignored + }; + } + + // @returns {TestResult} + }, { + key: "_test", + value: function _test(originalPath, cache, checkUnignored, slices) { + var path = originalPath + // Supports nullable path + && checkPath.convert(originalPath); + checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError); + return this._t(path, cache, checkUnignored, slices); + } + }, { + key: "_t", + value: function _t(path, cache, checkUnignored, slices) { + if (path in cache) { + return cache[path]; + } + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH); + } + slices.pop(); + + // If the path has no parent directory, just test it + if (!slices.length) { + return cache[path] = this._testOne(path, checkUnignored); + } + var parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices); + + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + ? parent : this._testOne(path, checkUnignored); + } + }, { + key: "ignores", + value: function ignores(path) { + return this._test(path, this._ignoreCache, false).ignored; + } + }, { + key: "createFilter", + value: function createFilter() { + var _this = this; + return function (path) { + return !_this.ignores(path); + }; + } + }, { + key: "filter", + value: function filter(paths) { + return makeArray(paths).filter(this.createFilter()); + } + + // @returns {TestResult} + }, { + key: "test", + value: function test(path) { + return this._test(path, this._testCache, true); + } + }]); + return Ignore; +}(); +var factory = function factory(options) { + return new Ignore(options); +}; +var isPathValid = function isPathValid(path) { + return checkPath(path && checkPath.convert(path), path, RETURN_FALSE); +}; +factory.isPathValid = isPathValid; + +// Fixes typescript +factory["default"] = factory; +module.exports = factory; + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ +if ( +// Detect `process` so that it can run in browsers. +typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) { + /* eslint no-control-regex: "off" */ + var makePosix = function makePosix(str) { + return /^\\\\\?\\/.test(str) || /[\0-\x1F"<>\|]+/.test(str) ? str : str.replace(/\\/g, '/'); + }; + checkPath.convert = makePosix; + + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'd:\\foo' + var REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; + checkPath.isNotRelative = function (path) { + return REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path); + }; +} diff --git a/node_modules/ignore/package.json b/node_modules/ignore/package.json new file mode 100644 index 0000000..b7f684e --- /dev/null +++ b/node_modules/ignore/package.json @@ -0,0 +1,74 @@ +{ + "name": "ignore", + "version": "5.3.2", + "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.", + "files": [ + "legacy.js", + "index.js", + "index.d.ts", + "LICENSE-MIT" + ], + "scripts": { + "prepublishOnly": "npm run build", + "build": "babel -o legacy.js index.js", + "test:lint": "eslint .", + "test:tsc": "tsc ./test/ts/simple.ts --lib ES6", + "test:ts": "node ./test/ts/simple.js", + "tap": "tap --reporter classic", + "test:git": "npm run tap test/git-check-ignore.js", + "test:ignore": "npm run tap test/ignore.js", + "test:ignore:only": "IGNORE_ONLY_IGNORES=1 npm run tap test/ignore.js", + "test:others": "npm run tap test/others.js", + "test:cases": "npm run tap test/*.js -- --coverage", + "test:no-coverage": "npm run tap test/*.js -- --no-check-coverage", + "test:only": "npm run test:lint && npm run test:tsc && npm run test:ts && npm run test:cases", + "test": "npm run test:only", + "test:win32": "IGNORE_TEST_WIN32=1 npm run test", + "report": "tap --coverage-report=html", + "posttest": "npm run report && codecov" + }, + "repository": { + "type": "git", + "url": "git@github.com:kaelzhang/node-ignore.git" + }, + "keywords": [ + "ignore", + ".gitignore", + "gitignore", + "npmignore", + "rules", + "manager", + "filter", + "regexp", + "regex", + "fnmatch", + "glob", + "asterisks", + "regular-expression" + ], + "author": "kael", + "license": "MIT", + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" + }, + "devDependencies": { + "@babel/cli": "^7.22.9", + "@babel/core": "^7.22.9", + "@babel/preset-env": "^7.22.9", + "codecov": "^3.8.2", + "debug": "^4.3.4", + "eslint": "^8.46.0", + "eslint-config-ostai": "^3.0.0", + "eslint-plugin-import": "^2.28.0", + "mkdirp": "^3.0.1", + "pre-suf": "^1.1.1", + "rimraf": "^6.0.1", + "spawn-sync": "^2.0.0", + "tap": "^16.3.9", + "tmp": "0.2.3", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">= 4" + } +} diff --git a/node_modules/import-fresh/index.js b/node_modules/import-fresh/index.js new file mode 100644 index 0000000..1bed876 --- /dev/null +++ b/node_modules/import-fresh/index.js @@ -0,0 +1,34 @@ +'use strict'; +const path = require('path'); +const resolveFrom = require('resolve-from'); +const parentModule = require('parent-module'); + +module.exports = moduleId => { + if (typeof moduleId !== 'string') { + throw new TypeError('Expected a string'); + } + + const parentPath = parentModule(__filename); + + const cwd = parentPath ? path.dirname(parentPath) : __dirname; + const filePath = resolveFrom(cwd, moduleId); + + const oldModule = require.cache[filePath]; + // Delete itself from module parent + if (oldModule && oldModule.parent) { + let i = oldModule.parent.children.length; + + while (i--) { + if (oldModule.parent.children[i].id === filePath) { + oldModule.parent.children.splice(i, 1); + } + } + } + + delete require.cache[filePath]; // Delete module from cache + + const parent = require.cache[parentPath]; // If `filePath` and `parentPath` are the same, cache will already be deleted so we won't get a memory leak in next step + + // In case cache doesn't have parent, fall back to normal require + return parent === undefined || parent.require === undefined ? require(filePath) : parent.require(filePath); +}; diff --git a/node_modules/import-fresh/license b/node_modules/import-fresh/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/import-fresh/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/import-fresh/package.json b/node_modules/import-fresh/package.json new file mode 100644 index 0000000..4e8b841 --- /dev/null +++ b/node_modules/import-fresh/package.json @@ -0,0 +1,48 @@ +{ + "name": "import-fresh", + "version": "3.3.1", + "description": "Import a module while bypassing the cache", + "license": "MIT", + "repository": "sindresorhus/import-fresh", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "sideEffects": false, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd", + "heapdump": "node heapdump.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "require", + "cache", + "uncache", + "uncached", + "module", + "fresh", + "bypass" + ], + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.0.1", + "heapdump": "^0.3.12", + "tsd": "^0.7.3", + "xo": "^0.23.0" + } +} diff --git a/node_modules/import-fresh/readme.md b/node_modules/import-fresh/readme.md new file mode 100644 index 0000000..a868bc6 --- /dev/null +++ b/node_modules/import-fresh/readme.md @@ -0,0 +1,54 @@ +# import-fresh + +> Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching) + +Useful for testing purposes when you need to freshly import a module. + +## ESM + +For ESM, you can use this snippet: + +```js +const importFresh = moduleName => import(`${moduleName}?${Date.now()}`); + +const {default: foo} = await importFresh('foo'); +``` + +**This snippet causes a memory leak, so only use it for short-lived tests.** + +## Install + +```sh +npm install import-fresh +``` + +## Usage + +```js +// foo.js +let i = 0; +module.exports = () => ++i; +``` + +```js +const importFresh = require('import-fresh'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +importFresh('./foo')(); +//=> 1 + +importFresh('./foo')(); +//=> 1 +``` + +## Related + +- [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache +- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path +- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory +- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily diff --git a/node_modules/imurmurhash/README.md b/node_modules/imurmurhash/README.md new file mode 100644 index 0000000..f35b20a --- /dev/null +++ b/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/imurmurhash/imurmurhash.js b/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 0000000..e63146a --- /dev/null +++ b/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/node_modules/imurmurhash/imurmurhash.min.js b/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 0000000..dc0ee88 --- /dev/null +++ b/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/node_modules/imurmurhash/package.json b/node_modules/imurmurhash/package.json new file mode 100644 index 0000000..8a93edb --- /dev/null +++ b/node_modules/imurmurhash/package.json @@ -0,0 +1,40 @@ +{ + "name": "imurmurhash", + "version": "0.1.4", + "description": "An incremental implementation of MurmurHash3", + "homepage": "https://github.com/jensyt/imurmurhash-js", + "main": "imurmurhash.js", + "files": [ + "imurmurhash.js", + "imurmurhash.min.js", + "package.json", + "README.md" + ], + "repository": { + "type": "git", + "url": "https://github.com/jensyt/imurmurhash-js" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "keywords": [ + "murmur", + "murmurhash", + "murmurhash3", + "hash", + "incremental" + ], + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, + "license": "MIT", + "dependencies": { + }, + "devDependencies": { + }, + "engines": { + "node": ">=0.8.19" + } +} diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE new file mode 100644 index 0000000..842218c --- /dev/null +++ b/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-extglob/README.md b/node_modules/is-extglob/README.md new file mode 100644 index 0000000..0416af5 --- /dev/null +++ b/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js new file mode 100644 index 0000000..c1d986f --- /dev/null +++ b/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json new file mode 100644 index 0000000..7a90836 --- /dev/null +++ b/node_modules/is-extglob/package.json @@ -0,0 +1,69 @@ +{ + "name": "is-extglob", + "description": "Returns true if a string has an extglob.", + "version": "2.1.1", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extglob", + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md new file mode 100644 index 0000000..740724b --- /dev/null +++ b/node_modules/is-glob/README.md @@ -0,0 +1,206 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +### Default behavior + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob('abc/?.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +### Option strict + +When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that +some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js', {strict: false}); +isGlob('*.js', {strict: false}); +isGlob('**/abc.js', {strict: false}); +isGlob('abc/*.js', {strict: false}); +isGlob('abc/(aaa|bbb).js', {strict: false}); +isGlob('abc/[a-z].js', {strict: false}); +isGlob('abc/{a,b}.js', {strict: false}); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js', {strict: false}); +isGlob('abc/!(a).js', {strict: false}); +isGlob('abc/+(a).js', {strict: false}); +isGlob('abc/*(a).js', {strict: false}); +isGlob('abc/?(a).js', {strict: false}); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('\\!foo.js', {strict: false}); +isGlob('\\*.js', {strict: false}); +isGlob('\\*\\*/abc.js', {strict: false}); +isGlob('abc/\\*.js', {strict: false}); +isGlob('abc/\\(aaa|bbb).js', {strict: false}); +isGlob('abc/\\[a-z].js', {strict: false}); +isGlob('abc/\\{a,b}.js', {strict: false}); +//=> false +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [doowb](https://github.com/doowb) | +| 1 | [phated](https://github.com/phated) | +| 1 | [danhper](https://github.com/danhper) | +| 1 | [paulmillr](https://github.com/paulmillr) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js new file mode 100644 index 0000000..620f563 --- /dev/null +++ b/node_modules/is-glob/index.js @@ -0,0 +1,150 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = require('is-extglob'); +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +module.exports = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); +}; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json new file mode 100644 index 0000000..858af03 --- /dev/null +++ b/node_modules/is-glob/package.json @@ -0,0 +1,81 @@ +{ + "name": "is-glob", + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "version": "4.0.3", + "homepage": "https://github.com/micromatch/is-glob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Daniel Perez (https://tuvistavie.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/is-glob", + "bugs": { + "url": "https://github.com/micromatch/is-glob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha && node benchmark.js" + }, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + } +} diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE new file mode 100644 index 0000000..9af4a67 --- /dev/null +++ b/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-number/README.md b/node_modules/is-number/README.md new file mode 100644 index 0000000..eb8149e --- /dev/null +++ b/node_modules/is-number/README.md @@ -0,0 +1,187 @@ +# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a finite number. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-number +``` + +## Why is this needed? + +In JavaScript, it's not always as straightforward as it should be to reliably check if a value is a number. It's common for devs to use `+`, `-`, or `Number()` to cast a string value to a number (for example, when values are returned from user input, regex matches, parsers, etc). But there are many non-intuitive edge cases that yield unexpected results: + +```js +console.log(+[]); //=> 0 +console.log(+''); //=> 0 +console.log(+' '); //=> 0 +console.log(typeof NaN); //=> 'number' +``` + +This library offers a performant way to smooth out edge cases like these. + +## Usage + +```js +const isNumber = require('is-number'); +``` + +See the [tests](./test.js) for more examples. + +### true + +```js +isNumber(5e3); // true +isNumber(0xff); // true +isNumber(-1.1); // true +isNumber(0); // true +isNumber(1); // true +isNumber(1.1); // true +isNumber(10); // true +isNumber(10.10); // true +isNumber(100); // true +isNumber('-1.1'); // true +isNumber('0'); // true +isNumber('012'); // true +isNumber('0xff'); // true +isNumber('1'); // true +isNumber('1.1'); // true +isNumber('10'); // true +isNumber('10.10'); // true +isNumber('100'); // true +isNumber('5e3'); // true +isNumber(parseInt('012')); // true +isNumber(parseFloat('012')); // true +``` + +### False + +Everything else is false, as you would expect: + +```js +isNumber(Infinity); // false +isNumber(NaN); // false +isNumber(null); // false +isNumber(undefined); // false +isNumber(''); // false +isNumber(' '); // false +isNumber('foo'); // false +isNumber([1]); // false +isNumber([]); // false +isNumber(function () {}); // false +isNumber({}); // false +``` + +## Release history + +### 7.0.0 + +* Refactor. Now uses `.isFinite` if it exists. +* Performance is about the same as v6.0 when the value is a string or number. But it's now 3x-4x faster when the value is not a string or number. + +### 6.0.0 + +* Optimizations, thanks to @benaadams. + +### 5.0.0 + +**Breaking changes** + +* removed support for `instanceof Number` and `instanceof String` + +## Benchmarks + +As with all benchmarks, take these with a grain of salt. See the [benchmarks](./benchmark/index.js) for more detail. + +``` +# all +v7.0 x 413,222 ops/sec ±2.02% (86 runs sampled) +v6.0 x 111,061 ops/sec ±1.29% (85 runs sampled) +parseFloat x 317,596 ops/sec ±1.36% (86 runs sampled) +fastest is 'v7.0' + +# string +v7.0 x 3,054,496 ops/sec ±1.05% (89 runs sampled) +v6.0 x 2,957,781 ops/sec ±0.98% (88 runs sampled) +parseFloat x 3,071,060 ops/sec ±1.13% (88 runs sampled) +fastest is 'parseFloat,v7.0' + +# number +v7.0 x 3,146,895 ops/sec ±0.89% (89 runs sampled) +v6.0 x 3,214,038 ops/sec ±1.07% (89 runs sampled) +parseFloat x 3,077,588 ops/sec ±1.07% (87 runs sampled) +fastest is 'v6.0' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 49 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [charlike-old](https://github.com/charlike-old) | +| 1 | [benaadams](https://github.com/benaadams) | +| 1 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 15, 2018._ \ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js new file mode 100644 index 0000000..27f19b7 --- /dev/null +++ b/node_modules/is-number/index.js @@ -0,0 +1,18 @@ +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; +}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json new file mode 100644 index 0000000..3715072 --- /dev/null +++ b/node_modules/is-number/package.json @@ -0,0 +1,82 @@ +{ + "name": "is-number", + "description": "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.", + "version": "7.0.0", + "homepage": "https://github.com/jonschlinkert/is-number", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Olsten Larck (https://i.am.charlike.online)", + "Rouven Weßling (www.rouvenwessling.de)" + ], + "repository": "jonschlinkert/is-number", + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.12.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "keywords": [ + "cast", + "check", + "coerce", + "coercion", + "finite", + "integer", + "is", + "isnan", + "is-nan", + "is-num", + "is-number", + "isnumber", + "isfinite", + "istype", + "kind", + "math", + "nan", + "num", + "number", + "numeric", + "parseFloat", + "parseInt", + "test", + "type", + "typeof", + "value" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "related": { + "list": [ + "is-plain-object", + "is-primitive", + "isobject", + "kind-of" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/isexe/LICENSE b/node_modules/isexe/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/isexe/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/isexe/README.md b/node_modules/isexe/README.md new file mode 100644 index 0000000..35769e8 --- /dev/null +++ b/node_modules/isexe/README.md @@ -0,0 +1,51 @@ +# isexe + +Minimal module to check if a file is executable, and a normal file. + +Uses `fs.stat` and tests against the `PATHEXT` environment variable on +Windows. + +## USAGE + +```javascript +var isexe = require('isexe') +isexe('some-file-name', function (err, isExe) { + if (err) { + console.error('probably file does not exist or something', err) + } else if (isExe) { + console.error('this thing can be run') + } else { + console.error('cannot be run') + } +}) + +// same thing but synchronous, throws errors +var isExe = isexe.sync('some-file-name') + +// treat errors as just "not executable" +isexe('maybe-missing-file', { ignoreErrors: true }, callback) +var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) +``` + +## API + +### `isexe(path, [options], [callback])` + +Check if the path is executable. If no callback provided, and a +global `Promise` object is available, then a Promise will be returned. + +Will raise whatever errors may be raised by `fs.stat`, unless +`options.ignoreErrors` is set to true. + +### `isexe.sync(path, [options])` + +Same as `isexe` but returns the value and throws any errors raised. + +### Options + +* `ignoreErrors` Treat all errors as "no, this is not executable", but + don't raise them. +* `uid` Number to use as the user id +* `gid` Number to use as the group id +* `pathExt` List of path extensions to use instead of `PATHEXT` + environment variable on Windows. diff --git a/node_modules/isexe/index.js b/node_modules/isexe/index.js new file mode 100644 index 0000000..553fb32 --- /dev/null +++ b/node_modules/isexe/index.js @@ -0,0 +1,57 @@ +var fs = require('fs') +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = require('./windows.js') +} else { + core = require('./mode.js') +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } + + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } + + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false + } + } + cb(er, is) + }) +} + +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} diff --git a/node_modules/isexe/mode.js b/node_modules/isexe/mode.js new file mode 100644 index 0000000..1995ea4 --- /dev/null +++ b/node_modules/isexe/mode.js @@ -0,0 +1,41 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), options) +} + +function checkStat (stat, options) { + return stat.isFile() && checkMode(stat, options) +} + +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid + + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() + + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g + + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 + + return ret +} diff --git a/node_modules/isexe/package.json b/node_modules/isexe/package.json new file mode 100644 index 0000000..e452689 --- /dev/null +++ b/node_modules/isexe/package.json @@ -0,0 +1,31 @@ +{ + "name": "isexe", + "version": "2.0.0", + "description": "Minimal module to check if a file is executable.", + "main": "index.js", + "directories": { + "test": "test" + }, + "devDependencies": { + "mkdirp": "^0.5.1", + "rimraf": "^2.5.0", + "tap": "^10.3.0" + }, + "scripts": { + "test": "tap test/*.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/isexe.git" + }, + "keywords": [], + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" + }, + "homepage": "https://github.com/isaacs/isexe#readme" +} diff --git a/node_modules/isexe/test/basic.js b/node_modules/isexe/test/basic.js new file mode 100644 index 0000000..d926df6 --- /dev/null +++ b/node_modules/isexe/test/basic.js @@ -0,0 +1,221 @@ +var t = require('tap') +var fs = require('fs') +var path = require('path') +var fixture = path.resolve(__dirname, 'fixtures') +var meow = fixture + '/meow.cat' +var mine = fixture + '/mine.cat' +var ours = fixture + '/ours.cat' +var fail = fixture + '/fail.false' +var noent = fixture + '/enoent.exe' +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var isWindows = process.platform === 'win32' +var hasAccess = typeof fs.access === 'function' +var winSkip = isWindows && 'windows' +var accessSkip = !hasAccess && 'no fs.access function' +var hasPromise = typeof Promise === 'function' +var promiseSkip = !hasPromise && 'no global Promise' + +function reset () { + delete require.cache[require.resolve('../')] + return require('../') +} + +t.test('setup fixtures', function (t) { + rimraf.sync(fixture) + mkdirp.sync(fixture) + fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') + fs.chmodSync(meow, parseInt('0755', 8)) + fs.writeFileSync(fail, '#!/usr/bin/env false\n') + fs.chmodSync(fail, parseInt('0644', 8)) + fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') + fs.chmodSync(mine, parseInt('0744', 8)) + fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') + fs.chmodSync(ours, parseInt('0754', 8)) + t.end() +}) + +t.test('promise', { skip: promiseSkip }, function (t) { + var isexe = reset() + t.test('meow async', function (t) { + isexe(meow).then(function (is) { + t.ok(is) + t.end() + }) + }) + t.test('fail async', function (t) { + isexe(fail).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.test('noent async', function (t) { + isexe(noent).catch(function (er) { + t.ok(er) + t.end() + }) + }) + t.test('noent ignore async', function (t) { + isexe(noent, { ignoreErrors: true }).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.end() +}) + +t.test('no promise', function (t) { + global.Promise = null + var isexe = reset() + t.throws('try to meow a promise', function () { + isexe(meow) + }) + t.end() +}) + +t.test('access', { skip: accessSkip || winSkip }, function (t) { + runTest(t) +}) + +t.test('mode', { skip: winSkip }, function (t) { + delete fs.access + delete fs.accessSync + var isexe = reset() + t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) + t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) + runTest(t) +}) + +t.test('windows', function (t) { + global.TESTING_WINDOWS = true + var pathExt = '.EXE;.CAT;.CMD;.COM' + t.test('pathExt option', function (t) { + runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) + }) + t.test('pathExt env', function (t) { + process.env.PATHEXT = pathExt + runTest(t) + }) + t.test('no pathExt', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: '', skipFail: true }) + }) + t.test('pathext with empty entry', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: ';' + pathExt, skipFail: true }) + }) + t.end() +}) + +t.test('cleanup', function (t) { + rimraf.sync(fixture) + t.end() +}) + +function runTest (t, options) { + var isexe = reset() + + var optionsIgnore = Object.create(options || {}) + optionsIgnore.ignoreErrors = true + + if (!options || !options.skipFail) { + t.notOk(isexe.sync(fail, options)) + } + t.notOk(isexe.sync(noent, optionsIgnore)) + if (!options) { + t.ok(isexe.sync(meow)) + } else { + t.ok(isexe.sync(meow, options)) + } + + t.ok(isexe.sync(mine, options)) + t.ok(isexe.sync(ours, options)) + t.throws(function () { + isexe.sync(noent, options) + }) + + t.test('meow async', function (t) { + if (!options) { + isexe(meow, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } else { + isexe(meow, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } + }) + + t.test('mine async', function (t) { + isexe(mine, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + t.test('ours async', function (t) { + isexe(ours, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + if (!options || !options.skipFail) { + t.test('fail async', function (t) { + isexe(fail, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + } + + t.test('noent async', function (t) { + isexe(noent, options, function (er, is) { + t.ok(er) + t.notOk(is) + t.end() + }) + }) + + t.test('noent ignore async', function (t) { + isexe(noent, optionsIgnore, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.test('directory is not executable', function (t) { + isexe(__dirname, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.end() +} diff --git a/node_modules/isexe/windows.js b/node_modules/isexe/windows.js new file mode 100644 index 0000000..3499673 --- /dev/null +++ b/node_modules/isexe/windows.js @@ -0,0 +1,42 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT + + if (!pathext) { + return true + } + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } + } + return false +} + +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) +} diff --git a/node_modules/js-yaml/CHANGELOG.md b/node_modules/js-yaml/CHANGELOG.md new file mode 100644 index 0000000..ff2375e --- /dev/null +++ b/node_modules/js-yaml/CHANGELOG.md @@ -0,0 +1,616 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [4.1.0] - 2021-04-15 +### Added +- Types are now exported as `yaml.types.XXX`. +- Every type now has `options` property with original arguments kept as they were + (see `yaml.types.int.options` as an example). + +### Changed +- `Schema.extend()` now keeps old type order in case of conflicts + (e.g. Schema.extend([ a, b, c ]).extend([ b, a, d ]) is now ordered as `abcd` instead of `cbad`). + + +## [4.0.0] - 2021-01-03 +### Changed +- Check [migration guide](migrate_v3_to_v4.md) to see details for all breaking changes. +- Breaking: "unsafe" tags `!!js/function`, `!!js/regexp`, `!!js/undefined` are + moved to [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) package. +- Breaking: removed `safe*` functions. Use `load`, `loadAll`, `dump` + instead which are all now safe by default. +- `yaml.DEFAULT_SAFE_SCHEMA` and `yaml.DEFAULT_FULL_SCHEMA` are removed, use + `yaml.DEFAULT_SCHEMA` instead. +- `yaml.Schema.create(schema, tags)` is removed, use `schema.extend(tags)` instead. +- `!!binary` now always mapped to `Uint8Array` on load. +- Reduced nesting of `/lib` folder. +- Parse numbers according to YAML 1.2 instead of YAML 1.1 (`01234` is now decimal, + `0o1234` is octal, `1:23` is parsed as string instead of base60). +- `dump()` no longer quotes `:`, `[`, `]`, `(`, `)` except when necessary, #470, #557. +- Line and column in exceptions are now formatted as `(X:Y)` instead of + `at line X, column Y` (also present in compact format), #332. +- Code snippet created in exceptions now contains multiple lines with line numbers. +- `dump()` now serializes `undefined` as `null` in collections and removes keys with + `undefined` in mappings, #571. +- `dump()` with `skipInvalid=true` now serializes invalid items in collections as null. +- Custom tags starting with `!` are now dumped as `!tag` instead of `!`, #576. +- Custom tags starting with `tag:yaml.org,2002:` are now shorthanded using `!!`, #258. + +### Added +- Added `.mjs` (es modules) support. +- Added `quotingType` and `forceQuotes` options for dumper to configure + string literal style, #290, #529. +- Added `styles: { '!!null': 'empty' }` option for dumper + (serializes `{ foo: null }` as "`foo: `"), #570. +- Added `replacer` option (similar to option in JSON.stringify), #339. +- Custom `Tag` can now handle all tags or multiple tags with the same prefix, #385. + +### Fixed +- Astral characters are no longer encoded by `dump()`, #587. +- "duplicate mapping key" exception now points at the correct column, #452. +- Extra commas in flow collections (e.g. `[foo,,bar]`) now throw an exception + instead of producing null, #321. +- `__proto__` key no longer overrides object prototype, #164. +- Removed `bower.json`. +- Tags are now url-decoded in `load()` and url-encoded in `dump()` + (previously usage of custom non-ascii tags may have led to invalid YAML that can't be parsed). +- Anchors now work correctly with empty nodes, #301. +- Fix incorrect parsing of invalid block mapping syntax, #418. +- Throw an error if block sequence/mapping indent contains a tab, #80. + + +## [3.14.1] - 2020-12-07 +### Security +- Fix possible code execution in (already unsafe) `.load()` (in &anchor). + + +## [3.14.0] - 2020-05-22 +### Changed +- Support `safe/loadAll(input, options)` variant of call. +- CI: drop outdated nodejs versions. +- Dev deps bump. + +### Fixed +- Quote `=` in plain scalars #519. +- Check the node type for `!` tag in case user manually specifies it. +- Verify that there are no null-bytes in input. +- Fix wrong quote position when writing condensed flow, #526. + + +## [3.13.1] - 2019-04-05 +### Security +- Fix possible code execution in (already unsafe) `.load()`, #480. + + +## [3.13.0] - 2019-03-20 +### Security +- Security fix: `safeLoad()` can hang when arrays with nested refs + used as key. Now throws exception for nested arrays. #475. + + +## [3.12.2] - 2019-02-26 +### Fixed +- Fix `noArrayIndent` option for root level, #468. + + +## [3.12.1] - 2019-01-05 +### Added +- Added `noArrayIndent` option, #432. + + +## [3.12.0] - 2018-06-02 +### Changed +- Support arrow functions without a block statement, #421. + + +## [3.11.0] - 2018-03-05 +### Added +- Add arrow functions suport for `!!js/function`. + +### Fixed +- Fix dump in bin/octal/hex formats for negative integers, #399. + + +## [3.10.0] - 2017-09-10 +### Fixed +- Fix `condenseFlow` output (quote keys for sure, instead of spaces), #371, #370. +- Dump astrals as codepoints instead of surrogate pair, #368. + + +## [3.9.1] - 2017-07-08 +### Fixed +- Ensure stack is present for custom errors in node 7.+, #351. + + +## [3.9.0] - 2017-07-08 +### Added +- Add `condenseFlow` option (to create pretty URL query params), #346. + +### Fixed +- Support array return from safeLoadAll/loadAll, #350. + + +## [3.8.4] - 2017-05-08 +### Fixed +- Dumper: prevent space after dash for arrays that wrap, #343. + + +## [3.8.3] - 2017-04-05 +### Fixed +- Should not allow numbers to begin and end with underscore, #335. + + +## [3.8.2] - 2017-03-02 +### Fixed +- Fix `!!float 123` (integers) parse, #333. +- Don't allow leading zeros in floats (except 0, 0.xxx). +- Allow positive exponent without sign in floats. + + +## [3.8.1] - 2017-02-07 +### Changed +- Maintenance: update browserified build. + + +## [3.8.0] - 2017-02-07 +### Fixed +- Fix reported position for `duplicated mapping key` errors. + Now points to block start instead of block end. + (#243, thanks to @shockey). + + +## [3.7.0] - 2016-11-12 +### Added +- Support polymorphism for tags (#300, thanks to @monken). + +### Fixed +- Fix parsing of quotes followed by newlines (#304, thanks to @dplepage). + + +## [3.6.1] - 2016-05-11 +### Fixed +- Fix output cut on a pipe, #286. + + +## [3.6.0] - 2016-04-16 +### Fixed +- Dumper rewrite, fix multiple bugs with trailing `\n`. + Big thanks to @aepsilon! +- Loader: fix leading/trailing newlines in block scalars, @aepsilon. + + +## [3.5.5] - 2016-03-17 +### Fixed +- Date parse fix: don't allow dates with on digit in month and day, #268. + + +## [3.5.4] - 2016-03-09 +### Added +- `noCompatMode` for dumper, to disable quoting YAML 1.1 values. + + +## [3.5.3] - 2016-02-11 +### Changed +- Maintenance release. + + +## [3.5.2] - 2016-01-11 +### Changed +- Maintenance: missed comma in bower config. + + +## [3.5.1] - 2016-01-11 +### Changed +- Removed `inherit` dependency, #239. +- Better browserify workaround for esprima load. +- Demo rewrite. + + +## [3.5.0] - 2016-01-10 +### Fixed +- Dumper. Fold strings only, #217. +- Dumper. `norefs` option, to clone linked objects, #229. +- Loader. Throw a warning for duplicate keys, #166. +- Improved browserify support (mark `esprima` & `Buffer` excluded). + + +## [3.4.6] - 2015-11-26 +### Changed +- Use standalone `inherit` to keep browserified files clear. + + +## [3.4.5] - 2015-11-23 +### Added +- Added `lineWidth` option to dumper. + + +## [3.4.4] - 2015-11-21 +### Fixed +- Fixed floats dump (missed dot for scientific format), #220. +- Allow non-printable characters inside quoted scalars, #192. + + +## [3.4.3] - 2015-10-10 +### Changed +- Maintenance release - deps bump (esprima, argparse). + + +## [3.4.2] - 2015-09-09 +### Fixed +- Fixed serialization of duplicated entries in sequences, #205. + Thanks to @vogelsgesang. + + +## [3.4.1] - 2015-09-05 +### Fixed +- Fixed stacktrace handling in generated errors, for browsers (FF/IE). + + +## [3.4.0] - 2015-08-23 +### Changed +- Don't throw on warnings anymore. Use `onWarning` option to catch. +- Throw error on unknown tags (was warning before). +- Reworked internals of error class. + +### Fixed +- Fixed multiline keys dump, #197. Thanks to @tcr. +- Fixed heading line breaks in some scalars (regression). + + +## [3.3.1] - 2015-05-13 +### Added +- Added `.sortKeys` dumper option, thanks to @rjmunro. + +### Fixed +- Fixed astral characters support, #191. + + +## [3.3.0] - 2015-04-26 +### Changed +- Significantly improved long strings formatting in dumper, thanks to @isaacs. +- Strip BOM if exists. + + +## [3.2.7] - 2015-02-19 +### Changed +- Maintenance release. +- Updated dependencies. +- HISTORY.md -> CHANGELOG.md + + +## [3.2.6] - 2015-02-07 +### Fixed +- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE). +- Fixed demo dates dump (#113, thanks to @Hypercubed). + + +## [3.2.5] - 2014-12-28 +### Fixed +- Fixed resolving of all built-in types on empty nodes. +- Fixed invalid warning on empty lines within quoted scalars and flow collections. +- Fixed bug: Tag on an empty node didn't resolve in some cases. + + +## [3.2.4] - 2014-12-19 +### Fixed +- Fixed resolving of !!null tag on an empty node. + + +## [3.2.3] - 2014-11-08 +### Fixed +- Implemented dumping of objects with circular and cross references. +- Partially fixed aliasing of constructed objects. (see issue #141 for details) + + +## [3.2.2] - 2014-09-07 +### Fixed +- Fixed infinite loop on unindented block scalars. +- Rewritten base64 encode/decode in binary type, to keep code licence clear. + + +## [3.2.1] - 2014-08-24 +### Fixed +- Nothig new. Just fix npm publish error. + + +## [3.2.0] - 2014-08-24 +### Added +- Added input piping support to CLI. + +### Fixed +- Fixed typo, that could cause hand on initial indent (#139). + + +## [3.1.0] - 2014-07-07 +### Changed +- 1.5x-2x speed boost. +- Removed deprecated `require('xxx.yml')` support. +- Significant code cleanup and refactoring. +- Internal API changed. If you used custom types - see updated examples. + Others are not affected. +- Even if the input string has no trailing line break character, + it will be parsed as if it has one. +- Added benchmark scripts. +- Moved bower files to /dist folder +- Bugfixes. + + +## [3.0.2] - 2014-02-27 +### Fixed +- Fixed bug: "constructor" string parsed as `null`. + + +## [3.0.1] - 2013-12-22 +### Fixed +- Fixed parsing of literal scalars. (issue #108) +- Prevented adding unnecessary spaces in object dumps. (issue #68) +- Fixed dumping of objects with very long (> 1024 in length) keys. + + +## [3.0.0] - 2013-12-16 +### Changed +- Refactored code. Changed API for custom types. +- Removed output colors in CLI, dump json by default. +- Removed big dependencies from browser version (esprima, buffer). Load `esprima` manually, if `!!js/function` needed. `!!bin` now returns Array in browser +- AMD support. +- Don't quote dumped strings because of `-` & `?` (if not first char). +- __Deprecated__ loading yaml files via `require()`, as not recommended + behaviour for node. + + +## [2.1.3] - 2013-10-16 +### Fixed +- Fix wrong loading of empty block scalars. + + +## [2.1.2] - 2013-10-07 +### Fixed +- Fix unwanted line breaks in folded scalars. + + +## [2.1.1] - 2013-10-02 +### Fixed +- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1 +- Fixed reader bug in JSON-like sequences/mappings. + + +## [2.1.0] - 2013-06-05 +### Added +- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`), + JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`). +- Add `skipInvalid` dumper option. + +### Changed +- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA` + and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`. +- Use `safeLoad` for `require` extension. + +### Fixed +- Bug fix: export `NIL` constant from the public interface. + + +## [2.0.5] - 2013-04-26 +### Security +- Close security issue in !!js/function constructor. + Big thanks to @nealpoole for security audit. + + +## [2.0.4] - 2013-04-08 +### Changed +- Updated .npmignore to reduce package size + + +## [2.0.3] - 2013-02-26 +### Fixed +- Fixed dumping of empty arrays ans objects. ([] and {} instead of null) + + +## [2.0.2] - 2013-02-15 +### Fixed +- Fixed input validation: tabs are printable characters. + + +## [2.0.1] - 2013-02-09 +### Fixed +- Fixed error, when options not passed to function cass + + +## [2.0.0] - 2013-02-09 +### Changed +- Full rewrite. New architecture. Fast one-stage parsing. +- Changed custom types API. +- Added YAML dumper. + + +## [1.0.3] - 2012-11-05 +### Fixed +- Fixed utf-8 files loading. + + +## [1.0.2] - 2012-08-02 +### Fixed +- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. +- Fix timstamps incorectly parsed in local time when no time part specified. + + +## [1.0.1] - 2012-07-07 +### Fixed +- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. +- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. + + +## [1.0.0] - 2012-07-01 +### Changed +- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. + Fixes #42. +- `require(filename)` now returns a single document and throws an Error if + file contains more than one document. +- CLI was merged back from js-yaml.bin + + +## [0.3.7] - 2012-02-28 +### Fixed +- Fix export of `addConstructor()`. Closes #39. + + +## [0.3.6] - 2012-02-22 +### Changed +- Removed AMD parts - too buggy to use. Need help to rewrite from scratch + +### Fixed +- Removed YUI compressor warning (renamed `double` variable). Closes #40. + + +## [0.3.5] - 2012-01-10 +### Fixed +- Workagound for .npmignore fuckup under windows. Thanks to airportyh. + + +## [0.3.4] - 2011-12-24 +### Fixed +- Fixes str[] for oldIEs support. +- Adds better has change support for browserified demo. +- improves compact output of Error. Closes #33. + + +## [0.3.3] - 2011-12-20 +### Added +- adds `compact` stringification of Errors. + +### Changed +- jsyaml executable moved to separate module. + + +## [0.3.2] - 2011-12-16 +### Added +- Added jsyaml executable. +- Added !!js/function support. Closes #12. + +### Fixed +- Fixes ug with block style scalars. Closes #26. +- All sources are passing JSLint now. +- Fixes bug in Safari. Closes #28. +- Fixes bug in Opers. Closes #29. +- Improves browser support. Closes #20. + + +## [0.3.1] - 2011-11-18 +### Added +- Added AMD support for browserified version. +- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. +- Added !!js/regexp and !!js/undefined types. Partially solves #12. + +### Changed +- Wrapped browserified js-yaml into closure. + +### Fixed +- Fixed the resolvement of non-specific tags. Closes #17. +- Fixed !!set mapping. +- Fixed month parse in dates. Closes #19. + + +## [0.3.0] - 2011-11-09 +### Added +- Added browserified version. Closes #13. +- Added live demo of browserified version. +- Ported some of the PyYAML tests. See #14. + +### Fixed +- Removed JS.Class dependency. Closes #3. +- Fixed timestamp bug when fraction was given. + + +## [0.2.2] - 2011-11-06 +### Fixed +- Fixed crash on docs without ---. Closes #8. +- Fixed multiline string parse +- Fixed tests/comments for using array as key + + +## [0.2.1] - 2011-11-02 +### Fixed +- Fixed short file read (<4k). Closes #9. + + +## [0.2.0] - 2011-11-02 +### Changed +- First public release + + +[4.1.0]: https://github.com/nodeca/js-yaml/compare/4.0.0...4.1.0 +[4.0.0]: https://github.com/nodeca/js-yaml/compare/3.14.0...4.0.0 +[3.14.0]: https://github.com/nodeca/js-yaml/compare/3.13.1...3.14.0 +[3.13.1]: https://github.com/nodeca/js-yaml/compare/3.13.0...3.13.1 +[3.13.0]: https://github.com/nodeca/js-yaml/compare/3.12.2...3.13.0 +[3.12.2]: https://github.com/nodeca/js-yaml/compare/3.12.1...3.12.2 +[3.12.1]: https://github.com/nodeca/js-yaml/compare/3.12.0...3.12.1 +[3.12.0]: https://github.com/nodeca/js-yaml/compare/3.11.0...3.12.0 +[3.11.0]: https://github.com/nodeca/js-yaml/compare/3.10.0...3.11.0 +[3.10.0]: https://github.com/nodeca/js-yaml/compare/3.9.1...3.10.0 +[3.9.1]: https://github.com/nodeca/js-yaml/compare/3.9.0...3.9.1 +[3.9.0]: https://github.com/nodeca/js-yaml/compare/3.8.4...3.9.0 +[3.8.4]: https://github.com/nodeca/js-yaml/compare/3.8.3...3.8.4 +[3.8.3]: https://github.com/nodeca/js-yaml/compare/3.8.2...3.8.3 +[3.8.2]: https://github.com/nodeca/js-yaml/compare/3.8.1...3.8.2 +[3.8.1]: https://github.com/nodeca/js-yaml/compare/3.8.0...3.8.1 +[3.8.0]: https://github.com/nodeca/js-yaml/compare/3.7.0...3.8.0 +[3.7.0]: https://github.com/nodeca/js-yaml/compare/3.6.1...3.7.0 +[3.6.1]: https://github.com/nodeca/js-yaml/compare/3.6.0...3.6.1 +[3.6.0]: https://github.com/nodeca/js-yaml/compare/3.5.5...3.6.0 +[3.5.5]: https://github.com/nodeca/js-yaml/compare/3.5.4...3.5.5 +[3.5.4]: https://github.com/nodeca/js-yaml/compare/3.5.3...3.5.4 +[3.5.3]: https://github.com/nodeca/js-yaml/compare/3.5.2...3.5.3 +[3.5.2]: https://github.com/nodeca/js-yaml/compare/3.5.1...3.5.2 +[3.5.1]: https://github.com/nodeca/js-yaml/compare/3.5.0...3.5.1 +[3.5.0]: https://github.com/nodeca/js-yaml/compare/3.4.6...3.5.0 +[3.4.6]: https://github.com/nodeca/js-yaml/compare/3.4.5...3.4.6 +[3.4.5]: https://github.com/nodeca/js-yaml/compare/3.4.4...3.4.5 +[3.4.4]: https://github.com/nodeca/js-yaml/compare/3.4.3...3.4.4 +[3.4.3]: https://github.com/nodeca/js-yaml/compare/3.4.2...3.4.3 +[3.4.2]: https://github.com/nodeca/js-yaml/compare/3.4.1...3.4.2 +[3.4.1]: https://github.com/nodeca/js-yaml/compare/3.4.0...3.4.1 +[3.4.0]: https://github.com/nodeca/js-yaml/compare/3.3.1...3.4.0 +[3.3.1]: https://github.com/nodeca/js-yaml/compare/3.3.0...3.3.1 +[3.3.0]: https://github.com/nodeca/js-yaml/compare/3.2.7...3.3.0 +[3.2.7]: https://github.com/nodeca/js-yaml/compare/3.2.6...3.2.7 +[3.2.6]: https://github.com/nodeca/js-yaml/compare/3.2.5...3.2.6 +[3.2.5]: https://github.com/nodeca/js-yaml/compare/3.2.4...3.2.5 +[3.2.4]: https://github.com/nodeca/js-yaml/compare/3.2.3...3.2.4 +[3.2.3]: https://github.com/nodeca/js-yaml/compare/3.2.2...3.2.3 +[3.2.2]: https://github.com/nodeca/js-yaml/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/nodeca/js-yaml/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/nodeca/js-yaml/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/nodeca/js-yaml/compare/3.0.2...3.1.0 +[3.0.2]: https://github.com/nodeca/js-yaml/compare/3.0.1...3.0.2 +[3.0.1]: https://github.com/nodeca/js-yaml/compare/3.0.0...3.0.1 +[3.0.0]: https://github.com/nodeca/js-yaml/compare/2.1.3...3.0.0 +[2.1.3]: https://github.com/nodeca/js-yaml/compare/2.1.2...2.1.3 +[2.1.2]: https://github.com/nodeca/js-yaml/compare/2.1.1...2.1.2 +[2.1.1]: https://github.com/nodeca/js-yaml/compare/2.1.0...2.1.1 +[2.1.0]: https://github.com/nodeca/js-yaml/compare/2.0.5...2.1.0 +[2.0.5]: https://github.com/nodeca/js-yaml/compare/2.0.4...2.0.5 +[2.0.4]: https://github.com/nodeca/js-yaml/compare/2.0.3...2.0.4 +[2.0.3]: https://github.com/nodeca/js-yaml/compare/2.0.2...2.0.3 +[2.0.2]: https://github.com/nodeca/js-yaml/compare/2.0.1...2.0.2 +[2.0.1]: https://github.com/nodeca/js-yaml/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/nodeca/js-yaml/compare/1.0.3...2.0.0 +[1.0.3]: https://github.com/nodeca/js-yaml/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/nodeca/js-yaml/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/nodeca/js-yaml/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/nodeca/js-yaml/compare/0.3.7...1.0.0 +[0.3.7]: https://github.com/nodeca/js-yaml/compare/0.3.6...0.3.7 +[0.3.6]: https://github.com/nodeca/js-yaml/compare/0.3.5...0.3.6 +[0.3.5]: https://github.com/nodeca/js-yaml/compare/0.3.4...0.3.5 +[0.3.4]: https://github.com/nodeca/js-yaml/compare/0.3.3...0.3.4 +[0.3.3]: https://github.com/nodeca/js-yaml/compare/0.3.2...0.3.3 +[0.3.2]: https://github.com/nodeca/js-yaml/compare/0.3.1...0.3.2 +[0.3.1]: https://github.com/nodeca/js-yaml/compare/0.3.0...0.3.1 +[0.3.0]: https://github.com/nodeca/js-yaml/compare/0.2.2...0.3.0 +[0.2.2]: https://github.com/nodeca/js-yaml/compare/0.2.1...0.2.2 +[0.2.1]: https://github.com/nodeca/js-yaml/compare/0.2.0...0.2.1 +[0.2.0]: https://github.com/nodeca/js-yaml/releases/tag/0.2.0 diff --git a/node_modules/js-yaml/LICENSE b/node_modules/js-yaml/LICENSE new file mode 100644 index 0000000..09d3a29 --- /dev/null +++ b/node_modules/js-yaml/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2011-2015 by Vitaly Puzrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/js-yaml/README.md b/node_modules/js-yaml/README.md new file mode 100644 index 0000000..3cbc4bd --- /dev/null +++ b/node_modules/js-yaml/README.md @@ -0,0 +1,246 @@ +JS-YAML - YAML 1.2 parser / writer for JavaScript +================================================= + +[![CI](https://github.com/nodeca/js-yaml/workflows/CI/badge.svg?branch=master)](https://github.com/nodeca/js-yaml/actions) +[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml) + +__[Online Demo](http://nodeca.github.com/js-yaml/)__ + + +This is an implementation of [YAML](http://yaml.org/), a human-friendly data +serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was +completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. + + +Installation +------------ + +### YAML module for node.js + +``` +npm install js-yaml +``` + + +### CLI executable + +If you want to inspect your YAML files from CLI, install js-yaml globally: + +``` +npm install -g js-yaml +``` + +#### Usage + +``` +usage: js-yaml [-h] [-v] [-c] [-t] file + +Positional arguments: + file File with YAML document(s) + +Optional arguments: + -h, --help Show this help message and exit. + -v, --version Show program's version number and exit. + -c, --compact Display errors in compact mode + -t, --trace Show stack trace on error +``` + + +API +--- + +Here we cover the most 'useful' methods. If you need advanced details (creating +your own tags), see [examples](https://github.com/nodeca/js-yaml/tree/master/examples) +for more info. + +``` javascript +const yaml = require('js-yaml'); +const fs = require('fs'); + +// Get document, or throw exception on error +try { + const doc = yaml.load(fs.readFileSync('/home/ixti/example.yml', 'utf8')); + console.log(doc); +} catch (e) { + console.log(e); +} +``` + + +### load (string [ , options ]) + +Parses `string` as single YAML document. Returns either a +plain object, a string, a number, `null` or `undefined`, or throws `YAMLException` on error. By default, does +not support regexps, functions and undefined. + +options: + +- `filename` _(default: null)_ - string to be used as a file path in + error/warning messages. +- `onWarning` _(default: null)_ - function to call on warning messages. + Loader will call this function with an instance of `YAMLException` for each warning. +- `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use. + - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: + http://www.yaml.org/spec/1.2/spec.html#id2802346 + - `JSON_SCHEMA` - all JSON-supported types: + http://www.yaml.org/spec/1.2/spec.html#id2803231 + - `CORE_SCHEMA` - same as `JSON_SCHEMA`: + http://www.yaml.org/spec/1.2/spec.html#id2804923 + - `DEFAULT_SCHEMA` - all supported YAML types. +- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. + +NOTE: This function **does not** understand multi-document sources, it throws +exception on those. + +NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. +So, the JSON schema is not as strictly defined in the YAML specification. +It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. +The core schema also has no such restrictions. It allows binary notation for integers. + + +### loadAll (string [, iterator] [, options ]) + +Same as `load()`, but understands multi-document sources. Applies +`iterator` to each document if specified, or returns array of documents. + +``` javascript +const yaml = require('js-yaml'); + +yaml.loadAll(data, function (doc) { + console.log(doc); +}); +``` + + +### dump (object [ , options ]) + +Serializes `object` as a YAML document. Uses `DEFAULT_SCHEMA`, so it will +throw an exception if you try to dump regexps or functions. However, you can +disable exceptions by setting the `skipInvalid` option to `true`. + +options: + +- `indent` _(default: 2)_ - indentation width to use (in spaces). +- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements +- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function + in the safe schema) and skip pairs and single values with such types. +- `flowLevel` _(default: -1)_ - specifies level of nesting, when to switch from + block to flow style for collections. -1 means block style everwhere +- `styles` - "tag" => "style" map. Each tag may have own set of styles. +- `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use. +- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a + function, use the function to sort the keys. +- `lineWidth` _(default: `80`)_ - set max line width. Set `-1` for unlimited width. +- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references +- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older + yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 +- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. +- `quotingType` _(`'` or `"`, default: `'`)_ - strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters. +- `forceQuotes` _(default: `false`)_ - if `true`, all non-key strings will be quoted even if they normally don't need to. +- `replacer` - callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`). + +The following table show availlable styles (e.g. "canonical", +"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml +output is shown on the right side after `=>` (default setting) or `->`: + +``` none +!!null + "canonical" -> "~" + "lowercase" => "null" + "uppercase" -> "NULL" + "camelcase" -> "Null" + +!!int + "binary" -> "0b1", "0b101010", "0b1110001111010" + "octal" -> "0o1", "0o52", "0o16172" + "decimal" => "1", "42", "7290" + "hexadecimal" -> "0x1", "0x2A", "0x1C7A" + +!!bool + "lowercase" => "true", "false" + "uppercase" -> "TRUE", "FALSE" + "camelcase" -> "True", "False" + +!!float + "lowercase" => ".nan", '.inf' + "uppercase" -> ".NAN", '.INF' + "camelcase" -> ".NaN", '.Inf' +``` + +Example: + +``` javascript +dump(object, { + 'styles': { + '!!null': 'canonical' // dump null as ~ + }, + 'sortKeys': true // sort object keys +}); +``` + +Supported YAML types +-------------------- + +The list of standard YAML tags and corresponding JavaScript types. See also +[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and +[YAML types repository](http://yaml.org/type/). + +``` +!!null '' # null +!!bool 'yes' # bool +!!int '3...' # number +!!float '3.14...' # number +!!binary '...base64...' # buffer +!!timestamp 'YYYY-...' # date +!!omap [ ... ] # array of key-value pairs +!!pairs [ ... ] # array or array pairs +!!set { ... } # array of objects with given keys and null values +!!str '...' # string +!!seq [ ... ] # array +!!map { ... } # object +``` + +**JavaScript-specific tags** + +See [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) for +extra types. + + +Caveats +------- + +Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects +or arrays as keys, and stringifies (by calling `toString()` method) them at the +moment of adding them. + +``` yaml +--- +? [ foo, bar ] +: - baz +? { foo: bar } +: - baz + - baz +``` + +``` javascript +{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } +``` + +Also, reading of properties on implicit block mapping keys is not supported yet. +So, the following YAML document cannot be loaded. + +``` yaml +&anchor foo: + foo: bar + *anchor: duplicate key + baz: bat + *anchor: duplicate key +``` + + +js-yaml for enterprise +---------------------- + +Available as part of the Tidelift Subscription + +The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/js-yaml/dist/js-yaml.js b/node_modules/js-yaml/dist/js-yaml.js new file mode 100644 index 0000000..4cc0ddf --- /dev/null +++ b/node_modules/js-yaml/dist/js-yaml.js @@ -0,0 +1,3874 @@ + +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jsyaml = {})); +}(this, (function (exports) { 'use strict'; + + function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); + } + + + function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); + } + + + function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; + } + + + function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; + } + + + function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; + } + + + function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); + } + + + var isNothing_1 = isNothing; + var isObject_1 = isObject; + var toArray_1 = toArray; + var repeat_1 = repeat; + var isNegativeZero_1 = isNegativeZero; + var extend_1 = extend; + + var common = { + isNothing: isNothing_1, + isObject: isObject_1, + toArray: toArray_1, + repeat: repeat_1, + isNegativeZero: isNegativeZero_1, + extend: extend_1 + }; + + // YAML error class. http://stackoverflow.com/questions/8458984 + + + function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; + } + + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; + } + + + function YAMLException$1(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } + } + + + // Inherit from Error + YAMLException$1.prototype = Object.create(Error.prototype); + YAMLException$1.prototype.constructor = YAMLException$1; + + + YAMLException$1.prototype.toString = function toString(compact) { + return this.name + ': ' + formatError(this, compact); + }; + + + var exception = YAMLException$1; + + // get snippet for a single line, respecting maxLength + function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; + } + + + function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; + } + + + function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); + } + + + var snippet = makeSnippet; + + var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + 'defaultStyle', + 'styleAliases' + ]; + + var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' + ]; + + function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; + } + + function Type$1(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } + } + + var type = Type$1; + + /*eslint-disable max-len*/ + + + + + + function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; + } + + + function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; + } + + + function Schema$1(definition) { + return this.extend(definition); + } + + + Schema$1.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new exception('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + if (type$1.loadKind && type$1.loadKind !== 'scalar') { + throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + + if (type$1.multi) { + throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema$1.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; + }; + + + var schema = Schema$1; + + var str = new type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } + }); + + var seq = new type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } + }); + + var map = new type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } + }); + + var failsafe = new schema({ + explicit: [ + str, + seq, + map + ] + }); + + function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); + } + + function constructYamlNull() { + return null; + } + + function isNull(object) { + return object === null; + } + + var _null = new type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' + }); + + function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); + } + + function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; + } + + function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; + } + + var bool = new type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' + }); + + function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); + } + + function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); + } + + function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); + } + + function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + } + + // base 10 (except 0) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; + } + + function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + return sign * parseInt(value, 10); + } + + function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); + } + + var int = new type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } + }); + + var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + + function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; + } + + function constructYamlFloat(data) { + var value, sign; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + } + return sign * parseFloat(value, 10); + } + + + var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + + function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; + } + + function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); + } + + var float = new type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' + }); + + var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] + }); + + var core = json; + + var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + + var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + + function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; + } + + function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; + } + + function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); + } + + var timestamp = new type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp + }); + + function resolveYamlMerge(data) { + return data === '<<' || data === null; + } + + var merge = new type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge + }); + + /*eslint-disable no-bitwise*/ + + + + + + // [ 64, 65, 66 ] -> [ padding, CR, LF ] + var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + + function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; + } + + function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + return new Uint8Array(result); + } + + function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; + } + + function isBinary(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; + } + + var binary = new type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary + }); + + var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; + var _toString$2 = Object.prototype.toString; + + function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString$2.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty$3.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; + } + + function constructYamlOmap(data) { + return data !== null ? data : []; + } + + var omap = new type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap + }); + + var _toString$1 = Object.prototype.toString; + + function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString$1.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; + } + + function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; + } + + var pairs = new type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs + }); + + var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; + + function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty$2.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; + } + + function constructYamlSet(data) { + return data !== null ? data : {}; + } + + var set = new type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet + }); + + var _default = core.extend({ + implicit: [ + timestamp, + merge + ], + explicit: [ + binary, + omap, + pairs, + set + ] + }); + + /*eslint-disable max-len,no-use-before-define*/ + + + + + + + + var _hasOwnProperty$1 = Object.prototype.hasOwnProperty; + + + var CONTEXT_FLOW_IN = 1; + var CONTEXT_FLOW_OUT = 2; + var CONTEXT_BLOCK_IN = 3; + var CONTEXT_BLOCK_OUT = 4; + + + var CHOMPING_CLIP = 1; + var CHOMPING_STRIP = 2; + var CHOMPING_KEEP = 3; + + + var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; + var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; + var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; + var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + + function _class(obj) { return Object.prototype.toString.call(obj); } + + function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); + } + + function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); + } + + function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); + } + + function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; + } + + function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; + } + + function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; + } + + function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; + } + + function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; + } + + function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); + } + + var simpleEscapeCheck = new Array(256); // integer, for fast access + var simpleEscapeMap = new Array(256); + for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); + } + + + function State$1(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || _default; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + this.legacy = options['legacy'] || false; + + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + + } + + + function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = snippet(mark); + + return new exception(message, mark); + } + + function throwError(state, message) { + throw generateError(state, message); + } + + function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } + } + + + var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty$1.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + state.tagMap[handle] = prefix; + } + }; + + + function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } + } + + function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty$1.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } + } + + function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, startPos) { + + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty$1.call(overridableKeys, keyNode) && + _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; + } + delete overridableKeys[keyNode]; + } + + return _result; + } + + function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; + } + + function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; + } + + function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; + } + + function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } + } + + + function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; + } + + function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); + } + + function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); + } + + function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); + } + + function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; + } + + function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; + } + + function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; + } + + function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; + } + + function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; + } + + function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty$1.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; + } + + function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== '!') { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; + } + + function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = Object.create(null); + state.anchorMap = Object.create(null); + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } + } + + + function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State$1(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; + } + + + function loadAll$1(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } + } + + + function load$1(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new exception('expected a single document in the stream, but found more'); + } + + + var loadAll_1 = loadAll$1; + var load_1 = load$1; + + var loader = { + loadAll: loadAll_1, + load: load_1 + }; + + /*eslint-disable no-use-before-define*/ + + + + + + var _toString = Object.prototype.toString; + var _hasOwnProperty = Object.prototype.hasOwnProperty; + + var CHAR_BOM = 0xFEFF; + var CHAR_TAB = 0x09; /* Tab */ + var CHAR_LINE_FEED = 0x0A; /* LF */ + var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ + var CHAR_SPACE = 0x20; /* Space */ + var CHAR_EXCLAMATION = 0x21; /* ! */ + var CHAR_DOUBLE_QUOTE = 0x22; /* " */ + var CHAR_SHARP = 0x23; /* # */ + var CHAR_PERCENT = 0x25; /* % */ + var CHAR_AMPERSAND = 0x26; /* & */ + var CHAR_SINGLE_QUOTE = 0x27; /* ' */ + var CHAR_ASTERISK = 0x2A; /* * */ + var CHAR_COMMA = 0x2C; /* , */ + var CHAR_MINUS = 0x2D; /* - */ + var CHAR_COLON = 0x3A; /* : */ + var CHAR_EQUALS = 0x3D; /* = */ + var CHAR_GREATER_THAN = 0x3E; /* > */ + var CHAR_QUESTION = 0x3F; /* ? */ + var CHAR_COMMERCIAL_AT = 0x40; /* @ */ + var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ + var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ + var CHAR_GRAVE_ACCENT = 0x60; /* ` */ + var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ + var CHAR_VERTICAL_LINE = 0x7C; /* | */ + var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + + var ESCAPE_SEQUENCES = {}; + + ESCAPE_SEQUENCES[0x00] = '\\0'; + ESCAPE_SEQUENCES[0x07] = '\\a'; + ESCAPE_SEQUENCES[0x08] = '\\b'; + ESCAPE_SEQUENCES[0x09] = '\\t'; + ESCAPE_SEQUENCES[0x0A] = '\\n'; + ESCAPE_SEQUENCES[0x0B] = '\\v'; + ESCAPE_SEQUENCES[0x0C] = '\\f'; + ESCAPE_SEQUENCES[0x0D] = '\\r'; + ESCAPE_SEQUENCES[0x1B] = '\\e'; + ESCAPE_SEQUENCES[0x22] = '\\"'; + ESCAPE_SEQUENCES[0x5C] = '\\\\'; + ESCAPE_SEQUENCES[0x85] = '\\N'; + ESCAPE_SEQUENCES[0xA0] = '\\_'; + ESCAPE_SEQUENCES[0x2028] = '\\L'; + ESCAPE_SEQUENCES[0x2029] = '\\P'; + + var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' + ]; + + var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + + function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; + } + + function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new exception('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; + } + + + var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + + function State(options) { + this.schema = options['schema'] || _default; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; + } + + // Indents every line in a string. Empty lines (\n only) are not indented. + function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; + } + + function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); + } + + function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; + } + + // [33] s-white ::= s-space | s-tab + function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; + } + + // Returns true if the character can be printed without escaping. + // From YAML 1.2: "any allowed characters known to be non-printable + // should also be escaped. [However,] This isn’t mandatory" + // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. + function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM) + || (0x10000 <= c && c <= 0x10FFFF); + } + + // [34] ns-char ::= nb-char - s-white + // [27] nb-char ::= c-printable - b-char - c-byte-order-mark + // [26] b-char ::= b-line-feed | b-carriage-return + // Including s-white (for some reason, examples doesn't match specs in this aspect) + // ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark + function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; + } + + // [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out + // c = flow-in ⇒ ns-plain-safe-in + // c = block-key ⇒ ns-plain-safe-out + // c = flow-key ⇒ ns-plain-safe-in + // [128] ns-plain-safe-out ::= ns-char + // [129] ns-plain-safe-in ::= ns-char - c-flow-indicator + // [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) + // | ( /* An ns-char preceding */ “#” ) + // | ( “:” /* Followed by an ns-plain-safe(c) */ ) + function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' + } + + // Simplified test for values allowed as the first character in plain style. + function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; + } + + // Simplified test for values allowed as the last character in plain style. + function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; + } + + // Same as 'string'.codePointAt(pos), but works in older browsers. + function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; + } + + // Determines whether block indentation indicator is required. + function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); + } + + var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + + // Determines which scalar styles are possible and returns the preferred style. + // lineWidth = -1 => no limit. + // Pre-conditions: str.length > 0. + // Post-conditions: + // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. + // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). + // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). + function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, + testAmbiguousType, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + + // Note: line breaking/folding is implemented for only the folded style. + // NB. We drop the last trailing newline (if any) of a returned block scalar + // since the dumper adds its own newline. This always works: + // • No ending newline => unaffected; already using strip "-" chomping. + // • Ending newline => removed then restored. + // Importantly, this keeps the "+" chomp indicator from gaining an extra line. + function writeScalar(state, string, level, iskey, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'"); + } + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, + testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string) + '"'; + default: + throw new exception('impossible error: invalid scalar style'); + } + }()); + } + + // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. + function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; + } + + // (See the note for writeScalar.) + function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; + } + + // Note: a long line without a suitable break point will exceed the width limit. + // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. + function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; + } + + // Greedy line breaking. + // Picks the longest line under the limit each time, + // otherwise settles for the shortest line over the limit. + // NB. More-indented lines *cannot* be folded, as that would add an extra \n. + function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner + } + + // Escapes a double-quoted string. + function escapeString(string) { + var result = ''; + var char = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; + } + + function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; + } + + function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. + } + + function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; + } + + function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new exception('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. + } + + function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.tag = '?'; + } + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; + } + + // Serializes `object` and writes it to global `result`. + // Returns true on success, or false on invalid object. + // + function writeNode(state, level, object, block, compact, iskey, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new exception('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + state.dump; + } + } + + return true; + } + + function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); + } + + function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } + } + + function dump$1(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; + } + + var dump_1 = dump$1; + + var dumper = { + dump: dump_1 + }; + + function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; + } + + + var Type = type; + var Schema = schema; + var FAILSAFE_SCHEMA = failsafe; + var JSON_SCHEMA = json; + var CORE_SCHEMA = core; + var DEFAULT_SCHEMA = _default; + var load = loader.load; + var loadAll = loader.loadAll; + var dump = dumper.dump; + var YAMLException = exception; + + // Re-export all types in case user wants to create custom schema + var types = { + binary: binary, + float: float, + map: map, + null: _null, + pairs: pairs, + set: set, + timestamp: timestamp, + bool: bool, + int: int, + merge: merge, + omap: omap, + seq: seq, + str: str + }; + + // Removed functions from JS-YAML 3.0.x + var safeLoad = renamed('safeLoad', 'load'); + var safeLoadAll = renamed('safeLoadAll', 'loadAll'); + var safeDump = renamed('safeDump', 'dump'); + + var jsYaml = { + Type: Type, + Schema: Schema, + FAILSAFE_SCHEMA: FAILSAFE_SCHEMA, + JSON_SCHEMA: JSON_SCHEMA, + CORE_SCHEMA: CORE_SCHEMA, + DEFAULT_SCHEMA: DEFAULT_SCHEMA, + load: load, + loadAll: loadAll, + dump: dump, + YAMLException: YAMLException, + types: types, + safeLoad: safeLoad, + safeLoadAll: safeLoadAll, + safeDump: safeDump + }; + + exports.CORE_SCHEMA = CORE_SCHEMA; + exports.DEFAULT_SCHEMA = DEFAULT_SCHEMA; + exports.FAILSAFE_SCHEMA = FAILSAFE_SCHEMA; + exports.JSON_SCHEMA = JSON_SCHEMA; + exports.Schema = Schema; + exports.Type = Type; + exports.YAMLException = YAMLException; + exports.default = jsYaml; + exports.dump = dump; + exports.load = load; + exports.loadAll = loadAll; + exports.safeDump = safeDump; + exports.safeLoad = safeLoad; + exports.safeLoadAll = safeLoadAll; + exports.types = types; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/js-yaml/dist/js-yaml.min.js new file mode 100644 index 0000000..bdd8eef --- /dev/null +++ b/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1,2 @@ +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jsyaml={})}(this,(function(e){"use strict";function t(e){return null==e}var n={isNothing:t,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:t(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;nl&&(t=i-l+(o=" ... ").length),n-i>l&&(n=i+l-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:i-t+o.length}}function l(e,t){return n.repeat(" ",t-e.length)+e}var c=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var i,r=/\r?\n|\r|\0/g,o=[0],c=[],s=-1;i=r.exec(e.buffer);)c.push(i.index),o.push(i.index+i[0].length),e.position<=i.index&&s<0&&(s=o.length-2);s<0&&(s=o.length-1);var u,p,f="",d=Math.min(e.line+t.linesAfter,c.length).toString().length,h=t.maxLength-(t.indent+d+3);for(u=1;u<=t.linesBefore&&!(s-u<0);u++)p=a(e.buffer,o[s-u],c[s-u],e.position-(o[s]-o[s-u]),h),f=n.repeat(" ",t.indent)+l((e.line-u+1).toString(),d)+" | "+p.str+"\n"+f;for(p=a(e.buffer,o[s],c[s],e.position,h),f+=n.repeat(" ",t.indent)+l((e.line+1).toString(),d)+" | "+p.str+"\n",f+=n.repeat("-",t.indent+d+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(s+u>=c.length);u++)p=a(e.buffer,o[s+u],c[s+u],e.position-(o[s]-o[s+u]),h),f+=n.repeat(" ",t.indent)+l((e.line+u+1).toString(),d)+" | "+p.str+"\n";return f.replace(/\n$/,"")},s=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],u=["scalar","sequence","mapping"];var p=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===s.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===u.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function f(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function d(e){return this.extend(e)}d.prototype.extend=function(e){var t=[],n=[];if(e instanceof p)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new o("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof p))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new o("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof p))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(d.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=f(i,"implicit"),i.compiledExplicit=f(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),x=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var I=/^[-+]?[0-9]+e/;var S=new p("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!x.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||n.isNegativeZero(e))},represent:function(e,t){var i;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(n.isNegativeZero(e))return"-0.0";return i=e.toString(10),I.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),O=b.extend({implicit:[A,v,C,S]}),j=O,T=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),N=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var F=new p("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==T.exec(e)||null!==N.exec(e))},construct:function(e){var t,n,i,r,o,a,l,c,s=0,u=null;if(null===(t=T.exec(e))&&(t=N.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],a=+t[5],l=+t[6],t[7]){for(s=t[7].slice(0,3);s.length<3;)s+="0";s=+s}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,i,r,o,a,l,s)),u&&c.setTime(c.getTime()-u),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var E=new p("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var L=new p("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,o=M;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=M,a=0,l=[];for(t=0;t>16&255),l.push(a>>8&255),l.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0===(n=r%4*6)?(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)):18===n?(l.push(a>>10&255),l.push(a>>2&255)):12===n&&l.push(a>>4&255),new Uint8Array(l)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=M;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0===(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),_=Object.prototype.hasOwnProperty,D=Object.prototype.toString;var U=new p("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,o,a=[],l=e;for(t=0,n=l.length;t>10),56320+(e-65536&1023))}for(var ie=new Array(256),re=new Array(256),oe=0;oe<256;oe++)ie[oe]=te(oe)?1:0,re[oe]=te(oe);function ae(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||K,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function le(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=c(n),new o(t,n)}function ce(e,t){throw le(e,t)}function se(e,t){e.onWarning&&e.onWarning.call(null,le(e,t))}var ue={YAML:function(e,t,n){var i,r,o;null!==e.version&&ce(e,"duplication of %YAML directive"),1!==n.length&&ce(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&ce(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&ce(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&se(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&ce(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],G.test(i)||ce(e,"ill-formed tag handle (first argument) of the TAG directive"),P.call(e.tagMap,i)&&ce(e,'there is a previously declared suffix for "'+i+'" tag handle'),V.test(r)||ce(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){ce(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function pe(e,t,n,i){var r,o,a,l;if(t1&&(e.result+=n.repeat("\n",t-1))}function be(e,t){var n,i,r=e.tag,o=e.anchor,a=[],l=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation")),45===i)&&z(e.input.charCodeAt(e.position+1));)if(l=!0,e.position++,ge(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,we(e,t,3,!1,!0),a.push(e.result),ge(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)ce(e,"bad indentation of a sequence entry");else if(e.lineIndentt?g=1:e.lineIndent===t?g=0:e.lineIndentt?g=1:e.lineIndent===t?g=0:e.lineIndentt)&&(y&&(a=e.line,l=e.lineStart,c=e.position),we(e,t,4,!0,r)&&(y?g=e.result:m=e.result),y||(de(e,f,d,h,g,m,a,l,c),h=g=m=null),ge(e,!0,-1),s=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==s)ce(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===o?ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?ce(e,"repeat of an indentation width identifier"):(p=t+o-1,u=!0)}if(Q(a)){do{a=e.input.charCodeAt(++e.position)}while(Q(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!J(a)&&0!==a)}for(;0!==a;){for(he(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!u||e.lineIndentp&&(p=e.lineIndent),J(a))f++;else{if(e.lineIndent0){for(r=a,o=0;r>0;r--)(a=ee(l=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:ce(e,"expected hexadecimal character");e.result+=ne(o),e.position++}else ce(e,"unknown escape sequence");n=i=e.position}else J(l)?(pe(e,n,i,!0),ye(e,ge(e,!1,t)),n=i=e.position):e.position===e.lineStart&&me(e)?ce(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}ce(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?y=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!z(i)&&!X(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),P.call(e.anchorMap,n)||ce(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ge(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,l,c,s,u,p=e.kind,f=e.result;if(z(u=e.input.charCodeAt(e.position))||X(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(z(i=e.input.charCodeAt(e.position+1))||n&&X(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==u;){if(58===u){if(z(i=e.input.charCodeAt(e.position+1))||n&&X(i))break}else if(35===u){if(z(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&me(e)||n&&X(u))break;if(J(u)){if(l=e.line,c=e.lineStart,s=e.lineIndent,ge(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=l,e.lineStart=c,e.lineIndent=s;break}}a&&(pe(e,r,o,!1),ye(e,e.line-l),r=o=e.position,a=!1),Q(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return pe(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,d,1===i)&&(y=!0,null===e.tag&&(e.tag="?")):(y=!0,null===e.tag&&null===e.anchor||ce(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(y=c&&be(e,h))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ce(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),s=0,u=e.implicitTypes.length;s"),null!==e.result&&f.kind!==e.kind&&ce(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ce(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||y}function ke(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(ge(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&ce(e,"directive name must not be less than one character in length");0!==r;){for(;Q(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!J(r));break}if(J(r))break;for(t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&he(e),P.call(ue,n)?ue[n](e,n,i):se(e,'unknown document directive "'+n+'"')}ge(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,ge(e,!0,-1)):a&&ce(e,"directives end mark is expected"),we(e,e.lineIndent-1,4,!1,!0),ge(e,!0,-1),e.checkLineBreaks&&H.test(e.input.slice(o,e.position))&&se(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&me(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,ge(e,!0,-1)):e.position=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function Re(e){return/^\n* /.test(e)}function Be(e,t,n,i,r,o,a,l){var c,s,u=0,p=null,f=!1,d=!1,h=-1!==i,g=-1,m=De(s=Ye(e,0))&&s!==Oe&&!_e(s)&&45!==s&&63!==s&&58!==s&&44!==s&&91!==s&&93!==s&&123!==s&&125!==s&&35!==s&&38!==s&&42!==s&&33!==s&&124!==s&&61!==s&&62!==s&&39!==s&&34!==s&&37!==s&&64!==s&&96!==s&&function(e){return!_e(e)&&58!==e}(Ye(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!De(u=Ye(e,c)))return 5;m=m&&qe(u,p,l),p=u}else{for(c=0;c=65536?c+=2:c++){if(10===(u=Ye(e,c)))f=!0,h&&(d=d||c-g-1>i&&" "!==e[g+1],g=c);else if(!De(u))return 5;m=m&&qe(u,p,l),p=u}d=d||h&&c-g-1>i&&" "!==e[g+1]}return f||d?n>9&&Re(e)?5:a?2===o?5:2:d?4:3:!m||a||r(e)?2===o?5:2:1}function Ke(e,t,n,i,r){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Te.indexOf(t)||Ne.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),l=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=i||e.flowLevel>-1&&n>=e.flowLevel;switch(Be(t,c,e.indent,l,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+Pe(t,e.indent)+We(Me(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(l=e.indexOf("\n"),l=-1!==l?l:e.length,r.lastIndex=l,He(e.slice(0,l),t)),a="\n"===e[0]||" "===e[0];var l;for(;i=r.exec(e);){var c=i[1],s=i[2];n=" "===s[0],o+=c+(a||n||""===s?"":"\n")+He(s,t),a=n}return o}(t,l),a));case 5:return'"'+function(e){for(var t,n="",i=0,r=0;r=65536?r+=2:r++)i=Ye(e,r),!(t=je[i])&&De(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||Fe(i);return n}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function Pe(e,t){var n=Re(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function We(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function He(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,a=0,l=0,c="";n=r.exec(e);)(l=n.index)-o>t&&(i=a>o?a:l,c+="\n"+e.slice(o,i),o=i+1),a=l;return c+="\n",e.length-o>t&&a>o?c+=e.slice(o,a)+"\n"+e.slice(a+1):c+=e.slice(o),c.slice(1)}function $e(e,t,n,i){var r,o,a,l="",c=e.tag;for(r=0,o=n.length;r tag resolver accepts not "'+s+'" style');i=c.represent[s](t,s)}e.dump=i}return!0}return!1}function Ve(e,t,n,i,r,a,l){e.tag=null,e.dump=n,Ge(e,n,!1)||Ge(e,n,!0);var c,s=Ie.call(e.dump),u=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var p,f,d="[object Object]"===s||"[object Array]"===s;if(d&&(f=-1!==(p=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(r=!1),f&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(d&&f&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),"[object Object]"===s)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var r,a,l,c,s,u,p="",f=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(r=0,a=d.length;r1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,s&&(u+=Le(e,t)),Ve(e,t+1,c,!0,s)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=f,e.dump=p||"{}"}(e,t,e.dump,r),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var i,r,o,a,l,c="",s=e.tag,u=Object.keys(n);for(i=0,r=u.length;i1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ve(e,t,a,!1,!1)&&(c+=l+=e.dump));e.tag=s,e.dump="{"+c+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+p+" "+e.dump));else if("[object Array]"===s)i&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?$e(e,t-1,e.dump,r):$e(e,t,e.dump,r),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var i,r,o,a="",l=e.tag;for(i=0,r=n.length;i",e.dump=c+" "+e.dump)}return!0}function Ze(e,t){var n,i,r=[],o=[];for(Je(e,r,o),n=0,i=o.length;n maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; +} + + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} + + +function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); +} + + +var snippet = makeSnippet; + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type$1(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +var type = Type$1; + +/*eslint-disable max-len*/ + + + + + +function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema$1(definition) { + return this.extend(definition); +} + + +Schema$1.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new exception('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + if (type$1.loadKind && type$1.loadKind !== 'scalar') { + throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + + if (type$1.multi) { + throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema$1.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; +}; + + +var schema = Schema$1; + +var str = new type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + +var seq = new type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + +var map = new type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + +var failsafe = new schema({ + explicit: [ + str, + seq, + map + ] +}); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +var _null = new type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +var bool = new type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + } + + // base 10 (except 0) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +var int = new type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +var float = new type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + +var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] +}); + +var core = json; + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +var timestamp = new type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +var merge = new type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + +/*eslint-disable no-bitwise*/ + + + + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + return new Uint8Array(result); +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} + +var binary = new type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + +var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; +var _toString$2 = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString$2.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty$3.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +var omap = new type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + +var _toString$1 = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString$1.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +var pairs = new type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + +var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty$2.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +var set = new type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + +var _default = core.extend({ + implicit: [ + timestamp, + merge + ], + explicit: [ + binary, + omap, + pairs, + set + ] +}); + +/*eslint-disable max-len,no-use-before-define*/ + + + + + + + +var _hasOwnProperty$1 = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State$1(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || _default; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + this.legacy = options['legacy'] || false; + + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = snippet(mark); + + return new exception(message, mark); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty$1.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty$1.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, startPos) { + + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty$1.call(overridableKeys, keyNode) && + _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; + } + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty$1.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== '!') { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = Object.create(null); + state.anchorMap = Object.create(null); + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State$1(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll$1(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load$1(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new exception('expected a single document in the stream, but found more'); +} + + +var loadAll_1 = loadAll$1; +var load_1 = load$1; + +var loader = { + loadAll: loadAll_1, + load: load_1 +}; + +/*eslint-disable no-use-before-define*/ + + + + + +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new exception('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + + +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + +function State(options) { + this.schema = options['schema'] || _default; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} + +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, + testAmbiguousType, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'"); + } + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, + testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string) + '"'; + default: + throw new exception('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new exception('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.tag = '?'; + } + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new exception('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump$1(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; +} + +var dump_1 = dump$1; + +var dumper = { + dump: dump_1 +}; + +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} + + +var Type = type; +var Schema = schema; +var FAILSAFE_SCHEMA = failsafe; +var JSON_SCHEMA = json; +var CORE_SCHEMA = core; +var DEFAULT_SCHEMA = _default; +var load = loader.load; +var loadAll = loader.loadAll; +var dump = dumper.dump; +var YAMLException = exception; + +// Re-export all types in case user wants to create custom schema +var types = { + binary: binary, + float: float, + map: map, + null: _null, + pairs: pairs, + set: set, + timestamp: timestamp, + bool: bool, + int: int, + merge: merge, + omap: omap, + seq: seq, + str: str +}; + +// Removed functions from JS-YAML 3.0.x +var safeLoad = renamed('safeLoad', 'load'); +var safeLoadAll = renamed('safeLoadAll', 'loadAll'); +var safeDump = renamed('safeDump', 'dump'); + +var jsYaml = { + Type: Type, + Schema: Schema, + FAILSAFE_SCHEMA: FAILSAFE_SCHEMA, + JSON_SCHEMA: JSON_SCHEMA, + CORE_SCHEMA: CORE_SCHEMA, + DEFAULT_SCHEMA: DEFAULT_SCHEMA, + load: load, + loadAll: loadAll, + dump: dump, + YAMLException: YAMLException, + types: types, + safeLoad: safeLoad, + safeLoadAll: safeLoadAll, + safeDump: safeDump +}; + +export default jsYaml; +export { CORE_SCHEMA, DEFAULT_SCHEMA, FAILSAFE_SCHEMA, JSON_SCHEMA, Schema, Type, YAMLException, dump, load, loadAll, safeDump, safeLoad, safeLoadAll, types }; diff --git a/node_modules/js-yaml/index.js b/node_modules/js-yaml/index.js new file mode 100644 index 0000000..bcb7eba --- /dev/null +++ b/node_modules/js-yaml/index.js @@ -0,0 +1,47 @@ +'use strict'; + + +var loader = require('./lib/loader'); +var dumper = require('./lib/dumper'); + + +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} + + +module.exports.Type = require('./lib/type'); +module.exports.Schema = require('./lib/schema'); +module.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe'); +module.exports.JSON_SCHEMA = require('./lib/schema/json'); +module.exports.CORE_SCHEMA = require('./lib/schema/core'); +module.exports.DEFAULT_SCHEMA = require('./lib/schema/default'); +module.exports.load = loader.load; +module.exports.loadAll = loader.loadAll; +module.exports.dump = dumper.dump; +module.exports.YAMLException = require('./lib/exception'); + +// Re-export all types in case user wants to create custom schema +module.exports.types = { + binary: require('./lib/type/binary'), + float: require('./lib/type/float'), + map: require('./lib/type/map'), + null: require('./lib/type/null'), + pairs: require('./lib/type/pairs'), + set: require('./lib/type/set'), + timestamp: require('./lib/type/timestamp'), + bool: require('./lib/type/bool'), + int: require('./lib/type/int'), + merge: require('./lib/type/merge'), + omap: require('./lib/type/omap'), + seq: require('./lib/type/seq'), + str: require('./lib/type/str') +}; + +// Removed functions from JS-YAML 3.0.x +module.exports.safeLoad = renamed('safeLoad', 'load'); +module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll'); +module.exports.safeDump = renamed('safeDump', 'dump'); diff --git a/node_modules/js-yaml/lib/common.js b/node_modules/js-yaml/lib/common.js new file mode 100644 index 0000000..25ef7d8 --- /dev/null +++ b/node_modules/js-yaml/lib/common.js @@ -0,0 +1,59 @@ +'use strict'; + + +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} + + +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); +} + + +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; +} + + +function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; +} + + +function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; +} + + +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} + + +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; diff --git a/node_modules/js-yaml/lib/dumper.js b/node_modules/js-yaml/lib/dumper.js new file mode 100644 index 0000000..f357a6a --- /dev/null +++ b/node_modules/js-yaml/lib/dumper.js @@ -0,0 +1,965 @@ +'use strict'; + +/*eslint-disable no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var DEFAULT_SCHEMA = require('./schema/default'); + +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + + +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + +function State(options) { + this.schema = options['schema'] || DEFAULT_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} + +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, + testAmbiguousType, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'"); + } + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, + testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.tag = '?'; + } + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; +} + +module.exports.dump = dump; diff --git a/node_modules/js-yaml/lib/exception.js b/node_modules/js-yaml/lib/exception.js new file mode 100644 index 0000000..7f62daa --- /dev/null +++ b/node_modules/js-yaml/lib/exception.js @@ -0,0 +1,55 @@ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + + +function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; + } + + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; +} + + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + return this.name + ': ' + formatError(this, compact); +}; + + +module.exports = YAMLException; diff --git a/node_modules/js-yaml/lib/loader.js b/node_modules/js-yaml/lib/loader.js new file mode 100644 index 0000000..39f13f5 --- /dev/null +++ b/node_modules/js-yaml/lib/loader.js @@ -0,0 +1,1727 @@ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var makeSnippet = require('./snippet'); +var DEFAULT_SCHEMA = require('./schema/default'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_SCHEMA; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + this.legacy = options['legacy'] || false; + + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = makeSnippet(mark); + + return new YAMLException(message, mark); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, startPos) { + + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; + } + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== '!') { + if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = Object.create(null); + state.anchorMap = Object.create(null); + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; diff --git a/node_modules/js-yaml/lib/schema.js b/node_modules/js-yaml/lib/schema.js new file mode 100644 index 0000000..65b41f4 --- /dev/null +++ b/node_modules/js-yaml/lib/schema.js @@ -0,0 +1,121 @@ +'use strict'; + +/*eslint-disable max-len*/ + +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + return this.extend(definition); +} + + +Schema.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof Type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + + if (type.multi) { + throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; +}; + + +module.exports = Schema; diff --git a/node_modules/js-yaml/lib/schema/core.js b/node_modules/js-yaml/lib/schema/core.js new file mode 100644 index 0000000..608b26d --- /dev/null +++ b/node_modules/js-yaml/lib/schema/core.js @@ -0,0 +1,11 @@ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +module.exports = require('./json'); diff --git a/node_modules/js-yaml/lib/schema/default.js b/node_modules/js-yaml/lib/schema/default.js new file mode 100644 index 0000000..3af0520 --- /dev/null +++ b/node_modules/js-yaml/lib/schema/default.js @@ -0,0 +1,22 @@ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +module.exports = require('./core').extend({ + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); diff --git a/node_modules/js-yaml/lib/schema/failsafe.js b/node_modules/js-yaml/lib/schema/failsafe.js new file mode 100644 index 0000000..b7a33eb --- /dev/null +++ b/node_modules/js-yaml/lib/schema/failsafe.js @@ -0,0 +1,17 @@ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); diff --git a/node_modules/js-yaml/lib/schema/json.js b/node_modules/js-yaml/lib/schema/json.js new file mode 100644 index 0000000..b73df78 --- /dev/null +++ b/node_modules/js-yaml/lib/schema/json.js @@ -0,0 +1,19 @@ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +module.exports = require('./failsafe').extend({ + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); diff --git a/node_modules/js-yaml/lib/snippet.js b/node_modules/js-yaml/lib/snippet.js new file mode 100644 index 0000000..00e2133 --- /dev/null +++ b/node_modules/js-yaml/lib/snippet.js @@ -0,0 +1,101 @@ +'use strict'; + + +var common = require('./common'); + + +// get snippet for a single line, respecting maxLength +function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; +} + + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} + + +function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); +} + + +module.exports = makeSnippet; diff --git a/node_modules/js-yaml/lib/type.js b/node_modules/js-yaml/lib/type.js new file mode 100644 index 0000000..5e57877 --- /dev/null +++ b/node_modules/js-yaml/lib/type.js @@ -0,0 +1,66 @@ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; diff --git a/node_modules/js-yaml/lib/type/binary.js b/node_modules/js-yaml/lib/type/binary.js new file mode 100644 index 0000000..e152351 --- /dev/null +++ b/node_modules/js-yaml/lib/type/binary.js @@ -0,0 +1,125 @@ +'use strict'; + +/*eslint-disable no-bitwise*/ + + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + return new Uint8Array(result); +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); diff --git a/node_modules/js-yaml/lib/type/bool.js b/node_modules/js-yaml/lib/type/bool.js new file mode 100644 index 0000000..cb77459 --- /dev/null +++ b/node_modules/js-yaml/lib/type/bool.js @@ -0,0 +1,35 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/type/float.js b/node_modules/js-yaml/lib/type/float.js new file mode 100644 index 0000000..74d77ec --- /dev/null +++ b/node_modules/js-yaml/lib/type/float.js @@ -0,0 +1,97 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/type/int.js b/node_modules/js-yaml/lib/type/int.js new file mode 100644 index 0000000..3fe3a44 --- /dev/null +++ b/node_modules/js-yaml/lib/type/int.js @@ -0,0 +1,156 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + } + + // base 10 (except 0) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); diff --git a/node_modules/js-yaml/lib/type/map.js b/node_modules/js-yaml/lib/type/map.js new file mode 100644 index 0000000..f327bee --- /dev/null +++ b/node_modules/js-yaml/lib/type/map.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); diff --git a/node_modules/js-yaml/lib/type/merge.js b/node_modules/js-yaml/lib/type/merge.js new file mode 100644 index 0000000..ae08a86 --- /dev/null +++ b/node_modules/js-yaml/lib/type/merge.js @@ -0,0 +1,12 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); diff --git a/node_modules/js-yaml/lib/type/null.js b/node_modules/js-yaml/lib/type/null.js new file mode 100644 index 0000000..315ca4e --- /dev/null +++ b/node_modules/js-yaml/lib/type/null.js @@ -0,0 +1,35 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/type/omap.js b/node_modules/js-yaml/lib/type/omap.js new file mode 100644 index 0000000..b2b5323 --- /dev/null +++ b/node_modules/js-yaml/lib/type/omap.js @@ -0,0 +1,44 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); diff --git a/node_modules/js-yaml/lib/type/pairs.js b/node_modules/js-yaml/lib/type/pairs.js new file mode 100644 index 0000000..74b5240 --- /dev/null +++ b/node_modules/js-yaml/lib/type/pairs.js @@ -0,0 +1,53 @@ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); diff --git a/node_modules/js-yaml/lib/type/seq.js b/node_modules/js-yaml/lib/type/seq.js new file mode 100644 index 0000000..be8f77f --- /dev/null +++ b/node_modules/js-yaml/lib/type/seq.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); diff --git a/node_modules/js-yaml/lib/type/set.js b/node_modules/js-yaml/lib/type/set.js new file mode 100644 index 0000000..f885a32 --- /dev/null +++ b/node_modules/js-yaml/lib/type/set.js @@ -0,0 +1,29 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); diff --git a/node_modules/js-yaml/lib/type/str.js b/node_modules/js-yaml/lib/type/str.js new file mode 100644 index 0000000..27acc10 --- /dev/null +++ b/node_modules/js-yaml/lib/type/str.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); diff --git a/node_modules/js-yaml/lib/type/timestamp.js b/node_modules/js-yaml/lib/type/timestamp.js new file mode 100644 index 0000000..8fa9c58 --- /dev/null +++ b/node_modules/js-yaml/lib/type/timestamp.js @@ -0,0 +1,88 @@ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); diff --git a/node_modules/js-yaml/package.json b/node_modules/js-yaml/package.json new file mode 100644 index 0000000..17574da --- /dev/null +++ b/node_modules/js-yaml/package.json @@ -0,0 +1,66 @@ +{ + "name": "js-yaml", + "version": "4.1.0", + "description": "YAML 1.2 parser and serializer", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "author": "Vladimir Zapparov ", + "contributors": [ + "Aleksey V Zapparov (http://www.ixti.net/)", + "Vitaly Puzrin (https://github.com/puzrin)", + "Martin Grenfell (http://got-ravings.blogspot.com)" + ], + "license": "MIT", + "repository": "nodeca/js-yaml", + "files": [ + "index.js", + "lib/", + "bin/", + "dist/" + ], + "bin": { + "js-yaml": "bin/js-yaml.js" + }, + "module": "./dist/js-yaml.mjs", + "exports": { + ".": { + "import": "./dist/js-yaml.mjs", + "require": "./index.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "lint": "eslint .", + "test": "npm run lint && mocha", + "coverage": "npm run lint && nyc mocha && nyc report --reporter html", + "demo": "npm run lint && node support/build_demo.js", + "gh-demo": "npm run demo && gh-pages -d demo -f", + "browserify": "rollup -c support/rollup.config.js", + "prepublishOnly": "npm run gh-demo" + }, + "unpkg": "dist/js-yaml.min.js", + "jsdelivr": "dist/js-yaml.min.js", + "dependencies": { + "argparse": "^2.0.1" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-node-resolve": "^11.0.0", + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "codemirror": "^5.13.4", + "eslint": "^7.0.0", + "fast-check": "^2.8.0", + "gh-pages": "^3.1.0", + "mocha": "^8.2.1", + "nyc": "^15.1.0", + "rollup": "^2.34.1", + "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-terser": "^7.0.2", + "shelljs": "^0.8.4" + } +} diff --git a/node_modules/json-buffer/LICENSE b/node_modules/json-buffer/LICENSE new file mode 100644 index 0000000..b799ec0 --- /dev/null +++ b/node_modules/json-buffer/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2013 Dominic Tarr + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/json-buffer/README.md b/node_modules/json-buffer/README.md new file mode 100644 index 0000000..4773d63 --- /dev/null +++ b/node_modules/json-buffer/README.md @@ -0,0 +1,24 @@ +# json-buffer + +JSON functions that can convert buffers! + +[![build status](https://secure.travis-ci.org/dominictarr/json-buffer.png)](http://travis-ci.org/dominictarr/json-buffer) + +[![testling badge](https://ci.testling.com/dominictarr/json-buffer.png)](https://ci.testling.com/dominictarr/json-buffer) + +JSON mangles buffers by converting to an array... +which isn't helpful. json-buffers converts to base64 instead, +and deconverts base64 to a buffer. + +``` js +var JSONB = require('json-buffer') +var Buffer = require('buffer').Buffer + +var str = JSONB.stringify(Buffer.from('hello there!')) + +console.log(JSONB.parse(str)) //GET a BUFFER back +``` + +## License + +MIT diff --git a/node_modules/json-buffer/index.js b/node_modules/json-buffer/index.js new file mode 100644 index 0000000..16f012e --- /dev/null +++ b/node_modules/json-buffer/index.js @@ -0,0 +1,58 @@ +//TODO: handle reviver/dehydrate function like normal +//and handle indentation, like normal. +//if anyone needs this... please send pull request. + +exports.stringify = function stringify (o) { + if('undefined' == typeof o) return o + + if(o && Buffer.isBuffer(o)) + return JSON.stringify(':base64:' + o.toString('base64')) + + if(o && o.toJSON) + o = o.toJSON() + + if(o && 'object' === typeof o) { + var s = '' + var array = Array.isArray(o) + s = array ? '[' : '{' + var first = true + + for(var k in o) { + var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k]) + if(Object.hasOwnProperty.call(o, k) && !ignore) { + if(!first) + s += ',' + first = false + if (array) { + if(o[k] == undefined) + s += 'null' + else + s += stringify(o[k]) + } else if (o[k] !== void(0)) { + s += stringify(k) + ':' + stringify(o[k]) + } + } + } + + s += array ? ']' : '}' + + return s + } else if ('string' === typeof o) { + return JSON.stringify(/^:/.test(o) ? ':' + o : o) + } else if ('undefined' === typeof o) { + return 'null'; + } else + return JSON.stringify(o) +} + +exports.parse = function (s) { + return JSON.parse(s, function (key, value) { + if('string' === typeof value) { + if(/^:base64:/.test(value)) + return Buffer.from(value.substring(8), 'base64') + else + return /^:/.test(value) ? value.substring(1) : value + } + return value + }) +} diff --git a/node_modules/json-buffer/package.json b/node_modules/json-buffer/package.json new file mode 100644 index 0000000..346747f --- /dev/null +++ b/node_modules/json-buffer/package.json @@ -0,0 +1,34 @@ +{ + "name": "json-buffer", + "description": "JSON parse & stringify that supports binary via bops & base64", + "version": "3.0.1", + "homepage": "https://github.com/dominictarr/json-buffer", + "repository": { + "type": "git", + "url": "git://github.com/dominictarr/json-buffer.git" + }, + "devDependencies": { + "tape": "^4.6.3" + }, + "scripts": { + "test": "set -e; for t in test/*.js; do node $t; done" + }, + "author": "Dominic Tarr (http://dominictarr.com)", + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/node_modules/json-buffer/test/index.js b/node_modules/json-buffer/test/index.js new file mode 100644 index 0000000..94e8372 --- /dev/null +++ b/node_modules/json-buffer/test/index.js @@ -0,0 +1,63 @@ + +var test = require('tape') +var _JSON = require('../') + +function clone (o) { + return JSON.parse(JSON.stringify(o)) +} + +var examples = { + simple: { foo: [], bar: {}, baz: Buffer.from('some binary data') }, + just_buffer: Buffer.from('JUST A BUFFER'), + all_types: { + string:'hello', + number: 3145, + null: null, + object: {}, + array: [], + boolean: true, + boolean2: false + }, + foo: Buffer.from('foo'), + foo2: Buffer.from('foo2'), + escape: { + buffer: Buffer.from('x'), + string: _JSON.stringify(Buffer.from('x')) + }, + escape2: { + buffer: Buffer.from('x'), + string: ':base64:'+ Buffer.from('x').toString('base64') + }, + undefined: { + empty: undefined, test: true + }, + undefined2: { + first: 1, empty: undefined, test: true + }, + undefinedArray: { + array: [undefined, 1, 'two'] + }, + fn: { + fn: function () {} + }, + undefined: undefined +} + +for(k in examples) +(function (value, k) { + test(k, function (t) { + var s = _JSON.stringify(value) + console.log('parse', s) + if(JSON.stringify(value) !== undefined) { + console.log(s) + var _value = _JSON.parse(s) + t.deepEqual(clone(_value), clone(value)) + } + else + t.equal(s, undefined) + t.end() + }) +})(examples[k], k) + + + diff --git a/node_modules/json-schema-traverse/LICENSE b/node_modules/json-schema-traverse/LICENSE new file mode 100644 index 0000000..7f15435 --- /dev/null +++ b/node_modules/json-schema-traverse/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/json-schema-traverse/README.md b/node_modules/json-schema-traverse/README.md new file mode 100644 index 0000000..d5ccaf4 --- /dev/null +++ b/node_modules/json-schema-traverse/README.md @@ -0,0 +1,83 @@ +# json-schema-traverse +Traverse JSON Schema passing each schema object to callback + +[![Build Status](https://travis-ci.org/epoberezkin/json-schema-traverse.svg?branch=master)](https://travis-ci.org/epoberezkin/json-schema-traverse) +[![npm version](https://badge.fury.io/js/json-schema-traverse.svg)](https://www.npmjs.com/package/json-schema-traverse) +[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) + + +## Install + +``` +npm install json-schema-traverse +``` + + +## Usage + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + properties: { + foo: {type: 'string'}, + bar: {type: 'integer'} + } +}; + +traverse(schema, {cb}); +// cb is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} + +// Or: + +traverse(schema, {cb: {pre, post}}); +// pre is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} +// +// post is called 3 times with: +// 1. {type: 'string'} +// 2. {type: 'integer'} +// 3. root schema + +``` + +Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. + +Callback is passed these parameters: + +- _schema_: the current schema object +- _JSON pointer_: from the root schema to the current schema object +- _root schema_: the schema passed to `traverse` object +- _parent JSON pointer_: from the root schema to the parent schema object (see below) +- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) +- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema +- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` + + +## Traverse objects in all unknown keywords + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + mySchema: { + minimum: 1, + maximum: 2 + } +}; + +traverse(schema, {allKeys: true, cb}); +// cb is called 2 times with: +// 1. root schema +// 2. mySchema +``` + +Without option `allKeys: true` callback will be called only with root schema. + + +## License + +[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) diff --git a/node_modules/json-schema-traverse/index.js b/node_modules/json-schema-traverse/index.js new file mode 100644 index 0000000..d4a18df --- /dev/null +++ b/node_modules/json-schema-traverse/index.js @@ -0,0 +1,89 @@ +'use strict'; + +var traverse = module.exports = function (schema, opts, cb) { + // Legacy support for v0.3.1 and earlier. + if (typeof opts == 'function') { + cb = opts; + opts = {}; + } + + cb = opts.cb || cb; + var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; + var post = cb.post || function() {}; + + _traverse(opts, pre, post, schema, '', schema); +}; + + +traverse.keywords = { + additionalItems: true, + items: true, + contains: true, + additionalProperties: true, + propertyNames: true, + not: true +}; + +traverse.arrayKeywords = { + items: true, + allOf: true, + anyOf: true, + oneOf: true +}; + +traverse.propsKeywords = { + definitions: true, + properties: true, + patternProperties: true, + dependencies: true +}; + +traverse.skipKeywords = { + default: true, + enum: true, + const: true, + required: true, + maximum: true, + minimum: true, + exclusiveMaximum: true, + exclusiveMinimum: true, + multipleOf: true, + maxLength: true, + minLength: true, + pattern: true, + format: true, + maxItems: true, + minItems: true, + uniqueItems: true, + maxProperties: true, + minProperties: true +}; + + +function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (schema && typeof schema == 'object' && !Array.isArray(schema)) { + pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + for (var key in schema) { + var sch = schema[key]; + if (Array.isArray(sch)) { + if (key in traverse.arrayKeywords) { + for (var i=0; i + keyv +
+
+ + +> Simple key-value storage with support for multiple backends + +[![build](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml) +[![codecov](https://codecov.io/gh/jaredwray/keyv/branch/main/graph/badge.svg?token=bRzR3RyOXZ)](https://codecov.io/gh/jaredwray/keyv) +[![npm](https://img.shields.io/npm/dm/keyv.svg)](https://www.npmjs.com/package/keyv) +[![npm](https://img.shields.io/npm/v/keyv.svg)](https://www.npmjs.com/package/keyv) + +Keyv provides a consistent interface for key-value storage across multiple backends via storage adapters. It supports TTL based expiry, making it suitable as a cache or a persistent key-value store. + +## Features + +There are a few existing modules similar to Keyv, however Keyv is different because it: + +- Isn't bloated +- Has a simple Promise based API +- Suitable as a TTL based cache or persistent key-value store +- [Easily embeddable](#add-cache-support-to-your-module) inside another module +- Works with any storage that implements the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) API +- Handles all JSON types plus `Buffer` +- Supports namespaces +- Wide range of [**efficient, well tested**](#official-storage-adapters) storage adapters +- Connection errors are passed through (db failures won't kill your app) +- Supports the current active LTS version of Node.js or higher + +## Usage + +Install Keyv. + +``` +npm install --save keyv +``` + +By default everything is stored in memory, you can optionally also install a storage adapter. + +``` +npm install --save @keyv/redis +npm install --save @keyv/mongo +npm install --save @keyv/sqlite +npm install --save @keyv/postgres +npm install --save @keyv/mysql +npm install --save @keyv/etcd +``` + +Create a new Keyv instance, passing your connection string if applicable. Keyv will automatically load the correct storage adapter. + +```js +const Keyv = require('keyv'); + +// One of the following +const keyv = new Keyv(); +const keyv = new Keyv('redis://user:pass@localhost:6379'); +const keyv = new Keyv('mongodb://user:pass@localhost:27017/dbname'); +const keyv = new Keyv('sqlite://path/to/database.sqlite'); +const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname'); +const keyv = new Keyv('mysql://user:pass@localhost:3306/dbname'); +const keyv = new Keyv('etcd://localhost:2379'); + +// Handle DB connection errors +keyv.on('error', err => console.log('Connection Error', err)); + +await keyv.set('foo', 'expires in 1 second', 1000); // true +await keyv.set('foo', 'never expires'); // true +await keyv.get('foo'); // 'never expires' +await keyv.delete('foo'); // true +await keyv.clear(); // undefined +``` + +### Namespaces + +You can namespace your Keyv instance to avoid key collisions and allow you to clear only a certain namespace while using the same database. + +```js +const users = new Keyv('redis://user:pass@localhost:6379', { namespace: 'users' }); +const cache = new Keyv('redis://user:pass@localhost:6379', { namespace: 'cache' }); + +await users.set('foo', 'users'); // true +await cache.set('foo', 'cache'); // true +await users.get('foo'); // 'users' +await cache.get('foo'); // 'cache' +await users.clear(); // undefined +await users.get('foo'); // undefined +await cache.get('foo'); // 'cache' +``` + +### Custom Serializers + +Keyv uses [`json-buffer`](https://github.com/dominictarr/json-buffer) for data serialization to ensure consistency across different backends. + +You can optionally provide your own serialization functions to support extra data types or to serialize to something other than JSON. + +```js +const keyv = new Keyv({ serialize: JSON.stringify, deserialize: JSON.parse }); +``` + +**Warning:** Using custom serializers means you lose any guarantee of data consistency. You should do extensive testing with your serialisation functions and chosen storage engine. + +## Official Storage Adapters + +The official storage adapters are covered by [over 150 integration tests](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml) to guarantee consistent behaviour. They are lightweight, efficient wrappers over the DB clients making use of indexes and native TTLs where available. + +Database | Adapter | Native TTL +---|---|--- +Redis | [@keyv/redis](https://github.com/jaredwray/keyv/tree/master/packages/redis) | Yes +MongoDB | [@keyv/mongo](https://github.com/jaredwray/keyv/tree/master/packages/mongo) | Yes +SQLite | [@keyv/sqlite](https://github.com/jaredwray/keyv/tree/master/packages/sqlite) | No +PostgreSQL | [@keyv/postgres](https://github.com/jaredwray/keyv/tree/master/packages/postgres) | No +MySQL | [@keyv/mysql](https://github.com/jaredwray/keyv/tree/master/packages/mysql) | No +Etcd | [@keyv/etcd](https://github.com/jaredwray/keyv/tree/master/packages/etcd) | Yes +Memcache | [@keyv/memcache](https://github.com/jaredwray/keyv/tree/master/packages/memcache) | Yes + +## Third-party Storage Adapters + +You can also use third-party storage adapters or build your own. Keyv will wrap these storage adapters in TTL functionality and handle complex types internally. + +```js +const Keyv = require('keyv'); +const myAdapter = require('./my-storage-adapter'); + +const keyv = new Keyv({ store: myAdapter }); +``` + +Any store that follows the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) api will work. + +```js +new Keyv({ store: new Map() }); +``` + +For example, [`quick-lru`](https://github.com/sindresorhus/quick-lru) is a completely unrelated module that implements the Map API. + +```js +const Keyv = require('keyv'); +const QuickLRU = require('quick-lru'); + +const lru = new QuickLRU({ maxSize: 1000 }); +const keyv = new Keyv({ store: lru }); +``` + +The following are third-party storage adapters compatible with Keyv: + +- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple "Least Recently Used" (LRU) cache +- [keyv-file](https://github.com/zaaack/keyv-file) - File system storage adapter for Keyv +- [keyv-dynamodb](https://www.npmjs.com/package/keyv-dynamodb) - DynamoDB storage adapter for Keyv +- [keyv-lru](https://www.npmjs.com/package/keyv-lru) - LRU storage adapter for Keyv +- [keyv-null](https://www.npmjs.com/package/keyv-null) - Null storage adapter for Keyv +- [keyv-firestore ](https://github.com/goto-bus-stop/keyv-firestore) – Firebase Cloud Firestore adapter for Keyv +- [keyv-mssql](https://github.com/pmorgan3/keyv-mssql) - Microsoft Sql Server adapter for Keyv +- [keyv-azuretable](https://github.com/howlowck/keyv-azuretable) - Azure Table Storage/API adapter for Keyv +- [keyv-arango](https://github.com/TimMikeladze/keyv-arango) - ArangoDB storage adapter for Keyv +- [keyv-momento](https://github.com/momentohq/node-keyv-adaptor/) - Momento storage adapter for Keyv + +## Add Cache Support to your Module + +Keyv is designed to be easily embedded into other modules to add cache support. The recommended pattern is to expose a `cache` option in your modules options which is passed through to Keyv. Caching will work in memory by default and users have the option to also install a Keyv storage adapter and pass in a connection string, or any other storage that implements the `Map` API. + +You should also set a namespace for your module so you can safely call `.clear()` without clearing unrelated app data. + +Inside your module: + +```js +class AwesomeModule { + constructor(opts) { + this.cache = new Keyv({ + uri: typeof opts.cache === 'string' && opts.cache, + store: typeof opts.cache !== 'string' && opts.cache, + namespace: 'awesome-module' + }); + } +} +``` + +Now it can be consumed like this: + +```js +const AwesomeModule = require('awesome-module'); + +// Caches stuff in memory by default +const awesomeModule = new AwesomeModule(); + +// After npm install --save keyv-redis +const awesomeModule = new AwesomeModule({ cache: 'redis://localhost' }); + +// Some third-party module that implements the Map API +const awesomeModule = new AwesomeModule({ cache: some3rdPartyStore }); +``` + +## Compression + +Keyv supports `gzip` and `brotli` compression. To enable compression, pass the `compress` option to the constructor. + +```js +const KeyvGzip = require('@keyv/compress-gzip'); +const Keyv = require('keyv'); + +const keyvGzip = new KeyvGzip(); +const keyv = new Keyv({ compression: KeyvGzip }); +``` + +You can also pass a custom compression function to the `compression` option. Following the pattern of the official compression adapters. + +### Want to build your own? + +Great! Keyv is designed to be easily extended. You can build your own compression adapter by following the pattern of the official compression adapters based on this interface: + +```typescript +interface CompressionAdapter { + async compress(value: any, options?: any); + async decompress(value: any, options?: any); + async serialize(value: any); + async deserialize(value: any); +} +``` + +In addition to the interface, you can test it with our compression test suite using @keyv/test-suite: + +```js +const {keyvCompresstionTests} = require('@keyv/test-suite'); +const KeyvGzip = require('@keyv/compress-gzip'); + +keyvCompresstionTests(test, new KeyvGzip()); +``` + +## API + +### new Keyv([uri], [options]) + +Returns a new Keyv instance. + +The Keyv instance is also an `EventEmitter` that will emit an `'error'` event if the storage adapter connection fails. + +### uri + +Type: `String`
+Default: `undefined` + +The connection string URI. + +Merged into the options object as options.uri. + +### options + +Type: `Object` + +The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. + +#### options.namespace + +Type: `String`
+Default: `'keyv'` + +Namespace for the current instance. + +#### options.ttl + +Type: `Number`
+Default: `undefined` + +Default TTL. Can be overridden by specififying a TTL on `.set()`. + +#### options.compression + +Type: `@keyv/compress-`
+Default: `undefined` + +Compression package to use. See [Compression](#compression) for more details. + +#### options.serialize + +Type: `Function`
+Default: `JSONB.stringify` + +A custom serialization function. + +#### options.deserialize + +Type: `Function`
+Default: `JSONB.parse` + +A custom deserialization function. + +#### options.store + +Type: `Storage adapter instance`
+Default: `new Map()` + +The storage adapter instance to be used by Keyv. + +#### options.adapter + +Type: `String`
+Default: `undefined` + +Specify an adapter to use. e.g `'redis'` or `'mongodb'`. + +### Instance + +Keys must always be strings. Values can be of any type. + +#### .set(key, value, [ttl]) + +Set a value. + +By default keys are persistent. You can set an expiry TTL in milliseconds. + +Returns a promise which resolves to `true`. + +#### .get(key, [options]) + +Returns a promise which resolves to the retrieved value. + +##### options.raw + +Type: `Boolean`
+Default: `false` + +If set to true the raw DB object Keyv stores internally will be returned instead of just the value. + +This contains the TTL timestamp. + +#### .delete(key) + +Deletes an entry. + +Returns a promise which resolves to `true` if the key existed, `false` if not. + +#### .clear() + +Delete all entries in the current namespace. + +Returns a promise which is resolved when the entries have been cleared. + +#### .iterator() + +Iterate over all entries of the current namespace. + +Returns a iterable that can be iterated by for-of loops. For example: + +```js +// please note that the "await" keyword should be used here +for await (const [key, value] of this.keyv.iterator()) { + console.log(key, value); +}; +``` + +# How to Contribute + +In this section of the documentation we will cover: + +1) How to set up this repository locally +2) How to get started with running commands +3) How to contribute changes using Pull Requests + +## Dependencies + +This package requires the following dependencies to run: + +1) [Yarn V1](https://yarnpkg.com/getting-started/install) +3) [Docker](https://docs.docker.com/get-docker/) + +## Setting up your workspace + +To contribute to this repository, start by setting up this project locally: + +1) Fork this repository into your Git account +2) Clone the forked repository to your local directory using `git clone` +3) Install any of the above missing dependencies + +## Launching the project + +Once the project is installed locally, you are ready to start up its services: + +1) Ensure that your Docker service is running. +2) From the root directory of your project, run the `yarn` command in the command prompt to install yarn. +3) Run the `yarn bootstrap` command to install any necessary dependencies. +4) Run `yarn test:services:start` to start up this project's Docker container. The container will launch all services within your workspace. + +## Available Commands + +Once the project is running, you can execute a variety of commands. The root workspace and each subpackage contain a `package.json` file with a `scripts` field listing all the commands that can be executed from that directory. This project also supports native `yarn`, and `docker` commands. + +Here, we'll cover the primary commands that can be executed from the root directory. Unless otherwise noted, these commands can also be executed from a subpackage. If executed from a subpackage, they will only affect that subpackage, rather than the entire workspace. + +### `yarn` + +The `yarn` command installs yarn in the workspace. + +### `yarn bootstrap` + +The `yarn bootstrap` command installs all dependencies in the workspace. + +### `yarn test:services:start` + +The `yarn test:services:start` command starts up the project's Docker container, launching all services in the workspace. This command must be executed from the root directory. + +### `yarn test:services:stop` + +The `yarn test:services:stop` command brings down the project's Docker container, halting all services. This command must be executed from the root directory. + +### `yarn test` + +The `yarn test` command runs all tests in the workspace. + +### `yarn clean` + +The `yarn clean` command removes yarn and all dependencies installed by yarn. After executing this command, you must repeat the steps in *Setting up your workspace* to rebuild your workspace. + +## Contributing Changes + +Now that you've set up your workspace, you're ready to contribute changes to the `keyv` repository. + +1) Make any changes that you would like to contribute in your local workspace. +2) After making these changes, ensure that the project's tests still pass by executing the `yarn test` command in the root directory. +3) Commit your changes and push them to your forked repository. +4) Navigate to the original `keyv` repository and go the *Pull Requests* tab. +5) Click the *New pull request* button, and open a pull request for the branch in your repository that contains your changes. +6) Once your pull request is created, ensure that all checks have passed and that your branch has no conflicts with the base branch. If there are any issues, resolve these changes in your local repository, and then commit and push them to git. +7) Similarly, respond to any reviewer comments or requests for changes by making edits to your local repository and pushing them to Git. +8) Once the pull request has been reviewed, those with write access to the branch will be able to merge your changes into the `keyv` repository. + +If you need more information on the steps to create a pull request, you can find a detailed walkthrough in the [Github documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) + +## License + +MIT © Jared Wray diff --git a/node_modules/keyv/package.json b/node_modules/keyv/package.json new file mode 100644 index 0000000..a830461 --- /dev/null +++ b/node_modules/keyv/package.json @@ -0,0 +1,57 @@ +{ + "name": "keyv", + "version": "4.5.4", + "description": "Simple key-value storage with support for multiple backends", + "main": "src/index.js", + "scripts": { + "build": "echo 'No build step required.'", + "prepare": "yarn build", + "test": "xo && c8 ava --serial", + "test:ci": "xo && ava --serial", + "clean": "rm -rf node_modules && rm -rf ./coverage && rm -rf ./test/testdb.sqlite" + }, + "xo": { + "rules": { + "unicorn/prefer-module": 0, + "unicorn/prefer-node-protocol": 0, + "@typescript-eslint/consistent-type-definitions": 0, + "unicorn/no-typeof-undefined": 0, + "unicorn/prefer-event-target": 0 + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jaredwray/keyv.git" + }, + "keywords": [ + "key", + "value", + "store", + "cache", + "ttl" + ], + "author": "Jared Wray (http://jaredwray.com)", + "license": "MIT", + "bugs": { + "url": "https://github.com/jaredwray/keyv/issues" + }, + "homepage": "https://github.com/jaredwray/keyv", + "dependencies": { + "json-buffer": "3.0.1" + }, + "devDependencies": { + "@keyv/test-suite": "*", + "eslint": "^8.51.0", + "eslint-plugin-promise": "^6.1.1", + "pify": "^5.0.0", + "timekeeper": "^2.3.1", + "tsd": "^0.29.0" + }, + "tsd": { + "directory": "test" + }, + "types": "./src/index.d.ts", + "files": [ + "src" + ] +} diff --git a/node_modules/keyv/src/index.js b/node_modules/keyv/src/index.js new file mode 100644 index 0000000..ac539bd --- /dev/null +++ b/node_modules/keyv/src/index.js @@ -0,0 +1,259 @@ +'use strict'; + +const EventEmitter = require('events'); +const JSONB = require('json-buffer'); + +const loadStore = options => { + const adapters = { + redis: '@keyv/redis', + rediss: '@keyv/redis', + mongodb: '@keyv/mongo', + mongo: '@keyv/mongo', + sqlite: '@keyv/sqlite', + postgresql: '@keyv/postgres', + postgres: '@keyv/postgres', + mysql: '@keyv/mysql', + etcd: '@keyv/etcd', + offline: '@keyv/offline', + tiered: '@keyv/tiered', + }; + if (options.adapter || options.uri) { + const adapter = options.adapter || /^[^:+]*/.exec(options.uri)[0]; + return new (require(adapters[adapter]))(options); + } + + return new Map(); +}; + +const iterableAdapters = [ + 'sqlite', + 'postgres', + 'mysql', + 'mongo', + 'redis', + 'tiered', +]; + +class Keyv extends EventEmitter { + constructor(uri, {emitErrors = true, ...options} = {}) { + super(); + this.opts = { + namespace: 'keyv', + serialize: JSONB.stringify, + deserialize: JSONB.parse, + ...((typeof uri === 'string') ? {uri} : uri), + ...options, + }; + + if (!this.opts.store) { + const adapterOptions = {...this.opts}; + this.opts.store = loadStore(adapterOptions); + } + + if (this.opts.compression) { + const compression = this.opts.compression; + this.opts.serialize = compression.serialize.bind(compression); + this.opts.deserialize = compression.deserialize.bind(compression); + } + + if (typeof this.opts.store.on === 'function' && emitErrors) { + this.opts.store.on('error', error => this.emit('error', error)); + } + + this.opts.store.namespace = this.opts.namespace; + + const generateIterator = iterator => async function * () { + for await (const [key, raw] of typeof iterator === 'function' + ? iterator(this.opts.store.namespace) + : iterator) { + const data = await this.opts.deserialize(raw); + if (this.opts.store.namespace && !key.includes(this.opts.store.namespace)) { + continue; + } + + if (typeof data.expires === 'number' && Date.now() > data.expires) { + this.delete(key); + continue; + } + + yield [this._getKeyUnprefix(key), data.value]; + } + }; + + // Attach iterators + if (typeof this.opts.store[Symbol.iterator] === 'function' && this.opts.store instanceof Map) { + this.iterator = generateIterator(this.opts.store); + } else if (typeof this.opts.store.iterator === 'function' && this.opts.store.opts + && this._checkIterableAdaptar()) { + this.iterator = generateIterator(this.opts.store.iterator.bind(this.opts.store)); + } + } + + _checkIterableAdaptar() { + return iterableAdapters.includes(this.opts.store.opts.dialect) + || iterableAdapters.findIndex(element => this.opts.store.opts.url.includes(element)) >= 0; + } + + _getKeyPrefix(key) { + return `${this.opts.namespace}:${key}`; + } + + _getKeyPrefixArray(keys) { + return keys.map(key => `${this.opts.namespace}:${key}`); + } + + _getKeyUnprefix(key) { + return key + .split(':') + .splice(1) + .join(':'); + } + + get(key, options) { + const {store} = this.opts; + const isArray = Array.isArray(key); + const keyPrefixed = isArray ? this._getKeyPrefixArray(key) : this._getKeyPrefix(key); + if (isArray && store.getMany === undefined) { + const promises = []; + for (const key of keyPrefixed) { + promises.push(Promise.resolve() + .then(() => store.get(key)) + .then(data => (typeof data === 'string') ? this.opts.deserialize(data) : (this.opts.compression ? this.opts.deserialize(data) : data)) + .then(data => { + if (data === undefined || data === null) { + return undefined; + } + + if (typeof data.expires === 'number' && Date.now() > data.expires) { + return this.delete(key).then(() => undefined); + } + + return (options && options.raw) ? data : data.value; + }), + ); + } + + return Promise.allSettled(promises) + .then(values => { + const data = []; + for (const value of values) { + data.push(value.value); + } + + return data; + }); + } + + return Promise.resolve() + .then(() => isArray ? store.getMany(keyPrefixed) : store.get(keyPrefixed)) + .then(data => (typeof data === 'string') ? this.opts.deserialize(data) : (this.opts.compression ? this.opts.deserialize(data) : data)) + .then(data => { + if (data === undefined || data === null) { + return undefined; + } + + if (isArray) { + return data.map((row, index) => { + if ((typeof row === 'string')) { + row = this.opts.deserialize(row); + } + + if (row === undefined || row === null) { + return undefined; + } + + if (typeof row.expires === 'number' && Date.now() > row.expires) { + this.delete(key[index]).then(() => undefined); + return undefined; + } + + return (options && options.raw) ? row : row.value; + }); + } + + if (typeof data.expires === 'number' && Date.now() > data.expires) { + return this.delete(key).then(() => undefined); + } + + return (options && options.raw) ? data : data.value; + }); + } + + set(key, value, ttl) { + const keyPrefixed = this._getKeyPrefix(key); + if (typeof ttl === 'undefined') { + ttl = this.opts.ttl; + } + + if (ttl === 0) { + ttl = undefined; + } + + const {store} = this.opts; + + return Promise.resolve() + .then(() => { + const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; + if (typeof value === 'symbol') { + this.emit('error', 'symbol cannot be serialized'); + } + + value = {value, expires}; + return this.opts.serialize(value); + }) + .then(value => store.set(keyPrefixed, value, ttl)) + .then(() => true); + } + + delete(key) { + const {store} = this.opts; + if (Array.isArray(key)) { + const keyPrefixed = this._getKeyPrefixArray(key); + if (store.deleteMany === undefined) { + const promises = []; + for (const key of keyPrefixed) { + promises.push(store.delete(key)); + } + + return Promise.allSettled(promises) + .then(values => values.every(x => x.value === true)); + } + + return Promise.resolve() + .then(() => store.deleteMany(keyPrefixed)); + } + + const keyPrefixed = this._getKeyPrefix(key); + return Promise.resolve() + .then(() => store.delete(keyPrefixed)); + } + + clear() { + const {store} = this.opts; + return Promise.resolve() + .then(() => store.clear()); + } + + has(key) { + const keyPrefixed = this._getKeyPrefix(key); + const {store} = this.opts; + return Promise.resolve() + .then(async () => { + if (typeof store.has === 'function') { + return store.has(keyPrefixed); + } + + const value = await store.get(keyPrefixed); + return value !== undefined; + }); + } + + disconnect() { + const {store} = this.opts; + if (typeof store.disconnect === 'function') { + return store.disconnect(); + } + } +} + +module.exports = Keyv; diff --git a/node_modules/levn/LICENSE b/node_modules/levn/LICENSE new file mode 100644 index 0000000..525b118 --- /dev/null +++ b/node_modules/levn/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) George Zahariev + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/levn/README.md b/node_modules/levn/README.md new file mode 100644 index 0000000..7ab008d --- /dev/null +++ b/node_modules/levn/README.md @@ -0,0 +1,196 @@ +# levn [![Build Status](https://travis-ci.org/gkz/levn.png)](https://travis-ci.org/gkz/levn) +__Light ECMAScript (JavaScript) Value Notation__ +Levn is a library which allows you to parse a string into a JavaScript value based on an expected type. It is meant for short amounts of human entered data (eg. config files, command line arguments). + +Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.4.1. + +__How is this different than JSON?__ levn is meant to be written by humans only, is (due to the previous point) much more concise, can be validated against supplied types, has regex and date literals, and can easily be extended with custom types. On the other hand, it is probably slower and thus less efficient at transporting large amounts of data, which is fine since this is not its purpose. + + npm install levn + +For updates on levn, [follow me on twitter](https://twitter.com/gkzahariev). + + +## Quick Examples + +```js +var parse = require('levn').parse; +parse('Number', '2'); // 2 +parse('String', '2'); // '2' +parse('String', 'levn'); // 'levn' +parse('String', 'a b'); // 'a b' +parse('Boolean', 'true'); // true + +parse('Date', '#2011-11-11#'); // (Date object) +parse('Date', '2011-11-11'); // (Date object) +parse('RegExp', '/[a-z]/gi'); // /[a-z]/gi +parse('RegExp', 're'); // /re/ +parse('Int', '2'); // 2 + +parse('Number | String', 'str'); // 'str' +parse('Number | String', '2'); // 2 + +parse('[Number]', '[1,2,3]'); // [1,2,3] +parse('(String, Boolean)', '(hi, false)'); // ['hi', false] +parse('{a: String, b: Number}', '{a: str, b: 2}'); // {a: 'str', b: 2} + +// at the top level, you can ommit surrounding delimiters +parse('[Number]', '1,2,3'); // [1,2,3] +parse('(String, Boolean)', 'hi, false'); // ['hi', false] +parse('{a: String, b: Number}', 'a: str, b: 2'); // {a: 'str', b: 2} + +// wildcard - auto choose type +parse('*', '[hi,(null,[42]),{k: true}]'); // ['hi', [null, [42]], {k: true}] +``` +## Usage + +`require('levn');` returns an object that exposes three properties. `VERSION` is the current version of the library as a string. `parse` and `parsedTypeParse` are functions. + +```js +// parse(type, input, options); +parse('[Number]', '1,2,3'); // [1, 2, 3] + +// parsedTypeParse(parsedType, input, options); +var parsedType = require('type-check').parseType('[Number]'); +parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] +``` + +### parse(type, input, options) + +`parse` casts the string `input` into a JavaScript value according to the specified `type` in the [type format](https://github.com/gkz/type-check#type-format) (and taking account the optional `options`) and returns the resulting JavaScript value. + +##### arguments +* type - `String` - the type written in the [type format](https://github.com/gkz/type-check#type-format) which to check against +* input - `String` - the value written in the [levn format](#levn-format) +* options - `Maybe Object` - an optional parameter specifying additional [options](#options) + +##### returns +`*` - the resulting JavaScript value + +##### example +```js +parse('[Number]', '1,2,3'); // [1, 2, 3] +``` + +### parsedTypeParse(parsedType, input, options) + +`parsedTypeParse` casts the string `input` into a JavaScript value according to the specified `type` which has already been parsed (and taking account the optional `options`) and returns the resulting JavaScript value. You can parse a type using the [type-check](https://github.com/gkz/type-check) library's `parseType` function. + +##### arguments +* type - `Object` - the type in the parsed type format which to check against +* input - `String` - the value written in the [levn format](#levn-format) +* options - `Maybe Object` - an optional parameter specifying additional [options](#options) + +##### returns +`*` - the resulting JavaScript value + +##### example +```js +var parsedType = require('type-check').parseType('[Number]'); +parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] +``` + +## Levn Format + +Levn can use the type information you provide to choose the appropriate value to produce from the input. For the same input, it will choose a different output value depending on the type provided. For example, `parse('Number', '2')` will produce the number `2`, but `parse('String', '2')` will produce the string `"2"`. + +If you do not provide type information, and simply use `*`, levn will parse the input according the unambiguous "explicit" mode, which we will now detail - you can also set the `explicit` option to true manually in the [options](#options). + +* `"string"`, `'string'` are parsed as a String, eg. `"a msg"` is `"a msg"` +* `#date#` is parsed as a Date, eg. `#2011-11-11#` is `new Date('2011-11-11')` +* `/regexp/flags` is parsed as a RegExp, eg. `/re/gi` is `/re/gi` +* `undefined`, `null`, `NaN`, `true`, and `false` are all their JavaScript equivalents +* `[element1, element2, etc]` is an Array, and the casting procedure is recursively applied to each element. Eg. `[1,2,3]` is `[1,2,3]`. +* `(element1, element2, etc)` is an tuple, and the casting procedure is recursively applied to each element. Eg. `(1, a)` is `(1, a)` (is `[1, 'a']`). +* `{key1: val1, key2: val2, ...}` is an Object, and the casting procedure is recursively applied to each property. Eg. `{a: 1, b: 2}` is `{a: 1, b: 2}`. +* Any test which does not fall under the above, and which does not contain special characters (`[``]``(``)``{``}``:``,`) is a string, eg. `$12- blah` is `"$12- blah"`. + +If you do provide type information, you can make your input more concise as the program already has some information about what it expects. Please see the [type format](https://github.com/gkz/type-check#type-format) section of [type-check](https://github.com/gkz/type-check) for more information about how to specify types. There are some rules about what levn can do with the information: + +* If a String is expected, and only a String, all characters of the input (including any special ones) will become part of the output. Eg. `[({})]` is `"[({})]"`, and `"hi"` is `'"hi"'`. +* If a Date is expected, the surrounding `#` can be omitted from date literals. Eg. `2011-11-11` is `new Date('2011-11-11')`. +* If a RegExp is expected, no flags need to be specified, and the regex is not using any of the special characters,the opening and closing `/` can be omitted - this will have the affect of setting the source of the regex to the input. Eg. `regex` is `/regex/`. +* If an Array is expected, and it is the root node (at the top level), the opening `[` and closing `]` can be omitted. Eg. `1,2,3` is `[1,2,3]`. +* If a tuple is expected, and it is the root node (at the top level), the opening `(` and closing `)` can be omitted. Eg. `1, a` is `(1, a)` (is `[1, 'a']`). +* If an Object is expected, and it is the root node (at the top level), the opening `{` and closing `}` can be omitted. Eg `a: 1, b: 2` is `{a: 1, b: 2}`. + +If you list multiple types (eg. `Number | String`), it will first attempt to cast to the first type and then validate - if the validation fails it will move on to the next type and so forth, left to right. You must be careful as some types will succeed with any input, such as String. Thus put String at the end of your list. In non-explicit mode, Date and RegExp will succeed with a large variety of input - also be careful with these and list them near the end if not last in your list. + +Whitespace between special characters and elements is inconsequential. + +## Options + +Options is an object. It is an optional parameter to the `parse` and `parsedTypeParse` functions. + +### Explicit + +A `Boolean`. By default it is `false`. + +__Example:__ + +```js +parse('RegExp', 're', {explicit: false}); // /re/ +parse('RegExp', 're', {explicit: true}); // Error: ... does not type check... +parse('RegExp | String', 're', {explicit: true}); // 're' +``` + +`explicit` sets whether to be in explicit mode or not. Using `*` automatically activates explicit mode. For more information, read the [levn format](#levn-format) section. + +### customTypes + +An `Object`. Empty `{}` by default. + +__Example:__ + +```js +var options = { + customTypes: { + Even: { + typeOf: 'Number', + validate: function (x) { + return x % 2 === 0; + }, + cast: function (x) { + return {type: 'Just', value: parseInt(x)}; + } + } + } +} +parse('Even', '2', options); // 2 +parse('Even', '3', options); // Error: Value: "3" does not type check... +``` + +__Another Example:__ +```js +function Person(name, age){ + this.name = name; + this.age = age; +} +var options = { + customTypes: { + Person: { + typeOf: 'Object', + validate: function (x) { + x instanceof Person; + }, + cast: function (value, options, typesCast) { + var name, age; + if ({}.toString.call(value).slice(8, -1) !== 'Object') { + return {type: 'Nothing'}; + } + name = typesCast(value.name, [{type: 'String'}], options); + age = typesCast(value.age, [{type: 'Numger'}], options); + return {type: 'Just', value: new Person(name, age)}; + } + } +} +parse('Person', '{name: Laura, age: 25}', options); // Person {name: 'Laura', age: 25} +``` + +`customTypes` is an object whose keys are the name of the types, and whose values are an object with three properties, `typeOf`, `validate`, and `cast`. For more information about `typeOf` and `validate`, please see the [custom types](https://github.com/gkz/type-check#custom-types) section of type-check. + +`cast` is a function which receives three arguments, the value under question, options, and the typesCast function. In `cast`, attempt to cast the value into the specified type. If you are successful, return an object in the format `{type: 'Just', value: CAST-VALUE}`, if you know it won't work, return `{type: 'Nothing'}`. You can use the `typesCast` function to cast any child values. Remember to pass `options` to it. In your function you can also check for `options.explicit` and act accordingly. + +## Technical About + +`levn` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [type-check](https://github.com/gkz/type-check) to both parse types and validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/levn/lib/cast.js b/node_modules/levn/lib/cast.js new file mode 100644 index 0000000..92cb9a6 --- /dev/null +++ b/node_modules/levn/lib/cast.js @@ -0,0 +1,327 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var parsedTypeCheck, types, toString$ = {}.toString; + parsedTypeCheck = require('type-check').parsedTypeCheck; + types = { + '*': function(value, options){ + switch (toString$.call(value).slice(8, -1)) { + case 'Array': + return typeCast(value, { + type: 'Array' + }, options); + case 'Object': + return typeCast(value, { + type: 'Object' + }, options); + default: + return { + type: 'Just', + value: typesCast(value, [ + { + type: 'Undefined' + }, { + type: 'Null' + }, { + type: 'NaN' + }, { + type: 'Boolean' + }, { + type: 'Number' + }, { + type: 'Date' + }, { + type: 'RegExp' + }, { + type: 'Array' + }, { + type: 'Object' + }, { + type: 'String' + } + ], (options.explicit = true, options)) + }; + } + }, + Undefined: function(it){ + if (it === 'undefined' || it === void 8) { + return { + type: 'Just', + value: void 8 + }; + } else { + return { + type: 'Nothing' + }; + } + }, + Null: function(it){ + if (it === 'null') { + return { + type: 'Just', + value: null + }; + } else { + return { + type: 'Nothing' + }; + } + }, + NaN: function(it){ + if (it === 'NaN') { + return { + type: 'Just', + value: NaN + }; + } else { + return { + type: 'Nothing' + }; + } + }, + Boolean: function(it){ + if (it === 'true') { + return { + type: 'Just', + value: true + }; + } else if (it === 'false') { + return { + type: 'Just', + value: false + }; + } else { + return { + type: 'Nothing' + }; + } + }, + Number: function(it){ + return { + type: 'Just', + value: +it + }; + }, + Int: function(it){ + return { + type: 'Just', + value: +it + }; + }, + Float: function(it){ + return { + type: 'Just', + value: +it + }; + }, + Date: function(value, options){ + var that; + if (that = /^\#([\s\S]*)\#$/.exec(value)) { + return { + type: 'Just', + value: new Date(+that[1] || that[1]) + }; + } else if (options.explicit) { + return { + type: 'Nothing' + }; + } else { + return { + type: 'Just', + value: new Date(+value || value) + }; + } + }, + RegExp: function(value, options){ + var that; + if (that = /^\/([\s\S]*)\/([gimy]*)$/.exec(value)) { + return { + type: 'Just', + value: new RegExp(that[1], that[2]) + }; + } else if (options.explicit) { + return { + type: 'Nothing' + }; + } else { + return { + type: 'Just', + value: new RegExp(value) + }; + } + }, + Array: function(value, options){ + return castArray(value, { + of: [{ + type: '*' + }] + }, options); + }, + Object: function(value, options){ + return castFields(value, { + of: {} + }, options); + }, + String: function(it){ + var replace, that; + if (toString$.call(it).slice(8, -1) !== 'String') { + return { + type: 'Nothing' + }; + } + replace = function(value, quote){ + return value.replace(/\\([^u]|u[0-9a-fA-F]{4})/g, function(all, escaped){ + switch (escaped[0]) { + case quote: + return quote; + case '\\': + return '\\'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'u': + return JSON.parse("\"" + all + "\""); + default: + return escaped; + } + }); + }; + if (that = it.match(/^'([\s\S]*)'$/)) { + return { + type: 'Just', + value: replace(that[1], "'") + }; + } else if (that = it.match(/^"([\s\S]*)"$/)) { + return { + type: 'Just', + value: replace(that[1], '"') + }; + } else { + return { + type: 'Just', + value: it + }; + } + } + }; + function castArray(node, type, options){ + var typeOf, element; + if (toString$.call(node).slice(8, -1) !== 'Array') { + return { + type: 'Nothing' + }; + } + typeOf = type.of; + return { + type: 'Just', + value: (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) { + element = ref$[i$]; + results$.push(typesCast(element, typeOf, options)); + } + return results$; + }()) + }; + } + function castTuple(node, type, options){ + var result, i, i$, ref$, len$, types, cast; + if (toString$.call(node).slice(8, -1) !== 'Array') { + return { + type: 'Nothing' + }; + } + result = []; + i = 0; + for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { + types = ref$[i$]; + cast = typesCast(node[i], types, options); + if (toString$.call(cast).slice(8, -1) !== 'Undefined') { + result.push(cast); + } + i++; + } + if (node.length <= i) { + return { + type: 'Just', + value: result + }; + } else { + return { + type: 'Nothing' + }; + } + } + function castFields(node, type, options){ + var typeOf, key, value; + if (toString$.call(node).slice(8, -1) !== 'Object') { + return { + type: 'Nothing' + }; + } + typeOf = type.of; + return { + type: 'Just', + value: (function(){ + var ref$, resultObj$ = {}; + for (key in ref$ = node) { + value = ref$[key]; + resultObj$[typesCast(key, [{ + type: 'String' + }], options)] = typesCast(value, typeOf[key] || [{ + type: '*' + }], options); + } + return resultObj$; + }()) + }; + } + function typeCast(node, typeObj, options){ + var type, structure, castFunc, ref$; + type = typeObj.type, structure = typeObj.structure; + if (type) { + castFunc = ((ref$ = options.customTypes[type]) != null ? ref$.cast : void 8) || types[type]; + if (!castFunc) { + throw new Error("Type not defined: " + type + "."); + } + return castFunc(node, options, typesCast); + } else { + switch (structure) { + case 'array': + return castArray(node, typeObj, options); + case 'tuple': + return castTuple(node, typeObj, options); + case 'fields': + return castFields(node, typeObj, options); + } + } + } + function typesCast(node, types, options){ + var i$, len$, type, ref$, valueType, value; + for (i$ = 0, len$ = types.length; i$ < len$; ++i$) { + type = types[i$]; + ref$ = typeCast(node, type, options), valueType = ref$.type, value = ref$.value; + if (valueType === 'Nothing') { + continue; + } + if (parsedTypeCheck([type], value, { + customTypes: options.customTypes + })) { + return value; + } + } + throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + "."); + } + module.exports = function(node, types, options){ + if (!options.explicit && types.length === 1 && types[0].type === 'String') { + return node; + } + return typesCast(node, types, options); + }; +}).call(this); diff --git a/node_modules/levn/lib/index.js b/node_modules/levn/lib/index.js new file mode 100644 index 0000000..b8b6684 --- /dev/null +++ b/node_modules/levn/lib/index.js @@ -0,0 +1,22 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var parseString, cast, parseType, VERSION, parsedTypeParse, parse; + parseString = require('./parse-string'); + cast = require('./cast'); + parseType = require('type-check').parseType; + VERSION = '0.4.1'; + parsedTypeParse = function(parsedType, string, options){ + options == null && (options = {}); + options.explicit == null && (options.explicit = false); + options.customTypes == null && (options.customTypes = {}); + return cast(parseString(parsedType, string, options), parsedType, options); + }; + parse = function(type, string, options){ + return parsedTypeParse(parseType(type), string, options); + }; + module.exports = { + VERSION: VERSION, + parse: parse, + parsedTypeParse: parsedTypeParse + }; +}).call(this); diff --git a/node_modules/levn/lib/parse-string.js b/node_modules/levn/lib/parse-string.js new file mode 100644 index 0000000..eaed2f0 --- /dev/null +++ b/node_modules/levn/lib/parse-string.js @@ -0,0 +1,113 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var reject, special, tokenRegex; + reject = require('prelude-ls').reject; + function consumeOp(tokens, op){ + if (tokens[0] === op) { + return tokens.shift(); + } else { + throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + "."); + } + } + function maybeConsumeOp(tokens, op){ + if (tokens[0] === op) { + return tokens.shift(); + } + } + function consumeList(tokens, arg$, hasDelimiters){ + var open, close, result, untilTest; + open = arg$[0], close = arg$[1]; + if (hasDelimiters) { + consumeOp(tokens, open); + } + result = []; + untilTest = "," + (hasDelimiters ? close : ''); + while (tokens.length && (hasDelimiters && tokens[0] !== close)) { + result.push(consumeElement(tokens, untilTest)); + maybeConsumeOp(tokens, ','); + } + if (hasDelimiters) { + consumeOp(tokens, close); + } + return result; + } + function consumeArray(tokens, hasDelimiters){ + return consumeList(tokens, ['[', ']'], hasDelimiters); + } + function consumeTuple(tokens, hasDelimiters){ + return consumeList(tokens, ['(', ')'], hasDelimiters); + } + function consumeFields(tokens, hasDelimiters){ + var result, untilTest, key; + if (hasDelimiters) { + consumeOp(tokens, '{'); + } + result = {}; + untilTest = "," + (hasDelimiters ? '}' : ''); + while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) { + key = consumeValue(tokens, ':'); + consumeOp(tokens, ':'); + result[key] = consumeElement(tokens, untilTest); + maybeConsumeOp(tokens, ','); + } + if (hasDelimiters) { + consumeOp(tokens, '}'); + } + return result; + } + function consumeValue(tokens, untilTest){ + var out; + untilTest == null && (untilTest = ''); + out = ''; + while (tokens.length && -1 === untilTest.indexOf(tokens[0])) { + out += tokens.shift(); + } + return out; + } + function consumeElement(tokens, untilTest){ + switch (tokens[0]) { + case '[': + return consumeArray(tokens, true); + case '(': + return consumeTuple(tokens, true); + case '{': + return consumeFields(tokens, true); + default: + return consumeValue(tokens, untilTest); + } + } + function consumeTopLevel(tokens, types, options){ + var ref$, type, structure, origTokens, result, finalResult, x$, y$; + ref$ = types[0], type = ref$.type, structure = ref$.structure; + origTokens = tokens.concat(); + if (!options.explicit && types.length === 1 && ((!type && structure) || (type === 'Array' || type === 'Object'))) { + result = structure === 'array' || type === 'Array' + ? consumeArray(tokens, tokens[0] === '[') + : structure === 'tuple' + ? consumeTuple(tokens, tokens[0] === '(') + : consumeFields(tokens, tokens[0] === '{'); + finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array' + ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$) + : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result; + } else { + finalResult = consumeElement(tokens); + } + return finalResult; + } + special = /\[\]\(\)}{:,/.source; + tokenRegex = RegExp('("(?:\\\\"|[^"])*")|(\'(?:\\\\\'|[^\'])*\')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|([' + special + '])|([^\\s' + special + '](?:\\s*[^\\s' + special + ']+)*)|\\s*'); + module.exports = function(types, string, options){ + var tokens, node; + options == null && (options = {}); + if (!options.explicit && types.length === 1 && types[0].type === 'String') { + return string; + } + tokens = reject(not$, string.split(tokenRegex)); + node = consumeTopLevel(tokens, types, options); + if (!node) { + throw new Error("Error parsing '" + string + "'."); + } + return node; + }; + function not$(x){ return !x; } +}).call(this); diff --git a/node_modules/levn/package.json b/node_modules/levn/package.json new file mode 100644 index 0000000..0c356d6 --- /dev/null +++ b/node_modules/levn/package.json @@ -0,0 +1,46 @@ +{ + "name": "levn", + "version": "0.4.1", + "author": "George Zahariev ", + "description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible", + "homepage": "https://github.com/gkz/levn", + "keywords": [ + "levn", + "light", + "ecmascript", + "value", + "notation", + "json", + "typed", + "human", + "concise", + "typed", + "flexible" + ], + "files": [ + "lib", + "README.md", + "LICENSE" + ], + "main": "./lib/", + "bugs": "https://github.com/gkz/levn/issues", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + }, + "repository": { + "type": "git", + "url": "git://github.com/gkz/levn.git" + }, + "scripts": { + "test": "make test" + }, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1" + } +} diff --git a/node_modules/locate-path/index.js b/node_modules/locate-path/index.js new file mode 100644 index 0000000..a6358e5 --- /dev/null +++ b/node_modules/locate-path/index.js @@ -0,0 +1,68 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const {promisify} = require('util'); +const pLocate = require('p-locate'); + +const fsStat = promisify(fs.stat); +const fsLStat = promisify(fs.lstat); + +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; + +function checkType({type}) { + if (type in typeMappings) { + return; + } + + throw new Error(`Invalid type specified: ${type}`); +} + +const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); + +module.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: 'file', + allowSymlinks: true, + ...options + }; + + checkType(options); + + const statFn = options.allowSymlinks ? fsStat : fsLStat; + + return pLocate(paths, async path_ => { + try { + const stat = await statFn(path.resolve(options.cwd, path_)); + return matchType(options.type, stat); + } catch { + return false; + } + }, options); +}; + +module.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: 'file', + ...options + }; + + checkType(options); + + const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; + + for (const path_ of paths) { + try { + const stat = statFn(path.resolve(options.cwd, path_)); + + if (matchType(options.type, stat)) { + return path_; + } + } catch {} + } +}; diff --git a/node_modules/locate-path/license b/node_modules/locate-path/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/locate-path/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/locate-path/package.json b/node_modules/locate-path/package.json new file mode 100644 index 0000000..08bea50 --- /dev/null +++ b/node_modules/locate-path/package.json @@ -0,0 +1,46 @@ +{ + "name": "locate-path", + "version": "6.0.0", + "description": "Get the first path that exists on disk of multiple paths", + "license": "MIT", + "repository": "sindresorhus/locate-path", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "dependencies": { + "p-locate": "^5.0.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.13.1", + "xo": "^0.32.1" + } +} diff --git a/node_modules/locate-path/readme.md b/node_modules/locate-path/readme.md new file mode 100644 index 0000000..1002bcd --- /dev/null +++ b/node_modules/locate-path/readme.md @@ -0,0 +1,125 @@ +# locate-path [![Build Status](https://travis-ci.com/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.com/github/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + +## Install + +``` +$ npm install locate-path +``` + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + console(await locatePath(files)); + //=> 'rainbow' +})(); +``` + +## API + +### locatePath(paths, options?) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `object` + +##### concurrency + +Type: `number`\ +Default: `Infinity`\ +Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`\ +Default: `true` + +Preserve `paths` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`\ +Default: `process.cwd()` + +Current working directory. + +##### type + +Type: `string`\ +Default: `'file'`\ +Values: `'file' | 'directory'` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`\ +Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### locatePath.sync(paths, options?) + +Returns the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `object` + +##### cwd + +Same as above. + +##### type + +Same as above. + +##### allowSymlinks + +Same as above. + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/lodash.merge/LICENSE b/node_modules/lodash.merge/LICENSE new file mode 100644 index 0000000..77c42f1 --- /dev/null +++ b/node_modules/lodash.merge/LICENSE @@ -0,0 +1,47 @@ +Copyright OpenJS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.merge/README.md b/node_modules/lodash.merge/README.md new file mode 100644 index 0000000..91b7538 --- /dev/null +++ b/node_modules/lodash.merge/README.md @@ -0,0 +1,18 @@ +# lodash.merge v4.6.2 + +The [Lodash](https://lodash.com/) method `_.merge` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.merge +``` + +In Node.js: +```js +var merge = require('lodash.merge'); +``` + +See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/4.6.2-npm-packages/lodash.merge) for more details. diff --git a/node_modules/lodash.merge/index.js b/node_modules/lodash.merge/index.js new file mode 100644 index 0000000..8e75d95 --- /dev/null +++ b/node_modules/lodash.merge/index.js @@ -0,0 +1,1977 @@ +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeMax = Math.max, + nativeNow = Date.now; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ +function toPlainObject(value) { + return copyObject(value, keysIn(value)); +} + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +/** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ +var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = merge; diff --git a/node_modules/lodash.merge/package.json b/node_modules/lodash.merge/package.json new file mode 100644 index 0000000..3130fc8 --- /dev/null +++ b/node_modules/lodash.merge/package.json @@ -0,0 +1,16 @@ +{ + "name": "lodash.merge", + "version": "4.6.2", + "description": "The Lodash method `_.merge` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, merge", + "author": "John-David Dalton ", + "contributors": [ + "John-David Dalton ", + "Mathias Bynens " + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/merge2/LICENSE b/node_modules/merge2/LICENSE new file mode 100644 index 0000000..31dd9c7 --- /dev/null +++ b/node_modules/merge2/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2020 Teambition + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/merge2/README.md b/node_modules/merge2/README.md new file mode 100644 index 0000000..27f8eb9 --- /dev/null +++ b/node_modules/merge2/README.md @@ -0,0 +1,144 @@ +# merge2 + +Merge multiple streams into one stream in sequence or parallel. + +[![NPM version][npm-image]][npm-url] +[![Build Status][travis-image]][travis-url] +[![Downloads][downloads-image]][downloads-url] + +## Install + +Install with [npm](https://npmjs.org/package/merge2) + +```sh +npm install merge2 +``` + +## Usage + +```js +const gulp = require('gulp') +const merge2 = require('merge2') +const concat = require('gulp-concat') +const minifyHtml = require('gulp-minify-html') +const ngtemplate = require('gulp-ngtemplate') + +gulp.task('app-js', function () { + return merge2( + gulp.src('static/src/tpl/*.html') + .pipe(minifyHtml({empty: true})) + .pipe(ngtemplate({ + module: 'genTemplates', + standalone: true + }) + ), gulp.src([ + 'static/src/js/app.js', + 'static/src/js/locale_zh-cn.js', + 'static/src/js/router.js', + 'static/src/js/tools.js', + 'static/src/js/services.js', + 'static/src/js/filters.js', + 'static/src/js/directives.js', + 'static/src/js/controllers.js' + ]) + ) + .pipe(concat('app.js')) + .pipe(gulp.dest('static/dist/js/')) +}) +``` + +```js +const stream = merge2([stream1, stream2], stream3, {end: false}) +//... +stream.add(stream4, stream5) +//.. +stream.end() +``` + +```js +// equal to merge2([stream1, stream2], stream3) +const stream = merge2() +stream.add([stream1, stream2]) +stream.add(stream3) +``` + +```js +// merge order: +// 1. merge `stream1`; +// 2. merge `stream2` and `stream3` in parallel after `stream1` merged; +// 3. merge 'stream4' after `stream2` and `stream3` merged; +const stream = merge2(stream1, [stream2, stream3], stream4) + +// merge order: +// 1. merge `stream5` and `stream6` in parallel after `stream4` merged; +// 2. merge 'stream7' after `stream5` and `stream6` merged; +stream.add([stream5, stream6], stream7) +``` + +```js +// nest merge +// equal to merge2(stream1, stream2, stream6, stream3, [stream4, stream5]); +const streamA = merge2(stream1, stream2) +const streamB = merge2(stream3, [stream4, stream5]) +const stream = merge2(streamA, streamB) +streamA.add(stream6) +``` + +## API + +```js +const merge2 = require('merge2') +``` + +### merge2() + +### merge2(options) + +### merge2(stream1, stream2, ..., streamN) + +### merge2(stream1, stream2, ..., streamN, options) + +### merge2(stream1, [stream2, stream3, ...], streamN, options) + +return a duplex stream (mergedStream). streams in array will be merged in parallel. + +### mergedStream.add(stream) + +### mergedStream.add(stream1, [stream2, stream3, ...], ...) + +return the mergedStream. + +### mergedStream.on('queueDrain', function() {}) + +It will emit 'queueDrain' when all streams merged. If you set `end === false` in options, this event give you a notice that should add more streams to merge or end the mergedStream. + +#### stream + +*option* +Type: `Readable` or `Duplex` or `Transform` stream. + +#### options + +*option* +Type: `Object`. + +* **end** - `Boolean` - if `end === false` then mergedStream will not be auto ended, you should end by yourself. **Default:** `undefined` + +* **pipeError** - `Boolean` - if `pipeError === true` then mergedStream will emit `error` event from source streams. **Default:** `undefined` + +* **objectMode** - `Boolean` . **Default:** `true` + +`objectMode` and other options(`highWaterMark`, `defaultEncoding` ...) is same as Node.js `Stream`. + +## License + +MIT © [Teambition](https://www.teambition.com) + +[npm-url]: https://npmjs.org/package/merge2 +[npm-image]: http://img.shields.io/npm/v/merge2.svg + +[travis-url]: https://travis-ci.org/teambition/merge2 +[travis-image]: http://img.shields.io/travis/teambition/merge2.svg + +[downloads-url]: https://npmjs.org/package/merge2 +[downloads-image]: http://img.shields.io/npm/dm/merge2.svg?style=flat-square diff --git a/node_modules/merge2/index.js b/node_modules/merge2/index.js new file mode 100644 index 0000000..78a61ed --- /dev/null +++ b/node_modules/merge2/index.js @@ -0,0 +1,144 @@ +'use strict' +/* + * merge2 + * https://github.com/teambition/merge2 + * + * Copyright (c) 2014-2020 Teambition + * Licensed under the MIT license. + */ +const Stream = require('stream') +const PassThrough = Stream.PassThrough +const slice = Array.prototype.slice + +module.exports = merge2 + +function merge2 () { + const streamsQueue = [] + const args = slice.call(arguments) + let merging = false + let options = args[args.length - 1] + + if (options && !Array.isArray(options) && options.pipe == null) { + args.pop() + } else { + options = {} + } + + const doEnd = options.end !== false + const doPipeError = options.pipeError === true + if (options.objectMode == null) { + options.objectMode = true + } + if (options.highWaterMark == null) { + options.highWaterMark = 64 * 1024 + } + const mergedStream = PassThrough(options) + + function addStream () { + for (let i = 0, len = arguments.length; i < len; i++) { + streamsQueue.push(pauseStreams(arguments[i], options)) + } + mergeStream() + return this + } + + function mergeStream () { + if (merging) { + return + } + merging = true + + let streams = streamsQueue.shift() + if (!streams) { + process.nextTick(endStream) + return + } + if (!Array.isArray(streams)) { + streams = [streams] + } + + let pipesCount = streams.length + 1 + + function next () { + if (--pipesCount > 0) { + return + } + merging = false + mergeStream() + } + + function pipe (stream) { + function onend () { + stream.removeListener('merge2UnpipeEnd', onend) + stream.removeListener('end', onend) + if (doPipeError) { + stream.removeListener('error', onerror) + } + next() + } + function onerror (err) { + mergedStream.emit('error', err) + } + // skip ended stream + if (stream._readableState.endEmitted) { + return next() + } + + stream.on('merge2UnpipeEnd', onend) + stream.on('end', onend) + + if (doPipeError) { + stream.on('error', onerror) + } + + stream.pipe(mergedStream, { end: false }) + // compatible for old stream + stream.resume() + } + + for (let i = 0; i < streams.length; i++) { + pipe(streams[i]) + } + + next() + } + + function endStream () { + merging = false + // emit 'queueDrain' when all streams merged. + mergedStream.emit('queueDrain') + if (doEnd) { + mergedStream.end() + } + } + + mergedStream.setMaxListeners(0) + mergedStream.add = addStream + mergedStream.on('unpipe', function (stream) { + stream.emit('merge2UnpipeEnd') + }) + + if (args.length) { + addStream.apply(null, args) + } + return mergedStream +} + +// check and pause streams for pipe. +function pauseStreams (streams, options) { + if (!Array.isArray(streams)) { + // Backwards-compat with old-style streams + if (!streams._readableState && streams.pipe) { + streams = streams.pipe(PassThrough(options)) + } + if (!streams._readableState || !streams.pause || !streams.pipe) { + throw new Error('Only readable stream can be merged.') + } + streams.pause() + } else { + for (let i = 0, len = streams.length; i < len; i++) { + streams[i] = pauseStreams(streams[i], options) + } + } + return streams +} diff --git a/node_modules/merge2/package.json b/node_modules/merge2/package.json new file mode 100644 index 0000000..7777307 --- /dev/null +++ b/node_modules/merge2/package.json @@ -0,0 +1,43 @@ +{ + "name": "merge2", + "description": "Merge multiple streams into one stream in sequence or parallel.", + "authors": [ + "Yan Qing " + ], + "license": "MIT", + "version": "1.4.1", + "main": "./index.js", + "repository": { + "type": "git", + "url": "git@github.com:teambition/merge2.git" + }, + "homepage": "https://github.com/teambition/merge2", + "keywords": [ + "merge2", + "multiple", + "sequence", + "parallel", + "merge", + "stream", + "merge stream", + "sync" + ], + "engines": { + "node": ">= 8" + }, + "dependencies": {}, + "devDependencies": { + "standard": "^14.3.4", + "through2": "^3.0.1", + "thunks": "^4.9.6", + "tman": "^1.10.0", + "to-through": "^2.0.0" + }, + "scripts": { + "test": "standard && tman" + }, + "files": [ + "README.md", + "index.js" + ] +} diff --git a/node_modules/micromatch/LICENSE b/node_modules/micromatch/LICENSE new file mode 100755 index 0000000..9af4a67 --- /dev/null +++ b/node_modules/micromatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/micromatch/README.md b/node_modules/micromatch/README.md new file mode 100644 index 0000000..d72a059 --- /dev/null +++ b/node_modules/micromatch/README.md @@ -0,0 +1,1024 @@ +# micromatch [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![NPM total downloads](https://img.shields.io/npm/dt/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Tests](https://github.com/micromatch/micromatch/actions/workflows/test.yml/badge.svg)](https://github.com/micromatch/micromatch/actions/workflows/test.yml) + +> Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Table of Contents + +
+Details + + * [Install](#install) +- [Sponsors](#sponsors) + * [Gold Sponsors](#gold-sponsors) + * [Quickstart](#quickstart) + * [Why use micromatch?](#why-use-micromatch) + + [Matching features](#matching-features) + * [Switching to micromatch](#switching-to-micromatch) + + [From minimatch](#from-minimatch) + + [From multimatch](#from-multimatch) + * [API](#api) + * [Options](#options) + * [Options Examples](#options-examples) + + [options.basename](#optionsbasename) + + [options.bash](#optionsbash) + + [options.expandRange](#optionsexpandrange) + + [options.format](#optionsformat) + + [options.ignore](#optionsignore) + + [options.matchBase](#optionsmatchbase) + + [options.noextglob](#optionsnoextglob) + + [options.nonegate](#optionsnonegate) + + [options.noglobstar](#optionsnoglobstar) + + [options.nonull](#optionsnonull) + + [options.nullglob](#optionsnullglob) + + [options.onIgnore](#optionsonignore) + + [options.onMatch](#optionsonmatch) + + [options.onResult](#optionsonresult) + + [options.posixSlashes](#optionsposixslashes) + + [options.unescape](#optionsunescape) + * [Extended globbing](#extended-globbing) + + [Extglobs](#extglobs) + + [Braces](#braces) + + [Regex character classes](#regex-character-classes) + + [Regex groups](#regex-groups) + + [POSIX bracket expressions](#posix-bracket-expressions) + * [Notes](#notes) + + [Bash 4.3 parity](#bash-43-parity) + + [Backslashes](#backslashes) + * [Benchmarks](#benchmarks) + + [Running benchmarks](#running-benchmarks) + + [Latest results](#latest-results) + * [Contributing](#contributing) + * [About](#about) + +
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save micromatch +``` + +
+ +# Sponsors + +[Become a Sponsor](https://github.com/sponsors/jonschlinkert) to add your logo to this README, or any of [my other projects](https://github.com/jonschlinkert?tab=repositories&q=&type=&language=&sort=stargazers) + +
+ +## Quickstart + +```js +const micromatch = require('micromatch'); +// micromatch(list, patterns[, options]); +``` + +The [main export](#micromatch) takes a list of strings and one or more glob patterns: + +```js +console.log(micromatch(['foo', 'bar', 'baz', 'qux'], ['f*', 'b*'])) //=> ['foo', 'bar', 'baz'] +console.log(micromatch(['foo', 'bar', 'baz', 'qux'], ['*', '!b*'])) //=> ['foo', 'qux'] +``` + +Use [.isMatch()](#ismatch) to for boolean matching: + +```js +console.log(micromatch.isMatch('foo', 'f*')) //=> true +console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true +``` + +[Switching](#switching-to-micromatch) from minimatch and multimatch is easy! + +
+ +## Why use micromatch? + +> micromatch is a [replacement](#switching-to-micromatch) for minimatch and multimatch + +* Supports all of the same matching features as [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) +* More complete support for the Bash 4.3 specification than minimatch and multimatch. Micromatch passes _all of the spec tests_ from bash, including some that bash still fails. +* **Fast & Performant** - Loads in about 5ms and performs [fast matches](#benchmarks). +* **Glob matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories +* **[Advanced globbing](#extended-globbing)** - Supports [extglobs](#extglobs), [braces](#braces-1), and [POSIX brackets](#posix-bracket-expressions), and support for escaping special characters with `\` or quotes. +* **Accurate** - Covers more scenarios [than minimatch](https://github.com/yarnpkg/yarn/pull/3339) +* **Well tested** - More than 5,000 [test assertions](./test) +* **Windows support** - More reliable windows support than minimatch and multimatch. +* **[Safe](https://github.com/micromatch/braces#braces-is-safe)** - Micromatch is not subject to DoS with brace patterns like minimatch and multimatch. + +### Matching features + +* Support for multiple glob patterns (no need for wrappers like multimatch) +* Wildcards (`**`, `*.js`) +* Negation (`'!a/*.js'`, `'*!(b).js'`) +* [extglobs](#extglobs) (`+(x|y)`, `!(a|b)`) +* [POSIX character classes](#posix-bracket-expressions) (`[[:alpha:][:digit:]]`) +* [brace expansion](https://github.com/micromatch/braces) (`foo/{1..5}.md`, `bar/{a,b,c}.js`) +* regex character classes (`foo-[1-5].js`) +* regex logical "or" (`foo/(abc|xyz).js`) + +You can mix and match these features to create whatever patterns you need! + +## Switching to micromatch + +_(There is one notable difference between micromatch and minimatch in regards to how backslashes are handled. See [the notes about backslashes](#backslashes) for more information.)_ + +### From minimatch + +Use [micromatch.isMatch()](#ismatch) instead of `minimatch()`: + +```js +console.log(micromatch.isMatch('foo', 'b*')); //=> false +``` + +Use [micromatch.match()](#match) instead of `minimatch.match()`: + +```js +console.log(micromatch.match(['foo', 'bar'], 'b*')); //=> 'bar' +``` + +### From multimatch + +Same signature: + +```js +console.log(micromatch(['foo', 'bar', 'baz'], ['f*', '*z'])); //=> ['foo', 'baz'] +``` + +## API + +**Params** + +* `list` **{String|Array}**: List of strings to match. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) +* `returns` **{Array}**: Returns an array of matches + +**Example** + +```js +const mm = require('micromatch'); +// mm(list, patterns[, options]); + +console.log(mm(['a.js', 'a.txt'], ['*.js'])); +//=> [ 'a.js' ] +``` + +### [.matcher](index.js#L109) + +Returns a matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match. + +**Params** + +* `pattern` **{String}**: Glob pattern +* `options` **{Object}** +* `returns` **{Function}**: Returns a matcher function. + +**Example** + +```js +const mm = require('micromatch'); +// mm.matcher(pattern[, options]); + +const isMatch = mm.matcher('*.!(*a)'); +console.log(isMatch('a.a')); //=> false +console.log(isMatch('a.b')); //=> true +``` + +### [.isMatch](index.js#L128) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* `str` **{String}**: The string to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `[options]` **{Object}**: See available [options](#options). +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +const mm = require('micromatch'); +// mm.isMatch(string, patterns[, options]); + +console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true +console.log(mm.isMatch('a.a', 'b.*')); //=> false +``` + +### [.not](index.js#L153) + +Returns a list of strings that _**do not match any**_ of the given `patterns`. + +**Params** + +* `list` **{Array}**: Array of strings to match. +* `patterns` **{String|Array}**: One or more glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Array}**: Returns an array of strings that **do not match** the given patterns. + +**Example** + +```js +const mm = require('micromatch'); +// mm.not(list, patterns[, options]); + +console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); +//=> ['b.b', 'c.c'] +``` + +### [.contains](index.js#L193) + +Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. + +**Params** + +* `str` **{String}**: The string to match. +* `patterns` **{String|Array}**: Glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any of the patterns matches any part of `str`. + +**Example** + +```js +var mm = require('micromatch'); +// mm.contains(string, pattern[, options]); + +console.log(mm.contains('aa/bb/cc', '*b')); +//=> true +console.log(mm.contains('aa/bb/cc', '*d')); +//=> false +``` + +### [.matchKeys](index.js#L235) + +Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. + +**Params** + +* `object` **{Object}**: The object with keys to filter. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Object}**: Returns an object with only keys that match the given patterns. + +**Example** + +```js +const mm = require('micromatch'); +// mm.matchKeys(object, patterns[, options]); + +const obj = { aa: 'a', ab: 'b', ac: 'c' }; +console.log(mm.matchKeys(obj, '*b')); +//=> { ab: 'b' } +``` + +### [.some](index.js#L264) + +Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + +**Params** + +* `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any `patterns` matches any of the strings in `list` + +**Example** + +```js +const mm = require('micromatch'); +// mm.some(list, patterns[, options]); + +console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); +// true +console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); +// false +``` + +### [.every](index.js#L300) + +Returns true if every string in the given `list` matches any of the given glob `patterns`. + +**Params** + +* `list` **{String|Array}**: The string or array of strings to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if all `patterns` matches all of the strings in `list` + +**Example** + +```js +const mm = require('micromatch'); +// mm.every(list, patterns[, options]); + +console.log(mm.every('foo.js', ['foo.js'])); +// true +console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); +// true +console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); +// false +console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); +// false +``` + +### [.all](index.js#L339) + +Returns true if **all** of the given `patterns` match the specified string. + +**Params** + +* `str` **{String|Array}**: The string to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +const mm = require('micromatch'); +// mm.all(string, patterns[, options]); + +console.log(mm.all('foo.js', ['foo.js'])); +// true + +console.log(mm.all('foo.js', ['*.js', '!foo.js'])); +// false + +console.log(mm.all('foo.js', ['*.js', 'foo.js'])); +// true + +console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); +// true +``` + +### [.capture](index.js#L366) + +Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. + +**Params** + +* `glob` **{String}**: Glob pattern to use for matching. +* `input` **{String}**: String to match +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Array|null}**: Returns an array of captures if the input matches the glob pattern, otherwise `null`. + +**Example** + +```js +const mm = require('micromatch'); +// mm.capture(pattern, string[, options]); + +console.log(mm.capture('test/*.js', 'test/foo.js')); +//=> ['foo'] +console.log(mm.capture('test/*.js', 'foo/bar.css')); +//=> null +``` + +### [.makeRe](index.js#L392) + +Create a regular expression from the given glob `pattern`. + +**Params** + +* `pattern` **{String}**: A glob pattern to convert to regex. +* `options` **{Object}** +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +const mm = require('micromatch'); +// mm.makeRe(pattern[, options]); + +console.log(mm.makeRe('*.js')); +//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ +``` + +### [.scan](index.js#L408) + +Scan a glob pattern to separate the pattern into segments. Used by the [split](#split) method. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with + +**Example** + +```js +const mm = require('micromatch'); +const state = mm.scan(pattern[, options]); +``` + +### [.parse](index.js#L424) + +Parse a glob pattern to create the source string for a regular expression. + +**Params** + +* `glob` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with useful properties and output to be used as regex source string. + +**Example** + +```js +const mm = require('micromatch'); +const state = mm.parse(pattern[, options]); +``` + +### [.braces](index.js#L451) + +Process the given brace `pattern`. + +**Params** + +* `pattern` **{String}**: String with brace pattern to process. +* `options` **{Object}**: Any [options](#options) to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options. +* `returns` **{Array}** + +**Example** + +```js +const { braces } = require('micromatch'); +console.log(braces('foo/{a,b,c}/bar')); +//=> [ 'foo/(a|b|c)/bar' ] + +console.log(braces('foo/{a,b,c}/bar', { expand: true })); +//=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] +``` + +## Options + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | +| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | +| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | +| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | +| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | +| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | +| `dot` | `boolean` | `false` | Match dotfiles. Otherwise dotfiles are ignored unless a `.` is explicitly defined in the pattern. | +| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. This option is overridden by the `expandBrace` option. | +| `failglob` | `boolean` | `false` | Similar to the `failglob` behavior in Bash, throws an error when no matches are found. Based on the bash option of the same name. | +| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | +| `flags` | `boolean` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | +| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | +| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | +| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | +| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | +| `lookbehinds` | `boolean` | `true` | Support regex positive and negative lookbehinds. Note that you must be using Node 8.1.10 or higher to enable regex lookbehinds. | +| `matchBase` | `boolean` | `false` | Alias for `basename` | +| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | +| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | +| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | +| `nocase` | `boolean` | `false` | Perform case-insensitive matching. Equivalent to the regex `i` flag. Note that this option is ignored when the `flags` option is defined. | +| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | +| `noext` | `boolean` | `false` | Alias for `noextglob` | +| `noextglob` | `boolean` | `false` | Disable support for matching with [extglobs](#extglobs) (like `+(a\|b)`) | +| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | +| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | +| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | +| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | +| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | +| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | +| `posix` | `boolean` | `false` | Support [POSIX character classes](#posix-bracket-expressions) ("posix brackets"). | +| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | +| `prepend` | `string` | `undefined` | String to prepend to the generated regex used for matching. | +| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | +| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | +| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | +| `unescape` | `boolean` | `undefined` | Remove preceding backslashes from escaped glob characters before creating the regular expression to perform matches. | +| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatitibility. | + +## Options Examples + +### options.basename + +Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. + +**Type**: `Boolean` + +**Default**: `false` + +**Example** + +```js +micromatch(['a/b.js', 'a/c.md'], '*.js'); +//=> [] + +micromatch(['a/b.js', 'a/c.md'], '*.js', { basename: true }); +//=> ['a/b.js'] +``` + +### options.bash + +Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as any other star. + +**Type**: `Boolean` + +**Default**: `true` + +**Example** + +```js +const files = ['abc', 'ajz']; +console.log(micromatch(files, '[a-c]*')); +//=> ['abc', 'ajz'] + +console.log(micromatch(files, '[a-c]*', { bash: false })); +``` + +### options.expandRange + +**Type**: `function` + +**Default**: `undefined` + +Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. + +**Example** + +The following example shows how to create a glob that matches a numeric folder name between `01` and `25`, with leading zeros. + +```js +const fill = require('fill-range'); +const regex = micromatch.makeRe('foo/{01..25}/bar', { + expandRange(a, b) { + return `(${fill(a, b, { toRegex: true })})`; + } +}); + +console.log(regex) +//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ + +console.log(regex.test('foo/00/bar')) // false +console.log(regex.test('foo/01/bar')) // true +console.log(regex.test('foo/10/bar')) // true +console.log(regex.test('foo/22/bar')) // true +console.log(regex.test('foo/25/bar')) // true +console.log(regex.test('foo/26/bar')) // false +``` + +### options.format + +**Type**: `function` + +**Default**: `undefined` + +Custom function for formatting strings before they're matched. + +**Example** + +```js +// strip leading './' from strings +const format = str => str.replace(/^\.\//, ''); +const isMatch = picomatch('foo/*.js', { format }); +console.log(isMatch('./foo/bar.js')) //=> true +``` + +### options.ignore + +String or array of glob patterns to match files to ignore. + +**Type**: `String|Array` + +**Default**: `undefined` + +```js +const isMatch = micromatch.matcher('*', { ignore: 'f*' }); +console.log(isMatch('foo')) //=> false +console.log(isMatch('bar')) //=> true +console.log(isMatch('baz')) //=> true +``` + +### options.matchBase + +Alias for [options.basename](#options-basename). + +### options.noextglob + +Disable extglob support, so that [extglobs](#extglobs) are regarded as literal characters. + +**Type**: `Boolean` + +**Default**: `undefined` + +**Examples** + +```js +console.log(micromatch(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)')); +//=> ['a/b', 'a/!(z)'] + +console.log(micromatch(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)', { noextglob: true })); +//=> ['a/!(z)'] (matches only as literal characters) +``` + +### options.nonegate + +Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. + +**Type**: `Boolean` + +**Default**: `undefined` + +### options.noglobstar + +Disable matching with globstars (`**`). + +**Type**: `Boolean` + +**Default**: `undefined` + +```js +micromatch(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**'); +//=> ['a/b', 'a/b/c', 'a/b/c/d'] + +micromatch(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true}); +//=> ['a/b'] +``` + +### options.nonull + +Alias for [options.nullglob](#options-nullglob). + +### options.nullglob + +If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. + +**Type**: `Boolean` + +**Default**: `undefined` + +### options.onIgnore + +```js +const onIgnore = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); + // { glob: '*', regex: /^(?:(?!\.)(?=.)[^\/]*?\/?)$/, input: 'foo', output: 'foo' } +}; + +const isMatch = micromatch.matcher('*', { onIgnore, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +### options.onMatch + +```js +const onMatch = ({ glob, regex, input, output }) => { + console.log({ input, output }); + // { input: 'some\\path', output: 'some/path' } + // { input: 'some\\path', output: 'some/path' } + // { input: 'some\\path', output: 'some/path' } +}; + +const isMatch = micromatch.matcher('**', { onMatch, posixSlashes: true }); +isMatch('some\\path'); +isMatch('some\\path'); +isMatch('some\\path'); +``` + +### options.onResult + +```js +const onResult = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = micromatch('*', { onResult, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +### options.posixSlashes + +Convert path separators on returned files to posix/unix-style forward slashes. Aliased as `unixify` for backwards compatibility. + +**Type**: `Boolean` + +**Default**: `true` on windows, `false` everywhere else. + +**Example** + +```js +console.log(micromatch.match(['a\\b\\c'], 'a/**')); +//=> ['a/b/c'] + +console.log(micromatch.match(['a\\b\\c'], { posixSlashes: false })); +//=> ['a\\b\\c'] +``` + +### options.unescape + +Remove backslashes from escaped glob characters before creating the regular expression to perform matches. + +**Type**: `Boolean` + +**Default**: `undefined` + +**Example** + +In this example we want to match a literal `*`: + +```js +console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c')); +//=> ['a\\*c'] + +console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c', { unescape: true })); +//=> ['a*c'] +``` + +
+
+ +## Extended globbing + +Micromatch supports the following extended globbing features. + +### Extglobs + +Extended globbing, as described by the bash man page: + +| **pattern** | **regex equivalent** | **description** | +| --- | --- | --- | +| `?(pattern)` | `(pattern)?` | Matches zero or one occurrence of the given patterns | +| `*(pattern)` | `(pattern)*` | Matches zero or more occurrences of the given patterns | +| `+(pattern)` | `(pattern)+` | Matches one or more occurrences of the given patterns | +| `@(pattern)` | `(pattern)` * | Matches one of the given patterns | +| `!(pattern)` | N/A (equivalent regex is much more complicated) | Matches anything except one of the given patterns | + +* Note that `@` isn't a regex character. + +### Braces + +Brace patterns can be used to match specific ranges or sets of characters. + +**Example** + +The pattern `{f,b}*/{1..3}/{b,q}*` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +baz/1/qux +baz/2/qux +baz/3/qux +``` + +Visit [braces](https://github.com/micromatch/braces) to see the full range of features and options related to brace expansion, or to create brace matching or expansion related issues. + +### Regex character classes + +Given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: + +* `[ac].js`: matches both `a` and `c`, returning `['a.js', 'c.js']` +* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` +* `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']` + +Learn about [regex character classes](http://www.regular-expressions.info/charclass.html). + +### Regex groups + +Given `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: + +* `(a|c).js`: would match either `a` or `c`, returning `['a.js', 'c.js']` +* `(b|d).js`: would match either `b` or `d`, returning `['b.js', 'd.js']` +* `(b|[A-Z]).js`: would match either `b` or an uppercase letter, returning `['b.js', 'E.js']` + +As with regex, parens can be nested, so patterns like `((a|b)|c)/b` will work. Although brace expansion might be friendlier to use, depending on preference. + +### POSIX bracket expressions + +POSIX brackets are intended to be more user-friendly than regex character classes. This of course is in the eye of the beholder. + +**Example** + +```js +console.log(micromatch.isMatch('a1', '[[:alpha:][:digit:]]')) //=> true +console.log(micromatch.isMatch('a1', '[[:alpha:][:alpha:]]')) //=> false +``` + +*** + +## Notes + +### Bash 4.3 parity + +Whenever possible matching behavior is based on behavior Bash 4.3, which is mostly consistent with minimatch. + +However, it's suprising how many edge cases and rabbit holes there are with glob matching, and since there is no real glob specification, and micromatch is more accurate than both Bash and minimatch, there are cases where best-guesses were made for behavior. In a few cases where Bash had no answers, we used wildmatch (used by git) as a fallback. + +### Backslashes + +There is an important, notable difference between minimatch and micromatch _in regards to how backslashes are handled_ in glob patterns. + +* Micromatch exclusively and explicitly reserves backslashes for escaping characters in a glob pattern, even on windows, which is consistent with bash behavior. _More importantly, unescaping globs can result in unsafe regular expressions_. +* Minimatch converts all backslashes to forward slashes, which means you can't use backslashes to escape any characters in your glob patterns. + +We made this decision for micromatch for a couple of reasons: + +* Consistency with bash conventions. +* Glob patterns are not filepaths. They are a type of [regular language](https://en.wikipedia.org/wiki/Regular_language) that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine. + +**A note about joining paths to globs** + +Note that when you pass something like `path.join('foo', '*')` to micromatch, you are creating a filepath and expecting it to still work as a glob pattern. This causes problems on windows, since the `path.sep` is `\\`. + +In other words, since `\\` is reserved as an escape character in globs, on windows `path.join('foo', '*')` would result in `foo\\*`, which tells micromatch to match `*` as a literal character. This is the same behavior as bash. + +To solve this, you might be inspired to do something like `'foo\\*'.replace(/\\/g, '/')`, but this causes another, potentially much more serious, problem. + +## Benchmarks + +### Running benchmarks + +Install dependencies for running benchmarks: + +```sh +$ cd bench && npm install +``` + +Run the benchmarks: + +```sh +$ npm run bench +``` + +### Latest results + +As of August 23, 2024 (longer bars are better): + +```sh +# .makeRe star + micromatch x 2,232,802 ops/sec ±2.34% (89 runs sampled)) + minimatch x 781,018 ops/sec ±6.74% (92 runs sampled)) + +# .makeRe star; dot=true + micromatch x 1,863,453 ops/sec ±0.74% (93 runs sampled) + minimatch x 723,105 ops/sec ±0.75% (93 runs sampled) + +# .makeRe globstar + micromatch x 1,624,179 ops/sec ±2.22% (91 runs sampled) + minimatch x 1,117,230 ops/sec ±2.78% (86 runs sampled)) + +# .makeRe globstars + micromatch x 1,658,642 ops/sec ±0.86% (92 runs sampled) + minimatch x 741,224 ops/sec ±1.24% (89 runs sampled)) + +# .makeRe with leading star + micromatch x 1,525,014 ops/sec ±1.63% (90 runs sampled) + minimatch x 561,074 ops/sec ±3.07% (89 runs sampled) + +# .makeRe - braces + micromatch x 172,478 ops/sec ±2.37% (78 runs sampled) + minimatch x 96,087 ops/sec ±2.34% (88 runs sampled))) + +# .makeRe braces - range (expanded) + micromatch x 26,973 ops/sec ±0.84% (89 runs sampled) + minimatch x 3,023 ops/sec ±0.99% (90 runs sampled)) + +# .makeRe braces - range (compiled) + micromatch x 152,892 ops/sec ±1.67% (83 runs sampled) + minimatch x 992 ops/sec ±3.50% (89 runs sampled)d)) + +# .makeRe braces - nested ranges (expanded) + micromatch x 15,816 ops/sec ±13.05% (80 runs sampled) + minimatch x 2,953 ops/sec ±1.64% (91 runs sampled) + +# .makeRe braces - nested ranges (compiled) + micromatch x 110,881 ops/sec ±1.85% (82 runs sampled) + minimatch x 1,008 ops/sec ±1.51% (91 runs sampled) + +# .makeRe braces - set (compiled) + micromatch x 134,930 ops/sec ±3.54% (63 runs sampled)) + minimatch x 43,242 ops/sec ±0.60% (93 runs sampled) + +# .makeRe braces - nested sets (compiled) + micromatch x 94,455 ops/sec ±1.74% (69 runs sampled)) + minimatch x 27,720 ops/sec ±1.84% (93 runs sampled)) +``` + +## Contributing + +All contributions are welcome! Please read [the contributing guide](.github/contributing.md) to get started. + +**Bug reports** + +Please create an issue if you encounter a bug or matching behavior that doesn't seem correct. If you find a matching-related issue, please: + +* [research existing issues first](../../issues) (open and closed) +* visit the [GNU Bash documentation](https://www.gnu.org/software/bash/manual/) to see how Bash deals with the pattern +* visit the [minimatch](https://github.com/isaacs/minimatch) documentation to cross-check expected behavior in node.js +* if all else fails, since there is no real specification for globs we will probably need to discuss expected behavior and decide how to resolve it. which means any detail you can provide to help with this discussion would be greatly appreciated. + +**Platform issues** + +It's important to us that micromatch work consistently on all platforms. If you encounter any platform-specific matching or path related issues, please let us know (pull requests are also greatly appreciated). + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/micromatch/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") +* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 523 | [jonschlinkert](https://github.com/jonschlinkert) | +| 12 | [es128](https://github.com/es128) | +| 9 | [danez](https://github.com/danez) | +| 8 | [doowb](https://github.com/doowb) | +| 6 | [paulmillr](https://github.com/paulmillr) | +| 5 | [mrmlnc](https://github.com/mrmlnc) | +| 3 | [DrPizza](https://github.com/DrPizza) | +| 2 | [Tvrqvoise](https://github.com/Tvrqvoise) | +| 2 | [antonyk](https://github.com/antonyk) | +| 2 | [MartinKolarik](https://github.com/MartinKolarik) | +| 2 | [Glazy](https://github.com/Glazy) | +| 2 | [mceIdo](https://github.com/mceIdo) | +| 2 | [TrySound](https://github.com/TrySound) | +| 1 | [yvele](https://github.com/yvele) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | +| 1 | [simlu](https://github.com/simlu) | +| 1 | [curbengh](https://github.com/curbengh) | +| 1 | [fidian](https://github.com/fidian) | +| 1 | [tomByrer](https://github.com/tomByrer) | +| 1 | [ZoomerTedJackson](https://github.com/ZoomerTedJackson) | +| 1 | [styfle](https://github.com/styfle) | +| 1 | [sebdeckers](https://github.com/sebdeckers) | +| 1 | [muescha](https://github.com/muescha) | +| 1 | [juszczykjakub](https://github.com/juszczykjakub) | +| 1 | [joyceerhl](https://github.com/joyceerhl) | +| 1 | [donatj](https://github.com/donatj) | +| 1 | [frangio](https://github.com/frangio) | +| 1 | [UltCombo](https://github.com/UltCombo) | +| 1 | [DianeLooney](https://github.com/DianeLooney) | +| 1 | [devongovett](https://github.com/devongovett) | +| 1 | [Cslove](https://github.com/Cslove) | +| 1 | [amilajack](https://github.com/amilajack) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2024, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on August 23, 2024._ \ No newline at end of file diff --git a/node_modules/micromatch/index.js b/node_modules/micromatch/index.js new file mode 100644 index 0000000..cb9d9ef --- /dev/null +++ b/node_modules/micromatch/index.js @@ -0,0 +1,474 @@ +'use strict'; + +const util = require('util'); +const braces = require('braces'); +const picomatch = require('picomatch'); +const utils = require('picomatch/lib/utils'); + +const isEmptyString = v => v === '' || v === './'; +const hasBraces = v => { + const index = v.indexOf('{'); + return index > -1 && v.indexOf('}', index) > -1; +}; + +/** + * Returns an array of strings that match one or more glob patterns. + * + * ```js + * const mm = require('micromatch'); + * // mm(list, patterns[, options]); + * + * console.log(mm(['a.js', 'a.txt'], ['*.js'])); + * //=> [ 'a.js' ] + * ``` + * @param {String|Array} `list` List of strings to match. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) + * @return {Array} Returns an array of matches + * @summary false + * @api public + */ + +const micromatch = (list, patterns, options) => { + patterns = [].concat(patterns); + list = [].concat(list); + + let omit = new Set(); + let keep = new Set(); + let items = new Set(); + let negatives = 0; + + let onResult = state => { + items.add(state.output); + if (options && options.onResult) { + options.onResult(state); + } + }; + + for (let i = 0; i < patterns.length; i++) { + let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); + let negated = isMatch.state.negated || isMatch.state.negatedExtglob; + if (negated) negatives++; + + for (let item of list) { + let matched = isMatch(item, true); + + let match = negated ? !matched.isMatch : matched.isMatch; + if (!match) continue; + + if (negated) { + omit.add(matched.output); + } else { + omit.delete(matched.output); + keep.add(matched.output); + } + } + } + + let result = negatives === patterns.length ? [...items] : [...keep]; + let matches = result.filter(item => !omit.has(item)); + + if (options && matches.length === 0) { + if (options.failglob === true) { + throw new Error(`No matches found for "${patterns.join(', ')}"`); + } + + if (options.nonull === true || options.nullglob === true) { + return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; + } + } + + return matches; +}; + +/** + * Backwards compatibility + */ + +micromatch.match = micromatch; + +/** + * Returns a matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns + * true if the string is a match. + * + * ```js + * const mm = require('micromatch'); + * // mm.matcher(pattern[, options]); + * + * const isMatch = mm.matcher('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @param {String} `pattern` Glob pattern + * @param {Object} `options` + * @return {Function} Returns a matcher function. + * @api public + */ + +micromatch.matcher = (pattern, options) => picomatch(pattern, options); + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const mm = require('micromatch'); + * // mm.isMatch(string, patterns[, options]); + * + * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(mm.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `[options]` See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Backwards compatibility + */ + +micromatch.any = micromatch.isMatch; + +/** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.not(list, patterns[, options]); + * + * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); + * //=> ['b.b', 'c.c'] + * ``` + * @param {Array} `list` Array of strings to match. + * @param {String|Array} `patterns` One or more glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of strings that **do not match** the given patterns. + * @api public + */ + +micromatch.not = (list, patterns, options = {}) => { + patterns = [].concat(patterns).map(String); + let result = new Set(); + let items = []; + + let onResult = state => { + if (options.onResult) options.onResult(state); + items.push(state.output); + }; + + let matches = new Set(micromatch(list, patterns, { ...options, onResult })); + + for (let item of items) { + if (!matches.has(item)) { + result.add(item); + } + } + return [...result]; +}; + +/** + * Returns true if the given `string` contains the given pattern. Similar + * to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * ```js + * var mm = require('micromatch'); + * // mm.contains(string, pattern[, options]); + * + * console.log(mm.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(mm.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String|Array} `patterns` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any of the patterns matches any part of `str`. + * @api public + */ + +micromatch.contains = (str, pattern, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } + + if (Array.isArray(pattern)) { + return pattern.some(p => micromatch.contains(str, p, options)); + } + + if (typeof pattern === 'string') { + if (isEmptyString(str) || isEmptyString(pattern)) { + return false; + } + + if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { + return true; + } + } + + return micromatch.isMatch(str, pattern, { ...options, contains: true }); +}; + +/** + * Filter the keys of the given object with the given `glob` pattern + * and `options`. Does not attempt to match nested keys. If you need this feature, + * use [glob-object][] instead. + * + * ```js + * const mm = require('micromatch'); + * // mm.matchKeys(object, patterns[, options]); + * + * const obj = { aa: 'a', ab: 'b', ac: 'c' }; + * console.log(mm.matchKeys(obj, '*b')); + * //=> { ab: 'b' } + * ``` + * @param {Object} `object` The object with keys to filter. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Object} Returns an object with only keys that match the given patterns. + * @api public + */ + +micromatch.matchKeys = (obj, patterns, options) => { + if (!utils.isObject(obj)) { + throw new TypeError('Expected the first argument to be an object'); + } + let keys = micromatch(Object.keys(obj), patterns, options); + let res = {}; + for (let key of keys) res[key] = obj[key]; + return res; +}; + +/** + * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.some(list, patterns[, options]); + * + * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // true + * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` + * @api public + */ + +micromatch.some = (list, patterns, options) => { + let items = [].concat(list); + + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options); + if (items.some(item => isMatch(item))) { + return true; + } + } + return false; +}; + +/** + * Returns true if every string in the given `list` matches + * any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.every(list, patterns[, options]); + * + * console.log(mm.every('foo.js', ['foo.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // false + * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` + * @api public + */ + +micromatch.every = (list, patterns, options) => { + let items = [].concat(list); + + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options); + if (!items.every(item => isMatch(item))) { + return false; + } + } + return true; +}; + +/** + * Returns true if **all** of the given `patterns` match + * the specified string. + * + * ```js + * const mm = require('micromatch'); + * // mm.all(string, patterns[, options]); + * + * console.log(mm.all('foo.js', ['foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); + * // false + * + * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); + * // true + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +micromatch.all = (str, patterns, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } + + return [].concat(patterns).every(p => picomatch(p, options)(str)); +}; + +/** + * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. + * + * ```js + * const mm = require('micromatch'); + * // mm.capture(pattern, string[, options]); + * + * console.log(mm.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(mm.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `glob` Glob pattern to use for matching. + * @param {String} `input` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. + * @api public + */ + +micromatch.capture = (glob, input, options) => { + let posix = utils.isWindows(options); + let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); + let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); + + if (match) { + return match.slice(1).map(v => v === void 0 ? '' : v); + } +}; + +/** + * Create a regular expression from the given glob `pattern`. + * + * ```js + * const mm = require('micromatch'); + * // mm.makeRe(pattern[, options]); + * + * console.log(mm.makeRe('*.js')); + * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ + * ``` + * @param {String} `pattern` A glob pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +micromatch.makeRe = (...args) => picomatch.makeRe(...args); + +/** + * Scan a glob pattern to separate the pattern into segments. Used + * by the [split](#split) method. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.scan(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +micromatch.scan = (...args) => picomatch.scan(...args); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.parse(pattern[, options]); + * ``` + * @param {String} `glob` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as regex source string. + * @api public + */ + +micromatch.parse = (patterns, options) => { + let res = []; + for (let pattern of [].concat(patterns || [])) { + for (let str of braces(String(pattern), options)) { + res.push(picomatch.parse(str, options)); + } + } + return res; +}; + +/** + * Process the given brace `pattern`. + * + * ```js + * const { braces } = require('micromatch'); + * console.log(braces('foo/{a,b,c}/bar')); + * //=> [ 'foo/(a|b|c)/bar' ] + * + * console.log(braces('foo/{a,b,c}/bar', { expand: true })); + * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] + * ``` + * @param {String} `pattern` String with brace pattern to process. + * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. + * @return {Array} + * @api public + */ + +micromatch.braces = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + if ((options && options.nobrace === true) || !hasBraces(pattern)) { + return [pattern]; + } + return braces(pattern, options); +}; + +/** + * Expand braces + */ + +micromatch.braceExpand = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + return micromatch.braces(pattern, { ...options, expand: true }); +}; + +/** + * Expose micromatch + */ + +// exposed for tests +micromatch.hasBraces = hasBraces; +module.exports = micromatch; diff --git a/node_modules/micromatch/package.json b/node_modules/micromatch/package.json new file mode 100644 index 0000000..d5558bb --- /dev/null +++ b/node_modules/micromatch/package.json @@ -0,0 +1,119 @@ +{ + "name": "micromatch", + "description": "Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.", + "version": "4.0.8", + "homepage": "https://github.com/micromatch/micromatch", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "(https://github.com/DianeLooney)", + "Amila Welihinda (amilajack.com)", + "Bogdan Chadkin (https://github.com/TrySound)", + "Brian Woodward (https://twitter.com/doowb)", + "Devon Govett (http://badassjs.com)", + "Elan Shanker (https://github.com/es128)", + "Fabrício Matté (https://ultcombo.js.org)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Martin Kolárik (https://kolarik.sk)", + "Olsten Larck (https://i.am.charlike.online)", + "Paul Miller (paulmillr.com)", + "Tom Byrer (https://github.com/tomByrer)", + "Tyler Akins (http://rumkin.com)", + "Peter Bright (https://github.com/drpizza)", + "Kuba Juszczyk (https://github.com/ku8ar)" + ], + "repository": "micromatch/micromatch", + "bugs": { + "url": "https://github.com/micromatch/micromatch/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=8.6" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "devDependencies": { + "fill-range": "^7.0.1", + "gulp-format-md": "^2.0.0", + "minimatch": "^5.0.1", + "mocha": "^9.2.2", + "time-require": "github:jonschlinkert/time-require" + }, + "keywords": [ + "bash", + "bracket", + "character-class", + "expand", + "expansion", + "expression", + "extglob", + "extglobs", + "file", + "files", + "filter", + "find", + "glob", + "globbing", + "globs", + "globstar", + "lookahead", + "lookaround", + "lookbehind", + "match", + "matcher", + "matches", + "matching", + "micromatch", + "minimatch", + "multimatch", + "negate", + "negation", + "path", + "pattern", + "patterns", + "posix", + "regex", + "regexp", + "regular", + "shell", + "star", + "wildcard" + ], + "verb": { + "toc": "collapsible", + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "braces", + "expand-brackets", + "extglob", + "fill-range", + "nanomatch" + ] + }, + "reflinks": [ + "extglob", + "fill-range", + "glob-object", + "minimatch", + "multimatch" + ] + } +} diff --git a/node_modules/minimatch/LICENSE b/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/minimatch/README.md b/node_modules/minimatch/README.md new file mode 100644 index 0000000..33ede1d --- /dev/null +++ b/node_modules/minimatch/README.md @@ -0,0 +1,230 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### allowWindowsEscape + +Windows path separator `\` is by default converted to `/`, which +prohibits the usage of `\` as a escape character. This flag skips that +behavior and allows using the escape character. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/minimatch/minimatch.js b/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..fda45ad --- /dev/null +++ b/node_modules/minimatch/minimatch.js @@ -0,0 +1,947 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = (function () { try { return require('path') } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + b = b || {} + var t = {} + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } + + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } + + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) + } + + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } + + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) + } + + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + assertValidPattern(pattern) + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + assertValidPattern(pattern) + + if (!options) options = {} + + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (!options.allowWindowsEscape && path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + assertValidPattern(pattern) + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json new file mode 100644 index 0000000..566efdf --- /dev/null +++ b/node_modules/minimatch/package.json @@ -0,0 +1,33 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.1.2", + "publishConfig": { + "tag": "v3-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "devDependencies": { + "tap": "^15.1.6" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ] +} diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js new file mode 100644 index 0000000..ea734fb --- /dev/null +++ b/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md new file mode 100644 index 0000000..fa5d39b --- /dev/null +++ b/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Vercel, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json new file mode 100644 index 0000000..4997189 --- /dev/null +++ b/node_modules/ms/package.json @@ -0,0 +1,38 @@ +{ + "name": "ms", + "version": "2.1.3", + "description": "Tiny millisecond conversion utility", + "repository": "vercel/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.18.2", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1", + "prettier": "2.0.5" + } +} diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md new file mode 100644 index 0000000..0fc1abb --- /dev/null +++ b/node_modules/ms/readme.md @@ -0,0 +1,59 @@ +# ms + +![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/natural-compare/README.md b/node_modules/natural-compare/README.md new file mode 100644 index 0000000..c85dfdf --- /dev/null +++ b/node_modules/natural-compare/README.md @@ -0,0 +1,125 @@ + +[Build]: http://img.shields.io/travis/litejs/natural-compare-lite.png +[Coverage]: http://img.shields.io/coveralls/litejs/natural-compare-lite.png +[1]: https://travis-ci.org/litejs/natural-compare-lite +[2]: https://coveralls.io/r/litejs/natural-compare-lite +[npm package]: https://npmjs.org/package/natural-compare-lite +[GitHub repo]: https://github.com/litejs/natural-compare-lite + + + + @version 1.4.0 + @date 2015-10-26 + @stability 3 - Stable + + +Natural Compare – [![Build][]][1] [![Coverage][]][2] +=============== + +Compare strings containing a mix of letters and numbers +in the way a human being would in sort order. +This is described as a "natural ordering". + +```text +Standard sorting: Natural order sorting: + img1.png img1.png + img10.png img2.png + img12.png img10.png + img2.png img12.png +``` + +String.naturalCompare returns a number indicating +whether a reference string comes before or after or is the same +as the given string in sort order. +Use it with builtin sort() function. + + + +### Installation + +- In browser + +```html + +``` + +- In node.js: `npm install natural-compare-lite` + +```javascript +require("natural-compare-lite") +``` + +### Usage + +```javascript +// Simple case sensitive example +var a = ["z1.doc", "z10.doc", "z17.doc", "z2.doc", "z23.doc", "z3.doc"]; +a.sort(String.naturalCompare); +// ["z1.doc", "z2.doc", "z3.doc", "z10.doc", "z17.doc", "z23.doc"] + +// Use wrapper function for case insensitivity +a.sort(function(a, b){ + return String.naturalCompare(a.toLowerCase(), b.toLowerCase()); +}) + +// In most cases we want to sort an array of objects +var a = [ {"street":"350 5th Ave", "room":"A-1021"} + , {"street":"350 5th Ave", "room":"A-21046-b"} ]; + +// sort by street, then by room +a.sort(function(a, b){ + return String.naturalCompare(a.street, b.street) || String.naturalCompare(a.room, b.room); +}) + +// When text transformation is needed (eg toLowerCase()), +// it is best for performance to keep +// transformed key in that object. +// There are no need to do text transformation +// on each comparision when sorting. +var a = [ {"make":"Audi", "model":"A6"} + , {"make":"Kia", "model":"Rio"} ]; + +// sort by make, then by model +a.map(function(car){ + car.sort_key = (car.make + " " + car.model).toLowerCase(); +}) +a.sort(function(a, b){ + return String.naturalCompare(a.sort_key, b.sort_key); +}) +``` + +- Works well with dates in ISO format eg "Rev 2012-07-26.doc". + + +### Custom alphabet + +It is possible to configure a custom alphabet +to achieve a desired order. + +```javascript +// Estonian alphabet +String.alphabet = "ABDEFGHIJKLMNOPRSŠZŽTUVÕÄÖÜXYabdefghijklmnoprsšzžtuvõäöüxy" +["t", "z", "x", "õ"].sort(String.naturalCompare) +// ["z", "t", "õ", "x"] + +// Russian alphabet +String.alphabet = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя" +["Ё", "А", "Б"].sort(String.naturalCompare) +// ["А", "Б", "Ё"] +``` + + +External links +-------------- + +- [GitHub repo][https://github.com/litejs/natural-compare-lite] +- [jsperf test](http://jsperf.com/natural-sort-2/12) + + +Licence +------- + +Copyright (c) 2012-2015 Lauri Rooden <lauri@rooden.ee> +[The MIT License](http://lauri.rooden.ee/mit-license.txt) + + diff --git a/node_modules/natural-compare/index.js b/node_modules/natural-compare/index.js new file mode 100644 index 0000000..e705d49 --- /dev/null +++ b/node_modules/natural-compare/index.js @@ -0,0 +1,57 @@ + + + +/* + * @version 1.4.0 + * @date 2015-10-26 + * @stability 3 - Stable + * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite) + * @license MIT License + */ + + +var naturalCompare = function(a, b) { + var i, codeA + , codeB = 1 + , posA = 0 + , posB = 0 + , alphabet = String.alphabet + + function getCode(str, pos, code) { + if (code) { + for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i; + return +str.slice(pos - 1, i) + } + code = alphabet && alphabet.indexOf(str.charAt(pos)) + return code > -1 ? code + 76 : ((code = str.charCodeAt(pos) || 0), code < 45 || code > 127) ? code + : code < 46 ? 65 // - + : code < 48 ? code - 1 + : code < 58 ? code + 18 // 0-9 + : code < 65 ? code - 11 + : code < 91 ? code + 11 // A-Z + : code < 97 ? code - 37 + : code < 123 ? code + 5 // a-z + : code - 63 + } + + + if ((a+="") != (b+="")) for (;codeB;) { + codeA = getCode(a, posA++) + codeB = getCode(b, posB++) + + if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) { + codeA = getCode(a, posA, posA) + codeB = getCode(b, posB, posA = i) + posB = i + } + + if (codeA != codeB) return (codeA < codeB) ? -1 : 1 + } + return 0 +} + +try { + module.exports = naturalCompare; +} catch (e) { + String.naturalCompare = naturalCompare; +} diff --git a/node_modules/natural-compare/package.json b/node_modules/natural-compare/package.json new file mode 100644 index 0000000..1a71362 --- /dev/null +++ b/node_modules/natural-compare/package.json @@ -0,0 +1,42 @@ +{ + "name": "natural-compare", + "version": "1.4.0", + "stability": 3, + "author": "Lauri Rooden (https://github.com/litejs/natural-compare-lite)", + "license": "MIT", + "description": "Compare strings containing a mix of letters and numbers in the way a human being would in sort order.", + "keywords": [ + "string", + "natural", + "order", + "sort", + "natsort", + "natcmp", + "compare", + "alphanum", + "litejs" + ], + "main": "index.js", + "readmeFilename": "README.md", + "files": [ + "index.js" + ], + "scripts": { + "build": "node node_modules/buildman/index.js --all", + "test": "node tests/index.js" + }, + "repository": "git://github.com/litejs/natural-compare-lite.git", + "bugs": { + "url": "https://github.com/litejs/natural-compare-lite/issues" + }, + "devDependencies": { + "buildman": "*", + "testman": "*" + }, + "buildman": { + "dist/index-min.js": { + "banner": "/*! litejs.com/MIT-LICENSE.txt */", + "input": "index.js" + } + } +} diff --git a/node_modules/optionator/CHANGELOG.md b/node_modules/optionator/CHANGELOG.md new file mode 100644 index 0000000..2928cc2 --- /dev/null +++ b/node_modules/optionator/CHANGELOG.md @@ -0,0 +1,59 @@ +# 0.9.0 +- update dependencies, in particular `levn` and `type-check` - this could affect behaviour of argument parsing + +# 0.8.3 +- changes dependency from `wordwrap` to `word-wrap` due to license issue +- update dependencies + +# 0.8.2 +- fix bug #18 - detect missing value when flag is last item +- update dependencies + +# 0.8.1 +- update `fast-levenshtein` dependency + +# 0.8.0 +- update `levn` dependency - supplying a float value to an option with type `Int` now throws an error, instead of silently converting to an `Int` + +# 0.7.1 +- fix bug with use of `defaults` and `concatRepeatedArrays` or `mergeRepeatedObjects` + +# 0.7.0 +- added `concatrepeatedarrays` option: `oneValuePerFlag`, only allows one array value per flag +- added `typeAliases` option +- added `parseArgv` which takes an array and parses with the first two items sliced off +- changed enum help style +- bug fixes (#12) +- use of `concatRepeatedArrays` and `mergeRepeatedObjects` at the top level is deprecated, use it as either a per-option option, or set them in the `defaults` object to set them for all objects + +# 0.6.0 +- added `defaults` lib-option flag, allowing one to set default properties for all options +- added `concatRepeatedArrays` and `mergeRepeatedObjects` as option level properties, allowing you to turn this feature on for specific options only + +# 0.5.0 +- `Boolean` flags with `default: 'true'`, and no short aliases, will by default show the `--no` version in help + +# 0.4.0 +- add `mergeRepeatedObjects` setting + +# 0.3.0 +- add `concatRepeatedArrays` setting +- add `overrideRequired` option setting +- use just Levenshtein string compare algo rather than Levenshtein Damerau to due dependency license issue + +# 0.2.2 +- bug fixes + +# 0.2.1 +- improved interpolation +- added changelog + +# 0.2.0 +- add dependency checks to options - added `dependsOn` as an option property +- add interpolation for `prepend` and `append` text with new `generateHelp` option, `interpolate` + +# 0.1.1 +- update dependencies + +# 0.1.0 +- initial release diff --git a/node_modules/optionator/LICENSE b/node_modules/optionator/LICENSE new file mode 100644 index 0000000..525b118 --- /dev/null +++ b/node_modules/optionator/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) George Zahariev + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/optionator/README.md b/node_modules/optionator/README.md new file mode 100644 index 0000000..9cd0bb4 --- /dev/null +++ b/node_modules/optionator/README.md @@ -0,0 +1,238 @@ +# Optionator + + +Optionator is a JavaScript/Node.js option parsing and help generation library used by [eslint](http://eslint.org), [Grasp](http://graspjs.com), [LiveScript](http://livescript.net), [esmangle](https://github.com/estools/esmangle), [escodegen](https://github.com/estools/escodegen), and [many more](https://www.npmjs.com/browse/depended/optionator). + +For an online demo, check out the [Grasp online demo](http://www.graspjs.com/#demo). + +[About](#about) · [Usage](#usage) · [Settings Format](#settings-format) · [Argument Format](#argument-format) + +## Why? +The problem with other option parsers, such as `yargs` or `minimist`, is they just accept all input, valid or not. +With Optionator, if you mistype an option, it will give you an error (with a suggestion for what you meant). +If you give the wrong type of argument for an option, it will give you an error rather than supplying the wrong input to your application. + + $ cmd --halp + Invalid option '--halp' - perhaps you meant '--help'? + + $ cmd --count str + Invalid value for option 'count' - expected type Int, received value: str. + +Other helpful features include reformatting the help text based on the size of the console, so that it fits even if the console is narrow, and accepting not just an array (eg. process.argv), but a string or object as well, making things like testing much easier. + +## About +Optionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types. + +MIT license. Version 0.9.4 + + npm install optionator + +For updates on Optionator, [follow me on twitter](https://twitter.com/gkzahariev). + +Optionator is a Node.js module, but can be used in the browser as well if packed with webpack/browserify. + +## Usage +`require('optionator');` returns a function. It has one property, `VERSION`, the current version of the library as a string. This function is called with an object specifying your options and other information, see the [settings format section](#settings-format). This in turn returns an object with three properties, `parse`, `parseArgv`, `generateHelp`, and `generateHelpForOption`, which are all functions. + +```js +var optionator = require('optionator')({ + prepend: 'Usage: cmd [options]', + append: 'Version 1.0.0', + options: [{ + option: 'help', + alias: 'h', + type: 'Boolean', + description: 'displays help' + }, { + option: 'count', + alias: 'c', + type: 'Int', + description: 'number of things', + example: 'cmd --count 2' + }] +}); + +var options = optionator.parseArgv(process.argv); +if (options.help) { + console.log(optionator.generateHelp()); +} +... +``` + +### parse(input, parseOptions) +`parse` processes the `input` according to your settings, and returns an object with the results. + +##### arguments +* input - `[String] | Object | String` - the input you wish to parse +* parseOptions - `{slice: Int}` - all options optional + - `slice` specifies how much to slice away from the beginning if the input is an array or string - by default `0` for string, `2` for array (works with `process.argv`) + +##### returns +`Object` - the parsed options, each key is a camelCase version of the option name (specified in dash-case), and each value is the processed value for that option. Positional values are in an array under the `_` key. + +##### example +```js +parse(['node', 't.js', '--count', '2', 'positional']); // {count: 2, _: ['positional']} +parse('--count 2 positional'); // {count: 2, _: ['positional']} +parse({count: 2, _:['positional']}); // {count: 2, _: ['positional']} +``` + +### parseArgv(input) +`parseArgv` works exactly like `parse`, but only for array input and it slices off the first two elements. + +##### arguments +* input - `[String]` - the input you wish to parse + +##### returns +See "returns" section in "parse" + +##### example +```js +parseArgv(process.argv); +``` + +### generateHelp(helpOptions) +`generateHelp` produces help text based on your settings. + +##### arguments +* helpOptions - `{showHidden: Boolean, interpolate: Object}` - all options optional + - `showHidden` specifies whether to show options with `hidden: true` specified, by default it is `false` + - `interpolate` specify data to be interpolated in `prepend` and `append` text, `{{key}}` is the format - eg. `generateHelp({interpolate:{version: '0.4.2'}})`, will change this `append` text: `Version {{version}}` to `Version 0.4.2` + +##### returns +`String` - the generated help text + +##### example +```js +generateHelp(); /* +"Usage: cmd [options] positional + + -h, --help displays help + -c, --count Int number of things + +Version 1.0.0 +"*/ +``` + +### generateHelpForOption(optionName) +`generateHelpForOption` produces expanded help text for the specified with `optionName` option. If an `example` was specified for the option, it will be displayed, and if a `longDescription` was specified, it will display that instead of the `description`. + +##### arguments +* optionName - `String` - the name of the option to display + +##### returns +`String` - the generated help text for the option + +##### example +```js +generateHelpForOption('count'); /* +"-c, --count Int +description: number of things +example: cmd --count 2 +"*/ +``` + +## Settings Format +When your `require('optionator')`, you get a function that takes in a settings object. This object has the type: + + { + prepend: String, + append: String, + options: [{heading: String} | { + option: String, + alias: [String] | String, + type: String, + enum: [String], + default: String, + restPositional: Boolean, + required: Boolean, + overrideRequired: Boolean, + dependsOn: [String] | String, + concatRepeatedArrays: Boolean | (Boolean, Object), + mergeRepeatedObjects: Boolean, + description: String, + longDescription: String, + example: [String] | String + }], + helpStyle: { + aliasSeparator: String, + typeSeparator: String, + descriptionSeparator: String, + initialIndent: Int, + secondaryIndent: Int, + maxPadFactor: Number + }, + mutuallyExclusive: [[String | [String]]], + concatRepeatedArrays: Boolean | (Boolean, Object), // deprecated, set in defaults object + mergeRepeatedObjects: Boolean, // deprecated, set in defaults object + positionalAnywhere: Boolean, + typeAliases: Object, + defaults: Object + } + +All of the properties are optional (the `Maybe` has been excluded for brevities sake), except for having either `heading: String` or `option: String` in each object in the `options` array. + +### Top Level Properties +* `prepend` is an optional string to be placed before the options in the help text +* `append` is an optional string to be placed after the options in the help text +* `options` is a required array specifying your options and headings, the options and headings will be displayed in the order specified +* `helpStyle` is an optional object which enables you to change the default appearance of some aspects of the help text +* `mutuallyExclusive` is an optional array of arrays of either strings or arrays of strings. The top level array is a list of rules, each rule is a list of elements - each element can be either a string (the name of an option), or a list of strings (a group of option names) - there will be an error if more than one element is present +* `concatRepeatedArrays` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property +* `mergeRepeatedObjects` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property +* `positionalAnywhere` is an optional boolean (defaults to `true`) - when `true` it allows positional arguments anywhere, when `false`, all arguments after the first positional one are taken to be positional as well, even if they look like a flag. For example, with `positionalAnywhere: false`, the arguments `--flag --boom 12 --crack` would have two positional arguments: `12` and `--crack` +* `typeAliases` is an optional object, it allows you to set aliases for types, eg. `{Path: 'String'}` would allow you to use the type `Path` as an alias for the type `String` +* `defaults` is an optional object following the option properties format, which specifies default values for all options. A default will be overridden if manually set. For example, you can do `default: { type: "String" }` to set the default type of all options to `String`, and then override that default in an individual option by setting the `type` property + +#### Heading Properties +* `heading` a required string, the name of the heading + +#### Option Properties +* `option` the required name of the option - use dash-case, without the leading dashes +* `alias` is an optional string or array of strings which specify any aliases for the option +* `type` is a required string in the [type check](https://github.com/gkz/type-check) [format](https://github.com/gkz/type-check#type-format), this will be used to cast the inputted value and validate it +* `enum` is an optional array of strings, each string will be parsed by [levn](https://github.com/gkz/levn) - the argument value must be one of the resulting values - each potential value must validate against the specified `type` +* `default` is a optional string, which will be parsed by [levn](https://github.com/gkz/levn) and used as the default value if none is set - the value must validate against the specified `type` +* `restPositional` is an optional boolean - if set to `true`, everything after the option will be taken to be a positional argument, even if it looks like a named argument +* `required` is an optional boolean - if set to `true`, the option parsing will fail if the option is not defined +* `overrideRequired` is a optional boolean - if set to `true` and the option is used, and there is another option which is required but not set, it will override the need for the required option and there will be no error - this is useful if you have required options and want to use `--help` or `--version` flags +* `concatRepeatedArrays` is an optional boolean or tuple with boolean and options object (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']` + + You can supply an options object by giving the following value: `[true, options]`. The one currently supported option is `oneValuePerFlag`, this only allows one array value per flag. This is useful if your potential values contain a comma. +* `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}` +* `dependsOn` is an optional string or array of strings - if simply a string (the name of another option), it will make sure that that other option is set, if an array of strings, depending on whether `'and'` or `'or'` is first, it will either check whether all (`['and', 'option-a', 'option-b']`), or at least one (`['or', 'option-a', 'option-b']`) other options are set +* `description` is an optional string, which will be displayed next to the option in the help text +* `longDescription` is an optional string, it will be displayed instead of the `description` when `generateHelpForOption` is used +* `example` is an optional string or array of strings with example(s) for the option - these will be displayed when `generateHelpForOption` is used + +#### Help Style Properties +* `aliasSeparator` is an optional string, separates multiple names from each other - default: ' ,' +* `typeSeparator` is an optional string, separates the type from the names - default: ' ' +* `descriptionSeparator` is an optional string , separates the description from the padded name and type - default: ' ' +* `initialIndent` is an optional int - the amount of indent for options - default: 2 +* `secondaryIndent` is an optional int - the amount of indent if wrapped fully (in addition to the initial indent) - default: 4 +* `maxPadFactor` is an optional number - affects the default level of padding for the names/type, it is multiplied by the average of the length of the names/type - default: 1.5 + +## Argument Format +At the highest level there are two types of arguments: named, and positional. + +Name arguments of any length are prefixed with `--` (eg. `--go`), and those of one character may be prefixed with either `--` or `-` (eg. `-g`). + +There are two types of named arguments: boolean flags (eg. `--problemo`, `-p`) which take no value and result in a `true` if they are present, the falsey `undefined` if they are not present, or `false` if present and explicitly prefixed with `no` (eg. `--no-problemo`). Named arguments with values (eg. `--tseries 800`, `-t 800`) are the other type. If the option has a type `Boolean` it will automatically be made into a boolean flag. Any other type results in a named argument that takes a value. + +For more information about how to properly set types to get the value you want, take a look at the [type check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) pages. + +You can group single character arguments that use a single `-`, however all except the last must be boolean flags (which take no value). The last may be a boolean flag, or an argument which takes a value - eg. `-ba 2` is equivalent to `-b -a 2`. + +Positional arguments are all those values which do not fall under the above - they can be anywhere, not just at the end. For example, in `cmd -b one -a 2 two` where `b` is a boolean flag, and `a` has the type `Number`, there are two positional arguments, `one` and `two`. + +Everything after an `--` is positional, even if it looks like a named argument. + +You may optionally use `=` to separate option names from values, for example: `--count=2`. + +If you specify the option `NUM`, then any argument using a single `-` followed by a number will be valid and will set the value of `NUM`. Eg. `-2` will be parsed into `NUM: 2`. + +If duplicate named arguments are present, the last one will be taken. + +## Technical About +`optionator` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [levn](https://github.com/gkz/levn) to cast arguments to their specified type, and uses [type-check](https://github.com/gkz/type-check) to validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/optionator/lib/help.js b/node_modules/optionator/lib/help.js new file mode 100644 index 0000000..59e6f96 --- /dev/null +++ b/node_modules/optionator/lib/help.js @@ -0,0 +1,260 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var ref$, id, find, sort, min, max, map, unlines, nameToRaw, dasherize, naturalJoin, wordWrap, wordwrap, getPreText, setHelpStyleDefaults, generateHelpForOption, generateHelp; + ref$ = require('prelude-ls'), id = ref$.id, find = ref$.find, sort = ref$.sort, min = ref$.min, max = ref$.max, map = ref$.map, unlines = ref$.unlines; + ref$ = require('./util'), nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin; + wordWrap = require('word-wrap'); + wordwrap = function(a, b){ + var ref$, indent, width; + ref$ = b === undefined + ? ['', a - 1] + : [repeatString$(' ', a), b - a - 1], indent = ref$[0], width = ref$[1]; + return function(text){ + return wordWrap(text, { + indent: indent, + width: width, + trim: true + }); + }; + }; + getPreText = function(option, arg$, maxWidth){ + var mainName, shortNames, ref$, longNames, type, description, aliasSeparator, typeSeparator, initialIndent, names, namesString, namesStringLen, typeSeparatorString, typeSeparatorStringLen, wrap; + mainName = option.option, shortNames = (ref$ = option.shortNames) != null + ? ref$ + : [], longNames = (ref$ = option.longNames) != null + ? ref$ + : [], type = option.type, description = option.description; + aliasSeparator = arg$.aliasSeparator, typeSeparator = arg$.typeSeparator, initialIndent = arg$.initialIndent; + if (option.negateName) { + mainName = "no-" + mainName; + if (longNames) { + longNames = map(function(it){ + return "no-" + it; + }, longNames); + } + } + names = mainName.length === 1 + ? [mainName].concat(shortNames, longNames) + : shortNames.concat([mainName], longNames); + namesString = map(nameToRaw, names).join(aliasSeparator); + namesStringLen = namesString.length; + typeSeparatorString = mainName === 'NUM' ? '::' : typeSeparator; + typeSeparatorStringLen = typeSeparatorString.length; + if (maxWidth != null && !option.boolean && initialIndent + namesStringLen + typeSeparatorStringLen + type.length > maxWidth) { + wrap = wordwrap(initialIndent + namesStringLen + typeSeparatorStringLen, maxWidth); + return namesString + "" + typeSeparatorString + wrap(type).replace(/^\s+/, ''); + } else { + return namesString + "" + (option.boolean + ? '' + : typeSeparatorString + "" + type); + } + }; + setHelpStyleDefaults = function(helpStyle){ + helpStyle.aliasSeparator == null && (helpStyle.aliasSeparator = ', '); + helpStyle.typeSeparator == null && (helpStyle.typeSeparator = ' '); + helpStyle.descriptionSeparator == null && (helpStyle.descriptionSeparator = ' '); + helpStyle.initialIndent == null && (helpStyle.initialIndent = 2); + helpStyle.secondaryIndent == null && (helpStyle.secondaryIndent = 4); + helpStyle.maxPadFactor == null && (helpStyle.maxPadFactor = 1.5); + }; + generateHelpForOption = function(getOption, arg$){ + var stdout, helpStyle, ref$; + stdout = arg$.stdout, helpStyle = (ref$ = arg$.helpStyle) != null + ? ref$ + : {}; + setHelpStyleDefaults(helpStyle); + return function(optionName){ + var maxWidth, wrap, option, e, pre, defaultString, restPositionalString, description, fullDescription, that, preDescription, descriptionString, exampleString, examples, seperator; + maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null; + wrap = maxWidth ? wordwrap(maxWidth) : id; + try { + option = getOption(dasherize(optionName)); + } catch (e$) { + e = e$; + return e.message; + } + pre = getPreText(option, helpStyle); + defaultString = option['default'] && !option.negateName ? "\ndefault: " + option['default'] : ''; + restPositionalString = option.restPositional ? 'Everything after this option is considered a positional argument, even if it looks like an option.' : ''; + description = option.longDescription || option.description && sentencize(option.description); + fullDescription = description && restPositionalString + ? description + " " + restPositionalString + : (that = description || restPositionalString) ? that : ''; + preDescription = 'description:'; + descriptionString = !fullDescription + ? '' + : maxWidth && fullDescription.length - 1 - preDescription.length > maxWidth + ? "\n" + preDescription + "\n" + wrap(fullDescription) + : "\n" + preDescription + " " + fullDescription; + exampleString = (that = option.example) ? (examples = [].concat(that), examples.length > 1 + ? "\nexamples:\n" + unlines(examples) + : "\nexample: " + examples[0]) : ''; + seperator = defaultString || descriptionString || exampleString ? "\n" + repeatString$('=', pre.length) : ''; + return pre + "" + seperator + defaultString + descriptionString + exampleString; + }; + }; + generateHelp = function(arg$){ + var options, prepend, append, helpStyle, ref$, stdout, aliasSeparator, typeSeparator, descriptionSeparator, maxPadFactor, initialIndent, secondaryIndent; + options = arg$.options, prepend = arg$.prepend, append = arg$.append, helpStyle = (ref$ = arg$.helpStyle) != null + ? ref$ + : {}, stdout = arg$.stdout; + setHelpStyleDefaults(helpStyle); + aliasSeparator = helpStyle.aliasSeparator, typeSeparator = helpStyle.typeSeparator, descriptionSeparator = helpStyle.descriptionSeparator, maxPadFactor = helpStyle.maxPadFactor, initialIndent = helpStyle.initialIndent, secondaryIndent = helpStyle.secondaryIndent; + return function(arg$){ + var ref$, showHidden, interpolate, maxWidth, output, out, data, optionCount, totalPreLen, preLens, i$, len$, item, that, pre, descParts, desc, preLen, sortedPreLens, maxPreLen, preLenMean, x, padAmount, descSepLen, fullWrapCount, partialWrapCount, descLen, totalLen, initialSpace, wrapAllFull, i, wrap; + ref$ = arg$ != null + ? arg$ + : {}, showHidden = ref$.showHidden, interpolate = ref$.interpolate; + maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null; + output = []; + out = function(it){ + return output.push(it != null ? it : ''); + }; + if (prepend) { + out(interpolate ? interp(prepend, interpolate) : prepend); + out(); + } + data = []; + optionCount = 0; + totalPreLen = 0; + preLens = []; + for (i$ = 0, len$ = (ref$ = options).length; i$ < len$; ++i$) { + item = ref$[i$]; + if (showHidden || !item.hidden) { + if (that = item.heading) { + data.push({ + type: 'heading', + value: that + }); + } else { + pre = getPreText(item, helpStyle, maxWidth); + descParts = []; + if ((that = item.description) != null) { + descParts.push(that); + } + if (that = item['enum']) { + descParts.push("either: " + naturalJoin(that)); + } + if (item['default'] && !item.negateName) { + descParts.push("default: " + item['default']); + } + desc = descParts.join(' - '); + data.push({ + type: 'option', + pre: pre, + desc: desc, + descLen: desc.length + }); + preLen = pre.length; + optionCount++; + totalPreLen += preLen; + preLens.push(preLen); + } + } + } + sortedPreLens = sort(preLens); + maxPreLen = sortedPreLens[sortedPreLens.length - 1]; + preLenMean = initialIndent + totalPreLen / optionCount; + x = optionCount > 2 ? min(preLenMean * maxPadFactor, maxPreLen) : maxPreLen; + for (i$ = sortedPreLens.length - 1; i$ >= 0; --i$) { + preLen = sortedPreLens[i$]; + if (preLen <= x) { + padAmount = preLen; + break; + } + } + descSepLen = descriptionSeparator.length; + if (maxWidth != null) { + fullWrapCount = 0; + partialWrapCount = 0; + for (i$ = 0, len$ = data.length; i$ < len$; ++i$) { + item = data[i$]; + if (item.type === 'option') { + pre = item.pre, desc = item.desc, descLen = item.descLen; + if (descLen === 0) { + item.wrap = 'none'; + } else { + preLen = max(padAmount, pre.length) + initialIndent + descSepLen; + totalLen = preLen + descLen; + if (totalLen > maxWidth) { + if (descLen / 2.5 > maxWidth - preLen) { + fullWrapCount++; + item.wrap = 'full'; + } else { + partialWrapCount++; + item.wrap = 'partial'; + } + } else { + item.wrap = 'none'; + } + } + } + } + } + initialSpace = repeatString$(' ', initialIndent); + wrapAllFull = optionCount > 1 && fullWrapCount + partialWrapCount * 0.5 > optionCount * 0.5; + for (i$ = 0, len$ = data.length; i$ < len$; ++i$) { + i = i$; + item = data[i$]; + if (item.type === 'heading') { + if (i !== 0) { + out(); + } + out(item.value + ":"); + } else { + pre = item.pre, desc = item.desc, descLen = item.descLen, wrap = item.wrap; + if (maxWidth != null) { + if (wrapAllFull || wrap === 'full') { + wrap = wordwrap(initialIndent + secondaryIndent, maxWidth); + out(initialSpace + "" + pre + "\n" + wrap(desc)); + continue; + } else if (wrap === 'partial') { + wrap = wordwrap(initialIndent + descSepLen + max(padAmount, pre.length), maxWidth); + out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + wrap(desc).replace(/^\s+/, '')); + continue; + } + } + if (descLen === 0) { + out(initialSpace + "" + pre); + } else { + out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + desc); + } + } + } + if (append) { + out(); + out(interpolate ? interp(append, interpolate) : append); + } + return unlines(output); + }; + }; + function pad(str, num){ + var len, padAmount; + len = str.length; + padAmount = num - len; + return str + "" + repeatString$(' ', padAmount > 0 ? padAmount : 0); + } + function sentencize(str){ + var first, rest, period; + first = str.charAt(0).toUpperCase(); + rest = str.slice(1); + period = /[\.!\?]$/.test(str) ? '' : '.'; + return first + "" + rest + period; + } + function interp(string, object){ + return string.replace(/{{([a-zA-Z$_][a-zA-Z$_0-9]*)}}/g, function(arg$, key){ + var ref$; + return (ref$ = object[key]) != null + ? ref$ + : "{{" + key + "}}"; + }); + } + module.exports = { + generateHelp: generateHelp, + generateHelpForOption: generateHelpForOption + }; + function repeatString$(str, n){ + for (var r = ''; n > 0; (n >>= 1) && (str += str)) if (n & 1) r += str; + return r; + } +}).call(this); diff --git a/node_modules/optionator/lib/index.js b/node_modules/optionator/lib/index.js new file mode 100644 index 0000000..436b7cc --- /dev/null +++ b/node_modules/optionator/lib/index.js @@ -0,0 +1,465 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var VERSION, ref$, id, map, compact, any, groupBy, partition, chars, isItNaN, keys, Obj, camelize, deepIs, closestString, nameToRaw, dasherize, naturalJoin, generateHelp, generateHelpForOption, parsedTypeCheck, parseType, parseLevn, camelizeKeys, parseString, main, toString$ = {}.toString, slice$ = [].slice, arrayFrom$ = Array.from || function(x){return slice$.call(x);}; + VERSION = '0.9.4'; + ref$ = require('prelude-ls'), id = ref$.id, map = ref$.map, compact = ref$.compact, any = ref$.any, groupBy = ref$.groupBy, partition = ref$.partition, chars = ref$.chars, isItNaN = ref$.isItNaN, keys = ref$.keys, Obj = ref$.Obj, camelize = ref$.camelize; + deepIs = require('deep-is'); + ref$ = require('./util'), closestString = ref$.closestString, nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin; + ref$ = require('./help'), generateHelp = ref$.generateHelp, generateHelpForOption = ref$.generateHelpForOption; + ref$ = require('type-check'), parsedTypeCheck = ref$.parsedTypeCheck, parseType = ref$.parseType; + parseLevn = require('levn').parsedTypeParse; + camelizeKeys = function(obj){ + var key, value, resultObj$ = {}; + for (key in obj) { + value = obj[key]; + resultObj$[camelize(key)] = value; + } + return resultObj$; + }; + parseString = function(string){ + var assignOpt, regex, replaceRegex, result; + assignOpt = '--?[a-zA-Z][-a-z-A-Z0-9]*='; + regex = RegExp('(?:' + assignOpt + ')?(?:\'(?:\\\\\'|[^\'])+\'|"(?:\\\\"|[^"])+")|[^\'"\\s]+', 'g'); + replaceRegex = RegExp('^(' + assignOpt + ')?[\'"]([\\s\\S]*)[\'"]$'); + result = map(function(it){ + return it.replace(replaceRegex, '$1$2'); + }, string.match(regex) || []); + return result; + }; + main = function(libOptions){ + var opts, defaults, required, traverse, getOption, parse; + opts = {}; + defaults = {}; + required = []; + if (toString$.call(libOptions.stdout).slice(8, -1) === 'Undefined') { + libOptions.stdout = process.stdout; + } + libOptions.positionalAnywhere == null && (libOptions.positionalAnywhere = true); + libOptions.typeAliases == null && (libOptions.typeAliases = {}); + libOptions.defaults == null && (libOptions.defaults = {}); + if (libOptions.concatRepeatedArrays != null) { + libOptions.defaults.concatRepeatedArrays = libOptions.concatRepeatedArrays; + } + if (libOptions.mergeRepeatedObjects != null) { + libOptions.defaults.mergeRepeatedObjects = libOptions.mergeRepeatedObjects; + } + traverse = function(options){ + var i$, len$, option, name, k, ref$, v, type, that, e, parsedPossibilities, parsedType, j$, len1$, possibility, rawDependsType, dependsOpts, dependsType, cra, alias, shortNames, longNames; + if (toString$.call(options).slice(8, -1) !== 'Array') { + throw new Error('No options defined.'); + } + for (i$ = 0, len$ = options.length; i$ < len$; ++i$) { + option = options[i$]; + if (option.heading == null) { + name = option.option; + if (opts[name] != null) { + throw new Error("Option '" + name + "' already defined."); + } + for (k in ref$ = libOptions.defaults) { + v = ref$[k]; + option[k] == null && (option[k] = v); + } + if (option.type === 'Boolean') { + option.boolean == null && (option.boolean = true); + } + if (option.parsedType == null) { + if (!option.type) { + throw new Error("No type defined for option '" + name + "'."); + } + try { + type = (that = libOptions.typeAliases[option.type]) != null + ? that + : option.type; + option.parsedType = parseType(type); + } catch (e$) { + e = e$; + throw new Error("Option '" + name + "': Error parsing type '" + option.type + "': " + e.message); + } + } + if (option['default']) { + try { + defaults[name] = parseLevn(option.parsedType, option['default']); + } catch (e$) { + e = e$; + throw new Error("Option '" + name + "': Error parsing default value '" + option['default'] + "' for type '" + option.type + "': " + e.message); + } + } + if (option['enum'] && !option.parsedPossiblities) { + parsedPossibilities = []; + parsedType = option.parsedType; + for (j$ = 0, len1$ = (ref$ = option['enum']).length; j$ < len1$; ++j$) { + possibility = ref$[j$]; + try { + parsedPossibilities.push(parseLevn(parsedType, possibility)); + } catch (e$) { + e = e$; + throw new Error("Option '" + name + "': Error parsing enum value '" + possibility + "' for type '" + option.type + "': " + e.message); + } + } + option.parsedPossibilities = parsedPossibilities; + } + if (that = option.dependsOn) { + if (that.length) { + ref$ = [].concat(option.dependsOn), rawDependsType = ref$[0], dependsOpts = slice$.call(ref$, 1); + dependsType = rawDependsType.toLowerCase(); + if (dependsOpts.length) { + if (dependsType === 'and' || dependsType === 'or') { + option.dependsOn = [dependsType].concat(arrayFrom$(dependsOpts)); + } else { + throw new Error("Option '" + name + "': If you have more than one dependency, you must specify either 'and' or 'or'"); + } + } else { + if ((ref$ = dependsType.toLowerCase()) === 'and' || ref$ === 'or') { + option.dependsOn = null; + } else { + option.dependsOn = ['and', rawDependsType]; + } + } + } else { + option.dependsOn = null; + } + } + if (option.required) { + required.push(name); + } + opts[name] = option; + if (option.concatRepeatedArrays != null) { + cra = option.concatRepeatedArrays; + if ('Boolean' === toString$.call(cra).slice(8, -1)) { + option.concatRepeatedArrays = [cra, {}]; + } else if (cra.length === 1) { + option.concatRepeatedArrays = [cra[0], {}]; + } else if (cra.length !== 2) { + throw new Error("Invalid setting for concatRepeatedArrays"); + } + } + if (option.alias || option.aliases) { + if (name === 'NUM') { + throw new Error("-NUM option can't have aliases."); + } + if (option.alias) { + option.aliases == null && (option.aliases = [].concat(option.alias)); + } + for (j$ = 0, len1$ = (ref$ = option.aliases).length; j$ < len1$; ++j$) { + alias = ref$[j$]; + if (opts[alias] != null) { + throw new Error("Option '" + alias + "' already defined."); + } + opts[alias] = option; + } + ref$ = partition(fn$, option.aliases), shortNames = ref$[0], longNames = ref$[1]; + option.shortNames == null && (option.shortNames = shortNames); + option.longNames == null && (option.longNames = longNames); + } + if ((!option.aliases || option.shortNames.length === 0) && option.type === 'Boolean' && option['default'] === 'true') { + option.negateName = true; + } + } + } + function fn$(it){ + return it.length === 1; + } + }; + traverse(libOptions.options); + getOption = function(name){ + var opt, possiblyMeant; + opt = opts[name]; + if (opt == null) { + possiblyMeant = closestString(keys(opts), name); + throw new Error("Invalid option '" + nameToRaw(name) + "'" + (possiblyMeant ? " - perhaps you meant '" + nameToRaw(possiblyMeant) + "'?" : '.')); + } + return opt; + }; + parse = function(input, arg$){ + var slice, obj, positional, restPositional, overrideRequired, prop, setValue, setDefaults, checkRequired, mutuallyExclusiveError, checkMutuallyExclusive, checkDependency, checkDependencies, checkProp, args, key, value, option, ref$, i$, len$, arg, that, result, short, argName, usingAssign, val, flags, len, j$, len1$, i, flag, opt, name, valPrime, negated, noedName; + slice = (arg$ != null + ? arg$ + : {}).slice; + obj = {}; + positional = []; + restPositional = false; + overrideRequired = false; + prop = null; + setValue = function(name, value){ + var opt, val, cra, e, currentType; + opt = getOption(name); + if (opt.boolean) { + val = value; + } else { + try { + cra = opt.concatRepeatedArrays; + if (cra != null && cra[0] && cra[1].oneValuePerFlag && opt.parsedType.length === 1 && opt.parsedType[0].structure === 'array') { + val = [parseLevn(opt.parsedType[0].of, value)]; + } else { + val = parseLevn(opt.parsedType, value); + } + } catch (e$) { + e = e$; + throw new Error("Invalid value for option '" + name + "' - expected type " + opt.type + ", received value: " + value + "."); + } + if (opt['enum'] && !any(function(it){ + return deepIs(it, val); + }, opt.parsedPossibilities)) { + throw new Error("Option " + name + ": '" + val + "' not one of " + naturalJoin(opt['enum']) + "."); + } + } + currentType = toString$.call(obj[name]).slice(8, -1); + if (obj[name] != null) { + if (opt.concatRepeatedArrays != null && opt.concatRepeatedArrays[0] && currentType === 'Array') { + obj[name] = obj[name].concat(val); + } else if (opt.mergeRepeatedObjects && currentType === 'Object') { + import$(obj[name], val); + } else { + obj[name] = val; + } + } else { + obj[name] = val; + } + if (opt.restPositional) { + restPositional = true; + } + if (opt.overrideRequired) { + overrideRequired = true; + } + }; + setDefaults = function(){ + var name, ref$, value; + for (name in ref$ = defaults) { + value = ref$[name]; + if (obj[name] == null) { + obj[name] = value; + } + } + }; + checkRequired = function(){ + var i$, ref$, len$, name; + if (overrideRequired) { + return; + } + for (i$ = 0, len$ = (ref$ = required).length; i$ < len$; ++i$) { + name = ref$[i$]; + if (!obj[name]) { + throw new Error("Option " + nameToRaw(name) + " is required."); + } + } + }; + mutuallyExclusiveError = function(first, second){ + throw new Error("The options " + nameToRaw(first) + " and " + nameToRaw(second) + " are mutually exclusive - you cannot use them at the same time."); + }; + checkMutuallyExclusive = function(){ + var rules, i$, len$, rule, present, j$, len1$, element, k$, len2$, opt; + rules = libOptions.mutuallyExclusive; + if (!rules) { + return; + } + for (i$ = 0, len$ = rules.length; i$ < len$; ++i$) { + rule = rules[i$]; + present = null; + for (j$ = 0, len1$ = rule.length; j$ < len1$; ++j$) { + element = rule[j$]; + if (toString$.call(element).slice(8, -1) === 'Array') { + for (k$ = 0, len2$ = element.length; k$ < len2$; ++k$) { + opt = element[k$]; + if (opt in obj) { + if (present != null) { + mutuallyExclusiveError(present, opt); + } else { + present = opt; + break; + } + } + } + } else { + if (element in obj) { + if (present != null) { + mutuallyExclusiveError(present, element); + } else { + present = element; + } + } + } + } + } + }; + checkDependency = function(option){ + var dependsOn, type, targetOptionNames, i$, len$, targetOptionName, targetOption; + dependsOn = option.dependsOn; + if (!dependsOn || option.dependenciesMet) { + return true; + } + type = dependsOn[0], targetOptionNames = slice$.call(dependsOn, 1); + for (i$ = 0, len$ = targetOptionNames.length; i$ < len$; ++i$) { + targetOptionName = targetOptionNames[i$]; + targetOption = obj[targetOptionName]; + if (targetOption && checkDependency(targetOption)) { + if (type === 'or') { + return true; + } + } else if (type === 'and') { + throw new Error("The option '" + option.option + "' did not have its dependencies met."); + } + } + if (type === 'and') { + return true; + } else { + throw new Error("The option '" + option.option + "' did not meet any of its dependencies."); + } + }; + checkDependencies = function(){ + var name; + for (name in obj) { + checkDependency(opts[name]); + } + }; + checkProp = function(){ + if (prop) { + throw new Error("Value for '" + prop + "' of type '" + getOption(prop).type + "' required."); + } + }; + switch (toString$.call(input).slice(8, -1)) { + case 'String': + args = parseString(input.slice(slice != null ? slice : 0)); + break; + case 'Array': + args = input.slice(slice != null ? slice : 2); + break; + case 'Object': + obj = {}; + for (key in input) { + value = input[key]; + if (key !== '_') { + option = getOption(dasherize(key)); + if (parsedTypeCheck(option.parsedType, value)) { + obj[option.option] = value; + } else { + throw new Error("Option '" + option.option + "': Invalid type for '" + value + "' - expected type '" + option.type + "'."); + } + } + } + checkMutuallyExclusive(); + checkDependencies(); + setDefaults(); + checkRequired(); + return ref$ = camelizeKeys(obj), ref$._ = input._ || [], ref$; + default: + throw new Error("Invalid argument to 'parse': " + input + "."); + } + for (i$ = 0, len$ = args.length; i$ < len$; ++i$) { + arg = args[i$]; + if (arg === '--') { + restPositional = true; + } else if (restPositional) { + positional.push(arg); + } else { + if (that = arg.match(/^(--?)([a-zA-Z][-a-zA-Z0-9]*)(=)?(.*)?$/)) { + result = that; + checkProp(); + short = result[1].length === 1; + argName = result[2]; + usingAssign = result[3] != null; + val = result[4]; + if (usingAssign && val == null) { + throw new Error("No value for '" + argName + "' specified."); + } + if (short) { + flags = chars(argName); + len = flags.length; + for (j$ = 0, len1$ = flags.length; j$ < len1$; ++j$) { + i = j$; + flag = flags[j$]; + opt = getOption(flag); + name = opt.option; + if (restPositional) { + positional.push(flag); + } else if (i === len - 1) { + if (usingAssign) { + valPrime = opt.boolean ? parseLevn([{ + type: 'Boolean' + }], val) : val; + setValue(name, valPrime); + } else if (opt.boolean) { + setValue(name, true); + } else { + prop = name; + } + } else if (opt.boolean) { + setValue(name, true); + } else { + throw new Error("Can't set argument '" + flag + "' when not last flag in a group of short flags."); + } + } + } else { + negated = false; + if (that = argName.match(/^no-(.+)$/)) { + negated = true; + noedName = that[1]; + opt = getOption(noedName); + } else { + opt = getOption(argName); + } + name = opt.option; + if (opt.boolean) { + valPrime = usingAssign ? parseLevn([{ + type: 'Boolean' + }], val) : true; + if (negated) { + setValue(name, !valPrime); + } else { + setValue(name, valPrime); + } + } else { + if (negated) { + throw new Error("Only use 'no-' prefix for Boolean options, not with '" + noedName + "'."); + } + if (usingAssign) { + setValue(name, val); + } else { + prop = name; + } + } + } + } else if (that = arg.match(/^-([0-9]+(?:\.[0-9]+)?)$/)) { + opt = opts.NUM; + if (!opt) { + throw new Error('No -NUM option defined.'); + } + setValue(opt.option, that[1]); + } else { + if (prop) { + setValue(prop, arg); + prop = null; + } else { + positional.push(arg); + if (!libOptions.positionalAnywhere) { + restPositional = true; + } + } + } + } + } + checkProp(); + checkMutuallyExclusive(); + checkDependencies(); + setDefaults(); + checkRequired(); + return ref$ = camelizeKeys(obj), ref$._ = positional, ref$; + }; + return { + parse: parse, + parseArgv: function(it){ + return parse(it, { + slice: 2 + }); + }, + generateHelp: generateHelp(libOptions), + generateHelpForOption: generateHelpForOption(getOption, libOptions) + }; + }; + main.VERSION = VERSION; + module.exports = main; + function import$(obj, src){ + var own = {}.hasOwnProperty; + for (var key in src) if (own.call(src, key)) obj[key] = src[key]; + return obj; + } +}).call(this); diff --git a/node_modules/optionator/lib/util.js b/node_modules/optionator/lib/util.js new file mode 100644 index 0000000..5bc0cbb --- /dev/null +++ b/node_modules/optionator/lib/util.js @@ -0,0 +1,54 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var prelude, map, sortBy, fl, closestString, nameToRaw, dasherize, naturalJoin; + prelude = require('prelude-ls'), map = prelude.map, sortBy = prelude.sortBy; + fl = require('fast-levenshtein'); + closestString = function(possibilities, input){ + var distances, ref$, string, distance; + if (!possibilities.length) { + return; + } + distances = map(function(it){ + var ref$, longer, shorter; + ref$ = input.length > it.length + ? [input, it] + : [it, input], longer = ref$[0], shorter = ref$[1]; + return { + string: it, + distance: fl.get(longer, shorter) + }; + })( + possibilities); + ref$ = sortBy(function(it){ + return it.distance; + }, distances)[0], string = ref$.string, distance = ref$.distance; + return string; + }; + nameToRaw = function(name){ + if (name.length === 1 || name === 'NUM') { + return "-" + name; + } else { + return "--" + name; + } + }; + dasherize = function(string){ + if (/^[A-Z]/.test(string)) { + return string; + } else { + return prelude.dasherize(string); + } + }; + naturalJoin = function(array){ + if (array.length < 3) { + return array.join(' or '); + } else { + return array.slice(0, -1).join(', ') + ", or " + array[array.length - 1]; + } + }; + module.exports = { + closestString: closestString, + nameToRaw: nameToRaw, + dasherize: dasherize, + naturalJoin: naturalJoin + }; +}).call(this); diff --git a/node_modules/optionator/package.json b/node_modules/optionator/package.json new file mode 100644 index 0000000..72b21ba --- /dev/null +++ b/node_modules/optionator/package.json @@ -0,0 +1,43 @@ +{ + "name": "optionator", + "version": "0.9.4", + "author": "George Zahariev ", + "description": "option parsing and help generation", + "homepage": "https://github.com/gkz/optionator", + "keywords": [ + "options", + "flags", + "option parsing", + "cli" + ], + "files": [ + "lib", + "README.md", + "LICENSE" + ], + "main": "./lib/", + "bugs": "https://github.com/gkz/optionator/issues", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + }, + "repository": { + "type": "git", + "url": "git://github.com/gkz/optionator.git" + }, + "scripts": { + "test": "make test" + }, + "dependencies": { + "prelude-ls": "^1.2.1", + "deep-is": "^0.1.3", + "word-wrap": "^1.2.5", + "type-check": "^0.4.0", + "levn": "^0.4.1", + "fast-levenshtein": "^2.0.6" + }, + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^10.4.0" + } +} diff --git a/node_modules/p-limit/index.js b/node_modules/p-limit/index.js new file mode 100644 index 0000000..c2ae52d --- /dev/null +++ b/node_modules/p-limit/index.js @@ -0,0 +1,71 @@ +'use strict'; +const Queue = require('yocto-queue'); + +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + throw new TypeError('Expected `concurrency` to be a number from 1 and up'); + } + + const queue = new Queue(); + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.size > 0) { + queue.dequeue()(); + } + }; + + const run = async (fn, resolve, ...args) => { + activeCount++; + + const result = (async () => fn(...args))(); + + resolve(result); + + try { + await result; + } catch {} + + next(); + }; + + const enqueue = (fn, resolve, ...args) => { + queue.enqueue(run.bind(null, fn, resolve, ...args)); + + (async () => { + // This function needs to wait until the next microtask before comparing + // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously + // when the run function is dequeued and called. The comparison in the if-statement + // needs to happen asynchronously as well to get an up-to-date value for `activeCount`. + await Promise.resolve(); + + if (activeCount < concurrency && queue.size > 0) { + queue.dequeue()(); + } + })(); + }; + + const generator = (fn, ...args) => new Promise(resolve => { + enqueue(fn, resolve, ...args); + }); + + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.size + }, + clearQueue: { + value: () => { + queue.clear(); + } + } + }); + + return generator; +}; + +module.exports = pLimit; diff --git a/node_modules/p-limit/license b/node_modules/p-limit/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-limit/package.json b/node_modules/p-limit/package.json new file mode 100644 index 0000000..7651473 --- /dev/null +++ b/node_modules/p-limit/package.json @@ -0,0 +1,52 @@ +{ + "name": "p-limit", + "version": "3.1.0", + "description": "Run multiple promise-returning & async functions with limited concurrency", + "license": "MIT", + "repository": "sindresorhus/p-limit", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "delay": "^4.4.0", + "in-range": "^2.0.0", + "random-int": "^2.0.1", + "time-span": "^4.0.0", + "tsd": "^0.13.1", + "xo": "^0.35.0" + } +} diff --git a/node_modules/p-limit/readme.md b/node_modules/p-limit/readme.md new file mode 100644 index 0000000..b283c1e --- /dev/null +++ b/node_modules/p-limit/readme.md @@ -0,0 +1,101 @@ +# p-limit + +> Run multiple promise-returning & async functions with limited concurrency + +## Install + +``` +$ npm install p-limit +``` + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`\ +Minimum: `1`\ +Default: `Infinity` + +Concurrency limit. + +### limit(fn, ...args) + +Returns the promise returned by calling `fn(...args)`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + +#### args + +Any arguments to pass through to `fn`. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +### limit.activeCount + +The number of promises that are currently running. + +### limit.pendingCount + +The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + +### limit.clearQueue() + +Discard pending promises that are waiting to run. + +This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + +Note: This does not cancel promises that are already running. + +## FAQ + +### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? + +This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/p-locate/index.js b/node_modules/p-locate/index.js new file mode 100644 index 0000000..641c3dd --- /dev/null +++ b/node_modules/p-locate/index.js @@ -0,0 +1,50 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); + +// The input can also be a promise, so we `Promise.all()` them both +const finder = async element => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + + return false; +}; + +const pLocate = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; + + const limit = pLimit(options.concurrency); + + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); + + // Check the promises either serially or concurrently + const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); + + try { + await Promise.all(items.map(element => checkLimit(finder, element))); + } catch (error) { + if (error instanceof EndError) { + return error.value; + } + + throw error; + } +}; + +module.exports = pLocate; diff --git a/node_modules/p-locate/license b/node_modules/p-locate/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/p-locate/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-locate/package.json b/node_modules/p-locate/package.json new file mode 100644 index 0000000..2d5e447 --- /dev/null +++ b/node_modules/p-locate/package.json @@ -0,0 +1,54 @@ +{ + "name": "p-locate", + "version": "5.0.0", + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "license": "MIT", + "repository": "sindresorhus/p-locate", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-limit": "^3.0.2" + }, + "devDependencies": { + "ava": "^2.4.0", + "delay": "^4.1.0", + "in-range": "^2.0.0", + "time-span": "^4.0.0", + "tsd": "^0.13.1", + "xo": "^0.32.1" + } +} diff --git a/node_modules/p-locate/readme.md b/node_modules/p-locate/readme.md new file mode 100644 index 0000000..be85ec1 --- /dev/null +++ b/node_modules/p-locate/readme.md @@ -0,0 +1,93 @@ +# p-locate [![Build Status](https://travis-ci.com/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.com/github/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + +## Install + +``` +$ npm install p-locate +``` + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + +## API + +### pLocate(input, tester, options?) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +An iterable of promises/values to test. + +#### tester(element) + +Type: `Function` + +This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + +#### options + +Type: `object` + +##### concurrency + +Type: `number`\ +Default: `Infinity`\ +Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`\ +Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/parent-module/index.js b/node_modules/parent-module/index.js new file mode 100644 index 0000000..a26f953 --- /dev/null +++ b/node_modules/parent-module/index.js @@ -0,0 +1,37 @@ +'use strict'; +const callsites = require('callsites'); + +module.exports = filepath => { + const stacks = callsites(); + + if (!filepath) { + return stacks[2].getFileName(); + } + + let seenVal = false; + + // Skip the first stack as it's this function + stacks.shift(); + + for (const stack of stacks) { + const parentFilepath = stack.getFileName(); + + if (typeof parentFilepath !== 'string') { + continue; + } + + if (parentFilepath === filepath) { + seenVal = true; + continue; + } + + // Skip native modules + if (parentFilepath === 'module.js') { + continue; + } + + if (seenVal && parentFilepath !== filepath) { + return parentFilepath; + } + } +}; diff --git a/node_modules/parent-module/license b/node_modules/parent-module/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/parent-module/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parent-module/package.json b/node_modules/parent-module/package.json new file mode 100644 index 0000000..790333d --- /dev/null +++ b/node_modules/parent-module/package.json @@ -0,0 +1,46 @@ +{ + "name": "parent-module", + "version": "1.0.1", + "description": "Get the path of the parent module", + "license": "MIT", + "repository": "sindresorhus/parent-module", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "parent", + "module", + "package", + "pkg", + "caller", + "calling", + "module", + "path", + "callsites", + "callsite", + "stacktrace", + "stack", + "trace", + "function", + "file" + ], + "dependencies": { + "callsites": "^3.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "execa": "^1.0.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/parent-module/readme.md b/node_modules/parent-module/readme.md new file mode 100644 index 0000000..dffb4ce --- /dev/null +++ b/node_modules/parent-module/readme.md @@ -0,0 +1,67 @@ +# parent-module [![Build Status](https://travis-ci.org/sindresorhus/parent-module.svg?branch=master)](https://travis-ci.org/sindresorhus/parent-module) + +> Get the path of the parent module + +Node.js exposes `module.parent`, but it only gives you the first cached parent, which is not necessarily the actual parent. + + +## Install + +``` +$ npm install parent-module +``` + + +## Usage + +```js +// bar.js +const parentModule = require('parent-module'); + +module.exports = () => { + console.log(parentModule()); + //=> '/Users/sindresorhus/dev/unicorn/foo.js' +}; +``` + +```js +// foo.js +const bar = require('./bar'); + +bar(); +``` + + +## API + +### parentModule([filepath]) + +By default, it will return the path of the immediate parent. + +#### filepath + +Type: `string`
+Default: [`__filename`](https://nodejs.org/api/globals.html#globals_filename) + +Filepath of the module of which to get the parent path. + +Useful if you want it to work [multiple module levels down](https://github.com/sindresorhus/parent-module/tree/master/fixtures/filepath). + + +## Tip + +Combine it with [`read-pkg-up`](https://github.com/sindresorhus/read-pkg-up) to read the package.json of the parent module. + +```js +const path = require('path'); +const readPkgUp = require('read-pkg-up'); +const parentModule = require('parent-module'); + +console.log(readPkgUp.sync({cwd: path.dirname(parentModule())}).pkg); +//=> {name: 'chalk', version: '1.0.0', …} +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-exists/index.js b/node_modules/path-exists/index.js new file mode 100644 index 0000000..1943921 --- /dev/null +++ b/node_modules/path-exists/index.js @@ -0,0 +1,23 @@ +'use strict'; +const fs = require('fs'); +const {promisify} = require('util'); + +const pAccess = promisify(fs.access); + +module.exports = async path => { + try { + await pAccess(path); + return true; + } catch (_) { + return false; + } +}; + +module.exports.sync = path => { + try { + fs.accessSync(path); + return true; + } catch (_) { + return false; + } +}; diff --git a/node_modules/path-exists/license b/node_modules/path-exists/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/path-exists/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-exists/package.json b/node_modules/path-exists/package.json new file mode 100644 index 0000000..0755256 --- /dev/null +++ b/node_modules/path-exists/package.json @@ -0,0 +1,39 @@ +{ + "name": "path-exists", + "version": "4.0.0", + "description": "Check if a path exists", + "license": "MIT", + "repository": "sindresorhus/path-exists", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "path", + "exists", + "exist", + "file", + "filepath", + "fs", + "filesystem", + "file-system", + "access", + "stat" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/path-exists/readme.md b/node_modules/path-exists/readme.md new file mode 100644 index 0000000..81f9845 --- /dev/null +++ b/node_modules/path-exists/readme.md @@ -0,0 +1,52 @@ +# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) + +> Check if a path exists + +NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed. + +While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. + +Never use this before handling a file though: + +> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. + + +## Install + +``` +$ npm install path-exists +``` + + +## Usage + +```js +// foo.js +const pathExists = require('path-exists'); + +(async () => { + console.log(await pathExists('foo.js')); + //=> true +})(); +``` + + +## API + +### pathExists(path) + +Returns a `Promise` of whether the path exists. + +### pathExists.sync(path) + +Returns a `boolean` of whether the path exists. + + +## Related + +- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-key/index.js b/node_modules/path-key/index.js new file mode 100644 index 0000000..0cf6415 --- /dev/null +++ b/node_modules/path-key/index.js @@ -0,0 +1,16 @@ +'use strict'; + +const pathKey = (options = {}) => { + const environment = options.env || process.env; + const platform = options.platform || process.platform; + + if (platform !== 'win32') { + return 'PATH'; + } + + return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; +}; + +module.exports = pathKey; +// TODO: Remove this for the next major release +module.exports.default = pathKey; diff --git a/node_modules/path-key/license b/node_modules/path-key/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/path-key/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-key/package.json b/node_modules/path-key/package.json new file mode 100644 index 0000000..c8cbd38 --- /dev/null +++ b/node_modules/path-key/package.json @@ -0,0 +1,39 @@ +{ + "name": "path-key", + "version": "3.1.1", + "description": "Get the PATH environment variable key cross-platform", + "license": "MIT", + "repository": "sindresorhus/path-key", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "path", + "key", + "environment", + "env", + "variable", + "var", + "get", + "cross-platform", + "windows" + ], + "devDependencies": { + "@types/node": "^11.13.0", + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/path-key/readme.md b/node_modules/path-key/readme.md new file mode 100644 index 0000000..a9052d7 --- /dev/null +++ b/node_modules/path-key/readme.md @@ -0,0 +1,61 @@ +# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) + +> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform + +It's usually `PATH`, but on Windows it can be any casing like `Path`... + + +## Install + +``` +$ npm install path-key +``` + + +## Usage + +```js +const pathKey = require('path-key'); + +const key = pathKey(); +//=> 'PATH' + +const PATH = process.env[key]; +//=> '/usr/local/bin:/usr/bin:/bin' +``` + + +## API + +### pathKey(options?) + +#### options + +Type: `object` + +##### env + +Type: `object`
+Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) + +Use a custom environment variables object. + +#### platform + +Type: `string`
+Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) + +Get the PATH key for a specific platform. + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/picomatch/CHANGELOG.md b/node_modules/picomatch/CHANGELOG.md new file mode 100644 index 0000000..8ccc6c1 --- /dev/null +++ b/node_modules/picomatch/CHANGELOG.md @@ -0,0 +1,136 @@ +# Release history + +**All notable changes to this project will be documented in this file.** + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## 2.3.1 (2022-01-02) + +### Fixed + +* Fixes bug when a pattern containing an expression after the closing parenthesis (`/!(*.d).{ts,tsx}`) was incorrectly converted to regexp ([9f241ef](https://github.com/micromatch/picomatch/commit/9f241ef)). + +### Changed + +* Some documentation improvements ([f81d236](https://github.com/micromatch/picomatch/commit/f81d236), [421e0e7](https://github.com/micromatch/picomatch/commit/421e0e7)). + +## 2.3.0 (2021-05-21) + +### Fixed + +* Fixes bug where file names with two dots were not being matched consistently with negation extglobs containing a star ([56083ef](https://github.com/micromatch/picomatch/commit/56083ef)) + +## 2.2.3 (2021-04-10) + +### Fixed + +* Do not skip pattern seperator for square brackets ([fb08a30](https://github.com/micromatch/picomatch/commit/fb08a30)). +* Set negatedExtGlob also if it does not span the whole pattern ([032e3f5](https://github.com/micromatch/picomatch/commit/032e3f5)). + +## 2.2.2 (2020-03-21) + +### Fixed + +* Correctly handle parts of the pattern after parentheses in the `scan` method ([e15b920](https://github.com/micromatch/picomatch/commit/e15b920)). + +## 2.2.1 (2020-01-04) + +* Fixes [#49](https://github.com/micromatch/picomatch/issues/49), so that braces with no sets or ranges are now propertly treated as literals. + +## 2.2.0 (2020-01-04) + +* Disable fastpaths mode for the parse method ([5b8d33f](https://github.com/micromatch/picomatch/commit/5b8d33f)) +* Add `tokens`, `slashes`, and `parts` to the object returned by `picomatch.scan()`. + +## 2.1.0 (2019-10-31) + +* add benchmarks for scan ([4793b92](https://github.com/micromatch/picomatch/commit/4793b92)) +* Add eslint object-curly-spacing rule ([707c650](https://github.com/micromatch/picomatch/commit/707c650)) +* Add prefer-const eslint rule ([5c7501c](https://github.com/micromatch/picomatch/commit/5c7501c)) +* Add support for nonegate in scan API ([275c9b9](https://github.com/micromatch/picomatch/commit/275c9b9)) +* Change lets to consts. Move root import up. ([4840625](https://github.com/micromatch/picomatch/commit/4840625)) +* closes https://github.com/micromatch/picomatch/issues/21 ([766bcb0](https://github.com/micromatch/picomatch/commit/766bcb0)) +* Fix "Extglobs" table in readme ([eb19da8](https://github.com/micromatch/picomatch/commit/eb19da8)) +* fixes https://github.com/micromatch/picomatch/issues/20 ([9caca07](https://github.com/micromatch/picomatch/commit/9caca07)) +* fixes https://github.com/micromatch/picomatch/issues/26 ([fa58f45](https://github.com/micromatch/picomatch/commit/fa58f45)) +* Lint test ([d433a34](https://github.com/micromatch/picomatch/commit/d433a34)) +* lint unit tests ([0159b55](https://github.com/micromatch/picomatch/commit/0159b55)) +* Make scan work with noext ([6c02e03](https://github.com/micromatch/picomatch/commit/6c02e03)) +* minor linting ([c2a2b87](https://github.com/micromatch/picomatch/commit/c2a2b87)) +* minor parser improvements ([197671d](https://github.com/micromatch/picomatch/commit/197671d)) +* remove eslint since it... ([07876fa](https://github.com/micromatch/picomatch/commit/07876fa)) +* remove funding file ([8ebe96d](https://github.com/micromatch/picomatch/commit/8ebe96d)) +* Remove unused funks ([cbc6d54](https://github.com/micromatch/picomatch/commit/cbc6d54)) +* Run eslint during pretest, fix existing eslint findings ([0682367](https://github.com/micromatch/picomatch/commit/0682367)) +* support `noparen` in scan ([3d37569](https://github.com/micromatch/picomatch/commit/3d37569)) +* update changelog ([7b34e77](https://github.com/micromatch/picomatch/commit/7b34e77)) +* update travis ([777f038](https://github.com/micromatch/picomatch/commit/777f038)) +* Use eslint-disable-next-line instead of eslint-disable ([4e7c1fd](https://github.com/micromatch/picomatch/commit/4e7c1fd)) + +## 2.0.7 (2019-05-14) + +* 2.0.7 ([9eb9a71](https://github.com/micromatch/picomatch/commit/9eb9a71)) +* supports lookbehinds ([1f63f7e](https://github.com/micromatch/picomatch/commit/1f63f7e)) +* update .verb.md file with typo change ([2741279](https://github.com/micromatch/picomatch/commit/2741279)) +* fix: typo in README ([0753e44](https://github.com/micromatch/picomatch/commit/0753e44)) + +## 2.0.4 (2019-04-10) + +### Fixed + +- Readme link [fixed](https://github.com/micromatch/picomatch/pull/13/commits/a96ab3aa2b11b6861c23289964613d85563b05df) by @danez. +- `options.capture` now works as expected when fastpaths are enabled. See https://github.com/micromatch/picomatch/pull/12/commits/26aefd71f1cfaf95c37f1c1fcab68a693b037304. Thanks to @DrPizza. + +## 2.0.0 (2019-04-10) + +### Added + +- Adds support for `options.onIgnore`. See the readme for details +- Adds support for `options.onResult`. See the readme for details + +### Breaking changes + +- The unixify option was renamed to `windows` +- caching and all related options and methods have been removed + +## 1.0.0 (2018-11-05) + +- adds `.onMatch` option +- improvements to `.scan` method +- numerous improvements and optimizations for matching and parsing +- better windows path handling + +## 0.1.0 - 2017-04-13 + +First release. + + +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog diff --git a/node_modules/picomatch/LICENSE b/node_modules/picomatch/LICENSE new file mode 100644 index 0000000..3608dca --- /dev/null +++ b/node_modules/picomatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/picomatch/README.md b/node_modules/picomatch/README.md new file mode 100644 index 0000000..b0526e2 --- /dev/null +++ b/node_modules/picomatch/README.md @@ -0,0 +1,708 @@ +

Picomatch

+ +

+ +version + + +test status + + +coverage status + + +downloads + +

+ +
+
+ +

+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. +

+ +
+
+ +## Why picomatch? + +* **Lightweight** - No dependencies +* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function. +* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps) +* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files) +* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes. +* **Well tested** - Thousands of unit tests + +See the [library comparison](#library-comparisons) to other libraries. + +
+
+ +## Table of Contents + +
Click to expand + +- [Install](#install) +- [Usage](#usage) +- [API](#api) + * [picomatch](#picomatch) + * [.test](#test) + * [.matchBase](#matchbase) + * [.isMatch](#ismatch) + * [.parse](#parse) + * [.scan](#scan) + * [.compileRe](#compilere) + * [.makeRe](#makere) + * [.toRegex](#toregex) +- [Options](#options) + * [Picomatch options](#picomatch-options) + * [Scan Options](#scan-options) + * [Options Examples](#options-examples) +- [Globbing features](#globbing-features) + * [Basic globbing](#basic-globbing) + * [Advanced globbing](#advanced-globbing) + * [Braces](#braces) + * [Matching special characters as literals](#matching-special-characters-as-literals) +- [Library Comparisons](#library-comparisons) +- [Benchmarks](#benchmarks) +- [Philosophies](#philosophies) +- [About](#about) + * [Author](#author) + * [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +
+ +
+
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +npm install --save picomatch +``` + +
+ +## Usage + +The main export is a function that takes a glob pattern and an options object and returns a function for matching strings. + +```js +const pm = require('picomatch'); +const isMatch = pm('*.js'); + +console.log(isMatch('abcd')); //=> false +console.log(isMatch('a.js')); //=> true +console.log(isMatch('a.md')); //=> false +console.log(isMatch('a/b.js')); //=> false +``` + +
+ +## API + +### [picomatch](lib/picomatch.js#L32) + +Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information. + +**Params** + +* `globs` **{String|Array}**: One or more glob patterns. +* `options` **{Object=}** +* `returns` **{Function=}**: Returns a matcher function. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch(glob[, options]); + +const isMatch = picomatch('*.!(*a)'); +console.log(isMatch('a.a')); //=> false +console.log(isMatch('a.b')); //=> true +``` + +### [.test](lib/picomatch.js#L117) + +Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string. + +**Params** + +* `input` **{String}**: String to test. +* `regex` **{RegExp}** +* `returns` **{Object}**: Returns an object with matching info. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.test(input, regex[, options]); + +console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); +// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } +``` + +### [.matchBase](lib/picomatch.js#L161) + +Match the basename of a filepath. + +**Params** + +* `input` **{String}**: String to test. +* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe). +* `returns` **{Boolean}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.matchBase(input, glob[, options]); +console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true +``` + +### [.isMatch](lib/picomatch.js#L183) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* **{String|Array}**: str The string to test. +* **{String|Array}**: patterns One or more glob patterns to use for matching. +* **{Object}**: See available [options](#options). +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.isMatch(string, patterns[, options]); + +console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true +console.log(picomatch.isMatch('a.a', 'b.*')); //=> false +``` + +### [.parse](lib/picomatch.js#L199) + +Parse a glob pattern to create the source string for a regular expression. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string. + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.parse(pattern[, options]); +``` + +### [.scan](lib/picomatch.js#L231) + +Scan a glob pattern to separate the pattern into segments. + +**Params** + +* `input` **{String}**: Glob pattern to scan. +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.scan(input[, options]); + +const result = picomatch.scan('!./foo/*.js'); +console.log(result); +{ prefix: '!./', + input: '!./foo/*.js', + start: 3, + base: 'foo', + glob: '*.js', + isBrace: false, + isBracket: false, + isGlob: true, + isExtglob: false, + isGlobstar: false, + negated: true } +``` + +### [.compileRe](lib/picomatch.js#L245) + +Compile a regular expression from the `state` object returned by the +[parse()](#parse) method. + +**Params** + +* `state` **{Object}** +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser. +* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. +* `returns` **{RegExp}** + +### [.makeRe](lib/picomatch.js#L286) + +Create a regular expression from a parsed glob pattern. + +**Params** + +* `state` **{String}**: The object returned from the `.parse` method. +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. +* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +const picomatch = require('picomatch'); +const state = picomatch.parse('*.js'); +// picomatch.compileRe(state[, options]); + +console.log(picomatch.compileRe(state)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +### [.toRegex](lib/picomatch.js#L321) + +Create a regular expression from the given regex source string. + +**Params** + +* `source` **{String}**: Regular expression source string. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.toRegex(source[, options]); + +const { output } = picomatch.parse('*.js'); +console.log(picomatch.toRegex(output)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +
+ +## Options + +### Picomatch options + +The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | +| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | +| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | +| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | +| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | +| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | +| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true | +| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. | +| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. | +| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | +| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | +| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | +| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | +| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | +| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | +| `matchBase` | `boolean` | `false` | Alias for `basename` | +| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | +| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | +| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | +| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. | +| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | +| `noext` | `boolean` | `false` | Alias for `noextglob` | +| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) | +| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | +| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | +| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | +| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | +| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | +| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | +| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). | +| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | +| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. | +| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | +| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | +| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | +| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. | +| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. | + +picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error. + +### Scan Options + +In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern | +| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true | + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.scan('!./foo/*.js', { tokens: true }); +console.log(result); +// { +// prefix: '!./', +// input: '!./foo/*.js', +// start: 3, +// base: 'foo', +// glob: '*.js', +// isBrace: false, +// isBracket: false, +// isGlob: true, +// isExtglob: false, +// isGlobstar: false, +// negated: true, +// maxDepth: 2, +// tokens: [ +// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true }, +// { value: 'foo', depth: 1, isGlob: false }, +// { value: '*.js', depth: 1, isGlob: true } +// ], +// slashes: [ 2, 6 ], +// parts: [ 'foo', '*.js' ] +// } +``` + +
+ +### Options Examples + +#### options.expandRange + +**Type**: `function` + +**Default**: `undefined` + +Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. + +**Example** + +The following example shows how to create a glob that matches a folder + +```js +const fill = require('fill-range'); +const regex = pm.makeRe('foo/{01..25}/bar', { + expandRange(a, b) { + return `(${fill(a, b, { toRegex: true })})`; + } +}); + +console.log(regex); +//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ + +console.log(regex.test('foo/00/bar')) // false +console.log(regex.test('foo/01/bar')) // true +console.log(regex.test('foo/10/bar')) // true +console.log(regex.test('foo/22/bar')) // true +console.log(regex.test('foo/25/bar')) // true +console.log(regex.test('foo/26/bar')) // false +``` + +#### options.format + +**Type**: `function` + +**Default**: `undefined` + +Custom function for formatting strings before they're matched. + +**Example** + +```js +// strip leading './' from strings +const format = str => str.replace(/^\.\//, ''); +const isMatch = picomatch('foo/*.js', { format }); +console.log(isMatch('./foo/bar.js')); //=> true +``` + +#### options.onMatch + +```js +const onMatch = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onMatch }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onIgnore + +```js +const onIgnore = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onIgnore, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onResult + +```js +const onResult = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onResult, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +
+
+ +## Globbing features + +* [Basic globbing](#basic-globbing) (Wildcard matching) +* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching) + +### Basic globbing + +| **Character** | **Description** | +| --- | --- | +| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. | +| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. | +| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. | +| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. | + +#### Matching behavior vs. Bash + +Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions: + +* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`. +* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`. + +
+ +### Advanced globbing + +* [extglobs](#extglobs) +* [POSIX brackets](#posix-brackets) +* [Braces](#brace-expansion) + +#### Extglobs + +| **Pattern** | **Description** | +| --- | --- | +| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` | +| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` | +| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` | +| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` | +| `!(pattern)` | Match _anything but_ `pattern` | + +**Examples** + +```js +const pm = require('picomatch'); + +// *(pattern) matches ZERO or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// +(pattern) matches ONE or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// supports multiple extglobs +console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false + +// supports nested extglobs +console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true +``` + +#### POSIX brackets + +POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true. + +**Enable POSIX bracket support** + +```js +console.log(pm.makeRe('[[:word:]]+', { posix: true })); +//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/ +``` + +**Supported POSIX classes** + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]` +* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`. +* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`. +* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`. +* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`. +* `[:digit:]` - Numerical digits, equivalent to `[0-9]`. +* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`. +* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`. +* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`. +* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`. +* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`. +* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`. +* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`. +* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`. + +See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information. + +### Braces + +Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces. + +### Matching special characters as literals + +If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes: + +**Special Characters** + +Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms. + +To match any of the following characters as literals: `$^*+?()[] + +Examples: + +```js +console.log(pm.makeRe('foo/bar \\(1\\)')); +console.log(pm.makeRe('foo/bar \\(1\\)')); +``` + +
+
+ +## Library Comparisons + +The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets). + +| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` | +| --- | --- | --- | --- | --- | --- | --- | --- | +| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - | +| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - | +| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - | +| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - | +| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - | +| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ | +| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ | +| File system operations | - | - | - | - | - | - | - | + +
+
+ +## Benchmarks + +Performance comparison of picomatch and minimatch. + +``` +# .makeRe star + picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled) + minimatch x 627,206 ops/sec ±1.96% (87 runs sampled)) + +# .makeRe star; dot=true + picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled) + minimatch x 525,876 ops/sec ±0.60% (88 runs sampled) + +# .makeRe globstar + picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled) + minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d) + +# .makeRe globstars + picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled) + minimatch x 477,179 ops/sec ±1.33% (91 runs sampled) + +# .makeRe with leading star + picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled) + minimatch x 453,564 ops/sec ±1.43% (94 runs sampled) + +# .makeRe - basic braces + picomatch x 392,067 ops/sec ±0.70% (90 runs sampled) + minimatch x 99,532 ops/sec ±2.03% (87 runs sampled)) +``` + +
+
+ +## Philosophies + +The goal of this library is to be blazing fast, without compromising on accuracy. + +**Accuracy** + +The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`. + +Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements. + +**Performance** + +Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer. + +
+
+ +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). diff --git a/node_modules/picomatch/index.js b/node_modules/picomatch/index.js new file mode 100644 index 0000000..d2f2bc5 --- /dev/null +++ b/node_modules/picomatch/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/picomatch'); diff --git a/node_modules/picomatch/lib/constants.js b/node_modules/picomatch/lib/constants.js new file mode 100644 index 0000000..a62ef38 --- /dev/null +++ b/node_modules/picomatch/lib/constants.js @@ -0,0 +1,179 @@ +'use strict'; + +const path = require('path'); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; diff --git a/node_modules/picomatch/lib/parse.js b/node_modules/picomatch/lib/parse.js new file mode 100644 index 0000000..58269d0 --- /dev/null +++ b/node_modules/picomatch/lib/parse.js @@ -0,0 +1,1091 @@ +'use strict'; + +const constants = require('./constants'); +const utils = require('./utils'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +module.exports = parse; diff --git a/node_modules/picomatch/lib/picomatch.js b/node_modules/picomatch/lib/picomatch.js new file mode 100644 index 0000000..782d809 --- /dev/null +++ b/node_modules/picomatch/lib/picomatch.js @@ -0,0 +1,342 @@ +'use strict'; + +const path = require('path'); +const scan = require('./scan'); +const parse = require('./parse'); +const utils = require('./utils'); +const constants = require('./constants'); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +module.exports = picomatch; diff --git a/node_modules/picomatch/lib/scan.js b/node_modules/picomatch/lib/scan.js new file mode 100644 index 0000000..e59cd7a --- /dev/null +++ b/node_modules/picomatch/lib/scan.js @@ -0,0 +1,391 @@ +'use strict'; + +const utils = require('./utils'); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = require('./constants'); + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +module.exports = scan; diff --git a/node_modules/picomatch/lib/utils.js b/node_modules/picomatch/lib/utils.js new file mode 100644 index 0000000..c3ca766 --- /dev/null +++ b/node_modules/picomatch/lib/utils.js @@ -0,0 +1,64 @@ +'use strict'; + +const path = require('path'); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = require('./constants'); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; + +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; diff --git a/node_modules/picomatch/package.json b/node_modules/picomatch/package.json new file mode 100644 index 0000000..3db22d4 --- /dev/null +++ b/node_modules/picomatch/package.json @@ -0,0 +1,81 @@ +{ + "name": "picomatch", + "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.", + "version": "2.3.1", + "homepage": "https://github.com/micromatch/picomatch", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "funding": "https://github.com/sponsors/jonschlinkert", + "repository": "micromatch/picomatch", + "bugs": { + "url": "https://github.com/micromatch/picomatch/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8.6" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "devDependencies": { + "eslint": "^6.8.0", + "fill-range": "^7.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.2.2", + "nyc": "^15.0.0", + "time-require": "github:jonschlinkert/time-require" + }, + "keywords": [ + "glob", + "match", + "picomatch" + ], + "nyc": { + "reporter": [ + "html", + "lcov", + "text-summary" + ] + }, + "verb": { + "toc": { + "render": true, + "method": "preWrite", + "maxdepth": 3 + }, + "layout": "empty", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "braces", + "micromatch" + ] + }, + "reflinks": [ + "braces", + "expand-brackets", + "extglob", + "fill-range", + "micromatch", + "minimatch", + "nanomatch", + "picomatch" + ] + } +} diff --git a/node_modules/prelude-ls/CHANGELOG.md b/node_modules/prelude-ls/CHANGELOG.md new file mode 100644 index 0000000..71b8a0f --- /dev/null +++ b/node_modules/prelude-ls/CHANGELOG.md @@ -0,0 +1,108 @@ +# 1.2.1 +- fix version + +# 1.2.0 +- add `List.remove` +- build with LiveScript 1.6.0 +- update dependencies +- remove coverage calculation + +# 1.1.2 +- add `Func.memoize` +- fix `zip-all` and `zip-with-all` corner case (no input) +- build with LiveScript 1.4.0 + +# 1.1.1 +- curry `unique-by`, `minimum-by` + +# 1.1.0 +- added `List` functions: `maximum-by`, `minimum-by`, `unique-by` +- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices` +- added `Str` functions: `capitalize`, `camelize`, `dasherize` +- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)`` +- exported `Str.repeat` through main `prelude` object +- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one +- fixed issue with `fix` +- improved code coverage + +# 1.0.3 +- build browser versions + +# 1.0.2 +- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects + +# 1.0.1 +- bug fixes for `drop-while` and `take-while` + +# 1.0.0 +* massive update - separated functions into separate modules +* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list +* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that +* browser version now using browserify - use `prelude = require('prelude-ls')` +* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply` +* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists` +* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs` +* removed `cons`, `append` - use the concat operator +* removed `compose` - use the compose operator +* removed `obj-to-func` - use partially applied access (eg. `(obj.)`) +* removed `length` - use `(.length)` +* `sort-by` renamed to `sort-with` +* added new `sort-by` +* removed `compare` - just use the new `sort-by` +* `break-it` renamed `break-list`, (`Str.break-str` for the string version) +* added `Str.repeat` which creates a new string by repeating the input n times +* `unfold` as alias to `unfoldr` is no longer used +* fixed up style and compiled with LiveScript 1.1.1 +* use Make instead of Slake +* greatly improved tests + +# 0.6.0 +* fixed various bugs +* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions +* added `unfoldr` (alias `unfold`) +* calling `replicate` with a string now returns a list of strings +* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying +* added `sort`, `sortBy`, and `compare` + +# 0.5.0 +* removed `lookup` - use (.prop) +* removed `call` - use (.func arg1, arg2) +* removed `pluck` - use map (.prop), xs +* fixed buys wtih `head` and `last` +* added non-minifed browser version, as `prelude-browser.js` +* renamed `prelude-min.js` to `prelude-browser-min.js` +* renamed `zip` to `zipAll` +* renamed `zipWith` to `zipAllWith` +* added `zip`, a curried zip that takes only two arguments +* added `zipWith`, a curried zipWith that takes only two arguments + +# 0.4.0 +* added `parition` function +* added `curry` function +* removed `elem` function (use `in`) +* removed `notElem` function (use `not in`) + +# 0.3.0 +* added `listToObject` +* added `unique` +* added `objToFunc` +* added support for using strings in map and the like +* added support for using objects in map and the like +* added ability to use objects instead of functions in certain cases +* removed `error` (just use throw) +* added `tau` constant +* added `join` +* added `values` +* added `keys` +* added `partial` +* renamed `log` to `ln` +* added alias to `head`: `first` +* added `installPrelude` helper + +# 0.2.0 +* removed functions that simply warp operators as you can now use operators as functions in LiveScript +* `min/max` are now curried and take only 2 arguments +* added `call` + +# 0.1.0 +* initial public release diff --git a/node_modules/prelude-ls/LICENSE b/node_modules/prelude-ls/LICENSE new file mode 100644 index 0000000..525b118 --- /dev/null +++ b/node_modules/prelude-ls/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) George Zahariev + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/prelude-ls/README.md b/node_modules/prelude-ls/README.md new file mode 100644 index 0000000..fabc212 --- /dev/null +++ b/node_modules/prelude-ls/README.md @@ -0,0 +1,15 @@ +# prelude.ls [![Build Status](https://travis-ci.org/gkz/prelude-ls.png?branch=master)](https://travis-ci.org/gkz/prelude-ls) + +is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript. + +See **[the prelude.ls site](http://preludels.com)** for examples, a reference, and more. + +You can install via npm `npm install prelude-ls` + +### Development + +`make test` to test + +`make build` to build `lib` from `src` + +`make build-browser` to build browser versions diff --git a/node_modules/prelude-ls/lib/Func.js b/node_modules/prelude-ls/lib/Func.js new file mode 100644 index 0000000..09777a8 --- /dev/null +++ b/node_modules/prelude-ls/lib/Func.js @@ -0,0 +1,69 @@ +// Generated by LiveScript 1.6.0 +var apply, curry, flip, fix, over, memoize, toString$ = {}.toString; +apply = curry$(function(f, list){ + return f.apply(null, list); +}); +curry = function(f){ + return curry$(f); +}; +flip = curry$(function(f, x, y){ + return f(y, x); +}); +fix = function(f){ + return function(g){ + return function(){ + return f(g(g)).apply(null, arguments); + }; + }(function(g){ + return function(){ + return f(g(g)).apply(null, arguments); + }; + }); +}; +over = curry$(function(f, g, x, y){ + return f(g(x), g(y)); +}); +memoize = function(f){ + var memo; + memo = {}; + return function(){ + var args, res$, i$, to$, key, arg; + res$ = []; + for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + args = res$; + key = (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) { + arg = ref$[i$]; + results$.push(arg + toString$.call(arg).slice(8, -1)); + } + return results$; + }()).join(''); + return memo[key] = key in memo + ? memo[key] + : f.apply(null, args); + }; +}; +module.exports = { + curry: curry, + flip: flip, + fix: fix, + apply: apply, + over: over, + memoize: memoize +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/List.js b/node_modules/prelude-ls/lib/List.js new file mode 100644 index 0000000..d2e41ab --- /dev/null +++ b/node_modules/prelude-ls/lib/List.js @@ -0,0 +1,716 @@ +// Generated by LiveScript 1.6.0 +var each, map, compact, filter, reject, remove, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString; +each = curry$(function(f, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + f(x); + } + return xs; +}); +map = curry$(function(f, xs){ + var i$, len$, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + results$.push(f(x)); + } + return results$; +}); +compact = function(xs){ + var i$, len$, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (x) { + results$.push(x); + } + } + return results$; +}; +filter = curry$(function(f, xs){ + var i$, len$, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (f(x)) { + results$.push(x); + } + } + return results$; +}); +reject = curry$(function(f, xs){ + var i$, len$, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (!f(x)) { + results$.push(x); + } + } + return results$; +}); +remove = curry$(function(el, xs){ + var i, x$; + i = elemIndex(el, xs); + x$ = xs.slice(); + if (i != null) { + x$.splice(i, 1); + } + return x$; +}); +partition = curry$(function(f, xs){ + var passed, failed, i$, len$, x; + passed = []; + failed = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + (f(x) ? passed : failed).push(x); + } + return [passed, failed]; +}); +find = curry$(function(f, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (f(x)) { + return x; + } + } +}); +head = first = function(xs){ + return xs[0]; +}; +tail = function(xs){ + if (!xs.length) { + return; + } + return xs.slice(1); +}; +last = function(xs){ + return xs[xs.length - 1]; +}; +initial = function(xs){ + if (!xs.length) { + return; + } + return xs.slice(0, -1); +}; +empty = function(xs){ + return !xs.length; +}; +reverse = function(xs){ + return xs.concat().reverse(); +}; +unique = function(xs){ + var result, i$, len$, x; + result = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (!in$(x, result)) { + result.push(x); + } + } + return result; +}; +uniqueBy = curry$(function(f, xs){ + var seen, i$, len$, x, val, results$ = []; + seen = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + val = f(x); + if (in$(val, seen)) { + continue; + } + seen.push(val); + results$.push(x); + } + return results$; +}); +fold = foldl = curry$(function(f, memo, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + memo = f(memo, x); + } + return memo; +}); +fold1 = foldl1 = curry$(function(f, xs){ + return fold(f, xs[0], xs.slice(1)); +}); +foldr = curry$(function(f, memo, xs){ + var i$, x; + for (i$ = xs.length - 1; i$ >= 0; --i$) { + x = xs[i$]; + memo = f(x, memo); + } + return memo; +}); +foldr1 = curry$(function(f, xs){ + return foldr(f, xs[xs.length - 1], xs.slice(0, -1)); +}); +unfoldr = curry$(function(f, b){ + var result, x, that; + result = []; + x = b; + while ((that = f(x)) != null) { + result.push(that[0]); + x = that[1]; + } + return result; +}); +concat = function(xss){ + return [].concat.apply([], xss); +}; +concatMap = curry$(function(f, xs){ + var x; + return [].concat.apply([], (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { + x = ref$[i$]; + results$.push(f(x)); + } + return results$; + }())); +}); +flatten = function(xs){ + var x; + return [].concat.apply([], (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (toString$.call(x).slice(8, -1) === 'Array') { + results$.push(flatten(x)); + } else { + results$.push(x); + } + } + return results$; + }())); +}; +difference = function(xs){ + var yss, res$, i$, to$, results, len$, x, j$, len1$, ys; + res$ = []; + for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + yss = res$; + results = []; + outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { + ys = yss[j$]; + if (in$(x, ys)) { + continue outer; + } + } + results.push(x); + } + return results; +}; +intersection = function(xs){ + var yss, res$, i$, to$, results, len$, x, j$, len1$, ys; + res$ = []; + for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + yss = res$; + results = []; + outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { + ys = yss[j$]; + if (!in$(x, ys)) { + continue outer; + } + } + results.push(x); + } + return results; +}; +union = function(){ + var xss, res$, i$, to$, results, len$, xs, j$, len1$, x; + res$ = []; + for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + xss = res$; + results = []; + for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { + xs = xss[i$]; + for (j$ = 0, len1$ = xs.length; j$ < len1$; ++j$) { + x = xs[j$]; + if (!in$(x, results)) { + results.push(x); + } + } + } + return results; +}; +countBy = curry$(function(f, xs){ + var results, i$, len$, x, key; + results = {}; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + key = f(x); + if (key in results) { + results[key] += 1; + } else { + results[key] = 1; + } + } + return results; +}); +groupBy = curry$(function(f, xs){ + var results, i$, len$, x, key; + results = {}; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + key = f(x); + if (key in results) { + results[key].push(x); + } else { + results[key] = [x]; + } + } + return results; +}); +andList = function(xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (!x) { + return false; + } + } + return true; +}; +orList = function(xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (x) { + return true; + } + } + return false; +}; +any = curry$(function(f, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (f(x)) { + return true; + } + } + return false; +}); +all = curry$(function(f, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (!f(x)) { + return false; + } + } + return true; +}); +sort = function(xs){ + return xs.concat().sort(function(x, y){ + if (x > y) { + return 1; + } else if (x < y) { + return -1; + } else { + return 0; + } + }); +}; +sortWith = curry$(function(f, xs){ + return xs.concat().sort(f); +}); +sortBy = curry$(function(f, xs){ + return xs.concat().sort(function(x, y){ + if (f(x) > f(y)) { + return 1; + } else if (f(x) < f(y)) { + return -1; + } else { + return 0; + } + }); +}); +sum = function(xs){ + var result, i$, len$, x; + result = 0; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + result += x; + } + return result; +}; +product = function(xs){ + var result, i$, len$, x; + result = 1; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + result *= x; + } + return result; +}; +mean = average = function(xs){ + var sum, i$, len$, x; + sum = 0; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + sum += x; + } + return sum / xs.length; +}; +maximum = function(xs){ + var max, i$, ref$, len$, x; + max = xs[0]; + for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (x > max) { + max = x; + } + } + return max; +}; +minimum = function(xs){ + var min, i$, ref$, len$, x; + min = xs[0]; + for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (x < min) { + min = x; + } + } + return min; +}; +maximumBy = curry$(function(f, xs){ + var max, i$, ref$, len$, x; + max = xs[0]; + for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (f(x) > f(max)) { + max = x; + } + } + return max; +}); +minimumBy = curry$(function(f, xs){ + var min, i$, ref$, len$, x; + min = xs[0]; + for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (f(x) < f(min)) { + min = x; + } + } + return min; +}); +scan = scanl = curry$(function(f, memo, xs){ + var last, x; + last = memo; + return [memo].concat((function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { + x = ref$[i$]; + results$.push(last = f(last, x)); + } + return results$; + }())); +}); +scan1 = scanl1 = curry$(function(f, xs){ + if (!xs.length) { + return; + } + return scan(f, xs[0], xs.slice(1)); +}); +scanr = curry$(function(f, memo, xs){ + xs = xs.concat().reverse(); + return scan(f, memo, xs).reverse(); +}); +scanr1 = curry$(function(f, xs){ + if (!xs.length) { + return; + } + xs = xs.concat().reverse(); + return scan(f, xs[0], xs.slice(1)).reverse(); +}); +slice = curry$(function(x, y, xs){ + return xs.slice(x, y); +}); +take = curry$(function(n, xs){ + if (n <= 0) { + return xs.slice(0, 0); + } else { + return xs.slice(0, n); + } +}); +drop = curry$(function(n, xs){ + if (n <= 0) { + return xs; + } else { + return xs.slice(n); + } +}); +splitAt = curry$(function(n, xs){ + return [take(n, xs), drop(n, xs)]; +}); +takeWhile = curry$(function(p, xs){ + var len, i; + len = xs.length; + if (!len) { + return xs; + } + i = 0; + while (i < len && p(xs[i])) { + i += 1; + } + return xs.slice(0, i); +}); +dropWhile = curry$(function(p, xs){ + var len, i; + len = xs.length; + if (!len) { + return xs; + } + i = 0; + while (i < len && p(xs[i])) { + i += 1; + } + return xs.slice(i); +}); +span = curry$(function(p, xs){ + return [takeWhile(p, xs), dropWhile(p, xs)]; +}); +breakList = curry$(function(p, xs){ + return span(compose$(p, not$), xs); +}); +zip = curry$(function(xs, ys){ + var result, len, i$, len$, i, x; + result = []; + len = ys.length; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (i === len) { + break; + } + result.push([x, ys[i]]); + } + return result; +}); +zipWith = curry$(function(f, xs, ys){ + var result, len, i$, len$, i, x; + result = []; + len = ys.length; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (i === len) { + break; + } + result.push(f(x, ys[i])); + } + return result; +}); +zipAll = function(){ + var xss, res$, i$, to$, minLength, len$, xs, ref$, i, lresult$, j$, results$ = []; + res$ = []; + for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + xss = res$; + minLength = undefined; + for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { + xs = xss[i$]; + minLength <= (ref$ = xs.length) || (minLength = ref$); + } + for (i$ = 0; i$ < minLength; ++i$) { + i = i$; + lresult$ = []; + for (j$ = 0, len$ = xss.length; j$ < len$; ++j$) { + xs = xss[j$]; + lresult$.push(xs[i]); + } + results$.push(lresult$); + } + return results$; +}; +zipAllWith = function(f){ + var xss, res$, i$, to$, minLength, len$, xs, ref$, i, results$ = []; + res$ = []; + for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + xss = res$; + minLength = undefined; + for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { + xs = xss[i$]; + minLength <= (ref$ = xs.length) || (minLength = ref$); + } + for (i$ = 0; i$ < minLength; ++i$) { + i = i$; + results$.push(f.apply(null, (fn$()))); + } + return results$; + function fn$(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = xss).length; i$ < len$; ++i$) { + xs = ref$[i$]; + results$.push(xs[i]); + } + return results$; + } +}; +at = curry$(function(n, xs){ + if (n < 0) { + return xs[xs.length + n]; + } else { + return xs[n]; + } +}); +elemIndex = curry$(function(el, xs){ + var i$, len$, i, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (x === el) { + return i; + } + } +}); +elemIndices = curry$(function(el, xs){ + var i$, len$, i, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (x === el) { + results$.push(i); + } + } + return results$; +}); +findIndex = curry$(function(f, xs){ + var i$, len$, i, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (f(x)) { + return i; + } + } +}); +findIndices = curry$(function(f, xs){ + var i$, len$, i, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (f(x)) { + results$.push(i); + } + } + return results$; +}); +module.exports = { + each: each, + map: map, + filter: filter, + compact: compact, + reject: reject, + remove: remove, + partition: partition, + find: find, + head: head, + first: first, + tail: tail, + last: last, + initial: initial, + empty: empty, + reverse: reverse, + difference: difference, + intersection: intersection, + union: union, + countBy: countBy, + groupBy: groupBy, + fold: fold, + fold1: fold1, + foldl: foldl, + foldl1: foldl1, + foldr: foldr, + foldr1: foldr1, + unfoldr: unfoldr, + andList: andList, + orList: orList, + any: any, + all: all, + unique: unique, + uniqueBy: uniqueBy, + sort: sort, + sortWith: sortWith, + sortBy: sortBy, + sum: sum, + product: product, + mean: mean, + average: average, + concat: concat, + concatMap: concatMap, + flatten: flatten, + maximum: maximum, + minimum: minimum, + maximumBy: maximumBy, + minimumBy: minimumBy, + scan: scan, + scan1: scan1, + scanl: scanl, + scanl1: scanl1, + scanr: scanr, + scanr1: scanr1, + slice: slice, + take: take, + drop: drop, + splitAt: splitAt, + takeWhile: takeWhile, + dropWhile: dropWhile, + span: span, + breakList: breakList, + zip: zip, + zipWith: zipWith, + zipAll: zipAll, + zipAllWith: zipAllWith, + at: at, + elemIndex: elemIndex, + elemIndices: elemIndices, + findIndex: findIndex, + findIndices: findIndices +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} +function in$(x, xs){ + var i = -1, l = xs.length >>> 0; + while (++i < l) if (x === xs[i]) return true; + return false; +} +function compose$() { + var functions = arguments; + return function() { + var i, result; + result = functions[0].apply(this, arguments); + for (i = 1; i < functions.length; ++i) { + result = functions[i](result); + } + return result; + }; +} +function not$(x){ return !x; } \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/Num.js b/node_modules/prelude-ls/lib/Num.js new file mode 100644 index 0000000..f6b5319 --- /dev/null +++ b/node_modules/prelude-ls/lib/Num.js @@ -0,0 +1,130 @@ +// Generated by LiveScript 1.6.0 +var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm; +max = curry$(function(x$, y$){ + return x$ > y$ ? x$ : y$; +}); +min = curry$(function(x$, y$){ + return x$ < y$ ? x$ : y$; +}); +negate = function(x){ + return -x; +}; +abs = Math.abs; +signum = function(x){ + if (x < 0) { + return -1; + } else if (x > 0) { + return 1; + } else { + return 0; + } +}; +quot = curry$(function(x, y){ + return ~~(x / y); +}); +rem = curry$(function(x$, y$){ + return x$ % y$; +}); +div = curry$(function(x, y){ + return Math.floor(x / y); +}); +mod = curry$(function(x$, y$){ + var ref$; + return ((x$) % (ref$ = y$) + ref$) % ref$; +}); +recip = (function(it){ + return 1 / it; +}); +pi = Math.PI; +tau = pi * 2; +exp = Math.exp; +sqrt = Math.sqrt; +ln = Math.log; +pow = curry$(function(x$, y$){ + return Math.pow(x$, y$); +}); +sin = Math.sin; +tan = Math.tan; +cos = Math.cos; +asin = Math.asin; +acos = Math.acos; +atan = Math.atan; +atan2 = curry$(function(x, y){ + return Math.atan2(x, y); +}); +truncate = function(x){ + return ~~x; +}; +round = Math.round; +ceiling = Math.ceil; +floor = Math.floor; +isItNaN = function(x){ + return x !== x; +}; +even = function(x){ + return x % 2 === 0; +}; +odd = function(x){ + return x % 2 !== 0; +}; +gcd = curry$(function(x, y){ + var z; + x = Math.abs(x); + y = Math.abs(y); + while (y !== 0) { + z = x % y; + x = y; + y = z; + } + return x; +}); +lcm = curry$(function(x, y){ + return Math.abs(Math.floor(x / gcd(x, y) * y)); +}); +module.exports = { + max: max, + min: min, + negate: negate, + abs: abs, + signum: signum, + quot: quot, + rem: rem, + div: div, + mod: mod, + recip: recip, + pi: pi, + tau: tau, + exp: exp, + sqrt: sqrt, + ln: ln, + pow: pow, + sin: sin, + tan: tan, + cos: cos, + acos: acos, + asin: asin, + atan: atan, + atan2: atan2, + truncate: truncate, + round: round, + ceiling: ceiling, + floor: floor, + isItNaN: isItNaN, + even: even, + odd: odd, + gcd: gcd, + lcm: lcm +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/Obj.js b/node_modules/prelude-ls/lib/Obj.js new file mode 100644 index 0000000..0b8d321 --- /dev/null +++ b/node_modules/prelude-ls/lib/Obj.js @@ -0,0 +1,154 @@ +// Generated by LiveScript 1.6.0 +var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find; +values = function(object){ + var i$, x, results$ = []; + for (i$ in object) { + x = object[i$]; + results$.push(x); + } + return results$; +}; +keys = function(object){ + var x, results$ = []; + for (x in object) { + results$.push(x); + } + return results$; +}; +pairsToObj = function(object){ + var i$, len$, x, resultObj$ = {}; + for (i$ = 0, len$ = object.length; i$ < len$; ++i$) { + x = object[i$]; + resultObj$[x[0]] = x[1]; + } + return resultObj$; +}; +objToPairs = function(object){ + var key, value, results$ = []; + for (key in object) { + value = object[key]; + results$.push([key, value]); + } + return results$; +}; +listsToObj = curry$(function(keys, values){ + var i$, len$, i, key, resultObj$ = {}; + for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) { + i = i$; + key = keys[i$]; + resultObj$[key] = values[i]; + } + return resultObj$; +}); +objToLists = function(object){ + var keys, values, key, value; + keys = []; + values = []; + for (key in object) { + value = object[key]; + keys.push(key); + values.push(value); + } + return [keys, values]; +}; +empty = function(object){ + var x; + for (x in object) { + return false; + } + return true; +}; +each = curry$(function(f, object){ + var i$, x; + for (i$ in object) { + x = object[i$]; + f(x); + } + return object; +}); +map = curry$(function(f, object){ + var k, x, resultObj$ = {}; + for (k in object) { + x = object[k]; + resultObj$[k] = f(x); + } + return resultObj$; +}); +compact = function(object){ + var k, x, resultObj$ = {}; + for (k in object) { + x = object[k]; + if (x) { + resultObj$[k] = x; + } + } + return resultObj$; +}; +filter = curry$(function(f, object){ + var k, x, resultObj$ = {}; + for (k in object) { + x = object[k]; + if (f(x)) { + resultObj$[k] = x; + } + } + return resultObj$; +}); +reject = curry$(function(f, object){ + var k, x, resultObj$ = {}; + for (k in object) { + x = object[k]; + if (!f(x)) { + resultObj$[k] = x; + } + } + return resultObj$; +}); +partition = curry$(function(f, object){ + var passed, failed, k, x; + passed = {}; + failed = {}; + for (k in object) { + x = object[k]; + (f(x) ? passed : failed)[k] = x; + } + return [passed, failed]; +}); +find = curry$(function(f, object){ + var i$, x; + for (i$ in object) { + x = object[i$]; + if (f(x)) { + return x; + } + } +}); +module.exports = { + values: values, + keys: keys, + pairsToObj: pairsToObj, + objToPairs: objToPairs, + listsToObj: listsToObj, + objToLists: objToLists, + empty: empty, + each: each, + map: map, + filter: filter, + compact: compact, + reject: reject, + partition: partition, + find: find +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/Str.js b/node_modules/prelude-ls/lib/Str.js new file mode 100644 index 0000000..59406d6 --- /dev/null +++ b/node_modules/prelude-ls/lib/Str.js @@ -0,0 +1,92 @@ +// Generated by LiveScript 1.6.0 +var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize; +split = curry$(function(sep, str){ + return str.split(sep); +}); +join = curry$(function(sep, xs){ + return xs.join(sep); +}); +lines = function(str){ + if (!str.length) { + return []; + } + return str.split('\n'); +}; +unlines = function(it){ + return it.join('\n'); +}; +words = function(str){ + if (!str.length) { + return []; + } + return str.split(/[ ]+/); +}; +unwords = function(it){ + return it.join(' '); +}; +chars = function(it){ + return it.split(''); +}; +unchars = function(it){ + return it.join(''); +}; +reverse = function(str){ + return str.split('').reverse().join(''); +}; +repeat = curry$(function(n, str){ + var result, i$; + result = ''; + for (i$ = 0; i$ < n; ++i$) { + result += str; + } + return result; +}); +capitalize = function(str){ + return str.charAt(0).toUpperCase() + str.slice(1); +}; +camelize = function(it){ + return it.replace(/[-_]+(.)?/g, function(arg$, c){ + return (c != null ? c : '').toUpperCase(); + }); +}; +dasherize = function(str){ + return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){ + return lower + "-" + (upper.length > 1 + ? upper + : upper.toLowerCase()); + }).replace(/^([A-Z]+)/, function(arg$, upper){ + if (upper.length > 1) { + return upper + "-"; + } else { + return upper.toLowerCase(); + } + }); +}; +module.exports = { + split: split, + join: join, + lines: lines, + unlines: unlines, + words: words, + unwords: unwords, + chars: chars, + unchars: unchars, + reverse: reverse, + repeat: repeat, + capitalize: capitalize, + camelize: camelize, + dasherize: dasherize +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/index.js b/node_modules/prelude-ls/lib/index.js new file mode 100644 index 0000000..9dcbed4 --- /dev/null +++ b/node_modules/prelude-ls/lib/index.js @@ -0,0 +1,178 @@ +// Generated by LiveScript 1.6.0 +var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString; +Func = require('./Func.js'); +List = require('./List.js'); +Obj = require('./Obj.js'); +Str = require('./Str.js'); +Num = require('./Num.js'); +id = function(x){ + return x; +}; +isType = curry$(function(type, x){ + return toString$.call(x).slice(8, -1) === type; +}); +replicate = curry$(function(n, x){ + var i$, results$ = []; + for (i$ = 0; i$ < n; ++i$) { + results$.push(x); + } + return results$; +}); +Str.empty = List.empty; +Str.slice = List.slice; +Str.take = List.take; +Str.drop = List.drop; +Str.splitAt = List.splitAt; +Str.takeWhile = List.takeWhile; +Str.dropWhile = List.dropWhile; +Str.span = List.span; +Str.breakStr = List.breakList; +prelude = { + Func: Func, + List: List, + Obj: Obj, + Str: Str, + Num: Num, + id: id, + isType: isType, + replicate: replicate +}; +prelude.each = List.each; +prelude.map = List.map; +prelude.filter = List.filter; +prelude.compact = List.compact; +prelude.reject = List.reject; +prelude.partition = List.partition; +prelude.find = List.find; +prelude.head = List.head; +prelude.first = List.first; +prelude.tail = List.tail; +prelude.last = List.last; +prelude.initial = List.initial; +prelude.empty = List.empty; +prelude.reverse = List.reverse; +prelude.difference = List.difference; +prelude.intersection = List.intersection; +prelude.union = List.union; +prelude.countBy = List.countBy; +prelude.groupBy = List.groupBy; +prelude.fold = List.fold; +prelude.foldl = List.foldl; +prelude.fold1 = List.fold1; +prelude.foldl1 = List.foldl1; +prelude.foldr = List.foldr; +prelude.foldr1 = List.foldr1; +prelude.unfoldr = List.unfoldr; +prelude.andList = List.andList; +prelude.orList = List.orList; +prelude.any = List.any; +prelude.all = List.all; +prelude.unique = List.unique; +prelude.uniqueBy = List.uniqueBy; +prelude.sort = List.sort; +prelude.sortWith = List.sortWith; +prelude.sortBy = List.sortBy; +prelude.sum = List.sum; +prelude.product = List.product; +prelude.mean = List.mean; +prelude.average = List.average; +prelude.concat = List.concat; +prelude.concatMap = List.concatMap; +prelude.flatten = List.flatten; +prelude.maximum = List.maximum; +prelude.minimum = List.minimum; +prelude.maximumBy = List.maximumBy; +prelude.minimumBy = List.minimumBy; +prelude.scan = List.scan; +prelude.scanl = List.scanl; +prelude.scan1 = List.scan1; +prelude.scanl1 = List.scanl1; +prelude.scanr = List.scanr; +prelude.scanr1 = List.scanr1; +prelude.slice = List.slice; +prelude.take = List.take; +prelude.drop = List.drop; +prelude.splitAt = List.splitAt; +prelude.takeWhile = List.takeWhile; +prelude.dropWhile = List.dropWhile; +prelude.span = List.span; +prelude.breakList = List.breakList; +prelude.zip = List.zip; +prelude.zipWith = List.zipWith; +prelude.zipAll = List.zipAll; +prelude.zipAllWith = List.zipAllWith; +prelude.at = List.at; +prelude.elemIndex = List.elemIndex; +prelude.elemIndices = List.elemIndices; +prelude.findIndex = List.findIndex; +prelude.findIndices = List.findIndices; +prelude.apply = Func.apply; +prelude.curry = Func.curry; +prelude.flip = Func.flip; +prelude.fix = Func.fix; +prelude.over = Func.over; +prelude.split = Str.split; +prelude.join = Str.join; +prelude.lines = Str.lines; +prelude.unlines = Str.unlines; +prelude.words = Str.words; +prelude.unwords = Str.unwords; +prelude.chars = Str.chars; +prelude.unchars = Str.unchars; +prelude.repeat = Str.repeat; +prelude.capitalize = Str.capitalize; +prelude.camelize = Str.camelize; +prelude.dasherize = Str.dasherize; +prelude.values = Obj.values; +prelude.keys = Obj.keys; +prelude.pairsToObj = Obj.pairsToObj; +prelude.objToPairs = Obj.objToPairs; +prelude.listsToObj = Obj.listsToObj; +prelude.objToLists = Obj.objToLists; +prelude.max = Num.max; +prelude.min = Num.min; +prelude.negate = Num.negate; +prelude.abs = Num.abs; +prelude.signum = Num.signum; +prelude.quot = Num.quot; +prelude.rem = Num.rem; +prelude.div = Num.div; +prelude.mod = Num.mod; +prelude.recip = Num.recip; +prelude.pi = Num.pi; +prelude.tau = Num.tau; +prelude.exp = Num.exp; +prelude.sqrt = Num.sqrt; +prelude.ln = Num.ln; +prelude.pow = Num.pow; +prelude.sin = Num.sin; +prelude.tan = Num.tan; +prelude.cos = Num.cos; +prelude.acos = Num.acos; +prelude.asin = Num.asin; +prelude.atan = Num.atan; +prelude.atan2 = Num.atan2; +prelude.truncate = Num.truncate; +prelude.round = Num.round; +prelude.ceiling = Num.ceiling; +prelude.floor = Num.floor; +prelude.isItNaN = Num.isItNaN; +prelude.even = Num.even; +prelude.odd = Num.odd; +prelude.gcd = Num.gcd; +prelude.lcm = Num.lcm; +prelude.VERSION = '1.2.1'; +module.exports = prelude; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/package.json b/node_modules/prelude-ls/package.json new file mode 100644 index 0000000..c313c3d --- /dev/null +++ b/node_modules/prelude-ls/package.json @@ -0,0 +1,46 @@ +{ + "name": "prelude-ls", + "version": "1.2.1", + "author": "George Zahariev ", + "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.", + "keywords": [ + "prelude", + "livescript", + "utility", + "ls", + "coffeescript", + "javascript", + "library", + "functional", + "array", + "list", + "object", + "string" + ], + "main": "lib/", + "files": [ + "lib/", + "README.md", + "LICENSE" + ], + "homepage": "http://preludels.com", + "bugs": "https://github.com/gkz/prelude-ls/issues", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + }, + "repository": { + "type": "git", + "url": "git://github.com/gkz/prelude-ls.git" + }, + "scripts": { + "test": "make test" + }, + "devDependencies": { + "livescript": "^1.6.0", + "uglify-js": "^3.8.1", + "mocha": "^7.1.1", + "browserify": "^16.5.1", + "sinon": "~8.0.1" + } +} diff --git a/node_modules/prettier/LICENSE b/node_modules/prettier/LICENSE new file mode 100644 index 0000000..5767e34 --- /dev/null +++ b/node_modules/prettier/LICENSE @@ -0,0 +1,7 @@ +Copyright © James Long and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/prettier/README.md b/node_modules/prettier/README.md new file mode 100644 index 0000000..ce24c9c --- /dev/null +++ b/node_modules/prettier/README.md @@ -0,0 +1,108 @@ +[![Prettier Banner](https://unpkg.com/prettier-logo@1.0.3/images/prettier-banner-light.svg)](https://prettier.io) + +

Opinionated Code Formatter

+ +

+ + JavaScript + · TypeScript + · Flow + · JSX + · JSON + +
+ + CSS + · SCSS + · Less + +
+ + HTML + · Vue + · Angular + +
+ + GraphQL + · Markdown + · YAML + +
+ + + Your favorite language? + + +

+ +

+ + Github Actions Build Status + + Github Actions Build Status + + Github Actions Build Status + + Codecov Coverage Status + + Blazing Fast +
+ + npm version + + weekly downloads from npm + + code style: prettier + + Follow Prettier on Twitter +

+ +## Intro + +Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. + +### Input + + +```js +foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne()); +``` + +### Output + +```js +foo( + reallyLongArg(), + omgSoManyParameters(), + IShouldRefactorThis(), + isThereSeriouslyAnotherOne(), +); +``` + +Prettier can be run [in your editor](https://prettier.io/docs/editors) on-save, in a [pre-commit hook](https://prettier.io/docs/precommit), or in [CI environments](https://prettier.io/docs/cli#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again! + +--- + +**[Documentation](https://prettier.io/docs/)** + +[Install](https://prettier.io/docs/install) · +[Options](https://prettier.io/docs/options) · +[CLI](https://prettier.io/docs/cli) · +[API](https://prettier.io/docs/api) + +**[Playground](https://prettier.io/playground/)** + +--- + +## Badge + +Show the world you're using _Prettier_ → [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) + +```md +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) +``` + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md). diff --git a/node_modules/prettier/THIRD-PARTY-NOTICES.md b/node_modules/prettier/THIRD-PARTY-NOTICES.md new file mode 100644 index 0000000..90b03ea --- /dev/null +++ b/node_modules/prettier/THIRD-PARTY-NOTICES.md @@ -0,0 +1,4416 @@ +# Licenses of bundled dependencies + +The published Prettier artifact additionally contains code with the following licenses: +MIT, ISC, BSD-3-Clause, BSD-2-Clause, and Apache-2.0. + +## @angular/compiler@v19.1.2 + +> Angular - the compiler library + +License: MIT +Repository: +Author: angular + +> The MIT License +> +> Copyright (c) 2010-2025 Google LLC. https://angular.dev/license +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## @babel/code-frame@v7.26.2 + +> Generate errors that contain a code frame that point to source locations. + +License: MIT +Homepage: +Repository: +Author: The Babel Team (https://babel.dev/team) + +> MIT License +> +> Copyright (c) 2014-present Sebastian McKenzie and other contributors +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## @babel/helper-validator-identifier@v7.25.9 + +> Validate identifier/keywords name + +License: MIT +Repository: +Author: The Babel Team (https://babel.dev/team) + +> MIT License +> +> Copyright (c) 2014-present Sebastian McKenzie and other contributors +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## @babel/parser@v7.26.9 + +> A JavaScript parser + +License: MIT +Homepage: +Repository: +Author: The Babel Team (https://babel.dev/team) + +> Copyright (C) 2012-2014 by various contributors (see AUTHORS) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## @glimmer/syntax@v0.94.7 + +License: MIT +Repository: + +> Copyright (c) 2015 Tilde, Inc. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +> of the Software, and to permit persons to whom the Software is furnished to do +> so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @glimmer/util@v0.94.6 + +> Common utilities used in Glimmer + +License: MIT +Repository: + +> Copyright (c) 2015 Tilde, Inc. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +> of the Software, and to permit persons to whom the Software is furnished to do +> so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @glimmer/wire-format@v0.94.6 + +License: MIT +Repository: + +> Copyright (c) 2015 Tilde, Inc. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +> of the Software, and to permit persons to whom the Software is furnished to do +> so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @handlebars/parser@v2.0.0 + +> The parser for the Handlebars language + +License: ISC +Homepage: +Repository: + +---------------------------------------- + +## @keyv/serialize@v1.0.2 + +> Serialization for Keyv + +License: MIT +Homepage: +Repository: +Author: Jared Wray (https://jaredwray.com) + +> MIT License +> +> Copyright (c) 2017-2021 Luke Childs +> Copyright (c) 2021-2022 Jared Wray +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @nodelib/fs.scandir@v2.1.5 + +> List files and directories inside the specified directory + +License: MIT + +> The MIT License (MIT) +> +> Copyright (c) Denis Malinochkin +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @nodelib/fs.stat@v2.0.5 + +> Get the status of a file with some features + +License: MIT + +> The MIT License (MIT) +> +> Copyright (c) Denis Malinochkin +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @nodelib/fs.walk@v1.2.8 + +> A library for efficiently walking a directory recursively + +License: MIT + +> The MIT License (MIT) +> +> Copyright (c) Denis Malinochkin +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @prettier/is-es5-identifier-name@v0.2.0 + +> Check if provided string is an `IdentifierName` as specified in ECMA262 edition 5.1 section 7.6. + +License: MIT +Author: fisker Cheung + +> MIT License +> +> Copyright (c) fisker Cheung (https://www.fiskercheung.com/) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @prettier/parse-srcset@v3.1.0 + +> A spec-conformant JavaScript parser for the HTML5 srcset attribute + +License: MIT +Homepage: +Author: Alex Bell + +> The MIT License (MIT) +> +> Copyright (c) 2014 Alex Bell +> Copyright (c) fisker Cheung +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @typescript-eslint/types@v8.24.1 + +> Types for the TypeScript-ESTree AST spec + +License: MIT +Homepage: +Repository: + +> MIT License +> +> Copyright (c) 2019 typescript-eslint and other contributors +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## @typescript-eslint/typescript-estree@v8.24.1 + +> A parser that converts TypeScript source code into an ESTree compatible form + +License: MIT +Homepage: +Repository: + +> MIT License +> +> Copyright (c) 2019 typescript-eslint and other contributors +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## acorn@v8.14.0 + +> ECMAScript parser + +License: MIT +Homepage: +Repository: + +> MIT License +> +> Copyright (C) 2012-2022 by various contributors (see AUTHORS) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## acorn-jsx@v5.3.2 + +> Modern, fast React.js JSX parser + +License: MIT +Homepage: +Repository: + +> Copyright (C) 2012-2017 by Ingvar Stepanyan +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## angular-estree-parser@v10.2.0 + +> A parser that converts Angular source code into an ESTree-compatible form + +License: MIT +Homepage: +Author: Ika (https://github.com/ikatyang) + +> MIT License +> +> Copyright (c) Ika (https://github.com/ikatyang) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## angular-html-parser@v8.0.1 + +> A HTML parser extracted from Angular with some modifications + +License: MIT +Homepage: +Author: Ika (https://github.com/ikatyang) + +> MIT License +> +> Copyright (c) Ika (https://github.com/ikatyang) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## ansi-regex@v6.1.0 + +> Regular expression for matching ANSI escape codes + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## bail@v1.0.5 + +> Throw a given error + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## braces@v3.0.3 + +> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) +Contributors: + - Brian Woodward (https://twitter.com/doowb) + - Elan Shanker (https://github.com/es128) + - Eugene Sharygin (https://github.com/eush77) + - hemanth.hm (http://h3manth.com) + - Jon Schlinkert (http://twitter.com/jonschlinkert) + +> The MIT License (MIT) +> +> Copyright (c) 2014-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## cacheable@v1.8.8 + +> High Performance Layer 1 / Layer 2 Caching with Keyv Storage + +License: MIT +Repository: +Author: Jared Wray + +> MIT License & © Jared Wray +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to +> deal in the Software without restriction, including without limitation the +> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +> sell copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +> DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## camelcase@v8.0.0 + +> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## ccount@v1.1.0 + +> Count characters + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## chalk@v5.4.1 + +> Terminal string styling done right + +License: MIT + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## character-entities@v1.2.4 + +> HTML character entity information + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## character-entities-legacy@v1.1.4 + +> HTML legacy character entity information + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## character-reference-invalid@v1.1.4 + +> HTML invalid numeric character reference information + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## ci-info@v4.1.0 + +> Get details about the current Continuous Integration environment + +License: MIT +Homepage: +Author: Thomas Watson Steen (https://twitter.com/wa7son) +Contributors: + - Sibiraj (https://github.com/sibiraj-s) + +> The MIT License (MIT) +> +> Copyright (c) 2016 Thomas Watson Steen +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## collapse-white-space@v1.0.6 + +> Replace multiple white-space characters with a single space + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## common-path-prefix@v3.0.0 + +> Computes the longest prefix string that is common to each path, excluding the base component + +License: ISC +Homepage: +Repository: +Author: Mark Wubben (https://novemberborn.net/) + +> ISC License (ISC) +> Copyright (c) 2016, Mark Wubben +> +> Permission to use, copy, modify, and/or distribute this software for any purpose +> with or without fee is hereby granted, provided that the above copyright notice +> and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +> OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +> TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +> THIS SOFTWARE. + +---------------------------------------- + +## dashify@v2.0.0 + +> Convert a camelcase or space-separated string to a dash-separated string. ~12 sloc, fast, supports diacritics. + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) +Contributors: + - Jeffrey Priebe (https://github.com/jeffreypriebe) + - Jon Schlinkert (http://twitter.com/jonschlinkert) + - Ondrej Brinkel (https://www.anzui.de) + +> The MIT License (MIT) +> +> Copyright (c) 2015-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## diff@v7.0.0 + +> A JavaScript text diff implementation. + +License: BSD-3-Clause +Repository: + +> BSD 3-Clause License +> +> Copyright (c) 2009-2015, Kevin Decker +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions are met: +> +> 1. Redistributions of source code must retain the above copyright notice, this +> list of conditions and the following disclaimer. +> +> 2. Redistributions in binary form must reproduce the above copyright notice, +> this list of conditions and the following disclaimer in the documentation +> and/or other materials provided with the distribution. +> +> 3. Neither the name of the copyright holder nor the names of its +> contributors may be used to endorse or promote products derived from +> this software without specific prior written permission. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +> FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +> DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +> OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------- + +## editorconfig@v0.15.3 + +> EditorConfig File Locator and Interpreter for Node.js + +License: MIT +Repository: +Author: EditorConfig Team +Contributors: + - Hong Xu (topbug.net) + - Jed Mao (https://github.com/jedmao/) + - Trey Hunner (http://treyhunner.com) + +> Copyright © 2012 EditorConfig Team +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the “Software”), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## emoji-regex@v10.4.0 + +> A regular expression to match all Emoji-only symbols as per the Unicode Standard. + +License: MIT +Homepage: +Repository: +Author: Mathias Bynens (https://mathiasbynens.be/) + +> Copyright Mathias Bynens +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## escape-string-regexp@v5.0.0 + +> Escape RegExp special characters + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## espree@v10.3.0 + +> An Esprima-compatible JavaScript parser built on Acorn + +License: BSD-2-Clause +Homepage: +Author: Nicholas C. Zakas + +> BSD 2-Clause License +> +> Copyright (c) Open JS Foundation +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions are met: +> +> 1. Redistributions of source code must retain the above copyright notice, this +> list of conditions and the following disclaimer. +> +> 2. Redistributions in binary form must reproduce the above copyright notice, +> this list of conditions and the following disclaimer in the documentation +> and/or other materials provided with the distribution. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +> FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +> DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +> OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------- + +## extend@v3.0.2 + +> Port of jQuery.extend for node.js and the browser + +License: MIT +Repository: +Author: Stefan Thomas (http://www.justmoon.net) +Contributors: + - Jordan Harband (https://github.com/ljharb) + +> The MIT License (MIT) +> +> Copyright (c) 2014 Stefan Thomas +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## fast-glob@v3.3.3 + +> It's a very fast and efficient glob library for Node.js + +License: MIT +Author: Denis Malinochkin (https://mrmlnc.com) + +> The MIT License (MIT) +> +> Copyright (c) Denis Malinochkin +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## fast-json-stable-stringify@v2.1.0 + +> deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify + +License: MIT +Homepage: +Repository: +Author: James Halliday (http://substack.net) + +> This software is released under the MIT license: +> +> Copyright (c) 2017 Evgeny Poberezkin +> Copyright (c) 2013 James Halliday +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## fastq@v1.18.0 + +> Fast, in memory work queue + +License: ISC +Homepage: +Repository: +Author: Matteo Collina + +> Copyright (c) 2015-2020, Matteo Collina +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## file-entry-cache@v10.0.6 + +> A lightweight cache for file metadata, ideal for processes that work on a specific set of files and only need to reprocess files that have changed since the last run + +License: MIT +Repository: +Author: Jared Wray + +> MIT License & © Jared Wray +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to +> deal in the Software without restriction, including without limitation the +> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +> sell copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +> DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## fill-range@v7.1.1 + +> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex` + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) +Contributors: + - Edo Rivai (edo.rivai.nl) + - Jon Schlinkert (http://twitter.com/jonschlinkert) + - Paul Miller (paulmillr.com) + - Rouven Weßling (www.rouvenwessling.de) + - null (https://github.com/wtgtybhertgeghgtwtg) + +> The MIT License (MIT) +> +> Copyright (c) 2014-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## find-cache-dir@v5.0.0 + +> Finds the common standard cache directory + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> Copyright (c) James Talmage (https://github.com/jamestalmage) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## find-up@v6.3.0 + +> Find a file or directory by walking up parent directories + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## flat-cache@v6.1.6 + +> A simple key/value storage using files to persist the data + +License: MIT +Repository: +Author: Jared Wray + +> MIT License & © Jared Wray +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to +> deal in the Software without restriction, including without limitation the +> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +> sell copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +> DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## flatted@v3.3.2 + +> A super light and fast circular JSON parser. + +License: ISC +Homepage: +Repository: +Author: Andrea Giammarchi + +> ISC License +> +> Copyright (c) 2018-2020, Andrea Giammarchi, @WebReflection +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +> AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +> OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +> PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## flatten@v1.0.3 + +> Flatten arbitrarily nested arrays into a non-nested list of non-array items. Maintained for legacy compatibility. + +License: MIT +Homepage: +Repository: +Author: Joshua Holbrook (http://jesusabdullah.net) +Contributors: + - M.K. (https://github.com/mk-pmb) + +> The MIT License (MIT) +> +> Copyright (c) 2016 Joshua Holbrook +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## flow-parser@v0.259.1 + +> JavaScript parser written in OCaml. Produces ESTree AST + +License: MIT +Homepage: +Repository: +Author: Flow Team + +---------------------------------------- + +## get-east-asian-width@v1.3.0 + +> Determine the East Asian Width of a Unicode character + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## get-stdin@v9.0.0 + +> Get stdin as a string or buffer + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## glob-parent@v5.1.2 + +> Extract the non-magic parent path from a glob string. + +License: ISC +Author: Gulp Team (https://gulpjs.com/) +Contributors: + - Elan Shanker (https://github.com/es128) + - Blaine Bublitz + +> The ISC License +> +> Copyright (c) 2015, 2019 Elan Shanker +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## graphql@v16.10.0 + +> A Query Language and Runtime which can target any service. + +License: MIT +Homepage: +Repository: + +> MIT License +> +> Copyright (c) GraphQL Contributors +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## hookified@v1.7.0 + +> Event and Middleware Hooks + +License: MIT +Homepage: +Repository: +Author: Jared Wray + +> MIT License & © Jared Wray +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## ignore@v7.0.3 + +> Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others. + +License: MIT +Repository: +Author: kael + +> Copyright (c) 2013 Kael Zhang , contributors +> http://kael.me/ +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## import-meta-resolve@v4.1.0 + +> Resolve things like Node.js — ponyfill for `import.meta.resolve` + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2021 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +> +> --- +> +> This is a derivative work based on: +> . +> Which is licensed: +> +> """ +> Copyright Node.js contributors. All rights reserved. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to +> deal in the Software without restriction, including without limitation the +> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +> sell copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +> IN THE SOFTWARE. +> """ +> +> This license applies to parts of Node.js originating from the +> https://github.com/joyent/node repository: +> +> """ +> Copyright Joyent, Inc. and other Node contributors. All rights reserved. +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to +> deal in the Software without restriction, including without limitation the +> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +> sell copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +> IN THE SOFTWARE. +> """ + +---------------------------------------- + +## index-to-position@v0.1.2 + +> Convert a string index to its line and column position + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## indexes-of@v1.0.1 + +> line String/Array#indexOf but return all the indexes in an array + +License: MIT +Homepage: +Repository: +Author: Dominic Tarr (dominictarr.com) + +> Copyright (c) 2013 Dominic Tarr +> +> Permission is hereby granted, free of charge, +> to any person obtaining a copy of this software and +> associated documentation files (the "Software"), to +> deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, +> merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom +> the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice +> shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +> ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## inherits@v2.0.4 + +> Browser-friendly inheritance fully compatible with standard node.js inherits() + +License: ISC + +> The ISC License +> +> Copyright (c) Isaac Z. Schlueter +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +> PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## is-alphabetical@v1.0.4 + +> Check if a character is alphabetical + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## is-alphanumerical@v1.0.4 + +> Check if a character is alphanumerical + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## is-buffer@v2.0.5 + +> Determine if an object is a Buffer + +License: MIT +Repository: +Author: Feross Aboukhadijeh (https://feross.org) + +> The MIT License (MIT) +> +> Copyright (c) Feross Aboukhadijeh +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## is-decimal@v1.0.4 + +> Check if a character is decimal + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## is-extglob@v2.1.1 + +> Returns true if a string has an extglob. + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) + +> The MIT License (MIT) +> +> Copyright (c) 2014-2016, Jon Schlinkert +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## is-glob@v4.0.3 + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) +Contributors: + - Brian Woodward (https://twitter.com/doowb) + - Daniel Perez (https://tuvistavie.com) + - Jon Schlinkert (http://twitter.com/jonschlinkert) + +> The MIT License (MIT) +> +> Copyright (c) 2014-2017, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## is-hexadecimal@v1.0.4 + +> Check if a character is hexadecimal + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## is-number@v7.0.0 + +> Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc. + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) +Contributors: + - Jon Schlinkert (http://twitter.com/jonschlinkert) + - Olsten Larck (https://i.am.charlike.online) + - Rouven Weßling (www.rouvenwessling.de) + +> The MIT License (MIT) +> +> Copyright (c) 2014-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## is-plain-obj@v2.1.0 + +> Check if a value is a plain object + +License: MIT +Author: Sindre Sorhus (sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## is-whitespace-character@v1.0.4 + +> Check if a character is a whitespace character + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## is-word-character@v1.0.4 + +> Check if a character is a word character + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## iterate-directory-up@v1.1.1 + +> Iterate directory up. + +License: MIT +Homepage: +Author: fisker Cheung (https://www.fiskercheung.com/) + +> MIT License +> +> Copyright (c) fisker Cheung (https://www.fiskercheung.com/) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## jest-docblock@v30.0.0-alpha.7 + +License: MIT +Repository: + +> MIT License +> +> Copyright (c) Meta Platforms, Inc. and affiliates. +> Copyright Contributors to the Jest project. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## js-tokens@v4.0.0 + +> A regex that tokenizes JavaScript. + +License: MIT +Author: Simon Lydell + +> The MIT License (MIT) +> +> Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## js-yaml@v4.1.0 + +> YAML 1.2 parser and serializer + +License: MIT +Author: Vladimir Zapparov +Contributors: + - Aleksey V Zapparov (http://www.ixti.net/) + - Vitaly Puzrin (https://github.com/puzrin) + - Martin Grenfell (http://got-ravings.blogspot.com) + +> (The MIT License) +> +> Copyright (C) 2011-2015 by Vitaly Puzrin +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## json5@v2.2.3 + +> JSON for Humans + +License: MIT +Homepage: +Repository: +Author: Aseem Kishore +Contributors: + - Max Nanasy + - Andrew Eisenberg + - Jordan Tucker + +> MIT License +> +> Copyright (c) 2012-2018 Aseem Kishore, and [others]. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. +> +> [others]: https://github.com/json5/json5/contributors + +---------------------------------------- + +## keyv@v5.2.3 + +> Simple key-value storage with support for multiple backends + +License: MIT +Homepage: +Repository: +Author: Jared Wray (http://jaredwray.com) + +> MIT License +> +> Copyright (c) 2017-2021 Luke Childs +> Copyright (c) 2021-2022 Jared Wray +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## leven@v4.0.0 + +> Measure the difference between two strings using the Levenshtein distance algorithm + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## lines-and-columns@v2.0.4 + +> Maps lines and columns to character offsets and back. + +License: MIT +Homepage: +Repository: +Author: Brian Donovan + +> The MIT License (MIT) +> +> Copyright (c) 2015 Brian Donovan +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## locate-path@v7.2.0 + +> Get the first path that exists on disk of multiple paths + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## lru-cache@v4.1.5 + +> A cache object that deletes the least-recently-used items. + +License: ISC +Author: Isaac Z. Schlueter + +> The ISC License +> +> Copyright (c) Isaac Z. Schlueter and Contributors +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## markdown-escapes@v1.0.4 + +> List of escapable characters in markdown + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## merge2@v1.4.1 + +> Merge multiple streams into one stream in sequence or parallel. + +License: MIT +Homepage: +Repository: + +> The MIT License (MIT) +> +> Copyright (c) 2014-2020 Teambition +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## meriyah@v6.0.5 + +> A 100% compliant, self-hosted javascript parser with high focus on both performance and stability + +License: ISC +Homepage: +Repository: +Author: Kenny F. (https://github.com/KFlash) +Contributors: + - Chunpeng Huo (https://github.com/3cp) + +> ISC License +> +> Copyright (c) 2019 and later, KFlash and others. +> +> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## micromatch@v4.0.8 + +> Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch. + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) +Contributors: + - null (https://github.com/DianeLooney) + - Amila Welihinda (amilajack.com) + - Bogdan Chadkin (https://github.com/TrySound) + - Brian Woodward (https://twitter.com/doowb) + - Devon Govett (http://badassjs.com) + - Elan Shanker (https://github.com/es128) + - Fabrício Matté (https://ultcombo.js.org) + - Jon Schlinkert (http://twitter.com/jonschlinkert) + - Martin Kolárik (https://kolarik.sk) + - Olsten Larck (https://i.am.charlike.online) + - Paul Miller (paulmillr.com) + - Tom Byrer (https://github.com/tomByrer) + - Tyler Akins (http://rumkin.com) + - Peter Bright (https://github.com/drpizza) + - Kuba Juszczyk (https://github.com/ku8ar) + +> The MIT License (MIT) +> +> Copyright (c) 2014-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## minimist@v1.2.8 + +> parse argument options + +License: MIT +Homepage: +Repository: +Author: James Halliday (http://substack.net) + +> This software is released under the MIT license: +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## n-readlines@v1.0.1 + +> Read file line by line without buffering the whole file in memory. + +License: MIT +Repository: +Author: Yoan Arnaudov + +> The MIT License (MIT) +> +> Copyright (c) 2013 Liucw +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## nanoid@v3.3.8 + +> A tiny (116 bytes), secure URL-friendly unique string ID generator + +License: MIT +Author: Andrey Sitnik + +> The MIT License (MIT) +> +> Copyright 2017 Andrey Sitnik +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## p-limit@v4.0.0 + +> Run multiple promise-returning & async functions with limited concurrency + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## p-locate@v6.0.0 + +> Get the first fulfilled promise that satisfies the provided testing function + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## parse-entities@v2.0.0 + +> Parse HTML character references: fast, spec-compliant, positional information + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## parse-json@v8.1.0 + +> Parse JSON with more helpful errors + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## path-exists@v5.0.0 + +> Check if a path exists + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## picocolors@v1.1.1 + +> The tiniest and the fastest library for terminal output formatting with ANSI colors + +License: ISC +Author: Alexey Raspopov + +> ISC License +> +> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## picomatch@v2.3.1 + +> Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) + +> The MIT License (MIT) +> +> Copyright (c) 2017-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## pkg-dir@v7.0.0 + +> Find the root directory of a Node.js project or npm package + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## please-upgrade-node@v3.2.0 + +> Displays a beginner-friendly message telling your user to upgrade their version of Node + +License: MIT +Homepage: +Repository: +Author: typicode + +> MIT License +> +> Copyright (c) 2017 +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## postcss@v8.5.3 + +> Tool for transforming styles with JS plugins + +License: MIT +Homepage: +Author: Andrey Sitnik + +> The MIT License (MIT) +> +> Copyright 2013 Andrey Sitnik +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## postcss-less@v6.0.0 + +> LESS parser for PostCSS + +License: MIT +Homepage: +Author: Denys Kniazevych + +> The MIT License (MIT) +> +> Copyright (c) 2013 Andrey Sitnik +> Copyright (c) 2016 Denys Kniazevych +> Copyright (c) 2016 Pat Sissons +> Copyright (c) 2017 Andrew Powell +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## postcss-media-query-parser@v0.2.3 + +> A tool for parsing media query lists. + +License: MIT +Homepage: +Repository: +Author: dryoma + +---------------------------------------- + +## postcss-scss@v4.0.9 + +> SCSS parser for PostCSS + +License: MIT +Author: Andrey Sitnik + +> The MIT License (MIT) +> +> Copyright 2013 Andrey Sitnik +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## postcss-selector-parser@v2.2.3 + +License: MIT +Homepage: +Author: Ben Briggs (http://beneb.info) + +> Copyright (c) Ben Briggs (http://beneb.info) +> +> Permission is hereby granted, free of charge, to any person +> obtaining a copy of this software and associated documentation +> files (the "Software"), to deal in the Software without +> restriction, including without limitation the rights to use, +> copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the +> Software is furnished to do so, subject to the following +> conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +> OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## postcss-values-parser@v2.0.1 + +> A CSS property value parser for use with PostCSS + +License: MIT +Author: Andrew Powell (shellscape) (http://shellscape.org) + +> Copyright (c) Andrew Powell +> +> Permission is hereby granted, free of charge, to any person +> obtaining a copy of this software and associated documentation +> files (the "Software"), to deal in the Software without +> restriction, including without limitation the rights to use, +> copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the +> Software is furnished to do so, subject to the following +> conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +> OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## pseudomap@v1.0.2 + +> A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available. + +License: ISC +Homepage: +Repository: +Author: Isaac Z. Schlueter (http://blog.izs.me/) + +> The ISC License +> +> Copyright (c) Isaac Z. Schlueter and Contributors +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## queue-microtask@v1.2.3 + +> fast, tiny `queueMicrotask` shim for modern engines + +License: MIT +Homepage: +Repository: +Author: Feross Aboukhadijeh (https://feross.org) + +> The MIT License (MIT) +> +> Copyright (c) Feross Aboukhadijeh +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## remark-footnotes@v2.0.0 + +> remark plugin to add support for pandoc footnotes + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2020 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## remark-math@v3.0.1 + +> remark plugin to parse and stringify math + +License: MIT +Author: Junyoung Choi (https://rokt33r.github.io) +Contributors: + - Junyoung Choi (https://rokt33r.github.io) + - Titus Wormer (https://wooorm.com) + +---------------------------------------- + +## remark-parse@v8.0.3 + +> remark plugin to parse Markdown + +License: MIT +Homepage: +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + - Eugene Sharygin + - Junyoung Choi + - Elijah Hamovitz + - Ika + +---------------------------------------- + +## repeat-string@v1.6.1 + +> Repeat the given string n times. Fastest implementation for repeating a string. + +License: MIT +Homepage: +Author: Jon Schlinkert (http://github.com/jonschlinkert) +Contributors: + - Brian Woodward (https://github.com/doowb) + - Jon Schlinkert (http://twitter.com/jonschlinkert) + - Linus Unnebäck (http://linus.unnebäck.se) + - Thijs Busser (http://tbusser.net) + - Titus (wooorm.com) + +> The MIT License (MIT) +> +> Copyright (c) 2014-2016, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## reusify@v1.0.4 + +> Reuse objects and functions with style + +License: MIT +Homepage: +Repository: +Author: Matteo Collina + +> The MIT License (MIT) +> +> Copyright (c) 2015 Matteo Collina +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## run-parallel@v1.2.0 + +> Run an array of functions in parallel + +License: MIT +Homepage: +Repository: +Author: Feross Aboukhadijeh (https://feross.org) + +> The MIT License (MIT) +> +> Copyright (c) Feross Aboukhadijeh +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## sdbm@v2.0.0 + +> SDBM non-cryptographic hash function + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## semver@v7.7.1 + +> The semantic version parser used by npm. + +License: ISC +Repository: +Author: GitHub Inc. + +> The ISC License +> +> Copyright (c) Isaac Z. Schlueter and Contributors +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## semver-compare@v1.0.0 + +> compare two semver version strings, returning -1, 0, or 1 + +License: MIT +Homepage: +Repository: +Author: James Halliday (http://substack.net) + +> This software is released under the MIT license: +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## sigmund@v1.0.1 + +> Quick and dirty signatures for Objects. + +License: ISC +Repository: +Author: Isaac Z. Schlueter (http://blog.izs.me/) + +> The ISC License +> +> Copyright (c) Isaac Z. Schlueter and Contributors +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## simple-html-tokenizer@v0.5.11 + +> Simple HTML Tokenizer is a lightweight JavaScript library that can be used to tokenize the kind of HTML normally found in templates. + +License: MIT +Repository: + +> Copyright (c) 2014 Yehuda Katz and contributors +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +> of the Software, and to permit persons to whom the Software is furnished to do +> so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## smol-toml@v1.3.1 + +> A small, fast, and correct TOML parser/serializer + +License: BSD-3-Clause +Author: Cynthia + +> Copyright (c) Squirrel Chat et al., All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions are met: +> +> 1. Redistributions of source code must retain the above copyright notice, this +> list of conditions and the following disclaimer. +> 2. Redistributions in binary form must reproduce the above copyright notice, +> this list of conditions and the following disclaimer in the +> documentation and/or other materials provided with the distribution. +> 3. Neither the name of the copyright holder nor the names of its contributors +> may be used to endorse or promote products derived from this software without +> specific prior written permission. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +> ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +> WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +> FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +> DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +> OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------- + +## state-toggle@v1.0.3 + +> Enter/exit a state + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## strip-ansi@v7.1.0 + +> Strip ANSI escape codes from a string + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## to-fast-properties@v4.0.0 + +> Force V8 to use fast properties for an object + +License: MIT +Author: Sindre Sorhus (https:/sindresorhus.com) + +> MIT License +> +> Copyright (c) Petka Antonov +> Benjamin Gruenbaum +> John-David Dalton +> Sindre Sorhus +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## to-regex-range@v5.0.1 + +> Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions. + +License: MIT +Homepage: +Author: Jon Schlinkert (https://github.com/jonschlinkert) +Contributors: + - Jon Schlinkert (http://twitter.com/jonschlinkert) + - Rouven Weßling (www.rouvenwessling.de) + +> The MIT License (MIT) +> +> Copyright (c) 2015-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## trim@v1.0.1 + +> Trim string whitespace + +License: MIT +Repository: +Author: TJ Holowaychuk + +---------------------------------------- + +## trim-trailing-lines@v1.1.4 + +> Remove final line feeds from a string + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## trough@v1.0.5 + +> Middleware: a channel used to convey a liquid + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## ts-api-utils@v2.0.1 + +> Utility functions for working with TypeScript's API. Successor to the wonderful tsutils. 🛠️️ + +License: MIT +Repository: +Author: JoshuaKGoldberg + +> # MIT License +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## typescript@v5.7.3 + +> TypeScript is a language for application scale JavaScript development + +License: Apache-2.0 +Homepage: +Repository: +Author: Microsoft Corp. + +> Apache License +> +> Version 2.0, January 2004 +> +> http://www.apache.org/licenses/ +> +> TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +> +> 1. Definitions. +> +> "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +> +> "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +> +> "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +> +> "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +> +> "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +> +> "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +> +> "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +> +> "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +> +> "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +> +> "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +> +> 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +> +> 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +> +> 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +> +> You must give any other recipients of the Work or Derivative Works a copy of this License; and +> +> You must cause any modified files to carry prominent notices stating that You changed the files; and +> +> You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +> +> If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +> +> 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +> +> 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +> +> 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +> +> 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +> +> 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +> +> END OF TERMS AND CONDITIONS + +---------------------------------------- + +## unherit@v1.1.3 + +> Clone a constructor without affecting the super-class + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## unified@v9.2.2 + +> Interface for parsing, inspecting, transforming, and serializing content through syntax trees + +License: MIT +Homepage: +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + - Junyoung Choi + - Hernan Rajchert + - Christian Murphy + - Vse Mozhet Byt + - Richard Littauer + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## uniq@v1.0.1 + +> Removes duplicates from a sorted array in place + +License: MIT +Repository: +Author: Mikola Lysenko + +> The MIT License (MIT) +> +> Copyright (c) 2013 Mikola Lysenko +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## unist-util-is@v4.1.0 + +> unist utility to check if a node passes a test + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + - Christian Murphy + - Lucas Brandstaetter (https://github.com/Roang-zero1) + +> (The MIT license) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## unist-util-remove-position@v2.0.1 + +> unist utility to remove positions from a tree + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## unist-util-stringify-position@v2.0.3 + +> unist utility to serialize a node, position, or point as a human readable location + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## unist-util-visit@v2.0.3 + +> unist utility to visit nodes + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + - Eugene Sharygin + - Richard Gibson + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## unist-util-visit-parents@v3.1.1 + +> unist utility to recursively walk over nodes, with ancestral information + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## url-or-path@v2.3.2 + +> Convert between file URL and path. + +License: MIT +Homepage: +Author: fisker Cheung (https://www.fiskercheung.com/) + +> MIT License +> +> Copyright (c) fisker Cheung (https://www.fiskercheung.com/) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## vfile@v4.2.1 + +> Virtual file format for text processing + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + - Brendan Abbott + - Denys Dovhan + - Kyle Mathews + - Shinnosuke Watanabe + - Sindre Sorhus + +> (The MIT License) +> +> Copyright (c) 2015 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## vfile-location@v3.2.0 + +> vfile utility to convert between positional (line and column-based) and offset (range-based) locations + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + - Christian Murphy + +> (The MIT License) +> +> Copyright (c) 2016 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## vfile-message@v2.0.4 + +> vfile utility to create a virtual message + +License: MIT +Author: Titus Wormer (https://wooorm.com) +Contributors: + - Titus Wormer (https://wooorm.com) + +> (The MIT License) +> +> Copyright (c) 2017 Titus Wormer +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------------------------------- + +## vnopts@v2.0.0 + +> validate and normalize options + +License: MIT +Homepage: +Author: Ika (https://github.com/ikatyang) + +> MIT License +> +> Copyright (c) Ika (https://github.com/ikatyang) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## wcwidth.js@v2.0.0 + +> a javascript porting of C's wcwidth() + +License: MIT +Homepage: +Repository: +Author: Woong Jun (http://code.woong.org/) +Contributors: + - Tim Oxley (http://campjs.com/) + +> wcwidth.js: a javascript portng of C's wcwidth() +> ================================================ +> +> Copyright (C) 2012-2014 by Woong Jun and Tim Oxley. +> +> This package is a javascript porting of `wcwidth()` implementation +> [by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c). +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +> of the Software, and to permit persons to whom the Software is furnished to do +> so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> +> THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +> INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR +> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +> EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +> OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +> IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +> OF SUCH DAMAGE. + +---------------------------------------- + +## xtend@v4.0.2 + +> extend like a boss + +License: MIT +Homepage: +Author: Raynos +Contributors: + - Jake Verbaten + - Matt Esch + +> The MIT License (MIT) +> Copyright (c) 2012-2014 Raynos. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +---------------------------------------- + +## yallist@v2.1.2 + +> Yet Another Linked List + +License: ISC +Repository: +Author: Isaac Z. Schlueter (http://blog.izs.me/) + +> The ISC License +> +> Copyright (c) Isaac Z. Schlueter and Contributors +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------------------------------------- + +## yaml@v1.10.2 + +> JavaScript parser and stringifier for YAML + +License: ISC +Homepage: +Author: Eemeli Aro + +> Copyright 2018 Eemeli Aro +> +> Permission to use, copy, modify, and/or distribute this software for any purpose +> with or without fee is hereby granted, provided that the above copyright notice +> and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +> OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +> TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +> THIS SOFTWARE. + +---------------------------------------- + +## yaml-unist-parser@v2.0.1 + +> A YAML parser that produces output compatible with unist + +License: MIT +Homepage: +Author: Ika (https://github.com/ikatyang) + +> MIT License +> +> Copyright (c) Ika (https://github.com/ikatyang) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +---------------------------------------- + +## yocto-queue@v1.1.1 + +> Tiny queue data structure + +License: MIT +Author: Sindre Sorhus (https://sindresorhus.com) + +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/prettier/doc.js b/node_modules/prettier/doc.js new file mode 100644 index 0000000..2923c46 --- /dev/null +++ b/node_modules/prettier/doc.js @@ -0,0 +1,1261 @@ +(function (factory) { + function interopModuleDefault() { + var module = factory(); + return module.default || module; + } + + if (typeof exports === "object" && typeof module === "object") { + module.exports = interopModuleDefault(); + } else if (typeof define === "function" && define.amd) { + define(interopModuleDefault); + } else { + var root = + typeof globalThis !== "undefined" + ? globalThis + : typeof global !== "undefined" + ? global + : typeof self !== "undefined" + ? self + : this || {}; + root.doc = interopModuleDefault(); + } +})(function () { + "use strict"; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + + // src/document/public.js + var public_exports = {}; + __export(public_exports, { + builders: () => builders, + printer: () => printer, + utils: () => utils + }); + + // src/document/constants.js + var DOC_TYPE_STRING = "string"; + var DOC_TYPE_ARRAY = "array"; + var DOC_TYPE_CURSOR = "cursor"; + var DOC_TYPE_INDENT = "indent"; + var DOC_TYPE_ALIGN = "align"; + var DOC_TYPE_TRIM = "trim"; + var DOC_TYPE_GROUP = "group"; + var DOC_TYPE_FILL = "fill"; + var DOC_TYPE_IF_BREAK = "if-break"; + var DOC_TYPE_INDENT_IF_BREAK = "indent-if-break"; + var DOC_TYPE_LINE_SUFFIX = "line-suffix"; + var DOC_TYPE_LINE_SUFFIX_BOUNDARY = "line-suffix-boundary"; + var DOC_TYPE_LINE = "line"; + var DOC_TYPE_LABEL = "label"; + var DOC_TYPE_BREAK_PARENT = "break-parent"; + var VALID_OBJECT_DOC_TYPES = /* @__PURE__ */ new Set([ + DOC_TYPE_CURSOR, + DOC_TYPE_INDENT, + DOC_TYPE_ALIGN, + DOC_TYPE_TRIM, + DOC_TYPE_GROUP, + DOC_TYPE_FILL, + DOC_TYPE_IF_BREAK, + DOC_TYPE_INDENT_IF_BREAK, + DOC_TYPE_LINE_SUFFIX, + DOC_TYPE_LINE_SUFFIX_BOUNDARY, + DOC_TYPE_LINE, + DOC_TYPE_LABEL, + DOC_TYPE_BREAK_PARENT + ]); + + // scripts/build/shims/at.js + var at = (isOptionalObject, object, index) => { + if (isOptionalObject && (object === void 0 || object === null)) { + return; + } + if (Array.isArray(object) || typeof object === "string") { + return object[index < 0 ? object.length + index : index]; + } + return object.at(index); + }; + var at_default = at; + + // src/document/utils/get-doc-type.js + function getDocType(doc) { + if (typeof doc === "string") { + return DOC_TYPE_STRING; + } + if (Array.isArray(doc)) { + return DOC_TYPE_ARRAY; + } + if (!doc) { + return; + } + const { type } = doc; + if (VALID_OBJECT_DOC_TYPES.has(type)) { + return type; + } + } + var get_doc_type_default = getDocType; + + // src/document/invalid-doc-error.js + var disjunctionListFormat = (list) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(list); + function getDocErrorMessage(doc) { + const type = doc === null ? "null" : typeof doc; + if (type !== "string" && type !== "object") { + return `Unexpected doc '${type}', +Expected it to be 'string' or 'object'.`; + } + if (get_doc_type_default(doc)) { + throw new Error("doc is valid."); + } + const objectType = Object.prototype.toString.call(doc); + if (objectType !== "[object Object]") { + return `Unexpected doc '${objectType}'.`; + } + const EXPECTED_TYPE_VALUES = disjunctionListFormat( + [...VALID_OBJECT_DOC_TYPES].map((type2) => `'${type2}'`) + ); + return `Unexpected doc.type '${doc.type}'. +Expected it to be ${EXPECTED_TYPE_VALUES}.`; + } + var InvalidDocError = class extends Error { + name = "InvalidDocError"; + constructor(doc) { + super(getDocErrorMessage(doc)); + this.doc = doc; + } + }; + var invalid_doc_error_default = InvalidDocError; + + // src/document/utils/traverse-doc.js + var traverseDocOnExitStackMarker = {}; + function traverseDoc(doc, onEnter, onExit, shouldTraverseConditionalGroups) { + const docsStack = [doc]; + while (docsStack.length > 0) { + const doc2 = docsStack.pop(); + if (doc2 === traverseDocOnExitStackMarker) { + onExit(docsStack.pop()); + continue; + } + if (onExit) { + docsStack.push(doc2, traverseDocOnExitStackMarker); + } + const docType = get_doc_type_default(doc2); + if (!docType) { + throw new invalid_doc_error_default(doc2); + } + if ((onEnter == null ? void 0 : onEnter(doc2)) === false) { + continue; + } + switch (docType) { + case DOC_TYPE_ARRAY: + case DOC_TYPE_FILL: { + const parts = docType === DOC_TYPE_ARRAY ? doc2 : doc2.parts; + for (let ic = parts.length, i = ic - 1; i >= 0; --i) { + docsStack.push(parts[i]); + } + break; + } + case DOC_TYPE_IF_BREAK: + docsStack.push(doc2.flatContents, doc2.breakContents); + break; + case DOC_TYPE_GROUP: + if (shouldTraverseConditionalGroups && doc2.expandedStates) { + for (let ic = doc2.expandedStates.length, i = ic - 1; i >= 0; --i) { + docsStack.push(doc2.expandedStates[i]); + } + } else { + docsStack.push(doc2.contents); + } + break; + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + case DOC_TYPE_LINE_SUFFIX: + docsStack.push(doc2.contents); + break; + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc2); + } + } + } + var traverse_doc_default = traverseDoc; + + // src/document/utils.js + function mapDoc(doc, cb) { + if (typeof doc === "string") { + return cb(doc); + } + const mapped = /* @__PURE__ */ new Map(); + return rec(doc); + function rec(doc2) { + if (mapped.has(doc2)) { + return mapped.get(doc2); + } + const result = process2(doc2); + mapped.set(doc2, result); + return result; + } + function process2(doc2) { + switch (get_doc_type_default(doc2)) { + case DOC_TYPE_ARRAY: + return cb(doc2.map(rec)); + case DOC_TYPE_FILL: + return cb({ ...doc2, parts: doc2.parts.map(rec) }); + case DOC_TYPE_IF_BREAK: + return cb({ + ...doc2, + breakContents: rec(doc2.breakContents), + flatContents: rec(doc2.flatContents) + }); + case DOC_TYPE_GROUP: { + let { expandedStates, contents } = doc2; + if (expandedStates) { + expandedStates = expandedStates.map(rec); + contents = expandedStates[0]; + } else { + contents = rec(contents); + } + return cb({ ...doc2, contents, expandedStates }); + } + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + case DOC_TYPE_LINE_SUFFIX: + return cb({ ...doc2, contents: rec(doc2.contents) }); + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + return cb(doc2); + default: + throw new invalid_doc_error_default(doc2); + } + } + } + function findInDoc(doc, fn, defaultValue) { + let result = defaultValue; + let shouldSkipFurtherProcessing = false; + function findInDocOnEnterFn(doc2) { + if (shouldSkipFurtherProcessing) { + return false; + } + const maybeResult = fn(doc2); + if (maybeResult !== void 0) { + shouldSkipFurtherProcessing = true; + result = maybeResult; + } + } + traverse_doc_default(doc, findInDocOnEnterFn); + return result; + } + function willBreakFn(doc) { + if (doc.type === DOC_TYPE_GROUP && doc.break) { + return true; + } + if (doc.type === DOC_TYPE_LINE && doc.hard) { + return true; + } + if (doc.type === DOC_TYPE_BREAK_PARENT) { + return true; + } + } + function willBreak(doc) { + return findInDoc(doc, willBreakFn, false); + } + function breakParentGroup(groupStack) { + if (groupStack.length > 0) { + const parentGroup = at_default( + /* isOptionalObject */ + false, + groupStack, + -1 + ); + if (!parentGroup.expandedStates && !parentGroup.break) { + parentGroup.break = "propagated"; + } + } + return null; + } + function propagateBreaks(doc) { + const alreadyVisitedSet = /* @__PURE__ */ new Set(); + const groupStack = []; + function propagateBreaksOnEnterFn(doc2) { + if (doc2.type === DOC_TYPE_BREAK_PARENT) { + breakParentGroup(groupStack); + } + if (doc2.type === DOC_TYPE_GROUP) { + groupStack.push(doc2); + if (alreadyVisitedSet.has(doc2)) { + return false; + } + alreadyVisitedSet.add(doc2); + } + } + function propagateBreaksOnExitFn(doc2) { + if (doc2.type === DOC_TYPE_GROUP) { + const group2 = groupStack.pop(); + if (group2.break) { + breakParentGroup(groupStack); + } + } + } + traverse_doc_default( + doc, + propagateBreaksOnEnterFn, + propagateBreaksOnExitFn, + /* shouldTraverseConditionalGroups */ + true + ); + } + function removeLinesFn(doc) { + if (doc.type === DOC_TYPE_LINE && !doc.hard) { + return doc.soft ? "" : " "; + } + if (doc.type === DOC_TYPE_IF_BREAK) { + return doc.flatContents; + } + return doc; + } + function removeLines(doc) { + return mapDoc(doc, removeLinesFn); + } + function stripTrailingHardlineFromParts(parts) { + parts = [...parts]; + while (parts.length >= 2 && at_default( + /* isOptionalObject */ + false, + parts, + -2 + ).type === DOC_TYPE_LINE && at_default( + /* isOptionalObject */ + false, + parts, + -1 + ).type === DOC_TYPE_BREAK_PARENT) { + parts.length -= 2; + } + if (parts.length > 0) { + const lastPart = stripTrailingHardlineFromDoc(at_default( + /* isOptionalObject */ + false, + parts, + -1 + )); + parts[parts.length - 1] = lastPart; + } + return parts; + } + function stripTrailingHardlineFromDoc(doc) { + switch (get_doc_type_default(doc)) { + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_GROUP: + case DOC_TYPE_LINE_SUFFIX: + case DOC_TYPE_LABEL: { + const contents = stripTrailingHardlineFromDoc(doc.contents); + return { ...doc, contents }; + } + case DOC_TYPE_IF_BREAK: + return { + ...doc, + breakContents: stripTrailingHardlineFromDoc(doc.breakContents), + flatContents: stripTrailingHardlineFromDoc(doc.flatContents) + }; + case DOC_TYPE_FILL: + return { ...doc, parts: stripTrailingHardlineFromParts(doc.parts) }; + case DOC_TYPE_ARRAY: + return stripTrailingHardlineFromParts(doc); + case DOC_TYPE_STRING: + return doc.replace(/[\n\r]*$/u, ""); + case DOC_TYPE_ALIGN: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc); + } + return doc; + } + function stripTrailingHardline(doc) { + return stripTrailingHardlineFromDoc(cleanDoc(doc)); + } + function cleanDocFn(doc) { + switch (get_doc_type_default(doc)) { + case DOC_TYPE_FILL: + if (doc.parts.every((part) => part === "")) { + return ""; + } + break; + case DOC_TYPE_GROUP: + if (!doc.contents && !doc.id && !doc.break && !doc.expandedStates) { + return ""; + } + if (doc.contents.type === DOC_TYPE_GROUP && doc.contents.id === doc.id && doc.contents.break === doc.break && doc.contents.expandedStates === doc.expandedStates) { + return doc.contents; + } + break; + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LINE_SUFFIX: + if (!doc.contents) { + return ""; + } + break; + case DOC_TYPE_IF_BREAK: + if (!doc.flatContents && !doc.breakContents) { + return ""; + } + break; + case DOC_TYPE_ARRAY: { + const parts = []; + for (const part of doc) { + if (!part) { + continue; + } + const [currentPart, ...restParts] = Array.isArray(part) ? part : [part]; + if (typeof currentPart === "string" && typeof at_default( + /* isOptionalObject */ + false, + parts, + -1 + ) === "string") { + parts[parts.length - 1] += currentPart; + } else { + parts.push(currentPart); + } + parts.push(...restParts); + } + if (parts.length === 0) { + return ""; + } + if (parts.length === 1) { + return parts[0]; + } + return parts; + } + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_LABEL: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc); + } + return doc; + } + function cleanDoc(doc) { + return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc)); + } + function replaceEndOfLine(doc, replacement = literalline) { + return mapDoc( + doc, + (currentDoc) => typeof currentDoc === "string" ? join(replacement, currentDoc.split("\n")) : currentDoc + ); + } + function canBreakFn(doc) { + if (doc.type === DOC_TYPE_LINE) { + return true; + } + } + function canBreak(doc) { + return findInDoc(doc, canBreakFn, false); + } + + // src/document/utils/assert-doc.js + var noop = () => { + }; + var assertDoc = true ? noop : function(doc) { + traverse_doc_default(doc, (doc2) => { + if (checked.has(doc2)) { + return false; + } + if (typeof doc2 !== "string") { + checked.add(doc2); + } + }); + }; + var assertDocArray = true ? noop : function(docs, optional = false) { + if (optional && !docs) { + return; + } + if (!Array.isArray(docs)) { + throw new TypeError("Unexpected doc array."); + } + for (const doc of docs) { + assertDoc(doc); + } + }; + var assertDocFillParts = true ? noop : ( + /** + * @param {Doc[]} parts + */ + function(parts) { + assertDocArray(parts); + if (parts.length > 1 && isEmptyDoc(at_default( + /* isOptionalObject */ + false, + parts, + -1 + ))) { + parts = parts.slice(0, -1); + } + for (const [i, doc] of parts.entries()) { + if (i % 2 === 1 && !isValidSeparator(doc)) { + const type = get_doc_type_default(doc); + throw new Error( + `Unexpected non-line-break doc at ${i}. Doc type is ${type}.` + ); + } + } + } + ); + + // src/document/builders.js + function indent(contents) { + assertDoc(contents); + return { type: DOC_TYPE_INDENT, contents }; + } + function align(widthOrString, contents) { + assertDoc(contents); + return { type: DOC_TYPE_ALIGN, contents, n: widthOrString }; + } + function group(contents, opts = {}) { + assertDoc(contents); + assertDocArray( + opts.expandedStates, + /* optional */ + true + ); + return { + type: DOC_TYPE_GROUP, + id: opts.id, + contents, + break: Boolean(opts.shouldBreak), + expandedStates: opts.expandedStates + }; + } + function dedentToRoot(contents) { + return align(Number.NEGATIVE_INFINITY, contents); + } + function markAsRoot(contents) { + return align({ type: "root" }, contents); + } + function dedent(contents) { + return align(-1, contents); + } + function conditionalGroup(states, opts) { + return group(states[0], { ...opts, expandedStates: states }); + } + function fill(parts) { + assertDocFillParts(parts); + return { type: DOC_TYPE_FILL, parts }; + } + function ifBreak(breakContents, flatContents = "", opts = {}) { + assertDoc(breakContents); + if (flatContents !== "") { + assertDoc(flatContents); + } + return { + type: DOC_TYPE_IF_BREAK, + breakContents, + flatContents, + groupId: opts.groupId + }; + } + function indentIfBreak(contents, opts) { + assertDoc(contents); + return { + type: DOC_TYPE_INDENT_IF_BREAK, + contents, + groupId: opts.groupId, + negate: opts.negate + }; + } + function lineSuffix(contents) { + assertDoc(contents); + return { type: DOC_TYPE_LINE_SUFFIX, contents }; + } + var lineSuffixBoundary = { type: DOC_TYPE_LINE_SUFFIX_BOUNDARY }; + var breakParent = { type: DOC_TYPE_BREAK_PARENT }; + var trim = { type: DOC_TYPE_TRIM }; + var hardlineWithoutBreakParent = { type: DOC_TYPE_LINE, hard: true }; + var literallineWithoutBreakParent = { + type: DOC_TYPE_LINE, + hard: true, + literal: true + }; + var line = { type: DOC_TYPE_LINE }; + var softline = { type: DOC_TYPE_LINE, soft: true }; + var hardline = [hardlineWithoutBreakParent, breakParent]; + var literalline = [literallineWithoutBreakParent, breakParent]; + var cursor = { type: DOC_TYPE_CURSOR }; + function join(separator, docs) { + assertDoc(separator); + assertDocArray(docs); + const parts = []; + for (let i = 0; i < docs.length; i++) { + if (i !== 0) { + parts.push(separator); + } + parts.push(docs[i]); + } + return parts; + } + function addAlignmentToDoc(doc, size, tabWidth) { + assertDoc(doc); + let aligned = doc; + if (size > 0) { + for (let i = 0; i < Math.floor(size / tabWidth); ++i) { + aligned = indent(aligned); + } + aligned = align(size % tabWidth, aligned); + aligned = align(Number.NEGATIVE_INFINITY, aligned); + } + return aligned; + } + function label(label2, contents) { + assertDoc(contents); + return label2 ? { type: DOC_TYPE_LABEL, label: label2, contents } : contents; + } + + // scripts/build/shims/string-replace-all.js + var stringReplaceAll = (isOptionalObject, original, pattern, replacement) => { + if (isOptionalObject && (original === void 0 || original === null)) { + return; + } + if (original.replaceAll) { + return original.replaceAll(pattern, replacement); + } + if (pattern.global) { + return original.replace(pattern, replacement); + } + return original.split(pattern).join(replacement); + }; + var string_replace_all_default = stringReplaceAll; + + // src/common/end-of-line.js + function convertEndOfLineToChars(value) { + switch (value) { + case "cr": + return "\r"; + case "crlf": + return "\r\n"; + default: + return "\n"; + } + } + + // node_modules/emoji-regex/index.mjs + var emoji_regex_default = () => { + return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; + }; + + // node_modules/get-east-asian-width/lookup.js + function isFullWidth(x) { + return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510; + } + function isWide(x) { + return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141; + } + + // node_modules/get-east-asian-width/index.js + var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint)); + + // src/utils/get-string-width.js + var notAsciiRegex = /[^\x20-\x7F]/u; + function getStringWidth(text) { + if (!text) { + return 0; + } + if (!notAsciiRegex.test(text)) { + return text.length; + } + text = text.replace(emoji_regex_default(), " "); + let width = 0; + for (const character of text) { + const codePoint = character.codePointAt(0); + if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { + continue; + } + if (codePoint >= 768 && codePoint <= 879) { + continue; + } + width += _isNarrowWidth(codePoint) ? 1 : 2; + } + return width; + } + var get_string_width_default = getStringWidth; + + // src/document/printer.js + var MODE_BREAK = Symbol("MODE_BREAK"); + var MODE_FLAT = Symbol("MODE_FLAT"); + var CURSOR_PLACEHOLDER = Symbol("cursor"); + var DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH"); + function rootIndent() { + return { value: "", length: 0, queue: [] }; + } + function makeIndent(ind, options) { + return generateInd(ind, { type: "indent" }, options); + } + function makeAlign(indent2, widthOrDoc, options) { + if (widthOrDoc === Number.NEGATIVE_INFINITY) { + return indent2.root || rootIndent(); + } + if (widthOrDoc < 0) { + return generateInd(indent2, { type: "dedent" }, options); + } + if (!widthOrDoc) { + return indent2; + } + if (widthOrDoc.type === "root") { + return { ...indent2, root: indent2 }; + } + const alignType = typeof widthOrDoc === "string" ? "stringAlign" : "numberAlign"; + return generateInd(indent2, { type: alignType, n: widthOrDoc }, options); + } + function generateInd(ind, newPart, options) { + const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) : [...ind.queue, newPart]; + let value = ""; + let length = 0; + let lastTabs = 0; + let lastSpaces = 0; + for (const part of queue) { + switch (part.type) { + case "indent": + flush(); + if (options.useTabs) { + addTabs(1); + } else { + addSpaces(options.tabWidth); + } + break; + case "stringAlign": + flush(); + value += part.n; + length += part.n.length; + break; + case "numberAlign": + lastTabs += 1; + lastSpaces += part.n; + break; + default: + throw new Error(`Unexpected type '${part.type}'`); + } + } + flushSpaces(); + return { ...ind, value, length, queue }; + function addTabs(count) { + value += " ".repeat(count); + length += options.tabWidth * count; + } + function addSpaces(count) { + value += " ".repeat(count); + length += count; + } + function flush() { + if (options.useTabs) { + flushTabs(); + } else { + flushSpaces(); + } + } + function flushTabs() { + if (lastTabs > 0) { + addTabs(lastTabs); + } + resetLast(); + } + function flushSpaces() { + if (lastSpaces > 0) { + addSpaces(lastSpaces); + } + resetLast(); + } + function resetLast() { + lastTabs = 0; + lastSpaces = 0; + } + } + function trim2(out) { + let trimCount = 0; + let cursorCount = 0; + let outIndex = out.length; + outer: while (outIndex--) { + const last = out[outIndex]; + if (last === CURSOR_PLACEHOLDER) { + cursorCount++; + continue; + } + if (false) { + throw new Error(`Unexpected value in trim: '${typeof last}'`); + } + for (let charIndex = last.length - 1; charIndex >= 0; charIndex--) { + const char = last[charIndex]; + if (char === " " || char === " ") { + trimCount++; + } else { + out[outIndex] = last.slice(0, charIndex + 1); + break outer; + } + } + } + if (trimCount > 0 || cursorCount > 0) { + out.length = outIndex + 1; + while (cursorCount-- > 0) { + out.push(CURSOR_PLACEHOLDER); + } + } + return trimCount; + } + function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat) { + if (width === Number.POSITIVE_INFINITY) { + return true; + } + let restIdx = restCommands.length; + const cmds = [next]; + const out = []; + while (width >= 0) { + if (cmds.length === 0) { + if (restIdx === 0) { + return true; + } + cmds.push(restCommands[--restIdx]); + continue; + } + const { mode, doc } = cmds.pop(); + const docType = get_doc_type_default(doc); + switch (docType) { + case DOC_TYPE_STRING: + out.push(doc); + width -= get_string_width_default(doc); + break; + case DOC_TYPE_ARRAY: + case DOC_TYPE_FILL: { + const parts = docType === DOC_TYPE_ARRAY ? doc : doc.parts; + const end = doc[DOC_FILL_PRINTED_LENGTH] ?? 0; + for (let i = parts.length - 1; i >= end; i--) { + cmds.push({ mode, doc: parts[i] }); + } + break; + } + case DOC_TYPE_INDENT: + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + cmds.push({ mode, doc: doc.contents }); + break; + case DOC_TYPE_TRIM: + width += trim2(out); + break; + case DOC_TYPE_GROUP: { + if (mustBeFlat && doc.break) { + return false; + } + const groupMode = doc.break ? MODE_BREAK : mode; + const contents = doc.expandedStates && groupMode === MODE_BREAK ? at_default( + /* isOptionalObject */ + false, + doc.expandedStates, + -1 + ) : doc.contents; + cmds.push({ mode: groupMode, doc: contents }); + break; + } + case DOC_TYPE_IF_BREAK: { + const groupMode = doc.groupId ? groupModeMap[doc.groupId] || MODE_FLAT : mode; + const contents = groupMode === MODE_BREAK ? doc.breakContents : doc.flatContents; + if (contents) { + cmds.push({ mode, doc: contents }); + } + break; + } + case DOC_TYPE_LINE: + if (mode === MODE_BREAK || doc.hard) { + return true; + } + if (!doc.soft) { + out.push(" "); + width--; + } + break; + case DOC_TYPE_LINE_SUFFIX: + hasLineSuffix = true; + break; + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + if (hasLineSuffix) { + return false; + } + break; + } + } + return false; + } + function printDocToString(doc, options) { + const groupModeMap = {}; + const width = options.printWidth; + const newLine = convertEndOfLineToChars(options.endOfLine); + let pos = 0; + const cmds = [{ ind: rootIndent(), mode: MODE_BREAK, doc }]; + const out = []; + let shouldRemeasure = false; + const lineSuffix2 = []; + let printedCursorCount = 0; + propagateBreaks(doc); + while (cmds.length > 0) { + const { ind, mode, doc: doc2 } = cmds.pop(); + switch (get_doc_type_default(doc2)) { + case DOC_TYPE_STRING: { + const formatted = newLine !== "\n" ? string_replace_all_default( + /* isOptionalObject */ + false, + doc2, + "\n", + newLine + ) : doc2; + out.push(formatted); + if (cmds.length > 0) { + pos += get_string_width_default(formatted); + } + break; + } + case DOC_TYPE_ARRAY: + for (let i = doc2.length - 1; i >= 0; i--) { + cmds.push({ ind, mode, doc: doc2[i] }); + } + break; + case DOC_TYPE_CURSOR: + if (printedCursorCount >= 2) { + throw new Error("There are too many 'cursor' in doc."); + } + out.push(CURSOR_PLACEHOLDER); + printedCursorCount++; + break; + case DOC_TYPE_INDENT: + cmds.push({ ind: makeIndent(ind, options), mode, doc: doc2.contents }); + break; + case DOC_TYPE_ALIGN: + cmds.push({ + ind: makeAlign(ind, doc2.n, options), + mode, + doc: doc2.contents + }); + break; + case DOC_TYPE_TRIM: + pos -= trim2(out); + break; + case DOC_TYPE_GROUP: + switch (mode) { + case MODE_FLAT: + if (!shouldRemeasure) { + cmds.push({ + ind, + mode: doc2.break ? MODE_BREAK : MODE_FLAT, + doc: doc2.contents + }); + break; + } + // fallthrough + case MODE_BREAK: { + shouldRemeasure = false; + const next = { ind, mode: MODE_FLAT, doc: doc2.contents }; + const rem = width - pos; + const hasLineSuffix = lineSuffix2.length > 0; + if (!doc2.break && fits(next, cmds, rem, hasLineSuffix, groupModeMap)) { + cmds.push(next); + } else { + if (doc2.expandedStates) { + const mostExpanded = at_default( + /* isOptionalObject */ + false, + doc2.expandedStates, + -1 + ); + if (doc2.break) { + cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded }); + break; + } else { + for (let i = 1; i < doc2.expandedStates.length + 1; i++) { + if (i >= doc2.expandedStates.length) { + cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded }); + break; + } else { + const state = doc2.expandedStates[i]; + const cmd = { ind, mode: MODE_FLAT, doc: state }; + if (fits(cmd, cmds, rem, hasLineSuffix, groupModeMap)) { + cmds.push(cmd); + break; + } + } + } + } + } else { + cmds.push({ ind, mode: MODE_BREAK, doc: doc2.contents }); + } + } + break; + } + } + if (doc2.id) { + groupModeMap[doc2.id] = at_default( + /* isOptionalObject */ + false, + cmds, + -1 + ).mode; + } + break; + // Fills each line with as much code as possible before moving to a new + // line with the same indentation. + // + // Expects doc.parts to be an array of alternating content and + // whitespace. The whitespace contains the linebreaks. + // + // For example: + // ["I", line, "love", line, "monkeys"] + // or + // [{ type: group, ... }, softline, { type: group, ... }] + // + // It uses this parts structure to handle three main layout cases: + // * The first two content items fit on the same line without + // breaking + // -> output the first content item and the whitespace "flat". + // * Only the first content item fits on the line without breaking + // -> output the first content item "flat" and the whitespace with + // "break". + // * Neither content item fits on the line without breaking + // -> output the first content item and the whitespace with "break". + case DOC_TYPE_FILL: { + const rem = width - pos; + const offset = doc2[DOC_FILL_PRINTED_LENGTH] ?? 0; + const { parts } = doc2; + const length = parts.length - offset; + if (length === 0) { + break; + } + const content = parts[offset + 0]; + const whitespace = parts[offset + 1]; + const contentFlatCmd = { ind, mode: MODE_FLAT, doc: content }; + const contentBreakCmd = { ind, mode: MODE_BREAK, doc: content }; + const contentFits = fits( + contentFlatCmd, + [], + rem, + lineSuffix2.length > 0, + groupModeMap, + true + ); + if (length === 1) { + if (contentFits) { + cmds.push(contentFlatCmd); + } else { + cmds.push(contentBreakCmd); + } + break; + } + const whitespaceFlatCmd = { ind, mode: MODE_FLAT, doc: whitespace }; + const whitespaceBreakCmd = { ind, mode: MODE_BREAK, doc: whitespace }; + if (length === 2) { + if (contentFits) { + cmds.push(whitespaceFlatCmd, contentFlatCmd); + } else { + cmds.push(whitespaceBreakCmd, contentBreakCmd); + } + break; + } + const secondContent = parts[offset + 2]; + const remainingCmd = { + ind, + mode, + doc: { ...doc2, [DOC_FILL_PRINTED_LENGTH]: offset + 2 } + }; + const firstAndSecondContentFlatCmd = { + ind, + mode: MODE_FLAT, + doc: [content, whitespace, secondContent] + }; + const firstAndSecondContentFits = fits( + firstAndSecondContentFlatCmd, + [], + rem, + lineSuffix2.length > 0, + groupModeMap, + true + ); + if (firstAndSecondContentFits) { + cmds.push(remainingCmd, whitespaceFlatCmd, contentFlatCmd); + } else if (contentFits) { + cmds.push(remainingCmd, whitespaceBreakCmd, contentFlatCmd); + } else { + cmds.push(remainingCmd, whitespaceBreakCmd, contentBreakCmd); + } + break; + } + case DOC_TYPE_IF_BREAK: + case DOC_TYPE_INDENT_IF_BREAK: { + const groupMode = doc2.groupId ? groupModeMap[doc2.groupId] : mode; + if (groupMode === MODE_BREAK) { + const breakContents = doc2.type === DOC_TYPE_IF_BREAK ? doc2.breakContents : doc2.negate ? doc2.contents : indent(doc2.contents); + if (breakContents) { + cmds.push({ ind, mode, doc: breakContents }); + } + } + if (groupMode === MODE_FLAT) { + const flatContents = doc2.type === DOC_TYPE_IF_BREAK ? doc2.flatContents : doc2.negate ? indent(doc2.contents) : doc2.contents; + if (flatContents) { + cmds.push({ ind, mode, doc: flatContents }); + } + } + break; + } + case DOC_TYPE_LINE_SUFFIX: + lineSuffix2.push({ ind, mode, doc: doc2.contents }); + break; + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + if (lineSuffix2.length > 0) { + cmds.push({ ind, mode, doc: hardlineWithoutBreakParent }); + } + break; + case DOC_TYPE_LINE: + switch (mode) { + case MODE_FLAT: + if (!doc2.hard) { + if (!doc2.soft) { + out.push(" "); + pos += 1; + } + break; + } else { + shouldRemeasure = true; + } + // fallthrough + case MODE_BREAK: + if (lineSuffix2.length > 0) { + cmds.push({ ind, mode, doc: doc2 }, ...lineSuffix2.reverse()); + lineSuffix2.length = 0; + break; + } + if (doc2.literal) { + if (ind.root) { + out.push(newLine, ind.root.value); + pos = ind.root.length; + } else { + out.push(newLine); + pos = 0; + } + } else { + pos -= trim2(out); + out.push(newLine + ind.value); + pos = ind.length; + } + break; + } + break; + case DOC_TYPE_LABEL: + cmds.push({ ind, mode, doc: doc2.contents }); + break; + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc2); + } + if (cmds.length === 0 && lineSuffix2.length > 0) { + cmds.push(...lineSuffix2.reverse()); + lineSuffix2.length = 0; + } + } + const cursorPlaceholderIndex = out.indexOf(CURSOR_PLACEHOLDER); + if (cursorPlaceholderIndex !== -1) { + const otherCursorPlaceholderIndex = out.indexOf( + CURSOR_PLACEHOLDER, + cursorPlaceholderIndex + 1 + ); + if (otherCursorPlaceholderIndex === -1) { + return { + formatted: out.filter((char) => char !== CURSOR_PLACEHOLDER).join("") + }; + } + const beforeCursor = out.slice(0, cursorPlaceholderIndex).join(""); + const aroundCursor = out.slice(cursorPlaceholderIndex + 1, otherCursorPlaceholderIndex).join(""); + const afterCursor = out.slice(otherCursorPlaceholderIndex + 1).join(""); + return { + formatted: beforeCursor + aroundCursor + afterCursor, + cursorNodeStart: beforeCursor.length, + cursorNodeText: aroundCursor + }; + } + return { formatted: out.join("") }; + } + + // src/document/public.js + var builders = { + join, + line, + softline, + hardline, + literalline, + group, + conditionalGroup, + fill, + lineSuffix, + lineSuffixBoundary, + cursor, + breakParent, + ifBreak, + trim, + indent, + indentIfBreak, + align, + addAlignmentToDoc, + markAsRoot, + dedentToRoot, + dedent, + hardlineWithoutBreakParent, + literallineWithoutBreakParent, + label, + // TODO: Remove this in v4 + concat: (parts) => parts + }; + var printer = { printDocToString }; + var utils = { + willBreak, + traverseDoc: traverse_doc_default, + findInDoc, + mapDoc, + removeLines, + stripTrailingHardline, + replaceEndOfLine, + canBreak + }; + return __toCommonJS(public_exports); +}); \ No newline at end of file diff --git a/node_modules/prettier/doc.mjs b/node_modules/prettier/doc.mjs new file mode 100644 index 0000000..6f0c81c --- /dev/null +++ b/node_modules/prettier/doc.mjs @@ -0,0 +1,1233 @@ +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; + +// src/document/public.js +var public_exports = {}; +__export(public_exports, { + builders: () => builders, + printer: () => printer, + utils: () => utils +}); + +// src/document/constants.js +var DOC_TYPE_STRING = "string"; +var DOC_TYPE_ARRAY = "array"; +var DOC_TYPE_CURSOR = "cursor"; +var DOC_TYPE_INDENT = "indent"; +var DOC_TYPE_ALIGN = "align"; +var DOC_TYPE_TRIM = "trim"; +var DOC_TYPE_GROUP = "group"; +var DOC_TYPE_FILL = "fill"; +var DOC_TYPE_IF_BREAK = "if-break"; +var DOC_TYPE_INDENT_IF_BREAK = "indent-if-break"; +var DOC_TYPE_LINE_SUFFIX = "line-suffix"; +var DOC_TYPE_LINE_SUFFIX_BOUNDARY = "line-suffix-boundary"; +var DOC_TYPE_LINE = "line"; +var DOC_TYPE_LABEL = "label"; +var DOC_TYPE_BREAK_PARENT = "break-parent"; +var VALID_OBJECT_DOC_TYPES = /* @__PURE__ */ new Set([ + DOC_TYPE_CURSOR, + DOC_TYPE_INDENT, + DOC_TYPE_ALIGN, + DOC_TYPE_TRIM, + DOC_TYPE_GROUP, + DOC_TYPE_FILL, + DOC_TYPE_IF_BREAK, + DOC_TYPE_INDENT_IF_BREAK, + DOC_TYPE_LINE_SUFFIX, + DOC_TYPE_LINE_SUFFIX_BOUNDARY, + DOC_TYPE_LINE, + DOC_TYPE_LABEL, + DOC_TYPE_BREAK_PARENT +]); + +// scripts/build/shims/at.js +var at = (isOptionalObject, object, index) => { + if (isOptionalObject && (object === void 0 || object === null)) { + return; + } + if (Array.isArray(object) || typeof object === "string") { + return object[index < 0 ? object.length + index : index]; + } + return object.at(index); +}; +var at_default = at; + +// src/document/utils/get-doc-type.js +function getDocType(doc) { + if (typeof doc === "string") { + return DOC_TYPE_STRING; + } + if (Array.isArray(doc)) { + return DOC_TYPE_ARRAY; + } + if (!doc) { + return; + } + const { type } = doc; + if (VALID_OBJECT_DOC_TYPES.has(type)) { + return type; + } +} +var get_doc_type_default = getDocType; + +// src/document/invalid-doc-error.js +var disjunctionListFormat = (list) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(list); +function getDocErrorMessage(doc) { + const type = doc === null ? "null" : typeof doc; + if (type !== "string" && type !== "object") { + return `Unexpected doc '${type}', +Expected it to be 'string' or 'object'.`; + } + if (get_doc_type_default(doc)) { + throw new Error("doc is valid."); + } + const objectType = Object.prototype.toString.call(doc); + if (objectType !== "[object Object]") { + return `Unexpected doc '${objectType}'.`; + } + const EXPECTED_TYPE_VALUES = disjunctionListFormat( + [...VALID_OBJECT_DOC_TYPES].map((type2) => `'${type2}'`) + ); + return `Unexpected doc.type '${doc.type}'. +Expected it to be ${EXPECTED_TYPE_VALUES}.`; +} +var InvalidDocError = class extends Error { + name = "InvalidDocError"; + constructor(doc) { + super(getDocErrorMessage(doc)); + this.doc = doc; + } +}; +var invalid_doc_error_default = InvalidDocError; + +// src/document/utils/traverse-doc.js +var traverseDocOnExitStackMarker = {}; +function traverseDoc(doc, onEnter, onExit, shouldTraverseConditionalGroups) { + const docsStack = [doc]; + while (docsStack.length > 0) { + const doc2 = docsStack.pop(); + if (doc2 === traverseDocOnExitStackMarker) { + onExit(docsStack.pop()); + continue; + } + if (onExit) { + docsStack.push(doc2, traverseDocOnExitStackMarker); + } + const docType = get_doc_type_default(doc2); + if (!docType) { + throw new invalid_doc_error_default(doc2); + } + if ((onEnter == null ? void 0 : onEnter(doc2)) === false) { + continue; + } + switch (docType) { + case DOC_TYPE_ARRAY: + case DOC_TYPE_FILL: { + const parts = docType === DOC_TYPE_ARRAY ? doc2 : doc2.parts; + for (let ic = parts.length, i = ic - 1; i >= 0; --i) { + docsStack.push(parts[i]); + } + break; + } + case DOC_TYPE_IF_BREAK: + docsStack.push(doc2.flatContents, doc2.breakContents); + break; + case DOC_TYPE_GROUP: + if (shouldTraverseConditionalGroups && doc2.expandedStates) { + for (let ic = doc2.expandedStates.length, i = ic - 1; i >= 0; --i) { + docsStack.push(doc2.expandedStates[i]); + } + } else { + docsStack.push(doc2.contents); + } + break; + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + case DOC_TYPE_LINE_SUFFIX: + docsStack.push(doc2.contents); + break; + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc2); + } + } +} +var traverse_doc_default = traverseDoc; + +// src/document/utils.js +function mapDoc(doc, cb) { + if (typeof doc === "string") { + return cb(doc); + } + const mapped = /* @__PURE__ */ new Map(); + return rec(doc); + function rec(doc2) { + if (mapped.has(doc2)) { + return mapped.get(doc2); + } + const result = process2(doc2); + mapped.set(doc2, result); + return result; + } + function process2(doc2) { + switch (get_doc_type_default(doc2)) { + case DOC_TYPE_ARRAY: + return cb(doc2.map(rec)); + case DOC_TYPE_FILL: + return cb({ ...doc2, parts: doc2.parts.map(rec) }); + case DOC_TYPE_IF_BREAK: + return cb({ + ...doc2, + breakContents: rec(doc2.breakContents), + flatContents: rec(doc2.flatContents) + }); + case DOC_TYPE_GROUP: { + let { expandedStates, contents } = doc2; + if (expandedStates) { + expandedStates = expandedStates.map(rec); + contents = expandedStates[0]; + } else { + contents = rec(contents); + } + return cb({ ...doc2, contents, expandedStates }); + } + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + case DOC_TYPE_LINE_SUFFIX: + return cb({ ...doc2, contents: rec(doc2.contents) }); + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + return cb(doc2); + default: + throw new invalid_doc_error_default(doc2); + } + } +} +function findInDoc(doc, fn, defaultValue) { + let result = defaultValue; + let shouldSkipFurtherProcessing = false; + function findInDocOnEnterFn(doc2) { + if (shouldSkipFurtherProcessing) { + return false; + } + const maybeResult = fn(doc2); + if (maybeResult !== void 0) { + shouldSkipFurtherProcessing = true; + result = maybeResult; + } + } + traverse_doc_default(doc, findInDocOnEnterFn); + return result; +} +function willBreakFn(doc) { + if (doc.type === DOC_TYPE_GROUP && doc.break) { + return true; + } + if (doc.type === DOC_TYPE_LINE && doc.hard) { + return true; + } + if (doc.type === DOC_TYPE_BREAK_PARENT) { + return true; + } +} +function willBreak(doc) { + return findInDoc(doc, willBreakFn, false); +} +function breakParentGroup(groupStack) { + if (groupStack.length > 0) { + const parentGroup = at_default( + /* isOptionalObject */ + false, + groupStack, + -1 + ); + if (!parentGroup.expandedStates && !parentGroup.break) { + parentGroup.break = "propagated"; + } + } + return null; +} +function propagateBreaks(doc) { + const alreadyVisitedSet = /* @__PURE__ */ new Set(); + const groupStack = []; + function propagateBreaksOnEnterFn(doc2) { + if (doc2.type === DOC_TYPE_BREAK_PARENT) { + breakParentGroup(groupStack); + } + if (doc2.type === DOC_TYPE_GROUP) { + groupStack.push(doc2); + if (alreadyVisitedSet.has(doc2)) { + return false; + } + alreadyVisitedSet.add(doc2); + } + } + function propagateBreaksOnExitFn(doc2) { + if (doc2.type === DOC_TYPE_GROUP) { + const group2 = groupStack.pop(); + if (group2.break) { + breakParentGroup(groupStack); + } + } + } + traverse_doc_default( + doc, + propagateBreaksOnEnterFn, + propagateBreaksOnExitFn, + /* shouldTraverseConditionalGroups */ + true + ); +} +function removeLinesFn(doc) { + if (doc.type === DOC_TYPE_LINE && !doc.hard) { + return doc.soft ? "" : " "; + } + if (doc.type === DOC_TYPE_IF_BREAK) { + return doc.flatContents; + } + return doc; +} +function removeLines(doc) { + return mapDoc(doc, removeLinesFn); +} +function stripTrailingHardlineFromParts(parts) { + parts = [...parts]; + while (parts.length >= 2 && at_default( + /* isOptionalObject */ + false, + parts, + -2 + ).type === DOC_TYPE_LINE && at_default( + /* isOptionalObject */ + false, + parts, + -1 + ).type === DOC_TYPE_BREAK_PARENT) { + parts.length -= 2; + } + if (parts.length > 0) { + const lastPart = stripTrailingHardlineFromDoc(at_default( + /* isOptionalObject */ + false, + parts, + -1 + )); + parts[parts.length - 1] = lastPart; + } + return parts; +} +function stripTrailingHardlineFromDoc(doc) { + switch (get_doc_type_default(doc)) { + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_GROUP: + case DOC_TYPE_LINE_SUFFIX: + case DOC_TYPE_LABEL: { + const contents = stripTrailingHardlineFromDoc(doc.contents); + return { ...doc, contents }; + } + case DOC_TYPE_IF_BREAK: + return { + ...doc, + breakContents: stripTrailingHardlineFromDoc(doc.breakContents), + flatContents: stripTrailingHardlineFromDoc(doc.flatContents) + }; + case DOC_TYPE_FILL: + return { ...doc, parts: stripTrailingHardlineFromParts(doc.parts) }; + case DOC_TYPE_ARRAY: + return stripTrailingHardlineFromParts(doc); + case DOC_TYPE_STRING: + return doc.replace(/[\n\r]*$/u, ""); + case DOC_TYPE_ALIGN: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc); + } + return doc; +} +function stripTrailingHardline(doc) { + return stripTrailingHardlineFromDoc(cleanDoc(doc)); +} +function cleanDocFn(doc) { + switch (get_doc_type_default(doc)) { + case DOC_TYPE_FILL: + if (doc.parts.every((part) => part === "")) { + return ""; + } + break; + case DOC_TYPE_GROUP: + if (!doc.contents && !doc.id && !doc.break && !doc.expandedStates) { + return ""; + } + if (doc.contents.type === DOC_TYPE_GROUP && doc.contents.id === doc.id && doc.contents.break === doc.break && doc.contents.expandedStates === doc.expandedStates) { + return doc.contents; + } + break; + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LINE_SUFFIX: + if (!doc.contents) { + return ""; + } + break; + case DOC_TYPE_IF_BREAK: + if (!doc.flatContents && !doc.breakContents) { + return ""; + } + break; + case DOC_TYPE_ARRAY: { + const parts = []; + for (const part of doc) { + if (!part) { + continue; + } + const [currentPart, ...restParts] = Array.isArray(part) ? part : [part]; + if (typeof currentPart === "string" && typeof at_default( + /* isOptionalObject */ + false, + parts, + -1 + ) === "string") { + parts[parts.length - 1] += currentPart; + } else { + parts.push(currentPart); + } + parts.push(...restParts); + } + if (parts.length === 0) { + return ""; + } + if (parts.length === 1) { + return parts[0]; + } + return parts; + } + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_LABEL: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc); + } + return doc; +} +function cleanDoc(doc) { + return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc)); +} +function replaceEndOfLine(doc, replacement = literalline) { + return mapDoc( + doc, + (currentDoc) => typeof currentDoc === "string" ? join(replacement, currentDoc.split("\n")) : currentDoc + ); +} +function canBreakFn(doc) { + if (doc.type === DOC_TYPE_LINE) { + return true; + } +} +function canBreak(doc) { + return findInDoc(doc, canBreakFn, false); +} + +// src/document/utils/assert-doc.js +var noop = () => { +}; +var assertDoc = true ? noop : function(doc) { + traverse_doc_default(doc, (doc2) => { + if (checked.has(doc2)) { + return false; + } + if (typeof doc2 !== "string") { + checked.add(doc2); + } + }); +}; +var assertDocArray = true ? noop : function(docs, optional = false) { + if (optional && !docs) { + return; + } + if (!Array.isArray(docs)) { + throw new TypeError("Unexpected doc array."); + } + for (const doc of docs) { + assertDoc(doc); + } +}; +var assertDocFillParts = true ? noop : ( + /** + * @param {Doc[]} parts + */ + function(parts) { + assertDocArray(parts); + if (parts.length > 1 && isEmptyDoc(at_default( + /* isOptionalObject */ + false, + parts, + -1 + ))) { + parts = parts.slice(0, -1); + } + for (const [i, doc] of parts.entries()) { + if (i % 2 === 1 && !isValidSeparator(doc)) { + const type = get_doc_type_default(doc); + throw new Error( + `Unexpected non-line-break doc at ${i}. Doc type is ${type}.` + ); + } + } + } +); + +// src/document/builders.js +function indent(contents) { + assertDoc(contents); + return { type: DOC_TYPE_INDENT, contents }; +} +function align(widthOrString, contents) { + assertDoc(contents); + return { type: DOC_TYPE_ALIGN, contents, n: widthOrString }; +} +function group(contents, opts = {}) { + assertDoc(contents); + assertDocArray( + opts.expandedStates, + /* optional */ + true + ); + return { + type: DOC_TYPE_GROUP, + id: opts.id, + contents, + break: Boolean(opts.shouldBreak), + expandedStates: opts.expandedStates + }; +} +function dedentToRoot(contents) { + return align(Number.NEGATIVE_INFINITY, contents); +} +function markAsRoot(contents) { + return align({ type: "root" }, contents); +} +function dedent(contents) { + return align(-1, contents); +} +function conditionalGroup(states, opts) { + return group(states[0], { ...opts, expandedStates: states }); +} +function fill(parts) { + assertDocFillParts(parts); + return { type: DOC_TYPE_FILL, parts }; +} +function ifBreak(breakContents, flatContents = "", opts = {}) { + assertDoc(breakContents); + if (flatContents !== "") { + assertDoc(flatContents); + } + return { + type: DOC_TYPE_IF_BREAK, + breakContents, + flatContents, + groupId: opts.groupId + }; +} +function indentIfBreak(contents, opts) { + assertDoc(contents); + return { + type: DOC_TYPE_INDENT_IF_BREAK, + contents, + groupId: opts.groupId, + negate: opts.negate + }; +} +function lineSuffix(contents) { + assertDoc(contents); + return { type: DOC_TYPE_LINE_SUFFIX, contents }; +} +var lineSuffixBoundary = { type: DOC_TYPE_LINE_SUFFIX_BOUNDARY }; +var breakParent = { type: DOC_TYPE_BREAK_PARENT }; +var trim = { type: DOC_TYPE_TRIM }; +var hardlineWithoutBreakParent = { type: DOC_TYPE_LINE, hard: true }; +var literallineWithoutBreakParent = { + type: DOC_TYPE_LINE, + hard: true, + literal: true +}; +var line = { type: DOC_TYPE_LINE }; +var softline = { type: DOC_TYPE_LINE, soft: true }; +var hardline = [hardlineWithoutBreakParent, breakParent]; +var literalline = [literallineWithoutBreakParent, breakParent]; +var cursor = { type: DOC_TYPE_CURSOR }; +function join(separator, docs) { + assertDoc(separator); + assertDocArray(docs); + const parts = []; + for (let i = 0; i < docs.length; i++) { + if (i !== 0) { + parts.push(separator); + } + parts.push(docs[i]); + } + return parts; +} +function addAlignmentToDoc(doc, size, tabWidth) { + assertDoc(doc); + let aligned = doc; + if (size > 0) { + for (let i = 0; i < Math.floor(size / tabWidth); ++i) { + aligned = indent(aligned); + } + aligned = align(size % tabWidth, aligned); + aligned = align(Number.NEGATIVE_INFINITY, aligned); + } + return aligned; +} +function label(label2, contents) { + assertDoc(contents); + return label2 ? { type: DOC_TYPE_LABEL, label: label2, contents } : contents; +} + +// scripts/build/shims/string-replace-all.js +var stringReplaceAll = (isOptionalObject, original, pattern, replacement) => { + if (isOptionalObject && (original === void 0 || original === null)) { + return; + } + if (original.replaceAll) { + return original.replaceAll(pattern, replacement); + } + if (pattern.global) { + return original.replace(pattern, replacement); + } + return original.split(pattern).join(replacement); +}; +var string_replace_all_default = stringReplaceAll; + +// src/common/end-of-line.js +function convertEndOfLineToChars(value) { + switch (value) { + case "cr": + return "\r"; + case "crlf": + return "\r\n"; + default: + return "\n"; + } +} + +// node_modules/emoji-regex/index.mjs +var emoji_regex_default = () => { + return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; +}; + +// node_modules/get-east-asian-width/lookup.js +function isFullWidth(x) { + return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510; +} +function isWide(x) { + return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141; +} + +// node_modules/get-east-asian-width/index.js +var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint)); + +// src/utils/get-string-width.js +var notAsciiRegex = /[^\x20-\x7F]/u; +function getStringWidth(text) { + if (!text) { + return 0; + } + if (!notAsciiRegex.test(text)) { + return text.length; + } + text = text.replace(emoji_regex_default(), " "); + let width = 0; + for (const character of text) { + const codePoint = character.codePointAt(0); + if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { + continue; + } + if (codePoint >= 768 && codePoint <= 879) { + continue; + } + width += _isNarrowWidth(codePoint) ? 1 : 2; + } + return width; +} +var get_string_width_default = getStringWidth; + +// src/document/printer.js +var MODE_BREAK = Symbol("MODE_BREAK"); +var MODE_FLAT = Symbol("MODE_FLAT"); +var CURSOR_PLACEHOLDER = Symbol("cursor"); +var DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH"); +function rootIndent() { + return { value: "", length: 0, queue: [] }; +} +function makeIndent(ind, options) { + return generateInd(ind, { type: "indent" }, options); +} +function makeAlign(indent2, widthOrDoc, options) { + if (widthOrDoc === Number.NEGATIVE_INFINITY) { + return indent2.root || rootIndent(); + } + if (widthOrDoc < 0) { + return generateInd(indent2, { type: "dedent" }, options); + } + if (!widthOrDoc) { + return indent2; + } + if (widthOrDoc.type === "root") { + return { ...indent2, root: indent2 }; + } + const alignType = typeof widthOrDoc === "string" ? "stringAlign" : "numberAlign"; + return generateInd(indent2, { type: alignType, n: widthOrDoc }, options); +} +function generateInd(ind, newPart, options) { + const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) : [...ind.queue, newPart]; + let value = ""; + let length = 0; + let lastTabs = 0; + let lastSpaces = 0; + for (const part of queue) { + switch (part.type) { + case "indent": + flush(); + if (options.useTabs) { + addTabs(1); + } else { + addSpaces(options.tabWidth); + } + break; + case "stringAlign": + flush(); + value += part.n; + length += part.n.length; + break; + case "numberAlign": + lastTabs += 1; + lastSpaces += part.n; + break; + default: + throw new Error(`Unexpected type '${part.type}'`); + } + } + flushSpaces(); + return { ...ind, value, length, queue }; + function addTabs(count) { + value += " ".repeat(count); + length += options.tabWidth * count; + } + function addSpaces(count) { + value += " ".repeat(count); + length += count; + } + function flush() { + if (options.useTabs) { + flushTabs(); + } else { + flushSpaces(); + } + } + function flushTabs() { + if (lastTabs > 0) { + addTabs(lastTabs); + } + resetLast(); + } + function flushSpaces() { + if (lastSpaces > 0) { + addSpaces(lastSpaces); + } + resetLast(); + } + function resetLast() { + lastTabs = 0; + lastSpaces = 0; + } +} +function trim2(out) { + let trimCount = 0; + let cursorCount = 0; + let outIndex = out.length; + outer: while (outIndex--) { + const last = out[outIndex]; + if (last === CURSOR_PLACEHOLDER) { + cursorCount++; + continue; + } + if (false) { + throw new Error(`Unexpected value in trim: '${typeof last}'`); + } + for (let charIndex = last.length - 1; charIndex >= 0; charIndex--) { + const char = last[charIndex]; + if (char === " " || char === " ") { + trimCount++; + } else { + out[outIndex] = last.slice(0, charIndex + 1); + break outer; + } + } + } + if (trimCount > 0 || cursorCount > 0) { + out.length = outIndex + 1; + while (cursorCount-- > 0) { + out.push(CURSOR_PLACEHOLDER); + } + } + return trimCount; +} +function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat) { + if (width === Number.POSITIVE_INFINITY) { + return true; + } + let restIdx = restCommands.length; + const cmds = [next]; + const out = []; + while (width >= 0) { + if (cmds.length === 0) { + if (restIdx === 0) { + return true; + } + cmds.push(restCommands[--restIdx]); + continue; + } + const { mode, doc } = cmds.pop(); + const docType = get_doc_type_default(doc); + switch (docType) { + case DOC_TYPE_STRING: + out.push(doc); + width -= get_string_width_default(doc); + break; + case DOC_TYPE_ARRAY: + case DOC_TYPE_FILL: { + const parts = docType === DOC_TYPE_ARRAY ? doc : doc.parts; + const end = doc[DOC_FILL_PRINTED_LENGTH] ?? 0; + for (let i = parts.length - 1; i >= end; i--) { + cmds.push({ mode, doc: parts[i] }); + } + break; + } + case DOC_TYPE_INDENT: + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + cmds.push({ mode, doc: doc.contents }); + break; + case DOC_TYPE_TRIM: + width += trim2(out); + break; + case DOC_TYPE_GROUP: { + if (mustBeFlat && doc.break) { + return false; + } + const groupMode = doc.break ? MODE_BREAK : mode; + const contents = doc.expandedStates && groupMode === MODE_BREAK ? at_default( + /* isOptionalObject */ + false, + doc.expandedStates, + -1 + ) : doc.contents; + cmds.push({ mode: groupMode, doc: contents }); + break; + } + case DOC_TYPE_IF_BREAK: { + const groupMode = doc.groupId ? groupModeMap[doc.groupId] || MODE_FLAT : mode; + const contents = groupMode === MODE_BREAK ? doc.breakContents : doc.flatContents; + if (contents) { + cmds.push({ mode, doc: contents }); + } + break; + } + case DOC_TYPE_LINE: + if (mode === MODE_BREAK || doc.hard) { + return true; + } + if (!doc.soft) { + out.push(" "); + width--; + } + break; + case DOC_TYPE_LINE_SUFFIX: + hasLineSuffix = true; + break; + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + if (hasLineSuffix) { + return false; + } + break; + } + } + return false; +} +function printDocToString(doc, options) { + const groupModeMap = {}; + const width = options.printWidth; + const newLine = convertEndOfLineToChars(options.endOfLine); + let pos = 0; + const cmds = [{ ind: rootIndent(), mode: MODE_BREAK, doc }]; + const out = []; + let shouldRemeasure = false; + const lineSuffix2 = []; + let printedCursorCount = 0; + propagateBreaks(doc); + while (cmds.length > 0) { + const { ind, mode, doc: doc2 } = cmds.pop(); + switch (get_doc_type_default(doc2)) { + case DOC_TYPE_STRING: { + const formatted = newLine !== "\n" ? string_replace_all_default( + /* isOptionalObject */ + false, + doc2, + "\n", + newLine + ) : doc2; + out.push(formatted); + if (cmds.length > 0) { + pos += get_string_width_default(formatted); + } + break; + } + case DOC_TYPE_ARRAY: + for (let i = doc2.length - 1; i >= 0; i--) { + cmds.push({ ind, mode, doc: doc2[i] }); + } + break; + case DOC_TYPE_CURSOR: + if (printedCursorCount >= 2) { + throw new Error("There are too many 'cursor' in doc."); + } + out.push(CURSOR_PLACEHOLDER); + printedCursorCount++; + break; + case DOC_TYPE_INDENT: + cmds.push({ ind: makeIndent(ind, options), mode, doc: doc2.contents }); + break; + case DOC_TYPE_ALIGN: + cmds.push({ + ind: makeAlign(ind, doc2.n, options), + mode, + doc: doc2.contents + }); + break; + case DOC_TYPE_TRIM: + pos -= trim2(out); + break; + case DOC_TYPE_GROUP: + switch (mode) { + case MODE_FLAT: + if (!shouldRemeasure) { + cmds.push({ + ind, + mode: doc2.break ? MODE_BREAK : MODE_FLAT, + doc: doc2.contents + }); + break; + } + // fallthrough + case MODE_BREAK: { + shouldRemeasure = false; + const next = { ind, mode: MODE_FLAT, doc: doc2.contents }; + const rem = width - pos; + const hasLineSuffix = lineSuffix2.length > 0; + if (!doc2.break && fits(next, cmds, rem, hasLineSuffix, groupModeMap)) { + cmds.push(next); + } else { + if (doc2.expandedStates) { + const mostExpanded = at_default( + /* isOptionalObject */ + false, + doc2.expandedStates, + -1 + ); + if (doc2.break) { + cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded }); + break; + } else { + for (let i = 1; i < doc2.expandedStates.length + 1; i++) { + if (i >= doc2.expandedStates.length) { + cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded }); + break; + } else { + const state = doc2.expandedStates[i]; + const cmd = { ind, mode: MODE_FLAT, doc: state }; + if (fits(cmd, cmds, rem, hasLineSuffix, groupModeMap)) { + cmds.push(cmd); + break; + } + } + } + } + } else { + cmds.push({ ind, mode: MODE_BREAK, doc: doc2.contents }); + } + } + break; + } + } + if (doc2.id) { + groupModeMap[doc2.id] = at_default( + /* isOptionalObject */ + false, + cmds, + -1 + ).mode; + } + break; + // Fills each line with as much code as possible before moving to a new + // line with the same indentation. + // + // Expects doc.parts to be an array of alternating content and + // whitespace. The whitespace contains the linebreaks. + // + // For example: + // ["I", line, "love", line, "monkeys"] + // or + // [{ type: group, ... }, softline, { type: group, ... }] + // + // It uses this parts structure to handle three main layout cases: + // * The first two content items fit on the same line without + // breaking + // -> output the first content item and the whitespace "flat". + // * Only the first content item fits on the line without breaking + // -> output the first content item "flat" and the whitespace with + // "break". + // * Neither content item fits on the line without breaking + // -> output the first content item and the whitespace with "break". + case DOC_TYPE_FILL: { + const rem = width - pos; + const offset = doc2[DOC_FILL_PRINTED_LENGTH] ?? 0; + const { parts } = doc2; + const length = parts.length - offset; + if (length === 0) { + break; + } + const content = parts[offset + 0]; + const whitespace = parts[offset + 1]; + const contentFlatCmd = { ind, mode: MODE_FLAT, doc: content }; + const contentBreakCmd = { ind, mode: MODE_BREAK, doc: content }; + const contentFits = fits( + contentFlatCmd, + [], + rem, + lineSuffix2.length > 0, + groupModeMap, + true + ); + if (length === 1) { + if (contentFits) { + cmds.push(contentFlatCmd); + } else { + cmds.push(contentBreakCmd); + } + break; + } + const whitespaceFlatCmd = { ind, mode: MODE_FLAT, doc: whitespace }; + const whitespaceBreakCmd = { ind, mode: MODE_BREAK, doc: whitespace }; + if (length === 2) { + if (contentFits) { + cmds.push(whitespaceFlatCmd, contentFlatCmd); + } else { + cmds.push(whitespaceBreakCmd, contentBreakCmd); + } + break; + } + const secondContent = parts[offset + 2]; + const remainingCmd = { + ind, + mode, + doc: { ...doc2, [DOC_FILL_PRINTED_LENGTH]: offset + 2 } + }; + const firstAndSecondContentFlatCmd = { + ind, + mode: MODE_FLAT, + doc: [content, whitespace, secondContent] + }; + const firstAndSecondContentFits = fits( + firstAndSecondContentFlatCmd, + [], + rem, + lineSuffix2.length > 0, + groupModeMap, + true + ); + if (firstAndSecondContentFits) { + cmds.push(remainingCmd, whitespaceFlatCmd, contentFlatCmd); + } else if (contentFits) { + cmds.push(remainingCmd, whitespaceBreakCmd, contentFlatCmd); + } else { + cmds.push(remainingCmd, whitespaceBreakCmd, contentBreakCmd); + } + break; + } + case DOC_TYPE_IF_BREAK: + case DOC_TYPE_INDENT_IF_BREAK: { + const groupMode = doc2.groupId ? groupModeMap[doc2.groupId] : mode; + if (groupMode === MODE_BREAK) { + const breakContents = doc2.type === DOC_TYPE_IF_BREAK ? doc2.breakContents : doc2.negate ? doc2.contents : indent(doc2.contents); + if (breakContents) { + cmds.push({ ind, mode, doc: breakContents }); + } + } + if (groupMode === MODE_FLAT) { + const flatContents = doc2.type === DOC_TYPE_IF_BREAK ? doc2.flatContents : doc2.negate ? indent(doc2.contents) : doc2.contents; + if (flatContents) { + cmds.push({ ind, mode, doc: flatContents }); + } + } + break; + } + case DOC_TYPE_LINE_SUFFIX: + lineSuffix2.push({ ind, mode, doc: doc2.contents }); + break; + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + if (lineSuffix2.length > 0) { + cmds.push({ ind, mode, doc: hardlineWithoutBreakParent }); + } + break; + case DOC_TYPE_LINE: + switch (mode) { + case MODE_FLAT: + if (!doc2.hard) { + if (!doc2.soft) { + out.push(" "); + pos += 1; + } + break; + } else { + shouldRemeasure = true; + } + // fallthrough + case MODE_BREAK: + if (lineSuffix2.length > 0) { + cmds.push({ ind, mode, doc: doc2 }, ...lineSuffix2.reverse()); + lineSuffix2.length = 0; + break; + } + if (doc2.literal) { + if (ind.root) { + out.push(newLine, ind.root.value); + pos = ind.root.length; + } else { + out.push(newLine); + pos = 0; + } + } else { + pos -= trim2(out); + out.push(newLine + ind.value); + pos = ind.length; + } + break; + } + break; + case DOC_TYPE_LABEL: + cmds.push({ ind, mode, doc: doc2.contents }); + break; + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc2); + } + if (cmds.length === 0 && lineSuffix2.length > 0) { + cmds.push(...lineSuffix2.reverse()); + lineSuffix2.length = 0; + } + } + const cursorPlaceholderIndex = out.indexOf(CURSOR_PLACEHOLDER); + if (cursorPlaceholderIndex !== -1) { + const otherCursorPlaceholderIndex = out.indexOf( + CURSOR_PLACEHOLDER, + cursorPlaceholderIndex + 1 + ); + if (otherCursorPlaceholderIndex === -1) { + return { + formatted: out.filter((char) => char !== CURSOR_PLACEHOLDER).join("") + }; + } + const beforeCursor = out.slice(0, cursorPlaceholderIndex).join(""); + const aroundCursor = out.slice(cursorPlaceholderIndex + 1, otherCursorPlaceholderIndex).join(""); + const afterCursor = out.slice(otherCursorPlaceholderIndex + 1).join(""); + return { + formatted: beforeCursor + aroundCursor + afterCursor, + cursorNodeStart: beforeCursor.length, + cursorNodeText: aroundCursor + }; + } + return { formatted: out.join("") }; +} + +// src/document/public.js +var builders = { + join, + line, + softline, + hardline, + literalline, + group, + conditionalGroup, + fill, + lineSuffix, + lineSuffixBoundary, + cursor, + breakParent, + ifBreak, + trim, + indent, + indentIfBreak, + align, + addAlignmentToDoc, + markAsRoot, + dedentToRoot, + dedent, + hardlineWithoutBreakParent, + literallineWithoutBreakParent, + label, + // TODO: Remove this in v4 + concat: (parts) => parts +}; +var printer = { printDocToString }; +var utils = { + willBreak, + traverseDoc: traverse_doc_default, + findInDoc, + mapDoc, + removeLines, + stripTrailingHardline, + replaceEndOfLine, + canBreak +}; + +// with-default-export:src/document/public.js +var public_default = public_exports; +export { + builders, + public_default as default, + printer, + utils +}; diff --git a/node_modules/prettier/index.cjs b/node_modules/prettier/index.cjs new file mode 100644 index 0000000..ec43948 --- /dev/null +++ b/node_modules/prettier/index.cjs @@ -0,0 +1,682 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/utils/skip.js +function skip(characters) { + return (text, startIndex, options) => { + const backwards = Boolean(options == null ? void 0 : options.backwards); + if (startIndex === false) { + return false; + } + const { length } = text; + let cursor = startIndex; + while (cursor >= 0 && cursor < length) { + const character = text.charAt(cursor); + if (characters instanceof RegExp) { + if (!characters.test(character)) { + return cursor; + } + } else if (!characters.includes(character)) { + return cursor; + } + backwards ? cursor-- : cursor++; + } + if (cursor === -1 || cursor === length) { + return cursor; + } + return false; + }; +} +var skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine; +var init_skip = __esm({ + "src/utils/skip.js"() { + skipWhitespace = skip(/\s/u); + skipSpaces = skip(" "); + skipToLineEnd = skip(",; "); + skipEverythingButNewLine = skip(/[^\n\r]/u); + } +}); + +// src/utils/skip-inline-comment.js +function skipInlineComment(text, startIndex) { + if (startIndex === false) { + return false; + } + if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "*") { + for (let i = startIndex + 2; i < text.length; ++i) { + if (text.charAt(i) === "*" && text.charAt(i + 1) === "/") { + return i + 2; + } + } + } + return startIndex; +} +var skip_inline_comment_default; +var init_skip_inline_comment = __esm({ + "src/utils/skip-inline-comment.js"() { + skip_inline_comment_default = skipInlineComment; + } +}); + +// src/utils/skip-newline.js +function skipNewline(text, startIndex, options) { + const backwards = Boolean(options == null ? void 0 : options.backwards); + if (startIndex === false) { + return false; + } + const character = text.charAt(startIndex); + if (backwards) { + if (text.charAt(startIndex - 1) === "\r" && character === "\n") { + return startIndex - 2; + } + if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") { + return startIndex - 1; + } + } else { + if (character === "\r" && text.charAt(startIndex + 1) === "\n") { + return startIndex + 2; + } + if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") { + return startIndex + 1; + } + } + return startIndex; +} +var skip_newline_default; +var init_skip_newline = __esm({ + "src/utils/skip-newline.js"() { + skip_newline_default = skipNewline; + } +}); + +// src/utils/skip-trailing-comment.js +function skipTrailingComment(text, startIndex) { + if (startIndex === false) { + return false; + } + if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "/") { + return skipEverythingButNewLine(text, startIndex); + } + return startIndex; +} +var skip_trailing_comment_default; +var init_skip_trailing_comment = __esm({ + "src/utils/skip-trailing-comment.js"() { + init_skip(); + skip_trailing_comment_default = skipTrailingComment; + } +}); + +// src/utils/get-next-non-space-non-comment-character-index.js +function getNextNonSpaceNonCommentCharacterIndex(text, startIndex) { + let oldIdx = null; + let nextIdx = startIndex; + while (nextIdx !== oldIdx) { + oldIdx = nextIdx; + nextIdx = skipSpaces(text, nextIdx); + nextIdx = skip_inline_comment_default(text, nextIdx); + nextIdx = skip_trailing_comment_default(text, nextIdx); + nextIdx = skip_newline_default(text, nextIdx); + } + return nextIdx; +} +var get_next_non_space_non_comment_character_index_default; +var init_get_next_non_space_non_comment_character_index = __esm({ + "src/utils/get-next-non-space-non-comment-character-index.js"() { + init_skip(); + init_skip_inline_comment(); + init_skip_newline(); + init_skip_trailing_comment(); + get_next_non_space_non_comment_character_index_default = getNextNonSpaceNonCommentCharacterIndex; + } +}); + +// src/utils/has-newline.js +function hasNewline(text, startIndex, options = {}) { + const idx = skipSpaces( + text, + options.backwards ? startIndex - 1 : startIndex, + options + ); + const idx2 = skip_newline_default(text, idx, options); + return idx !== idx2; +} +var has_newline_default; +var init_has_newline = __esm({ + "src/utils/has-newline.js"() { + init_skip(); + init_skip_newline(); + has_newline_default = hasNewline; + } +}); + +// src/utils/is-next-line-empty.js +function isNextLineEmpty(text, startIndex) { + let oldIdx = null; + let idx = startIndex; + while (idx !== oldIdx) { + oldIdx = idx; + idx = skipToLineEnd(text, idx); + idx = skip_inline_comment_default(text, idx); + idx = skipSpaces(text, idx); + } + idx = skip_trailing_comment_default(text, idx); + idx = skip_newline_default(text, idx); + return idx !== false && has_newline_default(text, idx); +} +var is_next_line_empty_default; +var init_is_next_line_empty = __esm({ + "src/utils/is-next-line-empty.js"() { + init_has_newline(); + init_skip(); + init_skip_inline_comment(); + init_skip_newline(); + init_skip_trailing_comment(); + is_next_line_empty_default = isNextLineEmpty; + } +}); + +// src/utils/is-previous-line-empty.js +function isPreviousLineEmpty(text, startIndex) { + let idx = startIndex - 1; + idx = skipSpaces(text, idx, { backwards: true }); + idx = skip_newline_default(text, idx, { backwards: true }); + idx = skipSpaces(text, idx, { backwards: true }); + const idx2 = skip_newline_default(text, idx, { backwards: true }); + return idx !== idx2; +} +var is_previous_line_empty_default; +var init_is_previous_line_empty = __esm({ + "src/utils/is-previous-line-empty.js"() { + init_skip(); + init_skip_newline(); + is_previous_line_empty_default = isPreviousLineEmpty; + } +}); + +// src/main/comments/utils.js +function describeNodeForDebugging(node) { + const nodeType = node.type || node.kind || "(unknown type)"; + let nodeName = String( + node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || "" + ); + if (nodeName.length > 20) { + nodeName = nodeName.slice(0, 19) + "\u2026"; + } + return nodeType + (nodeName ? " " + nodeName : ""); +} +function addCommentHelper(node, comment) { + const comments = node.comments ?? (node.comments = []); + comments.push(comment); + comment.printed = false; + comment.nodeDescription = describeNodeForDebugging(node); +} +function addLeadingComment(node, comment) { + comment.leading = true; + comment.trailing = false; + addCommentHelper(node, comment); +} +function addDanglingComment(node, comment, marker) { + comment.leading = false; + comment.trailing = false; + if (marker) { + comment.marker = marker; + } + addCommentHelper(node, comment); +} +function addTrailingComment(node, comment) { + comment.leading = false; + comment.trailing = true; + addCommentHelper(node, comment); +} +var init_utils = __esm({ + "src/main/comments/utils.js"() { + } +}); + +// src/utils/get-alignment-size.js +function getAlignmentSize(text, tabWidth, startIndex = 0) { + let size = 0; + for (let i = startIndex; i < text.length; ++i) { + if (text[i] === " ") { + size = size + tabWidth - size % tabWidth; + } else { + size++; + } + } + return size; +} +var get_alignment_size_default; +var init_get_alignment_size = __esm({ + "src/utils/get-alignment-size.js"() { + get_alignment_size_default = getAlignmentSize; + } +}); + +// src/utils/get-indent-size.js +function getIndentSize(value, tabWidth) { + const lastNewlineIndex = value.lastIndexOf("\n"); + if (lastNewlineIndex === -1) { + return 0; + } + return get_alignment_size_default( + // All the leading whitespaces + value.slice(lastNewlineIndex + 1).match(/^[\t ]*/u)[0], + tabWidth + ); +} +var get_indent_size_default; +var init_get_indent_size = __esm({ + "src/utils/get-indent-size.js"() { + init_get_alignment_size(); + get_indent_size_default = getIndentSize; + } +}); + +// node_modules/escape-string-regexp/index.js +function escapeStringRegexp(string) { + if (typeof string !== "string") { + throw new TypeError("Expected a string"); + } + return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} +var init_escape_string_regexp = __esm({ + "node_modules/escape-string-regexp/index.js"() { + } +}); + +// src/utils/get-max-continuous-count.js +function getMaxContinuousCount(text, searchString) { + const results = text.match( + new RegExp(`(${escapeStringRegexp(searchString)})+`, "gu") + ); + if (results === null) { + return 0; + } + return results.reduce( + (maxCount, result) => Math.max(maxCount, result.length / searchString.length), + 0 + ); +} +var get_max_continuous_count_default; +var init_get_max_continuous_count = __esm({ + "src/utils/get-max-continuous-count.js"() { + init_escape_string_regexp(); + get_max_continuous_count_default = getMaxContinuousCount; + } +}); + +// src/utils/get-next-non-space-non-comment-character.js +function getNextNonSpaceNonCommentCharacter(text, startIndex) { + const index = get_next_non_space_non_comment_character_index_default(text, startIndex); + return index === false ? "" : text.charAt(index); +} +var get_next_non_space_non_comment_character_default; +var init_get_next_non_space_non_comment_character = __esm({ + "src/utils/get-next-non-space-non-comment-character.js"() { + init_get_next_non_space_non_comment_character_index(); + get_next_non_space_non_comment_character_default = getNextNonSpaceNonCommentCharacter; + } +}); + +// src/utils/get-preferred-quote.js +function getPreferredQuote(text, preferredQuoteOrPreferSingleQuote) { + const preferred = preferredQuoteOrPreferSingleQuote === true || preferredQuoteOrPreferSingleQuote === SINGLE_QUOTE ? SINGLE_QUOTE : DOUBLE_QUOTE; + const alternate = preferred === SINGLE_QUOTE ? DOUBLE_QUOTE : SINGLE_QUOTE; + let preferredQuoteCount = 0; + let alternateQuoteCount = 0; + for (const character of text) { + if (character === preferred) { + preferredQuoteCount++; + } else if (character === alternate) { + alternateQuoteCount++; + } + } + return preferredQuoteCount > alternateQuoteCount ? alternate : preferred; +} +var SINGLE_QUOTE, DOUBLE_QUOTE, get_preferred_quote_default; +var init_get_preferred_quote = __esm({ + "src/utils/get-preferred-quote.js"() { + SINGLE_QUOTE = "'"; + DOUBLE_QUOTE = '"'; + get_preferred_quote_default = getPreferredQuote; + } +}); + +// node_modules/emoji-regex/index.mjs +var emoji_regex_default; +var init_emoji_regex = __esm({ + "node_modules/emoji-regex/index.mjs"() { + emoji_regex_default = () => { + return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; + }; + } +}); + +// node_modules/get-east-asian-width/lookup.js +function isFullWidth(x) { + return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510; +} +function isWide(x) { + return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141; +} +var init_lookup = __esm({ + "node_modules/get-east-asian-width/lookup.js"() { + } +}); + +// node_modules/get-east-asian-width/index.js +var _isNarrowWidth; +var init_get_east_asian_width = __esm({ + "node_modules/get-east-asian-width/index.js"() { + init_lookup(); + _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint)); + } +}); + +// src/utils/get-string-width.js +function getStringWidth(text) { + if (!text) { + return 0; + } + if (!notAsciiRegex.test(text)) { + return text.length; + } + text = text.replace(emoji_regex_default(), " "); + let width = 0; + for (const character of text) { + const codePoint = character.codePointAt(0); + if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { + continue; + } + if (codePoint >= 768 && codePoint <= 879) { + continue; + } + width += _isNarrowWidth(codePoint) ? 1 : 2; + } + return width; +} +var notAsciiRegex, get_string_width_default; +var init_get_string_width = __esm({ + "src/utils/get-string-width.js"() { + init_emoji_regex(); + init_get_east_asian_width(); + notAsciiRegex = /[^\x20-\x7F]/u; + get_string_width_default = getStringWidth; + } +}); + +// src/utils/has-newline-in-range.js +function hasNewlineInRange(text, startIndex, endIndex) { + for (let i = startIndex; i < endIndex; ++i) { + if (text.charAt(i) === "\n") { + return true; + } + } + return false; +} +var has_newline_in_range_default; +var init_has_newline_in_range = __esm({ + "src/utils/has-newline-in-range.js"() { + has_newline_in_range_default = hasNewlineInRange; + } +}); + +// src/utils/has-spaces.js +function hasSpaces(text, startIndex, options = {}) { + const idx = skipSpaces( + text, + options.backwards ? startIndex - 1 : startIndex, + options + ); + return idx !== startIndex; +} +var has_spaces_default; +var init_has_spaces = __esm({ + "src/utils/has-spaces.js"() { + init_skip(); + has_spaces_default = hasSpaces; + } +}); + +// scripts/build/shims/string-replace-all.js +var stringReplaceAll, string_replace_all_default; +var init_string_replace_all = __esm({ + "scripts/build/shims/string-replace-all.js"() { + stringReplaceAll = (isOptionalObject, original, pattern, replacement) => { + if (isOptionalObject && (original === void 0 || original === null)) { + return; + } + if (original.replaceAll) { + return original.replaceAll(pattern, replacement); + } + if (pattern.global) { + return original.replace(pattern, replacement); + } + return original.split(pattern).join(replacement); + }; + string_replace_all_default = stringReplaceAll; + } +}); + +// src/utils/make-string.js +function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) { + const otherQuote = enclosingQuote === '"' ? "'" : '"'; + const regex = /\\(.)|(["'])/gsu; + const raw = string_replace_all_default( + /* isOptionalObject */ + false, + rawText, + regex, + (match, escaped, quote) => { + if (escaped === otherQuote) { + return escaped; + } + if (quote === enclosingQuote) { + return "\\" + quote; + } + if (quote) { + return quote; + } + return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(escaped) ? escaped : "\\" + escaped; + } + ); + return enclosingQuote + raw + enclosingQuote; +} +var make_string_default; +var init_make_string = __esm({ + "src/utils/make-string.js"() { + init_string_replace_all(); + make_string_default = makeString; + } +}); + +// src/utils/public.js +var public_exports = {}; +__export(public_exports, { + addDanglingComment: () => addDanglingComment, + addLeadingComment: () => addLeadingComment, + addTrailingComment: () => addTrailingComment, + getAlignmentSize: () => get_alignment_size_default, + getIndentSize: () => get_indent_size_default, + getMaxContinuousCount: () => get_max_continuous_count_default, + getNextNonSpaceNonCommentCharacter: () => get_next_non_space_non_comment_character_default, + getNextNonSpaceNonCommentCharacterIndex: () => getNextNonSpaceNonCommentCharacterIndex2, + getPreferredQuote: () => get_preferred_quote_default, + getStringWidth: () => get_string_width_default, + hasNewline: () => has_newline_default, + hasNewlineInRange: () => has_newline_in_range_default, + hasSpaces: () => has_spaces_default, + isNextLineEmpty: () => isNextLineEmpty2, + isNextLineEmptyAfterIndex: () => is_next_line_empty_default, + isPreviousLineEmpty: () => isPreviousLineEmpty2, + makeString: () => make_string_default, + skip: () => skip, + skipEverythingButNewLine: () => skipEverythingButNewLine, + skipInlineComment: () => skip_inline_comment_default, + skipNewline: () => skip_newline_default, + skipSpaces: () => skipSpaces, + skipToLineEnd: () => skipToLineEnd, + skipTrailingComment: () => skip_trailing_comment_default, + skipWhitespace: () => skipWhitespace +}); +function legacyGetNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) { + return get_next_non_space_non_comment_character_index_default( + text, + locEnd(node) + ); +} +function getNextNonSpaceNonCommentCharacterIndex2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? get_next_non_space_non_comment_character_index_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyGetNextNonSpaceNonCommentCharacterIndex(...arguments) + ); +} +function legacyIsPreviousLineEmpty(text, node, locStart) { + return is_previous_line_empty_default(text, locStart(node)); +} +function isPreviousLineEmpty2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? is_previous_line_empty_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyIsPreviousLineEmpty(...arguments) + ); +} +function legacyIsNextLineEmpty(text, node, locEnd) { + return is_next_line_empty_default(text, locEnd(node)); +} +function isNextLineEmpty2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? is_next_line_empty_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyIsNextLineEmpty(...arguments) + ); +} +var init_public = __esm({ + "src/utils/public.js"() { + init_get_next_non_space_non_comment_character_index(); + init_is_next_line_empty(); + init_is_previous_line_empty(); + init_utils(); + init_get_alignment_size(); + init_get_indent_size(); + init_get_max_continuous_count(); + init_get_next_non_space_non_comment_character(); + init_get_preferred_quote(); + init_get_string_width(); + init_has_newline(); + init_has_newline_in_range(); + init_has_spaces(); + init_make_string(); + init_skip(); + init_skip_inline_comment(); + init_skip_newline(); + init_skip_trailing_comment(); + } +}); + +// src/main/version.evaluate.cjs +var require_version_evaluate = __commonJS({ + "src/main/version.evaluate.cjs"(exports2, module2) { + module2.exports = "3.5.3"; + } +}); + +// src/index.cjs +var prettierPromise = import("./index.mjs"); +var functionNames = [ + "formatWithCursor", + "format", + "check", + "resolveConfig", + "resolveConfigFile", + "clearConfigCache", + "getFileInfo", + "getSupportInfo" +]; +var prettier = /* @__PURE__ */ Object.create(null); +for (const name of functionNames) { + prettier[name] = async (...args) => { + const prettier2 = await prettierPromise; + return prettier2[name](...args); + }; +} +var debugApiFunctionNames = [ + "parse", + "formatAST", + "formatDoc", + "printToDoc", + "printDocToString" +]; +var debugApis = /* @__PURE__ */ Object.create(null); +for (const name of debugApiFunctionNames) { + debugApis[name] = async (...args) => { + const prettier2 = await prettierPromise; + return prettier2.__debug[name](...args); + }; +} +prettier.__debug = debugApis; +if (true) { + prettier.util = (init_public(), __toCommonJS(public_exports)); + prettier.doc = require("./doc.js"); +} else { + Object.defineProperties(prettier, { + util: { + get() { + try { + return null; + } catch { + } + throw new Error( + "prettier.util is not available in development CommonJS version" + ); + } + }, + doc: { + get() { + try { + return null; + } catch { + } + throw new Error( + "prettier.doc is not available in development CommonJS version" + ); + } + } + }); +} +prettier.version = require_version_evaluate(); +module.exports = prettier; diff --git a/node_modules/prettier/index.mjs b/node_modules/prettier/index.mjs new file mode 100644 index 0000000..0c03045 --- /dev/null +++ b/node_modules/prettier/index.mjs @@ -0,0 +1,22242 @@ +import { createRequire as __prettierCreateRequire } from "module"; +import { fileURLToPath as __prettierFileUrlToPath } from "url"; +import { dirname as __prettierDirname } from "path"; +const require = __prettierCreateRequire(import.meta.url); +const __filename = __prettierFileUrlToPath(import.meta.url); +const __dirname = __prettierDirname(__filename); + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; +var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] +}) : x)(function(x) { + if (typeof require !== "undefined") return require.apply(this, arguments); + throw Error('Dynamic require of "' + x + '" is not supported'); +}); +var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key2 of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key2) && key2 !== except) + __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); + +// node_modules/fast-glob/out/utils/array.js +var require_array = __commonJS({ + "node_modules/fast-glob/out/utils/array.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.splitWhen = exports.flatten = void 0; + function flatten(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); + } + exports.flatten = flatten; + function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } else { + result[groupIndex].push(item); + } + } + return result; + } + exports.splitWhen = splitWhen; + } +}); + +// node_modules/fast-glob/out/utils/errno.js +var require_errno = __commonJS({ + "node_modules/fast-glob/out/utils/errno.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isEnoentCodeError = void 0; + function isEnoentCodeError(error) { + return error.code === "ENOENT"; + } + exports.isEnoentCodeError = isEnoentCodeError; + } +}); + +// node_modules/fast-glob/out/utils/fs.js +var require_fs = __commonJS({ + "node_modules/fast-glob/out/utils/fs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createDirentFromStats = void 0; + var DirentFromStats = class { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } + }; + function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); + } + exports.createDirentFromStats = createDirentFromStats; + } +}); + +// node_modules/fast-glob/out/utils/path.js +var require_path = __commonJS({ + "node_modules/fast-glob/out/utils/path.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; + var os2 = __require("os"); + var path13 = __require("path"); + var IS_WINDOWS_PLATFORM = os2.platform() === "win32"; + var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; + var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; + var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g; + var DOS_DEVICE_PATH_RE = /^\\\\([.?])/; + var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g; + function unixify(filepath) { + return filepath.replace(/\\/g, "/"); + } + exports.unixify = unixify; + function makeAbsolute(cwd, filepath) { + return path13.resolve(cwd, filepath); + } + exports.makeAbsolute = makeAbsolute; + function removeLeadingDotSegment(entry) { + if (entry.charAt(0) === ".") { + const secondCharactery = entry.charAt(1); + if (secondCharactery === "/" || secondCharactery === "\\") { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); + } + } + return entry; + } + exports.removeLeadingDotSegment = removeLeadingDotSegment; + exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; + function escapeWindowsPath(pattern) { + return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); + } + exports.escapeWindowsPath = escapeWindowsPath; + function escapePosixPath(pattern) { + return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); + } + exports.escapePosixPath = escapePosixPath; + exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; + function convertWindowsPathToPattern(filepath) { + return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/"); + } + exports.convertWindowsPathToPattern = convertWindowsPathToPattern; + function convertPosixPathToPattern(filepath) { + return escapePosixPath(filepath); + } + exports.convertPosixPathToPattern = convertPosixPathToPattern; + } +}); + +// node_modules/is-extglob/index.js +var require_is_extglob = __commonJS({ + "node_modules/is-extglob/index.js"(exports, module) { + module.exports = function isExtglob(str2) { + if (typeof str2 !== "string" || str2 === "") { + return false; + } + var match; + while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str2)) { + if (match[2]) return true; + str2 = str2.slice(match.index + match[0].length); + } + return false; + }; + } +}); + +// node_modules/is-glob/index.js +var require_is_glob = __commonJS({ + "node_modules/is-glob/index.js"(exports, module) { + var isExtglob = require_is_extglob(); + var chars = { "{": "}", "(": ")", "[": "]" }; + var strictCheck = function(str2) { + if (str2[0] === "!") { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str2.length) { + if (str2[index] === "*") { + return true; + } + if (str2[index + 1] === "?" && /[\].+)]/.test(str2[index])) { + return true; + } + if (closeSquareIndex !== -1 && str2[index] === "[" && str2[index + 1] !== "]") { + if (closeSquareIndex < index) { + closeSquareIndex = str2.indexOf("]", index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str2.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + if (closeCurlyIndex !== -1 && str2[index] === "{" && str2[index + 1] !== "}") { + closeCurlyIndex = str2.indexOf("}", index); + if (closeCurlyIndex > index) { + backSlashIndex = str2.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + if (closeParenIndex !== -1 && str2[index] === "(" && str2[index + 1] === "?" && /[:!=]/.test(str2[index + 2]) && str2[index + 3] !== ")") { + closeParenIndex = str2.indexOf(")", index); + if (closeParenIndex > index) { + backSlashIndex = str2.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + if (pipeIndex !== -1 && str2[index] === "(" && str2[index + 1] !== "|") { + if (pipeIndex < index) { + pipeIndex = str2.indexOf("|", index); + } + if (pipeIndex !== -1 && str2[pipeIndex + 1] !== ")") { + closeParenIndex = str2.indexOf(")", pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str2.indexOf("\\", pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + if (str2[index] === "\\") { + var open = str2[index + 1]; + index += 2; + var close = chars[open]; + if (close) { + var n = str2.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + if (str2[index] === "!") { + return true; + } + } else { + index++; + } + } + return false; + }; + var relaxedCheck = function(str2) { + if (str2[0] === "!") { + return true; + } + var index = 0; + while (index < str2.length) { + if (/[*?{}()[\]]/.test(str2[index])) { + return true; + } + if (str2[index] === "\\") { + var open = str2[index + 1]; + index += 2; + var close = chars[open]; + if (close) { + var n = str2.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + if (str2[index] === "!") { + return true; + } + } else { + index++; + } + } + return false; + }; + module.exports = function isGlob(str2, options8) { + if (typeof str2 !== "string" || str2 === "") { + return false; + } + if (isExtglob(str2)) { + return true; + } + var check2 = strictCheck; + if (options8 && options8.strict === false) { + check2 = relaxedCheck; + } + return check2(str2); + }; + } +}); + +// node_modules/glob-parent/index.js +var require_glob_parent = __commonJS({ + "node_modules/glob-parent/index.js"(exports, module) { + "use strict"; + var isGlob = require_is_glob(); + var pathPosixDirname = __require("path").posix.dirname; + var isWin32 = __require("os").platform() === "win32"; + var slash2 = "/"; + var backslash = /\\/g; + var enclosure = /[\{\[].*[\}\]]$/; + var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; + var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + module.exports = function globParent(str2, opts) { + var options8 = Object.assign({ flipBackslashes: true }, opts); + if (options8.flipBackslashes && isWin32 && str2.indexOf(slash2) < 0) { + str2 = str2.replace(backslash, slash2); + } + if (enclosure.test(str2)) { + str2 += slash2; + } + str2 += "a"; + do { + str2 = pathPosixDirname(str2); + } while (isGlob(str2) || globby.test(str2)); + return str2.replace(escaped, "$1"); + }; + } +}); + +// node_modules/braces/lib/utils.js +var require_utils = __commonJS({ + "node_modules/braces/lib/utils.js"(exports) { + "use strict"; + exports.isInteger = (num) => { + if (typeof num === "number") { + return Number.isInteger(num); + } + if (typeof num === "string" && num.trim() !== "") { + return Number.isInteger(Number(num)); + } + return false; + }; + exports.find = (node, type2) => node.nodes.find((node2) => node2.type === type2); + exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return (Number(max) - Number(min)) / Number(step) >= limit; + }; + exports.escapeNode = (block, n = 0, type2) => { + const node = block.nodes[n]; + if (!node) return; + if (type2 && node.type === type2 || node.type === "open" || node.type === "close") { + if (node.escaped !== true) { + node.value = "\\" + node.value; + node.escaped = true; + } + } + }; + exports.encloseBrace = (node) => { + if (node.type !== "brace") return false; + if (node.commas >> 0 + node.ranges >> 0 === 0) { + node.invalid = true; + return true; + } + return false; + }; + exports.isInvalidBrace = (block) => { + if (block.type !== "brace") return false; + if (block.invalid === true || block.dollar) return true; + if (block.commas >> 0 + block.ranges >> 0 === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; + }; + exports.isOpenOrClose = (node) => { + if (node.type === "open" || node.type === "close") { + return true; + } + return node.open === true || node.close === true; + }; + exports.reduce = (nodes) => nodes.reduce((acc, node) => { + if (node.type === "text") acc.push(node.value); + if (node.type === "range") node.type = "text"; + return acc; + }, []); + exports.flatten = (...args) => { + const result = []; + const flat = (arr) => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + if (Array.isArray(ele)) { + flat(ele); + continue; + } + if (ele !== void 0) { + result.push(ele); + } + } + return result; + }; + flat(args); + return result; + }; + } +}); + +// node_modules/braces/lib/stringify.js +var require_stringify = __commonJS({ + "node_modules/braces/lib/stringify.js"(exports, module) { + "use strict"; + var utils = require_utils(); + module.exports = (ast, options8 = {}) => { + const stringify2 = (node, parent = {}) => { + const invalidBlock = options8.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options8.escapeInvalid === true; + let output = ""; + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return "\\" + node.value; + } + return node.value; + } + if (node.value) { + return node.value; + } + if (node.nodes) { + for (const child of node.nodes) { + output += stringify2(child); + } + } + return output; + }; + return stringify2(ast); + }; + } +}); + +// node_modules/is-number/index.js +var require_is_number = __commonJS({ + "node_modules/is-number/index.js"(exports, module) { + "use strict"; + module.exports = function(num) { + if (typeof num === "number") { + return num - num === 0; + } + if (typeof num === "string" && num.trim() !== "") { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; + }; + } +}); + +// node_modules/to-regex-range/index.js +var require_to_regex_range = __commonJS({ + "node_modules/to-regex-range/index.js"(exports, module) { + "use strict"; + var isNumber = require_is_number(); + var toRegexRange = (min, max, options8) => { + if (isNumber(min) === false) { + throw new TypeError("toRegexRange: expected the first argument to be a number"); + } + if (max === void 0 || min === max) { + return String(min); + } + if (isNumber(max) === false) { + throw new TypeError("toRegexRange: expected the second argument to be a number."); + } + let opts = { relaxZeros: true, ...options8 }; + if (typeof opts.strictZeros === "boolean") { + opts.relaxZeros = opts.strictZeros === false; + } + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap; + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + let a = Math.min(min, max); + let b = Math.max(min, max); + if (Math.abs(a - b) === 1) { + let result = min + "|" + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives, opts); + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && positives.length + negatives.length > 1) { + state.result = `(?:${state.result})`; + } + toRegexRange.cache[cacheKey] = state; + return state.result; + }; + function collatePatterns(neg, pos2, options8) { + let onlyNegative = filterPatterns(neg, pos2, "-", false, options8) || []; + let onlyPositive = filterPatterns(pos2, neg, "", false, options8) || []; + let intersected = filterPatterns(neg, pos2, "-?", true, options8) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join("|"); + } + function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + let stop = countNines(min, nines); + let stops = /* @__PURE__ */ new Set([max]); + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + stop = countZeros(max + 1, zeros) - 1; + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + stops = [...stops]; + stops.sort(compare); + return stops; + } + function rangeToPattern(start, stop, options8) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ""; + let count = 0; + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + if (startDigit === stopDigit) { + pattern += startDigit; + } else if (startDigit !== "0" || stopDigit !== "9") { + pattern += toCharacterClass(startDigit, stopDigit, options8); + } else { + count++; + } + } + if (count) { + pattern += options8.shorthand === true ? "\\d" : "[0-9]"; + } + return { pattern, count: [count], digits }; + } + function splitToPatterns(min, max, tok, options8) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + for (let i = 0; i < ranges.length; i++) { + let max2 = ranges[i]; + let obj = rangeToPattern(String(start), String(max2), options8); + let zeros = ""; + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max2 + 1; + continue; + } + if (tok.isPadded) { + zeros = padZeros(max2, tok, options8); + } + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max2 + 1; + prev = obj; + } + return tokens; + } + function filterPatterns(arr, comparison, prefix, intersection, options8) { + let result = []; + for (let ele of arr) { + let { string } = ele; + if (!intersection && !contains(comparison, "string", string)) { + result.push(prefix + string); + } + if (intersection && contains(comparison, "string", string)) { + result.push(prefix + string); + } + } + return result; + } + function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; + } + function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; + } + function contains(arr, key2, val) { + return arr.some((ele) => ele[key2] === val); + } + function countNines(min, len) { + return Number(String(min).slice(0, -len) + "9".repeat(len)); + } + function countZeros(integer, zeros) { + return integer - integer % Math.pow(10, zeros); + } + function toQuantifier(digits) { + let [start = 0, stop = ""] = digits; + if (stop || start > 1) { + return `{${start + (stop ? "," + stop : "")}}`; + } + return ""; + } + function toCharacterClass(a, b, options8) { + return `[${a}${b - a === 1 ? "" : "-"}${b}]`; + } + function hasPadding(str2) { + return /^-?(0+)\d/.test(str2); + } + function padZeros(value, tok, options8) { + if (!tok.isPadded) { + return value; + } + let diff2 = Math.abs(tok.maxLen - String(value).length); + let relax = options8.relaxZeros !== false; + switch (diff2) { + case 0: + return ""; + case 1: + return relax ? "0?" : "0"; + case 2: + return relax ? "0{0,2}" : "00"; + default: { + return relax ? `0{0,${diff2}}` : `0{${diff2}}`; + } + } + } + toRegexRange.cache = {}; + toRegexRange.clearCache = () => toRegexRange.cache = {}; + module.exports = toRegexRange; + } +}); + +// node_modules/fill-range/index.js +var require_fill_range = __commonJS({ + "node_modules/fill-range/index.js"(exports, module) { + "use strict"; + var util2 = __require("util"); + var toRegexRange = require_to_regex_range(); + var isObject3 = (val) => val !== null && typeof val === "object" && !Array.isArray(val); + var transform = (toNumber) => { + return (value) => toNumber === true ? Number(value) : String(value); + }; + var isValidValue = (value) => { + return typeof value === "number" || typeof value === "string" && value !== ""; + }; + var isNumber = (num) => Number.isInteger(+num); + var zeros = (input) => { + let value = `${input}`; + let index = -1; + if (value[0] === "-") value = value.slice(1); + if (value === "0") return false; + while (value[++index] === "0") ; + return index > 0; + }; + var stringify2 = (start, end, options8) => { + if (typeof start === "string" || typeof end === "string") { + return true; + } + return options8.stringify === true; + }; + var pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === "-" ? "-" : ""; + if (dash) input = input.slice(1); + input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0"); + } + if (toNumber === false) { + return String(input); + } + return input; + }; + var toMaxLen = (input, maxLength) => { + let negative = input[0] === "-" ? "-" : ""; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = "0" + input; + return negative ? "-" + input : input; + }; + var toSequence = (parts, options8, maxLen) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + let prefix = options8.capture ? "" : "?:"; + let positives = ""; + let negatives = ""; + let result; + if (parts.positives.length) { + positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|"); + } + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`; + } + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + if (options8.wrap) { + return `(${prefix}${result})`; + } + return result; + }; + var toRange = (a, b, isNumbers, options8) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options8 }); + } + let start = String.fromCharCode(a); + if (a === b) return start; + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; + }; + var toRegex = (start, end, options8) => { + if (Array.isArray(start)) { + let wrap = options8.wrap === true; + let prefix = options8.capture ? "" : "?:"; + return wrap ? `(${prefix}${start.join("|")})` : start.join("|"); + } + return toRegexRange(start, end, options8); + }; + var rangeError = (...args) => { + return new RangeError("Invalid range arguments: " + util2.inspect(...args)); + }; + var invalidRange = (start, end, options8) => { + if (options8.strictRanges === true) throw rangeError([start, end]); + return []; + }; + var invalidStep = (step, options8) => { + if (options8.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; + }; + var fillNumbers = (start, end, step = 1, options8 = {}) => { + let a = Number(start); + let b = Number(end); + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options8.strictRanges === true) throw rangeError([start, end]); + return []; + } + if (a === 0) a = 0; + if (b === 0) b = 0; + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify2(start, end, options8) === false; + let format3 = options8.transform || transform(toNumber); + if (options8.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options8); + } + let parts = { negatives: [], positives: [] }; + let push2 = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)); + let range = []; + let index = 0; + while (descending ? a >= b : a <= b) { + if (options8.toRegex === true && step > 1) { + push2(a); + } else { + range.push(pad(format3(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + if (options8.toRegex === true) { + return step > 1 ? toSequence(parts, options8, maxLen) : toRegex(range, null, { wrap: false, ...options8 }); + } + return range; + }; + var fillLetters = (start, end, step = 1, options8 = {}) => { + if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) { + return invalidRange(start, end, options8); + } + let format3 = options8.transform || ((val) => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + if (options8.toRegex && step === 1) { + return toRange(min, max, false, options8); + } + let range = []; + let index = 0; + while (descending ? a >= b : a <= b) { + range.push(format3(a, index)); + a = descending ? a - step : a + step; + index++; + } + if (options8.toRegex === true) { + return toRegex(range, null, { wrap: false, options: options8 }); + } + return range; + }; + var fill = (start, end, step, options8 = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options8); + } + if (typeof step === "function") { + return fill(start, end, 1, { transform: step }); + } + if (isObject3(step)) { + return fill(start, end, 0, step); + } + let opts = { ...options8 }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + if (!isNumber(step)) { + if (step != null && !isObject3(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); + }; + module.exports = fill; + } +}); + +// node_modules/braces/lib/compile.js +var require_compile = __commonJS({ + "node_modules/braces/lib/compile.js"(exports, module) { + "use strict"; + var fill = require_fill_range(); + var utils = require_utils(); + var compile = (ast, options8 = {}) => { + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options8.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options8.escapeInvalid === true ? "\\" : ""; + let output = ""; + if (node.isOpen === true) { + return prefix + node.value; + } + if (node.isClose === true) { + console.log("node.isClose", prefix, node.value); + return prefix + node.value; + } + if (node.type === "open") { + return invalid ? prefix + node.value : "("; + } + if (node.type === "close") { + return invalid ? prefix + node.value : ")"; + } + if (node.type === "comma") { + return node.prev.type === "comma" ? "" : invalid ? node.value : "|"; + } + if (node.value) { + return node.value; + } + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options8, wrap: false, toRegex: true, strictZeros: true }); + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + return output; + }; + return walk(ast); + }; + module.exports = compile; + } +}); + +// node_modules/braces/lib/expand.js +var require_expand = __commonJS({ + "node_modules/braces/lib/expand.js"(exports, module) { + "use strict"; + var fill = require_fill_range(); + var stringify2 = require_stringify(); + var utils = require_utils(); + var append = (queue = "", stash = "", enclose = false) => { + const result = []; + queue = [].concat(queue); + stash = [].concat(stash); + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash; + } + for (const item of queue) { + if (Array.isArray(item)) { + for (const value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === "string") ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); + } + } + } + return utils.flatten(result); + }; + var expand = (ast, options8 = {}) => { + const rangeLimit = options8.rangeLimit === void 0 ? 1e3 : options8.rangeLimit; + const walk = (node, parent = {}) => { + node.queue = []; + let p = parent; + let q = parent.queue; + while (p.type !== "brace" && p.type !== "root" && p.parent) { + p = p.parent; + q = p.queue; + } + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify2(node, options8))); + return; + } + if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ["{}"])); + return; + } + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + if (utils.exceedsLimit(...args, options8.step, rangeLimit)) { + throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit."); + } + let range = fill(...args, options8); + if (range.length === 0) { + range = stringify2(node, options8); + } + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + const enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + while (block.type !== "brace" && block.type !== "root" && block.parent) { + block = block.parent; + queue = block.queue; + } + for (let i = 0; i < node.nodes.length; i++) { + const child = node.nodes[i]; + if (child.type === "comma" && node.type === "brace") { + if (i === 1) queue.push(""); + queue.push(""); + continue; + } + if (child.type === "close") { + q.push(append(q.pop(), queue, enclose)); + continue; + } + if (child.value && child.type !== "open") { + queue.push(append(queue.pop(), child.value)); + continue; + } + if (child.nodes) { + walk(child, node); + } + } + return queue; + }; + return utils.flatten(walk(ast)); + }; + module.exports = expand; + } +}); + +// node_modules/braces/lib/constants.js +var require_constants = __commonJS({ + "node_modules/braces/lib/constants.js"(exports, module) { + "use strict"; + module.exports = { + MAX_LENGTH: 1e4, + // Digits + CHAR_0: "0", + /* 0 */ + CHAR_9: "9", + /* 9 */ + // Alphabet chars. + CHAR_UPPERCASE_A: "A", + /* A */ + CHAR_LOWERCASE_A: "a", + /* a */ + CHAR_UPPERCASE_Z: "Z", + /* Z */ + CHAR_LOWERCASE_Z: "z", + /* z */ + CHAR_LEFT_PARENTHESES: "(", + /* ( */ + CHAR_RIGHT_PARENTHESES: ")", + /* ) */ + CHAR_ASTERISK: "*", + /* * */ + // Non-alphabetic chars. + CHAR_AMPERSAND: "&", + /* & */ + CHAR_AT: "@", + /* @ */ + CHAR_BACKSLASH: "\\", + /* \ */ + CHAR_BACKTICK: "`", + /* ` */ + CHAR_CARRIAGE_RETURN: "\r", + /* \r */ + CHAR_CIRCUMFLEX_ACCENT: "^", + /* ^ */ + CHAR_COLON: ":", + /* : */ + CHAR_COMMA: ",", + /* , */ + CHAR_DOLLAR: "$", + /* . */ + CHAR_DOT: ".", + /* . */ + CHAR_DOUBLE_QUOTE: '"', + /* " */ + CHAR_EQUAL: "=", + /* = */ + CHAR_EXCLAMATION_MARK: "!", + /* ! */ + CHAR_FORM_FEED: "\f", + /* \f */ + CHAR_FORWARD_SLASH: "/", + /* / */ + CHAR_HASH: "#", + /* # */ + CHAR_HYPHEN_MINUS: "-", + /* - */ + CHAR_LEFT_ANGLE_BRACKET: "<", + /* < */ + CHAR_LEFT_CURLY_BRACE: "{", + /* { */ + CHAR_LEFT_SQUARE_BRACKET: "[", + /* [ */ + CHAR_LINE_FEED: "\n", + /* \n */ + CHAR_NO_BREAK_SPACE: "\xA0", + /* \u00A0 */ + CHAR_PERCENT: "%", + /* % */ + CHAR_PLUS: "+", + /* + */ + CHAR_QUESTION_MARK: "?", + /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: ">", + /* > */ + CHAR_RIGHT_CURLY_BRACE: "}", + /* } */ + CHAR_RIGHT_SQUARE_BRACKET: "]", + /* ] */ + CHAR_SEMICOLON: ";", + /* ; */ + CHAR_SINGLE_QUOTE: "'", + /* ' */ + CHAR_SPACE: " ", + /* */ + CHAR_TAB: " ", + /* \t */ + CHAR_UNDERSCORE: "_", + /* _ */ + CHAR_VERTICAL_LINE: "|", + /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF" + /* \uFEFF */ + }; + } +}); + +// node_modules/braces/lib/parse.js +var require_parse = __commonJS({ + "node_modules/braces/lib/parse.js"(exports, module) { + "use strict"; + var stringify2 = require_stringify(); + var { + MAX_LENGTH, + CHAR_BACKSLASH, + /* \ */ + CHAR_BACKTICK, + /* ` */ + CHAR_COMMA, + /* , */ + CHAR_DOT, + /* . */ + CHAR_LEFT_PARENTHESES, + /* ( */ + CHAR_RIGHT_PARENTHESES, + /* ) */ + CHAR_LEFT_CURLY_BRACE, + /* { */ + CHAR_RIGHT_CURLY_BRACE, + /* } */ + CHAR_LEFT_SQUARE_BRACKET, + /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, + /* ] */ + CHAR_DOUBLE_QUOTE, + /* " */ + CHAR_SINGLE_QUOTE, + /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE + } = require_constants(); + var parse7 = (input, options8 = {}) => { + if (typeof input !== "string") { + throw new TypeError("Expected a string"); + } + const opts = options8 || {}; + const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + const ast = { type: "root", input, nodes: [] }; + const stack2 = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + const advance = () => input[index++]; + const push2 = (node) => { + if (node.type === "text" && prev.type === "dot") { + prev.type = "text"; + } + if (prev && prev.type === "text" && node.type === "text") { + prev.value += node.value; + return; + } + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + push2({ type: "bos" }); + while (index < length) { + block = stack2[stack2.length - 1]; + value = advance(); + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + if (value === CHAR_BACKSLASH) { + push2({ type: "text", value: (options8.keepEscaping ? value : "") + advance() }); + continue; + } + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push2({ type: "text", value: "\\" + value }); + continue; + } + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + let next; + while (index < length && (next = advance())) { + value += next; + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + if (brackets === 0) { + break; + } + } + } + push2({ type: "text", value }); + continue; + } + if (value === CHAR_LEFT_PARENTHESES) { + block = push2({ type: "paren", nodes: [] }); + stack2.push(block); + push2({ type: "text", value }); + continue; + } + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== "paren") { + push2({ type: "text", value }); + continue; + } + block = stack2.pop(); + push2({ type: "text", value }); + block = stack2[stack2.length - 1]; + continue; + } + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + const open = value; + let next; + if (options8.keepQuotes !== true) { + value = ""; + } + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + if (next === open) { + if (options8.keepQuotes === true) value += next; + break; + } + value += next; + } + push2({ type: "text", value }); + continue; + } + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true; + const brace = { + type: "brace", + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + block = push2(brace); + stack2.push(block); + push2({ type: "open", value }); + continue; + } + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== "brace") { + push2({ type: "text", value }); + continue; + } + const type2 = "close"; + block = stack2.pop(); + block.close = true; + push2({ type: type2, value }); + depth--; + block = stack2[stack2.length - 1]; + continue; + } + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + const open = block.nodes.shift(); + block.nodes = [open, { type: "text", value: stringify2(block) }]; + } + push2({ type: "comma", value }); + block.commas++; + continue; + } + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + const siblings = block.nodes; + if (depth === 0 || siblings.length === 0) { + push2({ type: "text", value }); + continue; + } + if (prev.type === "dot") { + block.range = []; + prev.value += value; + prev.type = "range"; + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = "text"; + continue; + } + block.ranges++; + block.args = []; + continue; + } + if (prev.type === "range") { + siblings.pop(); + const before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + push2({ type: "dot", value }); + continue; + } + push2({ type: "text", value }); + } + do { + block = stack2.pop(); + if (block.type !== "root") { + block.nodes.forEach((node) => { + if (!node.nodes) { + if (node.type === "open") node.isOpen = true; + if (node.type === "close") node.isClose = true; + if (!node.nodes) node.type = "text"; + node.invalid = true; + } + }); + const parent = stack2[stack2.length - 1]; + const index2 = parent.nodes.indexOf(block); + parent.nodes.splice(index2, 1, ...block.nodes); + } + } while (stack2.length > 0); + push2({ type: "eos" }); + return ast; + }; + module.exports = parse7; + } +}); + +// node_modules/braces/index.js +var require_braces = __commonJS({ + "node_modules/braces/index.js"(exports, module) { + "use strict"; + var stringify2 = require_stringify(); + var compile = require_compile(); + var expand = require_expand(); + var parse7 = require_parse(); + var braces = (input, options8 = {}) => { + let output = []; + if (Array.isArray(input)) { + for (const pattern of input) { + const result = braces.create(pattern, options8); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options8)); + } + if (options8 && options8.expand === true && options8.nodupes === true) { + output = [...new Set(output)]; + } + return output; + }; + braces.parse = (input, options8 = {}) => parse7(input, options8); + braces.stringify = (input, options8 = {}) => { + if (typeof input === "string") { + return stringify2(braces.parse(input, options8), options8); + } + return stringify2(input, options8); + }; + braces.compile = (input, options8 = {}) => { + if (typeof input === "string") { + input = braces.parse(input, options8); + } + return compile(input, options8); + }; + braces.expand = (input, options8 = {}) => { + if (typeof input === "string") { + input = braces.parse(input, options8); + } + let result = expand(input, options8); + if (options8.noempty === true) { + result = result.filter(Boolean); + } + if (options8.nodupes === true) { + result = [...new Set(result)]; + } + return result; + }; + braces.create = (input, options8 = {}) => { + if (input === "" || input.length < 3) { + return [input]; + } + return options8.expand !== true ? braces.compile(input, options8) : braces.expand(input, options8); + }; + module.exports = braces; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/constants.js +var require_constants2 = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/constants.js"(exports, module) { + "use strict"; + var path13 = __require("path"); + var WIN_SLASH = "\\\\/"; + var WIN_NO_SLASH = `[^${WIN_SLASH}]`; + var DOT_LITERAL = "\\."; + var PLUS_LITERAL = "\\+"; + var QMARK_LITERAL = "\\?"; + var SLASH_LITERAL = "\\/"; + var ONE_CHAR = "(?=.)"; + var QMARK = "[^/]"; + var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + var START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + var NO_DOT = `(?!${DOT_LITERAL})`; + var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + var STAR = `${QMARK}*?`; + var POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR + }; + var WINDOWS_CHARS = { + ...POSIX_CHARS, + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` + }; + var POSIX_REGEX_SOURCE = { + alnum: "a-zA-Z0-9", + alpha: "a-zA-Z", + ascii: "\\x00-\\x7F", + blank: " \\t", + cntrl: "\\x00-\\x1F\\x7F", + digit: "0-9", + graph: "\\x21-\\x7E", + lower: "a-z", + print: "\\x20-\\x7E ", + punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~", + space: " \\t\\r\\n\\v\\f", + upper: "A-Z", + word: "A-Za-z0-9_", + xdigit: "A-Fa-f0-9" + }; + module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + "***": "*", + "**/**": "**", + "**/**/**": "**" + }, + // Digits + CHAR_0: 48, + /* 0 */ + CHAR_9: 57, + /* 9 */ + // Alphabet chars. + CHAR_UPPERCASE_A: 65, + /* A */ + CHAR_LOWERCASE_A: 97, + /* a */ + CHAR_UPPERCASE_Z: 90, + /* Z */ + CHAR_LOWERCASE_Z: 122, + /* z */ + CHAR_LEFT_PARENTHESES: 40, + /* ( */ + CHAR_RIGHT_PARENTHESES: 41, + /* ) */ + CHAR_ASTERISK: 42, + /* * */ + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, + /* & */ + CHAR_AT: 64, + /* @ */ + CHAR_BACKWARD_SLASH: 92, + /* \ */ + CHAR_CARRIAGE_RETURN: 13, + /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, + /* ^ */ + CHAR_COLON: 58, + /* : */ + CHAR_COMMA: 44, + /* , */ + CHAR_DOT: 46, + /* . */ + CHAR_DOUBLE_QUOTE: 34, + /* " */ + CHAR_EQUAL: 61, + /* = */ + CHAR_EXCLAMATION_MARK: 33, + /* ! */ + CHAR_FORM_FEED: 12, + /* \f */ + CHAR_FORWARD_SLASH: 47, + /* / */ + CHAR_GRAVE_ACCENT: 96, + /* ` */ + CHAR_HASH: 35, + /* # */ + CHAR_HYPHEN_MINUS: 45, + /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, + /* < */ + CHAR_LEFT_CURLY_BRACE: 123, + /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, + /* [ */ + CHAR_LINE_FEED: 10, + /* \n */ + CHAR_NO_BREAK_SPACE: 160, + /* \u00A0 */ + CHAR_PERCENT: 37, + /* % */ + CHAR_PLUS: 43, + /* + */ + CHAR_QUESTION_MARK: 63, + /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, + /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, + /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, + /* ] */ + CHAR_SEMICOLON: 59, + /* ; */ + CHAR_SINGLE_QUOTE: 39, + /* ' */ + CHAR_SPACE: 32, + /* */ + CHAR_TAB: 9, + /* \t */ + CHAR_UNDERSCORE: 95, + /* _ */ + CHAR_VERTICAL_LINE: 124, + /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, + /* \uFEFF */ + SEP: path13.sep, + /** + * Create EXTGLOB_CHARS + */ + extglobChars(chars) { + return { + "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` }, + "?": { type: "qmark", open: "(?:", close: ")?" }, + "+": { type: "plus", open: "(?:", close: ")+" }, + "*": { type: "star", open: "(?:", close: ")*" }, + "@": { type: "at", open: "(?:", close: ")" } + }; + }, + /** + * Create GLOB_CHARS + */ + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } + }; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/utils.js +var require_utils2 = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/utils.js"(exports) { + "use strict"; + var path13 = __require("path"); + var win32 = process.platform === "win32"; + var { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = require_constants2(); + exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val); + exports.hasRegexChars = (str2) => REGEX_SPECIAL_CHARS.test(str2); + exports.isRegexChar = (str2) => str2.length === 1 && exports.hasRegexChars(str2); + exports.escapeRegex = (str2) => str2.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1"); + exports.toPosixSlashes = (str2) => str2.replace(REGEX_BACKSLASH, "/"); + exports.removeBackslashes = (str2) => { + return str2.replace(REGEX_REMOVE_BACKSLASH, (match) => { + return match === "\\" ? "" : match; + }); + }; + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split(".").map(Number); + if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) { + return true; + } + return false; + }; + exports.isWindows = (options8) => { + if (options8 && typeof options8.windows === "boolean") { + return options8.windows; + } + return win32 === true || path13.sep === "\\"; + }; + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith("./")) { + output = output.slice(2); + state.prefix = "./"; + } + return output; + }; + exports.wrapOutput = (input, state = {}, options8 = {}) => { + const prepend = options8.contains ? "" : "^"; + const append = options8.contains ? "" : "$"; + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/scan.js +var require_scan = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/scan.js"(exports, module) { + "use strict"; + var utils = require_utils2(); + var { + CHAR_ASTERISK, + /* * */ + CHAR_AT, + /* @ */ + CHAR_BACKWARD_SLASH, + /* \ */ + CHAR_COMMA, + /* , */ + CHAR_DOT, + /* . */ + CHAR_EXCLAMATION_MARK, + /* ! */ + CHAR_FORWARD_SLASH, + /* / */ + CHAR_LEFT_CURLY_BRACE, + /* { */ + CHAR_LEFT_PARENTHESES, + /* ( */ + CHAR_LEFT_SQUARE_BRACKET, + /* [ */ + CHAR_PLUS, + /* + */ + CHAR_QUESTION_MARK, + /* ? */ + CHAR_RIGHT_CURLY_BRACE, + /* } */ + CHAR_RIGHT_PARENTHESES, + /* ) */ + CHAR_RIGHT_SQUARE_BRACKET + /* ] */ + } = require_constants2(); + var isPathSeparator = (code) => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + }; + var depth = (token2) => { + if (token2.isPrefix !== true) { + token2.depth = token2.isGlobstar ? Infinity : 1; + } + }; + var scan = (input, options8) => { + const opts = options8 || {}; + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + let str2 = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token2 = { value: "", depth: 0, isGlob: false }; + const eos = () => index >= length; + const peek2 = () => str2.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str2.charCodeAt(++index); + }; + while (index < length) { + code = advance(); + let next; + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + code = advance(); + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + advance(); + continue; + } + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token2.isBrace = true; + isGlob = token2.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token2.isBrace = true; + isGlob = token2.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + if (braces === 0) { + braceEscaped = false; + isBrace = token2.isBrace = true; + finished = true; + break; + } + } + } + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token2); + token2 = { value: "", depth: 0, isGlob: false }; + if (finished === true) continue; + if (prev === CHAR_DOT && index === start + 1) { + start += 2; + continue; + } + lastIndex = index + 1; + continue; + } + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; + if (isExtglobChar === true && peek2() === CHAR_LEFT_PARENTHESES) { + isGlob = token2.isGlob = true; + isExtglob = token2.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + code = advance(); + continue; + } + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token2.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token2.isGlobstar = true; + isGlob = token2.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_QUESTION_MARK) { + isGlob = token2.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + advance(); + continue; + } + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token2.isBracket = true; + isGlob = token2.isGlob = true; + finished = true; + break; + } + } + if (scanToEnd === true) { + continue; + } + break; + } + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token2.negated = true; + start++; + continue; + } + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token2.isGlob = true; + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token2.backslashes = true; + code = advance(); + continue; + } + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + if (isGlob === true) { + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + } + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + let base = str2; + let prefix = ""; + let glob = ""; + if (start > 0) { + prefix = str2.slice(0, start); + str2 = str2.slice(start); + lastIndex -= start; + } + if (base && isGlob === true && lastIndex > 0) { + base = str2.slice(0, lastIndex); + glob = str2.slice(lastIndex); + } else if (isGlob === true) { + base = ""; + glob = str2; + } else { + base = str2; + } + if (base && base !== "" && base !== "/" && base !== str2) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token2); + } + state.tokens = tokens; + } + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== "") { + parts.push(value); + } + prevIndex = i; + } + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + state.slashes = slashes; + state.parts = parts; + } + return state; + }; + module.exports = scan; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/parse.js +var require_parse2 = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/parse.js"(exports, module) { + "use strict"; + var constants = require_constants2(); + var utils = require_utils2(); + var { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS + } = constants; + var expandRange = (args, options8) => { + if (typeof options8.expandRange === "function") { + return options8.expandRange(...args, options8); + } + args.sort(); + const value = `[${args.join("-")}]`; + try { + new RegExp(value); + } catch (ex) { + return args.map((v) => utils.escapeRegex(v)).join(".."); + } + return value; + }; + var syntaxError2 = (type2, char) => { + return `Missing ${type2}: "${char}" - use "\\\\${char}" to match literal characters`; + }; + var parse7 = (input, options8) => { + if (typeof input !== "string") { + throw new TypeError("Expected a string"); + } + input = REPLACEMENTS[input] || input; + const opts = { ...options8 }; + const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + const bos = { type: "bos", value: "", output: opts.prepend || "" }; + const tokens = [bos]; + const capture = opts.capture ? "" : "?:"; + const win32 = utils.isWindows(options8); + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + const globstar = (opts2) => { + return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + const nodot = opts.dot ? "" : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + if (opts.capture) { + star = `(${star})`; + } + if (typeof opts.noext === "boolean") { + opts.noextglob = opts.noext; + } + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: "", + output: "", + prefix: "", + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + input = utils.removePrefix(input, state); + len = input.length; + const extglobs = []; + const braces = []; + const stack2 = []; + let prev = bos; + let value; + const eos = () => state.index === len - 1; + const peek2 = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ""; + const remaining = () => input.slice(state.index + 1); + const consume = (value2 = "", num = 0) => { + state.consumed += value2; + state.index += num; + }; + const append = (token2) => { + state.output += token2.output != null ? token2.output : token2.value; + consume(token2.value); + }; + const negate = () => { + let count = 1; + while (peek2() === "!" && (peek2(2) !== "(" || peek2(3) === "?")) { + advance(); + state.start++; + count++; + } + if (count % 2 === 0) { + return false; + } + state.negated = true; + state.start++; + return true; + }; + const increment = (type2) => { + state[type2]++; + stack2.push(type2); + }; + const decrement = (type2) => { + state[type2]--; + stack2.pop(); + }; + const push2 = (tok) => { + if (prev.type === "globstar") { + const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"); + const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren"); + if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = "star"; + prev.value = "*"; + prev.output = star; + state.output += prev.output; + } + } + if (extglobs.length && tok.type !== "paren") { + extglobs[extglobs.length - 1].inner += tok.value; + } + if (tok.value || tok.output) append(tok); + if (prev && prev.type === "text" && tok.type === "text") { + prev.value += tok.value; + prev.output = (prev.output || "") + tok.value; + return; + } + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + const extglobOpen = (type2, value2) => { + const token2 = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" }; + token2.prev = prev; + token2.parens = state.parens; + token2.output = state.output; + const output = (opts.capture ? "(" : "") + token2.open; + increment("parens"); + push2({ type: type2, value: value2, output: state.output ? "" : ONE_CHAR }); + push2({ type: "paren", extglob: true, value: advance(), output }); + extglobs.push(token2); + }; + const extglobClose = (token2) => { + let output = token2.close + (opts.capture ? ")" : ""); + let rest; + if (token2.type === "negate") { + let extglobStar = star; + if (token2.inner && token2.inner.length > 1 && token2.inner.includes("/")) { + extglobStar = globstar(opts); + } + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token2.close = `)$))${extglobStar}`; + } + if (token2.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + const expression = parse7(rest, { ...options8, fastpaths: false }).output; + output = token2.close = `)${expression})${extglobStar})`; + } + if (token2.prev.type === "bos") { + state.negatedExtglob = true; + } + } + push2({ type: "paren", extglob: true, value, output }); + decrement("parens"); + }; + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === "\\") { + backslashes = true; + return m; + } + if (first === "?") { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ""); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ""); + } + return QMARK.repeat(chars.length); + } + if (first === ".") { + return DOT_LITERAL.repeat(chars.length); + } + if (first === "*") { + if (esc) { + return esc + first + (rest ? star : ""); + } + return star; + } + return esc ? m : `\\${m}`; + }); + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ""); + } else { + output = output.replace(/\\+/g, (m) => { + return m.length % 2 === 0 ? "\\\\" : m ? "\\" : ""; + }); + } + } + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + state.output = utils.wrapOutput(output, state, options8); + return state; + } + while (!eos()) { + value = advance(); + if (value === "\0") { + continue; + } + if (value === "\\") { + const next = peek2(); + if (next === "/" && opts.bash !== true) { + continue; + } + if (next === "." || next === ";") { + continue; + } + if (!next) { + value += "\\"; + push2({ type: "text", value }); + continue; + } + const match = /^\\+/.exec(remaining()); + let slashes = 0; + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += "\\"; + } + } + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + if (state.brackets === 0) { + push2({ type: "text", value }); + continue; + } + } + if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) { + if (opts.posix !== false && value === ":") { + const inner = prev.value.slice(1); + if (inner.includes("[")) { + prev.posix = true; + if (inner.includes(":")) { + const idx = prev.value.lastIndexOf("["); + const pre = prev.value.slice(0, idx); + const rest2 = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest2]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + if (value === "[" && peek2() !== ":" || value === "-" && peek2() === "]") { + value = `\\${value}`; + } + if (value === "]" && (prev.value === "[" || prev.value === "[^")) { + value = `\\${value}`; + } + if (opts.posix === true && value === "!" && prev.value === "[") { + value = "^"; + } + prev.value += value; + append({ value }); + continue; + } + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push2({ type: "text", value }); + } + continue; + } + if (value === "(") { + increment("parens"); + push2({ type: "paren", value }); + continue; + } + if (value === ")") { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError2("opening", "(")); + } + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + push2({ type: "paren", value, output: state.parens ? ")" : "\\)" }); + decrement("parens"); + continue; + } + if (value === "[") { + if (opts.nobracket === true || !remaining().includes("]")) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError2("closing", "]")); + } + value = `\\${value}`; + } else { + increment("brackets"); + } + push2({ type: "bracket", value }); + continue; + } + if (value === "]") { + if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) { + push2({ type: "text", value, output: `\\${value}` }); + continue; + } + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError2("opening", "[")); + } + push2({ type: "text", value, output: `\\${value}` }); + continue; + } + decrement("brackets"); + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) { + value = `/${value}`; + } + prev.value += value; + append({ value }); + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + if (value === "{" && opts.nobrace !== true) { + increment("braces"); + const open = { + type: "brace", + value, + output: "(", + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + braces.push(open); + push2(open); + continue; + } + if (value === "}") { + const brace = braces[braces.length - 1]; + if (opts.nobrace === true || !brace) { + push2({ type: "text", value, output: value }); + continue; + } + let output = ")"; + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === "brace") { + break; + } + if (arr[i].type !== "dots") { + range.unshift(arr[i].value); + } + } + output = expandRange(range, opts); + state.backtrack = true; + } + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = "\\{"; + value = output = "\\}"; + state.output = out; + for (const t of toks) { + state.output += t.output || t.value; + } + } + push2({ type: "brace", value, output }); + decrement("braces"); + braces.pop(); + continue; + } + if (value === "|") { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push2({ type: "text", value }); + continue; + } + if (value === ",") { + let output = value; + const brace = braces[braces.length - 1]; + if (brace && stack2[stack2.length - 1] === "braces") { + brace.comma = true; + output = "|"; + } + push2({ type: "comma", value, output }); + continue; + } + if (value === "/") { + if (prev.type === "dot" && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ""; + state.output = ""; + tokens.pop(); + prev = bos; + continue; + } + push2({ type: "slash", value, output: SLASH_LITERAL }); + continue; + } + if (value === ".") { + if (state.braces > 0 && prev.type === "dot") { + if (prev.value === ".") prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = "dots"; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") { + push2({ type: "text", value, output: DOT_LITERAL }); + continue; + } + push2({ type: "dot", value, output: DOT_LITERAL }); + continue; + } + if (value === "?") { + const isGroup = prev && prev.value === "("; + if (!isGroup && opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") { + extglobOpen("qmark", value); + continue; + } + if (prev && prev.type === "paren") { + const next = peek2(); + let output = value; + if (next === "<" && !utils.supportsLookbehinds()) { + throw new Error("Node.js v10 or higher is required for regex lookbehinds"); + } + if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) { + output = `\\${value}`; + } + push2({ type: "text", value, output }); + continue; + } + if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) { + push2({ type: "qmark", value, output: QMARK_NO_DOT }); + continue; + } + push2({ type: "qmark", value, output: QMARK }); + continue; + } + if (value === "!") { + if (opts.noextglob !== true && peek2() === "(") { + if (peek2(2) !== "?" || !/[!=<:]/.test(peek2(3))) { + extglobOpen("negate", value); + continue; + } + } + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + if (value === "+") { + if (opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") { + extglobOpen("plus", value); + continue; + } + if (prev && prev.value === "(" || opts.regex === false) { + push2({ type: "plus", value, output: PLUS_LITERAL }); + continue; + } + if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) { + push2({ type: "plus", value }); + continue; + } + push2({ type: "plus", value: PLUS_LITERAL }); + continue; + } + if (value === "@") { + if (opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") { + push2({ type: "at", extglob: true, value, output: "" }); + continue; + } + push2({ type: "text", value }); + continue; + } + if (value !== "*") { + if (value === "$" || value === "^") { + value = `\\${value}`; + } + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + push2({ type: "text", value }); + continue; + } + if (prev && (prev.type === "globstar" || prev.star === true)) { + prev.type = "star"; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen("star", value); + continue; + } + if (prev.type === "star") { + if (opts.noglobstar === true) { + consume(value); + continue; + } + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === "slash" || prior.type === "bos"; + const afterStar = before && (before.type === "star" || before.type === "globstar"); + if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) { + push2({ type: "star", value, output: "" }); + continue; + } + const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"); + const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren"); + if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) { + push2({ type: "star", value, output: "" }); + continue; + } + while (rest.slice(0, 3) === "/**") { + const after = input[state.index + 4]; + if (after && after !== "/") { + break; + } + rest = rest.slice(3); + consume("/**", 3); + } + if (prior.type === "bos" && eos()) { + prev.type = "globstar"; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + prev.type = "globstar"; + prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") { + const end = rest[1] !== void 0 ? "|$" : ""; + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + prev.type = "globstar"; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + state.output += prior.output + prev.output; + state.globstar = true; + consume(value + advance()); + push2({ type: "slash", value: "/", output: "" }); + continue; + } + if (prior.type === "bos" && rest[0] === "/") { + prev.type = "globstar"; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push2({ type: "slash", value: "/", output: "" }); + continue; + } + state.output = state.output.slice(0, -prev.output.length); + prev.type = "globstar"; + prev.output = globstar(opts); + prev.value += value; + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + const token2 = { type: "star", value, output: star }; + if (opts.bash === true) { + token2.output = ".*?"; + if (prev.type === "bos" || prev.type === "slash") { + token2.output = nodot + token2.output; + } + push2(token2); + continue; + } + if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) { + token2.output = value; + push2(token2); + continue; + } + if (state.index === state.start || prev.type === "slash" || prev.type === "dot") { + if (prev.type === "dot") { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + } else { + state.output += nodot; + prev.output += nodot; + } + if (peek2() !== "*") { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + push2(token2); + } + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "]")); + state.output = utils.escapeLast(state.output, "["); + decrement("brackets"); + } + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", ")")); + state.output = utils.escapeLast(state.output, "("); + decrement("parens"); + } + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "}")); + state.output = utils.escapeLast(state.output, "{"); + decrement("braces"); + } + if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) { + push2({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }); + } + if (state.backtrack === true) { + state.output = ""; + for (const token2 of state.tokens) { + state.output += token2.output != null ? token2.output : token2.value; + if (token2.suffix) { + state.output += token2.suffix; + } + } + } + return state; + }; + parse7.fastpaths = (input, options8) => { + const opts = { ...options8 }; + const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options8); + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? "" : "?:"; + const state = { negated: false, prefix: "" }; + let star = opts.bash === true ? ".*?" : STAR; + if (opts.capture) { + star = `(${star})`; + } + const globstar = (opts2) => { + if (opts2.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + const create = (str2) => { + switch (str2) { + case "*": + return `${nodot}${ONE_CHAR}${star}`; + case ".*": + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + case "*.*": + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + case "*/*": + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + case "**": + return nodot + globstar(opts); + case "**/*": + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + case "**/*.*": + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + case "**/.*": + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + default: { + const match = /^(.*?)\.(\w+)$/.exec(str2); + if (!match) return; + const source3 = create(match[1]); + if (!source3) return; + return source3 + DOT_LITERAL + match[2]; + } + } + }; + const output = utils.removePrefix(input, state); + let source2 = create(output); + if (source2 && opts.strictSlashes !== true) { + source2 += `${SLASH_LITERAL}?`; + } + return source2; + }; + module.exports = parse7; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/picomatch.js +var require_picomatch = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports, module) { + "use strict"; + var path13 = __require("path"); + var scan = require_scan(); + var parse7 = require_parse2(); + var utils = require_utils2(); + var constants = require_constants2(); + var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val); + var picomatch = (glob, options8, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map((input) => picomatch(input, options8, returnState)); + const arrayMatcher = (str2) => { + for (const isMatch of fns) { + const state2 = isMatch(str2); + if (state2) return state2; + } + return false; + }; + return arrayMatcher; + } + const isState = isObject3(glob) && glob.tokens && glob.input; + if (glob === "" || typeof glob !== "string" && !isState) { + throw new TypeError("Expected pattern to be a non-empty string"); + } + const opts = options8 || {}; + const posix = utils.isWindows(options8); + const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true); + const state = regex.state; + delete regex.state; + let isIgnored2 = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null }; + isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState); + } + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + if (typeof opts.onResult === "function") { + opts.onResult(result); + } + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + if (isIgnored2(input)) { + if (typeof opts.onIgnore === "function") { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + if (typeof opts.onMatch === "function") { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + if (returnState) { + matcher.state = state; + } + return matcher; + }; + picomatch.test = (input, regex, options8, { glob, posix } = {}) => { + if (typeof input !== "string") { + throw new TypeError("Expected input to be a string"); + } + if (input === "") { + return { isMatch: false, output: "" }; + } + const opts = options8 || {}; + const format3 = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = match && format3 ? format3(input) : input; + if (match === false) { + output = format3 ? format3(input) : input; + match = output === glob; + } + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options8, posix); + } else { + match = regex.exec(output); + } + } + return { isMatch: Boolean(match), match, output }; + }; + picomatch.matchBase = (input, glob, options8, posix = utils.isWindows(options8)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8); + return regex.test(path13.basename(input)); + }; + picomatch.isMatch = (str2, patterns, options8) => picomatch(patterns, options8)(str2); + picomatch.parse = (pattern, options8) => { + if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options8)); + return parse7(pattern, { ...options8, fastpaths: false }); + }; + picomatch.scan = (input, options8) => scan(input, options8); + picomatch.compileRe = (state, options8, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + const opts = options8 || {}; + const prepend = opts.contains ? "" : "^"; + const append = opts.contains ? "" : "$"; + let source2 = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source2 = `^(?!${source2}).*$`; + } + const regex = picomatch.toRegex(source2, options8); + if (returnState === true) { + regex.state = state; + } + return regex; + }; + picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== "string") { + throw new TypeError("Expected a non-empty string"); + } + let parsed = { negated: false, fastpaths: true }; + if (options8.fastpaths !== false && (input[0] === "." || input[0] === "*")) { + parsed.output = parse7.fastpaths(input, options8); + } + if (!parsed.output) { + parsed = parse7(input, options8); + } + return picomatch.compileRe(parsed, options8, returnOutput, returnState); + }; + picomatch.toRegex = (source2, options8) => { + try { + const opts = options8 || {}; + return new RegExp(source2, opts.flags || (opts.nocase ? "i" : "")); + } catch (err) { + if (options8 && options8.debug === true) throw err; + return /$^/; + } + }; + picomatch.constants = constants; + module.exports = picomatch; + } +}); + +// node_modules/micromatch/node_modules/picomatch/index.js +var require_picomatch2 = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/index.js"(exports, module) { + "use strict"; + module.exports = require_picomatch(); + } +}); + +// node_modules/micromatch/index.js +var require_micromatch = __commonJS({ + "node_modules/micromatch/index.js"(exports, module) { + "use strict"; + var util2 = __require("util"); + var braces = require_braces(); + var picomatch = require_picomatch2(); + var utils = require_utils2(); + var isEmptyString = (v) => v === "" || v === "./"; + var hasBraces = (v) => { + const index = v.indexOf("{"); + return index > -1 && v.indexOf("}", index) > -1; + }; + var micromatch2 = (list, patterns, options8) => { + patterns = [].concat(patterns); + list = [].concat(list); + let omit2 = /* @__PURE__ */ new Set(); + let keep = /* @__PURE__ */ new Set(); + let items = /* @__PURE__ */ new Set(); + let negatives = 0; + let onResult = (state) => { + items.add(state.output); + if (options8 && options8.onResult) { + options8.onResult(state); + } + }; + for (let i = 0; i < patterns.length; i++) { + let isMatch = picomatch(String(patterns[i]), { ...options8, onResult }, true); + let negated = isMatch.state.negated || isMatch.state.negatedExtglob; + if (negated) negatives++; + for (let item of list) { + let matched = isMatch(item, true); + let match = negated ? !matched.isMatch : matched.isMatch; + if (!match) continue; + if (negated) { + omit2.add(matched.output); + } else { + omit2.delete(matched.output); + keep.add(matched.output); + } + } + } + let result = negatives === patterns.length ? [...items] : [...keep]; + let matches = result.filter((item) => !omit2.has(item)); + if (options8 && matches.length === 0) { + if (options8.failglob === true) { + throw new Error(`No matches found for "${patterns.join(", ")}"`); + } + if (options8.nonull === true || options8.nullglob === true) { + return options8.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns; + } + } + return matches; + }; + micromatch2.match = micromatch2; + micromatch2.matcher = (pattern, options8) => picomatch(pattern, options8); + micromatch2.isMatch = (str2, patterns, options8) => picomatch(patterns, options8)(str2); + micromatch2.any = micromatch2.isMatch; + micromatch2.not = (list, patterns, options8 = {}) => { + patterns = [].concat(patterns).map(String); + let result = /* @__PURE__ */ new Set(); + let items = []; + let onResult = (state) => { + if (options8.onResult) options8.onResult(state); + items.push(state.output); + }; + let matches = new Set(micromatch2(list, patterns, { ...options8, onResult })); + for (let item of items) { + if (!matches.has(item)) { + result.add(item); + } + } + return [...result]; + }; + micromatch2.contains = (str2, pattern, options8) => { + if (typeof str2 !== "string") { + throw new TypeError(`Expected a string: "${util2.inspect(str2)}"`); + } + if (Array.isArray(pattern)) { + return pattern.some((p) => micromatch2.contains(str2, p, options8)); + } + if (typeof pattern === "string") { + if (isEmptyString(str2) || isEmptyString(pattern)) { + return false; + } + if (str2.includes(pattern) || str2.startsWith("./") && str2.slice(2).includes(pattern)) { + return true; + } + } + return micromatch2.isMatch(str2, pattern, { ...options8, contains: true }); + }; + micromatch2.matchKeys = (obj, patterns, options8) => { + if (!utils.isObject(obj)) { + throw new TypeError("Expected the first argument to be an object"); + } + let keys = micromatch2(Object.keys(obj), patterns, options8); + let res = {}; + for (let key2 of keys) res[key2] = obj[key2]; + return res; + }; + micromatch2.some = (list, patterns, options8) => { + let items = [].concat(list); + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options8); + if (items.some((item) => isMatch(item))) { + return true; + } + } + return false; + }; + micromatch2.every = (list, patterns, options8) => { + let items = [].concat(list); + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options8); + if (!items.every((item) => isMatch(item))) { + return false; + } + } + return true; + }; + micromatch2.all = (str2, patterns, options8) => { + if (typeof str2 !== "string") { + throw new TypeError(`Expected a string: "${util2.inspect(str2)}"`); + } + return [].concat(patterns).every((p) => picomatch(p, options8)(str2)); + }; + micromatch2.capture = (glob, input, options8) => { + let posix = utils.isWindows(options8); + let regex = picomatch.makeRe(String(glob), { ...options8, capture: true }); + let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); + if (match) { + return match.slice(1).map((v) => v === void 0 ? "" : v); + } + }; + micromatch2.makeRe = (...args) => picomatch.makeRe(...args); + micromatch2.scan = (...args) => picomatch.scan(...args); + micromatch2.parse = (patterns, options8) => { + let res = []; + for (let pattern of [].concat(patterns || [])) { + for (let str2 of braces(String(pattern), options8)) { + res.push(picomatch.parse(str2, options8)); + } + } + return res; + }; + micromatch2.braces = (pattern, options8) => { + if (typeof pattern !== "string") throw new TypeError("Expected a string"); + if (options8 && options8.nobrace === true || !hasBraces(pattern)) { + return [pattern]; + } + return braces(pattern, options8); + }; + micromatch2.braceExpand = (pattern, options8) => { + if (typeof pattern !== "string") throw new TypeError("Expected a string"); + return micromatch2.braces(pattern, { ...options8, expand: true }); + }; + micromatch2.hasBraces = hasBraces; + module.exports = micromatch2; + } +}); + +// node_modules/fast-glob/out/utils/pattern.js +var require_pattern = __commonJS({ + "node_modules/fast-glob/out/utils/pattern.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; + var path13 = __require("path"); + var globParent = require_glob_parent(); + var micromatch2 = require_micromatch(); + var GLOBSTAR = "**"; + var ESCAPE_SYMBOL = "\\"; + var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; + var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; + var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; + var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; + var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; + var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; + function isStaticPattern(pattern, options8 = {}) { + return !isDynamicPattern(pattern, options8); + } + exports.isStaticPattern = isStaticPattern; + function isDynamicPattern(pattern, options8 = {}) { + if (pattern === "") { + return false; + } + if (options8.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; + } + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options8.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options8.braceExpansion !== false && hasBraceExpansion(pattern)) { + return true; + } + return false; + } + exports.isDynamicPattern = isDynamicPattern; + function hasBraceExpansion(pattern) { + const openingBraceIndex = pattern.indexOf("{"); + if (openingBraceIndex === -1) { + return false; + } + const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1); + if (closingBraceIndex === -1) { + return false; + } + const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); + return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); + } + function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; + } + exports.convertToPositivePattern = convertToPositivePattern; + function convertToNegativePattern(pattern) { + return "!" + pattern; + } + exports.convertToNegativePattern = convertToNegativePattern; + function isNegativePattern(pattern) { + return pattern.startsWith("!") && pattern[1] !== "("; + } + exports.isNegativePattern = isNegativePattern; + function isPositivePattern(pattern) { + return !isNegativePattern(pattern); + } + exports.isPositivePattern = isPositivePattern; + function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); + } + exports.getNegativePatterns = getNegativePatterns; + function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); + } + exports.getPositivePatterns = getPositivePatterns; + function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); + } + exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; + function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); + } + exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; + function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith("..") || pattern.startsWith("./.."); + } + exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; + function getBaseDirectory(pattern) { + return globParent(pattern, { flipBackslashes: false }); + } + exports.getBaseDirectory = getBaseDirectory; + function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR); + } + exports.hasGlobStar = hasGlobStar; + function endsWithSlashGlobStar(pattern) { + return pattern.endsWith("/" + GLOBSTAR); + } + exports.endsWithSlashGlobStar = endsWithSlashGlobStar; + function isAffectDepthOfReadingPattern(pattern) { + const basename = path13.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); + } + exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; + function expandPatternsWithBraceExpansion(patterns) { + return patterns.reduce((collection, pattern) => { + return collection.concat(expandBraceExpansion(pattern)); + }, []); + } + exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; + function expandBraceExpansion(pattern) { + const patterns = micromatch2.braces(pattern, { expand: true, nodupes: true, keepEscaping: true }); + patterns.sort((a, b) => a.length - b.length); + return patterns.filter((pattern2) => pattern2 !== ""); + } + exports.expandBraceExpansion = expandBraceExpansion; + function getPatternParts(pattern, options8) { + let { parts } = micromatch2.scan(pattern, Object.assign(Object.assign({}, options8), { parts: true })); + if (parts.length === 0) { + parts = [pattern]; + } + if (parts[0].startsWith("/")) { + parts[0] = parts[0].slice(1); + parts.unshift(""); + } + return parts; + } + exports.getPatternParts = getPatternParts; + function makeRe(pattern, options8) { + return micromatch2.makeRe(pattern, options8); + } + exports.makeRe = makeRe; + function convertPatternsToRe(patterns, options8) { + return patterns.map((pattern) => makeRe(pattern, options8)); + } + exports.convertPatternsToRe = convertPatternsToRe; + function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); + } + exports.matchAny = matchAny; + function removeDuplicateSlashes(pattern) { + return pattern.replace(DOUBLE_SLASH_RE, "/"); + } + exports.removeDuplicateSlashes = removeDuplicateSlashes; + function partitionAbsoluteAndRelative(patterns) { + const absolute = []; + const relative = []; + for (const pattern of patterns) { + if (isAbsolute(pattern)) { + absolute.push(pattern); + } else { + relative.push(pattern); + } + } + return [absolute, relative]; + } + exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative; + function isAbsolute(pattern) { + return path13.isAbsolute(pattern); + } + exports.isAbsolute = isAbsolute; + } +}); + +// node_modules/merge2/index.js +var require_merge2 = __commonJS({ + "node_modules/merge2/index.js"(exports, module) { + "use strict"; + var Stream = __require("stream"); + var PassThrough = Stream.PassThrough; + var slice = Array.prototype.slice; + module.exports = merge2; + function merge2() { + const streamsQueue = []; + const args = slice.call(arguments); + let merging = false; + let options8 = args[args.length - 1]; + if (options8 && !Array.isArray(options8) && options8.pipe == null) { + args.pop(); + } else { + options8 = {}; + } + const doEnd = options8.end !== false; + const doPipeError = options8.pipeError === true; + if (options8.objectMode == null) { + options8.objectMode = true; + } + if (options8.highWaterMark == null) { + options8.highWaterMark = 64 * 1024; + } + const mergedStream = PassThrough(options8); + function addStream() { + for (let i = 0, len = arguments.length; i < len; i++) { + streamsQueue.push(pauseStreams(arguments[i], options8)); + } + mergeStream(); + return this; + } + function mergeStream() { + if (merging) { + return; + } + merging = true; + let streams = streamsQueue.shift(); + if (!streams) { + process.nextTick(endStream); + return; + } + if (!Array.isArray(streams)) { + streams = [streams]; + } + let pipesCount = streams.length + 1; + function next() { + if (--pipesCount > 0) { + return; + } + merging = false; + mergeStream(); + } + function pipe(stream) { + function onend() { + stream.removeListener("merge2UnpipeEnd", onend); + stream.removeListener("end", onend); + if (doPipeError) { + stream.removeListener("error", onerror); + } + next(); + } + function onerror(err) { + mergedStream.emit("error", err); + } + if (stream._readableState.endEmitted) { + return next(); + } + stream.on("merge2UnpipeEnd", onend); + stream.on("end", onend); + if (doPipeError) { + stream.on("error", onerror); + } + stream.pipe(mergedStream, { end: false }); + stream.resume(); + } + for (let i = 0; i < streams.length; i++) { + pipe(streams[i]); + } + next(); + } + function endStream() { + merging = false; + mergedStream.emit("queueDrain"); + if (doEnd) { + mergedStream.end(); + } + } + mergedStream.setMaxListeners(0); + mergedStream.add = addStream; + mergedStream.on("unpipe", function(stream) { + stream.emit("merge2UnpipeEnd"); + }); + if (args.length) { + addStream.apply(null, args); + } + return mergedStream; + } + function pauseStreams(streams, options8) { + if (!Array.isArray(streams)) { + if (!streams._readableState && streams.pipe) { + streams = streams.pipe(PassThrough(options8)); + } + if (!streams._readableState || !streams.pause || !streams.pipe) { + throw new Error("Only readable stream can be merged."); + } + streams.pause(); + } else { + for (let i = 0, len = streams.length; i < len; i++) { + streams[i] = pauseStreams(streams[i], options8); + } + } + return streams; + } + } +}); + +// node_modules/fast-glob/out/utils/stream.js +var require_stream = __commonJS({ + "node_modules/fast-glob/out/utils/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = void 0; + var merge2 = require_merge2(); + function merge3(streams) { + const mergedStream = merge2(streams); + streams.forEach((stream) => { + stream.once("error", (error) => mergedStream.emit("error", error)); + }); + mergedStream.once("close", () => propagateCloseEventToSources(streams)); + mergedStream.once("end", () => propagateCloseEventToSources(streams)); + return mergedStream; + } + exports.merge = merge3; + function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit("close")); + } + } +}); + +// node_modules/fast-glob/out/utils/string.js +var require_string = __commonJS({ + "node_modules/fast-glob/out/utils/string.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isEmpty = exports.isString = void 0; + function isString(input) { + return typeof input === "string"; + } + exports.isString = isString; + function isEmpty(input) { + return input === ""; + } + exports.isEmpty = isEmpty; + } +}); + +// node_modules/fast-glob/out/utils/index.js +var require_utils3 = __commonJS({ + "node_modules/fast-glob/out/utils/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; + var array2 = require_array(); + exports.array = array2; + var errno = require_errno(); + exports.errno = errno; + var fs7 = require_fs(); + exports.fs = fs7; + var path13 = require_path(); + exports.path = path13; + var pattern = require_pattern(); + exports.pattern = pattern; + var stream = require_stream(); + exports.stream = stream; + var string = require_string(); + exports.string = string; + } +}); + +// node_modules/fast-glob/out/managers/tasks.js +var require_tasks = __commonJS({ + "node_modules/fast-glob/out/managers/tasks.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; + var utils = require_utils3(); + function generate(input, settings) { + const patterns = processPatterns(input, settings); + const ignore = processPatterns(settings.ignore, settings); + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks( + staticPatterns, + negativePatterns, + /* dynamic */ + false + ); + const dynamicTasks = convertPatternsToTasks( + dynamicPatterns, + negativePatterns, + /* dynamic */ + true + ); + return staticTasks.concat(dynamicTasks); + } + exports.generate = generate; + function processPatterns(input, settings) { + let patterns = input; + if (settings.braceExpansion) { + patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); + } + if (settings.baseNameMatch) { + patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`); + } + return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); + } + function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + if ("." in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic)); + } else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); + } + return tasks; + } + exports.convertPatternsToTasks = convertPatternsToTasks; + function getPositivePatterns(patterns) { + return utils.pattern.getPositivePatterns(patterns); + } + exports.getPositivePatterns = getPositivePatterns; + function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils.pattern.convertToPositivePattern); + return positive; + } + exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; + function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } else { + collection[base] = [pattern]; + } + return collection; + }, group); + } + exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; + function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); + } + exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; + function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) + }; + } + exports.convertPatternGroupToTask = convertPatternGroupToTask; + } +}); + +// node_modules/@nodelib/fs.stat/out/providers/async.js +var require_async = __commonJS({ + "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.read = void 0; + function read3(path13, settings, callback) { + settings.fs.lstat(path13, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); + return; + } + settings.fs.stat(path13, (statError, stat) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; + } + callSuccessCallback(callback, lstat); + return; + } + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat); + }); + }); + } + exports.read = read3; + function callFailureCallback(callback, error) { + callback(error); + } + function callSuccessCallback(callback, result) { + callback(null, result); + } + } +}); + +// node_modules/@nodelib/fs.stat/out/providers/sync.js +var require_sync = __commonJS({ + "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.read = void 0; + function read3(path13, settings) { + const lstat = settings.fs.lstatSync(path13); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat = settings.fs.statSync(path13); + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + return stat; + } catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; + } + throw error; + } + } + exports.read = read3; + } +}); + +// node_modules/@nodelib/fs.stat/out/adapters/fs.js +var require_fs2 = __commonJS({ + "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + var fs7 = __require("fs"); + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs7.lstat, + stat: fs7.stat, + lstatSync: fs7.lstatSync, + statSync: fs7.statSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === void 0) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + } + exports.createFileSystemAdapter = createFileSystemAdapter; + } +}); + +// node_modules/@nodelib/fs.stat/out/settings.js +var require_settings = __commonJS({ + "node_modules/@nodelib/fs.stat/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fs7 = require_fs2(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs7.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.stat/out/index.js +var require_out = __commonJS({ + "node_modules/@nodelib/fs.stat/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.statSync = exports.stat = exports.Settings = void 0; + var async = require_async(); + var sync = require_sync(); + var settings_1 = require_settings(); + exports.Settings = settings_1.default; + function stat(path13, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + async.read(path13, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path13, getSettings(optionsOrSettingsOrCallback), callback); + } + exports.stat = stat; + function statSync2(path13, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path13, settings); + } + exports.statSync = statSync2; + function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/queue-microtask/index.js +var require_queue_microtask = __commonJS({ + "node_modules/queue-microtask/index.js"(exports, module) { + var promise; + module.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => { + throw err; + }, 0)); + } +}); + +// node_modules/run-parallel/index.js +var require_run_parallel = __commonJS({ + "node_modules/run-parallel/index.js"(exports, module) { + module.exports = runParallel; + var queueMicrotask2 = require_queue_microtask(); + function runParallel(tasks, cb) { + let results, pending, keys; + let isSync = true; + if (Array.isArray(tasks)) { + results = []; + pending = tasks.length; + } else { + keys = Object.keys(tasks); + results = {}; + pending = keys.length; + } + function done(err) { + function end() { + if (cb) cb(err, results); + cb = null; + } + if (isSync) queueMicrotask2(end); + else end(); + } + function each(i, err, result) { + results[i] = result; + if (--pending === 0 || err) { + done(err); + } + } + if (!pending) { + done(null); + } else if (keys) { + keys.forEach(function(key2) { + tasks[key2](function(err, result) { + each(key2, err, result); + }); + }); + } else { + tasks.forEach(function(task, i) { + task(function(err, result) { + each(i, err, result); + }); + }); + } + isSync = false; + } + } +}); + +// node_modules/@nodelib/fs.scandir/out/constants.js +var require_constants3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; + var NODE_PROCESS_VERSION_PARTS = process.versions.node.split("."); + if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); + } + var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); + var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); + var SUPPORTED_MAJOR_VERSION = 10; + var SUPPORTED_MINOR_VERSION = 10; + var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; + var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; + exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; + } +}); + +// node_modules/@nodelib/fs.scandir/out/utils/fs.js +var require_fs3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createDirentFromStats = void 0; + var DirentFromStats = class { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } + }; + function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); + } + exports.createDirentFromStats = createDirentFromStats; + } +}); + +// node_modules/@nodelib/fs.scandir/out/utils/index.js +var require_utils4 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.fs = void 0; + var fs7 = require_fs3(); + exports.fs = fs7; + } +}); + +// node_modules/@nodelib/fs.scandir/out/providers/common.js +var require_common = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.joinPathSegments = void 0; + function joinPathSegments(a, b, separator) { + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; + } + exports.joinPathSegments = joinPathSegments; + } +}); + +// node_modules/@nodelib/fs.scandir/out/providers/async.js +var require_async2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; + var fsStat = require_out(); + var rpl = require_run_parallel(); + var constants_1 = require_constants3(); + var utils = require_utils4(); + var common2 = require_common(); + function read3(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); + } + exports.read = read3; + function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common2.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); + } + exports.readdirWithFileTypes = readdirWithFileTypes; + function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; + } + function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path13 = common2.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path13, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path: path13, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); + } + exports.readdir = readdir; + function callFailureCallback(callback, error) { + callback(error); + } + function callSuccessCallback(callback, result) { + callback(null, result); + } + } +}); + +// node_modules/@nodelib/fs.scandir/out/providers/sync.js +var require_sync2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; + var fsStat = require_out(); + var constants_1 = require_constants3(); + var utils = require_utils4(); + var common2 = require_common(); + function read3(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir(directory, settings); + } + exports.read = read3; + function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common2.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); + } + exports.readdirWithFileTypes = readdirWithFileTypes; + function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common2.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); + } + exports.readdir = readdir; + } +}); + +// node_modules/@nodelib/fs.scandir/out/adapters/fs.js +var require_fs4 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + var fs7 = __require("fs"); + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs7.lstat, + stat: fs7.stat, + lstatSync: fs7.lstatSync, + statSync: fs7.statSync, + readdir: fs7.readdir, + readdirSync: fs7.readdirSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === void 0) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + } + exports.createFileSystemAdapter = createFileSystemAdapter; + } +}); + +// node_modules/@nodelib/fs.scandir/out/settings.js +var require_settings2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path13 = __require("path"); + var fsStat = require_out(); + var fs7 = require_fs4(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs7.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path13.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.scandir/out/index.js +var require_out2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Settings = exports.scandirSync = exports.scandir = void 0; + var async = require_async2(); + var sync = require_sync2(); + var settings_1 = require_settings2(); + exports.Settings = settings_1.default; + function scandir(path13, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + async.read(path13, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path13, getSettings(optionsOrSettingsOrCallback), callback); + } + exports.scandir = scandir; + function scandirSync(path13, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path13, settings); + } + exports.scandirSync = scandirSync; + function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/reusify/reusify.js +var require_reusify = __commonJS({ + "node_modules/reusify/reusify.js"(exports, module) { + "use strict"; + function reusify(Constructor) { + var head = new Constructor(); + var tail = head; + function get() { + var current = head; + if (current.next) { + head = current.next; + } else { + head = new Constructor(); + tail = head; + } + current.next = null; + return current; + } + function release(obj) { + tail.next = obj; + tail = obj; + } + return { + get, + release + }; + } + module.exports = reusify; + } +}); + +// node_modules/fastq/queue.js +var require_queue = __commonJS({ + "node_modules/fastq/queue.js"(exports, module) { + "use strict"; + var reusify = require_reusify(); + function fastqueue(context, worker, _concurrency) { + if (typeof context === "function") { + _concurrency = worker; + worker = context; + context = null; + } + if (!(_concurrency >= 1)) { + throw new Error("fastqueue concurrency must be equal to or greater than 1"); + } + var cache3 = reusify(Task); + var queueHead = null; + var queueTail = null; + var _running = 0; + var errorHandler = null; + var self = { + push: push2, + drain: noop2, + saturated: noop2, + pause, + paused: false, + get concurrency() { + return _concurrency; + }, + set concurrency(value) { + if (!(value >= 1)) { + throw new Error("fastqueue concurrency must be equal to or greater than 1"); + } + _concurrency = value; + if (self.paused) return; + for (; queueHead && _running < _concurrency; ) { + _running++; + release(); + } + }, + running, + resume, + idle, + length, + getQueue, + unshift, + empty: noop2, + kill, + killAndDrain, + error + }; + return self; + function running() { + return _running; + } + function pause() { + self.paused = true; + } + function length() { + var current = queueHead; + var counter = 0; + while (current) { + current = current.next; + counter++; + } + return counter; + } + function getQueue() { + var current = queueHead; + var tasks = []; + while (current) { + tasks.push(current.value); + current = current.next; + } + return tasks; + } + function resume() { + if (!self.paused) return; + self.paused = false; + if (queueHead === null) { + _running++; + release(); + return; + } + for (; queueHead && _running < _concurrency; ) { + _running++; + release(); + } + } + function idle() { + return _running === 0 && self.length() === 0; + } + function push2(value, done) { + var current = cache3.get(); + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop2; + current.errorHandler = errorHandler; + if (_running >= _concurrency || self.paused) { + if (queueTail) { + queueTail.next = current; + queueTail = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); + } + } else { + _running++; + worker.call(context, current.value, current.worked); + } + } + function unshift(value, done) { + var current = cache3.get(); + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop2; + current.errorHandler = errorHandler; + if (_running >= _concurrency || self.paused) { + if (queueHead) { + current.next = queueHead; + queueHead = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); + } + } else { + _running++; + worker.call(context, current.value, current.worked); + } + } + function release(holder) { + if (holder) { + cache3.release(holder); + } + var next = queueHead; + if (next && _running <= _concurrency) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null; + } + queueHead = next.next; + next.next = null; + worker.call(context, next.value, next.worked); + if (queueTail === null) { + self.empty(); + } + } else { + _running--; + } + } else if (--_running === 0) { + self.drain(); + } + } + function kill() { + queueHead = null; + queueTail = null; + self.drain = noop2; + } + function killAndDrain() { + queueHead = null; + queueTail = null; + self.drain(); + self.drain = noop2; + } + function error(handler) { + errorHandler = handler; + } + } + function noop2() { + } + function Task() { + this.value = null; + this.callback = noop2; + this.next = null; + this.release = noop2; + this.context = null; + this.errorHandler = null; + var self = this; + this.worked = function worked(err, result) { + var callback = self.callback; + var errorHandler = self.errorHandler; + var val = self.value; + self.value = null; + self.callback = noop2; + if (self.errorHandler) { + errorHandler(err, val); + } + callback.call(self.context, err, result); + self.release(self); + }; + } + function queueAsPromised(context, worker, _concurrency) { + if (typeof context === "function") { + _concurrency = worker; + worker = context; + context = null; + } + function asyncWrapper(arg, cb) { + worker.call(this, arg).then(function(res) { + cb(null, res); + }, cb); + } + var queue = fastqueue(context, asyncWrapper, _concurrency); + var pushCb = queue.push; + var unshiftCb = queue.unshift; + queue.push = push2; + queue.unshift = unshift; + queue.drained = drained; + return queue; + function push2(value) { + var p = new Promise(function(resolve3, reject) { + pushCb(value, function(err, result) { + if (err) { + reject(err); + return; + } + resolve3(result); + }); + }); + p.catch(noop2); + return p; + } + function unshift(value) { + var p = new Promise(function(resolve3, reject) { + unshiftCb(value, function(err, result) { + if (err) { + reject(err); + return; + } + resolve3(result); + }); + }); + p.catch(noop2); + return p; + } + function drained() { + var p = new Promise(function(resolve3) { + process.nextTick(function() { + if (queue.idle()) { + resolve3(); + } else { + var previousDrain = queue.drain; + queue.drain = function() { + if (typeof previousDrain === "function") previousDrain(); + resolve3(); + queue.drain = previousDrain; + }; + } + }); + }); + return p; + } + } + module.exports = fastqueue; + module.exports.promise = queueAsPromised; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/common.js +var require_common2 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; + function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; + } + return !settings.errorFilter(error); + } + exports.isFatalError = isFatalError; + function isAppliedFilter(filter2, value) { + return filter2 === null || filter2(value); + } + exports.isAppliedFilter = isAppliedFilter; + function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); + } + exports.replacePathSegmentSeparator = replacePathSegmentSeparator; + function joinPathSegments(a, b, separator) { + if (a === "") { + return b; + } + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; + } + exports.joinPathSegments = joinPathSegments; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/reader.js +var require_reader = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var common2 = require_common2(); + var Reader = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common2.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } + }; + exports.default = Reader; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/async.js +var require_async3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var events_1 = __require("events"); + var fsScandir = require_out2(); + var fastq = require_queue(); + var common2 = require_common2(); + var reader_1 = require_reader(); + var AsyncReader = class extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit("end"); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error("The reader is already destroyed"); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on("entry", callback); + } + onError(callback) { + this._emitter.once("error", callback); + } + onEnd(callback) { + this._emitter.once("end", callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, void 0); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, void 0); + }); + } + _handleError(error) { + if (this._isDestroyed || !common2.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit("error", error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== void 0) { + entry.path = common2.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common2.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common2.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit("entry", entry); + } + }; + exports.default = AsyncReader; + } +}); + +// node_modules/@nodelib/fs.walk/out/providers/async.js +var require_async4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var async_1 = require_async3(); + var AsyncProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); + } + }; + exports.default = AsyncProvider; + function callFailureCallback(callback, error) { + callback(error); + } + function callSuccessCallback(callback, entries) { + callback(null, entries); + } + } +}); + +// node_modules/@nodelib/fs.walk/out/providers/stream.js +var require_stream2 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = __require("stream"); + var async_1 = require_async3(); + var StreamProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { + }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit("error", error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } + }; + exports.default = StreamProvider; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/sync.js +var require_sync3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsScandir = require_out2(); + var common2 = require_common2(); + var reader_1 = require_reader(); + var SyncReader = class extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = /* @__PURE__ */ new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common2.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== void 0) { + entry.path = common2.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common2.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common2.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } + }; + exports.default = SyncReader; + } +}); + +// node_modules/@nodelib/fs.walk/out/providers/sync.js +var require_sync4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var sync_1 = require_sync3(); + var SyncProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } + }; + exports.default = SyncProvider; + } +}); + +// node_modules/@nodelib/fs.walk/out/settings.js +var require_settings3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path13 = __require("path"); + var fsScandir = require_out2(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, void 0); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path13.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.walk/out/index.js +var require_out3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; + var async_1 = require_async4(); + var stream_1 = require_stream2(); + var sync_1 = require_sync4(); + var settings_1 = require_settings3(); + exports.Settings = settings_1.default; + function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; + } + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); + } + exports.walk = walk; + function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); + } + exports.walkSync = walkSync; + function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); + } + exports.walkStream = walkStream; + function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/fast-glob/out/readers/reader.js +var require_reader2 = __commonJS({ + "node_modules/fast-glob/out/readers/reader.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path13 = __require("path"); + var fsStat = require_out(); + var utils = require_utils3(); + var Reader = class { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); + } + _getFullEntryPath(filepath) { + return path13.resolve(this._settings.cwd, filepath); + } + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; + } + return entry; + } + _isFatalError(error) { + return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; + } + }; + exports.default = Reader; + } +}); + +// node_modules/fast-glob/out/readers/stream.js +var require_stream3 = __commonJS({ + "node_modules/fast-glob/out/readers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = __require("stream"); + var fsStat = require_out(); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var ReaderStream = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk.walkStream; + this._stat = fsStat.stat; + } + dynamic(root2, options8) { + return this._walkStream(root2, options8); + } + static(patterns, options8) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options8).then((entry) => { + if (entry !== null && options8.entryFilter(entry)) { + stream.push(entry); + } + if (index === filepaths.length - 1) { + stream.end(); + } + done(); + }).catch(done); + }; + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); + } + return stream; + } + _getEntry(filepath, pattern, options8) { + return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => { + if (options8.errorFilter(error)) { + return null; + } + throw error; + }); + } + _getStat(filepath) { + return new Promise((resolve3, reject) => { + this._stat(filepath, this._fsStatSettings, (error, stats) => { + return error === null ? resolve3(stats) : reject(error); + }); + }); + } + }; + exports.default = ReaderStream; + } +}); + +// node_modules/fast-glob/out/readers/async.js +var require_async5 = __commonJS({ + "node_modules/fast-glob/out/readers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var stream_1 = require_stream3(); + var ReaderAsync = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkAsync = fsWalk.walk; + this._readerStream = new stream_1.default(this._settings); + } + dynamic(root2, options8) { + return new Promise((resolve3, reject) => { + this._walkAsync(root2, options8, (error, entries) => { + if (error === null) { + resolve3(entries); + } else { + reject(error); + } + }); + }); + } + async static(patterns, options8) { + const entries = []; + const stream = this._readerStream.static(patterns, options8); + return new Promise((resolve3, reject) => { + stream.once("error", reject); + stream.on("data", (entry) => entries.push(entry)); + stream.once("end", () => resolve3(entries)); + }); + } + }; + exports.default = ReaderAsync; + } +}); + +// node_modules/fast-glob/out/providers/matchers/matcher.js +var require_matcher = __commonJS({ + "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var Matcher = class { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); + } + _fillStorage() { + for (const pattern of this._patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections + }); + } + } + _getPatternSegments(pattern) { + const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; + } + return { + dynamic: true, + pattern: part, + patternRe: utils.pattern.makeRe(part, this._micromatchOptions) + }; + }); + } + _splitSegmentsIntoSections(segments) { + return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + } + }; + exports.default = Matcher; + } +}); + +// node_modules/fast-glob/out/providers/matchers/partial.js +var require_partial = __commonJS({ + "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var matcher_1 = require_matcher(); + var PartialMatcher = class extends matcher_1.default { + match(filepath) { + const parts = filepath.split("/"); + const levels = parts.length; + const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + if (!pattern.complete && levels > section.length) { + return true; + } + const match = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { + return true; + } + return false; + }); + if (match) { + return true; + } + } + return false; + } + }; + exports.default = PartialMatcher; + } +}); + +// node_modules/fast-glob/out/providers/filters/deep.js +var require_deep = __commonJS({ + "node_modules/fast-glob/out/providers/filters/deep.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var partial_1 = require_partial(); + var DeepFilter = class { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + } + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); + } + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); + } + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); + return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + } + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { + return false; + } + if (this._isSkippedSymbolicLink(entry)) { + return false; + } + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { + return false; + } + return this._isSkippedByNegativePatterns(filepath, negativeRe); + } + _isSkippedByDeep(basePath, entryPath) { + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; + } + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split("/").length; + if (basePath === "") { + return entryPathDepth; + } + const basePathDepth = basePath.split("/").length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + } + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); + } + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); + } + }; + exports.default = DeepFilter; + } +}); + +// node_modules/fast-glob/out/providers/filters/entry.js +var require_entry = __commonJS({ + "node_modules/fast-glob/out/providers/filters/entry.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var EntryFilter = class { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = /* @__PURE__ */ new Map(); + } + getFilter(positive, negative) { + const [absoluteNegative, relativeNegative] = utils.pattern.partitionAbsoluteAndRelative(negative); + const patterns = { + positive: { + all: utils.pattern.convertPatternsToRe(positive, this._micromatchOptions) + }, + negative: { + absolute: utils.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })), + relative: utils.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })) + } + }; + return (entry) => this._filter(entry, patterns); + } + _filter(entry, patterns) { + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._settings.unique && this._isDuplicateEntry(filepath)) { + return false; + } + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; + } + const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory()); + if (this._settings.unique && isMatched) { + this._createIndexRecord(filepath); + } + return isMatched; + } + _isDuplicateEntry(filepath) { + return this.index.has(filepath); + } + _createIndexRecord(filepath) { + this.index.set(filepath, void 0); + } + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); + } + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); + } + _isMatchToPatternsSet(filepath, patterns, isDirectory2) { + const isMatched = this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory2); + if (!isMatched) { + return false; + } + const isMatchedByRelativeNegative = this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory2); + if (isMatchedByRelativeNegative) { + return false; + } + const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory2); + if (isMatchedByAbsoluteNegative) { + return false; + } + return true; + } + _isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory2) { + if (patternsRe.length === 0) { + return false; + } + const fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath); + return this._isMatchToPatterns(fullpath, patternsRe, isDirectory2); + } + _isMatchToPatterns(filepath, patternsRe, isDirectory2) { + if (patternsRe.length === 0) { + return false; + } + const isMatched = utils.pattern.matchAny(filepath, patternsRe); + if (!isMatched && isDirectory2) { + return utils.pattern.matchAny(filepath + "/", patternsRe); + } + return isMatched; + } + }; + exports.default = EntryFilter; + } +}); + +// node_modules/fast-glob/out/providers/filters/error.js +var require_error = __commonJS({ + "node_modules/fast-glob/out/providers/filters/error.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var ErrorFilter = class { + constructor(_settings) { + this._settings = _settings; + } + getFilter() { + return (error) => this._isNonFatalError(error); + } + _isNonFatalError(error) { + return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; + } + }; + exports.default = ErrorFilter; + } +}); + +// node_modules/fast-glob/out/providers/transformers/entry.js +var require_entry2 = __commonJS({ + "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var EntryTransformer = class { + constructor(_settings) { + this._settings = _settings; + } + getTransformer() { + return (entry) => this._transform(entry); + } + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils.path.unixify(filepath); + } + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += "/"; + } + if (!this._settings.objectMode) { + return filepath; + } + return Object.assign(Object.assign({}, entry), { path: filepath }); + } + }; + exports.default = EntryTransformer; + } +}); + +// node_modules/fast-glob/out/providers/provider.js +var require_provider = __commonJS({ + "node_modules/fast-glob/out/providers/provider.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path13 = __require("path"); + var deep_1 = require_deep(); + var entry_1 = require_entry(); + var error_1 = require_error(); + var entry_2 = require_entry2(); + var Provider = class { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); + } + _getRootDirectory(task) { + return path13.resolve(this._settings.cwd, task.base); + } + _getReaderOptions(task) { + const basePath = task.base === "." ? "" : task.base; + return { + basePath, + pathSegmentSeparator: "/", + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() + }; + } + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false + }; + } + }; + exports.default = Provider; + } +}); + +// node_modules/fast-glob/out/providers/async.js +var require_async6 = __commonJS({ + "node_modules/fast-glob/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var async_1 = require_async5(); + var provider_1 = require_provider(); + var ProviderAsync = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new async_1.default(this._settings); + } + async read(task) { + const root2 = this._getRootDirectory(task); + const options8 = this._getReaderOptions(task); + const entries = await this.api(root2, task, options8); + return entries.map((entry) => options8.transform(entry)); + } + api(root2, task, options8) { + if (task.dynamic) { + return this._reader.dynamic(root2, options8); + } + return this._reader.static(task.patterns, options8); + } + }; + exports.default = ProviderAsync; + } +}); + +// node_modules/fast-glob/out/providers/stream.js +var require_stream4 = __commonJS({ + "node_modules/fast-glob/out/providers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = __require("stream"); + var stream_2 = require_stream3(); + var provider_1 = require_provider(); + var ProviderStream = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); + } + read(task) { + const root2 = this._getRootDirectory(task); + const options8 = this._getReaderOptions(task); + const source2 = this.api(root2, task, options8); + const destination = new stream_1.Readable({ objectMode: true, read: () => { + } }); + source2.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options8.transform(entry))).once("end", () => destination.emit("end")); + destination.once("close", () => source2.destroy()); + return destination; + } + api(root2, task, options8) { + if (task.dynamic) { + return this._reader.dynamic(root2, options8); + } + return this._reader.static(task.patterns, options8); + } + }; + exports.default = ProviderStream; + } +}); + +// node_modules/fast-glob/out/readers/sync.js +var require_sync5 = __commonJS({ + "node_modules/fast-glob/out/readers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsStat = require_out(); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var ReaderSync = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; + } + dynamic(root2, options8) { + return this._walkSync(root2, options8); + } + static(patterns, options8) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options8); + if (entry === null || !options8.entryFilter(entry)) { + continue; + } + entries.push(entry); + } + return entries; + } + _getEntry(filepath, pattern, options8) { + try { + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); + } catch (error) { + if (options8.errorFilter(error)) { + return null; + } + throw error; + } + } + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); + } + }; + exports.default = ReaderSync; + } +}); + +// node_modules/fast-glob/out/providers/sync.js +var require_sync6 = __commonJS({ + "node_modules/fast-glob/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var sync_1 = require_sync5(); + var provider_1 = require_provider(); + var ProviderSync = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1.default(this._settings); + } + read(task) { + const root2 = this._getRootDirectory(task); + const options8 = this._getReaderOptions(task); + const entries = this.api(root2, task, options8); + return entries.map(options8.transform); + } + api(root2, task, options8) { + if (task.dynamic) { + return this._reader.dynamic(root2, options8); + } + return this._reader.static(task.patterns, options8); + } + }; + exports.default = ProviderSync; + } +}); + +// node_modules/fast-glob/out/settings.js +var require_settings4 = __commonJS({ + "node_modules/fast-glob/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; + var fs7 = __require("fs"); + var os2 = __require("os"); + var CPU_COUNT = Math.max(os2.cpus().length, 1); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs7.lstat, + lstatSync: fs7.lstatSync, + stat: fs7.stat, + statSync: fs7.statSync, + readdir: fs7.readdir, + readdirSync: fs7.readdirSync + }; + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; + } + if (this.stats) { + this.objectMode = true; + } + this.ignore = [].concat(this.ignore); + } + _getValue(option, value) { + return option === void 0 ? value : option; + } + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); + } + }; + exports.default = Settings; + } +}); + +// node_modules/fast-glob/out/index.js +var require_out4 = __commonJS({ + "node_modules/fast-glob/out/index.js"(exports, module) { + "use strict"; + var taskManager = require_tasks(); + var async_1 = require_async6(); + var stream_1 = require_stream4(); + var sync_1 = require_sync6(); + var settings_1 = require_settings4(); + var utils = require_utils3(); + async function FastGlob(source2, options8) { + assertPatternsInput(source2); + const works = getWorks(source2, async_1.default, options8); + const result = await Promise.all(works); + return utils.array.flatten(result); + } + (function(FastGlob2) { + FastGlob2.glob = FastGlob2; + FastGlob2.globSync = sync; + FastGlob2.globStream = stream; + FastGlob2.async = FastGlob2; + function sync(source2, options8) { + assertPatternsInput(source2); + const works = getWorks(source2, sync_1.default, options8); + return utils.array.flatten(works); + } + FastGlob2.sync = sync; + function stream(source2, options8) { + assertPatternsInput(source2); + const works = getWorks(source2, stream_1.default, options8); + return utils.stream.merge(works); + } + FastGlob2.stream = stream; + function generateTasks(source2, options8) { + assertPatternsInput(source2); + const patterns = [].concat(source2); + const settings = new settings_1.default(options8); + return taskManager.generate(patterns, settings); + } + FastGlob2.generateTasks = generateTasks; + function isDynamicPattern(source2, options8) { + assertPatternsInput(source2); + const settings = new settings_1.default(options8); + return utils.pattern.isDynamicPattern(source2, settings); + } + FastGlob2.isDynamicPattern = isDynamicPattern; + function escapePath(source2) { + assertPatternsInput(source2); + return utils.path.escape(source2); + } + FastGlob2.escapePath = escapePath; + function convertPathToPattern(source2) { + assertPatternsInput(source2); + return utils.path.convertPathToPattern(source2); + } + FastGlob2.convertPathToPattern = convertPathToPattern; + let posix; + (function(posix2) { + function escapePath2(source2) { + assertPatternsInput(source2); + return utils.path.escapePosixPath(source2); + } + posix2.escapePath = escapePath2; + function convertPathToPattern2(source2) { + assertPatternsInput(source2); + return utils.path.convertPosixPathToPattern(source2); + } + posix2.convertPathToPattern = convertPathToPattern2; + })(posix = FastGlob2.posix || (FastGlob2.posix = {})); + let win32; + (function(win322) { + function escapePath2(source2) { + assertPatternsInput(source2); + return utils.path.escapeWindowsPath(source2); + } + win322.escapePath = escapePath2; + function convertPathToPattern2(source2) { + assertPatternsInput(source2); + return utils.path.convertWindowsPathToPattern(source2); + } + win322.convertPathToPattern = convertPathToPattern2; + })(win32 = FastGlob2.win32 || (FastGlob2.win32 = {})); + })(FastGlob || (FastGlob = {})); + function getWorks(source2, _Provider, options8) { + const patterns = [].concat(source2); + const settings = new settings_1.default(options8); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); + } + function assertPatternsInput(input) { + const source2 = [].concat(input); + const isValidSource = source2.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError("Patterns must be a string (non empty) or an array of strings"); + } + } + module.exports = FastGlob; + } +}); + +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports, module) { + var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module.exports = debug; + } +}); + +// node_modules/semver/internal/constants.js +var require_constants4 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports, module) { + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; + } +}); + +// node_modules/semver/internal/re.js +var require_re = __commonJS({ + "node_modules/semver/internal/re.js"(exports, module) { + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants4(); + var debug = require_debug(); + exports = module.exports = {}; + var re = exports.re = []; + var safeRe = exports.safeRe = []; + var src = exports.src = []; + var safeSrc = exports.safeSrc = []; + var t = exports.t = {}; + var R = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token2, max] of safeRegexReplacements) { + value = value.split(`${token2}*`).join(`${token2}{0,${max}}`).split(`${token2}+`).join(`${token2}{1,${max}}`); + } + return value; + }; + var createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug(name, index, value); + t[name] = index; + src[index] = value; + safeSrc[index] = safe; + re[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); + createToken("FULL", `^${src[t.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); + createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t.COERCE], true); + createToken("COERCERTLFULL", src[t.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); + exports.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); + exports.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); + exports.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + } +}); + +// node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "node_modules/semver/internal/parse-options.js"(exports, module) { + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options8) => { + if (!options8) { + return emptyOpts; + } + if (typeof options8 !== "object") { + return looseOption; + } + return options8; + }; + module.exports = parseOptions; + } +}); + +// node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "node_modules/semver/internal/identifiers.js"(exports, module) { + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a, b) => { + const anum = numeric.test(a); + const bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; + }; + var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); + module.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "node_modules/semver/classes/semver.js"(exports, module) { + var debug = require_debug(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants4(); + var { safeRe: re, safeSrc: src, t } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var SemVer = class _SemVer { + constructor(version, options8) { + options8 = parseOptions(options8); + if (version instanceof _SemVer) { + if (version.loose === !!options8.loose && version.includePrerelease === !!options8.includePrerelease) { + return version; + } else { + version = version.version; + } + } else if (typeof version !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); + } + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); + } + debug("SemVer", version, options8); + this.options = options8; + this.loose = !!options8.loose; + this.includePrerelease = !!options8.includePrerelease; + const m = version.trim().match(options8.loose ? re[t.LOOSE] : re[t.FULL]); + if (!m) { + throw new TypeError(`Invalid Version: ${version}`); + } + this.raw = version; + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } + this.build = m[5] ? m[5].split(".") : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new _SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + } + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug("prerelease compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug("build compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`); + const match = `-${identifier}`.match(r); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); + } + } + } + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === "number") { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; + } + }; + module.exports = SemVer; + } +}); + +// node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + "node_modules/semver/functions/compare.js"(exports, module) { + var SemVer = require_semver(); + var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); + module.exports = compare; + } +}); + +// node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + "node_modules/semver/functions/gte.js"(exports, module) { + var compare = require_compare(); + var gte = (a, b, loose) => compare(a, b, loose) >= 0; + module.exports = gte; + } +}); + +// node_modules/pseudomap/pseudomap.js +var require_pseudomap = __commonJS({ + "node_modules/pseudomap/pseudomap.js"(exports, module) { + var hasOwnProperty3 = Object.prototype.hasOwnProperty; + module.exports = PseudoMap; + function PseudoMap(set3) { + if (!(this instanceof PseudoMap)) + throw new TypeError("Constructor PseudoMap requires 'new'"); + this.clear(); + if (set3) { + if (set3 instanceof PseudoMap || typeof Map === "function" && set3 instanceof Map) + set3.forEach(function(value, key2) { + this.set(key2, value); + }, this); + else if (Array.isArray(set3)) + set3.forEach(function(kv) { + this.set(kv[0], kv[1]); + }, this); + else + throw new TypeError("invalid argument"); + } + } + PseudoMap.prototype.forEach = function(fn, thisp) { + thisp = thisp || this; + Object.keys(this._data).forEach(function(k) { + if (k !== "size") + fn.call(thisp, this._data[k].value, this._data[k].key); + }, this); + }; + PseudoMap.prototype.has = function(k) { + return !!find(this._data, k); + }; + PseudoMap.prototype.get = function(k) { + var res = find(this._data, k); + return res && res.value; + }; + PseudoMap.prototype.set = function(k, v) { + set2(this._data, k, v); + }; + PseudoMap.prototype.delete = function(k) { + var res = find(this._data, k); + if (res) { + delete this._data[res._index]; + this._data.size--; + } + }; + PseudoMap.prototype.clear = function() { + var data = /* @__PURE__ */ Object.create(null); + data.size = 0; + Object.defineProperty(this, "_data", { + value: data, + enumerable: false, + configurable: true, + writable: false + }); + }; + Object.defineProperty(PseudoMap.prototype, "size", { + get: function() { + return this._data.size; + }, + set: function(n) { + }, + enumerable: true, + configurable: true + }); + PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() { + throw new Error("iterators are not implemented in this version"); + }; + function same(a, b) { + return a === b || a !== a && b !== b; + } + function Entry(k, v, i) { + this.key = k; + this.value = v; + this._index = i; + } + function find(data, k) { + for (var i = 0, s = "_" + k, key2 = s; hasOwnProperty3.call(data, key2); key2 = s + i++) { + if (same(data[key2].key, k)) + return data[key2]; + } + } + function set2(data, k, v) { + for (var i = 0, s = "_" + k, key2 = s; hasOwnProperty3.call(data, key2); key2 = s + i++) { + if (same(data[key2].key, k)) { + data[key2].value = v; + return; + } + } + data.size++; + data[key2] = new Entry(k, v, key2); + } + } +}); + +// node_modules/pseudomap/map.js +var require_map = __commonJS({ + "node_modules/pseudomap/map.js"(exports, module) { + if (process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test") + process.env.TEST_PSEUDOMAP = "true"; + if (typeof Map === "function" && !process.env.TEST_PSEUDOMAP) { + module.exports = Map; + } else { + module.exports = require_pseudomap(); + } + } +}); + +// node_modules/yallist/yallist.js +var require_yallist = __commonJS({ + "node_modules/yallist/yallist.js"(exports, module) { + module.exports = Yallist; + Yallist.Node = Node; + Yallist.create = Yallist; + function Yallist(list) { + var self = this; + if (!(self instanceof Yallist)) { + self = new Yallist(); + } + self.tail = null; + self.head = null; + self.length = 0; + if (list && typeof list.forEach === "function") { + list.forEach(function(item) { + self.push(item); + }); + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]); + } + } + return self; + } + Yallist.prototype.removeNode = function(node) { + if (node.list !== this) { + throw new Error("removing node which does not belong to this list"); + } + var next = node.next; + var prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + node.list.length--; + node.next = null; + node.prev = null; + node.list = null; + }; + Yallist.prototype.unshiftNode = function(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; + }; + Yallist.prototype.pushNode = function(node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; + }; + Yallist.prototype.push = function() { + for (var i = 0, l = arguments.length; i < l; i++) { + push2(this, arguments[i]); + } + return this.length; + }; + Yallist.prototype.unshift = function() { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]); + } + return this.length; + }; + Yallist.prototype.pop = function() { + if (!this.tail) { + return void 0; + } + var res = this.tail.value; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = null; + } else { + this.head = null; + } + this.length--; + return res; + }; + Yallist.prototype.shift = function() { + if (!this.head) { + return void 0; + } + var res = this.head.value; + this.head = this.head.next; + if (this.head) { + this.head.prev = null; + } else { + this.tail = null; + } + this.length--; + return res; + }; + Yallist.prototype.forEach = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this); + walker = walker.next; + } + }; + Yallist.prototype.forEachReverse = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this); + walker = walker.prev; + } + }; + Yallist.prototype.get = function(n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + walker = walker.next; + } + if (i === n && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.getReverse = function(n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + walker = walker.prev; + } + if (i === n && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.map = function(fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.head; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; + }; + Yallist.prototype.mapReverse = function(fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.tail; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; + }; + Yallist.prototype.reduce = function(fn, initial) { + var acc; + var walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; + } + return acc; + }; + Yallist.prototype.reduceReverse = function(fn, initial) { + var acc; + var walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; + } + return acc; + }; + Yallist.prototype.toArray = function() { + var arr = new Array(this.length); + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; + }; + Yallist.prototype.toArrayReverse = function() { + var arr = new Array(this.length); + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; + }; + Yallist.prototype.slice = function(from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next; + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.sliceReverse = function(from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev; + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.reverse = function() { + var head = this.head; + var tail = this.tail; + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; + }; + function push2(self, item) { + self.tail = new Node(item, self.tail, null, self); + if (!self.head) { + self.head = self.tail; + } + self.length++; + } + function unshift(self, item) { + self.head = new Node(item, null, self.head, self); + if (!self.tail) { + self.tail = self.head; + } + self.length++; + } + function Node(value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list); + } + this.list = list; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } else { + this.prev = null; + } + if (next) { + next.prev = this; + this.next = next; + } else { + this.next = null; + } + } + } +}); + +// node_modules/editorconfig/node_modules/lru-cache/index.js +var require_lru_cache = __commonJS({ + "node_modules/editorconfig/node_modules/lru-cache/index.js"(exports, module) { + "use strict"; + module.exports = LRUCache; + var Map2 = require_map(); + var util2 = __require("util"); + var Yallist = require_yallist(); + var hasSymbol = typeof Symbol === "function" && process.env._nodeLRUCacheForceNoSymbol !== "1"; + var makeSymbol; + if (hasSymbol) { + makeSymbol = function(key2) { + return Symbol(key2); + }; + } else { + makeSymbol = function(key2) { + return "_" + key2; + }; + } + var MAX = makeSymbol("max"); + var LENGTH = makeSymbol("length"); + var LENGTH_CALCULATOR = makeSymbol("lengthCalculator"); + var ALLOW_STALE = makeSymbol("allowStale"); + var MAX_AGE = makeSymbol("maxAge"); + var DISPOSE = makeSymbol("dispose"); + var NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet"); + var LRU_LIST = makeSymbol("lruList"); + var CACHE = makeSymbol("cache"); + function naiveLength() { + return 1; + } + function LRUCache(options8) { + if (!(this instanceof LRUCache)) { + return new LRUCache(options8); + } + if (typeof options8 === "number") { + options8 = { max: options8 }; + } + if (!options8) { + options8 = {}; + } + var max = this[MAX] = options8.max; + if (!max || !(typeof max === "number") || max <= 0) { + this[MAX] = Infinity; + } + var lc = options8.length || naiveLength; + if (typeof lc !== "function") { + lc = naiveLength; + } + this[LENGTH_CALCULATOR] = lc; + this[ALLOW_STALE] = options8.stale || false; + this[MAX_AGE] = options8.maxAge || 0; + this[DISPOSE] = options8.dispose; + this[NO_DISPOSE_ON_SET] = options8.noDisposeOnSet || false; + this.reset(); + } + Object.defineProperty(LRUCache.prototype, "max", { + set: function(mL) { + if (!mL || !(typeof mL === "number") || mL <= 0) { + mL = Infinity; + } + this[MAX] = mL; + trim2(this); + }, + get: function() { + return this[MAX]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "allowStale", { + set: function(allowStale) { + this[ALLOW_STALE] = !!allowStale; + }, + get: function() { + return this[ALLOW_STALE]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "maxAge", { + set: function(mA) { + if (!mA || !(typeof mA === "number") || mA < 0) { + mA = 0; + } + this[MAX_AGE] = mA; + trim2(this); + }, + get: function() { + return this[MAX_AGE]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "lengthCalculator", { + set: function(lC) { + if (typeof lC !== "function") { + lC = naiveLength; + } + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC; + this[LENGTH] = 0; + this[LRU_LIST].forEach(function(hit) { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); + this[LENGTH] += hit.length; + }, this); + } + trim2(this); + }, + get: function() { + return this[LENGTH_CALCULATOR]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "length", { + get: function() { + return this[LENGTH]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "itemCount", { + get: function() { + return this[LRU_LIST].length; + }, + enumerable: true + }); + LRUCache.prototype.rforEach = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this[LRU_LIST].tail; walker !== null; ) { + var prev = walker.prev; + forEachStep(this, fn, walker, thisp); + walker = prev; + } + }; + function forEachStep(self, fn, node, thisp) { + var hit = node.value; + if (isStale(self, hit)) { + del(self, node); + if (!self[ALLOW_STALE]) { + hit = void 0; + } + } + if (hit) { + fn.call(thisp, hit.value, hit.key, self); + } + } + LRUCache.prototype.forEach = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this[LRU_LIST].head; walker !== null; ) { + var next = walker.next; + forEachStep(this, fn, walker, thisp); + walker = next; + } + }; + LRUCache.prototype.keys = function() { + return this[LRU_LIST].toArray().map(function(k) { + return k.key; + }, this); + }; + LRUCache.prototype.values = function() { + return this[LRU_LIST].toArray().map(function(k) { + return k.value; + }, this); + }; + LRUCache.prototype.reset = function() { + if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { + this[LRU_LIST].forEach(function(hit) { + this[DISPOSE](hit.key, hit.value); + }, this); + } + this[CACHE] = new Map2(); + this[LRU_LIST] = new Yallist(); + this[LENGTH] = 0; + }; + LRUCache.prototype.dump = function() { + return this[LRU_LIST].map(function(hit) { + if (!isStale(this, hit)) { + return { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }; + } + }, this).toArray().filter(function(h) { + return h; + }); + }; + LRUCache.prototype.dumpLru = function() { + return this[LRU_LIST]; + }; + LRUCache.prototype.inspect = function(n, opts) { + var str2 = "LRUCache {"; + var extras = false; + var as = this[ALLOW_STALE]; + if (as) { + str2 += "\n allowStale: true"; + extras = true; + } + var max = this[MAX]; + if (max && max !== Infinity) { + if (extras) { + str2 += ","; + } + str2 += "\n max: " + util2.inspect(max, opts); + extras = true; + } + var maxAge = this[MAX_AGE]; + if (maxAge) { + if (extras) { + str2 += ","; + } + str2 += "\n maxAge: " + util2.inspect(maxAge, opts); + extras = true; + } + var lc = this[LENGTH_CALCULATOR]; + if (lc && lc !== naiveLength) { + if (extras) { + str2 += ","; + } + str2 += "\n length: " + util2.inspect(this[LENGTH], opts); + extras = true; + } + var didFirst = false; + this[LRU_LIST].forEach(function(item) { + if (didFirst) { + str2 += ",\n "; + } else { + if (extras) { + str2 += ",\n"; + } + didFirst = true; + str2 += "\n "; + } + var key2 = util2.inspect(item.key).split("\n").join("\n "); + var val = { value: item.value }; + if (item.maxAge !== maxAge) { + val.maxAge = item.maxAge; + } + if (lc !== naiveLength) { + val.length = item.length; + } + if (isStale(this, item)) { + val.stale = true; + } + val = util2.inspect(val, opts).split("\n").join("\n "); + str2 += key2 + " => " + val; + }); + if (didFirst || extras) { + str2 += "\n"; + } + str2 += "}"; + return str2; + }; + LRUCache.prototype.set = function(key2, value, maxAge) { + maxAge = maxAge || this[MAX_AGE]; + var now = maxAge ? Date.now() : 0; + var len = this[LENGTH_CALCULATOR](value, key2); + if (this[CACHE].has(key2)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key2)); + return false; + } + var node = this[CACHE].get(key2); + var item = node.value; + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) { + this[DISPOSE](key2, item.value); + } + } + item.now = now; + item.maxAge = maxAge; + item.value = value; + this[LENGTH] += len - item.length; + item.length = len; + this.get(key2); + trim2(this); + return true; + } + var hit = new Entry(key2, value, len, now, maxAge); + if (hit.length > this[MAX]) { + if (this[DISPOSE]) { + this[DISPOSE](key2, value); + } + return false; + } + this[LENGTH] += hit.length; + this[LRU_LIST].unshift(hit); + this[CACHE].set(key2, this[LRU_LIST].head); + trim2(this); + return true; + }; + LRUCache.prototype.has = function(key2) { + if (!this[CACHE].has(key2)) return false; + var hit = this[CACHE].get(key2).value; + if (isStale(this, hit)) { + return false; + } + return true; + }; + LRUCache.prototype.get = function(key2) { + return get(this, key2, true); + }; + LRUCache.prototype.peek = function(key2) { + return get(this, key2, false); + }; + LRUCache.prototype.pop = function() { + var node = this[LRU_LIST].tail; + if (!node) return null; + del(this, node); + return node.value; + }; + LRUCache.prototype.del = function(key2) { + del(this, this[CACHE].get(key2)); + }; + LRUCache.prototype.load = function(arr) { + this.reset(); + var now = Date.now(); + for (var l = arr.length - 1; l >= 0; l--) { + var hit = arr[l]; + var expiresAt = hit.e || 0; + if (expiresAt === 0) { + this.set(hit.k, hit.v); + } else { + var maxAge = expiresAt - now; + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge); + } + } + } + }; + LRUCache.prototype.prune = function() { + var self = this; + this[CACHE].forEach(function(value, key2) { + get(self, key2, false); + }); + }; + function get(self, key2, doUse) { + var node = self[CACHE].get(key2); + if (node) { + var hit = node.value; + if (isStale(self, hit)) { + del(self, node); + if (!self[ALLOW_STALE]) hit = void 0; + } else { + if (doUse) { + self[LRU_LIST].unshiftNode(node); + } + } + if (hit) hit = hit.value; + } + return hit; + } + function isStale(self, hit) { + if (!hit || !hit.maxAge && !self[MAX_AGE]) { + return false; + } + var stale = false; + var diff2 = Date.now() - hit.now; + if (hit.maxAge) { + stale = diff2 > hit.maxAge; + } else { + stale = self[MAX_AGE] && diff2 > self[MAX_AGE]; + } + return stale; + } + function trim2(self) { + if (self[LENGTH] > self[MAX]) { + for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) { + var prev = walker.prev; + del(self, walker); + walker = prev; + } + } + } + function del(self, node) { + if (node) { + var hit = node.value; + if (self[DISPOSE]) { + self[DISPOSE](hit.key, hit.value); + } + self[LENGTH] -= hit.length; + self[CACHE].delete(hit.key); + self[LRU_LIST].removeNode(node); + } + } + function Entry(key2, value, length, now, maxAge) { + this.key = key2; + this.value = value; + this.length = length; + this.now = now; + this.maxAge = maxAge || 0; + } + } +}); + +// node_modules/sigmund/sigmund.js +var require_sigmund = __commonJS({ + "node_modules/sigmund/sigmund.js"(exports, module) { + module.exports = sigmund; + function sigmund(subject, maxSessions) { + maxSessions = maxSessions || 10; + var notes = []; + var analysis = ""; + var RE = RegExp; + function psychoAnalyze(subject2, session) { + if (session > maxSessions) return; + if (typeof subject2 === "function" || typeof subject2 === "undefined") { + return; + } + if (typeof subject2 !== "object" || !subject2 || subject2 instanceof RE) { + analysis += subject2; + return; + } + if (notes.indexOf(subject2) !== -1 || session === maxSessions) return; + notes.push(subject2); + analysis += "{"; + Object.keys(subject2).forEach(function(issue, _, __) { + if (issue.charAt(0) === "_") return; + var to = typeof subject2[issue]; + if (to === "function" || to === "undefined") return; + analysis += issue; + psychoAnalyze(subject2[issue], session + 1); + }); + } + psychoAnalyze(subject, 0); + return analysis; + } + } +}); + +// node_modules/editorconfig/src/lib/fnmatch.js +var require_fnmatch = __commonJS({ + "node_modules/editorconfig/src/lib/fnmatch.js"(exports, module) { + var platform = typeof process === "object" ? process.platform : "win32"; + if (module) module.exports = minimatch; + else exports.minimatch = minimatch; + minimatch.Minimatch = Minimatch; + var LRU = require_lru_cache(); + var cache3 = minimatch.cache = new LRU({ max: 100 }); + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var sigmund = require_sigmund(); + var path13 = __require("path"); + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c2) { + set2[c2] = true; + return set2; + }, {}); + } + var slashSplit = /\/+/; + minimatch.monkeyPatch = monkeyPatch; + function monkeyPatch() { + var desc = Object.getOwnPropertyDescriptor(String.prototype, "match"); + var orig = desc.value; + desc.value = function(p) { + if (p instanceof Minimatch) return p.match(this); + return orig.call(this, p); + }; + Object.defineProperty(String.prototype, desc); + } + minimatch.filter = filter2; + function filter2(pattern, options8) { + options8 = options8 || {}; + return function(p, i, list) { + return minimatch(p, pattern, options8); + }; + } + function ext(a, b) { + a = a || {}; + b = b || {}; + var t = {}; + Object.keys(b).forEach(function(k) { + t[k] = b[k]; + }); + Object.keys(a).forEach(function(k) { + t[k] = a[k]; + }); + return t; + } + minimatch.defaults = function(def) { + if (!def || !Object.keys(def).length) return minimatch; + var orig = minimatch; + var m = function minimatch2(p, pattern, options8) { + return orig.minimatch(p, pattern, ext(def, options8)); + }; + m.Minimatch = function Minimatch2(pattern, options8) { + return new orig.Minimatch(pattern, ext(def, options8)); + }; + return m; + }; + Minimatch.defaults = function(def) { + if (!def || !Object.keys(def).length) return Minimatch; + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options8) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required"); + } + if (!options8) options8 = {}; + if (!options8.nocomment && pattern.charAt(0) === "#") { + return false; + } + if (pattern.trim() === "") return p === ""; + return new Minimatch(pattern, options8).match(p); + } + function Minimatch(pattern, options8) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options8, cache3); + } + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required"); + } + if (!options8) options8 = {}; + if (platform === "win32") { + pattern = pattern.split("\\").join("/"); + } + var cacheKey = pattern + "\n" + sigmund(options8); + var cached = minimatch.cache.get(cacheKey); + if (cached) return cached; + minimatch.cache.set(cacheKey, this); + this.options = options8; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.make(); + } + Minimatch.prototype.make = make; + function make() { + if (this._made) return; + var pattern = this.pattern; + var options8 = this.options; + if (!options8.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + this.parseNegate(); + var set2 = this.globSet = this.braceExpand(); + if (options8.debug) console.error(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + if (options8.debug) console.error(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + if (options8.debug) console.error(this.pattern, set2); + set2 = set2.filter(function(s) { + return -1 === s.indexOf(false); + }); + if (options8.debug) console.error(this.pattern, set2); + this.set = set2; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern, negate = false, options8 = this.options, negateOffset = 0; + if (options8.nonegate) return; + for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options8) { + return new Minimatch(pattern, options8).braceExpand(); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options8) { + options8 = options8 || this.options; + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + if (typeof pattern === "undefined") { + throw new Error("undefined pattern"); + } + if (options8.nobrace || !pattern.match(/\{.*\}/)) { + return [pattern]; + } + var escaping = false; + if (pattern.charAt(0) !== "{") { + var prefix = null; + for (var i = 0, l = pattern.length; i < l; i++) { + var c2 = pattern.charAt(i); + if (c2 === "\\") { + escaping = !escaping; + } else if (c2 === "{" && !escaping) { + prefix = pattern.substr(0, i); + break; + } + } + if (prefix === null) { + return [pattern]; + } + var tail = braceExpand(pattern.substr(i), options8); + return tail.map(function(t) { + return prefix + t; + }); + } + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/); + if (numset) { + var suf = braceExpand(pattern.substr(numset[0].length), options8), start = +numset[1], end = +numset[2], inc = start > end ? -1 : 1, set2 = []; + for (var i = start; i != end + inc; i += inc) { + for (var ii = 0, ll = suf.length; ii < ll; ii++) { + set2.push(i + suf[ii]); + } + } + return set2; + } + var i = 1, depth = 1, set2 = [], member = "", sawEnd = false, escaping = false; + function addMember() { + set2.push(member); + member = ""; + } + FOR: for (i = 1, l = pattern.length; i < l; i++) { + var c2 = pattern.charAt(i); + if (escaping) { + escaping = false; + member += "\\" + c2; + } else { + switch (c2) { + case "\\": + escaping = true; + continue; + case "{": + depth++; + member += "{"; + continue; + case "}": + depth--; + if (depth === 0) { + addMember(); + i++; + break FOR; + } else { + member += c2; + continue; + } + case ",": + if (depth === 1) { + addMember(); + } else { + member += c2; + } + continue; + default: + member += c2; + continue; + } + } + } + if (depth !== 0) { + return braceExpand("\\" + pattern, options8); + } + var suf = braceExpand(pattern.substr(i), options8); + var addBraces = set2.length === 1; + set2 = set2.map(function(p) { + return braceExpand(p, options8); + }); + set2 = set2.reduce(function(l2, r) { + return l2.concat(r); + }); + if (addBraces) { + set2 = set2.map(function(s) { + return "{" + s + "}"; + }); + } + var ret = []; + for (var i = 0, l = set2.length; i < l; i++) { + for (var ii = 0, ll = suf.length; ii < ll; ii++) { + ret.push(set2[i] + suf[ii]); + } + } + return ret; + } + Minimatch.prototype.parse = parse7; + var SUBPARSE = {}; + function parse7(pattern, isSub) { + var options8 = this.options; + if (!options8.noglobstar && pattern === "**") return GLOBSTAR; + if (pattern === "") return ""; + var re = "", hasMagic = !!options8.nocase, escaping = false, patternListStack = [], plType, stateChar, inClass = false, reClassStart = -1, classStart = -1, patternStart = pattern.charAt(0) === "." ? "" : options8.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + function clearStateChar() { + if (stateChar) { + switch (stateChar) { + case "*": + re += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; + } + stateChar = false; + } + } + for (var i = 0, len = pattern.length, c2; i < len && (c2 = pattern.charAt(i)); i++) { + if (options8.debug) { + console.error("%s %s %s %j", pattern, i, re, c2); + } + if (escaping && reSpecials[c2]) { + re += "\\" + c2; + escaping = false; + continue; + } + SWITCH: switch (c2) { + case "/": + return false; + case "\\": + clearStateChar(); + escaping = true; + continue; + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + if (options8.debug) { + console.error("%s %s %s %j <-- stateChar", pattern, i, re, c2); + } + if (inClass) { + if (c2 === "!" && i === classStart + 1) c2 = "^"; + re += c2; + continue; + } + clearStateChar(); + stateChar = c2; + if (options8.noext) clearStateChar(); + continue; + case "(": + if (inClass) { + re += "("; + continue; + } + if (!stateChar) { + re += "\\("; + continue; + } + plType = stateChar; + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }); + re += stateChar === "!" ? "(?:(?!" : "(?:"; + stateChar = false; + continue; + case ")": + if (inClass || !patternListStack.length) { + re += "\\)"; + continue; + } + hasMagic = true; + re += ")"; + plType = patternListStack.pop().type; + switch (plType) { + case "!": + re += "[^/]*?)"; + break; + case "?": + case "+": + case "*": + re += plType; + case "@": + break; + } + continue; + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|"; + escaping = false; + continue; + } + re += "|"; + continue; + // these are mostly the same in regexp and glob + case "[": + clearStateChar(); + if (inClass) { + re += "\\" + c2; + continue; + } + inClass = true; + classStart = i; + reClassStart = re.length; + re += c2; + continue; + case "]": + if (i === classStart + 1 || !inClass) { + re += "\\" + c2; + escaping = false; + continue; + } + hasMagic = true; + inClass = false; + re += c2; + continue; + default: + clearStateChar(); + if (escaping) { + escaping = false; + } else if (reSpecials[c2] && !(c2 === "^" && inClass)) { + re += "\\"; + } + re += c2; + } + } + if (inClass) { + var cs = pattern.substr(classStart + 1), sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; + } + var pl; + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3); + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + var addPatternStart = false; + switch (re.charAt(0)) { + case ".": + case "[": + case "(": + addPatternStart = true; + } + if (re !== "" && hasMagic) re = "(?=.)" + re; + if (addPatternStart) re = patternStart + re; + if (isSub === SUBPARSE) { + return [re, hasMagic]; + } + if (!hasMagic) { + return globUnescape(pattern); + } + var flags = options8.nocase ? "i" : "", regExp = new RegExp("^" + re + "$", flags); + regExp._glob = pattern; + regExp._src = re; + return regExp; + } + minimatch.makeRe = function(pattern, options8) { + return new Minimatch(pattern, options8 || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) return this.regexp = false; + var options8 = this.options; + var twoStar = options8.noglobstar ? star : options8.dot ? twoStarDot : twoStarNoDot, flags = options8.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; + }).join("\\/"); + }).join("|"); + re = "^(?:" + re + ")$"; + if (this.negate) re = "^(?!" + re + ").*$"; + try { + return this.regexp = new RegExp(re, flags); + } catch (ex) { + return this.regexp = false; + } + } + minimatch.match = function(list, pattern, options8) { + var mm = new Minimatch(pattern, options8); + list = list.filter(function(f) { + return mm.match(f); + }); + if (options8.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = match; + function match(f, partial) { + if (this.comment) return false; + if (this.empty) return f === ""; + if (f === "/" && partial) return true; + var options8 = this.options; + if (platform === "win32") { + f = f.split("\\").join("/"); + } + f = f.split(slashSplit); + if (options8.debug) { + console.error(this.pattern, "split", f); + } + var set2 = this.set; + for (var i = 0, l = set2.length; i < l; i++) { + var pattern = set2[i]; + var hit = this.matchOne(f, pattern, partial); + if (hit) { + if (options8.flipNegate) return true; + return !this.negate; + } + } + if (options8.flipNegate) return false; + return this.negate; + } + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options8 = this.options; + if (options8.debug) { + console.error( + "matchOne", + { + "this": this, + file, + pattern + } + ); + } + if (options8.matchBase && pattern.length === 1) { + file = path13.basename(file.join("/")).split("/"); + } + if (options8.debug) { + console.error("matchOne", file.length, pattern.length); + } + for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + if (options8.debug) { + console.error("matchOne loop"); + } + var p = pattern[pi], f = file[fi]; + if (options8.debug) { + console.error(pattern, p, f); + } + if (p === false) return false; + if (p === GLOBSTAR) { + if (options8.debug) + console.error("GLOBSTAR", [pattern, p, f]); + var fr = fi, pr = pi + 1; + if (pr === pl) { + if (options8.debug) + console.error("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options8.dot && file[fi].charAt(0) === ".") return false; + } + return true; + } + WHILE: while (fr < fl) { + var swallowee = file[fr]; + if (options8.debug) { + console.error( + "\nglobstar while", + file, + fr, + pattern, + pr, + swallowee + ); + } + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + if (options8.debug) + console.error("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options8.dot && swallowee.charAt(0) === ".") { + if (options8.debug) + console.error("dot detected!", file, fr, pattern, pr); + break WHILE; + } + if (options8.debug) + console.error("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + if (fr === fl) return true; + } + return false; + } + var hit; + if (typeof p === "string") { + if (options8.nocase) { + hit = f.toLowerCase() === p.toLowerCase(); + } else { + hit = f === p; + } + if (options8.debug) { + console.error("string match", p, f, hit); + } + } else { + hit = f.match(p); + if (options8.debug) { + console.error("pattern match", p, f, hit); + } + } + if (!hit) return false; + } + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial; + } else if (pi === pl) { + var emptyFileEnd = fi === fl - 1 && file[fi] === ""; + return emptyFileEnd; + } + throw new Error("wtf?"); + }; + function globUnescape(s) { + return s.replace(/\\(.)/g, "$1"); + } + function regExpEscape(s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } + } +}); + +// node_modules/editorconfig/src/lib/ini.js +var require_ini = __commonJS({ + "node_modules/editorconfig/src/lib/ini.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function(resolve3, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve3(result.value) : new P(function(resolve4) { + resolve4(result.value); + }).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __generator = exports && exports.__generator || function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + } + result["default"] = mod; + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var fs7 = __importStar(__require("fs")); + var regex = { + section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/, + param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/, + comment: /^\s*[#;].*$/ + }; + function parse7(file) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a) { + return [2, new Promise(function(resolve3, reject) { + fs7.readFile(file, "utf8", function(err, data) { + if (err) { + reject(err); + return; + } + resolve3(parseString2(data)); + }); + })]; + }); + }); + } + exports.parse = parse7; + function parseSync(file) { + return parseString2(fs7.readFileSync(file, "utf8")); + } + exports.parseSync = parseSync; + function parseString2(data) { + var sectionBody = {}; + var sectionName = null; + var value = [[sectionName, sectionBody]]; + var lines = data.split(/\r\n|\r|\n/); + lines.forEach(function(line3) { + var match; + if (regex.comment.test(line3)) { + return; + } + if (regex.param.test(line3)) { + match = line3.match(regex.param); + sectionBody[match[1]] = match[2]; + } else if (regex.section.test(line3)) { + match = line3.match(regex.section); + sectionName = match[1]; + sectionBody = {}; + value.push([sectionName, sectionBody]); + } + }); + return value; + } + exports.parseString = parseString2; + } +}); + +// node_modules/editorconfig/package.json +var require_package = __commonJS({ + "node_modules/editorconfig/package.json"(exports, module) { + module.exports = { + name: "editorconfig", + version: "0.15.3", + description: "EditorConfig File Locator and Interpreter for Node.js", + keywords: [ + "editorconfig", + "core" + ], + main: "src/index.js", + contributors: [ + "Hong Xu (topbug.net)", + "Jed Mao (https://github.com/jedmao/)", + "Trey Hunner (http://treyhunner.com)" + ], + directories: { + bin: "./bin", + lib: "./lib" + }, + scripts: { + clean: "rimraf dist", + prebuild: "npm run clean", + build: "tsc", + pretest: "npm run lint && npm run build && npm run copy && cmake .", + test: "ctest .", + "pretest:ci": "npm run pretest", + "test:ci": "ctest -VV --output-on-failure .", + lint: "npm run eclint && npm run tslint", + eclint: 'eclint check --indent_size ignore "src/**"', + tslint: "tslint --project tsconfig.json --exclude package.json", + copy: "cpy .npmignore LICENSE README.md CHANGELOG.md dist && cpy bin/* dist/bin && cpy src/lib/fnmatch*.* dist/src/lib", + prepub: "npm run lint && npm run build && npm run copy", + pub: "npm publish ./dist" + }, + repository: { + type: "git", + url: "git://github.com/editorconfig/editorconfig-core-js.git" + }, + bugs: "https://github.com/editorconfig/editorconfig-core-js/issues", + author: "EditorConfig Team", + license: "MIT", + dependencies: { + commander: "^2.19.0", + "lru-cache": "^4.1.5", + semver: "^5.6.0", + sigmund: "^1.0.1" + }, + devDependencies: { + "@types/mocha": "^5.2.6", + "@types/node": "^10.12.29", + "@types/semver": "^5.5.0", + "cpy-cli": "^2.0.0", + eclint: "^2.8.1", + mocha: "^5.2.0", + rimraf: "^2.6.3", + should: "^13.2.3", + tslint: "^5.13.1", + typescript: "^3.3.3333" + } + }; + } +}); + +// node_modules/editorconfig/src/index.js +var require_src = __commonJS({ + "node_modules/editorconfig/src/index.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function(resolve3, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve3(result.value) : new P(function(resolve4) { + resolve4(result.value); + }).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __generator = exports && exports.__generator || function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + } + result["default"] = mod; + return result; + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var fs7 = __importStar(__require("fs")); + var path13 = __importStar(__require("path")); + var semver = { + gte: require_gte() + }; + var fnmatch_1 = __importDefault(require_fnmatch()); + var ini_1 = require_ini(); + exports.parseString = ini_1.parseString; + var package_json_1 = __importDefault(require_package()); + var knownProps = { + end_of_line: true, + indent_style: true, + indent_size: true, + insert_final_newline: true, + trim_trailing_whitespace: true, + charset: true + }; + function fnmatch(filepath, glob) { + var matchOptions = { matchBase: true, dot: true, noext: true }; + glob = glob.replace(/\*\*/g, "{*,**/**/**}"); + return fnmatch_1.default(filepath, glob, matchOptions); + } + function getConfigFileNames(filepath, options8) { + var paths = []; + do { + filepath = path13.dirname(filepath); + paths.push(path13.join(filepath, options8.config)); + } while (filepath !== options8.root); + return paths; + } + function processMatches(matches, version) { + if ("indent_style" in matches && matches.indent_style === "tab" && !("indent_size" in matches) && semver.gte(version, "0.10.0")) { + matches.indent_size = "tab"; + } + if ("indent_size" in matches && !("tab_width" in matches) && matches.indent_size !== "tab") { + matches.tab_width = matches.indent_size; + } + if ("indent_size" in matches && "tab_width" in matches && matches.indent_size === "tab") { + matches.indent_size = matches.tab_width; + } + return matches; + } + function processOptions(options8, filepath) { + if (options8 === void 0) { + options8 = {}; + } + return { + config: options8.config || ".editorconfig", + version: options8.version || package_json_1.default.version, + root: path13.resolve(options8.root || path13.parse(filepath).root) + }; + } + function buildFullGlob(pathPrefix, glob) { + switch (glob.indexOf("/")) { + case -1: + glob = "**/" + glob; + break; + case 0: + glob = glob.substring(1); + break; + default: + break; + } + return path13.join(pathPrefix, glob); + } + function extendProps(props, options8) { + if (props === void 0) { + props = {}; + } + if (options8 === void 0) { + options8 = {}; + } + for (var key2 in options8) { + if (options8.hasOwnProperty(key2)) { + var value = options8[key2]; + var key22 = key2.toLowerCase(); + var value2 = value; + if (knownProps[key22]) { + value2 = value.toLowerCase(); + } + try { + value2 = JSON.parse(value); + } catch (e) { + } + if (typeof value === "undefined" || value === null) { + value2 = String(value); + } + props[key22] = value2; + } + } + return props; + } + function parseFromConfigs(configs, filepath, options8) { + return processMatches(configs.reverse().reduce(function(matches, file) { + var pathPrefix = path13.dirname(file.name); + file.contents.forEach(function(section) { + var glob = section[0]; + var options22 = section[1]; + if (!glob) { + return; + } + var fullGlob = buildFullGlob(pathPrefix, glob); + if (!fnmatch(filepath, fullGlob)) { + return; + } + matches = extendProps(matches, options22); + }); + return matches; + }, {}), options8.version); + } + function getConfigsForFiles(files) { + var configs = []; + for (var i in files) { + if (files.hasOwnProperty(i)) { + var file = files[i]; + var contents = ini_1.parseString(file.contents); + configs.push({ + name: file.name, + contents + }); + if ((contents[0][1].root || "").toLowerCase() === "true") { + break; + } + } + } + return configs; + } + function readConfigFiles(filepaths) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a) { + return [2, Promise.all(filepaths.map(function(name) { + return new Promise(function(resolve3) { + fs7.readFile(name, "utf8", function(err, data) { + resolve3({ + name, + contents: err ? "" : data + }); + }); + }); + }))]; + }); + }); + } + function readConfigFilesSync(filepaths) { + var files = []; + var file; + filepaths.forEach(function(filepath) { + try { + file = fs7.readFileSync(filepath, "utf8"); + } catch (e) { + file = ""; + } + files.push({ + name: filepath, + contents: file + }); + }); + return files; + } + function opts(filepath, options8) { + if (options8 === void 0) { + options8 = {}; + } + var resolvedFilePath = path13.resolve(filepath); + return [ + resolvedFilePath, + processOptions(options8, resolvedFilePath) + ]; + } + function parseFromFiles(filepath, files, options8) { + if (options8 === void 0) { + options8 = {}; + } + return __awaiter(this, void 0, void 0, function() { + var _a, resolvedFilePath, processedOptions; + return __generator(this, function(_b) { + _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1]; + return [2, files.then(getConfigsForFiles).then(function(configs) { + return parseFromConfigs(configs, resolvedFilePath, processedOptions); + })]; + }); + }); + } + exports.parseFromFiles = parseFromFiles; + function parseFromFilesSync(filepath, files, options8) { + if (options8 === void 0) { + options8 = {}; + } + var _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1]; + return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions); + } + exports.parseFromFilesSync = parseFromFilesSync; + function parse7(_filepath, _options) { + if (_options === void 0) { + _options = {}; + } + return __awaiter(this, void 0, void 0, function() { + var _a, resolvedFilePath, processedOptions, filepaths; + return __generator(this, function(_b) { + _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1]; + filepaths = getConfigFileNames(resolvedFilePath, processedOptions); + return [2, readConfigFiles(filepaths).then(getConfigsForFiles).then(function(configs) { + return parseFromConfigs(configs, resolvedFilePath, processedOptions); + })]; + }); + }); + } + exports.parse = parse7; + function parseSync(_filepath, _options) { + if (_options === void 0) { + _options = {}; + } + var _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1]; + var filepaths = getConfigFileNames(resolvedFilePath, processedOptions); + var files = readConfigFilesSync(filepaths); + return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions); + } + exports.parseSync = parseSync; + } +}); + +// node_modules/ci-info/vendors.json +var require_vendors = __commonJS({ + "node_modules/ci-info/vendors.json"(exports, module) { + module.exports = [ + { + name: "Agola CI", + constant: "AGOLA", + env: "AGOLA_GIT_REF", + pr: "AGOLA_PULL_REQUEST_ID" + }, + { + name: "Appcircle", + constant: "APPCIRCLE", + env: "AC_APPCIRCLE", + pr: { + env: "AC_GIT_PR", + ne: "false" + } + }, + { + name: "AppVeyor", + constant: "APPVEYOR", + env: "APPVEYOR", + pr: "APPVEYOR_PULL_REQUEST_NUMBER" + }, + { + name: "AWS CodeBuild", + constant: "CODEBUILD", + env: "CODEBUILD_BUILD_ARN", + pr: { + env: "CODEBUILD_WEBHOOK_EVENT", + any: [ + "PULL_REQUEST_CREATED", + "PULL_REQUEST_UPDATED", + "PULL_REQUEST_REOPENED" + ] + } + }, + { + name: "Azure Pipelines", + constant: "AZURE_PIPELINES", + env: "TF_BUILD", + pr: { + BUILD_REASON: "PullRequest" + } + }, + { + name: "Bamboo", + constant: "BAMBOO", + env: "bamboo_planKey" + }, + { + name: "Bitbucket Pipelines", + constant: "BITBUCKET", + env: "BITBUCKET_COMMIT", + pr: "BITBUCKET_PR_ID" + }, + { + name: "Bitrise", + constant: "BITRISE", + env: "BITRISE_IO", + pr: "BITRISE_PULL_REQUEST" + }, + { + name: "Buddy", + constant: "BUDDY", + env: "BUDDY_WORKSPACE_ID", + pr: "BUDDY_EXECUTION_PULL_REQUEST_ID" + }, + { + name: "Buildkite", + constant: "BUILDKITE", + env: "BUILDKITE", + pr: { + env: "BUILDKITE_PULL_REQUEST", + ne: "false" + } + }, + { + name: "CircleCI", + constant: "CIRCLE", + env: "CIRCLECI", + pr: "CIRCLE_PULL_REQUEST" + }, + { + name: "Cirrus CI", + constant: "CIRRUS", + env: "CIRRUS_CI", + pr: "CIRRUS_PR" + }, + { + name: "Codefresh", + constant: "CODEFRESH", + env: "CF_BUILD_ID", + pr: { + any: [ + "CF_PULL_REQUEST_NUMBER", + "CF_PULL_REQUEST_ID" + ] + } + }, + { + name: "Codemagic", + constant: "CODEMAGIC", + env: "CM_BUILD_ID", + pr: "CM_PULL_REQUEST" + }, + { + name: "Codeship", + constant: "CODESHIP", + env: { + CI_NAME: "codeship" + } + }, + { + name: "Drone", + constant: "DRONE", + env: "DRONE", + pr: { + DRONE_BUILD_EVENT: "pull_request" + } + }, + { + name: "dsari", + constant: "DSARI", + env: "DSARI" + }, + { + name: "Earthly", + constant: "EARTHLY", + env: "EARTHLY_CI" + }, + { + name: "Expo Application Services", + constant: "EAS", + env: "EAS_BUILD" + }, + { + name: "Gerrit", + constant: "GERRIT", + env: "GERRIT_PROJECT" + }, + { + name: "Gitea Actions", + constant: "GITEA_ACTIONS", + env: "GITEA_ACTIONS" + }, + { + name: "GitHub Actions", + constant: "GITHUB_ACTIONS", + env: "GITHUB_ACTIONS", + pr: { + GITHUB_EVENT_NAME: "pull_request" + } + }, + { + name: "GitLab CI", + constant: "GITLAB", + env: "GITLAB_CI", + pr: "CI_MERGE_REQUEST_ID" + }, + { + name: "GoCD", + constant: "GOCD", + env: "GO_PIPELINE_LABEL" + }, + { + name: "Google Cloud Build", + constant: "GOOGLE_CLOUD_BUILD", + env: "BUILDER_OUTPUT" + }, + { + name: "Harness CI", + constant: "HARNESS", + env: "HARNESS_BUILD_ID" + }, + { + name: "Heroku", + constant: "HEROKU", + env: { + env: "NODE", + includes: "/app/.heroku/node/bin/node" + } + }, + { + name: "Hudson", + constant: "HUDSON", + env: "HUDSON_URL" + }, + { + name: "Jenkins", + constant: "JENKINS", + env: [ + "JENKINS_URL", + "BUILD_ID" + ], + pr: { + any: [ + "ghprbPullId", + "CHANGE_ID" + ] + } + }, + { + name: "LayerCI", + constant: "LAYERCI", + env: "LAYERCI", + pr: "LAYERCI_PULL_REQUEST" + }, + { + name: "Magnum CI", + constant: "MAGNUM", + env: "MAGNUM" + }, + { + name: "Netlify CI", + constant: "NETLIFY", + env: "NETLIFY", + pr: { + env: "PULL_REQUEST", + ne: "false" + } + }, + { + name: "Nevercode", + constant: "NEVERCODE", + env: "NEVERCODE", + pr: { + env: "NEVERCODE_PULL_REQUEST", + ne: "false" + } + }, + { + name: "Prow", + constant: "PROW", + env: "PROW_JOB_ID" + }, + { + name: "ReleaseHub", + constant: "RELEASEHUB", + env: "RELEASE_BUILD_ID" + }, + { + name: "Render", + constant: "RENDER", + env: "RENDER", + pr: { + IS_PULL_REQUEST: "true" + } + }, + { + name: "Sail CI", + constant: "SAIL", + env: "SAILCI", + pr: "SAIL_PULL_REQUEST_NUMBER" + }, + { + name: "Screwdriver", + constant: "SCREWDRIVER", + env: "SCREWDRIVER", + pr: { + env: "SD_PULL_REQUEST", + ne: "false" + } + }, + { + name: "Semaphore", + constant: "SEMAPHORE", + env: "SEMAPHORE", + pr: "PULL_REQUEST_NUMBER" + }, + { + name: "Sourcehut", + constant: "SOURCEHUT", + env: { + CI_NAME: "sourcehut" + } + }, + { + name: "Strider CD", + constant: "STRIDER", + env: "STRIDER" + }, + { + name: "TaskCluster", + constant: "TASKCLUSTER", + env: [ + "TASK_ID", + "RUN_ID" + ] + }, + { + name: "TeamCity", + constant: "TEAMCITY", + env: "TEAMCITY_VERSION" + }, + { + name: "Travis CI", + constant: "TRAVIS", + env: "TRAVIS", + pr: { + env: "TRAVIS_PULL_REQUEST", + ne: "false" + } + }, + { + name: "Vela", + constant: "VELA", + env: "VELA", + pr: { + VELA_PULL_REQUEST: "1" + } + }, + { + name: "Vercel", + constant: "VERCEL", + env: { + any: [ + "NOW_BUILDER", + "VERCEL" + ] + }, + pr: "VERCEL_GIT_PULL_REQUEST_ID" + }, + { + name: "Visual Studio App Center", + constant: "APPCENTER", + env: "APPCENTER_BUILD_ID" + }, + { + name: "Woodpecker", + constant: "WOODPECKER", + env: { + CI: "woodpecker" + }, + pr: { + CI_BUILD_EVENT: "pull_request" + } + }, + { + name: "Xcode Cloud", + constant: "XCODE_CLOUD", + env: "CI_XCODE_PROJECT", + pr: "CI_PULL_REQUEST_NUMBER" + }, + { + name: "Xcode Server", + constant: "XCODE_SERVER", + env: "XCS" + } + ]; + } +}); + +// node_modules/ci-info/index.js +var require_ci_info = __commonJS({ + "node_modules/ci-info/index.js"(exports) { + "use strict"; + var vendors = require_vendors(); + var env2 = process.env; + Object.defineProperty(exports, "_vendors", { + value: vendors.map(function(v) { + return v.constant; + }) + }); + exports.name = null; + exports.isPR = null; + exports.id = null; + vendors.forEach(function(vendor) { + const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]; + const isCI2 = envs.every(function(obj) { + return checkEnv(obj); + }); + exports[vendor.constant] = isCI2; + if (!isCI2) { + return; + } + exports.name = vendor.name; + exports.isPR = checkPR(vendor); + exports.id = vendor.constant; + }); + exports.isCI = !!(env2.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false' + (env2.BUILD_ID || // Jenkins, Cloudbees + env2.BUILD_NUMBER || // Jenkins, TeamCity + env2.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari + env2.CI_APP_ID || // Appflow + env2.CI_BUILD_ID || // Appflow + env2.CI_BUILD_NUMBER || // Appflow + env2.CI_NAME || // Codeship and others + env2.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI + env2.RUN_ID || // TaskCluster, dsari + exports.name || false)); + function checkEnv(obj) { + if (typeof obj === "string") return !!env2[obj]; + if ("env" in obj) { + return env2[obj.env] && env2[obj.env].includes(obj.includes); + } + if ("any" in obj) { + return obj.any.some(function(k) { + return !!env2[k]; + }); + } + return Object.keys(obj).every(function(k) { + return env2[k] === obj[k]; + }); + } + function checkPR(vendor) { + switch (typeof vendor.pr) { + case "string": + return !!env2[vendor.pr]; + case "object": + if ("env" in vendor.pr) { + if ("any" in vendor.pr) { + return vendor.pr.any.some(function(key2) { + return env2[vendor.pr.env] === key2; + }); + } else { + return vendor.pr.env in env2 && env2[vendor.pr.env] !== vendor.pr.ne; + } + } else if ("any" in vendor.pr) { + return vendor.pr.any.some(function(key2) { + return !!env2[key2]; + }); + } else { + return checkEnv(vendor.pr); + } + default: + return null; + } + } + } +}); + +// node_modules/picocolors/picocolors.js +var require_picocolors = __commonJS({ + "node_modules/picocolors/picocolors.js"(exports, module) { + var p = process || {}; + var argv = p.argv || []; + var env2 = p.env || {}; + var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI); + var formatter = (open, close, replace = open) => (input) => { + let string = "" + input, index = string.indexOf(close, open.length); + return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close; + }; + var replaceClose = (string, close, replace, index) => { + let result = "", cursor2 = 0; + do { + result += string.substring(cursor2, index) + replace; + cursor2 = index + close.length; + index = string.indexOf(close, cursor2); + } while (~index); + return result + string.substring(cursor2); + }; + var createColors = (enabled = isColorSupported) => { + let f = enabled ? formatter : () => String; + return { + isColorSupported: enabled, + reset: f("\x1B[0m", "\x1B[0m"), + bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"), + dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"), + italic: f("\x1B[3m", "\x1B[23m"), + underline: f("\x1B[4m", "\x1B[24m"), + inverse: f("\x1B[7m", "\x1B[27m"), + hidden: f("\x1B[8m", "\x1B[28m"), + strikethrough: f("\x1B[9m", "\x1B[29m"), + black: f("\x1B[30m", "\x1B[39m"), + red: f("\x1B[31m", "\x1B[39m"), + green: f("\x1B[32m", "\x1B[39m"), + yellow: f("\x1B[33m", "\x1B[39m"), + blue: f("\x1B[34m", "\x1B[39m"), + magenta: f("\x1B[35m", "\x1B[39m"), + cyan: f("\x1B[36m", "\x1B[39m"), + white: f("\x1B[37m", "\x1B[39m"), + gray: f("\x1B[90m", "\x1B[39m"), + bgBlack: f("\x1B[40m", "\x1B[49m"), + bgRed: f("\x1B[41m", "\x1B[49m"), + bgGreen: f("\x1B[42m", "\x1B[49m"), + bgYellow: f("\x1B[43m", "\x1B[49m"), + bgBlue: f("\x1B[44m", "\x1B[49m"), + bgMagenta: f("\x1B[45m", "\x1B[49m"), + bgCyan: f("\x1B[46m", "\x1B[49m"), + bgWhite: f("\x1B[47m", "\x1B[49m"), + blackBright: f("\x1B[90m", "\x1B[39m"), + redBright: f("\x1B[91m", "\x1B[39m"), + greenBright: f("\x1B[92m", "\x1B[39m"), + yellowBright: f("\x1B[93m", "\x1B[39m"), + blueBright: f("\x1B[94m", "\x1B[39m"), + magentaBright: f("\x1B[95m", "\x1B[39m"), + cyanBright: f("\x1B[96m", "\x1B[39m"), + whiteBright: f("\x1B[97m", "\x1B[39m"), + bgBlackBright: f("\x1B[100m", "\x1B[49m"), + bgRedBright: f("\x1B[101m", "\x1B[49m"), + bgGreenBright: f("\x1B[102m", "\x1B[49m"), + bgYellowBright: f("\x1B[103m", "\x1B[49m"), + bgBlueBright: f("\x1B[104m", "\x1B[49m"), + bgMagentaBright: f("\x1B[105m", "\x1B[49m"), + bgCyanBright: f("\x1B[106m", "\x1B[49m"), + bgWhiteBright: f("\x1B[107m", "\x1B[49m") + }; + }; + module.exports = createColors(); + module.exports.createColors = createColors; + } +}); + +// node_modules/js-tokens/index.js +var require_js_tokens = __commonJS({ + "node_modules/js-tokens/index.js"(exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; + exports.matchToToken = function(match) { + var token2 = { type: "invalid", value: match[0], closed: void 0 }; + if (match[1]) token2.type = "string", token2.closed = !!(match[3] || match[4]); + else if (match[5]) token2.type = "comment"; + else if (match[6]) token2.type = "comment", token2.closed = !!match[7]; + else if (match[8]) token2.type = "regex"; + else if (match[9]) token2.type = "number"; + else if (match[10]) token2.type = "name"; + else if (match[11]) token2.type = "punctuator"; + else if (match[12]) token2.type = "whitespace"; + return token2; + }; + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/identifier.js +var require_identifier = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isIdentifierChar = isIdentifierChar; + exports.isIdentifierName = isIdentifierName; + exports.isIdentifierStart = isIdentifierStart; + var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; + var nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65"; + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; + var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + function isInAstralSet(code, set2) { + let pos2 = 65536; + for (let i = 0, length = set2.length; i < length; i += 2) { + pos2 += set2[i]; + if (pos2 > code) return false; + pos2 += set2[i + 1]; + if (pos2 >= code) return true; + } + return false; + } + function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 65535) { + return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); + } + function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 65535) { + return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); + } + function isIdentifierName(name) { + let isFirst = true; + for (let i = 0; i < name.length; i++) { + let cp = name.charCodeAt(i); + if ((cp & 64512) === 55296 && i + 1 < name.length) { + const trail = name.charCodeAt(++i); + if ((trail & 64512) === 56320) { + cp = 65536 + ((cp & 1023) << 10) + (trail & 1023); + } + } + if (isFirst) { + isFirst = false; + if (!isIdentifierStart(cp)) { + return false; + } + } else if (!isIdentifierChar(cp)) { + return false; + } + } + return !isFirst; + } + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/keyword.js +var require_keyword = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isKeyword = isKeyword; + exports.isReservedWord = isReservedWord; + exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; + exports.isStrictBindReservedWord = isStrictBindReservedWord; + exports.isStrictReservedWord = isStrictReservedWord; + var reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] + }; + var keywords = new Set(reservedWords.keyword); + var reservedWordsStrictSet = new Set(reservedWords.strict); + var reservedWordsStrictBindSet = new Set(reservedWords.strictBind); + function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; + } + function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); + } + function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); + } + function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); + } + function isKeyword(word) { + return keywords.has(word); + } + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/index.js +var require_lib = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "isIdentifierChar", { + enumerable: true, + get: function() { + return _identifier.isIdentifierChar; + } + }); + Object.defineProperty(exports, "isIdentifierName", { + enumerable: true, + get: function() { + return _identifier.isIdentifierName; + } + }); + Object.defineProperty(exports, "isIdentifierStart", { + enumerable: true, + get: function() { + return _identifier.isIdentifierStart; + } + }); + Object.defineProperty(exports, "isKeyword", { + enumerable: true, + get: function() { + return _keyword.isKeyword; + } + }); + Object.defineProperty(exports, "isReservedWord", { + enumerable: true, + get: function() { + return _keyword.isReservedWord; + } + }); + Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictBindOnlyReservedWord; + } + }); + Object.defineProperty(exports, "isStrictBindReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictBindReservedWord; + } + }); + Object.defineProperty(exports, "isStrictReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictReservedWord; + } + }); + var _identifier = require_identifier(); + var _keyword = require_keyword(); + } +}); + +// node_modules/@babel/code-frame/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/@babel/code-frame/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var picocolors = require_picocolors(); + var jsTokens = require_js_tokens(); + var helperValidatorIdentifier = require_lib(); + function isColorSupported() { + return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported; + } + var compose = (f, g) => (v) => f(g(v)); + function buildDefs(colors) { + return { + keyword: colors.cyan, + capitalized: colors.yellow, + jsxIdentifier: colors.yellow, + punctuator: colors.yellow, + number: colors.magenta, + string: colors.green, + regex: colors.magenta, + comment: colors.gray, + invalid: compose(compose(colors.white, colors.bgRed), colors.bold), + gutter: colors.gray, + marker: compose(colors.red, colors.bold), + message: compose(colors.red, colors.bold), + reset: colors.reset + }; + } + var defsOn = buildDefs(picocolors.createColors(true)); + var defsOff = buildDefs(picocolors.createColors(false)); + function getDefs(enabled) { + return enabled ? defsOn : defsOff; + } + var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]); + var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/; + var BRACKET = /^[()[\]{}]$/; + var tokenize2; + { + const JSX_TAG = /^[a-z][\w-]*$/i; + const getTokenType = function(token2, offset, text) { + if (token2.type === "name") { + if (helperValidatorIdentifier.isKeyword(token2.value) || helperValidatorIdentifier.isStrictReservedWord(token2.value, true) || sometimesKeywords.has(token2.value)) { + return "keyword"; + } + if (JSX_TAG.test(token2.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === " defs[type2](str2)).join("\n"); + } else { + highlighted += value; + } + } + return highlighted; + } + var deprecationWarningShown = false; + var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; + function getMarkerLines(loc, source2, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source2.length, endLine + linesBelow); + if (startLine === -1) { + start = 0; + } + if (endLine === -1) { + end = source2.length; + } + const lineDiff2 = endLine - startLine; + const markerLines = {}; + if (lineDiff2) { + for (let i = 0; i <= lineDiff2; i++) { + const lineNumber = i + startLine; + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source2[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff2) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source2[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + return { + start, + end, + markerLines + }; + } + function codeFrameColumns3(rawLines, loc, opts = {}) { + const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode; + const defs = getDefs(shouldHighlight); + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines; + let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line3, index2) => { + const number = start + 1 + index2; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; + if (Array.isArray(hasMarker)) { + const markerSpacing = line3.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join(""); + if (lastMarkerLine && opts.message) { + markerLine += " " + defs.message(opts.message); + } + } + return [defs.marker(">"), defs.gutter(gutter), line3.length > 0 ? ` ${line3}` : "", markerLine].join(""); + } else { + return ` ${defs.gutter(gutter)}${line3.length > 0 ? ` ${line3}` : ""}`; + } + }).join("\n"); + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message} +${frame}`; + } + if (shouldHighlight) { + return defs.reset(frame); + } else { + return frame; + } + } + function index(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns3(rawLines, location, opts); + } + exports.codeFrameColumns = codeFrameColumns3; + exports.default = index; + exports.highlight = highlight; + } +}); + +// node_modules/ignore/index.js +var require_ignore = __commonJS({ + "node_modules/ignore/index.js"(exports, module) { + function makeArray(subject) { + return Array.isArray(subject) ? subject : [subject]; + } + var UNDEFINED = void 0; + var EMPTY = ""; + var SPACE = " "; + var ESCAPE = "\\"; + var REGEX_TEST_BLANK_LINE = /^\s+$/; + var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; + var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; + var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; + var REGEX_SPLITALL_CRLF = /\r?\n/g; + var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; + var REGEX_TEST_TRAILING_SLASH = /\/$/; + var SLASH = "/"; + var TMP_KEY_IGNORE = "node-ignore"; + if (typeof Symbol !== "undefined") { + TMP_KEY_IGNORE = Symbol.for("node-ignore"); + } + var KEY_IGNORE = TMP_KEY_IGNORE; + var define = (object, key2, value) => { + Object.defineProperty(object, key2, { value }); + return value; + }; + var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; + var RETURN_FALSE = () => false; + var sanitizeRange = (range) => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY + ); + var cleanRangeBackSlash = (slashes) => { + const { length } = slashes; + return slashes.slice(0, length - length % 2); + }; + var REPLACERS = [ + [ + // Remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], + // > Trailing spaces are ignored unless they are quoted with backslash ("\") + [ + // (a\ ) -> (a ) + // (a ) -> (a) + // (a ) -> (a) + // (a \ ) -> (a ) + /((?:\\\\)*?)(\\?\s+)$/, + (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY) + ], + // Replace (\ ) with ' ' + // (\ ) -> ' ' + // (\\ ) -> '\\ ' + // (\\\ ) -> '\\ ' + [ + /(\\+?)\s/g, + (_, m1) => { + const { length } = m1; + return m1.slice(0, length - length % 2) + SPACE; + } + ], + // Escape metacharacters + // which is written down by users but means special for regular expressions. + // > There are 12 characters with special meanings: + // > - the backslash \, + // > - the caret ^, + // > - the dollar sign $, + // > - the period or dot ., + // > - the vertical bar or pipe symbol |, + // > - the question mark ?, + // > - the asterisk or star *, + // > - the plus sign +, + // > - the opening parenthesis (, + // > - the closing parenthesis ), + // > - and the opening square bracket [, + // > - the opening curly brace {, + // > These special characters are often called "metacharacters". + [ + /[\\$.|*+(){^]/g, + (match) => `\\${match}` + ], + [ + // > a question mark (?) matches a single character + /(?!\\)\?/g, + () => "[^/]" + ], + // leading slash + [ + // > A leading slash matches the beginning of the pathname. + // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". + // A leading slash matches the beginning of the pathname + /^\//, + () => "^" + ], + // replace special metacharacter slash after the leading slash + [ + /\//g, + () => "\\/" + ], + [ + // > A leading "**" followed by a slash means match in all directories. + // > For example, "**/foo" matches file or directory "foo" anywhere, + // > the same as pattern "foo". + // > "**/foo/bar" matches file or directory "bar" anywhere that is directly + // > under directory "foo". + // Notice that the '*'s have been replaced as '\\*' + /^\^*\\\*\\\*\\\//, + // '**/foo' <-> 'foo' + () => "^(?:.*\\/)?" + ], + // starting + [ + // there will be no leading '/' + // (which has been replaced by section "leading slash") + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^^])/, + function startingReplacer() { + return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; + } + ], + // two globstars + [ + // Use lookahead assertions so that we could match more than one `'/**'` + /\\\/\\\*\\\*(?=\\\/|$)/g, + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + // Check if it is not the last `'/**'` + (_, index, str2) => index + 6 < str2.length ? "(?:\\/[^\\/]+)*" : "\\/.+" + ], + // normal intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + // 'abc.*/' -> go + // 'abc.*' -> skip this rule, + // coz trailing single wildcard will be handed by [trailing wildcard] + /(^|[^\\]+)(\\\*)+(?=.+)/g, + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + (_, p1, p2) => { + const unescaped = p2.replace(/\\\*/g, "[^\\/]*"); + return p1 + unescaped; + } + ], + [ + // unescape, revert step 3 except for back slash + // For example, if a user escape a '\\*', + // after step 3, the result will be '\\\\\\*' + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE + ], + [ + // '\\\\' -> '\\' + /\\\\/g, + () => ESCAPE + ], + [ + // > The range notation, e.g. [a-zA-Z], + // > can be used to match one of the characters in a range. + // `\` is escaped by step 3 + /(\\)?\[([^\]/]*?)(\\*)($|\])/g, + (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]" + ], + // ending + [ + // 'js' will not match 'js.' + // 'ab' will not match 'abc' + /(?:[^*])$/, + // WTF! + // https://git-scm.com/docs/gitignore + // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) + // which re-fixes #24, #38 + // > If there is a separator at the end of the pattern then the pattern + // > will only match directories, otherwise the pattern can match both + // > files and directories. + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)` + ] + ]; + var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/; + var MODE_IGNORE = "regex"; + var MODE_CHECK_IGNORE = "checkRegex"; + var UNDERSCORE = "_"; + var TRAILING_WILD_CARD_REPLACERS = { + [MODE_IGNORE](_, p1) { + const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; + return `${prefix}(?=$|\\/$)`; + }, + [MODE_CHECK_IGNORE](_, p1) { + const prefix = p1 ? `${p1}[^/]*` : "[^/]*"; + return `${prefix}(?=$|\\/$)`; + } + }; + var makeRegexPrefix = (pattern) => REPLACERS.reduce( + (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)), + pattern + ); + var isString = (subject) => typeof subject === "string"; + var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0; + var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean); + var IgnoreRule = class { + constructor(pattern, mark, body, ignoreCase, negative, prefix) { + this.pattern = pattern; + this.mark = mark; + this.negative = negative; + define(this, "body", body); + define(this, "ignoreCase", ignoreCase); + define(this, "regexPrefix", prefix); + } + get regex() { + const key2 = UNDERSCORE + MODE_IGNORE; + if (this[key2]) { + return this[key2]; + } + return this._make(MODE_IGNORE, key2); + } + get checkRegex() { + const key2 = UNDERSCORE + MODE_CHECK_IGNORE; + if (this[key2]) { + return this[key2]; + } + return this._make(MODE_CHECK_IGNORE, key2); + } + _make(mode, key2) { + const str2 = this.regexPrefix.replace( + REGEX_REPLACE_TRAILING_WILDCARD, + // It does not need to bind pattern + TRAILING_WILD_CARD_REPLACERS[mode] + ); + const regex = this.ignoreCase ? new RegExp(str2, "i") : new RegExp(str2); + return define(this, key2, regex); + } + }; + var createRule = ({ + pattern, + mark + }, ignoreCase) => { + let negative = false; + let body = pattern; + if (body.indexOf("!") === 0) { + negative = true; + body = body.substr(1); + } + body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); + const regexPrefix = makeRegexPrefix(body); + return new IgnoreRule( + pattern, + mark, + body, + ignoreCase, + negative, + regexPrefix + ); + }; + var RuleManager = class { + constructor(ignoreCase) { + this._ignoreCase = ignoreCase; + this._rules = []; + } + _add(pattern) { + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules._rules); + this._added = true; + return; + } + if (isString(pattern)) { + pattern = { + pattern + }; + } + if (checkPattern(pattern.pattern)) { + const rule = createRule(pattern, this._ignoreCase); + this._added = true; + this._rules.push(rule); + } + } + // @param {Array | string | Ignore} pattern + add(pattern) { + this._added = false; + makeArray( + isString(pattern) ? splitPattern(pattern) : pattern + ).forEach(this._add, this); + return this._added; + } + // Test one single path without recursively checking parent directories + // + // - checkUnignored `boolean` whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + // - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE` + // @returns {TestResult} true if a file is ignored + test(path13, checkUnignored, mode) { + let ignored = false; + let unignored = false; + let matchedRule; + this._rules.forEach((rule) => { + const { negative } = rule; + if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { + return; + } + const matched = rule[mode].test(path13); + if (!matched) { + return; + } + ignored = !negative; + unignored = negative; + matchedRule = negative ? UNDEFINED : rule; + }); + const ret = { + ignored, + unignored + }; + if (matchedRule) { + ret.rule = matchedRule; + } + return ret; + } + }; + var throwError2 = (message, Ctor) => { + throw new Ctor(message); + }; + var checkPath = (path13, originalPath, doThrow) => { + if (!isString(path13)) { + return doThrow( + `path must be a string, but got \`${originalPath}\``, + TypeError + ); + } + if (!path13) { + return doThrow(`path must not be empty`, TypeError); + } + if (checkPath.isNotRelative(path13)) { + const r = "`path.relative()`d"; + return doThrow( + `path should be a ${r} string, but got "${originalPath}"`, + RangeError + ); + } + return true; + }; + var isNotRelative = (path13) => REGEX_TEST_INVALID_PATH.test(path13); + checkPath.isNotRelative = isNotRelative; + checkPath.convert = (p) => p; + var Ignore = class { + constructor({ + ignorecase = true, + ignoreCase = ignorecase, + allowRelativePaths = false + } = {}) { + define(this, KEY_IGNORE, true); + this._rules = new RuleManager(ignoreCase); + this._strictPathCheck = !allowRelativePaths; + this._initCache(); + } + _initCache() { + this._ignoreCache = /* @__PURE__ */ Object.create(null); + this._testCache = /* @__PURE__ */ Object.create(null); + } + add(pattern) { + if (this._rules.add(pattern)) { + this._initCache(); + } + return this; + } + // legacy + addPattern(pattern) { + return this.add(pattern); + } + // @returns {TestResult} + _test(originalPath, cache3, checkUnignored, slices) { + const path13 = originalPath && checkPath.convert(originalPath); + checkPath( + path13, + originalPath, + this._strictPathCheck ? throwError2 : RETURN_FALSE + ); + return this._t(path13, cache3, checkUnignored, slices); + } + checkIgnore(path13) { + if (!REGEX_TEST_TRAILING_SLASH.test(path13)) { + return this.test(path13); + } + const slices = path13.split(SLASH).filter(Boolean); + slices.pop(); + if (slices.length) { + const parent = this._t( + slices.join(SLASH) + SLASH, + this._testCache, + true, + slices + ); + if (parent.ignored) { + return parent; + } + } + return this._rules.test(path13, false, MODE_CHECK_IGNORE); + } + _t(path13, cache3, checkUnignored, slices) { + if (path13 in cache3) { + return cache3[path13]; + } + if (!slices) { + slices = path13.split(SLASH).filter(Boolean); + } + slices.pop(); + if (!slices.length) { + return cache3[path13] = this._rules.test(path13, checkUnignored, MODE_IGNORE); + } + const parent = this._t( + slices.join(SLASH) + SLASH, + cache3, + checkUnignored, + slices + ); + return cache3[path13] = parent.ignored ? parent : this._rules.test(path13, checkUnignored, MODE_IGNORE); + } + ignores(path13) { + return this._test(path13, this._ignoreCache, false).ignored; + } + createFilter() { + return (path13) => !this.ignores(path13); + } + filter(paths) { + return makeArray(paths).filter(this.createFilter()); + } + // @returns {TestResult} + test(path13) { + return this._test(path13, this._testCache, true); + } + }; + var factory = (options8) => new Ignore(options8); + var isPathValid = (path13) => checkPath(path13 && checkPath.convert(path13), path13, RETURN_FALSE); + if ( + // Detect `process` so that it can run in browsers. + typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32") + ) { + const makePosix = (str2) => /^\\\\\?\\/.test(str2) || /["<>|\u0000-\u001F]+/u.test(str2) ? str2 : str2.replace(/\\/g, "/"); + checkPath.convert = makePosix; + const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; + checkPath.isNotRelative = (path13) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path13) || isNotRelative(path13); + } + module.exports = factory; + factory.default = factory; + module.exports.isPathValid = isPathValid; + } +}); + +// node_modules/n-readlines/readlines.js +var require_readlines = __commonJS({ + "node_modules/n-readlines/readlines.js"(exports, module) { + "use strict"; + var fs7 = __require("fs"); + var LineByLine = class { + constructor(file, options8) { + options8 = options8 || {}; + if (!options8.readChunk) options8.readChunk = 1024; + if (!options8.newLineCharacter) { + options8.newLineCharacter = 10; + } else { + options8.newLineCharacter = options8.newLineCharacter.charCodeAt(0); + } + if (typeof file === "number") { + this.fd = file; + } else { + this.fd = fs7.openSync(file, "r"); + } + this.options = options8; + this.newLineCharacter = options8.newLineCharacter; + this.reset(); + } + _searchInBuffer(buffer2, hexNeedle) { + let found = -1; + for (let i = 0; i <= buffer2.length; i++) { + let b_byte = buffer2[i]; + if (b_byte === hexNeedle) { + found = i; + break; + } + } + return found; + } + reset() { + this.eofReached = false; + this.linesCache = []; + this.fdPosition = 0; + } + close() { + fs7.closeSync(this.fd); + this.fd = null; + } + _extractLines(buffer2) { + let line3; + const lines = []; + let bufferPosition = 0; + let lastNewLineBufferPosition = 0; + while (true) { + let bufferPositionValue = buffer2[bufferPosition++]; + if (bufferPositionValue === this.newLineCharacter) { + line3 = buffer2.slice(lastNewLineBufferPosition, bufferPosition); + lines.push(line3); + lastNewLineBufferPosition = bufferPosition; + } else if (bufferPositionValue === void 0) { + break; + } + } + let leftovers = buffer2.slice(lastNewLineBufferPosition, bufferPosition); + if (leftovers.length) { + lines.push(leftovers); + } + return lines; + } + _readChunk(lineLeftovers) { + let totalBytesRead = 0; + let bytesRead; + const buffers = []; + do { + const readBuffer = Buffer.alloc(this.options.readChunk); + bytesRead = fs7.readSync(this.fd, readBuffer, 0, this.options.readChunk, this.fdPosition); + totalBytesRead = totalBytesRead + bytesRead; + this.fdPosition = this.fdPosition + bytesRead; + buffers.push(readBuffer); + } while (bytesRead && this._searchInBuffer(buffers[buffers.length - 1], this.options.newLineCharacter) === -1); + let bufferData = Buffer.concat(buffers); + if (bytesRead < this.options.readChunk) { + this.eofReached = true; + bufferData = bufferData.slice(0, totalBytesRead); + } + if (totalBytesRead) { + this.linesCache = this._extractLines(bufferData); + if (lineLeftovers) { + this.linesCache[0] = Buffer.concat([lineLeftovers, this.linesCache[0]]); + } + } + return totalBytesRead; + } + next() { + if (!this.fd) return false; + let line3 = false; + if (this.eofReached && this.linesCache.length === 0) { + return line3; + } + let bytesRead; + if (!this.linesCache.length) { + bytesRead = this._readChunk(); + } + if (this.linesCache.length) { + line3 = this.linesCache.shift(); + const lastLineCharacter = line3[line3.length - 1]; + if (lastLineCharacter !== this.newLineCharacter) { + bytesRead = this._readChunk(line3); + if (bytesRead) { + line3 = this.linesCache.shift(); + } + } + } + if (this.eofReached && this.linesCache.length === 0) { + this.close(); + } + if (line3 && line3[line3.length - 1] === this.newLineCharacter) { + line3 = line3.slice(0, line3.length - 1); + } + return line3; + } + }; + module.exports = LineByLine; + } +}); + +// src/index.js +var index_exports = {}; +__export(index_exports, { + __debug: () => debugApis, + __internal: () => sharedWithCli, + check: () => check, + clearConfigCache: () => clearCache3, + doc: () => doc, + format: () => format2, + formatWithCursor: () => formatWithCursor2, + getFileInfo: () => getFileInfo2, + getSupportInfo: () => getSupportInfo2, + resolveConfig: () => resolveConfig, + resolveConfigFile: () => resolveConfigFile, + util: () => public_exports, + version: () => version_evaluate_default +}); + +// node_modules/diff/lib/index.mjs +function Diff() { +} +Diff.prototype = { + diff: function diff(oldString, newString) { + var _options$timeout; + var options8 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var callback = options8.callback; + if (typeof options8 === "function") { + callback = options8; + options8 = {}; + } + var self = this; + function done(value) { + value = self.postProcess(value, options8); + if (callback) { + setTimeout(function() { + callback(value); + }, 0); + return true; + } else { + return value; + } + } + oldString = this.castInput(oldString, options8); + newString = this.castInput(newString, options8); + oldString = this.removeEmpty(this.tokenize(oldString, options8)); + newString = this.removeEmpty(this.tokenize(newString, options8)); + var newLen = newString.length, oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + if (options8.maxEditLength != null) { + maxEditLength = Math.min(maxEditLength, options8.maxEditLength); + } + var maxExecutionTime = (_options$timeout = options8.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity; + var abortAfterTimestamp = Date.now() + maxExecutionTime; + var bestPath = [{ + oldPos: -1, + lastComponent: void 0 + }]; + var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options8); + if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken)); + } + var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity; + function execEditLength() { + for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { + var basePath = void 0; + var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1]; + if (removePath) { + bestPath[diagonalPath - 1] = void 0; + } + var canAdd = false; + if (addPath) { + var addPathNewPos = addPath.oldPos - diagonalPath; + canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; + } + var canRemove = removePath && removePath.oldPos + 1 < oldLen; + if (!canAdd && !canRemove) { + bestPath[diagonalPath] = void 0; + continue; + } + if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) { + basePath = self.addToPath(addPath, true, false, 0, options8); + } else { + basePath = self.addToPath(removePath, false, true, 1, options8); + } + newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options8); + if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken)); + } else { + bestPath[diagonalPath] = basePath; + if (basePath.oldPos + 1 >= oldLen) { + maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); + } + if (newPos + 1 >= newLen) { + minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); + } + } + } + editLength++; + } + if (callback) { + (function exec() { + setTimeout(function() { + if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { + return callback(); + } + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } + } + }, + addToPath: function addToPath(path13, added, removed, oldPosInc, options8) { + var last = path13.lastComponent; + if (last && !options8.oneChangePerToken && last.added === added && last.removed === removed) { + return { + oldPos: path13.oldPos + oldPosInc, + lastComponent: { + count: last.count + 1, + added, + removed, + previousComponent: last.previousComponent + } + }; + } else { + return { + oldPos: path13.oldPos + oldPosInc, + lastComponent: { + count: 1, + added, + removed, + previousComponent: last + } + }; + } + }, + extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options8) { + var newLen = newString.length, oldLen = oldString.length, oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options8)) { + newPos++; + oldPos++; + commonCount++; + if (options8.oneChangePerToken) { + basePath.lastComponent = { + count: 1, + previousComponent: basePath.lastComponent, + added: false, + removed: false + }; + } + } + if (commonCount && !options8.oneChangePerToken) { + basePath.lastComponent = { + count: commonCount, + previousComponent: basePath.lastComponent, + added: false, + removed: false + }; + } + basePath.oldPos = oldPos; + return newPos; + }, + equals: function equals(left, right, options8) { + if (options8.comparator) { + return options8.comparator(left, right); + } else { + return left === right || options8.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + }, + removeEmpty: function removeEmpty(array2) { + var ret = []; + for (var i = 0; i < array2.length; i++) { + if (array2[i]) { + ret.push(array2[i]); + } + } + return ret; + }, + castInput: function castInput(value) { + return value; + }, + tokenize: function tokenize(value) { + return Array.from(value); + }, + join: function join(chars) { + return chars.join(""); + }, + postProcess: function postProcess(changeObjects) { + return changeObjects; + } +}; +function buildValues(diff2, lastComponent, newString, oldString, useLongestToken) { + var components = []; + var nextComponent; + while (lastComponent) { + components.push(lastComponent); + nextComponent = lastComponent.previousComponent; + delete lastComponent.previousComponent; + lastComponent = nextComponent; + } + components.reverse(); + var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + if (!component.added && useLongestToken) { + var value = newString.slice(newPos, newPos + component.count); + value = value.map(function(value2, i) { + var oldValue = oldString[oldPos + i]; + return oldValue.length > value2.length ? oldValue : value2; + }); + component.value = diff2.join(value); + } else { + component.value = diff2.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff2.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + } + } + return components; +} +var characterDiff = new Diff(); +function longestCommonPrefix(str1, str2) { + var i; + for (i = 0; i < str1.length && i < str2.length; i++) { + if (str1[i] != str2[i]) { + return str1.slice(0, i); + } + } + return str1.slice(0, i); +} +function longestCommonSuffix(str1, str2) { + var i; + if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) { + return ""; + } + for (i = 0; i < str1.length && i < str2.length; i++) { + if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) { + return str1.slice(-i); + } + } + return str1.slice(-i); +} +function replacePrefix(string, oldPrefix, newPrefix) { + if (string.slice(0, oldPrefix.length) != oldPrefix) { + throw Error("string ".concat(JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug")); + } + return newPrefix + string.slice(oldPrefix.length); +} +function replaceSuffix(string, oldSuffix, newSuffix) { + if (!oldSuffix) { + return string + newSuffix; + } + if (string.slice(-oldSuffix.length) != oldSuffix) { + throw Error("string ".concat(JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug")); + } + return string.slice(0, -oldSuffix.length) + newSuffix; +} +function removePrefix(string, oldPrefix) { + return replacePrefix(string, oldPrefix, ""); +} +function removeSuffix(string, oldSuffix) { + return replaceSuffix(string, oldSuffix, ""); +} +function maximumOverlap(string1, string2) { + return string2.slice(0, overlapCount(string1, string2)); +} +function overlapCount(a, b) { + var startA = 0; + if (a.length > b.length) { + startA = a.length - b.length; + } + var endB = b.length; + if (a.length < b.length) { + endB = a.length; + } + var map2 = Array(endB); + var k = 0; + map2[0] = 0; + for (var j = 1; j < endB; j++) { + if (b[j] == b[k]) { + map2[j] = map2[k]; + } else { + map2[j] = k; + } + while (k > 0 && b[j] != b[k]) { + k = map2[k]; + } + if (b[j] == b[k]) { + k++; + } + } + k = 0; + for (var i = startA; i < a.length; i++) { + while (k > 0 && a[i] != b[k]) { + k = map2[k]; + } + if (a[i] == b[k]) { + k++; + } + } + return k; +} +var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}"; +var tokenizeIncludingWhitespace = new RegExp("[".concat(extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), "ug"); +var wordDiff = new Diff(); +wordDiff.equals = function(left, right, options8) { + if (options8.ignoreCase) { + left = left.toLowerCase(); + right = right.toLowerCase(); + } + return left.trim() === right.trim(); +}; +wordDiff.tokenize = function(value) { + var options8 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var parts; + if (options8.intlSegmenter) { + if (options8.intlSegmenter.resolvedOptions().granularity != "word") { + throw new Error('The segmenter passed must have a granularity of "word"'); + } + parts = Array.from(options8.intlSegmenter.segment(value), function(segment) { + return segment.segment; + }); + } else { + parts = value.match(tokenizeIncludingWhitespace) || []; + } + var tokens = []; + var prevPart = null; + parts.forEach(function(part) { + if (/\s/.test(part)) { + if (prevPart == null) { + tokens.push(part); + } else { + tokens.push(tokens.pop() + part); + } + } else if (/\s/.test(prevPart)) { + if (tokens[tokens.length - 1] == prevPart) { + tokens.push(tokens.pop() + part); + } else { + tokens.push(prevPart + part); + } + } else { + tokens.push(part); + } + prevPart = part; + }); + return tokens; +}; +wordDiff.join = function(tokens) { + return tokens.map(function(token2, i) { + if (i == 0) { + return token2; + } else { + return token2.replace(/^\s+/, ""); + } + }).join(""); +}; +wordDiff.postProcess = function(changes, options8) { + if (!changes || options8.oneChangePerToken) { + return changes; + } + var lastKeep = null; + var insertion = null; + var deletion = null; + changes.forEach(function(change) { + if (change.added) { + insertion = change; + } else if (change.removed) { + deletion = change; + } else { + if (insertion || deletion) { + dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change); + } + lastKeep = change; + insertion = null; + deletion = null; + } + }); + if (insertion || deletion) { + dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null); + } + return changes; +}; +function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) { + if (deletion && insertion) { + var oldWsPrefix = deletion.value.match(/^\s*/)[0]; + var oldWsSuffix = deletion.value.match(/\s*$/)[0]; + var newWsPrefix = insertion.value.match(/^\s*/)[0]; + var newWsSuffix = insertion.value.match(/\s*$/)[0]; + if (startKeep) { + var commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix); + startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix); + deletion.value = removePrefix(deletion.value, commonWsPrefix); + insertion.value = removePrefix(insertion.value, commonWsPrefix); + } + if (endKeep) { + var commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix); + endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix); + deletion.value = removeSuffix(deletion.value, commonWsSuffix); + insertion.value = removeSuffix(insertion.value, commonWsSuffix); + } + } else if (insertion) { + if (startKeep) { + insertion.value = insertion.value.replace(/^\s*/, ""); + } + if (endKeep) { + endKeep.value = endKeep.value.replace(/^\s*/, ""); + } + } else if (startKeep && endKeep) { + var newWsFull = endKeep.value.match(/^\s*/)[0], delWsStart = deletion.value.match(/^\s*/)[0], delWsEnd = deletion.value.match(/\s*$/)[0]; + var newWsStart = longestCommonPrefix(newWsFull, delWsStart); + deletion.value = removePrefix(deletion.value, newWsStart); + var newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd); + deletion.value = removeSuffix(deletion.value, newWsEnd); + endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd); + startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length)); + } else if (endKeep) { + var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0]; + var deletionWsSuffix = deletion.value.match(/\s*$/)[0]; + var overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix); + deletion.value = removeSuffix(deletion.value, overlap); + } else if (startKeep) { + var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0]; + var deletionWsPrefix = deletion.value.match(/^\s*/)[0]; + var _overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix); + deletion.value = removePrefix(deletion.value, _overlap); + } +} +var wordWithSpaceDiff = new Diff(); +wordWithSpaceDiff.tokenize = function(value) { + var regex = new RegExp("(\\r?\\n)|[".concat(extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), "ug"); + return value.match(regex) || []; +}; +var lineDiff = new Diff(); +lineDiff.tokenize = function(value, options8) { + if (options8.stripTrailingCr) { + value = value.replace(/\r\n/g, "\n"); + } + var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + for (var i = 0; i < linesAndNewlines.length; i++) { + var line3 = linesAndNewlines[i]; + if (i % 2 && !options8.newlineIsToken) { + retLines[retLines.length - 1] += line3; + } else { + retLines.push(line3); + } + } + return retLines; +}; +lineDiff.equals = function(left, right, options8) { + if (options8.ignoreWhitespace) { + if (!options8.newlineIsToken || !left.includes("\n")) { + left = left.trim(); + } + if (!options8.newlineIsToken || !right.includes("\n")) { + right = right.trim(); + } + } else if (options8.ignoreNewlineAtEof && !options8.newlineIsToken) { + if (left.endsWith("\n")) { + left = left.slice(0, -1); + } + if (right.endsWith("\n")) { + right = right.slice(0, -1); + } + } + return Diff.prototype.equals.call(this, left, right, options8); +}; +function diffLines(oldStr, newStr, callback) { + return lineDiff.diff(oldStr, newStr, callback); +} +var sentenceDiff = new Diff(); +sentenceDiff.tokenize = function(value) { + return value.split(/(\S.+?[.!?])(?=\s+|$)/); +}; +var cssDiff = new Diff(); +cssDiff.tokenize = function(value) { + return value.split(/([{}:;,]|\s+)/); +}; +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { + _defineProperty(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; +} +function _typeof(o) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof(o); +} +function _defineProperty(obj, key2, value) { + key2 = _toPropertyKey(key2); + if (key2 in obj) { + Object.defineProperty(obj, key2, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key2] = value; + } + return obj; +} +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); +} +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; +} +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +var jsonDiff = new Diff(); +jsonDiff.useLongestToken = true; +jsonDiff.tokenize = lineDiff.tokenize; +jsonDiff.castInput = function(value, options8) { + var undefinedReplacement = options8.undefinedReplacement, _options$stringifyRep = options8.stringifyReplacer, stringifyReplacer = _options$stringifyRep === void 0 ? function(k, v) { + return typeof v === "undefined" ? undefinedReplacement : v; + } : _options$stringifyRep; + return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " "); +}; +jsonDiff.equals = function(left, right, options8) { + return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"), options8); +}; +function canonicalize(obj, stack2, replacementStack, replacer, key2) { + stack2 = stack2 || []; + replacementStack = replacementStack || []; + if (replacer) { + obj = replacer(key2, obj); + } + var i; + for (i = 0; i < stack2.length; i += 1) { + if (stack2[i] === obj) { + return replacementStack[i]; + } + } + var canonicalizedObj; + if ("[object Array]" === Object.prototype.toString.call(obj)) { + stack2.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i = 0; i < obj.length; i += 1) { + canonicalizedObj[i] = canonicalize(obj[i], stack2, replacementStack, replacer, key2); + } + stack2.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + if (_typeof(obj) === "object" && obj !== null) { + stack2.push(obj); + canonicalizedObj = {}; + replacementStack.push(canonicalizedObj); + var sortedKeys = [], _key; + for (_key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, _key)) { + sortedKeys.push(_key); + } + } + sortedKeys.sort(); + for (i = 0; i < sortedKeys.length; i += 1) { + _key = sortedKeys[i]; + canonicalizedObj[_key] = canonicalize(obj[_key], stack2, replacementStack, replacer, _key); + } + stack2.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; +} +var arrayDiff = new Diff(); +arrayDiff.tokenize = function(value) { + return value.slice(); +}; +arrayDiff.join = arrayDiff.removeEmpty = function(value) { + return value; +}; +function diffArrays(oldArr, newArr, callback) { + return arrayDiff.diff(oldArr, newArr, callback); +} +function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) { + if (!options8) { + options8 = {}; + } + if (typeof options8 === "function") { + options8 = { + callback: options8 + }; + } + if (typeof options8.context === "undefined") { + options8.context = 4; + } + if (options8.newlineIsToken) { + throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions"); + } + if (!options8.callback) { + return diffLinesResultToPatch(diffLines(oldStr, newStr, options8)); + } else { + var _options = options8, _callback = _options.callback; + diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options8), {}, { + callback: function callback(diff2) { + var patch = diffLinesResultToPatch(diff2); + _callback(patch); + } + })); + } + function diffLinesResultToPatch(diff2) { + if (!diff2) { + return; + } + diff2.push({ + value: "", + lines: [] + }); + function contextLines(lines) { + return lines.map(function(entry) { + return " " + entry; + }); + } + var hunks = []; + var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; + var _loop = function _loop2() { + var current = diff2[i], lines = current.lines || splitLines(current.value); + current.lines = lines; + if (current.added || current.removed) { + var _curRange; + if (!oldRangeStart) { + var prev = diff2[i - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + if (prev) { + curRange = options8.context > 0 ? contextLines(prev.lines.slice(-options8.context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) { + return (current.added ? "+" : "-") + entry; + }))); + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + if (oldRangeStart) { + if (lines.length <= options8.context * 2 && i < diff2.length - 2) { + var _curRange2; + (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); + } else { + var _curRange3; + var contextSize = Math.min(lines.length, options8.context); + (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); + var _hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + hunks.push(_hunk); + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + }; + for (var i = 0; i < diff2.length; i++) { + _loop(); + } + for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) { + var hunk = _hunks[_i]; + for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) { + if (hunk.lines[_i2].endsWith("\n")) { + hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1); + } else { + hunk.lines.splice(_i2 + 1, 0, "\\ No newline at end of file"); + _i2++; + } + } + } + return { + oldFileName, + newFileName, + oldHeader, + newHeader, + hunks + }; + } +} +function formatPatch(diff2) { + if (Array.isArray(diff2)) { + return diff2.map(formatPatch).join("\n"); + } + var ret = []; + if (diff2.oldFileName == diff2.newFileName) { + ret.push("Index: " + diff2.oldFileName); + } + ret.push("==================================================================="); + ret.push("--- " + diff2.oldFileName + (typeof diff2.oldHeader === "undefined" ? "" : " " + diff2.oldHeader)); + ret.push("+++ " + diff2.newFileName + (typeof diff2.newHeader === "undefined" ? "" : " " + diff2.newHeader)); + for (var i = 0; i < diff2.hunks.length; i++) { + var hunk = diff2.hunks[i]; + if (hunk.oldLines === 0) { + hunk.oldStart -= 1; + } + if (hunk.newLines === 0) { + hunk.newStart -= 1; + } + ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@"); + ret.push.apply(ret, hunk.lines); + } + return ret.join("\n") + "\n"; +} +function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) { + var _options2; + if (typeof options8 === "function") { + options8 = { + callback: options8 + }; + } + if (!((_options2 = options8) !== null && _options2 !== void 0 && _options2.callback)) { + var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8); + if (!patchObj) { + return; + } + return formatPatch(patchObj); + } else { + var _options3 = options8, _callback2 = _options3.callback; + structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options8), {}, { + callback: function callback(patchObj2) { + if (!patchObj2) { + _callback2(); + } else { + _callback2(formatPatch(patchObj2)); + } + } + })); + } +} +function splitLines(text) { + var hasTrailingNl = text.endsWith("\n"); + var result = text.split("\n").map(function(line3) { + return line3 + "\n"; + }); + if (hasTrailingNl) { + result.pop(); + } else { + result.push(result.pop().slice(0, -1)); + } + return result; +} + +// src/index.js +var import_fast_glob = __toESM(require_out4(), 1); + +// node_modules/vnopts/lib/descriptors/api.js +var apiDescriptor = { + key: (key2) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(key2) ? key2 : JSON.stringify(key2), + value(value) { + if (value === null || typeof value !== "object") { + return JSON.stringify(value); + } + if (Array.isArray(value)) { + return `[${value.map((subValue) => apiDescriptor.value(subValue)).join(", ")}]`; + } + const keys = Object.keys(value); + return keys.length === 0 ? "{}" : `{ ${keys.map((key2) => `${apiDescriptor.key(key2)}: ${apiDescriptor.value(value[key2])}`).join(", ")} }`; + }, + pair: ({ key: key2, value }) => apiDescriptor.value({ [key2]: value }) +}; + +// node_modules/chalk/source/vendor/ansi-styles/index.js +var ANSI_BACKGROUND_OFFSET = 10; +var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; +var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; +var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; +var styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + // Bright color + blackBright: [90, 39], + gray: [90, 39], + // Alias of `blackBright` + grey: [90, 39], + // Alias of `blackBright` + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + // Bright color + bgBlackBright: [100, 49], + bgGray: [100, 49], + // Alias of `bgBlackBright` + bgGrey: [100, 49], + // Alias of `bgBlackBright` + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } +}; +var modifierNames = Object.keys(styles.modifier); +var foregroundColorNames = Object.keys(styles.color); +var backgroundColorNames = Object.keys(styles.bgColor); +var colorNames = [...foregroundColorNames, ...backgroundColorNames]; +function assembleStyles() { + const codes2 = /* @__PURE__ */ new Map(); + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\x1B[${style[0]}m`, + close: `\x1B[${style[1]}m` + }; + group[styleName] = styles[styleName]; + codes2.set(style[0], style[1]); + } + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + Object.defineProperty(styles, "codes", { + value: codes2, + enumerable: false + }); + styles.color.close = "\x1B[39m"; + styles.bgColor.close = "\x1B[49m"; + styles.color.ansi = wrapAnsi16(); + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + Object.defineProperties(styles, { + rgbToAnsi256: { + value(red, green, blue) { + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + if (red > 248) { + return 231; + } + return Math.round((red - 8) / 247 * 24) + 232; + } + return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); + }, + enumerable: false + }, + hexToRgb: { + value(hex) { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + let [colorString] = matches; + if (colorString.length === 3) { + colorString = [...colorString].map((character) => character + character).join(""); + } + const integer = Number.parseInt(colorString, 16); + return [ + /* eslint-disable no-bitwise */ + integer >> 16 & 255, + integer >> 8 & 255, + integer & 255 + /* eslint-enable no-bitwise */ + ]; + }, + enumerable: false + }, + hexToAnsi256: { + value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false + }, + ansi256ToAnsi: { + value(code) { + if (code < 8) { + return 30 + code; + } + if (code < 16) { + return 90 + (code - 8); + } + let red; + let green; + let blue; + if (code >= 232) { + red = ((code - 232) * 10 + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + const remainder = code % 36; + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = remainder % 6 / 5; + } + const value = Math.max(red, green, blue) * 2; + if (value === 0) { + return 30; + } + let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); + if (value === 2) { + result += 60; + } + return result; + }, + enumerable: false + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false + }, + hexToAnsi: { + value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false + } + }); + return styles; +} +var ansiStyles = assembleStyles(); +var ansi_styles_default = ansiStyles; + +// node_modules/chalk/source/vendor/supports-color/index.js +import process2 from "process"; +import os from "os"; +import tty from "tty"; +function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} +var { env } = process2; +var flagForceColor; +if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + flagForceColor = 0; +} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + flagForceColor = 1; +} +function envForceColor() { + if ("FORCE_COLOR" in env) { + if (env.FORCE_COLOR === "true") { + return 1; + } + if (env.FORCE_COLOR === "false") { + return 0; + } + return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + } +} +function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} +function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== void 0) { + flagForceColor = noFlagForceColor; + } + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + if (forceColor === 0) { + return 0; + } + if (sniffFlags) { + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + } + if ("TF_BUILD" in env && "AGENT_NAME" in env) { + return 1; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; + } + if (process2.platform === "win32") { + const osRelease = os.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key2) => key2 in env)) { + return 3; + } + if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign2) => sign2 in env) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if (env.COLORTERM === "truecolor") { + return 3; + } + if (env.TERM === "xterm-kitty") { + return 3; + } + if ("TERM_PROGRAM" in env) { + const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": { + return version >= 3 ? 3 : 2; + } + case "Apple_Terminal": { + return 2; + } + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + return min; +} +function createSupportsColor(stream, options8 = {}) { + const level = _supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options8 + }); + return translateLevel(level); +} +var supportsColor = { + stdout: createSupportsColor({ isTTY: tty.isatty(1) }), + stderr: createSupportsColor({ isTTY: tty.isatty(2) }) +}; +var supports_color_default = supportsColor; + +// node_modules/chalk/source/utilities.js +function stringReplaceAll(string, substring, replacer) { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ""; + do { + returnValue += string.slice(endIndex, index) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} +function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { + let endIndex = 0; + let returnValue = ""; + do { + const gotCR = string[index - 1] === "\r"; + returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; + endIndex = index + 1; + index = string.indexOf("\n", endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} + +// node_modules/chalk/source/index.js +var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default; +var GENERATOR = Symbol("GENERATOR"); +var STYLER = Symbol("STYLER"); +var IS_EMPTY = Symbol("IS_EMPTY"); +var levelMapping = [ + "ansi", + "ansi", + "ansi256", + "ansi16m" +]; +var styles2 = /* @__PURE__ */ Object.create(null); +var applyOptions = (object, options8 = {}) => { + if (options8.level && !(Number.isInteger(options8.level) && options8.level >= 0 && options8.level <= 3)) { + throw new Error("The `level` option should be an integer from 0 to 3"); + } + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options8.level === void 0 ? colorLevel : options8.level; +}; +var chalkFactory = (options8) => { + const chalk2 = (...strings) => strings.join(" "); + applyOptions(chalk2, options8); + Object.setPrototypeOf(chalk2, createChalk.prototype); + return chalk2; +}; +function createChalk(options8) { + return chalkFactory(options8); +} +Object.setPrototypeOf(createChalk.prototype, Function.prototype); +for (const [styleName, style] of Object.entries(ansi_styles_default)) { + styles2[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); + Object.defineProperty(this, styleName, { value: builder }); + return builder; + } + }; +} +styles2.visible = { + get() { + const builder = createBuilder(this, this[STYLER], true); + Object.defineProperty(this, "visible", { value: builder }); + return builder; + } +}; +var getModelAnsi = (model, level, type2, ...arguments_) => { + if (model === "rgb") { + if (level === "ansi16m") { + return ansi_styles_default[type2].ansi16m(...arguments_); + } + if (level === "ansi256") { + return ansi_styles_default[type2].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); + } + return ansi_styles_default[type2].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); + } + if (model === "hex") { + return getModelAnsi("rgb", level, type2, ...ansi_styles_default.hexToRgb(...arguments_)); + } + return ansi_styles_default[type2][model](...arguments_); +}; +var usedModels = ["rgb", "hex", "ansi256"]; +for (const model of usedModels) { + styles2[model] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; + } + }; + const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); + styles2[bgModel] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; + } + }; +} +var proto = Object.defineProperties(() => { +}, { + ...styles2, + level: { + enumerable: true, + get() { + return this[GENERATOR].level; + }, + set(level) { + this[GENERATOR].level = level; + } + } +}); +var createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === void 0) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } + return { + open, + close, + openAll, + closeAll, + parent + }; +}; +var createBuilder = (self, _styler, _isEmpty) => { + const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); + Object.setPrototypeOf(builder, proto); + builder[GENERATOR] = self; + builder[STYLER] = _styler; + builder[IS_EMPTY] = _isEmpty; + return builder; +}; +var applyStyle = (self, string) => { + if (self.level <= 0 || !string) { + return self[IS_EMPTY] ? "" : string; + } + let styler = self[STYLER]; + if (styler === void 0) { + return string; + } + const { openAll, closeAll } = styler; + if (string.includes("\x1B")) { + while (styler !== void 0) { + string = stringReplaceAll(string, styler.close, styler.open); + styler = styler.parent; + } + } + const lfIndex = string.indexOf("\n"); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } + return openAll + string + closeAll; +}; +Object.defineProperties(createChalk.prototype, styles2); +var chalk = createChalk(); +var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); +var source_default = chalk; + +// node_modules/vnopts/lib/handlers/deprecated/common.js +var commonDeprecatedHandler = (keyOrPair, redirectTo, { descriptor }) => { + const messages2 = [ + `${source_default.yellow(typeof keyOrPair === "string" ? descriptor.key(keyOrPair) : descriptor.pair(keyOrPair))} is deprecated` + ]; + if (redirectTo) { + messages2.push(`we now treat it as ${source_default.blue(typeof redirectTo === "string" ? descriptor.key(redirectTo) : descriptor.pair(redirectTo))}`); + } + return messages2.join("; ") + "."; +}; + +// node_modules/vnopts/lib/constants.js +var VALUE_NOT_EXIST = Symbol.for("vnopts.VALUE_NOT_EXIST"); +var VALUE_UNCHANGED = Symbol.for("vnopts.VALUE_UNCHANGED"); + +// node_modules/vnopts/lib/handlers/invalid/common.js +var INDENTATION = " ".repeat(2); +var commonInvalidHandler = (key2, value, utils) => { + const { text, list } = utils.normalizeExpectedResult(utils.schemas[key2].expected(utils)); + const descriptions = []; + if (text) { + descriptions.push(getDescription(key2, value, text, utils.descriptor)); + } + if (list) { + descriptions.push([getDescription(key2, value, list.title, utils.descriptor)].concat(list.values.map((valueDescription) => getListDescription(valueDescription, utils.loggerPrintWidth))).join("\n")); + } + return chooseDescription(descriptions, utils.loggerPrintWidth); +}; +function getDescription(key2, value, expected, descriptor) { + return [ + `Invalid ${source_default.red(descriptor.key(key2))} value.`, + `Expected ${source_default.blue(expected)},`, + `but received ${value === VALUE_NOT_EXIST ? source_default.gray("nothing") : source_default.red(descriptor.value(value))}.` + ].join(" "); +} +function getListDescription({ text, list }, printWidth) { + const descriptions = []; + if (text) { + descriptions.push(`- ${source_default.blue(text)}`); + } + if (list) { + descriptions.push([`- ${source_default.blue(list.title)}:`].concat(list.values.map((valueDescription) => getListDescription(valueDescription, printWidth - INDENTATION.length).replace(/^|\n/g, `$&${INDENTATION}`))).join("\n")); + } + return chooseDescription(descriptions, printWidth); +} +function chooseDescription(descriptions, printWidth) { + if (descriptions.length === 1) { + return descriptions[0]; + } + const [firstDescription, secondDescription] = descriptions; + const [firstWidth, secondWidth] = descriptions.map((description) => description.split("\n", 1)[0].length); + return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription; +} + +// node_modules/leven/index.js +var array = []; +var characterCodeCache = []; +function leven(first, second) { + if (first === second) { + return 0; + } + const swap = first; + if (first.length > second.length) { + first = second; + second = swap; + } + let firstLength = first.length; + let secondLength = second.length; + while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) { + firstLength--; + secondLength--; + } + let start = 0; + while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) { + start++; + } + firstLength -= start; + secondLength -= start; + if (firstLength === 0) { + return secondLength; + } + let bCharacterCode; + let result; + let temporary; + let temporary2; + let index = 0; + let index2 = 0; + while (index < firstLength) { + characterCodeCache[index] = first.charCodeAt(start + index); + array[index] = ++index; + } + while (index2 < secondLength) { + bCharacterCode = second.charCodeAt(start + index2); + temporary = index2++; + result = index2; + for (index = 0; index < firstLength; index++) { + temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1; + temporary = array[index]; + result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2; + } + } + return result; +} + +// node_modules/vnopts/lib/handlers/unknown/leven.js +var levenUnknownHandler = (key2, value, { descriptor, logger, schemas }) => { + const messages2 = [ + `Ignored unknown option ${source_default.yellow(descriptor.pair({ key: key2, value }))}.` + ]; + const suggestion = Object.keys(schemas).sort().find((knownKey) => leven(key2, knownKey) < 3); + if (suggestion) { + messages2.push(`Did you mean ${source_default.blue(descriptor.key(suggestion))}?`); + } + logger.warn(messages2.join(" ")); +}; + +// node_modules/vnopts/lib/schema.js +var HANDLER_KEYS = [ + "default", + "expected", + "validate", + "deprecated", + "forward", + "redirect", + "overlap", + "preprocess", + "postprocess" +]; +function createSchema(SchemaConstructor, parameters) { + const schema2 = new SchemaConstructor(parameters); + const subSchema = Object.create(schema2); + for (const handlerKey of HANDLER_KEYS) { + if (handlerKey in parameters) { + subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema2, Schema.prototype[handlerKey].length); + } + } + return subSchema; +} +var Schema = class { + static create(parameters) { + return createSchema(this, parameters); + } + constructor(parameters) { + this.name = parameters.name; + } + default(_utils) { + return void 0; + } + // this is actually an abstract method but we need a placeholder to get `function.length` + /* c8 ignore start */ + expected(_utils) { + return "nothing"; + } + /* c8 ignore stop */ + // this is actually an abstract method but we need a placeholder to get `function.length` + /* c8 ignore start */ + validate(_value, _utils) { + return false; + } + /* c8 ignore stop */ + deprecated(_value, _utils) { + return false; + } + forward(_value, _utils) { + return void 0; + } + redirect(_value, _utils) { + return void 0; + } + overlap(currentValue, _newValue, _utils) { + return currentValue; + } + preprocess(value, _utils) { + return value; + } + postprocess(_value, _utils) { + return VALUE_UNCHANGED; + } +}; +function normalizeHandler(handler, superSchema, handlerArgumentsLength) { + return typeof handler === "function" ? (...args) => handler(...args.slice(0, handlerArgumentsLength - 1), superSchema, ...args.slice(handlerArgumentsLength - 1)) : () => handler; +} + +// node_modules/vnopts/lib/schemas/alias.js +var AliasSchema = class extends Schema { + constructor(parameters) { + super(parameters); + this._sourceName = parameters.sourceName; + } + expected(utils) { + return utils.schemas[this._sourceName].expected(utils); + } + validate(value, utils) { + return utils.schemas[this._sourceName].validate(value, utils); + } + redirect(_value, _utils) { + return this._sourceName; + } +}; + +// node_modules/vnopts/lib/schemas/any.js +var AnySchema = class extends Schema { + expected() { + return "anything"; + } + validate() { + return true; + } +}; + +// node_modules/vnopts/lib/schemas/array.js +var ArraySchema = class extends Schema { + constructor({ valueSchema, name = valueSchema.name, ...handlers }) { + super({ ...handlers, name }); + this._valueSchema = valueSchema; + } + expected(utils) { + const { text, list } = utils.normalizeExpectedResult(this._valueSchema.expected(utils)); + return { + text: text && `an array of ${text}`, + list: list && { + title: `an array of the following values`, + values: [{ list }] + } + }; + } + validate(value, utils) { + if (!Array.isArray(value)) { + return false; + } + const invalidValues = []; + for (const subValue of value) { + const subValidateResult = utils.normalizeValidateResult(this._valueSchema.validate(subValue, utils), subValue); + if (subValidateResult !== true) { + invalidValues.push(subValidateResult.value); + } + } + return invalidValues.length === 0 ? true : { value: invalidValues }; + } + deprecated(value, utils) { + const deprecatedResult = []; + for (const subValue of value) { + const subDeprecatedResult = utils.normalizeDeprecatedResult(this._valueSchema.deprecated(subValue, utils), subValue); + if (subDeprecatedResult !== false) { + deprecatedResult.push(...subDeprecatedResult.map(({ value: deprecatedValue }) => ({ + value: [deprecatedValue] + }))); + } + } + return deprecatedResult; + } + forward(value, utils) { + const forwardResult = []; + for (const subValue of value) { + const subForwardResult = utils.normalizeForwardResult(this._valueSchema.forward(subValue, utils), subValue); + forwardResult.push(...subForwardResult.map(wrapTransferResult)); + } + return forwardResult; + } + redirect(value, utils) { + const remain = []; + const redirect = []; + for (const subValue of value) { + const subRedirectResult = utils.normalizeRedirectResult(this._valueSchema.redirect(subValue, utils), subValue); + if ("remain" in subRedirectResult) { + remain.push(subRedirectResult.remain); + } + redirect.push(...subRedirectResult.redirect.map(wrapTransferResult)); + } + return remain.length === 0 ? { redirect } : { redirect, remain }; + } + overlap(currentValue, newValue) { + return currentValue.concat(newValue); + } +}; +function wrapTransferResult({ from, to }) { + return { from: [from], to }; +} + +// node_modules/vnopts/lib/schemas/boolean.js +var BooleanSchema = class extends Schema { + expected() { + return "true or false"; + } + validate(value) { + return typeof value === "boolean"; + } +}; + +// node_modules/vnopts/lib/utils.js +function recordFromArray(array2, mainKey) { + const record = /* @__PURE__ */ Object.create(null); + for (const value of array2) { + const key2 = value[mainKey]; + if (record[key2]) { + throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key2)}`); + } + record[key2] = value; + } + return record; +} +function mapFromArray(array2, mainKey) { + const map2 = /* @__PURE__ */ new Map(); + for (const value of array2) { + const key2 = value[mainKey]; + if (map2.has(key2)) { + throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key2)}`); + } + map2.set(key2, value); + } + return map2; +} +function createAutoChecklist() { + const map2 = /* @__PURE__ */ Object.create(null); + return (id) => { + const idString = JSON.stringify(id); + if (map2[idString]) { + return true; + } + map2[idString] = true; + return false; + }; +} +function partition(array2, predicate) { + const trueArray = []; + const falseArray = []; + for (const value of array2) { + if (predicate(value)) { + trueArray.push(value); + } else { + falseArray.push(value); + } + } + return [trueArray, falseArray]; +} +function isInt(value) { + return value === Math.floor(value); +} +function comparePrimitive(a, b) { + if (a === b) { + return 0; + } + const typeofA = typeof a; + const typeofB = typeof b; + const orders = [ + "undefined", + "object", + "boolean", + "number", + "string" + ]; + if (typeofA !== typeofB) { + return orders.indexOf(typeofA) - orders.indexOf(typeofB); + } + if (typeofA !== "string") { + return Number(a) - Number(b); + } + return a.localeCompare(b); +} +function normalizeInvalidHandler(invalidHandler) { + return (...args) => { + const errorMessageOrError = invalidHandler(...args); + return typeof errorMessageOrError === "string" ? new Error(errorMessageOrError) : errorMessageOrError; + }; +} +function normalizeDefaultResult(result) { + return result === void 0 ? {} : result; +} +function normalizeExpectedResult(result) { + if (typeof result === "string") { + return { text: result }; + } + const { text, list } = result; + assert((text || list) !== void 0, "Unexpected `expected` result, there should be at least one field."); + if (!list) { + return { text }; + } + return { + text, + list: { + title: list.title, + values: list.values.map(normalizeExpectedResult) + } + }; +} +function normalizeValidateResult(result, value) { + return result === true ? true : result === false ? { value } : result; +} +function normalizeDeprecatedResult(result, value, doNotNormalizeTrue = false) { + return result === false ? false : result === true ? doNotNormalizeTrue ? true : [{ value }] : "value" in result ? [result] : result.length === 0 ? false : result; +} +function normalizeTransferResult(result, value) { + return typeof result === "string" || "key" in result ? { from: value, to: result } : "from" in result ? { from: result.from, to: result.to } : { from: value, to: result.to }; +} +function normalizeForwardResult(result, value) { + return result === void 0 ? [] : Array.isArray(result) ? result.map((transferResult) => normalizeTransferResult(transferResult, value)) : [normalizeTransferResult(result, value)]; +} +function normalizeRedirectResult(result, value) { + const redirect = normalizeForwardResult(typeof result === "object" && "redirect" in result ? result.redirect : result, value); + return redirect.length === 0 ? { remain: value, redirect } : typeof result === "object" && "remain" in result ? { remain: result.remain, redirect } : { redirect }; +} +function assert(isValid, message) { + if (!isValid) { + throw new Error(message); + } +} + +// node_modules/vnopts/lib/schemas/choice.js +var ChoiceSchema = class extends Schema { + constructor(parameters) { + super(parameters); + this._choices = mapFromArray(parameters.choices.map((choice) => choice && typeof choice === "object" ? choice : { value: choice }), "value"); + } + expected({ descriptor }) { + const choiceDescriptions = Array.from(this._choices.keys()).map((value) => this._choices.get(value)).filter(({ hidden }) => !hidden).map((choiceInfo) => choiceInfo.value).sort(comparePrimitive).map(descriptor.value); + const head = choiceDescriptions.slice(0, -2); + const tail = choiceDescriptions.slice(-2); + const message = head.concat(tail.join(" or ")).join(", "); + return { + text: message, + list: { + title: "one of the following values", + values: choiceDescriptions + } + }; + } + validate(value) { + return this._choices.has(value); + } + deprecated(value) { + const choiceInfo = this._choices.get(value); + return choiceInfo && choiceInfo.deprecated ? { value } : false; + } + forward(value) { + const choiceInfo = this._choices.get(value); + return choiceInfo ? choiceInfo.forward : void 0; + } + redirect(value) { + const choiceInfo = this._choices.get(value); + return choiceInfo ? choiceInfo.redirect : void 0; + } +}; + +// node_modules/vnopts/lib/schemas/number.js +var NumberSchema = class extends Schema { + expected() { + return "a number"; + } + validate(value, _utils) { + return typeof value === "number"; + } +}; + +// node_modules/vnopts/lib/schemas/integer.js +var IntegerSchema = class extends NumberSchema { + expected() { + return "an integer"; + } + validate(value, utils) { + return utils.normalizeValidateResult(super.validate(value, utils), value) === true && isInt(value); + } +}; + +// node_modules/vnopts/lib/schemas/string.js +var StringSchema = class extends Schema { + expected() { + return "a string"; + } + validate(value) { + return typeof value === "string"; + } +}; + +// node_modules/vnopts/lib/defaults.js +var defaultDescriptor = apiDescriptor; +var defaultUnknownHandler = levenUnknownHandler; +var defaultInvalidHandler = commonInvalidHandler; +var defaultDeprecatedHandler = commonDeprecatedHandler; + +// node_modules/vnopts/lib/normalize.js +var Normalizer = class { + constructor(schemas, opts) { + const { logger = console, loggerPrintWidth = 80, descriptor = defaultDescriptor, unknown = defaultUnknownHandler, invalid = defaultInvalidHandler, deprecated = defaultDeprecatedHandler, missing = () => false, required = () => false, preprocess = (x) => x, postprocess = () => VALUE_UNCHANGED } = opts || {}; + this._utils = { + descriptor, + logger: ( + /* c8 ignore next */ + logger || { warn: () => { + } } + ), + loggerPrintWidth, + schemas: recordFromArray(schemas, "name"), + normalizeDefaultResult, + normalizeExpectedResult, + normalizeDeprecatedResult, + normalizeForwardResult, + normalizeRedirectResult, + normalizeValidateResult + }; + this._unknownHandler = unknown; + this._invalidHandler = normalizeInvalidHandler(invalid); + this._deprecatedHandler = deprecated; + this._identifyMissing = (k, o) => !(k in o) || missing(k, o); + this._identifyRequired = required; + this._preprocess = preprocess; + this._postprocess = postprocess; + this.cleanHistory(); + } + cleanHistory() { + this._hasDeprecationWarned = createAutoChecklist(); + } + normalize(options8) { + const newOptions = {}; + const preprocessed = this._preprocess(options8, this._utils); + const restOptionsArray = [preprocessed]; + const applyNormalization = () => { + while (restOptionsArray.length !== 0) { + const currentOptions = restOptionsArray.shift(); + const transferredOptionsArray = this._applyNormalization(currentOptions, newOptions); + restOptionsArray.push(...transferredOptionsArray); + } + }; + applyNormalization(); + for (const key2 of Object.keys(this._utils.schemas)) { + const schema2 = this._utils.schemas[key2]; + if (!(key2 in newOptions)) { + const defaultResult = normalizeDefaultResult(schema2.default(this._utils)); + if ("value" in defaultResult) { + restOptionsArray.push({ [key2]: defaultResult.value }); + } + } + } + applyNormalization(); + for (const key2 of Object.keys(this._utils.schemas)) { + if (!(key2 in newOptions)) { + continue; + } + const schema2 = this._utils.schemas[key2]; + const value = newOptions[key2]; + const newValue = schema2.postprocess(value, this._utils); + if (newValue === VALUE_UNCHANGED) { + continue; + } + this._applyValidation(newValue, key2, schema2); + newOptions[key2] = newValue; + } + this._applyPostprocess(newOptions); + this._applyRequiredCheck(newOptions); + return newOptions; + } + _applyNormalization(options8, newOptions) { + const transferredOptionsArray = []; + const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8); + for (const key2 of knownKeys) { + const schema2 = this._utils.schemas[key2]; + const value = schema2.preprocess(options8[key2], this._utils); + this._applyValidation(value, key2, schema2); + const appendTransferredOptions = ({ from, to }) => { + transferredOptionsArray.push(typeof to === "string" ? { [to]: from } : { [to.key]: to.value }); + }; + const warnDeprecated = ({ value: currentValue, redirectTo }) => { + const deprecatedResult = normalizeDeprecatedResult( + schema2.deprecated(currentValue, this._utils), + value, + /* doNotNormalizeTrue */ + true + ); + if (deprecatedResult === false) { + return; + } + if (deprecatedResult === true) { + if (!this._hasDeprecationWarned(key2)) { + this._utils.logger.warn(this._deprecatedHandler(key2, redirectTo, this._utils)); + } + } else { + for (const { value: deprecatedValue } of deprecatedResult) { + const pair = { key: key2, value: deprecatedValue }; + if (!this._hasDeprecationWarned(pair)) { + const redirectToPair = typeof redirectTo === "string" ? { key: redirectTo, value: deprecatedValue } : redirectTo; + this._utils.logger.warn(this._deprecatedHandler(pair, redirectToPair, this._utils)); + } + } + } + }; + const forwardResult = normalizeForwardResult(schema2.forward(value, this._utils), value); + forwardResult.forEach(appendTransferredOptions); + const redirectResult = normalizeRedirectResult(schema2.redirect(value, this._utils), value); + redirectResult.redirect.forEach(appendTransferredOptions); + if ("remain" in redirectResult) { + const remainingValue = redirectResult.remain; + newOptions[key2] = key2 in newOptions ? schema2.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue; + warnDeprecated({ value: remainingValue }); + } + for (const { from, to } of redirectResult.redirect) { + warnDeprecated({ value: from, redirectTo: to }); + } + } + for (const key2 of unknownKeys) { + const value = options8[key2]; + this._applyUnknownHandler(key2, value, newOptions, (knownResultKey, knownResultValue) => { + transferredOptionsArray.push({ [knownResultKey]: knownResultValue }); + }); + } + return transferredOptionsArray; + } + _applyRequiredCheck(options8) { + for (const key2 of Object.keys(this._utils.schemas)) { + if (this._identifyMissing(key2, options8)) { + if (this._identifyRequired(key2)) { + throw this._invalidHandler(key2, VALUE_NOT_EXIST, this._utils); + } + } + } + } + _partitionOptionKeys(options8) { + const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => key2 in this._utils.schemas); + return { knownKeys, unknownKeys }; + } + _applyValidation(value, key2, schema2) { + const validateResult = normalizeValidateResult(schema2.validate(value, this._utils), value); + if (validateResult !== true) { + throw this._invalidHandler(key2, validateResult.value, this._utils); + } + } + _applyUnknownHandler(key2, value, newOptions, knownResultHandler) { + const unknownResult = this._unknownHandler(key2, value, this._utils); + if (!unknownResult) { + return; + } + for (const resultKey of Object.keys(unknownResult)) { + if (this._identifyMissing(resultKey, unknownResult)) { + continue; + } + const resultValue = unknownResult[resultKey]; + if (resultKey in this._utils.schemas) { + knownResultHandler(resultKey, resultValue); + } else { + newOptions[resultKey] = resultValue; + } + } + } + _applyPostprocess(options8) { + const postprocessed = this._postprocess(options8, this._utils); + if (postprocessed === VALUE_UNCHANGED) { + return; + } + if (postprocessed.delete) { + for (const deleteKey of postprocessed.delete) { + delete options8[deleteKey]; + } + } + if (postprocessed.override) { + const { knownKeys, unknownKeys } = this._partitionOptionKeys(postprocessed.override); + for (const key2 of knownKeys) { + const value = postprocessed.override[key2]; + this._applyValidation(value, key2, this._utils.schemas[key2]); + options8[key2] = value; + } + for (const key2 of unknownKeys) { + const value = postprocessed.override[key2]; + this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => { + const schema2 = this._utils.schemas[knownResultKey]; + this._applyValidation(knownResultValue, knownResultKey, schema2); + options8[knownResultKey] = knownResultValue; + }); + } + } + } +}; + +// src/common/errors.js +var errors_exports = {}; +__export(errors_exports, { + ArgExpansionBailout: () => ArgExpansionBailout, + ConfigError: () => ConfigError, + UndefinedParserError: () => UndefinedParserError +}); +var ConfigError = class extends Error { + name = "ConfigError"; +}; +var UndefinedParserError = class extends Error { + name = "UndefinedParserError"; +}; +var ArgExpansionBailout = class extends Error { + name = "ArgExpansionBailout"; +}; + +// src/config/resolve-config.js +var import_micromatch = __toESM(require_micromatch(), 1); +import path9 from "path"; + +// node_modules/url-or-path/index.js +import { fileURLToPath, pathToFileURL } from "url"; +var URL_STRING_PREFIX = "file:"; +var isUrlInstance = (value) => value instanceof URL; +var isUrlString = (value) => typeof value === "string" && value.startsWith(URL_STRING_PREFIX); +var isUrl = (urlOrPath) => isUrlInstance(urlOrPath) || isUrlString(urlOrPath); +var toPath = (urlOrPath) => isUrl(urlOrPath) ? fileURLToPath(urlOrPath) : urlOrPath; + +// src/utils/partition.js +function partition2(array2, predicate) { + const result = [[], []]; + for (const value of array2) { + result[predicate(value) ? 0 : 1].push(value); + } + return result; +} +var partition_default = partition2; + +// src/config/editorconfig/index.js +var import_editorconfig = __toESM(require_src(), 1); +import path4 from "path"; + +// src/config/find-project-root.js +import * as path3 from "path"; + +// src/utils/is-directory.js +import fs from "fs/promises"; +async function isDirectory(directory, options8) { + const allowSymlinks = (options8 == null ? void 0 : options8.allowSymlinks) ?? true; + let stats; + try { + stats = await (allowSymlinks ? fs.stat : fs.lstat)(toPath(directory)); + } catch { + return false; + } + return stats.isDirectory(); +} +var is_directory_default = isDirectory; + +// src/config/searcher.js +import path2 from "path"; + +// node_modules/iterate-directory-up/index.js +import * as path from "path"; +var toAbsolutePath = (value) => path.resolve(toPath(value)); +function* iterateDirectoryUp(from, to) { + from = toAbsolutePath(from); + const { root: root2 } = path.parse(from); + to = to ? toAbsolutePath(to) : root2; + if (from !== to && !from.startsWith(to)) { + return; + } + for (let directory = from; directory !== to; directory = path.dirname(directory)) { + yield directory; + } + yield to; +} +var iterate_directory_up_default = iterateDirectoryUp; + +// src/config/searcher.js +var _names, _filter, _stopDirectory, _cache, _Searcher_instances, searchInDirectory_fn; +var Searcher = class { + /** + * @param {{ + * names: string[], + * filter: (fileOrDirectory: {name: string, path: string}) => Promise, + * stopDirectory?: string, + * }} param0 + */ + constructor({ names, filter: filter2, stopDirectory }) { + __privateAdd(this, _Searcher_instances); + __privateAdd(this, _names); + __privateAdd(this, _filter); + __privateAdd(this, _stopDirectory); + __privateAdd(this, _cache, /* @__PURE__ */ new Map()); + __privateSet(this, _names, names); + __privateSet(this, _filter, filter2); + __privateSet(this, _stopDirectory, stopDirectory); + } + async search(startDirectory, { shouldCache }) { + const cache3 = __privateGet(this, _cache); + if (shouldCache && cache3.has(startDirectory)) { + return cache3.get(startDirectory); + } + const searchedDirectories = []; + let result; + for (const directory of iterate_directory_up_default( + startDirectory, + __privateGet(this, _stopDirectory) + )) { + searchedDirectories.push(directory); + result = await __privateMethod(this, _Searcher_instances, searchInDirectory_fn).call(this, directory, shouldCache); + if (result) { + break; + } + } + for (const directory of searchedDirectories) { + cache3.set(directory, result); + } + return result; + } + clearCache() { + __privateGet(this, _cache).clear(); + } +}; +_names = new WeakMap(); +_filter = new WeakMap(); +_stopDirectory = new WeakMap(); +_cache = new WeakMap(); +_Searcher_instances = new WeakSet(); +searchInDirectory_fn = async function(directory, shouldCache) { + const cache3 = __privateGet(this, _cache); + if (shouldCache && cache3.has(directory)) { + return cache3.get(directory); + } + for (const name of __privateGet(this, _names)) { + const fileOrDirectory = path2.join(directory, name); + if (await __privateGet(this, _filter).call(this, { name, path: fileOrDirectory })) { + return fileOrDirectory; + } + } +}; +var searcher_default = Searcher; + +// src/config/find-project-root.js +var MARKERS = [".git", ".hg"]; +var searcher; +var searchOptions = { + names: MARKERS, + filter: ({ path: directory }) => is_directory_default(directory, { allowSymlinks: false }) +}; +async function findProjectRoot(startDirectory, options8) { + searcher ?? (searcher = new searcher_default(searchOptions)); + const mark = await searcher.search(startDirectory, options8); + return mark ? path3.dirname(mark) : void 0; +} +function clearFindProjectRootCache() { + searcher == null ? void 0 : searcher.clearCache(); +} + +// src/config/editorconfig/editorconfig-to-prettier.js +function removeUnset(editorConfig) { + const result = {}; + const keys = Object.keys(editorConfig); + for (let i = 0; i < keys.length; i++) { + const key2 = keys[i]; + if (editorConfig[key2] === "unset") { + continue; + } + result[key2] = editorConfig[key2]; + } + return result; +} +function editorConfigToPrettier(editorConfig) { + if (!editorConfig) { + return null; + } + editorConfig = removeUnset(editorConfig); + if (Object.keys(editorConfig).length === 0) { + return null; + } + const result = {}; + if (editorConfig.indent_style) { + result.useTabs = editorConfig.indent_style === "tab"; + } + if (editorConfig.indent_size === "tab") { + result.useTabs = true; + } + if (result.useTabs && editorConfig.tab_width) { + result.tabWidth = editorConfig.tab_width; + } else if (editorConfig.indent_style === "space" && editorConfig.indent_size && editorConfig.indent_size !== "tab") { + result.tabWidth = editorConfig.indent_size; + } else if (editorConfig.tab_width !== void 0) { + result.tabWidth = editorConfig.tab_width; + } + if (editorConfig.max_line_length) { + if (editorConfig.max_line_length === "off") { + result.printWidth = Number.POSITIVE_INFINITY; + } else { + result.printWidth = editorConfig.max_line_length; + } + } + if (editorConfig.quote_type === "single") { + result.singleQuote = true; + } else if (editorConfig.quote_type === "double") { + result.singleQuote = false; + } + if (["cr", "crlf", "lf"].includes(editorConfig.end_of_line)) { + result.endOfLine = editorConfig.end_of_line; + } + return result; +} +var editorconfig_to_prettier_default = editorConfigToPrettier; + +// src/config/editorconfig/index.js +var editorconfigCache = /* @__PURE__ */ new Map(); +function clearEditorconfigCache() { + clearFindProjectRootCache(); + editorconfigCache.clear(); +} +async function loadEditorconfigInternal(file, { shouldCache }) { + const directory = path4.dirname(file); + const root2 = await findProjectRoot(directory, { shouldCache }); + const editorConfig = await import_editorconfig.default.parse(file, { root: root2 }); + const config = editorconfig_to_prettier_default(editorConfig); + return config; +} +function loadEditorconfig(file, { shouldCache }) { + file = path4.resolve(file); + if (!shouldCache || !editorconfigCache.has(file)) { + editorconfigCache.set( + file, + loadEditorconfigInternal(file, { shouldCache }) + ); + } + return editorconfigCache.get(file); +} + +// src/config/prettier-config/index.js +import path8 from "path"; + +// src/common/mockable.js +var import_ci_info = __toESM(require_ci_info(), 1); +import fs2 from "fs/promises"; + +// node_modules/get-stdin/index.js +var { stdin } = process; +async function getStdin() { + let result = ""; + if (stdin.isTTY) { + return result; + } + stdin.setEncoding("utf8"); + for await (const chunk of stdin) { + result += chunk; + } + return result; +} +getStdin.buffer = async () => { + const result = []; + let length = 0; + if (stdin.isTTY) { + return Buffer.concat([]); + } + for await (const chunk of stdin) { + result.push(chunk); + length += chunk.length; + } + return Buffer.concat(result, length); +}; + +// src/common/mockable.js +function writeFormattedFile(file, data) { + return fs2.writeFile(file, data); +} +var mockable = { + getPrettierConfigSearchStopDirectory: () => void 0, + getStdin, + isCI: () => import_ci_info.isCI, + writeFormattedFile +}; +var mockable_default = mockable; + +// src/utils/is-file.js +import fs3 from "fs/promises"; +async function isFile(file, options8) { + const allowSymlinks = (options8 == null ? void 0 : options8.allowSymlinks) ?? true; + let stats; + try { + stats = await (allowSymlinks ? fs3.stat : fs3.lstat)(toPath(file)); + } catch { + return false; + } + return stats.isFile(); +} +var is_file_default = isFile; + +// src/config/prettier-config/loaders.js +import { pathToFileURL as pathToFileURL2 } from "url"; + +// node_modules/js-yaml/dist/js-yaml.mjs +function isNothing(subject) { + return typeof subject === "undefined" || subject === null; +} +function isObject(subject) { + return typeof subject === "object" && subject !== null; +} +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + return [sequence]; +} +function extend(target, source2) { + var index, length, key2, sourceKeys; + if (source2) { + sourceKeys = Object.keys(source2); + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key2 = sourceKeys[index]; + target[key2] = source2[key2]; + } + } + return target; +} +function repeat(string, count) { + var result = "", cycle; + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + return result; +} +function isNegativeZero(number) { + return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; +} +var isNothing_1 = isNothing; +var isObject_1 = isObject; +var toArray_1 = toArray; +var repeat_1 = repeat; +var isNegativeZero_1 = isNegativeZero; +var extend_1 = extend; +var common = { + isNothing: isNothing_1, + isObject: isObject_1, + toArray: toArray_1, + repeat: repeat_1, + isNegativeZero: isNegativeZero_1, + extend: extend_1 +}; +function formatError(exception2, compact) { + var where = "", message = exception2.reason || "(unknown reason)"; + if (!exception2.mark) return message; + if (exception2.mark.name) { + where += 'in "' + exception2.mark.name + '" '; + } + where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")"; + if (!compact && exception2.mark.snippet) { + where += "\n\n" + exception2.mark.snippet; + } + return message + " " + where; +} +function YAMLException$1(reason, mark) { + Error.call(this); + this.name = "YAMLException"; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack || ""; + } +} +YAMLException$1.prototype = Object.create(Error.prototype); +YAMLException$1.prototype.constructor = YAMLException$1; +YAMLException$1.prototype.toString = function toString(compact) { + return this.name + ": " + formatError(this, compact); +}; +var exception = YAMLException$1; +function getLine(buffer2, lineStart, lineEnd, position, maxLineLength) { + var head = ""; + var tail = ""; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + if (position - lineStart > maxHalfLength) { + head = " ... "; + lineStart = position - maxHalfLength + head.length; + } + if (lineEnd - position > maxHalfLength) { + tail = " ..."; + lineEnd = position + maxHalfLength - tail.length; + } + return { + str: head + buffer2.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail, + pos: position - lineStart + head.length + // relative position + }; +} +function padStart(string, max) { + return common.repeat(" ", max - string.length) + string; +} +function makeSnippet(mark, options8) { + options8 = Object.create(options8 || null); + if (!mark.buffer) return null; + if (!options8.maxLength) options8.maxLength = 79; + if (typeof options8.indent !== "number") options8.indent = 1; + if (typeof options8.linesBefore !== "number") options8.linesBefore = 3; + if (typeof options8.linesAfter !== "number") options8.linesAfter = 2; + var re = /\r?\n|\r|\0/g; + var lineStarts = [0]; + var lineEnds = []; + var match; + var foundLineNo = -1; + while (match = re.exec(mark.buffer)) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + var result = "", i, line3; + var lineNoLength = Math.min(mark.line + options8.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options8.maxLength - (options8.indent + lineNoLength + 3); + for (i = 1; i <= options8.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line3 = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(" ", options8.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line3.str + "\n" + result; + } + line3 = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(" ", options8.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line3.str + "\n"; + result += common.repeat("-", options8.indent + lineNoLength + 3 + line3.pos) + "^\n"; + for (i = 1; i <= options8.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line3 = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(" ", options8.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line3.str + "\n"; + } + return result.replace(/\n$/, ""); +} +var snippet = makeSnippet; +var TYPE_CONSTRUCTOR_OPTIONS = [ + "kind", + "multi", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "representName", + "defaultStyle", + "styleAliases" +]; +var YAML_NODE_KINDS = [ + "scalar", + "sequence", + "mapping" +]; +function compileStyleAliases(map2) { + var result = {}; + if (map2 !== null) { + Object.keys(map2).forEach(function(style) { + map2[style].forEach(function(alias) { + result[String(alias)] = style; + }); + }); + } + return result; +} +function Type$1(tag, options8) { + options8 = options8 || {}; + Object.keys(options8).forEach(function(name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + this.options = options8; + this.tag = tag; + this.kind = options8["kind"] || null; + this.resolve = options8["resolve"] || function() { + return true; + }; + this.construct = options8["construct"] || function(data) { + return data; + }; + this.instanceOf = options8["instanceOf"] || null; + this.predicate = options8["predicate"] || null; + this.represent = options8["represent"] || null; + this.representName = options8["representName"] || null; + this.defaultStyle = options8["defaultStyle"] || null; + this.multi = options8["multi"] || false; + this.styleAliases = compileStyleAliases(options8["styleAliases"] || null); + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} +var type = Type$1; +function compileList(schema2, name) { + var result = []; + schema2[name].forEach(function(currentType) { + var newIndex = result.length; + result.forEach(function(previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) { + newIndex = previousIndex; + } + }); + result[newIndex] = currentType; + }); + return result; +} +function compileMap() { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + function collectType(type2) { + if (type2.multi) { + result.multi[type2.kind].push(type2); + result.multi["fallback"].push(type2); + } else { + result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2; + } + } + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} +function Schema$1(definition) { + return this.extend(definition); +} +Schema$1.prototype.extend = function extend2(definition) { + var implicit = []; + var explicit = []; + if (definition instanceof type) { + explicit.push(definition); + } else if (Array.isArray(definition)) { + explicit = explicit.concat(definition); + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + } else { + throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + } + implicit.forEach(function(type$1) { + if (!(type$1 instanceof type)) { + throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + if (type$1.loadKind && type$1.loadKind !== "scalar") { + throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + } + if (type$1.multi) { + throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); + } + }); + explicit.forEach(function(type$1) { + if (!(type$1 instanceof type)) { + throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + }); + var result = Object.create(Schema$1.prototype); + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + result.compiledImplicit = compileList(result, "implicit"); + result.compiledExplicit = compileList(result, "explicit"); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + return result; +}; +var schema = Schema$1; +var str = new type("tag:yaml.org,2002:str", { + kind: "scalar", + construct: function(data) { + return data !== null ? data : ""; + } +}); +var seq = new type("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: function(data) { + return data !== null ? data : []; + } +}); +var map = new type("tag:yaml.org,2002:map", { + kind: "mapping", + construct: function(data) { + return data !== null ? data : {}; + } +}); +var failsafe = new schema({ + explicit: [ + str, + seq, + map + ] +}); +function resolveYamlNull(data) { + if (data === null) return true; + var max = data.length; + return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL"); +} +function constructYamlNull() { + return null; +} +function isNull(object) { + return object === null; +} +var _null = new type("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function() { + return "~"; + }, + lowercase: function() { + return "null"; + }, + uppercase: function() { + return "NULL"; + }, + camelcase: function() { + return "Null"; + }, + empty: function() { + return ""; + } + }, + defaultStyle: "lowercase" +}); +function resolveYamlBoolean(data) { + if (data === null) return false; + var max = data.length; + return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE"); +} +function constructYamlBoolean(data) { + return data === "true" || data === "True" || data === "TRUE"; +} +function isBoolean(object) { + return Object.prototype.toString.call(object) === "[object Boolean]"; +} +var bool = new type("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function(object) { + return object ? "true" : "false"; + }, + uppercase: function(object) { + return object ? "TRUE" : "FALSE"; + }, + camelcase: function(object) { + return object ? "True" : "False"; + } + }, + defaultStyle: "lowercase" +}); +function isHexCode(c2) { + return 48 <= c2 && c2 <= 57 || 65 <= c2 && c2 <= 70 || 97 <= c2 && c2 <= 102; +} +function isOctCode(c2) { + return 48 <= c2 && c2 <= 55; +} +function isDecCode(c2) { + return 48 <= c2 && c2 <= 57; +} +function resolveYamlInteger(data) { + if (data === null) return false; + var max = data.length, index = 0, hasDigits = false, ch; + if (!max) return false; + ch = data[index]; + if (ch === "-" || ch === "+") { + ch = data[++index]; + } + if (ch === "0") { + if (index + 1 === max) return true; + ch = data[++index]; + if (ch === "b") { + index++; + for (; index < max; index++) { + ch = data[index]; + if (ch === "_") continue; + if (ch !== "0" && ch !== "1") return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "x") { + index++; + for (; index < max; index++) { + ch = data[index]; + if (ch === "_") continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "o") { + index++; + for (; index < max; index++) { + ch = data[index]; + if (ch === "_") continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + } + if (ch === "_") return false; + for (; index < max; index++) { + ch = data[index]; + if (ch === "_") continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + if (!hasDigits || ch === "_") return false; + return true; +} +function constructYamlInteger(data) { + var value = data, sign2 = 1, ch; + if (value.indexOf("_") !== -1) { + value = value.replace(/_/g, ""); + } + ch = value[0]; + if (ch === "-" || ch === "+") { + if (ch === "-") sign2 = -1; + value = value.slice(1); + ch = value[0]; + } + if (value === "0") return 0; + if (ch === "0") { + if (value[1] === "b") return sign2 * parseInt(value.slice(2), 2); + if (value[1] === "x") return sign2 * parseInt(value.slice(2), 16); + if (value[1] === "o") return sign2 * parseInt(value.slice(2), 8); + } + return sign2 * parseInt(value, 10); +} +function isInteger(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object)); +} +var int = new type("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function(obj) { + return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); + }, + octal: function(obj) { + return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1); + }, + decimal: function(obj) { + return obj.toString(10); + }, + /* eslint-disable max-len */ + hexadecimal: function(obj) { + return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); + } + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"] + } +}); +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" +); +function resolveYamlFloat(data) { + if (data === null) return false; + if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === "_") { + return false; + } + return true; +} +function constructYamlFloat(data) { + var value, sign2; + value = data.replace(/_/g, "").toLowerCase(); + sign2 = value[0] === "-" ? -1 : 1; + if ("+-".indexOf(value[0]) >= 0) { + value = value.slice(1); + } + if (value === ".inf") { + return sign2 === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + } else if (value === ".nan") { + return NaN; + } + return sign2 * parseFloat(value, 10); +} +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; +function representYamlFloat(object, style) { + var res; + if (isNaN(object)) { + switch (style) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + } else if (common.isNegativeZero(object)) { + return "-0.0"; + } + res = object.toString(10); + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; +} +function isFloat(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object)); +} +var float = new type("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: "lowercase" +}); +var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] +}); +var core = json; +var YAML_DATE_REGEXP = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" +); +var YAML_TIMESTAMP_REGEXP = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" +); +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + if (match === null) throw new Error("Date resolve error"); + year = +match[1]; + month = +match[2] - 1; + day = +match[3]; + if (!match[4]) { + return new Date(Date.UTC(year, month, day)); + } + hour = +match[4]; + minute = +match[5]; + second = +match[6]; + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { + fraction += "0"; + } + fraction = +fraction; + } + if (match[9]) { + tz_hour = +match[10]; + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 6e4; + if (match[9] === "-") delta = -delta; + } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (delta) date.setTime(date.getTime() - delta); + return date; +} +function representYamlTimestamp(object) { + return object.toISOString(); +} +var timestamp = new type("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); +function resolveYamlMerge(data) { + return data === "<<" || data === null; +} +var merge = new type("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: resolveYamlMerge +}); +var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; +function resolveYamlBinary(data) { + if (data === null) return false; + var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP; + for (idx = 0; idx < max; idx++) { + code = map2.indexOf(data.charAt(idx)); + if (code > 64) continue; + if (code < 0) return false; + bitlen += 6; + } + return bitlen % 8 === 0; +} +function constructYamlBinary(data) { + var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = []; + for (idx = 0; idx < max; idx++) { + if (idx % 4 === 0 && idx) { + result.push(bits >> 16 & 255); + result.push(bits >> 8 & 255); + result.push(bits & 255); + } + bits = bits << 6 | map2.indexOf(input.charAt(idx)); + } + tailbits = max % 4 * 6; + if (tailbits === 0) { + result.push(bits >> 16 & 255); + result.push(bits >> 8 & 255); + result.push(bits & 255); + } else if (tailbits === 18) { + result.push(bits >> 10 & 255); + result.push(bits >> 2 & 255); + } else if (tailbits === 12) { + result.push(bits >> 4 & 255); + } + return new Uint8Array(result); +} +function representYamlBinary(object) { + var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP; + for (idx = 0; idx < max; idx++) { + if (idx % 3 === 0 && idx) { + result += map2[bits >> 18 & 63]; + result += map2[bits >> 12 & 63]; + result += map2[bits >> 6 & 63]; + result += map2[bits & 63]; + } + bits = (bits << 8) + object[idx]; + } + tail = max % 3; + if (tail === 0) { + result += map2[bits >> 18 & 63]; + result += map2[bits >> 12 & 63]; + result += map2[bits >> 6 & 63]; + result += map2[bits & 63]; + } else if (tail === 2) { + result += map2[bits >> 10 & 63]; + result += map2[bits >> 4 & 63]; + result += map2[bits << 2 & 63]; + result += map2[64]; + } else if (tail === 1) { + result += map2[bits >> 2 & 63]; + result += map2[bits << 4 & 63]; + result += map2[64]; + result += map2[64]; + } + return result; +} +function isBinary(obj) { + return Object.prototype.toString.call(obj) === "[object Uint8Array]"; +} +var binary = new type("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); +var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; +var _toString$2 = Object.prototype.toString; +function resolveYamlOmap(data) { + if (data === null) return true; + var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + if (_toString$2.call(pair) !== "[object Object]") return false; + for (pairKey in pair) { + if (_hasOwnProperty$3.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + if (!pairHasKey) return false; + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + return true; +} +function constructYamlOmap(data) { + return data !== null ? data : []; +} +var omap = new type("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); +var _toString$1 = Object.prototype.toString; +function resolveYamlPairs(data) { + if (data === null) return true; + var index, length, pair, keys, result, object = data; + result = new Array(object.length); + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + if (_toString$1.call(pair) !== "[object Object]") return false; + keys = Object.keys(pair); + if (keys.length !== 1) return false; + result[index] = [keys[0], pair[keys[0]]]; + } + return true; +} +function constructYamlPairs(data) { + if (data === null) return []; + var index, length, pair, keys, result, object = data; + result = new Array(object.length); + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + keys = Object.keys(pair); + result[index] = [keys[0], pair[keys[0]]]; + } + return result; +} +var pairs = new type("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); +var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; +function resolveYamlSet(data) { + if (data === null) return true; + var key2, object = data; + for (key2 in object) { + if (_hasOwnProperty$2.call(object, key2)) { + if (object[key2] !== null) return false; + } + } + return true; +} +function constructYamlSet(data) { + return data !== null ? data : {}; +} +var set = new type("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: resolveYamlSet, + construct: constructYamlSet +}); +var _default = core.extend({ + implicit: [ + timestamp, + merge + ], + explicit: [ + binary, + omap, + pairs, + set + ] +}); +var _hasOwnProperty$1 = Object.prototype.hasOwnProperty; +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; +function _class(obj) { + return Object.prototype.toString.call(obj); +} +function is_EOL(c2) { + return c2 === 10 || c2 === 13; +} +function is_WHITE_SPACE(c2) { + return c2 === 9 || c2 === 32; +} +function is_WS_OR_EOL(c2) { + return c2 === 9 || c2 === 32 || c2 === 10 || c2 === 13; +} +function is_FLOW_INDICATOR(c2) { + return c2 === 44 || c2 === 91 || c2 === 93 || c2 === 123 || c2 === 125; +} +function fromHexCode(c2) { + var lc; + if (48 <= c2 && c2 <= 57) { + return c2 - 48; + } + lc = c2 | 32; + if (97 <= lc && lc <= 102) { + return lc - 97 + 10; + } + return -1; +} +function escapedHexLen(c2) { + if (c2 === 120) { + return 2; + } + if (c2 === 117) { + return 4; + } + if (c2 === 85) { + return 8; + } + return 0; +} +function fromDecimalCode(c2) { + if (48 <= c2 && c2 <= 57) { + return c2 - 48; + } + return -1; +} +function simpleEscapeSequence(c2) { + return c2 === 48 ? "\0" : c2 === 97 ? "\x07" : c2 === 98 ? "\b" : c2 === 116 ? " " : c2 === 9 ? " " : c2 === 110 ? "\n" : c2 === 118 ? "\v" : c2 === 102 ? "\f" : c2 === 114 ? "\r" : c2 === 101 ? "\x1B" : c2 === 32 ? " " : c2 === 34 ? '"' : c2 === 47 ? "/" : c2 === 92 ? "\\" : c2 === 78 ? "\x85" : c2 === 95 ? "\xA0" : c2 === 76 ? "\u2028" : c2 === 80 ? "\u2029" : ""; +} +function charFromCodepoint(c2) { + if (c2 <= 65535) { + return String.fromCharCode(c2); + } + return String.fromCharCode( + (c2 - 65536 >> 10) + 55296, + (c2 - 65536 & 1023) + 56320 + ); +} +var simpleEscapeCheck = new Array(256); +var simpleEscapeMap = new Array(256); +for (i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} +var i; +function State$1(input, options8) { + this.input = input; + this.filename = options8["filename"] || null; + this.schema = options8["schema"] || _default; + this.onWarning = options8["onWarning"] || null; + this.legacy = options8["legacy"] || false; + this.json = options8["json"] || false; + this.listener = options8["listener"] || null; + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + this.firstTabInLine = -1; + this.documents = []; +} +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), + // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + mark.snippet = snippet(mark); + return new exception(message, mark); +} +function throwError(state, message) { + throw generateError(state, message); +} +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} +var directiveHandlers = { + YAML: function handleYamlDirective(state, name, args) { + var match, major, minor; + if (state.version !== null) { + throwError(state, "duplication of %YAML directive"); + } + if (args.length !== 1) { + throwError(state, "YAML directive accepts exactly one argument"); + } + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match === null) { + throwError(state, "ill-formed argument of the YAML directive"); + } + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + if (major !== 1) { + throwError(state, "unacceptable YAML version of the document"); + } + state.version = args[0]; + state.checkLineBreaks = minor < 2; + if (minor !== 1 && minor !== 2) { + throwWarning(state, "unsupported YAML version of the document"); + } + }, + TAG: function handleTagDirective(state, name, args) { + var handle, prefix; + if (args.length !== 2) { + throwError(state, "TAG directive accepts exactly two arguments"); + } + handle = args[0]; + prefix = args[1]; + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, "ill-formed tag handle (first argument) of the TAG directive"); + } + if (_hasOwnProperty$1.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, "ill-formed tag prefix (second argument) of the TAG directive"); + } + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, "tag prefix is malformed: " + prefix); + } + state.tagMap[handle] = prefix; + } +}; +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + if (start < end) { + _result = state.input.slice(start, end); + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 9 || 32 <= _character && _character <= 1114111)) { + throwError(state, "expected valid JSON character"); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, "the stream contains non-printable characters"); + } + state.result += _result; + } +} +function mergeMappings(state, destination, source2, overridableKeys) { + var sourceKeys, key2, index, quantity; + if (!common.isObject(source2)) { + throwError(state, "cannot merge mappings; the provided source object is unacceptable"); + } + sourceKeys = Object.keys(source2); + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key2 = sourceKeys[index]; + if (!_hasOwnProperty$1.call(destination, key2)) { + destination[key2] = source2[key2]; + overridableKeys[key2] = true; + } + } +} +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { + var index, quantity; + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, "nested arrays are not supported inside keys"); + } + if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") { + keyNode[index] = "[object Object]"; + } + } + } + if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") { + keyNode = "[object Object]"; + } + keyNode = String(keyNode); + if (_result === null) { + _result = {}; + } + if (keyTag === "tag:yaml.org,2002:merge") { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, "duplicated mapping key"); + } + if (keyNode === "__proto__") { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; + } + delete overridableKeys[keyNode]; + } + return _result; +} +function readLineBreak(state) { + var ch; + ch = state.input.charCodeAt(state.position); + if (ch === 10) { + state.position++; + } else if (ch === 13) { + state.position++; + if (state.input.charCodeAt(state.position) === 10) { + state.position++; + } + } else { + throwError(state, "a line break is expected"); + } + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; +} +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 9 && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } + if (allowComments && ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 10 && ch !== 13 && ch !== 0); + } + if (is_EOL(ch)) { + readLineBreak(state); + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + while (ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, "deficient indentation"); + } + return lineBreaks; +} +function testDocumentSeparator(state) { + var _position = state.position, ch; + ch = state.input.charCodeAt(_position); + if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { + _position += 3; + ch = state.input.charCodeAt(_position); + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + return false; +} +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += " "; + } else if (count > 1) { + state.result += common.repeat("\n", count - 1); + } +} +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; + ch = state.input.charCodeAt(state.position); + if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) { + return false; + } + if (ch === 63 || ch === 45) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + state.kind = "scalar"; + state.result = ""; + captureStart = captureEnd = state.position; + hasPendingContent = false; + while (ch !== 0) { + if (ch === 58) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + } else if (ch === 35) { + preceding = state.input.charCodeAt(state.position - 1); + if (is_WS_OR_EOL(preceding)) { + break; + } + } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + ch = state.input.charCodeAt(++state.position); + } + captureSegment(state, captureStart, captureEnd, false); + if (state.result) { + return true; + } + state.kind = _kind; + state.result = _result; + return false; +} +function readSingleQuotedScalar(state, nodeIndent) { + var ch, captureStart, captureEnd; + ch = state.input.charCodeAt(state.position); + if (ch !== 39) { + return false; + } + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 39) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (ch === 39) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, "unexpected end of the document within a single quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError(state, "unexpected end of the stream within a single quoted scalar"); +} +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, captureEnd, hexLength, hexResult, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 34) { + return false; + } + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 34) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + } else if (ch === 92) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + } else { + throwError(state, "expected hexadecimal character"); + } + } + state.result += charFromCodepoint(hexResult); + state.position++; + } else { + throwError(state, "unknown escape sequence"); + } + captureStart = captureEnd = state.position; + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, "unexpected end of the document within a double quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError(state, "unexpected end of the stream within a double quoted scalar"); +} +function readFlowCollection(state, nodeIndent) { + var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 91) { + terminator = 93; + isMapping = false; + _result = []; + } else if (ch === 123) { + terminator = 125; + isMapping = true; + _result = {}; + } else { + return false; + } + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(++state.position); + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? "mapping" : "sequence"; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, "missed comma between flow collection entries"); + } else if (ch === 44) { + throwError(state, "expected the node content, but found ','"); + } + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + if (ch === 63) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + _line = state.line; + _lineStart = state.lineStart; + _pos = state.position; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if ((isExplicitPair || state.line === _line) && ch === 58) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === 44) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + throwError(state, "unexpected end of the stream within a flow collection"); +} +function readBlockScalar(state, nodeIndent) { + var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 124) { + folding = false; + } else if (ch === 62) { + folding = true; + } else { + return false; + } + state.kind = "scalar"; + state.result = ""; + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + if (ch === 43 || ch === 45) { + if (CHOMPING_CLIP === chomping) { + chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, "repeat of a chomping mode identifier"); + } + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, "repeat of an indentation width identifier"); + } + } else { + break; + } + } + if (is_WHITE_SPACE(ch)) { + do { + ch = state.input.charCodeAt(++state.position); + } while (is_WHITE_SPACE(ch)); + if (ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (!is_EOL(ch) && ch !== 0); + } + } + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + ch = state.input.charCodeAt(state.position); + while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + if (is_EOL(ch)) { + emptyLines++; + continue; + } + if (state.lineIndent < textIndent) { + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { + state.result += "\n"; + } + } + break; + } + if (folding) { + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat("\n", emptyLines + 1); + } else if (emptyLines === 0) { + if (didReadContent) { + state.result += " "; + } + } else { + state.result += common.repeat("\n", emptyLines); + } + } else { + state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + while (!is_EOL(ch) && ch !== 0) { + ch = state.input.charCodeAt(++state.position); + } + captureSegment(state, captureStart, state.position, false); + } + return true; +} +function readBlockSequence(state, nodeIndent) { + var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; + if (state.firstTabInLine !== -1) return false; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, "tab characters must not be used in indentation"); + } + if (ch !== 45) { + break; + } + following = state.input.charCodeAt(state.position + 1); + if (!is_WS_OR_EOL(following)) { + break; + } + detected = true; + state.position++; + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) { + throwError(state, "bad indentation of a sequence entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "sequence"; + state.result = _result; + return true; + } + return false; +} +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + if (state.firstTabInLine !== -1) return false; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, "tab characters must not be used in indentation"); + } + following = state.input.charCodeAt(state.position + 1); + _line = state.line; + if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { + if (ch === 63) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = true; + allowCompact = true; + } else if (atExplicitKey) { + atExplicitKey = false; + allowCompact = true; + } else { + throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); + } + state.position += 1; + ch = following; + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + break; + } + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (ch === 58) { + ch = state.input.charCodeAt(++state.position); + if (!is_WS_OR_EOL(ch)) { + throwError(state, "a whitespace character is expected after the key-value separator within a block mapping"); + } + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + } else if (detected) { + throwError(state, "can not read an implicit mapping pair; a colon is missed"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } else if (detected) { + throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) { + throwError(state, "bad indentation of a mapping entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "mapping"; + state.result = _result; + } + return detected; +} +function readTagProperty(state) { + var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 33) return false; + if (state.tag !== null) { + throwError(state, "duplication of a tag property"); + } + ch = state.input.charCodeAt(++state.position); + if (ch === 60) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + } else if (ch === 33) { + isNamed = true; + tagHandle = "!!"; + ch = state.input.charCodeAt(++state.position); + } else { + tagHandle = "!"; + } + _position = state.position; + if (isVerbatim) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0 && ch !== 62); + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, "unexpected end of the stream within a verbatim tag"); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + if (ch === 33) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, "named tag handle cannot contain such characters"); + } + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, "tag suffix cannot contain exclamation marks"); + } + } + ch = state.input.charCodeAt(++state.position); + } + tagName = state.input.slice(_position, state.position); + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, "tag suffix cannot contain flow indicator characters"); + } + } + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, "tag name cannot contain such characters: " + tagName); + } + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, "tag name is malformed: " + tagName); + } + if (isVerbatim) { + state.tag = tagName; + } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + } else if (tagHandle === "!") { + state.tag = "!" + tagName; + } else if (tagHandle === "!!") { + state.tag = "tag:yaml.org,2002:" + tagName; + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + return true; +} +function readAnchorProperty(state) { + var _position, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 38) return false; + if (state.anchor !== null) { + throwError(state, "duplication of an anchor property"); + } + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError(state, "name of an anchor node must contain at least one character"); + } + state.anchor = state.input.slice(_position, state.position); + return true; +} +function readAlias(state) { + var _position, alias, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 42) return false; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError(state, "name of an alias node must contain at least one character"); + } + alias = state.input.slice(_position, state.position); + if (!_hasOwnProperty$1.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent; + if (state.listener !== null) { + state.listener("open", state); + } + state.tag = null; + state.anchor = null; + state.kind = null; + state.result = null; + allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; + if (allowToSeek) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + blockIndent = state.position - state.lineStart; + if (indentStatus === 1) { + if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + } else if (readAlias(state)) { + hasContent = true; + if (state.tag !== null || state.anchor !== null) { + throwError(state, "alias node should not have any properties"); + } + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + if (state.tag === null) { + state.tag = "?"; + } + } + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } else if (state.tag === "?") { + if (state.result !== null && state.kind !== "scalar") { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type2 = state.implicitTypes[typeIndex]; + if (type2.resolve(state.result)) { + state.result = type2.construct(state.result); + state.tag = type2.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== "!") { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) { + type2 = state.typeMap[state.kind || "fallback"][state.tag]; + } else { + type2 = null; + typeList = state.typeMap.multi[state.kind || "fallback"]; + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type2 = typeList[typeIndex]; + break; + } + } + } + if (!type2) { + throwError(state, "unknown tag !<" + state.tag + ">"); + } + if (state.result !== null && type2.kind !== state.kind) { + throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"'); + } + if (!type2.resolve(state.result, state.tag)) { + throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag"); + } else { + state.result = type2.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + if (state.listener !== null) { + state.listener("close", state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} +function readDocument(state) { + var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = /* @__PURE__ */ Object.create(null); + state.anchorMap = /* @__PURE__ */ Object.create(null); + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + if (state.lineIndent > 0 || ch !== 37) { + break; + } + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + if (directiveName.length < 1) { + throwError(state, "directive name must not be less than one character in length"); + } + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0 && !is_EOL(ch)); + break; + } + if (is_EOL(ch)) break; + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveArgs.push(state.input.slice(_position, state.position)); + } + if (ch !== 0) readLineBreak(state); + if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + skipSeparationSpace(state, true, -1); + if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } else if (hasDirectives) { + throwError(state, "directives end mark is expected"); + } + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, "non-ASCII line breaks are interpreted as content"); + } + state.documents.push(state.result); + if (state.position === state.lineStart && testDocumentSeparator(state)) { + if (state.input.charCodeAt(state.position) === 46) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + if (state.position < state.length - 1) { + throwError(state, "end of the stream or a document separator is expected"); + } else { + return; + } +} +function loadDocuments(input, options8) { + input = String(input); + options8 = options8 || {}; + if (input.length !== 0) { + if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) { + input += "\n"; + } + if (input.charCodeAt(0) === 65279) { + input = input.slice(1); + } + } + var state = new State$1(input, options8); + var nullpos = input.indexOf("\0"); + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, "null byte is not allowed in input"); + } + state.input += "\0"; + while (state.input.charCodeAt(state.position) === 32) { + state.lineIndent += 1; + state.position += 1; + } + while (state.position < state.length - 1) { + readDocument(state); + } + return state.documents; +} +function loadAll$1(input, iterator, options8) { + if (iterator !== null && typeof iterator === "object" && typeof options8 === "undefined") { + options8 = iterator; + iterator = null; + } + var documents = loadDocuments(input, options8); + if (typeof iterator !== "function") { + return documents; + } + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} +function load$1(input, options8) { + var documents = loadDocuments(input, options8); + if (documents.length === 0) { + return void 0; + } else if (documents.length === 1) { + return documents[0]; + } + throw new exception("expected a single document in the stream, but found more"); +} +var loadAll_1 = loadAll$1; +var load_1 = load$1; +var loader = { + loadAll: loadAll_1, + load: load_1 +}; +var ESCAPE_SEQUENCES = {}; +ESCAPE_SEQUENCES[0] = "\\0"; +ESCAPE_SEQUENCES[7] = "\\a"; +ESCAPE_SEQUENCES[8] = "\\b"; +ESCAPE_SEQUENCES[9] = "\\t"; +ESCAPE_SEQUENCES[10] = "\\n"; +ESCAPE_SEQUENCES[11] = "\\v"; +ESCAPE_SEQUENCES[12] = "\\f"; +ESCAPE_SEQUENCES[13] = "\\r"; +ESCAPE_SEQUENCES[27] = "\\e"; +ESCAPE_SEQUENCES[34] = '\\"'; +ESCAPE_SEQUENCES[92] = "\\\\"; +ESCAPE_SEQUENCES[133] = "\\N"; +ESCAPE_SEQUENCES[160] = "\\_"; +ESCAPE_SEQUENCES[8232] = "\\L"; +ESCAPE_SEQUENCES[8233] = "\\P"; +function renamed(from, to) { + return function() { + throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default."); + }; +} +var load = loader.load; +var loadAll = loader.loadAll; +var safeLoad = renamed("safeLoad", "load"); +var safeLoadAll = renamed("safeLoadAll", "loadAll"); +var safeDump = renamed("safeDump", "dump"); + +// node_modules/json5/dist/index.mjs +var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/; +var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/; +var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/; +var unicode = { + Space_Separator, + ID_Start, + ID_Continue +}; +var util = { + isSpaceSeparator(c2) { + return typeof c2 === "string" && unicode.Space_Separator.test(c2); + }, + isIdStartChar(c2) { + return typeof c2 === "string" && (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z" || c2 === "$" || c2 === "_" || unicode.ID_Start.test(c2)); + }, + isIdContinueChar(c2) { + return typeof c2 === "string" && (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z" || c2 >= "0" && c2 <= "9" || c2 === "$" || c2 === "_" || c2 === "\u200C" || c2 === "\u200D" || unicode.ID_Continue.test(c2)); + }, + isDigit(c2) { + return typeof c2 === "string" && /[0-9]/.test(c2); + }, + isHexDigit(c2) { + return typeof c2 === "string" && /[0-9A-Fa-f]/.test(c2); + } +}; +var source; +var parseState; +var stack; +var pos; +var line; +var column; +var token; +var key; +var root; +var parse2 = function parse3(text, reviver) { + source = String(text); + parseState = "start"; + stack = []; + pos = 0; + line = 1; + column = 0; + token = void 0; + key = void 0; + root = void 0; + do { + token = lex(); + parseStates[parseState](); + } while (token.type !== "eof"); + if (typeof reviver === "function") { + return internalize({ "": root }, "", reviver); + } + return root; +}; +function internalize(holder, name, reviver) { + const value = holder[name]; + if (value != null && typeof value === "object") { + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + const key2 = String(i); + const replacement = internalize(value, key2, reviver); + if (replacement === void 0) { + delete value[key2]; + } else { + Object.defineProperty(value, key2, { + value: replacement, + writable: true, + enumerable: true, + configurable: true + }); + } + } + } else { + for (const key2 in value) { + const replacement = internalize(value, key2, reviver); + if (replacement === void 0) { + delete value[key2]; + } else { + Object.defineProperty(value, key2, { + value: replacement, + writable: true, + enumerable: true, + configurable: true + }); + } + } + } + } + return reviver.call(holder, name, value); +} +var lexState; +var buffer; +var doubleQuote; +var sign; +var c; +function lex() { + lexState = "default"; + buffer = ""; + doubleQuote = false; + sign = 1; + for (; ; ) { + c = peek(); + const token2 = lexStates[lexState](); + if (token2) { + return token2; + } + } +} +function peek() { + if (source[pos]) { + return String.fromCodePoint(source.codePointAt(pos)); + } +} +function read() { + const c2 = peek(); + if (c2 === "\n") { + line++; + column = 0; + } else if (c2) { + column += c2.length; + } else { + column++; + } + if (c2) { + pos += c2.length; + } + return c2; +} +var lexStates = { + default() { + switch (c) { + case " ": + case "\v": + case "\f": + case " ": + case "\xA0": + case "\uFEFF": + case "\n": + case "\r": + case "\u2028": + case "\u2029": + read(); + return; + case "/": + read(); + lexState = "comment"; + return; + case void 0: + read(); + return newToken("eof"); + } + if (util.isSpaceSeparator(c)) { + read(); + return; + } + return lexStates[parseState](); + }, + comment() { + switch (c) { + case "*": + read(); + lexState = "multiLineComment"; + return; + case "/": + read(); + lexState = "singleLineComment"; + return; + } + throw invalidChar(read()); + }, + multiLineComment() { + switch (c) { + case "*": + read(); + lexState = "multiLineCommentAsterisk"; + return; + case void 0: + throw invalidChar(read()); + } + read(); + }, + multiLineCommentAsterisk() { + switch (c) { + case "*": + read(); + return; + case "/": + read(); + lexState = "default"; + return; + case void 0: + throw invalidChar(read()); + } + read(); + lexState = "multiLineComment"; + }, + singleLineComment() { + switch (c) { + case "\n": + case "\r": + case "\u2028": + case "\u2029": + read(); + lexState = "default"; + return; + case void 0: + read(); + return newToken("eof"); + } + read(); + }, + value() { + switch (c) { + case "{": + case "[": + return newToken("punctuator", read()); + case "n": + read(); + literal("ull"); + return newToken("null", null); + case "t": + read(); + literal("rue"); + return newToken("boolean", true); + case "f": + read(); + literal("alse"); + return newToken("boolean", false); + case "-": + case "+": + if (read() === "-") { + sign = -1; + } + lexState = "sign"; + return; + case ".": + buffer = read(); + lexState = "decimalPointLeading"; + return; + case "0": + buffer = read(); + lexState = "zero"; + return; + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + buffer = read(); + lexState = "decimalInteger"; + return; + case "I": + read(); + literal("nfinity"); + return newToken("numeric", Infinity); + case "N": + read(); + literal("aN"); + return newToken("numeric", NaN); + case '"': + case "'": + doubleQuote = read() === '"'; + buffer = ""; + lexState = "string"; + return; + } + throw invalidChar(read()); + }, + identifierNameStartEscape() { + if (c !== "u") { + throw invalidChar(read()); + } + read(); + const u = unicodeEscape(); + switch (u) { + case "$": + case "_": + break; + default: + if (!util.isIdStartChar(u)) { + throw invalidIdentifier(); + } + break; + } + buffer += u; + lexState = "identifierName"; + }, + identifierName() { + switch (c) { + case "$": + case "_": + case "\u200C": + case "\u200D": + buffer += read(); + return; + case "\\": + read(); + lexState = "identifierNameEscape"; + return; + } + if (util.isIdContinueChar(c)) { + buffer += read(); + return; + } + return newToken("identifier", buffer); + }, + identifierNameEscape() { + if (c !== "u") { + throw invalidChar(read()); + } + read(); + const u = unicodeEscape(); + switch (u) { + case "$": + case "_": + case "\u200C": + case "\u200D": + break; + default: + if (!util.isIdContinueChar(u)) { + throw invalidIdentifier(); + } + break; + } + buffer += u; + lexState = "identifierName"; + }, + sign() { + switch (c) { + case ".": + buffer = read(); + lexState = "decimalPointLeading"; + return; + case "0": + buffer = read(); + lexState = "zero"; + return; + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + buffer = read(); + lexState = "decimalInteger"; + return; + case "I": + read(); + literal("nfinity"); + return newToken("numeric", sign * Infinity); + case "N": + read(); + literal("aN"); + return newToken("numeric", NaN); + } + throw invalidChar(read()); + }, + zero() { + switch (c) { + case ".": + buffer += read(); + lexState = "decimalPoint"; + return; + case "e": + case "E": + buffer += read(); + lexState = "decimalExponent"; + return; + case "x": + case "X": + buffer += read(); + lexState = "hexadecimal"; + return; + } + return newToken("numeric", sign * 0); + }, + decimalInteger() { + switch (c) { + case ".": + buffer += read(); + lexState = "decimalPoint"; + return; + case "e": + case "E": + buffer += read(); + lexState = "decimalExponent"; + return; + } + if (util.isDigit(c)) { + buffer += read(); + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + decimalPointLeading() { + if (util.isDigit(c)) { + buffer += read(); + lexState = "decimalFraction"; + return; + } + throw invalidChar(read()); + }, + decimalPoint() { + switch (c) { + case "e": + case "E": + buffer += read(); + lexState = "decimalExponent"; + return; + } + if (util.isDigit(c)) { + buffer += read(); + lexState = "decimalFraction"; + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + decimalFraction() { + switch (c) { + case "e": + case "E": + buffer += read(); + lexState = "decimalExponent"; + return; + } + if (util.isDigit(c)) { + buffer += read(); + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + decimalExponent() { + switch (c) { + case "+": + case "-": + buffer += read(); + lexState = "decimalExponentSign"; + return; + } + if (util.isDigit(c)) { + buffer += read(); + lexState = "decimalExponentInteger"; + return; + } + throw invalidChar(read()); + }, + decimalExponentSign() { + if (util.isDigit(c)) { + buffer += read(); + lexState = "decimalExponentInteger"; + return; + } + throw invalidChar(read()); + }, + decimalExponentInteger() { + if (util.isDigit(c)) { + buffer += read(); + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + hexadecimal() { + if (util.isHexDigit(c)) { + buffer += read(); + lexState = "hexadecimalInteger"; + return; + } + throw invalidChar(read()); + }, + hexadecimalInteger() { + if (util.isHexDigit(c)) { + buffer += read(); + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + string() { + switch (c) { + case "\\": + read(); + buffer += escape(); + return; + case '"': + if (doubleQuote) { + read(); + return newToken("string", buffer); + } + buffer += read(); + return; + case "'": + if (!doubleQuote) { + read(); + return newToken("string", buffer); + } + buffer += read(); + return; + case "\n": + case "\r": + throw invalidChar(read()); + case "\u2028": + case "\u2029": + separatorChar(c); + break; + case void 0: + throw invalidChar(read()); + } + buffer += read(); + }, + start() { + switch (c) { + case "{": + case "[": + return newToken("punctuator", read()); + } + lexState = "value"; + }, + beforePropertyName() { + switch (c) { + case "$": + case "_": + buffer = read(); + lexState = "identifierName"; + return; + case "\\": + read(); + lexState = "identifierNameStartEscape"; + return; + case "}": + return newToken("punctuator", read()); + case '"': + case "'": + doubleQuote = read() === '"'; + lexState = "string"; + return; + } + if (util.isIdStartChar(c)) { + buffer += read(); + lexState = "identifierName"; + return; + } + throw invalidChar(read()); + }, + afterPropertyName() { + if (c === ":") { + return newToken("punctuator", read()); + } + throw invalidChar(read()); + }, + beforePropertyValue() { + lexState = "value"; + }, + afterPropertyValue() { + switch (c) { + case ",": + case "}": + return newToken("punctuator", read()); + } + throw invalidChar(read()); + }, + beforeArrayValue() { + if (c === "]") { + return newToken("punctuator", read()); + } + lexState = "value"; + }, + afterArrayValue() { + switch (c) { + case ",": + case "]": + return newToken("punctuator", read()); + } + throw invalidChar(read()); + }, + end() { + throw invalidChar(read()); + } +}; +function newToken(type2, value) { + return { + type: type2, + value, + line, + column + }; +} +function literal(s) { + for (const c2 of s) { + const p = peek(); + if (p !== c2) { + throw invalidChar(read()); + } + read(); + } +} +function escape() { + const c2 = peek(); + switch (c2) { + case "b": + read(); + return "\b"; + case "f": + read(); + return "\f"; + case "n": + read(); + return "\n"; + case "r": + read(); + return "\r"; + case "t": + read(); + return " "; + case "v": + read(); + return "\v"; + case "0": + read(); + if (util.isDigit(peek())) { + throw invalidChar(read()); + } + return "\0"; + case "x": + read(); + return hexEscape(); + case "u": + read(); + return unicodeEscape(); + case "\n": + case "\u2028": + case "\u2029": + read(); + return ""; + case "\r": + read(); + if (peek() === "\n") { + read(); + } + return ""; + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + throw invalidChar(read()); + case void 0: + throw invalidChar(read()); + } + return read(); +} +function hexEscape() { + let buffer2 = ""; + let c2 = peek(); + if (!util.isHexDigit(c2)) { + throw invalidChar(read()); + } + buffer2 += read(); + c2 = peek(); + if (!util.isHexDigit(c2)) { + throw invalidChar(read()); + } + buffer2 += read(); + return String.fromCodePoint(parseInt(buffer2, 16)); +} +function unicodeEscape() { + let buffer2 = ""; + let count = 4; + while (count-- > 0) { + const c2 = peek(); + if (!util.isHexDigit(c2)) { + throw invalidChar(read()); + } + buffer2 += read(); + } + return String.fromCodePoint(parseInt(buffer2, 16)); +} +var parseStates = { + start() { + if (token.type === "eof") { + throw invalidEOF(); + } + push(); + }, + beforePropertyName() { + switch (token.type) { + case "identifier": + case "string": + key = token.value; + parseState = "afterPropertyName"; + return; + case "punctuator": + pop(); + return; + case "eof": + throw invalidEOF(); + } + }, + afterPropertyName() { + if (token.type === "eof") { + throw invalidEOF(); + } + parseState = "beforePropertyValue"; + }, + beforePropertyValue() { + if (token.type === "eof") { + throw invalidEOF(); + } + push(); + }, + beforeArrayValue() { + if (token.type === "eof") { + throw invalidEOF(); + } + if (token.type === "punctuator" && token.value === "]") { + pop(); + return; + } + push(); + }, + afterPropertyValue() { + if (token.type === "eof") { + throw invalidEOF(); + } + switch (token.value) { + case ",": + parseState = "beforePropertyName"; + return; + case "}": + pop(); + } + }, + afterArrayValue() { + if (token.type === "eof") { + throw invalidEOF(); + } + switch (token.value) { + case ",": + parseState = "beforeArrayValue"; + return; + case "]": + pop(); + } + }, + end() { + } +}; +function push() { + let value; + switch (token.type) { + case "punctuator": + switch (token.value) { + case "{": + value = {}; + break; + case "[": + value = []; + break; + } + break; + case "null": + case "boolean": + case "numeric": + case "string": + value = token.value; + break; + } + if (root === void 0) { + root = value; + } else { + const parent = stack[stack.length - 1]; + if (Array.isArray(parent)) { + parent.push(value); + } else { + Object.defineProperty(parent, key, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + } + if (value !== null && typeof value === "object") { + stack.push(value); + if (Array.isArray(value)) { + parseState = "beforeArrayValue"; + } else { + parseState = "beforePropertyName"; + } + } else { + const current = stack[stack.length - 1]; + if (current == null) { + parseState = "end"; + } else if (Array.isArray(current)) { + parseState = "afterArrayValue"; + } else { + parseState = "afterPropertyValue"; + } + } +} +function pop() { + stack.pop(); + const current = stack[stack.length - 1]; + if (current == null) { + parseState = "end"; + } else if (Array.isArray(current)) { + parseState = "afterArrayValue"; + } else { + parseState = "afterPropertyValue"; + } +} +function invalidChar(c2) { + if (c2 === void 0) { + return syntaxError(`JSON5: invalid end of input at ${line}:${column}`); + } + return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`); +} +function invalidEOF() { + return syntaxError(`JSON5: invalid end of input at ${line}:${column}`); +} +function invalidIdentifier() { + column -= 5; + return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`); +} +function separatorChar(c2) { + console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`); +} +function formatChar(c2) { + const replacements = { + "'": "\\'", + '"': '\\"', + "\\": "\\\\", + "\b": "\\b", + "\f": "\\f", + "\n": "\\n", + "\r": "\\r", + " ": "\\t", + "\v": "\\v", + "\0": "\\0", + "\u2028": "\\u2028", + "\u2029": "\\u2029" + }; + if (replacements[c2]) { + return replacements[c2]; + } + if (c2 < " ") { + const hexString = c2.charCodeAt(0).toString(16); + return "\\x" + ("00" + hexString).substring(hexString.length); + } + return c2; +} +function syntaxError(message) { + const err = new SyntaxError(message); + err.lineNumber = line; + err.columnNumber = column; + return err; +} +var dist_default = { parse: parse2 }; + +// node_modules/parse-json/index.js +var import_code_frame = __toESM(require_lib2(), 1); + +// node_modules/index-to-position/index.js +var safeLastIndexOf = (string, searchString, index) => index < 0 ? -1 : string.lastIndexOf(searchString, index); +function getPosition(text, textIndex) { + const lineBreakBefore = safeLastIndexOf(text, "\n", textIndex - 1); + const column2 = textIndex - lineBreakBefore - 1; + let line3 = 0; + for (let index = lineBreakBefore; index >= 0; index = safeLastIndexOf(text, "\n", index - 1)) { + line3++; + } + return { line: line3, column: column2 }; +} +function indexToLineColumn(text, textIndex, { oneBased = false } = {}) { + if (textIndex < 0 || textIndex >= text.length && text.length > 0) { + throw new RangeError("Index out of bounds"); + } + const position = getPosition(text, textIndex); + return oneBased ? { line: position.line + 1, column: position.column + 1 } : position; +} + +// node_modules/parse-json/index.js +var getCodePoint = (character) => `\\u{${character.codePointAt(0).toString(16)}}`; +var _message; +var _JSONError = class _JSONError extends Error { + constructor(message) { + var _a; + super(); + __publicField(this, "name", "JSONError"); + __publicField(this, "fileName"); + __publicField(this, "codeFrame"); + __publicField(this, "rawCodeFrame"); + __privateAdd(this, _message); + __privateSet(this, _message, message); + (_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, this, _JSONError); + } + get message() { + const { fileName, codeFrame } = this; + return `${__privateGet(this, _message)}${fileName ? ` in ${fileName}` : ""}${codeFrame ? ` + +${codeFrame} +` : ""}`; + } + set message(message) { + __privateSet(this, _message, message); + } +}; +_message = new WeakMap(); +var JSONError = _JSONError; +var generateCodeFrame = (string, location, highlightCode = true) => (0, import_code_frame.codeFrameColumns)(string, { start: location }, { highlightCode }); +var getErrorLocation = (string, message) => { + const match = message.match(/in JSON at position (?\d+)(?: \(line (?\d+) column (?\d+)\))?$/); + if (!match) { + return; + } + let { index, line: line3, column: column2 } = match.groups; + if (line3 && column2) { + return { line: Number(line3), column: Number(column2) }; + } + index = Number(index); + if (index === string.length) { + const { line: line4, column: column3 } = indexToLineColumn(string, string.length - 1, { oneBased: true }); + return { line: line4, column: column3 + 1 }; + } + return indexToLineColumn(string, index, { oneBased: true }); +}; +var addCodePointToUnexpectedToken = (message) => message.replace( + // TODO[engine:node@>=20]: The token always quoted after Node.js 20 + /(?<=^Unexpected token )(?')?(.)\k/, + (_, _quote, token2) => `"${token2}"(${getCodePoint(token2)})` +); +function parseJson(string, reviver, fileName) { + if (typeof reviver === "string") { + fileName = reviver; + reviver = void 0; + } + let message; + try { + return JSON.parse(string, reviver); + } catch (error) { + message = error.message; + } + let location; + if (string) { + location = getErrorLocation(string, message); + message = addCodePointToUnexpectedToken(message); + } else { + message += " while parsing empty string"; + } + const jsonError = new JSONError(message); + jsonError.fileName = fileName; + if (location) { + jsonError.codeFrame = generateCodeFrame(string, location); + jsonError.rawCodeFrame = generateCodeFrame( + string, + location, + /* highlightCode */ + false + ); + } + throw jsonError; +} + +// node_modules/smol-toml/dist/error.js +function getLineColFromPtr(string, ptr) { + let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g); + return [lines.length, lines.pop().length + 1]; +} +function makeCodeBlock(string, line3, column2) { + let lines = string.split(/\r\n|\n|\r/g); + let codeblock = ""; + let numberLen = (Math.log10(line3 + 1) | 0) + 1; + for (let i = line3 - 1; i <= line3 + 1; i++) { + let l = lines[i - 1]; + if (!l) + continue; + codeblock += i.toString().padEnd(numberLen, " "); + codeblock += ": "; + codeblock += l; + codeblock += "\n"; + if (i === line3) { + codeblock += " ".repeat(numberLen + column2 + 2); + codeblock += "^\n"; + } + } + return codeblock; +} +var TomlError = class extends Error { + line; + column; + codeblock; + constructor(message, options8) { + const [line3, column2] = getLineColFromPtr(options8.toml, options8.ptr); + const codeblock = makeCodeBlock(options8.toml, line3, column2); + super(`Invalid TOML document: ${message} + +${codeblock}`, options8); + this.line = line3; + this.column = column2; + this.codeblock = codeblock; + } +}; + +// node_modules/smol-toml/dist/util.js +function indexOfNewline(str2, start = 0, end = str2.length) { + let idx = str2.indexOf("\n", start); + if (str2[idx - 1] === "\r") + idx--; + return idx <= end ? idx : -1; +} +function skipComment(str2, ptr) { + for (let i = ptr; i < str2.length; i++) { + let c2 = str2[i]; + if (c2 === "\n") + return i; + if (c2 === "\r" && str2[i + 1] === "\n") + return i + 1; + if (c2 < " " && c2 !== " " || c2 === "\x7F") { + throw new TomlError("control characters are not allowed in comments", { + toml: str2, + ptr + }); + } + } + return str2.length; +} +function skipVoid(str2, ptr, banNewLines, banComments) { + let c2; + while ((c2 = str2[ptr]) === " " || c2 === " " || !banNewLines && (c2 === "\n" || c2 === "\r" && str2[ptr + 1] === "\n")) + ptr++; + return banComments || c2 !== "#" ? ptr : skipVoid(str2, skipComment(str2, ptr), banNewLines); +} +function skipUntil(str2, ptr, sep, end, banNewLines = false) { + if (!end) { + ptr = indexOfNewline(str2, ptr); + return ptr < 0 ? str2.length : ptr; + } + for (let i = ptr; i < str2.length; i++) { + let c2 = str2[i]; + if (c2 === "#") { + i = indexOfNewline(str2, i); + } else if (c2 === sep) { + return i + 1; + } else if (c2 === end) { + return i; + } else if (banNewLines && (c2 === "\n" || c2 === "\r" && str2[i + 1] === "\n")) { + return i; + } + } + throw new TomlError("cannot find end of structure", { + toml: str2, + ptr + }); +} +function getStringEnd(str2, seek) { + let first = str2[seek]; + let target = first === str2[seek + 1] && str2[seek + 1] === str2[seek + 2] ? str2.slice(seek, seek + 3) : first; + seek += target.length - 1; + do + seek = str2.indexOf(target, ++seek); + while (seek > -1 && first !== "'" && str2[seek - 1] === "\\" && str2[seek - 2] !== "\\"); + if (seek > -1) { + seek += target.length; + if (target.length > 1) { + if (str2[seek] === first) + seek++; + if (str2[seek] === first) + seek++; + } + } + return seek; +} + +// node_modules/smol-toml/dist/date.js +var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i; +var _hasDate, _hasTime, _offset; +var _TomlDate = class _TomlDate extends Date { + constructor(date) { + let hasDate = true; + let hasTime = true; + let offset = "Z"; + if (typeof date === "string") { + let match = date.match(DATE_TIME_RE); + if (match) { + if (!match[1]) { + hasDate = false; + date = `0000-01-01T${date}`; + } + hasTime = !!match[2]; + if (match[2] && +match[2] > 23) { + date = ""; + } else { + offset = match[3] || null; + date = date.toUpperCase(); + if (!offset && hasTime) + date += "Z"; + } + } else { + date = ""; + } + } + super(date); + __privateAdd(this, _hasDate, false); + __privateAdd(this, _hasTime, false); + __privateAdd(this, _offset, null); + if (!isNaN(this.getTime())) { + __privateSet(this, _hasDate, hasDate); + __privateSet(this, _hasTime, hasTime); + __privateSet(this, _offset, offset); + } + } + isDateTime() { + return __privateGet(this, _hasDate) && __privateGet(this, _hasTime); + } + isLocal() { + return !__privateGet(this, _hasDate) || !__privateGet(this, _hasTime) || !__privateGet(this, _offset); + } + isDate() { + return __privateGet(this, _hasDate) && !__privateGet(this, _hasTime); + } + isTime() { + return __privateGet(this, _hasTime) && !__privateGet(this, _hasDate); + } + isValid() { + return __privateGet(this, _hasDate) || __privateGet(this, _hasTime); + } + toISOString() { + let iso = super.toISOString(); + if (this.isDate()) + return iso.slice(0, 10); + if (this.isTime()) + return iso.slice(11, 23); + if (__privateGet(this, _offset) === null) + return iso.slice(0, -1); + if (__privateGet(this, _offset) === "Z") + return iso; + let offset = +__privateGet(this, _offset).slice(1, 3) * 60 + +__privateGet(this, _offset).slice(4, 6); + offset = __privateGet(this, _offset)[0] === "-" ? offset : -offset; + let offsetDate = new Date(this.getTime() - offset * 6e4); + return offsetDate.toISOString().slice(0, -1) + __privateGet(this, _offset); + } + static wrapAsOffsetDateTime(jsDate, offset = "Z") { + let date = new _TomlDate(jsDate); + __privateSet(date, _offset, offset); + return date; + } + static wrapAsLocalDateTime(jsDate) { + let date = new _TomlDate(jsDate); + __privateSet(date, _offset, null); + return date; + } + static wrapAsLocalDate(jsDate) { + let date = new _TomlDate(jsDate); + __privateSet(date, _hasTime, false); + __privateSet(date, _offset, null); + return date; + } + static wrapAsLocalTime(jsDate) { + let date = new _TomlDate(jsDate); + __privateSet(date, _hasDate, false); + __privateSet(date, _offset, null); + return date; + } +}; +_hasDate = new WeakMap(); +_hasTime = new WeakMap(); +_offset = new WeakMap(); +var TomlDate = _TomlDate; + +// node_modules/smol-toml/dist/primitive.js +var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; +var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; +var LEADING_ZERO = /^[+-]?0[0-9_]/; +var ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i; +var ESC_MAP = { + b: "\b", + t: " ", + n: "\n", + f: "\f", + r: "\r", + '"': '"', + "\\": "\\" +}; +function parseString(str2, ptr = 0, endPtr = str2.length) { + let isLiteral = str2[ptr] === "'"; + let isMultiline = str2[ptr++] === str2[ptr] && str2[ptr] === str2[ptr + 1]; + if (isMultiline) { + endPtr -= 2; + if (str2[ptr += 2] === "\r") + ptr++; + if (str2[ptr] === "\n") + ptr++; + } + let tmp = 0; + let isEscape; + let parsed = ""; + let sliceStart = ptr; + while (ptr < endPtr - 1) { + let c2 = str2[ptr++]; + if (c2 === "\n" || c2 === "\r" && str2[ptr] === "\n") { + if (!isMultiline) { + throw new TomlError("newlines are not allowed in strings", { + toml: str2, + ptr: ptr - 1 + }); + } + } else if (c2 < " " && c2 !== " " || c2 === "\x7F") { + throw new TomlError("control characters are not allowed in strings", { + toml: str2, + ptr: ptr - 1 + }); + } + if (isEscape) { + isEscape = false; + if (c2 === "u" || c2 === "U") { + let code = str2.slice(ptr, ptr += c2 === "u" ? 4 : 8); + if (!ESCAPE_REGEX.test(code)) { + throw new TomlError("invalid unicode escape", { + toml: str2, + ptr: tmp + }); + } + try { + parsed += String.fromCodePoint(parseInt(code, 16)); + } catch { + throw new TomlError("invalid unicode escape", { + toml: str2, + ptr: tmp + }); + } + } else if (isMultiline && (c2 === "\n" || c2 === " " || c2 === " " || c2 === "\r")) { + ptr = skipVoid(str2, ptr - 1, true); + if (str2[ptr] !== "\n" && str2[ptr] !== "\r") { + throw new TomlError("invalid escape: only line-ending whitespace may be escaped", { + toml: str2, + ptr: tmp + }); + } + ptr = skipVoid(str2, ptr); + } else if (c2 in ESC_MAP) { + parsed += ESC_MAP[c2]; + } else { + throw new TomlError("unrecognized escape sequence", { + toml: str2, + ptr: tmp + }); + } + sliceStart = ptr; + } else if (!isLiteral && c2 === "\\") { + tmp = ptr - 1; + isEscape = true; + parsed += str2.slice(sliceStart, tmp); + } + } + return parsed + str2.slice(sliceStart, endPtr - 1); +} +function parseValue(value, toml, ptr) { + if (value === "true") + return true; + if (value === "false") + return false; + if (value === "-inf") + return -Infinity; + if (value === "inf" || value === "+inf") + return Infinity; + if (value === "nan" || value === "+nan" || value === "-nan") + return NaN; + if (value === "-0") + return 0; + let isInt2; + if ((isInt2 = INT_REGEX.test(value)) || FLOAT_REGEX.test(value)) { + if (LEADING_ZERO.test(value)) { + throw new TomlError("leading zeroes are not allowed", { + toml, + ptr + }); + } + let numeric = +value.replace(/_/g, ""); + if (isNaN(numeric)) { + throw new TomlError("invalid number", { + toml, + ptr + }); + } + if (isInt2 && !Number.isSafeInteger(numeric)) { + throw new TomlError("integer value cannot be represented losslessly", { + toml, + ptr + }); + } + return numeric; + } + let date = new TomlDate(value); + if (!date.isValid()) { + throw new TomlError("invalid value", { + toml, + ptr + }); + } + return date; +} + +// node_modules/smol-toml/dist/extract.js +function sliceAndTrimEndOf(str2, startPtr, endPtr, allowNewLines) { + let value = str2.slice(startPtr, endPtr); + let commentIdx = value.indexOf("#"); + if (commentIdx > -1) { + skipComment(str2, commentIdx); + value = value.slice(0, commentIdx); + } + let trimmed = value.trimEnd(); + if (!allowNewLines) { + let newlineIdx = value.indexOf("\n", trimmed.length); + if (newlineIdx > -1) { + throw new TomlError("newlines are not allowed in inline tables", { + toml: str2, + ptr: startPtr + newlineIdx + }); + } + } + return [trimmed, commentIdx]; +} +function extractValue(str2, ptr, end, depth) { + if (depth === 0) { + throw new TomlError("document contains excessively nested structures. aborting.", { + toml: str2, + ptr + }); + } + let c2 = str2[ptr]; + if (c2 === "[" || c2 === "{") { + let [value, endPtr2] = c2 === "[" ? parseArray(str2, ptr, depth) : parseInlineTable(str2, ptr, depth); + let newPtr = skipUntil(str2, endPtr2, ",", end); + if (end === "}") { + let nextNewLine = indexOfNewline(str2, endPtr2, newPtr); + if (nextNewLine > -1) { + throw new TomlError("newlines are not allowed in inline tables", { + toml: str2, + ptr: nextNewLine + }); + } + } + return [value, newPtr]; + } + let endPtr; + if (c2 === '"' || c2 === "'") { + endPtr = getStringEnd(str2, ptr); + let parsed = parseString(str2, ptr, endPtr); + if (end) { + endPtr = skipVoid(str2, endPtr, end !== "]"); + if (str2[endPtr] && str2[endPtr] !== "," && str2[endPtr] !== end && str2[endPtr] !== "\n" && str2[endPtr] !== "\r") { + throw new TomlError("unexpected character encountered", { + toml: str2, + ptr: endPtr + }); + } + endPtr += +(str2[endPtr] === ","); + } + return [parsed, endPtr]; + } + endPtr = skipUntil(str2, ptr, ",", end); + let slice = sliceAndTrimEndOf(str2, ptr, endPtr - +(str2[endPtr - 1] === ","), end === "]"); + if (!slice[0]) { + throw new TomlError("incomplete key-value declaration: no value specified", { + toml: str2, + ptr + }); + } + if (end && slice[1] > -1) { + endPtr = skipVoid(str2, ptr + slice[1]); + endPtr += +(str2[endPtr] === ","); + } + return [ + parseValue(slice[0], str2, ptr), + endPtr + ]; +} + +// node_modules/smol-toml/dist/struct.js +var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; +function parseKey(str2, ptr, end = "=") { + let dot = ptr - 1; + let parsed = []; + let endPtr = str2.indexOf(end, ptr); + if (endPtr < 0) { + throw new TomlError("incomplete key-value: cannot find end of key", { + toml: str2, + ptr + }); + } + do { + let c2 = str2[ptr = ++dot]; + if (c2 !== " " && c2 !== " ") { + if (c2 === '"' || c2 === "'") { + if (c2 === str2[ptr + 1] && c2 === str2[ptr + 2]) { + throw new TomlError("multiline strings are not allowed in keys", { + toml: str2, + ptr + }); + } + let eos = getStringEnd(str2, ptr); + if (eos < 0) { + throw new TomlError("unfinished string encountered", { + toml: str2, + ptr + }); + } + dot = str2.indexOf(".", eos); + let strEnd = str2.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot); + let newLine = indexOfNewline(strEnd); + if (newLine > -1) { + throw new TomlError("newlines are not allowed in keys", { + toml: str2, + ptr: ptr + dot + newLine + }); + } + if (strEnd.trimStart()) { + throw new TomlError("found extra tokens after the string part", { + toml: str2, + ptr: eos + }); + } + if (endPtr < eos) { + endPtr = str2.indexOf(end, eos); + if (endPtr < 0) { + throw new TomlError("incomplete key-value: cannot find end of key", { + toml: str2, + ptr + }); + } + } + parsed.push(parseString(str2, ptr, eos)); + } else { + dot = str2.indexOf(".", ptr); + let part = str2.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot); + if (!KEY_PART_RE.test(part)) { + throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", { + toml: str2, + ptr + }); + } + parsed.push(part.trimEnd()); + } + } + } while (dot + 1 && dot < endPtr); + return [parsed, skipVoid(str2, endPtr + 1, true, true)]; +} +function parseInlineTable(str2, ptr, depth) { + let res = {}; + let seen = /* @__PURE__ */ new Set(); + let c2; + let comma = 0; + ptr++; + while ((c2 = str2[ptr++]) !== "}" && c2) { + if (c2 === "\n") { + throw new TomlError("newlines are not allowed in inline tables", { + toml: str2, + ptr: ptr - 1 + }); + } else if (c2 === "#") { + throw new TomlError("inline tables cannot contain comments", { + toml: str2, + ptr: ptr - 1 + }); + } else if (c2 === ",") { + throw new TomlError("expected key-value, found comma", { + toml: str2, + ptr: ptr - 1 + }); + } else if (c2 !== " " && c2 !== " ") { + let k; + let t = res; + let hasOwn = false; + let [key2, keyEndPtr] = parseKey(str2, ptr - 1); + for (let i = 0; i < key2.length; i++) { + if (i) + t = hasOwn ? t[k] : t[k] = {}; + k = key2[i]; + if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) { + throw new TomlError("trying to redefine an already defined value", { + toml: str2, + ptr + }); + } + if (!hasOwn && k === "__proto__") { + Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); + } + } + if (hasOwn) { + throw new TomlError("trying to redefine an already defined value", { + toml: str2, + ptr + }); + } + let [value, valueEndPtr] = extractValue(str2, keyEndPtr, "}", depth - 1); + seen.add(value); + t[k] = value; + ptr = valueEndPtr; + comma = str2[ptr - 1] === "," ? ptr - 1 : 0; + } + } + if (comma) { + throw new TomlError("trailing commas are not allowed in inline tables", { + toml: str2, + ptr: comma + }); + } + if (!c2) { + throw new TomlError("unfinished table encountered", { + toml: str2, + ptr + }); + } + return [res, ptr]; +} +function parseArray(str2, ptr, depth) { + let res = []; + let c2; + ptr++; + while ((c2 = str2[ptr++]) !== "]" && c2) { + if (c2 === ",") { + throw new TomlError("expected value, found comma", { + toml: str2, + ptr: ptr - 1 + }); + } else if (c2 === "#") + ptr = skipComment(str2, ptr); + else if (c2 !== " " && c2 !== " " && c2 !== "\n" && c2 !== "\r") { + let e = extractValue(str2, ptr - 1, "]", depth - 1); + res.push(e[0]); + ptr = e[1]; + } + } + if (!c2) { + throw new TomlError("unfinished array encountered", { + toml: str2, + ptr + }); + } + return [res, ptr]; +} + +// node_modules/smol-toml/dist/parse.js +function peekTable(key2, table, meta, type2) { + var _a, _b; + let t = table; + let m = meta; + let k; + let hasOwn = false; + let state; + for (let i = 0; i < key2.length; i++) { + if (i) { + t = hasOwn ? t[k] : t[k] = {}; + m = (state = m[k]).c; + if (type2 === 0 && (state.t === 1 || state.t === 2)) { + return null; + } + if (state.t === 2) { + let l = t.length - 1; + t = t[l]; + m = m[l].c; + } + } + k = key2[i]; + if ((hasOwn = Object.hasOwn(t, k)) && ((_a = m[k]) == null ? void 0 : _a.t) === 0 && ((_b = m[k]) == null ? void 0 : _b.d)) { + return null; + } + if (!hasOwn) { + if (k === "__proto__") { + Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); + Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true }); + } + m[k] = { + t: i < key2.length - 1 && type2 === 2 ? 3 : type2, + d: false, + i: 0, + c: {} + }; + } + } + state = m[k]; + if (state.t !== type2 && !(type2 === 1 && state.t === 3)) { + return null; + } + if (type2 === 2) { + if (!state.d) { + state.d = true; + t[k] = []; + } + t[k].push(t = {}); + state.c[state.i++] = state = { t: 1, d: false, i: 0, c: {} }; + } + if (state.d) { + return null; + } + state.d = true; + if (type2 === 1) { + t = hasOwn ? t[k] : t[k] = {}; + } else if (type2 === 0 && hasOwn) { + return null; + } + return [k, t, state.c]; +} +function parse4(toml, opts) { + let maxDepth = (opts == null ? void 0 : opts.maxDepth) ?? 1e3; + let res = {}; + let meta = {}; + let tbl = res; + let m = meta; + for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) { + if (toml[ptr] === "[") { + let isTableArray = toml[++ptr] === "["; + let k = parseKey(toml, ptr += +isTableArray, "]"); + if (isTableArray) { + if (toml[k[1] - 1] !== "]") { + throw new TomlError("expected end of table declaration", { + toml, + ptr: k[1] - 1 + }); + } + k[1]++; + } + let p = peekTable( + k[0], + res, + meta, + isTableArray ? 2 : 1 + /* Type.EXPLICIT */ + ); + if (!p) { + throw new TomlError("trying to redefine an already defined table or value", { + toml, + ptr + }); + } + m = p[2]; + tbl = p[1]; + ptr = k[1]; + } else { + let k = parseKey(toml, ptr); + let p = peekTable( + k[0], + tbl, + m, + 0 + /* Type.DOTTED */ + ); + if (!p) { + throw new TomlError("trying to redefine an already defined table or value", { + toml, + ptr + }); + } + let v = extractValue(toml, k[1], void 0, maxDepth); + p[1][p[0]] = v[0]; + ptr = v[1]; + } + ptr = skipVoid(toml, ptr, true); + if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") { + throw new TomlError("each key-value declaration must be followed by an end-of-line", { + toml, + ptr + }); + } + ptr = skipVoid(toml, ptr); + } + return res; +} + +// src/utils/read-file.js +import fs4 from "fs/promises"; +async function readFile(file) { + if (isUrlString(file)) { + file = new URL(file); + } + try { + return await fs4.readFile(file, "utf8"); + } catch (error) { + if (error.code === "ENOENT") { + return; + } + throw new Error(`Unable to read '${file}': ${error.message}`); + } +} +var read_file_default = readFile; + +// src/config/prettier-config/loaders.js +async function readJson(file) { + const content = await read_file_default(file); + try { + return parseJson(content); + } catch (error) { + error.message = `JSON Error in ${file}: +${error.message}`; + throw error; + } +} +async function importModuleDefault(file) { + const module = await import(pathToFileURL2(file).href); + return module.default; +} +async function readPackageJson(file) { + try { + return await readJson(file); + } catch (error) { + if (process.versions.bun) { + try { + return await importModuleDefault(file); + } catch { + } + } + throw error; + } +} +async function loadConfigFromPackageJson(file) { + const { prettier } = await readPackageJson(file); + return prettier; +} +async function loadConfigFromPackageYaml(file) { + const { prettier } = await loadYaml(file); + return prettier; +} +async function loadYaml(file) { + const content = await read_file_default(file); + try { + return load(content); + } catch (error) { + error.message = `YAML Error in ${file}: +${error.message}`; + throw error; + } +} +var loaders = { + async ".toml"(file) { + const content = await read_file_default(file); + try { + return parse4(content); + } catch (error) { + error.message = `TOML Error in ${file}: +${error.message}`; + throw error; + } + }, + async ".json5"(file) { + const content = await read_file_default(file); + try { + return dist_default.parse(content); + } catch (error) { + error.message = `JSON5 Error in ${file}: +${error.message}`; + throw error; + } + }, + ".json": readJson, + ".js": importModuleDefault, + ".mjs": importModuleDefault, + ".cjs": importModuleDefault, + ".ts": importModuleDefault, + ".mts": importModuleDefault, + ".cts": importModuleDefault, + ".yaml": loadYaml, + ".yml": loadYaml, + // No extension + "": loadYaml +}; +var loaders_default = loaders; + +// src/config/prettier-config/config-searcher.js +var CONFIG_FILE_NAMES = [ + "package.json", + "package.yaml", + ".prettierrc", + ".prettierrc.json", + ".prettierrc.yaml", + ".prettierrc.yml", + ".prettierrc.json5", + ".prettierrc.js", + ".prettierrc.ts", + ".prettierrc.mjs", + ".prettierrc.mts", + ".prettierrc.cjs", + ".prettierrc.cts", + "prettier.config.js", + "prettier.config.ts", + "prettier.config.mjs", + "prettier.config.mts", + "prettier.config.cjs", + "prettier.config.cts", + ".prettierrc.toml" +]; +async function filter({ name, path: file }) { + if (!await is_file_default(file)) { + return false; + } + if (name === "package.json") { + try { + return Boolean(await loadConfigFromPackageJson(file)); + } catch { + return false; + } + } + if (name === "package.yaml") { + try { + return Boolean(await loadConfigFromPackageYaml(file)); + } catch { + return false; + } + } + return true; +} +function getSearcher(stopDirectory) { + return new searcher_default({ names: CONFIG_FILE_NAMES, filter, stopDirectory }); +} +var config_searcher_default = getSearcher; + +// src/config/prettier-config/load-config.js +import path7 from "path"; + +// src/utils/import-from-file.js +import { pathToFileURL as pathToFileURL4 } from "url"; + +// node_modules/import-meta-resolve/lib/resolve.js +import assert3 from "assert"; +import { statSync, realpathSync } from "fs"; +import process3 from "process"; +import { URL as URL2, fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL3 } from "url"; +import path6 from "path"; +import { builtinModules } from "module"; + +// node_modules/import-meta-resolve/lib/get-format.js +import { fileURLToPath as fileURLToPath3 } from "url"; + +// node_modules/import-meta-resolve/lib/package-json-reader.js +import fs5 from "fs"; +import path5 from "path"; +import { fileURLToPath as fileURLToPath2 } from "url"; + +// node_modules/import-meta-resolve/lib/errors.js +import v8 from "v8"; +import assert2 from "assert"; +import { format, inspect } from "util"; +var own = {}.hasOwnProperty; +var classRegExp = /^([A-Z][a-z\d]*)+$/; +var kTypes = /* @__PURE__ */ new Set([ + "string", + "function", + "number", + "object", + // Accept 'Function' and 'Object' as alternative to the lower cased version. + "Function", + "Object", + "boolean", + "bigint", + "symbol" +]); +var codes = {}; +function formatList(array2, type2 = "and") { + return array2.length < 3 ? array2.join(` ${type2} `) : `${array2.slice(0, -1).join(", ")}, ${type2} ${array2[array2.length - 1]}`; +} +var messages = /* @__PURE__ */ new Map(); +var nodeInternalPrefix = "__node_internal_"; +var userStackTraceLimit; +codes.ERR_INVALID_ARG_TYPE = createError( + "ERR_INVALID_ARG_TYPE", + /** + * @param {string} name + * @param {Array | string} expected + * @param {unknown} actual + */ + (name, expected, actual) => { + assert2(typeof name === "string", "'name' must be a string"); + if (!Array.isArray(expected)) { + expected = [expected]; + } + let message = "The "; + if (name.endsWith(" argument")) { + message += `${name} `; + } else { + const type2 = name.includes(".") ? "property" : "argument"; + message += `"${name}" ${type2} `; + } + message += "must be "; + const types = []; + const instances = []; + const other = []; + for (const value of expected) { + assert2( + typeof value === "string", + "All expected entries have to be of type string" + ); + if (kTypes.has(value)) { + types.push(value.toLowerCase()); + } else if (classRegExp.exec(value) === null) { + assert2( + value !== "object", + 'The value "object" should be written as "Object"' + ); + other.push(value); + } else { + instances.push(value); + } + } + if (instances.length > 0) { + const pos2 = types.indexOf("object"); + if (pos2 !== -1) { + types.slice(pos2, 1); + instances.push("Object"); + } + } + if (types.length > 0) { + message += `${types.length > 1 ? "one of type" : "of type"} ${formatList( + types, + "or" + )}`; + if (instances.length > 0 || other.length > 0) message += " or "; + } + if (instances.length > 0) { + message += `an instance of ${formatList(instances, "or")}`; + if (other.length > 0) message += " or "; + } + if (other.length > 0) { + if (other.length > 1) { + message += `one of ${formatList(other, "or")}`; + } else { + if (other[0].toLowerCase() !== other[0]) message += "an "; + message += `${other[0]}`; + } + } + message += `. Received ${determineSpecificType(actual)}`; + return message; + }, + TypeError +); +codes.ERR_INVALID_MODULE_SPECIFIER = createError( + "ERR_INVALID_MODULE_SPECIFIER", + /** + * @param {string} request + * @param {string} reason + * @param {string} [base] + */ + (request, reason, base = void 0) => { + return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`; + }, + TypeError +); +codes.ERR_INVALID_PACKAGE_CONFIG = createError( + "ERR_INVALID_PACKAGE_CONFIG", + /** + * @param {string} path + * @param {string} [base] + * @param {string} [message] + */ + (path13, base, message) => { + return `Invalid package config ${path13}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`; + }, + Error +); +codes.ERR_INVALID_PACKAGE_TARGET = createError( + "ERR_INVALID_PACKAGE_TARGET", + /** + * @param {string} packagePath + * @param {string} key + * @param {unknown} target + * @param {boolean} [isImport=false] + * @param {string} [base] + */ + (packagePath, key2, target, isImport = false, base = void 0) => { + const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./"); + if (key2 === ".") { + assert2(isImport === false); + return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`; + } + return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify( + target + )} defined for '${key2}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`; + }, + Error +); +codes.ERR_MODULE_NOT_FOUND = createError( + "ERR_MODULE_NOT_FOUND", + /** + * @param {string} path + * @param {string} base + * @param {boolean} [exactUrl] + */ + (path13, base, exactUrl = false) => { + return `Cannot find ${exactUrl ? "module" : "package"} '${path13}' imported from ${base}`; + }, + Error +); +codes.ERR_NETWORK_IMPORT_DISALLOWED = createError( + "ERR_NETWORK_IMPORT_DISALLOWED", + "import of '%s' by %s is not supported: %s", + Error +); +codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError( + "ERR_PACKAGE_IMPORT_NOT_DEFINED", + /** + * @param {string} specifier + * @param {string} packagePath + * @param {string} base + */ + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`; + }, + TypeError +); +codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError( + "ERR_PACKAGE_PATH_NOT_EXPORTED", + /** + * @param {string} packagePath + * @param {string} subpath + * @param {string} [base] + */ + (packagePath, subpath, base = void 0) => { + if (subpath === ".") + return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`; + return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`; + }, + Error +); +codes.ERR_UNSUPPORTED_DIR_IMPORT = createError( + "ERR_UNSUPPORTED_DIR_IMPORT", + "Directory import '%s' is not supported resolving ES modules imported from %s", + Error +); +codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError( + "ERR_UNSUPPORTED_RESOLVE_REQUEST", + 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', + TypeError +); +codes.ERR_UNKNOWN_FILE_EXTENSION = createError( + "ERR_UNKNOWN_FILE_EXTENSION", + /** + * @param {string} extension + * @param {string} path + */ + (extension, path13) => { + return `Unknown file extension "${extension}" for ${path13}`; + }, + TypeError +); +codes.ERR_INVALID_ARG_VALUE = createError( + "ERR_INVALID_ARG_VALUE", + /** + * @param {string} name + * @param {unknown} value + * @param {string} [reason='is invalid'] + */ + (name, value, reason = "is invalid") => { + let inspected = inspect(value); + if (inspected.length > 128) { + inspected = `${inspected.slice(0, 128)}...`; + } + const type2 = name.includes(".") ? "property" : "argument"; + return `The ${type2} '${name}' ${reason}. Received ${inspected}`; + }, + TypeError + // Note: extra classes have been shaken out. + // , RangeError +); +function createError(sym, value, constructor) { + messages.set(sym, value); + return makeNodeErrorWithCode(constructor, sym); +} +function makeNodeErrorWithCode(Base, key2) { + return NodeError; + function NodeError(...parameters) { + const limit = Error.stackTraceLimit; + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0; + const error = new Base(); + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit; + const message = getMessage(key2, parameters, error); + Object.defineProperties(error, { + // Note: no need to implement `kIsNodeError` symbol, would be hard, + // probably. + message: { + value: message, + enumerable: false, + writable: true, + configurable: true + }, + toString: { + /** @this {Error} */ + value() { + return `${this.name} [${key2}]: ${this.message}`; + }, + enumerable: false, + writable: true, + configurable: true + } + }); + captureLargerStackTrace(error); + error.code = key2; + return error; + } +} +function isErrorStackTraceLimitWritable() { + try { + if (v8.startupSnapshot.isBuildingSnapshot()) { + return false; + } + } catch { + } + const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit"); + if (desc === void 0) { + return Object.isExtensible(Error); + } + return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0; +} +function hideStackFrames(wrappedFunction) { + const hidden = nodeInternalPrefix + wrappedFunction.name; + Object.defineProperty(wrappedFunction, "name", { value: hidden }); + return wrappedFunction; +} +var captureLargerStackTrace = hideStackFrames( + /** + * @param {Error} error + * @returns {Error} + */ + // @ts-expect-error: fine + function(error) { + const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); + if (stackTraceLimitIsWritable) { + userStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Number.POSITIVE_INFINITY; + } + Error.captureStackTrace(error); + if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit; + return error; + } +); +function getMessage(key2, parameters, self) { + const message = messages.get(key2); + assert2(message !== void 0, "expected `message` to be found"); + if (typeof message === "function") { + assert2( + message.length <= parameters.length, + // Default options do not count. + `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).` + ); + return Reflect.apply(message, self, parameters); + } + const regex = /%[dfijoOs]/g; + let expectedLength = 0; + while (regex.exec(message) !== null) expectedLength++; + assert2( + expectedLength === parameters.length, + `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).` + ); + if (parameters.length === 0) return message; + parameters.unshift(message); + return Reflect.apply(format, null, parameters); +} +function determineSpecificType(value) { + if (value === null || value === void 0) { + return String(value); + } + if (typeof value === "function" && value.name) { + return `function ${value.name}`; + } + if (typeof value === "object") { + if (value.constructor && value.constructor.name) { + return `an instance of ${value.constructor.name}`; + } + return `${inspect(value, { depth: -1 })}`; + } + let inspected = inspect(value, { colors: false }); + if (inspected.length > 28) { + inspected = `${inspected.slice(0, 25)}...`; + } + return `type ${typeof value} (${inspected})`; +} + +// node_modules/import-meta-resolve/lib/package-json-reader.js +var hasOwnProperty = {}.hasOwnProperty; +var { ERR_INVALID_PACKAGE_CONFIG } = codes; +var cache = /* @__PURE__ */ new Map(); +function read2(jsonPath, { base, specifier }) { + const existing = cache.get(jsonPath); + if (existing) { + return existing; + } + let string; + try { + string = fs5.readFileSync(path5.toNamespacedPath(jsonPath), "utf8"); + } catch (error) { + const exception2 = ( + /** @type {ErrnoException} */ + error + ); + if (exception2.code !== "ENOENT") { + throw exception2; + } + } + const result = { + exists: false, + pjsonPath: jsonPath, + main: void 0, + name: void 0, + type: "none", + // Ignore unknown types for forwards compatibility + exports: void 0, + imports: void 0 + }; + if (string !== void 0) { + let parsed; + try { + parsed = JSON.parse(string); + } catch (error_) { + const cause = ( + /** @type {ErrnoException} */ + error_ + ); + const error = new ERR_INVALID_PACKAGE_CONFIG( + jsonPath, + (base ? `"${specifier}" from ` : "") + fileURLToPath2(base || specifier), + cause.message + ); + error.cause = cause; + throw error; + } + result.exists = true; + if (hasOwnProperty.call(parsed, "name") && typeof parsed.name === "string") { + result.name = parsed.name; + } + if (hasOwnProperty.call(parsed, "main") && typeof parsed.main === "string") { + result.main = parsed.main; + } + if (hasOwnProperty.call(parsed, "exports")) { + result.exports = parsed.exports; + } + if (hasOwnProperty.call(parsed, "imports")) { + result.imports = parsed.imports; + } + if (hasOwnProperty.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module")) { + result.type = parsed.type; + } + } + cache.set(jsonPath, result); + return result; +} +function getPackageScopeConfig(resolved) { + let packageJSONUrl = new URL("package.json", resolved); + while (true) { + const packageJSONPath2 = packageJSONUrl.pathname; + if (packageJSONPath2.endsWith("node_modules/package.json")) { + break; + } + const packageConfig = read2(fileURLToPath2(packageJSONUrl), { + specifier: resolved + }); + if (packageConfig.exists) { + return packageConfig; + } + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new URL("../package.json", packageJSONUrl); + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { + break; + } + } + const packageJSONPath = fileURLToPath2(packageJSONUrl); + return { + pjsonPath: packageJSONPath, + exists: false, + type: "none" + }; +} +function getPackageType(url2) { + return getPackageScopeConfig(url2).type; +} + +// node_modules/import-meta-resolve/lib/get-format.js +var { ERR_UNKNOWN_FILE_EXTENSION } = codes; +var hasOwnProperty2 = {}.hasOwnProperty; +var extensionFormatMap = { + // @ts-expect-error: hush. + __proto__: null, + ".cjs": "commonjs", + ".js": "module", + ".json": "json", + ".mjs": "module" +}; +function mimeToFormat(mime) { + if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) + return "module"; + if (mime === "application/json") return "json"; + return null; +} +var protocolHandlers = { + // @ts-expect-error: hush. + __proto__: null, + "data:": getDataProtocolModuleFormat, + "file:": getFileProtocolModuleFormat, + "http:": getHttpProtocolModuleFormat, + "https:": getHttpProtocolModuleFormat, + "node:"() { + return "builtin"; + } +}; +function getDataProtocolModuleFormat(parsed) { + const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec( + parsed.pathname + ) || [null, null, null]; + return mimeToFormat(mime); +} +function extname(url2) { + const pathname = url2.pathname; + let index = pathname.length; + while (index--) { + const code = pathname.codePointAt(index); + if (code === 47) { + return ""; + } + if (code === 46) { + return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index); + } + } + return ""; +} +function getFileProtocolModuleFormat(url2, _context, ignoreErrors) { + const value = extname(url2); + if (value === ".js") { + const packageType = getPackageType(url2); + if (packageType !== "none") { + return packageType; + } + return "commonjs"; + } + if (value === "") { + const packageType = getPackageType(url2); + if (packageType === "none" || packageType === "commonjs") { + return "commonjs"; + } + return "module"; + } + const format3 = extensionFormatMap[value]; + if (format3) return format3; + if (ignoreErrors) { + return void 0; + } + const filepath = fileURLToPath3(url2); + throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath); +} +function getHttpProtocolModuleFormat() { +} +function defaultGetFormatWithoutErrors(url2, context) { + const protocol = url2.protocol; + if (!hasOwnProperty2.call(protocolHandlers, protocol)) { + return null; + } + return protocolHandlers[protocol](url2, context, true) || null; +} + +// node_modules/import-meta-resolve/lib/utils.js +var { ERR_INVALID_ARG_VALUE } = codes; +var DEFAULT_CONDITIONS = Object.freeze(["node", "import"]); +var DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS); +function getDefaultConditions() { + return DEFAULT_CONDITIONS; +} +function getDefaultConditionsSet() { + return DEFAULT_CONDITIONS_SET; +} +function getConditionsSet(conditions) { + if (conditions !== void 0 && conditions !== getDefaultConditions()) { + if (!Array.isArray(conditions)) { + throw new ERR_INVALID_ARG_VALUE( + "conditions", + conditions, + "expected an array" + ); + } + return new Set(conditions); + } + return getDefaultConditionsSet(); +} + +// node_modules/import-meta-resolve/lib/resolve.js +var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]; +var { + ERR_NETWORK_IMPORT_DISALLOWED, + ERR_INVALID_MODULE_SPECIFIER, + ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2, + ERR_INVALID_PACKAGE_TARGET, + ERR_MODULE_NOT_FOUND, + ERR_PACKAGE_IMPORT_NOT_DEFINED, + ERR_PACKAGE_PATH_NOT_EXPORTED, + ERR_UNSUPPORTED_DIR_IMPORT, + ERR_UNSUPPORTED_RESOLVE_REQUEST +} = codes; +var own2 = {}.hasOwnProperty; +var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; +var deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; +var invalidPackageNameRegEx = /^\.|%|\\/; +var patternRegEx = /\*/g; +var encodedSeparatorRegEx = /%2f|%5c/i; +var emittedPackageWarnings = /* @__PURE__ */ new Set(); +var doubleSlashRegEx = /[/\\]{2}/; +function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) { + if (process3.noDeprecation) { + return; + } + const pjsonPath = fileURLToPath4(packageJsonUrl); + const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null; + process3.emitWarning( + `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath4(base)}` : ""}.`, + "DeprecationWarning", + "DEP0166" + ); +} +function emitLegacyIndexDeprecation(url2, packageJsonUrl, base, main) { + if (process3.noDeprecation) { + return; + } + const format3 = defaultGetFormatWithoutErrors(url2, { parentURL: base.href }); + if (format3 !== "module") return; + const urlPath = fileURLToPath4(url2.href); + const packagePath = fileURLToPath4(new URL2(".", packageJsonUrl)); + const basePath = fileURLToPath4(base); + if (!main) { + process3.emitWarning( + `No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice( + packagePath.length + )}", imported from ${basePath}. +Default "index" lookups for the main are deprecated for ES modules.`, + "DeprecationWarning", + "DEP0151" + ); + } else if (path6.resolve(packagePath, main) !== urlPath) { + process3.emitWarning( + `Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice( + packagePath.length + )}", imported from ${basePath}. + Automatic extension resolution of the "main" field is deprecated for ES modules.`, + "DeprecationWarning", + "DEP0151" + ); + } +} +function tryStatSync(path13) { + try { + return statSync(path13); + } catch { + } +} +function fileExists(url2) { + const stats = statSync(url2, { throwIfNoEntry: false }); + const isFile2 = stats ? stats.isFile() : void 0; + return isFile2 === null || isFile2 === void 0 ? false : isFile2; +} +function legacyMainResolve(packageJsonUrl, packageConfig, base) { + let guess; + if (packageConfig.main !== void 0) { + guess = new URL2(packageConfig.main, packageJsonUrl); + if (fileExists(guess)) return guess; + const tries2 = [ + `./${packageConfig.main}.js`, + `./${packageConfig.main}.json`, + `./${packageConfig.main}.node`, + `./${packageConfig.main}/index.js`, + `./${packageConfig.main}/index.json`, + `./${packageConfig.main}/index.node` + ]; + let i2 = -1; + while (++i2 < tries2.length) { + guess = new URL2(tries2[i2], packageJsonUrl); + if (fileExists(guess)) break; + guess = void 0; + } + if (guess) { + emitLegacyIndexDeprecation( + guess, + packageJsonUrl, + base, + packageConfig.main + ); + return guess; + } + } + const tries = ["./index.js", "./index.json", "./index.node"]; + let i = -1; + while (++i < tries.length) { + guess = new URL2(tries[i], packageJsonUrl); + if (fileExists(guess)) break; + guess = void 0; + } + if (guess) { + emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main); + return guess; + } + throw new ERR_MODULE_NOT_FOUND( + fileURLToPath4(new URL2(".", packageJsonUrl)), + fileURLToPath4(base) + ); +} +function finalizeResolution(resolved, base, preserveSymlinks) { + if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) { + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved.pathname, + 'must not include encoded "/" or "\\" characters', + fileURLToPath4(base) + ); + } + let filePath; + try { + filePath = fileURLToPath4(resolved); + } catch (error) { + const cause = ( + /** @type {ErrnoException} */ + error + ); + Object.defineProperty(cause, "input", { value: String(resolved) }); + Object.defineProperty(cause, "module", { value: String(base) }); + throw cause; + } + const stats = tryStatSync( + filePath.endsWith("/") ? filePath.slice(-1) : filePath + ); + if (stats && stats.isDirectory()) { + const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath4(base)); + error.url = String(resolved); + throw error; + } + if (!stats || !stats.isFile()) { + const error = new ERR_MODULE_NOT_FOUND( + filePath || resolved.pathname, + base && fileURLToPath4(base), + true + ); + error.url = String(resolved); + throw error; + } + if (!preserveSymlinks) { + const real = realpathSync(filePath); + const { search, hash } = resolved; + resolved = pathToFileURL3(real + (filePath.endsWith(path6.sep) ? "/" : "")); + resolved.search = search; + resolved.hash = hash; + } + return resolved; +} +function importNotDefined(specifier, packageJsonUrl, base) { + return new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJsonUrl && fileURLToPath4(new URL2(".", packageJsonUrl)), + fileURLToPath4(base) + ); +} +function exportsNotFound(subpath, packageJsonUrl, base) { + return new ERR_PACKAGE_PATH_NOT_EXPORTED( + fileURLToPath4(new URL2(".", packageJsonUrl)), + subpath, + base && fileURLToPath4(base) + ); +} +function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) { + const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath4(packageJsonUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER( + request, + reason, + base && fileURLToPath4(base) + ); +} +function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) { + target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`; + return new ERR_INVALID_PACKAGE_TARGET( + fileURLToPath4(new URL2(".", packageJsonUrl)), + subpath, + target, + internal, + base && fileURLToPath4(base) + ); +} +function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) { + if (subpath !== "" && !pattern && target[target.length - 1] !== "/") + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + if (!target.startsWith("./")) { + if (internal && !target.startsWith("../") && !target.startsWith("/")) { + let isURL2 = false; + try { + new URL2(target); + isURL2 = true; + } catch { + } + if (!isURL2) { + const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target + subpath; + return packageResolve(exportTarget, packageJsonUrl, conditions); + } + } + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + } + if (invalidSegmentRegEx.exec(target.slice(2)) !== null) { + if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) { + if (!isPathMap) { + const request = pattern ? match.replace("*", () => subpath) : match + subpath; + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target; + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match, + packageJsonUrl, + internal, + base, + true + ); + } + } else { + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + } + } + const resolved = new URL2(target, packageJsonUrl); + const resolvedPath = resolved.pathname; + const packagePath = new URL2(".", packageJsonUrl).pathname; + if (!resolvedPath.startsWith(packagePath)) + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + if (subpath === "") return resolved; + if (invalidSegmentRegEx.exec(subpath) !== null) { + const request = pattern ? match.replace("*", () => subpath) : match + subpath; + if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) { + if (!isPathMap) { + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target; + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match, + packageJsonUrl, + internal, + base, + false + ); + } + } else { + throwInvalidSubpath(request, match, packageJsonUrl, internal, base); + } + } + if (pattern) { + return new URL2( + RegExpPrototypeSymbolReplace.call( + patternRegEx, + resolved.href, + () => subpath + ) + ); + } + return new URL2(subpath, resolved); +} +function isArrayIndex(key2) { + const keyNumber = Number(key2); + if (`${keyNumber}` !== key2) return false; + return keyNumber >= 0 && keyNumber < 4294967295; +} +function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) { + if (typeof target === "string") { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJsonUrl, + base, + pattern, + internal, + isPathMap, + conditions + ); + } + if (Array.isArray(target)) { + const targetList = target; + if (targetList.length === 0) return null; + let lastException; + let i = -1; + while (++i < targetList.length) { + const targetItem = targetList[i]; + let resolveResult; + try { + resolveResult = resolvePackageTarget( + packageJsonUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ); + } catch (error) { + const exception2 = ( + /** @type {ErrnoException} */ + error + ); + lastException = exception2; + if (exception2.code === "ERR_INVALID_PACKAGE_TARGET") continue; + throw error; + } + if (resolveResult === void 0) continue; + if (resolveResult === null) { + lastException = null; + continue; + } + return resolveResult; + } + if (lastException === void 0 || lastException === null) { + return null; + } + throw lastException; + } + if (typeof target === "object" && target !== null) { + const keys = Object.getOwnPropertyNames(target); + let i = -1; + while (++i < keys.length) { + const key2 = keys[i]; + if (isArrayIndex(key2)) { + throw new ERR_INVALID_PACKAGE_CONFIG2( + fileURLToPath4(packageJsonUrl), + base, + '"exports" cannot contain numeric property keys.' + ); + } + } + i = -1; + while (++i < keys.length) { + const key2 = keys[i]; + if (key2 === "default" || conditions && conditions.has(key2)) { + const conditionalTarget = ( + /** @type {unknown} */ + target[key2] + ); + const resolveResult = resolvePackageTarget( + packageJsonUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ); + if (resolveResult === void 0) continue; + return resolveResult; + } + } + return null; + } + if (target === null) { + return null; + } + throw invalidPackageTarget( + packageSubpath, + target, + packageJsonUrl, + internal, + base + ); +} +function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { + if (typeof exports === "string" || Array.isArray(exports)) return true; + if (typeof exports !== "object" || exports === null) return false; + const keys = Object.getOwnPropertyNames(exports); + let isConditionalSugar = false; + let i = 0; + let keyIndex = -1; + while (++keyIndex < keys.length) { + const key2 = keys[keyIndex]; + const currentIsConditionalSugar = key2 === "" || key2[0] !== "."; + if (i++ === 0) { + isConditionalSugar = currentIsConditionalSugar; + } else if (isConditionalSugar !== currentIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG2( + fileURLToPath4(packageJsonUrl), + base, + `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` + ); + } + } + return isConditionalSugar; +} +function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { + if (process3.noDeprecation) { + return; + } + const pjsonPath = fileURLToPath4(pjsonUrl); + if (emittedPackageWarnings.has(pjsonPath + "|" + match)) return; + emittedPackageWarnings.add(pjsonPath + "|" + match); + process3.emitWarning( + `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath4(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, + "DeprecationWarning", + "DEP0155" + ); +} +function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) { + let exports = packageConfig.exports; + if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) { + exports = { ".": exports }; + } + if (own2.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) { + const target = exports[packageSubpath]; + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + "", + packageSubpath, + base, + false, + false, + false, + conditions + ); + if (resolveResult === null || resolveResult === void 0) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); + } + return resolveResult; + } + let bestMatch = ""; + let bestMatchSubpath = ""; + const keys = Object.getOwnPropertyNames(exports); + let i = -1; + while (++i < keys.length) { + const key2 = keys[i]; + const patternIndex = key2.indexOf("*"); + if (patternIndex !== -1 && packageSubpath.startsWith(key2.slice(0, patternIndex))) { + if (packageSubpath.endsWith("/")) { + emitTrailingSlashPatternDeprecation( + packageSubpath, + packageJsonUrl, + base + ); + } + const patternTrailer = key2.slice(patternIndex + 1); + if (packageSubpath.length >= key2.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key2) === 1 && key2.lastIndexOf("*") === patternIndex) { + bestMatch = key2; + bestMatchSubpath = packageSubpath.slice( + patternIndex, + packageSubpath.length - patternTrailer.length + ); + } + } + } + if (bestMatch) { + const target = ( + /** @type {unknown} */ + exports[bestMatch] + ); + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + false, + packageSubpath.endsWith("/"), + conditions + ); + if (resolveResult === null || resolveResult === void 0) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); + } + return resolveResult; + } + throw exportsNotFound(packageSubpath, packageJsonUrl, base); +} +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf("*"); + const bPatternIndex = b.indexOf("*"); + const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + if (baseLengthA > baseLengthB) return -1; + if (baseLengthB > baseLengthA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; + return 0; +} +function packageImportsResolve(name, base, conditions) { + if (name === "#" || name.startsWith("#/") || name.endsWith("/")) { + const reason = "is not a valid internal imports specifier name"; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath4(base)); + } + let packageJsonUrl; + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + packageJsonUrl = pathToFileURL3(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (own2.call(imports, name) && !name.includes("*")) { + const resolveResult = resolvePackageTarget( + packageJsonUrl, + imports[name], + "", + name, + base, + false, + true, + false, + conditions + ); + if (resolveResult !== null && resolveResult !== void 0) { + return resolveResult; + } + } else { + let bestMatch = ""; + let bestMatchSubpath = ""; + const keys = Object.getOwnPropertyNames(imports); + let i = -1; + while (++i < keys.length) { + const key2 = keys[i]; + const patternIndex = key2.indexOf("*"); + if (patternIndex !== -1 && name.startsWith(key2.slice(0, -1))) { + const patternTrailer = key2.slice(patternIndex + 1); + if (name.length >= key2.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key2) === 1 && key2.lastIndexOf("*") === patternIndex) { + bestMatch = key2; + bestMatchSubpath = name.slice( + patternIndex, + name.length - patternTrailer.length + ); + } + } + } + if (bestMatch) { + const target = imports[bestMatch]; + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + true, + false, + conditions + ); + if (resolveResult !== null && resolveResult !== void 0) { + return resolveResult; + } + } + } + } + } + throw importNotDefined(name, packageJsonUrl, base); +} +function parsePackageName(specifier, base) { + let separatorIndex = specifier.indexOf("/"); + let validPackageName = true; + let isScoped = false; + if (specifier[0] === "@") { + isScoped = true; + if (separatorIndex === -1 || specifier.length === 0) { + validPackageName = false; + } else { + separatorIndex = specifier.indexOf("/", separatorIndex + 1); + } + } + const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex); + if (invalidPackageNameRegEx.exec(packageName) !== null) { + validPackageName = false; + } + if (!validPackageName) { + throw new ERR_INVALID_MODULE_SPECIFIER( + specifier, + "is not a valid package name", + fileURLToPath4(base) + ); + } + const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)); + return { packageName, packageSubpath, isScoped }; +} +function packageResolve(specifier, base, conditions) { + if (builtinModules.includes(specifier)) { + return new URL2("node:" + specifier); + } + const { packageName, packageSubpath, isScoped } = parsePackageName( + specifier, + base + ); + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + const packageJsonUrl2 = pathToFileURL3(packageConfig.pjsonPath); + if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) { + return packageExportsResolve( + packageJsonUrl2, + packageSubpath, + packageConfig, + base, + conditions + ); + } + } + let packageJsonUrl = new URL2( + "./node_modules/" + packageName + "/package.json", + base + ); + let packageJsonPath = fileURLToPath4(packageJsonUrl); + let lastPath; + do { + const stat = tryStatSync(packageJsonPath.slice(0, -13)); + if (!stat || !stat.isDirectory()) { + lastPath = packageJsonPath; + packageJsonUrl = new URL2( + (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", + packageJsonUrl + ); + packageJsonPath = fileURLToPath4(packageJsonUrl); + continue; + } + const packageConfig2 = read2(packageJsonPath, { base, specifier }); + if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) { + return packageExportsResolve( + packageJsonUrl, + packageSubpath, + packageConfig2, + base, + conditions + ); + } + if (packageSubpath === ".") { + return legacyMainResolve(packageJsonUrl, packageConfig2, base); + } + return new URL2(packageSubpath, packageJsonUrl); + } while (packageJsonPath.length !== lastPath.length); + throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath4(base), false); +} +function isRelativeSpecifier(specifier) { + if (specifier[0] === ".") { + if (specifier.length === 1 || specifier[1] === "/") return true; + if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) { + return true; + } + } + return false; +} +function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { + if (specifier === "") return false; + if (specifier[0] === "/") return true; + return isRelativeSpecifier(specifier); +} +function moduleResolve(specifier, base, conditions, preserveSymlinks) { + const protocol = base.protocol; + const isData = protocol === "data:"; + const isRemote = isData || protocol === "http:" || protocol === "https:"; + let resolved; + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + try { + resolved = new URL2(specifier, base); + } catch (error_) { + const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base); + error.cause = error_; + throw error; + } + } else if (protocol === "file:" && specifier[0] === "#") { + resolved = packageImportsResolve(specifier, base, conditions); + } else { + try { + resolved = new URL2(specifier); + } catch (error_) { + if (isRemote && !builtinModules.includes(specifier)) { + const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base); + error.cause = error_; + throw error; + } + resolved = packageResolve(specifier, base, conditions); + } + } + assert3(resolved !== void 0, "expected to be defined"); + if (resolved.protocol !== "file:") { + return resolved; + } + return finalizeResolution(resolved, base, preserveSymlinks); +} +function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { + if (parsedParentURL) { + const parentProtocol = parsedParentURL.protocol; + if (parentProtocol === "http:" || parentProtocol === "https:") { + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + const parsedProtocol = parsed == null ? void 0 : parsed.protocol; + if (parsedProtocol && parsedProtocol !== "https:" && parsedProtocol !== "http:") { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "remote imports cannot import from a local location." + ); + } + return { url: (parsed == null ? void 0 : parsed.href) || "" }; + } + if (builtinModules.includes(specifier)) { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "remote imports cannot import from a local location." + ); + } + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "only relative and absolute specifiers are supported." + ); + } + } +} +function isURL(self) { + return Boolean( + self && typeof self === "object" && "href" in self && typeof self.href === "string" && "protocol" in self && typeof self.protocol === "string" && self.href && self.protocol + ); +} +function throwIfInvalidParentURL(parentURL) { + if (parentURL === void 0) { + return; + } + if (typeof parentURL !== "string" && !isURL(parentURL)) { + throw new codes.ERR_INVALID_ARG_TYPE( + "parentURL", + ["string", "URL"], + parentURL + ); + } +} +function defaultResolve(specifier, context = {}) { + const { parentURL } = context; + assert3(parentURL !== void 0, "expected `parentURL` to be defined"); + throwIfInvalidParentURL(parentURL); + let parsedParentURL; + if (parentURL) { + try { + parsedParentURL = new URL2(parentURL); + } catch { + } + } + let parsed; + let protocol; + try { + parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new URL2(specifier, parsedParentURL) : new URL2(specifier); + protocol = parsed.protocol; + if (protocol === "data:") { + return { url: parsed.href, format: null }; + } + } catch { + } + const maybeReturn = checkIfDisallowedImport( + specifier, + parsed, + parsedParentURL + ); + if (maybeReturn) return maybeReturn; + if (protocol === void 0 && parsed) { + protocol = parsed.protocol; + } + if (protocol === "node:") { + return { url: specifier }; + } + if (parsed && parsed.protocol === "node:") return { url: specifier }; + const conditions = getConditionsSet(context.conditions); + const url2 = moduleResolve(specifier, new URL2(parentURL), conditions, false); + return { + // Do NOT cast `url` to a string: that will work even when there are real + // problems, silencing them + url: url2.href, + format: defaultGetFormatWithoutErrors(url2, { parentURL }) + }; +} + +// node_modules/import-meta-resolve/index.js +function resolve2(specifier, parent) { + if (!parent) { + throw new Error( + "Please pass `parent`: `import-meta-resolve` cannot ponyfill that" + ); + } + try { + return defaultResolve(specifier, { parentURL: parent }).url; + } catch (error) { + const exception2 = ( + /** @type {ErrnoException} */ + error + ); + if ((exception2.code === "ERR_UNSUPPORTED_DIR_IMPORT" || exception2.code === "ERR_MODULE_NOT_FOUND") && typeof exception2.url === "string") { + return exception2.url; + } + throw error; + } +} + +// src/utils/import-from-file.js +function importFromFile(specifier, parent) { + const url2 = resolve2(specifier, pathToFileURL4(parent).href); + return import(url2); +} +var import_from_file_default = importFromFile; + +// src/utils/require-from-file.js +import { createRequire } from "module"; +function requireFromFile(id, parent) { + const require2 = createRequire(parent); + return require2(id); +} +var require_from_file_default = requireFromFile; + +// src/config/prettier-config/load-external-config.js +var requireErrorCodesShouldBeIgnored = /* @__PURE__ */ new Set([ + "MODULE_NOT_FOUND", + "ERR_REQUIRE_ESM", + "ERR_PACKAGE_PATH_NOT_EXPORTED", + "ERR_REQUIRE_ASYNC_MODULE" +]); +async function loadExternalConfig(externalConfig, configFile) { + try { + const required = require_from_file_default(externalConfig, configFile); + if (process.features.require_module && required.__esModule) { + return required.default; + } + return required; + } catch (error) { + if (!requireErrorCodesShouldBeIgnored.has(error == null ? void 0 : error.code)) { + throw error; + } + } + const module = await import_from_file_default(externalConfig, configFile); + return module.default; +} +var load_external_config_default = loadExternalConfig; + +// src/config/prettier-config/load-config.js +async function loadConfig(configFile) { + const { base: fileName, ext: extension } = path7.parse(configFile); + const load2 = fileName === "package.json" ? loadConfigFromPackageJson : fileName === "package.yaml" ? loadConfigFromPackageYaml : loaders_default[extension]; + if (!load2) { + throw new Error( + `No loader specified for extension "${extension || "noExt"}"` + ); + } + let config = await load2(configFile); + if (!config) { + return; + } + if (typeof config === "string") { + config = await load_external_config_default(config, configFile); + } + if (typeof config !== "object") { + throw new TypeError( + `Config is only allowed to be an object, but received ${typeof config} in "${configFile}"` + ); + } + delete config.$schema; + return config; +} +var load_config_default = loadConfig; + +// src/config/prettier-config/index.js +var loadCache = /* @__PURE__ */ new Map(); +var searchCache = /* @__PURE__ */ new Map(); +function clearPrettierConfigCache() { + loadCache.clear(); + searchCache.clear(); +} +function loadPrettierConfig(configFile, { shouldCache }) { + configFile = path8.resolve(configFile); + if (!shouldCache || !loadCache.has(configFile)) { + loadCache.set(configFile, load_config_default(configFile)); + } + return loadCache.get(configFile); +} +function getSearchFunction(stopDirectory) { + stopDirectory = stopDirectory ? path8.resolve(stopDirectory) : void 0; + if (!searchCache.has(stopDirectory)) { + const searcher2 = config_searcher_default(stopDirectory); + const searchFunction = searcher2.search.bind(searcher2); + searchCache.set(stopDirectory, searchFunction); + } + return searchCache.get(stopDirectory); +} +function searchPrettierConfig(startDirectory, options8 = {}) { + startDirectory = startDirectory ? path8.resolve(startDirectory) : process.cwd(); + const stopDirectory = mockable_default.getPrettierConfigSearchStopDirectory(); + const search = getSearchFunction(stopDirectory); + return search(startDirectory, { shouldCache: options8.shouldCache }); +} + +// src/config/resolve-config.js +function clearCache() { + clearPrettierConfigCache(); + clearEditorconfigCache(); +} +function loadEditorconfig2(file, options8) { + if (!file || !options8.editorconfig) { + return; + } + const shouldCache = options8.useCache; + return loadEditorconfig(file, { shouldCache }); +} +async function loadPrettierConfig2(file, options8) { + const shouldCache = options8.useCache; + let configFile = options8.config; + if (!configFile) { + const directory = file ? path9.dirname(path9.resolve(file)) : void 0; + configFile = await searchPrettierConfig(directory, { shouldCache }); + } + if (!configFile) { + return; + } + const config = await loadPrettierConfig(configFile, { shouldCache }); + return { config, configFile }; +} +async function resolveConfig(fileUrlOrPath, options8) { + options8 = { useCache: true, ...options8 }; + const filePath = toPath(fileUrlOrPath); + const [result, editorConfigured] = await Promise.all([ + loadPrettierConfig2(filePath, options8), + loadEditorconfig2(filePath, options8) + ]); + if (!result && !editorConfigured) { + return null; + } + const merged = { + ...editorConfigured, + ...mergeOverrides(result, filePath) + }; + if (Array.isArray(merged.plugins)) { + merged.plugins = merged.plugins.map( + (value) => typeof value === "string" && value.startsWith(".") ? path9.resolve(path9.dirname(result.configFile), value) : value + ); + } + return merged; +} +async function resolveConfigFile(fileUrlOrPath) { + const directory = fileUrlOrPath ? path9.dirname(path9.resolve(toPath(fileUrlOrPath))) : void 0; + const result = await searchPrettierConfig(directory, { shouldCache: false }); + return result ?? null; +} +function mergeOverrides(configResult, filePath) { + const { config, configFile } = configResult || {}; + const { overrides, ...options8 } = config || {}; + if (filePath && overrides) { + const relativeFilePath = path9.relative(path9.dirname(configFile), filePath); + for (const override of overrides) { + if (pathMatchesGlobs( + relativeFilePath, + override.files, + override.excludeFiles + )) { + Object.assign(options8, override.options); + } + } + } + return options8; +} +function pathMatchesGlobs(filePath, patterns, excludedPatterns) { + const patternList = Array.isArray(patterns) ? patterns : [patterns]; + const [withSlashes, withoutSlashes] = partition_default( + patternList, + (pattern) => pattern.includes("/") + ); + return import_micromatch.default.isMatch(filePath, withoutSlashes, { + ignore: excludedPatterns, + basename: true, + dot: true + }) || import_micromatch.default.isMatch(filePath, withSlashes, { + ignore: excludedPatterns, + basename: false, + dot: true + }); +} + +// scripts/build/shims/string-replace-all.js +var stringReplaceAll2 = (isOptionalObject, original, pattern, replacement) => { + if (isOptionalObject && (original === void 0 || original === null)) { + return; + } + if (original.replaceAll) { + return original.replaceAll(pattern, replacement); + } + if (pattern.global) { + return original.replace(pattern, replacement); + } + return original.split(pattern).join(replacement); +}; +var string_replace_all_default = stringReplaceAll2; + +// src/utils/ignore.js +var import_ignore = __toESM(require_ignore(), 1); +import path10 from "path"; +import url from "url"; +var slash = path10.sep === "\\" ? (filePath) => string_replace_all_default( + /* isOptionalObject */ + false, + filePath, + "\\", + "/" +) : (filePath) => filePath; +function getRelativePath(file, ignoreFile) { + const ignoreFilePath = toPath(ignoreFile); + const filePath = isUrl(file) ? url.fileURLToPath(file) : path10.resolve(file); + return path10.relative( + // If there's an ignore-path set, the filename must be relative to the + // ignore path, not the current working directory. + ignoreFilePath ? path10.dirname(ignoreFilePath) : process.cwd(), + filePath + ); +} +async function createSingleIsIgnoredFunction(ignoreFile, withNodeModules) { + let content = ""; + if (ignoreFile) { + content += await read_file_default(ignoreFile) ?? ""; + } + if (!withNodeModules) { + content += "\nnode_modules"; + } + if (!content) { + return; + } + const ignore = (0, import_ignore.default)({ allowRelativePaths: true }).add(content); + return (file) => ignore.checkIgnore(slash(getRelativePath(file, ignoreFile))).ignored; +} +async function createIsIgnoredFunction(ignoreFiles, withNodeModules) { + if (ignoreFiles.length === 0 && !withNodeModules) { + ignoreFiles = [void 0]; + } + const isIgnoredFunctions = (await Promise.all( + ignoreFiles.map( + (ignoreFile) => createSingleIsIgnoredFunction(ignoreFile, withNodeModules) + ) + )).filter(Boolean); + return (file) => isIgnoredFunctions.some((isIgnored2) => isIgnored2(file)); +} +async function isIgnored(file, options8) { + const { ignorePath: ignoreFiles, withNodeModules } = options8; + const isIgnored2 = await createIsIgnoredFunction(ignoreFiles, withNodeModules); + return isIgnored2(file); +} + +// src/utils/get-interpreter.js +var import_n_readlines = __toESM(require_readlines(), 1); +import fs6 from "fs"; +function getInterpreter(file) { + let fd; + try { + fd = fs6.openSync(file, "r"); + } catch { + return; + } + try { + const liner = new import_n_readlines.default(fd); + const firstLine = liner.next().toString("utf8"); + const m1 = firstLine.match(/^#!\/(?:usr\/)?bin\/env\s+(\S+)/u); + if (m1) { + return m1[1]; + } + const m2 = firstLine.match(/^#!\/(?:usr\/(?:local\/)?)?bin\/(\S+)/u); + if (m2) { + return m2[1]; + } + } finally { + try { + fs6.closeSync(fd); + } catch { + } + } +} +var get_interpreter_default = getInterpreter; + +// src/utils/infer-parser.js +var getFileBasename = (file) => String(file).split(/[/\\]/u).pop(); +function getLanguageByFileName(languages2, file) { + if (!file) { + return; + } + const basename = getFileBasename(file).toLowerCase(); + return languages2.find( + ({ filenames }) => filenames == null ? void 0 : filenames.some((name) => name.toLowerCase() === basename) + ) ?? languages2.find( + ({ extensions }) => extensions == null ? void 0 : extensions.some((extension) => basename.endsWith(extension)) + ); +} +function getLanguageByLanguageName(languages2, languageName) { + if (!languageName) { + return; + } + return languages2.find(({ name }) => name.toLowerCase() === languageName) ?? languages2.find(({ aliases }) => aliases == null ? void 0 : aliases.includes(languageName)) ?? languages2.find(({ extensions }) => extensions == null ? void 0 : extensions.includes(`.${languageName}`)); +} +function getLanguageByInterpreter(languages2, file) { + if (!file || getFileBasename(file).includes(".")) { + return; + } + const interpreter = get_interpreter_default(file); + if (!interpreter) { + return; + } + return languages2.find( + ({ interpreters }) => interpreters == null ? void 0 : interpreters.includes(interpreter) + ); +} +function inferParser(options8, fileInfo) { + const languages2 = options8.plugins.flatMap( + (plugin) => ( + // @ts-expect-error -- Safe + plugin.languages ?? [] + ) + ); + const language = getLanguageByLanguageName(languages2, fileInfo.language) ?? getLanguageByFileName(languages2, fileInfo.physicalFile) ?? getLanguageByFileName(languages2, fileInfo.file) ?? getLanguageByInterpreter(languages2, fileInfo.physicalFile); + return language == null ? void 0 : language.parsers[0]; +} +var infer_parser_default = inferParser; + +// src/common/get-file-info.js +async function getFileInfo(file, options8) { + if (typeof file !== "string" && !(file instanceof URL)) { + throw new TypeError( + `expect \`file\` to be a string or URL, got \`${typeof file}\`` + ); + } + let { ignorePath, withNodeModules } = options8; + if (!Array.isArray(ignorePath)) { + ignorePath = [ignorePath]; + } + const ignored = await isIgnored(file, { ignorePath, withNodeModules }); + let inferredParser; + if (!ignored) { + inferredParser = await getParser(file, options8); + } + return { + ignored, + inferredParser: inferredParser ?? null + }; +} +async function getParser(file, options8) { + let config; + if (options8.resolveConfig !== false) { + config = await resolveConfig(file); + } + return (config == null ? void 0 : config.parser) ?? infer_parser_default(options8, { physicalFile: file }); +} +var get_file_info_default = getFileInfo; + +// src/common/end-of-line.js +function guessEndOfLine(text) { + const index = text.indexOf("\r"); + if (index !== -1) { + return text.charAt(index + 1) === "\n" ? "crlf" : "cr"; + } + return "lf"; +} +function convertEndOfLineToChars(value) { + switch (value) { + case "cr": + return "\r"; + case "crlf": + return "\r\n"; + default: + return "\n"; + } +} +function countEndOfLineChars(text, eol) { + let regex; + switch (eol) { + case "\n": + regex = /\n/gu; + break; + case "\r": + regex = /\r/gu; + break; + case "\r\n": + regex = /\r\n/gu; + break; + default: + throw new Error(`Unexpected "eol" ${JSON.stringify(eol)}.`); + } + const endOfLines = text.match(regex); + return endOfLines ? endOfLines.length : 0; +} +function normalizeEndOfLine(text) { + return string_replace_all_default( + /* isOptionalObject */ + false, + text, + /\r\n?/gu, + "\n" + ); +} + +// src/document/constants.js +var DOC_TYPE_STRING = "string"; +var DOC_TYPE_ARRAY = "array"; +var DOC_TYPE_CURSOR = "cursor"; +var DOC_TYPE_INDENT = "indent"; +var DOC_TYPE_ALIGN = "align"; +var DOC_TYPE_TRIM = "trim"; +var DOC_TYPE_GROUP = "group"; +var DOC_TYPE_FILL = "fill"; +var DOC_TYPE_IF_BREAK = "if-break"; +var DOC_TYPE_INDENT_IF_BREAK = "indent-if-break"; +var DOC_TYPE_LINE_SUFFIX = "line-suffix"; +var DOC_TYPE_LINE_SUFFIX_BOUNDARY = "line-suffix-boundary"; +var DOC_TYPE_LINE = "line"; +var DOC_TYPE_LABEL = "label"; +var DOC_TYPE_BREAK_PARENT = "break-parent"; +var VALID_OBJECT_DOC_TYPES = /* @__PURE__ */ new Set([ + DOC_TYPE_CURSOR, + DOC_TYPE_INDENT, + DOC_TYPE_ALIGN, + DOC_TYPE_TRIM, + DOC_TYPE_GROUP, + DOC_TYPE_FILL, + DOC_TYPE_IF_BREAK, + DOC_TYPE_INDENT_IF_BREAK, + DOC_TYPE_LINE_SUFFIX, + DOC_TYPE_LINE_SUFFIX_BOUNDARY, + DOC_TYPE_LINE, + DOC_TYPE_LABEL, + DOC_TYPE_BREAK_PARENT +]); + +// scripts/build/shims/at.js +var at = (isOptionalObject, object, index) => { + if (isOptionalObject && (object === void 0 || object === null)) { + return; + } + if (Array.isArray(object) || typeof object === "string") { + return object[index < 0 ? object.length + index : index]; + } + return object.at(index); +}; +var at_default = at; + +// src/document/utils/get-doc-type.js +function getDocType(doc2) { + if (typeof doc2 === "string") { + return DOC_TYPE_STRING; + } + if (Array.isArray(doc2)) { + return DOC_TYPE_ARRAY; + } + if (!doc2) { + return; + } + const { type: type2 } = doc2; + if (VALID_OBJECT_DOC_TYPES.has(type2)) { + return type2; + } +} +var get_doc_type_default = getDocType; + +// src/document/invalid-doc-error.js +var disjunctionListFormat = (list) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(list); +function getDocErrorMessage(doc2) { + const type2 = doc2 === null ? "null" : typeof doc2; + if (type2 !== "string" && type2 !== "object") { + return `Unexpected doc '${type2}', +Expected it to be 'string' or 'object'.`; + } + if (get_doc_type_default(doc2)) { + throw new Error("doc is valid."); + } + const objectType = Object.prototype.toString.call(doc2); + if (objectType !== "[object Object]") { + return `Unexpected doc '${objectType}'.`; + } + const EXPECTED_TYPE_VALUES = disjunctionListFormat( + [...VALID_OBJECT_DOC_TYPES].map((type3) => `'${type3}'`) + ); + return `Unexpected doc.type '${doc2.type}'. +Expected it to be ${EXPECTED_TYPE_VALUES}.`; +} +var InvalidDocError = class extends Error { + name = "InvalidDocError"; + constructor(doc2) { + super(getDocErrorMessage(doc2)); + this.doc = doc2; + } +}; +var invalid_doc_error_default = InvalidDocError; + +// src/document/utils/traverse-doc.js +var traverseDocOnExitStackMarker = {}; +function traverseDoc(doc2, onEnter, onExit, shouldTraverseConditionalGroups) { + const docsStack = [doc2]; + while (docsStack.length > 0) { + const doc3 = docsStack.pop(); + if (doc3 === traverseDocOnExitStackMarker) { + onExit(docsStack.pop()); + continue; + } + if (onExit) { + docsStack.push(doc3, traverseDocOnExitStackMarker); + } + const docType = get_doc_type_default(doc3); + if (!docType) { + throw new invalid_doc_error_default(doc3); + } + if ((onEnter == null ? void 0 : onEnter(doc3)) === false) { + continue; + } + switch (docType) { + case DOC_TYPE_ARRAY: + case DOC_TYPE_FILL: { + const parts = docType === DOC_TYPE_ARRAY ? doc3 : doc3.parts; + for (let ic = parts.length, i = ic - 1; i >= 0; --i) { + docsStack.push(parts[i]); + } + break; + } + case DOC_TYPE_IF_BREAK: + docsStack.push(doc3.flatContents, doc3.breakContents); + break; + case DOC_TYPE_GROUP: + if (shouldTraverseConditionalGroups && doc3.expandedStates) { + for (let ic = doc3.expandedStates.length, i = ic - 1; i >= 0; --i) { + docsStack.push(doc3.expandedStates[i]); + } + } else { + docsStack.push(doc3.contents); + } + break; + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + case DOC_TYPE_LINE_SUFFIX: + docsStack.push(doc3.contents); + break; + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc3); + } + } +} +var traverse_doc_default = traverseDoc; + +// src/document/utils.js +function mapDoc(doc2, cb) { + if (typeof doc2 === "string") { + return cb(doc2); + } + const mapped = /* @__PURE__ */ new Map(); + return rec(doc2); + function rec(doc3) { + if (mapped.has(doc3)) { + return mapped.get(doc3); + } + const result = process4(doc3); + mapped.set(doc3, result); + return result; + } + function process4(doc3) { + switch (get_doc_type_default(doc3)) { + case DOC_TYPE_ARRAY: + return cb(doc3.map(rec)); + case DOC_TYPE_FILL: + return cb({ ...doc3, parts: doc3.parts.map(rec) }); + case DOC_TYPE_IF_BREAK: + return cb({ + ...doc3, + breakContents: rec(doc3.breakContents), + flatContents: rec(doc3.flatContents) + }); + case DOC_TYPE_GROUP: { + let { expandedStates, contents } = doc3; + if (expandedStates) { + expandedStates = expandedStates.map(rec); + contents = expandedStates[0]; + } else { + contents = rec(contents); + } + return cb({ ...doc3, contents, expandedStates }); + } + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + case DOC_TYPE_LINE_SUFFIX: + return cb({ ...doc3, contents: rec(doc3.contents) }); + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + return cb(doc3); + default: + throw new invalid_doc_error_default(doc3); + } + } +} +function breakParentGroup(groupStack) { + if (groupStack.length > 0) { + const parentGroup = at_default( + /* isOptionalObject */ + false, + groupStack, + -1 + ); + if (!parentGroup.expandedStates && !parentGroup.break) { + parentGroup.break = "propagated"; + } + } + return null; +} +function propagateBreaks(doc2) { + const alreadyVisitedSet = /* @__PURE__ */ new Set(); + const groupStack = []; + function propagateBreaksOnEnterFn(doc3) { + if (doc3.type === DOC_TYPE_BREAK_PARENT) { + breakParentGroup(groupStack); + } + if (doc3.type === DOC_TYPE_GROUP) { + groupStack.push(doc3); + if (alreadyVisitedSet.has(doc3)) { + return false; + } + alreadyVisitedSet.add(doc3); + } + } + function propagateBreaksOnExitFn(doc3) { + if (doc3.type === DOC_TYPE_GROUP) { + const group = groupStack.pop(); + if (group.break) { + breakParentGroup(groupStack); + } + } + } + traverse_doc_default( + doc2, + propagateBreaksOnEnterFn, + propagateBreaksOnExitFn, + /* shouldTraverseConditionalGroups */ + true + ); +} +function stripTrailingHardlineFromParts(parts) { + parts = [...parts]; + while (parts.length >= 2 && at_default( + /* isOptionalObject */ + false, + parts, + -2 + ).type === DOC_TYPE_LINE && at_default( + /* isOptionalObject */ + false, + parts, + -1 + ).type === DOC_TYPE_BREAK_PARENT) { + parts.length -= 2; + } + if (parts.length > 0) { + const lastPart = stripTrailingHardlineFromDoc(at_default( + /* isOptionalObject */ + false, + parts, + -1 + )); + parts[parts.length - 1] = lastPart; + } + return parts; +} +function stripTrailingHardlineFromDoc(doc2) { + switch (get_doc_type_default(doc2)) { + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_GROUP: + case DOC_TYPE_LINE_SUFFIX: + case DOC_TYPE_LABEL: { + const contents = stripTrailingHardlineFromDoc(doc2.contents); + return { ...doc2, contents }; + } + case DOC_TYPE_IF_BREAK: + return { + ...doc2, + breakContents: stripTrailingHardlineFromDoc(doc2.breakContents), + flatContents: stripTrailingHardlineFromDoc(doc2.flatContents) + }; + case DOC_TYPE_FILL: + return { ...doc2, parts: stripTrailingHardlineFromParts(doc2.parts) }; + case DOC_TYPE_ARRAY: + return stripTrailingHardlineFromParts(doc2); + case DOC_TYPE_STRING: + return doc2.replace(/[\n\r]*$/u, ""); + case DOC_TYPE_ALIGN: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc2); + } + return doc2; +} +function stripTrailingHardline(doc2) { + return stripTrailingHardlineFromDoc(cleanDoc(doc2)); +} +function cleanDocFn(doc2) { + switch (get_doc_type_default(doc2)) { + case DOC_TYPE_FILL: + if (doc2.parts.every((part) => part === "")) { + return ""; + } + break; + case DOC_TYPE_GROUP: + if (!doc2.contents && !doc2.id && !doc2.break && !doc2.expandedStates) { + return ""; + } + if (doc2.contents.type === DOC_TYPE_GROUP && doc2.contents.id === doc2.id && doc2.contents.break === doc2.break && doc2.contents.expandedStates === doc2.expandedStates) { + return doc2.contents; + } + break; + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LINE_SUFFIX: + if (!doc2.contents) { + return ""; + } + break; + case DOC_TYPE_IF_BREAK: + if (!doc2.flatContents && !doc2.breakContents) { + return ""; + } + break; + case DOC_TYPE_ARRAY: { + const parts = []; + for (const part of doc2) { + if (!part) { + continue; + } + const [currentPart, ...restParts] = Array.isArray(part) ? part : [part]; + if (typeof currentPart === "string" && typeof at_default( + /* isOptionalObject */ + false, + parts, + -1 + ) === "string") { + parts[parts.length - 1] += currentPart; + } else { + parts.push(currentPart); + } + parts.push(...restParts); + } + if (parts.length === 0) { + return ""; + } + if (parts.length === 1) { + return parts[0]; + } + return parts; + } + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_LABEL: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc2); + } + return doc2; +} +function cleanDoc(doc2) { + return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc)); +} +function inheritLabel(doc2, fn) { + return doc2.type === DOC_TYPE_LABEL ? { ...doc2, contents: fn(doc2.contents) } : fn(doc2); +} + +// src/document/utils/assert-doc.js +var noop = () => { +}; +var assertDoc = true ? noop : function(doc2) { + traverse_doc_default(doc2, (doc3) => { + if (checked.has(doc3)) { + return false; + } + if (typeof doc3 !== "string") { + checked.add(doc3); + } + }); +}; + +// src/document/builders.js +function indent(contents) { + assertDoc(contents); + return { type: DOC_TYPE_INDENT, contents }; +} +function align(widthOrString, contents) { + assertDoc(contents); + return { type: DOC_TYPE_ALIGN, contents, n: widthOrString }; +} +function lineSuffix(contents) { + assertDoc(contents); + return { type: DOC_TYPE_LINE_SUFFIX, contents }; +} +var breakParent = { type: DOC_TYPE_BREAK_PARENT }; +var hardlineWithoutBreakParent = { type: DOC_TYPE_LINE, hard: true }; +var line2 = { type: DOC_TYPE_LINE }; +var hardline = [hardlineWithoutBreakParent, breakParent]; +var cursor = { type: DOC_TYPE_CURSOR }; +function addAlignmentToDoc(doc2, size, tabWidth) { + assertDoc(doc2); + let aligned = doc2; + if (size > 0) { + for (let i = 0; i < Math.floor(size / tabWidth); ++i) { + aligned = indent(aligned); + } + aligned = align(size % tabWidth, aligned); + aligned = align(Number.NEGATIVE_INFINITY, aligned); + } + return aligned; +} + +// src/document/debug.js +function flattenDoc(doc2) { + var _a; + if (!doc2) { + return ""; + } + if (Array.isArray(doc2)) { + const res = []; + for (const part of doc2) { + if (Array.isArray(part)) { + res.push(...flattenDoc(part)); + } else { + const flattened = flattenDoc(part); + if (flattened !== "") { + res.push(flattened); + } + } + } + return res; + } + if (doc2.type === DOC_TYPE_IF_BREAK) { + return { + ...doc2, + breakContents: flattenDoc(doc2.breakContents), + flatContents: flattenDoc(doc2.flatContents) + }; + } + if (doc2.type === DOC_TYPE_GROUP) { + return { + ...doc2, + contents: flattenDoc(doc2.contents), + expandedStates: (_a = doc2.expandedStates) == null ? void 0 : _a.map(flattenDoc) + }; + } + if (doc2.type === DOC_TYPE_FILL) { + return { type: "fill", parts: doc2.parts.map(flattenDoc) }; + } + if (doc2.contents) { + return { ...doc2, contents: flattenDoc(doc2.contents) }; + } + return doc2; +} +function printDocToDebug(doc2) { + const printedSymbols = /* @__PURE__ */ Object.create(null); + const usedKeysForSymbols = /* @__PURE__ */ new Set(); + return printDoc(flattenDoc(doc2)); + function printDoc(doc3, index, parentParts) { + var _a, _b; + if (typeof doc3 === "string") { + return JSON.stringify(doc3); + } + if (Array.isArray(doc3)) { + const printed = doc3.map(printDoc).filter(Boolean); + return printed.length === 1 ? printed[0] : `[${printed.join(", ")}]`; + } + if (doc3.type === DOC_TYPE_LINE) { + const withBreakParent = ((_a = parentParts == null ? void 0 : parentParts[index + 1]) == null ? void 0 : _a.type) === DOC_TYPE_BREAK_PARENT; + if (doc3.literal) { + return withBreakParent ? "literalline" : "literallineWithoutBreakParent"; + } + if (doc3.hard) { + return withBreakParent ? "hardline" : "hardlineWithoutBreakParent"; + } + if (doc3.soft) { + return "softline"; + } + return "line"; + } + if (doc3.type === DOC_TYPE_BREAK_PARENT) { + const afterHardline = ((_b = parentParts == null ? void 0 : parentParts[index - 1]) == null ? void 0 : _b.type) === DOC_TYPE_LINE && parentParts[index - 1].hard; + return afterHardline ? void 0 : "breakParent"; + } + if (doc3.type === DOC_TYPE_TRIM) { + return "trim"; + } + if (doc3.type === DOC_TYPE_INDENT) { + return "indent(" + printDoc(doc3.contents) + ")"; + } + if (doc3.type === DOC_TYPE_ALIGN) { + return doc3.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + printDoc(doc3.contents) + ")" : doc3.n < 0 ? "dedent(" + printDoc(doc3.contents) + ")" : doc3.n.type === "root" ? "markAsRoot(" + printDoc(doc3.contents) + ")" : "align(" + JSON.stringify(doc3.n) + ", " + printDoc(doc3.contents) + ")"; + } + if (doc3.type === DOC_TYPE_IF_BREAK) { + return "ifBreak(" + printDoc(doc3.breakContents) + (doc3.flatContents ? ", " + printDoc(doc3.flatContents) : "") + (doc3.groupId ? (!doc3.flatContents ? ', ""' : "") + `, { groupId: ${printGroupId(doc3.groupId)} }` : "") + ")"; + } + if (doc3.type === DOC_TYPE_INDENT_IF_BREAK) { + const optionsParts = []; + if (doc3.negate) { + optionsParts.push("negate: true"); + } + if (doc3.groupId) { + optionsParts.push(`groupId: ${printGroupId(doc3.groupId)}`); + } + const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : ""; + return `indentIfBreak(${printDoc(doc3.contents)}${options8})`; + } + if (doc3.type === DOC_TYPE_GROUP) { + const optionsParts = []; + if (doc3.break && doc3.break !== "propagated") { + optionsParts.push("shouldBreak: true"); + } + if (doc3.id) { + optionsParts.push(`id: ${printGroupId(doc3.id)}`); + } + const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : ""; + if (doc3.expandedStates) { + return `conditionalGroup([${doc3.expandedStates.map((part) => printDoc(part)).join(",")}]${options8})`; + } + return `group(${printDoc(doc3.contents)}${options8})`; + } + if (doc3.type === DOC_TYPE_FILL) { + return `fill([${doc3.parts.map((part) => printDoc(part)).join(", ")}])`; + } + if (doc3.type === DOC_TYPE_LINE_SUFFIX) { + return "lineSuffix(" + printDoc(doc3.contents) + ")"; + } + if (doc3.type === DOC_TYPE_LINE_SUFFIX_BOUNDARY) { + return "lineSuffixBoundary"; + } + if (doc3.type === DOC_TYPE_LABEL) { + return `label(${JSON.stringify(doc3.label)}, ${printDoc(doc3.contents)})`; + } + throw new Error("Unknown doc type " + doc3.type); + } + function printGroupId(id) { + if (typeof id !== "symbol") { + return JSON.stringify(String(id)); + } + if (id in printedSymbols) { + return printedSymbols[id]; + } + const prefix = id.description || "symbol"; + for (let counter = 0; ; counter++) { + const key2 = prefix + (counter > 0 ? ` #${counter}` : ""); + if (!usedKeysForSymbols.has(key2)) { + usedKeysForSymbols.add(key2); + return printedSymbols[id] = `Symbol.for(${JSON.stringify(key2)})`; + } + } + } +} + +// node_modules/emoji-regex/index.mjs +var emoji_regex_default = () => { + return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; +}; + +// node_modules/get-east-asian-width/lookup.js +function isFullWidth(x) { + return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510; +} +function isWide(x) { + return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141; +} + +// node_modules/get-east-asian-width/index.js +var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint)); + +// src/utils/get-string-width.js +var notAsciiRegex = /[^\x20-\x7F]/u; +function getStringWidth(text) { + if (!text) { + return 0; + } + if (!notAsciiRegex.test(text)) { + return text.length; + } + text = text.replace(emoji_regex_default(), " "); + let width = 0; + for (const character of text) { + const codePoint = character.codePointAt(0); + if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { + continue; + } + if (codePoint >= 768 && codePoint <= 879) { + continue; + } + width += _isNarrowWidth(codePoint) ? 1 : 2; + } + return width; +} +var get_string_width_default = getStringWidth; + +// src/document/printer.js +var MODE_BREAK = Symbol("MODE_BREAK"); +var MODE_FLAT = Symbol("MODE_FLAT"); +var CURSOR_PLACEHOLDER = Symbol("cursor"); +var DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH"); +function rootIndent() { + return { value: "", length: 0, queue: [] }; +} +function makeIndent(ind, options8) { + return generateInd(ind, { type: "indent" }, options8); +} +function makeAlign(indent2, widthOrDoc, options8) { + if (widthOrDoc === Number.NEGATIVE_INFINITY) { + return indent2.root || rootIndent(); + } + if (widthOrDoc < 0) { + return generateInd(indent2, { type: "dedent" }, options8); + } + if (!widthOrDoc) { + return indent2; + } + if (widthOrDoc.type === "root") { + return { ...indent2, root: indent2 }; + } + const alignType = typeof widthOrDoc === "string" ? "stringAlign" : "numberAlign"; + return generateInd(indent2, { type: alignType, n: widthOrDoc }, options8); +} +function generateInd(ind, newPart, options8) { + const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) : [...ind.queue, newPart]; + let value = ""; + let length = 0; + let lastTabs = 0; + let lastSpaces = 0; + for (const part of queue) { + switch (part.type) { + case "indent": + flush(); + if (options8.useTabs) { + addTabs(1); + } else { + addSpaces(options8.tabWidth); + } + break; + case "stringAlign": + flush(); + value += part.n; + length += part.n.length; + break; + case "numberAlign": + lastTabs += 1; + lastSpaces += part.n; + break; + default: + throw new Error(`Unexpected type '${part.type}'`); + } + } + flushSpaces(); + return { ...ind, value, length, queue }; + function addTabs(count) { + value += " ".repeat(count); + length += options8.tabWidth * count; + } + function addSpaces(count) { + value += " ".repeat(count); + length += count; + } + function flush() { + if (options8.useTabs) { + flushTabs(); + } else { + flushSpaces(); + } + } + function flushTabs() { + if (lastTabs > 0) { + addTabs(lastTabs); + } + resetLast(); + } + function flushSpaces() { + if (lastSpaces > 0) { + addSpaces(lastSpaces); + } + resetLast(); + } + function resetLast() { + lastTabs = 0; + lastSpaces = 0; + } +} +function trim(out) { + let trimCount = 0; + let cursorCount = 0; + let outIndex = out.length; + outer: while (outIndex--) { + const last = out[outIndex]; + if (last === CURSOR_PLACEHOLDER) { + cursorCount++; + continue; + } + if (false) { + throw new Error(`Unexpected value in trim: '${typeof last}'`); + } + for (let charIndex = last.length - 1; charIndex >= 0; charIndex--) { + const char = last[charIndex]; + if (char === " " || char === " ") { + trimCount++; + } else { + out[outIndex] = last.slice(0, charIndex + 1); + break outer; + } + } + } + if (trimCount > 0 || cursorCount > 0) { + out.length = outIndex + 1; + while (cursorCount-- > 0) { + out.push(CURSOR_PLACEHOLDER); + } + } + return trimCount; +} +function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat) { + if (width === Number.POSITIVE_INFINITY) { + return true; + } + let restIdx = restCommands.length; + const cmds = [next]; + const out = []; + while (width >= 0) { + if (cmds.length === 0) { + if (restIdx === 0) { + return true; + } + cmds.push(restCommands[--restIdx]); + continue; + } + const { mode, doc: doc2 } = cmds.pop(); + const docType = get_doc_type_default(doc2); + switch (docType) { + case DOC_TYPE_STRING: + out.push(doc2); + width -= get_string_width_default(doc2); + break; + case DOC_TYPE_ARRAY: + case DOC_TYPE_FILL: { + const parts = docType === DOC_TYPE_ARRAY ? doc2 : doc2.parts; + const end = doc2[DOC_FILL_PRINTED_LENGTH] ?? 0; + for (let i = parts.length - 1; i >= end; i--) { + cmds.push({ mode, doc: parts[i] }); + } + break; + } + case DOC_TYPE_INDENT: + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + cmds.push({ mode, doc: doc2.contents }); + break; + case DOC_TYPE_TRIM: + width += trim(out); + break; + case DOC_TYPE_GROUP: { + if (mustBeFlat && doc2.break) { + return false; + } + const groupMode = doc2.break ? MODE_BREAK : mode; + const contents = doc2.expandedStates && groupMode === MODE_BREAK ? at_default( + /* isOptionalObject */ + false, + doc2.expandedStates, + -1 + ) : doc2.contents; + cmds.push({ mode: groupMode, doc: contents }); + break; + } + case DOC_TYPE_IF_BREAK: { + const groupMode = doc2.groupId ? groupModeMap[doc2.groupId] || MODE_FLAT : mode; + const contents = groupMode === MODE_BREAK ? doc2.breakContents : doc2.flatContents; + if (contents) { + cmds.push({ mode, doc: contents }); + } + break; + } + case DOC_TYPE_LINE: + if (mode === MODE_BREAK || doc2.hard) { + return true; + } + if (!doc2.soft) { + out.push(" "); + width--; + } + break; + case DOC_TYPE_LINE_SUFFIX: + hasLineSuffix = true; + break; + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + if (hasLineSuffix) { + return false; + } + break; + } + } + return false; +} +function printDocToString(doc2, options8) { + const groupModeMap = {}; + const width = options8.printWidth; + const newLine = convertEndOfLineToChars(options8.endOfLine); + let pos2 = 0; + const cmds = [{ ind: rootIndent(), mode: MODE_BREAK, doc: doc2 }]; + const out = []; + let shouldRemeasure = false; + const lineSuffix2 = []; + let printedCursorCount = 0; + propagateBreaks(doc2); + while (cmds.length > 0) { + const { ind, mode, doc: doc3 } = cmds.pop(); + switch (get_doc_type_default(doc3)) { + case DOC_TYPE_STRING: { + const formatted = newLine !== "\n" ? string_replace_all_default( + /* isOptionalObject */ + false, + doc3, + "\n", + newLine + ) : doc3; + out.push(formatted); + if (cmds.length > 0) { + pos2 += get_string_width_default(formatted); + } + break; + } + case DOC_TYPE_ARRAY: + for (let i = doc3.length - 1; i >= 0; i--) { + cmds.push({ ind, mode, doc: doc3[i] }); + } + break; + case DOC_TYPE_CURSOR: + if (printedCursorCount >= 2) { + throw new Error("There are too many 'cursor' in doc."); + } + out.push(CURSOR_PLACEHOLDER); + printedCursorCount++; + break; + case DOC_TYPE_INDENT: + cmds.push({ ind: makeIndent(ind, options8), mode, doc: doc3.contents }); + break; + case DOC_TYPE_ALIGN: + cmds.push({ + ind: makeAlign(ind, doc3.n, options8), + mode, + doc: doc3.contents + }); + break; + case DOC_TYPE_TRIM: + pos2 -= trim(out); + break; + case DOC_TYPE_GROUP: + switch (mode) { + case MODE_FLAT: + if (!shouldRemeasure) { + cmds.push({ + ind, + mode: doc3.break ? MODE_BREAK : MODE_FLAT, + doc: doc3.contents + }); + break; + } + // fallthrough + case MODE_BREAK: { + shouldRemeasure = false; + const next = { ind, mode: MODE_FLAT, doc: doc3.contents }; + const rem = width - pos2; + const hasLineSuffix = lineSuffix2.length > 0; + if (!doc3.break && fits(next, cmds, rem, hasLineSuffix, groupModeMap)) { + cmds.push(next); + } else { + if (doc3.expandedStates) { + const mostExpanded = at_default( + /* isOptionalObject */ + false, + doc3.expandedStates, + -1 + ); + if (doc3.break) { + cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded }); + break; + } else { + for (let i = 1; i < doc3.expandedStates.length + 1; i++) { + if (i >= doc3.expandedStates.length) { + cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded }); + break; + } else { + const state = doc3.expandedStates[i]; + const cmd = { ind, mode: MODE_FLAT, doc: state }; + if (fits(cmd, cmds, rem, hasLineSuffix, groupModeMap)) { + cmds.push(cmd); + break; + } + } + } + } + } else { + cmds.push({ ind, mode: MODE_BREAK, doc: doc3.contents }); + } + } + break; + } + } + if (doc3.id) { + groupModeMap[doc3.id] = at_default( + /* isOptionalObject */ + false, + cmds, + -1 + ).mode; + } + break; + // Fills each line with as much code as possible before moving to a new + // line with the same indentation. + // + // Expects doc.parts to be an array of alternating content and + // whitespace. The whitespace contains the linebreaks. + // + // For example: + // ["I", line, "love", line, "monkeys"] + // or + // [{ type: group, ... }, softline, { type: group, ... }] + // + // It uses this parts structure to handle three main layout cases: + // * The first two content items fit on the same line without + // breaking + // -> output the first content item and the whitespace "flat". + // * Only the first content item fits on the line without breaking + // -> output the first content item "flat" and the whitespace with + // "break". + // * Neither content item fits on the line without breaking + // -> output the first content item and the whitespace with "break". + case DOC_TYPE_FILL: { + const rem = width - pos2; + const offset = doc3[DOC_FILL_PRINTED_LENGTH] ?? 0; + const { parts } = doc3; + const length = parts.length - offset; + if (length === 0) { + break; + } + const content = parts[offset + 0]; + const whitespace = parts[offset + 1]; + const contentFlatCmd = { ind, mode: MODE_FLAT, doc: content }; + const contentBreakCmd = { ind, mode: MODE_BREAK, doc: content }; + const contentFits = fits( + contentFlatCmd, + [], + rem, + lineSuffix2.length > 0, + groupModeMap, + true + ); + if (length === 1) { + if (contentFits) { + cmds.push(contentFlatCmd); + } else { + cmds.push(contentBreakCmd); + } + break; + } + const whitespaceFlatCmd = { ind, mode: MODE_FLAT, doc: whitespace }; + const whitespaceBreakCmd = { ind, mode: MODE_BREAK, doc: whitespace }; + if (length === 2) { + if (contentFits) { + cmds.push(whitespaceFlatCmd, contentFlatCmd); + } else { + cmds.push(whitespaceBreakCmd, contentBreakCmd); + } + break; + } + const secondContent = parts[offset + 2]; + const remainingCmd = { + ind, + mode, + doc: { ...doc3, [DOC_FILL_PRINTED_LENGTH]: offset + 2 } + }; + const firstAndSecondContentFlatCmd = { + ind, + mode: MODE_FLAT, + doc: [content, whitespace, secondContent] + }; + const firstAndSecondContentFits = fits( + firstAndSecondContentFlatCmd, + [], + rem, + lineSuffix2.length > 0, + groupModeMap, + true + ); + if (firstAndSecondContentFits) { + cmds.push(remainingCmd, whitespaceFlatCmd, contentFlatCmd); + } else if (contentFits) { + cmds.push(remainingCmd, whitespaceBreakCmd, contentFlatCmd); + } else { + cmds.push(remainingCmd, whitespaceBreakCmd, contentBreakCmd); + } + break; + } + case DOC_TYPE_IF_BREAK: + case DOC_TYPE_INDENT_IF_BREAK: { + const groupMode = doc3.groupId ? groupModeMap[doc3.groupId] : mode; + if (groupMode === MODE_BREAK) { + const breakContents = doc3.type === DOC_TYPE_IF_BREAK ? doc3.breakContents : doc3.negate ? doc3.contents : indent(doc3.contents); + if (breakContents) { + cmds.push({ ind, mode, doc: breakContents }); + } + } + if (groupMode === MODE_FLAT) { + const flatContents = doc3.type === DOC_TYPE_IF_BREAK ? doc3.flatContents : doc3.negate ? indent(doc3.contents) : doc3.contents; + if (flatContents) { + cmds.push({ ind, mode, doc: flatContents }); + } + } + break; + } + case DOC_TYPE_LINE_SUFFIX: + lineSuffix2.push({ ind, mode, doc: doc3.contents }); + break; + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + if (lineSuffix2.length > 0) { + cmds.push({ ind, mode, doc: hardlineWithoutBreakParent }); + } + break; + case DOC_TYPE_LINE: + switch (mode) { + case MODE_FLAT: + if (!doc3.hard) { + if (!doc3.soft) { + out.push(" "); + pos2 += 1; + } + break; + } else { + shouldRemeasure = true; + } + // fallthrough + case MODE_BREAK: + if (lineSuffix2.length > 0) { + cmds.push({ ind, mode, doc: doc3 }, ...lineSuffix2.reverse()); + lineSuffix2.length = 0; + break; + } + if (doc3.literal) { + if (ind.root) { + out.push(newLine, ind.root.value); + pos2 = ind.root.length; + } else { + out.push(newLine); + pos2 = 0; + } + } else { + pos2 -= trim(out); + out.push(newLine + ind.value); + pos2 = ind.length; + } + break; + } + break; + case DOC_TYPE_LABEL: + cmds.push({ ind, mode, doc: doc3.contents }); + break; + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc3); + } + if (cmds.length === 0 && lineSuffix2.length > 0) { + cmds.push(...lineSuffix2.reverse()); + lineSuffix2.length = 0; + } + } + const cursorPlaceholderIndex = out.indexOf(CURSOR_PLACEHOLDER); + if (cursorPlaceholderIndex !== -1) { + const otherCursorPlaceholderIndex = out.indexOf( + CURSOR_PLACEHOLDER, + cursorPlaceholderIndex + 1 + ); + if (otherCursorPlaceholderIndex === -1) { + return { + formatted: out.filter((char) => char !== CURSOR_PLACEHOLDER).join("") + }; + } + const beforeCursor = out.slice(0, cursorPlaceholderIndex).join(""); + const aroundCursor = out.slice(cursorPlaceholderIndex + 1, otherCursorPlaceholderIndex).join(""); + const afterCursor = out.slice(otherCursorPlaceholderIndex + 1).join(""); + return { + formatted: beforeCursor + aroundCursor + afterCursor, + cursorNodeStart: beforeCursor.length, + cursorNodeText: aroundCursor + }; + } + return { formatted: out.join("") }; +} + +// src/utils/get-alignment-size.js +function getAlignmentSize(text, tabWidth, startIndex = 0) { + let size = 0; + for (let i = startIndex; i < text.length; ++i) { + if (text[i] === " ") { + size = size + tabWidth - size % tabWidth; + } else { + size++; + } + } + return size; +} +var get_alignment_size_default = getAlignmentSize; + +// src/common/ast-path.js +var _AstPath_instances, getNodeStackIndex_fn, getAncestors_fn; +var AstPath = class { + constructor(value) { + __privateAdd(this, _AstPath_instances); + this.stack = [value]; + } + /** @type {string | null} */ + get key() { + const { stack: stack2, siblings } = this; + return at_default( + /* isOptionalObject */ + false, + stack2, + siblings === null ? -2 : -4 + ) ?? null; + } + /** @type {number | null} */ + get index() { + return this.siblings === null ? null : at_default( + /* isOptionalObject */ + false, + this.stack, + -2 + ); + } + /** @type {object} */ + get node() { + return at_default( + /* isOptionalObject */ + false, + this.stack, + -1 + ); + } + /** @type {object | null} */ + get parent() { + return this.getNode(1); + } + /** @type {object | null} */ + get grandparent() { + return this.getNode(2); + } + /** @type {boolean} */ + get isInArray() { + return this.siblings !== null; + } + /** @type {object[] | null} */ + get siblings() { + const { stack: stack2 } = this; + const maybeArray = at_default( + /* isOptionalObject */ + false, + stack2, + -3 + ); + return Array.isArray(maybeArray) ? maybeArray : null; + } + /** @type {object | null} */ + get next() { + const { siblings } = this; + return siblings === null ? null : siblings[this.index + 1]; + } + /** @type {object | null} */ + get previous() { + const { siblings } = this; + return siblings === null ? null : siblings[this.index - 1]; + } + /** @type {boolean} */ + get isFirst() { + return this.index === 0; + } + /** @type {boolean} */ + get isLast() { + const { siblings, index } = this; + return siblings !== null && index === siblings.length - 1; + } + /** @type {boolean} */ + get isRoot() { + return this.stack.length === 1; + } + /** @type {object} */ + get root() { + return this.stack[0]; + } + /** @type {object[]} */ + get ancestors() { + return [...__privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)]; + } + // The name of the current property is always the penultimate element of + // this.stack, and always a string/number/symbol. + getName() { + const { stack: stack2 } = this; + const { length } = stack2; + if (length > 1) { + return at_default( + /* isOptionalObject */ + false, + stack2, + -2 + ); + } + return null; + } + // The value of the current property is always the final element of + // this.stack. + getValue() { + return at_default( + /* isOptionalObject */ + false, + this.stack, + -1 + ); + } + getNode(count = 0) { + const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count); + return stackIndex === -1 ? null : this.stack[stackIndex]; + } + getParentNode(count = 0) { + return this.getNode(count + 1); + } + // Temporarily push properties named by string arguments given after the + // callback function onto this.stack, then call the callback with a + // reference to this (modified) AstPath object. Note that the stack will + // be restored to its original state after the callback is finished, so it + // is probably a mistake to retain a reference to the path. + call(callback, ...names) { + const { stack: stack2 } = this; + const { length } = stack2; + let value = at_default( + /* isOptionalObject */ + false, + stack2, + -1 + ); + for (const name of names) { + value = value[name]; + stack2.push(name, value); + } + try { + return callback(this); + } finally { + stack2.length = length; + } + } + /** + * @template {(path: AstPath) => any} T + * @param {T} callback + * @param {number} [count=0] + * @returns {ReturnType} + */ + callParent(callback, count = 0) { + const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count + 1); + const parentValues = this.stack.splice(stackIndex + 1); + try { + return callback(this); + } finally { + this.stack.push(...parentValues); + } + } + // Similar to AstPath.prototype.call, except that the value obtained by + // accessing this.getValue()[name1][name2]... should be array. The + // callback will be called with a reference to this path object for each + // element of the array. + each(callback, ...names) { + const { stack: stack2 } = this; + const { length } = stack2; + let value = at_default( + /* isOptionalObject */ + false, + stack2, + -1 + ); + for (const name of names) { + value = value[name]; + stack2.push(name, value); + } + try { + for (let i = 0; i < value.length; ++i) { + stack2.push(i, value[i]); + callback(this, i, value); + stack2.length -= 2; + } + } finally { + stack2.length = length; + } + } + // Similar to AstPath.prototype.each, except that the results of the + // callback function invocations are stored in an array and returned at + // the end of the iteration. + map(callback, ...names) { + const result = []; + this.each( + (path13, index, value) => { + result[index] = callback(path13, index, value); + }, + ...names + ); + return result; + } + /** + * @param {...( + * | ((node: any, name: string | null, number: number | null) => boolean) + * | undefined + * )} predicates + */ + match(...predicates) { + let stackPointer = this.stack.length - 1; + let name = null; + let node = this.stack[stackPointer--]; + for (const predicate of predicates) { + if (node === void 0) { + return false; + } + let number = null; + if (typeof name === "number") { + number = name; + name = this.stack[stackPointer--]; + node = this.stack[stackPointer--]; + } + if (predicate && !predicate(node, name, number)) { + return false; + } + name = this.stack[stackPointer--]; + node = this.stack[stackPointer--]; + } + return true; + } + /** + * Traverses the ancestors of the current node heading toward the tree root + * until it finds a node that matches the provided predicate function. Will + * return the first matching ancestor. If no such node exists, returns undefined. + * @param {(node: any) => boolean} predicate + * @internal Unstable API. Don't use in plugins for now. + */ + findAncestor(predicate) { + for (const node of __privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)) { + if (predicate(node)) { + return node; + } + } + } + /** + * Traverses the ancestors of the current node heading toward the tree root + * until it finds a node that matches the provided predicate function. + * returns true if matched node found. + * @param {(node: any) => boolean} predicate + * @returns {boolean} + * @internal Unstable API. Don't use in plugins for now. + */ + hasAncestor(predicate) { + for (const node of __privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)) { + if (predicate(node)) { + return true; + } + } + return false; + } +}; +_AstPath_instances = new WeakSet(); +getNodeStackIndex_fn = function(count) { + const { stack: stack2 } = this; + for (let i = stack2.length - 1; i >= 0; i -= 2) { + if (!Array.isArray(stack2[i]) && --count < 0) { + return i; + } + } + return -1; +}; +getAncestors_fn = function* () { + const { stack: stack2 } = this; + for (let index = stack2.length - 3; index >= 0; index -= 2) { + const value = stack2[index]; + if (!Array.isArray(value)) { + yield value; + } + } +}; +var ast_path_default = AstPath; + +// src/main/comments/attach.js +import assert4 from "assert"; + +// src/utils/is-object.js +function isObject2(object) { + return object !== null && typeof object === "object"; +} +var is_object_default = isObject2; + +// src/utils/ast-utils.js +function* getChildren(node, options8) { + const { getVisitorKeys, filter: filter2 = () => true } = options8; + const isMatchedNode = (node2) => is_object_default(node2) && filter2(node2); + for (const key2 of getVisitorKeys(node)) { + const value = node[key2]; + if (Array.isArray(value)) { + for (const child of value) { + if (isMatchedNode(child)) { + yield child; + } + } + } else if (isMatchedNode(value)) { + yield value; + } + } +} +function* getDescendants(node, options8) { + const queue = [node]; + for (let index = 0; index < queue.length; index++) { + const node2 = queue[index]; + for (const child of getChildren(node2, options8)) { + yield child; + queue.push(child); + } + } +} +function isLeaf(node, options8) { + return getChildren(node, options8).next().done; +} + +// src/utils/skip.js +function skip(characters) { + return (text, startIndex, options8) => { + const backwards = Boolean(options8 == null ? void 0 : options8.backwards); + if (startIndex === false) { + return false; + } + const { length } = text; + let cursor2 = startIndex; + while (cursor2 >= 0 && cursor2 < length) { + const character = text.charAt(cursor2); + if (characters instanceof RegExp) { + if (!characters.test(character)) { + return cursor2; + } + } else if (!characters.includes(character)) { + return cursor2; + } + backwards ? cursor2-- : cursor2++; + } + if (cursor2 === -1 || cursor2 === length) { + return cursor2; + } + return false; + }; +} +var skipWhitespace = skip(/\s/u); +var skipSpaces = skip(" "); +var skipToLineEnd = skip(",; "); +var skipEverythingButNewLine = skip(/[^\n\r]/u); + +// src/utils/skip-newline.js +function skipNewline(text, startIndex, options8) { + const backwards = Boolean(options8 == null ? void 0 : options8.backwards); + if (startIndex === false) { + return false; + } + const character = text.charAt(startIndex); + if (backwards) { + if (text.charAt(startIndex - 1) === "\r" && character === "\n") { + return startIndex - 2; + } + if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") { + return startIndex - 1; + } + } else { + if (character === "\r" && text.charAt(startIndex + 1) === "\n") { + return startIndex + 2; + } + if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") { + return startIndex + 1; + } + } + return startIndex; +} +var skip_newline_default = skipNewline; + +// src/utils/has-newline.js +function hasNewline(text, startIndex, options8 = {}) { + const idx = skipSpaces( + text, + options8.backwards ? startIndex - 1 : startIndex, + options8 + ); + const idx2 = skip_newline_default(text, idx, options8); + return idx !== idx2; +} +var has_newline_default = hasNewline; + +// src/utils/is-non-empty-array.js +function isNonEmptyArray(object) { + return Array.isArray(object) && object.length > 0; +} +var is_non_empty_array_default = isNonEmptyArray; + +// src/main/create-get-visitor-keys-function.js +var nonTraversableKeys = /* @__PURE__ */ new Set([ + "tokens", + "comments", + "parent", + "enclosingNode", + "precedingNode", + "followingNode" +]); +var defaultGetVisitorKeys = (node) => Object.keys(node).filter((key2) => !nonTraversableKeys.has(key2)); +function createGetVisitorKeysFunction(printerGetVisitorKeys) { + return printerGetVisitorKeys ? (node) => printerGetVisitorKeys(node, nonTraversableKeys) : defaultGetVisitorKeys; +} +var create_get_visitor_keys_function_default = createGetVisitorKeysFunction; + +// src/main/comments/utils.js +function describeNodeForDebugging(node) { + const nodeType = node.type || node.kind || "(unknown type)"; + let nodeName = String( + node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || "" + ); + if (nodeName.length > 20) { + nodeName = nodeName.slice(0, 19) + "\u2026"; + } + return nodeType + (nodeName ? " " + nodeName : ""); +} +function addCommentHelper(node, comment) { + const comments = node.comments ?? (node.comments = []); + comments.push(comment); + comment.printed = false; + comment.nodeDescription = describeNodeForDebugging(node); +} +function addLeadingComment(node, comment) { + comment.leading = true; + comment.trailing = false; + addCommentHelper(node, comment); +} +function addDanglingComment(node, comment, marker) { + comment.leading = false; + comment.trailing = false; + if (marker) { + comment.marker = marker; + } + addCommentHelper(node, comment); +} +function addTrailingComment(node, comment) { + comment.leading = false; + comment.trailing = true; + addCommentHelper(node, comment); +} + +// src/main/comments/attach.js +var childNodesCache = /* @__PURE__ */ new WeakMap(); +function getSortedChildNodes(node, options8) { + if (childNodesCache.has(node)) { + return childNodesCache.get(node); + } + const { + printer: { + getCommentChildNodes, + canAttachComment, + getVisitorKeys: printerGetVisitorKeys + }, + locStart, + locEnd + } = options8; + if (!canAttachComment) { + return []; + } + const childNodes = ((getCommentChildNodes == null ? void 0 : getCommentChildNodes(node, options8)) ?? [ + ...getChildren(node, { + getVisitorKeys: create_get_visitor_keys_function_default(printerGetVisitorKeys) + }) + ]).flatMap( + (node2) => canAttachComment(node2) ? [node2] : getSortedChildNodes(node2, options8) + ); + childNodes.sort( + (nodeA, nodeB) => locStart(nodeA) - locStart(nodeB) || locEnd(nodeA) - locEnd(nodeB) + ); + childNodesCache.set(node, childNodes); + return childNodes; +} +function decorateComment(node, comment, options8, enclosingNode) { + const { locStart, locEnd } = options8; + const commentStart = locStart(comment); + const commentEnd = locEnd(comment); + const childNodes = getSortedChildNodes(node, options8); + let precedingNode; + let followingNode; + let left = 0; + let right = childNodes.length; + while (left < right) { + const middle = left + right >> 1; + const child = childNodes[middle]; + const start = locStart(child); + const end = locEnd(child); + if (start <= commentStart && commentEnd <= end) { + return decorateComment(child, comment, options8, child); + } + if (end <= commentStart) { + precedingNode = child; + left = middle + 1; + continue; + } + if (commentEnd <= start) { + followingNode = child; + right = middle; + continue; + } + throw new Error("Comment location overlaps with node location"); + } + if ((enclosingNode == null ? void 0 : enclosingNode.type) === "TemplateLiteral") { + const { quasis } = enclosingNode; + const commentIndex = findExpressionIndexForComment( + quasis, + comment, + options8 + ); + if (precedingNode && findExpressionIndexForComment(quasis, precedingNode, options8) !== commentIndex) { + precedingNode = null; + } + if (followingNode && findExpressionIndexForComment(quasis, followingNode, options8) !== commentIndex) { + followingNode = null; + } + } + return { enclosingNode, precedingNode, followingNode }; +} +var returnFalse = () => false; +function attachComments(ast, options8) { + const { comments } = ast; + delete ast.comments; + if (!is_non_empty_array_default(comments) || !options8.printer.canAttachComment) { + return; + } + const tiesToBreak = []; + const { + locStart, + locEnd, + printer: { + experimentalFeatures: { + // TODO: Make this as default behavior + avoidAstMutation = false + } = {}, + handleComments = {} + }, + originalText: text + } = options8; + const { + ownLine: handleOwnLineComment = returnFalse, + endOfLine: handleEndOfLineComment = returnFalse, + remaining: handleRemainingComment = returnFalse + } = handleComments; + const decoratedComments = comments.map((comment, index) => ({ + ...decorateComment(ast, comment, options8), + comment, + text, + options: options8, + ast, + isLastComment: comments.length - 1 === index + })); + for (const [index, context] of decoratedComments.entries()) { + const { + comment, + precedingNode, + enclosingNode, + followingNode, + text: text2, + options: options9, + ast: ast2, + isLastComment + } = context; + if (options9.parser === "json" || options9.parser === "json5" || options9.parser === "jsonc" || options9.parser === "__js_expression" || options9.parser === "__ts_expression" || options9.parser === "__vue_expression" || options9.parser === "__vue_ts_expression") { + if (locStart(comment) - locStart(ast2) <= 0) { + addLeadingComment(ast2, comment); + continue; + } + if (locEnd(comment) - locEnd(ast2) >= 0) { + addTrailingComment(ast2, comment); + continue; + } + } + let args; + if (avoidAstMutation) { + args = [context]; + } else { + comment.enclosingNode = enclosingNode; + comment.precedingNode = precedingNode; + comment.followingNode = followingNode; + args = [comment, text2, options9, ast2, isLastComment]; + } + if (isOwnLineComment(text2, options9, decoratedComments, index)) { + comment.placement = "ownLine"; + if (handleOwnLineComment(...args)) { + } else if (followingNode) { + addLeadingComment(followingNode, comment); + } else if (precedingNode) { + addTrailingComment(precedingNode, comment); + } else if (enclosingNode) { + addDanglingComment(enclosingNode, comment); + } else { + addDanglingComment(ast2, comment); + } + } else if (isEndOfLineComment(text2, options9, decoratedComments, index)) { + comment.placement = "endOfLine"; + if (handleEndOfLineComment(...args)) { + } else if (precedingNode) { + addTrailingComment(precedingNode, comment); + } else if (followingNode) { + addLeadingComment(followingNode, comment); + } else if (enclosingNode) { + addDanglingComment(enclosingNode, comment); + } else { + addDanglingComment(ast2, comment); + } + } else { + comment.placement = "remaining"; + if (handleRemainingComment(...args)) { + } else if (precedingNode && followingNode) { + const tieCount = tiesToBreak.length; + if (tieCount > 0) { + const lastTie = tiesToBreak[tieCount - 1]; + if (lastTie.followingNode !== followingNode) { + breakTies(tiesToBreak, options9); + } + } + tiesToBreak.push(context); + } else if (precedingNode) { + addTrailingComment(precedingNode, comment); + } else if (followingNode) { + addLeadingComment(followingNode, comment); + } else if (enclosingNode) { + addDanglingComment(enclosingNode, comment); + } else { + addDanglingComment(ast2, comment); + } + } + } + breakTies(tiesToBreak, options8); + if (!avoidAstMutation) { + for (const comment of comments) { + delete comment.precedingNode; + delete comment.enclosingNode; + delete comment.followingNode; + } + } +} +var isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text); +function isOwnLineComment(text, options8, decoratedComments, commentIndex) { + const { comment, precedingNode } = decoratedComments[commentIndex]; + const { locStart, locEnd } = options8; + let start = locStart(comment); + if (precedingNode) { + for (let index = commentIndex - 1; index >= 0; index--) { + const { comment: comment2, precedingNode: currentCommentPrecedingNode } = decoratedComments[index]; + if (currentCommentPrecedingNode !== precedingNode || !isAllEmptyAndNoLineBreak(text.slice(locEnd(comment2), start))) { + break; + } + start = locStart(comment2); + } + } + return has_newline_default(text, start, { backwards: true }); +} +function isEndOfLineComment(text, options8, decoratedComments, commentIndex) { + const { comment, followingNode } = decoratedComments[commentIndex]; + const { locStart, locEnd } = options8; + let end = locEnd(comment); + if (followingNode) { + for (let index = commentIndex + 1; index < decoratedComments.length; index++) { + const { comment: comment2, followingNode: currentCommentFollowingNode } = decoratedComments[index]; + if (currentCommentFollowingNode !== followingNode || !isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment2)))) { + break; + } + end = locEnd(comment2); + } + } + return has_newline_default(text, end); +} +function breakTies(tiesToBreak, options8) { + var _a, _b; + const tieCount = tiesToBreak.length; + if (tieCount === 0) { + return; + } + const { precedingNode, followingNode } = tiesToBreak[0]; + let gapEndPos = options8.locStart(followingNode); + let indexOfFirstLeadingComment; + for (indexOfFirstLeadingComment = tieCount; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) { + const { + comment, + precedingNode: currentCommentPrecedingNode, + followingNode: currentCommentFollowingNode + } = tiesToBreak[indexOfFirstLeadingComment - 1]; + assert4.strictEqual(currentCommentPrecedingNode, precedingNode); + assert4.strictEqual(currentCommentFollowingNode, followingNode); + const gap = options8.originalText.slice(options8.locEnd(comment), gapEndPos); + if (((_b = (_a = options8.printer).isGap) == null ? void 0 : _b.call(_a, gap, options8)) ?? /^[\s(]*$/u.test(gap)) { + gapEndPos = options8.locStart(comment); + } else { + break; + } + } + for (const [i, { comment }] of tiesToBreak.entries()) { + if (i < indexOfFirstLeadingComment) { + addTrailingComment(precedingNode, comment); + } else { + addLeadingComment(followingNode, comment); + } + } + for (const node of [precedingNode, followingNode]) { + if (node.comments && node.comments.length > 1) { + node.comments.sort((a, b) => options8.locStart(a) - options8.locStart(b)); + } + } + tiesToBreak.length = 0; +} +function findExpressionIndexForComment(quasis, comment, options8) { + const startPos = options8.locStart(comment) - 1; + for (let i = 1; i < quasis.length; ++i) { + if (startPos < options8.locStart(quasis[i])) { + return i - 1; + } + } + return 0; +} + +// src/utils/is-previous-line-empty.js +function isPreviousLineEmpty(text, startIndex) { + let idx = startIndex - 1; + idx = skipSpaces(text, idx, { backwards: true }); + idx = skip_newline_default(text, idx, { backwards: true }); + idx = skipSpaces(text, idx, { backwards: true }); + const idx2 = skip_newline_default(text, idx, { backwards: true }); + return idx !== idx2; +} +var is_previous_line_empty_default = isPreviousLineEmpty; + +// src/main/comments/print.js +function printComment(path13, options8) { + const comment = path13.node; + comment.printed = true; + return options8.printer.printComment(path13, options8); +} +function printLeadingComment(path13, options8) { + var _a; + const comment = path13.node; + const parts = [printComment(path13, options8)]; + const { printer, originalText, locStart, locEnd } = options8; + const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment); + if (isBlock) { + const lineBreak = has_newline_default(originalText, locEnd(comment)) ? has_newline_default(originalText, locStart(comment), { + backwards: true + }) ? hardline : line2 : " "; + parts.push(lineBreak); + } else { + parts.push(hardline); + } + const index = skip_newline_default( + originalText, + skipSpaces(originalText, locEnd(comment)) + ); + if (index !== false && has_newline_default(originalText, index)) { + parts.push(hardline); + } + return parts; +} +function printTrailingComment(path13, options8, previousComment) { + var _a; + const comment = path13.node; + const printed = printComment(path13, options8); + const { printer, originalText, locStart } = options8; + const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment); + if ((previousComment == null ? void 0 : previousComment.hasLineSuffix) && !(previousComment == null ? void 0 : previousComment.isBlock) || has_newline_default(originalText, locStart(comment), { backwards: true })) { + const isLineBeforeEmpty = is_previous_line_empty_default( + originalText, + locStart(comment) + ); + return { + doc: lineSuffix([hardline, isLineBeforeEmpty ? hardline : "", printed]), + isBlock, + hasLineSuffix: true + }; + } + if (!isBlock || (previousComment == null ? void 0 : previousComment.hasLineSuffix)) { + return { + doc: [lineSuffix([" ", printed]), breakParent], + isBlock, + hasLineSuffix: true + }; + } + return { doc: [" ", printed], isBlock, hasLineSuffix: false }; +} +function printCommentsSeparately(path13, options8) { + const value = path13.node; + if (!value) { + return {}; + } + const ignored = options8[Symbol.for("printedComments")]; + const comments = (value.comments || []).filter( + (comment) => !ignored.has(comment) + ); + if (comments.length === 0) { + return { leading: "", trailing: "" }; + } + const leadingParts = []; + const trailingParts = []; + let printedTrailingComment; + path13.each(() => { + const comment = path13.node; + if (ignored == null ? void 0 : ignored.has(comment)) { + return; + } + const { leading, trailing } = comment; + if (leading) { + leadingParts.push(printLeadingComment(path13, options8)); + } else if (trailing) { + printedTrailingComment = printTrailingComment( + path13, + options8, + printedTrailingComment + ); + trailingParts.push(printedTrailingComment.doc); + } + }, "comments"); + return { leading: leadingParts, trailing: trailingParts }; +} +function printComments(path13, doc2, options8) { + const { leading, trailing } = printCommentsSeparately(path13, options8); + if (!leading && !trailing) { + return doc2; + } + return inheritLabel(doc2, (doc3) => [leading, doc3, trailing]); +} +function ensureAllCommentsPrinted(options8) { + const { + [Symbol.for("comments")]: comments, + [Symbol.for("printedComments")]: printedComments + } = options8; + for (const comment of comments) { + if (!comment.printed && !printedComments.has(comment)) { + throw new Error( + 'Comment "' + comment.value.trim() + '" was not printed. Please report this error!' + ); + } + delete comment.printed; + } +} + +// src/main/create-print-pre-check-function.js +function createPrintPreCheckFunction(options8) { + if (true) { + return () => { + }; + } + const getVisitorKeys = create_get_visitor_keys_function_default( + options8.printer.getVisitorKeys + ); + return function(path13) { + if (path13.isRoot) { + return; + } + const { key: key2, parent } = path13; + const visitorKeys = getVisitorKeys(parent); + if (visitorKeys.includes(key2)) { + return; + } + throw Object.assign(new Error("Calling `print()` on non-node object."), { + parentNode: parent, + allowedProperties: visitorKeys, + printingProperty: key2, + printingValue: path13.node, + pathStack: path13.stack.length > 5 ? ["...", ...path13.stack.slice(-5)] : [...path13.stack] + }); + }; +} +var create_print_pre_check_function_default = createPrintPreCheckFunction; + +// src/main/core-options.evaluate.js +var core_options_evaluate_default = { + "cursorOffset": { + "category": "Special", + "type": "int", + "default": -1, + "range": { + "start": -1, + "end": Infinity, + "step": 1 + }, + "description": "Print (to stderr) where a cursor at the given position would move to after formatting.", + "cliCategory": "Editor" + }, + "endOfLine": { + "category": "Global", + "type": "choice", + "default": "lf", + "description": "Which end of line characters to apply.", + "choices": [ + { + "value": "lf", + "description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos" + }, + { + "value": "crlf", + "description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows" + }, + { + "value": "cr", + "description": "Carriage Return character only (\\r), used very rarely" + }, + { + "value": "auto", + "description": "Maintain existing\n(mixed values within one file are normalised by looking at what's used after the first line)" + } + ] + }, + "filepath": { + "category": "Special", + "type": "path", + "description": "Specify the input filepath. This will be used to do parser inference.", + "cliName": "stdin-filepath", + "cliCategory": "Other", + "cliDescription": "Path to the file to pretend that stdin comes from." + }, + "insertPragma": { + "category": "Special", + "type": "boolean", + "default": false, + "description": "Insert @format pragma into file's first docblock comment.", + "cliCategory": "Other" + }, + "parser": { + "category": "Global", + "type": "choice", + "default": void 0, + "description": "Which parser to use.", + "exception": (value) => typeof value === "string" || typeof value === "function", + "choices": [ + { + "value": "flow", + "description": "Flow" + }, + { + "value": "babel", + "description": "JavaScript" + }, + { + "value": "babel-flow", + "description": "Flow" + }, + { + "value": "babel-ts", + "description": "TypeScript" + }, + { + "value": "typescript", + "description": "TypeScript" + }, + { + "value": "acorn", + "description": "JavaScript" + }, + { + "value": "espree", + "description": "JavaScript" + }, + { + "value": "meriyah", + "description": "JavaScript" + }, + { + "value": "css", + "description": "CSS" + }, + { + "value": "less", + "description": "Less" + }, + { + "value": "scss", + "description": "SCSS" + }, + { + "value": "json", + "description": "JSON" + }, + { + "value": "json5", + "description": "JSON5" + }, + { + "value": "jsonc", + "description": "JSON with Comments" + }, + { + "value": "json-stringify", + "description": "JSON.stringify" + }, + { + "value": "graphql", + "description": "GraphQL" + }, + { + "value": "markdown", + "description": "Markdown" + }, + { + "value": "mdx", + "description": "MDX" + }, + { + "value": "vue", + "description": "Vue" + }, + { + "value": "yaml", + "description": "YAML" + }, + { + "value": "glimmer", + "description": "Ember / Handlebars" + }, + { + "value": "html", + "description": "HTML" + }, + { + "value": "angular", + "description": "Angular" + }, + { + "value": "lwc", + "description": "Lightning Web Components" + } + ] + }, + "plugins": { + "type": "path", + "array": true, + "default": [ + { + "value": [] + } + ], + "category": "Global", + "description": "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.", + "exception": (value) => typeof value === "string" || typeof value === "object", + "cliName": "plugin", + "cliCategory": "Config" + }, + "printWidth": { + "category": "Global", + "type": "int", + "default": 80, + "description": "The line length where Prettier will try wrap.", + "range": { + "start": 0, + "end": Infinity, + "step": 1 + } + }, + "rangeEnd": { + "category": "Special", + "type": "int", + "default": Infinity, + "range": { + "start": 0, + "end": Infinity, + "step": 1 + }, + "description": "Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.", + "cliCategory": "Editor" + }, + "rangeStart": { + "category": "Special", + "type": "int", + "default": 0, + "range": { + "start": 0, + "end": Infinity, + "step": 1 + }, + "description": "Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.", + "cliCategory": "Editor" + }, + "requirePragma": { + "category": "Special", + "type": "boolean", + "default": false, + "description": "Require either '@prettier' or '@format' to be present in the file's first docblock comment\nin order for it to be formatted.", + "cliCategory": "Other" + }, + "tabWidth": { + "type": "int", + "category": "Global", + "default": 2, + "description": "Number of spaces per indentation level.", + "range": { + "start": 0, + "end": Infinity, + "step": 1 + } + }, + "useTabs": { + "category": "Global", + "type": "boolean", + "default": false, + "description": "Indent with tabs instead of spaces." + }, + "embeddedLanguageFormatting": { + "category": "Global", + "type": "choice", + "default": "auto", + "description": "Control how Prettier formats quoted code embedded in the file.", + "choices": [ + { + "value": "auto", + "description": "Format embedded code if Prettier can automatically identify it." + }, + { + "value": "off", + "description": "Never automatically format embedded code." + } + ] + } +}; + +// src/main/support.js +function getSupportInfo({ plugins = [], showDeprecated = false } = {}) { + const languages2 = plugins.flatMap((plugin) => plugin.languages ?? []); + const options8 = []; + for (const option of normalizeOptionSettings( + Object.assign({}, ...plugins.map(({ options: options9 }) => options9), core_options_evaluate_default) + )) { + if (!showDeprecated && option.deprecated) { + continue; + } + if (Array.isArray(option.choices)) { + if (!showDeprecated) { + option.choices = option.choices.filter((choice) => !choice.deprecated); + } + if (option.name === "parser") { + option.choices = [ + ...option.choices, + ...collectParsersFromLanguages(option.choices, languages2, plugins) + ]; + } + } + option.pluginDefaults = Object.fromEntries( + plugins.filter((plugin) => { + var _a; + return ((_a = plugin.defaultOptions) == null ? void 0 : _a[option.name]) !== void 0; + }).map((plugin) => [plugin.name, plugin.defaultOptions[option.name]]) + ); + options8.push(option); + } + return { languages: languages2, options: options8 }; +} +function* collectParsersFromLanguages(parserChoices, languages2, plugins) { + const existingParsers = new Set(parserChoices.map((choice) => choice.value)); + for (const language of languages2) { + if (language.parsers) { + for (const parserName of language.parsers) { + if (!existingParsers.has(parserName)) { + existingParsers.add(parserName); + const plugin = plugins.find( + (plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName) + ); + let description = language.name; + if (plugin == null ? void 0 : plugin.name) { + description += ` (plugin: ${plugin.name})`; + } + yield { value: parserName, description }; + } + } + } + } +} +function normalizeOptionSettings(settings) { + const options8 = []; + for (const [name, originalOption] of Object.entries(settings)) { + const option = { name, ...originalOption }; + if (Array.isArray(option.default)) { + option.default = at_default( + /* isOptionalObject */ + false, + option.default, + -1 + ).value; + } + options8.push(option); + } + return options8; +} + +// src/main/normalize-options.js +var hasDeprecationWarned; +function normalizeOptions(options8, optionInfos, { + logger = false, + isCLI = false, + passThrough = false, + FlagSchema, + descriptor +} = {}) { + if (isCLI) { + if (!FlagSchema) { + throw new Error("'FlagSchema' option is required."); + } + if (!descriptor) { + throw new Error("'descriptor' option is required."); + } + } else { + descriptor = apiDescriptor; + } + const unknown = !passThrough ? (key2, value, options9) => { + const { _, ...schemas2 } = options9.schemas; + return levenUnknownHandler(key2, value, { + ...options9, + schemas: schemas2 + }); + } : Array.isArray(passThrough) ? (key2, value) => !passThrough.includes(key2) ? void 0 : { [key2]: value } : (key2, value) => ({ [key2]: value }); + const schemas = optionInfosToSchemas(optionInfos, { isCLI, FlagSchema }); + const normalizer = new Normalizer(schemas, { + logger, + unknown, + descriptor + }); + const shouldSuppressDuplicateDeprecationWarnings = logger !== false; + if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) { + normalizer._hasDeprecationWarned = hasDeprecationWarned; + } + const normalized = normalizer.normalize(options8); + if (shouldSuppressDuplicateDeprecationWarnings) { + hasDeprecationWarned = normalizer._hasDeprecationWarned; + } + return normalized; +} +function optionInfosToSchemas(optionInfos, { isCLI, FlagSchema }) { + const schemas = []; + if (isCLI) { + schemas.push(AnySchema.create({ name: "_" })); + } + for (const optionInfo of optionInfos) { + schemas.push( + optionInfoToSchema(optionInfo, { + isCLI, + optionInfos, + FlagSchema + }) + ); + if (optionInfo.alias && isCLI) { + schemas.push( + AliasSchema.create({ + // @ts-expect-error + name: optionInfo.alias, + sourceName: optionInfo.name + }) + ); + } + } + return schemas; +} +function optionInfoToSchema(optionInfo, { isCLI, optionInfos, FlagSchema }) { + const { name } = optionInfo; + const parameters = { name }; + let SchemaConstructor; + const handlers = {}; + switch (optionInfo.type) { + case "int": + SchemaConstructor = IntegerSchema; + if (isCLI) { + parameters.preprocess = Number; + } + break; + case "string": + SchemaConstructor = StringSchema; + break; + case "choice": + SchemaConstructor = ChoiceSchema; + parameters.choices = optionInfo.choices.map( + (choiceInfo) => (choiceInfo == null ? void 0 : choiceInfo.redirect) ? { + ...choiceInfo, + redirect: { + to: { key: optionInfo.name, value: choiceInfo.redirect } + } + } : choiceInfo + ); + break; + case "boolean": + SchemaConstructor = BooleanSchema; + break; + case "flag": + SchemaConstructor = FlagSchema; + parameters.flags = optionInfos.flatMap( + (optionInfo2) => [ + optionInfo2.alias, + optionInfo2.description && optionInfo2.name, + optionInfo2.oppositeDescription && `no-${optionInfo2.name}` + ].filter(Boolean) + ); + break; + case "path": + SchemaConstructor = StringSchema; + break; + default: + throw new Error(`Unexpected type ${optionInfo.type}`); + } + if (optionInfo.exception) { + parameters.validate = (value, schema2, utils) => optionInfo.exception(value) || schema2.validate(value, utils); + } else { + parameters.validate = (value, schema2, utils) => value === void 0 || schema2.validate(value, utils); + } + if (optionInfo.redirect) { + handlers.redirect = (value) => !value ? void 0 : { + to: typeof optionInfo.redirect === "string" ? optionInfo.redirect : { + key: optionInfo.redirect.option, + value: optionInfo.redirect.value + } + }; + } + if (optionInfo.deprecated) { + handlers.deprecated = true; + } + if (isCLI && !optionInfo.array) { + const originalPreprocess = parameters.preprocess || ((x) => x); + parameters.preprocess = (value, schema2, utils) => schema2.preprocess( + originalPreprocess(Array.isArray(value) ? at_default( + /* isOptionalObject */ + false, + value, + -1 + ) : value), + utils + ); + } + return optionInfo.array ? ArraySchema.create({ + ...isCLI ? { preprocess: (v) => Array.isArray(v) ? v : [v] } : {}, + ...handlers, + // @ts-expect-error + valueSchema: SchemaConstructor.create(parameters) + }) : SchemaConstructor.create({ ...parameters, ...handlers }); +} +var normalize_options_default = normalizeOptions; + +// scripts/build/shims/array-find-last.js +var arrayFindLast = (isOptionalObject, array2, callback) => { + if (isOptionalObject && (array2 === void 0 || array2 === null)) { + return; + } + if (array2.findLast) { + return array2.findLast(callback); + } + for (let index = array2.length - 1; index >= 0; index--) { + const element = array2[index]; + if (callback(element, index, array2)) { + return element; + } + } +}; +var array_find_last_default = arrayFindLast; + +// src/main/parser-and-printer.js +function getParserPluginByParserName(plugins, parserName) { + if (!parserName) { + throw new Error("parserName is required."); + } + const plugin = array_find_last_default( + /* isOptionalObject */ + false, + plugins, + (plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName) + ); + if (plugin) { + return plugin; + } + let message = `Couldn't resolve parser "${parserName}".`; + if (false) { + message += " Plugins must be explicitly added to the standalone bundle."; + } + throw new ConfigError(message); +} +function getPrinterPluginByAstFormat(plugins, astFormat) { + if (!astFormat) { + throw new Error("astFormat is required."); + } + const plugin = array_find_last_default( + /* isOptionalObject */ + false, + plugins, + (plugin2) => plugin2.printers && Object.prototype.hasOwnProperty.call(plugin2.printers, astFormat) + ); + if (plugin) { + return plugin; + } + let message = `Couldn't find plugin for AST format "${astFormat}".`; + if (false) { + message += " Plugins must be explicitly added to the standalone bundle."; + } + throw new ConfigError(message); +} +function resolveParser({ plugins, parser }) { + const plugin = getParserPluginByParserName(plugins, parser); + return initParser(plugin, parser); +} +function initParser(plugin, parserName) { + const parserOrParserInitFunction = plugin.parsers[parserName]; + return typeof parserOrParserInitFunction === "function" ? parserOrParserInitFunction() : parserOrParserInitFunction; +} +function initPrinter(plugin, astFormat) { + const printerOrPrinterInitFunction = plugin.printers[astFormat]; + return typeof printerOrPrinterInitFunction === "function" ? printerOrPrinterInitFunction() : printerOrPrinterInitFunction; +} + +// src/main/normalize-format-options.js +var formatOptionsHiddenDefaults = { + astFormat: "estree", + printer: {}, + originalText: void 0, + locStart: null, + locEnd: null +}; +async function normalizeFormatOptions(options8, opts = {}) { + var _a; + const rawOptions = { ...options8 }; + if (!rawOptions.parser) { + if (!rawOptions.filepath) { + throw new UndefinedParserError( + "No parser and no file path given, couldn't infer a parser." + ); + } else { + rawOptions.parser = infer_parser_default(rawOptions, { + physicalFile: rawOptions.filepath + }); + if (!rawOptions.parser) { + throw new UndefinedParserError( + `No parser could be inferred for file "${rawOptions.filepath}".` + ); + } + } + } + const supportOptions = getSupportInfo({ + plugins: options8.plugins, + showDeprecated: true + }).options; + const defaults = { + ...formatOptionsHiddenDefaults, + ...Object.fromEntries( + supportOptions.filter((optionInfo) => optionInfo.default !== void 0).map((option) => [option.name, option.default]) + ) + }; + const parserPlugin = getParserPluginByParserName( + rawOptions.plugins, + rawOptions.parser + ); + const parser = await initParser(parserPlugin, rawOptions.parser); + rawOptions.astFormat = parser.astFormat; + rawOptions.locEnd = parser.locEnd; + rawOptions.locStart = parser.locStart; + const printerPlugin = ((_a = parserPlugin.printers) == null ? void 0 : _a[parser.astFormat]) ? parserPlugin : getPrinterPluginByAstFormat(rawOptions.plugins, parser.astFormat); + const printer = await initPrinter(printerPlugin, parser.astFormat); + rawOptions.printer = printer; + const pluginDefaults = printerPlugin.defaultOptions ? Object.fromEntries( + Object.entries(printerPlugin.defaultOptions).filter( + ([, value]) => value !== void 0 + ) + ) : {}; + const mixedDefaults = { ...defaults, ...pluginDefaults }; + for (const [k, value] of Object.entries(mixedDefaults)) { + if (rawOptions[k] === null || rawOptions[k] === void 0) { + rawOptions[k] = value; + } + } + if (rawOptions.parser === "json") { + rawOptions.trailingComma = "none"; + } + return normalize_options_default(rawOptions, supportOptions, { + passThrough: Object.keys(formatOptionsHiddenDefaults), + ...opts + }); +} +var normalize_format_options_default = normalizeFormatOptions; + +// src/main/parse.js +var import_code_frame2 = __toESM(require_lib2(), 1); +async function parse5(originalText, options8) { + const parser = await resolveParser(options8); + const text = parser.preprocess ? parser.preprocess(originalText, options8) : originalText; + options8.originalText = text; + let ast; + try { + ast = await parser.parse( + text, + options8, + // TODO: remove the third argument in v4 + // The duplicated argument is passed as intended, see #10156 + options8 + ); + } catch (error) { + handleParseError(error, originalText); + } + return { text, ast }; +} +function handleParseError(error, text) { + const { loc } = error; + if (loc) { + const codeFrame = (0, import_code_frame2.codeFrameColumns)(text, loc, { highlightCode: true }); + error.message += "\n" + codeFrame; + error.codeFrame = codeFrame; + throw error; + } + throw error; +} +var parse_default = parse5; + +// src/main/multiparser.js +async function printEmbeddedLanguages(path13, genericPrint, options8, printAstToDoc2, embeds) { + const { + embeddedLanguageFormatting, + printer: { + embed, + hasPrettierIgnore = () => false, + getVisitorKeys: printerGetVisitorKeys + } + } = options8; + if (!embed || embeddedLanguageFormatting !== "auto") { + return; + } + if (embed.length > 2) { + throw new Error( + "printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed" + ); + } + const getVisitorKeys = create_get_visitor_keys_function_default( + embed.getVisitorKeys ?? printerGetVisitorKeys + ); + const embedCallResults = []; + recurse(); + const originalPathStack = path13.stack; + for (const { print, node, pathStack } of embedCallResults) { + try { + path13.stack = pathStack; + const doc2 = await print(textToDocForEmbed, genericPrint, path13, options8); + if (doc2) { + embeds.set(node, doc2); + } + } catch (error) { + if (process.env.PRETTIER_DEBUG) { + throw error; + } + } + } + path13.stack = originalPathStack; + function textToDocForEmbed(text, partialNextOptions) { + return textToDoc(text, partialNextOptions, options8, printAstToDoc2); + } + function recurse() { + const { node } = path13; + if (node === null || typeof node !== "object" || hasPrettierIgnore(path13)) { + return; + } + for (const key2 of getVisitorKeys(node)) { + if (Array.isArray(node[key2])) { + path13.each(recurse, key2); + } else { + path13.call(recurse, key2); + } + } + const result = embed(path13, options8); + if (!result) { + return; + } + if (typeof result === "function") { + embedCallResults.push({ + print: result, + node, + pathStack: [...path13.stack] + }); + return; + } + if (false) { + throw new Error( + "`embed` should return an async function instead of Promise." + ); + } + embeds.set(node, result); + } +} +async function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc2) { + const options8 = await normalize_format_options_default( + { + ...parentOptions, + ...partialNextOptions, + parentParser: parentOptions.parser, + originalText: text + }, + { passThrough: true } + ); + const { ast } = await parse_default(text, options8); + const doc2 = await printAstToDoc2(ast, options8); + return stripTrailingHardline(doc2); +} + +// src/main/print-ignored.js +function printIgnored(path13, options8) { + const { + originalText, + [Symbol.for("comments")]: comments, + locStart, + locEnd, + [Symbol.for("printedComments")]: printedComments + } = options8; + const { node } = path13; + const start = locStart(node); + const end = locEnd(node); + for (const comment of comments) { + if (locStart(comment) >= start && locEnd(comment) <= end) { + printedComments.add(comment); + } + } + return originalText.slice(start, end); +} +var print_ignored_default = printIgnored; + +// src/main/ast-to-doc.js +async function printAstToDoc(ast, options8) { + ({ ast } = await prepareToPrint(ast, options8)); + const cache3 = /* @__PURE__ */ new Map(); + const path13 = new ast_path_default(ast); + const ensurePrintingNode = create_print_pre_check_function_default(options8); + const embeds = /* @__PURE__ */ new Map(); + await printEmbeddedLanguages(path13, mainPrint, options8, printAstToDoc, embeds); + const doc2 = await callPluginPrintFunction( + path13, + options8, + mainPrint, + void 0, + embeds + ); + ensureAllCommentsPrinted(options8); + if (options8.nodeAfterCursor && !options8.nodeBeforeCursor) { + return [cursor, doc2]; + } + if (options8.nodeBeforeCursor && !options8.nodeAfterCursor) { + return [doc2, cursor]; + } + return doc2; + function mainPrint(selector, args) { + if (selector === void 0 || selector === path13) { + return mainPrintInternal(args); + } + if (Array.isArray(selector)) { + return path13.call(() => mainPrintInternal(args), ...selector); + } + return path13.call(() => mainPrintInternal(args), selector); + } + function mainPrintInternal(args) { + ensurePrintingNode(path13); + const value = path13.node; + if (value === void 0 || value === null) { + return ""; + } + const shouldCache = value && typeof value === "object" && args === void 0; + if (shouldCache && cache3.has(value)) { + return cache3.get(value); + } + const doc3 = callPluginPrintFunction(path13, options8, mainPrint, args, embeds); + if (shouldCache) { + cache3.set(value, doc3); + } + return doc3; + } +} +function callPluginPrintFunction(path13, options8, printPath, args, embeds) { + var _a; + const { node } = path13; + const { printer } = options8; + let doc2; + if ((_a = printer.hasPrettierIgnore) == null ? void 0 : _a.call(printer, path13)) { + doc2 = print_ignored_default(path13, options8); + } else if (embeds.has(node)) { + doc2 = embeds.get(node); + } else { + doc2 = printer.print(path13, options8, printPath, args); + } + switch (node) { + case options8.cursorNode: + doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3, cursor]); + break; + case options8.nodeBeforeCursor: + doc2 = inheritLabel(doc2, (doc3) => [doc3, cursor]); + break; + case options8.nodeAfterCursor: + doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3]); + break; + } + if (printer.printComment && (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path13, options8))) { + doc2 = printComments(path13, doc2, options8); + } + return doc2; +} +async function prepareToPrint(ast, options8) { + const comments = ast.comments ?? []; + options8[Symbol.for("comments")] = comments; + options8[Symbol.for("tokens")] = ast.tokens ?? []; + options8[Symbol.for("printedComments")] = /* @__PURE__ */ new Set(); + attachComments(ast, options8); + const { + printer: { preprocess } + } = options8; + ast = preprocess ? await preprocess(ast, options8) : ast; + return { ast, comments }; +} + +// src/main/get-cursor-node.js +function getCursorLocation(ast, options8) { + const { cursorOffset, locStart, locEnd } = options8; + const getVisitorKeys = create_get_visitor_keys_function_default( + options8.printer.getVisitorKeys + ); + const nodeContainsCursor = (node) => locStart(node) <= cursorOffset && locEnd(node) >= cursorOffset; + let cursorNode = ast; + const nodesContainingCursor = [ast]; + for (const node of getDescendants(ast, { + getVisitorKeys, + filter: nodeContainsCursor + })) { + nodesContainingCursor.push(node); + cursorNode = node; + } + if (isLeaf(cursorNode, { getVisitorKeys })) { + return { cursorNode }; + } + let nodeBeforeCursor; + let nodeAfterCursor; + let nodeBeforeCursorEndIndex = -1; + let nodeAfterCursorStartIndex = Number.POSITIVE_INFINITY; + while (nodesContainingCursor.length > 0 && (nodeBeforeCursor === void 0 || nodeAfterCursor === void 0)) { + cursorNode = nodesContainingCursor.pop(); + const foundBeforeNode = nodeBeforeCursor !== void 0; + const foundAfterNode = nodeAfterCursor !== void 0; + for (const node of getChildren(cursorNode, { getVisitorKeys })) { + if (!foundBeforeNode) { + const nodeEnd = locEnd(node); + if (nodeEnd <= cursorOffset && nodeEnd > nodeBeforeCursorEndIndex) { + nodeBeforeCursor = node; + nodeBeforeCursorEndIndex = nodeEnd; + } + } + if (!foundAfterNode) { + const nodeStart = locStart(node); + if (nodeStart >= cursorOffset && nodeStart < nodeAfterCursorStartIndex) { + nodeAfterCursor = node; + nodeAfterCursorStartIndex = nodeStart; + } + } + } + } + return { + nodeBeforeCursor, + nodeAfterCursor + }; +} +var get_cursor_node_default = getCursorLocation; + +// src/main/massage-ast.js +function massageAst(ast, options8) { + const { + printer: { + massageAstNode: cleanFunction, + getVisitorKeys: printerGetVisitorKeys + } + } = options8; + if (!cleanFunction) { + return ast; + } + const getVisitorKeys = create_get_visitor_keys_function_default(printerGetVisitorKeys); + const ignoredProperties = cleanFunction.ignoredProperties ?? /* @__PURE__ */ new Set(); + return recurse(ast); + function recurse(original, parent) { + if (!(original !== null && typeof original === "object")) { + return original; + } + if (Array.isArray(original)) { + return original.map((child) => recurse(child, parent)).filter(Boolean); + } + const cloned = {}; + const childrenKeys = new Set(getVisitorKeys(original)); + for (const key2 in original) { + if (!Object.prototype.hasOwnProperty.call(original, key2) || ignoredProperties.has(key2)) { + continue; + } + if (childrenKeys.has(key2)) { + cloned[key2] = recurse(original[key2], original); + } else { + cloned[key2] = original[key2]; + } + } + const result = cleanFunction(original, cloned, parent); + if (result === null) { + return; + } + return result ?? cloned; + } +} +var massage_ast_default = massageAst; + +// scripts/build/shims/array-find-last-index.js +var arrayFindLastIndex = (isOptionalObject, array2, callback) => { + if (isOptionalObject && (array2 === void 0 || array2 === null)) { + return; + } + if (array2.findLastIndex) { + return array2.findLastIndex(callback); + } + for (let index = array2.length - 1; index >= 0; index--) { + const element = array2[index]; + if (callback(element, index, array2)) { + return index; + } + } + return -1; +}; +var array_find_last_index_default = arrayFindLastIndex; + +// src/main/range-util.js +import assert5 from "assert"; +var isJsonParser = ({ parser }) => parser === "json" || parser === "json5" || parser === "jsonc" || parser === "json-stringify"; +function findCommonAncestor(startNodeAndParents, endNodeAndParents) { + const startNodeAndAncestors = [ + startNodeAndParents.node, + ...startNodeAndParents.parentNodes + ]; + const endNodeAndAncestors = /* @__PURE__ */ new Set([ + endNodeAndParents.node, + ...endNodeAndParents.parentNodes + ]); + return startNodeAndAncestors.find( + (node) => jsonSourceElements.has(node.type) && endNodeAndAncestors.has(node) + ); +} +function dropRootParents(parents) { + const index = array_find_last_index_default( + /* isOptionalObject */ + false, + parents, + (node) => node.type !== "Program" && node.type !== "File" + ); + if (index === -1) { + return parents; + } + return parents.slice(0, index + 1); +} +function findSiblingAncestors(startNodeAndParents, endNodeAndParents, { locStart, locEnd }) { + let resultStartNode = startNodeAndParents.node; + let resultEndNode = endNodeAndParents.node; + if (resultStartNode === resultEndNode) { + return { + startNode: resultStartNode, + endNode: resultEndNode + }; + } + const startNodeStart = locStart(startNodeAndParents.node); + for (const endParent of dropRootParents(endNodeAndParents.parentNodes)) { + if (locStart(endParent) >= startNodeStart) { + resultEndNode = endParent; + } else { + break; + } + } + const endNodeEnd = locEnd(endNodeAndParents.node); + for (const startParent of dropRootParents(startNodeAndParents.parentNodes)) { + if (locEnd(startParent) <= endNodeEnd) { + resultStartNode = startParent; + } else { + break; + } + if (resultStartNode === resultEndNode) { + break; + } + } + return { + startNode: resultStartNode, + endNode: resultEndNode + }; +} +function findNodeAtOffset(node, offset, options8, predicate, parentNodes = [], type2) { + const { locStart, locEnd } = options8; + const start = locStart(node); + const end = locEnd(node); + if (offset > end || offset < start || type2 === "rangeEnd" && offset === start || type2 === "rangeStart" && offset === end) { + return; + } + for (const childNode of getSortedChildNodes(node, options8)) { + const childResult = findNodeAtOffset( + childNode, + offset, + options8, + predicate, + [node, ...parentNodes], + type2 + ); + if (childResult) { + return childResult; + } + } + if (!predicate || predicate(node, parentNodes[0])) { + return { + node, + parentNodes + }; + } +} +function isJsSourceElement(type2, parentType) { + return parentType !== "DeclareExportDeclaration" && type2 !== "TypeParameterDeclaration" && (type2 === "Directive" || type2 === "TypeAlias" || type2 === "TSExportAssignment" || type2.startsWith("Declare") || type2.startsWith("TSDeclare") || type2.endsWith("Statement") || type2.endsWith("Declaration")); +} +var jsonSourceElements = /* @__PURE__ */ new Set([ + "JsonRoot", + "ObjectExpression", + "ArrayExpression", + "StringLiteral", + "NumericLiteral", + "BooleanLiteral", + "NullLiteral", + "UnaryExpression", + "TemplateLiteral" +]); +var graphqlSourceElements = /* @__PURE__ */ new Set([ + "OperationDefinition", + "FragmentDefinition", + "VariableDefinition", + "TypeExtensionDefinition", + "ObjectTypeDefinition", + "FieldDefinition", + "DirectiveDefinition", + "EnumTypeDefinition", + "EnumValueDefinition", + "InputValueDefinition", + "InputObjectTypeDefinition", + "SchemaDefinition", + "OperationTypeDefinition", + "InterfaceTypeDefinition", + "UnionTypeDefinition", + "ScalarTypeDefinition" +]); +function isSourceElement(opts, node, parentNode) { + if (!node) { + return false; + } + switch (opts.parser) { + case "flow": + case "babel": + case "babel-flow": + case "babel-ts": + case "typescript": + case "acorn": + case "espree": + case "meriyah": + case "__babel_estree": + return isJsSourceElement(node.type, parentNode == null ? void 0 : parentNode.type); + case "json": + case "json5": + case "jsonc": + case "json-stringify": + return jsonSourceElements.has(node.type); + case "graphql": + return graphqlSourceElements.has(node.kind); + case "vue": + return node.tag !== "root"; + } + return false; +} +function calculateRange(text, opts, ast) { + let { rangeStart: start, rangeEnd: end, locStart, locEnd } = opts; + assert5.ok(end > start); + const firstNonWhitespaceCharacterIndex = text.slice(start, end).search(/\S/u); + const isAllWhitespace = firstNonWhitespaceCharacterIndex === -1; + if (!isAllWhitespace) { + start += firstNonWhitespaceCharacterIndex; + for (; end > start; --end) { + if (/\S/u.test(text[end - 1])) { + break; + } + } + } + const startNodeAndParents = findNodeAtOffset( + ast, + start, + opts, + (node, parentNode) => isSourceElement(opts, node, parentNode), + [], + "rangeStart" + ); + const endNodeAndParents = ( + // No need find Node at `end`, it will be the same as `startNodeAndParents` + isAllWhitespace ? startNodeAndParents : findNodeAtOffset( + ast, + end, + opts, + (node) => isSourceElement(opts, node), + [], + "rangeEnd" + ) + ); + if (!startNodeAndParents || !endNodeAndParents) { + return { + rangeStart: 0, + rangeEnd: 0 + }; + } + let startNode; + let endNode; + if (isJsonParser(opts)) { + const commonAncestor = findCommonAncestor( + startNodeAndParents, + endNodeAndParents + ); + startNode = commonAncestor; + endNode = commonAncestor; + } else { + ({ startNode, endNode } = findSiblingAncestors( + startNodeAndParents, + endNodeAndParents, + opts + )); + } + return { + rangeStart: Math.min(locStart(startNode), locStart(endNode)), + rangeEnd: Math.max(locEnd(startNode), locEnd(endNode)) + }; +} + +// src/main/core.js +var BOM = "\uFEFF"; +var CURSOR = Symbol("cursor"); +async function coreFormat(originalText, opts, addAlignmentSize = 0) { + if (!originalText || originalText.trim().length === 0) { + return { formatted: "", cursorOffset: -1, comments: [] }; + } + const { ast, text } = await parse_default(originalText, opts); + if (opts.cursorOffset >= 0) { + opts = { + ...opts, + ...get_cursor_node_default(ast, opts) + }; + } + let doc2 = await printAstToDoc(ast, opts, addAlignmentSize); + if (addAlignmentSize > 0) { + doc2 = addAlignmentToDoc([hardline, doc2], addAlignmentSize, opts.tabWidth); + } + const result = printDocToString(doc2, opts); + if (addAlignmentSize > 0) { + const trimmed = result.formatted.trim(); + if (result.cursorNodeStart !== void 0) { + result.cursorNodeStart -= result.formatted.indexOf(trimmed); + if (result.cursorNodeStart < 0) { + result.cursorNodeStart = 0; + result.cursorNodeText = result.cursorNodeText.trimStart(); + } + if (result.cursorNodeStart + result.cursorNodeText.length > trimmed.length) { + result.cursorNodeText = result.cursorNodeText.trimEnd(); + } + } + result.formatted = trimmed + convertEndOfLineToChars(opts.endOfLine); + } + const comments = opts[Symbol.for("comments")]; + if (opts.cursorOffset >= 0) { + let oldCursorRegionStart; + let oldCursorRegionText; + let newCursorRegionStart; + let newCursorRegionText; + if ((opts.cursorNode || opts.nodeBeforeCursor || opts.nodeAfterCursor) && result.cursorNodeText) { + newCursorRegionStart = result.cursorNodeStart; + newCursorRegionText = result.cursorNodeText; + if (opts.cursorNode) { + oldCursorRegionStart = opts.locStart(opts.cursorNode); + oldCursorRegionText = text.slice( + oldCursorRegionStart, + opts.locEnd(opts.cursorNode) + ); + } else { + if (!opts.nodeBeforeCursor && !opts.nodeAfterCursor) { + throw new Error( + "Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor" + ); + } + oldCursorRegionStart = opts.nodeBeforeCursor ? opts.locEnd(opts.nodeBeforeCursor) : 0; + const oldCursorRegionEnd = opts.nodeAfterCursor ? opts.locStart(opts.nodeAfterCursor) : text.length; + oldCursorRegionText = text.slice( + oldCursorRegionStart, + oldCursorRegionEnd + ); + } + } else { + oldCursorRegionStart = 0; + oldCursorRegionText = text; + newCursorRegionStart = 0; + newCursorRegionText = result.formatted; + } + const cursorOffsetRelativeToOldCursorRegionStart = opts.cursorOffset - oldCursorRegionStart; + if (oldCursorRegionText === newCursorRegionText) { + return { + formatted: result.formatted, + cursorOffset: newCursorRegionStart + cursorOffsetRelativeToOldCursorRegionStart, + comments + }; + } + const oldCursorNodeCharArray = oldCursorRegionText.split(""); + oldCursorNodeCharArray.splice( + cursorOffsetRelativeToOldCursorRegionStart, + 0, + CURSOR + ); + const newCursorNodeCharArray = newCursorRegionText.split(""); + const cursorNodeDiff = diffArrays( + oldCursorNodeCharArray, + newCursorNodeCharArray + ); + let cursorOffset = newCursorRegionStart; + for (const entry of cursorNodeDiff) { + if (entry.removed) { + if (entry.value.includes(CURSOR)) { + break; + } + } else { + cursorOffset += entry.count; + } + } + return { formatted: result.formatted, cursorOffset, comments }; + } + return { formatted: result.formatted, cursorOffset: -1, comments }; +} +async function formatRange(originalText, opts) { + const { ast, text } = await parse_default(originalText, opts); + const { rangeStart, rangeEnd } = calculateRange(text, opts, ast); + const rangeString = text.slice(rangeStart, rangeEnd); + const rangeStart2 = Math.min( + rangeStart, + text.lastIndexOf("\n", rangeStart) + 1 + ); + const indentString = text.slice(rangeStart2, rangeStart).match(/^\s*/u)[0]; + const alignmentSize = get_alignment_size_default(indentString, opts.tabWidth); + const rangeResult = await coreFormat( + rangeString, + { + ...opts, + rangeStart: 0, + rangeEnd: Number.POSITIVE_INFINITY, + // Track the cursor offset only if it's within our range + cursorOffset: opts.cursorOffset > rangeStart && opts.cursorOffset <= rangeEnd ? opts.cursorOffset - rangeStart : -1, + // Always use `lf` to format, we'll replace it later + endOfLine: "lf" + }, + alignmentSize + ); + const rangeTrimmed = rangeResult.formatted.trimEnd(); + let { cursorOffset } = opts; + if (cursorOffset > rangeEnd) { + cursorOffset += rangeTrimmed.length - rangeString.length; + } else if (rangeResult.cursorOffset >= 0) { + cursorOffset = rangeResult.cursorOffset + rangeStart; + } + let formatted = text.slice(0, rangeStart) + rangeTrimmed + text.slice(rangeEnd); + if (opts.endOfLine !== "lf") { + const eol = convertEndOfLineToChars(opts.endOfLine); + if (cursorOffset >= 0 && eol === "\r\n") { + cursorOffset += countEndOfLineChars( + formatted.slice(0, cursorOffset), + "\n" + ); + } + formatted = string_replace_all_default( + /* isOptionalObject */ + false, + formatted, + "\n", + eol + ); + } + return { formatted, cursorOffset, comments: rangeResult.comments }; +} +function ensureIndexInText(text, index, defaultValue) { + if (typeof index !== "number" || Number.isNaN(index) || index < 0 || index > text.length) { + return defaultValue; + } + return index; +} +function normalizeIndexes(text, options8) { + let { cursorOffset, rangeStart, rangeEnd } = options8; + cursorOffset = ensureIndexInText(text, cursorOffset, -1); + rangeStart = ensureIndexInText(text, rangeStart, 0); + rangeEnd = ensureIndexInText(text, rangeEnd, text.length); + return { ...options8, cursorOffset, rangeStart, rangeEnd }; +} +function normalizeInputAndOptions(text, options8) { + let { cursorOffset, rangeStart, rangeEnd, endOfLine } = normalizeIndexes( + text, + options8 + ); + const hasBOM = text.charAt(0) === BOM; + if (hasBOM) { + text = text.slice(1); + cursorOffset--; + rangeStart--; + rangeEnd--; + } + if (endOfLine === "auto") { + endOfLine = guessEndOfLine(text); + } + if (text.includes("\r")) { + const countCrlfBefore = (index) => countEndOfLineChars(text.slice(0, Math.max(index, 0)), "\r\n"); + cursorOffset -= countCrlfBefore(cursorOffset); + rangeStart -= countCrlfBefore(rangeStart); + rangeEnd -= countCrlfBefore(rangeEnd); + text = normalizeEndOfLine(text); + } + return { + hasBOM, + text, + options: normalizeIndexes(text, { + ...options8, + cursorOffset, + rangeStart, + rangeEnd, + endOfLine + }) + }; +} +async function hasPragma(text, options8) { + const selectedParser = await resolveParser(options8); + return !selectedParser.hasPragma || selectedParser.hasPragma(text); +} +async function formatWithCursor(originalText, originalOptions) { + let { hasBOM, text, options: options8 } = normalizeInputAndOptions( + originalText, + await normalize_format_options_default(originalOptions) + ); + if (options8.rangeStart >= options8.rangeEnd && text !== "" || options8.requirePragma && !await hasPragma(text, options8)) { + return { + formatted: originalText, + cursorOffset: originalOptions.cursorOffset, + comments: [] + }; + } + let result; + if (options8.rangeStart > 0 || options8.rangeEnd < text.length) { + result = await formatRange(text, options8); + } else { + if (!options8.requirePragma && options8.insertPragma && options8.printer.insertPragma && !await hasPragma(text, options8)) { + text = options8.printer.insertPragma(text); + } + result = await coreFormat(text, options8); + } + if (hasBOM) { + result.formatted = BOM + result.formatted; + if (result.cursorOffset >= 0) { + result.cursorOffset++; + } + } + return result; +} +async function parse6(originalText, originalOptions, devOptions) { + const { text, options: options8 } = normalizeInputAndOptions( + originalText, + await normalize_format_options_default(originalOptions) + ); + const parsed = await parse_default(text, options8); + if (devOptions) { + if (devOptions.preprocessForPrint) { + parsed.ast = await prepareToPrint(parsed.ast, options8); + } + if (devOptions.massage) { + parsed.ast = massage_ast_default(parsed.ast, options8); + } + } + return parsed; +} +async function formatAst(ast, options8) { + options8 = await normalize_format_options_default(options8); + const doc2 = await printAstToDoc(ast, options8); + return printDocToString(doc2, options8); +} +async function formatDoc(doc2, options8) { + const text = printDocToDebug(doc2); + const { formatted } = await formatWithCursor(text, { + ...options8, + parser: "__js_expression" + }); + return formatted; +} +async function printToDoc(originalText, options8) { + options8 = await normalize_format_options_default(options8); + const { ast } = await parse_default(originalText, options8); + return printAstToDoc(ast, options8); +} +async function printDocToString2(doc2, options8) { + return printDocToString( + doc2, + await normalize_format_options_default(options8) + ); +} + +// src/main/option-categories.js +var option_categories_exports = {}; +__export(option_categories_exports, { + CATEGORY_CONFIG: () => CATEGORY_CONFIG, + CATEGORY_EDITOR: () => CATEGORY_EDITOR, + CATEGORY_FORMAT: () => CATEGORY_FORMAT, + CATEGORY_GLOBAL: () => CATEGORY_GLOBAL, + CATEGORY_OTHER: () => CATEGORY_OTHER, + CATEGORY_OUTPUT: () => CATEGORY_OUTPUT, + CATEGORY_SPECIAL: () => CATEGORY_SPECIAL +}); +var CATEGORY_CONFIG = "Config"; +var CATEGORY_EDITOR = "Editor"; +var CATEGORY_FORMAT = "Format"; +var CATEGORY_OTHER = "Other"; +var CATEGORY_OUTPUT = "Output"; +var CATEGORY_GLOBAL = "Global"; +var CATEGORY_SPECIAL = "Special"; + +// src/plugins/builtin-plugins-proxy.js +var builtin_plugins_proxy_exports = {}; +__export(builtin_plugins_proxy_exports, { + languages: () => languages, + options: () => options7, + parsers: () => parsers, + printers: () => printers +}); + +// src/language-css/languages.evaluate.js +var languages_evaluate_default = [ + { + "linguistLanguageId": 50, + "name": "CSS", + "type": "markup", + "tmScope": "source.css", + "aceMode": "css", + "codemirrorMode": "css", + "codemirrorMimeType": "text/css", + "color": "#563d7c", + "extensions": [ + ".css", + ".wxss" + ], + "parsers": [ + "css" + ], + "vscodeLanguageIds": [ + "css" + ] + }, + { + "linguistLanguageId": 262764437, + "name": "PostCSS", + "type": "markup", + "color": "#dc3a0c", + "tmScope": "source.postcss", + "group": "CSS", + "extensions": [ + ".pcss", + ".postcss" + ], + "aceMode": "text", + "parsers": [ + "css" + ], + "vscodeLanguageIds": [ + "postcss" + ] + }, + { + "linguistLanguageId": 198, + "name": "Less", + "type": "markup", + "color": "#1d365d", + "aliases": [ + "less-css" + ], + "extensions": [ + ".less" + ], + "tmScope": "source.css.less", + "aceMode": "less", + "codemirrorMode": "css", + "codemirrorMimeType": "text/css", + "parsers": [ + "less" + ], + "vscodeLanguageIds": [ + "less" + ] + }, + { + "linguistLanguageId": 329, + "name": "SCSS", + "type": "markup", + "color": "#c6538c", + "tmScope": "source.css.scss", + "aceMode": "scss", + "codemirrorMode": "css", + "codemirrorMimeType": "text/x-scss", + "extensions": [ + ".scss" + ], + "parsers": [ + "scss" + ], + "vscodeLanguageIds": [ + "scss" + ] + } +]; + +// src/common/common-options.evaluate.js +var common_options_evaluate_default = { + "bracketSpacing": { + "category": "Common", + "type": "boolean", + "default": true, + "description": "Print spaces between brackets.", + "oppositeDescription": "Do not print spaces between brackets." + }, + "objectWrap": { + "category": "Common", + "type": "choice", + "default": "preserve", + "description": "How to wrap object literals.", + "choices": [ + { + "value": "preserve", + "description": "Keep as multi-line, if there is a newline between the opening brace and first property." + }, + { + "value": "collapse", + "description": "Fit to a single line when possible." + } + ] + }, + "singleQuote": { + "category": "Common", + "type": "boolean", + "default": false, + "description": "Use single quotes instead of double quotes." + }, + "proseWrap": { + "category": "Common", + "type": "choice", + "default": "preserve", + "description": "How to wrap prose.", + "choices": [ + { + "value": "always", + "description": "Wrap prose if it exceeds the print width." + }, + { + "value": "never", + "description": "Do not wrap prose." + }, + { + "value": "preserve", + "description": "Wrap prose as-is." + } + ] + }, + "bracketSameLine": { + "category": "Common", + "type": "boolean", + "default": false, + "description": "Put > of opening tags on the last line instead of on a new line." + }, + "singleAttributePerLine": { + "category": "Common", + "type": "boolean", + "default": false, + "description": "Enforce single attribute per line in HTML, Vue and JSX." + } +}; + +// src/language-css/options.js +var options = { + singleQuote: common_options_evaluate_default.singleQuote +}; +var options_default = options; + +// src/language-graphql/languages.evaluate.js +var languages_evaluate_default2 = [ + { + "linguistLanguageId": 139, + "name": "GraphQL", + "type": "data", + "color": "#e10098", + "extensions": [ + ".graphql", + ".gql", + ".graphqls" + ], + "tmScope": "source.graphql", + "aceMode": "text", + "parsers": [ + "graphql" + ], + "vscodeLanguageIds": [ + "graphql" + ] + } +]; + +// src/language-graphql/options.js +var options2 = { + bracketSpacing: common_options_evaluate_default.bracketSpacing +}; +var options_default2 = options2; + +// src/language-handlebars/languages.evaluate.js +var languages_evaluate_default3 = [ + { + "linguistLanguageId": 155, + "name": "Handlebars", + "type": "markup", + "color": "#f7931e", + "aliases": [ + "hbs", + "htmlbars" + ], + "extensions": [ + ".handlebars", + ".hbs" + ], + "tmScope": "text.html.handlebars", + "aceMode": "handlebars", + "parsers": [ + "glimmer" + ], + "vscodeLanguageIds": [ + "handlebars" + ] + } +]; + +// src/language-html/languages.evaluate.js +var languages_evaluate_default4 = [ + { + "linguistLanguageId": 146, + "name": "Angular", + "type": "markup", + "tmScope": "text.html.basic", + "aceMode": "html", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "color": "#e34c26", + "aliases": [ + "xhtml" + ], + "extensions": [ + ".component.html" + ], + "parsers": [ + "angular" + ], + "vscodeLanguageIds": [ + "html" + ], + "filenames": [] + }, + { + "linguistLanguageId": 146, + "name": "HTML", + "type": "markup", + "tmScope": "text.html.basic", + "aceMode": "html", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "color": "#e34c26", + "aliases": [ + "xhtml" + ], + "extensions": [ + ".html", + ".hta", + ".htm", + ".html.hl", + ".inc", + ".xht", + ".xhtml", + ".mjml" + ], + "parsers": [ + "html" + ], + "vscodeLanguageIds": [ + "html" + ] + }, + { + "linguistLanguageId": 146, + "name": "Lightning Web Components", + "type": "markup", + "tmScope": "text.html.basic", + "aceMode": "html", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "color": "#e34c26", + "aliases": [ + "xhtml" + ], + "extensions": [], + "parsers": [ + "lwc" + ], + "vscodeLanguageIds": [ + "html" + ], + "filenames": [] + }, + { + "linguistLanguageId": 391, + "name": "Vue", + "type": "markup", + "color": "#41b883", + "extensions": [ + ".vue" + ], + "tmScope": "text.html.vue", + "aceMode": "html", + "parsers": [ + "vue" + ], + "vscodeLanguageIds": [ + "vue" + ] + } +]; + +// src/language-html/options.js +var CATEGORY_HTML = "HTML"; +var options3 = { + bracketSameLine: common_options_evaluate_default.bracketSameLine, + htmlWhitespaceSensitivity: { + category: CATEGORY_HTML, + type: "choice", + default: "css", + description: "How to handle whitespaces in HTML.", + choices: [ + { + value: "css", + description: "Respect the default value of CSS display property." + }, + { + value: "strict", + description: "Whitespaces are considered sensitive." + }, + { + value: "ignore", + description: "Whitespaces are considered insensitive." + } + ] + }, + singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine, + vueIndentScriptAndStyle: { + category: CATEGORY_HTML, + type: "boolean", + default: false, + description: "Indent script and style tags in Vue files." + } +}; +var options_default3 = options3; + +// src/language-js/languages.evaluate.js +var languages_evaluate_default5 = [ + { + "linguistLanguageId": 183, + "name": "JavaScript", + "type": "programming", + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "color": "#f1e05a", + "aliases": [ + "js", + "node" + ], + "extensions": [ + ".js", + "._js", + ".bones", + ".cjs", + ".es", + ".es6", + ".frag", + ".gs", + ".jake", + ".javascript", + ".jsb", + ".jscad", + ".jsfl", + ".jslib", + ".jsm", + ".jspre", + ".jss", + ".mjs", + ".njs", + ".pac", + ".sjs", + ".ssjs", + ".xsjs", + ".xsjslib", + ".wxs" + ], + "filenames": [ + "Jakefile" + ], + "interpreters": [ + "chakra", + "d8", + "gjs", + "js", + "node", + "nodejs", + "qjs", + "rhino", + "v8", + "v8-shell", + "zx" + ], + "parsers": [ + "babel", + "acorn", + "espree", + "meriyah", + "babel-flow", + "babel-ts", + "flow", + "typescript" + ], + "vscodeLanguageIds": [ + "javascript", + "mongo" + ] + }, + { + "linguistLanguageId": 183, + "name": "Flow", + "type": "programming", + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "color": "#f1e05a", + "aliases": [], + "extensions": [ + ".js.flow" + ], + "filenames": [], + "interpreters": [ + "chakra", + "d8", + "gjs", + "js", + "node", + "nodejs", + "qjs", + "rhino", + "v8", + "v8-shell" + ], + "parsers": [ + "flow", + "babel-flow" + ], + "vscodeLanguageIds": [ + "javascript" + ] + }, + { + "linguistLanguageId": 183, + "name": "JSX", + "type": "programming", + "tmScope": "source.js.jsx", + "aceMode": "javascript", + "codemirrorMode": "jsx", + "codemirrorMimeType": "text/jsx", + "color": void 0, + "aliases": void 0, + "extensions": [ + ".jsx" + ], + "filenames": void 0, + "interpreters": void 0, + "parsers": [ + "babel", + "babel-flow", + "babel-ts", + "flow", + "typescript", + "espree", + "meriyah" + ], + "vscodeLanguageIds": [ + "javascriptreact" + ], + "group": "JavaScript" + }, + { + "linguistLanguageId": 378, + "name": "TypeScript", + "type": "programming", + "color": "#3178c6", + "aliases": [ + "ts" + ], + "interpreters": [ + "deno", + "ts-node" + ], + "extensions": [ + ".ts", + ".cts", + ".mts" + ], + "tmScope": "source.ts", + "aceMode": "typescript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/typescript", + "parsers": [ + "typescript", + "babel-ts" + ], + "vscodeLanguageIds": [ + "typescript" + ] + }, + { + "linguistLanguageId": 94901924, + "name": "TSX", + "type": "programming", + "color": "#3178c6", + "group": "TypeScript", + "extensions": [ + ".tsx" + ], + "tmScope": "source.tsx", + "aceMode": "javascript", + "codemirrorMode": "jsx", + "codemirrorMimeType": "text/jsx", + "parsers": [ + "typescript", + "babel-ts" + ], + "vscodeLanguageIds": [ + "typescriptreact" + ] + } +]; + +// src/language-js/options.js +var CATEGORY_JAVASCRIPT = "JavaScript"; +var options4 = { + arrowParens: { + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "always", + description: "Include parentheses around a sole arrow function parameter.", + choices: [ + { + value: "always", + description: "Always include parens. Example: `(x) => x`" + }, + { + value: "avoid", + description: "Omit parens when possible. Example: `x => x`" + } + ] + }, + bracketSameLine: common_options_evaluate_default.bracketSameLine, + objectWrap: common_options_evaluate_default.objectWrap, + bracketSpacing: common_options_evaluate_default.bracketSpacing, + jsxBracketSameLine: { + category: CATEGORY_JAVASCRIPT, + type: "boolean", + description: "Put > on the last line instead of at a new line.", + deprecated: "2.4.0" + }, + semi: { + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: true, + description: "Print semicolons.", + oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." + }, + experimentalOperatorPosition: { + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "end", + description: "Where to print operators when binary expressions wrap lines.", + choices: [ + { + value: "start", + description: "Print operators at the start of new lines." + }, + { + value: "end", + description: "Print operators at the end of previous lines." + } + ] + }, + experimentalTernaries: { + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: false, + description: "Use curious ternaries, with the question mark after the condition.", + oppositeDescription: "Default behavior of ternaries; keep question marks on the same line as the consequent." + }, + singleQuote: common_options_evaluate_default.singleQuote, + jsxSingleQuote: { + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: false, + description: "Use single quotes in JSX." + }, + quoteProps: { + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "as-needed", + description: "Change when properties in objects are quoted.", + choices: [ + { + value: "as-needed", + description: "Only add quotes around object properties where required." + }, + { + value: "consistent", + description: "If at least one property in an object requires quotes, quote all properties." + }, + { + value: "preserve", + description: "Respect the input use of quotes in object properties." + } + ] + }, + trailingComma: { + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "all", + description: "Print trailing commas wherever possible when multi-line.", + choices: [ + { + value: "all", + description: "Trailing commas wherever possible (including function arguments)." + }, + { + value: "es5", + description: "Trailing commas where valid in ES5 (objects, arrays, etc.)" + }, + { value: "none", description: "No trailing commas." } + ] + }, + singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine +}; +var options_default4 = options4; + +// src/language-json/languages.evaluate.js +var languages_evaluate_default6 = [ + { + "linguistLanguageId": 174, + "name": "JSON.stringify", + "type": "data", + "color": "#292929", + "tmScope": "source.json", + "aceMode": "json", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "aliases": [ + "geojson", + "jsonl", + "topojson" + ], + "extensions": [ + ".importmap" + ], + "filenames": [ + "package.json", + "package-lock.json", + "composer.json" + ], + "parsers": [ + "json-stringify" + ], + "vscodeLanguageIds": [ + "json" + ] + }, + { + "linguistLanguageId": 174, + "name": "JSON", + "type": "data", + "color": "#292929", + "tmScope": "source.json", + "aceMode": "json", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "aliases": [ + "geojson", + "jsonl", + "topojson" + ], + "extensions": [ + ".json", + ".4DForm", + ".4DProject", + ".avsc", + ".geojson", + ".gltf", + ".har", + ".ice", + ".JSON-tmLanguage", + ".mcmeta", + ".tfstate", + ".tfstate.backup", + ".topojson", + ".webapp", + ".webmanifest", + ".yy", + ".yyp" + ], + "filenames": [ + ".all-contributorsrc", + ".arcconfig", + ".auto-changelog", + ".c8rc", + ".htmlhintrc", + ".imgbotconfig", + ".nycrc", + ".tern-config", + ".tern-project", + ".watchmanconfig", + "Pipfile.lock", + "composer.lock", + "flake.lock", + "mcmod.info", + ".babelrc", + ".jscsrc", + ".jshintrc", + ".jslintrc", + ".swcrc" + ], + "parsers": [ + "json" + ], + "vscodeLanguageIds": [ + "json" + ] + }, + { + "linguistLanguageId": 423, + "name": "JSON with Comments", + "type": "data", + "color": "#292929", + "group": "JSON", + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "aliases": [ + "jsonc" + ], + "extensions": [ + ".jsonc", + ".code-snippets", + ".code-workspace", + ".sublime-build", + ".sublime-commands", + ".sublime-completions", + ".sublime-keymap", + ".sublime-macro", + ".sublime-menu", + ".sublime-mousemap", + ".sublime-project", + ".sublime-settings", + ".sublime-theme", + ".sublime-workspace", + ".sublime_metrics", + ".sublime_session" + ], + "filenames": [], + "parsers": [ + "jsonc" + ], + "vscodeLanguageIds": [ + "jsonc" + ] + }, + { + "linguistLanguageId": 175, + "name": "JSON5", + "type": "data", + "color": "#267CB9", + "extensions": [ + ".json5" + ], + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "parsers": [ + "json5" + ], + "vscodeLanguageIds": [ + "json5" + ] + } +]; + +// src/language-markdown/languages.evaluate.js +var languages_evaluate_default7 = [ + { + "linguistLanguageId": 222, + "name": "Markdown", + "type": "prose", + "color": "#083fa1", + "aliases": [ + "md", + "pandoc" + ], + "aceMode": "markdown", + "codemirrorMode": "gfm", + "codemirrorMimeType": "text/x-gfm", + "wrap": true, + "extensions": [ + ".md", + ".livemd", + ".markdown", + ".mdown", + ".mdwn", + ".mkd", + ".mkdn", + ".mkdown", + ".ronn", + ".scd", + ".workbook" + ], + "filenames": [ + "contents.lr", + "README" + ], + "tmScope": "text.md", + "parsers": [ + "markdown" + ], + "vscodeLanguageIds": [ + "markdown" + ] + }, + { + "linguistLanguageId": 222, + "name": "MDX", + "type": "prose", + "color": "#083fa1", + "aliases": [ + "md", + "pandoc" + ], + "aceMode": "markdown", + "codemirrorMode": "gfm", + "codemirrorMimeType": "text/x-gfm", + "wrap": true, + "extensions": [ + ".mdx" + ], + "filenames": [], + "tmScope": "text.md", + "parsers": [ + "mdx" + ], + "vscodeLanguageIds": [ + "mdx" + ] + } +]; + +// src/language-markdown/options.js +var options5 = { + proseWrap: common_options_evaluate_default.proseWrap, + singleQuote: common_options_evaluate_default.singleQuote +}; +var options_default5 = options5; + +// src/language-yaml/languages.evaluate.js +var languages_evaluate_default8 = [ + { + "linguistLanguageId": 407, + "name": "YAML", + "type": "data", + "color": "#cb171e", + "tmScope": "source.yaml", + "aliases": [ + "yml" + ], + "extensions": [ + ".yml", + ".mir", + ".reek", + ".rviz", + ".sublime-syntax", + ".syntax", + ".yaml", + ".yaml-tmlanguage", + ".yaml.sed", + ".yml.mysql" + ], + "filenames": [ + ".clang-format", + ".clang-tidy", + ".gemrc", + "CITATION.cff", + "glide.lock", + ".prettierrc", + ".stylelintrc", + ".lintstagedrc" + ], + "aceMode": "yaml", + "codemirrorMode": "yaml", + "codemirrorMimeType": "text/x-yaml", + "parsers": [ + "yaml" + ], + "vscodeLanguageIds": [ + "yaml", + "ansible", + "dockercompose", + "github-actions-workflow", + "home-assistant" + ] + } +]; + +// src/language-yaml/options.js +var options6 = { + bracketSpacing: common_options_evaluate_default.bracketSpacing, + singleQuote: common_options_evaluate_default.singleQuote, + proseWrap: common_options_evaluate_default.proseWrap +}; +var options_default6 = options6; + +// src/plugins/builtin-plugins-proxy.js +function createParsersAndPrinters(modules) { + const parsers2 = /* @__PURE__ */ Object.create(null); + const printers2 = /* @__PURE__ */ Object.create(null); + for (const { + importPlugin: importPlugin2, + parsers: parserNames = [], + printers: printerNames = [] + } of modules) { + const loadPlugin2 = async () => { + const plugin = await importPlugin2(); + Object.assign(parsers2, plugin.parsers); + Object.assign(printers2, plugin.printers); + return plugin; + }; + for (const parserName of parserNames) { + parsers2[parserName] = async () => (await loadPlugin2()).parsers[parserName]; + } + for (const printerName of printerNames) { + printers2[printerName] = async () => (await loadPlugin2()).printers[printerName]; + } + } + return { parsers: parsers2, printers: printers2 }; +} +var options7 = { + ...options_default, + ...options_default2, + ...options_default3, + ...options_default4, + ...options_default5, + ...options_default6 +}; +var languages = [ + ...languages_evaluate_default, + ...languages_evaluate_default2, + ...languages_evaluate_default3, + ...languages_evaluate_default4, + ...languages_evaluate_default5, + ...languages_evaluate_default6, + ...languages_evaluate_default7, + ...languages_evaluate_default8 +]; +var { parsers, printers } = createParsersAndPrinters([ + { + importPlugin: () => import("./plugins/acorn.mjs"), + parsers: ["acorn", "espree"] + }, + { + importPlugin: () => import("./plugins/angular.mjs"), + parsers: [ + "__ng_action", + "__ng_binding", + "__ng_interpolation", + "__ng_directive" + ] + }, + { + importPlugin: () => import("./plugins/babel.mjs"), + parsers: [ + "babel", + "babel-flow", + "babel-ts", + "__js_expression", + "__ts_expression", + "__vue_expression", + "__vue_ts_expression", + "__vue_event_binding", + "__vue_ts_event_binding", + "__babel_estree", + "json", + "json5", + "jsonc", + "json-stringify" + ] + }, + { + importPlugin: () => import("./plugins/estree.mjs"), + printers: ["estree", "estree-json"] + }, + { + importPlugin: () => import("./plugins/flow.mjs"), + parsers: ["flow"] + }, + { + importPlugin: () => import("./plugins/glimmer.mjs"), + parsers: ["glimmer"], + printers: ["glimmer"] + }, + { + importPlugin: () => import("./plugins/graphql.mjs"), + parsers: ["graphql"], + printers: ["graphql"] + }, + { + importPlugin: () => import("./plugins/html.mjs"), + parsers: ["html", "angular", "vue", "lwc"], + printers: ["html"] + }, + { + importPlugin: () => import("./plugins/markdown.mjs"), + parsers: ["markdown", "mdx", "remark"], + printers: ["mdast"] + }, + { + importPlugin: () => import("./plugins/meriyah.mjs"), + parsers: ["meriyah"] + }, + { + importPlugin: () => import("./plugins/postcss.mjs"), + parsers: ["css", "less", "scss"], + printers: ["postcss"] + }, + { + importPlugin: () => import("./plugins/typescript.mjs"), + parsers: ["typescript"] + }, + { + importPlugin: () => import("./plugins/yaml.mjs"), + parsers: ["yaml"], + printers: ["yaml"] + } +]); + +// src/main/plugins/load-builtin-plugins.js +function loadBuiltinPlugins() { + return [builtin_plugins_proxy_exports]; +} +var load_builtin_plugins_default = loadBuiltinPlugins; + +// src/main/plugins/load-plugin.js +import path12 from "path"; +import { pathToFileURL as pathToFileURL5 } from "url"; + +// src/utils/import-from-directory.js +import path11 from "path"; +function importFromDirectory(specifier, directory) { + return import_from_file_default(specifier, path11.join(directory, "noop.js")); +} +var import_from_directory_default = importFromDirectory; + +// src/main/plugins/load-plugin.js +async function importPlugin(name, cwd) { + if (path12.isAbsolute(name)) { + return import(pathToFileURL5(name).href); + } + try { + return await import(pathToFileURL5(path12.resolve(name)).href); + } catch { + return import_from_directory_default(name, cwd); + } +} +async function loadPluginWithoutCache(plugin, cwd) { + const module = await importPlugin(plugin, cwd); + return { name: plugin, ...module.default ?? module }; +} +var cache2 = /* @__PURE__ */ new Map(); +function loadPlugin(plugin) { + if (typeof plugin !== "string") { + return plugin; + } + const cwd = process.cwd(); + const cacheKey = JSON.stringify({ name: plugin, cwd }); + if (!cache2.has(cacheKey)) { + cache2.set(cacheKey, loadPluginWithoutCache(plugin, cwd)); + } + return cache2.get(cacheKey); +} +function clearCache2() { + cache2.clear(); +} + +// src/main/plugins/load-plugins.js +function loadPlugins(plugins = []) { + return Promise.all(plugins.map((plugin) => loadPlugin(plugin))); +} +var load_plugins_default = loadPlugins; + +// src/utils/object-omit.js +function omit(object, keys) { + keys = new Set(keys); + return Object.fromEntries( + Object.entries(object).filter(([key2]) => !keys.has(key2)) + ); +} +var object_omit_default = omit; + +// src/index.js +import * as doc from "./doc.mjs"; + +// src/main/version.evaluate.cjs +var version_evaluate_default = "3.5.3"; + +// src/utils/public.js +var public_exports = {}; +__export(public_exports, { + addDanglingComment: () => addDanglingComment, + addLeadingComment: () => addLeadingComment, + addTrailingComment: () => addTrailingComment, + getAlignmentSize: () => get_alignment_size_default, + getIndentSize: () => get_indent_size_default, + getMaxContinuousCount: () => get_max_continuous_count_default, + getNextNonSpaceNonCommentCharacter: () => get_next_non_space_non_comment_character_default, + getNextNonSpaceNonCommentCharacterIndex: () => getNextNonSpaceNonCommentCharacterIndex2, + getPreferredQuote: () => get_preferred_quote_default, + getStringWidth: () => get_string_width_default, + hasNewline: () => has_newline_default, + hasNewlineInRange: () => has_newline_in_range_default, + hasSpaces: () => has_spaces_default, + isNextLineEmpty: () => isNextLineEmpty2, + isNextLineEmptyAfterIndex: () => is_next_line_empty_default, + isPreviousLineEmpty: () => isPreviousLineEmpty2, + makeString: () => make_string_default, + skip: () => skip, + skipEverythingButNewLine: () => skipEverythingButNewLine, + skipInlineComment: () => skip_inline_comment_default, + skipNewline: () => skip_newline_default, + skipSpaces: () => skipSpaces, + skipToLineEnd: () => skipToLineEnd, + skipTrailingComment: () => skip_trailing_comment_default, + skipWhitespace: () => skipWhitespace +}); + +// src/utils/skip-inline-comment.js +function skipInlineComment(text, startIndex) { + if (startIndex === false) { + return false; + } + if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "*") { + for (let i = startIndex + 2; i < text.length; ++i) { + if (text.charAt(i) === "*" && text.charAt(i + 1) === "/") { + return i + 2; + } + } + } + return startIndex; +} +var skip_inline_comment_default = skipInlineComment; + +// src/utils/skip-trailing-comment.js +function skipTrailingComment(text, startIndex) { + if (startIndex === false) { + return false; + } + if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "/") { + return skipEverythingButNewLine(text, startIndex); + } + return startIndex; +} +var skip_trailing_comment_default = skipTrailingComment; + +// src/utils/get-next-non-space-non-comment-character-index.js +function getNextNonSpaceNonCommentCharacterIndex(text, startIndex) { + let oldIdx = null; + let nextIdx = startIndex; + while (nextIdx !== oldIdx) { + oldIdx = nextIdx; + nextIdx = skipSpaces(text, nextIdx); + nextIdx = skip_inline_comment_default(text, nextIdx); + nextIdx = skip_trailing_comment_default(text, nextIdx); + nextIdx = skip_newline_default(text, nextIdx); + } + return nextIdx; +} +var get_next_non_space_non_comment_character_index_default = getNextNonSpaceNonCommentCharacterIndex; + +// src/utils/is-next-line-empty.js +function isNextLineEmpty(text, startIndex) { + let oldIdx = null; + let idx = startIndex; + while (idx !== oldIdx) { + oldIdx = idx; + idx = skipToLineEnd(text, idx); + idx = skip_inline_comment_default(text, idx); + idx = skipSpaces(text, idx); + } + idx = skip_trailing_comment_default(text, idx); + idx = skip_newline_default(text, idx); + return idx !== false && has_newline_default(text, idx); +} +var is_next_line_empty_default = isNextLineEmpty; + +// src/utils/get-indent-size.js +function getIndentSize(value, tabWidth) { + const lastNewlineIndex = value.lastIndexOf("\n"); + if (lastNewlineIndex === -1) { + return 0; + } + return get_alignment_size_default( + // All the leading whitespaces + value.slice(lastNewlineIndex + 1).match(/^[\t ]*/u)[0], + tabWidth + ); +} +var get_indent_size_default = getIndentSize; + +// node_modules/escape-string-regexp/index.js +function escapeStringRegexp(string) { + if (typeof string !== "string") { + throw new TypeError("Expected a string"); + } + return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} + +// src/utils/get-max-continuous-count.js +function getMaxContinuousCount(text, searchString) { + const results = text.match( + new RegExp(`(${escapeStringRegexp(searchString)})+`, "gu") + ); + if (results === null) { + return 0; + } + return results.reduce( + (maxCount, result) => Math.max(maxCount, result.length / searchString.length), + 0 + ); +} +var get_max_continuous_count_default = getMaxContinuousCount; + +// src/utils/get-next-non-space-non-comment-character.js +function getNextNonSpaceNonCommentCharacter(text, startIndex) { + const index = get_next_non_space_non_comment_character_index_default(text, startIndex); + return index === false ? "" : text.charAt(index); +} +var get_next_non_space_non_comment_character_default = getNextNonSpaceNonCommentCharacter; + +// src/utils/get-preferred-quote.js +var SINGLE_QUOTE = "'"; +var DOUBLE_QUOTE = '"'; +function getPreferredQuote(text, preferredQuoteOrPreferSingleQuote) { + const preferred = preferredQuoteOrPreferSingleQuote === true || preferredQuoteOrPreferSingleQuote === SINGLE_QUOTE ? SINGLE_QUOTE : DOUBLE_QUOTE; + const alternate = preferred === SINGLE_QUOTE ? DOUBLE_QUOTE : SINGLE_QUOTE; + let preferredQuoteCount = 0; + let alternateQuoteCount = 0; + for (const character of text) { + if (character === preferred) { + preferredQuoteCount++; + } else if (character === alternate) { + alternateQuoteCount++; + } + } + return preferredQuoteCount > alternateQuoteCount ? alternate : preferred; +} +var get_preferred_quote_default = getPreferredQuote; + +// src/utils/has-newline-in-range.js +function hasNewlineInRange(text, startIndex, endIndex) { + for (let i = startIndex; i < endIndex; ++i) { + if (text.charAt(i) === "\n") { + return true; + } + } + return false; +} +var has_newline_in_range_default = hasNewlineInRange; + +// src/utils/has-spaces.js +function hasSpaces(text, startIndex, options8 = {}) { + const idx = skipSpaces( + text, + options8.backwards ? startIndex - 1 : startIndex, + options8 + ); + return idx !== startIndex; +} +var has_spaces_default = hasSpaces; + +// src/utils/make-string.js +function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) { + const otherQuote = enclosingQuote === '"' ? "'" : '"'; + const regex = /\\(.)|(["'])/gsu; + const raw = string_replace_all_default( + /* isOptionalObject */ + false, + rawText, + regex, + (match, escaped, quote) => { + if (escaped === otherQuote) { + return escaped; + } + if (quote === enclosingQuote) { + return "\\" + quote; + } + if (quote) { + return quote; + } + return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(escaped) ? escaped : "\\" + escaped; + } + ); + return enclosingQuote + raw + enclosingQuote; +} +var make_string_default = makeString; + +// src/utils/public.js +function legacyGetNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) { + return get_next_non_space_non_comment_character_index_default( + text, + locEnd(node) + ); +} +function getNextNonSpaceNonCommentCharacterIndex2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? get_next_non_space_non_comment_character_index_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyGetNextNonSpaceNonCommentCharacterIndex(...arguments) + ); +} +function legacyIsPreviousLineEmpty(text, node, locStart) { + return is_previous_line_empty_default(text, locStart(node)); +} +function isPreviousLineEmpty2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? is_previous_line_empty_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyIsPreviousLineEmpty(...arguments) + ); +} +function legacyIsNextLineEmpty(text, node, locEnd) { + return is_next_line_empty_default(text, locEnd(node)); +} +function isNextLineEmpty2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? is_next_line_empty_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyIsNextLineEmpty(...arguments) + ); +} + +// src/index.js +function withPlugins(fn, optionsArgumentIndex = 1) { + return async (...args) => { + const options8 = args[optionsArgumentIndex] ?? {}; + const { plugins = [] } = options8; + args[optionsArgumentIndex] = { + ...options8, + plugins: (await Promise.all([ + load_builtin_plugins_default(), + // TODO: standalone version allow `plugins` to be `prettierPlugins` which is an object, should allow that too + load_plugins_default(plugins) + ])).flat() + }; + return fn(...args); + }; +} +var formatWithCursor2 = withPlugins(formatWithCursor); +async function format2(text, options8) { + const { formatted } = await formatWithCursor2(text, { + ...options8, + cursorOffset: -1 + }); + return formatted; +} +async function check(text, options8) { + return await format2(text, options8) === text; +} +async function clearCache3() { + clearCache(); + clearCache2(); +} +var getFileInfo2 = withPlugins(get_file_info_default); +var getSupportInfo2 = withPlugins(getSupportInfo, 0); +var sharedWithCli = { + errors: errors_exports, + optionCategories: option_categories_exports, + createIsIgnoredFunction, + formatOptionsHiddenDefaults, + normalizeOptions: normalize_options_default, + getSupportInfoWithoutPlugins: getSupportInfo, + normalizeOptionSettings, + vnopts: { + ChoiceSchema, + apiDescriptor + }, + fastGlob: import_fast_glob.default, + createTwoFilesPatch, + utils: { + omit: object_omit_default + }, + mockable: mockable_default +}; +var debugApis = { + parse: withPlugins(parse6), + formatAST: withPlugins(formatAst), + formatDoc: withPlugins(formatDoc), + printToDoc: withPlugins(printToDoc), + printDocToString: withPlugins(printDocToString2), + mockable: mockable_default +}; + +// with-default-export:src/index.js +var src_default = index_exports; +export { + debugApis as __debug, + sharedWithCli as __internal, + check, + clearCache3 as clearConfigCache, + src_default as default, + doc, + format2 as format, + formatWithCursor2 as formatWithCursor, + getFileInfo2 as getFileInfo, + getSupportInfo2 as getSupportInfo, + resolveConfig, + resolveConfigFile, + public_exports as util, + version_evaluate_default as version +}; diff --git a/node_modules/prettier/internal/cli.mjs b/node_modules/prettier/internal/cli.mjs new file mode 100644 index 0000000..ccaa71e --- /dev/null +++ b/node_modules/prettier/internal/cli.mjs @@ -0,0 +1,4873 @@ +import { createRequire as __prettierCreateRequire } from "module"; +import { fileURLToPath as __prettierFileUrlToPath } from "url"; +import { dirname as __prettierDirname } from "path"; +const require = __prettierCreateRequire(import.meta.url); +const __filename = __prettierFileUrlToPath(import.meta.url); +const __dirname = __prettierDirname(__filename); + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] +}) : x)(function(x) { + if (typeof require !== "undefined") return require.apply(this, arguments); + throw Error('Dynamic require of "' + x + '" is not supported'); +}); +var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); + +// node_modules/dashify/index.js +var require_dashify = __commonJS({ + "node_modules/dashify/index.js"(exports, module) { + "use strict"; + module.exports = (str, options) => { + if (typeof str !== "string") throw new TypeError("expected a string"); + return str.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/\W/g, (m) => /[À-ž]/.test(m) ? m : "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, (m) => options && options.condense ? "-" : m).toLowerCase(); + }; + } +}); + +// node_modules/minimist/index.js +var require_minimist = __commonJS({ + "node_modules/minimist/index.js"(exports, module) { + "use strict"; + function hasKey(obj, keys2) { + var o = obj; + keys2.slice(0, -1).forEach(function(key2) { + o = o[key2] || {}; + }); + var key = keys2[keys2.length - 1]; + return key in o; + } + function isNumber(x) { + if (typeof x === "number") { + return true; + } + if (/^0x[0-9a-f]+$/i.test(x)) { + return true; + } + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); + } + function isConstructorOrProto(obj, key) { + return key === "constructor" && typeof obj[key] === "function" || key === "__proto__"; + } + module.exports = function(args, opts) { + if (!opts) { + opts = {}; + } + var flags = { + bools: {}, + strings: {}, + unknownFn: null + }; + if (typeof opts.unknown === "function") { + flags.unknownFn = opts.unknown; + } + if (typeof opts.boolean === "boolean" && opts.boolean) { + flags.allBools = true; + } else { + [].concat(opts.boolean).filter(Boolean).forEach(function(key2) { + flags.bools[key2] = true; + }); + } + var aliases = {}; + function aliasIsBoolean(key2) { + return aliases[key2].some(function(x) { + return flags.bools[x]; + }); + } + Object.keys(opts.alias || {}).forEach(function(key2) { + aliases[key2] = [].concat(opts.alias[key2]); + aliases[key2].forEach(function(x) { + aliases[x] = [key2].concat(aliases[key2].filter(function(y) { + return x !== y; + })); + }); + }); + [].concat(opts.string).filter(Boolean).forEach(function(key2) { + flags.strings[key2] = true; + if (aliases[key2]) { + [].concat(aliases[key2]).forEach(function(k) { + flags.strings[k] = true; + }); + } + }); + var defaults = opts.default || {}; + var argv = { _: [] }; + function argDefined(key2, arg2) { + return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2]; + } + function setKey(obj, keys2, value2) { + var o = obj; + for (var i2 = 0; i2 < keys2.length - 1; i2++) { + var key2 = keys2[i2]; + if (isConstructorOrProto(o, key2)) { + return; + } + if (o[key2] === void 0) { + o[key2] = {}; + } + if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) { + o[key2] = {}; + } + if (o[key2] === Array.prototype) { + o[key2] = []; + } + o = o[key2]; + } + var lastKey = keys2[keys2.length - 1]; + if (isConstructorOrProto(o, lastKey)) { + return; + } + if (o === Object.prototype || o === Number.prototype || o === String.prototype) { + o = {}; + } + if (o === Array.prototype) { + o = []; + } + if (o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] === "boolean") { + o[lastKey] = value2; + } else if (Array.isArray(o[lastKey])) { + o[lastKey].push(value2); + } else { + o[lastKey] = [o[lastKey], value2]; + } + } + function setArg(key2, val, arg2) { + if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) { + if (flags.unknownFn(arg2) === false) { + return; + } + } + var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val; + setKey(argv, key2.split("."), value2); + (aliases[key2] || []).forEach(function(x) { + setKey(argv, x.split("."), value2); + }); + } + Object.keys(flags.bools).forEach(function(key2) { + setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]); + }); + var notFlags = []; + if (args.indexOf("--") !== -1) { + notFlags = args.slice(args.indexOf("--") + 1); + args = args.slice(0, args.indexOf("--")); + } + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var key; + var next; + if (/^--.+=/.test(arg)) { + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + key = m[1]; + var value = m[2]; + if (flags.bools[key]) { + value = value !== "false"; + } + setArg(key, value, arg); + } else if (/^--no-.+/.test(arg)) { + key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false, arg); + } else if (/^--.+/.test(arg)) { + key = arg.match(/^--(.+)/)[1]; + next = args[i + 1]; + if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, next, arg); + i += 1; + } else if (/^(true|false)$/.test(next)) { + setArg(key, next === "true", arg); + i += 1; + } else { + setArg(key, flags.strings[key] ? "" : true, arg); + } + } else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1, -1).split(""); + var broken = false; + for (var j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (next === "-") { + setArg(letters[j], next, arg); + continue; + } + if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") { + setArg(letters[j], next.slice(1), arg); + broken = true; + break; + } + if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next, arg); + broken = true; + break; + } + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], arg.slice(j + 2), arg); + broken = true; + break; + } else { + setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg); + } + } + key = arg.slice(-1)[0]; + if (!broken && key !== "-") { + if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, args[i + 1], arg); + i += 1; + } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) { + setArg(key, args[i + 1] === "true", arg); + i += 1; + } else { + setArg(key, flags.strings[key] ? "" : true, arg); + } + } + } else { + if (!flags.unknownFn || flags.unknownFn(arg) !== false) { + argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg)); + } + if (opts.stopEarly) { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + } + } + Object.keys(defaults).forEach(function(k) { + if (!hasKey(argv, k.split("."))) { + setKey(argv, k.split("."), defaults[k]); + (aliases[k] || []).forEach(function(x) { + setKey(argv, x.split("."), defaults[k]); + }); + } + }); + if (opts["--"]) { + argv["--"] = notFlags.slice(); + } else { + notFlags.forEach(function(k) { + argv._.push(k); + }); + } + return argv; + }; + } +}); + +// node_modules/fast-json-stable-stringify/index.js +var require_fast_json_stable_stringify = __commonJS({ + "node_modules/fast-json-stable-stringify/index.js"(exports, module) { + "use strict"; + module.exports = function(data, opts) { + if (!opts) opts = {}; + if (typeof opts === "function") opts = { cmp: opts }; + var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false; + var cmp = opts.cmp && /* @__PURE__ */ function(f) { + return function(node) { + return function(a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + }(opts.cmp); + var seen = []; + return function stringify5(node) { + if (node && node.toJSON && typeof node.toJSON === "function") { + node = node.toJSON(); + } + if (node === void 0) return; + if (typeof node == "number") return isFinite(node) ? "" + node : "null"; + if (typeof node !== "object") return JSON.stringify(node); + var i, out; + if (Array.isArray(node)) { + out = "["; + for (i = 0; i < node.length; i++) { + if (i) out += ","; + out += stringify5(node[i]) || "null"; + } + return out + "]"; + } + if (node === null) return "null"; + if (seen.indexOf(node) !== -1) { + if (cycles) return JSON.stringify("__cycle__"); + throw new TypeError("Converting circular structure to JSON"); + } + var seenIndex = seen.push(node) - 1; + var keys2 = Object.keys(node).sort(cmp && cmp(node)); + out = ""; + for (i = 0; i < keys2.length; i++) { + var key = keys2[i]; + var value = stringify5(node[key]); + if (!value) continue; + if (out) out += ","; + out += JSON.stringify(key) + ":" + value; + } + seen.splice(seenIndex, 1); + return "{" + out + "}"; + }(data); + }; + } +}); + +// node_modules/common-path-prefix/index.js +var require_common_path_prefix = __commonJS({ + "node_modules/common-path-prefix/index.js"(exports, module) { + "use strict"; + var { sep: DEFAULT_SEPARATOR } = __require("path"); + var determineSeparator = (paths) => { + for (const path12 of paths) { + const match = /(\/|\\)/.exec(path12); + if (match !== null) return match[0]; + } + return DEFAULT_SEPARATOR; + }; + module.exports = function commonPathPrefix2(paths, sep = determineSeparator(paths)) { + const [first = "", ...remaining] = paths; + if (first === "" || remaining.length === 0) return ""; + const parts = first.split(sep); + let endOfPrefix = parts.length; + for (const path12 of remaining) { + const compare = path12.split(sep); + for (let i = 0; i < endOfPrefix; i++) { + if (compare[i] !== parts[i]) { + endOfPrefix = i; + } + } + if (endOfPrefix === 0) return ""; + } + const prefix = parts.slice(0, endOfPrefix).join(sep); + return prefix.endsWith(sep) ? prefix : prefix + sep; + }; + } +}); + +// src/cli/index.js +import * as prettier2 from "../index.mjs"; + +// scripts/build/shims/at.js +var at = (isOptionalObject, object2, index) => { + if (isOptionalObject && (object2 === void 0 || object2 === null)) { + return; + } + if (Array.isArray(object2) || typeof object2 === "string") { + return object2[index < 0 ? object2.length + index : index]; + } + return object2.at(index); +}; +var at_default = at; + +// src/cli/options/get-context-options.js +var import_dashify = __toESM(require_dashify(), 1); +import { getSupportInfo } from "../index.mjs"; + +// src/cli/cli-options.evaluate.js +var cli_options_evaluate_default = { + "cache": { + "default": false, + "description": "Only format changed files. Cannot use with --stdin-filepath.", + "type": "boolean" + }, + "cacheLocation": { + "description": "Path to the cache file.", + "type": "path" + }, + "cacheStrategy": { + "choices": [ + { + "description": "Use the file metadata such as timestamps as cache keys", + "value": "metadata" + }, + { + "description": "Use the file content as cache keys", + "value": "content" + } + ], + "description": "Strategy for the cache to use for detecting changed files.", + "type": "choice" + }, + "check": { + "alias": "c", + "category": "Output", + "description": "Check if the given files are formatted, print a human-friendly summary\nmessage and paths to unformatted files (see also --list-different).", + "type": "boolean" + }, + "color": { + "default": true, + "description": "Colorize error messages.", + "oppositeDescription": "Do not colorize error messages.", + "type": "boolean" + }, + "config": { + "category": "Config", + "description": "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).", + "exception": (value) => value === false, + "oppositeDescription": "Do not look for a configuration file.", + "type": "path" + }, + "configPrecedence": { + "category": "Config", + "choices": [ + { + "description": "CLI options take precedence over config file", + "value": "cli-override" + }, + { + "description": "Config file take precedence over CLI options", + "value": "file-override" + }, + { + "description": "If a config file is found will evaluate it and ignore other CLI options.\nIf no config file is found CLI options will evaluate as normal.", + "value": "prefer-file" + } + ], + "default": "cli-override", + "description": "Define in which order config files and CLI options should be evaluated.", + "type": "choice" + }, + "debugBenchmark": { + "type": "boolean" + }, + "debugCheck": { + "type": "boolean" + }, + "debugPrintAst": { + "type": "boolean" + }, + "debugPrintComments": { + "type": "boolean" + }, + "debugPrintDoc": { + "type": "boolean" + }, + "debugRepeat": { + "default": 0, + "type": "int" + }, + "editorconfig": { + "category": "Config", + "default": true, + "description": "Take .editorconfig into account when parsing configuration.", + "oppositeDescription": "Don't take .editorconfig into account when parsing configuration.", + "type": "boolean" + }, + "errorOnUnmatchedPattern": { + "oppositeDescription": "Prevent errors when pattern is unmatched.", + "type": "boolean" + }, + "fileInfo": { + "description": "Extract the following info (as JSON) for a given file path. Reported fields:\n* ignored (boolean) - true if file path is filtered by --ignore-path\n* inferredParser (string | null) - name of parser inferred from file path", + "type": "path" + }, + "findConfigPath": { + "category": "Config", + "description": "Find and print the path to a configuration file for the given input file.", + "type": "path" + }, + "help": { + "alias": "h", + "description": "Show CLI usage, or details about the given flag.\nExample: --help write", + "exception": (value) => value === "", + "type": "flag" + }, + "ignorePath": { + "array": true, + "category": "Config", + "default": [ + { + "value": [ + ".gitignore", + ".prettierignore" + ] + } + ], + "description": "Path to a file with patterns describing files to ignore.\nMultiple values are accepted.", + "type": "path" + }, + "ignoreUnknown": { + "alias": "u", + "description": "Ignore unknown files.", + "type": "boolean" + }, + "listDifferent": { + "alias": "l", + "category": "Output", + "description": "Print the names of files that are different from Prettier's formatting (see also --check).", + "type": "boolean" + }, + "logLevel": { + "choices": [ + "silent", + "error", + "warn", + "log", + "debug" + ], + "default": "log", + "description": "What level of logs to report.", + "type": "choice" + }, + "supportInfo": { + "description": "Print support information as JSON.", + "type": "boolean" + }, + "version": { + "alias": "v", + "description": "Print Prettier version.", + "type": "boolean" + }, + "withNodeModules": { + "category": "Config", + "description": "Process files inside 'node_modules' directory.", + "type": "boolean" + }, + "write": { + "alias": "w", + "category": "Output", + "description": "Edit files in-place. (Beware!)", + "type": "boolean" + } +}; + +// src/cli/prettier-internal.js +import { __internal as sharedWithCli } from "../index.mjs"; +var { + errors, + optionCategories, + createIsIgnoredFunction, + formatOptionsHiddenDefaults, + normalizeOptions, + getSupportInfoWithoutPlugins, + normalizeOptionSettings, + vnopts, + fastGlob, + createTwoFilesPatch, + mockable +} = sharedWithCli; + +// src/cli/options/get-context-options.js +var detailedCliOptions = normalizeOptionSettings(cli_options_evaluate_default).map( + (option) => normalizeDetailedOption(option) +); +function apiOptionToCliOption(apiOption) { + const cliOption = { + ...apiOption, + description: apiOption.cliDescription ?? apiOption.description, + category: apiOption.cliCategory ?? optionCategories.CATEGORY_FORMAT, + forwardToApi: apiOption.name + }; + if (apiOption.deprecated) { + delete cliOption.forwardToApi; + delete cliOption.description; + delete cliOption.oppositeDescription; + cliOption.deprecated = true; + } + return normalizeDetailedOption(cliOption); +} +function normalizeDetailedOption(option) { + var _a; + return { + category: optionCategories.CATEGORY_OTHER, + ...option, + name: option.cliName ?? (0, import_dashify.default)(option.name), + choices: (_a = option.choices) == null ? void 0 : _a.map((choice) => { + const newChoice = { + description: "", + deprecated: false, + ...typeof choice === "object" ? choice : { value: choice } + }; + if (newChoice.value === true) { + newChoice.value = ""; + } + return newChoice; + }) + }; +} +function supportInfoToContextOptions({ options: supportOptions, languages }) { + const detailedOptions = [ + ...detailedCliOptions, + ...supportOptions.map((apiOption) => apiOptionToCliOption(apiOption)) + ]; + return { + supportOptions, + languages, + detailedOptions + }; +} +async function getContextOptions(plugins) { + const supportInfo = await getSupportInfo({ + showDeprecated: true, + plugins + }); + return supportInfoToContextOptions(supportInfo); +} +function getContextOptionsWithoutPlugins() { + const supportInfo = getSupportInfoWithoutPlugins(); + return supportInfoToContextOptions(supportInfo); +} + +// scripts/build/shims/string-replace-all.js +var stringReplaceAll = (isOptionalObject, original, pattern, replacement) => { + if (isOptionalObject && (original === void 0 || original === null)) { + return; + } + if (original.replaceAll) { + return original.replaceAll(pattern, replacement); + } + if (pattern.global) { + return original.replace(pattern, replacement); + } + return original.split(pattern).join(replacement); +}; +var string_replace_all_default = stringReplaceAll; + +// node_modules/camelcase/index.js +var UPPERCASE = /[\p{Lu}]/u; +var LOWERCASE = /[\p{Ll}]/u; +var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu; +var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u; +var SEPARATORS = /[_.\- ]+/; +var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source); +var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu"); +var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu"); +var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => { + let isLastCharLower = false; + let isLastCharUpper = false; + let isLastLastCharUpper = false; + let isLastLastCharPreserved = false; + for (let index = 0; index < string.length; index++) { + const character = string[index]; + isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true; + if (isLastCharLower && UPPERCASE.test(character)) { + string = string.slice(0, index) + "-" + string.slice(index); + isLastCharLower = false; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = true; + index++; + } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) { + string = string.slice(0, index - 1) + "-" + string.slice(index - 1); + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = false; + isLastCharLower = true; + } else { + isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character; + } + } + return string; +}; +var preserveConsecutiveUppercase = (input, toLowerCase) => { + LEADING_CAPITAL.lastIndex = 0; + return string_replace_all_default( + /* isOptionalObject */ + false, + input, + LEADING_CAPITAL, + (match) => toLowerCase(match) + ); +}; +var postProcess = (input, toUpperCase) => { + SEPARATORS_AND_IDENTIFIER.lastIndex = 0; + NUMBERS_AND_IDENTIFIER.lastIndex = 0; + return string_replace_all_default( + /* isOptionalObject */ + false, + string_replace_all_default( + /* isOptionalObject */ + false, + input, + NUMBERS_AND_IDENTIFIER, + (match, pattern, offset) => ["_", "-"].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match) + ), + SEPARATORS_AND_IDENTIFIER, + (_2, identifier) => toUpperCase(identifier) + ); +}; +function camelCase(input, options) { + if (!(typeof input === "string" || Array.isArray(input))) { + throw new TypeError("Expected the input to be `string | string[]`"); + } + options = { + pascalCase: false, + preserveConsecutiveUppercase: false, + ...options + }; + if (Array.isArray(input)) { + input = input.map((x) => x.trim()).filter((x) => x.length).join("-"); + } else { + input = input.trim(); + } + if (input.length === 0) { + return ""; + } + const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale); + const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale); + if (input.length === 1) { + if (SEPARATORS.test(input)) { + return ""; + } + return options.pascalCase ? toUpperCase(input) : toLowerCase(input); + } + const hasUpperCase = input !== toLowerCase(input); + if (hasUpperCase) { + input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase); + } + input = input.replace(LEADING_SEPARATORS, ""); + input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input); + if (options.pascalCase) { + input = toUpperCase(input.charAt(0)) + input.slice(1); + } + return postProcess(input, toUpperCase); +} + +// src/cli/utils.js +import fs from "fs/promises"; +import path from "path"; + +// node_modules/sdbm/index.js +function sdbm(string) { + let hash2 = 0; + for (let i = 0; i < string.length; i++) { + hash2 = string.charCodeAt(i) + (hash2 << 6) + (hash2 << 16) - hash2; + } + return hash2 >>> 0; +} + +// src/cli/utils.js +import { __internal as sharedWithCli2 } from "../index.mjs"; +var printToScreen = console.log.bind(console); +function groupBy(array2, iteratee) { + const result = /* @__PURE__ */ Object.create(null); + for (const value of array2) { + const key = iteratee(value); + if (Array.isArray(result[key])) { + result[key].push(value); + } else { + result[key] = [value]; + } + } + return result; +} +function pick(object2, keys2) { + const entries = keys2.map((key) => [key, object2[key]]); + return Object.fromEntries(entries); +} +function createHash(source) { + return String(sdbm(source)); +} +async function statSafe(filePath) { + try { + return await fs.stat(filePath); + } catch (error) { + if (error.code !== "ENOENT") { + throw error; + } + } +} +async function lstatSafe(filePath) { + try { + return await fs.lstat(filePath); + } catch (error) { + if (error.code !== "ENOENT") { + throw error; + } + } +} +function isJson(value) { + try { + JSON.parse(value); + return true; + } catch { + return false; + } +} +var normalizeToPosix = path.sep === "\\" ? (filepath) => string_replace_all_default( + /* isOptionalObject */ + false, + filepath, + "\\", + "/" +) : (filepath) => filepath; +var { omit } = sharedWithCli2.utils; + +// src/cli/options/create-minimist-options.js +function createMinimistOptions(detailedOptions) { + const booleanNames = []; + const stringNames = []; + const defaultValues = {}; + for (const option of detailedOptions) { + const { name, alias, type } = option; + const names = type === "boolean" ? booleanNames : stringNames; + names.push(name); + if (alias) { + names.push(alias); + } + if (!option.deprecated && (!option.forwardToApi || name === "plugin") && option.default !== void 0) { + defaultValues[option.name] = option.default; + } + } + return { + // we use vnopts' AliasSchema to handle aliases for better error messages + alias: {}, + boolean: booleanNames, + string: stringNames, + default: defaultValues + }; +} + +// src/cli/options/minimist.js +var import_minimist = __toESM(require_minimist(), 1); +var PLACEHOLDER = null; +function minimistParse(args, options) { + const boolean = options.boolean ?? []; + const defaults = options.default ?? {}; + const booleanWithoutDefault = boolean.filter((key) => !(key in defaults)); + const newDefaults = { + ...defaults, + ...Object.fromEntries( + booleanWithoutDefault.map((key) => [key, PLACEHOLDER]) + ) + }; + const parsed = (0, import_minimist.default)(args, { ...options, default: newDefaults }); + return Object.fromEntries( + Object.entries(parsed).filter(([, value]) => value !== PLACEHOLDER) + ); +} + +// node_modules/chalk/source/vendor/ansi-styles/index.js +var ANSI_BACKGROUND_OFFSET = 10; +var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; +var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; +var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; +var styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + // Bright color + blackBright: [90, 39], + gray: [90, 39], + // Alias of `blackBright` + grey: [90, 39], + // Alias of `blackBright` + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + // Bright color + bgBlackBright: [100, 49], + bgGray: [100, 49], + // Alias of `bgBlackBright` + bgGrey: [100, 49], + // Alias of `bgBlackBright` + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } +}; +var modifierNames = Object.keys(styles.modifier); +var foregroundColorNames = Object.keys(styles.color); +var backgroundColorNames = Object.keys(styles.bgColor); +var colorNames = [...foregroundColorNames, ...backgroundColorNames]; +function assembleStyles() { + const codes = /* @__PURE__ */ new Map(); + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\x1B[${style[0]}m`, + close: `\x1B[${style[1]}m` + }; + group[styleName] = styles[styleName]; + codes.set(style[0], style[1]); + } + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + Object.defineProperty(styles, "codes", { + value: codes, + enumerable: false + }); + styles.color.close = "\x1B[39m"; + styles.bgColor.close = "\x1B[49m"; + styles.color.ansi = wrapAnsi16(); + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + Object.defineProperties(styles, { + rgbToAnsi256: { + value(red, green, blue) { + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + if (red > 248) { + return 231; + } + return Math.round((red - 8) / 247 * 24) + 232; + } + return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); + }, + enumerable: false + }, + hexToRgb: { + value(hex) { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + let [colorString] = matches; + if (colorString.length === 3) { + colorString = [...colorString].map((character) => character + character).join(""); + } + const integer = Number.parseInt(colorString, 16); + return [ + /* eslint-disable no-bitwise */ + integer >> 16 & 255, + integer >> 8 & 255, + integer & 255 + /* eslint-enable no-bitwise */ + ]; + }, + enumerable: false + }, + hexToAnsi256: { + value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false + }, + ansi256ToAnsi: { + value(code) { + if (code < 8) { + return 30 + code; + } + if (code < 16) { + return 90 + (code - 8); + } + let red; + let green; + let blue; + if (code >= 232) { + red = ((code - 232) * 10 + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + const remainder = code % 36; + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = remainder % 6 / 5; + } + const value = Math.max(red, green, blue) * 2; + if (value === 0) { + return 30; + } + let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); + if (value === 2) { + result += 60; + } + return result; + }, + enumerable: false + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false + }, + hexToAnsi: { + value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false + } + }); + return styles; +} +var ansiStyles = assembleStyles(); +var ansi_styles_default = ansiStyles; + +// node_modules/chalk/source/vendor/supports-color/index.js +import process2 from "process"; +import os from "os"; +import tty from "tty"; +function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} +var { env } = process2; +var flagForceColor; +if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + flagForceColor = 0; +} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + flagForceColor = 1; +} +function envForceColor() { + if ("FORCE_COLOR" in env) { + if (env.FORCE_COLOR === "true") { + return 1; + } + if (env.FORCE_COLOR === "false") { + return 0; + } + return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + } +} +function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} +function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== void 0) { + flagForceColor = noFlagForceColor; + } + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + if (forceColor === 0) { + return 0; + } + if (sniffFlags) { + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + } + if ("TF_BUILD" in env && "AGENT_NAME" in env) { + return 1; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; + } + if (process2.platform === "win32") { + const osRelease = os.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) { + return 3; + } + if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if (env.COLORTERM === "truecolor") { + return 3; + } + if (env.TERM === "xterm-kitty") { + return 3; + } + if ("TERM_PROGRAM" in env) { + const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": { + return version2 >= 3 ? 3 : 2; + } + case "Apple_Terminal": { + return 2; + } + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + return min; +} +function createSupportsColor(stream, options = {}) { + const level = _supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options + }); + return translateLevel(level); +} +var supportsColor = { + stdout: createSupportsColor({ isTTY: tty.isatty(1) }), + stderr: createSupportsColor({ isTTY: tty.isatty(2) }) +}; +var supports_color_default = supportsColor; + +// node_modules/chalk/source/utilities.js +function stringReplaceAll2(string, substring, replacer) { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ""; + do { + returnValue += string.slice(endIndex, index) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} +function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { + let endIndex = 0; + let returnValue = ""; + do { + const gotCR = string[index - 1] === "\r"; + returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; + endIndex = index + 1; + index = string.indexOf("\n", endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} + +// node_modules/chalk/source/index.js +var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default; +var GENERATOR = Symbol("GENERATOR"); +var STYLER = Symbol("STYLER"); +var IS_EMPTY = Symbol("IS_EMPTY"); +var levelMapping = [ + "ansi", + "ansi", + "ansi256", + "ansi16m" +]; +var styles2 = /* @__PURE__ */ Object.create(null); +var applyOptions = (object2, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error("The `level` option should be an integer from 0 to 3"); + } + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object2.level = options.level === void 0 ? colorLevel : options.level; +}; +var chalkFactory = (options) => { + const chalk2 = (...strings) => strings.join(" "); + applyOptions(chalk2, options); + Object.setPrototypeOf(chalk2, createChalk.prototype); + return chalk2; +}; +function createChalk(options) { + return chalkFactory(options); +} +Object.setPrototypeOf(createChalk.prototype, Function.prototype); +for (const [styleName, style] of Object.entries(ansi_styles_default)) { + styles2[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); + Object.defineProperty(this, styleName, { value: builder }); + return builder; + } + }; +} +styles2.visible = { + get() { + const builder = createBuilder(this, this[STYLER], true); + Object.defineProperty(this, "visible", { value: builder }); + return builder; + } +}; +var getModelAnsi = (model, level, type, ...arguments_) => { + if (model === "rgb") { + if (level === "ansi16m") { + return ansi_styles_default[type].ansi16m(...arguments_); + } + if (level === "ansi256") { + return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); + } + return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); + } + if (model === "hex") { + return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_)); + } + return ansi_styles_default[type][model](...arguments_); +}; +var usedModels = ["rgb", "hex", "ansi256"]; +for (const model of usedModels) { + styles2[model] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; + } + }; + const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); + styles2[bgModel] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; + } + }; +} +var proto = Object.defineProperties(() => { +}, { + ...styles2, + level: { + enumerable: true, + get() { + return this[GENERATOR].level; + }, + set(level) { + this[GENERATOR].level = level; + } + } +}); +var createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === void 0) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } + return { + open, + close, + openAll, + closeAll, + parent + }; +}; +var createBuilder = (self, _styler, _isEmpty) => { + const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); + Object.setPrototypeOf(builder, proto); + builder[GENERATOR] = self; + builder[STYLER] = _styler; + builder[IS_EMPTY] = _isEmpty; + return builder; +}; +var applyStyle = (self, string) => { + if (self.level <= 0 || !string) { + return self[IS_EMPTY] ? "" : string; + } + let styler = self[STYLER]; + if (styler === void 0) { + return string; + } + const { openAll, closeAll } = styler; + if (string.includes("\x1B")) { + while (styler !== void 0) { + string = stringReplaceAll2(string, styler.close, styler.open); + styler = styler.parent; + } + } + const lfIndex = string.indexOf("\n"); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } + return openAll + string + closeAll; +}; +Object.defineProperties(createChalk.prototype, styles2); +var chalk = createChalk(); +var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); +var source_default = chalk; + +// node_modules/leven/index.js +var array = []; +var characterCodeCache = []; +function leven(first, second) { + if (first === second) { + return 0; + } + const swap = first; + if (first.length > second.length) { + first = second; + second = swap; + } + let firstLength = first.length; + let secondLength = second.length; + while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) { + firstLength--; + secondLength--; + } + let start = 0; + while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) { + start++; + } + firstLength -= start; + secondLength -= start; + if (firstLength === 0) { + return secondLength; + } + let bCharacterCode; + let result; + let temporary; + let temporary2; + let index = 0; + let index2 = 0; + while (index < firstLength) { + characterCodeCache[index] = first.charCodeAt(start + index); + array[index] = ++index; + } + while (index2 < secondLength) { + bCharacterCode = second.charCodeAt(start + index2); + temporary = index2++; + result = index2; + for (index = 0; index < firstLength; index++) { + temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1; + temporary = array[index]; + result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2; + } + } + return result; +} + +// src/cli/options/normalize-cli-options.js +var descriptor = { + key: (key) => key.length === 1 ? `-${key}` : `--${key}`, + value: (value) => vnopts.apiDescriptor.value(value), + pair: ({ key, value }) => value === false ? `--no-${key}` : value === true ? descriptor.key(key) : value === "" ? `${descriptor.key(key)} without an argument` : `${descriptor.key(key)}=${value}` +}; +var _flags; +var FlagSchema = class extends vnopts.ChoiceSchema { + constructor({ name, flags }) { + super({ name, choices: flags }); + __privateAdd(this, _flags, []); + __privateSet(this, _flags, [...flags].sort()); + } + preprocess(value, utils) { + if (typeof value === "string" && value.length > 0 && !__privateGet(this, _flags).includes(value)) { + const suggestion = __privateGet(this, _flags).find((flag) => leven(flag, value) < 3); + if (suggestion) { + utils.logger.warn( + [ + `Unknown flag ${source_default.yellow(utils.descriptor.value(value))},`, + `did you mean ${source_default.blue(utils.descriptor.value(suggestion))}?` + ].join(" ") + ); + return suggestion; + } + } + return value; + } + expected() { + return "a flag"; + } +}; +_flags = new WeakMap(); +function normalizeCliOptions(options, optionInfos, opts) { + return normalizeOptions(options, optionInfos, { + ...opts, + isCLI: true, + FlagSchema, + descriptor + }); +} +var normalize_cli_options_default = normalizeCliOptions; + +// src/cli/options/parse-cli-arguments.js +function parseArgv(rawArguments, detailedOptions, logger, keys2) { + var _a; + const minimistOptions = createMinimistOptions(detailedOptions); + let argv = minimistParse(rawArguments, minimistOptions); + if (keys2) { + detailedOptions = detailedOptions.filter( + (option) => keys2.includes(option.name) + ); + argv = pick(argv, keys2); + } + const normalized = normalize_cli_options_default(argv, detailedOptions, { logger }); + return { + ...Object.fromEntries( + Object.entries(normalized).map(([key, value]) => { + const option = detailedOptions.find(({ name }) => name === key) || {}; + return [option.forwardToApi || camelCase(key), value]; + }) + ), + _: (_a = normalized._) == null ? void 0 : _a.map(String), + get __raw() { + return argv; + } + }; +} +var { detailedOptions: detailedOptionsWithoutPlugins } = getContextOptionsWithoutPlugins(); +function parseArgvWithoutPlugins(rawArguments, logger, keys2) { + return parseArgv( + rawArguments, + detailedOptionsWithoutPlugins, + logger, + typeof keys2 === "string" ? [keys2] : keys2 + ); +} + +// src/cli/context.js +var _stack; +var Context = class { + constructor({ rawArguments, logger }) { + __privateAdd(this, _stack, []); + this.rawArguments = rawArguments; + this.logger = logger; + } + async init() { + const { rawArguments, logger } = this; + const { plugins } = parseArgvWithoutPlugins(rawArguments, logger, [ + "plugin" + ]); + await this.pushContextPlugins(plugins); + const argv = parseArgv(rawArguments, this.detailedOptions, logger); + this.argv = argv; + this.filePatterns = argv._; + } + /** + * @param {string[]} plugins + */ + async pushContextPlugins(plugins) { + const options = await getContextOptions(plugins); + __privateGet(this, _stack).push(options); + Object.assign(this, options); + } + popContextPlugins() { + __privateGet(this, _stack).pop(); + Object.assign(this, at_default( + /* isOptionalObject */ + false, + __privateGet(this, _stack), + -1 + )); + } + // eslint-disable-next-line getter-return + get performanceTestFlag() { + const { debugBenchmark, debugRepeat } = this.argv; + if (debugBenchmark) { + return { + name: "--debug-benchmark", + debugBenchmark: true + }; + } + if (debugRepeat > 0) { + return { + name: "--debug-repeat", + debugRepeat + }; + } + const { PRETTIER_PERF_REPEAT } = process.env; + if (PRETTIER_PERF_REPEAT && /^\d+$/u.test(PRETTIER_PERF_REPEAT)) { + return { + name: "PRETTIER_PERF_REPEAT (environment variable)", + debugRepeat: Number(PRETTIER_PERF_REPEAT) + }; + } + } +}; +_stack = new WeakMap(); +var context_default = Context; + +// src/cli/file-info.js +var import_fast_json_stable_stringify = __toESM(require_fast_json_stable_stringify(), 1); +import { format, getFileInfo } from "../index.mjs"; +async function logFileInfoOrDie(context) { + const { + fileInfo: file, + ignorePath, + withNodeModules, + plugins, + config + } = context.argv; + const fileInfo = await getFileInfo(file, { + ignorePath, + withNodeModules, + plugins, + resolveConfig: config !== false + }); + printToScreen(await format((0, import_fast_json_stable_stringify.default)(fileInfo), { parser: "json" })); +} +var file_info_default = logFileInfoOrDie; + +// src/cli/find-config-path.js +import path2 from "path"; +import { resolveConfigFile } from "../index.mjs"; +async function logResolvedConfigPathOrDie(context) { + const file = context.argv.findConfigPath; + const configFile = await resolveConfigFile(file); + if (configFile) { + printToScreen(normalizeToPosix(path2.relative(process.cwd(), configFile))); + } else { + throw new Error(`Can not find configure file for "${file}".`); + } +} +var find_config_path_default = logResolvedConfigPathOrDie; + +// src/cli/format.js +import fs8 from "fs/promises"; +import path11 from "path"; +import * as prettier from "../index.mjs"; + +// src/cli/expand-patterns.js +import path3 from "path"; +async function* expandPatterns(context) { + const seen = /* @__PURE__ */ new Set(); + let noResults = true; + for await (const { filePath, ignoreUnknown, error } of expandPatternsInternal( + context + )) { + noResults = false; + if (error) { + yield { error }; + continue; + } + const filename = path3.resolve(filePath); + if (seen.has(filename)) { + continue; + } + seen.add(filename); + yield { filename, ignoreUnknown }; + } + if (noResults && context.argv.errorOnUnmatchedPattern !== false) { + yield { + error: `No matching files. Patterns: ${context.filePatterns.join(" ")}` + }; + } +} +async function* expandPatternsInternal(context) { + const silentlyIgnoredDirs = [".git", ".sl", ".svn", ".hg", ".jj"]; + if (context.argv.withNodeModules !== true) { + silentlyIgnoredDirs.push("node_modules"); + } + const globOptions = { + dot: true, + ignore: silentlyIgnoredDirs.map((dir) => "**/" + dir), + followSymbolicLinks: false + }; + const cwd2 = process.cwd(); + const entries = []; + for (const pattern of context.filePatterns) { + const absolutePath = path3.resolve(cwd2, pattern); + if (containsIgnoredPathSegment(absolutePath, cwd2, silentlyIgnoredDirs)) { + continue; + } + const stat = await lstatSafe(absolutePath); + if (stat) { + if (stat.isSymbolicLink()) { + if (context.argv.errorOnUnmatchedPattern !== false) { + yield { + error: `Explicitly specified pattern "${pattern}" is a symbolic link.` + }; + } else { + context.logger.debug( + `Skipping pattern "${pattern}", as it is a symbolic link.` + ); + } + } else if (stat.isFile()) { + entries.push({ + type: "file", + glob: escapePathForGlob(fixWindowsSlashes(pattern)), + input: pattern + }); + } else if (stat.isDirectory()) { + const relativePath = path3.relative(cwd2, absolutePath) || "."; + const prefix = escapePathForGlob(fixWindowsSlashes(relativePath)); + entries.push({ + type: "dir", + glob: `${prefix}/**/*`, + input: pattern, + ignoreUnknown: true + }); + } + } else if (pattern[0] === "!") { + globOptions.ignore.push(fixWindowsSlashes(pattern.slice(1))); + } else { + entries.push({ + type: "glob", + glob: fixWindowsSlashes(pattern), + input: pattern + }); + } + } + for (const { type, glob, input, ignoreUnknown } of entries) { + let result; + try { + result = await fastGlob(glob, globOptions); + } catch ({ message }) { + yield { + error: `${errorMessages.globError[type]}: "${input}". +${message}` + }; + continue; + } + if (result.length === 0) { + if (context.argv.errorOnUnmatchedPattern !== false) { + yield { error: `${errorMessages.emptyResults[type]}: "${input}".` }; + } + } else { + yield* sortPaths(result).map((filePath) => ({ filePath, ignoreUnknown })); + } + } +} +var errorMessages = { + globError: { + file: "Unable to resolve file", + dir: "Unable to expand directory", + glob: "Unable to expand glob pattern" + }, + emptyResults: { + file: "Explicitly specified file was ignored due to negative glob patterns", + dir: "No supported files were found in the directory", + glob: "No files matching the pattern were found" + } +}; +function containsIgnoredPathSegment(absolutePath, cwd2, ignoredDirectories) { + return path3.relative(cwd2, absolutePath).split(path3.sep).some((dir) => ignoredDirectories.includes(dir)); +} +function sortPaths(paths) { + return paths.sort((a, b) => a.localeCompare(b)); +} +function escapePathForGlob(path12) { + return string_replace_all_default( + /* isOptionalObject */ + false, + string_replace_all_default( + /* isOptionalObject */ + false, + fastGlob.escapePath( + string_replace_all_default( + /* isOptionalObject */ + false, + path12, + "\\", + "\0" + ) + // Workaround for fast-glob#262 (part 1) + ), + String.raw`\!`, + "@(!)" + ), + "\0", + String.raw`@(\\)` + ); +} +var fixWindowsSlashes = normalizeToPosix; + +// src/cli/find-cache-file.js +import fs4 from "fs/promises"; +import os2 from "os"; +import path8 from "path"; + +// node_modules/find-cache-dir/index.js +var import_common_path_prefix = __toESM(require_common_path_prefix(), 1); +import process4 from "process"; +import path7 from "path"; +import fs3 from "fs"; + +// node_modules/pkg-dir/index.js +import path6 from "path"; + +// node_modules/pkg-dir/node_modules/find-up/index.js +import path5 from "path"; +import { fileURLToPath as fileURLToPath2 } from "url"; + +// node_modules/locate-path/index.js +import process3 from "process"; +import path4 from "path"; +import fs2, { promises as fsPromises } from "fs"; +import { fileURLToPath } from "url"; +var typeMappings = { + directory: "isDirectory", + file: "isFile" +}; +function checkType(type) { + if (Object.hasOwnProperty.call(typeMappings, type)) { + return; + } + throw new Error(`Invalid type specified: ${type}`); +} +var matchType = (type, stat) => stat[typeMappings[type]](); +var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath; +function locatePathSync(paths, { + cwd: cwd2 = process3.cwd(), + type = "file", + allowSymlinks = true +} = {}) { + checkType(type); + cwd2 = toPath(cwd2); + const statFunction = allowSymlinks ? fs2.statSync : fs2.lstatSync; + for (const path_ of paths) { + try { + const stat = statFunction(path4.resolve(cwd2, path_), { + throwIfNoEntry: false + }); + if (!stat) { + continue; + } + if (matchType(type, stat)) { + return path_; + } + } catch { + } + } +} + +// node_modules/pkg-dir/node_modules/find-up/index.js +var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath; +var findUpStop = Symbol("findUpStop"); +function findUpMultipleSync(name, options = {}) { + let directory = path5.resolve(toPath2(options.cwd) || ""); + const { root } = path5.parse(directory); + const stopAt = options.stopAt || root; + const limit = options.limit || Number.POSITIVE_INFINITY; + const paths = [name].flat(); + const runMatcher = (locateOptions) => { + if (typeof name !== "function") { + return locatePathSync(paths, locateOptions); + } + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === "string") { + return locatePathSync([foundPath], locateOptions); + } + return foundPath; + }; + const matches = []; + while (true) { + const foundPath = runMatcher({ ...options, cwd: directory }); + if (foundPath === findUpStop) { + break; + } + if (foundPath) { + matches.push(path5.resolve(directory, foundPath)); + } + if (directory === stopAt || matches.length >= limit) { + break; + } + directory = path5.dirname(directory); + } + return matches; +} +function findUpSync(name, options = {}) { + const matches = findUpMultipleSync(name, { ...options, limit: 1 }); + return matches[0]; +} + +// node_modules/pkg-dir/index.js +function packageDirectorySync({ cwd: cwd2 } = {}) { + const filePath = findUpSync("package.json", { cwd: cwd2 }); + return filePath && path6.dirname(filePath); +} + +// node_modules/find-cache-dir/index.js +var { env: env2, cwd } = process4; +var isWritable = (path12) => { + try { + fs3.accessSync(path12, fs3.constants.W_OK); + return true; + } catch { + return false; + } +}; +function useDirectory(directory, options) { + if (options.create) { + fs3.mkdirSync(directory, { recursive: true }); + } + return directory; +} +function getNodeModuleDirectory(directory) { + const nodeModules = path7.join(directory, "node_modules"); + if (!isWritable(nodeModules) && (fs3.existsSync(nodeModules) || !isWritable(path7.join(directory)))) { + return; + } + return nodeModules; +} +function findCacheDirectory(options = {}) { + if (env2.CACHE_DIR && !["true", "false", "1", "0"].includes(env2.CACHE_DIR)) { + return useDirectory(path7.join(env2.CACHE_DIR, options.name), options); + } + let { cwd: directory = cwd(), files } = options; + if (files) { + if (!Array.isArray(files)) { + throw new TypeError(`Expected \`files\` option to be an array, got \`${typeof files}\`.`); + } + directory = (0, import_common_path_prefix.default)(files.map((file) => path7.resolve(directory, file))); + } + directory = packageDirectorySync({ cwd: directory }); + if (!directory) { + return; + } + const nodeModules = getNodeModuleDirectory(directory); + if (!nodeModules) { + return; + } + return useDirectory(path7.join(directory, "node_modules", ".cache", options.name), options); +} + +// src/cli/find-cache-file.js +function findDefaultCacheFile() { + const cacheDir = findCacheDirectory({ name: "prettier", create: true }) || os2.tmpdir(); + const cacheFilePath = path8.join(cacheDir, ".prettier-cache"); + return cacheFilePath; +} +async function findCacheFileFromOption(cacheLocation) { + const cacheFile = path8.resolve(cacheLocation); + const stat = await statSafe(cacheFile); + if (stat) { + if (stat.isDirectory()) { + throw new Error( + `Resolved --cache-location '${cacheFile}' is a directory` + ); + } + const data = await fs4.readFile(cacheFile, "utf8"); + if (!isJson(data)) { + throw new Error(`'${cacheFile}' isn't a valid JSON file`); + } + } + return cacheFile; +} +async function findCacheFile(cacheLocation) { + if (!cacheLocation) { + return findDefaultCacheFile(); + } + const cacheFile = await findCacheFileFromOption(cacheLocation); + return cacheFile; +} +var find_cache_file_default = findCacheFile; + +// src/cli/format-results-cache.js +var import_fast_json_stable_stringify2 = __toESM(require_fast_json_stable_stringify(), 1); +import fs7 from "fs"; + +// node_modules/file-entry-cache/dist/index.js +import crypto2 from "crypto"; +import fs6 from "fs"; +import path10 from "path"; + +// node_modules/file-entry-cache/node_modules/flat-cache/dist/index.js +import path9 from "path"; +import fs5 from "fs"; + +// node_modules/hookified/dist/node/index.js +var Eventified = class { + _eventListeners; + _maxListeners; + constructor() { + this._eventListeners = /* @__PURE__ */ new Map(); + this._maxListeners = 100; + } + /** + * Adds a handler function for a specific event that will run only once + * @param {string | symbol} eventName + * @param {EventListener} listener + * @returns {IEventEmitter} returns the instance of the class for chaining + */ + once(eventName, listener) { + const onceListener = (...arguments_) => { + this.off(eventName, onceListener); + listener(...arguments_); + }; + this.on(eventName, onceListener); + return this; + } + /** + * Gets the number of listeners for a specific event. If no event is provided, it returns the total number of listeners + * @param {string} eventName The event name. Not required + * @returns {number} The number of listeners + */ + listenerCount(eventName) { + if (!eventName) { + return this.getAllListeners().length; + } + const listeners = this._eventListeners.get(eventName); + return listeners ? listeners.length : 0; + } + /** + * Gets an array of event names + * @returns {Array} An array of event names + */ + eventNames() { + return Array.from(this._eventListeners.keys()); + } + /** + * Gets an array of listeners for a specific event. If no event is provided, it returns all listeners + * @param {string} [event] (Optional) The event name + * @returns {EventListener[]} An array of listeners + */ + rawListeners(event) { + if (!event) { + return this.getAllListeners(); + } + return this._eventListeners.get(event) ?? []; + } + /** + * Prepends a listener to the beginning of the listeners array for the specified event + * @param {string | symbol} eventName + * @param {EventListener} listener + * @returns {IEventEmitter} returns the instance of the class for chaining + */ + prependListener(eventName, listener) { + const listeners = this._eventListeners.get(eventName) ?? []; + listeners.unshift(listener); + this._eventListeners.set(eventName, listeners); + return this; + } + /** + * Prepends a one-time listener to the beginning of the listeners array for the specified event + * @param {string | symbol} eventName + * @param {EventListener} listener + * @returns {IEventEmitter} returns the instance of the class for chaining + */ + prependOnceListener(eventName, listener) { + const onceListener = (...arguments_) => { + this.off(eventName, onceListener); + listener(...arguments_); + }; + this.prependListener(eventName, onceListener); + return this; + } + /** + * Gets the maximum number of listeners that can be added for a single event + * @returns {number} The maximum number of listeners + */ + maxListeners() { + return this._maxListeners; + } + /** + * Adds a listener for a specific event. It is an alias for the on() method + * @param {string | symbol} event + * @param {EventListener} listener + * @returns {IEventEmitter} returns the instance of the class for chaining + */ + addListener(event, listener) { + this.on(event, listener); + return this; + } + /** + * Adds a listener for a specific event + * @param {string | symbol} event + * @param {EventListener} listener + * @returns {IEventEmitter} returns the instance of the class for chaining + */ + on(event, listener) { + if (!this._eventListeners.has(event)) { + this._eventListeners.set(event, []); + } + const listeners = this._eventListeners.get(event); + if (listeners) { + if (listeners.length >= this._maxListeners) { + console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${listeners.length + 1} ${event} listeners added. Use setMaxListeners() to increase limit.`); + } + listeners.push(listener); + } + return this; + } + /** + * Removes a listener for a specific event. It is an alias for the off() method + * @param {string | symbol} event + * @param {EventListener} listener + * @returns {IEventEmitter} returns the instance of the class for chaining + */ + removeListener(event, listener) { + this.off(event, listener); + return this; + } + /** + * Removes a listener for a specific event + * @param {string | symbol} event + * @param {EventListener} listener + * @returns {IEventEmitter} returns the instance of the class for chaining + */ + off(event, listener) { + const listeners = this._eventListeners.get(event) ?? []; + const index = listeners.indexOf(listener); + if (index !== -1) { + listeners.splice(index, 1); + } + if (listeners.length === 0) { + this._eventListeners.delete(event); + } + return this; + } + /** + * Calls all listeners for a specific event + * @param {string | symbol} event + * @param arguments_ The arguments to pass to the listeners + * @returns {boolean} Returns true if the event had listeners, false otherwise + */ + emit(event, ...arguments_) { + let result = false; + const listeners = this._eventListeners.get(event); + if (listeners && listeners.length > 0) { + for (const listener of listeners) { + listener(...arguments_); + result = true; + } + } + return result; + } + /** + * Gets all listeners for a specific event. If no event is provided, it returns all listeners + * @param {string} [event] (Optional) The event name + * @returns {EventListener[]} An array of listeners + */ + listeners(event) { + return this._eventListeners.get(event) ?? []; + } + /** + * Removes all listeners for a specific event. If no event is provided, it removes all listeners + * @param {string} [event] (Optional) The event name + * @returns {IEventEmitter} returns the instance of the class for chaining + */ + removeAllListeners(event) { + if (event) { + this._eventListeners.delete(event); + } else { + this._eventListeners.clear(); + } + return this; + } + /** + * Sets the maximum number of listeners that can be added for a single event + * @param {number} n The maximum number of listeners + * @returns {void} + */ + setMaxListeners(n) { + this._maxListeners = n; + for (const listeners of this._eventListeners.values()) { + if (listeners.length > n) { + listeners.splice(n); + } + } + } + /** + * Gets all listeners + * @returns {EventListener[]} An array of listeners + */ + getAllListeners() { + let result = new Array(); + for (const listeners of this._eventListeners.values()) { + result = result.concat(listeners); + } + return result; + } +}; +var Hookified = class extends Eventified { + _hooks; + _throwHookErrors = false; + constructor(options) { + super(); + this._hooks = /* @__PURE__ */ new Map(); + if ((options == null ? void 0 : options.throwHookErrors) !== void 0) { + this._throwHookErrors = options.throwHookErrors; + } + } + /** + * Gets all hooks + * @returns {Map} + */ + get hooks() { + return this._hooks; + } + /** + * Gets whether an error should be thrown when a hook throws an error. Default is false and only emits an error event. + * @returns {boolean} + */ + get throwHookErrors() { + return this._throwHookErrors; + } + /** + * Sets whether an error should be thrown when a hook throws an error. Default is false and only emits an error event. + * @param {boolean} value + */ + set throwHookErrors(value) { + this._throwHookErrors = value; + } + /** + * Adds a handler function for a specific event + * @param {string} event + * @param {Hook} handler - this can be async or sync + * @returns {void} + */ + onHook(event, handler) { + const eventHandlers = this._hooks.get(event); + if (eventHandlers) { + eventHandlers.push(handler); + } else { + this._hooks.set(event, [handler]); + } + } + /** + * Adds a handler function for a specific event that runs before all other handlers + * @param {string} event + * @param {Hook} handler - this can be async or sync + * @returns {void} + */ + prependHook(event, handler) { + const eventHandlers = this._hooks.get(event); + if (eventHandlers) { + eventHandlers.unshift(handler); + } else { + this._hooks.set(event, [handler]); + } + } + /** + * Adds a handler that only executes once for a specific event before all other handlers + * @param event + * @param handler + */ + prependOnceHook(event, handler) { + const hook = async (...arguments_) => { + this.removeHook(event, hook); + return handler(...arguments_); + }; + this.prependHook(event, hook); + } + /** + * Adds a handler that only executes once for a specific event + * @param event + * @param handler + */ + onceHook(event, handler) { + const hook = async (...arguments_) => { + this.removeHook(event, hook); + return handler(...arguments_); + }; + this.onHook(event, hook); + } + /** + * Removes a handler function for a specific event + * @param {string} event + * @param {Hook} handler + * @returns {void} + */ + removeHook(event, handler) { + const eventHandlers = this._hooks.get(event); + if (eventHandlers) { + const index = eventHandlers.indexOf(handler); + if (index !== -1) { + eventHandlers.splice(index, 1); + } + } + } + /** + * Calls all handlers for a specific event + * @param {string} event + * @param {T[]} arguments_ + * @returns {Promise} + */ + async hook(event, ...arguments_) { + const eventHandlers = this._hooks.get(event); + if (eventHandlers) { + for (const handler of eventHandlers) { + try { + await handler(...arguments_); + } catch (error) { + const message = `${event}: ${error.message}`; + this.emit("error", new Error(message)); + if (this._throwHookErrors) { + throw new Error(message); + } + } + } + } + } + /** + * Gets all hooks for a specific event + * @param {string} event + * @returns {Hook[]} + */ + getHooks(event) { + return this._hooks.get(event); + } + /** + * Removes all hooks + * @returns {void} + */ + clearHooks() { + this._hooks.clear(); + } +}; + +// node_modules/cacheable/dist/index.js +import * as crypto from "crypto"; +var structuredClone = globalThis.structuredClone ?? ((value) => JSON.parse(JSON.stringify(value))); +var shorthandToMilliseconds = (shorthand) => { + let milliseconds; + if (shorthand === void 0) { + return void 0; + } + if (typeof shorthand === "number") { + milliseconds = shorthand; + } else if (typeof shorthand === "string") { + shorthand = shorthand.trim(); + if (Number.isNaN(Number(shorthand))) { + const match = /^([\d.]+)\s*(ms|s|m|h|hr|d)$/i.exec(shorthand); + if (!match) { + throw new Error( + `Unsupported time format: "${shorthand}". Use 'ms', 's', 'm', 'h', 'hr', or 'd'.` + ); + } + const [, value, unit] = match; + const numericValue = Number.parseFloat(value); + const unitLower = unit.toLowerCase(); + switch (unitLower) { + case "ms": { + milliseconds = numericValue; + break; + } + case "s": { + milliseconds = numericValue * 1e3; + break; + } + case "m": { + milliseconds = numericValue * 1e3 * 60; + break; + } + case "h": { + milliseconds = numericValue * 1e3 * 60 * 60; + break; + } + case "hr": { + milliseconds = numericValue * 1e3 * 60 * 60; + break; + } + case "d": { + milliseconds = numericValue * 1e3 * 60 * 60 * 24; + break; + } + /* c8 ignore next 3 */ + default: { + milliseconds = Number(shorthand); + } + } + } else { + milliseconds = Number(shorthand); + } + } else { + throw new TypeError("Time must be a string or a number."); + } + return milliseconds; +}; +var shorthandToTime = (shorthand, fromDate) => { + fromDate || (fromDate = /* @__PURE__ */ new Date()); + const milliseconds = shorthandToMilliseconds(shorthand); + if (milliseconds === void 0) { + return fromDate.getTime(); + } + return fromDate.getTime() + milliseconds; +}; +function hash(object2, algorithm = "sha256") { + const objectString = JSON.stringify(object2); + if (!crypto.getHashes().includes(algorithm)) { + throw new Error(`Unsupported hash algorithm: '${algorithm}'`); + } + const hasher = crypto.createHash(algorithm); + hasher.update(objectString); + return hasher.digest("hex"); +} +function wrapSync(function_, options) { + const { ttl, keyPrefix, cache } = options; + return function(...arguments_) { + const cacheKey = createWrapKey(function_, arguments_, keyPrefix); + let value = cache.get(cacheKey); + if (value === void 0) { + try { + value = function_(...arguments_); + cache.set(cacheKey, value, ttl); + } catch (error) { + cache.emit("error", error); + if (options.cacheErrors) { + cache.set(cacheKey, error, ttl); + } + } + } + return value; + }; +} +function createWrapKey(function_, arguments_, keyPrefix) { + if (!keyPrefix) { + return `${function_.name}::${hash(arguments_)}`; + } + return `${keyPrefix}::${function_.name}::${hash(arguments_)}`; +} +var ListNode = class { + // eslint-disable-next-line @typescript-eslint/parameter-properties + value; + prev = void 0; + next = void 0; + constructor(value) { + this.value = value; + } +}; +var DoublyLinkedList = class { + head = void 0; + tail = void 0; + nodesMap = /* @__PURE__ */ new Map(); + // Add a new node to the front (most recently used) + addToFront(value) { + const newNode = new ListNode(value); + if (this.head) { + newNode.next = this.head; + this.head.prev = newNode; + this.head = newNode; + } else { + this.head = this.tail = newNode; + } + this.nodesMap.set(value, newNode); + } + // Move an existing node to the front (most recently used) + moveToFront(value) { + const node = this.nodesMap.get(value); + if (!node || this.head === node) { + return; + } + if (node.prev) { + node.prev.next = node.next; + } + if (node.next) { + node.next.prev = node.prev; + } + if (node === this.tail) { + this.tail = node.prev; + } + node.prev = void 0; + node.next = this.head; + if (this.head) { + this.head.prev = node; + } + this.head = node; + this.tail || (this.tail = node); + } + // Get the oldest node (tail) + getOldest() { + return this.tail ? this.tail.value : void 0; + } + // Remove the oldest node (tail) + removeOldest() { + if (!this.tail) { + return void 0; + } + const oldValue = this.tail.value; + if (this.tail.prev) { + this.tail = this.tail.prev; + this.tail.next = void 0; + } else { + this.head = this.tail = void 0; + } + this.nodesMap.delete(oldValue); + return oldValue; + } + get size() { + return this.nodesMap.size; + } +}; +var CacheableMemory = class extends Hookified { + _lru = new DoublyLinkedList(); + _hashCache = /* @__PURE__ */ new Map(); + _hash0 = /* @__PURE__ */ new Map(); + _hash1 = /* @__PURE__ */ new Map(); + _hash2 = /* @__PURE__ */ new Map(); + _hash3 = /* @__PURE__ */ new Map(); + _hash4 = /* @__PURE__ */ new Map(); + _hash5 = /* @__PURE__ */ new Map(); + _hash6 = /* @__PURE__ */ new Map(); + _hash7 = /* @__PURE__ */ new Map(); + _hash8 = /* @__PURE__ */ new Map(); + _hash9 = /* @__PURE__ */ new Map(); + _ttl; + // Turned off by default + _useClone = true; + // Turned on by default + _lruSize = 0; + // Turned off by default + _checkInterval = 0; + // Turned off by default + _interval = 0; + // Turned off by default + /** + * @constructor + * @param {CacheableMemoryOptions} [options] - The options for the CacheableMemory + */ + constructor(options) { + super(); + if (options == null ? void 0 : options.ttl) { + this.setTtl(options.ttl); + } + if ((options == null ? void 0 : options.useClone) !== void 0) { + this._useClone = options.useClone; + } + if (options == null ? void 0 : options.lruSize) { + this._lruSize = options.lruSize; + } + if (options == null ? void 0 : options.checkInterval) { + this._checkInterval = options.checkInterval; + } + this.startIntervalCheck(); + } + /** + * Gets the time-to-live + * @returns {number|string|undefined} - The time-to-live in miliseconds or a human-readable format. If undefined, it will not have a time-to-live. + */ + get ttl() { + return this._ttl; + } + /** + * Sets the time-to-live + * @param {number|string|undefined} value - The time-to-live in miliseconds or a human-readable format (example '1s' = 1 second, '1h' = 1 hour). If undefined, it will not have a time-to-live. + */ + set ttl(value) { + this.setTtl(value); + } + /** + * Gets whether to use clone + * @returns {boolean} - If true, it will clone the value before returning it. If false, it will return the value directly. Default is true. + */ + get useClone() { + return this._useClone; + } + /** + * Sets whether to use clone + * @param {boolean} value - If true, it will clone the value before returning it. If false, it will return the value directly. Default is true. + */ + set useClone(value) { + this._useClone = value; + } + /** + * Gets the size of the LRU cache + * @returns {number} - The size of the LRU cache. If set to 0, it will not use LRU cache. Default is 0. + */ + get lruSize() { + return this._lruSize; + } + /** + * Sets the size of the LRU cache + * @param {number} value - The size of the LRU cache. If set to 0, it will not use LRU cache. Default is 0. + */ + set lruSize(value) { + this._lruSize = value; + this.lruResize(); + } + /** + * Gets the check interval + * @returns {number} - The interval to check for expired items. If set to 0, it will not check for expired items. Default is 0. + */ + get checkInterval() { + return this._checkInterval; + } + /** + * Sets the check interval + * @param {number} value - The interval to check for expired items. If set to 0, it will not check for expired items. Default is 0. + */ + set checkInterval(value) { + this._checkInterval = value; + } + /** + * Gets the size of the cache + * @returns {number} - The size of the cache + */ + get size() { + return this._hash0.size + this._hash1.size + this._hash2.size + this._hash3.size + this._hash4.size + this._hash5.size + this._hash6.size + this._hash7.size + this._hash8.size + this._hash9.size; + } + /** + * Gets the keys + * @returns {IterableIterator} - The keys + */ + get keys() { + return this.concatStores().keys(); + } + /** + * Gets the items + * @returns {IterableIterator} - The items + */ + get items() { + return this.concatStores().values(); + } + /** + * Gets the value of the key + * @param {string} key - The key to get the value + * @returns {T | undefined} - The value of the key + */ + get(key) { + const store = this.getStore(key); + const item = store.get(key); + if (!item) { + return void 0; + } + if (item.expires && item.expires && Date.now() > item.expires) { + store.delete(key); + return void 0; + } + this.lruMoveToFront(key); + if (!this._useClone) { + return item.value; + } + return this.clone(item.value); + } + /** + * Gets the values of the keys + * @param {string[]} keys - The keys to get the values + * @returns {T[]} - The values of the keys + */ + getMany(keys2) { + const result = new Array(); + for (const key of keys2) { + result.push(this.get(key)); + } + return result; + } + /** + * Gets the raw value of the key + * @param {string} key - The key to get the value + * @returns {CacheableStoreItem | undefined} - The raw value of the key + */ + getRaw(key) { + const store = this.getStore(key); + const item = store.get(key); + if (!item) { + return void 0; + } + if (item.expires && item.expires && Date.now() > item.expires) { + store.delete(key); + return void 0; + } + this.lruMoveToFront(key); + return item; + } + /** + * Gets the raw values of the keys + * @param {string[]} keys - The keys to get the values + * @returns {CacheableStoreItem[]} - The raw values of the keys + */ + getManyRaw(keys2) { + const result = new Array(); + for (const key of keys2) { + result.push(this.getRaw(key)); + } + return result; + } + /** + * Sets the value of the key + * @param {string} key - The key to set the value + * @param {any} value - The value to set + * @param {number|string|SetOptions} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable. + * If you want to set expire directly you can do that by setting the expire property in the SetOptions. + * If you set undefined, it will use the default time-to-live. If both are undefined then it will not have a time-to-live. + * @returns {void} + */ + set(key, value, ttl) { + const store = this.getStore(key); + let expires; + if (ttl !== void 0 || this._ttl !== void 0) { + if (typeof ttl === "object") { + if (ttl.expire) { + expires = typeof ttl.expire === "number" ? ttl.expire : ttl.expire.getTime(); + } + if (ttl.ttl) { + const finalTtl = shorthandToTime(ttl.ttl); + if (finalTtl !== void 0) { + expires = finalTtl; + } + } + } else { + const finalTtl = shorthandToTime(ttl ?? this._ttl); + if (finalTtl !== void 0) { + expires = finalTtl; + } + } + } + if (this._lruSize > 0) { + if (store.has(key)) { + this.lruMoveToFront(key); + } else { + this.lruAddToFront(key); + if (this._lru.size > this._lruSize) { + const oldestKey = this._lru.getOldest(); + if (oldestKey) { + this._lru.removeOldest(); + this.delete(oldestKey); + } + } + } + } + const item = { key, value, expires }; + store.set( + key, + item + ); + } + /** + * Sets the values of the keys + * @param {CacheableItem[]} items - The items to set + * @returns {void} + */ + setMany(items) { + for (const item of items) { + this.set(item.key, item.value, item.ttl); + } + } + /** + * Checks if the key exists + * @param {string} key - The key to check + * @returns {boolean} - If true, the key exists. If false, the key does not exist. + */ + has(key) { + const item = this.get(key); + return Boolean(item); + } + /** + * @function hasMany + * @param {string[]} keys - The keys to check + * @returns {boolean[]} - If true, the key exists. If false, the key does not exist. + */ + hasMany(keys2) { + const result = new Array(); + for (const key of keys2) { + const item = this.get(key); + result.push(Boolean(item)); + } + return result; + } + /** + * Take will get the key and delete the entry from cache + * @param {string} key - The key to take + * @returns {T | undefined} - The value of the key + */ + take(key) { + const item = this.get(key); + if (!item) { + return void 0; + } + this.delete(key); + return item; + } + /** + * TakeMany will get the keys and delete the entries from cache + * @param {string[]} keys - The keys to take + * @returns {T[]} - The values of the keys + */ + takeMany(keys2) { + const result = new Array(); + for (const key of keys2) { + result.push(this.take(key)); + } + return result; + } + /** + * Delete the key + * @param {string} key - The key to delete + * @returns {void} + */ + delete(key) { + const store = this.getStore(key); + store.delete(key); + } + /** + * Delete the keys + * @param {string[]} keys - The keys to delete + * @returns {void} + */ + deleteMany(keys2) { + for (const key of keys2) { + this.delete(key); + } + } + /** + * Clear the cache + * @returns {void} + */ + clear() { + this._hash0.clear(); + this._hash1.clear(); + this._hash2.clear(); + this._hash3.clear(); + this._hash4.clear(); + this._hash5.clear(); + this._hash6.clear(); + this._hash7.clear(); + this._hash8.clear(); + this._hash9.clear(); + this._hashCache.clear(); + this._lru = new DoublyLinkedList(); + } + /** + * Get the store based on the key (internal use) + * @param {string} key - The key to get the store + * @returns {CacheableHashStore} - The store + */ + getStore(key) { + const hash2 = this.hashKey(key); + return this.getStoreFromHash(hash2); + } + /** + * Get the store based on the hash (internal use) + * @param {number} hash + * @returns {Map} + */ + getStoreFromHash(hash2) { + switch (hash2) { + case 1: { + return this._hash1; + } + case 2: { + return this._hash2; + } + case 3: { + return this._hash3; + } + case 4: { + return this._hash4; + } + case 5: { + return this._hash5; + } + case 6: { + return this._hash6; + } + case 7: { + return this._hash7; + } + case 8: { + return this._hash8; + } + case 9: { + return this._hash9; + } + default: { + return this._hash0; + } + } + } + /** + * Hash the key (internal use) + * @param key + * @returns {number} from 0 to 9 + */ + hashKey(key) { + const cacheHashNumber = this._hashCache.get(key); + if (cacheHashNumber) { + return cacheHashNumber; + } + let hash2 = 0; + const primeMultiplier = 31; + for (let i = 0; i < key.length; i++) { + hash2 = hash2 * primeMultiplier + key.charCodeAt(i); + } + const result = Math.abs(hash2) % 10; + this._hashCache.set(key, result); + return result; + } + /** + * Clone the value. This is for internal use + * @param {any} value - The value to clone + * @returns {any} - The cloned value + */ + clone(value) { + if (this.isPrimitive(value)) { + return value; + } + return structuredClone(value); + } + /** + * Add to the front of the LRU cache. This is for internal use + * @param {string} key - The key to add to the front + * @returns {void} + */ + lruAddToFront(key) { + if (this._lruSize === 0) { + return; + } + this._lru.addToFront(key); + } + /** + * Move to the front of the LRU cache. This is for internal use + * @param {string} key - The key to move to the front + * @returns {void} + */ + lruMoveToFront(key) { + if (this._lruSize === 0) { + return; + } + this._lru.moveToFront(key); + } + /** + * Resize the LRU cache. This is for internal use + * @returns {void} + */ + lruResize() { + if (this._lruSize === 0) { + return; + } + while (this._lru.size > this._lruSize) { + const oldestKey = this._lru.getOldest(); + if (oldestKey) { + this._lru.removeOldest(); + this.delete(oldestKey); + } + } + } + /** + * Check for expiration. This is for internal use + * @returns {void} + */ + checkExpiration() { + const stores = this.concatStores(); + for (const item of stores.values()) { + if (item.expires && Date.now() > item.expires) { + this.delete(item.key); + } + } + } + /** + * Start the interval check. This is for internal use + * @returns {void} + */ + startIntervalCheck() { + if (this._checkInterval > 0) { + if (this._interval) { + clearInterval(this._interval); + } + this._interval = setInterval(() => { + this.checkExpiration(); + }, this._checkInterval).unref(); + } + } + /** + * Stop the interval check. This is for internal use + * @returns {void} + */ + stopIntervalCheck() { + if (this._interval) { + clearInterval(this._interval); + } + this._interval = 0; + this._checkInterval = 0; + } + /** + * Hash the object. This is for internal use + * @param {any} object - The object to hash + * @param {string} [algorithm='sha256'] - The algorithm to hash + * @returns {string} - The hashed string + */ + hash(object2, algorithm = "sha256") { + return hash(object2, algorithm); + } + /** + * Wrap the function for caching + * @param {Function} function_ - The function to wrap + * @param {Object} [options] - The options to wrap + * @returns {Function} - The wrapped function + */ + wrap(function_, options) { + const wrapOptions = { + ttl: (options == null ? void 0 : options.ttl) ?? this._ttl, + keyPrefix: options == null ? void 0 : options.keyPrefix, + cache: this + }; + return wrapSync(function_, wrapOptions); + } + isPrimitive(value) { + const result = false; + if (value === null || value === void 0) { + return true; + } + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + return true; + } + return result; + } + concatStores() { + return new Map([...this._hash0, ...this._hash1, ...this._hash2, ...this._hash3, ...this._hash4, ...this._hash5, ...this._hash6, ...this._hash7, ...this._hash8, ...this._hash9]); + } + setTtl(ttl) { + if (typeof ttl === "string" || ttl === void 0) { + this._ttl = ttl; + } else if (ttl > 0) { + this._ttl = ttl; + } else { + this._ttl = void 0; + } + } +}; + +// node_modules/flatted/esm/index.js +var { parse: $parse, stringify: $stringify } = JSON; +var { keys } = Object; +var Primitive = String; +var primitive = "string"; +var ignore = {}; +var object = "object"; +var noop = (_2, value) => value; +var primitives = (value) => value instanceof Primitive ? Primitive(value) : value; +var Primitives = (_2, value) => typeof value === primitive ? new Primitive(value) : value; +var revive = (input, parsed, output, $) => { + const lazy = []; + for (let ke = keys(output), { length } = ke, y = 0; y < length; y++) { + const k = ke[y]; + const value = output[k]; + if (value instanceof Primitive) { + const tmp = input[value]; + if (typeof tmp === object && !parsed.has(tmp)) { + parsed.add(tmp); + output[k] = ignore; + lazy.push({ k, a: [input, parsed, tmp, $] }); + } else + output[k] = $.call(output, k, tmp); + } else if (output[k] !== ignore) + output[k] = $.call(output, k, value); + } + for (let { length } = lazy, i = 0; i < length; i++) { + const { k, a } = lazy[i]; + output[k] = $.call(output, k, revive.apply(null, a)); + } + return output; +}; +var set = (known, input, value) => { + const index = Primitive(input.push(value) - 1); + known.set(value, index); + return index; +}; +var parse = (text, reviver) => { + const input = $parse(text, Primitives).map(primitives); + const value = input[0]; + const $ = reviver || noop; + const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value; + return $.call({ "": tmp }, "", tmp); +}; +var stringify2 = (value, replacer, space) => { + const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop; + const known = /* @__PURE__ */ new Map(); + const input = []; + const output = []; + let i = +set(known, input, $.call({ "": value }, "", value)); + let firstRun = !i; + while (i < input.length) { + firstRun = true; + output[i] = $stringify(input[i++], replace, space); + } + return "[" + output.join(",") + "]"; + function replace(key, value2) { + if (firstRun) { + firstRun = !firstRun; + return value2; + } + const after = $.call(this, key, value2); + switch (typeof after) { + case object: + if (after === null) return after; + case primitive: + return known.get(after) || set(known, input, after); + } + return after; + } +}; + +// node_modules/file-entry-cache/node_modules/flat-cache/dist/index.js +var FlatCache = class extends Hookified { + _cache = new CacheableMemory(); + _cacheDir = ".cache"; + _cacheId = "cache1"; + _persistInterval = 0; + _persistTimer; + _changesSinceLastSave = false; + _parse = parse; + _stringify = stringify2; + constructor(options) { + super(); + if (options) { + this._cache = new CacheableMemory({ + ttl: options.ttl, + useClone: options.useClone, + lruSize: options.lruSize, + checkInterval: options.expirationInterval + }); + } + if (options == null ? void 0 : options.cacheDir) { + this._cacheDir = options.cacheDir; + } + if (options == null ? void 0 : options.cacheId) { + this._cacheId = options.cacheId; + } + if (options == null ? void 0 : options.persistInterval) { + this._persistInterval = options.persistInterval; + this.startAutoPersist(); + } + if (options == null ? void 0 : options.deserialize) { + this._parse = options.deserialize; + } + if (options == null ? void 0 : options.serialize) { + this._stringify = options.serialize; + } + } + /** + * The cache object + * @property cache + * @type {CacheableMemory} + */ + get cache() { + return this._cache; + } + /** + * The cache directory + * @property cacheDir + * @type {String} + * @default '.cache' + */ + get cacheDir() { + return this._cacheDir; + } + /** + * Set the cache directory + * @property cacheDir + * @type {String} + * @default '.cache' + */ + set cacheDir(value) { + this._cacheDir = value; + } + /** + * The cache id + * @property cacheId + * @type {String} + * @default 'cache1' + */ + get cacheId() { + return this._cacheId; + } + /** + * Set the cache id + * @property cacheId + * @type {String} + * @default 'cache1' + */ + set cacheId(value) { + this._cacheId = value; + } + /** + * The flag to indicate if there are changes since the last save + * @property changesSinceLastSave + * @type {Boolean} + * @default false + */ + get changesSinceLastSave() { + return this._changesSinceLastSave; + } + /** + * The interval to persist the cache to disk. 0 means no timed persistence + * @property persistInterval + * @type {Number} + * @default 0 + */ + get persistInterval() { + return this._persistInterval; + } + /** + * Set the interval to persist the cache to disk. 0 means no timed persistence + * @property persistInterval + * @type {Number} + * @default 0 + */ + set persistInterval(value) { + this._persistInterval = value; + } + /** + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted + * then the cache module directory `.cacheDir` will be used instead + * + * @method load + * @param cacheId {String} the id of the cache, would also be used as the name of the file cache + * @param cacheDir {String} directory for the cache entry + */ + // eslint-disable-next-line unicorn/prevent-abbreviations + load(cacheId, cacheDir) { + try { + const filePath = path9.resolve(`${cacheDir ?? this._cacheDir}/${cacheId ?? this._cacheId}`); + this.loadFile(filePath); + this.emit( + "load" + /* LOAD */ + ); + } catch (error) { + this.emit("error", error); + } + } + /** + * Load the cache from the provided file + * @method loadFile + * @param {String} pathToFile the path to the file containing the info for the cache + */ + loadFile(pathToFile) { + if (fs5.existsSync(pathToFile)) { + const data = fs5.readFileSync(pathToFile, "utf8"); + const items = this._parse(data); + for (const key of Object.keys(items)) { + this._cache.set(items[key].key, items[key].value, { expire: items[key].expires }); + } + this._changesSinceLastSave = true; + } + } + /** + * Returns the entire persisted object + * @method all + * @returns {*} + */ + all() { + const result = {}; + const items = Array.from(this._cache.items); + for (const item of items) { + result[item.key] = item.value; + } + return result; + } + /** + * Returns an array with all the items in the cache { key, value, ttl } + * @method items + * @returns {Array} + */ + get items() { + return Array.from(this._cache.items); + } + /** + * Returns the path to the file where the cache is persisted + * @method cacheFilePath + * @returns {String} + */ + get cacheFilePath() { + return path9.resolve(`${this._cacheDir}/${this._cacheId}`); + } + /** + * Returns the path to the cache directory + * @method cacheDirPath + * @returns {String} + */ + get cacheDirPath() { + return path9.resolve(this._cacheDir); + } + /** + * Returns an array with all the keys in the cache + * @method keys + * @returns {Array} + */ + keys() { + return Array.from(this._cache.keys); + } + /** + * (Legacy) set key method. This method will be deprecated in the future + * @method setKey + * @param key {string} the key to set + * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify + */ + setKey(key, value, ttl) { + this.set(key, value, ttl); + } + /** + * Sets a key to a given value + * @method set + * @param key {string} the key to set + * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify + * @param [ttl] {number} the time to live in milliseconds + */ + set(key, value, ttl) { + this._cache.set(key, value, ttl); + this._changesSinceLastSave = true; + } + /** + * (Legacy) Remove a given key from the cache. This method will be deprecated in the future + * @method removeKey + * @param key {String} the key to remove from the object + */ + removeKey(key) { + this.delete(key); + } + /** + * Remove a given key from the cache + * @method delete + * @param key {String} the key to remove from the object + */ + delete(key) { + this._cache.delete(key); + this._changesSinceLastSave = true; + this.emit("delete", key); + } + /** + * (Legacy) Return the value of the provided key. This method will be deprecated in the future + * @method getKey + * @param key {String} the name of the key to retrieve + * @returns {*} at T the value from the key + */ + getKey(key) { + return this.get(key); + } + /** + * Return the value of the provided key + * @method get + * @param key {String} the name of the key to retrieve + * @returns {*} at T the value from the key + */ + get(key) { + return this._cache.get(key); + } + /** + * Clear the cache and save the state to disk + * @method clear + */ + clear() { + try { + this._cache.clear(); + this._changesSinceLastSave = true; + this.save(); + this.emit( + "clear" + /* CLEAR */ + ); + } catch (error) { + this.emit("error", error); + } + } + /** + * Save the state of the cache identified by the docId to disk + * as a JSON structure + * @method save + */ + save(force = false) { + try { + if (this._changesSinceLastSave || force) { + const filePath = this.cacheFilePath; + const items = Array.from(this._cache.items); + const data = this._stringify(items); + if (!fs5.existsSync(this._cacheDir)) { + fs5.mkdirSync(this._cacheDir, { recursive: true }); + } + fs5.writeFileSync(filePath, data); + this._changesSinceLastSave = false; + this.emit( + "save" + /* SAVE */ + ); + } + } catch (error) { + this.emit("error", error); + } + } + /** + * Remove the file where the cache is persisted + * @method removeCacheFile + * @return {Boolean} true or false if the file was successfully deleted + */ + removeCacheFile() { + try { + if (fs5.existsSync(this.cacheFilePath)) { + fs5.rmSync(this.cacheFilePath); + return true; + } + } catch (error) { + this.emit("error", error); + } + return false; + } + /** + * Destroy the cache. This will remove the directory, file, and memory cache + * @method destroy + * @param [includeCacheDir=false] {Boolean} if true, the cache directory will be removed + * @return {undefined} + */ + destroy(includeCacheDirectory = false) { + try { + this._cache.clear(); + this.stopAutoPersist(); + if (includeCacheDirectory) { + fs5.rmSync(this.cacheDirPath, { recursive: true, force: true }); + } else { + fs5.rmSync(this.cacheFilePath, { recursive: true, force: true }); + } + this._changesSinceLastSave = false; + this.emit( + "destroy" + /* DESTROY */ + ); + } catch (error) { + this.emit("error", error); + } + } + /** + * Start the auto persist interval + * @method startAutoPersist + */ + startAutoPersist() { + if (this._persistInterval > 0) { + if (this._persistTimer) { + clearInterval(this._persistTimer); + this._persistTimer = void 0; + } + this._persistTimer = setInterval(() => { + this.save(); + }, this._persistInterval); + } + } + /** + * Stop the auto persist interval + * @method stopAutoPersist + */ + stopAutoPersist() { + if (this._persistTimer) { + clearInterval(this._persistTimer); + this._persistTimer = void 0; + } + } +}; +function createFromFile(filePath, options) { + const cache = new FlatCache(options); + cache.loadFile(filePath); + return cache; +} + +// node_modules/file-entry-cache/dist/index.js +function createFromFile2(filePath, useCheckSum, currentWorkingDirectory) { + const fname = path10.basename(filePath); + const directory = path10.dirname(filePath); + return create(fname, directory, useCheckSum, currentWorkingDirectory); +} +function create(cacheId, cacheDirectory, useCheckSum, currentWorkingDirectory) { + const options = { + currentWorkingDirectory, + useCheckSum, + cache: { + cacheId, + cacheDir: cacheDirectory + } + }; + const fileEntryCache = new FileEntryCache(options); + if (cacheDirectory) { + const cachePath = `${cacheDirectory}/${cacheId}`; + if (fs6.existsSync(cachePath)) { + fileEntryCache.cache = createFromFile(cachePath, options.cache); + } + } + return fileEntryCache; +} +var FileEntryDefault = class { + static create = create; + static createFromFile = createFromFile2; +}; +var FileEntryCache = class { + _cache = new FlatCache({ useClone: false }); + _useCheckSum = false; + _currentWorkingDirectory; + _hashAlgorithm = "md5"; + constructor(options) { + if (options == null ? void 0 : options.cache) { + this._cache = new FlatCache(options.cache); + } + if (options == null ? void 0 : options.useCheckSum) { + this._useCheckSum = options.useCheckSum; + } + if (options == null ? void 0 : options.currentWorkingDirectory) { + this._currentWorkingDirectory = options.currentWorkingDirectory; + } + if (options == null ? void 0 : options.hashAlgorithm) { + this._hashAlgorithm = options.hashAlgorithm; + } + } + get cache() { + return this._cache; + } + set cache(cache) { + this._cache = cache; + } + get useCheckSum() { + return this._useCheckSum; + } + set useCheckSum(value) { + this._useCheckSum = value; + } + get hashAlgorithm() { + return this._hashAlgorithm; + } + set hashAlgorithm(value) { + this._hashAlgorithm = value; + } + get currentWorkingDirectory() { + return this._currentWorkingDirectory; + } + set currentWorkingDirectory(value) { + this._currentWorkingDirectory = value; + } + /** + * Given a buffer, calculate md5 hash of its content. + * @method getHash + * @param {Buffer} buffer buffer to calculate hash on + * @return {String} content hash digest + */ + // eslint-disable-next-line @typescript-eslint/ban-types + getHash(buffer) { + return crypto2.createHash(this._hashAlgorithm).update(buffer).digest("hex"); + } + /** + * Create the key for the file path used for caching. + * @method createFileKey + * @param {String} filePath + * @return {String} + */ + createFileKey(filePath, options) { + let result = filePath; + const currentWorkingDirectory = (options == null ? void 0 : options.currentWorkingDirectory) ?? this._currentWorkingDirectory; + if (currentWorkingDirectory && filePath.startsWith(currentWorkingDirectory)) { + const splitPath = filePath.split(currentWorkingDirectory).pop(); + if (splitPath) { + result = splitPath; + if (result.startsWith("/")) { + result = result.slice(1); + } + } + } + return result; + } + /** + * Check if the file path is a relative path + * @method isRelativePath + * @param filePath - The file path to check + * @returns {boolean} if the file path is a relative path, false otherwise + */ + isRelativePath(filePath) { + return !path10.isAbsolute(filePath); + } + /** + * Delete the cache file from the disk + * @method deleteCacheFile + * @return {boolean} true if the file was deleted, false otherwise + */ + deleteCacheFile() { + return this._cache.removeCacheFile(); + } + /** + * Remove the cache from the file and clear the memory cache + * @method destroy + */ + destroy() { + this._cache.destroy(); + } + /** + * Remove and Entry From the Cache + * @method removeEntry + * @param filePath - The file path to remove from the cache + */ + removeEntry(filePath, options) { + if (this.isRelativePath(filePath)) { + filePath = this.getAbsolutePath(filePath, { currentWorkingDirectory: options == null ? void 0 : options.currentWorkingDirectory }); + this._cache.removeKey(this.createFileKey(filePath)); + } + const key = this.createFileKey(filePath, { currentWorkingDirectory: options == null ? void 0 : options.currentWorkingDirectory }); + this._cache.removeKey(key); + } + /** + * Reconcile the cache + * @method reconcile + */ + reconcile() { + const items = this._cache.items; + for (const item of items) { + const fileDescriptor = this.getFileDescriptor(item.key); + if (fileDescriptor.notFound) { + this._cache.removeKey(item.key); + } + } + this._cache.save(); + } + /** + * Check if the file has changed + * @method hasFileChanged + * @param filePath - The file path to check + * @returns {boolean} if the file has changed, false otherwise + */ + hasFileChanged(filePath) { + let result = false; + const fileDescriptor = this.getFileDescriptor(filePath); + if ((!fileDescriptor.err || !fileDescriptor.notFound) && fileDescriptor.changed) { + result = true; + } + return result; + } + /** + * Get the file descriptor for the file path + * @method getFileDescriptor + * @param filePath - The file path to get the file descriptor for + * @param options - The options for getting the file descriptor + * @returns The file descriptor + */ + getFileDescriptor(filePath, options) { + var _a, _b, _c; + let fstat; + const result = { + key: this.createFileKey(filePath), + changed: false, + meta: {} + }; + result.meta = this._cache.getKey(result.key) ?? {}; + filePath = this.getAbsolutePath(filePath, { currentWorkingDirectory: options == null ? void 0 : options.currentWorkingDirectory }); + const useCheckSumValue = (options == null ? void 0 : options.useCheckSum) ?? this._useCheckSum; + try { + fstat = fs6.statSync(filePath); + result.meta = { + size: fstat.size + }; + result.meta.mtime = fstat.mtime.getTime(); + if (useCheckSumValue) { + const buffer = fs6.readFileSync(filePath); + result.meta.hash = this.getHash(buffer); + } + } catch (error) { + this.removeEntry(filePath); + let notFound = false; + if (error.message.includes("ENOENT")) { + notFound = true; + } + return { + key: result.key, + err: error, + notFound, + meta: {} + }; + } + const metaCache = this._cache.getKey(result.key); + if (!metaCache) { + result.changed = true; + this._cache.setKey(result.key, result.meta); + return result; + } + if (result.meta.data === void 0) { + result.meta.data = metaCache.data; + } + if ((metaCache == null ? void 0 : metaCache.mtime) !== ((_a = result.meta) == null ? void 0 : _a.mtime) || (metaCache == null ? void 0 : metaCache.size) !== ((_b = result.meta) == null ? void 0 : _b.size)) { + result.changed = true; + } + if (useCheckSumValue && (metaCache == null ? void 0 : metaCache.hash) !== ((_c = result.meta) == null ? void 0 : _c.hash)) { + result.changed = true; + } + this._cache.setKey(result.key, result.meta); + return result; + } + /** + * Get the file descriptors for the files + * @method normalizeEntries + * @param files?: string[] - The files to get the file descriptors for + * @returns The file descriptors + */ + normalizeEntries(files) { + const result = new Array(); + if (files) { + for (const file of files) { + const fileDescriptor = this.getFileDescriptor(file); + result.push(fileDescriptor); + } + return result; + } + const keys2 = this.cache.keys(); + for (const key of keys2) { + const fileDescriptor = this.getFileDescriptor(key); + if (!fileDescriptor.notFound && !fileDescriptor.err) { + result.push(fileDescriptor); + } + } + return result; + } + /** + * Analyze the files + * @method analyzeFiles + * @param files - The files to analyze + * @returns {AnalyzedFiles} The analysis of the files + */ + analyzeFiles(files) { + const result = { + changedFiles: [], + notFoundFiles: [], + notChangedFiles: [] + }; + const fileDescriptors = this.normalizeEntries(files); + for (const fileDescriptor of fileDescriptors) { + if (fileDescriptor.notFound) { + result.notFoundFiles.push(fileDescriptor.key); + } else if (fileDescriptor.changed) { + result.changedFiles.push(fileDescriptor.key); + } else { + result.notChangedFiles.push(fileDescriptor.key); + } + } + return result; + } + /** + * Get the updated files + * @method getUpdatedFiles + * @param files - The files to get the updated files for + * @returns {string[]} The updated files + */ + getUpdatedFiles(files) { + const result = new Array(); + const fileDescriptors = this.normalizeEntries(files); + for (const fileDescriptor of fileDescriptors) { + if (fileDescriptor.changed) { + result.push(fileDescriptor.key); + } + } + return result; + } + /** + * Get the not found files + * @method getFileDescriptorsByPath + * @param filePath - the files that you want to get from a path + * @returns {FileDescriptor[]} The not found files + */ + getFileDescriptorsByPath(filePath) { + const result = new Array(); + const keys2 = this._cache.keys(); + for (const key of keys2) { + const absolutePath = this.getAbsolutePath(filePath); + if (absolutePath.startsWith(filePath)) { + const fileDescriptor = this.getFileDescriptor(key); + result.push(fileDescriptor); + } + } + return result; + } + /** + * Get the Absolute Path. If it is already absolute it will return the path as is. + * @method getAbsolutePath + * @param filePath - The file path to get the absolute path for + * @param options - The options for getting the absolute path. The current working directory is used if not provided. + * @returns {string} + */ + getAbsolutePath(filePath, options) { + if (this.isRelativePath(filePath)) { + const currentWorkingDirectory = (options == null ? void 0 : options.currentWorkingDirectory) ?? this._currentWorkingDirectory ?? process.cwd(); + filePath = path10.resolve(currentWorkingDirectory, filePath); + } + return filePath; + } + /** + * Rename the absolute path keys. This is used when a directory is changed or renamed. + * @method renameAbsolutePathKeys + * @param oldPath - The old path to rename + * @param newPath - The new path to rename to + */ + renameAbsolutePathKeys(oldPath, newPath) { + const keys2 = this._cache.keys(); + for (const key of keys2) { + if (key.startsWith(oldPath)) { + const newKey = key.replace(oldPath, newPath); + const meta = this._cache.getKey(key); + this._cache.removeKey(key); + this._cache.setKey(newKey, meta); + } + } + } +}; + +// src/cli/format-results-cache.js +import { version as prettierVersion } from "../index.mjs"; +var optionsHashCache = /* @__PURE__ */ new WeakMap(); +var nodeVersion = process.version; +function getHashOfOptions(options) { + if (optionsHashCache.has(options)) { + return optionsHashCache.get(options); + } + const hash2 = createHash( + `${prettierVersion}_${nodeVersion}_${(0, import_fast_json_stable_stringify2.default)(options)}` + ); + optionsHashCache.set(options, hash2); + return hash2; +} +function getMetadataFromFileDescriptor(fileDescriptor) { + return fileDescriptor.meta; +} +var _fileEntryCache; +var FormatResultsCache = class { + /** + * @param {string} cacheFileLocation The path of cache file location. (default: `node_modules/.cache/prettier/.prettier-cache`) + * @param {string} cacheStrategy + */ + constructor(cacheFileLocation, cacheStrategy) { + __privateAdd(this, _fileEntryCache); + const useChecksum = cacheStrategy === "content"; + try { + __privateSet(this, _fileEntryCache, FileEntryDefault.createFromFile( + /* filePath */ + cacheFileLocation, + useChecksum + )); + } catch { + if (fs7.existsSync(cacheFileLocation)) { + fs7.unlinkSync(cacheFileLocation); + __privateSet(this, _fileEntryCache, FileEntryDefault.createFromFile( + /* filePath */ + cacheFileLocation, + useChecksum + )); + } + } + } + /** + * @param {string} filePath + * @param {any} options + */ + existsAvailableFormatResultsCache(filePath, options) { + var _a; + const fileDescriptor = __privateGet(this, _fileEntryCache).getFileDescriptor(filePath); + if (fileDescriptor.notFound || fileDescriptor.changed) { + return false; + } + const hashOfOptions = (_a = getMetadataFromFileDescriptor(fileDescriptor).data) == null ? void 0 : _a.hashOfOptions; + return hashOfOptions && hashOfOptions === getHashOfOptions(options); + } + /** + * @param {string} filePath + * @param {any} options + */ + setFormatResultsCache(filePath, options) { + const fileDescriptor = __privateGet(this, _fileEntryCache).getFileDescriptor(filePath); + if (!fileDescriptor.notFound) { + const meta = getMetadataFromFileDescriptor(fileDescriptor); + meta.data = { ...meta.data, hashOfOptions: getHashOfOptions(options) }; + } + } + /** + * @param {string} filePath + */ + removeFormatResultsCache(filePath) { + __privateGet(this, _fileEntryCache).removeEntry(filePath); + } + reconcile() { + __privateGet(this, _fileEntryCache).reconcile(); + } +}; +_fileEntryCache = new WeakMap(); +var format_results_cache_default = FormatResultsCache; + +// src/cli/is-tty.js +function isTTY() { + return process.stdout.isTTY && !mockable.isCI(); +} + +// src/cli/options/get-options-for-file.js +var import_dashify2 = __toESM(require_dashify(), 1); +import { resolveConfig } from "../index.mjs"; +function getOptions(argv, detailedOptions) { + return Object.fromEntries( + detailedOptions.filter(({ forwardToApi }) => forwardToApi).map(({ forwardToApi, name }) => [forwardToApi, argv[name]]) + ); +} +function cliifyOptions(object2, apiDetailedOptionMap) { + return Object.fromEntries( + Object.entries(object2 || {}).map(([key, value]) => { + const apiOption = apiDetailedOptionMap[key]; + const cliKey = apiOption ? apiOption.name : key; + return [(0, import_dashify2.default)(cliKey), value]; + }) + ); +} +function createApiDetailedOptionMap(detailedOptions) { + return Object.fromEntries( + detailedOptions.filter( + (option) => option.forwardToApi && option.forwardToApi !== option.name + ).map((option) => [option.forwardToApi, option]) + ); +} +function parseArgsToOptions(context, overrideDefaults) { + const minimistOptions = createMinimistOptions(context.detailedOptions); + const apiDetailedOptionMap = createApiDetailedOptionMap( + context.detailedOptions + ); + return getOptions( + normalize_cli_options_default( + minimistParse(context.rawArguments, { + string: minimistOptions.string, + boolean: minimistOptions.boolean, + default: cliifyOptions(overrideDefaults, apiDetailedOptionMap) + }), + context.detailedOptions, + { logger: false } + ), + context.detailedOptions + ); +} +async function getOptionsOrDie(context, filePath) { + try { + if (context.argv.config === false) { + context.logger.debug( + "'--no-config' option found, skip loading config file." + ); + return null; + } + context.logger.debug( + context.argv.config ? `load config file from '${context.argv.config}'` : `resolve config from '${filePath}'` + ); + const options = await resolveConfig(filePath, { + editorconfig: context.argv.editorconfig, + config: context.argv.config + }); + context.logger.debug("loaded options `" + JSON.stringify(options) + "`"); + return options; + } catch (error) { + context.logger.error( + `Invalid configuration${filePath ? ` for file "${filePath}"` : ""}: +` + error.message + ); + process.exit(2); + } +} +function applyConfigPrecedence(context, options) { + try { + switch (context.argv.configPrecedence) { + case "cli-override": + return parseArgsToOptions(context, options); + case "file-override": + return { ...parseArgsToOptions(context), ...options }; + case "prefer-file": + return options || parseArgsToOptions(context); + } + } catch (error) { + context.logger.error(error.toString()); + process.exit(2); + } +} +async function getOptionsForFile(context, filepath) { + const options = await getOptionsOrDie(context, filepath); + const hasPlugins = options == null ? void 0 : options.plugins; + if (hasPlugins) { + await context.pushContextPlugins(options.plugins); + } + const appliedOptions = { + filepath, + ...applyConfigPrecedence( + context, + options && normalizeOptions(options, context.supportOptions, { + logger: context.logger + }) + ) + }; + context.logger.debug( + `applied config-precedence (${context.argv.configPrecedence}): ${JSON.stringify(appliedOptions)}` + ); + if (hasPlugins) { + context.popContextPlugins(); + } + return appliedOptions; +} +var get_options_for_file_default = getOptionsForFile; + +// src/cli/format.js +var { getStdin, writeFormattedFile } = mockable; +function diff(a, b) { + return createTwoFilesPatch("", "", a, b, "", "", { context: 2 }); +} +var DebugError = class extends Error { + name = "DebugError"; +}; +function handleError(context, filename, error, printedFilename, ignoreUnknown) { + ignoreUnknown || (ignoreUnknown = context.argv.ignoreUnknown); + const errorIsUndefinedParseError = error instanceof errors.UndefinedParserError; + if (printedFilename) { + if ((context.argv.write || ignoreUnknown) && errorIsUndefinedParseError) { + printedFilename.clear(); + } else { + process.stdout.write("\n"); + } + } + if (errorIsUndefinedParseError) { + if (ignoreUnknown) { + return; + } + if (!context.argv.check && !context.argv.listDifferent) { + process.exitCode = 2; + } + context.logger.error(error.message); + return; + } + const isParseError = Boolean(error == null ? void 0 : error.loc); + const isValidationError = /^Invalid \S+ value\./u.test(error == null ? void 0 : error.message); + if (isParseError) { + context.logger.error(`${filename}: ${String(error)}`); + } else if (isValidationError || error instanceof errors.ConfigError) { + context.logger.error(error.message); + process.exit(1); + } else if (error instanceof DebugError) { + context.logger.error(`${filename}: ${error.message}`); + } else { + context.logger.error(filename + ": " + (error.stack || error)); + } + process.exitCode = 2; +} +function writeOutput(context, result, options) { + process.stdout.write( + context.argv.debugCheck ? result.filepath : result.formatted + ); + if (options && options.cursorOffset >= 0) { + process.stderr.write(result.cursorOffset + "\n"); + } +} +async function listDifferent(context, input, options, filename) { + if (!context.argv.check && !context.argv.listDifferent) { + return; + } + try { + if (!await prettier.check(input, options) && !context.argv.write) { + context.logger.log(filename); + process.exitCode = 1; + } + } catch (error) { + context.logger.error(error.message); + } + return true; +} +async function format3(context, input, opt) { + if (context.argv.debugPrintDoc) { + const doc = await prettier.__debug.printToDoc(input, opt); + return { formatted: await prettier.__debug.formatDoc(doc) + "\n" }; + } + if (context.argv.debugPrintComments) { + return { + formatted: await prettier.format( + JSON.stringify( + (await prettier.formatWithCursor(input, opt)).comments || [] + ), + { parser: "json" } + ) + }; + } + if (context.argv.debugPrintAst) { + const { ast } = await prettier.__debug.parse(input, opt); + return { + formatted: JSON.stringify(ast) + }; + } + if (context.argv.debugCheck) { + const pp = await prettier.format(input, opt); + const pppp = await prettier.format(pp, opt); + if (pp !== pppp) { + throw new DebugError( + "prettier(input) !== prettier(prettier(input))\n" + diff(pp, pppp) + ); + } else { + const stringify5 = (obj) => JSON.stringify(obj, null, 2); + const ast = stringify5( + (await prettier.__debug.parse(input, opt, { massage: true })).ast + ); + const past = stringify5( + (await prettier.__debug.parse(pp, opt, { massage: true })).ast + ); + if (ast !== past) { + const MAX_AST_SIZE = 2097152; + const astDiff = ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE ? "AST diff too large to render" : diff(ast, past); + throw new DebugError( + "ast(input) !== ast(prettier(input))\n" + astDiff + "\n" + diff(input, pp) + ); + } + } + return { formatted: pp, filepath: opt.filepath || "(stdin)\n" }; + } + const { performanceTestFlag } = context; + if (performanceTestFlag == null ? void 0 : performanceTestFlag.debugBenchmark) { + let benchmark; + try { + ({ default: benchmark } = await import("benchmark")); + } catch { + context.logger.debug( + "'--debug-benchmark' requires the 'benchmark' package to be installed." + ); + process.exit(2); + } + context.logger.debug( + "'--debug-benchmark' option found, measuring formatWithCursor with 'benchmark' module." + ); + const suite = new benchmark.Suite(); + suite.add("format", { + defer: true, + async fn(deferred) { + await prettier.formatWithCursor(input, opt); + deferred.resolve(); + } + }); + const result = await new Promise((resolve) => { + suite.on("complete", (event) => { + resolve({ + benchmark: String(event.target), + hz: event.target.hz, + ms: event.target.times.cycle * 1e3 + }); + }).run({ async: false }); + }); + context.logger.debug( + "'--debug-benchmark' measurements for formatWithCursor: " + JSON.stringify(result, null, 2) + ); + } else if (performanceTestFlag == null ? void 0 : performanceTestFlag.debugRepeat) { + const repeat = performanceTestFlag.debugRepeat; + context.logger.debug( + `'${performanceTestFlag.name}' found, running formatWithCursor ${repeat} times.` + ); + let totalMs = 0; + for (let i = 0; i < repeat; ++i) { + const startMs = Date.now(); + await prettier.formatWithCursor(input, opt); + totalMs += Date.now() - startMs; + } + const averageMs = totalMs / repeat; + const results = { + repeat, + hz: 1e3 / averageMs, + ms: averageMs + }; + context.logger.debug( + `'${performanceTestFlag.name}' measurements for formatWithCursor: ${JSON.stringify( + results, + null, + 2 + )}` + ); + } + return prettier.formatWithCursor(input, opt); +} +async function createIsIgnoredFromContextOrDie(context) { + try { + return await createIsIgnoredFunction( + context.argv.ignorePath, + context.argv.withNodeModules + ); + } catch (e) { + context.logger.error(e.message); + process.exit(2); + } +} +async function formatStdin(context) { + const { filepath } = context.argv; + try { + const input = await getStdin(); + let isFileIgnored = false; + if (filepath) { + const isIgnored = await createIsIgnoredFromContextOrDie(context); + isFileIgnored = isIgnored(filepath); + } + if (isFileIgnored) { + writeOutput(context, { formatted: input }); + return; + } + const options = await get_options_for_file_default( + context, + filepath ? path11.resolve(filepath) : void 0 + ); + if (await listDifferent(context, input, options, "(stdin)")) { + return; + } + const formatted = await format3(context, input, options); + const { performanceTestFlag } = context; + if (performanceTestFlag) { + context.logger.log( + `'${performanceTestFlag.name}' option found, skipped print code to screen.` + ); + return; + } + writeOutput(context, formatted, options); + } catch (error) { + handleError(context, filepath || "stdin", error); + } +} +async function formatFiles(context) { + const isIgnored = await createIsIgnoredFromContextOrDie(context); + const cwd2 = process.cwd(); + let numberOfUnformattedFilesFound = 0; + const { performanceTestFlag } = context; + if (context.argv.check && !performanceTestFlag) { + context.logger.log("Checking formatting..."); + } + let formatResultsCache; + const cacheFilePath = await find_cache_file_default(context.argv.cacheLocation); + if (context.argv.cache) { + formatResultsCache = new format_results_cache_default( + cacheFilePath, + context.argv.cacheStrategy || "content" + ); + } else if (!context.argv.cacheLocation) { + const stat = await statSafe(cacheFilePath); + if (stat) { + await fs8.unlink(cacheFilePath); + } + } + for await (const { error, filename, ignoreUnknown } of expandPatterns( + context + )) { + if (error) { + context.logger.error(error); + process.exitCode = 2; + continue; + } + const isFileIgnored = isIgnored(filename); + if (isFileIgnored && (context.argv.debugCheck || context.argv.write || context.argv.check || context.argv.listDifferent)) { + continue; + } + const options = { + ...await get_options_for_file_default(context, filename), + filepath: filename + }; + const fileNameToDisplay = normalizeToPosix(path11.relative(cwd2, filename)); + let printedFilename; + if (isTTY()) { + printedFilename = context.logger.log(fileNameToDisplay, { + newline: false, + clearable: true + }); + } + let input; + try { + input = await fs8.readFile(filename, "utf8"); + } catch (error2) { + context.logger.log(""); + context.logger.error( + `Unable to read file "${fileNameToDisplay}": +${error2.message}` + ); + process.exitCode = 2; + continue; + } + if (isFileIgnored) { + printedFilename == null ? void 0 : printedFilename.clear(); + writeOutput(context, { formatted: input }, options); + continue; + } + const start = Date.now(); + const isCacheExists = formatResultsCache == null ? void 0 : formatResultsCache.existsAvailableFormatResultsCache( + filename, + options + ); + let result; + let output; + try { + if (isCacheExists) { + result = { formatted: input }; + } else { + result = await format3(context, input, options); + } + output = result.formatted; + } catch (error2) { + handleError( + context, + fileNameToDisplay, + error2, + printedFilename, + ignoreUnknown + ); + continue; + } + const isDifferent = output !== input; + let shouldSetCache = !isDifferent; + printedFilename == null ? void 0 : printedFilename.clear(); + if (performanceTestFlag) { + context.logger.log( + `'${performanceTestFlag.name}' option found, skipped print code or write files.` + ); + return; + } + if (context.argv.write) { + if (isDifferent) { + if (!context.argv.check && !context.argv.listDifferent) { + context.logger.log(`${fileNameToDisplay} ${Date.now() - start}ms`); + } + try { + await writeFormattedFile(filename, output); + shouldSetCache = true; + } catch (error2) { + context.logger.error( + `Unable to write file "${fileNameToDisplay}": +${error2.message}` + ); + process.exitCode = 2; + } + } else if (!context.argv.check && !context.argv.listDifferent) { + const message = `${source_default.grey(fileNameToDisplay)} ${Date.now() - start}ms (unchanged)`; + if (isCacheExists) { + context.logger.log(`${message} (cached)`); + } else { + context.logger.log(message); + } + } + } else if (context.argv.debugCheck) { + if (result.filepath) { + context.logger.log(fileNameToDisplay); + } else { + process.exitCode = 2; + } + } else if (!context.argv.check && !context.argv.listDifferent) { + writeOutput(context, result, options); + } + if (shouldSetCache) { + formatResultsCache == null ? void 0 : formatResultsCache.setFormatResultsCache(filename, options); + } else { + formatResultsCache == null ? void 0 : formatResultsCache.removeFormatResultsCache(filename); + } + if (isDifferent) { + if (context.argv.check) { + context.logger.warn(fileNameToDisplay); + } else if (context.argv.listDifferent) { + context.logger.log(fileNameToDisplay); + } + numberOfUnformattedFilesFound += 1; + } + } + formatResultsCache == null ? void 0 : formatResultsCache.reconcile(); + if (context.argv.check) { + if (numberOfUnformattedFilesFound === 0) { + context.logger.log("All matched files use Prettier code style!"); + } else { + const files = numberOfUnformattedFilesFound === 1 ? "the above file" : `${numberOfUnformattedFilesFound} files`; + context.logger.warn( + context.argv.write ? `Code style issues fixed in ${files}.` : `Code style issues found in ${files}. Run Prettier with --write to fix.` + ); + } + } + if ((context.argv.check || context.argv.listDifferent) && numberOfUnformattedFilesFound > 0 && !process.exitCode && !context.argv.write) { + process.exitCode = 1; + } +} + +// src/cli/logger.js +import readline from "readline"; + +// node_modules/strip-ansi/node_modules/ansi-regex/index.js +function ansiRegex({ onlyFirst = false } = {}) { + const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)"; + const pattern = [ + `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`, + "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))" + ].join("|"); + return new RegExp(pattern, onlyFirst ? void 0 : "g"); +} + +// node_modules/strip-ansi/index.js +var regex = ansiRegex(); +function stripAnsi(string) { + if (typeof string !== "string") { + throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); + } + return string.replace(regex, ""); +} + +// node_modules/wcwidth.js/combining.js +var combining_default = [ + [768, 879], + [1155, 1158], + [1160, 1161], + [1425, 1469], + [1471, 1471], + [1473, 1474], + [1476, 1477], + [1479, 1479], + [1536, 1539], + [1552, 1557], + [1611, 1630], + [1648, 1648], + [1750, 1764], + [1767, 1768], + [1770, 1773], + [1807, 1807], + [1809, 1809], + [1840, 1866], + [1958, 1968], + [2027, 2035], + [2305, 2306], + [2364, 2364], + [2369, 2376], + [2381, 2381], + [2385, 2388], + [2402, 2403], + [2433, 2433], + [2492, 2492], + [2497, 2500], + [2509, 2509], + [2530, 2531], + [2561, 2562], + [2620, 2620], + [2625, 2626], + [2631, 2632], + [2635, 2637], + [2672, 2673], + [2689, 2690], + [2748, 2748], + [2753, 2757], + [2759, 2760], + [2765, 2765], + [2786, 2787], + [2817, 2817], + [2876, 2876], + [2879, 2879], + [2881, 2883], + [2893, 2893], + [2902, 2902], + [2946, 2946], + [3008, 3008], + [3021, 3021], + [3134, 3136], + [3142, 3144], + [3146, 3149], + [3157, 3158], + [3260, 3260], + [3263, 3263], + [3270, 3270], + [3276, 3277], + [3298, 3299], + [3393, 3395], + [3405, 3405], + [3530, 3530], + [3538, 3540], + [3542, 3542], + [3633, 3633], + [3636, 3642], + [3655, 3662], + [3761, 3761], + [3764, 3769], + [3771, 3772], + [3784, 3789], + [3864, 3865], + [3893, 3893], + [3895, 3895], + [3897, 3897], + [3953, 3966], + [3968, 3972], + [3974, 3975], + [3984, 3991], + [3993, 4028], + [4038, 4038], + [4141, 4144], + [4146, 4146], + [4150, 4151], + [4153, 4153], + [4184, 4185], + [4448, 4607], + [4959, 4959], + [5906, 5908], + [5938, 5940], + [5970, 5971], + [6002, 6003], + [6068, 6069], + [6071, 6077], + [6086, 6086], + [6089, 6099], + [6109, 6109], + [6155, 6157], + [6313, 6313], + [6432, 6434], + [6439, 6440], + [6450, 6450], + [6457, 6459], + [6679, 6680], + [6912, 6915], + [6964, 6964], + [6966, 6970], + [6972, 6972], + [6978, 6978], + [7019, 7027], + [7616, 7626], + [7678, 7679], + [8203, 8207], + [8234, 8238], + [8288, 8291], + [8298, 8303], + [8400, 8431], + [12330, 12335], + [12441, 12442], + [43014, 43014], + [43019, 43019], + [43045, 43046], + [64286, 64286], + [65024, 65039], + [65056, 65059], + [65279, 65279], + [65529, 65531], + [68097, 68099], + [68101, 68102], + [68108, 68111], + [68152, 68154], + [68159, 68159], + [119143, 119145], + [119155, 119170], + [119173, 119179], + [119210, 119213], + [119362, 119364], + [917505, 917505], + [917536, 917631], + [917760, 917999] +]; + +// node_modules/wcwidth.js/index.js +var DEFAULTS = { + nul: 0, + control: 0 +}; +function bisearch(ucs) { + let min = 0; + let max = combining_default.length - 1; + let mid; + if (ucs < combining_default[0][0] || ucs > combining_default[max][1]) return false; + while (max >= min) { + mid = Math.floor((min + max) / 2); + if (ucs > combining_default[mid][1]) min = mid + 1; + else if (ucs < combining_default[mid][0]) max = mid - 1; + else return true; + } + return false; +} +function wcwidth(ucs, opts) { + if (ucs === 0) return opts.nul; + if (ucs < 32 || ucs >= 127 && ucs < 160) return opts.control; + if (bisearch(ucs)) return 0; + return 1 + (ucs >= 4352 && (ucs <= 4447 || // Hangul Jamo init. consonants + ucs == 9001 || ucs == 9002 || ucs >= 11904 && ucs <= 42191 && ucs != 12351 || // CJK ... Yi + ucs >= 44032 && ucs <= 55203 || // Hangul Syllables + ucs >= 63744 && ucs <= 64255 || // CJK Compatibility Ideographs + ucs >= 65040 && ucs <= 65049 || // Vertical forms + ucs >= 65072 && ucs <= 65135 || // CJK Compatibility Forms + ucs >= 65280 && ucs <= 65376 || // Fullwidth Forms + ucs >= 65504 && ucs <= 65510 || ucs >= 131072 && ucs <= 196605 || ucs >= 196608 && ucs <= 262141)); +} +function wcswidth(str, opts) { + let h; + let l; + let s = 0; + let n; + if (typeof str !== "string") return wcwidth(str, opts); + for (let i = 0; i < str.length; i++) { + h = str.charCodeAt(i); + if (h >= 55296 && h <= 56319) { + l = str.charCodeAt(++i); + if (l >= 56320 && l <= 57343) { + h = (h - 55296) * 1024 + (l - 56320) + 65536; + } else { + i--; + } + } + n = wcwidth(h, opts); + if (n < 0) return -1; + s += n; + } + return s; +} +var _ = (str) => wcswidth(str, DEFAULTS); +_.config = (opts = {}) => { + opts = { + ...DEFAULTS, + ...opts + }; + return (str) => wcswidth(str, opts); +}; +var wcwidth_default = _; + +// src/cli/logger.js +var countLines = (stream, text) => { + const columns = stream.columns || 80; + let lineCount = 0; + for (const line of stripAnsi(text).split("\n")) { + lineCount += Math.max(1, Math.ceil(wcwidth_default(line) / columns)); + } + return lineCount; +}; +var clear = (stream, text) => () => { + const lineCount = countLines(stream, text); + for (let line = 0; line < lineCount; line++) { + if (line > 0) { + readline.moveCursor(stream, 0, -1); + } + readline.clearLine(stream, 0); + readline.cursorTo(stream, 0); + } +}; +var emptyLogResult = { clear() { +} }; +function createLogger(logLevel = "log") { + return { + logLevel, + warn: createLogFunc("warn", "yellow"), + error: createLogFunc("error", "red"), + debug: createLogFunc("debug", "blue"), + log: createLogFunc("log") + }; + function createLogFunc(loggerName, color) { + if (!shouldLog(loggerName)) { + return () => emptyLogResult; + } + const stream = process[loggerName === "log" ? "stdout" : "stderr"]; + const chalkInstance = loggerName === "log" ? source_default : chalkStderr; + const prefix = color ? `[${chalkInstance[color](loggerName)}] ` : ""; + return (message, options) => { + options = { + newline: true, + clearable: false, + ...options + }; + message = string_replace_all_default( + /* isOptionalObject */ + false, + message, + /^/gmu, + prefix + ) + (options.newline ? "\n" : ""); + stream.write(message); + if (options.clearable) { + return { + clear: clear(stream, message) + }; + } + }; + } + function shouldLog(loggerName) { + switch (logLevel) { + case "silent": + return false; + case "debug": + if (loggerName === "debug") { + return true; + } + // fall through + case "log": + if (loggerName === "log") { + return true; + } + // fall through + case "warn": + if (loggerName === "warn") { + return true; + } + // fall through + case "error": + return loggerName === "error"; + } + } +} +var logger_default = createLogger; + +// src/cli/print-support-info.js +var import_fast_json_stable_stringify3 = __toESM(require_fast_json_stable_stringify(), 1); +import { format as format4, getSupportInfo as getSupportInfo2 } from "../index.mjs"; +var sortByName = (array2) => array2.sort((a, b) => a.name.localeCompare(b.name)); +async function printSupportInfo() { + const { languages, options } = await getSupportInfo2(); + const supportInfo = { + languages: sortByName(languages), + options: sortByName(options).map( + (option) => omit(option, ["cliName", "cliCategory", "cliDescription"]) + ) + }; + printToScreen(await format4((0, import_fast_json_stable_stringify3.default)(supportInfo), { parser: "json" })); +} +var print_support_info_default = printSupportInfo; + +// src/cli/constants.evaluate.js +var categoryOrder = [ + "Output", + "Format", + "Config", + "Editor", + "Other" +]; +var usageSummary = "Usage: prettier [options] [file/dir/glob ...]\n\nBy default, output is written to stdout.\nStdin is read if it is piped to Prettier and no files are given."; + +// src/cli/usage.js +var OPTION_USAGE_THRESHOLD = 25; +var CHOICE_USAGE_MARGIN = 3; +var CHOICE_USAGE_INDENTATION = 2; +function indent(str, spaces) { + return string_replace_all_default( + /* isOptionalObject */ + false, + str, + /^/gmu, + " ".repeat(spaces) + ); +} +function createDefaultValueDisplay(value) { + return Array.isArray(value) ? `[${value.map(createDefaultValueDisplay).join(", ")}]` : value; +} +function getOptionDefaultValue(context, optionName) { + var _a; + const option = context.detailedOptions.find( + ({ name }) => name === optionName + ); + if ((option == null ? void 0 : option.default) !== void 0) { + return option.default; + } + const optionCamelName = camelCase(optionName); + return formatOptionsHiddenDefaults[optionCamelName] ?? ((_a = context.supportOptions.find( + (option2) => !option2.deprecated && option2.name === optionCamelName + )) == null ? void 0 : _a.default); +} +function createOptionUsageHeader(option) { + const name = `--${option.name}`; + const alias = option.alias ? `-${option.alias},` : null; + const type = createOptionUsageType(option); + return [alias, name, type].filter(Boolean).join(" "); +} +function createOptionUsageRow(header, content, threshold) { + const separator = header.length >= threshold ? ` +${" ".repeat(threshold)}` : " ".repeat(threshold - header.length); + const description = string_replace_all_default( + /* isOptionalObject */ + false, + content, + "\n", + ` +${" ".repeat(threshold)}` + ); + return `${header}${separator}${description}`; +} +function createOptionUsageType(option) { + switch (option.type) { + case "boolean": + return null; + case "choice": + return `<${option.choices.filter((choice) => !choice.deprecated).map((choice) => choice.value).join("|")}>`; + default: + return `<${option.type}>`; + } +} +function createChoiceUsages(choices, margin, indentation) { + const activeChoices = choices.filter((choice) => !choice.deprecated); + const threshold = Math.max(0, ...activeChoices.map((choice) => choice.value.length)) + margin; + return activeChoices.map( + (choice) => indent( + createOptionUsageRow(choice.value, choice.description, threshold), + indentation + ) + ); +} +function createOptionUsage(context, option, threshold) { + const header = createOptionUsageHeader(option); + const optionDefaultValue = getOptionDefaultValue(context, option.name); + return createOptionUsageRow( + header, + `${option.description}${optionDefaultValue === void 0 ? "" : ` +Defaults to ${createDefaultValueDisplay(optionDefaultValue)}.`}`, + threshold + ); +} +function getOptionsWithOpposites(options) { + const optionsWithOpposites = options.map((option) => [ + option.description ? option : null, + option.oppositeDescription ? { + ...option, + name: `no-${option.name}`, + type: "boolean", + description: option.oppositeDescription + } : null + ]); + return optionsWithOpposites.flat().filter(Boolean); +} +function createUsage(context) { + const sortedOptions = context.detailedOptions.sort( + (optionA, optionB) => optionA.name.localeCompare(optionB.name) + ); + const options = getOptionsWithOpposites(sortedOptions).filter( + // remove unnecessary option (e.g. `semi`, `color`, etc.), which is only used for --help + (option) => !(option.type === "boolean" && option.oppositeDescription && !option.name.startsWith("no-")) + ); + const groupedOptions = groupBy(options, (option) => option.category); + const firstCategories = categoryOrder.slice(0, -1); + const lastCategories = categoryOrder.slice(-1); + const restCategories = Object.keys(groupedOptions).filter( + (category) => !categoryOrder.includes(category) + ); + const allCategories = [ + ...firstCategories, + ...restCategories, + ...lastCategories + ]; + const optionsUsage = allCategories.map((category) => { + const categoryOptions = groupedOptions[category].map( + (option) => createOptionUsage(context, option, OPTION_USAGE_THRESHOLD) + ).join("\n"); + return `${category} options: + +${indent(categoryOptions, 2)}`; + }); + return [usageSummary, ...optionsUsage, ""].join("\n\n"); +} +function createPluginDefaults(pluginDefaults) { + if (!pluginDefaults || Object.keys(pluginDefaults).length === 0) { + return ""; + } + const defaults = Object.entries(pluginDefaults).sort( + ([pluginNameA], [pluginNameB]) => pluginNameA.localeCompare(pluginNameB) + ).map( + ([plugin, value]) => `* ${plugin}: ${createDefaultValueDisplay(value)}` + ).join("\n"); + return ` +Plugin defaults: +${defaults}`; +} +function createDetailedUsage(context, flag) { + const option = getOptionsWithOpposites(context.detailedOptions).find( + (option2) => option2.name === flag || option2.alias === flag + ); + const header = createOptionUsageHeader(option); + const description = ` + +${indent(option.description, 2)}`; + const choices = option.type !== "choice" ? "" : ` + +Valid options: + +${createChoiceUsages( + option.choices, + CHOICE_USAGE_MARGIN, + CHOICE_USAGE_INDENTATION + ).join("\n")}`; + const optionDefaultValue = getOptionDefaultValue(context, option.name); + const defaults = optionDefaultValue !== void 0 ? ` + +Default: ${createDefaultValueDisplay(optionDefaultValue)}` : ""; + const pluginDefaults = createPluginDefaults(option.pluginDefaults); + return `${header}${description}${choices}${defaults}${pluginDefaults}`; +} + +// src/cli/index.js +async function run(rawArguments = process.argv.slice(2)) { + let logger = logger_default(); + try { + const { logLevel } = parseArgvWithoutPlugins( + rawArguments, + logger, + "log-level" + ); + if (logLevel !== logger.logLevel) { + logger = logger_default(logLevel); + } + const context = new context_default({ rawArguments, logger }); + await context.init(); + if (logger.logLevel !== "debug" && context.performanceTestFlag) { + context.logger = logger_default("debug"); + } + await main(context); + } catch (error) { + logger.error(error.message); + process.exitCode = 1; + } +} +async function main(context) { + context.logger.debug(`normalized argv: ${JSON.stringify(context.argv)}`); + if (context.argv.check && context.argv.listDifferent) { + throw new Error("Cannot use --check and --list-different together."); + } + if (context.argv.write && context.argv.debugCheck) { + throw new Error("Cannot use --write and --debug-check together."); + } + if (context.argv.findConfigPath && context.filePatterns.length > 0) { + throw new Error("Cannot use --find-config-path with multiple files"); + } + if (context.argv.fileInfo && context.filePatterns.length > 0) { + throw new Error("Cannot use --file-info with multiple files"); + } + if (!context.argv.cache && context.argv.cacheStrategy) { + throw new Error("`--cache-strategy` cannot be used without `--cache`."); + } + if (context.argv.version) { + printToScreen(prettier2.version); + return; + } + if (context.argv.help !== void 0) { + printToScreen( + typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context) + ); + return; + } + if (context.argv.supportInfo) { + return print_support_info_default(); + } + if (context.argv.findConfigPath) { + await find_config_path_default(context); + return; + } + if (context.argv.fileInfo) { + await file_info_default(context); + return; + } + const hasFilePatterns = context.filePatterns.length > 0; + const useStdin = !hasFilePatterns && (!process.stdin.isTTY || context.argv.filepath); + if (useStdin) { + if (context.argv.cache) { + throw new Error("`--cache` cannot be used when formatting stdin."); + } + await formatStdin(context); + return; + } + if (hasFilePatterns) { + await formatFiles(context); + return; + } + process.exitCode = 1; + printToScreen(createUsage(context)); +} +export { + run +}; diff --git a/node_modules/prettier/package.json b/node_modules/prettier/package.json new file mode 100644 index 0000000..a3f37d2 --- /dev/null +++ b/node_modules/prettier/package.json @@ -0,0 +1,200 @@ +{ + "name": "prettier", + "version": "3.5.3", + "description": "Prettier is an opinionated code formatter", + "bin": "./bin/prettier.cjs", + "repository": "prettier/prettier", + "funding": "https://github.com/prettier/prettier?sponsor=1", + "homepage": "https://prettier.io", + "author": "James Long", + "license": "MIT", + "main": "./index.cjs", + "browser": "./standalone.js", + "unpkg": "./standalone.js", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.cjs", + "browser": { + "import": "./standalone.mjs", + "default": "./standalone.js" + }, + "default": "./index.mjs" + }, + "./*": "./*", + "./doc": { + "types": "./doc.d.ts", + "require": "./doc.js", + "default": "./doc.mjs" + }, + "./standalone": { + "types": "./standalone.d.ts", + "require": "./standalone.js", + "default": "./standalone.mjs" + }, + "./plugins/estree": { + "types": "./plugins/estree.d.ts", + "require": "./plugins/estree.js", + "default": "./plugins/estree.mjs" + }, + "./plugins/babel": { + "types": "./plugins/babel.d.ts", + "require": "./plugins/babel.js", + "default": "./plugins/babel.mjs" + }, + "./plugins/flow": { + "types": "./plugins/flow.d.ts", + "require": "./plugins/flow.js", + "default": "./plugins/flow.mjs" + }, + "./plugins/typescript": { + "types": "./plugins/typescript.d.ts", + "require": "./plugins/typescript.js", + "default": "./plugins/typescript.mjs" + }, + "./plugins/acorn": { + "types": "./plugins/acorn.d.ts", + "require": "./plugins/acorn.js", + "default": "./plugins/acorn.mjs" + }, + "./plugins/meriyah": { + "types": "./plugins/meriyah.d.ts", + "require": "./plugins/meriyah.js", + "default": "./plugins/meriyah.mjs" + }, + "./plugins/angular": { + "types": "./plugins/angular.d.ts", + "require": "./plugins/angular.js", + "default": "./plugins/angular.mjs" + }, + "./plugins/postcss": { + "types": "./plugins/postcss.d.ts", + "require": "./plugins/postcss.js", + "default": "./plugins/postcss.mjs" + }, + "./plugins/graphql": { + "types": "./plugins/graphql.d.ts", + "require": "./plugins/graphql.js", + "default": "./plugins/graphql.mjs" + }, + "./plugins/markdown": { + "types": "./plugins/markdown.d.ts", + "require": "./plugins/markdown.js", + "default": "./plugins/markdown.mjs" + }, + "./plugins/glimmer": { + "types": "./plugins/glimmer.d.ts", + "require": "./plugins/glimmer.js", + "default": "./plugins/glimmer.mjs" + }, + "./plugins/html": { + "types": "./plugins/html.d.ts", + "require": "./plugins/html.js", + "default": "./plugins/html.mjs" + }, + "./plugins/yaml": { + "types": "./plugins/yaml.d.ts", + "require": "./plugins/yaml.js", + "default": "./plugins/yaml.mjs" + }, + "./esm/standalone.mjs": "./standalone.mjs", + "./parser-babel": "./plugins/babel.js", + "./parser-babel.js": "./plugins/babel.js", + "./esm/parser-babel.mjs": "./plugins/babel.mjs", + "./parser-flow": "./plugins/flow.js", + "./parser-flow.js": "./plugins/flow.js", + "./esm/parser-flow.mjs": "./plugins/flow.mjs", + "./parser-typescript": "./plugins/typescript.js", + "./parser-typescript.js": "./plugins/typescript.js", + "./esm/parser-typescript.mjs": "./plugins/typescript.mjs", + "./parser-espree": "./plugins/acorn.js", + "./parser-espree.js": "./plugins/acorn.js", + "./esm/parser-espree.mjs": "./plugins/acorn.mjs", + "./parser-meriyah": "./plugins/meriyah.js", + "./parser-meriyah.js": "./plugins/meriyah.js", + "./esm/parser-meriyah.mjs": "./plugins/meriyah.mjs", + "./parser-angular": "./plugins/angular.js", + "./parser-angular.js": "./plugins/angular.js", + "./esm/parser-angular.mjs": "./plugins/angular.mjs", + "./parser-postcss": "./plugins/postcss.js", + "./parser-postcss.js": "./plugins/postcss.js", + "./esm/parser-postcss.mjs": "./plugins/postcss.mjs", + "./parser-graphql": "./plugins/graphql.js", + "./parser-graphql.js": "./plugins/graphql.js", + "./esm/parser-graphql.mjs": "./plugins/graphql.mjs", + "./parser-markdown": "./plugins/markdown.js", + "./parser-markdown.js": "./plugins/markdown.js", + "./esm/parser-markdown.mjs": "./plugins/markdown.mjs", + "./parser-glimmer": "./plugins/glimmer.js", + "./parser-glimmer.js": "./plugins/glimmer.js", + "./esm/parser-glimmer.mjs": "./plugins/glimmer.mjs", + "./parser-html": "./plugins/html.js", + "./parser-html.js": "./plugins/html.js", + "./esm/parser-html.mjs": "./plugins/html.mjs", + "./parser-yaml": "./plugins/yaml.js", + "./parser-yaml.js": "./plugins/yaml.js", + "./esm/parser-yaml.mjs": "./plugins/yaml.mjs" + }, + "engines": { + "node": ">=14" + }, + "files": [ + "LICENSE", + "README.md", + "THIRD-PARTY-NOTICES.md", + "bin/prettier.cjs", + "doc.d.ts", + "doc.js", + "doc.mjs", + "index.cjs", + "index.d.ts", + "index.d.ts", + "index.mjs", + "internal/cli.mjs", + "package.json", + "plugins/acorn.d.ts", + "plugins/acorn.js", + "plugins/acorn.mjs", + "plugins/angular.d.ts", + "plugins/angular.js", + "plugins/angular.mjs", + "plugins/babel.d.ts", + "plugins/babel.js", + "plugins/babel.mjs", + "plugins/estree.d.ts", + "plugins/estree.js", + "plugins/estree.mjs", + "plugins/flow.d.ts", + "plugins/flow.js", + "plugins/flow.mjs", + "plugins/glimmer.d.ts", + "plugins/glimmer.js", + "plugins/glimmer.mjs", + "plugins/graphql.d.ts", + "plugins/graphql.js", + "plugins/graphql.mjs", + "plugins/html.d.ts", + "plugins/html.js", + "plugins/html.mjs", + "plugins/markdown.d.ts", + "plugins/markdown.js", + "plugins/markdown.mjs", + "plugins/meriyah.d.ts", + "plugins/meriyah.js", + "plugins/meriyah.mjs", + "plugins/postcss.d.ts", + "plugins/postcss.js", + "plugins/postcss.mjs", + "plugins/typescript.d.ts", + "plugins/typescript.js", + "plugins/typescript.mjs", + "plugins/yaml.d.ts", + "plugins/yaml.js", + "plugins/yaml.mjs", + "standalone.d.ts", + "standalone.js", + "standalone.mjs" + ], + "preferUnplugged": true, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/prettier/plugins/acorn.js b/node_modules/prettier/plugins/acorn.js new file mode 100644 index 0000000..bdaa3d5 --- /dev/null +++ b/node_modules/prettier/plugins/acorn.js @@ -0,0 +1,15 @@ +(function(n){function e(){var i=n();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.acorn=e()}})(function(){"use strict";var di=Object.create;var ce=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var xi=Object.getOwnPropertyNames;var yi=Object.getPrototypeOf,gi=Object.prototype.hasOwnProperty;var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vi=(e,t)=>{for(var i in t)ce(e,i,{get:t[i],enumerable:!0})},$e=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xi(t))!gi.call(e,r)&&r!==i&&ce(e,r,{get:()=>t[r],enumerable:!(s=mi(t,r))||s.enumerable});return e};var et=(e,t,i)=>(i=e!=null?di(yi(e)):{},$e(t||!e||!e.__esModule?ce(i,"default",{value:e,enumerable:!0}):i,e)),bi=e=>$e(ce({},"__esModule",{value:!0}),e);var Gt=Ze((Ys,qt)=>{qt.exports={}});var Je=Ze((Zs,Ge)=>{"use strict";var ns=Gt(),os=/^[\da-fA-F]+$/,us=/^\d+$/,Jt=new WeakMap;function Kt(e){e=e.Parser.acorn||e;let t=Jt.get(e);if(!t){let i=e.tokTypes,s=e.TokContext,r=e.TokenType,n=new s("...",!0,!0),p={tc_oTag:n,tc_cTag:o,tc_expr:u},d={jsxName:new r("jsxName"),jsxText:new r("jsxText",{beforeExpr:!0}),jsxTagStart:new r("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new r("jsxTagEnd")};d.jsxTagStart.updateContext=function(){this.context.push(u),this.context.push(n),this.exprAllowed=!1},d.jsxTagEnd.updateContext=function(f){let C=this.context.pop();C===n&&f===i.slash||C===o?(this.context.pop(),this.exprAllowed=this.curContext()===u):this.exprAllowed=!0},t={tokContexts:p,tokTypes:d},Jt.set(e,t)}return t}function ne(e){if(!e)return e;if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return ne(e.object)+"."+ne(e.property)}Ge.exports=function(e){return e=e||{},function(t){return ps({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}};Object.defineProperty(Ge.exports,"tokTypes",{get:function(){return Kt(void 0).tokTypes},configurable:!0,enumerable:!0});function ps(e,t){let i=t.acorn||void 0,s=Kt(i),r=i.tokTypes,n=s.tokTypes,o=i.tokContexts,u=s.tokContexts.tc_oTag,p=s.tokContexts.tc_cTag,d=s.tokContexts.tc_expr,f=i.isNewLine,C=i.isIdentifierStart,B=i.isIdentifierChar;return class extends t{static get acornJsx(){return s}jsx_readToken(){let h="",m=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let x=this.input.charCodeAt(this.pos);switch(x){case 60:case 123:return this.pos===this.start?x===60&&this.exprAllowed?(++this.pos,this.finishToken(n.jsxTagStart)):this.getTokenFromCode(x):(h+=this.input.slice(m,this.pos),this.finishToken(n.jsxText,h));case 38:h+=this.input.slice(m,this.pos),h+=this.jsx_readEntity(),m=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(x===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:f(x)?(h+=this.input.slice(m,this.pos),h+=this.jsx_readNewLine(!0),m=this.pos):++this.pos}}}jsx_readNewLine(h){let m=this.input.charCodeAt(this.pos),x;return++this.pos,m===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,x=h?` +`:`\r +`):x=String.fromCharCode(m),this.options.locations&&(++this.curLine,this.lineStart=this.pos),x}jsx_readString(h){let m="",x=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let g=this.input.charCodeAt(this.pos);if(g===h)break;g===38?(m+=this.input.slice(x,this.pos),m+=this.jsx_readEntity(),x=this.pos):f(g)?(m+=this.input.slice(x,this.pos),m+=this.jsx_readNewLine(!1),x=this.pos):++this.pos}return m+=this.input.slice(x,this.pos++),this.finishToken(r.string,m)}jsx_readEntity(){let h="",m=0,x,g=this.input[this.pos];g!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let w=++this.pos;for(;this.pos")}let we=w.name?"Element":"Fragment";return x["opening"+we]=w,x["closing"+we]=he,x.children=g,this.type===r.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(x,"JSX"+we)}jsx_parseText(){let h=this.parseLiteral(this.value);return h.type="JSXText",h}jsx_parseElement(){let h=this.start,m=this.startLoc;return this.next(),this.jsx_parseElementAt(h,m)}parseExprAtom(h){return this.type===n.jsxText?this.jsx_parseText():this.type===n.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(h)}readToken(h){let m=this.curContext();if(m===d)return this.jsx_readToken();if(m===u||m===p){if(C(h))return this.jsx_readWord();if(h==62)return++this.pos,this.finishToken(n.jsxTagEnd);if((h===34||h===39)&&m==u)return this.jsx_readString(h)}return h===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(n.jsxTagStart)):super.readToken(h)}updateContext(h){if(this.type==r.braceL){var m=this.curContext();m==u?this.context.push(o.b_expr):m==d?this.context.push(o.b_tmpl):super.updateContext(h),this.exprAllowed=!0}else if(this.type===r.slash&&h===n.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(h)}}}});var Hs={};vi(Hs,{parsers:()=>zs});var Si=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],nt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ci="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",ot="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Ae={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Pe="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_i={5:Pe,"5module":Pe+" export import",6:Pe+" const class extends export import super"},Ti=/^in(stanceof)?$/,ki=new RegExp("["+ot+"]"),Ei=new RegExp("["+ot+Ci+"]");function Ne(e,t){for(var i=65536,s=0;se)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function M(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ki.test(String.fromCharCode(e)):t===!1?!1:Ne(e,nt)}function H(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ei.test(String.fromCharCode(e)):t===!1?!1:Ne(e,nt)||Ne(e,Si)}var S=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function P(e,t){return new S(e,{beforeExpr:!0,binop:t})}var I={beforeExpr:!0},A={startsExpr:!0},Oe={};function b(e,t){return t===void 0&&(t={}),t.keyword=e,Oe[e]=new S(e,t)}var a={num:new S("num",A),regexp:new S("regexp",A),string:new S("string",A),name:new S("name",A),privateId:new S("privateId",A),eof:new S("eof"),bracketL:new S("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new S("]"),braceL:new S("{",{beforeExpr:!0,startsExpr:!0}),braceR:new S("}"),parenL:new S("(",{beforeExpr:!0,startsExpr:!0}),parenR:new S(")"),comma:new S(",",I),semi:new S(";",I),colon:new S(":",I),dot:new S("."),question:new S("?",I),questionDot:new S("?."),arrow:new S("=>",I),template:new S("template"),invalidTemplate:new S("invalidTemplate"),ellipsis:new S("...",I),backQuote:new S("`",A),dollarBraceL:new S("${",{beforeExpr:!0,startsExpr:!0}),eq:new S("=",{beforeExpr:!0,isAssign:!0}),assign:new S("_=",{beforeExpr:!0,isAssign:!0}),incDec:new S("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new S("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:P("||",1),logicalAND:P("&&",2),bitwiseOR:P("|",3),bitwiseXOR:P("^",4),bitwiseAND:P("&",5),equality:P("==/!=/===/!==",6),relational:P("/<=/>=",7),bitShift:P("<>/>>>",8),plusMin:new S("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:P("%",10),star:P("*",10),slash:P("/",10),starstar:new S("**",{beforeExpr:!0}),coalesce:P("??",1),_break:b("break"),_case:b("case",I),_catch:b("catch"),_continue:b("continue"),_debugger:b("debugger"),_default:b("default",I),_do:b("do",{isLoop:!0,beforeExpr:!0}),_else:b("else",I),_finally:b("finally"),_for:b("for",{isLoop:!0}),_function:b("function",A),_if:b("if"),_return:b("return",I),_switch:b("switch"),_throw:b("throw",I),_try:b("try"),_var:b("var"),_const:b("const"),_while:b("while",{isLoop:!0}),_with:b("with"),_new:b("new",{beforeExpr:!0,startsExpr:!0}),_this:b("this",A),_super:b("super",A),_class:b("class",A),_extends:b("extends",I),_export:b("export"),_import:b("import",A),_null:b("null",A),_true:b("true",A),_false:b("false",A),_in:b("in",{beforeExpr:!0,binop:7}),_instanceof:b("instanceof",{beforeExpr:!0,binop:7}),_typeof:b("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:b("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:b("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},L=/\r\n?|\n|\u2028|\u2029/,wi=new RegExp(L.source,"g");function Q(e){return e===10||e===13||e===8232||e===8233}function ut(e,t,i){i===void 0&&(i=e.length);for(var s=t;s>10)+55296,(e&1023)+56320))}var Ii=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ie=function(t,i){this.line=t,this.column=i};ie.prototype.offset=function(t){return new ie(this.line,this.column+t)};var ye=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function ct(e,t){for(var i=1,s=0;;){var r=ut(e,s,t);if(r<0)return new ie(i,t-s);++i,s=r}}var Ve={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},st=!1;function Ni(e){var t={};for(var i in Ve)t[i]=e&&Y(e,i)?e[i]:Ve[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!st&&typeof console=="object"&&console.warn&&(st=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),tt(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return tt(t.onComment)&&(t.onComment=Vi(t,t.onComment)),t}function Vi(e,t){return function(i,s,r,n,o,u){var p={type:i?"Block":"Line",value:s,start:r,end:n};e.locations&&(p.loc=new ye(this,o,u)),e.ranges&&(p.range=[r,n]),t.push(p)}}var se=1,Z=2,Be=4,lt=8,ft=16,dt=32,De=64,mt=128,re=256,Fe=se|Z|re;function je(e,t){return Z|(e?Be:0)|(t?lt:0)}var fe=0,Me=1,G=2,xt=3,yt=4,gt=5,T=function(t,i,s){this.options=t=Ni(t),this.sourceFile=t.sourceFile,this.keywords=K(_i[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=Ae[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=K(r);var n=(r?r+" ":"")+Ae.strict;this.reservedWordsStrict=K(n),this.reservedWordsStrictBind=K(n+" "+Ae.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(` +`,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(L).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=a.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(se),this.regexpState=null,this.privateNameStack=[]},F={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};T.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};F.inFunction.get=function(){return(this.currentVarScope().flags&Z)>0};F.inGenerator.get=function(){return(this.currentVarScope().flags<)>0&&!this.currentVarScope().inClassFieldInit};F.inAsync.get=function(){return(this.currentVarScope().flags&Be)>0&&!this.currentVarScope().inClassFieldInit};F.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&re)return!1;if(t.flags&Z)return(t.flags&Be)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};F.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&De)>0||i||this.options.allowSuperOutsideMethod};F.allowDirectSuper.get=function(){return(this.currentThisScope().flags&mt)>0};F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};F.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(Z|re))>0||i};F.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&re)>0};T.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var s=this,r=0;r=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,N.lastIndex=e,e+=N.exec(this.input)[0].length,this.input[e]===";"&&e++}};k.eat=function(e){return this.type===e?(this.next(),!0):!1};k.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc};k.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};k.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};k.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||L.test(this.input.slice(this.lastTokEnd,this.start))};k.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};k.semicolon=function(){!this.eat(a.semi)&&!this.insertSemicolon()&&this.unexpected()};k.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};k.expect=function(e){this.eat(e)||this.unexpected()};k.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var ge=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};k.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};k.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};k.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&s<56320)return!0;if(M(s,!0)){for(var r=i+1;H(s=this.input.charCodeAt(r),!0);)++r;if(s===92||s>55295&&s<56320)return!0;var n=this.input.slice(i,r);if(!Ti.test(n))return!0}return!1};l.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;N.lastIndex=this.pos;var e=N.exec(this.input),t=this.pos+e[0].length,i;return!L.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(H(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};l.parseStatement=function(e,t,i){var s=this.type,r=this.startNode(),n;switch(this.isLet(e)&&(s=a._var,n="let"),s){case a._break:case a._continue:return this.parseBreakContinueStatement(r,s.keyword);case a._debugger:return this.parseDebuggerStatement(r);case a._do:return this.parseDoStatement(r);case a._for:return this.parseForStatement(r);case a._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case a._class:return e&&this.unexpected(),this.parseClass(r,!0);case a._if:return this.parseIfStatement(r);case a._return:return this.parseReturnStatement(r);case a._switch:return this.parseSwitchStatement(r);case a._throw:return this.parseThrowStatement(r);case a._try:return this.parseTryStatement(r);case a._const:case a._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(r,n);case a._while:return this.parseWhileStatement(r);case a._with:return this.parseWithStatement(r);case a.braceL:return this.parseBlock(!0,r);case a.semi:return this.parseEmptyStatement(r);case a._export:case a._import:if(this.options.ecmaVersion>10&&s===a._import){N.lastIndex=this.pos;var o=N.exec(this.input),u=this.pos+o[0].length,p=this.input.charCodeAt(u);if(p===40||p===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===a._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var d=this.value,f=this.parseExpression();return s===a.name&&f.type==="Identifier"&&this.eat(a.colon)?this.parseLabeledStatement(r,d,f,e):this.parseExpressionStatement(r,f)}};l.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(a.semi)||this.insertSemicolon()?e.label=null:this.type!==a.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(a.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};l.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ue),this.enterScope(0),this.expect(a.parenL),this.type===a.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===a._var||this.type===a._const||i){var s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&s.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===a._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,s)):(t>-1&&this.unexpected(t),this.parseFor(e,s))}var n=this.isContextual("let"),o=!1,u=this.containsEsc,p=new ge,d=this.start,f=t>-1?this.parseExprSubscripts(p,"await"):this.parseExpression(!0,p);return this.type===a._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===a._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!u&&f.type==="Identifier"&&f.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),n&&o&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,p),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(p,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))};l.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,te|(i?0:Le),!1,t)};l.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};l.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(a.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};l.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(Ri),this.enterScope(0);for(var t,i=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var s=this.type===a._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(a.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};l.parseThrowStatement=function(e){return this.next(),L.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Oi=[];l.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?dt:0),this.checkLValPattern(e,t?yt:G),this.expect(a.parenR),e};l.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===a._catch){var t=this.startNode();this.next(),this.eat(a.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(a._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};l.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};l.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ue),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};l.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};l.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};l.parseLabeledStatement=function(e,t,i,s){for(var r=0,n=this.labels;r=0;p--){var d=this.labels[p];if(d.statementStart===e.start)d.statementStart=this.start,d.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};l.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};l.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(a.braceL),e&&this.enterScope(0);this.type!==a.braceR;){var s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};l.parseFor=function(e,t){return e.init=t,this.expect(a.semi),e.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),e.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};l.parseForIn=function(e,t){var i=this.type===a._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};l.parseVar=function(e,t,i,s){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(a.eq)?r.init=this.parseMaybeAssign(t):!s&&i==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&r.id.type!=="Identifier"&&!(t&&(this.type===a._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(a.comma))break}return e};l.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Me:G,!1)};var te=1,Le=2,vt=4;l.parseFunction=function(e,t,i,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===a.star&&t&Le&&this.unexpected(),e.generator=this.eat(a.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&te&&(e.id=t&vt&&this.type!==a.name?null:this.parseIdent(),e.id&&!(t&Le)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Me:G:xt));var n=this.yieldPos,o=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(je(e.async,e.generator)),t&te||(e.id=this.type===a.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,r),this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=u,this.finishNode(e,t&te?"FunctionDeclaration":"FunctionExpression")};l.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};l.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),r=this.startNode(),n=!1;for(r.body=[],this.expect(a.braceL);this.type!==a.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(r.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(n&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),n=!0):o.key&&o.key.type==="PrivateIdentifier"&&Bi(s,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};l.parseClassElement=function(e){if(this.eat(a.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,n=!1,o="method",u=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===a.star?u=!0:s="static"}if(i.static=u,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon()?n=!0:s="async"),!s&&(t>=9||!n)&&this.eat(a.star)&&(r=!0),!s&&!n&&!r){var p=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=p:s=p)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===a.parenL||o!=="method"||r||n){var d=!i.static&&de(i,"constructor"),f=d&&e;d&&o!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=d?"constructor":o,this.parseClassMethod(i,r,n,f)}else this.parseClassField(i);return i};l.isClassElementNameStart=function(){return this.type===a.name||this.type===a.privateId||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword};l.parseClassElementName=function(e){this.type===a.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};l.parseClassMethod=function(e,t,i,s){var r=e.key;e.kind==="constructor"?(t&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):e.static&&de(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,s);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};l.parseClassField=function(e){if(de(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&de(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(a.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};l.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(re|De);this.type!==a.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};l.parseClassId=function(e,t){this.type===a.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,G,!1)):(t===!0&&this.unexpected(),e.id=null)};l.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null};l.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};l.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,r=s===0?null:this.privateNameStack[s-1],n=0;n=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};l.parseExport=function(e,t){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,t);if(this.eat(a._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,s=e.specifiers;i=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};l.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportSpecifier")};l.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportDefaultSpecifier")};l.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportNamespaceSpecifier")};l.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===a.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma)))return e;if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(a.braceL);!this.eat(a.braceR);){if(t)t=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;e.push(this.parseImportSpecifier())}return e};l.parseWithClause=function(){var e=[];if(!this.eat(a._with))return e;this.expect(a.braceL);for(var t={},i=!0;!this.eat(a.braceR);){if(i)i=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;var s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;Y(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e};l.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};l.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);return Ii.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};l.adaptDirectivePrologue=function(e){for(var t=0;t=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var R=T.prototype;R.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,r=e.properties;s=8&&!u&&p.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(_.f_expr),this.parseFunction(this.startNodeAt(n,o),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(n,o),[p],!1,t);if(this.options.ecmaVersion>=8&&p.name==="async"&&this.type===a.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return p=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(a.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,o),[p],!0,t)}return p;case a.regexp:var d=this.value;return s=this.parseLiteral(d.value),s.regex={pattern:d.pattern,flags:d.flags},s;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return s=this.startNode(),s.value=this.type===a._null?null:this.type===a._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case a.parenL:var f=this.start,C=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(C)&&(e.parenthesizedAssign=f),e.parenthesizedBind<0&&(e.parenthesizedBind=f)),C;case a.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(a.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case a.braceL:return this.overrideContext(_.b_expr),this.parseObj(!1,e);case a._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case a._class:return this.parseClass(this.startNode(),!1);case a._new:return this.parseNew();case a.backQuote:return this.parseTemplate();case a._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};y.parseExprAtomDefault=function(){this.unexpected()};y.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===a.parenL&&!e)return this.parseDynamicImport(t);if(this.type===a.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};y.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(a.parenR)?e.options=null:(this.expect(a.comma),this.afterTrailingComma(a.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(a.parenR)||(this.expect(a.comma),this.afterTrailingComma(a.parenR)||this.unexpected())));else if(!this.eat(a.parenR)){var t=this.start;this.eat(a.comma)&&this.eat(a.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};y.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};y.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};y.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e};y.shouldParseArrow=function(e){return!this.canInsertSemicolon()};y.parseParenAndDistinguishExpression=function(e,t){var i=this.start,s=this.startLoc,r,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,u=this.startLoc,p=[],d=!0,f=!1,C=new ge,B=this.yieldPos,h=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==a.parenR;)if(d?d=!1:this.expect(a.comma),n&&this.afterTrailingComma(a.parenR,!0)){f=!0;break}else if(this.type===a.ellipsis){m=this.start,p.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else p.push(this.parseMaybeAssign(!1,C,this.parseParenItem));var x=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(p)&&this.eat(a.arrow))return this.checkPatternErrors(C,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=B,this.awaitPos=h,this.parseParenArrowList(i,s,p,t);(!p.length||f)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(C,!0),this.yieldPos=B||this.yieldPos,this.awaitPos=h||this.awaitPos,p.length>1?(r=this.startNodeAt(o,u),r.expressions=p,this.finishNodeAt(r,"SequenceExpression",x,g)):r=p[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(i,s);return w.expression=r,this.finishNode(w,"ParenthesizedExpression")}else return r};y.parseParenItem=function(e){return e};y.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var Di=[];y.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===a.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(a.parenL)?e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Di,this.finishNode(e,"NewExpression")};y.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===a.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,` +`),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` +`),cooked:this.value},this.next(),i.tail=this.type===a.backQuote,this.finishNode(i,"TemplateElement")};y.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.tail;)this.type===a.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(a.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(a.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};y.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===a.name||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===a.star)&&!L.test(this.input.slice(this.lastTokEnd,this.start))};y.parseObj=function(e,t){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(a.braceR);){if(s)s=!1;else if(this.expect(a.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(a.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,r,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};y.parseProperty=function(e,t){var i=this.startNode(),s,r,n,o;if(this.options.ecmaVersion>=9&&this.eat(a.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===a.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,o=this.startLoc),e||(s=this.eat(a.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(a.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,e,s,r,n,o,t,u),this.finishNode(i,"Property")};y.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};y.parsePropertyValue=function(e,t,i,s,r,n,o,u){(i||s)&&this.type===a.colon&&this.unexpected(),this.eat(a.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===a.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,s)):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==a.comma&&this.type!==a.braceR&&this.type!==a.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key)):this.type===a.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};y.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(a.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(a.bracketR),e.key;e.computed=!1}return e.key=this.type===a.num||this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};y.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};y.parseMethod=function(e,t,i){var s=this.startNode(),r=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(je(t,s.generator)|De|(i?mt:0)),this.expect(a.parenL),s.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(s,"FunctionExpression")};y.parseArrowExpression=function(e,t,i,s){var r=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(je(i,!1)|ft),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};y.parseFunctionBody=function(e,t,i,s){var r=t&&this.type!==a.braceL,n=this.strict,o=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||u)&&(o=this.strictDirective(this.end),o&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var p=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!n&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,gt),e.body=this.parseBlock(!1,void 0,o&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=p}this.exitScope()};y.isSimpleParamList=function(e){for(var t=0,i=e;t-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&r.flags&se&&delete this.undefinedExports[e]}else if(t===yt){var n=this.currentScope();n.lexical.push(e)}else if(t===xt){var o=this.currentScope();this.treatFunctionsAsVar?s=o.lexical.indexOf(e)>-1:s=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e)}else for(var u=this.scopeStack.length-1;u>=0;--u){var p=this.scopeStack[u];if(p.lexical.indexOf(e)>-1&&!(p.flags&dt&&p.lexical[0]===e)||!this.treatFunctionsAsVarInScope(p)&&p.functions.indexOf(e)>-1){s=!0;break}if(p.var.push(e),this.inModule&&p.flags&se&&delete this.undefinedExports[e],p.flags&Fe)break}s&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};W.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};W.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};W.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fe)return t}};W.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fe&&!(t.flags&ft))return t}};var ve=function(t,i,s){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new ye(t,s)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},ae=T.prototype;ae.startNode=function(){return new ve(this,this.start,this.startLoc)};ae.startNodeAt=function(e,t){return new ve(this,e,t)};function St(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}ae.finishNode=function(e,t){return St.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ae.finishNodeAt=function(e,t,i,s){return St.call(this,e,t,i,s)};ae.copyNode=function(e){var t=new ve(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var ji="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Ct="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",_t=Ct+" Extended_Pictographic",Tt=_t,kt=Tt+" EBase EComp EMod EPres ExtPict",Et=kt,Mi=Et,Ui={9:Ct,10:_t,11:Tt,12:kt,13:Et,14:Mi},qi="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Gi={9:"",10:"",11:"",12:"",13:"",14:qi},rt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",wt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",At=wt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Pt=At+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",It=Pt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Nt=It+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Ji=Nt+" "+ji,Ki={9:wt,10:At,11:Pt,12:It,13:Nt,14:Ji},Vt={};function Wi(e){var t=Vt[e]={binary:K(Ui[e]+" "+rt),binaryOfStrings:K(Gi[e]),nonBinary:{General_Category:K(rt),Script:K(Ki[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(le=0,Ie=[9,10,11,12,13,14];le=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Vt[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};j.prototype.reset=function(t,i,s){var r=s.indexOf("v")!==-1,n=s.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=s,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)};j.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};j.prototype.at=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return-1;var n=s.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=r)return n;var o=s.charCodeAt(t+1);return o>=56320&&o<=57343?(n<<10)+o-56613888:n};j.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return r;var n=s.charCodeAt(t),o;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=r||(o=s.charCodeAt(t+1))<56320||o>57343?t+1:t+2};j.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};j.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};j.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};j.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};j.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var s=this.pos,r=0,n=t;r-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(s=!0),o==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")};function Xi(e){for(var t in e)return!0;return!1}c.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Xi(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};c.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t=16;for(t&&(e.branchID=new xe(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};c.regexp_alternative=function(e){for(;e.pos=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};c.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};c.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};c.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return r!==-1&&r=16){var i=this.regexp_eatModifiers(e),s=e.eat(45);if(i||s){for(var r=0;r-1&&e.raise("Duplicate regular expression modifiers")}if(s){var o=this.regexp_eatModifiers(e);!i&&!o&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var u=0;u-1||i.indexOf(p)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};c.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};c.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&zi(i);)t+=U(i),e.advance();return t};function zi(e){return e===105||e===109||e===115}c.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};c.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};c.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Lt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Lt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}c.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Lt(i);)e.advance();return e.pos!==t};c.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};c.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var s=0,r=i;s=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),Hi(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Hi(e){return M(e,!0)||e===36||e===95}c.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),Qi(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Qi(e){return H(e,!0)||e===36||e===95||e===8204||e===8205}c.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};c.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};c.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};c.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};c.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};c.regexp_eatZero=function(e){return e.current()===48&&!be(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};c.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};c.regexp_eatControlLetter=function(e){var t=e.current();return Rt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Rt(e){return e>=65&&e<=90||e>=97&&e<=122}c.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(s&&r>=55296&&r<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(r-55296)*1024+(o-56320)+65536,!0}e.pos=n,e.lastIntValue=r}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Yi(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Yi(e){return e>=0&&e<=1114111}c.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};c.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ot=0,q=1,V=2;c.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Zi(t))return e.lastIntValue=-1,e.advance(),q;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var s;if(e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&s===V&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return Ot};function Zi(e){return e===100||e===68||e===115||e===83||e===119||e===87}c.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,s),q}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return Ot};c.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){Y(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};c.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return q;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return V;e.raise("Invalid property name")};c.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Bt(t=e.current());)e.lastStringValue+=U(t),e.advance();return e.lastStringValue!==""};function Bt(e){return Rt(e)||e===95}c.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";$i(t=e.current());)e.lastStringValue+=U(t),e.advance();return e.lastStringValue!==""};function $i(e){return Bt(e)||be(e)}c.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};c.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===V&&e.raise("Negated character class may contain strings"),!0}return!1};c.regexp_classContents=function(e){return e.current()===93?q:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),q)};c.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};c.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||jt(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return s!==93?(e.lastIntValue=s,e.advance(),!0):!1};c.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};c.regexp_classSetExpression=function(e){var t=q,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===V&&(t=V);for(var s=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==V&&(t=q);continue}e.raise("Invalid character in character class")}if(s!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===V&&(t=V)}};c.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;return i!==-1&&s!==-1&&i>s&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};c.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?q:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};c.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return i&&s===V&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null};c.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null};c.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===V&&(t=V);return t};c.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?q:V};c.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&es(i)||ts(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function es(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function ts(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}c.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return is(t)?(e.lastIntValue=t,e.advance(),!0):!1};function is(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}c.regexp_eatClassControlLetter=function(e){var t=e.current();return be(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};c.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};c.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;be(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function be(e){return e>=48&&e<=57}c.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Dt(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ft(i),e.advance();return e.pos!==t};function Dt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ft(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}c.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};c.regexp_eatOctalDigit=function(e){var t=e.current();return jt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function jt(e){return e>=48&&e<=55}c.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s=this.input.length)return this.finishToken(a.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};v.readToken=function(e){return M(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};v.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};v.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,r=t;(s=ut(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};v.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&pt.test(String.fromCharCode(e)))++this.pos;else break e}}};v.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};v.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(a.ellipsis)):(++this.pos,this.finishToken(a.dot))};v.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(a.assign,2):this.finishOp(a.slash,1)};v.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,s=e===42?a.star:a.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,s=a.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(a.assign,i+1):this.finishOp(s,i)};v.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(a.assign,3)}return this.finishOp(e===124?a.logicalOR:a.logicalAND,2)}return t===61?this.finishOp(a.assign,2):this.finishOp(e===124?a.bitwiseOR:a.bitwiseAND,1)};v.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(a.assign,2):this.finishOp(a.bitwiseXOR,1)};v.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||L.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(a.incDec,2):t===61?this.finishOp(a.assign,2):this.finishOp(a.plusMin,1)};v.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(a.assign,i+1):this.finishOp(a.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(a.relational,i))};v.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(a.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(a.arrow)):this.finishOp(e===61?a.eq:a.prefix,1)};v.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(a.questionDot,2)}if(t===63){if(e>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(a.assign,3)}return this.finishOp(a.coalesce,2)}}return this.finishOp(a.question,1)};v.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),M(t,!0)||t===92))return this.finishToken(a.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+U(t)+"'")};v.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(a.parenL);case 41:return++this.pos,this.finishToken(a.parenR);case 59:return++this.pos,this.finishToken(a.semi);case 44:return++this.pos,this.finishToken(a.comma);case 91:return++this.pos,this.finishToken(a.bracketL);case 93:return++this.pos,this.finishToken(a.bracketR);case 123:return++this.pos,this.finishToken(a.braceL);case 125:return++this.pos,this.finishToken(a.braceR);case 58:return++this.pos,this.finishToken(a.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(a.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(a.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+U(e)+"'")};v.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};v.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(L.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(s==="[")t=!0;else if(s==="]"&&t)t=!1;else if(s==="/"&&!t)break;e=s==="\\"}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var n=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(n);var u=this.regexpState||(this.regexpState=new j(this));u.reset(i,r,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var p=null;try{p=new RegExp(r,o)}catch{}return this.finishToken(a.regexp,{pattern:r,flags:o,value:p})};v.readInt=function(e,t,i){for(var s=this.options.ecmaVersion>=12&&t===void 0,r=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,o=0,u=0,p=0,d=t??1/0;p=97?C=f-97+10:f>=65?C=f-65+10:f>=48&&f<=57?C=f-48:C=1/0,C>=e)break;u=f,o=o*e+C}return s&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:o};function ss(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Mt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}v.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Mt(this.input.slice(t,this.pos)),++this.pos):M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(a.num,i)};v.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){var r=Mt(this.input.slice(t,this.pos));return++this.pos,M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(a.num,r)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=ss(this.input.slice(t,this.pos),i);return this.finishToken(a.num,n)};v.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};v.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;s===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Q(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(a.string,t)};var Ut={};v.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Ut)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};v.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ut;this.raise(e,t)};v.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===a.template||this.type===a.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(a.dollarBraceL)):(++this.pos,this.finishToken(a.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(a.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Q(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=` +`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};v.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),(s!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return Q(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};v.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};v.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[i<0?t.length+i:i]:t.at(i)},X=ls;function fs(e){return Array.isArray(e)&&e.length>0}var Wt=fs;function O(e){var s,r,n;let t=((s=e.range)==null?void 0:s[0])??e.start,i=(n=((r=e.declaration)==null?void 0:r.decorators)??e.decorators)==null?void 0:n[0];return i?Math.min(O(i),t):t}function J(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function ds(e){let t=new Set(e);return i=>t.has(i==null?void 0:i.type)}var Xt=ds;var ms=Xt(["Block","CommentBlock","MultiLine"]),oe=ms;function xs(e){let t=`*${e.value}*`.split(` +`);return t.length>1&&t.every(i=>i.trimStart()[0]==="*")}var Ke=xs;function ys(e){return oe(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(e.value)}var zt=ys;var ue=null;function pe(e){if(ue!==null&&typeof ue.property){let t=ue;return ue=pe.prototype=null,t}return ue=pe.prototype=e??Object.create(null),new pe}var gs=10;for(let e=0;e<=gs;e++)pe();function We(e){return pe(e)}function vs(e,t="type"){We(e);function i(s){let r=s[t],n=e[r];if(!Array.isArray(n))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:s});return n}return i}var Ht=vs;var Qt={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var bs=Ht(Qt),Yt=bs;function Xe(e,t){if(!(e!==null&&typeof e=="object"))return e;if(Array.isArray(e)){for(let s=0;s{var o;(o=n.leadingComments)!=null&&o.some(zt)&&r.add(O(n))}),e=_e(e,n=>{if(n.type==="ParenthesizedExpression"){let{expression:o}=n;if(o.type==="TypeCastExpression")return o.range=[...n.range],o;let u=O(n);if(!r.has(u))return o.extra={...o.extra,parenthesized:!0},o}})}if(e=_e(e,r=>{switch(r.type){case"LogicalExpression":if(Zt(r))return ze(r);break;case"VariableDeclaration":{let n=X(!1,r.declarations,-1);n!=null&&n.init&&s[J(n)]!==";"&&(r.range=[O(r),J(n)]);break}case"TSParenthesizedType":return r.typeAnnotation;case"TSTypeParameter":if(typeof r.name=="string"){let n=O(r);r.name={type:"Identifier",name:r.name,range:[n,n+r.name.length]}}break;case"TopicReference":e.extra={...e.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(r.types.length===1)return r.types[0];break}}),Wt(e.comments)){let r=X(!1,e.comments,-1);for(let n=e.comments.length-2;n>=0;n--){let o=e.comments[n];J(o)===O(r)&&oe(o)&&oe(r)&&Ke(o)&&Ke(r)&&(e.comments.splice(n+1,1),o.value+="*//*"+r.value,o.range=[O(o),J(r)]),r=o}}return e.type==="Program"&&(e.range=[0,s.length]),e}function Zt(e){return e.type==="LogicalExpression"&&e.right.type==="LogicalExpression"&&e.operator===e.right.operator}function ze(e){return Zt(e)?ze({type:"LogicalExpression",operator:e.operator,left:ze({type:"LogicalExpression",operator:e.operator,left:e.left,right:e.right.left,range:[O(e.left),J(e.right.left)]}),right:e.right.right,range:[O(e),J(e)]}):e}var Te=Ss;var Cs=(e,t,i,s)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(i,s):i.global?t.replace(i,s):t.split(i).join(s)},ee=Cs;var _s=/\*\/$/,Ts=/^\/\*\*?/,ks=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Es=/(^|\s+)\/\/([^\n\r]*)/g,$t=/^(\r?\n)+/,ws=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ei=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,As=/(\r?\n|^) *\* ?/g,Ps=[];function ti(e){let t=e.match(ks);return t?t[0].trimStart():""}function ii(e){let t=` +`;e=ee(!1,e.replace(Ts,"").replace(_s,""),As,"$1");let i="";for(;i!==e;)i=e,e=ee(!1,e,ws,`${t}$1 $2${t}`);e=e.replace($t,"").trimEnd();let s=Object.create(null),r=ee(!1,e,ei,"").replace($t,"").trimEnd(),n;for(;n=ei.exec(e);){let o=ee(!1,n[2],Es,"");if(typeof s[n[1]]=="string"||Array.isArray(s[n[1]])){let u=s[n[1]];s[n[1]]=[...Ps,...Array.isArray(u)?u:[u],o]}else s[n[1]]=o}return{comments:r,pragmas:s}}function Is(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` +`);return t===-1?e:e.slice(0,t)}var si=Is;function Ns(e){let t=si(e);t&&(e=e.slice(t.length+1));let i=ti(e),{pragmas:s,comments:r}=ii(i);return{shebang:t,text:e,pragmas:s,comments:r}}function ri(e){let{pragmas:t}=Ns(e);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function Vs(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:ri,locStart:O,locEnd:J,...e}}var ke=Vs;function Ls(e){let{filepath:t}=e;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs")||t.endsWith(".cts"))return"script";if(t.endsWith(".mjs")||t.endsWith(".mts"))return"module"}}var Ee=Ls;var Rs={ecmaVersion:"latest",allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,locations:!0,ranges:!0};function Os(e){let{message:t,loc:i}=e;if(!i)return e;let{line:s,column:r}=i;return Se(t.replace(/ \(\d+:\d+\)$/u,""),{loc:{start:{line:s,column:r+1}},cause:e})}var ai,Bs=()=>(ai??(ai=T.extend((0,ni.default)())),ai);function Ds(e,t){let i=Bs(),s=[],r=[],n=i.parse(e,{...Rs,sourceType:t,allowImportExportEverywhere:t==="module",onComment:s,onToken:r});return n.comments=s,n.tokens=r,n}function Fs(e,t={}){let i=Ee(t),s=(i?[i]:["module","script"]).map(n=>()=>Ds(e,n)),r;try{r=Ce(s)}catch({errors:[n]}){throw Os(n)}return Te(r,{text:e})}var oi=ke(Fs);var ci=et(Je(),1);var E={Boolean:"Boolean",EOF:"",Identifier:"Identifier",PrivateIdentifier:"PrivateIdentifier",Keyword:"Keyword",Null:"Null",Numeric:"Numeric",Punctuator:"Punctuator",String:"String",RegularExpression:"RegularExpression",Template:"Template",JSXIdentifier:"JSXIdentifier",JSXText:"JSXText"};function js(e,t){let i=e[0],s=X(!1,e,-1),r={type:E.Template,value:t.slice(i.start,s.end)};return i.loc&&(r.loc={start:i.loc.start,end:s.loc.end}),i.range&&(r.start=i.range[0],r.end=s.range[1],r.range=[r.start,r.end]),r}function He(e,t){this._acornTokTypes=e,this._tokens=[],this._curlyBrace=null,this._code=t}He.prototype={constructor:He,translate(e,t){let i=e.type,s=this._acornTokTypes;if(i===s.name)e.type=E.Identifier,e.value==="static"&&(e.type=E.Keyword),t.ecmaVersion>5&&(e.value==="yield"||e.value==="let")&&(e.type=E.Keyword);else if(i===s.privateId)e.type=E.PrivateIdentifier;else if(i===s.semi||i===s.comma||i===s.parenL||i===s.parenR||i===s.braceL||i===s.braceR||i===s.dot||i===s.bracketL||i===s.colon||i===s.question||i===s.bracketR||i===s.ellipsis||i===s.arrow||i===s.jsxTagStart||i===s.incDec||i===s.starstar||i===s.jsxTagEnd||i===s.prefix||i===s.questionDot||i.binop&&!i.keyword||i.isAssign)e.type=E.Punctuator,e.value=this._code.slice(e.start,e.end);else if(i===s.jsxName)e.type=E.JSXIdentifier;else if(i.label==="jsxText"||i===s.jsxAttrValueToken)e.type=E.JSXText;else if(i.keyword)i.keyword==="true"||i.keyword==="false"?e.type=E.Boolean:i.keyword==="null"?e.type=E.Null:e.type=E.Keyword;else if(i===s.num)e.type=E.Numeric,e.value=this._code.slice(e.start,e.end);else if(i===s.string)t.jsxAttrValueToken?(t.jsxAttrValueToken=!1,e.type=E.JSXText):e.type=E.String,e.value=this._code.slice(e.start,e.end);else if(i===s.regexp){e.type=E.RegularExpression;let r=e.value;e.regex={flags:r.flags,pattern:r.pattern},e.value=`/${r.pattern}/${r.flags}`}return e},onToken(e,t){let i=this._acornTokTypes,s=t.tokens,r=this._tokens,n=()=>{s.push(js(this._tokens,this._code)),this._tokens=[]};if(e.type===i.eof){this._curlyBrace&&s.push(this.translate(this._curlyBrace,t));return}if(e.type===i.backQuote){this._curlyBrace&&(s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=null),r.push(e),r.length>1&&n();return}if(e.type===i.dollarBraceL){r.push(e),n();return}if(e.type===i.braceR){this._curlyBrace&&s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=e;return}if(e.type===i.template||e.type===i.invalidTemplate){this._curlyBrace&&(r.push(this._curlyBrace),this._curlyBrace=null),r.push(e);return}this._curlyBrace&&(s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=null),s.push(this.translate(e,t))}};var ui=He;var pi=[3,5,6,7,8,9,10,11,12,13,14,15,16];function Ms(){return X(!1,pi,-1)}function Us(e=5){let t=e==="latest"?Ms():e;if(typeof t!="number")throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof e} instead.`);if(t>=2015&&(t-=2009),!pi.includes(t))throw new Error("Invalid ecmaVersion.");return t}function qs(e="script"){if(e==="script"||e==="module")return e;if(e==="commonjs")return"script";throw new Error("Invalid sourceType.")}function hi(e){let t=Us(e.ecmaVersion),i=qs(e.sourceType),s=e.range===!0,r=e.loc===!0;if(t!==3&&e.allowReserved)throw new Error("`allowReserved` is only supported when ecmaVersion is 3");if(typeof e.allowReserved<"u"&&typeof e.allowReserved!="boolean")throw new Error("`allowReserved`, when present, must be `true` or `false`");let n=t===3?e.allowReserved||"never":!1,o=e.ecmaFeatures||{},u=e.sourceType==="commonjs"||!!o.globalReturn;if(i==="module"&&t<6)throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");return Object.assign({},e,{ecmaVersion:t,sourceType:i,ranges:s,locations:r,allowReserved:n,allowReturnOutsideFunction:u})}var z=Symbol("espree's internal state"),Qe=Symbol("espree's esprimaFinishNode");function Gs(e,t,i,s,r,n,o){let u;e?u="Block":o.slice(i,i+2)==="#!"?u="Hashbang":u="Line";let p={type:u,value:t};return typeof i=="number"&&(p.start=i,p.end=s,p.range=[i,s]),typeof r=="object"&&(p.loc={start:r,end:n}),p}var Ye=()=>e=>{let t=Object.assign({},e.acorn.tokTypes);return e.acornJsx&&Object.assign(t,e.acornJsx.tokTypes),class extends e{constructor(s,r){(typeof s!="object"||s===null)&&(s={}),typeof r!="string"&&!(r instanceof String)&&(r=String(r));let n=s.sourceType,o=hi(s),u=o.ecmaFeatures||{},p=o.tokens===!0?new ui(t,r):null,d={originalSourceType:n||o.sourceType,tokens:p?[]:null,comments:o.comment===!0?[]:null,impliedStrict:u.impliedStrict===!0&&o.ecmaVersion>=5,ecmaVersion:o.ecmaVersion,jsxAttrValueToken:!1,lastToken:null,templateElements:[]};super({ecmaVersion:o.ecmaVersion,sourceType:o.sourceType,ranges:o.ranges,locations:o.locations,allowReserved:o.allowReserved,allowReturnOutsideFunction:o.allowReturnOutsideFunction,onToken(f){p&&p.onToken(f,d),f.type!==t.eof&&(d.lastToken=f)},onComment(f,C,B,h,m,x){if(d.comments){let g=Gs(f,C,B,h,m,x,r);d.comments.push(g)}}},r),this[z]=d}tokenize(){do this.next();while(this.type!==t.eof);this.next();let s=this[z],r=s.tokens;return s.comments&&(r.comments=s.comments),r}finishNode(...s){let r=super.finishNode(...s);return this[Qe](r)}finishNodeAt(...s){let r=super.finishNodeAt(...s);return this[Qe](r)}parse(){let s=this[z],r=super.parse();if(r.sourceType=s.originalSourceType,s.comments&&(r.comments=s.comments),s.tokens&&(r.tokens=s.tokens),r.body.length){let[n]=r.body;r.range&&(r.range[0]=n.range[0]),r.loc&&(r.loc.start=n.loc.start),r.start=n.start}return s.lastToken&&(r.range&&(r.range[1]=s.lastToken.range[1]),r.loc&&(r.loc.end=s.lastToken.loc.end),r.end=s.lastToken.end),this[z].templateElements.forEach(n=>{let u=n.tail?1:2;n.start+=-1,n.end+=u,n.range&&(n.range[0]+=-1,n.range[1]+=u),n.loc&&(n.loc.start.column+=-1,n.loc.end.column+=u)}),r}parseTopLevel(s){return this[z].impliedStrict&&(this.strict=!0),super.parseTopLevel(s)}raise(s,r){let n=e.acorn.getLineInfo(this.input,s),o=new SyntaxError(r);throw o.index=s,o.lineNumber=n.line,o.column=n.column+1,o}raiseRecoverable(s,r){this.raise(s,r)}unexpected(s){let r="Unexpected token";if(s!=null){if(this.pos=s,this.options.locations)for(;this.posthis.start&&(r+=` ${this.input.slice(this.start,this.end)}`),this.raise(this.start,r)}jsx_readString(s){let r=super.jsx_readString(s);return this.type===t.string&&(this[z].jsxAttrValueToken=!0),r}[Qe](s){return s.type==="TemplateElement"&&this[z].templateElements.push(s),s.type.includes("Function")&&!s.generator&&(s.generator=!1),s}}};var Js={_regular:null,_jsx:null,get regular(){return this._regular===null&&(this._regular=T.extend(Ye())),this._regular},get jsx(){return this._jsx===null&&(this._jsx=T.extend((0,ci.default)(),Ye())),this._jsx},get(e){return!!(e&&e.ecmaFeatures&&e.ecmaFeatures.jsx)?this.jsx:this.regular}};function li(e,t){let i=Js.get(t);return new i(t,e).parse()}var Ks={ecmaVersion:"latest",range:!0,loc:!0,comment:!0,tokens:!0,sourceType:"module",ecmaFeatures:{jsx:!0,globalReturn:!0,impliedStrict:!1}};function Ws(e){let{message:t,lineNumber:i,column:s}=e;return typeof i!="number"?e:Se(t,{loc:{start:{line:i,column:s}},cause:e})}function Xs(e,t={}){let i=Ee(t),s=(i?[i]:["module","script"]).map(n=>()=>li(e,{...Ks,sourceType:n})),r;try{r=Ce(s)}catch({errors:[n]}){throw Ws(n)}return Te(r,{text:e})}var fi=ke(Xs);var zs={acorn:oi,espree:fi};return bi(Hs);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/acorn.mjs b/node_modules/prettier/plugins/acorn.mjs new file mode 100644 index 0000000..7984f56 --- /dev/null +++ b/node_modules/prettier/plugins/acorn.mjs @@ -0,0 +1,15 @@ +var di=Object.create;var we=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var xi=Object.getOwnPropertyNames;var yi=Object.getPrototypeOf,gi=Object.prototype.hasOwnProperty;var $e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vi=(e,t)=>{for(var i in t)we(e,i,{get:t[i],enumerable:!0})},bi=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xi(t))!gi.call(e,r)&&r!==i&&we(e,r,{get:()=>t[r],enumerable:!(s=mi(t,r))||s.enumerable});return e};var et=(e,t,i)=>(i=e!=null?di(yi(e)):{},bi(t||!e||!e.__esModule?we(i,"default",{value:e,enumerable:!0}):i,e));var Gt=$e((Qs,qt)=>{qt.exports={}});var Je=$e((Ys,Ge)=>{"use strict";var ns=Gt(),os=/^[\da-fA-F]+$/,us=/^\d+$/,Jt=new WeakMap;function Kt(e){e=e.Parser.acorn||e;let t=Jt.get(e);if(!t){let i=e.tokTypes,s=e.TokContext,r=e.TokenType,n=new s("...",!0,!0),p={tc_oTag:n,tc_cTag:o,tc_expr:u},d={jsxName:new r("jsxName"),jsxText:new r("jsxText",{beforeExpr:!0}),jsxTagStart:new r("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new r("jsxTagEnd")};d.jsxTagStart.updateContext=function(){this.context.push(u),this.context.push(n),this.exprAllowed=!1},d.jsxTagEnd.updateContext=function(f){let C=this.context.pop();C===n&&f===i.slash||C===o?(this.context.pop(),this.exprAllowed=this.curContext()===u):this.exprAllowed=!0},t={tokContexts:p,tokTypes:d},Jt.set(e,t)}return t}function ne(e){if(!e)return e;if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return ne(e.object)+"."+ne(e.property)}Ge.exports=function(e){return e=e||{},function(t){return ps({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}};Object.defineProperty(Ge.exports,"tokTypes",{get:function(){return Kt(void 0).tokTypes},configurable:!0,enumerable:!0});function ps(e,t){let i=t.acorn||void 0,s=Kt(i),r=i.tokTypes,n=s.tokTypes,o=i.tokContexts,u=s.tokContexts.tc_oTag,p=s.tokContexts.tc_cTag,d=s.tokContexts.tc_expr,f=i.isNewLine,C=i.isIdentifierStart,B=i.isIdentifierChar;return class extends t{static get acornJsx(){return s}jsx_readToken(){let h="",m=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let x=this.input.charCodeAt(this.pos);switch(x){case 60:case 123:return this.pos===this.start?x===60&&this.exprAllowed?(++this.pos,this.finishToken(n.jsxTagStart)):this.getTokenFromCode(x):(h+=this.input.slice(m,this.pos),this.finishToken(n.jsxText,h));case 38:h+=this.input.slice(m,this.pos),h+=this.jsx_readEntity(),m=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(x===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:f(x)?(h+=this.input.slice(m,this.pos),h+=this.jsx_readNewLine(!0),m=this.pos):++this.pos}}}jsx_readNewLine(h){let m=this.input.charCodeAt(this.pos),x;return++this.pos,m===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,x=h?` +`:`\r +`):x=String.fromCharCode(m),this.options.locations&&(++this.curLine,this.lineStart=this.pos),x}jsx_readString(h){let m="",x=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let g=this.input.charCodeAt(this.pos);if(g===h)break;g===38?(m+=this.input.slice(x,this.pos),m+=this.jsx_readEntity(),x=this.pos):f(g)?(m+=this.input.slice(x,this.pos),m+=this.jsx_readNewLine(!1),x=this.pos):++this.pos}return m+=this.input.slice(x,this.pos++),this.finishToken(r.string,m)}jsx_readEntity(){let h="",m=0,x,g=this.input[this.pos];g!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let w=++this.pos;for(;this.pos")}let Ee=w.name?"Element":"Fragment";return x["opening"+Ee]=w,x["closing"+Ee]=he,x.children=g,this.type===r.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(x,"JSX"+Ee)}jsx_parseText(){let h=this.parseLiteral(this.value);return h.type="JSXText",h}jsx_parseElement(){let h=this.start,m=this.startLoc;return this.next(),this.jsx_parseElementAt(h,m)}parseExprAtom(h){return this.type===n.jsxText?this.jsx_parseText():this.type===n.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(h)}readToken(h){let m=this.curContext();if(m===d)return this.jsx_readToken();if(m===u||m===p){if(C(h))return this.jsx_readWord();if(h==62)return++this.pos,this.finishToken(n.jsxTagEnd);if((h===34||h===39)&&m==u)return this.jsx_readString(h)}return h===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(n.jsxTagStart)):super.readToken(h)}updateContext(h){if(this.type==r.braceL){var m=this.curContext();m==u?this.context.push(o.b_expr):m==d?this.context.push(o.b_tmpl):super.updateContext(h),this.exprAllowed=!0}else if(this.type===r.slash&&h===n.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(h)}}}});var Ze={};vi(Ze,{parsers:()=>zs});var Si=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],nt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ci="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",ot="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Ae={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Pe="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_i={5:Pe,"5module":Pe+" export import",6:Pe+" const class extends export import super"},Ti=/^in(stanceof)?$/,ki=new RegExp("["+ot+"]"),Ei=new RegExp("["+ot+Ci+"]");function Ne(e,t){for(var i=65536,s=0;se)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function M(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ki.test(String.fromCharCode(e)):t===!1?!1:Ne(e,nt)}function H(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ei.test(String.fromCharCode(e)):t===!1?!1:Ne(e,nt)||Ne(e,Si)}var S=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function P(e,t){return new S(e,{beforeExpr:!0,binop:t})}var I={beforeExpr:!0},A={startsExpr:!0},Oe={};function b(e,t){return t===void 0&&(t={}),t.keyword=e,Oe[e]=new S(e,t)}var a={num:new S("num",A),regexp:new S("regexp",A),string:new S("string",A),name:new S("name",A),privateId:new S("privateId",A),eof:new S("eof"),bracketL:new S("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new S("]"),braceL:new S("{",{beforeExpr:!0,startsExpr:!0}),braceR:new S("}"),parenL:new S("(",{beforeExpr:!0,startsExpr:!0}),parenR:new S(")"),comma:new S(",",I),semi:new S(";",I),colon:new S(":",I),dot:new S("."),question:new S("?",I),questionDot:new S("?."),arrow:new S("=>",I),template:new S("template"),invalidTemplate:new S("invalidTemplate"),ellipsis:new S("...",I),backQuote:new S("`",A),dollarBraceL:new S("${",{beforeExpr:!0,startsExpr:!0}),eq:new S("=",{beforeExpr:!0,isAssign:!0}),assign:new S("_=",{beforeExpr:!0,isAssign:!0}),incDec:new S("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new S("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:P("||",1),logicalAND:P("&&",2),bitwiseOR:P("|",3),bitwiseXOR:P("^",4),bitwiseAND:P("&",5),equality:P("==/!=/===/!==",6),relational:P("/<=/>=",7),bitShift:P("<>/>>>",8),plusMin:new S("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:P("%",10),star:P("*",10),slash:P("/",10),starstar:new S("**",{beforeExpr:!0}),coalesce:P("??",1),_break:b("break"),_case:b("case",I),_catch:b("catch"),_continue:b("continue"),_debugger:b("debugger"),_default:b("default",I),_do:b("do",{isLoop:!0,beforeExpr:!0}),_else:b("else",I),_finally:b("finally"),_for:b("for",{isLoop:!0}),_function:b("function",A),_if:b("if"),_return:b("return",I),_switch:b("switch"),_throw:b("throw",I),_try:b("try"),_var:b("var"),_const:b("const"),_while:b("while",{isLoop:!0}),_with:b("with"),_new:b("new",{beforeExpr:!0,startsExpr:!0}),_this:b("this",A),_super:b("super",A),_class:b("class",A),_extends:b("extends",I),_export:b("export"),_import:b("import",A),_null:b("null",A),_true:b("true",A),_false:b("false",A),_in:b("in",{beforeExpr:!0,binop:7}),_instanceof:b("instanceof",{beforeExpr:!0,binop:7}),_typeof:b("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:b("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:b("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},L=/\r\n?|\n|\u2028|\u2029/,wi=new RegExp(L.source,"g");function Q(e){return e===10||e===13||e===8232||e===8233}function ut(e,t,i){i===void 0&&(i=e.length);for(var s=t;s>10)+55296,(e&1023)+56320))}var Ii=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ie=function(t,i){this.line=t,this.column=i};ie.prototype.offset=function(t){return new ie(this.line,this.column+t)};var xe=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function ct(e,t){for(var i=1,s=0;;){var r=ut(e,s,t);if(r<0)return new ie(i,t-s);++i,s=r}}var Ve={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},st=!1;function Ni(e){var t={};for(var i in Ve)t[i]=e&&Y(e,i)?e[i]:Ve[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!st&&typeof console=="object"&&console.warn&&(st=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),tt(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return tt(t.onComment)&&(t.onComment=Vi(t,t.onComment)),t}function Vi(e,t){return function(i,s,r,n,o,u){var p={type:i?"Block":"Line",value:s,start:r,end:n};e.locations&&(p.loc=new xe(this,o,u)),e.ranges&&(p.range=[r,n]),t.push(p)}}var se=1,Z=2,Be=4,lt=8,ft=16,dt=32,De=64,mt=128,re=256,Fe=se|Z|re;function je(e,t){return Z|(e?Be:0)|(t?lt:0)}var le=0,Me=1,G=2,xt=3,yt=4,gt=5,T=function(t,i,s){this.options=t=Ni(t),this.sourceFile=t.sourceFile,this.keywords=K(_i[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=Ae[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=K(r);var n=(r?r+" ":"")+Ae.strict;this.reservedWordsStrict=K(n),this.reservedWordsStrictBind=K(n+" "+Ae.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(` +`,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(L).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=a.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(se),this.regexpState=null,this.privateNameStack=[]},F={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};T.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};F.inFunction.get=function(){return(this.currentVarScope().flags&Z)>0};F.inGenerator.get=function(){return(this.currentVarScope().flags<)>0&&!this.currentVarScope().inClassFieldInit};F.inAsync.get=function(){return(this.currentVarScope().flags&Be)>0&&!this.currentVarScope().inClassFieldInit};F.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&re)return!1;if(t.flags&Z)return(t.flags&Be)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};F.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&De)>0||i||this.options.allowSuperOutsideMethod};F.allowDirectSuper.get=function(){return(this.currentThisScope().flags&mt)>0};F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};F.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(Z|re))>0||i};F.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&re)>0};T.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var s=this,r=0;r=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,N.lastIndex=e,e+=N.exec(this.input)[0].length,this.input[e]===";"&&e++}};k.eat=function(e){return this.type===e?(this.next(),!0):!1};k.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc};k.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};k.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};k.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||L.test(this.input.slice(this.lastTokEnd,this.start))};k.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};k.semicolon=function(){!this.eat(a.semi)&&!this.insertSemicolon()&&this.unexpected()};k.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};k.expect=function(e){this.eat(e)||this.unexpected()};k.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var ye=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};k.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};k.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};k.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&s<56320)return!0;if(M(s,!0)){for(var r=i+1;H(s=this.input.charCodeAt(r),!0);)++r;if(s===92||s>55295&&s<56320)return!0;var n=this.input.slice(i,r);if(!Ti.test(n))return!0}return!1};l.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;N.lastIndex=this.pos;var e=N.exec(this.input),t=this.pos+e[0].length,i;return!L.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(H(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};l.parseStatement=function(e,t,i){var s=this.type,r=this.startNode(),n;switch(this.isLet(e)&&(s=a._var,n="let"),s){case a._break:case a._continue:return this.parseBreakContinueStatement(r,s.keyword);case a._debugger:return this.parseDebuggerStatement(r);case a._do:return this.parseDoStatement(r);case a._for:return this.parseForStatement(r);case a._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case a._class:return e&&this.unexpected(),this.parseClass(r,!0);case a._if:return this.parseIfStatement(r);case a._return:return this.parseReturnStatement(r);case a._switch:return this.parseSwitchStatement(r);case a._throw:return this.parseThrowStatement(r);case a._try:return this.parseTryStatement(r);case a._const:case a._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(r,n);case a._while:return this.parseWhileStatement(r);case a._with:return this.parseWithStatement(r);case a.braceL:return this.parseBlock(!0,r);case a.semi:return this.parseEmptyStatement(r);case a._export:case a._import:if(this.options.ecmaVersion>10&&s===a._import){N.lastIndex=this.pos;var o=N.exec(this.input),u=this.pos+o[0].length,p=this.input.charCodeAt(u);if(p===40||p===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===a._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var d=this.value,f=this.parseExpression();return s===a.name&&f.type==="Identifier"&&this.eat(a.colon)?this.parseLabeledStatement(r,d,f,e):this.parseExpressionStatement(r,f)}};l.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(a.semi)||this.insertSemicolon()?e.label=null:this.type!==a.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(a.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};l.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ue),this.enterScope(0),this.expect(a.parenL),this.type===a.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===a._var||this.type===a._const||i){var s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&s.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===a._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,s)):(t>-1&&this.unexpected(t),this.parseFor(e,s))}var n=this.isContextual("let"),o=!1,u=this.containsEsc,p=new ye,d=this.start,f=t>-1?this.parseExprSubscripts(p,"await"):this.parseExpression(!0,p);return this.type===a._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===a._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!u&&f.type==="Identifier"&&f.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),n&&o&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,p),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(p,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))};l.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,te|(i?0:Le),!1,t)};l.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};l.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(a.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};l.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(Ri),this.enterScope(0);for(var t,i=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var s=this.type===a._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(a.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};l.parseThrowStatement=function(e){return this.next(),L.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Oi=[];l.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?dt:0),this.checkLValPattern(e,t?yt:G),this.expect(a.parenR),e};l.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===a._catch){var t=this.startNode();this.next(),this.eat(a.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(a._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};l.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};l.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ue),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};l.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};l.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};l.parseLabeledStatement=function(e,t,i,s){for(var r=0,n=this.labels;r=0;p--){var d=this.labels[p];if(d.statementStart===e.start)d.statementStart=this.start,d.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};l.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};l.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(a.braceL),e&&this.enterScope(0);this.type!==a.braceR;){var s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};l.parseFor=function(e,t){return e.init=t,this.expect(a.semi),e.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),e.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};l.parseForIn=function(e,t){var i=this.type===a._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};l.parseVar=function(e,t,i,s){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(a.eq)?r.init=this.parseMaybeAssign(t):!s&&i==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&r.id.type!=="Identifier"&&!(t&&(this.type===a._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(a.comma))break}return e};l.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Me:G,!1)};var te=1,Le=2,vt=4;l.parseFunction=function(e,t,i,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===a.star&&t&Le&&this.unexpected(),e.generator=this.eat(a.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&te&&(e.id=t&vt&&this.type!==a.name?null:this.parseIdent(),e.id&&!(t&Le)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Me:G:xt));var n=this.yieldPos,o=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(je(e.async,e.generator)),t&te||(e.id=this.type===a.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,r),this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=u,this.finishNode(e,t&te?"FunctionDeclaration":"FunctionExpression")};l.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};l.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),r=this.startNode(),n=!1;for(r.body=[],this.expect(a.braceL);this.type!==a.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(r.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(n&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),n=!0):o.key&&o.key.type==="PrivateIdentifier"&&Bi(s,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};l.parseClassElement=function(e){if(this.eat(a.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,n=!1,o="method",u=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===a.star?u=!0:s="static"}if(i.static=u,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon()?n=!0:s="async"),!s&&(t>=9||!n)&&this.eat(a.star)&&(r=!0),!s&&!n&&!r){var p=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=p:s=p)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===a.parenL||o!=="method"||r||n){var d=!i.static&&fe(i,"constructor"),f=d&&e;d&&o!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=d?"constructor":o,this.parseClassMethod(i,r,n,f)}else this.parseClassField(i);return i};l.isClassElementNameStart=function(){return this.type===a.name||this.type===a.privateId||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword};l.parseClassElementName=function(e){this.type===a.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};l.parseClassMethod=function(e,t,i,s){var r=e.key;e.kind==="constructor"?(t&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):e.static&&fe(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,s);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};l.parseClassField=function(e){if(fe(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&fe(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(a.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};l.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(re|De);this.type!==a.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};l.parseClassId=function(e,t){this.type===a.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,G,!1)):(t===!0&&this.unexpected(),e.id=null)};l.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null};l.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};l.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,r=s===0?null:this.privateNameStack[s-1],n=0;n=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};l.parseExport=function(e,t){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,t);if(this.eat(a._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,s=e.specifiers;i=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};l.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportSpecifier")};l.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportDefaultSpecifier")};l.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportNamespaceSpecifier")};l.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===a.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma)))return e;if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(a.braceL);!this.eat(a.braceR);){if(t)t=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;e.push(this.parseImportSpecifier())}return e};l.parseWithClause=function(){var e=[];if(!this.eat(a._with))return e;this.expect(a.braceL);for(var t={},i=!0;!this.eat(a.braceR);){if(i)i=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;var s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;Y(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e};l.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};l.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);return Ii.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};l.adaptDirectivePrologue=function(e){for(var t=0;t=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var R=T.prototype;R.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,r=e.properties;s=8&&!u&&p.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(_.f_expr),this.parseFunction(this.startNodeAt(n,o),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(n,o),[p],!1,t);if(this.options.ecmaVersion>=8&&p.name==="async"&&this.type===a.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return p=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(a.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,o),[p],!0,t)}return p;case a.regexp:var d=this.value;return s=this.parseLiteral(d.value),s.regex={pattern:d.pattern,flags:d.flags},s;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return s=this.startNode(),s.value=this.type===a._null?null:this.type===a._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case a.parenL:var f=this.start,C=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(C)&&(e.parenthesizedAssign=f),e.parenthesizedBind<0&&(e.parenthesizedBind=f)),C;case a.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(a.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case a.braceL:return this.overrideContext(_.b_expr),this.parseObj(!1,e);case a._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case a._class:return this.parseClass(this.startNode(),!1);case a._new:return this.parseNew();case a.backQuote:return this.parseTemplate();case a._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};y.parseExprAtomDefault=function(){this.unexpected()};y.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===a.parenL&&!e)return this.parseDynamicImport(t);if(this.type===a.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};y.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(a.parenR)?e.options=null:(this.expect(a.comma),this.afterTrailingComma(a.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(a.parenR)||(this.expect(a.comma),this.afterTrailingComma(a.parenR)||this.unexpected())));else if(!this.eat(a.parenR)){var t=this.start;this.eat(a.comma)&&this.eat(a.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};y.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};y.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};y.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e};y.shouldParseArrow=function(e){return!this.canInsertSemicolon()};y.parseParenAndDistinguishExpression=function(e,t){var i=this.start,s=this.startLoc,r,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,u=this.startLoc,p=[],d=!0,f=!1,C=new ye,B=this.yieldPos,h=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==a.parenR;)if(d?d=!1:this.expect(a.comma),n&&this.afterTrailingComma(a.parenR,!0)){f=!0;break}else if(this.type===a.ellipsis){m=this.start,p.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else p.push(this.parseMaybeAssign(!1,C,this.parseParenItem));var x=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(p)&&this.eat(a.arrow))return this.checkPatternErrors(C,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=B,this.awaitPos=h,this.parseParenArrowList(i,s,p,t);(!p.length||f)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(C,!0),this.yieldPos=B||this.yieldPos,this.awaitPos=h||this.awaitPos,p.length>1?(r=this.startNodeAt(o,u),r.expressions=p,this.finishNodeAt(r,"SequenceExpression",x,g)):r=p[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(i,s);return w.expression=r,this.finishNode(w,"ParenthesizedExpression")}else return r};y.parseParenItem=function(e){return e};y.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var Di=[];y.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===a.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(a.parenL)?e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Di,this.finishNode(e,"NewExpression")};y.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===a.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,` +`),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` +`),cooked:this.value},this.next(),i.tail=this.type===a.backQuote,this.finishNode(i,"TemplateElement")};y.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.tail;)this.type===a.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(a.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(a.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};y.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===a.name||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===a.star)&&!L.test(this.input.slice(this.lastTokEnd,this.start))};y.parseObj=function(e,t){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(a.braceR);){if(s)s=!1;else if(this.expect(a.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(a.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,r,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};y.parseProperty=function(e,t){var i=this.startNode(),s,r,n,o;if(this.options.ecmaVersion>=9&&this.eat(a.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===a.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,o=this.startLoc),e||(s=this.eat(a.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(a.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,e,s,r,n,o,t,u),this.finishNode(i,"Property")};y.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};y.parsePropertyValue=function(e,t,i,s,r,n,o,u){(i||s)&&this.type===a.colon&&this.unexpected(),this.eat(a.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===a.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,s)):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==a.comma&&this.type!==a.braceR&&this.type!==a.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key)):this.type===a.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};y.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(a.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(a.bracketR),e.key;e.computed=!1}return e.key=this.type===a.num||this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};y.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};y.parseMethod=function(e,t,i){var s=this.startNode(),r=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(je(t,s.generator)|De|(i?mt:0)),this.expect(a.parenL),s.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(s,"FunctionExpression")};y.parseArrowExpression=function(e,t,i,s){var r=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(je(i,!1)|ft),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};y.parseFunctionBody=function(e,t,i,s){var r=t&&this.type!==a.braceL,n=this.strict,o=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||u)&&(o=this.strictDirective(this.end),o&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var p=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!n&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,gt),e.body=this.parseBlock(!1,void 0,o&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=p}this.exitScope()};y.isSimpleParamList=function(e){for(var t=0,i=e;t-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&r.flags&se&&delete this.undefinedExports[e]}else if(t===yt){var n=this.currentScope();n.lexical.push(e)}else if(t===xt){var o=this.currentScope();this.treatFunctionsAsVar?s=o.lexical.indexOf(e)>-1:s=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e)}else for(var u=this.scopeStack.length-1;u>=0;--u){var p=this.scopeStack[u];if(p.lexical.indexOf(e)>-1&&!(p.flags&dt&&p.lexical[0]===e)||!this.treatFunctionsAsVarInScope(p)&&p.functions.indexOf(e)>-1){s=!0;break}if(p.var.push(e),this.inModule&&p.flags&se&&delete this.undefinedExports[e],p.flags&Fe)break}s&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};W.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};W.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};W.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fe)return t}};W.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fe&&!(t.flags&ft))return t}};var ge=function(t,i,s){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new xe(t,s)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},ae=T.prototype;ae.startNode=function(){return new ge(this,this.start,this.startLoc)};ae.startNodeAt=function(e,t){return new ge(this,e,t)};function St(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}ae.finishNode=function(e,t){return St.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ae.finishNodeAt=function(e,t,i,s){return St.call(this,e,t,i,s)};ae.copyNode=function(e){var t=new ge(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var ji="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Ct="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",_t=Ct+" Extended_Pictographic",Tt=_t,kt=Tt+" EBase EComp EMod EPres ExtPict",Et=kt,Mi=Et,Ui={9:Ct,10:_t,11:Tt,12:kt,13:Et,14:Mi},qi="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Gi={9:"",10:"",11:"",12:"",13:"",14:qi},rt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",wt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",At=wt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Pt=At+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",It=Pt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Nt=It+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Ji=Nt+" "+ji,Ki={9:wt,10:At,11:Pt,12:It,13:Nt,14:Ji},Vt={};function Wi(e){var t=Vt[e]={binary:K(Ui[e]+" "+rt),binaryOfStrings:K(Gi[e]),nonBinary:{General_Category:K(rt),Script:K(Ki[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(ce=0,Ie=[9,10,11,12,13,14];ce=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Vt[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};j.prototype.reset=function(t,i,s){var r=s.indexOf("v")!==-1,n=s.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=s,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)};j.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};j.prototype.at=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return-1;var n=s.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=r)return n;var o=s.charCodeAt(t+1);return o>=56320&&o<=57343?(n<<10)+o-56613888:n};j.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return r;var n=s.charCodeAt(t),o;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=r||(o=s.charCodeAt(t+1))<56320||o>57343?t+1:t+2};j.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};j.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};j.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};j.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};j.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var s=this.pos,r=0,n=t;r-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(s=!0),o==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")};function Xi(e){for(var t in e)return!0;return!1}c.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Xi(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};c.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t=16;for(t&&(e.branchID=new me(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};c.regexp_alternative=function(e){for(;e.pos=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};c.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};c.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};c.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return r!==-1&&r=16){var i=this.regexp_eatModifiers(e),s=e.eat(45);if(i||s){for(var r=0;r-1&&e.raise("Duplicate regular expression modifiers")}if(s){var o=this.regexp_eatModifiers(e);!i&&!o&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var u=0;u-1||i.indexOf(p)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};c.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};c.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&zi(i);)t+=U(i),e.advance();return t};function zi(e){return e===105||e===109||e===115}c.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};c.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};c.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Lt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Lt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}c.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Lt(i);)e.advance();return e.pos!==t};c.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};c.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var s=0,r=i;s=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),Hi(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Hi(e){return M(e,!0)||e===36||e===95}c.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),Qi(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Qi(e){return H(e,!0)||e===36||e===95||e===8204||e===8205}c.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};c.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};c.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};c.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};c.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};c.regexp_eatZero=function(e){return e.current()===48&&!ve(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};c.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};c.regexp_eatControlLetter=function(e){var t=e.current();return Rt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Rt(e){return e>=65&&e<=90||e>=97&&e<=122}c.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(s&&r>=55296&&r<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(r-55296)*1024+(o-56320)+65536,!0}e.pos=n,e.lastIntValue=r}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Yi(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Yi(e){return e>=0&&e<=1114111}c.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};c.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ot=0,q=1,V=2;c.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Zi(t))return e.lastIntValue=-1,e.advance(),q;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var s;if(e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&s===V&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return Ot};function Zi(e){return e===100||e===68||e===115||e===83||e===119||e===87}c.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,s),q}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return Ot};c.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){Y(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};c.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return q;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return V;e.raise("Invalid property name")};c.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Bt(t=e.current());)e.lastStringValue+=U(t),e.advance();return e.lastStringValue!==""};function Bt(e){return Rt(e)||e===95}c.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";$i(t=e.current());)e.lastStringValue+=U(t),e.advance();return e.lastStringValue!==""};function $i(e){return Bt(e)||ve(e)}c.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};c.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===V&&e.raise("Negated character class may contain strings"),!0}return!1};c.regexp_classContents=function(e){return e.current()===93?q:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),q)};c.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};c.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||jt(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return s!==93?(e.lastIntValue=s,e.advance(),!0):!1};c.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};c.regexp_classSetExpression=function(e){var t=q,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===V&&(t=V);for(var s=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==V&&(t=q);continue}e.raise("Invalid character in character class")}if(s!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===V&&(t=V)}};c.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;return i!==-1&&s!==-1&&i>s&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};c.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?q:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};c.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return i&&s===V&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null};c.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null};c.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===V&&(t=V);return t};c.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?q:V};c.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&es(i)||ts(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function es(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function ts(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}c.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return is(t)?(e.lastIntValue=t,e.advance(),!0):!1};function is(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}c.regexp_eatClassControlLetter=function(e){var t=e.current();return ve(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};c.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};c.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ve(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function ve(e){return e>=48&&e<=57}c.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Dt(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ft(i),e.advance();return e.pos!==t};function Dt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ft(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}c.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};c.regexp_eatOctalDigit=function(e){var t=e.current();return jt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function jt(e){return e>=48&&e<=55}c.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s=this.input.length)return this.finishToken(a.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};v.readToken=function(e){return M(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};v.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};v.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,r=t;(s=ut(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};v.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&pt.test(String.fromCharCode(e)))++this.pos;else break e}}};v.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};v.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(a.ellipsis)):(++this.pos,this.finishToken(a.dot))};v.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(a.assign,2):this.finishOp(a.slash,1)};v.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,s=e===42?a.star:a.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,s=a.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(a.assign,i+1):this.finishOp(s,i)};v.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(a.assign,3)}return this.finishOp(e===124?a.logicalOR:a.logicalAND,2)}return t===61?this.finishOp(a.assign,2):this.finishOp(e===124?a.bitwiseOR:a.bitwiseAND,1)};v.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(a.assign,2):this.finishOp(a.bitwiseXOR,1)};v.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||L.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(a.incDec,2):t===61?this.finishOp(a.assign,2):this.finishOp(a.plusMin,1)};v.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(a.assign,i+1):this.finishOp(a.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(a.relational,i))};v.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(a.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(a.arrow)):this.finishOp(e===61?a.eq:a.prefix,1)};v.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(a.questionDot,2)}if(t===63){if(e>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(a.assign,3)}return this.finishOp(a.coalesce,2)}}return this.finishOp(a.question,1)};v.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),M(t,!0)||t===92))return this.finishToken(a.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+U(t)+"'")};v.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(a.parenL);case 41:return++this.pos,this.finishToken(a.parenR);case 59:return++this.pos,this.finishToken(a.semi);case 44:return++this.pos,this.finishToken(a.comma);case 91:return++this.pos,this.finishToken(a.bracketL);case 93:return++this.pos,this.finishToken(a.bracketR);case 123:return++this.pos,this.finishToken(a.braceL);case 125:return++this.pos,this.finishToken(a.braceR);case 58:return++this.pos,this.finishToken(a.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(a.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(a.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+U(e)+"'")};v.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};v.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(L.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(s==="[")t=!0;else if(s==="]"&&t)t=!1;else if(s==="/"&&!t)break;e=s==="\\"}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var n=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(n);var u=this.regexpState||(this.regexpState=new j(this));u.reset(i,r,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var p=null;try{p=new RegExp(r,o)}catch{}return this.finishToken(a.regexp,{pattern:r,flags:o,value:p})};v.readInt=function(e,t,i){for(var s=this.options.ecmaVersion>=12&&t===void 0,r=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,o=0,u=0,p=0,d=t??1/0;p=97?C=f-97+10:f>=65?C=f-65+10:f>=48&&f<=57?C=f-48:C=1/0,C>=e)break;u=f,o=o*e+C}return s&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:o};function ss(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Mt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}v.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Mt(this.input.slice(t,this.pos)),++this.pos):M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(a.num,i)};v.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){var r=Mt(this.input.slice(t,this.pos));return++this.pos,M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(a.num,r)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=ss(this.input.slice(t,this.pos),i);return this.finishToken(a.num,n)};v.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};v.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;s===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Q(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(a.string,t)};var Ut={};v.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Ut)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};v.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ut;this.raise(e,t)};v.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===a.template||this.type===a.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(a.dollarBraceL)):(++this.pos,this.finishToken(a.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(a.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Q(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=` +`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};v.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),(s!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return Q(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};v.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};v.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[i<0?t.length+i:i]:t.at(i)},X=ls;function fs(e){return Array.isArray(e)&&e.length>0}var Wt=fs;function O(e){var s,r,n;let t=((s=e.range)==null?void 0:s[0])??e.start,i=(n=((r=e.declaration)==null?void 0:r.decorators)??e.decorators)==null?void 0:n[0];return i?Math.min(O(i),t):t}function J(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function ds(e){let t=new Set(e);return i=>t.has(i==null?void 0:i.type)}var Xt=ds;var ms=Xt(["Block","CommentBlock","MultiLine"]),oe=ms;function xs(e){let t=`*${e.value}*`.split(` +`);return t.length>1&&t.every(i=>i.trimStart()[0]==="*")}var Ke=xs;function ys(e){return oe(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(e.value)}var zt=ys;var ue=null;function pe(e){if(ue!==null&&typeof ue.property){let t=ue;return ue=pe.prototype=null,t}return ue=pe.prototype=e??Object.create(null),new pe}var gs=10;for(let e=0;e<=gs;e++)pe();function We(e){return pe(e)}function vs(e,t="type"){We(e);function i(s){let r=s[t],n=e[r];if(!Array.isArray(n))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:s});return n}return i}var Ht=vs;var Qt={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var bs=Ht(Qt),Yt=bs;function Xe(e,t){if(!(e!==null&&typeof e=="object"))return e;if(Array.isArray(e)){for(let s=0;s{var o;(o=n.leadingComments)!=null&&o.some(zt)&&r.add(O(n))}),e=Ce(e,n=>{if(n.type==="ParenthesizedExpression"){let{expression:o}=n;if(o.type==="TypeCastExpression")return o.range=[...n.range],o;let u=O(n);if(!r.has(u))return o.extra={...o.extra,parenthesized:!0},o}})}if(e=Ce(e,r=>{switch(r.type){case"LogicalExpression":if(Zt(r))return ze(r);break;case"VariableDeclaration":{let n=X(!1,r.declarations,-1);n!=null&&n.init&&s[J(n)]!==";"&&(r.range=[O(r),J(n)]);break}case"TSParenthesizedType":return r.typeAnnotation;case"TSTypeParameter":if(typeof r.name=="string"){let n=O(r);r.name={type:"Identifier",name:r.name,range:[n,n+r.name.length]}}break;case"TopicReference":e.extra={...e.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(r.types.length===1)return r.types[0];break}}),Wt(e.comments)){let r=X(!1,e.comments,-1);for(let n=e.comments.length-2;n>=0;n--){let o=e.comments[n];J(o)===O(r)&&oe(o)&&oe(r)&&Ke(o)&&Ke(r)&&(e.comments.splice(n+1,1),o.value+="*//*"+r.value,o.range=[O(o),J(r)]),r=o}}return e.type==="Program"&&(e.range=[0,s.length]),e}function Zt(e){return e.type==="LogicalExpression"&&e.right.type==="LogicalExpression"&&e.operator===e.right.operator}function ze(e){return Zt(e)?ze({type:"LogicalExpression",operator:e.operator,left:ze({type:"LogicalExpression",operator:e.operator,left:e.left,right:e.right.left,range:[O(e.left),J(e.right.left)]}),right:e.right.right,range:[O(e),J(e)]}):e}var _e=Ss;var Cs=(e,t,i,s)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(i,s):i.global?t.replace(i,s):t.split(i).join(s)},ee=Cs;var _s=/\*\/$/,Ts=/^\/\*\*?/,ks=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Es=/(^|\s+)\/\/([^\n\r]*)/g,$t=/^(\r?\n)+/,ws=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ei=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,As=/(\r?\n|^) *\* ?/g,Ps=[];function ti(e){let t=e.match(ks);return t?t[0].trimStart():""}function ii(e){let t=` +`;e=ee(!1,e.replace(Ts,"").replace(_s,""),As,"$1");let i="";for(;i!==e;)i=e,e=ee(!1,e,ws,`${t}$1 $2${t}`);e=e.replace($t,"").trimEnd();let s=Object.create(null),r=ee(!1,e,ei,"").replace($t,"").trimEnd(),n;for(;n=ei.exec(e);){let o=ee(!1,n[2],Es,"");if(typeof s[n[1]]=="string"||Array.isArray(s[n[1]])){let u=s[n[1]];s[n[1]]=[...Ps,...Array.isArray(u)?u:[u],o]}else s[n[1]]=o}return{comments:r,pragmas:s}}function Is(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` +`);return t===-1?e:e.slice(0,t)}var si=Is;function Ns(e){let t=si(e);t&&(e=e.slice(t.length+1));let i=ti(e),{pragmas:s,comments:r}=ii(i);return{shebang:t,text:e,pragmas:s,comments:r}}function ri(e){let{pragmas:t}=Ns(e);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function Vs(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:ri,locStart:O,locEnd:J,...e}}var Te=Vs;function Ls(e){let{filepath:t}=e;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs")||t.endsWith(".cts"))return"script";if(t.endsWith(".mjs")||t.endsWith(".mts"))return"module"}}var ke=Ls;var Rs={ecmaVersion:"latest",allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,locations:!0,ranges:!0};function Os(e){let{message:t,loc:i}=e;if(!i)return e;let{line:s,column:r}=i;return be(t.replace(/ \(\d+:\d+\)$/u,""),{loc:{start:{line:s,column:r+1}},cause:e})}var ai,Bs=()=>(ai??(ai=T.extend((0,ni.default)())),ai);function Ds(e,t){let i=Bs(),s=[],r=[],n=i.parse(e,{...Rs,sourceType:t,allowImportExportEverywhere:t==="module",onComment:s,onToken:r});return n.comments=s,n.tokens=r,n}function Fs(e,t={}){let i=ke(t),s=(i?[i]:["module","script"]).map(n=>()=>Ds(e,n)),r;try{r=Se(s)}catch({errors:[n]}){throw Os(n)}return _e(r,{text:e})}var oi=Te(Fs);var ci=et(Je(),1);var E={Boolean:"Boolean",EOF:"",Identifier:"Identifier",PrivateIdentifier:"PrivateIdentifier",Keyword:"Keyword",Null:"Null",Numeric:"Numeric",Punctuator:"Punctuator",String:"String",RegularExpression:"RegularExpression",Template:"Template",JSXIdentifier:"JSXIdentifier",JSXText:"JSXText"};function js(e,t){let i=e[0],s=X(!1,e,-1),r={type:E.Template,value:t.slice(i.start,s.end)};return i.loc&&(r.loc={start:i.loc.start,end:s.loc.end}),i.range&&(r.start=i.range[0],r.end=s.range[1],r.range=[r.start,r.end]),r}function He(e,t){this._acornTokTypes=e,this._tokens=[],this._curlyBrace=null,this._code=t}He.prototype={constructor:He,translate(e,t){let i=e.type,s=this._acornTokTypes;if(i===s.name)e.type=E.Identifier,e.value==="static"&&(e.type=E.Keyword),t.ecmaVersion>5&&(e.value==="yield"||e.value==="let")&&(e.type=E.Keyword);else if(i===s.privateId)e.type=E.PrivateIdentifier;else if(i===s.semi||i===s.comma||i===s.parenL||i===s.parenR||i===s.braceL||i===s.braceR||i===s.dot||i===s.bracketL||i===s.colon||i===s.question||i===s.bracketR||i===s.ellipsis||i===s.arrow||i===s.jsxTagStart||i===s.incDec||i===s.starstar||i===s.jsxTagEnd||i===s.prefix||i===s.questionDot||i.binop&&!i.keyword||i.isAssign)e.type=E.Punctuator,e.value=this._code.slice(e.start,e.end);else if(i===s.jsxName)e.type=E.JSXIdentifier;else if(i.label==="jsxText"||i===s.jsxAttrValueToken)e.type=E.JSXText;else if(i.keyword)i.keyword==="true"||i.keyword==="false"?e.type=E.Boolean:i.keyword==="null"?e.type=E.Null:e.type=E.Keyword;else if(i===s.num)e.type=E.Numeric,e.value=this._code.slice(e.start,e.end);else if(i===s.string)t.jsxAttrValueToken?(t.jsxAttrValueToken=!1,e.type=E.JSXText):e.type=E.String,e.value=this._code.slice(e.start,e.end);else if(i===s.regexp){e.type=E.RegularExpression;let r=e.value;e.regex={flags:r.flags,pattern:r.pattern},e.value=`/${r.pattern}/${r.flags}`}return e},onToken(e,t){let i=this._acornTokTypes,s=t.tokens,r=this._tokens,n=()=>{s.push(js(this._tokens,this._code)),this._tokens=[]};if(e.type===i.eof){this._curlyBrace&&s.push(this.translate(this._curlyBrace,t));return}if(e.type===i.backQuote){this._curlyBrace&&(s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=null),r.push(e),r.length>1&&n();return}if(e.type===i.dollarBraceL){r.push(e),n();return}if(e.type===i.braceR){this._curlyBrace&&s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=e;return}if(e.type===i.template||e.type===i.invalidTemplate){this._curlyBrace&&(r.push(this._curlyBrace),this._curlyBrace=null),r.push(e);return}this._curlyBrace&&(s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=null),s.push(this.translate(e,t))}};var ui=He;var pi=[3,5,6,7,8,9,10,11,12,13,14,15,16];function Ms(){return X(!1,pi,-1)}function Us(e=5){let t=e==="latest"?Ms():e;if(typeof t!="number")throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof e} instead.`);if(t>=2015&&(t-=2009),!pi.includes(t))throw new Error("Invalid ecmaVersion.");return t}function qs(e="script"){if(e==="script"||e==="module")return e;if(e==="commonjs")return"script";throw new Error("Invalid sourceType.")}function hi(e){let t=Us(e.ecmaVersion),i=qs(e.sourceType),s=e.range===!0,r=e.loc===!0;if(t!==3&&e.allowReserved)throw new Error("`allowReserved` is only supported when ecmaVersion is 3");if(typeof e.allowReserved<"u"&&typeof e.allowReserved!="boolean")throw new Error("`allowReserved`, when present, must be `true` or `false`");let n=t===3?e.allowReserved||"never":!1,o=e.ecmaFeatures||{},u=e.sourceType==="commonjs"||!!o.globalReturn;if(i==="module"&&t<6)throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");return Object.assign({},e,{ecmaVersion:t,sourceType:i,ranges:s,locations:r,allowReserved:n,allowReturnOutsideFunction:u})}var z=Symbol("espree's internal state"),Qe=Symbol("espree's esprimaFinishNode");function Gs(e,t,i,s,r,n,o){let u;e?u="Block":o.slice(i,i+2)==="#!"?u="Hashbang":u="Line";let p={type:u,value:t};return typeof i=="number"&&(p.start=i,p.end=s,p.range=[i,s]),typeof r=="object"&&(p.loc={start:r,end:n}),p}var Ye=()=>e=>{let t=Object.assign({},e.acorn.tokTypes);return e.acornJsx&&Object.assign(t,e.acornJsx.tokTypes),class extends e{constructor(s,r){(typeof s!="object"||s===null)&&(s={}),typeof r!="string"&&!(r instanceof String)&&(r=String(r));let n=s.sourceType,o=hi(s),u=o.ecmaFeatures||{},p=o.tokens===!0?new ui(t,r):null,d={originalSourceType:n||o.sourceType,tokens:p?[]:null,comments:o.comment===!0?[]:null,impliedStrict:u.impliedStrict===!0&&o.ecmaVersion>=5,ecmaVersion:o.ecmaVersion,jsxAttrValueToken:!1,lastToken:null,templateElements:[]};super({ecmaVersion:o.ecmaVersion,sourceType:o.sourceType,ranges:o.ranges,locations:o.locations,allowReserved:o.allowReserved,allowReturnOutsideFunction:o.allowReturnOutsideFunction,onToken(f){p&&p.onToken(f,d),f.type!==t.eof&&(d.lastToken=f)},onComment(f,C,B,h,m,x){if(d.comments){let g=Gs(f,C,B,h,m,x,r);d.comments.push(g)}}},r),this[z]=d}tokenize(){do this.next();while(this.type!==t.eof);this.next();let s=this[z],r=s.tokens;return s.comments&&(r.comments=s.comments),r}finishNode(...s){let r=super.finishNode(...s);return this[Qe](r)}finishNodeAt(...s){let r=super.finishNodeAt(...s);return this[Qe](r)}parse(){let s=this[z],r=super.parse();if(r.sourceType=s.originalSourceType,s.comments&&(r.comments=s.comments),s.tokens&&(r.tokens=s.tokens),r.body.length){let[n]=r.body;r.range&&(r.range[0]=n.range[0]),r.loc&&(r.loc.start=n.loc.start),r.start=n.start}return s.lastToken&&(r.range&&(r.range[1]=s.lastToken.range[1]),r.loc&&(r.loc.end=s.lastToken.loc.end),r.end=s.lastToken.end),this[z].templateElements.forEach(n=>{let u=n.tail?1:2;n.start+=-1,n.end+=u,n.range&&(n.range[0]+=-1,n.range[1]+=u),n.loc&&(n.loc.start.column+=-1,n.loc.end.column+=u)}),r}parseTopLevel(s){return this[z].impliedStrict&&(this.strict=!0),super.parseTopLevel(s)}raise(s,r){let n=e.acorn.getLineInfo(this.input,s),o=new SyntaxError(r);throw o.index=s,o.lineNumber=n.line,o.column=n.column+1,o}raiseRecoverable(s,r){this.raise(s,r)}unexpected(s){let r="Unexpected token";if(s!=null){if(this.pos=s,this.options.locations)for(;this.posthis.start&&(r+=` ${this.input.slice(this.start,this.end)}`),this.raise(this.start,r)}jsx_readString(s){let r=super.jsx_readString(s);return this.type===t.string&&(this[z].jsxAttrValueToken=!0),r}[Qe](s){return s.type==="TemplateElement"&&this[z].templateElements.push(s),s.type.includes("Function")&&!s.generator&&(s.generator=!1),s}}};var Js={_regular:null,_jsx:null,get regular(){return this._regular===null&&(this._regular=T.extend(Ye())),this._regular},get jsx(){return this._jsx===null&&(this._jsx=T.extend((0,ci.default)(),Ye())),this._jsx},get(e){return!!(e&&e.ecmaFeatures&&e.ecmaFeatures.jsx)?this.jsx:this.regular}};function li(e,t){let i=Js.get(t);return new i(t,e).parse()}var Ks={ecmaVersion:"latest",range:!0,loc:!0,comment:!0,tokens:!0,sourceType:"module",ecmaFeatures:{jsx:!0,globalReturn:!0,impliedStrict:!1}};function Ws(e){let{message:t,lineNumber:i,column:s}=e;return typeof i!="number"?e:be(t,{loc:{start:{line:i,column:s}},cause:e})}function Xs(e,t={}){let i=ke(t),s=(i?[i]:["module","script"]).map(n=>()=>li(e,{...Ks,sourceType:n})),r;try{r=Se(s)}catch({errors:[n]}){throw Ws(n)}return _e(r,{text:e})}var fi=Te(Xs);var zs={acorn:oi,espree:fi};var Ca=Ze;export{Ca as default,zs as parsers}; diff --git a/node_modules/prettier/plugins/angular.js b/node_modules/prettier/plugins/angular.js new file mode 100644 index 0000000..afc2259 --- /dev/null +++ b/node_modules/prettier/plugins/angular.js @@ -0,0 +1,2 @@ +(function(n){function e(){var i=n();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.angular=e()}})(function(){"use strict";var it=Object.defineProperty;var $s=Object.getOwnPropertyDescriptor;var Rs=Object.getOwnPropertyNames;var Bs=Object.prototype.hasOwnProperty;var Xt=t=>{throw TypeError(t)};var Jt=(t,e)=>{for(var n in e)it(t,n,{get:e[n],enumerable:!0})},Ds=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Rs(e))!Bs.call(t,r)&&r!==n&&it(t,r,{get:()=>e[r],enumerable:!(s=$s(e,r))||s.enumerable});return t};var Os=t=>Ds(it({},"__esModule",{value:!0}),t);var ot=(t,e,n)=>e.has(t)||Xt("Cannot "+n);var L=(t,e,n)=>(ot(t,e,"read from private field"),n?n.call(t):e.get(t)),V=(t,e,n)=>e.has(t)?Xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),K=(t,e,n,s)=>(ot(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),c=(t,e,n)=>(ot(t,e,"access private method"),n);var Yr={};Jt(Yr,{parsers:()=>zt});var zt={};Jt(zt,{__ng_action:()=>zr,__ng_binding:()=>Gr,__ng_directive:()=>Jr,__ng_interpolation:()=>Xr});var Kr=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var Yt;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom"})(Yt||(Yt={}));var Qt;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default"})(Qt||(Qt={}));var Kt;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(Kt||(Kt={}));var B;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL"})(B||(B={}));var Zt;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(Zt||(Zt={}));var en;(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(en||(en={}));var tn;(function(t){t[t.None=0]="None",t[t.Const=1]="Const"})(tn||(tn={}));var nn;(function(t){t[t.Dynamic=0]="Dynamic",t[t.Bool=1]="Bool",t[t.String=2]="String",t[t.Int=3]="Int",t[t.Number=4]="Number",t[t.Function=5]="Function",t[t.Inferred=6]="Inferred",t[t.None=7]="None"})(nn||(nn={}));var Fs=void 0;var sn;(function(t){t[t.Minus=0]="Minus",t[t.Plus=1]="Plus"})(sn||(sn={}));var _;(function(t){t[t.Equals=0]="Equals",t[t.NotEquals=1]="NotEquals",t[t.Identical=2]="Identical",t[t.NotIdentical=3]="NotIdentical",t[t.Minus=4]="Minus",t[t.Plus=5]="Plus",t[t.Divide=6]="Divide",t[t.Multiply=7]="Multiply",t[t.Modulo=8]="Modulo",t[t.And=9]="And",t[t.Or=10]="Or",t[t.BitwiseOr=11]="BitwiseOr",t[t.BitwiseAnd=12]="BitwiseAnd",t[t.Lower=13]="Lower",t[t.LowerEquals=14]="LowerEquals",t[t.Bigger=15]="Bigger",t[t.BiggerEquals=16]="BiggerEquals",t[t.NullishCoalesce=17]="NullishCoalesce"})(_||(_={}));function Vs(t,e){return t==null||e==null?t==e:t.isEquivalent(e)}function Hs(t,e,n){let s=t.length;if(s!==e.length)return!1;for(let r=0;rn.isEquivalent(s))}var k=class{type;sourceSpan;constructor(e,n){this.type=e||null,this.sourceSpan=n||null}prop(e,n){return new vt(this,e,null,n)}key(e,n,s){return new wt(this,e,n,s)}callFn(e,n,s){return new Xe(this,e,null,n,s)}instantiate(e,n,s){return new dt(this,e,n,s)}conditional(e,n=null,s){return new gt(this,e,n,null,s)}equals(e,n){return new C(_.Equals,this,e,null,n)}notEquals(e,n){return new C(_.NotEquals,this,e,null,n)}identical(e,n){return new C(_.Identical,this,e,null,n)}notIdentical(e,n){return new C(_.NotIdentical,this,e,null,n)}minus(e,n){return new C(_.Minus,this,e,null,n)}plus(e,n){return new C(_.Plus,this,e,null,n)}divide(e,n){return new C(_.Divide,this,e,null,n)}multiply(e,n){return new C(_.Multiply,this,e,null,n)}modulo(e,n){return new C(_.Modulo,this,e,null,n)}and(e,n){return new C(_.And,this,e,null,n)}bitwiseOr(e,n,s=!0){return new C(_.BitwiseOr,this,e,null,n,s)}bitwiseAnd(e,n,s=!0){return new C(_.BitwiseAnd,this,e,null,n,s)}or(e,n){return new C(_.Or,this,e,null,n)}lower(e,n){return new C(_.Lower,this,e,null,n)}lowerEquals(e,n){return new C(_.LowerEquals,this,e,null,n)}bigger(e,n){return new C(_.Bigger,this,e,null,n)}biggerEquals(e,n){return new C(_.BiggerEquals,this,e,null,n)}isBlank(e){return this.equals(TYPED_NULL_EXPR,e)}nullishCoalesce(e,n){return new C(_.NullishCoalesce,this,e,null,n)}toStmt(){return new St(this,null)}},Ge=class t extends k{name;constructor(e,n,s){super(n,s),this.name=e}isEquivalent(e){return e instanceof t&&this.name===e.name}isConstant(){return!1}visitExpression(e,n){return e.visitReadVarExpr(this,n)}clone(){return new t(this.name,this.type,this.sourceSpan)}set(e){return new pt(this.name,e,null,this.sourceSpan)}},ut=class t extends k{expr;constructor(e,n,s){super(n,s),this.expr=e}visitExpression(e,n){return e.visitTypeofExpr(this,n)}isEquivalent(e){return e instanceof t&&e.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new t(this.expr.clone())}};var pt=class t extends k{name;value;constructor(e,n,s,r){super(s||n.type,r),this.name=e,this.value=n}isEquivalent(e){return e instanceof t&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,n){return e.visitWriteVarExpr(this,n)}clone(){return new t(this.name,this.value.clone(),this.type,this.sourceSpan)}toDeclStmt(e,n){return new xt(this.name,this.value,e,n,this.sourceSpan)}toConstDecl(){return this.toDeclStmt(Fs,Ee.Final)}},ht=class t extends k{receiver;index;value;constructor(e,n,s,r,o){super(r||s.type,o),this.receiver=e,this.index=n,this.value=s}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,n){return e.visitWriteKeyExpr(this,n)}clone(){return new t(this.receiver.clone(),this.index.clone(),this.value.clone(),this.type,this.sourceSpan)}},ft=class t extends k{receiver;name;value;constructor(e,n,s,r,o){super(r||s.type,o),this.receiver=e,this.name=n,this.value=s}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,n){return e.visitWritePropExpr(this,n)}clone(){return new t(this.receiver.clone(),this.name,this.value.clone(),this.type,this.sourceSpan)}},Xe=class t extends k{fn;args;pure;constructor(e,n,s,r,o=!1){super(s,r),this.fn=e,this.args=n,this.pure=o}get receiver(){return this.fn}isEquivalent(e){return e instanceof t&&this.fn.isEquivalent(e.fn)&&tt(this.args,e.args)&&this.pure===e.pure}isConstant(){return!1}visitExpression(e,n){return e.visitInvokeFunctionExpr(this,n)}clone(){return new t(this.fn.clone(),this.args.map(e=>e.clone()),this.type,this.sourceSpan,this.pure)}};var dt=class t extends k{classExpr;args;constructor(e,n,s,r){super(s,r),this.classExpr=e,this.args=n}isEquivalent(e){return e instanceof t&&this.classExpr.isEquivalent(e.classExpr)&&tt(this.args,e.args)}isConstant(){return!1}visitExpression(e,n){return e.visitInstantiateExpr(this,n)}clone(){return new t(this.classExpr.clone(),this.args.map(e=>e.clone()),this.type,this.sourceSpan)}},Je=class t extends k{value;constructor(e,n,s){super(n,s),this.value=e}isEquivalent(e){return e instanceof t&&this.value===e.value}isConstant(){return!0}visitExpression(e,n){return e.visitLiteralExpr(this,n)}clone(){return new t(this.value,this.type,this.sourceSpan)}};var mt=class t extends k{value;typeParams;constructor(e,n,s=null,r){super(n,r),this.value=e,this.typeParams=s}isEquivalent(e){return e instanceof t&&this.value.name===e.value.name&&this.value.moduleName===e.value.moduleName}isConstant(){return!1}visitExpression(e,n){return e.visitExternalExpr(this,n)}clone(){return new t(this.value,this.type,this.typeParams,this.sourceSpan)}};var gt=class t extends k{condition;falseCase;trueCase;constructor(e,n,s=null,r,o){super(r||n.type,o),this.condition=e,this.falseCase=s,this.trueCase=n}isEquivalent(e){return e instanceof t&&this.condition.isEquivalent(e.condition)&&this.trueCase.isEquivalent(e.trueCase)&&Vs(this.falseCase,e.falseCase)}isConstant(){return!1}visitExpression(e,n){return e.visitConditionalExpr(this,n)}clone(){var e;return new t(this.condition.clone(),this.trueCase.clone(),(e=this.falseCase)==null?void 0:e.clone(),this.type,this.sourceSpan)}};var C=class t extends k{operator;rhs;parens;lhs;constructor(e,n,s,r,o,a=!0){super(r||n.type,o),this.operator=e,this.rhs=s,this.parens=a,this.lhs=n}isEquivalent(e){return e instanceof t&&this.operator===e.operator&&this.lhs.isEquivalent(e.lhs)&&this.rhs.isEquivalent(e.rhs)}isConstant(){return!1}visitExpression(e,n){return e.visitBinaryOperatorExpr(this,n)}clone(){return new t(this.operator,this.lhs.clone(),this.rhs.clone(),this.type,this.sourceSpan,this.parens)}},vt=class t extends k{receiver;name;constructor(e,n,s,r){super(s,r),this.receiver=e,this.name=n}get index(){return this.name}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name}isConstant(){return!1}visitExpression(e,n){return e.visitReadPropExpr(this,n)}set(e){return new ft(this.receiver,this.name,e,null,this.sourceSpan)}clone(){return new t(this.receiver.clone(),this.name,this.type,this.sourceSpan)}},wt=class t extends k{receiver;index;constructor(e,n,s,r){super(s,r),this.receiver=e,this.index=n}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)}isConstant(){return!1}visitExpression(e,n){return e.visitReadKeyExpr(this,n)}set(e){return new ht(this.receiver,this.index,e,null,this.sourceSpan)}clone(){return new t(this.receiver.clone(),this.index.clone(),this.type,this.sourceSpan)}},Ye=class t extends k{entries;constructor(e,n,s){super(n,s),this.entries=e}isConstant(){return this.entries.every(e=>e.isConstant())}isEquivalent(e){return e instanceof t&&tt(this.entries,e.entries)}visitExpression(e,n){return e.visitLiteralArrayExpr(this,n)}clone(){return new t(this.entries.map(e=>e.clone()),this.type,this.sourceSpan)}};var Qe=class t extends k{entries;valueType=null;constructor(e,n,s){super(n,s),this.entries=e,n&&(this.valueType=n.valueType)}isEquivalent(e){return e instanceof t&&tt(this.entries,e.entries)}isConstant(){return this.entries.every(e=>e.value.isConstant())}visitExpression(e,n){return e.visitLiteralMapExpr(this,n)}clone(){let e=this.entries.map(n=>n.clone());return new t(e,this.type,this.sourceSpan)}};var Ee;(function(t){t[t.None=0]="None",t[t.Final=1]="Final",t[t.Private=2]="Private",t[t.Exported=4]="Exported",t[t.Static=8]="Static"})(Ee||(Ee={}));var Ke=class{modifiers;sourceSpan;leadingComments;constructor(e=Ee.None,n=null,s){this.modifiers=e,this.sourceSpan=n,this.leadingComments=s}hasModifier(e){return(this.modifiers&e)!==0}addLeadingComment(e){this.leadingComments=this.leadingComments??[],this.leadingComments.push(e)}},xt=class t extends Ke{name;value;type;constructor(e,n,s,r,o,a){super(r,o,a),this.name=e,this.value=n,this.type=s||n&&n.type||null}isEquivalent(e){return e instanceof t&&this.name===e.name&&(this.value?!!e.value&&this.value.isEquivalent(e.value):!e.value)}visitStatement(e,n){return e.visitDeclareVarStmt(this,n)}};var St=class t extends Ke{expr;constructor(e,n,s){super(Ee.None,n,s),this.expr=e}isEquivalent(e){return e instanceof t&&this.expr.isEquivalent(e.expr)}visitStatement(e,n){return e.visitExpressionStmt(this,n)}};function Us(t,e,n){return new Ge(t,e,n)}var Zr=Us("");var rn=class t{static INSTANCE=new t;keyOf(e){if(e instanceof Je&&typeof e.value=="string")return`"${e.value}"`;if(e instanceof Je)return String(e.value);if(e instanceof Ye){let n=[];for(let s of e.entries)n.push(this.keyOf(s));return`[${n.join(",")}]`}else if(e instanceof Qe){let n=[];for(let s of e.entries){let r=s.key;s.quoted&&(r=`"${r}"`),n.push(r+":"+this.keyOf(s.value))}return`{${n.join(",")}}`}else{if(e instanceof mt)return`import("${e.value.moduleName}", ${e.value.name})`;if(e instanceof Ge)return`read(${e.name})`;if(e instanceof ut)return`typeof(${this.keyOf(e.expr)})`;throw new Error(`${this.constructor.name} does not handle expressions of type ${e.constructor.name}`)}}};var i="@angular/core",P=class{static NEW_METHOD="factory";static TRANSFORM_METHOD="transform";static PATCH_DEPS="patchedDeps";static core={name:null,moduleName:i};static namespaceHTML={name:"\u0275\u0275namespaceHTML",moduleName:i};static namespaceMathML={name:"\u0275\u0275namespaceMathML",moduleName:i};static namespaceSVG={name:"\u0275\u0275namespaceSVG",moduleName:i};static element={name:"\u0275\u0275element",moduleName:i};static elementStart={name:"\u0275\u0275elementStart",moduleName:i};static elementEnd={name:"\u0275\u0275elementEnd",moduleName:i};static advance={name:"\u0275\u0275advance",moduleName:i};static syntheticHostProperty={name:"\u0275\u0275syntheticHostProperty",moduleName:i};static syntheticHostListener={name:"\u0275\u0275syntheticHostListener",moduleName:i};static attribute={name:"\u0275\u0275attribute",moduleName:i};static attributeInterpolate1={name:"\u0275\u0275attributeInterpolate1",moduleName:i};static attributeInterpolate2={name:"\u0275\u0275attributeInterpolate2",moduleName:i};static attributeInterpolate3={name:"\u0275\u0275attributeInterpolate3",moduleName:i};static attributeInterpolate4={name:"\u0275\u0275attributeInterpolate4",moduleName:i};static attributeInterpolate5={name:"\u0275\u0275attributeInterpolate5",moduleName:i};static attributeInterpolate6={name:"\u0275\u0275attributeInterpolate6",moduleName:i};static attributeInterpolate7={name:"\u0275\u0275attributeInterpolate7",moduleName:i};static attributeInterpolate8={name:"\u0275\u0275attributeInterpolate8",moduleName:i};static attributeInterpolateV={name:"\u0275\u0275attributeInterpolateV",moduleName:i};static classProp={name:"\u0275\u0275classProp",moduleName:i};static elementContainerStart={name:"\u0275\u0275elementContainerStart",moduleName:i};static elementContainerEnd={name:"\u0275\u0275elementContainerEnd",moduleName:i};static elementContainer={name:"\u0275\u0275elementContainer",moduleName:i};static styleMap={name:"\u0275\u0275styleMap",moduleName:i};static styleMapInterpolate1={name:"\u0275\u0275styleMapInterpolate1",moduleName:i};static styleMapInterpolate2={name:"\u0275\u0275styleMapInterpolate2",moduleName:i};static styleMapInterpolate3={name:"\u0275\u0275styleMapInterpolate3",moduleName:i};static styleMapInterpolate4={name:"\u0275\u0275styleMapInterpolate4",moduleName:i};static styleMapInterpolate5={name:"\u0275\u0275styleMapInterpolate5",moduleName:i};static styleMapInterpolate6={name:"\u0275\u0275styleMapInterpolate6",moduleName:i};static styleMapInterpolate7={name:"\u0275\u0275styleMapInterpolate7",moduleName:i};static styleMapInterpolate8={name:"\u0275\u0275styleMapInterpolate8",moduleName:i};static styleMapInterpolateV={name:"\u0275\u0275styleMapInterpolateV",moduleName:i};static classMap={name:"\u0275\u0275classMap",moduleName:i};static classMapInterpolate1={name:"\u0275\u0275classMapInterpolate1",moduleName:i};static classMapInterpolate2={name:"\u0275\u0275classMapInterpolate2",moduleName:i};static classMapInterpolate3={name:"\u0275\u0275classMapInterpolate3",moduleName:i};static classMapInterpolate4={name:"\u0275\u0275classMapInterpolate4",moduleName:i};static classMapInterpolate5={name:"\u0275\u0275classMapInterpolate5",moduleName:i};static classMapInterpolate6={name:"\u0275\u0275classMapInterpolate6",moduleName:i};static classMapInterpolate7={name:"\u0275\u0275classMapInterpolate7",moduleName:i};static classMapInterpolate8={name:"\u0275\u0275classMapInterpolate8",moduleName:i};static classMapInterpolateV={name:"\u0275\u0275classMapInterpolateV",moduleName:i};static styleProp={name:"\u0275\u0275styleProp",moduleName:i};static stylePropInterpolate1={name:"\u0275\u0275stylePropInterpolate1",moduleName:i};static stylePropInterpolate2={name:"\u0275\u0275stylePropInterpolate2",moduleName:i};static stylePropInterpolate3={name:"\u0275\u0275stylePropInterpolate3",moduleName:i};static stylePropInterpolate4={name:"\u0275\u0275stylePropInterpolate4",moduleName:i};static stylePropInterpolate5={name:"\u0275\u0275stylePropInterpolate5",moduleName:i};static stylePropInterpolate6={name:"\u0275\u0275stylePropInterpolate6",moduleName:i};static stylePropInterpolate7={name:"\u0275\u0275stylePropInterpolate7",moduleName:i};static stylePropInterpolate8={name:"\u0275\u0275stylePropInterpolate8",moduleName:i};static stylePropInterpolateV={name:"\u0275\u0275stylePropInterpolateV",moduleName:i};static nextContext={name:"\u0275\u0275nextContext",moduleName:i};static resetView={name:"\u0275\u0275resetView",moduleName:i};static templateCreate={name:"\u0275\u0275template",moduleName:i};static defer={name:"\u0275\u0275defer",moduleName:i};static deferWhen={name:"\u0275\u0275deferWhen",moduleName:i};static deferOnIdle={name:"\u0275\u0275deferOnIdle",moduleName:i};static deferOnImmediate={name:"\u0275\u0275deferOnImmediate",moduleName:i};static deferOnTimer={name:"\u0275\u0275deferOnTimer",moduleName:i};static deferOnHover={name:"\u0275\u0275deferOnHover",moduleName:i};static deferOnInteraction={name:"\u0275\u0275deferOnInteraction",moduleName:i};static deferOnViewport={name:"\u0275\u0275deferOnViewport",moduleName:i};static deferPrefetchWhen={name:"\u0275\u0275deferPrefetchWhen",moduleName:i};static deferPrefetchOnIdle={name:"\u0275\u0275deferPrefetchOnIdle",moduleName:i};static deferPrefetchOnImmediate={name:"\u0275\u0275deferPrefetchOnImmediate",moduleName:i};static deferPrefetchOnTimer={name:"\u0275\u0275deferPrefetchOnTimer",moduleName:i};static deferPrefetchOnHover={name:"\u0275\u0275deferPrefetchOnHover",moduleName:i};static deferPrefetchOnInteraction={name:"\u0275\u0275deferPrefetchOnInteraction",moduleName:i};static deferPrefetchOnViewport={name:"\u0275\u0275deferPrefetchOnViewport",moduleName:i};static deferHydrateWhen={name:"\u0275\u0275deferHydrateWhen",moduleName:i};static deferHydrateNever={name:"\u0275\u0275deferHydrateNever",moduleName:i};static deferHydrateOnIdle={name:"\u0275\u0275deferHydrateOnIdle",moduleName:i};static deferHydrateOnImmediate={name:"\u0275\u0275deferHydrateOnImmediate",moduleName:i};static deferHydrateOnTimer={name:"\u0275\u0275deferHydrateOnTimer",moduleName:i};static deferHydrateOnHover={name:"\u0275\u0275deferHydrateOnHover",moduleName:i};static deferHydrateOnInteraction={name:"\u0275\u0275deferHydrateOnInteraction",moduleName:i};static deferHydrateOnViewport={name:"\u0275\u0275deferHydrateOnViewport",moduleName:i};static deferEnableTimerScheduling={name:"\u0275\u0275deferEnableTimerScheduling",moduleName:i};static conditional={name:"\u0275\u0275conditional",moduleName:i};static repeater={name:"\u0275\u0275repeater",moduleName:i};static repeaterCreate={name:"\u0275\u0275repeaterCreate",moduleName:i};static repeaterTrackByIndex={name:"\u0275\u0275repeaterTrackByIndex",moduleName:i};static repeaterTrackByIdentity={name:"\u0275\u0275repeaterTrackByIdentity",moduleName:i};static componentInstance={name:"\u0275\u0275componentInstance",moduleName:i};static text={name:"\u0275\u0275text",moduleName:i};static enableBindings={name:"\u0275\u0275enableBindings",moduleName:i};static disableBindings={name:"\u0275\u0275disableBindings",moduleName:i};static getCurrentView={name:"\u0275\u0275getCurrentView",moduleName:i};static textInterpolate={name:"\u0275\u0275textInterpolate",moduleName:i};static textInterpolate1={name:"\u0275\u0275textInterpolate1",moduleName:i};static textInterpolate2={name:"\u0275\u0275textInterpolate2",moduleName:i};static textInterpolate3={name:"\u0275\u0275textInterpolate3",moduleName:i};static textInterpolate4={name:"\u0275\u0275textInterpolate4",moduleName:i};static textInterpolate5={name:"\u0275\u0275textInterpolate5",moduleName:i};static textInterpolate6={name:"\u0275\u0275textInterpolate6",moduleName:i};static textInterpolate7={name:"\u0275\u0275textInterpolate7",moduleName:i};static textInterpolate8={name:"\u0275\u0275textInterpolate8",moduleName:i};static textInterpolateV={name:"\u0275\u0275textInterpolateV",moduleName:i};static restoreView={name:"\u0275\u0275restoreView",moduleName:i};static pureFunction0={name:"\u0275\u0275pureFunction0",moduleName:i};static pureFunction1={name:"\u0275\u0275pureFunction1",moduleName:i};static pureFunction2={name:"\u0275\u0275pureFunction2",moduleName:i};static pureFunction3={name:"\u0275\u0275pureFunction3",moduleName:i};static pureFunction4={name:"\u0275\u0275pureFunction4",moduleName:i};static pureFunction5={name:"\u0275\u0275pureFunction5",moduleName:i};static pureFunction6={name:"\u0275\u0275pureFunction6",moduleName:i};static pureFunction7={name:"\u0275\u0275pureFunction7",moduleName:i};static pureFunction8={name:"\u0275\u0275pureFunction8",moduleName:i};static pureFunctionV={name:"\u0275\u0275pureFunctionV",moduleName:i};static pipeBind1={name:"\u0275\u0275pipeBind1",moduleName:i};static pipeBind2={name:"\u0275\u0275pipeBind2",moduleName:i};static pipeBind3={name:"\u0275\u0275pipeBind3",moduleName:i};static pipeBind4={name:"\u0275\u0275pipeBind4",moduleName:i};static pipeBindV={name:"\u0275\u0275pipeBindV",moduleName:i};static hostProperty={name:"\u0275\u0275hostProperty",moduleName:i};static property={name:"\u0275\u0275property",moduleName:i};static propertyInterpolate={name:"\u0275\u0275propertyInterpolate",moduleName:i};static propertyInterpolate1={name:"\u0275\u0275propertyInterpolate1",moduleName:i};static propertyInterpolate2={name:"\u0275\u0275propertyInterpolate2",moduleName:i};static propertyInterpolate3={name:"\u0275\u0275propertyInterpolate3",moduleName:i};static propertyInterpolate4={name:"\u0275\u0275propertyInterpolate4",moduleName:i};static propertyInterpolate5={name:"\u0275\u0275propertyInterpolate5",moduleName:i};static propertyInterpolate6={name:"\u0275\u0275propertyInterpolate6",moduleName:i};static propertyInterpolate7={name:"\u0275\u0275propertyInterpolate7",moduleName:i};static propertyInterpolate8={name:"\u0275\u0275propertyInterpolate8",moduleName:i};static propertyInterpolateV={name:"\u0275\u0275propertyInterpolateV",moduleName:i};static i18n={name:"\u0275\u0275i18n",moduleName:i};static i18nAttributes={name:"\u0275\u0275i18nAttributes",moduleName:i};static i18nExp={name:"\u0275\u0275i18nExp",moduleName:i};static i18nStart={name:"\u0275\u0275i18nStart",moduleName:i};static i18nEnd={name:"\u0275\u0275i18nEnd",moduleName:i};static i18nApply={name:"\u0275\u0275i18nApply",moduleName:i};static i18nPostprocess={name:"\u0275\u0275i18nPostprocess",moduleName:i};static pipe={name:"\u0275\u0275pipe",moduleName:i};static projection={name:"\u0275\u0275projection",moduleName:i};static projectionDef={name:"\u0275\u0275projectionDef",moduleName:i};static reference={name:"\u0275\u0275reference",moduleName:i};static inject={name:"\u0275\u0275inject",moduleName:i};static injectAttribute={name:"\u0275\u0275injectAttribute",moduleName:i};static directiveInject={name:"\u0275\u0275directiveInject",moduleName:i};static invalidFactory={name:"\u0275\u0275invalidFactory",moduleName:i};static invalidFactoryDep={name:"\u0275\u0275invalidFactoryDep",moduleName:i};static templateRefExtractor={name:"\u0275\u0275templateRefExtractor",moduleName:i};static forwardRef={name:"forwardRef",moduleName:i};static resolveForwardRef={name:"resolveForwardRef",moduleName:i};static replaceMetadata={name:"\u0275\u0275replaceMetadata",moduleName:i};static \u0275\u0275defineInjectable={name:"\u0275\u0275defineInjectable",moduleName:i};static declareInjectable={name:"\u0275\u0275ngDeclareInjectable",moduleName:i};static InjectableDeclaration={name:"\u0275\u0275InjectableDeclaration",moduleName:i};static resolveWindow={name:"\u0275\u0275resolveWindow",moduleName:i};static resolveDocument={name:"\u0275\u0275resolveDocument",moduleName:i};static resolveBody={name:"\u0275\u0275resolveBody",moduleName:i};static getComponentDepsFactory={name:"\u0275\u0275getComponentDepsFactory",moduleName:i};static defineComponent={name:"\u0275\u0275defineComponent",moduleName:i};static declareComponent={name:"\u0275\u0275ngDeclareComponent",moduleName:i};static setComponentScope={name:"\u0275\u0275setComponentScope",moduleName:i};static ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleName:i};static ViewEncapsulation={name:"ViewEncapsulation",moduleName:i};static ComponentDeclaration={name:"\u0275\u0275ComponentDeclaration",moduleName:i};static FactoryDeclaration={name:"\u0275\u0275FactoryDeclaration",moduleName:i};static declareFactory={name:"\u0275\u0275ngDeclareFactory",moduleName:i};static FactoryTarget={name:"\u0275\u0275FactoryTarget",moduleName:i};static defineDirective={name:"\u0275\u0275defineDirective",moduleName:i};static declareDirective={name:"\u0275\u0275ngDeclareDirective",moduleName:i};static DirectiveDeclaration={name:"\u0275\u0275DirectiveDeclaration",moduleName:i};static InjectorDef={name:"\u0275\u0275InjectorDef",moduleName:i};static InjectorDeclaration={name:"\u0275\u0275InjectorDeclaration",moduleName:i};static defineInjector={name:"\u0275\u0275defineInjector",moduleName:i};static declareInjector={name:"\u0275\u0275ngDeclareInjector",moduleName:i};static NgModuleDeclaration={name:"\u0275\u0275NgModuleDeclaration",moduleName:i};static ModuleWithProviders={name:"ModuleWithProviders",moduleName:i};static defineNgModule={name:"\u0275\u0275defineNgModule",moduleName:i};static declareNgModule={name:"\u0275\u0275ngDeclareNgModule",moduleName:i};static setNgModuleScope={name:"\u0275\u0275setNgModuleScope",moduleName:i};static registerNgModuleType={name:"\u0275\u0275registerNgModuleType",moduleName:i};static PipeDeclaration={name:"\u0275\u0275PipeDeclaration",moduleName:i};static definePipe={name:"\u0275\u0275definePipe",moduleName:i};static declarePipe={name:"\u0275\u0275ngDeclarePipe",moduleName:i};static declareClassMetadata={name:"\u0275\u0275ngDeclareClassMetadata",moduleName:i};static declareClassMetadataAsync={name:"\u0275\u0275ngDeclareClassMetadataAsync",moduleName:i};static setClassMetadata={name:"\u0275setClassMetadata",moduleName:i};static setClassMetadataAsync={name:"\u0275setClassMetadataAsync",moduleName:i};static setClassDebugInfo={name:"\u0275setClassDebugInfo",moduleName:i};static queryRefresh={name:"\u0275\u0275queryRefresh",moduleName:i};static viewQuery={name:"\u0275\u0275viewQuery",moduleName:i};static loadQuery={name:"\u0275\u0275loadQuery",moduleName:i};static contentQuery={name:"\u0275\u0275contentQuery",moduleName:i};static viewQuerySignal={name:"\u0275\u0275viewQuerySignal",moduleName:i};static contentQuerySignal={name:"\u0275\u0275contentQuerySignal",moduleName:i};static queryAdvance={name:"\u0275\u0275queryAdvance",moduleName:i};static twoWayProperty={name:"\u0275\u0275twoWayProperty",moduleName:i};static twoWayBindingSet={name:"\u0275\u0275twoWayBindingSet",moduleName:i};static twoWayListener={name:"\u0275\u0275twoWayListener",moduleName:i};static declareLet={name:"\u0275\u0275declareLet",moduleName:i};static storeLet={name:"\u0275\u0275storeLet",moduleName:i};static readContextLet={name:"\u0275\u0275readContextLet",moduleName:i};static attachSourceLocations={name:"\u0275\u0275attachSourceLocations",moduleName:i};static NgOnChangesFeature={name:"\u0275\u0275NgOnChangesFeature",moduleName:i};static InheritDefinitionFeature={name:"\u0275\u0275InheritDefinitionFeature",moduleName:i};static CopyDefinitionFeature={name:"\u0275\u0275CopyDefinitionFeature",moduleName:i};static ProvidersFeature={name:"\u0275\u0275ProvidersFeature",moduleName:i};static HostDirectivesFeature={name:"\u0275\u0275HostDirectivesFeature",moduleName:i};static InputTransformsFeatureFeature={name:"\u0275\u0275InputTransformsFeature",moduleName:i};static ExternalStylesFeature={name:"\u0275\u0275ExternalStylesFeature",moduleName:i};static listener={name:"\u0275\u0275listener",moduleName:i};static getInheritedFactory={name:"\u0275\u0275getInheritedFactory",moduleName:i};static sanitizeHtml={name:"\u0275\u0275sanitizeHtml",moduleName:i};static sanitizeStyle={name:"\u0275\u0275sanitizeStyle",moduleName:i};static sanitizeResourceUrl={name:"\u0275\u0275sanitizeResourceUrl",moduleName:i};static sanitizeScript={name:"\u0275\u0275sanitizeScript",moduleName:i};static sanitizeUrl={name:"\u0275\u0275sanitizeUrl",moduleName:i};static sanitizeUrlOrResourceUrl={name:"\u0275\u0275sanitizeUrlOrResourceUrl",moduleName:i};static trustConstantHtml={name:"\u0275\u0275trustConstantHtml",moduleName:i};static trustConstantResourceUrl={name:"\u0275\u0275trustConstantResourceUrl",moduleName:i};static validateIframeAttribute={name:"\u0275\u0275validateIframeAttribute",moduleName:i};static InputSignalBrandWriteType={name:"\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE",moduleName:i};static UnwrapDirectiveSignalInputs={name:"\u0275UnwrapDirectiveSignalInputs",moduleName:i};static unwrapWritableSignal={name:"\u0275unwrapWritableSignal",moduleName:i}};var Et=class{full;major;minor;patch;constructor(e){this.full=e;let n=e.split(".");this.major=n[0],this.minor=n[1],this.patch=n.slice(2).join(".")}};var on;(function(t){t[t.Class=0]="Class",t[t.Function=1]="Function"})(on||(on={}));var an;(function(t){t[t.Directive=0]="Directive",t[t.Component=1]="Component",t[t.Injectable=2]="Injectable",t[t.Pipe=3]="Pipe",t[t.NgModule=4]="NgModule"})(an||(an={}));var ye=class{input;errLocation;ctxLocation;message;constructor(e,n,s,r){this.input=n,this.errLocation=s,this.ctxLocation=r,this.message=`Parser Error: ${e} ${s} [${n}] in ${r}`}},G=class{start;end;constructor(e,n){this.start=e,this.end=n}toAbsolute(e){return new O(e+this.start,e+this.end)}},E=class{span;sourceSpan;constructor(e,n){this.span=e,this.sourceSpan=n}toString(){return"AST"}},se=class extends E{nameSpan;constructor(e,n,s){super(e,n),this.nameSpan=s}},b=class extends E{visit(e,n=null){}},X=class extends E{visit(e,n=null){return e.visitImplicitReceiver(this,n)}},yt=class extends X{visit(e,n=null){var s;return(s=e.visitThisReceiver)==null?void 0:s.call(e,this,n)}},_e=class extends E{expressions;constructor(e,n,s){super(e,n),this.expressions=s}visit(e,n=null){return e.visitChain(this,n)}},Ce=class extends E{condition;trueExp;falseExp;constructor(e,n,s,r,o){super(e,n),this.condition=s,this.trueExp=r,this.falseExp=o}visit(e,n=null){return e.visitConditional(this,n)}},re=class extends se{receiver;name;constructor(e,n,s,r,o){super(e,n,s),this.receiver=r,this.name=o}visit(e,n=null){return e.visitPropertyRead(this,n)}},Te=class extends se{receiver;name;value;constructor(e,n,s,r,o,a){super(e,n,s),this.receiver=r,this.name=o,this.value=a}visit(e,n=null){return e.visitPropertyWrite(this,n)}},ie=class extends se{receiver;name;constructor(e,n,s,r,o){super(e,n,s),this.receiver=r,this.name=o}visit(e,n=null){return e.visitSafePropertyRead(this,n)}},ke=class extends E{receiver;key;constructor(e,n,s,r){super(e,n),this.receiver=s,this.key=r}visit(e,n=null){return e.visitKeyedRead(this,n)}},oe=class extends E{receiver;key;constructor(e,n,s,r){super(e,n),this.receiver=s,this.key=r}visit(e,n=null){return e.visitSafeKeyedRead(this,n)}},Ie=class extends E{receiver;key;value;constructor(e,n,s,r,o){super(e,n),this.receiver=s,this.key=r,this.value=o}visit(e,n=null){return e.visitKeyedWrite(this,n)}},be=class extends se{exp;name;args;constructor(e,n,s,r,o,a){super(e,n,a),this.exp=s,this.name=r,this.args=o}visit(e,n=null){return e.visitPipe(this,n)}},N=class extends E{value;constructor(e,n,s){super(e,n),this.value=s}visit(e,n=null){return e.visitLiteralPrimitive(this,n)}},Ne=class extends E{expressions;constructor(e,n,s){super(e,n),this.expressions=s}visit(e,n=null){return e.visitLiteralArray(this,n)}},Ae=class extends E{keys;values;constructor(e,n,s,r){super(e,n),this.keys=s,this.values=r}visit(e,n=null){return e.visitLiteralMap(this,n)}},Pe=class extends E{strings;expressions;constructor(e,n,s,r){super(e,n),this.strings=s,this.expressions=r}visit(e,n=null){return e.visitInterpolation(this,n)}},A=class extends E{operation;left;right;constructor(e,n,s,r,o){super(e,n),this.operation=s,this.left=r,this.right=o}visit(e,n=null){return e.visitBinary(this,n)}},ae=class t extends A{operator;expr;left=null;right=null;operation=null;static createMinus(e,n,s){return new t(e,n,"-",s,"-",new N(e,n,0),s)}static createPlus(e,n,s){return new t(e,n,"+",s,"-",s,new N(e,n,0))}constructor(e,n,s,r,o,a,l){super(e,n,o,a,l),this.operator=s,this.expr=r}visit(e,n=null){return e.visitUnary!==void 0?e.visitUnary(this,n):e.visitBinary(this,n)}},Le=class extends E{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitPrefixNot(this,n)}},Me=class extends E{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitTypeofExpression(this,n)}},$e=class extends E{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitNonNullAssert(this,n)}},Re=class extends E{receiver;args;argumentSpan;constructor(e,n,s,r,o){super(e,n),this.receiver=s,this.args=r,this.argumentSpan=o}visit(e,n=null){return e.visitCall(this,n)}},le=class extends E{receiver;args;argumentSpan;constructor(e,n,s,r,o){super(e,n),this.receiver=s,this.args=r,this.argumentSpan=o}visit(e,n=null){return e.visitSafeCall(this,n)}},O=class{start;end;constructor(e,n){this.start=e,this.end=n}},W=class extends E{ast;source;location;errors;constructor(e,n,s,r,o){super(new G(0,n===null?0:n.length),new O(r,n===null?r:r+n.length)),this.ast=e,this.source=n,this.location=s,this.errors=o}visit(e,n=null){return e.visitASTWithSource?e.visitASTWithSource(this,n):this.ast.visit(e,n)}toString(){return`${this.source} in ${this.location}`}},ce=class{sourceSpan;key;value;constructor(e,n,s){this.sourceSpan=e,this.key=n,this.value=s}},Be=class{sourceSpan;key;value;constructor(e,n,s){this.sourceSpan=e,this.key=n,this.value=s}},_t=class{visit(e,n){e.visit(this,n)}visitUnary(e,n){this.visit(e.expr,n)}visitBinary(e,n){this.visit(e.left,n),this.visit(e.right,n)}visitChain(e,n){this.visitAll(e.expressions,n)}visitConditional(e,n){this.visit(e.condition,n),this.visit(e.trueExp,n),this.visit(e.falseExp,n)}visitPipe(e,n){this.visit(e.exp,n),this.visitAll(e.args,n)}visitImplicitReceiver(e,n){}visitThisReceiver(e,n){}visitInterpolation(e,n){this.visitAll(e.expressions,n)}visitKeyedRead(e,n){this.visit(e.receiver,n),this.visit(e.key,n)}visitKeyedWrite(e,n){this.visit(e.receiver,n),this.visit(e.key,n),this.visit(e.value,n)}visitLiteralArray(e,n){this.visitAll(e.expressions,n)}visitLiteralMap(e,n){this.visitAll(e.values,n)}visitLiteralPrimitive(e,n){}visitPrefixNot(e,n){this.visit(e.expression,n)}visitTypeofExpression(e,n){this.visit(e.expression,n)}visitNonNullAssert(e,n){this.visit(e.expression,n)}visitPropertyRead(e,n){this.visit(e.receiver,n)}visitPropertyWrite(e,n){this.visit(e.receiver,n),this.visit(e.value,n)}visitSafePropertyRead(e,n){this.visit(e.receiver,n)}visitSafeKeyedRead(e,n){this.visit(e.receiver,n),this.visit(e.key,n)}visitCall(e,n){this.visit(e.receiver,n),this.visitAll(e.args,n)}visitSafeCall(e,n){this.visit(e.receiver,n),this.visitAll(e.args,n)}visitAll(e,n){for(let s of e)this.visit(s,n)}};var ln;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.LITERAL_ATTR=1]="LITERAL_ATTR",t[t.ANIMATION=2]="ANIMATION",t[t.TWO_WAY=3]="TWO_WAY"})(ln||(ln={}));var cn;(function(t){t[t.Regular=0]="Regular",t[t.Animation=1]="Animation",t[t.TwoWay=2]="TwoWay"})(cn||(cn={}));var H;(function(t){t[t.Property=0]="Property",t[t.Attribute=1]="Attribute",t[t.Class=2]="Class",t[t.Style=3]="Style",t[t.Animation=4]="Animation",t[t.TwoWay=5]="TwoWay"})(H||(H={}));var un;(function(t){t[t.RAW_TEXT=0]="RAW_TEXT",t[t.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",t[t.PARSABLE_DATA=2]="PARSABLE_DATA"})(un||(un={}));var Ws=[/@/,/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function qs(t,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${t}' to be an array, [start, end].`);if(e!=null){let n=e[0],s=e[1];Ws.forEach(r=>{if(r.test(n)||r.test(s))throw new Error(`['${n}', '${s}'] contains unusable interpolation symbol.`)})}}var Ct=class t{start;end;static fromArray(e){return e?(qs("interpolation",e),new t(e[0],e[1])):Z}constructor(e,n){this.start=e,this.end=n}},Z=new Ct("{{","}}");var at=0;var Un=9,js=10,zs=11,Gs=12,Xs=13,Wn=32,Js=33,qn=34,Ys=35,jn=36,Qs=37,pn=38,zn=39,je=40,me=41,Ks=42,Gn=43,ge=44,Xn=45,ee=46,Tt=47,te=58,ve=59,Zs=60,qe=61,er=62,hn=63,tr=48;var nr=57,Jn=65,sr=69;var Yn=90,ze=91,rr=92,we=93,ir=94,$t=95,Qn=97;var or=101,ar=102,lr=110,cr=114,ur=116,pr=117,hr=118;var Kn=122,kt=123,fn=124,xe=125,Zn=160;var fr=96;function dr(t){return t>=Un&&t<=Wn||t==Zn}function j(t){return tr<=t&&t<=nr}function mr(t){return t>=Qn&&t<=Kn||t>=Jn&&t<=Yn}function dn(t){return t===zn||t===qn||t===fr}var mn;(function(t){t[t.WARNING=0]="WARNING",t[t.ERROR=1]="ERROR"})(mn||(mn={}));var gn;(function(t){t[t.Inline=0]="Inline",t[t.SideEffect=1]="SideEffect",t[t.Omit=2]="Omit"})(gn||(gn={}));var vn;(function(t){t[t.Global=0]="Global",t[t.Local=1]="Local"})(vn||(vn={}));var wn;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(wn||(wn={}));var gr="(:(where|is)\\()?";var es="-shadowcsshost",ts="-shadowcsscontext",Rt="(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",ei=new RegExp(es+Rt,"gim"),ti=new RegExp(gr+"("+ts+Rt+")","gim"),ni=new RegExp(ts+Rt,"im"),vr=es+"-no-combinator",si=new RegExp(`${vr}(?![^(]*\\))`,"g");var ns="%COMMENT%",ri=new RegExp(ns,"g");var ii=new RegExp(`(\\s*(?:${ns}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g");var wr="%COMMA_IN_PLACEHOLDER%",xr="%SEMI_IN_PLACEHOLDER%",Sr="%COLON_IN_PLACEHOLDER%",oi=new RegExp(wr,"g"),ai=new RegExp(xr,"g"),li=new RegExp(Sr,"g");var f;(function(t){t[t.ListEnd=0]="ListEnd",t[t.Statement=1]="Statement",t[t.Variable=2]="Variable",t[t.ElementStart=3]="ElementStart",t[t.Element=4]="Element",t[t.Template=5]="Template",t[t.ElementEnd=6]="ElementEnd",t[t.ContainerStart=7]="ContainerStart",t[t.Container=8]="Container",t[t.ContainerEnd=9]="ContainerEnd",t[t.DisableBindings=10]="DisableBindings",t[t.Conditional=11]="Conditional",t[t.EnableBindings=12]="EnableBindings",t[t.Text=13]="Text",t[t.Listener=14]="Listener",t[t.InterpolateText=15]="InterpolateText",t[t.Binding=16]="Binding",t[t.Property=17]="Property",t[t.StyleProp=18]="StyleProp",t[t.ClassProp=19]="ClassProp",t[t.StyleMap=20]="StyleMap",t[t.ClassMap=21]="ClassMap",t[t.Advance=22]="Advance",t[t.Pipe=23]="Pipe",t[t.Attribute=24]="Attribute",t[t.ExtractedAttribute=25]="ExtractedAttribute",t[t.Defer=26]="Defer",t[t.DeferOn=27]="DeferOn",t[t.DeferWhen=28]="DeferWhen",t[t.I18nMessage=29]="I18nMessage",t[t.HostProperty=30]="HostProperty",t[t.Namespace=31]="Namespace",t[t.ProjectionDef=32]="ProjectionDef",t[t.Projection=33]="Projection",t[t.RepeaterCreate=34]="RepeaterCreate",t[t.Repeater=35]="Repeater",t[t.TwoWayProperty=36]="TwoWayProperty",t[t.TwoWayListener=37]="TwoWayListener",t[t.DeclareLet=38]="DeclareLet",t[t.StoreLet=39]="StoreLet",t[t.I18nStart=40]="I18nStart",t[t.I18n=41]="I18n",t[t.I18nEnd=42]="I18nEnd",t[t.I18nExpression=43]="I18nExpression",t[t.I18nApply=44]="I18nApply",t[t.IcuStart=45]="IcuStart",t[t.IcuEnd=46]="IcuEnd",t[t.IcuPlaceholder=47]="IcuPlaceholder",t[t.I18nContext=48]="I18nContext",t[t.I18nAttributes=49]="I18nAttributes",t[t.SourceLocation=50]="SourceLocation"})(f||(f={}));var J;(function(t){t[t.LexicalRead=0]="LexicalRead",t[t.Context=1]="Context",t[t.TrackContext=2]="TrackContext",t[t.ReadVariable=3]="ReadVariable",t[t.NextContext=4]="NextContext",t[t.Reference=5]="Reference",t[t.StoreLet=6]="StoreLet",t[t.ContextLetReference=7]="ContextLetReference",t[t.GetCurrentView=8]="GetCurrentView",t[t.RestoreView=9]="RestoreView",t[t.ResetView=10]="ResetView",t[t.PureFunctionExpr=11]="PureFunctionExpr",t[t.PureFunctionParameterExpr=12]="PureFunctionParameterExpr",t[t.PipeBinding=13]="PipeBinding",t[t.PipeBindingVariadic=14]="PipeBindingVariadic",t[t.SafePropertyRead=15]="SafePropertyRead",t[t.SafeKeyedRead=16]="SafeKeyedRead",t[t.SafeInvokeFunction=17]="SafeInvokeFunction",t[t.SafeTernaryExpr=18]="SafeTernaryExpr",t[t.EmptyExpr=19]="EmptyExpr",t[t.AssignTemporaryExpr=20]="AssignTemporaryExpr",t[t.ReadTemporaryExpr=21]="ReadTemporaryExpr",t[t.SlotLiteralExpr=22]="SlotLiteralExpr",t[t.ConditionalCase=23]="ConditionalCase",t[t.ConstCollected=24]="ConstCollected",t[t.TwoWayBindingSet=25]="TwoWayBindingSet"})(J||(J={}));var xn;(function(t){t[t.None=0]="None",t[t.AlwaysInline=1]="AlwaysInline"})(xn||(xn={}));var Sn;(function(t){t[t.Context=0]="Context",t[t.Identifier=1]="Identifier",t[t.SavedView=2]="SavedView",t[t.Alias=3]="Alias"})(Sn||(Sn={}));var En;(function(t){t[t.Normal=0]="Normal",t[t.TemplateDefinitionBuilder=1]="TemplateDefinitionBuilder"})(En||(En={}));var U;(function(t){t[t.Attribute=0]="Attribute",t[t.ClassName=1]="ClassName",t[t.StyleProperty=2]="StyleProperty",t[t.Property=3]="Property",t[t.Template=4]="Template",t[t.I18n=5]="I18n",t[t.Animation=6]="Animation",t[t.TwoWayProperty=7]="TwoWayProperty"})(U||(U={}));var yn;(function(t){t[t.Creation=0]="Creation",t[t.Postproccessing=1]="Postproccessing"})(yn||(yn={}));var _n;(function(t){t[t.I18nText=0]="I18nText",t[t.I18nAttribute=1]="I18nAttribute"})(_n||(_n={}));var Cn;(function(t){t[t.None=0]="None",t[t.ElementTag=1]="ElementTag",t[t.TemplateTag=2]="TemplateTag",t[t.OpenTag=4]="OpenTag",t[t.CloseTag=8]="CloseTag",t[t.ExpressionIndex=16]="ExpressionIndex"})(Cn||(Cn={}));var Tn;(function(t){t[t.HTML=0]="HTML",t[t.SVG=1]="SVG",t[t.Math=2]="Math"})(Tn||(Tn={}));var kn;(function(t){t[t.Idle=0]="Idle",t[t.Immediate=1]="Immediate",t[t.Timer=2]="Timer",t[t.Hover=3]="Hover",t[t.Interaction=4]="Interaction",t[t.Viewport=5]="Viewport",t[t.Never=6]="Never"})(kn||(kn={}));var In;(function(t){t[t.RootI18n=0]="RootI18n",t[t.Icu=1]="Icu",t[t.Attr=2]="Attr"})(In||(In={}));var bn;(function(t){t[t.NgTemplate=0]="NgTemplate",t[t.Structural=1]="Structural",t[t.Block=2]="Block"})(bn||(bn={}));var Er=Symbol("ConsumesSlot"),ss=Symbol("DependsOnSlotContext"),Oe=Symbol("ConsumesVars"),Bt=Symbol("UsesVarOffset"),ci={[Er]:!0,numSlotsUsed:1},ui={[ss]:!0},pi={[Oe]:!0};var Ze=class{strings;expressions;i18nPlaceholders;constructor(e,n,s){if(this.strings=e,this.expressions=n,this.i18nPlaceholders=s,s.length!==0&&s.length!==n.length)throw new Error(`Expected ${n.length} placeholders to match interpolation expression count, but got ${s.length}`)}};var Y=class extends k{constructor(e=null){super(null,e)}};var Nn=class t extends Y{target;value;sourceSpan;kind=J.StoreLet;[Oe]=!0;[ss]=!0;constructor(e,n,s){super(),this.target=e,this.value=n,this.sourceSpan=s}visitExpression(){}isEquivalent(e){return e instanceof t&&e.target===this.target&&e.value.isEquivalent(this.value)}isConstant(){return!1}transformInternalExpressions(e,n){this.value=(this.value,void 0)}clone(){return new t(this.target,this.value,this.sourceSpan)}};var An=class t extends Y{kind=J.PureFunctionExpr;[Oe]=!0;[Bt]=!0;varOffset=null;body;args;fn=null;constructor(e,n){super(),this.body=e,this.args=n}visitExpression(e,n){var s;(s=this.body)==null||s.visitExpression(e,n);for(let r of this.args)r.visitExpression(e,n)}isEquivalent(e){return!(e instanceof t)||e.args.length!==this.args.length?!1:e.body!==null&&this.body!==null&&e.body.isEquivalent(this.body)&&e.args.every((n,s)=>n.isEquivalent(this.args[s]))}isConstant(){return!1}transformInternalExpressions(e,n){this.body!==null?this.body=(this.body,n|Nt.InChildOperation,void 0):this.fn!==null&&(this.fn=(this.fn,void 0));for(let s=0;sr.clone()));return e.fn=((s=this.fn)==null?void 0:s.clone())??null,e.varOffset=this.varOffset,e}};var It=class t extends Y{target;targetSlot;name;args;kind=J.PipeBinding;[Oe]=!0;[Bt]=!0;varOffset=null;constructor(e,n,s,r){super(),this.target=e,this.targetSlot=n,this.name=s,this.args=r}visitExpression(e,n){for(let s of this.args)s.visitExpression(e,n)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(e,n){for(let s=0;sn.clone()));return e.varOffset=this.varOffset,e}},Pn=class t extends Y{target;targetSlot;name;args;numArgs;kind=J.PipeBindingVariadic;[Oe]=!0;[Bt]=!0;varOffset=null;constructor(e,n,s,r,o){super(),this.target=e,this.targetSlot=n,this.name=s,this.args=r,this.numArgs=o}visitExpression(e,n){this.args.visitExpression(e,n)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(e,n){this.args=(this.args,void 0)}clone(){let e=new t(this.target,this.targetSlot,this.name,this.args.clone(),this.numArgs);return e.varOffset=this.varOffset,e}};var bt=class t extends Y{receiver;args;kind=J.SafeInvokeFunction;constructor(e,n){super(),this.receiver=e,this.args=n}visitExpression(e,n){this.receiver.visitExpression(e,n);for(let s of this.args)s.visitExpression(e,n)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(e,n){this.receiver=(this.receiver,void 0);for(let s=0;se.clone()))}};var Nt;(function(t){t[t.None=0]="None",t[t.InChildOperation=1]="InChildOperation"})(Nt||(Nt={}));var hi=new Set([f.Element,f.ElementStart,f.Container,f.ContainerStart,f.Template,f.RepeaterCreate]);var Ln;(function(t){t[t.Tmpl=0]="Tmpl",t[t.Host=1]="Host",t[t.Both=2]="Both"})(Ln||(Ln={}));var fi=Object.freeze([]);var di=new Map([[f.ElementEnd,[f.ElementStart,f.Element]],[f.ContainerEnd,[f.ContainerStart,f.Container]],[f.I18nEnd,[f.I18nStart,f.I18n]]]),mi=new Set([f.Pipe]);var gi=[Xe,Ye,Qe,bt,It].map(t=>t.constructor.name);var yr={},_r="\uE500";yr.ngsp=_r;var Mn;(function(t){t.HEX="hexadecimal",t.DEC="decimal"})(Mn||(Mn={}));var rs=` \f +\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,vi=new RegExp(`[^${rs}]`),wi=new RegExp(`[${rs}]{2,}`,"g");var d;(function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.PrivateIdentifier=2]="PrivateIdentifier",t[t.Keyword=3]="Keyword",t[t.String=4]="String",t[t.Operator=5]="Operator",t[t.Number=6]="Number",t[t.Error=7]="Error"})(d||(d={}));var Cr=["var","let","as","null","undefined","true","false","if","else","this","typeof"],De=class{tokenize(e){let n=new At(e),s=[],r=n.scanToken();for(;r!=null;)s.push(r),r=n.scanToken();return s}},M=class{index;end;type;numValue;strValue;constructor(e,n,s,r,o){this.index=e,this.end=n,this.type=s,this.numValue=r,this.strValue=o}isCharacter(e){return this.type==d.Character&&this.numValue==e}isNumber(){return this.type==d.Number}isString(){return this.type==d.String}isOperator(e){return this.type==d.Operator&&this.strValue==e}isIdentifier(){return this.type==d.Identifier}isPrivateIdentifier(){return this.type==d.PrivateIdentifier}isKeyword(){return this.type==d.Keyword}isKeywordLet(){return this.type==d.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==d.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==d.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==d.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==d.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==d.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==d.Keyword&&this.strValue=="this"}isKeywordTypeof(){return this.type===d.Keyword&&this.strValue==="typeof"}isError(){return this.type==d.Error}toNumber(){return this.type==d.Number?this.numValue:-1}toString(){switch(this.type){case d.Character:case d.Identifier:case d.Keyword:case d.Operator:case d.PrivateIdentifier:case d.String:case d.Error:return this.strValue;case d.Number:return this.numValue.toString();default:return null}}};function $n(t,e,n){return new M(t,e,d.Character,n,String.fromCharCode(n))}function Tr(t,e,n){return new M(t,e,d.Identifier,0,n)}function kr(t,e,n){return new M(t,e,d.PrivateIdentifier,0,n)}function Ir(t,e,n){return new M(t,e,d.Keyword,0,n)}function lt(t,e,n){return new M(t,e,d.Operator,0,n)}function br(t,e,n){return new M(t,e,d.String,0,n)}function Nr(t,e,n){return new M(t,e,d.Number,n,"")}function Ar(t,e,n){return new M(t,e,d.Error,0,n)}var ct=new M(-1,-1,d.Character,0,""),At=class{input;length;peek=0;index=-1;constructor(e){this.input=e,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?at:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,n=this.length,s=this.peek,r=this.index;for(;s<=Wn;)if(++r>=n){s=at;break}else s=e.charCodeAt(r);if(this.peek=s,this.index=r,r>=n)return null;if(Rn(s))return this.scanIdentifier();if(j(s))return this.scanNumber(r);let o=r;switch(s){case ee:return this.advance(),j(this.peek)?this.scanNumber(o):$n(o,this.index,ee);case je:case me:case kt:case xe:case ze:case we:case ge:case te:case ve:return this.scanCharacter(o,s);case zn:case qn:return this.scanString();case Ys:return this.scanPrivateIdentifier();case Gn:case Xn:case Ks:case Tt:case Qs:case ir:return this.scanOperator(o,String.fromCharCode(s));case hn:return this.scanQuestion(o);case Zs:case er:return this.scanComplexOperator(o,String.fromCharCode(s),qe,"=");case Js:case qe:return this.scanComplexOperator(o,String.fromCharCode(s),qe,"=",qe,"=");case pn:return this.scanComplexOperator(o,"&",pn,"&");case fn:return this.scanComplexOperator(o,"|",fn,"|");case Zn:for(;dr(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,n){return this.advance(),$n(e,this.index,n)}scanOperator(e,n){return this.advance(),lt(e,this.index,n)}scanComplexOperator(e,n,s,r,o,a){this.advance();let l=n;return this.peek==s&&(this.advance(),l+=r),o!=null&&this.peek==o&&(this.advance(),l+=a),lt(e,this.index,l)}scanIdentifier(){let e=this.index;for(this.advance();Bn(this.peek);)this.advance();let n=this.input.substring(e,this.index);return Cr.indexOf(n)>-1?Ir(e,this.index,n):Tr(e,this.index,n)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!Rn(this.peek))return this.error("Invalid character [#]",-1);for(;Bn(this.peek);)this.advance();let n=this.input.substring(e,this.index);return kr(e,this.index,n)}scanNumber(e){let n=this.index===e,s=!1;for(this.advance();;){if(!j(this.peek))if(this.peek===$t){if(!j(this.input.charCodeAt(this.index-1))||!j(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===ee)n=!1;else if(Pr(this.peek)){if(this.advance(),Lr(this.peek)&&this.advance(),!j(this.peek))return this.error("Invalid exponent",-1);n=!1}else break;this.advance()}let r=this.input.substring(e,this.index);s&&(r=r.replace(/_/g,""));let o=n?$r(r):parseFloat(r);return Nr(e,this.index,o)}scanString(){let e=this.index,n=this.peek;this.advance();let s="",r=this.index,o=this.input;for(;this.peek!=n;)if(this.peek==rr){s+=o.substring(r,this.index);let l;if(this.advance(),this.peek==pr){let u=o.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(u))l=parseInt(u,16);else return this.error(`Invalid unicode escape [\\u${u}]`,0);for(let h=0;h<5;h++)this.advance()}else l=Mr(this.peek),this.advance();s+=String.fromCharCode(l),r=this.index}else{if(this.peek==at)return this.error("Unterminated quote",0);this.advance()}let a=o.substring(r,this.index);return this.advance(),br(e,this.index,s+a)}scanQuestion(e){this.advance();let n="?";return(this.peek===hn||this.peek===ee)&&(n+=this.peek===ee?".":"?",this.advance()),lt(e,this.index,n)}error(e,n){let s=this.index+n;return Ar(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}};function Rn(t){return Qn<=t&&t<=Kn||Jn<=t&&t<=Yn||t==$t||t==jn}function Bn(t){return mr(t)||j(t)||t==$t||t==jn}function Pr(t){return t==or||t==sr}function Lr(t){return t==Xn||t==Gn}function Mr(t){switch(t){case lr:return js;case ar:return Gs;case cr:return Xs;case ur:return Un;case hr:return zs;default:return t}}function $r(t){let e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e}var Pt=class{strings;expressions;offsets;constructor(e,n,s){this.strings=e,this.expressions=n,this.offsets=s}},Lt=class{templateBindings;warnings;errors;constructor(e,n,s){this.templateBindings=e,this.warnings=n,this.errors=s}},ue=class{_lexer;errors=[];constructor(e){this._lexer=e}parseAction(e,n,s,r=Z){this._checkNoInterpolation(e,n,r);let o=this._stripComments(e),a=this._lexer.tokenize(o),l=new z(e,n,s,a,1,this.errors,0).parseChain();return new W(l,e,n,s,this.errors)}parseBinding(e,n,s,r=Z){let o=this._parseBindingAst(e,n,s,r);return new W(o,e,n,s,this.errors)}checkSimpleExpression(e){let n=new Mt;return e.visit(n),n.errors}parseSimpleBinding(e,n,s,r=Z){let o=this._parseBindingAst(e,n,s,r),a=this.checkSimpleExpression(o);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,n),new W(o,e,n,s,this.errors)}_reportError(e,n,s,r){this.errors.push(new ye(e,n,s,r))}_parseBindingAst(e,n,s,r){this._checkNoInterpolation(e,n,r);let o=this._stripComments(e),a=this._lexer.tokenize(o);return new z(e,n,s,a,0,this.errors,0).parseChain()}parseTemplateBindings(e,n,s,r,o){let a=this._lexer.tokenize(n);return new z(n,s,o,a,0,this.errors,0).parseTemplateBindings({source:e,span:new O(r,r+e.length)})}parseInterpolation(e,n,s,r,o=Z){let{strings:a,expressions:l,offsets:u}=this.splitInterpolation(e,n,r,o);if(l.length===0)return null;let h=[];for(let g=0;gg.text),h,e,n,s)}parseInterpolationExpression(e,n,s){let r=this._stripComments(e),o=this._lexer.tokenize(r),a=new z(e,n,s,o,0,this.errors,0).parseChain(),l=["",""];return this.createInterpolationAst(l,[a],e,n,s)}createInterpolationAst(e,n,s,r,o){let a=new G(0,s.length),l=new Pe(a,a.toAbsolute(o),e,n);return new W(l,s,r,o,this.errors)}splitInterpolation(e,n,s,r=Z){let o=[],a=[],l=[],u=s?Rr(s):null,h=0,g=!1,S=!1,{start:w,end:y}=r;for(;h-1)break;o>-1&&a>-1&&this._reportError(`Got interpolation (${s}${r}) where expression was expected`,e,`at column ${o} in`,n)}_getInterpolationEndIndex(e,n,s){for(let r of this._forEachUnquotedChar(e,s)){if(e.startsWith(n,r))return r;if(e.startsWith("//",r))return e.indexOf(n,r)}return-1}*_forEachUnquotedChar(e,n){let s=null,r=0;for(let o=n;o=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,n){let s=this.currentEndIndex;if(n!==void 0&&n>this.currentEndIndex&&(s=n),e>s){let r=s;s=e,e=r}return new G(e,s)}sourceSpan(e,n){let s=`${e}@${this.inputIndex}:${n}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,n).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,n){this.context|=e;let s=n();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===ct?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],n=this.inputIndex;for(;this.index":case"<=":case">=":this.advance();let r=this.parseAdditive();n=new A(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parseAdditive(){let e=this.inputIndex,n=this.parseMultiplicative();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let r=this.parseMultiplicative();n=new A(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parseMultiplicative(){let e=this.inputIndex,n=this.parsePrefix();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let r=this.parsePrefix();n=new A(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parsePrefix(){if(this.next.type==d.Operator){let e=this.inputIndex,n=this.next.strValue,s;switch(n){case"+":return this.advance(),s=this.parsePrefix(),ae.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),ae.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new Le(this.span(e),this.sourceSpan(e),s)}}else if(this.next.isKeywordTypeof()){this.advance();let e=this.inputIndex,n=this.parsePrefix();return new Me(this.span(e),this.sourceSpan(e),n)}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,n=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(ee))n=this.parseAccessMember(n,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(je)?n=this.parseCall(n,e,!0):n=this.consumeOptionalCharacter(ze)?this.parseKeyedReadOrWrite(n,e,!0):this.parseAccessMember(n,e,!0);else if(this.consumeOptionalCharacter(ze))n=this.parseKeyedReadOrWrite(n,e,!1);else if(this.consumeOptionalCharacter(je))n=this.parseCall(n,e,!1);else if(this.consumeOptionalOperator("!"))n=new $e(this.span(e),this.sourceSpan(e),n);else return n}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(je)){this.rparensExpected++;let n=this.parsePipe();return this.rparensExpected--,this.expectCharacter(me),n}else{if(this.next.isKeywordNull())return this.advance(),new N(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new N(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new N(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new N(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new yt(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(ze)){this.rbracketsExpected++;let n=this.parseExpressionList(we);return this.rbracketsExpected--,this.expectCharacter(we),new Ne(this.span(e),this.sourceSpan(e),n)}else{if(this.next.isCharacter(kt))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new X(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let n=this.next.toNumber();return this.advance(),new N(this.span(e),this.sourceSpan(e),n)}else if(this.next.isString()){let n=this.next.toString();return this.advance(),new N(this.span(e),this.sourceSpan(e),n)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new b(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new b(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new b(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let n=[];do if(!this.next.isCharacter(e))n.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(ge));return n}parseLiteralMap(){let e=[],n=[],s=this.inputIndex;if(this.expectCharacter(kt),!this.consumeOptionalCharacter(xe)){this.rbracesExpected++;do{let r=this.inputIndex,o=this.next.isString(),a=this.expectIdentifierOrKeywordOrString(),l={key:a,quoted:o};if(e.push(l),o)this.expectCharacter(te),n.push(this.parsePipe());else if(this.consumeOptionalCharacter(te))n.push(this.parsePipe());else{l.isShorthandInitialized=!0;let u=this.span(r),h=this.sourceSpan(r);n.push(new re(u,h,h,new X(u,h),a))}}while(this.consumeOptionalCharacter(ge)&&!this.next.isCharacter(xe));this.rbracesExpected--,this.expectCharacter(xe)}return new Ae(this.span(s),this.sourceSpan(s),e,n)}parseAccessMember(e,n,s){let r=this.inputIndex,o=this.withContext(ne.Writable,()=>{let u=this.expectIdentifierOrKeyword()??"";return u.length===0&&this.error("Expected identifier for property access",e.span.end),u}),a=this.sourceSpan(r),l;if(s)this.consumeOptionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),l=new b(this.span(n),this.sourceSpan(n))):l=new ie(this.span(n),this.sourceSpan(n),a,e,o);else if(this.consumeOptionalOperator("=")){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new b(this.span(n),this.sourceSpan(n));let u=this.parseConditional();l=new Te(this.span(n),this.sourceSpan(n),a,e,o,u)}else l=new re(this.span(n),this.sourceSpan(n),a,e,o);return l}parseCall(e,n,s){let r=this.inputIndex;this.rparensExpected++;let o=this.parseCallArguments(),a=this.span(r,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(me),this.rparensExpected--;let l=this.span(n),u=this.sourceSpan(n);return s?new le(l,u,e,o,a):new Re(l,u,e,o,a)}parseCallArguments(){if(this.next.isCharacter(me))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(ge));return e}expectTemplateBindingKey(){let e="",n=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),n=this.consumeOptionalOperator("-"),n&&(e+="-");while(n);return{source:e,span:new O(s,s+e.length)}}parseTemplateBindings(e){let n=[];for(n.push(...this.parseDirectiveKeywordBindings(e));this.index{this.rbracketsExpected++;let r=this.parsePipe();if(r instanceof b&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(we),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let o=this.parseConditional();return new Ie(this.span(n),this.sourceSpan(n),e,r,o)}else return s?new oe(this.span(n),this.sourceSpan(n),e,r):new ke(this.span(n),this.sourceSpan(n),e,r);return new b(this.span(n),this.sourceSpan(n))})}parseDirectiveKeywordBindings(e){let n=[];this.consumeOptionalCharacter(te);let s=this.getDirectiveBoundTarget(),r=this.currentAbsoluteOffset,o=this.parseAsBinding(e);o||(this.consumeStatementTerminator(),r=this.currentAbsoluteOffset);let a=new O(e.span.start,r);return n.push(new Be(a,e,s)),o&&n.push(o),n}getDirectiveBoundTarget(){if(this.next===ct||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:n,end:s}=e.span,r=this.input.substring(n,s);return new W(e,r,this.location,this.absoluteOffset+n,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let n=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new O(e.span.start,this.currentAbsoluteOffset);return new ce(s,n,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let n=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let r=new O(e,this.currentAbsoluteOffset);return new ce(r,n,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(ve)||this.consumeOptionalCharacter(ge)}error(e,n=null){this.errors.push(new ye(e,this.input,this.locationText(n),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),el+u.length,0);s+=a,n+=a}e.set(s,n),r++}return e}var Br=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),xi=Array.from(Br).reduce((t,[e,n])=>(t.set(e,n),t),new Map);var Si=new ue(new De);function D(t){return e=>e.kind===t}function Se(t,e){return n=>n.kind===t&&e===n.expression instanceof Ze}function Dr(t){return(t.kind===f.Property||t.kind===f.TwoWayProperty)&&!(t.expression instanceof Ze)}var Ei=[{test:D(f.StyleMap),transform:et},{test:D(f.ClassMap),transform:et},{test:D(f.StyleProp)},{test:D(f.ClassProp)},{test:Se(f.Attribute,!0)},{test:Se(f.Property,!0)},{test:Dr},{test:Se(f.Attribute,!1)}],yi=[{test:Se(f.HostProperty,!0)},{test:Se(f.HostProperty,!1)},{test:D(f.Attribute)},{test:D(f.StyleMap),transform:et},{test:D(f.ClassMap),transform:et},{test:D(f.StyleProp)},{test:D(f.ClassProp)}],_i=new Set([f.Listener,f.TwoWayListener,f.StyleMap,f.ClassMap,f.StyleProp,f.ClassProp,f.Property,f.TwoWayProperty,f.HostProperty,f.Attribute]);function et(t){return t.slice(t.length-1)}var Ci=new Map([["window",P.resolveWindow],["document",P.resolveDocument],["body",P.resolveBody]]);var Ti=new Map([[B.HTML,P.sanitizeHtml],[B.RESOURCE_URL,P.sanitizeResourceUrl],[B.SCRIPT,P.sanitizeScript],[B.STYLE,P.sanitizeStyle],[B.URL,P.sanitizeUrl]]),ki=new Map([[B.HTML,P.trustConstantHtml],[B.RESOURCE_URL,P.trustConstantResourceUrl]]);var Dn;(function(t){t[t.None=0]="None",t[t.ViewContextRead=1]="ViewContextRead",t[t.ViewContextWrite=2]="ViewContextWrite",t[t.SideEffectful=4]="SideEffectful"})(Dn||(Dn={}));var Ii=new Map([[H.Property,U.Property],[H.TwoWay,U.TwoWayProperty],[H.Attribute,U.Attribute],[H.Class,U.ClassName],[H.Style,U.StyleProperty],[H.Animation,U.Animation]]);var bi=Symbol("queryAdvancePlaceholder");var On;(function(t){t[t.NG_CONTENT=0]="NG_CONTENT",t[t.STYLE=1]="STYLE",t[t.STYLESHEET=2]="STYLESHEET",t[t.SCRIPT=3]="SCRIPT",t[t.OTHER=4]="OTHER"})(On||(On={}));var Fn;(function(t){t.IDLE="idle",t.TIMER="timer",t.INTERACTION="interaction",t.IMMEDIATE="immediate",t.HOVER="hover",t.VIEWPORT="viewport",t.NEVER="never"})(Fn||(Fn={}));var is="%COMP%",Ni=`_nghost-${is}`,Ai=`_ngcontent-${is}`;var Pi=new Et("19.1.2");var Vn;(function(t){t[t.Extract=0]="Extract",t[t.Merge=1]="Merge"})(Vn||(Vn={}));var Hn;(function(t){t[t.Directive=0]="Directive",t[t.Component=1]="Component",t[t.Injectable=2]="Injectable",t[t.Pipe=3]="Pipe",t[t.NgModule=4]="NgModule"})(Hn||(Hn={}));function os({start:t,end:e},n){let s=t,r=e;for(;r!==s&&/\s/.test(n[r-1]);)r--;for(;s!==r&&/\s/.test(n[s]);)s++;return{start:s,end:r}}function Fr({start:t,end:e},n){let s=t,r=e;for(;r!==n.length&&/\s/.test(n[r]);)r++;for(;s!==0&&/\s/.test(n[s-1]);)s--;return{start:s,end:r}}function Vr(t,e){return e[t.start-1]==="("&&e[t.end]===")"?{start:t.start-1,end:t.end+1}:t}function as(t,e,n){let s=0,r={start:t.start,end:t.end};for(;;){let o=Fr(r,e),a=Vr(o,e);if(o.start===a.start&&o.end===a.end)break;r.start=a.start,r.end=a.end,s++}return{hasParens:(n?s-1:s)!==0,outerSpan:os(n?{start:r.start+1,end:r.end-1}:r,e),innerSpan:os(t,e)}}function ls(t){return typeof t=="string"?e=>e===t:e=>t.test(e)}function cs(t,e,n){let s=ls(e);for(let r=n;r>=0;r--){let o=t[r];if(s(o))return r}throw new Error(`Cannot find front char ${e} from index ${n} in ${JSON.stringify(t)}`)}function us(t,e,n){let s=ls(e);for(let r=n;rue.prototype._commentStart(t);function Ur(t,e){let n=e?Hr(t):null;if(n===null)return{text:t,comments:[]};let s={type:"CommentLine",value:t.slice(n+2),...Fe({start:n,end:t.length})};return{text:t.slice(0,n),comments:[s]}}function Ve(t,e=!0){return n=>{let s=new De,r=new ue(s),{text:o,comments:a}=Ur(n,e),l=t(o,r);if(l.errors.length!==0){let[{message:u}]=l.errors;throw new SyntaxError(u.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}return{result:l,comments:a,text:o}}}var hs=Ve((t,e)=>e.parseBinding(t,"",0)),Wr=Ve((t,e)=>e.parseSimpleBinding(t,"",0)),fs=Ve((t,e)=>e.parseAction(t,"",0)),ds=Ve((t,e)=>e.parseInterpolationExpression(t,"",0)),ms=Ve((t,e)=>e.parseTemplateBindings("",t,"",0,0),!1);var jr=(t,e,n)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[n<0?e.length+n:n]:e.at(n)},nt=jr;var Dt=class{text;constructor(e){this.text=e}getCharacterIndex(e,n){return us(this.text,e,n)}getCharacterLastIndex(e,n){return cs(this.text,e,n)}transformSpan(e,{stripSpaces:n=!1,hasParentParens:s=!1}={}){if(!n)return Fe(e);let{outerSpan:r,innerSpan:o,hasParens:a}=as(e,this.text,s),l=Fe(o);return a&&(l.extra={parenthesized:!0,parenStart:r.start,parenEnd:r.end}),l}createNode(e,{stripSpaces:n=!0,hasParentParens:s=!1}={}){let{type:r,start:o,end:a}=e,l={...e,...this.transformSpan({start:o,end:a},{stripSpaces:n,hasParentParens:s})};switch(r){case"NumericLiteral":case"StringLiteral":{let u=this.text.slice(l.start,l.end),{value:h}=l;l.extra={...l.extra,raw:u,rawValue:h};break}case"ObjectProperty":{let{shorthand:u}=l;u&&(l.extra={...l.extra,shorthand:u});break}}return l}},gs=Dt;function Ft(t){var e;return!!((e=t.extra)!=null&&e.parenthesized)}function $(t){return Ft(t)?t.extra.parenStart:t.start}function R(t){return Ft(t)?t.extra.parenEnd:t.end}function vs(t){return(t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression")&&!Ft(t)}function ws(t,e){let{start:n,end:s}=t.sourceSpan;return n>=s||/^\s+$/.test(e.slice(n,s))}var We,pe,p,v,He,x,Ot,Ue=class extends gs{constructor(n,s){super(s);V(this,p);V(this,We);V(this,pe);K(this,We,n),K(this,pe,s)}get node(){return c(this,p,x).call(this,L(this,We))}transformNode(n){return c(this,p,Ot).call(this,n)}};We=new WeakMap,pe=new WeakMap,p=new WeakSet,v=function(n,{stripSpaces:s=!0,hasParentParens:r=!1}={}){return this.createNode(n,{stripSpaces:s,hasParentParens:r})},He=function(n,s,{computed:r,optional:o,end:a=R(s),hasParentParens:l=!1}){if(ws(n,L(this,pe))||n.sourceSpan.start===s.start)return s;let u=c(this,p,x).call(this,n),h=vs(u);return c(this,p,v).call(this,{type:o||h?"OptionalMemberExpression":"MemberExpression",object:u,property:s,computed:r,...o?{optional:!0}:h?{optional:!1}:void 0,start:$(u),end:a},{hasParentParens:l})},x=function(n,s=!1){return c(this,p,Ot).call(this,n,s)},Ot=function(n,s=!1){if(n instanceof Pe){let{expressions:o}=n;if(o.length!==1)throw new Error("Unexpected 'Interpolation'");return c(this,p,x).call(this,o[0])}if(n instanceof ae)return c(this,p,v).call(this,{type:"UnaryExpression",prefix:!0,argument:c(this,p,x).call(this,n.expr),operator:n.operator,...n.sourceSpan},{hasParentParens:s});if(n instanceof A){let{left:o,operation:a,right:l}=n,u=c(this,p,x).call(this,o),h=c(this,p,x).call(this,l),g=$(u),S=R(h),w={left:u,right:h,start:g,end:S};return a==="&&"||a==="||"||a==="??"?c(this,p,v).call(this,{...w,type:"LogicalExpression",operator:a},{hasParentParens:s}):c(this,p,v).call(this,{...w,type:"BinaryExpression",operator:a},{hasParentParens:s})}if(n instanceof be){let{exp:o,name:a,args:l}=n,u=c(this,p,x).call(this,o),h=$(u),g=R(u),S=this.getCharacterIndex(/\S/,this.getCharacterIndex("|",g)+1),w=c(this,p,v).call(this,{type:"Identifier",name:a,start:S,end:S+a.length}),y=l.map(T=>c(this,p,x).call(this,T));return c(this,p,v).call(this,{type:"NGPipeExpression",left:u,right:w,arguments:y,start:h,end:R(y.length===0?w:nt(!1,y,-1))},{hasParentParens:s})}if(n instanceof _e)return c(this,p,v).call(this,{type:"NGChainedExpression",expressions:n.expressions.map(o=>c(this,p,x).call(this,o)),...n.sourceSpan},{hasParentParens:s});if(n instanceof Ce){let{condition:o,trueExp:a,falseExp:l}=n,u=c(this,p,x).call(this,o),h=c(this,p,x).call(this,a),g=c(this,p,x).call(this,l);return c(this,p,v).call(this,{type:"ConditionalExpression",test:u,consequent:h,alternate:g,start:$(u),end:R(g)},{hasParentParens:s})}if(n instanceof b)return c(this,p,v).call(this,{type:"NGEmptyExpression",...n.sourceSpan},{hasParentParens:s});if(n instanceof X)return c(this,p,v).call(this,{type:"ThisExpression",...n.sourceSpan},{hasParentParens:s});if(n instanceof ke||n instanceof oe)return c(this,p,He).call(this,n.receiver,c(this,p,x).call(this,n.key),{computed:!0,optional:n instanceof oe,end:n.sourceSpan.end,hasParentParens:s});if(n instanceof Ne)return c(this,p,v).call(this,{type:"ArrayExpression",elements:n.expressions.map(o=>c(this,p,x).call(this,o)),...n.sourceSpan},{hasParentParens:s});if(n instanceof Ae){let{keys:o,values:a}=n,l=a.map(h=>c(this,p,x).call(this,h)),u=o.map(({key:h,quoted:g},S)=>{let w=l[S],y=$(w),T=R(w),F=this.getCharacterIndex(/\S/,S===0?n.sourceSpan.start+1:this.getCharacterIndex(",",R(l[S-1]))+1),fe=y===F?T:this.getCharacterLastIndex(/\S/,this.getCharacterLastIndex(":",y-1)-1)+1,de={start:F,end:fe},q=g?c(this,p,v).call(this,{type:"StringLiteral",value:h,...de}):c(this,p,v).call(this,{type:"Identifier",name:h,...de}),Gt=q.endc(this,p,x).call(this,w)),h=c(this,p,x).call(this,a),g=vs(h),S=o||g?"OptionalCallExpression":"CallExpression";return c(this,p,v).call(this,{type:S,callee:h,arguments:u,optional:S==="OptionalCallExpression"?o:void 0,start:$(h),end:n.sourceSpan.end},{hasParentParens:s})}if(n instanceof $e){let o=c(this,p,x).call(this,n.expression);return c(this,p,v).call(this,{type:"TSNonNullExpression",expression:o,start:$(o),end:n.sourceSpan.end},{hasParentParens:s})}let r=n instanceof Le;if(r||n instanceof Me){let o=c(this,p,x).call(this,n.expression),a=r?"!":"typeof",{start:l}=n.sourceSpan;if(!r){let u=this.text.lastIndexOf(a,l);if(u===-1)throw new Error(`Cannot find operator ${a} from index ${l} in ${JSON.stringify(this.text)}`);l=u}return c(this,p,v).call(this,{type:"UnaryExpression",prefix:!0,operator:a,argument:o,start:l,end:R(o)},{hasParentParens:s})}if(n instanceof re||n instanceof ie){let{receiver:o,name:a}=n,l=this.getCharacterLastIndex(/\S/,n.sourceSpan.end-1)+1,u=c(this,p,v).call(this,{type:"Identifier",name:a,start:l-a.length,end:l},ws(o,L(this,pe))?{hasParentParens:s}:{});return c(this,p,He).call(this,o,u,{computed:!1,optional:n instanceof ie,hasParentParens:s})}if(n instanceof Ie){let o=c(this,p,x).call(this,n.key),a=c(this,p,x).call(this,n.value),l=c(this,p,He).call(this,n.receiver,o,{computed:!0,optional:!1,end:this.getCharacterIndex("]",R(o))+1});return c(this,p,v).call(this,{type:"AssignmentExpression",left:l,operator:"=",right:a,start:$(l),end:R(a)},{hasParentParens:s})}if(n instanceof Te){let{receiver:o,name:a,value:l}=n,u=c(this,p,x).call(this,l),h=this.getCharacterLastIndex(/\S/,this.getCharacterLastIndex("=",$(u)-1)-1)+1,g=c(this,p,v).call(this,{type:"Identifier",name:a,start:h-a.length,end:h}),S=c(this,p,He).call(this,o,g,{computed:!1,optional:!1});return c(this,p,v).call(this,{type:"AssignmentExpression",left:S,operator:"=",right:u,start:$(S),end:R(u)},{hasParentParens:s})}throw Object.assign(new Error("Unexpected node"),{node:n})};function xs(t,e){return new Ue(t,e).node}function Ss(t){return t instanceof Be}function Es(t){return t instanceof ce}var he,Q,m,ys,I,Ht,Ut,Wt,_s,Cs,Ts,ks,Vt=class extends Ue{constructor(n,s){super(void 0,s);V(this,m);V(this,he);V(this,Q);K(this,he,n),K(this,Q,s);for(let r of n)c(this,m,_s).call(this,r)}get expressions(){return c(this,m,Ts).call(this)}};he=new WeakMap,Q=new WeakMap,m=new WeakSet,ys=function(){return L(this,he)[0].key},I=function(n,{stripSpaces:s=!0}={}){return this.createNode(n,{stripSpaces:s})},Ht=function(n){return this.transformNode(n)},Ut=function(n){return ps(n.slice(L(this,m,ys).source.length))},Wt=function(n){let s=L(this,Q);if(s[n.start]!=='"'&&s[n.start]!=="'")return;let r=s[n.start],o=!1;for(let a=n.start+1;a({...y,...this.transformSpan({start:y.start,end:T})}),S=y=>({...g(y,h.end),alias:h}),w=o.pop();if(w.type==="NGMicrosyntaxExpression")o.push(S(w));else if(w.type==="NGMicrosyntaxKeyedExpression"){let y=S(w.expression);o.push(g({...w,expression:y},y.end))}else throw new Error(`Unexpected type ${w.type}`)}else o.push(c(this,m,ks).call(this,u,l));a=u}return c(this,m,I).call(this,{type:"NGMicrosyntax",body:o,...o.length===0?n[0].sourceSpan:{start:o[0].start,end:nt(!1,o,-1).end}})},ks=function(n,s){if(Ss(n)){let{key:r,value:o}=n;return o?s===0?c(this,m,I).call(this,{type:"NGMicrosyntaxExpression",expression:c(this,m,Ht).call(this,o.ast),alias:null,...o.sourceSpan}):c(this,m,I).call(this,{type:"NGMicrosyntaxKeyedExpression",key:c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:c(this,m,Ut).call(this,r.source),...r.span}),expression:c(this,m,I).call(this,{type:"NGMicrosyntaxExpression",expression:c(this,m,Ht).call(this,o.ast),alias:null,...o.sourceSpan}),start:r.span.start,end:o.sourceSpan.end}):c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:c(this,m,Ut).call(this,r.source),...r.span})}else{let{key:r,sourceSpan:o}=n;if(/^let\s$/.test(L(this,Q).slice(o.start,o.start+4))){let{value:l}=n;return c(this,m,I).call(this,{type:"NGMicrosyntaxLet",key:c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:r.source,...r.span}),value:l?c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:l.source,...l.span}):null,start:o.start,end:l?l.span.end:r.span.end})}else{let l=c(this,m,Cs).call(this,n);return c(this,m,I).call(this,{type:"NGMicrosyntaxAs",key:c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:l.source,...l.span}),alias:c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:r.source,...r.span}),start:l.span.start,end:r.span.end})}}};function Is(t,e){return new Vt(t,e).expressions}function st({result:{ast:t},text:e,comments:n}){return Object.assign(xs(t,e),{comments:n})}function bs({result:{templateBindings:t},text:e}){return Is(t,e)}var Ns=t=>st(hs(t));var As=t=>st(ds(t)),qt=t=>st(fs(t)),Ps=t=>bs(ms(t));function jt(t){var s,r,o;let e=((s=t.range)==null?void 0:s[0])??t.start,n=(o=((r=t.declaration)==null?void 0:r.decorators)??t.decorators)==null?void 0:o[0];return n?Math.min(jt(n),e):e}function Ls(t){var e;return((e=t.range)==null?void 0:e[1])??t.end}function rt(t){return{astFormat:"estree",parse(e){let n=t(e);return{type:"NGRoot",node:t===qt&&n.type!=="NGChainedExpression"?{...n,type:"NGChainedExpression",expressions:[n]}:n}},locStart:jt,locEnd:Ls}}var zr=rt(qt),Gr=rt(Ns),Xr=rt(As),Jr=rt(Ps);return Os(Yr);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/angular.mjs b/node_modules/prettier/plugins/angular.mjs new file mode 100644 index 0000000..03f0d29 --- /dev/null +++ b/node_modules/prettier/plugins/angular.mjs @@ -0,0 +1,2 @@ +var $s=Object.defineProperty;var Xt=t=>{throw TypeError(t)};var Jt=(t,e)=>{for(var n in e)$s(t,n,{get:e[n],enumerable:!0})};var it=(t,e,n)=>e.has(t)||Xt("Cannot "+n);var L=(t,e,n)=>(it(t,e,"read from private field"),n?n.call(t):e.get(t)),V=(t,e,n)=>e.has(t)?Xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),K=(t,e,n,s)=>(it(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),c=(t,e,n)=>(it(t,e,"access private method"),n);var zt={};Jt(zt,{parsers:()=>jt});var jt={};Jt(jt,{__ng_action:()=>Ur,__ng_binding:()=>Wr,__ng_directive:()=>jr,__ng_interpolation:()=>qr});var Gr=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var Yt;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom"})(Yt||(Yt={}));var Qt;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default"})(Qt||(Qt={}));var Kt;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(Kt||(Kt={}));var B;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL"})(B||(B={}));var Zt;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(Zt||(Zt={}));var en;(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(en||(en={}));var tn;(function(t){t[t.None=0]="None",t[t.Const=1]="Const"})(tn||(tn={}));var nn;(function(t){t[t.Dynamic=0]="Dynamic",t[t.Bool=1]="Bool",t[t.String=2]="String",t[t.Int=3]="Int",t[t.Number=4]="Number",t[t.Function=5]="Function",t[t.Inferred=6]="Inferred",t[t.None=7]="None"})(nn||(nn={}));var Rs=void 0;var sn;(function(t){t[t.Minus=0]="Minus",t[t.Plus=1]="Plus"})(sn||(sn={}));var _;(function(t){t[t.Equals=0]="Equals",t[t.NotEquals=1]="NotEquals",t[t.Identical=2]="Identical",t[t.NotIdentical=3]="NotIdentical",t[t.Minus=4]="Minus",t[t.Plus=5]="Plus",t[t.Divide=6]="Divide",t[t.Multiply=7]="Multiply",t[t.Modulo=8]="Modulo",t[t.And=9]="And",t[t.Or=10]="Or",t[t.BitwiseOr=11]="BitwiseOr",t[t.BitwiseAnd=12]="BitwiseAnd",t[t.Lower=13]="Lower",t[t.LowerEquals=14]="LowerEquals",t[t.Bigger=15]="Bigger",t[t.BiggerEquals=16]="BiggerEquals",t[t.NullishCoalesce=17]="NullishCoalesce"})(_||(_={}));function Bs(t,e){return t==null||e==null?t==e:t.isEquivalent(e)}function Ds(t,e,n){let s=t.length;if(s!==e.length)return!1;for(let r=0;rn.isEquivalent(s))}var k=class{type;sourceSpan;constructor(e,n){this.type=e||null,this.sourceSpan=n||null}prop(e,n){return new gt(this,e,null,n)}key(e,n,s){return new vt(this,e,n,s)}callFn(e,n,s){return new Xe(this,e,null,n,s)}instantiate(e,n,s){return new ft(this,e,n,s)}conditional(e,n=null,s){return new mt(this,e,n,null,s)}equals(e,n){return new C(_.Equals,this,e,null,n)}notEquals(e,n){return new C(_.NotEquals,this,e,null,n)}identical(e,n){return new C(_.Identical,this,e,null,n)}notIdentical(e,n){return new C(_.NotIdentical,this,e,null,n)}minus(e,n){return new C(_.Minus,this,e,null,n)}plus(e,n){return new C(_.Plus,this,e,null,n)}divide(e,n){return new C(_.Divide,this,e,null,n)}multiply(e,n){return new C(_.Multiply,this,e,null,n)}modulo(e,n){return new C(_.Modulo,this,e,null,n)}and(e,n){return new C(_.And,this,e,null,n)}bitwiseOr(e,n,s=!0){return new C(_.BitwiseOr,this,e,null,n,s)}bitwiseAnd(e,n,s=!0){return new C(_.BitwiseAnd,this,e,null,n,s)}or(e,n){return new C(_.Or,this,e,null,n)}lower(e,n){return new C(_.Lower,this,e,null,n)}lowerEquals(e,n){return new C(_.LowerEquals,this,e,null,n)}bigger(e,n){return new C(_.Bigger,this,e,null,n)}biggerEquals(e,n){return new C(_.BiggerEquals,this,e,null,n)}isBlank(e){return this.equals(TYPED_NULL_EXPR,e)}nullishCoalesce(e,n){return new C(_.NullishCoalesce,this,e,null,n)}toStmt(){return new xt(this,null)}},Ge=class t extends k{name;constructor(e,n,s){super(n,s),this.name=e}isEquivalent(e){return e instanceof t&&this.name===e.name}isConstant(){return!1}visitExpression(e,n){return e.visitReadVarExpr(this,n)}clone(){return new t(this.name,this.type,this.sourceSpan)}set(e){return new ut(this.name,e,null,this.sourceSpan)}},ct=class t extends k{expr;constructor(e,n,s){super(n,s),this.expr=e}visitExpression(e,n){return e.visitTypeofExpr(this,n)}isEquivalent(e){return e instanceof t&&e.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new t(this.expr.clone())}};var ut=class t extends k{name;value;constructor(e,n,s,r){super(s||n.type,r),this.name=e,this.value=n}isEquivalent(e){return e instanceof t&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,n){return e.visitWriteVarExpr(this,n)}clone(){return new t(this.name,this.value.clone(),this.type,this.sourceSpan)}toDeclStmt(e,n){return new wt(this.name,this.value,e,n,this.sourceSpan)}toConstDecl(){return this.toDeclStmt(Rs,Ee.Final)}},pt=class t extends k{receiver;index;value;constructor(e,n,s,r,o){super(r||s.type,o),this.receiver=e,this.index=n,this.value=s}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,n){return e.visitWriteKeyExpr(this,n)}clone(){return new t(this.receiver.clone(),this.index.clone(),this.value.clone(),this.type,this.sourceSpan)}},ht=class t extends k{receiver;name;value;constructor(e,n,s,r,o){super(r||s.type,o),this.receiver=e,this.name=n,this.value=s}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,n){return e.visitWritePropExpr(this,n)}clone(){return new t(this.receiver.clone(),this.name,this.value.clone(),this.type,this.sourceSpan)}},Xe=class t extends k{fn;args;pure;constructor(e,n,s,r,o=!1){super(s,r),this.fn=e,this.args=n,this.pure=o}get receiver(){return this.fn}isEquivalent(e){return e instanceof t&&this.fn.isEquivalent(e.fn)&&tt(this.args,e.args)&&this.pure===e.pure}isConstant(){return!1}visitExpression(e,n){return e.visitInvokeFunctionExpr(this,n)}clone(){return new t(this.fn.clone(),this.args.map(e=>e.clone()),this.type,this.sourceSpan,this.pure)}};var ft=class t extends k{classExpr;args;constructor(e,n,s,r){super(s,r),this.classExpr=e,this.args=n}isEquivalent(e){return e instanceof t&&this.classExpr.isEquivalent(e.classExpr)&&tt(this.args,e.args)}isConstant(){return!1}visitExpression(e,n){return e.visitInstantiateExpr(this,n)}clone(){return new t(this.classExpr.clone(),this.args.map(e=>e.clone()),this.type,this.sourceSpan)}},Je=class t extends k{value;constructor(e,n,s){super(n,s),this.value=e}isEquivalent(e){return e instanceof t&&this.value===e.value}isConstant(){return!0}visitExpression(e,n){return e.visitLiteralExpr(this,n)}clone(){return new t(this.value,this.type,this.sourceSpan)}};var dt=class t extends k{value;typeParams;constructor(e,n,s=null,r){super(n,r),this.value=e,this.typeParams=s}isEquivalent(e){return e instanceof t&&this.value.name===e.value.name&&this.value.moduleName===e.value.moduleName}isConstant(){return!1}visitExpression(e,n){return e.visitExternalExpr(this,n)}clone(){return new t(this.value,this.type,this.typeParams,this.sourceSpan)}};var mt=class t extends k{condition;falseCase;trueCase;constructor(e,n,s=null,r,o){super(r||n.type,o),this.condition=e,this.falseCase=s,this.trueCase=n}isEquivalent(e){return e instanceof t&&this.condition.isEquivalent(e.condition)&&this.trueCase.isEquivalent(e.trueCase)&&Bs(this.falseCase,e.falseCase)}isConstant(){return!1}visitExpression(e,n){return e.visitConditionalExpr(this,n)}clone(){var e;return new t(this.condition.clone(),this.trueCase.clone(),(e=this.falseCase)==null?void 0:e.clone(),this.type,this.sourceSpan)}};var C=class t extends k{operator;rhs;parens;lhs;constructor(e,n,s,r,o,a=!0){super(r||n.type,o),this.operator=e,this.rhs=s,this.parens=a,this.lhs=n}isEquivalent(e){return e instanceof t&&this.operator===e.operator&&this.lhs.isEquivalent(e.lhs)&&this.rhs.isEquivalent(e.rhs)}isConstant(){return!1}visitExpression(e,n){return e.visitBinaryOperatorExpr(this,n)}clone(){return new t(this.operator,this.lhs.clone(),this.rhs.clone(),this.type,this.sourceSpan,this.parens)}},gt=class t extends k{receiver;name;constructor(e,n,s,r){super(s,r),this.receiver=e,this.name=n}get index(){return this.name}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name}isConstant(){return!1}visitExpression(e,n){return e.visitReadPropExpr(this,n)}set(e){return new ht(this.receiver,this.name,e,null,this.sourceSpan)}clone(){return new t(this.receiver.clone(),this.name,this.type,this.sourceSpan)}},vt=class t extends k{receiver;index;constructor(e,n,s,r){super(s,r),this.receiver=e,this.index=n}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)}isConstant(){return!1}visitExpression(e,n){return e.visitReadKeyExpr(this,n)}set(e){return new pt(this.receiver,this.index,e,null,this.sourceSpan)}clone(){return new t(this.receiver.clone(),this.index.clone(),this.type,this.sourceSpan)}},Ye=class t extends k{entries;constructor(e,n,s){super(n,s),this.entries=e}isConstant(){return this.entries.every(e=>e.isConstant())}isEquivalent(e){return e instanceof t&&tt(this.entries,e.entries)}visitExpression(e,n){return e.visitLiteralArrayExpr(this,n)}clone(){return new t(this.entries.map(e=>e.clone()),this.type,this.sourceSpan)}};var Qe=class t extends k{entries;valueType=null;constructor(e,n,s){super(n,s),this.entries=e,n&&(this.valueType=n.valueType)}isEquivalent(e){return e instanceof t&&tt(this.entries,e.entries)}isConstant(){return this.entries.every(e=>e.value.isConstant())}visitExpression(e,n){return e.visitLiteralMapExpr(this,n)}clone(){let e=this.entries.map(n=>n.clone());return new t(e,this.type,this.sourceSpan)}};var Ee;(function(t){t[t.None=0]="None",t[t.Final=1]="Final",t[t.Private=2]="Private",t[t.Exported=4]="Exported",t[t.Static=8]="Static"})(Ee||(Ee={}));var Ke=class{modifiers;sourceSpan;leadingComments;constructor(e=Ee.None,n=null,s){this.modifiers=e,this.sourceSpan=n,this.leadingComments=s}hasModifier(e){return(this.modifiers&e)!==0}addLeadingComment(e){this.leadingComments=this.leadingComments??[],this.leadingComments.push(e)}},wt=class t extends Ke{name;value;type;constructor(e,n,s,r,o,a){super(r,o,a),this.name=e,this.value=n,this.type=s||n&&n.type||null}isEquivalent(e){return e instanceof t&&this.name===e.name&&(this.value?!!e.value&&this.value.isEquivalent(e.value):!e.value)}visitStatement(e,n){return e.visitDeclareVarStmt(this,n)}};var xt=class t extends Ke{expr;constructor(e,n,s){super(Ee.None,n,s),this.expr=e}isEquivalent(e){return e instanceof t&&this.expr.isEquivalent(e.expr)}visitStatement(e,n){return e.visitExpressionStmt(this,n)}};function Os(t,e,n){return new Ge(t,e,n)}var Xr=Os("");var rn=class t{static INSTANCE=new t;keyOf(e){if(e instanceof Je&&typeof e.value=="string")return`"${e.value}"`;if(e instanceof Je)return String(e.value);if(e instanceof Ye){let n=[];for(let s of e.entries)n.push(this.keyOf(s));return`[${n.join(",")}]`}else if(e instanceof Qe){let n=[];for(let s of e.entries){let r=s.key;s.quoted&&(r=`"${r}"`),n.push(r+":"+this.keyOf(s.value))}return`{${n.join(",")}}`}else{if(e instanceof dt)return`import("${e.value.moduleName}", ${e.value.name})`;if(e instanceof Ge)return`read(${e.name})`;if(e instanceof ct)return`typeof(${this.keyOf(e.expr)})`;throw new Error(`${this.constructor.name} does not handle expressions of type ${e.constructor.name}`)}}};var i="@angular/core",P=class{static NEW_METHOD="factory";static TRANSFORM_METHOD="transform";static PATCH_DEPS="patchedDeps";static core={name:null,moduleName:i};static namespaceHTML={name:"\u0275\u0275namespaceHTML",moduleName:i};static namespaceMathML={name:"\u0275\u0275namespaceMathML",moduleName:i};static namespaceSVG={name:"\u0275\u0275namespaceSVG",moduleName:i};static element={name:"\u0275\u0275element",moduleName:i};static elementStart={name:"\u0275\u0275elementStart",moduleName:i};static elementEnd={name:"\u0275\u0275elementEnd",moduleName:i};static advance={name:"\u0275\u0275advance",moduleName:i};static syntheticHostProperty={name:"\u0275\u0275syntheticHostProperty",moduleName:i};static syntheticHostListener={name:"\u0275\u0275syntheticHostListener",moduleName:i};static attribute={name:"\u0275\u0275attribute",moduleName:i};static attributeInterpolate1={name:"\u0275\u0275attributeInterpolate1",moduleName:i};static attributeInterpolate2={name:"\u0275\u0275attributeInterpolate2",moduleName:i};static attributeInterpolate3={name:"\u0275\u0275attributeInterpolate3",moduleName:i};static attributeInterpolate4={name:"\u0275\u0275attributeInterpolate4",moduleName:i};static attributeInterpolate5={name:"\u0275\u0275attributeInterpolate5",moduleName:i};static attributeInterpolate6={name:"\u0275\u0275attributeInterpolate6",moduleName:i};static attributeInterpolate7={name:"\u0275\u0275attributeInterpolate7",moduleName:i};static attributeInterpolate8={name:"\u0275\u0275attributeInterpolate8",moduleName:i};static attributeInterpolateV={name:"\u0275\u0275attributeInterpolateV",moduleName:i};static classProp={name:"\u0275\u0275classProp",moduleName:i};static elementContainerStart={name:"\u0275\u0275elementContainerStart",moduleName:i};static elementContainerEnd={name:"\u0275\u0275elementContainerEnd",moduleName:i};static elementContainer={name:"\u0275\u0275elementContainer",moduleName:i};static styleMap={name:"\u0275\u0275styleMap",moduleName:i};static styleMapInterpolate1={name:"\u0275\u0275styleMapInterpolate1",moduleName:i};static styleMapInterpolate2={name:"\u0275\u0275styleMapInterpolate2",moduleName:i};static styleMapInterpolate3={name:"\u0275\u0275styleMapInterpolate3",moduleName:i};static styleMapInterpolate4={name:"\u0275\u0275styleMapInterpolate4",moduleName:i};static styleMapInterpolate5={name:"\u0275\u0275styleMapInterpolate5",moduleName:i};static styleMapInterpolate6={name:"\u0275\u0275styleMapInterpolate6",moduleName:i};static styleMapInterpolate7={name:"\u0275\u0275styleMapInterpolate7",moduleName:i};static styleMapInterpolate8={name:"\u0275\u0275styleMapInterpolate8",moduleName:i};static styleMapInterpolateV={name:"\u0275\u0275styleMapInterpolateV",moduleName:i};static classMap={name:"\u0275\u0275classMap",moduleName:i};static classMapInterpolate1={name:"\u0275\u0275classMapInterpolate1",moduleName:i};static classMapInterpolate2={name:"\u0275\u0275classMapInterpolate2",moduleName:i};static classMapInterpolate3={name:"\u0275\u0275classMapInterpolate3",moduleName:i};static classMapInterpolate4={name:"\u0275\u0275classMapInterpolate4",moduleName:i};static classMapInterpolate5={name:"\u0275\u0275classMapInterpolate5",moduleName:i};static classMapInterpolate6={name:"\u0275\u0275classMapInterpolate6",moduleName:i};static classMapInterpolate7={name:"\u0275\u0275classMapInterpolate7",moduleName:i};static classMapInterpolate8={name:"\u0275\u0275classMapInterpolate8",moduleName:i};static classMapInterpolateV={name:"\u0275\u0275classMapInterpolateV",moduleName:i};static styleProp={name:"\u0275\u0275styleProp",moduleName:i};static stylePropInterpolate1={name:"\u0275\u0275stylePropInterpolate1",moduleName:i};static stylePropInterpolate2={name:"\u0275\u0275stylePropInterpolate2",moduleName:i};static stylePropInterpolate3={name:"\u0275\u0275stylePropInterpolate3",moduleName:i};static stylePropInterpolate4={name:"\u0275\u0275stylePropInterpolate4",moduleName:i};static stylePropInterpolate5={name:"\u0275\u0275stylePropInterpolate5",moduleName:i};static stylePropInterpolate6={name:"\u0275\u0275stylePropInterpolate6",moduleName:i};static stylePropInterpolate7={name:"\u0275\u0275stylePropInterpolate7",moduleName:i};static stylePropInterpolate8={name:"\u0275\u0275stylePropInterpolate8",moduleName:i};static stylePropInterpolateV={name:"\u0275\u0275stylePropInterpolateV",moduleName:i};static nextContext={name:"\u0275\u0275nextContext",moduleName:i};static resetView={name:"\u0275\u0275resetView",moduleName:i};static templateCreate={name:"\u0275\u0275template",moduleName:i};static defer={name:"\u0275\u0275defer",moduleName:i};static deferWhen={name:"\u0275\u0275deferWhen",moduleName:i};static deferOnIdle={name:"\u0275\u0275deferOnIdle",moduleName:i};static deferOnImmediate={name:"\u0275\u0275deferOnImmediate",moduleName:i};static deferOnTimer={name:"\u0275\u0275deferOnTimer",moduleName:i};static deferOnHover={name:"\u0275\u0275deferOnHover",moduleName:i};static deferOnInteraction={name:"\u0275\u0275deferOnInteraction",moduleName:i};static deferOnViewport={name:"\u0275\u0275deferOnViewport",moduleName:i};static deferPrefetchWhen={name:"\u0275\u0275deferPrefetchWhen",moduleName:i};static deferPrefetchOnIdle={name:"\u0275\u0275deferPrefetchOnIdle",moduleName:i};static deferPrefetchOnImmediate={name:"\u0275\u0275deferPrefetchOnImmediate",moduleName:i};static deferPrefetchOnTimer={name:"\u0275\u0275deferPrefetchOnTimer",moduleName:i};static deferPrefetchOnHover={name:"\u0275\u0275deferPrefetchOnHover",moduleName:i};static deferPrefetchOnInteraction={name:"\u0275\u0275deferPrefetchOnInteraction",moduleName:i};static deferPrefetchOnViewport={name:"\u0275\u0275deferPrefetchOnViewport",moduleName:i};static deferHydrateWhen={name:"\u0275\u0275deferHydrateWhen",moduleName:i};static deferHydrateNever={name:"\u0275\u0275deferHydrateNever",moduleName:i};static deferHydrateOnIdle={name:"\u0275\u0275deferHydrateOnIdle",moduleName:i};static deferHydrateOnImmediate={name:"\u0275\u0275deferHydrateOnImmediate",moduleName:i};static deferHydrateOnTimer={name:"\u0275\u0275deferHydrateOnTimer",moduleName:i};static deferHydrateOnHover={name:"\u0275\u0275deferHydrateOnHover",moduleName:i};static deferHydrateOnInteraction={name:"\u0275\u0275deferHydrateOnInteraction",moduleName:i};static deferHydrateOnViewport={name:"\u0275\u0275deferHydrateOnViewport",moduleName:i};static deferEnableTimerScheduling={name:"\u0275\u0275deferEnableTimerScheduling",moduleName:i};static conditional={name:"\u0275\u0275conditional",moduleName:i};static repeater={name:"\u0275\u0275repeater",moduleName:i};static repeaterCreate={name:"\u0275\u0275repeaterCreate",moduleName:i};static repeaterTrackByIndex={name:"\u0275\u0275repeaterTrackByIndex",moduleName:i};static repeaterTrackByIdentity={name:"\u0275\u0275repeaterTrackByIdentity",moduleName:i};static componentInstance={name:"\u0275\u0275componentInstance",moduleName:i};static text={name:"\u0275\u0275text",moduleName:i};static enableBindings={name:"\u0275\u0275enableBindings",moduleName:i};static disableBindings={name:"\u0275\u0275disableBindings",moduleName:i};static getCurrentView={name:"\u0275\u0275getCurrentView",moduleName:i};static textInterpolate={name:"\u0275\u0275textInterpolate",moduleName:i};static textInterpolate1={name:"\u0275\u0275textInterpolate1",moduleName:i};static textInterpolate2={name:"\u0275\u0275textInterpolate2",moduleName:i};static textInterpolate3={name:"\u0275\u0275textInterpolate3",moduleName:i};static textInterpolate4={name:"\u0275\u0275textInterpolate4",moduleName:i};static textInterpolate5={name:"\u0275\u0275textInterpolate5",moduleName:i};static textInterpolate6={name:"\u0275\u0275textInterpolate6",moduleName:i};static textInterpolate7={name:"\u0275\u0275textInterpolate7",moduleName:i};static textInterpolate8={name:"\u0275\u0275textInterpolate8",moduleName:i};static textInterpolateV={name:"\u0275\u0275textInterpolateV",moduleName:i};static restoreView={name:"\u0275\u0275restoreView",moduleName:i};static pureFunction0={name:"\u0275\u0275pureFunction0",moduleName:i};static pureFunction1={name:"\u0275\u0275pureFunction1",moduleName:i};static pureFunction2={name:"\u0275\u0275pureFunction2",moduleName:i};static pureFunction3={name:"\u0275\u0275pureFunction3",moduleName:i};static pureFunction4={name:"\u0275\u0275pureFunction4",moduleName:i};static pureFunction5={name:"\u0275\u0275pureFunction5",moduleName:i};static pureFunction6={name:"\u0275\u0275pureFunction6",moduleName:i};static pureFunction7={name:"\u0275\u0275pureFunction7",moduleName:i};static pureFunction8={name:"\u0275\u0275pureFunction8",moduleName:i};static pureFunctionV={name:"\u0275\u0275pureFunctionV",moduleName:i};static pipeBind1={name:"\u0275\u0275pipeBind1",moduleName:i};static pipeBind2={name:"\u0275\u0275pipeBind2",moduleName:i};static pipeBind3={name:"\u0275\u0275pipeBind3",moduleName:i};static pipeBind4={name:"\u0275\u0275pipeBind4",moduleName:i};static pipeBindV={name:"\u0275\u0275pipeBindV",moduleName:i};static hostProperty={name:"\u0275\u0275hostProperty",moduleName:i};static property={name:"\u0275\u0275property",moduleName:i};static propertyInterpolate={name:"\u0275\u0275propertyInterpolate",moduleName:i};static propertyInterpolate1={name:"\u0275\u0275propertyInterpolate1",moduleName:i};static propertyInterpolate2={name:"\u0275\u0275propertyInterpolate2",moduleName:i};static propertyInterpolate3={name:"\u0275\u0275propertyInterpolate3",moduleName:i};static propertyInterpolate4={name:"\u0275\u0275propertyInterpolate4",moduleName:i};static propertyInterpolate5={name:"\u0275\u0275propertyInterpolate5",moduleName:i};static propertyInterpolate6={name:"\u0275\u0275propertyInterpolate6",moduleName:i};static propertyInterpolate7={name:"\u0275\u0275propertyInterpolate7",moduleName:i};static propertyInterpolate8={name:"\u0275\u0275propertyInterpolate8",moduleName:i};static propertyInterpolateV={name:"\u0275\u0275propertyInterpolateV",moduleName:i};static i18n={name:"\u0275\u0275i18n",moduleName:i};static i18nAttributes={name:"\u0275\u0275i18nAttributes",moduleName:i};static i18nExp={name:"\u0275\u0275i18nExp",moduleName:i};static i18nStart={name:"\u0275\u0275i18nStart",moduleName:i};static i18nEnd={name:"\u0275\u0275i18nEnd",moduleName:i};static i18nApply={name:"\u0275\u0275i18nApply",moduleName:i};static i18nPostprocess={name:"\u0275\u0275i18nPostprocess",moduleName:i};static pipe={name:"\u0275\u0275pipe",moduleName:i};static projection={name:"\u0275\u0275projection",moduleName:i};static projectionDef={name:"\u0275\u0275projectionDef",moduleName:i};static reference={name:"\u0275\u0275reference",moduleName:i};static inject={name:"\u0275\u0275inject",moduleName:i};static injectAttribute={name:"\u0275\u0275injectAttribute",moduleName:i};static directiveInject={name:"\u0275\u0275directiveInject",moduleName:i};static invalidFactory={name:"\u0275\u0275invalidFactory",moduleName:i};static invalidFactoryDep={name:"\u0275\u0275invalidFactoryDep",moduleName:i};static templateRefExtractor={name:"\u0275\u0275templateRefExtractor",moduleName:i};static forwardRef={name:"forwardRef",moduleName:i};static resolveForwardRef={name:"resolveForwardRef",moduleName:i};static replaceMetadata={name:"\u0275\u0275replaceMetadata",moduleName:i};static \u0275\u0275defineInjectable={name:"\u0275\u0275defineInjectable",moduleName:i};static declareInjectable={name:"\u0275\u0275ngDeclareInjectable",moduleName:i};static InjectableDeclaration={name:"\u0275\u0275InjectableDeclaration",moduleName:i};static resolveWindow={name:"\u0275\u0275resolveWindow",moduleName:i};static resolveDocument={name:"\u0275\u0275resolveDocument",moduleName:i};static resolveBody={name:"\u0275\u0275resolveBody",moduleName:i};static getComponentDepsFactory={name:"\u0275\u0275getComponentDepsFactory",moduleName:i};static defineComponent={name:"\u0275\u0275defineComponent",moduleName:i};static declareComponent={name:"\u0275\u0275ngDeclareComponent",moduleName:i};static setComponentScope={name:"\u0275\u0275setComponentScope",moduleName:i};static ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleName:i};static ViewEncapsulation={name:"ViewEncapsulation",moduleName:i};static ComponentDeclaration={name:"\u0275\u0275ComponentDeclaration",moduleName:i};static FactoryDeclaration={name:"\u0275\u0275FactoryDeclaration",moduleName:i};static declareFactory={name:"\u0275\u0275ngDeclareFactory",moduleName:i};static FactoryTarget={name:"\u0275\u0275FactoryTarget",moduleName:i};static defineDirective={name:"\u0275\u0275defineDirective",moduleName:i};static declareDirective={name:"\u0275\u0275ngDeclareDirective",moduleName:i};static DirectiveDeclaration={name:"\u0275\u0275DirectiveDeclaration",moduleName:i};static InjectorDef={name:"\u0275\u0275InjectorDef",moduleName:i};static InjectorDeclaration={name:"\u0275\u0275InjectorDeclaration",moduleName:i};static defineInjector={name:"\u0275\u0275defineInjector",moduleName:i};static declareInjector={name:"\u0275\u0275ngDeclareInjector",moduleName:i};static NgModuleDeclaration={name:"\u0275\u0275NgModuleDeclaration",moduleName:i};static ModuleWithProviders={name:"ModuleWithProviders",moduleName:i};static defineNgModule={name:"\u0275\u0275defineNgModule",moduleName:i};static declareNgModule={name:"\u0275\u0275ngDeclareNgModule",moduleName:i};static setNgModuleScope={name:"\u0275\u0275setNgModuleScope",moduleName:i};static registerNgModuleType={name:"\u0275\u0275registerNgModuleType",moduleName:i};static PipeDeclaration={name:"\u0275\u0275PipeDeclaration",moduleName:i};static definePipe={name:"\u0275\u0275definePipe",moduleName:i};static declarePipe={name:"\u0275\u0275ngDeclarePipe",moduleName:i};static declareClassMetadata={name:"\u0275\u0275ngDeclareClassMetadata",moduleName:i};static declareClassMetadataAsync={name:"\u0275\u0275ngDeclareClassMetadataAsync",moduleName:i};static setClassMetadata={name:"\u0275setClassMetadata",moduleName:i};static setClassMetadataAsync={name:"\u0275setClassMetadataAsync",moduleName:i};static setClassDebugInfo={name:"\u0275setClassDebugInfo",moduleName:i};static queryRefresh={name:"\u0275\u0275queryRefresh",moduleName:i};static viewQuery={name:"\u0275\u0275viewQuery",moduleName:i};static loadQuery={name:"\u0275\u0275loadQuery",moduleName:i};static contentQuery={name:"\u0275\u0275contentQuery",moduleName:i};static viewQuerySignal={name:"\u0275\u0275viewQuerySignal",moduleName:i};static contentQuerySignal={name:"\u0275\u0275contentQuerySignal",moduleName:i};static queryAdvance={name:"\u0275\u0275queryAdvance",moduleName:i};static twoWayProperty={name:"\u0275\u0275twoWayProperty",moduleName:i};static twoWayBindingSet={name:"\u0275\u0275twoWayBindingSet",moduleName:i};static twoWayListener={name:"\u0275\u0275twoWayListener",moduleName:i};static declareLet={name:"\u0275\u0275declareLet",moduleName:i};static storeLet={name:"\u0275\u0275storeLet",moduleName:i};static readContextLet={name:"\u0275\u0275readContextLet",moduleName:i};static attachSourceLocations={name:"\u0275\u0275attachSourceLocations",moduleName:i};static NgOnChangesFeature={name:"\u0275\u0275NgOnChangesFeature",moduleName:i};static InheritDefinitionFeature={name:"\u0275\u0275InheritDefinitionFeature",moduleName:i};static CopyDefinitionFeature={name:"\u0275\u0275CopyDefinitionFeature",moduleName:i};static ProvidersFeature={name:"\u0275\u0275ProvidersFeature",moduleName:i};static HostDirectivesFeature={name:"\u0275\u0275HostDirectivesFeature",moduleName:i};static InputTransformsFeatureFeature={name:"\u0275\u0275InputTransformsFeature",moduleName:i};static ExternalStylesFeature={name:"\u0275\u0275ExternalStylesFeature",moduleName:i};static listener={name:"\u0275\u0275listener",moduleName:i};static getInheritedFactory={name:"\u0275\u0275getInheritedFactory",moduleName:i};static sanitizeHtml={name:"\u0275\u0275sanitizeHtml",moduleName:i};static sanitizeStyle={name:"\u0275\u0275sanitizeStyle",moduleName:i};static sanitizeResourceUrl={name:"\u0275\u0275sanitizeResourceUrl",moduleName:i};static sanitizeScript={name:"\u0275\u0275sanitizeScript",moduleName:i};static sanitizeUrl={name:"\u0275\u0275sanitizeUrl",moduleName:i};static sanitizeUrlOrResourceUrl={name:"\u0275\u0275sanitizeUrlOrResourceUrl",moduleName:i};static trustConstantHtml={name:"\u0275\u0275trustConstantHtml",moduleName:i};static trustConstantResourceUrl={name:"\u0275\u0275trustConstantResourceUrl",moduleName:i};static validateIframeAttribute={name:"\u0275\u0275validateIframeAttribute",moduleName:i};static InputSignalBrandWriteType={name:"\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE",moduleName:i};static UnwrapDirectiveSignalInputs={name:"\u0275UnwrapDirectiveSignalInputs",moduleName:i};static unwrapWritableSignal={name:"\u0275unwrapWritableSignal",moduleName:i}};var St=class{full;major;minor;patch;constructor(e){this.full=e;let n=e.split(".");this.major=n[0],this.minor=n[1],this.patch=n.slice(2).join(".")}};var on;(function(t){t[t.Class=0]="Class",t[t.Function=1]="Function"})(on||(on={}));var an;(function(t){t[t.Directive=0]="Directive",t[t.Component=1]="Component",t[t.Injectable=2]="Injectable",t[t.Pipe=3]="Pipe",t[t.NgModule=4]="NgModule"})(an||(an={}));var ye=class{input;errLocation;ctxLocation;message;constructor(e,n,s,r){this.input=n,this.errLocation=s,this.ctxLocation=r,this.message=`Parser Error: ${e} ${s} [${n}] in ${r}`}},G=class{start;end;constructor(e,n){this.start=e,this.end=n}toAbsolute(e){return new O(e+this.start,e+this.end)}},E=class{span;sourceSpan;constructor(e,n){this.span=e,this.sourceSpan=n}toString(){return"AST"}},se=class extends E{nameSpan;constructor(e,n,s){super(e,n),this.nameSpan=s}},b=class extends E{visit(e,n=null){}},X=class extends E{visit(e,n=null){return e.visitImplicitReceiver(this,n)}},Et=class extends X{visit(e,n=null){var s;return(s=e.visitThisReceiver)==null?void 0:s.call(e,this,n)}},_e=class extends E{expressions;constructor(e,n,s){super(e,n),this.expressions=s}visit(e,n=null){return e.visitChain(this,n)}},Ce=class extends E{condition;trueExp;falseExp;constructor(e,n,s,r,o){super(e,n),this.condition=s,this.trueExp=r,this.falseExp=o}visit(e,n=null){return e.visitConditional(this,n)}},re=class extends se{receiver;name;constructor(e,n,s,r,o){super(e,n,s),this.receiver=r,this.name=o}visit(e,n=null){return e.visitPropertyRead(this,n)}},Te=class extends se{receiver;name;value;constructor(e,n,s,r,o,a){super(e,n,s),this.receiver=r,this.name=o,this.value=a}visit(e,n=null){return e.visitPropertyWrite(this,n)}},ie=class extends se{receiver;name;constructor(e,n,s,r,o){super(e,n,s),this.receiver=r,this.name=o}visit(e,n=null){return e.visitSafePropertyRead(this,n)}},ke=class extends E{receiver;key;constructor(e,n,s,r){super(e,n),this.receiver=s,this.key=r}visit(e,n=null){return e.visitKeyedRead(this,n)}},oe=class extends E{receiver;key;constructor(e,n,s,r){super(e,n),this.receiver=s,this.key=r}visit(e,n=null){return e.visitSafeKeyedRead(this,n)}},Ie=class extends E{receiver;key;value;constructor(e,n,s,r,o){super(e,n),this.receiver=s,this.key=r,this.value=o}visit(e,n=null){return e.visitKeyedWrite(this,n)}},be=class extends se{exp;name;args;constructor(e,n,s,r,o,a){super(e,n,a),this.exp=s,this.name=r,this.args=o}visit(e,n=null){return e.visitPipe(this,n)}},N=class extends E{value;constructor(e,n,s){super(e,n),this.value=s}visit(e,n=null){return e.visitLiteralPrimitive(this,n)}},Ne=class extends E{expressions;constructor(e,n,s){super(e,n),this.expressions=s}visit(e,n=null){return e.visitLiteralArray(this,n)}},Ae=class extends E{keys;values;constructor(e,n,s,r){super(e,n),this.keys=s,this.values=r}visit(e,n=null){return e.visitLiteralMap(this,n)}},Pe=class extends E{strings;expressions;constructor(e,n,s,r){super(e,n),this.strings=s,this.expressions=r}visit(e,n=null){return e.visitInterpolation(this,n)}},A=class extends E{operation;left;right;constructor(e,n,s,r,o){super(e,n),this.operation=s,this.left=r,this.right=o}visit(e,n=null){return e.visitBinary(this,n)}},ae=class t extends A{operator;expr;left=null;right=null;operation=null;static createMinus(e,n,s){return new t(e,n,"-",s,"-",new N(e,n,0),s)}static createPlus(e,n,s){return new t(e,n,"+",s,"-",s,new N(e,n,0))}constructor(e,n,s,r,o,a,l){super(e,n,o,a,l),this.operator=s,this.expr=r}visit(e,n=null){return e.visitUnary!==void 0?e.visitUnary(this,n):e.visitBinary(this,n)}},Le=class extends E{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitPrefixNot(this,n)}},Me=class extends E{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitTypeofExpression(this,n)}},$e=class extends E{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitNonNullAssert(this,n)}},Re=class extends E{receiver;args;argumentSpan;constructor(e,n,s,r,o){super(e,n),this.receiver=s,this.args=r,this.argumentSpan=o}visit(e,n=null){return e.visitCall(this,n)}},le=class extends E{receiver;args;argumentSpan;constructor(e,n,s,r,o){super(e,n),this.receiver=s,this.args=r,this.argumentSpan=o}visit(e,n=null){return e.visitSafeCall(this,n)}},O=class{start;end;constructor(e,n){this.start=e,this.end=n}},W=class extends E{ast;source;location;errors;constructor(e,n,s,r,o){super(new G(0,n===null?0:n.length),new O(r,n===null?r:r+n.length)),this.ast=e,this.source=n,this.location=s,this.errors=o}visit(e,n=null){return e.visitASTWithSource?e.visitASTWithSource(this,n):this.ast.visit(e,n)}toString(){return`${this.source} in ${this.location}`}},ce=class{sourceSpan;key;value;constructor(e,n,s){this.sourceSpan=e,this.key=n,this.value=s}},Be=class{sourceSpan;key;value;constructor(e,n,s){this.sourceSpan=e,this.key=n,this.value=s}},yt=class{visit(e,n){e.visit(this,n)}visitUnary(e,n){this.visit(e.expr,n)}visitBinary(e,n){this.visit(e.left,n),this.visit(e.right,n)}visitChain(e,n){this.visitAll(e.expressions,n)}visitConditional(e,n){this.visit(e.condition,n),this.visit(e.trueExp,n),this.visit(e.falseExp,n)}visitPipe(e,n){this.visit(e.exp,n),this.visitAll(e.args,n)}visitImplicitReceiver(e,n){}visitThisReceiver(e,n){}visitInterpolation(e,n){this.visitAll(e.expressions,n)}visitKeyedRead(e,n){this.visit(e.receiver,n),this.visit(e.key,n)}visitKeyedWrite(e,n){this.visit(e.receiver,n),this.visit(e.key,n),this.visit(e.value,n)}visitLiteralArray(e,n){this.visitAll(e.expressions,n)}visitLiteralMap(e,n){this.visitAll(e.values,n)}visitLiteralPrimitive(e,n){}visitPrefixNot(e,n){this.visit(e.expression,n)}visitTypeofExpression(e,n){this.visit(e.expression,n)}visitNonNullAssert(e,n){this.visit(e.expression,n)}visitPropertyRead(e,n){this.visit(e.receiver,n)}visitPropertyWrite(e,n){this.visit(e.receiver,n),this.visit(e.value,n)}visitSafePropertyRead(e,n){this.visit(e.receiver,n)}visitSafeKeyedRead(e,n){this.visit(e.receiver,n),this.visit(e.key,n)}visitCall(e,n){this.visit(e.receiver,n),this.visitAll(e.args,n)}visitSafeCall(e,n){this.visit(e.receiver,n),this.visitAll(e.args,n)}visitAll(e,n){for(let s of e)this.visit(s,n)}};var ln;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.LITERAL_ATTR=1]="LITERAL_ATTR",t[t.ANIMATION=2]="ANIMATION",t[t.TWO_WAY=3]="TWO_WAY"})(ln||(ln={}));var cn;(function(t){t[t.Regular=0]="Regular",t[t.Animation=1]="Animation",t[t.TwoWay=2]="TwoWay"})(cn||(cn={}));var H;(function(t){t[t.Property=0]="Property",t[t.Attribute=1]="Attribute",t[t.Class=2]="Class",t[t.Style=3]="Style",t[t.Animation=4]="Animation",t[t.TwoWay=5]="TwoWay"})(H||(H={}));var un;(function(t){t[t.RAW_TEXT=0]="RAW_TEXT",t[t.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",t[t.PARSABLE_DATA=2]="PARSABLE_DATA"})(un||(un={}));var Fs=[/@/,/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function Vs(t,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${t}' to be an array, [start, end].`);if(e!=null){let n=e[0],s=e[1];Fs.forEach(r=>{if(r.test(n)||r.test(s))throw new Error(`['${n}', '${s}'] contains unusable interpolation symbol.`)})}}var _t=class t{start;end;static fromArray(e){return e?(Vs("interpolation",e),new t(e[0],e[1])):Z}constructor(e,n){this.start=e,this.end=n}},Z=new _t("{{","}}");var ot=0;var Un=9,Hs=10,Us=11,Ws=12,qs=13,Wn=32,js=33,qn=34,zs=35,jn=36,Gs=37,pn=38,zn=39,je=40,me=41,Xs=42,Gn=43,ge=44,Xn=45,ee=46,Ct=47,te=58,ve=59,Js=60,qe=61,Ys=62,hn=63,Qs=48;var Ks=57,Jn=65,Zs=69;var Yn=90,ze=91,er=92,we=93,tr=94,Mt=95,Qn=97;var nr=101,sr=102,rr=110,ir=114,or=116,ar=117,lr=118;var Kn=122,Tt=123,fn=124,xe=125,Zn=160;var cr=96;function ur(t){return t>=Un&&t<=Wn||t==Zn}function j(t){return Qs<=t&&t<=Ks}function pr(t){return t>=Qn&&t<=Kn||t>=Jn&&t<=Yn}function dn(t){return t===zn||t===qn||t===cr}var mn;(function(t){t[t.WARNING=0]="WARNING",t[t.ERROR=1]="ERROR"})(mn||(mn={}));var gn;(function(t){t[t.Inline=0]="Inline",t[t.SideEffect=1]="SideEffect",t[t.Omit=2]="Omit"})(gn||(gn={}));var vn;(function(t){t[t.Global=0]="Global",t[t.Local=1]="Local"})(vn||(vn={}));var wn;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(wn||(wn={}));var hr="(:(where|is)\\()?";var es="-shadowcsshost",ts="-shadowcsscontext",$t="(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",Jr=new RegExp(es+$t,"gim"),Yr=new RegExp(hr+"("+ts+$t+")","gim"),Qr=new RegExp(ts+$t,"im"),fr=es+"-no-combinator",Kr=new RegExp(`${fr}(?![^(]*\\))`,"g");var ns="%COMMENT%",Zr=new RegExp(ns,"g");var ei=new RegExp(`(\\s*(?:${ns}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g");var dr="%COMMA_IN_PLACEHOLDER%",mr="%SEMI_IN_PLACEHOLDER%",gr="%COLON_IN_PLACEHOLDER%",ti=new RegExp(dr,"g"),ni=new RegExp(mr,"g"),si=new RegExp(gr,"g");var f;(function(t){t[t.ListEnd=0]="ListEnd",t[t.Statement=1]="Statement",t[t.Variable=2]="Variable",t[t.ElementStart=3]="ElementStart",t[t.Element=4]="Element",t[t.Template=5]="Template",t[t.ElementEnd=6]="ElementEnd",t[t.ContainerStart=7]="ContainerStart",t[t.Container=8]="Container",t[t.ContainerEnd=9]="ContainerEnd",t[t.DisableBindings=10]="DisableBindings",t[t.Conditional=11]="Conditional",t[t.EnableBindings=12]="EnableBindings",t[t.Text=13]="Text",t[t.Listener=14]="Listener",t[t.InterpolateText=15]="InterpolateText",t[t.Binding=16]="Binding",t[t.Property=17]="Property",t[t.StyleProp=18]="StyleProp",t[t.ClassProp=19]="ClassProp",t[t.StyleMap=20]="StyleMap",t[t.ClassMap=21]="ClassMap",t[t.Advance=22]="Advance",t[t.Pipe=23]="Pipe",t[t.Attribute=24]="Attribute",t[t.ExtractedAttribute=25]="ExtractedAttribute",t[t.Defer=26]="Defer",t[t.DeferOn=27]="DeferOn",t[t.DeferWhen=28]="DeferWhen",t[t.I18nMessage=29]="I18nMessage",t[t.HostProperty=30]="HostProperty",t[t.Namespace=31]="Namespace",t[t.ProjectionDef=32]="ProjectionDef",t[t.Projection=33]="Projection",t[t.RepeaterCreate=34]="RepeaterCreate",t[t.Repeater=35]="Repeater",t[t.TwoWayProperty=36]="TwoWayProperty",t[t.TwoWayListener=37]="TwoWayListener",t[t.DeclareLet=38]="DeclareLet",t[t.StoreLet=39]="StoreLet",t[t.I18nStart=40]="I18nStart",t[t.I18n=41]="I18n",t[t.I18nEnd=42]="I18nEnd",t[t.I18nExpression=43]="I18nExpression",t[t.I18nApply=44]="I18nApply",t[t.IcuStart=45]="IcuStart",t[t.IcuEnd=46]="IcuEnd",t[t.IcuPlaceholder=47]="IcuPlaceholder",t[t.I18nContext=48]="I18nContext",t[t.I18nAttributes=49]="I18nAttributes",t[t.SourceLocation=50]="SourceLocation"})(f||(f={}));var J;(function(t){t[t.LexicalRead=0]="LexicalRead",t[t.Context=1]="Context",t[t.TrackContext=2]="TrackContext",t[t.ReadVariable=3]="ReadVariable",t[t.NextContext=4]="NextContext",t[t.Reference=5]="Reference",t[t.StoreLet=6]="StoreLet",t[t.ContextLetReference=7]="ContextLetReference",t[t.GetCurrentView=8]="GetCurrentView",t[t.RestoreView=9]="RestoreView",t[t.ResetView=10]="ResetView",t[t.PureFunctionExpr=11]="PureFunctionExpr",t[t.PureFunctionParameterExpr=12]="PureFunctionParameterExpr",t[t.PipeBinding=13]="PipeBinding",t[t.PipeBindingVariadic=14]="PipeBindingVariadic",t[t.SafePropertyRead=15]="SafePropertyRead",t[t.SafeKeyedRead=16]="SafeKeyedRead",t[t.SafeInvokeFunction=17]="SafeInvokeFunction",t[t.SafeTernaryExpr=18]="SafeTernaryExpr",t[t.EmptyExpr=19]="EmptyExpr",t[t.AssignTemporaryExpr=20]="AssignTemporaryExpr",t[t.ReadTemporaryExpr=21]="ReadTemporaryExpr",t[t.SlotLiteralExpr=22]="SlotLiteralExpr",t[t.ConditionalCase=23]="ConditionalCase",t[t.ConstCollected=24]="ConstCollected",t[t.TwoWayBindingSet=25]="TwoWayBindingSet"})(J||(J={}));var xn;(function(t){t[t.None=0]="None",t[t.AlwaysInline=1]="AlwaysInline"})(xn||(xn={}));var Sn;(function(t){t[t.Context=0]="Context",t[t.Identifier=1]="Identifier",t[t.SavedView=2]="SavedView",t[t.Alias=3]="Alias"})(Sn||(Sn={}));var En;(function(t){t[t.Normal=0]="Normal",t[t.TemplateDefinitionBuilder=1]="TemplateDefinitionBuilder"})(En||(En={}));var U;(function(t){t[t.Attribute=0]="Attribute",t[t.ClassName=1]="ClassName",t[t.StyleProperty=2]="StyleProperty",t[t.Property=3]="Property",t[t.Template=4]="Template",t[t.I18n=5]="I18n",t[t.Animation=6]="Animation",t[t.TwoWayProperty=7]="TwoWayProperty"})(U||(U={}));var yn;(function(t){t[t.Creation=0]="Creation",t[t.Postproccessing=1]="Postproccessing"})(yn||(yn={}));var _n;(function(t){t[t.I18nText=0]="I18nText",t[t.I18nAttribute=1]="I18nAttribute"})(_n||(_n={}));var Cn;(function(t){t[t.None=0]="None",t[t.ElementTag=1]="ElementTag",t[t.TemplateTag=2]="TemplateTag",t[t.OpenTag=4]="OpenTag",t[t.CloseTag=8]="CloseTag",t[t.ExpressionIndex=16]="ExpressionIndex"})(Cn||(Cn={}));var Tn;(function(t){t[t.HTML=0]="HTML",t[t.SVG=1]="SVG",t[t.Math=2]="Math"})(Tn||(Tn={}));var kn;(function(t){t[t.Idle=0]="Idle",t[t.Immediate=1]="Immediate",t[t.Timer=2]="Timer",t[t.Hover=3]="Hover",t[t.Interaction=4]="Interaction",t[t.Viewport=5]="Viewport",t[t.Never=6]="Never"})(kn||(kn={}));var In;(function(t){t[t.RootI18n=0]="RootI18n",t[t.Icu=1]="Icu",t[t.Attr=2]="Attr"})(In||(In={}));var bn;(function(t){t[t.NgTemplate=0]="NgTemplate",t[t.Structural=1]="Structural",t[t.Block=2]="Block"})(bn||(bn={}));var vr=Symbol("ConsumesSlot"),ss=Symbol("DependsOnSlotContext"),Oe=Symbol("ConsumesVars"),Rt=Symbol("UsesVarOffset"),ri={[vr]:!0,numSlotsUsed:1},ii={[ss]:!0},oi={[Oe]:!0};var Ze=class{strings;expressions;i18nPlaceholders;constructor(e,n,s){if(this.strings=e,this.expressions=n,this.i18nPlaceholders=s,s.length!==0&&s.length!==n.length)throw new Error(`Expected ${n.length} placeholders to match interpolation expression count, but got ${s.length}`)}};var Y=class extends k{constructor(e=null){super(null,e)}};var Nn=class t extends Y{target;value;sourceSpan;kind=J.StoreLet;[Oe]=!0;[ss]=!0;constructor(e,n,s){super(),this.target=e,this.value=n,this.sourceSpan=s}visitExpression(){}isEquivalent(e){return e instanceof t&&e.target===this.target&&e.value.isEquivalent(this.value)}isConstant(){return!1}transformInternalExpressions(e,n){this.value=(this.value,void 0)}clone(){return new t(this.target,this.value,this.sourceSpan)}};var An=class t extends Y{kind=J.PureFunctionExpr;[Oe]=!0;[Rt]=!0;varOffset=null;body;args;fn=null;constructor(e,n){super(),this.body=e,this.args=n}visitExpression(e,n){var s;(s=this.body)==null||s.visitExpression(e,n);for(let r of this.args)r.visitExpression(e,n)}isEquivalent(e){return!(e instanceof t)||e.args.length!==this.args.length?!1:e.body!==null&&this.body!==null&&e.body.isEquivalent(this.body)&&e.args.every((n,s)=>n.isEquivalent(this.args[s]))}isConstant(){return!1}transformInternalExpressions(e,n){this.body!==null?this.body=(this.body,n|bt.InChildOperation,void 0):this.fn!==null&&(this.fn=(this.fn,void 0));for(let s=0;sr.clone()));return e.fn=((s=this.fn)==null?void 0:s.clone())??null,e.varOffset=this.varOffset,e}};var kt=class t extends Y{target;targetSlot;name;args;kind=J.PipeBinding;[Oe]=!0;[Rt]=!0;varOffset=null;constructor(e,n,s,r){super(),this.target=e,this.targetSlot=n,this.name=s,this.args=r}visitExpression(e,n){for(let s of this.args)s.visitExpression(e,n)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(e,n){for(let s=0;sn.clone()));return e.varOffset=this.varOffset,e}},Pn=class t extends Y{target;targetSlot;name;args;numArgs;kind=J.PipeBindingVariadic;[Oe]=!0;[Rt]=!0;varOffset=null;constructor(e,n,s,r,o){super(),this.target=e,this.targetSlot=n,this.name=s,this.args=r,this.numArgs=o}visitExpression(e,n){this.args.visitExpression(e,n)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(e,n){this.args=(this.args,void 0)}clone(){let e=new t(this.target,this.targetSlot,this.name,this.args.clone(),this.numArgs);return e.varOffset=this.varOffset,e}};var It=class t extends Y{receiver;args;kind=J.SafeInvokeFunction;constructor(e,n){super(),this.receiver=e,this.args=n}visitExpression(e,n){this.receiver.visitExpression(e,n);for(let s of this.args)s.visitExpression(e,n)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(e,n){this.receiver=(this.receiver,void 0);for(let s=0;se.clone()))}};var bt;(function(t){t[t.None=0]="None",t[t.InChildOperation=1]="InChildOperation"})(bt||(bt={}));var ai=new Set([f.Element,f.ElementStart,f.Container,f.ContainerStart,f.Template,f.RepeaterCreate]);var Ln;(function(t){t[t.Tmpl=0]="Tmpl",t[t.Host=1]="Host",t[t.Both=2]="Both"})(Ln||(Ln={}));var li=Object.freeze([]);var ci=new Map([[f.ElementEnd,[f.ElementStart,f.Element]],[f.ContainerEnd,[f.ContainerStart,f.Container]],[f.I18nEnd,[f.I18nStart,f.I18n]]]),ui=new Set([f.Pipe]);var pi=[Xe,Ye,Qe,It,kt].map(t=>t.constructor.name);var wr={},xr="\uE500";wr.ngsp=xr;var Mn;(function(t){t.HEX="hexadecimal",t.DEC="decimal"})(Mn||(Mn={}));var rs=` \f +\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,hi=new RegExp(`[^${rs}]`),fi=new RegExp(`[${rs}]{2,}`,"g");var d;(function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.PrivateIdentifier=2]="PrivateIdentifier",t[t.Keyword=3]="Keyword",t[t.String=4]="String",t[t.Operator=5]="Operator",t[t.Number=6]="Number",t[t.Error=7]="Error"})(d||(d={}));var Sr=["var","let","as","null","undefined","true","false","if","else","this","typeof"],De=class{tokenize(e){let n=new Nt(e),s=[],r=n.scanToken();for(;r!=null;)s.push(r),r=n.scanToken();return s}},M=class{index;end;type;numValue;strValue;constructor(e,n,s,r,o){this.index=e,this.end=n,this.type=s,this.numValue=r,this.strValue=o}isCharacter(e){return this.type==d.Character&&this.numValue==e}isNumber(){return this.type==d.Number}isString(){return this.type==d.String}isOperator(e){return this.type==d.Operator&&this.strValue==e}isIdentifier(){return this.type==d.Identifier}isPrivateIdentifier(){return this.type==d.PrivateIdentifier}isKeyword(){return this.type==d.Keyword}isKeywordLet(){return this.type==d.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==d.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==d.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==d.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==d.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==d.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==d.Keyword&&this.strValue=="this"}isKeywordTypeof(){return this.type===d.Keyword&&this.strValue==="typeof"}isError(){return this.type==d.Error}toNumber(){return this.type==d.Number?this.numValue:-1}toString(){switch(this.type){case d.Character:case d.Identifier:case d.Keyword:case d.Operator:case d.PrivateIdentifier:case d.String:case d.Error:return this.strValue;case d.Number:return this.numValue.toString();default:return null}}};function $n(t,e,n){return new M(t,e,d.Character,n,String.fromCharCode(n))}function Er(t,e,n){return new M(t,e,d.Identifier,0,n)}function yr(t,e,n){return new M(t,e,d.PrivateIdentifier,0,n)}function _r(t,e,n){return new M(t,e,d.Keyword,0,n)}function at(t,e,n){return new M(t,e,d.Operator,0,n)}function Cr(t,e,n){return new M(t,e,d.String,0,n)}function Tr(t,e,n){return new M(t,e,d.Number,n,"")}function kr(t,e,n){return new M(t,e,d.Error,0,n)}var lt=new M(-1,-1,d.Character,0,""),Nt=class{input;length;peek=0;index=-1;constructor(e){this.input=e,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?ot:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,n=this.length,s=this.peek,r=this.index;for(;s<=Wn;)if(++r>=n){s=ot;break}else s=e.charCodeAt(r);if(this.peek=s,this.index=r,r>=n)return null;if(Rn(s))return this.scanIdentifier();if(j(s))return this.scanNumber(r);let o=r;switch(s){case ee:return this.advance(),j(this.peek)?this.scanNumber(o):$n(o,this.index,ee);case je:case me:case Tt:case xe:case ze:case we:case ge:case te:case ve:return this.scanCharacter(o,s);case zn:case qn:return this.scanString();case zs:return this.scanPrivateIdentifier();case Gn:case Xn:case Xs:case Ct:case Gs:case tr:return this.scanOperator(o,String.fromCharCode(s));case hn:return this.scanQuestion(o);case Js:case Ys:return this.scanComplexOperator(o,String.fromCharCode(s),qe,"=");case js:case qe:return this.scanComplexOperator(o,String.fromCharCode(s),qe,"=",qe,"=");case pn:return this.scanComplexOperator(o,"&",pn,"&");case fn:return this.scanComplexOperator(o,"|",fn,"|");case Zn:for(;ur(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,n){return this.advance(),$n(e,this.index,n)}scanOperator(e,n){return this.advance(),at(e,this.index,n)}scanComplexOperator(e,n,s,r,o,a){this.advance();let l=n;return this.peek==s&&(this.advance(),l+=r),o!=null&&this.peek==o&&(this.advance(),l+=a),at(e,this.index,l)}scanIdentifier(){let e=this.index;for(this.advance();Bn(this.peek);)this.advance();let n=this.input.substring(e,this.index);return Sr.indexOf(n)>-1?_r(e,this.index,n):Er(e,this.index,n)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!Rn(this.peek))return this.error("Invalid character [#]",-1);for(;Bn(this.peek);)this.advance();let n=this.input.substring(e,this.index);return yr(e,this.index,n)}scanNumber(e){let n=this.index===e,s=!1;for(this.advance();;){if(!j(this.peek))if(this.peek===Mt){if(!j(this.input.charCodeAt(this.index-1))||!j(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===ee)n=!1;else if(Ir(this.peek)){if(this.advance(),br(this.peek)&&this.advance(),!j(this.peek))return this.error("Invalid exponent",-1);n=!1}else break;this.advance()}let r=this.input.substring(e,this.index);s&&(r=r.replace(/_/g,""));let o=n?Ar(r):parseFloat(r);return Tr(e,this.index,o)}scanString(){let e=this.index,n=this.peek;this.advance();let s="",r=this.index,o=this.input;for(;this.peek!=n;)if(this.peek==er){s+=o.substring(r,this.index);let l;if(this.advance(),this.peek==ar){let u=o.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(u))l=parseInt(u,16);else return this.error(`Invalid unicode escape [\\u${u}]`,0);for(let h=0;h<5;h++)this.advance()}else l=Nr(this.peek),this.advance();s+=String.fromCharCode(l),r=this.index}else{if(this.peek==ot)return this.error("Unterminated quote",0);this.advance()}let a=o.substring(r,this.index);return this.advance(),Cr(e,this.index,s+a)}scanQuestion(e){this.advance();let n="?";return(this.peek===hn||this.peek===ee)&&(n+=this.peek===ee?".":"?",this.advance()),at(e,this.index,n)}error(e,n){let s=this.index+n;return kr(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}};function Rn(t){return Qn<=t&&t<=Kn||Jn<=t&&t<=Yn||t==Mt||t==jn}function Bn(t){return pr(t)||j(t)||t==Mt||t==jn}function Ir(t){return t==nr||t==Zs}function br(t){return t==Xn||t==Gn}function Nr(t){switch(t){case rr:return Hs;case sr:return Ws;case ir:return qs;case or:return Un;case lr:return Us;default:return t}}function Ar(t){let e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e}var At=class{strings;expressions;offsets;constructor(e,n,s){this.strings=e,this.expressions=n,this.offsets=s}},Pt=class{templateBindings;warnings;errors;constructor(e,n,s){this.templateBindings=e,this.warnings=n,this.errors=s}},ue=class{_lexer;errors=[];constructor(e){this._lexer=e}parseAction(e,n,s,r=Z){this._checkNoInterpolation(e,n,r);let o=this._stripComments(e),a=this._lexer.tokenize(o),l=new z(e,n,s,a,1,this.errors,0).parseChain();return new W(l,e,n,s,this.errors)}parseBinding(e,n,s,r=Z){let o=this._parseBindingAst(e,n,s,r);return new W(o,e,n,s,this.errors)}checkSimpleExpression(e){let n=new Lt;return e.visit(n),n.errors}parseSimpleBinding(e,n,s,r=Z){let o=this._parseBindingAst(e,n,s,r),a=this.checkSimpleExpression(o);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,n),new W(o,e,n,s,this.errors)}_reportError(e,n,s,r){this.errors.push(new ye(e,n,s,r))}_parseBindingAst(e,n,s,r){this._checkNoInterpolation(e,n,r);let o=this._stripComments(e),a=this._lexer.tokenize(o);return new z(e,n,s,a,0,this.errors,0).parseChain()}parseTemplateBindings(e,n,s,r,o){let a=this._lexer.tokenize(n);return new z(n,s,o,a,0,this.errors,0).parseTemplateBindings({source:e,span:new O(r,r+e.length)})}parseInterpolation(e,n,s,r,o=Z){let{strings:a,expressions:l,offsets:u}=this.splitInterpolation(e,n,r,o);if(l.length===0)return null;let h=[];for(let g=0;gg.text),h,e,n,s)}parseInterpolationExpression(e,n,s){let r=this._stripComments(e),o=this._lexer.tokenize(r),a=new z(e,n,s,o,0,this.errors,0).parseChain(),l=["",""];return this.createInterpolationAst(l,[a],e,n,s)}createInterpolationAst(e,n,s,r,o){let a=new G(0,s.length),l=new Pe(a,a.toAbsolute(o),e,n);return new W(l,s,r,o,this.errors)}splitInterpolation(e,n,s,r=Z){let o=[],a=[],l=[],u=s?Pr(s):null,h=0,g=!1,S=!1,{start:w,end:y}=r;for(;h-1)break;o>-1&&a>-1&&this._reportError(`Got interpolation (${s}${r}) where expression was expected`,e,`at column ${o} in`,n)}_getInterpolationEndIndex(e,n,s){for(let r of this._forEachUnquotedChar(e,s)){if(e.startsWith(n,r))return r;if(e.startsWith("//",r))return e.indexOf(n,r)}return-1}*_forEachUnquotedChar(e,n){let s=null,r=0;for(let o=n;o=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,n){let s=this.currentEndIndex;if(n!==void 0&&n>this.currentEndIndex&&(s=n),e>s){let r=s;s=e,e=r}return new G(e,s)}sourceSpan(e,n){let s=`${e}@${this.inputIndex}:${n}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,n).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,n){this.context|=e;let s=n();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===lt?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],n=this.inputIndex;for(;this.index":case"<=":case">=":this.advance();let r=this.parseAdditive();n=new A(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parseAdditive(){let e=this.inputIndex,n=this.parseMultiplicative();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let r=this.parseMultiplicative();n=new A(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parseMultiplicative(){let e=this.inputIndex,n=this.parsePrefix();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let r=this.parsePrefix();n=new A(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parsePrefix(){if(this.next.type==d.Operator){let e=this.inputIndex,n=this.next.strValue,s;switch(n){case"+":return this.advance(),s=this.parsePrefix(),ae.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),ae.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new Le(this.span(e),this.sourceSpan(e),s)}}else if(this.next.isKeywordTypeof()){this.advance();let e=this.inputIndex,n=this.parsePrefix();return new Me(this.span(e),this.sourceSpan(e),n)}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,n=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(ee))n=this.parseAccessMember(n,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(je)?n=this.parseCall(n,e,!0):n=this.consumeOptionalCharacter(ze)?this.parseKeyedReadOrWrite(n,e,!0):this.parseAccessMember(n,e,!0);else if(this.consumeOptionalCharacter(ze))n=this.parseKeyedReadOrWrite(n,e,!1);else if(this.consumeOptionalCharacter(je))n=this.parseCall(n,e,!1);else if(this.consumeOptionalOperator("!"))n=new $e(this.span(e),this.sourceSpan(e),n);else return n}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(je)){this.rparensExpected++;let n=this.parsePipe();return this.rparensExpected--,this.expectCharacter(me),n}else{if(this.next.isKeywordNull())return this.advance(),new N(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new N(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new N(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new N(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new Et(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(ze)){this.rbracketsExpected++;let n=this.parseExpressionList(we);return this.rbracketsExpected--,this.expectCharacter(we),new Ne(this.span(e),this.sourceSpan(e),n)}else{if(this.next.isCharacter(Tt))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new X(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let n=this.next.toNumber();return this.advance(),new N(this.span(e),this.sourceSpan(e),n)}else if(this.next.isString()){let n=this.next.toString();return this.advance(),new N(this.span(e),this.sourceSpan(e),n)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new b(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new b(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new b(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let n=[];do if(!this.next.isCharacter(e))n.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(ge));return n}parseLiteralMap(){let e=[],n=[],s=this.inputIndex;if(this.expectCharacter(Tt),!this.consumeOptionalCharacter(xe)){this.rbracesExpected++;do{let r=this.inputIndex,o=this.next.isString(),a=this.expectIdentifierOrKeywordOrString(),l={key:a,quoted:o};if(e.push(l),o)this.expectCharacter(te),n.push(this.parsePipe());else if(this.consumeOptionalCharacter(te))n.push(this.parsePipe());else{l.isShorthandInitialized=!0;let u=this.span(r),h=this.sourceSpan(r);n.push(new re(u,h,h,new X(u,h),a))}}while(this.consumeOptionalCharacter(ge)&&!this.next.isCharacter(xe));this.rbracesExpected--,this.expectCharacter(xe)}return new Ae(this.span(s),this.sourceSpan(s),e,n)}parseAccessMember(e,n,s){let r=this.inputIndex,o=this.withContext(ne.Writable,()=>{let u=this.expectIdentifierOrKeyword()??"";return u.length===0&&this.error("Expected identifier for property access",e.span.end),u}),a=this.sourceSpan(r),l;if(s)this.consumeOptionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),l=new b(this.span(n),this.sourceSpan(n))):l=new ie(this.span(n),this.sourceSpan(n),a,e,o);else if(this.consumeOptionalOperator("=")){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new b(this.span(n),this.sourceSpan(n));let u=this.parseConditional();l=new Te(this.span(n),this.sourceSpan(n),a,e,o,u)}else l=new re(this.span(n),this.sourceSpan(n),a,e,o);return l}parseCall(e,n,s){let r=this.inputIndex;this.rparensExpected++;let o=this.parseCallArguments(),a=this.span(r,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(me),this.rparensExpected--;let l=this.span(n),u=this.sourceSpan(n);return s?new le(l,u,e,o,a):new Re(l,u,e,o,a)}parseCallArguments(){if(this.next.isCharacter(me))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(ge));return e}expectTemplateBindingKey(){let e="",n=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),n=this.consumeOptionalOperator("-"),n&&(e+="-");while(n);return{source:e,span:new O(s,s+e.length)}}parseTemplateBindings(e){let n=[];for(n.push(...this.parseDirectiveKeywordBindings(e));this.index{this.rbracketsExpected++;let r=this.parsePipe();if(r instanceof b&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(we),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let o=this.parseConditional();return new Ie(this.span(n),this.sourceSpan(n),e,r,o)}else return s?new oe(this.span(n),this.sourceSpan(n),e,r):new ke(this.span(n),this.sourceSpan(n),e,r);return new b(this.span(n),this.sourceSpan(n))})}parseDirectiveKeywordBindings(e){let n=[];this.consumeOptionalCharacter(te);let s=this.getDirectiveBoundTarget(),r=this.currentAbsoluteOffset,o=this.parseAsBinding(e);o||(this.consumeStatementTerminator(),r=this.currentAbsoluteOffset);let a=new O(e.span.start,r);return n.push(new Be(a,e,s)),o&&n.push(o),n}getDirectiveBoundTarget(){if(this.next===lt||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:n,end:s}=e.span,r=this.input.substring(n,s);return new W(e,r,this.location,this.absoluteOffset+n,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let n=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new O(e.span.start,this.currentAbsoluteOffset);return new ce(s,n,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let n=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let r=new O(e,this.currentAbsoluteOffset);return new ce(r,n,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(ve)||this.consumeOptionalCharacter(ge)}error(e,n=null){this.errors.push(new ye(e,this.input,this.locationText(n),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),el+u.length,0);s+=a,n+=a}e.set(s,n),r++}return e}var Lr=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),di=Array.from(Lr).reduce((t,[e,n])=>(t.set(e,n),t),new Map);var mi=new ue(new De);function D(t){return e=>e.kind===t}function Se(t,e){return n=>n.kind===t&&e===n.expression instanceof Ze}function Mr(t){return(t.kind===f.Property||t.kind===f.TwoWayProperty)&&!(t.expression instanceof Ze)}var gi=[{test:D(f.StyleMap),transform:et},{test:D(f.ClassMap),transform:et},{test:D(f.StyleProp)},{test:D(f.ClassProp)},{test:Se(f.Attribute,!0)},{test:Se(f.Property,!0)},{test:Mr},{test:Se(f.Attribute,!1)}],vi=[{test:Se(f.HostProperty,!0)},{test:Se(f.HostProperty,!1)},{test:D(f.Attribute)},{test:D(f.StyleMap),transform:et},{test:D(f.ClassMap),transform:et},{test:D(f.StyleProp)},{test:D(f.ClassProp)}],wi=new Set([f.Listener,f.TwoWayListener,f.StyleMap,f.ClassMap,f.StyleProp,f.ClassProp,f.Property,f.TwoWayProperty,f.HostProperty,f.Attribute]);function et(t){return t.slice(t.length-1)}var xi=new Map([["window",P.resolveWindow],["document",P.resolveDocument],["body",P.resolveBody]]);var Si=new Map([[B.HTML,P.sanitizeHtml],[B.RESOURCE_URL,P.sanitizeResourceUrl],[B.SCRIPT,P.sanitizeScript],[B.STYLE,P.sanitizeStyle],[B.URL,P.sanitizeUrl]]),Ei=new Map([[B.HTML,P.trustConstantHtml],[B.RESOURCE_URL,P.trustConstantResourceUrl]]);var Dn;(function(t){t[t.None=0]="None",t[t.ViewContextRead=1]="ViewContextRead",t[t.ViewContextWrite=2]="ViewContextWrite",t[t.SideEffectful=4]="SideEffectful"})(Dn||(Dn={}));var yi=new Map([[H.Property,U.Property],[H.TwoWay,U.TwoWayProperty],[H.Attribute,U.Attribute],[H.Class,U.ClassName],[H.Style,U.StyleProperty],[H.Animation,U.Animation]]);var _i=Symbol("queryAdvancePlaceholder");var On;(function(t){t[t.NG_CONTENT=0]="NG_CONTENT",t[t.STYLE=1]="STYLE",t[t.STYLESHEET=2]="STYLESHEET",t[t.SCRIPT=3]="SCRIPT",t[t.OTHER=4]="OTHER"})(On||(On={}));var Fn;(function(t){t.IDLE="idle",t.TIMER="timer",t.INTERACTION="interaction",t.IMMEDIATE="immediate",t.HOVER="hover",t.VIEWPORT="viewport",t.NEVER="never"})(Fn||(Fn={}));var is="%COMP%",Ci=`_nghost-${is}`,Ti=`_ngcontent-${is}`;var ki=new St("19.1.2");var Vn;(function(t){t[t.Extract=0]="Extract",t[t.Merge=1]="Merge"})(Vn||(Vn={}));var Hn;(function(t){t[t.Directive=0]="Directive",t[t.Component=1]="Component",t[t.Injectable=2]="Injectable",t[t.Pipe=3]="Pipe",t[t.NgModule=4]="NgModule"})(Hn||(Hn={}));function os({start:t,end:e},n){let s=t,r=e;for(;r!==s&&/\s/.test(n[r-1]);)r--;for(;s!==r&&/\s/.test(n[s]);)s++;return{start:s,end:r}}function Rr({start:t,end:e},n){let s=t,r=e;for(;r!==n.length&&/\s/.test(n[r]);)r++;for(;s!==0&&/\s/.test(n[s-1]);)s--;return{start:s,end:r}}function Br(t,e){return e[t.start-1]==="("&&e[t.end]===")"?{start:t.start-1,end:t.end+1}:t}function as(t,e,n){let s=0,r={start:t.start,end:t.end};for(;;){let o=Rr(r,e),a=Br(o,e);if(o.start===a.start&&o.end===a.end)break;r.start=a.start,r.end=a.end,s++}return{hasParens:(n?s-1:s)!==0,outerSpan:os(n?{start:r.start+1,end:r.end-1}:r,e),innerSpan:os(t,e)}}function ls(t){return typeof t=="string"?e=>e===t:e=>t.test(e)}function cs(t,e,n){let s=ls(e);for(let r=n;r>=0;r--){let o=t[r];if(s(o))return r}throw new Error(`Cannot find front char ${e} from index ${n} in ${JSON.stringify(t)}`)}function us(t,e,n){let s=ls(e);for(let r=n;rue.prototype._commentStart(t);function Or(t,e){let n=e?Dr(t):null;if(n===null)return{text:t,comments:[]};let s={type:"CommentLine",value:t.slice(n+2),...Fe({start:n,end:t.length})};return{text:t.slice(0,n),comments:[s]}}function Ve(t,e=!0){return n=>{let s=new De,r=new ue(s),{text:o,comments:a}=Or(n,e),l=t(o,r);if(l.errors.length!==0){let[{message:u}]=l.errors;throw new SyntaxError(u.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}return{result:l,comments:a,text:o}}}var hs=Ve((t,e)=>e.parseBinding(t,"",0)),Fr=Ve((t,e)=>e.parseSimpleBinding(t,"",0)),fs=Ve((t,e)=>e.parseAction(t,"",0)),ds=Ve((t,e)=>e.parseInterpolationExpression(t,"",0)),ms=Ve((t,e)=>e.parseTemplateBindings("",t,"",0,0),!1);var Hr=(t,e,n)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[n<0?e.length+n:n]:e.at(n)},nt=Hr;var Bt=class{text;constructor(e){this.text=e}getCharacterIndex(e,n){return us(this.text,e,n)}getCharacterLastIndex(e,n){return cs(this.text,e,n)}transformSpan(e,{stripSpaces:n=!1,hasParentParens:s=!1}={}){if(!n)return Fe(e);let{outerSpan:r,innerSpan:o,hasParens:a}=as(e,this.text,s),l=Fe(o);return a&&(l.extra={parenthesized:!0,parenStart:r.start,parenEnd:r.end}),l}createNode(e,{stripSpaces:n=!0,hasParentParens:s=!1}={}){let{type:r,start:o,end:a}=e,l={...e,...this.transformSpan({start:o,end:a},{stripSpaces:n,hasParentParens:s})};switch(r){case"NumericLiteral":case"StringLiteral":{let u=this.text.slice(l.start,l.end),{value:h}=l;l.extra={...l.extra,raw:u,rawValue:h};break}case"ObjectProperty":{let{shorthand:u}=l;u&&(l.extra={...l.extra,shorthand:u});break}}return l}},gs=Bt;function Ot(t){var e;return!!((e=t.extra)!=null&&e.parenthesized)}function $(t){return Ot(t)?t.extra.parenStart:t.start}function R(t){return Ot(t)?t.extra.parenEnd:t.end}function vs(t){return(t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression")&&!Ot(t)}function ws(t,e){let{start:n,end:s}=t.sourceSpan;return n>=s||/^\s+$/.test(e.slice(n,s))}var We,pe,p,v,He,x,Dt,Ue=class extends gs{constructor(n,s){super(s);V(this,p);V(this,We);V(this,pe);K(this,We,n),K(this,pe,s)}get node(){return c(this,p,x).call(this,L(this,We))}transformNode(n){return c(this,p,Dt).call(this,n)}};We=new WeakMap,pe=new WeakMap,p=new WeakSet,v=function(n,{stripSpaces:s=!0,hasParentParens:r=!1}={}){return this.createNode(n,{stripSpaces:s,hasParentParens:r})},He=function(n,s,{computed:r,optional:o,end:a=R(s),hasParentParens:l=!1}){if(ws(n,L(this,pe))||n.sourceSpan.start===s.start)return s;let u=c(this,p,x).call(this,n),h=vs(u);return c(this,p,v).call(this,{type:o||h?"OptionalMemberExpression":"MemberExpression",object:u,property:s,computed:r,...o?{optional:!0}:h?{optional:!1}:void 0,start:$(u),end:a},{hasParentParens:l})},x=function(n,s=!1){return c(this,p,Dt).call(this,n,s)},Dt=function(n,s=!1){if(n instanceof Pe){let{expressions:o}=n;if(o.length!==1)throw new Error("Unexpected 'Interpolation'");return c(this,p,x).call(this,o[0])}if(n instanceof ae)return c(this,p,v).call(this,{type:"UnaryExpression",prefix:!0,argument:c(this,p,x).call(this,n.expr),operator:n.operator,...n.sourceSpan},{hasParentParens:s});if(n instanceof A){let{left:o,operation:a,right:l}=n,u=c(this,p,x).call(this,o),h=c(this,p,x).call(this,l),g=$(u),S=R(h),w={left:u,right:h,start:g,end:S};return a==="&&"||a==="||"||a==="??"?c(this,p,v).call(this,{...w,type:"LogicalExpression",operator:a},{hasParentParens:s}):c(this,p,v).call(this,{...w,type:"BinaryExpression",operator:a},{hasParentParens:s})}if(n instanceof be){let{exp:o,name:a,args:l}=n,u=c(this,p,x).call(this,o),h=$(u),g=R(u),S=this.getCharacterIndex(/\S/,this.getCharacterIndex("|",g)+1),w=c(this,p,v).call(this,{type:"Identifier",name:a,start:S,end:S+a.length}),y=l.map(T=>c(this,p,x).call(this,T));return c(this,p,v).call(this,{type:"NGPipeExpression",left:u,right:w,arguments:y,start:h,end:R(y.length===0?w:nt(!1,y,-1))},{hasParentParens:s})}if(n instanceof _e)return c(this,p,v).call(this,{type:"NGChainedExpression",expressions:n.expressions.map(o=>c(this,p,x).call(this,o)),...n.sourceSpan},{hasParentParens:s});if(n instanceof Ce){let{condition:o,trueExp:a,falseExp:l}=n,u=c(this,p,x).call(this,o),h=c(this,p,x).call(this,a),g=c(this,p,x).call(this,l);return c(this,p,v).call(this,{type:"ConditionalExpression",test:u,consequent:h,alternate:g,start:$(u),end:R(g)},{hasParentParens:s})}if(n instanceof b)return c(this,p,v).call(this,{type:"NGEmptyExpression",...n.sourceSpan},{hasParentParens:s});if(n instanceof X)return c(this,p,v).call(this,{type:"ThisExpression",...n.sourceSpan},{hasParentParens:s});if(n instanceof ke||n instanceof oe)return c(this,p,He).call(this,n.receiver,c(this,p,x).call(this,n.key),{computed:!0,optional:n instanceof oe,end:n.sourceSpan.end,hasParentParens:s});if(n instanceof Ne)return c(this,p,v).call(this,{type:"ArrayExpression",elements:n.expressions.map(o=>c(this,p,x).call(this,o)),...n.sourceSpan},{hasParentParens:s});if(n instanceof Ae){let{keys:o,values:a}=n,l=a.map(h=>c(this,p,x).call(this,h)),u=o.map(({key:h,quoted:g},S)=>{let w=l[S],y=$(w),T=R(w),F=this.getCharacterIndex(/\S/,S===0?n.sourceSpan.start+1:this.getCharacterIndex(",",R(l[S-1]))+1),fe=y===F?T:this.getCharacterLastIndex(/\S/,this.getCharacterLastIndex(":",y-1)-1)+1,de={start:F,end:fe},q=g?c(this,p,v).call(this,{type:"StringLiteral",value:h,...de}):c(this,p,v).call(this,{type:"Identifier",name:h,...de}),Gt=q.endc(this,p,x).call(this,w)),h=c(this,p,x).call(this,a),g=vs(h),S=o||g?"OptionalCallExpression":"CallExpression";return c(this,p,v).call(this,{type:S,callee:h,arguments:u,optional:S==="OptionalCallExpression"?o:void 0,start:$(h),end:n.sourceSpan.end},{hasParentParens:s})}if(n instanceof $e){let o=c(this,p,x).call(this,n.expression);return c(this,p,v).call(this,{type:"TSNonNullExpression",expression:o,start:$(o),end:n.sourceSpan.end},{hasParentParens:s})}let r=n instanceof Le;if(r||n instanceof Me){let o=c(this,p,x).call(this,n.expression),a=r?"!":"typeof",{start:l}=n.sourceSpan;if(!r){let u=this.text.lastIndexOf(a,l);if(u===-1)throw new Error(`Cannot find operator ${a} from index ${l} in ${JSON.stringify(this.text)}`);l=u}return c(this,p,v).call(this,{type:"UnaryExpression",prefix:!0,operator:a,argument:o,start:l,end:R(o)},{hasParentParens:s})}if(n instanceof re||n instanceof ie){let{receiver:o,name:a}=n,l=this.getCharacterLastIndex(/\S/,n.sourceSpan.end-1)+1,u=c(this,p,v).call(this,{type:"Identifier",name:a,start:l-a.length,end:l},ws(o,L(this,pe))?{hasParentParens:s}:{});return c(this,p,He).call(this,o,u,{computed:!1,optional:n instanceof ie,hasParentParens:s})}if(n instanceof Ie){let o=c(this,p,x).call(this,n.key),a=c(this,p,x).call(this,n.value),l=c(this,p,He).call(this,n.receiver,o,{computed:!0,optional:!1,end:this.getCharacterIndex("]",R(o))+1});return c(this,p,v).call(this,{type:"AssignmentExpression",left:l,operator:"=",right:a,start:$(l),end:R(a)},{hasParentParens:s})}if(n instanceof Te){let{receiver:o,name:a,value:l}=n,u=c(this,p,x).call(this,l),h=this.getCharacterLastIndex(/\S/,this.getCharacterLastIndex("=",$(u)-1)-1)+1,g=c(this,p,v).call(this,{type:"Identifier",name:a,start:h-a.length,end:h}),S=c(this,p,He).call(this,o,g,{computed:!1,optional:!1});return c(this,p,v).call(this,{type:"AssignmentExpression",left:S,operator:"=",right:u,start:$(S),end:R(u)},{hasParentParens:s})}throw Object.assign(new Error("Unexpected node"),{node:n})};function xs(t,e){return new Ue(t,e).node}function Ss(t){return t instanceof Be}function Es(t){return t instanceof ce}var he,Q,m,ys,I,Vt,Ht,Ut,_s,Cs,Ts,ks,Ft=class extends Ue{constructor(n,s){super(void 0,s);V(this,m);V(this,he);V(this,Q);K(this,he,n),K(this,Q,s);for(let r of n)c(this,m,_s).call(this,r)}get expressions(){return c(this,m,Ts).call(this)}};he=new WeakMap,Q=new WeakMap,m=new WeakSet,ys=function(){return L(this,he)[0].key},I=function(n,{stripSpaces:s=!0}={}){return this.createNode(n,{stripSpaces:s})},Vt=function(n){return this.transformNode(n)},Ht=function(n){return ps(n.slice(L(this,m,ys).source.length))},Ut=function(n){let s=L(this,Q);if(s[n.start]!=='"'&&s[n.start]!=="'")return;let r=s[n.start],o=!1;for(let a=n.start+1;a({...y,...this.transformSpan({start:y.start,end:T})}),S=y=>({...g(y,h.end),alias:h}),w=o.pop();if(w.type==="NGMicrosyntaxExpression")o.push(S(w));else if(w.type==="NGMicrosyntaxKeyedExpression"){let y=S(w.expression);o.push(g({...w,expression:y},y.end))}else throw new Error(`Unexpected type ${w.type}`)}else o.push(c(this,m,ks).call(this,u,l));a=u}return c(this,m,I).call(this,{type:"NGMicrosyntax",body:o,...o.length===0?n[0].sourceSpan:{start:o[0].start,end:nt(!1,o,-1).end}})},ks=function(n,s){if(Ss(n)){let{key:r,value:o}=n;return o?s===0?c(this,m,I).call(this,{type:"NGMicrosyntaxExpression",expression:c(this,m,Vt).call(this,o.ast),alias:null,...o.sourceSpan}):c(this,m,I).call(this,{type:"NGMicrosyntaxKeyedExpression",key:c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:c(this,m,Ht).call(this,r.source),...r.span}),expression:c(this,m,I).call(this,{type:"NGMicrosyntaxExpression",expression:c(this,m,Vt).call(this,o.ast),alias:null,...o.sourceSpan}),start:r.span.start,end:o.sourceSpan.end}):c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:c(this,m,Ht).call(this,r.source),...r.span})}else{let{key:r,sourceSpan:o}=n;if(/^let\s$/.test(L(this,Q).slice(o.start,o.start+4))){let{value:l}=n;return c(this,m,I).call(this,{type:"NGMicrosyntaxLet",key:c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:r.source,...r.span}),value:l?c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:l.source,...l.span}):null,start:o.start,end:l?l.span.end:r.span.end})}else{let l=c(this,m,Cs).call(this,n);return c(this,m,I).call(this,{type:"NGMicrosyntaxAs",key:c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:l.source,...l.span}),alias:c(this,m,I).call(this,{type:"NGMicrosyntaxKey",name:r.source,...r.span}),start:l.span.start,end:r.span.end})}}};function Is(t,e){return new Ft(t,e).expressions}function st({result:{ast:t},text:e,comments:n}){return Object.assign(xs(t,e),{comments:n})}function bs({result:{templateBindings:t},text:e}){return Is(t,e)}var Ns=t=>st(hs(t));var As=t=>st(ds(t)),Wt=t=>st(fs(t)),Ps=t=>bs(ms(t));function qt(t){var s,r,o;let e=((s=t.range)==null?void 0:s[0])??t.start,n=(o=((r=t.declaration)==null?void 0:r.decorators)??t.decorators)==null?void 0:o[0];return n?Math.min(qt(n),e):e}function Ls(t){var e;return((e=t.range)==null?void 0:e[1])??t.end}function rt(t){return{astFormat:"estree",parse(e){let n=t(e);return{type:"NGRoot",node:t===Wt&&n.type!=="NGChainedExpression"?{...n,type:"NGChainedExpression",expressions:[n]}:n}},locStart:qt,locEnd:Ls}}var Ur=rt(Wt),Wr=rt(Ns),qr=rt(As),jr=rt(Ps);var Zi=zt;export{Zi as default,jt as parsers}; diff --git a/node_modules/prettier/plugins/babel.js b/node_modules/prettier/plugins/babel.js new file mode 100644 index 0000000..904358c --- /dev/null +++ b/node_modules/prettier/plugins/babel.js @@ -0,0 +1,15 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.babel=e()}})(function(){"use strict";var Bs=Object.create;var be=Object.defineProperty;var Rs=Object.getOwnPropertyDescriptor;var _s=Object.getOwnPropertyNames;var Us=Object.getPrototypeOf,js=Object.prototype.hasOwnProperty;var $s=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),zs=(a,t)=>{for(var e in t)be(a,e,{get:t[e],enumerable:!0})},Et=(a,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _s(t))!js.call(a,i)&&i!==e&&be(a,i,{get:()=>t[i],enumerable:!(s=Rs(t,i))||s.enumerable});return a};var It=(a,t,e)=>(e=a!=null?Bs(Us(a)):{},Et(t||!a||!a.__esModule?be(e,"default",{value:a,enumerable:!0}):e,a)),Vs=a=>Et(be({},"__esModule",{value:!0}),a);var gt=$s(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});function qs(a,t){if(a==null)return{};var e={};for(var s in a)if({}.hasOwnProperty.call(a,s)){if(t.includes(s))continue;e[s]=a[s]}return e}var O=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},ee=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function v(a,t){let{line:e,column:s,index:i}=a;return new O(e,s+t,i+t)}var Nt="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Ks={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Nt},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Nt}},kt={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},we=a=>a.type==="UpdateExpression"?kt.UpdateExpression[`${a.prefix}`]:kt[a.type],Hs={AccessorIsGenerator:({kind:a})=>`A ${a}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:a})=>`Missing initializer in ${a} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:a})=>`\`${a}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:a})=>`'import.${a}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:a,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`. +- Did you mean \`export { '${a}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:a})=>`'${a==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:a})=>`Unsyntactic ${a==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:a})=>`A string literal cannot be used as an imported binding. +- Did you mean \`import { "${a}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:a})=>`Expected number in radix ${a}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:a})=>`Escape sequence in keyword ${a}.`,InvalidIdentifier:({identifierName:a})=>`Invalid identifier ${a}.`,InvalidLhs:({ancestor:a})=>`Invalid left-hand side in ${we(a)}.`,InvalidLhsBinding:({ancestor:a})=>`Binding invalid left-hand side in ${we(a)}.`,InvalidLhsOptionalChaining:({ancestor:a})=>`Invalid optional chaining in the left-hand side of ${we(a)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:a})=>`Unexpected character '${a}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:a})=>`Private name #${a} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:a})=>`Label '${a}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:a})=>`This experimental syntax requires enabling the parser plugin: ${a.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:a})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${a.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:a})=>`Duplicate key "${a}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:a})=>`An export name cannot include a lone surrogate, found '\\u${a.toString(16)}'.`,ModuleExportUndefined:({localName:a})=>`Export '${a}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:a})=>`Private names are only allowed in property accesses (\`obj.#${a}\`) or in \`in\` expressions (\`#${a} in obj\`).`,PrivateNameRedeclaration:({identifierName:a})=>`Duplicate private name #${a}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:a})=>`Unexpected keyword '${a}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:a})=>`Unexpected reserved word '${a}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:a,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${a?`, expected "${a}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:a,onlyValidPropertyName:t})=>`The only valid meta property for ${a} is ${a}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:a})=>`Identifier '${a}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Js={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:a})=>`Assigning to '${a}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:a})=>`Binding '${a}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Ws=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Xs=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:a})=>`Invalid topic token ${a}. In order to use ${a} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${a}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:a})=>`Hack-style pipe body cannot be an unparenthesized ${we({type:a})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),Gs=["message"];function vt(a,t,e){Object.defineProperty(a,t,{enumerable:!1,configurable:!0,value:e})}function Ys({toMessage:a,code:t,reasonCode:e,syntaxPlugin:s}){let i=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let r={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};r[e]&&(e=r[e])}return function r(n,o){let h=new SyntaxError;return h.code=t,h.reasonCode=e,h.loc=n,h.pos=n.index,h.syntaxPlugin=s,i&&(h.missingPlugin=o.missingPlugin),vt(h,"clone",function(c={}){var u;let{line:f,column:d,index:x}=(u=c.loc)!=null?u:n;return r(new O(f,d,x),Object.assign({},o,c.details))}),vt(h,"details",o),Object.defineProperty(h,"message",{configurable:!0,get(){let l=`${a(o)} (${n.line}:${n.column})`;return this.message=l,l},set(l){Object.defineProperty(this,"message",{value:l,writable:!0})}}),h}}function _(a,t){if(Array.isArray(a))return s=>_(s,a[0]);let e={};for(let s of Object.keys(a)){let i=a[s],r=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=r,o=qs(r,Gs),h=typeof n=="string"?()=>n:n;e[s]=Ys(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:h},t?{syntaxPlugin:t}:{},o))}return e}var p=Object.assign({},_(Ks),_(Hs),_(Js),_`pipelineOperator`(Xs));function Qs(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Zs(a){let t=Qs();if(a==null)return t;if(a.annexB!=null&&a.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let e of Object.keys(t))a[e]!=null&&(t[e]=a[e]);if(t.startLine===1)a.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:a.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((a.startColumn==null||a.startIndex==null)&&a.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return t}var{defineProperty:ei}=Object,Lt=(a,t)=>{a&&ei(a,t,{enumerable:!1,value:a[t]})};function oe(a){return Lt(a.loc.start,"index"),Lt(a.loc.end,"index"),a}var ti=a=>class extends a{parse(){let e=oe(super.parse());return this.optionFlags&128&&(e.tokens=e.tokens.map(oe)),e}parseRegExpLiteral({pattern:e,flags:s}){let i=null;try{i=new RegExp(e,s)}catch{}let r=this.estreeParseLiteral(i);return r.regex={pattern:e,flags:s},r}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let i=this.estreeParseLiteral(s);return i.bigint=String(i.value||e),i}parseDecimalLiteral(e){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||e),i}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){let s=e.value;delete e.value,s.type="Literal",s.raw=s.extra.raw,s.value=s.extra.expressionValue;let i=e;return i.type="ExpressionStatement",i.expression=s,i.directive=s.extra.rawValue,delete s.extra,i}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,i,r,n){super.parseBlockBody(e,s,i,r,n);let o=e.directives.map(h=>this.directiveToStmt(h));e.body=o.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let i=super.parseLiteral(e,s);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(e,s,i=!1){super.parseFunctionBody(e,s,i),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,i,r,n,o,h=!1){let l=this.startNode();l.kind=e.kind,l=super.parseMethod(l,s,i,r,n,o,h),l.type="FunctionExpression",delete l.kind,e.value=l;let{typeParameters:c}=e;return c&&(delete e.typeParameters,l.typeParameters=c,this.resetStartLocationFromNode(l,c)),o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition",s.computed=!1),s}parseObjectMethod(e,s,i,r,n){let o=super.parseObjectMethod(e,s,i,r,n);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,s,i,r){let n=super.parseObjectProperty(e,s,i,r);return n&&(n.kind="init",n.type="Property"),n}isValidLVal(e,s,i){return e==="Property"?"value":super.isValidLVal(e,s,i)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:i,value:r}=e;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(r,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,i){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(p.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(p.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,i)}finishCallExpression(e,s){let i=super.finishCallExpression(e,s);if(i.callee.type==="Import"){var r,n;i.type="ImportExpression",i.source=i.arguments[0],i.options=(r=i.arguments[1])!=null?r:null,i.attributes=(n=i.arguments[1])!=null?n:null,delete i.arguments,delete i.callee}return i}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let i=this.state.lastTokStartLoc,r=super.parseExport(e,s);switch(r.type){case"ExportAllDeclaration":r.exported=null;break;case"ExportNamedDeclaration":r.specifiers.length===1&&r.specifiers[0].type==="ExportNamespaceSpecifier"&&(r.type="ExportAllDeclaration",r.exported=r.specifiers[0].exported,delete r.specifiers);case"ExportDefaultDeclaration":{var n;let{declaration:o}=r;(o==null?void 0:o.type)==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===r.start&&this.resetStartLocation(r,i)}break}return r}parseSubscript(e,s,i,r){let n=super.parseSubscript(e,s,i,r);if(r.optionalChainMember){if((n.type==="OptionalMemberExpression"||n.type==="OptionalCallExpression")&&(n.type=n.type.substring(8)),r.stop){let o=this.startNodeAtNode(n);return o.expression=n,this.finishNode(o,"ChainExpression")}}else(n.type==="MemberExpression"||n.type==="CallExpression")&&(n.optional=!1);return n}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,s,i){return oe(super.finishNodeAt(e,s,i))}resetStartLocation(e,s){super.resetStartLocation(e,s),oe(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),oe(e)}},W=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},C={brace:new W("{"),j_oTag:new W("...",!0)};C.template=new W("`",!0);var b=!0,m=!0,_e=!0,he=!0,z=!0,si=!0,Ie=class{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},lt=new Map;function A(a,t={}){t.keyword=a;let e=P(a,t);return lt.set(a,e),e}function k(a,t){return P(a,{beforeExpr:b,binop:t})}var pe=-1,B=[],ct=[],pt=[],ut=[],ft=[],dt=[];function P(a,t={}){var e,s,i,r;return++pe,ct.push(a),pt.push((e=t.binop)!=null?e:-1),ut.push((s=t.beforeExpr)!=null?s:!1),ft.push((i=t.startsExpr)!=null?i:!1),dt.push((r=t.prefix)!=null?r:!1),B.push(new Ie(a,t)),pe}function T(a,t={}){var e,s,i,r;return++pe,lt.set(a,pe),ct.push(a),pt.push((e=t.binop)!=null?e:-1),ut.push((s=t.beforeExpr)!=null?s:!1),ft.push((i=t.startsExpr)!=null?i:!1),dt.push((r=t.prefix)!=null?r:!1),B.push(new Ie("name",t)),pe}var ii={bracketL:P("[",{beforeExpr:b,startsExpr:m}),bracketHashL:P("#[",{beforeExpr:b,startsExpr:m}),bracketBarL:P("[|",{beforeExpr:b,startsExpr:m}),bracketR:P("]"),bracketBarR:P("|]"),braceL:P("{",{beforeExpr:b,startsExpr:m}),braceBarL:P("{|",{beforeExpr:b,startsExpr:m}),braceHashL:P("#{",{beforeExpr:b,startsExpr:m}),braceR:P("}"),braceBarR:P("|}"),parenL:P("(",{beforeExpr:b,startsExpr:m}),parenR:P(")"),comma:P(",",{beforeExpr:b}),semi:P(";",{beforeExpr:b}),colon:P(":",{beforeExpr:b}),doubleColon:P("::",{beforeExpr:b}),dot:P("."),question:P("?",{beforeExpr:b}),questionDot:P("?."),arrow:P("=>",{beforeExpr:b}),template:P("template"),ellipsis:P("...",{beforeExpr:b}),backQuote:P("`",{startsExpr:m}),dollarBraceL:P("${",{beforeExpr:b,startsExpr:m}),templateTail:P("...`",{startsExpr:m}),templateNonTail:P("...${",{beforeExpr:b,startsExpr:m}),at:P("@"),hash:P("#",{startsExpr:m}),interpreterDirective:P("#!..."),eq:P("=",{beforeExpr:b,isAssign:he}),assign:P("_=",{beforeExpr:b,isAssign:he}),slashAssign:P("_=",{beforeExpr:b,isAssign:he}),xorAssign:P("_=",{beforeExpr:b,isAssign:he}),moduloAssign:P("_=",{beforeExpr:b,isAssign:he}),incDec:P("++/--",{prefix:z,postfix:si,startsExpr:m}),bang:P("!",{beforeExpr:b,prefix:z,startsExpr:m}),tilde:P("~",{beforeExpr:b,prefix:z,startsExpr:m}),doubleCaret:P("^^",{startsExpr:m}),doubleAt:P("@@",{startsExpr:m}),pipeline:k("|>",0),nullishCoalescing:k("??",1),logicalOR:k("||",1),logicalAND:k("&&",2),bitwiseOR:k("|",3),bitwiseXOR:k("^",4),bitwiseAND:k("&",5),equality:k("==/!=/===/!==",6),lt:k("/<=/>=",7),gt:k("/<=/>=",7),relational:k("/<=/>=",7),bitShift:k("<>/>>>",8),bitShiftL:k("<>/>>>",8),bitShiftR:k("<>/>>>",8),plusMin:P("+/-",{beforeExpr:b,binop:9,prefix:z,startsExpr:m}),modulo:P("%",{binop:10,startsExpr:m}),star:P("*",{binop:10}),slash:k("/",10),exponent:P("**",{beforeExpr:b,binop:11,rightAssociative:!0}),_in:A("in",{beforeExpr:b,binop:7}),_instanceof:A("instanceof",{beforeExpr:b,binop:7}),_break:A("break"),_case:A("case",{beforeExpr:b}),_catch:A("catch"),_continue:A("continue"),_debugger:A("debugger"),_default:A("default",{beforeExpr:b}),_else:A("else",{beforeExpr:b}),_finally:A("finally"),_function:A("function",{startsExpr:m}),_if:A("if"),_return:A("return",{beforeExpr:b}),_switch:A("switch"),_throw:A("throw",{beforeExpr:b,prefix:z,startsExpr:m}),_try:A("try"),_var:A("var"),_const:A("const"),_with:A("with"),_new:A("new",{beforeExpr:b,startsExpr:m}),_this:A("this",{startsExpr:m}),_super:A("super",{startsExpr:m}),_class:A("class",{startsExpr:m}),_extends:A("extends",{beforeExpr:b}),_export:A("export"),_import:A("import",{startsExpr:m}),_null:A("null",{startsExpr:m}),_true:A("true",{startsExpr:m}),_false:A("false",{startsExpr:m}),_typeof:A("typeof",{beforeExpr:b,prefix:z,startsExpr:m}),_void:A("void",{beforeExpr:b,prefix:z,startsExpr:m}),_delete:A("delete",{beforeExpr:b,prefix:z,startsExpr:m}),_do:A("do",{isLoop:_e,beforeExpr:b}),_for:A("for",{isLoop:_e}),_while:A("while",{isLoop:_e}),_as:T("as",{startsExpr:m}),_assert:T("assert",{startsExpr:m}),_async:T("async",{startsExpr:m}),_await:T("await",{startsExpr:m}),_defer:T("defer",{startsExpr:m}),_from:T("from",{startsExpr:m}),_get:T("get",{startsExpr:m}),_let:T("let",{startsExpr:m}),_meta:T("meta",{startsExpr:m}),_of:T("of",{startsExpr:m}),_sent:T("sent",{startsExpr:m}),_set:T("set",{startsExpr:m}),_source:T("source",{startsExpr:m}),_static:T("static",{startsExpr:m}),_using:T("using",{startsExpr:m}),_yield:T("yield",{startsExpr:m}),_asserts:T("asserts",{startsExpr:m}),_checks:T("checks",{startsExpr:m}),_exports:T("exports",{startsExpr:m}),_global:T("global",{startsExpr:m}),_implements:T("implements",{startsExpr:m}),_intrinsic:T("intrinsic",{startsExpr:m}),_infer:T("infer",{startsExpr:m}),_is:T("is",{startsExpr:m}),_mixins:T("mixins",{startsExpr:m}),_proto:T("proto",{startsExpr:m}),_require:T("require",{startsExpr:m}),_satisfies:T("satisfies",{startsExpr:m}),_keyof:T("keyof",{startsExpr:m}),_readonly:T("readonly",{startsExpr:m}),_unique:T("unique",{startsExpr:m}),_abstract:T("abstract",{startsExpr:m}),_declare:T("declare",{startsExpr:m}),_enum:T("enum",{startsExpr:m}),_module:T("module",{startsExpr:m}),_namespace:T("namespace",{startsExpr:m}),_interface:T("interface",{startsExpr:m}),_type:T("type",{startsExpr:m}),_opaque:T("opaque",{startsExpr:m}),name:P("name",{startsExpr:m}),placeholder:P("%%",{startsExpr:!0}),string:P("string",{startsExpr:m}),num:P("num",{startsExpr:m}),bigint:P("bigint",{startsExpr:m}),decimal:P("decimal",{startsExpr:m}),regexp:P("regexp",{startsExpr:m}),privateName:P("#name",{startsExpr:m}),eof:P("eof"),jsxName:P("jsxName"),jsxText:P("jsxText",{beforeExpr:!0}),jsxTagStart:P("jsxTagStart",{startsExpr:!0}),jsxTagEnd:P("jsxTagEnd")};function E(a){return a>=93&&a<=133}function ri(a){return a<=92}function D(a){return a>=58&&a<=133}function Vt(a){return a>=58&&a<=137}function ai(a){return ut[a]}function Ve(a){return ft[a]}function ni(a){return a>=29&&a<=33}function Dt(a){return a>=129&&a<=131}function oi(a){return a>=90&&a<=92}function mt(a){return a>=58&&a<=92}function hi(a){return a>=39&&a<=59}function li(a){return a===34}function ci(a){return dt[a]}function pi(a){return a>=121&&a<=123}function ui(a){return a>=124&&a<=130}function q(a){return ct[a]}function Ce(a){return pt[a]}function fi(a){return a===57}function Ne(a){return a>=24&&a<=25}function F(a){return B[a]}B[8].updateContext=a=>{a.pop()},B[5].updateContext=B[7].updateContext=B[23].updateContext=a=>{a.push(C.brace)},B[22].updateContext=a=>{a[a.length-1]===C.template?a.pop():a.push(C.template)},B[143].updateContext=a=>{a.push(C.j_expr,C.j_oTag)};var yt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",qt="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",di=new RegExp("["+yt+"]"),mi=new RegExp("["+yt+qt+"]");yt=qt=null;var Kt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],yi=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function qe(a,t){let e=65536;for(let s=0,i=t.length;sa)return!1;if(e+=t[s+1],e>=a)return!0}return!1}function R(a){return a<65?a===36:a<=90?!0:a<97?a===95:a<=122?!0:a<=65535?a>=170&&di.test(String.fromCharCode(a)):qe(a,Kt)}function Y(a){return a<48?a===36:a<58?!0:a<65?!1:a<=90?!0:a<97?a===95:a<=122?!0:a<=65535?a>=170&&mi.test(String.fromCharCode(a)):qe(a,Kt)||qe(a,yi)}var xt={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},xi=new Set(xt.keyword),Pi=new Set(xt.strict),gi=new Set(xt.strictBind);function Ht(a,t){return t&&a==="await"||a==="enum"}function Jt(a,t){return Ht(a,t)||Pi.has(a)}function Wt(a){return gi.has(a)}function Xt(a,t){return Jt(a,t)||Wt(a)}function Ti(a){return xi.has(a)}function bi(a,t,e){return a===64&&t===64&&R(e)}var Ai=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Si(a){return Ai.has(a)}var ue=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},fe=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new ue(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let i=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(i,t,e,s);let r=i.names.get(t)||0;e&16?r=r|4:(i.firstLexicalName||(i.firstLexicalName=t),r=r|2),i.names.set(t,r),e&8&&this.maybeExportDefined(i,t)}else if(e&4)for(let r=this.scopeStack.length-1;r>=0&&(i=this.scopeStack[r],this.checkRedeclarationInScope(i,t,e,s),i.names.set(t,(i.names.get(t)||0)|1),this.maybeExportDefined(i,t),!(i.flags&387));--r);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(p.VarRedeclaration,i,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let i=t.names.get(e);return s&16?(i&2)>0||!this.treatFunctionsAsVarInScope(t)&&(i&1)>0:(i&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(i&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&387)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&451&&!(e&4))return e}}},Ke=class extends ue{constructor(...t){super(...t),this.declareFunctions=new Set}},He=class extends fe{createScope(t){return new Ke(t)}declareName(t,e,s){let i=this.currentScope();if(e&2048){this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let i=t.names.get(e);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Je=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let i=this.plugins.get(e);for(let r of Object.keys(s))if((i==null?void 0:i[r])!==s[r])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function Gt(a,t){a.trailingComments===void 0?a.trailingComments=t:a.trailingComments.unshift(...t)}function wi(a,t){a.leadingComments===void 0?a.leadingComments=t:a.leadingComments.unshift(...t)}function de(a,t){a.innerComments===void 0?a.innerComments=t:a.innerComments.unshift(...t)}function H(a,t,e){let s=null,i=t.length;for(;s===null&&i>0;)s=t[--i];s===null||s.start>e.start?de(a,e.comments):Gt(s,e.comments)}var We=class extends Je{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let i=s-1,r=e[i];r.start===t.end&&(r.leadingNode=t,i--);let{start:n}=t;for(;i>=0;i--){let o=e[i],h=o.end;if(h>n)o.containingNode=t,this.finalizeComment(o),e.splice(i,1);else{h===n&&(o.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&Gt(t.leadingNode,e),t.trailingNode!==null&&wi(t.trailingNode,e);else{let{containingNode:s,start:i}=t;if(this.input.charCodeAt(this.offsetToSourcePos(i)-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":H(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":H(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":H(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":H(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":H(s,s.specifiers,t);break;case"TSEnumDeclaration":H(s,s.members,t);break;case"TSEnumBody":H(s,s.members,t);break;default:de(s,e)}else de(s,e)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let i=e[s-1];i.leadingNode===t&&(i.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){let{commentStack:e}=this.state,{length:s}=e;s!==0&&(e[s-1].trailingNode===t?e[s-1].trailingNode=null:s>=2&&e[s-2].trailingNode===t&&(e[s-2].trailingNode=null))}takeSurroundingComments(t,e,s){let{commentStack:i}=this.state,r=i.length;if(r===0)return;let n=r-1;for(;n>=0;n--){let o=i[n],h=o.end;if(o.start===s)o.leadingNode=t;else if(h===e)o.trailingNode=t;else if(h0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startIndex:s,startLine:i,startColumn:r}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.startIndex=s,this.curLine=i,this.lineStart=-r,this.startLoc=this.endLoc=new O(i,r,s)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new O(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new a;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},Ii=function(t){return t>=48&&t<=57},Ot={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Se={bin:a=>a===48||a===49,oct:a=>a>=48&&a<=55,dec:a=>a>=48&&a<=57,hex:a=>a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102};function Ft(a,t,e,s,i,r){let n=e,o=s,h=i,l="",c=null,u=e,{length:f}=t;for(;;){if(e>=f){r.unterminated(n,o,h),l+=t.slice(u,e);break}let d=t.charCodeAt(e);if(Ni(a,d,t,e)){l+=t.slice(u,e);break}if(d===92){l+=t.slice(u,e);let x=ki(t,e,s,i,a==="template",r);x.ch===null&&!c?c={pos:e,lineStart:s,curLine:i}:l+=x.ch,{pos:e,lineStart:s,curLine:i}=x,u=e}else d===8232||d===8233?(++e,++i,s=e):d===10||d===13?a==="template"?(l+=t.slice(u,e)+` +`,++e,d===13&&t.charCodeAt(e)===10&&++e,++i,u=s=e):r.unterminated(n,o,h):++e}return{pos:e,str:l,firstInvalidLoc:c,lineStart:s,curLine:i,containsInvalid:!!c}}function Ni(a,t,e,s){return a==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(a==="double"?34:39)}function ki(a,t,e,s,i,r){let n=!i;t++;let o=l=>({pos:t,ch:l,lineStart:e,curLine:s}),h=a.charCodeAt(t++);switch(h){case 110:return o(` +`);case 114:return o("\r");case 120:{let l;return{code:l,pos:t}=Ge(a,t,e,s,2,!1,n,r),o(l===null?null:String.fromCharCode(l))}case 117:{let l;return{code:l,pos:t}=Qt(a,t,e,s,n,r),o(l===null?null:String.fromCodePoint(l))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:a.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);r.strictNumericEscape(t-1,e,s);default:if(h>=48&&h<=55){let l=t-1,u=/^[0-7]+/.exec(a.slice(l,t+2))[0],f=parseInt(u,8);f>255&&(u=u.slice(0,-1),f=parseInt(u,8)),t+=u.length-1;let d=a.charCodeAt(t);if(u!=="0"||d===56||d===57){if(i)return o(null);r.strictNumericEscape(l,e,s)}return o(String.fromCharCode(f))}return o(String.fromCharCode(h))}}function Ge(a,t,e,s,i,r,n,o){let h=t,l;return{n:l,pos:t}=Yt(a,t,e,s,16,i,r,!1,o,!n),l===null&&(n?o.invalidEscapeSequence(h,e,s):t=h-1),{code:l,pos:t}}function Yt(a,t,e,s,i,r,n,o,h,l){let c=t,u=i===16?Ot.hex:Ot.decBinOct,f=i===16?Se.hex:i===10?Se.dec:i===8?Se.oct:Se.bin,d=!1,x=0;for(let S=0,N=r??1/0;S=97?I=w-97+10:w>=65?I=w-65+10:Ii(w)?I=w-48:I=1/0,I>=i){if(I<=9&&l)return{n:null,pos:t};if(I<=9&&h.invalidDigit(t,e,s,i))I=0;else if(n)I=0,d=!0;else break}++t,x=x*i+I}return t===c||r!=null&&t-c!==r||d?{n:null,pos:t}:{n:x,pos:t}}function Qt(a,t,e,s,i,r){let n=a.charCodeAt(t),o;if(n===123){if(++t,{code:o,pos:t}=Ge(a,t,e,s,a.indexOf("}",t)-t,!0,i,r),++t,o!==null&&o>1114111)if(i)r.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=Ge(a,t,e,s,4,!1,i,r));return{code:o,pos:t}}function le(a,t,e){return new O(e,a-t,a)}var vi=new Set([103,109,115,105,121,117,100,118]),M=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new ee(t.startLoc,t.endLoc)}},Ye=class extends We{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,i,r,n)=>this.optionFlags&1024?(this.raise(p.InvalidDigit,le(s,i,r),{radix:n}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(p.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(p.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(p.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(p.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,i,r)=>{this.recordStrictModeErrors(p.StrictNumericEscape,le(s,i,r))},unterminated:(s,i,r)=>{throw this.raise(p.UnterminatedString,le(s-1,i,r))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(p.StrictNumericEscape),unterminated:(s,i,r)=>{throw this.raise(p.UnterminatedTemplate,le(s,i,r))}}),this.state=new Xe,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&128&&this.pushToken(new M(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return Ue.lastIndex=t,Ue.test(this.input)?Ue.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return je.lastIndex=t,je.test(this.input)?je.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++tthis.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,i=this.input.indexOf(t,s+2);if(i===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+t.length,Ae.lastIndex=s+2;Ae.test(this.input)&&Ae.lastIndex<=i;)++this.state.curLine,this.state.lineStart=Ae.lastIndex;if(this.isLookahead)return;let r={type:"CommentBlock",value:this.input.slice(s+2,i),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(i+t.length),loc:new ee(e,this.state.curPosition())};return this.optionFlags&128&&this.pushToken(r),r}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=t);if(this.state.post)){let r=this.skipLineComment(3);r!==void 0&&(this.addComment(r),e==null||e.push(r))}else break e}else if(s===60&&!this.inModule&&this.optionFlags&4096){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let r=this.skipLineComment(4);r!==void 0&&(this.addComment(r),e==null||e.push(r))}else break e}else break e}}if((e==null?void 0:e.length)>0){let s=this.state.pos,i={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(s),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(p.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?p.RecordExpressionHashIncorrectStartSyntaxType:p.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else R(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!Q(t)&&++this.state.pos=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(R(t)){this.readWord(t);return}}throw this.raise(p.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,i,{pos:r}=this.state;for(;;++r){if(r>=this.length)throw this.raise(p.UnterminatedRegExp,v(t,1));let l=this.input.charCodeAt(r);if(Q(l))throw this.raise(p.UnterminatedRegExp,v(t,1));if(s)s=!1;else{if(l===91)i=!0;else if(l===93&&i)i=!1;else if(l===47&&!i)break;s=l===92}}let n=this.input.slice(e,r);++r;let o="",h=()=>v(t,r+2-e);for(;r=2&&this.input.charCodeAt(e)===48;if(h){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(p.StrictOctalLiteral,s),!this.state.strict){let x=d.indexOf("_");x>0&&this.raise(p.ZeroDigitNumericSeparator,v(s,x))}o=h&&!/[89]/.test(d)}let l=this.input.charCodeAt(this.state.pos);if(l===46&&!o&&(++this.state.pos,this.readInt(10),i=!0,l=this.input.charCodeAt(this.state.pos)),(l===69||l===101)&&!o&&(l=this.input.charCodeAt(++this.state.pos),(l===43||l===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(p.InvalidOrMissingExponent,s),i=!0,n=!0,l=this.input.charCodeAt(this.state.pos)),l===110&&((i||h)&&this.raise(p.InvalidBigIntLiteral,s),++this.state.pos,r=!0),l===109){this.expectPlugin("decimal",this.state.curPosition()),(n||h)&&this.raise(p.InvalidDecimal,s),++this.state.pos;var c=!0}if(R(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());let u=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(r){this.finishToken(136,u);return}if(c){this.finishToken(137,u);return}let f=o?parseInt(u,8):parseFloat(u);this.finishToken(135,f)}readCodePoint(t){let{code:e,pos:s}=Qt(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:i,lineStart:r}=Ft(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=r,this.state.curLine=i,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:i,curLine:r,lineStart:n}=Ft("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=r,s&&(this.state.firstInvalidTemplateEscapePos=new O(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(i)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,i=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos=0;o--){let h=n[o];if(h.loc.index===r)return n[o]=t(i,s);if(h.loc.indexthis.hasPlugin(e)))throw this.raise(p.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,i)=>{this.raise(t,le(e,s,i))}}},Qe=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Ze=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Qe)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,i]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,i):this.parser.raise(p.InvalidPrivateFieldResolution,i,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:i,loneAccessors:r,undefinedPrivateNames:n}=this.current(),o=i.has(t);if(e&3){let h=o&&r.get(t);if(h){let l=h&4,c=e&4,u=h&3,f=e&3;o=u===f||l!==c,o||r.delete(t)}else o||r.set(t,e)}o&&this.parser.raise(p.PrivateNameRedeclaration,s,{identifierName:t}),i.add(t),n.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(p.InvalidPrivateFieldResolution,e,{identifierName:t})}},te=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},ke=class extends te{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},et=class{constructor(t){this.parser=void 0,this.stack=[new te],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let s=e.loc.start,{stack:i}=this,r=i.length-1,n=i[r];for(;!n.isCertainlyParameterDeclaration();){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(t,s);else return;n=i[--r]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){let{stack:s}=this,i=s[s.length-1],r=e.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(t,r);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(t,r);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,i=e[s];for(;i.canBeArrowParameterDeclaration();)i.type===2&&i.recordDeclarationError(p.AwaitBindingIdentifier,t),i=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,i])=>{this.parser.raise(s,i);let r=t.length-2,n=t[r];for(;n.canBeArrowParameterDeclaration();)n.clearDeclarationError(i.index),n=t[--r]})}};function Li(){return new te(3)}function Di(){return new ke(1)}function Mi(){return new ke(2)}function Zt(){return new te}var tt=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function Ee(a,t){return(a?2:0)|(t?1:0)}var st=class extends Ye{addExtra(t,e,s,i=!0){if(!t)return;let{extra:r}=t;r==null&&(r={},t.extra=r),i?r[e]=s:Object.defineProperty(r,e,{enumerable:i,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){let s=t+e.length;if(this.input.slice(t,s)===e){let i=this.input.charCodeAt(s);return!(Y(i)||(i&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Mt(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Mt(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(p.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let i=t((r=null)=>{throw s.node=r,s});if(this.state.errors.length>e.errors.length){let r=this.state;return this.state=e,this.state.tokensLength=r.tokensLength,{node:i,error:r.errors[e.errors.length],thrown:!1,aborted:!1,failState:r}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let r=this.state;if(this.state=e,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:r};if(i===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:r};throw i}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:i,privateKeyLoc:r,optionalParametersLoc:n}=t,o=!!s||!!i||!!n||!!r;if(!e)return o;s!=null&&this.raise(p.InvalidCoverInitializedName,s),i!=null&&this.raise(p.DuplicateProto,i),r!=null&&this.raise(p.UnexpectedPrivateField,r),n!=null&&this.unexpected(n)}isLiteralPropertyName(){return Vt(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let i=this.inModule;this.inModule=t;let r=this.scope,n=this.getScopeHandler();this.scope=new n(this,t);let o=this.prodParam;this.prodParam=new tt;let h=this.classScope;this.classScope=new Ze(this);let l=this.expressionScope;return this.expressionScope=new et(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=i,this.scope=r,this.prodParam=o,this.classScope=h,this.expressionScope=l}}enterInitialScopes(){let t=0;this.inModule&&(t|=2),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},Z=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},se=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new ee(s),(t==null?void 0:t.optionFlags)&64&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},Pt=se.prototype;Pt.__clone=function(){let a=new se(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;e`Cannot overwrite reserved type ${a}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:a,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${a} = true,\` or \`${a} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:a,enumName:t})=>`Enum member names need to be unique, but the name \`${a}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:a})=>`Enum \`${a}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:a,enumName:t})=>`Enum type \`${a}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:a})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${a}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:a,memberName:t,explicitType:e})=>`Enum \`${a}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:a,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${a}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:a,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${a}\`.`,EnumInvalidMemberName:({enumName:a,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${a}\`.`,EnumNumberMemberNotInitialized:({enumName:a,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${a}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:a})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${a}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:a})=>`Unexpected reserved type ${a}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:a,suggestion:t})=>`\`declare export ${a}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Ri(a){return a.type==="DeclareExportAllDeclaration"||a.type==="DeclareExportDeclaration"&&(!a.declaration||a.declaration.type!=="TypeAlias"&&a.declaration.type!=="InterfaceDeclaration")}function Bt(a){return a.importKind==="type"||a.importKind==="typeof"}var _i={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Ui(a,t){let e=[],s=[];for(let i=0;iclass extends a{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return He}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=ji.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let i=this.flowParseType();return this.state.inType=s,i}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(g.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,i=null;return this.match(54)?(this.state.inType=e,i=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(i=this.flowParsePredicate())),[s,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),i=this.startNode(),r=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let n=this.flowParseFunctionTypeParams();return i.params=n.params,i.rest=n.rest,i.this=n._this,this.expect(11),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(r,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(g.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),i=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(g.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,g.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),i.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let r=null,n=!1;return i.forEach(o=>{Ri(o)?(r==="CommonJS"&&this.raise(g.AmbiguousDeclareModuleKind,o),r="ES"):o.type==="DeclareModuleExports"&&(n&&this.raise(g.DuplicateDeclareModuleExports,o),r==="ES"&&this.raise(g.AmbiguousDeclareModuleKind,o),r="CommonJS",n=!0)}),e.kind=r||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){let i=this.state.value;throw this.raise(g.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:_i[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return s.type="DeclareTypeAlias",s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return s.type="DeclareOpaqueType",s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(g.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,i){Bi.has(e)&&this.raise(i?g.AssignReservedType:g.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,i=this.startNode(),r=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return i.name=n.name,i.variance=r,i.bound=n.typeAnnotation,this.match(29)?(this.eat(29),i.default=this.flowParseType()):e&&this.raise(g.MissingTypeParamDefault,s),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let i=!1;do{let r=this.flowParseTypeParameter(i);s.params.push(r),r.default&&(i=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==C.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=i}),this.state.inType=s,!this.state.inType&&this.curContext()===C.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,i){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=i,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let i=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(i),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:i,allowProto:r,allowInexact:n}){let o=this.state.inType;this.state.inType=!0;let h=this.startNode();h.callProperties=[],h.properties=[],h.indexers=[],h.internalSlots=[];let l,c,u=!1;for(s&&this.match(6)?(this.expect(6),l=9,c=!0):(this.expect(5),l=8,c=!1),h.exact=c;!this.match(l);){let d=!1,x=null,S=null,N=this.startNode();if(r&&this.isContextual(118)){let I=this.lookahead();I.type!==14&&I.type!==17&&(this.next(),x=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let I=this.lookahead();I.type!==14&&I.type!==17&&(this.next(),d=!0)}let w=this.flowParseVariance();if(this.eat(0))x!=null&&this.unexpected(x),this.eat(0)?(w&&this.unexpected(w.loc.start),h.internalSlots.push(this.flowParseObjectTypeInternalSlot(N,d))):h.indexers.push(this.flowParseObjectTypeIndexer(N,d,w));else if(this.match(10)||this.match(47))x!=null&&this.unexpected(x),w&&this.unexpected(w.loc.start),h.callProperties.push(this.flowParseObjectTypeCallProperty(N,d));else{let I="init";if(this.isContextual(99)||this.isContextual(104)){let ne=this.lookahead();Vt(ne.type)&&(I=this.state.value,this.next())}let Te=this.flowParseObjectTypeProperty(N,d,x,w,I,i,n??!c);Te===null?(u=!0,S=this.state.lastTokStartLoc):h.properties.push(Te)}this.flowObjectTypeSemicolon(),S&&!this.match(8)&&!this.match(9)&&this.raise(g.UnexpectedExplicitInexactInObject,S)}this.expect(l),i&&(h.inexact=u);let f=this.finishNode(h,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,s,i,r,n,o,h){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?h||this.raise(g.InexactInsideExact,this.state.lastTokStartLoc):this.raise(g.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(g.InexactVariance,r),null):(o||this.raise(g.UnexpectedSpreadType,this.state.lastTokStartLoc),i!=null&&this.unexpected(i),r&&this.raise(g.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=i!=null,e.kind=n;let l=!1;return this.match(47)||this.match(10)?(e.method=!0,i!=null&&this.unexpected(i),r&&this.unexpected(r.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(n==="get"||n==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(g.ThisParamBannedInConstructor,e.value.this)):(n!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,i=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?g.GetterMayNotHaveThisParam:g.SetterMayNotHaveThisParam,e.value.this),i!==s&&this.raise(e.kind==="get"?p.BadGetterArity:p.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(p.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){var i;(i=e)!=null||(e=this.state.startLoc);let r=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let n=this.startNodeAt(e);n.qualification=r,n.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(n,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,s){let i=this.startNodeAt(e);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,i));return}super.parseFunctionBody(e,!1,i)}parseFunctionBodyAndFinish(e,s,i=!1){if(this.match(14)){let r=this.startNode();[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=r.typeAnnotation?this.finishNode(r,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let i=this.lookahead();if(D(i.type)){let r=this.startNode();return this.next(),this.flowParseInterface(r)}}else if(this.isContextual(126)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,i){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||E(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(E(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||Dt(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||Dt(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(i),e}this.expect(17);let r=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(s),{consequent:h,failed:l}=this.tryParseConditionalConsequent(),[c,u]=this.getArrowLikeExpressions(h);if(l||u.length>0){let f=[...n];if(u.length>0){this.state=r,this.state.noArrowAt=f;for(let d=0;d1&&this.raise(g.AmbiguousConditionalArrow,r.startLoc),l&&c.length===1&&(this.state=r,f.push(c[0].start),this.state.noArrowAt=f,{consequent:h,failed:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(h,!0),this.state.noArrowAt=n,this.expect(14),o.test=e,o.consequent=h,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let i=[e],r=[];for(;i.length!==0;){let n=i.pop();n.type==="ArrowFunctionExpression"&&n.body.type!=="BlockStatement"?(n.typeParameters||!n.returnType?this.finishArrowValidation(n):r.push(n),i.push(n.body)):n.type==="ConditionalExpression"&&(i.push(n.consequent),i.push(n.alternate))}return s?(r.forEach(n=>this.finishArrowValidation(n)),[r,[]]):Ui(r,n=>n.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let i;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),i=s(),this.state.noArrowParamsConversionAt.pop()):i=s(),i}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=i,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return i}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,i=super.maybeParseExportNamespaceSpecifier(e);return i&&e.exportKind==="type"&&this.unexpected(s),i}parseClassId(e,s,i){super.parseClassId(e,s,i),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,i){let{startLoc:r}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,i),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(g.DeclareClassElement,r):s.value&&this.raise(g.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(p.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):bi(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,i){for(let r=0;r1||!s)&&this.raise(g.TypeCastInPattern,n.typeAnnotation)}return e}parseArrayLike(e,s,i,r){let n=super.parseArrayLike(e,s,i,r);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(n.elements),n}isValidLVal(e,s,i){return e==="TypeCastExpression"||super.isValidLVal(e,s,i)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,i,r,n,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,i,r,n,o),s.params&&n){let h=s.params;h.length>0&&this.isThisParam(h[0])&&this.raise(g.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&n&&s.value.params){let h=s.value.params;h.length>0&&this.isThisParam(h[0])&&this.raise(g.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,i,r){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,i,r)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let s=e.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,s.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let i=s[0];this.isThisParam(i)&&e.kind==="get"?this.raise(g.GetterMayNotHaveThisParam,i):this.isThisParam(i)&&this.raise(g.SetterMayNotHaveThisParam,i)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,i,r,n,o,h){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let l;this.match(47)&&!o&&(l=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let c=super.parseObjPropValue(e,s,i,r,n,o,h);return l&&((c.value||c).typeParameters=l),c}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(g.PatternIsOptional,e),this.isThisParam(e)&&this.raise(g.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(g.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(g.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.startsuper.parseMaybeAssign(e,s),r),!n.error)return n.node;let{context:l}=this.state,c=l[l.length-1];(c===C.j_oTag||c===C.j_expr)&&l.pop()}if((i=n)!=null&&i.error||this.match(47)){var o,h;r=r||this.state.clone();let l,c=this.tryParse(f=>{var d;l=this.flowParseTypeParameterDeclaration();let x=this.forwardNoArrowParamsConversionAt(l,()=>{let N=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(N,l),N});(d=x.extra)!=null&&d.parenthesized&&f();let S=this.maybeUnwrapTypeCastExpression(x);return S.type!=="ArrowFunctionExpression"&&f(),S.typeParameters=l,this.resetStartLocationFromNode(S,l),x},r),u=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(g.UnexpectedTypeParameterBeforeAsyncArrowFunction,l),c.node;u=c.node}if((o=n)!=null&&o.node)return this.state=n.failState,n.node;if(u)return this.state=c.failState,u;throw(h=n)!=null&&h.thrown?n.error:c.thrown?c.error:this.raise(g.UnexpectedTokenAfterTypeParameter,l)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let r=this.startNode();return[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),r});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,i,r=!0){if(!(i&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let n=0;n0&&this.raise(g.ThisParamMustBeFirst,e.params[n]);super.checkParams(e,s,i,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,i){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let r=this.startNodeAt(s);r.callee=e,r.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(r,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let r=this.state.clone(),n=this.tryParse(h=>this.parseAsyncArrowWithTypeParameters(s)||h(),r);if(!n.error&&!n.aborted)return n.node;let o=this.tryParse(()=>super.parseSubscripts(e,s,i),r);if(o.node&&!o.error)return o.node;if(n.node)return this.state=n.failState,n.node;if(o.node)return this.state=o.failState,o.node;throw n.error||o.error}return super.parseSubscripts(e,s,i)}parseSubscript(e,s,i,r){if(this.match(18)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,i)return r.stop=!0,e;this.next();let n=this.startNodeAt(s);return n.callee=e,n.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),n.arguments=this.parseCallExpressionArguments(11),n.optional=!0,this.finishCallExpression(n,!0)}else if(!i&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let n=this.startNodeAt(s);n.callee=e;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),n.arguments=super.parseCallExpressionArguments(11),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let i=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(g.UnterminatedFlowComment,this.state.curPosition()),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(g.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let i=this.input.charCodeAt(s+e),r=this.input.charCodeAt(s+e+1);return i===58&&r===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:i===58&&r!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:i}){this.raise(g.EnumBooleanMemberNotInitialized,e,{memberName:i,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?g.EnumInvalidMemberInitializerSymbolType:g.EnumInvalidMemberInitializerPrimaryType:g.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(g.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(g.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let i=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 134:{let i=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:i}}flowEnumCheckExplicitTypeMismatch(e,s,i){let{explicitType:r}=s;r!==null&&r!==i&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let i=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},n=!1;for(;!this.match(8);){if(this.eat(21)){n=!0;break}let o=this.startNode(),{id:h,init:l}=this.flowEnumMemberRaw(),c=h.name;if(c==="")continue;/^[a-z]/.test(c)&&this.raise(g.EnumInvalidMemberName,h,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),i.has(c)&&this.raise(g.EnumDuplicateMemberName,h,{memberName:c,enumName:e}),i.add(c);let u={enumName:e,explicitType:s,memberName:c};switch(o.id=h,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"boolean"),o.init=l.value,r.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"number"),o.init=l.value,r.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"string"),o.init=l.value,r.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,u);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,u);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,u);break;default:r.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:r,hasUnknownMembers:n}}flowEnumStringMembers(e,s,{enumName:i}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let r of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return s}else{for(let r of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!E(this.state.type))throw this.raise(g.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(g.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let i=s.name,r=s.loc.start,n=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:o,hasUnknownMembers:h}=this.flowEnumMembers({enumName:i,explicitType:n});switch(e.hasUnknownMembers=h,n){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let l=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let c=o.booleanMembers.length,u=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!c&&!u&&!f&&!d)return l();if(!c&&!u)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!u&&!f&&c>=d){for(let x of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(x.loc.start,{enumName:i,memberName:x.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!c&&!f&&u>=d){for(let x of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(x.loc.start,{enumName:i,memberName:x.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(g.EnumInconsistentMemberValues,r,{enumName:i}),l()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},J=_`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:a})=>`Expected corresponding JSX closing tag for <${a}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:a,HTMLEntity:t})=>`Unexpected token \`${a}\`. Did you mean \`${t}\` or \`{'${a}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function V(a){return a?a.type==="JSXOpeningFragment"||a.type==="JSXClosingFragment":!1}function G(a){if(a.type==="JSXIdentifier")return a.name;if(a.type==="JSXNamespacedName")return a.namespace.name+":"+a.name.name;if(a.type==="JSXMemberExpression")return G(a.object)+"."+G(a.property);throw new Error("Node had unexpected type: "+a.type)}var zi=a=>class extends a{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(J.UnterminatedJsxContent,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(i);return}e+=this.input.slice(s,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:Q(i)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),i;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=e?` +`:`\r +`):i=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,i}jsxReadString(e){let s="",i=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(p.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadEntity(),i=this.state.pos):Q(r)?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadNewLine(!1),i=this.state.pos):++this.state.pos}s+=this.input.slice(i,this.state.pos++),this.finishToken(134,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let i=this.readInt(s,void 0,!1,"bail");if(i!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(i)}else{let s=0,i=!1;for(;s++<10&&this.state.pos1){for(let i=0;i0){if(s&256){let r=!!(s&512),n=(i&4)>0;return r!==n}return!0}return s&128&&(i&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(i&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let i=s-1;i>=0;i--){let n=this.scopeStack[i].tsNames.get(e);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(t)}},es=a=>a.type==="ParenthesizedExpression"?es(a.expression):a,nt=class extends it{toAssignable(t,e=!1){var s,i;let r;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(r=es(t),e?r.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(p.InvalidParenthesizedAssignment,t):r.type!=="MemberExpression"&&!this.isOptionalMemberExpression(r)&&this.raise(p.InvalidParenthesizedAssignment,t):this.raise(p.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let o=0,h=t.properties.length,l=h-1;oi.type!=="ObjectMethod"&&(r===s||i.type!=="SpreadElement")&&this.isAssignable(i))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){let i=s&1,r=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(12),i&&this.match(12))r.push(null);else{if(this.eat(t))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),r.push(o),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(p.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());r.push(this.parseAssignableListItem(s,o))}}return r}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseAssignableListItem(t,e){let s=this.parseMaybeDefault();(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s);let i=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),i}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){var s,i;if((s=t)!=null||(t=this.state.startLoc),e=(i=e)!=null?i:this.parseBindingAtom(),!this.eat(29))return e;let r=this.startNodeAt(t);return r.left=e,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,i=!1,r=!1,n=!1){var o;let h=t.type;if(this.isObjectMethod(t))return;let l=this.isOptionalMemberExpression(t);if(l||h==="MemberExpression"){l&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(p.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(p.InvalidPropertyBindingPattern,t);return}if(h==="Identifier"){this.checkIdentifier(t,s,r);let{name:S}=t;i&&(i.has(S)?this.raise(p.ParamDupe,t):i.add(S));return}let c=this.isValidLVal(h,!(n||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(c===!0)return;if(c===!1){let S=s===64?p.InvalidLhs:p.InvalidLhsBinding;this.raise(S,t,{ancestor:e});return}let u,f;typeof c=="string"?(u=c,f=h==="ParenthesizedExpression"):[u,f]=c;let d=h==="ArrayPattern"||h==="ObjectPattern"?{type:h}:e,x=t[u];if(Array.isArray(x))for(let S of x)S&&this.checkLVal(S,d,s,i,r,f);else x&&this.checkLVal(x,d,s,i,r,f)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?Xt(t.name,this.inModule):Wt(t.name))&&(e===64?this.raise(p.StrictEvalArguments,t,{referenceName:t.name}):this.raise(p.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(p.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(p.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?p.RestTrailingComma:p.ElementAfterRest,this.state.startLoc),!0):!1}};function Vi(a){if(a==null)throw new Error(`Unexpected ${a} value.`);return a}function Rt(a){if(!a)throw new Error("Assert fail")}var y=_`typescript`({AbstractMethodHasImplementation:({methodName:a})=>`Method '${a}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:a})=>`Property '${a}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:a})=>`'declare' is not allowed in ${a}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:a})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:a})=>`Duplicate modifier: '${a}'.`,EmptyHeritageClauseType:({token:a})=>`'${a}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:a})=>`'${a[0]}' modifier cannot be used with '${a[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:a})=>`Index signatures cannot have an accessibility modifier ('${a}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:a})=>`'${a}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:a})=>`'${a}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:a})=>`'${a}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:a})=>`'${a[0]}' modifier must precede '${a[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:a})=>`Private elements cannot have an accessibility modifier ('${a}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:a})=>`Single type parameter ${a} should have a trailing comma. Example usage: <${a},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:a})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${a}.`});function qi(a){switch(a){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function _t(a){return a==="private"||a==="public"||a==="protected"}function Ki(a){return a==="in"||a==="out"}var Hi=a=>class extends a{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:y.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:y.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:y.InvalidModifierOnTypeParameter})}getScopeHandler(){return at}tsIsIdentifier(){return E(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s){if(!E(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let i=this.state.value;if(e.includes(i)){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return i}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:i,errorTemplate:r=y.InvalidModifierOnTypeMember},n){let o=(l,c,u,f)=>{c===u&&n[f]&&this.raise(y.InvalidModifiersOrder,l,{orderedModifiers:[u,f]})},h=(l,c,u,f)=>{(n[u]&&c===f||n[f]&&c===u)&&this.raise(y.IncompatibleModifiers,l,{modifiers:[u,f]})};for(;;){let{startLoc:l}=this.state,c=this.tsParseModifier(e.concat(s??[]),i);if(!c)break;_t(c)?n.accessibility?this.raise(y.DuplicateAccessibilityModifier,l,{modifier:c}):(o(l,c,c,"override"),o(l,c,c,"static"),o(l,c,c,"readonly"),n.accessibility=c):Ki(c)?(n[c]&&this.raise(y.DuplicateModifier,l,{modifier:c}),n[c]=!0,o(l,c,"in","out")):(hasOwnProperty.call(n,c)?this.raise(y.DuplicateModifier,l,{modifier:c}):(o(l,c,"static","readonly"),o(l,c,"static","override"),o(l,c,"override","readonly"),o(l,c,"abstract","override"),h(l,c,"declare","override"),h(l,c,"static","abstract")),n[c]=!0),s!=null&&s.includes(c)&&this.raise(r,l,{modifier:c})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){let i=[];for(;!this.tsIsListTerminator(e);)i.push(s());return i}tsParseDelimitedList(e,s,i){return Vi(this.tsParseDelimitedListWorker(e,s,!0,i))}tsParseDelimitedListWorker(e,s,i,r){let n=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let h=s();if(h==null)return;if(n.push(h),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;i&&this.expect(12);return}return r&&(r.value=o),n}tsParseBracketedList(e,s,i,r,n){r||(i?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,s,n);return i?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(y.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)&&!this.match(11)?(e.options=super.parseMaybeAssignAllowIn(),this.eat(12)):e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e){let s;if(e&1&&this.match(78))if(e&2)s=this.parseIdentifier(!0);else{let i=this.startNode();this.next(),s=this.finishNode(i,"ThisExpression")}else s=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let i=this.startNodeAtNode(s);i.left=s,i.right=this.parseIdentifier(!!(e&1)),s=this.finishNode(i,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let i={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,i),s.params.length===0&&this.raise(y.EmptyTypeParameters,s),i.value!==-1&&this.addExtra(s,"trailingComma",i.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let i=e===19,r="parameters",n="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[r]=this.tsParseBindingListForSignature(),i?s[n]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[n]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:i}=s;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(y.UnsupportedSignatureParameterKind,s,{type:i})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),E(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);let i=e;if(this.match(10)||this.match(47)){s&&this.raise(y.ReadonlyForMethodSignature,e);let r=i;r.kind&&this.match(47)&&this.raise(y.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,r),this.tsParseTypeMemberSemicolon();let n="parameters",o="typeAnnotation";if(r.kind==="get")r[n].length>0&&(this.raise(p.BadGetterArity,this.state.curPosition()),this.isThisParam(r[n][0])&&this.raise(y.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(r.kind==="set"){if(r[n].length!==1)this.raise(p.BadSetterArity,this.state.curPosition());else{let h=r[n][0];this.isThisParam(h)&&this.raise(y.AccessorCannotDeclareThisParameter,this.state.curPosition()),h.type==="Identifier"&&h.optional&&this.raise(y.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),h.type==="RestElement"&&this.raise(y.SetAccessorCannotHaveRestParameter,this.state.curPosition())}r[o]&&this.raise(y.SetAccessorCannotHaveReturnType,r[o])}else r.kind="method";return this.finishNode(r,"TSMethodSignature")}else{let r=i;s&&(r.readonly=!0);let n=this.tsTryParseTypeAnnotation();return n&&(r.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let i=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(i,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let s=this.tsTryParseIndexSignature(e);return s||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{let s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(i=>{let{type:r}=i;s&&r!=="TSRestType"&&r!=="TSOptionalType"&&!(r==="TSNamedTupleMember"&&i.optional)&&this.raise(y.OptionalTypeBeforeRequired,i),s||(s=r==="TSNamedTupleMember"&&i.optional||r==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,s=this.eat(21),{startLoc:i}=this.state,r,n,o,h,c=D(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,o=!1,n=this.parseIdentifier(!0),this.expect(14),h=this.tsParseType();else if(c===63){o=!0;let u=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(i),u),this.expect(17),this.expect(14),h=this.tsParseType()):(r=!1,h=f,this.expect(17))}else h=this.tsParseType(),o=this.eat(17),r=this.eat(14);if(r){let u;n?(u=this.startNodeAt(i),u.optional=o,u.label=n,u.elementType=h,this.eat(17)&&(u.optional=!0,this.raise(y.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAt(i),u.optional=o,this.raise(y.InvalidTupleMemberLabel,h),u.label=h,u.elementType=this.tsParseType()),h=this.finishNode(u,"TSNamedTupleMember")}else if(o){let u=this.startNodeAt(i);u.typeAnnotation=h,h=this.finishNode(u,"TSOptionalType")}if(s){let u=this.startNodeAt(e);u.typeAnnotation=h,h=this.finishNode(u,"TSRestType")}return h}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let i=this.startNode();return e==="TSConstructorType"&&(i.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,i)),this.finishNode(i,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){{let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==135&&s.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(E(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":qi(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,s=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAt(e);i.elementType=s,this.expect(3),s=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAt(e);i.objectType=s,i.indexType=this.tsParseType(),this.expect(3),s=this.finishNode(i,"TSIndexedAccessType")}return s}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(y.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return pi(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,i){let r=this.startNode(),n=this.eat(i),o=[];do o.push(s());while(this.eat(i));return o.length===1&&!n?o[0]:(r.types=o,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(E(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let i=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(78)){let h=this.tsParseThisTypeOrThisTypePredicate();return h.type==="TSThisType"?(i.parameterName=h,i.asserts=!0,i.typeAnnotation=null,h=this.finishNode(i,"TSTypePredicate")):(this.resetStartLocationFromNode(h,i),h.asserts=!0),s.typeAnnotation=h,this.finishNode(s,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return r?(i.parameterName=this.parseIdentifier(),i.asserts=r,i.typeAnnotation=null,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=r,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!E(this.state.type)&&!this.match(78)?!1:(e&&this.raise(p.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){Rt(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(y.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{let r=this.startNode();return r.expression=this.tsParseEntityName(3),this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSExpressionWithTypeArguments")});return i.length||this.raise(y.EmptyHeritageClauseType,s,{token:e}),i}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),E(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(y.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==C.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),e.body=i}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,i){e.isExport=i||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let r=this.tsParseModuleReference();return e.importKind==="type"&&r.type!=="TSExternalModuleReference"&&this.raise(y.ImportAliasHasImportType,r),e.moduleReference=r,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),i=e();return this.state=s,i}tsTryParseAndCatch(e){let s=this.tryParse(i=>e()||i());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),i=e();if(i!==void 0&&i!==!1)return i;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,i;return this.isContextual(100)&&(s=74,i="let"),this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,i||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{let r=this.tsParseInterfaceDeclaration(e,{declare:!0});if(r)return r}default:if(E(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,i){switch(s.name){case"declare":{let r=this.tsTryParseDeclare(e);return r&&(r.declare=!0),r}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let r=e;return r.kind="global",e.global=!0,r.id=s,r.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(r,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,i)}}tsParseDeclaration(e,s,i,r){switch(s){case"abstract":if(this.tsCheckLineTerminator(i)&&(this.match(80)||E(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case"module":if(this.tsCheckLineTerminator(i)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(E(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(i)&&E(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(i)&&E(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let r=this.startNodeAt(e);return r.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(r),r.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),r});if(this.state.maybeInArrowParameters=s,!!i)return super.parseArrowExpression(i,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(y.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===C.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return ui(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){let i=this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},r);let n=r.accessibility,o=r.override,h=r.readonly;!(e&4)&&(n||h||o)&&this.raise(y.UnexpectedParameterModifier,i);let l=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(l);let c=this.parseMaybeDefault(l.loc.start,l);if(n||h||o){let u=this.startNodeAt(i);return s.length&&(u.decorators=s),n&&(u.accessibility=n),h&&(u.readonly=h),o&&(u.override=o),c.type!=="Identifier"&&c.type!=="AssignmentPattern"&&this.raise(y.UnsupportedParameterPropertyKind,u),u.parameter=c,this.finishNode(u,"TSParameterProperty")}return s.length&&(l.decorators=s),c}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(y.PatternIsOptional,s)}setArrowFunctionParameters(e,s,i){super.setArrowFunctionParameters(e,s,i),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,i=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let r=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return r&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,r):r==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(y.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,r,i):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,i))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(y.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,i,r){let n=super.parseArrayLike(e,s,i,r);return n.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,s,i,r){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(i)return r.stop=!0,e;r.optionalChainMember=n=!0,this.next()}if(this.match(47)||this.match(51)){let o,h=this.tsTryParseAndCatch(()=>{if(!i&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(s);if(f)return f}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(Ne(this.state.type)){let f=super.parseTaggedTemplateExpression(e,s,r);return f.typeParameters=l,f}if(!i&&this.eat(10)){let f=this.startNodeAt(s);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=l,r.optionalChainMember&&(f.optional=n),this.finishCallExpression(f,r.optionalChainMember)}let c=this.state.type;if(c===48||c===52||c!==10&&Ve(c)&&!this.hasPrecedingLineBreak())return;let u=this.startNodeAt(s);return u.expression=e,u.typeParameters=l,this.finishNode(u,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),h)return h.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(y.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),h}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:i}=e;i.type==="TSInstantiationExpression"&&!((s=i.extra)!=null&&s.parenthesized)&&(e.typeParameters=i.typeParameters,e.callee=i.expression)}parseExprOp(e,s,i){let r;if(Ce(58)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(r=this.isContextual(120)))){let n=this.startNodeAt(s);return n.expression=e,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(r&&this.raise(p.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,r?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,s,i)}return super.parseExprOp(e,s,i)}checkReservedWord(e,s,i,r){this.state.isAmbientContext||super.checkReservedWord(e,s,i,r)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(y.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,r){super.applyImportPhase(e,s,i,r),s?e.exportKind=i==="type"?"type":"value":e.importKind=i==="type"||i==="typeof"?i:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let s;if(E(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let i=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,i);s=super.parseImportSpecifiersAndAfter(e,i)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(y.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){let i=e;this.next();let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(i,!1):i.importKind="value",this.tsParseImportEqualsDeclaration(i,r,!0)}else if(this.eat(29)){let i=e;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(93)){let i=e;return this.expectContextual(128),i.id=this.parseIdentifier(),this.semicolon(),this.finishNode(i,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,i=!1){let{isAmbientContext:r}=this.state,n=super.parseVarStatement(e,s,i||r);if(!r)return n;for(let{id:o,init:h}of n.declarations)h&&(s!=="const"||o.typeAnnotation?this.raise(y.InitializerNotAllowedInAmbientContext,h):Wi(h,this.hasPlugin("estree"))||this.raise(y.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,h));return n}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let i=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(i,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return i}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(i=>_t(i)?e.accessibility===i:!!e[i])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,i){let r=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:y.InvalidModifierOnTypeParameterPositions},s);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,r)&&this.raise(y.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,i,!!s.static)};s.declare?this.tsInAmbientContext(n):n()}parseClassMemberWithIsStatic(e,s,i,r){let n=this.tsTryParseIndexSignature(s);if(n){e.body.push(n),s.abstract&&this.raise(y.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(y.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(y.IndexSignatureHasDeclare,s),s.override&&this.raise(y.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(y.NonAbstractClassHasAbstractMethod,s),s.override&&(i.hadSuperClass||this.raise(y.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,i,r)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(y.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(y.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,i){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,i):void 0)||super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,i){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,i);let r=this.tryParse(()=>super.parseConditional(e,s));return r.node?(r.error&&(this.state=r.failState),r.node):(r.error&&super.setOptionalParametersError(i,r.error),e)}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,i=this.eatContextual(125);if(i&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(y.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let n=E(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return n?((n.type==="TSInterfaceDeclaration"||n.type==="TSTypeAliasDeclaration"||i)&&(e.exportKind="type"),i&&n.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(n,s),n.declare=!0),n):null}parseClassId(e,s,i,r){if((!s||i)&&this.isContextual(113))return;super.parseClassId(e,s,i,e.declare?1024:8331);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(y.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:s}=e;this.raise(y.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(y.PrivateElementHasAbstract,e),e.accessibility&&this.raise(y.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(y.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,i,r,n,o){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);h&&n&&this.raise(y.ConstructorHasTypeParameters,h);let{declare:l=!1,kind:c}=s;l&&(c==="get"||c==="set")&&this.raise(y.DeclareAccessor,s,{kind:c}),h&&(s.typeParameters=h),super.pushClassMethod(e,s,i,r,n,o)}pushClassPrivateMethod(e,s,i,r){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(s.typeParameters=n),super.pushClassPrivateMethod(e,s,i,r)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,i,r,n,o,h){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);return l&&(e.typeParameters=l),super.parseObjPropValue(e,s,i,r,n,o,h)}parseFunctionParams(e,s){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(e.typeParameters=i),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var i,r,n,o,h;let l,c,u;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(l=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!c.error)return c.node;let{context:x}=this.state,S=x[x.length-1];(S===C.j_oTag||S===C.j_expr)&&x.pop()}if(!((i=c)!=null&&i.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!l||l===this.state)&&(l=this.state.clone());let f,d=this.tryParse(x=>{var S,N;f=this.tsParseTypeParameters(this.tsParseConstModifier);let w=super.parseMaybeAssign(e,s);return(w.type!=="ArrowFunctionExpression"||(S=w.extra)!=null&&S.parenthesized)&&x(),((N=f)==null?void 0:N.params.length)!==0&&this.resetStartLocationFromNode(w,f),w.typeParameters=f,w},l);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!c&&(Rt(!this.hasPlugin("jsx")),u=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!u.error))return u.node;if((r=c)!=null&&r.node)return this.state=c.failState,c.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;throw((o=c)==null?void 0:o.error)||d.error||((h=u)==null?void 0:h.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(y.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(i=>{let r=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&i(),r});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(y.UnexpectedTypeCastInParameter,e):this.raise(y.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,i){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(i!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,i)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,s){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e,s);return r.typeParameters=i,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,s)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.startthis.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:i}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=i}}parseClass(e,s,i){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,i)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(y.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,i,r,n,o,h){let l=super.parseMethod(e,s,i,r,n,o,h);if(l.abstract&&(this.hasPlugin("estree")?l.value:l).body){let{key:f}=l;this.raise(y.AbstractMethodHasImplementation,l,{methodName:f.type==="Identifier"&&!l.computed?f.name:`[${this.input.slice(this.offsetToSourcePos(f.start),this.offsetToSourcePos(f.end))}]`})}return l}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,i,r){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!1,i),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,i,r))}parseImportSpecifier(e,s,i,r,n){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!0,i),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,i,r,i?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,i){let r=s?"imported":"local",n=s?"local":"exported",o=e[r],h,l=!1,c=!0,u=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let x=this.parseIdentifier();D(this.state.type)?(l=!0,o=d,h=s?this.parseIdentifier():this.parseModuleExportName(),c=!1):(h=x,c=!1)}else D(this.state.type)?(c=!1,h=s?this.parseIdentifier():this.parseModuleExportName()):(l=!0,o=d)}else D(this.state.type)&&(l=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());l&&i&&this.raise(s?y.TypeModifierIsUsedInTypeImports:y.TypeModifierIsUsedInTypeExports,u),e[r]=o,e[n]=h;let f=s?"importKind":"exportKind";e[f]=l?"type":"value",c&&this.eatContextual(93)&&(e[n]=s?this.parseIdentifier():this.parseModuleExportName()),e[n]||(e[n]=U(e[r])),s&&this.checkIdentifier(e[n],l?4098:4096)}};function Ji(a){if(a.type!=="MemberExpression")return!1;let{computed:t,property:e}=a;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:ss(a.object)}function Wi(a,t){var e;let{type:s}=a;if((e=a.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){let{value:i}=a;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(ts(a,t)||Xi(a,t)||s==="TemplateLiteral"&&a.expressions.length===0||Ji(a))}function ts(a,t){return t?a.type==="Literal"&&(typeof a.value=="number"||"bigint"in a):a.type==="NumericLiteral"||a.type==="BigIntLiteral"}function Xi(a,t){if(a.type==="UnaryExpression"){let{operator:e,argument:s}=a;if(e==="-"&&ts(s,t))return!0}return!1}function ss(a){return a.type==="Identifier"?!0:a.type!=="MemberExpression"||a.computed?!1:ss(a.object)}var Ut=_`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Gi=a=>class extends a{parsePlaceholder(e){if(this.match(133)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let i=e;return(!i.expectedNode||!i.type)&&(i=this.finishNode(i,"Placeholder")),i.expectedNode=s,i}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,i,r){e!==void 0&&super.checkReservedWord(e,s,i,r)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,i){return e==="Placeholder"||super.isValidLVal(e,s,i)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===133)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var i;if(s.type!=="Placeholder"||(i=s.extra)!=null&&i.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let n=e;return n.label=this.finishPlaceholder(s,"Identifier"),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,"LabeledStatement")}this.semicolon();let r=e;return r.name=s.name,this.finishPlaceholder(r,"Statement")}parseBlock(e,s,i){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,i)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,i){let r=s?"ClassDeclaration":"ClassExpression";this.next();let n=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(133)||this.match(5))e.id=o;else{if(i||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,r);throw this.raise(Ut.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,i);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,n),this.finishNode(e,r)}parseExport(e,s){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseExport(e,s);let r=e;if(!this.isContextual(98)&&!this.match(12))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(i,"Declaration"),this.finishNode(r,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let n=this.startNode();return n.exported=i,r.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],super.parseExport(r,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(q(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var i;return(i=e.specifiers)!=null&&i.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(i=>i.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let i=this.startNodeAtNode(s);return i.local=s,e.specifiers.push(this.finishNode(i,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(Ut.UnexpectedSpace,this.state.lastTokEndLoc)}},Yi=a=>class extends a{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),E(this.state.type)){let i=this.parseIdentifierName(),r=this.createIdentifier(s,i);if(r.type="V8IntrinsicIdentifier",this.match(10))return r}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},jt=["minimal","fsharp","hack","smart"],$t=["^^","@@","^","%","#"];function Qi(a){if(a.has("decorators")){if(a.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let e=a.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let s=a.get("decorators").allowCallParenthesized;if(s!=null&&typeof s!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(a.has("flow")&&a.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(a.has("placeholders")&&a.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(a.has("pipelineOperator")){var t;let e=a.get("pipelineOperator").proposal;if(!jt.includes(e)){let i=jt.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}let s=((t=a.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash";if(e==="hack"){if(a.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(a.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=a.get("pipelineOperator").topicToken;if(!$t.includes(i)){let r=$t.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}if(i==="#"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}if(a.has("moduleAttributes")){if(a.has("deprecatedImportAssert")||a.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(a.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(a.has("importAssertions")&&a.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!a.has("deprecatedImportAssert")&&a.has("importAttributes")&&a.get("importAttributes").deprecatedAssertSyntax&&a.set("deprecatedImportAssert",{}),a.has("recordAndTuple")){let e=a.get("recordAndTuple").syntaxType;if(e!=null){let s=["hash","bar"];if(!s.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+s.map(i=>`'${i}'`).join(", "))}}if(a.has("asyncDoExpressions")&&!a.has("doExpressions")){let e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(a.has("optionalChainingAssign")&&a.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var is={estree:ti,jsx:zi,flow:$i,typescript:Hi,v8intrinsic:Yi,placeholders:Gi},Zi=Object.keys(is),ot=class extends nt{checkProto(t,e,s,i){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;let r=t.key;if((r.type==="Identifier"?r.name:r.value)==="__proto__"){if(e){this.raise(p.RecordNoProto,r);return}s.used&&(i?i.doubleProtoLoc===null&&(i.doubleProtoLoc=r.loc.start):this.raise(p.DuplicateProto,r)),s.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===e}getExpression(){this.enterInitialScopes(),this.nextToken();let t=this.parseExpression();return this.match(140)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&128&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let i=this.startNodeAt(e);for(i.expressions=[s];this.eat(12);)i.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(i.expressions),this.finishNode(i,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var s;t.optionalParametersLoc=(s=e==null?void 0:e.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,s)),o}let i;t?i=!1:(t=new Z,i=!0);let{type:r}=this.state;(r===10||E(r))&&(this.state.potentialArrowAt=this.state.start);let n=this.parseMaybeConditional(t);if(e&&(n=e.call(this,n,s)),ni(this.state.type)){let o=this.startNodeAt(s),h=this.state.value;if(o.operator=h,this.match(29)){this.toAssignable(n,!0),o.left=n;let l=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=l&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=l&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=l&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else o.left=n;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(n,this.finishNode(o,"AssignmentExpression")),o}else i&&this.checkExpressionErrors(t,!0);return n}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprOps(t);return this.shouldExitDescending(i,s)?i:this.parseConditional(i,e,t)}parseConditional(t,e,s){if(this.eat(17)){let i=this.startNodeAt(e);return i.test=t,i.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(i,s)?i:this.parseExprOp(i,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let r=this.getPrivateNameSV(t);(s>=Ce(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(p.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t.loc.start)}let i=this.state.type;if(hi(i)&&(this.prodParam.hasIn||!this.match(58))){let r=Ce(i);if(r>s){if(i===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let n=this.startNodeAt(e);n.left=t,n.operator=this.state.value;let o=i===41||i===42,h=i===40;if(h&&(r=Ce(42)),this.next(),i===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(p.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);n.right=this.parseExprOpRightExpr(i,r);let l=this.finishNode(n,o||h?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(h&&(c===41||c===42)||o&&c===40)throw this.raise(p.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(p.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,fi(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return Ws.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(p.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(p.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,i=this.isContextual(96);if(i&&this.recordAwaitIfAllowed()){this.next();let h=this.parseAwait(s);return e||this.checkExponentialAfterUnary(h),h}let r=this.match(34),n=this.startNode();if(ci(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let h=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&h){let l=n.argument;l.type==="Identifier"?this.raise(p.StrictDelete,n):this.hasPropertyAsPrivateName(l)&&this.raise(p.DeletePrivateField,n)}if(!r)return e||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let o=this.parseUpdate(n,r,t);if(i){let{type:h}=this.state;if((this.hasPlugin("v8intrinsic")?Ve(h):Ve(h)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(p.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){let n=t;return this.checkLVal(n.argument,this.finishNode(n,"UpdateExpression")),t}let i=this.state.startLoc,r=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return r;for(;li(this.state.type)&&!this.canInsertSemicolon();){let n=this.startNodeAt(i);n.operator=this.state.value,n.prefix=!1,n.argument=r,this.next(),this.checkLVal(r,r=this.finishNode(n,"UpdateExpression"))}return r}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprAtom(t);return this.shouldExitDescending(i,s)?i:this.parseSubscripts(i,e)}parseSubscripts(t,e,s){let i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,i),i.maybeAsyncArrow=!1;while(!i.stop);return t}parseSubscript(t,e,s,i){let{type:r}=this.state;if(!s&&r===15)return this.parseBind(t,e,s,i);if(Ne(r))return this.parseTaggedTemplateExpression(t,e,i);let n=!1;if(r===18){if(s&&(this.raise(p.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return i.stop=!0,t;i.optionalChainMember=n=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,i,n);{let o=this.eat(0);return o||n||this.eat(16)?this.parseMember(t,e,i,o,n):(i.stop=!0,t)}}parseMember(t,e,s,i,r){let n=this.startNodeAt(e);return n.object=t,n.computed=i,i?(n.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(p.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),s.optionalChainMember?(n.optional=r,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(t,e,s,i){let r=this.startNodeAt(e);return r.object=t,this.next(),r.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,i){let r=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:h,optionalChainMember:l}=s;h&&(this.expressionScope.enter(Mi()),n=new Z),l&&(o.optional=i),i?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type!=="Super",o,n);let c=this.finishCallExpression(o,l);return h&&this.shouldParseAsyncArrow()&&!i?(s.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),c)):(h&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(c)),this.state.maybeInArrowParameters=r,c}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let i=this.startNodeAt(e);return i.tag=t,i.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(p.OptionalChainingNoTemplate,e),this.finishNode(i,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(p.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(p.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,i){let r=[],n=!0,o=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}r.push(this.parseExprListItem(!1,i,e))}return this.state.inFSharpPipelineDirectBody=o,r}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&de(t,e.innerComments),e.callee.trailingComments&&de(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.optionFlags&256?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(p.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let r=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(r)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,t);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let r=e.callee=this.parseNoCallExpr();if(r.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(p.UnsupportedBind,r)}case 139:return this.raise(p.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let r=this.getPluginOption("pipelineOperator","proposal");if(r)return this.parseTopicReference(r);this.unexpected();break}case 47:{let r=this.input.codePointAt(this.nextTokenStart());R(r)||r===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(i===137)return this.parseDecimalLiteral(this.state.value);if(E(i)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let r=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:h}=this.state;if(h===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(E(h))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(h===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return r&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=v(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(e,s,t,i)}finishTopicReference(t,e,s,i){if(this.testTopicReferenceConfiguration(s,e,i))return s==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PrimaryTopicNotAllowed,e),this.registerTopicReference(),this.finishNode(t,"PipelinePrimaryTopicReference"));throw this.raise(p.PipeTopicUnconfiguredToken,e,{token:q(i)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:q(s)}]);case"smart":return s===27;default:throw this.raise(p.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Ee(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(p.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!(this.optionFlags&16)?this.raise(p.SuperNotAllowed,t):!this.scope.allowSuper&&!(this.optionFlags&16)&&this.raise(p.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(p.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(v(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let i=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||i)&&this.raise(p.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){let e=this.createIdentifier(this.startNodeAtNode(t),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(p.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let s=this.isContextual(105);if(this.expectPlugin(s?"sourcePhaseImports":"deferredImportEvaluation"),!(this.optionFlags&256))throw this.raise(p.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),t.phase=s?"source":"defer",this.parseImportCall(t)}return this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(Di());let i=this.state.maybeInArrowParameters,r=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],h=new Z,l=!0,c,u;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,h.optionalParametersLoc===null?null:h.optionalParametersLoc),this.match(11)){u=this.state.startLoc;break}if(this.match(21)){let x=this.state.startLoc;if(c=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),x)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(h,this.parseParenItem))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=r;let d=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(h),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),u&&this.unexpected(u),c&&this.unexpected(c),this.checkExpressionErrors(h,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(n),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,f)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!(this.optionFlags&512))return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!(this.optionFlags&4)&&this.raise(p.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(p.ImportCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:i,value:r}=this.state,n=e+1,o=this.startNodeAt(v(s,1));r===null&&(t||this.raise(p.InvalidEscapeSequenceTemplate,v(this.state.firstInvalidTemplateEscapePos,1)));let h=this.match(24),l=h?-1:-2,c=i+l;o.value={raw:this.input.slice(n,c).replace(/\r\n?/g,` +`),cooked:r===null?null:r.slice(1,l)},o.tail=h,this.next();let u=this.finishNode(o,"TemplateElement");return this.resetEndLocation(u,v(this.state.lastTokEndLoc,l)),u}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),i=[s],r=[];for(;!s.tail;)r.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(s=this.parseTemplateElement(t));return e.expressions=r,e.quasis=i,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=Object.create(null),o=!0,h=this.startNode();for(h.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(h);break}let c;e?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(i),this.checkProto(c,s,n,i)),s&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(p.InvalidRecordProperty,c),c.shorthand&&this.addExtra(c,"shorthand",!0),h.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=r;let l="ObjectExpression";return e?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(h,l)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(p.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),i=!1,r=!1,n;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let h=this.state.containsEsc;if(this.parsePropertyName(s,t),!o&&!h&&this.maybeAsyncOrAccessorProp(s)){let{key:l}=s,c=l.name;c==="async"&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(l),o=this.eat(55),this.parsePropertyName(s)),(c==="get"||c==="set")&&(r=!0,this.resetPreviousNodeTrailingComments(l),s.kind=c,this.match(55)&&(o=!0,this.raise(p.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,n,o,i,!1,r,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),i=this.getObjectOrClassMethodParams(t);i.length!==s&&this.raise(t.kind==="get"?p.BadGetterArity:p.BadSetterArity,t),t.kind==="set"&&((e=i[i.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(p.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,i,r){if(r){let n=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(s||e||this.match(10))return i&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,i){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(i),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,U(t.key));else if(this.match(29)){let r=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=r):this.raise(p.InvalidCoverInitializedName,r),t.value=this.parseMaybeDefault(e,U(t.key))}else t.value=U(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,i,r,n,o){let h=this.parseObjectMethod(t,s,i,r,n)||this.parseObjectProperty(t,e,r,o);return h||this.unexpected(),h}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:i}=this.state,r;if(D(s))r=this.parseIdentifier(!0);else switch(s){case 135:r=this.parseNumericLiteral(i);break;case 134:r=this.parseStringLiteral(i);break;case 136:r=this.parseBigIntLiteral(i);break;case 139:{let n=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=n):this.raise(p.UnexpectedPrivateField,n),r=this.parsePrivateName();break}default:if(s===137){r=this.parseDecimalLiteral(i);break}this.unexpected()}t.key=r,s!==139&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,i,r,n,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(o?64:0)|(r?32:0)),this.prodParam.enter(Ee(s,t.generator)),this.parseFunctionParams(t,i);let h=this.parseFunctionBodyAndFinish(t,n,!0);return this.prodParam.exit(),this.scope.exit(),h}parseArrayLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(t,!s,i,n),this.state.inFSharpPipelineDirectBody=r,this.finishNode(n,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,i){this.scope.enter(6);let r=Ee(s,!1);!this.match(5)&&this.prodParam.hasIn&&(r|=8),this.prodParam.enter(r),this.initFunction(t,s);let n=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let i=e&&!this.match(5);if(this.expressionScope.enter(Zt()),i)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let r=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,o=>{let h=!this.isSimpleParamList(t.params);o&&h&&this.raise(p.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let l=!r&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!h,e,l),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,l)}),this.prodParam.exit(),this.state.labels=n}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e10||!Si(t))return;if(s&&Ti(t)){this.raise(p.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?i?Xt:Jt:Ht)(t,this.inModule)){this.raise(p.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(p.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(p.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(p.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(p.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait||this.optionFlags&1&&!this.scope.inFunction;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(p.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(p.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||Ne(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){let t=this.startNode();this.expressionScope.recordParameterInitializerError(p.YieldInParameter,t),this.next();let e=!1,s=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:s=this.parseMaybeAssign()}return t.delegate=e,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)&&!this.match(11)&&(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(p.ImportCallArity,t)}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(p.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(p.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},$e={kind:1},er={kind:2},tr=/[\uD800-\uDFFF]/u,ze=/in(?:stanceof)?/y;function sr(a,t,e){for(let s=0;s0)for(let[r,n]of Array.from(this.scope.undefinedExports))this.raise(p.ModuleExportUndefined,n,{localName:r});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let i;return e===140?i=this.finishNode(t,"Program"):i=this.finishNodeAt(t,"Program",v(this.state.startLoc,-1)),i}stmtToDirective(t){let e=t;e.type="Directive",e.value=e.expression,delete e.expression;let s=e.value,i=s.value,r=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),n=s.value=r.slice(1,-1);return this.addExtra(s,"raw",r),this.addExtra(s,"rawValue",n),this.addExtra(s,"expressionValue",i),s.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(R(t)){if(ze.lastIndex=e,ze.test(this.input)){let s=this.codePointAtPos(ze.lastIndex);if(!Y(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){let{type:t,containsEsc:e}=this.lookahead();if(t===102&&!e)return!1;if(E(t)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,i=this.startNode(),r=!!(t&2),n=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?p.StrictFunction:this.options.annexB?p.SloppyFunctionAnnexB:p.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(i,!1,!r&&n);case 80:return r||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?r||this.raise(p.UnexpectedLexicalDeclaration,i):this.raise(p.AwaitUsingNotInAsyncContext,i),this.next(),this.parseVarStatement(i,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(p.UnexpectedUsingDeclaration,this.state.startLoc):r||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),u=this.codePointAtPos(c);if(u!==91&&(!r&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(u,c)&&u!==123))break}case 75:r||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(i,c)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!(this.optionFlags&8)&&!o&&this.raise(p.UnexpectedImportExport,this.state.startLoc),this.next();let c;return s===83?(c=this.parseImport(i),c.type==="ImportDeclaration"&&(!c.importKind||c.importKind==="value")&&(this.sawUnambiguousESM=!0)):(c=this.parseExport(i,e),(c.type==="ExportNamedDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportAllDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return r||this.raise(p.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(i,!0,!r&&n)}let h=this.state.value,l=this.parseExpression();return E(s)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(i,h,l,t):this.parseExpressionStatement(i,l,e)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(p.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){if(t){var i;(i=e.decorators)!=null&&i.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(p.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)}return e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(p.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(p.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let i=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(i,s);let r=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s,i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(p.DecoratorArgumentsOutsideParentheses,r)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let i=this.startNodeAt(e);i.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName()):i.property=this.parseIdentifier(!0),i.computed=!1,s=this.finishNode(i,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s,e)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,e){if(this.eat(10)){let s=this.startNodeAt(e);return s.callee=t,s.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push($e);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(100);{let h=this.isContextual(96)&&this.startsAwaitUsing(),l=h||this.isContextual(107)&&this.startsUsingForOf(),c=s&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||c){let u=this.startNode(),f;h?(f="await using",this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(u,!0,f);let d=this.finishNode(u,"VariableDeclaration"),x=this.match(58);return x&&l&&this.raise(p.ForInUsing,d),(x||this.isContextual(102))&&d.declarations.length===1?this.parseForIn(t,d,e):(e!==null&&this.unexpected(e),this.parseFor(t,d))}}let i=this.isContextual(95),r=new Z,n=this.parseExpression(!0,r),o=this.isContextual(102);if(o&&(s&&this.raise(p.ForOfLet,n),e===null&&i&&n.type==="Identifier"&&this.raise(p.ForOfAsync,n)),o||this.match(58)){this.checkDestructuringPrivate(r),this.toAssignable(n,!0);let h=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{type:h}),this.parseForIn(t,n,e)}else this.checkExpressionErrors(r,!0);return e!==null&&this.unexpected(e),this.parseFor(t,n)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!(this.optionFlags&2)&&this.raise(p.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(er),this.scope.enter(0);let s;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let r=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),r?s.test=this.parseExpression():(i&&this.raise(p.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),i=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(p.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(p.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push($e),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(p.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,i){for(let n of this.state.labels)n.name===e&&this.raise(p.LabelRedeclaration,s,{labelName:e});let r=oi(this.state.type)?1:this.match(71)?2:null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===t.start)o.statementStart=this.sourceToOffsetPos(this.state.start),o.kind=r;else break}return this.state.labels.push({name:e,kind:r,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=i&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let i=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(i,t,!1,8,s),e&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,i,r){let n=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(n,e?o:void 0,s,i,r)}parseBlockOrModuleBlockBody(t,e,s,i,r){let n=this.state.strict,o=!1,h=!1;for(;!this.match(i);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!h){if(this.isValidDirective(l)){let c=this.stmtToDirective(l);e.push(c),!o&&c.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}h=!0,this.state.strictErrors.clear()}t.push(l)}r==null||r.call(this,o),n||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let i=this.match(58);return this.next(),i?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(p.ForInOfLoopInitializer,e,{type:i?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(p.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,i=!1){let r=t.declarations=[];for(t.kind=s;;){let n=this.startNode();if(this.parseVarId(n,s),n.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!i&&(n.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),r.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(p.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,i=!!(e&1),r=i&&!(e&4),n=!!(e&8);this.initFunction(t,n),this.match(55)&&(s&&this.raise(p.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),i&&(t.id=this.parseFunctionId(r));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Ee(n,t.generator)),i||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||E(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Li()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,i),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},i=[],r=this.startNode();if(r.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(p.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}let n=this.startNode();i.length&&(n.decorators=i,this.resetStartLocationFromNode(n,i[0]),i=[]),this.parseClassMember(r,n,s),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(p.DecoratorConstructor,n)}}),this.state.strict=e,this.next(),i.length)throw this.raise(p.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(r,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let i=e;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(t,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=e;return i.computed=!1,i.key=s,i.static=!1,t.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,i)}parseClassMemberWithIsStatic(t,e,s,i){let r=e,n=e,o=e,h=e,l=e,c=r,u=r;if(e.static=i,this.parsePropertyNamePrefixOperator(e),this.eat(55)){c.kind="method";let w=this.match(139);if(this.parseClassElementName(c),w){this.pushClassPrivateMethod(t,n,!0,!1);return}this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsGenerator,r.key),this.pushClassMethod(t,r,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&E(this.state.type),d=this.parseClassElementName(e),x=f?d.name:null,S=this.isPrivateName(d),N=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(c.kind="method",S){this.pushClassPrivateMethod(t,n,!1,!1);return}let w=this.isNonstaticConstructor(r),I=!1;w&&(r.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(p.DuplicateConstructor,d),w&&this.hasPlugin("typescript")&&e.override&&this.raise(p.OverrideOnConstructor,d),s.hadConstructor=!0,I=s.hadSuperClass),this.pushClassMethod(t,r,!1,!1,w,I)}else if(this.isClassProperty())S?this.pushClassPrivateProperty(t,h):this.pushClassProperty(t,o);else if(x==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let w=this.eat(55);u.optional&&this.unexpected(N),c.kind="method";let I=this.match(139);this.parseClassElementName(c),this.parsePostMemberNameModifiers(u),I?this.pushClassPrivateMethod(t,n,w,!0):(this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsAsync,r.key),this.pushClassMethod(t,r,w,!0,!1,!1))}else if((x==="get"||x==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),c.kind=x;let w=this.match(139);this.parseClassElementName(r),w?this.pushClassPrivateMethod(t,n,!1,!1):(this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsAccessor,r.key),this.pushClassMethod(t,r,!1,!1,!1,!1)),this.checkGetterSetterParams(r)}else if(x==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let w=this.match(139);this.parseClassElementName(o),this.pushClassAccessorProperty(t,l,w)}else this.isLineTerminator()?S?this.pushClassPrivateProperty(t,h):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===132||e===134)&&t.static&&s==="prototype"&&this.raise(p.StaticPrototype,this.state.startLoc),e===139){s==="constructor"&&this.raise(p.ConstructorClassPrivateField,this.state.startLoc);let i=this.parsePrivateName();return t.key=i,i}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(208);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=e.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(p.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key);let i=this.parseClassAccessorProperty(e);t.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(t,e,s,i,r,n){t.body.push(this.parseMethod(e,s,i,r,n,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,i){let r=this.parseMethod(e,s,i,!1,!1,"ClassPrivateMethod",!0);t.body.push(r);let n=r.kind==="get"?r.static?6:2:r.kind==="set"?r.static?5:1:0;this.declareClassPrivateMethodInScope(r,n)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(Zt()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,i=8331){if(E(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,i);else if(s||!e)t.id=null;else throw this.raise(p.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),i=this.maybeParseExportDefaultSpecifier(t,s),r=!i||this.eat(12),n=r&&this.eatExportStar(t),o=n&&this.maybeParseExportNamespaceSpecifier(t),h=r&&(!o||this.eat(12)),l=i||n;if(n&&!o){if(i&&this.unexpected(),e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(t);i&&r&&!n&&!c&&this.unexpected(null,5),o&&h&&this.unexpected(null,98);let u;if(l||c){if(u=!1,e)throw this.raise(p.UnsupportedDecoratorExport,t);this.parseExportFrom(t,l)}else u=this.maybeParseExportDeclaration(t);if(l||c||u){var f;let d=t;if(this.checkExport(d,!0,!1,!!d.source),((f=d.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=t,x=this.parseExportDefaultExpression();if(d.declaration=x,x.type==="ClassDeclaration")this.maybeTakeDecorators(e,x,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.checkExport(d,!0,!0),this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);let s=e||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,t.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,s;(s=(e=t).specifiers)!=null||(e.specifiers=[]);let i=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),i.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(i,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(p.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(p.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(E(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let{type:i}=this.lookahead();if(E(i)&&i!==98||i===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||E(this.state.type)&&s)return!0;if(this.match(65)&&s){let i=this.input.charCodeAt(this.nextTokenStartSince(e+4));return i===34||i===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(p.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(p.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(p.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,i){if(e){var r;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized)&&this.raise(p.ExportDefaultFromAsIdentifier,o)}}else if((r=t.specifiers)!=null&&r.length)for(let o of t.specifiers){let{exported:h}=o,l=h.type==="Identifier"?h.name:h.value;if(this.checkDuplicateExports(o,l),!i&&o.local){let{local:c}=o;c.type!=="Identifier"?this.raise(p.ExportBindingIsString,o,{localName:c.value,exportName:l}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(t.declaration){let o=t.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:h}=o;if(!h)throw new Error("Assertion failure");this.checkDuplicateExports(t,h.name)}else if(o.type==="VariableDeclaration")for(let h of o.declarations)this.checkDeclaration(h.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(p.DuplicateDefaultExport,t):this.raise(p.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let i=this.isContextual(130),r=this.match(134),n=this.startNode();n.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(n,r,t,i))}return e}parseExportSpecifier(t,e,s,i){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=Fi(t.local):t.exported||(t.exported=U(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),e=tr.exec(t.value);return e&&this.raise(p.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(p.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(p.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var i;s!=="ImportDefaultSpecifier"&&this.raise(p.ImportReflectionNotBinding,e[0].loc.start),((i=t.assertions)==null?void 0:i.length)>0&&this.raise(p.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(i=>{let r;if(i.type==="ExportSpecifier"?r=i.local:i.type==="ImportSpecifier"&&(r=i.imported),r!==void 0)return r.type==="Identifier"?r.name!=="default":r.value!=="default"});s!==void 0&&this.raise(p.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,i){e||(s==="module"?(this.expectPlugin("importReflection",i),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",i),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",i),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.parseIdentifier(!0),{type:i}=this.state;return(D(i)?i!==98||this.lookaheadCharCode()===102:i!==12)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(t,e,s.name,s.loc.start),null):(this.applyImportPhase(t,e,null),s)}isPrecedingIdImportPhase(t){let{type:e}=this.state;return E(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),r=i&&this.maybeParseStarImportSpecifier(t);return i&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),i=this.state.value;if(e.has(i)&&this.raise(p.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i}),e.add(i),this.match(134)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(p.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(p.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():e=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(p.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(D(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(p.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),i=this.match(134),r=this.isContextual(130);s.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(s,i,t.importKind==="type"||t.importKind==="typeof",r,void 0);t.specifiers.push(n)}}parseImportSpecifier(t,e,s,i,r){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:n}=t;if(e)throw this.raise(p.ImportBindingIsString,t,{importName:n.value});this.checkReservedWord(n.name,t.loc.start,!0,!0),t.local||(t.local=U(n))}return this.finishImportSpecifier(t,"ImportSpecifier",r)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},ve=class extends ht{constructor(t,e,s){t=Zs(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename,this.startIndex=t.startIndex;let i=0;t.allowAwaitOutsideFunction&&(i|=1),t.allowReturnOutsideFunction&&(i|=2),t.allowImportExportEverywhere&&(i|=8),t.allowSuperOutsideMethod&&(i|=16),t.allowUndeclaredExports&&(i|=32),t.allowNewTargetOutsideFunction&&(i|=4),t.ranges&&(i|=64),t.tokens&&(i|=128),t.createImportExpressions&&(i|=256),t.createParenthesizedExpressions&&(i|=512),t.errorRecovery&&(i|=1024),t.attachComment&&(i|=2048),t.annexB&&(i|=4096),this.optionFlags=i}getScopeHandler(){return fe}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}};function ir(a,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let s=ce(t,a),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",ce(t,a).parse()}catch{}else i.program.sourceType="script";return i}catch(s){try{return t.sourceType="script",ce(t,a).parse()}catch{}throw s}}else return ce(t,a).parse()}function rr(a,t){let e=ce(t,a);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function ar(a){let t={};for(let e of Object.keys(a))t[e]=F(a[e]);return t}var nr=ar(ii);function ce(a,t){let e=ve,s=new Map;if(a!=null&&a.plugins){for(let i of a.plugins){let r,n;typeof i=="string"?r=i:[r,n]=i,s.has(r)||s.set(r,n||{})}Qi(s),e=or(s)}return new e(a,t,s)}var zt=new Map;function or(a){let t=[];for(let i of Zi)a.has(i)&&t.push(i);let e=t.join("|"),s=zt.get(e);if(!s){s=ve;for(let i of t)s=is[i](s);zt.set(e,s)}return s}me.parse=ir;me.parseExpression=rr;me.tokTypes=nr});var Jr={};zs(Jr,{parsers:()=>Hr});var Re=It(gt(),1);function Le(a){return(t,e,s)=>{let i=!!(s!=null&&s.backwards);if(e===!1)return!1;let{length:r}=t,n=e;for(;n>=0&&n{if(!(a&&t==null))return Array.isArray(t)||typeof t=="string"?t[e<0?t.length+e:e]:t.at(e)},Tt=dr;function mr(a){return Array.isArray(a)&&a.length>0}var ye=mr;function L(a){var s,i,r;let t=((s=a.range)==null?void 0:s[0])??a.start,e=(r=((i=a.declaration)==null?void 0:i.decorators)??a.decorators)==null?void 0:r[0];return e?Math.min(L(e),t):t}function j(a){var t;return((t=a.range)==null?void 0:t[1])??a.end}function yr(a){let t=new Set(a);return e=>t.has(e==null?void 0:e.type)}var ps=yr;var xr=ps(["Block","CommentBlock","MultiLine"]),xe=xr;function Pr(a){let t=`*${a.value}*`.split(` +`);return t.length>1&&t.every(e=>e.trimStart()[0]==="*")}var bt=Pr;function gr(a){return xe(a)&&a.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(a.value)}var us=gr;var Pe=null;function ge(a){if(Pe!==null&&typeof Pe.property){let t=Pe;return Pe=ge.prototype=null,t}return Pe=ge.prototype=a??Object.create(null),new ge}var Tr=10;for(let a=0;a<=Tr;a++)ge();function At(a){return ge(a)}function br(a,t="type"){At(a);function e(s){let i=s[t],r=a[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:s});return r}return e}var fs=br;var ds={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var Ar=fs(ds),ms=Ar;function St(a,t){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a)){for(let s=0;s{var n;(n=r.leadingComments)!=null&&n.some(us)&&i.add(L(r))}),a=Me(a,r=>{if(r.type==="ParenthesizedExpression"){let{expression:n}=r;if(n.type==="TypeCastExpression")return n.range=[...r.range],n;let o=L(r);if(!i.has(o))return n.extra={...n.extra,parenthesized:!0},n}})}if(a=Me(a,i=>{switch(i.type){case"LogicalExpression":if(ys(i))return wt(i);break;case"VariableDeclaration":{let r=Tt(!1,i.declarations,-1);r!=null&&r.init&&s[j(r)]!==";"&&(i.range=[L(i),j(r)]);break}case"TSParenthesizedType":return i.typeAnnotation;case"TSTypeParameter":if(typeof i.name=="string"){let r=L(i);i.name={type:"Identifier",name:i.name,range:[r,r+i.name.length]}}break;case"TopicReference":a.extra={...a.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(i.types.length===1)return i.types[0];break}}),ye(a.comments)){let i=Tt(!1,a.comments,-1);for(let r=a.comments.length-2;r>=0;r--){let n=a.comments[r];j(n)===L(i)&&xe(n)&&xe(i)&&bt(n)&&bt(i)&&(a.comments.splice(r+1,1),n.value+="*//*"+i.value,n.range=[L(n),j(i)]),i=n}}return a.type==="Program"&&(a.range=[0,s.length]),a}function ys(a){return a.type==="LogicalExpression"&&a.right.type==="LogicalExpression"&&a.operator===a.right.operator}function wt(a){return ys(a)?wt({type:"LogicalExpression",operator:a.operator,left:wt({type:"LogicalExpression",operator:a.operator,left:a.left,right:a.right.left,range:[L(a.left),j(a.right.left)]}),right:a.right.right,range:[L(a),j(a)]}):a}var xs=Sr;function wr(a,t){let e=new SyntaxError(a+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(e,t)}var Oe=wr;function Cr(a){let{message:t,loc:{line:e,column:s},reasonCode:i}=a,r=a;(i==="MissingPlugin"||i==="MissingOneOfPlugins")&&(t="Unexpected token.",r=void 0);let n=` (${e}:${s})`;return t.endsWith(n)&&(t=t.slice(0,-n.length)),Oe(t,{loc:{start:{line:e,column:s+1}},cause:r})}var Fe=Cr;var Er=(a,t,e,s)=>{if(!(a&&t==null))return t.replaceAll?t.replaceAll(e,s):e.global?t.replace(e,s):t.split(e).join(s)},ie=Er;var Ir=/\*\/$/,Nr=/^\/\*\*?/,kr=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,vr=/(^|\s+)\/\/([^\n\r]*)/g,Ps=/^(\r?\n)+/,Lr=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,gs=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,Dr=/(\r?\n|^) *\* ?/g,Mr=[];function Ts(a){let t=a.match(kr);return t?t[0].trimStart():""}function bs(a){let t=` +`;a=ie(!1,a.replace(Nr,"").replace(Ir,""),Dr,"$1");let e="";for(;e!==a;)e=a,a=ie(!1,a,Lr,`${t}$1 $2${t}`);a=a.replace(Ps,"").trimEnd();let s=Object.create(null),i=ie(!1,a,gs,"").replace(Ps,"").trimEnd(),r;for(;r=gs.exec(a);){let n=ie(!1,r[2],vr,"");if(typeof s[r[1]]=="string"||Array.isArray(s[r[1]])){let o=s[r[1]];s[r[1]]=[...Mr,...Array.isArray(o)?o:[o],n]}else s[r[1]]=n}return{comments:i,pragmas:s}}function Or(a){let t=De(a);t&&(a=a.slice(t.length+1));let e=Ts(a),{pragmas:s,comments:i}=bs(e);return{shebang:t,text:a,pragmas:s,comments:i}}function As(a){let{pragmas:t}=Or(a);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function Fr(a){return a=typeof a=="function"?{parse:a}:a,{astFormat:"estree",hasPragma:As,locStart:L,locEnd:j,...a}}var X=Fr;function Br(a){let{filepath:t}=a;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs")||t.endsWith(".cts"))return"script";if(t.endsWith(".mjs")||t.endsWith(".mts"))return"module"}}var Ss=Br;function Rr(a,t){let{type:e="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:r,comments:n}=a;return delete a.tokens,delete a.comments,{tokens:r,comments:n,type:e,node:a,range:[0,i.length],rootMarker:s}}var Be=Rr;var re=a=>X(zr(a)),_r={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","explicitResourceManagement","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}],"recordAndTuple"],tokens:!0,ranges:!0},ws="v8intrinsic",Cs=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],$=(a,t=_r)=>({...t,plugins:[...t.plugins,...a]}),Ur=/@(?:no)?flow\b/u;function jr(a,t){var i;if((i=t.filepath)!=null&&i.endsWith(".js.flow"))return!0;let e=De(a);e&&(a=a.slice(e.length));let s=ls(a,0);return s!==!1&&(a=a.slice(0,s)),Ur.test(a)}function $r(a,t,e){let s=a(t,e),i=s.errors.find(r=>!Vr.has(r.reasonCode));if(i)throw i;return s}function zr({isExpression:a=!1,optionsCombinations:t}){return(e,s={})=>{if((s.parser==="babel"||s.parser==="__babel_estree")&&jr(e,s))return s.parser="babel-flow",Ls.parse(e,s);let i=t;(s.__babelSourceType??Ss(s))==="script"&&(i=i.map(l=>({...l,sourceType:"script"})));let n=/%[A-Z]/u.test(e);e.includes("|>")?i=(n?[...Cs,ws]:Cs).flatMap(c=>i.map(u=>$([c],u))):n&&(i=i.map(l=>$([ws],l)));let o=a?Re.parseExpression:Re.parse,h;try{h=cs(i.map(l=>()=>$r(o,e,l)))}catch({errors:[l]}){throw Fe(l)}return a&&(h=Be(h,{text:e,rootMarker:s.rootMarker})),xs(h,{parser:"babel",text:e})}}var Vr=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","ImportAttributesUseAssert"]),vs=[$(["jsx"])],Es=re({optionsCombinations:vs}),Is=re({optionsCombinations:[$(["jsx","typescript"]),$(["typescript"])]}),Ns=re({isExpression:!0,optionsCombinations:[$(["jsx"])]}),ks=re({isExpression:!0,optionsCombinations:[$(["typescript"])]}),Ls=re({optionsCombinations:[$(["jsx",["flow",{all:!0}],"flowComments"])]}),qr=re({optionsCombinations:vs.map(a=>$(["estree"],a))}),Ds={babel:Es,"babel-flow":Ls,"babel-ts":Is,__js_expression:Ns,__ts_expression:ks,__vue_expression:Ns,__vue_ts_expression:ks,__vue_event_binding:Es,__vue_ts_event_binding:Is,__babel_estree:qr};var Ms=It(gt(),1);function Os(a={}){let{allowComments:t=!0}=a;return function(s){let i;try{i=(0,Ms.parseExpression)(s,{tokens:!0,ranges:!0,attachComment:!1})}catch(r){throw Fe(r)}if(!t&&ye(i.comments))throw K(i.comments[0],"Comment");return ae(i),Be(i,{type:"JsonRoot",text:s})}}function K(a,t){let[e,s]=[a.loc.start,a.loc.end].map(({line:i,column:r})=>({line:i,column:r+1}));return Oe(`${t} is not allowed in JSON.`,{loc:{start:e,end:s}})}function ae(a){switch(a.type){case"ArrayExpression":for(let t of a.elements)t!==null&&ae(t);return;case"ObjectExpression":for(let t of a.properties)ae(t);return;case"ObjectProperty":if(a.computed)throw K(a.key,"Computed key");if(a.shorthand)throw K(a.key,"Shorthand property");a.key.type!=="Identifier"&&ae(a.key),ae(a.value);return;case"UnaryExpression":{let{operator:t,argument:e}=a;if(t!=="+"&&t!=="-")throw K(a,`Operator '${a.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw K(e,`Operator '${t}' before '${e.type}'`)}case"Identifier":if(a.name!=="Infinity"&&a.name!=="NaN"&&a.name!=="undefined")throw K(a,`Identifier '${a.name}'`);return;case"TemplateLiteral":if(ye(a.expressions))throw K(a.expressions[0],"'TemplateLiteral' with expression");for(let t of a.quasis)ae(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw K(a,`'${a.type}'`)}}var Ct=Os(),Kr={json:X({parse:Ct,hasPragma(){return!0}}),json5:X(Ct),jsonc:X(Ct),"json-stringify":X({parse:Os({allowComments:!1}),astFormat:"estree-json"})},Fs=Kr;var Hr={...Ds,...Fs};return Vs(Jr);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/babel.mjs b/node_modules/prettier/plugins/babel.mjs new file mode 100644 index 0000000..00351ee --- /dev/null +++ b/node_modules/prettier/plugins/babel.mjs @@ -0,0 +1,15 @@ +var Bs=Object.create;var Re=Object.defineProperty;var Rs=Object.getOwnPropertyDescriptor;var _s=Object.getOwnPropertyNames;var Us=Object.getPrototypeOf,js=Object.prototype.hasOwnProperty;var $s=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),zs=(a,t)=>{for(var e in t)Re(a,e,{get:t[e],enumerable:!0})},Vs=(a,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _s(t))!js.call(a,i)&&i!==e&&Re(a,i,{get:()=>t[i],enumerable:!(s=Rs(t,i))||s.enumerable});return a};var It=(a,t,e)=>(e=a!=null?Bs(Us(a)):{},Vs(t||!a||!a.__esModule?Re(e,"default",{value:a,enumerable:!0}):e,a));var gt=$s(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});function qs(a,t){if(a==null)return{};var e={};for(var s in a)if({}.hasOwnProperty.call(a,s)){if(t.includes(s))continue;e[s]=a[s]}return e}var O=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},ee=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function v(a,t){let{line:e,column:s,index:i}=a;return new O(e,s+t,i+t)}var Nt="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Ks={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Nt},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Nt}},kt={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Se=a=>a.type==="UpdateExpression"?kt.UpdateExpression[`${a.prefix}`]:kt[a.type],Hs={AccessorIsGenerator:({kind:a})=>`A ${a}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:a})=>`Missing initializer in ${a} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:a})=>`\`${a}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:a})=>`'import.${a}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:a,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`. +- Did you mean \`export { '${a}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:a})=>`'${a==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:a})=>`Unsyntactic ${a==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:a})=>`A string literal cannot be used as an imported binding. +- Did you mean \`import { "${a}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:a})=>`Expected number in radix ${a}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:a})=>`Escape sequence in keyword ${a}.`,InvalidIdentifier:({identifierName:a})=>`Invalid identifier ${a}.`,InvalidLhs:({ancestor:a})=>`Invalid left-hand side in ${Se(a)}.`,InvalidLhsBinding:({ancestor:a})=>`Binding invalid left-hand side in ${Se(a)}.`,InvalidLhsOptionalChaining:({ancestor:a})=>`Invalid optional chaining in the left-hand side of ${Se(a)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:a})=>`Unexpected character '${a}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:a})=>`Private name #${a} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:a})=>`Label '${a}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:a})=>`This experimental syntax requires enabling the parser plugin: ${a.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:a})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${a.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:a})=>`Duplicate key "${a}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:a})=>`An export name cannot include a lone surrogate, found '\\u${a.toString(16)}'.`,ModuleExportUndefined:({localName:a})=>`Export '${a}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:a})=>`Private names are only allowed in property accesses (\`obj.#${a}\`) or in \`in\` expressions (\`#${a} in obj\`).`,PrivateNameRedeclaration:({identifierName:a})=>`Duplicate private name #${a}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:a})=>`Unexpected keyword '${a}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:a})=>`Unexpected reserved word '${a}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:a,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${a?`, expected "${a}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:a,onlyValidPropertyName:t})=>`The only valid meta property for ${a} is ${a}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:a})=>`Identifier '${a}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Js={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:a})=>`Assigning to '${a}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:a})=>`Binding '${a}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Ws=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Xs=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:a})=>`Invalid topic token ${a}. In order to use ${a} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${a}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:a})=>`Hack-style pipe body cannot be an unparenthesized ${Se({type:a})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),Gs=["message"];function vt(a,t,e){Object.defineProperty(a,t,{enumerable:!1,configurable:!0,value:e})}function Ys({toMessage:a,code:t,reasonCode:e,syntaxPlugin:s}){let i=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let r={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};r[e]&&(e=r[e])}return function r(n,o){let h=new SyntaxError;return h.code=t,h.reasonCode=e,h.loc=n,h.pos=n.index,h.syntaxPlugin=s,i&&(h.missingPlugin=o.missingPlugin),vt(h,"clone",function(c={}){var u;let{line:f,column:d,index:x}=(u=c.loc)!=null?u:n;return r(new O(f,d,x),Object.assign({},o,c.details))}),vt(h,"details",o),Object.defineProperty(h,"message",{configurable:!0,get(){let l=`${a(o)} (${n.line}:${n.column})`;return this.message=l,l},set(l){Object.defineProperty(this,"message",{value:l,writable:!0})}}),h}}function _(a,t){if(Array.isArray(a))return s=>_(s,a[0]);let e={};for(let s of Object.keys(a)){let i=a[s],r=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=r,o=qs(r,Gs),h=typeof n=="string"?()=>n:n;e[s]=Ys(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:h},t?{syntaxPlugin:t}:{},o))}return e}var p=Object.assign({},_(Ks),_(Hs),_(Js),_`pipelineOperator`(Xs));function Qs(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Zs(a){let t=Qs();if(a==null)return t;if(a.annexB!=null&&a.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let e of Object.keys(t))a[e]!=null&&(t[e]=a[e]);if(t.startLine===1)a.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:a.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((a.startColumn==null||a.startIndex==null)&&a.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return t}var{defineProperty:ei}=Object,Lt=(a,t)=>{a&&ei(a,t,{enumerable:!1,value:a[t]})};function oe(a){return Lt(a.loc.start,"index"),Lt(a.loc.end,"index"),a}var ti=a=>class extends a{parse(){let e=oe(super.parse());return this.optionFlags&128&&(e.tokens=e.tokens.map(oe)),e}parseRegExpLiteral({pattern:e,flags:s}){let i=null;try{i=new RegExp(e,s)}catch{}let r=this.estreeParseLiteral(i);return r.regex={pattern:e,flags:s},r}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let i=this.estreeParseLiteral(s);return i.bigint=String(i.value||e),i}parseDecimalLiteral(e){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||e),i}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){let s=e.value;delete e.value,s.type="Literal",s.raw=s.extra.raw,s.value=s.extra.expressionValue;let i=e;return i.type="ExpressionStatement",i.expression=s,i.directive=s.extra.rawValue,delete s.extra,i}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,i,r,n){super.parseBlockBody(e,s,i,r,n);let o=e.directives.map(h=>this.directiveToStmt(h));e.body=o.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let i=super.parseLiteral(e,s);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(e,s,i=!1){super.parseFunctionBody(e,s,i),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,i,r,n,o,h=!1){let l=this.startNode();l.kind=e.kind,l=super.parseMethod(l,s,i,r,n,o,h),l.type="FunctionExpression",delete l.kind,e.value=l;let{typeParameters:c}=e;return c&&(delete e.typeParameters,l.typeParameters=c,this.resetStartLocationFromNode(l,c)),o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition",s.computed=!1),s}parseObjectMethod(e,s,i,r,n){let o=super.parseObjectMethod(e,s,i,r,n);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,s,i,r){let n=super.parseObjectProperty(e,s,i,r);return n&&(n.kind="init",n.type="Property"),n}isValidLVal(e,s,i){return e==="Property"?"value":super.isValidLVal(e,s,i)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:i,value:r}=e;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(r,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,i){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(p.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(p.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,i)}finishCallExpression(e,s){let i=super.finishCallExpression(e,s);if(i.callee.type==="Import"){var r,n;i.type="ImportExpression",i.source=i.arguments[0],i.options=(r=i.arguments[1])!=null?r:null,i.attributes=(n=i.arguments[1])!=null?n:null,delete i.arguments,delete i.callee}return i}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let i=this.state.lastTokStartLoc,r=super.parseExport(e,s);switch(r.type){case"ExportAllDeclaration":r.exported=null;break;case"ExportNamedDeclaration":r.specifiers.length===1&&r.specifiers[0].type==="ExportNamespaceSpecifier"&&(r.type="ExportAllDeclaration",r.exported=r.specifiers[0].exported,delete r.specifiers);case"ExportDefaultDeclaration":{var n;let{declaration:o}=r;(o==null?void 0:o.type)==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===r.start&&this.resetStartLocation(r,i)}break}return r}parseSubscript(e,s,i,r){let n=super.parseSubscript(e,s,i,r);if(r.optionalChainMember){if((n.type==="OptionalMemberExpression"||n.type==="OptionalCallExpression")&&(n.type=n.type.substring(8)),r.stop){let o=this.startNodeAtNode(n);return o.expression=n,this.finishNode(o,"ChainExpression")}}else(n.type==="MemberExpression"||n.type==="CallExpression")&&(n.optional=!1);return n}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,s,i){return oe(super.finishNodeAt(e,s,i))}resetStartLocation(e,s){super.resetStartLocation(e,s),oe(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),oe(e)}},W=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},C={brace:new W("{"),j_oTag:new W("...",!0)};C.template=new W("`",!0);var b=!0,m=!0,_e=!0,he=!0,z=!0,si=!0,Ee=class{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},lt=new Map;function A(a,t={}){t.keyword=a;let e=P(a,t);return lt.set(a,e),e}function k(a,t){return P(a,{beforeExpr:b,binop:t})}var pe=-1,B=[],ct=[],pt=[],ut=[],ft=[],dt=[];function P(a,t={}){var e,s,i,r;return++pe,ct.push(a),pt.push((e=t.binop)!=null?e:-1),ut.push((s=t.beforeExpr)!=null?s:!1),ft.push((i=t.startsExpr)!=null?i:!1),dt.push((r=t.prefix)!=null?r:!1),B.push(new Ee(a,t)),pe}function T(a,t={}){var e,s,i,r;return++pe,lt.set(a,pe),ct.push(a),pt.push((e=t.binop)!=null?e:-1),ut.push((s=t.beforeExpr)!=null?s:!1),ft.push((i=t.startsExpr)!=null?i:!1),dt.push((r=t.prefix)!=null?r:!1),B.push(new Ee("name",t)),pe}var ii={bracketL:P("[",{beforeExpr:b,startsExpr:m}),bracketHashL:P("#[",{beforeExpr:b,startsExpr:m}),bracketBarL:P("[|",{beforeExpr:b,startsExpr:m}),bracketR:P("]"),bracketBarR:P("|]"),braceL:P("{",{beforeExpr:b,startsExpr:m}),braceBarL:P("{|",{beforeExpr:b,startsExpr:m}),braceHashL:P("#{",{beforeExpr:b,startsExpr:m}),braceR:P("}"),braceBarR:P("|}"),parenL:P("(",{beforeExpr:b,startsExpr:m}),parenR:P(")"),comma:P(",",{beforeExpr:b}),semi:P(";",{beforeExpr:b}),colon:P(":",{beforeExpr:b}),doubleColon:P("::",{beforeExpr:b}),dot:P("."),question:P("?",{beforeExpr:b}),questionDot:P("?."),arrow:P("=>",{beforeExpr:b}),template:P("template"),ellipsis:P("...",{beforeExpr:b}),backQuote:P("`",{startsExpr:m}),dollarBraceL:P("${",{beforeExpr:b,startsExpr:m}),templateTail:P("...`",{startsExpr:m}),templateNonTail:P("...${",{beforeExpr:b,startsExpr:m}),at:P("@"),hash:P("#",{startsExpr:m}),interpreterDirective:P("#!..."),eq:P("=",{beforeExpr:b,isAssign:he}),assign:P("_=",{beforeExpr:b,isAssign:he}),slashAssign:P("_=",{beforeExpr:b,isAssign:he}),xorAssign:P("_=",{beforeExpr:b,isAssign:he}),moduloAssign:P("_=",{beforeExpr:b,isAssign:he}),incDec:P("++/--",{prefix:z,postfix:si,startsExpr:m}),bang:P("!",{beforeExpr:b,prefix:z,startsExpr:m}),tilde:P("~",{beforeExpr:b,prefix:z,startsExpr:m}),doubleCaret:P("^^",{startsExpr:m}),doubleAt:P("@@",{startsExpr:m}),pipeline:k("|>",0),nullishCoalescing:k("??",1),logicalOR:k("||",1),logicalAND:k("&&",2),bitwiseOR:k("|",3),bitwiseXOR:k("^",4),bitwiseAND:k("&",5),equality:k("==/!=/===/!==",6),lt:k("/<=/>=",7),gt:k("/<=/>=",7),relational:k("/<=/>=",7),bitShift:k("<>/>>>",8),bitShiftL:k("<>/>>>",8),bitShiftR:k("<>/>>>",8),plusMin:P("+/-",{beforeExpr:b,binop:9,prefix:z,startsExpr:m}),modulo:P("%",{binop:10,startsExpr:m}),star:P("*",{binop:10}),slash:k("/",10),exponent:P("**",{beforeExpr:b,binop:11,rightAssociative:!0}),_in:A("in",{beforeExpr:b,binop:7}),_instanceof:A("instanceof",{beforeExpr:b,binop:7}),_break:A("break"),_case:A("case",{beforeExpr:b}),_catch:A("catch"),_continue:A("continue"),_debugger:A("debugger"),_default:A("default",{beforeExpr:b}),_else:A("else",{beforeExpr:b}),_finally:A("finally"),_function:A("function",{startsExpr:m}),_if:A("if"),_return:A("return",{beforeExpr:b}),_switch:A("switch"),_throw:A("throw",{beforeExpr:b,prefix:z,startsExpr:m}),_try:A("try"),_var:A("var"),_const:A("const"),_with:A("with"),_new:A("new",{beforeExpr:b,startsExpr:m}),_this:A("this",{startsExpr:m}),_super:A("super",{startsExpr:m}),_class:A("class",{startsExpr:m}),_extends:A("extends",{beforeExpr:b}),_export:A("export"),_import:A("import",{startsExpr:m}),_null:A("null",{startsExpr:m}),_true:A("true",{startsExpr:m}),_false:A("false",{startsExpr:m}),_typeof:A("typeof",{beforeExpr:b,prefix:z,startsExpr:m}),_void:A("void",{beforeExpr:b,prefix:z,startsExpr:m}),_delete:A("delete",{beforeExpr:b,prefix:z,startsExpr:m}),_do:A("do",{isLoop:_e,beforeExpr:b}),_for:A("for",{isLoop:_e}),_while:A("while",{isLoop:_e}),_as:T("as",{startsExpr:m}),_assert:T("assert",{startsExpr:m}),_async:T("async",{startsExpr:m}),_await:T("await",{startsExpr:m}),_defer:T("defer",{startsExpr:m}),_from:T("from",{startsExpr:m}),_get:T("get",{startsExpr:m}),_let:T("let",{startsExpr:m}),_meta:T("meta",{startsExpr:m}),_of:T("of",{startsExpr:m}),_sent:T("sent",{startsExpr:m}),_set:T("set",{startsExpr:m}),_source:T("source",{startsExpr:m}),_static:T("static",{startsExpr:m}),_using:T("using",{startsExpr:m}),_yield:T("yield",{startsExpr:m}),_asserts:T("asserts",{startsExpr:m}),_checks:T("checks",{startsExpr:m}),_exports:T("exports",{startsExpr:m}),_global:T("global",{startsExpr:m}),_implements:T("implements",{startsExpr:m}),_intrinsic:T("intrinsic",{startsExpr:m}),_infer:T("infer",{startsExpr:m}),_is:T("is",{startsExpr:m}),_mixins:T("mixins",{startsExpr:m}),_proto:T("proto",{startsExpr:m}),_require:T("require",{startsExpr:m}),_satisfies:T("satisfies",{startsExpr:m}),_keyof:T("keyof",{startsExpr:m}),_readonly:T("readonly",{startsExpr:m}),_unique:T("unique",{startsExpr:m}),_abstract:T("abstract",{startsExpr:m}),_declare:T("declare",{startsExpr:m}),_enum:T("enum",{startsExpr:m}),_module:T("module",{startsExpr:m}),_namespace:T("namespace",{startsExpr:m}),_interface:T("interface",{startsExpr:m}),_type:T("type",{startsExpr:m}),_opaque:T("opaque",{startsExpr:m}),name:P("name",{startsExpr:m}),placeholder:P("%%",{startsExpr:!0}),string:P("string",{startsExpr:m}),num:P("num",{startsExpr:m}),bigint:P("bigint",{startsExpr:m}),decimal:P("decimal",{startsExpr:m}),regexp:P("regexp",{startsExpr:m}),privateName:P("#name",{startsExpr:m}),eof:P("eof"),jsxName:P("jsxName"),jsxText:P("jsxText",{beforeExpr:!0}),jsxTagStart:P("jsxTagStart",{startsExpr:!0}),jsxTagEnd:P("jsxTagEnd")};function E(a){return a>=93&&a<=133}function ri(a){return a<=92}function D(a){return a>=58&&a<=133}function Vt(a){return a>=58&&a<=137}function ai(a){return ut[a]}function Ve(a){return ft[a]}function ni(a){return a>=29&&a<=33}function Dt(a){return a>=129&&a<=131}function oi(a){return a>=90&&a<=92}function mt(a){return a>=58&&a<=92}function hi(a){return a>=39&&a<=59}function li(a){return a===34}function ci(a){return dt[a]}function pi(a){return a>=121&&a<=123}function ui(a){return a>=124&&a<=130}function q(a){return ct[a]}function we(a){return pt[a]}function fi(a){return a===57}function Ie(a){return a>=24&&a<=25}function F(a){return B[a]}B[8].updateContext=a=>{a.pop()},B[5].updateContext=B[7].updateContext=B[23].updateContext=a=>{a.push(C.brace)},B[22].updateContext=a=>{a[a.length-1]===C.template?a.pop():a.push(C.template)},B[143].updateContext=a=>{a.push(C.j_expr,C.j_oTag)};var yt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",qt="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",di=new RegExp("["+yt+"]"),mi=new RegExp("["+yt+qt+"]");yt=qt=null;var Kt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],yi=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function qe(a,t){let e=65536;for(let s=0,i=t.length;sa)return!1;if(e+=t[s+1],e>=a)return!0}return!1}function R(a){return a<65?a===36:a<=90?!0:a<97?a===95:a<=122?!0:a<=65535?a>=170&&di.test(String.fromCharCode(a)):qe(a,Kt)}function Y(a){return a<48?a===36:a<58?!0:a<65?!1:a<=90?!0:a<97?a===95:a<=122?!0:a<=65535?a>=170&&mi.test(String.fromCharCode(a)):qe(a,Kt)||qe(a,yi)}var xt={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},xi=new Set(xt.keyword),Pi=new Set(xt.strict),gi=new Set(xt.strictBind);function Ht(a,t){return t&&a==="await"||a==="enum"}function Jt(a,t){return Ht(a,t)||Pi.has(a)}function Wt(a){return gi.has(a)}function Xt(a,t){return Jt(a,t)||Wt(a)}function Ti(a){return xi.has(a)}function bi(a,t,e){return a===64&&t===64&&R(e)}var Ai=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Si(a){return Ai.has(a)}var ue=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},fe=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new ue(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let i=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(i,t,e,s);let r=i.names.get(t)||0;e&16?r=r|4:(i.firstLexicalName||(i.firstLexicalName=t),r=r|2),i.names.set(t,r),e&8&&this.maybeExportDefined(i,t)}else if(e&4)for(let r=this.scopeStack.length-1;r>=0&&(i=this.scopeStack[r],this.checkRedeclarationInScope(i,t,e,s),i.names.set(t,(i.names.get(t)||0)|1),this.maybeExportDefined(i,t),!(i.flags&387));--r);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(p.VarRedeclaration,i,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let i=t.names.get(e);return s&16?(i&2)>0||!this.treatFunctionsAsVarInScope(t)&&(i&1)>0:(i&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(i&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&387)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&451&&!(e&4))return e}}},Ke=class extends ue{constructor(...t){super(...t),this.declareFunctions=new Set}},He=class extends fe{createScope(t){return new Ke(t)}declareName(t,e,s){let i=this.currentScope();if(e&2048){this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let i=t.names.get(e);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Je=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let i=this.plugins.get(e);for(let r of Object.keys(s))if((i==null?void 0:i[r])!==s[r])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function Gt(a,t){a.trailingComments===void 0?a.trailingComments=t:a.trailingComments.unshift(...t)}function wi(a,t){a.leadingComments===void 0?a.leadingComments=t:a.leadingComments.unshift(...t)}function de(a,t){a.innerComments===void 0?a.innerComments=t:a.innerComments.unshift(...t)}function H(a,t,e){let s=null,i=t.length;for(;s===null&&i>0;)s=t[--i];s===null||s.start>e.start?de(a,e.comments):Gt(s,e.comments)}var We=class extends Je{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let i=s-1,r=e[i];r.start===t.end&&(r.leadingNode=t,i--);let{start:n}=t;for(;i>=0;i--){let o=e[i],h=o.end;if(h>n)o.containingNode=t,this.finalizeComment(o),e.splice(i,1);else{h===n&&(o.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&Gt(t.leadingNode,e),t.trailingNode!==null&&wi(t.trailingNode,e);else{let{containingNode:s,start:i}=t;if(this.input.charCodeAt(this.offsetToSourcePos(i)-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":H(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":H(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":H(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":H(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":H(s,s.specifiers,t);break;case"TSEnumDeclaration":H(s,s.members,t);break;case"TSEnumBody":H(s,s.members,t);break;default:de(s,e)}else de(s,e)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let i=e[s-1];i.leadingNode===t&&(i.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){let{commentStack:e}=this.state,{length:s}=e;s!==0&&(e[s-1].trailingNode===t?e[s-1].trailingNode=null:s>=2&&e[s-2].trailingNode===t&&(e[s-2].trailingNode=null))}takeSurroundingComments(t,e,s){let{commentStack:i}=this.state,r=i.length;if(r===0)return;let n=r-1;for(;n>=0;n--){let o=i[n],h=o.end;if(o.start===s)o.leadingNode=t;else if(h===e)o.trailingNode=t;else if(h0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startIndex:s,startLine:i,startColumn:r}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.startIndex=s,this.curLine=i,this.lineStart=-r,this.startLoc=this.endLoc=new O(i,r,s)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new O(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new a;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},Ii=function(t){return t>=48&&t<=57},Ot={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ae={bin:a=>a===48||a===49,oct:a=>a>=48&&a<=55,dec:a=>a>=48&&a<=57,hex:a=>a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102};function Ft(a,t,e,s,i,r){let n=e,o=s,h=i,l="",c=null,u=e,{length:f}=t;for(;;){if(e>=f){r.unterminated(n,o,h),l+=t.slice(u,e);break}let d=t.charCodeAt(e);if(Ni(a,d,t,e)){l+=t.slice(u,e);break}if(d===92){l+=t.slice(u,e);let x=ki(t,e,s,i,a==="template",r);x.ch===null&&!c?c={pos:e,lineStart:s,curLine:i}:l+=x.ch,{pos:e,lineStart:s,curLine:i}=x,u=e}else d===8232||d===8233?(++e,++i,s=e):d===10||d===13?a==="template"?(l+=t.slice(u,e)+` +`,++e,d===13&&t.charCodeAt(e)===10&&++e,++i,u=s=e):r.unterminated(n,o,h):++e}return{pos:e,str:l,firstInvalidLoc:c,lineStart:s,curLine:i,containsInvalid:!!c}}function Ni(a,t,e,s){return a==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(a==="double"?34:39)}function ki(a,t,e,s,i,r){let n=!i;t++;let o=l=>({pos:t,ch:l,lineStart:e,curLine:s}),h=a.charCodeAt(t++);switch(h){case 110:return o(` +`);case 114:return o("\r");case 120:{let l;return{code:l,pos:t}=Ge(a,t,e,s,2,!1,n,r),o(l===null?null:String.fromCharCode(l))}case 117:{let l;return{code:l,pos:t}=Qt(a,t,e,s,n,r),o(l===null?null:String.fromCodePoint(l))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:a.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);r.strictNumericEscape(t-1,e,s);default:if(h>=48&&h<=55){let l=t-1,u=/^[0-7]+/.exec(a.slice(l,t+2))[0],f=parseInt(u,8);f>255&&(u=u.slice(0,-1),f=parseInt(u,8)),t+=u.length-1;let d=a.charCodeAt(t);if(u!=="0"||d===56||d===57){if(i)return o(null);r.strictNumericEscape(l,e,s)}return o(String.fromCharCode(f))}return o(String.fromCharCode(h))}}function Ge(a,t,e,s,i,r,n,o){let h=t,l;return{n:l,pos:t}=Yt(a,t,e,s,16,i,r,!1,o,!n),l===null&&(n?o.invalidEscapeSequence(h,e,s):t=h-1),{code:l,pos:t}}function Yt(a,t,e,s,i,r,n,o,h,l){let c=t,u=i===16?Ot.hex:Ot.decBinOct,f=i===16?Ae.hex:i===10?Ae.dec:i===8?Ae.oct:Ae.bin,d=!1,x=0;for(let S=0,N=r??1/0;S=97?I=w-97+10:w>=65?I=w-65+10:Ii(w)?I=w-48:I=1/0,I>=i){if(I<=9&&l)return{n:null,pos:t};if(I<=9&&h.invalidDigit(t,e,s,i))I=0;else if(n)I=0,d=!0;else break}++t,x=x*i+I}return t===c||r!=null&&t-c!==r||d?{n:null,pos:t}:{n:x,pos:t}}function Qt(a,t,e,s,i,r){let n=a.charCodeAt(t),o;if(n===123){if(++t,{code:o,pos:t}=Ge(a,t,e,s,a.indexOf("}",t)-t,!0,i,r),++t,o!==null&&o>1114111)if(i)r.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=Ge(a,t,e,s,4,!1,i,r));return{code:o,pos:t}}function le(a,t,e){return new O(e,a-t,a)}var vi=new Set([103,109,115,105,121,117,100,118]),M=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new ee(t.startLoc,t.endLoc)}},Ye=class extends We{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,i,r,n)=>this.optionFlags&1024?(this.raise(p.InvalidDigit,le(s,i,r),{radix:n}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(p.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(p.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(p.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(p.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,i,r)=>{this.recordStrictModeErrors(p.StrictNumericEscape,le(s,i,r))},unterminated:(s,i,r)=>{throw this.raise(p.UnterminatedString,le(s-1,i,r))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(p.StrictNumericEscape),unterminated:(s,i,r)=>{throw this.raise(p.UnterminatedTemplate,le(s,i,r))}}),this.state=new Xe,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&128&&this.pushToken(new M(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return Ue.lastIndex=t,Ue.test(this.input)?Ue.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return je.lastIndex=t,je.test(this.input)?je.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++tthis.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,i=this.input.indexOf(t,s+2);if(i===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+t.length,be.lastIndex=s+2;be.test(this.input)&&be.lastIndex<=i;)++this.state.curLine,this.state.lineStart=be.lastIndex;if(this.isLookahead)return;let r={type:"CommentBlock",value:this.input.slice(s+2,i),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(i+t.length),loc:new ee(e,this.state.curPosition())};return this.optionFlags&128&&this.pushToken(r),r}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=t);if(this.state.post)){let r=this.skipLineComment(3);r!==void 0&&(this.addComment(r),e==null||e.push(r))}else break e}else if(s===60&&!this.inModule&&this.optionFlags&4096){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let r=this.skipLineComment(4);r!==void 0&&(this.addComment(r),e==null||e.push(r))}else break e}else break e}}if((e==null?void 0:e.length)>0){let s=this.state.pos,i={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(s),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(p.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?p.RecordExpressionHashIncorrectStartSyntaxType:p.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else R(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!Q(t)&&++this.state.pos=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(R(t)){this.readWord(t);return}}throw this.raise(p.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,i,{pos:r}=this.state;for(;;++r){if(r>=this.length)throw this.raise(p.UnterminatedRegExp,v(t,1));let l=this.input.charCodeAt(r);if(Q(l))throw this.raise(p.UnterminatedRegExp,v(t,1));if(s)s=!1;else{if(l===91)i=!0;else if(l===93&&i)i=!1;else if(l===47&&!i)break;s=l===92}}let n=this.input.slice(e,r);++r;let o="",h=()=>v(t,r+2-e);for(;r=2&&this.input.charCodeAt(e)===48;if(h){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(p.StrictOctalLiteral,s),!this.state.strict){let x=d.indexOf("_");x>0&&this.raise(p.ZeroDigitNumericSeparator,v(s,x))}o=h&&!/[89]/.test(d)}let l=this.input.charCodeAt(this.state.pos);if(l===46&&!o&&(++this.state.pos,this.readInt(10),i=!0,l=this.input.charCodeAt(this.state.pos)),(l===69||l===101)&&!o&&(l=this.input.charCodeAt(++this.state.pos),(l===43||l===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(p.InvalidOrMissingExponent,s),i=!0,n=!0,l=this.input.charCodeAt(this.state.pos)),l===110&&((i||h)&&this.raise(p.InvalidBigIntLiteral,s),++this.state.pos,r=!0),l===109){this.expectPlugin("decimal",this.state.curPosition()),(n||h)&&this.raise(p.InvalidDecimal,s),++this.state.pos;var c=!0}if(R(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());let u=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(r){this.finishToken(136,u);return}if(c){this.finishToken(137,u);return}let f=o?parseInt(u,8):parseFloat(u);this.finishToken(135,f)}readCodePoint(t){let{code:e,pos:s}=Qt(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:i,lineStart:r}=Ft(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=r,this.state.curLine=i,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:i,curLine:r,lineStart:n}=Ft("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=r,s&&(this.state.firstInvalidTemplateEscapePos=new O(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(i)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,i=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos=0;o--){let h=n[o];if(h.loc.index===r)return n[o]=t(i,s);if(h.loc.indexthis.hasPlugin(e)))throw this.raise(p.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,i)=>{this.raise(t,le(e,s,i))}}},Qe=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Ze=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Qe)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,i]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,i):this.parser.raise(p.InvalidPrivateFieldResolution,i,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:i,loneAccessors:r,undefinedPrivateNames:n}=this.current(),o=i.has(t);if(e&3){let h=o&&r.get(t);if(h){let l=h&4,c=e&4,u=h&3,f=e&3;o=u===f||l!==c,o||r.delete(t)}else o||r.set(t,e)}o&&this.parser.raise(p.PrivateNameRedeclaration,s,{identifierName:t}),i.add(t),n.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(p.InvalidPrivateFieldResolution,e,{identifierName:t})}},te=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Ne=class extends te{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},et=class{constructor(t){this.parser=void 0,this.stack=[new te],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let s=e.loc.start,{stack:i}=this,r=i.length-1,n=i[r];for(;!n.isCertainlyParameterDeclaration();){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(t,s);else return;n=i[--r]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){let{stack:s}=this,i=s[s.length-1],r=e.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(t,r);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(t,r);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,i=e[s];for(;i.canBeArrowParameterDeclaration();)i.type===2&&i.recordDeclarationError(p.AwaitBindingIdentifier,t),i=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,i])=>{this.parser.raise(s,i);let r=t.length-2,n=t[r];for(;n.canBeArrowParameterDeclaration();)n.clearDeclarationError(i.index),n=t[--r]})}};function Li(){return new te(3)}function Di(){return new Ne(1)}function Mi(){return new Ne(2)}function Zt(){return new te}var tt=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function Ce(a,t){return(a?2:0)|(t?1:0)}var st=class extends Ye{addExtra(t,e,s,i=!0){if(!t)return;let{extra:r}=t;r==null&&(r={},t.extra=r),i?r[e]=s:Object.defineProperty(r,e,{enumerable:i,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){let s=t+e.length;if(this.input.slice(t,s)===e){let i=this.input.charCodeAt(s);return!(Y(i)||(i&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Mt(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Mt(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(p.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let i=t((r=null)=>{throw s.node=r,s});if(this.state.errors.length>e.errors.length){let r=this.state;return this.state=e,this.state.tokensLength=r.tokensLength,{node:i,error:r.errors[e.errors.length],thrown:!1,aborted:!1,failState:r}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let r=this.state;if(this.state=e,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:r};if(i===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:r};throw i}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:i,privateKeyLoc:r,optionalParametersLoc:n}=t,o=!!s||!!i||!!n||!!r;if(!e)return o;s!=null&&this.raise(p.InvalidCoverInitializedName,s),i!=null&&this.raise(p.DuplicateProto,i),r!=null&&this.raise(p.UnexpectedPrivateField,r),n!=null&&this.unexpected(n)}isLiteralPropertyName(){return Vt(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let i=this.inModule;this.inModule=t;let r=this.scope,n=this.getScopeHandler();this.scope=new n(this,t);let o=this.prodParam;this.prodParam=new tt;let h=this.classScope;this.classScope=new Ze(this);let l=this.expressionScope;return this.expressionScope=new et(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=i,this.scope=r,this.prodParam=o,this.classScope=h,this.expressionScope=l}}enterInitialScopes(){let t=0;this.inModule&&(t|=2),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},Z=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},se=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new ee(s),(t==null?void 0:t.optionFlags)&64&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},Pt=se.prototype;Pt.__clone=function(){let a=new se(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;e`Cannot overwrite reserved type ${a}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:a,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${a} = true,\` or \`${a} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:a,enumName:t})=>`Enum member names need to be unique, but the name \`${a}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:a})=>`Enum \`${a}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:a,enumName:t})=>`Enum type \`${a}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:a})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${a}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:a,memberName:t,explicitType:e})=>`Enum \`${a}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:a,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${a}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:a,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${a}\`.`,EnumInvalidMemberName:({enumName:a,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${a}\`.`,EnumNumberMemberNotInitialized:({enumName:a,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${a}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:a})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${a}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:a})=>`Unexpected reserved type ${a}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:a,suggestion:t})=>`\`declare export ${a}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Ri(a){return a.type==="DeclareExportAllDeclaration"||a.type==="DeclareExportDeclaration"&&(!a.declaration||a.declaration.type!=="TypeAlias"&&a.declaration.type!=="InterfaceDeclaration")}function Bt(a){return a.importKind==="type"||a.importKind==="typeof"}var _i={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Ui(a,t){let e=[],s=[];for(let i=0;iclass extends a{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return He}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=ji.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let i=this.flowParseType();return this.state.inType=s,i}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(g.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,i=null;return this.match(54)?(this.state.inType=e,i=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(i=this.flowParsePredicate())),[s,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),i=this.startNode(),r=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let n=this.flowParseFunctionTypeParams();return i.params=n.params,i.rest=n.rest,i.this=n._this,this.expect(11),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(r,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(g.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),i=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(g.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,g.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),i.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let r=null,n=!1;return i.forEach(o=>{Ri(o)?(r==="CommonJS"&&this.raise(g.AmbiguousDeclareModuleKind,o),r="ES"):o.type==="DeclareModuleExports"&&(n&&this.raise(g.DuplicateDeclareModuleExports,o),r==="ES"&&this.raise(g.AmbiguousDeclareModuleKind,o),r="CommonJS",n=!0)}),e.kind=r||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){let i=this.state.value;throw this.raise(g.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:_i[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return s.type="DeclareTypeAlias",s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return s.type="DeclareOpaqueType",s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(g.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,i){Bi.has(e)&&this.raise(i?g.AssignReservedType:g.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,i=this.startNode(),r=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return i.name=n.name,i.variance=r,i.bound=n.typeAnnotation,this.match(29)?(this.eat(29),i.default=this.flowParseType()):e&&this.raise(g.MissingTypeParamDefault,s),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let i=!1;do{let r=this.flowParseTypeParameter(i);s.params.push(r),r.default&&(i=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==C.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=i}),this.state.inType=s,!this.state.inType&&this.curContext()===C.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,i){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=i,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let i=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(i),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:i,allowProto:r,allowInexact:n}){let o=this.state.inType;this.state.inType=!0;let h=this.startNode();h.callProperties=[],h.properties=[],h.indexers=[],h.internalSlots=[];let l,c,u=!1;for(s&&this.match(6)?(this.expect(6),l=9,c=!0):(this.expect(5),l=8,c=!1),h.exact=c;!this.match(l);){let d=!1,x=null,S=null,N=this.startNode();if(r&&this.isContextual(118)){let I=this.lookahead();I.type!==14&&I.type!==17&&(this.next(),x=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let I=this.lookahead();I.type!==14&&I.type!==17&&(this.next(),d=!0)}let w=this.flowParseVariance();if(this.eat(0))x!=null&&this.unexpected(x),this.eat(0)?(w&&this.unexpected(w.loc.start),h.internalSlots.push(this.flowParseObjectTypeInternalSlot(N,d))):h.indexers.push(this.flowParseObjectTypeIndexer(N,d,w));else if(this.match(10)||this.match(47))x!=null&&this.unexpected(x),w&&this.unexpected(w.loc.start),h.callProperties.push(this.flowParseObjectTypeCallProperty(N,d));else{let I="init";if(this.isContextual(99)||this.isContextual(104)){let ne=this.lookahead();Vt(ne.type)&&(I=this.state.value,this.next())}let Te=this.flowParseObjectTypeProperty(N,d,x,w,I,i,n??!c);Te===null?(u=!0,S=this.state.lastTokStartLoc):h.properties.push(Te)}this.flowObjectTypeSemicolon(),S&&!this.match(8)&&!this.match(9)&&this.raise(g.UnexpectedExplicitInexactInObject,S)}this.expect(l),i&&(h.inexact=u);let f=this.finishNode(h,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,s,i,r,n,o,h){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?h||this.raise(g.InexactInsideExact,this.state.lastTokStartLoc):this.raise(g.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(g.InexactVariance,r),null):(o||this.raise(g.UnexpectedSpreadType,this.state.lastTokStartLoc),i!=null&&this.unexpected(i),r&&this.raise(g.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=i!=null,e.kind=n;let l=!1;return this.match(47)||this.match(10)?(e.method=!0,i!=null&&this.unexpected(i),r&&this.unexpected(r.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(n==="get"||n==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(g.ThisParamBannedInConstructor,e.value.this)):(n!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,i=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?g.GetterMayNotHaveThisParam:g.SetterMayNotHaveThisParam,e.value.this),i!==s&&this.raise(e.kind==="get"?p.BadGetterArity:p.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(p.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){var i;(i=e)!=null||(e=this.state.startLoc);let r=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let n=this.startNodeAt(e);n.qualification=r,n.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(n,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,s){let i=this.startNodeAt(e);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,i));return}super.parseFunctionBody(e,!1,i)}parseFunctionBodyAndFinish(e,s,i=!1){if(this.match(14)){let r=this.startNode();[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=r.typeAnnotation?this.finishNode(r,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let i=this.lookahead();if(D(i.type)){let r=this.startNode();return this.next(),this.flowParseInterface(r)}}else if(this.isContextual(126)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,i){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||E(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(E(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||Dt(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||Dt(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(i),e}this.expect(17);let r=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(s),{consequent:h,failed:l}=this.tryParseConditionalConsequent(),[c,u]=this.getArrowLikeExpressions(h);if(l||u.length>0){let f=[...n];if(u.length>0){this.state=r,this.state.noArrowAt=f;for(let d=0;d1&&this.raise(g.AmbiguousConditionalArrow,r.startLoc),l&&c.length===1&&(this.state=r,f.push(c[0].start),this.state.noArrowAt=f,{consequent:h,failed:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(h,!0),this.state.noArrowAt=n,this.expect(14),o.test=e,o.consequent=h,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let i=[e],r=[];for(;i.length!==0;){let n=i.pop();n.type==="ArrowFunctionExpression"&&n.body.type!=="BlockStatement"?(n.typeParameters||!n.returnType?this.finishArrowValidation(n):r.push(n),i.push(n.body)):n.type==="ConditionalExpression"&&(i.push(n.consequent),i.push(n.alternate))}return s?(r.forEach(n=>this.finishArrowValidation(n)),[r,[]]):Ui(r,n=>n.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let i;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),i=s(),this.state.noArrowParamsConversionAt.pop()):i=s(),i}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=i,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return i}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,i=super.maybeParseExportNamespaceSpecifier(e);return i&&e.exportKind==="type"&&this.unexpected(s),i}parseClassId(e,s,i){super.parseClassId(e,s,i),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,i){let{startLoc:r}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,i),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(g.DeclareClassElement,r):s.value&&this.raise(g.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(p.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):bi(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,i){for(let r=0;r1||!s)&&this.raise(g.TypeCastInPattern,n.typeAnnotation)}return e}parseArrayLike(e,s,i,r){let n=super.parseArrayLike(e,s,i,r);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(n.elements),n}isValidLVal(e,s,i){return e==="TypeCastExpression"||super.isValidLVal(e,s,i)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,i,r,n,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,i,r,n,o),s.params&&n){let h=s.params;h.length>0&&this.isThisParam(h[0])&&this.raise(g.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&n&&s.value.params){let h=s.value.params;h.length>0&&this.isThisParam(h[0])&&this.raise(g.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,i,r){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,i,r)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let s=e.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,s.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let i=s[0];this.isThisParam(i)&&e.kind==="get"?this.raise(g.GetterMayNotHaveThisParam,i):this.isThisParam(i)&&this.raise(g.SetterMayNotHaveThisParam,i)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,i,r,n,o,h){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let l;this.match(47)&&!o&&(l=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let c=super.parseObjPropValue(e,s,i,r,n,o,h);return l&&((c.value||c).typeParameters=l),c}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(g.PatternIsOptional,e),this.isThisParam(e)&&this.raise(g.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(g.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(g.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.startsuper.parseMaybeAssign(e,s),r),!n.error)return n.node;let{context:l}=this.state,c=l[l.length-1];(c===C.j_oTag||c===C.j_expr)&&l.pop()}if((i=n)!=null&&i.error||this.match(47)){var o,h;r=r||this.state.clone();let l,c=this.tryParse(f=>{var d;l=this.flowParseTypeParameterDeclaration();let x=this.forwardNoArrowParamsConversionAt(l,()=>{let N=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(N,l),N});(d=x.extra)!=null&&d.parenthesized&&f();let S=this.maybeUnwrapTypeCastExpression(x);return S.type!=="ArrowFunctionExpression"&&f(),S.typeParameters=l,this.resetStartLocationFromNode(S,l),x},r),u=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(g.UnexpectedTypeParameterBeforeAsyncArrowFunction,l),c.node;u=c.node}if((o=n)!=null&&o.node)return this.state=n.failState,n.node;if(u)return this.state=c.failState,u;throw(h=n)!=null&&h.thrown?n.error:c.thrown?c.error:this.raise(g.UnexpectedTokenAfterTypeParameter,l)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let r=this.startNode();return[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),r});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,i,r=!0){if(!(i&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let n=0;n0&&this.raise(g.ThisParamMustBeFirst,e.params[n]);super.checkParams(e,s,i,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,i){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let r=this.startNodeAt(s);r.callee=e,r.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(r,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let r=this.state.clone(),n=this.tryParse(h=>this.parseAsyncArrowWithTypeParameters(s)||h(),r);if(!n.error&&!n.aborted)return n.node;let o=this.tryParse(()=>super.parseSubscripts(e,s,i),r);if(o.node&&!o.error)return o.node;if(n.node)return this.state=n.failState,n.node;if(o.node)return this.state=o.failState,o.node;throw n.error||o.error}return super.parseSubscripts(e,s,i)}parseSubscript(e,s,i,r){if(this.match(18)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,i)return r.stop=!0,e;this.next();let n=this.startNodeAt(s);return n.callee=e,n.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),n.arguments=this.parseCallExpressionArguments(11),n.optional=!0,this.finishCallExpression(n,!0)}else if(!i&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let n=this.startNodeAt(s);n.callee=e;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),n.arguments=super.parseCallExpressionArguments(11),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let i=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(g.UnterminatedFlowComment,this.state.curPosition()),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(g.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let i=this.input.charCodeAt(s+e),r=this.input.charCodeAt(s+e+1);return i===58&&r===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:i===58&&r!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:i}){this.raise(g.EnumBooleanMemberNotInitialized,e,{memberName:i,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?g.EnumInvalidMemberInitializerSymbolType:g.EnumInvalidMemberInitializerPrimaryType:g.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(g.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(g.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let i=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 134:{let i=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:i}}flowEnumCheckExplicitTypeMismatch(e,s,i){let{explicitType:r}=s;r!==null&&r!==i&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let i=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},n=!1;for(;!this.match(8);){if(this.eat(21)){n=!0;break}let o=this.startNode(),{id:h,init:l}=this.flowEnumMemberRaw(),c=h.name;if(c==="")continue;/^[a-z]/.test(c)&&this.raise(g.EnumInvalidMemberName,h,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),i.has(c)&&this.raise(g.EnumDuplicateMemberName,h,{memberName:c,enumName:e}),i.add(c);let u={enumName:e,explicitType:s,memberName:c};switch(o.id=h,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"boolean"),o.init=l.value,r.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"number"),o.init=l.value,r.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"string"),o.init=l.value,r.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,u);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,u);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,u);break;default:r.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:r,hasUnknownMembers:n}}flowEnumStringMembers(e,s,{enumName:i}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let r of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return s}else{for(let r of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!E(this.state.type))throw this.raise(g.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(g.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let i=s.name,r=s.loc.start,n=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:o,hasUnknownMembers:h}=this.flowEnumMembers({enumName:i,explicitType:n});switch(e.hasUnknownMembers=h,n){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let l=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let c=o.booleanMembers.length,u=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!c&&!u&&!f&&!d)return l();if(!c&&!u)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!u&&!f&&c>=d){for(let x of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(x.loc.start,{enumName:i,memberName:x.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!c&&!f&&u>=d){for(let x of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(x.loc.start,{enumName:i,memberName:x.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(g.EnumInconsistentMemberValues,r,{enumName:i}),l()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},J=_`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:a})=>`Expected corresponding JSX closing tag for <${a}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:a,HTMLEntity:t})=>`Unexpected token \`${a}\`. Did you mean \`${t}\` or \`{'${a}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function V(a){return a?a.type==="JSXOpeningFragment"||a.type==="JSXClosingFragment":!1}function G(a){if(a.type==="JSXIdentifier")return a.name;if(a.type==="JSXNamespacedName")return a.namespace.name+":"+a.name.name;if(a.type==="JSXMemberExpression")return G(a.object)+"."+G(a.property);throw new Error("Node had unexpected type: "+a.type)}var zi=a=>class extends a{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(J.UnterminatedJsxContent,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(i);return}e+=this.input.slice(s,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:Q(i)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),i;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=e?` +`:`\r +`):i=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,i}jsxReadString(e){let s="",i=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(p.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadEntity(),i=this.state.pos):Q(r)?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadNewLine(!1),i=this.state.pos):++this.state.pos}s+=this.input.slice(i,this.state.pos++),this.finishToken(134,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let i=this.readInt(s,void 0,!1,"bail");if(i!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(i)}else{let s=0,i=!1;for(;s++<10&&this.state.pos1){for(let i=0;i0){if(s&256){let r=!!(s&512),n=(i&4)>0;return r!==n}return!0}return s&128&&(i&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(i&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let i=s-1;i>=0;i--){let n=this.scopeStack[i].tsNames.get(e);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(t)}},es=a=>a.type==="ParenthesizedExpression"?es(a.expression):a,nt=class extends it{toAssignable(t,e=!1){var s,i;let r;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(r=es(t),e?r.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(p.InvalidParenthesizedAssignment,t):r.type!=="MemberExpression"&&!this.isOptionalMemberExpression(r)&&this.raise(p.InvalidParenthesizedAssignment,t):this.raise(p.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let o=0,h=t.properties.length,l=h-1;oi.type!=="ObjectMethod"&&(r===s||i.type!=="SpreadElement")&&this.isAssignable(i))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){let i=s&1,r=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(12),i&&this.match(12))r.push(null);else{if(this.eat(t))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),r.push(o),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(p.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());r.push(this.parseAssignableListItem(s,o))}}return r}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseAssignableListItem(t,e){let s=this.parseMaybeDefault();(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s);let i=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),i}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){var s,i;if((s=t)!=null||(t=this.state.startLoc),e=(i=e)!=null?i:this.parseBindingAtom(),!this.eat(29))return e;let r=this.startNodeAt(t);return r.left=e,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,i=!1,r=!1,n=!1){var o;let h=t.type;if(this.isObjectMethod(t))return;let l=this.isOptionalMemberExpression(t);if(l||h==="MemberExpression"){l&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(p.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(p.InvalidPropertyBindingPattern,t);return}if(h==="Identifier"){this.checkIdentifier(t,s,r);let{name:S}=t;i&&(i.has(S)?this.raise(p.ParamDupe,t):i.add(S));return}let c=this.isValidLVal(h,!(n||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(c===!0)return;if(c===!1){let S=s===64?p.InvalidLhs:p.InvalidLhsBinding;this.raise(S,t,{ancestor:e});return}let u,f;typeof c=="string"?(u=c,f=h==="ParenthesizedExpression"):[u,f]=c;let d=h==="ArrayPattern"||h==="ObjectPattern"?{type:h}:e,x=t[u];if(Array.isArray(x))for(let S of x)S&&this.checkLVal(S,d,s,i,r,f);else x&&this.checkLVal(x,d,s,i,r,f)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?Xt(t.name,this.inModule):Wt(t.name))&&(e===64?this.raise(p.StrictEvalArguments,t,{referenceName:t.name}):this.raise(p.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(p.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(p.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?p.RestTrailingComma:p.ElementAfterRest,this.state.startLoc),!0):!1}};function Vi(a){if(a==null)throw new Error(`Unexpected ${a} value.`);return a}function Rt(a){if(!a)throw new Error("Assert fail")}var y=_`typescript`({AbstractMethodHasImplementation:({methodName:a})=>`Method '${a}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:a})=>`Property '${a}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:a})=>`'declare' is not allowed in ${a}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:a})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:a})=>`Duplicate modifier: '${a}'.`,EmptyHeritageClauseType:({token:a})=>`'${a}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:a})=>`'${a[0]}' modifier cannot be used with '${a[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:a})=>`Index signatures cannot have an accessibility modifier ('${a}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:a})=>`'${a}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:a})=>`'${a}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:a})=>`'${a}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:a})=>`'${a[0]}' modifier must precede '${a[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:a})=>`Private elements cannot have an accessibility modifier ('${a}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:a})=>`Single type parameter ${a} should have a trailing comma. Example usage: <${a},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:a})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${a}.`});function qi(a){switch(a){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function _t(a){return a==="private"||a==="public"||a==="protected"}function Ki(a){return a==="in"||a==="out"}var Hi=a=>class extends a{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:y.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:y.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:y.InvalidModifierOnTypeParameter})}getScopeHandler(){return at}tsIsIdentifier(){return E(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s){if(!E(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let i=this.state.value;if(e.includes(i)){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return i}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:i,errorTemplate:r=y.InvalidModifierOnTypeMember},n){let o=(l,c,u,f)=>{c===u&&n[f]&&this.raise(y.InvalidModifiersOrder,l,{orderedModifiers:[u,f]})},h=(l,c,u,f)=>{(n[u]&&c===f||n[f]&&c===u)&&this.raise(y.IncompatibleModifiers,l,{modifiers:[u,f]})};for(;;){let{startLoc:l}=this.state,c=this.tsParseModifier(e.concat(s??[]),i);if(!c)break;_t(c)?n.accessibility?this.raise(y.DuplicateAccessibilityModifier,l,{modifier:c}):(o(l,c,c,"override"),o(l,c,c,"static"),o(l,c,c,"readonly"),n.accessibility=c):Ki(c)?(n[c]&&this.raise(y.DuplicateModifier,l,{modifier:c}),n[c]=!0,o(l,c,"in","out")):(hasOwnProperty.call(n,c)?this.raise(y.DuplicateModifier,l,{modifier:c}):(o(l,c,"static","readonly"),o(l,c,"static","override"),o(l,c,"override","readonly"),o(l,c,"abstract","override"),h(l,c,"declare","override"),h(l,c,"static","abstract")),n[c]=!0),s!=null&&s.includes(c)&&this.raise(r,l,{modifier:c})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){let i=[];for(;!this.tsIsListTerminator(e);)i.push(s());return i}tsParseDelimitedList(e,s,i){return Vi(this.tsParseDelimitedListWorker(e,s,!0,i))}tsParseDelimitedListWorker(e,s,i,r){let n=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let h=s();if(h==null)return;if(n.push(h),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;i&&this.expect(12);return}return r&&(r.value=o),n}tsParseBracketedList(e,s,i,r,n){r||(i?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,s,n);return i?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(y.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)&&!this.match(11)?(e.options=super.parseMaybeAssignAllowIn(),this.eat(12)):e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e){let s;if(e&1&&this.match(78))if(e&2)s=this.parseIdentifier(!0);else{let i=this.startNode();this.next(),s=this.finishNode(i,"ThisExpression")}else s=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let i=this.startNodeAtNode(s);i.left=s,i.right=this.parseIdentifier(!!(e&1)),s=this.finishNode(i,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let i={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,i),s.params.length===0&&this.raise(y.EmptyTypeParameters,s),i.value!==-1&&this.addExtra(s,"trailingComma",i.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let i=e===19,r="parameters",n="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[r]=this.tsParseBindingListForSignature(),i?s[n]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[n]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:i}=s;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(y.UnsupportedSignatureParameterKind,s,{type:i})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),E(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);let i=e;if(this.match(10)||this.match(47)){s&&this.raise(y.ReadonlyForMethodSignature,e);let r=i;r.kind&&this.match(47)&&this.raise(y.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,r),this.tsParseTypeMemberSemicolon();let n="parameters",o="typeAnnotation";if(r.kind==="get")r[n].length>0&&(this.raise(p.BadGetterArity,this.state.curPosition()),this.isThisParam(r[n][0])&&this.raise(y.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(r.kind==="set"){if(r[n].length!==1)this.raise(p.BadSetterArity,this.state.curPosition());else{let h=r[n][0];this.isThisParam(h)&&this.raise(y.AccessorCannotDeclareThisParameter,this.state.curPosition()),h.type==="Identifier"&&h.optional&&this.raise(y.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),h.type==="RestElement"&&this.raise(y.SetAccessorCannotHaveRestParameter,this.state.curPosition())}r[o]&&this.raise(y.SetAccessorCannotHaveReturnType,r[o])}else r.kind="method";return this.finishNode(r,"TSMethodSignature")}else{let r=i;s&&(r.readonly=!0);let n=this.tsTryParseTypeAnnotation();return n&&(r.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let i=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(i,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let s=this.tsTryParseIndexSignature(e);return s||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{let s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(i=>{let{type:r}=i;s&&r!=="TSRestType"&&r!=="TSOptionalType"&&!(r==="TSNamedTupleMember"&&i.optional)&&this.raise(y.OptionalTypeBeforeRequired,i),s||(s=r==="TSNamedTupleMember"&&i.optional||r==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,s=this.eat(21),{startLoc:i}=this.state,r,n,o,h,c=D(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,o=!1,n=this.parseIdentifier(!0),this.expect(14),h=this.tsParseType();else if(c===63){o=!0;let u=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(i),u),this.expect(17),this.expect(14),h=this.tsParseType()):(r=!1,h=f,this.expect(17))}else h=this.tsParseType(),o=this.eat(17),r=this.eat(14);if(r){let u;n?(u=this.startNodeAt(i),u.optional=o,u.label=n,u.elementType=h,this.eat(17)&&(u.optional=!0,this.raise(y.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAt(i),u.optional=o,this.raise(y.InvalidTupleMemberLabel,h),u.label=h,u.elementType=this.tsParseType()),h=this.finishNode(u,"TSNamedTupleMember")}else if(o){let u=this.startNodeAt(i);u.typeAnnotation=h,h=this.finishNode(u,"TSOptionalType")}if(s){let u=this.startNodeAt(e);u.typeAnnotation=h,h=this.finishNode(u,"TSRestType")}return h}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let i=this.startNode();return e==="TSConstructorType"&&(i.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,i)),this.finishNode(i,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){{let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==135&&s.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(E(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":qi(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,s=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAt(e);i.elementType=s,this.expect(3),s=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAt(e);i.objectType=s,i.indexType=this.tsParseType(),this.expect(3),s=this.finishNode(i,"TSIndexedAccessType")}return s}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(y.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return pi(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,i){let r=this.startNode(),n=this.eat(i),o=[];do o.push(s());while(this.eat(i));return o.length===1&&!n?o[0]:(r.types=o,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(E(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let i=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(78)){let h=this.tsParseThisTypeOrThisTypePredicate();return h.type==="TSThisType"?(i.parameterName=h,i.asserts=!0,i.typeAnnotation=null,h=this.finishNode(i,"TSTypePredicate")):(this.resetStartLocationFromNode(h,i),h.asserts=!0),s.typeAnnotation=h,this.finishNode(s,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return r?(i.parameterName=this.parseIdentifier(),i.asserts=r,i.typeAnnotation=null,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=r,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!E(this.state.type)&&!this.match(78)?!1:(e&&this.raise(p.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){Rt(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(y.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{let r=this.startNode();return r.expression=this.tsParseEntityName(3),this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSExpressionWithTypeArguments")});return i.length||this.raise(y.EmptyHeritageClauseType,s,{token:e}),i}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),E(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(y.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==C.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),e.body=i}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,i){e.isExport=i||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let r=this.tsParseModuleReference();return e.importKind==="type"&&r.type!=="TSExternalModuleReference"&&this.raise(y.ImportAliasHasImportType,r),e.moduleReference=r,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),i=e();return this.state=s,i}tsTryParseAndCatch(e){let s=this.tryParse(i=>e()||i());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),i=e();if(i!==void 0&&i!==!1)return i;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,i;return this.isContextual(100)&&(s=74,i="let"),this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,i||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{let r=this.tsParseInterfaceDeclaration(e,{declare:!0});if(r)return r}default:if(E(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,i){switch(s.name){case"declare":{let r=this.tsTryParseDeclare(e);return r&&(r.declare=!0),r}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let r=e;return r.kind="global",e.global=!0,r.id=s,r.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(r,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,i)}}tsParseDeclaration(e,s,i,r){switch(s){case"abstract":if(this.tsCheckLineTerminator(i)&&(this.match(80)||E(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case"module":if(this.tsCheckLineTerminator(i)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(E(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(i)&&E(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(i)&&E(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let r=this.startNodeAt(e);return r.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(r),r.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),r});if(this.state.maybeInArrowParameters=s,!!i)return super.parseArrowExpression(i,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(y.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===C.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return ui(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){let i=this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},r);let n=r.accessibility,o=r.override,h=r.readonly;!(e&4)&&(n||h||o)&&this.raise(y.UnexpectedParameterModifier,i);let l=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(l);let c=this.parseMaybeDefault(l.loc.start,l);if(n||h||o){let u=this.startNodeAt(i);return s.length&&(u.decorators=s),n&&(u.accessibility=n),h&&(u.readonly=h),o&&(u.override=o),c.type!=="Identifier"&&c.type!=="AssignmentPattern"&&this.raise(y.UnsupportedParameterPropertyKind,u),u.parameter=c,this.finishNode(u,"TSParameterProperty")}return s.length&&(l.decorators=s),c}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(y.PatternIsOptional,s)}setArrowFunctionParameters(e,s,i){super.setArrowFunctionParameters(e,s,i),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,i=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let r=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return r&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,r):r==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(y.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,r,i):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,i))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(y.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,i,r){let n=super.parseArrayLike(e,s,i,r);return n.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,s,i,r){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(i)return r.stop=!0,e;r.optionalChainMember=n=!0,this.next()}if(this.match(47)||this.match(51)){let o,h=this.tsTryParseAndCatch(()=>{if(!i&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(s);if(f)return f}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(Ie(this.state.type)){let f=super.parseTaggedTemplateExpression(e,s,r);return f.typeParameters=l,f}if(!i&&this.eat(10)){let f=this.startNodeAt(s);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=l,r.optionalChainMember&&(f.optional=n),this.finishCallExpression(f,r.optionalChainMember)}let c=this.state.type;if(c===48||c===52||c!==10&&Ve(c)&&!this.hasPrecedingLineBreak())return;let u=this.startNodeAt(s);return u.expression=e,u.typeParameters=l,this.finishNode(u,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),h)return h.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(y.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),h}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:i}=e;i.type==="TSInstantiationExpression"&&!((s=i.extra)!=null&&s.parenthesized)&&(e.typeParameters=i.typeParameters,e.callee=i.expression)}parseExprOp(e,s,i){let r;if(we(58)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(r=this.isContextual(120)))){let n=this.startNodeAt(s);return n.expression=e,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(r&&this.raise(p.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,r?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,s,i)}return super.parseExprOp(e,s,i)}checkReservedWord(e,s,i,r){this.state.isAmbientContext||super.checkReservedWord(e,s,i,r)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(y.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,r){super.applyImportPhase(e,s,i,r),s?e.exportKind=i==="type"?"type":"value":e.importKind=i==="type"||i==="typeof"?i:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let s;if(E(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let i=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,i);s=super.parseImportSpecifiersAndAfter(e,i)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(y.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){let i=e;this.next();let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(i,!1):i.importKind="value",this.tsParseImportEqualsDeclaration(i,r,!0)}else if(this.eat(29)){let i=e;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(93)){let i=e;return this.expectContextual(128),i.id=this.parseIdentifier(),this.semicolon(),this.finishNode(i,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,i=!1){let{isAmbientContext:r}=this.state,n=super.parseVarStatement(e,s,i||r);if(!r)return n;for(let{id:o,init:h}of n.declarations)h&&(s!=="const"||o.typeAnnotation?this.raise(y.InitializerNotAllowedInAmbientContext,h):Wi(h,this.hasPlugin("estree"))||this.raise(y.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,h));return n}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let i=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(i,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return i}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(i=>_t(i)?e.accessibility===i:!!e[i])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,i){let r=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:y.InvalidModifierOnTypeParameterPositions},s);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,r)&&this.raise(y.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,i,!!s.static)};s.declare?this.tsInAmbientContext(n):n()}parseClassMemberWithIsStatic(e,s,i,r){let n=this.tsTryParseIndexSignature(s);if(n){e.body.push(n),s.abstract&&this.raise(y.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(y.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(y.IndexSignatureHasDeclare,s),s.override&&this.raise(y.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(y.NonAbstractClassHasAbstractMethod,s),s.override&&(i.hadSuperClass||this.raise(y.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,i,r)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(y.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(y.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,i){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,i):void 0)||super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,i){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,i);let r=this.tryParse(()=>super.parseConditional(e,s));return r.node?(r.error&&(this.state=r.failState),r.node):(r.error&&super.setOptionalParametersError(i,r.error),e)}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,i=this.eatContextual(125);if(i&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(y.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let n=E(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return n?((n.type==="TSInterfaceDeclaration"||n.type==="TSTypeAliasDeclaration"||i)&&(e.exportKind="type"),i&&n.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(n,s),n.declare=!0),n):null}parseClassId(e,s,i,r){if((!s||i)&&this.isContextual(113))return;super.parseClassId(e,s,i,e.declare?1024:8331);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(y.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:s}=e;this.raise(y.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(y.PrivateElementHasAbstract,e),e.accessibility&&this.raise(y.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(y.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,i,r,n,o){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);h&&n&&this.raise(y.ConstructorHasTypeParameters,h);let{declare:l=!1,kind:c}=s;l&&(c==="get"||c==="set")&&this.raise(y.DeclareAccessor,s,{kind:c}),h&&(s.typeParameters=h),super.pushClassMethod(e,s,i,r,n,o)}pushClassPrivateMethod(e,s,i,r){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(s.typeParameters=n),super.pushClassPrivateMethod(e,s,i,r)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,i,r,n,o,h){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);return l&&(e.typeParameters=l),super.parseObjPropValue(e,s,i,r,n,o,h)}parseFunctionParams(e,s){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(e.typeParameters=i),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var i,r,n,o,h;let l,c,u;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(l=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!c.error)return c.node;let{context:x}=this.state,S=x[x.length-1];(S===C.j_oTag||S===C.j_expr)&&x.pop()}if(!((i=c)!=null&&i.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!l||l===this.state)&&(l=this.state.clone());let f,d=this.tryParse(x=>{var S,N;f=this.tsParseTypeParameters(this.tsParseConstModifier);let w=super.parseMaybeAssign(e,s);return(w.type!=="ArrowFunctionExpression"||(S=w.extra)!=null&&S.parenthesized)&&x(),((N=f)==null?void 0:N.params.length)!==0&&this.resetStartLocationFromNode(w,f),w.typeParameters=f,w},l);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!c&&(Rt(!this.hasPlugin("jsx")),u=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!u.error))return u.node;if((r=c)!=null&&r.node)return this.state=c.failState,c.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;throw((o=c)==null?void 0:o.error)||d.error||((h=u)==null?void 0:h.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(y.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(i=>{let r=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&i(),r});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(y.UnexpectedTypeCastInParameter,e):this.raise(y.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,i){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(i!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,i)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,s){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e,s);return r.typeParameters=i,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,s)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.startthis.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:i}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=i}}parseClass(e,s,i){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,i)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(y.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,i,r,n,o,h){let l=super.parseMethod(e,s,i,r,n,o,h);if(l.abstract&&(this.hasPlugin("estree")?l.value:l).body){let{key:f}=l;this.raise(y.AbstractMethodHasImplementation,l,{methodName:f.type==="Identifier"&&!l.computed?f.name:`[${this.input.slice(this.offsetToSourcePos(f.start),this.offsetToSourcePos(f.end))}]`})}return l}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,i,r){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!1,i),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,i,r))}parseImportSpecifier(e,s,i,r,n){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!0,i),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,i,r,i?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,i){let r=s?"imported":"local",n=s?"local":"exported",o=e[r],h,l=!1,c=!0,u=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let x=this.parseIdentifier();D(this.state.type)?(l=!0,o=d,h=s?this.parseIdentifier():this.parseModuleExportName(),c=!1):(h=x,c=!1)}else D(this.state.type)?(c=!1,h=s?this.parseIdentifier():this.parseModuleExportName()):(l=!0,o=d)}else D(this.state.type)&&(l=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());l&&i&&this.raise(s?y.TypeModifierIsUsedInTypeImports:y.TypeModifierIsUsedInTypeExports,u),e[r]=o,e[n]=h;let f=s?"importKind":"exportKind";e[f]=l?"type":"value",c&&this.eatContextual(93)&&(e[n]=s?this.parseIdentifier():this.parseModuleExportName()),e[n]||(e[n]=U(e[r])),s&&this.checkIdentifier(e[n],l?4098:4096)}};function Ji(a){if(a.type!=="MemberExpression")return!1;let{computed:t,property:e}=a;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:ss(a.object)}function Wi(a,t){var e;let{type:s}=a;if((e=a.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){let{value:i}=a;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(ts(a,t)||Xi(a,t)||s==="TemplateLiteral"&&a.expressions.length===0||Ji(a))}function ts(a,t){return t?a.type==="Literal"&&(typeof a.value=="number"||"bigint"in a):a.type==="NumericLiteral"||a.type==="BigIntLiteral"}function Xi(a,t){if(a.type==="UnaryExpression"){let{operator:e,argument:s}=a;if(e==="-"&&ts(s,t))return!0}return!1}function ss(a){return a.type==="Identifier"?!0:a.type!=="MemberExpression"||a.computed?!1:ss(a.object)}var Ut=_`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Gi=a=>class extends a{parsePlaceholder(e){if(this.match(133)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let i=e;return(!i.expectedNode||!i.type)&&(i=this.finishNode(i,"Placeholder")),i.expectedNode=s,i}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,i,r){e!==void 0&&super.checkReservedWord(e,s,i,r)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,i){return e==="Placeholder"||super.isValidLVal(e,s,i)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===133)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var i;if(s.type!=="Placeholder"||(i=s.extra)!=null&&i.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let n=e;return n.label=this.finishPlaceholder(s,"Identifier"),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,"LabeledStatement")}this.semicolon();let r=e;return r.name=s.name,this.finishPlaceholder(r,"Statement")}parseBlock(e,s,i){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,i)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,i){let r=s?"ClassDeclaration":"ClassExpression";this.next();let n=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(133)||this.match(5))e.id=o;else{if(i||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,r);throw this.raise(Ut.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,i);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,n),this.finishNode(e,r)}parseExport(e,s){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseExport(e,s);let r=e;if(!this.isContextual(98)&&!this.match(12))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(i,"Declaration"),this.finishNode(r,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let n=this.startNode();return n.exported=i,r.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],super.parseExport(r,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(q(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var i;return(i=e.specifiers)!=null&&i.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(i=>i.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let i=this.startNodeAtNode(s);return i.local=s,e.specifiers.push(this.finishNode(i,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(Ut.UnexpectedSpace,this.state.lastTokEndLoc)}},Yi=a=>class extends a{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),E(this.state.type)){let i=this.parseIdentifierName(),r=this.createIdentifier(s,i);if(r.type="V8IntrinsicIdentifier",this.match(10))return r}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},jt=["minimal","fsharp","hack","smart"],$t=["^^","@@","^","%","#"];function Qi(a){if(a.has("decorators")){if(a.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let e=a.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let s=a.get("decorators").allowCallParenthesized;if(s!=null&&typeof s!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(a.has("flow")&&a.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(a.has("placeholders")&&a.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(a.has("pipelineOperator")){var t;let e=a.get("pipelineOperator").proposal;if(!jt.includes(e)){let i=jt.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}let s=((t=a.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash";if(e==="hack"){if(a.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(a.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=a.get("pipelineOperator").topicToken;if(!$t.includes(i)){let r=$t.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}if(i==="#"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}if(a.has("moduleAttributes")){if(a.has("deprecatedImportAssert")||a.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(a.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(a.has("importAssertions")&&a.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!a.has("deprecatedImportAssert")&&a.has("importAttributes")&&a.get("importAttributes").deprecatedAssertSyntax&&a.set("deprecatedImportAssert",{}),a.has("recordAndTuple")){let e=a.get("recordAndTuple").syntaxType;if(e!=null){let s=["hash","bar"];if(!s.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+s.map(i=>`'${i}'`).join(", "))}}if(a.has("asyncDoExpressions")&&!a.has("doExpressions")){let e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(a.has("optionalChainingAssign")&&a.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var is={estree:ti,jsx:zi,flow:$i,typescript:Hi,v8intrinsic:Yi,placeholders:Gi},Zi=Object.keys(is),ot=class extends nt{checkProto(t,e,s,i){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;let r=t.key;if((r.type==="Identifier"?r.name:r.value)==="__proto__"){if(e){this.raise(p.RecordNoProto,r);return}s.used&&(i?i.doubleProtoLoc===null&&(i.doubleProtoLoc=r.loc.start):this.raise(p.DuplicateProto,r)),s.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===e}getExpression(){this.enterInitialScopes(),this.nextToken();let t=this.parseExpression();return this.match(140)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&128&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let i=this.startNodeAt(e);for(i.expressions=[s];this.eat(12);)i.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(i.expressions),this.finishNode(i,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var s;t.optionalParametersLoc=(s=e==null?void 0:e.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,s)),o}let i;t?i=!1:(t=new Z,i=!0);let{type:r}=this.state;(r===10||E(r))&&(this.state.potentialArrowAt=this.state.start);let n=this.parseMaybeConditional(t);if(e&&(n=e.call(this,n,s)),ni(this.state.type)){let o=this.startNodeAt(s),h=this.state.value;if(o.operator=h,this.match(29)){this.toAssignable(n,!0),o.left=n;let l=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=l&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=l&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=l&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else o.left=n;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(n,this.finishNode(o,"AssignmentExpression")),o}else i&&this.checkExpressionErrors(t,!0);return n}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprOps(t);return this.shouldExitDescending(i,s)?i:this.parseConditional(i,e,t)}parseConditional(t,e,s){if(this.eat(17)){let i=this.startNodeAt(e);return i.test=t,i.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(i,s)?i:this.parseExprOp(i,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let r=this.getPrivateNameSV(t);(s>=we(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(p.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t.loc.start)}let i=this.state.type;if(hi(i)&&(this.prodParam.hasIn||!this.match(58))){let r=we(i);if(r>s){if(i===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let n=this.startNodeAt(e);n.left=t,n.operator=this.state.value;let o=i===41||i===42,h=i===40;if(h&&(r=we(42)),this.next(),i===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(p.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);n.right=this.parseExprOpRightExpr(i,r);let l=this.finishNode(n,o||h?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(h&&(c===41||c===42)||o&&c===40)throw this.raise(p.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(p.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,fi(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return Ws.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(p.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(p.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,i=this.isContextual(96);if(i&&this.recordAwaitIfAllowed()){this.next();let h=this.parseAwait(s);return e||this.checkExponentialAfterUnary(h),h}let r=this.match(34),n=this.startNode();if(ci(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let h=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&h){let l=n.argument;l.type==="Identifier"?this.raise(p.StrictDelete,n):this.hasPropertyAsPrivateName(l)&&this.raise(p.DeletePrivateField,n)}if(!r)return e||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let o=this.parseUpdate(n,r,t);if(i){let{type:h}=this.state;if((this.hasPlugin("v8intrinsic")?Ve(h):Ve(h)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(p.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){let n=t;return this.checkLVal(n.argument,this.finishNode(n,"UpdateExpression")),t}let i=this.state.startLoc,r=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return r;for(;li(this.state.type)&&!this.canInsertSemicolon();){let n=this.startNodeAt(i);n.operator=this.state.value,n.prefix=!1,n.argument=r,this.next(),this.checkLVal(r,r=this.finishNode(n,"UpdateExpression"))}return r}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprAtom(t);return this.shouldExitDescending(i,s)?i:this.parseSubscripts(i,e)}parseSubscripts(t,e,s){let i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,i),i.maybeAsyncArrow=!1;while(!i.stop);return t}parseSubscript(t,e,s,i){let{type:r}=this.state;if(!s&&r===15)return this.parseBind(t,e,s,i);if(Ie(r))return this.parseTaggedTemplateExpression(t,e,i);let n=!1;if(r===18){if(s&&(this.raise(p.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return i.stop=!0,t;i.optionalChainMember=n=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,i,n);{let o=this.eat(0);return o||n||this.eat(16)?this.parseMember(t,e,i,o,n):(i.stop=!0,t)}}parseMember(t,e,s,i,r){let n=this.startNodeAt(e);return n.object=t,n.computed=i,i?(n.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(p.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),s.optionalChainMember?(n.optional=r,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(t,e,s,i){let r=this.startNodeAt(e);return r.object=t,this.next(),r.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,i){let r=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:h,optionalChainMember:l}=s;h&&(this.expressionScope.enter(Mi()),n=new Z),l&&(o.optional=i),i?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type!=="Super",o,n);let c=this.finishCallExpression(o,l);return h&&this.shouldParseAsyncArrow()&&!i?(s.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),c)):(h&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(c)),this.state.maybeInArrowParameters=r,c}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let i=this.startNodeAt(e);return i.tag=t,i.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(p.OptionalChainingNoTemplate,e),this.finishNode(i,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(p.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(p.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,i){let r=[],n=!0,o=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}r.push(this.parseExprListItem(!1,i,e))}return this.state.inFSharpPipelineDirectBody=o,r}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&de(t,e.innerComments),e.callee.trailingComments&&de(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.optionFlags&256?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(p.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let r=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(r)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,t);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let r=e.callee=this.parseNoCallExpr();if(r.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(p.UnsupportedBind,r)}case 139:return this.raise(p.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let r=this.getPluginOption("pipelineOperator","proposal");if(r)return this.parseTopicReference(r);this.unexpected();break}case 47:{let r=this.input.codePointAt(this.nextTokenStart());R(r)||r===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(i===137)return this.parseDecimalLiteral(this.state.value);if(E(i)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let r=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:h}=this.state;if(h===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(E(h))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(h===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return r&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=v(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(e,s,t,i)}finishTopicReference(t,e,s,i){if(this.testTopicReferenceConfiguration(s,e,i))return s==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PrimaryTopicNotAllowed,e),this.registerTopicReference(),this.finishNode(t,"PipelinePrimaryTopicReference"));throw this.raise(p.PipeTopicUnconfiguredToken,e,{token:q(i)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:q(s)}]);case"smart":return s===27;default:throw this.raise(p.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Ce(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(p.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!(this.optionFlags&16)?this.raise(p.SuperNotAllowed,t):!this.scope.allowSuper&&!(this.optionFlags&16)&&this.raise(p.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(p.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(v(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let i=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||i)&&this.raise(p.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){let e=this.createIdentifier(this.startNodeAtNode(t),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(p.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let s=this.isContextual(105);if(this.expectPlugin(s?"sourcePhaseImports":"deferredImportEvaluation"),!(this.optionFlags&256))throw this.raise(p.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),t.phase=s?"source":"defer",this.parseImportCall(t)}return this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(Di());let i=this.state.maybeInArrowParameters,r=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],h=new Z,l=!0,c,u;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,h.optionalParametersLoc===null?null:h.optionalParametersLoc),this.match(11)){u=this.state.startLoc;break}if(this.match(21)){let x=this.state.startLoc;if(c=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),x)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(h,this.parseParenItem))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=r;let d=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(h),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),u&&this.unexpected(u),c&&this.unexpected(c),this.checkExpressionErrors(h,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(n),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,f)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!(this.optionFlags&512))return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!(this.optionFlags&4)&&this.raise(p.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(p.ImportCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:i,value:r}=this.state,n=e+1,o=this.startNodeAt(v(s,1));r===null&&(t||this.raise(p.InvalidEscapeSequenceTemplate,v(this.state.firstInvalidTemplateEscapePos,1)));let h=this.match(24),l=h?-1:-2,c=i+l;o.value={raw:this.input.slice(n,c).replace(/\r\n?/g,` +`),cooked:r===null?null:r.slice(1,l)},o.tail=h,this.next();let u=this.finishNode(o,"TemplateElement");return this.resetEndLocation(u,v(this.state.lastTokEndLoc,l)),u}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),i=[s],r=[];for(;!s.tail;)r.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(s=this.parseTemplateElement(t));return e.expressions=r,e.quasis=i,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=Object.create(null),o=!0,h=this.startNode();for(h.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(h);break}let c;e?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(i),this.checkProto(c,s,n,i)),s&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(p.InvalidRecordProperty,c),c.shorthand&&this.addExtra(c,"shorthand",!0),h.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=r;let l="ObjectExpression";return e?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(h,l)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(p.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),i=!1,r=!1,n;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let h=this.state.containsEsc;if(this.parsePropertyName(s,t),!o&&!h&&this.maybeAsyncOrAccessorProp(s)){let{key:l}=s,c=l.name;c==="async"&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(l),o=this.eat(55),this.parsePropertyName(s)),(c==="get"||c==="set")&&(r=!0,this.resetPreviousNodeTrailingComments(l),s.kind=c,this.match(55)&&(o=!0,this.raise(p.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,n,o,i,!1,r,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),i=this.getObjectOrClassMethodParams(t);i.length!==s&&this.raise(t.kind==="get"?p.BadGetterArity:p.BadSetterArity,t),t.kind==="set"&&((e=i[i.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(p.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,i,r){if(r){let n=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(s||e||this.match(10))return i&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,i){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(i),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,U(t.key));else if(this.match(29)){let r=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=r):this.raise(p.InvalidCoverInitializedName,r),t.value=this.parseMaybeDefault(e,U(t.key))}else t.value=U(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,i,r,n,o){let h=this.parseObjectMethod(t,s,i,r,n)||this.parseObjectProperty(t,e,r,o);return h||this.unexpected(),h}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:i}=this.state,r;if(D(s))r=this.parseIdentifier(!0);else switch(s){case 135:r=this.parseNumericLiteral(i);break;case 134:r=this.parseStringLiteral(i);break;case 136:r=this.parseBigIntLiteral(i);break;case 139:{let n=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=n):this.raise(p.UnexpectedPrivateField,n),r=this.parsePrivateName();break}default:if(s===137){r=this.parseDecimalLiteral(i);break}this.unexpected()}t.key=r,s!==139&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,i,r,n,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(o?64:0)|(r?32:0)),this.prodParam.enter(Ce(s,t.generator)),this.parseFunctionParams(t,i);let h=this.parseFunctionBodyAndFinish(t,n,!0);return this.prodParam.exit(),this.scope.exit(),h}parseArrayLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(t,!s,i,n),this.state.inFSharpPipelineDirectBody=r,this.finishNode(n,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,i){this.scope.enter(6);let r=Ce(s,!1);!this.match(5)&&this.prodParam.hasIn&&(r|=8),this.prodParam.enter(r),this.initFunction(t,s);let n=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let i=e&&!this.match(5);if(this.expressionScope.enter(Zt()),i)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let r=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,o=>{let h=!this.isSimpleParamList(t.params);o&&h&&this.raise(p.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let l=!r&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!h,e,l),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,l)}),this.prodParam.exit(),this.state.labels=n}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e10||!Si(t))return;if(s&&Ti(t)){this.raise(p.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?i?Xt:Jt:Ht)(t,this.inModule)){this.raise(p.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(p.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(p.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(p.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(p.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait||this.optionFlags&1&&!this.scope.inFunction;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(p.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(p.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||Ie(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){let t=this.startNode();this.expressionScope.recordParameterInitializerError(p.YieldInParameter,t),this.next();let e=!1,s=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:s=this.parseMaybeAssign()}return t.delegate=e,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)&&!this.match(11)&&(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(p.ImportCallArity,t)}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(p.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(p.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},$e={kind:1},er={kind:2},tr=/[\uD800-\uDFFF]/u,ze=/in(?:stanceof)?/y;function sr(a,t,e){for(let s=0;s0)for(let[r,n]of Array.from(this.scope.undefinedExports))this.raise(p.ModuleExportUndefined,n,{localName:r});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let i;return e===140?i=this.finishNode(t,"Program"):i=this.finishNodeAt(t,"Program",v(this.state.startLoc,-1)),i}stmtToDirective(t){let e=t;e.type="Directive",e.value=e.expression,delete e.expression;let s=e.value,i=s.value,r=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),n=s.value=r.slice(1,-1);return this.addExtra(s,"raw",r),this.addExtra(s,"rawValue",n),this.addExtra(s,"expressionValue",i),s.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(R(t)){if(ze.lastIndex=e,ze.test(this.input)){let s=this.codePointAtPos(ze.lastIndex);if(!Y(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){let{type:t,containsEsc:e}=this.lookahead();if(t===102&&!e)return!1;if(E(t)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,i=this.startNode(),r=!!(t&2),n=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?p.StrictFunction:this.options.annexB?p.SloppyFunctionAnnexB:p.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(i,!1,!r&&n);case 80:return r||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?r||this.raise(p.UnexpectedLexicalDeclaration,i):this.raise(p.AwaitUsingNotInAsyncContext,i),this.next(),this.parseVarStatement(i,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(p.UnexpectedUsingDeclaration,this.state.startLoc):r||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),u=this.codePointAtPos(c);if(u!==91&&(!r&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(u,c)&&u!==123))break}case 75:r||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(i,c)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!(this.optionFlags&8)&&!o&&this.raise(p.UnexpectedImportExport,this.state.startLoc),this.next();let c;return s===83?(c=this.parseImport(i),c.type==="ImportDeclaration"&&(!c.importKind||c.importKind==="value")&&(this.sawUnambiguousESM=!0)):(c=this.parseExport(i,e),(c.type==="ExportNamedDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportAllDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return r||this.raise(p.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(i,!0,!r&&n)}let h=this.state.value,l=this.parseExpression();return E(s)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(i,h,l,t):this.parseExpressionStatement(i,l,e)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(p.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){if(t){var i;(i=e.decorators)!=null&&i.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(p.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)}return e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(p.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(p.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let i=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(i,s);let r=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s,i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(p.DecoratorArgumentsOutsideParentheses,r)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let i=this.startNodeAt(e);i.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName()):i.property=this.parseIdentifier(!0),i.computed=!1,s=this.finishNode(i,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s,e)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,e){if(this.eat(10)){let s=this.startNodeAt(e);return s.callee=t,s.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push($e);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(100);{let h=this.isContextual(96)&&this.startsAwaitUsing(),l=h||this.isContextual(107)&&this.startsUsingForOf(),c=s&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||c){let u=this.startNode(),f;h?(f="await using",this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(u,!0,f);let d=this.finishNode(u,"VariableDeclaration"),x=this.match(58);return x&&l&&this.raise(p.ForInUsing,d),(x||this.isContextual(102))&&d.declarations.length===1?this.parseForIn(t,d,e):(e!==null&&this.unexpected(e),this.parseFor(t,d))}}let i=this.isContextual(95),r=new Z,n=this.parseExpression(!0,r),o=this.isContextual(102);if(o&&(s&&this.raise(p.ForOfLet,n),e===null&&i&&n.type==="Identifier"&&this.raise(p.ForOfAsync,n)),o||this.match(58)){this.checkDestructuringPrivate(r),this.toAssignable(n,!0);let h=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{type:h}),this.parseForIn(t,n,e)}else this.checkExpressionErrors(r,!0);return e!==null&&this.unexpected(e),this.parseFor(t,n)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!(this.optionFlags&2)&&this.raise(p.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(er),this.scope.enter(0);let s;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let r=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),r?s.test=this.parseExpression():(i&&this.raise(p.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),i=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(p.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(p.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push($e),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(p.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,i){for(let n of this.state.labels)n.name===e&&this.raise(p.LabelRedeclaration,s,{labelName:e});let r=oi(this.state.type)?1:this.match(71)?2:null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===t.start)o.statementStart=this.sourceToOffsetPos(this.state.start),o.kind=r;else break}return this.state.labels.push({name:e,kind:r,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=i&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let i=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(i,t,!1,8,s),e&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,i,r){let n=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(n,e?o:void 0,s,i,r)}parseBlockOrModuleBlockBody(t,e,s,i,r){let n=this.state.strict,o=!1,h=!1;for(;!this.match(i);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!h){if(this.isValidDirective(l)){let c=this.stmtToDirective(l);e.push(c),!o&&c.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}h=!0,this.state.strictErrors.clear()}t.push(l)}r==null||r.call(this,o),n||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let i=this.match(58);return this.next(),i?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(p.ForInOfLoopInitializer,e,{type:i?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(p.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,i=!1){let r=t.declarations=[];for(t.kind=s;;){let n=this.startNode();if(this.parseVarId(n,s),n.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!i&&(n.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),r.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(p.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,i=!!(e&1),r=i&&!(e&4),n=!!(e&8);this.initFunction(t,n),this.match(55)&&(s&&this.raise(p.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),i&&(t.id=this.parseFunctionId(r));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Ce(n,t.generator)),i||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||E(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Li()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,i),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},i=[],r=this.startNode();if(r.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(p.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}let n=this.startNode();i.length&&(n.decorators=i,this.resetStartLocationFromNode(n,i[0]),i=[]),this.parseClassMember(r,n,s),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(p.DecoratorConstructor,n)}}),this.state.strict=e,this.next(),i.length)throw this.raise(p.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(r,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let i=e;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(t,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=e;return i.computed=!1,i.key=s,i.static=!1,t.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,i)}parseClassMemberWithIsStatic(t,e,s,i){let r=e,n=e,o=e,h=e,l=e,c=r,u=r;if(e.static=i,this.parsePropertyNamePrefixOperator(e),this.eat(55)){c.kind="method";let w=this.match(139);if(this.parseClassElementName(c),w){this.pushClassPrivateMethod(t,n,!0,!1);return}this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsGenerator,r.key),this.pushClassMethod(t,r,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&E(this.state.type),d=this.parseClassElementName(e),x=f?d.name:null,S=this.isPrivateName(d),N=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(c.kind="method",S){this.pushClassPrivateMethod(t,n,!1,!1);return}let w=this.isNonstaticConstructor(r),I=!1;w&&(r.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(p.DuplicateConstructor,d),w&&this.hasPlugin("typescript")&&e.override&&this.raise(p.OverrideOnConstructor,d),s.hadConstructor=!0,I=s.hadSuperClass),this.pushClassMethod(t,r,!1,!1,w,I)}else if(this.isClassProperty())S?this.pushClassPrivateProperty(t,h):this.pushClassProperty(t,o);else if(x==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let w=this.eat(55);u.optional&&this.unexpected(N),c.kind="method";let I=this.match(139);this.parseClassElementName(c),this.parsePostMemberNameModifiers(u),I?this.pushClassPrivateMethod(t,n,w,!0):(this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsAsync,r.key),this.pushClassMethod(t,r,w,!0,!1,!1))}else if((x==="get"||x==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),c.kind=x;let w=this.match(139);this.parseClassElementName(r),w?this.pushClassPrivateMethod(t,n,!1,!1):(this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsAccessor,r.key),this.pushClassMethod(t,r,!1,!1,!1,!1)),this.checkGetterSetterParams(r)}else if(x==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let w=this.match(139);this.parseClassElementName(o),this.pushClassAccessorProperty(t,l,w)}else this.isLineTerminator()?S?this.pushClassPrivateProperty(t,h):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===132||e===134)&&t.static&&s==="prototype"&&this.raise(p.StaticPrototype,this.state.startLoc),e===139){s==="constructor"&&this.raise(p.ConstructorClassPrivateField,this.state.startLoc);let i=this.parsePrivateName();return t.key=i,i}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(208);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=e.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(p.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key);let i=this.parseClassAccessorProperty(e);t.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(t,e,s,i,r,n){t.body.push(this.parseMethod(e,s,i,r,n,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,i){let r=this.parseMethod(e,s,i,!1,!1,"ClassPrivateMethod",!0);t.body.push(r);let n=r.kind==="get"?r.static?6:2:r.kind==="set"?r.static?5:1:0;this.declareClassPrivateMethodInScope(r,n)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(Zt()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,i=8331){if(E(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,i);else if(s||!e)t.id=null;else throw this.raise(p.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),i=this.maybeParseExportDefaultSpecifier(t,s),r=!i||this.eat(12),n=r&&this.eatExportStar(t),o=n&&this.maybeParseExportNamespaceSpecifier(t),h=r&&(!o||this.eat(12)),l=i||n;if(n&&!o){if(i&&this.unexpected(),e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(t);i&&r&&!n&&!c&&this.unexpected(null,5),o&&h&&this.unexpected(null,98);let u;if(l||c){if(u=!1,e)throw this.raise(p.UnsupportedDecoratorExport,t);this.parseExportFrom(t,l)}else u=this.maybeParseExportDeclaration(t);if(l||c||u){var f;let d=t;if(this.checkExport(d,!0,!1,!!d.source),((f=d.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=t,x=this.parseExportDefaultExpression();if(d.declaration=x,x.type==="ClassDeclaration")this.maybeTakeDecorators(e,x,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.checkExport(d,!0,!0),this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);let s=e||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,t.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,s;(s=(e=t).specifiers)!=null||(e.specifiers=[]);let i=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),i.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(i,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(p.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(p.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(E(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let{type:i}=this.lookahead();if(E(i)&&i!==98||i===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||E(this.state.type)&&s)return!0;if(this.match(65)&&s){let i=this.input.charCodeAt(this.nextTokenStartSince(e+4));return i===34||i===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(p.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(p.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(p.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,i){if(e){var r;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized)&&this.raise(p.ExportDefaultFromAsIdentifier,o)}}else if((r=t.specifiers)!=null&&r.length)for(let o of t.specifiers){let{exported:h}=o,l=h.type==="Identifier"?h.name:h.value;if(this.checkDuplicateExports(o,l),!i&&o.local){let{local:c}=o;c.type!=="Identifier"?this.raise(p.ExportBindingIsString,o,{localName:c.value,exportName:l}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(t.declaration){let o=t.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:h}=o;if(!h)throw new Error("Assertion failure");this.checkDuplicateExports(t,h.name)}else if(o.type==="VariableDeclaration")for(let h of o.declarations)this.checkDeclaration(h.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(p.DuplicateDefaultExport,t):this.raise(p.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let i=this.isContextual(130),r=this.match(134),n=this.startNode();n.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(n,r,t,i))}return e}parseExportSpecifier(t,e,s,i){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=Fi(t.local):t.exported||(t.exported=U(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),e=tr.exec(t.value);return e&&this.raise(p.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(p.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(p.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var i;s!=="ImportDefaultSpecifier"&&this.raise(p.ImportReflectionNotBinding,e[0].loc.start),((i=t.assertions)==null?void 0:i.length)>0&&this.raise(p.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(i=>{let r;if(i.type==="ExportSpecifier"?r=i.local:i.type==="ImportSpecifier"&&(r=i.imported),r!==void 0)return r.type==="Identifier"?r.name!=="default":r.value!=="default"});s!==void 0&&this.raise(p.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,i){e||(s==="module"?(this.expectPlugin("importReflection",i),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",i),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",i),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.parseIdentifier(!0),{type:i}=this.state;return(D(i)?i!==98||this.lookaheadCharCode()===102:i!==12)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(t,e,s.name,s.loc.start),null):(this.applyImportPhase(t,e,null),s)}isPrecedingIdImportPhase(t){let{type:e}=this.state;return E(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),r=i&&this.maybeParseStarImportSpecifier(t);return i&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),i=this.state.value;if(e.has(i)&&this.raise(p.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i}),e.add(i),this.match(134)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(p.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(p.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():e=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(p.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(D(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(p.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),i=this.match(134),r=this.isContextual(130);s.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(s,i,t.importKind==="type"||t.importKind==="typeof",r,void 0);t.specifiers.push(n)}}parseImportSpecifier(t,e,s,i,r){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:n}=t;if(e)throw this.raise(p.ImportBindingIsString,t,{importName:n.value});this.checkReservedWord(n.name,t.loc.start,!0,!0),t.local||(t.local=U(n))}return this.finishImportSpecifier(t,"ImportSpecifier",r)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},ke=class extends ht{constructor(t,e,s){t=Zs(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename,this.startIndex=t.startIndex;let i=0;t.allowAwaitOutsideFunction&&(i|=1),t.allowReturnOutsideFunction&&(i|=2),t.allowImportExportEverywhere&&(i|=8),t.allowSuperOutsideMethod&&(i|=16),t.allowUndeclaredExports&&(i|=32),t.allowNewTargetOutsideFunction&&(i|=4),t.ranges&&(i|=64),t.tokens&&(i|=128),t.createImportExpressions&&(i|=256),t.createParenthesizedExpressions&&(i|=512),t.errorRecovery&&(i|=1024),t.attachComment&&(i|=2048),t.annexB&&(i|=4096),this.optionFlags=i}getScopeHandler(){return fe}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}};function ir(a,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let s=ce(t,a),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",ce(t,a).parse()}catch{}else i.program.sourceType="script";return i}catch(s){try{return t.sourceType="script",ce(t,a).parse()}catch{}throw s}}else return ce(t,a).parse()}function rr(a,t){let e=ce(t,a);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function ar(a){let t={};for(let e of Object.keys(a))t[e]=F(a[e]);return t}var nr=ar(ii);function ce(a,t){let e=ke,s=new Map;if(a!=null&&a.plugins){for(let i of a.plugins){let r,n;typeof i=="string"?r=i:[r,n]=i,s.has(r)||s.set(r,n||{})}Qi(s),e=or(s)}return new e(a,t,s)}var zt=new Map;function or(a){let t=[];for(let i of Zi)a.has(i)&&t.push(i);let e=t.join("|"),s=zt.get(e);if(!s){s=ke;for(let i of t)s=is[i](s);zt.set(e,s)}return s}me.parse=ir;me.parseExpression=rr;me.tokTypes=nr});var Et={};zs(Et,{parsers:()=>Hr});var Be=It(gt(),1);function ve(a){return(t,e,s)=>{let i=!!(s!=null&&s.backwards);if(e===!1)return!1;let{length:r}=t,n=e;for(;n>=0&&n{if(!(a&&t==null))return Array.isArray(t)||typeof t=="string"?t[e<0?t.length+e:e]:t.at(e)},Tt=dr;function mr(a){return Array.isArray(a)&&a.length>0}var ye=mr;function L(a){var s,i,r;let t=((s=a.range)==null?void 0:s[0])??a.start,e=(r=((i=a.declaration)==null?void 0:i.decorators)??a.decorators)==null?void 0:r[0];return e?Math.min(L(e),t):t}function j(a){var t;return((t=a.range)==null?void 0:t[1])??a.end}function yr(a){let t=new Set(a);return e=>t.has(e==null?void 0:e.type)}var ps=yr;var xr=ps(["Block","CommentBlock","MultiLine"]),xe=xr;function Pr(a){let t=`*${a.value}*`.split(` +`);return t.length>1&&t.every(e=>e.trimStart()[0]==="*")}var bt=Pr;function gr(a){return xe(a)&&a.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(a.value)}var us=gr;var Pe=null;function ge(a){if(Pe!==null&&typeof Pe.property){let t=Pe;return Pe=ge.prototype=null,t}return Pe=ge.prototype=a??Object.create(null),new ge}var Tr=10;for(let a=0;a<=Tr;a++)ge();function At(a){return ge(a)}function br(a,t="type"){At(a);function e(s){let i=s[t],r=a[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:s});return r}return e}var fs=br;var ds={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var Ar=fs(ds),ms=Ar;function St(a,t){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a)){for(let s=0;s{var n;(n=r.leadingComments)!=null&&n.some(us)&&i.add(L(r))}),a=De(a,r=>{if(r.type==="ParenthesizedExpression"){let{expression:n}=r;if(n.type==="TypeCastExpression")return n.range=[...r.range],n;let o=L(r);if(!i.has(o))return n.extra={...n.extra,parenthesized:!0},n}})}if(a=De(a,i=>{switch(i.type){case"LogicalExpression":if(ys(i))return wt(i);break;case"VariableDeclaration":{let r=Tt(!1,i.declarations,-1);r!=null&&r.init&&s[j(r)]!==";"&&(i.range=[L(i),j(r)]);break}case"TSParenthesizedType":return i.typeAnnotation;case"TSTypeParameter":if(typeof i.name=="string"){let r=L(i);i.name={type:"Identifier",name:i.name,range:[r,r+i.name.length]}}break;case"TopicReference":a.extra={...a.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(i.types.length===1)return i.types[0];break}}),ye(a.comments)){let i=Tt(!1,a.comments,-1);for(let r=a.comments.length-2;r>=0;r--){let n=a.comments[r];j(n)===L(i)&&xe(n)&&xe(i)&&bt(n)&&bt(i)&&(a.comments.splice(r+1,1),n.value+="*//*"+i.value,n.range=[L(n),j(i)]),i=n}}return a.type==="Program"&&(a.range=[0,s.length]),a}function ys(a){return a.type==="LogicalExpression"&&a.right.type==="LogicalExpression"&&a.operator===a.right.operator}function wt(a){return ys(a)?wt({type:"LogicalExpression",operator:a.operator,left:wt({type:"LogicalExpression",operator:a.operator,left:a.left,right:a.right.left,range:[L(a.left),j(a.right.left)]}),right:a.right.right,range:[L(a),j(a)]}):a}var xs=Sr;function wr(a,t){let e=new SyntaxError(a+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(e,t)}var Me=wr;function Cr(a){let{message:t,loc:{line:e,column:s},reasonCode:i}=a,r=a;(i==="MissingPlugin"||i==="MissingOneOfPlugins")&&(t="Unexpected token.",r=void 0);let n=` (${e}:${s})`;return t.endsWith(n)&&(t=t.slice(0,-n.length)),Me(t,{loc:{start:{line:e,column:s+1}},cause:r})}var Oe=Cr;var Er=(a,t,e,s)=>{if(!(a&&t==null))return t.replaceAll?t.replaceAll(e,s):e.global?t.replace(e,s):t.split(e).join(s)},ie=Er;var Ir=/\*\/$/,Nr=/^\/\*\*?/,kr=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,vr=/(^|\s+)\/\/([^\n\r]*)/g,Ps=/^(\r?\n)+/,Lr=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,gs=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,Dr=/(\r?\n|^) *\* ?/g,Mr=[];function Ts(a){let t=a.match(kr);return t?t[0].trimStart():""}function bs(a){let t=` +`;a=ie(!1,a.replace(Nr,"").replace(Ir,""),Dr,"$1");let e="";for(;e!==a;)e=a,a=ie(!1,a,Lr,`${t}$1 $2${t}`);a=a.replace(Ps,"").trimEnd();let s=Object.create(null),i=ie(!1,a,gs,"").replace(Ps,"").trimEnd(),r;for(;r=gs.exec(a);){let n=ie(!1,r[2],vr,"");if(typeof s[r[1]]=="string"||Array.isArray(s[r[1]])){let o=s[r[1]];s[r[1]]=[...Mr,...Array.isArray(o)?o:[o],n]}else s[r[1]]=n}return{comments:i,pragmas:s}}function Or(a){let t=Le(a);t&&(a=a.slice(t.length+1));let e=Ts(a),{pragmas:s,comments:i}=bs(e);return{shebang:t,text:a,pragmas:s,comments:i}}function As(a){let{pragmas:t}=Or(a);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function Fr(a){return a=typeof a=="function"?{parse:a}:a,{astFormat:"estree",hasPragma:As,locStart:L,locEnd:j,...a}}var X=Fr;function Br(a){let{filepath:t}=a;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs")||t.endsWith(".cts"))return"script";if(t.endsWith(".mjs")||t.endsWith(".mts"))return"module"}}var Ss=Br;function Rr(a,t){let{type:e="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:r,comments:n}=a;return delete a.tokens,delete a.comments,{tokens:r,comments:n,type:e,node:a,range:[0,i.length],rootMarker:s}}var Fe=Rr;var re=a=>X(zr(a)),_r={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","explicitResourceManagement","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}],"recordAndTuple"],tokens:!0,ranges:!0},ws="v8intrinsic",Cs=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],$=(a,t=_r)=>({...t,plugins:[...t.plugins,...a]}),Ur=/@(?:no)?flow\b/u;function jr(a,t){var i;if((i=t.filepath)!=null&&i.endsWith(".js.flow"))return!0;let e=Le(a);e&&(a=a.slice(e.length));let s=ls(a,0);return s!==!1&&(a=a.slice(0,s)),Ur.test(a)}function $r(a,t,e){let s=a(t,e),i=s.errors.find(r=>!Vr.has(r.reasonCode));if(i)throw i;return s}function zr({isExpression:a=!1,optionsCombinations:t}){return(e,s={})=>{if((s.parser==="babel"||s.parser==="__babel_estree")&&jr(e,s))return s.parser="babel-flow",Ls.parse(e,s);let i=t;(s.__babelSourceType??Ss(s))==="script"&&(i=i.map(l=>({...l,sourceType:"script"})));let n=/%[A-Z]/u.test(e);e.includes("|>")?i=(n?[...Cs,ws]:Cs).flatMap(c=>i.map(u=>$([c],u))):n&&(i=i.map(l=>$([ws],l)));let o=a?Be.parseExpression:Be.parse,h;try{h=cs(i.map(l=>()=>$r(o,e,l)))}catch({errors:[l]}){throw Oe(l)}return a&&(h=Fe(h,{text:e,rootMarker:s.rootMarker})),xs(h,{parser:"babel",text:e})}}var Vr=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","ImportAttributesUseAssert"]),vs=[$(["jsx"])],Es=re({optionsCombinations:vs}),Is=re({optionsCombinations:[$(["jsx","typescript"]),$(["typescript"])]}),Ns=re({isExpression:!0,optionsCombinations:[$(["jsx"])]}),ks=re({isExpression:!0,optionsCombinations:[$(["typescript"])]}),Ls=re({optionsCombinations:[$(["jsx",["flow",{all:!0}],"flowComments"])]}),qr=re({optionsCombinations:vs.map(a=>$(["estree"],a))}),Ds={babel:Es,"babel-flow":Ls,"babel-ts":Is,__js_expression:Ns,__ts_expression:ks,__vue_expression:Ns,__vue_ts_expression:ks,__vue_event_binding:Es,__vue_ts_event_binding:Is,__babel_estree:qr};var Ms=It(gt(),1);function Os(a={}){let{allowComments:t=!0}=a;return function(s){let i;try{i=(0,Ms.parseExpression)(s,{tokens:!0,ranges:!0,attachComment:!1})}catch(r){throw Oe(r)}if(!t&&ye(i.comments))throw K(i.comments[0],"Comment");return ae(i),Fe(i,{type:"JsonRoot",text:s})}}function K(a,t){let[e,s]=[a.loc.start,a.loc.end].map(({line:i,column:r})=>({line:i,column:r+1}));return Me(`${t} is not allowed in JSON.`,{loc:{start:e,end:s}})}function ae(a){switch(a.type){case"ArrayExpression":for(let t of a.elements)t!==null&&ae(t);return;case"ObjectExpression":for(let t of a.properties)ae(t);return;case"ObjectProperty":if(a.computed)throw K(a.key,"Computed key");if(a.shorthand)throw K(a.key,"Shorthand property");a.key.type!=="Identifier"&&ae(a.key),ae(a.value);return;case"UnaryExpression":{let{operator:t,argument:e}=a;if(t!=="+"&&t!=="-")throw K(a,`Operator '${a.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw K(e,`Operator '${t}' before '${e.type}'`)}case"Identifier":if(a.name!=="Infinity"&&a.name!=="NaN"&&a.name!=="undefined")throw K(a,`Identifier '${a.name}'`);return;case"TemplateLiteral":if(ye(a.expressions))throw K(a.expressions[0],"'TemplateLiteral' with expression");for(let t of a.quasis)ae(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw K(a,`'${a.type}'`)}}var Ct=Os(),Kr={json:X({parse:Ct,hasPragma(){return!0}}),json5:X(Ct),jsonc:X(Ct),"json-stringify":X({parse:Os({allowComments:!1}),astFormat:"estree-json"})},Fs=Kr;var Hr={...Ds,...Fs};var Cn=Et;export{Cn as default,Hr as parsers}; diff --git a/node_modules/prettier/plugins/estree.js b/node_modules/prettier/plugins/estree.js new file mode 100644 index 0000000..974ddca --- /dev/null +++ b/node_modules/prettier/plugins/estree.js @@ -0,0 +1,36 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.estree=e()}})(function(){"use strict";var wn=Object.defineProperty;var Ha=Object.getOwnPropertyDescriptor;var Va=Object.getOwnPropertyNames;var $a=Object.prototype.hasOwnProperty;var Ns=e=>{throw TypeError(e)};var xr=(e,t)=>{for(var r in t)wn(e,r,{get:t[r],enumerable:!0})},Ka=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Va(t))!$a.call(e,s)&&s!==r&&wn(e,s,{get:()=>t[s],enumerable:!(n=Ha(t,s))||n.enumerable});return e};var Qa=e=>Ka(wn({},"__esModule",{value:!0}),e);var Gs=(e,t,r)=>t.has(e)||Ns("Cannot "+r);var ct=(e,t,r)=>(Gs(e,t,"read from private field"),r?r.call(e):t.get(e)),Us=(e,t,r)=>t.has(e)?Ns("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ys=(e,t,r,n)=>(Gs(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Em={};xr(Em,{languages:()=>fm,options:()=>Na,printers:()=>Dm});var Xs=[{linguistLanguageId:183,name:"JavaScript",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:["js","node"],extensions:[".js","._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".wxs"],filenames:["Jakefile"],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"]},{linguistLanguageId:183,name:"Flow",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:[],extensions:[".js.flow"],filenames:[],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"]},{linguistLanguageId:183,name:"JSX",type:"programming",tmScope:"source.js.jsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",color:void 0,aliases:void 0,extensions:[".jsx"],filenames:void 0,interpreters:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript"},{linguistLanguageId:378,name:"TypeScript",type:"programming",color:"#3178c6",aliases:["ts"],interpreters:["deno","ts-node"],extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"]},{linguistLanguageId:94901924,name:"TSX",type:"programming",color:"#3178c6",group:"TypeScript",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"]}];var js={};xr(js,{canAttachComment:()=>Bp,embed:()=>ri,experimentalFeatures:()=>om,getCommentChildNodes:()=>bp,getVisitorKeys:()=>br,handleComments:()=>Zn,insertPragma:()=>yi,isBlockComment:()=>ee,isGap:()=>Pp,massageAstNode:()=>xu,print:()=>ja,printComment:()=>Ou,willPrintOwnComments:()=>es});var za=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},Y=za;var Za=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},M=Za;function eo(e){return e!==null&&typeof e=="object"}var Hs=eo;function*to(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,s=u=>Hs(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let a of i)s(a)&&(yield a);else s(i)&&(yield i)}}function*ro(e,t){let r=[e];for(let n=0;n/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Ks(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Qs(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var zs=e=>!(Ks(e)||Qs(e));var no=/[^\x20-\x7F]/u;function so(e){if(!e)return 0;if(!no.test(e))return e.length;e=e.replace($s()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=zs(n)?1:2)}return t}var rt=so;function hr(e){return(t,r,n)=>{let s=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:u}=t,i=r;for(;i>=0&&i0}var O=co;var tu=new Proxy(()=>{},{get:()=>tu}),Mt=tu;var gr="'",ru='"';function lo(e,t){let r=t===!0||t===gr?gr:ru,n=r===gr?ru:gr,s=0,u=0;for(let i of e)i===r?s++:i===n&&u++;return s>u?n:r}var Sr=lo;function mo(e,t,r){let n=t==='"'?"'":'"',u=Y(!1,e,/\\(.)|(["'])/gsu,(i,a,o)=>a===n?a:o===t?"\\"+o:o||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a)?a:"\\"+a));return t+u+t}var nu=mo;function yo(e,t){Mt.ok(/^(?["']).*\k$/su.test(e));let r=e.slice(1,-1),n=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":Sr(r,t.singleQuote);return e.charAt(0)===n?e:nu(r,n,!1)}var nt=yo;function q(e){var n,s,u;let t=((n=e.range)==null?void 0:n[0])??e.start,r=(u=((s=e.declaration)==null?void 0:s.decorators)??e.decorators)==null?void 0:u[0];return r?Math.min(q(r),t):t}function k(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function Pt(e,t){let r=q(e);return Number.isInteger(r)&&r===q(t)}function Do(e,t){let r=k(e);return Number.isInteger(r)&&r===k(t)}function su(e,t){return Pt(e,t)&&Do(e,t)}var rr=null;function nr(e){if(rr!==null&&typeof rr.property){let t=rr;return rr=nr.prototype=null,t}return rr=nr.prototype=e??Object.create(null),new nr}var fo=10;for(let e=0;e<=fo;e++)nr();function On(e){return nr(e)}function Eo(e,t="type"){On(e);function r(n){let s=n[t],u=e[s];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return u}return r}var Br=Eo;var uu={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var Fo=Br(uu),br=Fo;function Co(e){let t=new Set(e);return r=>t.has(r==null?void 0:r.type)}var R=Co;var Ao=R(["Block","CommentBlock","MultiLine"]),ee=Ao;var To=R(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),Pr=To;function xo(e,t){let r=t.split(".");for(let n=r.length-1;n>=0;n--){let s=r[n];if(n===0)return e.type==="Identifier"&&e.name===s;if(e.type!=="MemberExpression"||e.optional||e.computed||e.property.type!=="Identifier"||e.property.name!==s)return!1;e=e.object}}function ho(e,t){return t.some(r=>xo(e,r))}var iu=ho;function go({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}var kr=go;function ur(e,t){return t(e)||Vs(e,{getVisitorKeys:br,predicate:t})}function Jt(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||L(e)||W(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||Ae(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function pu(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function Lr(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var At=R(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),cu=R(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),U=R(["ArrayExpression","TupleExpression"]),se=R(["ObjectExpression","RecordExpression"]);function lu(e){return e.type==="LogicalExpression"&&e.operator==="??"}function Fe(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function Rn(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&Fe(e.argument)}function te(e){return!!(e&&(e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"))}function Jn(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}var wr=R(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),So=R(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),Re=R(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),Rt=R(["FunctionExpression","ArrowFunctionExpression"]);function Bo(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function _n(e){return L(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var X=R(["JSXElement","JSXFragment"]);function kt(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function Or(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function mu(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!Pt(e,e.typeAnnotation)}var De=R(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function Tt(e){return W(e)||e.type==="BindExpression"&&!!e.object}var bo=R(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function qt(e){return kr(e)||Pr(e)||bo(e)||(e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference")&&!e.typeParameters&&!e.typeArguments}function Po(e){return e.type==="Identifier"&&(e.name==="beforeEach"||e.name==="beforeAll"||e.name==="afterEach"||e.name==="afterAll")}var ko=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function Io(e){return iu(e,ko)}function It(e,t){if((e==null?void 0:e.type)!=="CallExpression"||e.optional)return!1;let r=pe(e);if(r.length===1){if(_n(e)&&It(t))return Rt(r[0]);if(Po(e.callee))return _n(r[0])}else if((r.length===2||r.length===3)&&(r[0].type==="TemplateLiteral"||te(r[0]))&&Io(e.callee))return r[2]&&!Fe(r[2])?!1:(r.length===2?Rt(r[1]):Bo(r[1])&&z(r[1]).length<=1)||_n(r[1]);return!1}var yu=e=>t=>((t==null?void 0:t.type)==="ChainExpression"&&(t=t.expression),e(t)),L=yu(R(["CallExpression","OptionalCallExpression"])),W=yu(R(["MemberExpression","OptionalMemberExpression"]));function qn(e,t=5){return Du(e,t)<=t}function Du(e,t){let r=0;for(let n in e){let s=e[n];if(s&&typeof s=="object"&&typeof s.type=="string"&&(r++,r+=Du(s,t-r)),r>t)return r}return r}var Lo=.25;function ir(e,t){let{printWidth:r}=t;if(T(e))return!1;let n=r*Lo;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=n||Rn(e)&&!T(e.argument))return!0;let s=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return s?s.length<=n:te(e)?nt(fe(e),t).length<=n:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=n&&!e.quasis[0].value.raw.includes(` +`):e.type==="UnaryExpression"?ir(e.argument,{printWidth:r}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=n-2:wr(e)}function Le(e,t){return X(t)?Lt(t):T(t,h.Leading,r=>Z(e,k(r)))}function au(e){return e.quasis.some(t=>t.value.raw.includes(` +`))}function _r(e,t){return(e.type==="TemplateLiteral"&&au(e)||e.type==="TaggedTemplateExpression"&&au(e.quasi))&&!Z(t,q(e),{backwards:!0})}function vr(e){if(!T(e))return!1;let t=M(!1,lt(e,h.Dangling),-1);return t&&!ee(t)}function fu(e){if(e.length<=1)return!1;let t=0;for(let r of e)if(Rt(r)){if(t+=1,t>1)return!0}else if(L(r)){for(let n of pe(r))if(Rt(n))return!0}return!1}function jr(e){let{node:t,parent:r,key:n}=e;return n==="callee"&&L(t)&&L(r)&&r.arguments.length>0&&t.arguments.length>r.arguments.length}var wo=new Set(["!","-","+","~"]);function Ie(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return Ie(e.expression,t);let r=n=>Ie(n,t-1);if(Jn(e))return rt(e.pattern??e.regex.pattern)<=5;if(wr(e)||So(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(n=>!n.value.raw.includes(` +`))&&e.expressions.every(r);if(se(e))return e.properties.every(n=>!n.computed&&(n.shorthand||n.value&&r(n.value)));if(U(e))return e.elements.every(n=>n===null||r(n));if(mt(e)){if(e.type==="ImportExpression"||Ie(e.callee,t)){let n=pe(e);return n.length<=t&&n.every(r)}return!1}return W(e)?Ie(e.object,t)&&Ie(e.property,t):e.type==="UnaryExpression"&&wo.has(e.operator)||e.type==="UpdateExpression"?Ie(e.argument,t):!1}function fe(e){var t;return((t=e.extra)==null?void 0:t.raw)??e.raw}function Eu(e){return e}function oe(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function ae(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return ae(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return ae(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:ae(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:ae(e.callee,t);case"ConditionalExpression":return ae(e.test,t);case"UpdateExpression":return!e.prefix&&ae(e.argument,t);case"BindExpression":return e.object&&ae(e.object,t);case"SequenceExpression":return ae(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return ae(e.expression,t);default:return t(e)}}var ou={"==":!0,"!=":!0,"===":!0,"!==":!0},Ir={"*":!0,"/":!0,"%":!0},Mn={">>":!0,">>>":!0,"<<":!0};function ar(e,t){return!(sr(t)!==sr(e)||e==="**"||ou[e]&&ou[t]||t==="%"&&Ir[e]||e==="%"&&Ir[t]||t!==e&&Ir[t]&&Ir[e]||Mn[e]&&Mn[t])}var Oo=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(r=>[r,t])));function sr(e){return Oo.get(e)}function Fu(e){return!!Mn[e]||e==="|"||e==="^"||e==="&"}function Cu(e){var r;if(e.rest)return!0;let t=z(e);return((r=M(!1,t,-1))==null?void 0:r.type)==="RestElement"}var vn=new WeakMap;function z(e){if(vn.has(e))return vn.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),vn.set(e,t),t}function Au(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);r.this&&e.call(s,"this"),Array.isArray(r.parameters)?e.each(s,"parameters"):Array.isArray(r.params)&&e.each(s,"params"),r.rest&&e.call(s,"rest")}var jn=new WeakMap;function pe(e){if(jn.has(e))return jn.get(e);if(e.type==="ChainExpression")return pe(e.expression);let t=e.arguments;return e.type==="ImportExpression"&&(t=[e.source],e.options&&t.push(e.options)),jn.set(e,t),t}function Wt(e,t){let{node:r}=e;if(r.type==="ChainExpression")return e.call(()=>Wt(e,t),"expression");r.type==="ImportExpression"?(e.call(n=>t(n,0),"source"),r.options&&e.call(n=>t(n,1),"options")):e.each(t,"arguments")}function Wn(e,t){let r=[];if(e.type==="ChainExpression"&&(e=e.expression,r.push("expression")),e.type==="ImportExpression"){if(t===0||t===(e.options?-2:-1))return[...r,"source"];if(e.options&&(t===1||t===-1))return[...r,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...r,"arguments",t]}function or(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function Lt(e){return(e==null?void 0:e.prettierIgnore)||T(e,h.PrettierIgnore)}var h={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},Tu=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(r,n,s)=>!(e&h.Leading&&!r.leading||e&h.Trailing&&!r.trailing||e&h.Dangling&&(r.leading||r.trailing)||e&h.Block&&!ee(r)||e&h.Line&&!At(r)||e&h.First&&n!==0||e&h.Last&&n!==s.length-1||e&h.PrettierIgnore&&!or(r)||t&&!t(r))};function T(e,t,r){if(!O(e==null?void 0:e.comments))return!1;let n=Tu(t,r);return n?e.comments.some(n):!0}function lt(e,t,r){if(!Array.isArray(e==null?void 0:e.comments))return[];let n=Tu(t,r);return n?e.comments.filter(n):e.comments}var ce=(e,{originalText:t})=>jt(t,k(e));function mt(e){return L(e)||e.type==="NewExpression"||e.type==="ImportExpression"}function Ce(e){return e&&(e.type==="ObjectProperty"||e.type==="Property"&&!kt(e))}var Ae=R(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),we=R(["TSUnionType","UnionTypeAnnotation"]),Nt=R(["TSIntersectionType","IntersectionTypeAnnotation"]),Je=R(["TSConditionalType","ConditionalTypeAnnotation"]);var _o=new Set(["range","raw","comments","leadingComments","trailingComments","innerComments","extra","start","end","loc","flags","errors","tokens"]),Gt=e=>{for(let t of e.quasis)delete t.value};function du(e,t,r){var s,u;if(e.type==="Program"&&delete t.sourceType,(e.type==="BigIntLiteral"||e.type==="BigIntLiteralTypeAnnotation")&&e.value&&(t.value=e.value.toLowerCase()),(e.type==="BigIntLiteral"||e.type==="Literal")&&e.bigint&&(t.bigint=e.bigint.toLowerCase()),e.type==="EmptyStatement"||e.type==="JSXText"||e.type==="JSXExpressionContainer"&&(e.expression.type==="Literal"||e.expression.type==="StringLiteral")&&e.expression.value===" ")return null;if((e.type==="Property"||e.type==="ObjectProperty"||e.type==="MethodDefinition"||e.type==="ClassProperty"||e.type==="ClassMethod"||e.type==="PropertyDefinition"||e.type==="TSDeclareMethod"||e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty"||e.type==="ImportAttribute")&&e.key&&!e.computed){let{key:i}=e;te(i)||Fe(i)?t.key=String(i.value):i.type==="Identifier"&&(t.key=i.name)}if(e.type==="JSXElement"&&e.openingElement.name.name==="style"&&e.openingElement.attributes.some(i=>i.type==="JSXAttribute"&&i.name.name==="jsx"))for(let{type:i,expression:a}of t.children)i==="JSXExpressionContainer"&&a.type==="TemplateLiteral"&&Gt(a);e.type==="JSXAttribute"&&e.name.name==="css"&&e.value.type==="JSXExpressionContainer"&&e.value.expression.type==="TemplateLiteral"&&Gt(t.value.expression),e.type==="JSXAttribute"&&((s=e.value)==null?void 0:s.type)==="Literal"&&/["']|"|'/u.test(e.value.value)&&(t.value.value=Y(!1,e.value.value,/["']|"|'/gu,'"'));let n=e.expression||e.callee;if(e.type==="Decorator"&&n.type==="CallExpression"&&n.callee.name==="Component"&&n.arguments.length===1){let i=e.expression.arguments[0].properties;for(let[a,o]of t.expression.arguments[0].properties.entries())switch(i[a].key.name){case"styles":U(o.value)&&Gt(o.value.elements[0]);break;case"template":o.value.type==="TemplateLiteral"&&Gt(o.value);break}}e.type==="TaggedTemplateExpression"&&(e.tag.type==="MemberExpression"||e.tag.type==="Identifier"&&(e.tag.name==="gql"||e.tag.name==="graphql"||e.tag.name==="css"||e.tag.name==="md"||e.tag.name==="markdown"||e.tag.name==="html")||e.tag.type==="CallExpression")&&Gt(t.quasi),e.type==="TemplateLiteral"&&((u=e.leadingComments)!=null&&u.some(a=>ee(a)&&["GraphQL","HTML"].some(o=>a.value===` ${o} `))||r.type==="CallExpression"&&r.callee.name==="graphql"||!e.leadingComments)&&Gt(t),e.type==="ChainExpression"&&e.expression.type==="TSNonNullExpression"&&(t.type="TSNonNullExpression",t.expression.type="ChainExpression"),e.type==="TSMappedType"&&(delete t.key,delete t.constraint),e.type==="TSEnumDeclaration"&&delete t.body}du.ignoredProperties=_o;var xu=du;var qe="string",he="array",st="cursor",Ve="indent",$e="align",Ke="trim",me="group",Oe="fill",Te="if-break",Qe="indent-if-break",ze="line-suffix",We="line-suffix-boundary",ie="line",ge="label",_e="break-parent",Mr=new Set([st,Ve,$e,Ke,me,Oe,Te,Qe,ze,We,ie,ge,_e]);function vo(e){if(typeof e=="string")return qe;if(Array.isArray(e))return he;if(!e)return;let{type:t}=e;if(Mr.has(t))return t}var Se=vo;var jo=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Mo(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', +Expected it to be 'string' or 'object'.`;if(Se(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=jo([...Mr].map(s=>`'${s}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${n}.`}var Nn=class extends Error{name="InvalidDocError";constructor(t){super(Mo(t)),this.doc=t}},dt=Nn;var hu={};function Ro(e,t,r,n){let s=[e];for(;s.length>0;){let u=s.pop();if(u===hu){r(s.pop());continue}r&&s.push(u,hu);let i=Se(u);if(!i)throw new dt(u);if((t==null?void 0:t(u))!==!1)switch(i){case he:case Oe:{let a=i===he?u:u.parts;for(let o=a.length,p=o-1;p>=0;--p)s.push(a[p]);break}case Te:s.push(u.flatContents,u.breakContents);break;case me:if(n&&u.expandedStates)for(let a=u.expandedStates.length,o=a-1;o>=0;--o)s.push(u.expandedStates[o]);else s.push(u.contents);break;case $e:case Ve:case Qe:case ge:case ze:s.push(u.contents);break;case qe:case st:case Ke:case We:case ie:case _e:break;default:throw new dt(u)}}}var pr=Ro;function yt(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=s(u);return r.set(u,i),i}function s(u){switch(Se(u)){case he:return t(u.map(n));case Oe:return t({...u,parts:u.parts.map(n)});case Te:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case me:{let{expandedStates:i,contents:a}=u;return i?(i=i.map(n),a=i[0]):a=n(a),t({...u,contents:a,expandedStates:i})}case $e:case Ve:case Qe:case ge:case ze:return t({...u,contents:n(u.contents)});case qe:case st:case Ke:case We:case ie:case _e:return t(u);default:throw new dt(u)}}}function Su(e,t,r){let n=r,s=!1;function u(i){if(s)return!1;let a=t(i);a!==void 0&&(s=!0,n=a)}return pr(e,u),n}function Jo(e){if(e.type===me&&e.break||e.type===ie&&e.hard||e.type===_e)return!0}function re(e){return Su(e,Jo,!1)}function gu(e){if(e.length>0){let t=M(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Bu(e){let t=new Set,r=[];function n(u){if(u.type===_e&&gu(r),u.type===me){if(r.push(u),t.has(u))return!1;t.add(u)}}function s(u){u.type===me&&r.pop().break&&gu(r)}pr(e,n,s,!0)}function qo(e){return e.type===ie&&!e.hard?e.soft?"":" ":e.type===Te?e.flatContents:e}function cr(e){return yt(e,qo)}function Wo(e){switch(Se(e)){case Oe:if(e.parts.every(t=>t===""))return"";break;case me:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===me&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case $e:case Ve:case Qe:case ze:if(!e.contents)return"";break;case Te:if(!e.flatContents&&!e.breakContents)return"";break;case he:{let t=[];for(let r of e){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof M(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...s)}return t.length===0?"":t.length===1?t[0]:t}case qe:case st:case Ke:case We:case ie:case ge:case _e:break;default:throw new dt(e)}return e}function Ut(e){return yt(e,t=>Wo(t))}function ve(e,t=Rr){return yt(e,r=>typeof r=="string"?b(t,r.split(` +`)):r)}function No(e){if(e.type===ie)return!0}function bu(e){return Su(e,No,!1)}function lr(e,t){return e.type===ge?{...e,contents:t(e.contents)}:t(e)}function Pu(e){let t=!0;return pr(e,r=>{switch(Se(r)){case qe:if(r==="")break;case Ke:case We:case ie:case _e:return t=!1,!1}}),t}var Gn=()=>{},Ze=Gn,Un=Gn,ku=Gn;function f(e){return Ze(e),{type:Ve,contents:e}}function Be(e,t){return Ze(t),{type:$e,contents:t,n:e}}function l(e,t={}){return Ze(e),Un(t.expandedStates,!0),{type:me,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Iu(e){return Be(Number.NEGATIVE_INFINITY,e)}function Jr(e){return Be(-1,e)}function et(e,t){return l(e[0],{...t,expandedStates:e})}function qr(e){return ku(e),{type:Oe,parts:e}}function B(e,t="",r={}){return Ze(e),t!==""&&Ze(t),{type:Te,breakContents:e,flatContents:t,groupId:r.groupId}}function xt(e,t){return Ze(e),{type:Qe,contents:e,groupId:t.groupId,negate:t.negate}}function Yn(e){return Ze(e),{type:ze,contents:e}}var je={type:We},Ee={type:_e};var Xn={type:ie,hard:!0},Go={type:ie,hard:!0,literal:!0},x={type:ie},E={type:ie,soft:!0},F=[Xn,Ee],Rr=[Go,Ee],mr={type:st};function b(e,t){Ze(e),Un(t);let r=[];for(let n=0;n0){for(let s=0;s1&&t.every(r=>r.trimStart()[0]==="*")}var wu=Uo;function Ou(e,t){let r=e.node;if(At(r))return t.originalText.slice(q(r),k(r)).trimEnd();if(ee(r))return wu(r)?Yo(r):["/*",ve(r.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(r))}function Yo(e){let t=e.value.split(` +`);return["/*",b(F,t.map((r,n)=>n===0?r.trimEnd():" "+(nzo,ownLine:()=>Qo,remaining:()=>Zo});function Xo(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Hn(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Xo(e)}function le(e,t){t.leading=!0,t.trailing=!1,Hn(e,t)}function Me(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Hn(e,t)}function V(e,t){t.leading=!1,t.trailing=!0,Hn(e,t)}function Ho(e,t){let r=null,n=t;for(;n!==r;)r=n,n=Xe(e,n),n=_t(e,n),n=vt(e,n),n=He(e,n);return n}var it=Ho;function Vo(e,t){let r=it(e,t);return r===!1?"":e.charAt(r)}var be=Vo;function $o(e,t,r){for(let n=t;nt(e))}function zo(e){return[ep,Ru,vu,qu,$n,Kn,_u,ju,Ju,lp,yp,zn,Cp,Qn,dp,xp,gp].some(t=>t(e))}function Zo(e){return[Wu,$n,Kn,np,pp,Mu,zn,op,ap,Tp,Qn,Ap].some(t=>t(e))}function wt(e,t){let r=(e.body||e.properties).find(({type:n})=>n!=="EmptyStatement");r?le(r,t):Me(e,t)}function Vn(e,t){e.type==="BlockStatement"?wt(e,t):le(e,t)}function ep({comment:e,followingNode:t}){return t&&Wr(e)?(le(t,e),!0):!1}function $n({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){if((r==null?void 0:r.type)!=="IfStatement"||!n)return!1;if(be(s,k(e))===")")return V(t,e),!0;if(t===r.consequent&&n===r.alternate){let i=it(s,k(r.consequent));if(q(e)"?(Me(t,e),!0):!1}function pp({comment:e,enclosingNode:t,text:r}){return be(r,k(e))!==")"?!1:t&&(Nu(t)&&z(t).length===0||mt(t)&&pe(t).length===0)?(Me(t,e),!0):((t==null?void 0:t.type)==="MethodDefinition"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&z(t.value).length===0?(Me(t.value,e),!0):!1}function cp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(t==null?void 0:t.type)==="ComponentTypeParameter"&&((r==null?void 0:r.type)==="DeclareComponent"||(r==null?void 0:r.type)==="ComponentTypeAnnotation")&&(n==null?void 0:n.type)!=="ComponentTypeParameter"?(V(t,e),!0):((t==null?void 0:t.type)==="ComponentParameter"||(t==null?void 0:t.type)==="RestElement")&&(r==null?void 0:r.type)==="ComponentDeclaration"&&be(s,k(e))===")"?(V(t,e),!0):!1}function Ru({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(t==null?void 0:t.type)==="FunctionTypeParam"&&(r==null?void 0:r.type)==="FunctionTypeAnnotation"&&(n==null?void 0:n.type)!=="FunctionTypeParam"?(V(t,e),!0):((t==null?void 0:t.type)==="Identifier"||(t==null?void 0:t.type)==="AssignmentPattern"||(t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern"||(t==null?void 0:t.type)==="RestElement"||(t==null?void 0:t.type)==="TSParameterProperty")&&Nu(r)&&be(s,k(e))===")"?(V(t,e),!0):!ee(e)&&((r==null?void 0:r.type)==="FunctionDeclaration"||(r==null?void 0:r.type)==="FunctionExpression"||(r==null?void 0:r.type)==="ObjectMethod")&&(n==null?void 0:n.type)==="BlockStatement"&&r.body===n&&it(s,k(e))===q(n)?(wt(n,e),!0):!1}function Ju({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="LabeledStatement"?(le(t,e),!0):!1}function Qn({comment:e,enclosingNode:t}){return((t==null?void 0:t.type)==="ContinueStatement"||(t==null?void 0:t.type)==="BreakStatement")&&!t.label?(V(t,e),!0):!1}function lp({comment:e,precedingNode:t,enclosingNode:r}){return L(r)&&t&&r.callee===t&&r.arguments.length>0?(le(r.arguments[0],e),!0):!1}function mp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return we(r)?(or(e)&&(n.prettierIgnore=!0,e.unignore=!0),t?(V(t,e),!0):!1):(we(n)&&or(e)&&(n.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function yp({comment:e,enclosingNode:t}){return Ce(t)?(le(t,e),!0):!1}function zn({comment:e,enclosingNode:t,ast:r,isLastComment:n}){var s;return((s=r==null?void 0:r.body)==null?void 0:s.length)===0?(n?Me(r,e):le(r,e),!0):(t==null?void 0:t.type)==="Program"&&t.body.length===0&&!O(t.directives)?(n?Me(t,e):le(t,e),!0):!1}function Dp({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="ForInStatement"||(t==null?void 0:t.type)==="ForOfStatement"?(le(t,e),!0):!1}function qu({comment:e,precedingNode:t,enclosingNode:r,text:n}){if((r==null?void 0:r.type)==="ImportSpecifier"||(r==null?void 0:r.type)==="ExportSpecifier")return le(r,e),!0;let s=(t==null?void 0:t.type)==="ImportSpecifier"&&(r==null?void 0:r.type)==="ImportDeclaration",u=(t==null?void 0:t.type)==="ExportSpecifier"&&(r==null?void 0:r.type)==="ExportNamedDeclaration";return(s||u)&&Z(n,k(e))?(V(t,e),!0):!1}function fp({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="AssignmentPattern"?(le(t,e),!0):!1}var Ep=new Set(["VariableDeclarator","AssignmentExpression","TypeAlias","TSTypeAliasDeclaration"]),Fp=new Set(["ObjectExpression","RecordExpression","ArrayExpression","TupleExpression","TemplateLiteral","TaggedTemplateExpression","ObjectTypeAnnotation","TSTypeLiteral"]);function Cp({comment:e,enclosingNode:t,followingNode:r}){return Ep.has(t==null?void 0:t.type)&&r&&(Fp.has(r.type)||ee(e))?(le(r,e),!0):!1}function Ap({comment:e,enclosingNode:t,followingNode:r,text:n}){return!r&&((t==null?void 0:t.type)==="TSMethodSignature"||(t==null?void 0:t.type)==="TSDeclareFunction"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&be(n,k(e))===";"?(V(t,e),!0):!1}function Wu({comment:e,enclosingNode:t,followingNode:r}){if(or(e)&&(t==null?void 0:t.type)==="TSMappedType"&&(r==null?void 0:r.type)==="TSTypeParameter"&&r.constraint)return t.prettierIgnore=!0,e.unignore=!0,!0}function Tp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return(r==null?void 0:r.type)!=="TSMappedType"?!1:(n==null?void 0:n.type)==="TSTypeParameter"&&n.name?(le(n.name,e),!0):(t==null?void 0:t.type)==="TSTypeParameter"&&t.constraint?(V(t.constraint,e),!0):!1}function dp({comment:e,enclosingNode:t,followingNode:r}){return!t||t.type!=="SwitchCase"||t.test||!r||r!==t.consequent[0]?!1:(r.type==="BlockStatement"&&At(e)?wt(r,e):Me(t,e),!0)}function xp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return we(t)&&((r.type==="TSArrayType"||r.type==="ArrayTypeAnnotation")&&!n||Nt(r))?(V(M(!1,t.types,-1),e),!0):!1}function hp({comment:e,enclosingNode:t,precedingNode:r,followingNode:n}){if(((t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern")&&(n==null?void 0:n.type)==="TSTypeAnnotation")return r?V(r,e):Me(t,e),!0}function gp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){var s;if(!n&&(r==null?void 0:r.type)==="UnaryExpression"&&((t==null?void 0:t.type)==="LogicalExpression"||(t==null?void 0:t.type)==="BinaryExpression")){let u=((s=r.argument.loc)==null?void 0:s.start.line)!==t.right.loc.start.line,i=At(e)||e.loc.start.line===e.loc.end.line,a=e.loc.start.line===t.right.loc.start.line;if(u&&i&&a)return V(t.right,e),!0}return!1}var Nu=R(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration","ObjectMethod","ClassMethod","TSDeclareFunction","TSCallSignatureDeclaration","TSConstructSignatureDeclaration","TSMethodSignature","TSConstructorType","TSFunctionType","TSDeclareMethod"]);var Sp=new Set(["EmptyStatement","TemplateElement","TSEmptyBodyFunctionExpression","ChainExpression"]);function Bp(e){return!Sp.has(e.type)}function bp(e,t){var r;if((t.parser==="typescript"||t.parser==="flow"||t.parser==="acorn"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree")&&e.type==="MethodDefinition"&&((r=e.value)==null?void 0:r.type)==="FunctionExpression"&&z(e.value).length===0&&!e.value.returnType&&!O(e.value.typeParameters)&&e.value.body)return[...e.decorators||[],e.key,e.value.body]}function es(e){let{node:t,parent:r}=e;return(X(t)||r&&(r.type==="JSXSpreadAttribute"||r.type==="JSXSpreadChild"||we(r)||(r.type==="ClassDeclaration"||r.type==="ClassExpression")&&r.superClass===t))&&(!Lt(t)||we(r))}function Pp(e,{parser:t}){if(t==="flow"||t==="babel-flow")return e=Y(!1,e,/[\s(]/gu,""),e===""||e==="/*"||e==="/*::"}function Gu(e){switch(e){case"cr":return"\r";case"crlf":return`\r +`;default:return` +`}}var Pe=Symbol("MODE_BREAK"),at=Symbol("MODE_FLAT"),Yt=Symbol("cursor"),ts=Symbol("DOC_FILL_PRINTED_LENGTH");function Uu(){return{value:"",length:0,queue:[]}}function kp(e,t){return rs(e,{type:"indent"},t)}function Ip(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Uu():t<0?rs(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:rs(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function rs(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],s="",u=0,i=0,a=0;for(let c of n)switch(c.type){case"indent":y(),r.useTabs?o(1):p(r.tabWidth);break;case"stringAlign":y(),s+=c.n,u+=c.n.length;break;case"numberAlign":i+=1,a+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return m(),{...e,value:s,length:u,queue:n};function o(c){s+=" ".repeat(c),u+=r.tabWidth*c}function p(c){s+=" ".repeat(c),u+=c}function y(){r.useTabs?D():m()}function D(){i>0&&o(i),C()}function m(){a>0&&p(a),C()}function C(){i=0,a=0}}function ns(e){let t=0,r=0,n=e.length;e:for(;n--;){let s=e[n];if(s===Yt){r++;continue}for(let u=s.length-1;u>=0;u--){let i=s[u];if(i===" "||i===" ")t++;else{e[n]=s.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Yt);return t}function Nr(e,t,r,n,s,u){if(r===Number.POSITIVE_INFINITY)return!0;let i=t.length,a=[e],o=[];for(;r>=0;){if(a.length===0){if(i===0)return!0;a.push(t[--i]);continue}let{mode:p,doc:y}=a.pop(),D=Se(y);switch(D){case qe:o.push(y),r-=rt(y);break;case he:case Oe:{let m=D===he?y:y.parts,C=y[ts]??0;for(let c=m.length-1;c>=C;c--)a.push({mode:p,doc:m[c]});break}case Ve:case $e:case Qe:case ge:a.push({mode:p,doc:y.contents});break;case Ke:r+=ns(o);break;case me:{if(u&&y.break)return!1;let m=y.break?Pe:p,C=y.expandedStates&&m===Pe?M(!1,y.expandedStates,-1):y.contents;a.push({mode:m,doc:C});break}case Te:{let C=(y.groupId?s[y.groupId]||at:p)===Pe?y.breakContents:y.flatContents;C&&a.push({mode:p,doc:C});break}case ie:if(p===Pe||y.hard)return!0;y.soft||(o.push(" "),r--);break;case ze:n=!0;break;case We:if(n)return!1;break}}return!1}function ss(e,t){let r={},n=t.printWidth,s=Gu(t.endOfLine),u=0,i=[{ind:Uu(),mode:Pe,doc:e}],a=[],o=!1,p=[],y=0;for(Bu(e);i.length>0;){let{ind:m,mode:C,doc:c}=i.pop();switch(Se(c)){case qe:{let A=s!==` +`?Y(!1,c,` +`,s):c;a.push(A),i.length>0&&(u+=rt(A));break}case he:for(let A=c.length-1;A>=0;A--)i.push({ind:m,mode:C,doc:c[A]});break;case st:if(y>=2)throw new Error("There are too many 'cursor' in doc.");a.push(Yt),y++;break;case Ve:i.push({ind:kp(m,t),mode:C,doc:c.contents});break;case $e:i.push({ind:Ip(m,c.n,t),mode:C,doc:c.contents});break;case Ke:u-=ns(a);break;case me:switch(C){case at:if(!o){i.push({ind:m,mode:c.break?Pe:at,doc:c.contents});break}case Pe:{o=!1;let A={ind:m,mode:at,doc:c.contents},d=n-u,S=p.length>0;if(!c.break&&Nr(A,i,d,S,r))i.push(A);else if(c.expandedStates){let g=M(!1,c.expandedStates,-1);if(c.break){i.push({ind:m,mode:Pe,doc:g});break}else for(let _=1;_=c.expandedStates.length){i.push({ind:m,mode:Pe,doc:g});break}else{let v=c.expandedStates[_],j={ind:m,mode:at,doc:v};if(Nr(j,i,d,S,r)){i.push(j);break}}}else i.push({ind:m,mode:Pe,doc:c.contents});break}}c.id&&(r[c.id]=M(!1,i,-1).mode);break;case Oe:{let A=n-u,d=c[ts]??0,{parts:S}=c,g=S.length-d;if(g===0)break;let _=S[d+0],v=S[d+1],j={ind:m,mode:at,doc:_},I={ind:m,mode:Pe,doc:_},G=Nr(j,[],A,p.length>0,r,!0);if(g===1){G?i.push(j):i.push(I);break}let P={ind:m,mode:at,doc:v},N={ind:m,mode:Pe,doc:v};if(g===2){G?i.push(P,j):i.push(N,I);break}let ue=S[d+2],Q={ind:m,mode:C,doc:{...c,[ts]:d+2}};Nr({ind:m,mode:at,doc:[_,v,ue]},[],A,p.length>0,r,!0)?i.push(Q,P,j):G?i.push(Q,N,j):i.push(Q,N,I);break}case Te:case Qe:{let A=c.groupId?r[c.groupId]:C;if(A===Pe){let d=c.type===Te?c.breakContents:c.negate?c.contents:f(c.contents);d&&i.push({ind:m,mode:C,doc:d})}if(A===at){let d=c.type===Te?c.flatContents:c.negate?f(c.contents):c.contents;d&&i.push({ind:m,mode:C,doc:d})}break}case ze:p.push({ind:m,mode:C,doc:c.contents});break;case We:p.length>0&&i.push({ind:m,mode:C,doc:Xn});break;case ie:switch(C){case at:if(c.hard)o=!0;else{c.soft||(a.push(" "),u+=1);break}case Pe:if(p.length>0){i.push({ind:m,mode:C,doc:c},...p.reverse()),p.length=0;break}c.literal?m.root?(a.push(s,m.root.value),u=m.root.length):(a.push(s),u=0):(u-=ns(a),a.push(s+m.value),u=m.length);break}break;case ge:i.push({ind:m,mode:C,doc:c.contents});break;case _e:break;default:throw new dt(c)}i.length===0&&p.length>0&&(i.push(...p.reverse()),p.length=0)}let D=a.indexOf(Yt);if(D!==-1){let m=a.indexOf(Yt,D+1);if(m===-1)return{formatted:a.filter(d=>d!==Yt).join("")};let C=a.slice(0,D).join(""),c=a.slice(D+1,m).join(""),A=a.slice(m+1).join("");return{formatted:C+c+A,cursorNodeStart:C.length,cursorNodeText:c}}return{formatted:a.join("")}}function Lp(e,t,r=0){let n=0;for(let s=r;s{if(i.push(t()),y.tail)return;let{tabWidth:D}=r,m=y.value.raw,C=m.includes(` +`)?Xu(m,D):o;o=C;let c=a[p],A=n[u][p],d=de(r.originalText,k(y),q(n.quasis[p+1]));if(!d){let g=ss(c,{...r,printWidth:Number.POSITIVE_INFINITY}).formatted;g.includes(` +`)?d=!0:c=g}d&&(T(A)||A.type==="Identifier"||W(A)||A.type==="ConditionalExpression"||A.type==="SequenceExpression"||Ae(A)||De(A))&&(c=[f([E,c]),E]);let S=C===0&&m.endsWith(` +`)?Be(Number.NEGATIVE_INFINITY,c):Lu(c,C,D);i.push(l(["${",S,je,"}"]))},"quasis"),i.push("`"),i}function Hu(e,t){let r=t("quasi");return ut(r.label&&{tagged:!0,...r.label},[t("tag"),t(e.node.typeArguments?"typeArguments":"typeParameters"),je,r])}function Op(e,t,r){let{node:n}=e,s=n.quasis[0].value.raw.trim().split(/\s*\|\s*/u);if(s.length>1||s.some(u=>u.length>0)){t.__inJestEach=!0;let u=e.map(r,"expressions");t.__inJestEach=!1;let i=[],a=u.map(m=>"${"+ss(m,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),o=[{hasLineBreak:!1,cells:[]}];for(let m=1;mm.cells.length)),y=Array.from({length:p}).fill(0),D=[{cells:s},...o.filter(m=>m.cells.length>0)];for(let{cells:m}of D.filter(C=>!C.hasLineBreak))for(let[C,c]of m.entries())y[C]=Math.max(y[C],rt(c));return i.push(je,"`",f([F,b(F,D.map(m=>b(" | ",m.cells.map((C,c)=>m.hasLineBreak?C:C+" ".repeat(y[c]-rt(C))))))]),F,"`"),i}}function _p(e,t){let{node:r}=e,n=t();return T(r)&&(n=l([f([E,n]),E])),["${",n,je,"}"]}function Xt(e,t){return e.map(r=>_p(r,t),"expressions")}function Ur(e,t){return yt(e,r=>typeof r=="string"?t?Y(!1,r,/(\\*)`/gu,"$1$1\\`"):us(r):r)}function us(e){return Y(!1,e,/([\\`]|\$\{)/gu,String.raw`\$1`)}function vp({node:e,parent:t}){let r=/^[fx]?(?:describe|it|test)$/u;return t.type==="TaggedTemplateExpression"&&t.quasi===e&&t.tag.type==="MemberExpression"&&t.tag.property.type==="Identifier"&&t.tag.property.name==="each"&&(t.tag.object.type==="Identifier"&&r.test(t.tag.object.name)||t.tag.object.type==="MemberExpression"&&t.tag.object.property.type==="Identifier"&&(t.tag.object.property.name==="only"||t.tag.object.property.name==="skip")&&t.tag.object.object.type==="Identifier"&&r.test(t.tag.object.object.name))}var as=[(e,t)=>e.type==="ObjectExpression"&&t==="properties",(e,t)=>e.type==="CallExpression"&&e.callee.type==="Identifier"&&e.callee.name==="Component"&&t==="arguments",(e,t)=>e.type==="Decorator"&&t==="expression"];function Vu(e){let t=n=>n.type==="TemplateLiteral",r=(n,s)=>Ce(n)&&!n.computed&&n.key.type==="Identifier"&&n.key.name==="styles"&&s==="value";return e.match(t,(n,s)=>U(n)&&s==="elements",r,...as)||e.match(t,r,...as)}function $u(e){return e.match(t=>t.type==="TemplateLiteral",(t,r)=>Ce(t)&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="template"&&r==="value",...as)}function is(e,t){return T(e,h.Block|h.Leading,({value:r})=>r===` ${t} `)}function Yr({node:e,parent:t},r){return is(e,r)||jp(t)&&is(t,r)||t.type==="ExpressionStatement"&&is(t,r)}function jp(e){return e.type==="AsConstExpression"||e.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const"}async function Mp(e,t,r){let{node:n}=r,s=n.quasis.map(y=>y.value.raw),u=0,i=s.reduce((y,D,m)=>m===0?D:y+"@prettier-placeholder-"+u+++"-id"+D,""),a=await e(i,{parser:"scss"}),o=Xt(r,t),p=Rp(a,o);if(!p)throw new Error("Couldn't insert all the expressions");return["`",f([F,p]),E,"`"]}function Rp(e,t){if(!O(t))return e;let r=0,n=yt(Ut(e),s=>typeof s!="string"||!s.includes("@prettier-placeholder")?s:s.split(/@prettier-placeholder-(\d+)-id/u).map((u,i)=>i%2===0?ve(u):(r++,t[u])));return t.length===r?n:null}function Jp({node:e,parent:t,grandparent:r}){return r&&e.quasis&&t.type==="JSXExpressionContainer"&&r.type==="JSXElement"&&r.openingElement.name.name==="style"&&r.openingElement.attributes.some(n=>n.type==="JSXAttribute"&&n.name.name==="jsx")||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="css"||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="MemberExpression"&&t.tag.object.name==="css"&&(t.tag.property.name==="global"||t.tag.property.name==="resolve")}function Xr(e){return e.type==="Identifier"&&e.name==="styled"}function Ku(e){return/^[A-Z]/u.test(e.object.name)&&e.property.name==="extend"}function qp({parent:e}){if(!e||e.type!=="TaggedTemplateExpression")return!1;let t=e.tag.type==="ParenthesizedExpression"?e.tag.expression:e.tag;switch(t.type){case"MemberExpression":return Xr(t.object)||Ku(t);case"CallExpression":return Xr(t.callee)||t.callee.type==="MemberExpression"&&(t.callee.object.type==="MemberExpression"&&(Xr(t.callee.object.object)||Ku(t.callee.object))||t.callee.object.type==="CallExpression"&&Xr(t.callee.object.callee));case"Identifier":return t.name==="css";default:return!1}}function Wp({parent:e,grandparent:t}){return(t==null?void 0:t.type)==="JSXAttribute"&&e.type==="JSXExpressionContainer"&&t.name.type==="JSXIdentifier"&&t.name.name==="css"}function Np(e){if(Jp(e)||qp(e)||Wp(e)||Vu(e))return Mp}var Qu=Np;async function Gp(e,t,r){let{node:n}=r,s=n.quasis.length,u=Xt(r,t),i=[];for(let a=0;a2&&m[0].trim()===""&&m[1].trim()==="",d=C>2&&m[C-1].trim()===""&&m[C-2].trim()==="",S=m.every(_=>/^\s*(?:#[^\n\r]*)?$/u.test(_));if(!y&&/#[^\n\r]*$/u.test(m[C-1]))return null;let g=null;S?g=Up(m):g=await e(D,{parser:"graphql"}),g?(g=Ur(g,!1),!p&&A&&i.push(""),i.push(g),!y&&d&&i.push("")):!p&&!y&&A&&i.push(""),c&&i.push(c)}return["`",f([F,b(F,i)]),F,"`"]}function Up(e){let t=[],r=!1,n=e.map(s=>s.trim());for(let[s,u]of n.entries())u!==""&&(n[s-1]===""&&r?t.push([F,u]):t.push(u),r=!0);return t.length===0?null:b(F,t)}function Yp({node:e,parent:t}){return Yr({node:e,parent:t},"GraphQL")||t&&(t.type==="TaggedTemplateExpression"&&(t.tag.type==="MemberExpression"&&t.tag.object.name==="graphql"&&t.tag.property.name==="experimental"||t.tag.type==="Identifier"&&(t.tag.name==="gql"||t.tag.name==="graphql"))||t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="graphql")}function Xp(e){if(Yp(e))return Gp}var zu=Xp;var os=0;async function Zu(e,t,r,n,s){let{node:u}=n,i=os;os=os+1>>>0;let a=S=>`PRETTIER_HTML_PLACEHOLDER_${S}_${i}_IN_JS`,o=u.quasis.map((S,g,_)=>g===_.length-1?S.value.cooked:S.value.cooked+a(g)).join(""),p=Xt(n,r),y=new RegExp(a(String.raw`(\d+)`),"gu"),D=0,m=await t(o,{parser:e,__onHtmlRoot(S){D=S.children.length}}),C=yt(m,S=>{if(typeof S!="string")return S;let g=[],_=S.split(y);for(let v=0;v<_.length;v++){let j=_[v];if(v%2===0){j&&(j=us(j),s.__embeddedInHtml&&(j=Y(!1,j,/<\/(?=script\b)/giu,String.raw`<\/`)),g.push(j));continue}let I=Number(j);g.push(p[I])}return g}),c=/^\s/u.test(o)?" ":"",A=/\s$/u.test(o)?" ":"",d=s.htmlWhitespaceSensitivity==="ignore"?F:c&&A?x:null;return d?l(["`",f([d,l(C)]),d,"`"]):ut({hug:!1},l(["`",c,D>1?f(l(C)):l(C),A,"`"]))}function Hp(e){return Yr(e,"HTML")||e.match(t=>t.type==="TemplateLiteral",(t,r)=>t.type==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="html"&&r==="quasi")}var Vp=Zu.bind(void 0,"html"),$p=Zu.bind(void 0,"angular");function Kp(e){if(Hp(e))return Vp;if($u(e))return $p}var ei=Kp;async function Qp(e,t,r){let{node:n}=r,s=Y(!1,n.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(o,p)=>"\\".repeat(p.length/2)+"`"),u=zp(s),i=u!=="";i&&(s=Y(!1,s,new RegExp(`^${u}`,"gmu"),""));let a=Ur(await e(s,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",i?f([E,a]):[Rr,Iu(a)],E,"`"]}function zp(e){let t=e.match(/^([^\S\n]*)\S/mu);return t===null?"":t[1]}function Zp(e){if(ec(e))return Qp}function ec({node:e,parent:t}){return(t==null?void 0:t.type)==="TaggedTemplateExpression"&&e.quasis.length===1&&t.tag.type==="Identifier"&&(t.tag.name==="md"||t.tag.name==="markdown")}var ti=Zp;function tc(e){let{node:t}=e;if(t.type!=="TemplateLiteral"||rc(t))return;let r;for(let n of[Qu,zu,ei,ti])if(r=n(e),!!r)return t.quasis.length===1&&t.quasis[0].value.raw.trim()===""?"``":async(...s)=>{let u=await r(...s);return u&&ut({embed:!0,...u.label},u)}}function rc({quasis:e}){return e.some(({value:{cooked:t}})=>t===null)}var ri=tc;var nc=/\*\/$/,sc=/^\/\*\*?/,ii=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,uc=/(^|\s+)\/\/([^\n\r]*)/g,ni=/^(\r?\n)+/,ic=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,si=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,ac=/(\r?\n|^) *\* ?/g,ai=[];function oi(e){let t=e.match(ii);return t?t[0].trimStart():""}function pi(e){let t=e.match(ii),r=t==null?void 0:t[0];return r==null?e:e.slice(r.length)}function ci(e){let t=` +`;e=Y(!1,e.replace(sc,"").replace(nc,""),ac,"$1");let r="";for(;r!==e;)r=e,e=Y(!1,e,ic,`${t}$1 $2${t}`);e=e.replace(ni,"").trimEnd();let n=Object.create(null),s=Y(!1,e,si,"").replace(ni,"").trimEnd(),u;for(;u=si.exec(e);){let i=Y(!1,u[2],uc,"");if(typeof n[u[1]]=="string"||Array.isArray(n[u[1]])){let a=n[u[1]];n[u[1]]=[...ai,...Array.isArray(a)?a:[a],i]}else n[u[1]]=i}return{comments:s,pragmas:n}}function li({comments:e="",pragmas:t={}}){let r=` +`,n="/**",s=" *",u=" */",i=Object.keys(t),a=i.flatMap(p=>ui(p,t[p])).map(p=>`${s} ${p}${r}`).join("");if(!e){if(i.length===0)return"";if(i.length===1&&!Array.isArray(t[i[0]])){let p=t[i[0]];return`${n} ${ui(i[0],p)[0]}${u}`}}let o=e.split(r).map(p=>`${s} ${p}`).join(r)+r;return n+r+(e?o:"")+(e&&i.length>0?s+r:"")+a+u}function ui(e,t){return[...ai,...Array.isArray(t)?t:[t]].map(r=>`@${e} ${r}`.trim())}function oc(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` +`);return t===-1?e:e.slice(0,t)}var mi=oc;function pc(e){let t=mi(e);t&&(e=e.slice(t.length+1));let r=oi(e),{pragmas:n,comments:s}=ci(r);return{shebang:t,text:e,pragmas:n,comments:s}}function yi(e){let{shebang:t,text:r,pragmas:n,comments:s}=pc(e),u=pi(r),i=li({pragmas:{format:"",...n},comments:s.trimStart()});return(t?`${t} +`:"")+i+(u.startsWith(` +`)?` +`:` + +`)+u}function cc(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:s,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:a}=e,o=s(a),p=u(a);for(let y of n)s(y)>=o&&u(y)<=p&&i.add(y);return r.slice(o,p)}var Di=cc;function ps(e,t){var u,i,a,o,p,y,D,m,C;if(e.isRoot)return!1;let{node:r,key:n,parent:s}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&Dc(r)&&yr(e))return!0;if(lc(r))return!1;if(r.type==="Identifier"){if((u=r.extra)!=null&&u.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(r.name)||n==="left"&&(r.name==="async"&&!s.await||r.name==="let")&&s.type==="ForOfStatement")return!0;if(r.name==="let"){let c=(i=e.findAncestor(A=>A.type==="ForOfStatement"))==null?void 0:i.left;if(c&&ae(c,A=>A===r))return!0}if(n==="object"&&r.name==="let"&&s.type==="MemberExpression"&&s.computed&&!s.optional){let c=e.findAncestor(d=>d.type==="ExpressionStatement"||d.type==="ForStatement"||d.type==="ForInStatement"),A=c?c.type==="ExpressionStatement"?c.expression:c.type==="ForStatement"?c.init:c.left:void 0;if(A&&ae(A,d=>d===r))return!0}if(n==="expression")switch(r.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let c=e.findAncestor(A=>!Ae(A));if(c!==s&&c.type==="ExpressionStatement")return!0}}return!1}if(r.type==="ObjectExpression"||r.type==="FunctionExpression"||r.type==="ClassExpression"||r.type==="DoExpression"){let c=(a=e.findAncestor(A=>A.type==="ExpressionStatement"))==null?void 0:a.expression;if(c&&ae(c,A=>A===r))return!0}if(r.type==="ObjectExpression"){let c=(o=e.findAncestor(A=>A.type==="ArrowFunctionExpression"))==null?void 0:o.body;if(c&&c.type!=="SequenceExpression"&&c.type!=="AssignmentExpression"&&ae(c,A=>A===r))return!0}switch(s.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(n==="superClass"&&(r.type==="ArrowFunctionExpression"||r.type==="AssignmentExpression"||r.type==="AwaitExpression"||r.type==="BinaryExpression"||r.type==="ConditionalExpression"||r.type==="LogicalExpression"||r.type==="NewExpression"||r.type==="ObjectExpression"||r.type==="SequenceExpression"||r.type==="TaggedTemplateExpression"||r.type==="UnaryExpression"||r.type==="UpdateExpression"||r.type==="YieldExpression"||r.type==="TSNonNullExpression"||r.type==="ClassExpression"&&O(r.decorators)))return!0;break;case"ExportDefaultDeclaration":return fi(e,t)||r.type==="SequenceExpression";case"Decorator":if(n==="expression"&&!Ec(r))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression")&&yc(r))return!0;break;case"BinaryExpression":if(n==="left"&&(s.operator==="in"||s.operator==="instanceof")&&r.type==="UnaryExpression")return!0;break;case"VariableDeclarator":if(n==="init"&&e.match(void 0,void 0,(c,A)=>A==="declarations"&&c.type==="VariableDeclaration",(c,A)=>A==="left"&&c.type==="ForInStatement"))return!0;break}switch(r.type){case"UpdateExpression":if(s.type==="UnaryExpression")return r.prefix&&(r.operator==="++"&&s.operator==="+"||r.operator==="--"&&s.operator==="-");case"UnaryExpression":switch(s.type){case"UnaryExpression":return r.operator===s.operator&&(r.operator==="+"||r.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"BinaryExpression":return n==="left"&&s.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(s.type==="UpdateExpression"||r.operator==="in"&&mc(e))return!0;if(r.operator==="|>"&&((p=r.extra)!=null&&p.parenthesized)){let c=e.grandparent;if(c.type==="BinaryExpression"&&c.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(s.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!Ae(r);case"ConditionalExpression":return Ae(r)||lu(r);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return n==="callee";case"ClassExpression":case"ClassDeclaration":return n==="superClass";case"TSTypeAssertion":case"TaggedTemplateExpression":case"UnaryExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"AssignmentExpression":case"AssignmentPattern":return n==="left"&&(r.type==="TSTypeAssertion"||Ae(r));case"LogicalExpression":if(r.type==="LogicalExpression")return s.operator!==r.operator;case"BinaryExpression":{let{operator:c,type:A}=r;if(!c&&A!=="TSTypeAssertion")return!0;let d=sr(c),S=s.operator,g=sr(S);return g>d||n==="right"&&g===d||g===d&&!ar(S,c)?!0:g");default:return!1}case"TSFunctionType":if(e.match(c=>c.type==="TSFunctionType",(c,A)=>A==="typeAnnotation"&&c.type==="TSTypeAnnotation",(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression"))return!0;case"TSConditionalType":case"TSConstructorType":case"ConditionalTypeAnnotation":if(n==="extendsType"&&Je(r)&&s.type===r.type||n==="checkType"&&Je(s))return!0;if(n==="extendsType"&&s.type==="TSConditionalType"){let{typeAnnotation:c}=r.returnType||r.typeAnnotation;if(c.type==="TSTypePredicate"&&c.typeAnnotation&&(c=c.typeAnnotation.typeAnnotation),c.type==="TSInferType"&&c.typeParameter.constraint)return!0}case"TSUnionType":case"TSIntersectionType":if((we(s)||Nt(s))&&s.types.length>1&&(!r.types||r.types.length>1))return!0;case"TSInferType":if(r.type==="TSInferType"){if(s.type==="TSRestType")return!1;if(n==="types"&&(s.type==="TSUnionType"||s.type==="TSIntersectionType")&&r.typeParameter.type==="TSTypeParameter"&&r.typeParameter.constraint)return!0}case"TSTypeOperator":return s.type==="TSArrayType"||s.type==="TSOptionalType"||s.type==="TSRestType"||n==="objectType"&&s.type==="TSIndexedAccessType"||s.type==="TSTypeOperator"||s.type==="TSTypeAnnotation"&&e.grandparent.type.startsWith("TSJSDoc");case"TSTypeQuery":return n==="objectType"&&s.type==="TSIndexedAccessType"||n==="elementType"&&s.type==="TSArrayType";case"TypeOperator":return s.type==="ArrayTypeAnnotation"||s.type==="NullableTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||s.type==="TypeOperator";case"TypeofTypeAnnotation":return n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||n==="elementType"&&s.type==="ArrayTypeAnnotation";case"ArrayTypeAnnotation":return s.type==="NullableTypeAnnotation";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return s.type==="TypeOperator"||s.type==="ArrayTypeAnnotation"||s.type==="NullableTypeAnnotation"||s.type==="IntersectionTypeAnnotation"||s.type==="UnionTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType");case"InferTypeAnnotation":case"NullableTypeAnnotation":return s.type==="ArrayTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType");case"ComponentTypeAnnotation":case"FunctionTypeAnnotation":{if(r.type==="ComponentTypeAnnotation"&&(r.rendersType===null||r.rendersType===void 0))return!1;if(e.match(void 0,(A,d)=>d==="typeAnnotation"&&A.type==="TypeAnnotation",(A,d)=>d==="returnType"&&A.type==="ArrowFunctionExpression")||e.match(void 0,(A,d)=>d==="typeAnnotation"&&A.type==="TypePredicate",(A,d)=>d==="typeAnnotation"&&A.type==="TypeAnnotation",(A,d)=>d==="returnType"&&A.type==="ArrowFunctionExpression"))return!0;let c=s.type==="NullableTypeAnnotation"?e.grandparent:s;return c.type==="UnionTypeAnnotation"||c.type==="IntersectionTypeAnnotation"||c.type==="ArrayTypeAnnotation"||n==="objectType"&&(c.type==="IndexedAccessType"||c.type==="OptionalIndexedAccessType")||n==="checkType"&&s.type==="ConditionalTypeAnnotation"||n==="extendsType"&&s.type==="ConditionalTypeAnnotation"&&((y=r.returnType)==null?void 0:y.type)==="InferTypeAnnotation"&&((D=r.returnType)==null?void 0:D.typeParameter.bound)||c.type==="NullableTypeAnnotation"||s.type==="FunctionTypeParam"&&s.name===null&&z(r).some(A=>{var d;return((d=A.typeAnnotation)==null?void 0:d.type)==="NullableTypeAnnotation"})}case"OptionalIndexedAccessType":return n==="objectType"&&s.type==="IndexedAccessType";case"StringLiteral":case"NumericLiteral":case"Literal":if(typeof r.value=="string"&&s.type==="ExpressionStatement"&&!s.directive){let c=e.grandparent;return c.type==="Program"||c.type==="BlockStatement"}return n==="object"&&s.type==="MemberExpression"&&typeof r.value=="number";case"AssignmentExpression":{let c=e.grandparent;return n==="body"&&s.type==="ArrowFunctionExpression"?!0:n==="key"&&(s.type==="ClassProperty"||s.type==="PropertyDefinition")&&s.computed||(n==="init"||n==="update")&&s.type==="ForStatement"?!1:s.type==="ExpressionStatement"?r.left.type==="ObjectPattern":!(n==="key"&&s.type==="TSPropertySignature"||s.type==="AssignmentExpression"||s.type==="SequenceExpression"&&c.type==="ForStatement"&&(c.init===s||c.update===s)||n==="value"&&s.type==="Property"&&c.type==="ObjectPattern"&&c.properties.includes(s)||s.type==="NGChainedExpression"||n==="node"&&s.type==="JsExpressionRoot")}case"ConditionalExpression":switch(s.type){case"TaggedTemplateExpression":case"UnaryExpression":case"SpreadElement":case"BinaryExpression":case"LogicalExpression":case"NGPipeExpression":case"ExportDefaultDeclaration":case"AwaitExpression":case"JSXSpreadAttribute":case"TSTypeAssertion":case"TypeCastExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"ConditionalExpression":return t.experimentalTernaries?!1:n==="test";case"MemberExpression":case"OptionalMemberExpression":return n==="object";default:return!1}case"FunctionExpression":switch(s.type){case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"TaggedTemplateExpression":return!0;default:return!1}case"ArrowFunctionExpression":switch(s.type){case"BinaryExpression":return s.operator!=="|>"||((m=r.extra)==null?void 0:m.parenthesized);case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":case"BindExpression":case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"AwaitExpression":case"TSTypeAssertion":return!0;case"ConditionalExpression":return n==="test";default:return!1}case"ClassExpression":switch(s.type){case"NewExpression":return n==="callee";default:return!1}case"OptionalMemberExpression":case"OptionalCallExpression":case"CallExpression":case"MemberExpression":if(fc(e))return!0;case"TaggedTemplateExpression":case"TSNonNullExpression":if(n==="callee"&&(s.type==="BindExpression"||s.type==="NewExpression")){let c=r;for(;c;)switch(c.type){case"CallExpression":case"OptionalCallExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":case"BindExpression":c=c.object;break;case"TaggedTemplateExpression":c=c.tag;break;case"TSNonNullExpression":c=c.expression;break;default:return!1}}return!1;case"BindExpression":return n==="callee"&&(s.type==="BindExpression"||s.type==="NewExpression")||n==="object"&&W(s);case"NGPipeExpression":return!(s.type==="NGRoot"||s.type==="NGMicrosyntaxExpression"||s.type==="ObjectProperty"&&!((C=r.extra)!=null&&C.parenthesized)||U(s)||n==="arguments"&&L(s)||n==="right"&&s.type==="NGPipeExpression"||n==="property"&&s.type==="MemberExpression"||s.type==="AssignmentExpression");case"JSXFragment":case"JSXElement":return n==="callee"||n==="left"&&s.type==="BinaryExpression"&&s.operator==="<"||!U(s)&&s.type!=="ArrowFunctionExpression"&&s.type!=="AssignmentExpression"&&s.type!=="AssignmentPattern"&&s.type!=="BinaryExpression"&&s.type!=="NewExpression"&&s.type!=="ConditionalExpression"&&s.type!=="ExpressionStatement"&&s.type!=="JsExpressionRoot"&&s.type!=="JSXAttribute"&&s.type!=="JSXElement"&&s.type!=="JSXExpressionContainer"&&s.type!=="JSXFragment"&&s.type!=="LogicalExpression"&&!L(s)&&!Ce(s)&&s.type!=="ReturnStatement"&&s.type!=="ThrowStatement"&&s.type!=="TypeCastExpression"&&s.type!=="VariableDeclarator"&&s.type!=="YieldExpression";case"TSInstantiationExpression":return n==="object"&&W(s)}return!1}var lc=R(["BlockStatement","BreakStatement","ComponentDeclaration","ClassBody","ClassDeclaration","ClassMethod","ClassProperty","PropertyDefinition","ClassPrivateProperty","ContinueStatement","DebuggerStatement","DeclareComponent","DeclareClass","DeclareExportAllDeclaration","DeclareExportDeclaration","DeclareFunction","DeclareHook","DeclareInterface","DeclareModule","DeclareModuleExports","DeclareNamespace","DeclareVariable","DeclareEnum","DoWhileStatement","EnumDeclaration","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExpressionStatement","ForInStatement","ForOfStatement","ForStatement","FunctionDeclaration","HookDeclaration","IfStatement","ImportDeclaration","InterfaceDeclaration","LabeledStatement","MethodDefinition","ReturnStatement","SwitchStatement","ThrowStatement","TryStatement","TSDeclareFunction","TSEnumDeclaration","TSImportEqualsDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSNamespaceExportDeclaration","TypeAlias","VariableDeclaration","WhileStatement","WithStatement"]);function mc(e){let t=0,{node:r}=e;for(;r;){let n=e.getParentNode(t++);if((n==null?void 0:n.type)==="ForStatement"&&n.init===r)return!0;r=n}return!1}function yc(e){return ur(e,t=>t.type==="ObjectTypeAnnotation"&&ur(t,r=>r.type==="FunctionTypeAnnotation"))}function Dc(e){return se(e)}function yr(e){let{parent:t,key:r}=e;switch(t.type){case"NGPipeExpression":if(r==="arguments"&&e.isLast)return e.callParent(yr);break;case"ObjectProperty":if(r==="value")return e.callParent(()=>e.key==="properties"&&e.isLast);break;case"BinaryExpression":case"LogicalExpression":if(r==="right")return e.callParent(yr);break;case"ConditionalExpression":if(r==="alternate")return e.callParent(yr);break;case"UnaryExpression":if(t.prefix)return e.callParent(yr);break}return!1}function fi(e,t){let{node:r,parent:n}=e;return r.type==="FunctionExpression"||r.type==="ClassExpression"?n.type==="ExportDefaultDeclaration"||!ps(e,t):!Jt(r)||n.type!=="ExportDefaultDeclaration"&&ps(e,t)?!1:e.call(()=>fi(e,t),...Lr(r))}function fc(e){return!!(e.match(void 0,(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&(t.type==="CallExpression"||t.type==="NewExpression"))||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression")||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression")&&(e.match(void 0,void 0,(t,r)=>r==="callee"&&(t.type==="CallExpression"&&!t.optional||t.type==="NewExpression")||r==="object"&&t.type==="MemberExpression"&&!t.optional)||e.match(void 0,void 0,(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression"))||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression"))}function cs(e){return e.type==="Identifier"?!0:W(e)?!e.computed&&!e.optional&&e.property.type==="Identifier"&&cs(e.object):!1}function Ec(e){return e.type==="ChainExpression"&&(e=e.expression),cs(e)||L(e)&&!e.optional&&cs(e.callee)}var ke=ps;function Fc(e,t){let r=t-1;r=Xe(e,r,{backwards:!0}),r=He(e,r,{backwards:!0}),r=Xe(e,r,{backwards:!0});let n=He(e,r,{backwards:!0});return r!==n}var Ei=Fc;var Cc=()=>!0;function ls(e,t){let r=e.node;return r.printed=!0,t.printer.printComment(e,t)}function Ac(e,t){var y;let r=e.node,n=[ls(e,t)],{printer:s,originalText:u,locStart:i,locEnd:a}=t;if((y=s.isBlockComment)==null?void 0:y.call(s,r)){let D=Z(u,a(r))?Z(u,i(r),{backwards:!0})?F:x:" ";n.push(D)}else n.push(F);let p=He(u,Xe(u,a(r)));return p!==!1&&Z(u,p)&&n.push(F),n}function Tc(e,t,r){var p;let n=e.node,s=ls(e,t),{printer:u,originalText:i,locStart:a}=t,o=(p=u.isBlockComment)==null?void 0:p.call(u,n);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||Z(i,a(n),{backwards:!0})){let y=Ei(i,a(n));return{doc:Yn([F,y?F:"",s]),isBlock:o,hasLineSuffix:!0}}return!o||r!=null&&r.hasLineSuffix?{doc:[Yn([" ",s]),Ee],isBlock:o,hasLineSuffix:!0}:{doc:[" ",s],isBlock:o,hasLineSuffix:!1}}function J(e,t,r={}){let{node:n}=e;if(!O(n==null?void 0:n.comments))return"";let{indent:s=!1,marker:u,filter:i=Cc}=r,a=[];if(e.each(({node:p})=>{p.leading||p.trailing||p.marker!==u||!i(p)||a.push(ls(e,t))},"comments"),a.length===0)return"";let o=b(F,a);return s?f([F,o]):o}function ms(e,t){let r=e.node;if(!r)return{};let n=t[Symbol.for("printedComments")];if((r.comments||[]).filter(o=>!n.has(o)).length===0)return{leading:"",trailing:""};let u=[],i=[],a;return e.each(()=>{let o=e.node;if(n!=null&&n.has(o))return;let{leading:p,trailing:y}=o;p?u.push(Ac(e,t)):y&&(a=Tc(e,t,a),i.push(a.doc))},"comments"),{leading:u,trailing:i}}function ye(e,t,r){let{leading:n,trailing:s}=ms(e,r);return!n&&!s?t:lr(t,u=>[n,u,s])}var ys=class extends Error{name="UnexpectedNodeError";constructor(t,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`),this.node=t}},Ne=ys;function Ds(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Ge,fs=class{constructor(t){Us(this,Ge);Ys(this,Ge,new Set(t))}getLeadingWhitespaceCount(t){let r=ct(this,Ge),n=0;for(let s=0;s=0&&r.has(t.charAt(s));s--)n++;return n}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return ct(this,Ge).has(t.charAt(0))}hasTrailingWhitespace(t){return ct(this,Ge).has(M(!1,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let n=`[${Ds([...ct(this,Ge)].join(""))}]+`,s=new RegExp(r?`(${n})`:n,"u");return t.split(s)}hasWhitespaceCharacter(t){let r=ct(this,Ge);return Array.prototype.some.call(t,n=>r.has(n))}hasNonWhitespaceCharacter(t){let r=ct(this,Ge);return Array.prototype.some.call(t,n=>!r.has(n))}isWhitespaceOnly(t){let r=ct(this,Ge);return Array.prototype.every.call(t,n=>r.has(n))}};Ge=new WeakMap;var Fi=fs;var Hr=new Fi(` +\r `),Es=e=>e===""||e===x||e===F||e===E;function dc(e,t,r){var _,v,j,I,G;let{node:n}=e;if(n.type==="JSXElement"&&vc(n))return[r("openingElement"),r("closingElement")];let s=n.type==="JSXElement"?r("openingElement"):r("openingFragment"),u=n.type==="JSXElement"?r("closingElement"):r("closingFragment");if(n.children.length===1&&n.children[0].type==="JSXExpressionContainer"&&(n.children[0].expression.type==="TemplateLiteral"||n.children[0].expression.type==="TaggedTemplateExpression"))return[s,...e.map(r,"children"),u];n.children=n.children.map(P=>jc(P)?{type:"JSXText",value:" ",raw:" "}:P);let i=n.children.some(X),a=n.children.filter(P=>P.type==="JSXExpressionContainer").length>1,o=n.type==="JSXElement"&&n.openingElement.attributes.length>1,p=re(s)||i||o||a,y=e.parent.rootMarker==="mdx",D=t.singleQuote?"{' '}":'{" "}',m=y?x:B([D,E]," "),C=((v=(_=n.openingElement)==null?void 0:_.name)==null?void 0:v.name)==="fbt",c=xc(e,t,r,m,C),A=n.children.some(P=>Dr(P));for(let P=c.length-2;P>=0;P--){let N=c[P]===""&&c[P+1]==="",ue=c[P]===F&&c[P+1]===""&&c[P+2]===F,Q=(c[P]===E||c[P]===F)&&c[P+1]===""&&c[P+2]===m,Bt=c[P]===m&&c[P+1]===""&&(c[P+2]===E||c[P+2]===F),Ct=c[P]===m&&c[P+1]===""&&c[P+2]===m,w=c[P]===E&&c[P+1]===""&&c[P+2]===F||c[P]===F&&c[P+1]===""&&c[P+2]===E;ue&&A||N||Q||Ct||w?c.splice(P,2):Bt&&c.splice(P+1,2)}for(;c.length>0&&Es(M(!1,c,-1));)c.pop();for(;c.length>1&&Es(c[0])&&Es(c[1]);)c.shift(),c.shift();let d=[""];for(let[P,N]of c.entries()){if(N===m){if(P===1&&Pu(c[P-1])){if(c.length===2){d.push([d.pop(),D]);continue}d.push([D,F],"");continue}else if(P===c.length-1){d.push([d.pop(),D]);continue}else if(c[P-1]===""&&c[P-2]===F){d.push([d.pop(),D]);continue}}P%2===0?d.push([d.pop(),N]):d.push(N,""),re(N)&&(p=!0)}let S=A?qr(d):l(d,{shouldBreak:!0});if(((j=t.cursorNode)==null?void 0:j.type)==="JSXText"&&n.children.includes(t.cursorNode)?S=[mr,S,mr]:((I=t.nodeBeforeCursor)==null?void 0:I.type)==="JSXText"&&n.children.includes(t.nodeBeforeCursor)?S=[mr,S]:((G=t.nodeAfterCursor)==null?void 0:G.type)==="JSXText"&&n.children.includes(t.nodeAfterCursor)&&(S=[S,mr]),y)return S;let g=l([s,f([F,S]),F,u]);return p?g:et([l([s,...c,u]),g])}function xc(e,t,r,n,s){let u="",i=[u];function a(p){u=p,i.push([i.pop(),p])}function o(p){p!==""&&(u=p,i.push(p,""))}return e.each(({node:p,next:y})=>{if(p.type==="JSXText"){let D=fe(p);if(Dr(p)){let m=Hr.split(D,!0);m[0]===""&&(m.shift(),/\n/u.test(m[0])?o(Ai(s,m[1],p,y)):o(n),m.shift());let C;if(M(!1,m,-1)===""&&(m.pop(),C=m.pop()),m.length===0)return;for(let[c,A]of m.entries())c%2===1?o(x):a(A);C!==void 0?/\n/u.test(C)?o(Ai(s,u,p,y)):o(n):o(Ci(s,u,p,y))}else/\n/u.test(D)?D.match(/\n/gu).length>1&&o(F):o(n)}else{let D=r();if(a(D),y&&Dr(y)){let C=Hr.trim(fe(y)),[c]=Hr.split(C);o(Ci(s,c,p,y))}else o(F)}},"children"),i}function Ci(e,t,r,n){return e?"":r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?t.length===1?E:F:E}function Ai(e,t,r,n){return e?F:t.length===1?r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?F:E:F}var hc=new Set(["ArrayExpression","TupleExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function gc(e,t,r){let{parent:n}=e;if(hc.has(n.type))return t;let s=e.match(void 0,i=>i.type==="ArrowFunctionExpression",L,i=>i.type==="JSXExpressionContainer"),u=ke(e,r);return l([u?"":B("("),f([E,t]),E,u?"":B(")")],{shouldBreak:s})}function Sc(e,t,r){let{node:n}=e,s=[];if(s.push(r("name")),n.value){let u;if(te(n.value)){let i=fe(n.value),a=Y(!1,Y(!1,i.slice(1,-1),"'","'"),""",'"'),o=Sr(a,t.jsxSingleQuote);a=o==='"'?Y(!1,a,'"',"""):Y(!1,a,"'","'"),u=e.call(()=>ye(e,ve(o+a+o),t),"value")}else u=r("value");s.push("=",u)}return s}function Bc(e,t,r){let{node:n}=e,s=(u,i)=>u.type==="JSXEmptyExpression"||!T(u)&&(U(u)||se(u)||u.type==="ArrowFunctionExpression"||u.type==="AwaitExpression"&&(s(u.argument,u)||u.argument.type==="JSXElement")||L(u)||u.type==="ChainExpression"&&L(u.expression)||u.type==="FunctionExpression"||u.type==="TemplateLiteral"||u.type==="TaggedTemplateExpression"||u.type==="DoExpression"||X(i)&&(u.type==="ConditionalExpression"||De(u)));return s(n.expression,e.parent)?l(["{",r("expression"),je,"}"]):l(["{",f([E,r("expression")]),E,je,"}"])}function bc(e,t,r){var a,o;let{node:n}=e,s=T(n.name)||T(n.typeParameters)||T(n.typeArguments);if(n.selfClosing&&n.attributes.length===0&&!s)return["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," />"];if(((a=n.attributes)==null?void 0:a.length)===1&&te(n.attributes[0].value)&&!n.attributes[0].value.value.includes(` +`)&&!s&&!T(n.attributes[0]))return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," ",...e.map(r,"attributes"),n.selfClosing?" />":">"]);let u=(o=n.attributes)==null?void 0:o.some(p=>te(p.value)&&p.value.value.includes(` +`)),i=t.singleAttributePerLine&&n.attributes.length>1?F:x;return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters"),f(e.map(()=>[i,r()],"attributes")),...Pc(n,t,s)],{shouldBreak:u})}function Pc(e,t,r){return e.selfClosing?[x,"/>"]:kc(e,t,r)?[">"]:[E,">"]}function kc(e,t,r){let n=e.attributes.length>0&&T(M(!1,e.attributes,-1),h.Trailing);return e.attributes.length===0&&!r||(t.bracketSameLine||t.jsxBracketSameLine)&&(!r||e.attributes.length>0)&&!n}function Ic(e,t,r){let{node:n}=e,s=[];s.push(""),s}function Lc(e,t){let{node:r}=e,n=T(r),s=T(r,h.Line),u=r.type==="JSXOpeningFragment";return[u?"<":""]}function wc(e,t,r){let n=ye(e,dc(e,t,r),t);return gc(e,n,t)}function Oc(e,t){let{node:r}=e,n=T(r,h.Line);return[J(e,t,{indent:n}),n?F:""]}function _c(e,t,r){let{node:n}=e;return["{",e.call(({node:s})=>{let u=["...",r()];return!T(s)||!es(e)?u:[f([E,ye(e,u,t)]),E]},n.type==="JSXSpreadAttribute"?"argument":"expression"),"}"]}function Ti(e,t,r){let{node:n}=e;if(n.type.startsWith("JSX"))switch(n.type){case"JSXAttribute":return Sc(e,t,r);case"JSXIdentifier":return n.name;case"JSXNamespacedName":return b(":",[r("namespace"),r("name")]);case"JSXMemberExpression":return b(".",[r("object"),r("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return _c(e,t,r);case"JSXExpressionContainer":return Bc(e,t,r);case"JSXFragment":case"JSXElement":return wc(e,t,r);case"JSXOpeningElement":return bc(e,t,r);case"JSXClosingElement":return Ic(e,t,r);case"JSXOpeningFragment":case"JSXClosingFragment":return Lc(e,t);case"JSXEmptyExpression":return Oc(e,t);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new Ne(n,"JSX")}}function vc(e){if(e.children.length===0)return!0;if(e.children.length>1)return!1;let t=e.children[0];return t.type==="JSXText"&&!Dr(t)}function Dr(e){return e.type==="JSXText"&&(Hr.hasNonWhitespaceCharacter(fe(e))||!/\n/u.test(fe(e)))}function jc(e){return e.type==="JSXExpressionContainer"&&te(e.expression)&&e.expression.value===" "&&!T(e.expression)}function di(e){let{node:t,parent:r}=e;if(!X(t)||!X(r))return!1;let{index:n,siblings:s}=e,u;for(let i=n;i>0;i--){let a=s[i-1];if(!(a.type==="JSXText"&&!Dr(a))){u=a;break}}return(u==null?void 0:u.type)==="JSXExpressionContainer"&&u.expression.type==="JSXEmptyExpression"&&Lt(u.expression)}function Mc(e){return Lt(e.node)||di(e)}var Vr=Mc;var Rc=0;function $r(e,t,r){var v;let{node:n,parent:s,grandparent:u,key:i}=e,a=i!=="body"&&(s.type==="IfStatement"||s.type==="WhileStatement"||s.type==="SwitchStatement"||s.type==="DoWhileStatement"),o=n.operator==="|>"&&((v=e.root.extra)==null?void 0:v.__isUsingHackPipeline),p=Fs(e,r,t,!1,a);if(a)return p;if(o)return l(p);if(L(s)&&s.callee===n||s.type==="UnaryExpression"||W(s)&&!s.computed)return l([f([E,...p]),E]);let y=s.type==="ReturnStatement"||s.type==="ThrowStatement"||s.type==="JSXExpressionContainer"&&u.type==="JSXAttribute"||n.operator!=="|"&&s.type==="JsExpressionRoot"||n.type!=="NGPipeExpression"&&(s.type==="NGRoot"&&t.parser==="__ng_binding"||s.type==="NGMicrosyntaxExpression"&&u.type==="NGMicrosyntax"&&u.body.length===1)||n===s.body&&s.type==="ArrowFunctionExpression"||n!==s.body&&s.type==="ForStatement"||s.type==="ConditionalExpression"&&u.type!=="ReturnStatement"&&u.type!=="ThrowStatement"&&!L(u)||s.type==="TemplateLiteral",D=s.type==="AssignmentExpression"||s.type==="VariableDeclarator"||s.type==="ClassProperty"||s.type==="PropertyDefinition"||s.type==="TSAbstractPropertyDefinition"||s.type==="ClassPrivateProperty"||Ce(s),m=De(n.left)&&ar(n.operator,n.left.operator);if(y||Ht(n)&&!m||!Ht(n)&&D)return l(p);if(p.length===0)return"";let C=X(n.right),c=p.findIndex(j=>typeof j!="string"&&!Array.isArray(j)&&j.type===me),A=p.slice(0,c===-1?1:c+1),d=p.slice(A.length,C?-1:void 0),S=Symbol("logicalChain-"+ ++Rc),g=l([...A,f(d)],{id:S});if(!C)return g;let _=M(!1,p,-1);return l([g,xt(_,{groupId:S})])}function Fs(e,t,r,n,s){var S;let{node:u}=e;if(!De(u))return[l(t())];let i=[];ar(u.operator,u.left.operator)?i=e.call(g=>Fs(g,t,r,!0,s),"left"):i.push(l(t("left")));let a=Ht(u),o=(u.operator==="|>"||u.type==="NGPipeExpression"||Jc(e,r))&&!Le(r.originalText,u.right),y=!T(u.right,h.Leading,Wr)&&Le(r.originalText,u.right),D=u.type==="NGPipeExpression"?"|":u.operator,m=u.type==="NGPipeExpression"&&u.arguments.length>0?l(f([E,": ",b([x,": "],e.map(()=>Be(2,l(t())),"arguments"))])):"",C;if(a)C=[D," ",t("right"),m];else{let _=D==="|>"&&((S=e.root.extra)==null?void 0:S.__isUsingHackPipeline)?e.call(v=>Fs(v,t,r,!0,s),"right"):t("right");if(r.experimentalOperatorPosition==="start"){let v="";if(y)switch(Se(_)){case he:v=_.splice(0,1)[0];break;case ge:v=_.contents.splice(0,1)[0];break}C=[x,v,D," ",_,m]}else C=[o?x:"",D,o?" ":x,_,m]}let{parent:c}=e,A=T(u.left,h.Trailing|h.Line);if((A||!(s&&u.type==="LogicalExpression")&&c.type!==u.type&&u.left.type!==u.type&&u.right.type!==u.type)&&(C=l(C,{shouldBreak:A})),r.experimentalOperatorPosition==="start"?i.push(a||y?" ":"",C):i.push(o?"":" ",C),n&&T(u)){let g=Ut(ye(e,i,r));return g.type===Oe?g.parts:Array.isArray(g)?g:[g]}return i}function Ht(e){return e.type!=="LogicalExpression"?!1:!!(se(e.right)&&e.right.properties.length>0||U(e.right)&&e.right.elements.length>0||X(e.right))}var xi=e=>e.type==="BinaryExpression"&&e.operator==="|";function Jc(e,t){return(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression")&&xi(e.node)&&!e.hasAncestor(r=>!xi(r)&&r.type!=="JsExpressionRoot")}function gi(e,t,r){let{node:n}=e;if(n.type.startsWith("NG"))switch(n.type){case"NGRoot":return[r("node"),T(n.node)?" //"+lt(n.node)[0].value.trimEnd():""];case"NGPipeExpression":return $r(e,t,r);case"NGChainedExpression":return l(b([";",x],e.map(()=>Wc(e)?r():["(",r(),")"],"expressions")));case"NGEmptyExpression":return"";case"NGMicrosyntax":return e.map(()=>[e.isFirst?"":hi(e)?" ":[";",x],r()],"body");case"NGMicrosyntaxKey":return/^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(n.name)?n.name:JSON.stringify(n.name);case"NGMicrosyntaxExpression":return[r("expression"),n.alias===null?"":[" as ",r("alias")]];case"NGMicrosyntaxKeyedExpression":{let{index:s,parent:u}=e,i=hi(e)||(s===1&&(n.key.name==="then"||n.key.name==="else"||n.key.name==="as")||(s===2||s===3)&&(n.key.name==="else"&&u.body[s-1].type==="NGMicrosyntaxKeyedExpression"&&u.body[s-1].key.name==="then"||n.key.name==="track"))&&u.body[0].type==="NGMicrosyntaxExpression";return[r("key"),i?" ":": ",r("expression")]}case"NGMicrosyntaxLet":return["let ",r("key"),n.value===null?"":[" = ",r("value")]];case"NGMicrosyntaxAs":return[r("key")," as ",r("alias")];default:throw new Ne(n,"Angular")}}function hi({node:e,index:t}){return e.type==="NGMicrosyntaxKeyedExpression"&&e.key.name==="of"&&t===1}var qc=R(["CallExpression","OptionalCallExpression","AssignmentExpression"]);function Wc({node:e}){return ur(e,qc)}function Cs(e,t,r){let{node:n}=e;return l([b(x,e.map(r,"decorators")),bi(n,t)?F:x])}function Si(e,t,r){return Pi(e.node)?[b(F,e.map(r,"declaration","decorators")),F]:""}function Bi(e,t,r){let{node:n,parent:s}=e,{decorators:u}=n;if(!O(u)||Pi(s)||Vr(e))return"";let i=n.type==="ClassExpression"||n.type==="ClassDeclaration"||bi(n,t);return[e.key==="declaration"&&cu(s)?F:i?Ee:"",b(x,e.map(r,"decorators")),x]}function bi(e,t){return e.decorators.some(r=>Z(t.originalText,k(r)))}function Pi(e){var r;if(e.type!=="ExportDefaultDeclaration"&&e.type!=="ExportNamedDeclaration"&&e.type!=="DeclareExportDeclaration")return!1;let t=(r=e.declaration)==null?void 0:r.decorators;return O(t)&&Pt(e,t[0])}var Dt=class extends Error{name="ArgExpansionBailout"};function Nc(e,t,r){let{node:n}=e,s=pe(n);if(s.length===0)return["(",J(e,t),")"];let u=s.length-1;if(Yc(s)){let D=["("];return Wt(e,(m,C)=>{D.push(r()),C!==u&&D.push(", ")}),D.push(")"),D}let i=!1,a=[];Wt(e,({node:D},m)=>{let C=r();m===u||(ce(D,t)?(i=!0,C=[C,",",F,F]):C=[C,",",x]),a.push(C)});let o=!t.parser.startsWith("__ng_")&&n.type!=="ImportExpression"&&oe(t,"all")?",":"";function p(){return l(["(",f([x,...a]),o,x,")"],{shouldBreak:!0})}if(i||e.parent.type!=="Decorator"&&fu(s))return p();if(Uc(s)){let D=a.slice(1);if(D.some(re))return p();let m;try{m=r(Wn(n,0),{expandFirstArg:!0})}catch(C){if(C instanceof Dt)return p();throw C}return re(m)?[Ee,et([["(",l(m,{shouldBreak:!0}),", ",...D,")"],p()])]:et([["(",m,", ",...D,")"],["(",l(m,{shouldBreak:!0}),", ",...D,")"],p()])}if(Gc(s,a,t)){let D=a.slice(0,-1);if(D.some(re))return p();let m;try{m=r(Wn(n,-1),{expandLastArg:!0})}catch(C){if(C instanceof Dt)return p();throw C}return re(m)?[Ee,et([["(",...D,l(m,{shouldBreak:!0}),")"],p()])]:et([["(",...D,m,")"],["(",...D,l(m,{shouldBreak:!0}),")"],p()])}let y=["(",f([E,...a]),B(o),E,")"];return jr(e)?y:l(y,{shouldBreak:a.some(re)||i})}function fr(e,t=!1){return se(e)&&(e.properties.length>0||T(e))||U(e)&&(e.elements.length>0||T(e))||e.type==="TSTypeAssertion"&&fr(e.expression)||Ae(e)&&fr(e.expression)||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&(!e.returnType||!e.returnType.typeAnnotation||e.returnType.typeAnnotation.type!=="TSTypeReference"||Xc(e.body))&&(e.body.type==="BlockStatement"||e.body.type==="ArrowFunctionExpression"&&fr(e.body,!0)||se(e.body)||U(e.body)||!t&&(L(e.body)||e.body.type==="ConditionalExpression")||X(e.body))||e.type==="DoExpression"||e.type==="ModuleExpression"}function Gc(e,t,r){var u,i;let n=M(!1,e,-1);if(e.length===1){let a=M(!1,t,-1);if((u=a.label)!=null&&u.embed&&((i=a.label)==null?void 0:i.hug)!==!1)return!0}let s=M(!1,e,-2);return!T(n,h.Leading)&&!T(n,h.Trailing)&&fr(n)&&(!s||s.type!==n.type)&&(e.length!==2||s.type!=="ArrowFunctionExpression"||!U(n))&&!(e.length>1&&As(n,r))}function Uc(e){if(e.length!==2)return!1;let[t,r]=e;return t.type==="ModuleExpression"&&Hc(r)?!0:!T(t)&&(t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement")&&r.type!=="FunctionExpression"&&r.type!=="ArrowFunctionExpression"&&r.type!=="ConditionalExpression"&&Ii(r)&&!fr(r)}function Ii(e){if(e.type==="ParenthesizedExpression")return Ii(e.expression);if(Ae(e)||e.type==="TypeCastExpression"){let{typeAnnotation:t}=e;if(t.type==="TypeAnnotation"&&(t=t.typeAnnotation),t.type==="TSArrayType"&&(t=t.elementType,t.type==="TSArrayType"&&(t=t.elementType)),t.type==="GenericTypeAnnotation"||t.type==="TSTypeReference"){let r=t.typeArguments??t.typeParameters;(r==null?void 0:r.params.length)===1&&(t=r.params[0])}return qt(t)&&Ie(e.expression,1)}return mt(e)&&pe(e).length>1?!1:De(e)?Ie(e.left,1)&&Ie(e.right,1):Jn(e)||Ie(e)}function Yc(e){return e.length===2?ki(e,0):e.length===3?e[0].type==="Identifier"&&ki(e,1):!1}function ki(e,t){let r=e[t],n=e[t+1];return r.type==="ArrowFunctionExpression"&&z(r).length===0&&r.body.type==="BlockStatement"&&n.type==="ArrayExpression"&&!e.some(s=>T(s))}function Xc(e){return e.type==="BlockStatement"&&(e.body.some(t=>t.type!=="EmptyStatement")||T(e,h.Dangling))}function Hc(e){return e.type==="ObjectExpression"&&e.properties.length===1&&Ce(e.properties[0])&&e.properties[0].key.type==="Identifier"&&e.properties[0].key.name==="type"&&te(e.properties[0].value)&&e.properties[0].value.value==="module"}var Er=Nc;var Vc=e=>((e.type==="ChainExpression"||e.type==="TSNonNullExpression")&&(e=e.expression),L(e)&&pe(e).length>0);function Li(e,t,r){var p;let n=r("object"),s=Ts(e,t,r),{node:u}=e,i=e.findAncestor(y=>!(W(y)||y.type==="TSNonNullExpression")),a=e.findAncestor(y=>!(y.type==="ChainExpression"||y.type==="TSNonNullExpression")),o=i&&(i.type==="NewExpression"||i.type==="BindExpression"||i.type==="AssignmentExpression"&&i.left.type!=="Identifier")||u.computed||u.object.type==="Identifier"&&u.property.type==="Identifier"&&!W(a)||(a.type==="AssignmentExpression"||a.type==="VariableDeclarator")&&(Vc(u.object)||((p=n.label)==null?void 0:p.memberChain));return ut(n.label,[n,o?s:l(f([E,s]))])}function Ts(e,t,r){let n=r("property"),{node:s}=e,u=$(e);return s.computed?!s.property||Fe(s.property)?[u,"[",n,"]"]:l([u,"[",f([E,n]),E,"]"]):[u,".",n]}function wi(e,t,r){if(e.node.type==="ChainExpression")return e.call(()=>wi(e,t,r),"expression");let{parent:n}=e,s=!n||n.type==="ExpressionStatement",u=[];function i(w){let{originalText:ne}=t,xe=it(ne,k(w));return ne.charAt(xe)===")"?xe!==!1&&jt(ne,xe+1):ce(w,t)}function a(){let{node:w}=e;if(w.type==="ChainExpression")return e.call(a,"expression");if(L(w)&&(Tt(w.callee)||L(w.callee))){let ne=i(w);u.unshift({node:w,hasTrailingEmptyLine:ne,printed:[ye(e,[$(e),tt(e,t,r),Er(e,t,r)],t),ne?F:""]}),e.call(a,"callee")}else Tt(w)?(u.unshift({node:w,needsParens:ke(e,t),printed:ye(e,W(w)?Ts(e,t,r):Kr(e,t,r),t)}),e.call(a,"object")):w.type==="TSNonNullExpression"?(u.unshift({node:w,printed:ye(e,"!",t)}),e.call(a,"expression")):u.unshift({node:w,printed:r()})}let{node:o}=e;u.unshift({node:o,printed:[$(e),tt(e,t,r),Er(e,t,r)]}),o.callee&&e.call(a,"callee");let p=[],y=[u[0]],D=1;for(;D0&&p.push(y);function C(w){return/^[A-Z]|^[$_]+$/u.test(w)}function c(w){return w.length<=t.tabWidth}function A(w){var pt;let ne=(pt=w[1][0])==null?void 0:pt.node.computed;if(w[0].length===1){let bt=w[0][0].node;return bt.type==="ThisExpression"||bt.type==="Identifier"&&(C(bt.name)||s&&c(bt.name)||ne)}let xe=M(!1,w[0],-1).node;return W(xe)&&xe.property.type==="Identifier"&&(C(xe.property.name)||ne)}let d=p.length>=2&&!T(p[1][0].node)&&A(p);function S(w){let ne=w.map(xe=>xe.printed);return w.length>0&&M(!1,w,-1).needsParens?["(",...ne,")"]:ne}function g(w){return w.length===0?"":f([F,b(F,w.map(S))])}let _=p.map(S),v=_,j=d?3:2,I=p.flat(),G=I.slice(1,-1).some(w=>T(w.node,h.Leading))||I.slice(0,-1).some(w=>T(w.node,h.Trailing))||p[j]&&T(p[j][0].node,h.Leading);if(p.length<=j&&!G&&!p.some(w=>M(!1,w,-1).hasTrailingEmptyLine))return jr(e)?v:l(v);let P=M(!1,p[d?1:0],-1).node,N=!L(P)&&i(P),ue=[S(p[0]),d?p.slice(1,2).map(S):"",N?F:"",g(p.slice(d?2:1))],Q=u.map(({node:w})=>w).filter(L);function Bt(){let w=M(!1,M(!1,p,-1),-1).node,ne=M(!1,_,-1);return L(w)&&re(ne)&&Q.slice(0,-1).some(xe=>xe.arguments.some(Rt))}let Ct;return G||Q.length>2&&Q.some(w=>!w.arguments.every(ne=>Ie(ne)))||_.slice(0,-1).some(re)||Bt()?Ct=l(ue):Ct=[re(v)||N?Ee:"",et([v,ue])],ut({memberChain:!0},Ct)}var Oi=wi;function Qr(e,t,r){var y;let{node:n}=e,s=n.type==="NewExpression",u=n.type==="ImportExpression",i=$(e),a=pe(n),o=a.length===1&&_r(a[0],t.originalText);if(o||$c(e)||It(n,e.parent)){let D=[];if(Wt(e,()=>{D.push(r())}),!(o&&((y=D[0].label)!=null&&y.embed)))return[s?"new ":"",_i(e,r),i,tt(e,t,r),"(",b(", ",D),")"]}if(!u&&!s&&Tt(n.callee)&&!e.call(D=>ke(D,t),"callee",...n.callee.type==="ChainExpression"?["expression"]:[]))return Oi(e,t,r);let p=[s?"new ":"",_i(e,r),i,tt(e,t,r),Er(e,t,r)];return u||L(n.callee)?l(p):p}function _i(e,t){let{node:r}=e;return r.type==="ImportExpression"?`import${r.phase?`.${r.phase}`:""}`:t("callee")}function $c(e){let{node:t}=e;if(t.type!=="CallExpression"||t.optional||t.callee.type!=="Identifier")return!1;let r=pe(t);return t.callee.name==="require"?r.length===1&&te(r[0])||r.length>1:t.callee.name==="define"&&e.parent.type==="ExpressionStatement"?r.length===1||r.length===2&&r[0].type==="ArrayExpression"||r.length===3&&te(r[0])&&r[1].type==="ArrayExpression":!1}function ht(e,t,r,n,s,u){let i=Kc(e,t,r,n,u),a=u?r(u,{assignmentLayout:i}):"";switch(i){case"break-after-operator":return l([l(n),s,l(f([x,a]))]);case"never-break-after-operator":return l([l(n),s," ",a]);case"fluid":{let o=Symbol("assignment");return l([l(n),s,l(f(x),{id:o}),je,xt(a,{groupId:o})])}case"break-lhs":return l([n,s," ",l(a)]);case"chain":return[l(n),s,x,a];case"chain-tail":return[l(n),s,f([x,a])];case"chain-tail-arrow-chain":return[l(n),s,a];case"only-left":return n}}function ji(e,t,r){let{node:n}=e;return ht(e,t,r,r("left"),[" ",n.operator],"right")}function Mi(e,t,r){return ht(e,t,r,r("id")," =","init")}function Kc(e,t,r,n,s){let{node:u}=e,i=u[s];if(!i)return"only-left";let a=!zr(i);if(e.match(zr,Ri,m=>!a||m.type!=="ExpressionStatement"&&m.type!=="VariableDeclaration"))return a?i.type==="ArrowFunctionExpression"&&i.body.type==="ArrowFunctionExpression"?"chain-tail-arrow-chain":"chain-tail":"chain";if(!a&&zr(i.right)||Le(t.originalText,i))return"break-after-operator";if(u.type==="ImportAttribute"||i.type==="CallExpression"&&i.callee.name==="require"||t.parser==="json5"||t.parser==="jsonc"||t.parser==="json")return"never-break-after-operator";let y=bu(n);if(zc(u)||rl(u)||ds(u)&&y)return"break-lhs";let D=sl(u,n,t);return e.call(()=>Qc(e,t,r,D),s)?"break-after-operator":Zc(u)?"break-lhs":!y&&(D||i.type==="TemplateLiteral"||i.type==="TaggedTemplateExpression"||i.type==="BooleanLiteral"||Fe(i)||i.type==="ClassExpression")?"never-break-after-operator":"fluid"}function Qc(e,t,r,n){let s=e.node;if(De(s)&&!Ht(s))return!0;switch(s.type){case"StringLiteralTypeAnnotation":case"SequenceExpression":return!0;case"TSConditionalType":case"ConditionalTypeAnnotation":if(!t.experimentalTernaries&&!al(s))break;return!0;case"ConditionalExpression":{if(!t.experimentalTernaries){let{test:p}=s;return De(p)&&!Ht(p)}let{consequent:a,alternate:o}=s;return a.type==="ConditionalExpression"||o.type==="ConditionalExpression"}case"ClassExpression":return O(s.decorators)}if(n)return!1;let u=s,i=[];for(;;)if(u.type==="UnaryExpression"||u.type==="AwaitExpression"||u.type==="YieldExpression"&&u.argument!==null)u=u.argument,i.push("argument");else if(u.type==="TSNonNullExpression")u=u.expression,i.push("expression");else break;return!!(te(u)||e.call(()=>Ji(e,t,r),...i))}function zc(e){if(Ri(e)){let t=e.left||e.id;return t.type==="ObjectPattern"&&t.properties.length>2&&t.properties.some(r=>{var n;return Ce(r)&&(!r.shorthand||((n=r.value)==null?void 0:n.type)==="AssignmentPattern")})}return!1}function zr(e){return e.type==="AssignmentExpression"}function Ri(e){return zr(e)||e.type==="VariableDeclarator"}function Zc(e){let t=tl(e);if(O(t)){let r=e.type==="TSTypeAliasDeclaration"?"constraint":"bound";if(t.length>1&&t.some(n=>n[r]||n.default))return!0}return!1}var el=R(["TSTypeAliasDeclaration","TypeAlias"]);function tl(e){var t;if(el(e))return(t=e.typeParameters)==null?void 0:t.params}function rl(e){if(e.type!=="VariableDeclarator")return!1;let{typeAnnotation:t}=e.id;if(!t||!t.typeAnnotation)return!1;let r=vi(t.typeAnnotation);return O(r)&&r.length>1&&r.some(n=>O(vi(n))||n.type==="TSConditionalType")}function ds(e){var t;return e.type==="VariableDeclarator"&&((t=e.init)==null?void 0:t.type)==="ArrowFunctionExpression"}var nl=R(["TSTypeReference","GenericTypeAnnotation"]);function vi(e){var t;if(nl(e))return(t=e.typeArguments??e.typeParameters)==null?void 0:t.params}function Ji(e,t,r,n=!1){var i;let{node:s}=e,u=()=>Ji(e,t,r,!0);if(s.type==="ChainExpression"||s.type==="TSNonNullExpression")return e.call(u,"expression");if(L(s)){if((i=Qr(e,t,r).label)!=null&&i.memberChain)return!1;let o=pe(s);return!(o.length===0||o.length===1&&ir(o[0],t))||ul(s,r)?!1:e.call(u,"callee")}return W(s)?e.call(u,"object"):n&&(s.type==="Identifier"||s.type==="ThisExpression")}function sl(e,t,r){return Ce(e)?(t=Ut(t),typeof t=="string"&&rt(t)1)return!0;if(r.length===1){let s=r[0];if(we(s)||Nt(s)||s.type==="TSTypeLiteral"||s.type==="ObjectTypeAnnotation")return!0}let n=e.typeParameters?"typeParameters":"typeArguments";if(re(t(n)))return!0}return!1}function il(e){var t;return(t=e.typeParameters??e.typeArguments)==null?void 0:t.params}function al(e){function t(r){switch(r.type){case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"TSFunctionType":return!!r.typeParameters;case"TSTypeReference":return!!(r.typeArguments??r.typeParameters);default:return!1}}return t(e.checkType)||t(e.extendsType)}function Ue(e,t,r,n,s){let u=e.node,i=z(u),a=s?tt(e,r,t):"";if(i.length===0)return[a,"(",J(e,r,{filter:c=>be(r.originalText,k(c))===")"}),")"];let{parent:o}=e,p=It(o),y=xs(u),D=[];if(Au(e,(c,A)=>{let d=A===i.length-1;d&&u.rest&&D.push("..."),D.push(t()),!d&&(D.push(","),p||y?D.push(" "):ce(i[A],r)?D.push(F,F):D.push(x))}),n&&!pl(e)){if(re(a)||re(D))throw new Dt;return l([cr(a),"(",cr(D),")"])}let m=i.every(c=>!O(c.decorators));return y&&m?[a,"(",...D,")"]:p?[a,"(",...D,")"]:(Or(o)||mu(o)||o.type==="TypeAlias"||o.type==="UnionTypeAnnotation"||o.type==="IntersectionTypeAnnotation"||o.type==="FunctionTypeAnnotation"&&o.returnType===u)&&i.length===1&&i[0].name===null&&u.this!==i[0]&&i[0].typeAnnotation&&u.typeParameters===null&&qt(i[0].typeAnnotation)&&!u.rest?r.arrowParens==="always"||u.type==="HookTypeAnnotation"?["(",...D,")"]:D:[a,"(",f([E,...D]),B(!Cu(u)&&oe(r,"all")?",":""),E,")"]}function xs(e){if(!e)return!1;let t=z(e);if(t.length!==1)return!1;let[r]=t;return!T(r)&&(r.type==="ObjectPattern"||r.type==="ArrayPattern"||r.type==="Identifier"&&r.typeAnnotation&&(r.typeAnnotation.type==="TypeAnnotation"||r.typeAnnotation.type==="TSTypeAnnotation")&&Re(r.typeAnnotation.typeAnnotation)||r.type==="FunctionTypeParam"&&Re(r.typeAnnotation)&&r!==e.rest||r.type==="AssignmentPattern"&&(r.left.type==="ObjectPattern"||r.left.type==="ArrayPattern")&&(r.right.type==="Identifier"||se(r.right)&&r.right.properties.length===0||U(r.right)&&r.right.elements.length===0))}function ol(e){let t;return e.returnType?(t=e.returnType,t.typeAnnotation&&(t=t.typeAnnotation)):e.typeAnnotation&&(t=e.typeAnnotation),t}function ot(e,t){var s;let r=ol(e);if(!r)return!1;let n=(s=e.typeParameters)==null?void 0:s.params;if(n){if(n.length>1)return!1;if(n.length===1){let u=n[0];if(u.constraint||u.default)return!1}}return z(e).length===1&&(Re(r)||re(t))}function pl(e){return e.match(t=>t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement",(t,r)=>{if(t.type==="CallExpression"&&r==="arguments"&&t.arguments.length===1&&t.callee.type==="CallExpression"){let n=t.callee.callee;return n.type==="Identifier"||n.type==="MemberExpression"&&!n.computed&&n.object.type==="Identifier"&&n.property.type==="Identifier"}return!1},(t,r)=>t.type==="VariableDeclarator"&&r==="init"||t.type==="ExportDefaultDeclaration"&&r==="declaration"||t.type==="TSExportAssignment"&&r==="expression"||t.type==="AssignmentExpression"&&r==="right"&&t.left.type==="MemberExpression"&&t.left.object.type==="Identifier"&&t.left.object.name==="module"&&t.left.property.type==="Identifier"&&t.left.property.name==="exports",t=>t.type!=="VariableDeclaration"||t.kind==="const"&&t.declarations.length===1)}function qi(e){let t=z(e);return t.length>1&&t.some(r=>r.type==="TSParameterProperty")}var cl=R(["VoidTypeAnnotation","TSVoidKeyword","NullLiteralTypeAnnotation","TSNullKeyword"]),ll=R(["ObjectTypeAnnotation","TSTypeLiteral","GenericTypeAnnotation","TSTypeReference"]);function ml(e){let{types:t}=e;if(t.some(n=>T(n)))return!1;let r=t.find(n=>ll(n));return r?t.every(n=>n===r||cl(n)):!1}function hs(e){return qt(e)||Re(e)?!0:we(e)?ml(e):!1}function Wi(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[K(e),"opaque type ",r("id"),r("typeParameters")];return s.supertype&&u.push(": ",r("supertype")),s.impltype&&u.push(" = ",r("impltype")),u.push(n),u}function Zr(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[K(e)];u.push("type ",r("id"),r("typeParameters"));let i=s.type==="TSTypeAliasDeclaration"?"typeAnnotation":"right";return[ht(e,t,r,u," =",i),n]}function en(e,t,r){let n=!1;return l(e.map(({isFirst:s,previous:u,node:i,index:a})=>{let o=r();if(s)return o;let p=Re(i),y=Re(u);return y&&p?[" & ",n?f(o):o]:!y&&!p?t.experimentalOperatorPosition==="start"?f([x,"& ",o]):f([" &",x,o]):(a>1&&(n=!0),[" & ",a>1?f(o):o])},"types"))}function tn(e,t,r){let{node:n}=e,{parent:s}=e,u=s.type!=="TypeParameterInstantiation"&&(!Je(s)||!t.experimentalTernaries)&&s.type!=="TSTypeParameterInstantiation"&&s.type!=="GenericTypeAnnotation"&&s.type!=="TSTypeReference"&&s.type!=="TSTypeAssertion"&&s.type!=="TupleTypeAnnotation"&&s.type!=="TSTupleType"&&!(s.type==="FunctionTypeParam"&&!s.name&&e.grandparent.this!==s)&&!((s.type==="TypeAlias"||s.type==="VariableDeclarator"||s.type==="TSTypeAliasDeclaration")&&Le(t.originalText,n)),i=hs(n),a=e.map(y=>{let D=r();return i||(D=Be(2,D)),ye(y,D,t)},"types");if(i)return b(" | ",a);let o=u&&!Le(t.originalText,n),p=[B([o?x:"","| "]),b([x,"| "],a)];return ke(e,t)?l([f(p),E]):(s.type==="TupleTypeAnnotation"||s.type==="TSTupleType")&&s[s.type==="TupleTypeAnnotation"&&s.types?"types":"elementTypes"].length>1?l([f([B(["(",E]),p]),E,B(")")]):l(u?f(p):p)}function yl(e){var n;let{node:t,parent:r}=e;return t.type==="FunctionTypeAnnotation"&&(Or(r)||!((r.type==="ObjectTypeProperty"||r.type==="ObjectTypeInternalSlot")&&!r.variance&&!r.optional&&Pt(r,t)||r.type==="ObjectTypeCallProperty"||((n=e.getParentNode(2))==null?void 0:n.type)==="DeclareFunction"))}function rn(e,t,r){let{node:n}=e,s=[Vt(e)];(n.type==="TSConstructorType"||n.type==="TSConstructSignatureDeclaration")&&s.push("new ");let u=Ue(e,r,t,!1,!0),i=[];return n.type==="FunctionTypeAnnotation"?i.push(yl(e)?" => ":": ",r("returnType")):i.push(H(e,r,n.returnType?"returnType":"typeAnnotation")),ot(n,i)&&(u=l(u)),s.push(u,i),l(s)}function nn(e,t,r){return[r("objectType"),$(e),"[",r("indexType"),"]"]}function sn(e,t,r){return["infer ",r("typeParameter")]}function gs(e,t,r){let{node:n}=e;return[n.postfix?"":r,H(e,t),n.postfix?r:""]}function un(e,t,r){let{node:n}=e;return["...",...n.type==="TupleTypeSpreadElement"&&n.label?[r("label"),": "]:[],r("typeAnnotation")]}function an(e,t,r){let{node:n}=e;return[n.variance?r("variance"):"",r("label"),n.optional?"?":"",": ",r("elementType")]}var Dl=new WeakSet;function H(e,t,r="typeAnnotation"){let{node:{[r]:n}}=e;if(!n)return"";let s=!1;if(n.type==="TSTypeAnnotation"||n.type==="TypeAnnotation"){let u=e.call(Ni,r);(u==="=>"||u===":"&&T(n,h.Leading))&&(s=!0),Dl.add(n)}return s?[" ",t(r)]:t(r)}var Ni=e=>e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>(r==="returnType"||r==="typeAnnotation")&&(t.type==="TSFunctionType"||t.type==="TSConstructorType"))?"=>":e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>r==="typeAnnotation"&&(t.type==="TSJSDocNullableType"||t.type==="TSJSDocNonNullableType"||t.type==="TSTypePredicate"))||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareFunction")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareHook")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="bound"&&t.type==="TypeParameter"&&t.usesExtendsBound)?"":":";function on(e,t,r){let n=Ni(e);return n?[n," ",r("typeAnnotation")]:r("typeAnnotation")}function pn(e){return[e("elementType"),"[]"]}function cn({node:e},t){let r=e.type==="TSTypeQuery"?"exprName":"argument",n=e.type==="TypeofTypeAnnotation"||e.typeArguments?"typeArguments":"typeParameters";return["typeof ",t(r),t(n)]}function ln(e,t){let{node:r}=e;return[r.type==="TSTypePredicate"&&r.asserts?"asserts ":r.type==="TypePredicate"&&r.kind?`${r.kind} `:"",t("parameterName"),r.typeAnnotation?[" is ",H(e,t)]:""]}function $(e){let{node:t}=e;return!t.optional||t.type==="Identifier"&&t===e.parent.key?"":L(t)||W(t)&&t.computed||t.type==="OptionalIndexedAccessType"?"?.":"?"}function mn(e){return e.node.definite||e.match(void 0,(t,r)=>r==="id"&&t.type==="VariableDeclarator"&&t.definite)?"!":""}var fl=new Set(["DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","DeclareVariable","DeclareExportDeclaration","DeclareExportAllDeclaration","DeclareOpaqueType","DeclareTypeAlias","DeclareEnum","DeclareInterface"]);function K(e){let{node:t}=e;return t.declare||fl.has(t.type)&&e.parent.type!=="DeclareExportDeclaration"?"declare ":""}var El=new Set(["TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function Vt({node:e}){return e.abstract||El.has(e.type)?"abstract ":""}function tt(e,t,r){let n=e.node;return n.typeArguments?r("typeArguments"):n.typeParameters?r("typeParameters"):""}function Kr(e,t,r){return["::",r("callee")]}function ft(e,t,r){return e.type==="EmptyStatement"?";":e.type==="BlockStatement"||r?[" ",t]:f([x,t])}function yn(e,t){return["...",t("argument"),H(e,t)]}function $t(e){return e.accessibility?e.accessibility+" ":""}function Fl(e,t,r,n){let{node:s}=e,u=s.inexact?"...":"";return T(s,h.Dangling)?l([r,u,J(e,t,{indent:!0}),E,n]):[r,u,n]}function Kt(e,t,r){let{node:n}=e,s=[],u=n.type==="TupleExpression"?"#[":"[",i="]",a=n.type==="TupleTypeAnnotation"&&n.types?"types":n.type==="TSTupleType"||n.type==="TupleTypeAnnotation"?"elementTypes":"elements",o=n[a];if(o.length===0)s.push(Fl(e,t,u,i));else{let p=M(!1,o,-1),y=(p==null?void 0:p.type)!=="RestElement"&&!n.inexact,D=p===null,m=Symbol("array"),C=!t.__inJestEach&&o.length>1&&o.every((d,S,g)=>{let _=d==null?void 0:d.type;if(!U(d)&&!se(d))return!1;let v=g[S+1];if(v&&_!==v.type)return!1;let j=U(d)?"elements":"properties";return d[j]&&d[j].length>1}),c=As(n,t),A=y?D?",":oe(t)?c?B(",","",{groupId:m}):B(","):"":"";s.push(l([u,f([E,c?Al(e,t,r,A):[Cl(e,t,a,n.inexact,r),A],J(e,t)]),E,i],{shouldBreak:C,id:m}))}return s.push($(e),H(e,r)),s}function As(e,t){return U(e)&&e.elements.length>1&&e.elements.every(r=>r&&(Fe(r)||Rn(r)&&!T(r.argument))&&!T(r,h.Trailing|h.Line,n=>!Z(t.originalText,q(n),{backwards:!0})))}function Gi({node:e},{originalText:t}){let r=s=>_t(t,vt(t,s)),n=s=>t[s]===","?s:n(r(s+1));return jt(t,n(k(e)))}function Cl(e,t,r,n,s){let u=[];return e.each(({node:i,isLast:a})=>{u.push(i?l(s()):""),(!a||n)&&u.push([",",x,i&&Gi(e,t)?E:""])},r),n&&u.push("..."),u}function Al(e,t,r,n){let s=[];return e.each(({isLast:u,next:i})=>{s.push([r(),u?n:","]),u||s.push(Gi(e,t)?[F,F]:T(i,h.Leading|h.Line)?F:x)},"elements"),qr(s)}var Tl=/^[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/,dl=e=>Tl.test(e),Ui=dl;function xl(e){return e.length===1?e:e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")}var Et=xl;var Dn=new WeakMap;function Xi(e){return/^(?:\d+|\d+\.\d+)$/u.test(e)}function Yi(e,t){return t.parser==="json"||t.parser==="jsonc"||!te(e.key)||nt(fe(e.key),t).slice(1,-1)!==e.key.value?!1:!!(Ui(e.key.value)&&!(t.parser==="babel-ts"&&e.type==="ClassProperty"||t.parser==="typescript"&&e.type==="PropertyDefinition")||Xi(e.key.value)&&String(Number(e.key.value))===e.key.value&&e.type!=="ImportAttribute"&&(t.parser==="babel"||t.parser==="acorn"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree"))}function hl(e,t){let{key:r}=e.node;return(r.type==="Identifier"||Fe(r)&&Xi(Et(fe(r)))&&String(r.value)===Et(fe(r))&&!(t.parser==="typescript"||t.parser==="babel-ts"))&&(t.parser==="json"||t.parser==="jsonc"||t.quoteProps==="consistent"&&Dn.get(e.parent))}function Ft(e,t,r){let{node:n}=e;if(n.computed)return["[",r("key"),"]"];let{parent:s}=e,{key:u}=n;if(t.quoteProps==="consistent"&&!Dn.has(s)){let i=e.siblings.some(a=>!a.computed&&te(a.key)&&!Yi(a,t));Dn.set(s,i)}if(hl(e,t)){let i=nt(JSON.stringify(u.type==="Identifier"?u.name:u.value.toString()),t);return e.call(a=>ye(a,i,t),"key")}return Yi(n,t)&&(t.quoteProps==="as-needed"||t.quoteProps==="consistent"&&!Dn.get(s))?e.call(i=>ye(i,/^\d/u.test(u.value)?Et(u.value):u.value,t),"key"):r("key")}function fn(e,t,r){let{node:n}=e;return n.shorthand?r("value"):ht(e,t,r,Ft(e,t,r),":","value")}var gl=({node:e,key:t,parent:r})=>t==="value"&&e.type==="FunctionExpression"&&(r.type==="ObjectMethod"||r.type==="ClassMethod"||r.type==="ClassPrivateMethod"||r.type==="MethodDefinition"||r.type==="TSAbstractMethodDefinition"||r.type==="TSDeclareMethod"||r.type==="Property"&&kt(r));function En(e,t,r,n){if(gl(e))return Fn(e,r,t);let{node:s}=e,u=!1;if((s.type==="FunctionDeclaration"||s.type==="FunctionExpression")&&(n!=null&&n.expandLastArg)){let{parent:y}=e;L(y)&&(pe(y).length>1||z(s).every(D=>D.type==="Identifier"&&!D.typeAnnotation))&&(u=!0)}let i=[K(e),s.async?"async ":"",`function${s.generator?"*":""} `,s.id?t("id"):""],a=Ue(e,t,r,u),o=Qt(e,t),p=ot(s,o);return i.push(tt(e,r,t),l([p?l(a):a,o]),s.body?" ":"",t("body")),r.semi&&(s.declare||!s.body)&&i.push(";"),i}function Fr(e,t,r){let{node:n}=e,{kind:s}=n,u=n.value||n,i=[];return!s||s==="init"||s==="method"||s==="constructor"?u.async&&i.push("async "):(Mt.ok(s==="get"||s==="set"),i.push(s," ")),u.generator&&i.push("*"),i.push(Ft(e,t,r),n.optional||n.key.optional?"?":"",n===u?Fn(e,t,r):r("value")),i}function Fn(e,t,r){let{node:n}=e,s=Ue(e,r,t),u=Qt(e,r),i=qi(n),a=ot(n,u),o=[tt(e,t,r),l([i?l(s,{shouldBreak:!0}):a?l(s):s,u])];return n.body?o.push(" ",r("body")):o.push(t.semi?";":""),o}function Sl(e){let t=z(e);return t.length===1&&!e.typeParameters&&!T(e,h.Dangling)&&t[0].type==="Identifier"&&!t[0].typeAnnotation&&!T(t[0])&&!t[0].optional&&!e.predicate&&!e.returnType}function Cn(e,t){if(t.arrowParens==="always")return!1;if(t.arrowParens==="avoid"){let{node:r}=e;return Sl(r)}return!1}function Qt(e,t){let{node:r}=e,s=[H(e,t,"returnType")];return r.predicate&&s.push(t("predicate")),s}function Hi(e,t,r){let{node:n}=e,s=t.semi?";":"",u=[];if(n.argument){let o=r("argument");Bl(t,n.argument)?o=["(",f([F,o]),F,")"]:(De(n.argument)||n.argument.type==="SequenceExpression"||t.experimentalTernaries&&n.argument.type==="ConditionalExpression"&&(n.argument.consequent.type==="ConditionalExpression"||n.argument.alternate.type==="ConditionalExpression"))&&(o=l([B("("),f([E,o]),E,B(")")])),u.push(" ",o)}let i=T(n,h.Dangling),a=s&&i&&T(n,h.Last|h.Line);return a&&u.push(s),i&&u.push(" ",J(e,t)),a||u.push(s),u}function Vi(e,t,r){return["return",Hi(e,t,r)]}function $i(e,t,r){return["throw",Hi(e,t,r)]}function Bl(e,t){if(Le(e.originalText,t)||T(t,h.Leading,r=>de(e.originalText,q(r),k(r)))&&!X(t))return!0;if(Jt(t)){let r=t,n;for(;n=pu(r);)if(r=n,Le(e.originalText,r))return!0}return!1}var Ss=new WeakMap;function Ki(e){return Ss.has(e)||Ss.set(e,e.type==="ConditionalExpression"&&!ae(e,t=>t.type==="ObjectExpression")),Ss.get(e)}var Qi=e=>e.type==="SequenceExpression";function zi(e,t,r,n={}){let s=[],u,i=[],a=!1,o=!n.expandLastArg&&e.node.body.type==="ArrowFunctionExpression",p;(function S(){let{node:g}=e,_=bl(e,t,r,n);if(s.length===0)s.push(_);else{let{leading:v,trailing:j}=ms(e,t);s.push([v,_]),i.unshift(j)}o&&(a||(a=g.returnType&&z(g).length>0||g.typeParameters||z(g).some(v=>v.type!=="Identifier"))),!o||g.body.type!=="ArrowFunctionExpression"?(u=r("body",n),p=g.body):e.call(S,"body")})();let y=!Le(t.originalText,p)&&(Qi(p)||Pl(p,u,t)||!a&&Ki(p)),D=e.key==="callee"&&mt(e.parent),m=Symbol("arrow-chain"),C=kl(e,n,{signatureDocs:s,shouldBreak:a}),c=!1,A=!1,d=!1;return o&&(D||n.assignmentLayout)&&(A=!0,d=!T(e.node,h.Leading&h.Line),c=n.assignmentLayout==="chain-tail-arrow-chain"||D&&!y),u=Il(e,t,n,{bodyDoc:u,bodyComments:i,functionBody:p,shouldPutBodyOnSameLine:y}),l([l(A?f([d?E:"",C]):C,{shouldBreak:c,id:m})," =>",o?xt(u,{groupId:m}):l(u),o&&D?B(E,"",{groupId:m}):""])}function bl(e,t,r,n){let{node:s}=e,u=[];if(s.async&&u.push("async "),Cn(e,t))u.push(r(["params",0]));else{let a=n.expandLastArg||n.expandFirstArg,o=Qt(e,r);if(a){if(re(o))throw new Dt;o=l(cr(o))}u.push(l([Ue(e,r,t,a,!0),o]))}let i=J(e,t,{filter(a){let o=it(t.originalText,k(a));return o!==!1&&t.originalText.slice(o,o+2)==="=>"}});return i&&u.push(" ",i),u}function Pl(e,t,r){var n,s;return U(e)||se(e)||e.type==="ArrowFunctionExpression"||e.type==="DoExpression"||e.type==="BlockStatement"||X(e)||((n=t.label)==null?void 0:n.hug)!==!1&&(((s=t.label)==null?void 0:s.embed)||_r(e,r.originalText))}function kl(e,t,{signatureDocs:r,shouldBreak:n}){if(r.length===1)return r[0];let{parent:s,key:u}=e;return u!=="callee"&&mt(s)||De(s)?l([r[0]," =>",f([x,b([" =>",x],r.slice(1))])],{shouldBreak:n}):u==="callee"&&mt(s)||t.assignmentLayout?l(b([" =>",x],r),{shouldBreak:n}):l(f(b([" =>",x],r)),{shouldBreak:n})}function Il(e,t,r,{bodyDoc:n,bodyComments:s,functionBody:u,shouldPutBodyOnSameLine:i}){let{node:a,parent:o}=e,p=r.expandLastArg&&oe(t,"all")?B(","):"",y=(r.expandLastArg||o.type==="JSXExpressionContainer")&&!T(a)?E:"";return i&&Ki(u)?[" ",l([B("","("),f([E,n]),B("",")"),p,y]),s]:(Qi(u)&&(n=l(["(",f([E,n]),E,")"])),i?[" ",n,s]:[f([x,n,s]),p,y])}var Ll=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let s=t[n];if(r(s,n,t))return s}}},Zi=Ll;function Cr(e,t,r,n){let{node:s}=e,u=[],i=Zi(!1,s[n],a=>a.type!=="EmptyStatement");return e.each(({node:a})=>{a.type!=="EmptyStatement"&&(u.push(r()),a!==i&&(u.push(F),ce(a,t)&&u.push(F)))},n),u}function An(e,t,r){let n=wl(e,t,r),{node:s,parent:u}=e;if(s.type==="Program"&&(u==null?void 0:u.type)!=="ModuleExpression")return n?[n,F]:"";let i=[];if(s.type==="StaticBlock"&&i.push("static "),i.push("{"),n)i.push(f([F,n]),F);else{let a=e.grandparent;u.type==="ArrowFunctionExpression"||u.type==="FunctionExpression"||u.type==="FunctionDeclaration"||u.type==="ComponentDeclaration"||u.type==="HookDeclaration"||u.type==="ObjectMethod"||u.type==="ClassMethod"||u.type==="ClassPrivateMethod"||u.type==="ForStatement"||u.type==="WhileStatement"||u.type==="DoWhileStatement"||u.type==="DoExpression"||u.type==="ModuleExpression"||u.type==="CatchClause"&&!a.finalizer||u.type==="TSModuleDeclaration"||s.type==="StaticBlock"||i.push(F)}return i.push("}"),i}function wl(e,t,r){let{node:n}=e,s=O(n.directives),u=n.body.some(o=>o.type!=="EmptyStatement"),i=T(n,h.Dangling);if(!s&&!u&&!i)return"";let a=[];return s&&(a.push(Cr(e,t,r,"directives")),(u||i)&&(a.push(F),ce(M(!1,n.directives,-1),t)&&a.push(F))),u&&a.push(Cr(e,t,r,"body")),i&&a.push(J(e,t)),a}function Ol(e){let t=new WeakMap;return function(r){return t.has(r)||t.set(r,Symbol(e)),t.get(r)}}var Tn=Ol;function _l(e){switch(e){case null:return"";case"PlusOptional":return"+?";case"MinusOptional":return"-?";case"Optional":return"?"}}function ea(e,t,r){let{node:n}=e;return l([n.variance?r("variance"):"","[",f([r("keyTparam")," in ",r("sourceType")]),"]",_l(n.optional),": ",r("propType")])}function Bs(e,t){return e==="+"||e==="-"?e+t:t}function ta(e,t,r){let{node:n}=e,s=t.objectWrap==="preserve"&&de(t.originalText,q(n),q(n.typeParameter));return l(["{",f([t.bracketSpacing?x:E,l([r("typeParameter"),n.optional?Bs(n.optional,"?"):"",n.typeAnnotation?": ":"",r("typeAnnotation")]),t.semi?B(";"):""]),J(e,t),t.bracketSpacing?x:E,"}"],{shouldBreak:s})}var Ar=Tn("typeParameters");function vl(e,t,r){let{node:n}=e;return z(n).length===1&&n.type.startsWith("TS")&&!n[r][0].constraint&&e.parent.type==="ArrowFunctionExpression"&&!(t.filepath&&/\.ts$/u.test(t.filepath))}function Ot(e,t,r,n){let{node:s}=e;if(!s[n])return"";if(!Array.isArray(s[n]))return r(n);let u=It(e.grandparent),i=e.match(p=>!(p[n].length===1&&Re(p[n][0])),void 0,(p,y)=>y==="typeAnnotation",p=>p.type==="Identifier",ds);if(s[n].length===0||!i&&(u||s[n].length===1&&(s[n][0].type==="NullableTypeAnnotation"||hs(s[n][0]))))return["<",b(", ",e.map(r,n)),jl(e,t),">"];let o=s.type==="TSTypeParameterInstantiation"?"":vl(e,t,n)?",":oe(t)?B(","):"";return l(["<",f([E,b([",",x],e.map(r,n))]),o,E,">"],{id:Ar(s)})}function jl(e,t){let{node:r}=e;if(!T(r,h.Dangling))return"";let n=!T(r,h.Line),s=J(e,t,{indent:!n});return n?s:[s,F]}function dn(e,t,r){let{node:n,parent:s}=e,u=[n.const?"const ":""],i=n.type==="TSTypeParameter"?r("name"):n.name;if(s.type==="TSMappedType")return s.readonly&&u.push(Bs(s.readonly,"readonly")," "),u.push("[",i),n.constraint&&u.push(" in ",r("constraint")),s.nameType&&u.push(" as ",e.callParent(()=>r("nameType"))),u.push("]"),u;if(n.variance&&u.push(r("variance")),n.in&&u.push("in "),n.out&&u.push("out "),u.push(i),n.bound&&(n.usesExtendsBound&&u.push(" extends "),u.push(H(e,r,"bound"))),n.constraint){let a=Symbol("constraint");u.push(" extends",l(f(x),{id:a}),je,xt(r("constraint"),{groupId:a}))}return n.default&&u.push(" = ",r("default")),l(u)}var ra=R(["ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function xn(e,t,r){let{node:n}=e,s=[K(e),Vt(e),"class"],u=T(n.id,h.Trailing)||T(n.typeParameters,h.Trailing)||T(n.superClass)||O(n.extends)||O(n.mixins)||O(n.implements),i=[],a=[];if(n.id&&i.push(" ",r("id")),i.push(r("typeParameters")),n.superClass){let y=[Rl(e,t,r),r(n.superTypeArguments?"superTypeArguments":"superTypeParameters")],D=e.call(m=>["extends ",ye(m,y,t)],"superClass");u?a.push(x,l(D)):a.push(" ",D)}else a.push(bs(e,t,r,"extends"));a.push(bs(e,t,r,"mixins"),bs(e,t,r,"implements"));let o;if(u){let y;ua(n)?y=[...i,f(a)]:y=f([...i,a]),o=na(n),s.push(l(y,{id:o}))}else s.push(...i,...a);let p=n.body;return u&&O(p.body)?s.push(B(F," ",{groupId:o})):s.push(" "),s.push(r("body")),s}var na=Tn("heritageGroup");function sa(e){return B(F,"",{groupId:na(e)})}function Ml(e){return["extends","mixins","implements"].reduce((t,r)=>t+(Array.isArray(e[r])?e[r].length:0),e.superClass?1:0)>1}function ua(e){return e.typeParameters&&!T(e.typeParameters,h.Trailing|h.Line)&&!Ml(e)}function bs(e,t,r,n){let{node:s}=e;if(!O(s[n]))return"";let u=J(e,t,{marker:n});return[ua(s)?B(" ",x,{groupId:Ar(s.typeParameters)}):x,u,u&&F,n,l(f([x,b([",",x],e.map(r,n))]))]}function Rl(e,t,r){let n=r("superClass"),{parent:s}=e;return s.type==="AssignmentExpression"?l(B(["(",f([E,n]),E,")"],n)):n}function hn(e,t,r){let{node:n}=e,s=[];return O(n.decorators)&&s.push(Cs(e,t,r)),s.push($t(n)),n.static&&s.push("static "),s.push(Vt(e)),n.override&&s.push("override "),s.push(Fr(e,t,r)),s}function gn(e,t,r){let{node:n}=e,s=[],u=t.semi?";":"";O(n.decorators)&&s.push(Cs(e,t,r)),s.push(K(e),$t(n)),n.static&&s.push("static "),s.push(Vt(e)),n.override&&s.push("override "),n.readonly&&s.push("readonly "),n.variance&&s.push(r("variance")),(n.type==="ClassAccessorProperty"||n.type==="AccessorProperty"||n.type==="TSAbstractAccessorProperty")&&s.push("accessor "),s.push(Ft(e,t,r),$(e),mn(e),H(e,r));let i=n.type==="TSAbstractPropertyDefinition"||n.type==="TSAbstractAccessorProperty";return[ht(e,t,r,s," =",i?void 0:"value"),u]}function ia(e,t,r){let{node:n}=e,s=[];return e.each(({node:u,next:i,isLast:a})=>{s.push(r()),!t.semi&&ra(u)&&Jl(u,i)&&s.push(";"),a||(s.push(F),ce(u,t)&&s.push(F))},"body"),T(n,h.Dangling)&&s.push(J(e,t)),["{",s.length>0?[f([F,s]),F]:"","}"]}function Jl(e,t){var s;let{type:r,name:n}=e.key;if(!e.computed&&r==="Identifier"&&(n==="static"||n==="get"||n==="set")&&!e.value&&!e.typeAnnotation)return!0;if(!t||t.static||t.accessibility||t.readonly)return!1;if(!t.computed){let u=(s=t.key)==null?void 0:s.name;if(u==="in"||u==="instanceof")return!0}if(ra(t)&&t.variance&&!t.static&&!t.declare)return!0;switch(t.type){case"ClassProperty":case"PropertyDefinition":case"TSAbstractPropertyDefinition":return t.computed;case"MethodDefinition":case"TSAbstractMethodDefinition":case"ClassMethod":case"ClassPrivateMethod":{if((t.value?t.value.async:t.async)||t.kind==="get"||t.kind==="set")return!1;let i=t.value?t.value.generator:t.generator;return!!(t.computed||i)}case"TSIndexSignature":return!0}return!1}var ql=R(["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"]);function Ps(e){return ql(e)?Ps(e.expression):e}var aa=R(["FunctionExpression","ArrowFunctionExpression"]);function oa(e){return e.type==="MemberExpression"||e.type==="OptionalMemberExpression"||e.type==="Identifier"&&e.name!=="undefined"}function pa(e,t){if(t.semi||ks(e,t)||Is(e,t))return!1;let{node:r,key:n,parent:s}=e;return!!(r.type==="ExpressionStatement"&&(n==="body"&&(s.type==="Program"||s.type==="BlockStatement"||s.type==="StaticBlock"||s.type==="TSModuleBlock")||n==="consequent"&&s.type==="SwitchCase")&&e.call(()=>ca(e,t),"expression"))}function ca(e,t){let{node:r}=e;switch(r.type){case"ParenthesizedExpression":case"TypeCastExpression":case"ArrayExpression":case"ArrayPattern":case"TemplateLiteral":case"TemplateElement":case"RegExpLiteral":return!0;case"ArrowFunctionExpression":if(!Cn(e,t))return!0;break;case"UnaryExpression":{let{prefix:n,operator:s}=r;if(n&&(s==="+"||s==="-"))return!0;break}case"BindExpression":if(!r.object)return!0;break;case"Literal":if(r.regex)return!0;break;default:if(X(r))return!0}return ke(e,t)?!0:Jt(r)?e.call(()=>ca(e,t),...Lr(r)):!1}function ks({node:e,parent:t},r){return(r.parentParser==="markdown"||r.parentParser==="mdx")&&e.type==="ExpressionStatement"&&X(e.expression)&&t.type==="Program"&&t.body.length===1}function Is({node:e,parent:t},r){return(r.parser==="__vue_event_binding"||r.parser==="__vue_ts_event_binding")&&e.type==="ExpressionStatement"&&t.type==="Program"&&t.body.length===1}function la(e,t,r){let n=[r("expression")];if(Is(e,t)){let s=Ps(e.node.expression);(aa(s)||oa(s))&&n.push(";")}else ks(e,t)||t.semi&&n.push(";");return n}function ma(e,t,r){if(t.__isVueBindings||t.__isVueForBindingLeft){let n=e.map(r,"program","body",0,"params");if(n.length===1)return n[0];let s=b([",",x],n);return t.__isVueForBindingLeft?["(",f([E,l(s)]),E,")"]:s}if(t.__isEmbeddedTypescriptGenericParameters){let n=e.map(r,"program","body",0,"typeParameters","params");return b([",",x],n)}}function fa(e,t){let{node:r}=e;switch(r.type){case"RegExpLiteral":return ya(r);case"BigIntLiteral":return Sn(r.extra.raw);case"NumericLiteral":return Et(r.extra.raw);case"StringLiteral":return ve(nt(r.extra.raw,t));case"NullLiteral":return"null";case"BooleanLiteral":return String(r.value);case"DirectiveLiteral":return Da(r.extra.raw,t);case"Literal":{if(r.regex)return ya(r.regex);if(r.bigint)return Sn(r.raw);let{value:n}=r;return typeof n=="number"?Et(r.raw):typeof n=="string"?Wl(e)?Da(r.raw,t):ve(nt(r.raw,t)):String(n)}}}function Wl(e){if(e.key!=="expression")return;let{parent:t}=e;return t.type==="ExpressionStatement"&&t.directive}function Sn(e){return e.toLowerCase()}function ya({pattern:e,flags:t}){return t=[...t].sort().join(""),`/${e}/${t}`}function Da(e,t){let r=e.slice(1,-1);if(r.includes('"')||r.includes("'"))return e;let n=t.singleQuote?"'":'"';return n+r+n}function Nl(e,t,r){let n=e.originalText.slice(t,r);for(let s of e[Symbol.for("comments")]){let u=q(s);if(u>r)break;let i=k(s);if(ie.type==="ExportDefaultDeclaration"||e.type==="DeclareExportDeclaration"&&e.default;function Bn(e,t,r){let{node:n}=e,s=[Si(e,t,r),K(e),"export",Fa(n)?" default":""],{declaration:u,exported:i}=n;return T(n,h.Dangling)&&(s.push(" ",J(e,t)),vr(n)&&s.push(F)),u?s.push(" ",r("declaration")):(s.push(Yl(n)),n.type==="ExportAllDeclaration"||n.type==="DeclareExportAllDeclaration"?(s.push(" *"),i&&s.push(" as ",r("exported"))):s.push(Aa(e,t,r)),s.push(Ca(e,t,r),da(e,t,r))),s.push(Ul(n,t)),s}var Gl=R(["ClassDeclaration","ComponentDeclaration","FunctionDeclaration","TSInterfaceDeclaration","DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","HookDeclaration","TSDeclareFunction","EnumDeclaration"]);function Ul(e,t){return t.semi&&(!e.declaration||Fa(e)&&!Gl(e.declaration))?";":""}function ws(e,t=!0){return e&&e!=="value"?`${t?" ":""}${e}${t?"":" "}`:""}function Os(e,t){return ws(e.importKind,t)}function Yl(e){return ws(e.exportKind)}function Ca(e,t,r){let{node:n}=e;if(!n.source)return"";let s=[];return Ta(n,t)&&s.push(" from"),s.push(" ",r("source")),s}function Aa(e,t,r){let{node:n}=e;if(!Ta(n,t))return"";let s=[" "];if(O(n.specifiers)){let u=[],i=[];e.each(()=>{let a=e.node.type;if(a==="ExportNamespaceSpecifier"||a==="ExportDefaultSpecifier"||a==="ImportNamespaceSpecifier"||a==="ImportDefaultSpecifier")u.push(r());else if(a==="ExportSpecifier"||a==="ImportSpecifier")i.push(r());else throw new Ne(n,"specifier")},"specifiers"),s.push(b(", ",u)),i.length>0&&(u.length>0&&s.push(", "),i.length>1||u.length>0||n.specifiers.some(o=>T(o))?s.push(l(["{",f([t.bracketSpacing?x:E,b([",",x],i)]),B(oe(t)?",":""),t.bracketSpacing?x:E,"}"])):s.push(["{",t.bracketSpacing?" ":"",...i,t.bracketSpacing?" ":"","}"]))}else s.push("{}");return s}function Ta(e,t){return e.type!=="ImportDeclaration"||O(e.specifiers)||e.importKind==="type"?!0:Ls(t,q(e),q(e.source)).trimEnd().endsWith("from")}function Xl(e,t){var n,s;if((n=e.extra)!=null&&n.deprecatedAssertSyntax)return"assert";let r=Ls(t,k(e.source),(s=e.attributes)!=null&&s[0]?q(e.attributes[0]):k(e)).trimStart();return r.startsWith("assert")?"assert":r.startsWith("with")||O(e.attributes)?"with":void 0}function da(e,t,r){let{node:n}=e;if(!n.source)return"";let s=Xl(n,t);if(!s)return"";let u=[` ${s} {`];return O(n.attributes)&&(t.bracketSpacing&&u.push(" "),u.push(b(", ",e.map(r,"attributes"))),t.bracketSpacing&&u.push(" ")),u.push("}"),u}function xa(e,t,r){let{node:n}=e,{type:s}=n,u=s.startsWith("Import"),i=u?"imported":"local",a=u?"local":"exported",o=n[i],p=n[a],y="",D="";return s==="ExportNamespaceSpecifier"||s==="ImportNamespaceSpecifier"?y="*":o&&(y=r(i)),p&&!Hl(n)&&(D=r(a)),[ws(s==="ImportSpecifier"?n.importKind:n.exportKind,!1),y,y&&D?" as ":"",D]}function Hl(e){if(e.type!=="ImportSpecifier"&&e.type!=="ExportSpecifier")return!1;let{local:t,[e.type==="ImportSpecifier"?"imported":"exported"]:r}=e;if(t.type!==r.type||!su(t,r))return!1;if(te(t))return t.value===r.value&&fe(t)===fe(r);switch(t.type){case"Identifier":return t.name===r.name;default:return!1}}function gt(e,t,r){var j;let n=t.semi?";":"",{node:s}=e,u=s.type==="ObjectTypeAnnotation",i=s.type==="TSEnumDeclaration"||s.type==="EnumBooleanBody"||s.type==="EnumNumberBody"||s.type==="EnumBigIntBody"||s.type==="EnumStringBody"||s.type==="EnumSymbolBody",a=[s.type==="TSTypeLiteral"||i?"members":s.type==="TSInterfaceBody"?"body":"properties"];u&&a.push("indexers","callProperties","internalSlots");let o=a.flatMap(I=>e.map(({node:G})=>({node:G,printed:r(),loc:q(G)}),I));a.length>1&&o.sort((I,G)=>I.loc-G.loc);let{parent:p,key:y}=e,D=u&&y==="body"&&(p.type==="InterfaceDeclaration"||p.type==="DeclareInterface"||p.type==="DeclareClass"),m=s.type==="TSInterfaceBody"||i||D||s.type==="ObjectPattern"&&p.type!=="FunctionDeclaration"&&p.type!=="FunctionExpression"&&p.type!=="ArrowFunctionExpression"&&p.type!=="ObjectMethod"&&p.type!=="ClassMethod"&&p.type!=="ClassPrivateMethod"&&p.type!=="AssignmentPattern"&&p.type!=="CatchClause"&&s.properties.some(I=>I.value&&(I.value.type==="ObjectPattern"||I.value.type==="ArrayPattern"))||s.type!=="ObjectPattern"&&t.objectWrap==="preserve"&&o.length>0&&de(t.originalText,q(s),o[0].loc),C=D?";":s.type==="TSInterfaceBody"||s.type==="TSTypeLiteral"?B(n,";"):",",c=s.type==="RecordExpression"?"#{":s.exact?"{|":"{",A=s.exact?"|}":"}",d=[],S=o.map(I=>{let G=[...d,l(I.printed)];return d=[C,x],(I.node.type==="TSPropertySignature"||I.node.type==="TSMethodSignature"||I.node.type==="TSConstructSignatureDeclaration"||I.node.type==="TSCallSignatureDeclaration")&&T(I.node,h.PrettierIgnore)&&d.shift(),ce(I.node,t)&&d.push(F),G});if(s.inexact||s.hasUnknownMembers){let I;if(T(s,h.Dangling)){let G=T(s,h.Line);I=[J(e,t),G||Z(t.originalText,k(M(!1,lt(s),-1)))?F:x,"..."]}else I=["..."];S.push([...d,...I])}let g=(j=M(!1,o,-1))==null?void 0:j.node,_=!(s.inexact||s.hasUnknownMembers||g&&(g.type==="RestElement"||(g.type==="TSPropertySignature"||g.type==="TSCallSignatureDeclaration"||g.type==="TSMethodSignature"||g.type==="TSConstructSignatureDeclaration")&&T(g,h.PrettierIgnore))),v;if(S.length===0){if(!T(s,h.Dangling))return[c,A,H(e,r)];v=l([c,J(e,t,{indent:!0}),E,A,$(e),H(e,r)])}else v=[D&&O(s.properties)?sa(p):"",c,f([t.bracketSpacing?x:E,...S]),B(_&&(C!==","||oe(t))?C:""),t.bracketSpacing?x:E,A,$(e),H(e,r)];return e.match(I=>I.type==="ObjectPattern"&&!O(I.decorators),_s)||Re(s)&&(e.match(void 0,(I,G)=>G==="typeAnnotation",(I,G)=>G==="typeAnnotation",_s)||e.match(void 0,(I,G)=>I.type==="FunctionTypeParam"&&G==="typeAnnotation",_s))||!m&&e.match(I=>I.type==="ObjectPattern",I=>I.type==="AssignmentExpression"||I.type==="VariableDeclarator")?v:l(v,{shouldBreak:m})}function _s(e,t){return(t==="params"||t==="parameters"||t==="this"||t==="rest")&&xs(e)}function Vl(e){let t=[e];for(let r=0;rm[N]===n),c=m.type===n.type&&!C,A,d,S=0;do d=A||n,A=e.getParentNode(S),S++;while(A&&A.type===n.type&&a.every(N=>A[N]!==d));let g=A||m,_=d;if(s&&(X(n[a[0]])||X(o)||X(p)||Vl(_))){D=!0,c=!0;let N=Q=>[B("("),f([E,Q]),E,B(")")],ue=Q=>Q.type==="NullLiteral"||Q.type==="Literal"&&Q.value===null||Q.type==="Identifier"&&Q.name==="undefined";y.push(" ? ",ue(o)?r(u):N(r(u))," : ",p.type===n.type||ue(p)?r(i):N(r(i)))}else{let N=Q=>t.useTabs?f(r(Q)):Be(2,r(Q)),ue=[x,"? ",o.type===n.type?B("","("):"",N(u),o.type===n.type?B("",")"):"",x,": ",N(i)];y.push(m.type!==n.type||m[i]===n||C?ue:t.useTabs?Jr(f(ue)):Be(Math.max(0,t.tabWidth-2),ue))}let v=[u,i,...a].some(N=>T(n[N],ue=>ee(ue)&&de(t.originalText,q(ue),k(ue)))),j=N=>m===g?l(N,{shouldBreak:v}):v?[N,Ee]:N,I=!D&&(W(m)||m.type==="NGPipeExpression"&&m.left===n)&&!m.computed,G=Ql(e),P=j([$l(e,t,r),c?y:f(y),s&&I&&!G?E:""]);return C||G?l([f([E,P]),E]):P}function zl(e,t){return(W(t)||t.type==="NGPipeExpression"&&t.left===e)&&!t.computed}function Zl(e,t,r,n){return[...e.map(u=>lt(u)),lt(t),lt(r)].flat().some(u=>ee(u)&&de(n.originalText,q(u),k(u)))}var em=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function tm(e){let{node:t}=e;if(t.type!=="ConditionalExpression")return!1;let r,n=t;for(let s=0;!r;s++){let u=e.getParentNode(s);if(u.type==="ChainExpression"&&u.expression===n||L(u)&&u.callee===n||W(u)&&u.object===n||u.type==="TSNonNullExpression"&&u.expression===n){n=u;continue}u.type==="NewExpression"&&u.callee===n||Ae(u)&&u.expression===n?(r=e.getParentNode(s+1),n=u):r=u}return n===t?!1:r[em.get(r.type)]===n}var vs=e=>[B("("),f([E,e]),E,B(")")];function zt(e,t,r,n){if(!t.experimentalTernaries)return ha(e,t,r);let{node:s}=e,u=s.type==="ConditionalExpression",i=Je(s),a=u?"consequent":"trueType",o=u?"alternate":"falseType",p=u?["test"]:["checkType","extendsType"],y=s[a],D=s[o],m=p.map(Ye=>s[Ye]),{parent:C}=e,c=C.type===s.type,A=c&&p.some(Ye=>C[Ye]===s),d=c&&C[o]===s,S=y.type===s.type,g=D.type===s.type,_=g||d,v=t.tabWidth>2||t.useTabs,j,I,G=0;do I=j||s,j=e.getParentNode(G),G++;while(j&&j.type===s.type&&p.every(Ye=>j[Ye]!==I));let P=j||C,N=n&&n.assignmentLayout&&n.assignmentLayout!=="break-after-operator"&&(C.type==="AssignmentExpression"||C.type==="VariableDeclarator"||C.type==="ClassProperty"||C.type==="PropertyDefinition"||C.type==="ClassPrivateProperty"||C.type==="ObjectProperty"||C.type==="Property"),ue=(C.type==="ReturnStatement"||C.type==="ThrowStatement")&&!(S||g),Q=u&&P.type==="JSXExpressionContainer"&&e.grandparent.type!=="JSXAttribute",Bt=tm(e),Ct=zl(s,C),w=i&&ke(e,t),ne=v?t.useTabs?" ":" ".repeat(t.tabWidth-1):"",xe=Zl(m,y,D,t)||S||g,pt=!_&&!c&&!i&&(Q?y.type==="NullLiteral"||y.type==="Literal"&&y.value===null:ir(y,t)&&qn(s.test,3)),bt=_||d||i&&!c||c&&u&&qn(s.test,1)||pt,Rs=[];!S&&T(y,h.Dangling)&&e.call(Ye=>{Rs.push(J(Ye,t),F)},"consequent");let er=[];T(s.test,h.Dangling)&&e.call(Ye=>{er.push(J(Ye,t))},"test"),!g&&T(D,h.Dangling)&&e.call(Ye=>{er.push(J(Ye,t))},"alternate"),T(s,h.Dangling)&&er.push(J(e,t));let Js=Symbol("test"),Ga=Symbol("consequent"),Tr=Symbol("test-and-consequent"),Ua=u?[vs(r("test")),s.test.type==="ConditionalExpression"?Ee:""]:[r("checkType")," ","extends"," ",Je(s.extendsType)||s.extendsType.type==="TSMappedType"?r("extendsType"):l(vs(r("extendsType")))],qs=l([Ua," ?"],{id:Js}),Ya=r(a),dr=f([S||Q&&(X(y)||c||_)?F:x,Rs,Ya]),Xa=bt?l([qs,_?dr:B(dr,l(dr,{id:Ga}),{groupId:Js})],{id:Tr}):[qs,dr],Ln=r(o),Ws=pt?B(Ln,Jr(vs(Ln)),{groupId:Tr}):Ln,tr=[Xa,er.length>0?[f([F,er]),F]:g?F:pt?B(x," ",{groupId:Tr}):x,":",g?" ":v?bt?B(ne,B(_||pt?" ":ne," "),{groupId:Tr}):B(ne," "):" ",g?Ws:l([f(Ws),Q&&!pt?E:""]),Ct&&!Bt?E:"",xe?Ee:""];return N&&!xe?l(f([E,l(tr)])):N||ue?l(f(tr)):Bt||i&&A?l([f([E,tr]),w?E:""]):C===P?l(tr):tr}function ga(e,t,r,n){let{node:s}=e;if(wr(s))return fa(e,t);let u=t.semi?";":"",i=[];switch(s.type){case"JsExpressionRoot":return r("node");case"JsonRoot":return[r("node"),F];case"File":return ma(e,t,r)??r("program");case"EmptyStatement":return"";case"ExpressionStatement":return la(e,t,r);case"ChainExpression":return r("expression");case"ParenthesizedExpression":return!T(s.expression)&&(se(s.expression)||U(s.expression))?["(",r("expression"),")"]:l(["(",f([E,r("expression")]),E,")"]);case"AssignmentExpression":return ji(e,t,r);case"VariableDeclarator":return Mi(e,t,r);case"BinaryExpression":case"LogicalExpression":return $r(e,t,r);case"AssignmentPattern":return[r("left")," = ",r("right")];case"OptionalMemberExpression":case"MemberExpression":return Li(e,t,r);case"MetaProperty":return[r("meta"),".",r("property")];case"BindExpression":return s.object&&i.push(r("object")),i.push(l(f([E,Kr(e,t,r)]))),i;case"Identifier":return[s.name,$(e),mn(e),H(e,r)];case"V8IntrinsicIdentifier":return["%",s.name];case"SpreadElement":case"SpreadElementPattern":case"SpreadPropertyPattern":case"RestElement":return yn(e,r);case"FunctionDeclaration":case"FunctionExpression":return En(e,r,t,n);case"ArrowFunctionExpression":return zi(e,t,r,n);case"YieldExpression":return i.push("yield"),s.delegate&&i.push("*"),s.argument&&i.push(" ",r("argument")),i;case"AwaitExpression":if(i.push("await"),s.argument){i.push(" ",r("argument"));let{parent:a}=e;if(L(a)&&a.callee===s||W(a)&&a.object===s){i=[f([E,...i]),E];let o=e.findAncestor(p=>p.type==="AwaitExpression"||p.type==="BlockStatement");if((o==null?void 0:o.type)!=="AwaitExpression"||!ae(o.argument,p=>p===s))return l(i)}}return i;case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return Bn(e,t,r);case"ImportDeclaration":return Ea(e,t,r);case"ImportSpecifier":case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":case"ImportDefaultSpecifier":case"ExportDefaultSpecifier":return xa(e,t,r);case"ImportAttribute":return fn(e,t,r);case"Program":case"BlockStatement":case"StaticBlock":return An(e,t,r);case"ClassBody":return ia(e,t,r);case"ThrowStatement":return $i(e,t,r);case"ReturnStatement":return Vi(e,t,r);case"NewExpression":case"ImportExpression":case"OptionalCallExpression":case"CallExpression":return Qr(e,t,r);case"ObjectExpression":case"ObjectPattern":case"RecordExpression":return gt(e,t,r);case"Property":return kt(s)?Fr(e,t,r):fn(e,t,r);case"ObjectProperty":return fn(e,t,r);case"ObjectMethod":return Fr(e,t,r);case"Decorator":return["@",r("expression")];case"ArrayExpression":case"ArrayPattern":case"TupleExpression":return Kt(e,t,r);case"SequenceExpression":{let{parent:a}=e;if(a.type==="ExpressionStatement"||a.type==="ForStatement"){let o=[];return e.each(({isFirst:p})=>{p?o.push(r()):o.push(",",f([x,r()]))},"expressions"),l(o)}return l(b([",",x],e.map(r,"expressions")))}case"ThisExpression":return"this";case"Super":return"super";case"Directive":return[r("value"),u];case"UnaryExpression":return i.push(s.operator),/[a-z]$/u.test(s.operator)&&i.push(" "),T(s.argument)?i.push(l(["(",f([E,r("argument")]),E,")"])):i.push(r("argument")),i;case"UpdateExpression":return[s.prefix?s.operator:"",r("argument"),s.prefix?"":s.operator];case"ConditionalExpression":return zt(e,t,r,n);case"VariableDeclaration":{let a=e.map(r,"declarations"),o=e.parent,p=o.type==="ForStatement"||o.type==="ForInStatement"||o.type==="ForOfStatement",y=s.declarations.some(m=>m.init),D;return a.length===1&&!T(s.declarations[0])?D=a[0]:a.length>0&&(D=f(a[0])),i=[K(e),s.kind,D?[" ",D]:"",f(a.slice(1).map(m=>[",",y&&!p?F:x,m]))],p&&o.body!==s||i.push(u),l(i)}case"WithStatement":return l(["with (",r("object"),")",ft(s.body,r("body"))]);case"IfStatement":{let a=ft(s.consequent,r("consequent")),o=l(["if (",l([f([E,r("test")]),E]),")",a]);if(i.push(o),s.alternate){let p=T(s.consequent,h.Trailing|h.Line)||vr(s),y=s.consequent.type==="BlockStatement"&&!p;i.push(y?" ":F),T(s,h.Dangling)&&i.push(J(e,t),p?F:" "),i.push("else",l(ft(s.alternate,r("alternate"),s.alternate.type==="IfStatement")))}return i}case"ForStatement":{let a=ft(s.body,r("body")),o=J(e,t),p=o?[o,E]:"";return!s.init&&!s.test&&!s.update?[p,l(["for (;;)",a])]:[p,l(["for (",l([f([E,r("init"),";",x,r("test"),";",x,r("update")]),E]),")",a])]}case"WhileStatement":return l(["while (",l([f([E,r("test")]),E]),")",ft(s.body,r("body"))]);case"ForInStatement":return l(["for (",r("left")," in ",r("right"),")",ft(s.body,r("body"))]);case"ForOfStatement":return l(["for",s.await?" await":""," (",r("left")," of ",r("right"),")",ft(s.body,r("body"))]);case"DoWhileStatement":{let a=ft(s.body,r("body"));return i=[l(["do",a])],s.body.type==="BlockStatement"?i.push(" "):i.push(F),i.push("while (",l([f([E,r("test")]),E]),")",u),i}case"DoExpression":return[s.async?"async ":"","do ",r("body")];case"BreakStatement":case"ContinueStatement":return i.push(s.type==="BreakStatement"?"break":"continue"),s.label&&i.push(" ",r("label")),i.push(u),i;case"LabeledStatement":return s.body.type==="EmptyStatement"?[r("label"),":;"]:[r("label"),": ",r("body")];case"TryStatement":return["try ",r("block"),s.handler?[" ",r("handler")]:"",s.finalizer?[" finally ",r("finalizer")]:""];case"CatchClause":if(s.param){let a=T(s.param,p=>!ee(p)||p.leading&&Z(t.originalText,k(p))||p.trailing&&Z(t.originalText,q(p),{backwards:!0})),o=r("param");return["catch ",a?["(",f([E,o]),E,") "]:["(",o,") "],r("body")]}return["catch ",r("body")];case"SwitchStatement":return[l(["switch (",f([E,r("discriminant")]),E,")"])," {",s.cases.length>0?f([F,b(F,e.map(({node:a,isLast:o})=>[r(),!o&&ce(a,t)?F:""],"cases"))]):"",F,"}"];case"SwitchCase":{s.test?i.push("case ",r("test"),":"):i.push("default:"),T(s,h.Dangling)&&i.push(" ",J(e,t));let a=s.consequent.filter(o=>o.type!=="EmptyStatement");if(a.length>0){let o=Cr(e,t,r,"consequent");i.push(a.length===1&&a[0].type==="BlockStatement"?[" ",o]:f([F,o]))}return i}case"DebuggerStatement":return["debugger",u];case"ClassDeclaration":case"ClassExpression":return xn(e,t,r);case"ClassMethod":case"ClassPrivateMethod":case"MethodDefinition":return hn(e,t,r);case"ClassProperty":case"PropertyDefinition":case"ClassPrivateProperty":case"ClassAccessorProperty":case"AccessorProperty":return gn(e,t,r);case"TemplateElement":return ve(s.value.raw);case"TemplateLiteral":return Gr(e,r,t);case"TaggedTemplateExpression":return Hu(e,r);case"PrivateIdentifier":return["#",s.name];case"PrivateName":return["#",r("id")];case"TopicReference":return"%";case"ArgumentPlaceholder":return"?";case"ModuleExpression":return["module ",r("body")];case"InterpreterDirective":default:throw new Ne(s,"ESTree")}}function bn(e,t,r){let{parent:n,node:s,key:u}=e,i=[r("expression")];switch(s.type){case"AsConstExpression":i.push(" as const");break;case"AsExpression":case"TSAsExpression":i.push(" as ",r("typeAnnotation"));break;case"SatisfiesExpression":case"TSSatisfiesExpression":i.push(" satisfies ",r("typeAnnotation"));break}return u==="callee"&&L(n)||u==="object"&&W(n)?l([f([E,...i]),E]):i}function Sa(e,t,r){let{node:n}=e,s=[K(e),"component"];n.id&&s.push(" ",r("id")),s.push(r("typeParameters"));let u=rm(e,r,t);return n.rendersType?s.push(l([u," ",r("rendersType")])):s.push(l([u])),n.body&&s.push(" ",r("body")),t.semi&&n.type==="DeclareComponent"&&s.push(";"),s}function rm(e,t,r){let{node:n}=e,s=n.params;if(n.rest&&(s=[...s,n.rest]),s.length===0)return["(",J(e,r,{filter:i=>be(r.originalText,k(i))===")"}),")"];let u=[];return sm(e,(i,a)=>{let o=a===s.length-1;o&&n.rest&&u.push("..."),u.push(t()),!o&&(u.push(","),ce(s[a],r)?u.push(F,F):u.push(x))}),["(",f([E,...u]),B(oe(r,"all")&&!nm(n,s)?",":""),E,")"]}function nm(e,t){var r;return e.rest||((r=M(!1,t,-1))==null?void 0:r.type)==="RestElement"}function sm(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);e.each(s,"params"),r.rest&&e.call(s,"rest")}function Ba(e,t,r){let{node:n}=e;return n.shorthand?r("local"):[r("name")," as ",r("local")]}function ba(e,t,r){let{node:n}=e,s=[];return n.name&&s.push(r("name"),n.optional?"?: ":": "),s.push(r("typeAnnotation")),s}function Pa(e,t,r){return gt(e,r,t)}function Pn(e,t){let{node:r}=e,n=t("id");r.computed&&(n=["[",n,"]"]);let s="";return r.initializer&&(s=t("initializer")),r.init&&(s=t("init")),s?[n," = ",s]:n}function ka(e,t,r){let{node:n}=e,s;if(n.type==="EnumSymbolBody"||n.explicitType)switch(n.type){case"EnumBooleanBody":s="boolean";break;case"EnumNumberBody":s="number";break;case"EnumBigIntBody":s="bigint";break;case"EnumStringBody":s="string";break;case"EnumSymbolBody":s="symbol";break}return[s?`of ${s} `:"",Pa(e,t,r)]}function kn(e,t,r){let{node:n}=e;return[K(e),n.const?"const ":"","enum ",t("id")," ",n.type==="TSEnumDeclaration"?Pa(e,t,r):t("body")]}function La(e,t,r){let{node:n}=e,s=["hook"];n.id&&s.push(" ",r("id"));let u=Ue(e,r,t,!1,!0),i=Qt(e,r),a=ot(n,i);return s.push(l([a?l(u):u,i]),n.body?" ":"",r("body")),s}function wa(e,t,r){let{node:n}=e,s=[K(e),"hook"];return n.id&&s.push(" ",r("id")),t.semi&&s.push(";"),s}function Ia(e){var r;let{node:t}=e;return t.type==="HookTypeAnnotation"&&((r=e.getParentNode(2))==null?void 0:r.type)==="DeclareHook"}function Oa(e,t,r){let{node:n}=e,s=[];s.push(Ia(e)?"":"hook ");let u=Ue(e,r,t,!1,!0),i=[];return i.push(Ia(e)?": ":" => ",r("returnType")),ot(n,i)&&(u=l(u)),s.push(u,i),l(s)}function In(e,t,r){let{node:n}=e,s=[K(e),"interface"],u=[],i=[];n.type!=="InterfaceTypeAnnotation"&&u.push(" ",r("id"),r("typeParameters"));let a=n.typeParameters&&!T(n.typeParameters,h.Trailing|h.Line);return O(n.extends)&&i.push(a?B(" ",x,{groupId:Ar(n.typeParameters)}):x,"extends ",(n.extends.length===1?Eu:f)(b([",",x],e.map(r,"extends")))),T(n.id,h.Trailing)||O(n.extends)?a?s.push(l([...u,f(i)])):s.push(l(f([...u,...i]))):s.push(...u,...i),s.push(" ",r("body")),l(s)}function _a(e,t,r){let{node:n}=e;if(Pr(n))return n.type.slice(0,-14).toLowerCase();let s=t.semi?";":"";switch(n.type){case"ComponentDeclaration":case"DeclareComponent":case"ComponentTypeAnnotation":return Sa(e,t,r);case"ComponentParameter":return Ba(e,t,r);case"ComponentTypeParameter":return ba(e,t,r);case"HookDeclaration":return La(e,t,r);case"DeclareHook":return wa(e,t,r);case"HookTypeAnnotation":return Oa(e,t,r);case"DeclareClass":return xn(e,t,r);case"DeclareFunction":return[K(e),"function ",r("id"),r("predicate"),s];case"DeclareModule":return["declare module ",r("id")," ",r("body")];case"DeclareModuleExports":return["declare module.exports",H(e,r),s];case"DeclareNamespace":return["declare namespace ",r("id")," ",r("body")];case"DeclareVariable":return[K(e),n.kind??"var"," ",r("id"),s];case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return Bn(e,t,r);case"DeclareOpaqueType":case"OpaqueType":return Wi(e,t,r);case"DeclareTypeAlias":case"TypeAlias":return Zr(e,t,r);case"IntersectionTypeAnnotation":return en(e,t,r);case"UnionTypeAnnotation":return tn(e,t,r);case"ConditionalTypeAnnotation":return zt(e,t,r);case"InferTypeAnnotation":return sn(e,t,r);case"FunctionTypeAnnotation":return rn(e,t,r);case"TupleTypeAnnotation":return Kt(e,t,r);case"TupleTypeLabeledElement":return an(e,t,r);case"TupleTypeSpreadElement":return un(e,t,r);case"GenericTypeAnnotation":return[r("id"),Ot(e,t,r,"typeParameters")];case"IndexedAccessType":case"OptionalIndexedAccessType":return nn(e,t,r);case"TypeAnnotation":return on(e,t,r);case"TypeParameter":return dn(e,t,r);case"TypeofTypeAnnotation":return cn(e,r);case"ExistsTypeAnnotation":return"*";case"ArrayTypeAnnotation":return pn(r);case"DeclareEnum":case"EnumDeclaration":return kn(e,r,t);case"EnumBooleanBody":case"EnumNumberBody":case"EnumBigIntBody":case"EnumStringBody":case"EnumSymbolBody":return ka(e,r,t);case"EnumBooleanMember":case"EnumNumberMember":case"EnumBigIntMember":case"EnumStringMember":case"EnumDefaultedMember":return Pn(e,r);case"FunctionTypeParam":{let u=n.name?r("name"):e.parent.this===n?"this":"";return[u,$(e),u?": ":"",r("typeAnnotation")]}case"DeclareInterface":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":return In(e,t,r);case"ClassImplements":case"InterfaceExtends":return[r("id"),r("typeParameters")];case"NullableTypeAnnotation":return["?",r("typeAnnotation")];case"Variance":{let{kind:u}=n;return Mt.ok(u==="plus"||u==="minus"),u==="plus"?"+":"-"}case"KeyofTypeAnnotation":return["keyof ",r("argument")];case"ObjectTypeCallProperty":return[n.static?"static ":"",r("value")];case"ObjectTypeMappedTypeProperty":return ea(e,t,r);case"ObjectTypeIndexer":return[n.static?"static ":"",n.variance?r("variance"):"","[",r("id"),n.id?": ":"",r("key"),"]: ",r("value")];case"ObjectTypeProperty":{let u="";return n.proto?u="proto ":n.static&&(u="static "),[u,n.kind!=="init"?n.kind+" ":"",n.variance?r("variance"):"",Ft(e,t,r),$(e),kt(n)?"":": ",r("value")]}case"ObjectTypeAnnotation":return gt(e,t,r);case"ObjectTypeInternalSlot":return[n.static?"static ":"","[[",r("id"),"]]",$(e),n.method?"":": ",r("value")];case"ObjectTypeSpreadProperty":return yn(e,r);case"QualifiedTypeofIdentifier":case"QualifiedTypeIdentifier":return[r("qualification"),".",r("id")];case"NullLiteralTypeAnnotation":return"null";case"BooleanLiteralTypeAnnotation":return String(n.value);case"StringLiteralTypeAnnotation":return ve(nt(fe(n),t));case"NumberLiteralTypeAnnotation":return Et(n.raw??n.extra.raw);case"BigIntLiteralTypeAnnotation":return Sn(n.raw??n.extra.raw);case"TypeCastExpression":return["(",r("expression"),H(e,r),")"];case"TypePredicate":return ln(e,r);case"TypeOperator":return[n.operator," ",r("typeAnnotation")];case"TypeParameterDeclaration":case"TypeParameterInstantiation":return Ot(e,t,r,"params");case"InferredPredicate":case"DeclaredPredicate":return[e.key==="predicate"&&e.parent.type!=="DeclareFunction"&&!e.parent.returnType?": ":" ","%checks",...n.type==="DeclaredPredicate"?["(",r("value"),")"]:[]];case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return bn(e,t,r)}}function va(e,t,r){var i;let{node:n}=e;if(!n.type.startsWith("TS"))return;if(kr(n))return n.type.slice(2,-7).toLowerCase();let s=t.semi?";":"",u=[];switch(n.type){case"TSThisType":return"this";case"TSTypeAssertion":{let a=!(U(n.expression)||se(n.expression)),o=l(["<",f([E,r("typeAnnotation")]),E,">"]),p=[B("("),f([E,r("expression")]),E,B(")")];return a?et([[o,r("expression")],[o,l(p,{shouldBreak:!0})],[o,r("expression")]]):l([o,r("expression")])}case"TSDeclareFunction":return En(e,r,t);case"TSExportAssignment":return["export = ",r("expression"),s];case"TSModuleBlock":return An(e,t,r);case"TSInterfaceBody":case"TSTypeLiteral":return gt(e,t,r);case"TSTypeAliasDeclaration":return Zr(e,t,r);case"TSQualifiedName":return[r("left"),".",r("right")];case"TSAbstractMethodDefinition":case"TSDeclareMethod":return hn(e,t,r);case"TSAbstractAccessorProperty":case"TSAbstractPropertyDefinition":return gn(e,t,r);case"TSInterfaceHeritage":case"TSClassImplements":case"TSExpressionWithTypeArguments":case"TSInstantiationExpression":return[r("expression"),r(n.typeArguments?"typeArguments":"typeParameters")];case"TSTemplateLiteralType":return Gr(e,r,t);case"TSNamedTupleMember":return an(e,t,r);case"TSRestType":return un(e,t,r);case"TSOptionalType":return[r("typeAnnotation"),"?"];case"TSInterfaceDeclaration":return In(e,t,r);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return Ot(e,t,r,"params");case"TSTypeParameter":return dn(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":return bn(e,t,r);case"TSArrayType":return pn(r);case"TSPropertySignature":return[n.readonly?"readonly ":"",Ft(e,t,r),$(e),H(e,r)];case"TSParameterProperty":return[$t(n),n.static?"static ":"",n.override?"override ":"",n.readonly?"readonly ":"",r("parameter")];case"TSTypeQuery":return cn(e,r);case"TSIndexSignature":{let a=n.parameters.length>1?B(oe(t)?",":""):"",o=l([f([E,b([", ",E],e.map(r,"parameters"))]),a,E]),p=e.parent.type==="ClassBody"&&e.key==="body";return[p&&n.static?"static ":"",n.readonly?"readonly ":"","[",n.parameters?o:"","]",H(e,r),p?s:""]}case"TSTypePredicate":return ln(e,r);case"TSNonNullExpression":return[r("expression"),"!"];case"TSImportType":return["import(",r("argument"),")",n.qualifier?[".",r("qualifier")]:"",Ot(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSLiteralType":return r("literal");case"TSIndexedAccessType":return nn(e,t,r);case"TSTypeOperator":return[n.operator," ",r("typeAnnotation")];case"TSMappedType":return ta(e,t,r);case"TSMethodSignature":{let a=n.kind&&n.kind!=="method"?`${n.kind} `:"";u.push($t(n),a,n.computed?"[":"",r("key"),n.computed?"]":"",$(e));let o=Ue(e,r,t,!1,!0),p=n.returnType?"returnType":"typeAnnotation",y=n[p],D=y?H(e,r,p):"",m=ot(n,D);return u.push(m?l(o):o),y&&u.push(l(D)),l(u)}case"TSNamespaceExportDeclaration":return["export as namespace ",r("id"),t.semi?";":""];case"TSEnumDeclaration":return kn(e,r,t);case"TSEnumMember":return Pn(e,r);case"TSImportEqualsDeclaration":return[n.isExport?"export ":"","import ",Os(n,!1),r("id")," = ",r("moduleReference"),t.semi?";":""];case"TSExternalModuleReference":return["require(",r("expression"),")"];case"TSModuleDeclaration":{let{parent:a}=e,o=a.type==="TSModuleDeclaration",p=((i=n.body)==null?void 0:i.type)==="TSModuleDeclaration";return o?u.push("."):(u.push(K(e)),n.kind!=="global"&&u.push(n.kind," ")),u.push(r("id")),p?u.push(r("body")):n.body?u.push(" ",l(r("body"))):u.push(s),u}case"TSConditionalType":return zt(e,t,r);case"TSInferType":return sn(e,t,r);case"TSIntersectionType":return en(e,t,r);case"TSUnionType":return tn(e,t,r);case"TSFunctionType":case"TSCallSignatureDeclaration":case"TSConstructorType":case"TSConstructSignatureDeclaration":return rn(e,t,r);case"TSTupleType":return Kt(e,t,r);case"TSTypeReference":return[r("typeName"),Ot(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSTypeAnnotation":return on(e,t,r);case"TSEmptyBodyFunctionExpression":return Fn(e,t,r);case"TSJSDocAllType":return"*";case"TSJSDocUnknownType":return"?";case"TSJSDocNullableType":return gs(e,r,"?");case"TSJSDocNonNullableType":return gs(e,r,"!");case"TSParenthesizedType":default:throw new Ne(n,"TypeScript")}}function um(e,t,r,n){if(Vr(e))return Di(e,t);for(let s of[gi,Ti,_a,va,ga]){let u=s(e,t,r,n);if(u!==void 0)return u}}var im=R(["ClassMethod","ClassPrivateMethod","ClassProperty","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition","ClassPrivateProperty","MethodDefinition","TSAbstractMethodDefinition","TSDeclareMethod"]);function am(e,t,r,n){var D;e.isRoot&&((D=t.__onHtmlBindingRoot)==null||D.call(t,e.node,t));let s=um(e,t,r,n);if(!s)return"";let{node:u}=e;if(im(u))return s;let i=O(u.decorators),a=Bi(e,t,r),o=u.type==="ClassExpression";if(i&&!o)return lr(s,m=>l([a,m]));let p=ke(e,t),y=pa(e,t);return!a&&!p&&!y?s:lr(s,m=>[y?";":"",p?"(":"",p&&o&&i?[f([x,a,m]),x]:[a,m],p?")":""])}var ja=am;var om={avoidAstMutation:!0};var Ma=[{linguistLanguageId:174,name:"JSON.stringify",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".importmap"],filenames:["package.json","package-lock.json","composer.json"],parsers:["json-stringify"],vscodeLanguageIds:["json"]},{linguistLanguageId:174,name:"JSON",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".json",".4DForm",".4DProject",".avsc",".geojson",".gltf",".har",".ice",".JSON-tmLanguage",".mcmeta",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","Pipfile.lock","composer.lock","flake.lock","mcmod.info",".babelrc",".jscsrc",".jshintrc",".jslintrc",".swcrc"],parsers:["json"],vscodeLanguageIds:["json"]},{linguistLanguageId:423,name:"JSON with Comments",type:"data",color:"#292929",group:"JSON",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",aliases:["jsonc"],extensions:[".jsonc",".code-snippets",".code-workspace",".sublime-build",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[],parsers:["jsonc"],vscodeLanguageIds:["jsonc"]},{linguistLanguageId:175,name:"JSON5",type:"data",color:"#267CB9",extensions:[".json5"],tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"application/json",parsers:["json5"],vscodeLanguageIds:["json5"]}];var Ms={};xr(Ms,{getVisitorKeys:()=>Ja,massageAstNode:()=>Wa,print:()=>lm});var pm={JsonRoot:["node"],ArrayExpression:["elements"],ObjectExpression:["properties"],ObjectProperty:["key","value"],UnaryExpression:["argument"],NullLiteral:[],BooleanLiteral:[],StringLiteral:[],NumericLiteral:[],Identifier:[],TemplateLiteral:["quasis"],TemplateElement:[]},Ra=pm;var cm=Br(Ra),Ja=cm;function lm(e,t,r){let{node:n}=e;switch(n.type){case"JsonRoot":return[r("node"),F];case"ArrayExpression":{if(n.elements.length===0)return"[]";let s=e.map(()=>e.node===null?"null":r(),"elements");return["[",f([F,b([",",F],s)]),F,"]"]}case"ObjectExpression":return n.properties.length===0?"{}":["{",f([F,b([",",F],e.map(r,"properties"))]),F,"}"];case"ObjectProperty":return[r("key"),": ",r("value")];case"UnaryExpression":return[n.operator==="+"?"":n.operator,r("argument")];case"NullLiteral":return"null";case"BooleanLiteral":return n.value?"true":"false";case"StringLiteral":return JSON.stringify(n.value);case"NumericLiteral":return qa(e)?JSON.stringify(String(n.value)):JSON.stringify(n.value);case"Identifier":return qa(e)?JSON.stringify(n.name):n.name;case"TemplateLiteral":return r(["quasis",0]);case"TemplateElement":return JSON.stringify(n.value.cooked);default:throw new Ne(n,"JSON")}}function qa(e){return e.key==="key"&&e.parent.type==="ObjectProperty"}var mm=new Set(["start","end","extra","loc","comments","leadingComments","trailingComments","innerComments","errors","range","tokens"]);function Wa(e,t){let{type:r}=e;if(r==="ObjectProperty"){let{key:n}=e;n.type==="Identifier"?t.key={type:"StringLiteral",value:n.name}:n.type==="NumericLiteral"&&(t.key={type:"StringLiteral",value:String(n.value)});return}if(r==="UnaryExpression"&&e.operator==="+")return t.argument;if(r==="ArrayExpression"){for(let[n,s]of e.elements.entries())s===null&&t.elements.splice(n,0,{type:"NullLiteral"});return}if(r==="TemplateLiteral")return{type:"StringLiteral",value:e.quasis[0].value.cooked}}Wa.ignoredProperties=mm;var Zt={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var St="JavaScript",ym={arrowParens:{category:St,type:"choice",default:"always",description:"Include parentheses around a sole arrow function parameter.",choices:[{value:"always",description:"Always include parens. Example: `(x) => x`"},{value:"avoid",description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:Zt.bracketSameLine,objectWrap:Zt.objectWrap,bracketSpacing:Zt.bracketSpacing,jsxBracketSameLine:{category:St,type:"boolean",description:"Put > on the last line instead of at a new line.",deprecated:"2.4.0"},semi:{category:St,type:"boolean",default:!0,description:"Print semicolons.",oppositeDescription:"Do not print semicolons, except at the beginning of lines which may need them."},experimentalOperatorPosition:{category:St,type:"choice",default:"end",description:"Where to print operators when binary expressions wrap lines.",choices:[{value:"start",description:"Print operators at the start of new lines."},{value:"end",description:"Print operators at the end of previous lines."}]},experimentalTernaries:{category:St,type:"boolean",default:!1,description:"Use curious ternaries, with the question mark after the condition.",oppositeDescription:"Default behavior of ternaries; keep question marks on the same line as the consequent."},singleQuote:Zt.singleQuote,jsxSingleQuote:{category:St,type:"boolean",default:!1,description:"Use single quotes in JSX."},quoteProps:{category:St,type:"choice",default:"as-needed",description:"Change when properties in objects are quoted.",choices:[{value:"as-needed",description:"Only add quotes around object properties where required."},{value:"consistent",description:"If at least one property in an object requires quotes, quote all properties."},{value:"preserve",description:"Respect the input use of quotes in object properties."}]},trailingComma:{category:St,type:"choice",default:"all",description:"Print trailing commas wherever possible when multi-line.",choices:[{value:"all",description:"Trailing commas wherever possible (including function arguments)."},{value:"es5",description:"Trailing commas where valid in ES5 (objects, arrays, etc.)"},{value:"none",description:"No trailing commas."}]},singleAttributePerLine:Zt.singleAttributePerLine},Na=ym;var Dm={estree:js,"estree-json":Ms},fm=[...Xs,...Ma];return Qa(Em);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/estree.mjs b/node_modules/prettier/plugins/estree.mjs new file mode 100644 index 0000000..2069ba6 --- /dev/null +++ b/node_modules/prettier/plugins/estree.mjs @@ -0,0 +1,36 @@ +var Ha=Object.defineProperty;var Ns=e=>{throw TypeError(e)};var xr=(e,t)=>{for(var r in t)Ha(e,r,{get:t[r],enumerable:!0})};var Gs=(e,t,r)=>t.has(e)||Ns("Cannot "+r);var ct=(e,t,r)=>(Gs(e,t,"read from private field"),r?r.call(e):t.get(e)),Us=(e,t,r)=>t.has(e)?Ns("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ys=(e,t,r,n)=>(Gs(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Ms={};xr(Ms,{languages:()=>lm,options:()=>Na,printers:()=>cm});var Xs=[{linguistLanguageId:183,name:"JavaScript",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:["js","node"],extensions:[".js","._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".wxs"],filenames:["Jakefile"],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"]},{linguistLanguageId:183,name:"Flow",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:[],extensions:[".js.flow"],filenames:[],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"]},{linguistLanguageId:183,name:"JSX",type:"programming",tmScope:"source.js.jsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",color:void 0,aliases:void 0,extensions:[".jsx"],filenames:void 0,interpreters:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript"},{linguistLanguageId:378,name:"TypeScript",type:"programming",color:"#3178c6",aliases:["ts"],interpreters:["deno","ts-node"],extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"]},{linguistLanguageId:94901924,name:"TSX",type:"programming",color:"#3178c6",group:"TypeScript",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"]}];var vs={};xr(vs,{canAttachComment:()=>xp,embed:()=>ri,experimentalFeatures:()=>sm,getCommentChildNodes:()=>hp,getVisitorKeys:()=>br,handleComments:()=>zn,insertPragma:()=>yi,isBlockComment:()=>ee,isGap:()=>gp,massageAstNode:()=>xu,print:()=>ja,printComment:()=>Ou,willPrintOwnComments:()=>Zn});var Va=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},Y=Va;var $a=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},M=$a;function Ka(e){return e!==null&&typeof e=="object"}var Hs=Ka;function*Qa(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,s=u=>Hs(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let a of i)s(a)&&(yield a);else s(i)&&(yield i)}}function*za(e,t){let r=[e];for(let n=0;n/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Ks(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Qs(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var zs=e=>!(Ks(e)||Qs(e));var Za=/[^\x20-\x7F]/u;function eo(e){if(!e)return 0;if(!Za.test(e))return e.length;e=e.replace($s()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=zs(n)?1:2)}return t}var rt=eo;function hr(e){return(t,r,n)=>{let s=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:u}=t,i=r;for(;i>=0&&i0}var O=io;var tu=new Proxy(()=>{},{get:()=>tu}),Mt=tu;var gr="'",ru='"';function ao(e,t){let r=t===!0||t===gr?gr:ru,n=r===gr?ru:gr,s=0,u=0;for(let i of e)i===r?s++:i===n&&u++;return s>u?n:r}var Sr=ao;function oo(e,t,r){let n=t==='"'?"'":'"',u=Y(!1,e,/\\(.)|(["'])/gsu,(i,a,o)=>a===n?a:o===t?"\\"+o:o||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a)?a:"\\"+a));return t+u+t}var nu=oo;function po(e,t){Mt.ok(/^(?["']).*\k$/su.test(e));let r=e.slice(1,-1),n=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":Sr(r,t.singleQuote);return e.charAt(0)===n?e:nu(r,n,!1)}var nt=po;function q(e){var n,s,u;let t=((n=e.range)==null?void 0:n[0])??e.start,r=(u=((s=e.declaration)==null?void 0:s.decorators)??e.decorators)==null?void 0:u[0];return r?Math.min(q(r),t):t}function k(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function Pt(e,t){let r=q(e);return Number.isInteger(r)&&r===q(t)}function co(e,t){let r=k(e);return Number.isInteger(r)&&r===k(t)}function su(e,t){return Pt(e,t)&&co(e,t)}var rr=null;function nr(e){if(rr!==null&&typeof rr.property){let t=rr;return rr=nr.prototype=null,t}return rr=nr.prototype=e??Object.create(null),new nr}var lo=10;for(let e=0;e<=lo;e++)nr();function wn(e){return nr(e)}function mo(e,t="type"){wn(e);function r(n){let s=n[t],u=e[s];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return u}return r}var Br=mo;var uu={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var yo=Br(uu),br=yo;function Do(e){let t=new Set(e);return r=>t.has(r==null?void 0:r.type)}var R=Do;var fo=R(["Block","CommentBlock","MultiLine"]),ee=fo;var Eo=R(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),Pr=Eo;function Fo(e,t){let r=t.split(".");for(let n=r.length-1;n>=0;n--){let s=r[n];if(n===0)return e.type==="Identifier"&&e.name===s;if(e.type!=="MemberExpression"||e.optional||e.computed||e.property.type!=="Identifier"||e.property.name!==s)return!1;e=e.object}}function Co(e,t){return t.some(r=>Fo(e,r))}var iu=Co;function Ao({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}var kr=Ao;function ur(e,t){return t(e)||Vs(e,{getVisitorKeys:br,predicate:t})}function Jt(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||L(e)||W(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||Ae(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function pu(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function Lr(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var At=R(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),cu=R(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),U=R(["ArrayExpression","TupleExpression"]),se=R(["ObjectExpression","RecordExpression"]);function lu(e){return e.type==="LogicalExpression"&&e.operator==="??"}function Fe(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function Mn(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&Fe(e.argument)}function te(e){return!!(e&&(e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"))}function Rn(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}var wr=R(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),To=R(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),Re=R(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),Rt=R(["FunctionExpression","ArrowFunctionExpression"]);function xo(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function On(e){return L(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var X=R(["JSXElement","JSXFragment"]);function kt(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function Or(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function mu(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!Pt(e,e.typeAnnotation)}var De=R(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function Tt(e){return W(e)||e.type==="BindExpression"&&!!e.object}var ho=R(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function qt(e){return kr(e)||Pr(e)||ho(e)||(e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference")&&!e.typeParameters&&!e.typeArguments}function go(e){return e.type==="Identifier"&&(e.name==="beforeEach"||e.name==="beforeAll"||e.name==="afterEach"||e.name==="afterAll")}var So=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function Bo(e){return iu(e,So)}function It(e,t){if((e==null?void 0:e.type)!=="CallExpression"||e.optional)return!1;let r=pe(e);if(r.length===1){if(On(e)&&It(t))return Rt(r[0]);if(go(e.callee))return On(r[0])}else if((r.length===2||r.length===3)&&(r[0].type==="TemplateLiteral"||te(r[0]))&&Bo(e.callee))return r[2]&&!Fe(r[2])?!1:(r.length===2?Rt(r[1]):xo(r[1])&&z(r[1]).length<=1)||On(r[1]);return!1}var yu=e=>t=>((t==null?void 0:t.type)==="ChainExpression"&&(t=t.expression),e(t)),L=yu(R(["CallExpression","OptionalCallExpression"])),W=yu(R(["MemberExpression","OptionalMemberExpression"]));function Jn(e,t=5){return Du(e,t)<=t}function Du(e,t){let r=0;for(let n in e){let s=e[n];if(s&&typeof s=="object"&&typeof s.type=="string"&&(r++,r+=Du(s,t-r)),r>t)return r}return r}var bo=.25;function ir(e,t){let{printWidth:r}=t;if(T(e))return!1;let n=r*bo;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=n||Mn(e)&&!T(e.argument))return!0;let s=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return s?s.length<=n:te(e)?nt(fe(e),t).length<=n:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=n&&!e.quasis[0].value.raw.includes(` +`):e.type==="UnaryExpression"?ir(e.argument,{printWidth:r}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=n-2:wr(e)}function Le(e,t){return X(t)?Lt(t):T(t,h.Leading,r=>Z(e,k(r)))}function au(e){return e.quasis.some(t=>t.value.raw.includes(` +`))}function _r(e,t){return(e.type==="TemplateLiteral"&&au(e)||e.type==="TaggedTemplateExpression"&&au(e.quasi))&&!Z(t,q(e),{backwards:!0})}function vr(e){if(!T(e))return!1;let t=M(!1,lt(e,h.Dangling),-1);return t&&!ee(t)}function fu(e){if(e.length<=1)return!1;let t=0;for(let r of e)if(Rt(r)){if(t+=1,t>1)return!0}else if(L(r)){for(let n of pe(r))if(Rt(n))return!0}return!1}function jr(e){let{node:t,parent:r,key:n}=e;return n==="callee"&&L(t)&&L(r)&&r.arguments.length>0&&t.arguments.length>r.arguments.length}var Po=new Set(["!","-","+","~"]);function Ie(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return Ie(e.expression,t);let r=n=>Ie(n,t-1);if(Rn(e))return rt(e.pattern??e.regex.pattern)<=5;if(wr(e)||To(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(n=>!n.value.raw.includes(` +`))&&e.expressions.every(r);if(se(e))return e.properties.every(n=>!n.computed&&(n.shorthand||n.value&&r(n.value)));if(U(e))return e.elements.every(n=>n===null||r(n));if(mt(e)){if(e.type==="ImportExpression"||Ie(e.callee,t)){let n=pe(e);return n.length<=t&&n.every(r)}return!1}return W(e)?Ie(e.object,t)&&Ie(e.property,t):e.type==="UnaryExpression"&&Po.has(e.operator)||e.type==="UpdateExpression"?Ie(e.argument,t):!1}function fe(e){var t;return((t=e.extra)==null?void 0:t.raw)??e.raw}function Eu(e){return e}function oe(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function ae(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return ae(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return ae(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:ae(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:ae(e.callee,t);case"ConditionalExpression":return ae(e.test,t);case"UpdateExpression":return!e.prefix&&ae(e.argument,t);case"BindExpression":return e.object&&ae(e.object,t);case"SequenceExpression":return ae(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return ae(e.expression,t);default:return t(e)}}var ou={"==":!0,"!=":!0,"===":!0,"!==":!0},Ir={"*":!0,"/":!0,"%":!0},jn={">>":!0,">>>":!0,"<<":!0};function ar(e,t){return!(sr(t)!==sr(e)||e==="**"||ou[e]&&ou[t]||t==="%"&&Ir[e]||e==="%"&&Ir[t]||t!==e&&Ir[t]&&Ir[e]||jn[e]&&jn[t])}var ko=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(r=>[r,t])));function sr(e){return ko.get(e)}function Fu(e){return!!jn[e]||e==="|"||e==="^"||e==="&"}function Cu(e){var r;if(e.rest)return!0;let t=z(e);return((r=M(!1,t,-1))==null?void 0:r.type)==="RestElement"}var _n=new WeakMap;function z(e){if(_n.has(e))return _n.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),_n.set(e,t),t}function Au(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);r.this&&e.call(s,"this"),Array.isArray(r.parameters)?e.each(s,"parameters"):Array.isArray(r.params)&&e.each(s,"params"),r.rest&&e.call(s,"rest")}var vn=new WeakMap;function pe(e){if(vn.has(e))return vn.get(e);if(e.type==="ChainExpression")return pe(e.expression);let t=e.arguments;return e.type==="ImportExpression"&&(t=[e.source],e.options&&t.push(e.options)),vn.set(e,t),t}function Wt(e,t){let{node:r}=e;if(r.type==="ChainExpression")return e.call(()=>Wt(e,t),"expression");r.type==="ImportExpression"?(e.call(n=>t(n,0),"source"),r.options&&e.call(n=>t(n,1),"options")):e.each(t,"arguments")}function qn(e,t){let r=[];if(e.type==="ChainExpression"&&(e=e.expression,r.push("expression")),e.type==="ImportExpression"){if(t===0||t===(e.options?-2:-1))return[...r,"source"];if(e.options&&(t===1||t===-1))return[...r,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...r,"arguments",t]}function or(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function Lt(e){return(e==null?void 0:e.prettierIgnore)||T(e,h.PrettierIgnore)}var h={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},Tu=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(r,n,s)=>!(e&h.Leading&&!r.leading||e&h.Trailing&&!r.trailing||e&h.Dangling&&(r.leading||r.trailing)||e&h.Block&&!ee(r)||e&h.Line&&!At(r)||e&h.First&&n!==0||e&h.Last&&n!==s.length-1||e&h.PrettierIgnore&&!or(r)||t&&!t(r))};function T(e,t,r){if(!O(e==null?void 0:e.comments))return!1;let n=Tu(t,r);return n?e.comments.some(n):!0}function lt(e,t,r){if(!Array.isArray(e==null?void 0:e.comments))return[];let n=Tu(t,r);return n?e.comments.filter(n):e.comments}var ce=(e,{originalText:t})=>jt(t,k(e));function mt(e){return L(e)||e.type==="NewExpression"||e.type==="ImportExpression"}function Ce(e){return e&&(e.type==="ObjectProperty"||e.type==="Property"&&!kt(e))}var Ae=R(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),we=R(["TSUnionType","UnionTypeAnnotation"]),Nt=R(["TSIntersectionType","IntersectionTypeAnnotation"]),Je=R(["TSConditionalType","ConditionalTypeAnnotation"]);var Io=new Set(["range","raw","comments","leadingComments","trailingComments","innerComments","extra","start","end","loc","flags","errors","tokens"]),Gt=e=>{for(let t of e.quasis)delete t.value};function du(e,t,r){var s,u;if(e.type==="Program"&&delete t.sourceType,(e.type==="BigIntLiteral"||e.type==="BigIntLiteralTypeAnnotation")&&e.value&&(t.value=e.value.toLowerCase()),(e.type==="BigIntLiteral"||e.type==="Literal")&&e.bigint&&(t.bigint=e.bigint.toLowerCase()),e.type==="EmptyStatement"||e.type==="JSXText"||e.type==="JSXExpressionContainer"&&(e.expression.type==="Literal"||e.expression.type==="StringLiteral")&&e.expression.value===" ")return null;if((e.type==="Property"||e.type==="ObjectProperty"||e.type==="MethodDefinition"||e.type==="ClassProperty"||e.type==="ClassMethod"||e.type==="PropertyDefinition"||e.type==="TSDeclareMethod"||e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty"||e.type==="ImportAttribute")&&e.key&&!e.computed){let{key:i}=e;te(i)||Fe(i)?t.key=String(i.value):i.type==="Identifier"&&(t.key=i.name)}if(e.type==="JSXElement"&&e.openingElement.name.name==="style"&&e.openingElement.attributes.some(i=>i.type==="JSXAttribute"&&i.name.name==="jsx"))for(let{type:i,expression:a}of t.children)i==="JSXExpressionContainer"&&a.type==="TemplateLiteral"&&Gt(a);e.type==="JSXAttribute"&&e.name.name==="css"&&e.value.type==="JSXExpressionContainer"&&e.value.expression.type==="TemplateLiteral"&&Gt(t.value.expression),e.type==="JSXAttribute"&&((s=e.value)==null?void 0:s.type)==="Literal"&&/["']|"|'/u.test(e.value.value)&&(t.value.value=Y(!1,e.value.value,/["']|"|'/gu,'"'));let n=e.expression||e.callee;if(e.type==="Decorator"&&n.type==="CallExpression"&&n.callee.name==="Component"&&n.arguments.length===1){let i=e.expression.arguments[0].properties;for(let[a,o]of t.expression.arguments[0].properties.entries())switch(i[a].key.name){case"styles":U(o.value)&&Gt(o.value.elements[0]);break;case"template":o.value.type==="TemplateLiteral"&&Gt(o.value);break}}e.type==="TaggedTemplateExpression"&&(e.tag.type==="MemberExpression"||e.tag.type==="Identifier"&&(e.tag.name==="gql"||e.tag.name==="graphql"||e.tag.name==="css"||e.tag.name==="md"||e.tag.name==="markdown"||e.tag.name==="html")||e.tag.type==="CallExpression")&&Gt(t.quasi),e.type==="TemplateLiteral"&&((u=e.leadingComments)!=null&&u.some(a=>ee(a)&&["GraphQL","HTML"].some(o=>a.value===` ${o} `))||r.type==="CallExpression"&&r.callee.name==="graphql"||!e.leadingComments)&&Gt(t),e.type==="ChainExpression"&&e.expression.type==="TSNonNullExpression"&&(t.type="TSNonNullExpression",t.expression.type="ChainExpression"),e.type==="TSMappedType"&&(delete t.key,delete t.constraint),e.type==="TSEnumDeclaration"&&delete t.body}du.ignoredProperties=Io;var xu=du;var qe="string",he="array",st="cursor",Ve="indent",$e="align",Ke="trim",me="group",Oe="fill",Te="if-break",Qe="indent-if-break",ze="line-suffix",We="line-suffix-boundary",ie="line",ge="label",_e="break-parent",Mr=new Set([st,Ve,$e,Ke,me,Oe,Te,Qe,ze,We,ie,ge,_e]);function Lo(e){if(typeof e=="string")return qe;if(Array.isArray(e))return he;if(!e)return;let{type:t}=e;if(Mr.has(t))return t}var Se=Lo;var wo=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Oo(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', +Expected it to be 'string' or 'object'.`;if(Se(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=wo([...Mr].map(s=>`'${s}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${n}.`}var Wn=class extends Error{name="InvalidDocError";constructor(t){super(Oo(t)),this.doc=t}},dt=Wn;var hu={};function _o(e,t,r,n){let s=[e];for(;s.length>0;){let u=s.pop();if(u===hu){r(s.pop());continue}r&&s.push(u,hu);let i=Se(u);if(!i)throw new dt(u);if((t==null?void 0:t(u))!==!1)switch(i){case he:case Oe:{let a=i===he?u:u.parts;for(let o=a.length,p=o-1;p>=0;--p)s.push(a[p]);break}case Te:s.push(u.flatContents,u.breakContents);break;case me:if(n&&u.expandedStates)for(let a=u.expandedStates.length,o=a-1;o>=0;--o)s.push(u.expandedStates[o]);else s.push(u.contents);break;case $e:case Ve:case Qe:case ge:case ze:s.push(u.contents);break;case qe:case st:case Ke:case We:case ie:case _e:break;default:throw new dt(u)}}}var pr=_o;function yt(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=s(u);return r.set(u,i),i}function s(u){switch(Se(u)){case he:return t(u.map(n));case Oe:return t({...u,parts:u.parts.map(n)});case Te:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case me:{let{expandedStates:i,contents:a}=u;return i?(i=i.map(n),a=i[0]):a=n(a),t({...u,contents:a,expandedStates:i})}case $e:case Ve:case Qe:case ge:case ze:return t({...u,contents:n(u.contents)});case qe:case st:case Ke:case We:case ie:case _e:return t(u);default:throw new dt(u)}}}function Su(e,t,r){let n=r,s=!1;function u(i){if(s)return!1;let a=t(i);a!==void 0&&(s=!0,n=a)}return pr(e,u),n}function vo(e){if(e.type===me&&e.break||e.type===ie&&e.hard||e.type===_e)return!0}function re(e){return Su(e,vo,!1)}function gu(e){if(e.length>0){let t=M(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Bu(e){let t=new Set,r=[];function n(u){if(u.type===_e&&gu(r),u.type===me){if(r.push(u),t.has(u))return!1;t.add(u)}}function s(u){u.type===me&&r.pop().break&&gu(r)}pr(e,n,s,!0)}function jo(e){return e.type===ie&&!e.hard?e.soft?"":" ":e.type===Te?e.flatContents:e}function cr(e){return yt(e,jo)}function Mo(e){switch(Se(e)){case Oe:if(e.parts.every(t=>t===""))return"";break;case me:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===me&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case $e:case Ve:case Qe:case ze:if(!e.contents)return"";break;case Te:if(!e.flatContents&&!e.breakContents)return"";break;case he:{let t=[];for(let r of e){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof M(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...s)}return t.length===0?"":t.length===1?t[0]:t}case qe:case st:case Ke:case We:case ie:case ge:case _e:break;default:throw new dt(e)}return e}function Ut(e){return yt(e,t=>Mo(t))}function ve(e,t=Rr){return yt(e,r=>typeof r=="string"?b(t,r.split(` +`)):r)}function Ro(e){if(e.type===ie)return!0}function bu(e){return Su(e,Ro,!1)}function lr(e,t){return e.type===ge?{...e,contents:t(e.contents)}:t(e)}function Pu(e){let t=!0;return pr(e,r=>{switch(Se(r)){case qe:if(r==="")break;case Ke:case We:case ie:case _e:return t=!1,!1}}),t}var Nn=()=>{},Ze=Nn,Gn=Nn,ku=Nn;function f(e){return Ze(e),{type:Ve,contents:e}}function Be(e,t){return Ze(t),{type:$e,contents:t,n:e}}function l(e,t={}){return Ze(e),Gn(t.expandedStates,!0),{type:me,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Iu(e){return Be(Number.NEGATIVE_INFINITY,e)}function Jr(e){return Be(-1,e)}function et(e,t){return l(e[0],{...t,expandedStates:e})}function qr(e){return ku(e),{type:Oe,parts:e}}function B(e,t="",r={}){return Ze(e),t!==""&&Ze(t),{type:Te,breakContents:e,flatContents:t,groupId:r.groupId}}function xt(e,t){return Ze(e),{type:Qe,contents:e,groupId:t.groupId,negate:t.negate}}function Un(e){return Ze(e),{type:ze,contents:e}}var je={type:We},Ee={type:_e};var Yn={type:ie,hard:!0},Jo={type:ie,hard:!0,literal:!0},x={type:ie},E={type:ie,soft:!0},F=[Yn,Ee],Rr=[Jo,Ee],mr={type:st};function b(e,t){Ze(e),Gn(t);let r=[];for(let n=0;n0){for(let s=0;s1&&t.every(r=>r.trimStart()[0]==="*")}var wu=qo;function Ou(e,t){let r=e.node;if(At(r))return t.originalText.slice(q(r),k(r)).trimEnd();if(ee(r))return wu(r)?Wo(r):["/*",ve(r.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(r))}function Wo(e){let t=e.value.split(` +`);return["/*",b(F,t.map((r,n)=>n===0?r.trimEnd():" "+(nVo,ownLine:()=>Ho,remaining:()=>$o});function No(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Xn(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=No(e)}function le(e,t){t.leading=!0,t.trailing=!1,Xn(e,t)}function Me(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Xn(e,t)}function V(e,t){t.leading=!1,t.trailing=!0,Xn(e,t)}function Go(e,t){let r=null,n=t;for(;n!==r;)r=n,n=Xe(e,n),n=_t(e,n),n=vt(e,n),n=He(e,n);return n}var it=Go;function Uo(e,t){let r=it(e,t);return r===!1?"":e.charAt(r)}var be=Uo;function Yo(e,t,r){for(let n=t;nt(e))}function Vo(e){return[Ko,Ru,vu,qu,Vn,$n,_u,ju,Ju,ap,pp,Qn,Dp,Kn,Fp,Cp,Tp].some(t=>t(e))}function $o(e){return[Wu,Vn,$n,Zo,up,Mu,Qn,sp,np,Ep,Kn,fp].some(t=>t(e))}function wt(e,t){let r=(e.body||e.properties).find(({type:n})=>n!=="EmptyStatement");r?le(r,t):Me(e,t)}function Hn(e,t){e.type==="BlockStatement"?wt(e,t):le(e,t)}function Ko({comment:e,followingNode:t}){return t&&Wr(e)?(le(t,e),!0):!1}function Vn({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){if((r==null?void 0:r.type)!=="IfStatement"||!n)return!1;if(be(s,k(e))===")")return V(t,e),!0;if(t===r.consequent&&n===r.alternate){let i=it(s,k(r.consequent));if(q(e)"?(Me(t,e),!0):!1}function up({comment:e,enclosingNode:t,text:r}){return be(r,k(e))!==")"?!1:t&&(Nu(t)&&z(t).length===0||mt(t)&&pe(t).length===0)?(Me(t,e),!0):((t==null?void 0:t.type)==="MethodDefinition"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&z(t.value).length===0?(Me(t.value,e),!0):!1}function ip({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(t==null?void 0:t.type)==="ComponentTypeParameter"&&((r==null?void 0:r.type)==="DeclareComponent"||(r==null?void 0:r.type)==="ComponentTypeAnnotation")&&(n==null?void 0:n.type)!=="ComponentTypeParameter"?(V(t,e),!0):((t==null?void 0:t.type)==="ComponentParameter"||(t==null?void 0:t.type)==="RestElement")&&(r==null?void 0:r.type)==="ComponentDeclaration"&&be(s,k(e))===")"?(V(t,e),!0):!1}function Ru({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(t==null?void 0:t.type)==="FunctionTypeParam"&&(r==null?void 0:r.type)==="FunctionTypeAnnotation"&&(n==null?void 0:n.type)!=="FunctionTypeParam"?(V(t,e),!0):((t==null?void 0:t.type)==="Identifier"||(t==null?void 0:t.type)==="AssignmentPattern"||(t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern"||(t==null?void 0:t.type)==="RestElement"||(t==null?void 0:t.type)==="TSParameterProperty")&&Nu(r)&&be(s,k(e))===")"?(V(t,e),!0):!ee(e)&&((r==null?void 0:r.type)==="FunctionDeclaration"||(r==null?void 0:r.type)==="FunctionExpression"||(r==null?void 0:r.type)==="ObjectMethod")&&(n==null?void 0:n.type)==="BlockStatement"&&r.body===n&&it(s,k(e))===q(n)?(wt(n,e),!0):!1}function Ju({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="LabeledStatement"?(le(t,e),!0):!1}function Kn({comment:e,enclosingNode:t}){return((t==null?void 0:t.type)==="ContinueStatement"||(t==null?void 0:t.type)==="BreakStatement")&&!t.label?(V(t,e),!0):!1}function ap({comment:e,precedingNode:t,enclosingNode:r}){return L(r)&&t&&r.callee===t&&r.arguments.length>0?(le(r.arguments[0],e),!0):!1}function op({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return we(r)?(or(e)&&(n.prettierIgnore=!0,e.unignore=!0),t?(V(t,e),!0):!1):(we(n)&&or(e)&&(n.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function pp({comment:e,enclosingNode:t}){return Ce(t)?(le(t,e),!0):!1}function Qn({comment:e,enclosingNode:t,ast:r,isLastComment:n}){var s;return((s=r==null?void 0:r.body)==null?void 0:s.length)===0?(n?Me(r,e):le(r,e),!0):(t==null?void 0:t.type)==="Program"&&t.body.length===0&&!O(t.directives)?(n?Me(t,e):le(t,e),!0):!1}function cp({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="ForInStatement"||(t==null?void 0:t.type)==="ForOfStatement"?(le(t,e),!0):!1}function qu({comment:e,precedingNode:t,enclosingNode:r,text:n}){if((r==null?void 0:r.type)==="ImportSpecifier"||(r==null?void 0:r.type)==="ExportSpecifier")return le(r,e),!0;let s=(t==null?void 0:t.type)==="ImportSpecifier"&&(r==null?void 0:r.type)==="ImportDeclaration",u=(t==null?void 0:t.type)==="ExportSpecifier"&&(r==null?void 0:r.type)==="ExportNamedDeclaration";return(s||u)&&Z(n,k(e))?(V(t,e),!0):!1}function lp({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="AssignmentPattern"?(le(t,e),!0):!1}var mp=new Set(["VariableDeclarator","AssignmentExpression","TypeAlias","TSTypeAliasDeclaration"]),yp=new Set(["ObjectExpression","RecordExpression","ArrayExpression","TupleExpression","TemplateLiteral","TaggedTemplateExpression","ObjectTypeAnnotation","TSTypeLiteral"]);function Dp({comment:e,enclosingNode:t,followingNode:r}){return mp.has(t==null?void 0:t.type)&&r&&(yp.has(r.type)||ee(e))?(le(r,e),!0):!1}function fp({comment:e,enclosingNode:t,followingNode:r,text:n}){return!r&&((t==null?void 0:t.type)==="TSMethodSignature"||(t==null?void 0:t.type)==="TSDeclareFunction"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&be(n,k(e))===";"?(V(t,e),!0):!1}function Wu({comment:e,enclosingNode:t,followingNode:r}){if(or(e)&&(t==null?void 0:t.type)==="TSMappedType"&&(r==null?void 0:r.type)==="TSTypeParameter"&&r.constraint)return t.prettierIgnore=!0,e.unignore=!0,!0}function Ep({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return(r==null?void 0:r.type)!=="TSMappedType"?!1:(n==null?void 0:n.type)==="TSTypeParameter"&&n.name?(le(n.name,e),!0):(t==null?void 0:t.type)==="TSTypeParameter"&&t.constraint?(V(t.constraint,e),!0):!1}function Fp({comment:e,enclosingNode:t,followingNode:r}){return!t||t.type!=="SwitchCase"||t.test||!r||r!==t.consequent[0]?!1:(r.type==="BlockStatement"&&At(e)?wt(r,e):Me(t,e),!0)}function Cp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return we(t)&&((r.type==="TSArrayType"||r.type==="ArrayTypeAnnotation")&&!n||Nt(r))?(V(M(!1,t.types,-1),e),!0):!1}function Ap({comment:e,enclosingNode:t,precedingNode:r,followingNode:n}){if(((t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern")&&(n==null?void 0:n.type)==="TSTypeAnnotation")return r?V(r,e):Me(t,e),!0}function Tp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){var s;if(!n&&(r==null?void 0:r.type)==="UnaryExpression"&&((t==null?void 0:t.type)==="LogicalExpression"||(t==null?void 0:t.type)==="BinaryExpression")){let u=((s=r.argument.loc)==null?void 0:s.start.line)!==t.right.loc.start.line,i=At(e)||e.loc.start.line===e.loc.end.line,a=e.loc.start.line===t.right.loc.start.line;if(u&&i&&a)return V(t.right,e),!0}return!1}var Nu=R(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration","ObjectMethod","ClassMethod","TSDeclareFunction","TSCallSignatureDeclaration","TSConstructSignatureDeclaration","TSMethodSignature","TSConstructorType","TSFunctionType","TSDeclareMethod"]);var dp=new Set(["EmptyStatement","TemplateElement","TSEmptyBodyFunctionExpression","ChainExpression"]);function xp(e){return!dp.has(e.type)}function hp(e,t){var r;if((t.parser==="typescript"||t.parser==="flow"||t.parser==="acorn"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree")&&e.type==="MethodDefinition"&&((r=e.value)==null?void 0:r.type)==="FunctionExpression"&&z(e.value).length===0&&!e.value.returnType&&!O(e.value.typeParameters)&&e.value.body)return[...e.decorators||[],e.key,e.value.body]}function Zn(e){let{node:t,parent:r}=e;return(X(t)||r&&(r.type==="JSXSpreadAttribute"||r.type==="JSXSpreadChild"||we(r)||(r.type==="ClassDeclaration"||r.type==="ClassExpression")&&r.superClass===t))&&(!Lt(t)||we(r))}function gp(e,{parser:t}){if(t==="flow"||t==="babel-flow")return e=Y(!1,e,/[\s(]/gu,""),e===""||e==="/*"||e==="/*::"}function Gu(e){switch(e){case"cr":return"\r";case"crlf":return`\r +`;default:return` +`}}var Pe=Symbol("MODE_BREAK"),at=Symbol("MODE_FLAT"),Yt=Symbol("cursor"),es=Symbol("DOC_FILL_PRINTED_LENGTH");function Uu(){return{value:"",length:0,queue:[]}}function Sp(e,t){return ts(e,{type:"indent"},t)}function Bp(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Uu():t<0?ts(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:ts(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function ts(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],s="",u=0,i=0,a=0;for(let c of n)switch(c.type){case"indent":y(),r.useTabs?o(1):p(r.tabWidth);break;case"stringAlign":y(),s+=c.n,u+=c.n.length;break;case"numberAlign":i+=1,a+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return m(),{...e,value:s,length:u,queue:n};function o(c){s+=" ".repeat(c),u+=r.tabWidth*c}function p(c){s+=" ".repeat(c),u+=c}function y(){r.useTabs?D():m()}function D(){i>0&&o(i),C()}function m(){a>0&&p(a),C()}function C(){i=0,a=0}}function rs(e){let t=0,r=0,n=e.length;e:for(;n--;){let s=e[n];if(s===Yt){r++;continue}for(let u=s.length-1;u>=0;u--){let i=s[u];if(i===" "||i===" ")t++;else{e[n]=s.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Yt);return t}function Nr(e,t,r,n,s,u){if(r===Number.POSITIVE_INFINITY)return!0;let i=t.length,a=[e],o=[];for(;r>=0;){if(a.length===0){if(i===0)return!0;a.push(t[--i]);continue}let{mode:p,doc:y}=a.pop(),D=Se(y);switch(D){case qe:o.push(y),r-=rt(y);break;case he:case Oe:{let m=D===he?y:y.parts,C=y[es]??0;for(let c=m.length-1;c>=C;c--)a.push({mode:p,doc:m[c]});break}case Ve:case $e:case Qe:case ge:a.push({mode:p,doc:y.contents});break;case Ke:r+=rs(o);break;case me:{if(u&&y.break)return!1;let m=y.break?Pe:p,C=y.expandedStates&&m===Pe?M(!1,y.expandedStates,-1):y.contents;a.push({mode:m,doc:C});break}case Te:{let C=(y.groupId?s[y.groupId]||at:p)===Pe?y.breakContents:y.flatContents;C&&a.push({mode:p,doc:C});break}case ie:if(p===Pe||y.hard)return!0;y.soft||(o.push(" "),r--);break;case ze:n=!0;break;case We:if(n)return!1;break}}return!1}function ns(e,t){let r={},n=t.printWidth,s=Gu(t.endOfLine),u=0,i=[{ind:Uu(),mode:Pe,doc:e}],a=[],o=!1,p=[],y=0;for(Bu(e);i.length>0;){let{ind:m,mode:C,doc:c}=i.pop();switch(Se(c)){case qe:{let A=s!==` +`?Y(!1,c,` +`,s):c;a.push(A),i.length>0&&(u+=rt(A));break}case he:for(let A=c.length-1;A>=0;A--)i.push({ind:m,mode:C,doc:c[A]});break;case st:if(y>=2)throw new Error("There are too many 'cursor' in doc.");a.push(Yt),y++;break;case Ve:i.push({ind:Sp(m,t),mode:C,doc:c.contents});break;case $e:i.push({ind:Bp(m,c.n,t),mode:C,doc:c.contents});break;case Ke:u-=rs(a);break;case me:switch(C){case at:if(!o){i.push({ind:m,mode:c.break?Pe:at,doc:c.contents});break}case Pe:{o=!1;let A={ind:m,mode:at,doc:c.contents},d=n-u,S=p.length>0;if(!c.break&&Nr(A,i,d,S,r))i.push(A);else if(c.expandedStates){let g=M(!1,c.expandedStates,-1);if(c.break){i.push({ind:m,mode:Pe,doc:g});break}else for(let _=1;_=c.expandedStates.length){i.push({ind:m,mode:Pe,doc:g});break}else{let v=c.expandedStates[_],j={ind:m,mode:at,doc:v};if(Nr(j,i,d,S,r)){i.push(j);break}}}else i.push({ind:m,mode:Pe,doc:c.contents});break}}c.id&&(r[c.id]=M(!1,i,-1).mode);break;case Oe:{let A=n-u,d=c[es]??0,{parts:S}=c,g=S.length-d;if(g===0)break;let _=S[d+0],v=S[d+1],j={ind:m,mode:at,doc:_},I={ind:m,mode:Pe,doc:_},G=Nr(j,[],A,p.length>0,r,!0);if(g===1){G?i.push(j):i.push(I);break}let P={ind:m,mode:at,doc:v},N={ind:m,mode:Pe,doc:v};if(g===2){G?i.push(P,j):i.push(N,I);break}let ue=S[d+2],Q={ind:m,mode:C,doc:{...c,[es]:d+2}};Nr({ind:m,mode:at,doc:[_,v,ue]},[],A,p.length>0,r,!0)?i.push(Q,P,j):G?i.push(Q,N,j):i.push(Q,N,I);break}case Te:case Qe:{let A=c.groupId?r[c.groupId]:C;if(A===Pe){let d=c.type===Te?c.breakContents:c.negate?c.contents:f(c.contents);d&&i.push({ind:m,mode:C,doc:d})}if(A===at){let d=c.type===Te?c.flatContents:c.negate?f(c.contents):c.contents;d&&i.push({ind:m,mode:C,doc:d})}break}case ze:p.push({ind:m,mode:C,doc:c.contents});break;case We:p.length>0&&i.push({ind:m,mode:C,doc:Yn});break;case ie:switch(C){case at:if(c.hard)o=!0;else{c.soft||(a.push(" "),u+=1);break}case Pe:if(p.length>0){i.push({ind:m,mode:C,doc:c},...p.reverse()),p.length=0;break}c.literal?m.root?(a.push(s,m.root.value),u=m.root.length):(a.push(s),u=0):(u-=rs(a),a.push(s+m.value),u=m.length);break}break;case ge:i.push({ind:m,mode:C,doc:c.contents});break;case _e:break;default:throw new dt(c)}i.length===0&&p.length>0&&(i.push(...p.reverse()),p.length=0)}let D=a.indexOf(Yt);if(D!==-1){let m=a.indexOf(Yt,D+1);if(m===-1)return{formatted:a.filter(d=>d!==Yt).join("")};let C=a.slice(0,D).join(""),c=a.slice(D+1,m).join(""),A=a.slice(m+1).join("");return{formatted:C+c+A,cursorNodeStart:C.length,cursorNodeText:c}}return{formatted:a.join("")}}function bp(e,t,r=0){let n=0;for(let s=r;s{if(i.push(t()),y.tail)return;let{tabWidth:D}=r,m=y.value.raw,C=m.includes(` +`)?Xu(m,D):o;o=C;let c=a[p],A=n[u][p],d=de(r.originalText,k(y),q(n.quasis[p+1]));if(!d){let g=ns(c,{...r,printWidth:Number.POSITIVE_INFINITY}).formatted;g.includes(` +`)?d=!0:c=g}d&&(T(A)||A.type==="Identifier"||W(A)||A.type==="ConditionalExpression"||A.type==="SequenceExpression"||Ae(A)||De(A))&&(c=[f([E,c]),E]);let S=C===0&&m.endsWith(` +`)?Be(Number.NEGATIVE_INFINITY,c):Lu(c,C,D);i.push(l(["${",S,je,"}"]))},"quasis"),i.push("`"),i}function Hu(e,t){let r=t("quasi");return ut(r.label&&{tagged:!0,...r.label},[t("tag"),t(e.node.typeArguments?"typeArguments":"typeParameters"),je,r])}function kp(e,t,r){let{node:n}=e,s=n.quasis[0].value.raw.trim().split(/\s*\|\s*/u);if(s.length>1||s.some(u=>u.length>0)){t.__inJestEach=!0;let u=e.map(r,"expressions");t.__inJestEach=!1;let i=[],a=u.map(m=>"${"+ns(m,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),o=[{hasLineBreak:!1,cells:[]}];for(let m=1;mm.cells.length)),y=Array.from({length:p}).fill(0),D=[{cells:s},...o.filter(m=>m.cells.length>0)];for(let{cells:m}of D.filter(C=>!C.hasLineBreak))for(let[C,c]of m.entries())y[C]=Math.max(y[C],rt(c));return i.push(je,"`",f([F,b(F,D.map(m=>b(" | ",m.cells.map((C,c)=>m.hasLineBreak?C:C+" ".repeat(y[c]-rt(C))))))]),F,"`"),i}}function Ip(e,t){let{node:r}=e,n=t();return T(r)&&(n=l([f([E,n]),E])),["${",n,je,"}"]}function Xt(e,t){return e.map(r=>Ip(r,t),"expressions")}function Ur(e,t){return yt(e,r=>typeof r=="string"?t?Y(!1,r,/(\\*)`/gu,"$1$1\\`"):ss(r):r)}function ss(e){return Y(!1,e,/([\\`]|\$\{)/gu,String.raw`\$1`)}function Lp({node:e,parent:t}){let r=/^[fx]?(?:describe|it|test)$/u;return t.type==="TaggedTemplateExpression"&&t.quasi===e&&t.tag.type==="MemberExpression"&&t.tag.property.type==="Identifier"&&t.tag.property.name==="each"&&(t.tag.object.type==="Identifier"&&r.test(t.tag.object.name)||t.tag.object.type==="MemberExpression"&&t.tag.object.property.type==="Identifier"&&(t.tag.object.property.name==="only"||t.tag.object.property.name==="skip")&&t.tag.object.object.type==="Identifier"&&r.test(t.tag.object.object.name))}var is=[(e,t)=>e.type==="ObjectExpression"&&t==="properties",(e,t)=>e.type==="CallExpression"&&e.callee.type==="Identifier"&&e.callee.name==="Component"&&t==="arguments",(e,t)=>e.type==="Decorator"&&t==="expression"];function Vu(e){let t=n=>n.type==="TemplateLiteral",r=(n,s)=>Ce(n)&&!n.computed&&n.key.type==="Identifier"&&n.key.name==="styles"&&s==="value";return e.match(t,(n,s)=>U(n)&&s==="elements",r,...is)||e.match(t,r,...is)}function $u(e){return e.match(t=>t.type==="TemplateLiteral",(t,r)=>Ce(t)&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="template"&&r==="value",...is)}function us(e,t){return T(e,h.Block|h.Leading,({value:r})=>r===` ${t} `)}function Yr({node:e,parent:t},r){return us(e,r)||wp(t)&&us(t,r)||t.type==="ExpressionStatement"&&us(t,r)}function wp(e){return e.type==="AsConstExpression"||e.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const"}async function Op(e,t,r){let{node:n}=r,s=n.quasis.map(y=>y.value.raw),u=0,i=s.reduce((y,D,m)=>m===0?D:y+"@prettier-placeholder-"+u+++"-id"+D,""),a=await e(i,{parser:"scss"}),o=Xt(r,t),p=_p(a,o);if(!p)throw new Error("Couldn't insert all the expressions");return["`",f([F,p]),E,"`"]}function _p(e,t){if(!O(t))return e;let r=0,n=yt(Ut(e),s=>typeof s!="string"||!s.includes("@prettier-placeholder")?s:s.split(/@prettier-placeholder-(\d+)-id/u).map((u,i)=>i%2===0?ve(u):(r++,t[u])));return t.length===r?n:null}function vp({node:e,parent:t,grandparent:r}){return r&&e.quasis&&t.type==="JSXExpressionContainer"&&r.type==="JSXElement"&&r.openingElement.name.name==="style"&&r.openingElement.attributes.some(n=>n.type==="JSXAttribute"&&n.name.name==="jsx")||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="css"||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="MemberExpression"&&t.tag.object.name==="css"&&(t.tag.property.name==="global"||t.tag.property.name==="resolve")}function Xr(e){return e.type==="Identifier"&&e.name==="styled"}function Ku(e){return/^[A-Z]/u.test(e.object.name)&&e.property.name==="extend"}function jp({parent:e}){if(!e||e.type!=="TaggedTemplateExpression")return!1;let t=e.tag.type==="ParenthesizedExpression"?e.tag.expression:e.tag;switch(t.type){case"MemberExpression":return Xr(t.object)||Ku(t);case"CallExpression":return Xr(t.callee)||t.callee.type==="MemberExpression"&&(t.callee.object.type==="MemberExpression"&&(Xr(t.callee.object.object)||Ku(t.callee.object))||t.callee.object.type==="CallExpression"&&Xr(t.callee.object.callee));case"Identifier":return t.name==="css";default:return!1}}function Mp({parent:e,grandparent:t}){return(t==null?void 0:t.type)==="JSXAttribute"&&e.type==="JSXExpressionContainer"&&t.name.type==="JSXIdentifier"&&t.name.name==="css"}function Rp(e){if(vp(e)||jp(e)||Mp(e)||Vu(e))return Op}var Qu=Rp;async function Jp(e,t,r){let{node:n}=r,s=n.quasis.length,u=Xt(r,t),i=[];for(let a=0;a2&&m[0].trim()===""&&m[1].trim()==="",d=C>2&&m[C-1].trim()===""&&m[C-2].trim()==="",S=m.every(_=>/^\s*(?:#[^\n\r]*)?$/u.test(_));if(!y&&/#[^\n\r]*$/u.test(m[C-1]))return null;let g=null;S?g=qp(m):g=await e(D,{parser:"graphql"}),g?(g=Ur(g,!1),!p&&A&&i.push(""),i.push(g),!y&&d&&i.push("")):!p&&!y&&A&&i.push(""),c&&i.push(c)}return["`",f([F,b(F,i)]),F,"`"]}function qp(e){let t=[],r=!1,n=e.map(s=>s.trim());for(let[s,u]of n.entries())u!==""&&(n[s-1]===""&&r?t.push([F,u]):t.push(u),r=!0);return t.length===0?null:b(F,t)}function Wp({node:e,parent:t}){return Yr({node:e,parent:t},"GraphQL")||t&&(t.type==="TaggedTemplateExpression"&&(t.tag.type==="MemberExpression"&&t.tag.object.name==="graphql"&&t.tag.property.name==="experimental"||t.tag.type==="Identifier"&&(t.tag.name==="gql"||t.tag.name==="graphql"))||t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="graphql")}function Np(e){if(Wp(e))return Jp}var zu=Np;var as=0;async function Zu(e,t,r,n,s){let{node:u}=n,i=as;as=as+1>>>0;let a=S=>`PRETTIER_HTML_PLACEHOLDER_${S}_${i}_IN_JS`,o=u.quasis.map((S,g,_)=>g===_.length-1?S.value.cooked:S.value.cooked+a(g)).join(""),p=Xt(n,r),y=new RegExp(a(String.raw`(\d+)`),"gu"),D=0,m=await t(o,{parser:e,__onHtmlRoot(S){D=S.children.length}}),C=yt(m,S=>{if(typeof S!="string")return S;let g=[],_=S.split(y);for(let v=0;v<_.length;v++){let j=_[v];if(v%2===0){j&&(j=ss(j),s.__embeddedInHtml&&(j=Y(!1,j,/<\/(?=script\b)/giu,String.raw`<\/`)),g.push(j));continue}let I=Number(j);g.push(p[I])}return g}),c=/^\s/u.test(o)?" ":"",A=/\s$/u.test(o)?" ":"",d=s.htmlWhitespaceSensitivity==="ignore"?F:c&&A?x:null;return d?l(["`",f([d,l(C)]),d,"`"]):ut({hug:!1},l(["`",c,D>1?f(l(C)):l(C),A,"`"]))}function Gp(e){return Yr(e,"HTML")||e.match(t=>t.type==="TemplateLiteral",(t,r)=>t.type==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="html"&&r==="quasi")}var Up=Zu.bind(void 0,"html"),Yp=Zu.bind(void 0,"angular");function Xp(e){if(Gp(e))return Up;if($u(e))return Yp}var ei=Xp;async function Hp(e,t,r){let{node:n}=r,s=Y(!1,n.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(o,p)=>"\\".repeat(p.length/2)+"`"),u=Vp(s),i=u!=="";i&&(s=Y(!1,s,new RegExp(`^${u}`,"gmu"),""));let a=Ur(await e(s,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",i?f([E,a]):[Rr,Iu(a)],E,"`"]}function Vp(e){let t=e.match(/^([^\S\n]*)\S/mu);return t===null?"":t[1]}function $p(e){if(Kp(e))return Hp}function Kp({node:e,parent:t}){return(t==null?void 0:t.type)==="TaggedTemplateExpression"&&e.quasis.length===1&&t.tag.type==="Identifier"&&(t.tag.name==="md"||t.tag.name==="markdown")}var ti=$p;function Qp(e){let{node:t}=e;if(t.type!=="TemplateLiteral"||zp(t))return;let r;for(let n of[Qu,zu,ei,ti])if(r=n(e),!!r)return t.quasis.length===1&&t.quasis[0].value.raw.trim()===""?"``":async(...s)=>{let u=await r(...s);return u&&ut({embed:!0,...u.label},u)}}function zp({quasis:e}){return e.some(({value:{cooked:t}})=>t===null)}var ri=Qp;var Zp=/\*\/$/,ec=/^\/\*\*?/,ii=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,tc=/(^|\s+)\/\/([^\n\r]*)/g,ni=/^(\r?\n)+/,rc=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,si=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,nc=/(\r?\n|^) *\* ?/g,ai=[];function oi(e){let t=e.match(ii);return t?t[0].trimStart():""}function pi(e){let t=e.match(ii),r=t==null?void 0:t[0];return r==null?e:e.slice(r.length)}function ci(e){let t=` +`;e=Y(!1,e.replace(ec,"").replace(Zp,""),nc,"$1");let r="";for(;r!==e;)r=e,e=Y(!1,e,rc,`${t}$1 $2${t}`);e=e.replace(ni,"").trimEnd();let n=Object.create(null),s=Y(!1,e,si,"").replace(ni,"").trimEnd(),u;for(;u=si.exec(e);){let i=Y(!1,u[2],tc,"");if(typeof n[u[1]]=="string"||Array.isArray(n[u[1]])){let a=n[u[1]];n[u[1]]=[...ai,...Array.isArray(a)?a:[a],i]}else n[u[1]]=i}return{comments:s,pragmas:n}}function li({comments:e="",pragmas:t={}}){let r=` +`,n="/**",s=" *",u=" */",i=Object.keys(t),a=i.flatMap(p=>ui(p,t[p])).map(p=>`${s} ${p}${r}`).join("");if(!e){if(i.length===0)return"";if(i.length===1&&!Array.isArray(t[i[0]])){let p=t[i[0]];return`${n} ${ui(i[0],p)[0]}${u}`}}let o=e.split(r).map(p=>`${s} ${p}`).join(r)+r;return n+r+(e?o:"")+(e&&i.length>0?s+r:"")+a+u}function ui(e,t){return[...ai,...Array.isArray(t)?t:[t]].map(r=>`@${e} ${r}`.trim())}function sc(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` +`);return t===-1?e:e.slice(0,t)}var mi=sc;function uc(e){let t=mi(e);t&&(e=e.slice(t.length+1));let r=oi(e),{pragmas:n,comments:s}=ci(r);return{shebang:t,text:e,pragmas:n,comments:s}}function yi(e){let{shebang:t,text:r,pragmas:n,comments:s}=uc(e),u=pi(r),i=li({pragmas:{format:"",...n},comments:s.trimStart()});return(t?`${t} +`:"")+i+(u.startsWith(` +`)?` +`:` + +`)+u}function ic(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:s,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:a}=e,o=s(a),p=u(a);for(let y of n)s(y)>=o&&u(y)<=p&&i.add(y);return r.slice(o,p)}var Di=ic;function os(e,t){var u,i,a,o,p,y,D,m,C;if(e.isRoot)return!1;let{node:r,key:n,parent:s}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&cc(r)&&yr(e))return!0;if(ac(r))return!1;if(r.type==="Identifier"){if((u=r.extra)!=null&&u.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(r.name)||n==="left"&&(r.name==="async"&&!s.await||r.name==="let")&&s.type==="ForOfStatement")return!0;if(r.name==="let"){let c=(i=e.findAncestor(A=>A.type==="ForOfStatement"))==null?void 0:i.left;if(c&&ae(c,A=>A===r))return!0}if(n==="object"&&r.name==="let"&&s.type==="MemberExpression"&&s.computed&&!s.optional){let c=e.findAncestor(d=>d.type==="ExpressionStatement"||d.type==="ForStatement"||d.type==="ForInStatement"),A=c?c.type==="ExpressionStatement"?c.expression:c.type==="ForStatement"?c.init:c.left:void 0;if(A&&ae(A,d=>d===r))return!0}if(n==="expression")switch(r.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let c=e.findAncestor(A=>!Ae(A));if(c!==s&&c.type==="ExpressionStatement")return!0}}return!1}if(r.type==="ObjectExpression"||r.type==="FunctionExpression"||r.type==="ClassExpression"||r.type==="DoExpression"){let c=(a=e.findAncestor(A=>A.type==="ExpressionStatement"))==null?void 0:a.expression;if(c&&ae(c,A=>A===r))return!0}if(r.type==="ObjectExpression"){let c=(o=e.findAncestor(A=>A.type==="ArrowFunctionExpression"))==null?void 0:o.body;if(c&&c.type!=="SequenceExpression"&&c.type!=="AssignmentExpression"&&ae(c,A=>A===r))return!0}switch(s.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(n==="superClass"&&(r.type==="ArrowFunctionExpression"||r.type==="AssignmentExpression"||r.type==="AwaitExpression"||r.type==="BinaryExpression"||r.type==="ConditionalExpression"||r.type==="LogicalExpression"||r.type==="NewExpression"||r.type==="ObjectExpression"||r.type==="SequenceExpression"||r.type==="TaggedTemplateExpression"||r.type==="UnaryExpression"||r.type==="UpdateExpression"||r.type==="YieldExpression"||r.type==="TSNonNullExpression"||r.type==="ClassExpression"&&O(r.decorators)))return!0;break;case"ExportDefaultDeclaration":return fi(e,t)||r.type==="SequenceExpression";case"Decorator":if(n==="expression"&&!mc(r))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression")&&pc(r))return!0;break;case"BinaryExpression":if(n==="left"&&(s.operator==="in"||s.operator==="instanceof")&&r.type==="UnaryExpression")return!0;break;case"VariableDeclarator":if(n==="init"&&e.match(void 0,void 0,(c,A)=>A==="declarations"&&c.type==="VariableDeclaration",(c,A)=>A==="left"&&c.type==="ForInStatement"))return!0;break}switch(r.type){case"UpdateExpression":if(s.type==="UnaryExpression")return r.prefix&&(r.operator==="++"&&s.operator==="+"||r.operator==="--"&&s.operator==="-");case"UnaryExpression":switch(s.type){case"UnaryExpression":return r.operator===s.operator&&(r.operator==="+"||r.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"BinaryExpression":return n==="left"&&s.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(s.type==="UpdateExpression"||r.operator==="in"&&oc(e))return!0;if(r.operator==="|>"&&((p=r.extra)!=null&&p.parenthesized)){let c=e.grandparent;if(c.type==="BinaryExpression"&&c.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(s.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!Ae(r);case"ConditionalExpression":return Ae(r)||lu(r);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return n==="callee";case"ClassExpression":case"ClassDeclaration":return n==="superClass";case"TSTypeAssertion":case"TaggedTemplateExpression":case"UnaryExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"AssignmentExpression":case"AssignmentPattern":return n==="left"&&(r.type==="TSTypeAssertion"||Ae(r));case"LogicalExpression":if(r.type==="LogicalExpression")return s.operator!==r.operator;case"BinaryExpression":{let{operator:c,type:A}=r;if(!c&&A!=="TSTypeAssertion")return!0;let d=sr(c),S=s.operator,g=sr(S);return g>d||n==="right"&&g===d||g===d&&!ar(S,c)?!0:g");default:return!1}case"TSFunctionType":if(e.match(c=>c.type==="TSFunctionType",(c,A)=>A==="typeAnnotation"&&c.type==="TSTypeAnnotation",(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression"))return!0;case"TSConditionalType":case"TSConstructorType":case"ConditionalTypeAnnotation":if(n==="extendsType"&&Je(r)&&s.type===r.type||n==="checkType"&&Je(s))return!0;if(n==="extendsType"&&s.type==="TSConditionalType"){let{typeAnnotation:c}=r.returnType||r.typeAnnotation;if(c.type==="TSTypePredicate"&&c.typeAnnotation&&(c=c.typeAnnotation.typeAnnotation),c.type==="TSInferType"&&c.typeParameter.constraint)return!0}case"TSUnionType":case"TSIntersectionType":if((we(s)||Nt(s))&&s.types.length>1&&(!r.types||r.types.length>1))return!0;case"TSInferType":if(r.type==="TSInferType"){if(s.type==="TSRestType")return!1;if(n==="types"&&(s.type==="TSUnionType"||s.type==="TSIntersectionType")&&r.typeParameter.type==="TSTypeParameter"&&r.typeParameter.constraint)return!0}case"TSTypeOperator":return s.type==="TSArrayType"||s.type==="TSOptionalType"||s.type==="TSRestType"||n==="objectType"&&s.type==="TSIndexedAccessType"||s.type==="TSTypeOperator"||s.type==="TSTypeAnnotation"&&e.grandparent.type.startsWith("TSJSDoc");case"TSTypeQuery":return n==="objectType"&&s.type==="TSIndexedAccessType"||n==="elementType"&&s.type==="TSArrayType";case"TypeOperator":return s.type==="ArrayTypeAnnotation"||s.type==="NullableTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||s.type==="TypeOperator";case"TypeofTypeAnnotation":return n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||n==="elementType"&&s.type==="ArrayTypeAnnotation";case"ArrayTypeAnnotation":return s.type==="NullableTypeAnnotation";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return s.type==="TypeOperator"||s.type==="ArrayTypeAnnotation"||s.type==="NullableTypeAnnotation"||s.type==="IntersectionTypeAnnotation"||s.type==="UnionTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType");case"InferTypeAnnotation":case"NullableTypeAnnotation":return s.type==="ArrayTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType");case"ComponentTypeAnnotation":case"FunctionTypeAnnotation":{if(r.type==="ComponentTypeAnnotation"&&(r.rendersType===null||r.rendersType===void 0))return!1;if(e.match(void 0,(A,d)=>d==="typeAnnotation"&&A.type==="TypeAnnotation",(A,d)=>d==="returnType"&&A.type==="ArrowFunctionExpression")||e.match(void 0,(A,d)=>d==="typeAnnotation"&&A.type==="TypePredicate",(A,d)=>d==="typeAnnotation"&&A.type==="TypeAnnotation",(A,d)=>d==="returnType"&&A.type==="ArrowFunctionExpression"))return!0;let c=s.type==="NullableTypeAnnotation"?e.grandparent:s;return c.type==="UnionTypeAnnotation"||c.type==="IntersectionTypeAnnotation"||c.type==="ArrayTypeAnnotation"||n==="objectType"&&(c.type==="IndexedAccessType"||c.type==="OptionalIndexedAccessType")||n==="checkType"&&s.type==="ConditionalTypeAnnotation"||n==="extendsType"&&s.type==="ConditionalTypeAnnotation"&&((y=r.returnType)==null?void 0:y.type)==="InferTypeAnnotation"&&((D=r.returnType)==null?void 0:D.typeParameter.bound)||c.type==="NullableTypeAnnotation"||s.type==="FunctionTypeParam"&&s.name===null&&z(r).some(A=>{var d;return((d=A.typeAnnotation)==null?void 0:d.type)==="NullableTypeAnnotation"})}case"OptionalIndexedAccessType":return n==="objectType"&&s.type==="IndexedAccessType";case"StringLiteral":case"NumericLiteral":case"Literal":if(typeof r.value=="string"&&s.type==="ExpressionStatement"&&!s.directive){let c=e.grandparent;return c.type==="Program"||c.type==="BlockStatement"}return n==="object"&&s.type==="MemberExpression"&&typeof r.value=="number";case"AssignmentExpression":{let c=e.grandparent;return n==="body"&&s.type==="ArrowFunctionExpression"?!0:n==="key"&&(s.type==="ClassProperty"||s.type==="PropertyDefinition")&&s.computed||(n==="init"||n==="update")&&s.type==="ForStatement"?!1:s.type==="ExpressionStatement"?r.left.type==="ObjectPattern":!(n==="key"&&s.type==="TSPropertySignature"||s.type==="AssignmentExpression"||s.type==="SequenceExpression"&&c.type==="ForStatement"&&(c.init===s||c.update===s)||n==="value"&&s.type==="Property"&&c.type==="ObjectPattern"&&c.properties.includes(s)||s.type==="NGChainedExpression"||n==="node"&&s.type==="JsExpressionRoot")}case"ConditionalExpression":switch(s.type){case"TaggedTemplateExpression":case"UnaryExpression":case"SpreadElement":case"BinaryExpression":case"LogicalExpression":case"NGPipeExpression":case"ExportDefaultDeclaration":case"AwaitExpression":case"JSXSpreadAttribute":case"TSTypeAssertion":case"TypeCastExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"ConditionalExpression":return t.experimentalTernaries?!1:n==="test";case"MemberExpression":case"OptionalMemberExpression":return n==="object";default:return!1}case"FunctionExpression":switch(s.type){case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"TaggedTemplateExpression":return!0;default:return!1}case"ArrowFunctionExpression":switch(s.type){case"BinaryExpression":return s.operator!=="|>"||((m=r.extra)==null?void 0:m.parenthesized);case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":case"BindExpression":case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"AwaitExpression":case"TSTypeAssertion":return!0;case"ConditionalExpression":return n==="test";default:return!1}case"ClassExpression":switch(s.type){case"NewExpression":return n==="callee";default:return!1}case"OptionalMemberExpression":case"OptionalCallExpression":case"CallExpression":case"MemberExpression":if(lc(e))return!0;case"TaggedTemplateExpression":case"TSNonNullExpression":if(n==="callee"&&(s.type==="BindExpression"||s.type==="NewExpression")){let c=r;for(;c;)switch(c.type){case"CallExpression":case"OptionalCallExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":case"BindExpression":c=c.object;break;case"TaggedTemplateExpression":c=c.tag;break;case"TSNonNullExpression":c=c.expression;break;default:return!1}}return!1;case"BindExpression":return n==="callee"&&(s.type==="BindExpression"||s.type==="NewExpression")||n==="object"&&W(s);case"NGPipeExpression":return!(s.type==="NGRoot"||s.type==="NGMicrosyntaxExpression"||s.type==="ObjectProperty"&&!((C=r.extra)!=null&&C.parenthesized)||U(s)||n==="arguments"&&L(s)||n==="right"&&s.type==="NGPipeExpression"||n==="property"&&s.type==="MemberExpression"||s.type==="AssignmentExpression");case"JSXFragment":case"JSXElement":return n==="callee"||n==="left"&&s.type==="BinaryExpression"&&s.operator==="<"||!U(s)&&s.type!=="ArrowFunctionExpression"&&s.type!=="AssignmentExpression"&&s.type!=="AssignmentPattern"&&s.type!=="BinaryExpression"&&s.type!=="NewExpression"&&s.type!=="ConditionalExpression"&&s.type!=="ExpressionStatement"&&s.type!=="JsExpressionRoot"&&s.type!=="JSXAttribute"&&s.type!=="JSXElement"&&s.type!=="JSXExpressionContainer"&&s.type!=="JSXFragment"&&s.type!=="LogicalExpression"&&!L(s)&&!Ce(s)&&s.type!=="ReturnStatement"&&s.type!=="ThrowStatement"&&s.type!=="TypeCastExpression"&&s.type!=="VariableDeclarator"&&s.type!=="YieldExpression";case"TSInstantiationExpression":return n==="object"&&W(s)}return!1}var ac=R(["BlockStatement","BreakStatement","ComponentDeclaration","ClassBody","ClassDeclaration","ClassMethod","ClassProperty","PropertyDefinition","ClassPrivateProperty","ContinueStatement","DebuggerStatement","DeclareComponent","DeclareClass","DeclareExportAllDeclaration","DeclareExportDeclaration","DeclareFunction","DeclareHook","DeclareInterface","DeclareModule","DeclareModuleExports","DeclareNamespace","DeclareVariable","DeclareEnum","DoWhileStatement","EnumDeclaration","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExpressionStatement","ForInStatement","ForOfStatement","ForStatement","FunctionDeclaration","HookDeclaration","IfStatement","ImportDeclaration","InterfaceDeclaration","LabeledStatement","MethodDefinition","ReturnStatement","SwitchStatement","ThrowStatement","TryStatement","TSDeclareFunction","TSEnumDeclaration","TSImportEqualsDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSNamespaceExportDeclaration","TypeAlias","VariableDeclaration","WhileStatement","WithStatement"]);function oc(e){let t=0,{node:r}=e;for(;r;){let n=e.getParentNode(t++);if((n==null?void 0:n.type)==="ForStatement"&&n.init===r)return!0;r=n}return!1}function pc(e){return ur(e,t=>t.type==="ObjectTypeAnnotation"&&ur(t,r=>r.type==="FunctionTypeAnnotation"))}function cc(e){return se(e)}function yr(e){let{parent:t,key:r}=e;switch(t.type){case"NGPipeExpression":if(r==="arguments"&&e.isLast)return e.callParent(yr);break;case"ObjectProperty":if(r==="value")return e.callParent(()=>e.key==="properties"&&e.isLast);break;case"BinaryExpression":case"LogicalExpression":if(r==="right")return e.callParent(yr);break;case"ConditionalExpression":if(r==="alternate")return e.callParent(yr);break;case"UnaryExpression":if(t.prefix)return e.callParent(yr);break}return!1}function fi(e,t){let{node:r,parent:n}=e;return r.type==="FunctionExpression"||r.type==="ClassExpression"?n.type==="ExportDefaultDeclaration"||!os(e,t):!Jt(r)||n.type!=="ExportDefaultDeclaration"&&os(e,t)?!1:e.call(()=>fi(e,t),...Lr(r))}function lc(e){return!!(e.match(void 0,(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&(t.type==="CallExpression"||t.type==="NewExpression"))||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression")||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression")&&(e.match(void 0,void 0,(t,r)=>r==="callee"&&(t.type==="CallExpression"&&!t.optional||t.type==="NewExpression")||r==="object"&&t.type==="MemberExpression"&&!t.optional)||e.match(void 0,void 0,(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression"))||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression"))}function ps(e){return e.type==="Identifier"?!0:W(e)?!e.computed&&!e.optional&&e.property.type==="Identifier"&&ps(e.object):!1}function mc(e){return e.type==="ChainExpression"&&(e=e.expression),ps(e)||L(e)&&!e.optional&&ps(e.callee)}var ke=os;function yc(e,t){let r=t-1;r=Xe(e,r,{backwards:!0}),r=He(e,r,{backwards:!0}),r=Xe(e,r,{backwards:!0});let n=He(e,r,{backwards:!0});return r!==n}var Ei=yc;var Dc=()=>!0;function cs(e,t){let r=e.node;return r.printed=!0,t.printer.printComment(e,t)}function fc(e,t){var y;let r=e.node,n=[cs(e,t)],{printer:s,originalText:u,locStart:i,locEnd:a}=t;if((y=s.isBlockComment)==null?void 0:y.call(s,r)){let D=Z(u,a(r))?Z(u,i(r),{backwards:!0})?F:x:" ";n.push(D)}else n.push(F);let p=He(u,Xe(u,a(r)));return p!==!1&&Z(u,p)&&n.push(F),n}function Ec(e,t,r){var p;let n=e.node,s=cs(e,t),{printer:u,originalText:i,locStart:a}=t,o=(p=u.isBlockComment)==null?void 0:p.call(u,n);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||Z(i,a(n),{backwards:!0})){let y=Ei(i,a(n));return{doc:Un([F,y?F:"",s]),isBlock:o,hasLineSuffix:!0}}return!o||r!=null&&r.hasLineSuffix?{doc:[Un([" ",s]),Ee],isBlock:o,hasLineSuffix:!0}:{doc:[" ",s],isBlock:o,hasLineSuffix:!1}}function J(e,t,r={}){let{node:n}=e;if(!O(n==null?void 0:n.comments))return"";let{indent:s=!1,marker:u,filter:i=Dc}=r,a=[];if(e.each(({node:p})=>{p.leading||p.trailing||p.marker!==u||!i(p)||a.push(cs(e,t))},"comments"),a.length===0)return"";let o=b(F,a);return s?f([F,o]):o}function ls(e,t){let r=e.node;if(!r)return{};let n=t[Symbol.for("printedComments")];if((r.comments||[]).filter(o=>!n.has(o)).length===0)return{leading:"",trailing:""};let u=[],i=[],a;return e.each(()=>{let o=e.node;if(n!=null&&n.has(o))return;let{leading:p,trailing:y}=o;p?u.push(fc(e,t)):y&&(a=Ec(e,t,a),i.push(a.doc))},"comments"),{leading:u,trailing:i}}function ye(e,t,r){let{leading:n,trailing:s}=ls(e,r);return!n&&!s?t:lr(t,u=>[n,u,s])}var ms=class extends Error{name="UnexpectedNodeError";constructor(t,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`),this.node=t}},Ne=ms;function ys(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Ge,Ds=class{constructor(t){Us(this,Ge);Ys(this,Ge,new Set(t))}getLeadingWhitespaceCount(t){let r=ct(this,Ge),n=0;for(let s=0;s=0&&r.has(t.charAt(s));s--)n++;return n}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return ct(this,Ge).has(t.charAt(0))}hasTrailingWhitespace(t){return ct(this,Ge).has(M(!1,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let n=`[${ys([...ct(this,Ge)].join(""))}]+`,s=new RegExp(r?`(${n})`:n,"u");return t.split(s)}hasWhitespaceCharacter(t){let r=ct(this,Ge);return Array.prototype.some.call(t,n=>r.has(n))}hasNonWhitespaceCharacter(t){let r=ct(this,Ge);return Array.prototype.some.call(t,n=>!r.has(n))}isWhitespaceOnly(t){let r=ct(this,Ge);return Array.prototype.every.call(t,n=>r.has(n))}};Ge=new WeakMap;var Fi=Ds;var Hr=new Fi(` +\r `),fs=e=>e===""||e===x||e===F||e===E;function Fc(e,t,r){var _,v,j,I,G;let{node:n}=e;if(n.type==="JSXElement"&&Lc(n))return[r("openingElement"),r("closingElement")];let s=n.type==="JSXElement"?r("openingElement"):r("openingFragment"),u=n.type==="JSXElement"?r("closingElement"):r("closingFragment");if(n.children.length===1&&n.children[0].type==="JSXExpressionContainer"&&(n.children[0].expression.type==="TemplateLiteral"||n.children[0].expression.type==="TaggedTemplateExpression"))return[s,...e.map(r,"children"),u];n.children=n.children.map(P=>wc(P)?{type:"JSXText",value:" ",raw:" "}:P);let i=n.children.some(X),a=n.children.filter(P=>P.type==="JSXExpressionContainer").length>1,o=n.type==="JSXElement"&&n.openingElement.attributes.length>1,p=re(s)||i||o||a,y=e.parent.rootMarker==="mdx",D=t.singleQuote?"{' '}":'{" "}',m=y?x:B([D,E]," "),C=((v=(_=n.openingElement)==null?void 0:_.name)==null?void 0:v.name)==="fbt",c=Cc(e,t,r,m,C),A=n.children.some(P=>Dr(P));for(let P=c.length-2;P>=0;P--){let N=c[P]===""&&c[P+1]==="",ue=c[P]===F&&c[P+1]===""&&c[P+2]===F,Q=(c[P]===E||c[P]===F)&&c[P+1]===""&&c[P+2]===m,Bt=c[P]===m&&c[P+1]===""&&(c[P+2]===E||c[P+2]===F),Ct=c[P]===m&&c[P+1]===""&&c[P+2]===m,w=c[P]===E&&c[P+1]===""&&c[P+2]===F||c[P]===F&&c[P+1]===""&&c[P+2]===E;ue&&A||N||Q||Ct||w?c.splice(P,2):Bt&&c.splice(P+1,2)}for(;c.length>0&&fs(M(!1,c,-1));)c.pop();for(;c.length>1&&fs(c[0])&&fs(c[1]);)c.shift(),c.shift();let d=[""];for(let[P,N]of c.entries()){if(N===m){if(P===1&&Pu(c[P-1])){if(c.length===2){d.push([d.pop(),D]);continue}d.push([D,F],"");continue}else if(P===c.length-1){d.push([d.pop(),D]);continue}else if(c[P-1]===""&&c[P-2]===F){d.push([d.pop(),D]);continue}}P%2===0?d.push([d.pop(),N]):d.push(N,""),re(N)&&(p=!0)}let S=A?qr(d):l(d,{shouldBreak:!0});if(((j=t.cursorNode)==null?void 0:j.type)==="JSXText"&&n.children.includes(t.cursorNode)?S=[mr,S,mr]:((I=t.nodeBeforeCursor)==null?void 0:I.type)==="JSXText"&&n.children.includes(t.nodeBeforeCursor)?S=[mr,S]:((G=t.nodeAfterCursor)==null?void 0:G.type)==="JSXText"&&n.children.includes(t.nodeAfterCursor)&&(S=[S,mr]),y)return S;let g=l([s,f([F,S]),F,u]);return p?g:et([l([s,...c,u]),g])}function Cc(e,t,r,n,s){let u="",i=[u];function a(p){u=p,i.push([i.pop(),p])}function o(p){p!==""&&(u=p,i.push(p,""))}return e.each(({node:p,next:y})=>{if(p.type==="JSXText"){let D=fe(p);if(Dr(p)){let m=Hr.split(D,!0);m[0]===""&&(m.shift(),/\n/u.test(m[0])?o(Ai(s,m[1],p,y)):o(n),m.shift());let C;if(M(!1,m,-1)===""&&(m.pop(),C=m.pop()),m.length===0)return;for(let[c,A]of m.entries())c%2===1?o(x):a(A);C!==void 0?/\n/u.test(C)?o(Ai(s,u,p,y)):o(n):o(Ci(s,u,p,y))}else/\n/u.test(D)?D.match(/\n/gu).length>1&&o(F):o(n)}else{let D=r();if(a(D),y&&Dr(y)){let C=Hr.trim(fe(y)),[c]=Hr.split(C);o(Ci(s,c,p,y))}else o(F)}},"children"),i}function Ci(e,t,r,n){return e?"":r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?t.length===1?E:F:E}function Ai(e,t,r,n){return e?F:t.length===1?r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?F:E:F}var Ac=new Set(["ArrayExpression","TupleExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function Tc(e,t,r){let{parent:n}=e;if(Ac.has(n.type))return t;let s=e.match(void 0,i=>i.type==="ArrowFunctionExpression",L,i=>i.type==="JSXExpressionContainer"),u=ke(e,r);return l([u?"":B("("),f([E,t]),E,u?"":B(")")],{shouldBreak:s})}function dc(e,t,r){let{node:n}=e,s=[];if(s.push(r("name")),n.value){let u;if(te(n.value)){let i=fe(n.value),a=Y(!1,Y(!1,i.slice(1,-1),"'","'"),""",'"'),o=Sr(a,t.jsxSingleQuote);a=o==='"'?Y(!1,a,'"',"""):Y(!1,a,"'","'"),u=e.call(()=>ye(e,ve(o+a+o),t),"value")}else u=r("value");s.push("=",u)}return s}function xc(e,t,r){let{node:n}=e,s=(u,i)=>u.type==="JSXEmptyExpression"||!T(u)&&(U(u)||se(u)||u.type==="ArrowFunctionExpression"||u.type==="AwaitExpression"&&(s(u.argument,u)||u.argument.type==="JSXElement")||L(u)||u.type==="ChainExpression"&&L(u.expression)||u.type==="FunctionExpression"||u.type==="TemplateLiteral"||u.type==="TaggedTemplateExpression"||u.type==="DoExpression"||X(i)&&(u.type==="ConditionalExpression"||De(u)));return s(n.expression,e.parent)?l(["{",r("expression"),je,"}"]):l(["{",f([E,r("expression")]),E,je,"}"])}function hc(e,t,r){var a,o;let{node:n}=e,s=T(n.name)||T(n.typeParameters)||T(n.typeArguments);if(n.selfClosing&&n.attributes.length===0&&!s)return["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," />"];if(((a=n.attributes)==null?void 0:a.length)===1&&te(n.attributes[0].value)&&!n.attributes[0].value.value.includes(` +`)&&!s&&!T(n.attributes[0]))return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," ",...e.map(r,"attributes"),n.selfClosing?" />":">"]);let u=(o=n.attributes)==null?void 0:o.some(p=>te(p.value)&&p.value.value.includes(` +`)),i=t.singleAttributePerLine&&n.attributes.length>1?F:x;return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters"),f(e.map(()=>[i,r()],"attributes")),...gc(n,t,s)],{shouldBreak:u})}function gc(e,t,r){return e.selfClosing?[x,"/>"]:Sc(e,t,r)?[">"]:[E,">"]}function Sc(e,t,r){let n=e.attributes.length>0&&T(M(!1,e.attributes,-1),h.Trailing);return e.attributes.length===0&&!r||(t.bracketSameLine||t.jsxBracketSameLine)&&(!r||e.attributes.length>0)&&!n}function Bc(e,t,r){let{node:n}=e,s=[];s.push(""),s}function bc(e,t){let{node:r}=e,n=T(r),s=T(r,h.Line),u=r.type==="JSXOpeningFragment";return[u?"<":""]}function Pc(e,t,r){let n=ye(e,Fc(e,t,r),t);return Tc(e,n,t)}function kc(e,t){let{node:r}=e,n=T(r,h.Line);return[J(e,t,{indent:n}),n?F:""]}function Ic(e,t,r){let{node:n}=e;return["{",e.call(({node:s})=>{let u=["...",r()];return!T(s)||!Zn(e)?u:[f([E,ye(e,u,t)]),E]},n.type==="JSXSpreadAttribute"?"argument":"expression"),"}"]}function Ti(e,t,r){let{node:n}=e;if(n.type.startsWith("JSX"))switch(n.type){case"JSXAttribute":return dc(e,t,r);case"JSXIdentifier":return n.name;case"JSXNamespacedName":return b(":",[r("namespace"),r("name")]);case"JSXMemberExpression":return b(".",[r("object"),r("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return Ic(e,t,r);case"JSXExpressionContainer":return xc(e,t,r);case"JSXFragment":case"JSXElement":return Pc(e,t,r);case"JSXOpeningElement":return hc(e,t,r);case"JSXClosingElement":return Bc(e,t,r);case"JSXOpeningFragment":case"JSXClosingFragment":return bc(e,t);case"JSXEmptyExpression":return kc(e,t);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new Ne(n,"JSX")}}function Lc(e){if(e.children.length===0)return!0;if(e.children.length>1)return!1;let t=e.children[0];return t.type==="JSXText"&&!Dr(t)}function Dr(e){return e.type==="JSXText"&&(Hr.hasNonWhitespaceCharacter(fe(e))||!/\n/u.test(fe(e)))}function wc(e){return e.type==="JSXExpressionContainer"&&te(e.expression)&&e.expression.value===" "&&!T(e.expression)}function di(e){let{node:t,parent:r}=e;if(!X(t)||!X(r))return!1;let{index:n,siblings:s}=e,u;for(let i=n;i>0;i--){let a=s[i-1];if(!(a.type==="JSXText"&&!Dr(a))){u=a;break}}return(u==null?void 0:u.type)==="JSXExpressionContainer"&&u.expression.type==="JSXEmptyExpression"&&Lt(u.expression)}function Oc(e){return Lt(e.node)||di(e)}var Vr=Oc;var _c=0;function $r(e,t,r){var v;let{node:n,parent:s,grandparent:u,key:i}=e,a=i!=="body"&&(s.type==="IfStatement"||s.type==="WhileStatement"||s.type==="SwitchStatement"||s.type==="DoWhileStatement"),o=n.operator==="|>"&&((v=e.root.extra)==null?void 0:v.__isUsingHackPipeline),p=Es(e,r,t,!1,a);if(a)return p;if(o)return l(p);if(L(s)&&s.callee===n||s.type==="UnaryExpression"||W(s)&&!s.computed)return l([f([E,...p]),E]);let y=s.type==="ReturnStatement"||s.type==="ThrowStatement"||s.type==="JSXExpressionContainer"&&u.type==="JSXAttribute"||n.operator!=="|"&&s.type==="JsExpressionRoot"||n.type!=="NGPipeExpression"&&(s.type==="NGRoot"&&t.parser==="__ng_binding"||s.type==="NGMicrosyntaxExpression"&&u.type==="NGMicrosyntax"&&u.body.length===1)||n===s.body&&s.type==="ArrowFunctionExpression"||n!==s.body&&s.type==="ForStatement"||s.type==="ConditionalExpression"&&u.type!=="ReturnStatement"&&u.type!=="ThrowStatement"&&!L(u)||s.type==="TemplateLiteral",D=s.type==="AssignmentExpression"||s.type==="VariableDeclarator"||s.type==="ClassProperty"||s.type==="PropertyDefinition"||s.type==="TSAbstractPropertyDefinition"||s.type==="ClassPrivateProperty"||Ce(s),m=De(n.left)&&ar(n.operator,n.left.operator);if(y||Ht(n)&&!m||!Ht(n)&&D)return l(p);if(p.length===0)return"";let C=X(n.right),c=p.findIndex(j=>typeof j!="string"&&!Array.isArray(j)&&j.type===me),A=p.slice(0,c===-1?1:c+1),d=p.slice(A.length,C?-1:void 0),S=Symbol("logicalChain-"+ ++_c),g=l([...A,f(d)],{id:S});if(!C)return g;let _=M(!1,p,-1);return l([g,xt(_,{groupId:S})])}function Es(e,t,r,n,s){var S;let{node:u}=e;if(!De(u))return[l(t())];let i=[];ar(u.operator,u.left.operator)?i=e.call(g=>Es(g,t,r,!0,s),"left"):i.push(l(t("left")));let a=Ht(u),o=(u.operator==="|>"||u.type==="NGPipeExpression"||vc(e,r))&&!Le(r.originalText,u.right),y=!T(u.right,h.Leading,Wr)&&Le(r.originalText,u.right),D=u.type==="NGPipeExpression"?"|":u.operator,m=u.type==="NGPipeExpression"&&u.arguments.length>0?l(f([E,": ",b([x,": "],e.map(()=>Be(2,l(t())),"arguments"))])):"",C;if(a)C=[D," ",t("right"),m];else{let _=D==="|>"&&((S=e.root.extra)==null?void 0:S.__isUsingHackPipeline)?e.call(v=>Es(v,t,r,!0,s),"right"):t("right");if(r.experimentalOperatorPosition==="start"){let v="";if(y)switch(Se(_)){case he:v=_.splice(0,1)[0];break;case ge:v=_.contents.splice(0,1)[0];break}C=[x,v,D," ",_,m]}else C=[o?x:"",D,o?" ":x,_,m]}let{parent:c}=e,A=T(u.left,h.Trailing|h.Line);if((A||!(s&&u.type==="LogicalExpression")&&c.type!==u.type&&u.left.type!==u.type&&u.right.type!==u.type)&&(C=l(C,{shouldBreak:A})),r.experimentalOperatorPosition==="start"?i.push(a||y?" ":"",C):i.push(o?"":" ",C),n&&T(u)){let g=Ut(ye(e,i,r));return g.type===Oe?g.parts:Array.isArray(g)?g:[g]}return i}function Ht(e){return e.type!=="LogicalExpression"?!1:!!(se(e.right)&&e.right.properties.length>0||U(e.right)&&e.right.elements.length>0||X(e.right))}var xi=e=>e.type==="BinaryExpression"&&e.operator==="|";function vc(e,t){return(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression")&&xi(e.node)&&!e.hasAncestor(r=>!xi(r)&&r.type!=="JsExpressionRoot")}function gi(e,t,r){let{node:n}=e;if(n.type.startsWith("NG"))switch(n.type){case"NGRoot":return[r("node"),T(n.node)?" //"+lt(n.node)[0].value.trimEnd():""];case"NGPipeExpression":return $r(e,t,r);case"NGChainedExpression":return l(b([";",x],e.map(()=>Mc(e)?r():["(",r(),")"],"expressions")));case"NGEmptyExpression":return"";case"NGMicrosyntax":return e.map(()=>[e.isFirst?"":hi(e)?" ":[";",x],r()],"body");case"NGMicrosyntaxKey":return/^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(n.name)?n.name:JSON.stringify(n.name);case"NGMicrosyntaxExpression":return[r("expression"),n.alias===null?"":[" as ",r("alias")]];case"NGMicrosyntaxKeyedExpression":{let{index:s,parent:u}=e,i=hi(e)||(s===1&&(n.key.name==="then"||n.key.name==="else"||n.key.name==="as")||(s===2||s===3)&&(n.key.name==="else"&&u.body[s-1].type==="NGMicrosyntaxKeyedExpression"&&u.body[s-1].key.name==="then"||n.key.name==="track"))&&u.body[0].type==="NGMicrosyntaxExpression";return[r("key"),i?" ":": ",r("expression")]}case"NGMicrosyntaxLet":return["let ",r("key"),n.value===null?"":[" = ",r("value")]];case"NGMicrosyntaxAs":return[r("key")," as ",r("alias")];default:throw new Ne(n,"Angular")}}function hi({node:e,index:t}){return e.type==="NGMicrosyntaxKeyedExpression"&&e.key.name==="of"&&t===1}var jc=R(["CallExpression","OptionalCallExpression","AssignmentExpression"]);function Mc({node:e}){return ur(e,jc)}function Fs(e,t,r){let{node:n}=e;return l([b(x,e.map(r,"decorators")),bi(n,t)?F:x])}function Si(e,t,r){return Pi(e.node)?[b(F,e.map(r,"declaration","decorators")),F]:""}function Bi(e,t,r){let{node:n,parent:s}=e,{decorators:u}=n;if(!O(u)||Pi(s)||Vr(e))return"";let i=n.type==="ClassExpression"||n.type==="ClassDeclaration"||bi(n,t);return[e.key==="declaration"&&cu(s)?F:i?Ee:"",b(x,e.map(r,"decorators")),x]}function bi(e,t){return e.decorators.some(r=>Z(t.originalText,k(r)))}function Pi(e){var r;if(e.type!=="ExportDefaultDeclaration"&&e.type!=="ExportNamedDeclaration"&&e.type!=="DeclareExportDeclaration")return!1;let t=(r=e.declaration)==null?void 0:r.decorators;return O(t)&&Pt(e,t[0])}var Dt=class extends Error{name="ArgExpansionBailout"};function Rc(e,t,r){let{node:n}=e,s=pe(n);if(s.length===0)return["(",J(e,t),")"];let u=s.length-1;if(Wc(s)){let D=["("];return Wt(e,(m,C)=>{D.push(r()),C!==u&&D.push(", ")}),D.push(")"),D}let i=!1,a=[];Wt(e,({node:D},m)=>{let C=r();m===u||(ce(D,t)?(i=!0,C=[C,",",F,F]):C=[C,",",x]),a.push(C)});let o=!t.parser.startsWith("__ng_")&&n.type!=="ImportExpression"&&oe(t,"all")?",":"";function p(){return l(["(",f([x,...a]),o,x,")"],{shouldBreak:!0})}if(i||e.parent.type!=="Decorator"&&fu(s))return p();if(qc(s)){let D=a.slice(1);if(D.some(re))return p();let m;try{m=r(qn(n,0),{expandFirstArg:!0})}catch(C){if(C instanceof Dt)return p();throw C}return re(m)?[Ee,et([["(",l(m,{shouldBreak:!0}),", ",...D,")"],p()])]:et([["(",m,", ",...D,")"],["(",l(m,{shouldBreak:!0}),", ",...D,")"],p()])}if(Jc(s,a,t)){let D=a.slice(0,-1);if(D.some(re))return p();let m;try{m=r(qn(n,-1),{expandLastArg:!0})}catch(C){if(C instanceof Dt)return p();throw C}return re(m)?[Ee,et([["(",...D,l(m,{shouldBreak:!0}),")"],p()])]:et([["(",...D,m,")"],["(",...D,l(m,{shouldBreak:!0}),")"],p()])}let y=["(",f([E,...a]),B(o),E,")"];return jr(e)?y:l(y,{shouldBreak:a.some(re)||i})}function fr(e,t=!1){return se(e)&&(e.properties.length>0||T(e))||U(e)&&(e.elements.length>0||T(e))||e.type==="TSTypeAssertion"&&fr(e.expression)||Ae(e)&&fr(e.expression)||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&(!e.returnType||!e.returnType.typeAnnotation||e.returnType.typeAnnotation.type!=="TSTypeReference"||Nc(e.body))&&(e.body.type==="BlockStatement"||e.body.type==="ArrowFunctionExpression"&&fr(e.body,!0)||se(e.body)||U(e.body)||!t&&(L(e.body)||e.body.type==="ConditionalExpression")||X(e.body))||e.type==="DoExpression"||e.type==="ModuleExpression"}function Jc(e,t,r){var u,i;let n=M(!1,e,-1);if(e.length===1){let a=M(!1,t,-1);if((u=a.label)!=null&&u.embed&&((i=a.label)==null?void 0:i.hug)!==!1)return!0}let s=M(!1,e,-2);return!T(n,h.Leading)&&!T(n,h.Trailing)&&fr(n)&&(!s||s.type!==n.type)&&(e.length!==2||s.type!=="ArrowFunctionExpression"||!U(n))&&!(e.length>1&&Cs(n,r))}function qc(e){if(e.length!==2)return!1;let[t,r]=e;return t.type==="ModuleExpression"&&Gc(r)?!0:!T(t)&&(t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement")&&r.type!=="FunctionExpression"&&r.type!=="ArrowFunctionExpression"&&r.type!=="ConditionalExpression"&&Ii(r)&&!fr(r)}function Ii(e){if(e.type==="ParenthesizedExpression")return Ii(e.expression);if(Ae(e)||e.type==="TypeCastExpression"){let{typeAnnotation:t}=e;if(t.type==="TypeAnnotation"&&(t=t.typeAnnotation),t.type==="TSArrayType"&&(t=t.elementType,t.type==="TSArrayType"&&(t=t.elementType)),t.type==="GenericTypeAnnotation"||t.type==="TSTypeReference"){let r=t.typeArguments??t.typeParameters;(r==null?void 0:r.params.length)===1&&(t=r.params[0])}return qt(t)&&Ie(e.expression,1)}return mt(e)&&pe(e).length>1?!1:De(e)?Ie(e.left,1)&&Ie(e.right,1):Rn(e)||Ie(e)}function Wc(e){return e.length===2?ki(e,0):e.length===3?e[0].type==="Identifier"&&ki(e,1):!1}function ki(e,t){let r=e[t],n=e[t+1];return r.type==="ArrowFunctionExpression"&&z(r).length===0&&r.body.type==="BlockStatement"&&n.type==="ArrayExpression"&&!e.some(s=>T(s))}function Nc(e){return e.type==="BlockStatement"&&(e.body.some(t=>t.type!=="EmptyStatement")||T(e,h.Dangling))}function Gc(e){return e.type==="ObjectExpression"&&e.properties.length===1&&Ce(e.properties[0])&&e.properties[0].key.type==="Identifier"&&e.properties[0].key.name==="type"&&te(e.properties[0].value)&&e.properties[0].value.value==="module"}var Er=Rc;var Uc=e=>((e.type==="ChainExpression"||e.type==="TSNonNullExpression")&&(e=e.expression),L(e)&&pe(e).length>0);function Li(e,t,r){var p;let n=r("object"),s=As(e,t,r),{node:u}=e,i=e.findAncestor(y=>!(W(y)||y.type==="TSNonNullExpression")),a=e.findAncestor(y=>!(y.type==="ChainExpression"||y.type==="TSNonNullExpression")),o=i&&(i.type==="NewExpression"||i.type==="BindExpression"||i.type==="AssignmentExpression"&&i.left.type!=="Identifier")||u.computed||u.object.type==="Identifier"&&u.property.type==="Identifier"&&!W(a)||(a.type==="AssignmentExpression"||a.type==="VariableDeclarator")&&(Uc(u.object)||((p=n.label)==null?void 0:p.memberChain));return ut(n.label,[n,o?s:l(f([E,s]))])}function As(e,t,r){let n=r("property"),{node:s}=e,u=$(e);return s.computed?!s.property||Fe(s.property)?[u,"[",n,"]"]:l([u,"[",f([E,n]),E,"]"]):[u,".",n]}function wi(e,t,r){if(e.node.type==="ChainExpression")return e.call(()=>wi(e,t,r),"expression");let{parent:n}=e,s=!n||n.type==="ExpressionStatement",u=[];function i(w){let{originalText:ne}=t,xe=it(ne,k(w));return ne.charAt(xe)===")"?xe!==!1&&jt(ne,xe+1):ce(w,t)}function a(){let{node:w}=e;if(w.type==="ChainExpression")return e.call(a,"expression");if(L(w)&&(Tt(w.callee)||L(w.callee))){let ne=i(w);u.unshift({node:w,hasTrailingEmptyLine:ne,printed:[ye(e,[$(e),tt(e,t,r),Er(e,t,r)],t),ne?F:""]}),e.call(a,"callee")}else Tt(w)?(u.unshift({node:w,needsParens:ke(e,t),printed:ye(e,W(w)?As(e,t,r):Kr(e,t,r),t)}),e.call(a,"object")):w.type==="TSNonNullExpression"?(u.unshift({node:w,printed:ye(e,"!",t)}),e.call(a,"expression")):u.unshift({node:w,printed:r()})}let{node:o}=e;u.unshift({node:o,printed:[$(e),tt(e,t,r),Er(e,t,r)]}),o.callee&&e.call(a,"callee");let p=[],y=[u[0]],D=1;for(;D0&&p.push(y);function C(w){return/^[A-Z]|^[$_]+$/u.test(w)}function c(w){return w.length<=t.tabWidth}function A(w){var pt;let ne=(pt=w[1][0])==null?void 0:pt.node.computed;if(w[0].length===1){let bt=w[0][0].node;return bt.type==="ThisExpression"||bt.type==="Identifier"&&(C(bt.name)||s&&c(bt.name)||ne)}let xe=M(!1,w[0],-1).node;return W(xe)&&xe.property.type==="Identifier"&&(C(xe.property.name)||ne)}let d=p.length>=2&&!T(p[1][0].node)&&A(p);function S(w){let ne=w.map(xe=>xe.printed);return w.length>0&&M(!1,w,-1).needsParens?["(",...ne,")"]:ne}function g(w){return w.length===0?"":f([F,b(F,w.map(S))])}let _=p.map(S),v=_,j=d?3:2,I=p.flat(),G=I.slice(1,-1).some(w=>T(w.node,h.Leading))||I.slice(0,-1).some(w=>T(w.node,h.Trailing))||p[j]&&T(p[j][0].node,h.Leading);if(p.length<=j&&!G&&!p.some(w=>M(!1,w,-1).hasTrailingEmptyLine))return jr(e)?v:l(v);let P=M(!1,p[d?1:0],-1).node,N=!L(P)&&i(P),ue=[S(p[0]),d?p.slice(1,2).map(S):"",N?F:"",g(p.slice(d?2:1))],Q=u.map(({node:w})=>w).filter(L);function Bt(){let w=M(!1,M(!1,p,-1),-1).node,ne=M(!1,_,-1);return L(w)&&re(ne)&&Q.slice(0,-1).some(xe=>xe.arguments.some(Rt))}let Ct;return G||Q.length>2&&Q.some(w=>!w.arguments.every(ne=>Ie(ne)))||_.slice(0,-1).some(re)||Bt()?Ct=l(ue):Ct=[re(v)||N?Ee:"",et([v,ue])],ut({memberChain:!0},Ct)}var Oi=wi;function Qr(e,t,r){var y;let{node:n}=e,s=n.type==="NewExpression",u=n.type==="ImportExpression",i=$(e),a=pe(n),o=a.length===1&&_r(a[0],t.originalText);if(o||Yc(e)||It(n,e.parent)){let D=[];if(Wt(e,()=>{D.push(r())}),!(o&&((y=D[0].label)!=null&&y.embed)))return[s?"new ":"",_i(e,r),i,tt(e,t,r),"(",b(", ",D),")"]}if(!u&&!s&&Tt(n.callee)&&!e.call(D=>ke(D,t),"callee",...n.callee.type==="ChainExpression"?["expression"]:[]))return Oi(e,t,r);let p=[s?"new ":"",_i(e,r),i,tt(e,t,r),Er(e,t,r)];return u||L(n.callee)?l(p):p}function _i(e,t){let{node:r}=e;return r.type==="ImportExpression"?`import${r.phase?`.${r.phase}`:""}`:t("callee")}function Yc(e){let{node:t}=e;if(t.type!=="CallExpression"||t.optional||t.callee.type!=="Identifier")return!1;let r=pe(t);return t.callee.name==="require"?r.length===1&&te(r[0])||r.length>1:t.callee.name==="define"&&e.parent.type==="ExpressionStatement"?r.length===1||r.length===2&&r[0].type==="ArrayExpression"||r.length===3&&te(r[0])&&r[1].type==="ArrayExpression":!1}function ht(e,t,r,n,s,u){let i=Xc(e,t,r,n,u),a=u?r(u,{assignmentLayout:i}):"";switch(i){case"break-after-operator":return l([l(n),s,l(f([x,a]))]);case"never-break-after-operator":return l([l(n),s," ",a]);case"fluid":{let o=Symbol("assignment");return l([l(n),s,l(f(x),{id:o}),je,xt(a,{groupId:o})])}case"break-lhs":return l([n,s," ",l(a)]);case"chain":return[l(n),s,x,a];case"chain-tail":return[l(n),s,f([x,a])];case"chain-tail-arrow-chain":return[l(n),s,a];case"only-left":return n}}function ji(e,t,r){let{node:n}=e;return ht(e,t,r,r("left"),[" ",n.operator],"right")}function Mi(e,t,r){return ht(e,t,r,r("id")," =","init")}function Xc(e,t,r,n,s){let{node:u}=e,i=u[s];if(!i)return"only-left";let a=!zr(i);if(e.match(zr,Ri,m=>!a||m.type!=="ExpressionStatement"&&m.type!=="VariableDeclaration"))return a?i.type==="ArrowFunctionExpression"&&i.body.type==="ArrowFunctionExpression"?"chain-tail-arrow-chain":"chain-tail":"chain";if(!a&&zr(i.right)||Le(t.originalText,i))return"break-after-operator";if(u.type==="ImportAttribute"||i.type==="CallExpression"&&i.callee.name==="require"||t.parser==="json5"||t.parser==="jsonc"||t.parser==="json")return"never-break-after-operator";let y=bu(n);if(Vc(u)||zc(u)||Ts(u)&&y)return"break-lhs";let D=el(u,n,t);return e.call(()=>Hc(e,t,r,D),s)?"break-after-operator":$c(u)?"break-lhs":!y&&(D||i.type==="TemplateLiteral"||i.type==="TaggedTemplateExpression"||i.type==="BooleanLiteral"||Fe(i)||i.type==="ClassExpression")?"never-break-after-operator":"fluid"}function Hc(e,t,r,n){let s=e.node;if(De(s)&&!Ht(s))return!0;switch(s.type){case"StringLiteralTypeAnnotation":case"SequenceExpression":return!0;case"TSConditionalType":case"ConditionalTypeAnnotation":if(!t.experimentalTernaries&&!nl(s))break;return!0;case"ConditionalExpression":{if(!t.experimentalTernaries){let{test:p}=s;return De(p)&&!Ht(p)}let{consequent:a,alternate:o}=s;return a.type==="ConditionalExpression"||o.type==="ConditionalExpression"}case"ClassExpression":return O(s.decorators)}if(n)return!1;let u=s,i=[];for(;;)if(u.type==="UnaryExpression"||u.type==="AwaitExpression"||u.type==="YieldExpression"&&u.argument!==null)u=u.argument,i.push("argument");else if(u.type==="TSNonNullExpression")u=u.expression,i.push("expression");else break;return!!(te(u)||e.call(()=>Ji(e,t,r),...i))}function Vc(e){if(Ri(e)){let t=e.left||e.id;return t.type==="ObjectPattern"&&t.properties.length>2&&t.properties.some(r=>{var n;return Ce(r)&&(!r.shorthand||((n=r.value)==null?void 0:n.type)==="AssignmentPattern")})}return!1}function zr(e){return e.type==="AssignmentExpression"}function Ri(e){return zr(e)||e.type==="VariableDeclarator"}function $c(e){let t=Qc(e);if(O(t)){let r=e.type==="TSTypeAliasDeclaration"?"constraint":"bound";if(t.length>1&&t.some(n=>n[r]||n.default))return!0}return!1}var Kc=R(["TSTypeAliasDeclaration","TypeAlias"]);function Qc(e){var t;if(Kc(e))return(t=e.typeParameters)==null?void 0:t.params}function zc(e){if(e.type!=="VariableDeclarator")return!1;let{typeAnnotation:t}=e.id;if(!t||!t.typeAnnotation)return!1;let r=vi(t.typeAnnotation);return O(r)&&r.length>1&&r.some(n=>O(vi(n))||n.type==="TSConditionalType")}function Ts(e){var t;return e.type==="VariableDeclarator"&&((t=e.init)==null?void 0:t.type)==="ArrowFunctionExpression"}var Zc=R(["TSTypeReference","GenericTypeAnnotation"]);function vi(e){var t;if(Zc(e))return(t=e.typeArguments??e.typeParameters)==null?void 0:t.params}function Ji(e,t,r,n=!1){var i;let{node:s}=e,u=()=>Ji(e,t,r,!0);if(s.type==="ChainExpression"||s.type==="TSNonNullExpression")return e.call(u,"expression");if(L(s)){if((i=Qr(e,t,r).label)!=null&&i.memberChain)return!1;let o=pe(s);return!(o.length===0||o.length===1&&ir(o[0],t))||tl(s,r)?!1:e.call(u,"callee")}return W(s)?e.call(u,"object"):n&&(s.type==="Identifier"||s.type==="ThisExpression")}function el(e,t,r){return Ce(e)?(t=Ut(t),typeof t=="string"&&rt(t)1)return!0;if(r.length===1){let s=r[0];if(we(s)||Nt(s)||s.type==="TSTypeLiteral"||s.type==="ObjectTypeAnnotation")return!0}let n=e.typeParameters?"typeParameters":"typeArguments";if(re(t(n)))return!0}return!1}function rl(e){var t;return(t=e.typeParameters??e.typeArguments)==null?void 0:t.params}function nl(e){function t(r){switch(r.type){case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"TSFunctionType":return!!r.typeParameters;case"TSTypeReference":return!!(r.typeArguments??r.typeParameters);default:return!1}}return t(e.checkType)||t(e.extendsType)}function Ue(e,t,r,n,s){let u=e.node,i=z(u),a=s?tt(e,r,t):"";if(i.length===0)return[a,"(",J(e,r,{filter:c=>be(r.originalText,k(c))===")"}),")"];let{parent:o}=e,p=It(o),y=ds(u),D=[];if(Au(e,(c,A)=>{let d=A===i.length-1;d&&u.rest&&D.push("..."),D.push(t()),!d&&(D.push(","),p||y?D.push(" "):ce(i[A],r)?D.push(F,F):D.push(x))}),n&&!ul(e)){if(re(a)||re(D))throw new Dt;return l([cr(a),"(",cr(D),")"])}let m=i.every(c=>!O(c.decorators));return y&&m?[a,"(",...D,")"]:p?[a,"(",...D,")"]:(Or(o)||mu(o)||o.type==="TypeAlias"||o.type==="UnionTypeAnnotation"||o.type==="IntersectionTypeAnnotation"||o.type==="FunctionTypeAnnotation"&&o.returnType===u)&&i.length===1&&i[0].name===null&&u.this!==i[0]&&i[0].typeAnnotation&&u.typeParameters===null&&qt(i[0].typeAnnotation)&&!u.rest?r.arrowParens==="always"||u.type==="HookTypeAnnotation"?["(",...D,")"]:D:[a,"(",f([E,...D]),B(!Cu(u)&&oe(r,"all")?",":""),E,")"]}function ds(e){if(!e)return!1;let t=z(e);if(t.length!==1)return!1;let[r]=t;return!T(r)&&(r.type==="ObjectPattern"||r.type==="ArrayPattern"||r.type==="Identifier"&&r.typeAnnotation&&(r.typeAnnotation.type==="TypeAnnotation"||r.typeAnnotation.type==="TSTypeAnnotation")&&Re(r.typeAnnotation.typeAnnotation)||r.type==="FunctionTypeParam"&&Re(r.typeAnnotation)&&r!==e.rest||r.type==="AssignmentPattern"&&(r.left.type==="ObjectPattern"||r.left.type==="ArrayPattern")&&(r.right.type==="Identifier"||se(r.right)&&r.right.properties.length===0||U(r.right)&&r.right.elements.length===0))}function sl(e){let t;return e.returnType?(t=e.returnType,t.typeAnnotation&&(t=t.typeAnnotation)):e.typeAnnotation&&(t=e.typeAnnotation),t}function ot(e,t){var s;let r=sl(e);if(!r)return!1;let n=(s=e.typeParameters)==null?void 0:s.params;if(n){if(n.length>1)return!1;if(n.length===1){let u=n[0];if(u.constraint||u.default)return!1}}return z(e).length===1&&(Re(r)||re(t))}function ul(e){return e.match(t=>t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement",(t,r)=>{if(t.type==="CallExpression"&&r==="arguments"&&t.arguments.length===1&&t.callee.type==="CallExpression"){let n=t.callee.callee;return n.type==="Identifier"||n.type==="MemberExpression"&&!n.computed&&n.object.type==="Identifier"&&n.property.type==="Identifier"}return!1},(t,r)=>t.type==="VariableDeclarator"&&r==="init"||t.type==="ExportDefaultDeclaration"&&r==="declaration"||t.type==="TSExportAssignment"&&r==="expression"||t.type==="AssignmentExpression"&&r==="right"&&t.left.type==="MemberExpression"&&t.left.object.type==="Identifier"&&t.left.object.name==="module"&&t.left.property.type==="Identifier"&&t.left.property.name==="exports",t=>t.type!=="VariableDeclaration"||t.kind==="const"&&t.declarations.length===1)}function qi(e){let t=z(e);return t.length>1&&t.some(r=>r.type==="TSParameterProperty")}var il=R(["VoidTypeAnnotation","TSVoidKeyword","NullLiteralTypeAnnotation","TSNullKeyword"]),al=R(["ObjectTypeAnnotation","TSTypeLiteral","GenericTypeAnnotation","TSTypeReference"]);function ol(e){let{types:t}=e;if(t.some(n=>T(n)))return!1;let r=t.find(n=>al(n));return r?t.every(n=>n===r||il(n)):!1}function xs(e){return qt(e)||Re(e)?!0:we(e)?ol(e):!1}function Wi(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[K(e),"opaque type ",r("id"),r("typeParameters")];return s.supertype&&u.push(": ",r("supertype")),s.impltype&&u.push(" = ",r("impltype")),u.push(n),u}function Zr(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[K(e)];u.push("type ",r("id"),r("typeParameters"));let i=s.type==="TSTypeAliasDeclaration"?"typeAnnotation":"right";return[ht(e,t,r,u," =",i),n]}function en(e,t,r){let n=!1;return l(e.map(({isFirst:s,previous:u,node:i,index:a})=>{let o=r();if(s)return o;let p=Re(i),y=Re(u);return y&&p?[" & ",n?f(o):o]:!y&&!p?t.experimentalOperatorPosition==="start"?f([x,"& ",o]):f([" &",x,o]):(a>1&&(n=!0),[" & ",a>1?f(o):o])},"types"))}function tn(e,t,r){let{node:n}=e,{parent:s}=e,u=s.type!=="TypeParameterInstantiation"&&(!Je(s)||!t.experimentalTernaries)&&s.type!=="TSTypeParameterInstantiation"&&s.type!=="GenericTypeAnnotation"&&s.type!=="TSTypeReference"&&s.type!=="TSTypeAssertion"&&s.type!=="TupleTypeAnnotation"&&s.type!=="TSTupleType"&&!(s.type==="FunctionTypeParam"&&!s.name&&e.grandparent.this!==s)&&!((s.type==="TypeAlias"||s.type==="VariableDeclarator"||s.type==="TSTypeAliasDeclaration")&&Le(t.originalText,n)),i=xs(n),a=e.map(y=>{let D=r();return i||(D=Be(2,D)),ye(y,D,t)},"types");if(i)return b(" | ",a);let o=u&&!Le(t.originalText,n),p=[B([o?x:"","| "]),b([x,"| "],a)];return ke(e,t)?l([f(p),E]):(s.type==="TupleTypeAnnotation"||s.type==="TSTupleType")&&s[s.type==="TupleTypeAnnotation"&&s.types?"types":"elementTypes"].length>1?l([f([B(["(",E]),p]),E,B(")")]):l(u?f(p):p)}function pl(e){var n;let{node:t,parent:r}=e;return t.type==="FunctionTypeAnnotation"&&(Or(r)||!((r.type==="ObjectTypeProperty"||r.type==="ObjectTypeInternalSlot")&&!r.variance&&!r.optional&&Pt(r,t)||r.type==="ObjectTypeCallProperty"||((n=e.getParentNode(2))==null?void 0:n.type)==="DeclareFunction"))}function rn(e,t,r){let{node:n}=e,s=[Vt(e)];(n.type==="TSConstructorType"||n.type==="TSConstructSignatureDeclaration")&&s.push("new ");let u=Ue(e,r,t,!1,!0),i=[];return n.type==="FunctionTypeAnnotation"?i.push(pl(e)?" => ":": ",r("returnType")):i.push(H(e,r,n.returnType?"returnType":"typeAnnotation")),ot(n,i)&&(u=l(u)),s.push(u,i),l(s)}function nn(e,t,r){return[r("objectType"),$(e),"[",r("indexType"),"]"]}function sn(e,t,r){return["infer ",r("typeParameter")]}function hs(e,t,r){let{node:n}=e;return[n.postfix?"":r,H(e,t),n.postfix?r:""]}function un(e,t,r){let{node:n}=e;return["...",...n.type==="TupleTypeSpreadElement"&&n.label?[r("label"),": "]:[],r("typeAnnotation")]}function an(e,t,r){let{node:n}=e;return[n.variance?r("variance"):"",r("label"),n.optional?"?":"",": ",r("elementType")]}var cl=new WeakSet;function H(e,t,r="typeAnnotation"){let{node:{[r]:n}}=e;if(!n)return"";let s=!1;if(n.type==="TSTypeAnnotation"||n.type==="TypeAnnotation"){let u=e.call(Ni,r);(u==="=>"||u===":"&&T(n,h.Leading))&&(s=!0),cl.add(n)}return s?[" ",t(r)]:t(r)}var Ni=e=>e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>(r==="returnType"||r==="typeAnnotation")&&(t.type==="TSFunctionType"||t.type==="TSConstructorType"))?"=>":e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>r==="typeAnnotation"&&(t.type==="TSJSDocNullableType"||t.type==="TSJSDocNonNullableType"||t.type==="TSTypePredicate"))||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareFunction")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareHook")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="bound"&&t.type==="TypeParameter"&&t.usesExtendsBound)?"":":";function on(e,t,r){let n=Ni(e);return n?[n," ",r("typeAnnotation")]:r("typeAnnotation")}function pn(e){return[e("elementType"),"[]"]}function cn({node:e},t){let r=e.type==="TSTypeQuery"?"exprName":"argument",n=e.type==="TypeofTypeAnnotation"||e.typeArguments?"typeArguments":"typeParameters";return["typeof ",t(r),t(n)]}function ln(e,t){let{node:r}=e;return[r.type==="TSTypePredicate"&&r.asserts?"asserts ":r.type==="TypePredicate"&&r.kind?`${r.kind} `:"",t("parameterName"),r.typeAnnotation?[" is ",H(e,t)]:""]}function $(e){let{node:t}=e;return!t.optional||t.type==="Identifier"&&t===e.parent.key?"":L(t)||W(t)&&t.computed||t.type==="OptionalIndexedAccessType"?"?.":"?"}function mn(e){return e.node.definite||e.match(void 0,(t,r)=>r==="id"&&t.type==="VariableDeclarator"&&t.definite)?"!":""}var ll=new Set(["DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","DeclareVariable","DeclareExportDeclaration","DeclareExportAllDeclaration","DeclareOpaqueType","DeclareTypeAlias","DeclareEnum","DeclareInterface"]);function K(e){let{node:t}=e;return t.declare||ll.has(t.type)&&e.parent.type!=="DeclareExportDeclaration"?"declare ":""}var ml=new Set(["TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function Vt({node:e}){return e.abstract||ml.has(e.type)?"abstract ":""}function tt(e,t,r){let n=e.node;return n.typeArguments?r("typeArguments"):n.typeParameters?r("typeParameters"):""}function Kr(e,t,r){return["::",r("callee")]}function ft(e,t,r){return e.type==="EmptyStatement"?";":e.type==="BlockStatement"||r?[" ",t]:f([x,t])}function yn(e,t){return["...",t("argument"),H(e,t)]}function $t(e){return e.accessibility?e.accessibility+" ":""}function yl(e,t,r,n){let{node:s}=e,u=s.inexact?"...":"";return T(s,h.Dangling)?l([r,u,J(e,t,{indent:!0}),E,n]):[r,u,n]}function Kt(e,t,r){let{node:n}=e,s=[],u=n.type==="TupleExpression"?"#[":"[",i="]",a=n.type==="TupleTypeAnnotation"&&n.types?"types":n.type==="TSTupleType"||n.type==="TupleTypeAnnotation"?"elementTypes":"elements",o=n[a];if(o.length===0)s.push(yl(e,t,u,i));else{let p=M(!1,o,-1),y=(p==null?void 0:p.type)!=="RestElement"&&!n.inexact,D=p===null,m=Symbol("array"),C=!t.__inJestEach&&o.length>1&&o.every((d,S,g)=>{let _=d==null?void 0:d.type;if(!U(d)&&!se(d))return!1;let v=g[S+1];if(v&&_!==v.type)return!1;let j=U(d)?"elements":"properties";return d[j]&&d[j].length>1}),c=Cs(n,t),A=y?D?",":oe(t)?c?B(",","",{groupId:m}):B(","):"":"";s.push(l([u,f([E,c?fl(e,t,r,A):[Dl(e,t,a,n.inexact,r),A],J(e,t)]),E,i],{shouldBreak:C,id:m}))}return s.push($(e),H(e,r)),s}function Cs(e,t){return U(e)&&e.elements.length>1&&e.elements.every(r=>r&&(Fe(r)||Mn(r)&&!T(r.argument))&&!T(r,h.Trailing|h.Line,n=>!Z(t.originalText,q(n),{backwards:!0})))}function Gi({node:e},{originalText:t}){let r=s=>_t(t,vt(t,s)),n=s=>t[s]===","?s:n(r(s+1));return jt(t,n(k(e)))}function Dl(e,t,r,n,s){let u=[];return e.each(({node:i,isLast:a})=>{u.push(i?l(s()):""),(!a||n)&&u.push([",",x,i&&Gi(e,t)?E:""])},r),n&&u.push("..."),u}function fl(e,t,r,n){let s=[];return e.each(({isLast:u,next:i})=>{s.push([r(),u?n:","]),u||s.push(Gi(e,t)?[F,F]:T(i,h.Leading|h.Line)?F:x)},"elements"),qr(s)}var El=/^[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/,Fl=e=>El.test(e),Ui=Fl;function Cl(e){return e.length===1?e:e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")}var Et=Cl;var Dn=new WeakMap;function Xi(e){return/^(?:\d+|\d+\.\d+)$/u.test(e)}function Yi(e,t){return t.parser==="json"||t.parser==="jsonc"||!te(e.key)||nt(fe(e.key),t).slice(1,-1)!==e.key.value?!1:!!(Ui(e.key.value)&&!(t.parser==="babel-ts"&&e.type==="ClassProperty"||t.parser==="typescript"&&e.type==="PropertyDefinition")||Xi(e.key.value)&&String(Number(e.key.value))===e.key.value&&e.type!=="ImportAttribute"&&(t.parser==="babel"||t.parser==="acorn"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree"))}function Al(e,t){let{key:r}=e.node;return(r.type==="Identifier"||Fe(r)&&Xi(Et(fe(r)))&&String(r.value)===Et(fe(r))&&!(t.parser==="typescript"||t.parser==="babel-ts"))&&(t.parser==="json"||t.parser==="jsonc"||t.quoteProps==="consistent"&&Dn.get(e.parent))}function Ft(e,t,r){let{node:n}=e;if(n.computed)return["[",r("key"),"]"];let{parent:s}=e,{key:u}=n;if(t.quoteProps==="consistent"&&!Dn.has(s)){let i=e.siblings.some(a=>!a.computed&&te(a.key)&&!Yi(a,t));Dn.set(s,i)}if(Al(e,t)){let i=nt(JSON.stringify(u.type==="Identifier"?u.name:u.value.toString()),t);return e.call(a=>ye(a,i,t),"key")}return Yi(n,t)&&(t.quoteProps==="as-needed"||t.quoteProps==="consistent"&&!Dn.get(s))?e.call(i=>ye(i,/^\d/u.test(u.value)?Et(u.value):u.value,t),"key"):r("key")}function fn(e,t,r){let{node:n}=e;return n.shorthand?r("value"):ht(e,t,r,Ft(e,t,r),":","value")}var Tl=({node:e,key:t,parent:r})=>t==="value"&&e.type==="FunctionExpression"&&(r.type==="ObjectMethod"||r.type==="ClassMethod"||r.type==="ClassPrivateMethod"||r.type==="MethodDefinition"||r.type==="TSAbstractMethodDefinition"||r.type==="TSDeclareMethod"||r.type==="Property"&&kt(r));function En(e,t,r,n){if(Tl(e))return Fn(e,r,t);let{node:s}=e,u=!1;if((s.type==="FunctionDeclaration"||s.type==="FunctionExpression")&&(n!=null&&n.expandLastArg)){let{parent:y}=e;L(y)&&(pe(y).length>1||z(s).every(D=>D.type==="Identifier"&&!D.typeAnnotation))&&(u=!0)}let i=[K(e),s.async?"async ":"",`function${s.generator?"*":""} `,s.id?t("id"):""],a=Ue(e,t,r,u),o=Qt(e,t),p=ot(s,o);return i.push(tt(e,r,t),l([p?l(a):a,o]),s.body?" ":"",t("body")),r.semi&&(s.declare||!s.body)&&i.push(";"),i}function Fr(e,t,r){let{node:n}=e,{kind:s}=n,u=n.value||n,i=[];return!s||s==="init"||s==="method"||s==="constructor"?u.async&&i.push("async "):(Mt.ok(s==="get"||s==="set"),i.push(s," ")),u.generator&&i.push("*"),i.push(Ft(e,t,r),n.optional||n.key.optional?"?":"",n===u?Fn(e,t,r):r("value")),i}function Fn(e,t,r){let{node:n}=e,s=Ue(e,r,t),u=Qt(e,r),i=qi(n),a=ot(n,u),o=[tt(e,t,r),l([i?l(s,{shouldBreak:!0}):a?l(s):s,u])];return n.body?o.push(" ",r("body")):o.push(t.semi?";":""),o}function dl(e){let t=z(e);return t.length===1&&!e.typeParameters&&!T(e,h.Dangling)&&t[0].type==="Identifier"&&!t[0].typeAnnotation&&!T(t[0])&&!t[0].optional&&!e.predicate&&!e.returnType}function Cn(e,t){if(t.arrowParens==="always")return!1;if(t.arrowParens==="avoid"){let{node:r}=e;return dl(r)}return!1}function Qt(e,t){let{node:r}=e,s=[H(e,t,"returnType")];return r.predicate&&s.push(t("predicate")),s}function Hi(e,t,r){let{node:n}=e,s=t.semi?";":"",u=[];if(n.argument){let o=r("argument");xl(t,n.argument)?o=["(",f([F,o]),F,")"]:(De(n.argument)||n.argument.type==="SequenceExpression"||t.experimentalTernaries&&n.argument.type==="ConditionalExpression"&&(n.argument.consequent.type==="ConditionalExpression"||n.argument.alternate.type==="ConditionalExpression"))&&(o=l([B("("),f([E,o]),E,B(")")])),u.push(" ",o)}let i=T(n,h.Dangling),a=s&&i&&T(n,h.Last|h.Line);return a&&u.push(s),i&&u.push(" ",J(e,t)),a||u.push(s),u}function Vi(e,t,r){return["return",Hi(e,t,r)]}function $i(e,t,r){return["throw",Hi(e,t,r)]}function xl(e,t){if(Le(e.originalText,t)||T(t,h.Leading,r=>de(e.originalText,q(r),k(r)))&&!X(t))return!0;if(Jt(t)){let r=t,n;for(;n=pu(r);)if(r=n,Le(e.originalText,r))return!0}return!1}var gs=new WeakMap;function Ki(e){return gs.has(e)||gs.set(e,e.type==="ConditionalExpression"&&!ae(e,t=>t.type==="ObjectExpression")),gs.get(e)}var Qi=e=>e.type==="SequenceExpression";function zi(e,t,r,n={}){let s=[],u,i=[],a=!1,o=!n.expandLastArg&&e.node.body.type==="ArrowFunctionExpression",p;(function S(){let{node:g}=e,_=hl(e,t,r,n);if(s.length===0)s.push(_);else{let{leading:v,trailing:j}=ls(e,t);s.push([v,_]),i.unshift(j)}o&&(a||(a=g.returnType&&z(g).length>0||g.typeParameters||z(g).some(v=>v.type!=="Identifier"))),!o||g.body.type!=="ArrowFunctionExpression"?(u=r("body",n),p=g.body):e.call(S,"body")})();let y=!Le(t.originalText,p)&&(Qi(p)||gl(p,u,t)||!a&&Ki(p)),D=e.key==="callee"&&mt(e.parent),m=Symbol("arrow-chain"),C=Sl(e,n,{signatureDocs:s,shouldBreak:a}),c=!1,A=!1,d=!1;return o&&(D||n.assignmentLayout)&&(A=!0,d=!T(e.node,h.Leading&h.Line),c=n.assignmentLayout==="chain-tail-arrow-chain"||D&&!y),u=Bl(e,t,n,{bodyDoc:u,bodyComments:i,functionBody:p,shouldPutBodyOnSameLine:y}),l([l(A?f([d?E:"",C]):C,{shouldBreak:c,id:m})," =>",o?xt(u,{groupId:m}):l(u),o&&D?B(E,"",{groupId:m}):""])}function hl(e,t,r,n){let{node:s}=e,u=[];if(s.async&&u.push("async "),Cn(e,t))u.push(r(["params",0]));else{let a=n.expandLastArg||n.expandFirstArg,o=Qt(e,r);if(a){if(re(o))throw new Dt;o=l(cr(o))}u.push(l([Ue(e,r,t,a,!0),o]))}let i=J(e,t,{filter(a){let o=it(t.originalText,k(a));return o!==!1&&t.originalText.slice(o,o+2)==="=>"}});return i&&u.push(" ",i),u}function gl(e,t,r){var n,s;return U(e)||se(e)||e.type==="ArrowFunctionExpression"||e.type==="DoExpression"||e.type==="BlockStatement"||X(e)||((n=t.label)==null?void 0:n.hug)!==!1&&(((s=t.label)==null?void 0:s.embed)||_r(e,r.originalText))}function Sl(e,t,{signatureDocs:r,shouldBreak:n}){if(r.length===1)return r[0];let{parent:s,key:u}=e;return u!=="callee"&&mt(s)||De(s)?l([r[0]," =>",f([x,b([" =>",x],r.slice(1))])],{shouldBreak:n}):u==="callee"&&mt(s)||t.assignmentLayout?l(b([" =>",x],r),{shouldBreak:n}):l(f(b([" =>",x],r)),{shouldBreak:n})}function Bl(e,t,r,{bodyDoc:n,bodyComments:s,functionBody:u,shouldPutBodyOnSameLine:i}){let{node:a,parent:o}=e,p=r.expandLastArg&&oe(t,"all")?B(","):"",y=(r.expandLastArg||o.type==="JSXExpressionContainer")&&!T(a)?E:"";return i&&Ki(u)?[" ",l([B("","("),f([E,n]),B("",")"),p,y]),s]:(Qi(u)&&(n=l(["(",f([E,n]),E,")"])),i?[" ",n,s]:[f([x,n,s]),p,y])}var bl=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let s=t[n];if(r(s,n,t))return s}}},Zi=bl;function Cr(e,t,r,n){let{node:s}=e,u=[],i=Zi(!1,s[n],a=>a.type!=="EmptyStatement");return e.each(({node:a})=>{a.type!=="EmptyStatement"&&(u.push(r()),a!==i&&(u.push(F),ce(a,t)&&u.push(F)))},n),u}function An(e,t,r){let n=Pl(e,t,r),{node:s,parent:u}=e;if(s.type==="Program"&&(u==null?void 0:u.type)!=="ModuleExpression")return n?[n,F]:"";let i=[];if(s.type==="StaticBlock"&&i.push("static "),i.push("{"),n)i.push(f([F,n]),F);else{let a=e.grandparent;u.type==="ArrowFunctionExpression"||u.type==="FunctionExpression"||u.type==="FunctionDeclaration"||u.type==="ComponentDeclaration"||u.type==="HookDeclaration"||u.type==="ObjectMethod"||u.type==="ClassMethod"||u.type==="ClassPrivateMethod"||u.type==="ForStatement"||u.type==="WhileStatement"||u.type==="DoWhileStatement"||u.type==="DoExpression"||u.type==="ModuleExpression"||u.type==="CatchClause"&&!a.finalizer||u.type==="TSModuleDeclaration"||s.type==="StaticBlock"||i.push(F)}return i.push("}"),i}function Pl(e,t,r){let{node:n}=e,s=O(n.directives),u=n.body.some(o=>o.type!=="EmptyStatement"),i=T(n,h.Dangling);if(!s&&!u&&!i)return"";let a=[];return s&&(a.push(Cr(e,t,r,"directives")),(u||i)&&(a.push(F),ce(M(!1,n.directives,-1),t)&&a.push(F))),u&&a.push(Cr(e,t,r,"body")),i&&a.push(J(e,t)),a}function kl(e){let t=new WeakMap;return function(r){return t.has(r)||t.set(r,Symbol(e)),t.get(r)}}var Tn=kl;function Il(e){switch(e){case null:return"";case"PlusOptional":return"+?";case"MinusOptional":return"-?";case"Optional":return"?"}}function ea(e,t,r){let{node:n}=e;return l([n.variance?r("variance"):"","[",f([r("keyTparam")," in ",r("sourceType")]),"]",Il(n.optional),": ",r("propType")])}function Ss(e,t){return e==="+"||e==="-"?e+t:t}function ta(e,t,r){let{node:n}=e,s=t.objectWrap==="preserve"&&de(t.originalText,q(n),q(n.typeParameter));return l(["{",f([t.bracketSpacing?x:E,l([r("typeParameter"),n.optional?Ss(n.optional,"?"):"",n.typeAnnotation?": ":"",r("typeAnnotation")]),t.semi?B(";"):""]),J(e,t),t.bracketSpacing?x:E,"}"],{shouldBreak:s})}var Ar=Tn("typeParameters");function Ll(e,t,r){let{node:n}=e;return z(n).length===1&&n.type.startsWith("TS")&&!n[r][0].constraint&&e.parent.type==="ArrowFunctionExpression"&&!(t.filepath&&/\.ts$/u.test(t.filepath))}function Ot(e,t,r,n){let{node:s}=e;if(!s[n])return"";if(!Array.isArray(s[n]))return r(n);let u=It(e.grandparent),i=e.match(p=>!(p[n].length===1&&Re(p[n][0])),void 0,(p,y)=>y==="typeAnnotation",p=>p.type==="Identifier",Ts);if(s[n].length===0||!i&&(u||s[n].length===1&&(s[n][0].type==="NullableTypeAnnotation"||xs(s[n][0]))))return["<",b(", ",e.map(r,n)),wl(e,t),">"];let o=s.type==="TSTypeParameterInstantiation"?"":Ll(e,t,n)?",":oe(t)?B(","):"";return l(["<",f([E,b([",",x],e.map(r,n))]),o,E,">"],{id:Ar(s)})}function wl(e,t){let{node:r}=e;if(!T(r,h.Dangling))return"";let n=!T(r,h.Line),s=J(e,t,{indent:!n});return n?s:[s,F]}function dn(e,t,r){let{node:n,parent:s}=e,u=[n.const?"const ":""],i=n.type==="TSTypeParameter"?r("name"):n.name;if(s.type==="TSMappedType")return s.readonly&&u.push(Ss(s.readonly,"readonly")," "),u.push("[",i),n.constraint&&u.push(" in ",r("constraint")),s.nameType&&u.push(" as ",e.callParent(()=>r("nameType"))),u.push("]"),u;if(n.variance&&u.push(r("variance")),n.in&&u.push("in "),n.out&&u.push("out "),u.push(i),n.bound&&(n.usesExtendsBound&&u.push(" extends "),u.push(H(e,r,"bound"))),n.constraint){let a=Symbol("constraint");u.push(" extends",l(f(x),{id:a}),je,xt(r("constraint"),{groupId:a}))}return n.default&&u.push(" = ",r("default")),l(u)}var ra=R(["ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function xn(e,t,r){let{node:n}=e,s=[K(e),Vt(e),"class"],u=T(n.id,h.Trailing)||T(n.typeParameters,h.Trailing)||T(n.superClass)||O(n.extends)||O(n.mixins)||O(n.implements),i=[],a=[];if(n.id&&i.push(" ",r("id")),i.push(r("typeParameters")),n.superClass){let y=[_l(e,t,r),r(n.superTypeArguments?"superTypeArguments":"superTypeParameters")],D=e.call(m=>["extends ",ye(m,y,t)],"superClass");u?a.push(x,l(D)):a.push(" ",D)}else a.push(Bs(e,t,r,"extends"));a.push(Bs(e,t,r,"mixins"),Bs(e,t,r,"implements"));let o;if(u){let y;ua(n)?y=[...i,f(a)]:y=f([...i,a]),o=na(n),s.push(l(y,{id:o}))}else s.push(...i,...a);let p=n.body;return u&&O(p.body)?s.push(B(F," ",{groupId:o})):s.push(" "),s.push(r("body")),s}var na=Tn("heritageGroup");function sa(e){return B(F,"",{groupId:na(e)})}function Ol(e){return["extends","mixins","implements"].reduce((t,r)=>t+(Array.isArray(e[r])?e[r].length:0),e.superClass?1:0)>1}function ua(e){return e.typeParameters&&!T(e.typeParameters,h.Trailing|h.Line)&&!Ol(e)}function Bs(e,t,r,n){let{node:s}=e;if(!O(s[n]))return"";let u=J(e,t,{marker:n});return[ua(s)?B(" ",x,{groupId:Ar(s.typeParameters)}):x,u,u&&F,n,l(f([x,b([",",x],e.map(r,n))]))]}function _l(e,t,r){let n=r("superClass"),{parent:s}=e;return s.type==="AssignmentExpression"?l(B(["(",f([E,n]),E,")"],n)):n}function hn(e,t,r){let{node:n}=e,s=[];return O(n.decorators)&&s.push(Fs(e,t,r)),s.push($t(n)),n.static&&s.push("static "),s.push(Vt(e)),n.override&&s.push("override "),s.push(Fr(e,t,r)),s}function gn(e,t,r){let{node:n}=e,s=[],u=t.semi?";":"";O(n.decorators)&&s.push(Fs(e,t,r)),s.push(K(e),$t(n)),n.static&&s.push("static "),s.push(Vt(e)),n.override&&s.push("override "),n.readonly&&s.push("readonly "),n.variance&&s.push(r("variance")),(n.type==="ClassAccessorProperty"||n.type==="AccessorProperty"||n.type==="TSAbstractAccessorProperty")&&s.push("accessor "),s.push(Ft(e,t,r),$(e),mn(e),H(e,r));let i=n.type==="TSAbstractPropertyDefinition"||n.type==="TSAbstractAccessorProperty";return[ht(e,t,r,s," =",i?void 0:"value"),u]}function ia(e,t,r){let{node:n}=e,s=[];return e.each(({node:u,next:i,isLast:a})=>{s.push(r()),!t.semi&&ra(u)&&vl(u,i)&&s.push(";"),a||(s.push(F),ce(u,t)&&s.push(F))},"body"),T(n,h.Dangling)&&s.push(J(e,t)),["{",s.length>0?[f([F,s]),F]:"","}"]}function vl(e,t){var s;let{type:r,name:n}=e.key;if(!e.computed&&r==="Identifier"&&(n==="static"||n==="get"||n==="set")&&!e.value&&!e.typeAnnotation)return!0;if(!t||t.static||t.accessibility||t.readonly)return!1;if(!t.computed){let u=(s=t.key)==null?void 0:s.name;if(u==="in"||u==="instanceof")return!0}if(ra(t)&&t.variance&&!t.static&&!t.declare)return!0;switch(t.type){case"ClassProperty":case"PropertyDefinition":case"TSAbstractPropertyDefinition":return t.computed;case"MethodDefinition":case"TSAbstractMethodDefinition":case"ClassMethod":case"ClassPrivateMethod":{if((t.value?t.value.async:t.async)||t.kind==="get"||t.kind==="set")return!1;let i=t.value?t.value.generator:t.generator;return!!(t.computed||i)}case"TSIndexSignature":return!0}return!1}var jl=R(["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"]);function bs(e){return jl(e)?bs(e.expression):e}var aa=R(["FunctionExpression","ArrowFunctionExpression"]);function oa(e){return e.type==="MemberExpression"||e.type==="OptionalMemberExpression"||e.type==="Identifier"&&e.name!=="undefined"}function pa(e,t){if(t.semi||Ps(e,t)||ks(e,t))return!1;let{node:r,key:n,parent:s}=e;return!!(r.type==="ExpressionStatement"&&(n==="body"&&(s.type==="Program"||s.type==="BlockStatement"||s.type==="StaticBlock"||s.type==="TSModuleBlock")||n==="consequent"&&s.type==="SwitchCase")&&e.call(()=>ca(e,t),"expression"))}function ca(e,t){let{node:r}=e;switch(r.type){case"ParenthesizedExpression":case"TypeCastExpression":case"ArrayExpression":case"ArrayPattern":case"TemplateLiteral":case"TemplateElement":case"RegExpLiteral":return!0;case"ArrowFunctionExpression":if(!Cn(e,t))return!0;break;case"UnaryExpression":{let{prefix:n,operator:s}=r;if(n&&(s==="+"||s==="-"))return!0;break}case"BindExpression":if(!r.object)return!0;break;case"Literal":if(r.regex)return!0;break;default:if(X(r))return!0}return ke(e,t)?!0:Jt(r)?e.call(()=>ca(e,t),...Lr(r)):!1}function Ps({node:e,parent:t},r){return(r.parentParser==="markdown"||r.parentParser==="mdx")&&e.type==="ExpressionStatement"&&X(e.expression)&&t.type==="Program"&&t.body.length===1}function ks({node:e,parent:t},r){return(r.parser==="__vue_event_binding"||r.parser==="__vue_ts_event_binding")&&e.type==="ExpressionStatement"&&t.type==="Program"&&t.body.length===1}function la(e,t,r){let n=[r("expression")];if(ks(e,t)){let s=bs(e.node.expression);(aa(s)||oa(s))&&n.push(";")}else Ps(e,t)||t.semi&&n.push(";");return n}function ma(e,t,r){if(t.__isVueBindings||t.__isVueForBindingLeft){let n=e.map(r,"program","body",0,"params");if(n.length===1)return n[0];let s=b([",",x],n);return t.__isVueForBindingLeft?["(",f([E,l(s)]),E,")"]:s}if(t.__isEmbeddedTypescriptGenericParameters){let n=e.map(r,"program","body",0,"typeParameters","params");return b([",",x],n)}}function fa(e,t){let{node:r}=e;switch(r.type){case"RegExpLiteral":return ya(r);case"BigIntLiteral":return Sn(r.extra.raw);case"NumericLiteral":return Et(r.extra.raw);case"StringLiteral":return ve(nt(r.extra.raw,t));case"NullLiteral":return"null";case"BooleanLiteral":return String(r.value);case"DirectiveLiteral":return Da(r.extra.raw,t);case"Literal":{if(r.regex)return ya(r.regex);if(r.bigint)return Sn(r.raw);let{value:n}=r;return typeof n=="number"?Et(r.raw):typeof n=="string"?Ml(e)?Da(r.raw,t):ve(nt(r.raw,t)):String(n)}}}function Ml(e){if(e.key!=="expression")return;let{parent:t}=e;return t.type==="ExpressionStatement"&&t.directive}function Sn(e){return e.toLowerCase()}function ya({pattern:e,flags:t}){return t=[...t].sort().join(""),`/${e}/${t}`}function Da(e,t){let r=e.slice(1,-1);if(r.includes('"')||r.includes("'"))return e;let n=t.singleQuote?"'":'"';return n+r+n}function Rl(e,t,r){let n=e.originalText.slice(t,r);for(let s of e[Symbol.for("comments")]){let u=q(s);if(u>r)break;let i=k(s);if(ie.type==="ExportDefaultDeclaration"||e.type==="DeclareExportDeclaration"&&e.default;function Bn(e,t,r){let{node:n}=e,s=[Si(e,t,r),K(e),"export",Fa(n)?" default":""],{declaration:u,exported:i}=n;return T(n,h.Dangling)&&(s.push(" ",J(e,t)),vr(n)&&s.push(F)),u?s.push(" ",r("declaration")):(s.push(Wl(n)),n.type==="ExportAllDeclaration"||n.type==="DeclareExportAllDeclaration"?(s.push(" *"),i&&s.push(" as ",r("exported"))):s.push(Aa(e,t,r)),s.push(Ca(e,t,r),da(e,t,r))),s.push(ql(n,t)),s}var Jl=R(["ClassDeclaration","ComponentDeclaration","FunctionDeclaration","TSInterfaceDeclaration","DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","HookDeclaration","TSDeclareFunction","EnumDeclaration"]);function ql(e,t){return t.semi&&(!e.declaration||Fa(e)&&!Jl(e.declaration))?";":""}function Ls(e,t=!0){return e&&e!=="value"?`${t?" ":""}${e}${t?"":" "}`:""}function ws(e,t){return Ls(e.importKind,t)}function Wl(e){return Ls(e.exportKind)}function Ca(e,t,r){let{node:n}=e;if(!n.source)return"";let s=[];return Ta(n,t)&&s.push(" from"),s.push(" ",r("source")),s}function Aa(e,t,r){let{node:n}=e;if(!Ta(n,t))return"";let s=[" "];if(O(n.specifiers)){let u=[],i=[];e.each(()=>{let a=e.node.type;if(a==="ExportNamespaceSpecifier"||a==="ExportDefaultSpecifier"||a==="ImportNamespaceSpecifier"||a==="ImportDefaultSpecifier")u.push(r());else if(a==="ExportSpecifier"||a==="ImportSpecifier")i.push(r());else throw new Ne(n,"specifier")},"specifiers"),s.push(b(", ",u)),i.length>0&&(u.length>0&&s.push(", "),i.length>1||u.length>0||n.specifiers.some(o=>T(o))?s.push(l(["{",f([t.bracketSpacing?x:E,b([",",x],i)]),B(oe(t)?",":""),t.bracketSpacing?x:E,"}"])):s.push(["{",t.bracketSpacing?" ":"",...i,t.bracketSpacing?" ":"","}"]))}else s.push("{}");return s}function Ta(e,t){return e.type!=="ImportDeclaration"||O(e.specifiers)||e.importKind==="type"?!0:Is(t,q(e),q(e.source)).trimEnd().endsWith("from")}function Nl(e,t){var n,s;if((n=e.extra)!=null&&n.deprecatedAssertSyntax)return"assert";let r=Is(t,k(e.source),(s=e.attributes)!=null&&s[0]?q(e.attributes[0]):k(e)).trimStart();return r.startsWith("assert")?"assert":r.startsWith("with")||O(e.attributes)?"with":void 0}function da(e,t,r){let{node:n}=e;if(!n.source)return"";let s=Nl(n,t);if(!s)return"";let u=[` ${s} {`];return O(n.attributes)&&(t.bracketSpacing&&u.push(" "),u.push(b(", ",e.map(r,"attributes"))),t.bracketSpacing&&u.push(" ")),u.push("}"),u}function xa(e,t,r){let{node:n}=e,{type:s}=n,u=s.startsWith("Import"),i=u?"imported":"local",a=u?"local":"exported",o=n[i],p=n[a],y="",D="";return s==="ExportNamespaceSpecifier"||s==="ImportNamespaceSpecifier"?y="*":o&&(y=r(i)),p&&!Gl(n)&&(D=r(a)),[Ls(s==="ImportSpecifier"?n.importKind:n.exportKind,!1),y,y&&D?" as ":"",D]}function Gl(e){if(e.type!=="ImportSpecifier"&&e.type!=="ExportSpecifier")return!1;let{local:t,[e.type==="ImportSpecifier"?"imported":"exported"]:r}=e;if(t.type!==r.type||!su(t,r))return!1;if(te(t))return t.value===r.value&&fe(t)===fe(r);switch(t.type){case"Identifier":return t.name===r.name;default:return!1}}function gt(e,t,r){var j;let n=t.semi?";":"",{node:s}=e,u=s.type==="ObjectTypeAnnotation",i=s.type==="TSEnumDeclaration"||s.type==="EnumBooleanBody"||s.type==="EnumNumberBody"||s.type==="EnumBigIntBody"||s.type==="EnumStringBody"||s.type==="EnumSymbolBody",a=[s.type==="TSTypeLiteral"||i?"members":s.type==="TSInterfaceBody"?"body":"properties"];u&&a.push("indexers","callProperties","internalSlots");let o=a.flatMap(I=>e.map(({node:G})=>({node:G,printed:r(),loc:q(G)}),I));a.length>1&&o.sort((I,G)=>I.loc-G.loc);let{parent:p,key:y}=e,D=u&&y==="body"&&(p.type==="InterfaceDeclaration"||p.type==="DeclareInterface"||p.type==="DeclareClass"),m=s.type==="TSInterfaceBody"||i||D||s.type==="ObjectPattern"&&p.type!=="FunctionDeclaration"&&p.type!=="FunctionExpression"&&p.type!=="ArrowFunctionExpression"&&p.type!=="ObjectMethod"&&p.type!=="ClassMethod"&&p.type!=="ClassPrivateMethod"&&p.type!=="AssignmentPattern"&&p.type!=="CatchClause"&&s.properties.some(I=>I.value&&(I.value.type==="ObjectPattern"||I.value.type==="ArrayPattern"))||s.type!=="ObjectPattern"&&t.objectWrap==="preserve"&&o.length>0&&de(t.originalText,q(s),o[0].loc),C=D?";":s.type==="TSInterfaceBody"||s.type==="TSTypeLiteral"?B(n,";"):",",c=s.type==="RecordExpression"?"#{":s.exact?"{|":"{",A=s.exact?"|}":"}",d=[],S=o.map(I=>{let G=[...d,l(I.printed)];return d=[C,x],(I.node.type==="TSPropertySignature"||I.node.type==="TSMethodSignature"||I.node.type==="TSConstructSignatureDeclaration"||I.node.type==="TSCallSignatureDeclaration")&&T(I.node,h.PrettierIgnore)&&d.shift(),ce(I.node,t)&&d.push(F),G});if(s.inexact||s.hasUnknownMembers){let I;if(T(s,h.Dangling)){let G=T(s,h.Line);I=[J(e,t),G||Z(t.originalText,k(M(!1,lt(s),-1)))?F:x,"..."]}else I=["..."];S.push([...d,...I])}let g=(j=M(!1,o,-1))==null?void 0:j.node,_=!(s.inexact||s.hasUnknownMembers||g&&(g.type==="RestElement"||(g.type==="TSPropertySignature"||g.type==="TSCallSignatureDeclaration"||g.type==="TSMethodSignature"||g.type==="TSConstructSignatureDeclaration")&&T(g,h.PrettierIgnore))),v;if(S.length===0){if(!T(s,h.Dangling))return[c,A,H(e,r)];v=l([c,J(e,t,{indent:!0}),E,A,$(e),H(e,r)])}else v=[D&&O(s.properties)?sa(p):"",c,f([t.bracketSpacing?x:E,...S]),B(_&&(C!==","||oe(t))?C:""),t.bracketSpacing?x:E,A,$(e),H(e,r)];return e.match(I=>I.type==="ObjectPattern"&&!O(I.decorators),Os)||Re(s)&&(e.match(void 0,(I,G)=>G==="typeAnnotation",(I,G)=>G==="typeAnnotation",Os)||e.match(void 0,(I,G)=>I.type==="FunctionTypeParam"&&G==="typeAnnotation",Os))||!m&&e.match(I=>I.type==="ObjectPattern",I=>I.type==="AssignmentExpression"||I.type==="VariableDeclarator")?v:l(v,{shouldBreak:m})}function Os(e,t){return(t==="params"||t==="parameters"||t==="this"||t==="rest")&&ds(e)}function Ul(e){let t=[e];for(let r=0;rm[N]===n),c=m.type===n.type&&!C,A,d,S=0;do d=A||n,A=e.getParentNode(S),S++;while(A&&A.type===n.type&&a.every(N=>A[N]!==d));let g=A||m,_=d;if(s&&(X(n[a[0]])||X(o)||X(p)||Ul(_))){D=!0,c=!0;let N=Q=>[B("("),f([E,Q]),E,B(")")],ue=Q=>Q.type==="NullLiteral"||Q.type==="Literal"&&Q.value===null||Q.type==="Identifier"&&Q.name==="undefined";y.push(" ? ",ue(o)?r(u):N(r(u))," : ",p.type===n.type||ue(p)?r(i):N(r(i)))}else{let N=Q=>t.useTabs?f(r(Q)):Be(2,r(Q)),ue=[x,"? ",o.type===n.type?B("","("):"",N(u),o.type===n.type?B("",")"):"",x,": ",N(i)];y.push(m.type!==n.type||m[i]===n||C?ue:t.useTabs?Jr(f(ue)):Be(Math.max(0,t.tabWidth-2),ue))}let v=[u,i,...a].some(N=>T(n[N],ue=>ee(ue)&&de(t.originalText,q(ue),k(ue)))),j=N=>m===g?l(N,{shouldBreak:v}):v?[N,Ee]:N,I=!D&&(W(m)||m.type==="NGPipeExpression"&&m.left===n)&&!m.computed,G=Hl(e),P=j([Yl(e,t,r),c?y:f(y),s&&I&&!G?E:""]);return C||G?l([f([E,P]),E]):P}function Vl(e,t){return(W(t)||t.type==="NGPipeExpression"&&t.left===e)&&!t.computed}function $l(e,t,r,n){return[...e.map(u=>lt(u)),lt(t),lt(r)].flat().some(u=>ee(u)&&de(n.originalText,q(u),k(u)))}var Kl=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function Ql(e){let{node:t}=e;if(t.type!=="ConditionalExpression")return!1;let r,n=t;for(let s=0;!r;s++){let u=e.getParentNode(s);if(u.type==="ChainExpression"&&u.expression===n||L(u)&&u.callee===n||W(u)&&u.object===n||u.type==="TSNonNullExpression"&&u.expression===n){n=u;continue}u.type==="NewExpression"&&u.callee===n||Ae(u)&&u.expression===n?(r=e.getParentNode(s+1),n=u):r=u}return n===t?!1:r[Kl.get(r.type)]===n}var _s=e=>[B("("),f([E,e]),E,B(")")];function zt(e,t,r,n){if(!t.experimentalTernaries)return ha(e,t,r);let{node:s}=e,u=s.type==="ConditionalExpression",i=Je(s),a=u?"consequent":"trueType",o=u?"alternate":"falseType",p=u?["test"]:["checkType","extendsType"],y=s[a],D=s[o],m=p.map(Ye=>s[Ye]),{parent:C}=e,c=C.type===s.type,A=c&&p.some(Ye=>C[Ye]===s),d=c&&C[o]===s,S=y.type===s.type,g=D.type===s.type,_=g||d,v=t.tabWidth>2||t.useTabs,j,I,G=0;do I=j||s,j=e.getParentNode(G),G++;while(j&&j.type===s.type&&p.every(Ye=>j[Ye]!==I));let P=j||C,N=n&&n.assignmentLayout&&n.assignmentLayout!=="break-after-operator"&&(C.type==="AssignmentExpression"||C.type==="VariableDeclarator"||C.type==="ClassProperty"||C.type==="PropertyDefinition"||C.type==="ClassPrivateProperty"||C.type==="ObjectProperty"||C.type==="Property"),ue=(C.type==="ReturnStatement"||C.type==="ThrowStatement")&&!(S||g),Q=u&&P.type==="JSXExpressionContainer"&&e.grandparent.type!=="JSXAttribute",Bt=Ql(e),Ct=Vl(s,C),w=i&&ke(e,t),ne=v?t.useTabs?" ":" ".repeat(t.tabWidth-1):"",xe=$l(m,y,D,t)||S||g,pt=!_&&!c&&!i&&(Q?y.type==="NullLiteral"||y.type==="Literal"&&y.value===null:ir(y,t)&&Jn(s.test,3)),bt=_||d||i&&!c||c&&u&&Jn(s.test,1)||pt,Rs=[];!S&&T(y,h.Dangling)&&e.call(Ye=>{Rs.push(J(Ye,t),F)},"consequent");let er=[];T(s.test,h.Dangling)&&e.call(Ye=>{er.push(J(Ye,t))},"test"),!g&&T(D,h.Dangling)&&e.call(Ye=>{er.push(J(Ye,t))},"alternate"),T(s,h.Dangling)&&er.push(J(e,t));let Js=Symbol("test"),Ga=Symbol("consequent"),Tr=Symbol("test-and-consequent"),Ua=u?[_s(r("test")),s.test.type==="ConditionalExpression"?Ee:""]:[r("checkType")," ","extends"," ",Je(s.extendsType)||s.extendsType.type==="TSMappedType"?r("extendsType"):l(_s(r("extendsType")))],qs=l([Ua," ?"],{id:Js}),Ya=r(a),dr=f([S||Q&&(X(y)||c||_)?F:x,Rs,Ya]),Xa=bt?l([qs,_?dr:B(dr,l(dr,{id:Ga}),{groupId:Js})],{id:Tr}):[qs,dr],Ln=r(o),Ws=pt?B(Ln,Jr(_s(Ln)),{groupId:Tr}):Ln,tr=[Xa,er.length>0?[f([F,er]),F]:g?F:pt?B(x," ",{groupId:Tr}):x,":",g?" ":v?bt?B(ne,B(_||pt?" ":ne," "),{groupId:Tr}):B(ne," "):" ",g?Ws:l([f(Ws),Q&&!pt?E:""]),Ct&&!Bt?E:"",xe?Ee:""];return N&&!xe?l(f([E,l(tr)])):N||ue?l(f(tr)):Bt||i&&A?l([f([E,tr]),w?E:""]):C===P?l(tr):tr}function ga(e,t,r,n){let{node:s}=e;if(wr(s))return fa(e,t);let u=t.semi?";":"",i=[];switch(s.type){case"JsExpressionRoot":return r("node");case"JsonRoot":return[r("node"),F];case"File":return ma(e,t,r)??r("program");case"EmptyStatement":return"";case"ExpressionStatement":return la(e,t,r);case"ChainExpression":return r("expression");case"ParenthesizedExpression":return!T(s.expression)&&(se(s.expression)||U(s.expression))?["(",r("expression"),")"]:l(["(",f([E,r("expression")]),E,")"]);case"AssignmentExpression":return ji(e,t,r);case"VariableDeclarator":return Mi(e,t,r);case"BinaryExpression":case"LogicalExpression":return $r(e,t,r);case"AssignmentPattern":return[r("left")," = ",r("right")];case"OptionalMemberExpression":case"MemberExpression":return Li(e,t,r);case"MetaProperty":return[r("meta"),".",r("property")];case"BindExpression":return s.object&&i.push(r("object")),i.push(l(f([E,Kr(e,t,r)]))),i;case"Identifier":return[s.name,$(e),mn(e),H(e,r)];case"V8IntrinsicIdentifier":return["%",s.name];case"SpreadElement":case"SpreadElementPattern":case"SpreadPropertyPattern":case"RestElement":return yn(e,r);case"FunctionDeclaration":case"FunctionExpression":return En(e,r,t,n);case"ArrowFunctionExpression":return zi(e,t,r,n);case"YieldExpression":return i.push("yield"),s.delegate&&i.push("*"),s.argument&&i.push(" ",r("argument")),i;case"AwaitExpression":if(i.push("await"),s.argument){i.push(" ",r("argument"));let{parent:a}=e;if(L(a)&&a.callee===s||W(a)&&a.object===s){i=[f([E,...i]),E];let o=e.findAncestor(p=>p.type==="AwaitExpression"||p.type==="BlockStatement");if((o==null?void 0:o.type)!=="AwaitExpression"||!ae(o.argument,p=>p===s))return l(i)}}return i;case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return Bn(e,t,r);case"ImportDeclaration":return Ea(e,t,r);case"ImportSpecifier":case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":case"ImportDefaultSpecifier":case"ExportDefaultSpecifier":return xa(e,t,r);case"ImportAttribute":return fn(e,t,r);case"Program":case"BlockStatement":case"StaticBlock":return An(e,t,r);case"ClassBody":return ia(e,t,r);case"ThrowStatement":return $i(e,t,r);case"ReturnStatement":return Vi(e,t,r);case"NewExpression":case"ImportExpression":case"OptionalCallExpression":case"CallExpression":return Qr(e,t,r);case"ObjectExpression":case"ObjectPattern":case"RecordExpression":return gt(e,t,r);case"Property":return kt(s)?Fr(e,t,r):fn(e,t,r);case"ObjectProperty":return fn(e,t,r);case"ObjectMethod":return Fr(e,t,r);case"Decorator":return["@",r("expression")];case"ArrayExpression":case"ArrayPattern":case"TupleExpression":return Kt(e,t,r);case"SequenceExpression":{let{parent:a}=e;if(a.type==="ExpressionStatement"||a.type==="ForStatement"){let o=[];return e.each(({isFirst:p})=>{p?o.push(r()):o.push(",",f([x,r()]))},"expressions"),l(o)}return l(b([",",x],e.map(r,"expressions")))}case"ThisExpression":return"this";case"Super":return"super";case"Directive":return[r("value"),u];case"UnaryExpression":return i.push(s.operator),/[a-z]$/u.test(s.operator)&&i.push(" "),T(s.argument)?i.push(l(["(",f([E,r("argument")]),E,")"])):i.push(r("argument")),i;case"UpdateExpression":return[s.prefix?s.operator:"",r("argument"),s.prefix?"":s.operator];case"ConditionalExpression":return zt(e,t,r,n);case"VariableDeclaration":{let a=e.map(r,"declarations"),o=e.parent,p=o.type==="ForStatement"||o.type==="ForInStatement"||o.type==="ForOfStatement",y=s.declarations.some(m=>m.init),D;return a.length===1&&!T(s.declarations[0])?D=a[0]:a.length>0&&(D=f(a[0])),i=[K(e),s.kind,D?[" ",D]:"",f(a.slice(1).map(m=>[",",y&&!p?F:x,m]))],p&&o.body!==s||i.push(u),l(i)}case"WithStatement":return l(["with (",r("object"),")",ft(s.body,r("body"))]);case"IfStatement":{let a=ft(s.consequent,r("consequent")),o=l(["if (",l([f([E,r("test")]),E]),")",a]);if(i.push(o),s.alternate){let p=T(s.consequent,h.Trailing|h.Line)||vr(s),y=s.consequent.type==="BlockStatement"&&!p;i.push(y?" ":F),T(s,h.Dangling)&&i.push(J(e,t),p?F:" "),i.push("else",l(ft(s.alternate,r("alternate"),s.alternate.type==="IfStatement")))}return i}case"ForStatement":{let a=ft(s.body,r("body")),o=J(e,t),p=o?[o,E]:"";return!s.init&&!s.test&&!s.update?[p,l(["for (;;)",a])]:[p,l(["for (",l([f([E,r("init"),";",x,r("test"),";",x,r("update")]),E]),")",a])]}case"WhileStatement":return l(["while (",l([f([E,r("test")]),E]),")",ft(s.body,r("body"))]);case"ForInStatement":return l(["for (",r("left")," in ",r("right"),")",ft(s.body,r("body"))]);case"ForOfStatement":return l(["for",s.await?" await":""," (",r("left")," of ",r("right"),")",ft(s.body,r("body"))]);case"DoWhileStatement":{let a=ft(s.body,r("body"));return i=[l(["do",a])],s.body.type==="BlockStatement"?i.push(" "):i.push(F),i.push("while (",l([f([E,r("test")]),E]),")",u),i}case"DoExpression":return[s.async?"async ":"","do ",r("body")];case"BreakStatement":case"ContinueStatement":return i.push(s.type==="BreakStatement"?"break":"continue"),s.label&&i.push(" ",r("label")),i.push(u),i;case"LabeledStatement":return s.body.type==="EmptyStatement"?[r("label"),":;"]:[r("label"),": ",r("body")];case"TryStatement":return["try ",r("block"),s.handler?[" ",r("handler")]:"",s.finalizer?[" finally ",r("finalizer")]:""];case"CatchClause":if(s.param){let a=T(s.param,p=>!ee(p)||p.leading&&Z(t.originalText,k(p))||p.trailing&&Z(t.originalText,q(p),{backwards:!0})),o=r("param");return["catch ",a?["(",f([E,o]),E,") "]:["(",o,") "],r("body")]}return["catch ",r("body")];case"SwitchStatement":return[l(["switch (",f([E,r("discriminant")]),E,")"])," {",s.cases.length>0?f([F,b(F,e.map(({node:a,isLast:o})=>[r(),!o&&ce(a,t)?F:""],"cases"))]):"",F,"}"];case"SwitchCase":{s.test?i.push("case ",r("test"),":"):i.push("default:"),T(s,h.Dangling)&&i.push(" ",J(e,t));let a=s.consequent.filter(o=>o.type!=="EmptyStatement");if(a.length>0){let o=Cr(e,t,r,"consequent");i.push(a.length===1&&a[0].type==="BlockStatement"?[" ",o]:f([F,o]))}return i}case"DebuggerStatement":return["debugger",u];case"ClassDeclaration":case"ClassExpression":return xn(e,t,r);case"ClassMethod":case"ClassPrivateMethod":case"MethodDefinition":return hn(e,t,r);case"ClassProperty":case"PropertyDefinition":case"ClassPrivateProperty":case"ClassAccessorProperty":case"AccessorProperty":return gn(e,t,r);case"TemplateElement":return ve(s.value.raw);case"TemplateLiteral":return Gr(e,r,t);case"TaggedTemplateExpression":return Hu(e,r);case"PrivateIdentifier":return["#",s.name];case"PrivateName":return["#",r("id")];case"TopicReference":return"%";case"ArgumentPlaceholder":return"?";case"ModuleExpression":return["module ",r("body")];case"InterpreterDirective":default:throw new Ne(s,"ESTree")}}function bn(e,t,r){let{parent:n,node:s,key:u}=e,i=[r("expression")];switch(s.type){case"AsConstExpression":i.push(" as const");break;case"AsExpression":case"TSAsExpression":i.push(" as ",r("typeAnnotation"));break;case"SatisfiesExpression":case"TSSatisfiesExpression":i.push(" satisfies ",r("typeAnnotation"));break}return u==="callee"&&L(n)||u==="object"&&W(n)?l([f([E,...i]),E]):i}function Sa(e,t,r){let{node:n}=e,s=[K(e),"component"];n.id&&s.push(" ",r("id")),s.push(r("typeParameters"));let u=zl(e,r,t);return n.rendersType?s.push(l([u," ",r("rendersType")])):s.push(l([u])),n.body&&s.push(" ",r("body")),t.semi&&n.type==="DeclareComponent"&&s.push(";"),s}function zl(e,t,r){let{node:n}=e,s=n.params;if(n.rest&&(s=[...s,n.rest]),s.length===0)return["(",J(e,r,{filter:i=>be(r.originalText,k(i))===")"}),")"];let u=[];return em(e,(i,a)=>{let o=a===s.length-1;o&&n.rest&&u.push("..."),u.push(t()),!o&&(u.push(","),ce(s[a],r)?u.push(F,F):u.push(x))}),["(",f([E,...u]),B(oe(r,"all")&&!Zl(n,s)?",":""),E,")"]}function Zl(e,t){var r;return e.rest||((r=M(!1,t,-1))==null?void 0:r.type)==="RestElement"}function em(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);e.each(s,"params"),r.rest&&e.call(s,"rest")}function Ba(e,t,r){let{node:n}=e;return n.shorthand?r("local"):[r("name")," as ",r("local")]}function ba(e,t,r){let{node:n}=e,s=[];return n.name&&s.push(r("name"),n.optional?"?: ":": "),s.push(r("typeAnnotation")),s}function Pa(e,t,r){return gt(e,r,t)}function Pn(e,t){let{node:r}=e,n=t("id");r.computed&&(n=["[",n,"]"]);let s="";return r.initializer&&(s=t("initializer")),r.init&&(s=t("init")),s?[n," = ",s]:n}function ka(e,t,r){let{node:n}=e,s;if(n.type==="EnumSymbolBody"||n.explicitType)switch(n.type){case"EnumBooleanBody":s="boolean";break;case"EnumNumberBody":s="number";break;case"EnumBigIntBody":s="bigint";break;case"EnumStringBody":s="string";break;case"EnumSymbolBody":s="symbol";break}return[s?`of ${s} `:"",Pa(e,t,r)]}function kn(e,t,r){let{node:n}=e;return[K(e),n.const?"const ":"","enum ",t("id")," ",n.type==="TSEnumDeclaration"?Pa(e,t,r):t("body")]}function La(e,t,r){let{node:n}=e,s=["hook"];n.id&&s.push(" ",r("id"));let u=Ue(e,r,t,!1,!0),i=Qt(e,r),a=ot(n,i);return s.push(l([a?l(u):u,i]),n.body?" ":"",r("body")),s}function wa(e,t,r){let{node:n}=e,s=[K(e),"hook"];return n.id&&s.push(" ",r("id")),t.semi&&s.push(";"),s}function Ia(e){var r;let{node:t}=e;return t.type==="HookTypeAnnotation"&&((r=e.getParentNode(2))==null?void 0:r.type)==="DeclareHook"}function Oa(e,t,r){let{node:n}=e,s=[];s.push(Ia(e)?"":"hook ");let u=Ue(e,r,t,!1,!0),i=[];return i.push(Ia(e)?": ":" => ",r("returnType")),ot(n,i)&&(u=l(u)),s.push(u,i),l(s)}function In(e,t,r){let{node:n}=e,s=[K(e),"interface"],u=[],i=[];n.type!=="InterfaceTypeAnnotation"&&u.push(" ",r("id"),r("typeParameters"));let a=n.typeParameters&&!T(n.typeParameters,h.Trailing|h.Line);return O(n.extends)&&i.push(a?B(" ",x,{groupId:Ar(n.typeParameters)}):x,"extends ",(n.extends.length===1?Eu:f)(b([",",x],e.map(r,"extends")))),T(n.id,h.Trailing)||O(n.extends)?a?s.push(l([...u,f(i)])):s.push(l(f([...u,...i]))):s.push(...u,...i),s.push(" ",r("body")),l(s)}function _a(e,t,r){let{node:n}=e;if(Pr(n))return n.type.slice(0,-14).toLowerCase();let s=t.semi?";":"";switch(n.type){case"ComponentDeclaration":case"DeclareComponent":case"ComponentTypeAnnotation":return Sa(e,t,r);case"ComponentParameter":return Ba(e,t,r);case"ComponentTypeParameter":return ba(e,t,r);case"HookDeclaration":return La(e,t,r);case"DeclareHook":return wa(e,t,r);case"HookTypeAnnotation":return Oa(e,t,r);case"DeclareClass":return xn(e,t,r);case"DeclareFunction":return[K(e),"function ",r("id"),r("predicate"),s];case"DeclareModule":return["declare module ",r("id")," ",r("body")];case"DeclareModuleExports":return["declare module.exports",H(e,r),s];case"DeclareNamespace":return["declare namespace ",r("id")," ",r("body")];case"DeclareVariable":return[K(e),n.kind??"var"," ",r("id"),s];case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return Bn(e,t,r);case"DeclareOpaqueType":case"OpaqueType":return Wi(e,t,r);case"DeclareTypeAlias":case"TypeAlias":return Zr(e,t,r);case"IntersectionTypeAnnotation":return en(e,t,r);case"UnionTypeAnnotation":return tn(e,t,r);case"ConditionalTypeAnnotation":return zt(e,t,r);case"InferTypeAnnotation":return sn(e,t,r);case"FunctionTypeAnnotation":return rn(e,t,r);case"TupleTypeAnnotation":return Kt(e,t,r);case"TupleTypeLabeledElement":return an(e,t,r);case"TupleTypeSpreadElement":return un(e,t,r);case"GenericTypeAnnotation":return[r("id"),Ot(e,t,r,"typeParameters")];case"IndexedAccessType":case"OptionalIndexedAccessType":return nn(e,t,r);case"TypeAnnotation":return on(e,t,r);case"TypeParameter":return dn(e,t,r);case"TypeofTypeAnnotation":return cn(e,r);case"ExistsTypeAnnotation":return"*";case"ArrayTypeAnnotation":return pn(r);case"DeclareEnum":case"EnumDeclaration":return kn(e,r,t);case"EnumBooleanBody":case"EnumNumberBody":case"EnumBigIntBody":case"EnumStringBody":case"EnumSymbolBody":return ka(e,r,t);case"EnumBooleanMember":case"EnumNumberMember":case"EnumBigIntMember":case"EnumStringMember":case"EnumDefaultedMember":return Pn(e,r);case"FunctionTypeParam":{let u=n.name?r("name"):e.parent.this===n?"this":"";return[u,$(e),u?": ":"",r("typeAnnotation")]}case"DeclareInterface":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":return In(e,t,r);case"ClassImplements":case"InterfaceExtends":return[r("id"),r("typeParameters")];case"NullableTypeAnnotation":return["?",r("typeAnnotation")];case"Variance":{let{kind:u}=n;return Mt.ok(u==="plus"||u==="minus"),u==="plus"?"+":"-"}case"KeyofTypeAnnotation":return["keyof ",r("argument")];case"ObjectTypeCallProperty":return[n.static?"static ":"",r("value")];case"ObjectTypeMappedTypeProperty":return ea(e,t,r);case"ObjectTypeIndexer":return[n.static?"static ":"",n.variance?r("variance"):"","[",r("id"),n.id?": ":"",r("key"),"]: ",r("value")];case"ObjectTypeProperty":{let u="";return n.proto?u="proto ":n.static&&(u="static "),[u,n.kind!=="init"?n.kind+" ":"",n.variance?r("variance"):"",Ft(e,t,r),$(e),kt(n)?"":": ",r("value")]}case"ObjectTypeAnnotation":return gt(e,t,r);case"ObjectTypeInternalSlot":return[n.static?"static ":"","[[",r("id"),"]]",$(e),n.method?"":": ",r("value")];case"ObjectTypeSpreadProperty":return yn(e,r);case"QualifiedTypeofIdentifier":case"QualifiedTypeIdentifier":return[r("qualification"),".",r("id")];case"NullLiteralTypeAnnotation":return"null";case"BooleanLiteralTypeAnnotation":return String(n.value);case"StringLiteralTypeAnnotation":return ve(nt(fe(n),t));case"NumberLiteralTypeAnnotation":return Et(n.raw??n.extra.raw);case"BigIntLiteralTypeAnnotation":return Sn(n.raw??n.extra.raw);case"TypeCastExpression":return["(",r("expression"),H(e,r),")"];case"TypePredicate":return ln(e,r);case"TypeOperator":return[n.operator," ",r("typeAnnotation")];case"TypeParameterDeclaration":case"TypeParameterInstantiation":return Ot(e,t,r,"params");case"InferredPredicate":case"DeclaredPredicate":return[e.key==="predicate"&&e.parent.type!=="DeclareFunction"&&!e.parent.returnType?": ":" ","%checks",...n.type==="DeclaredPredicate"?["(",r("value"),")"]:[]];case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return bn(e,t,r)}}function va(e,t,r){var i;let{node:n}=e;if(!n.type.startsWith("TS"))return;if(kr(n))return n.type.slice(2,-7).toLowerCase();let s=t.semi?";":"",u=[];switch(n.type){case"TSThisType":return"this";case"TSTypeAssertion":{let a=!(U(n.expression)||se(n.expression)),o=l(["<",f([E,r("typeAnnotation")]),E,">"]),p=[B("("),f([E,r("expression")]),E,B(")")];return a?et([[o,r("expression")],[o,l(p,{shouldBreak:!0})],[o,r("expression")]]):l([o,r("expression")])}case"TSDeclareFunction":return En(e,r,t);case"TSExportAssignment":return["export = ",r("expression"),s];case"TSModuleBlock":return An(e,t,r);case"TSInterfaceBody":case"TSTypeLiteral":return gt(e,t,r);case"TSTypeAliasDeclaration":return Zr(e,t,r);case"TSQualifiedName":return[r("left"),".",r("right")];case"TSAbstractMethodDefinition":case"TSDeclareMethod":return hn(e,t,r);case"TSAbstractAccessorProperty":case"TSAbstractPropertyDefinition":return gn(e,t,r);case"TSInterfaceHeritage":case"TSClassImplements":case"TSExpressionWithTypeArguments":case"TSInstantiationExpression":return[r("expression"),r(n.typeArguments?"typeArguments":"typeParameters")];case"TSTemplateLiteralType":return Gr(e,r,t);case"TSNamedTupleMember":return an(e,t,r);case"TSRestType":return un(e,t,r);case"TSOptionalType":return[r("typeAnnotation"),"?"];case"TSInterfaceDeclaration":return In(e,t,r);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return Ot(e,t,r,"params");case"TSTypeParameter":return dn(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":return bn(e,t,r);case"TSArrayType":return pn(r);case"TSPropertySignature":return[n.readonly?"readonly ":"",Ft(e,t,r),$(e),H(e,r)];case"TSParameterProperty":return[$t(n),n.static?"static ":"",n.override?"override ":"",n.readonly?"readonly ":"",r("parameter")];case"TSTypeQuery":return cn(e,r);case"TSIndexSignature":{let a=n.parameters.length>1?B(oe(t)?",":""):"",o=l([f([E,b([", ",E],e.map(r,"parameters"))]),a,E]),p=e.parent.type==="ClassBody"&&e.key==="body";return[p&&n.static?"static ":"",n.readonly?"readonly ":"","[",n.parameters?o:"","]",H(e,r),p?s:""]}case"TSTypePredicate":return ln(e,r);case"TSNonNullExpression":return[r("expression"),"!"];case"TSImportType":return["import(",r("argument"),")",n.qualifier?[".",r("qualifier")]:"",Ot(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSLiteralType":return r("literal");case"TSIndexedAccessType":return nn(e,t,r);case"TSTypeOperator":return[n.operator," ",r("typeAnnotation")];case"TSMappedType":return ta(e,t,r);case"TSMethodSignature":{let a=n.kind&&n.kind!=="method"?`${n.kind} `:"";u.push($t(n),a,n.computed?"[":"",r("key"),n.computed?"]":"",$(e));let o=Ue(e,r,t,!1,!0),p=n.returnType?"returnType":"typeAnnotation",y=n[p],D=y?H(e,r,p):"",m=ot(n,D);return u.push(m?l(o):o),y&&u.push(l(D)),l(u)}case"TSNamespaceExportDeclaration":return["export as namespace ",r("id"),t.semi?";":""];case"TSEnumDeclaration":return kn(e,r,t);case"TSEnumMember":return Pn(e,r);case"TSImportEqualsDeclaration":return[n.isExport?"export ":"","import ",ws(n,!1),r("id")," = ",r("moduleReference"),t.semi?";":""];case"TSExternalModuleReference":return["require(",r("expression"),")"];case"TSModuleDeclaration":{let{parent:a}=e,o=a.type==="TSModuleDeclaration",p=((i=n.body)==null?void 0:i.type)==="TSModuleDeclaration";return o?u.push("."):(u.push(K(e)),n.kind!=="global"&&u.push(n.kind," ")),u.push(r("id")),p?u.push(r("body")):n.body?u.push(" ",l(r("body"))):u.push(s),u}case"TSConditionalType":return zt(e,t,r);case"TSInferType":return sn(e,t,r);case"TSIntersectionType":return en(e,t,r);case"TSUnionType":return tn(e,t,r);case"TSFunctionType":case"TSCallSignatureDeclaration":case"TSConstructorType":case"TSConstructSignatureDeclaration":return rn(e,t,r);case"TSTupleType":return Kt(e,t,r);case"TSTypeReference":return[r("typeName"),Ot(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSTypeAnnotation":return on(e,t,r);case"TSEmptyBodyFunctionExpression":return Fn(e,t,r);case"TSJSDocAllType":return"*";case"TSJSDocUnknownType":return"?";case"TSJSDocNullableType":return hs(e,r,"?");case"TSJSDocNonNullableType":return hs(e,r,"!");case"TSParenthesizedType":default:throw new Ne(n,"TypeScript")}}function tm(e,t,r,n){if(Vr(e))return Di(e,t);for(let s of[gi,Ti,_a,va,ga]){let u=s(e,t,r,n);if(u!==void 0)return u}}var rm=R(["ClassMethod","ClassPrivateMethod","ClassProperty","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition","ClassPrivateProperty","MethodDefinition","TSAbstractMethodDefinition","TSDeclareMethod"]);function nm(e,t,r,n){var D;e.isRoot&&((D=t.__onHtmlBindingRoot)==null||D.call(t,e.node,t));let s=tm(e,t,r,n);if(!s)return"";let{node:u}=e;if(rm(u))return s;let i=O(u.decorators),a=Bi(e,t,r),o=u.type==="ClassExpression";if(i&&!o)return lr(s,m=>l([a,m]));let p=ke(e,t),y=pa(e,t);return!a&&!p&&!y?s:lr(s,m=>[y?";":"",p?"(":"",p&&o&&i?[f([x,a,m]),x]:[a,m],p?")":""])}var ja=nm;var sm={avoidAstMutation:!0};var Ma=[{linguistLanguageId:174,name:"JSON.stringify",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".importmap"],filenames:["package.json","package-lock.json","composer.json"],parsers:["json-stringify"],vscodeLanguageIds:["json"]},{linguistLanguageId:174,name:"JSON",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".json",".4DForm",".4DProject",".avsc",".geojson",".gltf",".har",".ice",".JSON-tmLanguage",".mcmeta",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","Pipfile.lock","composer.lock","flake.lock","mcmod.info",".babelrc",".jscsrc",".jshintrc",".jslintrc",".swcrc"],parsers:["json"],vscodeLanguageIds:["json"]},{linguistLanguageId:423,name:"JSON with Comments",type:"data",color:"#292929",group:"JSON",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",aliases:["jsonc"],extensions:[".jsonc",".code-snippets",".code-workspace",".sublime-build",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[],parsers:["jsonc"],vscodeLanguageIds:["jsonc"]},{linguistLanguageId:175,name:"JSON5",type:"data",color:"#267CB9",extensions:[".json5"],tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"application/json",parsers:["json5"],vscodeLanguageIds:["json5"]}];var js={};xr(js,{getVisitorKeys:()=>Ja,massageAstNode:()=>Wa,print:()=>am});var um={JsonRoot:["node"],ArrayExpression:["elements"],ObjectExpression:["properties"],ObjectProperty:["key","value"],UnaryExpression:["argument"],NullLiteral:[],BooleanLiteral:[],StringLiteral:[],NumericLiteral:[],Identifier:[],TemplateLiteral:["quasis"],TemplateElement:[]},Ra=um;var im=Br(Ra),Ja=im;function am(e,t,r){let{node:n}=e;switch(n.type){case"JsonRoot":return[r("node"),F];case"ArrayExpression":{if(n.elements.length===0)return"[]";let s=e.map(()=>e.node===null?"null":r(),"elements");return["[",f([F,b([",",F],s)]),F,"]"]}case"ObjectExpression":return n.properties.length===0?"{}":["{",f([F,b([",",F],e.map(r,"properties"))]),F,"}"];case"ObjectProperty":return[r("key"),": ",r("value")];case"UnaryExpression":return[n.operator==="+"?"":n.operator,r("argument")];case"NullLiteral":return"null";case"BooleanLiteral":return n.value?"true":"false";case"StringLiteral":return JSON.stringify(n.value);case"NumericLiteral":return qa(e)?JSON.stringify(String(n.value)):JSON.stringify(n.value);case"Identifier":return qa(e)?JSON.stringify(n.name):n.name;case"TemplateLiteral":return r(["quasis",0]);case"TemplateElement":return JSON.stringify(n.value.cooked);default:throw new Ne(n,"JSON")}}function qa(e){return e.key==="key"&&e.parent.type==="ObjectProperty"}var om=new Set(["start","end","extra","loc","comments","leadingComments","trailingComments","innerComments","errors","range","tokens"]);function Wa(e,t){let{type:r}=e;if(r==="ObjectProperty"){let{key:n}=e;n.type==="Identifier"?t.key={type:"StringLiteral",value:n.name}:n.type==="NumericLiteral"&&(t.key={type:"StringLiteral",value:String(n.value)});return}if(r==="UnaryExpression"&&e.operator==="+")return t.argument;if(r==="ArrayExpression"){for(let[n,s]of e.elements.entries())s===null&&t.elements.splice(n,0,{type:"NullLiteral"});return}if(r==="TemplateLiteral")return{type:"StringLiteral",value:e.quasis[0].value.cooked}}Wa.ignoredProperties=om;var Zt={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var St="JavaScript",pm={arrowParens:{category:St,type:"choice",default:"always",description:"Include parentheses around a sole arrow function parameter.",choices:[{value:"always",description:"Always include parens. Example: `(x) => x`"},{value:"avoid",description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:Zt.bracketSameLine,objectWrap:Zt.objectWrap,bracketSpacing:Zt.bracketSpacing,jsxBracketSameLine:{category:St,type:"boolean",description:"Put > on the last line instead of at a new line.",deprecated:"2.4.0"},semi:{category:St,type:"boolean",default:!0,description:"Print semicolons.",oppositeDescription:"Do not print semicolons, except at the beginning of lines which may need them."},experimentalOperatorPosition:{category:St,type:"choice",default:"end",description:"Where to print operators when binary expressions wrap lines.",choices:[{value:"start",description:"Print operators at the start of new lines."},{value:"end",description:"Print operators at the end of previous lines."}]},experimentalTernaries:{category:St,type:"boolean",default:!1,description:"Use curious ternaries, with the question mark after the condition.",oppositeDescription:"Default behavior of ternaries; keep question marks on the same line as the consequent."},singleQuote:Zt.singleQuote,jsxSingleQuote:{category:St,type:"boolean",default:!1,description:"Use single quotes in JSX."},quoteProps:{category:St,type:"choice",default:"as-needed",description:"Change when properties in objects are quoted.",choices:[{value:"as-needed",description:"Only add quotes around object properties where required."},{value:"consistent",description:"If at least one property in an object requires quotes, quote all properties."},{value:"preserve",description:"Respect the input use of quotes in object properties."}]},trailingComma:{category:St,type:"choice",default:"all",description:"Print trailing commas wherever possible when multi-line.",choices:[{value:"all",description:"Trailing commas wherever possible (including function arguments)."},{value:"es5",description:"Trailing commas where valid in ES5 (objects, arrays, etc.)"},{value:"none",description:"No trailing commas."}]},singleAttributePerLine:Zt.singleAttributePerLine},Na=pm;var cm={estree:vs,"estree-json":js},lm=[...Xs,...Ma];var lx=Ms;export{lx as default,lm as languages,Na as options,cm as printers}; diff --git a/node_modules/prettier/plugins/flow.js b/node_modules/prettier/plugins/flow.js new file mode 100644 index 0000000..2f020a6 --- /dev/null +++ b/node_modules/prettier/plugins/flow.js @@ -0,0 +1,19 @@ +(function(i){function e(){var f=i();return f.default||f}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.flow=e()}})(function(){"use strict";var CE0=Object.create;var sd=Object.defineProperty;var jE0=Object.getOwnPropertyDescriptor;var OE0=Object.getOwnPropertyNames;var DE0=Object.getPrototypeOf,FE0=Object.prototype.hasOwnProperty;var RE0=(o0,ox)=>()=>(ox||o0((ox={exports:{}}).exports,ox),ox.exports),rz=(o0,ox)=>{for(var $x in ox)sd(o0,$x,{get:ox[$x],enumerable:!0})},ez=(o0,ox,$x,Ar)=>{if(ox&&typeof ox=="object"||typeof ox=="function")for(let lr of OE0(ox))!FE0.call(o0,lr)&&lr!==$x&&sd(o0,lr,{get:()=>ox[lr],enumerable:!(Ar=jE0(ox,lr))||Ar.enumerable});return o0};var LE0=(o0,ox,$x)=>($x=o0!=null?CE0(DE0(o0)):{},ez(ox||!o0||!o0.__esModule?sd($x,"default",{value:o0,enumerable:!0}):$x,o0)),ME0=o0=>ez(sd({},"__esModule",{value:!0}),o0);var tz=RE0(fO=>{(function(o0){typeof globalThis!="object"&&(this?ox():(o0.defineProperty(o0.prototype,"_T_",{configurable:!0,get:ox}),_T_));function ox(){var $x=this||self;$x.globalThis=$x,delete o0.prototype._T_}})(Object);(function(o0){"use strict";var ox="loc",$x=70416,Ar=69748,lr=163,Pr=92159,L2=43587,ie="labeled_statement",pO="&=",Bs="int_of_string",od=110591,vd=92909,M4=11559,kO="regexp",ld=43301,q4=11703,pd=122654,Us=255,mO="%ni",kd=68252,hO=232,md=42785,Dn="declare_variable",B4="while",hd=66938,dd=70301,yd=124907,U4=126515,dO=218,Fn="pattern_identifier",gd=67643,Rn="export_source",wd=216,_d=64279,yO="Out_of_memory",bd=113788,gO="comments",Td=126624,wO="win32",Ln="object_key_bigint_literal",Ed=185,X4=123214,Mo="constructor",Sd=69955,Mn="import_declaration",Ad=68437,Pd="Failure",Y4="Unix.Unix_error",Id=64255,Nd=42539,Cd=110579,qn="export_default_declaration",Bn="jsx_attribute_name",z4=11727,jd=43002,K4=126500,Un="component_param_pattern",_O="collect_comments_opt",Xn="match_unary_pattern",Yn="keyof_type",bO="Invalid binary/octal ",TO="range",J4=170,Xs="false",Od=43798,EO=", characters ",zn="object_type_property_getter",Dd=65547,Fd=126467,Rd=65007,SO="guard",Ld=42237,Md=8318,qd=71215,Kn="object_property_type",Jn="type_alias",Bd=67742,Gn="function_body",AO=304,Ud=68111,G4=120745,Xd=71959,W4=43880,PO="Match_failure",IO=280,Wn="type_cast",Vn=109,Ys="void",Yd="generator",zd=125124,Kd=101589,V4=94179,NO=">>>",$4=70404,$n="optional_indexed_access_type",CO=310,g1="argument",Qn="object_property",Hn="object_type_property",Jd=67004,Gd=42783,Wd=68850,jO="@",Vd=43741,$d=43487,Q4="object",OO="end",H4=126571,Qd=71956,DO=208,Hd=126566,Zd=67702,FO="EEXIST",Zn="this_expression",RO=203,xy=11507,ry=113807,Z4=119893,ey=42735,Bl="rest",x7="null_literal",Ul="protected",ty=43615,l1=8231,ny=68149,uy=73727,iy=72348,fy=92995,qo=224,cy=11686,sy=43013,r7="assignment_pattern",ay=12329,e7="function_type",v3=192,t7="jsx_element_name",oy=70018,n7="catch_clause_pattern",xp=126540,u7="template_literal",vy=120654,ly=68497,py=67679,i7="readonly_type",ky=68735,my="<",rp=": No such file or directory",hy=66915,LO="!",f7="object_type",dy=43712,ep=64297,yy=183969,gy=43503,wy=67591,Bo=65278,_y=67669,c7="for_of_assignment_pattern",Xl="`",by=11502,s7="catch_body",Ty=42191,Fa=-744106340,Ey=182,Uo=":",MO="a string",Sy=65663,Ay=66978,Py=71947,tp=43519,Iy=71086,Ny=125258,Cy=12538,a7="expression_or_spread",qO="Printexc.handle_uncaught_exception",np=69956,up=120122,ip=247,BO=231,jy=" : flags Open_rdonly and Open_wronly are not compatible",o7="statement_fork_point",UO=710,XO=-692038429,Re="static",Oy=55203,Dy=64324,Fy=64111,YO="!==",Ry=120132,Ly=124903,Yl="class",zO=222,v7="pattern_number_literal",zs="kind",My=71903,l7="variable_declarator",p7="typeof_expression",qy=126627,By=70084,KO=228,fp=70480,k7="class_private_field",Uy=239,cp=120713,xn=65535,m7="private_name",Xy=43137,h7="remote_identifier",Yy=70161,d7="label_identifier",zy="src/parser/statement_parser.ml",Ky=8335,Jy=19903,Gy=64310,Xo="_",y7="for_init_declaration",JO="infer",Wy=64466,Vy=43018,GO="tokens",$y=92735,Qy=66954,Hy=65473,Zy=70285,g7="sequence",x9="compare: functional value",r9=69890,zl=1e3,e9=65487,t9=42653,WO="\\\\",VO="%=",w7="match_member_pattern_base",n9=72367,_7="function_rest_param",$O="/static/",u9=124911,i9=65276,sp=126558,f9=11498,QO=137,b7="export_default_declaration_decl",c9="cases",ap=126602,T7="jsx_child",Le="continue",s9=42962,HO="importKind",c2=122,l3="Literal",E7="pattern_object_property_identifier_key",a9=42508,Ra="in",o9=55238,v9=67071,l9=70831,p9=72161,k9=67462,ZO="<<=",m9=43009,h9=66383,op=67827,d9=72202,y9=69839,g9=66775,xD="-=",Yo=8202,w9=70105,_9=120538,S7="for_in_left_declaration",b9="rendersType",vp=126563,T9=70708,lp=126523,rD=166,eD=202,E9=110951,Ks="component",pp=126552,S9=66977,tD=213,A7="enum_member_identifier",nD=210,P7="enum_bigint_body",uD=">=",A9=126495,P9="specifiers",iD=-88,I9="=",N9=65338,Kl="members",C9=123535,j9=43702,O9=72767,zo="get",D9=126633,kp=126536,F9=94098,R9="types",fD=273,L9=113663,cD="Internal Error: Found private field in object props",I7="jsx_element",M9=70366,q9=110959,mp=120655,sD="trailingComments",aD=282,La=24029,B9=-100,z1="yield",N7="binding_pattern",C7="typeof_identifier",oD="ENOTEMPTY",U9=-104,hp=126468,X9=1255,Y9=120628,j7="pattern_object_property_string_literal_key",z9=8521,vD="leadingComments",lD=8204,Ma="@ ",K9=70319,Js="left",J9=188,dp="case",G9=19967,yp=42622,W9=43492,V9=113770,$9=42774,Q9=183,gp=8468,O7="class_implements",wp=126579,p3="string",pD=211,e1=-48,H9=69926,Z9=123213,D7="if_consequent_statement",xg=124927,k3="number",rg=126546,eg=68119,tg=70726,_p=70750,ng=65489,kD="SpreadElement",mD="callee",hD=193,ug=70492,ig=71934,dD=164,fg=110580,cg=12320,bp="any",fe="/",F7="type_guard",A2="body",yD=272,gD=178,Te="pattern",wD="comment_bounds",R7="binding_type_identifier",sg=187,L7="pattern_array_rest_element_pattern",Tp="@])",ag=12543,og=11623,_D="start",vg=67871,ce="interface",lg=8449,pg=67637,kg=42961,Ep=120085,mg=126463,bD="alternate",TD=-1053382366,hg=70143,ED="--",dg=68031,M7="jsx_expression",q7="type_identifier_reference",Sp=11647,yg="proto",St="identifier",gg=43696,At="raw",wg=126529,_g=11564,Ap=126557,bg=64911,Pp=67592,Tg=43493,Eg=215,Sg=110588,Jl=461894857,Ag=92927,Pg=67861,Ig=119980,Ng=43042,Cg=66965,jg=67391,m3="computed",SD="unreachable jsxtext",Og=71167,Dg=42559,Fg=72966,AD=303,PD=180,ID=197,Ip=64319,Rg=169,ND="*",Ko=129,Lg=66335,Gl="meta",Mg=43388,Np=94178,it="optional",Cp="unknown",qg=120121,Bg=123180,jp=8469,Ug=68220,CD="|",Xg=43187,Yg=94207,zg=124895,Op=120513,Kg=42527,Jo=8286,Jg=94177,Wl="var",B7="component_type_param",Gg=66421,jD=267,Wg=92991,Vg=68415,U7="comment",X7="match_pattern_array_element",Go=244,Dp="^",$g=173791,OD=136,Qg=42890,Hg="ENOTDIR",Zg="??",xw=43711,rw=66303,ew=113800,tw=42239,nw=12703,Y7="variance_opt",z7="+",DD=">>>=",Fp="mixed",uw=65613,iw=73029,fw=68191,FD="*=",Rp=8487,cw=8477,K7="toplevel_statement_list",Lp="never",Mp="do",qa=125,sw=72249,RD="Pervasives.do_at_exit",LD="visit_trailing_comment",J7="jsx_closing_element",G7="jsx_namespaced_name",aw=124908,ow=126651,W7="component_declaration",vw=15,V7="interface_type",$7="function_type_return_annotation",lw=64109,qp=65595,Bp=126560,pw=110927,MD=301,Up=65598,Xp=8488,Gs="`.",qD=175,Yp="package",zp="else",Kp=120771,kw=68023,BD="fd ",Wo=8238,Jp=888960333,Gp=119965,mw=42655,Q7="match_object_pattern",hw=11710,dw=119993,H7="boolean_literal",Z7="statement_list",xu="function_param",ru="match_as_pattern",eu="pattern_object_property_bigint_literal_key",Wp=69959,yw=120485,UD=240,gw=191456,tu="declare_enum",Vp=120597,$p=70281,nu="type_annotation",uu="spread_element",Qp=126544,ww=120069,Ba="key",_w=43583,bw="out",Tw=` +`,XD="**=",iu="pattern_object_property_pattern",Ew="e",Sw=72712,YD="Internal Error: Found object private prop",Aw="ENOENT",Pw=-42,fu="jsx_opening_attribute",Iw=67646,cu="component_type",Nw=64296,Cw=43887,zD="Division_by_zero",KD="EnumDefaultedMember",su="typeof_member_identifier",jw=43792,au="match_member_pattern_property",ou="declare_export_declaration_decl",Ow=93026,vu="type_annotation_hint",Dw=42887,Fw=43881,Rw=43761,Hp=8526,JD=158,GD=287,h3=119,Lw=43866,Mw=72847,qw=8348,se=101,Bw=94026,Zp=72272,WD="src/parser/flow_lexer.ml",Uw=120744,Vo=8191,d3="implies",xk=255,rk=11711,lu="match_unary_pattern_argument",Xw=71235,VD=288,ek=68116,y2=100,pu="match_expression",ku="enum_body",tk=1114111,mu="assignment",Yw=71955,nk=43260,hu="pattern_array_e",zw=126583,$D="prefix",du="class_body",uk="shorthand",Kw=171,Jw=66256,ik=-97,QD=" =",Gw=94032,Ww=42606,Vw=71839,fk=120134,$w=55291,Qw=92862,Hw=43019,Zw=126543,y3="function",x_=111355,r_=11389,e_=70753,t_=43249,n_=64829,ck="line",yu="function_declaration",sk="undefined",HD="([^/]+)",u_=110947,i_=70002,ZD="Cygwin",gu="as_expression",f_=12591,ak=64285,c_=2048,s_=73112,ok=126589,xF=225,vk=43259,a_=72817,lk=64318,rF=172,eF=209,wu="match_binding_pattern",_u=" ",bu="import_source",Vl="delete",tF="Enum `",pk=126553,o_=67001,$o="default",v_=11630,kk=206,Tu="enum_bigint_member",l_=67504,mk=67593,p_=113791,k_=69572,Eu="typeof_type",nF=212,uF="%i",Su="function_this_param",m_=72329,Ua="0x",Qo=8239,h_=75075,iF=57343,Au="pattern_bigint_literal",d_=12341,fF=201,Ho="hook",cF=": closedir failed",y_=42959,hk=119970,sF=278,g_=43560,aF="||=",Pu="member_private_name",w_=120570,Iu="object_key_identifier",dk=223,oF="Not_found",vF=230,Nu="jsx_element_name_member_expression",Cu="string_literal",__=120596,b_=43807,T_=69687,E_=63743,yk=72192,ju="member_property",S_=43262,Ou="class_declaration",lF="renders*",pF="%Li",A_=126578,Du="jsx_attribute",g3=254,Ee="empty",$l="label",Fu="object_internal_slot_property_type",gk=120133,P_=43359,Me="predicate",kF="??=",I_=43697,N_=-43,Ru="default_opt",mF="the start of a statement",C_=67826,Lu="object_",Mu="class_element",wk=11631,_k=70855,qu="opaque_type",Bu="number_literal",hF=", ",bk=8319,Tk=120004,Ek=133,Uu="type_params",Xu="pattern_object_rest_property",K1="import",j_=72e3,O_=67413,D_=12343,F_=70080,Yu="intersection_type",p1=-36,R_=70005,Sk="properties",L_=11679,M_=8483,q_=110587,dF=43520,zu="computed_key",yF=207,Ku="class_identifier",B_="Invalid number ",Ju="function_param_pattern",Zo=12288,U_=113817,X_=70730,Y_=178207,Ak=71236,gF=167,Gu="object_indexer_property_type",z_=64286,wF="TypeAnnotation",K_=220,Wu="type_identifier",Vu="spread_property",$u="jsx_attribute_value_expression",J_=126519,Pk=70108,Ik=126,Nk=42999,Xa="prototype",G_=" : flags Open_text and Open_binary are not compatible",_F="**",Ck=43823,W_=": Not a directory",Qu="render_type",jk=72349,w3="test",V_=43776,$_=92879,Q_=11263,bF=241,H_=93052,Hu="nullable_type",Z_=43704,xb=64321,TF="Property",rb=72191,EF=165,Ql="instanceof",eb=69247,qe="name",Ok=126634,tb=8516,Dk="typeArguments",nb=71127,Zu="jsx_spread_attribute",ub=66559,ib=44031,fb=43645,t1=8233,cb=71494,sb="opaque",Fk=72967,ab=70106,xi="logical",SF="@[%s =@ ",Hl="0o",Rk=126554,ob=71351,Lk=8484,vb=72242,Mk=120687,_3=252,lb=183983,Zl="%S",ri="function_this_param_type",AF=292,qk="decorators",pb=43255,ei="catch_clause",Be="-",kb=67711,PF=": file descriptor already closed",Bk=64311,Uk=120539,mb="arguments",Xk=73062,hb=173823,db=42124,yb=72095,gb=125259,wb=42969,Yk=70280,IF=12520,_b=69749,bb=70066,ti="binary",ni="for_in_statement",Tb=43010,NF="^=",Eb=126570,ui="for_statement",zk=126584,ii="function_return_annotation",Sb=72144,Ab=8505,fi="class_expression",Pb=120076,Ib=69807,Nb=40981,Cb=-24976191,jb=72768,Ob=126550,Kk='"',ci="call_type_arg",CF="f",xv="this",Jk=126628,jF="===",OF=56320,si="declare_module_exports",Db=120512,Pt=105,Fb=119974,Rb=71450,Lb=71942,DF=195,Gk=120629,FF="/=",RF=">>",ai="declare_interface",LF=4096,oi="pattern_array_rest_element",Mb=71338,Wk=126520,vi="as_const_expression",MF="Popping lex mode from empty stack",qF="renders?",qb=68405,li="member",pi="class_extends",rv=12287,Vk=126590,Bb=66377,Ya="async",ki="pattern_array_element",b3=240,BF=308,Ub=69864,ev="readonly",Xb=70460,Yb=120779,zb=66378,mi="new_",$k=126551,hi="pattern_object_rest_property_pattern",di="for_statement_init",Kb=43595,Qk=68296,Jb=120712,Gb=64217,Wb=69295,UF="||",Vb=";",$b=70461,Qb=66939,XF="collect_comments",Hk=279,yi="generic_type",Hb=68295,Zb=44002,Zk=72162,gi="object_call_property_type",x8=8305,r8=119995,e8="with",wi="class_property",YF="qualification",_i="jsx_attribute_name_namespaced",bi="if_statement",Ti="typeof_qualified_identifier",zF=238,xT=65615,KF=176,n1="expression",t8=126559,Ei="jsx_attribute_value",Si="<2>",Ai="component_param",n8="Map.bal",u8=132,rT=70412,eT=70440,JF="<<",i8="finally",GF="v",Pi="syntax_opt",Ii="meta_property",tT=12447,nT=67514,WF=260,f8=12448,Ni="object_mapped_type_property",tv="operator",VF="closedir",Ci="unary_expression",uT=126588,iT=70851,ji="export_batch_specifier",T3="renders",$F=226,fT=73111,QF=221,H0="",cT=66927,sT=64967,aT="elements",oT=67640,vT=43754,Oi="declare_export_declaration",lT=-26065557,pT=65855,x6="boolean",Ws="typeof",kT=124902,mT=139,hT=65629,HF=224,dT=43123,c8=70449,yT=12735,K2=107,s8=11719,ZF="!=",Di="call_type_args",E3="asserts",za=-46,gT="namespace",Fi="match_pattern",Ri="for_of_statement_lhs",a8=126504,wT=69505,o8="for",_T=72703,v8=120127,l8=43471,bT=93047,xR="Undefined_recursive_module",rR=2147483647,Li="template_literal_element",eR="Unexpected ",TT=101631,ET=65497,p8=68120,Mi="import_default_specifier",rn="array",tR="expressions",ST=110930,AT=204,qi="while_",Bi="function_rest_param_type",Ka=63,PT=77808,nR="Unexpected token `",kr=114,Ui="pattern_object_p",IT=65140,NT=123190,Xi="pattern_object_property_number_literal_key",r6="enum",Yi="conditional_type",J1=113,zi="array_type",uR="minus",CT=43790,Ki="do_while",jT=11567,OT=11694,e6=256,DT=119976,Ji="component_body",G1=111,FT=177976,iR=-56,k8=67644,RT=73439,t6=951901561,fR="?",cR=")",m8=43867,h8=65575,LT=69445,sR="FunctionTypeParam",d8=119996,MT=65019,Gi="conditional",qT=11505,aR=135,BT=71295,UT=12799,XT=67382,Wi="type_guard_annotation",Vi="object_key_computed",en=123,$i="pattern_object_property_key",YT=119892,zT=67505,KT=66962,Qi="with_",JT=43273,Hi="interface_declaration",y8="bool",GT=71945,WT="declaration",VT=11519,n6=">",$T=66771,g8="}",oR=8472,QT=43014,Zi="declare_function",Xr=127,HT="RestElement",ZT=190,xE=8467,vR="module",w8=126522,lR="Sys_blocked_io",xf="jsx_opening_element",rf="object_key_number_literal",pR="|=",kR="mixins",mR=205,hR=217,_8="if",dR="+=",ef="match_object_pattern_property_key",tf="match_rest_pattern",nf="export_named_declaration_specifier",b8="try",T8="_bigarr02",rE=70479,tn="right",eE=245,tE=11718,uf="tuple_labeled_element",yR="TypeParameterInstantiation",nE="mkdir",uE=71999,iE=870530776,gR="@[",wR=-908856609,_R=331416730,fE=11670,cE=66735,sE=43709,E8=43642,aE=67002,oE=69375,ff="function_body_any",vE=119807,bR="Assert_failure",cf="function_identifier",lE=65479,u6=131,nv="new",sf="for_of_left_declaration",pE=120084,kE=100343,mE=73030,S8=70452,TR=134,ER=152,hE=253,dE=42954,SR=227,af="jsx_member_expression_object",of="class_property_value",yE=120144,gE=66994,S3="set",wE=126498,vf="tuple_element",lf="arg_list",_E=65481,bE=8511,TE=42964,EE=11492,A3=-25,A8=126555,SE=71039,AE="exportKind",pf="program",PE=70187,AR=173,It="as",P3=124,PR="visit_leading_comment",IE=110575,kf="class_",NE=72440,CE=67897,IR=235,jE=8543,NR=141,mf=120,hf="match_object_pattern_property",i6=1024,OE=101640,CR=1027,jR=236,I3=246,OR="(",DE=66511,df="regexp_literal",FE=65574,RE=43513,LE=43695,DR="&&",P8=11558,ME=66503,qE=93071,yf="pattern_expression",BE=65381,I8=126538,UE=12292,gf="import_namespace_specifier",wf="match_statement_case",XE=67583,YE=120137,zE=69622,KE=120770,JE=71131,uv=8287,GE=110590,WE=65135,VE="Fatal error: exception ",f6=118,N8=181,C8=11687,k1="camlinternalFormat.ml",$E=72959,QE=249,_f="union_type",FR=8206,HE=73064,ZE=70271,xS=92728,j8=65344,O8=11695,bf="class_decorator",RR="the end of an expression statement (`;`)",rS=177983,eS=8457,LR=931,tS=66499,nS=94175,MR="#",uS="Identifier",Tf="for_in_statement_lhs",Ef="pattern_string_literal",D8=70302,F8=126496,iS=66461,fS=82943,R8=8450,cS=72271,sS=70853,aS="of",qR="Stack_overflow",c6="hasUnknownMembers",s6="a",Sf="variable_declarator_pattern",oS=73061,vS=77711,L8=64317,lS=73097,Af="enum_declaration",pS=66966,M8=189,kS=119964,Pf="type_param",nn=782176664,q8=65535,BR=-10,mS=64433,B8=43815,U8=94031,X8=73065,hS=69958,Y8="property",If="jsx_children",Nf="member_property_identifier",dS=42537,Ja="const",yS=70278,Cf="enum_string_member",a6="local",jf="jsx_element_name_identifier",gS=68223,z8="",wS=119967,K8=119994,_S=66993,Of="jsx_member_expression_identifier",J8="explicitType",bS=67589,TS=65597,ES="exported",SS=94111,AS=113775,Df="object_spread_property_type",PS=64847,Ff="component_identifier",Rf="class_implements_interface",UR=162,XR=243,IS=12783,YR=`Fatal error: exception %s +`,G8=120093,o6="column",Lf="component_rest_param",NS=70451,CS=70312,jS=69967,W8=70279,OS=66463,DS=92975,V8=70286,Mf="pattern_object_property_computed_key",qf="object_key_string_literal",FS="jsError",Bf="type_args",RS=8304,zR="==",iv=115,Uf="declare_component",LS=120092,MS=43638,qS=66811,BS=43334,US=66863,XS=77823,KR=143,Xf="optional_call",YS=126562,$8=70162,ft=104,zS=66963,fv="await",Q8=70107,W1="0",KS=72250,JS=8507,GS=100351,H8="AssignmentPattern",Yf="type",JR="%u",zf="function_expression_or_method",WS=43470,GR=242,WR="camlinternalMod.ml",Kf="match_or_pattern",VS=72750,$S=69414,QS=65370,Jf="syntax",VR=32752,HS=42963,$R="End_of_file",ZS=12294,xA=8471,QR="elementType",rA=43782,HR="++",eA=43641,tA=71944,nA=126601,uA=78894,iA=-45,cv="null",fA=177,ZR="satisfies",cA=131071,Gf="import_specifier",Wf="class_method",Vf="type_",sA=126514,aA=8454,xL="inexact",oA=67807,vA=8525,lA=65470,pA=71352,$f="tuple_spread_element",rL=219,kA="abstract",mA=73458,Ue="return",v6=65536,Z8=126548,Qf="array_element",hA=-253313196,dA=186,xm="catch",Hf="infer_type",yA=12295,eL="Invalid legacy octal ",gA=69762,wA=43311,_A=65437,Zf="variable_declaration",tL=-696510241,xc="function_params",bA=64316,nL=311,rm=11565,uL="infinity",TA="@]",EA=65908,rc="extends",SA=66204,AA=43784,PA=11742,em=126503,Xe="debugger",IA=70457,Vs=-86,l6=912068366,NA=68786,tm="keyof",nm=69415,CA=12686,un=127343600,ec="declare_type_alias",iL="the",fL=233,tc="jsx_element_name_namespaced",jA=72283,cL=161,nc="function_param_type",Nt=128,OA=-673950933,um=126591,sL="Sys_error",DA=74649,FA=74862,p6="is",RA=43738,LA=68479,MA=196,im=70854,uc="enum_boolean_member",ic="match_expression_case",fm=72163,qA=92783,fc="component_param_name",BA=68863,fn=32768,aL=2048,UA=64284,oL="@{",XA="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",cm=8455,cc="update_expression",vL=276,YA=65500,k6="from",zA=68447,sm=12592,KA=92766,lL=">>=",w1=110,JA=66431,GA=43586,sc="jsx_identifier",WA=" : file already exists",M2=128,VA=71958,$A=66717,ac="enum_boolean_body",QA=64262,Gr="id",oc="component_renders_annotation",HA=42888,ZA=8584,xP=73008,vc="enum_symbol_body",lc="declare_namespace",am=72713,rP=55215,pc="object_property_value_type",kc="for_in_assignment_pattern",om=8485,eP=43395,pL=229,$s="true",tP=43743,mc="enum_number_member",kL=234,nP=72969,mL="expected *",cn=102,hL=200,m6="symbol",sv="source",hc="tparam_const_modifier",uP=43714,dc="jsx_fragment",yc="jsx_attribute_name_identifier",h6="public",iP=43442,gc="pattern_object_property",fP=65786,cP=70783,sP=43713,aP=72160,dL="*-/",wc="export_named_specifier",_c="arrow_function",oP=122623,vm=70006,yL="${",vP=43814,bc="generic_qualified_identifier_type",gL=199,Tc="jsx_spread_child",lm=8489,pm=184,wL=2047,lP=66955,Ec="try_catch",pP=70497,_L=237,kP=67431,mP=125183,bL=-602162310,sn="params",hP="consequent",dP=68029,yP=67829,gP=68095,Sc="enum_string_body",wP=93823,_P=68351,bP=65495,Ac="declare_module",Pc="body_expression",TP=66175,EP=191,km=70441,mm=65141,hm="&",Ic="super_expression",dm=126564,SP=72105,lS0="fs",Ye="throw",AP=68287,PP=67839,av=116,IP=110882,NP=69404,CP=123197,ov=65279,N3="src/parser/type_parser.ml",jP=68115,TL=259,ym=126547,gm=126556,OP=73055,Nc="member_property_expression",Cc="enum_defaulted_member",DP=43071,FP=11726,jc="component_type_rest_param",RP=68607,Oc="object_key",EL=160,V1="variance",LP=70655,MP=70414,C3="super",qP=123583,BP=65594,d6="method",UP=73648,y6=121,XP=93951,Dc="pattern_array_element_pattern",YP=43764,zP=42993,wm=120145,KP=74879,SL=168,_m=8486,JP=72001,Fc="tagged_template",Rc="module_ref_literal",GP=65312,vv="implements",WP=43700,VP=120003,AL="Invalid_argument",Lc=16777215,$P=83526,bm=69744,Tm=12336,Mc="switch_case",PL=-61,qc="optional_member",QP=64274,Em=64322,Sm=126530,HP=71998,Am=72970,ZP=13311,xI=73647,rI=120074,j3="let",Bc="expression_statement",Uc="component_type_params",eI=512,tI=69634,nI=67461,uI=123627,iI=64913,IL="children",NL="PropertyDefinition",CL=1026,jL="%li",Xc="declare_class",fI=43258,Yc="indexed_access_type",cI=124926,Qs=112,sI="b",zc="predicate_expression",Kc="if_alternate_statement",g6="private",OL=-594953737,DL=140,aI="nan",oI=72103,Pm=11735,Jc="statement",vI="rmdir",Im=66512,lI="match",FL=198,pI=11734,Gc="import_named_specifier",kI=69599,mI=68799,hI=194559,Wc="match_array_pattern",RL=174,Vc="function_",$c="bigint_literal",i2=248,Nm=67638,Cm=126539,dI=11557,LL=214,yI=5760,ze="break",an="block",Qc="match_member_pattern",gI=123565,wI=66815,w2="value",ML=1039100673,_I=69746,bI=70448,TI=74751,Hc="init",EI=69551,jm=65548,Zc="jsx_member_expression",Om=68096,Hs=108,Dm=126521,SI=71487,xs="match_statement",AI=178205,PI=12548,qL=" : is a directory",on=".",II=12348,O3=-835925911,$1="typeParameters",NI=66855,u1="typeAnnotation",lv="bigint",rs="jsx_attribute_value_literal",CI=194,BL="T_JSX_TEXT",jI=68466,Fm=126537,UL=67714067,OI=69487,Rm="export",DI=43822,Lm=126499,FI=55242,es="member_type_identifier",XL=138,RI=71679,w6=130,LI=12438,MI=119969,YL=298,Mm=12539,qI=119972,zL=",",BI=71423,UI="index out of bounds",vn=106,D3="%d",KL="T_RENDERS_QUESTION",qm=120571,Bm="returnType",XI=69423,Um=120070,JL="%",F3=117,GL=179,YI="EBADF",zI=93759,Xm=64325,ts="component_params",KI=66517,JI=67423,GI=605857695,WI=43518,WL=251,ns="for_of_statement",VI=71983,VL="~",$I=12442,Ke="switch",QI=66207,Ym=126535,$L="&&=",HI=69289,ZI=71723,us="generic_identifier_type",xN=126619,is="object_type_property_setter",rN=70418,QL="<=",eN=125251,tN=11702,fs="enum_number_body",R3=250,nN=124910,uN=69297,iN=67455,fN=42511,cs="ts_satisfies",cN=68324,zm="an identifier",sN=126534,F1=103,aN=120126,L3=449540197,_6="declare",oN=68899,vN=126502,HL=294,ss="function_expression",ZL=142,lN=123135,pN=67967,kN=120487,mN=120686,as="export_named_declaration",hN=66348,Km=119981,dN=12352,os="tuple_type",yN=68680,Jm="target",vs="call";function _z(x,r,e,t,u){if(t<=r)for(var i=1;i<=u;i++)e[t+i]=x[r+i];else for(var i=u;i>=1;i--)e[t+i]=x[r+i];return 0}function bz(x){for(var r=[0];x!==0;){for(var e=x[1],t=1;tx.hi?1:this.hix.mi?1:this.mix.lo?1:this.loe?1:rx.mi?1:this.mix.lo?1:this.lo>24),e=-this.hi+(r>>24);return new tr(x,r,e)},tr.prototype.add=function(x){var r=this.lo+x.lo,e=this.mi+x.mi+(r>>24),t=this.hi+x.hi+(e>>24);return new tr(r,e,t)},tr.prototype.sub=function(x){var r=this.lo-x.lo,e=this.mi-x.mi+(r>>24),t=this.hi-x.hi+(e>>24);return new tr(r,e,t)},tr.prototype.mul=function(x){var r=this.lo*x.lo,e=(r*tM|0)+this.mi*x.lo+this.lo*x.mi,t=(e*tM|0)+this.hi*x.lo+this.mi*x.mi+this.lo*x.hi;return new tr(r,e,t)},tr.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0},tr.prototype.isNeg=function(){return this.hi<<16<0},tr.prototype.and=function(x){return new tr(this.lo&x.lo,this.mi&x.mi,this.hi&x.hi)},tr.prototype.or=function(x){return new tr(this.lo|x.lo,this.mi|x.mi,this.hi|x.hi)},tr.prototype.xor=function(x){return new tr(this.lo^x.lo,this.mi^x.mi,this.hi^x.hi)},tr.prototype.shift_left=function(x){return x=x&63,x==0?this:x<24?new tr(this.lo<>24-x,this.hi<>24-x):x<48?new tr(0,this.lo<>48-x):new tr(0,0,this.lo<>x|this.mi<<24-x,this.mi>>x|this.hi<<24-x,this.hi>>x):x<48?new tr(this.mi>>x-24|this.hi<<48-x,this.hi>>x-24,0):new tr(this.hi>>x-48,0,0)},tr.prototype.shift_right=function(x){if(x=x&63,x==0)return this;var r=this.hi<<16>>16;if(x<24)return new tr(this.lo>>x|this.mi<<24-x,this.mi>>x|r<<24-x,this.hi<<16>>x>>>16);var e=this.hi<<16>>31;return x<48?new tr(this.mi>>x-24|this.hi<<48-x,this.hi<<16>>x-24>>16,e&xn):new tr(this.hi<<16>>x-32,e,e)},tr.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23,this.mi=(this.mi<<1|this.lo>>23)&Lc,this.lo=this.lo<<1&Lc},tr.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&Lc,this.mi=(this.mi>>>1|this.hi<<23)&Lc,this.hi=this.hi>>>1},tr.prototype.udivmod=function(x){for(var r=0,e=this.copy(),t=x.copy(),u=new tr(0,0,0);e.ucompare(t)>0;)r++,t.lsl1();for(;r>=0;)r--,u.lsl1(),e.ucompare(t)>=0&&(u.lo++,e=e.sub(t)),t.lsr1();return{quotient:u,modulus:e}},tr.prototype.div=function(x){var r=this;x.isZero()&&uM();var e=r.hi^x.hi;r.hi&fn&&(r=r.neg()),x.hi&fn&&(x=x.neg());var t=r.udivmod(x).quotient;return e&fn&&(t=t.neg()),t},tr.prototype.mod=function(x){var r=this;x.isZero()&&uM();var e=r.hi;r.hi&fn&&(r=r.neg()),x.hi&fn&&(x=x.neg());var t=r.udivmod(x).modulus;return e&fn&&(t=t.neg()),t},tr.prototype.toInt=function(){return this.lo|this.mi<<24},tr.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo},tr.prototype.toArray=function(){return[this.hi>>8,this.hi&Us,this.mi>>16,this.mi>>8&Us,this.mi&Us,this.lo>>16,this.lo>>8&Us,this.lo&Us]},tr.prototype.lo32=function(){return this.lo|(this.mi&Us)<<24},tr.prototype.hi32=function(){return this.mi>>>8&xn|this.hi<<16};function Pz(x,r){return new tr(x&Lc,x>>>24&Us|(r&xn)<<8,r>>>16&xn)}function _N(x){return x.hi32()}function bN(x){return x.lo32()}function b6(){i1(UI)}var Iz=T8;function Ga(x,r,e,t){this.kind=x,this.layout=r,this.dims=e,this.data=t}Ga.prototype.caml_custom=Iz,Ga.prototype.offset=function(x){var r=0;if(typeof x=="number"&&(x=[x]),x instanceof Array||i1("bigarray.js: invalid offset"),this.dims.length!=x.length&&i1("Bigarray.get/set: bad number of dimensions"),this.layout==0)for(var e=0;e=this.dims[e])&&b6(),r=r*this.dims[e]+x[e];else for(var e=this.dims.length-1;e>=0;e--)(x[e]<1||x[e]>this.dims[e])&&b6(),r=r*this.dims[e]+(x[e]-1);return r},Ga.prototype.get=function(x){switch(this.kind){case 7:var r=this.data[x*2+0],e=this.data[x*2+1];return Pz(r,e);case 10:case 11:var t=this.data[x*2+0],u=this.data[x*2+1];return[g3,t,u];default:return this.data[x]}},Ga.prototype.set=function(x,r){switch(this.kind){case 7:this.data[x*2+0]=bN(r),this.data[x*2+1]=_N(r);break;case 10:case 11:this.data[x*2+0]=r[1],this.data[x*2+1]=r[2];break;default:this.data[x]=r;break}return 0},Ga.prototype.fill=function(x){switch(this.kind){case 7:var r=bN(x),e=_N(x);if(r==e)this.data.fill(r);else for(var t=0;tc)return 1;if(i!=c){if(!r)return NaN;if(i==i)return 1;if(c==c)return-1}}break;case 7:for(var u=0;ux.data[u+1])return 1;if(this.data[u]>>>0>>0)return-1;if(this.data[u]>>>0>x.data[u]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var u=0;ux.data[u])return 1}break}return 0};function q3(x,r,e,t){this.kind=x,this.layout=r,this.dims=e,this.data=t}q3.prototype=new Ga,q3.prototype.offset=function(x){return typeof x!="number"&&(x instanceof Array&&x.length==1?x=x[0]:i1("Ml_Bigarray_c_1_1.offset")),(x<0||x>=this.dims[0])&&b6(),x},q3.prototype.get=function(x){return this.data[x]},q3.prototype.set=function(x,r){return this.data[x]=r,0},q3.prototype.fill=function(x){return this.data.fill(x),0};function TN(x,r,e,t){var u=rM(x);return Wm(e)*u!=t.length&&i1("length doesn't match dims"),r==0&&e.length==1&&u==1?new q3(x,r,e,t):new Ga(x,r,e,t)}function iM(x){return x.slice(1)}function Nz(x,r,e){var t=iM(e),u=eM(x,Wm(t));return TN(x,r,t,u)}function T6(x,r,e){return x.set(x.offset(r),e),0}function E6(x,r,e){var t=String.fromCharCode;if(r==0&&e<=LF&&e==x.length)return t.apply(null,x);for(var u=H0;0=e.l||e.t==2&&u>=e.c.length))e.c=x.t==4?E6(x.c,r,u):r==0&&x.c.length==u?x.c:x.c.substr(r,u),e.t=e.c.length==e.l?0:2;else if(e.t==2&&t==e.c.length)e.c+=x.t==4?E6(x.c,r,u):r==0&&x.c.length==u?x.c:x.c.substr(r,u),e.t=e.c.length==e.l?0:2;else{e.t!=4&&Vm(e);var i=x.c,c=e.c;if(x.t==4)if(t<=r)for(var v=0;v=0;v--)c[t+v]=i[r+v];else{for(var a=Math.min(u,i.length-r),v=0;v>=1,x==0)return e;r+=r,t++,t==9&&r.slice(0,1)}}function $m(x){x.t==2?x.c+=B3(x.l-x.c.length,"\0"):x.c=E6(x.c,0,x.c.length),x.t=0}function EN(x){if(x.length<24){for(var r=0;rXr)return!1;return!0}else return!/[^\x00-\x7f]/.test(x)}function fM(x){for(var r=H0,e=H0,t,u,i,c,v=0,a=x.length;veI?(e.substr(0,1),r+=e,e=H0,r+=x.slice(v,l)):e+=x.slice(v,l),l==a)break;v=l}c=1,++v=55295&&c<57344)&&(c=2)):(c=3,++v1114111)&&(c=3)))))),c<4?(v-=c,e+="\uFFFD"):c>xn?e+=String.fromCharCode(55232+(c>>10),OF+(c&1023)):e+=String.fromCharCode(c),e.length>i6&&(e.substr(0,1),r+=e,e=H0)}return r+e}function xa(x,r,e){this.t=x,this.c=r,this.l=e}xa.prototype.toString=function(){switch(this.t){case 9:return this.c;default:$m(this);case 0:if(EN(this.c))return this.t=9,this.c;this.t=8;case 8:return this.c}},xa.prototype.toUtf16=function(){var x=this.toString();return this.t==9?x:fM(x)},xa.prototype.slice=function(){var x=this.t==4?this.c.slice():this.c;return new xa(this.t,x,this.l)};function cM(x){return new xa(0,x,x.length)}function kS0(x){return x}function Ct(x){return cM(x)}function ls(x,r,e,t,u){return Zs(Ct(x),r,e,t,u),0}function U3(x){return new tr(x[7]<<0|x[6]<<8|x[5]<<16,x[4]<<0|x[3]<<8|x[2]<<16,x[1]<<0|x[0]<<8)}function ae(x,r){switch(x.t&6){default:if(r>=x.c.length)return 0;case 0:return x.c.charCodeAt(r);case 4:return x.c[r]}}function SN(){i1(UI)}function Cz(x,r){r>>>0>=x.l-7&&SN();for(var e=new Array(8),t=0;t<8;t++)e[7-t]=ae(x,r+t);return U3(e)}function Yr(x,r,e){if(e&=Us,x.t!=4){if(r==x.c.length)return x.c+=String.fromCharCode(e),r+1==x.l&&(x.t=0),0;Vm(x)}return x.c[r]=e,0}function ra(x,r,e){return r>>>0>=x.l&&SN(),Yr(x,r,e)}function X3(x){return x.toArray()}function jz(x,r,e){r>>>0>=x.l-7&&SN();for(var t=X3(e),u=0;u<8;u++)Yr(x,r+7-u,t[u]);return 0}function ps(x,r){var e=x.l>=0?x.l:x.l=x.length,t=r.length,u=e-t;if(u==0)return x.apply(null,r);if(u<0){var i=x.apply(null,r.slice(0,e));return typeof i!="function"?i:ps(i,r.slice(e))}else{switch(u){case 1:{var i=function(a){for(var l=new Array(t+1),m=0;m>>0>=x.length-1&&b6(),x}function Oz(x){return isFinite(x)?Math.abs(x)>=22250738585072014e-324?0:x!=0?1:2:isNaN(x)?4:3}function Dz(x){return x==eE?1:0}var Fz=Math.log2&&Math.log2(11235582092889474e291)==1020;function Rz(x){if(Fz)return Math.floor(Math.log2(x));var r=0;if(x==0)return-1/0;if(x>=1)for(;x>=2;)x/=2,r++;else for(;x<1;)x*=2,r--;return r}function AN(x){var r=new Float32Array(1);r[0]=x;var e=new Int32Array(r.buffer);return e[0]|0}function ct(x,r,e){return new tr(x,r,e)}function Qm(x){if(!isFinite(x))return isNaN(x)?ct(1,0,VR):x>0?ct(0,0,VR):ct(0,0,65520);var r=x==0&&1/x==-1/0?fn:x>=0?0:fn;r&&(x=-x);var e=Rz(x)+1023;e<=0?(e=0,x/=Math.pow(2,-CL)):(x/=Math.pow(2,e-CR),x<16&&(x*=2,e-=1),e==0&&(x/=2));var t=Math.pow(2,24),u=x|0;x=(x-u)*t;var i=x|0;x=(x-i)*t;var c=x|0;return u=u&vw|r|e<<4,ct(c,i,u)}function sM(x,r,e){if(x.write(32,r.dims.length),x.write(32,r.kind|r.layout<<8),r.caml_custom==T8)for(var t=0;t>4;if(u==wL)return(r|e|t&vw)==0?t&fn?-1/0:1/0:NaN;var i=Math.pow(2,-24),c=(r*i+e)*i+(t&vw);return u>0?(c+=16,c*=Math.pow(2,u-CR)):c*=Math.pow(2,-CL),t&fn&&(c=-c),c}function H1(x){Q1.Failure||(Q1.Failure=[i2,Pd,-3]),wN(Q1.Failure,x)}function aM(x,r,e){var t=x.read32s();(t<0||t>16)&&H1("input_value: wrong number of bigarray dimensions");var u=x.read32s(),i=u&Us,c=u>>8&1,v=[];if(e==T8)for(var a=0;a>>17,r=vM(r,461845907),x^=r,x=x<<13|x>>>19,(x+(x<<2)|0)+-430675100|0}function Lz(x,r){return x=ea(x,bN(r)),x=ea(x,_N(r)),x}function lM(x,r){return Lz(x,Qm(r))}function pM(x){var r=Wm(x.dims),e=0;switch(x.kind){case 2:case 3:case 12:r>e6&&(r=e6);var t=0,u=0;for(u=0;u+4<=x.data.length;u+=4)t=x.data[u+0]|x.data[u+1]<<8|x.data[u+2]<<16|x.data[u+3]<<24,e=ea(e,t);switch(t=0,r&3){case 3:t=x.data[u+2]<<16;case 2:t|=x.data[u+1]<<8;case 1:t|=x.data[u+0],e=ea(e,t)}break;case 4:case 5:r>M2&&(r=M2);var t=0,u=0;for(u=0;u+2<=x.data.length;u+=2)t=x.data[u+0]|x.data[u+1]<<16,e=ea(e,t);(r&1)!=0&&(e=ea(e,x.data[u]));break;case 6:r>64&&(r=64);for(var u=0;u64&&(r=64);for(var u=0;u32&&(r=32),r*=2;for(var u=0;u64&&(r=64);for(var u=0;u32&&(r=32);for(var u=0;u0?u(r,x,t):u(x,r,t);if(t&&i!=i)return e;if(+i!=+i)return+i;if((i|0)!=0)return i|0}return e}function CN(x){return typeof x=="string"&&!/[^\x00-\xff]/.test(x)}function jN(x){return x instanceof xa}function hM(x){if(typeof x=="number")return zl;if(jN(x))return _3;if(CN(x))return 1252;if(x instanceof Array&&x[0]===x[0]>>>0&&x[0]<=xk){var r=x[0]|0;return r==g3?0:r}else{if(x instanceof String)return IF;if(typeof x=="string")return IF;if(x instanceof Number)return zl;if(x&&x.caml_custom)return X9;if(x&&x.compare)return 1256;if(typeof x=="function")return 1247;if(typeof x=="symbol")return 1251}return 1001}function Je(x,r){return xr?1:0}function zz(x,r){return x.t&6&&$m(x),r.t&6&&$m(r),x.cr.c?1:0}function Hm(x,r,e){for(var t=[];;){if(!(e&&x===r)){var u=hM(x);if(u==R3){x=x[1];continue}var i=hM(r);if(i==R3){r=r[1];continue}if(u!==i)return u==zl?i==X9?mM(x,r,-1,e):-1:i==zl?u==X9?mM(r,x,1,e):1:ur)return 1;if(x!=r){if(!e)return NaN;if(x==x)return 1;if(r==r)return-1}break;case 1001:if(xr)return 1;if(x!=r){if(!e)return NaN;if(x==x)return 1;if(r==r)return-1}break;case 1251:if(x!==r)return e?1:NaN;break;case 1252:var x=x,r=r;if(x!==r){if(xr)return 1}break;case 12520:var x=x.toString(),r=r.toString();if(x!==r){if(xr)return 1}break;case 246:case 254:default:if(Dz(u)){i1("compare: continuation value");break}if(x.length!=r.length)return x.length1&&t.push(x,r,1);break}}if(t.length==0)return 0;var a=t.pop();r=t.pop(),x=t.pop(),a+10)if(r==0&&(e>=x.l||x.t==2&&e>=x.c.length))t==0?(x.c=H0,x.t=2):(x.c=B3(e,String.fromCharCode(t)),x.t=e==x.l?0:2);else for(x.t!=4&&Vm(x),e+=r;r0&&r===r||(x=x.replace(/_/g,H0),r=+x,x.length>0&&r===r||/^[+-]?nan$/i.test(x)))return r;var e=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(x);if(e){var t=e[3].replace(/0+$/,H0),u=parseInt(e[1]+e[2]+t,16),i=(e[5]|0)-4*t.length;return r=u*Math.pow(2,i),r}if(/^\+?inf(inity)?$/i.test(x))return 1/0;if(/^-inf(inity)?$/i.test(x))return-1/0;H1("float_of_string")}function DN(x){x=x;var r=x.length;r>31&&i1("format_int: format too long");for(var e={justify:z7,signstyle:Be,filler:_u,alternate:!1,base:0,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:CF},t=0;t=0&&u<=9;)e.width=e.width*10+u,t++;t--;break;case".":for(e.prec=0,t++;u=x.charCodeAt(t)-48,u>=0&&u<=9;)e.prec=e.prec*10+u,t++;t--;case"d":case"i":e.signedconv=!0;case"u":e.base=10;break;case"x":e.base=16;break;case"X":e.base=16,e.uppercase=!0;break;case"o":e.base=8;break;case"e":case"f":case"g":e.signedconv=!0,e.conv=u;break;case"E":case"F":case"G":e.signedconv=!0,e.uppercase=!0,e.conv=u.toLowerCase();break}}return e}function FN(x,r){x.uppercase&&(r=r.toUpperCase());var e=r.length;x.signedconv&&(x.sign<0||x.signstyle!=Be)&&e++,x.alternate&&(x.base==8&&(e+=1),x.base==16&&(e+=2));var t=H0;if(x.justify==z7&&x.filler==_u)for(var u=e;u20?(T-=20,m/=Math.pow(10,T),m+=new Array(T+1).join(W1),h>0&&(m=m+on+new Array(h+1).join(W1)),m):m.toFixed(h)}var t,u=DN(x),i=u.prec<0?6:u.prec;if((r<0||r==0&&1/r==-1/0)&&(u.sign=-1,r=-r),isNaN(r))t=aI,u.filler=_u;else if(!isFinite(r))t="inf",u.filler=_u;else switch(u.conv){case"e":var t=r.toExponential(i),c=t.length;t.charAt(c-3)==Ew&&(t=t.slice(0,c-1)+W1+t.slice(c-1));break;case"f":t=e(r,i);break;case"g":i=i||1,t=r.toExponential(i-1);var v=t.indexOf(Ew),a=+t.slice(v+1);if(a<-4||r>=1e21||r.toFixed(0).length>i){for(var c=v-1;t.charAt(c)==W1;)c--;t.charAt(c)==on&&c--,t=t.slice(0,c+1)+t.slice(v),c=t.length,t.charAt(c-3)==Ew&&(t=t.slice(0,c-1)+W1+t.slice(c-1));break}else{var l=i;if(a<0)l-=a+1,t=r.toFixed(l);else for(;t=r.toFixed(l),t.length>i+1;)l--;if(l){for(var c=t.length-1;t.charAt(c)==W1;)c--;t.charAt(c)==on&&c--,t=t.slice(0,c+1)}}break}return FN(u,t)}function x5(x,r){if(x==D3)return H0+r;var e=DN(x);r<0&&(e.signedconv?(e.sign=-1,r=-r):r>>>=0);var t=r.toString(e.base);if(e.prec>=0){e.filler=_u;var u=e.prec-t.length;u>0&&(t=B3(u,W1)+t)}return FN(e,t)}var gM=0;function ks(){return gM++}function wM(){return[0]}var r5=[];function Xx(x,r,e){var t=x[1],u=r5[e];if(u===void 0)for(var i=r5.length;i>1|1,reI?(e.substr(0,1),r+=e,e=H0,r+=x.slice(i,v)):e+=x.slice(i,v),v==c)break;i=v}t>6),e+=String.fromCharCode(Nt|t&Ka)):t<55296||t>=iF?e+=String.fromCharCode(HF|t>>12,Nt|t>>6&Ka,Nt|t&Ka):t>=56319||i+1==c||(u=x.charCodeAt(i+1))iF?e+="\xEF\xBF\xBD":(i++,t=(t<<10)+u-56613888,e+=String.fromCharCode(UD|t>>18,Nt|t>>12&Ka,Nt|t>>6&Ka,Nt|t&Ka)),e.length>i6&&(e.substr(0,1),r+=e,e=H0)}return r+e}function jt(x){return EN(x)?x:Vz(x)}function $z(x,r,e){if(!isFinite(x))return isNaN(x)?jt(aI):jt(x>0?uL:"-infinity");var t=x==0&&1/x==-1/0?1:x>=0?0:1;t&&(x=-x);var u=0;if(x!=0)if(x<1)for(;x<1&&u>-1022;)x*=2,u--;else for(;x>=2;)x/=2,u++;var i=u<0?H0:z7,c=H0;if(t)c=Be;else switch(e){case 43:c=z7;break;case 32:c=_u;break;default:break}if(r>=0&&r<13){var v=Math.pow(2,r*4);x=Math.round(x*v)/v}var a=x.toString(16);if(r>=0){var l=a.indexOf(on);if(l<0)a+=on+B3(r,W1);else{var m=l+1+r;a.length>24&Lc,x>>31&xn)}function Hz(x){return x.toInt()}function Zz(x){return+x.isNeg()}function LN(x){return x.neg()}function _M(x,r){var e=DN(x);e.signedconv&&Zz(r)&&(e.sign=-1,r=LN(r));var t=H0,u=S6(e.base),i="0123456789abcdef";do{var c=r.udivmod(u);r=c.quotient,t=i.charAt(Hz(c.modulus))+t}while(!Qz(r));if(e.prec>=0){e.filler=_u;var v=e.prec-t.length;v>0&&(t=B3(v,W1)+t)}return FN(e,t)}function Cx(x){return x.length}function Y0(x,r){return x.charCodeAt(r)}function bM(x,r){return x.add(r)}function TM(x,r){return x.mul(r)}function MN(x,r){return x.ucompare(r)<0}function EM(x){var r=0,e=Cx(x),t=10,u=1;if(e>0)switch(Y0(x,r)){case 45:r++,u=-1;break;case 43:r++,u=1;break}if(r+1=48&&x<=57?x-48:x>=65&&x<=90?x-55:x>=97&&x<=c2?x-87:-1}function pv(x){var r=EM(x),e=r[0],t=r[1],u=r[2],i=S6(u),c=new tr(Lc,268435455,xn).udivmod(i).quotient,v=Y0(x,e),a=e5(v);(a<0||a>=u)&&H1(Bs);for(var l=S6(a);;)if(e++,v=Y0(x,e),v!=95){if(a=e5(v),a<0||a>=u)break;MN(c,l)&&H1(Bs),a=S6(a),l=bM(TM(i,l),a),MN(l,a)&&H1(Bs)}return e!=Cx(x)&&H1(Bs),u==10&&MN(new tr(0,0,fn),l)&&H1(Bs),t<0&&(l=LN(l)),l}function SM(x,r){return x.or(r)}function t5(x){return x.toFloat()}function st(x){var r=EM(x),e=r[0],t=r[1],u=r[2],i=Cx(x),c=-1>>>0,v=e=u)&&H1(Bs);var l=a;for(e++;e=u)break;l=u*l+a,l>c&&H1(Bs)}return e!=i&&H1(Bs),l=t*l,u==10&&(l|0)!=l&&H1(Bs),l|0}function Gx(x){return EN(x)?x:fM(x)}function xK(x){for(var r={},e=1;e=0?x.l:x.l=x.length}function eK(x){return function(){for(var r=rK(x),e=new Array(r),t=0;t>>0&&qN(x,I3,Go)?0:1}function uK(x){return qN(x,Go,R3),0}function iK(x,r){return+(Hm(x,r,!1)<0)}function AM(x){return x}function fK(x,r){return x.get(x.offset(r))}function cK(x,r){return x.xor(r)}function sK(x,r){return x.shift_right_unsigned(r)}function aK(x,r){return x.shift_left(r)}function u5(x){function r(q,K){return aK(q,K)}function e(q,K){return sK(q,K)}function t(q,K){return SM(q,K)}function u(q,K){return cK(q,K)}function i(q,K){return bM(q,K)}function c(q,K){return TM(q,K)}function v(q,K){return t(r(q,K),e(q,64-K))}function a(q,K){return fK(q,K)}function l(q,K,u0){return T6(q,K,u0)}var m=pv(AM("0xd1342543de82ef95")),h=pv(AM("0xdaba0b6eb09322e3")),T,M,Y,b=x,N=a(b,0),C=a(b,1),I=a(b,2),F=a(b,3);T=i(C,I),T=c(u(T,e(T,32)),h),T=c(u(T,e(T,32)),h),T=u(T,e(T,32)),l(b,1,i(c(C,m),N));var M=I,Y=F;return Y=u(Y,M),M=v(M,24),M=u(u(M,Y),r(Y,16)),Y=v(Y,37),l(b,2,M),l(b,3,Y),T}function Wa(e,r){e<0&&b6();var e=e+1|0,t=new Array(e);t[0]=0;for(var u=1;u>>32-m,a)}function e(c,v,a,l,m,h,T){return r(v&a|~v&l,c,v,m,h,T)}function t(c,v,a,l,m,h,T){return r(v&l|a&~l,c,v,m,h,T)}function u(c,v,a,l,m,h,T){return r(v^a^l,c,v,m,h,T)}function i(c,v,a,l,m,h,T){return r(a^(v|~l),c,v,m,h,T)}return function(c,v){var a=c[0],l=c[1],m=c[2],h=c[3];a=e(a,l,m,h,v[0],7,3614090360),h=e(h,a,l,m,v[1],12,3905402710),m=e(m,h,a,l,v[2],17,606105819),l=e(l,m,h,a,v[3],22,3250441966),a=e(a,l,m,h,v[4],7,4118548399),h=e(h,a,l,m,v[5],12,1200080426),m=e(m,h,a,l,v[6],17,2821735955),l=e(l,m,h,a,v[7],22,4249261313),a=e(a,l,m,h,v[8],7,1770035416),h=e(h,a,l,m,v[9],12,2336552879),m=e(m,h,a,l,v[10],17,4294925233),l=e(l,m,h,a,v[11],22,2304563134),a=e(a,l,m,h,v[12],7,1804603682),h=e(h,a,l,m,v[13],12,4254626195),m=e(m,h,a,l,v[14],17,2792965006),l=e(l,m,h,a,v[15],22,1236535329),a=t(a,l,m,h,v[1],5,4129170786),h=t(h,a,l,m,v[6],9,3225465664),m=t(m,h,a,l,v[11],14,643717713),l=t(l,m,h,a,v[0],20,3921069994),a=t(a,l,m,h,v[5],5,3593408605),h=t(h,a,l,m,v[10],9,38016083),m=t(m,h,a,l,v[15],14,3634488961),l=t(l,m,h,a,v[4],20,3889429448),a=t(a,l,m,h,v[9],5,568446438),h=t(h,a,l,m,v[14],9,3275163606),m=t(m,h,a,l,v[3],14,4107603335),l=t(l,m,h,a,v[8],20,1163531501),a=t(a,l,m,h,v[13],5,2850285829),h=t(h,a,l,m,v[2],9,4243563512),m=t(m,h,a,l,v[7],14,1735328473),l=t(l,m,h,a,v[12],20,2368359562),a=u(a,l,m,h,v[5],4,4294588738),h=u(h,a,l,m,v[8],11,2272392833),m=u(m,h,a,l,v[11],16,1839030562),l=u(l,m,h,a,v[14],23,4259657740),a=u(a,l,m,h,v[1],4,2763975236),h=u(h,a,l,m,v[4],11,1272893353),m=u(m,h,a,l,v[7],16,4139469664),l=u(l,m,h,a,v[10],23,3200236656),a=u(a,l,m,h,v[13],4,681279174),h=u(h,a,l,m,v[0],11,3936430074),m=u(m,h,a,l,v[3],16,3572445317),l=u(l,m,h,a,v[6],23,76029189),a=u(a,l,m,h,v[9],4,3654602809),h=u(h,a,l,m,v[12],11,3873151461),m=u(m,h,a,l,v[15],16,530742520),l=u(l,m,h,a,v[2],23,3299628645),a=i(a,l,m,h,v[0],6,4096336452),h=i(h,a,l,m,v[7],10,1126891415),m=i(m,h,a,l,v[14],15,2878612391),l=i(l,m,h,a,v[5],21,4237533241),a=i(a,l,m,h,v[12],6,1700485571),h=i(h,a,l,m,v[3],10,2399980690),m=i(m,h,a,l,v[10],15,4293915773),l=i(l,m,h,a,v[1],21,2240044497),a=i(a,l,m,h,v[8],6,1873313359),h=i(h,a,l,m,v[15],10,4264355552),m=i(m,h,a,l,v[6],15,2734768916),l=i(l,m,h,a,v[13],21,1309151649),a=i(a,l,m,h,v[4],6,4149444226),h=i(h,a,l,m,v[11],10,3174756917),m=i(m,h,a,l,v[2],15,718787259),l=i(l,m,h,a,v[9],21,3951481745),c[0]=x(a,c[0]),c[1]=x(l,c[1]),c[2]=x(m,c[2]),c[3]=x(h,c[3])}}();function vK(x,r,e){var t=x.len&Ka,u=0;if(x.len+=e,t){var i=64-t;if(e=64;)x.b8.set(r.subarray(u,u+64),0),i5(x.w,x.b32),e-=64,u+=64;e&&x.b8.set(r.subarray(u,u+e),0)}function lK(x){var r=x.len&Ka;if(x.b8[r]=Nt,r++,r>56){for(var e=r;e<64;e++)x.b8[e]=0;i5(x.w,x.b32);for(var e=0;e<56;e++)x.b8[e]=0}else for(var e=r;e<56;e++)x.b8[e]=0;x.b32[14]=x.len<<3,x.b32[15]=x.len>>29&536870911,i5(x.w,x.b32);for(var t=new Uint8Array(16),u=0;u<4;u++)for(var e=0;e<4;e++)t[u*4+e]=x.w[u]>>8*e&255;return t}function BN(x){return x.t!=4&&Vm(x),x.c}function pK(x){return E6(x,0,x.length)}function kK(x,r,e){var t=oK(),u=BN(x);return vK(t,u.subarray(r,r+e),e),pK(lK(t))}function mK(x,r,e){return kK(Ct(x),r,e)}function Ot(x){return x.l}function hK(){return 0}function jr(x){wN(Q1.Sys_error,x)}var ta=new Array;function ln(x){var r=ta[x];return r.opened||jr("Cannot flush a closed channel"),!r.buffer||r.buffer_curr==0||(r.output?r.output(E6(r.buffer,0,r.buffer_curr)):r.file.write(r.offset,r.buffer,0,r.buffer_curr),r.offset+=r.buffer_curr,r.buffer_curr=0),0}function PM(){}function mS0(x){for(var r=Cx(x),e=new Uint8Array(r),t=0;t1&&t.pop();break;case".":break;case"":break;default:t.push(e[u]);break}return t.unshift(r[0]),t.orig=x,t}var wK=["E2BIG","EACCES","EAGAIN",YI,"EBUSY","ECHILD","EDEADLK","EDOM",FO,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",Aw,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",Hg,oD,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function na(x,r,e,t){var u=wK.indexOf(x);u<0&&(t==null&&(t=-9999),u=[0,t]);var i=[u,jt(r||H0),jt(e||H0)];return i}var NM={};function Va(x){return NM[x]}function ua(x,r){throw K0([0,x].concat(r))}function XN(x){return x instanceof Uint8Array||(x=new Uint8Array(x)),new xa(4,x,x.length)}function CM(x){jr(x+rp)}function oe(x){this.data=x}oe.prototype=new PM,oe.prototype.constructor=oe,oe.prototype.truncate=function(x){var r=this.data;this.data=E2(x|0),Zs(r,0,this.data,0,x)},oe.prototype.length=function(){return Ot(this.data)},oe.prototype.write=function(x,r,e,t){var u=this.length();if(x+t>=u){var i=E2(x+t),c=this.data;this.data=i,Zs(c,0,this.data,0,u)}return Zs(XN(r),e,this.data,x,t),0},oe.prototype.read=function(x,r,e,t){var u=this.length();if(x+t>=u&&(t=u-x),t){var i=E2(t|0);Zs(this.data,x,i,0,t),r.set(BN(i),e)}return t};function kv(x,r,e){this.file=r,this.name=x,this.flags=e}kv.prototype.err_closed=function(){jr(this.name+PF)},kv.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()},kv.prototype.write=function(x,r,e,t){if(this.file)return this.file.write(x,r,e,t);this.err_closed()},kv.prototype.read=function(x,r,e,t){if(this.file)return this.file.read(x,r,e,t);this.err_closed()},kv.prototype.close=function(){this.file=void 0};function _1(x,r){this.content={},this.root=x,this.lookupFun=r}_1.prototype.nm=function(x){return this.root+x},_1.prototype.create_dir_if_needed=function(x){for(var r=x.split(fe),e=H0,t=0;t0&&e>=0&&e+t<=r.length&&r[e+t-1]==10&&t--;var u=E2(t);return Zs(XN(r),e,u,0,t),this.log(u.toUtf16()),0}jr(this.fd+PF)},I6.prototype.read=function(x,r,e,t){jr(this.fd+": file descriptor is write only")},I6.prototype.close=function(){this.log=void 0};function s5(x,r){return r==null&&(r=f5.length),f5[r]=x,r|0}function hS0(x,r,e){for(var t={};r;){switch(r[1]){case 0:t.rdonly=1;break;case 1:t.wronly=1;break;case 2:t.append=1;break;case 3:t.create=1;break;case 4:t.truncate=1;break;case 5:t.excl=1;break;case 6:t.binary=1;break;case 7:t.text=1;break;case 8:t.nonblock=1;break}r=r[2]}t.rdonly&&t.wronly&&jr(x+jy),t.text&&t.binary&&jr(x+G_);var u=_K(x),i=u.device.open(u.rest,t);return s5(i,void 0)}(function(){function x(r,e){return A6()?dK(r,e):new I6(r,e)}s5(x(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:!0}),0),s5(x(1,{buffered:2,wronly:1,isCharacterDevice:!0}),1),s5(x(2,{buffered:2,wronly:1,isCharacterDevice:!0}),2)})();function bK(x){var r=f5[x];r.flags.wronly&&jr(BD+x+" is writeonly");var e=null,t={file:r,offset:r.flags.append?r.length():0,fd:x,opened:!0,out:!1,buffer_curr:0,buffer_max:0,buffer:new Uint8Array(v6),refill:e};return ta[t.fd]=t,t.fd}function OM(x){var r=f5[x];r.flags.rdonly&&jr(BD+x+" is readonly");var e=r.flags.buffered!==void 0?r.flags.buffered:1,t={file:r,offset:r.flags.append?r.length():0,fd:x,opened:!0,out:!0,buffer_curr:0,buffer:new Uint8Array(v6),buffered:e};return ta[t.fd]=t,t.fd}function TK(){for(var x=0,r=0;ru.buffer.length){var i=new Uint8Array(u.buffer_curr+r.length);i.set(u.buffer),u.buffer=i}switch(u.buffered){case 0:u.buffer.set(r,u.buffer_curr),u.buffer_curr+=r.length,ln(x);break;case 1:u.buffer.set(r,u.buffer_curr),u.buffer_curr+=r.length,u.buffer_curr>=u.buffer.length&&ln(x);break;case 2:var c=r.lastIndexOf(10);c<0?(u.buffer.set(r,u.buffer_curr),u.buffer_curr+=r.length,u.buffer_curr>=u.buffer.length&&ln(x)):(u.buffer.set(r.subarray(0,c+1),u.buffer_curr),u.buffer_curr+=c+1,ln(x),u.buffer.set(r.subarray(c+1),u.buffer_curr),u.buffer_curr+=r.length-c-1);break}return 0}function SK(x,u,e,t){var u=BN(u);return EK(x,u,e,t)}function YN(x,r,e,t){return SK(x,Ct(r),e,t)}function DM(x,r){var e=String.fromCharCode(r);return YN(x,e,0,1),0}function mv(x,r){return+(Hm(x,r,!1)!=0)}function zN(x,r){var e=new Array(r+1);e[0]=x;for(var t=1;t<=r;t++)e[t]=0;return e}function hv(x){return x instanceof Array&&x[0]==x[0]>>>0?x[0]:jN(x)||CN(x)?_3:x instanceof Function||typeof x=="function"?ip:x&&x.caml_custom?xk:zl}function AK(x){var r={};if(x)for(var e=1;e=0?x=u:H1("caml_register_global: cannot locate "+t)}}Q1[x+1]=r,e&&(Q1[e]=r)}function KN(x,r){return NM[x]=r,0}function PK(x){return x[2]=gM++,x}function _r(x,r){return x===r?1:0}function IK(){i1(UI)}function q2(x,r){return r>>>0>=Cx(x)&&IK(),Y0(x,r)}function P(x,r){return 1-_r(x,r)}function b1(x){return x.t&6&&$m(x),x.c}function NK(){return 2147483647/4|0}var CK=o0.process&&o0.process.platform&&o0.process.platform==wO?ZD:"Unix";function jK(){return[0,CK,32,0]}function OK(){nM(Q1.Not_found)}function FM(x){var r=xM(Gx(x));return r===void 0&&OK(),jt(r)}function DK(){if(o0.crypto){if(o0.crypto.getRandomValues){var x=o0.crypto.getRandomValues(new Int32Array(4));return[0,x[0],x[1],x[2],x[3]]}else if(o0.crypto.randomBytes){var x=new Int32Array(o0.crypto.randomBytes(16).buffer);return[0,x[0],x[1],x[2],x[3]]}}var r=new Date().getTime(),e=r^4294967295*Math.random();return[0,e]}function a5(x){for(var r=1;x&&x.joo_tramp;)x=x.joo_tramp.apply(null,x.joo_args),r++;return x}function J2(x,r){return{joo_tramp:x,joo_args:r}}function Rr(x,r){if(r.fun)return x.fun=r.fun,0;if(typeof r=="function")return x.fun=r,0;for(var e=r.length;e--;)x[e]=r[e];return 0}function B2(x){{if(x instanceof Array)return x;var r;return o0.RangeError&&x instanceof o0.RangeError&&x.message&&x.message.match(/maximum call stack/i)||o0.InternalError&&x instanceof o0.InternalError&&x.message&&x.message.match(/too much recursion/i)?r=Q1.Stack_overflow:x instanceof o0.Error&&Va(FS)?r=[0,Va(FS),x]:r=[0,Q1.Failure,jt(String(x))],x instanceof o0.Error&&(r.js_error=x),r}}function FK(x){switch(x[2]){case-8:case-11:case-12:return 1;default:return 0}}function RK(x){var r=H0;if(x[0]==0){if(r+=x[1][1],x.length==3&&x[2][0]==0&&FK(x[1]))var t=x[2],e=1;else var e=2,t=x;r+=OR;for(var u=e;ue&&(r+=hF);var i=t[u];typeof i=="number"?r+=i.toString():i instanceof xa||typeof i=="string"?r+=Kk+i.toString()+Kk:r+=Xo}r+=cR}else x[0]==i2&&(r+=x[1]);return r}function RM(x){if(x instanceof Array&&(x[0]==0||x[0]==i2)){var r=Va(qO);if(r)n5(r,[x,!1]);else{var e=RK(x),t=Va(RD);if(t&&n5(t,[0]),console.error(VE+e),x.js_error)throw x.js_error}}else throw x}function LK(){var x=o0.process;x&&x.on?x.on("uncaughtException",function(r,e){RM(r),x.exit(2)}):o0.addEventListener&&o0.addEventListener("error",function(r){r.error&&RM(r.error)})}LK();function d(x,r){return(x.l>=0?x.l:x.l=x.length)==1?x(r):ps(x,[r])}function p(x,r,e){return(x.l>=0?x.l:x.l=x.length)==2?x(r,e):ps(x,[r,e])}function Q0(x,r,e,t){return(x.l>=0?x.l:x.l=x.length)==3?x(r,e,t):ps(x,[r,e,t])}function JN(x,r,e,t,u){return(x.l>=0?x.l:x.l=x.length)==4?x(r,e,t,u):ps(x,[r,e,t,u])}function GN(x,r,e,t,u,i){return(x.l>=0?x.l:x.l=x.length)==5?x(r,e,t,u,i):ps(x,[r,e,t,u,i])}function N6(x,r,e,t,u,i,c){return(x.l>=0?x.l:x.l=x.length)==6?x(r,e,t,u,i,c):ps(x,[r,e,t,u,i,c])}function MK(x,r,e,t,u,i,c,v){return(x.l>=0?x.l:x.l=x.length)==7?x(r,e,t,u,i,c,v):ps(x,[r,e,t,u,i,c,v])}var O=void 0,WN=[i2,yO,-1],LM=[i2,sL,-2],kn=[i2,Pd,-3],o5=[i2,AL,-4],ms=[i2,oF,-7],MM=[i2,PO,-8],qM=[i2,qR,-9],Ir=[i2,bR,-11],C6=[i2,xR,-12],qK=[4,0,0,0,[12,45,[4,0,0,0,0]]],VN=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,EO,[4,0,0,0,[12,45,[4,0,0,0,[11,": ",[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],K3=[0,0,[0,0,0],[0,0,0]],J3=[0,0,0,0,0,1,0,0,0],BM=[0,"first_leading","last_trailing"],UM=[0,lf,rn,Qf,zi,_c,vi,gu,mu,r7,$c,ti,N7,R7,an,Pc,H7,ze,vs,ci,Di,s7,ei,n7,kf,du,Ou,bf,Mu,fi,pi,Ku,O7,Rf,Wf,k7,wi,of,U7,Ji,W7,Ff,Ai,fc,Un,ts,oc,Lf,cu,B7,Uc,jc,zu,Gi,Yi,Le,Xe,Xc,Uf,tu,Oi,ou,Zi,ai,Ac,si,lc,ec,Dn,Ru,Ki,Ee,P7,Tu,ku,ac,uc,Af,Cc,A7,fs,mc,Sc,Cf,vc,ji,qn,b7,as,nf,wc,Rn,n1,a7,Bc,kc,S7,ni,Tf,y7,c7,sf,ns,Ri,ui,di,Vc,Gn,ff,yu,ss,zf,cf,xu,Ju,nc,xc,_7,Bi,ii,Su,ri,e7,$7,us,bc,yi,St,Kc,D7,bi,K1,Mn,Mi,Gc,gf,bu,Gf,Yc,Hf,ce,Hi,V7,Yu,Du,Bn,yc,_i,Ei,$u,rs,T7,If,J7,I7,t7,jf,Nu,tc,M7,dc,sc,Zc,Of,af,G7,fu,xf,Zu,Tc,Yn,d7,ie,xi,Wc,ru,wu,pu,ic,Qc,w7,au,Q7,hf,ef,Kf,Fi,X7,tf,xs,wf,Xn,lu,li,Pu,ju,Nc,Nf,es,Ii,Rc,mi,x7,Hu,Bu,Lu,gi,Gu,Fu,Oc,Ln,Vi,Iu,rf,qf,Ni,Qn,Kn,pc,Df,f7,Hn,zn,is,qu,Xf,$n,qc,Te,hu,ki,Dc,oi,L7,Au,yf,Fn,v7,Ui,gc,eu,Mf,E7,$i,Xi,iu,j7,Xu,hi,Ef,Me,zc,m7,pf,i7,df,h7,Qu,Ue,g7,uu,Vu,Jc,o7,Z7,Cu,Ic,Ke,Mc,Jf,Pi,Fc,u7,Li,Zn,Ye,K7,hc,Ec,cs,vf,uf,$f,os,Vf,Jn,nu,vu,Bf,Wn,F7,Wi,Wu,q7,Pf,Uu,p7,C7,su,Ti,Eu,Ci,_f,cc,Zf,l7,Sf,V1,Y7,qi,Qi,z1],mn=[0,0,0];Dt(11,C6,xR),Dt(10,Ir,bR),Dt(9,[i2,lR,BR],lR),Dt(8,qM,qR),Dt(7,MM,PO),Dt(6,ms,oF),Dt(5,[i2,zD,-6],zD),Dt(4,[i2,$R,-5],$R),Dt(3,o5,AL),Dt(2,kn,Pd),Dt(1,LM,sL),Dt(0,WN,yO);function U2(x){if(typeof x=="number")return 0;switch(x[0]){case 0:return[0,U2(x[1])];case 1:return[1,U2(x[1])];case 2:return[2,U2(x[1])];case 3:return[3,U2(x[1])];case 4:return[4,U2(x[1])];case 5:return[5,U2(x[1])];case 6:return[6,U2(x[1])];case 7:return[7,U2(x[1])];case 8:var r=x[1];return[8,r,U2(x[2])];case 9:var e=x[1];return[9,e,e,U2(x[3])];case 10:return[10,U2(x[1])];case 11:return[11,U2(x[1])];case 12:return[12,U2(x[1])];case 13:return[13,U2(x[1])];default:return[14,U2(x[1])]}}function ve(x,r){if(typeof x=="number")return r;switch(x[0]){case 0:return[0,ve(x[1],r)];case 1:return[1,ve(x[1],r)];case 2:return[2,ve(x[1],r)];case 3:return[3,ve(x[1],r)];case 4:return[4,ve(x[1],r)];case 5:return[5,ve(x[1],r)];case 6:return[6,ve(x[1],r)];case 7:return[7,ve(x[1],r)];case 8:var e=x[1];return[8,e,ve(x[2],r)];case 9:var t=x[2],u=x[1];return[9,u,t,ve(x[3],r)];case 10:return[10,ve(x[1],r)];case 11:return[11,ve(x[1],r)];case 12:return[12,ve(x[1],r)];case 13:return[13,ve(x[1],r)];default:return[14,ve(x[1],r)]}}function I2(x,r){if(typeof x=="number")return r;switch(x[0]){case 0:return[0,I2(x[1],r)];case 1:return[1,I2(x[1],r)];case 2:var e=x[1];return[2,e,I2(x[2],r)];case 3:var t=x[1];return[3,t,I2(x[2],r)];case 4:var u=x[3],i=x[2],c=x[1];return[4,c,i,u,I2(x[4],r)];case 5:var v=x[3],a=x[2],l=x[1];return[5,l,a,v,I2(x[4],r)];case 6:var m=x[3],h=x[2],T=x[1];return[6,T,h,m,I2(x[4],r)];case 7:var b=x[3],N=x[2],C=x[1];return[7,C,N,b,I2(x[4],r)];case 8:var I=x[3],F=x[2],M=x[1];return[8,M,F,I,I2(x[4],r)];case 9:var Y=x[1];return[9,Y,I2(x[2],r)];case 10:return[10,I2(x[1],r)];case 11:var q=x[1];return[11,q,I2(x[2],r)];case 12:var K=x[1];return[12,K,I2(x[2],r)];case 13:var u0=x[2],Q=x[1];return[13,Q,u0,I2(x[3],r)];case 14:var e0=x[2],f0=x[1];return[14,f0,e0,I2(x[3],r)];case 15:return[15,I2(x[1],r)];case 16:return[16,I2(x[1],r)];case 17:var a0=x[1];return[17,a0,I2(x[2],r)];case 18:var Z=x[1];return[18,Z,I2(x[2],r)];case 19:return[19,I2(x[1],r)];case 20:var v0=x[2],t0=x[1];return[20,t0,v0,I2(x[3],r)];case 21:var y0=x[1];return[21,y0,I2(x[2],r)];case 22:return[22,I2(x[1],r)];case 23:var n0=x[1];return[23,n0,I2(x[2],r)];default:var s0=x[2],l0=x[1];return[24,l0,s0,I2(x[3],r)]}}function bx(x){throw K0([0,kn,x],1)}function R1(x){throw K0([0,o5,x],1)}function v5(x){return 0<=x?x:-x|0}var BK=$s,UK=Xs;function Mx(x,r){var e=Cx(x),t=Cx(r),u=E2(e+t|0);return ls(x,0,u,0,e),ls(r,0,u,e,t),b1(u)}function Lx(x,r){if(!x)return r;var e=x[2],t=x[1];if(!e)return[0,t,r];var u=e[2],i=e[1];if(!u)return[0,t,[0,i,r]];for(var c=[0,u[1],La],v=c,a=1,l=u[2];;){if(l){var m=l[2],h=l[1];if(m){var T=m[2],b=m[1];if(T){var N=[0,T[1],La],C=T[2];v[1+a]=[0,h,[0,b,N]];var v=N,a=1,l=C;continue}v[1+a]=[0,h,[0,b,r]]}else v[1+a]=[0,h,r]}else v[1+a]=r;return[0,t,[0,i,c]]}}bK(0);var XM=OM(1),hn=OM(2),XK="output_substring";function j6(x,r){YN(x,r,0,Cx(r))}function YM(x,r,e,t){return 0<=e&&0<=t&&(Cx(r)-t|0)>=e?YN(x,r,e,t):R1(XK)}function zM(x){return j6(hn,x),DM(hn,10),ln(hn)}var $N=[0,function(x){for(var r=TK(0);;){if(!r)return 0;var e=r[2],t=r[1];try{ln(t)}catch(c){var u=B2(c);if(u[1]!==LM)throw K0(u,0)}var r=e}}],KM=[0,function(x){}];function QN(x){return d(KM[1],0),d(M3($N),0)}KN(RD,QN);var JM=jK(0)[1],O6=(4*NK(0)|0)-1|0;function l5(x,r){return r?[0,d(x,r[1])]:0}function GM(x){return x?1:0}function WM(x){return 25>>0?x:x-32|0}var YK="hd",zK="tl",KK="List.iter2";function ia(x){for(var r=0,e=x;;){if(!e)return r;var r=r+1|0,e=e[2]}}function D6(x){return x?x[1]:bx(YK)}function VM(x){return x?x[2]:bx(zK)}function G3(x,r){for(var e=x,t=r;;){if(!e)return t;var u=[0,e[1],t],e=e[2],t=u}}function tx(x){return G3(x,0)}function F6(x){if(!x)return 0;var r=x[1];return Lx(r,F6(x[2]))}function dn(x,r){if(!r)return 0;var e=r[2],t=r[1];if(!e)return[0,x(t),0];for(var u=e[2],i=e[1],c=x(t),v=[0,x(i),La],a=v,l=1,m=u;;){if(m){var h=m[2],T=m[1];if(h){var b=h[2],N=h[1],C=x(T),I=[0,x(N),La];a[1+l]=[0,C,I];var a=I,l=1,m=b;continue}a[1+l]=[0,x(T),0]}else a[1+l]=0;return[0,c,v]}}function p5(x,r){for(var e=0,t=r;;){if(!t)return e;var u=t[2],e=[0,x(t[1]),e],t=u}}function T1(x,r){for(var e=r;;){if(!e)return 0;var t=e[2];d(x,e[1]);var e=t}}function m1(x,r,e){for(var t=r,u=e;;){if(!u)return t;var i=u[2],t=p(x,t,u[1]),u=i}}function HN(x,r,e){if(!r)return e;var t=r[1];return x(t,HN(x,r[2],e))}function $M(x,r,e){for(var t=r,u=e;;){if(t){if(u){var i=u[2],c=t[2];x(t[1],u[1]);var t=c,u=i;continue}}else if(!u)return;return R1(KK)}}function W3(x,r){for(var e=r;;){if(!e)return 0;var t=e[2],u=d(x,e[1]);if(u)return u;var e=t}}function ZN(x,r){for(var e=r;;){if(!e)return 0;var t=e[2],u=dM(e[1],x)===0?1:0;if(u)return u;var e=t}}function R6(x,r){for(var e=r;;){if(!e)return 0;var t=e[2],u=e[1];if(x(u))for(var i=[0,u,La],c=i,v=1,a=t;;){if(!a)return c[1+v]=0,i;var l=a[2],m=a[1];if(x(m)){var h=[0,m,La];c[1+v]=h;var c=h,v=1,a=l}else var a=l}else var e=t}}var JK="String.sub / Bytes.sub",GK="Bytes.blit",WK="String.blit / Bytes.blit_string";function dv(x,r){var e=E2(x);return Wz(e,0,x,r),e}function QM(x,r,e){if(0<=r&&0<=e&&(Ot(x)-e|0)>=r){var t=E2(e);return Zs(x,r,t,0,e),t}return R1(JK)}function V3(x,r,e){return b1(QM(x,r,e))}function HM(x,r,e,t,u){if(0<=u&&0<=r&&(Ot(x)-u|0)>=r&&0<=t&&(Ot(e)-u|0)>=t){Zs(x,r,e,t,u);return}return R1(GK)}function yn(x,r,e,t,u){if(0<=u&&0<=r&&(Cx(x)-u|0)>=r&&0<=t&&(Ot(e)-u|0)>=t){ls(x,r,e,t,u);return}return R1(WK)}var VK="String.concat",$K=H0;function k5(x,r){return b1(dv(x,r))}function E1(x,r,e){return b1(QM(Ct(x),r,e))}function ZM(x,r){if(!r)return $K;var e=Cx(x);x:{r:{for(var t=0,u=r,i=0;u;){var c=u[1];if(!u[2])break r;var v=(Cx(c)+e|0)+t|0,a=u[2],l=t<=v?v:R1(VK),t=l,u=a}var m=t;break x}var m=Cx(c)+t|0}for(var h=E2(m),T=i,b=r;;){if(b){var N=b[1];if(b[2]){var C=b[2];ls(N,0,h,T,Cx(N)),ls(x,0,h,T+Cx(N)|0,e);var T=(T+Cx(N)|0)+e|0,b=C;continue}ls(N,0,h,T,Cx(N))}return b1(h)}}function xq(x){var r=Ct(x);if(Ot(r)===0)var e=r;else{var t=Ot(r),u=E2(t);Zs(r,0,u,0,t),Yr(u,0,WM(ae(r,0)));var e=u}return b1(e)}function rq(x,r){var e=Cx(x),t=e<=Cx(r)?1:0;if(!t)return t;for(var u=0;;){if(u===e)return 1;if(Y0(r,u)!==Y0(x,u))return 0;var u=u+1|0}}function eq(x,r){var e=[0,0],t=[0,Cx(r)],u=Cx(r)-1|0;if(u>=0)for(var i=u;;){if(Y0(r,i)===x){var c=e[1];e[1]=[0,E1(r,i+1|0,(t[1]-i|0)-1|0),c],t[1]=i}var v=i-1|0;if(i===0)break;var i=v}var a=e[1];return[0,E1(r,0,t[1]),a]}function m5(x,r){return Cz(Ct(x),r)}var QK="Array.blit";function tq(x,r,e,t,u){if(0<=u&&0<=r&&(x.length-1-u|0)>=r&&0<=t&&(e.length-1-u|0)>=t){_z(x,r,e,t,u);return}return R1(QK)}function nq(x,r){var e=r.length-1-1|0,t=0;if(e>=0)for(var u=t;;){x(r[1+u]);var i=u+1|0;if(e===u)break;var u=i}}function h5(x,r){var e=r.length-1;if(e===0)return[0];var t=Wa(e,x(r[1])),u=e-1|0,i=1;if(u>=1)for(var c=i;;){t[1+c]=x(r[1+c]);var v=c+1|0;if(u===c)break;var c=v}return t}function L6(x){if(!x)return[0];for(var r=0,e=x,t=x[2],u=x[1];e;)var r=r+1|0,e=e[2];for(var i=Wa(r,u),c=1,v=t;;){if(!v)return i;var a=v[2];i[1+c]=v[1];var c=c+1|0,v=a}}function uq(x){try{var r=[0,pv(x)];return r}catch(t){var e=B2(t);if(e[1]===kn)return 0;throw K0(e,0)}}var HK=n8,ZK=n8,xJ=n8,rJ=n8;function xC(x){function r(c){return c?c[5]:0}function e(c,v,a,l){var m=r(c),h=r(l),T=h<=m?m+1|0:h+1|0;return[0,c,v,a,l,T]}function t(c,v,a,l){var m=c?c[5]:0,h=l?l[5]:0;if((h+2|0)=h){var K=h<=m?m+1|0:h+1|0;return[0,c,v,a,l,K]}if(!l)return R1(rJ);var u0=l[4],Q=l[3],e0=l[2],f0=l[1],a0=r(f0);if(a0<=r(u0))return e(e(c,v,a,f0),e0,Q,u0);if(!f0)return R1(xJ);var Z=f0[3],v0=f0[2],t0=f0[1],y0=e(f0[4],e0,Q,u0);return e(e(c,v,a,t0),v0,Z,y0)}function u(c,v,a){if(!a)return[0,0,c,v,0,1];var l=a[4],m=a[3],h=a[2],T=a[1],b=a[5],N=p(x[1],c,h);if(N===0)return m===v?a:[0,T,c,v,l,b];if(0<=N){var C=u(c,v,l);return l===C?a:t(T,h,m,C)}var I=u(c,v,T);return T===I?a:t(I,h,m,l)}function i(c,v,a){for(var l=v,m=a;;){if(!l)return m;var h=l[4],T=l[3],b=l[2],N=c(b,T,i(c,l[1],m)),l=h,m=N}}return[0,0,u,,,,,,,,,,,,,,,function(c,v){for(var a=v;;){if(!a)throw K0(ms,1);var l=a[4],m=a[3],h=a[1],T=p(x[1],c,a[2]);if(T===0)return m;var b=0<=T?l:h,a=b}},,,,,,,i]}function M6(x){return[0,0,0]}function q6(x){x[1]=0,x[2]=0}function yv(x,r){r[1]=[0,x,r[1]],r[2]=r[2]+1|0}function $3(x){var r=x[1];if(!r)return 0;var e=r[1];return x[1]=r[2],x[2]=x[2]-1|0,[0,e]}function Q3(x){var r=x[1];return r?[0,r[1]]:0}function iq(x){return[0,0,0,0]}function rC(x){x[1]=0,x[2]=0,x[3]=0}function eC(x,r){var e=[0,x,0],t=r[3];return t?(r[1]=r[1]+1|0,t[2]=e,r[3]=e,0):(r[1]=1,r[2]=e,r[3]=e,0)}var eJ="Buffer.add: cannot grow buffer",tJ="Buffer.add_substring/add_subbytes";function Wr(x){var r=1<=x?x:1,e=O6=(e+r|0));)t[1]=2*t[1]|0;O6=0)for(var c=i;;){Yr(t,c,x(ae(r,c)));var v=c+1|0;if(u===c)break;var c=v}return t}var rG=D3,eG="%+d",tG="% d",nG=uF,uG="%+i",iG="% i",fG="%x",cG="%#x",sG="%X",aG="%#X",oG="%o",vG="%#o",lG=JR,pG="%Ld",kG="%+Ld",mG="% Ld",hG=pF,dG="%+Li",yG="% Li",gG="%Lx",wG="%#Lx",_G="%LX",bG="%#LX",TG="%Lo",EG="%#Lo",SG="%Lu",AG="%ld",PG="%+ld",IG="% ld",NG=jL,CG="%+li",jG="% li",OG="%lx",DG="%#lx",FG="%lX",RG="%#lX",LG="%lo",MG="%#lo",qG="%lu",BG="%nd",UG="%+nd",XG="% nd",YG=mO,zG="%+ni",KG="% ni",JG="%nx",GG="%#nx",WG="%nX",VG="%#nX",$G="%no",QG="%#no",HG="%nu",ZG=[0,F1],xW=on,rW="neg_infinity",eW=uL,tW=aI,nW=[0,k1,1558,4],uW="Printf: bad conversion %[",iW=[0,k1,1626,39],fW=[0,k1,1649,31],cW=[0,k1,1650,31],sW="Printf: bad conversion %_",aW=oL,oW=gR,vW=oL,lW=gR;function d5(x,r){if(typeof x=="number")return[0,0,r];if(x[0]===0)return[0,[0,x[1],x[2]],r];if(typeof r!="number"&&r[0]===2)return[0,[1,x[1]],r[1]];throw K0(S1,1)}function U6(x,r,e){var t=d5(x,e);if(typeof r!="number")return[0,t[1],[0,r[1]],t[2]];if(!r)return[0,t[1],0,t[2]];var u=t[2];if(typeof u!="number"&&u[0]===2)return[0,t[1],1,u[1]];throw K0(S1,1)}function g2(x,r){if(typeof x=="number")return[0,0,r];switch(x[0]){case 0:if(typeof r!="number"&&r[0]===0){var e=g2(x[1],r[1]);return[0,[0,e[1]],e[2]]}break;case 1:if(typeof r!="number"&&r[0]===0){var t=g2(x[1],r[1]);return[0,[1,t[1]],t[2]]}break;case 2:var u=x[2],i=d5(x[1],r),c=i[2],v=i[1];if(typeof c!="number"&&c[0]===1){var a=g2(u,c[1]);return[0,[2,v,a[1]],a[2]]}throw K0(S1,1);case 3:var l=x[2],m=d5(x[1],r),h=m[2],T=m[1];if(typeof h!="number"&&h[0]===1){var b=g2(l,h[1]);return[0,[3,T,b[1]],b[2]]}throw K0(S1,1);case 4:var N=x[4],C=x[1],I=U6(x[2],x[3],r),F=I[3],M=I[1];if(typeof F!="number"&&F[0]===2){var Y=I[2],q=g2(N,F[1]);return[0,[4,C,M,Y,q[1]],q[2]]}throw K0(S1,1);case 5:var K=x[4],u0=x[1],Q=U6(x[2],x[3],r),e0=Q[3],f0=Q[1];if(typeof e0!="number"&&e0[0]===3){var a0=Q[2],Z=g2(K,e0[1]);return[0,[5,u0,f0,a0,Z[1]],Z[2]]}throw K0(S1,1);case 6:var v0=x[4],t0=x[1],y0=U6(x[2],x[3],r),n0=y0[3],s0=y0[1];if(typeof n0!="number"&&n0[0]===4){var l0=y0[2],w0=g2(v0,n0[1]);return[0,[6,t0,s0,l0,w0[1]],w0[2]]}throw K0(S1,1);case 7:var L0=x[4],I0=x[1],j0=U6(x[2],x[3],r),S0=j0[3],W0=j0[1];if(typeof S0!="number"&&S0[0]===5){var A0=j0[2],J0=g2(L0,S0[1]);return[0,[7,I0,W0,A0,J0[1]],J0[2]]}throw K0(S1,1);case 8:var b0=x[4],z=x[1],C0=U6(x[2],x[3],r),V0=C0[3],N0=C0[1];if(typeof V0!="number"&&V0[0]===6){var rx=C0[2],xx=g2(b0,V0[1]);return[0,[8,z,N0,rx,xx[1]],xx[2]]}throw K0(S1,1);case 9:var nx=x[2],mx=d5(x[1],r),F0=mx[2],px=mx[1];if(typeof F0!="number"&&F0[0]===7){var dx=g2(nx,F0[1]);return[0,[9,px,dx[1]],dx[2]]}throw K0(S1,1);case 10:var W=g2(x[1],r);return[0,[10,W[1]],W[2]];case 11:var g0=x[1],B=g2(x[2],r);return[0,[11,g0,B[1]],B[2]];case 12:var h0=x[1],_0=g2(x[2],r);return[0,[12,h0,_0[1]],_0[2]];case 13:if(typeof r!="number"&&r[0]===8){var d0=r[1],E0=r[2],U=x[3],Kx=x[1];if(mv([0,x[2]],[0,d0]))throw K0(S1,1);var Ix=g2(U,E0);return[0,[13,Kx,d0,Ix[1]],Ix[2]]}break;case 14:if(typeof r!="number"&&r[0]===9){var z0=r[1],Kr=r[3],S=x[3],G=x[2],Z0=x[1],yx=[0,U2(z0)];if(mv([0,U2(G)],yx))throw K0(S1,1);var Tx=g2(S,U2(Kr));return[0,[14,Z0,z0,Tx[1]],Tx[2]]}break;case 15:if(typeof r!="number"&&r[0]===10){var ex=g2(x[1],r[1]);return[0,[15,ex[1]],ex[2]]}break;case 16:if(typeof r!="number"&&r[0]===11){var m0=g2(x[1],r[1]);return[0,[16,m0[1]],m0[2]]}break;case 17:var Dx=x[1],Ex=g2(x[2],r);return[0,[17,Dx,Ex[1]],Ex[2]];case 18:var qx=x[2],O0=x[1];if(O0[0]===0){var Wx=O0[1],Yx=Wx[2],fx=g2(Wx[1],r),Qx=fx[1],vx=g2(qx,fx[2]);return[0,[18,[0,[0,Qx,Yx]],vx[1]],vx[2]]}var nr=O0[1],gr=nr[2],Nr=g2(nr[1],r),s2=Nr[1],b2=g2(qx,Nr[2]);return[0,[18,[1,[0,s2,gr]],b2[1]],b2[2]];case 19:if(typeof r!="number"&&r[0]===13){var k2=g2(x[1],r[1]);return[0,[19,k2[1]],k2[2]]}break;case 20:if(typeof r!="number"&&r[0]===1){var F2=x[2],jx=x[1],_=g2(x[3],r[1]);return[0,[20,jx,F2,_[1]],_[2]]}break;case 21:if(typeof r!="number"&&r[0]===2){var $=x[1],ix=g2(x[2],r[1]);return[0,[21,$,ix[1]],ix[2]]}break;case 23:var U0=x[2],cx=x[1];if(typeof cx!="number")switch(cx[0]){case 0:return Ge(cx,U0,r);case 1:return Ge(cx,U0,r);case 2:return Ge(cx,U0,r);case 3:return Ge(cx,U0,r);case 4:return Ge(cx,U0,r);case 5:return Ge(cx,U0,r);case 6:return Ge(cx,U0,r);case 7:return Ge(cx,U0,r);case 8:return Ge([8,cx[1],cx[2]],U0,r);case 9:var wx=cx[1],Or=Se(cx[2],U0,r),Hx=Or[2];return[0,[23,[9,wx,Or[1]],Hx[1]],Hx[2]];case 10:return Ge(cx,U0,r);default:return Ge(cx,U0,r)}switch(cx){case 0:return Ge(cx,U0,r);case 1:return Ge(cx,U0,r);case 2:if(typeof r!="number"&&r[0]===14){var x2=g2(U0,r[1]);return[0,[23,2,x2[1]],x2[2]]}throw K0(S1,1);default:return Ge(cx,U0,r)}}throw K0(S1,1)}function Ge(x,r,e){var t=g2(r,e);return[0,[23,x,t[1]],t[2]]}function Se(x,r,e){if(typeof x=="number")return[0,0,g2(r,e)];switch(x[0]){case 0:if(typeof e!="number"&&e[0]===0){var t=Se(x[1],r,e[1]);return[0,[0,t[1]],t[2]]}break;case 1:if(typeof e!="number"&&e[0]===1){var u=Se(x[1],r,e[1]);return[0,[1,u[1]],u[2]]}break;case 2:if(typeof e!="number"&&e[0]===2){var i=Se(x[1],r,e[1]);return[0,[2,i[1]],i[2]]}break;case 3:if(typeof e!="number"&&e[0]===3){var c=Se(x[1],r,e[1]);return[0,[3,c[1]],c[2]]}break;case 4:if(typeof e!="number"&&e[0]===4){var v=Se(x[1],r,e[1]);return[0,[4,v[1]],v[2]]}break;case 5:if(typeof e!="number"&&e[0]===5){var a=Se(x[1],r,e[1]);return[0,[5,a[1]],a[2]]}break;case 6:if(typeof e!="number"&&e[0]===6){var l=Se(x[1],r,e[1]);return[0,[6,l[1]],l[2]]}break;case 7:if(typeof e!="number"&&e[0]===7){var m=Se(x[1],r,e[1]);return[0,[7,m[1]],m[2]]}break;case 8:if(typeof e!="number"&&e[0]===8){var h=e[1],T=e[2],b=x[2];if(mv([0,x[1]],[0,h]))throw K0(S1,1);var N=Se(b,r,T);return[0,[8,h,N[1]],N[2]]}break;case 9:if(typeof e!="number"&&e[0]===9){var C=e[2],I=e[1],F=e[3],M=x[3],Y=x[2],q=x[1],K=[0,U2(I)];if(mv([0,U2(q)],K))throw K0(S1,1);var u0=[0,U2(C)];if(mv([0,U2(Y)],u0))throw K0(S1,1);var Q=M1(h1(c1(I),C)),e0=Q[4];Q[2].call(null,O),e0(O);var f0=Se(U2(M),r,F),a0=f0[2];return[0,[9,I,C,c1(f0[1])],a0]}break;case 10:if(typeof e!="number"&&e[0]===10){var Z=Se(x[1],r,e[1]);return[0,[10,Z[1]],Z[2]]}break;case 11:if(typeof e!="number"&&e[0]===11){var v0=Se(x[1],r,e[1]);return[0,[11,v0[1]],v0[2]]}break;case 13:if(typeof e!="number"&&e[0]===13){var t0=Se(x[1],r,e[1]);return[0,[13,t0[1]],t0[2]]}break;case 14:if(typeof e!="number"&&e[0]===14){var y0=Se(x[1],r,e[1]);return[0,[14,y0[1]],y0[2]]}break}throw K0(S1,1)}function We(x,r,e){var t=Cx(e),u=0<=r?x:0,i=v5(r);if(i<=t)return e;var c=u===2?48:32,v=dv(i,c);switch(u){case 0:yn(e,0,v,0,t);break;case 1:yn(e,0,v,i-t|0,t);break;default:x:if(0u){if(u!==32){if(43>u)break x;switch(u+N_|0){case 5:e:if(t<(e+2|0)&&1=(e+1|0))break x;var c=dv(e+1|0,48);return ra(c,0,u),yn(r,1,c,(e-t|0)+2|0,t-1|0),b1(c)}if(71<=u){if(5>>0)break x}else if(65>u)break x}if(t=0)for(var i=u;;){var c=ae(r,i);x:{r:{e:{if(32<=c){var v=c-34|0;if(58>>0){if(93<=v)break e}else if(56>>0)break r;var a=1;break x}if(11<=c){if(c===13)break r}else if(8<=c)break r}var a=4;break x}var a=2}e[1]=e[1]+a|0;var l=i+1|0;if(t===i)break;var i=l}if(e[1]===Ot(r))var m=r;else{var h=E2(e[1]);e[1]=0;var T=Ot(r)-1|0,b=0;if(T>=0)for(var N=b;;){var C=ae(r,N);x:{r:{e:{if(35<=C){if(C!==92){if(Xr<=C)break e;break r}}else{if(32>C){if(14<=C)break e;switch(C){case 8:Yr(h,e[1],92),e[1]++,Yr(h,e[1],98);break x;case 9:Yr(h,e[1],92),e[1]++,Yr(h,e[1],av);break x;case 10:Yr(h,e[1],92),e[1]++,Yr(h,e[1],w1);break x;case 13:Yr(h,e[1],92),e[1]++,Yr(h,e[1],kr);break x;default:break e}}if(34>C)break r}Yr(h,e[1],92),e[1]++,Yr(h,e[1],C);break x}Yr(h,e[1],92),e[1]++,Yr(h,e[1],48+(C/y2|0)|0),e[1]++,Yr(h,e[1],48+((C/10|0)%10|0)|0),e[1]++,Yr(h,e[1],48+(C%10|0)|0);break x}Yr(h,e[1],C)}e[1]++;var I=N+1|0;if(T===N)break;var N=I}var m=h}var F=b1(m),M=Cx(F),Y=dv(M+2|0,34);return ls(F,0,Y,1,M),b1(Y)}function kq(x,r){var e=v5(r),t=ZG[1];switch(x[2]){case 0:var u=cn;break;case 1:var u=se;break;case 2:var u=69;break;case 3:var u=F1;break;case 4:var u=71;break;case 5:var u=t;break;case 6:var u=ft;break;case 7:var u=72;break;default:var u=70}var i=oq(16);switch(H3(i,37),x[1]){case 0:break;case 1:H3(i,43);break;default:H3(i,32)}return 8<=x[2]&&H3(i,35),H3(i,46),L1(i,H0+e),H3(i,u),lq(i)}function y5(x,r){if(13>x)return r;var e=[0,0],t=Cx(r)-1|0,u=0;if(t>=0)for(var i=u;;){9>=Y0(r,i)+e1>>>0&&e[1]++;var c=i+1|0;if(t===i)break;var i=c}var v=e[1],a=E2(Cx(r)+((v-1|0)/3|0)|0),l=[0,0];function m(F){ra(a,l[1],F),l[1]++}var h=[0,((v-1|0)%3|0)+1|0],T=Cx(r)-1|0,b=0;if(T>=0)for(var N=b;;){var C=Y0(r,N);9>>0||(h[1]===0&&(m(95),h[1]=3),h[1]+=-1),m(C);var I=N+1|0;if(T===N)break;var N=I}return b1(a)}function kW(x,r){switch(x){case 1:var e=eG;break;case 2:var e=tG;break;case 4:var e=uG;break;case 5:var e=iG;break;case 6:var e=fG;break;case 7:var e=cG;break;case 8:var e=sG;break;case 9:var e=aG;break;case 10:var e=oG;break;case 11:var e=vG;break;case 0:case 13:var e=rG;break;case 3:case 14:var e=nG;break;default:var e=lG}return y5(x,x5(e,r))}function mW(x,r){switch(x){case 1:var e=PG;break;case 2:var e=IG;break;case 4:var e=CG;break;case 5:var e=jG;break;case 6:var e=OG;break;case 7:var e=DG;break;case 8:var e=FG;break;case 9:var e=RG;break;case 10:var e=LG;break;case 11:var e=MG;break;case 0:case 13:var e=AG;break;case 3:case 14:var e=NG;break;default:var e=qG}return y5(x,x5(e,r))}function hW(x,r){switch(x){case 1:var e=UG;break;case 2:var e=XG;break;case 4:var e=zG;break;case 5:var e=KG;break;case 6:var e=JG;break;case 7:var e=GG;break;case 8:var e=WG;break;case 9:var e=VG;break;case 10:var e=$G;break;case 11:var e=QG;break;case 0:case 13:var e=BG;break;case 3:case 14:var e=YG;break;default:var e=HG}return y5(x,x5(e,r))}function dW(x,r){switch(x){case 1:var e=kG;break;case 2:var e=mG;break;case 4:var e=dG;break;case 5:var e=yG;break;case 6:var e=gG;break;case 7:var e=wG;break;case 8:var e=_G;break;case 9:var e=bG;break;case 10:var e=TG;break;case 11:var e=EG;break;case 0:case 13:var e=pG;break;case 3:case 14:var e=hG;break;default:var e=SG}return y5(x,_M(e,r))}function fa(x,r,e){function t(h){switch(x[1]){case 0:var T=45;break;case 1:var T=43;break;default:var T=32}return $z(e,r,T)}function u(h){var T=Oz(e);return T===3?e<0?rW:eW:4<=T?tW:h}switch(x[2]){case 5:for(var i=RN(kq(x,r),e),c=0,v=Cx(i);;){if(c===v)var a=0;else{var l=q2(i,c)+za|0;x:{if(23>>0){if(l===55)break x}else if(21>>0)break x;var c=c+1|0;continue}var a=1}var m=a?i:Mx(i,xW);return u(m)}case 6:return t(O);case 7:return b1(xG(WM,Ct(t(O))));case 8:return u(t(O));default:return RN(kq(x,r),e)}}function X6(x,r,e,t){for(var u=r,i=e,c=t;;){if(typeof c=="number")return u(i);switch(c[0]){case 0:var v=c[1];return function(A0){return Br(u,[5,i,A0],v)};case 1:var a=c[1];return function(A0){x:{r:{if(40<=A0){if(A0===92){var z=WJ;break x}if(Xr>A0)break r}else{if(32<=A0){if(39>A0)break r;var z=VJ;break x}if(14>A0)switch(A0){case 8:var z=$J;break x;case 9:var z=QJ;break x;case 10:var z=HJ;break x;case 13:var z=ZJ;break x}}var J0=E2(4);Yr(J0,0,92),Yr(J0,1,48+(A0/y2|0)|0),Yr(J0,2,48+((A0/10|0)%10|0)|0),Yr(J0,3,48+(A0%10|0)|0);var z=b1(J0);break x}var b0=E2(1);Yr(b0,0,A0);var z=b1(b0)}var C0=Cx(z),V0=dv(C0+2|0,39);return ls(z,0,V0,1,C0),Br(u,[4,i,b1(V0)],a)};case 2:return oC(u,i,c[2],c[1],function(A0){return A0});case 3:return oC(u,i,c[2],c[1],pW);case 4:return g5(u,i,c[4],c[2],c[3],kW,c[1]);case 5:return g5(u,i,c[4],c[2],c[3],mW,c[1]);case 6:return g5(u,i,c[4],c[2],c[3],hW,c[1]);case 7:return g5(u,i,c[4],c[2],c[3],dW,c[1]);case 8:var l=c[4],m=c[3],h=c[2],T=c[1];if(typeof h=="number"){if(typeof m=="number")return m?function(A0,J0){return Br(u,[4,i,fa(T,A0,J0)],l)}:function(A0){return Br(u,[4,i,fa(T,cC(T),A0)],l)};var b=m[1];return function(A0){return Br(u,[4,i,fa(T,b,A0)],l)}}if(h[0]===0){var N=h[2],C=h[1];if(typeof m=="number")return m?function(A0,J0){return Br(u,[4,i,We(C,N,fa(T,A0,J0))],l)}:function(A0){return Br(u,[4,i,We(C,N,fa(T,cC(T),A0))],l)};var I=m[1];return function(A0){return Br(u,[4,i,We(C,N,fa(T,I,A0))],l)}}var F=h[1];if(typeof m=="number")return m?function(A0,J0,b0){return Br(u,[4,i,We(F,A0,fa(T,J0,b0))],l)}:function(A0,J0){return Br(u,[4,i,We(F,A0,fa(T,cC(T),J0))],l)};var M=m[1];return function(A0,J0){return Br(u,[4,i,We(F,A0,fa(T,M,J0))],l)};case 9:return oC(u,i,c[2],c[1],GJ);case 10:var i=[7,i],c=c[1];break;case 11:var i=[2,i,c[1]],c=c[2];break;case 12:var i=[3,i,c[1]],c=c[2];break;case 13:var Y=c[3],q=c[2],K=oq(16);sC(K,q);var u0=lq(K);return function(A0){return Br(u,[4,i,u0],Y)};case 14:var Q=c[3],e0=c[2];return function(A0){var J0=A0[1],b0=g2(J0,U2(c1(e0)));if(typeof b0[2]=="number")return Br(u,i,I2(b0[1],Q));throw K0(S1,1)};case 15:var f0=c[1];return function(A0,J0){return Br(u,[6,i,function(b0){return p(A0,b0,J0)}],f0)};case 16:var a0=c[1];return function(A0){return Br(u,[6,i,A0],a0)};case 17:var i=[0,i,c[1]],c=c[2];break;case 18:var Z=c[1];if(Z[0]===0){let A0=i,J0=u,b0=c[2];var u=function(N0){return Br(J0,[1,A0,[0,N0]],b0)},i=0,c=Z[1][1]}else{let A0=i,J0=u,b0=c[2];var u=function(N0){return Br(J0,[1,A0,[1,N0]],b0)},i=0,c=Z[1][1]}break;case 19:throw K0([0,Ir,nW],1);case 20:var v0=c[3],t0=[8,i,uW];return function(A0){return Br(u,t0,v0)};case 21:var y0=c[2];return function(A0){return Br(u,[4,i,x5(JR,A0)],y0)};case 22:var n0=c[1];return function(A0){return Br(u,[5,i,A0],n0)};case 23:var s0=c[2],l0=c[1];if(typeof l0=="number")switch(l0){case 0:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 1:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 2:throw K0([0,Ir,iW],1);default:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0])}switch(l0[0]){case 0:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 1:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 2:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 3:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 4:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 5:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 6:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 7:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 8:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 9:var w0=l0[2];return x<50?aC(x+1|0,u,i,w0,s0):J2(aC,[0,u,i,w0,s0]);case 10:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);default:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0])}default:var L0=c[3],I0=c[1],j0=d(c[2],0);return x<50?vC(x+1|0,u,i,L0,I0,j0):J2(vC,[0,u,i,L0,I0,j0])}}}function Br(x,r,e){return a5(X6(0,x,r,e))}function aC(x,r,e,t,u){if(typeof t=="number")return x<50?v2(x+1|0,r,e,u):J2(v2,[0,r,e,u]);switch(t[0]){case 0:var i=t[1];return function(q){return ot(r,e,i,u)};case 1:var c=t[1];return function(q){return ot(r,e,c,u)};case 2:var v=t[1];return function(q){return ot(r,e,v,u)};case 3:var a=t[1];return function(q){return ot(r,e,a,u)};case 4:var l=t[1];return function(q){return ot(r,e,l,u)};case 5:var m=t[1];return function(q){return ot(r,e,m,u)};case 6:var h=t[1];return function(q){return ot(r,e,h,u)};case 7:var T=t[1];return function(q){return ot(r,e,T,u)};case 8:var b=t[2];return function(q){return ot(r,e,b,u)};case 9:var N=t[3],C=t[2],I=h1(c1(t[1]),C);return function(q){return ot(r,e,ve(I,N),u)};case 10:var F=t[1];return function(q,K){return ot(r,e,F,u)};case 11:var M=t[1];return function(q){return ot(r,e,M,u)};case 12:var Y=t[1];return function(q){return ot(r,e,Y,u)};case 13:throw K0([0,Ir,fW],1);default:throw K0([0,Ir,cW],1)}}function ot(x,r,e,t){return a5(aC(0,x,r,e,t))}function v2(x,r,e,t){var u=[8,e,sW];return x<50?X6(x+1|0,r,u,t):J2(X6,[0,r,u,t])}function oC(x,r,e,t,u){if(typeof t=="number")return function(a){return Br(x,[4,r,u(a)],e)};if(t[0]===0){var i=t[2],c=t[1];return function(a){return Br(x,[4,r,We(c,i,u(a))],e)}}var v=t[1];return function(a,l){return Br(x,[4,r,We(v,a,u(l))],e)}}function g5(x,r,e,t,u,i,c){if(typeof t=="number"){if(typeof u=="number")return u?function(b,N){return Br(x,[4,r,Z3(b,i(c,N))],e)}:function(b){return Br(x,[4,r,i(c,b)],e)};var v=u[1];return function(b){return Br(x,[4,r,Z3(v,i(c,b))],e)}}if(t[0]===0){var a=t[2],l=t[1];if(typeof u=="number")return u?function(b,N){return Br(x,[4,r,We(l,a,Z3(b,i(c,N)))],e)}:function(b){return Br(x,[4,r,We(l,a,i(c,b))],e)};var m=u[1];return function(b){return Br(x,[4,r,We(l,a,Z3(m,i(c,b)))],e)}}var h=t[1];if(typeof u=="number")return u?function(b,N,C){return Br(x,[4,r,We(h,b,Z3(N,i(c,C)))],e)}:function(b,N){return Br(x,[4,r,We(h,b,i(c,N))],e)};var T=u[1];return function(b,N){return Br(x,[4,r,We(h,b,Z3(T,i(c,N)))],e)}}function vC(x,r,e,t,u,i){if(u){var c=u[1];return function(a){return yW(r,e,t,c,d(i,a))}}var v=[4,e,i];return x<50?X6(x+1|0,r,v,t):J2(X6,[0,r,v,t])}function yW(x,r,e,t,u){return a5(vC(0,x,r,e,t,u))}function ca(x,r){for(var e=r;;){if(typeof e=="number")return;switch(e[0]){case 0:var t=e[1],u=pq(e[2]);return ca(x,t),j6(x,u);case 1:var i=e[2],c=e[1];if(i[0]===0){var v=i[1];ca(x,c),j6(x,aW);var e=v}else{var a=i[1];ca(x,c),j6(x,oW);var e=a}break;case 6:var l=e[2];return ca(x,e[1]),d(l,x);case 7:ca(x,e[1]),ln(x);return;case 8:var m=e[2];return ca(x,e[1]),R1(m);case 2:case 4:var h=e[2];return ca(x,e[1]),j6(x,h);default:var T=e[2];ca(x,e[1]),DM(x,T);return}}}function sa(x,r){for(var e=r;;){if(typeof e=="number")return;switch(e[0]){case 0:var t=e[1],u=pq(e[2]);return sa(x,t),ir(x,u);case 1:var i=e[2],c=e[1];if(i[0]===0){var v=i[1];sa(x,c),ir(x,vW);var e=v}else{var a=i[1];sa(x,c),ir(x,lW);var e=a}break;case 6:var l=e[2];return sa(x,e[1]),ir(x,d(l,0));case 7:var e=e[1];break;case 8:var m=e[2];return sa(x,e[1]),R1(m);case 2:case 4:var h=e[2];return sa(x,e[1]),ir(x,h);default:var T=e[2];return sa(x,e[1]),at(x,T)}}}function mq(x,r){return Br(function(e){return ca(x,e),0},0,r[1])}function lC(x){return mq(hn,x)}function sr(x){return Br(function(r){var e=Wr(64);return sa(e,r),G2(e)},0,x[1])}var pC=[0,0],gW=on,wW=[0,[3,0,0],Zl],_W=Xo,bW=[0,[4,0,0,0,0],D3],TW=H0,EW=[0,[11,hF,[2,0,[2,0,0]]],", %s%s"],SW=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],AW=H0,PW=H0,IW=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],NW="Out of memory",CW="Stack overflow",jW="Pattern matching failed",OW="Assertion failed",DW="Undefined recursive module",FW="Raised at",RW="Re-raised at",LW="Raised by primitive operation at",MW="Called from",qW=[0,[12,32,[4,0,0,0,0]]," %d"],BW=" (inlined)",UW=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line",[2,0,[11,EO,qK]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],XW=H0,YW=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],zW=[0,[2,0,[11," unknown location",0]],"%s unknown location"],KW=[0,[2,0,[12,10,0]],`%s +`];function kC(x,r){var e=x[1+r];if(!(1-(typeof e=="number"?1:0)))return d(sr(bW),e);if(hv(e)===_3)return d(sr(wW),e);if(hv(e)!==hE)return _W;for(var t=RN("%.12g",e),u=0,i=Cx(t);;){if(i<=u)return Mx(t,gW);var c=q2(t,u);x:{if(48<=c){if(58>c)break x}else if(c===45)break x;return t}var u=u+1|0}}function hq(x,r){if(x.length-1<=r)return TW;var e=hq(x,r+1|0),t=kC(x,r);return p(sr(EW),t,e)}function Y6(x){x:{r:{for(var r=M3(pC);r;){e:{var e=r[2],t=r[1];try{var u=d(t,x)}catch{break e}if(u)break r}var r=e}var i=0;break x}var i=[0,u[1]]}if(i)return i[1];if(x===WN)return NW;if(x===qM)return CW;if(x[1]===MM){var c=x[2],v=c[3],a=c[2],l=c[1];return GN(sr(VN),l,a,v,v+5|0,jW)}if(x[1]===Ir){var m=x[2],h=m[3],T=m[2],b=m[1];return GN(sr(VN),b,T,h,h+6|0,OW)}if(x[1]===C6){var N=x[2],C=N[3],I=N[2],F=N[1];return GN(sr(VN),F,I,C,C+6|0,DW)}if(hv(x)===0){var M=x.length-1,Y=x[1][1];if(2>>0)var q=hq(x,2),K=kC(x,1),u0=p(sr(SW),K,q);else switch(M){case 0:var u0=AW;break;case 1:var u0=PW;break;default:var Q=kC(x,1),u0=d(sr(IW),Q)}var e0=[0,Y,[0,u0]]}else var e0=[0,x[1],0];var f0=e0[2],a0=e0[1];return f0?Mx(a0,f0[1]):a0}function mC(x,r){var e=Kz(r),t=e.length-1-1|0,u=0;if(t>=0)for(var i=u;;){var c=P2(e,i)[1+i];let u0=i;var v=function(e0){return e0?u0===0?FW:RW:u0===0?LW:MW};if(c[0]===0){if(c[3]===c[6])var a=c[3],h=d(sr(qW),a);else var l=c[6],m=c[3],h=p(sr(YW),m,l);var T=c[7],b=c[4],N=c[8]?BW:XW,C=c[2],I=c[9],F=v(c[1]),Y=[0,MK(sr(UW),F,I,C,N,h,b,T)]}else if(c[1])var Y=0;else var M=v(0),Y=[0,d(sr(zW),M)];if(Y){var q=Y[1];d(mq(x,KW),q)}var K=i+1|0;if(t===i)break;var i=K}}function hC(x){for(;;){var r=M3(pC),e=1-Gm(pC,r,[0,x,r]);if(!e)return e}}var JW=[0,H0,`(Cannot print locations: + bytecode executable program file not found)`,`(Cannot print locations: + bytecode executable program file appears to be corrupt)`,`(Cannot print locations: + bytecode executable program file has wrong magic number)`,`(Cannot print locations: + bytecode executable program file cannot be opened; + -- too many open files. Try running with OCAMLRUNPARAM=b=2)`].slice(),GW=[0,[11,VE,[2,0,[12,10,0]]],YR],WW=[0],VW="Fatal error: out of memory in uncaught exception handler",$W=[0,[11,VE,[2,0,[12,10,0]]],YR],QW=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],`Fatal error in uncaught exception handler: exception %s +`];KN(qO,function(x,r){try{try{var e=r?WW:wM(0);try{QN(O)}catch{}try{var t=Y6(x);d(lC(GW),t),mC(hn,e);var u=hK(0);if(u<0){var i=v5(u);zM(P2(JW,i)[1+i])}var c=ln(hn),v=c}catch(b){var a=B2(b),l=Y6(x);d(lC($W),l),mC(hn,e);var m=Y6(a);d(lC(QW),m),mC(hn,wM(0));var v=ln(hn)}var h=v}catch(b){var T=B2(b);if(T!==WN)throw K0(T,0);var h=zM(VW)}return h}catch{return 0}});var HW=[i2,"Stdlib.Fun.Finally_raised",ks(0)],ZW="Fun.Finally_raised: ";hC(function(x){return x[1]===HW?[0,Mx(ZW,Y6(x[2]))]:0});var xV="Digest.BLAKE2: wrong hash size";function dC(x){var r=x[1]<1?1:0,e=r||(64n0){var t0=s0;continue}var l0=n0}else var l0=y0;var w0=l0;break}else var w0=Q;var L0=w0-Q|0;return 0<=L0?xl(x,[0,pV,L0+f0|0,lV]):wv(x,[0,mV,w0+e0|0,kV],x[6]);case 3:var I0=e[2],j0=e[1];if(x[8]<(x[6]-x[9]|0)){var S0=Q3(x[2]);if(S0){var W0=S0[1],A0=W0[2],J0=W0[1];x[9]=J0-1>>>0&&Eq(x,A0)}else _5(x)}var b0=x[9]-j0|0,z=I0===1?1:x[9]=x[14]);)Cq(x,O);return x[13]=bq,Sq(x),r&&_5(x),x[12]=1,x[13]=1,rC(x[28]),wC(x[1]),q6(x[2]),q6(x[3]),q6(x[4]),q6(x[5]),x[10]=0,x[14]=0,x[9]=x[6],Nq(x,0,3)}function bC(x,r,e){var t=x[14]=e)return Q0(x[17],Fq,0,e);Q0(x[17],Fq,0,80);var e=e-80|0}}function IV(x){return x[1]===yC?Mx(_V,Mx(x[2],wV)):bV}function NV(x){return x[1]===yC?Mx(EV,Mx(x[2],TV)):SV}function CV(x){return 0}function jV(x){return 0}function EC(x,r,e,t,u){var i=iq(O),c=[0,_q,AV,0];eC(c,i);var v=M6(O);wC(v),yv([0,1,c],v);var a=78,l=M6(O),m=M6(O),h=M6(O);return[0,v,M6(O),h,m,l,a,10,68,a,0,1,1,1,1,gV,PV,x,r,e,t,u,0,0,IV,NV,CV,jV,i]}function Rq(x,r){var e=EC(x,r,function(t){return 0},function(t){return 0},function(t){return 0});return e[19]=function(t){return TC(e,O)},e[20]=function(t){return rl(e,t)},e[21]=function(t){return rl(e,t)},e}function Lq(x){return Rq(function(r,e,t){return YM(x,r,e,t)},function(r){return ln(x)})}function SC(x){return Rq(function(r,e,t){return nC(x,r,e,t)},function(r){return 0})}var AC=eI;function Mq(x){return Wr(AC)}var qq=Mq(O),OV=Lq(XM),DV=Lq(hn),FV=SC(qq),Bq=hs(0,Mq);B6(Bq,qq),B6(hs(0,function(x){return SC(gv(Bq))}),FV);function Uq(x,r,e,t){return nC(gv(x),r,e,t)}function Xq(x,r,e){var t=gv(r),u=t[2];return YM(x,G2(t),0,u),ln(x),t[2]=0,0}var Yq=hs(0,function(x){return Wr(AC)}),zq=hs(0,function(x){return Wr(AC)}),Kq=hs(0,function(x){var r=EC(function(e,t,u){return Uq(Yq,e,t,u)},function(e){return Xq(XM,Yq,O)},function(e){return 0},function(e){return 0},function(e){return 0});return r[19]=function(e){return TC(r,O)},r[20]=function(e){return rl(r,e)},r[21]=function(e){return rl(r,e)},aq(function(e){return _v(r,O)}),r});B6(Kq,OV);var Jq=hs(0,function(x){var r=EC(function(e,t,u){return Uq(zq,e,t,u)},function(e){return Xq(hn,zq,O)},function(e){return 0},function(e){return 0},function(e){return 0});return r[19]=function(e){return TC(r,O)},r[20]=function(e){return rl(r,e)},r[21]=function(e){return rl(r,e)},aq(function(e){return _v(r,O)}),r});B6(Jq,DV);var RV="Buffer.sub",LV=[0,0,4],MV=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],qV=H0,BV=H0,UV=H0,XV=H0;function Gq(x,r){var e=Wr(16),t=SC(e);x(t,r),_v(t,O);var u=e[2];if(2>u)return G2(e);var i=u-2|0,c=1;return 0<=i&&(e[2]-i|0)>=1?V3(e[1][1],c,i):R1(RV)}function vt(x,r){if(typeof r!="number"){x:{r:{e:{switch(r[0]){case 0:var e=r[2];if(vt(x,r[1]),typeof e=="number")switch(e){case 0:return Cq(x,O);case 1:return jq(x,O);case 2:return _v(x,O);case 3:var t=x[14]>>0)break;var Q=Q+1|0}break t}var e0=E1(F,u0,Q-u0|0),f0=K(Q);t:n:{for(var a0=f0;;){if(a0===Y)break n;var Z=q2(F,a0);if(48<=Z){if(58<=Z)break}else if(Z!==45)break;var a0=a0+1|0}break t}if(f0===a0)var v0=0;else try{var t0=st(E1(F,f0,a0-f0|0)),v0=t0}catch(dx){var y0=B2(dx);if(y0[1]!==kn)throw K0(y0,0);var v0=q(O)}K(a0)!==Y&&q(O);t:{if(P(e0,H0)&&P(e0,sI)){if(!P(e0,"h")){var n0=0;break t}if(!P(e0,"hov")){var n0=3;break t}if(!P(e0,"hv")){var n0=2;break t}if(P(e0,GF)){var n0=q(O);break t}var n0=1;break t}var n0=4}var M=[0,v0,n0]}return Nq(x,M[1],M[2]);case 2:var s0=r[1];if(typeof s0!="number"&&s0[0]===0){var l0=s0[2];if(typeof l0!="number"&&l0[0]===1){var w0=r[2],L0=l0[2],I0=s0[1];break r}}var C0=r[2],V0=s0;break x;case 3:var j0=r[1];if(typeof j0!="number"&&j0[0]===0){var S0=j0[2];if(typeof S0!="number"&&S0[0]===1){var W0=r[2],A0=S0[2],J0=j0[1];break}}var xx=r[2],nx=j0;break e;case 4:var b0=r[1];if(typeof b0!="number"&&b0[0]===0){var z=b0[2];if(typeof z!="number"&&z[0]===1){var w0=r[2],L0=z[2],I0=b0[1];break r}}var C0=r[2],V0=b0;break x;case 5:var N0=r[1];if(typeof N0!="number"&&N0[0]===0){var rx=N0[2];if(typeof rx!="number"&&rx[0]===1){var W0=r[2],A0=rx[2],J0=N0[1];break}}var xx=r[2],nx=N0;break e;case 6:var mx=r[2];return vt(x,r[1]),d(mx,x);case 7:return vt(x,r[1]),_v(x,O);default:var F0=r[2];return vt(x,r[1]),R1(F0)}return vt(x,J0),bC(x,A0,k5(1,W0))}return vt(x,nx),K6(x,xx)}return vt(x,I0),bC(x,L0,w0)}return vt(x,V0),Dq(x,Cx(C0),C0)}}function s1(x){return function(r){return Br(function(e){return vt(x,e),0},0,r[1])}}var YV="Array.sub",zV="first domain already spawned",KV=[0,"camlinternalOO.ml",Hk,50],JV=[0,WR,72,5],GV=[0,WR,81,2],WV="/tmp",VV=on,$V=[0,"src/wtf8.ml",65,9],QV=[0,"src/third-party/sedlex/flow_sedlexing.ml",QE,4],HV="Flow_sedlexing.MalFormed",ZV=x6,x$=k3,r$=p3,e$=m6,t$=lv,n$=[0,[12,40,[18,[1,[0,[11,Si,0],Si]],[11,"File_key.LibFile",[17,[0,Ma,1,0],0]]]],"(@[<2>File_key.LibFile@ "],u$=[0,[3,0,0],Zl],i$=[0,[17,0,[12,41,0]],Tp],f$=[0,[12,40,[18,[1,[0,[11,Si,0],Si]],[11,"File_key.SourceFile",[17,[0,Ma,1,0],0]]]],"(@[<2>File_key.SourceFile@ "],c$=[0,[3,0,0],Zl],s$=[0,[17,0,[12,41,0]],Tp],a$=[0,[12,40,[18,[1,[0,[11,Si,0],Si]],[11,"File_key.JsonFile",[17,[0,Ma,1,0],0]]]],"(@[<2>File_key.JsonFile@ "],o$=[0,[3,0,0],Zl],v$=[0,[17,0,[12,41,0]],Tp],l$=[0,[12,40,[18,[1,[0,[11,Si,0],Si]],[11,"File_key.ResourceFile",[17,[0,Ma,1,0],0]]]],"(@[<2>File_key.ResourceFile@ "],p$=[0,[3,0,0],Zl],k$=[0,[17,0,[12,41,0]],Tp],m$=[0,1],h$=[0,0],d$=[0,1],y$=[0,2],g$=[0,2],w$=[0,0],_$=[0,1],b$=[0,1],T$=[0,1],E$=[0,1],S$=[0,2],A$=[0,1],P$=[0,1],I$=[0,0,0],N$=[0,0,0],C$=[0,z1,Qi,qi,Y7,V1,Sf,l7,Zf,cc,_f,Ci,Eu,Ti,su,C7,p7,Uu,Pf,q7,Wu,Wi,F7,Wn,Bf,vu,nu,Jn,Vf,os,$f,uf,vf,cs,Ec,hc,K7,Ye,Zn,Li,u7,Fc,Pi,Jf,Mc,Ke,Ic,Cu,Z7,o7,Jc,Vu,uu,g7,Ue,Qu,h7,df,i7,pf,m7,zc,Me,Ef,hi,Xu,j7,iu,Xi,$i,E7,Mf,eu,gc,Ui,v7,Fn,yf,Au,L7,oi,Dc,ki,hu,Te,qc,$n,Xf,qu,is,zn,Hn,f7,Df,pc,Kn,Qn,Ni,qf,rf,Iu,Vi,Ln,Oc,Fu,Gu,gi,Lu,Bu,Hu,x7,mi,Rc,Ii,es,Nf,Nc,ju,Pu,li,lu,Xn,wf,xs,tf,X7,Fi,Kf,ef,hf,Q7,au,w7,Qc,ic,pu,wu,ru,Wc,xi,ie,d7,Yn,Tc,Zu,xf,fu,G7,af,Of,Zc,sc,dc,M7,tc,Nu,jf,t7,I7,J7,If,T7,rs,$u,Ei,_i,yc,Bn,Du,Yu,V7,Hi,ce,Hf,Yc,Gf,bu,gf,Gc,Mi,Mn,K1,bi,D7,Kc,St,yi,bc,us,$7,e7,ri,Su,ii,Bi,_7,xc,nc,Ju,xu,cf,zf,ss,yu,ff,Gn,Vc,di,ui,Ri,ns,sf,c7,y7,Tf,ni,S7,kc,Bc,a7,n1,Rn,wc,nf,as,b7,qn,ji,vc,Cf,Sc,mc,fs,A7,Cc,Af,uc,ac,ku,Tu,P7,Ee,Ki,Ru,Dn,ec,lc,si,Ac,ai,Zi,ou,Oi,tu,Uf,Xc,Xe,Le,Yi,Gi,zu,jc,Uc,B7,cu,Lf,oc,ts,Un,fc,Ai,Ff,W7,Ji,U7,of,wi,k7,Wf,Rf,O7,Ku,pi,fi,Mu,bf,Ou,du,kf,n7,ei,s7,Di,ci,vs,ze,H7,Pc,an,R7,N7,ti,$c,r7,mu,gu,vi,_c,zi,Qf,rn,lf],j$=[0,Jc,$u,nc,yi,ii,vs,Hu,Vi,M7,V7,Pc,vu,Hn,Ke,is,wc,X7,ef,bf,cs,Ni,J7,mi,Hf,T7,ac,A7,Qi,Au,$7,hc,ui,v7,xf,lc,Lf,us,uc,es,St,Y7,Tf,Mf,Zi,Di,Ju,s7,t7,vc,Ef,ri,Ri,Mc,Oc,D7,Z7,Xn,bu,ku,Zu,Ii,pi,wi,qc,lf,iu,Fi,Ai,F7,Iu,Xu,Zc,Rf,f7,Me,Qn,Bi,$n,Nf,tc,I7,bc,ie,Gi,Jn,mc,w7,hf,sc,d7,xc,ru,E7,zi,Ac,qn,Pu,i7,hu,Qf,P7,ci,g7,V1,hi,tu,p7,h7,bi,lu,ti,di,K7,yc,Mu,gi,Jf,Ee,c7,nu,z1,Yn,Ec,Oi,Xi,Eu,Dc,Uf,pf,$c,Ci,of,ou,Bu,Zf,au,If,gu,$f,Yu,Cc,kc,zn,nf,Tc,oi,ni,Pf,os,Ff,Sf,uf,Vu,Uu,Cu,_f,O7,Yc,ns,k7,xi,_7,W7,cc,U7,wf,Lu,G7,oc,r7,li,kf,fi,Un,Qc,L7,af,fc,ju,K1,Ue,C7,q7,Ic,yf,Ye,Xe,x7,Kc,qu,a7,rs,Te,H7,ss,Af,Gf,Wf,Rn,xu,Ei,Su,su,fs,zc,Gn,Mi,Kf,Sc,b7,Uc,Gu,uu,Ln,gf,pc,gc,Vf,rf,j7,Kn,Wu,si,Q7,n7,ai,R7,Bn,Pi,Tu,vf,e7,m7,Mn,qf,du,Fu,jf,Ku,wu,Hi,Ki,Bf,rn,l7,Ru,ei,Wn,Dn,Nu,_i,zu,fu,Ui,Rc,Du,S7,pu,Of,Wi,u7,mu,tf,B7,Fn,vi,N7,n1,ki,Ji,Bc,xs,yu,ff,o7,Le,cf,ts,$i,ji,ec,Li,Fc,ic,Vc,as,Ti,sf,Wc,Xf,an,Gc,Ou,dc,Df,zf,Xc,Qu,Cf,ze,_c,ce,Yi,qi,cu,df,y7,jc,eu,Zn,Nc],O$=zR,D$=ZF,F$=jF,R$=YO,L$=my,M$=QL,q$=n6,B$=uD,U$=JF,X$=RF,Y$=NO,z$=z7,K$=Be,J$=ND,G$=_F,W$=fe,V$=JL,$$=CD,Q$=Dp,H$=hm,Z$=Ra,xQ=Ql,rQ=dR,eQ=xD,tQ=FD,nQ=XD,uQ=FF,iQ=VO,fQ=ZO,cQ=lL,sQ=DD,aQ=pR,oQ=NF,vQ=pO,lQ=kF,pQ=$L,kQ=aF,mQ=Wl,hQ=j3,dQ=Ja,yQ=[0,[18,[1,[0,[11,Si,0],Si]],[11,"{ ",0]],"@[<2>{ "],gQ="Loc.line",wQ=[0,[18,[1,[0,0,H0]],[2,0,[11,QD,[17,[0,Ma,1,0],0]]]],SF],_Q=[0,[4,0,0,0,0],D3],bQ=[0,[17,0,0],TA],TQ=[0,[12,59,[17,[0,Ma,1,0],0]],";@ "],EQ=o6,SQ=[0,[18,[1,[0,0,H0]],[2,0,[11,QD,[17,[0,Ma,1,0],0]]]],SF],AQ=[0,[4,0,0,0,0],D3],PQ=[0,[17,0,0],TA],IQ=[0,[17,[0,Ma,1,0],[12,qa,[17,0,0]]],"@ }@]"],NQ=H0,CQ="Object literal may not have data and accessor property with the same name",jQ="Object literal may not have multiple get/set accessors with the same name",OQ="Unexpected token <. Remember, adjacent JSX elements must be wrapped in an enclosing parent tag",DQ="`let [` is ambiguous in this position because it is either a `let` binding pattern, or a member expression.",FQ="Async functions can only be declared at top level or immediately within another function.",RQ="`await` is an invalid identifier in async functions",LQ="`await` is not allowed in async function parameters.",MQ="Computed properties must have a value.",qQ="Constructor can't be an accessor.",BQ="Constructor can't be an async function.",UQ="Constructor can't be a generator.",XQ="It is sufficient for your declare function to just have a Promise return type.",YQ="async is an implementation detail and isn't necessary for your declare function statement. ",zQ="`declare` modifier can only appear on class fields.",KQ="Unexpected token `=`. Initializers are not allowed in a `declare`.",JQ="Unexpected token `=`. Initializers are not allowed in a `declare opaque type`.",GQ="Classes may only have one constructor",WQ="Rest element must be final element of an array pattern",VQ="Cannot export an enum with `export type`, try `export enum E {}` or `module.exports = E;` instead.",$Q="Enum members are separated with `,`. Replace `;` with `,`.",QQ="`const` enums are not supported. Flow Enums are designed to allow for inlining, however the inlining itself needs to be part of the build system (whatever you use) rather than Flow itself.",HQ="Expected an object pattern, array pattern, or an identifier but found an expression instead",ZQ="Missing comma between export specifiers",xH="Generators can only be declared at top level or immediately within another function.",rH="Getter should have zero parameters",eH="A getter cannot have a `this` parameter.",tH="Illegal break statement",nH="Illegal continue statement",uH="Illegal return statement",iH="Illegal Unicode escape",fH="Missing comma between import specifiers",cH="It cannot be used with `import type` or `import typeof` statements",sH="The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. ",aH="Explicit inexact syntax cannot appear inside an explicit exact object type",oH="Explicit inexact syntax can only appear inside an object type",vH="Component params must be an identifier. If you'd like to destructure, you should use `name as {destructure}`",lH="A bigint literal must be an integer",pH="JSX value should be either an expression or a quoted JSX text",kH="Invalid left-hand side in assignment",mH="Invalid left-hand side in exponentiation expression",hH="Invalid left-hand side in for-in",dH="Invalid left-hand side in for-of",yH="Invalid optional indexed access. Indexed access uses bracket notation. Use the format `T?.[K]`.",gH="Invalid regular expression",wH="A bigint literal cannot use exponential notation",_H="Tuple spread elements cannot be optional.",bH="Tuple variance annotations can only be used with labeled tuple elements, e.g. `[+foo: number]`",TH="`typeof` can only be used to get the type of variables.",EH="JSX attributes must only be assigned a non-empty expression",SH="Literals cannot be used as shorthand properties.",AH="Malformed unicode",PH="`match` argument must not be empty",IH="`match` argument cannot contain spread elements",NH="Object pattern can't contain methods",CH="Expected at least one type parameter.",jH="Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",OH="More than one default clause in switch statement",DH="Illegal newline after throw",FH="Illegal newline before arrow",RH="Missing catch or finally after try",LH="Const must be initialized",MH="Destructuring assignment must be initialized",qH="An optional chain may not be used in a `new` expression.",BH="Template literals may not be used in an optional chain.",UH="Rest parameter must be final parameter of an argument list",XH="Private fields may not be deleted.",YH="Private fields can only be referenced from within a class.",zH="Rest property must be final property of an object pattern",KH="Setter should have exactly one parameter",JH="A setter cannot have a `this` parameter.",GH="Catch variable may not be eval or arguments in strict mode",WH="Delete of an unqualified identifier in strict mode.",VH="Duplicate data property in object literal not allowed in strict mode",$H="Function name may not be eval or arguments in strict mode",QH="Assignment to eval or arguments is not allowed in strict mode",HH="Postfix increment/decrement may not have eval or arguments operand in strict mode",ZH="Prefix increment/decrement may not have eval or arguments operand in strict mode",xZ="Strict mode code may not include a with statement",rZ="Number literals with leading zeros are not allowed in strict mode.",eZ="Octal literals are not allowed in strict mode.",tZ="Strict mode function may not have duplicate parameter names",nZ="Parameter name eval or arguments is not allowed in strict mode",uZ='Illegal "use strict" directive in function with non-simple parameter list',iZ="Use of reserved word in strict mode",fZ="Variable name may not be eval or arguments in strict mode",cZ="You may not access a private field through the `super` keyword.",sZ="Flow does not support abstract classes.",aZ="Flow does not support template literal types.",oZ="A type annotation is required for the `this` parameter.",vZ="Arrow functions cannot have a `this` parameter; arrow functions automatically bind `this` when declared.",lZ="Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",pZ="The `this` parameter cannot be optional.",kZ="The `this` parameter must be the first function parameter.",mZ="A trailing comma is not permitted after the rest element",hZ="Unexpected end of input",dZ="Explicit inexact syntax must come at the end of an object type",yZ="Opaque type aliases are not allowed in untyped mode",gZ="Unexpected proto modifier",wZ="Unexpected reserved word",_Z="Unexpected reserved type",bZ="Spreading a type is only allowed inside an object type",TZ="Unexpected static modifier",EZ="Unexpected `super` outside of a class method",SZ="`super()` is only valid in a class constructor",AZ="Type aliases are not allowed in untyped mode",PZ="Type annotations are not allowed in untyped mode",IZ="Type declarations are not allowed in untyped mode",NZ="Type exports are not allowed in untyped mode",CZ="Type imports are not allowed in untyped mode",jZ="Interfaces are not allowed in untyped mode",OZ="Unexpected variance sigil",DZ="Found a decorator in an unsupported position.",FZ="Invalid regular expression: missing /",RZ="Unexpected whitespace between `#` and identifier",LZ="`yield` is an invalid identifier in generators",MZ="Yield expression not allowed in formal parameter",qZ=[0,[11,"Duplicate export for `",[2,0,[12,96,0]]],"Duplicate export for `%s`"],BZ=[0,[11,"Private fields may only be declared once. `#",[2,0,[11,"` is declared more than once.",0]]],"Private fields may only be declared once. `#%s` is declared more than once."],UZ=[0,[11,"bigint enum members need to be initialized, e.g. `",[2,0,[11," = 1n,` in enum `",[2,0,[11,Gs,0]]]]],"bigint enum members need to be initialized, e.g. `%s = 1n,` in enum `%s`."],XZ=[0,[11,"Boolean enum members need to be initialized. Use either `",[2,0,[11," = true,` or `",[2,0,[11," = false,` in enum `",[2,0,[11,Gs,0]]]]]]],"Boolean enum members need to be initialized. Use either `%s = true,` or `%s = false,` in enum `%s`."],YZ=[0,[11,"Enum member names need to be unique, but the name `",[2,0,[11,"` has already been used before in enum `",[2,0,[11,Gs,0]]]]],"Enum member names need to be unique, but the name `%s` has already been used before in enum `%s`."],zZ=[0,[11,tF,[2,0,[11,"` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.",0]]],"Enum `%s` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers."],KZ="The `...` must come at the end of the enum body. Remove the trailing comma.",JZ="The `...` must come after all enum members. Move it to the end of the enum body.",GZ=[0,[11,"Use one of `boolean`, `number`, `string`, `symbol`, or `bigint` in enum `",[2,0,[11,Gs,0]]],"Use one of `boolean`, `number`, `string`, `symbol`, or `bigint` in enum `%s`."],WZ=[0,[11,"Enum type `",[2,0,[11,"` is not valid. ",[2,0,0]]]],"Enum type `%s` is not valid. %s"],VZ=[0,[11,"Supplied enum type is not valid. ",[2,0,0]],"Supplied enum type is not valid. %s"],$Z=[0,[11,"Enum member names and initializers are separated with `=`. Replace `",[2,0,[11,":` with `",[2,0,[11," =`.",0]]]]],"Enum member names and initializers are separated with `=`. Replace `%s:` with `%s =`."],QZ=[0,[11,tF,[2,0,[11,"` has type `",[2,0,[11,"`, so the initializer of `",[2,0,[11,"` needs to be a ",[2,0,[11," literal.",0]]]]]]]]],"Enum `%s` has type `%s`, so the initializer of `%s` needs to be a %s literal."],HZ=[0,[11,"Symbol enum members cannot be initialized. Use `",[2,0,[11,",` in enum `",[2,0,[11,Gs,0]]]]],"Symbol enum members cannot be initialized. Use `%s,` in enum `%s`."],ZZ=[0,[11,"The enum member initializer for `",[2,0,[11,"` needs to be a literal (either a boolean, number, or string) in enum `",[2,0,[11,Gs,0]]]]],"The enum member initializer for `%s` needs to be a literal (either a boolean, number, or string) in enum `%s`."],x00=[0,[11,"Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `",[2,0,[11,"`, consider using `",[2,0,[11,"`, in enum `",[2,0,[11,Gs,0]]]]]]],"Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%s`, consider using `%s`, in enum `%s`."],r00=[0,[11,"Number enum members need to be initialized, e.g. `",[2,0,[11," = 1,` in enum `",[2,0,[11,Gs,0]]]]],"Number enum members need to be initialized, e.g. `%s = 1,` in enum `%s`."],e00=[0,[11,"String enum members need to consistently either all use initializers, or use no initializers, in enum ",[2,0,[12,46,0]]],"String enum members need to consistently either all use initializers, or use no initializers, in enum %s."],t00=[0,[11,"Expected corresponding JSX closing tag for ",[2,0,0]],"Expected corresponding JSX closing tag for %s"],n00="immediately within another function.",u00="In strict mode code, functions can only be declared at top level or ",i00="inside a block, or as the body of an if statement.",f00="In non-strict mode code, functions can only be declared at top level, ",c00="static ",s00=H0,a00="methods",o00="fields",v00=MR,l00=[0,[11,"Classes may not have ",[2,0,[2,0,[11," named `",[2,0,[11,Gs,0]]]]]],"Classes may not have %s%s named `%s`."],p00="Components use `renders` instead of `:` to annotate the render type of a component.",k00=fR,m00=H0,h00=[0,[11,"String params require local bindings using `as` renaming. You can use `'",[2,0,[11,"' as ",[2,0,[2,0,[11,": ` ",0]]]]]],"String params require local bindings using `as` renaming. You can use `'%s' as %s%s: ` "],d00="Remove the period.",y00="Indexed access uses bracket notation.",g00=[0,[11,"Invalid indexed access. ",[2,0,[11," Use the format `T[K]`.",0]]],"Invalid indexed access. %s Use the format `T[K]`."],w00=[0,[11,"Invalid flags supplied to RegExp constructor '",[2,0,[12,39,0]]],"Invalid flags supplied to RegExp constructor '%s'"],_00=rn,b00=Q4,T00=[0,[11,"In match ",[2,0,[11," pattern, the rest must be the last element in the pattern",0]]],"In match %s pattern, the rest must be the last element in the pattern"],E00=[0,[11,"JSX element ",[2,0,[11," has no corresponding closing tag.",0]]],"JSX element %s has no corresponding closing tag."],S00=[0,[11,nR,[2,0,[11,"`. Parentheses are required to combine `??` with `&&` or `||` expressions.",0]]],"Unexpected token `%s`. Parentheses are required to combine `??` with `&&` or `||` expressions."],A00=[0,[2,0,[11," '",[2,0,[11,"' has already been declared",0]]]],"%s '%s' has already been declared"],P00=H0,I00=Ul,N00=" You can try using JavaScript private fields by prepending `#` to the field name.",C00=g6,j00=" Fields and methods are public by default. You can simply omit the `public` keyword.",O00=h6,D00=[0,[11,"Flow does not support using `",[2,0,[11,"` in classes.",[2,0,0]]]],"Flow does not support using `%s` in classes.%s"],F00=[0,[11,"Private fields must be declared before they can be referenced. `#",[2,0,[11,"` has not been declared.",0]]],"Private fields must be declared before they can be referenced. `#%s` has not been declared."],R00=[0,[11,eR,[2,0,0]],"Unexpected %s"],L00=[0,[11,nR,[2,0,[11,"`. Did you mean `",[2,0,[11,"`?",0]]]]],"Unexpected token `%s`. Did you mean `%s`?"],M00=[0,[11,eR,[2,0,[11,", expected ",[2,0,0]]]],"Unexpected %s, expected %s"],q00=[0,[11,"Undefined label '",[2,0,[12,39,0]]],"Undefined label '%s'"],B00="Parse_error.Error",U00=[0,[0,36,37],[0,48,58],[0,65,91],[0,95,96],[0,97,en],[0,J4,Kw],[0,N8,Ey],[0,Q9,pm],[0,dA,sg],[0,v3,Eg],[0,wd,ip],[0,i2,706],[0,UO,722],[0,736,741],[0,748,749],[0,750,751],[0,768,885],[0,886,888],[0,890,894],[0,895,896],[0,902,907],[0,908,909],[0,910,930],[0,LR,1014],[0,1015,1154],[0,1155,1160],[0,1162,1328],[0,1329,1367],[0,1369,1370],[0,1376,1417],[0,1425,1470],[0,1471,1472],[0,1473,1475],[0,1476,1478],[0,1479,1480],[0,1488,1515],[0,1519,1523],[0,1552,1563],[0,1568,1642],[0,1646,1748],[0,1749,1757],[0,1759,1769],[0,1770,1789],[0,1791,1792],[0,1808,1867],[0,1869,1970],[0,1984,2038],[0,2042,2043],[0,2045,2046],[0,c_,2094],[0,2112,2140],[0,2144,2155],[0,2208,2229],[0,2230,2238],[0,2259,2274],[0,2275,2404],[0,2406,2416],[0,2417,2436],[0,2437,2445],[0,2447,2449],[0,2451,2473],[0,2474,2481],[0,2482,2483],[0,2486,2490],[0,2492,2501],[0,2503,2505],[0,2507,2511],[0,2519,2520],[0,2524,2526],[0,2527,2532],[0,2534,2546],[0,2556,2557],[0,2558,2559],[0,2561,2564],[0,2565,2571],[0,2575,2577],[0,2579,2601],[0,2602,2609],[0,2610,2612],[0,2613,2615],[0,2616,2618],[0,2620,2621],[0,2622,2627],[0,2631,2633],[0,2635,2638],[0,2641,2642],[0,2649,2653],[0,2654,2655],[0,2662,2678],[0,2689,2692],[0,2693,2702],[0,2703,2706],[0,2707,2729],[0,2730,2737],[0,2738,2740],[0,2741,2746],[0,2748,2758],[0,2759,2762],[0,2763,2766],[0,2768,2769],[0,2784,2788],[0,2790,2800],[0,2809,2816],[0,2817,2820],[0,2821,2829],[0,2831,2833],[0,2835,2857],[0,2858,2865],[0,2866,2868],[0,2869,2874],[0,2876,2885],[0,2887,2889],[0,2891,2894],[0,2902,2904],[0,2908,2910],[0,2911,2916],[0,2918,2928],[0,2929,2930],[0,2946,2948],[0,2949,2955],[0,2958,2961],[0,2962,2966],[0,2969,2971],[0,2972,2973],[0,2974,2976],[0,2979,2981],[0,2984,2987],[0,2990,3002],[0,3006,3011],[0,3014,3017],[0,3018,3022],[0,3024,3025],[0,3031,3032],[0,3046,3056],[0,3072,3085],[0,3086,3089],[0,3090,3113],[0,3114,3130],[0,3133,3141],[0,3142,3145],[0,3146,3150],[0,3157,3159],[0,3160,3163],[0,3168,3172],[0,3174,3184],[0,3200,3204],[0,3205,3213],[0,3214,3217],[0,3218,3241],[0,3242,3252],[0,3253,3258],[0,3260,3269],[0,3270,3273],[0,3274,3278],[0,3285,3287],[0,3294,3295],[0,3296,3300],[0,3302,3312],[0,3313,3315],[0,3328,3332],[0,3333,3341],[0,3342,3345],[0,3346,3397],[0,3398,3401],[0,3402,3407],[0,3412,3416],[0,3423,3428],[0,3430,3440],[0,3450,3456],[0,3458,3460],[0,3461,3479],[0,3482,3506],[0,3507,3516],[0,3517,3518],[0,3520,3527],[0,3530,3531],[0,3535,3541],[0,3542,3543],[0,3544,3552],[0,3558,3568],[0,3570,3572],[0,3585,3643],[0,3648,3663],[0,3664,3674],[0,3713,3715],[0,3716,3717],[0,3718,3723],[0,3724,3748],[0,3749,3750],[0,3751,3774],[0,3776,3781],[0,3782,3783],[0,3784,3790],[0,3792,3802],[0,3804,3808],[0,3840,3841],[0,3864,3866],[0,3872,3882],[0,3893,3894],[0,3895,3896],[0,3897,3898],[0,3902,3912],[0,3913,3949],[0,3953,3973],[0,3974,3992],[0,3993,4029],[0,4038,4039],[0,LF,4170],[0,4176,4254],[0,4256,4294],[0,4295,4296],[0,4301,4302],[0,4304,4347],[0,4348,4681],[0,4682,4686],[0,4688,4695],[0,4696,4697],[0,4698,4702],[0,4704,4745],[0,4746,4750],[0,4752,4785],[0,4786,4790],[0,4792,4799],[0,4800,4801],[0,4802,4806],[0,4808,4823],[0,4824,4881],[0,4882,4886],[0,4888,4955],[0,4957,4960],[0,4969,4978],[0,4992,5008],[0,5024,5110],[0,5112,5118],[0,5121,5741],[0,5743,yI],[0,5761,5787],[0,5792,5867],[0,5870,5881],[0,5888,5901],[0,5902,5909],[0,5920,5941],[0,5952,5972],[0,5984,5997],[0,5998,6001],[0,6002,6004],[0,6016,6100],[0,6103,6104],[0,6108,6110],[0,6112,6122],[0,6155,6158],[0,6160,6170],[0,6176,6265],[0,6272,6315],[0,6320,6390],[0,6400,6431],[0,6432,6444],[0,6448,6460],[0,6470,6510],[0,6512,6517],[0,6528,6572],[0,6576,6602],[0,6608,6619],[0,6656,6684],[0,6688,6751],[0,6752,6781],[0,6783,6794],[0,6800,6810],[0,6823,6824],[0,6832,6846],[0,6912,6988],[0,6992,7002],[0,7019,7028],[0,7040,7156],[0,7168,7224],[0,7232,7242],[0,7245,7294],[0,7296,7305],[0,7312,7355],[0,7357,7360],[0,7376,7379],[0,7380,7419],[0,7424,7674],[0,7675,7958],[0,7960,7966],[0,7968,8006],[0,8008,8014],[0,8016,8024],[0,8025,8026],[0,8027,8028],[0,8029,8030],[0,8031,8062],[0,8064,8117],[0,8118,8125],[0,8126,8127],[0,8130,8133],[0,8134,8141],[0,8144,8148],[0,8150,8156],[0,8160,8173],[0,8178,8181],[0,8182,8189],[0,lD,FR],[0,8255,8257],[0,8276,8277],[0,x8,8306],[0,bk,8320],[0,8336,8349],[0,8400,8413],[0,8417,8418],[0,8421,8433],[0,R8,8451],[0,cm,8456],[0,8458,gp],[0,jp,8470],[0,oR,8478],[0,Lk,om],[0,_m,Rp],[0,Xp,lm],[0,8490,8506],[0,8508,8512],[0,8517,8522],[0,Hp,8527],[0,8544,8585],[0,11264,11311],[0,11312,11359],[0,11360,11493],[0,11499,11508],[0,11520,P8],[0,M4,11560],[0,rm,11566],[0,11568,11624],[0,wk,11632],[0,Sp,11671],[0,11680,C8],[0,11688,O8],[0,11696,q4],[0,11704,rk],[0,11712,s8],[0,11720,z4],[0,11728,Pm],[0,11736,11743],[0,11744,11776],[0,12293,12296],[0,12321,Tm],[0,12337,12342],[0,12344,12349],[0,12353,12439],[0,12441,f8],[0,12449,Mm],[0,12540,12544],[0,12549,sm],[0,12593,12687],[0,12704,12731],[0,12784,12800],[0,13312,19894],[0,19968,40944],[0,40960,42125],[0,42192,42238],[0,42240,42509],[0,42512,42540],[0,42560,42608],[0,42612,yp],[0,42623,42738],[0,42775,42784],[0,42786,42889],[0,42891,42944],[0,42946,42951],[0,Nk,43048],[0,43072,43124],[0,43136,43206],[0,43216,43226],[0,43232,43256],[0,vk,nk],[0,43261,43310],[0,43312,43348],[0,43360,43389],[0,43392,43457],[0,l8,43482],[0,43488,tp],[0,dF,43575],[0,43584,43598],[0,43600,43610],[0,43616,43639],[0,E8,43715],[0,43739,43742],[0,43744,43760],[0,43762,43767],[0,43777,43783],[0,43785,43791],[0,43793,43799],[0,43808,B8],[0,43816,Ck],[0,43824,m8],[0,43868,W4],[0,43888,44011],[0,44012,44014],[0,44016,44026],[0,44032,55204],[0,55216,55239],[0,55243,55292],[0,63744,64110],[0,64112,64218],[0,64256,64263],[0,64275,64280],[0,ak,ep],[0,64298,Bk],[0,64312,L8],[0,lk,Ip],[0,64320,Em],[0,64323,Xm],[0,64326,64434],[0,64467,64830],[0,64848,64912],[0,64914,64968],[0,65008,65020],[0,65024,65040],[0,65056,65072],[0,65075,65077],[0,65101,65104],[0,65136,mm],[0,65142,65277],[0,65296,65306],[0,65313,65339],[0,65343,j8],[0,65345,65371],[0,65382,65471],[0,65474,65480],[0,65482,65488],[0,65490,65496],[0,65498,65501],[0,v6,jm],[0,65549,h8],[0,65576,qp],[0,65596,Up],[0,65599,65614],[0,65616,65630],[0,65664,65787],[0,65856,65909],[0,66045,66046],[0,66176,66205],[0,66208,66257],[0,66272,66273],[0,66304,66336],[0,66349,66379],[0,66384,66427],[0,66432,66462],[0,66464,66500],[0,66504,Im],[0,66513,66518],[0,66560,66718],[0,66720,66730],[0,66736,66772],[0,66776,66812],[0,66816,66856],[0,66864,66916],[0,67072,67383],[0,67392,67414],[0,67424,67432],[0,67584,67590],[0,Pp,mk],[0,67594,Nm],[0,67639,67641],[0,k8,67645],[0,67647,67670],[0,67680,67703],[0,67712,67743],[0,67808,op],[0,67828,67830],[0,67840,67862],[0,67872,67898],[0,67968,68024],[0,68030,68032],[0,Om,68100],[0,68101,68103],[0,68108,ek],[0,68117,p8],[0,68121,68150],[0,68152,68155],[0,68159,68160],[0,68192,68221],[0,68224,68253],[0,68288,Qk],[0,68297,68327],[0,68352,68406],[0,68416,68438],[0,68448,68467],[0,68480,68498],[0,68608,68681],[0,68736,68787],[0,68800,68851],[0,68864,68904],[0,68912,68922],[0,69376,69405],[0,nm,69416],[0,69424,69457],[0,69600,69623],[0,69632,69703],[0,69734,bm],[0,69759,69819],[0,69840,69865],[0,69872,69882],[0,69888,69941],[0,69942,69952],[0,np,Wp],[0,69968,70004],[0,vm,70007],[0,70016,70085],[0,70089,70093],[0,70096,Q8],[0,Pk,70109],[0,70144,$8],[0,70163,70200],[0,70206,70207],[0,70272,W8],[0,Yk,$p],[0,70282,V8],[0,70287,D8],[0,70303,70313],[0,70320,70379],[0,70384,70394],[0,70400,$4],[0,70405,70413],[0,70415,70417],[0,70419,km],[0,70442,c8],[0,70450,S8],[0,70453,70458],[0,70459,70469],[0,70471,70473],[0,70475,70478],[0,fp,70481],[0,70487,70488],[0,70493,70500],[0,70502,70509],[0,70512,70517],[0,70656,70731],[0,70736,70746],[0,_p,70752],[0,70784,im],[0,_k,70856],[0,70864,70874],[0,71040,71094],[0,71096,71105],[0,71128,71134],[0,71168,71233],[0,Ak,71237],[0,71248,71258],[0,71296,71353],[0,71360,71370],[0,71424,71451],[0,71453,71468],[0,71472,71482],[0,71680,71739],[0,71840,71914],[0,71935,71936],[0,72096,72104],[0,72106,72152],[0,72154,Zk],[0,fm,72165],[0,yk,72255],[0,72263,72264],[0,Zp,72346],[0,jk,72350],[0,72384,72441],[0,72704,am],[0,72714,72759],[0,72760,72769],[0,72784,72794],[0,72818,72848],[0,72850,72872],[0,72873,72887],[0,72960,Fk],[0,72968,Am],[0,72971,73015],[0,73018,73019],[0,73020,73022],[0,73023,73032],[0,73040,73050],[0,73056,Xk],[0,73063,X8],[0,73066,73103],[0,73104,73106],[0,73107,73113],[0,73120,73130],[0,73440,73463],[0,73728,74650],[0,74752,74863],[0,74880,75076],[0,77824,78895],[0,82944,83527],[0,92160,92729],[0,92736,92767],[0,92768,92778],[0,92880,92910],[0,92912,92917],[0,92928,92983],[0,92992,92996],[0,93008,93018],[0,93027,93048],[0,93053,93072],[0,93760,93824],[0,93952,94027],[0,U8,94088],[0,94095,94112],[0,94176,Np],[0,V4,94180],[0,94208,100344],[0,100352,101107],[0,110592,110879],[0,110928,110931],[0,110948,110952],[0,110960,111356],[0,113664,113771],[0,113776,113789],[0,113792,113801],[0,113808,113818],[0,113821,113823],[0,119141,119146],[0,119149,119155],[0,119163,119171],[0,119173,119180],[0,119210,119214],[0,119362,119365],[0,119808,Z4],[0,119894,Gp],[0,119966,119968],[0,hk,119971],[0,119973,119975],[0,119977,Km],[0,119982,K8],[0,r8,d8],[0,119997,Tk],[0,120005,Um],[0,120071,120075],[0,120077,Ep],[0,120086,G8],[0,120094,up],[0,120123,v8],[0,120128,gk],[0,fk,120135],[0,120138,wm],[0,120146,120486],[0,120488,Op],[0,120514,Uk],[0,120540,qm],[0,120572,Vp],[0,120598,Gk],[0,120630,mp],[0,120656,Mk],[0,120688,cp],[0,120714,G4],[0,120746,Kp],[0,120772,120780],[0,120782,120832],[0,121344,121399],[0,121403,121453],[0,121461,121462],[0,121476,121477],[0,121499,121504],[0,121505,121520],[0,122880,122887],[0,122888,122905],[0,122907,122914],[0,122915,122917],[0,122918,122923],[0,123136,123181],[0,123184,123198],[0,123200,123210],[0,X4,123215],[0,123584,123642],[0,124928,125125],[0,125136,125143],[0,125184,125260],[0,125264,125274],[0,126464,hp],[0,126469,F8],[0,126497,Lm],[0,K4,126501],[0,em,a8],[0,126505,U4],[0,126516,Wk],[0,Dm,w8],[0,lp,126524],[0,Sm,126531],[0,Ym,kp],[0,Fm,I8],[0,Cm,xp],[0,126541,Qp],[0,126545,ym],[0,Z8,126549],[0,$k,pp],[0,pk,Rk],[0,A8,gm],[0,Ap,sp],[0,t8,Bp],[0,126561,vp],[0,dm,126565],[0,126567,H4],[0,126572,wp],[0,126580,zk],[0,126585,ok],[0,Vk,um],[0,126592,ap],[0,126603,126620],[0,126625,Jk],[0,126629,Ok],[0,126635,126652],[0,131072,173783],[0,173824,177973],[0,177984,178206],[0,178208,183970],[0,183984,191457],[0,194560,195102],[0,917760,918e3]],X00=[0,1,0],Y00=[0,0,[0,1,0],[0,1,0]],z00=iL,K00="end of input",J00=s6,G00="template literal part",W00=s6,V00=kO,$00=iL,Q00=s6,H00=k3,Z00=s6,xx0=lv,rx0=s6,ex0=p3,tx0="an",nx0=St,ux0=_u,ix0=[0,[11,"token `",[2,0,[12,96,0]]],"token `%s`"],fx0="{",cx0=g8,sx0="{|",ax0="|}",ox0=OR,vx0=cR,lx0="[",px0="]",kx0=Vb,mx0=zL,hx0=on,dx0="=>",yx0="...",gx0=jO,wx0=MR,_x0=y3,bx0=_8,Tx0=Ra,Ex0=Ql,Sx0=Ue,Ax0=Ke,Px0=lI,Ix0=xv,Nx0=Ye,Cx0=b8,jx0=Wl,Ox0=B4,Dx0=e8,Fx0=Ja,Rx0=j3,Lx0=cv,Mx0=Xs,qx0=$s,Bx0=ze,Ux0=dp,Xx0=xm,Yx0=Le,zx0=$o,Kx0=Mp,Jx0=i8,Gx0=o8,Wx0=Yl,Vx0=rc,$x0=Re,Qx0=zp,Hx0=nv,Zx0=Vl,xr0=Ws,rr0=Ys,er0=r6,tr0=Rm,nr0=K1,ur0=C3,ir0=vv,fr0=ce,cr0=Yp,sr0=g6,ar0=Ul,or0=h6,vr0=z1,lr0=Xe,pr0=_6,kr0=Yf,mr0=sb,hr0=aS,dr0=Ya,yr0=fv,gr0="%checks",wr0=DD,_r0=lL,br0=ZO,Tr0=NF,Er0=pR,Sr0=pO,Ar0=VO,Pr0=FF,Ir0=FD,Nr0=XD,Cr0=xD,jr0=dR,Or0=kF,Dr0=$L,Fr0=aF,Rr0=I9,Lr0="?.",Mr0=Zg,qr0=fR,Br0=Uo,Ur0=UF,Xr0=DR,Yr0=CD,zr0=Dp,Kr0=hm,Jr0=zR,Gr0=ZF,Wr0=jF,Vr0=YO,$r0=QL,Qr0=uD,Hr0=my,Zr0=n6,x20=JF,r20=RF,e20=NO,t20=z7,n20=Be,u20=fe,i20=ND,f20=_F,c20=JL,s20=LO,a20=VL,o20=HR,v20=ED,l20=H0,p20=bp,k20=Fp,m20=Ee,h20=k3,d20=lv,y20=p3,g20=Ys,w20=m6,_20=Cp,b20=Lp,T20=sk,E20=tm,S20=ev,A20=JO,P20=p6,I20=E3,N20=d3,C20=qF,j20=lF,O20=Xl,D20=Xl,F20=yL,R20=Xl,L20=Xl,M20=g8,q20=g8,B20=yL,U20=fe,X20=fe,Y20=x6,z20=y8,K20="T_LCURLY",J20="T_RCURLY",G20="T_LCURLYBAR",W20="T_RCURLYBAR",V20="T_LPAREN",$20="T_RPAREN",Q20="T_LBRACKET",H20="T_RBRACKET",Z20="T_SEMICOLON",x10="T_COMMA",r10="T_PERIOD",e10="T_ARROW",t10="T_ELLIPSIS",n10="T_AT",u10="T_POUND",i10="T_FUNCTION",f10="T_IF",c10="T_IN",s10="T_INSTANCEOF",a10="T_RETURN",o10="T_SWITCH",v10="T_MATCH",l10="T_THIS",p10="T_THROW",k10="T_TRY",m10="T_VAR",h10="T_WHILE",d10="T_WITH",y10="T_CONST",g10="T_LET",w10="T_NULL",_10="T_FALSE",b10="T_TRUE",T10="T_BREAK",E10="T_CASE",S10="T_CATCH",A10="T_CONTINUE",P10="T_DEFAULT",I10="T_DO",N10="T_FINALLY",C10="T_FOR",j10="T_CLASS",O10="T_EXTENDS",D10="T_STATIC",F10="T_ELSE",R10="T_NEW",L10="T_DELETE",M10="T_TYPEOF",q10="T_VOID",B10="T_ENUM",U10="T_EXPORT",X10="T_IMPORT",Y10="T_SUPER",z10="T_IMPLEMENTS",K10="T_INTERFACE",J10="T_PACKAGE",G10="T_PRIVATE",W10="T_PROTECTED",V10="T_PUBLIC",$10="T_YIELD",Q10="T_DEBUGGER",H10="T_DECLARE",Z10="T_TYPE",xe0="T_OPAQUE",re0="T_OF",ee0="T_ASYNC",te0="T_AWAIT",ne0="T_CHECKS",ue0="T_RSHIFT3_ASSIGN",ie0="T_RSHIFT_ASSIGN",fe0="T_LSHIFT_ASSIGN",ce0="T_BIT_XOR_ASSIGN",se0="T_BIT_OR_ASSIGN",ae0="T_BIT_AND_ASSIGN",oe0="T_MOD_ASSIGN",ve0="T_DIV_ASSIGN",le0="T_MULT_ASSIGN",pe0="T_EXP_ASSIGN",ke0="T_MINUS_ASSIGN",me0="T_PLUS_ASSIGN",he0="T_NULLISH_ASSIGN",de0="T_AND_ASSIGN",ye0="T_OR_ASSIGN",ge0="T_ASSIGN",we0="T_PLING_PERIOD",_e0="T_PLING_PLING",be0="T_PLING",Te0="T_COLON",Ee0="T_OR",Se0="T_AND",Ae0="T_BIT_OR",Pe0="T_BIT_XOR",Ie0="T_BIT_AND",Ne0="T_EQUAL",Ce0="T_NOT_EQUAL",je0="T_STRICT_EQUAL",Oe0="T_STRICT_NOT_EQUAL",De0="T_LESS_THAN_EQUAL",Fe0="T_GREATER_THAN_EQUAL",Re0="T_LESS_THAN",Le0="T_GREATER_THAN",Me0="T_LSHIFT",qe0="T_RSHIFT",Be0="T_RSHIFT3",Ue0="T_PLUS",Xe0="T_MINUS",Ye0="T_DIV",ze0="T_MULT",Ke0="T_EXP",Je0="T_MOD",Ge0="T_NOT",We0="T_BIT_NOT",Ve0="T_INCR",$e0="T_DECR",Qe0="T_EOF",He0="T_ANY_TYPE",Ze0="T_MIXED_TYPE",xt0="T_EMPTY_TYPE",rt0="T_NUMBER_TYPE",et0="T_BIGINT_TYPE",tt0="T_STRING_TYPE",nt0="T_VOID_TYPE",ut0="T_SYMBOL_TYPE",it0="T_UNKNOWN_TYPE",ft0="T_NEVER_TYPE",ct0="T_UNDEFINED_TYPE",st0="T_KEYOF",at0="T_READONLY",ot0="T_INFER",vt0="T_IS",lt0="T_ASSERTS",pt0="T_IMPLIES",kt0=KL,mt0=KL,ht0="T_NUMBER",dt0="T_BIGINT",yt0="T_STRING",gt0="T_TEMPLATE_PART",wt0="T_IDENTIFIER",_t0="T_REGEXP",bt0="T_INTERPRETER",Tt0="T_ERROR",Et0="T_JSX_IDENTIFIER",St0=BL,At0=BL,Pt0="T_BOOLEAN_TYPE",It0="T_NUMBER_SINGLETON_TYPE",Nt0="T_BIGINT_SINGLETON_TYPE",Ct0=[0,WD,M8,9],jt0=[0,WD,kk,9],Ot0=dL,Dt0="*/",Ft0=dL,Rt0="unreachable line_comment",Lt0="unreachable string_quote",Mt0="\\",qt0="unreachable template_part",Bt0=`\r +`,Ut0=Tw,Xt0="unreachable regexp_class",Yt0=WO,zt0="unreachable regexp_body",Kt0=H0,Jt0=H0,Gt0=H0,Wt0=H0,Vt0=SD,$t0="{'>'}",Qt0=n6,Ht0="{'}'}",Zt0=g8,xn0=Ua,rn0=Vb,en0=hm,tn0=SD,nn0=Ua,un0=Vb,in0=hm,fn0="unreachable type_token wholenumber",cn0="unreachable type_token wholebigint",sn0="unreachable type_token floatbigint",an0="unreachable type_token scinumber",on0="unreachable type_token scibigint",vn0="unreachable type_token hexnumber",ln0="unreachable type_token hexbigint",pn0="unreachable type_token legacyoctnumber",kn0="unreachable type_token octnumber",mn0="unreachable type_token octbigint",hn0="unreachable type_token binnumber",dn0="unreachable type_token bigbigint",yn0="unreachable type_token",gn0=mL,wn0=[11,1],_n0=[11,0],bn0="unreachable template_tail",Tn0=H0,En0=H0,Sn0="unreachable jsx_child",An0="unreachable jsx_tag",Pn0=[0,ID],In0=[0,913],Nn0=[0,v3],Cn0=[0,CI],jn0=[0,hD],On0=[0,FL],Dn0=[0,8747],Fn0=[0,DO],Rn0=[0,916],Ln0=[0,8225],Mn0=[0,935],qn0=[0,gL],Bn0=[0,914],Un0=[0,MA],Xn0=[0,DF],Yn0=[0,mR],zn0=[0,915],Kn0=[0,RO],Jn0=[0,919],Gn0=[0,917],Wn0=[0,hL],Vn0=[0,eD],$n0=[0,eF],Qn0=[0,924],Hn0=[0,923],Zn0=[0,922],x70=[0,yF],r70=[0,921],e70=[0,AT],t70=[0,kk],n70=[0,fF],u70=[0,wd],i70=[0,927],f70=[0,937],c70=[0,nD],s70=[0,nF],a70=[0,pD],o70=[0,338],v70=[0,352],l70=[0,929],p70=[0,936],k70=[0,8243],m70=[0,928],h70=[0,934],d70=[0,LL],y70=[0,tD],g70=[0,933],w70=[0,hR],_70=[0,rL],b70=[0,dO],T70=[0,920],E70=[0,932],S70=[0,zO],A70=[0,PD],P70=[0,$F],I70=[0,xF],N70=[0,918],C70=[0,376],j70=[0,QF],O70=[0,926],D70=[0,K_],F70=[0,LR],R70=[0,925],L70=[0,39],M70=[0,8736],q70=[0,8743],B70=[0,38],U70=[0,945],X70=[0,8501],Y70=[0,qo],z70=[0,8226],K70=[0,rD],J70=[0,946],G70=[0,8222],W70=[0,KO],V70=[0,SR],$70=[0,8776],Q70=[0,pL],H70=[0,8773],Z70=[0,9827],xu0=[0,UO],ru0=[0,967],eu0=[0,UR],tu0=[0,pm],nu0=[0,BO],uu0=[0,KF],iu0=[0,8595],fu0=[0,8224],cu0=[0,8659],su0=[0,dD],au0=[0,8746],ou0=[0,8629],vu0=[0,Rg],lu0=[0,8745],pu0=[0,8195],ku0=[0,8709],mu0=[0,hO],hu0=[0,kL],du0=[0,fL],yu0=[0,ip],gu0=[0,9830],wu0=[0,8707],_u0=[0,8364],bu0=[0,IR],Tu0=[0,b3],Eu0=[0,951],Su0=[0,8801],Au0=[0,949],Pu0=[0,8194],Iu0=[0,8805],Nu0=[0,947],Cu0=[0,8260],ju0=[0,ZT],Ou0=[0,J9],Du0=[0,M8],Fu0=[0,8704],Ru0=[0,zF],Lu0=[0,_L],Mu0=[0,8230],qu0=[0,9829],Bu0=[0,8596],Uu0=[0,8660],Xu0=[0,62],Yu0=[0,402],zu0=[0,948],Ku0=[0,vF],Ju0=[0,Uy],Gu0=[0,8712],Wu0=[0,EP],Vu0=[0,953],$u0=[0,8734],Qu0=[0,8465],Hu0=[0,jR],Zu0=[0,8220],xi0=[0,8968],ri0=[0,8592],ei0=[0,Kw],ti0=[0,10216],ni0=[0,955],ui0=[0,8656],ii0=[0,954],fi0=[0,60],ci0=[0,8216],si0=[0,8249],ai0=[0,FR],oi0=[0,9674],vi0=[0,8727],li0=[0,8970],pi0=[0,EL],ki0=[0,8711],mi0=[0,956],hi0=[0,8722],di0=[0,Q9],yi0=[0,N8],gi0=[0,8212],wi0=[0,qD],_i0=[0,8804],bi0=[0,957],Ti0=[0,bF],Ei0=[0,8836],Si0=[0,8713],Ai0=[0,rF],Pi0=[0,8715],Ii0=[0,8800],Ni0=[0,8853],Ci0=[0,959],ji0=[0,969],Oi0=[0,8254],Di0=[0,GR],Fi0=[0,339],Ri0=[0,Go],Li0=[0,XR],Mi0=[0,Ey],qi0=[0,I3],Bi0=[0,8855],Ui0=[0,eE],Xi0=[0,i2],Yi0=[0,dA],zi0=[0,J4],Ki0=[0,lr],Ji0=[0,fA],Gi0=[0,982],Wi0=[0,960],Vi0=[0,966],$i0=[0,8869],Qi0=[0,8240],Hi0=[0,8706],Zi0=[0,8744],xf0=[0,8211],rf0=[0,10217],ef0=[0,8730],tf0=[0,8658],nf0=[0,34],uf0=[0,968],if0=[0,8733],ff0=[0,8719],cf0=[0,961],sf0=[0,8971],af0=[0,RL],of0=[0,8476],vf0=[0,8221],lf0=[0,8969],pf0=[0,8594],kf0=[0,sg],mf0=[0,AR],hf0=[0,gF],df0=[0,8901],yf0=[0,353],gf0=[0,8218],wf0=[0,8217],_f0=[0,8250],bf0=[0,8835],Tf0=[0,8721],Ef0=[0,8838],Sf0=[0,8834],Af0=[0,9824],Pf0=[0,8764],If0=[0,962],Nf0=[0,963],Cf0=[0,8207],jf0=[0,952],Of0=[0,8756],Df0=[0,964],Ff0=[0,dk],Rf0=[0,8839],Lf0=[0,GL],Mf0=[0,gD],qf0=[0,R3],Bf0=[0,8657],Uf0=[0,8482],Xf0=[0,Eg],Yf0=[0,732],zf0=[0,g3],Kf0=[0,8201],Jf0=[0,977],Gf0=[0,oR],Wf0=[0,_3],Vf0=[0,965],$f0=[0,978],Qf0=[0,SL],Hf0=[0,QE],Zf0=[0,WL],xc0=[0,lD],rc0=[0,8205],ec0=[0,950],tc0=[0,xk],nc0=[0,EF],uc0=[0,hE],ic0=[0,958],fc0=[0,8593],cc0=[0,Ed],sc0=[0,8242],ac0=[0,cL],oc0="unreachable regexp",vc0="unreachable token wholenumber",lc0="unreachable token wholebigint",pc0="unreachable token floatbigint",kc0="unreachable token scinumber",mc0="unreachable token scibigint",hc0="unreachable token hexnumber",dc0="unreachable token hexbigint",yc0="unreachable token legacyoctnumber",gc0="unreachable token legacynonoctnumber",wc0="unreachable token octnumber",_c0="unreachable token octbigint",bc0="unreachable token bignumber",Tc0="unreachable token bigint",Ec0="unreachable token",Sc0=mL,Ac0=[7,"#!"],Pc0="expected ?",Ic0="unreachable string_escape",Nc0=W1,Cc0=Hl,jc0=Hl,Oc0=W1,Dc0=sI,Fc0=CF,Rc0="n",Lc0="r",Mc0="t",qc0=GF,Bc0=Hl,Uc0=Ua,Xc0=Ua,Yc0="unreachable id_char",zc0=Ua,Kc0=Ua,Jc0=Hl,Gc0=eL,Wc0=bO,Vc0=B_,$c0=[26,"token ILLEGAL"],Qc0=[0,[11,"the identifier `",[2,0,[12,96,0]]],"the identifier `%s`"],Hc0=[0,1],Zc0=[0,1],xs0=MF,rs0=MF,es0=[0,[11,"an identifier. When exporting a ",[2,0,[11," as a named export, you must specify a ",[2,0,[11," name. Did you mean `export default ",[2,0,[11," ...`?",0]]]]]]],"an identifier. When exporting a %s as a named export, you must specify a %s name. Did you mean `export default %s ...`?"],ts0=zm,ns0="Peeking current location when not available",us0=[0,"src/parser/parser_env.ml",365,9],is0="Internal Error: Tried to add_declared_private with outside of class scope.",fs0="Internal Error: `exit_class` called before a matching `enter_class`",cs0=H0,ss0=[0,0,0],as0=[0,0,0],os0="Parser_env.Try.Rollback",vs0=H0,ls0=H0,ps0=[0,z1,Qi,qi,LD,PR,Y7,V1,Sf,l7,Zf,cc,_f,Ci,Eu,Ti,su,C7,p7,Uu,Pf,q7,Wu,Wi,F7,Wn,Bf,vu,nu,Jn,Vf,os,$f,uf,vf,cs,Ec,hc,K7,Ye,Zn,Li,u7,Fc,Pi,Jf,Mc,Ke,Ic,Cu,Z7,o7,Jc,Vu,uu,g7,Ue,Qu,h7,df,i7,pf,m7,zc,Me,Ef,hi,Xu,j7,iu,Xi,$i,E7,Mf,eu,gc,Ui,v7,Fn,yf,Au,L7,oi,Dc,ki,hu,Te,qc,$n,Xf,qu,is,zn,Hn,f7,Df,pc,Kn,Qn,Ni,qf,rf,Iu,Vi,Ln,Oc,Fu,Gu,gi,Lu,Bu,Hu,x7,mi,Rc,Ii,es,Nf,Nc,ju,Pu,li,lu,Xn,wf,xs,tf,X7,Fi,Kf,ef,hf,Q7,au,w7,Qc,ic,pu,wu,ru,Wc,xi,ie,d7,Yn,Tc,Zu,xf,fu,G7,af,Of,Zc,sc,dc,M7,tc,Nu,jf,t7,I7,J7,If,T7,rs,$u,Ei,_i,yc,Bn,Du,Yu,V7,Hi,ce,Hf,Yc,Gf,bu,gf,Gc,Mi,Mn,K1,bi,D7,Kc,St,yi,bc,us,$7,e7,ri,Su,ii,Bi,_7,xc,nc,Ju,xu,cf,zf,ss,yu,ff,Gn,Vc,di,ui,Ri,ns,sf,c7,y7,Tf,ni,S7,kc,Bc,a7,n1,Rn,wc,nf,as,b7,qn,ji,vc,Cf,Sc,mc,fs,A7,Cc,Af,uc,ac,ku,Tu,P7,Ee,Ki,Ru,Dn,ec,lc,si,Ac,ai,Zi,ou,Oi,tu,Uf,Xc,Xe,Le,Yi,Gi,zu,jc,Uc,B7,cu,Lf,oc,ts,Un,fc,Ai,Ff,W7,Ji,wD,U7,_O,XF,of,wi,k7,Wf,Rf,O7,Ku,pi,fi,Mu,bf,Ou,du,kf,n7,ei,s7,Di,ci,vs,ze,H7,Pc,an,R7,N7,ti,$c,r7,mu,gu,vi,_c,zi,Qf,rn,lf],ks0=[0,z1,Qi,qi,Y7,V1,Sf,l7,Zf,cc,_f,Ci,Eu,Ti,su,C7,p7,Uu,Pf,q7,Wu,Wi,F7,Wn,Bf,vu,nu,Jn,Vf,os,$f,uf,vf,cs,Ec,hc,K7,Ye,Zn,Li,u7,Fc,Pi,Jf,Mc,Ke,Ic,Cu,Z7,o7,Jc,Vu,uu,g7,Ue,Qu,h7,df,i7,pf,m7,zc,Me,Ef,hi,Xu,j7,iu,Xi,$i,E7,Mf,eu,gc,Ui,v7,Fn,yf,Au,L7,oi,Dc,ki,hu,Te,qc,$n,Xf,qu,is,zn,Hn,f7,Df,pc,Kn,Qn,Ni,qf,rf,Iu,Vi,Ln,Oc,Fu,Gu,gi,Lu,Bu,Hu,x7,mi,Rc,Ii,es,Nf,Nc,ju,Pu,li,lu,Xn,wf,xs,tf,X7,Fi,Kf,ef,hf,Q7,au,w7,Qc,ic,pu,wu,ru,Wc,xi,ie,d7,Yn,Tc,Zu,xf,fu,G7,af,Of,Zc,sc,dc,M7,tc,Nu,jf,t7,I7,J7,If,T7,rs,$u,Ei,_i,yc,Bn,Du,Yu,V7,Hi,ce,Hf,Yc,Gf,bu,gf,Gc,Mi,Mn,K1,bi,D7,Kc,St,yi,bc,us,$7,e7,ri,Su,ii,Bi,_7,xc,nc,Ju,xu,cf,zf,ss,yu,ff,Gn,Vc,di,ui,Ri,ns,sf,c7,y7,Tf,ni,S7,kc,Bc,a7,n1,Rn,wc,nf,as,b7,qn,ji,vc,Cf,Sc,mc,fs,A7,Cc,Af,uc,ac,ku,Tu,P7,Ee,Ki,Ru,Dn,ec,lc,si,Ac,ai,Zi,ou,Oi,tu,Uf,Xc,Xe,Le,Yi,Gi,zu,jc,Uc,B7,cu,Lf,oc,ts,Un,fc,Ai,Ff,W7,Ji,U7,of,wi,k7,Wf,Rf,O7,Ku,pi,fi,Mu,bf,Ou,du,kf,n7,ei,s7,Di,ci,vs,ze,H7,Pc,an,R7,N7,ti,$c,r7,mu,gu,vi,_c,zi,Qf,rn,lf],ms0=[0,Jc,$u,nc,yi,ii,vs,Hu,Vi,M7,V7,Pc,vu,Hn,Ke,is,wc,X7,ef,bf,cs,Ni,J7,mi,Hf,T7,ac,A7,Qi,Au,$7,hc,ui,v7,xf,lc,Lf,us,uc,es,St,Y7,Tf,Mf,Zi,Di,Ju,s7,t7,vc,Ef,ri,Ri,Mc,Oc,D7,Z7,Xn,bu,ku,Zu,Ii,pi,wi,qc,lf,iu,Fi,Ai,F7,Iu,Xu,Zc,Rf,f7,Me,Qn,Bi,$n,Nf,tc,I7,bc,ie,Gi,Jn,mc,w7,hf,sc,d7,xc,ru,E7,zi,Ac,qn,Pu,i7,hu,Qf,P7,ci,g7,V1,hi,tu,p7,h7,bi,lu,ti,di,K7,yc,Mu,gi,Jf,Ee,c7,nu,z1,Yn,Ec,Oi,Xi,Eu,Dc,Uf,pf,$c,Ci,of,ou,Bu,Zf,au,If,gu,$f,Yu,Cc,kc,zn,nf,Tc,oi,ni,Pf,os,Ff,Sf,uf,Vu,Uu,Cu,_f,O7,Yc,ns,k7,xi,_7,W7,cc,U7,wf,Lu,G7,oc,r7,li,kf,fi,Un,Qc,L7,af,fc,ju,K1,Ue,C7,q7,Ic,yf,Ye,Xe,x7,Kc,qu,a7,rs,Te,H7,ss,Af,Gf,Wf,Rn,xu,Ei,Su,su,fs,zc,Gn,Mi,Kf,Sc,b7,Uc,Gu,uu,Ln,gf,pc,gc,Vf,rf,j7,Kn,Wu,si,Q7,n7,ai,R7,Bn,Pi,Tu,vf,e7,m7,Mn,qf,du,Fu,jf,Ku,wu,Hi,Ki,Bf,rn,l7,Ru,ei,Wn,Dn,Nu,_i,zu,fu,Ui,Rc,Du,S7,pu,Of,Wi,u7,mu,tf,B7,Fn,vi,N7,n1,ki,Ji,Bc,xs,yu,ff,o7,Le,cf,ts,$i,ji,ec,Li,Fc,ic,Vc,as,Ti,sf,Wc,Xf,an,Gc,Ou,dc,Df,zf,Xc,Qu,Cf,ze,_c,ce,Yi,qi,cu,df,y7,jc,eu,Zn,Nc],hs0=[0,Jc,$u,nc,yi,ii,vs,Hu,Vi,M7,V7,Pc,vu,Hn,Ke,is,wc,X7,ef,bf,cs,Ni,J7,mi,Hf,T7,ac,A7,Qi,Au,$7,hc,ui,v7,xf,lc,Lf,us,uc,es,St,Y7,PR,Tf,Mf,Zi,Di,Ju,s7,t7,vc,Ef,ri,Ri,Mc,Oc,D7,Z7,Xn,bu,ku,Zu,Ii,pi,wi,qc,lf,iu,Fi,Ai,_O,F7,Iu,Xu,Zc,Rf,f7,Me,Qn,Bi,$n,Nf,tc,I7,bc,ie,Gi,Jn,mc,w7,hf,sc,d7,xc,ru,E7,zi,Ac,qn,Pu,i7,hu,Qf,P7,ci,g7,V1,hi,tu,p7,h7,bi,lu,ti,di,K7,yc,Mu,gi,Jf,Ee,c7,nu,z1,Yn,Ec,Oi,Xi,Eu,Dc,Uf,pf,$c,Ci,of,ou,Bu,Zf,au,If,gu,$f,Yu,Cc,kc,zn,nf,Tc,oi,ni,Pf,os,Ff,Sf,uf,Vu,Uu,Cu,_f,O7,Yc,ns,k7,xi,_7,W7,cc,U7,wf,Lu,G7,oc,r7,li,kf,fi,Un,Qc,L7,af,fc,ju,K1,Ue,C7,q7,Ic,yf,Ye,Xe,x7,Kc,qu,a7,rs,Te,H7,ss,Af,Gf,Wf,Rn,xu,Ei,Su,su,fs,zc,Gn,Mi,Kf,Sc,b7,Uc,Gu,uu,Ln,gf,pc,gc,Vf,rf,j7,Kn,Wu,si,Q7,n7,ai,R7,Bn,XF,Pi,Tu,vf,e7,m7,Mn,qf,du,Fu,jf,Ku,wu,Hi,Ki,Bf,wD,rn,l7,Ru,ei,Wn,LD,Dn,Nu,_i,zu,fu,Ui,Rc,Du,S7,pu,Of,Wi,u7,mu,tf,B7,Fn,vi,N7,n1,ki,Ji,Bc,xs,yu,ff,o7,Le,cf,ts,$i,ji,ec,Li,Fc,ic,Vc,as,Ti,sf,Wc,Xf,an,Gc,Ou,dc,Df,zf,Xc,Qu,Cf,ze,_c,ce,Yi,qi,cu,df,y7,jc,eu,Zn,Nc],ds0=y3,ys0=_8,gs0=Ra,ws0=Ql,_s0=Ue,bs0=Ke,Ts0=lI,Es0=xv,Ss0=Ye,As0=b8,Ps0=Wl,Is0=B4,Ns0=e8,Cs0=Ja,js0=j3,Os0=cv,Ds0=Xs,Fs0=$s,Rs0=ze,Ls0=dp,Ms0=xm,qs0=Le,Bs0=$o,Us0=Mp,Xs0=i8,Ys0=o8,zs0=Yl,Ks0=rc,Js0=Re,Gs0=zp,Ws0=nv,Vs0=Vl,$s0=Ws,Qs0=Ys,Hs0=r6,Zs0=Rm,xa0=K1,ra0=C3,ea0=vv,ta0=ce,na0=Yp,ua0=g6,ia0=Ul,fa0=h6,ca0=z1,sa0=Xe,aa0=_6,oa0=Yf,va0=sb,la0=aS,pa0=Ya,ka0=fv,ma0=bp,ha0=Fp,da0=Ee,ya0=k3,ga0=lv,wa0=p3,_a0=Ys,ba0=m6,Ta0=Cp,Ea0=Lp,Sa0=sk,Aa0=tm,Pa0=ev,Ia0=p6,Na0=E3,Ca0=d3,ja0=x6,Oa0=y8,Da0=[0,zm],Fa0=H0,Ra0=[18,1],La0=[18,0],Ma0=[0,0],qa0=Ks,Ba0=[0,0],Ua0=[0,"a type"],Xa0=[0,0],Ya0=[0,"a number literal type"],za0=[0,0],Ka0=p6,Ja0=E3,Ga0=d3,Wa0="You should only call render_type after making sure the next token is a renders variant",Va0=[0,[0,0,0,0,0]],$a0=[0,0,0,0],Qa0=[0,1],Ha0=[0,N3,1451,6],Za0=[0,N3,1454,6],xo0=[0,N3,1557,8],ro0=[0,1],eo0=[0,N3,1574,8],to0="Can not have both `static` and `proto`",no0=Re,uo0=yg,io0=[0,0],fo0=[0,"the end of a tuple type (no trailing comma is allowed in inexact tuple type)."],co0=[0,N3,qo,15],so0=[0,N3,EP,15],ao0=Be,oo0=Be,vo0=ck,lo0=o6,po0=[0,[11,"Failure while looking up ",[2,0,[11,". Index: ",[4,0,0,0,[11,". Length: ",[4,0,0,0,[12,46,0]]]]]]],"Failure while looking up %s. Index: %d. Length: %d."],ko0=[0,0,0,0],mo0="Offset_utils.Offset_lookup_failed",ho0=w2,do0=TO,yo0=o6,go0=ck,wo0=OO,_o0=o6,bo0=ck,To0=_D,Eo0=ox,So0="normal",Ao0=Yf,Po0="jsxTag",Io0="jsxChild",No0="template",Co0=kO,jo0="context",Oo0=Yf,Do0=[6,0],Fo0=[0,0],Ro0=[0,1],Lo0=[0,4],Mo0=[0,2],qo0=[0,3],Bo0=[0,0],Uo0=Be,Xo0=[0,0,0,0,0,0],Yo0=[0,1],zo0=[0,0],Ko0=Ks,Jo0=[0,71],Go0=[0,82],Wo0=vR,Vo0=gT,$o0="exports",Qo0=k6,Ho0=[0,H0,H0,0],Zo0=[0,MO],xv0=[0,82],rv0=[0,"a declaration, statement or export specifiers"],ev0=[0,1],tv0=[0,zy,1841,21],nv0=[0,"the keyword `as`"],uv0=[0,30],iv0=[0,30],fv0=[0,0],cv0=[0,1],sv0=[0,MO],av0=[0,"the keyword `from`"],ov0=[0,H0,H0,0],vv0=[0,RR],lv0="Label",pv0=[0,RR],kv0=[0,0,0],mv0=[0,39],hv0=[0,zy,372,22],dv0=[0,38],yv0=[0,zy,391,22],gv0=[0,0],wv0="the token `;`",_v0=[0,0],bv0=[0,0],Tv0=YD,Ev0=[0,zm],Sv0=YD,Av0=[26,St],Pv0=Ks,Iv0=[0,71],Nv0=[0,H0,0],Cv0=It,jv0=[0,H0,0],Ov0=[0,71],Dv0=[0,71],Fv0=y3,Rv0=[0,H0,0],Lv0=[0,0,0],Mv0=[0,0,0],qv0=[0,[0,8]],Bv0=[0,[0,7]],Uv0=[0,[0,6]],Xv0=[0,[0,10]],Yv0=[0,[0,9]],zv0=[0,[0,11]],Kv0=[0,[0,5]],Jv0=[0,[0,4]],Gv0=[0,[0,2]],Wv0=[0,[0,3]],Vv0=[0,[0,1]],$v0=[0,[0,0]],Qv0=[0,[0,12]],Hv0=[0,[0,13]],Zv0=[0,[0,14]],x30=[0,0],r30=[0,1],e30=[0,0],t30=[0,2],n30=[0,3],u30=[0,7],i30=[0,6],f30=[0,4],c30=[0,5],s30=[0,1],a30=[0,0],o30=[0,1],v30=[0,0],l30=C3,p30=[0,"either a call or access of `super`"],k30=C3,m30=K1,h30=Gl,d30=Gl,y30=nv,g30=[0,"the identifier `target`"],w30=[0,0],_30=[0,1],b30=[0,1],T30=[0,1],E30=[0,1],S30=[0,1],A30=[0,71],P30=Hl,I30=eL,N30=B_,C30=B_,j30=bO,O30=[0,0],D30=[0,1],F30=[0,0],R30=fe,L30=fe,M30=[0,"a regular expression"],q30=H0,B30=H0,U30=H0,X30=[0,79],Y30=[0,"src/parser/expression_parser.ml",1445,17],z30=[0,"a template literal part"],K30=[0,[0,H0,H0],1],J30=Xo,G30=[0,6],W30=[0,[0,17,[0,2]]],V30=[0,[0,18,[0,3]]],$30=[0,[0,19,[0,4]]],Q30=[0,[0,0,[0,5]]],H30=[0,[0,1,[0,5]]],Z30=[0,[0,2,[0,5]]],xl0=[0,[0,3,[0,5]]],rl0=[0,[0,5,[0,6]]],el0=[0,[0,7,[0,6]]],tl0=[0,[0,4,[0,6]]],nl0=[0,[0,6,[0,6]]],ul0=[0,[0,8,[0,7]]],il0=[0,[0,9,[0,7]]],fl0=[0,[0,10,[0,7]]],cl0=[0,[0,11,[0,8]]],sl0=[0,[0,12,[0,8]]],al0=[0,[0,15,[0,9]]],ol0=[0,[0,13,[0,9]]],vl0=[0,[0,14,[1,10]]],ll0=[0,[0,16,[0,9]]],pl0=[0,[0,21,[0,6]]],kl0=[0,[0,20,[0,6]]],ml0=[22,Zg],hl0=[13,"JSX fragment"],dl0=Uo,yl0=on,gl0=[0,un],wl0=[1,un],_l0=[0,H0,H0,0],bl0=[0,zm],Tl0=H0,El0=[0,"a number or string literal"],Sl0=[0,H0,'""',0],Al0=[0,0],Pl0=[0,"a number literal"],Il0=[0,[0,0,W1,0]],Nl0=[0,82],Cl0=[20,wR],jl0=[20,t6],Ol0=Yl,Dl0=[0,H0,0],Fl0="unexpected PrivateName in Property, expected a PrivateField",Rl0=[0,0,0],Ll0=Xa,Ml0="Must be one of the above",ql0=[0,1],Bl0=[0,1],Ul0=[0,1],Xl0=Xa,Yl0=Xa,zl0=I9,Kl0="Internal Error: private name found in object props",Jl0=[0,0,0,0],Gl0=[0,mF],Wl0=[19,[0,0]],Vl0=[0,mF],$l0=Tw,Ql0="Nooo: ",Hl0=$o,Zl0="Parser error: No such thing as an expression pattern!",x60=[0,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],r60=[0,"src/parser/parser_flow.ml",fA,28],e60=[0,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],t60=TO,n60=ox,u60=sD,i60=vD,f60=vD,c60=sD,s60=Yf,a60=gO,o60=A2,v60=w2,l60="InterpreterDirective",p60="interpreter",k60="Program",m60=$l,h60="BreakStatement",d60=$l,y60="ContinueStatement",g60="DebuggerStatement",w60=sv,_60="DeclareExportAllDeclaration",b60=sv,T60=P9,E60=WT,S60=$o,A60="DeclareExportDeclaration",P60=A2,I60=Gr,N60="DeclareModule",C60=u1,j60="DeclareModuleExports",O60=A2,D60=Gr,F60="DeclareNamespace",R60=w3,L60=A2,M60="DoWhileStatement",q60="EmptyStatement",B60=AE,U60=WT,X60="ExportDefaultDeclaration",Y60=AE,z60=ES,K60=sv,J60="ExportAllDeclaration",G60=AE,W60=sv,V60=P9,$60=WT,Q60="ExportNamedDeclaration",H60="directive",Z60=n1,x40="ExpressionStatement",r40=A2,e40="update",t40=w3,n40=Hc,u40="ForStatement",i40="each",f40=A2,c40=tn,s40=Js,a40="ForInStatement",o40=fv,v40=A2,l40=tn,p40=Js,k40="ForOfStatement",m40=bD,h40=hP,d40=w3,y40="IfStatement",g40=Yf,w40=Ws,_40=w2,b40=HO,T40=sv,E40=P9,S40="ImportDeclaration",A40=A2,P40=$l,I40="LabeledStatement",N40=c9,C40=g1,j40="MatchStatement",O40=g1,D40="ReturnStatement",F40=c9,R40="discriminant",L40="SwitchStatement",M40=g1,q40="ThrowStatement",B40="finalizer",U40="handler",X40=an,Y40="TryStatement",z40=A2,K40=w3,J40="WhileStatement",G40=A2,W40=Q4,V40="WithStatement",$40=aT,Q40="ArrayExpression",H40=$1,Z40=Bm,xp0=n1,rp0=Me,ep0=Yd,tp0=Ya,np0=A2,up0=sn,ip0=Gr,fp0="ArrowFunctionExpression",cp0=n1,sp0="AsConstExpression",ap0=u1,op0=n1,vp0="AsExpression",lp0=I9,pp0=tn,kp0=Js,mp0=tv,hp0="AssignmentExpression",dp0=tn,yp0=Js,gp0=tv,wp0="BinaryExpression",_p0="CallExpression",bp0=bD,Tp0=hP,Ep0=w3,Sp0="ConditionalExpression",Ap0=sv,Pp0="ImportExpression",Ip0=UF,Np0=DR,Cp0=Zg,jp0=tn,Op0=Js,Dp0=tv,Fp0="LogicalExpression",Rp0=c9,Lp0=g1,Mp0="MatchExpression",qp0="MemberExpression",Bp0=Y8,Up0=Gl,Xp0="MetaProperty",Yp0=mb,zp0=Dk,Kp0=mD,Jp0="NewExpression",Gp0=Sk,Wp0="ObjectExpression",Vp0=it,$p0="OptionalCallExpression",Qp0=it,Hp0="OptionalMemberExpression",Zp0=tR,xk0="SequenceExpression",rk0="Super",ek0="ThisExpression",tk0=u1,nk0=n1,uk0="TypeCastExpression",ik0=u1,fk0=n1,ck0="SatisfiesExpression",sk0=g1,ak0="AwaitExpression",ok0=Be,vk0=z7,lk0=LO,pk0=VL,kk0=Ws,mk0=Ys,hk0=Vl,dk0="matched above",yk0=g1,gk0=$D,wk0=tv,_k0="UnaryExpression",bk0=ED,Tk0=HR,Ek0=$D,Sk0=g1,Ak0=tv,Pk0="UpdateExpression",Ik0="delegate",Nk0=g1,Ck0="YieldExpression",jk0=SO,Ok0=A2,Dk0=Te,Fk0="MatchExpressionCase",Rk0=SO,Lk0=A2,Mk0=Te,qk0="MatchStatementCase",Bk0=uk,Uk0=Te,Xk0=Ba,Yk0="MatchObjectPatternProperty",zk0=Y8,Kk0="base",Jk0="MatchMemberPattern",Gk0="literal",Wk0="MatchLiteralPattern",Vk0="MatchWildcardPattern",$k0=Be,Qk0=z7,Hk0=g1,Zk0=tv,x80="MatchUnaryPattern",r80=Bl,e80=Sk,t80="MatchObjectPattern",n80=Bl,u80=aT,i80="MatchArrayPattern",f80="patterns",c80="MatchOrPattern",s80=Jm,a80=Te,o80="MatchAsPattern",v80=Gr,l80="MatchIdentifierPattern",p80=zs,k80=Gr,m80="MatchBindingPattern",h80=g1,d80="MatchRestPattern",y80="Unexpected FunctionDeclaration with BodyExpression",g80="HookDeclaration",w80=n1,_80=Me,b80=Yd,T80=Ya,E80="FunctionDeclaration",S80=$1,A80=Bm,P80=A2,I80=sn,N80=Gr,C80="Unexpected FunctionExpression with BodyExpression",j80=$1,O80=Bm,D80=n1,F80=Me,R80=Yd,L80=Ya,M80=A2,q80=sn,B80=Gr,U80="FunctionExpression",X80=it,Y80=u1,z80=qe,K80=uS,J80=it,G80=u1,W80=qe,V80="PrivateIdentifier",$80=it,Q80=u1,H80=qe,Z80=uS,xm0=hP,rm0=w3,em0="SwitchCase",tm0=A2,nm0="param",um0="CatchClause",im0=A2,fm0="BlockStatement",cm0=zs,sm0=Gr,am0="DeclareVariable",om0="DeclareHook",vm0=Me,lm0="DeclareFunction",pm0=Gr,km0=kR,mm0=vv,hm0=rc,dm0=A2,ym0=$1,gm0=Gr,wm0="DeclareClass",_m0=$1,bm0=b9,Tm0=sn,Em0=Bl,Sm0=sn,Am0=Gr,Pm0="DeclareComponent",Im0=$1,Nm0=b9,Cm0=Bl,jm0=sn,Om0="ComponentTypeAnnotation",Dm0=it,Fm0=u1,Rm0=qe,Lm0="ComponentTypeParameter",Mm0=A2,qm0=Gr,Bm0="DeclareEnum",Um0=rc,Xm0=A2,Ym0=$1,zm0=Gr,Km0="DeclareInterface",Jm0=w2,Gm0=Yf,Wm0=ES,Vm0="ExportNamespaceSpecifier",$m0=tn,Qm0=$1,Hm0=Gr,Zm0="DeclareTypeAlias",x50=tn,r50=$1,e50=Gr,t50="TypeAlias",n50="DeclareOpaqueType",u50="OpaqueType",i50="supertype",f50="impltype",c50=$1,s50=Gr,a50="ClassDeclaration",o50="ClassExpression",v50=qk,l50=vv,p50="superTypeParameters",k50="superClass",m50=$1,h50=A2,d50=Gr,y50=n1,g50="Decorator",w50=$1,_50=Gr,b50="ClassImplements",T50=A2,E50="ClassBody",S50=Mo,A50=d6,P50=zo,I50=S3,N50=qk,C50=m3,j50=Re,O50=zs,D50=w2,F50=Ba,R50="MethodDefinition",L50=_6,M50=qk,q50=V1,B50=Re,U50=m3,X50=u1,Y50=w2,z50=Ba,K50=NL,J50="Internal Error: Private name found in class prop",G50=_6,W50=qk,V50=V1,$50=Re,Q50=m3,H50=u1,Z50=w2,xh0=Ba,rh0=NL,eh0=$1,th0=b9,nh0=sn,uh0=Gr,ih0=A2,fh0="ComponentDeclaration",ch0=g1,sh0=HT,ah0=tn,oh0=Js,vh0=H8,lh0=uk,ph0=a6,kh0=qe,mh0="ComponentParameter",hh0=Hc,dh0=Gr,yh0="EnumBigIntMember",gh0=Gr,wh0=KD,_h0=Hc,bh0=Gr,Th0="EnumStringMember",Eh0=Gr,Sh0=KD,Ah0=Hc,Ph0=Gr,Ih0="EnumNumberMember",Nh0=Hc,Ch0=Gr,jh0="EnumBooleanMember",Oh0=c6,Dh0=J8,Fh0=Kl,Rh0="EnumBooleanBody",Lh0=c6,Mh0=J8,qh0=Kl,Bh0="EnumNumberBody",Uh0=c6,Xh0=J8,Yh0=Kl,zh0="EnumStringBody",Kh0=c6,Jh0=Kl,Gh0="EnumSymbolBody",Wh0=c6,Vh0=J8,$h0=Kl,Qh0="EnumBigIntBody",Hh0=A2,Zh0=Gr,xd0="EnumDeclaration",rd0=rc,ed0=A2,td0=$1,nd0=Gr,ud0="InterfaceDeclaration",id0=$1,fd0=Gr,cd0="InterfaceExtends",sd0=u1,ad0=Sk,od0="ObjectPattern",vd0=u1,ld0=aT,pd0="ArrayPattern",kd0=tn,md0=Js,hd0=H8,dd0=u1,yd0=qe,gd0=uS,wd0=g1,_d0=HT,bd0=g1,Td0=HT,Ed0=tn,Sd0=Js,Ad0=H8,Pd0=Hc,Id0=Hc,Nd0=zo,Cd0=S3,jd0=cD,Od0=m3,Dd0=uk,Fd0=d6,Rd0=zs,Ld0=w2,Md0=Ba,qd0=TF,Bd0=g1,Ud0=kD,Xd0=tn,Yd0=Js,zd0=H8,Kd0=m3,Jd0=uk,Gd0=d6,Wd0=zs,Vd0=w2,$d0=Ba,Qd0=TF,Hd0=g1,Zd0=kD,xy0=At,ry0=w2,ey0=l3,ty0=H0,ny0=At,uy0=lv,iy0=w2,fy0=l3,cy0=At,sy0=w2,ay0=l3,oy0=$s,vy0=Xs,ly0=At,py0=w2,ky0=l3,my0="flags",hy0=Te,dy0="regex",yy0=At,gy0=w2,wy0=l3,_y0=At,by0=w2,Ty0=l3,Ey0=tR,Sy0="quasis",Ay0="TemplateLiteral",Py0="cooked",Iy0=At,Ny0="tail",Cy0=w2,jy0="TemplateElement",Oy0="quasi",Dy0="tag",Fy0="TaggedTemplateExpression",Ry0=zs,Ly0="declarations",My0="VariableDeclaration",qy0=Hc,By0=Gr,Uy0="VariableDeclarator",Xy0="plus",Yy0=uR,zy0=ev,Ky0=Ra,Jy0=bw,Gy0="in-out",Wy0=zs,Vy0="Variance",$y0="AnyTypeAnnotation",Qy0="MixedTypeAnnotation",Hy0="EmptyTypeAnnotation",Zy0="VoidTypeAnnotation",x90="NullLiteralTypeAnnotation",r90="SymbolTypeAnnotation",e90="NumberTypeAnnotation",t90="BigIntTypeAnnotation",n90="StringTypeAnnotation",u90="BooleanTypeAnnotation",i90=u1,f90="NullableTypeAnnotation",c90="UnknownTypeAnnotation",s90="NeverTypeAnnotation",a90="UndefinedTypeAnnotation",o90=zs,v90=u1,l90="parameterName",p90="TypePredicate",k90="HookTypeAnnotation",m90="FunctionTypeAnnotation",h90=xv,d90=$1,y90=Bl,g90=Bm,w90=sn,_90=it,b90=u1,T90=qe,E90=sR,S90=it,A90=u1,P90=qe,I90=sR,N90=[0,0,0,0,0],C90="internalSlots",j90="callProperties",O90="indexers",D90=Sk,F90="exact",R90=xL,L90="ObjectTypeAnnotation",M90=cD,q90="There should not be computed object type property keys",B90=Hc,U90=zo,X90=S3,Y90=zs,z90=V1,K90=yg,J90=Re,G90=it,W90=d6,V90=w2,$90=Ba,Q90="ObjectTypeProperty",H90=g1,Z90="ObjectTypeSpreadProperty",xg0=V1,rg0=Re,eg0=w2,tg0=Ba,ng0=Gr,ug0="ObjectTypeIndexer",ig0=Re,fg0=w2,cg0="ObjectTypeCallProperty",sg0=it,ag0=V1,og0="sourceType",vg0="propType",lg0="keyTparam",pg0="ObjectTypeMappedTypeProperty",kg0=w2,mg0=d6,hg0=Re,dg0=it,yg0=Gr,gg0="ObjectTypeInternalSlot",wg0=A2,_g0=rc,bg0="InterfaceTypeAnnotation",Tg0=QR,Eg0="ArrayTypeAnnotation",Sg0="falseType",Ag0="trueType",Pg0="extendsType",Ig0="checkType",Ng0="ConditionalTypeAnnotation",Cg0="typeParameter",jg0="InferTypeAnnotation",Og0=Gr,Dg0=YF,Fg0="QualifiedTypeIdentifier",Rg0=$1,Lg0=Gr,Mg0="GenericTypeAnnotation",qg0="indexType",Bg0="objectType",Ug0="IndexedAccessType",Xg0=it,Yg0="OptionalIndexedAccessType",zg0=R9,Kg0="UnionTypeAnnotation",Jg0=R9,Gg0="IntersectionTypeAnnotation",Wg0=Dk,Vg0=g1,$g0="TypeofTypeAnnotation",Qg0=Gr,Hg0=YF,Zg0="QualifiedTypeofIdentifier",xw0=g1,rw0="KeyofTypeAnnotation",ew0=T3,tw0=qF,nw0=lF,uw0=u1,iw0=tv,fw0="TypeOperator",cw0=ev,sw0=xL,aw0="elementTypes",ow0="TupleTypeAnnotation",vw0=it,lw0=V1,pw0=QR,kw0=$l,mw0="TupleTypeLabeledElement",hw0=u1,dw0=$l,yw0="TupleTypeSpreadElement",gw0=At,ww0=w2,_w0="StringLiteralTypeAnnotation",bw0=At,Tw0=w2,Ew0="NumberLiteralTypeAnnotation",Sw0=At,Aw0=w2,Pw0="BigIntLiteralTypeAnnotation",Iw0=$s,Nw0=Xs,Cw0=At,jw0=w2,Ow0="BooleanLiteralTypeAnnotation",Dw0="ExistsTypeAnnotation",Fw0=u1,Rw0=wF,Lw0=u1,Mw0=wF,qw0=sn,Bw0="TypeParameterDeclaration",Uw0="usesExtendsBound",Xw0=$o,Yw0=V1,zw0=Ja,Kw0="bound",Jw0=qe,Gw0="TypeParameter",Ww0=sn,Vw0=yR,$w0=sn,Qw0=yR,Hw0=Xo,Zw0=IL,x_0="closingElement",r_0="openingElement",e_0="JSXElement",t_0="closingFragment",n_0=IL,u_0="openingFragment",i_0="JSXFragment",f_0=Dk,c_0="selfClosing",s_0="attributes",a_0=qe,o_0="JSXOpeningElement",v_0="JSXOpeningFragment",l_0=qe,p_0="JSXClosingElement",k_0="JSXClosingFragment",m_0=w2,h_0=qe,d_0="JSXAttribute",y_0=g1,g_0="JSXSpreadAttribute",w_0="JSXEmptyExpression",__0=n1,b_0="JSXExpressionContainer",T_0=n1,E_0="JSXSpreadChild",S_0=At,A_0=w2,P_0="JSXText",I_0=Y8,N_0=Q4,C_0="JSXMemberExpression",j_0=qe,O_0=gT,D_0="JSXNamespacedName",F_0=qe,R_0="JSXIdentifier",L_0=ES,M_0=a6,q_0="ExportSpecifier",B_0=a6,U_0="ImportDefaultSpecifier",X_0=a6,Y_0="ImportNamespaceSpecifier",z_0=HO,K_0=a6,J_0="imported",G_0="ImportSpecifier",W_0="Line",V_0="Block",$_0=w2,Q_0=w2,H_0="DeclaredPredicate",Z_0="InferredPredicate",xb0=mb,rb0=Dk,eb0=mD,tb0=m3,nb0=Y8,ub0=Q4,ib0="message",fb0=ox,cb0=OO,sb0=_D,ab0=sv,ob0=o6,vb0=ck,lb0=[0,z1,Qi,qi,Y7,V1,Sf,l7,Zf,cc,_f,Ci,Eu,Ti,su,C7,p7,Uu,Pf,q7,Wu,Wi,F7,Wn,Bf,vu,nu,Jn,Vf,os,$f,uf,vf,cs,Ec,hc,K7,Ye,Zn,Li,u7,Fc,Pi,Jf,Mc,Ke,Ic,Cu,Z7,o7,Jc,Vu,uu,g7,Ue,Qu,h7,df,i7,pf,m7,zc,Me,Ef,hi,Xu,j7,iu,Xi,$i,E7,Mf,eu,gc,Ui,v7,Fn,yf,Au,L7,oi,Dc,ki,hu,Te,qc,$n,Xf,qu,is,zn,Hn,f7,Df,pc,Kn,Qn,Ni,qf,rf,Iu,Vi,Ln,Oc,Fu,Gu,gi,Lu,Bu,Hu,x7,mi,Rc,Ii,es,Nf,Nc,ju,Pu,li,lu,Xn,wf,xs,tf,X7,Fi,Kf,ef,hf,Q7,au,w7,Qc,ic,pu,wu,ru,Wc,xi,ie,d7,Yn,Tc,Zu,xf,fu,G7,af,Of,Zc,sc,dc,M7,tc,Nu,jf,t7,I7,J7,If,T7,rs,$u,Ei,_i,yc,Bn,Du,Yu,V7,Hi,ce,Hf,Yc,Gf,bu,gf,Gc,Mi,Mn,K1,bi,D7,Kc,St,yi,bc,us,$7,e7,ri,Su,ii,Bi,_7,xc,nc,Ju,xu,cf,zf,ss,yu,ff,Gn,Vc,di,ui,Ri,ns,sf,c7,y7,Tf,ni,S7,kc,Bc,a7,n1,Rn,wc,nf,as,b7,qn,ji,vc,Cf,Sc,mc,fs,A7,Cc,Af,uc,ac,ku,Tu,P7,Ee,Ki,Ru,Dn,ec,lc,si,Ac,ai,Zi,ou,Oi,tu,Uf,Xc,Xe,Le,Yi,Gi,zu,jc,Uc,B7,cu,Lf,oc,ts,Un,fc,Ai,Ff,W7,Ji,U7,of,wi,k7,Wf,Rf,O7,Ku,pi,fi,Mu,bf,Ou,du,kf,n7,ei,s7,Di,ci,vs,ze,H7,Pc,an,R7,N7,ti,$c,r7,mu,gu,vi,_c,zi,Qf,rn,lf],pb0=[0,Jc,$u,nc,yi,ii,vs,Hu,Vi,M7,V7,Pc,vu,Hn,Ke,is,wc,X7,ef,bf,cs,Ni,J7,mi,Hf,T7,ac,A7,Qi,Au,$7,hc,ui,v7,xf,lc,Lf,us,uc,es,St,Y7,Tf,Mf,Zi,Di,Ju,s7,t7,vc,Ef,ri,Ri,Mc,Oc,D7,Z7,Xn,bu,ku,Zu,Ii,pi,wi,qc,lf,iu,Fi,Ai,F7,Iu,Xu,Zc,Rf,f7,Me,Qn,Bi,$n,Nf,tc,I7,bc,ie,Gi,Jn,mc,w7,hf,sc,d7,xc,ru,E7,zi,Ac,qn,Pu,i7,hu,Qf,P7,ci,g7,V1,hi,tu,p7,h7,bi,lu,ti,di,K7,yc,Mu,gi,Jf,Ee,c7,nu,z1,Yn,Ec,Oi,Xi,Eu,Dc,Uf,pf,$c,Ci,of,ou,Bu,Zf,au,If,gu,$f,Yu,Cc,kc,zn,nf,Tc,oi,ni,Pf,os,Ff,Sf,uf,Vu,Uu,Cu,_f,O7,Yc,ns,k7,xi,_7,W7,cc,U7,wf,Lu,G7,oc,r7,li,kf,fi,Un,Qc,L7,af,fc,ju,K1,Ue,C7,q7,Ic,yf,Ye,Xe,x7,Kc,qu,a7,rs,Te,H7,ss,Af,Gf,Wf,Rn,xu,Ei,Su,su,fs,zc,Gn,Mi,Kf,Sc,b7,Uc,Gu,uu,Ln,gf,pc,gc,Vf,rf,j7,Kn,Wu,si,Q7,n7,ai,R7,Bn,Pi,Tu,vf,e7,m7,Mn,qf,du,Fu,jf,Ku,wu,Hi,Ki,Bf,rn,l7,Ru,ei,Wn,Dn,Nu,_i,zu,fu,Ui,Rc,Du,S7,pu,Of,Wi,u7,mu,tf,B7,Fn,vi,N7,n1,ki,Ji,Bc,xs,yu,ff,o7,Le,cf,ts,$i,ji,ec,Li,Fc,ic,Vc,as,Ti,sf,Wc,Xf,an,Gc,Ou,dc,Df,zf,Xc,Qu,Cf,ze,_c,ce,Yi,qi,cu,df,y7,jc,eu,Zn,Nc],kb0=[0,lf,rn,Qf,zi,_c,vi,gu,mu,r7,$c,ti,N7,R7,an,Pc,H7,ze,vs,ci,Di,s7,ei,n7,kf,du,Ou,bf,Mu,fi,pi,Ku,O7,Rf,Wf,k7,wi,of,U7,Ji,W7,Ff,Ai,fc,Un,ts,oc,Lf,cu,B7,Uc,jc,zu,Gi,Yi,Le,Xe,Xc,Uf,tu,Oi,ou,Zi,ai,Ac,si,lc,ec,Dn,Ru,Ki,Ee,P7,Tu,ku,ac,uc,Af,Cc,A7,fs,mc,Sc,Cf,vc,ji,qn,b7,as,nf,wc,Rn,n1,a7,Bc,kc,S7,ni,Tf,y7,c7,sf,ns,Ri,ui,di,Vc,Gn,ff,yu,ss,zf,cf,xu,Ju,nc,xc,_7,Bi,ii,Su,ri,e7,$7,us,bc,yi,St,Kc,D7,bi,K1,Mn,Mi,Gc,gf,bu,Gf,Yc,Hf,ce,Hi,V7,Yu,Du,Bn,yc,_i,Ei,$u,rs,T7,If,J7,I7,t7,jf,Nu,tc,M7,dc,sc,Zc,Of,af,G7,fu,xf,Zu,Tc,Yn,d7,ie,xi,Wc,ru,wu,pu,ic,Qc,w7,au,Q7,hf,ef,Kf,Fi,X7,tf,xs,wf,Xn,lu,li,Pu,ju,Nc,Nf,es,Ii,Rc,mi,x7,Hu,Bu,Lu,gi,Gu,Fu,Oc,Ln,Vi,Iu,rf,qf,Ni,Qn,Kn,pc,Df,f7,Hn,zn,is,qu,Xf,$n,qc,Te,hu,ki,Dc,oi,L7,Au,yf,Fn,v7,Ui,gc,eu,Mf,E7,$i,Xi,iu,j7,Xu,hi,Ef,Me,zc,m7,pf,i7,df,h7,Qu,Ue,g7,uu,Vu,Jc,o7,Z7,Cu,Ic,Ke,Mc,Jf,Pi,Fc,u7,Li,Zn,Ye,K7,hc,Ec,cs,vf,uf,$f,os,Vf,Jn,nu,vu,Bf,Wn,F7,Wi,Wu,q7,Pf,Uu,p7,C7,su,Ti,Eu,Ci,_f,cc,Zf,l7,Sf,V1,Y7,qi,Qi,z1],mb0="Jsoo_runtime.Error.Exn",hb0=[0,0],db0="use_strict",yb0=R9,gb0="esproposal_decorators",wb0="pattern_matching",_b0="enums",bb0="components",Tb0="Internal error: ",Eb0=[i2,"CamlinternalLazy.Undefined",ks(0)];function Sb0(x,r){var e=Cx(r)-1|0,t=0;if(e>=0)for(var u=t;;){x(Y0(r,u));var i=u+1|0;if(e===u)break;var u=i}}var Ab0=ux,Pb0=[0,0];function Ib0(x){var r=DK(0),e=yq(O),t=r.length-1,u=E2((t*8|0)+1|0),i=t-1|0,c=0;if(i>=0)for(var v=c;;){jz(u,v*8|0,S6(P2(r,v)[1+v]));var a=v+1|0;if(i===v)break;var v=a}ra(u,t*8|0,1);var l=dq(u);ra(u,t*8|0,2);var m=dq(u),h=m5(m,8),T=m5(m,0),b=m5(l,8);return gq(e,m5(l,0),b,T,h),e}for(;;){var Wq=M3($N);let x=[0,1],r=Wq;if(!(1-Gm($N,Wq,function(e){return Gm(x,1,0)&&(_v(gv(Kq),O),_v(gv(Jq),O)),d(r,0)})))break}if(M3(Pb0))throw K0([0,o5,zV],1);var aa=xC([0,ux]),bv=xC([0,ux]),$a=xC([0,Je]),Vq=zN(0,0),Nb0=2,Cb0=[0,0];function $q(x){return 2=0)for(var c=i;;){var v=(c*2|0)+3|0,a=P2(x,c)[1+c];P2(e,v)[1+v]=a;var l=c+1|0;if(u===c)break;var c=l}return[0,Nb0,e,bv[1],$a[1],0,0,aa[1],0]}function PC(x,r){var e=x[2].length-1;if(e=0)for(var u=t;;){var i=q2(x,u);r[1]=(dk*r[1]|0)+i|0;var c=u+1|0;if(e===u)break;var u=c}r[1]=r[1]&rR;var v=1073741823r)return e;var t=[0,x[1+r],e],r=r-1|0,e=t}}function jC(x,r){try{var e=aa[17].call(null,r,x[7]);return e}catch(i){var t=B2(i);if(t!==ms)throw K0(t,0);var u=x[1];return x[1]=u+1|0,P(r,H0)&&(x[7]=aa[2].call(null,r,u,x[7])),u}}function OC(x){return Y3(x,0)?[0]:x}function DC(x,r,e,t,u,i){var c=u[2],v=u[4],a=CC(r),l=CC(e),m=CC(t),h=dn(function(e0){return J6(x,e0)},l),T=dn(function(e0){return J6(x,e0)},m);x[5]=[0,[0,x[3],x[4],x[6],x[7],h,a],x[5]],x[7]=aa[24].call(null,function(e0,f0,a0){return ZN(e0,a)?aa[2].call(null,e0,f0,a0):a0},x[7],aa[1]);var b=[0,bv[1]],N=[0,$a[1]];$M(function(e0,f0){b[1]=bv[2].call(null,e0,f0,b[1]);var a0=N[1];try{var Z=$a[17].call(null,f0,x[4]),v0=Z}catch(y0){var t0=B2(y0);if(t0!==ms)throw K0(t0,0);var v0=1}N[1]=$a[2].call(null,f0,v0,a0)},m,T),$M(function(e0,f0){b[1]=bv[2].call(null,e0,f0,b[1]),N[1]=$a[2].call(null,f0,0,N[1])},l,h),x[3]=b[1],x[4]=N[1],x[6]=HN(function(e0,f0){return ZN(e0[1],h)?f0:[0,e0,f0]},x[6],0);var C=i?d(c(x),v):c(x),I=D6(x[5]),F=I[6],M=I[5],Y=I[4],q=I[3],K=I[2],u0=I[1];x[5]=VM(x[5]),x[7]=m1(function(e0,f0){var a0=aa[17].call(null,f0,x[7]);return aa[2].call(null,f0,a0,e0)},Y,F),x[3]=u0,x[4]=K,x[6]=HN(function(e0,f0){return ZN(e0[1],M)?f0:[0,e0,f0]},x[6],q);var Q=[0,h5(function(e0){var f0=J6(x,e0);try{for(var a0=x[6];;){if(!a0)throw K0(ms,1);var Z=a0[1],v0=a0[2],t0=Z[2];if(dM(Z[1],f0)===0)return t0;var a0=v0}}catch(n0){var y0=B2(n0);if(y0===ms)return P2(x[2],f0)[1+f0];throw K0(y0,0)}},OC(t)),0];return bz([0,[0,C],[0,h5(function(e0){try{var f0=aa[17].call(null,e0,x[7]);return f0}catch(Z){var a0=B2(Z);throw a0===ms?K0([0,Ir,KV],1):K0(a0,0)}},OC(r)),Q]])}function T5(x,r){if(x===0)var e=Qq([0]);else{var t=Qq(h5(jb0,x)),u=x.length-1-1|0,i=0;if(u>=0)for(var c=i;;){var v=(c*2|0)+2|0;t[3]=bv[2].call(null,x[1+c],v,t[3]),t[4]=$a[2].call(null,v,1,t[4]);var a=c+1|0;if(u===c)break;var c=a}var e=t}var l=r(e);return e[8]=tx(e[8]),PC(e,3+((P2(e[2],1)[2]*16|0)/32|0)|0),[0,d(l,0),r,,0]}function E5(x,r){if(x)return x;var e=zN(i2,r[1]);return e[1]=r[2],PK(e)}function FC(x,r,e){if(x)return r;var t=e[8];if(t!==0)for(var u=t;u;){var i=u[2];d(u[1],r);var u=i}return r}function S5(x){var r=IC(x);x:{if((r%2|0)!==0&&(2+((P2(x[2],1)[2]*16|0)/32|0)|0)>=r){var e=IC(x);break x}var e=r}return P2(x[2],e)[1+e]=0,e}function RC(x,r){for(var e=[0,0],t=r.length-1;;){if(e[1]>=t)return;var u=e[1],i=function(V0){e[1]++;var N0=e[1];return P2(r,N0)[1+N0]},c=P2(r,u)[1+u],v=i(O);if(typeof v=="number")switch(v){case 0:let V0=i(O);var C0=function(sx){return V0};break;case 1:let N0=i(O);var C0=function(sx){return sx[1+N0]};break;case 2:var a=i(O);let rx=a,xx=i(O);var C0=function(sx){return sx[1+rx][1+xx]};break;case 3:let nx=i(O);var C0=function(sx){return d(sx[1][1+nx],sx)};break;case 4:let mx=i(O);var C0=function(sx,Sx){return sx[1+mx]=Sx,0};break;case 5:var l=i(O);let F0=l,px=i(O);var C0=function(sx){return d(F0,px)};break;case 6:var m=i(O);let dx=m,W=i(O);var C0=function(sx){return d(dx,sx[1+W])};break;case 7:var h=i(O),T=i(O);let g0=h,B=T,h0=i(O);var C0=function(sx){return d(g0,sx[1+B][1+h0])};break;case 8:var b=i(O);let _0=b,d0=i(O);var C0=function(sx){return d(_0,d(sx[1][1+d0],sx))};break;case 9:var N=i(O),C=i(O);let E0=N,U=C,Kx=i(O);var C0=function(sx){return p(E0,U,Kx)};break;case 10:var I=i(O),F=i(O);let Ix=I,z0=F,Kr=i(O);var C0=function(sx){return p(Ix,z0,sx[1+Kr])};break;case 11:var M=i(O),Y=i(O),q=i(O);let S=M,G=Y,Z0=q,yx=i(O);var C0=function(sx){return p(S,G,sx[1+Z0][1+yx])};break;case 12:var K=i(O),u0=i(O);let Tx=K,ex=u0,m0=i(O);var C0=function(sx){return p(Tx,ex,d(sx[1][1+m0],sx))};break;case 13:var Q=i(O),e0=i(O);let Dx=Q,Ex=e0,qx=i(O);var C0=function(sx){return p(Dx,sx[1+Ex],qx)};break;case 14:var f0=i(O),a0=i(O),Z=i(O);let O0=f0,Wx=a0,Yx=Z,fx=i(O);var C0=function(sx){return p(O0,sx[1+Wx][1+Yx],fx)};break;case 15:var v0=i(O),t0=i(O);let Qx=v0,vx=t0,nr=i(O);var C0=function(sx){return p(Qx,d(sx[1][1+vx],sx),nr)};break;case 16:var y0=i(O);let gr=y0,Nr=i(O);var C0=function(sx){return p(sx[1][1+gr],sx,Nr)};break;case 17:var n0=i(O);let s2=n0,b2=i(O);var C0=function(sx){return p(sx[1][1+s2],sx,sx[1+b2])};break;case 18:var s0=i(O),l0=i(O);let k2=s0,F2=l0,jx=i(O);var C0=function(sx){return p(sx[1][1+k2],sx,sx[1+F2][1+jx])};break;case 19:var w0=i(O);let _=w0,$=i(O);var C0=function(sx){var Sx=d(sx[1][1+$],sx);return p(sx[1][1+_],sx,Sx)};break;case 20:var L0=i(O),I0=i(O);S5(x);let ix=L0,U0=I0;var C0=function(sx){return d(Xx(U0,ix,0),U0)};break;case 21:var j0=i(O),S0=i(O);S5(x);let cx=j0,wx=S0;var C0=function(sx){var Sx=sx[1+wx];return d(Xx(Sx,cx,0),Sx)};break;case 22:var W0=i(O),A0=i(O),J0=i(O);S5(x);let Or=W0,Hx=A0,x2=J0;var C0=function(sx){var Sx=sx[1+Hx][1+x2];return d(Xx(Sx,Or,0),Sx)};break;default:var b0=i(O),z=i(O);S5(x);let hr=b0,Dr=z;var C0=function(sx){var Sx=d(sx[1][1+Dr],sx);return d(Xx(Sx,hr,0),Sx)}}else var C0=v;Hq(x,c,C0),e[1]++}}function Zq(x,r){var e=r.length-1,t=zN(0,e),u=e-1|0,i=0;if(u>=0)for(var c=i;;){var v=P2(r,c)[1+c];if(typeof v=="number")switch(v){case 0:let N=c;var a=function(Y){var q=t[1+N];if(C===q)throw K0([0,C6,x],1);return d(q,Y)};let C=a;var h=a;break;case 1:var l=[];let I=l,F=c;Rr(l,[I3,function(Y){var q=t[1+F];if(I===q)throw K0([0,C6,x],1);var K=hv(q);if(R3===K)return q[1];if(I3!==K&&Go!==K)return q;if(nK(q)!==0)throw K0(Eb0,1);var u0=q[1];q[1]=0;try{var Q=d(u0,0);return q[1]=Q,uK(q),Q}catch(f0){var e0=B2(f0);throw q[1]=function(a0){throw K0(e0,0)},tK(q),K0(e0,0)}}]);var h=l;break;default:var m=function(Y){throw K0([0,C6,x],1)},h=[0,m,m,m,0]}else var h=v[0]===0?Zq(x,v[1]):v[1];t[1+c]=h;var T=c+1|0;if(u===c)break;var c=T}return t}function xB(x,r,e){if(hv(e)===0&&x.length-1<=e.length-1){var t=x.length-1-1|0,u=0;if(t>=0)for(var i=u;;){var c=e[1+i],v=P2(x,i)[1+i];x:if(typeof v=="number"){if(v===2){if(hv(c)===0&&c.length-1===4){for(var a=0,l=r[1+i];;){l[1+a]=c[1+a];var m=a+1|0;if(a===3)break;var a=m}break x}throw K0([0,Ir,JV],1)}r[1+i]=c}else v[0]===0&&xB(v[1],r[1+i],c);var h=i+1|0;if(t===i)break;var i=h}return}throw K0([0,Ir,GV],1)}try{var Db0=FM("TMPDIR"),LC=Db0}catch(x){var rB=B2(x);if(rB!==ms)throw K0(rB,0);var LC=WV}var Fb0=[0,,,,,,,,,,LC];try{var Rb0=FM("TEMP"),eB=Rb0}catch(x){var tB=B2(x);if(tB!==ms)throw K0(tB,0);var eB=VV}var Lb0=[0,,,,,,,,,,eB],Mb0=[0,,,,,,,,,,LC],qb0=P(JM,ZD)?P(JM,"Win32")?Fb0:Lb0:Mb0,Bb0=qb0[10];hs(0,Ib0),hs([0,function(x){return x}],function(x){return Bb0});function ds(x,r){function e(t){return at(x,t)}return v6<=r?(e(b3|r>>>18|0),e(M2|(r>>>12|0)&63),e(M2|(r>>>6|0)&63),e(M2|r&63)):c_<=r?(e(qo|r>>>12|0),e(M2|(r>>>6|0)&63),e(M2|r&63)):M2<=r?(e(v3|r>>>6|0),e(M2|r&63)):e(r)}var Qa=[i2,HV,ks(0)],nB=0,uB=0,iB=0,fB=0,cB=0,sB=0,aB=0,oB=0,vB=0,lB=0;function y(x){if(x[3]===x[2])return-1;var r=x[1][1+x[3]];return x[3]=x[3]+1|0,r===10&&(x[5]!==0&&(x[5]=x[5]+1|0),x[4]=x[3]),r}function V(x,r){x[9]=x[3],x[10]=x[4],x[11]=x[5],x[12]=r}function or(x){return x[6]=x[3],x[7]=x[4],x[8]=x[5],V(x,-1)}function w(x){return x[3]=x[9],x[4]=x[10],x[5]=x[11],x[12]}function el(x){x[3]=x[6],x[4]=x[7],x[5]=x[8]}function MC(x,r){x[6]=r}function A5(x){return x[3]-x[6]|0}function l2(x){var r=x[3]-x[6]|0,e=x[6],t=x[1];return 0<=e&&0<=r&&(t.length-1-r|0)>=e?Tz(t,e,r):R1(YV)}function pB(x){var r=x[6];return P2(x[1],r)[1+r]}function G6(x,r,e,t){for(var u=[0,r],i=[0,e],c=[0,0];;){if(0>=i[1])return c[1];var v=x[1+u[1]];if(0>v)throw K0(Qa,1);if(Xr>>18|0),Yr(t,c[1]+1|0,M2|(v>>>12|0)&63),Yr(t,c[1]+2|0,M2|(v>>>6|0)&63),Yr(t,c[1]+3|0,M2|v&63),c[1]=c[1]+4|0}else Yr(t,c[1],qo|v>>>12|0),Yr(t,c[1]+1|0,M2|(v>>>6|0)&63),Yr(t,c[1]+2|0,M2|v&63),c[1]=c[1]+3|0;else Yr(t,c[1],v3|v>>>6|0),Yr(t,c[1]+1|0,M2|v&63),c[1]=c[1]+2|0;else Yr(t,c[1],v),c[1]++;u[1]++,i[1]+=-1}}function kB(x){for(var r=Cx(x),e=Wa(r,0),t=[0,0],u=[0,0];;){if(t[1]>=r)return[0,e,u[1],lB,vB,oB,aB,sB,cB,fB,iB,uB,nB];var i=Y0(x,t[1]);x:{if(v3<=i){if(b3>i){if(qo>i){var c=Y0(x,t[1]+1|0);if((c>>>6|0)!==2)throw K0(Qa,1);e[1+u[1]]=(i&31)<<6|c&63,t[1]=t[1]+2|0;break x}var v=Y0(x,t[1]+1|0),a=Y0(x,t[1]+2|0),l=(i&15)<<12|(v&63)<<6|a&63,m=(v>>>6|0)!==2?1:0,h=m||((a>>>6|0)!==2?1:0);if(h)var b=h;else var T=55296<=l?1:0,b=T&&(l<=57343?1:0);if(b)throw K0(Qa,1);e[1+u[1]]=l,t[1]=t[1]+3|0;break x}if(i2>i){var N=Y0(x,t[1]+1|0),C=Y0(x,t[1]+2|0),I=Y0(x,t[1]+3|0),F=(N>>>6|0)!==2?1:0;if(F)var Y=F;else var M=(C>>>6|0)!==2?1:0,Y=M||((I>>>6|0)!==2?1:0);if(Y)throw K0(Qa,1);var q=(i&7)<<18|(N&63)<<12|(C&63)<<6|I&63;if(tki){e[1+u[1]]=i,t[1]++;break x}throw K0(Qa,1)}u[1]++}}function W6(x,r,e){var t=x[6]+r|0,u=E2(e*4|0),i=x[1];if((t+e|0)<=i.length-1)return V3(u,0,G6(i,t,e,u));throw K0([0,Ir,QV],1)}function Ox(x){var r=x[6],e=x[3]-r|0,t=E2(e*4|0);return V3(t,0,G6(x[1],r,e,t))}function P5(x,r){var e=x[6],t=x[3]-e|0,u=E2(t*4|0);return uC(r,u,0,G6(x[1],e,t,u))}function V6(x){var r=x.length-1,e=E2(r*4|0);return V3(e,0,G6(x,0,r,e))}function mB(x,r){x[3]=x[3]-r|0}function ys(x){return typeof x=="number"?0:x[0]===0?1:x[1]}function Tv(x,r,e,t){var u=ys(x),i=ys(t),c=i<=u?u+1|0:i+1|0;return c===1?[0,r,e]:[1,c,r,e,x,t]}function I5(x,r,e,t){var u=ys(x),i=ys(t),c=i<=u?u+1|0:i+1|0;return[1,c,r,e,x,t]}function hB(x,r,e,t){var u=ys(x),i=ys(t);if((i+2|0)=i)return Tv(x,r,e,t);var C=t[5],I=t[4],F=t[3],M=t[2],Y=ys(I);if(Y<=ys(C))return I5(Tv(x,r,e,I),M,F,C);var q=I[4],K=I[3],u0=I[2],Q=Tv(I[5],M,F,C);return I5(Tv(x,r,e,q),u0,K,Q)}function Ha(x){return typeof x=="number"?0:x[0]===0?1:x[1]}function oa(x,r,e){x:{r:{if(typeof x=="number"){if(typeof e=="number")return[0,r];if(e[0]===1)break r}else{if(x[0]!==0){var t=x[1];if(typeof e!="number"&&e[0]===1){var u=e[1],i=u<=t?t+1|0:u+1|0;return[1,i,r,x,e]}var c=t;break x}if(typeof e!="number"&&e[0]===1)break r}return[1,2,r,x,e]}var c=e[1]}return[1,c+1|0,r,x,e]}function N5(x,r,e){var t=Ha(x),u=Ha(e),i=u<=t?t+1|0:u+1|0;return[1,i,r,x,e]}function dB(x,r,e){var t=Ha(x),u=Ha(e);if((u+2|0)=u)return oa(x,r,e);var T=e[4],b=e[3],N=e[2],C=Ha(b);if(C<=Ha(T))return N5(oa(x,r,b),N,T);var I=b[3],F=b[2],M=oa(b[4],N,T);return N5(oa(x,r,I),F,M)}var qC=0;function yB(x){function r(e,t){if(typeof t=="number")return[0,e];if(t[0]===0){var u=t[1],i=p(x[1],e,u);return i===0?t:0<=i?oa(t,e,qC):oa([0,e],u,qC)}var c=t[4],v=t[3],a=t[2],l=p(x[1],e,a);if(l===0)return t;if(0<=l){var m=r(e,c);return c===m?t:dB(v,a,m)}var h=r(e,v);return v===h?t:dB(h,a,c)}return[0,qC,,function(e,t){for(var u=t;;){if(typeof u=="number")return 0;if(u[0]===0)return p(x[1],e,u[1])===0?1:0;var i=u[4],c=u[3],v=p(x[1],e,u[2]),a=v===0?1:0;if(a)return a;var l=0<=v?i:c,u=l}},r]}function gB(x){switch(x[0]){case 0:return 1;case 1:return 2;case 2:return 2;default:return 3}}function Px(x,r){if(!r)return r;var e=r[1],t=d(x,e);return e===t?r:[0,t]}function D0(x,r,e,t,u){var i=p(x,r,e);return e===i?t:u(i)}function P0(x,r,e,t){var u=d(x,r);return r===u?e:t(u)}function W2(x,r){var e=r[1];return D0(x,e,r[2],r,function(t){return[0,e,t]})}function $6(x,r){return Px(function(e){var t=e[1];return D0(x,t,e[2],e,function(u){return[0,t,u]})},r)}function fr(x,r){var e=m1(function(u,i){var c=u[2],v=u[1],a=d(x,i),l=c||(a!==i?1:0);return[0,[0,a,v],l]},N$,r),t=e[1];return e[2]?tx(t):r}var BC=T5(j$,function(x){var r=NC(x,C$),e=r[1],t=r[2],u=r[3],i=r[4],c=r[5],v=r[6],a=r[7],l=r[8],m=r[9],h=r[10],T=r[11],b=r[12],N=r[13],C=r[14],I=r[15],F=r[16],M=r[17],Y=r[18],q=r[19],K=r[20],u0=r[21],Q=r[22],e0=r[23],f0=r[24],a0=r[25],Z=r[26],v0=r[27],t0=r[28],y0=r[29],n0=r[30],s0=r[31],l0=r[32],w0=r[33],L0=r[34],I0=r[35],j0=r[36],S0=r[37],W0=r[38],A0=r[39],J0=r[40],b0=r[41],z=r[42],C0=r[43],V0=r[44],N0=r[45],rx=r[46],xx=r[47],nx=r[48],mx=r[49],F0=r[50],px=r[51],dx=r[52],W=r[53],g0=r[54],B=r[55],h0=r[56],_0=r[57],d0=r[58],E0=r[60],U=r[61],Kx=r[62],Ix=r[63],z0=r[64],Kr=r[65],S=r[66],G=r[67],Z0=r[68],yx=r[69],Tx=r[70],ex=r[71],m0=r[72],Dx=r[73],Ex=r[74],qx=r[75],O0=r[76],Wx=r[77],Yx=r[78],fx=r[79],Qx=r[80],vx=r[81],nr=r[82],gr=r[83],Nr=r[84],s2=r[85],b2=r[86],k2=r[87],F2=r[88],jx=r[89],_=r[90],$=r[91],ix=r[92],U0=r[93],cx=r[94],wx=r[95],Or=r[96],Hx=r[97],x2=r[98],hr=r[99],Dr=r[y2],r2=r[se],sx=r[cn],Sx=r[F1],Zx=r[ft],Ur=r[Pt],Y2=r[vn],pe=r[K2],j1=r[Hs],kt=r[Vn],zt=r[w1],O1=r[G1],q1=r[Qs],T2=r[J1],En=r[kr],Sn=r[iv],Ss=r[av],ke=r[F3],Qe=r[f6],vo=r[h3],mt=r[mf],dr=r[y6],lo=r[c2],As=r[en],ga=r[P3],Uv=r[qa],Kt=r[Ik],An=r[Xr],wa=r[M2],po=r[Ko],ko=r[w6],_a=r[u6],ba=r[u8],Ta=r[Ek],mo=r[TR],me=r[aR],Q2=r[OD],Ea=r[QO],Pn=r[XL],ho=r[mT],yo=r[DL],Ps=r[NR],go=r[ZL],wl=r[KR],Xv=r[144],Yv=r[145],wo=r[146],_o=r[147],Sa=r[148],bo=r[149],_l=r[150],ht=r[151],E4=r[ER],Aa=r[153],$h=r[154],zv=r[155],bl=r[156],Tl=r[157],To=r[JD],S4=r[159],A4=r[EL],Qh=r[cL],Hh=r[UR],Zh=r[lr],P4=r[dD],I4=r[EF],N4=r[rD],El=r[gF],X=r[SL],A=r[Rg],D=r[J4],c0=r[Kw],k0=r[rF],M0=r[AR],$0=r[RL],lx=r[qD],Nx=r[KF],Fx=r[fA],ur=r[gD],Jx=r[GL],xr=r[PD],ar=r[N8],er=r[Ey],yr=r[Q9],Cr=r[pm],Rx=r[Ed],Lr=r[dA],Tr=r[sg],e2=r[J9],m2=r[M8],h2=r[ZT],Fr=r[EP],d2=r[v3],t2=r[hD],Er=r[CI],Sr=r[DF],a2=r[MA],qr=r[ID],Qr=r[FL],z2=r[gL],Mr=r[hL],n2=r[fF],o2=r[eD],f2=r[RO],N2=r[AT],he=r[mR],ee=r[kk],He=r[yF],B1=r[DO],u2=r[eF],te=r[nD],R2=r[pD],dt=r[nF],D1=r[tD],yt=r[LL],Jt=r[Eg],Ze=r[wd],xt=r[hR],gt=r[dO],wt=r[rL],Ax=r[K_],Z2=r[QF],de=r[zO],je=r[dk],rt=r[qo],et=r[xF],tt=r[$F],x1=r[SR],_t=r[KO],bt=r[pL],Is=r[vF],Ns=r[BO],In=r[hO],v1=r[fL],Gt=r[kL],U1=r[IR],Oe=r[jR],Wt=r[_L],Cs=r[zF],Nn=r[Uy],js=r[b3],nt=r[bF],Vt=r[GR],Tt=r[XR],$t=r[Go],De=r[eE],Os=r[I3],Ds=r[ip],Kv=r[i2],Eo=r[QE],So=r[R3],Jv=r[WL],Gv=r[_3],Wv=r[hE],Vv=r[g3],Ao=r[xk],Sl=r[e6],Al=r[257],Pa=r[258],Po=r[TL],$v=r[WF],Pl=r[261],Cn=r[262],Qv=r[263],Hv=r[264],Il=r[265],Io=r[266],Zv=r[jD],x3=r[268],Ia=r[269],Fs=r[270],Na=r[271],Nl=r[yD],No=r[fD],Co=r[274],r3=r[275],Cl=r[vL],jo=r[277],Rs=r[sF],Oo=r[Hk],e3=r[IO],Ca=r[281],t3=r[aD],n3=r[283],u3=r[284],ye=r[285],X1=r[286],i3=r[GD],Do=r[VD],jl=r[289],Ol=r[290],Fo=r[291],Ro=r[AF],Dl=r[293],Fl=r[HL],xd=r[295],Rl=r[296],rd=r[297],Qt=r[YL],jn=r[299],Lo=r[300],C4=r[MD],ja=r[302],Ll=r[AD],ed=r[AO],td=r[305],f3=r[306],j4=r[307],nd=r[BF],ud=r[309],id=r[CO],Ml=r[nL];return RC(x,[0,r[59],function(n,s){var f=s[2],o=f[4],k=f[3],g=f[1],E=f[2],j=s[1],R=p(n[1][1+j0],n,g),H=p(n[1][1+z],n,k),p0=fr(d(n[1][1+Co],n),o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,E,H,p0]]},F0,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return D0(d(n[1][1+Qt],n),o,k,s,function(ax){return[0,o,[0,ax]]});case 1:var g=f[1];return D0(d(n[1][1+xd],n),o,g,s,function(ax){return[0,o,[1,ax]]});case 2:var E=f[1];return D0(d(n[1][1+X1],n),o,E,s,function(ax){return[0,o,[2,ax]]});case 3:var j=f[1];return D0(d(n[1][1+Nl],n),o,j,s,function(ax){return[0,o,[3,ax]]});case 4:var R=f[1];return D0(d(n[1][1+Al],n),o,R,s,function(ax){return[0,o,[4,ax]]});case 5:var H=f[1];return D0(d(n[1][1+Sl],n),o,H,s,function(ax){return[0,o,[5,ax]]});case 6:var p0=f[1];return D0(d(n[1][1+Ao],n),o,p0,s,function(ax){return[0,o,[6,ax]]});case 7:var R0=f[1];return D0(d(n[1][1+Vv],n),o,R0,s,function(ax){return[0,o,[7,ax]]});case 8:var kx=f[1];return D0(d(n[1][1+Wv],n),o,kx,s,function(ax){return[0,o,[8,ax]]});case 9:var Bx=f[1];return D0(d(n[1][1+Gv],n),o,Bx,s,function(ax){return[0,o,[9,ax]]});case 10:var zx=f[1];return D0(d(n[1][1+So],n),o,zx,s,function(ax){return[0,o,[10,ax]]});case 11:var wr=f[1];return D0(d(n[1][1+Eo],n),o,wr,s,function(ax){return[0,o,[11,ax]]});case 12:var Jr=f[1];return D0(d(n[1][1+Kv],n),o,Jr,s,function(ax){return[0,o,[12,ax]]});case 13:var Hr=f[1];return D0(d(n[1][1+Ds],n),o,Hr,s,function(ax){return[0,o,[13,ax]]});case 14:var Vx=f[1];return D0(d(n[1][1+Os],n),o,Vx,s,function(ax){return[0,o,[14,ax]]});case 15:var C2=f[1];return D0(d(n[1][1+De],n),o,C2,s,function(ax){return[0,o,[15,ax]]});case 16:var r1=f[1];return D0(d(n[1][1+F2],n),o,r1,s,function(ax){return[0,o,[16,ax]]});case 17:var ne=f[1];return D0(d(n[1][1+$t],n),o,ne,s,function(ax){return[0,o,[17,ax]]});case 18:var Y1=f[1];return D0(d(n[1][1+Vt],n),o,Y1,s,function(ax){return[0,o,[18,ax]]});case 19:var ge=f[1];return D0(d(n[1][1+nt],n),o,ge,s,function(ax){return[0,o,[19,ax]]});case 20:var Fe=f[1];return D0(d(n[1][1+U1],n),o,Fe,s,function(ax){return[0,o,[20,ax]]});case 21:var we=f[1];return D0(d(n[1][1+tt],n),o,we,s,function(ax){return[0,o,[21,ax]]});case 22:var ue=f[1];return D0(d(n[1][1+rt],n),o,ue,s,function(ax){return[0,o,[22,ax]]});case 23:var _e=f[1];return D0(d(n[1][1+gt],n),o,_e,s,function(ax){return[0,o,[23,ax]]});case 24:var ut=f[1];return D0(d(n[1][1+B1],n),o,ut,s,function(ax){return[0,o,[24,ax]]});case 25:var be=f[1];return D0(d(n[1][1+Jt],n),o,be,s,function(ax){return[0,o,[25,ax]]});case 26:var Ht=f[1];return D0(d(n[1][1+te],n),o,Ht,s,function(ax){return[0,o,[26,ax]]});case 27:var Ls=f[1];return D0(d(n[1][1+f2],n),o,Ls,s,function(ax){return[0,o,[27,ax]]});case 28:var On=f[1];return D0(d(n[1][1+er],n),o,On,s,function(ax){return[0,o,[28,ax]]});case 29:var Ms=f[1];return D0(d(n[1][1+xr],n),o,Ms,s,function(ax){return[0,o,[29,ax]]});case 30:var Et=f[1];return D0(d(n[1][1+c0],n),o,Et,s,function(ax){return[0,o,[30,ax]]});case 31:var qs=f[1];return D0(d(n[1][1+yo],n),o,qs,s,function(ax){return[0,o,[31,ax]]});case 32:var c3=f[1];return D0(d(n[1][1+As],n),o,c3,s,function(ax){return[0,o,[32,ax]]});case 33:var s3=f[1];return D0(d(n[1][1+g0],n),o,s3,s,function(ax){return[0,o,[33,ax]]});case 34:var a3=f[1];return D0(d(n[1][1+N0],n),o,a3,s,function(ax){return[0,o,[34,ax]]});case 35:var o3=f[1];return D0(d(n[1][1+S0],n),o,o3,s,function(ax){return[0,o,[35,ax]]});case 36:var Oa=f[1];return D0(d(n[1][1+L0],n),o,Oa,s,function(ax){return[0,o,[36,ax]]});case 37:var _x=f[1];return D0(d(n[1][1+v0],n),o,_x,s,function(ax){return[0,o,[37,ax]]});case 38:var O4=f[1];return D0(d(n[1][1+F2],n),o,O4,s,function(ax){return[0,o,[38,ax]]});case 39:var hx=f[1];return D0(d(n[1][1+l],n),o,hx,s,function(ax){return[0,o,[39,ax]]});case 40:var D4=f[1];return D0(d(n[1][1+u],n),o,D4,s,function(ax){return[0,o,[40,ax]]});default:var nO=f[1];return D0(d(n[1][1+t],n),o,nO,s,function(ax){return[0,o,[41,ax]]})}},Co,function(n,s){return s},z,function(n){var s=d(n[1][1+C0],n);return function(f){return Px(s,f)}},C0,function(n,s){var f=s[2],o=s[1],k=s[3],g=fr(d(n[1][1+Co],n),o),E=fr(d(n[1][1+Co],n),f);return o===g&&f===E?s:[0,g,E,k]},Ax,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return D0(d(n[1][1+id],n),o,k,s,function(hx){return[0,o,[0,hx]]});case 1:var g=f[1];return D0(d(n[1][1+j4],n),o,g,s,function(hx){return[0,o,[1,hx]]});case 2:var E=f[1];return D0(d(n[1][1+f3],n),o,E,s,function(hx){return[0,o,[2,hx]]});case 3:var j=f[1];return D0(d(n[1][1+td],n),o,j,s,function(hx){return[0,o,[3,hx]]});case 4:var R=f[1];return D0(d(n[1][1+ed],n),o,R,s,function(hx){return[0,o,[4,hx]]});case 5:var H=f[1];return D0(d(n[1][1+C4],n),o,H,s,function(hx){return[0,o,[5,hx]]});case 6:var p0=f[1];return D0(d(n[1][1+Fl],n),o,p0,s,function(hx){return[0,o,[6,hx]]});case 7:var R0=f[1];return D0(d(n[1][1+n3],n),o,R0,s,function(hx){return[0,o,[7,hx]]});case 8:var kx=f[1];return D0(d(n[1][1+Po],n),o,kx,s,function(hx){return[0,o,[8,hx]]});case 9:var Bx=f[1];return D0(d(n[1][1+o2],n),o,Bx,s,function(hx){return[0,o,[9,hx]]});case 10:var zx=f[1];return P0(d(n[1][1+Rx],n),zx,s,function(hx){return[0,o,[10,hx]]});case 11:var wr=f[1];return P0(p(n[1][1+ar],n,o),wr,s,function(hx){return[0,o,[11,hx]]});case 12:var Jr=f[1];return D0(d(n[1][1+To],n),o,Jr,s,function(hx){return[0,o,[12,hx]]});case 13:var Hr=f[1];return D0(d(n[1][1+E4],n),o,Hr,s,function(hx){return[0,o,[13,hx]]});case 14:var Vx=f[1];return D0(d(n[1][1+xx],n),o,Vx,s,function(hx){return[0,o,[14,hx]]});case 15:var C2=f[1];return D0(d(n[1][1+Rl],n),o,C2,s,function(hx){return[0,o,[15,hx]]});case 16:var r1=f[1];return D0(d(n[1][1+zt],n),o,r1,s,function(hx){return[0,o,[16,hx]]});case 17:var ne=f[1];return D0(d(n[1][1+j1],n),o,ne,s,function(hx){return[0,o,[17,hx]]});case 18:var Y1=f[1];return D0(d(n[1][1+ja],n),o,Y1,s,function(hx){return[0,o,[18,hx]]});case 19:var ge=f[1];return D0(d(n[1][1+_0],n),o,ge,s,function(hx){return[0,o,[19,hx]]});case 20:var Fe=f[1];return D0(d(n[1][1+q1],n),o,Fe,s,function(hx){return[0,o,[20,hx]]});case 21:var we=f[1];return D0(d(n[1][1+ho],n),o,we,s,function(hx){return[0,o,[21,hx]]});case 22:var ue=f[1];return D0(d(n[1][1+me],n),o,ue,s,function(hx){return[0,o,[22,hx]]});case 23:var _e=f[1];return D0(d(n[1][1+vo],n),o,_e,s,function(hx){return[0,o,[23,hx]]});case 24:var ut=f[1];return D0(d(n[1][1+T2],n),o,ut,s,function(hx){return[0,o,[24,hx]]});case 25:var be=f[1];return D0(d(n[1][1+O1],n),o,be,s,function(hx){return[0,o,[25,hx]]});case 26:var Ht=f[1];return D0(d(n[1][1+pe],n),o,Ht,s,function(hx){return[0,o,[26,hx]]});case 27:var Ls=f[1];return P0(p(n[1][1+k2],n,o),Ls,s,function(hx){return[0,o,[27,hx]]});case 28:var On=f[1];return D0(d(n[1][1+s2],n),o,On,s,function(hx){return[0,o,[28,hx]]});case 29:var Ms=f[1];return D0(d(n[1][1+W],n),o,Ms,s,function(hx){return[0,o,[29,hx]]});case 30:var Et=f[1];return D0(d(n[1][1+rx],n),o,Et,s,function(hx){return[0,o,[30,hx]]});case 31:var qs=f[1];return D0(d(n[1][1+b0],n),o,qs,s,function(hx){return[0,o,[31,hx]]});case 32:var c3=f[1];return D0(d(n[1][1+J0],n),o,c3,s,function(hx){return[0,o,[32,hx]]});case 33:var s3=f[1];return D0(d(n[1][1+W0],n),o,s3,s,function(hx){return[0,o,[33,hx]]});case 34:var a3=f[1];return D0(d(n[1][1+e0],n),o,a3,s,function(hx){return[0,o,[34,hx]]});case 35:var o3=f[1];return D0(d(n[1][1+w0],n),o,o3,s,function(hx){return[0,o,[35,hx]]});case 36:var Oa=f[1];return D0(d(n[1][1+T],n),o,Oa,s,function(hx){return[0,o,[36,hx]]});case 37:var _x=f[1];return D0(d(n[1][1+m],n),o,_x,s,function(hx){return[0,o,[37,hx]]});default:var O4=f[1];return D0(d(n[1][1+e],n),o,O4,s,function(hx){return[0,o,[38,hx]]})}},id,function(n,s,f){var o=f[2],k=f[1],g=fr(d(n[1][1+ud],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},ud,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+Ax],n),f,s,function(k){return[0,k]});case 1:var o=s[1];return P0(d(n[1][1+dx],n),o,s,function(k){return[1,k]});default:return s}},j4,function(n,s,f){return Q0(n[1][1+ee],n,s,f)},f3,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return g===k&&E===o?f:[0,g,E]},td,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Z],n,k),R=p(n[1][1+z],n,o);return E===g&&j===k&&R===o?f:[0,E,j,R]},ed,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=p(n[1][1+Ll],n,g),j=p(n[1][1+Ax],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,f[1],E,j,R]},C4,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Ax],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,f[1],E,j,R]},Qt,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+nx],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},xd,function(n,s,f){var o=f[2],k=f[1],g=Px(d(n[1][1+Ps],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},Fl,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+Ax],n,E),R=Px(d(n[1][1+Ro],n),g),H=p(n[1][1+Ml],n,k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},Ml,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+wt],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},k2,function(n,s,f){var o=f[1],k=Q0(n[1][1+Fl],n,s,o);return o===k?f:[0,k,f[2],f[3]]},Ro,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+Dl],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},Dl,function(n,s){if(s[0]===0){var f=s[1],o=p(n[1][1+t0],n,f);return o===f?s:[0,o]}var k=s[1],g=k[2][1],E=k[1],j=p(n[1][1+z],n,g);return g===j?s:[1,[0,E,[0,j]]]},Fo,function(n,s){return W2(d(n[1][1+Qt],n),s)},Ol,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=Px(d(n[1][1+jl],n),g),j=p(n[1][1+Fo],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},X1,function(n,s,f){return Q0(n[1][1+Do],n,s,f)},n3,function(n,s,f){return Q0(n[1][1+Do],n,s,f)},Do,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[4],j=f[3],R=f[2],H=f[1],p0=Px(d(n[1][1+Ca],n),H),R0=Px(d(n[1][1+M],n),j),kx=p(n[1][1+i3],n,R),Bx=d(n[1][1+t3],n),zx=Px(function(Vx){return W2(Bx,Vx)},E),wr=Px(d(n[1][1+e3],n),g),Jr=fr(d(n[1][1+ye],n),k),Hr=p(n[1][1+z],n,o);return H===p0&&R===kx&&E===zx&&g===wr&&k===Jr&&o===Hr&&j===R0?f:[0,p0,kx,R0,zx,wr,Jr,Hr]},t3,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=Px(d(n[1][1+f0],n),k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},Ca,function(n,s){return Q0(n[1][1+O0],n,m$,s)},i3,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+u3],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},ye,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},u3,function(n,s){switch(s[0]){case 0:var f=s[1],o=f[1],k=f[2];return D0(d(n[1][1+Rs],n),o,k,s,function(R0){return[0,[0,o,R0]]});case 1:var g=s[1],E=g[1],j=g[2];return D0(d(n[1][1+Cl],n),E,j,s,function(R0){return[1,[0,E,R0]]});default:var R=s[1],H=R[1],p0=R[2];return D0(d(n[1][1+jo],n),H,p0,s,function(R0){return[2,[0,H,R0]]})}},e3,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+Oo],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},Oo,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+q],n,k),j=Px(d(n[1][1+f0],n),o);return k===E&&o===j?s:[0,g,[0,E,j]]},Rs,function(n,s,f){var o=f[6],k=f[5],g=f[3],E=f[2],j=p(n[1][1+Sx],n,E),R=W2(d(n[1][1+n2],n),g),H=fr(d(n[1][1+ye],n),k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,f[1],j,R,f[4],H,p0]},Cl,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[3],j=f[2],R=f[1],H=p(n[1][1+Sx],n,R),p0=p(n[1][1+r3],n,j),R0=p(n[1][1+a0],n,E),kx=p(n[1][1+i],n,g),Bx=fr(d(n[1][1+ye],n),k),zx=p(n[1][1+z],n,o);return R===H&&j===p0&&R0===E&&kx===g&&Bx===k&&zx===o?f:[0,H,p0,R0,f[4],kx,Bx,zx]},r3,function(n,s){if(typeof s=="number")return s;var f=s[1],o=p(n[1][1+Ax],n,f);return f===o?s:[0,o]},jo,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[3],j=f[2],R=f[1],H=p(n[1][1+E0],n,R),p0=p(n[1][1+r3],n,j),R0=p(n[1][1+a0],n,E),kx=p(n[1][1+i],n,g),Bx=fr(d(n[1][1+ye],n),k),zx=p(n[1][1+z],n,o);return R===H&&j===p0&&R0===E&&kx===g&&Bx===k&&zx===o?f:[0,H,p0,R0,f[4],kx,Bx,zx]},Tt,function(n,s){return Px(d(n[1][1+Ax],n),s)},Nl,function(n,s,f){var o=f[6],k=f[5],g=f[4],E=f[3],j=f[2],R=f[1],H=f[7],p0=p(n[1][1+Na],n,R),R0=Px(d(n[1][1+M],n),j),kx=p(n[1][1+Zv],n,E),Bx=p(n[1][1+No],n,k),zx=p(n[1][1+Io],n,g),wr=p(n[1][1+z],n,o);return R===p0&&j===R0&&E===kx&&k===Bx&&g===zx&&o===wr?f:[0,p0,R0,kx,zx,Bx,wr,H]},Na,function(n,s){return Q0(n[1][1+O0],n,h$,s)},Zv,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=s[1],j=fr(d(n[1][1+Fs],n),g),R=Px(d(n[1][1+Il],n),k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?s:[0,E,[0,j,R,H]]},Fs,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=f[4],j=s[1],R=p(n[1][1+Ia],n,g),H=p(n[1][1+x3],n,k),p0=p(n[1][1+Tt],n,o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,H,p0,E]]},Ia,function(n,s){if(s[0]===0)return[0,p(n[1][1+Rx],n,s[1])];var f=s[1],o=f[1];return[1,[0,o,Q0(n[1][1+xx],n,o,f[2])]]},x3,function(n,s){return Q0(n[1][1+Lo],n,d$,s)},Il,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+x3],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},No,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+Qt],n),f,o,s,function(k){return[0,f,k]})},Po,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+U],n,E),R=p(n[1][1+Ax],n,g),H=p(n[1][1+Ax],n,k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},Al,function(n,s,f){var o=f[2],k=f[1],g=Px(d(n[1][1+Ps],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},Sl,function(n,s,f){var o=f[1],k=p(n[1][1+z],n,o);return o===k?f:[0,k]},Ao,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[4],j=f[3],R=f[2],H=f[1],p0=p(n[1][1+Ca],n,H),R0=Px(d(n[1][1+M],n),R),kx=W2(d(n[1][1+ix],n),j),Bx=d(n[1][1+Lr],n),zx=Px(function(C2){return W2(Bx,C2)},E),wr=d(n[1][1+Lr],n),Jr=fr(function(C2){return W2(wr,C2)},g),Hr=Px(d(n[1][1+e3],n),k),Vx=p(n[1][1+z],n,o);return p0===H&&R0===R&&kx===j&&zx===E&&Jr===g&&Hr===k&&Vx===o?f:[0,p0,R0,kx,zx,Jr,Hr,Vx]},Vv,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=p(n[1][1+Na],n,j),H=Px(d(n[1][1+M],n),E),p0=p(n[1][1+Cn],n,g),R0=p(n[1][1+Io],n,k),kx=p(n[1][1+z],n,o);return j===R&&E===H&&g===p0&&k===R0&&o===kx?f:[0,R,H,p0,R0,kx]},Hv,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=Px(d(n[1][1+M],n),E),R=p(n[1][1+Cn],n,g),H=p(n[1][1+Io],n,k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},Cn,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=s[1],j=fr(d(n[1][1+Qv],n),g),R=Px(d(n[1][1+Pl],n),k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?s:[0,E,[0,j,R,H]]},Qv,function(n,s){var f=s[2],o=f[2],k=f[1],g=f[3],E=s[1],j=p(n[1][1+Ia],n,k),R=p(n[1][1+Z],n,o);return k===j&&o===R?s:[0,E,[0,j,R,g]]},Pl,function(n,s){var f=s[2],o=f[4],k=f[2],g=f[1],E=f[3],j=s[1],R=Px(d(n[1][1+Rx],n),g),H=p(n[1][1+t0],n,k),p0=p(n[1][1+z],n,o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,H,E,p0]]},Wv,function(n,s,f){return Q0(n[1][1+U1],n,s,f)},Gv,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=$6(d(n[1][1+Z2],n),k),H=Px(d(n[1][1+de],n),g),p0=Px(d(n[1][1+Jv],n),E),R0=p(n[1][1+z],n,o);return k===R&&g===H&&E===p0&&o===R0?f:[0,j,p0,H,R,R0]},Jv,function(n,s){switch(s[0]){case 0:var f=s[1],o=f[2],k=f[1],g=Q0(n[1][1+$t],n,k,o);return g===o?s:[0,[0,k,g]];case 1:var E=s[1],j=E[2],R=E[1],H=Q0(n[1][1+So],n,R,j);return H===j?s:[1,[0,R,H]];case 2:var p0=s[1],R0=p0[2],kx=p0[1],Bx=Q0(n[1][1+Ao],n,kx,R0);return Bx===R0?s:[2,[0,kx,Bx]];case 3:var zx=s[1],wr=zx[2],Jr=zx[1],Hr=Q0(n[1][1+Vv],n,Jr,wr);return Hr===wr?s:[3,[0,Jr,Hr]];case 4:var Vx=s[1],C2=p(n[1][1+t0],n,Vx);return C2===Vx?s:[4,C2];case 5:var r1=s[1],ne=r1[2],Y1=r1[1],ge=Q0(n[1][1+v0],n,Y1,ne);return ge===ne?s:[5,[0,Y1,ge]];case 6:var Fe=s[1],we=Fe[2],ue=Fe[1],_e=Q0(n[1][1+F2],n,ue,we);return _e===we?s:[6,[0,ue,_e]];case 7:var ut=s[1],be=ut[2],Ht=ut[1],Ls=Q0(n[1][1+k0],n,Ht,be);return Ls===be?s:[7,[0,Ht,Ls]];default:var On=s[1],Ms=On[2],Et=On[1],qs=Q0(n[1][1+U1],n,Et,Ms);return qs===Ms?s:[8,[0,Et,qs]]}},So,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+Mr],n,E),R=p(n[1][1+Z],n,g),H=Px(d(n[1][1+Kx],n),k),p0=p(n[1][1+z],n,o);return j===E&&R===g&&H===k&&p0===o?f:[0,j,R,H,p0]},Eo,function(n,s,f){return Q0(n[1][1+k0],n,s,f)},Kv,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=W2(d(n[1][1+Qt],n),k),j=p(n[1][1+z],n,o);return E===k&&o===j?f:[0,g,E,j]},Ds,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Z],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},Os,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=Q0(n[1][1+O0],n,y$,g),j=W2(d(n[1][1+Qt],n),k),R=p(n[1][1+z],n,o);return E===g&&j===k&&o===R?f:[0,E,j,R]},De,function(n,s,f){return Q0(n[1][1+v0],n,s,f)},$t,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=Q0(n[1][1+O0],n,[0,k],E),R=p(n[1][1+Z],n,g),H=p(n[1][1+z],n,o);return j===E&&R===g&&H===o?f:[0,j,R,k,H]},Vt,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+F0],n,g),j=p(n[1][1+U],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},nt,function(n,s,f){var o=f[1],k=p(n[1][1+z],n,o);return o===k?f:[0,k]},U1,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=Q0(n[1][1+O0],n,g$,g),j=p(n[1][1+Cs],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},Cs,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return P0(d(n[1][1+Wt],n),k,s,function(H){return[0,o,[0,H]]});case 1:var g=f[1];return P0(d(n[1][1+In],n),g,s,function(H){return[0,o,[1,H]]});case 2:var E=f[1];return P0(d(n[1][1+Is],n),E,s,function(H){return[0,o,[2,H]]});case 3:var j=f[1];return P0(d(n[1][1+_t],n),j,s,function(H){return[0,o,[3,H]]});default:var R=f[1];return P0(d(n[1][1+js],n),R,s,function(H){return[0,o,[4,H]]})}},Wt,function(n,s){var f=s[4],o=s[1],k=fr(d(n[1][1+Oe],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,s[2],s[3],g]},In,function(n,s){var f=s[4],o=s[1],k=fr(d(n[1][1+Ns],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,s[2],s[3],g]},Is,function(n,s){var f=s[4],o=s[1];if(o[0]===0)var k=o[1],g=d(n[1][1+Gt],n),R=P0(function(p0){return fr(g,p0)},k,o,function(p0){return[0,p0]});else var E=o[1],j=d(n[1][1+bt],n),R=P0(function(p0){return fr(j,p0)},E,o,function(p0){return[1,p0]});var H=p(n[1][1+z],n,f);return o===R&&f===H?s:[0,R,s[2],s[3],H]},_t,function(n,s){var f=s[3],o=s[1],k=fr(d(n[1][1+Gt],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,s[2],g]},js,function(n,s){var f=s[4],o=s[1],k=fr(d(n[1][1+Nn],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,s[2],s[3],g]},Gt,function(n,s){var f=s[2][1],o=s[1],k=p(n[1][1+v1],n,f);return f===k?s:[0,o,[0,k]]},Oe,function(n,s){var f=s[2],o=f[1],k=f[2],g=s[1],E=p(n[1][1+v1],n,o);return o===E?s:[0,g,[0,E,k]]},Ns,function(n,s){var f=s[2],o=f[1],k=f[2],g=s[1],E=p(n[1][1+v1],n,o);return o===E?s:[0,g,[0,E,k]]},bt,function(n,s){var f=s[2],o=f[1],k=f[2],g=s[1],E=p(n[1][1+v1],n,o);return o===E?s:[0,g,[0,E,k]]},Nn,function(n,s){var f=s[2],o=f[1],k=f[2],g=s[1],E=p(n[1][1+v1],n,o);return o===E?s:[0,g,[0,E,k]]},v1,function(n,s){return p(n[1][1+Rx],n,s)},tt,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+et],n,k),j=p(n[1][1+z],n,o);return E===k&&j===o?f:[0,g,E,j]},et,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+F0],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Ax],n),o,s,function(k){return[1,k]})},rt,function(n,s,f){var o=f[5],k=f[3],g=f[2],E=f[1],j=f[4],R=$6(d(n[1][1+Z2],n),k),H=Px(d(n[1][1+de],n),g),p0=Px(d(n[1][1+F0],n),E),R0=p(n[1][1+z],n,o);return k===R&&g===H&&E===p0&&o===R0?f:[0,p0,H,R,j,R0]},je,function(n,s){var f=s[2],o=f[2],k=f[1],g=f[4],E=f[3],j=s[1],R=p(n[1][1+Rx],n,k),H=Px(d(n[1][1+Rx],n),o);return k===R&&o===H?s:[0,j,[0,R,H,E,g]]},x1,function(n,s){var f=s[2],o=s[1],k=Px(d(n[1][1+Rx],n),f);return f===k?s:[0,o,k]},de,function(n,s){if(s[0]===0){var f=s[1],o=fr(d(n[1][1+je],n),f);return f===o?s:[0,o]}var k=s[1],g=p(n[1][1+x1],n,k);return k===g?s:[1,g]},Z2,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},gt,function(n,s,f){var o=f[3],k=f[1],g=f[2],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?f:[0,E,g,j]},wt,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+Ax],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+dx],n),o,s,function(k){return[1,k]})},Jt,function(n,s,f){var o=f[5],k=f[3],g=f[2],E=f[1],j=f[4],R=p(n[1][1+yt],n,E),H=p(n[1][1+Ax],n,g),p0=p(n[1][1+F0],n,k),R0=p(n[1][1+z],n,o);return E===R&&g===H&&k===p0&&o===R0?f:[0,R,H,p0,j,R0]},yt,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+Ze],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+xt],n),o,s,function(k){return[1,k]})},Ze,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+l],n),f,o,s,function(k){return[0,f,k]})},te,function(n,s,f){var o=f[5],k=f[3],g=f[2],E=f[1],j=f[4],R=p(n[1][1+u2],n,E),H=p(n[1][1+Ax],n,g),p0=p(n[1][1+F0],n,k),R0=p(n[1][1+z],n,o);return E===R&&g===H&&k===p0&&o===R0?f:[0,R,H,p0,j,R0]},u2,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+R2],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+dt],n),o,s,function(k){return[1,k]})},R2,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+l],n),f,o,s,function(k){return[0,f,k]})},B1,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=Px(d(n[1][1+He],n),j),H=Px(d(n[1][1+U],n),E),p0=Px(d(n[1][1+Ax],n),g),R0=p(n[1][1+F0],n,k),kx=p(n[1][1+z],n,o);return j===R&&E===H&&g===p0&&k===R0&&o===kx?f:[0,R,H,p0,R0,kx]},He,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+D1],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Ax],n),o,s,function(k){return[1,k]})},D1,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+l],n),f,o,s,function(k){return[0,f,k]})},qr,function(n,s){var f=s[2],o=f[2],k=f[1],g=f[3],E=s[1],j=p(n[1][1+t0],n,o),R=Px(d(n[1][1+Rx],n),k);return j===o&&R===k?s:[0,E,[0,R,j,g]]},Er,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+qr],n,k),j=p(n[1][1+z],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},Fr,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Z],n,k),j=p(n[1][1+z],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},m2,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+t0],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Q],n),o,s,function(k){return[1,k]})},h2,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=g[2],j=E[4],R=E[3],H=E[2],p0=E[1],R0=f[1],kx=f[5],Bx=g[1],zx=Px(d(n[1][1+M],n),R0),wr=Px(d(n[1][1+Fr],n),p0),Jr=fr(d(n[1][1+qr],n),H),Hr=Px(d(n[1][1+Er],n),R),Vx=p(n[1][1+m2],n,k),C2=p(n[1][1+z],n,o),r1=p(n[1][1+z],n,j);return Jr===H&&Hr===R&&Vx===k&&zx===R0&&C2===o&&r1===j&&wr===p0?f:[0,zx,[0,Bx,[0,wr,Jr,Hr,r1]],Vx,C2,kx]},Ps,function(n,s){return p(n[1][1+Rx],n,s)},cx,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+t0],n),f,s,function(g){return[0,g]});case 1:var o=s[1];return P0(d(n[1][1+_],n),o,s,function(g){return[1,g]});default:var k=s[1];return P0(d(n[1][1+jx],n),k,s,function(g){return[2,g]})}},_,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+h2],n),f,o,s,function(k){return[0,f,k]})},jx,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+h2],n),f,o,s,function(k){return[0,f,k]})},wx,function(n,s){var f=s[2],o=f[8],k=f[7],g=f[2],E=f[1],j=f[6],R=f[5],H=f[4],p0=f[3],R0=s[1],kx=p(n[1][1+Sx],n,E),Bx=p(n[1][1+cx],n,g),zx=p(n[1][1+i],n,k),wr=p(n[1][1+z],n,o);return kx===E&&Bx===g&&zx===k&&wr===o?s:[0,R0,[0,kx,Bx,p0,H,R,j,zx,wr]]},U0,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+t0],n,k),j=p(n[1][1+z],n,o);return E===k&&o===j?s:[0,g,[0,E,j]]},Ur,function(n,s){var f=s[2],o=f[6],k=f[5],g=f[3],E=f[2],j=f[4],R=f[1],H=s[1],p0=p(n[1][1+t0],n,E),R0=p(n[1][1+t0],n,g),kx=p(n[1][1+i],n,k),Bx=p(n[1][1+z],n,o);return p0===E&&R0===g&&kx===k&&Bx===o?s:[0,H,[0,R,p0,R0,j,kx,Bx]]},Zx,function(n,s){var f=s[2],o=f[6],k=f[2],g=f[1],E=f[5],j=f[4],R=f[3],H=s[1],p0=p(n[1][1+Rx],n,g),R0=p(n[1][1+t0],n,k),kx=p(n[1][1+z],n,o);return g===p0&&k===R0&&o===kx?s:[0,H,[0,p0,R0,R,j,E,kx]]},Y2,function(n,s){var f=s[2],o=f[3],k=f[1],g=k[2],E=k[1],j=f[2],R=s[1],H=Q0(n[1][1+h2],n,E,g),p0=p(n[1][1+z],n,o);return g===H&&o===p0?s:[0,R,[0,[0,E,H],j,p0]]},Hx,function(n,s){var f=s[2],o=f[6],k=f[4],g=f[3],E=f[2],j=f[1],R=f[5],H=s[1],p0=p(n[1][1+Y],n,j),R0=p(n[1][1+t0],n,E),kx=p(n[1][1+t0],n,g),Bx=p(n[1][1+i],n,k),zx=p(n[1][1+z],n,o);return p0===j&&R0===E&&kx===g&&Bx===k&&zx===o?s:[0,H,[0,p0,R0,kx,Bx,R,zx]]},ix,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=fr(d(n[1][1+$],n),k),R=p(n[1][1+z],n,o);return j===k&&o===R?f:[0,E,g,j,R]},$,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+wx],n),f,s,function(R){return[0,R]});case 1:var o=s[1];return P0(d(n[1][1+U0],n),o,s,function(R){return[1,R]});case 2:var k=s[1];return P0(d(n[1][1+Ur],n),k,s,function(R){return[2,R]});case 3:var g=s[1];return P0(d(n[1][1+Y2],n),g,s,function(R){return[3,R]});case 4:var E=s[1];return P0(d(n[1][1+Zx],n),E,s,function(R){return[4,R]});default:var j=s[1];return P0(d(n[1][1+Hx],n),j,s,function(R){return[5,R]})}},D,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=d(n[1][1+Lr],n),j=fr(function(p0){return W2(E,p0)},k),R=W2(d(n[1][1+ix],n),g),H=p(n[1][1+z],n,o);return j===k&&R===g&&o===H?f:[0,R,j,H]},e2,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+q],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Tr],n),o,s,function(k){return[1,k]})},Tr,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+e2],n,k),j=p(n[1][1+En],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},En,function(n,s){return p(n[1][1+Rx],n,s)},c,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+z],n,o);return o===E?s:[0,g,[0,k,E]]},i,function(n,s){return Px(d(n[1][1+c],n),s)},I0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+z],n,f);return f===k?s:[0,o,k]},f0,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+t0],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},M,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+Y],n),k),j=p(n[1][1+z],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},Y,function(n,s){var f=s[2],o=f[6],k=f[5],g=f[4],E=f[2],j=f[1],R=f[3],H=s[1],p0=p(n[1][1+a0],n,E),R0=p(n[1][1+i],n,g),kx=Px(d(n[1][1+t0],n),k),Bx=Px(d(n[1][1+I0],n),o),zx=p(n[1][1+jn],n,j);return zx===j&&p0===E&&R0===g&&kx===k&&Bx===o?s:[0,H,[0,zx,p0,R,R0,kx,Bx]]},Lr,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+e2],n,g),j=Px(d(n[1][1+f0],n),k),R=p(n[1][1+z],n,o);return E===g&&j===k&&R===o?f:[0,E,j,R]},$0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+t0],n,g),j=p(n[1][1+t0],n,k),R=p(n[1][1+z],n,o);return E===g&&j===k&&R===o?f:[0,E,j,R]},b2,function(n,s,f){var o=f[1],k=f[2],g=Q0(n[1][1+$0],n,s,o);return g===o?f:[0,g,k]},xx,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},j1,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},ja,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},Rl,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+z],n,o);return o===g?f:[0,k,g]},zt,function(n,s,f){return p(n[1][1+z],n,f)},_0,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+z],n,o);return o===j?f:[0,E,g,k,j]},q1,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[4],j=f[3],R=f[2],H=f[1];return o===p(n[1][1+z],n,o)?f:[0,H,R,j,E,g,k,o]},kt,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},Pa,function(n,s){var f=s[5],o=s[4],k=s[3],g=s[2],E=s[1],j=p(n[1][1+t0],n,E),R=p(n[1][1+t0],n,g),H=p(n[1][1+t0],n,k),p0=p(n[1][1+t0],n,o),R0=p(n[1][1+z],n,f);return E===j&&g===R&&k===H&&o===p0&&f===R0?s:[0,j,R,H,p0,R0]},M0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+Y],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},b,function(n,s){var f=s[3],o=s[2],k=s[1],g=p(n[1][1+F],n,k),E=Px(d(n[1][1+f0],n),o),j=p(n[1][1+z],n,f);return k===g&&Y3(o,E)&&f===j?s:[0,g,E,j]},F,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+I],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+N],n),o,s,function(k){return[1,k]})},I,function(n,s){return p(n[1][1+Rx],n,s)},C,function(n,s){return p(n[1][1+Rx],n,s)},N,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+F],n,k),j=p(n[1][1+C],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},go,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},B,function(n,s){var f=s[3],o=s[2],k=s[4],g=s[1],E=p(n[1][1+t0],n,o),j=p(n[1][1+z],n,f);return o===E&&f===j?s:[0,g,E,j,k]},d0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},y0,function(n,s){var f=s[3],o=s[1],k=s[2],g=fr(d(n[1][1+l0],n),o),E=p(n[1][1+z],n,f);return o===g&&f===E?s:[0,g,k,E]},l0,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return P0(d(n[1][1+t0],n),k,s,function(j){return[0,o,[0,j]]});case 1:var g=f[1];return P0(d(n[1][1+s0],n),g,s,function(j){return[0,o,[1,j]]});default:var E=f[1];return P0(d(n[1][1+n0],n),E,s,function(j){return[0,o,[2,j]]})}},s0,function(n,s){var f=s[3],o=s[2],k=s[4],g=s[1],E=p(n[1][1+t0],n,o),j=p(n[1][1+i],n,f);return E===o&&j===f?s:[0,g,E,j,k]},n0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,f);return k===f?s:[0,o,k]},nd,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},h,function(n,s,f){var o=f[2],k=f[1],g=k[3],E=k[2],j=k[1],R=p(n[1][1+t0],n,j),H=p(n[1][1+t0],n,E),p0=fr(d(n[1][1+t0],n),g),R0=p(n[1][1+z],n,o);return R===j&&H===E&&p0===g&&R0===o?f:[0,[0,R,H,p0],R0]},A,function(n,s,f){var o=f[2],k=f[1],g=k[3],E=k[2],j=k[1],R=p(n[1][1+t0],n,j),H=p(n[1][1+t0],n,E),p0=fr(d(n[1][1+t0],n),g),R0=p(n[1][1+z],n,o);return R===j&&H===E&&p0===g&&R0===o?f:[0,[0,R,H,p0],R0]},t0,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return P0(d(n[1][1+z],n),k,s,function(_x){return[0,o,[0,_x]]});case 1:var g=f[1];return P0(d(n[1][1+z],n),g,s,function(_x){return[0,o,[1,_x]]});case 2:var E=f[1];return P0(d(n[1][1+z],n),E,s,function(_x){return[0,o,[2,_x]]});case 3:var j=f[1];return P0(d(n[1][1+z],n),j,s,function(_x){return[0,o,[3,_x]]});case 4:var R=f[1];return P0(d(n[1][1+z],n),R,s,function(_x){return[0,o,[4,_x]]});case 5:var H=f[1];return P0(d(n[1][1+z],n),H,s,function(_x){return[0,o,[5,_x]]});case 6:var p0=f[1];return P0(d(n[1][1+z],n),p0,s,function(_x){return[0,o,[6,_x]]});case 7:var R0=f[1];return P0(d(n[1][1+z],n),R0,s,function(_x){return[0,o,[7,_x]]});case 8:var kx=f[1],Bx=f[2];return P0(d(n[1][1+z],n),Bx,s,function(_x){return[0,o,[8,kx,_x]]});case 9:var zx=f[1];return P0(d(n[1][1+z],n),zx,s,function(_x){return[0,o,[9,_x]]});case 10:var wr=f[1];return P0(d(n[1][1+z],n),wr,s,function(_x){return[0,o,[10,_x]]});case 11:var Jr=f[1];return P0(d(n[1][1+kt],n),Jr,s,function(_x){return[0,o,[11,_x]]});case 12:var Hr=f[1];return D0(d(n[1][1+h2],n),o,Hr,s,function(_x){return[0,o,[12,_x]]});case 13:var Vx=f[1];return D0(d(n[1][1+Hv],n),o,Vx,s,function(_x){return[0,o,[13,_x]]});case 14:var C2=f[1];return D0(d(n[1][1+ix],n),o,C2,s,function(_x){return[0,o,[14,_x]]});case 15:var r1=f[1];return D0(d(n[1][1+D],n),o,r1,s,function(_x){return[0,o,[15,_x]]});case 16:var ne=f[1];return P0(d(n[1][1+nd],n),ne,s,function(_x){return[0,o,[16,_x]]});case 17:var Y1=f[1];return P0(d(n[1][1+Pa],n),Y1,s,function(_x){return[0,o,[17,_x]]});case 18:var ge=f[1];return P0(d(n[1][1+M0],n),ge,s,function(_x){return[0,o,[18,_x]]});case 19:var Fe=f[1];return D0(d(n[1][1+Lr],n),o,Fe,s,function(_x){return[0,o,[19,_x]]});case 20:var we=f[1];return D0(d(n[1][1+$0],n),o,we,s,function(_x){return[0,o,[20,_x]]});case 21:var ue=f[1];return D0(d(n[1][1+b2],n),o,ue,s,function(_x){return[0,o,[21,_x]]});case 22:var _e=f[1];return D0(d(n[1][1+h],n),o,_e,s,function(_x){return[0,o,[22,_x]]});case 23:var ut=f[1];return D0(d(n[1][1+A],n),o,ut,s,function(_x){return[0,o,[23,_x]]});case 24:var be=f[1];return P0(d(n[1][1+b],n),be,s,function(_x){return[0,o,[24,_x]]});case 25:var Ht=f[1];return P0(d(n[1][1+go],n),Ht,s,function(_x){return[0,o,[25,_x]]});case 26:var Ls=f[1];return P0(d(n[1][1+B],n),Ls,s,function(_x){return[0,o,[26,_x]]});case 27:var On=f[1];return P0(d(n[1][1+d0],n),On,s,function(_x){return[0,o,[27,_x]]});case 28:var Ms=f[1];return P0(d(n[1][1+y0],n),Ms,s,function(_x){return[0,o,[28,_x]]});case 29:var Et=f[1];return D0(d(n[1][1+xx],n),o,Et,s,function(_x){return[0,o,[29,_x]]});case 30:var qs=f[1];return D0(d(n[1][1+j1],n),o,qs,s,function(_x){return[0,o,[30,_x]]});case 31:var c3=f[1];return D0(d(n[1][1+ja],n),o,c3,s,function(_x){return[0,o,[31,_x]]});case 32:var s3=f[1];return D0(d(n[1][1+Rl],n),o,s3,s,function(_x){return[0,o,[32,_x]]});case 33:var a3=f[1];return P0(d(n[1][1+z],n),a3,s,function(_x){return[0,o,[33,_x]]});case 34:var o3=f[1];return P0(d(n[1][1+z],n),o3,s,function(_x){return[0,o,[34,_x]]});default:var Oa=f[1];return P0(d(n[1][1+z],n),Oa,s,function(_x){return[0,o,[35,_x]]})}},Z,function(n,s){var f=s[1],o=s[2];return P0(d(n[1][1+t0],n),o,s,function(k){return[0,f,k]})},a0,function(n,s){if(s[0]===0)return s;var f=s[1];return P0(d(n[1][1+Z],n),f,s,function(o){return[1,o]})},Io,function(n,s){if(s[0]===0)return s;var f=s[2],o=s[1],k=p(n[1][1+B],n,f);return k===f?s:[1,o,k]},f2,function(n,s,f){return Q0(n[1][1+ee],n,s,f)},o2,function(n,s,f){return Q0(n[1][1+n2],n,s,f)},n2,function(n,s,f){return Q0(n[1][1+ee],n,s,f)},ee,function(n,s,f){var o=f[10],k=f[9],g=f[8],E=f[7],j=f[3],R=f[2],H=f[1],p0=f[11],R0=f[6],kx=f[5],Bx=f[4],zx=Px(d(n[1][1+Mr],n),H),wr=Px(d(n[1][1+M],n),k),Jr=p(n[1][1+a2],n,R),Hr=p(n[1][1+t2],n,g),Vx=p(n[1][1+N2],n,j),C2=Px(d(n[1][1+Kx],n),E),r1=p(n[1][1+z],n,o);return H===zx&&R===Jr&&j===Vx&&E===C2&&g===Hr&&k===wr&&o===r1?f:[0,zx,Jr,Vx,Bx,kx,R0,C2,Hr,wr,r1,p0]},a2,function(n,s){var f=s[2],o=f[4],k=f[3],g=f[2],E=f[1],j=s[1],R=fr(d(n[1][1+z2],n),g),H=Px(d(n[1][1+Sr],n),k),p0=Px(d(n[1][1+d2],n),E),R0=p(n[1][1+z],n,o);return g===R&&k===H&&o===R0&&E===p0?s:[0,j,[0,p0,R,H,R0]]},d2,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Z],n,k),j=p(n[1][1+z],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},z2,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Qr],n,k),j=p(n[1][1+Tt],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},t2,function(n,s){switch(s[0]){case 0:return s;case 1:var f=s[1];return P0(d(n[1][1+Z],n),f,s,function(k){return[1,k]});default:var o=s[1];return P0(d(n[1][1+u0],n),o,s,function(k){return[2,k]})}},N2,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+he],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+rd],n),o,s,function(k){return[1,k]})},he,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+Qt],n),f,o,s,function(k){return[0,f,k]})},rd,function(n,s){return p(n[1][1+Ax],n,s)},Mr,function(n,s){return Q0(n[1][1+O0],n,w$,s)},Rx,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+z],n,o);return o===E?s:[0,g,[0,k,E]]},K,function(n,s){return p(n[1][1+Rx],n,s)},q,function(n,s){return p(n[1][1+K],n,s)},jn,function(n,s){return p(n[1][1+K],n,s)},k0,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=p(n[1][1+jn],n,j),H=Px(d(n[1][1+M],n),E),p0=d(n[1][1+Lr],n),R0=fr(function(zx){return W2(p0,zx)},g),kx=W2(d(n[1][1+ix],n),k),Bx=p(n[1][1+z],n,o);return R===j&&H===E&&R0===g&&kx===k&&Bx===o?f:[0,R,H,R0,kx,Bx]},c0,function(n,s,f){return Q0(n[1][1+k0],n,s,f)},E0,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+z],n,o);return o===E?s:[0,g,[0,k,E]]},$v,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},ar,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},yr,function(n,s,f){return p(n[1][1+F0],n,f)},Cr,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+F0],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},er,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+U],n,E),R=Q0(n[1][1+yr],n,k!==0?1:0,g),H=d(n[1][1+Cr],n),p0=Px(function(kx){return W2(H,kx)},k),R0=p(n[1][1+z],n,o);return E===j&&g===R&&k===p0&&o===R0?f:[0,j,R,p0,R0]},xr,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=W2(d(n[1][1+Nx],n),E),H=Px(p(n[1][1+lx],n,j),k),p0=Px(function(kx){var Bx=kx[1],zx=kx[2],wr=Q0(n[1][1+Jx],n,j,Bx);return wr===Bx?kx:[0,wr,zx]},g),R0=p(n[1][1+z],n,o);return E===R&&k===H&&g===p0&&o===R0?f:[0,j,R,p0,H,R0]},Nx,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},lx,function(n,s,f){if(f[0]===0){var o=f[1],k=fr(p(n[1][1+ur],n,s),o);return o===k?f:[0,k]}var g=f[1],E=g[1],j=g[2];return D0(p(n[1][1+Fx],n,s),E,j,f,function(R){return[1,[0,E,R]]})},h0,function(n,s){return p(n[1][1+Rx],n,s)},ur,function(n,s,f){var o=f[3],k=f[2],g=f[1];x:{r:{var E=f[4];if(s){e:{if(g)switch(g[1]){case 0:break r;case 1:break e}if(2<=s){var j=0,R=0;break x}}var j=1,R=0;break x}}var j=1,R=1}var H=k?p(n[1][1+h0],n,o):R?p(n[1][1+jn],n,o):Q0(n[1][1+O0],n,_$,o);if(k)var p0=k[1],R0=j?d(n[1][1+jn],n):p(n[1][1+O0],n,b$),kx=P0(R0,p0,k,function(Bx){return[0,Bx]});else var kx=0;return k===kx&&o===H?f:[0,g,kx,H,E]},Jx,function(n,s,f){var o=2<=s?p(n[1][1+O0],n,T$):d(n[1][1+jn],n);return d(o,f)},Fx,function(n,s,f,o){var k=2<=s?p(n[1][1+O0],n,E$):d(n[1][1+jn],n);return d(k,o)},To,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+Yv],n,E),R=Px(d(n[1][1+S4],n),g),H=p(n[1][1+A4],n,k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},E4,function(n,s,f){var o=f[4],k=f[3],g=p(n[1][1+A4],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,f[1],f[2],g,E]},Yv,function(n,s){var f=s[2],o=f[4],k=f[2],g=f[1],E=f[3],j=s[1],R=p(n[1][1+Tl],n,g),H=Px(d(n[1][1+Ro],n),k),p0=fr(d(n[1][1+wo],n),o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,H,E,p0]]},S4,function(n,s){var f=s[2][1],o=s[1],k=p(n[1][1+Tl],n,f);return f===k?s:[0,o,[0,k]]},wo,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+X],n),f,s,function(E){return[0,E]})}var o=s[1],k=o[1],g=o[2];return D0(d(n[1][1+Xv],n),k,g,s,function(E){return[1,[0,k,E]]})},Xv,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},X,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+El],n,k),j=Px(d(n[1][1+P4],n),o);return k===E&&o===j?s:[0,g,[0,E,j]]},El,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+N4],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+I4],n),o,s,function(k){return[1,k]})},N4,function(n,s){return p(n[1][1+ht],n,s)},I4,function(n,s){return p(n[1][1+_o],n,s)},P4,function(n,s){if(s[0]===0){var f=s[1],o=f[1],k=f[2];return D0(d(n[1][1+Hh],n),o,k,s,function(R){return[0,[0,o,R]]})}var g=s[1],E=g[1],j=g[2];return D0(d(n[1][1+Zh],n),E,j,s,function(R){return[1,[0,E,R]]})},Zh,function(n,s,f){return Q0(n[1][1+Aa],n,s,f)},Hh,function(n,s,f){return Q0(n[1][1+xx],n,s,f)},A4,function(n,s){var f=s[2],o=s[1],k=fr(d(n[1][1+Qh],n),f);return f===k?s:[0,o,k]},Qh,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return D0(d(n[1][1+To],n),o,k,s,function(R){return[0,o,[0,R]]});case 1:var g=f[1];return D0(d(n[1][1+E4],n),o,g,s,function(R){return[0,o,[1,R]]});case 2:var E=f[1];return D0(d(n[1][1+Aa],n),o,E,s,function(R){return[0,o,[2,R]]});case 3:var j=f[1];return P0(d(n[1][1+wl],n),j,s,function(R){return[0,o,[3,R]]});default:return s}},Aa,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+z],n,o);if(!k)return o===g?f:[0,0,g];var E=k[1],j=p(n[1][1+Ax],n,E);return E===j&&o===g?f:[0,[0,j],g]},wl,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+Ax],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},Tl,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+bl],n),f,s,function(g){return[0,g]});case 1:var o=s[1];return P0(d(n[1][1+$h],n),o,s,function(g){return[1,g]});default:var k=s[1];return P0(d(n[1][1+zv],n),k,s,function(g){return[2,g]})}},bl,function(n,s){return p(n[1][1+ht],n,s)},$h,function(n,s){return p(n[1][1+_o],n,s)},zv,function(n,s){return p(n[1][1+_l],n,s)},_o,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+ht],n,k),j=p(n[1][1+ht],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},_l,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Sa],n,k),j=p(n[1][1+ht],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},Sa,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+bo],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+_l],n),o,s,function(k){return[1,k]})},bo,function(n,s){return p(n[1][1+bl],n,s)},ht,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+z],n,o);return o===E?s:[0,g,[0,k,E]]},yo,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ps],n,g),j=p(n[1][1+F0],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},ho,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Ax],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,f[1],E,j,R]},me,function(n,s,f){var o=f[5],k=f[2],g=f[1],E=f[4],j=f[3],R=p(n[1][1+Ax],n,g),H=fr(d(n[1][1+mo],n),k),p0=p(n[1][1+z],n,o);return g===R&&k===H&&o===p0?f:[0,R,H,j,E,p0]},mo,function(n,s){var f=s[2],o=f[4],k=f[3],g=f[2],E=f[1],j=s[1],R=p(n[1][1+Kt],n,E),H=p(n[1][1+Ax],n,g),p0=Px(d(n[1][1+Ax],n),k),R0=p(n[1][1+z],n,o);return E===R&&g===H&&k===p0&&o===R0?s:[0,j,[0,E,g,p0,R0]]},As,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=fr(d(n[1][1+lo],n),k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},lo,function(n,s){var f=s[2],o=f[4],k=f[3],g=f[2],E=f[1],j=s[1],R=p(n[1][1+Kt],n,E),H=W2(d(n[1][1+Qt],n),g),p0=Px(d(n[1][1+Ax],n),k),R0=p(n[1][1+z],n,o);return E===R&&g===H&&k===p0&&o===R0?s:[0,j,[0,E,g,p0,R0]]},Kt,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return P0(d(n[1][1+z],n),k,s,function(Vx){return[0,o,[0,Vx]]});case 1:var g=f[1];return D0(d(n[1][1+j1],n),o,g,s,function(Vx){return[0,o,[1,Vx]]});case 2:var E=f[1];return D0(d(n[1][1+ja],n),o,E,s,function(Vx){return[0,o,[2,Vx]]});case 3:var j=f[1];return D0(d(n[1][1+xx],n),o,j,s,function(Vx){return[0,o,[3,Vx]]});case 4:var R=f[1];return D0(d(n[1][1+Rl],n),o,R,s,function(Vx){return[0,o,[4,Vx]]});case 5:var H=f[1];return P0(d(n[1][1+z],n),H,s,function(Vx){return[0,o,[5,Vx]]});case 6:var p0=f[1];return P0(d(n[1][1+dr],n),p0,s,function(Vx){return[0,o,[6,Vx]]});case 7:var R0=f[1];return D0(d(n[1][1+Q2],n),o,R0,s,function(Vx){return[0,o,[7,Vx]]});case 8:var kx=f[1];return P0(d(n[1][1+Rx],n),kx,s,function(Vx){return[0,o,[8,Vx]]});case 9:var Bx=f[1];return P0(d(n[1][1+Ta],n),Bx,s,function(Vx){return[0,o,[9,Vx]]});case 10:var zx=f[1];return P0(d(n[1][1+ko],n),zx,s,function(Vx){return[0,o,[10,Vx]]});case 11:var wr=f[1];return P0(d(n[1][1+Pn],n),wr,s,function(Vx){return[0,o,[11,Vx]]});case 12:var Jr=f[1];return P0(d(n[1][1+An],n),Jr,s,function(Vx){return[0,o,[12,Vx]]});default:var Hr=f[1];return P0(d(n[1][1+Ea],n),Hr,s,function(Vx){return[0,o,[13,Vx]]})}},dr,function(n,s){var f=s[3],o=s[2],k=o[1],g=s[1],E=o[2],j=D0(d(n[1][1+mt],n),k,E,o,function(H){return[0,k,H]}),R=p(n[1][1+z],n,f);return o===j&&f===R?s:[0,g,j,R]},mt,function(n,s,f){if(f[0]===0){var o=f[1];return D0(d(n[1][1+j1],n),s,o,f,function(g){return[0,g]})}var k=f[1];return D0(d(n[1][1+ja],n),s,k,f,function(g){return[1,g]})},Ta,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=s[1],j=p(n[1][1+ba],n,g),R=p(n[1][1+_a],n,k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?s:[0,E,[0,j,R,H]]},ba,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+Rx],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Ta],n),o,s,function(k){return[1,k]})},_a,function(n,s){switch(s[0]){case 0:var f=s[1],o=f[1],k=f[2];return D0(d(n[1][1+xx],n),o,k,s,function(H){return[0,[0,o,H]]});case 1:var g=s[1],E=g[1],j=g[2];return D0(d(n[1][1+j1],n),E,j,s,function(H){return[1,[0,E,H]]});default:var R=s[1];return P0(d(n[1][1+Rx],n),R,s,function(H){return[2,H]})}},Q2,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=Q0(n[1][1+O0],n,[0,g],k),j=p(n[1][1+z],n,o);return k===E&&o===j?f:[0,g,E,j]},ko,function(n,s){var f=s[3],o=s[2],k=s[1],g=fr(d(n[1][1+po],n),k),E=$6(d(n[1][1+ga],n),o),j=p(n[1][1+z],n,f);return k===g&&o===E&&f===j?s:[0,g,E,j]},po,function(n,s){var f=s[2],o=f[4],k=f[2],g=f[1],E=f[3],j=s[1],R=p(n[1][1+wa],n,g),H=p(n[1][1+Kt],n,k),p0=p(n[1][1+z],n,o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,H,E,p0]]},wa,function(n,s){switch(s[0]){case 0:var f=s[1],o=f[1],k=f[2];return D0(d(n[1][1+xx],n),o,k,s,function(H){return[0,[0,o,H]]});case 1:var g=s[1],E=g[1],j=g[2];return D0(d(n[1][1+j1],n),E,j,s,function(H){return[1,[0,E,H]]});default:var R=s[1];return P0(d(n[1][1+Rx],n),R,s,function(H){return[2,H]})}},Pn,function(n,s){var f=s[3],o=s[2],k=s[1],g=fr(d(n[1][1+Uv],n),k),E=$6(d(n[1][1+ga],n),o),j=p(n[1][1+z],n,f);return k===g&&o===E&&f===j?s:[0,g,E,j]},Uv,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+Kt],n,f);return f===k?s:[0,o,k]},ga,function(n,s,f){var o=f[2],k=f[1],g=$6(d(n[1][1+Q2],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},An,function(n,s){var f=s[2],o=s[1],k=fr(d(n[1][1+Kt],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},Ea,function(n,s){var f=s[3],o=s[2],k=s[1],g=p(n[1][1+Kt],n,k);if(o[0]===0)var E=o[1],H=P0(p(n[1][1+O0],n,S$),E,o,function(R0){return[0,R0]});else var j=o[1],R=o[2],H=D0(d(n[1][1+Q2],n),j,R,o,function(R0){return[1,j,R0]});var p0=p(n[1][1+z],n,f);return k===g&&o===H&&f===p0?s:[0,g,H,p0]},vo,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+ke],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},s2,function(n,s,f){var o=f[1],k=Q0(n[1][1+vo],n,s,o);return o===k?f:[0,k,f[2],f[3]]},ke,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+Sn],n),f,s,function(g){return[0,g]});case 1:var o=s[1];return P0(d(n[1][1+Qe],n),o,s,function(g){return[1,g]});default:var k=s[1];return P0(d(n[1][1+Ss],n),k,s,function(g){return[2,g]})}},Sn,function(n,s){return p(n[1][1+Rx],n,s)},Qe,function(n,s){return p(n[1][1+E0],n,s)},Ss,function(n,s){return p(n[1][1+Ax],n,s)},T2,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Rx],n,g),j=p(n[1][1+Rx],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},O1,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+Ax],n,E),R=Px(d(n[1][1+Ro],n),g),H=Px(d(n[1][1+Ml],n),k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},pe,function(n,s,f){var o=f[2],k=f[1],g=fr(function(j){if(j[0]===0){var R=j[1],H=p(n[1][1+Or],n,R);return R===H?j:[0,H]}var p0=j[1],R0=p(n[1][1+px],n,p0);return p0===R0?j:[1,R0]},k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},Or,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[3],g=f[2],E=f[1],j=p(n[1][1+Sx],n,E),R=p(n[1][1+Ax],n,g);x:if(k){if(j[0]===3){var H=R[2];if(H[0]===10){var R0=_r(j[1][2][1],H[1][2][1]);break x}}var p0=E===j?1:0,R0=p0&&(g===R?1:0)}else var R0=k;return E===j&&g===R&&k===R0?s:[0,o,[0,j,R,R0]];case 1:var kx=f[2],Bx=f[1],zx=p(n[1][1+Sx],n,Bx),wr=W2(d(n[1][1+n2],n),kx);return Bx===zx&&kx===wr?s:[0,o,[1,zx,wr]];case 2:var Jr=f[3],Hr=f[2],Vx=f[1],C2=p(n[1][1+Sx],n,Vx),r1=W2(d(n[1][1+n2],n),Hr),ne=p(n[1][1+z],n,Jr);return Vx===C2&&Hr===r1&&Jr===ne?s:[0,o,[2,C2,r1,ne]];default:var Y1=f[3],ge=f[2],Fe=f[1],we=p(n[1][1+Sx],n,Fe),ue=W2(d(n[1][1+n2],n),ge),_e=p(n[1][1+z],n,Y1);return Fe===we&&ge===ue&&Y1===_e?s:[0,o,[3,we,ue,_e]]}},Sx,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+x2],n),f,s,function(R){return[0,R]});case 1:var o=s[1];return P0(d(n[1][1+hr],n),o,s,function(R){return[1,R]});case 2:var k=s[1];return P0(d(n[1][1+sx],n),k,s,function(R){return[2,R]});case 3:var g=s[1];return P0(d(n[1][1+Dr],n),g,s,function(R){return[3,R]});case 4:var E=s[1];return P0(d(n[1][1+E0],n),E,s,function(R){return[4,R]});default:var j=s[1];return P0(d(n[1][1+r2],n),j,s,function(R){return[5,R]})}},x2,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+xx],n),f,o,s,function(k){return[0,f,k]})},hr,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+j1],n),f,o,s,function(k){return[0,f,k]})},sx,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+ja],n),f,o,s,function(k){return[0,f,k]})},Dr,function(n,s){return p(n[1][1+Rx],n,s)},r2,function(n,s){return p(n[1][1+$v],n,s)},F2,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=p(n[1][1+jn],n,j),H=Px(d(n[1][1+M],n),E),p0=Px(d(n[1][1+t0],n),g),R0=Px(d(n[1][1+t0],n),k),kx=p(n[1][1+z],n,o);return j===R&&g===p0&&E===H&&g===p0&&k===R0&&o===kx?f:[0,R,H,p0,R0,kx]},Qr,function(n,s){return Q0(n[1][1+Lo],n,A$,s)},v,function(n,s,f){return Q0(n[1][1+Lo],n,[0,s],f)},jl,function(n,s){return Q0(n[1][1+Lo],n,P$,s)},xt,function(n,s){return p(n[1][1+Ll],n,s)},dt,function(n,s){return p(n[1][1+Ll],n,s)},Lo,function(n,s,f){var o=s?s[1]:0;return Q0(n[1][1+Nr],n,[0,o],f)},Ll,function(n,s){return Q0(n[1][1+Nr],n,0,s)},Nr,function(n,s,f){var o=f[2],k=f[1];switch(o[0]){case 0:var g=o[1],E=g[3],j=g[2],R=g[1],H=fr(p(n[1][1+Ex],n,s),R),p0=p(n[1][1+a0],n,j),R0=p(n[1][1+z],n,E);x:{if(H===R&&p0===j&&R0===E){var kx=o;break x}var kx=[0,[0,H,p0,R0]]}var be=kx;break;case 1:var Bx=o[1],zx=Bx[3],wr=Bx[2],Jr=Bx[1],Hr=fr(p(n[1][1+gr],n,s),Jr),Vx=p(n[1][1+a0],n,wr),C2=p(n[1][1+z],n,zx);x:{if(zx===C2&&Hr===Jr&&Vx===wr){var r1=o;break x}var r1=[1,[0,Hr,Vx,C2]]}var be=r1;break;case 2:var ne=o[1],Y1=ne[2],ge=ne[1],Fe=ne[3],we=Q0(n[1][1+O0],n,s,ge),ue=p(n[1][1+a0],n,Y1);x:{if(ge===we&&Y1===ue){var _e=o;break x}var _e=[2,[0,we,ue,Fe]]}var be=_e;break;default:var ut=o[1],be=P0(d(n[1][1+Wx],n),ut,o,function(Ht){return[3,Ht]})}return o===be?f:[0,k,be]},O0,function(n,s,f){return p(n[1][1+Rx],n,f)},Ix,function(n,s,f,o){return Q0(n[1][1+xx],n,f,o)},qx,function(n,s,f,o){return Q0(n[1][1+j1],n,f,o)},Yx,function(n,s,f,o){return Q0(n[1][1+ja],n,f,o)},Ex,function(n,s,f){if(f[0]===0){var o=f[1];return P0(p(n[1][1+Dx],n,s),o,f,function(g){return[0,g]})}var k=f[1];return P0(p(n[1][1+Kr],n,s),k,f,function(g){return[1,g]})},Dx,function(n,s,f){var o=f[2],k=o[4],g=o[3],E=o[2],j=o[1],R=f[1],H=Q0(n[1][1+yx],n,s,j),p0=Q0(n[1][1+G],n,s,E),R0=p(n[1][1+Tt],n,g);x:if(k){if(H[0]===3){var kx=p0[2];if(kx[0]===2){var zx=_r(H[1][2][1],kx[1][1][2][1]);break x}}var Bx=j===H?1:0,zx=Bx&&(E===p0?1:0)}else var zx=k;return H===j&&p0===E&&R0===g&&k===zx?f:[0,R,[0,H,p0,R0,zx]]},yx,function(n,s,f){switch(f[0]){case 0:var o=f[1];return P0(p(n[1][1+S],n,s),o,f,function(R){return[0,R]});case 1:var k=f[1];return P0(p(n[1][1+Z0],n,s),k,f,function(R){return[1,R]});case 2:var g=f[1];return P0(p(n[1][1+m0],n,s),g,f,function(R){return[2,R]});case 3:var E=f[1];return P0(p(n[1][1+Tx],n,s),E,f,function(R){return[3,R]});default:var j=f[1];return P0(p(n[1][1+ex],n,s),j,f,function(R){return[4,R]})}},S,function(n,s,f){var o=f[1],k=f[2];return D0(p(n[1][1+Ix],n,s),o,k,f,function(g){return[0,o,g]})},Z0,function(n,s,f){var o=f[1],k=f[2];return D0(p(n[1][1+qx],n,s),o,k,f,function(g){return[0,o,g]})},m0,function(n,s,f){var o=f[1],k=f[2];return D0(p(n[1][1+Yx],n,s),o,k,f,function(g){return[0,o,g]})},Tx,function(n,s,f){return Q0(n[1][1+O0],n,s,f)},ex,function(n,s,f){return p(n[1][1+$v],n,f)},Kr,function(n,s,f){var o=f[2],k=o[2],g=o[1],E=f[1],j=Q0(n[1][1+z0],n,s,g),R=p(n[1][1+z],n,k);return j===g&&k===R?f:[0,E,[0,j,R]]},G,function(n,s,f){return Q0(n[1][1+Nr],n,s,f)},z0,function(n,s,f){return Q0(n[1][1+Nr],n,s,f)},gr,function(n,s,f){switch(f[0]){case 0:var o=f[1];return P0(p(n[1][1+nr],n,s),o,f,function(g){return[0,g]});case 1:var k=f[1];return P0(p(n[1][1+Qx],n,s),k,f,function(g){return[1,g]});default:return f}},nr,function(n,s,f){var o=f[2],k=o[2],g=o[1],E=f[1],j=Q0(n[1][1+vx],n,s,g),R=p(n[1][1+Tt],n,k);return g===j&&k===R?f:[0,E,[0,j,R]]},vx,function(n,s,f){return Q0(n[1][1+Nr],n,s,f)},Qx,function(n,s,f){var o=f[2],k=o[2],g=o[1],E=f[1],j=Q0(n[1][1+fx],n,s,g),R=p(n[1][1+z],n,k);return j===g&&k===R?f:[0,E,[0,j,R]]},fx,function(n,s,f){return Q0(n[1][1+Nr],n,s,f)},Wx,function(n,s){return p(n[1][1+Ax],n,s)},Kx,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1];if(k)var E=k[1],j=P0(d(n[1][1+Ax],n),E,k,function(H){return[0,H]});else var j=k;var R=p(n[1][1+z],n,o);return k===j&&o===R?s:[0,g,[0,j,R]]},U,function(n,s){return p(n[1][1+Ax],n,s)},u0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+Q],n,f);return Y3(k,f)?s:[0,o,k]},Q,function(n,s){var f=s[2],o=f[3],k=f[2],g=k[2],E=k[1],j=f[1],R=s[1],H=p(n[1][1+Rx],n,E),p0=Px(d(n[1][1+t0],n),g),R0=p(n[1][1+z],n,o);return H===E&&p0===g&&R0===o?s:[0,R,[0,j,[0,H,p0],R0]]},Sr,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Qr],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},g0,function(n,s,f){var o=f[2],k=f[1],g=f[3],E=Px(d(n[1][1+Ax],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?f:[0,E,j,g]},W,function(n,s,f){var o=f[2],k=f[1],g=fr(d(n[1][1+Ax],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},j0,function(n,s){return p(n[1][1+nx],n,s)},nx,function(n,s){var f=d(n[1][1+mx],n),o=m1(function(g,E){var j=g[2],R=g[1],H=d(f,E);if(!H)return[0,R,1];if(H[2])return[0,G3(H,R),1];var p0=H[1],R0=j||(E!==p0?1:0);return[0,[0,p0,R],R0]},I$,s),k=o[1];return o[2]?tx(k):s},mx,function(n,s){return[0,p(n[1][1+F0],n,s),0]},dx,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},px,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},rx,function(n,s,f){var o=f[1],k=p(n[1][1+z],n,o);return o===k?f:[0,k]},N0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=f[4],j=p(n[1][1+Ax],n,g),R=fr(d(n[1][1+V0],n),k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?f:[0,j,R,H,E]},V0,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=s[1],j=Px(d(n[1][1+Ax],n),g),R=p(n[1][1+nx],n,k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?s:[0,E,[0,j,R,H]]},b0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=W2(d(n[1][1+J0],n),k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},J0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=fr(d(n[1][1+A0],n),g),j=fr(d(n[1][1+Ax],n),k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},A0,function(n,s){return s},W0,function(n,s,f){var o=f[1],k=p(n[1][1+z],n,o);return o===k?f:[0,k]},S0,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},L0,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=W2(d(n[1][1+Qt],n),E);if(g)var R=g[1],H=R[1],p0=R[2],R0=D0(d(n[1][1+Ol],n),H,p0,g,function(Hr){return[0,[0,H,Hr]]});else var R0=g;if(k)var kx=k[1],Bx=kx[1],zx=kx[2],wr=D0(d(n[1][1+Qt],n),Bx,zx,k,function(Hr){return[0,[0,Bx,Hr]]});else var wr=k;var Jr=p(n[1][1+z],n,o);return E===j&&g===R0&&k===wr&&o===Jr?f:[0,j,R0,wr,Jr]},e0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Z],n,k),R=p(n[1][1+z],n,o);return E===g&&j===k&&R===o?f:[0,E,j,R]},w0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Z],n,k),R=p(n[1][1+z],n,o);return E===g&&Y3(j,k)&&R===o?f:[0,E,j,R]},T,function(n,s,f){var o=f[3],k=f[2],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,f[1],g,E]},m,function(n,s,f){var o=f[4],k=f[2],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,f[1],g,f[3],E]},l,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=fr(p(n[1][1+a],n,k),g),j=p(n[1][1+z],n,o);return g===E&&o===j?f:[0,E,k,j]},a,function(n,s,f){var o=f[2],k=o[2],g=o[1],E=f[1],j=Q0(n[1][1+v],n,s,g),R=Px(d(n[1][1+Ax],n),k);return g===j&&k===R?f:[0,E,[0,j,R]]},u,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+U],n,g),j=p(n[1][1+F0],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},t,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+F0],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},v0,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+jn],n,E),R=Px(d(n[1][1+M],n),g),H=p(n[1][1+t0],n,k),p0=p(n[1][1+z],n,o);return E===j&&k===H&&g===R&&o===p0?f:[0,j,R,H,p0]},e,function(n,s,f){var o=f[2],k=f[1],g=f[4],E=f[3],j=Px(d(n[1][1+Ax],n),k),R=p(n[1][1+z],n,o);return o===R&&k===j?f:[0,j,R,E,g]}]),function(n,s){return E5(s,x)}}),UC=[];function wB(x,r,e){var t=e[2];switch(t[0]){case 0:var u=t[1][1];return m1(d(UC[1],x),r,u);case 1:var i=t[1][1];return m1(d(UC[2],x),r,i);case 2:return p(x,r,t[1][1]);default:return r}}Rr(UC,[0,function(x,r){return function(e){var t=e[0]===0?e[1][2][2]:e[1][2][1];return wB(x,r,t)}},function(x,r){return function(e){return e[0]===2?r:wB(x,r,e[1][2][1])}}]);var XC=[];function _B(x){var r=x[2];switch(r[0]){case 0:return W3(XC[1],r[1][1]);case 1:return W3(XC[2],r[1][1]);case 2:return 1;default:return 0}}Rr(XC,[0,function(x){var r=x[0]===0?x[1][2][2]:x[1][2][1];return _B(r)},function(x){return x[0]===2?0:_B(x[1][2][1])}]);var C5=[];function YC(x){var r=x[2];switch(r[0]){case 7:return 1;case 10:var e=r[1],t=e[1],u=d(C5[2],e[2]);return u||W3(C5[1],t);case 11:var i=r[1],c=i[1],v=d(C5[2],i[2]);return v||W3(function(a){return YC(a[2])},c);case 12:return W3(YC,r[1][1]);case 13:return 1;default:return 0}}Rr(C5,[0,function(x){return YC(x[2][2])},function(x){return x&&x[1][2][1]?1:0}]);function zC(x){switch(x){case 0:return mQ;case 1:return hQ;default:return dQ}}function gn(x,r){return[0,r[1],[0,r[2],x]]}function bB(x,r,e){var t=x?x[1]:0,u=r?r[1]:0;return[0,t,u,e]}function x0(x,r,e){var t=x?x[1]:0,u=r?r[1]:0;return!t&&!u?0:[0,bB([0,t],[0,u],0)]}function j2(x,r,e,t){var u=x?x[1]:0,i=r?r[1]:0;return!u&&!i&&!e?0:[0,bB([0,u],[0,i],e)]}function A1(x,r){if(x){if(r){var e=r[1],t=x[1],u=[0,Lx(t[2],e[2])];return x0([0,Lx(e[1],t[1])],u,O)}var i=x}else var i=r;return i}function j5(x,r){if(!r)return x;if(x){var e=r[1],t=x[1],u=e[1],i=t[3],c=t[1],v=[0,Lx(t[2],e[2])];return j2([0,Lx(u,c)],v,i,O)}var a=r[1];return j2([0,a[1]],[0,a[2]],0,O)}function TB(x,r){s1(x)(yQ),d(s1(x)(wQ),gQ);var e=r[1];d(s1(x)(_Q),e),s1(x)(bQ),s1(x)(TQ),d(s1(x)(SQ),EQ);var t=r[2];return d(s1(x)(AQ),t),s1(x)(PQ),s1(x)(IQ)}Rr([],[0,TB,TB,function(x,r){switch(r[0]){case 0:var e=r[1];return s1(x)(n$),d(s1(x)(u$),e),s1(x)(i$);case 1:var t=r[1];return s1(x)(f$),d(s1(x)(c$),t),s1(x)(s$);case 2:var u=r[1];return s1(x)(a$),d(s1(x)(o$),u),s1(x)(v$);default:var i=r[1];return s1(x)(l$),d(s1(x)(p$),i),s1(x)(k$)}}]);function Vr(x,r){return[0,x[1],x[2],r[3]]}function va(x,r){var e=x[1]-r[1]|0;return e===0?x[2]-r[2]|0:e}function EB(x,r){var e=r[1],t=x[1];if(t){var u=t[1];if(e)var i=e[1],c=gB(i),v=gB(u)-c|0,a=v===0?ux(u[1],i[1]):v;else var a=-1}else var a=e?1:0;if(a!==0)return a;var l=va(x[2],r[2]);return l===0?va(x[3],r[3]):l}function Za(x,r){return EB(x,r)===0?1:0}var mr=[];Rr(mr,[0,function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r){switch(x){case 0:if(!r)return 0;break;case 1:if(r===1)return 0;break;case 2:if(r===2)return 0;break;case 3:if(r===3)return 0;break;default:if(4<=r)return 0}function e(u){switch(u){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;default:return 4}}var t=e(r);return Je(e(x),t)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)}]);var SB=U00.slice();function KC(x){for(var r=0,e=SB.length-1-1|0;;){if(ex)return 1;var r=t+1|0}}}var AB=0;function PB(x){var r=x[2];return[0,x[1],[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]],x[3],x[4],x[5],x[6],x[7]]}function IB(x){return x[3][1]}function O5(x,r){return x!==r[4]?[0,r[1],r[2],r[3],x,r[5],r[6],r[7]]:r}var Ve=[];function NB(x,r){if(typeof x=="number"){var e=x;if(67<=e)if(se<=e)switch(e){case 101:if(typeof r=="number"&&se===r)return 1;break;case 102:if(typeof r=="number"&&cn===r)return 1;break;case 103:if(typeof r=="number"&&F1===r)return 1;break;case 104:if(typeof r=="number"&&ft===r)return 1;break;case 105:if(typeof r=="number"&&Pt===r)return 1;break;case 106:if(typeof r=="number"&&vn===r)return 1;break;case 107:if(typeof r=="number"&&K2===r)return 1;break;case 108:if(typeof r=="number"&&Hs===r)return 1;break;case 109:if(typeof r=="number"&&Vn===r)return 1;break;case 110:if(typeof r=="number"&&w1===r)return 1;break;case 111:if(typeof r=="number"&&G1===r)return 1;break;case 112:if(typeof r=="number"&&Qs===r)return 1;break;case 113:if(typeof r=="number"&&J1===r)return 1;break;case 114:if(typeof r=="number"&&kr===r)return 1;break;case 115:if(typeof r=="number"&&iv===r)return 1;break;case 116:if(typeof r=="number"&&av===r)return 1;break;case 117:if(typeof r=="number"&&F3===r)return 1;break;case 118:if(typeof r=="number"&&f6===r)return 1;break;case 119:if(typeof r=="number"&&h3===r)return 1;break;case 120:if(typeof r=="number"&&mf===r)return 1;break;case 121:if(typeof r=="number"&&y6===r)return 1;break;case 122:if(typeof r=="number"&&c2===r)return 1;break;case 123:if(typeof r=="number"&&en===r)return 1;break;case 124:if(typeof r=="number"&&P3===r)return 1;break;case 125:if(typeof r=="number"&&qa===r)return 1;break;case 126:if(typeof r=="number"&&Ik===r)return 1;break;case 127:if(typeof r=="number"&&Xr===r)return 1;break;case 128:if(typeof r=="number"&&M2===r)return 1;break;case 129:if(typeof r=="number"&&Ko===r)return 1;break;case 130:if(typeof r=="number"&&w6===r)return 1;break;case 131:if(typeof r=="number"&&u6===r)return 1;break;case 132:if(typeof r=="number"&&u8===r)return 1;break;default:if(typeof r=="number"&&Ek<=r)return 1}else switch(e){case 67:if(typeof r=="number"&&r===67)return 1;break;case 68:if(typeof r=="number"&&r===68)return 1;break;case 69:if(typeof r=="number"&&r===69)return 1;break;case 70:if(typeof r=="number"&&r===70)return 1;break;case 71:if(typeof r=="number"&&r===71)return 1;break;case 72:if(typeof r=="number"&&r===72)return 1;break;case 73:if(typeof r=="number"&&r===73)return 1;break;case 74:if(typeof r=="number"&&r===74)return 1;break;case 75:if(typeof r=="number"&&r===75)return 1;break;case 76:if(typeof r=="number"&&r===76)return 1;break;case 77:if(typeof r=="number"&&r===77)return 1;break;case 78:if(typeof r=="number"&&r===78)return 1;break;case 79:if(typeof r=="number"&&r===79)return 1;break;case 80:if(typeof r=="number"&&r===80)return 1;break;case 81:if(typeof r=="number"&&r===81)return 1;break;case 82:if(typeof r=="number"&&r===82)return 1;break;case 83:if(typeof r=="number"&&r===83)return 1;break;case 84:if(typeof r=="number"&&r===84)return 1;break;case 85:if(typeof r=="number"&&r===85)return 1;break;case 86:if(typeof r=="number"&&r===86)return 1;break;case 87:if(typeof r=="number"&&r===87)return 1;break;case 88:if(typeof r=="number"&&r===88)return 1;break;case 89:if(typeof r=="number"&&r===89)return 1;break;case 90:if(typeof r=="number"&&r===90)return 1;break;case 91:if(typeof r=="number"&&r===91)return 1;break;case 92:if(typeof r=="number"&&r===92)return 1;break;case 93:if(typeof r=="number"&&r===93)return 1;break;case 94:if(typeof r=="number"&&r===94)return 1;break;case 95:if(typeof r=="number"&&r===95)return 1;break;case 96:if(typeof r=="number"&&r===96)return 1;break;case 97:if(typeof r=="number"&&r===97)return 1;break;case 98:if(typeof r=="number"&&r===98)return 1;break;case 99:if(typeof r=="number"&&r===99)return 1;break;default:if(typeof r=="number"&&y2===r)return 1}else if(34<=e)switch(e){case 34:if(typeof r=="number"&&r===34)return 1;break;case 35:if(typeof r=="number"&&r===35)return 1;break;case 36:if(typeof r=="number"&&r===36)return 1;break;case 37:if(typeof r=="number"&&r===37)return 1;break;case 38:if(typeof r=="number"&&r===38)return 1;break;case 39:if(typeof r=="number"&&r===39)return 1;break;case 40:if(typeof r=="number"&&r===40)return 1;break;case 41:if(typeof r=="number"&&r===41)return 1;break;case 42:if(typeof r=="number"&&r===42)return 1;break;case 43:if(typeof r=="number"&&r===43)return 1;break;case 44:if(typeof r=="number"&&r===44)return 1;break;case 45:if(typeof r=="number"&&r===45)return 1;break;case 46:if(typeof r=="number"&&r===46)return 1;break;case 47:if(typeof r=="number"&&r===47)return 1;break;case 48:if(typeof r=="number"&&r===48)return 1;break;case 49:if(typeof r=="number"&&r===49)return 1;break;case 50:if(typeof r=="number"&&r===50)return 1;break;case 51:if(typeof r=="number"&&r===51)return 1;break;case 52:if(typeof r=="number"&&r===52)return 1;break;case 53:if(typeof r=="number"&&r===53)return 1;break;case 54:if(typeof r=="number"&&r===54)return 1;break;case 55:if(typeof r=="number"&&r===55)return 1;break;case 56:if(typeof r=="number"&&r===56)return 1;break;case 57:if(typeof r=="number"&&r===57)return 1;break;case 58:if(typeof r=="number"&&r===58)return 1;break;case 59:if(typeof r=="number"&&r===59)return 1;break;case 60:if(typeof r=="number"&&r===60)return 1;break;case 61:if(typeof r=="number"&&r===61)return 1;break;case 62:if(typeof r=="number"&&r===62)return 1;break;case 63:if(typeof r=="number"&&r===63)return 1;break;case 64:if(typeof r=="number"&&r===64)return 1;break;case 65:if(typeof r=="number"&&r===65)return 1;break;default:if(typeof r=="number"&&r===66)return 1}else switch(e){case 0:if(typeof r=="number"&&!r)return 1;break;case 1:if(typeof r=="number"&&r===1)return 1;break;case 2:if(typeof r=="number"&&r===2)return 1;break;case 3:if(typeof r=="number"&&r===3)return 1;break;case 4:if(typeof r=="number"&&r===4)return 1;break;case 5:if(typeof r=="number"&&r===5)return 1;break;case 6:if(typeof r=="number"&&r===6)return 1;break;case 7:if(typeof r=="number"&&r===7)return 1;break;case 8:if(typeof r=="number"&&r===8)return 1;break;case 9:if(typeof r=="number"&&r===9)return 1;break;case 10:if(typeof r=="number"&&r===10)return 1;break;case 11:if(typeof r=="number"&&r===11)return 1;break;case 12:if(typeof r=="number"&&r===12)return 1;break;case 13:if(typeof r=="number"&&r===13)return 1;break;case 14:if(typeof r=="number"&&r===14)return 1;break;case 15:if(typeof r=="number"&&r===15)return 1;break;case 16:if(typeof r=="number"&&r===16)return 1;break;case 17:if(typeof r=="number"&&r===17)return 1;break;case 18:if(typeof r=="number"&&r===18)return 1;break;case 19:if(typeof r=="number"&&r===19)return 1;break;case 20:if(typeof r=="number"&&r===20)return 1;break;case 21:if(typeof r=="number"&&r===21)return 1;break;case 22:if(typeof r=="number"&&r===22)return 1;break;case 23:if(typeof r=="number"&&r===23)return 1;break;case 24:if(typeof r=="number"&&r===24)return 1;break;case 25:if(typeof r=="number"&&r===25)return 1;break;case 26:if(typeof r=="number"&&r===26)return 1;break;case 27:if(typeof r=="number"&&r===27)return 1;break;case 28:if(typeof r=="number"&&r===28)return 1;break;case 29:if(typeof r=="number"&&r===29)return 1;break;case 30:if(typeof r=="number"&&r===30)return 1;break;case 31:if(typeof r=="number"&&r===31)return 1;break;case 32:if(typeof r=="number"&&r===32)return 1;break;default:if(typeof r=="number"&&r===33)return 1}}else switch(x[0]){case 0:if(typeof r!="number"&&r[0]===0){var t=r[2],u=x[2],i=p(Ve[13],x[1],r[1]);return i&&_r(u,t)}break;case 1:if(typeof r!="number"&&r[0]===1){var c=r[2],v=x[2],a=p(Ve[12],x[1],r[1]);return a&&_r(v,c)}break;case 2:if(typeof r!="number"&&r[0]===2){var l=r[1],m=x[1],h=l[4],T=l[3],b=l[2],N=m[4],C=m[3],I=m[2],F=p(Ve[11],m[1],l[1]),M=F&&_r(I,b),Y=M&&_r(C,T);return Y&&(N===h?1:0)}break;case 3:if(typeof r!="number"&&r[0]===3){var q=r[1],K=x[1],u0=q[5],Q=q[4],e0=q[3],f0=q[2],a0=K[5],Z=K[4],v0=K[3],t0=K[2],y0=p(Ve[10],K[1],q[1]),n0=y0&&_r(t0,f0),s0=n0&&_r(v0,e0),l0=s0&&(Z===Q?1:0);return l0&&(a0===u0?1:0)}break;case 4:if(typeof r!="number"&&r[0]===4){var w0=r[3],L0=r[2],I0=x[3],j0=x[2],S0=p(Ve[9],x[1],r[1]),W0=S0&&_r(j0,L0);return W0&&_r(I0,w0)}break;case 5:if(typeof r!="number"&&r[0]===5){var A0=r[3],J0=r[2],b0=x[3],z=x[2],C0=p(Ve[8],x[1],r[1]),V0=C0&&_r(z,J0);return V0&&_r(b0,A0)}break;case 6:if(typeof r!="number"&&r[0]===6){var N0=r[2],rx=x[2],xx=p(Ve[7],x[1],r[1]);return xx&&_r(rx,N0)}break;case 7:if(typeof r!="number"&&r[0]===7)return _r(x[1],r[1]);break;case 8:if(typeof r!="number"&&r[0]===8){var nx=_r(x[1],r[1]),mx=r[2],F0=x[2];return nx&&p(Ve[6],F0,mx)}break;case 9:if(typeof r!="number"&&r[0]===9){var px=r[3],dx=r[2],W=x[3],g0=x[2],B=p(Ve[5],x[1],r[1]),h0=B&&_r(g0,dx);return h0&&_r(W,px)}break;case 10:if(typeof r!="number"&&r[0]===10){var _0=r[3],d0=r[2],E0=x[3],U=x[2],Kx=p(Ve[4],x[1],r[1]),Ix=Kx&&_r(U,d0);return Ix&&_r(E0,_0)}break;case 11:if(typeof r!="number"&&r[0]===11)return p(Ve[3],x[1],r[1]);break;case 12:if(typeof r!="number"&&r[0]===12){var z0=r[3],Kr=r[2],S=x[3],G=x[2],Z0=p(Ve[2],x[1],r[1]),yx=Z0&&(G==Kr?1:0);return yx&&_r(S,z0)}break;default:if(typeof r!="number"&&r[0]===13){var Tx=r[2],ex=x[2],m0=r[3],Dx=x[3],Ex=p(Ve[1],x[1],r[1]);if(Ex){x:{if(ex){if(Tx){var qx=Y3(ex[1],Tx[1]);break x}}else if(!Tx){var qx=1;break x}var qx=0}var O0=qx}else var O0=Ex;return O0&&_r(Dx,m0)}}return 0}function CB(x,r){switch(x){case 0:if(!r)return 1;break;case 1:if(r===1)return 1;break;case 2:if(r===2)return 1;break;case 3:if(r===3)return 1;break;default:if(4<=r)return 1}return 0}function jB(x,r){switch(x){case 0:if(!r)return 1;break;case 1:if(r===1)return 1;break;default:if(2<=r)return 1}return 0}Rr(Ve,[0,jB,CB,function(x,r){if(x){if(r)return 1}else if(!r)return 1;return 0},Za,Za,Za,Za,Za,Za,Za,Za,jB,CB]);function OB(x){if(typeof x!="number")switch(x[0]){case 0:return ht0;case 1:return dt0;case 2:return yt0;case 3:return gt0;case 4:return wt0;case 5:return _t0;case 6:return bt0;case 7:return Tt0;case 8:return Et0;case 9:return St0;case 10:return At0;case 11:return Pt0;case 12:return It0;default:return Nt0}var r=x;if(67<=r){if(se<=r)switch(r){case 101:return Me0;case 102:return qe0;case 103:return Be0;case 104:return Ue0;case 105:return Xe0;case 106:return Ye0;case 107:return ze0;case 108:return Ke0;case 109:return Je0;case 110:return Ge0;case 111:return We0;case 112:return Ve0;case 113:return $e0;case 114:return Qe0;case 115:return He0;case 116:return Ze0;case 117:return xt0;case 118:return rt0;case 119:return et0;case 120:return tt0;case 121:return nt0;case 122:return ut0;case 123:return it0;case 124:return ft0;case 125:return ct0;case 126:return st0;case 127:return at0;case 128:return ot0;case 129:return vt0;case 130:return lt0;case 131:return pt0;case 132:return kt0;default:return mt0}switch(r){case 67:return ne0;case 68:return ue0;case 69:return ie0;case 70:return fe0;case 71:return ce0;case 72:return se0;case 73:return ae0;case 74:return oe0;case 75:return ve0;case 76:return le0;case 77:return pe0;case 78:return ke0;case 79:return me0;case 80:return he0;case 81:return de0;case 82:return ye0;case 83:return ge0;case 84:return we0;case 85:return _e0;case 86:return be0;case 87:return Te0;case 88:return Ee0;case 89:return Se0;case 90:return Ae0;case 91:return Pe0;case 92:return Ie0;case 93:return Ne0;case 94:return Ce0;case 95:return je0;case 96:return Oe0;case 97:return De0;case 98:return Fe0;case 99:return Re0;default:return Le0}}if(34<=r)switch(r){case 34:return E10;case 35:return S10;case 36:return A10;case 37:return P10;case 38:return I10;case 39:return N10;case 40:return C10;case 41:return j10;case 42:return O10;case 43:return D10;case 44:return F10;case 45:return R10;case 46:return L10;case 47:return M10;case 48:return q10;case 49:return B10;case 50:return U10;case 51:return X10;case 52:return Y10;case 53:return z10;case 54:return K10;case 55:return J10;case 56:return G10;case 57:return W10;case 58:return V10;case 59:return $10;case 60:return Q10;case 61:return H10;case 62:return Z10;case 63:return xe0;case 64:return re0;case 65:return ee0;default:return te0}switch(r){case 0:return K20;case 1:return J20;case 2:return G20;case 3:return W20;case 4:return V20;case 5:return $20;case 6:return Q20;case 7:return H20;case 8:return Z20;case 9:return x10;case 10:return r10;case 11:return e10;case 12:return t10;case 13:return n10;case 14:return u10;case 15:return i10;case 16:return f10;case 17:return c10;case 18:return s10;case 19:return a10;case 20:return o10;case 21:return v10;case 22:return l10;case 23:return p10;case 24:return k10;case 25:return m10;case 26:return h10;case 27:return d10;case 28:return y10;case 29:return g10;case 30:return w10;case 31:return _10;case 32:return b10;default:return T10}}function JC(x){if(typeof x!="number")switch(x[0]){case 0:return x[2];case 1:return x[2];case 2:return x[1][3];case 3:var r=x[1],e=r[5],t=r[4],u=r[3];return t&&e?Mx(D20,Mx(u,O20)):t?Mx(R20,Mx(u,F20)):e?Mx(M20,Mx(u,L20)):Mx(B20,Mx(u,q20));case 4:return x[3];case 5:var i=x[2];return Mx(X20,Mx(i,Mx(U20,x[3])));case 6:return x[2];case 7:return x[1];case 8:return x[1];case 9:return x[3];case 10:return x[3];case 11:return x[1]?Y20:z20;case 12:return x[3];default:return x[3]}var c=x;if(67<=c){if(se<=c)switch(c){case 101:return x20;case 102:return r20;case 103:return e20;case 104:return t20;case 105:return n20;case 106:return u20;case 107:return i20;case 108:return f20;case 109:return c20;case 110:return s20;case 111:return a20;case 112:return o20;case 113:return v20;case 114:return l20;case 115:return p20;case 116:return k20;case 117:return m20;case 118:return h20;case 119:return d20;case 120:return y20;case 121:return g20;case 122:return w20;case 123:return _20;case 124:return b20;case 125:return T20;case 126:return E20;case 127:return S20;case 128:return A20;case 129:return P20;case 130:return I20;case 131:return N20;case 132:return C20;default:return j20}switch(c){case 67:return gr0;case 68:return wr0;case 69:return _r0;case 70:return br0;case 71:return Tr0;case 72:return Er0;case 73:return Sr0;case 74:return Ar0;case 75:return Pr0;case 76:return Ir0;case 77:return Nr0;case 78:return Cr0;case 79:return jr0;case 80:return Or0;case 81:return Dr0;case 82:return Fr0;case 83:return Rr0;case 84:return Lr0;case 85:return Mr0;case 86:return qr0;case 87:return Br0;case 88:return Ur0;case 89:return Xr0;case 90:return Yr0;case 91:return zr0;case 92:return Kr0;case 93:return Jr0;case 94:return Gr0;case 95:return Wr0;case 96:return Vr0;case 97:return $r0;case 98:return Qr0;case 99:return Hr0;default:return Zr0}}if(34<=c)switch(c){case 34:return Ux0;case 35:return Xx0;case 36:return Yx0;case 37:return zx0;case 38:return Kx0;case 39:return Jx0;case 40:return Gx0;case 41:return Wx0;case 42:return Vx0;case 43:return $x0;case 44:return Qx0;case 45:return Hx0;case 46:return Zx0;case 47:return xr0;case 48:return rr0;case 49:return er0;case 50:return tr0;case 51:return nr0;case 52:return ur0;case 53:return ir0;case 54:return fr0;case 55:return cr0;case 56:return sr0;case 57:return ar0;case 58:return or0;case 59:return vr0;case 60:return lr0;case 61:return pr0;case 62:return kr0;case 63:return mr0;case 64:return hr0;case 65:return dr0;default:return yr0}switch(c){case 0:return fx0;case 1:return cx0;case 2:return sx0;case 3:return ax0;case 4:return ox0;case 5:return vx0;case 6:return lx0;case 7:return px0;case 8:return kx0;case 9:return mx0;case 10:return hx0;case 11:return dx0;case 12:return yx0;case 13:return gx0;case 14:return wx0;case 15:return _x0;case 16:return bx0;case 17:return Tx0;case 18:return Ex0;case 19:return Sx0;case 20:return Ax0;case 21:return Px0;case 22:return Ix0;case 23:return Nx0;case 24:return Cx0;case 25:return jx0;case 26:return Ox0;case 27:return Dx0;case 28:return Fx0;case 29:return Rx0;case 30:return Lx0;case 31:return Mx0;case 32:return qx0;default:return Bx0}}function D5(x){return d(sr(ix0),x)}function GC(x,r){var e=x?x[1]:0;x:{if(typeof r=="number"){if(kr===r){var t=z00,u=K00;break x}}else switch(r[0]){case 3:var t=J00,u=G00;break x;case 5:var t=W00,u=V00;break x;case 0:case 12:var t=Q00,u=H00;break x;case 1:case 13:var t=Z00,u=xx0;break x;case 4:case 8:var t=tx0,u=nx0;break x;case 6:case 7:case 11:break;default:var t=rx0,u=ex0;break x}var t=$00,u=D5(JC(r))}return e?Mx(t,Mx(ux0,u)):u}function Ub0(x){return Vo>>0)var t=w(x);else switch(e){case 0:var t=1;break;case 1:var t=2;break;case 2:var t=0;break;default:if(V(x,2),uo(y(x))===0){var u=Sv(y(x));if(u===0)var t=br(y(x))===0&&br(y(x))===0&&br(y(x))===0?0:w(x);else if(u===1&&br(y(x))===0){for(;;){var i=Ev(y(x));if(i!==0)break}var t=i===1?0:w(x)}else var t=w(x)}else var t=w(x)}if(2>>0)throw K0([0,Ir,Ct0],1);switch(t){case 0:break;case 1:return;default:if(!KC(pB(x))){mB(x,1);return}}}}function uh(x,r){var e=r-x[3][2]|0;return[0,IB(x),e]}function Z6(x,r,e){var t=uh(x,e),u=uh(x,r);return[0,x[1],u,t]}function P1(x,r){return uh(x,r[6])}function Ie(x,r){return uh(x,r[3])}function zr(x,r){return Z6(x,r[6],r[3])}function tU(x,r){x:if(typeof r!="number"){switch(r[0]){case 2:var e=r[1][1];break;case 3:return r[1][1];case 4:var e=r[1];break;case 5:return r[1];case 8:var e=r[2];break;case 9:return r[1];case 10:return r[1];default:break x}return e}return zr(x,x[2])}function I1(x,r,e){return[0,x[1],x[2],x[3],x[4],x[5],[0,[0,r,e],x[6]],x[7]]}function nU(x,r,e){return I1(x,r,[26,D5(e)])}function ZC(x,r,e,t){return I1(x,r,[27,e,t])}function lt(x,r){return I1(x,r,$c0)}function xe(x,r){var e=r[3],t=[0,IB(x)+1|0,e];return[0,x[1],x[2],t,x[4],x[5],x[6],x[7]]}function Lt(x,r,e,t,u){var i=[0,x[1],r,e],c=G2(t),v=u?0:1;return[0,i,[0,v,c,x[7][3][1]>>0)var a=w(t);else switch(v){case 0:var a=2;break;case 1:for(;;){V(t,3);var l=y(t),m=-1>>0)return bx(Yc0);switch(a){case 0:var b=iU(i,e,t,2,0),N=b[1],C=st(Mx(zc0,b[2])),I=0<=C?1:0,F=I&&(C<=55295?1:0);if(F)var Y=F;else var M=57344<=C?1:0,Y=M&&(C<=tk?1:0);var q=Y?uU(i,N,C):I1(i,N,28);ds(u,C);var i=q;break;case 1:var K=iU(i,e,t,3,1),u0=K[1],Q=st(Mx(Kc0,K[2])),e0=uU(i,u0,Q);ds(u,Q);var i=e0;break;case 2:return[0,i,G2(u)];default:P5(t,u)}}}function O2(x,r,e){var t=lt(x,zr(x,r));return el(r),e(t,r)}function Pv(x,r,e){for(var t=x;;){or(e);var u=y(e),i=-1>>0)var c=w(e);else switch(i){case 0:for(;;){V(e,3);var v=y(e),a=-1>>0){var h=lt(t,zr(t,e));return[0,h,Ie(h,e)]}switch(c){case 0:var T=xe(t,e);P5(e,r);var t=T;break;case 1:var b=t[4]?ZC(t,zr(t,e),Dt0,Ot0):t;return[0,b,Ie(b,e)];case 2:if(t[4])return[0,t,Ie(t,e)];ir(r,Ft0);break;default:P5(e,r)}}}function il(x,r,e){for(;;){or(e);var t=y(e),u=13>>0)var i=w(e);else switch(u){case 0:var i=0;break;case 1:for(;;){V(e,2);var c=y(e),v=-1>>0)return bx(Rt0);switch(i){case 0:return[0,x,Ie(x,e)];case 1:var a=Ie(x,e),l=a[2],m=a[1],h=xe(x,e);return[0,h,[0,m,l-A5(e)|0]];default:P5(e,r)}}}function cU(x,r){function e(u0){return V(u0,3),Z1(y(u0))===0?2:w(u0)}or(r);var t=y(r),u=mf>>0)var i=w(r);else switch(u){case 0:var i=0;break;case 1:var i=16;break;case 2:var i=15;break;case 3:V(r,15);var i=Pe(y(r))===0?15:w(r);break;case 4:V(r,4);var i=Z1(y(r))===0?e(r):w(r);break;case 5:V(r,11);var i=Z1(y(r))===0?e(r):w(r);break;case 6:var i=0;break;case 7:var i=5;break;case 8:var i=6;break;case 9:var i=7;break;case 10:var i=8;break;case 11:var i=9;break;case 12:V(r,14);var c=Sv(y(r));if(c===0)var i=br(y(r))===0&&br(y(r))===0&&br(y(r))===0?12:w(r);else if(c===1&&br(y(r))===0){for(;;){var v=Ev(y(r));if(v!==0)break}var i=v===1?13:w(r)}else var i=w(r);break;case 13:var i=10;break;default:V(r,14);var i=br(y(r))===0&&br(y(r))===0?1:w(r)}if(16>>0)return bx(Ic0);switch(i){case 0:var a=Ox(r);return[0,x,a,l2(r),0];case 1:var l=Ox(r);return[0,x,l,[0,st(Mx(Nc0,l))],0];case 2:var m=Ox(r),h=st(Mx(Cc0,m));return e6<=h?[0,x,m,[0,h>>>3|0,48+(h&7)|0],1]:[0,x,m,[0,h],1];case 3:var T=Ox(r);return[0,x,T,[0,st(Mx(jc0,T))],1];case 4:return[0,x,Oc0,[0,0],0];case 5:return[0,x,Dc0,[0,8],0];case 6:return[0,x,Fc0,[0,12],0];case 7:return[0,x,Rc0,[0,10],0];case 8:return[0,x,Lc0,[0,13],0];case 9:return[0,x,Mc0,[0,9],0];case 10:return[0,x,qc0,[0,11],0];case 11:var b=Ox(r);return[0,x,b,[0,st(Mx(Bc0,b))],1];case 12:var N=Ox(r);return[0,x,N,[0,st(Mx(Uc0,E1(N,1,Cx(N)-1|0)))],0];case 13:var C=Ox(r),I=st(Mx(Xc0,E1(C,2,Cx(C)-3|0))),F=tk>>0)var m=w(i);else switch(l){case 0:var m=3;break;case 1:for(;;){V(i,4);var h=y(i),T=-1>>0)return bx(Lt0);switch(m){case 0:var b=Ox(i);if(ir(t,b),_r(r,b))return[0,c,Ie(c,i),v];ir(e,b);break;case 1:ir(t,Mt0);var N=cU(c,i),C=N[4],I=N[3],F=N[2],M=N[1],Y=C||v;ir(t,F),nq(function(y0){return ds(e,y0)},I);var c=M,v=Y;break;case 2:var q=Ox(i);ir(t,q);var K=xe(lt(c,zr(c,i)),i);return ir(e,q),[0,K,Ie(K,i),v];case 3:var u0=Ox(i);ir(t,u0);var Q=lt(c,zr(c,i));return ir(e,u0),[0,Q,Ie(Q,i),v];default:var e0=i[6],f0=i[3]-e0|0,a0=E2(f0*4|0),Z=G6(i[1],e0,f0,a0);uC(t,a0,0,Z),uC(e,a0,0,Z)}}}function aU(x,r,e,t){for(var u=x;;){or(t);var i=y(t),c=96>>0)var v=w(t);else switch(c){case 0:var v=0;break;case 1:for(;;){V(t,6);var a=y(t),l=-1>>0)return bx(qt0);switch(v){case 0:return[0,lt(u,zr(u,t)),1];case 1:return[0,u,1];case 2:return[0,u,0];case 3:at(e,92);var T=cU(u,t),b=T[3],N=T[1];ir(e,T[2]),nq(function(F){return ds(r,F)},b);var u=N;break;case 4:ir(e,Bt0),ir(r,Ut0);var u=xe(u,t);break;case 5:ir(e,Ox(t)),at(r,10);var u=xe(u,t);break;default:var C=Ox(t);ir(e,C),ir(r,C)}}}function zb0(x,r,e){for(var t=x;;){or(e);var u=y(e),i=92>>0)var c=w(e);else switch(i){case 0:var c=0;break;case 1:for(;;){V(e,7);var v=y(e),a=-1>>0)var c=w(e);else switch(m){case 0:var c=2;break;case 1:var c=1;break;default:V(e,1);var c=Pe(y(e))===0?1:w(e)}}if(7>>0)return bx(zt0);switch(c){case 0:return[0,I1(t,zr(t,e),w1),Kt0];case 1:return[0,xe(I1(t,zr(t,e),w1),e),Jt0];case 2:ir(r,Ox(e));break;case 3:var h=Ox(e);return[0,t,E1(h,1,Cx(h)-1|0)];case 4:return[0,t,Gt0];case 5:at(r,91);x:{r:{e:{t:{n:for(;;){or(e);var T=y(e),b=93>>0)var N=w(e);else switch(b){case 0:var N=0;break;case 1:for(;;){V(e,5);var C=y(e),I=-1>>0)break r;switch(N){case 0:break e;case 1:ir(r,Yt0);break;case 2:at(r,92),at(r,93);break;case 3:break t;case 4:break n;default:ir(r,Ox(e))}}var Y=xe(I1(t,zr(t,e),w1),e);break x}at(r,93);var Y=t;break x}var Y=t;break x}var Y=bx(Xt0)}var t=Y;break;case 6:return[0,xe(I1(t,zr(t,e),w1),e),Wt0];default:ir(r,Ox(e))}}}function oU(x){var r=ux(x,"iexcl");if(0<=r){if(0>=r)return ac0;var e=ux(x,"prime");if(0<=e){if(0>=e)return sc0;var t=ux(x,"sup1");if(0<=t){if(0>=t)return cc0;var u=ux(x,"uarr");if(0<=u){if(0>=u)return fc0;var i=ux(x,"xi");if(0<=i){if(0>=i)return ic0;if(!P(x,"yacute"))return uc0;if(!P(x,"yen"))return nc0;if(!P(x,"yuml"))return tc0;if(!P(x,"zeta"))return ec0;if(!P(x,"zwj"))return rc0;if(!P(x,"zwnj"))return xc0}else{if(!P(x,"ucirc"))return Zf0;if(!P(x,"ugrave"))return Hf0;if(!P(x,"uml"))return Qf0;if(!P(x,"upsih"))return $f0;if(!P(x,"upsilon"))return Vf0;if(!P(x,"uuml"))return Wf0;if(!P(x,"weierp"))return Gf0}}else{var c=ux(x,"thetasym");if(0<=c){if(0>=c)return Jf0;if(!P(x,"thinsp"))return Kf0;if(!P(x,"thorn"))return zf0;if(!P(x,"tilde"))return Yf0;if(!P(x,"times"))return Xf0;if(!P(x,"trade"))return Uf0;if(!P(x,"uArr"))return Bf0;if(!P(x,"uacute"))return qf0}else{if(!P(x,"sup2"))return Mf0;if(!P(x,"sup3"))return Lf0;if(!P(x,"supe"))return Rf0;if(!P(x,"szlig"))return Ff0;if(!P(x,"tau"))return Df0;if(!P(x,"there4"))return Of0;if(!P(x,"theta"))return jf0}}}else{var v=ux(x,"rlm");if(0<=v){if(0>=v)return Cf0;var a=ux(x,"sigma");if(0<=a){if(0>=a)return Nf0;if(!P(x,"sigmaf"))return If0;if(!P(x,"sim"))return Pf0;if(!P(x,"spades"))return Af0;if(!P(x,"sub"))return Sf0;if(!P(x,"sube"))return Ef0;if(!P(x,"sum"))return Tf0;if(!P(x,"sup"))return bf0}else{if(!P(x,"rsaquo"))return _f0;if(!P(x,"rsquo"))return wf0;if(!P(x,"sbquo"))return gf0;if(!P(x,"scaron"))return yf0;if(!P(x,"sdot"))return df0;if(!P(x,"sect"))return hf0;if(!P(x,"shy"))return mf0}}else{var l=ux(x,"raquo");if(0<=l){if(0>=l)return kf0;if(!P(x,"rarr"))return pf0;if(!P(x,"rceil"))return lf0;if(!P(x,"rdquo"))return vf0;if(!P(x,"real"))return of0;if(!P(x,"reg"))return af0;if(!P(x,"rfloor"))return sf0;if(!P(x,"rho"))return cf0}else{if(!P(x,"prod"))return ff0;if(!P(x,"prop"))return if0;if(!P(x,"psi"))return uf0;if(!P(x,"quot"))return nf0;if(!P(x,"rArr"))return tf0;if(!P(x,"radic"))return ef0;if(!P(x,"rang"))return rf0}}}}else{var m=ux(x,"ndash");if(0<=m){if(0>=m)return xf0;var h=ux(x,"or");if(0<=h){if(0>=h)return Zi0;var T=ux(x,"part");if(0<=T){if(0>=T)return Hi0;if(!P(x,"permil"))return Qi0;if(!P(x,"perp"))return $i0;if(!P(x,"phi"))return Vi0;if(!P(x,"pi"))return Wi0;if(!P(x,"piv"))return Gi0;if(!P(x,"plusmn"))return Ji0;if(!P(x,"pound"))return Ki0}else{if(!P(x,"ordf"))return zi0;if(!P(x,"ordm"))return Yi0;if(!P(x,"oslash"))return Xi0;if(!P(x,"otilde"))return Ui0;if(!P(x,"otimes"))return Bi0;if(!P(x,"ouml"))return qi0;if(!P(x,"para"))return Mi0}}else{var b=ux(x,"oacute");if(0<=b){if(0>=b)return Li0;if(!P(x,"ocirc"))return Ri0;if(!P(x,"oelig"))return Fi0;if(!P(x,"ograve"))return Di0;if(!P(x,"oline"))return Oi0;if(!P(x,"omega"))return ji0;if(!P(x,"omicron"))return Ci0;if(!P(x,"oplus"))return Ni0}else{if(!P(x,"ne"))return Ii0;if(!P(x,"ni"))return Pi0;if(!P(x,"not"))return Ai0;if(!P(x,"notin"))return Si0;if(!P(x,"nsub"))return Ei0;if(!P(x,"ntilde"))return Ti0;if(!P(x,"nu"))return bi0}}}else{var N=ux(x,"le");if(0<=N){if(0>=N)return _i0;var C=ux(x,"macr");if(0<=C){if(0>=C)return wi0;if(!P(x,"mdash"))return gi0;if(!P(x,"micro"))return yi0;if(!P(x,"middot"))return di0;if(!P(x,uR))return hi0;if(!P(x,"mu"))return mi0;if(!P(x,"nabla"))return ki0;if(!P(x,"nbsp"))return pi0}else{if(!P(x,"lfloor"))return li0;if(!P(x,"lowast"))return vi0;if(!P(x,"loz"))return oi0;if(!P(x,"lrm"))return ai0;if(!P(x,"lsaquo"))return si0;if(!P(x,"lsquo"))return ci0;if(!P(x,"lt"))return fi0}}else{var I=ux(x,"kappa");if(0<=I){if(0>=I)return ii0;if(!P(x,"lArr"))return ui0;if(!P(x,"lambda"))return ni0;if(!P(x,"lang"))return ti0;if(!P(x,"laquo"))return ei0;if(!P(x,"larr"))return ri0;if(!P(x,"lceil"))return xi0;if(!P(x,"ldquo"))return Zu0}else{if(!P(x,"igrave"))return Hu0;if(!P(x,"image"))return Qu0;if(!P(x,"infin"))return $u0;if(!P(x,"iota"))return Vu0;if(!P(x,"iquest"))return Wu0;if(!P(x,"isin"))return Gu0;if(!P(x,"iuml"))return Ju0}}}}}else{var F=ux(x,"aelig");if(0<=F){if(0>=F)return Ku0;var M=ux(x,"delta");if(0<=M){if(0>=M)return zu0;var Y=ux(x,"fnof");if(0<=Y){if(0>=Y)return Yu0;var q=ux(x,"gt");if(0<=q){if(0>=q)return Xu0;if(!P(x,"hArr"))return Uu0;if(!P(x,"harr"))return Bu0;if(!P(x,"hearts"))return qu0;if(!P(x,"hellip"))return Mu0;if(!P(x,"iacute"))return Lu0;if(!P(x,"icirc"))return Ru0}else{if(!P(x,"forall"))return Fu0;if(!P(x,"frac12"))return Du0;if(!P(x,"frac14"))return Ou0;if(!P(x,"frac34"))return ju0;if(!P(x,"frasl"))return Cu0;if(!P(x,"gamma"))return Nu0;if(!P(x,"ge"))return Iu0}}else{var K=ux(x,"ensp");if(0<=K){if(0>=K)return Pu0;if(!P(x,"epsilon"))return Au0;if(!P(x,"equiv"))return Su0;if(!P(x,"eta"))return Eu0;if(!P(x,"eth"))return Tu0;if(!P(x,"euml"))return bu0;if(!P(x,"euro"))return _u0;if(!P(x,"exist"))return wu0}else{if(!P(x,"diams"))return gu0;if(!P(x,"divide"))return yu0;if(!P(x,"eacute"))return du0;if(!P(x,"ecirc"))return hu0;if(!P(x,"egrave"))return mu0;if(!P(x,Ee))return ku0;if(!P(x,"emsp"))return pu0}}}else{var u0=ux(x,"cap");if(0<=u0){if(0>=u0)return lu0;var Q=ux(x,"copy");if(0<=Q){if(0>=Q)return vu0;if(!P(x,"crarr"))return ou0;if(!P(x,"cup"))return au0;if(!P(x,"curren"))return su0;if(!P(x,"dArr"))return cu0;if(!P(x,"dagger"))return fu0;if(!P(x,"darr"))return iu0;if(!P(x,"deg"))return uu0}else{if(!P(x,"ccedil"))return nu0;if(!P(x,"cedil"))return tu0;if(!P(x,"cent"))return eu0;if(!P(x,"chi"))return ru0;if(!P(x,"circ"))return xu0;if(!P(x,"clubs"))return Z70;if(!P(x,"cong"))return H70}}else{var e0=ux(x,"aring");if(0<=e0){if(0>=e0)return Q70;if(!P(x,"asymp"))return $70;if(!P(x,"atilde"))return V70;if(!P(x,"auml"))return W70;if(!P(x,"bdquo"))return G70;if(!P(x,"beta"))return J70;if(!P(x,"brvbar"))return K70;if(!P(x,"bull"))return z70}else{if(!P(x,"agrave"))return Y70;if(!P(x,"alefsym"))return X70;if(!P(x,"alpha"))return U70;if(!P(x,"amp"))return B70;if(!P(x,"and"))return q70;if(!P(x,"ang"))return M70;if(!P(x,"apos"))return L70}}}}else{var f0=ux(x,"Nu");if(0<=f0){if(0>=f0)return R70;var a0=ux(x,"Sigma");if(0<=a0){if(0>=a0)return F70;var Z=ux(x,"Uuml");if(0<=Z){if(0>=Z)return D70;if(!P(x,"Xi"))return O70;if(!P(x,"Yacute"))return j70;if(!P(x,"Yuml"))return C70;if(!P(x,"Zeta"))return N70;if(!P(x,"aacute"))return I70;if(!P(x,"acirc"))return P70;if(!P(x,"acute"))return A70}else{if(!P(x,"THORN"))return S70;if(!P(x,"Tau"))return E70;if(!P(x,"Theta"))return T70;if(!P(x,"Uacute"))return b70;if(!P(x,"Ucirc"))return _70;if(!P(x,"Ugrave"))return w70;if(!P(x,"Upsilon"))return g70}}else{var v0=ux(x,"Otilde");if(0<=v0){if(0>=v0)return y70;if(!P(x,"Ouml"))return d70;if(!P(x,"Phi"))return h70;if(!P(x,"Pi"))return m70;if(!P(x,"Prime"))return k70;if(!P(x,"Psi"))return p70;if(!P(x,"Rho"))return l70;if(!P(x,"Scaron"))return v70}else{if(!P(x,"OElig"))return o70;if(!P(x,"Oacute"))return a70;if(!P(x,"Ocirc"))return s70;if(!P(x,"Ograve"))return c70;if(!P(x,"Omega"))return f70;if(!P(x,"Omicron"))return i70;if(!P(x,"Oslash"))return u70}}}else{var t0=ux(x,"Eacute");if(0<=t0){if(0>=t0)return n70;var y0=ux(x,"Icirc");if(0<=y0){if(0>=y0)return t70;if(!P(x,"Igrave"))return e70;if(!P(x,"Iota"))return r70;if(!P(x,"Iuml"))return x70;if(!P(x,"Kappa"))return Zn0;if(!P(x,"Lambda"))return Hn0;if(!P(x,"Mu"))return Qn0;if(!P(x,"Ntilde"))return $n0}else{if(!P(x,"Ecirc"))return Vn0;if(!P(x,"Egrave"))return Wn0;if(!P(x,"Epsilon"))return Gn0;if(!P(x,"Eta"))return Jn0;if(!P(x,"Euml"))return Kn0;if(!P(x,"Gamma"))return zn0;if(!P(x,"Iacute"))return Yn0}}else{var n0=ux(x,"Atilde");if(0<=n0){if(0>=n0)return Xn0;if(!P(x,"Auml"))return Un0;if(!P(x,"Beta"))return Bn0;if(!P(x,"Ccedil"))return qn0;if(!P(x,"Chi"))return Mn0;if(!P(x,"Dagger"))return Ln0;if(!P(x,"Delta"))return Rn0;if(!P(x,"ETH"))return Fn0}else{if(!P(x,"'int'"))return Dn0;if(!P(x,"AElig"))return On0;if(!P(x,"Aacute"))return jn0;if(!P(x,"Acirc"))return Cn0;if(!P(x,"Agrave"))return Nn0;if(!P(x,"Alpha"))return In0;if(!P(x,"Aring"))return Pn0}}}}}return 0}function vU(x,r,e,t){for(var u=x;;){var i=function(v0){for(;;)if(V(v0,8),VC(y(v0))!==0)return w(v0)};or(t);var c=y(t),v=qa>>0)var a=w(t);else switch(v){case 0:var a=3;break;case 1:var a=i(t);break;case 2:var a=4;break;case 3:V(t,4);var a=Pe(y(t))===0?4:w(t);break;case 4:V(t,8);var l=rU(y(t));if(l===0){var m=DB(y(t));if(m===0){for(;;){var h=FB(y(t));if(h!==0)break}var a=h===1?6:w(t)}else if(m===1&&br(y(t))===0){for(;;){var T=HB(y(t));if(T!==0)break}var a=T===1?5:w(t)}else var a=w(t)}else if(l===1&&cr(y(t))===0){var b=Rt(y(t));if(b===0){var N=Rt(y(t));if(N===0){var C=Rt(y(t));if(C===0){var I=Rt(y(t));if(I===0){var F=Rt(y(t));if(F===0)var M=Rt(y(t)),a=M===0?WB(y(t))===0?7:w(t):M===1?7:w(t);else var a=F===1?7:w(t)}else var a=I===1?7:w(t)}else var a=C===1?7:w(t)}else var a=N===1?7:w(t)}else var a=b===1?7:w(t)}else var a=w(t);break;case 5:var a=0;break;case 6:V(t,1);var a=VC(y(t))===0?i(t):w(t);break;default:V(t,2);var a=VC(y(t))===0?i(t):w(t)}if(8>>0)return bx(Vt0);switch(a){case 0:return el(t),u;case 1:return ZC(u,zr(u,t),Qt0,$t0);case 2:return ZC(u,zr(u,t),Zt0,Ht0);case 3:return lt(u,zr(u,t));case 4:var Y=Ox(t);ir(e,Y),ir(r,Y);var u=xe(u,t);break;case 5:var q=Ox(t),K=E1(q,3,Cx(q)-4|0);ir(e,q),ds(r,st(Mx(xn0,K)));break;case 6:var u0=Ox(t),Q=E1(u0,2,Cx(u0)-3|0);ir(e,u0),ds(r,st(Q));break;case 7:var e0=Ox(t),f0=E1(e0,1,Cx(e0)-2|0);ir(e,e0);var a0=oU(f0);a0?ds(r,a0[1]):ir(r,Mx(en0,Mx(f0,rn0)));break;default:var Z=Ox(t);ir(e,Z),ir(r,Z)}}}function x4(x){return function(r){var e=0,t=r;x:for(;;){var u=x(t,t[2]);switch(u[0]){case 0:break x;case 1:var i=u[2],c=u[1],e=[0,i,e],t=[0,c[1],c[2],c[3],c[4],c[5],c[6],i[1]];break;default:var t=u[1]}}var v=u[2],a=u[1],l=tU(a,v),m=e===0?0:tx(e),h=a[6];if(h===0)return[0,[0,a[1],a[2],a[3],a[4],a[5],a[6],l],[0,v,l,0,m]];var T=[0,v,l,tx(h),m];return[0,[0,a[1],a[2],a[3],a[4],a[5],AB,l],T]}}var Kb0=x4(function(x,r){or(r);var e=y(r),t=Vo>>0)var u=w(r);else switch(t){case 0:var u=0;break;case 1:var u=6;break;case 2:if(V(r,2),gs(y(r))===0){for(;V(r,2),gs(y(r))===0;);var u=w(r)}else var u=w(r);break;case 3:var u=1;break;case 4:V(r,1);var u=Pe(y(r))===0?1:w(r);break;default:V(r,5);var i=rh(y(r)),u=i===0?4:i===1?3:w(r)}if(6>>0)return bx(oc0);switch(u){case 0:return[0,x,kr];case 1:return[2,xe(x,r)];case 2:return[2,x];case 3:var c=P1(x,r),v=Wr(Xr),a=il(x,v,r),l=a[1];return[1,l,Lt(l,c,a[2],v,0)];case 4:var m=P1(x,r),h=Wr(Xr),T=Pv(x,h,r),b=T[1];return[1,b,Lt(b,m,T[2],h,1)];case 5:var N=P1(x,r),C=Wr(Xr),I=zb0(x,C,r),F=I[1],M=I[2],Y=Ie(F,r),q=[0,F[1],N,Y];return[0,F,[5,q,G2(C),M]];default:var K=lt(x,zr(x,r));return[0,K,[7,Ox(r)]]}}),Jb0=x4(function(x,r){or(r);var e=Yb0(y(r));if(14>>0)var t=w(r);else switch(e){case 0:var t=0;break;case 1:var t=14;break;case 2:if(V(r,2),gs(y(r))===0){for(;V(r,2),gs(y(r))===0;);var t=w(r)}else var t=w(r);break;case 3:var t=1;break;case 4:V(r,1);var t=Pe(y(r))===0?1:w(r);break;case 5:var t=12;break;case 6:var t=13;break;case 7:var t=10;break;case 8:V(r,6);var u=rh(y(r)),t=u===0?4:u===1?3:w(r);break;case 9:var t=9;break;case 10:var t=5;break;case 11:var t=11;break;case 12:var t=7;break;case 13:if(V(r,14),uo(y(r))===0){var i=Sv(y(r));if(i===0)var t=br(y(r))===0&&br(y(r))===0&&br(y(r))===0?13:w(r);else if(i===1&&br(y(r))===0){for(;;){var c=Ev(y(r));if(c!==0)break}var t=c===1?13:w(r)}else var t=w(r)}else var t=w(r);break;default:var t=8}if(14>>0)return bx(An0);switch(t){case 0:return[0,x,kr];case 1:return[2,xe(x,r)];case 2:return[2,x];case 3:var v=P1(x,r),a=Wr(Xr),l=il(x,a,r),m=l[1];return[1,m,Lt(m,v,l[2],a,0)];case 4:var h=P1(x,r),T=Wr(Xr),b=Pv(x,T,r),N=b[1];return[1,N,Lt(N,h,b[2],T,1)];case 5:return[0,x,99];case 6:return[0,x,vn];case 7:return[0,x,y2];case 8:return[0,x,0];case 9:return[0,x,87];case 10:return[0,x,10];case 11:return[0,x,83];case 12:var C=Ox(r),I=P1(x,r),F=Wr(Xr),M=Wr(Xr);ir(M,C);for(var Y=_r(C,"'"),q=x;;){or(r);var K=y(r),u0=39>>0)var Q=w(r);else switch(u0){case 0:var Q=2;break;case 1:for(;;){V(r,7);var e0=y(r),f0=-1>>0)var I0=bx(tn0);else switch(Q){case 0:if(!Y){at(M,39),at(F,39);continue}var I0=q;break;case 1:if(Y){at(M,34),at(F,34);continue}var I0=q;break;case 2:var I0=lt(q,zr(q,r));break;case 3:var j0=Ox(r);ir(M,j0),ir(F,j0);var q=xe(q,r);continue;case 4:var S0=Ox(r),W0=E1(S0,3,Cx(S0)-4|0);ir(M,S0),ds(F,st(Mx(nn0,W0)));continue;case 5:var A0=Ox(r),J0=E1(A0,2,Cx(A0)-3|0);ir(M,A0),ds(F,st(J0));continue;case 6:var b0=Ox(r),z=E1(b0,1,Cx(b0)-2|0);ir(M,b0);var C0=oU(z);C0?ds(F,C0[1]):ir(F,Mx(in0,Mx(z,un0)));continue;default:var V0=Ox(r);ir(M,V0),ir(F,V0);continue}var N0=Ie(I0,r);ir(M,C);var rx=G2(F),xx=G2(M);return[0,I0,[10,[0,I0[1],I,N0],rx,xx]]}case 13:for(var nx=r[6];;){or(r);var mx=y(r),F0=c2>>0)var px=w(r);else switch(F0){case 0:var px=1;break;case 1:var px=2;break;case 2:var px=0;break;default:if(V(r,2),uo(y(r))===0){var dx=Sv(y(r));if(dx===0)var px=br(y(r))===0&&br(y(r))===0&&br(y(r))===0?0:w(r);else if(dx===1&&br(y(r))===0){for(;;){var W=Ev(y(r));if(W!==0)break}var px=W===1?0:w(r)}else var px=w(r)}else var px=w(r)}if(2>>0)throw K0([0,Ir,jt0],1);switch(px){case 0:continue;case 1:break;default:if(KC(pB(r)))continue;mB(r,1)}var g0=r[3];MC(r,nx);var B=l2(r),h0=Z6(x,nx,g0);return[0,x,[8,V6(B),h0]]}default:return[0,x,[7,Ox(r)]]}}),Gb0=x4(function(x,r){or(r);var e=y(r),t=-1>>0)var u=w(r);else switch(t){case 0:var u=5;break;case 1:if(V(r,1),gs(y(r))===0){for(;V(r,1),gs(y(r))===0;);var u=w(r)}else var u=w(r);break;case 2:var u=0;break;case 3:V(r,0);var u=Pe(y(r))===0?0:w(r);break;case 4:V(r,5);var i=rh(y(r)),u=i===0?3:i===1?2:w(r);break;default:var u=4}if(5>>0)return bx(bn0);switch(u){case 0:return[2,xe(x,r)];case 1:return[2,x];case 2:var c=P1(x,r),v=Wr(Xr),a=il(x,v,r),l=a[1];return[1,l,Lt(l,c,a[2],v,0)];case 3:var m=P1(x,r),h=Wr(Xr),T=Pv(x,h,r),b=T[1];return[1,b,Lt(b,m,T[2],h,1)];case 4:var N=P1(x,r),C=Wr(Xr),I=Wr(Xr),F=aU(x,C,I,r),M=F[1],Y=F[2],q=Ie(M,r),K=[0,M[1],N,q],u0=G2(I);return[0,M,[3,[0,K,G2(C),u0,0,Y]]];default:var Q=lt(x,zr(x,r));return[0,Q,[3,[0,zr(Q,r),En0,Tn0,0,1]]]}}),Wb0=x4(function(x,r){function e(S){for(;;)if(V(S,29),cr(y(S))!==0)return w(S)}function t(S){V(S,29);var G=VB(y(S));if(3>>0)return w(S);switch(G){case 0:return e(S);case 1:var Z0=ro(y(S));if(Z0===0)for(;;){V(S,24);var yx=tl(y(S));if(2>>0)return w(S);switch(yx){case 0:return u(S);case 1:break;default:return i(S)}}else{if(Z0!==1)return w(S);for(;;){V(S,24);var Tx=_s(y(S));if(3>>0)return w(S);switch(Tx){case 0:return u(S);case 1:break;case 2:return c(S);default:return i(S)}}}break;case 2:for(;;){V(S,24);var ex=tl(y(S));if(2>>0)return w(S);switch(ex){case 0:return v(S);case 1:break;default:return a(S)}}break;default:for(;;){V(S,24);var m0=_s(y(S));if(3>>0)return w(S);switch(m0){case 0:return v(S);case 1:break;case 2:return c(S);default:return a(S)}}}}function u(S){for(;;)if(V(S,23),cr(y(S))!==0)return w(S)}function i(S){V(S,22);var G=X2(y(S));if(G!==0)return G===1?u(S):w(S);for(;;)if(V(S,21),cr(y(S))!==0)return w(S)}function c(S){for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,24);var G=_s(y(S));if(3>>0)return w(S);switch(G){case 0:return u(S);case 1:break;case 2:break x;default:return i(S)}}}}function v(S){for(;;)if(V(S,23),cr(y(S))!==0)return w(S)}function a(S){V(S,22);var G=X2(y(S));if(G!==0)return G===1?v(S):w(S);for(;;)if(V(S,21),cr(y(S))!==0)return w(S)}function l(S){V(S,27);var G=X2(y(S));if(G!==0)return G===1?e(S):w(S);for(;;)if(V(S,25),cr(y(S))!==0)return w(S)}function m(S){return V(S,3),xU(y(S))===0?3:w(S)}function h(S){return H5(y(S))===0&&W5(y(S))===0&&QB(y(S))===0&&UB(y(S))===0&&XB(y(S))===0&&G5(y(S))===0&&Q6(y(S))===0&&H5(y(S))===0&&uo(y(S))===0&&HC(y(S))===0&&Av(y(S))===0?3:w(S)}function T(S){V(S,30);var G=qB(y(S));if(3>>0)return w(S);switch(G){case 0:return e(S);case 1:x:for(;;){V(S,30);var Z0=eo(y(S));if(4>>0)return w(S);switch(Z0){case 0:return e(S);case 1:break;case 2:return t(S);case 3:break x;default:return l(S)}}for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,30);var yx=eo(y(S));if(4>>0)return w(S);switch(yx){case 0:return e(S);case 1:break;case 2:return t(S);case 3:break x;default:return l(S)}}}break;case 2:return t(S);default:return l(S)}}function b(S){for(;;)if(V(S,15),cr(y(S))!==0)return w(S)}function N(S){V(S,30);var G=tl(y(S));if(2>>0)return w(S);switch(G){case 0:return e(S);case 1:x:for(;;){V(S,30);var Z0=_s(y(S));if(3>>0)return w(S);switch(Z0){case 0:return e(S);case 1:break;case 2:break x;default:return l(S)}}for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,30);var yx=_s(y(S));if(3>>0)return w(S);switch(yx){case 0:return e(S);case 1:break;case 2:break x;default:return l(S)}}}break;default:return l(S)}}function C(S){V(S,15);var G=X2(y(S));if(G!==0)return G===1?b(S):w(S);for(;;)if(V(S,15),cr(y(S))!==0)return w(S)}function I(S){V(S,28);var G=X2(y(S));if(G!==0)return G===1?e(S):w(S);for(;;)if(V(S,26),cr(y(S))!==0)return w(S)}function F(S){for(;;)if(V(S,9),cr(y(S))!==0)return w(S)}function M(S){for(;;)if(V(S,9),cr(y(S))!==0)return w(S)}function Y(S){for(;;)if(V(S,13),cr(y(S))!==0)return w(S)}function q(S){for(;;)if(V(S,13),cr(y(S))!==0)return w(S)}function K(S){for(;;)if(V(S,19),cr(y(S))!==0)return w(S)}function u0(S){for(;;)if(V(S,19),cr(y(S))!==0)return w(S)}function Q(S){for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,30);var G=GB(y(S));if(4>>0)return w(S);switch(G){case 0:return e(S);case 1:return N(S);case 2:break;case 3:break x;default:return I(S)}}}}or(r);var e0=function(S){var G=Xb0(y(S));if(31>>0)return w(S);switch(G){case 0:return 66;case 1:return 67;case 2:if(V(S,1),gs(y(S))!==0)return w(S);for(;;)if(V(S,1),gs(y(S))!==0)return w(S);break;case 3:return 0;case 4:return V(S,0),Pe(y(S))===0?0:w(S);case 5:return 6;case 6:return 65;case 7:if(V(S,67),Q6(y(S))!==0)return w(S);var Z0=y(S),yx=F1>>0)return w(S);switch(qx){case 0:return e(S);case 1:break;case 2:return t(S);case 3:break x;default:return l(S)}}for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,30);var O0=eo(y(S));if(4>>0)return w(S);switch(O0){case 0:return e(S);case 1:break;case 2:return t(S);case 3:break x;default:return l(S)}}}break;case 16:V(S,67);var Wx=rh(y(S));if(Wx!==0)return Wx===1?5:w(S);V(S,2);var Yx=U5(y(S));if(2>>0)return w(S);switch(Yx){case 0:for(;;){var fx=U5(y(S));if(2>>0)return w(S);switch(fx){case 0:break;case 1:return m(S);default:return h(S)}}break;case 1:return m(S);default:return h(S)}break;case 17:V(S,30);var Qx=zB(y(S));if(8>>0)return w(S);switch(Qx){case 0:return e(S);case 1:return T(S);case 2:x:for(;;){V(S,16);var vx=$B(y(S));if(4>>0)return w(S);switch(vx){case 0:return b(S);case 1:return N(S);case 2:break;case 3:break x;default:return C(S)}}for(;;){V(S,15);var nr=B5(y(S));if(3>>0)return w(S);switch(nr){case 0:return b(S);case 1:return N(S);case 2:break;default:return C(S)}}break;case 3:for(;;){V(S,30);var gr=B5(y(S));if(3>>0)return w(S);switch(gr){case 0:return e(S);case 1:return N(S);case 2:break;default:return I(S)}}break;case 4:V(S,29);var Nr=YB(y(S));if(Nr===0)return e(S);if(Nr!==1)return w(S);x:{r:for(;;){V(S,10);var s2=eh(y(S));if(3>>0)return w(S);switch(s2){case 0:return F(S);case 1:break;case 2:break x;default:break r}}V(S,8);var b2=X2(y(S));if(b2!==0)return b2===1?F(S):w(S);for(;;)if(V(S,7),cr(y(S))!==0)return w(S)}x:for(;;){if(ws(y(S))!==0)return w(S);r:for(;;){V(S,10);var k2=eh(y(S));if(3>>0)return w(S);switch(k2){case 0:return M(S);case 1:break;case 2:break r;default:break x}}}V(S,8);var F2=X2(y(S));if(F2!==0)return F2===1?M(S):w(S);for(;;)if(V(S,7),cr(y(S))!==0)return w(S);break;case 5:return t(S);case 6:V(S,29);var jx=KB(y(S));if(jx===0)return e(S);if(jx!==1)return w(S);x:{r:for(;;){V(S,14);var _=xh(y(S));if(3<_>>>0)return w(S);switch(_){case 0:return Y(S);case 1:break;case 2:break x;default:break r}}V(S,12);var $=X2(y(S));if($!==0)return $===1?Y(S):w(S);for(;;)if(V(S,11),cr(y(S))!==0)return w(S)}x:for(;;){if(Z1(y(S))!==0)return w(S);r:for(;;){V(S,14);var ix=xh(y(S));if(3>>0)return w(S);switch(ix){case 0:return q(S);case 1:break;case 2:break r;default:break x}}}V(S,12);var U0=X2(y(S));if(U0!==0)return U0===1?q(S):w(S);for(;;)if(V(S,11),cr(y(S))!==0)return w(S);break;case 7:V(S,29);var cx=RB(y(S));if(cx===0)return e(S);if(cx!==1)return w(S);x:{r:for(;;){V(S,20);var wx=th(y(S));if(3>>0)return w(S);switch(wx){case 0:return K(S);case 1:break;case 2:break x;default:break r}}V(S,18);var Or=X2(y(S));if(Or!==0)return Or===1?K(S):w(S);for(;;)if(V(S,17),cr(y(S))!==0)return w(S)}x:for(;;){if(br(y(S))!==0)return w(S);r:for(;;){V(S,20);var Hx=th(y(S));if(3>>0)return w(S);switch(Hx){case 0:return u0(S);case 1:break;case 2:break r;default:break x}}}V(S,18);var x2=X2(y(S));if(x2!==0)return x2===1?u0(S):w(S);for(;;)if(V(S,17),cr(y(S))!==0)return w(S);break;default:return I(S)}break;case 18:V(S,30);var hr=Y5(y(S));if(5
>>0)return w(S);switch(hr){case 0:return e(S);case 1:return T(S);case 2:for(;;){V(S,30);var Dr=Y5(y(S));if(5>>0)return w(S);switch(Dr){case 0:return e(S);case 1:return T(S);case 2:break;case 3:return t(S);case 4:return Q(S);default:return I(S)}}break;case 3:return t(S);case 4:return Q(S);default:return I(S)}break;case 19:return 44;case 20:return 42;case 21:return 49;case 22:V(S,51);var r2=y(S),sx=61>>0)return bx(yn0);var f0=e0;if(34>f0)switch(f0){case 0:return[2,xe(x,r)];case 1:return[2,x];case 2:var a0=P1(x,r),Z=Wr(Xr),v0=Pv(x,Z,r),t0=v0[1];return[1,t0,Lt(t0,a0,v0[2],Z,1)];case 3:var y0=Ox(r);if(!x[5]){var n0=P1(x,r),s0=Wr(Xr);ir(s0,y0);var l0=Pv(x,s0,r),w0=l0[1];return[1,w0,Lt(w0,n0,l0[2],s0,1)]}var L0=x[4]?nU(x,zr(x,r),y0):x,I0=O5(1,L0),j0=A5(r);return _r(W6(r,j0-1|0,1),Uo)&&P(W6(r,j0-2|0,1),Uo)?[0,I0,87]:[2,I0];case 4:if(x[4])return[2,O5(0,x)];el(r),or(r);var S0=MB(y(r))===0?0:w(r);return S0===0?[0,x,K2]:bx(gn0);case 5:var W0=P1(x,r),A0=Wr(Xr),J0=il(x,A0,r),b0=J0[1];return[1,b0,Lt(b0,W0,J0[2],A0,0)];case 6:var z=Ox(r),C0=P1(x,r),V0=Wr(Xr),N0=Wr(Xr);ir(N0,z);var rx=sU(x,z,V0,N0,0,r),xx=rx[1],nx=rx[3],mx=[0,xx[1],C0,rx[2]],F0=G2(N0);return[0,xx,[2,[0,mx,G2(V0),F0,nx]]];case 7:return O2(x,r,function(S,G){or(G);x:if(Ae(y(G))===0&&K5(y(G))===0&&ws(y(G))===0){r:for(;;){var Z0=M5(y(G));if(2>>0){var ex=w(G);break x}switch(Z0){case 0:break;case 1:break r;default:var ex=0;break x}}for(;;){r:{if(ws(y(G))===0){e:for(;;){var yx=M5(y(G));if(2>>0){var Tx=w(G);break r}switch(yx){case 0:break;case 1:break e;default:var Tx=0;break r}}continue}var Tx=w(G)}var ex=Tx;break}}else var ex=w(G);return ex===0?[0,S,qt(0,l2(G))]:bx(dn0)});case 8:return[0,x,qt(0,l2(r))];case 9:return O2(x,r,function(S,G){if(or(G),Ae(y(G))===0&&K5(y(G))===0&&ws(y(G))===0){for(;;){V(G,0);var Z0=L5(y(G));if(Z0!==0)break}if(Z0===1)for(;;){if(ws(y(G))===0){for(;;){V(G,0);var yx=L5(y(G));if(yx!==0)break}if(yx===1)continue;var Tx=w(G)}else var Tx=w(G);var ex=Tx;break}else var ex=w(G)}else var ex=w(G);return ex===0?[0,S,Mt(0,l2(G))]:bx(hn0)});case 10:return[0,x,Mt(0,l2(r))];case 11:return O2(x,r,function(S,G){or(G);x:if(Ae(y(G))===0&&$5(y(G))===0&&Z1(y(G))===0){r:for(;;){var Z0=z5(y(G));if(2>>0){var ex=w(G);break x}switch(Z0){case 0:break;case 1:break r;default:var ex=0;break x}}for(;;){r:{if(Z1(y(G))===0){e:for(;;){var yx=z5(y(G));if(2>>0){var Tx=w(G);break r}switch(yx){case 0:break;case 1:break e;default:var Tx=0;break r}}continue}var Tx=w(G)}var ex=Tx;break}}else var ex=w(G);return ex===0?[0,S,qt(1,l2(G))]:bx(mn0)});case 12:return[0,x,qt(1,l2(r))];case 13:return O2(x,r,function(S,G){if(or(G),Ae(y(G))===0&&$5(y(G))===0&&Z1(y(G))===0){for(;;){V(G,0);var Z0=X5(y(G));if(Z0!==0)break}if(Z0===1)for(;;){if(Z1(y(G))===0){for(;;){V(G,0);var yx=X5(y(G));if(yx!==0)break}if(yx===1)continue;var Tx=w(G)}else var Tx=w(G);var ex=Tx;break}else var ex=w(G)}else var ex=w(G);return ex===0?[0,S,Mt(3,l2(G))]:bx(kn0)});case 14:return[0,x,Mt(3,l2(r))];case 15:return O2(x,r,function(S,G){if(or(G),Ae(y(G))===0&&Z1(y(G))===0){for(;;)if(V(G,0),Z1(y(G))!==0){var Z0=w(G);break}}else var Z0=w(G);return Z0===0?[0,S,Mt(1,l2(G))]:bx(pn0)});case 16:return[0,x,Mt(1,l2(r))];case 17:return O2(x,r,function(S,G){or(G);x:if(Ae(y(G))===0&&F5(y(G))===0&&br(y(G))===0){r:for(;;){var Z0=q5(y(G));if(2>>0){var ex=w(G);break x}switch(Z0){case 0:break;case 1:break r;default:var ex=0;break x}}for(;;){r:{if(br(y(G))===0){e:for(;;){var yx=q5(y(G));if(2>>0){var Tx=w(G);break r}switch(yx){case 0:break;case 1:break e;default:var Tx=0;break r}}continue}var Tx=w(G)}var ex=Tx;break}}else var ex=w(G);return ex===0?[0,S,qt(2,l2(G))]:bx(ln0)});case 18:return[0,x,qt(2,l2(r))];case 19:return O2(x,r,function(S,G){if(or(G),Ae(y(G))===0&&F5(y(G))===0&&br(y(G))===0){for(;;){V(G,0);var Z0=Z5(y(G));if(Z0!==0)break}if(Z0===1)for(;;){if(br(y(G))===0){for(;;){V(G,0);var yx=Z5(y(G));if(yx!==0)break}if(yx===1)continue;var Tx=w(G)}else var Tx=w(G);var ex=Tx;break}else var ex=w(G)}else var ex=w(G);return ex===0?[0,S,Mt(4,l2(G))]:bx(vn0)});case 20:return[0,x,Mt(4,l2(r))];case 21:return O2(x,r,function(S,G){function Z0(vx){var nr=nh(y(vx));if(2>>0)return w(vx);switch(nr){case 0:var gr=ro(y(vx));return gr===0?yx(vx):gr===1?Tx(vx):w(vx);case 1:return yx(vx);default:return Tx(vx)}}function yx(vx){for(;;){var nr=nl(y(vx));if(nr!==0)return nr===1?0:w(vx)}}function Tx(vx){for(;;){var nr=Ft(y(vx));if(2>>0)return w(vx);switch(nr){case 0:break;case 1:for(;;){if(vr(y(vx))!==0)return w(vx);x:for(;;){var gr=Ft(y(vx));if(2>>0)return w(vx);switch(gr){case 0:break;case 1:break x;default:return 0}}}break;default:return 0}}}function ex(vx){var nr=Q5(y(vx));if(nr!==0)return nr===1?Z0(vx):w(vx);x:for(;;){var gr=le(y(vx));if(2>>0)return w(vx);switch(gr){case 0:break;case 1:return Z0(vx);default:break x}}for(;;){if(vr(y(vx))!==0)return w(vx);x:for(;;){var Nr=le(y(vx));if(2>>0)return w(vx);switch(Nr){case 0:break;case 1:return Z0(vx);default:break x}}}}or(G);var m0=xo(y(G));if(2>>0)var Dx=w(G);else x:switch(m0){case 0:if(vr(y(G))===0){r:for(;;){var Ex=le(y(G));if(2>>0){var Dx=w(G);break x}switch(Ex){case 0:break;case 1:var Dx=Z0(G);break x;default:break r}}for(;;){r:{if(vr(y(G))===0){e:for(;;){var qx=le(y(G));if(2>>0){var O0=w(G);break r}switch(qx){case 0:break;case 1:var O0=Z0(G);break r;default:break e}}continue}var O0=w(G)}var Dx=O0;break}}else var Dx=w(G);break;case 1:var Wx=R5(y(G)),Dx=Wx===0?ex(G):Wx===1?Z0(G):w(G);break;default:r:for(;;){var Yx=V5(y(G));if(2>>0){var Dx=w(G);break}switch(Yx){case 0:var Dx=ex(G);break r;case 1:break;default:var Dx=Z0(G);break r}}}if(Dx!==0)return bx(on0);var fx=l2(G),Qx=I1(S,zr(S,G),42);return[0,Qx,qt(2,fx)]});case 22:var px=l2(r),dx=I1(x,zr(x,r),42);return[0,dx,qt(2,px)];case 23:return O2(x,r,function(S,G){function Z0(fx){var Qx=nh(y(fx));if(2>>0)return w(fx);switch(Qx){case 0:var vx=ro(y(fx));return vx===0?yx(fx):vx===1?Tx(fx):w(fx);case 1:return yx(fx);default:return Tx(fx)}}function yx(fx){for(;;)if(V(fx,0),vr(y(fx))!==0)return w(fx)}function Tx(fx){for(;;){V(fx,0);var Qx=to(y(fx));if(Qx!==0){if(Qx!==1)return w(fx);for(;;){if(vr(y(fx))!==0)return w(fx);for(;;){V(fx,0);var vx=to(y(fx));if(vx!==0)break}if(vx!==1)return w(fx)}}}}function ex(fx){var Qx=Q5(y(fx));if(Qx!==0)return Qx===1?Z0(fx):w(fx);x:for(;;){var vx=le(y(fx));if(2>>0)return w(fx);switch(vx){case 0:break;case 1:return Z0(fx);default:break x}}for(;;){if(vr(y(fx))!==0)return w(fx);x:for(;;){var nr=le(y(fx));if(2>>0)return w(fx);switch(nr){case 0:break;case 1:return Z0(fx);default:break x}}}}or(G);var m0=xo(y(G));if(2>>0)var Dx=w(G);else x:switch(m0){case 0:if(vr(y(G))===0){r:for(;;){var Ex=le(y(G));if(2>>0){var Dx=w(G);break x}switch(Ex){case 0:break;case 1:var Dx=Z0(G);break x;default:break r}}for(;;){r:{if(vr(y(G))===0){e:for(;;){var qx=le(y(G));if(2>>0){var O0=w(G);break r}switch(qx){case 0:break;case 1:var O0=Z0(G);break r;default:break e}}continue}var O0=w(G)}var Dx=O0;break}}else var Dx=w(G);break;case 1:var Wx=R5(y(G)),Dx=Wx===0?ex(G):Wx===1?Z0(G):w(G);break;default:r:for(;;){var Yx=V5(y(G));if(2>>0){var Dx=w(G);break}switch(Yx){case 0:var Dx=ex(G);break r;case 1:break;default:var Dx=Z0(G);break r}}}return Dx===0?[0,S,Mt(4,l2(G))]:bx(an0)});case 24:return[0,x,Mt(4,l2(r))];case 25:return O2(x,r,function(S,G){function Z0(Yx){for(;;){var fx=Ft(y(Yx));if(2>>0)return w(Yx);switch(fx){case 0:break;case 1:for(;;){if(vr(y(Yx))!==0)return w(Yx);x:for(;;){var Qx=Ft(y(Yx));if(2>>0)return w(Yx);switch(Qx){case 0:break;case 1:break x;default:return 0}}}break;default:return 0}}}function yx(Yx){var fx=nl(y(Yx));return fx===0?Z0(Yx):fx===1?0:w(Yx)}or(G);var Tx=xo(y(G));if(2>>0)var ex=w(G);else x:switch(Tx){case 0:var ex=vr(y(G))===0?Z0(G):w(G);break;case 1:for(;;){var m0=ul(y(G));if(m0===0){var ex=yx(G);break}if(m0!==1){var ex=w(G);break}}break;default:r:for(;;){var Dx=no(y(G));if(2>>0){var ex=w(G);break x}switch(Dx){case 0:var ex=yx(G);break x;case 1:break;default:break r}}for(;;){r:{if(vr(y(G))===0){e:for(;;){var Ex=no(y(G));if(2>>0){var qx=w(G);break r}switch(Ex){case 0:var qx=yx(G);break r;case 1:break;default:break e}}continue}var qx=w(G)}var ex=qx;break}}if(ex!==0)return bx(sn0);var O0=l2(G),Wx=I1(S,zr(S,G),34);return[0,Wx,qt(2,O0)]});case 26:return O2(x,r,function(S,G){or(G);var Z0=ro(y(G));x:if(Z0===0)for(;;){var yx=nl(y(G));if(yx!==0){if(yx===1){var Dx=0;break}var Dx=w(G);break}}else if(Z0===1){r:for(;;){var Tx=Ft(y(G));if(2>>0){var Dx=w(G);break x}switch(Tx){case 0:break;case 1:break r;default:var Dx=0;break x}}for(;;){r:{if(vr(y(G))===0){e:for(;;){var ex=Ft(y(G));if(2>>0){var m0=w(G);break r}switch(ex){case 0:break;case 1:break e;default:var m0=0;break r}}continue}var m0=w(G)}var Dx=m0;break}}else var Dx=w(G);return Dx===0?[0,S,qt(2,l2(G))]:bx(cn0)});case 27:var W=l2(r),g0=I1(x,zr(x,r),34);return[0,g0,qt(2,W)];case 28:return[0,x,qt(2,l2(r))];case 29:return O2(x,r,function(S,G){function Z0(O0){for(;;){V(O0,0);var Wx=to(y(O0));if(Wx!==0){if(Wx!==1)return w(O0);for(;;){if(vr(y(O0))!==0)return w(O0);for(;;){V(O0,0);var Yx=to(y(O0));if(Yx!==0)break}if(Yx!==1)return w(O0)}}}}function yx(O0){return V(O0,0),vr(y(O0))===0?Z0(O0):w(O0)}or(G);var Tx=xo(y(G));if(2>>0)var ex=w(G);else x:switch(Tx){case 0:var ex=vr(y(G))===0?Z0(G):w(G);break;case 1:for(;;){V(G,0);var m0=ul(y(G));if(m0===0){var ex=yx(G);break}if(m0!==1){var ex=w(G);break}}break;default:r:for(;;){V(G,0);var Dx=no(y(G));if(2>>0){var ex=w(G);break x}switch(Dx){case 0:var ex=yx(G);break x;case 1:break;default:break r}}for(;;){r:{if(vr(y(G))===0){e:for(;;){V(G,0);var Ex=no(y(G));if(2>>0){var qx=w(G);break r}switch(Ex){case 0:var qx=yx(G);break r;case 1:break;default:break e}}continue}var qx=w(G)}var ex=qx;break}}return ex===0?[0,S,Mt(4,l2(G))]:bx(fn0)});case 30:return[0,x,Mt(4,l2(r))];case 31:return[0,x,67];case 32:return[0,x,6];default:return[0,x,7]}switch(f0){case 34:return[0,x,0];case 35:return[0,x,1];case 36:return[0,x,2];case 37:return[0,x,3];case 38:return[0,x,4];case 39:return[0,x,5];case 40:return[0,x,12];case 41:return[0,x,10];case 42:return[0,x,8];case 43:return[0,x,9];case 44:return[0,x,87];case 45:return[0,x,84];case 46:return[0,x,86];case 47:return[0,x,6];case 48:return[0,x,7];case 49:return[0,x,99];case 50:return[0,x,y2];case 51:return[0,x,83];case 52:return[0,x,86];case 53:return[0,x,K2];case 54:return[0,x,87];case 55:return[0,x,89];case 56:return[0,x,88];case 57:return[0,x,90];case 58:return[0,x,92];case 59:return[0,x,11];case 60:return[0,x,83];case 61:return[0,x,ft];case 62:return[0,x,Pt];case 63:return[0,x,u8];case 64:return[0,x,Ek];case 65:var B=r[6];eU(r);var h0=Z6(x,B,r[3]);MC(r,B);var _0=l2(r),d0=fU(x,_0),E0=d0[2],U=d0[1],Kx=ux(E0,tm);if(0<=Kx){if(0>=Kx)return[0,U,Ik];var Ix=ux(E0,p3);if(0<=Ix){if(0>=Ix)return[0,U,mf];if(!P(E0,m6))return[0,U,c2];if(!P(E0,$s))return[0,U,32];if(!P(E0,Ws))return[0,U,47];if(!P(E0,sk))return[0,U,qa];if(!P(E0,Cp))return[0,U,en];if(!P(E0,Ys))return[0,U,y6]}else{if(!P(E0,Fp))return[0,U,av];if(!P(E0,Lp))return[0,U,P3];if(!P(E0,cv))return[0,U,30];if(!P(E0,k3))return[0,U,f6];if(!P(E0,ev))return[0,U,Xr];if(!P(E0,Re))return[0,U,43]}}else{var z0=ux(E0,Ee);if(0<=z0){if(0>=z0)return[0,U,F3];if(!P(E0,rc))return[0,U,42];if(!P(E0,Xs))return[0,U,31];if(!P(E0,d3))return[0,U,u6];if(!P(E0,JO))return[0,U,M2];if(!P(E0,ce))return[0,U,54];if(!P(E0,p6))return[0,U,Ko]}else{if(!P(E0,bp))return[0,U,iv];if(!P(E0,E3))return[0,U,w6];if(!P(E0,lv))return[0,U,h3];if(!P(E0,y8))return[0,U,_n0];if(!P(E0,x6))return[0,U,wn0];if(!P(E0,Ja))return[0,U,28]}}return[0,U,[4,h0,E0,V6(_0)]];case 66:var Kr=x[4]?I1(x,zr(x,r),92):x;return[0,Kr,kr];default:return[0,x,[7,Ox(r)]]}}),Vb0=x4(function(x,r){function e(_){for(;;)if(V(_,33),cr(y(_))!==0)return w(_)}function t(_){V(_,33);var $=VB(y(_));if(3<$>>>0)return w(_);switch($){case 0:return e(_);case 1:var ix=ro(y(_));if(ix===0)for(;;){V(_,28);var U0=tl(y(_));if(2>>0)return w(_);switch(U0){case 0:return u(_);case 1:break;default:return i(_)}}else{if(ix!==1)return w(_);for(;;){V(_,28);var cx=_s(y(_));if(3>>0)return w(_);switch(cx){case 0:return u(_);case 1:break;case 2:return c(_);default:return i(_)}}}break;case 2:for(;;){V(_,28);var wx=tl(y(_));if(2>>0)return w(_);switch(wx){case 0:return v(_);case 1:break;default:return a(_)}}break;default:for(;;){V(_,28);var Or=_s(y(_));if(3>>0)return w(_);switch(Or){case 0:return v(_);case 1:break;case 2:return c(_);default:return a(_)}}}}function u(_){for(;;)if(V(_,27),cr(y(_))!==0)return w(_)}function i(_){V(_,26);var $=X2(y(_));if($!==0)return $===1?u(_):w(_);for(;;)if(V(_,25),cr(y(_))!==0)return w(_)}function c(_){for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,28);var $=_s(y(_));if(3<$>>>0)return w(_);switch($){case 0:return u(_);case 1:break;case 2:break x;default:return i(_)}}}}function v(_){for(;;)if(V(_,27),cr(y(_))!==0)return w(_)}function a(_){V(_,26);var $=X2(y(_));if($!==0)return $===1?v(_):w(_);for(;;)if(V(_,25),cr(y(_))!==0)return w(_)}function l(_){V(_,31);var $=X2(y(_));if($!==0)return $===1?e(_):w(_);for(;;)if(V(_,29),cr(y(_))!==0)return w(_)}function m(_){return V(_,3),xU(y(_))===0?3:w(_)}function h(_){return H5(y(_))===0&&W5(y(_))===0&&QB(y(_))===0&&UB(y(_))===0&&XB(y(_))===0&&G5(y(_))===0&&Q6(y(_))===0&&H5(y(_))===0&&uo(y(_))===0&&HC(y(_))===0&&Av(y(_))===0?3:w(_)}function T(_){V(_,34);var $=qB(y(_));if(3<$>>>0)return w(_);switch($){case 0:return e(_);case 1:x:for(;;){V(_,34);var ix=eo(y(_));if(4>>0)return w(_);switch(ix){case 0:return e(_);case 1:break;case 2:return t(_);case 3:break x;default:return l(_)}}for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,34);var U0=eo(y(_));if(4>>0)return w(_);switch(U0){case 0:return e(_);case 1:break;case 2:return t(_);case 3:break x;default:return l(_)}}}break;case 2:return t(_);default:return l(_)}}function b(_){for(;;)if(V(_,19),cr(y(_))!==0)return w(_)}function N(_){V(_,34);var $=tl(y(_));if(2<$>>>0)return w(_);switch($){case 0:return e(_);case 1:x:for(;;){V(_,34);var ix=_s(y(_));if(3>>0)return w(_);switch(ix){case 0:return e(_);case 1:break;case 2:break x;default:return l(_)}}for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,34);var U0=_s(y(_));if(3>>0)return w(_);switch(U0){case 0:return e(_);case 1:break;case 2:break x;default:return l(_)}}}break;default:return l(_)}}function C(_){for(;;)if(V(_,17),cr(y(_))!==0)return w(_)}function I(_){for(;;)if(V(_,17),cr(y(_))!==0)return w(_)}function F(_){for(;;)if(V(_,11),cr(y(_))!==0)return w(_)}function M(_){for(;;)if(V(_,11),cr(y(_))!==0)return w(_)}function Y(_){for(;;)if(V(_,15),cr(y(_))!==0)return w(_)}function q(_){for(;;)if(V(_,15),cr(y(_))!==0)return w(_)}function K(_){for(;;)if(V(_,23),cr(y(_))!==0)return w(_)}function u0(_){for(;;)if(V(_,23),cr(y(_))!==0)return w(_)}function Q(_){V(_,32);var $=X2(y(_));if($!==0)return $===1?e(_):w(_);for(;;)if(V(_,30),cr(y(_))!==0)return w(_)}function e0(_){for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,34);var $=GB(y(_));if(4<$>>>0)return w(_);switch($){case 0:return e(_);case 1:return N(_);case 2:break;case 3:break x;default:return Q(_)}}}}or(r);var f0=function(_){var $=Ub0(y(_));if(36<$>>>0)return w(_);switch($){case 0:return 98;case 1:return 99;case 2:if(V(_,1),gs(y(_))!==0)return w(_);for(;;)if(V(_,1),gs(y(_))!==0)return w(_);break;case 3:return 0;case 4:return V(_,0),Pe(y(_))===0?0:w(_);case 5:return V(_,88),wn(y(_))===0?(V(_,58),wn(y(_))===0?54:w(_)):w(_);case 6:return 7;case 7:V(_,95);var ix=y(_),U0=32>>0)return w(_);switch(Or){case 0:return V(_,83),wn(y(_))===0?70:w(_);case 1:return 4;default:return 69}case 14:V(_,80);var Hx=y(_),x2=42>>0)return w(_);switch(sx){case 0:return e(_);case 1:break;case 2:return t(_);case 3:break x;default:return l(_)}}for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,34);var Sx=eo(y(_));if(4>>0)return w(_);switch(Sx){case 0:return e(_);case 1:break;case 2:return t(_);case 3:break x;default:return l(_)}}}break;case 18:V(_,93);var Zx=BB(y(_));if(2>>0)return w(_);switch(Zx){case 0:V(_,2);var Ur=U5(y(_));if(2>>0)return w(_);switch(Ur){case 0:for(;;){var Y2=U5(y(_));if(2>>0)return w(_);switch(Y2){case 0:break;case 1:return m(_);default:return h(_)}}break;case 1:return m(_);default:return h(_)}break;case 1:return 5;default:return 92}break;case 19:V(_,34);var pe=zB(y(_));if(8>>0)return w(_);switch(pe){case 0:return e(_);case 1:return T(_);case 2:x:{r:for(;;){V(_,20);var j1=$B(y(_));if(4>>0)return w(_);switch(j1){case 0:return b(_);case 1:return N(_);case 2:break;case 3:break x;default:break r}}V(_,19);var kt=X2(y(_));if(kt!==0)return kt===1?b(_):w(_);for(;;)if(V(_,19),cr(y(_))!==0)return w(_)}x:for(;;){V(_,18);var zt=B5(y(_));if(3>>0)return w(_);switch(zt){case 0:return C(_);case 1:return N(_);case 2:break;default:break x}}V(_,17);var O1=X2(y(_));if(O1!==0)return O1===1?C(_):w(_);for(;;)if(V(_,17),cr(y(_))!==0)return w(_);break;case 3:x:for(;;){V(_,18);var q1=B5(y(_));if(3>>0)return w(_);switch(q1){case 0:return I(_);case 1:return N(_);case 2:break;default:break x}}V(_,17);var T2=X2(y(_));if(T2!==0)return T2===1?I(_):w(_);for(;;)if(V(_,17),cr(y(_))!==0)return w(_);break;case 4:V(_,33);var En=YB(y(_));if(En===0)return e(_);if(En!==1)return w(_);x:{r:for(;;){V(_,12);var Sn=eh(y(_));if(3>>0)return w(_);switch(Sn){case 0:return F(_);case 1:break;case 2:break x;default:break r}}V(_,10);var Ss=X2(y(_));if(Ss!==0)return Ss===1?F(_):w(_);for(;;)if(V(_,9),cr(y(_))!==0)return w(_)}x:for(;;){if(ws(y(_))!==0)return w(_);r:for(;;){V(_,12);var ke=eh(y(_));if(3>>0)return w(_);switch(ke){case 0:return M(_);case 1:break;case 2:break r;default:break x}}}V(_,10);var Qe=X2(y(_));if(Qe!==0)return Qe===1?M(_):w(_);for(;;)if(V(_,9),cr(y(_))!==0)return w(_);break;case 5:return t(_);case 6:V(_,33);var vo=KB(y(_));if(vo===0)return e(_);if(vo!==1)return w(_);x:{r:for(;;){V(_,16);var mt=xh(y(_));if(3>>0)return w(_);switch(mt){case 0:return Y(_);case 1:break;case 2:break x;default:break r}}V(_,14);var dr=X2(y(_));if(dr!==0)return dr===1?Y(_):w(_);for(;;)if(V(_,13),cr(y(_))!==0)return w(_)}x:for(;;){if(Z1(y(_))!==0)return w(_);r:for(;;){V(_,16);var lo=xh(y(_));if(3>>0)return w(_);switch(lo){case 0:return q(_);case 1:break;case 2:break r;default:break x}}}V(_,14);var As=X2(y(_));if(As!==0)return As===1?q(_):w(_);for(;;)if(V(_,13),cr(y(_))!==0)return w(_);break;case 7:V(_,33);var ga=RB(y(_));if(ga===0)return e(_);if(ga!==1)return w(_);x:{r:for(;;){V(_,24);var Uv=th(y(_));if(3>>0)return w(_);switch(Uv){case 0:return K(_);case 1:break;case 2:break x;default:break r}}V(_,22);var Kt=X2(y(_));if(Kt!==0)return Kt===1?K(_):w(_);for(;;)if(V(_,21),cr(y(_))!==0)return w(_)}x:for(;;){if(br(y(_))!==0)return w(_);r:for(;;){V(_,24);var An=th(y(_));if(3>>0)return w(_);switch(An){case 0:return u0(_);case 1:break;case 2:break r;default:break x}}}V(_,22);var wa=X2(y(_));if(wa!==0)return wa===1?u0(_):w(_);for(;;)if(V(_,21),cr(y(_))!==0)return w(_);break;default:return Q(_)}break;case 20:V(_,34);var po=Y5(y(_));if(5>>0)return w(_);switch(po){case 0:return e(_);case 1:return T(_);case 2:for(;;){V(_,34);var ko=Y5(y(_));if(5>>0)return w(_);switch(ko){case 0:return e(_);case 1:return T(_);case 2:break;case 3:return t(_);case 4:return e0(_);default:return Q(_)}}break;case 3:return t(_);case 4:return e0(_);default:return Q(_)}break;case 21:return 46;case 22:return 44;case 23:V(_,78);var _a=y(_),ba=59<_a?61<_a?-1:Y0(z8,_a-60|0)-1|0:-1;return ba===0?(V(_,62),wn(y(_))===0?61:w(_)):ba===1?55:w(_);case 24:V(_,90);var Ta=QC(y(_));return Ta===0?(V(_,57),wn(y(_))===0?53:w(_)):Ta===1?91:w(_);case 25:V(_,79);var mo=QC(y(_));if(mo===0)return 56;if(mo!==1)return w(_);V(_,66);var me=QC(y(_));return me===0?63:me===1?(V(_,65),wn(y(_))===0?64:w(_)):w(_);case 26:V(_,50);var Q2=y(_),Ea=45>>0)return bx(Ec0);var a0=f0;if(50>a0)switch(a0){case 0:return[2,xe(x,r)];case 1:return[2,x];case 2:var Z=P1(x,r),v0=Wr(Xr),t0=Pv(x,v0,r),y0=t0[1];return[1,y0,Lt(y0,Z,t0[2],v0,1)];case 3:var n0=Ox(r);if(!x[5]){var s0=P1(x,r),l0=Wr(Xr);ir(l0,E1(n0,2,Cx(n0)-2|0));var w0=Pv(x,l0,r),L0=w0[1];return[1,L0,Lt(L0,s0,w0[2],l0,1)]}var I0=x[4]?nU(x,zr(x,r),n0):x,j0=O5(1,I0),S0=A5(r);return _r(W6(r,S0-1|0,1),Uo)&&P(W6(r,S0-2|0,1),Uo)?[0,j0,87]:[2,j0];case 4:if(x[4])return[2,O5(0,x)];el(r),or(r);var W0=MB(y(r))===0?0:w(r);return W0===0?[0,x,K2]:bx(Sc0);case 5:var A0=P1(x,r),J0=Wr(Xr),b0=il(x,J0,r),z=b0[1];return[1,z,Lt(z,A0,b0[2],J0,0)];case 6:if(r[6]!==0)return[0,x,Ac0];var C0=P1(x,r),V0=Wr(Xr),N0=il(x,V0,r),rx=N0[1],xx=[0,rx[1],C0,N0[2]];return[0,rx,[6,xx,G2(V0)]];case 7:var nx=Ox(r),mx=P1(x,r),F0=Wr(Xr),px=Wr(Xr);ir(px,nx);var dx=sU(x,nx,F0,px,0,r),W=dx[1],g0=dx[3],B=[0,W[1],mx,dx[2]],h0=G2(px);return[0,W,[2,[0,B,G2(F0),h0,g0]]];case 8:var _0=Wr(Xr),d0=Wr(Xr),E0=P1(x,r),U=aU(x,_0,d0,r),Kx=U[1],Ix=U[2],z0=Ie(Kx,r),Kr=[0,Kx[1],E0,z0],S=G2(d0);return[0,Kx,[3,[0,Kr,G2(_0),S,1,Ix]]];case 9:return O2(x,r,function(_,$){or($);x:if(Ae(y($))===0&&K5(y($))===0&&ws(y($))===0){r:for(;;){var ix=M5(y($));if(2>>0){var wx=w($);break x}switch(ix){case 0:break;case 1:break r;default:var wx=0;break x}}for(;;){r:{if(ws(y($))===0){e:for(;;){var U0=M5(y($));if(2>>0){var cx=w($);break r}switch(U0){case 0:break;case 1:break e;default:var cx=0;break r}}continue}var cx=w($)}var wx=cx;break}}else var wx=w($);return wx===0?[0,_,[1,0,Ox($)]]:bx(Tc0)});case 10:return[0,x,[1,0,Ox(r)]];case 11:return O2(x,r,function(_,$){if(or($),Ae(y($))===0&&K5(y($))===0&&ws(y($))===0){for(;;){V($,0);var ix=L5(y($));if(ix!==0)break}if(ix===1)for(;;){if(ws(y($))===0){for(;;){V($,0);var U0=L5(y($));if(U0!==0)break}if(U0===1)continue;var cx=w($)}else var cx=w($);var wx=cx;break}else var wx=w($)}else var wx=w($);return wx===0?[0,_,[0,0,Ox($)]]:bx(bc0)});case 12:return[0,x,[0,0,Ox(r)]];case 13:return O2(x,r,function(_,$){or($);x:if(Ae(y($))===0&&$5(y($))===0&&Z1(y($))===0){r:for(;;){var ix=z5(y($));if(2>>0){var wx=w($);break x}switch(ix){case 0:break;case 1:break r;default:var wx=0;break x}}for(;;){r:{if(Z1(y($))===0){e:for(;;){var U0=z5(y($));if(2>>0){var cx=w($);break r}switch(U0){case 0:break;case 1:break e;default:var cx=0;break r}}continue}var cx=w($)}var wx=cx;break}}else var wx=w($);return wx===0?[0,_,[1,1,Ox($)]]:bx(_c0)});case 14:return[0,x,[1,1,Ox(r)]];case 15:return O2(x,r,function(_,$){if(or($),Ae(y($))===0&&$5(y($))===0&&Z1(y($))===0){for(;;){V($,0);var ix=X5(y($));if(ix!==0)break}if(ix===1)for(;;){if(Z1(y($))===0){for(;;){V($,0);var U0=X5(y($));if(U0!==0)break}if(U0===1)continue;var cx=w($)}else var cx=w($);var wx=cx;break}else var wx=w($)}else var wx=w($);return wx===0?[0,_,[0,3,Ox($)]]:bx(wc0)});case 16:return[0,x,[0,3,Ox(r)]];case 17:return O2(x,r,function(_,$){if(or($),Ae(y($))===0){for(;;){var ix=y($),U0=47>>0){var wx=w($);break x}switch(ix){case 0:break;case 1:break r;default:var wx=0;break x}}for(;;){r:{if(br(y($))===0){e:for(;;){var U0=q5(y($));if(2>>0){var cx=w($);break r}switch(U0){case 0:break;case 1:break e;default:var cx=0;break r}}continue}var cx=w($)}var wx=cx;break}}else var wx=w($);return wx===0?[0,_,[1,2,Ox($)]]:bx(dc0)});case 22:return[0,x,[1,2,Ox(r)]];case 23:return O2(x,r,function(_,$){if(or($),Ae(y($))===0&&F5(y($))===0&&br(y($))===0){for(;;){V($,0);var ix=Z5(y($));if(ix!==0)break}if(ix===1)for(;;){if(br(y($))===0){for(;;){V($,0);var U0=Z5(y($));if(U0!==0)break}if(U0===1)continue;var cx=w($)}else var cx=w($);var wx=cx;break}else var wx=w($)}else var wx=w($);return wx===0?[0,_,[0,4,Ox($)]]:bx(hc0)});case 24:return[0,x,[0,4,Ox(r)]];case 25:return O2(x,r,function(_,$){function ix(Zx){var Ur=nh(y(Zx));if(2>>0)return w(Zx);switch(Ur){case 0:var Y2=ro(y(Zx));return Y2===0?U0(Zx):Y2===1?cx(Zx):w(Zx);case 1:return U0(Zx);default:return cx(Zx)}}function U0(Zx){for(;;){var Ur=nl(y(Zx));if(Ur!==0)return Ur===1?0:w(Zx)}}function cx(Zx){for(;;){var Ur=Ft(y(Zx));if(2>>0)return w(Zx);switch(Ur){case 0:break;case 1:for(;;){if(vr(y(Zx))!==0)return w(Zx);x:for(;;){var Y2=Ft(y(Zx));if(2>>0)return w(Zx);switch(Y2){case 0:break;case 1:break x;default:return 0}}}break;default:return 0}}}function wx(Zx){var Ur=Q5(y(Zx));if(Ur!==0)return Ur===1?ix(Zx):w(Zx);x:for(;;){var Y2=le(y(Zx));if(2>>0)return w(Zx);switch(Y2){case 0:break;case 1:return ix(Zx);default:break x}}for(;;){if(vr(y(Zx))!==0)return w(Zx);x:for(;;){var pe=le(y(Zx));if(2>>0)return w(Zx);switch(pe){case 0:break;case 1:return ix(Zx);default:break x}}}}or($);var Or=xo(y($));if(2>>0)var Hx=w($);else x:switch(Or){case 0:if(vr(y($))===0){r:for(;;){var x2=le(y($));if(2>>0){var Hx=w($);break x}switch(x2){case 0:break;case 1:var Hx=ix($);break x;default:break r}}for(;;){r:{if(vr(y($))===0){e:for(;;){var hr=le(y($));if(2
>>0){var Dr=w($);break r}switch(hr){case 0:break;case 1:var Dr=ix($);break r;default:break e}}continue}var Dr=w($)}var Hx=Dr;break}}else var Hx=w($);break;case 1:var r2=R5(y($)),Hx=r2===0?wx($):r2===1?ix($):w($);break;default:r:for(;;){var sx=V5(y($));if(2>>0){var Hx=w($);break}switch(sx){case 0:var Hx=wx($);break r;case 1:break;default:var Hx=ix($);break r}}}if(Hx!==0)return bx(mc0);var Sx=I1(_,zr(_,$),42);return[0,Sx,[1,2,Ox($)]]});case 26:var G=I1(x,zr(x,r),42);return[0,G,[1,2,Ox(r)]];case 27:return O2(x,r,function(_,$){function ix(Sx){var Zx=nh(y(Sx));if(2>>0)return w(Sx);switch(Zx){case 0:var Ur=ro(y(Sx));return Ur===0?U0(Sx):Ur===1?cx(Sx):w(Sx);case 1:return U0(Sx);default:return cx(Sx)}}function U0(Sx){for(;;)if(V(Sx,0),vr(y(Sx))!==0)return w(Sx)}function cx(Sx){for(;;){V(Sx,0);var Zx=to(y(Sx));if(Zx!==0){if(Zx!==1)return w(Sx);for(;;){if(vr(y(Sx))!==0)return w(Sx);for(;;){V(Sx,0);var Ur=to(y(Sx));if(Ur!==0)break}if(Ur!==1)return w(Sx)}}}}function wx(Sx){var Zx=Q5(y(Sx));if(Zx!==0)return Zx===1?ix(Sx):w(Sx);x:for(;;){var Ur=le(y(Sx));if(2>>0)return w(Sx);switch(Ur){case 0:break;case 1:return ix(Sx);default:break x}}for(;;){if(vr(y(Sx))!==0)return w(Sx);x:for(;;){var Y2=le(y(Sx));if(2>>0)return w(Sx);switch(Y2){case 0:break;case 1:return ix(Sx);default:break x}}}}or($);var Or=xo(y($));if(2>>0)var Hx=w($);else x:switch(Or){case 0:if(vr(y($))===0){r:for(;;){var x2=le(y($));if(2>>0){var Hx=w($);break x}switch(x2){case 0:break;case 1:var Hx=ix($);break x;default:break r}}for(;;){r:{if(vr(y($))===0){e:for(;;){var hr=le(y($));if(2
>>0){var Dr=w($);break r}switch(hr){case 0:break;case 1:var Dr=ix($);break r;default:break e}}continue}var Dr=w($)}var Hx=Dr;break}}else var Hx=w($);break;case 1:var r2=R5(y($)),Hx=r2===0?wx($):r2===1?ix($):w($);break;default:r:for(;;){var sx=V5(y($));if(2>>0){var Hx=w($);break}switch(sx){case 0:var Hx=wx($);break r;case 1:break;default:var Hx=ix($);break r}}}return Hx===0?[0,_,[0,4,Ox($)]]:bx(kc0)});case 28:return[0,x,[0,4,Ox(r)]];case 29:return O2(x,r,function(_,$){function ix(r2){for(;;){var sx=Ft(y(r2));if(2>>0)return w(r2);switch(sx){case 0:break;case 1:for(;;){if(vr(y(r2))!==0)return w(r2);x:for(;;){var Sx=Ft(y(r2));if(2>>0)return w(r2);switch(Sx){case 0:break;case 1:break x;default:return 0}}}break;default:return 0}}}function U0(r2){var sx=nl(y(r2));return sx===0?ix(r2):sx===1?0:w(r2)}or($);var cx=xo(y($));if(2>>0)var wx=w($);else x:switch(cx){case 0:var wx=vr(y($))===0?ix($):w($);break;case 1:for(;;){var Or=ul(y($));if(Or===0){var wx=U0($);break}if(Or!==1){var wx=w($);break}}break;default:r:for(;;){var Hx=no(y($));if(2>>0){var wx=w($);break x}switch(Hx){case 0:var wx=U0($);break x;case 1:break;default:break r}}for(;;){r:{if(vr(y($))===0){e:for(;;){var x2=no(y($));if(2>>0){var hr=w($);break r}switch(x2){case 0:var hr=U0($);break r;case 1:break;default:break e}}continue}var hr=w($)}var wx=hr;break}}if(wx!==0)return bx(pc0);var Dr=I1(_,zr(_,$),34);return[0,Dr,[1,2,Ox($)]]});case 30:return O2(x,r,function(_,$){or($);var ix=ro(y($));x:if(ix===0)for(;;){var U0=nl(y($));if(U0!==0){if(U0===1){var Hx=0;break}var Hx=w($);break}}else if(ix===1){r:for(;;){var cx=Ft(y($));if(2>>0){var Hx=w($);break x}switch(cx){case 0:break;case 1:break r;default:var Hx=0;break x}}for(;;){r:{if(vr(y($))===0){e:for(;;){var wx=Ft(y($));if(2>>0){var Or=w($);break r}switch(wx){case 0:break;case 1:break e;default:var Or=0;break r}}continue}var Or=w($)}var Hx=Or;break}}else var Hx=w($);return Hx===0?[0,_,[1,2,Ox($)]]:bx(lc0)});case 31:var Z0=I1(x,zr(x,r),34);return[0,Z0,[1,2,Ox(r)]];case 32:return[0,x,[1,2,Ox(r)]];case 33:return O2(x,r,function(_,$){function ix(Dr){for(;;){V(Dr,0);var r2=to(y(Dr));if(r2!==0){if(r2!==1)return w(Dr);for(;;){if(vr(y(Dr))!==0)return w(Dr);for(;;){V(Dr,0);var sx=to(y(Dr));if(sx!==0)break}if(sx!==1)return w(Dr)}}}}function U0(Dr){return V(Dr,0),vr(y(Dr))===0?ix(Dr):w(Dr)}or($);var cx=xo(y($));if(2>>0)var wx=w($);else x:switch(cx){case 0:var wx=vr(y($))===0?ix($):w($);break;case 1:for(;;){V($,0);var Or=ul(y($));if(Or===0){var wx=U0($);break}if(Or!==1){var wx=w($);break}}break;default:r:for(;;){V($,0);var Hx=no(y($));if(2>>0){var wx=w($);break x}switch(Hx){case 0:var wx=U0($);break x;case 1:break;default:break r}}for(;;){r:{if(vr(y($))===0){e:for(;;){V($,0);var x2=no(y($));if(2>>0){var hr=w($);break r}switch(x2){case 0:var hr=U0($);break r;case 1:break;default:break e}}continue}var hr=w($)}var wx=hr;break}}return wx===0?[0,_,[0,4,Ox($)]]:bx(vc0)});case 34:return[0,x,[0,4,Ox(r)]];case 35:var yx=zr(x,r),Tx=Ox(r);return[0,x,[4,yx,Tx,Tx]];case 36:return[0,x,0];case 37:return[0,x,1];case 38:return[0,x,4];case 39:return[0,x,5];case 40:return[0,x,6];case 41:return[0,x,7];case 42:return[0,x,12];case 43:return[0,x,10];case 44:return[0,x,8];case 45:return[0,x,9];case 46:return[0,x,87];case 47:el(r),or(r);var ex=y(r),m0=62=Wx)return[0,x,54];var Yx=ux(O0,C3);if(0<=Yx){if(0>=Yx)return[0,x,52];var fx=ux(O0,Ws);if(0<=fx){if(0>=fx)return[0,x,47];if(!P(O0,Wl))return[0,x,25];if(!P(O0,Ys))return[0,x,48];if(!P(O0,B4))return[0,x,26];if(!P(O0,e8))return[0,x,27];if(!P(O0,z1))return[0,x,59]}else{if(!P(O0,Ke))return[0,x,20];if(!P(O0,xv))return[0,x,22];if(!P(O0,Ye))return[0,x,23];if(!P(O0,$s))return[0,x,32];if(!P(O0,b8))return[0,x,24];if(!P(O0,Yf))return[0,x,62]}}else{var Qx=ux(O0,Yp);if(0<=Qx){if(0>=Qx)return[0,x,55];if(!P(O0,g6))return[0,x,56];if(!P(O0,Ul))return[0,x,57];if(!P(O0,h6))return[0,x,58];if(!P(O0,Ue))return[0,x,19];if(!P(O0,Re))return[0,x,43]}else{if(!P(O0,j3))return[0,x,29];if(!P(O0,lI))return[0,x,21];if(!P(O0,nv))return[0,x,45];if(!P(O0,cv))return[0,x,30];if(!P(O0,aS))return[0,x,64];if(!P(O0,sb))return[0,x,63]}}}else{var vx=ux(O0,zp);if(0<=vx){if(0>=vx)return[0,x,44];var nr=ux(O0,y3);if(0<=nr){if(0>=nr)return[0,x,15];if(!P(O0,_8))return[0,x,16];if(!P(O0,vv))return[0,x,53];if(!P(O0,K1))return[0,x,51];if(!P(O0,Ra))return[0,x,17];if(!P(O0,Ql))return[0,x,18]}else{if(!P(O0,r6))return[0,x,49];if(!P(O0,Rm))return[0,x,50];if(!P(O0,rc))return[0,x,42];if(!P(O0,Xs))return[0,x,31];if(!P(O0,i8))return[0,x,39];if(!P(O0,o8))return[0,x,40]}}else{var gr=ux(O0,Ja);if(0<=gr){if(0>=gr)return[0,x,28];if(!P(O0,Le))return[0,x,36];if(!P(O0,Xe))return[0,x,60];if(!P(O0,_6))return[0,x,61];if(!P(O0,$o))return[0,x,37];if(!P(O0,Vl))return[0,x,46];if(!P(O0,Mp))return[0,x,38]}else{if(!P(O0,Ya))return[0,x,65];if(!P(O0,fv))return[0,x,66];if(!P(O0,ze))return[0,x,33];if(!P(O0,dp))return[0,x,34];if(!P(O0,xm))return[0,x,35];if(!P(O0,Yl))return[0,x,41]}}}var Nr=l2(r),s2=fU(x,Nr),b2=s2[2],k2=s2[1];return[0,k2,[4,qx,b2,V6(Nr)]];case 98:var F2=x[4]?I1(x,zr(x,r),92):x;return[0,F2,kr];default:var jx=lt(x,zr(x,r));return[0,jx,[7,Ox(r)]]}}),N1=yB([0,Ab0]);function r4(x,r){return[0,0,0,r,PB(x)]}function ih(x){var r=x[4];switch(x[3]){case 0:var f0=Vb0(r);break;case 1:var f0=Wb0(r);break;case 2:var f0=Jb0(r);break;case 3:var e=Ie(r,r[2]),t=Wr(Xr),u=Wr(Xr),i=r[2];or(i);var c=y(i),v=en>>0)var a=w(i);else switch(v){case 0:var a=1;break;case 1:var a=4;break;case 2:var a=0;break;case 3:V(i,0);var a=Pe(y(i))===0?0:w(i);break;case 4:var a=2;break;default:var a=3}if(4
>>0)var l=bx(Sn0);else switch(a){case 0:var m=Ox(i);ir(u,m),ir(t,m);var h=vU(xe(r,i),t,u,i),T=Ie(h,i),b=G2(t),N=G2(u),l=[0,h,[9,[0,h[1],e,T],b,N]];break;case 1:var l=[0,r,kr];break;case 2:var l=[0,r,99];break;case 3:var l=[0,r,0];break;default:el(i);var C=vU(r,t,u,i),I=Ie(C,i),F=G2(t),M=G2(u),l=[0,C,[9,[0,C[1],e,I],F,M]]}var Y=l[2],q=l[1],K=tU(q,Y),u0=q[6];if(u0===0)var e0=[0,q,[0,Y,K,0,0]];else var Q=[0,Y,K,tx(u0),0],e0=[0,[0,q[1],q[2],q[3],q[4],q[5],0,q[7]],Q];var f0=e0;break;case 4:var f0=Gb0(r);break;default:var f0=Kb0(r)}var a0=f0[1],Z=f0[2],v0=[0,PB(a0),Z];return x[4]=a0,x[1]?x[2]=[0,v0]:x[1]=[0,v0],v0}function lU(x){var r=x[1];return r?r[1][2]:ih(x)[2]}function fl(x){return D6(x[24][1])}function S2(x){return x[28][5]}function B0(x,r){var e=r[2];x[1][1]=[0,[0,r[1],e],x[1][1]];var t=x[23];return t?p(t[1],x,e):0}function e4(x,r){x[31][1]=r}function io(x,r){if(x===0)return lU(r[26][1]);if(x!==1)throw K0([0,Ir,us0],1);var e=r[26][1];e[1]||ih(e);var t=e[2];return t?t[1][2]:ih(e)[2]}function la(x,r){return x===r[5]?r:[0,r[1],r[2],r[3],r[4],x,r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function pU(x,r){return x===r[10]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],x,r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function xj(x,r){return x===r[18]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],x,r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function rj(x,r){return x===r[19]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],x,r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function kU(x,r){return x===r[20]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],x,r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function Iv(x,r){return x===r[22]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],x,r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function ej(x,r){return x===r[14]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],x,r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function t4(x,r){return x===r[8]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],x,r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function n4(x,r){return x===r[12]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],x,r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function Nv(x,r){return x===r[15]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],x,r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function tj(x,r){return x===r[16]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],x,r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function mU(x,r){return x===r[6]?r:[0,r[1],r[2],r[3],r[4],r[5],x,r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function hU(x,r){return x===r[7]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],x,r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function nj(x,r){return x===r[13]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],x,r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function fh(x,r){return[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],[0,x],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function uj(x){function r(e){return B0(x,e)}return function(e){return T1(r,e)}}function cl(x){var r=x[4][1];return r?[0,r[1][2]]:0}function dU(x){var r=x[4][1];return r?[0,r[1][1]]:0}function yU(x){return[0,x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15],x[16],x[17],x[18],x[19],x[20],x[21],x[22],0,x[24],x[25],x[26],x[27],x[28],x[29],x[30],x[31]]}function gU(x,r,e,t){return[0,x[1],x[2],N1[1],x[4],x[5],0,0,0,0,0,1,x[12],x[13],x[14],x[15],x[16],x[17],e,r,x[20],t,x[22],x[23],x[24],x[25],x[26],x[27],x[28],x[29],x[30],x[31]]}function sl(x){return P(x,vv)&&P(x,ce)&&P(x,j3)&&P(x,Yp)&&P(x,g6)&&P(x,Ul)&&P(x,h6)&&P(x,Re)&&P(x,z1)?0:1}function Cv(x){return P(x,mb)&&P(x,"eval")?0:1}function ch(x){var r=ux(x,_8);x:{if(0<=r){if(0>>0){if(J1>=t+1>>>0)return 1}else if(t===6)return 0}return jv(x,r)}function ol(x){return bU(0,x)}function ka(x,r){var e=rr(x,r);x:{if(typeof e=="number")switch(e){case 29:case 43:case 53:case 54:case 55:case 56:case 57:case 58:case 59:var t=1;break x}else if(e[0]===4){var t=sl(e[2]);break x}var t=0}if(t)return 1;x:{if(typeof e=="number")switch(e){case 14:case 21:case 49:case 61:case 62:case 63:case 64:case 65:case 66:case 127:break;default:break x}else if(e[0]!==4)break x;return 1}return 0}function sh(x,r){return wU(r,rr(x,r))}function TU(x,r){var e=ka(x,r);return e||sh(x,r)}function _n(x){return ka(0,x)}function fo(x){var r=L(x)===15?1:0;if(r)var e=r;else{var t=L(x)===65?1:0;if(t){var u=rr(1,x)===15?1:0;if(u)var i=al(1,x)[2][1],e=G0(x)[3][1]===i?1:0;else var e=u}else var e=t}return e}function ah(x){var r=L(x);if(typeof r!="number"&&r[0]===4&&!P(r[3],Ho)){var e=x[28][1];if(e){var t=ka(1,x);if(t)var u=al(1,x)[2][1],i=G0(x)[3][1]===u?1:0;else var i=t}else var i=e;return i}return 0}function u4(x){var r=L(x);if(typeof r=="number")switch(r){case 13:case 41:return 1}else if(r[0]===4&&!P(r[3],kA)&&rr(1,x)===41)return 1;return 0}function cj(x){var r=x[28][1];if(r){var e=L(x);if(typeof e!="number"&&e[0]===4&&!P(e[3],Ks)&&ka(1,x))return 1;var t=0}else var t=r;return t}function sj(x){var r=L(x);return typeof r!="number"&&r[0]===4&&!P(r[3],T3)?1:0}function Ux(x,r){return B0(x,[0,G0(x),r])}function EU(x,r){var e=GC(0,r);return x?[28,e,x[1]]:[26,e]}function p2(x,r){var e=fj(r);return uj(r)(e),Ux(r,EU(x,L(r)))}function oh(x){function r(e){return B0(x,[0,e[1],Vn])}return function(e){return T1(r,e)}}function SU(x,r){var e=x[6]?Q0(sr(es0),r,r,r):ts0;return p2([0,e],x)}function Ne(x,r){var e=x[5];return e&&Ux(x,r)}function pt(x,r){var e=x[5],t=r[2],u=r[1];return e&&B0(x,[0,u,t])}function Ov(x,r){return B0(x,[0,r,[14,x[5]]])}function T0(x){var r=x[27][1];if(r){var e=r[1],t=fl(x),u=L(x);d(e,[0,G0(x),u,t])}var i=x[26][1],c=i[1],v=c?c[1][1]:ih(i)[1];x[25][1]=v;var a=fj(x);uj(x)(a);var l=x[2][1],m=G3(io(0,x)[4],l);x[2][1]=m;var h=[0,io(0,x)];x[4][1]=h;var T=x[26][1];return T[2]?(T[1]=T[2],T[2]=0,0):(lU(T),T[1]=0,0)}function $r(x,r){var e=NB(L(x),r);return e&&T0(x),e}function V2(x,r){x[24][1]=[0,r,x[24][1]];var e=fl(x),t=r4(x[25][1],e);x[26][1]=t}function H2(x){var r=x[24][1],e=r?r[2]:bx(rs0);x[24][1]=e;var t=fl(x),u=r4(x[25][1],t);x[26][1]=u}function q0(x){var r=G0(x);if(L(x)===9&&jv(1,x)){var e=i0(x),t=Lx(e,R6(function(i){return i[1][2][1]<=r[3][1]?1:0},io(1,x)[4]));return e4(x,[0,r[3][1]+1|0,0]),t}var u=i0(x);return e4(x,r[3]),u}function co(x){var r=x[4][1];if(!r)return 0;var e=r[1][2],t=R6(function(u){return u[1][2][1]<=e[3][1]?1:0},i0(x));return e4(x,[0,e[3][1]+1|0,0]),t}function bn(x,r){return p2([0,GC(Hc0,r)],x)}function J(x,r){return 1-NB(L(x),r)&&bn(x,r),T0(x)}function AU(x,r){var e=$r(x,r);return 1-e&&bn(x,r),e}function vh(x,r){AU(x,r)}function bs(x,r){var e=L(x);x:{if(typeof e!="number"&&e[0]===4&&_r(e[3],r))break x;p2([0,d(sr(Qc0),r)],x)}return T0(x)}var Bt=[i2,os0,ks(0)];function PU(x,r,e){if(e){var t=e[1],u=t[1],i=t[2];if(r[27][1]=[0,u],!x)return x;for(var c=i[2];;){if(!c)return;var v=c[2];d(u,c[1]);var c=v}}}function lh(x,r){var e=x[27][1];if(e){var t=e[1],u=iq(O);x[27][1]=[0,function(M){return eC(M,u)}];var i=[0,[0,t,u]]}else var i=0;var c=x[31][1],v=x[25][1],a=x[24][1],l=x[4][1],m=x[2][1],h=x[1][1];try{var T=d(r,x);PU(1,x,i);var b=[0,T];return b}catch(F){var N=B2(F);if(N!==Bt)throw K0(N,0);PU(0,x,i),x[1][1]=h,x[2][1]=m,x[4][1]=l,x[24][1]=a,x[25][1]=v,x[31][1]=c;var C=fl(x),I=r4(x[25][1],C);return x[26][1]=I,0}}function ph(x,r,e){var t=lh(x,e);return t?t[1]:r}function i4(x,r){var e=tx(r);if(!e)return r;var t=e[1],u=e[2],i=d(x,t);return t===i?r:tx([0,i,u])}var IU=T5(ms0,function(x){var r=jC(x,ls0),e=NC(x,ks0),t=e[24],u=e[28],i=e[42],c=e[92],v=e[Ed],a=e[K_],l=e[Hk],m=e[GD],h=e[AF],T=e[nL],b=e[6],N=e[7],C=e[10],I=e[17],F=e[23],M=e[29],Y=e[40],q=e[43],K=e[53],u0=e[62],Q=e[K2],e0=e[G1],f0=e[F3],a0=e[h3],Z=e[mT],v0=e[ER],t0=e[JD],y0=e[Rg],n0=e[J4],s0=e[N8],l0=e[J9],w0=e[M8],L0=e[ZT],I0=e[MA],j0=e[AT],S0=e[kk],W0=e[TL],A0=e[WF],J0=e[jD],b0=e[yD],z=e[fD],C0=e[IO],V0=e[aD],N0=e[VD],rx=e[HL],xx=e[YL],nx=e[MD],mx=e[AO],F0=e[BF],px=e[CO],dx=DC(x,0,0,UM,BC,1)[1];return RC(x,[0,q,function(W,g0){var B=g0[2],h0=R6(function(d0){return va(d0[1][2],W[1+r])<0?1:0},B),_0=ia(h0);return ia(B)===_0?g0:[0,g0[1],h0,g0[3]]},px,function(W,g0,B){var h0=B[2];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],_0]})},F0,function(W,g0){var B=g0[2];return P0(d(W[1][1+i],W),B,g0,function(h0){return[0,g0[1],h0]})},mx,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+a],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},nx,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+a],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},xx,function(W,g0,B){var h0=B[2];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],_0]})},rx,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+T],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},T,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},h,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},N0,function(W,g0,B){var h0=B[7],_0=B[2],d0=p(W[1][1+m],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],d0,B[3],B[4],B[5],B[6],E0]},m,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},V0,function(W,g0,B){var h0=B[2],_0=B[1];if(h0===0)return P0(d(W[1][1+a],W),_0,B,function(E0){return[0,E0,B[2],B[3]]});var d0=d(W[1][1+t],W);return P0(function(E0){return Px(d0,E0)},h0,B,function(E0){return[0,B[1],E0,B[3]]})},C0,function(W,g0){var B=g0[2],h0=B[2],_0=g0[1],d0=B[1],E0=d(W[1][1+l],W);return P0(function(U){return i4(E0,U)},d0,g0,function(U){return[0,_0,[0,U,h0]]})},l,function(W,g0){var B=g0[2],h0=B[2],_0=B[1],d0=g0[1];if(h0===0)return P0(d(W[1][1+v],W),_0,g0,function(U){return[0,d0,[0,U,h0]]});var E0=d(W[1][1+t],W);return P0(function(U){return Px(E0,U)},h0,g0,function(U){return[0,d0,[0,_0,U]]})},b0,function(W,g0,B){var h0=B[6],_0=B[5],d0=p(W[1][1+z],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],B[3],B[4],d0,E0,B[7]]},J0,function(W,g0){var B=g0[2],h0=g0[1],_0=B[3];return P0(d(W[1][1+i],W),_0,[0,h0,B],function(d0){return[0,h0,[0,B[1],B[2],d0]]})},A0,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},W0,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+a],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},S0,function(W,g0,B){var h0=B[10],_0=B[3],d0=p(W[1][1+j0],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,B[4],B[5],B[6],B[7],B[8],B[9],E0,B[11]]},I0,function(W,g0){var B=g0[2],h0=g0[1],_0=B[4];return P0(d(W[1][1+i],W),_0,[0,h0,B],function(d0){return[0,h0,[0,B[1],B[2],B[3],d0]]})},L0,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+w0],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0,B[5]]},l0,function(W,g0){if(g0[0]===0){var B=g0[1];return P0(d(W[1][1+v],W),B,g0,function(Kx){return[0,Kx]})}var h0=g0[1],_0=h0[2],d0=_0[2],E0=h0[1],U=p(W[1][1+v],W,d0);return d0===U?g0:[1,[0,E0,[0,_0[1],U]]]},s0,function(W,g0,B){var h0=B[2];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],_0]})},n0,function(W,g0,B){var h0=B[3],_0=B[1],d0=W2(d(W[1][1+c],W),_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,d0,B[2],E0]},y0,function(W,g0,B){var h0=B[2],_0=B[1],d0=_0[3],E0=_0[2],U=_0[1];if(d0)var Kx=i4(d(W[1][1+u],W),d0),Ix=E0;else var Kx=0,Ix=p(W[1][1+u],W,E0);var z0=p(W[1][1+i],W,h0);return E0===Ix&&d0===Kx&&h0===z0?B:[0,[0,U,Ix,Kx],z0]},t0,function(W,g0,B){var h0=B[4];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],B[3],_0]})},v0,function(W,g0,B){var h0=B[4];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],B[3],_0]})},Z,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+a],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},e0,function(W,g0,B){var h0=B[4],_0=B[3],d0=B[2],E0=B[1],U=p(W[1][1+i],W,h0);if(_0){var Kx=Px(d(W[1][1+T],W),_0);return _0===Kx&&h0===U?B:[0,B[1],B[2],Kx,U]}if(d0){var Ix=Px(d(W[1][1+h],W),d0);return d0===Ix&&h0===U?B:[0,B[1],Ix,B[3],U]}var z0=p(W[1][1+a],W,E0);return E0===z0&&h0===U?B:[0,z0,B[2],B[3],U]},a0,function(W,g0,B){var h0=B[3],_0=B[2],d0=p(W[1][1+f0],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],d0,E0]},Q,function(W,g0,B){var h0=B[2];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],_0]})},c,function(W,g0,B){var h0=B[4];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],B[3],_0]})},u0,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},K,function(W,g0,B){var h0=B[2],_0=B[1],d0=i4(d(W[1][1+a],W),_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,d0,E0]},Y,function(W,g0,B){var h0=B[3];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],_0]})},M,function(W,g0){var B=g0[3];return P0(d(W[1][1+i],W),B,g0,function(h0){return[0,g0[1],g0[2],h0]})},F,function(W,g0,B){var h0=B[3];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],_0]})},I,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},C,function(W,g0,B){var h0=B[2],_0=B[1],d0=_0[3],E0=_0[2],U=_0[1];if(d0)var Kx=i4(d(W[1][1+u],W),d0),Ix=E0;else var Kx=0,Ix=p(W[1][1+u],W,E0);var z0=p(W[1][1+i],W,h0);return E0===Ix&&d0===Kx&&h0===z0?B:[0,[0,U,Ix,Kx],z0]},N,function(W,g0,B){var h0=B[2],_0=h0[2],d0=h0[1],E0=B[1];if(!_0)return P0(p(W[1][1+b],W,g0),d0,B,function(Kx){return[0,E0,[0,Kx,_0]]});var U=_0[1];return P0(d(W[1][1+a],W),U,B,function(Kx){return[0,E0,[0,d0,[0,Kx]]]})}]),function(W,g0,B){var h0=E5(g0,x);return h0[1+r]=B,d(dx,h0),FC(g0,h0,x)}});function kh(x){var r=cl(x);if(r)var e=r[1],t=_U(x)?(e4(x,e[3]),[0,p(IU[1],0,e[3])]):0,u=t;else var u=0;return[0,0,function(i,c){return u?c(u[1],i):i}]}function f4(x){var r=cl(x);if(r){var e=r[1];if(_U(x)){e4(x,e[3]);var t=co(x),u=[0,p(IU[1],0,[0,e[3][1]+1|0,0])],i=t}else var u=0,i=co(x)}else var u=0,i=0;return[0,i,function(c,v){return u?p(v,u[1],c):c}]}function D2(x){return d1(x)?f4(x):kh(x)}function Ut(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,O3,2),e,t)})}function re(x,r){if(!r)return 0;var e=r[1];return[0,p(D2(x)[2],e,function(t,u){return p(Xx(t,lT,5),t,u)})]}function aj(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,UL,8),e,t)})}function vl(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,-1045824777,9),e,t)})}function c4(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,-455772979,10),e,t)})}function NU(x,r){if(!r)return 0;var e=r[1];return[0,p(D2(x)[2],e,function(t,u){return p(Xx(t,OL,13),t,u)})]}function Tn(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,tL,14),e,t)})}function CU(x,r){return p(D2(x)[2],r,function(e,t){var u=d(Xx(e,TD,16),e);return i4(function(i){return W2(u,i)},t)})}function jU(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,-21476009,17),e,t)})}T5(hs0,function(x){var r=jC(x,vs0),e=OC(ps0),t=e.length-1,u=BM.length-1,i=Wa(t+u|0,0),c=t-1|0,v=0;if(c>=0)for(var a=v;;){var l=J6(x,P2(e,a)[1+a]);P2(i,a)[1+a]=l;var m=a+1|0;if(c===a)break;var a=m}var h=u-1|0,T=0;if(h>=0)for(var b=T;;){var N=b+t|0,C=jC(x,P2(BM,b)[1+b]);P2(i,N)[1+N]=C;var I=b+1|0;if(h===b)break;var b=I}var F=i[4],M=i[5],Y=i[sF],q=i[Hk],K=i[317],u0=i[318],Q=i[45],e0=i[vL],f0=i[AD],a0=DC(x,0,0,UM,BC,1)[1];return RC(x,[0,e0,function(Z){return[0,Z[1+K],Z[1+u0]]},q,function(Z,v0){var t0=v0[2],y0=v0[1];return T1(d(Z[1][1+M],Z),y0),T1(d(Z[1][1+F],Z),t0)},Y,function(Z,v0){return v0?p(Z[1][1+q],Z,v0[1]):0},M,function(Z,v0){var t0=v0[1],y0=Z[1+K];if(y0){var n0=va(t0[2],y0[1][1][2])<0?1:0,s0=n0&&(Z[1+K]=[0,v0],0);return s0}var l0=va(t0[2],Z[1+r][2])<0?1:0,w0=l0&&(Z[1+K]=[0,v0],0);return w0},F,function(Z,v0){var t0=v0[1],y0=Z[1+u0];if(y0){var n0=va(y0[1][1][2],t0[2])<0?1:0,s0=n0&&(Z[1+u0]=[0,v0],0);return s0}var l0=0<=va(t0[2],Z[1+r][3])?1:0,w0=l0&&(Z[1+u0]=[0,v0],0);return w0},Q,function(Z,v0){return p(Z[1][1+q],Z,v0),v0},f0,function(Z,v0,t0){return p(Z[1][1+Y],Z,t0[2]),t0}]),function(Z,v0,t0){var y0=E5(v0,x);return y0[1+r]=t0,d(a0,y0),y0[1+K]=0,y0[1+u0]=0,FC(v0,y0,x)}});function OU(x){var r=L(x);x:{if(typeof r=="number"){var e=r;if(50<=e)switch(e){case 50:var u=Zs0;break x;case 51:var u=xa0;break x;case 52:var u=ra0;break x;case 53:var u=ea0;break x;case 54:var u=ta0;break x;case 55:var u=na0;break x;case 56:var u=ua0;break x;case 57:var u=ia0;break x;case 58:var u=fa0;break x;case 59:var u=ca0;break x;case 60:var u=sa0;break x;case 61:var u=aa0;break x;case 62:var u=oa0;break x;case 63:var u=va0;break x;case 64:var u=la0;break x;case 65:var u=pa0;break x;case 66:var u=ka0;break x;case 115:var u=ma0;break x;case 116:var u=ha0;break x;case 117:var u=da0;break x;case 118:var u=ya0;break x;case 119:var u=ga0;break x;case 120:var u=wa0;break x;case 121:var u=_a0;break x;case 122:var u=ba0;break x;case 123:var u=Ta0;break x;case 124:var u=Ea0;break x;case 125:var u=Sa0;break x;case 126:var u=Aa0;break x;case 127:var u=Pa0;break x;case 129:var u=Ia0;break x;case 130:var u=Na0;break x;case 131:var u=Ca0;break x}else switch(e){case 15:var u=ds0;break x;case 16:var u=ys0;break x;case 17:var u=gs0;break x;case 18:var u=ws0;break x;case 19:var u=_s0;break x;case 20:var u=bs0;break x;case 21:var u=Ts0;break x;case 22:var u=Es0;break x;case 23:var u=Ss0;break x;case 24:var u=As0;break x;case 25:var u=Ps0;break x;case 26:var u=Is0;break x;case 27:var u=Ns0;break x;case 28:var u=Cs0;break x;case 29:var u=js0;break x;case 30:var u=Os0;break x;case 31:var u=Ds0;break x;case 32:var u=Fs0;break x;case 33:var u=Rs0;break x;case 34:var u=Ls0;break x;case 35:var u=Ms0;break x;case 36:var u=qs0;break x;case 37:var u=Bs0;break x;case 38:var u=Us0;break x;case 39:var u=Xs0;break x;case 40:var u=Ys0;break x;case 41:var u=zs0;break x;case 42:var u=Ks0;break x;case 43:var u=Js0;break x;case 44:var u=Gs0;break x;case 45:var u=Ws0;break x;case 46:var u=Vs0;break x;case 47:var u=$s0;break x;case 48:var u=Qs0;break x;case 49:var u=Hs0;break x}}else switch(r[0]){case 4:var u=r[2];break x;case 11:var t=r[1]?ja0:Oa0,u=t;break x}p2(Da0,x);var u=Fa0}return T0(x),u}function a1(x){var r=G0(x),e=i0(x),t=OU(x);return[0,r,[0,t,x0([0,e],[0,q0(x)],O)]]}function DU(x){var r=G0(x),e=i0(x);J(x,14);var t=G0(x),u=OU(x),i=x0([0,e],[0,q0(x)],O),c=Vr(r,t),v=t[2],a=r[3],l=a[1]===v[1]?1:0,m=l&&(a[2]===v[2]?1:0);return 1-m&&B0(x,[0,c,G1]),[0,c,[0,u,i]]}function Dv(x){var r=x[2],e=r[3]===0?1:0,t=r[2];if(!e)return e;for(var u=t;;){if(!u)return 1;var i=u[1][2],c=u[2];x:{if(i[1][2][0]===2&&!i[2]){var v=1;break x}var v=0}if(!v)return v;var u=c}}function s4(x){for(var r=x;;){var e=r[2];if(e[0]!==31)return 0;var t=e[1][2];if(t[2][0]===27)return 1;var r=t}}function mh(x,r,e){var t=e[2][1],u=e[1];if(!P(t,fv)){var i=r[19];return i&&B0(r,[0,u,5])}if(P(t,j3)){if(!P(t,z1))return r[18]?B0(r,[0,u,96]):pt(r,[0,u,81])}else if(r[14])return B0(r,[0,u,[26,D5(t)]]);if(sl(t))return pt(r,[0,u,81]);if(ch(t))return B0(r,[0,u,96]);if(x){var c=x[1];if(Cv(t))return pt(r,[0,u,c])}}function r0(x,r,e){var t=x?x[1]:G0(e),u=d(r,e),i=cl(e),c=i?Vr(t,i[1]):t;return[0,c,u]}function oj(x,r,e){var t=r0(x,r,e),u=t[2];return[0,[0,t[1],u[1]],u[2]]}function hh(x){V2(x,0);var r=L(x);H2(x);var e=rr(1,x);x:{r:{if(typeof r=="number"){if(r!==22)break x}else{if(r[0]!==4)break x;var t=r[3];if(P(t,E3)){if(!P(t,d3))e:{if(typeof e=="number"){if(e!==22)break e}else if(e[0]!==4)break e;break r}}else e:{if(typeof e=="number"){if(e!==22)break e}else if(e[0]!==4)break e;break r}}if(typeof e=="number"){if(Ko!==e)break x}else if(e[0]!==4||P(e[3],p6))break x}return 1}return 0}function FU(x,r){var e=r[1],t=r[2][1],u=t?0:1;u&&B0(x,[0,e,49]);function i(F){return F[0]===0?[0,F[1]]:(B0(x,[0,F[1][1],50]),0)}x:{for(var c=t;;){if(!c){var v=0;break x}var a=c[2],l=i(c[1]);if(l)break;var c=a}for(var m=[0,l[1],La],h=m,T=1,b=a;;){if(!b){h[1+T]=0;var v=m;break}var N=b[2],C=i(b[1]);if(C){var I=[0,C[1],La];h[1+T]=I;var h=I,T=1,b=N}else var b=N}}return v&&!v[2]?v[1]:[0,e,[29,[0,v,0]]]}function RU(x){switch(x){case 3:return 2;case 4:return 1;case 5:return 1;case 6:return 1;case 7:return 1;default:return 1}}function vj(x,r,e){if(e){var t=e[1];x:{if(t!==8232&&t1!==t){if(t===10){var u=6;break x}if(t===13){var u=5;break x}if(v6<=t){var u=3;break x}if(c_<=t){var u=2;break x}if(M2<=t){var u=1;break x}var u=0;break x}var u=7}var i=u}else var i=4;return[0,i,x]}var $b0=[i2,mo0,ks(0)];function LU(x,r,e,t){try{var u=P2(x,r)[1+r];return u}catch(c){var i=B2(c);throw i[1]===o5?K0([0,$b0,e,Q0(sr(po0),t,r,x.length-1)],1):K0(i,0)}}function dh(x,r){if(r[1]===0&&r[2]===0)return 0;var e=LU(x,r[1]-1|0,r,vo0);return LU(e,r[2],r,lo0)}function MU(x){function r(a){var l=L(a);x:if(typeof l=="number"){if(8<=l){if(10<=l)break x}else if(l!==1)break x;return 1}return 0}function e(a,l,m,h,T,b){var N=Q0(x[24],a,T,b);if(m)var C=Mx(Uo0,b),I=-N;else var C=b,I=N;var F=q0(a);return r(a)?[2,l,[0,I,C,x0([0,h],[0,F],O)]]:[0,l]}function t(a){var l=G0(a),m=i0(a),h=L(a);if(typeof h=="number")switch(h){case 105:T0(a);var T=L(a);return typeof T!="number"&&T[0]===0?e(a,l,1,m,T[1],T[2]):[0,l];case 31:case 32:T0(a);var b=q0(a);return r(a)?[1,l,[0,h===32?1:0,x0([0,m],[0,b],O)]]:[0,l]}else switch(h[0]){case 0:return e(a,l,0,m,h[1],h[2]);case 1:var N=h[2],C=Q0(x[26],a,h[1],N),I=q0(a);return r(a)?[4,l,[0,C,N,x0([0,m],[0,I],O)]]:[0,l];case 2:var F=h[1],M=F[1],Y=F[3],q=F[2];F[4]&&Ne(a,77),T0(a);var K=q0(a);return r(a)?[3,M,[0,q,Y,x0([0,m],[0,K],O)]]:[0,M]}return T0(a),[0,l]}var u=[0,Xo0,N1[1],0,0];function i(a){var l=a1(a),m=L(a);x:{if(typeof m=="number"){if(m===83){J(a,83);var h=t(a);break x}if(m===87){Ux(a,[8,l[2][1]]),J(a,87);var h=t(a);break x}}var h=0}return[0,l,h]}var c=0;function v(a,l,m,h,T,b,N){var C=ia(T),I=ia(b);function F(Y){return[2,[0,[0,b],m,h,N]]}function M(Y){return[2,[0,[1,T],m,h,N]]}return C===0?F(O):I===0?M(O):C>>0){if(J1>=Q+1>>>0)break}else if(Q===10){var e0=G0(I),f0=i0(I);T0(I);var a0=L(I);x:{r:if(typeof a0=="number"){var Z=a0-2|0;if(G1>>0){if(J1>>0)break r}else{if(Z!==7)break r;J(I,9);var v0=L(I);e:{t:if(typeof v0=="number"){if(v0!==1&&kr!==v0)break t;var t0=1;break e}var t0=0}B0(I,[0,e0,[6,t0]])}break x}B0(I,[0,e0,Do0])}var K=[0,K[1],K[2],1,f0];continue}}var y0=K[2],n0=K[1],s0=r0(c,i,I),l0=s0[2],w0=l0[2],L0=l0[1],I0=s0[1],j0=L0[2][1],S0=L0[1];x:if(_r(j0,H0))var W0=K;else{var A0=q2(j0,0),J0=97<=A0?1:0,b0=J0&&(A0<=c2?1:0);b0&&B0(I,[0,S0,[10,b,j0]]),N1[3].call(null,j0,y0)&&B0(I,[0,S0,[4,b,j0]]);var z=K[4],C0=K[3],V0=N1[4].call(null,j0,y0),N0=[0,K[1],V0,C0,z];let fx=j0;var rx=function(Qx,vx){if(Y&&Y[1]!==Qx)return B0(I,[0,vx,[9,b,Y,fx]])};if(typeof w0=="number"){if(Y)switch(Y[1]){case 0:B0(I,[0,I0,[3,b,j0]]);var W0=N0;break x;case 1:B0(I,[0,I0,[11,b,j0]]);var W0=N0;break x;case 4:B0(I,[0,I0,[2,b,j0]]);var W0=N0;break x}var W0=[0,[0,n0[1],n0[2],n0[3],n0[4],[0,[0,I0,[0,L0]],n0[5]]],V0,C0,z]}else switch(w0[0]){case 0:B0(I,[0,w0[1],[9,b,Y,j0]]);var W0=N0;break;case 1:var xx=w0[1],nx=w0[2];rx(0,xx);var W0=[0,[0,[0,[0,I0,[0,L0,[0,xx,nx]]],n0[1]],n0[2],n0[3],n0[4],n0[5]],V0,C0,z];break;case 2:var mx=w0[1],F0=w0[2];rx(1,mx);var W0=[0,[0,n0[1],[0,[0,I0,[0,L0,[0,mx,F0]]],n0[2]],n0[3],n0[4],n0[5]],V0,C0,z];break;case 3:var px=w0[1],dx=w0[2];rx(2,px);var W0=[0,[0,n0[1],n0[2],[0,[0,I0,[0,L0,[0,px,dx]]],n0[3]],n0[4],n0[5]],V0,C0,z];break;default:var W=w0[1],g0=w0[2];rx(4,W);var W0=[0,[0,n0[1],n0[2],n0[3],[0,[0,I0,[0,L0,[0,W,g0]]],n0[4]],n0[5]],V0,C0,z]}}var B=L(I);x:{r:if(typeof B=="number"){var h0=B-2|0;if(G1>>0){if(J1>>0)break r}else{if(h0!==6)break r;Ux(I,18),J(I,8)}break x}J(I,9)}var K=W0}var _0=K[3],d0=K[4],E0=tx(K[1][5]),U=tx(K[1][4]),Kx=tx(K[1][3]),Ix=tx(K[1][2]),z0=tx(K[1][1]),Kr=Lx(d0,i0(I));J(I,1);var S=L(I);x:{r:if(typeof S=="number"){if(S!==1&&kr!==S)break r;var G=q0(I);break x}var G=d1(I)?co(I):0}var Z0=j2([0,q],[0,G],Kr,O);if(Y){switch(Y[1]){case 0:var yx=[0,[0,z0,1,_0,Z0]];break;case 1:var yx=[1,[0,Ix,1,_0,Z0]];break;case 2:var yx=v(I,b,1,_0,Kx,E0,Z0);break;case 3:var yx=[3,[0,E0,_0,Z0]];break;default:var yx=[4,[0,U,1,_0,Z0]]}var Tx=yx}else{var ex=ia(z0),m0=ia(Ix),Dx=ia(U),Ex=ia(Kx),qx=ia(E0),O0=function(fx){return[2,[0,Fo0,0,_0,Z0]]};x:{if(ex===0&&m0===0&&Dx===0){if(Ex===0&&qx===0){var Wx=O0(O);break x}var Wx=v(I,b,0,_0,Kx,E0,Z0);break x}if(m0===0&&Dx===0&&Ex===0&&qx<=ex){T1(function(Qx){return B0(I,[0,Qx[1],[3,b,Qx[2][1][2][1]]])},E0);var Wx=[0,[0,z0,0,_0,Z0]];break x}if(ex===0){if(Dx===0&&Ex===0&&qx<=m0){T1(function(Qx){return B0(I,[0,Qx[1],[11,b,Qx[2][1][2][1]]])},E0);var Wx=[1,[0,Ix,0,_0,Z0]];break x}if(m0===0&&Ex===0&&qx<=Dx){T1(function(Qx){return B0(I,[0,Qx[1],[11,b,Qx[2][1][2][1]]])},E0);var Wx=[4,[0,U,0,_0,Z0]];break x}}B0(I,[0,N,[5,b]]);var Wx=O0(O)}var Tx=Wx}return Tx},l);return[0,T,C,x0([0,h],0,O)]}]}function ll(x){return[0,pa(x)]}function yh(x,r,e){if(typeof e=="number")return[0,x,r];if(e[0]===0){var t=e[1],u=ux(x,t),i=e[2];return u===0?i===r?e:[0,t,r]:0<=u?[1,2,x,r,e,0]:[1,2,x,r,0,e]}var c=e[5],v=e[4],a=e[3],l=e[2],m=ux(x,l),h=e[1];if(m===0)return a===r?e:[1,h,x,r,v,c];if(0<=m){var T=yh(x,r,c);return c===T?e:hB(v,l,a,T)}var b=yh(x,r,v);return v===b?e:hB(b,l,a,c)}function Qb0(x,r){if(typeof x=="number"){var e=x;if(57<=e)switch(e){case 57:if(typeof r=="number"&&r===57)return 0;break;case 58:if(typeof r=="number"&&r===58)return 0;break;case 59:if(typeof r=="number"&&r===59)return 0;break;case 60:if(typeof r=="number"&&r===60)return 0;break;case 61:if(typeof r=="number"&&r===61)return 0;break;case 62:if(typeof r=="number"&&r===62)return 0;break;case 63:if(typeof r=="number"&&r===63)return 0;break;case 64:if(typeof r=="number"&&r===64)return 0;break;case 65:if(typeof r=="number"&&r===65)return 0;break;case 66:if(typeof r=="number"&&r===66)return 0;break;case 67:if(typeof r=="number"&&r===67)return 0;break;case 68:if(typeof r=="number"&&r===68)return 0;break;case 69:if(typeof r=="number"&&r===69)return 0;break;case 70:if(typeof r=="number"&&r===70)return 0;break;case 71:if(typeof r=="number"&&r===71)return 0;break;case 72:if(typeof r=="number"&&r===72)return 0;break;case 73:if(typeof r=="number"&&r===73)return 0;break;case 74:if(typeof r=="number"&&r===74)return 0;break;case 75:if(typeof r=="number"&&r===75)return 0;break;case 76:if(typeof r=="number"&&r===76)return 0;break;case 77:if(typeof r=="number"&&r===77)return 0;break;case 78:if(typeof r=="number"&&r===78)return 0;break;case 79:if(typeof r=="number"&&r===79)return 0;break;case 80:if(typeof r=="number"&&r===80)return 0;break;case 81:if(typeof r=="number"&&r===81)return 0;break;case 82:if(typeof r=="number"&&r===82)return 0;break;case 83:if(typeof r=="number"&&r===83)return 0;break;case 84:if(typeof r=="number"&&r===84)return 0;break;case 85:if(typeof r=="number"&&r===85)return 0;break;case 86:if(typeof r=="number"&&r===86)return 0;break;case 87:if(typeof r=="number"&&r===87)return 0;break;case 88:if(typeof r=="number"&&r===88)return 0;break;case 89:if(typeof r=="number"&&r===89)return 0;break;case 90:if(typeof r=="number"&&r===90)return 0;break;case 91:if(typeof r=="number"&&r===91)return 0;break;case 92:if(typeof r=="number"&&r===92)return 0;break;case 93:if(typeof r=="number"&&r===93)return 0;break;case 94:if(typeof r=="number"&&r===94)return 0;break;case 95:if(typeof r=="number"&&r===95)return 0;break;case 96:if(typeof r=="number"&&r===96)return 0;break;case 97:if(typeof r=="number"&&r===97)return 0;break;case 98:if(typeof r=="number"&&r===98)return 0;break;case 99:if(typeof r=="number"&&r===99)return 0;break;case 100:if(typeof r=="number"&&y2===r)return 0;break;case 101:if(typeof r=="number"&&se===r)return 0;break;case 102:if(typeof r=="number"&&cn===r)return 0;break;case 103:if(typeof r=="number"&&F1===r)return 0;break;case 104:if(typeof r=="number"&&ft===r)return 0;break;case 105:if(typeof r=="number"&&Pt===r)return 0;break;case 106:if(typeof r=="number"&&vn===r)return 0;break;case 107:if(typeof r=="number"&&K2===r)return 0;break;case 108:if(typeof r=="number"&&Hs===r)return 0;break;case 109:if(typeof r=="number"&&Vn===r)return 0;break;case 110:if(typeof r=="number"&&w1===r)return 0;break;case 111:if(typeof r=="number"&&G1===r)return 0;break;case 112:if(typeof r=="number"&&Qs===r)return 0;break;default:if(typeof r=="number"&&J1<=r)return 0}else switch(e){case 0:if(typeof r=="number"&&!r)return 0;break;case 1:if(typeof r=="number"&&r===1)return 0;break;case 2:if(typeof r=="number"&&r===2)return 0;break;case 3:if(typeof r=="number"&&r===3)return 0;break;case 4:if(typeof r=="number"&&r===4)return 0;break;case 5:if(typeof r=="number"&&r===5)return 0;break;case 6:if(typeof r=="number"&&r===6)return 0;break;case 7:if(typeof r=="number"&&r===7)return 0;break;case 8:if(typeof r=="number"&&r===8)return 0;break;case 9:if(typeof r=="number"&&r===9)return 0;break;case 10:if(typeof r=="number"&&r===10)return 0;break;case 11:if(typeof r=="number"&&r===11)return 0;break;case 12:if(typeof r=="number"&&r===12)return 0;break;case 13:if(typeof r=="number"&&r===13)return 0;break;case 14:if(typeof r=="number"&&r===14)return 0;break;case 15:if(typeof r=="number"&&r===15)return 0;break;case 16:if(typeof r=="number"&&r===16)return 0;break;case 17:if(typeof r=="number"&&r===17)return 0;break;case 18:if(typeof r=="number"&&r===18)return 0;break;case 19:if(typeof r=="number"&&r===19)return 0;break;case 20:if(typeof r=="number"&&r===20)return 0;break;case 21:if(typeof r=="number"&&r===21)return 0;break;case 22:if(typeof r=="number"&&r===22)return 0;break;case 23:if(typeof r=="number"&&r===23)return 0;break;case 24:if(typeof r=="number"&&r===24)return 0;break;case 25:if(typeof r=="number"&&r===25)return 0;break;case 26:if(typeof r=="number"&&r===26)return 0;break;case 27:if(typeof r=="number"&&r===27)return 0;break;case 28:if(typeof r=="number"&&r===28)return 0;break;case 29:if(typeof r=="number"&&r===29)return 0;break;case 30:if(typeof r=="number"&&r===30)return 0;break;case 31:if(typeof r=="number"&&r===31)return 0;break;case 32:if(typeof r=="number"&&r===32)return 0;break;case 33:if(typeof r=="number"&&r===33)return 0;break;case 34:if(typeof r=="number"&&r===34)return 0;break;case 35:if(typeof r=="number"&&r===35)return 0;break;case 36:if(typeof r=="number"&&r===36)return 0;break;case 37:if(typeof r=="number"&&r===37)return 0;break;case 38:if(typeof r=="number"&&r===38)return 0;break;case 39:if(typeof r=="number"&&r===39)return 0;break;case 40:if(typeof r=="number"&&r===40)return 0;break;case 41:if(typeof r=="number"&&r===41)return 0;break;case 42:if(typeof r=="number"&&r===42)return 0;break;case 43:if(typeof r=="number"&&r===43)return 0;break;case 44:if(typeof r=="number"&&r===44)return 0;break;case 45:if(typeof r=="number"&&r===45)return 0;break;case 46:if(typeof r=="number"&&r===46)return 0;break;case 47:if(typeof r=="number"&&r===47)return 0;break;case 48:if(typeof r=="number"&&r===48)return 0;break;case 49:if(typeof r=="number"&&r===49)return 0;break;case 50:if(typeof r=="number"&&r===50)return 0;break;case 51:if(typeof r=="number"&&r===51)return 0;break;case 52:if(typeof r=="number"&&r===52)return 0;break;case 53:if(typeof r=="number"&&r===53)return 0;break;case 54:if(typeof r=="number"&&r===54)return 0;break;case 55:if(typeof r=="number"&&r===55)return 0;break;default:if(typeof r=="number"&&r===56)return 0}}else switch(x[0]){case 0:if(typeof r!="number"&&r[0]===0){var t=r[1],u=x[1];return p(d(mr[43],0),u,t)}break;case 1:if(typeof r!="number"&&r[0]===1){var i=r[1],c=x[1];return p(d(mr[42],0),c,i)}break;case 2:if(typeof r!="number"&&r[0]===2){var v=r[2],a=r[1],l=x[2],m=x[1],h=p(d(mr[41],0),m,a);return h===0?p(d(mr[40],0),l,v):h}break;case 3:if(typeof r!="number"&&r[0]===3){var T=r[2],b=r[1],N=x[2],C=x[1],I=p(d(mr[39],0),C,b);return I===0?p(d(mr[38],0),N,T):I}break;case 4:if(typeof r!="number"&&r[0]===4){var F=r[2],M=r[1],Y=x[2],q=x[1],K=p(d(mr[37],0),q,M);return K===0?p(d(mr[36],0),Y,F):K}break;case 5:if(typeof r!="number"&&r[0]===5){var u0=r[1],Q=x[1];return p(d(mr[35],0),Q,u0)}break;case 6:if(typeof r!="number"&&r[0]===6){var e0=r[1],f0=x[1];return p(d(mr[34],0),f0,e0)}break;case 7:if(typeof r!="number"&&r[0]===7){var a0=r[2],Z=x[2],v0=r[1],t0=x[1],y0=p(d(mr[33],0),t0,v0);if(y0!==0)return y0;if(!Z)return a0?-1:0;var n0=Z[1];if(!a0)return 1;var s0=a0[1];return p(d(mr[32],0),n0,s0)}break;case 8:if(typeof r!="number"&&r[0]===8){var l0=r[1],w0=x[1];return p(d(mr[31],0),w0,l0)}break;case 9:if(typeof r!="number"&&r[0]===9){var L0=r[2],I0=x[2],j0=r[3],S0=r[1],W0=x[3],A0=x[1],J0=p(d(mr[30],0),A0,S0);if(J0!==0)return J0;if(I0)var b0=I0[1],z=L0?p(mr[29],b0,L0[1]):1;else var z=L0?-1:0;return z===0?p(d(mr[28],0),W0,j0):z}break;case 10:if(typeof r!="number"&&r[0]===10){var C0=r[2],V0=r[1],N0=x[2],rx=x[1],xx=p(d(mr[27],0),rx,V0);return xx===0?p(d(mr[26],0),N0,C0):xx}break;case 11:if(typeof r!="number"&&r[0]===11){var nx=r[2],mx=r[1],F0=x[2],px=x[1],dx=p(d(mr[25],0),px,mx);return dx===0?p(d(mr[24],0),F0,nx):dx}break;case 12:if(typeof r!="number"&&r[0]===12){var W=r[1],g0=x[1];return p(d(mr[23],0),g0,W)}break;case 13:if(typeof r!="number"&&r[0]===13){var B=r[1],h0=x[1];return p(d(mr[22],0),h0,B)}break;case 14:if(typeof r!="number"&&r[0]===14){var _0=r[1],d0=x[1];return p(d(mr[21],0),d0,_0)}break;case 15:if(typeof r!="number"&&r[0]===15){var E0=r[4],U=r[3],Kx=r[2],Ix=r[1],z0=x[4],Kr=x[3],S=x[2],G=x[1],Z0=p(d(mr[20],0),G,Ix);if(Z0!==0)return Z0;var yx=p(d(mr[19],0),S,Kx);if(yx!==0)return yx;var Tx=p(d(mr[18],0),Kr,U);return Tx===0?p(d(mr[17],0),z0,E0):Tx}break;case 16:if(typeof r!="number"&&r[0]===16){var ex=r[1],m0=x[1];return p(d(mr[16],0),m0,ex)}break;case 17:if(typeof r!="number"&&r[0]===17){var Dx=r[2],Ex=r[1],qx=x[2],O0=x[1],Wx=p(d(mr[15],0),O0,Ex);return Wx===0?p(d(mr[14],0),qx,Dx):Wx}break;case 18:if(typeof r!="number"&&r[0]===18){var Yx=r[1],fx=x[1];return p(d(mr[13],0),fx,Yx)}break;case 19:if(typeof r!="number"&&r[0]===19){var Qx=r[1],vx=x[1];return p(d(mr[12],0),vx,Qx)}break;case 20:if(typeof r!="number"&&r[0]===20){var nr=r[1],gr=x[1];if(t6<=gr){if(typeof nr=="number"&&t6===nr)return 0}else if(typeof nr=="number"&&wR===nr)return 0;var Nr=function(ke){return t6<=ke?1:0},s2=Nr(nr);return Je(Nr(gr),s2)}break;case 21:if(typeof r!="number"&&r[0]===21){var b2=r[1],k2=x[1];return p(d(mr[11],0),k2,b2)}break;case 22:if(typeof r!="number"&&r[0]===22){var F2=r[1],jx=x[1];return p(d(mr[10],0),jx,F2)}break;case 23:if(typeof r!="number"&&r[0]===23){var _=r[2],$=r[1],ix=x[2],U0=x[1],cx=p(d(mr[9],0),U0,$);return cx===0?p(d(mr[8],0),ix,_):cx}break;case 24:if(typeof r!="number"&&r[0]===24){var wx=r[1],Or=x[1];if(Jl===Or){if(typeof wx=="number"&&Jl===wx)return 0}else if(l6<=Or){if(typeof wx=="number"&&l6===wx)return 0}else if(typeof wx=="number"&&XO===wx)return 0;var Hx=function(ke){return Jl===ke?0:l6<=ke?2:1},x2=Hx(wx);return Je(Hx(Or),x2)}break;case 25:if(typeof r!="number"&&r[0]===25){var hr=r[1],Dr=x[1];return p(d(mr[7],0),Dr,hr)}break;case 26:if(typeof r!="number"&&r[0]===26){var r2=r[1],sx=x[1];return p(d(mr[6],0),sx,r2)}break;case 27:if(typeof r!="number"&&r[0]===27){var Sx=r[2],Zx=r[1],Ur=x[2],Y2=x[1],pe=p(d(mr[5],0),Y2,Zx);return pe===0?p(d(mr[4],0),Ur,Sx):pe}break;case 28:if(typeof r!="number"&&r[0]===28){var j1=r[2],kt=r[1],zt=x[2],O1=x[1],q1=p(d(mr[3],0),O1,kt);return q1===0?p(d(mr[2],0),zt,j1):q1}break;default:if(typeof r!="number"&&r[0]===29){var T2=r[1],En=x[1];return p(d(mr[1],0),En,T2)}}function Sn(ke){if(typeof ke!="number")switch(ke[0]){case 0:return 16;case 1:return 17;case 2:return 19;case 3:return 20;case 4:return 21;case 5:return 22;case 6:return 23;case 7:return 24;case 8:return 26;case 9:return 27;case 10:return 28;case 11:return 30;case 12:return 31;case 13:return 33;case 14:return 36;case 15:return 48;case 16:return 50;case 17:return 51;case 18:return 53;case 19:return 61;case 20:return 69;case 21:return 73;case 22:return 82;case 23:return 89;case 24:return Vn;case 25:return F3;case 26:return f6;case 27:return Ko;case 28:return QO;default:return XL}var Qe=ke;if(57<=Qe)switch(Qe){case 57:return 79;case 58:return 80;case 59:return 81;case 60:return 83;case 61:return 84;case 62:return 85;case 63:return 86;case 64:return 87;case 65:return 88;case 66:return 90;case 67:return 91;case 68:return 92;case 69:return 93;case 70:return 94;case 71:return 95;case 72:return 96;case 73:return 97;case 74:return 98;case 75:return 99;case 76:return y2;case 77:return se;case 78:return cn;case 79:return F1;case 80:return ft;case 81:return Pt;case 82:return vn;case 83:return K2;case 84:return Hs;case 85:return w1;case 86:return G1;case 87:return Qs;case 88:return J1;case 89:return kr;case 90:return iv;case 91:return av;case 92:return h3;case 93:return mf;case 94:return y6;case 95:return c2;case 96:return en;case 97:return P3;case 98:return qa;case 99:return Ik;case 100:return Xr;case 101:return M2;case 102:return w6;case 103:return u6;case 104:return u8;case 105:return Ek;case 106:return TR;case 107:return aR;case 108:return OD;case 109:return mT;case 110:return DL;case 111:return NR;case 112:return ZL;default:return KR}switch(Qe){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;case 7:return 7;case 8:return 8;case 9:return 9;case 10:return 10;case 11:return 11;case 12:return 12;case 13:return 13;case 14:return 14;case 15:return 15;case 16:return 18;case 17:return 25;case 18:return 29;case 19:return 32;case 20:return 34;case 21:return 35;case 22:return 37;case 23:return 38;case 24:return 39;case 25:return 40;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 49;case 34:return 52;case 35:return 54;case 36:return 55;case 37:return 56;case 38:return 57;case 39:return 58;case 40:return 59;case 41:return 60;case 42:return 62;case 43:return 63;case 44:return 64;case 45:return 65;case 46:return 66;case 47:return 67;case 48:return 68;case 49:return 70;case 50:return 71;case 51:return 72;case 52:return 74;case 53:return 75;case 54:return 76;case 55:return 77;default:return 78}}var Ss=Sn(r);return Je(Sn(x),Ss)}var lj=yB([0,function(x,r){var e=r[2],t=x[2],u=EB(x[1],r[1]);return u===0?Qb0(t,e):u}]);function a4(x,r,e){var t=e[2][1],u=e[1];return _r(t,H0)?r:N1[3].call(null,t,r)?(B0(x,[0,u,[0,t]]),r):N1[4].call(null,t,r)}function pj(x){return function(r){var e=r[2];switch(e[0]){case 0:return m1(function(t,u){var i=u[0]===0?u[1][2][2]:u[1][2][1];return pj(t)(i)},x,e[1][1]);case 1:return m1(function(t,u){if(u[0]===2)return t;var i=u[1][2][1];return pj(t)(i)},x,e[1][1]);case 2:return[0,e[1][1],x];default:return bx(Zl0)}}}var X0=Zq(r60,x60[1]);function gh(x,r,e){var t=x?x[1]:0,u=r?r[1]:0,i=G0(e),c=L(e);if(typeof c=="number")switch(c){case 104:var v=i0(e);return T0(e),[0,[0,i,[0,0,x0([0,v],0,O)]]];case 105:var a=i0(e);return T0(e),[0,[0,i,[0,1,x0([0,a],0,O)]]];case 127:if(t){var l=i0(e);return T0(e),[0,[0,i,[0,2,x0([0,l],0,O)]]]}break}else if(c[0]===4){var m=c[3];if(P(m,Ra)){if(!P(m,bw)&&u&&sh(1,e)){var h=i0(e);return T0(e),[0,[0,i,[0,4,x0([0,h],0,O)]]]}}else if(u&&sh(1,e)){var T=i0(e);T0(e);var b=L(e);x:{if(typeof b!="number"&&b[0]===4&&!P(b[3],bw)){var N=G0(e);T0(e);var C=Vr(i,N),I=5;break x}var C=i,I=3}return[0,[0,C,[0,I,x0([0,T],0,O)]]]}}return 0}function qU(x,r,e,t,u){r===1&&Ne(u,77);var i=i0(u);T0(u);var c=q0(u);if(x)var v=x0([0,Lx(x[1],i)],[0,c],O),a=v,l=Mx(oo0,t),m=-e;else var a=x0([0,i],[0,c],O),l=t,m=e;return[30,[0,m,l,a]]}function BU(x,r,e,t){var u=i0(t);T0(t);var i=q0(t);if(x)var c=x0([0,Lx(x[1],u)],[0,i],O),v=Mx(ao0,e),a=c,l=v,m=l5(LN,r);else var a=x0([0,u],[0,i],O),l=e,m=r;return[31,[0,m,l,a]]}var UU=[],XU=[],YU=[],zU=[],KU=[],JU=[],GU=[],WU=[],VU=[],$U=[],QU=[];function Zr(x){var r=G0(x),e=tj(0,x);return HU(e,r,kj(e))}function o4(x){return 1-S2(x)&&Ux(x,F1),r0(0,function(r){return J(r,87),Zr(r)},x)}function HU(x,r,e){var t=L(x);return typeof t=="number"&&t===42?r0([0,r],function(u){J(u,42);var i=kj(tj(1,u));vh(u,86);var c=Zr(u);vh(u,87);var v=Zr(u);return[17,[0,e,i,c,v,x0(0,[0,q0(u)],O)]]},x):e}function kj(x){var r=G0(x);if(L(x)===90){var e=i0(x);T0(x);var t=e}else var t=0;return ZU(x,[0,t],r,xX(x))}function ZU(x,r,e,t){var u=r?r[1]:0;return L(x)===90?r0([0,e],p(UU[1],u,[0,t,0]),x):t}function xX(x){var r=G0(x);if(L(x)===92){var e=i0(x);T0(x);var t=e}else var t=0;return rX(x,[0,t],r,eX(x))}function rX(x,r,e,t){var u=r?r[1]:0;return L(x)===92?r0([0,e],p(XU[1],u,[0,t,0]),x):t}function eX(x){return tX(x,mj(x))}function tX(x,r){var e=L(x);if(typeof e=="number"&&e===11&&!x[15]){var t=wh(x,r);return bh(1,x,t[1],0,[0,t[1],[0,0,[0,t,0],0,0]])}return r}function mj(x){var r=L(x);if(typeof r=="number"&&r===86)return r0(0,function(t){var u=i0(t);J(t,86);var i=x0([0,u],0,O);return[11,[0,mj(t),i]]},x);var e=G0(x);return nX(0,x,e,Hb0(x))}function hj(x,r,e,t,u){var i=r?r[1]:0;if(d1(e))return u;var c=L(e);if(typeof c=="number"){if(c===6){T0(e);var v=0;return x<50?pl(x+1|0,i,v,e,t,u):J2(pl,[0,i,v,e,t,u])}if(c===10){var a=rr(1,e);if(typeof a=="number"&&a===6){Ux(e,Ra0),J(e,10),J(e,6);var l=0;return x<50?pl(x+1|0,i,l,e,t,u):J2(pl,[0,i,l,e,t,u])}return Ux(e,La0),u}if(c===84){T0(e),L(e)!==6&&Ux(e,40),J(e,6);var m=1,h=1;return x<50?pl(x+1|0,h,m,e,t,u):J2(pl,[0,h,m,e,t,u])}}return u}function nX(x,r,e,t){return a5(hj(0,x,r,e,t))}function pl(x,r,e,t,u,i){var c=r0([0,u],function(a){if(!e&&$r(a,7))return[16,[0,i,x0(0,[0,q0(a)],O)]];var l=Zr(a);J(a,7);var m=[0,i,l,x0(0,[0,q0(a)],O)];return r?[21,[0,m,e]]:[20,m]},t),v=[0,r];return x<50?hj(x+1|0,v,t,u,c):J2(hj,[0,v,t,u,c])}function uX(x){if(V2(x,0),L(x)===4){T0(x);var r=uX(x);J(x,5);var t=r}else if(_n(x))var e=p(X0[13],0,x),t=[0,p(YU[1],x,[0,e[1],[0,e]])];else{Ux(x,45);var t=0}return H2(x),t}function Hb0(x){var r=G0(x),e=L(x);x:{r:{if(typeof e=="number")switch(e){case 4:var t=G0(x),u=r0(0,rT0,x),i=u[2],c=u[1];return i[0]===0?bh(1,x,t,0,[0,c,i[1]]):i[1];case 6:return r0(0,function(n0){var s0=i0(n0);J(n0,6);var l0=Nv(0,n0),w0=p(zU[1],l0,0),L0=w0[2],I0=w0[1];return J(n0,7),[28,[0,I0,L0,x0([0,s0],[0,q0(n0)],O)]]},x);case 47:return r0(0,function(n0){var s0=i0(n0);J(n0,47);var l0=uX(n0);if(!l0)return Ma0;var w0=l0[1],L0=d1(n0)?0:wj(n0);return[24,[0,w0,L0,x0([0,s0],0,O)]]},x);case 54:return r0(0,function(n0){var s0=i0(n0);T0(n0);var l0=oX(n0),w0=l0[2],L0=l0[1];return[15,[0,w0,L0,x0([0,s0],0,O)]]},x);case 99:var v=G0(x),a=re(x,Rv(x));return bh(1,x,v,a,_h(x));case 105:return r0(0,Zb0,x);case 107:var l=i0(x);return T0(x),[0,r,[10,x0([0,l],[0,q0(x)],O)]];case 126:return r0(0,function(n0){var s0=i0(n0);T0(n0);var l0=q0(n0),w0=Zr(n0);return[25,[0,w0,x0([0,s0],[0,l0],O)]]},x);case 127:return r0(0,function(n0){var s0=i0(n0);T0(n0);var l0=q0(n0),w0=Zr(n0);return[27,[0,w0,x0([0,s0],[0,l0],O)]]},x);case 128:return r0(0,function(n0){var s0=i0(n0);T0(n0);var l0=q0(n0),w0=r0(0,function(L0){var I0=Fv(L0);return[0,I0,ph(L0,[0,G0(L0)],function(j0){if(1-$r(j0,42))throw K0(Bt,1);var S0=kj(j0);if(!j0[16]&&L(j0)===86)throw K0(Bt,1);return[1,[0,S0[1],S0]]}),1,0,0,0]},n0);return[18,[0,w0,x0([0,s0],[0,l0],O)]]},x);case 0:case 2:var m=gj(0,1,1,x);return[0,m[1],[14,m[2]]];case 132:case 133:break r;case 42:case 43:break;case 31:case 32:var h=i0(x);return T0(x),[0,r,[32,[0,e===32?1:0,x0([0,h],[0,q0(x)],O)]]];default:break x}else switch(e[0]){case 2:var T=e[1],b=T[3],N=T[2],C=T[1];T[4]&&Ne(x,77);var I=i0(x);return T0(x),[0,C,[29,[0,N,b,x0([0,I],[0,q0(x)],O)]]];case 4:var F=e[3];if(P(F,Ks)){if(P(F,Ho)){if(!P(F,T3))break r}else if(x[28][1]){var M=rr(1,x);e:if(typeof M=="number"){if(M!==4&&M!==99)break e;var Y=G0(x);T0(x);var q=re(x,Rv(x));return bh(0,x,Y,q,_h(x))}var K=Th(x);return[0,K[1],[19,K[2]]]}}else if(x[28][1])return r0(0,function(n0){var s0=i0(n0);bs(n0,qa0);var l0=re(n0,Rv(n0)),w0=fX(n0);if(sj(n0))var I0=aj(n0,_j(n0)),j0=w0;else var L0=_j(n0),I0=L0,j0=p(D2(n0)[2],w0,function(S0,W0){return p(Xx(S0,420776873,12),S0,W0)});return[13,[0,l0,j0,I0,x0([0,s0],0,O)]]},x);break;case 7:if(P(e[1],Xl))break x;return Ux(x,85),[0,r,Ba0];case 12:var u0=e[3],Q=e[2],e0=e[1],f0=0;return r0(0,function(n0){return qU(f0,e0,Q,u0,n0)},x);case 13:var a0=e[3],Z=e[2],v0=0;return r0(0,function(n0){return BU(v0,Z,a0,n0)},x);default:break x}var t0=Th(x);return[0,t0[1],[19,t0[2]]]}return r0(0,function(n0){return[26,iX(n0)]},x)}var y0=xT0(x);return y0?[0,r,y0[1]]:(p2(Ua0,x),[0,r,Xa0])}function Zb0(x){var r=i0(x);T0(x);var e=L(x);if(typeof e!="number")switch(e[0]){case 12:return qU([0,r],e[1],e[2],e[3],x);case 13:return BU([0,r],e[2],e[3],x)}return p2(Ya0,x),za0}function dj(x,r){var e=i0(x),t=r0(0,T0,x)[1],u=x0([0,e],[0,q0(x)],O);return[0,[19,[0,[0,gn(0,[0,t,r])],0,u]]]}function xT0(x){var r=i0(x),e=L(x);if(typeof e=="number")switch(e){case 30:return T0(x),[0,[4,x0([0,r],[0,q0(x)],O)]];case 115:return T0(x),[0,[0,x0([0,r],[0,q0(x)],O)]];case 116:return T0(x),[0,[1,x0([0,r],[0,q0(x)],O)]];case 117:return T0(x),[0,[2,x0([0,r],[0,q0(x)],O)]];case 118:return T0(x),[0,[5,x0([0,r],[0,q0(x)],O)]];case 119:return T0(x),[0,[6,x0([0,r],[0,q0(x)],O)]];case 120:return T0(x),[0,[7,x0([0,r],[0,q0(x)],O)]];case 121:return T0(x),[0,[3,x0([0,r],[0,q0(x)],O)]];case 122:return T0(x),[0,[9,x0([0,r],[0,q0(x)],O)]];case 123:return T0(x),[0,[33,x0([0,r],[0,q0(x)],O)]];case 124:return T0(x),[0,[34,x0([0,r],[0,q0(x)],O)]];case 125:return T0(x),[0,[35,x0([0,r],[0,q0(x)],O)]];case 129:return dj(x,Ka0);case 130:return dj(x,Ja0);case 131:return dj(x,Ga0)}else if(e[0]===11){var t=e[1];T0(x);var u=q0(x),i=t?-883944824:737456202;return[0,[8,i,x0([0,r],[0,u],O)]]}return 0}function iX(x){var r=i0(x),e=L(x);x:{if(typeof e=="number")switch(e){case 132:var t=1;break x;case 133:var t=2;break x}else if(e[0]===4&&!P(e[3],T3)){var t=0;break x}var t=bx(Wa0)}var u=G0(x);T0(x);var i=q0(x),c=mj(x);return[0,u,c,x0([0,r],[0,i],O),t]}function wh(x,r){return[0,r[1],[0,0,r,0]]}function so(x){return p(KU[1],x,0)}function _h(x){return r0(0,function(r){var e=i0(r);J(r,4);var t=d(so(r),0),u=i0(r);J(r,5);var i=j2([0,e],[0,q0(r)],u,O);return[0,t[1],t[2],t[3],i]},x)}function fX(x){return r0(0,function(r){var e=i0(r);J(r,4);var t=p(JU[1],r,0),u=i0(r);J(r,5);var i=j2([0,e],[0,q0(r)],u,O);return[0,t[1],t[2],i]},x)}function rT0(x){var r=i0(x);J(x,4);var e=Nv(0,x),t=L(e);x:{r:{e:{if(typeof t!="number"){if(t[0]!==4)break r;var u=t[3];if(P(u,Ks)){if(P(u,T3))break e;var i=rr(1,e);t:{if(typeof i=="number"&&1>=i+Vs>>>0){var c=[0,d(so(e),0)];break t}var c=[1,Zr(e)]}var v=c}else{if(!e[28][1])break e;var a=rr(1,e);t:{n:if(typeof a=="number"){if(a!==4&&a!==99)break n;var l=[1,Zr(e)];break t}var l=cX(e)}var v=l}var C=v;break x}switch(t){case 5:var C=Va0;break x;case 132:var m=rr(1,e);t:{if(typeof m=="number"&&m===87){var h=[0,d(so(e),0)];break t}var h=[1,Zr(e)]}var C=h;break x;case 43:break;case 12:case 114:var C=[0,d(so(e),0)];break x;default:break r}}var C=cX(e);break x}r:{e:{if(typeof t=="number")switch(t){case 30:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:break;default:break e}else if(t[0]!==11)break e;var T=1;break r}var T=0}if(T){var b=rr(1,e);r:{if(typeof b=="number"&&1>=b+Vs>>>0){var N=[0,d(so(e),0)];break r}var N=[1,Zr(e)]}var C=N}else var C=[1,Zr(e)]}if(C[0]===0)var I=C;else{var F=C[1];if(x[15])var M=C;else{var Y=L(x);x:{if(typeof Y=="number"){if(Y===5){if(rr(1,x)===11){var q=[0,wh(x,F),0],u0=[0,d(so(x),q)];break x}var u0=[1,F];break x}if(Y===9){J(x,9);var K=[0,wh(x,F),0],u0=[0,d(so(x),K)];break x}}var u0=C}var M=u0}var I=M}var Q=i0(x);J(x,5);var e0=q0(x);if(I[0]===0)var f0=I[1],a0=j2([0,r],[0,e0],Q,O),Z=[0,[0,f0[1],f0[2],f0[3],a0]];else var Z=[1,eT0(I[1],r,e0)];return Z}function cX(x){var r=rr(1,x);if(typeof r=="number"&&1>=r+Vs>>>0)return[0,d(so(x),0)];var e=G0(x),t=vX(x,Fv(x)),u=ZU(x,0,e,rX(x,0,e,tX(x,nX(0,x,e,[0,t[1],[19,t[2]]]))));return[1,HU(tj(0,x),e,u)]}function bh(x,r,e,t,u){return r0([0,e],function(i){return J(i,11),[12,[0,t,u,sX(i),0,x]]},r)}function sX(x){return hh(x)?[1,yj(x)]:[0,Zr(x)]}function yj(x){function r(e){var t=i0(e);J(e,Ko);var u=Lx(t,i0(e));return[0,[0,Zr(e)],u]}return r0(0,function(e){var t=i0(e),u=$r(e,w6)?1:$r(e,u6)?2:0;V2(e,0);var i=a1(e);H2(e);x:if(u===2)var c=r(e),v=c[2],a=c[1];else{var l=L(e);if(typeof l=="number"&&Ko===l){var m=r(e),v=m[2],a=m[1];break x}var v=0,a=0}return[0,u,[0,i,a],j2([0,t],0,v,O)]},x)}function aX(x,r){return r0([0,r],yj,x)}function gj(x,r,e,t){var u=r&&(L(t)===2?1:0),i=r&&1-u;return r0(0,function(c){var v=i0(c),a=u?2:0;J(c,a);var l=Nv(0,c),m=N6(GU[1],x,i,e,u,l,$a0),h=m[3],T=m[2],b=m[1],N=Lx(h,i0(c)),C=u?3:1;return J(c,C),[0,u,T,b,j2([0,v],[0,q0(c)],N,O)]},t)}function oX(x){var r=$r(x,42)?CU(x,p(WU[1],x,0)):0;return[0,r,gj(0,0,0,x)]}function Fv(x){var r=a1(x),e=r[2],t=e[1],u=r[1],i=e[2];return ij(t)&&B0(x,[0,u,97]),[0,u,[0,t,i]]}function Rv(x){if(L(x)!==99)return 0;1-S2(x)&&Ux(x,F1);var r=r0(0,function(t){var u=i0(t);J(t,99);var i=Q0(VU[1],t,0,0),c=i0(t);return vh(t,y2),[0,i,j2([0,u],[0,q0(t)],c,O)]},x),e=r[1];return r[2][1]||B0(x,[0,e,52]),[0,r]}function wj(x){return L(x)===99?[0,r0(0,function(r){var e=i0(r);J(r,99);var t=Nv(0,r),u=p($U[1],t,0),i=i0(t);return J(t,y2),[0,u,j2([0,e],[0,q0(t)],i,O)]},x)]:0}function Th(x){return vX(x,Fv(x))}function vX(x,r){return r0([0,r[1]],function(e){var t=p(QU[1],e,[0,r[1],[0,r]])[2],u=L(e)===99?p(D2(e)[2],t,function(i,c){return p(Xx(i,-860373976,65),i,c)}):t;return[0,u,wj(e),0]},x)}function _j(x){var r=L(x);x:{if(typeof r=="number")switch(r){case 87:var e=G0(x);1-S2(x)&&Ux(x,F1),T0(x);var t=r0(0,Zr,x),u=t[2],i=t[1],c=u[2][0]===26?1:0;return B0(x,[0,e,[16,c]]),[1,i,[0,e,u,0,0]];case 132:case 133:break;default:break x}else if(r[0]!==4||P(r[3],T3))break x;1-S2(x)&&Ux(x,F1);var v=r0([0,G0(x)],iX,x);return[1,v[1],v[2]]}return[0,pa(x)]}function eT0(x,r,e){var t=x[2];function u(h0){return A1(h0,x0([0,r],[0,e],O))}var i=x[1];switch(t[0]){case 0:var B=[0,u(t[1])];break;case 1:var B=[1,u(t[1])];break;case 2:var B=[2,u(t[1])];break;case 3:var B=[3,u(t[1])];break;case 4:var B=[4,u(t[1])];break;case 5:var B=[5,u(t[1])];break;case 6:var B=[6,u(t[1])];break;case 7:var B=[7,u(t[1])];break;case 8:var c=u(t[2]),B=[8,t[1],c];break;case 9:var B=[9,u(t[1])];break;case 10:var B=[10,u(t[1])];break;case 11:var v=t[1],a=u(v[2]),B=[11,[0,v[1],a]];break;case 12:var l=t[1],m=l[5],h=u(l[4]),B=[12,[0,l[1],l[2],l[3],h,m]];break;case 13:var T=t[1],b=u(T[4]),B=[13,[0,T[1],T[2],T[3],b]];break;case 14:var N=t[1],C=N[4],I=j5(C,x0([0,r],[0,e],O)),B=[14,[0,N[1],N[2],N[3],I]];break;case 15:var F=t[1],M=u(F[3]),B=[15,[0,F[1],F[2],M]];break;case 16:var Y=t[1],q=u(Y[2]),B=[16,[0,Y[1],q]];break;case 17:var K=t[1],u0=u(K[5]),B=[17,[0,K[1],K[2],K[3],K[4],u0]];break;case 18:var Q=t[1],e0=u(Q[2]),B=[18,[0,Q[1],e0]];break;case 19:var f0=t[1],a0=u(f0[3]),B=[19,[0,f0[1],f0[2],a0]];break;case 20:var Z=t[1],v0=u(Z[3]),B=[20,[0,Z[1],Z[2],v0]];break;case 21:var t0=t[1],y0=t0[1],n0=t0[2],s0=u(y0[3]),B=[21,[0,[0,y0[1],y0[2],s0],n0]];break;case 22:var l0=t[1],w0=u(l0[2]),B=[22,[0,l0[1],w0]];break;case 23:var L0=t[1],I0=u(L0[2]),B=[23,[0,L0[1],I0]];break;case 24:var j0=t[1],S0=u(j0[3]),B=[24,[0,j0[1],j0[2],S0]];break;case 25:var W0=t[1],A0=u(W0[2]),B=[25,[0,W0[1],A0]];break;case 26:var J0=t[1],b0=J0[4],z=u(J0[3]),B=[26,[0,J0[1],J0[2],z,b0]];break;case 27:var C0=t[1],V0=u(C0[2]),B=[27,[0,C0[1],V0]];break;case 28:var N0=t[1],rx=u(N0[3]),B=[28,[0,N0[1],N0[2],rx]];break;case 29:var xx=t[1],nx=u(xx[3]),B=[29,[0,xx[1],xx[2],nx]];break;case 30:var mx=t[1],F0=u(mx[3]),B=[30,[0,mx[1],mx[2],F0]];break;case 31:var px=t[1],dx=u(px[3]),B=[31,[0,px[1],px[2],dx]];break;case 32:var W=t[1],g0=u(W[2]),B=[32,[0,W[1],g0]];break;case 33:var B=[33,u(t[1])];break;case 34:var B=[34,u(t[1])];break;default:var B=[35,u(t[1])]}return[0,i,B]}Rr(UU,[0,function(x,r,e){for(var t=r;;){if(!$r(e,90)){var u=tx(t);if(u){var i=u[2];if(i){var c=i[2],v=i[1],a=u[1];return[22,[0,[0,a,v,c],x0([0,x],0,O)]]}}throw K0([0,Ir,so0],1)}var t=[0,xX(e),t]}}]),Rr(XU,[0,function(x,r,e){for(var t=r;;){if(!$r(e,92)){var u=tx(t);if(u){var i=u[2];if(i){var c=i[2],v=i[1],a=u[1];return[23,[0,[0,a,v,c],x0([0,x],0,O)]]}}throw K0([0,Ir,co0],1)}var t=[0,eX(e),t]}}]),Rr(YU,[0,function(x,r){for(var e=r;;){var t=e[2],u=e[1];if(L(x)===10&&TU(1,x)){let v=t;var i=r0([0,u],function(l){return J(l,10),[0,v,a1(l)]},x),c=i[1],e=[0,c,[1,[0,c,i[2]]]];continue}return t}}]),Rr(zU,[0,function(x,r){for(var e=r;;){var t=L(x);x:if(typeof t=="number"){if(t!==7&&kr!==t)break x;return[0,tx(e),0]}var u=r0(0,function(l){if(!$r(l,12)){var m=L(l);x:{if(typeof m=="number"&&(ft===m||Pt===m&&ka(1,l))){var h=gh(0,0,l);break x}var h=0}var T=_n(l),b=rr(1,l);if(T&&typeof b=="number"&&1>=b+Vs>>>0){var N=a1(l),C=$r(l,86);return J(l,87),[0,[1,[0,N,Zr(l),h,C]]]}return GM(h)&&Ux(l,44),[0,[0,Zr(l)]]}var I=L(l);x:if(typeof I=="number"){if(10<=I){if(kr!==I)break x}else{if(7>I)break x;switch(I-7|0){case 0:break;case 1:break x;default:return p2(fo0,l),T0(l),0}}return 0}var F=_n(l),M=rr(1,l);x:{if(F&&typeof M=="number"&&1>=M+Vs>>>0){var Y=a1(l);L(l)===86&&(Ux(l,43),T0(l)),J(l,87);var q=[0,Y];break x}var q=0}return[0,[2,[0,q,Zr(l)]]]},x),i=u[2],c=u[1];if(!i)return[0,tx(e),1];var v=[0,[0,c,i[1]],e];L(x)!==7&&J(x,9);var e=v}}]);function lX(x){var r=rr(1,x);return typeof r=="number"&&1>=r+Vs>>>0?r0(0,function(e){V2(e,0);var t=p(X0[13],0,e);H2(e),1-S2(e)&&Ux(e,F1);var u=$r(e,86);return J(e,87),[0,[0,t],Zr(e),u]},x):wh(x,Zr(x))}Rr(KU,[0,function(x,r,e){for(var t=r,u=e;;){var i=L(x);x:if(typeof i=="number")switch(i){case 5:case 12:case 114:var c=i===12?[0,r0(0,function(T){var b=i0(T);J(T,12);var N=x0([0,b],0,O);return[0,lX(T),N]},x)]:0;return[0,t,tx(u),c,0]}else if(i[0]===4&&!P(i[3],xv)){if(rr(1,x)!==87&&rr(1,x)!==86)break x;var v=t!==0?1:0,a=v||(u!==0?1:0);a&&Ux(x,90);var l=r0(0,function(b){var N=i0(b);T0(b),L(b)===86&&Ux(b,89);var C=x0([0,N],0,O);return[0,o4(b),C]},x);L(x)!==5&&J(x,9);var t=[0,l];continue}var m=[0,lX(x),u];L(x)!==5&&J(x,9);var u=m}}]),Rr(JU,[0,function(x,r){for(var e=r;;){var t=L(x);x:if(typeof t=="number"){var u=t-5|0;if(7>>0){if(Vn!==u)break x}else if(5>=u-1>>>0)break x;var i=t===12?[0,r0(0,function(a){var l=i0(a);J(a,12);var m=rr(1,a);r:{if(typeof m=="number"){if(m===86){V2(a,0);var h=p(X0[13],0,a);H2(a),J(a,86),J(a,87);var b=1,N=[0,h];break r}if(m===87){V2(a,0);var T=p(X0[13],0,a);H2(a),J(a,87);var b=0,N=[0,T];break r}}var b=0,N=0}var C=Zr(a);return L(a)===9&&T0(a),[0,N,C,b,x0([0,l],0,O)]},x)]:0;return[0,tx(e),i,0]}var c=[0,r0(0,function(a){var l=L(a);x:{if(typeof l!="number"&&l[0]===2){var m=l[1],h=m[4],T=m[3],b=m[2],N=m[1];h&&Ne(a,77),J(a,[2,[0,N,b,T,h]]);var I=[1,[0,N,[0,b,T,x0(0,[0,q0(a)],O)]]];break x}V2(a,0);var C=p(X0[13],0,a);H2(a);var I=[0,C]}var F=$r(a,86);return[0,I,o4(a),F]},x),e];L(x)!==5&&J(x,9);var e=c}}]);function Eh(x,r,e){return r0([0,r],function(t){var u=_h(t);return J(t,87),[0,e,u,sX(t),0,1]},x)}function pX(x,r,e,t,u){var i=Tn(x,t),c=Eh(x,r,re(x,Rv(x))),v=[0,c[1],[12,c[2]]],a=[0,i,[0,v],0,e!==0?1:0,0,1,0,x0([0,u],0,O)];return[0,[0,v[1],a]]}function Sh(x,r,e,t,u,i,c){var v=c[2],a=c[1];return 1-S2(x)&&Ux(x,F1),[0,r0([0,r],function(l){var m=$r(l,86),h=AU(l,87)?Zr(l):[0,a,io0];return[0,v,[0,h],m,t!==0?1:0,u!==0?1:0,0,e,x0([0,i],0,O)]},x)]}function v4(x,r){var e=L(r);if(typeof e=="number"&&10>e)switch(e){case 1:if(!x)return;break;case 3:if(x)return;break;case 8:case 9:return T0(r)}return bn(r,9)}function l4(x,r){if(r)return B0(x,[0,r[1][1],Hs])}function p4(x,r){if(r)return B0(x,[0,r[1],95])}function tT0(x,r,e,t,u,i,c,v,a){for(var l=e,m=t,h=u,T=i,b=c,N=v;;){var C=L(x);if(typeof C=="number")switch(C){case 6:p4(x,b);var I=rr(1,x);if(typeof I=="number"&&I===6)return l4(x,h),[4,r0([0,a],function(b0){var z=Lx(N,i0(b0));J(b0,6),J(b0,6);var C0=a1(b0);J(b0,7),J(b0,7);var V0=L(b0);x:{r:if(typeof V0=="number"){if(V0!==4&&V0!==99)break r;var N0=Eh(b0,a,re(b0,Rv(b0))),nx=0,mx=[0,N0[1],[12,N0[2]]],F0=1,px=0;break x}var rx=$r(b0,86),xx=q0(b0);J(b0,87);var nx=xx,mx=Zr(b0),F0=0,px=rx}return[0,C0,mx,px,T!==0?1:0,F0,x0([0,z],[0,nx],O)]},x)];var F=Lx(N,i0(x));J(x,6);var M=rr(1,x);return typeof M!="number"&&M[0]===4&&!P(M[3],Ra)&&T===0?[5,r0([0,a],function(b0){var z=Fv(b0),C0=z[1];T0(b0);var V0=Zr(b0);J(b0,7);var N0=L(b0);x:{r:{var rx=[0,z,[0,C0],0,0,0,0];if(typeof N0=="number"){var xx=N0+U9|0;if(1>>0){if(xx!==-18)break r;T0(b0);var nx=2}else var nx=xx?(T0(b0),J(b0,86),1):(T0(b0),J(b0,86),0);var mx=nx;break x}}var mx=3}J(b0,87);var F0=Zr(b0);return[0,[0,C0,rx],F0,V0,h,mx,x0([0,F],[0,q0(b0)],O)]},x)]:[2,r0([0,a],function(b0){if(rr(1,b0)===87){var z=a1(b0);J(b0,87);var C0=[0,z]}else var C0=0;var V0=Zr(b0);J(b0,7);var N0=q0(b0);J(b0,87);var rx=Zr(b0);return[0,C0,V0,rx,T!==0?1:0,h,x0([0,F],[0,N0],O)]},x)];case 43:if(l){if(h!==0)throw K0([0,Ir,xo0],1);var Y=[0,G0(x)],q=Lx(N,i0(x));T0(x);var l=0,m=0,T=Y,N=q;continue}break;case 127:if(h===0){if(!ka(1,x)&&rr(1,x)!==6)break;var l=0,m=0,h=gh(ro0,0,x);continue}break;case 104:case 105:if(h===0){var l=0,m=0,h=gh(0,0,x);continue}break;case 4:case 99:return p4(x,b),l4(x,h),[3,r0([0,a],function(b0){var z=G0(b0),C0=Eh(b0,z,re(b0,Rv(b0)));return[0,C0,T!==0?1:0,x0([0,N],0,O)]},x)]}else if(C[0]===4&&!P(C[3],yg)&&m){if(h!==0)throw K0([0,Ir,eo0],1);var K=[0,G0(x)],u0=Lx(N,i0(x));T0(x);var l=0,m=0,b=K,N=u0;continue}if(T){var Q=T[1];if(b)return bx(to0);if(typeof C=="number"&&1>=C+Vs>>>0)return Sh(x,a,h,0,b,0,[0,Q,[3,gn(x0([0,N],0,O),[0,Q,no0])]])}else if(b){var e0=b[1];if(typeof C=="number"&&1>=C+Vs>>>0)return Sh(x,a,h,T,0,0,[0,e0,[3,gn(x0([0,N],0,O),[0,e0,uo0])]])}var f0=function(b0){V2(b0,0);var z=p(X0[20],0,b0);return H2(b0),z},a0=i0(x),Z=f0(x),v0=Z[1],t0=Z[2];x:if(t0[0]===3){var y0=t0[1][2][1];if(P(y0,zo)&&P(y0,S3))break x;var n0=L(x);if(typeof n0=="number"){var s0=n0-5|0;if(93>>0){if(95>=s0+1>>>0)return p4(x,b),l4(x,h),pX(x,a,T,t0,N)}else if(1>=s0-81>>>0)return Sh(x,a,h,T,b,N,[0,v0,t0])}Tn(x,t0);var l0=f0(x),w0=_r(y0,zo),L0=Lx(N,a0);return p4(x,b),l4(x,h),[0,r0([0,a],function(b0){var z=l0[1],C0=Tn(b0,l0[2]),V0=Eh(b0,a,0),N0=V0[2][2];r:if(w0){var rx=N0[2];e:{if(!rx[1]){if(!rx[2]&&!rx[3])break e;B0(b0,[0,z,23]);break r}B0(b0,[0,z,24])}}else{var xx=N0[2];if(xx[1])B0(b0,[0,z,67]);else{var nx=xx[2];e:{if(!xx[3]){if(nx&&!nx[2])break e;B0(b0,[0,z,66]);break r}B0(b0,[0,z,66])}}}var mx=x0([0,L0],0,O),F0=0,px=0,dx=0,W=T!==0?1:0,g0=0,B=w0?[1,V0]:[2,V0];return[0,C0,B,g0,W,dx,px,F0,mx]},x)]}var I0=Z[2],j0=L(x);x:if(typeof j0=="number"){if(j0!==4&&j0!==99)break x;return p4(x,b),l4(x,h),pX(x,a,T,I0,N)}var S0=T!==0?1:0;x:if(I0[0]===3){var W0=I0[1],A0=W0[2][1];r:{var J0=W0[1];if(r){if(!_r(Mo,A0)&&(!S0||!_r(Xa,A0)))break r;B0(x,[0,J0,[15,A0,S0,0,0]]);break x}}}return Sh(x,a,h,T,b,N,[0,v0,I0])}}Rr(GU,[0,function(x,r,e,t,u,i){for(var c=i;;){var v=c[3],a=c[2],l=c[1];if(x&&e)throw K0([0,Ir,Ha0],1);if(r&&!e)throw K0([0,Ir,Za0],1);var m=G0(u),h=L(u);if(typeof h=="number"){if(13<=h){if(kr===h)return[0,tx(l),a,v]}else if(h)switch(h-1|0){case 0:if(!t)return[0,tx(l),a,v];break;case 2:if(t)return[0,tx(l),a,v];break;case 11:if(!e){T0(u);var T=L(u);if(typeof T=="number"&&10>T)switch(T){case 1:case 3:case 8:case 9:B0(u,[0,m,32]),v4(t,u);continue}var b=fj(u);uj(u)(b),B0(u,[0,m,98]),T0(u),v4(t,u);continue}var N=i0(u);T0(u);var C=L(u);if(typeof C=="number"&&10>C)switch(C){case 1:case 3:case 8:case 9:v4(t,u);var I=L(u);if(typeof I=="number"){var F=I-1|0;if(2>=F>>>0)switch(F){case 0:if(r)return[0,tx(l),1,N];break;case 1:break;default:return B0(u,[0,m,31]),[0,tx(l),a,v]}}B0(u,[0,m,93]);continue}let K=N;var M=[1,r0([0,m],function(Q){var e0=x0([0,K],0,O);return[0,Zr(Q),e0]},u)];v4(t,u);var c=[0,[0,M,l],a,v];continue}}var Y=tT0(u,x,x,x,0,0,0,0,m);v4(t,u);var c=[0,[0,Y,l],a,v]}}]),Rr(WU,[0,function(x,r){for(var e=r;;){var t=[0,Th(x),e],u=L(x);if(typeof u=="number"&&u===9){J(x,9);var e=t;continue}return tx(t)}}]);function kX(x,r){var e=wU(x,r);if(e)var t=e;else{x:{if(typeof r=="number"&&1>=r+U9>>>0){var u=1;break x}var u=0}if(!u){x:{if(typeof r=="number")switch(r){case 15:case 28:case 30:case 31:case 32:case 42:case 43:case 47:case 54:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:break;default:break x}else switch(r[0]){case 4:if(ij(r[3]))return 1;break x;case 11:break;default:break x}return 1}return 0}var t=u}return t}Rr(VU,[0,function(x,r,e){for(var t=r,u=e;;){if(kX(x,L(x))){let b=t;var i=oj(0,function(I){var F=L(I);x:{if(typeof F=="number"&&F===28){var M=[0,r0(0,function(y0){var n0=i0(y0);return T0(y0),x0([0,n0],0,O)},I)];break x}var M=0}var Y=gh(0,Qa0,I),q=r0(0,function(t0){var y0=Fv(t0),n0=L(t0);x:{if(typeof n0=="number"){if(n0===42){var s0=1,l0=[1,r0(0,function(I0){return T0(I0),Zr(I0)},t0)];break x}if(n0===87){var s0=0,l0=[1,o4(t0)];break x}}var s0=0,l0=[0,pa(t0)]}return[0,y0,l0,s0]},I),K=q[2],u0=K[3],Q=K[2],e0=K[1],f0=q[1],a0=L(I);x:{if(typeof a0=="number"&&a0===83){T0(I);var Z=1,v0=[0,Zr(I)];break x}b&&B0(I,[0,f0,53]);var Z=b,v0=0}return[0,[0,e0,Q,u0,Y,v0,M],Z]},x),c=i[2],v=[0,i[1],u]}else var c=t,v=u;var a=L(x);if(typeof a=="number"){var l=a+B9|0;if(14>>0){if(l===-91){T0(x);var t=c,u=v;continue}}else if(12>>0)return tx(v)}x:{r:{e:{if(typeof a!="number"){if(a[0]!==4)break r;var m=a[3];if(!ch(m)){t:{if(P(m,fv)&&P(m,z1)){var h=0;break t}var h=1}if(!h){if(P(m,r6)){if(!P(m,vv))break e;if(P(m,Yf))break r;break e}if(!x[28][2])break r;var T=1;break x}}var T=1;break x}switch(a){case 4:case 83:break;default:break r}}var T=1;break x}var T=0}if(T)return bn(x,y2),tx(v);if(kX(x,a)){bn(x,9);var t=c,u=v}else{J(x,9);var t=c,u=v}}}]),Rr($U,[0,function(x,r){for(var e=r;;){var t=L(x);x:if(typeof t=="number"){if(y2!==t&&kr!==t)break x;return tx(e)}var u=[0,Zr(x),e];y2!==L(x)&&J(x,9);var e=u}}]),Rr(QU,[0,function(x,r){for(var e=r;;){var t=e[2],u=e[1];if(L(x)===10&&sh(1,x)){let v=t;var i=r0([0,u],function(l){return J(l,10),[0,v,Fv(l)]},x),c=i[1],e=[0,c,[1,[0,c,i[2]]]];continue}return[0,u,t]}}]);function mX(x,r){if(L(x)!==4)return[0,0,x0([0,r],[0,q0(x)],O)];var e=Lx(r,i0(x));J(x,4),V2(x,0);var t=d(X0[9],x);return H2(x),J(x,5),[0,[0,t],x0([0,e],[0,q0(x)],O)]}function nT0(x){var r=L(x);if(typeof r=="number"&&r===87){1-S2(x)&&Ux(x,F1);var e=G0(x);return J(x,87),hh(x)?[2,aX(x,e)]:[1,r0([0,e],Zr,x)]}return[0,pa(x)]}function uT0(x){var r=L(x);return typeof r=="number"&&r===87?[1,o4(x)]:[0,pa(x)]}function iT0(x){var r=i0(x);return J(x,67),mX(x,r)}var fT0=0;function hX(x){var r=Nv(0,x),e=L(r);return typeof e=="number"&&e===67?[0,r0(fT0,iT0,r)]:0}function cT0(x){var r=L(x);if(typeof r=="number"&&r===87){1-S2(x)&&Ux(x,F1);var e=pa(x),t=G0(x);J(x,87);var u=L(x);if(typeof u=="number"&&u===67)return[0,[0,e],[0,r0([0,t],function(v){var a=i0(v);return J(v,67),mX(v,a)},Nv(0,x))]];if(hh(x))return[0,[2,aX(x,t)],0];var i=[1,r0([0,t],Zr,x)],c=L(x)===67?vl(x,i):i;return[0,c,hX(x)]}return[0,[0,pa(x)],0]}function Ce(x,r){var e=la(1,r);V2(e,1);var t=x(e);return H2(e),t}function ma(x){return Ce(Zr,x)}function Ts(x){return Ce(Fv,x)}function $e(x){return Ce(Rv,x)}function dX(x){return Ce(wj,x)}function Lv(x){return Ce(o4,x)}function bj(x){return Ce(uT0,x)}function Tj(x){return Ce(nT0,x)}function Ej(x){return Ce(cT0,x)}function yX(x){return Ce(Th,x)}function Sj(x){return Ce(_j,x)}function ao(x,r){var e=r[2],t=r[1],u=x[1];switch(e[0]){case 0:return m1(sT0,x,e[1][1]);case 1:return m1(aT0,x,e[1][1]);case 2:var i=e[1][1],c=i[2][1],v=x[2],a=x[1],l=i[1];N1[3].call(null,c,v)&&B0(a,[0,l,78]);var m=i[2][1],h=i[1];return Cv(m)&&pt(a,[0,h,79]),sl(m)&&pt(a,[0,h,81]),[0,a,N1[4].call(null,c,v)];default:return B0(u,[0,t,20]),x}}function sT0(x){return function(r){return r[0]===0?ao(x,r[1][2][2]):ao(x,r[1][2][1])}}function aT0(x){return function(r){switch(r[0]){case 0:return ao(x,r[1][2][1]);case 1:return ao(x,r[1][2][1]);default:return x}}}function gX(x,r){var e=r[2],t=e[3],u=m1(function(i,c){return ao(i,c[2][1])},[0,x,N1[1]],e[2]);t&&ao(u,t[1][2][1])}function wX(x,r,e,t){var u=x[5],i=t[0]===0?Dv(t[1]):0,c=la(u?0:r,x),v=r||u||1-i;if(!v)return v;if(e){var a=e[1],l=a[2][1],m=a[1];Cv(l)&&pt(c,[0,m,71]),sl(l)&&pt(c,[0,m,81])}if(t[0]===0)return gX(c,t[1]);var h=t[1][2],T=h[2],b=[0,K3,[0,[0,dn(function(C){var I=C[2],F=I[1],M=I[4],Y=I[3],q=I[2],K=F[0]===0?[3,F[1]]:[0,[0,K3,F[1][2]]];return[0,[0,K3,[0,K,q,Y,M]]]},h[1]),[0,K3],0]]],N=ao([0,c,N1[1]],b);T&&ao(N,T[1][2][1])}function kl(x,r,e,t){return wX(x,r,e,[0,t])}function _X(x,r){if(r!==12)return 0;var e=i0(x),t=r0(0,function(c){return J(c,12),p(X0[18],c,79)},x),u=t[2],i=t[1];return[0,[0,i,u,x0([0,e],0,O)]]}function oT0(x){L(x)===22&&Ux(x,90);var r=p(X0[18],x,79),e=L(x)===83?(J(x,83),[0,d(X0[10],x)]):0;return[0,r,e]}var vT0=0;function ml(x,r){function e(u){var i=pU(1,xj(r,rj(x,u))),c=i0(i);J(i,4);x:{if(S2(i)&&L(i)===22){var v=i0(i),a=r0(0,function(K){return J(K,22),L(K)===87?[0,Lv(K)]:(Ux(K,86),0)},i),l=a[2],m=a[1];if(!l){var T=0;break x}var h=l[1];L(i)===9&&T0(i);var T=[0,[0,m,[0,h,x0([0,v],0,O)]]];break x}var T=0}x:r:{for(var b=0;;){var N=L(i);if(typeof N=="number"){var C=N-5|0;if(7>>0){if(Vn===C)break}else if(5>>0)break r}var I=r0(vT0,oT0,i);L(i)!==5&&J(i,9);var b=[0,I,b]}break x}var F=l5(function(q){return[0,q[1],[0,q[2],q[3]]]},_X(i,N));L(i)!==5&&Ux(i,62);var M=tx(b),Y=i0(i);return J(i,5),[0,T,M,F,j2([0,c],[0,q0(i)],Y,O)]}var t=0;return function(u){return r0(t,e,u)}}function bX(x,r,e,t,u){var i=gU(x,r,e,u);return p(X0[16],t,i)}function k4(x,r,e,t,u){var i=bX(x,r,e,t,u);return[0,[0,i[1]],i[2]]}function Mv(x){if(K2!==L(x))return Mv0;var r=i0(x);return T0(x),[0,1,r]}function Ah(x){if(L(x)===65&&!jv(1,x)){var r=i0(x);return T0(x),[0,1,r]}return Lv0}function lT0(x){var r=Ah(x),e=r[1],t=r[2],u=r0(0,function(F){var M=i0(F),Y=L(F);x:{if(typeof Y=="number"){if(Y===15){T0(F);var q=Mv(F),u0=q[2],Q=q[1],e0=1;break x}}else if(Y[0]===4&&!P(Y[3],Ho)&&!e){T0(F);var u0=0,Q=0,e0=0;break x}bn(F,Y);var K=Mv(F),u0=K[2],Q=K[1],e0=1}var f0=F6([0,t,[0,M,[0,u0,0]]]),a0=F[7],Z=L(F);x:{if(a0&&typeof Z=="number"){if(Z===4){var n0=0,s0=0;break x}if(Z===99){var v0=re(F,$e(F)),t0=L(F)===4?0:[0,Ut(F,p(X0[13],Ov0,F))],n0=t0,s0=v0;break x}}var y0=_n(F)?Ut(F,p(X0[13],Dv0,F)):(SU(F,Fv0),[0,G0(F),Rv0]),n0=[0,y0],s0=re(F,$e(F))}var l0=ml(e,Q)(F),w0=L(F)===87?l0:c4(F,l0),L0=Ej(F),I0=L0[2],j0=L0[1];if(I0)var S0=NU(F,I0),W0=j0;else var S0=I0,W0=vl(F,j0);return[0,Q,e0,s0,n0,w0,W0,S0,f0]},x),i=u[2],c=i[5],v=i[4],a=i[1],l=i[8],m=i[7],h=i[6],T=i[3],b=i[2],N=u[1],C=k4(x,e,a,0,Dv(c)),I=C[1];return kl(x,C[2],v,c),[27,[0,v,c,I,e,a,b,m,h,T,x0([0,l],0,O),N]]}var pT0=0;function m4(x){return r0(pT0,lT0,x)}function Aj(x,r){var e=i0(r);J(r,x);var t=r[28][2];if(t)var u=x===28?1:0,i=u&&(L(r)===49?1:0);else var i=t;i&&Ux(r,19);for(var c=0,v=0;;){var a=r0(0,function(I){var F=p(X0[18],I,82);if($r(I,83))var M=0,Y=[0,d(X0[10],I)];else{var q=F[1];if(F[2][0]===2)var M=0,Y=0;else var M=[0,[0,q,59]],Y=0}return[0,[0,F,Y],M]},r),l=a[2],m=l[2],h=[0,[0,a[1],l[1]],c],T=m?[0,m[1],v]:v;if(!$r(r,9)){var b=tx(T);return[0,tx(h),e,b]}var c=h,v=T}}var kT0=MU(X0),mT0=25;function TX(x){return Aj(mT0,x)}function EX(x){var r=Aj(28,ej(1,x)),e=r[1],t=r[2];return[0,e,t,tx(m1(function(u,i){return i[2][2]?u:[0,[0,i[1],58],u]},r[3],e))]}function SX(x){return Aj(29,ej(1,x))}function AX(x){function r(t){return[20,kT0[1].call(null,x,t)]}var e=0;return function(t){return r0(e,r,t)}}function hT0(x){var r=i0(x),e=L(x),t=rr(1,x);x:{r:if(typeof e!="number"&&e[0]===2){var u=e[1],i=u[4],c=u[3],v=u[2],a=u[1];e:{if(typeof t=="number")switch(t){case 86:case 87:break;default:break e}else{if(t[0]!==4)break e;if(P(t[3],It))break r}i&&Ne(x,77),J(x,[2,[0,a,v,c,i]]);var l=[1,[0,a,[0,v,c,x0([0,r],[0,q0(x)],O)]]];if(typeof t=="number"&&1>=t+Vs>>>0){var m=t===86?1:0;Ux(x,[17,m,v]),m&&T0(x);var h=G0(x),I=0,F=[0,h,[2,[0,[0,h,Nv0],bj(x),m]]],M=l;break x}T0(x);var I=0,F=p(X0[18],x,79),M=l;break x}}if(typeof t!="number"&&t[0]===4&&!P(t[3],It)){var T=[0,a1(x)];bs(x,Cv0);var I=0,F=p(X0[18],x,79),M=T;break x}if(typeof e=="number"&&!e){Ux(x,33);var b=[0,[0,G0(x),jv0]],I=0,F=p(X0[18],x,79),M=b;break x}var N=Q0(X0[14],x,0,79),C=N[2],I=1,F=[0,N[1],[2,C]],M=[0,C[1]]}var Y=L(x)===83?(J(x,83),[0,d(X0[10],x)]):0;return[0,M,F,Y,I]}var dT0=0;function yT0(x){var r=pU(1,x),e=i0(r);J(r,4);x:r:{for(var t=0;;){var u=L(r);if(typeof u=="number"){var i=u-5|0;if(7>>0){if(Vn===i)break}else if(5>>0)break r}var c=r0(dT0,hT0,r);L(r)!==5&&J(r,9);var t=[0,c,t]}break x}var v=l5(function(m){var h=m[3],T=m[2],b=m[1];return L(r)===9&&T0(r),[0,b,[0,T,h]]},_X(r,u));L(r)!==5&&Ux(r,62);var a=tx(t),l=i0(r);return J(r,5),[0,a,v,j2([0,e],[0,q0(r)],l,O)]}var gT0=0;function wT0(x){var r=r0(0,function(h){var T=i0(h);bs(h,Pv0);var b=Ut(h,p(X0[13],Iv0,h)),N=re(h,$e(h)),C=r0(gT0,yT0,h),I=sj(h)?C:p(D2(h)[2],C,function(F,M){return p(Xx(F,842685896,11),F,M)});return[0,N,b,I,aj(h,Sj(h)),T]},x),e=r[2],t=e[3],u=e[2],i=e[5],c=e[4],v=e[1],a=r[1],l=bX(x,0,0,0,0),m=l[1];return wX(x,l[2],[0,u],[1,t]),[3,[0,u,v,t,c,m,x0([0,i],0,O),a]]}var _T0=0;function Pj(x){return r0(_T0,wT0,x)}function y1(x,r){if(r[0]===0)return r[1];var e=r[1];return T1(function(t){return B0(x,t)},r[2][1]),e}function Ij(x,r,e){var t=x?x[1]:36;if(e[0]===0)var u=e[1];else{var i=e[1];T1(function(l){return B0(r,l)},e[2][2]);var u=i}1-d(X0[23],u)&&B0(r,[0,u[1],t]);var c=u[2];x:if(c[0]===10){var v=u[1];if(Cv(c[1][2][1])){pt(r,[0,v,72]);break x}}return p(X0[19],r,u)}function Nj(x,r){var e=G3(x[2],r[2]);return[0,G3(x[1],r[1]),e]}function PX(x){var r=tx(x[2]);return[0,tx(x[1]),r]}function Ph(x){var r=G0(x),e=IX(x),t=L(x);x:{if(typeof t=="number"&&t===90){var u=r0([0,r],function(l){for(var m=[0,e,0];;){var h=L(l);if(typeof h=="number"&&h===90){T0(l);var m=[0,IX(l),m];continue}var T=tx(m);return[0,T,x0(0,[0,q0(l)],O)]}},x),i=[0,u[1],[12,u[2]]];break x}var i=e}var c=L(x);if(typeof c!="number"&&c[0]===4&&!P(c[3],It)){var v=r0([0,r],function(a){T0(a);var l=L(a);x:{r:if(typeof l=="number"){var m=l+A3|0;if(4>=m>>>0){switch(m){case 0:var h=Xt(a,0),N=[1,h[1],h[2]];break;case 3:var T=Xt(a,2),N=[1,T[1],T[2]];break;case 4:var b=Xt(a,1),N=[1,b[1],b[2]];break;default:break r}var C=N;break x}}var C=[0,p(X0[13],0,a)]}return[0,i,C,x0(0,[0,q0(a)],O)]},x);return[0,v[1],[13,v[2]]]}return i}function IX(x){var r=L(x);if(typeof r=="number")switch(r){case 0:var e=function(m0){var Dx=G0(m0),Ex=i0(m0);function qx($){var ix=$[2],U0=$[1],cx=[2,[0,U0,ix[2][2]]];return[0,Dx,[0,cx,[0,U0,[7,ix]],1,x0([0,Ex],[0,q0(m0)],O)]]}var O0=L(m0);if(typeof O0=="number"){var Wx=O0+A3|0;if(4>=Wx>>>0)switch(Wx){case 0:return qx(Xt(m0,0));case 3:return qx(Xt(m0,2));case 4:return qx(Xt(m0,1))}}var Yx=i0(m0),fx=L(m0);x:{if(typeof fx!="number")switch(fx[0]){case 0:var Qx=fx[2],vx=fx[1],nr=G0(m0),gr=Q0(X0[24],m0,vx,Qx),jx=[1,[0,nr,[0,gr,Qx,x0([0,Yx],[0,q0(m0)],O)]]];break x;case 2:var Nr=fx[1],s2=Nr[4],b2=Nr[3],k2=Nr[2],F2=Nr[1];s2&&Ne(m0,77),J(m0,[2,[0,F2,k2,b2,s2]]);var jx=[0,[0,F2,[0,k2,b2,x0([0,Yx],[0,q0(m0)],O)]]];break x}var jx=[2,a1(m0)]}J(m0,87);var _=Ph(m0);return[0,Dx,[0,jx,_,0,x0([0,Ex],[0,q0(m0)],O)]]};return r0(0,function(m0){var Dx=i0(m0);J(m0,0);x:{for(var Ex=0;;){var qx=L(m0);if(typeof qx=="number"){var O0=qx-2|0;if(G1>>0){if(J1>=O0+1>>>0){var fx=[0,tx(Ex),0];break x}}else if(O0===10)break}var Wx=e(m0);1-(L(m0)===1?1:0)&&J(m0,9);var Ex=[0,Wx,Ex]}var Yx=CX(m0);L(m0)===9&&B0(m0,[0,G0(m0),Cl0]);var fx=[0,tx(Ex),[0,Yx]]}var Qx=fx[2],vx=fx[1],nr=i0(m0);return J(m0,1),[10,[0,vx,Qx,j2([0,Dx],[0,q0(m0)],nr,O)]]},x);case 4:var t=i0(x);J(x,4);var u=Ph(x);J(x,5);var i=q0(x),c=u[2],v=function(m0){return A1(m0,x0([0,t],[0,i],O))},a=function(m0){return j5(m0,x0([0,t],[0,i],O))},l=u[1];switch(c[0]){case 0:var S0=[0,v(c[1])];break;case 1:var m=c[1],h=v(m[3]),S0=[1,[0,m[1],m[2],h]];break;case 2:var T=c[1],b=v(T[3]),S0=[2,[0,T[1],T[2],b]];break;case 3:var N=c[1],C=v(N[3]),S0=[3,[0,N[1],N[2],C]];break;case 4:var I=c[1],F=v(I[2]),S0=[4,[0,I[1],F]];break;case 5:var S0=[5,v(c[1])];break;case 6:var M=c[1],Y=v(M[3]),S0=[6,[0,M[1],M[2],Y]];break;case 7:var q=c[1],K=v(q[3]),S0=[7,[0,q[1],q[2],K]];break;case 8:var u0=c[1],Q=u0[2],e0=u0[1],f0=v(Q[2]),S0=[8,[0,e0,[0,Q[1],f0]]];break;case 9:var a0=c[1],Z=a0[2],v0=a0[1],t0=v(Z[3]),S0=[9,[0,v0,[0,Z[1],Z[2],t0]]];break;case 10:var y0=c[1],n0=a(y0[3]),S0=[10,[0,y0[1],y0[2],n0]];break;case 11:var s0=c[1],l0=a(s0[3]),S0=[11,[0,s0[1],s0[2],l0]];break;case 12:var w0=c[1],L0=v(w0[2]),S0=[12,[0,w0[1],L0]];break;default:var I0=c[1],j0=v(I0[3]),S0=[13,[0,I0[1],I0[2],j0]]}return[0,l,S0];case 6:return r0(0,function(m0){var Dx=i0(m0),Ex=G0(m0);J(m0,6);x:{for(var qx=0;;){var O0=L(m0);if(typeof O0=="number"){var Wx=O0-8|0;if(Pt>>0){if(K2>=Wx+1>>>0){var vx=[0,tx(qx),0];break x}}else if(Wx===4)break}var Yx=Ph(m0),fx=Vr(Ex,G0(m0));L(m0)!==7&&J(m0,9);var qx=[0,[0,fx,Yx],qx]}var Qx=CX(m0);L(m0)===9&&B0(m0,[0,G0(m0),jl0]);var vx=[0,tx(qx),[0,Qx]]}var nr=vx[2],gr=vx[1],Nr=i0(m0);return J(m0,7),[11,[0,gr,nr,j2([0,Dx],[0,q0(m0)],Nr,O)]]},x);case 25:var W0=Xt(x,0);return[0,W0[1],[7,W0[2]]];case 28:var A0=Xt(x,2);return[0,A0[1],[7,A0[2]]];case 29:var J0=Xt(x,1);return[0,J0[1],[7,J0[2]]];case 30:var b0=i0(x),z=G0(x);return T0(x),[0,z,[5,x0([0,b0],[0,q0(x)],O)]];case 104:return NX(x,0);case 105:return NX(x,1);case 31:case 32:var C0=i0(x),V0=G0(x);return T0(x),[0,V0,[4,[0,r===32?1:0,x0([0,C0],[0,q0(x)],O)]]]}else switch(r[0]){case 0:var N0=r[2],rx=r[1],xx=i0(x),nx=G0(x),mx=Q0(X0[24],x,rx,N0);return[0,nx,[1,[0,mx,N0,x0([0,xx],[0,q0(x)],O)]]];case 1:var F0=r[2],px=r[1],dx=i0(x),W=G0(x),g0=Q0(X0[26],x,px,F0);return[0,W,[2,[0,g0,F0,x0([0,dx],[0,q0(x)],O)]]];case 2:var B=r[1],h0=B[4],_0=B[3],d0=B[2],E0=B[1],U=i0(x);return h0&&Ne(x,77),T0(x),[0,E0,[3,[0,d0,_0,x0([0,U],[0,q0(x)],O)]]];case 4:if(!P(r[3],Xo)){var Kx=i0(x),Ix=G0(x);return T0(x),[0,Ix,[0,x0([0,Kx],[0,q0(x)],O)]]}break}if(!_n(x)){var z0=i0(x),Kr=G0(x);p2(0,x);x:if(typeof r!="number"&&r[0]===7){T0(x);break x}return[0,Kr,[0,x0([0,z0],Al0,O)]]}for(var S=G0(x),G=[0,p(X0[13],0,x)];;){var Z0=L(x);if(typeof Z0=="number"){if(Z0===6){let m0=G;var G=[1,r0([0,S],function(Ex){J(Ex,6);var qx=i0(Ex),O0=L(Ex);x:{if(typeof O0!="number")switch(O0[0]){case 0:var Wx=O0[2],Yx=O0[1],fx=G0(Ex),Qx=Q0(X0[24],Ex,Yx,Wx),b2=[1,[0,fx,[0,Qx,Wx,x0([0,qx],[0,q0(Ex)],O)]]];break x;case 2:var vx=O0[1],nr=vx[4],gr=vx[3],Nr=vx[2],s2=vx[1];nr&&Ne(Ex,77),J(Ex,[2,[0,s2,Nr,gr,nr]]);var b2=[0,[0,s2,[0,Nr,gr,x0([0,qx],[0,q0(Ex)],O)]]];break x}p2(El0,Ex);var b2=[0,[0,G0(Ex),Sl0]]}return J(Ex,7),[0,m0,b2,x0(0,[0,q0(Ex)],O)]},x)];continue}if(Z0===10){let m0=G;var G=[1,r0([0,S],function(Ex){T0(Ex);var qx=[2,a1(Ex)];return[0,m0,qx,x0(0,[0,q0(Ex)],O)]},x)];continue}}if(G[0]===0){var yx=G[1];return[0,yx[1],[8,yx]]}var Tx=G[1],ex=Tx[1];return[0,ex,[9,[0,ex,Tx[2]]]]}}function NX(x,r){return r0(0,function(e){var t=i0(e);T0(e);var u=L(e);x:{if(typeof u!="number")switch(u[0]){case 0:var i=u[2],c=u[1],v=i0(e),a=G0(e),l=Q0(X0[24],e,c,i),I=[0,a,[0,[0,l,i,x0([0,v],[0,q0(e)],O)]]];break x;case 1:var m=u[2],h=u[1],T=i0(e),b=G0(e),N=Q0(X0[26],e,h,m),I=[0,b,[1,[0,N,m,x0([0,T],[0,q0(e)],O)]]];break x}var C=G0(e);p2(Pl0,e);var I=[0,C,Il0]}return[6,[0,r,I,x0([0,t],[0,q0(e)],O)]]},x)}function Xt(x,r){return r0(0,function(e){var t=i0(e);T0(e);var u=p(X0[13],Nl0,e);return[0,r,u,x0([0,t],[0,q0(e)],O)]},x)}function CX(x){return r0(0,function(r){var e=i0(r);J(r,12);var t=L(r);x:{r:if(typeof t=="number"){var u=t+A3|0;if(4>=u>>>0){switch(u){case 0:var i=[0,Xt(r,0)];break;case 3:var i=[0,Xt(r,2)];break;case 4:var i=[0,Xt(r,1)];break;default:break r}var c=i;break x}}var c=0}return[0,c,x0([0,e],[0,q0(r)],O)]},x)}function jX(x,r){var e=x[0]===0?x[1]:x[1]-1|0,t=(r[0]===0,r[1]);return t<=e?1:0}var h4=[],Ih=[],OX=[],DX=[],FX=[],d4=[],RX=[],LX=[],Cj=[],MX=[];function y4(x){var r=_n(x);if(r){var e=L(x);x:{if(typeof e=="number"){if(e===59){if(x[18]){var t=0;break x}}else if(e===66&&x[19]){var t=0;break x}}var t=1}var u=t}else var u=r;var i=L(x);x:{r:if(typeof i=="number"){if(23<=i){if(i===59){if(x[18])return[0,r0(0,function(m){m[10]&&Ux(m,J1);var h=i0(m),T=G0(m);J(m,59);var b=G0(m);if(ol(m))var N=0,C=0;else{var I=$r(m,K2),F=L(m);e:{t:if(typeof F=="number"){if(F!==87){if(10<=F)break t;switch(F){case 0:case 2:case 3:case 4:case 6:break t}}var M=0;break e}var M=1}e:{if(!I&&!M){var Y=0;break e}var Y=[0,Yt(m)]}var N=I,C=Y}var q=C?0:q0(m),K=Vr(T,b);return[38,[0,C,x0([0,h],[0,q],O),N,K]]},x)];break r}if(i!==99)break r}else if(i!==4&&22>i)break r;break x}if(!u)return d(h4[1],x)}x:{if(i===65&&S2(x)&&rr(1,x)===99){var c=h4[2],v=xY;break x}var c=xY,v=h4[2]}var a=lh(x,v);if(a)return a[1];var l=lh(x,c);return l?l[1]:d(h4[1],x)}function Yt(x){return y1(x,y4(x))}function qX(x){var r=x[2];switch(r[0]){case 24:var e=r[1],t=e[1][2][1];if(P(t,K1)){if(!P(t,nv)&&!P(e[2][2][1],Jm))return 0}else if(!P(e[2][2][1],Gl))return 0;break;case 10:case 23:break;default:return 0}return 1}function BX(x){var r=G0(x),e=r0(0,Nh,x),t=e[2],u=e[1],i=L(x);x:{if(typeof i=="number"&&i===85){var v=JN(Ih[3],1,x,t,u);break x}var c=Q0(Ih[1],x,t,u),v=Q0(Ih[2],x,c[2],c[1])}var a=v[2];if(L(x)!==86)return a;T0(x);var l=Yt(n4(0,x));J(x,87);var m=r0([0,r],Yt,x),h=m[2],T=m[1];return[0,[0,T,[8,[0,y1(x,a),l,h,0]]]]}function Nh(x){return p(OX[1],x,0)}function UX(x){var r=L(x);if(typeof r=="number"){if(49<=r){if(ft<=r){if(Qs>r)switch(r+U9|0){case 0:return r30;case 1:return e30;case 6:return t30;case 7:return n30}}else if(r===66&&x[19])return x[10]&&Ux(x,6),u30}else if(46<=r)switch(r+za|0){case 0:return i30;case 1:return f30;default:return c30}}return 0}function XX(x){var r=G0(x),e=i0(x),t=UX(x);if(t){var u=t[1];T0(x);var i=r0([0,r],YX,x),c=i[2],v=i[1];x:r:if(u===6){var a=c[2];switch(a[0]){case 10:pt(x,[0,v,69]);break;case 23:a[1][2][0]===1&&B0(x,[0,v,63]);break;default:break r}break x}return[0,[0,v,[36,[0,u,c,x0([0,e],0,O)]]]]}var l=L(x);x:{if(typeof l=="number"){if(Qs===l){var m=a30;break x}if(J1===l){var m=s30;break x}}var m=0}if(m){var h=m[1];T0(x);var T=r0([0,r],YX,x),b=T[2],N=T[1];1-qX(b)&&B0(x,[0,b[1],36]);var C=b[2];x:if(C[0]===10&&Cv(C[1][2][1])){Ne(x,74);break x}return[0,[0,N,[37,[0,h,b,1,x0([0,e],0,O)]]]]}var I=zX(x);if(d1(x))return I;var F=L(x);x:{if(typeof F=="number"){if(Qs===F){var M=v30;break x}if(J1===F){var M=o30;break x}}var M=0}if(!M)return I;var Y=M[1],q=y1(x,I);1-qX(q)&&B0(x,[0,q[1],36]);var K=q[2];x:if(K[0]===10&&Cv(K[1][2][1])){Ne(x,73);break x}var u0=G0(x);T0(x);var Q=q0(x),e0=Vr(q[1],u0);return[0,[0,e0,[37,[0,Y,q,0,x0(0,[0,Q],O)]]]]}function YX(x){return y1(x,XX(x))}function zX(x){var r=G0(x),e=1-x[17],t=0,u=x[17]===0?x:[0,x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15],x[16],t,x[18],x[19],x[20],x[21],x[22],x[23],x[24],x[25],x[26],x[27],x[28],x[29],x[30],x[31]],i=L(u);x:{r:if(typeof i=="number"){var c=i+iA|0;if(7>=c>>>0){switch(c){case 0:if(!e)break r;var v=[0,GX(u)];break;case 6:var v=[0,r0(0,function(m){var h=i0(m),T=G0(m);if(J(m,51),$r(m,10)){var b=gn(0,[0,T,m30]),N=G0(m);bs(m,h30);var C=gn(0,[0,N,d30]);return[24,[0,b,C,x0([0,h],[0,q0(m)],O)]]}var I=i0(m);J(m,4);var F=ZX([0,I],0,Yt(n4(0,m)));return J(m,5),[11,[0,F,x0([0,h],[0,q0(m)],O)]]},u)];break;case 7:var v=[0,KX(u)];break;default:break r}var a=v;break x}}var a=fo(u)?[0,VX(u)]:$X(u)}return qv(0,0,u,r,a)}function jj(x){return y1(x,zX(x))}function KX(x){switch(x[22]){case 0:var r=0,e=0;break;case 1:var r=0,e=1;break;default:var r=1,e=1}var t=G0(x),u=i0(x);J(x,52);var i=[0,t,[30,[0,x0([0,u],[0,q0(x)],O)]]],c=L(x);if(typeof c=="number"&&11>c)switch(c){case 4:var v=r?i:(B0(x,[0,t,se]),[0,t,[10,gn(0,[0,t,l30])]]);return JX(0,x,t,v);case 6:case 10:var a=e?i:(B0(x,[0,t,y2]),[0,t,[10,gn(0,[0,t,k30])]]);return JX(0,x,t,a)}return e?p2(p30,x):B0(x,[0,t,y2]),i}function qv(x,r,e,t,u){var i=x?x[1]:1,c=r?r[1]:0,v=WX([0,i],[0,c],e,t,u),a=dU(e);x:{if(a){var l=a[1];if(typeof l=="number"&&l===84){var m=1;break x}}var m=0}function h(C){var I=D2(C)[2];return p(I,y1(C,v),function(F,M){return p(Xx(F,nn,92),F,M)})}function T(C,I,F){var M=Ch(I),Y=M[1],q=M[2],K=Vr(t,Y),u0=[0,F,C,[0,Y,q],0];x:{if(!m&&!c){var Q=[6,u0];break x}var Q=[27,[0,u0,K,m]]}var e0=c||m;return qv([0,i],[0,e0],I,t,[0,[0,K,Q]])}if(e[13])return v;var b=L(e);if(typeof b=="number"){var N=b-99|0;if(2>>0){if(N===-95)return T(0,e,h(e))}else if(N!==1&&S2(e))return ph(fh(function(C,I){throw K0(Bt,1)},e),v,function(C){var I=h(C);return T(Oj(C),C,I)})}return v}function JX(x,r,e,t){var u=x?x[1]:1;return y1(r,qv([0,u],0,r,e,[0,t]))}function GX(x){return r0(0,function(r){var e=G0(r),t=i0(r);if(J(r,45),r[11]&&L(r)===10){var u=q0(r);T0(r);var i=gn(x0([0,t],[0,u],O),[0,e,y30]),c=L(r);return typeof c!="number"&&c[0]===4&&!P(c[3],Jm)?[24,[0,i,p(X0[13],0,r),0]]:(p2(g30,r),T0(r),[10,i])}var v=G0(r),a=L(r);x:{if(typeof a=="number"){if(a===45){var l=GX(r);break x}if(a===52){var l=KX(nj(1,r));break x}}var l=fo(r)?VX(r):y1(r,$X(r))}var m=nj(1,r),h=y1(m,WX([0,w30[1]],0,m,v,[0,l])),T=L(r);x:{if(typeof T!="number"&&T[0]===3){var b=HX(r,v,h,T[1]);break x}var b=h}x:{r:if(L(r)!==4){if(S2(r)&&L(r)===99)break r;var N=b;break x}var N=p(D2(r)[2],b,function(M,Y){return p(Xx(M,nn,93),M,Y)})}var C=S2(r)?ph(fh(function(M,Y){throw K0(Bt,1)},r),0,Oj):0,I=L(r);x:{if(typeof I=="number"&&I===4){var F=[0,Ch(r)];break x}var F=0}return[25,[0,N,C,F,x0([0,t],0,O)]]},x)}function Oj(x){V2(x,1);var r=L(x)===99?[0,r0(0,DX[1],x)]:0;return H2(x),r}function Ch(x){return r0(0,function(r){var e=i0(r);J(r,4);var t=p(FX[1],r,0),u=i0(r);return J(r,5),[0,t,j2([0,e],[0,q0(r)],u,O)]},x)}function WX(x,r,e,t,u){var i=x?x[1]:1,c=r?r[1]:0,v=L(e);if(typeof v=="number")switch(v){case 6:return T0(e),N6(d4[1],[0,i],[0,c],0,e,t,u);case 10:return T0(e),N6(d4[2],[0,i],[0,c],0,e,t,u);case 84:1-i&&Ux(e,60),J(e,84);var a=L(e);if(typeof a=="number")switch(a){case 4:return u;case 6:return T0(e),N6(d4[1],[0,i],b30,_30,e,t,u);case 99:if(S2(e))return u;break}else if(a[0]===3)return Ux(e,61),u;return N6(d4[2],[0,i],E30,T30,e,t,u)}else if(v[0]===3){var l=v[1];return c&&Ux(e,61),qv(S30,0,e,t,[0,HX(e,t,y1(e,u),l)])}return u}function VX(x){return r0(0,function(r){var e=Ah(r),t=e[1],u=e[2],i=r0(0,function(F){var M=i0(F);J(F,15);var Y=Mv(F),q=Y[1],K=F6([0,u,[0,M,[0,Y[2],0]]]);if(L(F)===4)var u0=0,Q=0;else{var e0=L(F);x:{if(typeof e0=="number"&&e0===99){var a0=0;break x}var f0=xj(q,rj(t,F)),a0=[0,Ut(f0,p(X0[13],A30,f0))]}var u0=re(F,$e(F)),Q=a0}var Z=Iv(0,F),v0=t||Z[19],t0=ml(v0,q)(Z),y0=L(Z)===87?t0:c4(Z,t0),n0=Ej(Z),s0=n0[2],l0=n0[1];if(s0)var w0=NU(Z,s0),L0=l0;else var w0=s0,L0=vl(Z,l0);return[0,Q,y0,q,w0,L0,u0,K]},r),c=i[2],v=c[3],a=c[2],l=c[1],m=c[7],h=c[6],T=c[5],b=c[4],N=i[1],C=k4(r,t,v,1,Dv(a)),I=C[1];return kl(r,C[2],l,a),[9,[0,l,a,I,t,v,1,b,T,h,x0([0,m],0,O),N]]},x)}function Dj(x,r,e){switch(r){case 1:Ne(x,77);try{var t=t5(pv(Mx(P30,e))),u=t}catch(T){var i=B2(T);if(i[1]!==kn)throw K0(i,0);var u=bx(Mx(I30,e))}break;case 2:Ne(x,76);try{var c=ON(e),u=c}catch(T){var v=B2(T);if(v[1]!==kn)throw K0(v,0);var u=bx(Mx(N30,e))}break;case 4:try{var a=ON(e),u=a}catch(T){var l=B2(T);if(l[1]!==kn)throw K0(l,0);var u=bx(Mx(C30,e))}break;default:try{var m=t5(pv(e)),u=m}catch(T){var h=B2(T);if(h[1]!==kn)throw K0(h,0);var u=bx(Mx(j30,e))}}return J(x,[0,r,e]),u}function Fj(x,r,e){var t=Cx(e);x:{if(t!==0&&w1===q2(e,t-1|0)){var u=E1(e,0,t-1|0);break x}var u=e}var i=uq(u);return J(x,[1,r,e]),i}function $X(x){var r=G0(x),e=i0(x),t=L(x);if(typeof t=="number")switch(t){case 0:var u=d(X0[12],x);return[1,[0,u[1],[26,u[2]]],u[3]];case 4:var i=i0(x),c=r0(0,function(W){J(W,4);var g0=G0(W),B=Yt(W),h0=L(W);x:{if(typeof h0=="number"){if(h0===9){var _0=[0,Rj(W,g0,[0,B,0])];break x}if(h0===87){var _0=[1,[0,B,Lv(W),0]];break x}}var _0=[0,B]}return J(W,5),_0},x),v=c[2],a=c[1],l=q0(x),m=v[0]===0?v[1]:[0,a,[34,v[1]]];return[0,ZX([0,i],[0,l],m)];case 6:var h=r0(0,bT0,x),T=h[2];return[1,[0,h[1],[0,T[1]]],T[2]];case 21:if(x[28][3]&&!jv(1,x)&&rr(1,x)===4){var b=i0(x),N=G0(x),C=p(X0[13],0,x),I=C[1],F=Ch(x);if(!d1(x)&&L(x)===0){var M=FU(x,F),Y=function(W){var g0=i0(W),B=d(X0[27],W),h0=$r(W,16)?[0,d(X0[7],W)]:0;J(W,87);var _0=Yt(W),d0=L(W);x:{r:if(typeof d0=="number"){if(d0!==1&&kr!==d0)break r;break x}J(W,9)}return[0,B,_0,h0,x0([0,g0],[0,q0(W)],O)]};return[0,r0([0,N],function(W){J(W,0);for(var g0=0;;){var B=L(W);x:if(typeof B=="number"){if(B!==1&&kr!==B)break x;var h0=tx(g0);return J(W,1),[22,[0,M,h0,N,I,x0([0,b],[0,q0(W)],O)]]}var g0=[0,r0(0,Y,W),g0]}},x)]}var q=Vr(N,F[1]);return qv(D30,O30,x,N,[0,[0,q,[6,[0,[0,I,[10,C]],0,F,x0([0,b],0,O)]]]])}break;case 22:return T0(x),[0,[0,r,[33,[0,x0([0,e],[0,q0(x)],O)]]]];case 30:return T0(x),[0,[0,r,[16,x0([0,e],[0,q0(x)],O)]]];case 41:return[0,d(X0[22],x)];case 99:var K=d(X0[17],x),u0=K[2],Q=K[1],e0=un<=u0[1]?[13,u0[2]]:[12,u0[2]];return[0,[0,Q,e0]];case 31:case 32:return T0(x),[0,[0,r,[15,[0,t===32?1:0,x0([0,e],[0,q0(x)],O)]]]];case 75:case 106:V2(x,5);var f0=G0(x),a0=i0(x),Z=L(x);x:{if(typeof Z!="number"&&Z[0]===5){var v0=Z[3],t0=Z[2];T0(x);var y0=q0(x),n0=y0,s0=v0,l0=t0,w0=Mx(L30,Mx(t0,Mx(R30,v0)));break x}p2(M30,x);var n0=0,s0=q30,l0=B30,w0=U30}H2(x);var L0=Wr(Cx(s0));Sb0(function(W){var g0=W+B9|0;if(21>=g0>>>0)switch(g0){case 0:case 3:case 5:case 9:case 15:case 17:case 18:case 21:return at(L0,W)}},s0);var I0=G2(L0);return P(I0,s0)&&Ux(x,[19,s0]),[0,[0,f0,[19,[0,l0,I0,w0,x0([0,a0],[0,n0],O)]]]]}else switch(t[0]){case 0:var j0=t[2],S0=Dj(x,t[1],j0);return[0,[0,r,[17,[0,S0,j0,x0([0,e],[0,q0(x)],O)]]]];case 1:var W0=t[2],A0=Fj(x,t[1],W0);return[0,[0,r,[18,[0,A0,W0,x0([0,e],[0,q0(x)],O)]]]];case 2:var J0=t[1],b0=J0[3],z=J0[2],C0=J0[1];J0[4]&&Ne(x,77),T0(x);var V0=x0([0,e],[0,q0(x)],O),N0=x[28],rx=N0[7],xx=N0[8];x:{if(rx){var nx=rx[1];if(rq(nx,z)){var F0=[20,[0,z,C0,0,Cx(nx),0,b0,V0]];break x}}if(xx){var mx=xx[1];if(rq(mx,z)){var F0=[20,[0,z,C0,0,Cx(mx),1,b0,V0]];break x}}var F0=[14,[0,z,b0,V0]]}return[0,[0,C0,F0]];case 3:var px=QX(x,t[1]);return[0,[0,px[1],[32,px[2]]]];case 4:if(!P(t[3],kA)&&rr(1,x)===41)return[0,d(X0[22],x)];break}if(_n(x)){var dx=p(X0[13],0,x);return[0,[0,dx[1],[10,dx]]]}p2(0,x);x:if(typeof t!="number"&&t[0]===7){T0(x);break x}return[0,[0,r,[16,x0([0,e],F30,O)]]]}function QX(x,r){var e=r[5],t=r[1],u=r[3],i=r[2],c=i0(x);J(x,[3,r]);var v=[0,t,[0,[0,u,i],e]];if(e)var l=0,m=[0,v,0],h=t;else var a=Q0(RX[1],x,[0,v,0],0),l=a[3],m=a[2],h=a[1];var T=q0(x),b=Vr(t,h);return[0,b,[0,m,l,x0([0,c],[0,T],O)]]}function HX(x,r,e,t){var u=p(D2(x)[2],e,function(c,v){return p(Xx(c,nn,3),c,v)}),i=QX(x,t);return[0,Vr(r,i[1]),[31,[0,u,i,0]]]}function ZX(x,r,e){var t=x?x[1]:0,u=r?r[1]:0,i=e[2];function c(cx){return A1(cx,x0([0,t],[0,u],O))}function v(cx){return j5(cx,x0([0,t],[0,u],O))}var a=e[1];switch(i[0]){case 0:var l=i[1],m=v(l[2]),U0=[0,[0,l[1],m]];break;case 1:var h=i[1],T=h[11],b=c(h[10]),U0=[1,[0,h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],b,T]];break;case 2:var N=i[1],C=c(N[2]),U0=[2,[0,N[1],C]];break;case 3:var I=i[1],F=c(I[3]),U0=[3,[0,I[1],I[2],F]];break;case 4:var M=i[1],Y=c(M[4]),U0=[4,[0,M[1],M[2],M[3],Y]];break;case 5:var q=i[1],K=c(q[4]),U0=[5,[0,q[1],q[2],q[3],K]];break;case 6:var u0=i[1],Q=c(u0[4]),U0=[6,[0,u0[1],u0[2],u0[3],Q]];break;case 7:var e0=i[1],f0=c(e0[7]),U0=[7,[0,e0[1],e0[2],e0[3],e0[4],e0[5],e0[6],f0]];break;case 8:var a0=i[1],Z=c(a0[4]),U0=[8,[0,a0[1],a0[2],a0[3],Z]];break;case 9:var v0=i[1],t0=v0[11],y0=c(v0[10]),U0=[9,[0,v0[1],v0[2],v0[3],v0[4],v0[5],v0[6],v0[7],v0[8],v0[9],y0,t0]];break;case 10:var n0=i[1],s0=n0[2],l0=n0[1],w0=c(s0[2]),U0=[10,[0,l0,[0,s0[1],w0]]];break;case 11:var L0=i[1],I0=c(L0[2]),U0=[11,[0,L0[1],I0]];break;case 12:var j0=i[1],S0=c(j0[4]),U0=[12,[0,j0[1],j0[2],j0[3],S0]];break;case 13:var W0=i[1],A0=c(W0[4]),U0=[13,[0,W0[1],W0[2],W0[3],A0]];break;case 14:var J0=i[1],b0=c(J0[3]),U0=[14,[0,J0[1],J0[2],b0]];break;case 15:var z=i[1],C0=c(z[2]),U0=[15,[0,z[1],C0]];break;case 16:var U0=[16,c(i[1])];break;case 17:var V0=i[1],N0=c(V0[3]),U0=[17,[0,V0[1],V0[2],N0]];break;case 18:var rx=i[1],xx=c(rx[3]),U0=[18,[0,rx[1],rx[2],xx]];break;case 19:var nx=i[1],mx=c(nx[4]),U0=[19,[0,nx[1],nx[2],nx[3],mx]];break;case 20:var F0=i[1],px=c(F0[7]),U0=[20,[0,F0[1],F0[2],F0[3],F0[4],F0[5],F0[6],px]];break;case 21:var dx=i[1],W=c(dx[4]),U0=[21,[0,dx[1],dx[2],dx[3],W]];break;case 22:var g0=i[1],B=c(g0[5]),U0=[22,[0,g0[1],g0[2],g0[3],g0[4],B]];break;case 23:var h0=i[1],_0=c(h0[3]),U0=[23,[0,h0[1],h0[2],_0]];break;case 24:var d0=i[1],E0=c(d0[3]),U0=[24,[0,d0[1],d0[2],E0]];break;case 25:var U=i[1],Kx=c(U[4]),U0=[25,[0,U[1],U[2],U[3],Kx]];break;case 26:var Ix=i[1],z0=v(Ix[2]),U0=[26,[0,Ix[1],z0]];break;case 27:var Kr=i[1],S=Kr[1],G=Kr[3],Z0=Kr[2],yx=c(S[4]),U0=[27,[0,[0,S[1],S[2],S[3],yx],Z0,G]];break;case 28:var Tx=i[1],ex=Tx[1],m0=Tx[3],Dx=Tx[2],Ex=c(ex[3]),U0=[28,[0,[0,ex[1],ex[2],Ex],Dx,m0]];break;case 29:var qx=i[1],O0=c(qx[2]),U0=[29,[0,qx[1],O0]];break;case 30:var U0=[30,[0,c(i[1][1])]];break;case 31:var Wx=i[1],Yx=c(Wx[3]),U0=[31,[0,Wx[1],Wx[2],Yx]];break;case 32:var fx=i[1],Qx=c(fx[3]),U0=[32,[0,fx[1],fx[2],Qx]];break;case 33:var U0=[33,[0,c(i[1][1])]];break;case 34:var vx=i[1],nr=c(vx[3]),U0=[34,[0,vx[1],vx[2],nr]];break;case 35:var gr=i[1],Nr=c(gr[3]),U0=[35,[0,gr[1],gr[2],Nr]];break;case 36:var s2=i[1],b2=c(s2[3]),U0=[36,[0,s2[1],s2[2],b2]];break;case 37:var k2=i[1],F2=c(k2[4]),U0=[37,[0,k2[1],k2[2],k2[3],F2]];break;default:var jx=i[1],_=jx[4],$=jx[3],ix=c(jx[2]),U0=[38,[0,jx[1],ix,$,_]]}return[0,a,U0]}function bT0(x){var r=i0(x);J(x,6);var e=p(LX[1],x,[0,0,mn]),t=e[2],u=e[1],i=i0(x);return J(x,7),[0,[0,u,j2([0,r],[0,q0(x)],i,O)],t]}function xY(x){var r=fh(Cj[1],x),e=G0(r);if(rr(1,r)===11)var u=0,i=0;else var t=Ah(r),u=t[2],i=t[1];var c=i||r[19],v=rj(c,r),a=v[18],l=r0(0,function(s0){var l0=re(s0,$e(s0));if(_n(s0)&&l0===0){var w0=p(X0[13],X30,s0),L0=w0[1],I0=[0,L0,[0,[0,L0,[2,[0,w0,[0,pa(s0)],0]]],0]];return[0,l0,[0,L0,[0,0,[0,I0,0],0,0]],[0,[0,L0[1],L0[3],L0[3]]],0]}var j0=ml(c,a)(s0);gX(s0,j0);var S0=Ej(Nv(1,s0));return[0,l0,j0,S0[1],S0[2]]},v),m=l[2],h=m[2],T=h[2];x:{r:{var b=m[4],N=m[3],C=m[1],I=l[1];if(!T[1]){var F=T[2];if(!T[3]&&F)break r;var M=yU(v);break x}}var M=v}var Y=h[2],q=Y[1];if(q){var K=h[1];B0(M,[0,q[1][1],87]);var u0=[0,K,[0,0,Y[2],Y[3],Y[4]]]}else var u0=h;var Q=Dv(u0),e0=d1(M),f0=e0&&(L(M)===11?1:0);f0&&Ux(M,56),J(M,11);var a0=gU(yU(M),i,0,Q),Z=r0(0,Cj[2],a0),v0=Z[2],t0=v0[1],y0=Z[1];kl(a0,v0[2],0,u0);var n0=Vr(e,y0);return[0,[0,n0,[1,[0,0,u0,t0,i,0,1,b,N,C,x0([0,u],0,O),I]]]]}function Rj(x,r,e){return r0([0,r],d(MX[1],e),x)}function rY(x){var r=G0(x),e=BX(x),t=L(x);x:{if(typeof t=="number"){var u=t-68|0;if(15>=u>>>0){switch(u){case 0:var i=qv0;break;case 1:var i=Bv0;break;case 2:var i=Uv0;break;case 3:var i=Xv0;break;case 4:var i=Yv0;break;case 5:var i=zv0;break;case 6:var i=Kv0;break;case 7:var i=Jv0;break;case 8:var i=Gv0;break;case 9:var i=Wv0;break;case 10:var i=Vv0;break;case 11:var i=$v0;break;case 12:var i=Qv0;break;case 13:var i=Hv0;break;case 14:var i=Zv0;break;default:var i=x30}var c=i;break x}}var c=0}if(c!==0&&T0(x),!c)return e;var v=c[1];return[0,r0([0,r],function(a){var l=Ij(0,a,e);return[4,[0,v,l,Yt(a),0]]},x)]}function TT0(x,r){if(typeof r=="number"&&r===81)return 0;throw K0(Bt,1)}Rr(h4,[0,rY,function(x){var r=fh(TT0,x),e=rY(r),t=L(r);if(typeof t=="number"){if(t===11)throw K0(Bt,1);if(t===87){var u=dU(r);x:{if(u){var i=u[1];if(typeof i=="number"&&i===5){var c=1;break x}}var c=0}if(c)throw K0(Bt,1)}}if(!_n(r))return e;if(e[0]===0){var v=e[1][2];if(v[0]===10&&!P(v[1][2][1],Ya)&&!d1(r))throw K0(Bt,1)}return e}]);function Lj(x,r,e,t,u){var i=y1(x,r);return[0,[0,u,[21,[0,t,i,y1(x,e),0]]]]}function Mj(x,r,e){for(var t=r,u=e;;){var i=L(x);if(typeof i=="number"&&i===89){T0(x);var c=r0(0,Nh,x),v=c[2],a=Vr(u,c[1]),l=qj(0,x,Lj(x,t,v,1,a),a),t=l[2],u=l[1];continue}return[0,u,t]}}function eY(x,r,e){for(var t=r,u=e;;){var i=L(x);if(typeof i=="number"&&i===88){T0(x);var c=r0(0,Nh,x),v=Mj(x,c[2],c[1]),a=v[2],l=Vr(u,v[1]),m=qj(0,x,Lj(x,t,a,0,l),l),t=m[2],u=m[1];continue}return[0,u,t]}}function qj(x,r,e,t){for(var u=x,i=e,c=t;;){var v=L(r);if(typeof v=="number"&&v===85){1-u&&Ux(r,ml0),J(r,85);var a=r0(0,Nh,r),l=a[2],m=a[1],h=L(r);x:{if(typeof h=="number"&&1>=h+iD>>>0){Ux(r,[22,JC(h)]);var T=Mj(r,l,m),b=eY(r,T[2],T[1]),N=b[2],C=b[1];break x}var N=l,C=m}var I=Vr(c,C),u=1,i=Lj(r,i,N,2,I),c=I;continue}return[0,c,i]}}Rr(Ih,[0,Mj,eY,qj]);function Bj(x,r,e,t){return[0,t,[5,[0,e,x,r,0]]]}Rr(OX,[0,function(x,r){for(var e=r;;){var t=r0(0,function(b0){var z=UX(b0)!==0?1:0;return[0,z,XX(n4(0,b0))]},x),u=t[2],i=u[2],c=u[1],v=t[1];x:if(L(x)===99&&i[0]===0&&i[1][2][0]===12){Ux(x,2);break x}let J0=v;var a=function(b0,z){for(var C0=b0,V0=z;;){var N0=L(x);x:if(typeof N0!="number"&&N0[0]===4){var rx=N0[3];if(P(rx,It)&&P(rx,ZR))break x;if(S2(x)){T0(x);var xx=y1(x,V0);r:{if(C0){var nx=C0[1],mx=nx[2],F0=C0[2],px=nx[3],dx=mx[1],W=nx[1];if(jX(mx[2],G30)){var g0=Bj(W,xx,dx,Vr(px,J0)),B=F0;break r}}var g0=xx,B=C0}var h0=g0[1];if(_r(rx,ZR))var _0=ma(x),d0=_0[1],Ix=[0,[0,Vr(h0,d0),[35,[0,g0,[0,d0,_0],0]]]];else if(L(x)===28){var E0=Vr(h0,G0(x));T0(x);var Ix=[0,[0,E0,[2,[0,g0,0]]]]}else var U=ma(x),Kx=U[1],Ix=[0,[0,Vr(h0,Kx),[3,[0,g0,[0,Kx,U],0]]]];var C0=B,V0=Ix;continue}}return[0,C0,V0]}}(e,i),l=a[2],m=a[1],h=L(x);x:{r:if(typeof h=="number"){var T=h-17|0;if(1>>0){if(73>T)break r;switch(T-73|0){case 0:var b=W30;break;case 1:var b=V30;break;case 2:var b=$30;break;case 3:var b=Q30;break;case 4:var b=H30;break;case 5:var b=Z30;break;case 6:var b=xl0;break;case 7:var b=rl0;break;case 8:var b=el0;break;case 9:var b=tl0;break;case 10:var b=nl0;break;case 11:var b=ul0;break;case 12:var b=il0;break;case 13:var b=fl0;break;case 14:var b=cl0;break;case 15:var b=sl0;break;case 16:var b=al0;break;case 17:var b=ol0;break;case 18:var b=vl0;break;case 19:var b=ll0;break;default:break r}var N=b}else var N=T?pl0:x[12]?0:kl0;var C=N;break x}var C=0}if(C!==0&&T0(x),!m&&!C)return l;if(C){var I=C[1],F=I[1],M=I[2],Y=c&&(F===14?1:0);Y&&B0(x,[0,v,37]);x:for(var q=y1(x,l),K=[0,F,M],u0=v,Q=m;;){var e0=K[2],f0=K[1];if(!Q)break x;var a0=Q[1],Z=a0[2],v0=Q[2],t0=a0[3],y0=Z[1],n0=a0[1];if(!jX(Z[2],e0))break;var s0=Vr(t0,u0),q=Bj(n0,q,y0,s0),K=[0,f0,e0],u0=s0,Q=v0}var e=[0,[0,q,[0,f0,e0],u0],Q]}else for(var l0=y1(x,l),w0=v,L0=m;;){if(!L0)return[0,l0];var I0=L0[1],j0=L0[2],S0=I0[2][1],W0=I0[1],A0=Vr(I0[3],w0),l0=Bj(W0,l0,S0,A0),w0=A0,L0=j0}}}]),Rr(DX,[0,function(x){var r=i0(x);J(x,99);for(var e=0;;){var t=L(x);x:if(typeof t=="number"){if(y2!==t&&kr!==t)break x;var u=tx(e),i=i0(x);J(x,y2);var c=L(x)===4?D2(x)[1]:q0(x);return[0,u,j2([0,r],[0,c],i,O)]}var v=L(x);x:{if(typeof v!="number"&&v[0]===4&&!P(v[2],Xo)){var a=G0(x),l=i0(x);bs(x,J30);var m=[1,[0,a,[0,x0([0,l],[0,q0(x)],O)]]];break x}var m=[0,ma(x)]}var h=[0,m,e];y2!==L(x)&&J(x,9);var e=h}}]);function ET0(x){var r=i0(x);J(x,12);var e=Yt(x);return[0,e,x0([0,r],0,O)]}Rr(FX,[0,function(x,r){for(var e=r;;){var t=L(x);x:if(typeof t=="number"){if(t!==5&&kr!==t)break x;return tx(e)}var u=L(x);x:{if(typeof u=="number"&&u===12){var i=[1,r0(0,ET0,x)];break x}var i=[0,Yt(x)]}var c=[0,i,e];L(x)!==5&&J(x,9);var e=c}}]),Rr(d4,[0,function(x,r,e,t,u,i){var c=x?x[1]:1,v=r?r[1]:0,a=e?e[1]:0,l=nj(0,t),m=d(X0[7],l),h=G0(t);J(t,7);var T=q0(t),b=Vr(u,h),N=x0(0,[0,T],O),C=[0,y1(t,i),[2,m],N],I=v?[28,[0,C,b,a]]:[23,C];return qv([0,c],[0,v],t,u,[0,[0,b,I]])},function(x,r,e,t,u,i){var c=x?x[1]:1,v=r?r[1]:0,a=e?e[1]:0,l=L(t);x:{if(typeof l=="number"&&l===14){var m=DU(t),h=m[1],T=t[30][1],b=m[2][1];if(T){var N=T[1];t[30][1]=[0,[0,N[1],[0,[0,b,h],N[2]]],T[2]]}else B0(t,[0,h,64]);var I=[1,m],F=h;break x}var C=a1(t),I=[0,C],F=C[1]}var M=Vr(u,F);x:if(i[0]===0&&i[1][2][0]===30&&I[0]===1){B0(t,[0,M,83]);break x}var Y=[0,y1(t,i),I,0],q=v?[28,[0,Y,M,a]]:[23,Y];return qv([0,c],[0,v],t,u,[0,[0,M,q]])}]),Rr(RX,[0,function(x,r,e){for(var t=r,u=e;;){var i=d(X0[7],x),c=[0,i,u],v=L(x);if(typeof v=="number"&&v===1){V2(x,4);var a=L(x);if(typeof a!="number"&&a[0]===3){var l=a[1],m=l[5],h=l[1],T=l[3],b=l[2];T0(x),H2(x);var N=[0,[0,h,[0,[0,T,b],m]],t];if(m){var C=tx(c);return[0,h,tx(N),C]}var t=N,u=c;continue}throw K0([0,Ir,Y30],1)}p2(z30,x);var I=[0,i[1],K30],F=tx(c),M=tx([0,I,t]);return[0,i[1],M,F]}}]),Rr(LX,[0,function(x,r){for(var e=r;;){var t=e[2],u=e[1],i=L(x);x:if(typeof i=="number"){if(13<=i){if(kr!==i)break x}else{if(7>i)break x;switch(i-7|0){case 0:break;case 2:var c=G0(x);T0(x);var e=[0,[0,[2,c],u],t];continue;case 5:var v=i0(x),a=r0(0,function(u0){T0(u0);var Q=y4(u0);return Q[0]===0?[0,Q[1],mn]:[0,Q[1],Q[2]]},x),l=a[2],m=l[2],h=a[1],T=l[1],b=[1,[0,h,[0,T,x0([0,v],0,O)]]],N=L(x)===7?1:0;r:{if(!N&&rr(1,x)===7){var C=[0,m[1],[0,[0,h,16],m[2]]];break r}var C=m}1-N&&J(x,9);var e=[0,[0,b,u],Nj(C,t)];continue;default:break x}}var I=PX(t);return[0,tx(u),I]}var F=y4(x);if(F[0]===0)var M=mn,Y=F[1];else var M=F[2],Y=F[1];L(x)!==7&&J(x,9);var e=[0,[0,[0,Y],u],Nj(M,t)]}}]),Rr(Cj,[0,function(x){return function(r){x:if(typeof r=="number"){if(62<=r){var e=r-63|0;if(49>=e>>>0){var t=e-15|0;if(9>>0)break x;switch(t){case 0:case 1:case 3:case 9:break;default:break x}}}else if(7<=r){if(r!==56)break x}else if(5>r)break x;return 0}throw K0(Bt,1)}},function(x){var r=L(x);if(typeof r=="number"&&!r){var e=p(X0[16],1,x);return[0,[0,e[1]],e[2]]}return[0,[1,d(X0[10],x)],0]}]),Rr(MX,[0,function(x,r){for(var e=x;;){var t=L(r);if(typeof t=="number"&&t===9){T0(r);var e=[0,Yt(r),e];continue}return[29,[0,tx(e),0]]}}]);function ST0(x){var r=i0(x);T0(x);var e=x0([0,r],0,O),t=jj(x),u=d1(x)?f4(x):kh(x);return[0,p(u[2],t,function(i,c){return p(Xx(i,nn,94),i,c)}),e]}function Uj(x){if(!x[28][4])return 0;for(var r=0;;){var e=L(x);if(typeof e=="number"&&e===13){var r=[0,r0(0,ST0,x),r];continue}return tx(r)}}function oo(x,r){var e=x?x[1]:0,t=i0(r),u=L(r);if(typeof u=="number")switch(u){case 6:var i=r0(0,function(s0){var l0=i0(s0);J(s0,6);var w0=n4(0,s0),L0=d(X0[10],w0);return J(s0,7),[0,L0,x0([0,l0],[0,q0(s0)],O)]},r),c=i[1];return[0,c,[5,[0,c,i[2]]]];case 14:if(!e){var v=r0(0,function(s0){return T0(s0),[3,a1(s0)]},r),a=v[1],l=v[2];return B0(r,[0,a,64]),[0,a,l]}var m=DU(r),h=r[30][1],T=m[2][1],b=m[1];if(h){var N=h[1],C=h[2],I=N[2],F=[0,[0,N1[4].call(null,T,N[1]),I],C];r[30][1]=F}else bx(is0);return[0,b,[4,m]]}else switch(u[0]){case 0:var M=u[2],Y=u[1],q=G0(r),K=Dj(r,Y,M);return[0,q,[1,[0,q,[0,K,M,x0([0,t],[0,q0(r)],O)]]]];case 1:var u0=u[2],Q=u[1],e0=G0(r),f0=Fj(r,Q,u0);return[0,e0,[2,[0,e0,[0,f0,u0,x0([0,t],[0,q0(r)],O)]]]];case 2:var a0=u[1],Z=a0[4],v0=a0[3],t0=a0[2],y0=a0[1];return Z&&Ne(r,77),J(r,[2,[0,y0,t0,v0,Z]]),[0,y0,[0,[0,y0,[0,t0,v0,x0([0,t],[0,q0(r)],O)]]]]}var n0=a1(r);return[0,n0[1],[3,n0]]}function jh(x,r,e){var t=0,u=Mv(x),i=u[1],c=u[2],v=oo([0,r],x),a=v[1],l=Tn(x,v[2]);return[0,l,r0(0,function(m){var h=Iv(1,m),T=r0(0,function(q){var K=ml(0,0)(q),u0=0,Q=L(q)===87?K:c4(q,K);x:if(e){var e0=Q[2];r:{if(!e0[1]){if(!e0[2]&&!e0[3])break r;B0(q,[0,a,23]);break x}B0(q,[0,a,24])}}else{var f0=Q[2];r:if(f0[1])B0(q,[0,a,67]);else{var a0=f0[2];if(a0&&!a0[2]&&!f0[3])break r;f0[3]?B0(q,[0,a,66]):B0(q,[0,a,66])}}return[0,u0,Q,vl(q,Tj(q))]},h),b=T[2],N=b[2],C=b[3],I=b[1],F=T[1],M=k4(h,t,i,0,Dv(N)),Y=M[1];return kl(h,M[2],0,N),[0,0,N,Y,t,i,1,0,C,I,x0([0,c],0,O),F]},x)]}function tY(x){var r=y4(x);return r[0]===0?[0,r[1],mn]:[0,r[1],r[2]]}function nY(x,r){switch(r[0]){case 0:var e=r[1],t=e[1],u=e[2];return B0(x,[0,t,47]),[0,t,[14,u]];case 1:var i=r[1],c=i[1],v=i[2];return B0(x,[0,c,47]),[0,c,[17,v]];case 2:var a=r[1],l=a[1],m=a[2];return B0(x,[0,l,47]),[0,l,[18,m]];case 3:var h=r[1],T=h[2][1],b=h[1];return ch(T)?B0(x,[0,b,96]):sl(T)&&pt(x,[0,b,81]),[0,b,[10,h]];case 4:return bx(Kl0);default:var N=r[1][2][1];return B0(x,[0,N[1],7]),N}}function uY(x,r,e){function t(i){var c=Iv(1,i),v=r0(0,function(C){var I=re(C,$e(C)),F=ml(x,r)(C),M=L(C)===87?F:c4(C,F);return[0,I,M,vl(C,Tj(C))]},c),a=v[2],l=a[2],m=a[3],h=a[1],T=v[1],b=k4(c,x,r,0,Dv(l)),N=b[1];return kl(c,b[2],0,l),[0,0,l,N,x,r,1,0,m,h,x0([0,e],0,O),T]}var u=0;return function(i){return r0(u,t,i)}}function iY(x){return J(x,87),tY(x)}function Xj(x,r,e,t,u,i){var c=r0([0,r],function(a){if(!t&&!u){var l=L(a);x:if(typeof l=="number"){if(87<=l){if(l!==99){if(88<=l)break x;var m=iY(a);return[0,[0,e,m[1],0],m[2]]}}else{if(l===83){if(e[0]===3)var h=e[1],T=G0(a),b=r0([0,h[1]],function(F){var M=i0(F);J(F,83);var Y=q0(F),q=p(X0[19],F,[0,h[1],[10,h]]),K=d(X0[10],F);return[4,[0,0,q,K,x0([0,M],[0,Y],O)]]},a),N=[0,b,[0,[0,[0,T,[26,D5(zl0)]],0],0]];else var N=iY(a);return[0,[0,e,N[1],1],N[2]]}if(10<=l)break x;switch(l){case 4:break;case 1:case 9:return[0,[0,e,nY(a,e),1],mn];default:break x}}var C=Tn(a,e);return[0,[1,C,uY(t,u,i)(a)],mn]}return[0,[0,e,nY(a,e),1],mn]}var I=Tn(a,e);return[0,[1,I,uY(t,u,i)(a)],mn]},x),v=c[2];return[0,[0,[0,c[1],v[1]]],v[2]]}function AT0(x){if(L(x)===12){var r=i0(x),e=r0(0,function(l0){return J(l0,12),tY(l0)},x),t=e[2],u=t[2],i=t[1],c=e[1];return[0,[1,[0,c,[0,i,x0([0,r],0,O)]]],u]}var v=G0(x),a=rr(1,x);x:{r:if(typeof a=="number"){if(87<=a){if(a!==99&&88<=a)break r}else if(a!==83){if(10<=a)break r;switch(a){case 1:case 4:case 9:break;default:break r}}var m=0,h=0;break x}var l=Ah(x),m=l[2],h=l[1]}var T=Mv(x),b=T[1],N=Lx(m,T[2]),C=L(x);if(!h&&!b&&typeof C!="number"&&C[0]===4){var I=C[3];if(!P(I,zo)){var F=i0(x),M=oo(0,x)[2],Y=L(x);x:if(typeof Y=="number"){if(87<=Y){if(Y!==99&&88<=Y)break x}else if(Y!==83){if(10<=Y)break x;switch(Y){case 1:case 4:case 9:break;default:break x}}return Xj(x,v,M,0,0,0)}Tn(x,M);var q=r0([0,v],function(l0){return jh(l0,0,1)},x),K=q[2],u0=K[2],Q=K[1],e0=q[1];return[0,[0,[0,e0,[2,Q,u0,x0([0,F],0,O)]]],mn]}if(!P(I,S3)){var f0=i0(x),a0=oo(0,x)[2],Z=L(x);x:if(typeof Z=="number"){if(87<=Z){if(Z!==99&&88<=Z)break x}else if(Z!==83){if(10<=Z)break x;switch(Z){case 1:case 4:case 9:break;default:break x}}return Xj(x,v,a0,0,0,0)}Tn(x,a0);var v0=r0([0,v],function(l0){return jh(l0,0,0)},x),t0=v0[2],y0=t0[2],n0=t0[1],s0=v0[1];return[0,[0,[0,s0,[3,n0,y0,x0([0,f0],0,O)]]],mn]}}return Xj(x,v,oo(0,x)[2],h,b,N)}function Oh(x,r,e,t){var u=e[2][1],i=e[1];if(_r(u,Mo))return B0(x,[0,i,[15,u,0,ML===t?1:0,1]]),r;x:{r:{e:{for(var c=r;;){if(typeof c=="number")break r;if(c[0]===0)break e;var v=ux(u,c[2]),a=c[5],l=c[4],m=c[3];if(v===0)break;var h=0<=v?a:l,c=h}var b=[0,m];break x}var T=c[2];if(ux(u,c[1])===0){var b=[0,T];break x}var b=0;break x}var b=0}if(!b)return yh(u,t,r);var N=b[1];x:{r:if(typeof t=="number"){if(OA===t){if(typeof N!="number"||GI!==N)break r}else if(GI!==t||typeof N!="number"||OA!==N)break r;break x}B0(x,[0,i,[1,u]])}return yh(u,_R,r)}function fY(x,r){return r0(0,function(e){var t=r?i0(e):0;J(e,53);for(var u=0;;){var i=[0,r0(0,function(a){var l=Ts(a),m=L(a)===99?p(D2(a)[2],l,function(h,T){return p(Xx(h,O3,95),h,T)}):l;return[0,m,dX(a)]},e),u],c=L(e);if(typeof c=="number"&&c===9){J(e,9);var u=i;continue}var v=tx(i);return[0,v,x0([0,t],0,O)]}},x)}function Yj(x){switch(x[0]){case 0:case 3:var r=x[1];return[0,[0,r[1],r[2][1]]];default:return 0}}function zj(x,r){if(r)return B0(x,[0,r[1][1],Hs])}function Kj(x,r){if(r)return B0(x,[0,r[1],12])}function cY(x,r,e,t,u,i,c,v){var a=r0([0,r],function(C){var I=bj(C),F=L(C);x:if(i){if(typeof F=="number"&&F===83){Ux(C,13),T0(C);var M=0;break x}var M=0}else{if(typeof F=="number"&&F===83){T0(C);var Y=Iv(1,C),M=[0,d(X0[7],Y)];break x}var M=1}var q=L(C);x:{if(typeof q=="number"&&9>q)switch(q){case 8:T0(C);var K=L(C);r:{e:if(typeof K=="number"){if(K!==1&&kr!==K)break e;var u0=q0(C);break r}var u0=d1(C)?co(C):0}var v0=[0,t,I,M,u0];break x;case 4:case 6:p2(0,C);var v0=[0,t,I,M,0];break x}var Q=L(C);r:{e:if(typeof Q=="number"){if(Q!==1&&kr!==Q)break e;var e0=[0,,function(l0,w0){return l0}];break r}var e0=d1(C)?f4(C):kh(C)}if(typeof M=="number")if(I[0]===0)var f0=M,a0=I,Z=p(e0[2],t,function(s0,l0){return p(Xx(s0,tL,98),s0,l0)});else var f0=M,a0=[1,p(e0[2],I[1],function(s0,l0){return p(Xx(s0,hA,99),s0,l0)})],Z=t;else var f0=[0,p(e0[2],M[1],function(s0,l0){return p(Xx(s0,nn,y2),s0,l0)})],a0=I,Z=t;var v0=[0,Z,a0,f0,0]}var t0=v0[3],y0=v0[2],n0=v0[1];return[0,n0,y0,t0,x0([0,v],[0,v0[4]],O)]},x),l=a[2],m=l[4],h=l[3],T=l[2],b=l[1],N=a[1];return b[0]===4?[2,[0,N,[0,b[1],h,T,u,c,e,m]]]:[1,[0,N,[0,b,h,T,u,c,e,m]]]}function Jj(x,r,e,t,u,i,c,v,a,l){for(;;){var m=L(x);x:if(typeof m=="number"){var h=m-1|0;if(7>>0){var T=h-82|0;if(4>>0)break x;switch(T){case 3:p2(0,x),T0(x);continue;case 0:case 4:break;default:break x}}else if(5>=h-1>>>0)break x;if(!u&&!i)return cY(x,r,e,t,c,v,a,l)}var b=L(x);x:{if(typeof b=="number"&&(b===4||b===99)){var N=0;break x}var N=ol(x)?1:0}if(N)return cY(x,r,e,t,c,v,a,l);Kj(x,v),zj(x,a);var C=Yj(t);x:{if(c){if(C){var I=C[1],F=I[1];if(!P(I[2],Xa)){B0(x,[0,F,[15,Ll0,c,1,0]]);var q=Iv(1,x),K=1;break x}}}else if(C){var M=C[1],Y=M[1];if(!P(M[2],Mo)){u&&B0(x,[0,Y,9]),i&&B0(x,[0,Y,10]);var q=Iv(2,x),K=0;break x}}var q=Iv(1,x),K=1}var u0=Tn(q,t),Q=r0(0,function(f0){var a0=r0(0,function(w0){var L0=re(w0,$e(w0)),I0=ml(u,i)(w0),j0=L(w0)===87?I0:c4(w0,I0),S0=j0[2],W0=S0[1];x:{if(W0){var A0=W0[1][1],J0=j0[1];if(K===0){B0(w0,[0,A0,88]);var b0=[0,J0,[0,0,S0[2],S0[3],S0[4]]];break x}}var b0=j0}return[0,L0,b0,vl(w0,Tj(w0))]},f0),Z=a0[2],v0=Z[2],t0=Z[3],y0=Z[1],n0=a0[1],s0=k4(f0,u,i,0,Dv(v0)),l0=s0[1];return kl(f0,s0[2],0,v0),[0,0,v0,l0,u,i,1,0,t0,y0,0,n0]},q),e0=[0,K,u0,Q,c,e,x0([0,l],0,O)];return[0,[0,Vr(r,Q[1]),e0]]}}function Gj(x,r){var e=rr(x,r);x:if(typeof e=="number"){if(87<=e){if(e!==99&&88<=e)break x}else if(e!==83){if(9<=e)break x;switch(e){case 1:case 4:case 8:break;default:break x}}return 1}return 0}var PT0=0;function IT0(x,r,e,t){var u=G0(x),i=L(x);x:{if(typeof i=="number")switch(i){case 104:var c=i0(x);T0(x);var l=[0,[0,u,[0,0,x0([0,c],0,O)]]];break x;case 105:var v=i0(x);T0(x);var l=[0,[0,u,[0,1,x0([0,v],0,O)]]];break x}else if(i[0]===4&&!P(i[3],ev)&&r){var a=i0(x);T0(x);var l=[0,[0,u,[0,2,x0([0,a],0,O)]]];break x}var l=0}x:if(l){var m=l[1][1];if(!e&&!t)break x;return B0(x,[0,m,Hs]),0}return l}var NT0=0;function sY(x){return Gj(NT0,x)}function CT0(x){var r=G0(x),e=Uj(x),t=L(x);x:{if(typeof t=="number"&&t===61&&!Gj(1,x)){var u=[0,G0(x)],i=i0(x);T0(x);var c=i,v=u;break x}var c=0,v=0}var a=L(x);x:if(typeof a=="number"&&2>=a+iR>>>0&&ka(1,x)){r:{if(typeof a=="number"){var l=a+iR|0;if(2>=l>>>0){switch(l){case 0:var m=XO;break;case 1:var m=l6;break;default:var m=Jl}var h=m;break r}}var h=bx(Ml0)}Ux(x,[24,h]),T0(x);break x}var T=L(x)===43?1:0;if(T){var b=rr(1,x);x:{r:if(typeof b=="number"){if(88<=b){if(b!==99&&kr!==b)break r}else{var N=b-9|0;if(77>>0){if(78>N)switch(N+9|0){case 1:case 4:case 8:break;default:break r}}else if(N!==74)break r}var C=0;break x}var C=1}var I=C}else var I=T;if(I){var F=i0(x);T0(x);var M=F}else var M=0;var Y=L(x)===65?1:0;if(Y)var q=1-Gj(1,x),K=q&&1-jv(1,x);else var K=Y;if(K){var u0=i0(x);T0(x);var Q=u0}else var Q=0;var e0=Mv(x),f0=e0[1],a0=e0[2],Z=ka(1,x),v0=Z||(rr(1,x)===6?1:0),t0=IT0(x,v0,K,f0);x:{if(!f0&&t0){var y0=Mv(x),n0=y0[2],s0=y0[1];break x}var n0=a0,s0=f0}var l0=F6([0,c,[0,M,[0,Q,[0,n0,0]]]]),w0=L(x);if(!K&&!s0&&typeof w0!="number"&&w0[0]===4){var L0=w0[3];if(!P(L0,zo)){var I0=i0(x),j0=oo(Bl0,x)[2];if(sY(x))return Jj(x,r,e,j0,K,s0,I,v,t0,l0);Kj(x,v),zj(x,t0),Tn(x,j0);var S0=Lx(l0,I0),W0=r0([0,r],function(Kx){return jh(Kx,1,1)},x),A0=W0[2],J0=A0[1],b0=A0[2],z=W0[1],C0=Yj(J0);x:if(I){if(C0){var V0=C0[1],N0=V0[1];if(!P(V0[2],Xa)){B0(x,[0,N0,[15,Yl0,I,0,0]]);break x}}}else if(C0){var rx=C0[1],xx=rx[1];if(!P(rx[2],Mo)){B0(x,[0,xx,8]);break x}}return[0,[0,z,[0,2,J0,b0,I,e,x0([0,S0],0,O)]]]}if(!P(L0,S3)){var nx=i0(x),mx=oo(ql0,x)[2];if(sY(x))return Jj(x,r,e,mx,K,s0,I,v,t0,l0);Kj(x,v),zj(x,t0),Tn(x,mx);var F0=Lx(l0,nx),px=r0([0,r],function(Kx){return jh(Kx,1,0)},x),dx=px[2],W=dx[1],g0=dx[2],B=px[1],h0=Yj(W);x:if(I){if(h0){var _0=h0[1],d0=_0[1];if(!P(_0[2],Xa)){B0(x,[0,d0,[15,Xl0,I,0,0]]);break x}}}else if(h0){var E0=h0[1],U=E0[1];if(!P(E0[2],Mo)){B0(x,[0,U,8]);break x}}return[0,[0,B,[0,3,W,g0,I,e,x0([0,F0],0,O)]]]}}return Jj(x,r,e,oo(Ul0,x)[2],K,s0,I,v,t0,l0)}function aY(x,r,e,t){var u=x?x[1]:0,i=la(1,r),c=Lx(u,Uj(i)),v=i0(i),a=L(i);x:if(typeof a!="number"&&a[0]===4&&!P(a[3],kA)){Ux(i,84),T0(i);break x}J(i,41);var l=ej(1,i),m=L(l);x:{r:if(e&&typeof m=="number"){if(53<=m){if(m!==99&&54<=m)break r}else if(m!==42&&m)break r;var T=0;break x}if(_n(i))var h=p(X0[13],0,l),T=[0,p(D2(i)[2],h,function(Q,e0){return p(Xx(Q,O3,cn),Q,e0)})];else{SU(i,Ol0);var T=[0,[0,G0(i),Dl0]]}}var b=$e(i);if(b)var N=b[1],C=[0,p(D2(i)[2],N,function(Q,e0){return p(Xx(Q,lT,se),Q,e0)})];else var C=0;var I=i0(i);if($r(i,42))var F=r0(0,function(Q){var e0=jj(xj(0,Q)),f0=L(Q)===99?p(D2(Q)[2],e0,function(Z,v0){return p(Xx(Z,nn,96),Z,v0)}):e0,a0=dX(Q);return[0,f0,a0,x0([0,I],0,O)]},i),M=F[1],Y=F[2],q=[0,[0,M,p(D2(i)[2],Y,function(Q,e0){return Q0(Xx(Q,-663447790,97),Q,M,e0)})]];else var q=0;if(L(i)===53){1-S2(i)&&Ux(i,K2);var K=[0,jU(i,fY(i,1))]}else var K=0;var u0=r0(0,function(Q){var e0=i0(Q);if(!$r(Q,0))return bn(Q,0),Rl0;Q[30][1]=[0,[0,N1[1],0],Q[30][1]];for(var f0=0,a0=PT0,Z=0;;){var v0=L(Q);if(typeof v0=="number"){var t0=v0-2|0;if(G1>>0){if(J1>=t0+1>>>0)break}else if(t0===6){J(Q,8);continue}}var y0=CT0(Q);switch(y0[0]){case 0:var n0=y0[1],s0=n0[2],l0=n0[1];switch(s0[1]){case 0:if(s0[4])var nx=a0,mx=f0;else{f0&&B0(Q,[0,l0,15]);var nx=a0,mx=1}break;case 1:var w0=s0[2],L0=w0[0]===4?Oh(Q,a0,w0[1],ML):a0,nx=L0,mx=f0;break;case 2:var I0=s0[2],j0=I0[0]===4?Oh(Q,a0,I0[1],OA):a0,nx=j0,mx=f0;break;default:var S0=s0[2],W0=S0[0]===4?Oh(Q,a0,S0[1],GI):a0,nx=W0,mx=f0}break;case 1:var A0=y0[1][2],J0=A0[4],b0=A0[1];switch(b0[0]){case 4:bx(Fl0);break;case 0:case 3:var z=b0[1],C0=z[2][1],V0=_r(C0,Mo),N0=z[1];if(V0)var xx=V0;else var rx=_r(C0,Xa),xx=rx&&J0;xx&&B0(Q,[0,N0,[15,C0,J0,0,0]]);break}var nx=a0,mx=f0;break;default:var nx=Oh(Q,a0,y0[1][2][1],_R),mx=f0}var f0=mx,a0=nx,Z=[0,y0,Z]}function F0(Kr,S){return R6(function(G){return 1-N1[3].call(null,G[1],Kr)},S)}var px=tx(Z),dx=Q[30][1];if(dx){var W=dx[1],g0=W[1];if(dx[2]){var B=dx[2],h0=F0(g0,W[2]),_0=D6(B),d0=_0[2],E0=_0[1],U=VM(B),Kx=[0,[0,E0,Lx(d0,h0)],U];Q[30][1]=Kx}else T1(function(Kr){return B0(Q,[0,Kr[2],[25,Kr[1]]])},F0(g0,W[2])),Q[30][1]=0}else bx(fs0);J(Q,1);var Ix=L(Q);x:{r:if(!t){if(typeof Ix=="number"&&(Ix===1||kr===Ix))break r;if(d1(Q)){var z0=co(Q);break x}var z0=0;break x}var z0=q0(Q)}return[0,px,x0([0,e0],[0,z0],O)]},i);return[0,T,u0,C,q,K,c,x0([0,v],0,O)]}function Dh(x,r){return r0(0,function(e){return[2,aY([0,r],e,e[7],0)]},x)}function jT0(x){return[7,aY(0,x,1,1)]}var OT0=0,oY=MU(X0);function vY(x){var r=m4(x);x:if(x[5])Ov(x,r[1]);else{var e=r[2];r:if(e[0]===27){var t=e[1],u=r[1];if(t[4])B0(x,[0,u,4]);else{if(!t[5])break r;B0(x,[0,u,22])}break x}}return r}function Fh(x,r){var e=r[4],t=r[3],u=r[2],i=r[1];e&&Ne(x,77);var c=i0(x);return J(x,[2,[0,i,u,t,e]]),[0,i,[0,u,t,x0([0,c],[0,q0(x)],O)]]}function o1(x,r,e){var t=x?x[1]:wv0,u=r?r[1]:1,i=L(e);if(typeof i=="number"){var c=i-2|0;if(G1>>0){if(J1>=c+1>>>0)return[1,[0,q0(e),function(a,l){return a}]]}else if(c===6){T0(e);var v=L(e);x:if(typeof v=="number"){if(v!==1&&kr!==v)break x;return[0,q0(e)]}return d1(e)?[0,co(e)]:_v0}}return d1(e)?[1,f4(e)]:(u&&p2([0,t],e),bv0)}function ha(x){var r=L(x);x:if(typeof r=="number"){if(r!==1&&kr!==r)break x;return[0,q0(x),function(e,t){return e}]}return d1(x)?f4(x):kh(x)}function Wj(x,r,e){var t=o1(0,0,r);if(t[0]===0)return[0,t[1],e];var u=t[1][2],i=tx(e);if(i)var c=i[2],v=tx([0,p(u,i[1],function(a,l){return Q0(Xx(a,634872468,66),a,x,l)}),c]);else var v=0;return[0,0,v]}var lY=[],pY=[],kY=[];function mY(x,r,e){var t=e[2][1],u=e[1];if(!(t&&!t[1][2][2]&&!t[2]))return B0(x,[0,u,r])}function Vj(x,r){if(!x[5]&&s4(r))return Ov(x,r[1])}function hY(x){var r=fo(x)?vY(x):d(X0[2],x),e=1-x[5],t=e&&s4(r);return t&&Ov(x,r[1]),r}function DT0(x){var r=i0(x);J(x,44);var e=hY(x);return[0,e,x0([0,r],0,O)]}function FT0(x){var r=i0(x);J(x,16);var e=Lx(r,i0(x));J(x,4);var t=d(X0[7],x);J(x,5);var u=hY(x),i=L(x)===44?[0,r0(0,DT0,x)]:0;return[28,[0,t,u,i,x0([0,e],0,O)]]}var RT0=0;function dY(x){return r0(RT0,FT0,x)}function LT0(x){var r=d(X0[7],x),e=o1(vv0,0,x);if(e[0]===0)var t=r,u=e[1];else var t=p(e[1][2],r,function(h,T){return p(Xx(h,nn,72),h,T)}),u=0;if(x[20]){var i=t[2];if(i[0]===14){var c=i[1][2];x:{if(1>>0){if(e!==14)break x}else if(4>=e-1>>>0)break x;return q0(x)}return d1(x)?co(x):0}function NY(x){return L(x)===1?0:[0,d(X0[7],x)]}function da(x){var r=G0(x),e=L(x);x:{if(typeof e!="number"&&e[0]===8){var t=e[1];break x}p2(bl0,x);var t=Tl0}var u=i0(x);T0(x);var i=L(x);x:{r:if(typeof i=="number"){var c=i+BR|0;if(73>>0){if(c!==77)break r}else if(71>=c-1>>>0)break r;var v=q0(x);break x}var v=Jh(x)}return[0,r,[0,t,x0([0,u],[0,v],O)]]}function CY(x){var r=rr(1,x);if(typeof r=="number"){if(r===10)for(var e=r0(0,function(u){var i=[0,da(u)];return J(u,10),[0,i,da(u)]},x);;){var t=L(x);if(typeof t=="number"&&t===10){let u=e;var e=r0([0,e[1]],function(c){return J(c,10),[0,[1,u],da(c)]},x);continue}return[2,e]}if(r===87)return[1,r0(0,function(u){var i=da(u);return J(u,87),[0,i,da(u)]},x)]}return[0,da(x)]}function T4(x,r){return _r(x[2][1],r[2][1])}function jY(x,r){var e=x[2],t=e[1],u=r[2],i=u[1],c=e[2],v=u[2];x:{if(t[0]===0){var a=t[1];if(i[0]===0){var m=T4(a,i[1]);break x}}else{var l=t[1];if(i[0]!==0){var m=jY(l,i[1]);break x}}var m=0}return m&&T4(c,v)}function Gh(x,r){switch(x[0]){case 0:var e=x[1];if(r[0]===0)return T4(e,r[1]);break;case 1:var t=x[1];if(r[0]===1){var u=t[2],i=r[1][2],c=u[2],v=i[2],a=T4(u[1],i[1]);return a&&T4(c,v)}break;default:var l=x[1];if(r[0]===2)return jY(l,r[1])}return 0}function Zj(x){switch(x[0]){case 0:return x[1][1];case 1:return x[1][1];default:return x[1][1]}}var Bv=[];function OY(x,r){var e=i0(r),t=r0(0,function(l0){J(l0,99);var w0=L(l0);if(typeof w0=="number"){if(y2===w0)return T0(l0),gl0}else if(w0[0]===8){var L0=CY(l0);x:{if(S2(l0)&&L(l0)===99&&vn!==rr(1,l0)){var I0=ph(l0,0,Oj);break x}var I0=0}for(var j0=0;;){var S0=L(l0);if(typeof S0=="number"){if(S0===0){var W0=i0(l0);V2(l0,0);var A0=r0(0,function(N0){J(N0,0),J(N0,12);var rx=d(X0[10],N0);return J(N0,1),rx},l0),J0=A0[2],b0=A0[1];H2(l0);var j0=[0,[1,[0,b0,[0,J0,x0([0,W0],[0,Jh(l0)],O)]]],j0];continue}}else if(S0[0]===8){var j0=[0,[0,r0(0,function(N0){var rx=rr(1,N0);x:{if(typeof rx=="number"&&rx===87){var xx=[1,r0(0,function(Ix){var z0=da(Ix);return J(Ix,87),[0,z0,da(Ix)]},N0)];break x}var xx=[0,da(N0)]}var nx=L(N0);x:{if(typeof nx=="number"&&nx===83){J(N0,83);var mx=i0(N0),F0=L(N0);r:{if(typeof F0=="number"){if(F0===0){var px=i0(N0);V2(N0,0);var dx=r0(0,function(z0){J(z0,0);var Kr=NY(z0);return J(z0,1),Kr},N0),W=dx[1],g0=dx[2];H2(N0);var B=[0,g0,j2([0,px],[0,Jh(N0)],0,O)];B[1]||B0(N0,[0,W,46]);var E0=[0,[1,[0,W,B]]];break r}}else if(F0[0]===10){var h0=F0[3],_0=F0[2],d0=F0[1];J(N0,F0);var E0=[0,[0,[0,d0,[0,_0,h0,x0([0,mx],[0,Jh(N0)],O)]]]];break r}Ux(N0,35);var E0=[0,[0,[0,G0(N0),_l0]]]}var U=E0;break x}var U=0}return[0,xx,U]},l0)],j0];continue}var z=tx(j0),C0=[0,Fa,[0,L0,I0,$r(l0,vn),z]];return $r(l0,y2)?[0,C0]:(bn(l0,y2),[1,C0])}}return bn(l0,y2),wl0},r);if(H2(r),d(Bv[3],t))var u=iE,i=r0(0,function(l0){return 0},r);else{V2(r,3);var c=d(Bv[4],t),v=Q0(Bv[1],x,c,r),u=v[2],i=v[1]}var a=q0(r);x:{r:if(typeof u!="number"){var l=u[1];if(Fa===l){var m=u[2],h=m[2][1],T=t[2],b=m[1];if(T[0]===0){var N=T[1];if(typeof N=="number")B0(r,[0,Zj(h),hl0]);else{var C=N[2][1];e:if(1-Gh(h,C)){if(x&&Gh(x[1],h)){var I=[21,d(Bv[2],C)];B0(r,[0,Zj(C),I]);break e}var F=[13,d(Bv[2],C)];B0(r,[0,Zj(h),F])}}}var M=b}else{if(un!==l)break r;var Y=u[2],q=t[2];if(q[0]===0){var K=q[1];typeof K!="number"&&B0(r,[0,Y,[13,d(Bv[2],K[2][1])]])}var M=Y}var u0=M;break x}var u0=t[1]}var Q=t[2][1],e0=t[1];if(typeof Q=="number"){x:{r:{var f0=x0([0,e],[0,a],O);if(typeof u!="number"){var a0=u[1];if(Fa===a0)var Z=u[2][1];else{if(un!==a0)break r;var Z=u[2]}var v0=Z;break x}}var v0=u0}var t0=[0,un,[0,e0,v0,i,f0]]}else{var y0=Q[2];x:{var n0=x0([0,e],[0,a],O);if(typeof u!="number"&&Fa===u[1]){var s0=[0,u[2]];break x}var s0=0}var t0=[0,Fa,[0,[0,e0,y0],s0,i,n0]]}return[0,Vr(t[1],u0),t0]}function DY(x,r){return V2(r,2),OY(x,r)}function XT0(x,r,e,t){for(var u=t;;){var i=cl(e);if(u&&r){var c=u[1],v=c[2],a=r[1],l=u[2];x:{if(v[0]===0){var m=v[1],h=m[2];if(h){var T=h[1][2][1],b=1-Gh(m[1][2][1],T);if(b){var N=Gh(a,T);break x}var N=b;break x}}var N=0}if(N){var C=c[2];x:{if(C[0]===0){var I=C[1],F=I[2];if(F){var M=F[1],Y=Vr(c[1],I[3][1]),q=[0,Fa,M],K=[0,Y,[0,[0,I[1],0,I[3],I[4]]]];break x}}var q=iE,K=c}return H2(e),[0,tx([0,K,l]),i,q]}}var u0=L(e);if(typeof u0=="number"){if(u0===99){V2(e,2);var Q=L(e),e0=rr(1,e);x:if(typeof Q=="number"&&Q===99&&typeof e0=="number"){if(vn!==e0&&kr!==e0)break x;var f0=r0(0,function(F0){J(F0,99),J(F0,vn);var px=L(F0);if(typeof px=="number"){if(y2===px)return T0(F0),un}else if(px[0]===8){var dx=CY(F0);return vh(F0,y2),[0,Fa,[0,dx]]}return bn(F0,y2),un},e),a0=f0[2],Z=f0[1],v0=typeof a0=="number"?[0,un,Z]:[0,Fa,[0,Z,a0[2]]],t0=e[24][1];r:{if(t0){var y0=t0[2];if(y0){var n0=y0[2];break r}}var n0=bx(xs0)}e[24][1]=n0;var s0=fl(e),l0=r4(e[25][1],s0);return e[26][1]=l0,[0,tx(u),i,v0]}var w0=OY(r,e),L0=w0[2],I0=w0[1],j0=un<=L0[1]?[0,I0,[1,L0[2]]]:[0,I0,[0,L0[2]]],u=[0,j0,u];continue}if(kr===u0)return p2(0,e),[0,tx(u),i,iE]}var S0=L(e);x:{if(typeof S0=="number"){if(S0===0){V2(e,0);var W0=r0(0,function(F0){J(F0,0);var px=L(F0);r:{if(typeof px=="number"&&px===12){var dx=i0(F0);J(F0,12);var W=d(X0[10],F0),h0=[3,[0,W,x0([0,dx],0,O)]];break r}var g0=NY(F0),B=g0?0:i0(F0),h0=[2,[0,g0,j2(0,0,B,O)]]}return J(F0,1),h0},e),A0=W0[2],J0=W0[1];H2(e);var xx=[0,J0,A0];break x}}else if(S0[0]===9){var b0=S0[3],z=S0[2],C0=S0[1];J(e,S0);var xx=[0,C0,[4,[0,z,b0]]];break x}var V0=DY(r,e),N0=V0[2],rx=V0[1],xx=un<=N0[1]?[0,rx,[1,N0[2]]]:[0,rx,[0,N0[2]]]}var u=[0,xx,u]}}function FY(x){switch(x[0]){case 0:return x[1][2][1];case 1:var r=x[1][2],e=r[1],t=Mx(dl0,r[2][2][1]);return Mx(e[2][1],t);default:var u=x[1][2],i=u[1],c=u[2],v=i[0]===0?i[1][2][1]:FY([2,i[1]]);return Mx(v,Mx(yl0,c[2][1]))}}Rr(Bv,[0,function(x,r,e){var t=G0(e),u=XT0(O,r,e,0),i=u[2],c=u[3],v=u[1],a=i?i[1]:t;return[0,[0,Vr(t,a),v],c]},FY,function(x){var r=x[2];if(r[0]!==0)return 1;var e=r[1];return typeof e=="number"?0:e[2][3]},function(x){var r=x[2][1];return typeof r=="number"?0:[0,r[2][1]]}]);function RY(x,r){var e=a1(r);return mh(x,r,e),e}var xO=[],LY=[],MY=[],qY=[];function YT0(x){var r=i0(x);J(x,60);var e=L(x)===8?q0(x):0,t=o1(0,0,x),u=t[0]===0?t[1]:t[1][1];return[5,[0,x0([0,r],[0,Lx(e,u)],O)]]}var zT0=0;function KT0(x){var r=i0(x);J(x,38);var e=t4(1,x),t=d(X0[2],e),u=1-x[5],i=u&&s4(t);i&&Ov(x,t[1]);var c=q0(x);J(x,26);var v=q0(x);J(x,4);var a=d(X0[7],x);J(x,5);var l=L(x)===8?q0(x):0,m=o1(0,gv0,x),h=m[0]===0?Lx(l,m[1]):m[1][1];return[18,[0,t,a,x0([0,r],[0,Lx(c,Lx(v,h))],O)]]}var JT0=0;function GT0(x){var r=i0(x);J(x,40);var e=x[19],t=e&&$r(x,66),u=Lx(r,i0(x));J(x,4);var i=x0([0,u],0,O),c=L(x);x:{if(typeof c=="number"&&c===65){var v=1;break x}var v=0}var a=n4(1,x),l=L(a);x:{if(typeof l=="number"){if(25<=l){if(30>l)switch(l+A3|0){case 0:var m=r0(0,TX,a),h=m[2],T=h[3],b=h[1],N=m[1],f0=T,a0=[0,[1,[0,N,[0,b,0,x0([0,h[2]],0,O)]]]];break x;case 3:var C=r0(0,EX,a),I=C[2],F=I[3],M=I[1],Y=C[1],f0=F,a0=[0,[1,[0,Y,[0,M,2,x0([0,I[2]],0,O)]]]];break x;case 4:if(rr(1,a)!==17){var q=r0(0,SX,a),K=q[2],u0=K[3],Q=K[1],e0=q[1],f0=u0,a0=[0,[1,[0,e0,[0,Q,1,x0([0,K[2]],0,O)]]]];break x}break}}else if(l===8){var f0=0,a0=0;break x}}var f0=0,a0=[0,[0,d(X0[8],a)]]}var Z=L(x);if(typeof Z=="number"){if(Z===17){if(!a0)throw K0([0,Ir,yv0],1);var v0=a0[1];if(v0[0]===0)var t0=[1,Ij(dv0,x,v0[1])];else{var y0=v0[1];mY(x,38,y0);var t0=[0,y0]}t?J(x,64):J(x,17);var n0=d(X0[7],x);J(x,5);var s0=t4(1,x),l0=d(X0[2],s0);return Vj(x,l0),[25,[0,t0,n0,l0,0,i]]}if(Z===64){if(!a0)throw K0([0,Ir,hv0],1);var w0=a0[1];if(w0[0]===0){var L0=Ij(mv0,x,w0[1]),I0=1-t,j0=I0&&v;x:if(j0){var S0=L0[2];if(S0[0]===2){var W0=S0[1][1],A0=W0[1];if(!P(W0[2][1],Ya)){B0(x,[0,A0,39]);break x}}}var J0=[1,L0]}else{var b0=w0[1];mY(x,39,b0);var J0=[0,b0]}J(x,64);var z=d(X0[10],x);J(x,5);var C0=t4(1,x),V0=d(X0[2],C0);return Vj(x,V0),[26,[0,J0,z,V0,t,i]]}}if(T1(function(g0){return B0(x,g0)},f0),t?J(x,64):J(x,8),a0)var N0=a0[1],rx=N0[0]===0?[0,[1,y1(x,N0[1])]]:[0,[0,N0[1]]],xx=rx;else var xx=0;var nx=L(x);x:{if(typeof nx=="number"&&nx===8){var mx=0;break x}var mx=[0,d(X0[7],x)]}J(x,8);var F0=L(x);x:{if(typeof F0=="number"&&F0===5){var px=0;break x}var px=[0,d(X0[7],x)]}J(x,5);var dx=t4(1,x),W=d(X0[2],dx);return Vj(x,W),[24,[0,xx,mx,px,W,i]]}var WT0=0;function VT0(x){1-x[11]&&Ux(x,27);var r=i0(x),e=G0(x);J(x,19);var t=L(x)===8?q0(x):0;x:{if(L(x)!==8&&!ol(x)){var u=[0,d(X0[7],x)];break x}var u=0}var i=Vr(e,G0(x)),c=o1(0,0,x);x:{if(c[0]===0)var v=c[1];else{var a=c[1],l=a[1];if(u){var m=[0,p(a[2],u[1],function(C,I){return p(Xx(C,nn,67),C,I)})],h=t;break x}var v=l}var m=u,h=Lx(t,v)}return[33,[0,m,x0([0,r],[0,h],O),i]]}var $T0=0;function QT0(x){var r=i0(x);J(x,20),J(x,4);var e=d(X0[7],x);J(x,5),J(x,0);for(var t=kv0;;){var u=t[2],i=t[1],c=L(x);x:if(typeof c=="number"){if(c!==1&&kr!==c)break x;var v=tx(u);J(x,1);var a=ha(x)[1],l=e[1];return[34,[0,e,v,x0([0,r],[0,a],O),l]]}let h=i;var m=oj(0,function(b){var N=i0(b),C=L(b);x:{if(typeof C=="number"&&C===37){h&&Ux(b,54),J(b,37);var I=q0(b),F=0;break x}J(b,34);var I=0,F=[0,d(X0[7],b)]}var M=h||(F===0?1:0);J(b,87);var Y=Lx(I,ha(b)[1]);function q(e0){x:if(typeof e0=="number"){var f0=e0-1|0;if(33>>0){if(f0!==36)break x}else if(31>=f0-1>>>0)break x;return 1}return 0}var K=1,u0=b[9]===1?b:[0,b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],K,b[10],b[11],b[12],b[13],b[14],b[15],b[16],b[17],b[18],b[19],b[20],b[21],b[22],b[23],b[24],b[25],b[26],b[27],b[28],b[29],b[30],b[31]],Q=p(X0[4],q,u0);return[0,[0,F,Q,x0([0,N],[0,Y],O)],M]},x),t=[0,m[2],[0,m[1],u]]}}var HT0=0;function ZT0(x){var r=i0(x),e=G0(x);J(x,23),d1(x)&&B0(x,[0,e,55]);var t=d(X0[7],x),u=o1(0,0,x);if(u[0]===0)var i=t,c=u[1];else var i=p(u[1][2],t,function(v,a){return p(Xx(v,nn,68),v,a)}),c=0;return[35,[0,i,x0([0,r],[0,c],O)]]}var xE0=0;function rE0(x){var r=i0(x);J(x,24);var e=d(X0[15],x),t=L(x)===35?p(D2(x)[2],e,function(b,N){var C=N[1];return[0,C,Q0(Xx(b,Jp,4),b,C,N[2])]}):e,u=L(x);x:{if(typeof u=="number"&&u===35){var i=[0,r0(0,function(N){var C=i0(N);J(N,35);var I=q0(N);if(L(N)===4){J(N,4);var F=[0,p(X0[18],N,68)];J(N,5);var M=F}else var M=0;var Y=d(X0[15],N),q=L(N)===39?Y:p(ha(N)[2],Y,function(K,u0){var Q=u0[1];return[0,Q,Q0(Xx(K,Jp,69),K,Q,u0[2])]});return[0,M,q,x0([0,C],[0,I],O)]},x)];break x}var i=0}var c=L(x);x:{if(typeof c=="number"&&c===39){J(x,39);var v=d(X0[15],x),a=v[1],l=v[2],m=[0,[0,a,p(ha(x)[2],l,function(N,C){return Q0(Xx(N,Jp,70),N,a,C)})]];break x}var m=0}var h=i===0?1:0,T=h&&(m===0?1:0);return T&&B0(x,[0,t[1],57]),[36,[0,t,i,m,x0([0,r],0,O)]]}var eE0=0;function tE0(x){var r=0,e=TX(x),t=e[3],u=e[2],i=Wj(r,x,e[1]),c=i[2],v=i[1];return T1(function(a){return B0(x,a)},t),[39,[0,c,r,x0([0,u],[0,v],O)]]}var nE0=0;function uE0(x){var r=2,e=EX(x),t=e[3],u=e[2],i=Wj(r,x,e[1]),c=i[2],v=i[1];return T1(function(a){return B0(x,a)},t),[39,[0,c,r,x0([0,u],[0,v],O)]]}var iE0=0;function fE0(x){var r=1,e=SX(x),t=e[3],u=e[2],i=Wj(r,x,e[1]),c=i[2],v=i[1];return T1(function(a){return B0(x,a)},t),[39,[0,c,r,x0([0,u],[0,v],O)]]}var cE0=0;function sE0(x){var r=i0(x);J(x,26);var e=Lx(r,i0(x));J(x,4);var t=d(X0[7],x);J(x,5);var u=t4(1,x),i=d(X0[2],u),c=1-x[5],v=c&&s4(i);return v&&Ov(x,i[1]),[40,[0,t,i,x0([0,e],0,O)]]}var aE0=0;function oE0(x){var r=i0(x),e=d(X0[7],x),t=L(x),u=e[2];if(u[0]===10&&typeof t=="number"&&t===87){var i=u[1],c=i[2][1],v=e[1];J(x,87),N1[3].call(null,c,x[3])&&B0(x,[0,v,[23,lv0,c]]);var a=x[31],l=x[30],m=x[29],h=x[28],T=x[27],b=x[26],N=x[25],C=x[24],I=x[23],F=x[22],M=x[21],Y=x[20],q=x[19],K=x[18],u0=x[17],Q=x[16],e0=x[15],f0=x[14],a0=x[13],Z=x[12],v0=x[11],t0=x[10],y0=x[9],n0=x[8],s0=x[7],l0=x[6],w0=x[5],L0=x[4],I0=N1[4].call(null,c,x[3]),j0=[0,x[1],x[2],I0,L0,w0,l0,s0,n0,y0,t0,v0,Z,a0,f0,e0,Q,u0,K,q,Y,M,F,I,C,N,b,T,h,m,l,a],S0=fo(j0)?vY(j0):d(X0[2],j0);return[31,[0,i,S0,x0([0,r],0,O)]]}var W0=o1(pv0,0,x);if(W0[0]===0)var A0=e,J0=W0[1];else var A0=p(W0[1][2],e,function(b0,z){return p(Xx(b0,nn,71),b0,z)}),J0=0;return[23,[0,A0,0,x0(0,[0,J0],O)]]}var vE0=0;function lE0(x){function r(e){var t=i0(e),u=d(X0[27],e),i=$r(e,16)?[0,d(X0[7],e)]:0;J(e,87);var c=d(X0[15],e),v=L(e);x:{r:if(typeof v=="number"){if(v!==1&&kr!==v)break r;break x}$r(e,9)}return[0,u,c,i,x0([0,t],[0,q0(e)],O)]}return r0(0,function(e){var t=i0(e);if(J(e,21),d1(e))throw K0(Bt,1);var u=Ch(e),i=d1(e),c=i||1-$r(e,0);if(c)throw K0(Bt,1);for(var v=0,a=FU(e,u);;){var l=L(e);x:if(typeof l=="number"){if(l!==1&&kr!==l)break x;var m=tx(v);return J(e,1),[32,[0,a,m,x0([0,t],[0,q0(e)],O)]]}var v=[0,r0(0,r,e),v]}},x)}function pE0(x,r){var e=x?x[1]:0;1-S2(r)&&Ux(r,ft);var t=rr(1,r);if(typeof t=="number")switch(t){case 25:return Yh(0,r);case 28:return Yh(2,r);case 29:return Yh(1,r);case 41:return r0(0,function(b){var N=i0(b);return J(b,61),[6,Qj(N,b)]},r);case 47:if(L(r)===51)return Mh(r);break;case 49:if(r[28][2])return r0(0,function(b){var N=i0(b);return J(b,61),[8,oY[1].call(null,[0,N],b)]},r);break;case 50:if(e)return SY(r);break;case 54:return r0(0,function(b){var N=i0(b);return J(b,61),[11,Uh(N,b)]},r);case 62:var u=L(r);return typeof u=="number"&&u===51&&e?Mh(r):r0(0,function(b){var N=i0(b);return J(b,61),[15,qh(N,b)]},r);case 63:return r0(0,function(b){var N=i0(b);return J(b,61),[16,Bh(Yo0,N,b)]},r);case 15:case 65:return _Y(r)}else if(t[0]===4){var i=t[3];if(P(i,Ks)){if(P(i,Ho)){if(!P(i,vR)){var c=G0(r),v=i0(r);J(r,61);var a=Lx(v,i0(r));return bs(r,Wo0),L(r)===10?r0([0,c],function(b){var N=i0(b);J(b,10);var C=i0(b);bs(b,$o0);var I=F6([0,a,[0,N,[0,C,[0,i0(b),0]]]]),F=Lv(b),M=o1(0,0,b);if(M[0]===0)var Y=M[1],q=F;else var Y=0,q=p(M[1][2],F,function(K,u0){return p(Xx(K,hA,88),K,u0)});return[13,[0,q,x0([0,I],[0,Y],O)]]},r):r0([0,c],d(pY[1],a),r)}if(!P(i,gT)){var l=G0(r),m=i0(r);J(r,61);var h=Lx(m,i0(r));return bs(r,Vo0),r0([0,l],d(kY[1],h),r)}}else if(r[28][1])return _Y(r)}else if(r[28][1])return r0(0,function(b){var N=i0(b);return J(b,61),[7,Hj(N,b)]},r)}if(!e)return d(X0[2],r);var T=L(r);return typeof T=="number"&&T===51?Mh(r):Yh(0,r)}var kE0=0;function BY(x,r,e){var t=kU(1,x),u=JN(xO[2],t,r,e,Jl0),i=u[4],c=u[3],v=u[2],a=kU(0,u[1]),l=tx(v);return T1(d(xO[1],a),l),[0,a,c,i]}function UY(x){var r=Uj(x),e=L(x);if(typeof e=="number"){var t=e-50|0;if(11>=t>>>0)switch(t){case 0:var u=mU(1,la(1,x)),i=i0(u),c=G0(u);J(u,50);var v=L(u);if(typeof v=="number"){if(54<=v){if(64>v)switch(v-54|0){case 0:return r0([0,c],function(T){1-S2(T)&&Ux(T,Pt);var b=0,N=r0(0,function(I){return Uh(b,I)},T),C=[0,N[1],[30,N[2]]];return[22,[0,[0,C],0,0,0,x0([0,i],0,O)]]},u);case 8:if(rr(1,u)!==0)return r0([0,c],function(T){1-S2(T)&&Ux(T,Pt);var b=rr(1,T);if(typeof b=="number"){if(b===49)return Ux(T,17),J(T,62),[22,[0,0,0,0,0,x0([0,i],0,O)]];if(K2===b){J(T,62);var N=G0(T);J(T,K2);var C=_4(T),I=C[1];return[22,[0,0,[0,[1,[0,N,0]]],[0,I],0,x0([0,i],[0,C[2]],O)]]}}var F=0,M=r0(0,function(q){return qh(F,q)},T),Y=[0,M[1],[37,M[2]]];return[22,[0,[0,Y],0,0,0,x0([0,i],0,O)]]},u);break;case 9:return r0([0,c],function(T){var b=r0(0,function(C){return Bh(0,0,C)},T),N=[0,b[1],[38,b[2]]];return[22,[0,[0,N],0,0,0,x0([0,i],0,O)]]},u)}}else if(v===37)return r0([0,c],function(T){var b=Lx(i,i0(T)),N=r0(0,function(u0){return J(u0,37)},T)[1],C=hU(1,T);x:{if(!fo(C)&&!ah(C)){if(u4(C)){var q=0,K=[0,Dh(C,r)];break x}if(L(C)===49){var q=0,K=[0,AX(0)(C)];break x}if(cj(C)){var q=0,K=[0,Pj(C)];break x}var I=d(X0[10],C),F=o1(0,0,C);if(F[0]===0)var M=F[1],Y=I;else var M=0,Y=p(F[1][2],I,function(e0,f0){return p(Xx(e0,nn,90),e0,f0)});var q=M,K=[1,Y];break x}var q=0,K=[0,m4(C)]}return[21,[0,N,K,x0([0,b],[0,q],O)]]},u)}if(u4(u))return r0([0,c],function(T){var b=Dh(T,r);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u);if(!fo(u)&&!ah(u)){if(typeof v=="number"){var a=v+A3|0;if(4>>0){if(a===24&&u[28][2])return r0([0,c],function(T){var b=p(X0[3],[0,r],T);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u)}else if(1>>0)return r0([0,c],function(T){var b=p(X0[3],[0,r],T);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u)}if(cj(u))return r0([0,c],function(T){var b=Pj(T);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u);if(typeof v=="number"&&K2===v)return r0([0,c],function(T){var b=G0(T);J(T,K2);var N=L(T);x:{if(typeof N!="number"&&N[0]===4&&!P(N[3],It)){T0(T);var C=[0,a1(T)];break x}var C=0}var I=_4(T),F=I[1];return[22,[0,0,[0,[1,[0,b,C]]],[0,F],1,x0([0,i],[0,I[2]],O)]]},u);var l=$r(u,62)?0:1;return $r(u,0)?r0([0,c],function(T){var b=TY(0,T,0);J(T,1);var N=L(T);x:{if(typeof N!="number"&&N[0]===4&&!P(N[3],k6)){var C=_4(T),I=C[2],F=C[1],q=dn(function(a0){var Z=a0[2];return[0,a0[1],[0,Z[1],Z[2],1,Z[4]]]},b),K=I,u0=[0,F];break x}EY(T,b);var M=o1(0,0,T),Y=M[0]===0?M[1]:M[1][1],q=b,K=Y,u0=0}return[22,[0,0,[0,[0,q]],u0,l,x0([0,i],[0,K],O)]]},u):(p2(rv0,u),p(X0[3],[0,r],u))}return r0([0,c],function(T){oh(T)(r);var b=m4(T);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u);case 1:oh(x)(r);var m=rr(1,x);x:{r:if(typeof m=="number"){if(m!==4&&m!==10)break r;var h=hl(x);break x}var h=Mh(x)}return h;case 11:if(rr(1,x)===50)return oh(x)(r),SY(x);break}}return Wh([0,r],x)}function XY(x,r){return Q0(LY[1],r,x,0)}function YY(x,r){var e=BY(r,x,function(i){return Wh(0,i)}),t=e[3],u=e[2];return[0,m1(function(i,c){return[0,c,i]},rO(x,e[1]),u),t]}function rO(x,r){return Q0(MY[1],r,x,0)}function Wh(x,r){var e=x?x[1]:0;1-u4(r)&&oh(r)(e);var t=L(r);if(typeof t=="number"){if(t===28)return r0(iE0,uE0,r);if(t===29)return r0(cE0,fE0,r)}if(!fo(r)&&!ah(r)){if(u4(r))return Dh(r,e);if(typeof t=="number"){var u=t-49|0;if(14>=u>>>0)switch(u){case 0:if(r[28][2])return AX(0)(r);break;case 5:if(!TU(1,r))return hl(r);var i=0,c=r0(0,function(T){return Uh(i,T)},r);return[0,c[1],[30,c[2]]];case 12:return pE0(0,r);case 13:if(ka(1,r)&&!bU(1,r)){var v=0,a=r0(0,function(T){return qh(v,T)},r);return[0,a[1],[37,a[2]]]}return d(X0[2],r);case 14:var l=rr(1,r);if(typeof l=="number"&&l===62){var m=0,h=r0(0,function(T){return Bh(zo0,m,T)},r);return[0,h[1],[38,h[2]]]}return d(X0[2],r)}}return cj(r)?Pj(r):zY(r)}return m4(r)}function zY(x){for(;;){var r=L(x);if(typeof r=="number"&&iv>r)switch(r){case 0:var e=d(X0[15],x),t=e[1],u=e[2];return[0,t,[0,p(ha(x)[2],u,function(t0,y0){return Q0(Xx(t0,Jp,76),t0,t,y0)})]];case 8:var i=G0(x),c=i0(x);return J(x,8),[0,i,[19,[0,x0([0,c],[0,ha(x)[1]],O)]]];case 16:return dY(x);case 19:return r0($T0,VT0,x);case 20:return r0(HT0,QT0,x);case 21:if(x[28][3]&&!jv(1,x)&&rr(1,x)===4){var v=lh(x,lE0);return v?v[1]:hl(x)}break;case 23:return r0(xE0,ZT0,x);case 24:return r0(eE0,rE0,x);case 25:return r0(nE0,tE0,x);case 26:return r0(aE0,sE0,x);case 27:var a=r0(0,function(t0){var y0=i0(t0);J(t0,27);var n0=Lx(y0,i0(t0));J(t0,4);var s0=d(X0[7],t0);J(t0,5);var l0=d(X0[2],t0),w0=1-t0[5],L0=w0&&s4(l0);return L0&&Ov(t0,l0[1]),[41,[0,s0,l0,x0([0,n0],0,O)]]},x),l=a[1],m=a[2];return pt(x,[0,l,75]),[0,l,m];case 33:var h=i0(x),T=r0(0,function(t0){J(t0,33);x:{if(L(t0)!==8&&!ol(t0)){var y0=p(X0[13],0,t0),n0=y0[2][1],s0=y0[1];1-N1[3].call(null,n0,t0[3])&&B0(t0,[0,s0,[29,n0]]);var l0=[0,y0];break x}var l0=0}var w0=o1(0,0,t0);x:{if(w0[0]===0)var L0=w0[1];else{var I0=w0[1],j0=I0[1];if(l0){var S0=[0,p(I0[2],l0[1],function(z,C0){return p(Xx(z,O3,74),z,C0)})],W0=0;break x}var L0=j0}var S0=l0,W0=L0}return[0,S0,W0]},x),b=T[2],N=b[1],C=T[1],I=N===0?1:0,F=b[2];if(I)var M=x[8],Y=M||x[9],q=1-Y;else var q=I;return q&&B0(x,[0,C,25]),[0,C,[1,[0,N,x0([0,h],[0,F],O)]]];case 36:var K=i0(x),u0=r0(0,function(t0){J(t0,36);x:{if(L(t0)!==8&&!ol(t0)){var y0=p(X0[13],0,t0),n0=y0[2][1],s0=y0[1];1-N1[3].call(null,n0,t0[3])&&B0(t0,[0,s0,[29,n0]]);var l0=[0,y0];break x}var l0=0}var w0=o1(0,0,t0);x:{if(w0[0]===0)var L0=w0[1];else{var I0=w0[1],j0=I0[1];if(l0){var S0=[0,p(I0[2],l0[1],function(z,C0){return p(Xx(z,O3,75),z,C0)})],W0=0;break x}var L0=j0}var S0=l0,W0=L0}return[0,S0,W0]},x),Q=u0[2],e0=u0[1],f0=Q[2],a0=Q[1];return 1-x[8]&&B0(x,[0,e0,26]),[0,e0,[4,[0,a0,x0([0,K],[0,f0],O)]]];case 38:return r0(JT0,KT0,x);case 40:return r0(WT0,GT0,x);case 44:return dY(x);case 60:return r0(zT0,YT0,x);case 114:return p2(Gl0,x),[0,G0(x),Wl0];case 1:case 5:case 7:case 9:case 10:case 11:case 12:case 17:case 18:case 34:case 35:case 37:case 39:case 42:case 43:case 50:case 84:case 87:p2(Vl0,x),T0(x);continue}if(!fo(x)&&!ah(x)){if(typeof r=="number"&&r===29&&rr(1,x)===6){var Z=al(1,x);return B0(x,[0,Vr(G0(x),Z),3]),hl(x)}return _n(x)?r0(vE0,oE0,x):(u4(x)&&(p2(0,x),T0(x)),hl(x))}var v0=m4(x);return Ov(x,v0[1]),v0}}Rr(xO,[0,function(x,r){if(typeof r!="number"&&r[0]===2){var e=r[1],t=e[4],u=e[1];return t&&pt(x,[0,u,77])}return bx(Mx(Ql0,Mx(OB(r),$l0)))},function(x,r,e,t){for(var u=x,i=t;;){var c=i[3],v=i[2],a=i[1],l=L(u);if(typeof l=="number"&&kr===l)return[0,u,a,v,c];if(d(r,l))return[0,u,a,v,c];if(typeof l!="number"&&l[0]===2){var m=d(e,u),h=[0,m,v],T=m[2];if(T[0]===23){var b=T[1][2];if(b){var N=_r(b[1],"use strict"),C=m[1],I=N&&1-u[21];I&&B0(u,[0,C,80]);var F=N?la(1,u):u,M=[0,l,a],Y=c||N,u=F,i=[0,M,h,Y];continue}}return[0,u,a,h,c]}return[0,u,a,v,c]}}]),Rr(LY,[0,function(x,r,e){for(var t=e;;){var u=L(x);if(typeof u=="number"&&kr===u||d(r,u))return tx(t);var t=[0,UY(x),t]}}]),Rr(MY,[0,function(x,r,e){for(var t=e;;){var u=L(x);if(typeof u=="number"&&kr===u||d(r,u))return tx(t);var t=[0,Wh(0,x),t]}}]),Rr(qY,[0,function(x,r,e){var t=1-x,u=RY([0,r],e),i=t&&(L(e)===86?1:0);return i&&(1-S2(e)&&Ux(e,F1),J(e,86)),[0,u,bj(e),i]}]),xB(e60[1],X0,[0,function(x){var r=L(x);x:{if(typeof r!="number"&&r[0]===6){var e=r[2],t=r[1];T0(x);var u=[0,[0,t,e]];break x}var u=0}var i=i0(x);x:{r:{for(var c=tx(i),v=5;c;){var a=c[2],l=c[1],m=l[2],h=l[1],T=m[2];e:{t:{for(var b=0,N=Cx(T);;){if(N<(b+5|0))break t;var C=_r(E1(T,b,v),"@flow");if(C)break;var b=b+1|0}var I=C;break e}var I=0}if(I)break r;var c=a}var F=0;break x}x[31][1]=h[3];var F=tx([0,[0,h,m],a])}x:if(F===0){if(i){var M=i[1],Y=M[2];if(!Y[1]){var q=Y[2],K=M[1];if(1<=Cx(q)&&q2(q,0)===42){x[31][1]=K[3];var u0=[0,M,0];break x}}}var u0=0}else var u0=F;function Q(n0){return 0}var e0=BY(x,Q,UY),f0=e0[2],a0=m1(function(n0,s0){return[0,s0,n0]},XY(Q,e0[1]),f0),Z=G0(x);if(J(x,kr),m1(function(n0,s0){var l0=s0[2];switch(l0[0]){case 21:return a4(x,n0,gn(0,[0,l0[1][1],Hl0]));case 22:var w0=l0[1],L0=w0[1];if(L0){if(!w0[2]){var I0=L0[1],j0=I0[2],S0=I0[1];x:{switch(j0[0]){case 39:return m1(function(z,C0){return a4(x,z,C0)},n0,m1(function(z,C0){return m1(pj,z,[0,C0[2][1],0])},0,j0[1][1]));case 2:case 27:var W0=j0[1][1];if(W0){var A0=W0[1];break x}break;case 3:case 20:case 30:case 37:case 38:var A0=j0[1][1];break x}return n0}return a4(x,n0,gn(0,[0,S0,A0[2][1]]))}}else{var J0=w0[2];if(J0){var b0=J0[1];return b0[0]===0?m1(function(z,C0){var V0=C0[2],N0=V0[2],rx=V0[1];return N0?a4(x,z,N0[1]):a4(x,z,rx)},n0,b0[1]):n0}}return n0;default:return n0}},N1[1],a0),a0)var v0=D6(tx(a0))[1],t0=Vr(D6(a0)[1],v0);else var t0=Z;var y0=tx(x[2][1]);return[0,t0,[0,a0,u,x0([0,u0],0,O),y0]]},zY,Wh,rO,YY,XY,function(x){var r=G0(x),e=Yt(x),t=L(x);return typeof t=="number"&&t===9?Rj(x,r,[0,e,0]):e},function(x){var r=G0(x),e=y4(x),t=L(x);return typeof t=="number"&&t===9?[0,Rj(x,r,[0,y1(x,e),0])]:e},function(x){return y1(x,BX(x))},Yt,jj,function(x){var r=r0(0,function(t){var u=i0(t);J(t,0);x:for(var i=0,c=[0,0,mn];;){var v=c[2],a=c[1],l=L(t);if(typeof l=="number"){if(l===1)break x;if(kr===l)break}var m=AT0(t),h=m[1],T=m[2];r:{if(h[0]===1&&L(t)===9){var b=[0,G0(t)];break r}var b=0}var N=Nj(T,v),C=L(t);r:{e:if(typeof C=="number"){var I=C-2|0;if(G1>>0){if(J1>>0)break e}else{if(I!==7)break e;T0(t)}var q=N;break r}var F=GC(Zc0,9),M=EU([0,F],L(t)),Y=[0,G0(t),M];$r(t,8);var q=[0,[0,Y,N[1]],[0,Y,N[2]]]}var i=b,c=[0,[0,h,a],q]}var K=i?[0,v[1],[0,[0,i[1],91],v[2]]]:v,u0=PX(K),Q=tx(a),e0=i0(t);return J(t,1),[0,[0,Q,j2([0,u],[0,q0(t)],e0,O)],u0]},x),e=r[2];return[0,r[1],e[1],e[2]]},RY,function(x,r,e){var t=r?r[1]:0;return r0(0,p(qY[1],t,e),x)},function(x){var r=G0(x),e=i0(x);J(x,0);var t=rO(function(v){return v===1?1:0},x),u=G0(x),i=t===0?i0(x):0;J(x,1);var c=[0,t,j2([0,e],[0,q0(x)],i,O)];return[0,Vr(r,u),c]},function(x){function r(t){var u=i0(t);J(t,0);var i=YY(function(h){return h===1?1:0},t),c=i[1],v=i[2],a=c===0?i0(t):0;J(t,1);var l=L(t);x:{r:if(!x){if(typeof l=="number"&&(l===1||kr===l))break r;if(d1(t)){var m=co(t);break x}var m=0;break x}var m=q0(t)}return[0,[0,c,j2([0,u],[0,m],a,O)],v]}var e=0;return function(t){return oj(e,r,t)}},function(x){return DY(kE0,x)},b4,zh,oo,Dh,function(x){return r0(OT0,jT0,x)},function(x){var r=x[2];switch(r[0]){case 24:var e=r[1],t=e[1][2][1];if(P(t,K1)){if(!P(t,nv)&&!P(e[2][2][1],Jm))return 0}else if(!P(e[2][2][1],Gl))return 0;break;case 0:case 10:case 23:case 26:break;default:return 0}return 1},Dj,Lv,Fj,Ph]);var eO=[i2,mb0,ks(0)],tO=[0,eO,[0]],mE0=T5(pb0,function(x){var r=NC(x,lb0)[42],e=DC(x,0,0,kb0,BC,1)[1];return Hq(x,r,function(t,u){return 0}),function(t,u){var i=E5(u,x);return d(e,i),FC(u,i,x)}}),hE0=[i2,B00,ks(0)];function dE0(x){if(typeof x=="number"){var r=x;if(57<=r)switch(r){case 57:return RH;case 58:return LH;case 59:return MH;case 60:return qH;case 61:return BH;case 62:return UH;case 63:return XH;case 64:return YH;case 65:return zH;case 66:return KH;case 67:return JH;case 68:return GH;case 69:return WH;case 70:return VH;case 71:return $H;case 72:return QH;case 73:return HH;case 74:return ZH;case 75:return xZ;case 76:return rZ;case 77:return eZ;case 78:return tZ;case 79:return nZ;case 80:return uZ;case 81:return iZ;case 82:return fZ;case 83:return cZ;case 84:return sZ;case 85:return aZ;case 86:return oZ;case 87:return vZ;case 88:return lZ;case 89:return pZ;case 90:return kZ;case 91:return mZ;case 92:return hZ;case 93:return dZ;case 94:return yZ;case 95:return gZ;case 96:return wZ;case 97:return _Z;case 98:return bZ;case 99:return TZ;case 100:return EZ;case 101:return SZ;case 102:return AZ;case 103:return PZ;case 104:return IZ;case 105:return NZ;case 106:return CZ;case 107:return jZ;case 108:return OZ;case 109:return DZ;case 110:return FZ;case 111:return RZ;case 112:return LZ;default:return MZ}switch(r){case 0:return CQ;case 1:return jQ;case 2:return OQ;case 3:return DQ;case 4:return FQ;case 5:return RQ;case 6:return LQ;case 7:return MQ;case 8:return qQ;case 9:return BQ;case 10:return UQ;case 11:return Mx(YQ,XQ);case 12:return zQ;case 13:return KQ;case 14:return JQ;case 15:return GQ;case 16:return WQ;case 17:return VQ;case 18:return $Q;case 19:return QQ;case 20:return HQ;case 21:return ZQ;case 22:return xH;case 23:return rH;case 24:return eH;case 25:return tH;case 26:return nH;case 27:return uH;case 28:return iH;case 29:return fH;case 30:return Mx(sH,cH);case 31:return aH;case 32:return oH;case 33:return vH;case 34:return lH;case 35:return pH;case 36:return kH;case 37:return mH;case 38:return hH;case 39:return dH;case 40:return yH;case 41:return gH;case 42:return wH;case 43:return _H;case 44:return bH;case 45:return TH;case 46:return EH;case 47:return SH;case 48:return AH;case 49:return PH;case 50:return IH;case 51:return NH;case 52:return CH;case 53:return jH;case 54:return OH;case 55:return DH;default:return FH}}switch(x[0]){case 0:var e=x[1];return d(sr(qZ),e);case 1:var t=x[1];return d(sr(BZ),t);case 2:var u=x[2],i=x[1];return p(sr(UZ),u,i);case 3:var c=x[2],v=x[1];return Q0(sr(XZ),c,c,v);case 4:var a=x[2],l=x[1];return p(sr(YZ),a,l);case 5:var m=x[1];return d(sr(zZ),m);case 6:return x[1]?KZ:JZ;case 7:var h=x[2],T=x[1],b=d(sr(GZ),T);if(!h)return d(sr(VZ),b);var N=h[1];return p(sr(WZ),N,b);case 8:var C=x[1];return p(sr($Z),C,C);case 9:var I=x[3],F=x[2],M=x[1];if(!F)return p(sr(ZZ),I,M);var Y=F[1];if(Y===3)return p(sr(HZ),I,M);switch(Y){case 0:var q=ZV;break;case 1:var q=x$;break;case 2:var q=r$;break;case 3:var q=e$;break;default:var q=t$}return JN(sr(QZ),M,q,I,q);case 10:var K=x[2],u0=x[1],Q=xq(K);return Q0(sr(x00),K,Q,u0);case 11:var e0=x[2],f0=x[1];return p(sr(r00),e0,f0);case 12:var a0=x[1];return d(sr(e00),a0);case 13:var Z=x[1];return d(sr(t00),Z);case 14:return x[1]?Mx(u00,n00):Mx(f00,i00);case 15:var v0=x[1],t0=x[4],y0=x[3],n0=x[2]?c00:s00,s0=y0?a00:o00,l0=t0?Mx(v00,v0):v0;return Q0(sr(l00),n0,s0,l0);case 16:return p00;case 17:var w0=x[2],L0=x[1],I0=eq(45,w0);if(I0)var j0=I0[1],S0=I0[2]?ZM(NQ,[0,j0,dn(xq,I0[2])]):j0;else var S0=w0;var W0=L0?k00:m00;return Q0(sr(h00),w0,S0,W0);case 18:var A0=x[1]?d00:y00;return d(sr(g00),A0);case 19:var J0=x[1];return d(sr(w00),J0);case 20:var b0=t6<=x[1]?_00:b00;return d(sr(T00),b0);case 21:var z=x[1];return d(sr(E00),z);case 22:var C0=x[1];return d(sr(S00),C0);case 23:var V0=x[2],N0=x[1];return p(sr(A00),N0,V0);case 24:var rx=x[1];if(Jl===rx)var xx=j00,nx=O00;else if(l6<=rx)var xx=P00,nx=I00;else var xx=N00,nx=C00;return p(sr(D00),nx,xx);case 25:var mx=x[1];return d(sr(F00),mx);case 26:var F0=x[1];return d(sr(R00),F0);case 27:var px=x[2],dx=x[1];return p(sr(L00),dx,px);case 28:var W=x[2],g0=x[1];return p(sr(M00),g0,W);default:var B=x[1];return d(sr(q00),B)}}function yE0(x,r){var e=x[2];function t(_){return A1(_,r)}var u=x[1];switch(e[0]){case 0:var i=e[1],c=j5(i[2],r),jx=[0,[0,i[1],c]];break;case 1:var v=e[1],a=t(v[2]),jx=[1,[0,v[1],a]];break;case 2:var l=e[1],m=t(l[7]),jx=[2,[0,l[1],l[2],l[3],l[4],l[5],l[6],m]];break;case 3:var h=e[1],T=h[7],b=t(h[6]),jx=[3,[0,h[1],h[2],h[3],h[4],h[5],b,T]];break;case 4:var N=e[1],C=t(N[2]),jx=[4,[0,N[1],C]];break;case 5:var jx=[5,[0,t(e[1][1])]];break;case 6:var I=e[1],F=t(I[7]),jx=[6,[0,I[1],I[2],I[3],I[4],I[5],I[6],F]];break;case 7:var M=e[1],Y=t(M[5]),jx=[7,[0,M[1],M[2],M[3],M[4],Y]];break;case 8:var q=e[1],K=t(q[3]),jx=[8,[0,q[1],q[2],K]];break;case 9:var u0=e[1],Q=t(u0[5]),jx=[9,[0,u0[1],u0[2],u0[3],u0[4],Q]];break;case 10:var e0=e[1],f0=t(e0[4]),jx=[10,[0,e0[1],e0[2],e0[3],f0]];break;case 11:var a0=e[1],Z=t(a0[5]),jx=[11,[0,a0[1],a0[2],a0[3],a0[4],Z]];break;case 12:var v0=e[1],t0=t(v0[3]),jx=[12,[0,v0[1],v0[2],t0]];break;case 13:var y0=e[1],n0=t(y0[2]),jx=[13,[0,y0[1],n0]];break;case 14:var s0=e[1],l0=t(s0[3]),jx=[14,[0,s0[1],s0[2],l0]];break;case 15:var w0=e[1],L0=t(w0[4]),jx=[15,[0,w0[1],w0[2],w0[3],L0]];break;case 16:var I0=e[1],j0=t(I0[5]),jx=[16,[0,I0[1],I0[2],I0[3],I0[4],j0]];break;case 17:var S0=e[1],W0=t(S0[4]),jx=[17,[0,S0[1],S0[2],S0[3],W0]];break;case 18:var A0=e[1],J0=t(A0[3]),jx=[18,[0,A0[1],A0[2],J0]];break;case 19:var jx=[19,[0,t(e[1][1])]];break;case 20:var b0=e[1],z=t(b0[3]),jx=[20,[0,b0[1],b0[2],z]];break;case 21:var C0=e[1],V0=t(C0[3]),jx=[21,[0,C0[1],C0[2],V0]];break;case 22:var N0=e[1],rx=t(N0[5]),jx=[22,[0,N0[1],N0[2],N0[3],N0[4],rx]];break;case 23:var xx=e[1],nx=t(xx[3]),jx=[23,[0,xx[1],xx[2],nx]];break;case 24:var mx=e[1],F0=t(mx[5]),jx=[24,[0,mx[1],mx[2],mx[3],mx[4],F0]];break;case 25:var px=e[1],dx=t(px[5]),jx=[25,[0,px[1],px[2],px[3],px[4],dx]];break;case 26:var W=e[1],g0=t(W[5]),jx=[26,[0,W[1],W[2],W[3],W[4],g0]];break;case 27:var B=e[1],h0=B[11],_0=t(B[10]),jx=[27,[0,B[1],B[2],B[3],B[4],B[5],B[6],B[7],B[8],B[9],_0,h0]];break;case 28:var d0=e[1],E0=t(d0[4]),jx=[28,[0,d0[1],d0[2],d0[3],E0]];break;case 29:var U=e[1],Kx=t(U[5]),jx=[29,[0,U[1],U[2],U[3],U[4],Kx]];break;case 30:var Ix=e[1],z0=t(Ix[5]),jx=[30,[0,Ix[1],Ix[2],Ix[3],Ix[4],z0]];break;case 31:var Kr=e[1],S=t(Kr[3]),jx=[31,[0,Kr[1],Kr[2],S]];break;case 32:var G=e[1],Z0=t(G[3]),jx=[32,[0,G[1],G[2],Z0]];break;case 33:var yx=e[1],Tx=yx[3],ex=t(yx[2]),jx=[33,[0,yx[1],ex,Tx]];break;case 34:var m0=e[1],Dx=m0[4],Ex=t(m0[3]),jx=[34,[0,m0[1],m0[2],Ex,Dx]];break;case 35:var qx=e[1],O0=t(qx[2]),jx=[35,[0,qx[1],O0]];break;case 36:var Wx=e[1],Yx=t(Wx[4]),jx=[36,[0,Wx[1],Wx[2],Wx[3],Yx]];break;case 37:var fx=e[1],Qx=t(fx[4]),jx=[37,[0,fx[1],fx[2],fx[3],Qx]];break;case 38:var vx=e[1],nr=t(vx[5]),jx=[38,[0,vx[1],vx[2],vx[3],vx[4],nr]];break;case 39:var gr=e[1],Nr=t(gr[3]),jx=[39,[0,gr[1],gr[2],Nr]];break;case 40:var s2=e[1],b2=t(s2[3]),jx=[40,[0,s2[1],s2[2],b2]];break;default:var k2=e[1],F2=t(k2[3]),jx=[41,[0,k2[1],k2[2],F2]]}return[0,u,jx]}var gE0=hv(tO)===i2?tO:tO[1];KN(FS,gE0);var ya=o0,C1=null,KY=void 0;function Vh(x){return 1-(x===KY?1:0)}ya.String,ya.RegExp,ya.Object,ya.Date,ya.Math;function wE0(x){throw x}function JY(x){return d(wE0,x)}ya.JSON;var _E0=ya.Array,bE0=ya.Error;hC(function(x){return x[1]===eO?[0,jt(x[2].toString())]:0}),hC(function(x){return x instanceof _E0?0:[0,jt(x.toString())]});var GY=[0,0];function Es(x){return xK(L6(x))}function $2(x){return iM(L6(x))}function pr(x,r){return $2(tx(p5(x,r)))}function gx(x,r){return r?d(x,r[1]):C1}function yl(x,r){return r[0]===0?C1:x(r[1])}function WY(x){return Es([0,[0,vb0,x[1]],[0,[0,ob0,x[2]],0]])}function VY(x){var r=x[1],e=r?Gx(r[1][1]):C1,t=[0,[0,cb0,WY(x[3])],0];return Es([0,[0,ab0,e],[0,[0,sb0,WY(x[2])],t]])}function _2(x){if(!x)return 0;var r=x[1],e=r[1];return x0([0,e],[0,Lx(r[3],r[2])],O)}var TE0=Gx;function gl(x,r,e){var t=r[e];return Vh(t)?t|0:x}function EE0(x,r){var e=Y3(r,KY)?{}:r,t=jt(x),u=gl(J3[6],e,db0),i=gl(J3[5],e,yb0),c=gl(J3[4],e,gb0),v=gl(J3[3],e,wb0),a=gl(J3[2],e,_b0),l=[0,gl(J3[1],e,bb0),a,v,c,i,u,0,0],m=e[GO],h=Vh(m),T=h&&m|0,b=e[gO],N=Vh(b)?b|0:1,C=e.all_comments,I=Vh(C)?C|0:1,F=[0,0],M=T?[0,function(X){return F[1]=[0,X,F[1]],0}]:0,Y=0,q=hb0[1];try{var K=0,u0=kB(t),Q=K,e0=u0}catch(X){var f0=B2(X);if(f0!==Qa)throw K0(f0,0);var a0=[0,[0,[0,Y,K3[2],K3[3]],48],0],Q=a0,e0=kB(cs0)}var Z=[0,Y,e0,X00,0,l[5],AB,Y00],v0=[0,r4(Z,0)],t0=[0,[0,Q],[0,0],N1[1],[0,0],l[6],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,[0,as0],[0,Z],v0,[0,M],l,Y,[0,0],[0,ss0]],y0=d(X0[1],t0),n0=tx(t0[1][1]),s0=tx(m1(function(X,A){var D=X[2],c0=X[1];return lj[3].call(null,A,c0)?[0,c0,D]:[0,lj[4].call(null,A,c0),[0,A,D]]},[0,lj[1],0],n0)[2]);if(s0){var l0=s0[2],w0=s0[1];if(q)throw K0([0,hE0,w0,l0],1)}GY[1]=0;var L0=Cx(t)-0|0,I0=Ct(t);x:{r:{for(var j0=0,S0=0;;){if(S0===L0)break r;var W0=ae(I0,S0);e:{if(0<=W0&&Xr>=W0){var A0=1;break e}if(CI<=W0&&dk>=W0){var A0=2;break e}if(qo<=W0&&Uy>=W0){var A0=3;break e}if(b3<=W0&&Go>=W0){var A0=4;break e}var A0=0}if(A0===0)var j0=vj(j0,S0,0),S0=S0+1|0;else{if((L0-S0|0)>>0)throw K0([0,Ir,$V],1);switch(J0){case 0:var z=ae(I0,S0);break;case 1:var z=(ae(I0,S0)&31)<<6|ae(I0,S0+1|0)&63;break;case 2:var z=(ae(I0,S0)&15)<<12|(ae(I0,S0+1|0)&63)<<6|ae(I0,S0+2|0)&63;break;default:var z=(ae(I0,S0)&7)<<18|(ae(I0,S0+1|0)&63)<<12|(ae(I0,S0+2|0)&63)<<6|ae(I0,S0+3|0)&63}var j0=vj(j0,S0,[0,z]),S0=b0}}var C0=vj(j0,S0,0);break x}var C0=j0}for(var V0=ko0,N0=tx([0,6,C0]);;){var rx=V0[3],xx=V0[2],nx=V0[1];if(!N0)break;var mx=N0[1];if(mx===5){var F0=N0[2];if(F0&&F0[1]===6){var px=F0[2],V0=[0,nx+2|0,0,[0,L6(tx([0,nx,xx])),rx]],N0=px;continue}}else if(6>mx){var dx=N0[2],V0=[0,nx+RU(mx)|0,[0,nx,xx],rx],N0=dx;continue}var W=N0[2],g0=[0,L6(tx([0,nx,xx])),rx],V0=[0,nx+RU(mx)|0,0,g0],N0=W}var B=L6(tx(rx));if(N)var _0=y0;else var h0=d(mE0[1],0),_0=p(Xx(h0,-201766268,F1),h0,y0);if(I)var E0=_0;else var d0=_0[2],E0=[0,_0[1],[0,d0[1],d0[2],d0[3],0]];function U(X,A,D,c0){var k0=[0,dh(B,A[3]),0],M0=[0,[0,t60,$2([0,dh(B,A[2]),k0])],0],$0=Lx(M0,[0,[0,n60,VY(A)],0]);if(D){var lx=D[1],Nx=lx[1];if(Nx){var Fx=lx[2];if(Fx)var ur=[0,[0,u60,Aa(Fx)],0],Jx=[0,[0,i60,Aa(Nx)],ur];else var Jx=[0,[0,f60,Aa(Nx)],0];var er=Jx}else var xr=lx[2],ar=xr?[0,[0,c60,Aa(xr)],0]:0,er=ar;var yr=er}else var yr=0;return Es(G3(Lx($0,Lx(yr,[0,[0,s60,Gx(X)],0])),c0))}function Kx(X){return pr(Ix,X)}function Ix(X){var A=X[2],D=X[1];switch(A[0]){case 0:return Yx([0,D,A[1]]);case 1:var c0=A[1],k0=c0[2];return U(h60,D,k0,[0,[0,m60,gx(m0,c0[1])],0]);case 2:return $(a50,[0,D,A[1]]);case 3:var M0=A[1],$0=M0[3],lx=M0[6],Nx=M0[5],Fx=M0[4],ur=M0[2],Jx=M0[1],xr=A1(_2($0[2][3]),lx),ar=[0,[0,eh0,gx(Q2,ur)],0],er=[0,[0,th0,ba(Fx)],ar],yr=$0[2],Cr=yr[2],Rx=yr[1];if(Cr)var Lr=Cr[1],Tr=Lr[2],e2=Tr[2],m2=Lr[1],h2=U(sh0,m2,e2,[0,[0,ch0,hr(Tr[1])],0]),Fr=$2(tx([0,h2,p5(wx,Rx)]));else var Fr=$2(dn(wx,Rx));var d2=[0,[0,uh0,m0(Jx)],[0,[0,nh0,Fr],er]];return U(fh0,D,xr,[0,[0,ih0,Yx(Nx)],d2]);case 4:var t2=A[1],Er=t2[2];return U(y60,D,Er,[0,[0,d60,gx(m0,t2[1])],0]);case 5:return U(g60,D,A[1][1],0);case 6:return vx([0,D,A[1]]);case 7:return nr([0,D,A[1]]);case 8:return b2([0,D,A[1]]);case 9:var Sr=A[1],a2=Sr[5],qr=Sr[4],Qr=Sr[3],z2=Sr[2],Mr=Sr[1];if(Qr){var n2=Qr[1];if(n2[0]!==0&&!n2[1][2])return U(_60,D,a2,[0,[0,w60,gx(T2,qr)],0])}if(z2){var o2=z2[1];switch(o2[0]){case 0:var f2=fx(o2[1]);break;case 1:var f2=Qx(o2[1]);break;case 2:var f2=vx(o2[1]);break;case 3:var f2=nr(o2[1]);break;case 4:var f2=dr(o2[1]);break;case 5:var f2=jx(o2[1]);break;case 6:var f2=_(1,o2[1]);break;case 7:var f2=Hx(o2[1]);break;default:var f2=b2(o2[1])}var N2=f2}else var N2=C1;var he=[0,[0,b60,gx(T2,qr)],0],ee=[0,[0,E60,N2],[0,[0,T60,F2(Qr)],he]],He=Mr?1:0;return U(A60,D,a2,[0,[0,S60,!!He],ee]);case 10:return Qx([0,D,A[1]]);case 11:var B1=A[1],u2=B1[5],te=B1[4],R2=B1[2],dt=B1[1],D1=[0,[0,Um0,pr(x2,B1[3])],0],yt=[0,[0,Xm0,An(0,te)],D1],Jt=[0,[0,Ym0,gx(Q2,R2)],yt];return U(Km0,D,u2,[0,[0,zm0,m0(dt)],Jt]);case 12:var Ze=A[1],xt=Ze[1],gt=Ze[3],wt=Ze[2],Ax=xt[0]===0?m0(xt[1]):T2(xt[1]);return U(N60,D,gt,[0,[0,I60,Ax],[0,[0,P60,Yx(wt)],0]]);case 13:var Z2=A[1],de=Z2[2];return U(j60,D,de,[0,[0,C60,me(Z2[1])],0]);case 14:var je=A[1],rt=je[3],et=je[2],tt=m0(je[1]);return U(F60,D,rt,[0,[0,D60,tt],[0,[0,O60,Yx(et)],0]]);case 15:var x1=A[1],_t=x1[4],bt=x1[2],Is=x1[1],Ns=[0,[0,$m0,dr(x1[3])],0],In=[0,[0,Qm0,gx(Q2,bt)],Ns];return U(Zm0,D,_t,[0,[0,Hm0,m0(Is)],In]);case 16:return _(1,[0,D,A[1]]);case 17:return fx([0,D,A[1]]);case 18:var v1=A[1],Gt=v1[3],U1=v1[1],Oe=[0,[0,R60,z0(v1[2])],0];return U(M60,D,Gt,[0,[0,L60,Ix(U1)],Oe]);case 19:return U(q60,D,A[1][1],0);case 20:var Wt=A[1],Cs=Wt[3],Nn=Wt[1],js=[0,[0,Hh0,Or(Wt[2])],0];return U(xd0,D,Cs,[0,[0,Zh0,m0(Nn)],js]);case 21:var nt=A[1],Vt=nt[2],Tt=nt[3],$t=Vt[0]===0?Ix(Vt[1]):z0(Vt[1]);return U(X60,D,Tt,[0,[0,U60,$t],[0,[0,B60,Gx(k2(1))],0]]);case 22:var De=A[1],Os=De[5],Ds=De[4],Kv=De[3],Eo=De[2],So=De[1];if(Eo){var Jv=Eo[1];if(Jv[0]!==0){var Gv=Jv[1][2],Wv=[0,[0,Y60,Gx(k2(Ds))],0],Vv=[0,[0,z60,gx(m0,Gv)],Wv];return U(J60,D,Os,[0,[0,K60,gx(T2,Kv)],Vv])}}var Ao=[0,[0,G60,Gx(k2(Ds))],0],Sl=[0,[0,W60,gx(T2,Kv)],Ao],Al=[0,[0,V60,F2(Eo)],Sl];return U(Q60,D,Os,[0,[0,$60,gx(Ix,So)],Al]);case 23:var Pa=A[1],Po=Pa[3],$v=Pa[1],Pl=[0,[0,H60,gx(TE0,Pa[2])],0];return U(x40,D,Po,[0,[0,Z60,z0($v)],Pl]);case 24:var Cn=A[1],Qv=Cn[5],Hv=Cn[3],Il=Cn[2],Io=Cn[1],Zv=[0,[0,r40,Ix(Cn[4])],0],x3=[0,[0,e40,gx(z0,Hv)],Zv],Ia=[0,[0,t40,gx(z0,Il)],x3];return U(u40,D,Qv,[0,[0,n40,gx(function(uO){return uO[0]===0?Qe(uO[1]):z0(uO[1])},Io)],Ia]);case 25:var Fs=A[1],Na=Fs[1],Nl=Fs[5],No=Fs[4],Co=Fs[3],r3=Fs[2],Cl=Na[0]===0?Qe(Na[1]):hr(Na[1]),jo=[0,[0,f40,Ix(Co)],[0,[0,i40,!!No],0]];return U(a40,D,Nl,[0,[0,s40,Cl],[0,[0,c40,z0(r3)],jo]]);case 26:var Rs=A[1],Oo=Rs[1],e3=Rs[5],Ca=Rs[4],t3=Rs[3],n3=Rs[2],u3=Oo[0]===0?Qe(Oo[1]):hr(Oo[1]),ye=[0,[0,v40,Ix(t3)],[0,[0,o40,!!Ca],0]];return U(k40,D,e3,[0,[0,p40,u3],[0,[0,l40,z0(n3)],ye]]);case 27:var X1=A[1],i3=X1[3],Do=X1[2],jl=X1[10],Ol=X1[9],Fo=X1[8],Ro=X1[7],Dl=X1[6],Fl=X1[5],xd=X1[4],Rl=Do[2][4],rd=X1[1],Qt=i3[0]===0?i3[1]:bx(y80),jn=A1(_2(Rl),jl);if(Dl===0)var Lo=0,C4=g80;else var Lo=[0,[0,T80,!!xd],[0,[0,b80,!!Fl],[0,[0,_80,gx(zv,Ro)],[0,[0,w80,!1],0]]]],C4=E80;var ja=[0,[0,S80,gx(Q2,Ol)],0],Ll=[0,[0,A80,Ur(Fo)],ja],ed=[0,[0,P80,Yx(Qt)],Ll],td=[0,[0,I80,sx(Do)],ed];return U(C4,D,jn,Lx([0,[0,N80,gx(m0,rd)],td],Lo));case 28:var f3=A[1],j4=f3[3],nd=f3[4],ud=f3[2],id=f3[1];if(j4)var Ml=j4[1][2],n=Ix(yE0(Ml[1],Ml[2]));else var n=C1;var s=[0,[0,h40,Ix(ud)],[0,[0,m40,n],0]];return U(y40,D,nd,[0,[0,d40,z0(id)],s]);case 29:var f=A[1],o=f[4],k=f[3],g=f[5],E=f[2],j=f[1];if(o){var R=o[1];if(R[0]===0)var R0=dn(function(iO){var fd=iO[3],cd=iO[2],HY=iO[1],AE0=cd?Vr(fd[1],cd[1][1]):fd[1],PE0=cd?cd[1]:fd;x:{r:{var IE0=0;if(HY){switch(HY[1]){case 0:var ZY=Yf;break;case 1:var ZY=Ws;break;default:break r}var xz=ZY;break x}}var xz=C1}var NE0=[0,[0,K_0,m0(PE0)],[0,[0,z_0,xz],IE0]];return U(G_0,AE0,0,[0,[0,J_0,m0(fd)],NE0])},R[1]);else var H=R[1],p0=H[1],R0=[0,U(Y_0,p0,0,[0,[0,X_0,m0(H[2])],0]),0];var kx=R0}else var kx=0;if(k)var Bx=k[1][1],zx=[0,[0,B_0,m0(Bx)],0],wr=[0,U(U_0,Bx[1],0,zx),kx];else var wr=kx;switch(j){case 0:var Jr=g40;break;case 1:var Jr=w40;break;default:var Jr=_40}var Hr=[0,[0,T40,T2(E)],[0,[0,b40,Gx(Jr)],0]];return U(S40,D,g,[0,[0,E40,$2(wr)],Hr]);case 30:return Hx([0,D,A[1]]);case 31:var Vx=A[1],C2=Vx[3],r1=Vx[1],ne=[0,[0,A40,Ix(Vx[2])],0];return U(I40,D,C2,[0,[0,P40,m0(r1)],ne]);case 32:var Y1=A[1],ge=Y1[3],Fe=Y1[1],we=[0,[0,N40,pr(S,Y1[2])],0];return U(j40,D,ge,[0,[0,C40,z0(Fe)],we]);case 33:var ue=A[1],_e=ue[2];return U(D40,D,_e,[0,[0,O40,gx(z0,ue[1])],0]);case 34:var ut=A[1],be=ut[3],Ht=ut[1],Ls=[0,[0,F40,pr(O0,ut[2])],0];return U(L40,D,be,[0,[0,R40,z0(Ht)],Ls]);case 35:var On=A[1],Ms=On[2];return U(q40,D,Ms,[0,[0,M40,z0(On[1])],0]);case 36:var Et=A[1],qs=Et[4],c3=Et[2],s3=Et[1],a3=[0,[0,B40,gx(Yx,Et[3])],0],o3=[0,[0,U40,gx(Wx,c3)],a3];return U(Y40,D,qs,[0,[0,X40,Yx(s3)],o3]);case 37:return jx([0,D,A[1]]);case 38:return _(0,[0,D,A[1]]);case 39:return Qe([0,D,A[1]]);case 40:var Oa=A[1],_x=Oa[3],O4=Oa[1],hx=[0,[0,z40,Ix(Oa[2])],0];return U(J40,D,_x,[0,[0,K40,z0(O4)],hx]);default:var D4=A[1],nO=D4[3],ax=D4[1],SE0=[0,[0,G40,Ix(D4[2])],0];return U(V40,D,nO,[0,[0,W40,z0(ax)],SE0])}}function z0(X){var A=X[2],D=X[1];switch(A[0]){case 0:var c0=A[1],k0=c0[2],M0=[0,[0,$40,pr(zt,c0[1])],0];return U(Q40,D,_2(k0),M0);case 1:var $0=A[1],lx=$0[3],Nx=$0[2],Fx=$0[10],ur=$0[9],Jx=$0[8],xr=$0[7],ar=$0[4],er=Nx[2][4];if(lx[0]===0)var yr=0,Cr=Yx(lx[1]);else var yr=1,Cr=z0(lx[1]);var Rx=A1(_2(er),Fx),Lr=[0,[0,H40,gx(Q2,ur)],0],Tr=[0,[0,xp0,!!yr],[0,[0,Z40,Ur(Jx)],Lr]],e2=[0,[0,np0,Cr],[0,[0,tp0,!!ar],[0,[0,ep0,!1],[0,[0,rp0,gx(zv,xr)],Tr]]]];return U(fp0,D,Rx,[0,[0,ip0,C1],[0,[0,up0,sx(Nx)],e2]]);case 2:var m2=A[1],h2=m2[2];return U(sp0,D,h2,[0,[0,cp0,z0(m2[1])],0]);case 3:var Fr=A[1],d2=Fr[3],t2=Fr[1],Er=[0,[0,ap0,dr(Fr[2][2])],0];return U(vp0,D,d2,[0,[0,op0,z0(t2)],Er]);case 4:var Sr=A[1],a2=Sr[1],qr=Sr[4],Qr=Sr[3],z2=Sr[2];if(a2){switch(a2[1]){case 0:var Mr=rQ;break;case 1:var Mr=eQ;break;case 2:var Mr=tQ;break;case 3:var Mr=nQ;break;case 4:var Mr=uQ;break;case 5:var Mr=iQ;break;case 6:var Mr=fQ;break;case 7:var Mr=cQ;break;case 8:var Mr=sQ;break;case 9:var Mr=aQ;break;case 10:var Mr=oQ;break;case 11:var Mr=vQ;break;case 12:var Mr=lQ;break;case 13:var Mr=pQ;break;default:var Mr=kQ}var n2=Mr}else var n2=lp0;var o2=[0,[0,pp0,z0(Qr)],0];return U(hp0,D,qr,[0,[0,mp0,Gx(n2)],[0,[0,kp0,hr(z2)],o2]]);case 5:var f2=A[1],N2=f2[4],he=f2[2],ee=f2[1],He=[0,[0,dp0,z0(f2[3])],0],B1=[0,[0,yp0,z0(he)],He];switch(ee){case 0:var u2=O$;break;case 1:var u2=D$;break;case 2:var u2=F$;break;case 3:var u2=R$;break;case 4:var u2=L$;break;case 5:var u2=M$;break;case 6:var u2=q$;break;case 7:var u2=B$;break;case 8:var u2=U$;break;case 9:var u2=X$;break;case 10:var u2=Y$;break;case 11:var u2=z$;break;case 12:var u2=K$;break;case 13:var u2=J$;break;case 14:var u2=G$;break;case 15:var u2=W$;break;case 16:var u2=V$;break;case 17:var u2=$$;break;case 18:var u2=Q$;break;case 19:var u2=H$;break;case 20:var u2=Z$;break;default:var u2=xQ}return U(wp0,D,N2,[0,[0,gp0,Gx(u2)],B1]);case 6:var te=A[1],R2=te[4],dt=A1(_2(te[3][2][2]),R2);return U(_p0,D,dt,bl(te));case 7:return $(o50,[0,D,A[1]]);case 8:var D1=A[1],yt=D1[4],Jt=D1[2],Ze=D1[1],xt=[0,[0,bp0,z0(D1[3])],0],gt=[0,[0,Tp0,z0(Jt)],xt];return U(Sp0,D,yt,[0,[0,Ep0,z0(Ze)],gt]);case 9:return ex([0,D,A[1]]);case 10:return m0(A[1]);case 11:var wt=A[1],Ax=wt[2];return U(Pp0,D,Ax,[0,[0,Ap0,z0(wt[1])],0]);case 12:return Ps([0,D,A[1]]);case 13:return go([0,D,A[1]]);case 14:return T2([0,D,A[1]]);case 15:return En([0,D,A[1]]);case 16:return Sn([0,D,A[1]]);case 17:return O1([0,D,A[1]]);case 18:return q1([0,D,A[1]]);case 19:var Z2=A[1],de=Z2[2],je=Z2[1],rt=Z2[4],et=Z2[3];try{var tt=new RegExp(Gx(je),Gx(de)),x1=tt}catch{var x1=C1}return U(wy0,D,rt,[0,[0,gy0,x1],[0,[0,yy0,Gx(et)],[0,[0,dy0,Es([0,[0,hy0,Gx(je)],[0,[0,my0,Gx(de)],0]])],0]]]);case 20:var _t=A[1];return T2([0,D,[0,_t[1],_t[6],_t[7]]]);case 21:var bt=A[1],Is=bt[4],Ns=bt[3],In=bt[2];switch(bt[1]){case 0:var v1=Ip0;break;case 1:var v1=Np0;break;default:var v1=Cp0}var Gt=[0,[0,jp0,z0(Ns)],0];return U(Fp0,D,Is,[0,[0,Dp0,Gx(v1)],[0,[0,Op0,z0(In)],Gt]]);case 22:var U1=A[1],Oe=U1[5],Wt=U1[1],Cs=[0,[0,Rp0,pr(Kr,U1[2])],0];return U(Mp0,D,Oe,[0,[0,Lp0,z0(Wt)],Cs]);case 23:var Nn=A[1],js=Nn[3];return U(qp0,D,js,Tl(Nn));case 24:var nt=A[1],Vt=nt[3],Tt=nt[1],$t=[0,[0,Bp0,m0(nt[2])],0];return U(Xp0,D,Vt,[0,[0,Up0,m0(Tt)],$t]);case 25:var De=A[1],Os=De[4],Ds=De[3],Kv=De[2],Eo=De[1];if(Ds)var So=Ds[1],Jv=A1(_2(So[2][2]),Os),Gv=Jv,Wv=qx(So);else var Gv=Os,Wv=$2(0);var Vv=[0,[0,zp0,gx(ho,Kv)],[0,[0,Yp0,Wv],0]];return U(Jp0,D,Gv,[0,[0,Kp0,z0(Eo)],Vv]);case 26:var Ao=A[1],Sl=Ao[2],Al=[0,[0,Gp0,pr(Y2,Ao[1])],0];return U(Wp0,D,_2(Sl),Al);case 27:var Pa=A[1],Po=Pa[1],$v=Pa[3],Pl=Po[4],Cn=A1(_2(Po[3][2][2]),Pl);return U($p0,D,Cn,Lx(bl(Po),[0,[0,Vp0,!!$v],0]));case 28:var Qv=A[1],Hv=Qv[1],Il=Hv[3],Io=[0,[0,Qp0,!!Qv[3]],0];return U(Hp0,D,Il,Lx(Tl(Hv),Io));case 29:var Zv=A[1],x3=Zv[2];return U(xk0,D,x3,[0,[0,Zp0,pr(z0,Zv[1])],0]);case 30:return U(rk0,D,A[1][1],0);case 31:var Ia=A[1],Fs=Ia[3],Na=Ia[1],Nl=[0,[0,Oy0,Ss(Ia[2])],0];return U(Fy0,D,Fs,[0,[0,Dy0,z0(Na)],Nl]);case 32:return Ss([0,D,A[1]]);case 33:return U(ek0,D,A[1][1],0);case 34:var No=A[1],Co=No[3],r3=No[1],Cl=[0,[0,tk0,me(No[2])],0];return U(uk0,D,Co,[0,[0,nk0,z0(r3)],Cl]);case 35:var jo=A[1],Rs=jo[3],Oo=jo[1],e3=[0,[0,ik0,dr(jo[2][2])],0];return U(ck0,D,Rs,[0,[0,fk0,z0(Oo)],e3]);case 36:var Ca=A[1],t3=Ca[3],n3=Ca[2],u3=Ca[1];if(7<=u3)return U(ak0,D,t3,[0,[0,sk0,z0(n3)],0]);switch(u3){case 0:var ye=ok0;break;case 1:var ye=vk0;break;case 2:var ye=lk0;break;case 3:var ye=pk0;break;case 4:var ye=kk0;break;case 5:var ye=mk0;break;case 6:var ye=hk0;break;default:var ye=bx(dk0)}return U(_k0,D,t3,[0,[0,wk0,Gx(ye)],[0,[0,gk0,!0],[0,[0,yk0,z0(n3)],0]]]);case 37:var X1=A[1],i3=X1[4],Do=X1[3],jl=X1[2],Ol=X1[1]?bk0:Tk0;return U(Pk0,D,i3,[0,[0,Ak0,Gx(Ol)],[0,[0,Sk0,z0(jl)],[0,[0,Ek0,!!Do],0]]]);default:var Fo=A[1],Ro=Fo[2],Dl=[0,[0,Ik0,!!Fo[3]],0];return U(Ck0,D,Ro,[0,[0,Nk0,gx(z0,Fo[1])],Dl])}}function Kr(X){var A=X[2],D=A[4],c0=A[2],k0=A[1],M0=X[1],$0=[0,[0,jk0,gx(z0,A[3])],0],lx=[0,[0,Ok0,z0(c0)],$0];return U(Fk0,M0,D,[0,[0,Dk0,G(k0)],lx])}function S(X){var A=X[2],D=A[4],c0=A[2],k0=A[1],M0=X[1],$0=[0,[0,Rk0,gx(z0,A[3])],0],lx=[0,[0,Lk0,Yx(c0)],$0];return U(qk0,M0,D,[0,[0,Mk0,G(k0)],lx])}function G(X){var A=X[2],D=X[1];function c0(qr){return U(Wk0,D,0,[0,[0,Gk0,qr],0])}switch(A[0]){case 0:return U(Vk0,D,A[1],0);case 1:return c0(O1([0,D,A[1]]));case 2:return c0(q1([0,D,A[1]]));case 3:return c0(T2([0,D,A[1]]));case 4:return c0(En([0,D,A[1]]));case 5:return c0(Sn([0,D,A[1]]));case 6:var k0=A[1],M0=k0[2],$0=k0[3],lx=k0[1]?$k0:Qk0,Nx=M0[2],Fx=M0[1],ur=Nx[0]===0?O1([0,Fx,Nx[1]]):q1([0,Fx,Nx[1]]);return U(x80,D,$0,[0,[0,Zk0,Gx(lx)],[0,[0,Hk0,ur],0]]);case 7:return yx([0,D,A[1]]);case 8:return Z0(A[1]);case 9:var Jx=function(qr){var Qr=qr[2],z2=Qr[2],Mr=Qr[1],n2=Qr[3],o2=qr[1],f2=0;switch(z2[0]){case 0:var N2=T2(z2[1]);break;case 1:var N2=O1(z2[1]);break;default:var N2=m0(z2[1])}var he=[0,[0,zk0,N2],f2],ee=Mr[0]===0?Z0(Mr[1]):Jx(Mr[1]);return U(Jk0,o2,n2,[0,[0,Kk0,ee],he])};return Jx(A[1]);case 10:var xr=A[1],ar=xr[3],er=xr[1],yr=[0,[0,r80,gx(Tx,xr[2])],0],Cr=[0,[0,e80,pr(function(qr){var Qr=qr[2],z2=Qr[1],Mr=Qr[4],n2=qr[1],o2=[0,[0,Bk0,!!Qr[3]],0],f2=[0,[0,Uk0,G(Qr[2])],o2];switch(z2[0]){case 0:var N2=T2(z2[1]);break;case 1:var N2=O1(z2[1]);break;default:var N2=m0(z2[1])}return U(Yk0,n2,Mr,[0,[0,Xk0,N2],f2])},er)],yr];return U(t80,D,_2(ar),Cr);case 11:var Rx=A[1],Lr=Rx[3],Tr=Rx[1],e2=[0,[0,n80,gx(Tx,Rx[2])],0],m2=[0,[0,u80,pr(function(qr){return G(qr[2])},Tr)],e2];return U(i80,D,_2(Lr),m2);case 12:var h2=A[1],Fr=h2[2];return U(c80,D,Fr,[0,[0,f80,pr(G,h2[1])],0]);default:var d2=A[1],t2=d2[2],Er=d2[3],Sr=d2[1],a2=t2[0]===0?m0(t2[1]):yx([0,t2[1],t2[2]]);return U(o80,D,Er,[0,[0,a80,G(Sr)],[0,[0,s80,a2],0]])}}function Z0(X){var A=X[1];return U(l80,A,0,[0,[0,v80,m0(X)],0])}function yx(X){var A=X[2],D=A[3],c0=A[2],k0=X[1],M0=[0,[0,p80,Gx(zC(A[1]))],0];return U(m80,k0,D,[0,[0,k80,m0(c0)],M0])}function Tx(X){var A=X[2],D=A[2],c0=X[1];return U(d80,c0,D,[0,[0,h80,gx(yx,A[1])],0])}function ex(X){var A=X[2],D=A[3],c0=A[2],k0=A[10],M0=A[9],$0=A[8],lx=A[7],Nx=A[5],Fx=A[4],ur=c0[2][4],Jx=A[1],xr=X[1],ar=D[0]===0?D[1]:bx(C80),er=A1(_2(ur),k0),yr=[0,[0,j80,gx(Q2,M0)],0],Cr=[0,[0,D80,!1],[0,[0,O80,Ur($0)],yr]],Rx=[0,[0,L80,!!Fx],[0,[0,R80,!!Nx],[0,[0,F80,gx(zv,lx)],Cr]]],Lr=[0,[0,M80,Yx(ar)],Rx],Tr=[0,[0,q80,sx(c0)],Lr];return U(U80,xr,er,[0,[0,B80,gx(m0,Jx)],Tr])}function m0(X){var A=X[2];return U(K80,X[1],A[2],[0,[0,z80,Gx(A[1])],[0,[0,Y80,C1],[0,[0,X80,!1],0]]])}function Dx(X){var A=X[2];return U(V80,X[1],A[2],[0,[0,W80,Gx(A[1])],[0,[0,G80,C1],[0,[0,J80,!1],0]]])}function Ex(X,A){var D=A[1][2],c0=D[2],k0=D[1],M0=[0,[0,$80,!!A[3]],0];return U(Z80,X,c0,[0,[0,H80,Gx(k0)],[0,[0,Q80,yl(me,A[2])],M0]])}function qx(X){return pr(kt,X[2][1])}function O0(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,xm0,pr(Ix,A[2])],0];return U(em0,k0,D,[0,[0,rm0,gx(z0,c0)],M0])}function Wx(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,tm0,Yx(A[2])],0];return U(um0,k0,D,[0,[0,nm0,gx(hr,c0)],M0])}function Yx(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,im0,Kx(A[1])],0];return U(fm0,c0,_2(D),k0)}function fx(X){var A=X[2],D=A[2],c0=A[1],k0=A[4],M0=A[3],$0=X[1],lx=Vr(c0[1],D[1]),Nx=[0,[0,cm0,Gx(zC(M0))],0];return U(am0,$0,k0,[0,[0,sm0,Ex(lx,[0,c0,[1,D],0])],Nx])}function Qx(X){var A=X[2],D=A[2],c0=A[1],k0=A[4],M0=A[3],$0=X[1],lx=Vr(c0[1],D[1]),Nx=D[2][2];x:{if(Nx[0]===12){var Fx=Nx[1][5];if(typeof Fx=="number"&&!Fx){var ur=0,Jx=om0;break x}}var ur=[0,[0,vm0,gx(zv,M0)],0],Jx=lm0}return U(Jx,$0,k0,Lx([0,[0,pm0,Ex(lx,[0,c0,[1,D],0])],0],ur))}function vx(X){var A=X[2],D=A[6],c0=A[4],k0=A[7],M0=A[5],$0=A[3],lx=A[2],Nx=A[1],Fx=X[1],ur=$2(c0?[0,x2(c0[1]),0]:0),Jx=D?pr(U0,D[1][2][1]):$2(0),xr=[0,[0,hm0,ur],[0,[0,mm0,Jx],[0,[0,km0,pr(x2,M0)],0]]],ar=[0,[0,dm0,An(0,$0)],xr],er=[0,[0,ym0,gx(Q2,lx)],ar];return U(wm0,Fx,k0,[0,[0,gm0,m0(Nx)],er])}function nr(X){var A=X[2],D=A[3],c0=X[1],k0=A[5],M0=A[4],$0=A[2],lx=A[1],Nx=A1(_2(D[2][3]),k0),Fx=D[2],ur=Fx[1],Jx=Fx[2],xr=[0,[0,_m0,gx(Q2,$0)],0],ar=[0,[0,bm0,ba(M0)],xr],er=[0,[0,Tm0,gr(ur)],ar],yr=[0,[0,Em0,gx(Nr,Jx)],er],Cr=[0,[0,Sm0,gr(ur)],yr];return U(Pm0,c0,Nx,[0,[0,Am0,m0(lx)],Cr])}function gr(X){return $2(dn(function(A){var D=A[2];return s2(0,D[3],A[1],[0,D[1]],D[2][2])},X))}function Nr(X){var A=X[2],D=A[4],c0=A[3],k0=A[2],M0=X[1];return s2(D,c0,M0,l5(function($0){return[0,$0]},A[1]),k0)}function s2(X,A,D,c0,k0){if(c0)var M0=c0[1],$0=M0[0]===0?gx(m0,[0,M0[1]]):gx(T2,[0,M0[1]]),lx=$0;else var lx=gx(m0,0);return U(Lm0,D,X,[0,[0,Rm0,lx],[0,[0,Fm0,dr(k0)],[0,[0,Dm0,!!A],0]]])}function b2(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,Mm0,Or(A[2])],0];return U(Bm0,k0,D,[0,[0,qm0,m0(c0)],M0])}function k2(X){return X?Jm0:Gm0}function F2(X){if(!X)return $2(0);var A=X[1];if(A[0]===0)return pr(E4,A[1]);var D=A[1],c0=D[2],k0=D[1];return $2(c0?[0,U(Vm0,k0,0,[0,[0,Wm0,m0(c0[1])],0]),0]:0)}function jx(X){var A=X[2],D=A[4],c0=A[2],k0=A[1],M0=X[1],$0=[0,[0,x50,dr(A[3])],0],lx=[0,[0,r50,gx(Q2,c0)],$0];return U(t50,M0,D,[0,[0,e50,m0(k0)],lx])}function _(X,A){var D=A[2],c0=D[5],k0=D[4],M0=D[3],$0=D[2],lx=D[1],Nx=A[1],Fx=X?n50:u50,ur=[0,[0,i50,gx(dr,k0)],0],Jx=[0,[0,f50,gx(dr,M0)],ur],xr=[0,[0,c50,gx(Q2,$0)],Jx];return U(Fx,Nx,c0,[0,[0,s50,m0(lx)],xr])}function $(X,A){var D=A[2],c0=D[7],k0=D[5],M0=D[4],$0=D[2],lx=D[6],Nx=D[3],Fx=D[1],ur=A[1];if(M0)var Jx=M0[1][2],xr=Jx[2],ar=Jx[1],er=A1(Jx[3],c0),yr=xr,Cr=[0,ar];else var er=c0,yr=0,Cr=0;if(k0)var Rx=k0[1][2],Lr=Rx[1],Tr=A1(Rx[2],er),e2=Tr,m2=pr(U0,Lr);else var e2=er,m2=$2(0);var h2=[0,[0,l50,m2],[0,[0,v50,pr(ix,lx)],0]],Fr=[0,[0,p50,gx(Pn,yr)],h2],d2=[0,[0,k50,gx(z0,Cr)],Fr],t2=[0,[0,m50,gx(Q2,Nx)],d2],Er=$0[2],Sr=Er[2],a2=$0[1],qr=[0,[0,h50,U(E50,a2,Sr,[0,[0,T50,pr(cx,Er[1])],0])],t2];return U(X,ur,e2,[0,[0,d50,gx(m0,Fx)],qr])}function ix(X){var A=X[2],D=A[2],c0=X[1];return U(g50,c0,D,[0,[0,y50,z0(A[1])],0])}function U0(X){var A=X[2],D=A[1],c0=X[1],k0=[0,[0,w50,gx(Pn,A[2])],0];return U(b50,c0,0,[0,[0,_50,m0(D)],k0])}function cx(X){switch(X[0]){case 0:var A=X[1],D=A[2],c0=D[6],k0=D[2],M0=D[5],$0=D[4],lx=D[3],Nx=D[1],Fx=A[1];switch(k0[0]){case 0:var ar=c0,er=0,yr=T2(k0[1]);break;case 1:var ar=c0,er=0,yr=O1(k0[1]);break;case 2:var ar=c0,er=0,yr=q1(k0[1]);break;case 3:var ar=c0,er=0,yr=m0(k0[1]);break;case 4:var ar=c0,er=0,yr=Dx(k0[1]);break;default:var ur=k0[1][2],Jx=ur[1],xr=A1(ur[2],c0),ar=xr,er=1,yr=z0(Jx)}switch(Nx){case 0:var Cr=S50;break;case 1:var Cr=A50;break;case 2:var Cr=P50;break;default:var Cr=I50}var Rx=[0,[0,O50,Gx(Cr)],[0,[0,j50,!!$0],[0,[0,C50,!!er],[0,[0,N50,pr(ix,M0)],0]]]];return U(R50,Fx,ar,[0,[0,F50,yr],[0,[0,D50,ex(lx)],Rx]]);case 1:var Lr=X[1],Tr=Lr[2],e2=Tr[7],m2=Tr[6],h2=Tr[2],Fr=Tr[1],d2=Tr[5],t2=Tr[4],Er=Tr[3],Sr=Lr[1];switch(Fr[0]){case 0:var Mr=e2,n2=0,o2=T2(Fr[1]);break;case 1:var Mr=e2,n2=0,o2=O1(Fr[1]);break;case 2:var Mr=e2,n2=0,o2=q1(Fr[1]);break;case 3:var Mr=e2,n2=0,o2=m0(Fr[1]);break;case 4:var a2=bx(J50),Mr=a2[3],n2=a2[2],o2=a2[1];break;default:var qr=Fr[1][2],Qr=qr[1],z2=A1(qr[2],e2),Mr=z2,n2=1,o2=z0(Qr)}if(typeof h2=="number")if(h2)var f2=0,N2=0;else var f2=1,N2=0;else var f2=0,N2=[0,h2[1]];var he=f2?[0,[0,G50,!!f2],0]:0,ee=m2===0?0:[0,[0,W50,pr(ix,m2)],0],He=Lx(ee,he),B1=[0,[0,Q50,!!n2],[0,[0,$50,!!t2],[0,[0,V50,gx(mt,d2)],0]]],u2=[0,[0,H50,yl(me,Er)],B1];return U(rh0,Sr,Mr,Lx([0,[0,xh0,o2],[0,[0,Z50,gx(z0,N2)],u2]],He));default:var te=X[1],R2=te[2],dt=R2[6],D1=R2[2],yt=R2[7],Jt=R2[5],Ze=R2[4],xt=R2[3],gt=R2[1],wt=te[1];if(typeof D1=="number")if(D1)var Ax=0,Z2=0;else var Ax=1,Z2=0;else var Ax=0,Z2=[0,D1[1]];var de=Ax?[0,[0,L50,!!Ax],0]:0,je=dt===0?0:[0,[0,M50,pr(ix,dt)],0],rt=Lx(je,de),et=[0,[0,U50,!1],[0,[0,B50,!!Ze],[0,[0,q50,gx(mt,Jt)],0]]],tt=[0,[0,X50,yl(me,xt)],et],x1=[0,[0,Y50,gx(z0,Z2)],tt];return U(K50,wt,yt,Lx([0,[0,z50,Dx(gt)],x1],rt))}}function wx(X){var A=X[2],D=A[3],c0=A[2],k0=A[1],M0=X[1],$0=A[4],lx=k0[0]===0?m0(k0[1]):T2(k0[1]);if(D)var Nx=[0,[0,ah0,z0(D[1])],0],Fx=U(vh0,M0,0,[0,[0,oh0,hr(c0)],Nx]);else var Fx=hr(c0);return U(mh0,M0,0,[0,[0,kh0,lx],[0,[0,ph0,Fx],[0,[0,lh0,!!$0],0]]])}function Or(X){var A=X[2],D=X[1];switch(A[0]){case 0:var c0=A[1],k0=c0[4],M0=[0,[0,Dh0,!!c0[2]],[0,[0,Oh0,!!c0[3]],0]],$0=[0,[0,Fh0,pr(function(Er){var Sr=Er[2],a2=Sr[1],qr=Er[1],Qr=[0,[0,Nh0,En(Sr[2])],0];return U(jh0,qr,0,[0,[0,Ch0,m0(a2)],Qr])},c0[1])],M0];return U(Rh0,D,_2(k0),$0);case 1:var lx=A[1],Nx=lx[4],Fx=[0,[0,Mh0,!!lx[2]],[0,[0,Lh0,!!lx[3]],0]],ur=[0,[0,qh0,pr(function(Er){var Sr=Er[2],a2=Sr[1],qr=Er[1],Qr=[0,[0,Ah0,O1(Sr[2])],0];return U(Ih0,qr,0,[0,[0,Ph0,m0(a2)],Qr])},lx[1])],Fx];return U(Bh0,D,_2(Nx),ur);case 2:var Jx=A[1],xr=Jx[1],ar=Jx[4],er=Jx[3],yr=Jx[2],Cr=xr[0]===0?dn(function(Er){var Sr=Er[1];return U(Sh0,Sr,0,[0,[0,Eh0,m0(Er[2][1])],0])},xr[1]):dn(function(Er){var Sr=Er[2],a2=Sr[1],qr=Er[1],Qr=[0,[0,_h0,T2(Sr[2])],0];return U(Th0,qr,0,[0,[0,bh0,m0(a2)],Qr])},xr[1]),Rx=[0,[0,Yh0,$2(Cr)],[0,[0,Xh0,!!yr],[0,[0,Uh0,!!er],0]]];return U(zh0,D,_2(ar),Rx);case 3:var Lr=A[1],Tr=Lr[3],e2=[0,[0,Kh0,!!Lr[2]],0],m2=[0,[0,Jh0,pr(function(Er){var Sr=Er[1];return U(wh0,Sr,0,[0,[0,gh0,m0(Er[2][1])],0])},Lr[1])],e2];return U(Gh0,D,_2(Tr),m2);default:var h2=A[1],Fr=h2[4],d2=[0,[0,Vh0,!!h2[2]],[0,[0,Wh0,!!h2[3]],0]],t2=[0,[0,$h0,pr(function(Er){var Sr=Er[2],a2=Sr[1],qr=Er[1],Qr=[0,[0,hh0,q1(Sr[2])],0];return U(yh0,qr,0,[0,[0,dh0,m0(a2)],Qr])},h2[1])],d2];return U(Qh0,D,_2(Fr),t2)}}function Hx(X){var A=X[2],D=A[5],c0=A[4],k0=A[2],M0=A[1],$0=X[1],lx=[0,[0,rd0,pr(x2,A[3])],0],Nx=[0,[0,ed0,An(0,c0)],lx],Fx=[0,[0,td0,gx(Q2,k0)],Nx];return U(ud0,$0,D,[0,[0,nd0,m0(M0)],Fx])}function x2(X){var A=X[2],D=A[1],c0=A[3],k0=A[2],M0=X[1],$0=D[0]===0?m0(D[1]):wa(D[1]);return U(cd0,M0,c0,[0,[0,fd0,$0],[0,[0,id0,gx(Pn,k0)],0]])}function hr(X){var A=X[2],D=X[1];switch(A[0]){case 0:var c0=A[1],k0=c0[3],M0=c0[1],$0=[0,[0,sd0,yl(me,c0[2])],0],lx=[0,[0,ad0,pr(pe,M0)],$0];return U(od0,D,_2(k0),lx);case 1:var Nx=A[1],Fx=Nx[3],ur=Nx[1],Jx=[0,[0,vd0,yl(me,Nx[2])],0],xr=[0,[0,ld0,pr(Zx,ur)],Jx];return U(pd0,D,_2(Fx),xr);case 2:return Ex(D,A[1]);default:return z0(A[1])}}function Dr(X){var A=X[2],D=A[2],c0=A[1],k0=X[1];if(!D)return hr(c0);var M0=[0,[0,kd0,z0(D[1])],0];return U(hd0,k0,0,[0,[0,md0,hr(c0)],M0])}function r2(X){var A=X[2],D=A[2],c0=X[1];return U(gd0,c0,D,[0,[0,yd0,xv],[0,[0,dd0,me(A[1])],0]])}function sx(X){var A=X[2],D=A[3],c0=A[2],k0=A[1];if(D){var M0=D[1],$0=M0[2],lx=$0[2],Nx=M0[1],Fx=U(_d0,Nx,lx,[0,[0,wd0,hr($0[1])],0]),ur=tx([0,Fx,p5(Dr,c0)]),Jx=k0?[0,r2(k0[1]),ur]:ur;return $2(Jx)}var xr=dn(Dr,c0),ar=k0?[0,r2(k0[1]),xr]:xr;return $2(ar)}function Sx(X,A){var D=A[2];return U(Td0,X,D,[0,[0,bd0,hr(A[1])],0])}function Zx(X){switch(X[0]){case 0:var A=X[1],D=A[2],c0=D[2],k0=D[1],M0=A[1];if(!c0)return hr(k0);var $0=[0,[0,Ed0,z0(c0[1])],0];return U(Ad0,M0,0,[0,[0,Sd0,hr(k0)],$0]);case 1:var lx=X[1];return Sx(lx[1],lx[2]);default:return C1}}function Ur(X){switch(X[0]){case 0:return C1;case 1:return me(X[1]);default:var A=X[1],D=A[2],c0=A[1];return U(Mw0,c0,0,[0,[0,Lw0,lo([0,D[1],D[2]])],0])}}function Y2(X){if(X[0]===0){var A=X[1],D=A[2],c0=A[1];switch(D[0]){case 0:var k0=D[3],M0=D[1],er=0,yr=k0,Cr=0,Rx=Pd0,Lr=z0(D[2]),Tr=M0;break;case 1:var $0=D[2],lx=D[1],er=0,yr=0,Cr=1,Rx=Id0,Lr=ex([0,$0[1],$0[2]]),Tr=lx;break;case 2:var Nx=D[2],Fx=D[3],ur=D[1],er=Fx,yr=0,Cr=0,Rx=Nd0,Lr=ex([0,Nx[1],Nx[2]]),Tr=ur;break;default:var Jx=D[2],xr=D[3],ar=D[1],er=xr,yr=0,Cr=0,Rx=Cd0,Lr=ex([0,Jx[1],Jx[2]]),Tr=ar}switch(Tr[0]){case 0:var d2=er,t2=0,Er=T2(Tr[1]);break;case 1:var d2=er,t2=0,Er=O1(Tr[1]);break;case 2:var d2=er,t2=0,Er=q1(Tr[1]);break;case 3:var d2=er,t2=0,Er=m0(Tr[1]);break;case 4:var e2=bx(jd0),d2=e2[3],t2=e2[2],Er=e2[1];break;default:var m2=Tr[1][2],h2=m2[1],Fr=A1(m2[2],er),d2=Fr,t2=1,Er=z0(h2)}return U(qd0,c0,d2,[0,[0,Md0,Er],[0,[0,Ld0,Lr],[0,[0,Rd0,Gx(Rx)],[0,[0,Fd0,!!Cr],[0,[0,Dd0,!!yr],[0,[0,Od0,!!t2],0]]]]]])}var Sr=X[1],a2=Sr[2],qr=a2[2],Qr=Sr[1];return U(Ud0,Qr,qr,[0,[0,Bd0,z0(a2[1])],0])}function pe(X){if(X[0]!==0){var A=X[1];return Sx(A[1],A[2])}var D=X[1],c0=D[2],k0=c0[3],M0=c0[2],$0=c0[1],lx=c0[4],Nx=D[1];switch($0[0]){case 0:var Jx=0,xr=0,ar=T2($0[1]);break;case 1:var Jx=0,xr=0,ar=O1($0[1]);break;case 2:var Jx=0,xr=0,ar=q1($0[1]);break;case 3:var Jx=0,xr=0,ar=m0($0[1]);break;default:var Fx=$0[1][2],ur=Fx[2],Jx=ur,xr=1,ar=z0(Fx[1])}if(k0)var er=k0[1],yr=Vr(M0[1],er[1]),Cr=[0,[0,Xd0,z0(er)],0],Rx=U(zd0,yr,0,[0,[0,Yd0,hr(M0)],Cr]);else var Rx=hr(M0);return U(Qd0,Nx,Jx,[0,[0,$d0,ar],[0,[0,Vd0,Rx],[0,[0,Wd0,Hc],[0,[0,Gd0,!1],[0,[0,Jd0,!!lx],[0,[0,Kd0,!!xr],0]]]]]])}function j1(X){var A=X[2],D=A[2],c0=X[1];return U(Zd0,c0,D,[0,[0,Hd0,z0(A[1])],0])}function kt(X){return X[0]===0?z0(X[1]):j1(X[1])}function zt(X){switch(X[0]){case 0:return z0(X[1]);case 1:return j1(X[1]);default:return C1}}function O1(X){var A=X[2];return U(ey0,X[1],A[3],[0,[0,ry0,A[1]],[0,[0,xy0,Gx(A[2])],0]])}function q1(X){var A=X[2],D=A[2],c0=A[1],k0=A[3],M0=X[1],$0=c0?_M(D3,c0[1]):ZM(ty0,eq(95,E1(D,0,Cx(D)-1|0)));return U(fy0,M0,k0,[0,[0,iy0,C1],[0,[0,uy0,Gx($0)],[0,[0,ny0,Gx(D)],0]]])}function T2(X){var A=X[2];return U(ay0,X[1],A[3],[0,[0,sy0,Gx(A[1])],[0,[0,cy0,Gx(A[2])],0]])}function En(X){var A=X[2],D=A[1],c0=A[2],k0=X[1],M0=D?oy0:vy0;return U(ky0,k0,c0,[0,[0,py0,!!D],[0,[0,ly0,Gx(M0)],0]])}function Sn(X){return U(Ty0,X[1],X[2],[0,[0,by0,C1],[0,[0,_y0,cv],0]])}function Ss(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,Ey0,pr(z0,A[2])],0];return U(Ay0,k0,D,[0,[0,Sy0,pr(ke,c0)],M0])}function ke(X){var A=X[2],D=A[1],c0=A[2],k0=X[1];return U(jy0,k0,0,[0,[0,Cy0,Es([0,[0,Iy0,Gx(D[1])],[0,[0,Py0,Gx(D[2])],0]])],[0,[0,Ny0,!!c0],0]])}function Qe(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,Ry0,Gx(zC(A[2]))],0];return U(My0,k0,D,[0,[0,Ly0,pr(vo,c0)],M0])}function vo(X){var A=X[2],D=A[1],c0=X[1],k0=[0,[0,qy0,gx(z0,A[2])],0];return U(Uy0,c0,0,[0,[0,By0,hr(D)],k0])}function mt(X){var A=X[2],D=A[2],c0=X[1];switch(A[1]){case 0:var k0=Xy0;break;case 1:var k0=Yy0;break;case 2:var k0=zy0;break;case 3:var k0=Ky0;break;case 4:var k0=Jy0;break;default:var k0=Gy0}return U(Vy0,c0,D,[0,[0,Wy0,Gx(k0)],0])}function dr(X){var A=X[2],D=X[1];switch(A[0]){case 0:return U($y0,D,A[1],0);case 1:return U(Qy0,D,A[1],0);case 2:return U(Hy0,D,A[1],0);case 3:return U(Zy0,D,A[1],0);case 4:return U(x90,D,A[1],0);case 5:return U(e90,D,A[1],0);case 6:return U(t90,D,A[1],0);case 7:return U(n90,D,A[1],0);case 8:return U(u90,D,A[2],0);case 9:return U(r90,D,A[1],0);case 10:return U(Dw0,D,A[1],0);case 11:var c0=A[1],k0=c0[2];return U(f90,D,k0,[0,[0,i90,dr(c0[1])],0]);case 12:return As([0,D,A[1]]);case 13:var M0=A[1],$0=M0[2],lx=M0[4],Nx=M0[3],Fx=M0[1],ur=A1(_2($0[2][3]),lx),Jx=$0[2],xr=Jx[2],ar=Jx[1],er=[0,[0,Im0,gx(Q2,Fx)],0],yr=[0,[0,Nm0,ba(Nx)],er],Cr=[0,[0,Cm0,gx(Nr,xr)],yr];return U(Om0,D,ur,[0,[0,jm0,gr(ar)],Cr]);case 14:return An(1,[0,D,A[1]]);case 15:var Rx=A[1],Lr=Rx[3],Tr=Rx[2],e2=[0,[0,wg0,An(0,Rx[1])],0];return U(bg0,D,Lr,[0,[0,_g0,pr(x2,Tr)],e2]);case 16:var m2=A[1],h2=m2[2];return U(Eg0,D,h2,[0,[0,Tg0,dr(m2[1])],0]);case 17:var Fr=A[1],d2=Fr[5],t2=Fr[3],Er=Fr[2],Sr=Fr[1],a2=[0,[0,Sg0,dr(Fr[4])],0],qr=[0,[0,Ag0,dr(t2)],a2],Qr=[0,[0,Pg0,dr(Er)],qr];return U(Ng0,D,d2,[0,[0,Ig0,dr(Sr)],Qr]);case 18:var z2=A[1],Mr=z2[2];return U(jg0,D,Mr,[0,[0,Cg0,Ea(z2[1])],0]);case 19:return po([0,D,A[1]]);case 20:var n2=A[1],o2=n2[3];return U(Ug0,D,o2,ko(n2));case 21:var f2=A[1],N2=f2[1],he=N2[3],ee=[0,[0,Xg0,!!f2[2]],0];return U(Yg0,D,he,Lx(ko(N2),ee));case 22:var He=A[1],B1=He[1],u2=He[2];return U(Kg0,D,u2,[0,[0,zg0,pr(dr,[0,B1[1],[0,B1[2],B1[3]]])],0]);case 23:var te=A[1],R2=te[1],dt=te[2];return U(Gg0,D,dt,[0,[0,Jg0,pr(dr,[0,R2[1],[0,R2[2],R2[3]]])],0]);case 24:var D1=A[1],yt=D1[2],Jt=D1[3],Ze=D1[1],xt=yt?[0,[0,Wg0,Pn(yt[1])],0]:0;return U($g0,D,Jt,[0,[0,Vg0,_a(Ze)],xt]);case 25:var gt=A[1],wt=gt[2];return U(rw0,D,wt,[0,[0,xw0,dr(gt[1])],0]);case 26:return Ta(D,A[1]);case 27:var Ax=A[1];return mo(D,Ax[2],cw0,Ax[1]);case 28:var Z2=A[1],de=Z2[3],je=[0,[0,sw0,!!Z2[2]],0];return U(ow0,D,de,[0,[0,aw0,pr(function(In){var v1=In[2],Gt=In[1];switch(v1[0]){case 0:return dr(v1[1]);case 1:var U1=v1[1],Oe=U1[2],Wt=U1[1],Cs=[0,[0,vw0,!!U1[4]],0],Nn=[0,[0,lw0,gx(mt,U1[3])],Cs],js=[0,[0,pw0,dr(Oe)],Nn];return U(mw0,Gt,0,[0,[0,kw0,m0(Wt)],js]);default:var nt=v1[1],Vt=nt[1],Tt=[0,[0,hw0,dr(nt[2])],0];return U(yw0,Gt,0,[0,[0,dw0,gx(m0,Vt)],Tt])}},Z2[1])],je]);case 29:var rt=A[1];return U(_w0,D,rt[3],[0,[0,ww0,Gx(rt[1])],[0,[0,gw0,Gx(rt[2])],0]]);case 30:var et=A[1];return U(Ew0,D,et[3],[0,[0,Tw0,et[1]],[0,[0,bw0,Gx(et[2])],0]]);case 31:var tt=A[1];return U(Pw0,D,tt[3],[0,[0,Aw0,C1],[0,[0,Sw0,Gx(tt[2])],0]]);case 32:var x1=A[1],_t=x1[1],bt=x1[2],Is=0,Ns=_t?Iw0:Nw0;return U(Ow0,D,bt,[0,[0,jw0,!!_t],[0,[0,Cw0,Gx(Ns)],Is]]);case 33:return U(c90,D,A[1],0);case 34:return U(s90,D,A[1],0);default:return U(a90,D,A[1],0)}}function lo(X){var A=X[2],D=A[2],c0=A[3],k0=D[2],M0=D[1],$0=X[1];switch(A[1]){case 0:var lx=C1;break;case 1:var lx=E3;break;default:var lx=d3}var Nx=[0,[0,v90,gx(dr,k0)],[0,[0,o90,lx],0]],Fx=[0,[0,l90,m0(M0)],Nx];return U(p90,$0,_2(c0),Fx)}function As(X){var A=X[2],D=A[5],c0=A[3],k0=A[2][2],M0=A[4],$0=k0[3],lx=k0[2],Nx=k0[1],Fx=A[1],ur=X[1],Jx=A1(_2(k0[4]),M0),xr=D===0?k90:m90,ar=D===0?0:[0,[0,h90,gx(Kt,Nx)],0],er=[0,[0,d90,gx(Q2,Fx)],0],yr=[0,[0,y90,gx(Uv,$0)],er],Cr=c0[0]===0?dr(c0[1]):lo(c0[1]);return U(xr,ur,Jx,Lx([0,[0,w90,pr(function(Rx){return ga(0,Rx)},lx)],[0,[0,g90,Cr],yr]],ar))}function ga(X,A){var D=A[2],c0=D[1],k0=A[1],M0=[0,[0,_90,!!D[3]],0],$0=[0,[0,b90,dr(D[2])],M0];return U(E90,k0,X,[0,[0,T90,gx(m0,c0)],$0])}function Uv(X){var A=X[2];return ga(A[2],A[1])}function Kt(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,A90,dr(A[1][2])],[0,[0,S90,!1],0]];return U(I90,c0,D,[0,[0,P90,gx(m0,0)],k0])}function An(X,A){var D=A[2],c0=D[4],k0=D[2],M0=D[1],$0=A[1],lx=m1(function(Cr,Rx){var Lr=Cr[4],Tr=Cr[3],e2=Cr[2],m2=Cr[1];switch(Rx[0]){case 0:var h2=Rx[1],Fr=h2[2],d2=Fr[2],t2=Fr[1],Er=Fr[8],Sr=Fr[7],a2=Fr[6],qr=Fr[5],Qr=Fr[4],z2=Fr[3],Mr=h2[1];switch(t2[0]){case 0:var n2=T2(t2[1]);break;case 1:var n2=O1(t2[1]);break;case 2:var n2=q1(t2[1]);break;case 3:var n2=m0(t2[1]);break;case 4:var n2=bx(M90);break;default:var n2=bx(q90)}switch(d2[0]){case 0:var N2=B90,he=dr(d2[1]);break;case 1:var o2=d2[1],N2=U90,he=As([0,o2[1],o2[2]]);break;default:var f2=d2[1],N2=X90,he=As([0,f2[1],f2[2]])}return[0,[0,U(Q90,Mr,Er,[0,[0,$90,n2],[0,[0,V90,he],[0,[0,W90,!!a2],[0,[0,G90,!!z2],[0,[0,J90,!!Qr],[0,[0,K90,!!qr],[0,[0,z90,gx(mt,Sr)],[0,[0,Y90,Gx(N2)],0]]]]]]]]),m2],e2,Tr,Lr];case 1:var ee=Rx[1],He=ee[2],B1=He[2],u2=ee[1];return[0,[0,U(Z90,u2,B1,[0,[0,H90,dr(He[1])],0]),m2],e2,Tr,Lr];case 2:var te=Rx[1],R2=te[2],dt=R2[6],D1=R2[4],yt=R2[3],Jt=R2[2],Ze=R2[1],xt=te[1],gt=[0,[0,rg0,!!D1],[0,[0,xg0,gx(mt,R2[5])],0]],wt=[0,[0,eg0,dr(yt)],gt],Ax=[0,[0,tg0,dr(Jt)],wt];return[0,m2,[0,U(ug0,xt,dt,[0,[0,ng0,gx(m0,Ze)],Ax]),e2],Tr,Lr];case 3:var Z2=Rx[1],de=Z2[2],je=de[3],rt=Z2[1],et=[0,[0,ig0,!!de[2]],0];return[0,m2,e2,[0,U(cg0,rt,je,[0,[0,fg0,As(de[1])],et]),Tr],Lr];case 4:var tt=Rx[1],x1=tt[2],_t=x1[6],bt=x1[5],Is=x1[4],Ns=x1[3],In=x1[1],v1=tt[1],Gt=[0,[0,dg0,!!Ns],[0,[0,hg0,!!Is],[0,[0,mg0,!!bt],[0,[0,kg0,dr(x1[2])],0]]]];return[0,m2,e2,Tr,[0,U(gg0,v1,_t,[0,[0,yg0,m0(In)],Gt]),Lr]];default:var U1=Rx[1],Oe=U1[2],Wt=Oe[6],Cs=Oe[4],Nn=Oe[3],js=Oe[2],nt=Oe[1],Vt=U1[1],Tt=0;switch(Oe[5]){case 0:var $t="PlusOptional";break;case 1:var $t="MinusOptional";break;case 2:var $t="Optional";break;default:var $t=C1}var De=[0,[0,ag0,gx(mt,Cs)],[0,[0,sg0,$t],Tt]],Os=[0,[0,og0,dr(Nn)],De],Ds=[0,[0,vg0,dr(js)],Os];return[0,[0,U(pg0,Vt,Wt,[0,[0,lg0,Ea(nt)],Ds]),m2],e2,Tr,Lr]}},N90,D[3]),Nx=lx[3],Fx=lx[2],ur=lx[1],Jx=[0,[0,C90,$2(tx(lx[4]))],0],xr=[0,[0,j90,$2(tx(Nx))],Jx],ar=[0,[0,O90,$2(tx(Fx))],xr],er=[0,[0,F90,!!M0],[0,[0,D90,$2(tx(ur))],ar]],yr=X?[0,[0,R90,!!k0],er]:er;return U(L90,$0,_2(c0),yr)}function wa(X){var A=X[2],D=A[1],c0=A[2],k0=X[1],M0=D[0]===0?m0(D[1]):wa(D[1]);return U(Fg0,k0,0,[0,[0,Dg0,M0],[0,[0,Og0,m0(c0)],0]])}function po(X){var A=X[2],D=A[1],c0=A[3],k0=A[2],M0=X[1],$0=D[0]===0?m0(D[1]):wa(D[1]);return U(Mg0,M0,c0,[0,[0,Lg0,$0],[0,[0,Rg0,gx(Pn,k0)],0]])}function ko(X){var A=X[1],D=[0,[0,qg0,dr(X[2])],0];return[0,[0,Bg0,dr(A)],D]}function _a(X){if(X[0]===0)return m0(X[1]);var A=X[1],D=A[2],c0=D[2],k0=A[1],M0=_a(D[1]);return U(Zg0,k0,0,[0,[0,Hg0,M0],[0,[0,Qg0,m0(c0)],0]])}function ba(X){return X[0]===0?C1:Ta(X[1],X[2])}function Ta(X,A){var D=A[3],c0=A[2];switch(A[4]){case 0:var k0=ew0;break;case 1:var k0=tw0;break;default:var k0=nw0}return mo(X,D,k0,c0)}function mo(X,A,D,c0){return U(fw0,X,A,[0,[0,iw0,Gx(D)],[0,[0,uw0,dr(c0)],0]])}function me(X){var A=X[1];return U(Rw0,A,0,[0,[0,Fw0,dr(X[2])],0])}function Q2(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,qw0,pr(Ea,A[1])],0];return U(Bw0,c0,_2(D),k0)}function Ea(X){var A=X[2],D=A[1][2],c0=A[6],k0=A[5],M0=A[4],$0=A[2],lx=D[2],Nx=D[1],Fx=X[1],ur=A[3]?[0,[0,Uw0,!0],0]:0,Jx=[0,[0,Xw0,gx(dr,k0)],0],xr=[0,[0,Yw0,gx(mt,M0)],Jx],ar=[0,[0,zw0,!!GM(c0)],xr];return U(Gw0,Fx,lx,Lx([0,[0,Jw0,Gx(Nx)],[0,[0,Kw0,yl(me,$0)],ar]],ur))}function Pn(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,Ww0,pr(dr,A[1])],0];return U(Vw0,c0,_2(D),k0)}function ho(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,$w0,pr(yo,A[1])],0];return U(Qw0,c0,_2(D),k0)}function yo(X){if(X[0]===0)return dr(X[1]);var A=X[1],D=A[1],c0=A[2][1];return po([0,D,[0,[0,gn(0,[0,D,Hw0])],0,c0]])}function Ps(X){var A=X[2],D=A[1],c0=A[4],k0=A[2],M0=X[1],$0=[0,[0,Zw0,pr(Yv,A[3][2])],0],lx=[0,[0,x_0,gx(Xv,k0)],$0],Nx=D[2],Fx=Nx[2],ur=Nx[4],Jx=Nx[3],xr=Nx[1],ar=D[1],er=Fx?[0,[0,f_0,ho(Fx[1])],0]:0,yr=[0,[0,s_0,pr(wl,ur)],[0,[0,c_0,!!Jx],0]];return U(e_0,M0,c0,[0,[0,r_0,U(o_0,ar,0,Lx([0,[0,a_0,wo(xr)],yr],er))],lx])}function go(X){var A=X[2],D=A[4],c0=A[3][2],k0=A[1],M0=X[1],$0=[0,[0,t_0,U(k_0,A[2],0,0)],0],lx=[0,[0,n_0,pr(Yv,c0)],$0];return U(i_0,M0,D,[0,[0,u_0,U(v_0,k0,0,0)],lx])}function wl(X){if(X[0]===0){var A=X[1],D=A[2],c0=D[1],k0=D[2],M0=A[1],$0=c0[0]===0?ht(c0[1]):_l(c0[1]);return U(d_0,M0,0,[0,[0,h_0,$0],[0,[0,m_0,gx(_o,k0)],0]])}var lx=X[1],Nx=lx[2],Fx=Nx[2],ur=lx[1];return U(g_0,ur,Fx,[0,[0,y_0,z0(Nx[1])],0])}function Xv(X){var A=X[1];return U(p_0,A,0,[0,[0,l_0,wo(X[2][1])],0])}function Yv(X){var A=X[2],D=X[1];switch(A[0]){case 0:return Ps([0,D,A[1]]);case 1:return go([0,D,A[1]]);case 2:return Sa([0,D,A[1]]);case 3:var c0=A[1],k0=c0[2];return U(E_0,D,k0,[0,[0,T_0,z0(c0[1])],0]);default:var M0=A[1];return U(P_0,D,0,[0,[0,A_0,Gx(M0[1])],[0,[0,S_0,Gx(M0[2])],0]])}}function wo(X){switch(X[0]){case 0:return ht(X[1]);case 1:return _l(X[1]);default:return bo(X[1])}}function _o(X){if(X[0]===0){var A=X[1];return T2([0,A[1],A[2]])}var D=X[1];return Sa([0,D[1],D[2]])}function Sa(X){var A=X[2],D=A[1],c0=X[1],k0=A[2],M0=D?z0(D[1]):U(w_0,[0,c0[1],[0,c0[2][1],c0[2][2]+1|0],[0,c0[3][1],c0[3][2]-1|0]],0,0);return U(b_0,c0,_2(k0),[0,[0,__0,M0],0])}function bo(X){var A=X[2],D=A[1],c0=A[2],k0=X[1],M0=D[0]===0?ht(D[1]):bo(D[1]);return U(C_0,k0,0,[0,[0,N_0,M0],[0,[0,I_0,ht(c0)],0]])}function _l(X){var A=X[2],D=A[1],c0=X[1],k0=[0,[0,j_0,ht(A[2])],0];return U(D_0,c0,0,[0,[0,O_0,ht(D)],k0])}function ht(X){var A=X[2];return U(R_0,X[1],A[2],[0,[0,F_0,Gx(A[1])],0])}function E4(X){var A=X[2],D=A[2],c0=A[1],k0=X[1],M0=m0(D?D[1]:c0);return U(q_0,k0,0,[0,[0,M_0,m0(c0)],[0,[0,L_0,M0],0]])}function Aa(X){return pr($h,X)}function $h(X){var A=X[2],D=X[1];if(A[1])var c0=A[2],k0=W_0;else var c0=A[2],k0=V_0;return U(k0,D,0,[0,[0,$_0,Gx(c0)],0])}function zv(X){var A=X[2],D=A[1],c0=A[2],k0=X[1];if(D)var M0=[0,[0,Q_0,z0(D[1])],0],$0=H_0;else var M0=0,$0=Z_0;return U($0,k0,c0,M0)}function bl(X){var A=X[2],D=X[1],c0=[0,[0,xb0,qx(X[3])],0],k0=[0,[0,rb0,gx(ho,A)],c0];return[0,[0,eb0,z0(D)],k0]}function Tl(X){var A=X[2],D=X[1];switch(A[0]){case 0:var c0=0,k0=m0(A[1]);break;case 1:var c0=0,k0=Dx(A[1]);break;default:var c0=1,k0=z0(A[1])}return[0,[0,ub0,z0(D)],[0,[0,nb0,k0],[0,[0,tb0,!!c0],0]]]}var To=E0[2],S4=To[2],A4=To[4],Qh=To[3],Hh=E0[1],Zh=Kx(To[1]),P4=[0,[0,o60,Zh],[0,[0,a60,Aa(A4)],0]];if(S4)var I4=S4[1],N4=Lx(P4,[0,[0,p60,U(l60,I4[1],0,[0,[0,v60,Gx(I4[2])],0])],0]);else var N4=P4;var El=U(k60,Hh,Qh,N4);return El.errors=pr(function(X){var A=X[1],D=[0,[0,ib0,Gx(dE0(X[2]))],0];return Es([0,[0,fb0,VY(A)],D])},Lx(s0,GY[1])),T&&(El[GO]=$2(p5(function(X){var A=X[2],D=X[1],c0=X[3],k0=[0,[0,ho0,Gx(JC(A))],0],M0=[0,dh(B,D[3]),0],$0=[0,[0,do0,$2([0,dh(B,D[2]),M0])],k0],lx=[0,[0,wo0,Es([0,[0,go0,D[3][1]],[0,[0,yo0,D[3][2]],0]])],0],Nx=[0,[0,Eo0,Es([0,[0,To0,Es([0,[0,bo0,D[2][1]],[0,[0,_o0,D[2][2]],0]])],lx])],$0];switch(c0){case 0:var Fx=So0;break;case 1:var Fx=Ao0;break;case 2:var Fx=Po0;break;case 3:var Fx=Io0;break;case 4:var Fx=No0;break;default:var Fx=Co0}return Es([0,[0,Oo0,Gx(OB(A))],[0,[0,jo0,Gx(Fx)],Nx]])},F[1]))),El}if(typeof fO<"u")var $Y=fO;else{var QY={};ya.flow=QY;var $Y=QY}$Y.parse=eK(function(x,r){try{var e=EE0(x,r);return e}catch(u){var t=B2(u);return t[1]===eO?JY(t[2]):JY(new bE0(Gx(Mx(Tb0,Y6(t)))))}}),QN(O)})(globalThis)});var vS0={};rz(vS0,{parsers:()=>lO});var lO={};rz(lO,{flow:()=>oS0});var wz=LE0(tz(),1);function qE0(o0,ox){let $x=new SyntaxError(o0+" ("+ox.loc.start.line+":"+ox.loc.start.column+")");return Object.assign($x,ox)}var nz=qE0;var BE0=(o0,ox,$x)=>{if(!(o0&&ox==null))return Array.isArray(ox)||typeof ox=="string"?ox[$x<0?ox.length+$x:$x]:ox.at($x)},cO=BE0;function UE0(o0){return Array.isArray(o0)&&o0.length>0}var uz=UE0;function Zt(o0){var Ar,lr,Pr;let ox=((Ar=o0.range)==null?void 0:Ar[0])??o0.start,$x=(Pr=((lr=o0.declaration)==null?void 0:lr.decorators)??o0.decorators)==null?void 0:Pr[0];return $x?Math.min(Zt($x),ox):ox}function Da(o0){var ox;return((ox=o0.range)==null?void 0:ox[1])??o0.end}function XE0(o0){let ox=new Set(o0);return $x=>ox.has($x==null?void 0:$x.type)}var iz=XE0;var YE0=iz(["Block","CommentBlock","MultiLine"]),F4=YE0;function zE0(o0){let ox=`*${o0.value}*`.split(` +`);return ox.length>1&&ox.every($x=>$x.trimStart()[0]==="*")}var sO=zE0;function KE0(o0){return F4(o0)&&o0.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(o0.value)}var fz=KE0;var R4=null;function L4(o0){if(R4!==null&&typeof R4.property){let ox=R4;return R4=L4.prototype=null,ox}return R4=L4.prototype=o0??Object.create(null),new L4}var JE0=10;for(let o0=0;o0<=JE0;o0++)L4();function aO(o0){return L4(o0)}function GE0(o0,ox="type"){aO(o0);function $x(Ar){let lr=Ar[ox],Pr=o0[lr];if(!Array.isArray(Pr))throw Object.assign(new Error(`Missing visitor keys for '${lr}'.`),{node:Ar});return Pr}return $x}var cz=GE0;var sz={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var WE0=cz(sz),az=WE0;function oO(o0,ox){if(!(o0!==null&&typeof o0=="object"))return o0;if(Array.isArray(o0)){for(let Ar=0;Ar{var L2;(L2=Pr.leadingComments)!=null&&L2.some(fz)&&lr.add(Zt(Pr))}),o0=ad(o0,Pr=>{if(Pr.type==="ParenthesizedExpression"){let{expression:L2}=Pr;if(L2.type==="TypeCastExpression")return L2.range=[...Pr.range],L2;let ie=Zt(Pr);if(!lr.has(ie))return L2.extra={...L2.extra,parenthesized:!0},L2}})}if(o0=ad(o0,lr=>{switch(lr.type){case"LogicalExpression":if(oz(lr))return vO(lr);break;case"VariableDeclaration":{let Pr=cO(!1,lr.declarations,-1);Pr!=null&&Pr.init&&Ar[Da(Pr)]!==";"&&(lr.range=[Zt(lr),Da(Pr)]);break}case"TSParenthesizedType":return lr.typeAnnotation;case"TSTypeParameter":if(typeof lr.name=="string"){let Pr=Zt(lr);lr.name={type:"Identifier",name:lr.name,range:[Pr,Pr+lr.name.length]}}break;case"TopicReference":o0.extra={...o0.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(lr.types.length===1)return lr.types[0];break}}),uz(o0.comments)){let lr=cO(!1,o0.comments,-1);for(let Pr=o0.comments.length-2;Pr>=0;Pr--){let L2=o0.comments[Pr];Da(L2)===Zt(lr)&&F4(L2)&&F4(lr)&&sO(L2)&&sO(lr)&&(o0.comments.splice(Pr+1,1),L2.value+="*//*"+lr.value,L2.range=[Zt(L2),Da(lr)]),lr=L2}}return o0.type==="Program"&&(o0.range=[0,Ar.length]),o0}function oz(o0){return o0.type==="LogicalExpression"&&o0.right.type==="LogicalExpression"&&o0.operator===o0.right.operator}function vO(o0){return oz(o0)?vO({type:"LogicalExpression",operator:o0.operator,left:vO({type:"LogicalExpression",operator:o0.operator,left:o0.left,right:o0.right.left,range:[Zt(o0.left),Da(o0.right.left)]}),right:o0.right.right,range:[Zt(o0),Da(o0)]}):o0}var vz=VE0;var $E0=(o0,ox,$x,Ar)=>{if(!(o0&&ox==null))return ox.replaceAll?ox.replaceAll($x,Ar):$x.global?ox.replace($x,Ar):ox.split($x).join(Ar)},ql=$E0;var QE0=/\*\/$/,HE0=/^\/\*\*?/,ZE0=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,xS0=/(^|\s+)\/\/([^\n\r]*)/g,lz=/^(\r?\n)+/,rS0=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,pz=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,eS0=/(\r?\n|^) *\* ?/g,tS0=[];function kz(o0){let ox=o0.match(ZE0);return ox?ox[0].trimStart():""}function mz(o0){let ox=` +`;o0=ql(!1,o0.replace(HE0,"").replace(QE0,""),eS0,"$1");let $x="";for(;$x!==o0;)$x=o0,o0=ql(!1,o0,rS0,`${ox}$1 $2${ox}`);o0=o0.replace(lz,"").trimEnd();let Ar=Object.create(null),lr=ql(!1,o0,pz,"").replace(lz,"").trimEnd(),Pr;for(;Pr=pz.exec(o0);){let L2=ql(!1,Pr[2],xS0,"");if(typeof Ar[Pr[1]]=="string"||Array.isArray(Ar[Pr[1]])){let ie=Ar[Pr[1]];Ar[Pr[1]]=[...tS0,...Array.isArray(ie)?ie:[ie],L2]}else Ar[Pr[1]]=L2}return{comments:lr,pragmas:Ar}}function nS0(o0){if(!o0.startsWith("#!"))return"";let ox=o0.indexOf(` +`);return ox===-1?o0:o0.slice(0,ox)}var hz=nS0;function uS0(o0){let ox=hz(o0);ox&&(o0=o0.slice(ox.length+1));let $x=kz(o0),{pragmas:Ar,comments:lr}=mz($x);return{shebang:ox,text:o0,pragmas:Ar,comments:lr}}function dz(o0){let{pragmas:ox}=uS0(o0);return Object.prototype.hasOwnProperty.call(ox,"prettier")||Object.prototype.hasOwnProperty.call(ox,"format")}function iS0(o0){return o0=typeof o0=="function"?{parse:o0}:o0,{astFormat:"estree",hasPragma:dz,locStart:Zt,locEnd:Da,...o0}}var yz=iS0;function fS0(o0){return o0.charAt(0)==="#"&&o0.charAt(1)==="!"?"//"+o0.slice(2):o0}var gz=fS0;var cS0={comments:!1,components:!0,enums:!0,esproposal_decorators:!0,esproposal_export_star_as:!0,tokens:!0};function sS0(o0){let{message:ox,loc:{start:$x,end:Ar}}=o0;return nz(ox,{loc:{start:{line:$x.line,column:$x.column+1},end:{line:Ar.line,column:Ar.column+1}},cause:o0})}function aS0(o0){let ox=wz.default.parse(gz(o0),cS0),[$x]=ox.errors;if($x)throw sS0($x);return vz(ox,{text:o0})}var oS0=yz(aS0);return ME0(vS0);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/flow.mjs b/node_modules/prettier/plugins/flow.mjs new file mode 100644 index 0000000..593733f --- /dev/null +++ b/node_modules/prettier/plugins/flow.mjs @@ -0,0 +1,19 @@ +var CE0=Object.create;var iO=Object.defineProperty;var jE0=Object.getOwnPropertyDescriptor;var OE0=Object.getOwnPropertyNames;var DE0=Object.getPrototypeOf,FE0=Object.prototype.hasOwnProperty;var RE0=(o0,ox)=>()=>(ox||o0((ox={exports:{}}).exports,ox),ox.exports),ez=(o0,ox)=>{for(var $x in ox)iO(o0,$x,{get:ox[$x],enumerable:!0})},LE0=(o0,ox,$x,Ar)=>{if(ox&&typeof ox=="object"||typeof ox=="function")for(let lr of OE0(ox))!FE0.call(o0,lr)&&lr!==$x&&iO(o0,lr,{get:()=>ox[lr],enumerable:!(Ar=jE0(ox,lr))||Ar.enumerable});return o0};var ME0=(o0,ox,$x)=>($x=o0!=null?CE0(DE0(o0)):{},LE0(ox||!o0||!o0.__esModule?iO($x,"default",{value:o0,enumerable:!0}):$x,o0));var tz=RE0(fO=>{(function(o0){typeof globalThis!="object"&&(this?ox():(o0.defineProperty(o0.prototype,"_T_",{configurable:!0,get:ox}),_T_));function ox(){var $x=this||self;$x.globalThis=$x,delete o0.prototype._T_}})(Object);(function(o0){"use strict";var ox="loc",$x=70416,Ar=69748,lr=163,Pr=92159,L2=43587,ie="labeled_statement",kO="&=",Bs="int_of_string",ad=110591,od=92909,M4=11559,mO="regexp",vd=43301,q4=11703,ld=122654,Us=255,hO="%ni",pd=68252,dO=232,kd=42785,Dn="declare_variable",B4="while",md=66938,hd=70301,dd=124907,U4=126515,yO=218,Fn="pattern_identifier",yd=67643,Rn="export_source",gd=216,wd=64279,gO="Out_of_memory",_d=113788,wO="comments",bd=126624,_O="win32",Ln="object_key_bigint_literal",Td=185,X4=123214,Mo="constructor",Ed=69955,Mn="import_declaration",Sd=68437,Ad="Failure",Y4="Unix.Unix_error",Pd=64255,Id=42539,Nd=110579,qn="export_default_declaration",Bn="jsx_attribute_name",z4=11727,Cd=43002,K4=126500,Un="component_param_pattern",bO="collect_comments_opt",Xn="match_unary_pattern",Yn="keyof_type",TO="Invalid binary/octal ",EO="range",J4=170,Xs="false",jd=43798,SO=", characters ",zn="object_type_property_getter",Od=65547,Dd=126467,Fd=65007,AO="guard",Rd=42237,Ld=8318,Md=71215,Kn="object_property_type",Jn="type_alias",qd=67742,Gn="function_body",PO=304,Bd=68111,G4=120745,Ud=71959,W4=43880,IO="Match_failure",NO=280,Wn="type_cast",Vn=109,Ys="void",Xd="generator",Yd=125124,zd=101589,V4=94179,CO=">>>",$4=70404,$n="optional_indexed_access_type",jO=310,g1="argument",Qn="object_property",Hn="object_type_property",Kd=67004,Jd=42783,Gd=68850,OO="@",Wd=43741,Vd=43487,Q4="object",DO="end",H4=126571,$d=71956,FO=208,Qd=126566,Hd=67702,RO="EEXIST",Zn="this_expression",LO=203,Zd=11507,xy=113807,Z4=119893,ry=42735,Bl="rest",x7="null_literal",Ul="protected",ey=43615,l1=8231,ty=68149,ny=73727,uy=72348,iy=92995,qo=224,fy=11686,cy=43013,r7="assignment_pattern",sy=12329,e7="function_type",v3=192,t7="jsx_element_name",ay=70018,n7="catch_clause_pattern",xp=126540,u7="template_literal",oy=120654,vy=68497,ly=67679,i7="readonly_type",py=68735,ky="<",rp=": No such file or directory",my=66915,MO="!",f7="object_type",hy=43712,ep=64297,dy=183969,yy=43503,gy=67591,Bo=65278,wy=67669,c7="for_of_assignment_pattern",Xl="`",_y=11502,s7="catch_body",by=42191,Fa=-744106340,Ty=182,Uo=":",qO="a string",Ey=65663,Sy=66978,Ay=71947,tp=43519,Py=71086,Iy=125258,Ny=12538,a7="expression_or_spread",BO="Printexc.handle_uncaught_exception",np=69956,up=120122,ip=247,UO=231,Cy=" : flags Open_rdonly and Open_wronly are not compatible",o7="statement_fork_point",XO=710,YO=-692038429,Re="static",jy=55203,Oy=64324,Dy=64111,zO="!==",Fy=120132,Ry=124903,Yl="class",KO=222,v7="pattern_number_literal",zs="kind",Ly=71903,l7="variable_declarator",p7="typeof_expression",My=126627,qy=70084,JO=228,fp=70480,k7="class_private_field",By=239,cp=120713,xn=65535,m7="private_name",Uy=43137,h7="remote_identifier",Xy=70161,d7="label_identifier",Yy="src/parser/statement_parser.ml",zy=8335,Ky=19903,Jy=64310,Xo="_",y7="for_init_declaration",GO="infer",Gy=64466,Wy=43018,WO="tokens",Vy=92735,$y=66954,Qy=65473,Hy=70285,g7="sequence",Zy="compare: functional value",x9=69890,zl=1e3,r9=65487,e9=42653,VO="\\\\",$O="%=",w7="match_member_pattern_base",t9=72367,_7="function_rest_param",QO="/static/",n9=124911,u9=65276,sp=126558,i9=11498,HO=137,b7="export_default_declaration_decl",f9="cases",ap=126602,T7="jsx_child",Le="continue",c9=42962,ZO="importKind",c2=122,l3="Literal",E7="pattern_object_property_identifier_key",s9=42508,Ra="in",a9=55238,o9=67071,v9=70831,l9=72161,p9=67462,xD="<<=",k9=43009,m9=66383,op=67827,h9=72202,d9=69839,y9=66775,rD="-=",Yo=8202,g9=70105,w9=120538,S7="for_in_left_declaration",_9="rendersType",vp=126563,b9=70708,lp=126523,eD=166,tD=202,T9=110951,Ks="component",pp=126552,E9=66977,nD=213,A7="enum_member_identifier",uD=210,P7="enum_bigint_body",iD=">=",S9=126495,A9="specifiers",fD=-88,P9="=",I9=65338,Kl="members",N9=123535,C9=43702,j9=72767,zo="get",O9=126633,kp=126536,D9=94098,F9="types",cD=273,R9=113663,sD="Internal Error: Found private field in object props",I7="jsx_element",L9=70366,M9=110959,mp=120655,aD="trailingComments",oD=282,La=24029,q9=-100,z1="yield",N7="binding_pattern",C7="typeof_identifier",vD="ENOTEMPTY",B9=-104,hp=126468,U9=1255,X9=120628,j7="pattern_object_property_string_literal_key",Y9=8521,lD="leadingComments",pD=8204,Ma="@ ",z9=70319,Js="left",K9=188,dp="case",J9=19967,yp=42622,G9=43492,W9=113770,V9=42774,$9=183,gp=8468,O7="class_implements",wp=126579,p3="string",kD=211,e1=-48,Q9=69926,H9=123213,D7="if_consequent_statement",Z9=124927,k3="number",xg=126546,rg=68119,eg=70726,_p=70750,tg=65489,mD="SpreadElement",hD="callee",dD=193,ng=70492,ug=71934,yD=164,ig=110580,fg=12320,bp="any",fe="/",F7="type_guard",A2="body",gD=272,wD=178,Te="pattern",_D="comment_bounds",R7="binding_type_identifier",cg=187,L7="pattern_array_rest_element_pattern",Tp="@])",sg=12543,ag=11623,bD="start",og=67871,ce="interface",vg=8449,lg=67637,pg=42961,Ep=120085,kg=126463,TD="alternate",ED=-1053382366,mg=70143,SD="--",hg=68031,M7="jsx_expression",q7="type_identifier_reference",Sp=11647,dg="proto",St="identifier",yg=43696,At="raw",gg=126529,wg=11564,Ap=126557,_g=64911,Pp=67592,bg=43493,Tg=215,Eg=110588,Jl=461894857,Sg=92927,Ag=67861,Pg=119980,Ig=43042,Ng=66965,Cg=67391,m3="computed",AD="unreachable jsxtext",jg=71167,Og=42559,Dg=72966,PD=303,ID=180,ND=197,Ip=64319,Fg=169,CD="*",Ko=129,Rg=66335,Gl="meta",Lg=43388,Np=94178,it="optional",Cp="unknown",Mg=120121,qg=123180,jp=8469,Bg=68220,jD="|",Ug=43187,Xg=94207,Yg=124895,Op=120513,zg=42527,Jo=8286,Kg=94177,Wl="var",B7="component_type_param",Jg=66421,OD=267,Gg=92991,Wg=68415,U7="comment",X7="match_pattern_array_element",Go=244,Dp="^",Vg=173791,DD=136,$g=42890,Qg="ENOTDIR",Hg="??",Zg=43711,xw=66303,rw=113800,ew=42239,tw=12703,Y7="variance_opt",z7="+",FD=">>>=",Fp="mixed",nw=65613,uw=73029,iw=68191,RD="*=",Rp=8487,fw=8477,K7="toplevel_statement_list",Lp="never",Mp="do",qa=125,cw=72249,LD="Pervasives.do_at_exit",MD="visit_trailing_comment",J7="jsx_closing_element",G7="jsx_namespaced_name",sw=124908,aw=126651,W7="component_declaration",ow=15,V7="interface_type",$7="function_type_return_annotation",vw=64109,qp=65595,Bp=126560,lw=110927,qD=301,Up=65598,Xp=8488,Gs="`.",BD=175,Yp="package",zp="else",Kp=120771,pw=68023,UD="fd ",Wo=8238,Jp=888960333,Gp=119965,kw=42655,Q7="match_object_pattern",mw=11710,hw=119993,H7="boolean_literal",Z7="statement_list",xu="function_param",ru="match_as_pattern",eu="pattern_object_property_bigint_literal_key",Wp=69959,dw=120485,XD=240,yw=191456,tu="declare_enum",Vp=120597,$p=70281,nu="type_annotation",uu="spread_element",Qp=126544,gw=120069,Ba="key",ww=43583,_w="out",bw=` +`,YD="**=",iu="pattern_object_property_pattern",Tw="e",Ew=72712,zD="Internal Error: Found object private prop",Sw="ENOENT",Aw=-42,fu="jsx_opening_attribute",Pw=67646,cu="component_type",Iw=64296,Nw=43887,KD="Division_by_zero",JD="EnumDefaultedMember",su="typeof_member_identifier",Cw=43792,au="match_member_pattern_property",ou="declare_export_declaration_decl",jw=93026,vu="type_annotation_hint",Ow=42887,Dw=43881,Fw=43761,Hp=8526,GD=158,WD=287,h3=119,Rw=43866,Lw=72847,Mw=8348,se=101,qw=94026,Zp=72272,VD="src/parser/flow_lexer.ml",Bw=120744,Vo=8191,d3="implies",xk=255,rk=11711,lu="match_unary_pattern_argument",Uw=71235,$D=288,ek=68116,y2=100,pu="match_expression",ku="enum_body",tk=1114111,mu="assignment",Xw=71955,nk=43260,hu="pattern_array_e",Yw=126583,QD="prefix",du="class_body",uk="shorthand",zw=171,Kw=66256,ik=-97,HD=" =",Jw=94032,Gw=42606,Ww=71839,fk=120134,Vw=55291,$w=92862,Qw=43019,Hw=126543,y3="function",Zw=111355,x_=11389,r_=70753,e_=43249,t_=64829,ck="line",yu="function_declaration",sk="undefined",ZD="([^/]+)",n_=110947,u_=70002,xF="Cygwin",gu="as_expression",i_=12591,ak=64285,f_=2048,c_=73112,ok=126589,rF=225,vk=43259,s_=72817,lk=64318,eF=172,tF=209,wu="match_binding_pattern",_u=" ",bu="import_source",Vl="delete",nF="Enum `",pk=126553,a_=67001,$o="default",o_=11630,kk=206,Tu="enum_bigint_member",v_=67504,mk=67593,l_=113791,p_=69572,Eu="typeof_type",uF=212,iF="%i",Su="function_this_param",k_=72329,Ua="0x",Qo=8239,m_=75075,fF=57343,Au="pattern_bigint_literal",h_=12341,cF=201,Ho="hook",sF=": closedir failed",d_=42959,hk=119970,aF=278,y_=43560,oF="||=",Pu="member_private_name",g_=120570,Iu="object_key_identifier",dk=223,vF="Not_found",lF=230,Nu="jsx_element_name_member_expression",Cu="string_literal",w_=120596,__=43807,b_=69687,T_=63743,yk=72192,ju="member_property",E_=43262,Ou="class_declaration",pF="renders*",kF="%Li",S_=126578,Du="jsx_attribute",g3=254,Ee="empty",$l="label",Fu="object_internal_slot_property_type",gk=120133,A_=43359,Me="predicate",mF="??=",P_=43697,I_=-43,Ru="default_opt",hF="the start of a statement",N_=67826,Lu="object_",Mu="class_element",wk=11631,_k=70855,qu="opaque_type",Bu="number_literal",dF=", ",bk=8319,Tk=120004,Ek=133,Uu="type_params",Xu="pattern_object_rest_property",K1="import",C_=72e3,j_=67413,O_=12343,D_=70080,Yu="intersection_type",p1=-36,F_=70005,Sk="properties",R_=11679,L_=8483,M_=110587,yF=43520,zu="computed_key",gF=207,Ku="class_identifier",q_="Invalid number ",Ju="function_param_pattern",Zo=12288,B_=113817,U_=70730,X_=178207,Ak=71236,wF=167,Gu="object_indexer_property_type",Y_=64286,_F="TypeAnnotation",z_=220,Wu="type_identifier",Vu="spread_property",$u="jsx_attribute_value_expression",K_=126519,Pk=70108,Ik=126,Nk=42999,Xa="prototype",J_=" : flags Open_text and Open_binary are not compatible",bF="**",Ck=43823,G_=": Not a directory",Qu="render_type",jk=72349,w3="test",W_=43776,V_=92879,$_=11263,TF=241,Q_=93052,Hu="nullable_type",H_=43704,Z_=64321,EF="Property",xb=72191,SF=165,Ql="instanceof",rb=69247,qe="name",Ok=126634,eb=8516,Dk="typeArguments",tb=71127,Zu="jsx_spread_attribute",nb=66559,ub=44031,ib=43645,t1=8233,fb=71494,cb="opaque",Fk=72967,sb=70106,xi="logical",AF="@[%s =@ ",Hl="0o",Rk=126554,ab=71351,Lk=8484,ob=72242,Mk=120687,_3=252,vb=183983,Zl="%S",ri="function_this_param_type",PF=292,qk="decorators",lb=43255,ei="catch_clause",Be="-",pb=67711,IF=": file descriptor already closed",Bk=64311,Uk=120539,kb="arguments",Xk=73062,mb=173823,hb=42124,db=72095,yb=125259,gb=42969,Yk=70280,NF=12520,wb=69749,_b=70066,ti="binary",ni="for_in_statement",bb=43010,CF="^=",Tb=126570,ui="for_statement",zk=126584,ii="function_return_annotation",Eb=72144,Sb=8505,fi="class_expression",Ab=120076,Pb=69807,Ib=40981,Nb=-24976191,Cb=72768,jb=126550,Kk='"',ci="call_type_arg",jF="f",xv="this",Jk=126628,OF="===",DF=56320,si="declare_module_exports",Ob=120512,Pt=105,Db=119974,Fb=71450,Rb=71942,FF=195,Gk=120629,RF="/=",LF=">>",ai="declare_interface",MF=4096,oi="pattern_array_rest_element",Lb=71338,Wk=126520,vi="as_const_expression",qF="Popping lex mode from empty stack",BF="renders?",Mb=68405,li="member",pi="class_extends",rv=12287,Vk=126590,qb=66377,Ya="async",ki="pattern_array_element",b3=240,UF=308,Bb=69864,ev="readonly",Ub=70460,Xb=120779,Yb=66378,mi="new_",$k=126551,hi="pattern_object_rest_property_pattern",di="for_statement_init",zb=43595,Qk=68296,Kb=120712,Jb=64217,Gb=69295,XF="||",Wb=";",Vb=70461,$b=66939,YF="collect_comments",Hk=279,yi="generic_type",Qb=68295,Hb=44002,Zk=72162,gi="object_call_property_type",x8=8305,r8=119995,e8="with",wi="class_property",zF="qualification",_i="jsx_attribute_name_namespaced",bi="if_statement",Ti="typeof_qualified_identifier",KF=238,Zb=65615,JF=176,n1="expression",t8=126559,Ei="jsx_attribute_value",Si="<2>",Ai="component_param",n8="Map.bal",u8=132,xT=70412,rT=70440,GF="<<",i8="finally",WF="v",Pi="syntax_opt",Ii="meta_property",eT=12447,tT=67514,VF=260,f8=12448,Ni="object_mapped_type_property",tv="operator",$F="closedir",Ci="unary_expression",nT=126588,uT=70851,ji="export_batch_specifier",T3="renders",QF=226,iT=73111,HF=221,H0="",fT=66927,cT=64967,sT="elements",aT=67640,oT=43754,Oi="declare_export_declaration",vT=-26065557,lT=65855,x6="boolean",Ws="typeof",pT=124902,kT=139,mT=65629,ZF=224,hT=43123,c8=70449,dT=12735,K2=107,s8=11719,xR="!=",Di="call_type_args",E3="asserts",za=-46,yT="namespace",Fi="match_pattern",Ri="for_of_statement_lhs",a8=126504,gT=69505,o8="for",wT=72703,v8=120127,l8=43471,_T=93047,rR="Undefined_recursive_module",eR=2147483647,Li="template_literal_element",tR="Unexpected ",bT=101631,TT=65497,p8=68120,Mi="import_default_specifier",rn="array",nR="expressions",ET=110930,ST=204,qi="while_",Bi="function_rest_param_type",Ka=63,AT=77808,uR="Unexpected token `",kr=114,Ui="pattern_object_p",PT=65140,IT=123190,Xi="pattern_object_property_number_literal_key",r6="enum",Yi="conditional_type",J1=113,zi="array_type",iR="minus",NT=43790,Ki="do_while",CT=11567,jT=11694,e6=256,OT=119976,Ji="component_body",G1=111,DT=177976,fR=-56,k8=67644,FT=73439,t6=951901561,cR="?",sR=")",m8=43867,h8=65575,RT=69445,aR="FunctionTypeParam",d8=119996,LT=65019,Gi="conditional",MT=11505,oR=135,qT=71295,BT=12799,UT=67382,Wi="type_guard_annotation",Vi="object_key_computed",en=123,$i="pattern_object_property_key",XT=119892,YT=67505,zT=66962,Qi="with_",KT=43273,Hi="interface_declaration",y8="bool",JT=71945,GT="declaration",WT=11519,n6=">",VT=66771,g8="}",vR=8472,$T=43014,Zi="declare_function",Xr=127,QT="RestElement",HT=190,ZT=8467,lR="module",w8=126522,pR="Sys_blocked_io",xf="jsx_opening_element",rf="object_key_number_literal",kR="|=",mR="mixins",hR=205,dR=217,_8="if",yR="+=",ef="match_object_pattern_property_key",tf="match_rest_pattern",nf="export_named_declaration_specifier",b8="try",T8="_bigarr02",xE=70479,tn="right",rE=245,eE=11718,uf="tuple_labeled_element",gR="TypeParameterInstantiation",tE="mkdir",nE=71999,uE=870530776,wR="@[",_R=-908856609,bR=331416730,iE=11670,fE=66735,cE=43709,E8=43642,sE=67002,aE=69375,ff="function_body_any",oE=119807,TR="Assert_failure",cf="function_identifier",vE=65479,u6=131,nv="new",sf="for_of_left_declaration",lE=120084,pE=100343,kE=73030,S8=70452,ER=134,SR=152,mE=253,hE=42954,AR=227,af="jsx_member_expression_object",of="class_property_value",dE=120144,yE=66994,S3="set",gE=126498,vf="tuple_element",lf="arg_list",wE=65481,_E=8511,bE=42964,TE=11492,A3=-25,A8=126555,EE=71039,SE="exportKind",pf="program",AE=70187,PR=173,It="as",P3=124,IR="visit_leading_comment",PE=110575,kf="class_",IE=72440,NE=67897,NR=235,CE=8543,CR=141,mf=120,hf="match_object_pattern_property",i6=1024,jE=101640,jR=1027,OR=236,I3=246,DR="(",OE=66511,df="regexp_literal",DE=65574,FE=43513,RE=43695,FR="&&",P8=11558,LE=66503,ME=93071,yf="pattern_expression",qE=65381,I8=126538,BE=12292,gf="import_namespace_specifier",wf="match_statement_case",UE=67583,XE=120137,YE=69622,zE=120770,KE=71131,uv=8287,JE=110590,GE=65135,WE="Fatal error: exception ",f6=118,N8=181,C8=11687,k1="camlinternalFormat.ml",VE=72959,$E=249,_f="union_type",RR=8206,QE=73064,HE=70271,ZE=92728,j8=65344,O8=11695,bf="class_decorator",LR="the end of an expression statement (`;`)",xS=177983,rS=8457,MR=931,eS=66499,tS=94175,qR="#",nS="Identifier",Tf="for_in_statement_lhs",Ef="pattern_string_literal",D8=70302,F8=126496,uS=66461,iS=82943,R8=8450,fS=72271,cS=70853,sS="of",BR="Stack_overflow",c6="hasUnknownMembers",s6="a",Sf="variable_declarator_pattern",aS=73061,oS=77711,L8=64317,vS=73097,Af="enum_declaration",lS=66966,M8=189,pS=119964,Pf="type_param",nn=782176664,q8=65535,UR=-10,kS=64433,B8=43815,U8=94031,X8=73065,mS=69958,Y8="property",If="jsx_children",Nf="member_property_identifier",hS=42537,Ja="const",dS=70278,Cf="enum_string_member",a6="local",jf="jsx_element_name_identifier",yS=68223,z8="",gS=119967,K8=119994,wS=66993,Of="jsx_member_expression_identifier",J8="explicitType",_S=67589,bS=65597,TS="exported",ES=94111,SS=113775,Df="object_spread_property_type",AS=64847,Ff="component_identifier",Rf="class_implements_interface",XR=162,YR=243,PS=12783,zR=`Fatal error: exception %s +`,G8=120093,o6="column",Lf="component_rest_param",IS=70451,NS=70312,CS=69967,W8=70279,jS=66463,OS=92975,V8=70286,Mf="pattern_object_property_computed_key",qf="object_key_string_literal",DS="jsError",Bf="type_args",FS=8304,KR="==",iv=115,Uf="declare_component",RS=120092,LS=43638,MS=66811,qS=43334,BS=66863,US=77823,JR=143,Xf="optional_call",XS=126562,$8=70162,ft=104,YS=66963,fv="await",Q8=70107,W1="0",zS=72250,KS=8507,JS=100351,H8="AssignmentPattern",Yf="type",GR="%u",zf="function_expression_or_method",GS=43470,WR=242,VR="camlinternalMod.ml",Kf="match_or_pattern",WS=72750,VS=69414,$S=65370,Jf="syntax",$R=32752,QS=42963,QR="End_of_file",HS=12294,ZS=8471,HR="elementType",xA=43782,ZR="++",rA=43641,eA=71944,tA=126601,nA=78894,uA=-45,cv="null",iA=177,xL="satisfies",fA=131071,Gf="import_specifier",Wf="class_method",Vf="type_",cA=126514,sA=8454,rL="inexact",aA=67807,oA=8525,vA=65470,lA=71352,$f="tuple_spread_element",eL=219,pA="abstract",kA=73458,Ue="return",v6=65536,Z8=126548,Qf="array_element",mA=-253313196,hA=186,xm="catch",Hf="infer_type",dA=12295,tL="Invalid legacy octal ",yA=69762,gA=43311,wA=65437,Zf="variable_declaration",nL=-696510241,xc="function_params",_A=64316,uL=311,rm=11565,iL="infinity",bA="@]",TA=65908,rc="extends",EA=66204,SA=43784,AA=11742,em=126503,Xe="debugger",PA=70457,Vs=-86,l6=912068366,IA=68786,tm="keyof",nm=69415,NA=12686,un=127343600,ec="declare_type_alias",fL="the",cL=233,tc="jsx_element_name_namespaced",CA=72283,sL=161,nc="function_param_type",Nt=128,jA=-673950933,um=126591,aL="Sys_error",OA=74649,DA=74862,p6="is",FA=43738,RA=68479,LA=196,im=70854,uc="enum_boolean_member",ic="match_expression_case",fm=72163,MA=92783,fc="component_param_name",qA=68863,fn=32768,oL=2048,BA=64284,vL="@{",UA="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",cm=8455,cc="update_expression",lL=276,XA=65500,k6="from",YA=68447,sm=12592,zA=92766,pL=">>=",w1=110,KA=66431,JA=43586,sc="jsx_identifier",GA=" : file already exists",M2=128,WA=71958,VA=66717,ac="enum_boolean_body",$A=64262,Gr="id",oc="component_renders_annotation",QA=42888,HA=8584,ZA=73008,vc="enum_symbol_body",lc="declare_namespace",am=72713,xP=55215,pc="object_property_value_type",kc="for_in_assignment_pattern",om=8485,rP=43395,kL=229,$s="true",eP=43743,mc="enum_number_member",mL=234,tP=72969,hL="expected *",cn=102,dL=200,m6="symbol",sv="source",hc="tparam_const_modifier",nP=43714,dc="jsx_fragment",yc="jsx_attribute_name_identifier",h6="public",uP=43442,gc="pattern_object_property",iP=65786,fP=70783,cP=43713,sP=72160,yL="*-/",wc="export_named_specifier",_c="arrow_function",aP=122623,vm=70006,gL="${",oP=43814,bc="generic_qualified_identifier_type",wL=199,Tc="jsx_spread_child",lm=8489,pm=184,_L=2047,vP=66955,Ec="try_catch",lP=70497,bL=237,pP=67431,kP=125183,TL=-602162310,sn="params",mP="consequent",hP=68029,dP=67829,yP=68095,Sc="enum_string_body",gP=93823,wP=68351,_P=65495,Ac="declare_module",Pc="body_expression",bP=66175,TP=191,km=70441,mm=65141,hm="&",Ic="super_expression",dm=126564,EP=72105,vS0="fs",Ye="throw",SP=68287,AP=67839,av=116,PP=110882,IP=69404,NP=123197,ov=65279,N3="src/parser/type_parser.ml",CP=68115,EL=259,ym=126547,gm=126556,jP=73055,Nc="member_property_expression",Cc="enum_defaulted_member",OP=43071,DP=11726,jc="component_type_rest_param",FP=68607,Oc="object_key",SL=160,V1="variance",RP=70655,LP=70414,C3="super",MP=123583,qP=65594,d6="method",BP=73648,y6=121,UP=93951,Dc="pattern_array_element_pattern",XP=43764,YP=42993,wm=120145,zP=74879,AL=168,_m=8486,KP=72001,Fc="tagged_template",Rc="module_ref_literal",JP=65312,vv="implements",GP=43700,WP=120003,PL="Invalid_argument",Lc=16777215,VP=83526,bm=69744,Tm=12336,Mc="switch_case",IL=-61,qc="optional_member",$P=64274,Em=64322,Sm=126530,QP=71998,Am=72970,HP=13311,ZP=73647,xI=120074,j3="let",Bc="expression_statement",Uc="component_type_params",rI=512,eI=69634,tI=67461,nI=123627,uI=64913,NL="children",CL="PropertyDefinition",jL=1026,OL="%li",Xc="declare_class",iI=43258,Yc="indexed_access_type",fI=124926,Qs=112,cI="b",zc="predicate_expression",Kc="if_alternate_statement",g6="private",DL=-594953737,FL=140,sI="nan",aI=72103,Pm=11735,Jc="statement",oI="rmdir",Im=66512,vI="match",RL=198,lI=11734,Gc="import_named_specifier",pI=69599,kI=68799,mI=194559,Wc="match_array_pattern",LL=174,Vc="function_",$c="bigint_literal",i2=248,Nm=67638,Cm=126539,hI=11557,ML=214,dI=5760,ze="break",an="block",Qc="match_member_pattern",yI=123565,gI=66815,w2="value",qL=1039100673,wI=69746,_I=70448,bI=74751,Hc="init",TI=69551,jm=65548,Zc="jsx_member_expression",Om=68096,Hs=108,Dm=126521,EI=71487,xs="match_statement",SI=178205,AI=12548,BL=" : is a directory",on=".",PI=12348,O3=-835925911,$1="typeParameters",II=66855,u1="typeAnnotation",lv="bigint",rs="jsx_attribute_value_literal",NI=194,UL="T_JSX_TEXT",CI=68466,Fm=126537,XL=67714067,jI=69487,Rm="export",OI=43822,Lm=126499,DI=55242,es="member_type_identifier",YL=138,FI=71679,w6=130,RI=12438,LI=119969,zL=298,Mm=12539,MI=119972,KL=",",qI=71423,BI="index out of bounds",vn=106,D3="%d",JL="T_RENDERS_QUESTION",qm=120571,Bm="returnType",UI=69423,Um=120070,GL="%",F3=117,WL=179,XI="EBADF",YI=93759,Xm=64325,ts="component_params",zI=66517,KI=67423,JI=605857695,GI=43518,VL=251,ns="for_of_statement",WI=71983,$L="~",VI=12442,Ke="switch",$I=66207,Ym=126535,QL="&&=",QI=69289,HI=71723,us="generic_identifier_type",ZI=126619,is="object_type_property_setter",xN=70418,HL="<=",rN=125251,eN=11702,fs="enum_number_body",R3=250,tN=124910,nN=69297,uN=67455,iN=42511,cs="ts_satisfies",fN=68324,zm="an identifier",cN=126534,F1=103,sN=120126,L3=449540197,_6="declare",aN=68899,oN=126502,ZL=294,ss="function_expression",xM=142,vN=123135,lN=67967,pN=120487,kN=120686,as="export_named_declaration",mN=66348,Km=119981,hN=12352,os="tuple_type",dN=68680,Jm="target",vs="call";function _z(x,r,e,t,u){if(t<=r)for(var i=1;i<=u;i++)e[t+i]=x[r+i];else for(var i=u;i>=1;i--)e[t+i]=x[r+i];return 0}function bz(x){for(var r=[0];x!==0;){for(var e=x[1],t=1;tx.hi?1:this.hix.mi?1:this.mix.lo?1:this.loe?1:rx.mi?1:this.mix.lo?1:this.lo>24),e=-this.hi+(r>>24);return new tr(x,r,e)},tr.prototype.add=function(x){var r=this.lo+x.lo,e=this.mi+x.mi+(r>>24),t=this.hi+x.hi+(e>>24);return new tr(r,e,t)},tr.prototype.sub=function(x){var r=this.lo-x.lo,e=this.mi-x.mi+(r>>24),t=this.hi-x.hi+(e>>24);return new tr(r,e,t)},tr.prototype.mul=function(x){var r=this.lo*x.lo,e=(r*nM|0)+this.mi*x.lo+this.lo*x.mi,t=(e*nM|0)+this.hi*x.lo+this.mi*x.mi+this.lo*x.hi;return new tr(r,e,t)},tr.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0},tr.prototype.isNeg=function(){return this.hi<<16<0},tr.prototype.and=function(x){return new tr(this.lo&x.lo,this.mi&x.mi,this.hi&x.hi)},tr.prototype.or=function(x){return new tr(this.lo|x.lo,this.mi|x.mi,this.hi|x.hi)},tr.prototype.xor=function(x){return new tr(this.lo^x.lo,this.mi^x.mi,this.hi^x.hi)},tr.prototype.shift_left=function(x){return x=x&63,x==0?this:x<24?new tr(this.lo<>24-x,this.hi<>24-x):x<48?new tr(0,this.lo<>48-x):new tr(0,0,this.lo<>x|this.mi<<24-x,this.mi>>x|this.hi<<24-x,this.hi>>x):x<48?new tr(this.mi>>x-24|this.hi<<48-x,this.hi>>x-24,0):new tr(this.hi>>x-48,0,0)},tr.prototype.shift_right=function(x){if(x=x&63,x==0)return this;var r=this.hi<<16>>16;if(x<24)return new tr(this.lo>>x|this.mi<<24-x,this.mi>>x|r<<24-x,this.hi<<16>>x>>>16);var e=this.hi<<16>>31;return x<48?new tr(this.mi>>x-24|this.hi<<48-x,this.hi<<16>>x-24>>16,e&xn):new tr(this.hi<<16>>x-32,e,e)},tr.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23,this.mi=(this.mi<<1|this.lo>>23)&Lc,this.lo=this.lo<<1&Lc},tr.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&Lc,this.mi=(this.mi>>>1|this.hi<<23)&Lc,this.hi=this.hi>>>1},tr.prototype.udivmod=function(x){for(var r=0,e=this.copy(),t=x.copy(),u=new tr(0,0,0);e.ucompare(t)>0;)r++,t.lsl1();for(;r>=0;)r--,u.lsl1(),e.ucompare(t)>=0&&(u.lo++,e=e.sub(t)),t.lsr1();return{quotient:u,modulus:e}},tr.prototype.div=function(x){var r=this;x.isZero()&&iM();var e=r.hi^x.hi;r.hi&fn&&(r=r.neg()),x.hi&fn&&(x=x.neg());var t=r.udivmod(x).quotient;return e&fn&&(t=t.neg()),t},tr.prototype.mod=function(x){var r=this;x.isZero()&&iM();var e=r.hi;r.hi&fn&&(r=r.neg()),x.hi&fn&&(x=x.neg());var t=r.udivmod(x).modulus;return e&fn&&(t=t.neg()),t},tr.prototype.toInt=function(){return this.lo|this.mi<<24},tr.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo},tr.prototype.toArray=function(){return[this.hi>>8,this.hi&Us,this.mi>>16,this.mi>>8&Us,this.mi&Us,this.lo>>16,this.lo>>8&Us,this.lo&Us]},tr.prototype.lo32=function(){return this.lo|(this.mi&Us)<<24},tr.prototype.hi32=function(){return this.mi>>>8&xn|this.hi<<16};function Pz(x,r){return new tr(x&Lc,x>>>24&Us|(r&xn)<<8,r>>>16&xn)}function wN(x){return x.hi32()}function _N(x){return x.lo32()}function b6(){i1(BI)}var Iz=T8;function Ga(x,r,e,t){this.kind=x,this.layout=r,this.dims=e,this.data=t}Ga.prototype.caml_custom=Iz,Ga.prototype.offset=function(x){var r=0;if(typeof x=="number"&&(x=[x]),x instanceof Array||i1("bigarray.js: invalid offset"),this.dims.length!=x.length&&i1("Bigarray.get/set: bad number of dimensions"),this.layout==0)for(var e=0;e=this.dims[e])&&b6(),r=r*this.dims[e]+x[e];else for(var e=this.dims.length-1;e>=0;e--)(x[e]<1||x[e]>this.dims[e])&&b6(),r=r*this.dims[e]+(x[e]-1);return r},Ga.prototype.get=function(x){switch(this.kind){case 7:var r=this.data[x*2+0],e=this.data[x*2+1];return Pz(r,e);case 10:case 11:var t=this.data[x*2+0],u=this.data[x*2+1];return[g3,t,u];default:return this.data[x]}},Ga.prototype.set=function(x,r){switch(this.kind){case 7:this.data[x*2+0]=_N(r),this.data[x*2+1]=wN(r);break;case 10:case 11:this.data[x*2+0]=r[1],this.data[x*2+1]=r[2];break;default:this.data[x]=r;break}return 0},Ga.prototype.fill=function(x){switch(this.kind){case 7:var r=_N(x),e=wN(x);if(r==e)this.data.fill(r);else for(var t=0;tc)return 1;if(i!=c){if(!r)return NaN;if(i==i)return 1;if(c==c)return-1}}break;case 7:for(var u=0;ux.data[u+1])return 1;if(this.data[u]>>>0>>0)return-1;if(this.data[u]>>>0>x.data[u]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var u=0;ux.data[u])return 1}break}return 0};function q3(x,r,e,t){this.kind=x,this.layout=r,this.dims=e,this.data=t}q3.prototype=new Ga,q3.prototype.offset=function(x){return typeof x!="number"&&(x instanceof Array&&x.length==1?x=x[0]:i1("Ml_Bigarray_c_1_1.offset")),(x<0||x>=this.dims[0])&&b6(),x},q3.prototype.get=function(x){return this.data[x]},q3.prototype.set=function(x,r){return this.data[x]=r,0},q3.prototype.fill=function(x){return this.data.fill(x),0};function bN(x,r,e,t){var u=eM(x);return Wm(e)*u!=t.length&&i1("length doesn't match dims"),r==0&&e.length==1&&u==1?new q3(x,r,e,t):new Ga(x,r,e,t)}function fM(x){return x.slice(1)}function Nz(x,r,e){var t=fM(e),u=tM(x,Wm(t));return bN(x,r,t,u)}function T6(x,r,e){return x.set(x.offset(r),e),0}function E6(x,r,e){var t=String.fromCharCode;if(r==0&&e<=MF&&e==x.length)return t.apply(null,x);for(var u=H0;0=e.l||e.t==2&&u>=e.c.length))e.c=x.t==4?E6(x.c,r,u):r==0&&x.c.length==u?x.c:x.c.substr(r,u),e.t=e.c.length==e.l?0:2;else if(e.t==2&&t==e.c.length)e.c+=x.t==4?E6(x.c,r,u):r==0&&x.c.length==u?x.c:x.c.substr(r,u),e.t=e.c.length==e.l?0:2;else{e.t!=4&&Vm(e);var i=x.c,c=e.c;if(x.t==4)if(t<=r)for(var v=0;v=0;v--)c[t+v]=i[r+v];else{for(var a=Math.min(u,i.length-r),v=0;v>=1,x==0)return e;r+=r,t++,t==9&&r.slice(0,1)}}function $m(x){x.t==2?x.c+=B3(x.l-x.c.length,"\0"):x.c=E6(x.c,0,x.c.length),x.t=0}function TN(x){if(x.length<24){for(var r=0;rXr)return!1;return!0}else return!/[^\x00-\x7f]/.test(x)}function cM(x){for(var r=H0,e=H0,t,u,i,c,v=0,a=x.length;vrI?(e.substr(0,1),r+=e,e=H0,r+=x.slice(v,l)):e+=x.slice(v,l),l==a)break;v=l}c=1,++v=55295&&c<57344)&&(c=2)):(c=3,++v1114111)&&(c=3)))))),c<4?(v-=c,e+="\uFFFD"):c>xn?e+=String.fromCharCode(55232+(c>>10),DF+(c&1023)):e+=String.fromCharCode(c),e.length>i6&&(e.substr(0,1),r+=e,e=H0)}return r+e}function xa(x,r,e){this.t=x,this.c=r,this.l=e}xa.prototype.toString=function(){switch(this.t){case 9:return this.c;default:$m(this);case 0:if(TN(this.c))return this.t=9,this.c;this.t=8;case 8:return this.c}},xa.prototype.toUtf16=function(){var x=this.toString();return this.t==9?x:cM(x)},xa.prototype.slice=function(){var x=this.t==4?this.c.slice():this.c;return new xa(this.t,x,this.l)};function sM(x){return new xa(0,x,x.length)}function pS0(x){return x}function Ct(x){return sM(x)}function ls(x,r,e,t,u){return Zs(Ct(x),r,e,t,u),0}function U3(x){return new tr(x[7]<<0|x[6]<<8|x[5]<<16,x[4]<<0|x[3]<<8|x[2]<<16,x[1]<<0|x[0]<<8)}function ae(x,r){switch(x.t&6){default:if(r>=x.c.length)return 0;case 0:return x.c.charCodeAt(r);case 4:return x.c[r]}}function EN(){i1(BI)}function Cz(x,r){r>>>0>=x.l-7&&EN();for(var e=new Array(8),t=0;t<8;t++)e[7-t]=ae(x,r+t);return U3(e)}function Yr(x,r,e){if(e&=Us,x.t!=4){if(r==x.c.length)return x.c+=String.fromCharCode(e),r+1==x.l&&(x.t=0),0;Vm(x)}return x.c[r]=e,0}function ra(x,r,e){return r>>>0>=x.l&&EN(),Yr(x,r,e)}function X3(x){return x.toArray()}function jz(x,r,e){r>>>0>=x.l-7&&EN();for(var t=X3(e),u=0;u<8;u++)Yr(x,r+7-u,t[u]);return 0}function ps(x,r){var e=x.l>=0?x.l:x.l=x.length,t=r.length,u=e-t;if(u==0)return x.apply(null,r);if(u<0){var i=x.apply(null,r.slice(0,e));return typeof i!="function"?i:ps(i,r.slice(e))}else{switch(u){case 1:{var i=function(a){for(var l=new Array(t+1),m=0;m>>0>=x.length-1&&b6(),x}function Oz(x){return isFinite(x)?Math.abs(x)>=22250738585072014e-324?0:x!=0?1:2:isNaN(x)?4:3}function Dz(x){return x==rE?1:0}var Fz=Math.log2&&Math.log2(11235582092889474e291)==1020;function Rz(x){if(Fz)return Math.floor(Math.log2(x));var r=0;if(x==0)return-1/0;if(x>=1)for(;x>=2;)x/=2,r++;else for(;x<1;)x*=2,r--;return r}function SN(x){var r=new Float32Array(1);r[0]=x;var e=new Int32Array(r.buffer);return e[0]|0}function ct(x,r,e){return new tr(x,r,e)}function Qm(x){if(!isFinite(x))return isNaN(x)?ct(1,0,$R):x>0?ct(0,0,$R):ct(0,0,65520);var r=x==0&&1/x==-1/0?fn:x>=0?0:fn;r&&(x=-x);var e=Rz(x)+1023;e<=0?(e=0,x/=Math.pow(2,-jL)):(x/=Math.pow(2,e-jR),x<16&&(x*=2,e-=1),e==0&&(x/=2));var t=Math.pow(2,24),u=x|0;x=(x-u)*t;var i=x|0;x=(x-i)*t;var c=x|0;return u=u&ow|r|e<<4,ct(c,i,u)}function aM(x,r,e){if(x.write(32,r.dims.length),x.write(32,r.kind|r.layout<<8),r.caml_custom==T8)for(var t=0;t>4;if(u==_L)return(r|e|t&ow)==0?t&fn?-1/0:1/0:NaN;var i=Math.pow(2,-24),c=(r*i+e)*i+(t&ow);return u>0?(c+=16,c*=Math.pow(2,u-jR)):c*=Math.pow(2,-jL),t&fn&&(c=-c),c}function H1(x){Q1.Failure||(Q1.Failure=[i2,Ad,-3]),gN(Q1.Failure,x)}function oM(x,r,e){var t=x.read32s();(t<0||t>16)&&H1("input_value: wrong number of bigarray dimensions");var u=x.read32s(),i=u&Us,c=u>>8&1,v=[];if(e==T8)for(var a=0;a>>17,r=lM(r,461845907),x^=r,x=x<<13|x>>>19,(x+(x<<2)|0)+-430675100|0}function Lz(x,r){return x=ea(x,_N(r)),x=ea(x,wN(r)),x}function pM(x,r){return Lz(x,Qm(r))}function kM(x){var r=Wm(x.dims),e=0;switch(x.kind){case 2:case 3:case 12:r>e6&&(r=e6);var t=0,u=0;for(u=0;u+4<=x.data.length;u+=4)t=x.data[u+0]|x.data[u+1]<<8|x.data[u+2]<<16|x.data[u+3]<<24,e=ea(e,t);switch(t=0,r&3){case 3:t=x.data[u+2]<<16;case 2:t|=x.data[u+1]<<8;case 1:t|=x.data[u+0],e=ea(e,t)}break;case 4:case 5:r>M2&&(r=M2);var t=0,u=0;for(u=0;u+2<=x.data.length;u+=2)t=x.data[u+0]|x.data[u+1]<<16,e=ea(e,t);(r&1)!=0&&(e=ea(e,x.data[u]));break;case 6:r>64&&(r=64);for(var u=0;u64&&(r=64);for(var u=0;u32&&(r=32),r*=2;for(var u=0;u64&&(r=64);for(var u=0;u32&&(r=32);for(var u=0;u0?u(r,x,t):u(x,r,t);if(t&&i!=i)return e;if(+i!=+i)return+i;if((i|0)!=0)return i|0}return e}function NN(x){return typeof x=="string"&&!/[^\x00-\xff]/.test(x)}function CN(x){return x instanceof xa}function dM(x){if(typeof x=="number")return zl;if(CN(x))return _3;if(NN(x))return 1252;if(x instanceof Array&&x[0]===x[0]>>>0&&x[0]<=xk){var r=x[0]|0;return r==g3?0:r}else{if(x instanceof String)return NF;if(typeof x=="string")return NF;if(x instanceof Number)return zl;if(x&&x.caml_custom)return U9;if(x&&x.compare)return 1256;if(typeof x=="function")return 1247;if(typeof x=="symbol")return 1251}return 1001}function Je(x,r){return xr?1:0}function zz(x,r){return x.t&6&&$m(x),r.t&6&&$m(r),x.cr.c?1:0}function Hm(x,r,e){for(var t=[];;){if(!(e&&x===r)){var u=dM(x);if(u==R3){x=x[1];continue}var i=dM(r);if(i==R3){r=r[1];continue}if(u!==i)return u==zl?i==U9?hM(x,r,-1,e):-1:i==zl?u==U9?hM(r,x,1,e):1:ur)return 1;if(x!=r){if(!e)return NaN;if(x==x)return 1;if(r==r)return-1}break;case 1001:if(xr)return 1;if(x!=r){if(!e)return NaN;if(x==x)return 1;if(r==r)return-1}break;case 1251:if(x!==r)return e?1:NaN;break;case 1252:var x=x,r=r;if(x!==r){if(xr)return 1}break;case 12520:var x=x.toString(),r=r.toString();if(x!==r){if(xr)return 1}break;case 246:case 254:default:if(Dz(u)){i1("compare: continuation value");break}if(x.length!=r.length)return x.length1&&t.push(x,r,1);break}}if(t.length==0)return 0;var a=t.pop();r=t.pop(),x=t.pop(),a+10)if(r==0&&(e>=x.l||x.t==2&&e>=x.c.length))t==0?(x.c=H0,x.t=2):(x.c=B3(e,String.fromCharCode(t)),x.t=e==x.l?0:2);else for(x.t!=4&&Vm(x),e+=r;r0&&r===r||(x=x.replace(/_/g,H0),r=+x,x.length>0&&r===r||/^[+-]?nan$/i.test(x)))return r;var e=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(x);if(e){var t=e[3].replace(/0+$/,H0),u=parseInt(e[1]+e[2]+t,16),i=(e[5]|0)-4*t.length;return r=u*Math.pow(2,i),r}if(/^\+?inf(inity)?$/i.test(x))return 1/0;if(/^-inf(inity)?$/i.test(x))return-1/0;H1("float_of_string")}function ON(x){x=x;var r=x.length;r>31&&i1("format_int: format too long");for(var e={justify:z7,signstyle:Be,filler:_u,alternate:!1,base:0,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:jF},t=0;t=0&&u<=9;)e.width=e.width*10+u,t++;t--;break;case".":for(e.prec=0,t++;u=x.charCodeAt(t)-48,u>=0&&u<=9;)e.prec=e.prec*10+u,t++;t--;case"d":case"i":e.signedconv=!0;case"u":e.base=10;break;case"x":e.base=16;break;case"X":e.base=16,e.uppercase=!0;break;case"o":e.base=8;break;case"e":case"f":case"g":e.signedconv=!0,e.conv=u;break;case"E":case"F":case"G":e.signedconv=!0,e.uppercase=!0,e.conv=u.toLowerCase();break}}return e}function DN(x,r){x.uppercase&&(r=r.toUpperCase());var e=r.length;x.signedconv&&(x.sign<0||x.signstyle!=Be)&&e++,x.alternate&&(x.base==8&&(e+=1),x.base==16&&(e+=2));var t=H0;if(x.justify==z7&&x.filler==_u)for(var u=e;u20?(T-=20,m/=Math.pow(10,T),m+=new Array(T+1).join(W1),h>0&&(m=m+on+new Array(h+1).join(W1)),m):m.toFixed(h)}var t,u=ON(x),i=u.prec<0?6:u.prec;if((r<0||r==0&&1/r==-1/0)&&(u.sign=-1,r=-r),isNaN(r))t=sI,u.filler=_u;else if(!isFinite(r))t="inf",u.filler=_u;else switch(u.conv){case"e":var t=r.toExponential(i),c=t.length;t.charAt(c-3)==Tw&&(t=t.slice(0,c-1)+W1+t.slice(c-1));break;case"f":t=e(r,i);break;case"g":i=i||1,t=r.toExponential(i-1);var v=t.indexOf(Tw),a=+t.slice(v+1);if(a<-4||r>=1e21||r.toFixed(0).length>i){for(var c=v-1;t.charAt(c)==W1;)c--;t.charAt(c)==on&&c--,t=t.slice(0,c+1)+t.slice(v),c=t.length,t.charAt(c-3)==Tw&&(t=t.slice(0,c-1)+W1+t.slice(c-1));break}else{var l=i;if(a<0)l-=a+1,t=r.toFixed(l);else for(;t=r.toFixed(l),t.length>i+1;)l--;if(l){for(var c=t.length-1;t.charAt(c)==W1;)c--;t.charAt(c)==on&&c--,t=t.slice(0,c+1)}}break}return DN(u,t)}function x5(x,r){if(x==D3)return H0+r;var e=ON(x);r<0&&(e.signedconv?(e.sign=-1,r=-r):r>>>=0);var t=r.toString(e.base);if(e.prec>=0){e.filler=_u;var u=e.prec-t.length;u>0&&(t=B3(u,W1)+t)}return DN(e,t)}var wM=0;function ks(){return wM++}function _M(){return[0]}var r5=[];function Xx(x,r,e){var t=x[1],u=r5[e];if(u===void 0)for(var i=r5.length;i>1|1,rrI?(e.substr(0,1),r+=e,e=H0,r+=x.slice(i,v)):e+=x.slice(i,v),v==c)break;i=v}t>6),e+=String.fromCharCode(Nt|t&Ka)):t<55296||t>=fF?e+=String.fromCharCode(ZF|t>>12,Nt|t>>6&Ka,Nt|t&Ka):t>=56319||i+1==c||(u=x.charCodeAt(i+1))fF?e+="\xEF\xBF\xBD":(i++,t=(t<<10)+u-56613888,e+=String.fromCharCode(XD|t>>18,Nt|t>>12&Ka,Nt|t>>6&Ka,Nt|t&Ka)),e.length>i6&&(e.substr(0,1),r+=e,e=H0)}return r+e}function jt(x){return TN(x)?x:Vz(x)}function $z(x,r,e){if(!isFinite(x))return isNaN(x)?jt(sI):jt(x>0?iL:"-infinity");var t=x==0&&1/x==-1/0?1:x>=0?0:1;t&&(x=-x);var u=0;if(x!=0)if(x<1)for(;x<1&&u>-1022;)x*=2,u--;else for(;x>=2;)x/=2,u++;var i=u<0?H0:z7,c=H0;if(t)c=Be;else switch(e){case 43:c=z7;break;case 32:c=_u;break;default:break}if(r>=0&&r<13){var v=Math.pow(2,r*4);x=Math.round(x*v)/v}var a=x.toString(16);if(r>=0){var l=a.indexOf(on);if(l<0)a+=on+B3(r,W1);else{var m=l+1+r;a.length>24&Lc,x>>31&xn)}function Hz(x){return x.toInt()}function Zz(x){return+x.isNeg()}function RN(x){return x.neg()}function bM(x,r){var e=ON(x);e.signedconv&&Zz(r)&&(e.sign=-1,r=RN(r));var t=H0,u=S6(e.base),i="0123456789abcdef";do{var c=r.udivmod(u);r=c.quotient,t=i.charAt(Hz(c.modulus))+t}while(!Qz(r));if(e.prec>=0){e.filler=_u;var v=e.prec-t.length;v>0&&(t=B3(v,W1)+t)}return DN(e,t)}function Cx(x){return x.length}function Y0(x,r){return x.charCodeAt(r)}function TM(x,r){return x.add(r)}function EM(x,r){return x.mul(r)}function LN(x,r){return x.ucompare(r)<0}function SM(x){var r=0,e=Cx(x),t=10,u=1;if(e>0)switch(Y0(x,r)){case 45:r++,u=-1;break;case 43:r++,u=1;break}if(r+1=48&&x<=57?x-48:x>=65&&x<=90?x-55:x>=97&&x<=c2?x-87:-1}function pv(x){var r=SM(x),e=r[0],t=r[1],u=r[2],i=S6(u),c=new tr(Lc,268435455,xn).udivmod(i).quotient,v=Y0(x,e),a=e5(v);(a<0||a>=u)&&H1(Bs);for(var l=S6(a);;)if(e++,v=Y0(x,e),v!=95){if(a=e5(v),a<0||a>=u)break;LN(c,l)&&H1(Bs),a=S6(a),l=TM(EM(i,l),a),LN(l,a)&&H1(Bs)}return e!=Cx(x)&&H1(Bs),u==10&&LN(new tr(0,0,fn),l)&&H1(Bs),t<0&&(l=RN(l)),l}function AM(x,r){return x.or(r)}function t5(x){return x.toFloat()}function st(x){var r=SM(x),e=r[0],t=r[1],u=r[2],i=Cx(x),c=-1>>>0,v=e=u)&&H1(Bs);var l=a;for(e++;e=u)break;l=u*l+a,l>c&&H1(Bs)}return e!=i&&H1(Bs),l=t*l,u==10&&(l|0)!=l&&H1(Bs),l|0}function Gx(x){return TN(x)?x:cM(x)}function xK(x){for(var r={},e=1;e=0?x.l:x.l=x.length}function eK(x){return function(){for(var r=rK(x),e=new Array(r),t=0;t>>0&&MN(x,I3,Go)?0:1}function uK(x){return MN(x,Go,R3),0}function iK(x,r){return+(Hm(x,r,!1)<0)}function PM(x){return x}function fK(x,r){return x.get(x.offset(r))}function cK(x,r){return x.xor(r)}function sK(x,r){return x.shift_right_unsigned(r)}function aK(x,r){return x.shift_left(r)}function u5(x){function r(q,K){return aK(q,K)}function e(q,K){return sK(q,K)}function t(q,K){return AM(q,K)}function u(q,K){return cK(q,K)}function i(q,K){return TM(q,K)}function c(q,K){return EM(q,K)}function v(q,K){return t(r(q,K),e(q,64-K))}function a(q,K){return fK(q,K)}function l(q,K,u0){return T6(q,K,u0)}var m=pv(PM("0xd1342543de82ef95")),h=pv(PM("0xdaba0b6eb09322e3")),T,M,Y,b=x,N=a(b,0),C=a(b,1),I=a(b,2),F=a(b,3);T=i(C,I),T=c(u(T,e(T,32)),h),T=c(u(T,e(T,32)),h),T=u(T,e(T,32)),l(b,1,i(c(C,m),N));var M=I,Y=F;return Y=u(Y,M),M=v(M,24),M=u(u(M,Y),r(Y,16)),Y=v(Y,37),l(b,2,M),l(b,3,Y),T}function Wa(e,r){e<0&&b6();var e=e+1|0,t=new Array(e);t[0]=0;for(var u=1;u>>32-m,a)}function e(c,v,a,l,m,h,T){return r(v&a|~v&l,c,v,m,h,T)}function t(c,v,a,l,m,h,T){return r(v&l|a&~l,c,v,m,h,T)}function u(c,v,a,l,m,h,T){return r(v^a^l,c,v,m,h,T)}function i(c,v,a,l,m,h,T){return r(a^(v|~l),c,v,m,h,T)}return function(c,v){var a=c[0],l=c[1],m=c[2],h=c[3];a=e(a,l,m,h,v[0],7,3614090360),h=e(h,a,l,m,v[1],12,3905402710),m=e(m,h,a,l,v[2],17,606105819),l=e(l,m,h,a,v[3],22,3250441966),a=e(a,l,m,h,v[4],7,4118548399),h=e(h,a,l,m,v[5],12,1200080426),m=e(m,h,a,l,v[6],17,2821735955),l=e(l,m,h,a,v[7],22,4249261313),a=e(a,l,m,h,v[8],7,1770035416),h=e(h,a,l,m,v[9],12,2336552879),m=e(m,h,a,l,v[10],17,4294925233),l=e(l,m,h,a,v[11],22,2304563134),a=e(a,l,m,h,v[12],7,1804603682),h=e(h,a,l,m,v[13],12,4254626195),m=e(m,h,a,l,v[14],17,2792965006),l=e(l,m,h,a,v[15],22,1236535329),a=t(a,l,m,h,v[1],5,4129170786),h=t(h,a,l,m,v[6],9,3225465664),m=t(m,h,a,l,v[11],14,643717713),l=t(l,m,h,a,v[0],20,3921069994),a=t(a,l,m,h,v[5],5,3593408605),h=t(h,a,l,m,v[10],9,38016083),m=t(m,h,a,l,v[15],14,3634488961),l=t(l,m,h,a,v[4],20,3889429448),a=t(a,l,m,h,v[9],5,568446438),h=t(h,a,l,m,v[14],9,3275163606),m=t(m,h,a,l,v[3],14,4107603335),l=t(l,m,h,a,v[8],20,1163531501),a=t(a,l,m,h,v[13],5,2850285829),h=t(h,a,l,m,v[2],9,4243563512),m=t(m,h,a,l,v[7],14,1735328473),l=t(l,m,h,a,v[12],20,2368359562),a=u(a,l,m,h,v[5],4,4294588738),h=u(h,a,l,m,v[8],11,2272392833),m=u(m,h,a,l,v[11],16,1839030562),l=u(l,m,h,a,v[14],23,4259657740),a=u(a,l,m,h,v[1],4,2763975236),h=u(h,a,l,m,v[4],11,1272893353),m=u(m,h,a,l,v[7],16,4139469664),l=u(l,m,h,a,v[10],23,3200236656),a=u(a,l,m,h,v[13],4,681279174),h=u(h,a,l,m,v[0],11,3936430074),m=u(m,h,a,l,v[3],16,3572445317),l=u(l,m,h,a,v[6],23,76029189),a=u(a,l,m,h,v[9],4,3654602809),h=u(h,a,l,m,v[12],11,3873151461),m=u(m,h,a,l,v[15],16,530742520),l=u(l,m,h,a,v[2],23,3299628645),a=i(a,l,m,h,v[0],6,4096336452),h=i(h,a,l,m,v[7],10,1126891415),m=i(m,h,a,l,v[14],15,2878612391),l=i(l,m,h,a,v[5],21,4237533241),a=i(a,l,m,h,v[12],6,1700485571),h=i(h,a,l,m,v[3],10,2399980690),m=i(m,h,a,l,v[10],15,4293915773),l=i(l,m,h,a,v[1],21,2240044497),a=i(a,l,m,h,v[8],6,1873313359),h=i(h,a,l,m,v[15],10,4264355552),m=i(m,h,a,l,v[6],15,2734768916),l=i(l,m,h,a,v[13],21,1309151649),a=i(a,l,m,h,v[4],6,4149444226),h=i(h,a,l,m,v[11],10,3174756917),m=i(m,h,a,l,v[2],15,718787259),l=i(l,m,h,a,v[9],21,3951481745),c[0]=x(a,c[0]),c[1]=x(l,c[1]),c[2]=x(m,c[2]),c[3]=x(h,c[3])}}();function vK(x,r,e){var t=x.len&Ka,u=0;if(x.len+=e,t){var i=64-t;if(e=64;)x.b8.set(r.subarray(u,u+64),0),i5(x.w,x.b32),e-=64,u+=64;e&&x.b8.set(r.subarray(u,u+e),0)}function lK(x){var r=x.len&Ka;if(x.b8[r]=Nt,r++,r>56){for(var e=r;e<64;e++)x.b8[e]=0;i5(x.w,x.b32);for(var e=0;e<56;e++)x.b8[e]=0}else for(var e=r;e<56;e++)x.b8[e]=0;x.b32[14]=x.len<<3,x.b32[15]=x.len>>29&536870911,i5(x.w,x.b32);for(var t=new Uint8Array(16),u=0;u<4;u++)for(var e=0;e<4;e++)t[u*4+e]=x.w[u]>>8*e&255;return t}function qN(x){return x.t!=4&&Vm(x),x.c}function pK(x){return E6(x,0,x.length)}function kK(x,r,e){var t=oK(),u=qN(x);return vK(t,u.subarray(r,r+e),e),pK(lK(t))}function mK(x,r,e){return kK(Ct(x),r,e)}function Ot(x){return x.l}function hK(){return 0}function jr(x){gN(Q1.Sys_error,x)}var ta=new Array;function ln(x){var r=ta[x];return r.opened||jr("Cannot flush a closed channel"),!r.buffer||r.buffer_curr==0||(r.output?r.output(E6(r.buffer,0,r.buffer_curr)):r.file.write(r.offset,r.buffer,0,r.buffer_curr),r.offset+=r.buffer_curr,r.buffer_curr=0),0}function IM(){}function kS0(x){for(var r=Cx(x),e=new Uint8Array(r),t=0;t1&&t.pop();break;case".":break;case"":break;default:t.push(e[u]);break}return t.unshift(r[0]),t.orig=x,t}var wK=["E2BIG","EACCES","EAGAIN",XI,"EBUSY","ECHILD","EDEADLK","EDOM",RO,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",Sw,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",Qg,vD,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function na(x,r,e,t){var u=wK.indexOf(x);u<0&&(t==null&&(t=-9999),u=[0,t]);var i=[u,jt(r||H0),jt(e||H0)];return i}var CM={};function Va(x){return CM[x]}function ua(x,r){throw K0([0,x].concat(r))}function UN(x){return x instanceof Uint8Array||(x=new Uint8Array(x)),new xa(4,x,x.length)}function jM(x){jr(x+rp)}function oe(x){this.data=x}oe.prototype=new IM,oe.prototype.constructor=oe,oe.prototype.truncate=function(x){var r=this.data;this.data=E2(x|0),Zs(r,0,this.data,0,x)},oe.prototype.length=function(){return Ot(this.data)},oe.prototype.write=function(x,r,e,t){var u=this.length();if(x+t>=u){var i=E2(x+t),c=this.data;this.data=i,Zs(c,0,this.data,0,u)}return Zs(UN(r),e,this.data,x,t),0},oe.prototype.read=function(x,r,e,t){var u=this.length();if(x+t>=u&&(t=u-x),t){var i=E2(t|0);Zs(this.data,x,i,0,t),r.set(qN(i),e)}return t};function kv(x,r,e){this.file=r,this.name=x,this.flags=e}kv.prototype.err_closed=function(){jr(this.name+IF)},kv.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()},kv.prototype.write=function(x,r,e,t){if(this.file)return this.file.write(x,r,e,t);this.err_closed()},kv.prototype.read=function(x,r,e,t){if(this.file)return this.file.read(x,r,e,t);this.err_closed()},kv.prototype.close=function(){this.file=void 0};function _1(x,r){this.content={},this.root=x,this.lookupFun=r}_1.prototype.nm=function(x){return this.root+x},_1.prototype.create_dir_if_needed=function(x){for(var r=x.split(fe),e=H0,t=0;t0&&e>=0&&e+t<=r.length&&r[e+t-1]==10&&t--;var u=E2(t);return Zs(UN(r),e,u,0,t),this.log(u.toUtf16()),0}jr(this.fd+IF)},I6.prototype.read=function(x,r,e,t){jr(this.fd+": file descriptor is write only")},I6.prototype.close=function(){this.log=void 0};function s5(x,r){return r==null&&(r=f5.length),f5[r]=x,r|0}function mS0(x,r,e){for(var t={};r;){switch(r[1]){case 0:t.rdonly=1;break;case 1:t.wronly=1;break;case 2:t.append=1;break;case 3:t.create=1;break;case 4:t.truncate=1;break;case 5:t.excl=1;break;case 6:t.binary=1;break;case 7:t.text=1;break;case 8:t.nonblock=1;break}r=r[2]}t.rdonly&&t.wronly&&jr(x+Cy),t.text&&t.binary&&jr(x+J_);var u=_K(x),i=u.device.open(u.rest,t);return s5(i,void 0)}(function(){function x(r,e){return A6()?dK(r,e):new I6(r,e)}s5(x(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:!0}),0),s5(x(1,{buffered:2,wronly:1,isCharacterDevice:!0}),1),s5(x(2,{buffered:2,wronly:1,isCharacterDevice:!0}),2)})();function bK(x){var r=f5[x];r.flags.wronly&&jr(UD+x+" is writeonly");var e=null,t={file:r,offset:r.flags.append?r.length():0,fd:x,opened:!0,out:!1,buffer_curr:0,buffer_max:0,buffer:new Uint8Array(v6),refill:e};return ta[t.fd]=t,t.fd}function DM(x){var r=f5[x];r.flags.rdonly&&jr(UD+x+" is readonly");var e=r.flags.buffered!==void 0?r.flags.buffered:1,t={file:r,offset:r.flags.append?r.length():0,fd:x,opened:!0,out:!0,buffer_curr:0,buffer:new Uint8Array(v6),buffered:e};return ta[t.fd]=t,t.fd}function TK(){for(var x=0,r=0;ru.buffer.length){var i=new Uint8Array(u.buffer_curr+r.length);i.set(u.buffer),u.buffer=i}switch(u.buffered){case 0:u.buffer.set(r,u.buffer_curr),u.buffer_curr+=r.length,ln(x);break;case 1:u.buffer.set(r,u.buffer_curr),u.buffer_curr+=r.length,u.buffer_curr>=u.buffer.length&&ln(x);break;case 2:var c=r.lastIndexOf(10);c<0?(u.buffer.set(r,u.buffer_curr),u.buffer_curr+=r.length,u.buffer_curr>=u.buffer.length&&ln(x)):(u.buffer.set(r.subarray(0,c+1),u.buffer_curr),u.buffer_curr+=c+1,ln(x),u.buffer.set(r.subarray(c+1),u.buffer_curr),u.buffer_curr+=r.length-c-1);break}return 0}function SK(x,u,e,t){var u=qN(u);return EK(x,u,e,t)}function XN(x,r,e,t){return SK(x,Ct(r),e,t)}function FM(x,r){var e=String.fromCharCode(r);return XN(x,e,0,1),0}function mv(x,r){return+(Hm(x,r,!1)!=0)}function YN(x,r){var e=new Array(r+1);e[0]=x;for(var t=1;t<=r;t++)e[t]=0;return e}function hv(x){return x instanceof Array&&x[0]==x[0]>>>0?x[0]:CN(x)||NN(x)?_3:x instanceof Function||typeof x=="function"?ip:x&&x.caml_custom?xk:zl}function AK(x){var r={};if(x)for(var e=1;e=0?x=u:H1("caml_register_global: cannot locate "+t)}}Q1[x+1]=r,e&&(Q1[e]=r)}function zN(x,r){return CM[x]=r,0}function PK(x){return x[2]=wM++,x}function _r(x,r){return x===r?1:0}function IK(){i1(BI)}function q2(x,r){return r>>>0>=Cx(x)&&IK(),Y0(x,r)}function P(x,r){return 1-_r(x,r)}function b1(x){return x.t&6&&$m(x),x.c}function NK(){return 2147483647/4|0}var CK=o0.process&&o0.process.platform&&o0.process.platform==_O?xF:"Unix";function jK(){return[0,CK,32,0]}function OK(){uM(Q1.Not_found)}function RM(x){var r=rM(Gx(x));return r===void 0&&OK(),jt(r)}function DK(){if(o0.crypto){if(o0.crypto.getRandomValues){var x=o0.crypto.getRandomValues(new Int32Array(4));return[0,x[0],x[1],x[2],x[3]]}else if(o0.crypto.randomBytes){var x=new Int32Array(o0.crypto.randomBytes(16).buffer);return[0,x[0],x[1],x[2],x[3]]}}var r=new Date().getTime(),e=r^4294967295*Math.random();return[0,e]}function a5(x){for(var r=1;x&&x.joo_tramp;)x=x.joo_tramp.apply(null,x.joo_args),r++;return x}function J2(x,r){return{joo_tramp:x,joo_args:r}}function Rr(x,r){if(r.fun)return x.fun=r.fun,0;if(typeof r=="function")return x.fun=r,0;for(var e=r.length;e--;)x[e]=r[e];return 0}function B2(x){{if(x instanceof Array)return x;var r;return o0.RangeError&&x instanceof o0.RangeError&&x.message&&x.message.match(/maximum call stack/i)||o0.InternalError&&x instanceof o0.InternalError&&x.message&&x.message.match(/too much recursion/i)?r=Q1.Stack_overflow:x instanceof o0.Error&&Va(DS)?r=[0,Va(DS),x]:r=[0,Q1.Failure,jt(String(x))],x instanceof o0.Error&&(r.js_error=x),r}}function FK(x){switch(x[2]){case-8:case-11:case-12:return 1;default:return 0}}function RK(x){var r=H0;if(x[0]==0){if(r+=x[1][1],x.length==3&&x[2][0]==0&&FK(x[1]))var t=x[2],e=1;else var e=2,t=x;r+=DR;for(var u=e;ue&&(r+=dF);var i=t[u];typeof i=="number"?r+=i.toString():i instanceof xa||typeof i=="string"?r+=Kk+i.toString()+Kk:r+=Xo}r+=sR}else x[0]==i2&&(r+=x[1]);return r}function LM(x){if(x instanceof Array&&(x[0]==0||x[0]==i2)){var r=Va(BO);if(r)n5(r,[x,!1]);else{var e=RK(x),t=Va(LD);if(t&&n5(t,[0]),console.error(WE+e),x.js_error)throw x.js_error}}else throw x}function LK(){var x=o0.process;x&&x.on?x.on("uncaughtException",function(r,e){LM(r),x.exit(2)}):o0.addEventListener&&o0.addEventListener("error",function(r){r.error&&LM(r.error)})}LK();function d(x,r){return(x.l>=0?x.l:x.l=x.length)==1?x(r):ps(x,[r])}function p(x,r,e){return(x.l>=0?x.l:x.l=x.length)==2?x(r,e):ps(x,[r,e])}function Q0(x,r,e,t){return(x.l>=0?x.l:x.l=x.length)==3?x(r,e,t):ps(x,[r,e,t])}function KN(x,r,e,t,u){return(x.l>=0?x.l:x.l=x.length)==4?x(r,e,t,u):ps(x,[r,e,t,u])}function JN(x,r,e,t,u,i){return(x.l>=0?x.l:x.l=x.length)==5?x(r,e,t,u,i):ps(x,[r,e,t,u,i])}function N6(x,r,e,t,u,i,c){return(x.l>=0?x.l:x.l=x.length)==6?x(r,e,t,u,i,c):ps(x,[r,e,t,u,i,c])}function MK(x,r,e,t,u,i,c,v){return(x.l>=0?x.l:x.l=x.length)==7?x(r,e,t,u,i,c,v):ps(x,[r,e,t,u,i,c,v])}var O=void 0,GN=[i2,gO,-1],MM=[i2,aL,-2],kn=[i2,Ad,-3],o5=[i2,PL,-4],ms=[i2,vF,-7],qM=[i2,IO,-8],BM=[i2,BR,-9],Ir=[i2,TR,-11],C6=[i2,rR,-12],qK=[4,0,0,0,[12,45,[4,0,0,0,0]]],WN=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,SO,[4,0,0,0,[12,45,[4,0,0,0,[11,": ",[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],K3=[0,0,[0,0,0],[0,0,0]],J3=[0,0,0,0,0,1,0,0,0],UM=[0,"first_leading","last_trailing"],XM=[0,lf,rn,Qf,zi,_c,vi,gu,mu,r7,$c,ti,N7,R7,an,Pc,H7,ze,vs,ci,Di,s7,ei,n7,kf,du,Ou,bf,Mu,fi,pi,Ku,O7,Rf,Wf,k7,wi,of,U7,Ji,W7,Ff,Ai,fc,Un,ts,oc,Lf,cu,B7,Uc,jc,zu,Gi,Yi,Le,Xe,Xc,Uf,tu,Oi,ou,Zi,ai,Ac,si,lc,ec,Dn,Ru,Ki,Ee,P7,Tu,ku,ac,uc,Af,Cc,A7,fs,mc,Sc,Cf,vc,ji,qn,b7,as,nf,wc,Rn,n1,a7,Bc,kc,S7,ni,Tf,y7,c7,sf,ns,Ri,ui,di,Vc,Gn,ff,yu,ss,zf,cf,xu,Ju,nc,xc,_7,Bi,ii,Su,ri,e7,$7,us,bc,yi,St,Kc,D7,bi,K1,Mn,Mi,Gc,gf,bu,Gf,Yc,Hf,ce,Hi,V7,Yu,Du,Bn,yc,_i,Ei,$u,rs,T7,If,J7,I7,t7,jf,Nu,tc,M7,dc,sc,Zc,Of,af,G7,fu,xf,Zu,Tc,Yn,d7,ie,xi,Wc,ru,wu,pu,ic,Qc,w7,au,Q7,hf,ef,Kf,Fi,X7,tf,xs,wf,Xn,lu,li,Pu,ju,Nc,Nf,es,Ii,Rc,mi,x7,Hu,Bu,Lu,gi,Gu,Fu,Oc,Ln,Vi,Iu,rf,qf,Ni,Qn,Kn,pc,Df,f7,Hn,zn,is,qu,Xf,$n,qc,Te,hu,ki,Dc,oi,L7,Au,yf,Fn,v7,Ui,gc,eu,Mf,E7,$i,Xi,iu,j7,Xu,hi,Ef,Me,zc,m7,pf,i7,df,h7,Qu,Ue,g7,uu,Vu,Jc,o7,Z7,Cu,Ic,Ke,Mc,Jf,Pi,Fc,u7,Li,Zn,Ye,K7,hc,Ec,cs,vf,uf,$f,os,Vf,Jn,nu,vu,Bf,Wn,F7,Wi,Wu,q7,Pf,Uu,p7,C7,su,Ti,Eu,Ci,_f,cc,Zf,l7,Sf,V1,Y7,qi,Qi,z1],mn=[0,0,0];Dt(11,C6,rR),Dt(10,Ir,TR),Dt(9,[i2,pR,UR],pR),Dt(8,BM,BR),Dt(7,qM,IO),Dt(6,ms,vF),Dt(5,[i2,KD,-6],KD),Dt(4,[i2,QR,-5],QR),Dt(3,o5,PL),Dt(2,kn,Ad),Dt(1,MM,aL),Dt(0,GN,gO);function U2(x){if(typeof x=="number")return 0;switch(x[0]){case 0:return[0,U2(x[1])];case 1:return[1,U2(x[1])];case 2:return[2,U2(x[1])];case 3:return[3,U2(x[1])];case 4:return[4,U2(x[1])];case 5:return[5,U2(x[1])];case 6:return[6,U2(x[1])];case 7:return[7,U2(x[1])];case 8:var r=x[1];return[8,r,U2(x[2])];case 9:var e=x[1];return[9,e,e,U2(x[3])];case 10:return[10,U2(x[1])];case 11:return[11,U2(x[1])];case 12:return[12,U2(x[1])];case 13:return[13,U2(x[1])];default:return[14,U2(x[1])]}}function ve(x,r){if(typeof x=="number")return r;switch(x[0]){case 0:return[0,ve(x[1],r)];case 1:return[1,ve(x[1],r)];case 2:return[2,ve(x[1],r)];case 3:return[3,ve(x[1],r)];case 4:return[4,ve(x[1],r)];case 5:return[5,ve(x[1],r)];case 6:return[6,ve(x[1],r)];case 7:return[7,ve(x[1],r)];case 8:var e=x[1];return[8,e,ve(x[2],r)];case 9:var t=x[2],u=x[1];return[9,u,t,ve(x[3],r)];case 10:return[10,ve(x[1],r)];case 11:return[11,ve(x[1],r)];case 12:return[12,ve(x[1],r)];case 13:return[13,ve(x[1],r)];default:return[14,ve(x[1],r)]}}function I2(x,r){if(typeof x=="number")return r;switch(x[0]){case 0:return[0,I2(x[1],r)];case 1:return[1,I2(x[1],r)];case 2:var e=x[1];return[2,e,I2(x[2],r)];case 3:var t=x[1];return[3,t,I2(x[2],r)];case 4:var u=x[3],i=x[2],c=x[1];return[4,c,i,u,I2(x[4],r)];case 5:var v=x[3],a=x[2],l=x[1];return[5,l,a,v,I2(x[4],r)];case 6:var m=x[3],h=x[2],T=x[1];return[6,T,h,m,I2(x[4],r)];case 7:var b=x[3],N=x[2],C=x[1];return[7,C,N,b,I2(x[4],r)];case 8:var I=x[3],F=x[2],M=x[1];return[8,M,F,I,I2(x[4],r)];case 9:var Y=x[1];return[9,Y,I2(x[2],r)];case 10:return[10,I2(x[1],r)];case 11:var q=x[1];return[11,q,I2(x[2],r)];case 12:var K=x[1];return[12,K,I2(x[2],r)];case 13:var u0=x[2],Q=x[1];return[13,Q,u0,I2(x[3],r)];case 14:var e0=x[2],f0=x[1];return[14,f0,e0,I2(x[3],r)];case 15:return[15,I2(x[1],r)];case 16:return[16,I2(x[1],r)];case 17:var a0=x[1];return[17,a0,I2(x[2],r)];case 18:var Z=x[1];return[18,Z,I2(x[2],r)];case 19:return[19,I2(x[1],r)];case 20:var v0=x[2],t0=x[1];return[20,t0,v0,I2(x[3],r)];case 21:var y0=x[1];return[21,y0,I2(x[2],r)];case 22:return[22,I2(x[1],r)];case 23:var n0=x[1];return[23,n0,I2(x[2],r)];default:var s0=x[2],l0=x[1];return[24,l0,s0,I2(x[3],r)]}}function bx(x){throw K0([0,kn,x],1)}function R1(x){throw K0([0,o5,x],1)}function v5(x){return 0<=x?x:-x|0}var BK=$s,UK=Xs;function Mx(x,r){var e=Cx(x),t=Cx(r),u=E2(e+t|0);return ls(x,0,u,0,e),ls(r,0,u,e,t),b1(u)}function Lx(x,r){if(!x)return r;var e=x[2],t=x[1];if(!e)return[0,t,r];var u=e[2],i=e[1];if(!u)return[0,t,[0,i,r]];for(var c=[0,u[1],La],v=c,a=1,l=u[2];;){if(l){var m=l[2],h=l[1];if(m){var T=m[2],b=m[1];if(T){var N=[0,T[1],La],C=T[2];v[1+a]=[0,h,[0,b,N]];var v=N,a=1,l=C;continue}v[1+a]=[0,h,[0,b,r]]}else v[1+a]=[0,h,r]}else v[1+a]=r;return[0,t,[0,i,c]]}}bK(0);var YM=DM(1),hn=DM(2),XK="output_substring";function j6(x,r){XN(x,r,0,Cx(r))}function zM(x,r,e,t){return 0<=e&&0<=t&&(Cx(r)-t|0)>=e?XN(x,r,e,t):R1(XK)}function KM(x){return j6(hn,x),FM(hn,10),ln(hn)}var VN=[0,function(x){for(var r=TK(0);;){if(!r)return 0;var e=r[2],t=r[1];try{ln(t)}catch(c){var u=B2(c);if(u[1]!==MM)throw K0(u,0)}var r=e}}],JM=[0,function(x){}];function $N(x){return d(JM[1],0),d(M3(VN),0)}zN(LD,$N);var GM=jK(0)[1],O6=(4*NK(0)|0)-1|0;function l5(x,r){return r?[0,d(x,r[1])]:0}function WM(x){return x?1:0}function VM(x){return 25>>0?x:x-32|0}var YK="hd",zK="tl",KK="List.iter2";function ia(x){for(var r=0,e=x;;){if(!e)return r;var r=r+1|0,e=e[2]}}function D6(x){return x?x[1]:bx(YK)}function $M(x){return x?x[2]:bx(zK)}function G3(x,r){for(var e=x,t=r;;){if(!e)return t;var u=[0,e[1],t],e=e[2],t=u}}function tx(x){return G3(x,0)}function F6(x){if(!x)return 0;var r=x[1];return Lx(r,F6(x[2]))}function dn(x,r){if(!r)return 0;var e=r[2],t=r[1];if(!e)return[0,x(t),0];for(var u=e[2],i=e[1],c=x(t),v=[0,x(i),La],a=v,l=1,m=u;;){if(m){var h=m[2],T=m[1];if(h){var b=h[2],N=h[1],C=x(T),I=[0,x(N),La];a[1+l]=[0,C,I];var a=I,l=1,m=b;continue}a[1+l]=[0,x(T),0]}else a[1+l]=0;return[0,c,v]}}function p5(x,r){for(var e=0,t=r;;){if(!t)return e;var u=t[2],e=[0,x(t[1]),e],t=u}}function T1(x,r){for(var e=r;;){if(!e)return 0;var t=e[2];d(x,e[1]);var e=t}}function m1(x,r,e){for(var t=r,u=e;;){if(!u)return t;var i=u[2],t=p(x,t,u[1]),u=i}}function QN(x,r,e){if(!r)return e;var t=r[1];return x(t,QN(x,r[2],e))}function QM(x,r,e){for(var t=r,u=e;;){if(t){if(u){var i=u[2],c=t[2];x(t[1],u[1]);var t=c,u=i;continue}}else if(!u)return;return R1(KK)}}function W3(x,r){for(var e=r;;){if(!e)return 0;var t=e[2],u=d(x,e[1]);if(u)return u;var e=t}}function HN(x,r){for(var e=r;;){if(!e)return 0;var t=e[2],u=yM(e[1],x)===0?1:0;if(u)return u;var e=t}}function R6(x,r){for(var e=r;;){if(!e)return 0;var t=e[2],u=e[1];if(x(u))for(var i=[0,u,La],c=i,v=1,a=t;;){if(!a)return c[1+v]=0,i;var l=a[2],m=a[1];if(x(m)){var h=[0,m,La];c[1+v]=h;var c=h,v=1,a=l}else var a=l}else var e=t}}var JK="String.sub / Bytes.sub",GK="Bytes.blit",WK="String.blit / Bytes.blit_string";function dv(x,r){var e=E2(x);return Wz(e,0,x,r),e}function HM(x,r,e){if(0<=r&&0<=e&&(Ot(x)-e|0)>=r){var t=E2(e);return Zs(x,r,t,0,e),t}return R1(JK)}function V3(x,r,e){return b1(HM(x,r,e))}function ZM(x,r,e,t,u){if(0<=u&&0<=r&&(Ot(x)-u|0)>=r&&0<=t&&(Ot(e)-u|0)>=t){Zs(x,r,e,t,u);return}return R1(GK)}function yn(x,r,e,t,u){if(0<=u&&0<=r&&(Cx(x)-u|0)>=r&&0<=t&&(Ot(e)-u|0)>=t){ls(x,r,e,t,u);return}return R1(WK)}var VK="String.concat",$K=H0;function k5(x,r){return b1(dv(x,r))}function E1(x,r,e){return b1(HM(Ct(x),r,e))}function xq(x,r){if(!r)return $K;var e=Cx(x);x:{r:{for(var t=0,u=r,i=0;u;){var c=u[1];if(!u[2])break r;var v=(Cx(c)+e|0)+t|0,a=u[2],l=t<=v?v:R1(VK),t=l,u=a}var m=t;break x}var m=Cx(c)+t|0}for(var h=E2(m),T=i,b=r;;){if(b){var N=b[1];if(b[2]){var C=b[2];ls(N,0,h,T,Cx(N)),ls(x,0,h,T+Cx(N)|0,e);var T=(T+Cx(N)|0)+e|0,b=C;continue}ls(N,0,h,T,Cx(N))}return b1(h)}}function rq(x){var r=Ct(x);if(Ot(r)===0)var e=r;else{var t=Ot(r),u=E2(t);Zs(r,0,u,0,t),Yr(u,0,VM(ae(r,0)));var e=u}return b1(e)}function eq(x,r){var e=Cx(x),t=e<=Cx(r)?1:0;if(!t)return t;for(var u=0;;){if(u===e)return 1;if(Y0(r,u)!==Y0(x,u))return 0;var u=u+1|0}}function tq(x,r){var e=[0,0],t=[0,Cx(r)],u=Cx(r)-1|0;if(u>=0)for(var i=u;;){if(Y0(r,i)===x){var c=e[1];e[1]=[0,E1(r,i+1|0,(t[1]-i|0)-1|0),c],t[1]=i}var v=i-1|0;if(i===0)break;var i=v}var a=e[1];return[0,E1(r,0,t[1]),a]}function m5(x,r){return Cz(Ct(x),r)}var QK="Array.blit";function nq(x,r,e,t,u){if(0<=u&&0<=r&&(x.length-1-u|0)>=r&&0<=t&&(e.length-1-u|0)>=t){_z(x,r,e,t,u);return}return R1(QK)}function uq(x,r){var e=r.length-1-1|0,t=0;if(e>=0)for(var u=t;;){x(r[1+u]);var i=u+1|0;if(e===u)break;var u=i}}function h5(x,r){var e=r.length-1;if(e===0)return[0];var t=Wa(e,x(r[1])),u=e-1|0,i=1;if(u>=1)for(var c=i;;){t[1+c]=x(r[1+c]);var v=c+1|0;if(u===c)break;var c=v}return t}function L6(x){if(!x)return[0];for(var r=0,e=x,t=x[2],u=x[1];e;)var r=r+1|0,e=e[2];for(var i=Wa(r,u),c=1,v=t;;){if(!v)return i;var a=v[2];i[1+c]=v[1];var c=c+1|0,v=a}}function iq(x){try{var r=[0,pv(x)];return r}catch(t){var e=B2(t);if(e[1]===kn)return 0;throw K0(e,0)}}var HK=n8,ZK=n8,xJ=n8,rJ=n8;function ZN(x){function r(c){return c?c[5]:0}function e(c,v,a,l){var m=r(c),h=r(l),T=h<=m?m+1|0:h+1|0;return[0,c,v,a,l,T]}function t(c,v,a,l){var m=c?c[5]:0,h=l?l[5]:0;if((h+2|0)=h){var K=h<=m?m+1|0:h+1|0;return[0,c,v,a,l,K]}if(!l)return R1(rJ);var u0=l[4],Q=l[3],e0=l[2],f0=l[1],a0=r(f0);if(a0<=r(u0))return e(e(c,v,a,f0),e0,Q,u0);if(!f0)return R1(xJ);var Z=f0[3],v0=f0[2],t0=f0[1],y0=e(f0[4],e0,Q,u0);return e(e(c,v,a,t0),v0,Z,y0)}function u(c,v,a){if(!a)return[0,0,c,v,0,1];var l=a[4],m=a[3],h=a[2],T=a[1],b=a[5],N=p(x[1],c,h);if(N===0)return m===v?a:[0,T,c,v,l,b];if(0<=N){var C=u(c,v,l);return l===C?a:t(T,h,m,C)}var I=u(c,v,T);return T===I?a:t(I,h,m,l)}function i(c,v,a){for(var l=v,m=a;;){if(!l)return m;var h=l[4],T=l[3],b=l[2],N=c(b,T,i(c,l[1],m)),l=h,m=N}}return[0,0,u,,,,,,,,,,,,,,,function(c,v){for(var a=v;;){if(!a)throw K0(ms,1);var l=a[4],m=a[3],h=a[1],T=p(x[1],c,a[2]);if(T===0)return m;var b=0<=T?l:h,a=b}},,,,,,,i]}function M6(x){return[0,0,0]}function q6(x){x[1]=0,x[2]=0}function yv(x,r){r[1]=[0,x,r[1]],r[2]=r[2]+1|0}function $3(x){var r=x[1];if(!r)return 0;var e=r[1];return x[1]=r[2],x[2]=x[2]-1|0,[0,e]}function Q3(x){var r=x[1];return r?[0,r[1]]:0}function fq(x){return[0,0,0,0]}function xC(x){x[1]=0,x[2]=0,x[3]=0}function rC(x,r){var e=[0,x,0],t=r[3];return t?(r[1]=r[1]+1|0,t[2]=e,r[3]=e,0):(r[1]=1,r[2]=e,r[3]=e,0)}var eJ="Buffer.add: cannot grow buffer",tJ="Buffer.add_substring/add_subbytes";function Wr(x){var r=1<=x?x:1,e=O6=(e+r|0));)t[1]=2*t[1]|0;O6=0)for(var c=i;;){Yr(t,c,x(ae(r,c)));var v=c+1|0;if(u===c)break;var c=v}return t}var rG=D3,eG="%+d",tG="% d",nG=iF,uG="%+i",iG="% i",fG="%x",cG="%#x",sG="%X",aG="%#X",oG="%o",vG="%#o",lG=GR,pG="%Ld",kG="%+Ld",mG="% Ld",hG=kF,dG="%+Li",yG="% Li",gG="%Lx",wG="%#Lx",_G="%LX",bG="%#LX",TG="%Lo",EG="%#Lo",SG="%Lu",AG="%ld",PG="%+ld",IG="% ld",NG=OL,CG="%+li",jG="% li",OG="%lx",DG="%#lx",FG="%lX",RG="%#lX",LG="%lo",MG="%#lo",qG="%lu",BG="%nd",UG="%+nd",XG="% nd",YG=hO,zG="%+ni",KG="% ni",JG="%nx",GG="%#nx",WG="%nX",VG="%#nX",$G="%no",QG="%#no",HG="%nu",ZG=[0,F1],xW=on,rW="neg_infinity",eW=iL,tW=sI,nW=[0,k1,1558,4],uW="Printf: bad conversion %[",iW=[0,k1,1626,39],fW=[0,k1,1649,31],cW=[0,k1,1650,31],sW="Printf: bad conversion %_",aW=vL,oW=wR,vW=vL,lW=wR;function d5(x,r){if(typeof x=="number")return[0,0,r];if(x[0]===0)return[0,[0,x[1],x[2]],r];if(typeof r!="number"&&r[0]===2)return[0,[1,x[1]],r[1]];throw K0(S1,1)}function U6(x,r,e){var t=d5(x,e);if(typeof r!="number")return[0,t[1],[0,r[1]],t[2]];if(!r)return[0,t[1],0,t[2]];var u=t[2];if(typeof u!="number"&&u[0]===2)return[0,t[1],1,u[1]];throw K0(S1,1)}function g2(x,r){if(typeof x=="number")return[0,0,r];switch(x[0]){case 0:if(typeof r!="number"&&r[0]===0){var e=g2(x[1],r[1]);return[0,[0,e[1]],e[2]]}break;case 1:if(typeof r!="number"&&r[0]===0){var t=g2(x[1],r[1]);return[0,[1,t[1]],t[2]]}break;case 2:var u=x[2],i=d5(x[1],r),c=i[2],v=i[1];if(typeof c!="number"&&c[0]===1){var a=g2(u,c[1]);return[0,[2,v,a[1]],a[2]]}throw K0(S1,1);case 3:var l=x[2],m=d5(x[1],r),h=m[2],T=m[1];if(typeof h!="number"&&h[0]===1){var b=g2(l,h[1]);return[0,[3,T,b[1]],b[2]]}throw K0(S1,1);case 4:var N=x[4],C=x[1],I=U6(x[2],x[3],r),F=I[3],M=I[1];if(typeof F!="number"&&F[0]===2){var Y=I[2],q=g2(N,F[1]);return[0,[4,C,M,Y,q[1]],q[2]]}throw K0(S1,1);case 5:var K=x[4],u0=x[1],Q=U6(x[2],x[3],r),e0=Q[3],f0=Q[1];if(typeof e0!="number"&&e0[0]===3){var a0=Q[2],Z=g2(K,e0[1]);return[0,[5,u0,f0,a0,Z[1]],Z[2]]}throw K0(S1,1);case 6:var v0=x[4],t0=x[1],y0=U6(x[2],x[3],r),n0=y0[3],s0=y0[1];if(typeof n0!="number"&&n0[0]===4){var l0=y0[2],w0=g2(v0,n0[1]);return[0,[6,t0,s0,l0,w0[1]],w0[2]]}throw K0(S1,1);case 7:var L0=x[4],I0=x[1],j0=U6(x[2],x[3],r),S0=j0[3],W0=j0[1];if(typeof S0!="number"&&S0[0]===5){var A0=j0[2],J0=g2(L0,S0[1]);return[0,[7,I0,W0,A0,J0[1]],J0[2]]}throw K0(S1,1);case 8:var b0=x[4],z=x[1],C0=U6(x[2],x[3],r),V0=C0[3],N0=C0[1];if(typeof V0!="number"&&V0[0]===6){var rx=C0[2],xx=g2(b0,V0[1]);return[0,[8,z,N0,rx,xx[1]],xx[2]]}throw K0(S1,1);case 9:var nx=x[2],mx=d5(x[1],r),F0=mx[2],px=mx[1];if(typeof F0!="number"&&F0[0]===7){var dx=g2(nx,F0[1]);return[0,[9,px,dx[1]],dx[2]]}throw K0(S1,1);case 10:var W=g2(x[1],r);return[0,[10,W[1]],W[2]];case 11:var g0=x[1],B=g2(x[2],r);return[0,[11,g0,B[1]],B[2]];case 12:var h0=x[1],_0=g2(x[2],r);return[0,[12,h0,_0[1]],_0[2]];case 13:if(typeof r!="number"&&r[0]===8){var d0=r[1],E0=r[2],U=x[3],Kx=x[1];if(mv([0,x[2]],[0,d0]))throw K0(S1,1);var Ix=g2(U,E0);return[0,[13,Kx,d0,Ix[1]],Ix[2]]}break;case 14:if(typeof r!="number"&&r[0]===9){var z0=r[1],Kr=r[3],S=x[3],G=x[2],Z0=x[1],yx=[0,U2(z0)];if(mv([0,U2(G)],yx))throw K0(S1,1);var Tx=g2(S,U2(Kr));return[0,[14,Z0,z0,Tx[1]],Tx[2]]}break;case 15:if(typeof r!="number"&&r[0]===10){var ex=g2(x[1],r[1]);return[0,[15,ex[1]],ex[2]]}break;case 16:if(typeof r!="number"&&r[0]===11){var m0=g2(x[1],r[1]);return[0,[16,m0[1]],m0[2]]}break;case 17:var Dx=x[1],Ex=g2(x[2],r);return[0,[17,Dx,Ex[1]],Ex[2]];case 18:var qx=x[2],O0=x[1];if(O0[0]===0){var Wx=O0[1],Yx=Wx[2],fx=g2(Wx[1],r),Qx=fx[1],vx=g2(qx,fx[2]);return[0,[18,[0,[0,Qx,Yx]],vx[1]],vx[2]]}var nr=O0[1],gr=nr[2],Nr=g2(nr[1],r),s2=Nr[1],b2=g2(qx,Nr[2]);return[0,[18,[1,[0,s2,gr]],b2[1]],b2[2]];case 19:if(typeof r!="number"&&r[0]===13){var k2=g2(x[1],r[1]);return[0,[19,k2[1]],k2[2]]}break;case 20:if(typeof r!="number"&&r[0]===1){var F2=x[2],jx=x[1],_=g2(x[3],r[1]);return[0,[20,jx,F2,_[1]],_[2]]}break;case 21:if(typeof r!="number"&&r[0]===2){var $=x[1],ix=g2(x[2],r[1]);return[0,[21,$,ix[1]],ix[2]]}break;case 23:var U0=x[2],cx=x[1];if(typeof cx!="number")switch(cx[0]){case 0:return Ge(cx,U0,r);case 1:return Ge(cx,U0,r);case 2:return Ge(cx,U0,r);case 3:return Ge(cx,U0,r);case 4:return Ge(cx,U0,r);case 5:return Ge(cx,U0,r);case 6:return Ge(cx,U0,r);case 7:return Ge(cx,U0,r);case 8:return Ge([8,cx[1],cx[2]],U0,r);case 9:var wx=cx[1],Or=Se(cx[2],U0,r),Hx=Or[2];return[0,[23,[9,wx,Or[1]],Hx[1]],Hx[2]];case 10:return Ge(cx,U0,r);default:return Ge(cx,U0,r)}switch(cx){case 0:return Ge(cx,U0,r);case 1:return Ge(cx,U0,r);case 2:if(typeof r!="number"&&r[0]===14){var x2=g2(U0,r[1]);return[0,[23,2,x2[1]],x2[2]]}throw K0(S1,1);default:return Ge(cx,U0,r)}}throw K0(S1,1)}function Ge(x,r,e){var t=g2(r,e);return[0,[23,x,t[1]],t[2]]}function Se(x,r,e){if(typeof x=="number")return[0,0,g2(r,e)];switch(x[0]){case 0:if(typeof e!="number"&&e[0]===0){var t=Se(x[1],r,e[1]);return[0,[0,t[1]],t[2]]}break;case 1:if(typeof e!="number"&&e[0]===1){var u=Se(x[1],r,e[1]);return[0,[1,u[1]],u[2]]}break;case 2:if(typeof e!="number"&&e[0]===2){var i=Se(x[1],r,e[1]);return[0,[2,i[1]],i[2]]}break;case 3:if(typeof e!="number"&&e[0]===3){var c=Se(x[1],r,e[1]);return[0,[3,c[1]],c[2]]}break;case 4:if(typeof e!="number"&&e[0]===4){var v=Se(x[1],r,e[1]);return[0,[4,v[1]],v[2]]}break;case 5:if(typeof e!="number"&&e[0]===5){var a=Se(x[1],r,e[1]);return[0,[5,a[1]],a[2]]}break;case 6:if(typeof e!="number"&&e[0]===6){var l=Se(x[1],r,e[1]);return[0,[6,l[1]],l[2]]}break;case 7:if(typeof e!="number"&&e[0]===7){var m=Se(x[1],r,e[1]);return[0,[7,m[1]],m[2]]}break;case 8:if(typeof e!="number"&&e[0]===8){var h=e[1],T=e[2],b=x[2];if(mv([0,x[1]],[0,h]))throw K0(S1,1);var N=Se(b,r,T);return[0,[8,h,N[1]],N[2]]}break;case 9:if(typeof e!="number"&&e[0]===9){var C=e[2],I=e[1],F=e[3],M=x[3],Y=x[2],q=x[1],K=[0,U2(I)];if(mv([0,U2(q)],K))throw K0(S1,1);var u0=[0,U2(C)];if(mv([0,U2(Y)],u0))throw K0(S1,1);var Q=M1(h1(c1(I),C)),e0=Q[4];Q[2].call(null,O),e0(O);var f0=Se(U2(M),r,F),a0=f0[2];return[0,[9,I,C,c1(f0[1])],a0]}break;case 10:if(typeof e!="number"&&e[0]===10){var Z=Se(x[1],r,e[1]);return[0,[10,Z[1]],Z[2]]}break;case 11:if(typeof e!="number"&&e[0]===11){var v0=Se(x[1],r,e[1]);return[0,[11,v0[1]],v0[2]]}break;case 13:if(typeof e!="number"&&e[0]===13){var t0=Se(x[1],r,e[1]);return[0,[13,t0[1]],t0[2]]}break;case 14:if(typeof e!="number"&&e[0]===14){var y0=Se(x[1],r,e[1]);return[0,[14,y0[1]],y0[2]]}break}throw K0(S1,1)}function We(x,r,e){var t=Cx(e),u=0<=r?x:0,i=v5(r);if(i<=t)return e;var c=u===2?48:32,v=dv(i,c);switch(u){case 0:yn(e,0,v,0,t);break;case 1:yn(e,0,v,i-t|0,t);break;default:x:if(0u){if(u!==32){if(43>u)break x;switch(u+I_|0){case 5:e:if(t<(e+2|0)&&1=(e+1|0))break x;var c=dv(e+1|0,48);return ra(c,0,u),yn(r,1,c,(e-t|0)+2|0,t-1|0),b1(c)}if(71<=u){if(5>>0)break x}else if(65>u)break x}if(t=0)for(var i=u;;){var c=ae(r,i);x:{r:{e:{if(32<=c){var v=c-34|0;if(58>>0){if(93<=v)break e}else if(56>>0)break r;var a=1;break x}if(11<=c){if(c===13)break r}else if(8<=c)break r}var a=4;break x}var a=2}e[1]=e[1]+a|0;var l=i+1|0;if(t===i)break;var i=l}if(e[1]===Ot(r))var m=r;else{var h=E2(e[1]);e[1]=0;var T=Ot(r)-1|0,b=0;if(T>=0)for(var N=b;;){var C=ae(r,N);x:{r:{e:{if(35<=C){if(C!==92){if(Xr<=C)break e;break r}}else{if(32>C){if(14<=C)break e;switch(C){case 8:Yr(h,e[1],92),e[1]++,Yr(h,e[1],98);break x;case 9:Yr(h,e[1],92),e[1]++,Yr(h,e[1],av);break x;case 10:Yr(h,e[1],92),e[1]++,Yr(h,e[1],w1);break x;case 13:Yr(h,e[1],92),e[1]++,Yr(h,e[1],kr);break x;default:break e}}if(34>C)break r}Yr(h,e[1],92),e[1]++,Yr(h,e[1],C);break x}Yr(h,e[1],92),e[1]++,Yr(h,e[1],48+(C/y2|0)|0),e[1]++,Yr(h,e[1],48+((C/10|0)%10|0)|0),e[1]++,Yr(h,e[1],48+(C%10|0)|0);break x}Yr(h,e[1],C)}e[1]++;var I=N+1|0;if(T===N)break;var N=I}var m=h}var F=b1(m),M=Cx(F),Y=dv(M+2|0,34);return ls(F,0,Y,1,M),b1(Y)}function mq(x,r){var e=v5(r),t=ZG[1];switch(x[2]){case 0:var u=cn;break;case 1:var u=se;break;case 2:var u=69;break;case 3:var u=F1;break;case 4:var u=71;break;case 5:var u=t;break;case 6:var u=ft;break;case 7:var u=72;break;default:var u=70}var i=vq(16);switch(H3(i,37),x[1]){case 0:break;case 1:H3(i,43);break;default:H3(i,32)}return 8<=x[2]&&H3(i,35),H3(i,46),L1(i,H0+e),H3(i,u),pq(i)}function y5(x,r){if(13>x)return r;var e=[0,0],t=Cx(r)-1|0,u=0;if(t>=0)for(var i=u;;){9>=Y0(r,i)+e1>>>0&&e[1]++;var c=i+1|0;if(t===i)break;var i=c}var v=e[1],a=E2(Cx(r)+((v-1|0)/3|0)|0),l=[0,0];function m(F){ra(a,l[1],F),l[1]++}var h=[0,((v-1|0)%3|0)+1|0],T=Cx(r)-1|0,b=0;if(T>=0)for(var N=b;;){var C=Y0(r,N);9>>0||(h[1]===0&&(m(95),h[1]=3),h[1]+=-1),m(C);var I=N+1|0;if(T===N)break;var N=I}return b1(a)}function kW(x,r){switch(x){case 1:var e=eG;break;case 2:var e=tG;break;case 4:var e=uG;break;case 5:var e=iG;break;case 6:var e=fG;break;case 7:var e=cG;break;case 8:var e=sG;break;case 9:var e=aG;break;case 10:var e=oG;break;case 11:var e=vG;break;case 0:case 13:var e=rG;break;case 3:case 14:var e=nG;break;default:var e=lG}return y5(x,x5(e,r))}function mW(x,r){switch(x){case 1:var e=PG;break;case 2:var e=IG;break;case 4:var e=CG;break;case 5:var e=jG;break;case 6:var e=OG;break;case 7:var e=DG;break;case 8:var e=FG;break;case 9:var e=RG;break;case 10:var e=LG;break;case 11:var e=MG;break;case 0:case 13:var e=AG;break;case 3:case 14:var e=NG;break;default:var e=qG}return y5(x,x5(e,r))}function hW(x,r){switch(x){case 1:var e=UG;break;case 2:var e=XG;break;case 4:var e=zG;break;case 5:var e=KG;break;case 6:var e=JG;break;case 7:var e=GG;break;case 8:var e=WG;break;case 9:var e=VG;break;case 10:var e=$G;break;case 11:var e=QG;break;case 0:case 13:var e=BG;break;case 3:case 14:var e=YG;break;default:var e=HG}return y5(x,x5(e,r))}function dW(x,r){switch(x){case 1:var e=kG;break;case 2:var e=mG;break;case 4:var e=dG;break;case 5:var e=yG;break;case 6:var e=gG;break;case 7:var e=wG;break;case 8:var e=_G;break;case 9:var e=bG;break;case 10:var e=TG;break;case 11:var e=EG;break;case 0:case 13:var e=pG;break;case 3:case 14:var e=hG;break;default:var e=SG}return y5(x,bM(e,r))}function fa(x,r,e){function t(h){switch(x[1]){case 0:var T=45;break;case 1:var T=43;break;default:var T=32}return $z(e,r,T)}function u(h){var T=Oz(e);return T===3?e<0?rW:eW:4<=T?tW:h}switch(x[2]){case 5:for(var i=FN(mq(x,r),e),c=0,v=Cx(i);;){if(c===v)var a=0;else{var l=q2(i,c)+za|0;x:{if(23>>0){if(l===55)break x}else if(21>>0)break x;var c=c+1|0;continue}var a=1}var m=a?i:Mx(i,xW);return u(m)}case 6:return t(O);case 7:return b1(xG(VM,Ct(t(O))));case 8:return u(t(O));default:return FN(mq(x,r),e)}}function X6(x,r,e,t){for(var u=r,i=e,c=t;;){if(typeof c=="number")return u(i);switch(c[0]){case 0:var v=c[1];return function(A0){return Br(u,[5,i,A0],v)};case 1:var a=c[1];return function(A0){x:{r:{if(40<=A0){if(A0===92){var z=WJ;break x}if(Xr>A0)break r}else{if(32<=A0){if(39>A0)break r;var z=VJ;break x}if(14>A0)switch(A0){case 8:var z=$J;break x;case 9:var z=QJ;break x;case 10:var z=HJ;break x;case 13:var z=ZJ;break x}}var J0=E2(4);Yr(J0,0,92),Yr(J0,1,48+(A0/y2|0)|0),Yr(J0,2,48+((A0/10|0)%10|0)|0),Yr(J0,3,48+(A0%10|0)|0);var z=b1(J0);break x}var b0=E2(1);Yr(b0,0,A0);var z=b1(b0)}var C0=Cx(z),V0=dv(C0+2|0,39);return ls(z,0,V0,1,C0),Br(u,[4,i,b1(V0)],a)};case 2:return aC(u,i,c[2],c[1],function(A0){return A0});case 3:return aC(u,i,c[2],c[1],pW);case 4:return g5(u,i,c[4],c[2],c[3],kW,c[1]);case 5:return g5(u,i,c[4],c[2],c[3],mW,c[1]);case 6:return g5(u,i,c[4],c[2],c[3],hW,c[1]);case 7:return g5(u,i,c[4],c[2],c[3],dW,c[1]);case 8:var l=c[4],m=c[3],h=c[2],T=c[1];if(typeof h=="number"){if(typeof m=="number")return m?function(A0,J0){return Br(u,[4,i,fa(T,A0,J0)],l)}:function(A0){return Br(u,[4,i,fa(T,fC(T),A0)],l)};var b=m[1];return function(A0){return Br(u,[4,i,fa(T,b,A0)],l)}}if(h[0]===0){var N=h[2],C=h[1];if(typeof m=="number")return m?function(A0,J0){return Br(u,[4,i,We(C,N,fa(T,A0,J0))],l)}:function(A0){return Br(u,[4,i,We(C,N,fa(T,fC(T),A0))],l)};var I=m[1];return function(A0){return Br(u,[4,i,We(C,N,fa(T,I,A0))],l)}}var F=h[1];if(typeof m=="number")return m?function(A0,J0,b0){return Br(u,[4,i,We(F,A0,fa(T,J0,b0))],l)}:function(A0,J0){return Br(u,[4,i,We(F,A0,fa(T,fC(T),J0))],l)};var M=m[1];return function(A0,J0){return Br(u,[4,i,We(F,A0,fa(T,M,J0))],l)};case 9:return aC(u,i,c[2],c[1],GJ);case 10:var i=[7,i],c=c[1];break;case 11:var i=[2,i,c[1]],c=c[2];break;case 12:var i=[3,i,c[1]],c=c[2];break;case 13:var Y=c[3],q=c[2],K=vq(16);cC(K,q);var u0=pq(K);return function(A0){return Br(u,[4,i,u0],Y)};case 14:var Q=c[3],e0=c[2];return function(A0){var J0=A0[1],b0=g2(J0,U2(c1(e0)));if(typeof b0[2]=="number")return Br(u,i,I2(b0[1],Q));throw K0(S1,1)};case 15:var f0=c[1];return function(A0,J0){return Br(u,[6,i,function(b0){return p(A0,b0,J0)}],f0)};case 16:var a0=c[1];return function(A0){return Br(u,[6,i,A0],a0)};case 17:var i=[0,i,c[1]],c=c[2];break;case 18:var Z=c[1];if(Z[0]===0){let A0=i,J0=u,b0=c[2];var u=function(N0){return Br(J0,[1,A0,[0,N0]],b0)},i=0,c=Z[1][1]}else{let A0=i,J0=u,b0=c[2];var u=function(N0){return Br(J0,[1,A0,[1,N0]],b0)},i=0,c=Z[1][1]}break;case 19:throw K0([0,Ir,nW],1);case 20:var v0=c[3],t0=[8,i,uW];return function(A0){return Br(u,t0,v0)};case 21:var y0=c[2];return function(A0){return Br(u,[4,i,x5(GR,A0)],y0)};case 22:var n0=c[1];return function(A0){return Br(u,[5,i,A0],n0)};case 23:var s0=c[2],l0=c[1];if(typeof l0=="number")switch(l0){case 0:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 1:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 2:throw K0([0,Ir,iW],1);default:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0])}switch(l0[0]){case 0:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 1:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 2:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 3:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 4:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 5:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 6:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 7:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 8:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);case 9:var w0=l0[2];return x<50?sC(x+1|0,u,i,w0,s0):J2(sC,[0,u,i,w0,s0]);case 10:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0]);default:return x<50?v2(x+1|0,u,i,s0):J2(v2,[0,u,i,s0])}default:var L0=c[3],I0=c[1],j0=d(c[2],0);return x<50?oC(x+1|0,u,i,L0,I0,j0):J2(oC,[0,u,i,L0,I0,j0])}}}function Br(x,r,e){return a5(X6(0,x,r,e))}function sC(x,r,e,t,u){if(typeof t=="number")return x<50?v2(x+1|0,r,e,u):J2(v2,[0,r,e,u]);switch(t[0]){case 0:var i=t[1];return function(q){return ot(r,e,i,u)};case 1:var c=t[1];return function(q){return ot(r,e,c,u)};case 2:var v=t[1];return function(q){return ot(r,e,v,u)};case 3:var a=t[1];return function(q){return ot(r,e,a,u)};case 4:var l=t[1];return function(q){return ot(r,e,l,u)};case 5:var m=t[1];return function(q){return ot(r,e,m,u)};case 6:var h=t[1];return function(q){return ot(r,e,h,u)};case 7:var T=t[1];return function(q){return ot(r,e,T,u)};case 8:var b=t[2];return function(q){return ot(r,e,b,u)};case 9:var N=t[3],C=t[2],I=h1(c1(t[1]),C);return function(q){return ot(r,e,ve(I,N),u)};case 10:var F=t[1];return function(q,K){return ot(r,e,F,u)};case 11:var M=t[1];return function(q){return ot(r,e,M,u)};case 12:var Y=t[1];return function(q){return ot(r,e,Y,u)};case 13:throw K0([0,Ir,fW],1);default:throw K0([0,Ir,cW],1)}}function ot(x,r,e,t){return a5(sC(0,x,r,e,t))}function v2(x,r,e,t){var u=[8,e,sW];return x<50?X6(x+1|0,r,u,t):J2(X6,[0,r,u,t])}function aC(x,r,e,t,u){if(typeof t=="number")return function(a){return Br(x,[4,r,u(a)],e)};if(t[0]===0){var i=t[2],c=t[1];return function(a){return Br(x,[4,r,We(c,i,u(a))],e)}}var v=t[1];return function(a,l){return Br(x,[4,r,We(v,a,u(l))],e)}}function g5(x,r,e,t,u,i,c){if(typeof t=="number"){if(typeof u=="number")return u?function(b,N){return Br(x,[4,r,Z3(b,i(c,N))],e)}:function(b){return Br(x,[4,r,i(c,b)],e)};var v=u[1];return function(b){return Br(x,[4,r,Z3(v,i(c,b))],e)}}if(t[0]===0){var a=t[2],l=t[1];if(typeof u=="number")return u?function(b,N){return Br(x,[4,r,We(l,a,Z3(b,i(c,N)))],e)}:function(b){return Br(x,[4,r,We(l,a,i(c,b))],e)};var m=u[1];return function(b){return Br(x,[4,r,We(l,a,Z3(m,i(c,b)))],e)}}var h=t[1];if(typeof u=="number")return u?function(b,N,C){return Br(x,[4,r,We(h,b,Z3(N,i(c,C)))],e)}:function(b,N){return Br(x,[4,r,We(h,b,i(c,N))],e)};var T=u[1];return function(b,N){return Br(x,[4,r,We(h,b,Z3(T,i(c,N)))],e)}}function oC(x,r,e,t,u,i){if(u){var c=u[1];return function(a){return yW(r,e,t,c,d(i,a))}}var v=[4,e,i];return x<50?X6(x+1|0,r,v,t):J2(X6,[0,r,v,t])}function yW(x,r,e,t,u){return a5(oC(0,x,r,e,t,u))}function ca(x,r){for(var e=r;;){if(typeof e=="number")return;switch(e[0]){case 0:var t=e[1],u=kq(e[2]);return ca(x,t),j6(x,u);case 1:var i=e[2],c=e[1];if(i[0]===0){var v=i[1];ca(x,c),j6(x,aW);var e=v}else{var a=i[1];ca(x,c),j6(x,oW);var e=a}break;case 6:var l=e[2];return ca(x,e[1]),d(l,x);case 7:ca(x,e[1]),ln(x);return;case 8:var m=e[2];return ca(x,e[1]),R1(m);case 2:case 4:var h=e[2];return ca(x,e[1]),j6(x,h);default:var T=e[2];ca(x,e[1]),FM(x,T);return}}}function sa(x,r){for(var e=r;;){if(typeof e=="number")return;switch(e[0]){case 0:var t=e[1],u=kq(e[2]);return sa(x,t),ir(x,u);case 1:var i=e[2],c=e[1];if(i[0]===0){var v=i[1];sa(x,c),ir(x,vW);var e=v}else{var a=i[1];sa(x,c),ir(x,lW);var e=a}break;case 6:var l=e[2];return sa(x,e[1]),ir(x,d(l,0));case 7:var e=e[1];break;case 8:var m=e[2];return sa(x,e[1]),R1(m);case 2:case 4:var h=e[2];return sa(x,e[1]),ir(x,h);default:var T=e[2];return sa(x,e[1]),at(x,T)}}}function hq(x,r){return Br(function(e){return ca(x,e),0},0,r[1])}function vC(x){return hq(hn,x)}function sr(x){return Br(function(r){var e=Wr(64);return sa(e,r),G2(e)},0,x[1])}var lC=[0,0],gW=on,wW=[0,[3,0,0],Zl],_W=Xo,bW=[0,[4,0,0,0,0],D3],TW=H0,EW=[0,[11,dF,[2,0,[2,0,0]]],", %s%s"],SW=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],AW=H0,PW=H0,IW=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],NW="Out of memory",CW="Stack overflow",jW="Pattern matching failed",OW="Assertion failed",DW="Undefined recursive module",FW="Raised at",RW="Re-raised at",LW="Raised by primitive operation at",MW="Called from",qW=[0,[12,32,[4,0,0,0,0]]," %d"],BW=" (inlined)",UW=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line",[2,0,[11,SO,qK]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],XW=H0,YW=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],zW=[0,[2,0,[11," unknown location",0]],"%s unknown location"],KW=[0,[2,0,[12,10,0]],`%s +`];function pC(x,r){var e=x[1+r];if(!(1-(typeof e=="number"?1:0)))return d(sr(bW),e);if(hv(e)===_3)return d(sr(wW),e);if(hv(e)!==mE)return _W;for(var t=FN("%.12g",e),u=0,i=Cx(t);;){if(i<=u)return Mx(t,gW);var c=q2(t,u);x:{if(48<=c){if(58>c)break x}else if(c===45)break x;return t}var u=u+1|0}}function dq(x,r){if(x.length-1<=r)return TW;var e=dq(x,r+1|0),t=pC(x,r);return p(sr(EW),t,e)}function Y6(x){x:{r:{for(var r=M3(lC);r;){e:{var e=r[2],t=r[1];try{var u=d(t,x)}catch{break e}if(u)break r}var r=e}var i=0;break x}var i=[0,u[1]]}if(i)return i[1];if(x===GN)return NW;if(x===BM)return CW;if(x[1]===qM){var c=x[2],v=c[3],a=c[2],l=c[1];return JN(sr(WN),l,a,v,v+5|0,jW)}if(x[1]===Ir){var m=x[2],h=m[3],T=m[2],b=m[1];return JN(sr(WN),b,T,h,h+6|0,OW)}if(x[1]===C6){var N=x[2],C=N[3],I=N[2],F=N[1];return JN(sr(WN),F,I,C,C+6|0,DW)}if(hv(x)===0){var M=x.length-1,Y=x[1][1];if(2>>0)var q=dq(x,2),K=pC(x,1),u0=p(sr(SW),K,q);else switch(M){case 0:var u0=AW;break;case 1:var u0=PW;break;default:var Q=pC(x,1),u0=d(sr(IW),Q)}var e0=[0,Y,[0,u0]]}else var e0=[0,x[1],0];var f0=e0[2],a0=e0[1];return f0?Mx(a0,f0[1]):a0}function kC(x,r){var e=Kz(r),t=e.length-1-1|0,u=0;if(t>=0)for(var i=u;;){var c=P2(e,i)[1+i];let u0=i;var v=function(e0){return e0?u0===0?FW:RW:u0===0?LW:MW};if(c[0]===0){if(c[3]===c[6])var a=c[3],h=d(sr(qW),a);else var l=c[6],m=c[3],h=p(sr(YW),m,l);var T=c[7],b=c[4],N=c[8]?BW:XW,C=c[2],I=c[9],F=v(c[1]),Y=[0,MK(sr(UW),F,I,C,N,h,b,T)]}else if(c[1])var Y=0;else var M=v(0),Y=[0,d(sr(zW),M)];if(Y){var q=Y[1];d(hq(x,KW),q)}var K=i+1|0;if(t===i)break;var i=K}}function mC(x){for(;;){var r=M3(lC),e=1-Gm(lC,r,[0,x,r]);if(!e)return e}}var JW=[0,H0,`(Cannot print locations: + bytecode executable program file not found)`,`(Cannot print locations: + bytecode executable program file appears to be corrupt)`,`(Cannot print locations: + bytecode executable program file has wrong magic number)`,`(Cannot print locations: + bytecode executable program file cannot be opened; + -- too many open files. Try running with OCAMLRUNPARAM=b=2)`].slice(),GW=[0,[11,WE,[2,0,[12,10,0]]],zR],WW=[0],VW="Fatal error: out of memory in uncaught exception handler",$W=[0,[11,WE,[2,0,[12,10,0]]],zR],QW=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],`Fatal error in uncaught exception handler: exception %s +`];zN(BO,function(x,r){try{try{var e=r?WW:_M(0);try{$N(O)}catch{}try{var t=Y6(x);d(vC(GW),t),kC(hn,e);var u=hK(0);if(u<0){var i=v5(u);KM(P2(JW,i)[1+i])}var c=ln(hn),v=c}catch(b){var a=B2(b),l=Y6(x);d(vC($W),l),kC(hn,e);var m=Y6(a);d(vC(QW),m),kC(hn,_M(0));var v=ln(hn)}var h=v}catch(b){var T=B2(b);if(T!==GN)throw K0(T,0);var h=KM(VW)}return h}catch{return 0}});var HW=[i2,"Stdlib.Fun.Finally_raised",ks(0)],ZW="Fun.Finally_raised: ";mC(function(x){return x[1]===HW?[0,Mx(ZW,Y6(x[2]))]:0});var xV="Digest.BLAKE2: wrong hash size";function hC(x){var r=x[1]<1?1:0,e=r||(64n0){var t0=s0;continue}var l0=n0}else var l0=y0;var w0=l0;break}else var w0=Q;var L0=w0-Q|0;return 0<=L0?xl(x,[0,pV,L0+f0|0,lV]):wv(x,[0,mV,w0+e0|0,kV],x[6]);case 3:var I0=e[2],j0=e[1];if(x[8]<(x[6]-x[9]|0)){var S0=Q3(x[2]);if(S0){var W0=S0[1],A0=W0[2],J0=W0[1];x[9]=J0-1>>>0&&Sq(x,A0)}else _5(x)}var b0=x[9]-j0|0,z=I0===1?1:x[9]=x[14]);)jq(x,O);return x[13]=Tq,Aq(x),r&&_5(x),x[12]=1,x[13]=1,xC(x[28]),gC(x[1]),q6(x[2]),q6(x[3]),q6(x[4]),q6(x[5]),x[10]=0,x[14]=0,x[9]=x[6],Cq(x,0,3)}function _C(x,r,e){var t=x[14]=e)return Q0(x[17],Rq,0,e);Q0(x[17],Rq,0,80);var e=e-80|0}}function IV(x){return x[1]===dC?Mx(_V,Mx(x[2],wV)):bV}function NV(x){return x[1]===dC?Mx(EV,Mx(x[2],TV)):SV}function CV(x){return 0}function jV(x){return 0}function TC(x,r,e,t,u){var i=fq(O),c=[0,bq,AV,0];rC(c,i);var v=M6(O);gC(v),yv([0,1,c],v);var a=78,l=M6(O),m=M6(O),h=M6(O);return[0,v,M6(O),h,m,l,a,10,68,a,0,1,1,1,1,gV,PV,x,r,e,t,u,0,0,IV,NV,CV,jV,i]}function Lq(x,r){var e=TC(x,r,function(t){return 0},function(t){return 0},function(t){return 0});return e[19]=function(t){return bC(e,O)},e[20]=function(t){return rl(e,t)},e[21]=function(t){return rl(e,t)},e}function Mq(x){return Lq(function(r,e,t){return zM(x,r,e,t)},function(r){return ln(x)})}function EC(x){return Lq(function(r,e,t){return tC(x,r,e,t)},function(r){return 0})}var SC=rI;function qq(x){return Wr(SC)}var Bq=qq(O),OV=Mq(YM),DV=Mq(hn),FV=EC(Bq),Uq=hs(0,qq);B6(Uq,Bq),B6(hs(0,function(x){return EC(gv(Uq))}),FV);function Xq(x,r,e,t){return tC(gv(x),r,e,t)}function Yq(x,r,e){var t=gv(r),u=t[2];return zM(x,G2(t),0,u),ln(x),t[2]=0,0}var zq=hs(0,function(x){return Wr(SC)}),Kq=hs(0,function(x){return Wr(SC)}),Jq=hs(0,function(x){var r=TC(function(e,t,u){return Xq(zq,e,t,u)},function(e){return Yq(YM,zq,O)},function(e){return 0},function(e){return 0},function(e){return 0});return r[19]=function(e){return bC(r,O)},r[20]=function(e){return rl(r,e)},r[21]=function(e){return rl(r,e)},oq(function(e){return _v(r,O)}),r});B6(Jq,OV);var Gq=hs(0,function(x){var r=TC(function(e,t,u){return Xq(Kq,e,t,u)},function(e){return Yq(hn,Kq,O)},function(e){return 0},function(e){return 0},function(e){return 0});return r[19]=function(e){return bC(r,O)},r[20]=function(e){return rl(r,e)},r[21]=function(e){return rl(r,e)},oq(function(e){return _v(r,O)}),r});B6(Gq,DV);var RV="Buffer.sub",LV=[0,0,4],MV=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],qV=H0,BV=H0,UV=H0,XV=H0;function Wq(x,r){var e=Wr(16),t=EC(e);x(t,r),_v(t,O);var u=e[2];if(2>u)return G2(e);var i=u-2|0,c=1;return 0<=i&&(e[2]-i|0)>=1?V3(e[1][1],c,i):R1(RV)}function vt(x,r){if(typeof r!="number"){x:{r:{e:{switch(r[0]){case 0:var e=r[2];if(vt(x,r[1]),typeof e=="number")switch(e){case 0:return jq(x,O);case 1:return Oq(x,O);case 2:return _v(x,O);case 3:var t=x[14]>>0)break;var Q=Q+1|0}break t}var e0=E1(F,u0,Q-u0|0),f0=K(Q);t:n:{for(var a0=f0;;){if(a0===Y)break n;var Z=q2(F,a0);if(48<=Z){if(58<=Z)break}else if(Z!==45)break;var a0=a0+1|0}break t}if(f0===a0)var v0=0;else try{var t0=st(E1(F,f0,a0-f0|0)),v0=t0}catch(dx){var y0=B2(dx);if(y0[1]!==kn)throw K0(y0,0);var v0=q(O)}K(a0)!==Y&&q(O);t:{if(P(e0,H0)&&P(e0,cI)){if(!P(e0,"h")){var n0=0;break t}if(!P(e0,"hov")){var n0=3;break t}if(!P(e0,"hv")){var n0=2;break t}if(P(e0,WF)){var n0=q(O);break t}var n0=1;break t}var n0=4}var M=[0,v0,n0]}return Cq(x,M[1],M[2]);case 2:var s0=r[1];if(typeof s0!="number"&&s0[0]===0){var l0=s0[2];if(typeof l0!="number"&&l0[0]===1){var w0=r[2],L0=l0[2],I0=s0[1];break r}}var C0=r[2],V0=s0;break x;case 3:var j0=r[1];if(typeof j0!="number"&&j0[0]===0){var S0=j0[2];if(typeof S0!="number"&&S0[0]===1){var W0=r[2],A0=S0[2],J0=j0[1];break}}var xx=r[2],nx=j0;break e;case 4:var b0=r[1];if(typeof b0!="number"&&b0[0]===0){var z=b0[2];if(typeof z!="number"&&z[0]===1){var w0=r[2],L0=z[2],I0=b0[1];break r}}var C0=r[2],V0=b0;break x;case 5:var N0=r[1];if(typeof N0!="number"&&N0[0]===0){var rx=N0[2];if(typeof rx!="number"&&rx[0]===1){var W0=r[2],A0=rx[2],J0=N0[1];break}}var xx=r[2],nx=N0;break e;case 6:var mx=r[2];return vt(x,r[1]),d(mx,x);case 7:return vt(x,r[1]),_v(x,O);default:var F0=r[2];return vt(x,r[1]),R1(F0)}return vt(x,J0),_C(x,A0,k5(1,W0))}return vt(x,nx),K6(x,xx)}return vt(x,I0),_C(x,L0,w0)}return vt(x,V0),Fq(x,Cx(C0),C0)}}function s1(x){return function(r){return Br(function(e){return vt(x,e),0},0,r[1])}}var YV="Array.sub",zV="first domain already spawned",KV=[0,"camlinternalOO.ml",Hk,50],JV=[0,VR,72,5],GV=[0,VR,81,2],WV="/tmp",VV=on,$V=[0,"src/wtf8.ml",65,9],QV=[0,"src/third-party/sedlex/flow_sedlexing.ml",$E,4],HV="Flow_sedlexing.MalFormed",ZV=x6,x$=k3,r$=p3,e$=m6,t$=lv,n$=[0,[12,40,[18,[1,[0,[11,Si,0],Si]],[11,"File_key.LibFile",[17,[0,Ma,1,0],0]]]],"(@[<2>File_key.LibFile@ "],u$=[0,[3,0,0],Zl],i$=[0,[17,0,[12,41,0]],Tp],f$=[0,[12,40,[18,[1,[0,[11,Si,0],Si]],[11,"File_key.SourceFile",[17,[0,Ma,1,0],0]]]],"(@[<2>File_key.SourceFile@ "],c$=[0,[3,0,0],Zl],s$=[0,[17,0,[12,41,0]],Tp],a$=[0,[12,40,[18,[1,[0,[11,Si,0],Si]],[11,"File_key.JsonFile",[17,[0,Ma,1,0],0]]]],"(@[<2>File_key.JsonFile@ "],o$=[0,[3,0,0],Zl],v$=[0,[17,0,[12,41,0]],Tp],l$=[0,[12,40,[18,[1,[0,[11,Si,0],Si]],[11,"File_key.ResourceFile",[17,[0,Ma,1,0],0]]]],"(@[<2>File_key.ResourceFile@ "],p$=[0,[3,0,0],Zl],k$=[0,[17,0,[12,41,0]],Tp],m$=[0,1],h$=[0,0],d$=[0,1],y$=[0,2],g$=[0,2],w$=[0,0],_$=[0,1],b$=[0,1],T$=[0,1],E$=[0,1],S$=[0,2],A$=[0,1],P$=[0,1],I$=[0,0,0],N$=[0,0,0],C$=[0,z1,Qi,qi,Y7,V1,Sf,l7,Zf,cc,_f,Ci,Eu,Ti,su,C7,p7,Uu,Pf,q7,Wu,Wi,F7,Wn,Bf,vu,nu,Jn,Vf,os,$f,uf,vf,cs,Ec,hc,K7,Ye,Zn,Li,u7,Fc,Pi,Jf,Mc,Ke,Ic,Cu,Z7,o7,Jc,Vu,uu,g7,Ue,Qu,h7,df,i7,pf,m7,zc,Me,Ef,hi,Xu,j7,iu,Xi,$i,E7,Mf,eu,gc,Ui,v7,Fn,yf,Au,L7,oi,Dc,ki,hu,Te,qc,$n,Xf,qu,is,zn,Hn,f7,Df,pc,Kn,Qn,Ni,qf,rf,Iu,Vi,Ln,Oc,Fu,Gu,gi,Lu,Bu,Hu,x7,mi,Rc,Ii,es,Nf,Nc,ju,Pu,li,lu,Xn,wf,xs,tf,X7,Fi,Kf,ef,hf,Q7,au,w7,Qc,ic,pu,wu,ru,Wc,xi,ie,d7,Yn,Tc,Zu,xf,fu,G7,af,Of,Zc,sc,dc,M7,tc,Nu,jf,t7,I7,J7,If,T7,rs,$u,Ei,_i,yc,Bn,Du,Yu,V7,Hi,ce,Hf,Yc,Gf,bu,gf,Gc,Mi,Mn,K1,bi,D7,Kc,St,yi,bc,us,$7,e7,ri,Su,ii,Bi,_7,xc,nc,Ju,xu,cf,zf,ss,yu,ff,Gn,Vc,di,ui,Ri,ns,sf,c7,y7,Tf,ni,S7,kc,Bc,a7,n1,Rn,wc,nf,as,b7,qn,ji,vc,Cf,Sc,mc,fs,A7,Cc,Af,uc,ac,ku,Tu,P7,Ee,Ki,Ru,Dn,ec,lc,si,Ac,ai,Zi,ou,Oi,tu,Uf,Xc,Xe,Le,Yi,Gi,zu,jc,Uc,B7,cu,Lf,oc,ts,Un,fc,Ai,Ff,W7,Ji,U7,of,wi,k7,Wf,Rf,O7,Ku,pi,fi,Mu,bf,Ou,du,kf,n7,ei,s7,Di,ci,vs,ze,H7,Pc,an,R7,N7,ti,$c,r7,mu,gu,vi,_c,zi,Qf,rn,lf],j$=[0,Jc,$u,nc,yi,ii,vs,Hu,Vi,M7,V7,Pc,vu,Hn,Ke,is,wc,X7,ef,bf,cs,Ni,J7,mi,Hf,T7,ac,A7,Qi,Au,$7,hc,ui,v7,xf,lc,Lf,us,uc,es,St,Y7,Tf,Mf,Zi,Di,Ju,s7,t7,vc,Ef,ri,Ri,Mc,Oc,D7,Z7,Xn,bu,ku,Zu,Ii,pi,wi,qc,lf,iu,Fi,Ai,F7,Iu,Xu,Zc,Rf,f7,Me,Qn,Bi,$n,Nf,tc,I7,bc,ie,Gi,Jn,mc,w7,hf,sc,d7,xc,ru,E7,zi,Ac,qn,Pu,i7,hu,Qf,P7,ci,g7,V1,hi,tu,p7,h7,bi,lu,ti,di,K7,yc,Mu,gi,Jf,Ee,c7,nu,z1,Yn,Ec,Oi,Xi,Eu,Dc,Uf,pf,$c,Ci,of,ou,Bu,Zf,au,If,gu,$f,Yu,Cc,kc,zn,nf,Tc,oi,ni,Pf,os,Ff,Sf,uf,Vu,Uu,Cu,_f,O7,Yc,ns,k7,xi,_7,W7,cc,U7,wf,Lu,G7,oc,r7,li,kf,fi,Un,Qc,L7,af,fc,ju,K1,Ue,C7,q7,Ic,yf,Ye,Xe,x7,Kc,qu,a7,rs,Te,H7,ss,Af,Gf,Wf,Rn,xu,Ei,Su,su,fs,zc,Gn,Mi,Kf,Sc,b7,Uc,Gu,uu,Ln,gf,pc,gc,Vf,rf,j7,Kn,Wu,si,Q7,n7,ai,R7,Bn,Pi,Tu,vf,e7,m7,Mn,qf,du,Fu,jf,Ku,wu,Hi,Ki,Bf,rn,l7,Ru,ei,Wn,Dn,Nu,_i,zu,fu,Ui,Rc,Du,S7,pu,Of,Wi,u7,mu,tf,B7,Fn,vi,N7,n1,ki,Ji,Bc,xs,yu,ff,o7,Le,cf,ts,$i,ji,ec,Li,Fc,ic,Vc,as,Ti,sf,Wc,Xf,an,Gc,Ou,dc,Df,zf,Xc,Qu,Cf,ze,_c,ce,Yi,qi,cu,df,y7,jc,eu,Zn,Nc],O$=KR,D$=xR,F$=OF,R$=zO,L$=ky,M$=HL,q$=n6,B$=iD,U$=GF,X$=LF,Y$=CO,z$=z7,K$=Be,J$=CD,G$=bF,W$=fe,V$=GL,$$=jD,Q$=Dp,H$=hm,Z$=Ra,xQ=Ql,rQ=yR,eQ=rD,tQ=RD,nQ=YD,uQ=RF,iQ=$O,fQ=xD,cQ=pL,sQ=FD,aQ=kR,oQ=CF,vQ=kO,lQ=mF,pQ=QL,kQ=oF,mQ=Wl,hQ=j3,dQ=Ja,yQ=[0,[18,[1,[0,[11,Si,0],Si]],[11,"{ ",0]],"@[<2>{ "],gQ="Loc.line",wQ=[0,[18,[1,[0,0,H0]],[2,0,[11,HD,[17,[0,Ma,1,0],0]]]],AF],_Q=[0,[4,0,0,0,0],D3],bQ=[0,[17,0,0],bA],TQ=[0,[12,59,[17,[0,Ma,1,0],0]],";@ "],EQ=o6,SQ=[0,[18,[1,[0,0,H0]],[2,0,[11,HD,[17,[0,Ma,1,0],0]]]],AF],AQ=[0,[4,0,0,0,0],D3],PQ=[0,[17,0,0],bA],IQ=[0,[17,[0,Ma,1,0],[12,qa,[17,0,0]]],"@ }@]"],NQ=H0,CQ="Object literal may not have data and accessor property with the same name",jQ="Object literal may not have multiple get/set accessors with the same name",OQ="Unexpected token <. Remember, adjacent JSX elements must be wrapped in an enclosing parent tag",DQ="`let [` is ambiguous in this position because it is either a `let` binding pattern, or a member expression.",FQ="Async functions can only be declared at top level or immediately within another function.",RQ="`await` is an invalid identifier in async functions",LQ="`await` is not allowed in async function parameters.",MQ="Computed properties must have a value.",qQ="Constructor can't be an accessor.",BQ="Constructor can't be an async function.",UQ="Constructor can't be a generator.",XQ="It is sufficient for your declare function to just have a Promise return type.",YQ="async is an implementation detail and isn't necessary for your declare function statement. ",zQ="`declare` modifier can only appear on class fields.",KQ="Unexpected token `=`. Initializers are not allowed in a `declare`.",JQ="Unexpected token `=`. Initializers are not allowed in a `declare opaque type`.",GQ="Classes may only have one constructor",WQ="Rest element must be final element of an array pattern",VQ="Cannot export an enum with `export type`, try `export enum E {}` or `module.exports = E;` instead.",$Q="Enum members are separated with `,`. Replace `;` with `,`.",QQ="`const` enums are not supported. Flow Enums are designed to allow for inlining, however the inlining itself needs to be part of the build system (whatever you use) rather than Flow itself.",HQ="Expected an object pattern, array pattern, or an identifier but found an expression instead",ZQ="Missing comma between export specifiers",xH="Generators can only be declared at top level or immediately within another function.",rH="Getter should have zero parameters",eH="A getter cannot have a `this` parameter.",tH="Illegal break statement",nH="Illegal continue statement",uH="Illegal return statement",iH="Illegal Unicode escape",fH="Missing comma between import specifiers",cH="It cannot be used with `import type` or `import typeof` statements",sH="The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. ",aH="Explicit inexact syntax cannot appear inside an explicit exact object type",oH="Explicit inexact syntax can only appear inside an object type",vH="Component params must be an identifier. If you'd like to destructure, you should use `name as {destructure}`",lH="A bigint literal must be an integer",pH="JSX value should be either an expression or a quoted JSX text",kH="Invalid left-hand side in assignment",mH="Invalid left-hand side in exponentiation expression",hH="Invalid left-hand side in for-in",dH="Invalid left-hand side in for-of",yH="Invalid optional indexed access. Indexed access uses bracket notation. Use the format `T?.[K]`.",gH="Invalid regular expression",wH="A bigint literal cannot use exponential notation",_H="Tuple spread elements cannot be optional.",bH="Tuple variance annotations can only be used with labeled tuple elements, e.g. `[+foo: number]`",TH="`typeof` can only be used to get the type of variables.",EH="JSX attributes must only be assigned a non-empty expression",SH="Literals cannot be used as shorthand properties.",AH="Malformed unicode",PH="`match` argument must not be empty",IH="`match` argument cannot contain spread elements",NH="Object pattern can't contain methods",CH="Expected at least one type parameter.",jH="Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",OH="More than one default clause in switch statement",DH="Illegal newline after throw",FH="Illegal newline before arrow",RH="Missing catch or finally after try",LH="Const must be initialized",MH="Destructuring assignment must be initialized",qH="An optional chain may not be used in a `new` expression.",BH="Template literals may not be used in an optional chain.",UH="Rest parameter must be final parameter of an argument list",XH="Private fields may not be deleted.",YH="Private fields can only be referenced from within a class.",zH="Rest property must be final property of an object pattern",KH="Setter should have exactly one parameter",JH="A setter cannot have a `this` parameter.",GH="Catch variable may not be eval or arguments in strict mode",WH="Delete of an unqualified identifier in strict mode.",VH="Duplicate data property in object literal not allowed in strict mode",$H="Function name may not be eval or arguments in strict mode",QH="Assignment to eval or arguments is not allowed in strict mode",HH="Postfix increment/decrement may not have eval or arguments operand in strict mode",ZH="Prefix increment/decrement may not have eval or arguments operand in strict mode",xZ="Strict mode code may not include a with statement",rZ="Number literals with leading zeros are not allowed in strict mode.",eZ="Octal literals are not allowed in strict mode.",tZ="Strict mode function may not have duplicate parameter names",nZ="Parameter name eval or arguments is not allowed in strict mode",uZ='Illegal "use strict" directive in function with non-simple parameter list',iZ="Use of reserved word in strict mode",fZ="Variable name may not be eval or arguments in strict mode",cZ="You may not access a private field through the `super` keyword.",sZ="Flow does not support abstract classes.",aZ="Flow does not support template literal types.",oZ="A type annotation is required for the `this` parameter.",vZ="Arrow functions cannot have a `this` parameter; arrow functions automatically bind `this` when declared.",lZ="Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",pZ="The `this` parameter cannot be optional.",kZ="The `this` parameter must be the first function parameter.",mZ="A trailing comma is not permitted after the rest element",hZ="Unexpected end of input",dZ="Explicit inexact syntax must come at the end of an object type",yZ="Opaque type aliases are not allowed in untyped mode",gZ="Unexpected proto modifier",wZ="Unexpected reserved word",_Z="Unexpected reserved type",bZ="Spreading a type is only allowed inside an object type",TZ="Unexpected static modifier",EZ="Unexpected `super` outside of a class method",SZ="`super()` is only valid in a class constructor",AZ="Type aliases are not allowed in untyped mode",PZ="Type annotations are not allowed in untyped mode",IZ="Type declarations are not allowed in untyped mode",NZ="Type exports are not allowed in untyped mode",CZ="Type imports are not allowed in untyped mode",jZ="Interfaces are not allowed in untyped mode",OZ="Unexpected variance sigil",DZ="Found a decorator in an unsupported position.",FZ="Invalid regular expression: missing /",RZ="Unexpected whitespace between `#` and identifier",LZ="`yield` is an invalid identifier in generators",MZ="Yield expression not allowed in formal parameter",qZ=[0,[11,"Duplicate export for `",[2,0,[12,96,0]]],"Duplicate export for `%s`"],BZ=[0,[11,"Private fields may only be declared once. `#",[2,0,[11,"` is declared more than once.",0]]],"Private fields may only be declared once. `#%s` is declared more than once."],UZ=[0,[11,"bigint enum members need to be initialized, e.g. `",[2,0,[11," = 1n,` in enum `",[2,0,[11,Gs,0]]]]],"bigint enum members need to be initialized, e.g. `%s = 1n,` in enum `%s`."],XZ=[0,[11,"Boolean enum members need to be initialized. Use either `",[2,0,[11," = true,` or `",[2,0,[11," = false,` in enum `",[2,0,[11,Gs,0]]]]]]],"Boolean enum members need to be initialized. Use either `%s = true,` or `%s = false,` in enum `%s`."],YZ=[0,[11,"Enum member names need to be unique, but the name `",[2,0,[11,"` has already been used before in enum `",[2,0,[11,Gs,0]]]]],"Enum member names need to be unique, but the name `%s` has already been used before in enum `%s`."],zZ=[0,[11,nF,[2,0,[11,"` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.",0]]],"Enum `%s` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers."],KZ="The `...` must come at the end of the enum body. Remove the trailing comma.",JZ="The `...` must come after all enum members. Move it to the end of the enum body.",GZ=[0,[11,"Use one of `boolean`, `number`, `string`, `symbol`, or `bigint` in enum `",[2,0,[11,Gs,0]]],"Use one of `boolean`, `number`, `string`, `symbol`, or `bigint` in enum `%s`."],WZ=[0,[11,"Enum type `",[2,0,[11,"` is not valid. ",[2,0,0]]]],"Enum type `%s` is not valid. %s"],VZ=[0,[11,"Supplied enum type is not valid. ",[2,0,0]],"Supplied enum type is not valid. %s"],$Z=[0,[11,"Enum member names and initializers are separated with `=`. Replace `",[2,0,[11,":` with `",[2,0,[11," =`.",0]]]]],"Enum member names and initializers are separated with `=`. Replace `%s:` with `%s =`."],QZ=[0,[11,nF,[2,0,[11,"` has type `",[2,0,[11,"`, so the initializer of `",[2,0,[11,"` needs to be a ",[2,0,[11," literal.",0]]]]]]]]],"Enum `%s` has type `%s`, so the initializer of `%s` needs to be a %s literal."],HZ=[0,[11,"Symbol enum members cannot be initialized. Use `",[2,0,[11,",` in enum `",[2,0,[11,Gs,0]]]]],"Symbol enum members cannot be initialized. Use `%s,` in enum `%s`."],ZZ=[0,[11,"The enum member initializer for `",[2,0,[11,"` needs to be a literal (either a boolean, number, or string) in enum `",[2,0,[11,Gs,0]]]]],"The enum member initializer for `%s` needs to be a literal (either a boolean, number, or string) in enum `%s`."],x00=[0,[11,"Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `",[2,0,[11,"`, consider using `",[2,0,[11,"`, in enum `",[2,0,[11,Gs,0]]]]]]],"Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%s`, consider using `%s`, in enum `%s`."],r00=[0,[11,"Number enum members need to be initialized, e.g. `",[2,0,[11," = 1,` in enum `",[2,0,[11,Gs,0]]]]],"Number enum members need to be initialized, e.g. `%s = 1,` in enum `%s`."],e00=[0,[11,"String enum members need to consistently either all use initializers, or use no initializers, in enum ",[2,0,[12,46,0]]],"String enum members need to consistently either all use initializers, or use no initializers, in enum %s."],t00=[0,[11,"Expected corresponding JSX closing tag for ",[2,0,0]],"Expected corresponding JSX closing tag for %s"],n00="immediately within another function.",u00="In strict mode code, functions can only be declared at top level or ",i00="inside a block, or as the body of an if statement.",f00="In non-strict mode code, functions can only be declared at top level, ",c00="static ",s00=H0,a00="methods",o00="fields",v00=qR,l00=[0,[11,"Classes may not have ",[2,0,[2,0,[11," named `",[2,0,[11,Gs,0]]]]]],"Classes may not have %s%s named `%s`."],p00="Components use `renders` instead of `:` to annotate the render type of a component.",k00=cR,m00=H0,h00=[0,[11,"String params require local bindings using `as` renaming. You can use `'",[2,0,[11,"' as ",[2,0,[2,0,[11,": ` ",0]]]]]],"String params require local bindings using `as` renaming. You can use `'%s' as %s%s: ` "],d00="Remove the period.",y00="Indexed access uses bracket notation.",g00=[0,[11,"Invalid indexed access. ",[2,0,[11," Use the format `T[K]`.",0]]],"Invalid indexed access. %s Use the format `T[K]`."],w00=[0,[11,"Invalid flags supplied to RegExp constructor '",[2,0,[12,39,0]]],"Invalid flags supplied to RegExp constructor '%s'"],_00=rn,b00=Q4,T00=[0,[11,"In match ",[2,0,[11," pattern, the rest must be the last element in the pattern",0]]],"In match %s pattern, the rest must be the last element in the pattern"],E00=[0,[11,"JSX element ",[2,0,[11," has no corresponding closing tag.",0]]],"JSX element %s has no corresponding closing tag."],S00=[0,[11,uR,[2,0,[11,"`. Parentheses are required to combine `??` with `&&` or `||` expressions.",0]]],"Unexpected token `%s`. Parentheses are required to combine `??` with `&&` or `||` expressions."],A00=[0,[2,0,[11," '",[2,0,[11,"' has already been declared",0]]]],"%s '%s' has already been declared"],P00=H0,I00=Ul,N00=" You can try using JavaScript private fields by prepending `#` to the field name.",C00=g6,j00=" Fields and methods are public by default. You can simply omit the `public` keyword.",O00=h6,D00=[0,[11,"Flow does not support using `",[2,0,[11,"` in classes.",[2,0,0]]]],"Flow does not support using `%s` in classes.%s"],F00=[0,[11,"Private fields must be declared before they can be referenced. `#",[2,0,[11,"` has not been declared.",0]]],"Private fields must be declared before they can be referenced. `#%s` has not been declared."],R00=[0,[11,tR,[2,0,0]],"Unexpected %s"],L00=[0,[11,uR,[2,0,[11,"`. Did you mean `",[2,0,[11,"`?",0]]]]],"Unexpected token `%s`. Did you mean `%s`?"],M00=[0,[11,tR,[2,0,[11,", expected ",[2,0,0]]]],"Unexpected %s, expected %s"],q00=[0,[11,"Undefined label '",[2,0,[12,39,0]]],"Undefined label '%s'"],B00="Parse_error.Error",U00=[0,[0,36,37],[0,48,58],[0,65,91],[0,95,96],[0,97,en],[0,J4,zw],[0,N8,Ty],[0,$9,pm],[0,hA,cg],[0,v3,Tg],[0,gd,ip],[0,i2,706],[0,XO,722],[0,736,741],[0,748,749],[0,750,751],[0,768,885],[0,886,888],[0,890,894],[0,895,896],[0,902,907],[0,908,909],[0,910,930],[0,MR,1014],[0,1015,1154],[0,1155,1160],[0,1162,1328],[0,1329,1367],[0,1369,1370],[0,1376,1417],[0,1425,1470],[0,1471,1472],[0,1473,1475],[0,1476,1478],[0,1479,1480],[0,1488,1515],[0,1519,1523],[0,1552,1563],[0,1568,1642],[0,1646,1748],[0,1749,1757],[0,1759,1769],[0,1770,1789],[0,1791,1792],[0,1808,1867],[0,1869,1970],[0,1984,2038],[0,2042,2043],[0,2045,2046],[0,f_,2094],[0,2112,2140],[0,2144,2155],[0,2208,2229],[0,2230,2238],[0,2259,2274],[0,2275,2404],[0,2406,2416],[0,2417,2436],[0,2437,2445],[0,2447,2449],[0,2451,2473],[0,2474,2481],[0,2482,2483],[0,2486,2490],[0,2492,2501],[0,2503,2505],[0,2507,2511],[0,2519,2520],[0,2524,2526],[0,2527,2532],[0,2534,2546],[0,2556,2557],[0,2558,2559],[0,2561,2564],[0,2565,2571],[0,2575,2577],[0,2579,2601],[0,2602,2609],[0,2610,2612],[0,2613,2615],[0,2616,2618],[0,2620,2621],[0,2622,2627],[0,2631,2633],[0,2635,2638],[0,2641,2642],[0,2649,2653],[0,2654,2655],[0,2662,2678],[0,2689,2692],[0,2693,2702],[0,2703,2706],[0,2707,2729],[0,2730,2737],[0,2738,2740],[0,2741,2746],[0,2748,2758],[0,2759,2762],[0,2763,2766],[0,2768,2769],[0,2784,2788],[0,2790,2800],[0,2809,2816],[0,2817,2820],[0,2821,2829],[0,2831,2833],[0,2835,2857],[0,2858,2865],[0,2866,2868],[0,2869,2874],[0,2876,2885],[0,2887,2889],[0,2891,2894],[0,2902,2904],[0,2908,2910],[0,2911,2916],[0,2918,2928],[0,2929,2930],[0,2946,2948],[0,2949,2955],[0,2958,2961],[0,2962,2966],[0,2969,2971],[0,2972,2973],[0,2974,2976],[0,2979,2981],[0,2984,2987],[0,2990,3002],[0,3006,3011],[0,3014,3017],[0,3018,3022],[0,3024,3025],[0,3031,3032],[0,3046,3056],[0,3072,3085],[0,3086,3089],[0,3090,3113],[0,3114,3130],[0,3133,3141],[0,3142,3145],[0,3146,3150],[0,3157,3159],[0,3160,3163],[0,3168,3172],[0,3174,3184],[0,3200,3204],[0,3205,3213],[0,3214,3217],[0,3218,3241],[0,3242,3252],[0,3253,3258],[0,3260,3269],[0,3270,3273],[0,3274,3278],[0,3285,3287],[0,3294,3295],[0,3296,3300],[0,3302,3312],[0,3313,3315],[0,3328,3332],[0,3333,3341],[0,3342,3345],[0,3346,3397],[0,3398,3401],[0,3402,3407],[0,3412,3416],[0,3423,3428],[0,3430,3440],[0,3450,3456],[0,3458,3460],[0,3461,3479],[0,3482,3506],[0,3507,3516],[0,3517,3518],[0,3520,3527],[0,3530,3531],[0,3535,3541],[0,3542,3543],[0,3544,3552],[0,3558,3568],[0,3570,3572],[0,3585,3643],[0,3648,3663],[0,3664,3674],[0,3713,3715],[0,3716,3717],[0,3718,3723],[0,3724,3748],[0,3749,3750],[0,3751,3774],[0,3776,3781],[0,3782,3783],[0,3784,3790],[0,3792,3802],[0,3804,3808],[0,3840,3841],[0,3864,3866],[0,3872,3882],[0,3893,3894],[0,3895,3896],[0,3897,3898],[0,3902,3912],[0,3913,3949],[0,3953,3973],[0,3974,3992],[0,3993,4029],[0,4038,4039],[0,MF,4170],[0,4176,4254],[0,4256,4294],[0,4295,4296],[0,4301,4302],[0,4304,4347],[0,4348,4681],[0,4682,4686],[0,4688,4695],[0,4696,4697],[0,4698,4702],[0,4704,4745],[0,4746,4750],[0,4752,4785],[0,4786,4790],[0,4792,4799],[0,4800,4801],[0,4802,4806],[0,4808,4823],[0,4824,4881],[0,4882,4886],[0,4888,4955],[0,4957,4960],[0,4969,4978],[0,4992,5008],[0,5024,5110],[0,5112,5118],[0,5121,5741],[0,5743,dI],[0,5761,5787],[0,5792,5867],[0,5870,5881],[0,5888,5901],[0,5902,5909],[0,5920,5941],[0,5952,5972],[0,5984,5997],[0,5998,6001],[0,6002,6004],[0,6016,6100],[0,6103,6104],[0,6108,6110],[0,6112,6122],[0,6155,6158],[0,6160,6170],[0,6176,6265],[0,6272,6315],[0,6320,6390],[0,6400,6431],[0,6432,6444],[0,6448,6460],[0,6470,6510],[0,6512,6517],[0,6528,6572],[0,6576,6602],[0,6608,6619],[0,6656,6684],[0,6688,6751],[0,6752,6781],[0,6783,6794],[0,6800,6810],[0,6823,6824],[0,6832,6846],[0,6912,6988],[0,6992,7002],[0,7019,7028],[0,7040,7156],[0,7168,7224],[0,7232,7242],[0,7245,7294],[0,7296,7305],[0,7312,7355],[0,7357,7360],[0,7376,7379],[0,7380,7419],[0,7424,7674],[0,7675,7958],[0,7960,7966],[0,7968,8006],[0,8008,8014],[0,8016,8024],[0,8025,8026],[0,8027,8028],[0,8029,8030],[0,8031,8062],[0,8064,8117],[0,8118,8125],[0,8126,8127],[0,8130,8133],[0,8134,8141],[0,8144,8148],[0,8150,8156],[0,8160,8173],[0,8178,8181],[0,8182,8189],[0,pD,RR],[0,8255,8257],[0,8276,8277],[0,x8,8306],[0,bk,8320],[0,8336,8349],[0,8400,8413],[0,8417,8418],[0,8421,8433],[0,R8,8451],[0,cm,8456],[0,8458,gp],[0,jp,8470],[0,vR,8478],[0,Lk,om],[0,_m,Rp],[0,Xp,lm],[0,8490,8506],[0,8508,8512],[0,8517,8522],[0,Hp,8527],[0,8544,8585],[0,11264,11311],[0,11312,11359],[0,11360,11493],[0,11499,11508],[0,11520,P8],[0,M4,11560],[0,rm,11566],[0,11568,11624],[0,wk,11632],[0,Sp,11671],[0,11680,C8],[0,11688,O8],[0,11696,q4],[0,11704,rk],[0,11712,s8],[0,11720,z4],[0,11728,Pm],[0,11736,11743],[0,11744,11776],[0,12293,12296],[0,12321,Tm],[0,12337,12342],[0,12344,12349],[0,12353,12439],[0,12441,f8],[0,12449,Mm],[0,12540,12544],[0,12549,sm],[0,12593,12687],[0,12704,12731],[0,12784,12800],[0,13312,19894],[0,19968,40944],[0,40960,42125],[0,42192,42238],[0,42240,42509],[0,42512,42540],[0,42560,42608],[0,42612,yp],[0,42623,42738],[0,42775,42784],[0,42786,42889],[0,42891,42944],[0,42946,42951],[0,Nk,43048],[0,43072,43124],[0,43136,43206],[0,43216,43226],[0,43232,43256],[0,vk,nk],[0,43261,43310],[0,43312,43348],[0,43360,43389],[0,43392,43457],[0,l8,43482],[0,43488,tp],[0,yF,43575],[0,43584,43598],[0,43600,43610],[0,43616,43639],[0,E8,43715],[0,43739,43742],[0,43744,43760],[0,43762,43767],[0,43777,43783],[0,43785,43791],[0,43793,43799],[0,43808,B8],[0,43816,Ck],[0,43824,m8],[0,43868,W4],[0,43888,44011],[0,44012,44014],[0,44016,44026],[0,44032,55204],[0,55216,55239],[0,55243,55292],[0,63744,64110],[0,64112,64218],[0,64256,64263],[0,64275,64280],[0,ak,ep],[0,64298,Bk],[0,64312,L8],[0,lk,Ip],[0,64320,Em],[0,64323,Xm],[0,64326,64434],[0,64467,64830],[0,64848,64912],[0,64914,64968],[0,65008,65020],[0,65024,65040],[0,65056,65072],[0,65075,65077],[0,65101,65104],[0,65136,mm],[0,65142,65277],[0,65296,65306],[0,65313,65339],[0,65343,j8],[0,65345,65371],[0,65382,65471],[0,65474,65480],[0,65482,65488],[0,65490,65496],[0,65498,65501],[0,v6,jm],[0,65549,h8],[0,65576,qp],[0,65596,Up],[0,65599,65614],[0,65616,65630],[0,65664,65787],[0,65856,65909],[0,66045,66046],[0,66176,66205],[0,66208,66257],[0,66272,66273],[0,66304,66336],[0,66349,66379],[0,66384,66427],[0,66432,66462],[0,66464,66500],[0,66504,Im],[0,66513,66518],[0,66560,66718],[0,66720,66730],[0,66736,66772],[0,66776,66812],[0,66816,66856],[0,66864,66916],[0,67072,67383],[0,67392,67414],[0,67424,67432],[0,67584,67590],[0,Pp,mk],[0,67594,Nm],[0,67639,67641],[0,k8,67645],[0,67647,67670],[0,67680,67703],[0,67712,67743],[0,67808,op],[0,67828,67830],[0,67840,67862],[0,67872,67898],[0,67968,68024],[0,68030,68032],[0,Om,68100],[0,68101,68103],[0,68108,ek],[0,68117,p8],[0,68121,68150],[0,68152,68155],[0,68159,68160],[0,68192,68221],[0,68224,68253],[0,68288,Qk],[0,68297,68327],[0,68352,68406],[0,68416,68438],[0,68448,68467],[0,68480,68498],[0,68608,68681],[0,68736,68787],[0,68800,68851],[0,68864,68904],[0,68912,68922],[0,69376,69405],[0,nm,69416],[0,69424,69457],[0,69600,69623],[0,69632,69703],[0,69734,bm],[0,69759,69819],[0,69840,69865],[0,69872,69882],[0,69888,69941],[0,69942,69952],[0,np,Wp],[0,69968,70004],[0,vm,70007],[0,70016,70085],[0,70089,70093],[0,70096,Q8],[0,Pk,70109],[0,70144,$8],[0,70163,70200],[0,70206,70207],[0,70272,W8],[0,Yk,$p],[0,70282,V8],[0,70287,D8],[0,70303,70313],[0,70320,70379],[0,70384,70394],[0,70400,$4],[0,70405,70413],[0,70415,70417],[0,70419,km],[0,70442,c8],[0,70450,S8],[0,70453,70458],[0,70459,70469],[0,70471,70473],[0,70475,70478],[0,fp,70481],[0,70487,70488],[0,70493,70500],[0,70502,70509],[0,70512,70517],[0,70656,70731],[0,70736,70746],[0,_p,70752],[0,70784,im],[0,_k,70856],[0,70864,70874],[0,71040,71094],[0,71096,71105],[0,71128,71134],[0,71168,71233],[0,Ak,71237],[0,71248,71258],[0,71296,71353],[0,71360,71370],[0,71424,71451],[0,71453,71468],[0,71472,71482],[0,71680,71739],[0,71840,71914],[0,71935,71936],[0,72096,72104],[0,72106,72152],[0,72154,Zk],[0,fm,72165],[0,yk,72255],[0,72263,72264],[0,Zp,72346],[0,jk,72350],[0,72384,72441],[0,72704,am],[0,72714,72759],[0,72760,72769],[0,72784,72794],[0,72818,72848],[0,72850,72872],[0,72873,72887],[0,72960,Fk],[0,72968,Am],[0,72971,73015],[0,73018,73019],[0,73020,73022],[0,73023,73032],[0,73040,73050],[0,73056,Xk],[0,73063,X8],[0,73066,73103],[0,73104,73106],[0,73107,73113],[0,73120,73130],[0,73440,73463],[0,73728,74650],[0,74752,74863],[0,74880,75076],[0,77824,78895],[0,82944,83527],[0,92160,92729],[0,92736,92767],[0,92768,92778],[0,92880,92910],[0,92912,92917],[0,92928,92983],[0,92992,92996],[0,93008,93018],[0,93027,93048],[0,93053,93072],[0,93760,93824],[0,93952,94027],[0,U8,94088],[0,94095,94112],[0,94176,Np],[0,V4,94180],[0,94208,100344],[0,100352,101107],[0,110592,110879],[0,110928,110931],[0,110948,110952],[0,110960,111356],[0,113664,113771],[0,113776,113789],[0,113792,113801],[0,113808,113818],[0,113821,113823],[0,119141,119146],[0,119149,119155],[0,119163,119171],[0,119173,119180],[0,119210,119214],[0,119362,119365],[0,119808,Z4],[0,119894,Gp],[0,119966,119968],[0,hk,119971],[0,119973,119975],[0,119977,Km],[0,119982,K8],[0,r8,d8],[0,119997,Tk],[0,120005,Um],[0,120071,120075],[0,120077,Ep],[0,120086,G8],[0,120094,up],[0,120123,v8],[0,120128,gk],[0,fk,120135],[0,120138,wm],[0,120146,120486],[0,120488,Op],[0,120514,Uk],[0,120540,qm],[0,120572,Vp],[0,120598,Gk],[0,120630,mp],[0,120656,Mk],[0,120688,cp],[0,120714,G4],[0,120746,Kp],[0,120772,120780],[0,120782,120832],[0,121344,121399],[0,121403,121453],[0,121461,121462],[0,121476,121477],[0,121499,121504],[0,121505,121520],[0,122880,122887],[0,122888,122905],[0,122907,122914],[0,122915,122917],[0,122918,122923],[0,123136,123181],[0,123184,123198],[0,123200,123210],[0,X4,123215],[0,123584,123642],[0,124928,125125],[0,125136,125143],[0,125184,125260],[0,125264,125274],[0,126464,hp],[0,126469,F8],[0,126497,Lm],[0,K4,126501],[0,em,a8],[0,126505,U4],[0,126516,Wk],[0,Dm,w8],[0,lp,126524],[0,Sm,126531],[0,Ym,kp],[0,Fm,I8],[0,Cm,xp],[0,126541,Qp],[0,126545,ym],[0,Z8,126549],[0,$k,pp],[0,pk,Rk],[0,A8,gm],[0,Ap,sp],[0,t8,Bp],[0,126561,vp],[0,dm,126565],[0,126567,H4],[0,126572,wp],[0,126580,zk],[0,126585,ok],[0,Vk,um],[0,126592,ap],[0,126603,126620],[0,126625,Jk],[0,126629,Ok],[0,126635,126652],[0,131072,173783],[0,173824,177973],[0,177984,178206],[0,178208,183970],[0,183984,191457],[0,194560,195102],[0,917760,918e3]],X00=[0,1,0],Y00=[0,0,[0,1,0],[0,1,0]],z00=fL,K00="end of input",J00=s6,G00="template literal part",W00=s6,V00=mO,$00=fL,Q00=s6,H00=k3,Z00=s6,xx0=lv,rx0=s6,ex0=p3,tx0="an",nx0=St,ux0=_u,ix0=[0,[11,"token `",[2,0,[12,96,0]]],"token `%s`"],fx0="{",cx0=g8,sx0="{|",ax0="|}",ox0=DR,vx0=sR,lx0="[",px0="]",kx0=Wb,mx0=KL,hx0=on,dx0="=>",yx0="...",gx0=OO,wx0=qR,_x0=y3,bx0=_8,Tx0=Ra,Ex0=Ql,Sx0=Ue,Ax0=Ke,Px0=vI,Ix0=xv,Nx0=Ye,Cx0=b8,jx0=Wl,Ox0=B4,Dx0=e8,Fx0=Ja,Rx0=j3,Lx0=cv,Mx0=Xs,qx0=$s,Bx0=ze,Ux0=dp,Xx0=xm,Yx0=Le,zx0=$o,Kx0=Mp,Jx0=i8,Gx0=o8,Wx0=Yl,Vx0=rc,$x0=Re,Qx0=zp,Hx0=nv,Zx0=Vl,xr0=Ws,rr0=Ys,er0=r6,tr0=Rm,nr0=K1,ur0=C3,ir0=vv,fr0=ce,cr0=Yp,sr0=g6,ar0=Ul,or0=h6,vr0=z1,lr0=Xe,pr0=_6,kr0=Yf,mr0=cb,hr0=sS,dr0=Ya,yr0=fv,gr0="%checks",wr0=FD,_r0=pL,br0=xD,Tr0=CF,Er0=kR,Sr0=kO,Ar0=$O,Pr0=RF,Ir0=RD,Nr0=YD,Cr0=rD,jr0=yR,Or0=mF,Dr0=QL,Fr0=oF,Rr0=P9,Lr0="?.",Mr0=Hg,qr0=cR,Br0=Uo,Ur0=XF,Xr0=FR,Yr0=jD,zr0=Dp,Kr0=hm,Jr0=KR,Gr0=xR,Wr0=OF,Vr0=zO,$r0=HL,Qr0=iD,Hr0=ky,Zr0=n6,x20=GF,r20=LF,e20=CO,t20=z7,n20=Be,u20=fe,i20=CD,f20=bF,c20=GL,s20=MO,a20=$L,o20=ZR,v20=SD,l20=H0,p20=bp,k20=Fp,m20=Ee,h20=k3,d20=lv,y20=p3,g20=Ys,w20=m6,_20=Cp,b20=Lp,T20=sk,E20=tm,S20=ev,A20=GO,P20=p6,I20=E3,N20=d3,C20=BF,j20=pF,O20=Xl,D20=Xl,F20=gL,R20=Xl,L20=Xl,M20=g8,q20=g8,B20=gL,U20=fe,X20=fe,Y20=x6,z20=y8,K20="T_LCURLY",J20="T_RCURLY",G20="T_LCURLYBAR",W20="T_RCURLYBAR",V20="T_LPAREN",$20="T_RPAREN",Q20="T_LBRACKET",H20="T_RBRACKET",Z20="T_SEMICOLON",x10="T_COMMA",r10="T_PERIOD",e10="T_ARROW",t10="T_ELLIPSIS",n10="T_AT",u10="T_POUND",i10="T_FUNCTION",f10="T_IF",c10="T_IN",s10="T_INSTANCEOF",a10="T_RETURN",o10="T_SWITCH",v10="T_MATCH",l10="T_THIS",p10="T_THROW",k10="T_TRY",m10="T_VAR",h10="T_WHILE",d10="T_WITH",y10="T_CONST",g10="T_LET",w10="T_NULL",_10="T_FALSE",b10="T_TRUE",T10="T_BREAK",E10="T_CASE",S10="T_CATCH",A10="T_CONTINUE",P10="T_DEFAULT",I10="T_DO",N10="T_FINALLY",C10="T_FOR",j10="T_CLASS",O10="T_EXTENDS",D10="T_STATIC",F10="T_ELSE",R10="T_NEW",L10="T_DELETE",M10="T_TYPEOF",q10="T_VOID",B10="T_ENUM",U10="T_EXPORT",X10="T_IMPORT",Y10="T_SUPER",z10="T_IMPLEMENTS",K10="T_INTERFACE",J10="T_PACKAGE",G10="T_PRIVATE",W10="T_PROTECTED",V10="T_PUBLIC",$10="T_YIELD",Q10="T_DEBUGGER",H10="T_DECLARE",Z10="T_TYPE",xe0="T_OPAQUE",re0="T_OF",ee0="T_ASYNC",te0="T_AWAIT",ne0="T_CHECKS",ue0="T_RSHIFT3_ASSIGN",ie0="T_RSHIFT_ASSIGN",fe0="T_LSHIFT_ASSIGN",ce0="T_BIT_XOR_ASSIGN",se0="T_BIT_OR_ASSIGN",ae0="T_BIT_AND_ASSIGN",oe0="T_MOD_ASSIGN",ve0="T_DIV_ASSIGN",le0="T_MULT_ASSIGN",pe0="T_EXP_ASSIGN",ke0="T_MINUS_ASSIGN",me0="T_PLUS_ASSIGN",he0="T_NULLISH_ASSIGN",de0="T_AND_ASSIGN",ye0="T_OR_ASSIGN",ge0="T_ASSIGN",we0="T_PLING_PERIOD",_e0="T_PLING_PLING",be0="T_PLING",Te0="T_COLON",Ee0="T_OR",Se0="T_AND",Ae0="T_BIT_OR",Pe0="T_BIT_XOR",Ie0="T_BIT_AND",Ne0="T_EQUAL",Ce0="T_NOT_EQUAL",je0="T_STRICT_EQUAL",Oe0="T_STRICT_NOT_EQUAL",De0="T_LESS_THAN_EQUAL",Fe0="T_GREATER_THAN_EQUAL",Re0="T_LESS_THAN",Le0="T_GREATER_THAN",Me0="T_LSHIFT",qe0="T_RSHIFT",Be0="T_RSHIFT3",Ue0="T_PLUS",Xe0="T_MINUS",Ye0="T_DIV",ze0="T_MULT",Ke0="T_EXP",Je0="T_MOD",Ge0="T_NOT",We0="T_BIT_NOT",Ve0="T_INCR",$e0="T_DECR",Qe0="T_EOF",He0="T_ANY_TYPE",Ze0="T_MIXED_TYPE",xt0="T_EMPTY_TYPE",rt0="T_NUMBER_TYPE",et0="T_BIGINT_TYPE",tt0="T_STRING_TYPE",nt0="T_VOID_TYPE",ut0="T_SYMBOL_TYPE",it0="T_UNKNOWN_TYPE",ft0="T_NEVER_TYPE",ct0="T_UNDEFINED_TYPE",st0="T_KEYOF",at0="T_READONLY",ot0="T_INFER",vt0="T_IS",lt0="T_ASSERTS",pt0="T_IMPLIES",kt0=JL,mt0=JL,ht0="T_NUMBER",dt0="T_BIGINT",yt0="T_STRING",gt0="T_TEMPLATE_PART",wt0="T_IDENTIFIER",_t0="T_REGEXP",bt0="T_INTERPRETER",Tt0="T_ERROR",Et0="T_JSX_IDENTIFIER",St0=UL,At0=UL,Pt0="T_BOOLEAN_TYPE",It0="T_NUMBER_SINGLETON_TYPE",Nt0="T_BIGINT_SINGLETON_TYPE",Ct0=[0,VD,M8,9],jt0=[0,VD,kk,9],Ot0=yL,Dt0="*/",Ft0=yL,Rt0="unreachable line_comment",Lt0="unreachable string_quote",Mt0="\\",qt0="unreachable template_part",Bt0=`\r +`,Ut0=bw,Xt0="unreachable regexp_class",Yt0=VO,zt0="unreachable regexp_body",Kt0=H0,Jt0=H0,Gt0=H0,Wt0=H0,Vt0=AD,$t0="{'>'}",Qt0=n6,Ht0="{'}'}",Zt0=g8,xn0=Ua,rn0=Wb,en0=hm,tn0=AD,nn0=Ua,un0=Wb,in0=hm,fn0="unreachable type_token wholenumber",cn0="unreachable type_token wholebigint",sn0="unreachable type_token floatbigint",an0="unreachable type_token scinumber",on0="unreachable type_token scibigint",vn0="unreachable type_token hexnumber",ln0="unreachable type_token hexbigint",pn0="unreachable type_token legacyoctnumber",kn0="unreachable type_token octnumber",mn0="unreachable type_token octbigint",hn0="unreachable type_token binnumber",dn0="unreachable type_token bigbigint",yn0="unreachable type_token",gn0=hL,wn0=[11,1],_n0=[11,0],bn0="unreachable template_tail",Tn0=H0,En0=H0,Sn0="unreachable jsx_child",An0="unreachable jsx_tag",Pn0=[0,ND],In0=[0,913],Nn0=[0,v3],Cn0=[0,NI],jn0=[0,dD],On0=[0,RL],Dn0=[0,8747],Fn0=[0,FO],Rn0=[0,916],Ln0=[0,8225],Mn0=[0,935],qn0=[0,wL],Bn0=[0,914],Un0=[0,LA],Xn0=[0,FF],Yn0=[0,hR],zn0=[0,915],Kn0=[0,LO],Jn0=[0,919],Gn0=[0,917],Wn0=[0,dL],Vn0=[0,tD],$n0=[0,tF],Qn0=[0,924],Hn0=[0,923],Zn0=[0,922],x70=[0,gF],r70=[0,921],e70=[0,ST],t70=[0,kk],n70=[0,cF],u70=[0,gd],i70=[0,927],f70=[0,937],c70=[0,uD],s70=[0,uF],a70=[0,kD],o70=[0,338],v70=[0,352],l70=[0,929],p70=[0,936],k70=[0,8243],m70=[0,928],h70=[0,934],d70=[0,ML],y70=[0,nD],g70=[0,933],w70=[0,dR],_70=[0,eL],b70=[0,yO],T70=[0,920],E70=[0,932],S70=[0,KO],A70=[0,ID],P70=[0,QF],I70=[0,rF],N70=[0,918],C70=[0,376],j70=[0,HF],O70=[0,926],D70=[0,z_],F70=[0,MR],R70=[0,925],L70=[0,39],M70=[0,8736],q70=[0,8743],B70=[0,38],U70=[0,945],X70=[0,8501],Y70=[0,qo],z70=[0,8226],K70=[0,eD],J70=[0,946],G70=[0,8222],W70=[0,JO],V70=[0,AR],$70=[0,8776],Q70=[0,kL],H70=[0,8773],Z70=[0,9827],xu0=[0,XO],ru0=[0,967],eu0=[0,XR],tu0=[0,pm],nu0=[0,UO],uu0=[0,JF],iu0=[0,8595],fu0=[0,8224],cu0=[0,8659],su0=[0,yD],au0=[0,8746],ou0=[0,8629],vu0=[0,Fg],lu0=[0,8745],pu0=[0,8195],ku0=[0,8709],mu0=[0,dO],hu0=[0,mL],du0=[0,cL],yu0=[0,ip],gu0=[0,9830],wu0=[0,8707],_u0=[0,8364],bu0=[0,NR],Tu0=[0,b3],Eu0=[0,951],Su0=[0,8801],Au0=[0,949],Pu0=[0,8194],Iu0=[0,8805],Nu0=[0,947],Cu0=[0,8260],ju0=[0,HT],Ou0=[0,K9],Du0=[0,M8],Fu0=[0,8704],Ru0=[0,KF],Lu0=[0,bL],Mu0=[0,8230],qu0=[0,9829],Bu0=[0,8596],Uu0=[0,8660],Xu0=[0,62],Yu0=[0,402],zu0=[0,948],Ku0=[0,lF],Ju0=[0,By],Gu0=[0,8712],Wu0=[0,TP],Vu0=[0,953],$u0=[0,8734],Qu0=[0,8465],Hu0=[0,OR],Zu0=[0,8220],xi0=[0,8968],ri0=[0,8592],ei0=[0,zw],ti0=[0,10216],ni0=[0,955],ui0=[0,8656],ii0=[0,954],fi0=[0,60],ci0=[0,8216],si0=[0,8249],ai0=[0,RR],oi0=[0,9674],vi0=[0,8727],li0=[0,8970],pi0=[0,SL],ki0=[0,8711],mi0=[0,956],hi0=[0,8722],di0=[0,$9],yi0=[0,N8],gi0=[0,8212],wi0=[0,BD],_i0=[0,8804],bi0=[0,957],Ti0=[0,TF],Ei0=[0,8836],Si0=[0,8713],Ai0=[0,eF],Pi0=[0,8715],Ii0=[0,8800],Ni0=[0,8853],Ci0=[0,959],ji0=[0,969],Oi0=[0,8254],Di0=[0,WR],Fi0=[0,339],Ri0=[0,Go],Li0=[0,YR],Mi0=[0,Ty],qi0=[0,I3],Bi0=[0,8855],Ui0=[0,rE],Xi0=[0,i2],Yi0=[0,hA],zi0=[0,J4],Ki0=[0,lr],Ji0=[0,iA],Gi0=[0,982],Wi0=[0,960],Vi0=[0,966],$i0=[0,8869],Qi0=[0,8240],Hi0=[0,8706],Zi0=[0,8744],xf0=[0,8211],rf0=[0,10217],ef0=[0,8730],tf0=[0,8658],nf0=[0,34],uf0=[0,968],if0=[0,8733],ff0=[0,8719],cf0=[0,961],sf0=[0,8971],af0=[0,LL],of0=[0,8476],vf0=[0,8221],lf0=[0,8969],pf0=[0,8594],kf0=[0,cg],mf0=[0,PR],hf0=[0,wF],df0=[0,8901],yf0=[0,353],gf0=[0,8218],wf0=[0,8217],_f0=[0,8250],bf0=[0,8835],Tf0=[0,8721],Ef0=[0,8838],Sf0=[0,8834],Af0=[0,9824],Pf0=[0,8764],If0=[0,962],Nf0=[0,963],Cf0=[0,8207],jf0=[0,952],Of0=[0,8756],Df0=[0,964],Ff0=[0,dk],Rf0=[0,8839],Lf0=[0,WL],Mf0=[0,wD],qf0=[0,R3],Bf0=[0,8657],Uf0=[0,8482],Xf0=[0,Tg],Yf0=[0,732],zf0=[0,g3],Kf0=[0,8201],Jf0=[0,977],Gf0=[0,vR],Wf0=[0,_3],Vf0=[0,965],$f0=[0,978],Qf0=[0,AL],Hf0=[0,$E],Zf0=[0,VL],xc0=[0,pD],rc0=[0,8205],ec0=[0,950],tc0=[0,xk],nc0=[0,SF],uc0=[0,mE],ic0=[0,958],fc0=[0,8593],cc0=[0,Td],sc0=[0,8242],ac0=[0,sL],oc0="unreachable regexp",vc0="unreachable token wholenumber",lc0="unreachable token wholebigint",pc0="unreachable token floatbigint",kc0="unreachable token scinumber",mc0="unreachable token scibigint",hc0="unreachable token hexnumber",dc0="unreachable token hexbigint",yc0="unreachable token legacyoctnumber",gc0="unreachable token legacynonoctnumber",wc0="unreachable token octnumber",_c0="unreachable token octbigint",bc0="unreachable token bignumber",Tc0="unreachable token bigint",Ec0="unreachable token",Sc0=hL,Ac0=[7,"#!"],Pc0="expected ?",Ic0="unreachable string_escape",Nc0=W1,Cc0=Hl,jc0=Hl,Oc0=W1,Dc0=cI,Fc0=jF,Rc0="n",Lc0="r",Mc0="t",qc0=WF,Bc0=Hl,Uc0=Ua,Xc0=Ua,Yc0="unreachable id_char",zc0=Ua,Kc0=Ua,Jc0=Hl,Gc0=tL,Wc0=TO,Vc0=q_,$c0=[26,"token ILLEGAL"],Qc0=[0,[11,"the identifier `",[2,0,[12,96,0]]],"the identifier `%s`"],Hc0=[0,1],Zc0=[0,1],xs0=qF,rs0=qF,es0=[0,[11,"an identifier. When exporting a ",[2,0,[11," as a named export, you must specify a ",[2,0,[11," name. Did you mean `export default ",[2,0,[11," ...`?",0]]]]]]],"an identifier. When exporting a %s as a named export, you must specify a %s name. Did you mean `export default %s ...`?"],ts0=zm,ns0="Peeking current location when not available",us0=[0,"src/parser/parser_env.ml",365,9],is0="Internal Error: Tried to add_declared_private with outside of class scope.",fs0="Internal Error: `exit_class` called before a matching `enter_class`",cs0=H0,ss0=[0,0,0],as0=[0,0,0],os0="Parser_env.Try.Rollback",vs0=H0,ls0=H0,ps0=[0,z1,Qi,qi,MD,IR,Y7,V1,Sf,l7,Zf,cc,_f,Ci,Eu,Ti,su,C7,p7,Uu,Pf,q7,Wu,Wi,F7,Wn,Bf,vu,nu,Jn,Vf,os,$f,uf,vf,cs,Ec,hc,K7,Ye,Zn,Li,u7,Fc,Pi,Jf,Mc,Ke,Ic,Cu,Z7,o7,Jc,Vu,uu,g7,Ue,Qu,h7,df,i7,pf,m7,zc,Me,Ef,hi,Xu,j7,iu,Xi,$i,E7,Mf,eu,gc,Ui,v7,Fn,yf,Au,L7,oi,Dc,ki,hu,Te,qc,$n,Xf,qu,is,zn,Hn,f7,Df,pc,Kn,Qn,Ni,qf,rf,Iu,Vi,Ln,Oc,Fu,Gu,gi,Lu,Bu,Hu,x7,mi,Rc,Ii,es,Nf,Nc,ju,Pu,li,lu,Xn,wf,xs,tf,X7,Fi,Kf,ef,hf,Q7,au,w7,Qc,ic,pu,wu,ru,Wc,xi,ie,d7,Yn,Tc,Zu,xf,fu,G7,af,Of,Zc,sc,dc,M7,tc,Nu,jf,t7,I7,J7,If,T7,rs,$u,Ei,_i,yc,Bn,Du,Yu,V7,Hi,ce,Hf,Yc,Gf,bu,gf,Gc,Mi,Mn,K1,bi,D7,Kc,St,yi,bc,us,$7,e7,ri,Su,ii,Bi,_7,xc,nc,Ju,xu,cf,zf,ss,yu,ff,Gn,Vc,di,ui,Ri,ns,sf,c7,y7,Tf,ni,S7,kc,Bc,a7,n1,Rn,wc,nf,as,b7,qn,ji,vc,Cf,Sc,mc,fs,A7,Cc,Af,uc,ac,ku,Tu,P7,Ee,Ki,Ru,Dn,ec,lc,si,Ac,ai,Zi,ou,Oi,tu,Uf,Xc,Xe,Le,Yi,Gi,zu,jc,Uc,B7,cu,Lf,oc,ts,Un,fc,Ai,Ff,W7,Ji,_D,U7,bO,YF,of,wi,k7,Wf,Rf,O7,Ku,pi,fi,Mu,bf,Ou,du,kf,n7,ei,s7,Di,ci,vs,ze,H7,Pc,an,R7,N7,ti,$c,r7,mu,gu,vi,_c,zi,Qf,rn,lf],ks0=[0,z1,Qi,qi,Y7,V1,Sf,l7,Zf,cc,_f,Ci,Eu,Ti,su,C7,p7,Uu,Pf,q7,Wu,Wi,F7,Wn,Bf,vu,nu,Jn,Vf,os,$f,uf,vf,cs,Ec,hc,K7,Ye,Zn,Li,u7,Fc,Pi,Jf,Mc,Ke,Ic,Cu,Z7,o7,Jc,Vu,uu,g7,Ue,Qu,h7,df,i7,pf,m7,zc,Me,Ef,hi,Xu,j7,iu,Xi,$i,E7,Mf,eu,gc,Ui,v7,Fn,yf,Au,L7,oi,Dc,ki,hu,Te,qc,$n,Xf,qu,is,zn,Hn,f7,Df,pc,Kn,Qn,Ni,qf,rf,Iu,Vi,Ln,Oc,Fu,Gu,gi,Lu,Bu,Hu,x7,mi,Rc,Ii,es,Nf,Nc,ju,Pu,li,lu,Xn,wf,xs,tf,X7,Fi,Kf,ef,hf,Q7,au,w7,Qc,ic,pu,wu,ru,Wc,xi,ie,d7,Yn,Tc,Zu,xf,fu,G7,af,Of,Zc,sc,dc,M7,tc,Nu,jf,t7,I7,J7,If,T7,rs,$u,Ei,_i,yc,Bn,Du,Yu,V7,Hi,ce,Hf,Yc,Gf,bu,gf,Gc,Mi,Mn,K1,bi,D7,Kc,St,yi,bc,us,$7,e7,ri,Su,ii,Bi,_7,xc,nc,Ju,xu,cf,zf,ss,yu,ff,Gn,Vc,di,ui,Ri,ns,sf,c7,y7,Tf,ni,S7,kc,Bc,a7,n1,Rn,wc,nf,as,b7,qn,ji,vc,Cf,Sc,mc,fs,A7,Cc,Af,uc,ac,ku,Tu,P7,Ee,Ki,Ru,Dn,ec,lc,si,Ac,ai,Zi,ou,Oi,tu,Uf,Xc,Xe,Le,Yi,Gi,zu,jc,Uc,B7,cu,Lf,oc,ts,Un,fc,Ai,Ff,W7,Ji,U7,of,wi,k7,Wf,Rf,O7,Ku,pi,fi,Mu,bf,Ou,du,kf,n7,ei,s7,Di,ci,vs,ze,H7,Pc,an,R7,N7,ti,$c,r7,mu,gu,vi,_c,zi,Qf,rn,lf],ms0=[0,Jc,$u,nc,yi,ii,vs,Hu,Vi,M7,V7,Pc,vu,Hn,Ke,is,wc,X7,ef,bf,cs,Ni,J7,mi,Hf,T7,ac,A7,Qi,Au,$7,hc,ui,v7,xf,lc,Lf,us,uc,es,St,Y7,Tf,Mf,Zi,Di,Ju,s7,t7,vc,Ef,ri,Ri,Mc,Oc,D7,Z7,Xn,bu,ku,Zu,Ii,pi,wi,qc,lf,iu,Fi,Ai,F7,Iu,Xu,Zc,Rf,f7,Me,Qn,Bi,$n,Nf,tc,I7,bc,ie,Gi,Jn,mc,w7,hf,sc,d7,xc,ru,E7,zi,Ac,qn,Pu,i7,hu,Qf,P7,ci,g7,V1,hi,tu,p7,h7,bi,lu,ti,di,K7,yc,Mu,gi,Jf,Ee,c7,nu,z1,Yn,Ec,Oi,Xi,Eu,Dc,Uf,pf,$c,Ci,of,ou,Bu,Zf,au,If,gu,$f,Yu,Cc,kc,zn,nf,Tc,oi,ni,Pf,os,Ff,Sf,uf,Vu,Uu,Cu,_f,O7,Yc,ns,k7,xi,_7,W7,cc,U7,wf,Lu,G7,oc,r7,li,kf,fi,Un,Qc,L7,af,fc,ju,K1,Ue,C7,q7,Ic,yf,Ye,Xe,x7,Kc,qu,a7,rs,Te,H7,ss,Af,Gf,Wf,Rn,xu,Ei,Su,su,fs,zc,Gn,Mi,Kf,Sc,b7,Uc,Gu,uu,Ln,gf,pc,gc,Vf,rf,j7,Kn,Wu,si,Q7,n7,ai,R7,Bn,Pi,Tu,vf,e7,m7,Mn,qf,du,Fu,jf,Ku,wu,Hi,Ki,Bf,rn,l7,Ru,ei,Wn,Dn,Nu,_i,zu,fu,Ui,Rc,Du,S7,pu,Of,Wi,u7,mu,tf,B7,Fn,vi,N7,n1,ki,Ji,Bc,xs,yu,ff,o7,Le,cf,ts,$i,ji,ec,Li,Fc,ic,Vc,as,Ti,sf,Wc,Xf,an,Gc,Ou,dc,Df,zf,Xc,Qu,Cf,ze,_c,ce,Yi,qi,cu,df,y7,jc,eu,Zn,Nc],hs0=[0,Jc,$u,nc,yi,ii,vs,Hu,Vi,M7,V7,Pc,vu,Hn,Ke,is,wc,X7,ef,bf,cs,Ni,J7,mi,Hf,T7,ac,A7,Qi,Au,$7,hc,ui,v7,xf,lc,Lf,us,uc,es,St,Y7,IR,Tf,Mf,Zi,Di,Ju,s7,t7,vc,Ef,ri,Ri,Mc,Oc,D7,Z7,Xn,bu,ku,Zu,Ii,pi,wi,qc,lf,iu,Fi,Ai,bO,F7,Iu,Xu,Zc,Rf,f7,Me,Qn,Bi,$n,Nf,tc,I7,bc,ie,Gi,Jn,mc,w7,hf,sc,d7,xc,ru,E7,zi,Ac,qn,Pu,i7,hu,Qf,P7,ci,g7,V1,hi,tu,p7,h7,bi,lu,ti,di,K7,yc,Mu,gi,Jf,Ee,c7,nu,z1,Yn,Ec,Oi,Xi,Eu,Dc,Uf,pf,$c,Ci,of,ou,Bu,Zf,au,If,gu,$f,Yu,Cc,kc,zn,nf,Tc,oi,ni,Pf,os,Ff,Sf,uf,Vu,Uu,Cu,_f,O7,Yc,ns,k7,xi,_7,W7,cc,U7,wf,Lu,G7,oc,r7,li,kf,fi,Un,Qc,L7,af,fc,ju,K1,Ue,C7,q7,Ic,yf,Ye,Xe,x7,Kc,qu,a7,rs,Te,H7,ss,Af,Gf,Wf,Rn,xu,Ei,Su,su,fs,zc,Gn,Mi,Kf,Sc,b7,Uc,Gu,uu,Ln,gf,pc,gc,Vf,rf,j7,Kn,Wu,si,Q7,n7,ai,R7,Bn,YF,Pi,Tu,vf,e7,m7,Mn,qf,du,Fu,jf,Ku,wu,Hi,Ki,Bf,_D,rn,l7,Ru,ei,Wn,MD,Dn,Nu,_i,zu,fu,Ui,Rc,Du,S7,pu,Of,Wi,u7,mu,tf,B7,Fn,vi,N7,n1,ki,Ji,Bc,xs,yu,ff,o7,Le,cf,ts,$i,ji,ec,Li,Fc,ic,Vc,as,Ti,sf,Wc,Xf,an,Gc,Ou,dc,Df,zf,Xc,Qu,Cf,ze,_c,ce,Yi,qi,cu,df,y7,jc,eu,Zn,Nc],ds0=y3,ys0=_8,gs0=Ra,ws0=Ql,_s0=Ue,bs0=Ke,Ts0=vI,Es0=xv,Ss0=Ye,As0=b8,Ps0=Wl,Is0=B4,Ns0=e8,Cs0=Ja,js0=j3,Os0=cv,Ds0=Xs,Fs0=$s,Rs0=ze,Ls0=dp,Ms0=xm,qs0=Le,Bs0=$o,Us0=Mp,Xs0=i8,Ys0=o8,zs0=Yl,Ks0=rc,Js0=Re,Gs0=zp,Ws0=nv,Vs0=Vl,$s0=Ws,Qs0=Ys,Hs0=r6,Zs0=Rm,xa0=K1,ra0=C3,ea0=vv,ta0=ce,na0=Yp,ua0=g6,ia0=Ul,fa0=h6,ca0=z1,sa0=Xe,aa0=_6,oa0=Yf,va0=cb,la0=sS,pa0=Ya,ka0=fv,ma0=bp,ha0=Fp,da0=Ee,ya0=k3,ga0=lv,wa0=p3,_a0=Ys,ba0=m6,Ta0=Cp,Ea0=Lp,Sa0=sk,Aa0=tm,Pa0=ev,Ia0=p6,Na0=E3,Ca0=d3,ja0=x6,Oa0=y8,Da0=[0,zm],Fa0=H0,Ra0=[18,1],La0=[18,0],Ma0=[0,0],qa0=Ks,Ba0=[0,0],Ua0=[0,"a type"],Xa0=[0,0],Ya0=[0,"a number literal type"],za0=[0,0],Ka0=p6,Ja0=E3,Ga0=d3,Wa0="You should only call render_type after making sure the next token is a renders variant",Va0=[0,[0,0,0,0,0]],$a0=[0,0,0,0],Qa0=[0,1],Ha0=[0,N3,1451,6],Za0=[0,N3,1454,6],xo0=[0,N3,1557,8],ro0=[0,1],eo0=[0,N3,1574,8],to0="Can not have both `static` and `proto`",no0=Re,uo0=dg,io0=[0,0],fo0=[0,"the end of a tuple type (no trailing comma is allowed in inexact tuple type)."],co0=[0,N3,qo,15],so0=[0,N3,TP,15],ao0=Be,oo0=Be,vo0=ck,lo0=o6,po0=[0,[11,"Failure while looking up ",[2,0,[11,". Index: ",[4,0,0,0,[11,". Length: ",[4,0,0,0,[12,46,0]]]]]]],"Failure while looking up %s. Index: %d. Length: %d."],ko0=[0,0,0,0],mo0="Offset_utils.Offset_lookup_failed",ho0=w2,do0=EO,yo0=o6,go0=ck,wo0=DO,_o0=o6,bo0=ck,To0=bD,Eo0=ox,So0="normal",Ao0=Yf,Po0="jsxTag",Io0="jsxChild",No0="template",Co0=mO,jo0="context",Oo0=Yf,Do0=[6,0],Fo0=[0,0],Ro0=[0,1],Lo0=[0,4],Mo0=[0,2],qo0=[0,3],Bo0=[0,0],Uo0=Be,Xo0=[0,0,0,0,0,0],Yo0=[0,1],zo0=[0,0],Ko0=Ks,Jo0=[0,71],Go0=[0,82],Wo0=lR,Vo0=yT,$o0="exports",Qo0=k6,Ho0=[0,H0,H0,0],Zo0=[0,qO],xv0=[0,82],rv0=[0,"a declaration, statement or export specifiers"],ev0=[0,1],tv0=[0,Yy,1841,21],nv0=[0,"the keyword `as`"],uv0=[0,30],iv0=[0,30],fv0=[0,0],cv0=[0,1],sv0=[0,qO],av0=[0,"the keyword `from`"],ov0=[0,H0,H0,0],vv0=[0,LR],lv0="Label",pv0=[0,LR],kv0=[0,0,0],mv0=[0,39],hv0=[0,Yy,372,22],dv0=[0,38],yv0=[0,Yy,391,22],gv0=[0,0],wv0="the token `;`",_v0=[0,0],bv0=[0,0],Tv0=zD,Ev0=[0,zm],Sv0=zD,Av0=[26,St],Pv0=Ks,Iv0=[0,71],Nv0=[0,H0,0],Cv0=It,jv0=[0,H0,0],Ov0=[0,71],Dv0=[0,71],Fv0=y3,Rv0=[0,H0,0],Lv0=[0,0,0],Mv0=[0,0,0],qv0=[0,[0,8]],Bv0=[0,[0,7]],Uv0=[0,[0,6]],Xv0=[0,[0,10]],Yv0=[0,[0,9]],zv0=[0,[0,11]],Kv0=[0,[0,5]],Jv0=[0,[0,4]],Gv0=[0,[0,2]],Wv0=[0,[0,3]],Vv0=[0,[0,1]],$v0=[0,[0,0]],Qv0=[0,[0,12]],Hv0=[0,[0,13]],Zv0=[0,[0,14]],x30=[0,0],r30=[0,1],e30=[0,0],t30=[0,2],n30=[0,3],u30=[0,7],i30=[0,6],f30=[0,4],c30=[0,5],s30=[0,1],a30=[0,0],o30=[0,1],v30=[0,0],l30=C3,p30=[0,"either a call or access of `super`"],k30=C3,m30=K1,h30=Gl,d30=Gl,y30=nv,g30=[0,"the identifier `target`"],w30=[0,0],_30=[0,1],b30=[0,1],T30=[0,1],E30=[0,1],S30=[0,1],A30=[0,71],P30=Hl,I30=tL,N30=q_,C30=q_,j30=TO,O30=[0,0],D30=[0,1],F30=[0,0],R30=fe,L30=fe,M30=[0,"a regular expression"],q30=H0,B30=H0,U30=H0,X30=[0,79],Y30=[0,"src/parser/expression_parser.ml",1445,17],z30=[0,"a template literal part"],K30=[0,[0,H0,H0],1],J30=Xo,G30=[0,6],W30=[0,[0,17,[0,2]]],V30=[0,[0,18,[0,3]]],$30=[0,[0,19,[0,4]]],Q30=[0,[0,0,[0,5]]],H30=[0,[0,1,[0,5]]],Z30=[0,[0,2,[0,5]]],xl0=[0,[0,3,[0,5]]],rl0=[0,[0,5,[0,6]]],el0=[0,[0,7,[0,6]]],tl0=[0,[0,4,[0,6]]],nl0=[0,[0,6,[0,6]]],ul0=[0,[0,8,[0,7]]],il0=[0,[0,9,[0,7]]],fl0=[0,[0,10,[0,7]]],cl0=[0,[0,11,[0,8]]],sl0=[0,[0,12,[0,8]]],al0=[0,[0,15,[0,9]]],ol0=[0,[0,13,[0,9]]],vl0=[0,[0,14,[1,10]]],ll0=[0,[0,16,[0,9]]],pl0=[0,[0,21,[0,6]]],kl0=[0,[0,20,[0,6]]],ml0=[22,Hg],hl0=[13,"JSX fragment"],dl0=Uo,yl0=on,gl0=[0,un],wl0=[1,un],_l0=[0,H0,H0,0],bl0=[0,zm],Tl0=H0,El0=[0,"a number or string literal"],Sl0=[0,H0,'""',0],Al0=[0,0],Pl0=[0,"a number literal"],Il0=[0,[0,0,W1,0]],Nl0=[0,82],Cl0=[20,_R],jl0=[20,t6],Ol0=Yl,Dl0=[0,H0,0],Fl0="unexpected PrivateName in Property, expected a PrivateField",Rl0=[0,0,0],Ll0=Xa,Ml0="Must be one of the above",ql0=[0,1],Bl0=[0,1],Ul0=[0,1],Xl0=Xa,Yl0=Xa,zl0=P9,Kl0="Internal Error: private name found in object props",Jl0=[0,0,0,0],Gl0=[0,hF],Wl0=[19,[0,0]],Vl0=[0,hF],$l0=bw,Ql0="Nooo: ",Hl0=$o,Zl0="Parser error: No such thing as an expression pattern!",x60=[0,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],r60=[0,"src/parser/parser_flow.ml",iA,28],e60=[0,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],t60=EO,n60=ox,u60=aD,i60=lD,f60=lD,c60=aD,s60=Yf,a60=wO,o60=A2,v60=w2,l60="InterpreterDirective",p60="interpreter",k60="Program",m60=$l,h60="BreakStatement",d60=$l,y60="ContinueStatement",g60="DebuggerStatement",w60=sv,_60="DeclareExportAllDeclaration",b60=sv,T60=A9,E60=GT,S60=$o,A60="DeclareExportDeclaration",P60=A2,I60=Gr,N60="DeclareModule",C60=u1,j60="DeclareModuleExports",O60=A2,D60=Gr,F60="DeclareNamespace",R60=w3,L60=A2,M60="DoWhileStatement",q60="EmptyStatement",B60=SE,U60=GT,X60="ExportDefaultDeclaration",Y60=SE,z60=TS,K60=sv,J60="ExportAllDeclaration",G60=SE,W60=sv,V60=A9,$60=GT,Q60="ExportNamedDeclaration",H60="directive",Z60=n1,x40="ExpressionStatement",r40=A2,e40="update",t40=w3,n40=Hc,u40="ForStatement",i40="each",f40=A2,c40=tn,s40=Js,a40="ForInStatement",o40=fv,v40=A2,l40=tn,p40=Js,k40="ForOfStatement",m40=TD,h40=mP,d40=w3,y40="IfStatement",g40=Yf,w40=Ws,_40=w2,b40=ZO,T40=sv,E40=A9,S40="ImportDeclaration",A40=A2,P40=$l,I40="LabeledStatement",N40=f9,C40=g1,j40="MatchStatement",O40=g1,D40="ReturnStatement",F40=f9,R40="discriminant",L40="SwitchStatement",M40=g1,q40="ThrowStatement",B40="finalizer",U40="handler",X40=an,Y40="TryStatement",z40=A2,K40=w3,J40="WhileStatement",G40=A2,W40=Q4,V40="WithStatement",$40=sT,Q40="ArrayExpression",H40=$1,Z40=Bm,xp0=n1,rp0=Me,ep0=Xd,tp0=Ya,np0=A2,up0=sn,ip0=Gr,fp0="ArrowFunctionExpression",cp0=n1,sp0="AsConstExpression",ap0=u1,op0=n1,vp0="AsExpression",lp0=P9,pp0=tn,kp0=Js,mp0=tv,hp0="AssignmentExpression",dp0=tn,yp0=Js,gp0=tv,wp0="BinaryExpression",_p0="CallExpression",bp0=TD,Tp0=mP,Ep0=w3,Sp0="ConditionalExpression",Ap0=sv,Pp0="ImportExpression",Ip0=XF,Np0=FR,Cp0=Hg,jp0=tn,Op0=Js,Dp0=tv,Fp0="LogicalExpression",Rp0=f9,Lp0=g1,Mp0="MatchExpression",qp0="MemberExpression",Bp0=Y8,Up0=Gl,Xp0="MetaProperty",Yp0=kb,zp0=Dk,Kp0=hD,Jp0="NewExpression",Gp0=Sk,Wp0="ObjectExpression",Vp0=it,$p0="OptionalCallExpression",Qp0=it,Hp0="OptionalMemberExpression",Zp0=nR,xk0="SequenceExpression",rk0="Super",ek0="ThisExpression",tk0=u1,nk0=n1,uk0="TypeCastExpression",ik0=u1,fk0=n1,ck0="SatisfiesExpression",sk0=g1,ak0="AwaitExpression",ok0=Be,vk0=z7,lk0=MO,pk0=$L,kk0=Ws,mk0=Ys,hk0=Vl,dk0="matched above",yk0=g1,gk0=QD,wk0=tv,_k0="UnaryExpression",bk0=SD,Tk0=ZR,Ek0=QD,Sk0=g1,Ak0=tv,Pk0="UpdateExpression",Ik0="delegate",Nk0=g1,Ck0="YieldExpression",jk0=AO,Ok0=A2,Dk0=Te,Fk0="MatchExpressionCase",Rk0=AO,Lk0=A2,Mk0=Te,qk0="MatchStatementCase",Bk0=uk,Uk0=Te,Xk0=Ba,Yk0="MatchObjectPatternProperty",zk0=Y8,Kk0="base",Jk0="MatchMemberPattern",Gk0="literal",Wk0="MatchLiteralPattern",Vk0="MatchWildcardPattern",$k0=Be,Qk0=z7,Hk0=g1,Zk0=tv,x80="MatchUnaryPattern",r80=Bl,e80=Sk,t80="MatchObjectPattern",n80=Bl,u80=sT,i80="MatchArrayPattern",f80="patterns",c80="MatchOrPattern",s80=Jm,a80=Te,o80="MatchAsPattern",v80=Gr,l80="MatchIdentifierPattern",p80=zs,k80=Gr,m80="MatchBindingPattern",h80=g1,d80="MatchRestPattern",y80="Unexpected FunctionDeclaration with BodyExpression",g80="HookDeclaration",w80=n1,_80=Me,b80=Xd,T80=Ya,E80="FunctionDeclaration",S80=$1,A80=Bm,P80=A2,I80=sn,N80=Gr,C80="Unexpected FunctionExpression with BodyExpression",j80=$1,O80=Bm,D80=n1,F80=Me,R80=Xd,L80=Ya,M80=A2,q80=sn,B80=Gr,U80="FunctionExpression",X80=it,Y80=u1,z80=qe,K80=nS,J80=it,G80=u1,W80=qe,V80="PrivateIdentifier",$80=it,Q80=u1,H80=qe,Z80=nS,xm0=mP,rm0=w3,em0="SwitchCase",tm0=A2,nm0="param",um0="CatchClause",im0=A2,fm0="BlockStatement",cm0=zs,sm0=Gr,am0="DeclareVariable",om0="DeclareHook",vm0=Me,lm0="DeclareFunction",pm0=Gr,km0=mR,mm0=vv,hm0=rc,dm0=A2,ym0=$1,gm0=Gr,wm0="DeclareClass",_m0=$1,bm0=_9,Tm0=sn,Em0=Bl,Sm0=sn,Am0=Gr,Pm0="DeclareComponent",Im0=$1,Nm0=_9,Cm0=Bl,jm0=sn,Om0="ComponentTypeAnnotation",Dm0=it,Fm0=u1,Rm0=qe,Lm0="ComponentTypeParameter",Mm0=A2,qm0=Gr,Bm0="DeclareEnum",Um0=rc,Xm0=A2,Ym0=$1,zm0=Gr,Km0="DeclareInterface",Jm0=w2,Gm0=Yf,Wm0=TS,Vm0="ExportNamespaceSpecifier",$m0=tn,Qm0=$1,Hm0=Gr,Zm0="DeclareTypeAlias",x50=tn,r50=$1,e50=Gr,t50="TypeAlias",n50="DeclareOpaqueType",u50="OpaqueType",i50="supertype",f50="impltype",c50=$1,s50=Gr,a50="ClassDeclaration",o50="ClassExpression",v50=qk,l50=vv,p50="superTypeParameters",k50="superClass",m50=$1,h50=A2,d50=Gr,y50=n1,g50="Decorator",w50=$1,_50=Gr,b50="ClassImplements",T50=A2,E50="ClassBody",S50=Mo,A50=d6,P50=zo,I50=S3,N50=qk,C50=m3,j50=Re,O50=zs,D50=w2,F50=Ba,R50="MethodDefinition",L50=_6,M50=qk,q50=V1,B50=Re,U50=m3,X50=u1,Y50=w2,z50=Ba,K50=CL,J50="Internal Error: Private name found in class prop",G50=_6,W50=qk,V50=V1,$50=Re,Q50=m3,H50=u1,Z50=w2,xh0=Ba,rh0=CL,eh0=$1,th0=_9,nh0=sn,uh0=Gr,ih0=A2,fh0="ComponentDeclaration",ch0=g1,sh0=QT,ah0=tn,oh0=Js,vh0=H8,lh0=uk,ph0=a6,kh0=qe,mh0="ComponentParameter",hh0=Hc,dh0=Gr,yh0="EnumBigIntMember",gh0=Gr,wh0=JD,_h0=Hc,bh0=Gr,Th0="EnumStringMember",Eh0=Gr,Sh0=JD,Ah0=Hc,Ph0=Gr,Ih0="EnumNumberMember",Nh0=Hc,Ch0=Gr,jh0="EnumBooleanMember",Oh0=c6,Dh0=J8,Fh0=Kl,Rh0="EnumBooleanBody",Lh0=c6,Mh0=J8,qh0=Kl,Bh0="EnumNumberBody",Uh0=c6,Xh0=J8,Yh0=Kl,zh0="EnumStringBody",Kh0=c6,Jh0=Kl,Gh0="EnumSymbolBody",Wh0=c6,Vh0=J8,$h0=Kl,Qh0="EnumBigIntBody",Hh0=A2,Zh0=Gr,xd0="EnumDeclaration",rd0=rc,ed0=A2,td0=$1,nd0=Gr,ud0="InterfaceDeclaration",id0=$1,fd0=Gr,cd0="InterfaceExtends",sd0=u1,ad0=Sk,od0="ObjectPattern",vd0=u1,ld0=sT,pd0="ArrayPattern",kd0=tn,md0=Js,hd0=H8,dd0=u1,yd0=qe,gd0=nS,wd0=g1,_d0=QT,bd0=g1,Td0=QT,Ed0=tn,Sd0=Js,Ad0=H8,Pd0=Hc,Id0=Hc,Nd0=zo,Cd0=S3,jd0=sD,Od0=m3,Dd0=uk,Fd0=d6,Rd0=zs,Ld0=w2,Md0=Ba,qd0=EF,Bd0=g1,Ud0=mD,Xd0=tn,Yd0=Js,zd0=H8,Kd0=m3,Jd0=uk,Gd0=d6,Wd0=zs,Vd0=w2,$d0=Ba,Qd0=EF,Hd0=g1,Zd0=mD,xy0=At,ry0=w2,ey0=l3,ty0=H0,ny0=At,uy0=lv,iy0=w2,fy0=l3,cy0=At,sy0=w2,ay0=l3,oy0=$s,vy0=Xs,ly0=At,py0=w2,ky0=l3,my0="flags",hy0=Te,dy0="regex",yy0=At,gy0=w2,wy0=l3,_y0=At,by0=w2,Ty0=l3,Ey0=nR,Sy0="quasis",Ay0="TemplateLiteral",Py0="cooked",Iy0=At,Ny0="tail",Cy0=w2,jy0="TemplateElement",Oy0="quasi",Dy0="tag",Fy0="TaggedTemplateExpression",Ry0=zs,Ly0="declarations",My0="VariableDeclaration",qy0=Hc,By0=Gr,Uy0="VariableDeclarator",Xy0="plus",Yy0=iR,zy0=ev,Ky0=Ra,Jy0=_w,Gy0="in-out",Wy0=zs,Vy0="Variance",$y0="AnyTypeAnnotation",Qy0="MixedTypeAnnotation",Hy0="EmptyTypeAnnotation",Zy0="VoidTypeAnnotation",x90="NullLiteralTypeAnnotation",r90="SymbolTypeAnnotation",e90="NumberTypeAnnotation",t90="BigIntTypeAnnotation",n90="StringTypeAnnotation",u90="BooleanTypeAnnotation",i90=u1,f90="NullableTypeAnnotation",c90="UnknownTypeAnnotation",s90="NeverTypeAnnotation",a90="UndefinedTypeAnnotation",o90=zs,v90=u1,l90="parameterName",p90="TypePredicate",k90="HookTypeAnnotation",m90="FunctionTypeAnnotation",h90=xv,d90=$1,y90=Bl,g90=Bm,w90=sn,_90=it,b90=u1,T90=qe,E90=aR,S90=it,A90=u1,P90=qe,I90=aR,N90=[0,0,0,0,0],C90="internalSlots",j90="callProperties",O90="indexers",D90=Sk,F90="exact",R90=rL,L90="ObjectTypeAnnotation",M90=sD,q90="There should not be computed object type property keys",B90=Hc,U90=zo,X90=S3,Y90=zs,z90=V1,K90=dg,J90=Re,G90=it,W90=d6,V90=w2,$90=Ba,Q90="ObjectTypeProperty",H90=g1,Z90="ObjectTypeSpreadProperty",xg0=V1,rg0=Re,eg0=w2,tg0=Ba,ng0=Gr,ug0="ObjectTypeIndexer",ig0=Re,fg0=w2,cg0="ObjectTypeCallProperty",sg0=it,ag0=V1,og0="sourceType",vg0="propType",lg0="keyTparam",pg0="ObjectTypeMappedTypeProperty",kg0=w2,mg0=d6,hg0=Re,dg0=it,yg0=Gr,gg0="ObjectTypeInternalSlot",wg0=A2,_g0=rc,bg0="InterfaceTypeAnnotation",Tg0=HR,Eg0="ArrayTypeAnnotation",Sg0="falseType",Ag0="trueType",Pg0="extendsType",Ig0="checkType",Ng0="ConditionalTypeAnnotation",Cg0="typeParameter",jg0="InferTypeAnnotation",Og0=Gr,Dg0=zF,Fg0="QualifiedTypeIdentifier",Rg0=$1,Lg0=Gr,Mg0="GenericTypeAnnotation",qg0="indexType",Bg0="objectType",Ug0="IndexedAccessType",Xg0=it,Yg0="OptionalIndexedAccessType",zg0=F9,Kg0="UnionTypeAnnotation",Jg0=F9,Gg0="IntersectionTypeAnnotation",Wg0=Dk,Vg0=g1,$g0="TypeofTypeAnnotation",Qg0=Gr,Hg0=zF,Zg0="QualifiedTypeofIdentifier",xw0=g1,rw0="KeyofTypeAnnotation",ew0=T3,tw0=BF,nw0=pF,uw0=u1,iw0=tv,fw0="TypeOperator",cw0=ev,sw0=rL,aw0="elementTypes",ow0="TupleTypeAnnotation",vw0=it,lw0=V1,pw0=HR,kw0=$l,mw0="TupleTypeLabeledElement",hw0=u1,dw0=$l,yw0="TupleTypeSpreadElement",gw0=At,ww0=w2,_w0="StringLiteralTypeAnnotation",bw0=At,Tw0=w2,Ew0="NumberLiteralTypeAnnotation",Sw0=At,Aw0=w2,Pw0="BigIntLiteralTypeAnnotation",Iw0=$s,Nw0=Xs,Cw0=At,jw0=w2,Ow0="BooleanLiteralTypeAnnotation",Dw0="ExistsTypeAnnotation",Fw0=u1,Rw0=_F,Lw0=u1,Mw0=_F,qw0=sn,Bw0="TypeParameterDeclaration",Uw0="usesExtendsBound",Xw0=$o,Yw0=V1,zw0=Ja,Kw0="bound",Jw0=qe,Gw0="TypeParameter",Ww0=sn,Vw0=gR,$w0=sn,Qw0=gR,Hw0=Xo,Zw0=NL,x_0="closingElement",r_0="openingElement",e_0="JSXElement",t_0="closingFragment",n_0=NL,u_0="openingFragment",i_0="JSXFragment",f_0=Dk,c_0="selfClosing",s_0="attributes",a_0=qe,o_0="JSXOpeningElement",v_0="JSXOpeningFragment",l_0=qe,p_0="JSXClosingElement",k_0="JSXClosingFragment",m_0=w2,h_0=qe,d_0="JSXAttribute",y_0=g1,g_0="JSXSpreadAttribute",w_0="JSXEmptyExpression",__0=n1,b_0="JSXExpressionContainer",T_0=n1,E_0="JSXSpreadChild",S_0=At,A_0=w2,P_0="JSXText",I_0=Y8,N_0=Q4,C_0="JSXMemberExpression",j_0=qe,O_0=yT,D_0="JSXNamespacedName",F_0=qe,R_0="JSXIdentifier",L_0=TS,M_0=a6,q_0="ExportSpecifier",B_0=a6,U_0="ImportDefaultSpecifier",X_0=a6,Y_0="ImportNamespaceSpecifier",z_0=ZO,K_0=a6,J_0="imported",G_0="ImportSpecifier",W_0="Line",V_0="Block",$_0=w2,Q_0=w2,H_0="DeclaredPredicate",Z_0="InferredPredicate",xb0=kb,rb0=Dk,eb0=hD,tb0=m3,nb0=Y8,ub0=Q4,ib0="message",fb0=ox,cb0=DO,sb0=bD,ab0=sv,ob0=o6,vb0=ck,lb0=[0,z1,Qi,qi,Y7,V1,Sf,l7,Zf,cc,_f,Ci,Eu,Ti,su,C7,p7,Uu,Pf,q7,Wu,Wi,F7,Wn,Bf,vu,nu,Jn,Vf,os,$f,uf,vf,cs,Ec,hc,K7,Ye,Zn,Li,u7,Fc,Pi,Jf,Mc,Ke,Ic,Cu,Z7,o7,Jc,Vu,uu,g7,Ue,Qu,h7,df,i7,pf,m7,zc,Me,Ef,hi,Xu,j7,iu,Xi,$i,E7,Mf,eu,gc,Ui,v7,Fn,yf,Au,L7,oi,Dc,ki,hu,Te,qc,$n,Xf,qu,is,zn,Hn,f7,Df,pc,Kn,Qn,Ni,qf,rf,Iu,Vi,Ln,Oc,Fu,Gu,gi,Lu,Bu,Hu,x7,mi,Rc,Ii,es,Nf,Nc,ju,Pu,li,lu,Xn,wf,xs,tf,X7,Fi,Kf,ef,hf,Q7,au,w7,Qc,ic,pu,wu,ru,Wc,xi,ie,d7,Yn,Tc,Zu,xf,fu,G7,af,Of,Zc,sc,dc,M7,tc,Nu,jf,t7,I7,J7,If,T7,rs,$u,Ei,_i,yc,Bn,Du,Yu,V7,Hi,ce,Hf,Yc,Gf,bu,gf,Gc,Mi,Mn,K1,bi,D7,Kc,St,yi,bc,us,$7,e7,ri,Su,ii,Bi,_7,xc,nc,Ju,xu,cf,zf,ss,yu,ff,Gn,Vc,di,ui,Ri,ns,sf,c7,y7,Tf,ni,S7,kc,Bc,a7,n1,Rn,wc,nf,as,b7,qn,ji,vc,Cf,Sc,mc,fs,A7,Cc,Af,uc,ac,ku,Tu,P7,Ee,Ki,Ru,Dn,ec,lc,si,Ac,ai,Zi,ou,Oi,tu,Uf,Xc,Xe,Le,Yi,Gi,zu,jc,Uc,B7,cu,Lf,oc,ts,Un,fc,Ai,Ff,W7,Ji,U7,of,wi,k7,Wf,Rf,O7,Ku,pi,fi,Mu,bf,Ou,du,kf,n7,ei,s7,Di,ci,vs,ze,H7,Pc,an,R7,N7,ti,$c,r7,mu,gu,vi,_c,zi,Qf,rn,lf],pb0=[0,Jc,$u,nc,yi,ii,vs,Hu,Vi,M7,V7,Pc,vu,Hn,Ke,is,wc,X7,ef,bf,cs,Ni,J7,mi,Hf,T7,ac,A7,Qi,Au,$7,hc,ui,v7,xf,lc,Lf,us,uc,es,St,Y7,Tf,Mf,Zi,Di,Ju,s7,t7,vc,Ef,ri,Ri,Mc,Oc,D7,Z7,Xn,bu,ku,Zu,Ii,pi,wi,qc,lf,iu,Fi,Ai,F7,Iu,Xu,Zc,Rf,f7,Me,Qn,Bi,$n,Nf,tc,I7,bc,ie,Gi,Jn,mc,w7,hf,sc,d7,xc,ru,E7,zi,Ac,qn,Pu,i7,hu,Qf,P7,ci,g7,V1,hi,tu,p7,h7,bi,lu,ti,di,K7,yc,Mu,gi,Jf,Ee,c7,nu,z1,Yn,Ec,Oi,Xi,Eu,Dc,Uf,pf,$c,Ci,of,ou,Bu,Zf,au,If,gu,$f,Yu,Cc,kc,zn,nf,Tc,oi,ni,Pf,os,Ff,Sf,uf,Vu,Uu,Cu,_f,O7,Yc,ns,k7,xi,_7,W7,cc,U7,wf,Lu,G7,oc,r7,li,kf,fi,Un,Qc,L7,af,fc,ju,K1,Ue,C7,q7,Ic,yf,Ye,Xe,x7,Kc,qu,a7,rs,Te,H7,ss,Af,Gf,Wf,Rn,xu,Ei,Su,su,fs,zc,Gn,Mi,Kf,Sc,b7,Uc,Gu,uu,Ln,gf,pc,gc,Vf,rf,j7,Kn,Wu,si,Q7,n7,ai,R7,Bn,Pi,Tu,vf,e7,m7,Mn,qf,du,Fu,jf,Ku,wu,Hi,Ki,Bf,rn,l7,Ru,ei,Wn,Dn,Nu,_i,zu,fu,Ui,Rc,Du,S7,pu,Of,Wi,u7,mu,tf,B7,Fn,vi,N7,n1,ki,Ji,Bc,xs,yu,ff,o7,Le,cf,ts,$i,ji,ec,Li,Fc,ic,Vc,as,Ti,sf,Wc,Xf,an,Gc,Ou,dc,Df,zf,Xc,Qu,Cf,ze,_c,ce,Yi,qi,cu,df,y7,jc,eu,Zn,Nc],kb0=[0,lf,rn,Qf,zi,_c,vi,gu,mu,r7,$c,ti,N7,R7,an,Pc,H7,ze,vs,ci,Di,s7,ei,n7,kf,du,Ou,bf,Mu,fi,pi,Ku,O7,Rf,Wf,k7,wi,of,U7,Ji,W7,Ff,Ai,fc,Un,ts,oc,Lf,cu,B7,Uc,jc,zu,Gi,Yi,Le,Xe,Xc,Uf,tu,Oi,ou,Zi,ai,Ac,si,lc,ec,Dn,Ru,Ki,Ee,P7,Tu,ku,ac,uc,Af,Cc,A7,fs,mc,Sc,Cf,vc,ji,qn,b7,as,nf,wc,Rn,n1,a7,Bc,kc,S7,ni,Tf,y7,c7,sf,ns,Ri,ui,di,Vc,Gn,ff,yu,ss,zf,cf,xu,Ju,nc,xc,_7,Bi,ii,Su,ri,e7,$7,us,bc,yi,St,Kc,D7,bi,K1,Mn,Mi,Gc,gf,bu,Gf,Yc,Hf,ce,Hi,V7,Yu,Du,Bn,yc,_i,Ei,$u,rs,T7,If,J7,I7,t7,jf,Nu,tc,M7,dc,sc,Zc,Of,af,G7,fu,xf,Zu,Tc,Yn,d7,ie,xi,Wc,ru,wu,pu,ic,Qc,w7,au,Q7,hf,ef,Kf,Fi,X7,tf,xs,wf,Xn,lu,li,Pu,ju,Nc,Nf,es,Ii,Rc,mi,x7,Hu,Bu,Lu,gi,Gu,Fu,Oc,Ln,Vi,Iu,rf,qf,Ni,Qn,Kn,pc,Df,f7,Hn,zn,is,qu,Xf,$n,qc,Te,hu,ki,Dc,oi,L7,Au,yf,Fn,v7,Ui,gc,eu,Mf,E7,$i,Xi,iu,j7,Xu,hi,Ef,Me,zc,m7,pf,i7,df,h7,Qu,Ue,g7,uu,Vu,Jc,o7,Z7,Cu,Ic,Ke,Mc,Jf,Pi,Fc,u7,Li,Zn,Ye,K7,hc,Ec,cs,vf,uf,$f,os,Vf,Jn,nu,vu,Bf,Wn,F7,Wi,Wu,q7,Pf,Uu,p7,C7,su,Ti,Eu,Ci,_f,cc,Zf,l7,Sf,V1,Y7,qi,Qi,z1],mb0="Jsoo_runtime.Error.Exn",hb0=[0,0],db0="use_strict",yb0=F9,gb0="esproposal_decorators",wb0="pattern_matching",_b0="enums",bb0="components",Tb0="Internal error: ",Eb0=[i2,"CamlinternalLazy.Undefined",ks(0)];function Sb0(x,r){var e=Cx(r)-1|0,t=0;if(e>=0)for(var u=t;;){x(Y0(r,u));var i=u+1|0;if(e===u)break;var u=i}}var Ab0=ux,Pb0=[0,0];function Ib0(x){var r=DK(0),e=gq(O),t=r.length-1,u=E2((t*8|0)+1|0),i=t-1|0,c=0;if(i>=0)for(var v=c;;){jz(u,v*8|0,S6(P2(r,v)[1+v]));var a=v+1|0;if(i===v)break;var v=a}ra(u,t*8|0,1);var l=yq(u);ra(u,t*8|0,2);var m=yq(u),h=m5(m,8),T=m5(m,0),b=m5(l,8);return wq(e,m5(l,0),b,T,h),e}for(;;){var Vq=M3(VN);let x=[0,1],r=Vq;if(!(1-Gm(VN,Vq,function(e){return Gm(x,1,0)&&(_v(gv(Jq),O),_v(gv(Gq),O)),d(r,0)})))break}if(M3(Pb0))throw K0([0,o5,zV],1);var aa=ZN([0,ux]),bv=ZN([0,ux]),$a=ZN([0,Je]),$q=YN(0,0),Nb0=2,Cb0=[0,0];function Qq(x){return 2=0)for(var c=i;;){var v=(c*2|0)+3|0,a=P2(x,c)[1+c];P2(e,v)[1+v]=a;var l=c+1|0;if(u===c)break;var c=l}return[0,Nb0,e,bv[1],$a[1],0,0,aa[1],0]}function AC(x,r){var e=x[2].length-1;if(e=0)for(var u=t;;){var i=q2(x,u);r[1]=(dk*r[1]|0)+i|0;var c=u+1|0;if(e===u)break;var u=c}r[1]=r[1]&eR;var v=1073741823r)return e;var t=[0,x[1+r],e],r=r-1|0,e=t}}function CC(x,r){try{var e=aa[17].call(null,r,x[7]);return e}catch(i){var t=B2(i);if(t!==ms)throw K0(t,0);var u=x[1];return x[1]=u+1|0,P(r,H0)&&(x[7]=aa[2].call(null,r,u,x[7])),u}}function jC(x){return Y3(x,0)?[0]:x}function OC(x,r,e,t,u,i){var c=u[2],v=u[4],a=NC(r),l=NC(e),m=NC(t),h=dn(function(e0){return J6(x,e0)},l),T=dn(function(e0){return J6(x,e0)},m);x[5]=[0,[0,x[3],x[4],x[6],x[7],h,a],x[5]],x[7]=aa[24].call(null,function(e0,f0,a0){return HN(e0,a)?aa[2].call(null,e0,f0,a0):a0},x[7],aa[1]);var b=[0,bv[1]],N=[0,$a[1]];QM(function(e0,f0){b[1]=bv[2].call(null,e0,f0,b[1]);var a0=N[1];try{var Z=$a[17].call(null,f0,x[4]),v0=Z}catch(y0){var t0=B2(y0);if(t0!==ms)throw K0(t0,0);var v0=1}N[1]=$a[2].call(null,f0,v0,a0)},m,T),QM(function(e0,f0){b[1]=bv[2].call(null,e0,f0,b[1]),N[1]=$a[2].call(null,f0,0,N[1])},l,h),x[3]=b[1],x[4]=N[1],x[6]=QN(function(e0,f0){return HN(e0[1],h)?f0:[0,e0,f0]},x[6],0);var C=i?d(c(x),v):c(x),I=D6(x[5]),F=I[6],M=I[5],Y=I[4],q=I[3],K=I[2],u0=I[1];x[5]=$M(x[5]),x[7]=m1(function(e0,f0){var a0=aa[17].call(null,f0,x[7]);return aa[2].call(null,f0,a0,e0)},Y,F),x[3]=u0,x[4]=K,x[6]=QN(function(e0,f0){return HN(e0[1],M)?f0:[0,e0,f0]},x[6],q);var Q=[0,h5(function(e0){var f0=J6(x,e0);try{for(var a0=x[6];;){if(!a0)throw K0(ms,1);var Z=a0[1],v0=a0[2],t0=Z[2];if(yM(Z[1],f0)===0)return t0;var a0=v0}}catch(n0){var y0=B2(n0);if(y0===ms)return P2(x[2],f0)[1+f0];throw K0(y0,0)}},jC(t)),0];return bz([0,[0,C],[0,h5(function(e0){try{var f0=aa[17].call(null,e0,x[7]);return f0}catch(Z){var a0=B2(Z);throw a0===ms?K0([0,Ir,KV],1):K0(a0,0)}},jC(r)),Q]])}function T5(x,r){if(x===0)var e=Hq([0]);else{var t=Hq(h5(jb0,x)),u=x.length-1-1|0,i=0;if(u>=0)for(var c=i;;){var v=(c*2|0)+2|0;t[3]=bv[2].call(null,x[1+c],v,t[3]),t[4]=$a[2].call(null,v,1,t[4]);var a=c+1|0;if(u===c)break;var c=a}var e=t}var l=r(e);return e[8]=tx(e[8]),AC(e,3+((P2(e[2],1)[2]*16|0)/32|0)|0),[0,d(l,0),r,,0]}function E5(x,r){if(x)return x;var e=YN(i2,r[1]);return e[1]=r[2],PK(e)}function DC(x,r,e){if(x)return r;var t=e[8];if(t!==0)for(var u=t;u;){var i=u[2];d(u[1],r);var u=i}return r}function S5(x){var r=PC(x);x:{if((r%2|0)!==0&&(2+((P2(x[2],1)[2]*16|0)/32|0)|0)>=r){var e=PC(x);break x}var e=r}return P2(x[2],e)[1+e]=0,e}function FC(x,r){for(var e=[0,0],t=r.length-1;;){if(e[1]>=t)return;var u=e[1],i=function(V0){e[1]++;var N0=e[1];return P2(r,N0)[1+N0]},c=P2(r,u)[1+u],v=i(O);if(typeof v=="number")switch(v){case 0:let V0=i(O);var C0=function(sx){return V0};break;case 1:let N0=i(O);var C0=function(sx){return sx[1+N0]};break;case 2:var a=i(O);let rx=a,xx=i(O);var C0=function(sx){return sx[1+rx][1+xx]};break;case 3:let nx=i(O);var C0=function(sx){return d(sx[1][1+nx],sx)};break;case 4:let mx=i(O);var C0=function(sx,Sx){return sx[1+mx]=Sx,0};break;case 5:var l=i(O);let F0=l,px=i(O);var C0=function(sx){return d(F0,px)};break;case 6:var m=i(O);let dx=m,W=i(O);var C0=function(sx){return d(dx,sx[1+W])};break;case 7:var h=i(O),T=i(O);let g0=h,B=T,h0=i(O);var C0=function(sx){return d(g0,sx[1+B][1+h0])};break;case 8:var b=i(O);let _0=b,d0=i(O);var C0=function(sx){return d(_0,d(sx[1][1+d0],sx))};break;case 9:var N=i(O),C=i(O);let E0=N,U=C,Kx=i(O);var C0=function(sx){return p(E0,U,Kx)};break;case 10:var I=i(O),F=i(O);let Ix=I,z0=F,Kr=i(O);var C0=function(sx){return p(Ix,z0,sx[1+Kr])};break;case 11:var M=i(O),Y=i(O),q=i(O);let S=M,G=Y,Z0=q,yx=i(O);var C0=function(sx){return p(S,G,sx[1+Z0][1+yx])};break;case 12:var K=i(O),u0=i(O);let Tx=K,ex=u0,m0=i(O);var C0=function(sx){return p(Tx,ex,d(sx[1][1+m0],sx))};break;case 13:var Q=i(O),e0=i(O);let Dx=Q,Ex=e0,qx=i(O);var C0=function(sx){return p(Dx,sx[1+Ex],qx)};break;case 14:var f0=i(O),a0=i(O),Z=i(O);let O0=f0,Wx=a0,Yx=Z,fx=i(O);var C0=function(sx){return p(O0,sx[1+Wx][1+Yx],fx)};break;case 15:var v0=i(O),t0=i(O);let Qx=v0,vx=t0,nr=i(O);var C0=function(sx){return p(Qx,d(sx[1][1+vx],sx),nr)};break;case 16:var y0=i(O);let gr=y0,Nr=i(O);var C0=function(sx){return p(sx[1][1+gr],sx,Nr)};break;case 17:var n0=i(O);let s2=n0,b2=i(O);var C0=function(sx){return p(sx[1][1+s2],sx,sx[1+b2])};break;case 18:var s0=i(O),l0=i(O);let k2=s0,F2=l0,jx=i(O);var C0=function(sx){return p(sx[1][1+k2],sx,sx[1+F2][1+jx])};break;case 19:var w0=i(O);let _=w0,$=i(O);var C0=function(sx){var Sx=d(sx[1][1+$],sx);return p(sx[1][1+_],sx,Sx)};break;case 20:var L0=i(O),I0=i(O);S5(x);let ix=L0,U0=I0;var C0=function(sx){return d(Xx(U0,ix,0),U0)};break;case 21:var j0=i(O),S0=i(O);S5(x);let cx=j0,wx=S0;var C0=function(sx){var Sx=sx[1+wx];return d(Xx(Sx,cx,0),Sx)};break;case 22:var W0=i(O),A0=i(O),J0=i(O);S5(x);let Or=W0,Hx=A0,x2=J0;var C0=function(sx){var Sx=sx[1+Hx][1+x2];return d(Xx(Sx,Or,0),Sx)};break;default:var b0=i(O),z=i(O);S5(x);let hr=b0,Dr=z;var C0=function(sx){var Sx=d(sx[1][1+Dr],sx);return d(Xx(Sx,hr,0),Sx)}}else var C0=v;Zq(x,c,C0),e[1]++}}function xB(x,r){var e=r.length-1,t=YN(0,e),u=e-1|0,i=0;if(u>=0)for(var c=i;;){var v=P2(r,c)[1+c];if(typeof v=="number")switch(v){case 0:let N=c;var a=function(Y){var q=t[1+N];if(C===q)throw K0([0,C6,x],1);return d(q,Y)};let C=a;var h=a;break;case 1:var l=[];let I=l,F=c;Rr(l,[I3,function(Y){var q=t[1+F];if(I===q)throw K0([0,C6,x],1);var K=hv(q);if(R3===K)return q[1];if(I3!==K&&Go!==K)return q;if(nK(q)!==0)throw K0(Eb0,1);var u0=q[1];q[1]=0;try{var Q=d(u0,0);return q[1]=Q,uK(q),Q}catch(f0){var e0=B2(f0);throw q[1]=function(a0){throw K0(e0,0)},tK(q),K0(e0,0)}}]);var h=l;break;default:var m=function(Y){throw K0([0,C6,x],1)},h=[0,m,m,m,0]}else var h=v[0]===0?xB(x,v[1]):v[1];t[1+c]=h;var T=c+1|0;if(u===c)break;var c=T}return t}function rB(x,r,e){if(hv(e)===0&&x.length-1<=e.length-1){var t=x.length-1-1|0,u=0;if(t>=0)for(var i=u;;){var c=e[1+i],v=P2(x,i)[1+i];x:if(typeof v=="number"){if(v===2){if(hv(c)===0&&c.length-1===4){for(var a=0,l=r[1+i];;){l[1+a]=c[1+a];var m=a+1|0;if(a===3)break;var a=m}break x}throw K0([0,Ir,JV],1)}r[1+i]=c}else v[0]===0&&rB(v[1],r[1+i],c);var h=i+1|0;if(t===i)break;var i=h}return}throw K0([0,Ir,GV],1)}try{var Db0=RM("TMPDIR"),RC=Db0}catch(x){var eB=B2(x);if(eB!==ms)throw K0(eB,0);var RC=WV}var Fb0=[0,,,,,,,,,,RC];try{var Rb0=RM("TEMP"),tB=Rb0}catch(x){var nB=B2(x);if(nB!==ms)throw K0(nB,0);var tB=VV}var Lb0=[0,,,,,,,,,,tB],Mb0=[0,,,,,,,,,,RC],qb0=P(GM,xF)?P(GM,"Win32")?Fb0:Lb0:Mb0,Bb0=qb0[10];hs(0,Ib0),hs([0,function(x){return x}],function(x){return Bb0});function ds(x,r){function e(t){return at(x,t)}return v6<=r?(e(b3|r>>>18|0),e(M2|(r>>>12|0)&63),e(M2|(r>>>6|0)&63),e(M2|r&63)):f_<=r?(e(qo|r>>>12|0),e(M2|(r>>>6|0)&63),e(M2|r&63)):M2<=r?(e(v3|r>>>6|0),e(M2|r&63)):e(r)}var Qa=[i2,HV,ks(0)],uB=0,iB=0,fB=0,cB=0,sB=0,aB=0,oB=0,vB=0,lB=0,pB=0;function y(x){if(x[3]===x[2])return-1;var r=x[1][1+x[3]];return x[3]=x[3]+1|0,r===10&&(x[5]!==0&&(x[5]=x[5]+1|0),x[4]=x[3]),r}function V(x,r){x[9]=x[3],x[10]=x[4],x[11]=x[5],x[12]=r}function or(x){return x[6]=x[3],x[7]=x[4],x[8]=x[5],V(x,-1)}function w(x){return x[3]=x[9],x[4]=x[10],x[5]=x[11],x[12]}function el(x){x[3]=x[6],x[4]=x[7],x[5]=x[8]}function LC(x,r){x[6]=r}function A5(x){return x[3]-x[6]|0}function l2(x){var r=x[3]-x[6]|0,e=x[6],t=x[1];return 0<=e&&0<=r&&(t.length-1-r|0)>=e?Tz(t,e,r):R1(YV)}function kB(x){var r=x[6];return P2(x[1],r)[1+r]}function G6(x,r,e,t){for(var u=[0,r],i=[0,e],c=[0,0];;){if(0>=i[1])return c[1];var v=x[1+u[1]];if(0>v)throw K0(Qa,1);if(Xr>>18|0),Yr(t,c[1]+1|0,M2|(v>>>12|0)&63),Yr(t,c[1]+2|0,M2|(v>>>6|0)&63),Yr(t,c[1]+3|0,M2|v&63),c[1]=c[1]+4|0}else Yr(t,c[1],qo|v>>>12|0),Yr(t,c[1]+1|0,M2|(v>>>6|0)&63),Yr(t,c[1]+2|0,M2|v&63),c[1]=c[1]+3|0;else Yr(t,c[1],v3|v>>>6|0),Yr(t,c[1]+1|0,M2|v&63),c[1]=c[1]+2|0;else Yr(t,c[1],v),c[1]++;u[1]++,i[1]+=-1}}function mB(x){for(var r=Cx(x),e=Wa(r,0),t=[0,0],u=[0,0];;){if(t[1]>=r)return[0,e,u[1],pB,lB,vB,oB,aB,sB,cB,fB,iB,uB];var i=Y0(x,t[1]);x:{if(v3<=i){if(b3>i){if(qo>i){var c=Y0(x,t[1]+1|0);if((c>>>6|0)!==2)throw K0(Qa,1);e[1+u[1]]=(i&31)<<6|c&63,t[1]=t[1]+2|0;break x}var v=Y0(x,t[1]+1|0),a=Y0(x,t[1]+2|0),l=(i&15)<<12|(v&63)<<6|a&63,m=(v>>>6|0)!==2?1:0,h=m||((a>>>6|0)!==2?1:0);if(h)var b=h;else var T=55296<=l?1:0,b=T&&(l<=57343?1:0);if(b)throw K0(Qa,1);e[1+u[1]]=l,t[1]=t[1]+3|0;break x}if(i2>i){var N=Y0(x,t[1]+1|0),C=Y0(x,t[1]+2|0),I=Y0(x,t[1]+3|0),F=(N>>>6|0)!==2?1:0;if(F)var Y=F;else var M=(C>>>6|0)!==2?1:0,Y=M||((I>>>6|0)!==2?1:0);if(Y)throw K0(Qa,1);var q=(i&7)<<18|(N&63)<<12|(C&63)<<6|I&63;if(tki){e[1+u[1]]=i,t[1]++;break x}throw K0(Qa,1)}u[1]++}}function W6(x,r,e){var t=x[6]+r|0,u=E2(e*4|0),i=x[1];if((t+e|0)<=i.length-1)return V3(u,0,G6(i,t,e,u));throw K0([0,Ir,QV],1)}function Ox(x){var r=x[6],e=x[3]-r|0,t=E2(e*4|0);return V3(t,0,G6(x[1],r,e,t))}function P5(x,r){var e=x[6],t=x[3]-e|0,u=E2(t*4|0);return nC(r,u,0,G6(x[1],e,t,u))}function V6(x){var r=x.length-1,e=E2(r*4|0);return V3(e,0,G6(x,0,r,e))}function hB(x,r){x[3]=x[3]-r|0}function ys(x){return typeof x=="number"?0:x[0]===0?1:x[1]}function Tv(x,r,e,t){var u=ys(x),i=ys(t),c=i<=u?u+1|0:i+1|0;return c===1?[0,r,e]:[1,c,r,e,x,t]}function I5(x,r,e,t){var u=ys(x),i=ys(t),c=i<=u?u+1|0:i+1|0;return[1,c,r,e,x,t]}function dB(x,r,e,t){var u=ys(x),i=ys(t);if((i+2|0)=i)return Tv(x,r,e,t);var C=t[5],I=t[4],F=t[3],M=t[2],Y=ys(I);if(Y<=ys(C))return I5(Tv(x,r,e,I),M,F,C);var q=I[4],K=I[3],u0=I[2],Q=Tv(I[5],M,F,C);return I5(Tv(x,r,e,q),u0,K,Q)}function Ha(x){return typeof x=="number"?0:x[0]===0?1:x[1]}function oa(x,r,e){x:{r:{if(typeof x=="number"){if(typeof e=="number")return[0,r];if(e[0]===1)break r}else{if(x[0]!==0){var t=x[1];if(typeof e!="number"&&e[0]===1){var u=e[1],i=u<=t?t+1|0:u+1|0;return[1,i,r,x,e]}var c=t;break x}if(typeof e!="number"&&e[0]===1)break r}return[1,2,r,x,e]}var c=e[1]}return[1,c+1|0,r,x,e]}function N5(x,r,e){var t=Ha(x),u=Ha(e),i=u<=t?t+1|0:u+1|0;return[1,i,r,x,e]}function yB(x,r,e){var t=Ha(x),u=Ha(e);if((u+2|0)=u)return oa(x,r,e);var T=e[4],b=e[3],N=e[2],C=Ha(b);if(C<=Ha(T))return N5(oa(x,r,b),N,T);var I=b[3],F=b[2],M=oa(b[4],N,T);return N5(oa(x,r,I),F,M)}var MC=0;function gB(x){function r(e,t){if(typeof t=="number")return[0,e];if(t[0]===0){var u=t[1],i=p(x[1],e,u);return i===0?t:0<=i?oa(t,e,MC):oa([0,e],u,MC)}var c=t[4],v=t[3],a=t[2],l=p(x[1],e,a);if(l===0)return t;if(0<=l){var m=r(e,c);return c===m?t:yB(v,a,m)}var h=r(e,v);return v===h?t:yB(h,a,c)}return[0,MC,,function(e,t){for(var u=t;;){if(typeof u=="number")return 0;if(u[0]===0)return p(x[1],e,u[1])===0?1:0;var i=u[4],c=u[3],v=p(x[1],e,u[2]),a=v===0?1:0;if(a)return a;var l=0<=v?i:c,u=l}},r]}function wB(x){switch(x[0]){case 0:return 1;case 1:return 2;case 2:return 2;default:return 3}}function Px(x,r){if(!r)return r;var e=r[1],t=d(x,e);return e===t?r:[0,t]}function D0(x,r,e,t,u){var i=p(x,r,e);return e===i?t:u(i)}function P0(x,r,e,t){var u=d(x,r);return r===u?e:t(u)}function W2(x,r){var e=r[1];return D0(x,e,r[2],r,function(t){return[0,e,t]})}function $6(x,r){return Px(function(e){var t=e[1];return D0(x,t,e[2],e,function(u){return[0,t,u]})},r)}function fr(x,r){var e=m1(function(u,i){var c=u[2],v=u[1],a=d(x,i),l=c||(a!==i?1:0);return[0,[0,a,v],l]},N$,r),t=e[1];return e[2]?tx(t):r}var qC=T5(j$,function(x){var r=IC(x,C$),e=r[1],t=r[2],u=r[3],i=r[4],c=r[5],v=r[6],a=r[7],l=r[8],m=r[9],h=r[10],T=r[11],b=r[12],N=r[13],C=r[14],I=r[15],F=r[16],M=r[17],Y=r[18],q=r[19],K=r[20],u0=r[21],Q=r[22],e0=r[23],f0=r[24],a0=r[25],Z=r[26],v0=r[27],t0=r[28],y0=r[29],n0=r[30],s0=r[31],l0=r[32],w0=r[33],L0=r[34],I0=r[35],j0=r[36],S0=r[37],W0=r[38],A0=r[39],J0=r[40],b0=r[41],z=r[42],C0=r[43],V0=r[44],N0=r[45],rx=r[46],xx=r[47],nx=r[48],mx=r[49],F0=r[50],px=r[51],dx=r[52],W=r[53],g0=r[54],B=r[55],h0=r[56],_0=r[57],d0=r[58],E0=r[60],U=r[61],Kx=r[62],Ix=r[63],z0=r[64],Kr=r[65],S=r[66],G=r[67],Z0=r[68],yx=r[69],Tx=r[70],ex=r[71],m0=r[72],Dx=r[73],Ex=r[74],qx=r[75],O0=r[76],Wx=r[77],Yx=r[78],fx=r[79],Qx=r[80],vx=r[81],nr=r[82],gr=r[83],Nr=r[84],s2=r[85],b2=r[86],k2=r[87],F2=r[88],jx=r[89],_=r[90],$=r[91],ix=r[92],U0=r[93],cx=r[94],wx=r[95],Or=r[96],Hx=r[97],x2=r[98],hr=r[99],Dr=r[y2],r2=r[se],sx=r[cn],Sx=r[F1],Zx=r[ft],Ur=r[Pt],Y2=r[vn],pe=r[K2],j1=r[Hs],kt=r[Vn],zt=r[w1],O1=r[G1],q1=r[Qs],T2=r[J1],En=r[kr],Sn=r[iv],Ss=r[av],ke=r[F3],Qe=r[f6],vo=r[h3],mt=r[mf],dr=r[y6],lo=r[c2],As=r[en],ga=r[P3],Uv=r[qa],Kt=r[Ik],An=r[Xr],wa=r[M2],po=r[Ko],ko=r[w6],_a=r[u6],ba=r[u8],Ta=r[Ek],mo=r[ER],me=r[oR],Q2=r[DD],Ea=r[HO],Pn=r[YL],ho=r[kT],yo=r[FL],Ps=r[CR],go=r[xM],wl=r[JR],Xv=r[144],Yv=r[145],wo=r[146],_o=r[147],Sa=r[148],bo=r[149],_l=r[150],ht=r[151],E4=r[SR],Aa=r[153],$h=r[154],zv=r[155],bl=r[156],Tl=r[157],To=r[GD],S4=r[159],A4=r[SL],Qh=r[sL],Hh=r[XR],Zh=r[lr],P4=r[yD],I4=r[SF],N4=r[eD],El=r[wF],X=r[AL],A=r[Fg],D=r[J4],c0=r[zw],k0=r[eF],M0=r[PR],$0=r[LL],lx=r[BD],Nx=r[JF],Fx=r[iA],ur=r[wD],Jx=r[WL],xr=r[ID],ar=r[N8],er=r[Ty],yr=r[$9],Cr=r[pm],Rx=r[Td],Lr=r[hA],Tr=r[cg],e2=r[K9],m2=r[M8],h2=r[HT],Fr=r[TP],d2=r[v3],t2=r[dD],Er=r[NI],Sr=r[FF],a2=r[LA],qr=r[ND],Qr=r[RL],z2=r[wL],Mr=r[dL],n2=r[cF],o2=r[tD],f2=r[LO],N2=r[ST],he=r[hR],ee=r[kk],He=r[gF],B1=r[FO],u2=r[tF],te=r[uD],R2=r[kD],dt=r[uF],D1=r[nD],yt=r[ML],Jt=r[Tg],Ze=r[gd],xt=r[dR],gt=r[yO],wt=r[eL],Ax=r[z_],Z2=r[HF],de=r[KO],je=r[dk],rt=r[qo],et=r[rF],tt=r[QF],x1=r[AR],_t=r[JO],bt=r[kL],Is=r[lF],Ns=r[UO],In=r[dO],v1=r[cL],Gt=r[mL],U1=r[NR],Oe=r[OR],Wt=r[bL],Cs=r[KF],Nn=r[By],js=r[b3],nt=r[TF],Vt=r[WR],Tt=r[YR],$t=r[Go],De=r[rE],Os=r[I3],Ds=r[ip],Kv=r[i2],Eo=r[$E],So=r[R3],Jv=r[VL],Gv=r[_3],Wv=r[mE],Vv=r[g3],Ao=r[xk],Sl=r[e6],Al=r[257],Pa=r[258],Po=r[EL],$v=r[VF],Pl=r[261],Cn=r[262],Qv=r[263],Hv=r[264],Il=r[265],Io=r[266],Zv=r[OD],x3=r[268],Ia=r[269],Fs=r[270],Na=r[271],Nl=r[gD],No=r[cD],Co=r[274],r3=r[275],Cl=r[lL],jo=r[277],Rs=r[aF],Oo=r[Hk],e3=r[NO],Ca=r[281],t3=r[oD],n3=r[283],u3=r[284],ye=r[285],X1=r[286],i3=r[WD],Do=r[$D],jl=r[289],Ol=r[290],Fo=r[291],Ro=r[PF],Dl=r[293],Fl=r[ZL],xd=r[295],Rl=r[296],rd=r[297],Qt=r[zL],jn=r[299],Lo=r[300],C4=r[qD],ja=r[302],Ll=r[PD],ed=r[PO],td=r[305],f3=r[306],j4=r[307],nd=r[UF],ud=r[309],id=r[jO],Ml=r[uL];return FC(x,[0,r[59],function(n,s){var f=s[2],o=f[4],k=f[3],g=f[1],E=f[2],j=s[1],R=p(n[1][1+j0],n,g),H=p(n[1][1+z],n,k),p0=fr(d(n[1][1+Co],n),o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,E,H,p0]]},F0,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return D0(d(n[1][1+Qt],n),o,k,s,function(ax){return[0,o,[0,ax]]});case 1:var g=f[1];return D0(d(n[1][1+xd],n),o,g,s,function(ax){return[0,o,[1,ax]]});case 2:var E=f[1];return D0(d(n[1][1+X1],n),o,E,s,function(ax){return[0,o,[2,ax]]});case 3:var j=f[1];return D0(d(n[1][1+Nl],n),o,j,s,function(ax){return[0,o,[3,ax]]});case 4:var R=f[1];return D0(d(n[1][1+Al],n),o,R,s,function(ax){return[0,o,[4,ax]]});case 5:var H=f[1];return D0(d(n[1][1+Sl],n),o,H,s,function(ax){return[0,o,[5,ax]]});case 6:var p0=f[1];return D0(d(n[1][1+Ao],n),o,p0,s,function(ax){return[0,o,[6,ax]]});case 7:var R0=f[1];return D0(d(n[1][1+Vv],n),o,R0,s,function(ax){return[0,o,[7,ax]]});case 8:var kx=f[1];return D0(d(n[1][1+Wv],n),o,kx,s,function(ax){return[0,o,[8,ax]]});case 9:var Bx=f[1];return D0(d(n[1][1+Gv],n),o,Bx,s,function(ax){return[0,o,[9,ax]]});case 10:var zx=f[1];return D0(d(n[1][1+So],n),o,zx,s,function(ax){return[0,o,[10,ax]]});case 11:var wr=f[1];return D0(d(n[1][1+Eo],n),o,wr,s,function(ax){return[0,o,[11,ax]]});case 12:var Jr=f[1];return D0(d(n[1][1+Kv],n),o,Jr,s,function(ax){return[0,o,[12,ax]]});case 13:var Hr=f[1];return D0(d(n[1][1+Ds],n),o,Hr,s,function(ax){return[0,o,[13,ax]]});case 14:var Vx=f[1];return D0(d(n[1][1+Os],n),o,Vx,s,function(ax){return[0,o,[14,ax]]});case 15:var C2=f[1];return D0(d(n[1][1+De],n),o,C2,s,function(ax){return[0,o,[15,ax]]});case 16:var r1=f[1];return D0(d(n[1][1+F2],n),o,r1,s,function(ax){return[0,o,[16,ax]]});case 17:var ne=f[1];return D0(d(n[1][1+$t],n),o,ne,s,function(ax){return[0,o,[17,ax]]});case 18:var Y1=f[1];return D0(d(n[1][1+Vt],n),o,Y1,s,function(ax){return[0,o,[18,ax]]});case 19:var ge=f[1];return D0(d(n[1][1+nt],n),o,ge,s,function(ax){return[0,o,[19,ax]]});case 20:var Fe=f[1];return D0(d(n[1][1+U1],n),o,Fe,s,function(ax){return[0,o,[20,ax]]});case 21:var we=f[1];return D0(d(n[1][1+tt],n),o,we,s,function(ax){return[0,o,[21,ax]]});case 22:var ue=f[1];return D0(d(n[1][1+rt],n),o,ue,s,function(ax){return[0,o,[22,ax]]});case 23:var _e=f[1];return D0(d(n[1][1+gt],n),o,_e,s,function(ax){return[0,o,[23,ax]]});case 24:var ut=f[1];return D0(d(n[1][1+B1],n),o,ut,s,function(ax){return[0,o,[24,ax]]});case 25:var be=f[1];return D0(d(n[1][1+Jt],n),o,be,s,function(ax){return[0,o,[25,ax]]});case 26:var Ht=f[1];return D0(d(n[1][1+te],n),o,Ht,s,function(ax){return[0,o,[26,ax]]});case 27:var Ls=f[1];return D0(d(n[1][1+f2],n),o,Ls,s,function(ax){return[0,o,[27,ax]]});case 28:var On=f[1];return D0(d(n[1][1+er],n),o,On,s,function(ax){return[0,o,[28,ax]]});case 29:var Ms=f[1];return D0(d(n[1][1+xr],n),o,Ms,s,function(ax){return[0,o,[29,ax]]});case 30:var Et=f[1];return D0(d(n[1][1+c0],n),o,Et,s,function(ax){return[0,o,[30,ax]]});case 31:var qs=f[1];return D0(d(n[1][1+yo],n),o,qs,s,function(ax){return[0,o,[31,ax]]});case 32:var c3=f[1];return D0(d(n[1][1+As],n),o,c3,s,function(ax){return[0,o,[32,ax]]});case 33:var s3=f[1];return D0(d(n[1][1+g0],n),o,s3,s,function(ax){return[0,o,[33,ax]]});case 34:var a3=f[1];return D0(d(n[1][1+N0],n),o,a3,s,function(ax){return[0,o,[34,ax]]});case 35:var o3=f[1];return D0(d(n[1][1+S0],n),o,o3,s,function(ax){return[0,o,[35,ax]]});case 36:var Oa=f[1];return D0(d(n[1][1+L0],n),o,Oa,s,function(ax){return[0,o,[36,ax]]});case 37:var _x=f[1];return D0(d(n[1][1+v0],n),o,_x,s,function(ax){return[0,o,[37,ax]]});case 38:var O4=f[1];return D0(d(n[1][1+F2],n),o,O4,s,function(ax){return[0,o,[38,ax]]});case 39:var hx=f[1];return D0(d(n[1][1+l],n),o,hx,s,function(ax){return[0,o,[39,ax]]});case 40:var D4=f[1];return D0(d(n[1][1+u],n),o,D4,s,function(ax){return[0,o,[40,ax]]});default:var tO=f[1];return D0(d(n[1][1+t],n),o,tO,s,function(ax){return[0,o,[41,ax]]})}},Co,function(n,s){return s},z,function(n){var s=d(n[1][1+C0],n);return function(f){return Px(s,f)}},C0,function(n,s){var f=s[2],o=s[1],k=s[3],g=fr(d(n[1][1+Co],n),o),E=fr(d(n[1][1+Co],n),f);return o===g&&f===E?s:[0,g,E,k]},Ax,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return D0(d(n[1][1+id],n),o,k,s,function(hx){return[0,o,[0,hx]]});case 1:var g=f[1];return D0(d(n[1][1+j4],n),o,g,s,function(hx){return[0,o,[1,hx]]});case 2:var E=f[1];return D0(d(n[1][1+f3],n),o,E,s,function(hx){return[0,o,[2,hx]]});case 3:var j=f[1];return D0(d(n[1][1+td],n),o,j,s,function(hx){return[0,o,[3,hx]]});case 4:var R=f[1];return D0(d(n[1][1+ed],n),o,R,s,function(hx){return[0,o,[4,hx]]});case 5:var H=f[1];return D0(d(n[1][1+C4],n),o,H,s,function(hx){return[0,o,[5,hx]]});case 6:var p0=f[1];return D0(d(n[1][1+Fl],n),o,p0,s,function(hx){return[0,o,[6,hx]]});case 7:var R0=f[1];return D0(d(n[1][1+n3],n),o,R0,s,function(hx){return[0,o,[7,hx]]});case 8:var kx=f[1];return D0(d(n[1][1+Po],n),o,kx,s,function(hx){return[0,o,[8,hx]]});case 9:var Bx=f[1];return D0(d(n[1][1+o2],n),o,Bx,s,function(hx){return[0,o,[9,hx]]});case 10:var zx=f[1];return P0(d(n[1][1+Rx],n),zx,s,function(hx){return[0,o,[10,hx]]});case 11:var wr=f[1];return P0(p(n[1][1+ar],n,o),wr,s,function(hx){return[0,o,[11,hx]]});case 12:var Jr=f[1];return D0(d(n[1][1+To],n),o,Jr,s,function(hx){return[0,o,[12,hx]]});case 13:var Hr=f[1];return D0(d(n[1][1+E4],n),o,Hr,s,function(hx){return[0,o,[13,hx]]});case 14:var Vx=f[1];return D0(d(n[1][1+xx],n),o,Vx,s,function(hx){return[0,o,[14,hx]]});case 15:var C2=f[1];return D0(d(n[1][1+Rl],n),o,C2,s,function(hx){return[0,o,[15,hx]]});case 16:var r1=f[1];return D0(d(n[1][1+zt],n),o,r1,s,function(hx){return[0,o,[16,hx]]});case 17:var ne=f[1];return D0(d(n[1][1+j1],n),o,ne,s,function(hx){return[0,o,[17,hx]]});case 18:var Y1=f[1];return D0(d(n[1][1+ja],n),o,Y1,s,function(hx){return[0,o,[18,hx]]});case 19:var ge=f[1];return D0(d(n[1][1+_0],n),o,ge,s,function(hx){return[0,o,[19,hx]]});case 20:var Fe=f[1];return D0(d(n[1][1+q1],n),o,Fe,s,function(hx){return[0,o,[20,hx]]});case 21:var we=f[1];return D0(d(n[1][1+ho],n),o,we,s,function(hx){return[0,o,[21,hx]]});case 22:var ue=f[1];return D0(d(n[1][1+me],n),o,ue,s,function(hx){return[0,o,[22,hx]]});case 23:var _e=f[1];return D0(d(n[1][1+vo],n),o,_e,s,function(hx){return[0,o,[23,hx]]});case 24:var ut=f[1];return D0(d(n[1][1+T2],n),o,ut,s,function(hx){return[0,o,[24,hx]]});case 25:var be=f[1];return D0(d(n[1][1+O1],n),o,be,s,function(hx){return[0,o,[25,hx]]});case 26:var Ht=f[1];return D0(d(n[1][1+pe],n),o,Ht,s,function(hx){return[0,o,[26,hx]]});case 27:var Ls=f[1];return P0(p(n[1][1+k2],n,o),Ls,s,function(hx){return[0,o,[27,hx]]});case 28:var On=f[1];return D0(d(n[1][1+s2],n),o,On,s,function(hx){return[0,o,[28,hx]]});case 29:var Ms=f[1];return D0(d(n[1][1+W],n),o,Ms,s,function(hx){return[0,o,[29,hx]]});case 30:var Et=f[1];return D0(d(n[1][1+rx],n),o,Et,s,function(hx){return[0,o,[30,hx]]});case 31:var qs=f[1];return D0(d(n[1][1+b0],n),o,qs,s,function(hx){return[0,o,[31,hx]]});case 32:var c3=f[1];return D0(d(n[1][1+J0],n),o,c3,s,function(hx){return[0,o,[32,hx]]});case 33:var s3=f[1];return D0(d(n[1][1+W0],n),o,s3,s,function(hx){return[0,o,[33,hx]]});case 34:var a3=f[1];return D0(d(n[1][1+e0],n),o,a3,s,function(hx){return[0,o,[34,hx]]});case 35:var o3=f[1];return D0(d(n[1][1+w0],n),o,o3,s,function(hx){return[0,o,[35,hx]]});case 36:var Oa=f[1];return D0(d(n[1][1+T],n),o,Oa,s,function(hx){return[0,o,[36,hx]]});case 37:var _x=f[1];return D0(d(n[1][1+m],n),o,_x,s,function(hx){return[0,o,[37,hx]]});default:var O4=f[1];return D0(d(n[1][1+e],n),o,O4,s,function(hx){return[0,o,[38,hx]]})}},id,function(n,s,f){var o=f[2],k=f[1],g=fr(d(n[1][1+ud],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},ud,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+Ax],n),f,s,function(k){return[0,k]});case 1:var o=s[1];return P0(d(n[1][1+dx],n),o,s,function(k){return[1,k]});default:return s}},j4,function(n,s,f){return Q0(n[1][1+ee],n,s,f)},f3,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return g===k&&E===o?f:[0,g,E]},td,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Z],n,k),R=p(n[1][1+z],n,o);return E===g&&j===k&&R===o?f:[0,E,j,R]},ed,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=p(n[1][1+Ll],n,g),j=p(n[1][1+Ax],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,f[1],E,j,R]},C4,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Ax],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,f[1],E,j,R]},Qt,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+nx],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},xd,function(n,s,f){var o=f[2],k=f[1],g=Px(d(n[1][1+Ps],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},Fl,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+Ax],n,E),R=Px(d(n[1][1+Ro],n),g),H=p(n[1][1+Ml],n,k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},Ml,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+wt],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},k2,function(n,s,f){var o=f[1],k=Q0(n[1][1+Fl],n,s,o);return o===k?f:[0,k,f[2],f[3]]},Ro,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+Dl],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},Dl,function(n,s){if(s[0]===0){var f=s[1],o=p(n[1][1+t0],n,f);return o===f?s:[0,o]}var k=s[1],g=k[2][1],E=k[1],j=p(n[1][1+z],n,g);return g===j?s:[1,[0,E,[0,j]]]},Fo,function(n,s){return W2(d(n[1][1+Qt],n),s)},Ol,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=Px(d(n[1][1+jl],n),g),j=p(n[1][1+Fo],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},X1,function(n,s,f){return Q0(n[1][1+Do],n,s,f)},n3,function(n,s,f){return Q0(n[1][1+Do],n,s,f)},Do,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[4],j=f[3],R=f[2],H=f[1],p0=Px(d(n[1][1+Ca],n),H),R0=Px(d(n[1][1+M],n),j),kx=p(n[1][1+i3],n,R),Bx=d(n[1][1+t3],n),zx=Px(function(Vx){return W2(Bx,Vx)},E),wr=Px(d(n[1][1+e3],n),g),Jr=fr(d(n[1][1+ye],n),k),Hr=p(n[1][1+z],n,o);return H===p0&&R===kx&&E===zx&&g===wr&&k===Jr&&o===Hr&&j===R0?f:[0,p0,kx,R0,zx,wr,Jr,Hr]},t3,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=Px(d(n[1][1+f0],n),k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},Ca,function(n,s){return Q0(n[1][1+O0],n,m$,s)},i3,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+u3],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},ye,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},u3,function(n,s){switch(s[0]){case 0:var f=s[1],o=f[1],k=f[2];return D0(d(n[1][1+Rs],n),o,k,s,function(R0){return[0,[0,o,R0]]});case 1:var g=s[1],E=g[1],j=g[2];return D0(d(n[1][1+Cl],n),E,j,s,function(R0){return[1,[0,E,R0]]});default:var R=s[1],H=R[1],p0=R[2];return D0(d(n[1][1+jo],n),H,p0,s,function(R0){return[2,[0,H,R0]]})}},e3,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+Oo],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},Oo,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+q],n,k),j=Px(d(n[1][1+f0],n),o);return k===E&&o===j?s:[0,g,[0,E,j]]},Rs,function(n,s,f){var o=f[6],k=f[5],g=f[3],E=f[2],j=p(n[1][1+Sx],n,E),R=W2(d(n[1][1+n2],n),g),H=fr(d(n[1][1+ye],n),k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,f[1],j,R,f[4],H,p0]},Cl,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[3],j=f[2],R=f[1],H=p(n[1][1+Sx],n,R),p0=p(n[1][1+r3],n,j),R0=p(n[1][1+a0],n,E),kx=p(n[1][1+i],n,g),Bx=fr(d(n[1][1+ye],n),k),zx=p(n[1][1+z],n,o);return R===H&&j===p0&&R0===E&&kx===g&&Bx===k&&zx===o?f:[0,H,p0,R0,f[4],kx,Bx,zx]},r3,function(n,s){if(typeof s=="number")return s;var f=s[1],o=p(n[1][1+Ax],n,f);return f===o?s:[0,o]},jo,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[3],j=f[2],R=f[1],H=p(n[1][1+E0],n,R),p0=p(n[1][1+r3],n,j),R0=p(n[1][1+a0],n,E),kx=p(n[1][1+i],n,g),Bx=fr(d(n[1][1+ye],n),k),zx=p(n[1][1+z],n,o);return R===H&&j===p0&&R0===E&&kx===g&&Bx===k&&zx===o?f:[0,H,p0,R0,f[4],kx,Bx,zx]},Tt,function(n,s){return Px(d(n[1][1+Ax],n),s)},Nl,function(n,s,f){var o=f[6],k=f[5],g=f[4],E=f[3],j=f[2],R=f[1],H=f[7],p0=p(n[1][1+Na],n,R),R0=Px(d(n[1][1+M],n),j),kx=p(n[1][1+Zv],n,E),Bx=p(n[1][1+No],n,k),zx=p(n[1][1+Io],n,g),wr=p(n[1][1+z],n,o);return R===p0&&j===R0&&E===kx&&k===Bx&&g===zx&&o===wr?f:[0,p0,R0,kx,zx,Bx,wr,H]},Na,function(n,s){return Q0(n[1][1+O0],n,h$,s)},Zv,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=s[1],j=fr(d(n[1][1+Fs],n),g),R=Px(d(n[1][1+Il],n),k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?s:[0,E,[0,j,R,H]]},Fs,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=f[4],j=s[1],R=p(n[1][1+Ia],n,g),H=p(n[1][1+x3],n,k),p0=p(n[1][1+Tt],n,o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,H,p0,E]]},Ia,function(n,s){if(s[0]===0)return[0,p(n[1][1+Rx],n,s[1])];var f=s[1],o=f[1];return[1,[0,o,Q0(n[1][1+xx],n,o,f[2])]]},x3,function(n,s){return Q0(n[1][1+Lo],n,d$,s)},Il,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+x3],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},No,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+Qt],n),f,o,s,function(k){return[0,f,k]})},Po,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+U],n,E),R=p(n[1][1+Ax],n,g),H=p(n[1][1+Ax],n,k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},Al,function(n,s,f){var o=f[2],k=f[1],g=Px(d(n[1][1+Ps],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},Sl,function(n,s,f){var o=f[1],k=p(n[1][1+z],n,o);return o===k?f:[0,k]},Ao,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[4],j=f[3],R=f[2],H=f[1],p0=p(n[1][1+Ca],n,H),R0=Px(d(n[1][1+M],n),R),kx=W2(d(n[1][1+ix],n),j),Bx=d(n[1][1+Lr],n),zx=Px(function(C2){return W2(Bx,C2)},E),wr=d(n[1][1+Lr],n),Jr=fr(function(C2){return W2(wr,C2)},g),Hr=Px(d(n[1][1+e3],n),k),Vx=p(n[1][1+z],n,o);return p0===H&&R0===R&&kx===j&&zx===E&&Jr===g&&Hr===k&&Vx===o?f:[0,p0,R0,kx,zx,Jr,Hr,Vx]},Vv,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=p(n[1][1+Na],n,j),H=Px(d(n[1][1+M],n),E),p0=p(n[1][1+Cn],n,g),R0=p(n[1][1+Io],n,k),kx=p(n[1][1+z],n,o);return j===R&&E===H&&g===p0&&k===R0&&o===kx?f:[0,R,H,p0,R0,kx]},Hv,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=Px(d(n[1][1+M],n),E),R=p(n[1][1+Cn],n,g),H=p(n[1][1+Io],n,k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},Cn,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=s[1],j=fr(d(n[1][1+Qv],n),g),R=Px(d(n[1][1+Pl],n),k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?s:[0,E,[0,j,R,H]]},Qv,function(n,s){var f=s[2],o=f[2],k=f[1],g=f[3],E=s[1],j=p(n[1][1+Ia],n,k),R=p(n[1][1+Z],n,o);return k===j&&o===R?s:[0,E,[0,j,R,g]]},Pl,function(n,s){var f=s[2],o=f[4],k=f[2],g=f[1],E=f[3],j=s[1],R=Px(d(n[1][1+Rx],n),g),H=p(n[1][1+t0],n,k),p0=p(n[1][1+z],n,o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,H,E,p0]]},Wv,function(n,s,f){return Q0(n[1][1+U1],n,s,f)},Gv,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=$6(d(n[1][1+Z2],n),k),H=Px(d(n[1][1+de],n),g),p0=Px(d(n[1][1+Jv],n),E),R0=p(n[1][1+z],n,o);return k===R&&g===H&&E===p0&&o===R0?f:[0,j,p0,H,R,R0]},Jv,function(n,s){switch(s[0]){case 0:var f=s[1],o=f[2],k=f[1],g=Q0(n[1][1+$t],n,k,o);return g===o?s:[0,[0,k,g]];case 1:var E=s[1],j=E[2],R=E[1],H=Q0(n[1][1+So],n,R,j);return H===j?s:[1,[0,R,H]];case 2:var p0=s[1],R0=p0[2],kx=p0[1],Bx=Q0(n[1][1+Ao],n,kx,R0);return Bx===R0?s:[2,[0,kx,Bx]];case 3:var zx=s[1],wr=zx[2],Jr=zx[1],Hr=Q0(n[1][1+Vv],n,Jr,wr);return Hr===wr?s:[3,[0,Jr,Hr]];case 4:var Vx=s[1],C2=p(n[1][1+t0],n,Vx);return C2===Vx?s:[4,C2];case 5:var r1=s[1],ne=r1[2],Y1=r1[1],ge=Q0(n[1][1+v0],n,Y1,ne);return ge===ne?s:[5,[0,Y1,ge]];case 6:var Fe=s[1],we=Fe[2],ue=Fe[1],_e=Q0(n[1][1+F2],n,ue,we);return _e===we?s:[6,[0,ue,_e]];case 7:var ut=s[1],be=ut[2],Ht=ut[1],Ls=Q0(n[1][1+k0],n,Ht,be);return Ls===be?s:[7,[0,Ht,Ls]];default:var On=s[1],Ms=On[2],Et=On[1],qs=Q0(n[1][1+U1],n,Et,Ms);return qs===Ms?s:[8,[0,Et,qs]]}},So,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+Mr],n,E),R=p(n[1][1+Z],n,g),H=Px(d(n[1][1+Kx],n),k),p0=p(n[1][1+z],n,o);return j===E&&R===g&&H===k&&p0===o?f:[0,j,R,H,p0]},Eo,function(n,s,f){return Q0(n[1][1+k0],n,s,f)},Kv,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=W2(d(n[1][1+Qt],n),k),j=p(n[1][1+z],n,o);return E===k&&o===j?f:[0,g,E,j]},Ds,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Z],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},Os,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=Q0(n[1][1+O0],n,y$,g),j=W2(d(n[1][1+Qt],n),k),R=p(n[1][1+z],n,o);return E===g&&j===k&&o===R?f:[0,E,j,R]},De,function(n,s,f){return Q0(n[1][1+v0],n,s,f)},$t,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=Q0(n[1][1+O0],n,[0,k],E),R=p(n[1][1+Z],n,g),H=p(n[1][1+z],n,o);return j===E&&R===g&&H===o?f:[0,j,R,k,H]},Vt,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+F0],n,g),j=p(n[1][1+U],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},nt,function(n,s,f){var o=f[1],k=p(n[1][1+z],n,o);return o===k?f:[0,k]},U1,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=Q0(n[1][1+O0],n,g$,g),j=p(n[1][1+Cs],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},Cs,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return P0(d(n[1][1+Wt],n),k,s,function(H){return[0,o,[0,H]]});case 1:var g=f[1];return P0(d(n[1][1+In],n),g,s,function(H){return[0,o,[1,H]]});case 2:var E=f[1];return P0(d(n[1][1+Is],n),E,s,function(H){return[0,o,[2,H]]});case 3:var j=f[1];return P0(d(n[1][1+_t],n),j,s,function(H){return[0,o,[3,H]]});default:var R=f[1];return P0(d(n[1][1+js],n),R,s,function(H){return[0,o,[4,H]]})}},Wt,function(n,s){var f=s[4],o=s[1],k=fr(d(n[1][1+Oe],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,s[2],s[3],g]},In,function(n,s){var f=s[4],o=s[1],k=fr(d(n[1][1+Ns],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,s[2],s[3],g]},Is,function(n,s){var f=s[4],o=s[1];if(o[0]===0)var k=o[1],g=d(n[1][1+Gt],n),R=P0(function(p0){return fr(g,p0)},k,o,function(p0){return[0,p0]});else var E=o[1],j=d(n[1][1+bt],n),R=P0(function(p0){return fr(j,p0)},E,o,function(p0){return[1,p0]});var H=p(n[1][1+z],n,f);return o===R&&f===H?s:[0,R,s[2],s[3],H]},_t,function(n,s){var f=s[3],o=s[1],k=fr(d(n[1][1+Gt],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,s[2],g]},js,function(n,s){var f=s[4],o=s[1],k=fr(d(n[1][1+Nn],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,s[2],s[3],g]},Gt,function(n,s){var f=s[2][1],o=s[1],k=p(n[1][1+v1],n,f);return f===k?s:[0,o,[0,k]]},Oe,function(n,s){var f=s[2],o=f[1],k=f[2],g=s[1],E=p(n[1][1+v1],n,o);return o===E?s:[0,g,[0,E,k]]},Ns,function(n,s){var f=s[2],o=f[1],k=f[2],g=s[1],E=p(n[1][1+v1],n,o);return o===E?s:[0,g,[0,E,k]]},bt,function(n,s){var f=s[2],o=f[1],k=f[2],g=s[1],E=p(n[1][1+v1],n,o);return o===E?s:[0,g,[0,E,k]]},Nn,function(n,s){var f=s[2],o=f[1],k=f[2],g=s[1],E=p(n[1][1+v1],n,o);return o===E?s:[0,g,[0,E,k]]},v1,function(n,s){return p(n[1][1+Rx],n,s)},tt,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+et],n,k),j=p(n[1][1+z],n,o);return E===k&&j===o?f:[0,g,E,j]},et,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+F0],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Ax],n),o,s,function(k){return[1,k]})},rt,function(n,s,f){var o=f[5],k=f[3],g=f[2],E=f[1],j=f[4],R=$6(d(n[1][1+Z2],n),k),H=Px(d(n[1][1+de],n),g),p0=Px(d(n[1][1+F0],n),E),R0=p(n[1][1+z],n,o);return k===R&&g===H&&E===p0&&o===R0?f:[0,p0,H,R,j,R0]},je,function(n,s){var f=s[2],o=f[2],k=f[1],g=f[4],E=f[3],j=s[1],R=p(n[1][1+Rx],n,k),H=Px(d(n[1][1+Rx],n),o);return k===R&&o===H?s:[0,j,[0,R,H,E,g]]},x1,function(n,s){var f=s[2],o=s[1],k=Px(d(n[1][1+Rx],n),f);return f===k?s:[0,o,k]},de,function(n,s){if(s[0]===0){var f=s[1],o=fr(d(n[1][1+je],n),f);return f===o?s:[0,o]}var k=s[1],g=p(n[1][1+x1],n,k);return k===g?s:[1,g]},Z2,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},gt,function(n,s,f){var o=f[3],k=f[1],g=f[2],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?f:[0,E,g,j]},wt,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+Ax],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+dx],n),o,s,function(k){return[1,k]})},Jt,function(n,s,f){var o=f[5],k=f[3],g=f[2],E=f[1],j=f[4],R=p(n[1][1+yt],n,E),H=p(n[1][1+Ax],n,g),p0=p(n[1][1+F0],n,k),R0=p(n[1][1+z],n,o);return E===R&&g===H&&k===p0&&o===R0?f:[0,R,H,p0,j,R0]},yt,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+Ze],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+xt],n),o,s,function(k){return[1,k]})},Ze,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+l],n),f,o,s,function(k){return[0,f,k]})},te,function(n,s,f){var o=f[5],k=f[3],g=f[2],E=f[1],j=f[4],R=p(n[1][1+u2],n,E),H=p(n[1][1+Ax],n,g),p0=p(n[1][1+F0],n,k),R0=p(n[1][1+z],n,o);return E===R&&g===H&&k===p0&&o===R0?f:[0,R,H,p0,j,R0]},u2,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+R2],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+dt],n),o,s,function(k){return[1,k]})},R2,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+l],n),f,o,s,function(k){return[0,f,k]})},B1,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=Px(d(n[1][1+He],n),j),H=Px(d(n[1][1+U],n),E),p0=Px(d(n[1][1+Ax],n),g),R0=p(n[1][1+F0],n,k),kx=p(n[1][1+z],n,o);return j===R&&E===H&&g===p0&&k===R0&&o===kx?f:[0,R,H,p0,R0,kx]},He,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+D1],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Ax],n),o,s,function(k){return[1,k]})},D1,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+l],n),f,o,s,function(k){return[0,f,k]})},qr,function(n,s){var f=s[2],o=f[2],k=f[1],g=f[3],E=s[1],j=p(n[1][1+t0],n,o),R=Px(d(n[1][1+Rx],n),k);return j===o&&R===k?s:[0,E,[0,R,j,g]]},Er,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+qr],n,k),j=p(n[1][1+z],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},Fr,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Z],n,k),j=p(n[1][1+z],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},m2,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+t0],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Q],n),o,s,function(k){return[1,k]})},h2,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=g[2],j=E[4],R=E[3],H=E[2],p0=E[1],R0=f[1],kx=f[5],Bx=g[1],zx=Px(d(n[1][1+M],n),R0),wr=Px(d(n[1][1+Fr],n),p0),Jr=fr(d(n[1][1+qr],n),H),Hr=Px(d(n[1][1+Er],n),R),Vx=p(n[1][1+m2],n,k),C2=p(n[1][1+z],n,o),r1=p(n[1][1+z],n,j);return Jr===H&&Hr===R&&Vx===k&&zx===R0&&C2===o&&r1===j&&wr===p0?f:[0,zx,[0,Bx,[0,wr,Jr,Hr,r1]],Vx,C2,kx]},Ps,function(n,s){return p(n[1][1+Rx],n,s)},cx,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+t0],n),f,s,function(g){return[0,g]});case 1:var o=s[1];return P0(d(n[1][1+_],n),o,s,function(g){return[1,g]});default:var k=s[1];return P0(d(n[1][1+jx],n),k,s,function(g){return[2,g]})}},_,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+h2],n),f,o,s,function(k){return[0,f,k]})},jx,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+h2],n),f,o,s,function(k){return[0,f,k]})},wx,function(n,s){var f=s[2],o=f[8],k=f[7],g=f[2],E=f[1],j=f[6],R=f[5],H=f[4],p0=f[3],R0=s[1],kx=p(n[1][1+Sx],n,E),Bx=p(n[1][1+cx],n,g),zx=p(n[1][1+i],n,k),wr=p(n[1][1+z],n,o);return kx===E&&Bx===g&&zx===k&&wr===o?s:[0,R0,[0,kx,Bx,p0,H,R,j,zx,wr]]},U0,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+t0],n,k),j=p(n[1][1+z],n,o);return E===k&&o===j?s:[0,g,[0,E,j]]},Ur,function(n,s){var f=s[2],o=f[6],k=f[5],g=f[3],E=f[2],j=f[4],R=f[1],H=s[1],p0=p(n[1][1+t0],n,E),R0=p(n[1][1+t0],n,g),kx=p(n[1][1+i],n,k),Bx=p(n[1][1+z],n,o);return p0===E&&R0===g&&kx===k&&Bx===o?s:[0,H,[0,R,p0,R0,j,kx,Bx]]},Zx,function(n,s){var f=s[2],o=f[6],k=f[2],g=f[1],E=f[5],j=f[4],R=f[3],H=s[1],p0=p(n[1][1+Rx],n,g),R0=p(n[1][1+t0],n,k),kx=p(n[1][1+z],n,o);return g===p0&&k===R0&&o===kx?s:[0,H,[0,p0,R0,R,j,E,kx]]},Y2,function(n,s){var f=s[2],o=f[3],k=f[1],g=k[2],E=k[1],j=f[2],R=s[1],H=Q0(n[1][1+h2],n,E,g),p0=p(n[1][1+z],n,o);return g===H&&o===p0?s:[0,R,[0,[0,E,H],j,p0]]},Hx,function(n,s){var f=s[2],o=f[6],k=f[4],g=f[3],E=f[2],j=f[1],R=f[5],H=s[1],p0=p(n[1][1+Y],n,j),R0=p(n[1][1+t0],n,E),kx=p(n[1][1+t0],n,g),Bx=p(n[1][1+i],n,k),zx=p(n[1][1+z],n,o);return p0===j&&R0===E&&kx===g&&Bx===k&&zx===o?s:[0,H,[0,p0,R0,kx,Bx,R,zx]]},ix,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=fr(d(n[1][1+$],n),k),R=p(n[1][1+z],n,o);return j===k&&o===R?f:[0,E,g,j,R]},$,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+wx],n),f,s,function(R){return[0,R]});case 1:var o=s[1];return P0(d(n[1][1+U0],n),o,s,function(R){return[1,R]});case 2:var k=s[1];return P0(d(n[1][1+Ur],n),k,s,function(R){return[2,R]});case 3:var g=s[1];return P0(d(n[1][1+Y2],n),g,s,function(R){return[3,R]});case 4:var E=s[1];return P0(d(n[1][1+Zx],n),E,s,function(R){return[4,R]});default:var j=s[1];return P0(d(n[1][1+Hx],n),j,s,function(R){return[5,R]})}},D,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=d(n[1][1+Lr],n),j=fr(function(p0){return W2(E,p0)},k),R=W2(d(n[1][1+ix],n),g),H=p(n[1][1+z],n,o);return j===k&&R===g&&o===H?f:[0,R,j,H]},e2,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+q],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Tr],n),o,s,function(k){return[1,k]})},Tr,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+e2],n,k),j=p(n[1][1+En],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},En,function(n,s){return p(n[1][1+Rx],n,s)},c,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+z],n,o);return o===E?s:[0,g,[0,k,E]]},i,function(n,s){return Px(d(n[1][1+c],n),s)},I0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+z],n,f);return f===k?s:[0,o,k]},f0,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+t0],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},M,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=fr(d(n[1][1+Y],n),k),j=p(n[1][1+z],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},Y,function(n,s){var f=s[2],o=f[6],k=f[5],g=f[4],E=f[2],j=f[1],R=f[3],H=s[1],p0=p(n[1][1+a0],n,E),R0=p(n[1][1+i],n,g),kx=Px(d(n[1][1+t0],n),k),Bx=Px(d(n[1][1+I0],n),o),zx=p(n[1][1+jn],n,j);return zx===j&&p0===E&&R0===g&&kx===k&&Bx===o?s:[0,H,[0,zx,p0,R,R0,kx,Bx]]},Lr,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+e2],n,g),j=Px(d(n[1][1+f0],n),k),R=p(n[1][1+z],n,o);return E===g&&j===k&&R===o?f:[0,E,j,R]},$0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+t0],n,g),j=p(n[1][1+t0],n,k),R=p(n[1][1+z],n,o);return E===g&&j===k&&R===o?f:[0,E,j,R]},b2,function(n,s,f){var o=f[1],k=f[2],g=Q0(n[1][1+$0],n,s,o);return g===o?f:[0,g,k]},xx,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},j1,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},ja,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},Rl,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+z],n,o);return o===g?f:[0,k,g]},zt,function(n,s,f){return p(n[1][1+z],n,f)},_0,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+z],n,o);return o===j?f:[0,E,g,k,j]},q1,function(n,s,f){var o=f[7],k=f[6],g=f[5],E=f[4],j=f[3],R=f[2],H=f[1];return o===p(n[1][1+z],n,o)?f:[0,H,R,j,E,g,k,o]},kt,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},Pa,function(n,s){var f=s[5],o=s[4],k=s[3],g=s[2],E=s[1],j=p(n[1][1+t0],n,E),R=p(n[1][1+t0],n,g),H=p(n[1][1+t0],n,k),p0=p(n[1][1+t0],n,o),R0=p(n[1][1+z],n,f);return E===j&&g===R&&k===H&&o===p0&&f===R0?s:[0,j,R,H,p0,R0]},M0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+Y],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},b,function(n,s){var f=s[3],o=s[2],k=s[1],g=p(n[1][1+F],n,k),E=Px(d(n[1][1+f0],n),o),j=p(n[1][1+z],n,f);return k===g&&Y3(o,E)&&f===j?s:[0,g,E,j]},F,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+I],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+N],n),o,s,function(k){return[1,k]})},I,function(n,s){return p(n[1][1+Rx],n,s)},C,function(n,s){return p(n[1][1+Rx],n,s)},N,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+F],n,k),j=p(n[1][1+C],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},go,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},B,function(n,s){var f=s[3],o=s[2],k=s[4],g=s[1],E=p(n[1][1+t0],n,o),j=p(n[1][1+z],n,f);return o===E&&f===j?s:[0,g,E,j,k]},d0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},y0,function(n,s){var f=s[3],o=s[1],k=s[2],g=fr(d(n[1][1+l0],n),o),E=p(n[1][1+z],n,f);return o===g&&f===E?s:[0,g,k,E]},l0,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return P0(d(n[1][1+t0],n),k,s,function(j){return[0,o,[0,j]]});case 1:var g=f[1];return P0(d(n[1][1+s0],n),g,s,function(j){return[0,o,[1,j]]});default:var E=f[1];return P0(d(n[1][1+n0],n),E,s,function(j){return[0,o,[2,j]]})}},s0,function(n,s){var f=s[3],o=s[2],k=s[4],g=s[1],E=p(n[1][1+t0],n,o),j=p(n[1][1+i],n,f);return E===o&&j===f?s:[0,g,E,j,k]},n0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,f);return k===f?s:[0,o,k]},nd,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+t0],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},h,function(n,s,f){var o=f[2],k=f[1],g=k[3],E=k[2],j=k[1],R=p(n[1][1+t0],n,j),H=p(n[1][1+t0],n,E),p0=fr(d(n[1][1+t0],n),g),R0=p(n[1][1+z],n,o);return R===j&&H===E&&p0===g&&R0===o?f:[0,[0,R,H,p0],R0]},A,function(n,s,f){var o=f[2],k=f[1],g=k[3],E=k[2],j=k[1],R=p(n[1][1+t0],n,j),H=p(n[1][1+t0],n,E),p0=fr(d(n[1][1+t0],n),g),R0=p(n[1][1+z],n,o);return R===j&&H===E&&p0===g&&R0===o?f:[0,[0,R,H,p0],R0]},t0,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return P0(d(n[1][1+z],n),k,s,function(_x){return[0,o,[0,_x]]});case 1:var g=f[1];return P0(d(n[1][1+z],n),g,s,function(_x){return[0,o,[1,_x]]});case 2:var E=f[1];return P0(d(n[1][1+z],n),E,s,function(_x){return[0,o,[2,_x]]});case 3:var j=f[1];return P0(d(n[1][1+z],n),j,s,function(_x){return[0,o,[3,_x]]});case 4:var R=f[1];return P0(d(n[1][1+z],n),R,s,function(_x){return[0,o,[4,_x]]});case 5:var H=f[1];return P0(d(n[1][1+z],n),H,s,function(_x){return[0,o,[5,_x]]});case 6:var p0=f[1];return P0(d(n[1][1+z],n),p0,s,function(_x){return[0,o,[6,_x]]});case 7:var R0=f[1];return P0(d(n[1][1+z],n),R0,s,function(_x){return[0,o,[7,_x]]});case 8:var kx=f[1],Bx=f[2];return P0(d(n[1][1+z],n),Bx,s,function(_x){return[0,o,[8,kx,_x]]});case 9:var zx=f[1];return P0(d(n[1][1+z],n),zx,s,function(_x){return[0,o,[9,_x]]});case 10:var wr=f[1];return P0(d(n[1][1+z],n),wr,s,function(_x){return[0,o,[10,_x]]});case 11:var Jr=f[1];return P0(d(n[1][1+kt],n),Jr,s,function(_x){return[0,o,[11,_x]]});case 12:var Hr=f[1];return D0(d(n[1][1+h2],n),o,Hr,s,function(_x){return[0,o,[12,_x]]});case 13:var Vx=f[1];return D0(d(n[1][1+Hv],n),o,Vx,s,function(_x){return[0,o,[13,_x]]});case 14:var C2=f[1];return D0(d(n[1][1+ix],n),o,C2,s,function(_x){return[0,o,[14,_x]]});case 15:var r1=f[1];return D0(d(n[1][1+D],n),o,r1,s,function(_x){return[0,o,[15,_x]]});case 16:var ne=f[1];return P0(d(n[1][1+nd],n),ne,s,function(_x){return[0,o,[16,_x]]});case 17:var Y1=f[1];return P0(d(n[1][1+Pa],n),Y1,s,function(_x){return[0,o,[17,_x]]});case 18:var ge=f[1];return P0(d(n[1][1+M0],n),ge,s,function(_x){return[0,o,[18,_x]]});case 19:var Fe=f[1];return D0(d(n[1][1+Lr],n),o,Fe,s,function(_x){return[0,o,[19,_x]]});case 20:var we=f[1];return D0(d(n[1][1+$0],n),o,we,s,function(_x){return[0,o,[20,_x]]});case 21:var ue=f[1];return D0(d(n[1][1+b2],n),o,ue,s,function(_x){return[0,o,[21,_x]]});case 22:var _e=f[1];return D0(d(n[1][1+h],n),o,_e,s,function(_x){return[0,o,[22,_x]]});case 23:var ut=f[1];return D0(d(n[1][1+A],n),o,ut,s,function(_x){return[0,o,[23,_x]]});case 24:var be=f[1];return P0(d(n[1][1+b],n),be,s,function(_x){return[0,o,[24,_x]]});case 25:var Ht=f[1];return P0(d(n[1][1+go],n),Ht,s,function(_x){return[0,o,[25,_x]]});case 26:var Ls=f[1];return P0(d(n[1][1+B],n),Ls,s,function(_x){return[0,o,[26,_x]]});case 27:var On=f[1];return P0(d(n[1][1+d0],n),On,s,function(_x){return[0,o,[27,_x]]});case 28:var Ms=f[1];return P0(d(n[1][1+y0],n),Ms,s,function(_x){return[0,o,[28,_x]]});case 29:var Et=f[1];return D0(d(n[1][1+xx],n),o,Et,s,function(_x){return[0,o,[29,_x]]});case 30:var qs=f[1];return D0(d(n[1][1+j1],n),o,qs,s,function(_x){return[0,o,[30,_x]]});case 31:var c3=f[1];return D0(d(n[1][1+ja],n),o,c3,s,function(_x){return[0,o,[31,_x]]});case 32:var s3=f[1];return D0(d(n[1][1+Rl],n),o,s3,s,function(_x){return[0,o,[32,_x]]});case 33:var a3=f[1];return P0(d(n[1][1+z],n),a3,s,function(_x){return[0,o,[33,_x]]});case 34:var o3=f[1];return P0(d(n[1][1+z],n),o3,s,function(_x){return[0,o,[34,_x]]});default:var Oa=f[1];return P0(d(n[1][1+z],n),Oa,s,function(_x){return[0,o,[35,_x]]})}},Z,function(n,s){var f=s[1],o=s[2];return P0(d(n[1][1+t0],n),o,s,function(k){return[0,f,k]})},a0,function(n,s){if(s[0]===0)return s;var f=s[1];return P0(d(n[1][1+Z],n),f,s,function(o){return[1,o]})},Io,function(n,s){if(s[0]===0)return s;var f=s[2],o=s[1],k=p(n[1][1+B],n,f);return k===f?s:[1,o,k]},f2,function(n,s,f){return Q0(n[1][1+ee],n,s,f)},o2,function(n,s,f){return Q0(n[1][1+n2],n,s,f)},n2,function(n,s,f){return Q0(n[1][1+ee],n,s,f)},ee,function(n,s,f){var o=f[10],k=f[9],g=f[8],E=f[7],j=f[3],R=f[2],H=f[1],p0=f[11],R0=f[6],kx=f[5],Bx=f[4],zx=Px(d(n[1][1+Mr],n),H),wr=Px(d(n[1][1+M],n),k),Jr=p(n[1][1+a2],n,R),Hr=p(n[1][1+t2],n,g),Vx=p(n[1][1+N2],n,j),C2=Px(d(n[1][1+Kx],n),E),r1=p(n[1][1+z],n,o);return H===zx&&R===Jr&&j===Vx&&E===C2&&g===Hr&&k===wr&&o===r1?f:[0,zx,Jr,Vx,Bx,kx,R0,C2,Hr,wr,r1,p0]},a2,function(n,s){var f=s[2],o=f[4],k=f[3],g=f[2],E=f[1],j=s[1],R=fr(d(n[1][1+z2],n),g),H=Px(d(n[1][1+Sr],n),k),p0=Px(d(n[1][1+d2],n),E),R0=p(n[1][1+z],n,o);return g===R&&k===H&&o===R0&&E===p0?s:[0,j,[0,p0,R,H,R0]]},d2,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Z],n,k),j=p(n[1][1+z],n,o);return E===k&&j===o?s:[0,g,[0,E,j]]},z2,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Qr],n,k),j=p(n[1][1+Tt],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},t2,function(n,s){switch(s[0]){case 0:return s;case 1:var f=s[1];return P0(d(n[1][1+Z],n),f,s,function(k){return[1,k]});default:var o=s[1];return P0(d(n[1][1+u0],n),o,s,function(k){return[2,k]})}},N2,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+he],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+rd],n),o,s,function(k){return[1,k]})},he,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+Qt],n),f,o,s,function(k){return[0,f,k]})},rd,function(n,s){return p(n[1][1+Ax],n,s)},Mr,function(n,s){return Q0(n[1][1+O0],n,w$,s)},Rx,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+z],n,o);return o===E?s:[0,g,[0,k,E]]},K,function(n,s){return p(n[1][1+Rx],n,s)},q,function(n,s){return p(n[1][1+K],n,s)},jn,function(n,s){return p(n[1][1+K],n,s)},k0,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=p(n[1][1+jn],n,j),H=Px(d(n[1][1+M],n),E),p0=d(n[1][1+Lr],n),R0=fr(function(zx){return W2(p0,zx)},g),kx=W2(d(n[1][1+ix],n),k),Bx=p(n[1][1+z],n,o);return R===j&&H===E&&R0===g&&kx===k&&Bx===o?f:[0,R,H,R0,kx,Bx]},c0,function(n,s,f){return Q0(n[1][1+k0],n,s,f)},E0,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+z],n,o);return o===E?s:[0,g,[0,k,E]]},$v,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},ar,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},yr,function(n,s,f){return p(n[1][1+F0],n,f)},Cr,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+F0],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},er,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+U],n,E),R=Q0(n[1][1+yr],n,k!==0?1:0,g),H=d(n[1][1+Cr],n),p0=Px(function(kx){return W2(H,kx)},k),R0=p(n[1][1+z],n,o);return E===j&&g===R&&k===p0&&o===R0?f:[0,j,R,p0,R0]},xr,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=W2(d(n[1][1+Nx],n),E),H=Px(p(n[1][1+lx],n,j),k),p0=Px(function(kx){var Bx=kx[1],zx=kx[2],wr=Q0(n[1][1+Jx],n,j,Bx);return wr===Bx?kx:[0,wr,zx]},g),R0=p(n[1][1+z],n,o);return E===R&&k===H&&g===p0&&o===R0?f:[0,j,R,p0,H,R0]},Nx,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+z],n,o);return o===E?f:[0,g,k,E]},lx,function(n,s,f){if(f[0]===0){var o=f[1],k=fr(p(n[1][1+ur],n,s),o);return o===k?f:[0,k]}var g=f[1],E=g[1],j=g[2];return D0(p(n[1][1+Fx],n,s),E,j,f,function(R){return[1,[0,E,R]]})},h0,function(n,s){return p(n[1][1+Rx],n,s)},ur,function(n,s,f){var o=f[3],k=f[2],g=f[1];x:{r:{var E=f[4];if(s){e:{if(g)switch(g[1]){case 0:break r;case 1:break e}if(2<=s){var j=0,R=0;break x}}var j=1,R=0;break x}}var j=1,R=1}var H=k?p(n[1][1+h0],n,o):R?p(n[1][1+jn],n,o):Q0(n[1][1+O0],n,_$,o);if(k)var p0=k[1],R0=j?d(n[1][1+jn],n):p(n[1][1+O0],n,b$),kx=P0(R0,p0,k,function(Bx){return[0,Bx]});else var kx=0;return k===kx&&o===H?f:[0,g,kx,H,E]},Jx,function(n,s,f){var o=2<=s?p(n[1][1+O0],n,T$):d(n[1][1+jn],n);return d(o,f)},Fx,function(n,s,f,o){var k=2<=s?p(n[1][1+O0],n,E$):d(n[1][1+jn],n);return d(k,o)},To,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+Yv],n,E),R=Px(d(n[1][1+S4],n),g),H=p(n[1][1+A4],n,k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},E4,function(n,s,f){var o=f[4],k=f[3],g=p(n[1][1+A4],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,f[1],f[2],g,E]},Yv,function(n,s){var f=s[2],o=f[4],k=f[2],g=f[1],E=f[3],j=s[1],R=p(n[1][1+Tl],n,g),H=Px(d(n[1][1+Ro],n),k),p0=fr(d(n[1][1+wo],n),o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,H,E,p0]]},S4,function(n,s){var f=s[2][1],o=s[1],k=p(n[1][1+Tl],n,f);return f===k?s:[0,o,[0,k]]},wo,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+X],n),f,s,function(E){return[0,E]})}var o=s[1],k=o[1],g=o[2];return D0(d(n[1][1+Xv],n),k,g,s,function(E){return[1,[0,k,E]]})},Xv,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},X,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+El],n,k),j=Px(d(n[1][1+P4],n),o);return k===E&&o===j?s:[0,g,[0,E,j]]},El,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+N4],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+I4],n),o,s,function(k){return[1,k]})},N4,function(n,s){return p(n[1][1+ht],n,s)},I4,function(n,s){return p(n[1][1+_o],n,s)},P4,function(n,s){if(s[0]===0){var f=s[1],o=f[1],k=f[2];return D0(d(n[1][1+Hh],n),o,k,s,function(R){return[0,[0,o,R]]})}var g=s[1],E=g[1],j=g[2];return D0(d(n[1][1+Zh],n),E,j,s,function(R){return[1,[0,E,R]]})},Zh,function(n,s,f){return Q0(n[1][1+Aa],n,s,f)},Hh,function(n,s,f){return Q0(n[1][1+xx],n,s,f)},A4,function(n,s){var f=s[2],o=s[1],k=fr(d(n[1][1+Qh],n),f);return f===k?s:[0,o,k]},Qh,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return D0(d(n[1][1+To],n),o,k,s,function(R){return[0,o,[0,R]]});case 1:var g=f[1];return D0(d(n[1][1+E4],n),o,g,s,function(R){return[0,o,[1,R]]});case 2:var E=f[1];return D0(d(n[1][1+Aa],n),o,E,s,function(R){return[0,o,[2,R]]});case 3:var j=f[1];return P0(d(n[1][1+wl],n),j,s,function(R){return[0,o,[3,R]]});default:return s}},Aa,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+z],n,o);if(!k)return o===g?f:[0,0,g];var E=k[1],j=p(n[1][1+Ax],n,E);return E===j&&o===g?f:[0,[0,j],g]},wl,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+Ax],n,o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},Tl,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+bl],n),f,s,function(g){return[0,g]});case 1:var o=s[1];return P0(d(n[1][1+$h],n),o,s,function(g){return[1,g]});default:var k=s[1];return P0(d(n[1][1+zv],n),k,s,function(g){return[2,g]})}},bl,function(n,s){return p(n[1][1+ht],n,s)},$h,function(n,s){return p(n[1][1+_o],n,s)},zv,function(n,s){return p(n[1][1+_l],n,s)},_o,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+ht],n,k),j=p(n[1][1+ht],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},_l,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Sa],n,k),j=p(n[1][1+ht],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},Sa,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+bo],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+_l],n),o,s,function(k){return[1,k]})},bo,function(n,s){return p(n[1][1+bl],n,s)},ht,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+z],n,o);return o===E?s:[0,g,[0,k,E]]},yo,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ps],n,g),j=p(n[1][1+F0],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},ho,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Ax],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,f[1],E,j,R]},me,function(n,s,f){var o=f[5],k=f[2],g=f[1],E=f[4],j=f[3],R=p(n[1][1+Ax],n,g),H=fr(d(n[1][1+mo],n),k),p0=p(n[1][1+z],n,o);return g===R&&k===H&&o===p0?f:[0,R,H,j,E,p0]},mo,function(n,s){var f=s[2],o=f[4],k=f[3],g=f[2],E=f[1],j=s[1],R=p(n[1][1+Kt],n,E),H=p(n[1][1+Ax],n,g),p0=Px(d(n[1][1+Ax],n),k),R0=p(n[1][1+z],n,o);return E===R&&g===H&&k===p0&&o===R0?s:[0,j,[0,E,g,p0,R0]]},As,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=fr(d(n[1][1+lo],n),k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},lo,function(n,s){var f=s[2],o=f[4],k=f[3],g=f[2],E=f[1],j=s[1],R=p(n[1][1+Kt],n,E),H=W2(d(n[1][1+Qt],n),g),p0=Px(d(n[1][1+Ax],n),k),R0=p(n[1][1+z],n,o);return E===R&&g===H&&k===p0&&o===R0?s:[0,j,[0,E,g,p0,R0]]},Kt,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[1];return P0(d(n[1][1+z],n),k,s,function(Vx){return[0,o,[0,Vx]]});case 1:var g=f[1];return D0(d(n[1][1+j1],n),o,g,s,function(Vx){return[0,o,[1,Vx]]});case 2:var E=f[1];return D0(d(n[1][1+ja],n),o,E,s,function(Vx){return[0,o,[2,Vx]]});case 3:var j=f[1];return D0(d(n[1][1+xx],n),o,j,s,function(Vx){return[0,o,[3,Vx]]});case 4:var R=f[1];return D0(d(n[1][1+Rl],n),o,R,s,function(Vx){return[0,o,[4,Vx]]});case 5:var H=f[1];return P0(d(n[1][1+z],n),H,s,function(Vx){return[0,o,[5,Vx]]});case 6:var p0=f[1];return P0(d(n[1][1+dr],n),p0,s,function(Vx){return[0,o,[6,Vx]]});case 7:var R0=f[1];return D0(d(n[1][1+Q2],n),o,R0,s,function(Vx){return[0,o,[7,Vx]]});case 8:var kx=f[1];return P0(d(n[1][1+Rx],n),kx,s,function(Vx){return[0,o,[8,Vx]]});case 9:var Bx=f[1];return P0(d(n[1][1+Ta],n),Bx,s,function(Vx){return[0,o,[9,Vx]]});case 10:var zx=f[1];return P0(d(n[1][1+ko],n),zx,s,function(Vx){return[0,o,[10,Vx]]});case 11:var wr=f[1];return P0(d(n[1][1+Pn],n),wr,s,function(Vx){return[0,o,[11,Vx]]});case 12:var Jr=f[1];return P0(d(n[1][1+An],n),Jr,s,function(Vx){return[0,o,[12,Vx]]});default:var Hr=f[1];return P0(d(n[1][1+Ea],n),Hr,s,function(Vx){return[0,o,[13,Vx]]})}},dr,function(n,s){var f=s[3],o=s[2],k=o[1],g=s[1],E=o[2],j=D0(d(n[1][1+mt],n),k,E,o,function(H){return[0,k,H]}),R=p(n[1][1+z],n,f);return o===j&&f===R?s:[0,g,j,R]},mt,function(n,s,f){if(f[0]===0){var o=f[1];return D0(d(n[1][1+j1],n),s,o,f,function(g){return[0,g]})}var k=f[1];return D0(d(n[1][1+ja],n),s,k,f,function(g){return[1,g]})},Ta,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=s[1],j=p(n[1][1+ba],n,g),R=p(n[1][1+_a],n,k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?s:[0,E,[0,j,R,H]]},ba,function(n,s){if(s[0]===0){var f=s[1];return P0(d(n[1][1+Rx],n),f,s,function(k){return[0,k]})}var o=s[1];return P0(d(n[1][1+Ta],n),o,s,function(k){return[1,k]})},_a,function(n,s){switch(s[0]){case 0:var f=s[1],o=f[1],k=f[2];return D0(d(n[1][1+xx],n),o,k,s,function(H){return[0,[0,o,H]]});case 1:var g=s[1],E=g[1],j=g[2];return D0(d(n[1][1+j1],n),E,j,s,function(H){return[1,[0,E,H]]});default:var R=s[1];return P0(d(n[1][1+Rx],n),R,s,function(H){return[2,H]})}},Q2,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=Q0(n[1][1+O0],n,[0,g],k),j=p(n[1][1+z],n,o);return k===E&&o===j?f:[0,g,E,j]},ko,function(n,s){var f=s[3],o=s[2],k=s[1],g=fr(d(n[1][1+po],n),k),E=$6(d(n[1][1+ga],n),o),j=p(n[1][1+z],n,f);return k===g&&o===E&&f===j?s:[0,g,E,j]},po,function(n,s){var f=s[2],o=f[4],k=f[2],g=f[1],E=f[3],j=s[1],R=p(n[1][1+wa],n,g),H=p(n[1][1+Kt],n,k),p0=p(n[1][1+z],n,o);return g===R&&k===H&&o===p0?s:[0,j,[0,R,H,E,p0]]},wa,function(n,s){switch(s[0]){case 0:var f=s[1],o=f[1],k=f[2];return D0(d(n[1][1+xx],n),o,k,s,function(H){return[0,[0,o,H]]});case 1:var g=s[1],E=g[1],j=g[2];return D0(d(n[1][1+j1],n),E,j,s,function(H){return[1,[0,E,H]]});default:var R=s[1];return P0(d(n[1][1+Rx],n),R,s,function(H){return[2,H]})}},Pn,function(n,s){var f=s[3],o=s[2],k=s[1],g=fr(d(n[1][1+Uv],n),k),E=$6(d(n[1][1+ga],n),o),j=p(n[1][1+z],n,f);return k===g&&o===E&&f===j?s:[0,g,E,j]},Uv,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+Kt],n,f);return f===k?s:[0,o,k]},ga,function(n,s,f){var o=f[2],k=f[1],g=$6(d(n[1][1+Q2],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},An,function(n,s){var f=s[2],o=s[1],k=fr(d(n[1][1+Kt],n),o),g=p(n[1][1+z],n,f);return o===k&&f===g?s:[0,k,g]},Ea,function(n,s){var f=s[3],o=s[2],k=s[1],g=p(n[1][1+Kt],n,k);if(o[0]===0)var E=o[1],H=P0(p(n[1][1+O0],n,S$),E,o,function(R0){return[0,R0]});else var j=o[1],R=o[2],H=D0(d(n[1][1+Q2],n),j,R,o,function(R0){return[1,j,R0]});var p0=p(n[1][1+z],n,f);return k===g&&o===H&&f===p0?s:[0,g,H,p0]},vo,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+ke],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},s2,function(n,s,f){var o=f[1],k=Q0(n[1][1+vo],n,s,o);return o===k?f:[0,k,f[2],f[3]]},ke,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+Sn],n),f,s,function(g){return[0,g]});case 1:var o=s[1];return P0(d(n[1][1+Qe],n),o,s,function(g){return[1,g]});default:var k=s[1];return P0(d(n[1][1+Ss],n),k,s,function(g){return[2,g]})}},Sn,function(n,s){return p(n[1][1+Rx],n,s)},Qe,function(n,s){return p(n[1][1+E0],n,s)},Ss,function(n,s){return p(n[1][1+Ax],n,s)},T2,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Rx],n,g),j=p(n[1][1+Rx],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},O1,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+Ax],n,E),R=Px(d(n[1][1+Ro],n),g),H=Px(d(n[1][1+Ml],n),k),p0=p(n[1][1+z],n,o);return E===j&&g===R&&k===H&&o===p0?f:[0,j,R,H,p0]},pe,function(n,s,f){var o=f[2],k=f[1],g=fr(function(j){if(j[0]===0){var R=j[1],H=p(n[1][1+Or],n,R);return R===H?j:[0,H]}var p0=j[1],R0=p(n[1][1+px],n,p0);return p0===R0?j:[1,R0]},k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},Or,function(n,s){var f=s[2],o=s[1];switch(f[0]){case 0:var k=f[3],g=f[2],E=f[1],j=p(n[1][1+Sx],n,E),R=p(n[1][1+Ax],n,g);x:if(k){if(j[0]===3){var H=R[2];if(H[0]===10){var R0=_r(j[1][2][1],H[1][2][1]);break x}}var p0=E===j?1:0,R0=p0&&(g===R?1:0)}else var R0=k;return E===j&&g===R&&k===R0?s:[0,o,[0,j,R,R0]];case 1:var kx=f[2],Bx=f[1],zx=p(n[1][1+Sx],n,Bx),wr=W2(d(n[1][1+n2],n),kx);return Bx===zx&&kx===wr?s:[0,o,[1,zx,wr]];case 2:var Jr=f[3],Hr=f[2],Vx=f[1],C2=p(n[1][1+Sx],n,Vx),r1=W2(d(n[1][1+n2],n),Hr),ne=p(n[1][1+z],n,Jr);return Vx===C2&&Hr===r1&&Jr===ne?s:[0,o,[2,C2,r1,ne]];default:var Y1=f[3],ge=f[2],Fe=f[1],we=p(n[1][1+Sx],n,Fe),ue=W2(d(n[1][1+n2],n),ge),_e=p(n[1][1+z],n,Y1);return Fe===we&&ge===ue&&Y1===_e?s:[0,o,[3,we,ue,_e]]}},Sx,function(n,s){switch(s[0]){case 0:var f=s[1];return P0(d(n[1][1+x2],n),f,s,function(R){return[0,R]});case 1:var o=s[1];return P0(d(n[1][1+hr],n),o,s,function(R){return[1,R]});case 2:var k=s[1];return P0(d(n[1][1+sx],n),k,s,function(R){return[2,R]});case 3:var g=s[1];return P0(d(n[1][1+Dr],n),g,s,function(R){return[3,R]});case 4:var E=s[1];return P0(d(n[1][1+E0],n),E,s,function(R){return[4,R]});default:var j=s[1];return P0(d(n[1][1+r2],n),j,s,function(R){return[5,R]})}},x2,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+xx],n),f,o,s,function(k){return[0,f,k]})},hr,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+j1],n),f,o,s,function(k){return[0,f,k]})},sx,function(n,s){var f=s[1],o=s[2];return D0(d(n[1][1+ja],n),f,o,s,function(k){return[0,f,k]})},Dr,function(n,s){return p(n[1][1+Rx],n,s)},r2,function(n,s){return p(n[1][1+$v],n,s)},F2,function(n,s,f){var o=f[5],k=f[4],g=f[3],E=f[2],j=f[1],R=p(n[1][1+jn],n,j),H=Px(d(n[1][1+M],n),E),p0=Px(d(n[1][1+t0],n),g),R0=Px(d(n[1][1+t0],n),k),kx=p(n[1][1+z],n,o);return j===R&&g===p0&&E===H&&g===p0&&k===R0&&o===kx?f:[0,R,H,p0,R0,kx]},Qr,function(n,s){return Q0(n[1][1+Lo],n,A$,s)},v,function(n,s,f){return Q0(n[1][1+Lo],n,[0,s],f)},jl,function(n,s){return Q0(n[1][1+Lo],n,P$,s)},xt,function(n,s){return p(n[1][1+Ll],n,s)},dt,function(n,s){return p(n[1][1+Ll],n,s)},Lo,function(n,s,f){var o=s?s[1]:0;return Q0(n[1][1+Nr],n,[0,o],f)},Ll,function(n,s){return Q0(n[1][1+Nr],n,0,s)},Nr,function(n,s,f){var o=f[2],k=f[1];switch(o[0]){case 0:var g=o[1],E=g[3],j=g[2],R=g[1],H=fr(p(n[1][1+Ex],n,s),R),p0=p(n[1][1+a0],n,j),R0=p(n[1][1+z],n,E);x:{if(H===R&&p0===j&&R0===E){var kx=o;break x}var kx=[0,[0,H,p0,R0]]}var be=kx;break;case 1:var Bx=o[1],zx=Bx[3],wr=Bx[2],Jr=Bx[1],Hr=fr(p(n[1][1+gr],n,s),Jr),Vx=p(n[1][1+a0],n,wr),C2=p(n[1][1+z],n,zx);x:{if(zx===C2&&Hr===Jr&&Vx===wr){var r1=o;break x}var r1=[1,[0,Hr,Vx,C2]]}var be=r1;break;case 2:var ne=o[1],Y1=ne[2],ge=ne[1],Fe=ne[3],we=Q0(n[1][1+O0],n,s,ge),ue=p(n[1][1+a0],n,Y1);x:{if(ge===we&&Y1===ue){var _e=o;break x}var _e=[2,[0,we,ue,Fe]]}var be=_e;break;default:var ut=o[1],be=P0(d(n[1][1+Wx],n),ut,o,function(Ht){return[3,Ht]})}return o===be?f:[0,k,be]},O0,function(n,s,f){return p(n[1][1+Rx],n,f)},Ix,function(n,s,f,o){return Q0(n[1][1+xx],n,f,o)},qx,function(n,s,f,o){return Q0(n[1][1+j1],n,f,o)},Yx,function(n,s,f,o){return Q0(n[1][1+ja],n,f,o)},Ex,function(n,s,f){if(f[0]===0){var o=f[1];return P0(p(n[1][1+Dx],n,s),o,f,function(g){return[0,g]})}var k=f[1];return P0(p(n[1][1+Kr],n,s),k,f,function(g){return[1,g]})},Dx,function(n,s,f){var o=f[2],k=o[4],g=o[3],E=o[2],j=o[1],R=f[1],H=Q0(n[1][1+yx],n,s,j),p0=Q0(n[1][1+G],n,s,E),R0=p(n[1][1+Tt],n,g);x:if(k){if(H[0]===3){var kx=p0[2];if(kx[0]===2){var zx=_r(H[1][2][1],kx[1][1][2][1]);break x}}var Bx=j===H?1:0,zx=Bx&&(E===p0?1:0)}else var zx=k;return H===j&&p0===E&&R0===g&&k===zx?f:[0,R,[0,H,p0,R0,zx]]},yx,function(n,s,f){switch(f[0]){case 0:var o=f[1];return P0(p(n[1][1+S],n,s),o,f,function(R){return[0,R]});case 1:var k=f[1];return P0(p(n[1][1+Z0],n,s),k,f,function(R){return[1,R]});case 2:var g=f[1];return P0(p(n[1][1+m0],n,s),g,f,function(R){return[2,R]});case 3:var E=f[1];return P0(p(n[1][1+Tx],n,s),E,f,function(R){return[3,R]});default:var j=f[1];return P0(p(n[1][1+ex],n,s),j,f,function(R){return[4,R]})}},S,function(n,s,f){var o=f[1],k=f[2];return D0(p(n[1][1+Ix],n,s),o,k,f,function(g){return[0,o,g]})},Z0,function(n,s,f){var o=f[1],k=f[2];return D0(p(n[1][1+qx],n,s),o,k,f,function(g){return[0,o,g]})},m0,function(n,s,f){var o=f[1],k=f[2];return D0(p(n[1][1+Yx],n,s),o,k,f,function(g){return[0,o,g]})},Tx,function(n,s,f){return Q0(n[1][1+O0],n,s,f)},ex,function(n,s,f){return p(n[1][1+$v],n,f)},Kr,function(n,s,f){var o=f[2],k=o[2],g=o[1],E=f[1],j=Q0(n[1][1+z0],n,s,g),R=p(n[1][1+z],n,k);return j===g&&k===R?f:[0,E,[0,j,R]]},G,function(n,s,f){return Q0(n[1][1+Nr],n,s,f)},z0,function(n,s,f){return Q0(n[1][1+Nr],n,s,f)},gr,function(n,s,f){switch(f[0]){case 0:var o=f[1];return P0(p(n[1][1+nr],n,s),o,f,function(g){return[0,g]});case 1:var k=f[1];return P0(p(n[1][1+Qx],n,s),k,f,function(g){return[1,g]});default:return f}},nr,function(n,s,f){var o=f[2],k=o[2],g=o[1],E=f[1],j=Q0(n[1][1+vx],n,s,g),R=p(n[1][1+Tt],n,k);return g===j&&k===R?f:[0,E,[0,j,R]]},vx,function(n,s,f){return Q0(n[1][1+Nr],n,s,f)},Qx,function(n,s,f){var o=f[2],k=o[2],g=o[1],E=f[1],j=Q0(n[1][1+fx],n,s,g),R=p(n[1][1+z],n,k);return j===g&&k===R?f:[0,E,[0,j,R]]},fx,function(n,s,f){return Q0(n[1][1+Nr],n,s,f)},Wx,function(n,s){return p(n[1][1+Ax],n,s)},Kx,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1];if(k)var E=k[1],j=P0(d(n[1][1+Ax],n),E,k,function(H){return[0,H]});else var j=k;var R=p(n[1][1+z],n,o);return k===j&&o===R?s:[0,g,[0,j,R]]},U,function(n,s){return p(n[1][1+Ax],n,s)},u0,function(n,s){var f=s[2],o=s[1],k=p(n[1][1+Q],n,f);return Y3(k,f)?s:[0,o,k]},Q,function(n,s){var f=s[2],o=f[3],k=f[2],g=k[2],E=k[1],j=f[1],R=s[1],H=p(n[1][1+Rx],n,E),p0=Px(d(n[1][1+t0],n),g),R0=p(n[1][1+z],n,o);return H===E&&p0===g&&R0===o?s:[0,R,[0,j,[0,H,p0],R0]]},Sr,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Qr],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},g0,function(n,s,f){var o=f[2],k=f[1],g=f[3],E=Px(d(n[1][1+Ax],n),k),j=p(n[1][1+z],n,o);return k===E&&o===j?f:[0,E,j,g]},W,function(n,s,f){var o=f[2],k=f[1],g=fr(d(n[1][1+Ax],n),k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},j0,function(n,s){return p(n[1][1+nx],n,s)},nx,function(n,s){var f=d(n[1][1+mx],n),o=m1(function(g,E){var j=g[2],R=g[1],H=d(f,E);if(!H)return[0,R,1];if(H[2])return[0,G3(H,R),1];var p0=H[1],R0=j||(E!==p0?1:0);return[0,[0,p0,R],R0]},I$,s),k=o[1];return o[2]?tx(k):s},mx,function(n,s){return[0,p(n[1][1+F0],n,s),0]},dx,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},px,function(n,s){var f=s[2],o=f[2],k=f[1],g=s[1],E=p(n[1][1+Ax],n,k),j=p(n[1][1+z],n,o);return k===E&&o===j?s:[0,g,[0,E,j]]},rx,function(n,s,f){var o=f[1],k=p(n[1][1+z],n,o);return o===k?f:[0,k]},N0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=f[4],j=p(n[1][1+Ax],n,g),R=fr(d(n[1][1+V0],n),k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?f:[0,j,R,H,E]},V0,function(n,s){var f=s[2],o=f[3],k=f[2],g=f[1],E=s[1],j=Px(d(n[1][1+Ax],n),g),R=p(n[1][1+nx],n,k),H=p(n[1][1+z],n,o);return g===j&&k===R&&o===H?s:[0,E,[0,j,R,H]]},b0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=W2(d(n[1][1+J0],n),k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},J0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=fr(d(n[1][1+A0],n),g),j=fr(d(n[1][1+Ax],n),k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},A0,function(n,s){return s},W0,function(n,s,f){var o=f[1],k=p(n[1][1+z],n,o);return o===k?f:[0,k]},S0,function(n,s,f){var o=f[2],k=f[1],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,g,E]},L0,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=W2(d(n[1][1+Qt],n),E);if(g)var R=g[1],H=R[1],p0=R[2],R0=D0(d(n[1][1+Ol],n),H,p0,g,function(Hr){return[0,[0,H,Hr]]});else var R0=g;if(k)var kx=k[1],Bx=kx[1],zx=kx[2],wr=D0(d(n[1][1+Qt],n),Bx,zx,k,function(Hr){return[0,[0,Bx,Hr]]});else var wr=k;var Jr=p(n[1][1+z],n,o);return E===j&&g===R0&&k===wr&&o===Jr?f:[0,j,R0,wr,Jr]},e0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Z],n,k),R=p(n[1][1+z],n,o);return E===g&&j===k&&R===o?f:[0,E,j,R]},w0,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+Z],n,k),R=p(n[1][1+z],n,o);return E===g&&Y3(j,k)&&R===o?f:[0,E,j,R]},T,function(n,s,f){var o=f[3],k=f[2],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,f[1],g,E]},m,function(n,s,f){var o=f[4],k=f[2],g=p(n[1][1+Ax],n,k),E=p(n[1][1+z],n,o);return k===g&&o===E?f:[0,f[1],g,f[3],E]},l,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=fr(p(n[1][1+a],n,k),g),j=p(n[1][1+z],n,o);return g===E&&o===j?f:[0,E,k,j]},a,function(n,s,f){var o=f[2],k=o[2],g=o[1],E=f[1],j=Q0(n[1][1+v],n,s,g),R=Px(d(n[1][1+Ax],n),k);return g===j&&k===R?f:[0,E,[0,j,R]]},u,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+U],n,g),j=p(n[1][1+F0],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},t,function(n,s,f){var o=f[3],k=f[2],g=f[1],E=p(n[1][1+Ax],n,g),j=p(n[1][1+F0],n,k),R=p(n[1][1+z],n,o);return g===E&&k===j&&o===R?f:[0,E,j,R]},v0,function(n,s,f){var o=f[4],k=f[3],g=f[2],E=f[1],j=p(n[1][1+jn],n,E),R=Px(d(n[1][1+M],n),g),H=p(n[1][1+t0],n,k),p0=p(n[1][1+z],n,o);return E===j&&k===H&&g===R&&o===p0?f:[0,j,R,H,p0]},e,function(n,s,f){var o=f[2],k=f[1],g=f[4],E=f[3],j=Px(d(n[1][1+Ax],n),k),R=p(n[1][1+z],n,o);return o===R&&k===j?f:[0,j,R,E,g]}]),function(n,s){return E5(s,x)}}),BC=[];function _B(x,r,e){var t=e[2];switch(t[0]){case 0:var u=t[1][1];return m1(d(BC[1],x),r,u);case 1:var i=t[1][1];return m1(d(BC[2],x),r,i);case 2:return p(x,r,t[1][1]);default:return r}}Rr(BC,[0,function(x,r){return function(e){var t=e[0]===0?e[1][2][2]:e[1][2][1];return _B(x,r,t)}},function(x,r){return function(e){return e[0]===2?r:_B(x,r,e[1][2][1])}}]);var UC=[];function bB(x){var r=x[2];switch(r[0]){case 0:return W3(UC[1],r[1][1]);case 1:return W3(UC[2],r[1][1]);case 2:return 1;default:return 0}}Rr(UC,[0,function(x){var r=x[0]===0?x[1][2][2]:x[1][2][1];return bB(r)},function(x){return x[0]===2?0:bB(x[1][2][1])}]);var C5=[];function XC(x){var r=x[2];switch(r[0]){case 7:return 1;case 10:var e=r[1],t=e[1],u=d(C5[2],e[2]);return u||W3(C5[1],t);case 11:var i=r[1],c=i[1],v=d(C5[2],i[2]);return v||W3(function(a){return XC(a[2])},c);case 12:return W3(XC,r[1][1]);case 13:return 1;default:return 0}}Rr(C5,[0,function(x){return XC(x[2][2])},function(x){return x&&x[1][2][1]?1:0}]);function YC(x){switch(x){case 0:return mQ;case 1:return hQ;default:return dQ}}function gn(x,r){return[0,r[1],[0,r[2],x]]}function TB(x,r,e){var t=x?x[1]:0,u=r?r[1]:0;return[0,t,u,e]}function x0(x,r,e){var t=x?x[1]:0,u=r?r[1]:0;return!t&&!u?0:[0,TB([0,t],[0,u],0)]}function j2(x,r,e,t){var u=x?x[1]:0,i=r?r[1]:0;return!u&&!i&&!e?0:[0,TB([0,u],[0,i],e)]}function A1(x,r){if(x){if(r){var e=r[1],t=x[1],u=[0,Lx(t[2],e[2])];return x0([0,Lx(e[1],t[1])],u,O)}var i=x}else var i=r;return i}function j5(x,r){if(!r)return x;if(x){var e=r[1],t=x[1],u=e[1],i=t[3],c=t[1],v=[0,Lx(t[2],e[2])];return j2([0,Lx(u,c)],v,i,O)}var a=r[1];return j2([0,a[1]],[0,a[2]],0,O)}function EB(x,r){s1(x)(yQ),d(s1(x)(wQ),gQ);var e=r[1];d(s1(x)(_Q),e),s1(x)(bQ),s1(x)(TQ),d(s1(x)(SQ),EQ);var t=r[2];return d(s1(x)(AQ),t),s1(x)(PQ),s1(x)(IQ)}Rr([],[0,EB,EB,function(x,r){switch(r[0]){case 0:var e=r[1];return s1(x)(n$),d(s1(x)(u$),e),s1(x)(i$);case 1:var t=r[1];return s1(x)(f$),d(s1(x)(c$),t),s1(x)(s$);case 2:var u=r[1];return s1(x)(a$),d(s1(x)(o$),u),s1(x)(v$);default:var i=r[1];return s1(x)(l$),d(s1(x)(p$),i),s1(x)(k$)}}]);function Vr(x,r){return[0,x[1],x[2],r[3]]}function va(x,r){var e=x[1]-r[1]|0;return e===0?x[2]-r[2]|0:e}function SB(x,r){var e=r[1],t=x[1];if(t){var u=t[1];if(e)var i=e[1],c=wB(i),v=wB(u)-c|0,a=v===0?ux(u[1],i[1]):v;else var a=-1}else var a=e?1:0;if(a!==0)return a;var l=va(x[2],r[2]);return l===0?va(x[3],r[3]):l}function Za(x,r){return SB(x,r)===0?1:0}var mr=[];Rr(mr,[0,function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r){switch(x){case 0:if(!r)return 0;break;case 1:if(r===1)return 0;break;case 2:if(r===2)return 0;break;case 3:if(r===3)return 0;break;default:if(4<=r)return 0}function e(u){switch(u){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;default:return 4}}var t=e(r);return Je(e(x),t)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return Je(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)},function(x,r,e){return ux(r,e)}]);var AB=U00.slice();function zC(x){for(var r=0,e=AB.length-1-1|0;;){if(ex)return 1;var r=t+1|0}}}var PB=0;function IB(x){var r=x[2];return[0,x[1],[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]],x[3],x[4],x[5],x[6],x[7]]}function NB(x){return x[3][1]}function O5(x,r){return x!==r[4]?[0,r[1],r[2],r[3],x,r[5],r[6],r[7]]:r}var Ve=[];function CB(x,r){if(typeof x=="number"){var e=x;if(67<=e)if(se<=e)switch(e){case 101:if(typeof r=="number"&&se===r)return 1;break;case 102:if(typeof r=="number"&&cn===r)return 1;break;case 103:if(typeof r=="number"&&F1===r)return 1;break;case 104:if(typeof r=="number"&&ft===r)return 1;break;case 105:if(typeof r=="number"&&Pt===r)return 1;break;case 106:if(typeof r=="number"&&vn===r)return 1;break;case 107:if(typeof r=="number"&&K2===r)return 1;break;case 108:if(typeof r=="number"&&Hs===r)return 1;break;case 109:if(typeof r=="number"&&Vn===r)return 1;break;case 110:if(typeof r=="number"&&w1===r)return 1;break;case 111:if(typeof r=="number"&&G1===r)return 1;break;case 112:if(typeof r=="number"&&Qs===r)return 1;break;case 113:if(typeof r=="number"&&J1===r)return 1;break;case 114:if(typeof r=="number"&&kr===r)return 1;break;case 115:if(typeof r=="number"&&iv===r)return 1;break;case 116:if(typeof r=="number"&&av===r)return 1;break;case 117:if(typeof r=="number"&&F3===r)return 1;break;case 118:if(typeof r=="number"&&f6===r)return 1;break;case 119:if(typeof r=="number"&&h3===r)return 1;break;case 120:if(typeof r=="number"&&mf===r)return 1;break;case 121:if(typeof r=="number"&&y6===r)return 1;break;case 122:if(typeof r=="number"&&c2===r)return 1;break;case 123:if(typeof r=="number"&&en===r)return 1;break;case 124:if(typeof r=="number"&&P3===r)return 1;break;case 125:if(typeof r=="number"&&qa===r)return 1;break;case 126:if(typeof r=="number"&&Ik===r)return 1;break;case 127:if(typeof r=="number"&&Xr===r)return 1;break;case 128:if(typeof r=="number"&&M2===r)return 1;break;case 129:if(typeof r=="number"&&Ko===r)return 1;break;case 130:if(typeof r=="number"&&w6===r)return 1;break;case 131:if(typeof r=="number"&&u6===r)return 1;break;case 132:if(typeof r=="number"&&u8===r)return 1;break;default:if(typeof r=="number"&&Ek<=r)return 1}else switch(e){case 67:if(typeof r=="number"&&r===67)return 1;break;case 68:if(typeof r=="number"&&r===68)return 1;break;case 69:if(typeof r=="number"&&r===69)return 1;break;case 70:if(typeof r=="number"&&r===70)return 1;break;case 71:if(typeof r=="number"&&r===71)return 1;break;case 72:if(typeof r=="number"&&r===72)return 1;break;case 73:if(typeof r=="number"&&r===73)return 1;break;case 74:if(typeof r=="number"&&r===74)return 1;break;case 75:if(typeof r=="number"&&r===75)return 1;break;case 76:if(typeof r=="number"&&r===76)return 1;break;case 77:if(typeof r=="number"&&r===77)return 1;break;case 78:if(typeof r=="number"&&r===78)return 1;break;case 79:if(typeof r=="number"&&r===79)return 1;break;case 80:if(typeof r=="number"&&r===80)return 1;break;case 81:if(typeof r=="number"&&r===81)return 1;break;case 82:if(typeof r=="number"&&r===82)return 1;break;case 83:if(typeof r=="number"&&r===83)return 1;break;case 84:if(typeof r=="number"&&r===84)return 1;break;case 85:if(typeof r=="number"&&r===85)return 1;break;case 86:if(typeof r=="number"&&r===86)return 1;break;case 87:if(typeof r=="number"&&r===87)return 1;break;case 88:if(typeof r=="number"&&r===88)return 1;break;case 89:if(typeof r=="number"&&r===89)return 1;break;case 90:if(typeof r=="number"&&r===90)return 1;break;case 91:if(typeof r=="number"&&r===91)return 1;break;case 92:if(typeof r=="number"&&r===92)return 1;break;case 93:if(typeof r=="number"&&r===93)return 1;break;case 94:if(typeof r=="number"&&r===94)return 1;break;case 95:if(typeof r=="number"&&r===95)return 1;break;case 96:if(typeof r=="number"&&r===96)return 1;break;case 97:if(typeof r=="number"&&r===97)return 1;break;case 98:if(typeof r=="number"&&r===98)return 1;break;case 99:if(typeof r=="number"&&r===99)return 1;break;default:if(typeof r=="number"&&y2===r)return 1}else if(34<=e)switch(e){case 34:if(typeof r=="number"&&r===34)return 1;break;case 35:if(typeof r=="number"&&r===35)return 1;break;case 36:if(typeof r=="number"&&r===36)return 1;break;case 37:if(typeof r=="number"&&r===37)return 1;break;case 38:if(typeof r=="number"&&r===38)return 1;break;case 39:if(typeof r=="number"&&r===39)return 1;break;case 40:if(typeof r=="number"&&r===40)return 1;break;case 41:if(typeof r=="number"&&r===41)return 1;break;case 42:if(typeof r=="number"&&r===42)return 1;break;case 43:if(typeof r=="number"&&r===43)return 1;break;case 44:if(typeof r=="number"&&r===44)return 1;break;case 45:if(typeof r=="number"&&r===45)return 1;break;case 46:if(typeof r=="number"&&r===46)return 1;break;case 47:if(typeof r=="number"&&r===47)return 1;break;case 48:if(typeof r=="number"&&r===48)return 1;break;case 49:if(typeof r=="number"&&r===49)return 1;break;case 50:if(typeof r=="number"&&r===50)return 1;break;case 51:if(typeof r=="number"&&r===51)return 1;break;case 52:if(typeof r=="number"&&r===52)return 1;break;case 53:if(typeof r=="number"&&r===53)return 1;break;case 54:if(typeof r=="number"&&r===54)return 1;break;case 55:if(typeof r=="number"&&r===55)return 1;break;case 56:if(typeof r=="number"&&r===56)return 1;break;case 57:if(typeof r=="number"&&r===57)return 1;break;case 58:if(typeof r=="number"&&r===58)return 1;break;case 59:if(typeof r=="number"&&r===59)return 1;break;case 60:if(typeof r=="number"&&r===60)return 1;break;case 61:if(typeof r=="number"&&r===61)return 1;break;case 62:if(typeof r=="number"&&r===62)return 1;break;case 63:if(typeof r=="number"&&r===63)return 1;break;case 64:if(typeof r=="number"&&r===64)return 1;break;case 65:if(typeof r=="number"&&r===65)return 1;break;default:if(typeof r=="number"&&r===66)return 1}else switch(e){case 0:if(typeof r=="number"&&!r)return 1;break;case 1:if(typeof r=="number"&&r===1)return 1;break;case 2:if(typeof r=="number"&&r===2)return 1;break;case 3:if(typeof r=="number"&&r===3)return 1;break;case 4:if(typeof r=="number"&&r===4)return 1;break;case 5:if(typeof r=="number"&&r===5)return 1;break;case 6:if(typeof r=="number"&&r===6)return 1;break;case 7:if(typeof r=="number"&&r===7)return 1;break;case 8:if(typeof r=="number"&&r===8)return 1;break;case 9:if(typeof r=="number"&&r===9)return 1;break;case 10:if(typeof r=="number"&&r===10)return 1;break;case 11:if(typeof r=="number"&&r===11)return 1;break;case 12:if(typeof r=="number"&&r===12)return 1;break;case 13:if(typeof r=="number"&&r===13)return 1;break;case 14:if(typeof r=="number"&&r===14)return 1;break;case 15:if(typeof r=="number"&&r===15)return 1;break;case 16:if(typeof r=="number"&&r===16)return 1;break;case 17:if(typeof r=="number"&&r===17)return 1;break;case 18:if(typeof r=="number"&&r===18)return 1;break;case 19:if(typeof r=="number"&&r===19)return 1;break;case 20:if(typeof r=="number"&&r===20)return 1;break;case 21:if(typeof r=="number"&&r===21)return 1;break;case 22:if(typeof r=="number"&&r===22)return 1;break;case 23:if(typeof r=="number"&&r===23)return 1;break;case 24:if(typeof r=="number"&&r===24)return 1;break;case 25:if(typeof r=="number"&&r===25)return 1;break;case 26:if(typeof r=="number"&&r===26)return 1;break;case 27:if(typeof r=="number"&&r===27)return 1;break;case 28:if(typeof r=="number"&&r===28)return 1;break;case 29:if(typeof r=="number"&&r===29)return 1;break;case 30:if(typeof r=="number"&&r===30)return 1;break;case 31:if(typeof r=="number"&&r===31)return 1;break;case 32:if(typeof r=="number"&&r===32)return 1;break;default:if(typeof r=="number"&&r===33)return 1}}else switch(x[0]){case 0:if(typeof r!="number"&&r[0]===0){var t=r[2],u=x[2],i=p(Ve[13],x[1],r[1]);return i&&_r(u,t)}break;case 1:if(typeof r!="number"&&r[0]===1){var c=r[2],v=x[2],a=p(Ve[12],x[1],r[1]);return a&&_r(v,c)}break;case 2:if(typeof r!="number"&&r[0]===2){var l=r[1],m=x[1],h=l[4],T=l[3],b=l[2],N=m[4],C=m[3],I=m[2],F=p(Ve[11],m[1],l[1]),M=F&&_r(I,b),Y=M&&_r(C,T);return Y&&(N===h?1:0)}break;case 3:if(typeof r!="number"&&r[0]===3){var q=r[1],K=x[1],u0=q[5],Q=q[4],e0=q[3],f0=q[2],a0=K[5],Z=K[4],v0=K[3],t0=K[2],y0=p(Ve[10],K[1],q[1]),n0=y0&&_r(t0,f0),s0=n0&&_r(v0,e0),l0=s0&&(Z===Q?1:0);return l0&&(a0===u0?1:0)}break;case 4:if(typeof r!="number"&&r[0]===4){var w0=r[3],L0=r[2],I0=x[3],j0=x[2],S0=p(Ve[9],x[1],r[1]),W0=S0&&_r(j0,L0);return W0&&_r(I0,w0)}break;case 5:if(typeof r!="number"&&r[0]===5){var A0=r[3],J0=r[2],b0=x[3],z=x[2],C0=p(Ve[8],x[1],r[1]),V0=C0&&_r(z,J0);return V0&&_r(b0,A0)}break;case 6:if(typeof r!="number"&&r[0]===6){var N0=r[2],rx=x[2],xx=p(Ve[7],x[1],r[1]);return xx&&_r(rx,N0)}break;case 7:if(typeof r!="number"&&r[0]===7)return _r(x[1],r[1]);break;case 8:if(typeof r!="number"&&r[0]===8){var nx=_r(x[1],r[1]),mx=r[2],F0=x[2];return nx&&p(Ve[6],F0,mx)}break;case 9:if(typeof r!="number"&&r[0]===9){var px=r[3],dx=r[2],W=x[3],g0=x[2],B=p(Ve[5],x[1],r[1]),h0=B&&_r(g0,dx);return h0&&_r(W,px)}break;case 10:if(typeof r!="number"&&r[0]===10){var _0=r[3],d0=r[2],E0=x[3],U=x[2],Kx=p(Ve[4],x[1],r[1]),Ix=Kx&&_r(U,d0);return Ix&&_r(E0,_0)}break;case 11:if(typeof r!="number"&&r[0]===11)return p(Ve[3],x[1],r[1]);break;case 12:if(typeof r!="number"&&r[0]===12){var z0=r[3],Kr=r[2],S=x[3],G=x[2],Z0=p(Ve[2],x[1],r[1]),yx=Z0&&(G==Kr?1:0);return yx&&_r(S,z0)}break;default:if(typeof r!="number"&&r[0]===13){var Tx=r[2],ex=x[2],m0=r[3],Dx=x[3],Ex=p(Ve[1],x[1],r[1]);if(Ex){x:{if(ex){if(Tx){var qx=Y3(ex[1],Tx[1]);break x}}else if(!Tx){var qx=1;break x}var qx=0}var O0=qx}else var O0=Ex;return O0&&_r(Dx,m0)}}return 0}function jB(x,r){switch(x){case 0:if(!r)return 1;break;case 1:if(r===1)return 1;break;case 2:if(r===2)return 1;break;case 3:if(r===3)return 1;break;default:if(4<=r)return 1}return 0}function OB(x,r){switch(x){case 0:if(!r)return 1;break;case 1:if(r===1)return 1;break;default:if(2<=r)return 1}return 0}Rr(Ve,[0,OB,jB,function(x,r){if(x){if(r)return 1}else if(!r)return 1;return 0},Za,Za,Za,Za,Za,Za,Za,Za,OB,jB]);function DB(x){if(typeof x!="number")switch(x[0]){case 0:return ht0;case 1:return dt0;case 2:return yt0;case 3:return gt0;case 4:return wt0;case 5:return _t0;case 6:return bt0;case 7:return Tt0;case 8:return Et0;case 9:return St0;case 10:return At0;case 11:return Pt0;case 12:return It0;default:return Nt0}var r=x;if(67<=r){if(se<=r)switch(r){case 101:return Me0;case 102:return qe0;case 103:return Be0;case 104:return Ue0;case 105:return Xe0;case 106:return Ye0;case 107:return ze0;case 108:return Ke0;case 109:return Je0;case 110:return Ge0;case 111:return We0;case 112:return Ve0;case 113:return $e0;case 114:return Qe0;case 115:return He0;case 116:return Ze0;case 117:return xt0;case 118:return rt0;case 119:return et0;case 120:return tt0;case 121:return nt0;case 122:return ut0;case 123:return it0;case 124:return ft0;case 125:return ct0;case 126:return st0;case 127:return at0;case 128:return ot0;case 129:return vt0;case 130:return lt0;case 131:return pt0;case 132:return kt0;default:return mt0}switch(r){case 67:return ne0;case 68:return ue0;case 69:return ie0;case 70:return fe0;case 71:return ce0;case 72:return se0;case 73:return ae0;case 74:return oe0;case 75:return ve0;case 76:return le0;case 77:return pe0;case 78:return ke0;case 79:return me0;case 80:return he0;case 81:return de0;case 82:return ye0;case 83:return ge0;case 84:return we0;case 85:return _e0;case 86:return be0;case 87:return Te0;case 88:return Ee0;case 89:return Se0;case 90:return Ae0;case 91:return Pe0;case 92:return Ie0;case 93:return Ne0;case 94:return Ce0;case 95:return je0;case 96:return Oe0;case 97:return De0;case 98:return Fe0;case 99:return Re0;default:return Le0}}if(34<=r)switch(r){case 34:return E10;case 35:return S10;case 36:return A10;case 37:return P10;case 38:return I10;case 39:return N10;case 40:return C10;case 41:return j10;case 42:return O10;case 43:return D10;case 44:return F10;case 45:return R10;case 46:return L10;case 47:return M10;case 48:return q10;case 49:return B10;case 50:return U10;case 51:return X10;case 52:return Y10;case 53:return z10;case 54:return K10;case 55:return J10;case 56:return G10;case 57:return W10;case 58:return V10;case 59:return $10;case 60:return Q10;case 61:return H10;case 62:return Z10;case 63:return xe0;case 64:return re0;case 65:return ee0;default:return te0}switch(r){case 0:return K20;case 1:return J20;case 2:return G20;case 3:return W20;case 4:return V20;case 5:return $20;case 6:return Q20;case 7:return H20;case 8:return Z20;case 9:return x10;case 10:return r10;case 11:return e10;case 12:return t10;case 13:return n10;case 14:return u10;case 15:return i10;case 16:return f10;case 17:return c10;case 18:return s10;case 19:return a10;case 20:return o10;case 21:return v10;case 22:return l10;case 23:return p10;case 24:return k10;case 25:return m10;case 26:return h10;case 27:return d10;case 28:return y10;case 29:return g10;case 30:return w10;case 31:return _10;case 32:return b10;default:return T10}}function KC(x){if(typeof x!="number")switch(x[0]){case 0:return x[2];case 1:return x[2];case 2:return x[1][3];case 3:var r=x[1],e=r[5],t=r[4],u=r[3];return t&&e?Mx(D20,Mx(u,O20)):t?Mx(R20,Mx(u,F20)):e?Mx(M20,Mx(u,L20)):Mx(B20,Mx(u,q20));case 4:return x[3];case 5:var i=x[2];return Mx(X20,Mx(i,Mx(U20,x[3])));case 6:return x[2];case 7:return x[1];case 8:return x[1];case 9:return x[3];case 10:return x[3];case 11:return x[1]?Y20:z20;case 12:return x[3];default:return x[3]}var c=x;if(67<=c){if(se<=c)switch(c){case 101:return x20;case 102:return r20;case 103:return e20;case 104:return t20;case 105:return n20;case 106:return u20;case 107:return i20;case 108:return f20;case 109:return c20;case 110:return s20;case 111:return a20;case 112:return o20;case 113:return v20;case 114:return l20;case 115:return p20;case 116:return k20;case 117:return m20;case 118:return h20;case 119:return d20;case 120:return y20;case 121:return g20;case 122:return w20;case 123:return _20;case 124:return b20;case 125:return T20;case 126:return E20;case 127:return S20;case 128:return A20;case 129:return P20;case 130:return I20;case 131:return N20;case 132:return C20;default:return j20}switch(c){case 67:return gr0;case 68:return wr0;case 69:return _r0;case 70:return br0;case 71:return Tr0;case 72:return Er0;case 73:return Sr0;case 74:return Ar0;case 75:return Pr0;case 76:return Ir0;case 77:return Nr0;case 78:return Cr0;case 79:return jr0;case 80:return Or0;case 81:return Dr0;case 82:return Fr0;case 83:return Rr0;case 84:return Lr0;case 85:return Mr0;case 86:return qr0;case 87:return Br0;case 88:return Ur0;case 89:return Xr0;case 90:return Yr0;case 91:return zr0;case 92:return Kr0;case 93:return Jr0;case 94:return Gr0;case 95:return Wr0;case 96:return Vr0;case 97:return $r0;case 98:return Qr0;case 99:return Hr0;default:return Zr0}}if(34<=c)switch(c){case 34:return Ux0;case 35:return Xx0;case 36:return Yx0;case 37:return zx0;case 38:return Kx0;case 39:return Jx0;case 40:return Gx0;case 41:return Wx0;case 42:return Vx0;case 43:return $x0;case 44:return Qx0;case 45:return Hx0;case 46:return Zx0;case 47:return xr0;case 48:return rr0;case 49:return er0;case 50:return tr0;case 51:return nr0;case 52:return ur0;case 53:return ir0;case 54:return fr0;case 55:return cr0;case 56:return sr0;case 57:return ar0;case 58:return or0;case 59:return vr0;case 60:return lr0;case 61:return pr0;case 62:return kr0;case 63:return mr0;case 64:return hr0;case 65:return dr0;default:return yr0}switch(c){case 0:return fx0;case 1:return cx0;case 2:return sx0;case 3:return ax0;case 4:return ox0;case 5:return vx0;case 6:return lx0;case 7:return px0;case 8:return kx0;case 9:return mx0;case 10:return hx0;case 11:return dx0;case 12:return yx0;case 13:return gx0;case 14:return wx0;case 15:return _x0;case 16:return bx0;case 17:return Tx0;case 18:return Ex0;case 19:return Sx0;case 20:return Ax0;case 21:return Px0;case 22:return Ix0;case 23:return Nx0;case 24:return Cx0;case 25:return jx0;case 26:return Ox0;case 27:return Dx0;case 28:return Fx0;case 29:return Rx0;case 30:return Lx0;case 31:return Mx0;case 32:return qx0;default:return Bx0}}function D5(x){return d(sr(ix0),x)}function JC(x,r){var e=x?x[1]:0;x:{if(typeof r=="number"){if(kr===r){var t=z00,u=K00;break x}}else switch(r[0]){case 3:var t=J00,u=G00;break x;case 5:var t=W00,u=V00;break x;case 0:case 12:var t=Q00,u=H00;break x;case 1:case 13:var t=Z00,u=xx0;break x;case 4:case 8:var t=tx0,u=nx0;break x;case 6:case 7:case 11:break;default:var t=rx0,u=ex0;break x}var t=$00,u=D5(KC(r))}return e?Mx(t,Mx(ux0,u)):u}function Ub0(x){return Vo>>0)var t=w(x);else switch(e){case 0:var t=1;break;case 1:var t=2;break;case 2:var t=0;break;default:if(V(x,2),uo(y(x))===0){var u=Sv(y(x));if(u===0)var t=br(y(x))===0&&br(y(x))===0&&br(y(x))===0?0:w(x);else if(u===1&&br(y(x))===0){for(;;){var i=Ev(y(x));if(i!==0)break}var t=i===1?0:w(x)}else var t=w(x)}else var t=w(x)}if(2>>0)throw K0([0,Ir,Ct0],1);switch(t){case 0:break;case 1:return;default:if(!zC(kB(x))){hB(x,1);return}}}}function uh(x,r){var e=r-x[3][2]|0;return[0,NB(x),e]}function Z6(x,r,e){var t=uh(x,e),u=uh(x,r);return[0,x[1],u,t]}function P1(x,r){return uh(x,r[6])}function Ie(x,r){return uh(x,r[3])}function zr(x,r){return Z6(x,r[6],r[3])}function nU(x,r){x:if(typeof r!="number"){switch(r[0]){case 2:var e=r[1][1];break;case 3:return r[1][1];case 4:var e=r[1];break;case 5:return r[1];case 8:var e=r[2];break;case 9:return r[1];case 10:return r[1];default:break x}return e}return zr(x,x[2])}function I1(x,r,e){return[0,x[1],x[2],x[3],x[4],x[5],[0,[0,r,e],x[6]],x[7]]}function uU(x,r,e){return I1(x,r,[26,D5(e)])}function HC(x,r,e,t){return I1(x,r,[27,e,t])}function lt(x,r){return I1(x,r,$c0)}function xe(x,r){var e=r[3],t=[0,NB(x)+1|0,e];return[0,x[1],x[2],t,x[4],x[5],x[6],x[7]]}function Lt(x,r,e,t,u){var i=[0,x[1],r,e],c=G2(t),v=u?0:1;return[0,i,[0,v,c,x[7][3][1]>>0)var a=w(t);else switch(v){case 0:var a=2;break;case 1:for(;;){V(t,3);var l=y(t),m=-1>>0)return bx(Yc0);switch(a){case 0:var b=fU(i,e,t,2,0),N=b[1],C=st(Mx(zc0,b[2])),I=0<=C?1:0,F=I&&(C<=55295?1:0);if(F)var Y=F;else var M=57344<=C?1:0,Y=M&&(C<=tk?1:0);var q=Y?iU(i,N,C):I1(i,N,28);ds(u,C);var i=q;break;case 1:var K=fU(i,e,t,3,1),u0=K[1],Q=st(Mx(Kc0,K[2])),e0=iU(i,u0,Q);ds(u,Q);var i=e0;break;case 2:return[0,i,G2(u)];default:P5(t,u)}}}function O2(x,r,e){var t=lt(x,zr(x,r));return el(r),e(t,r)}function Pv(x,r,e){for(var t=x;;){or(e);var u=y(e),i=-1>>0)var c=w(e);else switch(i){case 0:for(;;){V(e,3);var v=y(e),a=-1>>0){var h=lt(t,zr(t,e));return[0,h,Ie(h,e)]}switch(c){case 0:var T=xe(t,e);P5(e,r);var t=T;break;case 1:var b=t[4]?HC(t,zr(t,e),Dt0,Ot0):t;return[0,b,Ie(b,e)];case 2:if(t[4])return[0,t,Ie(t,e)];ir(r,Ft0);break;default:P5(e,r)}}}function il(x,r,e){for(;;){or(e);var t=y(e),u=13>>0)var i=w(e);else switch(u){case 0:var i=0;break;case 1:for(;;){V(e,2);var c=y(e),v=-1>>0)return bx(Rt0);switch(i){case 0:return[0,x,Ie(x,e)];case 1:var a=Ie(x,e),l=a[2],m=a[1],h=xe(x,e);return[0,h,[0,m,l-A5(e)|0]];default:P5(e,r)}}}function sU(x,r){function e(u0){return V(u0,3),Z1(y(u0))===0?2:w(u0)}or(r);var t=y(r),u=mf>>0)var i=w(r);else switch(u){case 0:var i=0;break;case 1:var i=16;break;case 2:var i=15;break;case 3:V(r,15);var i=Pe(y(r))===0?15:w(r);break;case 4:V(r,4);var i=Z1(y(r))===0?e(r):w(r);break;case 5:V(r,11);var i=Z1(y(r))===0?e(r):w(r);break;case 6:var i=0;break;case 7:var i=5;break;case 8:var i=6;break;case 9:var i=7;break;case 10:var i=8;break;case 11:var i=9;break;case 12:V(r,14);var c=Sv(y(r));if(c===0)var i=br(y(r))===0&&br(y(r))===0&&br(y(r))===0?12:w(r);else if(c===1&&br(y(r))===0){for(;;){var v=Ev(y(r));if(v!==0)break}var i=v===1?13:w(r)}else var i=w(r);break;case 13:var i=10;break;default:V(r,14);var i=br(y(r))===0&&br(y(r))===0?1:w(r)}if(16>>0)return bx(Ic0);switch(i){case 0:var a=Ox(r);return[0,x,a,l2(r),0];case 1:var l=Ox(r);return[0,x,l,[0,st(Mx(Nc0,l))],0];case 2:var m=Ox(r),h=st(Mx(Cc0,m));return e6<=h?[0,x,m,[0,h>>>3|0,48+(h&7)|0],1]:[0,x,m,[0,h],1];case 3:var T=Ox(r);return[0,x,T,[0,st(Mx(jc0,T))],1];case 4:return[0,x,Oc0,[0,0],0];case 5:return[0,x,Dc0,[0,8],0];case 6:return[0,x,Fc0,[0,12],0];case 7:return[0,x,Rc0,[0,10],0];case 8:return[0,x,Lc0,[0,13],0];case 9:return[0,x,Mc0,[0,9],0];case 10:return[0,x,qc0,[0,11],0];case 11:var b=Ox(r);return[0,x,b,[0,st(Mx(Bc0,b))],1];case 12:var N=Ox(r);return[0,x,N,[0,st(Mx(Uc0,E1(N,1,Cx(N)-1|0)))],0];case 13:var C=Ox(r),I=st(Mx(Xc0,E1(C,2,Cx(C)-3|0))),F=tk>>0)var m=w(i);else switch(l){case 0:var m=3;break;case 1:for(;;){V(i,4);var h=y(i),T=-1>>0)return bx(Lt0);switch(m){case 0:var b=Ox(i);if(ir(t,b),_r(r,b))return[0,c,Ie(c,i),v];ir(e,b);break;case 1:ir(t,Mt0);var N=sU(c,i),C=N[4],I=N[3],F=N[2],M=N[1],Y=C||v;ir(t,F),uq(function(y0){return ds(e,y0)},I);var c=M,v=Y;break;case 2:var q=Ox(i);ir(t,q);var K=xe(lt(c,zr(c,i)),i);return ir(e,q),[0,K,Ie(K,i),v];case 3:var u0=Ox(i);ir(t,u0);var Q=lt(c,zr(c,i));return ir(e,u0),[0,Q,Ie(Q,i),v];default:var e0=i[6],f0=i[3]-e0|0,a0=E2(f0*4|0),Z=G6(i[1],e0,f0,a0);nC(t,a0,0,Z),nC(e,a0,0,Z)}}}function oU(x,r,e,t){for(var u=x;;){or(t);var i=y(t),c=96>>0)var v=w(t);else switch(c){case 0:var v=0;break;case 1:for(;;){V(t,6);var a=y(t),l=-1>>0)return bx(qt0);switch(v){case 0:return[0,lt(u,zr(u,t)),1];case 1:return[0,u,1];case 2:return[0,u,0];case 3:at(e,92);var T=sU(u,t),b=T[3],N=T[1];ir(e,T[2]),uq(function(F){return ds(r,F)},b);var u=N;break;case 4:ir(e,Bt0),ir(r,Ut0);var u=xe(u,t);break;case 5:ir(e,Ox(t)),at(r,10);var u=xe(u,t);break;default:var C=Ox(t);ir(e,C),ir(r,C)}}}function zb0(x,r,e){for(var t=x;;){or(e);var u=y(e),i=92>>0)var c=w(e);else switch(i){case 0:var c=0;break;case 1:for(;;){V(e,7);var v=y(e),a=-1>>0)var c=w(e);else switch(m){case 0:var c=2;break;case 1:var c=1;break;default:V(e,1);var c=Pe(y(e))===0?1:w(e)}}if(7>>0)return bx(zt0);switch(c){case 0:return[0,I1(t,zr(t,e),w1),Kt0];case 1:return[0,xe(I1(t,zr(t,e),w1),e),Jt0];case 2:ir(r,Ox(e));break;case 3:var h=Ox(e);return[0,t,E1(h,1,Cx(h)-1|0)];case 4:return[0,t,Gt0];case 5:at(r,91);x:{r:{e:{t:{n:for(;;){or(e);var T=y(e),b=93>>0)var N=w(e);else switch(b){case 0:var N=0;break;case 1:for(;;){V(e,5);var C=y(e),I=-1>>0)break r;switch(N){case 0:break e;case 1:ir(r,Yt0);break;case 2:at(r,92),at(r,93);break;case 3:break t;case 4:break n;default:ir(r,Ox(e))}}var Y=xe(I1(t,zr(t,e),w1),e);break x}at(r,93);var Y=t;break x}var Y=t;break x}var Y=bx(Xt0)}var t=Y;break;case 6:return[0,xe(I1(t,zr(t,e),w1),e),Wt0];default:ir(r,Ox(e))}}}function vU(x){var r=ux(x,"iexcl");if(0<=r){if(0>=r)return ac0;var e=ux(x,"prime");if(0<=e){if(0>=e)return sc0;var t=ux(x,"sup1");if(0<=t){if(0>=t)return cc0;var u=ux(x,"uarr");if(0<=u){if(0>=u)return fc0;var i=ux(x,"xi");if(0<=i){if(0>=i)return ic0;if(!P(x,"yacute"))return uc0;if(!P(x,"yen"))return nc0;if(!P(x,"yuml"))return tc0;if(!P(x,"zeta"))return ec0;if(!P(x,"zwj"))return rc0;if(!P(x,"zwnj"))return xc0}else{if(!P(x,"ucirc"))return Zf0;if(!P(x,"ugrave"))return Hf0;if(!P(x,"uml"))return Qf0;if(!P(x,"upsih"))return $f0;if(!P(x,"upsilon"))return Vf0;if(!P(x,"uuml"))return Wf0;if(!P(x,"weierp"))return Gf0}}else{var c=ux(x,"thetasym");if(0<=c){if(0>=c)return Jf0;if(!P(x,"thinsp"))return Kf0;if(!P(x,"thorn"))return zf0;if(!P(x,"tilde"))return Yf0;if(!P(x,"times"))return Xf0;if(!P(x,"trade"))return Uf0;if(!P(x,"uArr"))return Bf0;if(!P(x,"uacute"))return qf0}else{if(!P(x,"sup2"))return Mf0;if(!P(x,"sup3"))return Lf0;if(!P(x,"supe"))return Rf0;if(!P(x,"szlig"))return Ff0;if(!P(x,"tau"))return Df0;if(!P(x,"there4"))return Of0;if(!P(x,"theta"))return jf0}}}else{var v=ux(x,"rlm");if(0<=v){if(0>=v)return Cf0;var a=ux(x,"sigma");if(0<=a){if(0>=a)return Nf0;if(!P(x,"sigmaf"))return If0;if(!P(x,"sim"))return Pf0;if(!P(x,"spades"))return Af0;if(!P(x,"sub"))return Sf0;if(!P(x,"sube"))return Ef0;if(!P(x,"sum"))return Tf0;if(!P(x,"sup"))return bf0}else{if(!P(x,"rsaquo"))return _f0;if(!P(x,"rsquo"))return wf0;if(!P(x,"sbquo"))return gf0;if(!P(x,"scaron"))return yf0;if(!P(x,"sdot"))return df0;if(!P(x,"sect"))return hf0;if(!P(x,"shy"))return mf0}}else{var l=ux(x,"raquo");if(0<=l){if(0>=l)return kf0;if(!P(x,"rarr"))return pf0;if(!P(x,"rceil"))return lf0;if(!P(x,"rdquo"))return vf0;if(!P(x,"real"))return of0;if(!P(x,"reg"))return af0;if(!P(x,"rfloor"))return sf0;if(!P(x,"rho"))return cf0}else{if(!P(x,"prod"))return ff0;if(!P(x,"prop"))return if0;if(!P(x,"psi"))return uf0;if(!P(x,"quot"))return nf0;if(!P(x,"rArr"))return tf0;if(!P(x,"radic"))return ef0;if(!P(x,"rang"))return rf0}}}}else{var m=ux(x,"ndash");if(0<=m){if(0>=m)return xf0;var h=ux(x,"or");if(0<=h){if(0>=h)return Zi0;var T=ux(x,"part");if(0<=T){if(0>=T)return Hi0;if(!P(x,"permil"))return Qi0;if(!P(x,"perp"))return $i0;if(!P(x,"phi"))return Vi0;if(!P(x,"pi"))return Wi0;if(!P(x,"piv"))return Gi0;if(!P(x,"plusmn"))return Ji0;if(!P(x,"pound"))return Ki0}else{if(!P(x,"ordf"))return zi0;if(!P(x,"ordm"))return Yi0;if(!P(x,"oslash"))return Xi0;if(!P(x,"otilde"))return Ui0;if(!P(x,"otimes"))return Bi0;if(!P(x,"ouml"))return qi0;if(!P(x,"para"))return Mi0}}else{var b=ux(x,"oacute");if(0<=b){if(0>=b)return Li0;if(!P(x,"ocirc"))return Ri0;if(!P(x,"oelig"))return Fi0;if(!P(x,"ograve"))return Di0;if(!P(x,"oline"))return Oi0;if(!P(x,"omega"))return ji0;if(!P(x,"omicron"))return Ci0;if(!P(x,"oplus"))return Ni0}else{if(!P(x,"ne"))return Ii0;if(!P(x,"ni"))return Pi0;if(!P(x,"not"))return Ai0;if(!P(x,"notin"))return Si0;if(!P(x,"nsub"))return Ei0;if(!P(x,"ntilde"))return Ti0;if(!P(x,"nu"))return bi0}}}else{var N=ux(x,"le");if(0<=N){if(0>=N)return _i0;var C=ux(x,"macr");if(0<=C){if(0>=C)return wi0;if(!P(x,"mdash"))return gi0;if(!P(x,"micro"))return yi0;if(!P(x,"middot"))return di0;if(!P(x,iR))return hi0;if(!P(x,"mu"))return mi0;if(!P(x,"nabla"))return ki0;if(!P(x,"nbsp"))return pi0}else{if(!P(x,"lfloor"))return li0;if(!P(x,"lowast"))return vi0;if(!P(x,"loz"))return oi0;if(!P(x,"lrm"))return ai0;if(!P(x,"lsaquo"))return si0;if(!P(x,"lsquo"))return ci0;if(!P(x,"lt"))return fi0}}else{var I=ux(x,"kappa");if(0<=I){if(0>=I)return ii0;if(!P(x,"lArr"))return ui0;if(!P(x,"lambda"))return ni0;if(!P(x,"lang"))return ti0;if(!P(x,"laquo"))return ei0;if(!P(x,"larr"))return ri0;if(!P(x,"lceil"))return xi0;if(!P(x,"ldquo"))return Zu0}else{if(!P(x,"igrave"))return Hu0;if(!P(x,"image"))return Qu0;if(!P(x,"infin"))return $u0;if(!P(x,"iota"))return Vu0;if(!P(x,"iquest"))return Wu0;if(!P(x,"isin"))return Gu0;if(!P(x,"iuml"))return Ju0}}}}}else{var F=ux(x,"aelig");if(0<=F){if(0>=F)return Ku0;var M=ux(x,"delta");if(0<=M){if(0>=M)return zu0;var Y=ux(x,"fnof");if(0<=Y){if(0>=Y)return Yu0;var q=ux(x,"gt");if(0<=q){if(0>=q)return Xu0;if(!P(x,"hArr"))return Uu0;if(!P(x,"harr"))return Bu0;if(!P(x,"hearts"))return qu0;if(!P(x,"hellip"))return Mu0;if(!P(x,"iacute"))return Lu0;if(!P(x,"icirc"))return Ru0}else{if(!P(x,"forall"))return Fu0;if(!P(x,"frac12"))return Du0;if(!P(x,"frac14"))return Ou0;if(!P(x,"frac34"))return ju0;if(!P(x,"frasl"))return Cu0;if(!P(x,"gamma"))return Nu0;if(!P(x,"ge"))return Iu0}}else{var K=ux(x,"ensp");if(0<=K){if(0>=K)return Pu0;if(!P(x,"epsilon"))return Au0;if(!P(x,"equiv"))return Su0;if(!P(x,"eta"))return Eu0;if(!P(x,"eth"))return Tu0;if(!P(x,"euml"))return bu0;if(!P(x,"euro"))return _u0;if(!P(x,"exist"))return wu0}else{if(!P(x,"diams"))return gu0;if(!P(x,"divide"))return yu0;if(!P(x,"eacute"))return du0;if(!P(x,"ecirc"))return hu0;if(!P(x,"egrave"))return mu0;if(!P(x,Ee))return ku0;if(!P(x,"emsp"))return pu0}}}else{var u0=ux(x,"cap");if(0<=u0){if(0>=u0)return lu0;var Q=ux(x,"copy");if(0<=Q){if(0>=Q)return vu0;if(!P(x,"crarr"))return ou0;if(!P(x,"cup"))return au0;if(!P(x,"curren"))return su0;if(!P(x,"dArr"))return cu0;if(!P(x,"dagger"))return fu0;if(!P(x,"darr"))return iu0;if(!P(x,"deg"))return uu0}else{if(!P(x,"ccedil"))return nu0;if(!P(x,"cedil"))return tu0;if(!P(x,"cent"))return eu0;if(!P(x,"chi"))return ru0;if(!P(x,"circ"))return xu0;if(!P(x,"clubs"))return Z70;if(!P(x,"cong"))return H70}}else{var e0=ux(x,"aring");if(0<=e0){if(0>=e0)return Q70;if(!P(x,"asymp"))return $70;if(!P(x,"atilde"))return V70;if(!P(x,"auml"))return W70;if(!P(x,"bdquo"))return G70;if(!P(x,"beta"))return J70;if(!P(x,"brvbar"))return K70;if(!P(x,"bull"))return z70}else{if(!P(x,"agrave"))return Y70;if(!P(x,"alefsym"))return X70;if(!P(x,"alpha"))return U70;if(!P(x,"amp"))return B70;if(!P(x,"and"))return q70;if(!P(x,"ang"))return M70;if(!P(x,"apos"))return L70}}}}else{var f0=ux(x,"Nu");if(0<=f0){if(0>=f0)return R70;var a0=ux(x,"Sigma");if(0<=a0){if(0>=a0)return F70;var Z=ux(x,"Uuml");if(0<=Z){if(0>=Z)return D70;if(!P(x,"Xi"))return O70;if(!P(x,"Yacute"))return j70;if(!P(x,"Yuml"))return C70;if(!P(x,"Zeta"))return N70;if(!P(x,"aacute"))return I70;if(!P(x,"acirc"))return P70;if(!P(x,"acute"))return A70}else{if(!P(x,"THORN"))return S70;if(!P(x,"Tau"))return E70;if(!P(x,"Theta"))return T70;if(!P(x,"Uacute"))return b70;if(!P(x,"Ucirc"))return _70;if(!P(x,"Ugrave"))return w70;if(!P(x,"Upsilon"))return g70}}else{var v0=ux(x,"Otilde");if(0<=v0){if(0>=v0)return y70;if(!P(x,"Ouml"))return d70;if(!P(x,"Phi"))return h70;if(!P(x,"Pi"))return m70;if(!P(x,"Prime"))return k70;if(!P(x,"Psi"))return p70;if(!P(x,"Rho"))return l70;if(!P(x,"Scaron"))return v70}else{if(!P(x,"OElig"))return o70;if(!P(x,"Oacute"))return a70;if(!P(x,"Ocirc"))return s70;if(!P(x,"Ograve"))return c70;if(!P(x,"Omega"))return f70;if(!P(x,"Omicron"))return i70;if(!P(x,"Oslash"))return u70}}}else{var t0=ux(x,"Eacute");if(0<=t0){if(0>=t0)return n70;var y0=ux(x,"Icirc");if(0<=y0){if(0>=y0)return t70;if(!P(x,"Igrave"))return e70;if(!P(x,"Iota"))return r70;if(!P(x,"Iuml"))return x70;if(!P(x,"Kappa"))return Zn0;if(!P(x,"Lambda"))return Hn0;if(!P(x,"Mu"))return Qn0;if(!P(x,"Ntilde"))return $n0}else{if(!P(x,"Ecirc"))return Vn0;if(!P(x,"Egrave"))return Wn0;if(!P(x,"Epsilon"))return Gn0;if(!P(x,"Eta"))return Jn0;if(!P(x,"Euml"))return Kn0;if(!P(x,"Gamma"))return zn0;if(!P(x,"Iacute"))return Yn0}}else{var n0=ux(x,"Atilde");if(0<=n0){if(0>=n0)return Xn0;if(!P(x,"Auml"))return Un0;if(!P(x,"Beta"))return Bn0;if(!P(x,"Ccedil"))return qn0;if(!P(x,"Chi"))return Mn0;if(!P(x,"Dagger"))return Ln0;if(!P(x,"Delta"))return Rn0;if(!P(x,"ETH"))return Fn0}else{if(!P(x,"'int'"))return Dn0;if(!P(x,"AElig"))return On0;if(!P(x,"Aacute"))return jn0;if(!P(x,"Acirc"))return Cn0;if(!P(x,"Agrave"))return Nn0;if(!P(x,"Alpha"))return In0;if(!P(x,"Aring"))return Pn0}}}}}return 0}function lU(x,r,e,t){for(var u=x;;){var i=function(v0){for(;;)if(V(v0,8),WC(y(v0))!==0)return w(v0)};or(t);var c=y(t),v=qa>>0)var a=w(t);else switch(v){case 0:var a=3;break;case 1:var a=i(t);break;case 2:var a=4;break;case 3:V(t,4);var a=Pe(y(t))===0?4:w(t);break;case 4:V(t,8);var l=eU(y(t));if(l===0){var m=FB(y(t));if(m===0){for(;;){var h=RB(y(t));if(h!==0)break}var a=h===1?6:w(t)}else if(m===1&&br(y(t))===0){for(;;){var T=ZB(y(t));if(T!==0)break}var a=T===1?5:w(t)}else var a=w(t)}else if(l===1&&cr(y(t))===0){var b=Rt(y(t));if(b===0){var N=Rt(y(t));if(N===0){var C=Rt(y(t));if(C===0){var I=Rt(y(t));if(I===0){var F=Rt(y(t));if(F===0)var M=Rt(y(t)),a=M===0?VB(y(t))===0?7:w(t):M===1?7:w(t);else var a=F===1?7:w(t)}else var a=I===1?7:w(t)}else var a=C===1?7:w(t)}else var a=N===1?7:w(t)}else var a=b===1?7:w(t)}else var a=w(t);break;case 5:var a=0;break;case 6:V(t,1);var a=WC(y(t))===0?i(t):w(t);break;default:V(t,2);var a=WC(y(t))===0?i(t):w(t)}if(8>>0)return bx(Vt0);switch(a){case 0:return el(t),u;case 1:return HC(u,zr(u,t),Qt0,$t0);case 2:return HC(u,zr(u,t),Zt0,Ht0);case 3:return lt(u,zr(u,t));case 4:var Y=Ox(t);ir(e,Y),ir(r,Y);var u=xe(u,t);break;case 5:var q=Ox(t),K=E1(q,3,Cx(q)-4|0);ir(e,q),ds(r,st(Mx(xn0,K)));break;case 6:var u0=Ox(t),Q=E1(u0,2,Cx(u0)-3|0);ir(e,u0),ds(r,st(Q));break;case 7:var e0=Ox(t),f0=E1(e0,1,Cx(e0)-2|0);ir(e,e0);var a0=vU(f0);a0?ds(r,a0[1]):ir(r,Mx(en0,Mx(f0,rn0)));break;default:var Z=Ox(t);ir(e,Z),ir(r,Z)}}}function x4(x){return function(r){var e=0,t=r;x:for(;;){var u=x(t,t[2]);switch(u[0]){case 0:break x;case 1:var i=u[2],c=u[1],e=[0,i,e],t=[0,c[1],c[2],c[3],c[4],c[5],c[6],i[1]];break;default:var t=u[1]}}var v=u[2],a=u[1],l=nU(a,v),m=e===0?0:tx(e),h=a[6];if(h===0)return[0,[0,a[1],a[2],a[3],a[4],a[5],a[6],l],[0,v,l,0,m]];var T=[0,v,l,tx(h),m];return[0,[0,a[1],a[2],a[3],a[4],a[5],PB,l],T]}}var Kb0=x4(function(x,r){or(r);var e=y(r),t=Vo>>0)var u=w(r);else switch(t){case 0:var u=0;break;case 1:var u=6;break;case 2:if(V(r,2),gs(y(r))===0){for(;V(r,2),gs(y(r))===0;);var u=w(r)}else var u=w(r);break;case 3:var u=1;break;case 4:V(r,1);var u=Pe(y(r))===0?1:w(r);break;default:V(r,5);var i=rh(y(r)),u=i===0?4:i===1?3:w(r)}if(6>>0)return bx(oc0);switch(u){case 0:return[0,x,kr];case 1:return[2,xe(x,r)];case 2:return[2,x];case 3:var c=P1(x,r),v=Wr(Xr),a=il(x,v,r),l=a[1];return[1,l,Lt(l,c,a[2],v,0)];case 4:var m=P1(x,r),h=Wr(Xr),T=Pv(x,h,r),b=T[1];return[1,b,Lt(b,m,T[2],h,1)];case 5:var N=P1(x,r),C=Wr(Xr),I=zb0(x,C,r),F=I[1],M=I[2],Y=Ie(F,r),q=[0,F[1],N,Y];return[0,F,[5,q,G2(C),M]];default:var K=lt(x,zr(x,r));return[0,K,[7,Ox(r)]]}}),Jb0=x4(function(x,r){or(r);var e=Yb0(y(r));if(14>>0)var t=w(r);else switch(e){case 0:var t=0;break;case 1:var t=14;break;case 2:if(V(r,2),gs(y(r))===0){for(;V(r,2),gs(y(r))===0;);var t=w(r)}else var t=w(r);break;case 3:var t=1;break;case 4:V(r,1);var t=Pe(y(r))===0?1:w(r);break;case 5:var t=12;break;case 6:var t=13;break;case 7:var t=10;break;case 8:V(r,6);var u=rh(y(r)),t=u===0?4:u===1?3:w(r);break;case 9:var t=9;break;case 10:var t=5;break;case 11:var t=11;break;case 12:var t=7;break;case 13:if(V(r,14),uo(y(r))===0){var i=Sv(y(r));if(i===0)var t=br(y(r))===0&&br(y(r))===0&&br(y(r))===0?13:w(r);else if(i===1&&br(y(r))===0){for(;;){var c=Ev(y(r));if(c!==0)break}var t=c===1?13:w(r)}else var t=w(r)}else var t=w(r);break;default:var t=8}if(14>>0)return bx(An0);switch(t){case 0:return[0,x,kr];case 1:return[2,xe(x,r)];case 2:return[2,x];case 3:var v=P1(x,r),a=Wr(Xr),l=il(x,a,r),m=l[1];return[1,m,Lt(m,v,l[2],a,0)];case 4:var h=P1(x,r),T=Wr(Xr),b=Pv(x,T,r),N=b[1];return[1,N,Lt(N,h,b[2],T,1)];case 5:return[0,x,99];case 6:return[0,x,vn];case 7:return[0,x,y2];case 8:return[0,x,0];case 9:return[0,x,87];case 10:return[0,x,10];case 11:return[0,x,83];case 12:var C=Ox(r),I=P1(x,r),F=Wr(Xr),M=Wr(Xr);ir(M,C);for(var Y=_r(C,"'"),q=x;;){or(r);var K=y(r),u0=39>>0)var Q=w(r);else switch(u0){case 0:var Q=2;break;case 1:for(;;){V(r,7);var e0=y(r),f0=-1>>0)var I0=bx(tn0);else switch(Q){case 0:if(!Y){at(M,39),at(F,39);continue}var I0=q;break;case 1:if(Y){at(M,34),at(F,34);continue}var I0=q;break;case 2:var I0=lt(q,zr(q,r));break;case 3:var j0=Ox(r);ir(M,j0),ir(F,j0);var q=xe(q,r);continue;case 4:var S0=Ox(r),W0=E1(S0,3,Cx(S0)-4|0);ir(M,S0),ds(F,st(Mx(nn0,W0)));continue;case 5:var A0=Ox(r),J0=E1(A0,2,Cx(A0)-3|0);ir(M,A0),ds(F,st(J0));continue;case 6:var b0=Ox(r),z=E1(b0,1,Cx(b0)-2|0);ir(M,b0);var C0=vU(z);C0?ds(F,C0[1]):ir(F,Mx(in0,Mx(z,un0)));continue;default:var V0=Ox(r);ir(M,V0),ir(F,V0);continue}var N0=Ie(I0,r);ir(M,C);var rx=G2(F),xx=G2(M);return[0,I0,[10,[0,I0[1],I,N0],rx,xx]]}case 13:for(var nx=r[6];;){or(r);var mx=y(r),F0=c2>>0)var px=w(r);else switch(F0){case 0:var px=1;break;case 1:var px=2;break;case 2:var px=0;break;default:if(V(r,2),uo(y(r))===0){var dx=Sv(y(r));if(dx===0)var px=br(y(r))===0&&br(y(r))===0&&br(y(r))===0?0:w(r);else if(dx===1&&br(y(r))===0){for(;;){var W=Ev(y(r));if(W!==0)break}var px=W===1?0:w(r)}else var px=w(r)}else var px=w(r)}if(2>>0)throw K0([0,Ir,jt0],1);switch(px){case 0:continue;case 1:break;default:if(zC(kB(r)))continue;hB(r,1)}var g0=r[3];LC(r,nx);var B=l2(r),h0=Z6(x,nx,g0);return[0,x,[8,V6(B),h0]]}default:return[0,x,[7,Ox(r)]]}}),Gb0=x4(function(x,r){or(r);var e=y(r),t=-1>>0)var u=w(r);else switch(t){case 0:var u=5;break;case 1:if(V(r,1),gs(y(r))===0){for(;V(r,1),gs(y(r))===0;);var u=w(r)}else var u=w(r);break;case 2:var u=0;break;case 3:V(r,0);var u=Pe(y(r))===0?0:w(r);break;case 4:V(r,5);var i=rh(y(r)),u=i===0?3:i===1?2:w(r);break;default:var u=4}if(5>>0)return bx(bn0);switch(u){case 0:return[2,xe(x,r)];case 1:return[2,x];case 2:var c=P1(x,r),v=Wr(Xr),a=il(x,v,r),l=a[1];return[1,l,Lt(l,c,a[2],v,0)];case 3:var m=P1(x,r),h=Wr(Xr),T=Pv(x,h,r),b=T[1];return[1,b,Lt(b,m,T[2],h,1)];case 4:var N=P1(x,r),C=Wr(Xr),I=Wr(Xr),F=oU(x,C,I,r),M=F[1],Y=F[2],q=Ie(M,r),K=[0,M[1],N,q],u0=G2(I);return[0,M,[3,[0,K,G2(C),u0,0,Y]]];default:var Q=lt(x,zr(x,r));return[0,Q,[3,[0,zr(Q,r),En0,Tn0,0,1]]]}}),Wb0=x4(function(x,r){function e(S){for(;;)if(V(S,29),cr(y(S))!==0)return w(S)}function t(S){V(S,29);var G=$B(y(S));if(3>>0)return w(S);switch(G){case 0:return e(S);case 1:var Z0=ro(y(S));if(Z0===0)for(;;){V(S,24);var yx=tl(y(S));if(2>>0)return w(S);switch(yx){case 0:return u(S);case 1:break;default:return i(S)}}else{if(Z0!==1)return w(S);for(;;){V(S,24);var Tx=_s(y(S));if(3>>0)return w(S);switch(Tx){case 0:return u(S);case 1:break;case 2:return c(S);default:return i(S)}}}break;case 2:for(;;){V(S,24);var ex=tl(y(S));if(2>>0)return w(S);switch(ex){case 0:return v(S);case 1:break;default:return a(S)}}break;default:for(;;){V(S,24);var m0=_s(y(S));if(3>>0)return w(S);switch(m0){case 0:return v(S);case 1:break;case 2:return c(S);default:return a(S)}}}}function u(S){for(;;)if(V(S,23),cr(y(S))!==0)return w(S)}function i(S){V(S,22);var G=X2(y(S));if(G!==0)return G===1?u(S):w(S);for(;;)if(V(S,21),cr(y(S))!==0)return w(S)}function c(S){for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,24);var G=_s(y(S));if(3>>0)return w(S);switch(G){case 0:return u(S);case 1:break;case 2:break x;default:return i(S)}}}}function v(S){for(;;)if(V(S,23),cr(y(S))!==0)return w(S)}function a(S){V(S,22);var G=X2(y(S));if(G!==0)return G===1?v(S):w(S);for(;;)if(V(S,21),cr(y(S))!==0)return w(S)}function l(S){V(S,27);var G=X2(y(S));if(G!==0)return G===1?e(S):w(S);for(;;)if(V(S,25),cr(y(S))!==0)return w(S)}function m(S){return V(S,3),rU(y(S))===0?3:w(S)}function h(S){return H5(y(S))===0&&W5(y(S))===0&&HB(y(S))===0&&XB(y(S))===0&&YB(y(S))===0&&G5(y(S))===0&&Q6(y(S))===0&&H5(y(S))===0&&uo(y(S))===0&&QC(y(S))===0&&Av(y(S))===0?3:w(S)}function T(S){V(S,30);var G=BB(y(S));if(3>>0)return w(S);switch(G){case 0:return e(S);case 1:x:for(;;){V(S,30);var Z0=eo(y(S));if(4>>0)return w(S);switch(Z0){case 0:return e(S);case 1:break;case 2:return t(S);case 3:break x;default:return l(S)}}for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,30);var yx=eo(y(S));if(4>>0)return w(S);switch(yx){case 0:return e(S);case 1:break;case 2:return t(S);case 3:break x;default:return l(S)}}}break;case 2:return t(S);default:return l(S)}}function b(S){for(;;)if(V(S,15),cr(y(S))!==0)return w(S)}function N(S){V(S,30);var G=tl(y(S));if(2>>0)return w(S);switch(G){case 0:return e(S);case 1:x:for(;;){V(S,30);var Z0=_s(y(S));if(3>>0)return w(S);switch(Z0){case 0:return e(S);case 1:break;case 2:break x;default:return l(S)}}for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,30);var yx=_s(y(S));if(3>>0)return w(S);switch(yx){case 0:return e(S);case 1:break;case 2:break x;default:return l(S)}}}break;default:return l(S)}}function C(S){V(S,15);var G=X2(y(S));if(G!==0)return G===1?b(S):w(S);for(;;)if(V(S,15),cr(y(S))!==0)return w(S)}function I(S){V(S,28);var G=X2(y(S));if(G!==0)return G===1?e(S):w(S);for(;;)if(V(S,26),cr(y(S))!==0)return w(S)}function F(S){for(;;)if(V(S,9),cr(y(S))!==0)return w(S)}function M(S){for(;;)if(V(S,9),cr(y(S))!==0)return w(S)}function Y(S){for(;;)if(V(S,13),cr(y(S))!==0)return w(S)}function q(S){for(;;)if(V(S,13),cr(y(S))!==0)return w(S)}function K(S){for(;;)if(V(S,19),cr(y(S))!==0)return w(S)}function u0(S){for(;;)if(V(S,19),cr(y(S))!==0)return w(S)}function Q(S){for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,30);var G=WB(y(S));if(4>>0)return w(S);switch(G){case 0:return e(S);case 1:return N(S);case 2:break;case 3:break x;default:return I(S)}}}}or(r);var e0=function(S){var G=Xb0(y(S));if(31>>0)return w(S);switch(G){case 0:return 66;case 1:return 67;case 2:if(V(S,1),gs(y(S))!==0)return w(S);for(;;)if(V(S,1),gs(y(S))!==0)return w(S);break;case 3:return 0;case 4:return V(S,0),Pe(y(S))===0?0:w(S);case 5:return 6;case 6:return 65;case 7:if(V(S,67),Q6(y(S))!==0)return w(S);var Z0=y(S),yx=F1>>0)return w(S);switch(qx){case 0:return e(S);case 1:break;case 2:return t(S);case 3:break x;default:return l(S)}}for(;;){if(vr(y(S))!==0)return w(S);x:for(;;){V(S,30);var O0=eo(y(S));if(4>>0)return w(S);switch(O0){case 0:return e(S);case 1:break;case 2:return t(S);case 3:break x;default:return l(S)}}}break;case 16:V(S,67);var Wx=rh(y(S));if(Wx!==0)return Wx===1?5:w(S);V(S,2);var Yx=U5(y(S));if(2>>0)return w(S);switch(Yx){case 0:for(;;){var fx=U5(y(S));if(2>>0)return w(S);switch(fx){case 0:break;case 1:return m(S);default:return h(S)}}break;case 1:return m(S);default:return h(S)}break;case 17:V(S,30);var Qx=KB(y(S));if(8>>0)return w(S);switch(Qx){case 0:return e(S);case 1:return T(S);case 2:x:for(;;){V(S,16);var vx=QB(y(S));if(4>>0)return w(S);switch(vx){case 0:return b(S);case 1:return N(S);case 2:break;case 3:break x;default:return C(S)}}for(;;){V(S,15);var nr=B5(y(S));if(3>>0)return w(S);switch(nr){case 0:return b(S);case 1:return N(S);case 2:break;default:return C(S)}}break;case 3:for(;;){V(S,30);var gr=B5(y(S));if(3>>0)return w(S);switch(gr){case 0:return e(S);case 1:return N(S);case 2:break;default:return I(S)}}break;case 4:V(S,29);var Nr=zB(y(S));if(Nr===0)return e(S);if(Nr!==1)return w(S);x:{r:for(;;){V(S,10);var s2=eh(y(S));if(3>>0)return w(S);switch(s2){case 0:return F(S);case 1:break;case 2:break x;default:break r}}V(S,8);var b2=X2(y(S));if(b2!==0)return b2===1?F(S):w(S);for(;;)if(V(S,7),cr(y(S))!==0)return w(S)}x:for(;;){if(ws(y(S))!==0)return w(S);r:for(;;){V(S,10);var k2=eh(y(S));if(3>>0)return w(S);switch(k2){case 0:return M(S);case 1:break;case 2:break r;default:break x}}}V(S,8);var F2=X2(y(S));if(F2!==0)return F2===1?M(S):w(S);for(;;)if(V(S,7),cr(y(S))!==0)return w(S);break;case 5:return t(S);case 6:V(S,29);var jx=JB(y(S));if(jx===0)return e(S);if(jx!==1)return w(S);x:{r:for(;;){V(S,14);var _=xh(y(S));if(3<_>>>0)return w(S);switch(_){case 0:return Y(S);case 1:break;case 2:break x;default:break r}}V(S,12);var $=X2(y(S));if($!==0)return $===1?Y(S):w(S);for(;;)if(V(S,11),cr(y(S))!==0)return w(S)}x:for(;;){if(Z1(y(S))!==0)return w(S);r:for(;;){V(S,14);var ix=xh(y(S));if(3>>0)return w(S);switch(ix){case 0:return q(S);case 1:break;case 2:break r;default:break x}}}V(S,12);var U0=X2(y(S));if(U0!==0)return U0===1?q(S):w(S);for(;;)if(V(S,11),cr(y(S))!==0)return w(S);break;case 7:V(S,29);var cx=LB(y(S));if(cx===0)return e(S);if(cx!==1)return w(S);x:{r:for(;;){V(S,20);var wx=th(y(S));if(3>>0)return w(S);switch(wx){case 0:return K(S);case 1:break;case 2:break x;default:break r}}V(S,18);var Or=X2(y(S));if(Or!==0)return Or===1?K(S):w(S);for(;;)if(V(S,17),cr(y(S))!==0)return w(S)}x:for(;;){if(br(y(S))!==0)return w(S);r:for(;;){V(S,20);var Hx=th(y(S));if(3>>0)return w(S);switch(Hx){case 0:return u0(S);case 1:break;case 2:break r;default:break x}}}V(S,18);var x2=X2(y(S));if(x2!==0)return x2===1?u0(S):w(S);for(;;)if(V(S,17),cr(y(S))!==0)return w(S);break;default:return I(S)}break;case 18:V(S,30);var hr=Y5(y(S));if(5
>>0)return w(S);switch(hr){case 0:return e(S);case 1:return T(S);case 2:for(;;){V(S,30);var Dr=Y5(y(S));if(5>>0)return w(S);switch(Dr){case 0:return e(S);case 1:return T(S);case 2:break;case 3:return t(S);case 4:return Q(S);default:return I(S)}}break;case 3:return t(S);case 4:return Q(S);default:return I(S)}break;case 19:return 44;case 20:return 42;case 21:return 49;case 22:V(S,51);var r2=y(S),sx=61>>0)return bx(yn0);var f0=e0;if(34>f0)switch(f0){case 0:return[2,xe(x,r)];case 1:return[2,x];case 2:var a0=P1(x,r),Z=Wr(Xr),v0=Pv(x,Z,r),t0=v0[1];return[1,t0,Lt(t0,a0,v0[2],Z,1)];case 3:var y0=Ox(r);if(!x[5]){var n0=P1(x,r),s0=Wr(Xr);ir(s0,y0);var l0=Pv(x,s0,r),w0=l0[1];return[1,w0,Lt(w0,n0,l0[2],s0,1)]}var L0=x[4]?uU(x,zr(x,r),y0):x,I0=O5(1,L0),j0=A5(r);return _r(W6(r,j0-1|0,1),Uo)&&P(W6(r,j0-2|0,1),Uo)?[0,I0,87]:[2,I0];case 4:if(x[4])return[2,O5(0,x)];el(r),or(r);var S0=qB(y(r))===0?0:w(r);return S0===0?[0,x,K2]:bx(gn0);case 5:var W0=P1(x,r),A0=Wr(Xr),J0=il(x,A0,r),b0=J0[1];return[1,b0,Lt(b0,W0,J0[2],A0,0)];case 6:var z=Ox(r),C0=P1(x,r),V0=Wr(Xr),N0=Wr(Xr);ir(N0,z);var rx=aU(x,z,V0,N0,0,r),xx=rx[1],nx=rx[3],mx=[0,xx[1],C0,rx[2]],F0=G2(N0);return[0,xx,[2,[0,mx,G2(V0),F0,nx]]];case 7:return O2(x,r,function(S,G){or(G);x:if(Ae(y(G))===0&&K5(y(G))===0&&ws(y(G))===0){r:for(;;){var Z0=M5(y(G));if(2>>0){var ex=w(G);break x}switch(Z0){case 0:break;case 1:break r;default:var ex=0;break x}}for(;;){r:{if(ws(y(G))===0){e:for(;;){var yx=M5(y(G));if(2>>0){var Tx=w(G);break r}switch(yx){case 0:break;case 1:break e;default:var Tx=0;break r}}continue}var Tx=w(G)}var ex=Tx;break}}else var ex=w(G);return ex===0?[0,S,qt(0,l2(G))]:bx(dn0)});case 8:return[0,x,qt(0,l2(r))];case 9:return O2(x,r,function(S,G){if(or(G),Ae(y(G))===0&&K5(y(G))===0&&ws(y(G))===0){for(;;){V(G,0);var Z0=L5(y(G));if(Z0!==0)break}if(Z0===1)for(;;){if(ws(y(G))===0){for(;;){V(G,0);var yx=L5(y(G));if(yx!==0)break}if(yx===1)continue;var Tx=w(G)}else var Tx=w(G);var ex=Tx;break}else var ex=w(G)}else var ex=w(G);return ex===0?[0,S,Mt(0,l2(G))]:bx(hn0)});case 10:return[0,x,Mt(0,l2(r))];case 11:return O2(x,r,function(S,G){or(G);x:if(Ae(y(G))===0&&$5(y(G))===0&&Z1(y(G))===0){r:for(;;){var Z0=z5(y(G));if(2>>0){var ex=w(G);break x}switch(Z0){case 0:break;case 1:break r;default:var ex=0;break x}}for(;;){r:{if(Z1(y(G))===0){e:for(;;){var yx=z5(y(G));if(2>>0){var Tx=w(G);break r}switch(yx){case 0:break;case 1:break e;default:var Tx=0;break r}}continue}var Tx=w(G)}var ex=Tx;break}}else var ex=w(G);return ex===0?[0,S,qt(1,l2(G))]:bx(mn0)});case 12:return[0,x,qt(1,l2(r))];case 13:return O2(x,r,function(S,G){if(or(G),Ae(y(G))===0&&$5(y(G))===0&&Z1(y(G))===0){for(;;){V(G,0);var Z0=X5(y(G));if(Z0!==0)break}if(Z0===1)for(;;){if(Z1(y(G))===0){for(;;){V(G,0);var yx=X5(y(G));if(yx!==0)break}if(yx===1)continue;var Tx=w(G)}else var Tx=w(G);var ex=Tx;break}else var ex=w(G)}else var ex=w(G);return ex===0?[0,S,Mt(3,l2(G))]:bx(kn0)});case 14:return[0,x,Mt(3,l2(r))];case 15:return O2(x,r,function(S,G){if(or(G),Ae(y(G))===0&&Z1(y(G))===0){for(;;)if(V(G,0),Z1(y(G))!==0){var Z0=w(G);break}}else var Z0=w(G);return Z0===0?[0,S,Mt(1,l2(G))]:bx(pn0)});case 16:return[0,x,Mt(1,l2(r))];case 17:return O2(x,r,function(S,G){or(G);x:if(Ae(y(G))===0&&F5(y(G))===0&&br(y(G))===0){r:for(;;){var Z0=q5(y(G));if(2>>0){var ex=w(G);break x}switch(Z0){case 0:break;case 1:break r;default:var ex=0;break x}}for(;;){r:{if(br(y(G))===0){e:for(;;){var yx=q5(y(G));if(2>>0){var Tx=w(G);break r}switch(yx){case 0:break;case 1:break e;default:var Tx=0;break r}}continue}var Tx=w(G)}var ex=Tx;break}}else var ex=w(G);return ex===0?[0,S,qt(2,l2(G))]:bx(ln0)});case 18:return[0,x,qt(2,l2(r))];case 19:return O2(x,r,function(S,G){if(or(G),Ae(y(G))===0&&F5(y(G))===0&&br(y(G))===0){for(;;){V(G,0);var Z0=Z5(y(G));if(Z0!==0)break}if(Z0===1)for(;;){if(br(y(G))===0){for(;;){V(G,0);var yx=Z5(y(G));if(yx!==0)break}if(yx===1)continue;var Tx=w(G)}else var Tx=w(G);var ex=Tx;break}else var ex=w(G)}else var ex=w(G);return ex===0?[0,S,Mt(4,l2(G))]:bx(vn0)});case 20:return[0,x,Mt(4,l2(r))];case 21:return O2(x,r,function(S,G){function Z0(vx){var nr=nh(y(vx));if(2>>0)return w(vx);switch(nr){case 0:var gr=ro(y(vx));return gr===0?yx(vx):gr===1?Tx(vx):w(vx);case 1:return yx(vx);default:return Tx(vx)}}function yx(vx){for(;;){var nr=nl(y(vx));if(nr!==0)return nr===1?0:w(vx)}}function Tx(vx){for(;;){var nr=Ft(y(vx));if(2>>0)return w(vx);switch(nr){case 0:break;case 1:for(;;){if(vr(y(vx))!==0)return w(vx);x:for(;;){var gr=Ft(y(vx));if(2>>0)return w(vx);switch(gr){case 0:break;case 1:break x;default:return 0}}}break;default:return 0}}}function ex(vx){var nr=Q5(y(vx));if(nr!==0)return nr===1?Z0(vx):w(vx);x:for(;;){var gr=le(y(vx));if(2>>0)return w(vx);switch(gr){case 0:break;case 1:return Z0(vx);default:break x}}for(;;){if(vr(y(vx))!==0)return w(vx);x:for(;;){var Nr=le(y(vx));if(2>>0)return w(vx);switch(Nr){case 0:break;case 1:return Z0(vx);default:break x}}}}or(G);var m0=xo(y(G));if(2>>0)var Dx=w(G);else x:switch(m0){case 0:if(vr(y(G))===0){r:for(;;){var Ex=le(y(G));if(2>>0){var Dx=w(G);break x}switch(Ex){case 0:break;case 1:var Dx=Z0(G);break x;default:break r}}for(;;){r:{if(vr(y(G))===0){e:for(;;){var qx=le(y(G));if(2>>0){var O0=w(G);break r}switch(qx){case 0:break;case 1:var O0=Z0(G);break r;default:break e}}continue}var O0=w(G)}var Dx=O0;break}}else var Dx=w(G);break;case 1:var Wx=R5(y(G)),Dx=Wx===0?ex(G):Wx===1?Z0(G):w(G);break;default:r:for(;;){var Yx=V5(y(G));if(2>>0){var Dx=w(G);break}switch(Yx){case 0:var Dx=ex(G);break r;case 1:break;default:var Dx=Z0(G);break r}}}if(Dx!==0)return bx(on0);var fx=l2(G),Qx=I1(S,zr(S,G),42);return[0,Qx,qt(2,fx)]});case 22:var px=l2(r),dx=I1(x,zr(x,r),42);return[0,dx,qt(2,px)];case 23:return O2(x,r,function(S,G){function Z0(fx){var Qx=nh(y(fx));if(2>>0)return w(fx);switch(Qx){case 0:var vx=ro(y(fx));return vx===0?yx(fx):vx===1?Tx(fx):w(fx);case 1:return yx(fx);default:return Tx(fx)}}function yx(fx){for(;;)if(V(fx,0),vr(y(fx))!==0)return w(fx)}function Tx(fx){for(;;){V(fx,0);var Qx=to(y(fx));if(Qx!==0){if(Qx!==1)return w(fx);for(;;){if(vr(y(fx))!==0)return w(fx);for(;;){V(fx,0);var vx=to(y(fx));if(vx!==0)break}if(vx!==1)return w(fx)}}}}function ex(fx){var Qx=Q5(y(fx));if(Qx!==0)return Qx===1?Z0(fx):w(fx);x:for(;;){var vx=le(y(fx));if(2>>0)return w(fx);switch(vx){case 0:break;case 1:return Z0(fx);default:break x}}for(;;){if(vr(y(fx))!==0)return w(fx);x:for(;;){var nr=le(y(fx));if(2>>0)return w(fx);switch(nr){case 0:break;case 1:return Z0(fx);default:break x}}}}or(G);var m0=xo(y(G));if(2>>0)var Dx=w(G);else x:switch(m0){case 0:if(vr(y(G))===0){r:for(;;){var Ex=le(y(G));if(2>>0){var Dx=w(G);break x}switch(Ex){case 0:break;case 1:var Dx=Z0(G);break x;default:break r}}for(;;){r:{if(vr(y(G))===0){e:for(;;){var qx=le(y(G));if(2>>0){var O0=w(G);break r}switch(qx){case 0:break;case 1:var O0=Z0(G);break r;default:break e}}continue}var O0=w(G)}var Dx=O0;break}}else var Dx=w(G);break;case 1:var Wx=R5(y(G)),Dx=Wx===0?ex(G):Wx===1?Z0(G):w(G);break;default:r:for(;;){var Yx=V5(y(G));if(2>>0){var Dx=w(G);break}switch(Yx){case 0:var Dx=ex(G);break r;case 1:break;default:var Dx=Z0(G);break r}}}return Dx===0?[0,S,Mt(4,l2(G))]:bx(an0)});case 24:return[0,x,Mt(4,l2(r))];case 25:return O2(x,r,function(S,G){function Z0(Yx){for(;;){var fx=Ft(y(Yx));if(2>>0)return w(Yx);switch(fx){case 0:break;case 1:for(;;){if(vr(y(Yx))!==0)return w(Yx);x:for(;;){var Qx=Ft(y(Yx));if(2>>0)return w(Yx);switch(Qx){case 0:break;case 1:break x;default:return 0}}}break;default:return 0}}}function yx(Yx){var fx=nl(y(Yx));return fx===0?Z0(Yx):fx===1?0:w(Yx)}or(G);var Tx=xo(y(G));if(2>>0)var ex=w(G);else x:switch(Tx){case 0:var ex=vr(y(G))===0?Z0(G):w(G);break;case 1:for(;;){var m0=ul(y(G));if(m0===0){var ex=yx(G);break}if(m0!==1){var ex=w(G);break}}break;default:r:for(;;){var Dx=no(y(G));if(2>>0){var ex=w(G);break x}switch(Dx){case 0:var ex=yx(G);break x;case 1:break;default:break r}}for(;;){r:{if(vr(y(G))===0){e:for(;;){var Ex=no(y(G));if(2>>0){var qx=w(G);break r}switch(Ex){case 0:var qx=yx(G);break r;case 1:break;default:break e}}continue}var qx=w(G)}var ex=qx;break}}if(ex!==0)return bx(sn0);var O0=l2(G),Wx=I1(S,zr(S,G),34);return[0,Wx,qt(2,O0)]});case 26:return O2(x,r,function(S,G){or(G);var Z0=ro(y(G));x:if(Z0===0)for(;;){var yx=nl(y(G));if(yx!==0){if(yx===1){var Dx=0;break}var Dx=w(G);break}}else if(Z0===1){r:for(;;){var Tx=Ft(y(G));if(2>>0){var Dx=w(G);break x}switch(Tx){case 0:break;case 1:break r;default:var Dx=0;break x}}for(;;){r:{if(vr(y(G))===0){e:for(;;){var ex=Ft(y(G));if(2>>0){var m0=w(G);break r}switch(ex){case 0:break;case 1:break e;default:var m0=0;break r}}continue}var m0=w(G)}var Dx=m0;break}}else var Dx=w(G);return Dx===0?[0,S,qt(2,l2(G))]:bx(cn0)});case 27:var W=l2(r),g0=I1(x,zr(x,r),34);return[0,g0,qt(2,W)];case 28:return[0,x,qt(2,l2(r))];case 29:return O2(x,r,function(S,G){function Z0(O0){for(;;){V(O0,0);var Wx=to(y(O0));if(Wx!==0){if(Wx!==1)return w(O0);for(;;){if(vr(y(O0))!==0)return w(O0);for(;;){V(O0,0);var Yx=to(y(O0));if(Yx!==0)break}if(Yx!==1)return w(O0)}}}}function yx(O0){return V(O0,0),vr(y(O0))===0?Z0(O0):w(O0)}or(G);var Tx=xo(y(G));if(2>>0)var ex=w(G);else x:switch(Tx){case 0:var ex=vr(y(G))===0?Z0(G):w(G);break;case 1:for(;;){V(G,0);var m0=ul(y(G));if(m0===0){var ex=yx(G);break}if(m0!==1){var ex=w(G);break}}break;default:r:for(;;){V(G,0);var Dx=no(y(G));if(2>>0){var ex=w(G);break x}switch(Dx){case 0:var ex=yx(G);break x;case 1:break;default:break r}}for(;;){r:{if(vr(y(G))===0){e:for(;;){V(G,0);var Ex=no(y(G));if(2>>0){var qx=w(G);break r}switch(Ex){case 0:var qx=yx(G);break r;case 1:break;default:break e}}continue}var qx=w(G)}var ex=qx;break}}return ex===0?[0,S,Mt(4,l2(G))]:bx(fn0)});case 30:return[0,x,Mt(4,l2(r))];case 31:return[0,x,67];case 32:return[0,x,6];default:return[0,x,7]}switch(f0){case 34:return[0,x,0];case 35:return[0,x,1];case 36:return[0,x,2];case 37:return[0,x,3];case 38:return[0,x,4];case 39:return[0,x,5];case 40:return[0,x,12];case 41:return[0,x,10];case 42:return[0,x,8];case 43:return[0,x,9];case 44:return[0,x,87];case 45:return[0,x,84];case 46:return[0,x,86];case 47:return[0,x,6];case 48:return[0,x,7];case 49:return[0,x,99];case 50:return[0,x,y2];case 51:return[0,x,83];case 52:return[0,x,86];case 53:return[0,x,K2];case 54:return[0,x,87];case 55:return[0,x,89];case 56:return[0,x,88];case 57:return[0,x,90];case 58:return[0,x,92];case 59:return[0,x,11];case 60:return[0,x,83];case 61:return[0,x,ft];case 62:return[0,x,Pt];case 63:return[0,x,u8];case 64:return[0,x,Ek];case 65:var B=r[6];tU(r);var h0=Z6(x,B,r[3]);LC(r,B);var _0=l2(r),d0=cU(x,_0),E0=d0[2],U=d0[1],Kx=ux(E0,tm);if(0<=Kx){if(0>=Kx)return[0,U,Ik];var Ix=ux(E0,p3);if(0<=Ix){if(0>=Ix)return[0,U,mf];if(!P(E0,m6))return[0,U,c2];if(!P(E0,$s))return[0,U,32];if(!P(E0,Ws))return[0,U,47];if(!P(E0,sk))return[0,U,qa];if(!P(E0,Cp))return[0,U,en];if(!P(E0,Ys))return[0,U,y6]}else{if(!P(E0,Fp))return[0,U,av];if(!P(E0,Lp))return[0,U,P3];if(!P(E0,cv))return[0,U,30];if(!P(E0,k3))return[0,U,f6];if(!P(E0,ev))return[0,U,Xr];if(!P(E0,Re))return[0,U,43]}}else{var z0=ux(E0,Ee);if(0<=z0){if(0>=z0)return[0,U,F3];if(!P(E0,rc))return[0,U,42];if(!P(E0,Xs))return[0,U,31];if(!P(E0,d3))return[0,U,u6];if(!P(E0,GO))return[0,U,M2];if(!P(E0,ce))return[0,U,54];if(!P(E0,p6))return[0,U,Ko]}else{if(!P(E0,bp))return[0,U,iv];if(!P(E0,E3))return[0,U,w6];if(!P(E0,lv))return[0,U,h3];if(!P(E0,y8))return[0,U,_n0];if(!P(E0,x6))return[0,U,wn0];if(!P(E0,Ja))return[0,U,28]}}return[0,U,[4,h0,E0,V6(_0)]];case 66:var Kr=x[4]?I1(x,zr(x,r),92):x;return[0,Kr,kr];default:return[0,x,[7,Ox(r)]]}}),Vb0=x4(function(x,r){function e(_){for(;;)if(V(_,33),cr(y(_))!==0)return w(_)}function t(_){V(_,33);var $=$B(y(_));if(3<$>>>0)return w(_);switch($){case 0:return e(_);case 1:var ix=ro(y(_));if(ix===0)for(;;){V(_,28);var U0=tl(y(_));if(2>>0)return w(_);switch(U0){case 0:return u(_);case 1:break;default:return i(_)}}else{if(ix!==1)return w(_);for(;;){V(_,28);var cx=_s(y(_));if(3>>0)return w(_);switch(cx){case 0:return u(_);case 1:break;case 2:return c(_);default:return i(_)}}}break;case 2:for(;;){V(_,28);var wx=tl(y(_));if(2>>0)return w(_);switch(wx){case 0:return v(_);case 1:break;default:return a(_)}}break;default:for(;;){V(_,28);var Or=_s(y(_));if(3>>0)return w(_);switch(Or){case 0:return v(_);case 1:break;case 2:return c(_);default:return a(_)}}}}function u(_){for(;;)if(V(_,27),cr(y(_))!==0)return w(_)}function i(_){V(_,26);var $=X2(y(_));if($!==0)return $===1?u(_):w(_);for(;;)if(V(_,25),cr(y(_))!==0)return w(_)}function c(_){for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,28);var $=_s(y(_));if(3<$>>>0)return w(_);switch($){case 0:return u(_);case 1:break;case 2:break x;default:return i(_)}}}}function v(_){for(;;)if(V(_,27),cr(y(_))!==0)return w(_)}function a(_){V(_,26);var $=X2(y(_));if($!==0)return $===1?v(_):w(_);for(;;)if(V(_,25),cr(y(_))!==0)return w(_)}function l(_){V(_,31);var $=X2(y(_));if($!==0)return $===1?e(_):w(_);for(;;)if(V(_,29),cr(y(_))!==0)return w(_)}function m(_){return V(_,3),rU(y(_))===0?3:w(_)}function h(_){return H5(y(_))===0&&W5(y(_))===0&&HB(y(_))===0&&XB(y(_))===0&&YB(y(_))===0&&G5(y(_))===0&&Q6(y(_))===0&&H5(y(_))===0&&uo(y(_))===0&&QC(y(_))===0&&Av(y(_))===0?3:w(_)}function T(_){V(_,34);var $=BB(y(_));if(3<$>>>0)return w(_);switch($){case 0:return e(_);case 1:x:for(;;){V(_,34);var ix=eo(y(_));if(4>>0)return w(_);switch(ix){case 0:return e(_);case 1:break;case 2:return t(_);case 3:break x;default:return l(_)}}for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,34);var U0=eo(y(_));if(4>>0)return w(_);switch(U0){case 0:return e(_);case 1:break;case 2:return t(_);case 3:break x;default:return l(_)}}}break;case 2:return t(_);default:return l(_)}}function b(_){for(;;)if(V(_,19),cr(y(_))!==0)return w(_)}function N(_){V(_,34);var $=tl(y(_));if(2<$>>>0)return w(_);switch($){case 0:return e(_);case 1:x:for(;;){V(_,34);var ix=_s(y(_));if(3>>0)return w(_);switch(ix){case 0:return e(_);case 1:break;case 2:break x;default:return l(_)}}for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,34);var U0=_s(y(_));if(3>>0)return w(_);switch(U0){case 0:return e(_);case 1:break;case 2:break x;default:return l(_)}}}break;default:return l(_)}}function C(_){for(;;)if(V(_,17),cr(y(_))!==0)return w(_)}function I(_){for(;;)if(V(_,17),cr(y(_))!==0)return w(_)}function F(_){for(;;)if(V(_,11),cr(y(_))!==0)return w(_)}function M(_){for(;;)if(V(_,11),cr(y(_))!==0)return w(_)}function Y(_){for(;;)if(V(_,15),cr(y(_))!==0)return w(_)}function q(_){for(;;)if(V(_,15),cr(y(_))!==0)return w(_)}function K(_){for(;;)if(V(_,23),cr(y(_))!==0)return w(_)}function u0(_){for(;;)if(V(_,23),cr(y(_))!==0)return w(_)}function Q(_){V(_,32);var $=X2(y(_));if($!==0)return $===1?e(_):w(_);for(;;)if(V(_,30),cr(y(_))!==0)return w(_)}function e0(_){for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,34);var $=WB(y(_));if(4<$>>>0)return w(_);switch($){case 0:return e(_);case 1:return N(_);case 2:break;case 3:break x;default:return Q(_)}}}}or(r);var f0=function(_){var $=Ub0(y(_));if(36<$>>>0)return w(_);switch($){case 0:return 98;case 1:return 99;case 2:if(V(_,1),gs(y(_))!==0)return w(_);for(;;)if(V(_,1),gs(y(_))!==0)return w(_);break;case 3:return 0;case 4:return V(_,0),Pe(y(_))===0?0:w(_);case 5:return V(_,88),wn(y(_))===0?(V(_,58),wn(y(_))===0?54:w(_)):w(_);case 6:return 7;case 7:V(_,95);var ix=y(_),U0=32>>0)return w(_);switch(Or){case 0:return V(_,83),wn(y(_))===0?70:w(_);case 1:return 4;default:return 69}case 14:V(_,80);var Hx=y(_),x2=42>>0)return w(_);switch(sx){case 0:return e(_);case 1:break;case 2:return t(_);case 3:break x;default:return l(_)}}for(;;){if(vr(y(_))!==0)return w(_);x:for(;;){V(_,34);var Sx=eo(y(_));if(4>>0)return w(_);switch(Sx){case 0:return e(_);case 1:break;case 2:return t(_);case 3:break x;default:return l(_)}}}break;case 18:V(_,93);var Zx=UB(y(_));if(2>>0)return w(_);switch(Zx){case 0:V(_,2);var Ur=U5(y(_));if(2>>0)return w(_);switch(Ur){case 0:for(;;){var Y2=U5(y(_));if(2>>0)return w(_);switch(Y2){case 0:break;case 1:return m(_);default:return h(_)}}break;case 1:return m(_);default:return h(_)}break;case 1:return 5;default:return 92}break;case 19:V(_,34);var pe=KB(y(_));if(8>>0)return w(_);switch(pe){case 0:return e(_);case 1:return T(_);case 2:x:{r:for(;;){V(_,20);var j1=QB(y(_));if(4>>0)return w(_);switch(j1){case 0:return b(_);case 1:return N(_);case 2:break;case 3:break x;default:break r}}V(_,19);var kt=X2(y(_));if(kt!==0)return kt===1?b(_):w(_);for(;;)if(V(_,19),cr(y(_))!==0)return w(_)}x:for(;;){V(_,18);var zt=B5(y(_));if(3>>0)return w(_);switch(zt){case 0:return C(_);case 1:return N(_);case 2:break;default:break x}}V(_,17);var O1=X2(y(_));if(O1!==0)return O1===1?C(_):w(_);for(;;)if(V(_,17),cr(y(_))!==0)return w(_);break;case 3:x:for(;;){V(_,18);var q1=B5(y(_));if(3>>0)return w(_);switch(q1){case 0:return I(_);case 1:return N(_);case 2:break;default:break x}}V(_,17);var T2=X2(y(_));if(T2!==0)return T2===1?I(_):w(_);for(;;)if(V(_,17),cr(y(_))!==0)return w(_);break;case 4:V(_,33);var En=zB(y(_));if(En===0)return e(_);if(En!==1)return w(_);x:{r:for(;;){V(_,12);var Sn=eh(y(_));if(3>>0)return w(_);switch(Sn){case 0:return F(_);case 1:break;case 2:break x;default:break r}}V(_,10);var Ss=X2(y(_));if(Ss!==0)return Ss===1?F(_):w(_);for(;;)if(V(_,9),cr(y(_))!==0)return w(_)}x:for(;;){if(ws(y(_))!==0)return w(_);r:for(;;){V(_,12);var ke=eh(y(_));if(3>>0)return w(_);switch(ke){case 0:return M(_);case 1:break;case 2:break r;default:break x}}}V(_,10);var Qe=X2(y(_));if(Qe!==0)return Qe===1?M(_):w(_);for(;;)if(V(_,9),cr(y(_))!==0)return w(_);break;case 5:return t(_);case 6:V(_,33);var vo=JB(y(_));if(vo===0)return e(_);if(vo!==1)return w(_);x:{r:for(;;){V(_,16);var mt=xh(y(_));if(3>>0)return w(_);switch(mt){case 0:return Y(_);case 1:break;case 2:break x;default:break r}}V(_,14);var dr=X2(y(_));if(dr!==0)return dr===1?Y(_):w(_);for(;;)if(V(_,13),cr(y(_))!==0)return w(_)}x:for(;;){if(Z1(y(_))!==0)return w(_);r:for(;;){V(_,16);var lo=xh(y(_));if(3>>0)return w(_);switch(lo){case 0:return q(_);case 1:break;case 2:break r;default:break x}}}V(_,14);var As=X2(y(_));if(As!==0)return As===1?q(_):w(_);for(;;)if(V(_,13),cr(y(_))!==0)return w(_);break;case 7:V(_,33);var ga=LB(y(_));if(ga===0)return e(_);if(ga!==1)return w(_);x:{r:for(;;){V(_,24);var Uv=th(y(_));if(3>>0)return w(_);switch(Uv){case 0:return K(_);case 1:break;case 2:break x;default:break r}}V(_,22);var Kt=X2(y(_));if(Kt!==0)return Kt===1?K(_):w(_);for(;;)if(V(_,21),cr(y(_))!==0)return w(_)}x:for(;;){if(br(y(_))!==0)return w(_);r:for(;;){V(_,24);var An=th(y(_));if(3>>0)return w(_);switch(An){case 0:return u0(_);case 1:break;case 2:break r;default:break x}}}V(_,22);var wa=X2(y(_));if(wa!==0)return wa===1?u0(_):w(_);for(;;)if(V(_,21),cr(y(_))!==0)return w(_);break;default:return Q(_)}break;case 20:V(_,34);var po=Y5(y(_));if(5>>0)return w(_);switch(po){case 0:return e(_);case 1:return T(_);case 2:for(;;){V(_,34);var ko=Y5(y(_));if(5>>0)return w(_);switch(ko){case 0:return e(_);case 1:return T(_);case 2:break;case 3:return t(_);case 4:return e0(_);default:return Q(_)}}break;case 3:return t(_);case 4:return e0(_);default:return Q(_)}break;case 21:return 46;case 22:return 44;case 23:V(_,78);var _a=y(_),ba=59<_a?61<_a?-1:Y0(z8,_a-60|0)-1|0:-1;return ba===0?(V(_,62),wn(y(_))===0?61:w(_)):ba===1?55:w(_);case 24:V(_,90);var Ta=$C(y(_));return Ta===0?(V(_,57),wn(y(_))===0?53:w(_)):Ta===1?91:w(_);case 25:V(_,79);var mo=$C(y(_));if(mo===0)return 56;if(mo!==1)return w(_);V(_,66);var me=$C(y(_));return me===0?63:me===1?(V(_,65),wn(y(_))===0?64:w(_)):w(_);case 26:V(_,50);var Q2=y(_),Ea=45>>0)return bx(Ec0);var a0=f0;if(50>a0)switch(a0){case 0:return[2,xe(x,r)];case 1:return[2,x];case 2:var Z=P1(x,r),v0=Wr(Xr),t0=Pv(x,v0,r),y0=t0[1];return[1,y0,Lt(y0,Z,t0[2],v0,1)];case 3:var n0=Ox(r);if(!x[5]){var s0=P1(x,r),l0=Wr(Xr);ir(l0,E1(n0,2,Cx(n0)-2|0));var w0=Pv(x,l0,r),L0=w0[1];return[1,L0,Lt(L0,s0,w0[2],l0,1)]}var I0=x[4]?uU(x,zr(x,r),n0):x,j0=O5(1,I0),S0=A5(r);return _r(W6(r,S0-1|0,1),Uo)&&P(W6(r,S0-2|0,1),Uo)?[0,j0,87]:[2,j0];case 4:if(x[4])return[2,O5(0,x)];el(r),or(r);var W0=qB(y(r))===0?0:w(r);return W0===0?[0,x,K2]:bx(Sc0);case 5:var A0=P1(x,r),J0=Wr(Xr),b0=il(x,J0,r),z=b0[1];return[1,z,Lt(z,A0,b0[2],J0,0)];case 6:if(r[6]!==0)return[0,x,Ac0];var C0=P1(x,r),V0=Wr(Xr),N0=il(x,V0,r),rx=N0[1],xx=[0,rx[1],C0,N0[2]];return[0,rx,[6,xx,G2(V0)]];case 7:var nx=Ox(r),mx=P1(x,r),F0=Wr(Xr),px=Wr(Xr);ir(px,nx);var dx=aU(x,nx,F0,px,0,r),W=dx[1],g0=dx[3],B=[0,W[1],mx,dx[2]],h0=G2(px);return[0,W,[2,[0,B,G2(F0),h0,g0]]];case 8:var _0=Wr(Xr),d0=Wr(Xr),E0=P1(x,r),U=oU(x,_0,d0,r),Kx=U[1],Ix=U[2],z0=Ie(Kx,r),Kr=[0,Kx[1],E0,z0],S=G2(d0);return[0,Kx,[3,[0,Kr,G2(_0),S,1,Ix]]];case 9:return O2(x,r,function(_,$){or($);x:if(Ae(y($))===0&&K5(y($))===0&&ws(y($))===0){r:for(;;){var ix=M5(y($));if(2>>0){var wx=w($);break x}switch(ix){case 0:break;case 1:break r;default:var wx=0;break x}}for(;;){r:{if(ws(y($))===0){e:for(;;){var U0=M5(y($));if(2>>0){var cx=w($);break r}switch(U0){case 0:break;case 1:break e;default:var cx=0;break r}}continue}var cx=w($)}var wx=cx;break}}else var wx=w($);return wx===0?[0,_,[1,0,Ox($)]]:bx(Tc0)});case 10:return[0,x,[1,0,Ox(r)]];case 11:return O2(x,r,function(_,$){if(or($),Ae(y($))===0&&K5(y($))===0&&ws(y($))===0){for(;;){V($,0);var ix=L5(y($));if(ix!==0)break}if(ix===1)for(;;){if(ws(y($))===0){for(;;){V($,0);var U0=L5(y($));if(U0!==0)break}if(U0===1)continue;var cx=w($)}else var cx=w($);var wx=cx;break}else var wx=w($)}else var wx=w($);return wx===0?[0,_,[0,0,Ox($)]]:bx(bc0)});case 12:return[0,x,[0,0,Ox(r)]];case 13:return O2(x,r,function(_,$){or($);x:if(Ae(y($))===0&&$5(y($))===0&&Z1(y($))===0){r:for(;;){var ix=z5(y($));if(2>>0){var wx=w($);break x}switch(ix){case 0:break;case 1:break r;default:var wx=0;break x}}for(;;){r:{if(Z1(y($))===0){e:for(;;){var U0=z5(y($));if(2>>0){var cx=w($);break r}switch(U0){case 0:break;case 1:break e;default:var cx=0;break r}}continue}var cx=w($)}var wx=cx;break}}else var wx=w($);return wx===0?[0,_,[1,1,Ox($)]]:bx(_c0)});case 14:return[0,x,[1,1,Ox(r)]];case 15:return O2(x,r,function(_,$){if(or($),Ae(y($))===0&&$5(y($))===0&&Z1(y($))===0){for(;;){V($,0);var ix=X5(y($));if(ix!==0)break}if(ix===1)for(;;){if(Z1(y($))===0){for(;;){V($,0);var U0=X5(y($));if(U0!==0)break}if(U0===1)continue;var cx=w($)}else var cx=w($);var wx=cx;break}else var wx=w($)}else var wx=w($);return wx===0?[0,_,[0,3,Ox($)]]:bx(wc0)});case 16:return[0,x,[0,3,Ox(r)]];case 17:return O2(x,r,function(_,$){if(or($),Ae(y($))===0){for(;;){var ix=y($),U0=47>>0){var wx=w($);break x}switch(ix){case 0:break;case 1:break r;default:var wx=0;break x}}for(;;){r:{if(br(y($))===0){e:for(;;){var U0=q5(y($));if(2>>0){var cx=w($);break r}switch(U0){case 0:break;case 1:break e;default:var cx=0;break r}}continue}var cx=w($)}var wx=cx;break}}else var wx=w($);return wx===0?[0,_,[1,2,Ox($)]]:bx(dc0)});case 22:return[0,x,[1,2,Ox(r)]];case 23:return O2(x,r,function(_,$){if(or($),Ae(y($))===0&&F5(y($))===0&&br(y($))===0){for(;;){V($,0);var ix=Z5(y($));if(ix!==0)break}if(ix===1)for(;;){if(br(y($))===0){for(;;){V($,0);var U0=Z5(y($));if(U0!==0)break}if(U0===1)continue;var cx=w($)}else var cx=w($);var wx=cx;break}else var wx=w($)}else var wx=w($);return wx===0?[0,_,[0,4,Ox($)]]:bx(hc0)});case 24:return[0,x,[0,4,Ox(r)]];case 25:return O2(x,r,function(_,$){function ix(Zx){var Ur=nh(y(Zx));if(2>>0)return w(Zx);switch(Ur){case 0:var Y2=ro(y(Zx));return Y2===0?U0(Zx):Y2===1?cx(Zx):w(Zx);case 1:return U0(Zx);default:return cx(Zx)}}function U0(Zx){for(;;){var Ur=nl(y(Zx));if(Ur!==0)return Ur===1?0:w(Zx)}}function cx(Zx){for(;;){var Ur=Ft(y(Zx));if(2>>0)return w(Zx);switch(Ur){case 0:break;case 1:for(;;){if(vr(y(Zx))!==0)return w(Zx);x:for(;;){var Y2=Ft(y(Zx));if(2>>0)return w(Zx);switch(Y2){case 0:break;case 1:break x;default:return 0}}}break;default:return 0}}}function wx(Zx){var Ur=Q5(y(Zx));if(Ur!==0)return Ur===1?ix(Zx):w(Zx);x:for(;;){var Y2=le(y(Zx));if(2>>0)return w(Zx);switch(Y2){case 0:break;case 1:return ix(Zx);default:break x}}for(;;){if(vr(y(Zx))!==0)return w(Zx);x:for(;;){var pe=le(y(Zx));if(2>>0)return w(Zx);switch(pe){case 0:break;case 1:return ix(Zx);default:break x}}}}or($);var Or=xo(y($));if(2>>0)var Hx=w($);else x:switch(Or){case 0:if(vr(y($))===0){r:for(;;){var x2=le(y($));if(2>>0){var Hx=w($);break x}switch(x2){case 0:break;case 1:var Hx=ix($);break x;default:break r}}for(;;){r:{if(vr(y($))===0){e:for(;;){var hr=le(y($));if(2
>>0){var Dr=w($);break r}switch(hr){case 0:break;case 1:var Dr=ix($);break r;default:break e}}continue}var Dr=w($)}var Hx=Dr;break}}else var Hx=w($);break;case 1:var r2=R5(y($)),Hx=r2===0?wx($):r2===1?ix($):w($);break;default:r:for(;;){var sx=V5(y($));if(2>>0){var Hx=w($);break}switch(sx){case 0:var Hx=wx($);break r;case 1:break;default:var Hx=ix($);break r}}}if(Hx!==0)return bx(mc0);var Sx=I1(_,zr(_,$),42);return[0,Sx,[1,2,Ox($)]]});case 26:var G=I1(x,zr(x,r),42);return[0,G,[1,2,Ox(r)]];case 27:return O2(x,r,function(_,$){function ix(Sx){var Zx=nh(y(Sx));if(2>>0)return w(Sx);switch(Zx){case 0:var Ur=ro(y(Sx));return Ur===0?U0(Sx):Ur===1?cx(Sx):w(Sx);case 1:return U0(Sx);default:return cx(Sx)}}function U0(Sx){for(;;)if(V(Sx,0),vr(y(Sx))!==0)return w(Sx)}function cx(Sx){for(;;){V(Sx,0);var Zx=to(y(Sx));if(Zx!==0){if(Zx!==1)return w(Sx);for(;;){if(vr(y(Sx))!==0)return w(Sx);for(;;){V(Sx,0);var Ur=to(y(Sx));if(Ur!==0)break}if(Ur!==1)return w(Sx)}}}}function wx(Sx){var Zx=Q5(y(Sx));if(Zx!==0)return Zx===1?ix(Sx):w(Sx);x:for(;;){var Ur=le(y(Sx));if(2>>0)return w(Sx);switch(Ur){case 0:break;case 1:return ix(Sx);default:break x}}for(;;){if(vr(y(Sx))!==0)return w(Sx);x:for(;;){var Y2=le(y(Sx));if(2>>0)return w(Sx);switch(Y2){case 0:break;case 1:return ix(Sx);default:break x}}}}or($);var Or=xo(y($));if(2>>0)var Hx=w($);else x:switch(Or){case 0:if(vr(y($))===0){r:for(;;){var x2=le(y($));if(2>>0){var Hx=w($);break x}switch(x2){case 0:break;case 1:var Hx=ix($);break x;default:break r}}for(;;){r:{if(vr(y($))===0){e:for(;;){var hr=le(y($));if(2
>>0){var Dr=w($);break r}switch(hr){case 0:break;case 1:var Dr=ix($);break r;default:break e}}continue}var Dr=w($)}var Hx=Dr;break}}else var Hx=w($);break;case 1:var r2=R5(y($)),Hx=r2===0?wx($):r2===1?ix($):w($);break;default:r:for(;;){var sx=V5(y($));if(2>>0){var Hx=w($);break}switch(sx){case 0:var Hx=wx($);break r;case 1:break;default:var Hx=ix($);break r}}}return Hx===0?[0,_,[0,4,Ox($)]]:bx(kc0)});case 28:return[0,x,[0,4,Ox(r)]];case 29:return O2(x,r,function(_,$){function ix(r2){for(;;){var sx=Ft(y(r2));if(2>>0)return w(r2);switch(sx){case 0:break;case 1:for(;;){if(vr(y(r2))!==0)return w(r2);x:for(;;){var Sx=Ft(y(r2));if(2>>0)return w(r2);switch(Sx){case 0:break;case 1:break x;default:return 0}}}break;default:return 0}}}function U0(r2){var sx=nl(y(r2));return sx===0?ix(r2):sx===1?0:w(r2)}or($);var cx=xo(y($));if(2>>0)var wx=w($);else x:switch(cx){case 0:var wx=vr(y($))===0?ix($):w($);break;case 1:for(;;){var Or=ul(y($));if(Or===0){var wx=U0($);break}if(Or!==1){var wx=w($);break}}break;default:r:for(;;){var Hx=no(y($));if(2>>0){var wx=w($);break x}switch(Hx){case 0:var wx=U0($);break x;case 1:break;default:break r}}for(;;){r:{if(vr(y($))===0){e:for(;;){var x2=no(y($));if(2>>0){var hr=w($);break r}switch(x2){case 0:var hr=U0($);break r;case 1:break;default:break e}}continue}var hr=w($)}var wx=hr;break}}if(wx!==0)return bx(pc0);var Dr=I1(_,zr(_,$),34);return[0,Dr,[1,2,Ox($)]]});case 30:return O2(x,r,function(_,$){or($);var ix=ro(y($));x:if(ix===0)for(;;){var U0=nl(y($));if(U0!==0){if(U0===1){var Hx=0;break}var Hx=w($);break}}else if(ix===1){r:for(;;){var cx=Ft(y($));if(2>>0){var Hx=w($);break x}switch(cx){case 0:break;case 1:break r;default:var Hx=0;break x}}for(;;){r:{if(vr(y($))===0){e:for(;;){var wx=Ft(y($));if(2>>0){var Or=w($);break r}switch(wx){case 0:break;case 1:break e;default:var Or=0;break r}}continue}var Or=w($)}var Hx=Or;break}}else var Hx=w($);return Hx===0?[0,_,[1,2,Ox($)]]:bx(lc0)});case 31:var Z0=I1(x,zr(x,r),34);return[0,Z0,[1,2,Ox(r)]];case 32:return[0,x,[1,2,Ox(r)]];case 33:return O2(x,r,function(_,$){function ix(Dr){for(;;){V(Dr,0);var r2=to(y(Dr));if(r2!==0){if(r2!==1)return w(Dr);for(;;){if(vr(y(Dr))!==0)return w(Dr);for(;;){V(Dr,0);var sx=to(y(Dr));if(sx!==0)break}if(sx!==1)return w(Dr)}}}}function U0(Dr){return V(Dr,0),vr(y(Dr))===0?ix(Dr):w(Dr)}or($);var cx=xo(y($));if(2>>0)var wx=w($);else x:switch(cx){case 0:var wx=vr(y($))===0?ix($):w($);break;case 1:for(;;){V($,0);var Or=ul(y($));if(Or===0){var wx=U0($);break}if(Or!==1){var wx=w($);break}}break;default:r:for(;;){V($,0);var Hx=no(y($));if(2>>0){var wx=w($);break x}switch(Hx){case 0:var wx=U0($);break x;case 1:break;default:break r}}for(;;){r:{if(vr(y($))===0){e:for(;;){V($,0);var x2=no(y($));if(2>>0){var hr=w($);break r}switch(x2){case 0:var hr=U0($);break r;case 1:break;default:break e}}continue}var hr=w($)}var wx=hr;break}}return wx===0?[0,_,[0,4,Ox($)]]:bx(vc0)});case 34:return[0,x,[0,4,Ox(r)]];case 35:var yx=zr(x,r),Tx=Ox(r);return[0,x,[4,yx,Tx,Tx]];case 36:return[0,x,0];case 37:return[0,x,1];case 38:return[0,x,4];case 39:return[0,x,5];case 40:return[0,x,6];case 41:return[0,x,7];case 42:return[0,x,12];case 43:return[0,x,10];case 44:return[0,x,8];case 45:return[0,x,9];case 46:return[0,x,87];case 47:el(r),or(r);var ex=y(r),m0=62=Wx)return[0,x,54];var Yx=ux(O0,C3);if(0<=Yx){if(0>=Yx)return[0,x,52];var fx=ux(O0,Ws);if(0<=fx){if(0>=fx)return[0,x,47];if(!P(O0,Wl))return[0,x,25];if(!P(O0,Ys))return[0,x,48];if(!P(O0,B4))return[0,x,26];if(!P(O0,e8))return[0,x,27];if(!P(O0,z1))return[0,x,59]}else{if(!P(O0,Ke))return[0,x,20];if(!P(O0,xv))return[0,x,22];if(!P(O0,Ye))return[0,x,23];if(!P(O0,$s))return[0,x,32];if(!P(O0,b8))return[0,x,24];if(!P(O0,Yf))return[0,x,62]}}else{var Qx=ux(O0,Yp);if(0<=Qx){if(0>=Qx)return[0,x,55];if(!P(O0,g6))return[0,x,56];if(!P(O0,Ul))return[0,x,57];if(!P(O0,h6))return[0,x,58];if(!P(O0,Ue))return[0,x,19];if(!P(O0,Re))return[0,x,43]}else{if(!P(O0,j3))return[0,x,29];if(!P(O0,vI))return[0,x,21];if(!P(O0,nv))return[0,x,45];if(!P(O0,cv))return[0,x,30];if(!P(O0,sS))return[0,x,64];if(!P(O0,cb))return[0,x,63]}}}else{var vx=ux(O0,zp);if(0<=vx){if(0>=vx)return[0,x,44];var nr=ux(O0,y3);if(0<=nr){if(0>=nr)return[0,x,15];if(!P(O0,_8))return[0,x,16];if(!P(O0,vv))return[0,x,53];if(!P(O0,K1))return[0,x,51];if(!P(O0,Ra))return[0,x,17];if(!P(O0,Ql))return[0,x,18]}else{if(!P(O0,r6))return[0,x,49];if(!P(O0,Rm))return[0,x,50];if(!P(O0,rc))return[0,x,42];if(!P(O0,Xs))return[0,x,31];if(!P(O0,i8))return[0,x,39];if(!P(O0,o8))return[0,x,40]}}else{var gr=ux(O0,Ja);if(0<=gr){if(0>=gr)return[0,x,28];if(!P(O0,Le))return[0,x,36];if(!P(O0,Xe))return[0,x,60];if(!P(O0,_6))return[0,x,61];if(!P(O0,$o))return[0,x,37];if(!P(O0,Vl))return[0,x,46];if(!P(O0,Mp))return[0,x,38]}else{if(!P(O0,Ya))return[0,x,65];if(!P(O0,fv))return[0,x,66];if(!P(O0,ze))return[0,x,33];if(!P(O0,dp))return[0,x,34];if(!P(O0,xm))return[0,x,35];if(!P(O0,Yl))return[0,x,41]}}}var Nr=l2(r),s2=cU(x,Nr),b2=s2[2],k2=s2[1];return[0,k2,[4,qx,b2,V6(Nr)]];case 98:var F2=x[4]?I1(x,zr(x,r),92):x;return[0,F2,kr];default:var jx=lt(x,zr(x,r));return[0,jx,[7,Ox(r)]]}}),N1=gB([0,Ab0]);function r4(x,r){return[0,0,0,r,IB(x)]}function ih(x){var r=x[4];switch(x[3]){case 0:var f0=Vb0(r);break;case 1:var f0=Wb0(r);break;case 2:var f0=Jb0(r);break;case 3:var e=Ie(r,r[2]),t=Wr(Xr),u=Wr(Xr),i=r[2];or(i);var c=y(i),v=en>>0)var a=w(i);else switch(v){case 0:var a=1;break;case 1:var a=4;break;case 2:var a=0;break;case 3:V(i,0);var a=Pe(y(i))===0?0:w(i);break;case 4:var a=2;break;default:var a=3}if(4
>>0)var l=bx(Sn0);else switch(a){case 0:var m=Ox(i);ir(u,m),ir(t,m);var h=lU(xe(r,i),t,u,i),T=Ie(h,i),b=G2(t),N=G2(u),l=[0,h,[9,[0,h[1],e,T],b,N]];break;case 1:var l=[0,r,kr];break;case 2:var l=[0,r,99];break;case 3:var l=[0,r,0];break;default:el(i);var C=lU(r,t,u,i),I=Ie(C,i),F=G2(t),M=G2(u),l=[0,C,[9,[0,C[1],e,I],F,M]]}var Y=l[2],q=l[1],K=nU(q,Y),u0=q[6];if(u0===0)var e0=[0,q,[0,Y,K,0,0]];else var Q=[0,Y,K,tx(u0),0],e0=[0,[0,q[1],q[2],q[3],q[4],q[5],0,q[7]],Q];var f0=e0;break;case 4:var f0=Gb0(r);break;default:var f0=Kb0(r)}var a0=f0[1],Z=f0[2],v0=[0,IB(a0),Z];return x[4]=a0,x[1]?x[2]=[0,v0]:x[1]=[0,v0],v0}function pU(x){var r=x[1];return r?r[1][2]:ih(x)[2]}function fl(x){return D6(x[24][1])}function S2(x){return x[28][5]}function B0(x,r){var e=r[2];x[1][1]=[0,[0,r[1],e],x[1][1]];var t=x[23];return t?p(t[1],x,e):0}function e4(x,r){x[31][1]=r}function io(x,r){if(x===0)return pU(r[26][1]);if(x!==1)throw K0([0,Ir,us0],1);var e=r[26][1];e[1]||ih(e);var t=e[2];return t?t[1][2]:ih(e)[2]}function la(x,r){return x===r[5]?r:[0,r[1],r[2],r[3],r[4],x,r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function kU(x,r){return x===r[10]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],x,r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function ZC(x,r){return x===r[18]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],x,r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function xj(x,r){return x===r[19]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],x,r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function mU(x,r){return x===r[20]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],x,r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function Iv(x,r){return x===r[22]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],x,r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function rj(x,r){return x===r[14]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],x,r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function t4(x,r){return x===r[8]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],x,r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function n4(x,r){return x===r[12]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],x,r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function Nv(x,r){return x===r[15]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],x,r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function ej(x,r){return x===r[16]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],x,r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function hU(x,r){return x===r[6]?r:[0,r[1],r[2],r[3],r[4],r[5],x,r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function dU(x,r){return x===r[7]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],x,r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function tj(x,r){return x===r[13]?r:[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],x,r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],r[23],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function fh(x,r){return[0,r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19],r[20],r[21],r[22],[0,x],r[24],r[25],r[26],r[27],r[28],r[29],r[30],r[31]]}function nj(x){function r(e){return B0(x,e)}return function(e){return T1(r,e)}}function cl(x){var r=x[4][1];return r?[0,r[1][2]]:0}function yU(x){var r=x[4][1];return r?[0,r[1][1]]:0}function gU(x){return[0,x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15],x[16],x[17],x[18],x[19],x[20],x[21],x[22],0,x[24],x[25],x[26],x[27],x[28],x[29],x[30],x[31]]}function wU(x,r,e,t){return[0,x[1],x[2],N1[1],x[4],x[5],0,0,0,0,0,1,x[12],x[13],x[14],x[15],x[16],x[17],e,r,x[20],t,x[22],x[23],x[24],x[25],x[26],x[27],x[28],x[29],x[30],x[31]]}function sl(x){return P(x,vv)&&P(x,ce)&&P(x,j3)&&P(x,Yp)&&P(x,g6)&&P(x,Ul)&&P(x,h6)&&P(x,Re)&&P(x,z1)?0:1}function Cv(x){return P(x,kb)&&P(x,"eval")?0:1}function ch(x){var r=ux(x,_8);x:{if(0<=r){if(0>>0){if(J1>=t+1>>>0)return 1}else if(t===6)return 0}return jv(x,r)}function ol(x){return TU(0,x)}function ka(x,r){var e=rr(x,r);x:{if(typeof e=="number")switch(e){case 29:case 43:case 53:case 54:case 55:case 56:case 57:case 58:case 59:var t=1;break x}else if(e[0]===4){var t=sl(e[2]);break x}var t=0}if(t)return 1;x:{if(typeof e=="number")switch(e){case 14:case 21:case 49:case 61:case 62:case 63:case 64:case 65:case 66:case 127:break;default:break x}else if(e[0]!==4)break x;return 1}return 0}function sh(x,r){return _U(r,rr(x,r))}function EU(x,r){var e=ka(x,r);return e||sh(x,r)}function _n(x){return ka(0,x)}function fo(x){var r=L(x)===15?1:0;if(r)var e=r;else{var t=L(x)===65?1:0;if(t){var u=rr(1,x)===15?1:0;if(u)var i=al(1,x)[2][1],e=G0(x)[3][1]===i?1:0;else var e=u}else var e=t}return e}function ah(x){var r=L(x);if(typeof r!="number"&&r[0]===4&&!P(r[3],Ho)){var e=x[28][1];if(e){var t=ka(1,x);if(t)var u=al(1,x)[2][1],i=G0(x)[3][1]===u?1:0;else var i=t}else var i=e;return i}return 0}function u4(x){var r=L(x);if(typeof r=="number")switch(r){case 13:case 41:return 1}else if(r[0]===4&&!P(r[3],pA)&&rr(1,x)===41)return 1;return 0}function fj(x){var r=x[28][1];if(r){var e=L(x);if(typeof e!="number"&&e[0]===4&&!P(e[3],Ks)&&ka(1,x))return 1;var t=0}else var t=r;return t}function cj(x){var r=L(x);return typeof r!="number"&&r[0]===4&&!P(r[3],T3)?1:0}function Ux(x,r){return B0(x,[0,G0(x),r])}function SU(x,r){var e=JC(0,r);return x?[28,e,x[1]]:[26,e]}function p2(x,r){var e=ij(r);return nj(r)(e),Ux(r,SU(x,L(r)))}function oh(x){function r(e){return B0(x,[0,e[1],Vn])}return function(e){return T1(r,e)}}function AU(x,r){var e=x[6]?Q0(sr(es0),r,r,r):ts0;return p2([0,e],x)}function Ne(x,r){var e=x[5];return e&&Ux(x,r)}function pt(x,r){var e=x[5],t=r[2],u=r[1];return e&&B0(x,[0,u,t])}function Ov(x,r){return B0(x,[0,r,[14,x[5]]])}function T0(x){var r=x[27][1];if(r){var e=r[1],t=fl(x),u=L(x);d(e,[0,G0(x),u,t])}var i=x[26][1],c=i[1],v=c?c[1][1]:ih(i)[1];x[25][1]=v;var a=ij(x);nj(x)(a);var l=x[2][1],m=G3(io(0,x)[4],l);x[2][1]=m;var h=[0,io(0,x)];x[4][1]=h;var T=x[26][1];return T[2]?(T[1]=T[2],T[2]=0,0):(pU(T),T[1]=0,0)}function $r(x,r){var e=CB(L(x),r);return e&&T0(x),e}function V2(x,r){x[24][1]=[0,r,x[24][1]];var e=fl(x),t=r4(x[25][1],e);x[26][1]=t}function H2(x){var r=x[24][1],e=r?r[2]:bx(rs0);x[24][1]=e;var t=fl(x),u=r4(x[25][1],t);x[26][1]=u}function q0(x){var r=G0(x);if(L(x)===9&&jv(1,x)){var e=i0(x),t=Lx(e,R6(function(i){return i[1][2][1]<=r[3][1]?1:0},io(1,x)[4]));return e4(x,[0,r[3][1]+1|0,0]),t}var u=i0(x);return e4(x,r[3]),u}function co(x){var r=x[4][1];if(!r)return 0;var e=r[1][2],t=R6(function(u){return u[1][2][1]<=e[3][1]?1:0},i0(x));return e4(x,[0,e[3][1]+1|0,0]),t}function bn(x,r){return p2([0,JC(Hc0,r)],x)}function J(x,r){return 1-CB(L(x),r)&&bn(x,r),T0(x)}function PU(x,r){var e=$r(x,r);return 1-e&&bn(x,r),e}function vh(x,r){PU(x,r)}function bs(x,r){var e=L(x);x:{if(typeof e!="number"&&e[0]===4&&_r(e[3],r))break x;p2([0,d(sr(Qc0),r)],x)}return T0(x)}var Bt=[i2,os0,ks(0)];function IU(x,r,e){if(e){var t=e[1],u=t[1],i=t[2];if(r[27][1]=[0,u],!x)return x;for(var c=i[2];;){if(!c)return;var v=c[2];d(u,c[1]);var c=v}}}function lh(x,r){var e=x[27][1];if(e){var t=e[1],u=fq(O);x[27][1]=[0,function(M){return rC(M,u)}];var i=[0,[0,t,u]]}else var i=0;var c=x[31][1],v=x[25][1],a=x[24][1],l=x[4][1],m=x[2][1],h=x[1][1];try{var T=d(r,x);IU(1,x,i);var b=[0,T];return b}catch(F){var N=B2(F);if(N!==Bt)throw K0(N,0);IU(0,x,i),x[1][1]=h,x[2][1]=m,x[4][1]=l,x[24][1]=a,x[25][1]=v,x[31][1]=c;var C=fl(x),I=r4(x[25][1],C);return x[26][1]=I,0}}function ph(x,r,e){var t=lh(x,e);return t?t[1]:r}function i4(x,r){var e=tx(r);if(!e)return r;var t=e[1],u=e[2],i=d(x,t);return t===i?r:tx([0,i,u])}var NU=T5(ms0,function(x){var r=CC(x,ls0),e=IC(x,ks0),t=e[24],u=e[28],i=e[42],c=e[92],v=e[Td],a=e[z_],l=e[Hk],m=e[WD],h=e[PF],T=e[uL],b=e[6],N=e[7],C=e[10],I=e[17],F=e[23],M=e[29],Y=e[40],q=e[43],K=e[53],u0=e[62],Q=e[K2],e0=e[G1],f0=e[F3],a0=e[h3],Z=e[kT],v0=e[SR],t0=e[GD],y0=e[Fg],n0=e[J4],s0=e[N8],l0=e[K9],w0=e[M8],L0=e[HT],I0=e[LA],j0=e[ST],S0=e[kk],W0=e[EL],A0=e[VF],J0=e[OD],b0=e[gD],z=e[cD],C0=e[NO],V0=e[oD],N0=e[$D],rx=e[ZL],xx=e[zL],nx=e[qD],mx=e[PO],F0=e[UF],px=e[jO],dx=OC(x,0,0,XM,qC,1)[1];return FC(x,[0,q,function(W,g0){var B=g0[2],h0=R6(function(d0){return va(d0[1][2],W[1+r])<0?1:0},B),_0=ia(h0);return ia(B)===_0?g0:[0,g0[1],h0,g0[3]]},px,function(W,g0,B){var h0=B[2];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],_0]})},F0,function(W,g0){var B=g0[2];return P0(d(W[1][1+i],W),B,g0,function(h0){return[0,g0[1],h0]})},mx,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+a],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},nx,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+a],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},xx,function(W,g0,B){var h0=B[2];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],_0]})},rx,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+T],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},T,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},h,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},N0,function(W,g0,B){var h0=B[7],_0=B[2],d0=p(W[1][1+m],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],d0,B[3],B[4],B[5],B[6],E0]},m,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},V0,function(W,g0,B){var h0=B[2],_0=B[1];if(h0===0)return P0(d(W[1][1+a],W),_0,B,function(E0){return[0,E0,B[2],B[3]]});var d0=d(W[1][1+t],W);return P0(function(E0){return Px(d0,E0)},h0,B,function(E0){return[0,B[1],E0,B[3]]})},C0,function(W,g0){var B=g0[2],h0=B[2],_0=g0[1],d0=B[1],E0=d(W[1][1+l],W);return P0(function(U){return i4(E0,U)},d0,g0,function(U){return[0,_0,[0,U,h0]]})},l,function(W,g0){var B=g0[2],h0=B[2],_0=B[1],d0=g0[1];if(h0===0)return P0(d(W[1][1+v],W),_0,g0,function(U){return[0,d0,[0,U,h0]]});var E0=d(W[1][1+t],W);return P0(function(U){return Px(E0,U)},h0,g0,function(U){return[0,d0,[0,_0,U]]})},b0,function(W,g0,B){var h0=B[6],_0=B[5],d0=p(W[1][1+z],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],B[3],B[4],d0,E0,B[7]]},J0,function(W,g0){var B=g0[2],h0=g0[1],_0=B[3];return P0(d(W[1][1+i],W),_0,[0,h0,B],function(d0){return[0,h0,[0,B[1],B[2],d0]]})},A0,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},W0,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+a],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},S0,function(W,g0,B){var h0=B[10],_0=B[3],d0=p(W[1][1+j0],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,B[4],B[5],B[6],B[7],B[8],B[9],E0,B[11]]},I0,function(W,g0){var B=g0[2],h0=g0[1],_0=B[4];return P0(d(W[1][1+i],W),_0,[0,h0,B],function(d0){return[0,h0,[0,B[1],B[2],B[3],d0]]})},L0,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+w0],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0,B[5]]},l0,function(W,g0){if(g0[0]===0){var B=g0[1];return P0(d(W[1][1+v],W),B,g0,function(Kx){return[0,Kx]})}var h0=g0[1],_0=h0[2],d0=_0[2],E0=h0[1],U=p(W[1][1+v],W,d0);return d0===U?g0:[1,[0,E0,[0,_0[1],U]]]},s0,function(W,g0,B){var h0=B[2];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],_0]})},n0,function(W,g0,B){var h0=B[3],_0=B[1],d0=W2(d(W[1][1+c],W),_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,d0,B[2],E0]},y0,function(W,g0,B){var h0=B[2],_0=B[1],d0=_0[3],E0=_0[2],U=_0[1];if(d0)var Kx=i4(d(W[1][1+u],W),d0),Ix=E0;else var Kx=0,Ix=p(W[1][1+u],W,E0);var z0=p(W[1][1+i],W,h0);return E0===Ix&&d0===Kx&&h0===z0?B:[0,[0,U,Ix,Kx],z0]},t0,function(W,g0,B){var h0=B[4];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],B[3],_0]})},v0,function(W,g0,B){var h0=B[4];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],B[3],_0]})},Z,function(W,g0,B){var h0=B[4],_0=B[3],d0=p(W[1][1+a],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],B[2],d0,E0]},e0,function(W,g0,B){var h0=B[4],_0=B[3],d0=B[2],E0=B[1],U=p(W[1][1+i],W,h0);if(_0){var Kx=Px(d(W[1][1+T],W),_0);return _0===Kx&&h0===U?B:[0,B[1],B[2],Kx,U]}if(d0){var Ix=Px(d(W[1][1+h],W),d0);return d0===Ix&&h0===U?B:[0,B[1],Ix,B[3],U]}var z0=p(W[1][1+a],W,E0);return E0===z0&&h0===U?B:[0,z0,B[2],B[3],U]},a0,function(W,g0,B){var h0=B[3],_0=B[2],d0=p(W[1][1+f0],W,_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,B[1],d0,E0]},Q,function(W,g0,B){var h0=B[2];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],_0]})},c,function(W,g0,B){var h0=B[4];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],B[3],_0]})},u0,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},K,function(W,g0,B){var h0=B[2],_0=B[1],d0=i4(d(W[1][1+a],W),_0),E0=p(W[1][1+i],W,h0);return _0===d0&&h0===E0?B:[0,d0,E0]},Y,function(W,g0,B){var h0=B[3];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],_0]})},M,function(W,g0){var B=g0[3];return P0(d(W[1][1+i],W),B,g0,function(h0){return[0,g0[1],g0[2],h0]})},F,function(W,g0,B){var h0=B[3];return P0(d(W[1][1+i],W),h0,B,function(_0){return[0,B[1],B[2],_0]})},I,function(W,g0){var B=g0[2],h0=B[1],_0=g0[1],d0=B[2];return P0(d(W[1][1+i],W),d0,g0,function(E0){return[0,_0,[0,h0,E0]]})},C,function(W,g0,B){var h0=B[2],_0=B[1],d0=_0[3],E0=_0[2],U=_0[1];if(d0)var Kx=i4(d(W[1][1+u],W),d0),Ix=E0;else var Kx=0,Ix=p(W[1][1+u],W,E0);var z0=p(W[1][1+i],W,h0);return E0===Ix&&d0===Kx&&h0===z0?B:[0,[0,U,Ix,Kx],z0]},N,function(W,g0,B){var h0=B[2],_0=h0[2],d0=h0[1],E0=B[1];if(!_0)return P0(p(W[1][1+b],W,g0),d0,B,function(Kx){return[0,E0,[0,Kx,_0]]});var U=_0[1];return P0(d(W[1][1+a],W),U,B,function(Kx){return[0,E0,[0,d0,[0,Kx]]]})}]),function(W,g0,B){var h0=E5(g0,x);return h0[1+r]=B,d(dx,h0),DC(g0,h0,x)}});function kh(x){var r=cl(x);if(r)var e=r[1],t=bU(x)?(e4(x,e[3]),[0,p(NU[1],0,e[3])]):0,u=t;else var u=0;return[0,0,function(i,c){return u?c(u[1],i):i}]}function f4(x){var r=cl(x);if(r){var e=r[1];if(bU(x)){e4(x,e[3]);var t=co(x),u=[0,p(NU[1],0,[0,e[3][1]+1|0,0])],i=t}else var u=0,i=co(x)}else var u=0,i=0;return[0,i,function(c,v){return u?p(v,u[1],c):c}]}function D2(x){return d1(x)?f4(x):kh(x)}function Ut(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,O3,2),e,t)})}function re(x,r){if(!r)return 0;var e=r[1];return[0,p(D2(x)[2],e,function(t,u){return p(Xx(t,vT,5),t,u)})]}function sj(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,XL,8),e,t)})}function vl(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,-1045824777,9),e,t)})}function c4(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,-455772979,10),e,t)})}function CU(x,r){if(!r)return 0;var e=r[1];return[0,p(D2(x)[2],e,function(t,u){return p(Xx(t,DL,13),t,u)})]}function Tn(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,nL,14),e,t)})}function jU(x,r){return p(D2(x)[2],r,function(e,t){var u=d(Xx(e,ED,16),e);return i4(function(i){return W2(u,i)},t)})}function OU(x,r){return p(D2(x)[2],r,function(e,t){return p(Xx(e,-21476009,17),e,t)})}T5(hs0,function(x){var r=CC(x,vs0),e=jC(ps0),t=e.length-1,u=UM.length-1,i=Wa(t+u|0,0),c=t-1|0,v=0;if(c>=0)for(var a=v;;){var l=J6(x,P2(e,a)[1+a]);P2(i,a)[1+a]=l;var m=a+1|0;if(c===a)break;var a=m}var h=u-1|0,T=0;if(h>=0)for(var b=T;;){var N=b+t|0,C=CC(x,P2(UM,b)[1+b]);P2(i,N)[1+N]=C;var I=b+1|0;if(h===b)break;var b=I}var F=i[4],M=i[5],Y=i[aF],q=i[Hk],K=i[317],u0=i[318],Q=i[45],e0=i[lL],f0=i[PD],a0=OC(x,0,0,XM,qC,1)[1];return FC(x,[0,e0,function(Z){return[0,Z[1+K],Z[1+u0]]},q,function(Z,v0){var t0=v0[2],y0=v0[1];return T1(d(Z[1][1+M],Z),y0),T1(d(Z[1][1+F],Z),t0)},Y,function(Z,v0){return v0?p(Z[1][1+q],Z,v0[1]):0},M,function(Z,v0){var t0=v0[1],y0=Z[1+K];if(y0){var n0=va(t0[2],y0[1][1][2])<0?1:0,s0=n0&&(Z[1+K]=[0,v0],0);return s0}var l0=va(t0[2],Z[1+r][2])<0?1:0,w0=l0&&(Z[1+K]=[0,v0],0);return w0},F,function(Z,v0){var t0=v0[1],y0=Z[1+u0];if(y0){var n0=va(y0[1][1][2],t0[2])<0?1:0,s0=n0&&(Z[1+u0]=[0,v0],0);return s0}var l0=0<=va(t0[2],Z[1+r][3])?1:0,w0=l0&&(Z[1+u0]=[0,v0],0);return w0},Q,function(Z,v0){return p(Z[1][1+q],Z,v0),v0},f0,function(Z,v0,t0){return p(Z[1][1+Y],Z,t0[2]),t0}]),function(Z,v0,t0){var y0=E5(v0,x);return y0[1+r]=t0,d(a0,y0),y0[1+K]=0,y0[1+u0]=0,DC(v0,y0,x)}});function DU(x){var r=L(x);x:{if(typeof r=="number"){var e=r;if(50<=e)switch(e){case 50:var u=Zs0;break x;case 51:var u=xa0;break x;case 52:var u=ra0;break x;case 53:var u=ea0;break x;case 54:var u=ta0;break x;case 55:var u=na0;break x;case 56:var u=ua0;break x;case 57:var u=ia0;break x;case 58:var u=fa0;break x;case 59:var u=ca0;break x;case 60:var u=sa0;break x;case 61:var u=aa0;break x;case 62:var u=oa0;break x;case 63:var u=va0;break x;case 64:var u=la0;break x;case 65:var u=pa0;break x;case 66:var u=ka0;break x;case 115:var u=ma0;break x;case 116:var u=ha0;break x;case 117:var u=da0;break x;case 118:var u=ya0;break x;case 119:var u=ga0;break x;case 120:var u=wa0;break x;case 121:var u=_a0;break x;case 122:var u=ba0;break x;case 123:var u=Ta0;break x;case 124:var u=Ea0;break x;case 125:var u=Sa0;break x;case 126:var u=Aa0;break x;case 127:var u=Pa0;break x;case 129:var u=Ia0;break x;case 130:var u=Na0;break x;case 131:var u=Ca0;break x}else switch(e){case 15:var u=ds0;break x;case 16:var u=ys0;break x;case 17:var u=gs0;break x;case 18:var u=ws0;break x;case 19:var u=_s0;break x;case 20:var u=bs0;break x;case 21:var u=Ts0;break x;case 22:var u=Es0;break x;case 23:var u=Ss0;break x;case 24:var u=As0;break x;case 25:var u=Ps0;break x;case 26:var u=Is0;break x;case 27:var u=Ns0;break x;case 28:var u=Cs0;break x;case 29:var u=js0;break x;case 30:var u=Os0;break x;case 31:var u=Ds0;break x;case 32:var u=Fs0;break x;case 33:var u=Rs0;break x;case 34:var u=Ls0;break x;case 35:var u=Ms0;break x;case 36:var u=qs0;break x;case 37:var u=Bs0;break x;case 38:var u=Us0;break x;case 39:var u=Xs0;break x;case 40:var u=Ys0;break x;case 41:var u=zs0;break x;case 42:var u=Ks0;break x;case 43:var u=Js0;break x;case 44:var u=Gs0;break x;case 45:var u=Ws0;break x;case 46:var u=Vs0;break x;case 47:var u=$s0;break x;case 48:var u=Qs0;break x;case 49:var u=Hs0;break x}}else switch(r[0]){case 4:var u=r[2];break x;case 11:var t=r[1]?ja0:Oa0,u=t;break x}p2(Da0,x);var u=Fa0}return T0(x),u}function a1(x){var r=G0(x),e=i0(x),t=DU(x);return[0,r,[0,t,x0([0,e],[0,q0(x)],O)]]}function FU(x){var r=G0(x),e=i0(x);J(x,14);var t=G0(x),u=DU(x),i=x0([0,e],[0,q0(x)],O),c=Vr(r,t),v=t[2],a=r[3],l=a[1]===v[1]?1:0,m=l&&(a[2]===v[2]?1:0);return 1-m&&B0(x,[0,c,G1]),[0,c,[0,u,i]]}function Dv(x){var r=x[2],e=r[3]===0?1:0,t=r[2];if(!e)return e;for(var u=t;;){if(!u)return 1;var i=u[1][2],c=u[2];x:{if(i[1][2][0]===2&&!i[2]){var v=1;break x}var v=0}if(!v)return v;var u=c}}function s4(x){for(var r=x;;){var e=r[2];if(e[0]!==31)return 0;var t=e[1][2];if(t[2][0]===27)return 1;var r=t}}function mh(x,r,e){var t=e[2][1],u=e[1];if(!P(t,fv)){var i=r[19];return i&&B0(r,[0,u,5])}if(P(t,j3)){if(!P(t,z1))return r[18]?B0(r,[0,u,96]):pt(r,[0,u,81])}else if(r[14])return B0(r,[0,u,[26,D5(t)]]);if(sl(t))return pt(r,[0,u,81]);if(ch(t))return B0(r,[0,u,96]);if(x){var c=x[1];if(Cv(t))return pt(r,[0,u,c])}}function r0(x,r,e){var t=x?x[1]:G0(e),u=d(r,e),i=cl(e),c=i?Vr(t,i[1]):t;return[0,c,u]}function aj(x,r,e){var t=r0(x,r,e),u=t[2];return[0,[0,t[1],u[1]],u[2]]}function hh(x){V2(x,0);var r=L(x);H2(x);var e=rr(1,x);x:{r:{if(typeof r=="number"){if(r!==22)break x}else{if(r[0]!==4)break x;var t=r[3];if(P(t,E3)){if(!P(t,d3))e:{if(typeof e=="number"){if(e!==22)break e}else if(e[0]!==4)break e;break r}}else e:{if(typeof e=="number"){if(e!==22)break e}else if(e[0]!==4)break e;break r}}if(typeof e=="number"){if(Ko!==e)break x}else if(e[0]!==4||P(e[3],p6))break x}return 1}return 0}function RU(x,r){var e=r[1],t=r[2][1],u=t?0:1;u&&B0(x,[0,e,49]);function i(F){return F[0]===0?[0,F[1]]:(B0(x,[0,F[1][1],50]),0)}x:{for(var c=t;;){if(!c){var v=0;break x}var a=c[2],l=i(c[1]);if(l)break;var c=a}for(var m=[0,l[1],La],h=m,T=1,b=a;;){if(!b){h[1+T]=0;var v=m;break}var N=b[2],C=i(b[1]);if(C){var I=[0,C[1],La];h[1+T]=I;var h=I,T=1,b=N}else var b=N}}return v&&!v[2]?v[1]:[0,e,[29,[0,v,0]]]}function LU(x){switch(x){case 3:return 2;case 4:return 1;case 5:return 1;case 6:return 1;case 7:return 1;default:return 1}}function oj(x,r,e){if(e){var t=e[1];x:{if(t!==8232&&t1!==t){if(t===10){var u=6;break x}if(t===13){var u=5;break x}if(v6<=t){var u=3;break x}if(f_<=t){var u=2;break x}if(M2<=t){var u=1;break x}var u=0;break x}var u=7}var i=u}else var i=4;return[0,i,x]}var $b0=[i2,mo0,ks(0)];function MU(x,r,e,t){try{var u=P2(x,r)[1+r];return u}catch(c){var i=B2(c);throw i[1]===o5?K0([0,$b0,e,Q0(sr(po0),t,r,x.length-1)],1):K0(i,0)}}function dh(x,r){if(r[1]===0&&r[2]===0)return 0;var e=MU(x,r[1]-1|0,r,vo0);return MU(e,r[2],r,lo0)}function qU(x){function r(a){var l=L(a);x:if(typeof l=="number"){if(8<=l){if(10<=l)break x}else if(l!==1)break x;return 1}return 0}function e(a,l,m,h,T,b){var N=Q0(x[24],a,T,b);if(m)var C=Mx(Uo0,b),I=-N;else var C=b,I=N;var F=q0(a);return r(a)?[2,l,[0,I,C,x0([0,h],[0,F],O)]]:[0,l]}function t(a){var l=G0(a),m=i0(a),h=L(a);if(typeof h=="number")switch(h){case 105:T0(a);var T=L(a);return typeof T!="number"&&T[0]===0?e(a,l,1,m,T[1],T[2]):[0,l];case 31:case 32:T0(a);var b=q0(a);return r(a)?[1,l,[0,h===32?1:0,x0([0,m],[0,b],O)]]:[0,l]}else switch(h[0]){case 0:return e(a,l,0,m,h[1],h[2]);case 1:var N=h[2],C=Q0(x[26],a,h[1],N),I=q0(a);return r(a)?[4,l,[0,C,N,x0([0,m],[0,I],O)]]:[0,l];case 2:var F=h[1],M=F[1],Y=F[3],q=F[2];F[4]&&Ne(a,77),T0(a);var K=q0(a);return r(a)?[3,M,[0,q,Y,x0([0,m],[0,K],O)]]:[0,M]}return T0(a),[0,l]}var u=[0,Xo0,N1[1],0,0];function i(a){var l=a1(a),m=L(a);x:{if(typeof m=="number"){if(m===83){J(a,83);var h=t(a);break x}if(m===87){Ux(a,[8,l[2][1]]),J(a,87);var h=t(a);break x}}var h=0}return[0,l,h]}var c=0;function v(a,l,m,h,T,b,N){var C=ia(T),I=ia(b);function F(Y){return[2,[0,[0,b],m,h,N]]}function M(Y){return[2,[0,[1,T],m,h,N]]}return C===0?F(O):I===0?M(O):C>>0){if(J1>=Q+1>>>0)break}else if(Q===10){var e0=G0(I),f0=i0(I);T0(I);var a0=L(I);x:{r:if(typeof a0=="number"){var Z=a0-2|0;if(G1>>0){if(J1>>0)break r}else{if(Z!==7)break r;J(I,9);var v0=L(I);e:{t:if(typeof v0=="number"){if(v0!==1&&kr!==v0)break t;var t0=1;break e}var t0=0}B0(I,[0,e0,[6,t0]])}break x}B0(I,[0,e0,Do0])}var K=[0,K[1],K[2],1,f0];continue}}var y0=K[2],n0=K[1],s0=r0(c,i,I),l0=s0[2],w0=l0[2],L0=l0[1],I0=s0[1],j0=L0[2][1],S0=L0[1];x:if(_r(j0,H0))var W0=K;else{var A0=q2(j0,0),J0=97<=A0?1:0,b0=J0&&(A0<=c2?1:0);b0&&B0(I,[0,S0,[10,b,j0]]),N1[3].call(null,j0,y0)&&B0(I,[0,S0,[4,b,j0]]);var z=K[4],C0=K[3],V0=N1[4].call(null,j0,y0),N0=[0,K[1],V0,C0,z];let fx=j0;var rx=function(Qx,vx){if(Y&&Y[1]!==Qx)return B0(I,[0,vx,[9,b,Y,fx]])};if(typeof w0=="number"){if(Y)switch(Y[1]){case 0:B0(I,[0,I0,[3,b,j0]]);var W0=N0;break x;case 1:B0(I,[0,I0,[11,b,j0]]);var W0=N0;break x;case 4:B0(I,[0,I0,[2,b,j0]]);var W0=N0;break x}var W0=[0,[0,n0[1],n0[2],n0[3],n0[4],[0,[0,I0,[0,L0]],n0[5]]],V0,C0,z]}else switch(w0[0]){case 0:B0(I,[0,w0[1],[9,b,Y,j0]]);var W0=N0;break;case 1:var xx=w0[1],nx=w0[2];rx(0,xx);var W0=[0,[0,[0,[0,I0,[0,L0,[0,xx,nx]]],n0[1]],n0[2],n0[3],n0[4],n0[5]],V0,C0,z];break;case 2:var mx=w0[1],F0=w0[2];rx(1,mx);var W0=[0,[0,n0[1],[0,[0,I0,[0,L0,[0,mx,F0]]],n0[2]],n0[3],n0[4],n0[5]],V0,C0,z];break;case 3:var px=w0[1],dx=w0[2];rx(2,px);var W0=[0,[0,n0[1],n0[2],[0,[0,I0,[0,L0,[0,px,dx]]],n0[3]],n0[4],n0[5]],V0,C0,z];break;default:var W=w0[1],g0=w0[2];rx(4,W);var W0=[0,[0,n0[1],n0[2],n0[3],[0,[0,I0,[0,L0,[0,W,g0]]],n0[4]],n0[5]],V0,C0,z]}}var B=L(I);x:{r:if(typeof B=="number"){var h0=B-2|0;if(G1>>0){if(J1>>0)break r}else{if(h0!==6)break r;Ux(I,18),J(I,8)}break x}J(I,9)}var K=W0}var _0=K[3],d0=K[4],E0=tx(K[1][5]),U=tx(K[1][4]),Kx=tx(K[1][3]),Ix=tx(K[1][2]),z0=tx(K[1][1]),Kr=Lx(d0,i0(I));J(I,1);var S=L(I);x:{r:if(typeof S=="number"){if(S!==1&&kr!==S)break r;var G=q0(I);break x}var G=d1(I)?co(I):0}var Z0=j2([0,q],[0,G],Kr,O);if(Y){switch(Y[1]){case 0:var yx=[0,[0,z0,1,_0,Z0]];break;case 1:var yx=[1,[0,Ix,1,_0,Z0]];break;case 2:var yx=v(I,b,1,_0,Kx,E0,Z0);break;case 3:var yx=[3,[0,E0,_0,Z0]];break;default:var yx=[4,[0,U,1,_0,Z0]]}var Tx=yx}else{var ex=ia(z0),m0=ia(Ix),Dx=ia(U),Ex=ia(Kx),qx=ia(E0),O0=function(fx){return[2,[0,Fo0,0,_0,Z0]]};x:{if(ex===0&&m0===0&&Dx===0){if(Ex===0&&qx===0){var Wx=O0(O);break x}var Wx=v(I,b,0,_0,Kx,E0,Z0);break x}if(m0===0&&Dx===0&&Ex===0&&qx<=ex){T1(function(Qx){return B0(I,[0,Qx[1],[3,b,Qx[2][1][2][1]]])},E0);var Wx=[0,[0,z0,0,_0,Z0]];break x}if(ex===0){if(Dx===0&&Ex===0&&qx<=m0){T1(function(Qx){return B0(I,[0,Qx[1],[11,b,Qx[2][1][2][1]]])},E0);var Wx=[1,[0,Ix,0,_0,Z0]];break x}if(m0===0&&Ex===0&&qx<=Dx){T1(function(Qx){return B0(I,[0,Qx[1],[11,b,Qx[2][1][2][1]]])},E0);var Wx=[4,[0,U,0,_0,Z0]];break x}}B0(I,[0,N,[5,b]]);var Wx=O0(O)}var Tx=Wx}return Tx},l);return[0,T,C,x0([0,h],0,O)]}]}function ll(x){return[0,pa(x)]}function yh(x,r,e){if(typeof e=="number")return[0,x,r];if(e[0]===0){var t=e[1],u=ux(x,t),i=e[2];return u===0?i===r?e:[0,t,r]:0<=u?[1,2,x,r,e,0]:[1,2,x,r,0,e]}var c=e[5],v=e[4],a=e[3],l=e[2],m=ux(x,l),h=e[1];if(m===0)return a===r?e:[1,h,x,r,v,c];if(0<=m){var T=yh(x,r,c);return c===T?e:dB(v,l,a,T)}var b=yh(x,r,v);return v===b?e:dB(b,l,a,c)}function Qb0(x,r){if(typeof x=="number"){var e=x;if(57<=e)switch(e){case 57:if(typeof r=="number"&&r===57)return 0;break;case 58:if(typeof r=="number"&&r===58)return 0;break;case 59:if(typeof r=="number"&&r===59)return 0;break;case 60:if(typeof r=="number"&&r===60)return 0;break;case 61:if(typeof r=="number"&&r===61)return 0;break;case 62:if(typeof r=="number"&&r===62)return 0;break;case 63:if(typeof r=="number"&&r===63)return 0;break;case 64:if(typeof r=="number"&&r===64)return 0;break;case 65:if(typeof r=="number"&&r===65)return 0;break;case 66:if(typeof r=="number"&&r===66)return 0;break;case 67:if(typeof r=="number"&&r===67)return 0;break;case 68:if(typeof r=="number"&&r===68)return 0;break;case 69:if(typeof r=="number"&&r===69)return 0;break;case 70:if(typeof r=="number"&&r===70)return 0;break;case 71:if(typeof r=="number"&&r===71)return 0;break;case 72:if(typeof r=="number"&&r===72)return 0;break;case 73:if(typeof r=="number"&&r===73)return 0;break;case 74:if(typeof r=="number"&&r===74)return 0;break;case 75:if(typeof r=="number"&&r===75)return 0;break;case 76:if(typeof r=="number"&&r===76)return 0;break;case 77:if(typeof r=="number"&&r===77)return 0;break;case 78:if(typeof r=="number"&&r===78)return 0;break;case 79:if(typeof r=="number"&&r===79)return 0;break;case 80:if(typeof r=="number"&&r===80)return 0;break;case 81:if(typeof r=="number"&&r===81)return 0;break;case 82:if(typeof r=="number"&&r===82)return 0;break;case 83:if(typeof r=="number"&&r===83)return 0;break;case 84:if(typeof r=="number"&&r===84)return 0;break;case 85:if(typeof r=="number"&&r===85)return 0;break;case 86:if(typeof r=="number"&&r===86)return 0;break;case 87:if(typeof r=="number"&&r===87)return 0;break;case 88:if(typeof r=="number"&&r===88)return 0;break;case 89:if(typeof r=="number"&&r===89)return 0;break;case 90:if(typeof r=="number"&&r===90)return 0;break;case 91:if(typeof r=="number"&&r===91)return 0;break;case 92:if(typeof r=="number"&&r===92)return 0;break;case 93:if(typeof r=="number"&&r===93)return 0;break;case 94:if(typeof r=="number"&&r===94)return 0;break;case 95:if(typeof r=="number"&&r===95)return 0;break;case 96:if(typeof r=="number"&&r===96)return 0;break;case 97:if(typeof r=="number"&&r===97)return 0;break;case 98:if(typeof r=="number"&&r===98)return 0;break;case 99:if(typeof r=="number"&&r===99)return 0;break;case 100:if(typeof r=="number"&&y2===r)return 0;break;case 101:if(typeof r=="number"&&se===r)return 0;break;case 102:if(typeof r=="number"&&cn===r)return 0;break;case 103:if(typeof r=="number"&&F1===r)return 0;break;case 104:if(typeof r=="number"&&ft===r)return 0;break;case 105:if(typeof r=="number"&&Pt===r)return 0;break;case 106:if(typeof r=="number"&&vn===r)return 0;break;case 107:if(typeof r=="number"&&K2===r)return 0;break;case 108:if(typeof r=="number"&&Hs===r)return 0;break;case 109:if(typeof r=="number"&&Vn===r)return 0;break;case 110:if(typeof r=="number"&&w1===r)return 0;break;case 111:if(typeof r=="number"&&G1===r)return 0;break;case 112:if(typeof r=="number"&&Qs===r)return 0;break;default:if(typeof r=="number"&&J1<=r)return 0}else switch(e){case 0:if(typeof r=="number"&&!r)return 0;break;case 1:if(typeof r=="number"&&r===1)return 0;break;case 2:if(typeof r=="number"&&r===2)return 0;break;case 3:if(typeof r=="number"&&r===3)return 0;break;case 4:if(typeof r=="number"&&r===4)return 0;break;case 5:if(typeof r=="number"&&r===5)return 0;break;case 6:if(typeof r=="number"&&r===6)return 0;break;case 7:if(typeof r=="number"&&r===7)return 0;break;case 8:if(typeof r=="number"&&r===8)return 0;break;case 9:if(typeof r=="number"&&r===9)return 0;break;case 10:if(typeof r=="number"&&r===10)return 0;break;case 11:if(typeof r=="number"&&r===11)return 0;break;case 12:if(typeof r=="number"&&r===12)return 0;break;case 13:if(typeof r=="number"&&r===13)return 0;break;case 14:if(typeof r=="number"&&r===14)return 0;break;case 15:if(typeof r=="number"&&r===15)return 0;break;case 16:if(typeof r=="number"&&r===16)return 0;break;case 17:if(typeof r=="number"&&r===17)return 0;break;case 18:if(typeof r=="number"&&r===18)return 0;break;case 19:if(typeof r=="number"&&r===19)return 0;break;case 20:if(typeof r=="number"&&r===20)return 0;break;case 21:if(typeof r=="number"&&r===21)return 0;break;case 22:if(typeof r=="number"&&r===22)return 0;break;case 23:if(typeof r=="number"&&r===23)return 0;break;case 24:if(typeof r=="number"&&r===24)return 0;break;case 25:if(typeof r=="number"&&r===25)return 0;break;case 26:if(typeof r=="number"&&r===26)return 0;break;case 27:if(typeof r=="number"&&r===27)return 0;break;case 28:if(typeof r=="number"&&r===28)return 0;break;case 29:if(typeof r=="number"&&r===29)return 0;break;case 30:if(typeof r=="number"&&r===30)return 0;break;case 31:if(typeof r=="number"&&r===31)return 0;break;case 32:if(typeof r=="number"&&r===32)return 0;break;case 33:if(typeof r=="number"&&r===33)return 0;break;case 34:if(typeof r=="number"&&r===34)return 0;break;case 35:if(typeof r=="number"&&r===35)return 0;break;case 36:if(typeof r=="number"&&r===36)return 0;break;case 37:if(typeof r=="number"&&r===37)return 0;break;case 38:if(typeof r=="number"&&r===38)return 0;break;case 39:if(typeof r=="number"&&r===39)return 0;break;case 40:if(typeof r=="number"&&r===40)return 0;break;case 41:if(typeof r=="number"&&r===41)return 0;break;case 42:if(typeof r=="number"&&r===42)return 0;break;case 43:if(typeof r=="number"&&r===43)return 0;break;case 44:if(typeof r=="number"&&r===44)return 0;break;case 45:if(typeof r=="number"&&r===45)return 0;break;case 46:if(typeof r=="number"&&r===46)return 0;break;case 47:if(typeof r=="number"&&r===47)return 0;break;case 48:if(typeof r=="number"&&r===48)return 0;break;case 49:if(typeof r=="number"&&r===49)return 0;break;case 50:if(typeof r=="number"&&r===50)return 0;break;case 51:if(typeof r=="number"&&r===51)return 0;break;case 52:if(typeof r=="number"&&r===52)return 0;break;case 53:if(typeof r=="number"&&r===53)return 0;break;case 54:if(typeof r=="number"&&r===54)return 0;break;case 55:if(typeof r=="number"&&r===55)return 0;break;default:if(typeof r=="number"&&r===56)return 0}}else switch(x[0]){case 0:if(typeof r!="number"&&r[0]===0){var t=r[1],u=x[1];return p(d(mr[43],0),u,t)}break;case 1:if(typeof r!="number"&&r[0]===1){var i=r[1],c=x[1];return p(d(mr[42],0),c,i)}break;case 2:if(typeof r!="number"&&r[0]===2){var v=r[2],a=r[1],l=x[2],m=x[1],h=p(d(mr[41],0),m,a);return h===0?p(d(mr[40],0),l,v):h}break;case 3:if(typeof r!="number"&&r[0]===3){var T=r[2],b=r[1],N=x[2],C=x[1],I=p(d(mr[39],0),C,b);return I===0?p(d(mr[38],0),N,T):I}break;case 4:if(typeof r!="number"&&r[0]===4){var F=r[2],M=r[1],Y=x[2],q=x[1],K=p(d(mr[37],0),q,M);return K===0?p(d(mr[36],0),Y,F):K}break;case 5:if(typeof r!="number"&&r[0]===5){var u0=r[1],Q=x[1];return p(d(mr[35],0),Q,u0)}break;case 6:if(typeof r!="number"&&r[0]===6){var e0=r[1],f0=x[1];return p(d(mr[34],0),f0,e0)}break;case 7:if(typeof r!="number"&&r[0]===7){var a0=r[2],Z=x[2],v0=r[1],t0=x[1],y0=p(d(mr[33],0),t0,v0);if(y0!==0)return y0;if(!Z)return a0?-1:0;var n0=Z[1];if(!a0)return 1;var s0=a0[1];return p(d(mr[32],0),n0,s0)}break;case 8:if(typeof r!="number"&&r[0]===8){var l0=r[1],w0=x[1];return p(d(mr[31],0),w0,l0)}break;case 9:if(typeof r!="number"&&r[0]===9){var L0=r[2],I0=x[2],j0=r[3],S0=r[1],W0=x[3],A0=x[1],J0=p(d(mr[30],0),A0,S0);if(J0!==0)return J0;if(I0)var b0=I0[1],z=L0?p(mr[29],b0,L0[1]):1;else var z=L0?-1:0;return z===0?p(d(mr[28],0),W0,j0):z}break;case 10:if(typeof r!="number"&&r[0]===10){var C0=r[2],V0=r[1],N0=x[2],rx=x[1],xx=p(d(mr[27],0),rx,V0);return xx===0?p(d(mr[26],0),N0,C0):xx}break;case 11:if(typeof r!="number"&&r[0]===11){var nx=r[2],mx=r[1],F0=x[2],px=x[1],dx=p(d(mr[25],0),px,mx);return dx===0?p(d(mr[24],0),F0,nx):dx}break;case 12:if(typeof r!="number"&&r[0]===12){var W=r[1],g0=x[1];return p(d(mr[23],0),g0,W)}break;case 13:if(typeof r!="number"&&r[0]===13){var B=r[1],h0=x[1];return p(d(mr[22],0),h0,B)}break;case 14:if(typeof r!="number"&&r[0]===14){var _0=r[1],d0=x[1];return p(d(mr[21],0),d0,_0)}break;case 15:if(typeof r!="number"&&r[0]===15){var E0=r[4],U=r[3],Kx=r[2],Ix=r[1],z0=x[4],Kr=x[3],S=x[2],G=x[1],Z0=p(d(mr[20],0),G,Ix);if(Z0!==0)return Z0;var yx=p(d(mr[19],0),S,Kx);if(yx!==0)return yx;var Tx=p(d(mr[18],0),Kr,U);return Tx===0?p(d(mr[17],0),z0,E0):Tx}break;case 16:if(typeof r!="number"&&r[0]===16){var ex=r[1],m0=x[1];return p(d(mr[16],0),m0,ex)}break;case 17:if(typeof r!="number"&&r[0]===17){var Dx=r[2],Ex=r[1],qx=x[2],O0=x[1],Wx=p(d(mr[15],0),O0,Ex);return Wx===0?p(d(mr[14],0),qx,Dx):Wx}break;case 18:if(typeof r!="number"&&r[0]===18){var Yx=r[1],fx=x[1];return p(d(mr[13],0),fx,Yx)}break;case 19:if(typeof r!="number"&&r[0]===19){var Qx=r[1],vx=x[1];return p(d(mr[12],0),vx,Qx)}break;case 20:if(typeof r!="number"&&r[0]===20){var nr=r[1],gr=x[1];if(t6<=gr){if(typeof nr=="number"&&t6===nr)return 0}else if(typeof nr=="number"&&_R===nr)return 0;var Nr=function(ke){return t6<=ke?1:0},s2=Nr(nr);return Je(Nr(gr),s2)}break;case 21:if(typeof r!="number"&&r[0]===21){var b2=r[1],k2=x[1];return p(d(mr[11],0),k2,b2)}break;case 22:if(typeof r!="number"&&r[0]===22){var F2=r[1],jx=x[1];return p(d(mr[10],0),jx,F2)}break;case 23:if(typeof r!="number"&&r[0]===23){var _=r[2],$=r[1],ix=x[2],U0=x[1],cx=p(d(mr[9],0),U0,$);return cx===0?p(d(mr[8],0),ix,_):cx}break;case 24:if(typeof r!="number"&&r[0]===24){var wx=r[1],Or=x[1];if(Jl===Or){if(typeof wx=="number"&&Jl===wx)return 0}else if(l6<=Or){if(typeof wx=="number"&&l6===wx)return 0}else if(typeof wx=="number"&&YO===wx)return 0;var Hx=function(ke){return Jl===ke?0:l6<=ke?2:1},x2=Hx(wx);return Je(Hx(Or),x2)}break;case 25:if(typeof r!="number"&&r[0]===25){var hr=r[1],Dr=x[1];return p(d(mr[7],0),Dr,hr)}break;case 26:if(typeof r!="number"&&r[0]===26){var r2=r[1],sx=x[1];return p(d(mr[6],0),sx,r2)}break;case 27:if(typeof r!="number"&&r[0]===27){var Sx=r[2],Zx=r[1],Ur=x[2],Y2=x[1],pe=p(d(mr[5],0),Y2,Zx);return pe===0?p(d(mr[4],0),Ur,Sx):pe}break;case 28:if(typeof r!="number"&&r[0]===28){var j1=r[2],kt=r[1],zt=x[2],O1=x[1],q1=p(d(mr[3],0),O1,kt);return q1===0?p(d(mr[2],0),zt,j1):q1}break;default:if(typeof r!="number"&&r[0]===29){var T2=r[1],En=x[1];return p(d(mr[1],0),En,T2)}}function Sn(ke){if(typeof ke!="number")switch(ke[0]){case 0:return 16;case 1:return 17;case 2:return 19;case 3:return 20;case 4:return 21;case 5:return 22;case 6:return 23;case 7:return 24;case 8:return 26;case 9:return 27;case 10:return 28;case 11:return 30;case 12:return 31;case 13:return 33;case 14:return 36;case 15:return 48;case 16:return 50;case 17:return 51;case 18:return 53;case 19:return 61;case 20:return 69;case 21:return 73;case 22:return 82;case 23:return 89;case 24:return Vn;case 25:return F3;case 26:return f6;case 27:return Ko;case 28:return HO;default:return YL}var Qe=ke;if(57<=Qe)switch(Qe){case 57:return 79;case 58:return 80;case 59:return 81;case 60:return 83;case 61:return 84;case 62:return 85;case 63:return 86;case 64:return 87;case 65:return 88;case 66:return 90;case 67:return 91;case 68:return 92;case 69:return 93;case 70:return 94;case 71:return 95;case 72:return 96;case 73:return 97;case 74:return 98;case 75:return 99;case 76:return y2;case 77:return se;case 78:return cn;case 79:return F1;case 80:return ft;case 81:return Pt;case 82:return vn;case 83:return K2;case 84:return Hs;case 85:return w1;case 86:return G1;case 87:return Qs;case 88:return J1;case 89:return kr;case 90:return iv;case 91:return av;case 92:return h3;case 93:return mf;case 94:return y6;case 95:return c2;case 96:return en;case 97:return P3;case 98:return qa;case 99:return Ik;case 100:return Xr;case 101:return M2;case 102:return w6;case 103:return u6;case 104:return u8;case 105:return Ek;case 106:return ER;case 107:return oR;case 108:return DD;case 109:return kT;case 110:return FL;case 111:return CR;case 112:return xM;default:return JR}switch(Qe){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;case 7:return 7;case 8:return 8;case 9:return 9;case 10:return 10;case 11:return 11;case 12:return 12;case 13:return 13;case 14:return 14;case 15:return 15;case 16:return 18;case 17:return 25;case 18:return 29;case 19:return 32;case 20:return 34;case 21:return 35;case 22:return 37;case 23:return 38;case 24:return 39;case 25:return 40;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 49;case 34:return 52;case 35:return 54;case 36:return 55;case 37:return 56;case 38:return 57;case 39:return 58;case 40:return 59;case 41:return 60;case 42:return 62;case 43:return 63;case 44:return 64;case 45:return 65;case 46:return 66;case 47:return 67;case 48:return 68;case 49:return 70;case 50:return 71;case 51:return 72;case 52:return 74;case 53:return 75;case 54:return 76;case 55:return 77;default:return 78}}var Ss=Sn(r);return Je(Sn(x),Ss)}var vj=gB([0,function(x,r){var e=r[2],t=x[2],u=SB(x[1],r[1]);return u===0?Qb0(t,e):u}]);function a4(x,r,e){var t=e[2][1],u=e[1];return _r(t,H0)?r:N1[3].call(null,t,r)?(B0(x,[0,u,[0,t]]),r):N1[4].call(null,t,r)}function lj(x){return function(r){var e=r[2];switch(e[0]){case 0:return m1(function(t,u){var i=u[0]===0?u[1][2][2]:u[1][2][1];return lj(t)(i)},x,e[1][1]);case 1:return m1(function(t,u){if(u[0]===2)return t;var i=u[1][2][1];return lj(t)(i)},x,e[1][1]);case 2:return[0,e[1][1],x];default:return bx(Zl0)}}}var X0=xB(r60,x60[1]);function gh(x,r,e){var t=x?x[1]:0,u=r?r[1]:0,i=G0(e),c=L(e);if(typeof c=="number")switch(c){case 104:var v=i0(e);return T0(e),[0,[0,i,[0,0,x0([0,v],0,O)]]];case 105:var a=i0(e);return T0(e),[0,[0,i,[0,1,x0([0,a],0,O)]]];case 127:if(t){var l=i0(e);return T0(e),[0,[0,i,[0,2,x0([0,l],0,O)]]]}break}else if(c[0]===4){var m=c[3];if(P(m,Ra)){if(!P(m,_w)&&u&&sh(1,e)){var h=i0(e);return T0(e),[0,[0,i,[0,4,x0([0,h],0,O)]]]}}else if(u&&sh(1,e)){var T=i0(e);T0(e);var b=L(e);x:{if(typeof b!="number"&&b[0]===4&&!P(b[3],_w)){var N=G0(e);T0(e);var C=Vr(i,N),I=5;break x}var C=i,I=3}return[0,[0,C,[0,I,x0([0,T],0,O)]]]}}return 0}function BU(x,r,e,t,u){r===1&&Ne(u,77);var i=i0(u);T0(u);var c=q0(u);if(x)var v=x0([0,Lx(x[1],i)],[0,c],O),a=v,l=Mx(oo0,t),m=-e;else var a=x0([0,i],[0,c],O),l=t,m=e;return[30,[0,m,l,a]]}function UU(x,r,e,t){var u=i0(t);T0(t);var i=q0(t);if(x)var c=x0([0,Lx(x[1],u)],[0,i],O),v=Mx(ao0,e),a=c,l=v,m=l5(RN,r);else var a=x0([0,u],[0,i],O),l=e,m=r;return[31,[0,m,l,a]]}var XU=[],YU=[],zU=[],KU=[],JU=[],GU=[],WU=[],VU=[],$U=[],QU=[],HU=[];function Zr(x){var r=G0(x),e=ej(0,x);return ZU(e,r,pj(e))}function o4(x){return 1-S2(x)&&Ux(x,F1),r0(0,function(r){return J(r,87),Zr(r)},x)}function ZU(x,r,e){var t=L(x);return typeof t=="number"&&t===42?r0([0,r],function(u){J(u,42);var i=pj(ej(1,u));vh(u,86);var c=Zr(u);vh(u,87);var v=Zr(u);return[17,[0,e,i,c,v,x0(0,[0,q0(u)],O)]]},x):e}function pj(x){var r=G0(x);if(L(x)===90){var e=i0(x);T0(x);var t=e}else var t=0;return xX(x,[0,t],r,rX(x))}function xX(x,r,e,t){var u=r?r[1]:0;return L(x)===90?r0([0,e],p(XU[1],u,[0,t,0]),x):t}function rX(x){var r=G0(x);if(L(x)===92){var e=i0(x);T0(x);var t=e}else var t=0;return eX(x,[0,t],r,tX(x))}function eX(x,r,e,t){var u=r?r[1]:0;return L(x)===92?r0([0,e],p(YU[1],u,[0,t,0]),x):t}function tX(x){return nX(x,kj(x))}function nX(x,r){var e=L(x);if(typeof e=="number"&&e===11&&!x[15]){var t=wh(x,r);return bh(1,x,t[1],0,[0,t[1],[0,0,[0,t,0],0,0]])}return r}function kj(x){var r=L(x);if(typeof r=="number"&&r===86)return r0(0,function(t){var u=i0(t);J(t,86);var i=x0([0,u],0,O);return[11,[0,kj(t),i]]},x);var e=G0(x);return uX(0,x,e,Hb0(x))}function mj(x,r,e,t,u){var i=r?r[1]:0;if(d1(e))return u;var c=L(e);if(typeof c=="number"){if(c===6){T0(e);var v=0;return x<50?pl(x+1|0,i,v,e,t,u):J2(pl,[0,i,v,e,t,u])}if(c===10){var a=rr(1,e);if(typeof a=="number"&&a===6){Ux(e,Ra0),J(e,10),J(e,6);var l=0;return x<50?pl(x+1|0,i,l,e,t,u):J2(pl,[0,i,l,e,t,u])}return Ux(e,La0),u}if(c===84){T0(e),L(e)!==6&&Ux(e,40),J(e,6);var m=1,h=1;return x<50?pl(x+1|0,h,m,e,t,u):J2(pl,[0,h,m,e,t,u])}}return u}function uX(x,r,e,t){return a5(mj(0,x,r,e,t))}function pl(x,r,e,t,u,i){var c=r0([0,u],function(a){if(!e&&$r(a,7))return[16,[0,i,x0(0,[0,q0(a)],O)]];var l=Zr(a);J(a,7);var m=[0,i,l,x0(0,[0,q0(a)],O)];return r?[21,[0,m,e]]:[20,m]},t),v=[0,r];return x<50?mj(x+1|0,v,t,u,c):J2(mj,[0,v,t,u,c])}function iX(x){if(V2(x,0),L(x)===4){T0(x);var r=iX(x);J(x,5);var t=r}else if(_n(x))var e=p(X0[13],0,x),t=[0,p(zU[1],x,[0,e[1],[0,e]])];else{Ux(x,45);var t=0}return H2(x),t}function Hb0(x){var r=G0(x),e=L(x);x:{r:{if(typeof e=="number")switch(e){case 4:var t=G0(x),u=r0(0,rT0,x),i=u[2],c=u[1];return i[0]===0?bh(1,x,t,0,[0,c,i[1]]):i[1];case 6:return r0(0,function(n0){var s0=i0(n0);J(n0,6);var l0=Nv(0,n0),w0=p(KU[1],l0,0),L0=w0[2],I0=w0[1];return J(n0,7),[28,[0,I0,L0,x0([0,s0],[0,q0(n0)],O)]]},x);case 47:return r0(0,function(n0){var s0=i0(n0);J(n0,47);var l0=iX(n0);if(!l0)return Ma0;var w0=l0[1],L0=d1(n0)?0:gj(n0);return[24,[0,w0,L0,x0([0,s0],0,O)]]},x);case 54:return r0(0,function(n0){var s0=i0(n0);T0(n0);var l0=vX(n0),w0=l0[2],L0=l0[1];return[15,[0,w0,L0,x0([0,s0],0,O)]]},x);case 99:var v=G0(x),a=re(x,Rv(x));return bh(1,x,v,a,_h(x));case 105:return r0(0,Zb0,x);case 107:var l=i0(x);return T0(x),[0,r,[10,x0([0,l],[0,q0(x)],O)]];case 126:return r0(0,function(n0){var s0=i0(n0);T0(n0);var l0=q0(n0),w0=Zr(n0);return[25,[0,w0,x0([0,s0],[0,l0],O)]]},x);case 127:return r0(0,function(n0){var s0=i0(n0);T0(n0);var l0=q0(n0),w0=Zr(n0);return[27,[0,w0,x0([0,s0],[0,l0],O)]]},x);case 128:return r0(0,function(n0){var s0=i0(n0);T0(n0);var l0=q0(n0),w0=r0(0,function(L0){var I0=Fv(L0);return[0,I0,ph(L0,[0,G0(L0)],function(j0){if(1-$r(j0,42))throw K0(Bt,1);var S0=pj(j0);if(!j0[16]&&L(j0)===86)throw K0(Bt,1);return[1,[0,S0[1],S0]]}),1,0,0,0]},n0);return[18,[0,w0,x0([0,s0],[0,l0],O)]]},x);case 0:case 2:var m=yj(0,1,1,x);return[0,m[1],[14,m[2]]];case 132:case 133:break r;case 42:case 43:break;case 31:case 32:var h=i0(x);return T0(x),[0,r,[32,[0,e===32?1:0,x0([0,h],[0,q0(x)],O)]]];default:break x}else switch(e[0]){case 2:var T=e[1],b=T[3],N=T[2],C=T[1];T[4]&&Ne(x,77);var I=i0(x);return T0(x),[0,C,[29,[0,N,b,x0([0,I],[0,q0(x)],O)]]];case 4:var F=e[3];if(P(F,Ks)){if(P(F,Ho)){if(!P(F,T3))break r}else if(x[28][1]){var M=rr(1,x);e:if(typeof M=="number"){if(M!==4&&M!==99)break e;var Y=G0(x);T0(x);var q=re(x,Rv(x));return bh(0,x,Y,q,_h(x))}var K=Th(x);return[0,K[1],[19,K[2]]]}}else if(x[28][1])return r0(0,function(n0){var s0=i0(n0);bs(n0,qa0);var l0=re(n0,Rv(n0)),w0=cX(n0);if(cj(n0))var I0=sj(n0,wj(n0)),j0=w0;else var L0=wj(n0),I0=L0,j0=p(D2(n0)[2],w0,function(S0,W0){return p(Xx(S0,420776873,12),S0,W0)});return[13,[0,l0,j0,I0,x0([0,s0],0,O)]]},x);break;case 7:if(P(e[1],Xl))break x;return Ux(x,85),[0,r,Ba0];case 12:var u0=e[3],Q=e[2],e0=e[1],f0=0;return r0(0,function(n0){return BU(f0,e0,Q,u0,n0)},x);case 13:var a0=e[3],Z=e[2],v0=0;return r0(0,function(n0){return UU(v0,Z,a0,n0)},x);default:break x}var t0=Th(x);return[0,t0[1],[19,t0[2]]]}return r0(0,function(n0){return[26,fX(n0)]},x)}var y0=xT0(x);return y0?[0,r,y0[1]]:(p2(Ua0,x),[0,r,Xa0])}function Zb0(x){var r=i0(x);T0(x);var e=L(x);if(typeof e!="number")switch(e[0]){case 12:return BU([0,r],e[1],e[2],e[3],x);case 13:return UU([0,r],e[2],e[3],x)}return p2(Ya0,x),za0}function hj(x,r){var e=i0(x),t=r0(0,T0,x)[1],u=x0([0,e],[0,q0(x)],O);return[0,[19,[0,[0,gn(0,[0,t,r])],0,u]]]}function xT0(x){var r=i0(x),e=L(x);if(typeof e=="number")switch(e){case 30:return T0(x),[0,[4,x0([0,r],[0,q0(x)],O)]];case 115:return T0(x),[0,[0,x0([0,r],[0,q0(x)],O)]];case 116:return T0(x),[0,[1,x0([0,r],[0,q0(x)],O)]];case 117:return T0(x),[0,[2,x0([0,r],[0,q0(x)],O)]];case 118:return T0(x),[0,[5,x0([0,r],[0,q0(x)],O)]];case 119:return T0(x),[0,[6,x0([0,r],[0,q0(x)],O)]];case 120:return T0(x),[0,[7,x0([0,r],[0,q0(x)],O)]];case 121:return T0(x),[0,[3,x0([0,r],[0,q0(x)],O)]];case 122:return T0(x),[0,[9,x0([0,r],[0,q0(x)],O)]];case 123:return T0(x),[0,[33,x0([0,r],[0,q0(x)],O)]];case 124:return T0(x),[0,[34,x0([0,r],[0,q0(x)],O)]];case 125:return T0(x),[0,[35,x0([0,r],[0,q0(x)],O)]];case 129:return hj(x,Ka0);case 130:return hj(x,Ja0);case 131:return hj(x,Ga0)}else if(e[0]===11){var t=e[1];T0(x);var u=q0(x),i=t?-883944824:737456202;return[0,[8,i,x0([0,r],[0,u],O)]]}return 0}function fX(x){var r=i0(x),e=L(x);x:{if(typeof e=="number")switch(e){case 132:var t=1;break x;case 133:var t=2;break x}else if(e[0]===4&&!P(e[3],T3)){var t=0;break x}var t=bx(Wa0)}var u=G0(x);T0(x);var i=q0(x),c=kj(x);return[0,u,c,x0([0,r],[0,i],O),t]}function wh(x,r){return[0,r[1],[0,0,r,0]]}function so(x){return p(JU[1],x,0)}function _h(x){return r0(0,function(r){var e=i0(r);J(r,4);var t=d(so(r),0),u=i0(r);J(r,5);var i=j2([0,e],[0,q0(r)],u,O);return[0,t[1],t[2],t[3],i]},x)}function cX(x){return r0(0,function(r){var e=i0(r);J(r,4);var t=p(GU[1],r,0),u=i0(r);J(r,5);var i=j2([0,e],[0,q0(r)],u,O);return[0,t[1],t[2],i]},x)}function rT0(x){var r=i0(x);J(x,4);var e=Nv(0,x),t=L(e);x:{r:{e:{if(typeof t!="number"){if(t[0]!==4)break r;var u=t[3];if(P(u,Ks)){if(P(u,T3))break e;var i=rr(1,e);t:{if(typeof i=="number"&&1>=i+Vs>>>0){var c=[0,d(so(e),0)];break t}var c=[1,Zr(e)]}var v=c}else{if(!e[28][1])break e;var a=rr(1,e);t:{n:if(typeof a=="number"){if(a!==4&&a!==99)break n;var l=[1,Zr(e)];break t}var l=sX(e)}var v=l}var C=v;break x}switch(t){case 5:var C=Va0;break x;case 132:var m=rr(1,e);t:{if(typeof m=="number"&&m===87){var h=[0,d(so(e),0)];break t}var h=[1,Zr(e)]}var C=h;break x;case 43:break;case 12:case 114:var C=[0,d(so(e),0)];break x;default:break r}}var C=sX(e);break x}r:{e:{if(typeof t=="number")switch(t){case 30:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:break;default:break e}else if(t[0]!==11)break e;var T=1;break r}var T=0}if(T){var b=rr(1,e);r:{if(typeof b=="number"&&1>=b+Vs>>>0){var N=[0,d(so(e),0)];break r}var N=[1,Zr(e)]}var C=N}else var C=[1,Zr(e)]}if(C[0]===0)var I=C;else{var F=C[1];if(x[15])var M=C;else{var Y=L(x);x:{if(typeof Y=="number"){if(Y===5){if(rr(1,x)===11){var q=[0,wh(x,F),0],u0=[0,d(so(x),q)];break x}var u0=[1,F];break x}if(Y===9){J(x,9);var K=[0,wh(x,F),0],u0=[0,d(so(x),K)];break x}}var u0=C}var M=u0}var I=M}var Q=i0(x);J(x,5);var e0=q0(x);if(I[0]===0)var f0=I[1],a0=j2([0,r],[0,e0],Q,O),Z=[0,[0,f0[1],f0[2],f0[3],a0]];else var Z=[1,eT0(I[1],r,e0)];return Z}function sX(x){var r=rr(1,x);if(typeof r=="number"&&1>=r+Vs>>>0)return[0,d(so(x),0)];var e=G0(x),t=lX(x,Fv(x)),u=xX(x,0,e,eX(x,0,e,nX(x,uX(0,x,e,[0,t[1],[19,t[2]]]))));return[1,ZU(ej(0,x),e,u)]}function bh(x,r,e,t,u){return r0([0,e],function(i){return J(i,11),[12,[0,t,u,aX(i),0,x]]},r)}function aX(x){return hh(x)?[1,dj(x)]:[0,Zr(x)]}function dj(x){function r(e){var t=i0(e);J(e,Ko);var u=Lx(t,i0(e));return[0,[0,Zr(e)],u]}return r0(0,function(e){var t=i0(e),u=$r(e,w6)?1:$r(e,u6)?2:0;V2(e,0);var i=a1(e);H2(e);x:if(u===2)var c=r(e),v=c[2],a=c[1];else{var l=L(e);if(typeof l=="number"&&Ko===l){var m=r(e),v=m[2],a=m[1];break x}var v=0,a=0}return[0,u,[0,i,a],j2([0,t],0,v,O)]},x)}function oX(x,r){return r0([0,r],dj,x)}function yj(x,r,e,t){var u=r&&(L(t)===2?1:0),i=r&&1-u;return r0(0,function(c){var v=i0(c),a=u?2:0;J(c,a);var l=Nv(0,c),m=N6(WU[1],x,i,e,u,l,$a0),h=m[3],T=m[2],b=m[1],N=Lx(h,i0(c)),C=u?3:1;return J(c,C),[0,u,T,b,j2([0,v],[0,q0(c)],N,O)]},t)}function vX(x){var r=$r(x,42)?jU(x,p(VU[1],x,0)):0;return[0,r,yj(0,0,0,x)]}function Fv(x){var r=a1(x),e=r[2],t=e[1],u=r[1],i=e[2];return uj(t)&&B0(x,[0,u,97]),[0,u,[0,t,i]]}function Rv(x){if(L(x)!==99)return 0;1-S2(x)&&Ux(x,F1);var r=r0(0,function(t){var u=i0(t);J(t,99);var i=Q0($U[1],t,0,0),c=i0(t);return vh(t,y2),[0,i,j2([0,u],[0,q0(t)],c,O)]},x),e=r[1];return r[2][1]||B0(x,[0,e,52]),[0,r]}function gj(x){return L(x)===99?[0,r0(0,function(r){var e=i0(r);J(r,99);var t=Nv(0,r),u=p(QU[1],t,0),i=i0(t);return J(t,y2),[0,u,j2([0,e],[0,q0(t)],i,O)]},x)]:0}function Th(x){return lX(x,Fv(x))}function lX(x,r){return r0([0,r[1]],function(e){var t=p(HU[1],e,[0,r[1],[0,r]])[2],u=L(e)===99?p(D2(e)[2],t,function(i,c){return p(Xx(i,-860373976,65),i,c)}):t;return[0,u,gj(e),0]},x)}function wj(x){var r=L(x);x:{if(typeof r=="number")switch(r){case 87:var e=G0(x);1-S2(x)&&Ux(x,F1),T0(x);var t=r0(0,Zr,x),u=t[2],i=t[1],c=u[2][0]===26?1:0;return B0(x,[0,e,[16,c]]),[1,i,[0,e,u,0,0]];case 132:case 133:break;default:break x}else if(r[0]!==4||P(r[3],T3))break x;1-S2(x)&&Ux(x,F1);var v=r0([0,G0(x)],fX,x);return[1,v[1],v[2]]}return[0,pa(x)]}function eT0(x,r,e){var t=x[2];function u(h0){return A1(h0,x0([0,r],[0,e],O))}var i=x[1];switch(t[0]){case 0:var B=[0,u(t[1])];break;case 1:var B=[1,u(t[1])];break;case 2:var B=[2,u(t[1])];break;case 3:var B=[3,u(t[1])];break;case 4:var B=[4,u(t[1])];break;case 5:var B=[5,u(t[1])];break;case 6:var B=[6,u(t[1])];break;case 7:var B=[7,u(t[1])];break;case 8:var c=u(t[2]),B=[8,t[1],c];break;case 9:var B=[9,u(t[1])];break;case 10:var B=[10,u(t[1])];break;case 11:var v=t[1],a=u(v[2]),B=[11,[0,v[1],a]];break;case 12:var l=t[1],m=l[5],h=u(l[4]),B=[12,[0,l[1],l[2],l[3],h,m]];break;case 13:var T=t[1],b=u(T[4]),B=[13,[0,T[1],T[2],T[3],b]];break;case 14:var N=t[1],C=N[4],I=j5(C,x0([0,r],[0,e],O)),B=[14,[0,N[1],N[2],N[3],I]];break;case 15:var F=t[1],M=u(F[3]),B=[15,[0,F[1],F[2],M]];break;case 16:var Y=t[1],q=u(Y[2]),B=[16,[0,Y[1],q]];break;case 17:var K=t[1],u0=u(K[5]),B=[17,[0,K[1],K[2],K[3],K[4],u0]];break;case 18:var Q=t[1],e0=u(Q[2]),B=[18,[0,Q[1],e0]];break;case 19:var f0=t[1],a0=u(f0[3]),B=[19,[0,f0[1],f0[2],a0]];break;case 20:var Z=t[1],v0=u(Z[3]),B=[20,[0,Z[1],Z[2],v0]];break;case 21:var t0=t[1],y0=t0[1],n0=t0[2],s0=u(y0[3]),B=[21,[0,[0,y0[1],y0[2],s0],n0]];break;case 22:var l0=t[1],w0=u(l0[2]),B=[22,[0,l0[1],w0]];break;case 23:var L0=t[1],I0=u(L0[2]),B=[23,[0,L0[1],I0]];break;case 24:var j0=t[1],S0=u(j0[3]),B=[24,[0,j0[1],j0[2],S0]];break;case 25:var W0=t[1],A0=u(W0[2]),B=[25,[0,W0[1],A0]];break;case 26:var J0=t[1],b0=J0[4],z=u(J0[3]),B=[26,[0,J0[1],J0[2],z,b0]];break;case 27:var C0=t[1],V0=u(C0[2]),B=[27,[0,C0[1],V0]];break;case 28:var N0=t[1],rx=u(N0[3]),B=[28,[0,N0[1],N0[2],rx]];break;case 29:var xx=t[1],nx=u(xx[3]),B=[29,[0,xx[1],xx[2],nx]];break;case 30:var mx=t[1],F0=u(mx[3]),B=[30,[0,mx[1],mx[2],F0]];break;case 31:var px=t[1],dx=u(px[3]),B=[31,[0,px[1],px[2],dx]];break;case 32:var W=t[1],g0=u(W[2]),B=[32,[0,W[1],g0]];break;case 33:var B=[33,u(t[1])];break;case 34:var B=[34,u(t[1])];break;default:var B=[35,u(t[1])]}return[0,i,B]}Rr(XU,[0,function(x,r,e){for(var t=r;;){if(!$r(e,90)){var u=tx(t);if(u){var i=u[2];if(i){var c=i[2],v=i[1],a=u[1];return[22,[0,[0,a,v,c],x0([0,x],0,O)]]}}throw K0([0,Ir,so0],1)}var t=[0,rX(e),t]}}]),Rr(YU,[0,function(x,r,e){for(var t=r;;){if(!$r(e,92)){var u=tx(t);if(u){var i=u[2];if(i){var c=i[2],v=i[1],a=u[1];return[23,[0,[0,a,v,c],x0([0,x],0,O)]]}}throw K0([0,Ir,co0],1)}var t=[0,tX(e),t]}}]),Rr(zU,[0,function(x,r){for(var e=r;;){var t=e[2],u=e[1];if(L(x)===10&&EU(1,x)){let v=t;var i=r0([0,u],function(l){return J(l,10),[0,v,a1(l)]},x),c=i[1],e=[0,c,[1,[0,c,i[2]]]];continue}return t}}]),Rr(KU,[0,function(x,r){for(var e=r;;){var t=L(x);x:if(typeof t=="number"){if(t!==7&&kr!==t)break x;return[0,tx(e),0]}var u=r0(0,function(l){if(!$r(l,12)){var m=L(l);x:{if(typeof m=="number"&&(ft===m||Pt===m&&ka(1,l))){var h=gh(0,0,l);break x}var h=0}var T=_n(l),b=rr(1,l);if(T&&typeof b=="number"&&1>=b+Vs>>>0){var N=a1(l),C=$r(l,86);return J(l,87),[0,[1,[0,N,Zr(l),h,C]]]}return WM(h)&&Ux(l,44),[0,[0,Zr(l)]]}var I=L(l);x:if(typeof I=="number"){if(10<=I){if(kr!==I)break x}else{if(7>I)break x;switch(I-7|0){case 0:break;case 1:break x;default:return p2(fo0,l),T0(l),0}}return 0}var F=_n(l),M=rr(1,l);x:{if(F&&typeof M=="number"&&1>=M+Vs>>>0){var Y=a1(l);L(l)===86&&(Ux(l,43),T0(l)),J(l,87);var q=[0,Y];break x}var q=0}return[0,[2,[0,q,Zr(l)]]]},x),i=u[2],c=u[1];if(!i)return[0,tx(e),1];var v=[0,[0,c,i[1]],e];L(x)!==7&&J(x,9);var e=v}}]);function pX(x){var r=rr(1,x);return typeof r=="number"&&1>=r+Vs>>>0?r0(0,function(e){V2(e,0);var t=p(X0[13],0,e);H2(e),1-S2(e)&&Ux(e,F1);var u=$r(e,86);return J(e,87),[0,[0,t],Zr(e),u]},x):wh(x,Zr(x))}Rr(JU,[0,function(x,r,e){for(var t=r,u=e;;){var i=L(x);x:if(typeof i=="number")switch(i){case 5:case 12:case 114:var c=i===12?[0,r0(0,function(T){var b=i0(T);J(T,12);var N=x0([0,b],0,O);return[0,pX(T),N]},x)]:0;return[0,t,tx(u),c,0]}else if(i[0]===4&&!P(i[3],xv)){if(rr(1,x)!==87&&rr(1,x)!==86)break x;var v=t!==0?1:0,a=v||(u!==0?1:0);a&&Ux(x,90);var l=r0(0,function(b){var N=i0(b);T0(b),L(b)===86&&Ux(b,89);var C=x0([0,N],0,O);return[0,o4(b),C]},x);L(x)!==5&&J(x,9);var t=[0,l];continue}var m=[0,pX(x),u];L(x)!==5&&J(x,9);var u=m}}]),Rr(GU,[0,function(x,r){for(var e=r;;){var t=L(x);x:if(typeof t=="number"){var u=t-5|0;if(7>>0){if(Vn!==u)break x}else if(5>=u-1>>>0)break x;var i=t===12?[0,r0(0,function(a){var l=i0(a);J(a,12);var m=rr(1,a);r:{if(typeof m=="number"){if(m===86){V2(a,0);var h=p(X0[13],0,a);H2(a),J(a,86),J(a,87);var b=1,N=[0,h];break r}if(m===87){V2(a,0);var T=p(X0[13],0,a);H2(a),J(a,87);var b=0,N=[0,T];break r}}var b=0,N=0}var C=Zr(a);return L(a)===9&&T0(a),[0,N,C,b,x0([0,l],0,O)]},x)]:0;return[0,tx(e),i,0]}var c=[0,r0(0,function(a){var l=L(a);x:{if(typeof l!="number"&&l[0]===2){var m=l[1],h=m[4],T=m[3],b=m[2],N=m[1];h&&Ne(a,77),J(a,[2,[0,N,b,T,h]]);var I=[1,[0,N,[0,b,T,x0(0,[0,q0(a)],O)]]];break x}V2(a,0);var C=p(X0[13],0,a);H2(a);var I=[0,C]}var F=$r(a,86);return[0,I,o4(a),F]},x),e];L(x)!==5&&J(x,9);var e=c}}]);function Eh(x,r,e){return r0([0,r],function(t){var u=_h(t);return J(t,87),[0,e,u,aX(t),0,1]},x)}function kX(x,r,e,t,u){var i=Tn(x,t),c=Eh(x,r,re(x,Rv(x))),v=[0,c[1],[12,c[2]]],a=[0,i,[0,v],0,e!==0?1:0,0,1,0,x0([0,u],0,O)];return[0,[0,v[1],a]]}function Sh(x,r,e,t,u,i,c){var v=c[2],a=c[1];return 1-S2(x)&&Ux(x,F1),[0,r0([0,r],function(l){var m=$r(l,86),h=PU(l,87)?Zr(l):[0,a,io0];return[0,v,[0,h],m,t!==0?1:0,u!==0?1:0,0,e,x0([0,i],0,O)]},x)]}function v4(x,r){var e=L(r);if(typeof e=="number"&&10>e)switch(e){case 1:if(!x)return;break;case 3:if(x)return;break;case 8:case 9:return T0(r)}return bn(r,9)}function l4(x,r){if(r)return B0(x,[0,r[1][1],Hs])}function p4(x,r){if(r)return B0(x,[0,r[1],95])}function tT0(x,r,e,t,u,i,c,v,a){for(var l=e,m=t,h=u,T=i,b=c,N=v;;){var C=L(x);if(typeof C=="number")switch(C){case 6:p4(x,b);var I=rr(1,x);if(typeof I=="number"&&I===6)return l4(x,h),[4,r0([0,a],function(b0){var z=Lx(N,i0(b0));J(b0,6),J(b0,6);var C0=a1(b0);J(b0,7),J(b0,7);var V0=L(b0);x:{r:if(typeof V0=="number"){if(V0!==4&&V0!==99)break r;var N0=Eh(b0,a,re(b0,Rv(b0))),nx=0,mx=[0,N0[1],[12,N0[2]]],F0=1,px=0;break x}var rx=$r(b0,86),xx=q0(b0);J(b0,87);var nx=xx,mx=Zr(b0),F0=0,px=rx}return[0,C0,mx,px,T!==0?1:0,F0,x0([0,z],[0,nx],O)]},x)];var F=Lx(N,i0(x));J(x,6);var M=rr(1,x);return typeof M!="number"&&M[0]===4&&!P(M[3],Ra)&&T===0?[5,r0([0,a],function(b0){var z=Fv(b0),C0=z[1];T0(b0);var V0=Zr(b0);J(b0,7);var N0=L(b0);x:{r:{var rx=[0,z,[0,C0],0,0,0,0];if(typeof N0=="number"){var xx=N0+B9|0;if(1>>0){if(xx!==-18)break r;T0(b0);var nx=2}else var nx=xx?(T0(b0),J(b0,86),1):(T0(b0),J(b0,86),0);var mx=nx;break x}}var mx=3}J(b0,87);var F0=Zr(b0);return[0,[0,C0,rx],F0,V0,h,mx,x0([0,F],[0,q0(b0)],O)]},x)]:[2,r0([0,a],function(b0){if(rr(1,b0)===87){var z=a1(b0);J(b0,87);var C0=[0,z]}else var C0=0;var V0=Zr(b0);J(b0,7);var N0=q0(b0);J(b0,87);var rx=Zr(b0);return[0,C0,V0,rx,T!==0?1:0,h,x0([0,F],[0,N0],O)]},x)];case 43:if(l){if(h!==0)throw K0([0,Ir,xo0],1);var Y=[0,G0(x)],q=Lx(N,i0(x));T0(x);var l=0,m=0,T=Y,N=q;continue}break;case 127:if(h===0){if(!ka(1,x)&&rr(1,x)!==6)break;var l=0,m=0,h=gh(ro0,0,x);continue}break;case 104:case 105:if(h===0){var l=0,m=0,h=gh(0,0,x);continue}break;case 4:case 99:return p4(x,b),l4(x,h),[3,r0([0,a],function(b0){var z=G0(b0),C0=Eh(b0,z,re(b0,Rv(b0)));return[0,C0,T!==0?1:0,x0([0,N],0,O)]},x)]}else if(C[0]===4&&!P(C[3],dg)&&m){if(h!==0)throw K0([0,Ir,eo0],1);var K=[0,G0(x)],u0=Lx(N,i0(x));T0(x);var l=0,m=0,b=K,N=u0;continue}if(T){var Q=T[1];if(b)return bx(to0);if(typeof C=="number"&&1>=C+Vs>>>0)return Sh(x,a,h,0,b,0,[0,Q,[3,gn(x0([0,N],0,O),[0,Q,no0])]])}else if(b){var e0=b[1];if(typeof C=="number"&&1>=C+Vs>>>0)return Sh(x,a,h,T,0,0,[0,e0,[3,gn(x0([0,N],0,O),[0,e0,uo0])]])}var f0=function(b0){V2(b0,0);var z=p(X0[20],0,b0);return H2(b0),z},a0=i0(x),Z=f0(x),v0=Z[1],t0=Z[2];x:if(t0[0]===3){var y0=t0[1][2][1];if(P(y0,zo)&&P(y0,S3))break x;var n0=L(x);if(typeof n0=="number"){var s0=n0-5|0;if(93>>0){if(95>=s0+1>>>0)return p4(x,b),l4(x,h),kX(x,a,T,t0,N)}else if(1>=s0-81>>>0)return Sh(x,a,h,T,b,N,[0,v0,t0])}Tn(x,t0);var l0=f0(x),w0=_r(y0,zo),L0=Lx(N,a0);return p4(x,b),l4(x,h),[0,r0([0,a],function(b0){var z=l0[1],C0=Tn(b0,l0[2]),V0=Eh(b0,a,0),N0=V0[2][2];r:if(w0){var rx=N0[2];e:{if(!rx[1]){if(!rx[2]&&!rx[3])break e;B0(b0,[0,z,23]);break r}B0(b0,[0,z,24])}}else{var xx=N0[2];if(xx[1])B0(b0,[0,z,67]);else{var nx=xx[2];e:{if(!xx[3]){if(nx&&!nx[2])break e;B0(b0,[0,z,66]);break r}B0(b0,[0,z,66])}}}var mx=x0([0,L0],0,O),F0=0,px=0,dx=0,W=T!==0?1:0,g0=0,B=w0?[1,V0]:[2,V0];return[0,C0,B,g0,W,dx,px,F0,mx]},x)]}var I0=Z[2],j0=L(x);x:if(typeof j0=="number"){if(j0!==4&&j0!==99)break x;return p4(x,b),l4(x,h),kX(x,a,T,I0,N)}var S0=T!==0?1:0;x:if(I0[0]===3){var W0=I0[1],A0=W0[2][1];r:{var J0=W0[1];if(r){if(!_r(Mo,A0)&&(!S0||!_r(Xa,A0)))break r;B0(x,[0,J0,[15,A0,S0,0,0]]);break x}}}return Sh(x,a,h,T,b,N,[0,v0,I0])}}Rr(WU,[0,function(x,r,e,t,u,i){for(var c=i;;){var v=c[3],a=c[2],l=c[1];if(x&&e)throw K0([0,Ir,Ha0],1);if(r&&!e)throw K0([0,Ir,Za0],1);var m=G0(u),h=L(u);if(typeof h=="number"){if(13<=h){if(kr===h)return[0,tx(l),a,v]}else if(h)switch(h-1|0){case 0:if(!t)return[0,tx(l),a,v];break;case 2:if(t)return[0,tx(l),a,v];break;case 11:if(!e){T0(u);var T=L(u);if(typeof T=="number"&&10>T)switch(T){case 1:case 3:case 8:case 9:B0(u,[0,m,32]),v4(t,u);continue}var b=ij(u);nj(u)(b),B0(u,[0,m,98]),T0(u),v4(t,u);continue}var N=i0(u);T0(u);var C=L(u);if(typeof C=="number"&&10>C)switch(C){case 1:case 3:case 8:case 9:v4(t,u);var I=L(u);if(typeof I=="number"){var F=I-1|0;if(2>=F>>>0)switch(F){case 0:if(r)return[0,tx(l),1,N];break;case 1:break;default:return B0(u,[0,m,31]),[0,tx(l),a,v]}}B0(u,[0,m,93]);continue}let K=N;var M=[1,r0([0,m],function(Q){var e0=x0([0,K],0,O);return[0,Zr(Q),e0]},u)];v4(t,u);var c=[0,[0,M,l],a,v];continue}}var Y=tT0(u,x,x,x,0,0,0,0,m);v4(t,u);var c=[0,[0,Y,l],a,v]}}]),Rr(VU,[0,function(x,r){for(var e=r;;){var t=[0,Th(x),e],u=L(x);if(typeof u=="number"&&u===9){J(x,9);var e=t;continue}return tx(t)}}]);function mX(x,r){var e=_U(x,r);if(e)var t=e;else{x:{if(typeof r=="number"&&1>=r+B9>>>0){var u=1;break x}var u=0}if(!u){x:{if(typeof r=="number")switch(r){case 15:case 28:case 30:case 31:case 32:case 42:case 43:case 47:case 54:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:break;default:break x}else switch(r[0]){case 4:if(uj(r[3]))return 1;break x;case 11:break;default:break x}return 1}return 0}var t=u}return t}Rr($U,[0,function(x,r,e){for(var t=r,u=e;;){if(mX(x,L(x))){let b=t;var i=aj(0,function(I){var F=L(I);x:{if(typeof F=="number"&&F===28){var M=[0,r0(0,function(y0){var n0=i0(y0);return T0(y0),x0([0,n0],0,O)},I)];break x}var M=0}var Y=gh(0,Qa0,I),q=r0(0,function(t0){var y0=Fv(t0),n0=L(t0);x:{if(typeof n0=="number"){if(n0===42){var s0=1,l0=[1,r0(0,function(I0){return T0(I0),Zr(I0)},t0)];break x}if(n0===87){var s0=0,l0=[1,o4(t0)];break x}}var s0=0,l0=[0,pa(t0)]}return[0,y0,l0,s0]},I),K=q[2],u0=K[3],Q=K[2],e0=K[1],f0=q[1],a0=L(I);x:{if(typeof a0=="number"&&a0===83){T0(I);var Z=1,v0=[0,Zr(I)];break x}b&&B0(I,[0,f0,53]);var Z=b,v0=0}return[0,[0,e0,Q,u0,Y,v0,M],Z]},x),c=i[2],v=[0,i[1],u]}else var c=t,v=u;var a=L(x);if(typeof a=="number"){var l=a+q9|0;if(14>>0){if(l===-91){T0(x);var t=c,u=v;continue}}else if(12>>0)return tx(v)}x:{r:{e:{if(typeof a!="number"){if(a[0]!==4)break r;var m=a[3];if(!ch(m)){t:{if(P(m,fv)&&P(m,z1)){var h=0;break t}var h=1}if(!h){if(P(m,r6)){if(!P(m,vv))break e;if(P(m,Yf))break r;break e}if(!x[28][2])break r;var T=1;break x}}var T=1;break x}switch(a){case 4:case 83:break;default:break r}}var T=1;break x}var T=0}if(T)return bn(x,y2),tx(v);if(mX(x,a)){bn(x,9);var t=c,u=v}else{J(x,9);var t=c,u=v}}}]),Rr(QU,[0,function(x,r){for(var e=r;;){var t=L(x);x:if(typeof t=="number"){if(y2!==t&&kr!==t)break x;return tx(e)}var u=[0,Zr(x),e];y2!==L(x)&&J(x,9);var e=u}}]),Rr(HU,[0,function(x,r){for(var e=r;;){var t=e[2],u=e[1];if(L(x)===10&&sh(1,x)){let v=t;var i=r0([0,u],function(l){return J(l,10),[0,v,Fv(l)]},x),c=i[1],e=[0,c,[1,[0,c,i[2]]]];continue}return[0,u,t]}}]);function hX(x,r){if(L(x)!==4)return[0,0,x0([0,r],[0,q0(x)],O)];var e=Lx(r,i0(x));J(x,4),V2(x,0);var t=d(X0[9],x);return H2(x),J(x,5),[0,[0,t],x0([0,e],[0,q0(x)],O)]}function nT0(x){var r=L(x);if(typeof r=="number"&&r===87){1-S2(x)&&Ux(x,F1);var e=G0(x);return J(x,87),hh(x)?[2,oX(x,e)]:[1,r0([0,e],Zr,x)]}return[0,pa(x)]}function uT0(x){var r=L(x);return typeof r=="number"&&r===87?[1,o4(x)]:[0,pa(x)]}function iT0(x){var r=i0(x);return J(x,67),hX(x,r)}var fT0=0;function dX(x){var r=Nv(0,x),e=L(r);return typeof e=="number"&&e===67?[0,r0(fT0,iT0,r)]:0}function cT0(x){var r=L(x);if(typeof r=="number"&&r===87){1-S2(x)&&Ux(x,F1);var e=pa(x),t=G0(x);J(x,87);var u=L(x);if(typeof u=="number"&&u===67)return[0,[0,e],[0,r0([0,t],function(v){var a=i0(v);return J(v,67),hX(v,a)},Nv(0,x))]];if(hh(x))return[0,[2,oX(x,t)],0];var i=[1,r0([0,t],Zr,x)],c=L(x)===67?vl(x,i):i;return[0,c,dX(x)]}return[0,[0,pa(x)],0]}function Ce(x,r){var e=la(1,r);V2(e,1);var t=x(e);return H2(e),t}function ma(x){return Ce(Zr,x)}function Ts(x){return Ce(Fv,x)}function $e(x){return Ce(Rv,x)}function yX(x){return Ce(gj,x)}function Lv(x){return Ce(o4,x)}function _j(x){return Ce(uT0,x)}function bj(x){return Ce(nT0,x)}function Tj(x){return Ce(cT0,x)}function gX(x){return Ce(Th,x)}function Ej(x){return Ce(wj,x)}function ao(x,r){var e=r[2],t=r[1],u=x[1];switch(e[0]){case 0:return m1(sT0,x,e[1][1]);case 1:return m1(aT0,x,e[1][1]);case 2:var i=e[1][1],c=i[2][1],v=x[2],a=x[1],l=i[1];N1[3].call(null,c,v)&&B0(a,[0,l,78]);var m=i[2][1],h=i[1];return Cv(m)&&pt(a,[0,h,79]),sl(m)&&pt(a,[0,h,81]),[0,a,N1[4].call(null,c,v)];default:return B0(u,[0,t,20]),x}}function sT0(x){return function(r){return r[0]===0?ao(x,r[1][2][2]):ao(x,r[1][2][1])}}function aT0(x){return function(r){switch(r[0]){case 0:return ao(x,r[1][2][1]);case 1:return ao(x,r[1][2][1]);default:return x}}}function wX(x,r){var e=r[2],t=e[3],u=m1(function(i,c){return ao(i,c[2][1])},[0,x,N1[1]],e[2]);t&&ao(u,t[1][2][1])}function _X(x,r,e,t){var u=x[5],i=t[0]===0?Dv(t[1]):0,c=la(u?0:r,x),v=r||u||1-i;if(!v)return v;if(e){var a=e[1],l=a[2][1],m=a[1];Cv(l)&&pt(c,[0,m,71]),sl(l)&&pt(c,[0,m,81])}if(t[0]===0)return wX(c,t[1]);var h=t[1][2],T=h[2],b=[0,K3,[0,[0,dn(function(C){var I=C[2],F=I[1],M=I[4],Y=I[3],q=I[2],K=F[0]===0?[3,F[1]]:[0,[0,K3,F[1][2]]];return[0,[0,K3,[0,K,q,Y,M]]]},h[1]),[0,K3],0]]],N=ao([0,c,N1[1]],b);T&&ao(N,T[1][2][1])}function kl(x,r,e,t){return _X(x,r,e,[0,t])}function bX(x,r){if(r!==12)return 0;var e=i0(x),t=r0(0,function(c){return J(c,12),p(X0[18],c,79)},x),u=t[2],i=t[1];return[0,[0,i,u,x0([0,e],0,O)]]}function oT0(x){L(x)===22&&Ux(x,90);var r=p(X0[18],x,79),e=L(x)===83?(J(x,83),[0,d(X0[10],x)]):0;return[0,r,e]}var vT0=0;function ml(x,r){function e(u){var i=kU(1,ZC(r,xj(x,u))),c=i0(i);J(i,4);x:{if(S2(i)&&L(i)===22){var v=i0(i),a=r0(0,function(K){return J(K,22),L(K)===87?[0,Lv(K)]:(Ux(K,86),0)},i),l=a[2],m=a[1];if(!l){var T=0;break x}var h=l[1];L(i)===9&&T0(i);var T=[0,[0,m,[0,h,x0([0,v],0,O)]]];break x}var T=0}x:r:{for(var b=0;;){var N=L(i);if(typeof N=="number"){var C=N-5|0;if(7>>0){if(Vn===C)break}else if(5>>0)break r}var I=r0(vT0,oT0,i);L(i)!==5&&J(i,9);var b=[0,I,b]}break x}var F=l5(function(q){return[0,q[1],[0,q[2],q[3]]]},bX(i,N));L(i)!==5&&Ux(i,62);var M=tx(b),Y=i0(i);return J(i,5),[0,T,M,F,j2([0,c],[0,q0(i)],Y,O)]}var t=0;return function(u){return r0(t,e,u)}}function TX(x,r,e,t,u){var i=wU(x,r,e,u);return p(X0[16],t,i)}function k4(x,r,e,t,u){var i=TX(x,r,e,t,u);return[0,[0,i[1]],i[2]]}function Mv(x){if(K2!==L(x))return Mv0;var r=i0(x);return T0(x),[0,1,r]}function Ah(x){if(L(x)===65&&!jv(1,x)){var r=i0(x);return T0(x),[0,1,r]}return Lv0}function lT0(x){var r=Ah(x),e=r[1],t=r[2],u=r0(0,function(F){var M=i0(F),Y=L(F);x:{if(typeof Y=="number"){if(Y===15){T0(F);var q=Mv(F),u0=q[2],Q=q[1],e0=1;break x}}else if(Y[0]===4&&!P(Y[3],Ho)&&!e){T0(F);var u0=0,Q=0,e0=0;break x}bn(F,Y);var K=Mv(F),u0=K[2],Q=K[1],e0=1}var f0=F6([0,t,[0,M,[0,u0,0]]]),a0=F[7],Z=L(F);x:{if(a0&&typeof Z=="number"){if(Z===4){var n0=0,s0=0;break x}if(Z===99){var v0=re(F,$e(F)),t0=L(F)===4?0:[0,Ut(F,p(X0[13],Ov0,F))],n0=t0,s0=v0;break x}}var y0=_n(F)?Ut(F,p(X0[13],Dv0,F)):(AU(F,Fv0),[0,G0(F),Rv0]),n0=[0,y0],s0=re(F,$e(F))}var l0=ml(e,Q)(F),w0=L(F)===87?l0:c4(F,l0),L0=Tj(F),I0=L0[2],j0=L0[1];if(I0)var S0=CU(F,I0),W0=j0;else var S0=I0,W0=vl(F,j0);return[0,Q,e0,s0,n0,w0,W0,S0,f0]},x),i=u[2],c=i[5],v=i[4],a=i[1],l=i[8],m=i[7],h=i[6],T=i[3],b=i[2],N=u[1],C=k4(x,e,a,0,Dv(c)),I=C[1];return kl(x,C[2],v,c),[27,[0,v,c,I,e,a,b,m,h,T,x0([0,l],0,O),N]]}var pT0=0;function m4(x){return r0(pT0,lT0,x)}function Sj(x,r){var e=i0(r);J(r,x);var t=r[28][2];if(t)var u=x===28?1:0,i=u&&(L(r)===49?1:0);else var i=t;i&&Ux(r,19);for(var c=0,v=0;;){var a=r0(0,function(I){var F=p(X0[18],I,82);if($r(I,83))var M=0,Y=[0,d(X0[10],I)];else{var q=F[1];if(F[2][0]===2)var M=0,Y=0;else var M=[0,[0,q,59]],Y=0}return[0,[0,F,Y],M]},r),l=a[2],m=l[2],h=[0,[0,a[1],l[1]],c],T=m?[0,m[1],v]:v;if(!$r(r,9)){var b=tx(T);return[0,tx(h),e,b]}var c=h,v=T}}var kT0=qU(X0),mT0=25;function EX(x){return Sj(mT0,x)}function SX(x){var r=Sj(28,rj(1,x)),e=r[1],t=r[2];return[0,e,t,tx(m1(function(u,i){return i[2][2]?u:[0,[0,i[1],58],u]},r[3],e))]}function AX(x){return Sj(29,rj(1,x))}function PX(x){function r(t){return[20,kT0[1].call(null,x,t)]}var e=0;return function(t){return r0(e,r,t)}}function hT0(x){var r=i0(x),e=L(x),t=rr(1,x);x:{r:if(typeof e!="number"&&e[0]===2){var u=e[1],i=u[4],c=u[3],v=u[2],a=u[1];e:{if(typeof t=="number")switch(t){case 86:case 87:break;default:break e}else{if(t[0]!==4)break e;if(P(t[3],It))break r}i&&Ne(x,77),J(x,[2,[0,a,v,c,i]]);var l=[1,[0,a,[0,v,c,x0([0,r],[0,q0(x)],O)]]];if(typeof t=="number"&&1>=t+Vs>>>0){var m=t===86?1:0;Ux(x,[17,m,v]),m&&T0(x);var h=G0(x),I=0,F=[0,h,[2,[0,[0,h,Nv0],_j(x),m]]],M=l;break x}T0(x);var I=0,F=p(X0[18],x,79),M=l;break x}}if(typeof t!="number"&&t[0]===4&&!P(t[3],It)){var T=[0,a1(x)];bs(x,Cv0);var I=0,F=p(X0[18],x,79),M=T;break x}if(typeof e=="number"&&!e){Ux(x,33);var b=[0,[0,G0(x),jv0]],I=0,F=p(X0[18],x,79),M=b;break x}var N=Q0(X0[14],x,0,79),C=N[2],I=1,F=[0,N[1],[2,C]],M=[0,C[1]]}var Y=L(x)===83?(J(x,83),[0,d(X0[10],x)]):0;return[0,M,F,Y,I]}var dT0=0;function yT0(x){var r=kU(1,x),e=i0(r);J(r,4);x:r:{for(var t=0;;){var u=L(r);if(typeof u=="number"){var i=u-5|0;if(7>>0){if(Vn===i)break}else if(5>>0)break r}var c=r0(dT0,hT0,r);L(r)!==5&&J(r,9);var t=[0,c,t]}break x}var v=l5(function(m){var h=m[3],T=m[2],b=m[1];return L(r)===9&&T0(r),[0,b,[0,T,h]]},bX(r,u));L(r)!==5&&Ux(r,62);var a=tx(t),l=i0(r);return J(r,5),[0,a,v,j2([0,e],[0,q0(r)],l,O)]}var gT0=0;function wT0(x){var r=r0(0,function(h){var T=i0(h);bs(h,Pv0);var b=Ut(h,p(X0[13],Iv0,h)),N=re(h,$e(h)),C=r0(gT0,yT0,h),I=cj(h)?C:p(D2(h)[2],C,function(F,M){return p(Xx(F,842685896,11),F,M)});return[0,N,b,I,sj(h,Ej(h)),T]},x),e=r[2],t=e[3],u=e[2],i=e[5],c=e[4],v=e[1],a=r[1],l=TX(x,0,0,0,0),m=l[1];return _X(x,l[2],[0,u],[1,t]),[3,[0,u,v,t,c,m,x0([0,i],0,O),a]]}var _T0=0;function Aj(x){return r0(_T0,wT0,x)}function y1(x,r){if(r[0]===0)return r[1];var e=r[1];return T1(function(t){return B0(x,t)},r[2][1]),e}function Pj(x,r,e){var t=x?x[1]:36;if(e[0]===0)var u=e[1];else{var i=e[1];T1(function(l){return B0(r,l)},e[2][2]);var u=i}1-d(X0[23],u)&&B0(r,[0,u[1],t]);var c=u[2];x:if(c[0]===10){var v=u[1];if(Cv(c[1][2][1])){pt(r,[0,v,72]);break x}}return p(X0[19],r,u)}function Ij(x,r){var e=G3(x[2],r[2]);return[0,G3(x[1],r[1]),e]}function IX(x){var r=tx(x[2]);return[0,tx(x[1]),r]}function Ph(x){var r=G0(x),e=NX(x),t=L(x);x:{if(typeof t=="number"&&t===90){var u=r0([0,r],function(l){for(var m=[0,e,0];;){var h=L(l);if(typeof h=="number"&&h===90){T0(l);var m=[0,NX(l),m];continue}var T=tx(m);return[0,T,x0(0,[0,q0(l)],O)]}},x),i=[0,u[1],[12,u[2]]];break x}var i=e}var c=L(x);if(typeof c!="number"&&c[0]===4&&!P(c[3],It)){var v=r0([0,r],function(a){T0(a);var l=L(a);x:{r:if(typeof l=="number"){var m=l+A3|0;if(4>=m>>>0){switch(m){case 0:var h=Xt(a,0),N=[1,h[1],h[2]];break;case 3:var T=Xt(a,2),N=[1,T[1],T[2]];break;case 4:var b=Xt(a,1),N=[1,b[1],b[2]];break;default:break r}var C=N;break x}}var C=[0,p(X0[13],0,a)]}return[0,i,C,x0(0,[0,q0(a)],O)]},x);return[0,v[1],[13,v[2]]]}return i}function NX(x){var r=L(x);if(typeof r=="number")switch(r){case 0:var e=function(m0){var Dx=G0(m0),Ex=i0(m0);function qx($){var ix=$[2],U0=$[1],cx=[2,[0,U0,ix[2][2]]];return[0,Dx,[0,cx,[0,U0,[7,ix]],1,x0([0,Ex],[0,q0(m0)],O)]]}var O0=L(m0);if(typeof O0=="number"){var Wx=O0+A3|0;if(4>=Wx>>>0)switch(Wx){case 0:return qx(Xt(m0,0));case 3:return qx(Xt(m0,2));case 4:return qx(Xt(m0,1))}}var Yx=i0(m0),fx=L(m0);x:{if(typeof fx!="number")switch(fx[0]){case 0:var Qx=fx[2],vx=fx[1],nr=G0(m0),gr=Q0(X0[24],m0,vx,Qx),jx=[1,[0,nr,[0,gr,Qx,x0([0,Yx],[0,q0(m0)],O)]]];break x;case 2:var Nr=fx[1],s2=Nr[4],b2=Nr[3],k2=Nr[2],F2=Nr[1];s2&&Ne(m0,77),J(m0,[2,[0,F2,k2,b2,s2]]);var jx=[0,[0,F2,[0,k2,b2,x0([0,Yx],[0,q0(m0)],O)]]];break x}var jx=[2,a1(m0)]}J(m0,87);var _=Ph(m0);return[0,Dx,[0,jx,_,0,x0([0,Ex],[0,q0(m0)],O)]]};return r0(0,function(m0){var Dx=i0(m0);J(m0,0);x:{for(var Ex=0;;){var qx=L(m0);if(typeof qx=="number"){var O0=qx-2|0;if(G1>>0){if(J1>=O0+1>>>0){var fx=[0,tx(Ex),0];break x}}else if(O0===10)break}var Wx=e(m0);1-(L(m0)===1?1:0)&&J(m0,9);var Ex=[0,Wx,Ex]}var Yx=jX(m0);L(m0)===9&&B0(m0,[0,G0(m0),Cl0]);var fx=[0,tx(Ex),[0,Yx]]}var Qx=fx[2],vx=fx[1],nr=i0(m0);return J(m0,1),[10,[0,vx,Qx,j2([0,Dx],[0,q0(m0)],nr,O)]]},x);case 4:var t=i0(x);J(x,4);var u=Ph(x);J(x,5);var i=q0(x),c=u[2],v=function(m0){return A1(m0,x0([0,t],[0,i],O))},a=function(m0){return j5(m0,x0([0,t],[0,i],O))},l=u[1];switch(c[0]){case 0:var S0=[0,v(c[1])];break;case 1:var m=c[1],h=v(m[3]),S0=[1,[0,m[1],m[2],h]];break;case 2:var T=c[1],b=v(T[3]),S0=[2,[0,T[1],T[2],b]];break;case 3:var N=c[1],C=v(N[3]),S0=[3,[0,N[1],N[2],C]];break;case 4:var I=c[1],F=v(I[2]),S0=[4,[0,I[1],F]];break;case 5:var S0=[5,v(c[1])];break;case 6:var M=c[1],Y=v(M[3]),S0=[6,[0,M[1],M[2],Y]];break;case 7:var q=c[1],K=v(q[3]),S0=[7,[0,q[1],q[2],K]];break;case 8:var u0=c[1],Q=u0[2],e0=u0[1],f0=v(Q[2]),S0=[8,[0,e0,[0,Q[1],f0]]];break;case 9:var a0=c[1],Z=a0[2],v0=a0[1],t0=v(Z[3]),S0=[9,[0,v0,[0,Z[1],Z[2],t0]]];break;case 10:var y0=c[1],n0=a(y0[3]),S0=[10,[0,y0[1],y0[2],n0]];break;case 11:var s0=c[1],l0=a(s0[3]),S0=[11,[0,s0[1],s0[2],l0]];break;case 12:var w0=c[1],L0=v(w0[2]),S0=[12,[0,w0[1],L0]];break;default:var I0=c[1],j0=v(I0[3]),S0=[13,[0,I0[1],I0[2],j0]]}return[0,l,S0];case 6:return r0(0,function(m0){var Dx=i0(m0),Ex=G0(m0);J(m0,6);x:{for(var qx=0;;){var O0=L(m0);if(typeof O0=="number"){var Wx=O0-8|0;if(Pt>>0){if(K2>=Wx+1>>>0){var vx=[0,tx(qx),0];break x}}else if(Wx===4)break}var Yx=Ph(m0),fx=Vr(Ex,G0(m0));L(m0)!==7&&J(m0,9);var qx=[0,[0,fx,Yx],qx]}var Qx=jX(m0);L(m0)===9&&B0(m0,[0,G0(m0),jl0]);var vx=[0,tx(qx),[0,Qx]]}var nr=vx[2],gr=vx[1],Nr=i0(m0);return J(m0,7),[11,[0,gr,nr,j2([0,Dx],[0,q0(m0)],Nr,O)]]},x);case 25:var W0=Xt(x,0);return[0,W0[1],[7,W0[2]]];case 28:var A0=Xt(x,2);return[0,A0[1],[7,A0[2]]];case 29:var J0=Xt(x,1);return[0,J0[1],[7,J0[2]]];case 30:var b0=i0(x),z=G0(x);return T0(x),[0,z,[5,x0([0,b0],[0,q0(x)],O)]];case 104:return CX(x,0);case 105:return CX(x,1);case 31:case 32:var C0=i0(x),V0=G0(x);return T0(x),[0,V0,[4,[0,r===32?1:0,x0([0,C0],[0,q0(x)],O)]]]}else switch(r[0]){case 0:var N0=r[2],rx=r[1],xx=i0(x),nx=G0(x),mx=Q0(X0[24],x,rx,N0);return[0,nx,[1,[0,mx,N0,x0([0,xx],[0,q0(x)],O)]]];case 1:var F0=r[2],px=r[1],dx=i0(x),W=G0(x),g0=Q0(X0[26],x,px,F0);return[0,W,[2,[0,g0,F0,x0([0,dx],[0,q0(x)],O)]]];case 2:var B=r[1],h0=B[4],_0=B[3],d0=B[2],E0=B[1],U=i0(x);return h0&&Ne(x,77),T0(x),[0,E0,[3,[0,d0,_0,x0([0,U],[0,q0(x)],O)]]];case 4:if(!P(r[3],Xo)){var Kx=i0(x),Ix=G0(x);return T0(x),[0,Ix,[0,x0([0,Kx],[0,q0(x)],O)]]}break}if(!_n(x)){var z0=i0(x),Kr=G0(x);p2(0,x);x:if(typeof r!="number"&&r[0]===7){T0(x);break x}return[0,Kr,[0,x0([0,z0],Al0,O)]]}for(var S=G0(x),G=[0,p(X0[13],0,x)];;){var Z0=L(x);if(typeof Z0=="number"){if(Z0===6){let m0=G;var G=[1,r0([0,S],function(Ex){J(Ex,6);var qx=i0(Ex),O0=L(Ex);x:{if(typeof O0!="number")switch(O0[0]){case 0:var Wx=O0[2],Yx=O0[1],fx=G0(Ex),Qx=Q0(X0[24],Ex,Yx,Wx),b2=[1,[0,fx,[0,Qx,Wx,x0([0,qx],[0,q0(Ex)],O)]]];break x;case 2:var vx=O0[1],nr=vx[4],gr=vx[3],Nr=vx[2],s2=vx[1];nr&&Ne(Ex,77),J(Ex,[2,[0,s2,Nr,gr,nr]]);var b2=[0,[0,s2,[0,Nr,gr,x0([0,qx],[0,q0(Ex)],O)]]];break x}p2(El0,Ex);var b2=[0,[0,G0(Ex),Sl0]]}return J(Ex,7),[0,m0,b2,x0(0,[0,q0(Ex)],O)]},x)];continue}if(Z0===10){let m0=G;var G=[1,r0([0,S],function(Ex){T0(Ex);var qx=[2,a1(Ex)];return[0,m0,qx,x0(0,[0,q0(Ex)],O)]},x)];continue}}if(G[0]===0){var yx=G[1];return[0,yx[1],[8,yx]]}var Tx=G[1],ex=Tx[1];return[0,ex,[9,[0,ex,Tx[2]]]]}}function CX(x,r){return r0(0,function(e){var t=i0(e);T0(e);var u=L(e);x:{if(typeof u!="number")switch(u[0]){case 0:var i=u[2],c=u[1],v=i0(e),a=G0(e),l=Q0(X0[24],e,c,i),I=[0,a,[0,[0,l,i,x0([0,v],[0,q0(e)],O)]]];break x;case 1:var m=u[2],h=u[1],T=i0(e),b=G0(e),N=Q0(X0[26],e,h,m),I=[0,b,[1,[0,N,m,x0([0,T],[0,q0(e)],O)]]];break x}var C=G0(e);p2(Pl0,e);var I=[0,C,Il0]}return[6,[0,r,I,x0([0,t],[0,q0(e)],O)]]},x)}function Xt(x,r){return r0(0,function(e){var t=i0(e);T0(e);var u=p(X0[13],Nl0,e);return[0,r,u,x0([0,t],[0,q0(e)],O)]},x)}function jX(x){return r0(0,function(r){var e=i0(r);J(r,12);var t=L(r);x:{r:if(typeof t=="number"){var u=t+A3|0;if(4>=u>>>0){switch(u){case 0:var i=[0,Xt(r,0)];break;case 3:var i=[0,Xt(r,2)];break;case 4:var i=[0,Xt(r,1)];break;default:break r}var c=i;break x}}var c=0}return[0,c,x0([0,e],[0,q0(r)],O)]},x)}function OX(x,r){var e=x[0]===0?x[1]:x[1]-1|0,t=(r[0]===0,r[1]);return t<=e?1:0}var h4=[],Ih=[],DX=[],FX=[],RX=[],d4=[],LX=[],MX=[],Nj=[],qX=[];function y4(x){var r=_n(x);if(r){var e=L(x);x:{if(typeof e=="number"){if(e===59){if(x[18]){var t=0;break x}}else if(e===66&&x[19]){var t=0;break x}}var t=1}var u=t}else var u=r;var i=L(x);x:{r:if(typeof i=="number"){if(23<=i){if(i===59){if(x[18])return[0,r0(0,function(m){m[10]&&Ux(m,J1);var h=i0(m),T=G0(m);J(m,59);var b=G0(m);if(ol(m))var N=0,C=0;else{var I=$r(m,K2),F=L(m);e:{t:if(typeof F=="number"){if(F!==87){if(10<=F)break t;switch(F){case 0:case 2:case 3:case 4:case 6:break t}}var M=0;break e}var M=1}e:{if(!I&&!M){var Y=0;break e}var Y=[0,Yt(m)]}var N=I,C=Y}var q=C?0:q0(m),K=Vr(T,b);return[38,[0,C,x0([0,h],[0,q],O),N,K]]},x)];break r}if(i!==99)break r}else if(i!==4&&22>i)break r;break x}if(!u)return d(h4[1],x)}x:{if(i===65&&S2(x)&&rr(1,x)===99){var c=h4[2],v=rY;break x}var c=rY,v=h4[2]}var a=lh(x,v);if(a)return a[1];var l=lh(x,c);return l?l[1]:d(h4[1],x)}function Yt(x){return y1(x,y4(x))}function BX(x){var r=x[2];switch(r[0]){case 24:var e=r[1],t=e[1][2][1];if(P(t,K1)){if(!P(t,nv)&&!P(e[2][2][1],Jm))return 0}else if(!P(e[2][2][1],Gl))return 0;break;case 10:case 23:break;default:return 0}return 1}function UX(x){var r=G0(x),e=r0(0,Nh,x),t=e[2],u=e[1],i=L(x);x:{if(typeof i=="number"&&i===85){var v=KN(Ih[3],1,x,t,u);break x}var c=Q0(Ih[1],x,t,u),v=Q0(Ih[2],x,c[2],c[1])}var a=v[2];if(L(x)!==86)return a;T0(x);var l=Yt(n4(0,x));J(x,87);var m=r0([0,r],Yt,x),h=m[2],T=m[1];return[0,[0,T,[8,[0,y1(x,a),l,h,0]]]]}function Nh(x){return p(DX[1],x,0)}function XX(x){var r=L(x);if(typeof r=="number"){if(49<=r){if(ft<=r){if(Qs>r)switch(r+B9|0){case 0:return r30;case 1:return e30;case 6:return t30;case 7:return n30}}else if(r===66&&x[19])return x[10]&&Ux(x,6),u30}else if(46<=r)switch(r+za|0){case 0:return i30;case 1:return f30;default:return c30}}return 0}function YX(x){var r=G0(x),e=i0(x),t=XX(x);if(t){var u=t[1];T0(x);var i=r0([0,r],zX,x),c=i[2],v=i[1];x:r:if(u===6){var a=c[2];switch(a[0]){case 10:pt(x,[0,v,69]);break;case 23:a[1][2][0]===1&&B0(x,[0,v,63]);break;default:break r}break x}return[0,[0,v,[36,[0,u,c,x0([0,e],0,O)]]]]}var l=L(x);x:{if(typeof l=="number"){if(Qs===l){var m=a30;break x}if(J1===l){var m=s30;break x}}var m=0}if(m){var h=m[1];T0(x);var T=r0([0,r],zX,x),b=T[2],N=T[1];1-BX(b)&&B0(x,[0,b[1],36]);var C=b[2];x:if(C[0]===10&&Cv(C[1][2][1])){Ne(x,74);break x}return[0,[0,N,[37,[0,h,b,1,x0([0,e],0,O)]]]]}var I=KX(x);if(d1(x))return I;var F=L(x);x:{if(typeof F=="number"){if(Qs===F){var M=v30;break x}if(J1===F){var M=o30;break x}}var M=0}if(!M)return I;var Y=M[1],q=y1(x,I);1-BX(q)&&B0(x,[0,q[1],36]);var K=q[2];x:if(K[0]===10&&Cv(K[1][2][1])){Ne(x,73);break x}var u0=G0(x);T0(x);var Q=q0(x),e0=Vr(q[1],u0);return[0,[0,e0,[37,[0,Y,q,0,x0(0,[0,Q],O)]]]]}function zX(x){return y1(x,YX(x))}function KX(x){var r=G0(x),e=1-x[17],t=0,u=x[17]===0?x:[0,x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15],x[16],t,x[18],x[19],x[20],x[21],x[22],x[23],x[24],x[25],x[26],x[27],x[28],x[29],x[30],x[31]],i=L(u);x:{r:if(typeof i=="number"){var c=i+uA|0;if(7>=c>>>0){switch(c){case 0:if(!e)break r;var v=[0,WX(u)];break;case 6:var v=[0,r0(0,function(m){var h=i0(m),T=G0(m);if(J(m,51),$r(m,10)){var b=gn(0,[0,T,m30]),N=G0(m);bs(m,h30);var C=gn(0,[0,N,d30]);return[24,[0,b,C,x0([0,h],[0,q0(m)],O)]]}var I=i0(m);J(m,4);var F=xY([0,I],0,Yt(n4(0,m)));return J(m,5),[11,[0,F,x0([0,h],[0,q0(m)],O)]]},u)];break;case 7:var v=[0,JX(u)];break;default:break r}var a=v;break x}}var a=fo(u)?[0,$X(u)]:QX(u)}return qv(0,0,u,r,a)}function Cj(x){return y1(x,KX(x))}function JX(x){switch(x[22]){case 0:var r=0,e=0;break;case 1:var r=0,e=1;break;default:var r=1,e=1}var t=G0(x),u=i0(x);J(x,52);var i=[0,t,[30,[0,x0([0,u],[0,q0(x)],O)]]],c=L(x);if(typeof c=="number"&&11>c)switch(c){case 4:var v=r?i:(B0(x,[0,t,se]),[0,t,[10,gn(0,[0,t,l30])]]);return GX(0,x,t,v);case 6:case 10:var a=e?i:(B0(x,[0,t,y2]),[0,t,[10,gn(0,[0,t,k30])]]);return GX(0,x,t,a)}return e?p2(p30,x):B0(x,[0,t,y2]),i}function qv(x,r,e,t,u){var i=x?x[1]:1,c=r?r[1]:0,v=VX([0,i],[0,c],e,t,u),a=yU(e);x:{if(a){var l=a[1];if(typeof l=="number"&&l===84){var m=1;break x}}var m=0}function h(C){var I=D2(C)[2];return p(I,y1(C,v),function(F,M){return p(Xx(F,nn,92),F,M)})}function T(C,I,F){var M=Ch(I),Y=M[1],q=M[2],K=Vr(t,Y),u0=[0,F,C,[0,Y,q],0];x:{if(!m&&!c){var Q=[6,u0];break x}var Q=[27,[0,u0,K,m]]}var e0=c||m;return qv([0,i],[0,e0],I,t,[0,[0,K,Q]])}if(e[13])return v;var b=L(e);if(typeof b=="number"){var N=b-99|0;if(2>>0){if(N===-95)return T(0,e,h(e))}else if(N!==1&&S2(e))return ph(fh(function(C,I){throw K0(Bt,1)},e),v,function(C){var I=h(C);return T(jj(C),C,I)})}return v}function GX(x,r,e,t){var u=x?x[1]:1;return y1(r,qv([0,u],0,r,e,[0,t]))}function WX(x){return r0(0,function(r){var e=G0(r),t=i0(r);if(J(r,45),r[11]&&L(r)===10){var u=q0(r);T0(r);var i=gn(x0([0,t],[0,u],O),[0,e,y30]),c=L(r);return typeof c!="number"&&c[0]===4&&!P(c[3],Jm)?[24,[0,i,p(X0[13],0,r),0]]:(p2(g30,r),T0(r),[10,i])}var v=G0(r),a=L(r);x:{if(typeof a=="number"){if(a===45){var l=WX(r);break x}if(a===52){var l=JX(tj(1,r));break x}}var l=fo(r)?$X(r):y1(r,QX(r))}var m=tj(1,r),h=y1(m,VX([0,w30[1]],0,m,v,[0,l])),T=L(r);x:{if(typeof T!="number"&&T[0]===3){var b=ZX(r,v,h,T[1]);break x}var b=h}x:{r:if(L(r)!==4){if(S2(r)&&L(r)===99)break r;var N=b;break x}var N=p(D2(r)[2],b,function(M,Y){return p(Xx(M,nn,93),M,Y)})}var C=S2(r)?ph(fh(function(M,Y){throw K0(Bt,1)},r),0,jj):0,I=L(r);x:{if(typeof I=="number"&&I===4){var F=[0,Ch(r)];break x}var F=0}return[25,[0,N,C,F,x0([0,t],0,O)]]},x)}function jj(x){V2(x,1);var r=L(x)===99?[0,r0(0,FX[1],x)]:0;return H2(x),r}function Ch(x){return r0(0,function(r){var e=i0(r);J(r,4);var t=p(RX[1],r,0),u=i0(r);return J(r,5),[0,t,j2([0,e],[0,q0(r)],u,O)]},x)}function VX(x,r,e,t,u){var i=x?x[1]:1,c=r?r[1]:0,v=L(e);if(typeof v=="number")switch(v){case 6:return T0(e),N6(d4[1],[0,i],[0,c],0,e,t,u);case 10:return T0(e),N6(d4[2],[0,i],[0,c],0,e,t,u);case 84:1-i&&Ux(e,60),J(e,84);var a=L(e);if(typeof a=="number")switch(a){case 4:return u;case 6:return T0(e),N6(d4[1],[0,i],b30,_30,e,t,u);case 99:if(S2(e))return u;break}else if(a[0]===3)return Ux(e,61),u;return N6(d4[2],[0,i],E30,T30,e,t,u)}else if(v[0]===3){var l=v[1];return c&&Ux(e,61),qv(S30,0,e,t,[0,ZX(e,t,y1(e,u),l)])}return u}function $X(x){return r0(0,function(r){var e=Ah(r),t=e[1],u=e[2],i=r0(0,function(F){var M=i0(F);J(F,15);var Y=Mv(F),q=Y[1],K=F6([0,u,[0,M,[0,Y[2],0]]]);if(L(F)===4)var u0=0,Q=0;else{var e0=L(F);x:{if(typeof e0=="number"&&e0===99){var a0=0;break x}var f0=ZC(q,xj(t,F)),a0=[0,Ut(f0,p(X0[13],A30,f0))]}var u0=re(F,$e(F)),Q=a0}var Z=Iv(0,F),v0=t||Z[19],t0=ml(v0,q)(Z),y0=L(Z)===87?t0:c4(Z,t0),n0=Tj(Z),s0=n0[2],l0=n0[1];if(s0)var w0=CU(Z,s0),L0=l0;else var w0=s0,L0=vl(Z,l0);return[0,Q,y0,q,w0,L0,u0,K]},r),c=i[2],v=c[3],a=c[2],l=c[1],m=c[7],h=c[6],T=c[5],b=c[4],N=i[1],C=k4(r,t,v,1,Dv(a)),I=C[1];return kl(r,C[2],l,a),[9,[0,l,a,I,t,v,1,b,T,h,x0([0,m],0,O),N]]},x)}function Oj(x,r,e){switch(r){case 1:Ne(x,77);try{var t=t5(pv(Mx(P30,e))),u=t}catch(T){var i=B2(T);if(i[1]!==kn)throw K0(i,0);var u=bx(Mx(I30,e))}break;case 2:Ne(x,76);try{var c=jN(e),u=c}catch(T){var v=B2(T);if(v[1]!==kn)throw K0(v,0);var u=bx(Mx(N30,e))}break;case 4:try{var a=jN(e),u=a}catch(T){var l=B2(T);if(l[1]!==kn)throw K0(l,0);var u=bx(Mx(C30,e))}break;default:try{var m=t5(pv(e)),u=m}catch(T){var h=B2(T);if(h[1]!==kn)throw K0(h,0);var u=bx(Mx(j30,e))}}return J(x,[0,r,e]),u}function Dj(x,r,e){var t=Cx(e);x:{if(t!==0&&w1===q2(e,t-1|0)){var u=E1(e,0,t-1|0);break x}var u=e}var i=iq(u);return J(x,[1,r,e]),i}function QX(x){var r=G0(x),e=i0(x),t=L(x);if(typeof t=="number")switch(t){case 0:var u=d(X0[12],x);return[1,[0,u[1],[26,u[2]]],u[3]];case 4:var i=i0(x),c=r0(0,function(W){J(W,4);var g0=G0(W),B=Yt(W),h0=L(W);x:{if(typeof h0=="number"){if(h0===9){var _0=[0,Fj(W,g0,[0,B,0])];break x}if(h0===87){var _0=[1,[0,B,Lv(W),0]];break x}}var _0=[0,B]}return J(W,5),_0},x),v=c[2],a=c[1],l=q0(x),m=v[0]===0?v[1]:[0,a,[34,v[1]]];return[0,xY([0,i],[0,l],m)];case 6:var h=r0(0,bT0,x),T=h[2];return[1,[0,h[1],[0,T[1]]],T[2]];case 21:if(x[28][3]&&!jv(1,x)&&rr(1,x)===4){var b=i0(x),N=G0(x),C=p(X0[13],0,x),I=C[1],F=Ch(x);if(!d1(x)&&L(x)===0){var M=RU(x,F),Y=function(W){var g0=i0(W),B=d(X0[27],W),h0=$r(W,16)?[0,d(X0[7],W)]:0;J(W,87);var _0=Yt(W),d0=L(W);x:{r:if(typeof d0=="number"){if(d0!==1&&kr!==d0)break r;break x}J(W,9)}return[0,B,_0,h0,x0([0,g0],[0,q0(W)],O)]};return[0,r0([0,N],function(W){J(W,0);for(var g0=0;;){var B=L(W);x:if(typeof B=="number"){if(B!==1&&kr!==B)break x;var h0=tx(g0);return J(W,1),[22,[0,M,h0,N,I,x0([0,b],[0,q0(W)],O)]]}var g0=[0,r0(0,Y,W),g0]}},x)]}var q=Vr(N,F[1]);return qv(D30,O30,x,N,[0,[0,q,[6,[0,[0,I,[10,C]],0,F,x0([0,b],0,O)]]]])}break;case 22:return T0(x),[0,[0,r,[33,[0,x0([0,e],[0,q0(x)],O)]]]];case 30:return T0(x),[0,[0,r,[16,x0([0,e],[0,q0(x)],O)]]];case 41:return[0,d(X0[22],x)];case 99:var K=d(X0[17],x),u0=K[2],Q=K[1],e0=un<=u0[1]?[13,u0[2]]:[12,u0[2]];return[0,[0,Q,e0]];case 31:case 32:return T0(x),[0,[0,r,[15,[0,t===32?1:0,x0([0,e],[0,q0(x)],O)]]]];case 75:case 106:V2(x,5);var f0=G0(x),a0=i0(x),Z=L(x);x:{if(typeof Z!="number"&&Z[0]===5){var v0=Z[3],t0=Z[2];T0(x);var y0=q0(x),n0=y0,s0=v0,l0=t0,w0=Mx(L30,Mx(t0,Mx(R30,v0)));break x}p2(M30,x);var n0=0,s0=q30,l0=B30,w0=U30}H2(x);var L0=Wr(Cx(s0));Sb0(function(W){var g0=W+q9|0;if(21>=g0>>>0)switch(g0){case 0:case 3:case 5:case 9:case 15:case 17:case 18:case 21:return at(L0,W)}},s0);var I0=G2(L0);return P(I0,s0)&&Ux(x,[19,s0]),[0,[0,f0,[19,[0,l0,I0,w0,x0([0,a0],[0,n0],O)]]]]}else switch(t[0]){case 0:var j0=t[2],S0=Oj(x,t[1],j0);return[0,[0,r,[17,[0,S0,j0,x0([0,e],[0,q0(x)],O)]]]];case 1:var W0=t[2],A0=Dj(x,t[1],W0);return[0,[0,r,[18,[0,A0,W0,x0([0,e],[0,q0(x)],O)]]]];case 2:var J0=t[1],b0=J0[3],z=J0[2],C0=J0[1];J0[4]&&Ne(x,77),T0(x);var V0=x0([0,e],[0,q0(x)],O),N0=x[28],rx=N0[7],xx=N0[8];x:{if(rx){var nx=rx[1];if(eq(nx,z)){var F0=[20,[0,z,C0,0,Cx(nx),0,b0,V0]];break x}}if(xx){var mx=xx[1];if(eq(mx,z)){var F0=[20,[0,z,C0,0,Cx(mx),1,b0,V0]];break x}}var F0=[14,[0,z,b0,V0]]}return[0,[0,C0,F0]];case 3:var px=HX(x,t[1]);return[0,[0,px[1],[32,px[2]]]];case 4:if(!P(t[3],pA)&&rr(1,x)===41)return[0,d(X0[22],x)];break}if(_n(x)){var dx=p(X0[13],0,x);return[0,[0,dx[1],[10,dx]]]}p2(0,x);x:if(typeof t!="number"&&t[0]===7){T0(x);break x}return[0,[0,r,[16,x0([0,e],F30,O)]]]}function HX(x,r){var e=r[5],t=r[1],u=r[3],i=r[2],c=i0(x);J(x,[3,r]);var v=[0,t,[0,[0,u,i],e]];if(e)var l=0,m=[0,v,0],h=t;else var a=Q0(LX[1],x,[0,v,0],0),l=a[3],m=a[2],h=a[1];var T=q0(x),b=Vr(t,h);return[0,b,[0,m,l,x0([0,c],[0,T],O)]]}function ZX(x,r,e,t){var u=p(D2(x)[2],e,function(c,v){return p(Xx(c,nn,3),c,v)}),i=HX(x,t);return[0,Vr(r,i[1]),[31,[0,u,i,0]]]}function xY(x,r,e){var t=x?x[1]:0,u=r?r[1]:0,i=e[2];function c(cx){return A1(cx,x0([0,t],[0,u],O))}function v(cx){return j5(cx,x0([0,t],[0,u],O))}var a=e[1];switch(i[0]){case 0:var l=i[1],m=v(l[2]),U0=[0,[0,l[1],m]];break;case 1:var h=i[1],T=h[11],b=c(h[10]),U0=[1,[0,h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],b,T]];break;case 2:var N=i[1],C=c(N[2]),U0=[2,[0,N[1],C]];break;case 3:var I=i[1],F=c(I[3]),U0=[3,[0,I[1],I[2],F]];break;case 4:var M=i[1],Y=c(M[4]),U0=[4,[0,M[1],M[2],M[3],Y]];break;case 5:var q=i[1],K=c(q[4]),U0=[5,[0,q[1],q[2],q[3],K]];break;case 6:var u0=i[1],Q=c(u0[4]),U0=[6,[0,u0[1],u0[2],u0[3],Q]];break;case 7:var e0=i[1],f0=c(e0[7]),U0=[7,[0,e0[1],e0[2],e0[3],e0[4],e0[5],e0[6],f0]];break;case 8:var a0=i[1],Z=c(a0[4]),U0=[8,[0,a0[1],a0[2],a0[3],Z]];break;case 9:var v0=i[1],t0=v0[11],y0=c(v0[10]),U0=[9,[0,v0[1],v0[2],v0[3],v0[4],v0[5],v0[6],v0[7],v0[8],v0[9],y0,t0]];break;case 10:var n0=i[1],s0=n0[2],l0=n0[1],w0=c(s0[2]),U0=[10,[0,l0,[0,s0[1],w0]]];break;case 11:var L0=i[1],I0=c(L0[2]),U0=[11,[0,L0[1],I0]];break;case 12:var j0=i[1],S0=c(j0[4]),U0=[12,[0,j0[1],j0[2],j0[3],S0]];break;case 13:var W0=i[1],A0=c(W0[4]),U0=[13,[0,W0[1],W0[2],W0[3],A0]];break;case 14:var J0=i[1],b0=c(J0[3]),U0=[14,[0,J0[1],J0[2],b0]];break;case 15:var z=i[1],C0=c(z[2]),U0=[15,[0,z[1],C0]];break;case 16:var U0=[16,c(i[1])];break;case 17:var V0=i[1],N0=c(V0[3]),U0=[17,[0,V0[1],V0[2],N0]];break;case 18:var rx=i[1],xx=c(rx[3]),U0=[18,[0,rx[1],rx[2],xx]];break;case 19:var nx=i[1],mx=c(nx[4]),U0=[19,[0,nx[1],nx[2],nx[3],mx]];break;case 20:var F0=i[1],px=c(F0[7]),U0=[20,[0,F0[1],F0[2],F0[3],F0[4],F0[5],F0[6],px]];break;case 21:var dx=i[1],W=c(dx[4]),U0=[21,[0,dx[1],dx[2],dx[3],W]];break;case 22:var g0=i[1],B=c(g0[5]),U0=[22,[0,g0[1],g0[2],g0[3],g0[4],B]];break;case 23:var h0=i[1],_0=c(h0[3]),U0=[23,[0,h0[1],h0[2],_0]];break;case 24:var d0=i[1],E0=c(d0[3]),U0=[24,[0,d0[1],d0[2],E0]];break;case 25:var U=i[1],Kx=c(U[4]),U0=[25,[0,U[1],U[2],U[3],Kx]];break;case 26:var Ix=i[1],z0=v(Ix[2]),U0=[26,[0,Ix[1],z0]];break;case 27:var Kr=i[1],S=Kr[1],G=Kr[3],Z0=Kr[2],yx=c(S[4]),U0=[27,[0,[0,S[1],S[2],S[3],yx],Z0,G]];break;case 28:var Tx=i[1],ex=Tx[1],m0=Tx[3],Dx=Tx[2],Ex=c(ex[3]),U0=[28,[0,[0,ex[1],ex[2],Ex],Dx,m0]];break;case 29:var qx=i[1],O0=c(qx[2]),U0=[29,[0,qx[1],O0]];break;case 30:var U0=[30,[0,c(i[1][1])]];break;case 31:var Wx=i[1],Yx=c(Wx[3]),U0=[31,[0,Wx[1],Wx[2],Yx]];break;case 32:var fx=i[1],Qx=c(fx[3]),U0=[32,[0,fx[1],fx[2],Qx]];break;case 33:var U0=[33,[0,c(i[1][1])]];break;case 34:var vx=i[1],nr=c(vx[3]),U0=[34,[0,vx[1],vx[2],nr]];break;case 35:var gr=i[1],Nr=c(gr[3]),U0=[35,[0,gr[1],gr[2],Nr]];break;case 36:var s2=i[1],b2=c(s2[3]),U0=[36,[0,s2[1],s2[2],b2]];break;case 37:var k2=i[1],F2=c(k2[4]),U0=[37,[0,k2[1],k2[2],k2[3],F2]];break;default:var jx=i[1],_=jx[4],$=jx[3],ix=c(jx[2]),U0=[38,[0,jx[1],ix,$,_]]}return[0,a,U0]}function bT0(x){var r=i0(x);J(x,6);var e=p(MX[1],x,[0,0,mn]),t=e[2],u=e[1],i=i0(x);return J(x,7),[0,[0,u,j2([0,r],[0,q0(x)],i,O)],t]}function rY(x){var r=fh(Nj[1],x),e=G0(r);if(rr(1,r)===11)var u=0,i=0;else var t=Ah(r),u=t[2],i=t[1];var c=i||r[19],v=xj(c,r),a=v[18],l=r0(0,function(s0){var l0=re(s0,$e(s0));if(_n(s0)&&l0===0){var w0=p(X0[13],X30,s0),L0=w0[1],I0=[0,L0,[0,[0,L0,[2,[0,w0,[0,pa(s0)],0]]],0]];return[0,l0,[0,L0,[0,0,[0,I0,0],0,0]],[0,[0,L0[1],L0[3],L0[3]]],0]}var j0=ml(c,a)(s0);wX(s0,j0);var S0=Tj(Nv(1,s0));return[0,l0,j0,S0[1],S0[2]]},v),m=l[2],h=m[2],T=h[2];x:{r:{var b=m[4],N=m[3],C=m[1],I=l[1];if(!T[1]){var F=T[2];if(!T[3]&&F)break r;var M=gU(v);break x}}var M=v}var Y=h[2],q=Y[1];if(q){var K=h[1];B0(M,[0,q[1][1],87]);var u0=[0,K,[0,0,Y[2],Y[3],Y[4]]]}else var u0=h;var Q=Dv(u0),e0=d1(M),f0=e0&&(L(M)===11?1:0);f0&&Ux(M,56),J(M,11);var a0=wU(gU(M),i,0,Q),Z=r0(0,Nj[2],a0),v0=Z[2],t0=v0[1],y0=Z[1];kl(a0,v0[2],0,u0);var n0=Vr(e,y0);return[0,[0,n0,[1,[0,0,u0,t0,i,0,1,b,N,C,x0([0,u],0,O),I]]]]}function Fj(x,r,e){return r0([0,r],d(qX[1],e),x)}function eY(x){var r=G0(x),e=UX(x),t=L(x);x:{if(typeof t=="number"){var u=t-68|0;if(15>=u>>>0){switch(u){case 0:var i=qv0;break;case 1:var i=Bv0;break;case 2:var i=Uv0;break;case 3:var i=Xv0;break;case 4:var i=Yv0;break;case 5:var i=zv0;break;case 6:var i=Kv0;break;case 7:var i=Jv0;break;case 8:var i=Gv0;break;case 9:var i=Wv0;break;case 10:var i=Vv0;break;case 11:var i=$v0;break;case 12:var i=Qv0;break;case 13:var i=Hv0;break;case 14:var i=Zv0;break;default:var i=x30}var c=i;break x}}var c=0}if(c!==0&&T0(x),!c)return e;var v=c[1];return[0,r0([0,r],function(a){var l=Pj(0,a,e);return[4,[0,v,l,Yt(a),0]]},x)]}function TT0(x,r){if(typeof r=="number"&&r===81)return 0;throw K0(Bt,1)}Rr(h4,[0,eY,function(x){var r=fh(TT0,x),e=eY(r),t=L(r);if(typeof t=="number"){if(t===11)throw K0(Bt,1);if(t===87){var u=yU(r);x:{if(u){var i=u[1];if(typeof i=="number"&&i===5){var c=1;break x}}var c=0}if(c)throw K0(Bt,1)}}if(!_n(r))return e;if(e[0]===0){var v=e[1][2];if(v[0]===10&&!P(v[1][2][1],Ya)&&!d1(r))throw K0(Bt,1)}return e}]);function Rj(x,r,e,t,u){var i=y1(x,r);return[0,[0,u,[21,[0,t,i,y1(x,e),0]]]]}function Lj(x,r,e){for(var t=r,u=e;;){var i=L(x);if(typeof i=="number"&&i===89){T0(x);var c=r0(0,Nh,x),v=c[2],a=Vr(u,c[1]),l=Mj(0,x,Rj(x,t,v,1,a),a),t=l[2],u=l[1];continue}return[0,u,t]}}function tY(x,r,e){for(var t=r,u=e;;){var i=L(x);if(typeof i=="number"&&i===88){T0(x);var c=r0(0,Nh,x),v=Lj(x,c[2],c[1]),a=v[2],l=Vr(u,v[1]),m=Mj(0,x,Rj(x,t,a,0,l),l),t=m[2],u=m[1];continue}return[0,u,t]}}function Mj(x,r,e,t){for(var u=x,i=e,c=t;;){var v=L(r);if(typeof v=="number"&&v===85){1-u&&Ux(r,ml0),J(r,85);var a=r0(0,Nh,r),l=a[2],m=a[1],h=L(r);x:{if(typeof h=="number"&&1>=h+fD>>>0){Ux(r,[22,KC(h)]);var T=Lj(r,l,m),b=tY(r,T[2],T[1]),N=b[2],C=b[1];break x}var N=l,C=m}var I=Vr(c,C),u=1,i=Rj(r,i,N,2,I),c=I;continue}return[0,c,i]}}Rr(Ih,[0,Lj,tY,Mj]);function qj(x,r,e,t){return[0,t,[5,[0,e,x,r,0]]]}Rr(DX,[0,function(x,r){for(var e=r;;){var t=r0(0,function(b0){var z=XX(b0)!==0?1:0;return[0,z,YX(n4(0,b0))]},x),u=t[2],i=u[2],c=u[1],v=t[1];x:if(L(x)===99&&i[0]===0&&i[1][2][0]===12){Ux(x,2);break x}let J0=v;var a=function(b0,z){for(var C0=b0,V0=z;;){var N0=L(x);x:if(typeof N0!="number"&&N0[0]===4){var rx=N0[3];if(P(rx,It)&&P(rx,xL))break x;if(S2(x)){T0(x);var xx=y1(x,V0);r:{if(C0){var nx=C0[1],mx=nx[2],F0=C0[2],px=nx[3],dx=mx[1],W=nx[1];if(OX(mx[2],G30)){var g0=qj(W,xx,dx,Vr(px,J0)),B=F0;break r}}var g0=xx,B=C0}var h0=g0[1];if(_r(rx,xL))var _0=ma(x),d0=_0[1],Ix=[0,[0,Vr(h0,d0),[35,[0,g0,[0,d0,_0],0]]]];else if(L(x)===28){var E0=Vr(h0,G0(x));T0(x);var Ix=[0,[0,E0,[2,[0,g0,0]]]]}else var U=ma(x),Kx=U[1],Ix=[0,[0,Vr(h0,Kx),[3,[0,g0,[0,Kx,U],0]]]];var C0=B,V0=Ix;continue}}return[0,C0,V0]}}(e,i),l=a[2],m=a[1],h=L(x);x:{r:if(typeof h=="number"){var T=h-17|0;if(1>>0){if(73>T)break r;switch(T-73|0){case 0:var b=W30;break;case 1:var b=V30;break;case 2:var b=$30;break;case 3:var b=Q30;break;case 4:var b=H30;break;case 5:var b=Z30;break;case 6:var b=xl0;break;case 7:var b=rl0;break;case 8:var b=el0;break;case 9:var b=tl0;break;case 10:var b=nl0;break;case 11:var b=ul0;break;case 12:var b=il0;break;case 13:var b=fl0;break;case 14:var b=cl0;break;case 15:var b=sl0;break;case 16:var b=al0;break;case 17:var b=ol0;break;case 18:var b=vl0;break;case 19:var b=ll0;break;default:break r}var N=b}else var N=T?pl0:x[12]?0:kl0;var C=N;break x}var C=0}if(C!==0&&T0(x),!m&&!C)return l;if(C){var I=C[1],F=I[1],M=I[2],Y=c&&(F===14?1:0);Y&&B0(x,[0,v,37]);x:for(var q=y1(x,l),K=[0,F,M],u0=v,Q=m;;){var e0=K[2],f0=K[1];if(!Q)break x;var a0=Q[1],Z=a0[2],v0=Q[2],t0=a0[3],y0=Z[1],n0=a0[1];if(!OX(Z[2],e0))break;var s0=Vr(t0,u0),q=qj(n0,q,y0,s0),K=[0,f0,e0],u0=s0,Q=v0}var e=[0,[0,q,[0,f0,e0],u0],Q]}else for(var l0=y1(x,l),w0=v,L0=m;;){if(!L0)return[0,l0];var I0=L0[1],j0=L0[2],S0=I0[2][1],W0=I0[1],A0=Vr(I0[3],w0),l0=qj(W0,l0,S0,A0),w0=A0,L0=j0}}}]),Rr(FX,[0,function(x){var r=i0(x);J(x,99);for(var e=0;;){var t=L(x);x:if(typeof t=="number"){if(y2!==t&&kr!==t)break x;var u=tx(e),i=i0(x);J(x,y2);var c=L(x)===4?D2(x)[1]:q0(x);return[0,u,j2([0,r],[0,c],i,O)]}var v=L(x);x:{if(typeof v!="number"&&v[0]===4&&!P(v[2],Xo)){var a=G0(x),l=i0(x);bs(x,J30);var m=[1,[0,a,[0,x0([0,l],[0,q0(x)],O)]]];break x}var m=[0,ma(x)]}var h=[0,m,e];y2!==L(x)&&J(x,9);var e=h}}]);function ET0(x){var r=i0(x);J(x,12);var e=Yt(x);return[0,e,x0([0,r],0,O)]}Rr(RX,[0,function(x,r){for(var e=r;;){var t=L(x);x:if(typeof t=="number"){if(t!==5&&kr!==t)break x;return tx(e)}var u=L(x);x:{if(typeof u=="number"&&u===12){var i=[1,r0(0,ET0,x)];break x}var i=[0,Yt(x)]}var c=[0,i,e];L(x)!==5&&J(x,9);var e=c}}]),Rr(d4,[0,function(x,r,e,t,u,i){var c=x?x[1]:1,v=r?r[1]:0,a=e?e[1]:0,l=tj(0,t),m=d(X0[7],l),h=G0(t);J(t,7);var T=q0(t),b=Vr(u,h),N=x0(0,[0,T],O),C=[0,y1(t,i),[2,m],N],I=v?[28,[0,C,b,a]]:[23,C];return qv([0,c],[0,v],t,u,[0,[0,b,I]])},function(x,r,e,t,u,i){var c=x?x[1]:1,v=r?r[1]:0,a=e?e[1]:0,l=L(t);x:{if(typeof l=="number"&&l===14){var m=FU(t),h=m[1],T=t[30][1],b=m[2][1];if(T){var N=T[1];t[30][1]=[0,[0,N[1],[0,[0,b,h],N[2]]],T[2]]}else B0(t,[0,h,64]);var I=[1,m],F=h;break x}var C=a1(t),I=[0,C],F=C[1]}var M=Vr(u,F);x:if(i[0]===0&&i[1][2][0]===30&&I[0]===1){B0(t,[0,M,83]);break x}var Y=[0,y1(t,i),I,0],q=v?[28,[0,Y,M,a]]:[23,Y];return qv([0,c],[0,v],t,u,[0,[0,M,q]])}]),Rr(LX,[0,function(x,r,e){for(var t=r,u=e;;){var i=d(X0[7],x),c=[0,i,u],v=L(x);if(typeof v=="number"&&v===1){V2(x,4);var a=L(x);if(typeof a!="number"&&a[0]===3){var l=a[1],m=l[5],h=l[1],T=l[3],b=l[2];T0(x),H2(x);var N=[0,[0,h,[0,[0,T,b],m]],t];if(m){var C=tx(c);return[0,h,tx(N),C]}var t=N,u=c;continue}throw K0([0,Ir,Y30],1)}p2(z30,x);var I=[0,i[1],K30],F=tx(c),M=tx([0,I,t]);return[0,i[1],M,F]}}]),Rr(MX,[0,function(x,r){for(var e=r;;){var t=e[2],u=e[1],i=L(x);x:if(typeof i=="number"){if(13<=i){if(kr!==i)break x}else{if(7>i)break x;switch(i-7|0){case 0:break;case 2:var c=G0(x);T0(x);var e=[0,[0,[2,c],u],t];continue;case 5:var v=i0(x),a=r0(0,function(u0){T0(u0);var Q=y4(u0);return Q[0]===0?[0,Q[1],mn]:[0,Q[1],Q[2]]},x),l=a[2],m=l[2],h=a[1],T=l[1],b=[1,[0,h,[0,T,x0([0,v],0,O)]]],N=L(x)===7?1:0;r:{if(!N&&rr(1,x)===7){var C=[0,m[1],[0,[0,h,16],m[2]]];break r}var C=m}1-N&&J(x,9);var e=[0,[0,b,u],Ij(C,t)];continue;default:break x}}var I=IX(t);return[0,tx(u),I]}var F=y4(x);if(F[0]===0)var M=mn,Y=F[1];else var M=F[2],Y=F[1];L(x)!==7&&J(x,9);var e=[0,[0,[0,Y],u],Ij(M,t)]}}]),Rr(Nj,[0,function(x){return function(r){x:if(typeof r=="number"){if(62<=r){var e=r-63|0;if(49>=e>>>0){var t=e-15|0;if(9>>0)break x;switch(t){case 0:case 1:case 3:case 9:break;default:break x}}}else if(7<=r){if(r!==56)break x}else if(5>r)break x;return 0}throw K0(Bt,1)}},function(x){var r=L(x);if(typeof r=="number"&&!r){var e=p(X0[16],1,x);return[0,[0,e[1]],e[2]]}return[0,[1,d(X0[10],x)],0]}]),Rr(qX,[0,function(x,r){for(var e=x;;){var t=L(r);if(typeof t=="number"&&t===9){T0(r);var e=[0,Yt(r),e];continue}return[29,[0,tx(e),0]]}}]);function ST0(x){var r=i0(x);T0(x);var e=x0([0,r],0,O),t=Cj(x),u=d1(x)?f4(x):kh(x);return[0,p(u[2],t,function(i,c){return p(Xx(i,nn,94),i,c)}),e]}function Bj(x){if(!x[28][4])return 0;for(var r=0;;){var e=L(x);if(typeof e=="number"&&e===13){var r=[0,r0(0,ST0,x),r];continue}return tx(r)}}function oo(x,r){var e=x?x[1]:0,t=i0(r),u=L(r);if(typeof u=="number")switch(u){case 6:var i=r0(0,function(s0){var l0=i0(s0);J(s0,6);var w0=n4(0,s0),L0=d(X0[10],w0);return J(s0,7),[0,L0,x0([0,l0],[0,q0(s0)],O)]},r),c=i[1];return[0,c,[5,[0,c,i[2]]]];case 14:if(!e){var v=r0(0,function(s0){return T0(s0),[3,a1(s0)]},r),a=v[1],l=v[2];return B0(r,[0,a,64]),[0,a,l]}var m=FU(r),h=r[30][1],T=m[2][1],b=m[1];if(h){var N=h[1],C=h[2],I=N[2],F=[0,[0,N1[4].call(null,T,N[1]),I],C];r[30][1]=F}else bx(is0);return[0,b,[4,m]]}else switch(u[0]){case 0:var M=u[2],Y=u[1],q=G0(r),K=Oj(r,Y,M);return[0,q,[1,[0,q,[0,K,M,x0([0,t],[0,q0(r)],O)]]]];case 1:var u0=u[2],Q=u[1],e0=G0(r),f0=Dj(r,Q,u0);return[0,e0,[2,[0,e0,[0,f0,u0,x0([0,t],[0,q0(r)],O)]]]];case 2:var a0=u[1],Z=a0[4],v0=a0[3],t0=a0[2],y0=a0[1];return Z&&Ne(r,77),J(r,[2,[0,y0,t0,v0,Z]]),[0,y0,[0,[0,y0,[0,t0,v0,x0([0,t],[0,q0(r)],O)]]]]}var n0=a1(r);return[0,n0[1],[3,n0]]}function jh(x,r,e){var t=0,u=Mv(x),i=u[1],c=u[2],v=oo([0,r],x),a=v[1],l=Tn(x,v[2]);return[0,l,r0(0,function(m){var h=Iv(1,m),T=r0(0,function(q){var K=ml(0,0)(q),u0=0,Q=L(q)===87?K:c4(q,K);x:if(e){var e0=Q[2];r:{if(!e0[1]){if(!e0[2]&&!e0[3])break r;B0(q,[0,a,23]);break x}B0(q,[0,a,24])}}else{var f0=Q[2];r:if(f0[1])B0(q,[0,a,67]);else{var a0=f0[2];if(a0&&!a0[2]&&!f0[3])break r;f0[3]?B0(q,[0,a,66]):B0(q,[0,a,66])}}return[0,u0,Q,vl(q,bj(q))]},h),b=T[2],N=b[2],C=b[3],I=b[1],F=T[1],M=k4(h,t,i,0,Dv(N)),Y=M[1];return kl(h,M[2],0,N),[0,0,N,Y,t,i,1,0,C,I,x0([0,c],0,O),F]},x)]}function nY(x){var r=y4(x);return r[0]===0?[0,r[1],mn]:[0,r[1],r[2]]}function uY(x,r){switch(r[0]){case 0:var e=r[1],t=e[1],u=e[2];return B0(x,[0,t,47]),[0,t,[14,u]];case 1:var i=r[1],c=i[1],v=i[2];return B0(x,[0,c,47]),[0,c,[17,v]];case 2:var a=r[1],l=a[1],m=a[2];return B0(x,[0,l,47]),[0,l,[18,m]];case 3:var h=r[1],T=h[2][1],b=h[1];return ch(T)?B0(x,[0,b,96]):sl(T)&&pt(x,[0,b,81]),[0,b,[10,h]];case 4:return bx(Kl0);default:var N=r[1][2][1];return B0(x,[0,N[1],7]),N}}function iY(x,r,e){function t(i){var c=Iv(1,i),v=r0(0,function(C){var I=re(C,$e(C)),F=ml(x,r)(C),M=L(C)===87?F:c4(C,F);return[0,I,M,vl(C,bj(C))]},c),a=v[2],l=a[2],m=a[3],h=a[1],T=v[1],b=k4(c,x,r,0,Dv(l)),N=b[1];return kl(c,b[2],0,l),[0,0,l,N,x,r,1,0,m,h,x0([0,e],0,O),T]}var u=0;return function(i){return r0(u,t,i)}}function fY(x){return J(x,87),nY(x)}function Uj(x,r,e,t,u,i){var c=r0([0,r],function(a){if(!t&&!u){var l=L(a);x:if(typeof l=="number"){if(87<=l){if(l!==99){if(88<=l)break x;var m=fY(a);return[0,[0,e,m[1],0],m[2]]}}else{if(l===83){if(e[0]===3)var h=e[1],T=G0(a),b=r0([0,h[1]],function(F){var M=i0(F);J(F,83);var Y=q0(F),q=p(X0[19],F,[0,h[1],[10,h]]),K=d(X0[10],F);return[4,[0,0,q,K,x0([0,M],[0,Y],O)]]},a),N=[0,b,[0,[0,[0,T,[26,D5(zl0)]],0],0]];else var N=fY(a);return[0,[0,e,N[1],1],N[2]]}if(10<=l)break x;switch(l){case 4:break;case 1:case 9:return[0,[0,e,uY(a,e),1],mn];default:break x}}var C=Tn(a,e);return[0,[1,C,iY(t,u,i)(a)],mn]}return[0,[0,e,uY(a,e),1],mn]}var I=Tn(a,e);return[0,[1,I,iY(t,u,i)(a)],mn]},x),v=c[2];return[0,[0,[0,c[1],v[1]]],v[2]]}function AT0(x){if(L(x)===12){var r=i0(x),e=r0(0,function(l0){return J(l0,12),nY(l0)},x),t=e[2],u=t[2],i=t[1],c=e[1];return[0,[1,[0,c,[0,i,x0([0,r],0,O)]]],u]}var v=G0(x),a=rr(1,x);x:{r:if(typeof a=="number"){if(87<=a){if(a!==99&&88<=a)break r}else if(a!==83){if(10<=a)break r;switch(a){case 1:case 4:case 9:break;default:break r}}var m=0,h=0;break x}var l=Ah(x),m=l[2],h=l[1]}var T=Mv(x),b=T[1],N=Lx(m,T[2]),C=L(x);if(!h&&!b&&typeof C!="number"&&C[0]===4){var I=C[3];if(!P(I,zo)){var F=i0(x),M=oo(0,x)[2],Y=L(x);x:if(typeof Y=="number"){if(87<=Y){if(Y!==99&&88<=Y)break x}else if(Y!==83){if(10<=Y)break x;switch(Y){case 1:case 4:case 9:break;default:break x}}return Uj(x,v,M,0,0,0)}Tn(x,M);var q=r0([0,v],function(l0){return jh(l0,0,1)},x),K=q[2],u0=K[2],Q=K[1],e0=q[1];return[0,[0,[0,e0,[2,Q,u0,x0([0,F],0,O)]]],mn]}if(!P(I,S3)){var f0=i0(x),a0=oo(0,x)[2],Z=L(x);x:if(typeof Z=="number"){if(87<=Z){if(Z!==99&&88<=Z)break x}else if(Z!==83){if(10<=Z)break x;switch(Z){case 1:case 4:case 9:break;default:break x}}return Uj(x,v,a0,0,0,0)}Tn(x,a0);var v0=r0([0,v],function(l0){return jh(l0,0,0)},x),t0=v0[2],y0=t0[2],n0=t0[1],s0=v0[1];return[0,[0,[0,s0,[3,n0,y0,x0([0,f0],0,O)]]],mn]}}return Uj(x,v,oo(0,x)[2],h,b,N)}function Oh(x,r,e,t){var u=e[2][1],i=e[1];if(_r(u,Mo))return B0(x,[0,i,[15,u,0,qL===t?1:0,1]]),r;x:{r:{e:{for(var c=r;;){if(typeof c=="number")break r;if(c[0]===0)break e;var v=ux(u,c[2]),a=c[5],l=c[4],m=c[3];if(v===0)break;var h=0<=v?a:l,c=h}var b=[0,m];break x}var T=c[2];if(ux(u,c[1])===0){var b=[0,T];break x}var b=0;break x}var b=0}if(!b)return yh(u,t,r);var N=b[1];x:{r:if(typeof t=="number"){if(jA===t){if(typeof N!="number"||JI!==N)break r}else if(JI!==t||typeof N!="number"||jA!==N)break r;break x}B0(x,[0,i,[1,u]])}return yh(u,bR,r)}function cY(x,r){return r0(0,function(e){var t=r?i0(e):0;J(e,53);for(var u=0;;){var i=[0,r0(0,function(a){var l=Ts(a),m=L(a)===99?p(D2(a)[2],l,function(h,T){return p(Xx(h,O3,95),h,T)}):l;return[0,m,yX(a)]},e),u],c=L(e);if(typeof c=="number"&&c===9){J(e,9);var u=i;continue}var v=tx(i);return[0,v,x0([0,t],0,O)]}},x)}function Xj(x){switch(x[0]){case 0:case 3:var r=x[1];return[0,[0,r[1],r[2][1]]];default:return 0}}function Yj(x,r){if(r)return B0(x,[0,r[1][1],Hs])}function zj(x,r){if(r)return B0(x,[0,r[1],12])}function sY(x,r,e,t,u,i,c,v){var a=r0([0,r],function(C){var I=_j(C),F=L(C);x:if(i){if(typeof F=="number"&&F===83){Ux(C,13),T0(C);var M=0;break x}var M=0}else{if(typeof F=="number"&&F===83){T0(C);var Y=Iv(1,C),M=[0,d(X0[7],Y)];break x}var M=1}var q=L(C);x:{if(typeof q=="number"&&9>q)switch(q){case 8:T0(C);var K=L(C);r:{e:if(typeof K=="number"){if(K!==1&&kr!==K)break e;var u0=q0(C);break r}var u0=d1(C)?co(C):0}var v0=[0,t,I,M,u0];break x;case 4:case 6:p2(0,C);var v0=[0,t,I,M,0];break x}var Q=L(C);r:{e:if(typeof Q=="number"){if(Q!==1&&kr!==Q)break e;var e0=[0,,function(l0,w0){return l0}];break r}var e0=d1(C)?f4(C):kh(C)}if(typeof M=="number")if(I[0]===0)var f0=M,a0=I,Z=p(e0[2],t,function(s0,l0){return p(Xx(s0,nL,98),s0,l0)});else var f0=M,a0=[1,p(e0[2],I[1],function(s0,l0){return p(Xx(s0,mA,99),s0,l0)})],Z=t;else var f0=[0,p(e0[2],M[1],function(s0,l0){return p(Xx(s0,nn,y2),s0,l0)})],a0=I,Z=t;var v0=[0,Z,a0,f0,0]}var t0=v0[3],y0=v0[2],n0=v0[1];return[0,n0,y0,t0,x0([0,v],[0,v0[4]],O)]},x),l=a[2],m=l[4],h=l[3],T=l[2],b=l[1],N=a[1];return b[0]===4?[2,[0,N,[0,b[1],h,T,u,c,e,m]]]:[1,[0,N,[0,b,h,T,u,c,e,m]]]}function Kj(x,r,e,t,u,i,c,v,a,l){for(;;){var m=L(x);x:if(typeof m=="number"){var h=m-1|0;if(7>>0){var T=h-82|0;if(4>>0)break x;switch(T){case 3:p2(0,x),T0(x);continue;case 0:case 4:break;default:break x}}else if(5>=h-1>>>0)break x;if(!u&&!i)return sY(x,r,e,t,c,v,a,l)}var b=L(x);x:{if(typeof b=="number"&&(b===4||b===99)){var N=0;break x}var N=ol(x)?1:0}if(N)return sY(x,r,e,t,c,v,a,l);zj(x,v),Yj(x,a);var C=Xj(t);x:{if(c){if(C){var I=C[1],F=I[1];if(!P(I[2],Xa)){B0(x,[0,F,[15,Ll0,c,1,0]]);var q=Iv(1,x),K=1;break x}}}else if(C){var M=C[1],Y=M[1];if(!P(M[2],Mo)){u&&B0(x,[0,Y,9]),i&&B0(x,[0,Y,10]);var q=Iv(2,x),K=0;break x}}var q=Iv(1,x),K=1}var u0=Tn(q,t),Q=r0(0,function(f0){var a0=r0(0,function(w0){var L0=re(w0,$e(w0)),I0=ml(u,i)(w0),j0=L(w0)===87?I0:c4(w0,I0),S0=j0[2],W0=S0[1];x:{if(W0){var A0=W0[1][1],J0=j0[1];if(K===0){B0(w0,[0,A0,88]);var b0=[0,J0,[0,0,S0[2],S0[3],S0[4]]];break x}}var b0=j0}return[0,L0,b0,vl(w0,bj(w0))]},f0),Z=a0[2],v0=Z[2],t0=Z[3],y0=Z[1],n0=a0[1],s0=k4(f0,u,i,0,Dv(v0)),l0=s0[1];return kl(f0,s0[2],0,v0),[0,0,v0,l0,u,i,1,0,t0,y0,0,n0]},q),e0=[0,K,u0,Q,c,e,x0([0,l],0,O)];return[0,[0,Vr(r,Q[1]),e0]]}}function Jj(x,r){var e=rr(x,r);x:if(typeof e=="number"){if(87<=e){if(e!==99&&88<=e)break x}else if(e!==83){if(9<=e)break x;switch(e){case 1:case 4:case 8:break;default:break x}}return 1}return 0}var PT0=0;function IT0(x,r,e,t){var u=G0(x),i=L(x);x:{if(typeof i=="number")switch(i){case 104:var c=i0(x);T0(x);var l=[0,[0,u,[0,0,x0([0,c],0,O)]]];break x;case 105:var v=i0(x);T0(x);var l=[0,[0,u,[0,1,x0([0,v],0,O)]]];break x}else if(i[0]===4&&!P(i[3],ev)&&r){var a=i0(x);T0(x);var l=[0,[0,u,[0,2,x0([0,a],0,O)]]];break x}var l=0}x:if(l){var m=l[1][1];if(!e&&!t)break x;return B0(x,[0,m,Hs]),0}return l}var NT0=0;function aY(x){return Jj(NT0,x)}function CT0(x){var r=G0(x),e=Bj(x),t=L(x);x:{if(typeof t=="number"&&t===61&&!Jj(1,x)){var u=[0,G0(x)],i=i0(x);T0(x);var c=i,v=u;break x}var c=0,v=0}var a=L(x);x:if(typeof a=="number"&&2>=a+fR>>>0&&ka(1,x)){r:{if(typeof a=="number"){var l=a+fR|0;if(2>=l>>>0){switch(l){case 0:var m=YO;break;case 1:var m=l6;break;default:var m=Jl}var h=m;break r}}var h=bx(Ml0)}Ux(x,[24,h]),T0(x);break x}var T=L(x)===43?1:0;if(T){var b=rr(1,x);x:{r:if(typeof b=="number"){if(88<=b){if(b!==99&&kr!==b)break r}else{var N=b-9|0;if(77>>0){if(78>N)switch(N+9|0){case 1:case 4:case 8:break;default:break r}}else if(N!==74)break r}var C=0;break x}var C=1}var I=C}else var I=T;if(I){var F=i0(x);T0(x);var M=F}else var M=0;var Y=L(x)===65?1:0;if(Y)var q=1-Jj(1,x),K=q&&1-jv(1,x);else var K=Y;if(K){var u0=i0(x);T0(x);var Q=u0}else var Q=0;var e0=Mv(x),f0=e0[1],a0=e0[2],Z=ka(1,x),v0=Z||(rr(1,x)===6?1:0),t0=IT0(x,v0,K,f0);x:{if(!f0&&t0){var y0=Mv(x),n0=y0[2],s0=y0[1];break x}var n0=a0,s0=f0}var l0=F6([0,c,[0,M,[0,Q,[0,n0,0]]]]),w0=L(x);if(!K&&!s0&&typeof w0!="number"&&w0[0]===4){var L0=w0[3];if(!P(L0,zo)){var I0=i0(x),j0=oo(Bl0,x)[2];if(aY(x))return Kj(x,r,e,j0,K,s0,I,v,t0,l0);zj(x,v),Yj(x,t0),Tn(x,j0);var S0=Lx(l0,I0),W0=r0([0,r],function(Kx){return jh(Kx,1,1)},x),A0=W0[2],J0=A0[1],b0=A0[2],z=W0[1],C0=Xj(J0);x:if(I){if(C0){var V0=C0[1],N0=V0[1];if(!P(V0[2],Xa)){B0(x,[0,N0,[15,Yl0,I,0,0]]);break x}}}else if(C0){var rx=C0[1],xx=rx[1];if(!P(rx[2],Mo)){B0(x,[0,xx,8]);break x}}return[0,[0,z,[0,2,J0,b0,I,e,x0([0,S0],0,O)]]]}if(!P(L0,S3)){var nx=i0(x),mx=oo(ql0,x)[2];if(aY(x))return Kj(x,r,e,mx,K,s0,I,v,t0,l0);zj(x,v),Yj(x,t0),Tn(x,mx);var F0=Lx(l0,nx),px=r0([0,r],function(Kx){return jh(Kx,1,0)},x),dx=px[2],W=dx[1],g0=dx[2],B=px[1],h0=Xj(W);x:if(I){if(h0){var _0=h0[1],d0=_0[1];if(!P(_0[2],Xa)){B0(x,[0,d0,[15,Xl0,I,0,0]]);break x}}}else if(h0){var E0=h0[1],U=E0[1];if(!P(E0[2],Mo)){B0(x,[0,U,8]);break x}}return[0,[0,B,[0,3,W,g0,I,e,x0([0,F0],0,O)]]]}}return Kj(x,r,e,oo(Ul0,x)[2],K,s0,I,v,t0,l0)}function oY(x,r,e,t){var u=x?x[1]:0,i=la(1,r),c=Lx(u,Bj(i)),v=i0(i),a=L(i);x:if(typeof a!="number"&&a[0]===4&&!P(a[3],pA)){Ux(i,84),T0(i);break x}J(i,41);var l=rj(1,i),m=L(l);x:{r:if(e&&typeof m=="number"){if(53<=m){if(m!==99&&54<=m)break r}else if(m!==42&&m)break r;var T=0;break x}if(_n(i))var h=p(X0[13],0,l),T=[0,p(D2(i)[2],h,function(Q,e0){return p(Xx(Q,O3,cn),Q,e0)})];else{AU(i,Ol0);var T=[0,[0,G0(i),Dl0]]}}var b=$e(i);if(b)var N=b[1],C=[0,p(D2(i)[2],N,function(Q,e0){return p(Xx(Q,vT,se),Q,e0)})];else var C=0;var I=i0(i);if($r(i,42))var F=r0(0,function(Q){var e0=Cj(ZC(0,Q)),f0=L(Q)===99?p(D2(Q)[2],e0,function(Z,v0){return p(Xx(Z,nn,96),Z,v0)}):e0,a0=yX(Q);return[0,f0,a0,x0([0,I],0,O)]},i),M=F[1],Y=F[2],q=[0,[0,M,p(D2(i)[2],Y,function(Q,e0){return Q0(Xx(Q,-663447790,97),Q,M,e0)})]];else var q=0;if(L(i)===53){1-S2(i)&&Ux(i,K2);var K=[0,OU(i,cY(i,1))]}else var K=0;var u0=r0(0,function(Q){var e0=i0(Q);if(!$r(Q,0))return bn(Q,0),Rl0;Q[30][1]=[0,[0,N1[1],0],Q[30][1]];for(var f0=0,a0=PT0,Z=0;;){var v0=L(Q);if(typeof v0=="number"){var t0=v0-2|0;if(G1>>0){if(J1>=t0+1>>>0)break}else if(t0===6){J(Q,8);continue}}var y0=CT0(Q);switch(y0[0]){case 0:var n0=y0[1],s0=n0[2],l0=n0[1];switch(s0[1]){case 0:if(s0[4])var nx=a0,mx=f0;else{f0&&B0(Q,[0,l0,15]);var nx=a0,mx=1}break;case 1:var w0=s0[2],L0=w0[0]===4?Oh(Q,a0,w0[1],qL):a0,nx=L0,mx=f0;break;case 2:var I0=s0[2],j0=I0[0]===4?Oh(Q,a0,I0[1],jA):a0,nx=j0,mx=f0;break;default:var S0=s0[2],W0=S0[0]===4?Oh(Q,a0,S0[1],JI):a0,nx=W0,mx=f0}break;case 1:var A0=y0[1][2],J0=A0[4],b0=A0[1];switch(b0[0]){case 4:bx(Fl0);break;case 0:case 3:var z=b0[1],C0=z[2][1],V0=_r(C0,Mo),N0=z[1];if(V0)var xx=V0;else var rx=_r(C0,Xa),xx=rx&&J0;xx&&B0(Q,[0,N0,[15,C0,J0,0,0]]);break}var nx=a0,mx=f0;break;default:var nx=Oh(Q,a0,y0[1][2][1],bR),mx=f0}var f0=mx,a0=nx,Z=[0,y0,Z]}function F0(Kr,S){return R6(function(G){return 1-N1[3].call(null,G[1],Kr)},S)}var px=tx(Z),dx=Q[30][1];if(dx){var W=dx[1],g0=W[1];if(dx[2]){var B=dx[2],h0=F0(g0,W[2]),_0=D6(B),d0=_0[2],E0=_0[1],U=$M(B),Kx=[0,[0,E0,Lx(d0,h0)],U];Q[30][1]=Kx}else T1(function(Kr){return B0(Q,[0,Kr[2],[25,Kr[1]]])},F0(g0,W[2])),Q[30][1]=0}else bx(fs0);J(Q,1);var Ix=L(Q);x:{r:if(!t){if(typeof Ix=="number"&&(Ix===1||kr===Ix))break r;if(d1(Q)){var z0=co(Q);break x}var z0=0;break x}var z0=q0(Q)}return[0,px,x0([0,e0],[0,z0],O)]},i);return[0,T,u0,C,q,K,c,x0([0,v],0,O)]}function Dh(x,r){return r0(0,function(e){return[2,oY([0,r],e,e[7],0)]},x)}function jT0(x){return[7,oY(0,x,1,1)]}var OT0=0,vY=qU(X0);function lY(x){var r=m4(x);x:if(x[5])Ov(x,r[1]);else{var e=r[2];r:if(e[0]===27){var t=e[1],u=r[1];if(t[4])B0(x,[0,u,4]);else{if(!t[5])break r;B0(x,[0,u,22])}break x}}return r}function Fh(x,r){var e=r[4],t=r[3],u=r[2],i=r[1];e&&Ne(x,77);var c=i0(x);return J(x,[2,[0,i,u,t,e]]),[0,i,[0,u,t,x0([0,c],[0,q0(x)],O)]]}function o1(x,r,e){var t=x?x[1]:wv0,u=r?r[1]:1,i=L(e);if(typeof i=="number"){var c=i-2|0;if(G1>>0){if(J1>=c+1>>>0)return[1,[0,q0(e),function(a,l){return a}]]}else if(c===6){T0(e);var v=L(e);x:if(typeof v=="number"){if(v!==1&&kr!==v)break x;return[0,q0(e)]}return d1(e)?[0,co(e)]:_v0}}return d1(e)?[1,f4(e)]:(u&&p2([0,t],e),bv0)}function ha(x){var r=L(x);x:if(typeof r=="number"){if(r!==1&&kr!==r)break x;return[0,q0(x),function(e,t){return e}]}return d1(x)?f4(x):kh(x)}function Gj(x,r,e){var t=o1(0,0,r);if(t[0]===0)return[0,t[1],e];var u=t[1][2],i=tx(e);if(i)var c=i[2],v=tx([0,p(u,i[1],function(a,l){return Q0(Xx(a,634872468,66),a,x,l)}),c]);else var v=0;return[0,0,v]}var pY=[],kY=[],mY=[];function hY(x,r,e){var t=e[2][1],u=e[1];if(!(t&&!t[1][2][2]&&!t[2]))return B0(x,[0,u,r])}function Wj(x,r){if(!x[5]&&s4(r))return Ov(x,r[1])}function dY(x){var r=fo(x)?lY(x):d(X0[2],x),e=1-x[5],t=e&&s4(r);return t&&Ov(x,r[1]),r}function DT0(x){var r=i0(x);J(x,44);var e=dY(x);return[0,e,x0([0,r],0,O)]}function FT0(x){var r=i0(x);J(x,16);var e=Lx(r,i0(x));J(x,4);var t=d(X0[7],x);J(x,5);var u=dY(x),i=L(x)===44?[0,r0(0,DT0,x)]:0;return[28,[0,t,u,i,x0([0,e],0,O)]]}var RT0=0;function yY(x){return r0(RT0,FT0,x)}function LT0(x){var r=d(X0[7],x),e=o1(vv0,0,x);if(e[0]===0)var t=r,u=e[1];else var t=p(e[1][2],r,function(h,T){return p(Xx(h,nn,72),h,T)}),u=0;if(x[20]){var i=t[2];if(i[0]===14){var c=i[1][2];x:{if(1>>0){if(e!==14)break x}else if(4>=e-1>>>0)break x;return q0(x)}return d1(x)?co(x):0}function CY(x){return L(x)===1?0:[0,d(X0[7],x)]}function da(x){var r=G0(x),e=L(x);x:{if(typeof e!="number"&&e[0]===8){var t=e[1];break x}p2(bl0,x);var t=Tl0}var u=i0(x);T0(x);var i=L(x);x:{r:if(typeof i=="number"){var c=i+UR|0;if(73>>0){if(c!==77)break r}else if(71>=c-1>>>0)break r;var v=q0(x);break x}var v=Jh(x)}return[0,r,[0,t,x0([0,u],[0,v],O)]]}function jY(x){var r=rr(1,x);if(typeof r=="number"){if(r===10)for(var e=r0(0,function(u){var i=[0,da(u)];return J(u,10),[0,i,da(u)]},x);;){var t=L(x);if(typeof t=="number"&&t===10){let u=e;var e=r0([0,e[1]],function(c){return J(c,10),[0,[1,u],da(c)]},x);continue}return[2,e]}if(r===87)return[1,r0(0,function(u){var i=da(u);return J(u,87),[0,i,da(u)]},x)]}return[0,da(x)]}function T4(x,r){return _r(x[2][1],r[2][1])}function OY(x,r){var e=x[2],t=e[1],u=r[2],i=u[1],c=e[2],v=u[2];x:{if(t[0]===0){var a=t[1];if(i[0]===0){var m=T4(a,i[1]);break x}}else{var l=t[1];if(i[0]!==0){var m=OY(l,i[1]);break x}}var m=0}return m&&T4(c,v)}function Gh(x,r){switch(x[0]){case 0:var e=x[1];if(r[0]===0)return T4(e,r[1]);break;case 1:var t=x[1];if(r[0]===1){var u=t[2],i=r[1][2],c=u[2],v=i[2],a=T4(u[1],i[1]);return a&&T4(c,v)}break;default:var l=x[1];if(r[0]===2)return OY(l,r[1])}return 0}function Hj(x){switch(x[0]){case 0:return x[1][1];case 1:return x[1][1];default:return x[1][1]}}var Bv=[];function DY(x,r){var e=i0(r),t=r0(0,function(l0){J(l0,99);var w0=L(l0);if(typeof w0=="number"){if(y2===w0)return T0(l0),gl0}else if(w0[0]===8){var L0=jY(l0);x:{if(S2(l0)&&L(l0)===99&&vn!==rr(1,l0)){var I0=ph(l0,0,jj);break x}var I0=0}for(var j0=0;;){var S0=L(l0);if(typeof S0=="number"){if(S0===0){var W0=i0(l0);V2(l0,0);var A0=r0(0,function(N0){J(N0,0),J(N0,12);var rx=d(X0[10],N0);return J(N0,1),rx},l0),J0=A0[2],b0=A0[1];H2(l0);var j0=[0,[1,[0,b0,[0,J0,x0([0,W0],[0,Jh(l0)],O)]]],j0];continue}}else if(S0[0]===8){var j0=[0,[0,r0(0,function(N0){var rx=rr(1,N0);x:{if(typeof rx=="number"&&rx===87){var xx=[1,r0(0,function(Ix){var z0=da(Ix);return J(Ix,87),[0,z0,da(Ix)]},N0)];break x}var xx=[0,da(N0)]}var nx=L(N0);x:{if(typeof nx=="number"&&nx===83){J(N0,83);var mx=i0(N0),F0=L(N0);r:{if(typeof F0=="number"){if(F0===0){var px=i0(N0);V2(N0,0);var dx=r0(0,function(z0){J(z0,0);var Kr=CY(z0);return J(z0,1),Kr},N0),W=dx[1],g0=dx[2];H2(N0);var B=[0,g0,j2([0,px],[0,Jh(N0)],0,O)];B[1]||B0(N0,[0,W,46]);var E0=[0,[1,[0,W,B]]];break r}}else if(F0[0]===10){var h0=F0[3],_0=F0[2],d0=F0[1];J(N0,F0);var E0=[0,[0,[0,d0,[0,_0,h0,x0([0,mx],[0,Jh(N0)],O)]]]];break r}Ux(N0,35);var E0=[0,[0,[0,G0(N0),_l0]]]}var U=E0;break x}var U=0}return[0,xx,U]},l0)],j0];continue}var z=tx(j0),C0=[0,Fa,[0,L0,I0,$r(l0,vn),z]];return $r(l0,y2)?[0,C0]:(bn(l0,y2),[1,C0])}}return bn(l0,y2),wl0},r);if(H2(r),d(Bv[3],t))var u=uE,i=r0(0,function(l0){return 0},r);else{V2(r,3);var c=d(Bv[4],t),v=Q0(Bv[1],x,c,r),u=v[2],i=v[1]}var a=q0(r);x:{r:if(typeof u!="number"){var l=u[1];if(Fa===l){var m=u[2],h=m[2][1],T=t[2],b=m[1];if(T[0]===0){var N=T[1];if(typeof N=="number")B0(r,[0,Hj(h),hl0]);else{var C=N[2][1];e:if(1-Gh(h,C)){if(x&&Gh(x[1],h)){var I=[21,d(Bv[2],C)];B0(r,[0,Hj(C),I]);break e}var F=[13,d(Bv[2],C)];B0(r,[0,Hj(h),F])}}}var M=b}else{if(un!==l)break r;var Y=u[2],q=t[2];if(q[0]===0){var K=q[1];typeof K!="number"&&B0(r,[0,Y,[13,d(Bv[2],K[2][1])]])}var M=Y}var u0=M;break x}var u0=t[1]}var Q=t[2][1],e0=t[1];if(typeof Q=="number"){x:{r:{var f0=x0([0,e],[0,a],O);if(typeof u!="number"){var a0=u[1];if(Fa===a0)var Z=u[2][1];else{if(un!==a0)break r;var Z=u[2]}var v0=Z;break x}}var v0=u0}var t0=[0,un,[0,e0,v0,i,f0]]}else{var y0=Q[2];x:{var n0=x0([0,e],[0,a],O);if(typeof u!="number"&&Fa===u[1]){var s0=[0,u[2]];break x}var s0=0}var t0=[0,Fa,[0,[0,e0,y0],s0,i,n0]]}return[0,Vr(t[1],u0),t0]}function FY(x,r){return V2(r,2),DY(x,r)}function XT0(x,r,e,t){for(var u=t;;){var i=cl(e);if(u&&r){var c=u[1],v=c[2],a=r[1],l=u[2];x:{if(v[0]===0){var m=v[1],h=m[2];if(h){var T=h[1][2][1],b=1-Gh(m[1][2][1],T);if(b){var N=Gh(a,T);break x}var N=b;break x}}var N=0}if(N){var C=c[2];x:{if(C[0]===0){var I=C[1],F=I[2];if(F){var M=F[1],Y=Vr(c[1],I[3][1]),q=[0,Fa,M],K=[0,Y,[0,[0,I[1],0,I[3],I[4]]]];break x}}var q=uE,K=c}return H2(e),[0,tx([0,K,l]),i,q]}}var u0=L(e);if(typeof u0=="number"){if(u0===99){V2(e,2);var Q=L(e),e0=rr(1,e);x:if(typeof Q=="number"&&Q===99&&typeof e0=="number"){if(vn!==e0&&kr!==e0)break x;var f0=r0(0,function(F0){J(F0,99),J(F0,vn);var px=L(F0);if(typeof px=="number"){if(y2===px)return T0(F0),un}else if(px[0]===8){var dx=jY(F0);return vh(F0,y2),[0,Fa,[0,dx]]}return bn(F0,y2),un},e),a0=f0[2],Z=f0[1],v0=typeof a0=="number"?[0,un,Z]:[0,Fa,[0,Z,a0[2]]],t0=e[24][1];r:{if(t0){var y0=t0[2];if(y0){var n0=y0[2];break r}}var n0=bx(xs0)}e[24][1]=n0;var s0=fl(e),l0=r4(e[25][1],s0);return e[26][1]=l0,[0,tx(u),i,v0]}var w0=DY(r,e),L0=w0[2],I0=w0[1],j0=un<=L0[1]?[0,I0,[1,L0[2]]]:[0,I0,[0,L0[2]]],u=[0,j0,u];continue}if(kr===u0)return p2(0,e),[0,tx(u),i,uE]}var S0=L(e);x:{if(typeof S0=="number"){if(S0===0){V2(e,0);var W0=r0(0,function(F0){J(F0,0);var px=L(F0);r:{if(typeof px=="number"&&px===12){var dx=i0(F0);J(F0,12);var W=d(X0[10],F0),h0=[3,[0,W,x0([0,dx],0,O)]];break r}var g0=CY(F0),B=g0?0:i0(F0),h0=[2,[0,g0,j2(0,0,B,O)]]}return J(F0,1),h0},e),A0=W0[2],J0=W0[1];H2(e);var xx=[0,J0,A0];break x}}else if(S0[0]===9){var b0=S0[3],z=S0[2],C0=S0[1];J(e,S0);var xx=[0,C0,[4,[0,z,b0]]];break x}var V0=FY(r,e),N0=V0[2],rx=V0[1],xx=un<=N0[1]?[0,rx,[1,N0[2]]]:[0,rx,[0,N0[2]]]}var u=[0,xx,u]}}function RY(x){switch(x[0]){case 0:return x[1][2][1];case 1:var r=x[1][2],e=r[1],t=Mx(dl0,r[2][2][1]);return Mx(e[2][1],t);default:var u=x[1][2],i=u[1],c=u[2],v=i[0]===0?i[1][2][1]:RY([2,i[1]]);return Mx(v,Mx(yl0,c[2][1]))}}Rr(Bv,[0,function(x,r,e){var t=G0(e),u=XT0(O,r,e,0),i=u[2],c=u[3],v=u[1],a=i?i[1]:t;return[0,[0,Vr(t,a),v],c]},RY,function(x){var r=x[2];if(r[0]!==0)return 1;var e=r[1];return typeof e=="number"?0:e[2][3]},function(x){var r=x[2][1];return typeof r=="number"?0:[0,r[2][1]]}]);function LY(x,r){var e=a1(r);return mh(x,r,e),e}var Zj=[],MY=[],qY=[],BY=[];function YT0(x){var r=i0(x);J(x,60);var e=L(x)===8?q0(x):0,t=o1(0,0,x),u=t[0]===0?t[1]:t[1][1];return[5,[0,x0([0,r],[0,Lx(e,u)],O)]]}var zT0=0;function KT0(x){var r=i0(x);J(x,38);var e=t4(1,x),t=d(X0[2],e),u=1-x[5],i=u&&s4(t);i&&Ov(x,t[1]);var c=q0(x);J(x,26);var v=q0(x);J(x,4);var a=d(X0[7],x);J(x,5);var l=L(x)===8?q0(x):0,m=o1(0,gv0,x),h=m[0]===0?Lx(l,m[1]):m[1][1];return[18,[0,t,a,x0([0,r],[0,Lx(c,Lx(v,h))],O)]]}var JT0=0;function GT0(x){var r=i0(x);J(x,40);var e=x[19],t=e&&$r(x,66),u=Lx(r,i0(x));J(x,4);var i=x0([0,u],0,O),c=L(x);x:{if(typeof c=="number"&&c===65){var v=1;break x}var v=0}var a=n4(1,x),l=L(a);x:{if(typeof l=="number"){if(25<=l){if(30>l)switch(l+A3|0){case 0:var m=r0(0,EX,a),h=m[2],T=h[3],b=h[1],N=m[1],f0=T,a0=[0,[1,[0,N,[0,b,0,x0([0,h[2]],0,O)]]]];break x;case 3:var C=r0(0,SX,a),I=C[2],F=I[3],M=I[1],Y=C[1],f0=F,a0=[0,[1,[0,Y,[0,M,2,x0([0,I[2]],0,O)]]]];break x;case 4:if(rr(1,a)!==17){var q=r0(0,AX,a),K=q[2],u0=K[3],Q=K[1],e0=q[1],f0=u0,a0=[0,[1,[0,e0,[0,Q,1,x0([0,K[2]],0,O)]]]];break x}break}}else if(l===8){var f0=0,a0=0;break x}}var f0=0,a0=[0,[0,d(X0[8],a)]]}var Z=L(x);if(typeof Z=="number"){if(Z===17){if(!a0)throw K0([0,Ir,yv0],1);var v0=a0[1];if(v0[0]===0)var t0=[1,Pj(dv0,x,v0[1])];else{var y0=v0[1];hY(x,38,y0);var t0=[0,y0]}t?J(x,64):J(x,17);var n0=d(X0[7],x);J(x,5);var s0=t4(1,x),l0=d(X0[2],s0);return Wj(x,l0),[25,[0,t0,n0,l0,0,i]]}if(Z===64){if(!a0)throw K0([0,Ir,hv0],1);var w0=a0[1];if(w0[0]===0){var L0=Pj(mv0,x,w0[1]),I0=1-t,j0=I0&&v;x:if(j0){var S0=L0[2];if(S0[0]===2){var W0=S0[1][1],A0=W0[1];if(!P(W0[2][1],Ya)){B0(x,[0,A0,39]);break x}}}var J0=[1,L0]}else{var b0=w0[1];hY(x,39,b0);var J0=[0,b0]}J(x,64);var z=d(X0[10],x);J(x,5);var C0=t4(1,x),V0=d(X0[2],C0);return Wj(x,V0),[26,[0,J0,z,V0,t,i]]}}if(T1(function(g0){return B0(x,g0)},f0),t?J(x,64):J(x,8),a0)var N0=a0[1],rx=N0[0]===0?[0,[1,y1(x,N0[1])]]:[0,[0,N0[1]]],xx=rx;else var xx=0;var nx=L(x);x:{if(typeof nx=="number"&&nx===8){var mx=0;break x}var mx=[0,d(X0[7],x)]}J(x,8);var F0=L(x);x:{if(typeof F0=="number"&&F0===5){var px=0;break x}var px=[0,d(X0[7],x)]}J(x,5);var dx=t4(1,x),W=d(X0[2],dx);return Wj(x,W),[24,[0,xx,mx,px,W,i]]}var WT0=0;function VT0(x){1-x[11]&&Ux(x,27);var r=i0(x),e=G0(x);J(x,19);var t=L(x)===8?q0(x):0;x:{if(L(x)!==8&&!ol(x)){var u=[0,d(X0[7],x)];break x}var u=0}var i=Vr(e,G0(x)),c=o1(0,0,x);x:{if(c[0]===0)var v=c[1];else{var a=c[1],l=a[1];if(u){var m=[0,p(a[2],u[1],function(C,I){return p(Xx(C,nn,67),C,I)})],h=t;break x}var v=l}var m=u,h=Lx(t,v)}return[33,[0,m,x0([0,r],[0,h],O),i]]}var $T0=0;function QT0(x){var r=i0(x);J(x,20),J(x,4);var e=d(X0[7],x);J(x,5),J(x,0);for(var t=kv0;;){var u=t[2],i=t[1],c=L(x);x:if(typeof c=="number"){if(c!==1&&kr!==c)break x;var v=tx(u);J(x,1);var a=ha(x)[1],l=e[1];return[34,[0,e,v,x0([0,r],[0,a],O),l]]}let h=i;var m=aj(0,function(b){var N=i0(b),C=L(b);x:{if(typeof C=="number"&&C===37){h&&Ux(b,54),J(b,37);var I=q0(b),F=0;break x}J(b,34);var I=0,F=[0,d(X0[7],b)]}var M=h||(F===0?1:0);J(b,87);var Y=Lx(I,ha(b)[1]);function q(e0){x:if(typeof e0=="number"){var f0=e0-1|0;if(33>>0){if(f0!==36)break x}else if(31>=f0-1>>>0)break x;return 1}return 0}var K=1,u0=b[9]===1?b:[0,b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],K,b[10],b[11],b[12],b[13],b[14],b[15],b[16],b[17],b[18],b[19],b[20],b[21],b[22],b[23],b[24],b[25],b[26],b[27],b[28],b[29],b[30],b[31]],Q=p(X0[4],q,u0);return[0,[0,F,Q,x0([0,N],[0,Y],O)],M]},x),t=[0,m[2],[0,m[1],u]]}}var HT0=0;function ZT0(x){var r=i0(x),e=G0(x);J(x,23),d1(x)&&B0(x,[0,e,55]);var t=d(X0[7],x),u=o1(0,0,x);if(u[0]===0)var i=t,c=u[1];else var i=p(u[1][2],t,function(v,a){return p(Xx(v,nn,68),v,a)}),c=0;return[35,[0,i,x0([0,r],[0,c],O)]]}var xE0=0;function rE0(x){var r=i0(x);J(x,24);var e=d(X0[15],x),t=L(x)===35?p(D2(x)[2],e,function(b,N){var C=N[1];return[0,C,Q0(Xx(b,Jp,4),b,C,N[2])]}):e,u=L(x);x:{if(typeof u=="number"&&u===35){var i=[0,r0(0,function(N){var C=i0(N);J(N,35);var I=q0(N);if(L(N)===4){J(N,4);var F=[0,p(X0[18],N,68)];J(N,5);var M=F}else var M=0;var Y=d(X0[15],N),q=L(N)===39?Y:p(ha(N)[2],Y,function(K,u0){var Q=u0[1];return[0,Q,Q0(Xx(K,Jp,69),K,Q,u0[2])]});return[0,M,q,x0([0,C],[0,I],O)]},x)];break x}var i=0}var c=L(x);x:{if(typeof c=="number"&&c===39){J(x,39);var v=d(X0[15],x),a=v[1],l=v[2],m=[0,[0,a,p(ha(x)[2],l,function(N,C){return Q0(Xx(N,Jp,70),N,a,C)})]];break x}var m=0}var h=i===0?1:0,T=h&&(m===0?1:0);return T&&B0(x,[0,t[1],57]),[36,[0,t,i,m,x0([0,r],0,O)]]}var eE0=0;function tE0(x){var r=0,e=EX(x),t=e[3],u=e[2],i=Gj(r,x,e[1]),c=i[2],v=i[1];return T1(function(a){return B0(x,a)},t),[39,[0,c,r,x0([0,u],[0,v],O)]]}var nE0=0;function uE0(x){var r=2,e=SX(x),t=e[3],u=e[2],i=Gj(r,x,e[1]),c=i[2],v=i[1];return T1(function(a){return B0(x,a)},t),[39,[0,c,r,x0([0,u],[0,v],O)]]}var iE0=0;function fE0(x){var r=1,e=AX(x),t=e[3],u=e[2],i=Gj(r,x,e[1]),c=i[2],v=i[1];return T1(function(a){return B0(x,a)},t),[39,[0,c,r,x0([0,u],[0,v],O)]]}var cE0=0;function sE0(x){var r=i0(x);J(x,26);var e=Lx(r,i0(x));J(x,4);var t=d(X0[7],x);J(x,5);var u=t4(1,x),i=d(X0[2],u),c=1-x[5],v=c&&s4(i);return v&&Ov(x,i[1]),[40,[0,t,i,x0([0,e],0,O)]]}var aE0=0;function oE0(x){var r=i0(x),e=d(X0[7],x),t=L(x),u=e[2];if(u[0]===10&&typeof t=="number"&&t===87){var i=u[1],c=i[2][1],v=e[1];J(x,87),N1[3].call(null,c,x[3])&&B0(x,[0,v,[23,lv0,c]]);var a=x[31],l=x[30],m=x[29],h=x[28],T=x[27],b=x[26],N=x[25],C=x[24],I=x[23],F=x[22],M=x[21],Y=x[20],q=x[19],K=x[18],u0=x[17],Q=x[16],e0=x[15],f0=x[14],a0=x[13],Z=x[12],v0=x[11],t0=x[10],y0=x[9],n0=x[8],s0=x[7],l0=x[6],w0=x[5],L0=x[4],I0=N1[4].call(null,c,x[3]),j0=[0,x[1],x[2],I0,L0,w0,l0,s0,n0,y0,t0,v0,Z,a0,f0,e0,Q,u0,K,q,Y,M,F,I,C,N,b,T,h,m,l,a],S0=fo(j0)?lY(j0):d(X0[2],j0);return[31,[0,i,S0,x0([0,r],0,O)]]}var W0=o1(pv0,0,x);if(W0[0]===0)var A0=e,J0=W0[1];else var A0=p(W0[1][2],e,function(b0,z){return p(Xx(b0,nn,71),b0,z)}),J0=0;return[23,[0,A0,0,x0(0,[0,J0],O)]]}var vE0=0;function lE0(x){function r(e){var t=i0(e),u=d(X0[27],e),i=$r(e,16)?[0,d(X0[7],e)]:0;J(e,87);var c=d(X0[15],e),v=L(e);x:{r:if(typeof v=="number"){if(v!==1&&kr!==v)break r;break x}$r(e,9)}return[0,u,c,i,x0([0,t],[0,q0(e)],O)]}return r0(0,function(e){var t=i0(e);if(J(e,21),d1(e))throw K0(Bt,1);var u=Ch(e),i=d1(e),c=i||1-$r(e,0);if(c)throw K0(Bt,1);for(var v=0,a=RU(e,u);;){var l=L(e);x:if(typeof l=="number"){if(l!==1&&kr!==l)break x;var m=tx(v);return J(e,1),[32,[0,a,m,x0([0,t],[0,q0(e)],O)]]}var v=[0,r0(0,r,e),v]}},x)}function pE0(x,r){var e=x?x[1]:0;1-S2(r)&&Ux(r,ft);var t=rr(1,r);if(typeof t=="number")switch(t){case 25:return Yh(0,r);case 28:return Yh(2,r);case 29:return Yh(1,r);case 41:return r0(0,function(b){var N=i0(b);return J(b,61),[6,$j(N,b)]},r);case 47:if(L(r)===51)return Mh(r);break;case 49:if(r[28][2])return r0(0,function(b){var N=i0(b);return J(b,61),[8,vY[1].call(null,[0,N],b)]},r);break;case 50:if(e)return AY(r);break;case 54:return r0(0,function(b){var N=i0(b);return J(b,61),[11,Uh(N,b)]},r);case 62:var u=L(r);return typeof u=="number"&&u===51&&e?Mh(r):r0(0,function(b){var N=i0(b);return J(b,61),[15,qh(N,b)]},r);case 63:return r0(0,function(b){var N=i0(b);return J(b,61),[16,Bh(Yo0,N,b)]},r);case 15:case 65:return bY(r)}else if(t[0]===4){var i=t[3];if(P(i,Ks)){if(P(i,Ho)){if(!P(i,lR)){var c=G0(r),v=i0(r);J(r,61);var a=Lx(v,i0(r));return bs(r,Wo0),L(r)===10?r0([0,c],function(b){var N=i0(b);J(b,10);var C=i0(b);bs(b,$o0);var I=F6([0,a,[0,N,[0,C,[0,i0(b),0]]]]),F=Lv(b),M=o1(0,0,b);if(M[0]===0)var Y=M[1],q=F;else var Y=0,q=p(M[1][2],F,function(K,u0){return p(Xx(K,mA,88),K,u0)});return[13,[0,q,x0([0,I],[0,Y],O)]]},r):r0([0,c],d(kY[1],a),r)}if(!P(i,yT)){var l=G0(r),m=i0(r);J(r,61);var h=Lx(m,i0(r));return bs(r,Vo0),r0([0,l],d(mY[1],h),r)}}else if(r[28][1])return bY(r)}else if(r[28][1])return r0(0,function(b){var N=i0(b);return J(b,61),[7,Qj(N,b)]},r)}if(!e)return d(X0[2],r);var T=L(r);return typeof T=="number"&&T===51?Mh(r):Yh(0,r)}var kE0=0;function UY(x,r,e){var t=mU(1,x),u=KN(Zj[2],t,r,e,Jl0),i=u[4],c=u[3],v=u[2],a=mU(0,u[1]),l=tx(v);return T1(d(Zj[1],a),l),[0,a,c,i]}function XY(x){var r=Bj(x),e=L(x);if(typeof e=="number"){var t=e-50|0;if(11>=t>>>0)switch(t){case 0:var u=hU(1,la(1,x)),i=i0(u),c=G0(u);J(u,50);var v=L(u);if(typeof v=="number"){if(54<=v){if(64>v)switch(v-54|0){case 0:return r0([0,c],function(T){1-S2(T)&&Ux(T,Pt);var b=0,N=r0(0,function(I){return Uh(b,I)},T),C=[0,N[1],[30,N[2]]];return[22,[0,[0,C],0,0,0,x0([0,i],0,O)]]},u);case 8:if(rr(1,u)!==0)return r0([0,c],function(T){1-S2(T)&&Ux(T,Pt);var b=rr(1,T);if(typeof b=="number"){if(b===49)return Ux(T,17),J(T,62),[22,[0,0,0,0,0,x0([0,i],0,O)]];if(K2===b){J(T,62);var N=G0(T);J(T,K2);var C=_4(T),I=C[1];return[22,[0,0,[0,[1,[0,N,0]]],[0,I],0,x0([0,i],[0,C[2]],O)]]}}var F=0,M=r0(0,function(q){return qh(F,q)},T),Y=[0,M[1],[37,M[2]]];return[22,[0,[0,Y],0,0,0,x0([0,i],0,O)]]},u);break;case 9:return r0([0,c],function(T){var b=r0(0,function(C){return Bh(0,0,C)},T),N=[0,b[1],[38,b[2]]];return[22,[0,[0,N],0,0,0,x0([0,i],0,O)]]},u)}}else if(v===37)return r0([0,c],function(T){var b=Lx(i,i0(T)),N=r0(0,function(u0){return J(u0,37)},T)[1],C=dU(1,T);x:{if(!fo(C)&&!ah(C)){if(u4(C)){var q=0,K=[0,Dh(C,r)];break x}if(L(C)===49){var q=0,K=[0,PX(0)(C)];break x}if(fj(C)){var q=0,K=[0,Aj(C)];break x}var I=d(X0[10],C),F=o1(0,0,C);if(F[0]===0)var M=F[1],Y=I;else var M=0,Y=p(F[1][2],I,function(e0,f0){return p(Xx(e0,nn,90),e0,f0)});var q=M,K=[1,Y];break x}var q=0,K=[0,m4(C)]}return[21,[0,N,K,x0([0,b],[0,q],O)]]},u)}if(u4(u))return r0([0,c],function(T){var b=Dh(T,r);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u);if(!fo(u)&&!ah(u)){if(typeof v=="number"){var a=v+A3|0;if(4>>0){if(a===24&&u[28][2])return r0([0,c],function(T){var b=p(X0[3],[0,r],T);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u)}else if(1>>0)return r0([0,c],function(T){var b=p(X0[3],[0,r],T);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u)}if(fj(u))return r0([0,c],function(T){var b=Aj(T);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u);if(typeof v=="number"&&K2===v)return r0([0,c],function(T){var b=G0(T);J(T,K2);var N=L(T);x:{if(typeof N!="number"&&N[0]===4&&!P(N[3],It)){T0(T);var C=[0,a1(T)];break x}var C=0}var I=_4(T),F=I[1];return[22,[0,0,[0,[1,[0,b,C]]],[0,F],1,x0([0,i],[0,I[2]],O)]]},u);var l=$r(u,62)?0:1;return $r(u,0)?r0([0,c],function(T){var b=EY(0,T,0);J(T,1);var N=L(T);x:{if(typeof N!="number"&&N[0]===4&&!P(N[3],k6)){var C=_4(T),I=C[2],F=C[1],q=dn(function(a0){var Z=a0[2];return[0,a0[1],[0,Z[1],Z[2],1,Z[4]]]},b),K=I,u0=[0,F];break x}SY(T,b);var M=o1(0,0,T),Y=M[0]===0?M[1]:M[1][1],q=b,K=Y,u0=0}return[22,[0,0,[0,[0,q]],u0,l,x0([0,i],[0,K],O)]]},u):(p2(rv0,u),p(X0[3],[0,r],u))}return r0([0,c],function(T){oh(T)(r);var b=m4(T);return[22,[0,[0,b],0,0,1,x0([0,i],0,O)]]},u);case 1:oh(x)(r);var m=rr(1,x);x:{r:if(typeof m=="number"){if(m!==4&&m!==10)break r;var h=hl(x);break x}var h=Mh(x)}return h;case 11:if(rr(1,x)===50)return oh(x)(r),AY(x);break}}return Wh([0,r],x)}function YY(x,r){return Q0(MY[1],r,x,0)}function zY(x,r){var e=UY(r,x,function(i){return Wh(0,i)}),t=e[3],u=e[2];return[0,m1(function(i,c){return[0,c,i]},xO(x,e[1]),u),t]}function xO(x,r){return Q0(qY[1],r,x,0)}function Wh(x,r){var e=x?x[1]:0;1-u4(r)&&oh(r)(e);var t=L(r);if(typeof t=="number"){if(t===28)return r0(iE0,uE0,r);if(t===29)return r0(cE0,fE0,r)}if(!fo(r)&&!ah(r)){if(u4(r))return Dh(r,e);if(typeof t=="number"){var u=t-49|0;if(14>=u>>>0)switch(u){case 0:if(r[28][2])return PX(0)(r);break;case 5:if(!EU(1,r))return hl(r);var i=0,c=r0(0,function(T){return Uh(i,T)},r);return[0,c[1],[30,c[2]]];case 12:return pE0(0,r);case 13:if(ka(1,r)&&!TU(1,r)){var v=0,a=r0(0,function(T){return qh(v,T)},r);return[0,a[1],[37,a[2]]]}return d(X0[2],r);case 14:var l=rr(1,r);if(typeof l=="number"&&l===62){var m=0,h=r0(0,function(T){return Bh(zo0,m,T)},r);return[0,h[1],[38,h[2]]]}return d(X0[2],r)}}return fj(r)?Aj(r):KY(r)}return m4(r)}function KY(x){for(;;){var r=L(x);if(typeof r=="number"&&iv>r)switch(r){case 0:var e=d(X0[15],x),t=e[1],u=e[2];return[0,t,[0,p(ha(x)[2],u,function(t0,y0){return Q0(Xx(t0,Jp,76),t0,t,y0)})]];case 8:var i=G0(x),c=i0(x);return J(x,8),[0,i,[19,[0,x0([0,c],[0,ha(x)[1]],O)]]];case 16:return yY(x);case 19:return r0($T0,VT0,x);case 20:return r0(HT0,QT0,x);case 21:if(x[28][3]&&!jv(1,x)&&rr(1,x)===4){var v=lh(x,lE0);return v?v[1]:hl(x)}break;case 23:return r0(xE0,ZT0,x);case 24:return r0(eE0,rE0,x);case 25:return r0(nE0,tE0,x);case 26:return r0(aE0,sE0,x);case 27:var a=r0(0,function(t0){var y0=i0(t0);J(t0,27);var n0=Lx(y0,i0(t0));J(t0,4);var s0=d(X0[7],t0);J(t0,5);var l0=d(X0[2],t0),w0=1-t0[5],L0=w0&&s4(l0);return L0&&Ov(t0,l0[1]),[41,[0,s0,l0,x0([0,n0],0,O)]]},x),l=a[1],m=a[2];return pt(x,[0,l,75]),[0,l,m];case 33:var h=i0(x),T=r0(0,function(t0){J(t0,33);x:{if(L(t0)!==8&&!ol(t0)){var y0=p(X0[13],0,t0),n0=y0[2][1],s0=y0[1];1-N1[3].call(null,n0,t0[3])&&B0(t0,[0,s0,[29,n0]]);var l0=[0,y0];break x}var l0=0}var w0=o1(0,0,t0);x:{if(w0[0]===0)var L0=w0[1];else{var I0=w0[1],j0=I0[1];if(l0){var S0=[0,p(I0[2],l0[1],function(z,C0){return p(Xx(z,O3,74),z,C0)})],W0=0;break x}var L0=j0}var S0=l0,W0=L0}return[0,S0,W0]},x),b=T[2],N=b[1],C=T[1],I=N===0?1:0,F=b[2];if(I)var M=x[8],Y=M||x[9],q=1-Y;else var q=I;return q&&B0(x,[0,C,25]),[0,C,[1,[0,N,x0([0,h],[0,F],O)]]];case 36:var K=i0(x),u0=r0(0,function(t0){J(t0,36);x:{if(L(t0)!==8&&!ol(t0)){var y0=p(X0[13],0,t0),n0=y0[2][1],s0=y0[1];1-N1[3].call(null,n0,t0[3])&&B0(t0,[0,s0,[29,n0]]);var l0=[0,y0];break x}var l0=0}var w0=o1(0,0,t0);x:{if(w0[0]===0)var L0=w0[1];else{var I0=w0[1],j0=I0[1];if(l0){var S0=[0,p(I0[2],l0[1],function(z,C0){return p(Xx(z,O3,75),z,C0)})],W0=0;break x}var L0=j0}var S0=l0,W0=L0}return[0,S0,W0]},x),Q=u0[2],e0=u0[1],f0=Q[2],a0=Q[1];return 1-x[8]&&B0(x,[0,e0,26]),[0,e0,[4,[0,a0,x0([0,K],[0,f0],O)]]];case 38:return r0(JT0,KT0,x);case 40:return r0(WT0,GT0,x);case 44:return yY(x);case 60:return r0(zT0,YT0,x);case 114:return p2(Gl0,x),[0,G0(x),Wl0];case 1:case 5:case 7:case 9:case 10:case 11:case 12:case 17:case 18:case 34:case 35:case 37:case 39:case 42:case 43:case 50:case 84:case 87:p2(Vl0,x),T0(x);continue}if(!fo(x)&&!ah(x)){if(typeof r=="number"&&r===29&&rr(1,x)===6){var Z=al(1,x);return B0(x,[0,Vr(G0(x),Z),3]),hl(x)}return _n(x)?r0(vE0,oE0,x):(u4(x)&&(p2(0,x),T0(x)),hl(x))}var v0=m4(x);return Ov(x,v0[1]),v0}}Rr(Zj,[0,function(x,r){if(typeof r!="number"&&r[0]===2){var e=r[1],t=e[4],u=e[1];return t&&pt(x,[0,u,77])}return bx(Mx(Ql0,Mx(DB(r),$l0)))},function(x,r,e,t){for(var u=x,i=t;;){var c=i[3],v=i[2],a=i[1],l=L(u);if(typeof l=="number"&&kr===l)return[0,u,a,v,c];if(d(r,l))return[0,u,a,v,c];if(typeof l!="number"&&l[0]===2){var m=d(e,u),h=[0,m,v],T=m[2];if(T[0]===23){var b=T[1][2];if(b){var N=_r(b[1],"use strict"),C=m[1],I=N&&1-u[21];I&&B0(u,[0,C,80]);var F=N?la(1,u):u,M=[0,l,a],Y=c||N,u=F,i=[0,M,h,Y];continue}}return[0,u,a,h,c]}return[0,u,a,v,c]}}]),Rr(MY,[0,function(x,r,e){for(var t=e;;){var u=L(x);if(typeof u=="number"&&kr===u||d(r,u))return tx(t);var t=[0,XY(x),t]}}]),Rr(qY,[0,function(x,r,e){for(var t=e;;){var u=L(x);if(typeof u=="number"&&kr===u||d(r,u))return tx(t);var t=[0,Wh(0,x),t]}}]),Rr(BY,[0,function(x,r,e){var t=1-x,u=LY([0,r],e),i=t&&(L(e)===86?1:0);return i&&(1-S2(e)&&Ux(e,F1),J(e,86)),[0,u,_j(e),i]}]),rB(e60[1],X0,[0,function(x){var r=L(x);x:{if(typeof r!="number"&&r[0]===6){var e=r[2],t=r[1];T0(x);var u=[0,[0,t,e]];break x}var u=0}var i=i0(x);x:{r:{for(var c=tx(i),v=5;c;){var a=c[2],l=c[1],m=l[2],h=l[1],T=m[2];e:{t:{for(var b=0,N=Cx(T);;){if(N<(b+5|0))break t;var C=_r(E1(T,b,v),"@flow");if(C)break;var b=b+1|0}var I=C;break e}var I=0}if(I)break r;var c=a}var F=0;break x}x[31][1]=h[3];var F=tx([0,[0,h,m],a])}x:if(F===0){if(i){var M=i[1],Y=M[2];if(!Y[1]){var q=Y[2],K=M[1];if(1<=Cx(q)&&q2(q,0)===42){x[31][1]=K[3];var u0=[0,M,0];break x}}}var u0=0}else var u0=F;function Q(n0){return 0}var e0=UY(x,Q,XY),f0=e0[2],a0=m1(function(n0,s0){return[0,s0,n0]},YY(Q,e0[1]),f0),Z=G0(x);if(J(x,kr),m1(function(n0,s0){var l0=s0[2];switch(l0[0]){case 21:return a4(x,n0,gn(0,[0,l0[1][1],Hl0]));case 22:var w0=l0[1],L0=w0[1];if(L0){if(!w0[2]){var I0=L0[1],j0=I0[2],S0=I0[1];x:{switch(j0[0]){case 39:return m1(function(z,C0){return a4(x,z,C0)},n0,m1(function(z,C0){return m1(lj,z,[0,C0[2][1],0])},0,j0[1][1]));case 2:case 27:var W0=j0[1][1];if(W0){var A0=W0[1];break x}break;case 3:case 20:case 30:case 37:case 38:var A0=j0[1][1];break x}return n0}return a4(x,n0,gn(0,[0,S0,A0[2][1]]))}}else{var J0=w0[2];if(J0){var b0=J0[1];return b0[0]===0?m1(function(z,C0){var V0=C0[2],N0=V0[2],rx=V0[1];return N0?a4(x,z,N0[1]):a4(x,z,rx)},n0,b0[1]):n0}}return n0;default:return n0}},N1[1],a0),a0)var v0=D6(tx(a0))[1],t0=Vr(D6(a0)[1],v0);else var t0=Z;var y0=tx(x[2][1]);return[0,t0,[0,a0,u,x0([0,u0],0,O),y0]]},KY,Wh,xO,zY,YY,function(x){var r=G0(x),e=Yt(x),t=L(x);return typeof t=="number"&&t===9?Fj(x,r,[0,e,0]):e},function(x){var r=G0(x),e=y4(x),t=L(x);return typeof t=="number"&&t===9?[0,Fj(x,r,[0,y1(x,e),0])]:e},function(x){return y1(x,UX(x))},Yt,Cj,function(x){var r=r0(0,function(t){var u=i0(t);J(t,0);x:for(var i=0,c=[0,0,mn];;){var v=c[2],a=c[1],l=L(t);if(typeof l=="number"){if(l===1)break x;if(kr===l)break}var m=AT0(t),h=m[1],T=m[2];r:{if(h[0]===1&&L(t)===9){var b=[0,G0(t)];break r}var b=0}var N=Ij(T,v),C=L(t);r:{e:if(typeof C=="number"){var I=C-2|0;if(G1>>0){if(J1>>0)break e}else{if(I!==7)break e;T0(t)}var q=N;break r}var F=JC(Zc0,9),M=SU([0,F],L(t)),Y=[0,G0(t),M];$r(t,8);var q=[0,[0,Y,N[1]],[0,Y,N[2]]]}var i=b,c=[0,[0,h,a],q]}var K=i?[0,v[1],[0,[0,i[1],91],v[2]]]:v,u0=IX(K),Q=tx(a),e0=i0(t);return J(t,1),[0,[0,Q,j2([0,u],[0,q0(t)],e0,O)],u0]},x),e=r[2];return[0,r[1],e[1],e[2]]},LY,function(x,r,e){var t=r?r[1]:0;return r0(0,p(BY[1],t,e),x)},function(x){var r=G0(x),e=i0(x);J(x,0);var t=xO(function(v){return v===1?1:0},x),u=G0(x),i=t===0?i0(x):0;J(x,1);var c=[0,t,j2([0,e],[0,q0(x)],i,O)];return[0,Vr(r,u),c]},function(x){function r(t){var u=i0(t);J(t,0);var i=zY(function(h){return h===1?1:0},t),c=i[1],v=i[2],a=c===0?i0(t):0;J(t,1);var l=L(t);x:{r:if(!x){if(typeof l=="number"&&(l===1||kr===l))break r;if(d1(t)){var m=co(t);break x}var m=0;break x}var m=q0(t)}return[0,[0,c,j2([0,u],[0,m],a,O)],v]}var e=0;return function(t){return aj(e,r,t)}},function(x){return FY(kE0,x)},b4,zh,oo,Dh,function(x){return r0(OT0,jT0,x)},function(x){var r=x[2];switch(r[0]){case 24:var e=r[1],t=e[1][2][1];if(P(t,K1)){if(!P(t,nv)&&!P(e[2][2][1],Jm))return 0}else if(!P(e[2][2][1],Gl))return 0;break;case 0:case 10:case 23:case 26:break;default:return 0}return 1},Oj,Lv,Dj,Ph]);var rO=[i2,mb0,ks(0)],eO=[0,rO,[0]],mE0=T5(pb0,function(x){var r=IC(x,lb0)[42],e=OC(x,0,0,kb0,qC,1)[1];return Zq(x,r,function(t,u){return 0}),function(t,u){var i=E5(u,x);return d(e,i),DC(u,i,x)}}),hE0=[i2,B00,ks(0)];function dE0(x){if(typeof x=="number"){var r=x;if(57<=r)switch(r){case 57:return RH;case 58:return LH;case 59:return MH;case 60:return qH;case 61:return BH;case 62:return UH;case 63:return XH;case 64:return YH;case 65:return zH;case 66:return KH;case 67:return JH;case 68:return GH;case 69:return WH;case 70:return VH;case 71:return $H;case 72:return QH;case 73:return HH;case 74:return ZH;case 75:return xZ;case 76:return rZ;case 77:return eZ;case 78:return tZ;case 79:return nZ;case 80:return uZ;case 81:return iZ;case 82:return fZ;case 83:return cZ;case 84:return sZ;case 85:return aZ;case 86:return oZ;case 87:return vZ;case 88:return lZ;case 89:return pZ;case 90:return kZ;case 91:return mZ;case 92:return hZ;case 93:return dZ;case 94:return yZ;case 95:return gZ;case 96:return wZ;case 97:return _Z;case 98:return bZ;case 99:return TZ;case 100:return EZ;case 101:return SZ;case 102:return AZ;case 103:return PZ;case 104:return IZ;case 105:return NZ;case 106:return CZ;case 107:return jZ;case 108:return OZ;case 109:return DZ;case 110:return FZ;case 111:return RZ;case 112:return LZ;default:return MZ}switch(r){case 0:return CQ;case 1:return jQ;case 2:return OQ;case 3:return DQ;case 4:return FQ;case 5:return RQ;case 6:return LQ;case 7:return MQ;case 8:return qQ;case 9:return BQ;case 10:return UQ;case 11:return Mx(YQ,XQ);case 12:return zQ;case 13:return KQ;case 14:return JQ;case 15:return GQ;case 16:return WQ;case 17:return VQ;case 18:return $Q;case 19:return QQ;case 20:return HQ;case 21:return ZQ;case 22:return xH;case 23:return rH;case 24:return eH;case 25:return tH;case 26:return nH;case 27:return uH;case 28:return iH;case 29:return fH;case 30:return Mx(sH,cH);case 31:return aH;case 32:return oH;case 33:return vH;case 34:return lH;case 35:return pH;case 36:return kH;case 37:return mH;case 38:return hH;case 39:return dH;case 40:return yH;case 41:return gH;case 42:return wH;case 43:return _H;case 44:return bH;case 45:return TH;case 46:return EH;case 47:return SH;case 48:return AH;case 49:return PH;case 50:return IH;case 51:return NH;case 52:return CH;case 53:return jH;case 54:return OH;case 55:return DH;default:return FH}}switch(x[0]){case 0:var e=x[1];return d(sr(qZ),e);case 1:var t=x[1];return d(sr(BZ),t);case 2:var u=x[2],i=x[1];return p(sr(UZ),u,i);case 3:var c=x[2],v=x[1];return Q0(sr(XZ),c,c,v);case 4:var a=x[2],l=x[1];return p(sr(YZ),a,l);case 5:var m=x[1];return d(sr(zZ),m);case 6:return x[1]?KZ:JZ;case 7:var h=x[2],T=x[1],b=d(sr(GZ),T);if(!h)return d(sr(VZ),b);var N=h[1];return p(sr(WZ),N,b);case 8:var C=x[1];return p(sr($Z),C,C);case 9:var I=x[3],F=x[2],M=x[1];if(!F)return p(sr(ZZ),I,M);var Y=F[1];if(Y===3)return p(sr(HZ),I,M);switch(Y){case 0:var q=ZV;break;case 1:var q=x$;break;case 2:var q=r$;break;case 3:var q=e$;break;default:var q=t$}return KN(sr(QZ),M,q,I,q);case 10:var K=x[2],u0=x[1],Q=rq(K);return Q0(sr(x00),K,Q,u0);case 11:var e0=x[2],f0=x[1];return p(sr(r00),e0,f0);case 12:var a0=x[1];return d(sr(e00),a0);case 13:var Z=x[1];return d(sr(t00),Z);case 14:return x[1]?Mx(u00,n00):Mx(f00,i00);case 15:var v0=x[1],t0=x[4],y0=x[3],n0=x[2]?c00:s00,s0=y0?a00:o00,l0=t0?Mx(v00,v0):v0;return Q0(sr(l00),n0,s0,l0);case 16:return p00;case 17:var w0=x[2],L0=x[1],I0=tq(45,w0);if(I0)var j0=I0[1],S0=I0[2]?xq(NQ,[0,j0,dn(rq,I0[2])]):j0;else var S0=w0;var W0=L0?k00:m00;return Q0(sr(h00),w0,S0,W0);case 18:var A0=x[1]?d00:y00;return d(sr(g00),A0);case 19:var J0=x[1];return d(sr(w00),J0);case 20:var b0=t6<=x[1]?_00:b00;return d(sr(T00),b0);case 21:var z=x[1];return d(sr(E00),z);case 22:var C0=x[1];return d(sr(S00),C0);case 23:var V0=x[2],N0=x[1];return p(sr(A00),N0,V0);case 24:var rx=x[1];if(Jl===rx)var xx=j00,nx=O00;else if(l6<=rx)var xx=P00,nx=I00;else var xx=N00,nx=C00;return p(sr(D00),nx,xx);case 25:var mx=x[1];return d(sr(F00),mx);case 26:var F0=x[1];return d(sr(R00),F0);case 27:var px=x[2],dx=x[1];return p(sr(L00),dx,px);case 28:var W=x[2],g0=x[1];return p(sr(M00),g0,W);default:var B=x[1];return d(sr(q00),B)}}function yE0(x,r){var e=x[2];function t(_){return A1(_,r)}var u=x[1];switch(e[0]){case 0:var i=e[1],c=j5(i[2],r),jx=[0,[0,i[1],c]];break;case 1:var v=e[1],a=t(v[2]),jx=[1,[0,v[1],a]];break;case 2:var l=e[1],m=t(l[7]),jx=[2,[0,l[1],l[2],l[3],l[4],l[5],l[6],m]];break;case 3:var h=e[1],T=h[7],b=t(h[6]),jx=[3,[0,h[1],h[2],h[3],h[4],h[5],b,T]];break;case 4:var N=e[1],C=t(N[2]),jx=[4,[0,N[1],C]];break;case 5:var jx=[5,[0,t(e[1][1])]];break;case 6:var I=e[1],F=t(I[7]),jx=[6,[0,I[1],I[2],I[3],I[4],I[5],I[6],F]];break;case 7:var M=e[1],Y=t(M[5]),jx=[7,[0,M[1],M[2],M[3],M[4],Y]];break;case 8:var q=e[1],K=t(q[3]),jx=[8,[0,q[1],q[2],K]];break;case 9:var u0=e[1],Q=t(u0[5]),jx=[9,[0,u0[1],u0[2],u0[3],u0[4],Q]];break;case 10:var e0=e[1],f0=t(e0[4]),jx=[10,[0,e0[1],e0[2],e0[3],f0]];break;case 11:var a0=e[1],Z=t(a0[5]),jx=[11,[0,a0[1],a0[2],a0[3],a0[4],Z]];break;case 12:var v0=e[1],t0=t(v0[3]),jx=[12,[0,v0[1],v0[2],t0]];break;case 13:var y0=e[1],n0=t(y0[2]),jx=[13,[0,y0[1],n0]];break;case 14:var s0=e[1],l0=t(s0[3]),jx=[14,[0,s0[1],s0[2],l0]];break;case 15:var w0=e[1],L0=t(w0[4]),jx=[15,[0,w0[1],w0[2],w0[3],L0]];break;case 16:var I0=e[1],j0=t(I0[5]),jx=[16,[0,I0[1],I0[2],I0[3],I0[4],j0]];break;case 17:var S0=e[1],W0=t(S0[4]),jx=[17,[0,S0[1],S0[2],S0[3],W0]];break;case 18:var A0=e[1],J0=t(A0[3]),jx=[18,[0,A0[1],A0[2],J0]];break;case 19:var jx=[19,[0,t(e[1][1])]];break;case 20:var b0=e[1],z=t(b0[3]),jx=[20,[0,b0[1],b0[2],z]];break;case 21:var C0=e[1],V0=t(C0[3]),jx=[21,[0,C0[1],C0[2],V0]];break;case 22:var N0=e[1],rx=t(N0[5]),jx=[22,[0,N0[1],N0[2],N0[3],N0[4],rx]];break;case 23:var xx=e[1],nx=t(xx[3]),jx=[23,[0,xx[1],xx[2],nx]];break;case 24:var mx=e[1],F0=t(mx[5]),jx=[24,[0,mx[1],mx[2],mx[3],mx[4],F0]];break;case 25:var px=e[1],dx=t(px[5]),jx=[25,[0,px[1],px[2],px[3],px[4],dx]];break;case 26:var W=e[1],g0=t(W[5]),jx=[26,[0,W[1],W[2],W[3],W[4],g0]];break;case 27:var B=e[1],h0=B[11],_0=t(B[10]),jx=[27,[0,B[1],B[2],B[3],B[4],B[5],B[6],B[7],B[8],B[9],_0,h0]];break;case 28:var d0=e[1],E0=t(d0[4]),jx=[28,[0,d0[1],d0[2],d0[3],E0]];break;case 29:var U=e[1],Kx=t(U[5]),jx=[29,[0,U[1],U[2],U[3],U[4],Kx]];break;case 30:var Ix=e[1],z0=t(Ix[5]),jx=[30,[0,Ix[1],Ix[2],Ix[3],Ix[4],z0]];break;case 31:var Kr=e[1],S=t(Kr[3]),jx=[31,[0,Kr[1],Kr[2],S]];break;case 32:var G=e[1],Z0=t(G[3]),jx=[32,[0,G[1],G[2],Z0]];break;case 33:var yx=e[1],Tx=yx[3],ex=t(yx[2]),jx=[33,[0,yx[1],ex,Tx]];break;case 34:var m0=e[1],Dx=m0[4],Ex=t(m0[3]),jx=[34,[0,m0[1],m0[2],Ex,Dx]];break;case 35:var qx=e[1],O0=t(qx[2]),jx=[35,[0,qx[1],O0]];break;case 36:var Wx=e[1],Yx=t(Wx[4]),jx=[36,[0,Wx[1],Wx[2],Wx[3],Yx]];break;case 37:var fx=e[1],Qx=t(fx[4]),jx=[37,[0,fx[1],fx[2],fx[3],Qx]];break;case 38:var vx=e[1],nr=t(vx[5]),jx=[38,[0,vx[1],vx[2],vx[3],vx[4],nr]];break;case 39:var gr=e[1],Nr=t(gr[3]),jx=[39,[0,gr[1],gr[2],Nr]];break;case 40:var s2=e[1],b2=t(s2[3]),jx=[40,[0,s2[1],s2[2],b2]];break;default:var k2=e[1],F2=t(k2[3]),jx=[41,[0,k2[1],k2[2],F2]]}return[0,u,jx]}var gE0=hv(eO)===i2?eO:eO[1];zN(DS,gE0);var ya=o0,C1=null,JY=void 0;function Vh(x){return 1-(x===JY?1:0)}ya.String,ya.RegExp,ya.Object,ya.Date,ya.Math;function wE0(x){throw x}function GY(x){return d(wE0,x)}ya.JSON;var _E0=ya.Array,bE0=ya.Error;mC(function(x){return x[1]===rO?[0,jt(x[2].toString())]:0}),mC(function(x){return x instanceof _E0?0:[0,jt(x.toString())]});var WY=[0,0];function Es(x){return xK(L6(x))}function $2(x){return fM(L6(x))}function pr(x,r){return $2(tx(p5(x,r)))}function gx(x,r){return r?d(x,r[1]):C1}function yl(x,r){return r[0]===0?C1:x(r[1])}function VY(x){return Es([0,[0,vb0,x[1]],[0,[0,ob0,x[2]],0]])}function $Y(x){var r=x[1],e=r?Gx(r[1][1]):C1,t=[0,[0,cb0,VY(x[3])],0];return Es([0,[0,ab0,e],[0,[0,sb0,VY(x[2])],t]])}function _2(x){if(!x)return 0;var r=x[1],e=r[1];return x0([0,e],[0,Lx(r[3],r[2])],O)}var TE0=Gx;function gl(x,r,e){var t=r[e];return Vh(t)?t|0:x}function EE0(x,r){var e=Y3(r,JY)?{}:r,t=jt(x),u=gl(J3[6],e,db0),i=gl(J3[5],e,yb0),c=gl(J3[4],e,gb0),v=gl(J3[3],e,wb0),a=gl(J3[2],e,_b0),l=[0,gl(J3[1],e,bb0),a,v,c,i,u,0,0],m=e[WO],h=Vh(m),T=h&&m|0,b=e[wO],N=Vh(b)?b|0:1,C=e.all_comments,I=Vh(C)?C|0:1,F=[0,0],M=T?[0,function(X){return F[1]=[0,X,F[1]],0}]:0,Y=0,q=hb0[1];try{var K=0,u0=mB(t),Q=K,e0=u0}catch(X){var f0=B2(X);if(f0!==Qa)throw K0(f0,0);var a0=[0,[0,[0,Y,K3[2],K3[3]],48],0],Q=a0,e0=mB(cs0)}var Z=[0,Y,e0,X00,0,l[5],PB,Y00],v0=[0,r4(Z,0)],t0=[0,[0,Q],[0,0],N1[1],[0,0],l[6],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,[0,as0],[0,Z],v0,[0,M],l,Y,[0,0],[0,ss0]],y0=d(X0[1],t0),n0=tx(t0[1][1]),s0=tx(m1(function(X,A){var D=X[2],c0=X[1];return vj[3].call(null,A,c0)?[0,c0,D]:[0,vj[4].call(null,A,c0),[0,A,D]]},[0,vj[1],0],n0)[2]);if(s0){var l0=s0[2],w0=s0[1];if(q)throw K0([0,hE0,w0,l0],1)}WY[1]=0;var L0=Cx(t)-0|0,I0=Ct(t);x:{r:{for(var j0=0,S0=0;;){if(S0===L0)break r;var W0=ae(I0,S0);e:{if(0<=W0&&Xr>=W0){var A0=1;break e}if(NI<=W0&&dk>=W0){var A0=2;break e}if(qo<=W0&&By>=W0){var A0=3;break e}if(b3<=W0&&Go>=W0){var A0=4;break e}var A0=0}if(A0===0)var j0=oj(j0,S0,0),S0=S0+1|0;else{if((L0-S0|0)>>0)throw K0([0,Ir,$V],1);switch(J0){case 0:var z=ae(I0,S0);break;case 1:var z=(ae(I0,S0)&31)<<6|ae(I0,S0+1|0)&63;break;case 2:var z=(ae(I0,S0)&15)<<12|(ae(I0,S0+1|0)&63)<<6|ae(I0,S0+2|0)&63;break;default:var z=(ae(I0,S0)&7)<<18|(ae(I0,S0+1|0)&63)<<12|(ae(I0,S0+2|0)&63)<<6|ae(I0,S0+3|0)&63}var j0=oj(j0,S0,[0,z]),S0=b0}}var C0=oj(j0,S0,0);break x}var C0=j0}for(var V0=ko0,N0=tx([0,6,C0]);;){var rx=V0[3],xx=V0[2],nx=V0[1];if(!N0)break;var mx=N0[1];if(mx===5){var F0=N0[2];if(F0&&F0[1]===6){var px=F0[2],V0=[0,nx+2|0,0,[0,L6(tx([0,nx,xx])),rx]],N0=px;continue}}else if(6>mx){var dx=N0[2],V0=[0,nx+LU(mx)|0,[0,nx,xx],rx],N0=dx;continue}var W=N0[2],g0=[0,L6(tx([0,nx,xx])),rx],V0=[0,nx+LU(mx)|0,0,g0],N0=W}var B=L6(tx(rx));if(N)var _0=y0;else var h0=d(mE0[1],0),_0=p(Xx(h0,-201766268,F1),h0,y0);if(I)var E0=_0;else var d0=_0[2],E0=[0,_0[1],[0,d0[1],d0[2],d0[3],0]];function U(X,A,D,c0){var k0=[0,dh(B,A[3]),0],M0=[0,[0,t60,$2([0,dh(B,A[2]),k0])],0],$0=Lx(M0,[0,[0,n60,$Y(A)],0]);if(D){var lx=D[1],Nx=lx[1];if(Nx){var Fx=lx[2];if(Fx)var ur=[0,[0,u60,Aa(Fx)],0],Jx=[0,[0,i60,Aa(Nx)],ur];else var Jx=[0,[0,f60,Aa(Nx)],0];var er=Jx}else var xr=lx[2],ar=xr?[0,[0,c60,Aa(xr)],0]:0,er=ar;var yr=er}else var yr=0;return Es(G3(Lx($0,Lx(yr,[0,[0,s60,Gx(X)],0])),c0))}function Kx(X){return pr(Ix,X)}function Ix(X){var A=X[2],D=X[1];switch(A[0]){case 0:return Yx([0,D,A[1]]);case 1:var c0=A[1],k0=c0[2];return U(h60,D,k0,[0,[0,m60,gx(m0,c0[1])],0]);case 2:return $(a50,[0,D,A[1]]);case 3:var M0=A[1],$0=M0[3],lx=M0[6],Nx=M0[5],Fx=M0[4],ur=M0[2],Jx=M0[1],xr=A1(_2($0[2][3]),lx),ar=[0,[0,eh0,gx(Q2,ur)],0],er=[0,[0,th0,ba(Fx)],ar],yr=$0[2],Cr=yr[2],Rx=yr[1];if(Cr)var Lr=Cr[1],Tr=Lr[2],e2=Tr[2],m2=Lr[1],h2=U(sh0,m2,e2,[0,[0,ch0,hr(Tr[1])],0]),Fr=$2(tx([0,h2,p5(wx,Rx)]));else var Fr=$2(dn(wx,Rx));var d2=[0,[0,uh0,m0(Jx)],[0,[0,nh0,Fr],er]];return U(fh0,D,xr,[0,[0,ih0,Yx(Nx)],d2]);case 4:var t2=A[1],Er=t2[2];return U(y60,D,Er,[0,[0,d60,gx(m0,t2[1])],0]);case 5:return U(g60,D,A[1][1],0);case 6:return vx([0,D,A[1]]);case 7:return nr([0,D,A[1]]);case 8:return b2([0,D,A[1]]);case 9:var Sr=A[1],a2=Sr[5],qr=Sr[4],Qr=Sr[3],z2=Sr[2],Mr=Sr[1];if(Qr){var n2=Qr[1];if(n2[0]!==0&&!n2[1][2])return U(_60,D,a2,[0,[0,w60,gx(T2,qr)],0])}if(z2){var o2=z2[1];switch(o2[0]){case 0:var f2=fx(o2[1]);break;case 1:var f2=Qx(o2[1]);break;case 2:var f2=vx(o2[1]);break;case 3:var f2=nr(o2[1]);break;case 4:var f2=dr(o2[1]);break;case 5:var f2=jx(o2[1]);break;case 6:var f2=_(1,o2[1]);break;case 7:var f2=Hx(o2[1]);break;default:var f2=b2(o2[1])}var N2=f2}else var N2=C1;var he=[0,[0,b60,gx(T2,qr)],0],ee=[0,[0,E60,N2],[0,[0,T60,F2(Qr)],he]],He=Mr?1:0;return U(A60,D,a2,[0,[0,S60,!!He],ee]);case 10:return Qx([0,D,A[1]]);case 11:var B1=A[1],u2=B1[5],te=B1[4],R2=B1[2],dt=B1[1],D1=[0,[0,Um0,pr(x2,B1[3])],0],yt=[0,[0,Xm0,An(0,te)],D1],Jt=[0,[0,Ym0,gx(Q2,R2)],yt];return U(Km0,D,u2,[0,[0,zm0,m0(dt)],Jt]);case 12:var Ze=A[1],xt=Ze[1],gt=Ze[3],wt=Ze[2],Ax=xt[0]===0?m0(xt[1]):T2(xt[1]);return U(N60,D,gt,[0,[0,I60,Ax],[0,[0,P60,Yx(wt)],0]]);case 13:var Z2=A[1],de=Z2[2];return U(j60,D,de,[0,[0,C60,me(Z2[1])],0]);case 14:var je=A[1],rt=je[3],et=je[2],tt=m0(je[1]);return U(F60,D,rt,[0,[0,D60,tt],[0,[0,O60,Yx(et)],0]]);case 15:var x1=A[1],_t=x1[4],bt=x1[2],Is=x1[1],Ns=[0,[0,$m0,dr(x1[3])],0],In=[0,[0,Qm0,gx(Q2,bt)],Ns];return U(Zm0,D,_t,[0,[0,Hm0,m0(Is)],In]);case 16:return _(1,[0,D,A[1]]);case 17:return fx([0,D,A[1]]);case 18:var v1=A[1],Gt=v1[3],U1=v1[1],Oe=[0,[0,R60,z0(v1[2])],0];return U(M60,D,Gt,[0,[0,L60,Ix(U1)],Oe]);case 19:return U(q60,D,A[1][1],0);case 20:var Wt=A[1],Cs=Wt[3],Nn=Wt[1],js=[0,[0,Hh0,Or(Wt[2])],0];return U(xd0,D,Cs,[0,[0,Zh0,m0(Nn)],js]);case 21:var nt=A[1],Vt=nt[2],Tt=nt[3],$t=Vt[0]===0?Ix(Vt[1]):z0(Vt[1]);return U(X60,D,Tt,[0,[0,U60,$t],[0,[0,B60,Gx(k2(1))],0]]);case 22:var De=A[1],Os=De[5],Ds=De[4],Kv=De[3],Eo=De[2],So=De[1];if(Eo){var Jv=Eo[1];if(Jv[0]!==0){var Gv=Jv[1][2],Wv=[0,[0,Y60,Gx(k2(Ds))],0],Vv=[0,[0,z60,gx(m0,Gv)],Wv];return U(J60,D,Os,[0,[0,K60,gx(T2,Kv)],Vv])}}var Ao=[0,[0,G60,Gx(k2(Ds))],0],Sl=[0,[0,W60,gx(T2,Kv)],Ao],Al=[0,[0,V60,F2(Eo)],Sl];return U(Q60,D,Os,[0,[0,$60,gx(Ix,So)],Al]);case 23:var Pa=A[1],Po=Pa[3],$v=Pa[1],Pl=[0,[0,H60,gx(TE0,Pa[2])],0];return U(x40,D,Po,[0,[0,Z60,z0($v)],Pl]);case 24:var Cn=A[1],Qv=Cn[5],Hv=Cn[3],Il=Cn[2],Io=Cn[1],Zv=[0,[0,r40,Ix(Cn[4])],0],x3=[0,[0,e40,gx(z0,Hv)],Zv],Ia=[0,[0,t40,gx(z0,Il)],x3];return U(u40,D,Qv,[0,[0,n40,gx(function(nO){return nO[0]===0?Qe(nO[1]):z0(nO[1])},Io)],Ia]);case 25:var Fs=A[1],Na=Fs[1],Nl=Fs[5],No=Fs[4],Co=Fs[3],r3=Fs[2],Cl=Na[0]===0?Qe(Na[1]):hr(Na[1]),jo=[0,[0,f40,Ix(Co)],[0,[0,i40,!!No],0]];return U(a40,D,Nl,[0,[0,s40,Cl],[0,[0,c40,z0(r3)],jo]]);case 26:var Rs=A[1],Oo=Rs[1],e3=Rs[5],Ca=Rs[4],t3=Rs[3],n3=Rs[2],u3=Oo[0]===0?Qe(Oo[1]):hr(Oo[1]),ye=[0,[0,v40,Ix(t3)],[0,[0,o40,!!Ca],0]];return U(k40,D,e3,[0,[0,p40,u3],[0,[0,l40,z0(n3)],ye]]);case 27:var X1=A[1],i3=X1[3],Do=X1[2],jl=X1[10],Ol=X1[9],Fo=X1[8],Ro=X1[7],Dl=X1[6],Fl=X1[5],xd=X1[4],Rl=Do[2][4],rd=X1[1],Qt=i3[0]===0?i3[1]:bx(y80),jn=A1(_2(Rl),jl);if(Dl===0)var Lo=0,C4=g80;else var Lo=[0,[0,T80,!!xd],[0,[0,b80,!!Fl],[0,[0,_80,gx(zv,Ro)],[0,[0,w80,!1],0]]]],C4=E80;var ja=[0,[0,S80,gx(Q2,Ol)],0],Ll=[0,[0,A80,Ur(Fo)],ja],ed=[0,[0,P80,Yx(Qt)],Ll],td=[0,[0,I80,sx(Do)],ed];return U(C4,D,jn,Lx([0,[0,N80,gx(m0,rd)],td],Lo));case 28:var f3=A[1],j4=f3[3],nd=f3[4],ud=f3[2],id=f3[1];if(j4)var Ml=j4[1][2],n=Ix(yE0(Ml[1],Ml[2]));else var n=C1;var s=[0,[0,h40,Ix(ud)],[0,[0,m40,n],0]];return U(y40,D,nd,[0,[0,d40,z0(id)],s]);case 29:var f=A[1],o=f[4],k=f[3],g=f[5],E=f[2],j=f[1];if(o){var R=o[1];if(R[0]===0)var R0=dn(function(uO){var fd=uO[3],cd=uO[2],ZY=uO[1],AE0=cd?Vr(fd[1],cd[1][1]):fd[1],PE0=cd?cd[1]:fd;x:{r:{var IE0=0;if(ZY){switch(ZY[1]){case 0:var xz=Yf;break;case 1:var xz=Ws;break;default:break r}var rz=xz;break x}}var rz=C1}var NE0=[0,[0,K_0,m0(PE0)],[0,[0,z_0,rz],IE0]];return U(G_0,AE0,0,[0,[0,J_0,m0(fd)],NE0])},R[1]);else var H=R[1],p0=H[1],R0=[0,U(Y_0,p0,0,[0,[0,X_0,m0(H[2])],0]),0];var kx=R0}else var kx=0;if(k)var Bx=k[1][1],zx=[0,[0,B_0,m0(Bx)],0],wr=[0,U(U_0,Bx[1],0,zx),kx];else var wr=kx;switch(j){case 0:var Jr=g40;break;case 1:var Jr=w40;break;default:var Jr=_40}var Hr=[0,[0,T40,T2(E)],[0,[0,b40,Gx(Jr)],0]];return U(S40,D,g,[0,[0,E40,$2(wr)],Hr]);case 30:return Hx([0,D,A[1]]);case 31:var Vx=A[1],C2=Vx[3],r1=Vx[1],ne=[0,[0,A40,Ix(Vx[2])],0];return U(I40,D,C2,[0,[0,P40,m0(r1)],ne]);case 32:var Y1=A[1],ge=Y1[3],Fe=Y1[1],we=[0,[0,N40,pr(S,Y1[2])],0];return U(j40,D,ge,[0,[0,C40,z0(Fe)],we]);case 33:var ue=A[1],_e=ue[2];return U(D40,D,_e,[0,[0,O40,gx(z0,ue[1])],0]);case 34:var ut=A[1],be=ut[3],Ht=ut[1],Ls=[0,[0,F40,pr(O0,ut[2])],0];return U(L40,D,be,[0,[0,R40,z0(Ht)],Ls]);case 35:var On=A[1],Ms=On[2];return U(q40,D,Ms,[0,[0,M40,z0(On[1])],0]);case 36:var Et=A[1],qs=Et[4],c3=Et[2],s3=Et[1],a3=[0,[0,B40,gx(Yx,Et[3])],0],o3=[0,[0,U40,gx(Wx,c3)],a3];return U(Y40,D,qs,[0,[0,X40,Yx(s3)],o3]);case 37:return jx([0,D,A[1]]);case 38:return _(0,[0,D,A[1]]);case 39:return Qe([0,D,A[1]]);case 40:var Oa=A[1],_x=Oa[3],O4=Oa[1],hx=[0,[0,z40,Ix(Oa[2])],0];return U(J40,D,_x,[0,[0,K40,z0(O4)],hx]);default:var D4=A[1],tO=D4[3],ax=D4[1],SE0=[0,[0,G40,Ix(D4[2])],0];return U(V40,D,tO,[0,[0,W40,z0(ax)],SE0])}}function z0(X){var A=X[2],D=X[1];switch(A[0]){case 0:var c0=A[1],k0=c0[2],M0=[0,[0,$40,pr(zt,c0[1])],0];return U(Q40,D,_2(k0),M0);case 1:var $0=A[1],lx=$0[3],Nx=$0[2],Fx=$0[10],ur=$0[9],Jx=$0[8],xr=$0[7],ar=$0[4],er=Nx[2][4];if(lx[0]===0)var yr=0,Cr=Yx(lx[1]);else var yr=1,Cr=z0(lx[1]);var Rx=A1(_2(er),Fx),Lr=[0,[0,H40,gx(Q2,ur)],0],Tr=[0,[0,xp0,!!yr],[0,[0,Z40,Ur(Jx)],Lr]],e2=[0,[0,np0,Cr],[0,[0,tp0,!!ar],[0,[0,ep0,!1],[0,[0,rp0,gx(zv,xr)],Tr]]]];return U(fp0,D,Rx,[0,[0,ip0,C1],[0,[0,up0,sx(Nx)],e2]]);case 2:var m2=A[1],h2=m2[2];return U(sp0,D,h2,[0,[0,cp0,z0(m2[1])],0]);case 3:var Fr=A[1],d2=Fr[3],t2=Fr[1],Er=[0,[0,ap0,dr(Fr[2][2])],0];return U(vp0,D,d2,[0,[0,op0,z0(t2)],Er]);case 4:var Sr=A[1],a2=Sr[1],qr=Sr[4],Qr=Sr[3],z2=Sr[2];if(a2){switch(a2[1]){case 0:var Mr=rQ;break;case 1:var Mr=eQ;break;case 2:var Mr=tQ;break;case 3:var Mr=nQ;break;case 4:var Mr=uQ;break;case 5:var Mr=iQ;break;case 6:var Mr=fQ;break;case 7:var Mr=cQ;break;case 8:var Mr=sQ;break;case 9:var Mr=aQ;break;case 10:var Mr=oQ;break;case 11:var Mr=vQ;break;case 12:var Mr=lQ;break;case 13:var Mr=pQ;break;default:var Mr=kQ}var n2=Mr}else var n2=lp0;var o2=[0,[0,pp0,z0(Qr)],0];return U(hp0,D,qr,[0,[0,mp0,Gx(n2)],[0,[0,kp0,hr(z2)],o2]]);case 5:var f2=A[1],N2=f2[4],he=f2[2],ee=f2[1],He=[0,[0,dp0,z0(f2[3])],0],B1=[0,[0,yp0,z0(he)],He];switch(ee){case 0:var u2=O$;break;case 1:var u2=D$;break;case 2:var u2=F$;break;case 3:var u2=R$;break;case 4:var u2=L$;break;case 5:var u2=M$;break;case 6:var u2=q$;break;case 7:var u2=B$;break;case 8:var u2=U$;break;case 9:var u2=X$;break;case 10:var u2=Y$;break;case 11:var u2=z$;break;case 12:var u2=K$;break;case 13:var u2=J$;break;case 14:var u2=G$;break;case 15:var u2=W$;break;case 16:var u2=V$;break;case 17:var u2=$$;break;case 18:var u2=Q$;break;case 19:var u2=H$;break;case 20:var u2=Z$;break;default:var u2=xQ}return U(wp0,D,N2,[0,[0,gp0,Gx(u2)],B1]);case 6:var te=A[1],R2=te[4],dt=A1(_2(te[3][2][2]),R2);return U(_p0,D,dt,bl(te));case 7:return $(o50,[0,D,A[1]]);case 8:var D1=A[1],yt=D1[4],Jt=D1[2],Ze=D1[1],xt=[0,[0,bp0,z0(D1[3])],0],gt=[0,[0,Tp0,z0(Jt)],xt];return U(Sp0,D,yt,[0,[0,Ep0,z0(Ze)],gt]);case 9:return ex([0,D,A[1]]);case 10:return m0(A[1]);case 11:var wt=A[1],Ax=wt[2];return U(Pp0,D,Ax,[0,[0,Ap0,z0(wt[1])],0]);case 12:return Ps([0,D,A[1]]);case 13:return go([0,D,A[1]]);case 14:return T2([0,D,A[1]]);case 15:return En([0,D,A[1]]);case 16:return Sn([0,D,A[1]]);case 17:return O1([0,D,A[1]]);case 18:return q1([0,D,A[1]]);case 19:var Z2=A[1],de=Z2[2],je=Z2[1],rt=Z2[4],et=Z2[3];try{var tt=new RegExp(Gx(je),Gx(de)),x1=tt}catch{var x1=C1}return U(wy0,D,rt,[0,[0,gy0,x1],[0,[0,yy0,Gx(et)],[0,[0,dy0,Es([0,[0,hy0,Gx(je)],[0,[0,my0,Gx(de)],0]])],0]]]);case 20:var _t=A[1];return T2([0,D,[0,_t[1],_t[6],_t[7]]]);case 21:var bt=A[1],Is=bt[4],Ns=bt[3],In=bt[2];switch(bt[1]){case 0:var v1=Ip0;break;case 1:var v1=Np0;break;default:var v1=Cp0}var Gt=[0,[0,jp0,z0(Ns)],0];return U(Fp0,D,Is,[0,[0,Dp0,Gx(v1)],[0,[0,Op0,z0(In)],Gt]]);case 22:var U1=A[1],Oe=U1[5],Wt=U1[1],Cs=[0,[0,Rp0,pr(Kr,U1[2])],0];return U(Mp0,D,Oe,[0,[0,Lp0,z0(Wt)],Cs]);case 23:var Nn=A[1],js=Nn[3];return U(qp0,D,js,Tl(Nn));case 24:var nt=A[1],Vt=nt[3],Tt=nt[1],$t=[0,[0,Bp0,m0(nt[2])],0];return U(Xp0,D,Vt,[0,[0,Up0,m0(Tt)],$t]);case 25:var De=A[1],Os=De[4],Ds=De[3],Kv=De[2],Eo=De[1];if(Ds)var So=Ds[1],Jv=A1(_2(So[2][2]),Os),Gv=Jv,Wv=qx(So);else var Gv=Os,Wv=$2(0);var Vv=[0,[0,zp0,gx(ho,Kv)],[0,[0,Yp0,Wv],0]];return U(Jp0,D,Gv,[0,[0,Kp0,z0(Eo)],Vv]);case 26:var Ao=A[1],Sl=Ao[2],Al=[0,[0,Gp0,pr(Y2,Ao[1])],0];return U(Wp0,D,_2(Sl),Al);case 27:var Pa=A[1],Po=Pa[1],$v=Pa[3],Pl=Po[4],Cn=A1(_2(Po[3][2][2]),Pl);return U($p0,D,Cn,Lx(bl(Po),[0,[0,Vp0,!!$v],0]));case 28:var Qv=A[1],Hv=Qv[1],Il=Hv[3],Io=[0,[0,Qp0,!!Qv[3]],0];return U(Hp0,D,Il,Lx(Tl(Hv),Io));case 29:var Zv=A[1],x3=Zv[2];return U(xk0,D,x3,[0,[0,Zp0,pr(z0,Zv[1])],0]);case 30:return U(rk0,D,A[1][1],0);case 31:var Ia=A[1],Fs=Ia[3],Na=Ia[1],Nl=[0,[0,Oy0,Ss(Ia[2])],0];return U(Fy0,D,Fs,[0,[0,Dy0,z0(Na)],Nl]);case 32:return Ss([0,D,A[1]]);case 33:return U(ek0,D,A[1][1],0);case 34:var No=A[1],Co=No[3],r3=No[1],Cl=[0,[0,tk0,me(No[2])],0];return U(uk0,D,Co,[0,[0,nk0,z0(r3)],Cl]);case 35:var jo=A[1],Rs=jo[3],Oo=jo[1],e3=[0,[0,ik0,dr(jo[2][2])],0];return U(ck0,D,Rs,[0,[0,fk0,z0(Oo)],e3]);case 36:var Ca=A[1],t3=Ca[3],n3=Ca[2],u3=Ca[1];if(7<=u3)return U(ak0,D,t3,[0,[0,sk0,z0(n3)],0]);switch(u3){case 0:var ye=ok0;break;case 1:var ye=vk0;break;case 2:var ye=lk0;break;case 3:var ye=pk0;break;case 4:var ye=kk0;break;case 5:var ye=mk0;break;case 6:var ye=hk0;break;default:var ye=bx(dk0)}return U(_k0,D,t3,[0,[0,wk0,Gx(ye)],[0,[0,gk0,!0],[0,[0,yk0,z0(n3)],0]]]);case 37:var X1=A[1],i3=X1[4],Do=X1[3],jl=X1[2],Ol=X1[1]?bk0:Tk0;return U(Pk0,D,i3,[0,[0,Ak0,Gx(Ol)],[0,[0,Sk0,z0(jl)],[0,[0,Ek0,!!Do],0]]]);default:var Fo=A[1],Ro=Fo[2],Dl=[0,[0,Ik0,!!Fo[3]],0];return U(Ck0,D,Ro,[0,[0,Nk0,gx(z0,Fo[1])],Dl])}}function Kr(X){var A=X[2],D=A[4],c0=A[2],k0=A[1],M0=X[1],$0=[0,[0,jk0,gx(z0,A[3])],0],lx=[0,[0,Ok0,z0(c0)],$0];return U(Fk0,M0,D,[0,[0,Dk0,G(k0)],lx])}function S(X){var A=X[2],D=A[4],c0=A[2],k0=A[1],M0=X[1],$0=[0,[0,Rk0,gx(z0,A[3])],0],lx=[0,[0,Lk0,Yx(c0)],$0];return U(qk0,M0,D,[0,[0,Mk0,G(k0)],lx])}function G(X){var A=X[2],D=X[1];function c0(qr){return U(Wk0,D,0,[0,[0,Gk0,qr],0])}switch(A[0]){case 0:return U(Vk0,D,A[1],0);case 1:return c0(O1([0,D,A[1]]));case 2:return c0(q1([0,D,A[1]]));case 3:return c0(T2([0,D,A[1]]));case 4:return c0(En([0,D,A[1]]));case 5:return c0(Sn([0,D,A[1]]));case 6:var k0=A[1],M0=k0[2],$0=k0[3],lx=k0[1]?$k0:Qk0,Nx=M0[2],Fx=M0[1],ur=Nx[0]===0?O1([0,Fx,Nx[1]]):q1([0,Fx,Nx[1]]);return U(x80,D,$0,[0,[0,Zk0,Gx(lx)],[0,[0,Hk0,ur],0]]);case 7:return yx([0,D,A[1]]);case 8:return Z0(A[1]);case 9:var Jx=function(qr){var Qr=qr[2],z2=Qr[2],Mr=Qr[1],n2=Qr[3],o2=qr[1],f2=0;switch(z2[0]){case 0:var N2=T2(z2[1]);break;case 1:var N2=O1(z2[1]);break;default:var N2=m0(z2[1])}var he=[0,[0,zk0,N2],f2],ee=Mr[0]===0?Z0(Mr[1]):Jx(Mr[1]);return U(Jk0,o2,n2,[0,[0,Kk0,ee],he])};return Jx(A[1]);case 10:var xr=A[1],ar=xr[3],er=xr[1],yr=[0,[0,r80,gx(Tx,xr[2])],0],Cr=[0,[0,e80,pr(function(qr){var Qr=qr[2],z2=Qr[1],Mr=Qr[4],n2=qr[1],o2=[0,[0,Bk0,!!Qr[3]],0],f2=[0,[0,Uk0,G(Qr[2])],o2];switch(z2[0]){case 0:var N2=T2(z2[1]);break;case 1:var N2=O1(z2[1]);break;default:var N2=m0(z2[1])}return U(Yk0,n2,Mr,[0,[0,Xk0,N2],f2])},er)],yr];return U(t80,D,_2(ar),Cr);case 11:var Rx=A[1],Lr=Rx[3],Tr=Rx[1],e2=[0,[0,n80,gx(Tx,Rx[2])],0],m2=[0,[0,u80,pr(function(qr){return G(qr[2])},Tr)],e2];return U(i80,D,_2(Lr),m2);case 12:var h2=A[1],Fr=h2[2];return U(c80,D,Fr,[0,[0,f80,pr(G,h2[1])],0]);default:var d2=A[1],t2=d2[2],Er=d2[3],Sr=d2[1],a2=t2[0]===0?m0(t2[1]):yx([0,t2[1],t2[2]]);return U(o80,D,Er,[0,[0,a80,G(Sr)],[0,[0,s80,a2],0]])}}function Z0(X){var A=X[1];return U(l80,A,0,[0,[0,v80,m0(X)],0])}function yx(X){var A=X[2],D=A[3],c0=A[2],k0=X[1],M0=[0,[0,p80,Gx(YC(A[1]))],0];return U(m80,k0,D,[0,[0,k80,m0(c0)],M0])}function Tx(X){var A=X[2],D=A[2],c0=X[1];return U(d80,c0,D,[0,[0,h80,gx(yx,A[1])],0])}function ex(X){var A=X[2],D=A[3],c0=A[2],k0=A[10],M0=A[9],$0=A[8],lx=A[7],Nx=A[5],Fx=A[4],ur=c0[2][4],Jx=A[1],xr=X[1],ar=D[0]===0?D[1]:bx(C80),er=A1(_2(ur),k0),yr=[0,[0,j80,gx(Q2,M0)],0],Cr=[0,[0,D80,!1],[0,[0,O80,Ur($0)],yr]],Rx=[0,[0,L80,!!Fx],[0,[0,R80,!!Nx],[0,[0,F80,gx(zv,lx)],Cr]]],Lr=[0,[0,M80,Yx(ar)],Rx],Tr=[0,[0,q80,sx(c0)],Lr];return U(U80,xr,er,[0,[0,B80,gx(m0,Jx)],Tr])}function m0(X){var A=X[2];return U(K80,X[1],A[2],[0,[0,z80,Gx(A[1])],[0,[0,Y80,C1],[0,[0,X80,!1],0]]])}function Dx(X){var A=X[2];return U(V80,X[1],A[2],[0,[0,W80,Gx(A[1])],[0,[0,G80,C1],[0,[0,J80,!1],0]]])}function Ex(X,A){var D=A[1][2],c0=D[2],k0=D[1],M0=[0,[0,$80,!!A[3]],0];return U(Z80,X,c0,[0,[0,H80,Gx(k0)],[0,[0,Q80,yl(me,A[2])],M0]])}function qx(X){return pr(kt,X[2][1])}function O0(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,xm0,pr(Ix,A[2])],0];return U(em0,k0,D,[0,[0,rm0,gx(z0,c0)],M0])}function Wx(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,tm0,Yx(A[2])],0];return U(um0,k0,D,[0,[0,nm0,gx(hr,c0)],M0])}function Yx(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,im0,Kx(A[1])],0];return U(fm0,c0,_2(D),k0)}function fx(X){var A=X[2],D=A[2],c0=A[1],k0=A[4],M0=A[3],$0=X[1],lx=Vr(c0[1],D[1]),Nx=[0,[0,cm0,Gx(YC(M0))],0];return U(am0,$0,k0,[0,[0,sm0,Ex(lx,[0,c0,[1,D],0])],Nx])}function Qx(X){var A=X[2],D=A[2],c0=A[1],k0=A[4],M0=A[3],$0=X[1],lx=Vr(c0[1],D[1]),Nx=D[2][2];x:{if(Nx[0]===12){var Fx=Nx[1][5];if(typeof Fx=="number"&&!Fx){var ur=0,Jx=om0;break x}}var ur=[0,[0,vm0,gx(zv,M0)],0],Jx=lm0}return U(Jx,$0,k0,Lx([0,[0,pm0,Ex(lx,[0,c0,[1,D],0])],0],ur))}function vx(X){var A=X[2],D=A[6],c0=A[4],k0=A[7],M0=A[5],$0=A[3],lx=A[2],Nx=A[1],Fx=X[1],ur=$2(c0?[0,x2(c0[1]),0]:0),Jx=D?pr(U0,D[1][2][1]):$2(0),xr=[0,[0,hm0,ur],[0,[0,mm0,Jx],[0,[0,km0,pr(x2,M0)],0]]],ar=[0,[0,dm0,An(0,$0)],xr],er=[0,[0,ym0,gx(Q2,lx)],ar];return U(wm0,Fx,k0,[0,[0,gm0,m0(Nx)],er])}function nr(X){var A=X[2],D=A[3],c0=X[1],k0=A[5],M0=A[4],$0=A[2],lx=A[1],Nx=A1(_2(D[2][3]),k0),Fx=D[2],ur=Fx[1],Jx=Fx[2],xr=[0,[0,_m0,gx(Q2,$0)],0],ar=[0,[0,bm0,ba(M0)],xr],er=[0,[0,Tm0,gr(ur)],ar],yr=[0,[0,Em0,gx(Nr,Jx)],er],Cr=[0,[0,Sm0,gr(ur)],yr];return U(Pm0,c0,Nx,[0,[0,Am0,m0(lx)],Cr])}function gr(X){return $2(dn(function(A){var D=A[2];return s2(0,D[3],A[1],[0,D[1]],D[2][2])},X))}function Nr(X){var A=X[2],D=A[4],c0=A[3],k0=A[2],M0=X[1];return s2(D,c0,M0,l5(function($0){return[0,$0]},A[1]),k0)}function s2(X,A,D,c0,k0){if(c0)var M0=c0[1],$0=M0[0]===0?gx(m0,[0,M0[1]]):gx(T2,[0,M0[1]]),lx=$0;else var lx=gx(m0,0);return U(Lm0,D,X,[0,[0,Rm0,lx],[0,[0,Fm0,dr(k0)],[0,[0,Dm0,!!A],0]]])}function b2(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,Mm0,Or(A[2])],0];return U(Bm0,k0,D,[0,[0,qm0,m0(c0)],M0])}function k2(X){return X?Jm0:Gm0}function F2(X){if(!X)return $2(0);var A=X[1];if(A[0]===0)return pr(E4,A[1]);var D=A[1],c0=D[2],k0=D[1];return $2(c0?[0,U(Vm0,k0,0,[0,[0,Wm0,m0(c0[1])],0]),0]:0)}function jx(X){var A=X[2],D=A[4],c0=A[2],k0=A[1],M0=X[1],$0=[0,[0,x50,dr(A[3])],0],lx=[0,[0,r50,gx(Q2,c0)],$0];return U(t50,M0,D,[0,[0,e50,m0(k0)],lx])}function _(X,A){var D=A[2],c0=D[5],k0=D[4],M0=D[3],$0=D[2],lx=D[1],Nx=A[1],Fx=X?n50:u50,ur=[0,[0,i50,gx(dr,k0)],0],Jx=[0,[0,f50,gx(dr,M0)],ur],xr=[0,[0,c50,gx(Q2,$0)],Jx];return U(Fx,Nx,c0,[0,[0,s50,m0(lx)],xr])}function $(X,A){var D=A[2],c0=D[7],k0=D[5],M0=D[4],$0=D[2],lx=D[6],Nx=D[3],Fx=D[1],ur=A[1];if(M0)var Jx=M0[1][2],xr=Jx[2],ar=Jx[1],er=A1(Jx[3],c0),yr=xr,Cr=[0,ar];else var er=c0,yr=0,Cr=0;if(k0)var Rx=k0[1][2],Lr=Rx[1],Tr=A1(Rx[2],er),e2=Tr,m2=pr(U0,Lr);else var e2=er,m2=$2(0);var h2=[0,[0,l50,m2],[0,[0,v50,pr(ix,lx)],0]],Fr=[0,[0,p50,gx(Pn,yr)],h2],d2=[0,[0,k50,gx(z0,Cr)],Fr],t2=[0,[0,m50,gx(Q2,Nx)],d2],Er=$0[2],Sr=Er[2],a2=$0[1],qr=[0,[0,h50,U(E50,a2,Sr,[0,[0,T50,pr(cx,Er[1])],0])],t2];return U(X,ur,e2,[0,[0,d50,gx(m0,Fx)],qr])}function ix(X){var A=X[2],D=A[2],c0=X[1];return U(g50,c0,D,[0,[0,y50,z0(A[1])],0])}function U0(X){var A=X[2],D=A[1],c0=X[1],k0=[0,[0,w50,gx(Pn,A[2])],0];return U(b50,c0,0,[0,[0,_50,m0(D)],k0])}function cx(X){switch(X[0]){case 0:var A=X[1],D=A[2],c0=D[6],k0=D[2],M0=D[5],$0=D[4],lx=D[3],Nx=D[1],Fx=A[1];switch(k0[0]){case 0:var ar=c0,er=0,yr=T2(k0[1]);break;case 1:var ar=c0,er=0,yr=O1(k0[1]);break;case 2:var ar=c0,er=0,yr=q1(k0[1]);break;case 3:var ar=c0,er=0,yr=m0(k0[1]);break;case 4:var ar=c0,er=0,yr=Dx(k0[1]);break;default:var ur=k0[1][2],Jx=ur[1],xr=A1(ur[2],c0),ar=xr,er=1,yr=z0(Jx)}switch(Nx){case 0:var Cr=S50;break;case 1:var Cr=A50;break;case 2:var Cr=P50;break;default:var Cr=I50}var Rx=[0,[0,O50,Gx(Cr)],[0,[0,j50,!!$0],[0,[0,C50,!!er],[0,[0,N50,pr(ix,M0)],0]]]];return U(R50,Fx,ar,[0,[0,F50,yr],[0,[0,D50,ex(lx)],Rx]]);case 1:var Lr=X[1],Tr=Lr[2],e2=Tr[7],m2=Tr[6],h2=Tr[2],Fr=Tr[1],d2=Tr[5],t2=Tr[4],Er=Tr[3],Sr=Lr[1];switch(Fr[0]){case 0:var Mr=e2,n2=0,o2=T2(Fr[1]);break;case 1:var Mr=e2,n2=0,o2=O1(Fr[1]);break;case 2:var Mr=e2,n2=0,o2=q1(Fr[1]);break;case 3:var Mr=e2,n2=0,o2=m0(Fr[1]);break;case 4:var a2=bx(J50),Mr=a2[3],n2=a2[2],o2=a2[1];break;default:var qr=Fr[1][2],Qr=qr[1],z2=A1(qr[2],e2),Mr=z2,n2=1,o2=z0(Qr)}if(typeof h2=="number")if(h2)var f2=0,N2=0;else var f2=1,N2=0;else var f2=0,N2=[0,h2[1]];var he=f2?[0,[0,G50,!!f2],0]:0,ee=m2===0?0:[0,[0,W50,pr(ix,m2)],0],He=Lx(ee,he),B1=[0,[0,Q50,!!n2],[0,[0,$50,!!t2],[0,[0,V50,gx(mt,d2)],0]]],u2=[0,[0,H50,yl(me,Er)],B1];return U(rh0,Sr,Mr,Lx([0,[0,xh0,o2],[0,[0,Z50,gx(z0,N2)],u2]],He));default:var te=X[1],R2=te[2],dt=R2[6],D1=R2[2],yt=R2[7],Jt=R2[5],Ze=R2[4],xt=R2[3],gt=R2[1],wt=te[1];if(typeof D1=="number")if(D1)var Ax=0,Z2=0;else var Ax=1,Z2=0;else var Ax=0,Z2=[0,D1[1]];var de=Ax?[0,[0,L50,!!Ax],0]:0,je=dt===0?0:[0,[0,M50,pr(ix,dt)],0],rt=Lx(je,de),et=[0,[0,U50,!1],[0,[0,B50,!!Ze],[0,[0,q50,gx(mt,Jt)],0]]],tt=[0,[0,X50,yl(me,xt)],et],x1=[0,[0,Y50,gx(z0,Z2)],tt];return U(K50,wt,yt,Lx([0,[0,z50,Dx(gt)],x1],rt))}}function wx(X){var A=X[2],D=A[3],c0=A[2],k0=A[1],M0=X[1],$0=A[4],lx=k0[0]===0?m0(k0[1]):T2(k0[1]);if(D)var Nx=[0,[0,ah0,z0(D[1])],0],Fx=U(vh0,M0,0,[0,[0,oh0,hr(c0)],Nx]);else var Fx=hr(c0);return U(mh0,M0,0,[0,[0,kh0,lx],[0,[0,ph0,Fx],[0,[0,lh0,!!$0],0]]])}function Or(X){var A=X[2],D=X[1];switch(A[0]){case 0:var c0=A[1],k0=c0[4],M0=[0,[0,Dh0,!!c0[2]],[0,[0,Oh0,!!c0[3]],0]],$0=[0,[0,Fh0,pr(function(Er){var Sr=Er[2],a2=Sr[1],qr=Er[1],Qr=[0,[0,Nh0,En(Sr[2])],0];return U(jh0,qr,0,[0,[0,Ch0,m0(a2)],Qr])},c0[1])],M0];return U(Rh0,D,_2(k0),$0);case 1:var lx=A[1],Nx=lx[4],Fx=[0,[0,Mh0,!!lx[2]],[0,[0,Lh0,!!lx[3]],0]],ur=[0,[0,qh0,pr(function(Er){var Sr=Er[2],a2=Sr[1],qr=Er[1],Qr=[0,[0,Ah0,O1(Sr[2])],0];return U(Ih0,qr,0,[0,[0,Ph0,m0(a2)],Qr])},lx[1])],Fx];return U(Bh0,D,_2(Nx),ur);case 2:var Jx=A[1],xr=Jx[1],ar=Jx[4],er=Jx[3],yr=Jx[2],Cr=xr[0]===0?dn(function(Er){var Sr=Er[1];return U(Sh0,Sr,0,[0,[0,Eh0,m0(Er[2][1])],0])},xr[1]):dn(function(Er){var Sr=Er[2],a2=Sr[1],qr=Er[1],Qr=[0,[0,_h0,T2(Sr[2])],0];return U(Th0,qr,0,[0,[0,bh0,m0(a2)],Qr])},xr[1]),Rx=[0,[0,Yh0,$2(Cr)],[0,[0,Xh0,!!yr],[0,[0,Uh0,!!er],0]]];return U(zh0,D,_2(ar),Rx);case 3:var Lr=A[1],Tr=Lr[3],e2=[0,[0,Kh0,!!Lr[2]],0],m2=[0,[0,Jh0,pr(function(Er){var Sr=Er[1];return U(wh0,Sr,0,[0,[0,gh0,m0(Er[2][1])],0])},Lr[1])],e2];return U(Gh0,D,_2(Tr),m2);default:var h2=A[1],Fr=h2[4],d2=[0,[0,Vh0,!!h2[2]],[0,[0,Wh0,!!h2[3]],0]],t2=[0,[0,$h0,pr(function(Er){var Sr=Er[2],a2=Sr[1],qr=Er[1],Qr=[0,[0,hh0,q1(Sr[2])],0];return U(yh0,qr,0,[0,[0,dh0,m0(a2)],Qr])},h2[1])],d2];return U(Qh0,D,_2(Fr),t2)}}function Hx(X){var A=X[2],D=A[5],c0=A[4],k0=A[2],M0=A[1],$0=X[1],lx=[0,[0,rd0,pr(x2,A[3])],0],Nx=[0,[0,ed0,An(0,c0)],lx],Fx=[0,[0,td0,gx(Q2,k0)],Nx];return U(ud0,$0,D,[0,[0,nd0,m0(M0)],Fx])}function x2(X){var A=X[2],D=A[1],c0=A[3],k0=A[2],M0=X[1],$0=D[0]===0?m0(D[1]):wa(D[1]);return U(cd0,M0,c0,[0,[0,fd0,$0],[0,[0,id0,gx(Pn,k0)],0]])}function hr(X){var A=X[2],D=X[1];switch(A[0]){case 0:var c0=A[1],k0=c0[3],M0=c0[1],$0=[0,[0,sd0,yl(me,c0[2])],0],lx=[0,[0,ad0,pr(pe,M0)],$0];return U(od0,D,_2(k0),lx);case 1:var Nx=A[1],Fx=Nx[3],ur=Nx[1],Jx=[0,[0,vd0,yl(me,Nx[2])],0],xr=[0,[0,ld0,pr(Zx,ur)],Jx];return U(pd0,D,_2(Fx),xr);case 2:return Ex(D,A[1]);default:return z0(A[1])}}function Dr(X){var A=X[2],D=A[2],c0=A[1],k0=X[1];if(!D)return hr(c0);var M0=[0,[0,kd0,z0(D[1])],0];return U(hd0,k0,0,[0,[0,md0,hr(c0)],M0])}function r2(X){var A=X[2],D=A[2],c0=X[1];return U(gd0,c0,D,[0,[0,yd0,xv],[0,[0,dd0,me(A[1])],0]])}function sx(X){var A=X[2],D=A[3],c0=A[2],k0=A[1];if(D){var M0=D[1],$0=M0[2],lx=$0[2],Nx=M0[1],Fx=U(_d0,Nx,lx,[0,[0,wd0,hr($0[1])],0]),ur=tx([0,Fx,p5(Dr,c0)]),Jx=k0?[0,r2(k0[1]),ur]:ur;return $2(Jx)}var xr=dn(Dr,c0),ar=k0?[0,r2(k0[1]),xr]:xr;return $2(ar)}function Sx(X,A){var D=A[2];return U(Td0,X,D,[0,[0,bd0,hr(A[1])],0])}function Zx(X){switch(X[0]){case 0:var A=X[1],D=A[2],c0=D[2],k0=D[1],M0=A[1];if(!c0)return hr(k0);var $0=[0,[0,Ed0,z0(c0[1])],0];return U(Ad0,M0,0,[0,[0,Sd0,hr(k0)],$0]);case 1:var lx=X[1];return Sx(lx[1],lx[2]);default:return C1}}function Ur(X){switch(X[0]){case 0:return C1;case 1:return me(X[1]);default:var A=X[1],D=A[2],c0=A[1];return U(Mw0,c0,0,[0,[0,Lw0,lo([0,D[1],D[2]])],0])}}function Y2(X){if(X[0]===0){var A=X[1],D=A[2],c0=A[1];switch(D[0]){case 0:var k0=D[3],M0=D[1],er=0,yr=k0,Cr=0,Rx=Pd0,Lr=z0(D[2]),Tr=M0;break;case 1:var $0=D[2],lx=D[1],er=0,yr=0,Cr=1,Rx=Id0,Lr=ex([0,$0[1],$0[2]]),Tr=lx;break;case 2:var Nx=D[2],Fx=D[3],ur=D[1],er=Fx,yr=0,Cr=0,Rx=Nd0,Lr=ex([0,Nx[1],Nx[2]]),Tr=ur;break;default:var Jx=D[2],xr=D[3],ar=D[1],er=xr,yr=0,Cr=0,Rx=Cd0,Lr=ex([0,Jx[1],Jx[2]]),Tr=ar}switch(Tr[0]){case 0:var d2=er,t2=0,Er=T2(Tr[1]);break;case 1:var d2=er,t2=0,Er=O1(Tr[1]);break;case 2:var d2=er,t2=0,Er=q1(Tr[1]);break;case 3:var d2=er,t2=0,Er=m0(Tr[1]);break;case 4:var e2=bx(jd0),d2=e2[3],t2=e2[2],Er=e2[1];break;default:var m2=Tr[1][2],h2=m2[1],Fr=A1(m2[2],er),d2=Fr,t2=1,Er=z0(h2)}return U(qd0,c0,d2,[0,[0,Md0,Er],[0,[0,Ld0,Lr],[0,[0,Rd0,Gx(Rx)],[0,[0,Fd0,!!Cr],[0,[0,Dd0,!!yr],[0,[0,Od0,!!t2],0]]]]]])}var Sr=X[1],a2=Sr[2],qr=a2[2],Qr=Sr[1];return U(Ud0,Qr,qr,[0,[0,Bd0,z0(a2[1])],0])}function pe(X){if(X[0]!==0){var A=X[1];return Sx(A[1],A[2])}var D=X[1],c0=D[2],k0=c0[3],M0=c0[2],$0=c0[1],lx=c0[4],Nx=D[1];switch($0[0]){case 0:var Jx=0,xr=0,ar=T2($0[1]);break;case 1:var Jx=0,xr=0,ar=O1($0[1]);break;case 2:var Jx=0,xr=0,ar=q1($0[1]);break;case 3:var Jx=0,xr=0,ar=m0($0[1]);break;default:var Fx=$0[1][2],ur=Fx[2],Jx=ur,xr=1,ar=z0(Fx[1])}if(k0)var er=k0[1],yr=Vr(M0[1],er[1]),Cr=[0,[0,Xd0,z0(er)],0],Rx=U(zd0,yr,0,[0,[0,Yd0,hr(M0)],Cr]);else var Rx=hr(M0);return U(Qd0,Nx,Jx,[0,[0,$d0,ar],[0,[0,Vd0,Rx],[0,[0,Wd0,Hc],[0,[0,Gd0,!1],[0,[0,Jd0,!!lx],[0,[0,Kd0,!!xr],0]]]]]])}function j1(X){var A=X[2],D=A[2],c0=X[1];return U(Zd0,c0,D,[0,[0,Hd0,z0(A[1])],0])}function kt(X){return X[0]===0?z0(X[1]):j1(X[1])}function zt(X){switch(X[0]){case 0:return z0(X[1]);case 1:return j1(X[1]);default:return C1}}function O1(X){var A=X[2];return U(ey0,X[1],A[3],[0,[0,ry0,A[1]],[0,[0,xy0,Gx(A[2])],0]])}function q1(X){var A=X[2],D=A[2],c0=A[1],k0=A[3],M0=X[1],$0=c0?bM(D3,c0[1]):xq(ty0,tq(95,E1(D,0,Cx(D)-1|0)));return U(fy0,M0,k0,[0,[0,iy0,C1],[0,[0,uy0,Gx($0)],[0,[0,ny0,Gx(D)],0]]])}function T2(X){var A=X[2];return U(ay0,X[1],A[3],[0,[0,sy0,Gx(A[1])],[0,[0,cy0,Gx(A[2])],0]])}function En(X){var A=X[2],D=A[1],c0=A[2],k0=X[1],M0=D?oy0:vy0;return U(ky0,k0,c0,[0,[0,py0,!!D],[0,[0,ly0,Gx(M0)],0]])}function Sn(X){return U(Ty0,X[1],X[2],[0,[0,by0,C1],[0,[0,_y0,cv],0]])}function Ss(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,Ey0,pr(z0,A[2])],0];return U(Ay0,k0,D,[0,[0,Sy0,pr(ke,c0)],M0])}function ke(X){var A=X[2],D=A[1],c0=A[2],k0=X[1];return U(jy0,k0,0,[0,[0,Cy0,Es([0,[0,Iy0,Gx(D[1])],[0,[0,Py0,Gx(D[2])],0]])],[0,[0,Ny0,!!c0],0]])}function Qe(X){var A=X[2],D=A[3],c0=A[1],k0=X[1],M0=[0,[0,Ry0,Gx(YC(A[2]))],0];return U(My0,k0,D,[0,[0,Ly0,pr(vo,c0)],M0])}function vo(X){var A=X[2],D=A[1],c0=X[1],k0=[0,[0,qy0,gx(z0,A[2])],0];return U(Uy0,c0,0,[0,[0,By0,hr(D)],k0])}function mt(X){var A=X[2],D=A[2],c0=X[1];switch(A[1]){case 0:var k0=Xy0;break;case 1:var k0=Yy0;break;case 2:var k0=zy0;break;case 3:var k0=Ky0;break;case 4:var k0=Jy0;break;default:var k0=Gy0}return U(Vy0,c0,D,[0,[0,Wy0,Gx(k0)],0])}function dr(X){var A=X[2],D=X[1];switch(A[0]){case 0:return U($y0,D,A[1],0);case 1:return U(Qy0,D,A[1],0);case 2:return U(Hy0,D,A[1],0);case 3:return U(Zy0,D,A[1],0);case 4:return U(x90,D,A[1],0);case 5:return U(e90,D,A[1],0);case 6:return U(t90,D,A[1],0);case 7:return U(n90,D,A[1],0);case 8:return U(u90,D,A[2],0);case 9:return U(r90,D,A[1],0);case 10:return U(Dw0,D,A[1],0);case 11:var c0=A[1],k0=c0[2];return U(f90,D,k0,[0,[0,i90,dr(c0[1])],0]);case 12:return As([0,D,A[1]]);case 13:var M0=A[1],$0=M0[2],lx=M0[4],Nx=M0[3],Fx=M0[1],ur=A1(_2($0[2][3]),lx),Jx=$0[2],xr=Jx[2],ar=Jx[1],er=[0,[0,Im0,gx(Q2,Fx)],0],yr=[0,[0,Nm0,ba(Nx)],er],Cr=[0,[0,Cm0,gx(Nr,xr)],yr];return U(Om0,D,ur,[0,[0,jm0,gr(ar)],Cr]);case 14:return An(1,[0,D,A[1]]);case 15:var Rx=A[1],Lr=Rx[3],Tr=Rx[2],e2=[0,[0,wg0,An(0,Rx[1])],0];return U(bg0,D,Lr,[0,[0,_g0,pr(x2,Tr)],e2]);case 16:var m2=A[1],h2=m2[2];return U(Eg0,D,h2,[0,[0,Tg0,dr(m2[1])],0]);case 17:var Fr=A[1],d2=Fr[5],t2=Fr[3],Er=Fr[2],Sr=Fr[1],a2=[0,[0,Sg0,dr(Fr[4])],0],qr=[0,[0,Ag0,dr(t2)],a2],Qr=[0,[0,Pg0,dr(Er)],qr];return U(Ng0,D,d2,[0,[0,Ig0,dr(Sr)],Qr]);case 18:var z2=A[1],Mr=z2[2];return U(jg0,D,Mr,[0,[0,Cg0,Ea(z2[1])],0]);case 19:return po([0,D,A[1]]);case 20:var n2=A[1],o2=n2[3];return U(Ug0,D,o2,ko(n2));case 21:var f2=A[1],N2=f2[1],he=N2[3],ee=[0,[0,Xg0,!!f2[2]],0];return U(Yg0,D,he,Lx(ko(N2),ee));case 22:var He=A[1],B1=He[1],u2=He[2];return U(Kg0,D,u2,[0,[0,zg0,pr(dr,[0,B1[1],[0,B1[2],B1[3]]])],0]);case 23:var te=A[1],R2=te[1],dt=te[2];return U(Gg0,D,dt,[0,[0,Jg0,pr(dr,[0,R2[1],[0,R2[2],R2[3]]])],0]);case 24:var D1=A[1],yt=D1[2],Jt=D1[3],Ze=D1[1],xt=yt?[0,[0,Wg0,Pn(yt[1])],0]:0;return U($g0,D,Jt,[0,[0,Vg0,_a(Ze)],xt]);case 25:var gt=A[1],wt=gt[2];return U(rw0,D,wt,[0,[0,xw0,dr(gt[1])],0]);case 26:return Ta(D,A[1]);case 27:var Ax=A[1];return mo(D,Ax[2],cw0,Ax[1]);case 28:var Z2=A[1],de=Z2[3],je=[0,[0,sw0,!!Z2[2]],0];return U(ow0,D,de,[0,[0,aw0,pr(function(In){var v1=In[2],Gt=In[1];switch(v1[0]){case 0:return dr(v1[1]);case 1:var U1=v1[1],Oe=U1[2],Wt=U1[1],Cs=[0,[0,vw0,!!U1[4]],0],Nn=[0,[0,lw0,gx(mt,U1[3])],Cs],js=[0,[0,pw0,dr(Oe)],Nn];return U(mw0,Gt,0,[0,[0,kw0,m0(Wt)],js]);default:var nt=v1[1],Vt=nt[1],Tt=[0,[0,hw0,dr(nt[2])],0];return U(yw0,Gt,0,[0,[0,dw0,gx(m0,Vt)],Tt])}},Z2[1])],je]);case 29:var rt=A[1];return U(_w0,D,rt[3],[0,[0,ww0,Gx(rt[1])],[0,[0,gw0,Gx(rt[2])],0]]);case 30:var et=A[1];return U(Ew0,D,et[3],[0,[0,Tw0,et[1]],[0,[0,bw0,Gx(et[2])],0]]);case 31:var tt=A[1];return U(Pw0,D,tt[3],[0,[0,Aw0,C1],[0,[0,Sw0,Gx(tt[2])],0]]);case 32:var x1=A[1],_t=x1[1],bt=x1[2],Is=0,Ns=_t?Iw0:Nw0;return U(Ow0,D,bt,[0,[0,jw0,!!_t],[0,[0,Cw0,Gx(Ns)],Is]]);case 33:return U(c90,D,A[1],0);case 34:return U(s90,D,A[1],0);default:return U(a90,D,A[1],0)}}function lo(X){var A=X[2],D=A[2],c0=A[3],k0=D[2],M0=D[1],$0=X[1];switch(A[1]){case 0:var lx=C1;break;case 1:var lx=E3;break;default:var lx=d3}var Nx=[0,[0,v90,gx(dr,k0)],[0,[0,o90,lx],0]],Fx=[0,[0,l90,m0(M0)],Nx];return U(p90,$0,_2(c0),Fx)}function As(X){var A=X[2],D=A[5],c0=A[3],k0=A[2][2],M0=A[4],$0=k0[3],lx=k0[2],Nx=k0[1],Fx=A[1],ur=X[1],Jx=A1(_2(k0[4]),M0),xr=D===0?k90:m90,ar=D===0?0:[0,[0,h90,gx(Kt,Nx)],0],er=[0,[0,d90,gx(Q2,Fx)],0],yr=[0,[0,y90,gx(Uv,$0)],er],Cr=c0[0]===0?dr(c0[1]):lo(c0[1]);return U(xr,ur,Jx,Lx([0,[0,w90,pr(function(Rx){return ga(0,Rx)},lx)],[0,[0,g90,Cr],yr]],ar))}function ga(X,A){var D=A[2],c0=D[1],k0=A[1],M0=[0,[0,_90,!!D[3]],0],$0=[0,[0,b90,dr(D[2])],M0];return U(E90,k0,X,[0,[0,T90,gx(m0,c0)],$0])}function Uv(X){var A=X[2];return ga(A[2],A[1])}function Kt(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,A90,dr(A[1][2])],[0,[0,S90,!1],0]];return U(I90,c0,D,[0,[0,P90,gx(m0,0)],k0])}function An(X,A){var D=A[2],c0=D[4],k0=D[2],M0=D[1],$0=A[1],lx=m1(function(Cr,Rx){var Lr=Cr[4],Tr=Cr[3],e2=Cr[2],m2=Cr[1];switch(Rx[0]){case 0:var h2=Rx[1],Fr=h2[2],d2=Fr[2],t2=Fr[1],Er=Fr[8],Sr=Fr[7],a2=Fr[6],qr=Fr[5],Qr=Fr[4],z2=Fr[3],Mr=h2[1];switch(t2[0]){case 0:var n2=T2(t2[1]);break;case 1:var n2=O1(t2[1]);break;case 2:var n2=q1(t2[1]);break;case 3:var n2=m0(t2[1]);break;case 4:var n2=bx(M90);break;default:var n2=bx(q90)}switch(d2[0]){case 0:var N2=B90,he=dr(d2[1]);break;case 1:var o2=d2[1],N2=U90,he=As([0,o2[1],o2[2]]);break;default:var f2=d2[1],N2=X90,he=As([0,f2[1],f2[2]])}return[0,[0,U(Q90,Mr,Er,[0,[0,$90,n2],[0,[0,V90,he],[0,[0,W90,!!a2],[0,[0,G90,!!z2],[0,[0,J90,!!Qr],[0,[0,K90,!!qr],[0,[0,z90,gx(mt,Sr)],[0,[0,Y90,Gx(N2)],0]]]]]]]]),m2],e2,Tr,Lr];case 1:var ee=Rx[1],He=ee[2],B1=He[2],u2=ee[1];return[0,[0,U(Z90,u2,B1,[0,[0,H90,dr(He[1])],0]),m2],e2,Tr,Lr];case 2:var te=Rx[1],R2=te[2],dt=R2[6],D1=R2[4],yt=R2[3],Jt=R2[2],Ze=R2[1],xt=te[1],gt=[0,[0,rg0,!!D1],[0,[0,xg0,gx(mt,R2[5])],0]],wt=[0,[0,eg0,dr(yt)],gt],Ax=[0,[0,tg0,dr(Jt)],wt];return[0,m2,[0,U(ug0,xt,dt,[0,[0,ng0,gx(m0,Ze)],Ax]),e2],Tr,Lr];case 3:var Z2=Rx[1],de=Z2[2],je=de[3],rt=Z2[1],et=[0,[0,ig0,!!de[2]],0];return[0,m2,e2,[0,U(cg0,rt,je,[0,[0,fg0,As(de[1])],et]),Tr],Lr];case 4:var tt=Rx[1],x1=tt[2],_t=x1[6],bt=x1[5],Is=x1[4],Ns=x1[3],In=x1[1],v1=tt[1],Gt=[0,[0,dg0,!!Ns],[0,[0,hg0,!!Is],[0,[0,mg0,!!bt],[0,[0,kg0,dr(x1[2])],0]]]];return[0,m2,e2,Tr,[0,U(gg0,v1,_t,[0,[0,yg0,m0(In)],Gt]),Lr]];default:var U1=Rx[1],Oe=U1[2],Wt=Oe[6],Cs=Oe[4],Nn=Oe[3],js=Oe[2],nt=Oe[1],Vt=U1[1],Tt=0;switch(Oe[5]){case 0:var $t="PlusOptional";break;case 1:var $t="MinusOptional";break;case 2:var $t="Optional";break;default:var $t=C1}var De=[0,[0,ag0,gx(mt,Cs)],[0,[0,sg0,$t],Tt]],Os=[0,[0,og0,dr(Nn)],De],Ds=[0,[0,vg0,dr(js)],Os];return[0,[0,U(pg0,Vt,Wt,[0,[0,lg0,Ea(nt)],Ds]),m2],e2,Tr,Lr]}},N90,D[3]),Nx=lx[3],Fx=lx[2],ur=lx[1],Jx=[0,[0,C90,$2(tx(lx[4]))],0],xr=[0,[0,j90,$2(tx(Nx))],Jx],ar=[0,[0,O90,$2(tx(Fx))],xr],er=[0,[0,F90,!!M0],[0,[0,D90,$2(tx(ur))],ar]],yr=X?[0,[0,R90,!!k0],er]:er;return U(L90,$0,_2(c0),yr)}function wa(X){var A=X[2],D=A[1],c0=A[2],k0=X[1],M0=D[0]===0?m0(D[1]):wa(D[1]);return U(Fg0,k0,0,[0,[0,Dg0,M0],[0,[0,Og0,m0(c0)],0]])}function po(X){var A=X[2],D=A[1],c0=A[3],k0=A[2],M0=X[1],$0=D[0]===0?m0(D[1]):wa(D[1]);return U(Mg0,M0,c0,[0,[0,Lg0,$0],[0,[0,Rg0,gx(Pn,k0)],0]])}function ko(X){var A=X[1],D=[0,[0,qg0,dr(X[2])],0];return[0,[0,Bg0,dr(A)],D]}function _a(X){if(X[0]===0)return m0(X[1]);var A=X[1],D=A[2],c0=D[2],k0=A[1],M0=_a(D[1]);return U(Zg0,k0,0,[0,[0,Hg0,M0],[0,[0,Qg0,m0(c0)],0]])}function ba(X){return X[0]===0?C1:Ta(X[1],X[2])}function Ta(X,A){var D=A[3],c0=A[2];switch(A[4]){case 0:var k0=ew0;break;case 1:var k0=tw0;break;default:var k0=nw0}return mo(X,D,k0,c0)}function mo(X,A,D,c0){return U(fw0,X,A,[0,[0,iw0,Gx(D)],[0,[0,uw0,dr(c0)],0]])}function me(X){var A=X[1];return U(Rw0,A,0,[0,[0,Fw0,dr(X[2])],0])}function Q2(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,qw0,pr(Ea,A[1])],0];return U(Bw0,c0,_2(D),k0)}function Ea(X){var A=X[2],D=A[1][2],c0=A[6],k0=A[5],M0=A[4],$0=A[2],lx=D[2],Nx=D[1],Fx=X[1],ur=A[3]?[0,[0,Uw0,!0],0]:0,Jx=[0,[0,Xw0,gx(dr,k0)],0],xr=[0,[0,Yw0,gx(mt,M0)],Jx],ar=[0,[0,zw0,!!WM(c0)],xr];return U(Gw0,Fx,lx,Lx([0,[0,Jw0,Gx(Nx)],[0,[0,Kw0,yl(me,$0)],ar]],ur))}function Pn(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,Ww0,pr(dr,A[1])],0];return U(Vw0,c0,_2(D),k0)}function ho(X){var A=X[2],D=A[2],c0=X[1],k0=[0,[0,$w0,pr(yo,A[1])],0];return U(Qw0,c0,_2(D),k0)}function yo(X){if(X[0]===0)return dr(X[1]);var A=X[1],D=A[1],c0=A[2][1];return po([0,D,[0,[0,gn(0,[0,D,Hw0])],0,c0]])}function Ps(X){var A=X[2],D=A[1],c0=A[4],k0=A[2],M0=X[1],$0=[0,[0,Zw0,pr(Yv,A[3][2])],0],lx=[0,[0,x_0,gx(Xv,k0)],$0],Nx=D[2],Fx=Nx[2],ur=Nx[4],Jx=Nx[3],xr=Nx[1],ar=D[1],er=Fx?[0,[0,f_0,ho(Fx[1])],0]:0,yr=[0,[0,s_0,pr(wl,ur)],[0,[0,c_0,!!Jx],0]];return U(e_0,M0,c0,[0,[0,r_0,U(o_0,ar,0,Lx([0,[0,a_0,wo(xr)],yr],er))],lx])}function go(X){var A=X[2],D=A[4],c0=A[3][2],k0=A[1],M0=X[1],$0=[0,[0,t_0,U(k_0,A[2],0,0)],0],lx=[0,[0,n_0,pr(Yv,c0)],$0];return U(i_0,M0,D,[0,[0,u_0,U(v_0,k0,0,0)],lx])}function wl(X){if(X[0]===0){var A=X[1],D=A[2],c0=D[1],k0=D[2],M0=A[1],$0=c0[0]===0?ht(c0[1]):_l(c0[1]);return U(d_0,M0,0,[0,[0,h_0,$0],[0,[0,m_0,gx(_o,k0)],0]])}var lx=X[1],Nx=lx[2],Fx=Nx[2],ur=lx[1];return U(g_0,ur,Fx,[0,[0,y_0,z0(Nx[1])],0])}function Xv(X){var A=X[1];return U(p_0,A,0,[0,[0,l_0,wo(X[2][1])],0])}function Yv(X){var A=X[2],D=X[1];switch(A[0]){case 0:return Ps([0,D,A[1]]);case 1:return go([0,D,A[1]]);case 2:return Sa([0,D,A[1]]);case 3:var c0=A[1],k0=c0[2];return U(E_0,D,k0,[0,[0,T_0,z0(c0[1])],0]);default:var M0=A[1];return U(P_0,D,0,[0,[0,A_0,Gx(M0[1])],[0,[0,S_0,Gx(M0[2])],0]])}}function wo(X){switch(X[0]){case 0:return ht(X[1]);case 1:return _l(X[1]);default:return bo(X[1])}}function _o(X){if(X[0]===0){var A=X[1];return T2([0,A[1],A[2]])}var D=X[1];return Sa([0,D[1],D[2]])}function Sa(X){var A=X[2],D=A[1],c0=X[1],k0=A[2],M0=D?z0(D[1]):U(w_0,[0,c0[1],[0,c0[2][1],c0[2][2]+1|0],[0,c0[3][1],c0[3][2]-1|0]],0,0);return U(b_0,c0,_2(k0),[0,[0,__0,M0],0])}function bo(X){var A=X[2],D=A[1],c0=A[2],k0=X[1],M0=D[0]===0?ht(D[1]):bo(D[1]);return U(C_0,k0,0,[0,[0,N_0,M0],[0,[0,I_0,ht(c0)],0]])}function _l(X){var A=X[2],D=A[1],c0=X[1],k0=[0,[0,j_0,ht(A[2])],0];return U(D_0,c0,0,[0,[0,O_0,ht(D)],k0])}function ht(X){var A=X[2];return U(R_0,X[1],A[2],[0,[0,F_0,Gx(A[1])],0])}function E4(X){var A=X[2],D=A[2],c0=A[1],k0=X[1],M0=m0(D?D[1]:c0);return U(q_0,k0,0,[0,[0,M_0,m0(c0)],[0,[0,L_0,M0],0]])}function Aa(X){return pr($h,X)}function $h(X){var A=X[2],D=X[1];if(A[1])var c0=A[2],k0=W_0;else var c0=A[2],k0=V_0;return U(k0,D,0,[0,[0,$_0,Gx(c0)],0])}function zv(X){var A=X[2],D=A[1],c0=A[2],k0=X[1];if(D)var M0=[0,[0,Q_0,z0(D[1])],0],$0=H_0;else var M0=0,$0=Z_0;return U($0,k0,c0,M0)}function bl(X){var A=X[2],D=X[1],c0=[0,[0,xb0,qx(X[3])],0],k0=[0,[0,rb0,gx(ho,A)],c0];return[0,[0,eb0,z0(D)],k0]}function Tl(X){var A=X[2],D=X[1];switch(A[0]){case 0:var c0=0,k0=m0(A[1]);break;case 1:var c0=0,k0=Dx(A[1]);break;default:var c0=1,k0=z0(A[1])}return[0,[0,ub0,z0(D)],[0,[0,nb0,k0],[0,[0,tb0,!!c0],0]]]}var To=E0[2],S4=To[2],A4=To[4],Qh=To[3],Hh=E0[1],Zh=Kx(To[1]),P4=[0,[0,o60,Zh],[0,[0,a60,Aa(A4)],0]];if(S4)var I4=S4[1],N4=Lx(P4,[0,[0,p60,U(l60,I4[1],0,[0,[0,v60,Gx(I4[2])],0])],0]);else var N4=P4;var El=U(k60,Hh,Qh,N4);return El.errors=pr(function(X){var A=X[1],D=[0,[0,ib0,Gx(dE0(X[2]))],0];return Es([0,[0,fb0,$Y(A)],D])},Lx(s0,WY[1])),T&&(El[WO]=$2(p5(function(X){var A=X[2],D=X[1],c0=X[3],k0=[0,[0,ho0,Gx(KC(A))],0],M0=[0,dh(B,D[3]),0],$0=[0,[0,do0,$2([0,dh(B,D[2]),M0])],k0],lx=[0,[0,wo0,Es([0,[0,go0,D[3][1]],[0,[0,yo0,D[3][2]],0]])],0],Nx=[0,[0,Eo0,Es([0,[0,To0,Es([0,[0,bo0,D[2][1]],[0,[0,_o0,D[2][2]],0]])],lx])],$0];switch(c0){case 0:var Fx=So0;break;case 1:var Fx=Ao0;break;case 2:var Fx=Po0;break;case 3:var Fx=Io0;break;case 4:var Fx=No0;break;default:var Fx=Co0}return Es([0,[0,Oo0,Gx(DB(A))],[0,[0,jo0,Gx(Fx)],Nx]])},F[1]))),El}if(typeof fO<"u")var QY=fO;else{var HY={};ya.flow=HY;var QY=HY}QY.parse=eK(function(x,r){try{var e=EE0(x,r);return e}catch(u){var t=B2(u);return t[1]===rO?GY(t[2]):GY(new bE0(Gx(Mx(Tb0,Y6(t)))))}}),$N(O)})(globalThis)});var pO={};ez(pO,{parsers:()=>lO});var lO={};ez(lO,{flow:()=>oS0});var wz=ME0(tz(),1);function qE0(o0,ox){let $x=new SyntaxError(o0+" ("+ox.loc.start.line+":"+ox.loc.start.column+")");return Object.assign($x,ox)}var nz=qE0;var BE0=(o0,ox,$x)=>{if(!(o0&&ox==null))return Array.isArray(ox)||typeof ox=="string"?ox[$x<0?ox.length+$x:$x]:ox.at($x)},cO=BE0;function UE0(o0){return Array.isArray(o0)&&o0.length>0}var uz=UE0;function Zt(o0){var Ar,lr,Pr;let ox=((Ar=o0.range)==null?void 0:Ar[0])??o0.start,$x=(Pr=((lr=o0.declaration)==null?void 0:lr.decorators)??o0.decorators)==null?void 0:Pr[0];return $x?Math.min(Zt($x),ox):ox}function Da(o0){var ox;return((ox=o0.range)==null?void 0:ox[1])??o0.end}function XE0(o0){let ox=new Set(o0);return $x=>ox.has($x==null?void 0:$x.type)}var iz=XE0;var YE0=iz(["Block","CommentBlock","MultiLine"]),F4=YE0;function zE0(o0){let ox=`*${o0.value}*`.split(` +`);return ox.length>1&&ox.every($x=>$x.trimStart()[0]==="*")}var sO=zE0;function KE0(o0){return F4(o0)&&o0.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(o0.value)}var fz=KE0;var R4=null;function L4(o0){if(R4!==null&&typeof R4.property){let ox=R4;return R4=L4.prototype=null,ox}return R4=L4.prototype=o0??Object.create(null),new L4}var JE0=10;for(let o0=0;o0<=JE0;o0++)L4();function aO(o0){return L4(o0)}function GE0(o0,ox="type"){aO(o0);function $x(Ar){let lr=Ar[ox],Pr=o0[lr];if(!Array.isArray(Pr))throw Object.assign(new Error(`Missing visitor keys for '${lr}'.`),{node:Ar});return Pr}return $x}var cz=GE0;var sz={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var WE0=cz(sz),az=WE0;function oO(o0,ox){if(!(o0!==null&&typeof o0=="object"))return o0;if(Array.isArray(o0)){for(let Ar=0;Ar{var L2;(L2=Pr.leadingComments)!=null&&L2.some(fz)&&lr.add(Zt(Pr))}),o0=sd(o0,Pr=>{if(Pr.type==="ParenthesizedExpression"){let{expression:L2}=Pr;if(L2.type==="TypeCastExpression")return L2.range=[...Pr.range],L2;let ie=Zt(Pr);if(!lr.has(ie))return L2.extra={...L2.extra,parenthesized:!0},L2}})}if(o0=sd(o0,lr=>{switch(lr.type){case"LogicalExpression":if(oz(lr))return vO(lr);break;case"VariableDeclaration":{let Pr=cO(!1,lr.declarations,-1);Pr!=null&&Pr.init&&Ar[Da(Pr)]!==";"&&(lr.range=[Zt(lr),Da(Pr)]);break}case"TSParenthesizedType":return lr.typeAnnotation;case"TSTypeParameter":if(typeof lr.name=="string"){let Pr=Zt(lr);lr.name={type:"Identifier",name:lr.name,range:[Pr,Pr+lr.name.length]}}break;case"TopicReference":o0.extra={...o0.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(lr.types.length===1)return lr.types[0];break}}),uz(o0.comments)){let lr=cO(!1,o0.comments,-1);for(let Pr=o0.comments.length-2;Pr>=0;Pr--){let L2=o0.comments[Pr];Da(L2)===Zt(lr)&&F4(L2)&&F4(lr)&&sO(L2)&&sO(lr)&&(o0.comments.splice(Pr+1,1),L2.value+="*//*"+lr.value,L2.range=[Zt(L2),Da(lr)]),lr=L2}}return o0.type==="Program"&&(o0.range=[0,Ar.length]),o0}function oz(o0){return o0.type==="LogicalExpression"&&o0.right.type==="LogicalExpression"&&o0.operator===o0.right.operator}function vO(o0){return oz(o0)?vO({type:"LogicalExpression",operator:o0.operator,left:vO({type:"LogicalExpression",operator:o0.operator,left:o0.left,right:o0.right.left,range:[Zt(o0.left),Da(o0.right.left)]}),right:o0.right.right,range:[Zt(o0),Da(o0)]}):o0}var vz=VE0;var $E0=(o0,ox,$x,Ar)=>{if(!(o0&&ox==null))return ox.replaceAll?ox.replaceAll($x,Ar):$x.global?ox.replace($x,Ar):ox.split($x).join(Ar)},ql=$E0;var QE0=/\*\/$/,HE0=/^\/\*\*?/,ZE0=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,xS0=/(^|\s+)\/\/([^\n\r]*)/g,lz=/^(\r?\n)+/,rS0=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,pz=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,eS0=/(\r?\n|^) *\* ?/g,tS0=[];function kz(o0){let ox=o0.match(ZE0);return ox?ox[0].trimStart():""}function mz(o0){let ox=` +`;o0=ql(!1,o0.replace(HE0,"").replace(QE0,""),eS0,"$1");let $x="";for(;$x!==o0;)$x=o0,o0=ql(!1,o0,rS0,`${ox}$1 $2${ox}`);o0=o0.replace(lz,"").trimEnd();let Ar=Object.create(null),lr=ql(!1,o0,pz,"").replace(lz,"").trimEnd(),Pr;for(;Pr=pz.exec(o0);){let L2=ql(!1,Pr[2],xS0,"");if(typeof Ar[Pr[1]]=="string"||Array.isArray(Ar[Pr[1]])){let ie=Ar[Pr[1]];Ar[Pr[1]]=[...tS0,...Array.isArray(ie)?ie:[ie],L2]}else Ar[Pr[1]]=L2}return{comments:lr,pragmas:Ar}}function nS0(o0){if(!o0.startsWith("#!"))return"";let ox=o0.indexOf(` +`);return ox===-1?o0:o0.slice(0,ox)}var hz=nS0;function uS0(o0){let ox=hz(o0);ox&&(o0=o0.slice(ox.length+1));let $x=kz(o0),{pragmas:Ar,comments:lr}=mz($x);return{shebang:ox,text:o0,pragmas:Ar,comments:lr}}function dz(o0){let{pragmas:ox}=uS0(o0);return Object.prototype.hasOwnProperty.call(ox,"prettier")||Object.prototype.hasOwnProperty.call(ox,"format")}function iS0(o0){return o0=typeof o0=="function"?{parse:o0}:o0,{astFormat:"estree",hasPragma:dz,locStart:Zt,locEnd:Da,...o0}}var yz=iS0;function fS0(o0){return o0.charAt(0)==="#"&&o0.charAt(1)==="!"?"//"+o0.slice(2):o0}var gz=fS0;var cS0={comments:!1,components:!0,enums:!0,esproposal_decorators:!0,esproposal_export_star_as:!0,tokens:!0};function sS0(o0){let{message:ox,loc:{start:$x,end:Ar}}=o0;return nz(ox,{loc:{start:{line:$x.line,column:$x.column+1},end:{line:Ar.line,column:Ar.column+1}},cause:o0})}function aS0(o0){let ox=wz.default.parse(gz(o0),cS0),[$x]=ox.errors;if($x)throw sS0($x);return vz(ox,{text:o0})}var oS0=yz(aS0);var lA0=pO;export{lA0 as default,lO as parsers}; diff --git a/node_modules/prettier/plugins/glimmer.js b/node_modules/prettier/plugins/glimmer.js new file mode 100644 index 0000000..e864e17 --- /dev/null +++ b/node_modules/prettier/plugins/glimmer.js @@ -0,0 +1,30 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.glimmer=e()}})(function(){"use strict";var Fe=Object.defineProperty;var Ws=Object.getOwnPropertyDescriptor;var js=Object.getOwnPropertyNames;var Qs=Object.prototype.hasOwnProperty;var Or=e=>{throw TypeError(e)};var He=(e,t)=>{for(var r in t)Fe(e,r,{get:t[r],enumerable:!0})},Js=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of js(t))!Qs.call(e,n)&&n!==r&&Fe(e,n,{get:()=>t[n],enumerable:!(s=Ws(t,n))||s.enumerable});return e};var $s=e=>Js(Fe({},"__esModule",{value:!0}),e);var Br=(e,t,r)=>t.has(e)||Or("Cannot "+r);var I=(e,t,r)=>(Br(e,t,"read from private field"),r?r.call(e):t.get(e)),Lt=(e,t,r)=>t.has(e)?Or("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,s)=>(Br(e,t,"write to private field"),s?s.call(e,r):t.set(e,r),r);var xi={};He(xi,{languages:()=>ps,parsers:()=>xr,printers:()=>Pi});var Xs=(e,t,r,s)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,s):r.global?t.replace(r,s):t.split(r).join(s)},Ue=Xs;var Dt="string",Gt="array",Kt="cursor",_t="indent",Ot="align",Wt="trim",Bt="group",It="fill",bt="if-break",jt="indent-if-break",Qt="line-suffix",Jt="line-suffix-boundary",j="line",$t="label",Rt="break-parent",fe=new Set([Kt,_t,Ot,Wt,Bt,It,bt,jt,Qt,Jt,j,$t,Rt]);var Zs=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},G=Zs;function tn(e){if(typeof e=="string")return Dt;if(Array.isArray(e))return Gt;if(!e)return;let{type:t}=e;if(fe.has(t))return t}var qt=tn;var en=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function rn(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', +Expected it to be 'string' or 'object'.`;if(qt(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let s=en([...fe].map(n=>`'${n}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${s}.`}var Me=class extends Error{name="InvalidDocError";constructor(t){super(rn(t)),this.doc=t}},ze=Me;function nn(e,t){if(typeof e=="string")return t(e);let r=new Map;return s(e);function s(i){if(r.has(i))return r.get(i);let a=n(i);return r.set(i,a),a}function n(i){switch(qt(i)){case Gt:return t(i.map(s));case It:return t({...i,parts:i.parts.map(s)});case bt:return t({...i,breakContents:s(i.breakContents),flatContents:s(i.flatContents)});case Bt:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(s),o=a[0]):o=s(o),t({...i,contents:o,expandedStates:a})}case Ot:case _t:case jt:case $t:case Qt:return t({...i,contents:s(i.contents)});case Dt:case Kt:case Wt:case Jt:case j:case Rt:return t(i);default:throw new ze(i)}}}function Ir(e,t=Rr){return nn(e,r=>typeof r=="string"?yt(t,r.split(` +`)):r)}var Ye=()=>{},kt=Ye,Ge=Ye,qr=Ye;function B(e){return kt(e),{type:_t,contents:e}}function an(e,t){return kt(t),{type:Ot,contents:t,n:e}}function R(e,t={}){return kt(e),Ge(t.expandedStates,!0),{type:Bt,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Xt(e){return an(-1,e)}function Ke(e){return qr(e),{type:It,parts:e}}function We(e,t="",r={}){return kt(e),t!==""&&kt(t),{type:bt,breakContents:e,flatContents:t,groupId:r.groupId}}var Vr={type:Rt};var on={type:j,hard:!0},ln={type:j,hard:!0,literal:!0},L={type:j},H={type:j,soft:!0},tt=[on,Vr],Rr=[ln,Vr];function yt(e,t){kt(e),Ge(t);let r=[];for(let s=0;si?s:r}var de=cn;function je(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var z,Qe=class{constructor(t){Lt(this,z);Y(this,z,new Set(t))}getLeadingWhitespaceCount(t){let r=I(this,z),s=0;for(let n=0;n=0&&r.has(t.charAt(n));n--)s++;return s}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return I(this,z).has(t.charAt(0))}hasTrailingWhitespace(t){return I(this,z).has(G(!1,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let s=`[${je([...I(this,z)].join(""))}]+`,n=new RegExp(r?`(${s})`:s,"u");return t.split(n)}hasWhitespaceCharacter(t){let r=I(this,z);return Array.prototype.some.call(t,s=>r.has(s))}hasNonWhitespaceCharacter(t){let r=I(this,z);return Array.prototype.some.call(t,s=>!r.has(s))}isWhitespaceOnly(t){let r=I(this,z);return Array.prototype.every.call(t,s=>r.has(s))}};z=new WeakMap;var Hr=Qe;var un=[" ",` +`,"\f","\r"," "],hn=new Hr(un),K=hn;function pn(e){return Array.isArray(e)&&e.length>0}var Zt=pn;var Je=class extends Error{name="UnexpectedNodeError";constructor(t,r,s="type"){super(`Unexpected ${r} node ${s}: ${JSON.stringify(t[s])}.`),this.node=t}},Ur=Je;function Mr(e,t,r){if(e.type==="TextNode"){let s=e.chars.trim();if(!s)return null;r.tag==="style"&&r.children.length===1&&r.children[0]===e?t.chars="":t.chars=K.split(s).join(" ")}e.type==="ElementNode"&&(delete t.startTag,delete t.openTag,delete t.parts,delete t.endTag,delete t.closeTag,delete t.nameNode,delete t.body,delete t.blockParamNodes,delete t.params,delete t.path),e.type==="Block"&&(delete t.blockParamNodes,delete t.params),e.type==="AttrNode"&&e.name.toLowerCase()==="class"&&delete t.value,e.type==="PathExpression"&&(t.head=e.head.original)}Mr.ignoredProperties=new Set(["loc","selfClosing"]);var zr=Mr;function fn(e){let{node:t}=e;if(t.type!=="TextNode")return;let{parent:r}=e;if(!(r.type==="ElementNode"&&r.tag==="style"&&r.children.length===1&&r.children[0]===t))return;let s=r.attributes.find(n=>n.type==="AttrNode"&&n.name==="lang");if(!(s&&!(s.value.type==="TextNode"&&(s.value.chars===""||s.value.chars==="css"))))return async n=>{let i=await n(t.chars,{parser:"css"});return i?[tt,i,Xt(H)]:[]}}var Yr=fn;var te=null;function ee(e){if(te!==null&&typeof te.property){let t=te;return te=ee.prototype=null,t}return te=ee.prototype=e??Object.create(null),new ee}var mn=10;for(let e=0;e<=mn;e++)ee();function $e(e){return ee(e)}function dn(e,t="type"){$e(e);function r(s){let n=s[t],i=e[n];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:s});return i}return r}var Gr=dn;var Kr={Template:["body"],Block:["body"],MustacheStatement:["path","params","hash"],BlockStatement:["path","params","hash","program","inverse"],ElementModifierStatement:["path","params","hash"],CommentStatement:[],MustacheCommentStatement:[],ElementNode:["attributes","modifiers","children","comments"],AttrNode:["value"],TextNode:[],ConcatStatement:["parts"],SubExpression:["path","params","hash"],PathExpression:[],StringLiteral:[],BooleanLiteral:[],NumberLiteral:[],NullLiteral:[],UndefinedLiteral:[],Hash:["pairs"],HashPair:["value"]};var gn=Gr(Kr),Wr=gn;function St(e){return e.loc.start.offset}function re(e){return e.loc.end.offset}var jr=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Jr(e){return e.toUpperCase()===e}function bn(e){return e.type==="ElementNode"&&typeof e.tag=="string"&&!e.tag.startsWith(":")&&(Jr(e.tag[0])||e.tag.includes("."))}function yn(e){return jr.has(e.toLowerCase())&&!Jr(e[0])}function Xe(e){return e.selfClosing===!0||yn(e.tag)||bn(e)&&e.children.every(t=>ge(t))}function ge(e){return e.type==="TextNode"&&!/\S/u.test(e.chars)}function Qr(e){return(e==null?void 0:e.type)==="MustacheCommentStatement"&&typeof e.value=="string"&&e.value.trim()==="prettier-ignore"}function $r(e){return Qr(e.node)||e.isInArray&&(e.key==="children"||e.key==="body"||e.key==="parts")&&Qr(e.siblings[e.index-2])}var is=2;function kn(e,t,r){var n,i,a,o,c,h,p,m,S;let{node:s}=e;switch(s.type){case"Block":case"Program":case"Template":return R(e.map(r,"body"));case"ElementNode":{let y=R(vn(e,r)),E=t.htmlWhitespaceSensitivity==="ignore"&&((n=e.next)==null?void 0:n.type)==="ElementNode"?H:"";if(Xe(s))return[y,E];let C=[""];return s.children.length===0?[y,B(C),E]:t.htmlWhitespaceSensitivity==="ignore"?[y,B(Xr(e,t,r)),tt,B(C),E]:[y,B(R(Xr(e,t,r))),B(C),E]}case"BlockStatement":return Pn(e)?[xn(e,r),es(e,r,t),rs(e,r,t)]:[Nn(e,r),R([es(e,r,t),rs(e,r,t),An(e,r,t)])];case"ElementModifierStatement":return R(["{{",ns(e,r),"}}"]);case"MustacheStatement":return R([be(s),ns(e,r),ye(s)]);case"SubExpression":return R(["(",Rn(e,r),H,")"]);case"AttrNode":{let{name:y,value:E}=s,C=E.type==="TextNode";if(C&&E.chars===""&&St(E)===re(E))return y;let w=C?de(E.chars,t.singleQuote):E.type==="ConcatStatement"?de(E.parts.map(q=>q.type==="TextNode"?q.chars:"").join(""),t.singleQuote):"",U=r("value");return[y,"=",w,y==="class"&&w?R(B(U)):U,w]}case"ConcatStatement":return e.map(r,"parts");case"Hash":return yt(L,e.map(r,"pairs"));case"HashPair":return[s.key,"=",r("value")];case"TextNode":{if(e.parent.tag==="pre"||e.parent.tag==="style")return s.chars;let y=Ue(!1,s.chars,"{{",String.raw`\{{`),E=Dn(e);if(E){if(E==="class"){let X=y.trim().split(/\s+/u).join(" "),rt=!1,V=!1;return e.parent.type==="ConcatStatement"&&(((i=e.previous)==null?void 0:i.type)==="MustacheStatement"&&/^\s/u.test(y)&&(rt=!0),((a=e.next)==null?void 0:a.type)==="MustacheStatement"&&/\s$/u.test(y)&&X!==""&&(V=!0)),[rt?L:"",X,V?L:""]}return Ir(y)}let C=K.isWhitespaceOnly(y),{isFirst:P,isLast:w}=e;if(t.htmlWhitespaceSensitivity!=="ignore"){let X=w&&e.parent.type==="Template",rt=P&&e.parent.type==="Template";if(C){if(rt||X)return"";let A=[L],nt=Vt(y);return nt&&(A=se(nt)),w&&(A=A.map(ue=>Xt(ue))),A}let V=K.getLeadingWhitespace(y),Pt=[];if(V){Pt=[L];let A=Vt(V);A&&(Pt=se(A)),y=y.slice(V.length)}let F=K.getTrailingWhitespace(y),st=[];if(F){if(!X){st=[L];let A=Vt(F);A&&(st=se(A)),w&&(st=st.map(nt=>Xt(nt)))}y=y.slice(0,-F.length)}return[...Pt,Ke(ss(y)),...st]}let U=Vt(y),q=_n(y),$=On(y);if((P||w)&&C&&(e.parent.type==="Block"||e.parent.type==="ElementNode"||e.parent.type==="Template"))return"";C&&U?(q=Math.min(U,is),$=0):((((o=e.next)==null?void 0:o.type)==="BlockStatement"||((c=e.next)==null?void 0:c.type)==="ElementNode")&&($=Math.max($,1)),(((h=e.previous)==null?void 0:h.type)==="BlockStatement"||((p=e.previous)==null?void 0:p.type)==="ElementNode")&&(q=Math.max(q,1)));let Nt="",Ct="";return $===0&&((m=e.next)==null?void 0:m.type)==="MustacheStatement"&&(Ct=" "),q===0&&((S=e.previous)==null?void 0:S.type)==="MustacheStatement"&&(Nt=" "),P&&(q=0,Nt=""),w&&($=0,Ct=""),K.hasLeadingWhitespace(y)&&(y=Nt+K.trimStart(y)),K.hasTrailingWhitespace(y)&&(y=K.trimEnd(y)+Ct),[...se(q),Ke(ss(y)),...se($)]}case"MustacheCommentStatement":{let y=St(s),E=re(s),C=t.originalText.charAt(y+2)==="~",P=t.originalText.charAt(E-3)==="~",w=s.value.includes("}}")?"--":"";return["{{",C?"~":"","!",w,s.value,w,P?"~":"","}}"]}case"PathExpression":return Hn(s);case"BooleanLiteral":return String(s.value);case"CommentStatement":return[""];case"StringLiteral":return Bn(e,t);case"NumberLiteral":return String(s.value);case"UndefinedLiteral":return"undefined";case"NullLiteral":return"null";case"AtHead":case"VarHead":case"ThisHead":default:throw new Ur(s,"Handlebars")}}function Sn(e,t){return St(e)-St(t)}function vn(e,t){let{node:r}=e,s=["attributes","modifiers","comments"].filter(i=>Zt(r[i])),n=s.flatMap(i=>r[i]).sort(Sn);for(let i of s)e.each(({node:a})=>{let o=n.indexOf(a);n.splice(o,1,[L,t()])},i);return Zt(r.blockParams)&&n.push(L,tr(r)),["<",r.tag,B(n),En(r)]}function Xr(e,t,r){let{node:s}=e,n=s.children.every(i=>ge(i));return t.htmlWhitespaceSensitivity==="ignore"&&n?"":e.map(({isFirst:i})=>{let a=r();return i&&t.htmlWhitespaceSensitivity==="ignore"?[H,a]:a},"children")}function En(e){return Xe(e)?We([H,"/>"],[" />",H]):We([H,">"],">")}function be(e){var s;let t=e.trusting?"{{{":"{{",r=(s=e.strip)!=null&&s.open?"~":"";return[t,r]}function ye(e){var s;let t=e.trusting?"}}}":"}}";return[(s=e.strip)!=null&&s.close?"~":"",t]}function wn(e){let t=be(e),r=e.openStrip.open?"~":"";return[t,r,"#"]}function Tn(e){let t=ye(e);return[e.openStrip.close?"~":"",t]}function Zr(e){let t=be(e),r=e.closeStrip.open?"~":"";return[t,r,"/"]}function ts(e){let t=ye(e);return[e.closeStrip.close?"~":"",t]}function as(e){let t=be(e),r=e.inverseStrip.open?"~":"";return[t,r]}function os(e){let t=ye(e);return[e.inverseStrip.close?"~":"",t]}function Nn(e,t){let{node:r}=e,s=[],n=ke(e,t);return n&&s.push(R(n)),Zt(r.program.blockParams)&&s.push(tr(r.program)),R([wn(r),Ze(e,t),s.length>0?B([L,yt(L,s)]):"",H,Tn(r)])}function Cn(e,t){return[t.htmlWhitespaceSensitivity==="ignore"?tt:"",as(e),"else",os(e)]}var ls=(e,t)=>e.head.type==="VarHead"&&t.head.type==="VarHead"&&e.head.name===t.head.name;function Pn(e){var s;let{grandparent:t,node:r}=e;return((s=t==null?void 0:t.inverse)==null?void 0:s.body.length)===1&&t.inverse.body[0]===r&&ls(t.inverse.body[0].path,t.path)}function xn(e,t){let{node:r,grandparent:s}=e;return R([as(s),["else"," ",s.inverse.body[0].path.head.name],B([L,R(ke(e,t)),...Zt(r.program.blockParams)?[L,tr(r.program)]:[]]),H,os(s)])}function An(e,t,r){let{node:s}=e;return r.htmlWhitespaceSensitivity==="ignore"?[cs(s)?H:tt,Zr(s),t("path"),ts(s)]:[Zr(s),t("path"),ts(s)]}function cs(e){return e.type==="BlockStatement"&&e.program.body.every(t=>ge(t))}function Ln(e){return us(e)&&e.inverse.body.length===1&&e.inverse.body[0].type==="BlockStatement"&&ls(e.inverse.body[0].path,e.path)}function us(e){return e.type==="BlockStatement"&&e.inverse}function es(e,t,r){let{node:s}=e;if(cs(s))return"";let n=t("program");return r.htmlWhitespaceSensitivity==="ignore"?B([tt,n]):B(n)}function rs(e,t,r){let{node:s}=e,n=t("inverse"),i=r.htmlWhitespaceSensitivity==="ignore"?[tt,n]:n;return Ln(s)?i:us(s)?[Cn(s,r),B(i)]:""}function ss(e){return yt(L,K.split(e))}function Dn(e){for(let t=0;t<2;t++){let r=e.getParentNode(t);if((r==null?void 0:r.type)==="AttrNode")return r.name.toLowerCase()}}function Vt(e){return e=typeof e=="string"?e:"",e.split(` +`).length-1}function _n(e){e=typeof e=="string"?e:"";let t=(e.match(/^([^\S\n\r]*[\n\r])+/gu)||[])[0]||"";return Vt(t)}function On(e){e=typeof e=="string"?e:"";let t=(e.match(/([\n\r][^\S\n\r]*)+$/gu)||[])[0]||"";return Vt(t)}function se(e=0){return Array.from({length:Math.min(e,is)}).fill(tt)}function Bn(e,t){let{node:{value:r}}=e,s=de(r,In(e)?!t.singleQuote:t.singleQuote);return[s,Ue(!1,r,s,`\\${s}`),s]}function In(e){let{ancestors:t}=e,r=t.findIndex(s=>s.type!=="SubExpression");return r!==-1&&t[r+1].type==="ConcatStatement"&&t[r+2].type==="AttrNode"}function Rn(e,t){let r=Ze(e,t),s=ke(e,t);return s?B([r,L,R(s)]):r}function ns(e,t){let r=Ze(e,t),s=ke(e,t);return s?[B([r,L,s]),H]:r}function Ze(e,t){return t("path")}function ke(e,t){var n;let{node:r}=e,s=[];return r.params.length>0&&s.push(...e.map(t,"params")),((n=r.hash)==null?void 0:n.pairs.length)>0&&s.push(t("hash")),s.length===0?"":yt(L,s)}function tr(e){return["as |",e.blockParams.join(" "),"|"]}var qn=new Set("!\"#%&'()*+,./;<=>@[\\]^`{|}~"),Vn=new Set(["true","false","null","undefined"]),Fn=(e,t)=>t===0&&e.startsWith("@")?!1:t!==0&&Vn.has(e)||/\s/u.test(e)||/^\d/u.test(e)||Array.prototype.some.call(e,r=>qn.has(r));function Hn(e){return e.tail.length===0&&e.original.includes("/")?e.original:[e.head.original,...e.tail].map((r,s)=>Fn(r,s)?`[${r}]`:r).join(".")}var Un={print:kn,massageAstNode:zr,hasPrettierIgnore:$r,getVisitorKeys:Wr,embed:Yr},hs=Un;var ps=[{linguistLanguageId:155,name:"Handlebars",type:"markup",color:"#f7931e",aliases:["hbs","htmlbars"],extensions:[".handlebars",".hbs"],tmScope:"text.html.handlebars",aceMode:"handlebars",parsers:["glimmer"],vscodeLanguageIds:["handlebars"]}];var xr={};He(xr,{glimmer:()=>Ci});var Mn=Object.freeze([]);function ms(){return Mn}var Wa=ms(),ja=ms();var er=Object.assign;var fs=console;function ds(e,t="unexpected unreachable branch"){throw fs.log("unreachable",e),fs.log(`${t} :: ${JSON.stringify(e)} (${e})`),new Error("code reached unreachable")}var zn=function(){var e=function(it,d,k,g){for(k=k||{},g=it.length;g--;k[it[g]]=d);return k},t=[2,44],r=[1,20],s=[5,14,15,19,29,34,39,44,47,48,52,56,60],n=[1,35],i=[1,38],a=[1,30],o=[1,31],c=[1,32],h=[1,33],p=[1,34],m=[1,37],S=[14,15,19,29,34,39,44,47,48,52,56,60],y=[14,15,19,29,34,44,47,48,52,56,60],E=[15,18],C=[14,15,19,29,34,47,48,52,56,60],P=[33,64,71,79,80,81,82,83,84],w=[23,33,55,64,67,71,74,79,80,81,82,83,84],U=[1,51],q=[23,33,55,64,67,71,74,79,80,81,82,83,84,86],$=[2,43],Nt=[55,64,71,79,80,81,82,83,84],Ct=[1,58],X=[1,59],rt=[1,66],V=[33,64,71,74,79,80,81,82,83,84],Pt=[23,64,71,79,80,81,82,83,84],F=[1,76],st=[64,67,71,79,80,81,82,83,84],A=[33,74],nt=[23,33,55,67,71,74],ue=[1,106],De=[1,118],Ar=[71,76],_e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,expr:49,mustache_repetition0:50,mustache_option0:51,OPEN_UNESCAPED:52,mustache_repetition1:53,mustache_option1:54,CLOSE_UNESCAPED:55,OPEN_PARTIAL:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,sexpr:63,OPEN_SEXPR:64,sexpr_repetition0:65,sexpr_option0:66,CLOSE_SEXPR:67,hash:68,hash_repetition_plus0:69,hashSegment:70,ID:71,EQUALS:72,blockParams:73,OPEN_BLOCK_PARAMS:74,blockParams_repetition_plus0:75,CLOSE_BLOCK_PARAMS:76,path:77,dataName:78,STRING:79,NUMBER:80,BOOLEAN:81,UNDEFINED:82,NULL:83,DATA:84,pathSegments:85,SEP:86,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",52:"OPEN_UNESCAPED",55:"CLOSE_UNESCAPED",56:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",64:"OPEN_SEXPR",67:"CLOSE_SEXPR",71:"ID",72:"EQUALS",74:"OPEN_BLOCK_PARAMS",76:"CLOSE_BLOCK_PARAMS",79:"STRING",80:"NUMBER",81:"BOOLEAN",82:"UNDEFINED",83:"NULL",84:"DATA",86:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[49,1],[49,1],[63,5],[68,1],[70,3],[73,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[78,2],[77,1],[85,3],[85,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[50,0],[50,2],[51,0],[51,1],[53,0],[53,2],[54,0],[54,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[65,0],[65,2],[66,0],[66,1],[69,1],[69,2],[75,1],[75,2]],performAction:function(d,k,g,b,N,l,xt){var u=l.length-1;switch(N){case 1:return l[u-1];case 2:this.$=b.prepareProgram(l[u]);break;case 3:case 4:case 5:case 6:case 7:case 8:case 20:case 27:case 28:case 33:case 34:this.$=l[u];break;case 9:this.$={type:"CommentStatement",value:b.stripComment(l[u]),strip:b.stripFlags(l[u],l[u]),loc:b.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:l[u],value:l[u],loc:b.locInfo(this._$)};break;case 11:this.$=b.prepareRawBlock(l[u-2],l[u-1],l[u],this._$);break;case 12:this.$={path:l[u-3],params:l[u-2],hash:l[u-1]};break;case 13:this.$=b.prepareBlock(l[u-3],l[u-2],l[u-1],l[u],!1,this._$);break;case 14:this.$=b.prepareBlock(l[u-3],l[u-2],l[u-1],l[u],!0,this._$);break;case 15:this.$={open:l[u-5],path:l[u-4],params:l[u-3],hash:l[u-2],blockParams:l[u-1],strip:b.stripFlags(l[u-5],l[u])};break;case 16:case 17:this.$={path:l[u-4],params:l[u-3],hash:l[u-2],blockParams:l[u-1],strip:b.stripFlags(l[u-5],l[u])};break;case 18:this.$={strip:b.stripFlags(l[u-1],l[u-1]),program:l[u]};break;case 19:var at=b.prepareBlock(l[u-2],l[u-1],l[u],l[u],!1,this._$),Yt=b.prepareProgram([at],l[u-1].loc);Yt.chained=!0,this.$={strip:l[u-2].strip,program:Yt,chain:!0};break;case 21:this.$={path:l[u-1],strip:b.stripFlags(l[u-2],l[u])};break;case 22:case 23:this.$=b.prepareMustache(l[u-3],l[u-2],l[u-1],l[u-4],b.stripFlags(l[u-4],l[u]),this._$);break;case 24:this.$={type:"PartialStatement",name:l[u-3],params:l[u-2],hash:l[u-1],indent:"",strip:b.stripFlags(l[u-4],l[u]),loc:b.locInfo(this._$)};break;case 25:this.$=b.preparePartialBlock(l[u-2],l[u-1],l[u],this._$);break;case 26:this.$={path:l[u-3],params:l[u-2],hash:l[u-1],strip:b.stripFlags(l[u-4],l[u])};break;case 29:this.$={type:"SubExpression",path:l[u-3],params:l[u-2],hash:l[u-1],loc:b.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:l[u],loc:b.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:b.id(l[u-2]),value:l[u],loc:b.locInfo(this._$)};break;case 32:this.$=b.id(l[u-1]);break;case 35:this.$={type:"StringLiteral",value:l[u],original:l[u],loc:b.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(l[u]),original:Number(l[u]),loc:b.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:l[u]==="true",original:l[u]==="true",loc:b.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:b.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:b.locInfo(this._$)};break;case 40:this.$=b.preparePath(!0,l[u],this._$);break;case 41:this.$=b.preparePath(!1,l[u],this._$);break;case 42:l[u-2].push({part:b.id(l[u]),original:l[u],separator:l[u-1]}),this.$=l[u-2];break;case 43:this.$=[{part:b.id(l[u]),original:l[u]}];break;case 44:case 46:case 48:case 56:case 62:case 68:case 76:case 80:case 84:case 88:case 92:this.$=[];break;case 45:case 47:case 49:case 57:case 63:case 69:case 77:case 81:case 85:case 89:case 93:case 97:case 99:l[u-1].push(l[u]);break;case 96:case 98:this.$=[l[u]];break}},table:[e([5,14,15,19,29,34,48,52,56,60],t,{3:1,4:2,6:3}),{1:[3]},{5:[1,4]},e([5,39,44,47],[2,2],{7:5,8:6,9:7,10:8,11:9,12:10,13:11,24:15,27:16,16:17,59:19,14:[1,12],15:r,19:[1,23],29:[1,21],34:[1,22],48:[1,13],52:[1,14],56:[1,18],60:[1,24]}),{1:[2,1]},e(s,[2,45]),e(s,[2,3]),e(s,[2,4]),e(s,[2,5]),e(s,[2,6]),e(s,[2,7]),e(s,[2,8]),e(s,[2,9]),{20:26,49:25,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:26,49:39,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(S,t,{6:3,4:40}),e(y,t,{6:3,4:41}),e(E,[2,46],{17:42}),{20:26,49:43,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(C,t,{6:3,4:44}),e([5,14,15,18,19,29,34,39,44,47,48,52,56,60],[2,10]),{20:45,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:46,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:47,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:26,49:48,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(P,[2,76],{50:49}),e(w,[2,27]),e(w,[2,28]),e(w,[2,33]),e(w,[2,34]),e(w,[2,35]),e(w,[2,36]),e(w,[2,37]),e(w,[2,38]),e(w,[2,39]),{20:26,49:50,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(w,[2,41],{86:U}),{71:i,85:52},e(q,$),e(Nt,[2,80],{53:53}),{25:54,38:56,39:Ct,43:57,44:X,45:55,47:[2,52]},{28:60,43:61,44:X,47:[2,54]},{13:63,15:r,18:[1,62]},e(P,[2,84],{57:64}),{26:65,47:rt},e(V,[2,56],{30:67}),e(V,[2,62],{35:68}),e(Pt,[2,48],{21:69}),e(P,[2,88],{61:70}),{20:26,33:[2,78],49:72,51:71,63:27,64:n,68:73,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(st,[2,92],{65:77}),{71:[1,78]},e(w,[2,40],{86:U}),{20:26,49:80,54:79,55:[2,82],63:27,64:n,68:81,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{26:82,47:rt},{47:[2,53]},e(S,t,{6:3,4:83}),{47:[2,20]},{20:84,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(C,t,{6:3,4:85}),{26:86,47:rt},{47:[2,55]},e(s,[2,11]),e(E,[2,47]),{20:26,33:[2,86],49:88,58:87,63:27,64:n,68:89,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(s,[2,25]),{20:90,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(A,[2,58],{20:26,63:27,77:28,78:29,85:36,69:74,70:75,31:91,49:92,68:93,64:n,71:F,79:a,80:o,81:c,82:h,83:p,84:m}),e(A,[2,64],{20:26,63:27,77:28,78:29,85:36,69:74,70:75,36:94,49:95,68:96,64:n,71:F,79:a,80:o,81:c,82:h,83:p,84:m}),{20:26,22:97,23:[2,50],49:98,63:27,64:n,68:99,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:26,33:[2,90],49:101,62:100,63:27,64:n,68:102,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{33:[1,103]},e(P,[2,77]),{33:[2,79]},e([23,33,55,67,74],[2,30],{70:104,71:[1,105]}),e(nt,[2,96]),e(q,$,{72:ue}),{20:26,49:108,63:27,64:n,66:107,67:[2,94],68:109,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(q,[2,42]),{55:[1,110]},e(Nt,[2,81]),{55:[2,83]},e(s,[2,13]),{38:56,39:Ct,43:57,44:X,45:112,46:111,47:[2,74]},e(V,[2,68],{40:113}),{47:[2,18]},e(s,[2,14]),{33:[1,114]},e(P,[2,85]),{33:[2,87]},{33:[1,115]},{32:116,33:[2,60],73:117,74:De},e(V,[2,57]),e(A,[2,59]),{33:[2,66],37:119,73:120,74:De},e(V,[2,63]),e(A,[2,65]),{23:[1,121]},e(Pt,[2,49]),{23:[2,51]},{33:[1,122]},e(P,[2,89]),{33:[2,91]},e(s,[2,22]),e(nt,[2,97]),{72:ue},{20:26,49:123,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{67:[1,124]},e(st,[2,93]),{67:[2,95]},e(s,[2,23]),{47:[2,19]},{47:[2,75]},e(A,[2,70],{20:26,63:27,77:28,78:29,85:36,69:74,70:75,41:125,49:126,68:127,64:n,71:F,79:a,80:o,81:c,82:h,83:p,84:m}),e(s,[2,24]),e(s,[2,21]),{33:[1,128]},{33:[2,61]},{71:[1,130],75:129},{33:[1,131]},{33:[2,67]},e(E,[2,12]),e(C,[2,26]),e(nt,[2,31]),e(w,[2,29]),{33:[2,72],42:132,73:133,74:De},e(V,[2,69]),e(A,[2,71]),e(S,[2,15]),{71:[1,135],76:[1,134]},e(Ar,[2,98]),e(y,[2,16]),{33:[1,136]},{33:[2,73]},{33:[2,32]},e(Ar,[2,99]),e(S,[2,17])],defaultActions:{4:[2,1],55:[2,53],57:[2,20],61:[2,55],73:[2,79],81:[2,83],85:[2,18],89:[2,87],99:[2,51],102:[2,91],109:[2,95],111:[2,19],112:[2,75],117:[2,61],120:[2,67],133:[2,73],134:[2,32]},parseError:function(d,k){if(k.recoverable)this.trace(d);else{var g=new Error(d);throw g.hash=k,g}},parse:function(d){var k=this,g=[0],b=[],N=[null],l=[],xt=this.table,u="",at=0,Yt=0,Lr=0,zs=2,Dr=1,Ys=l.slice.call(arguments,1),x=Object.create(this.lexer),dt={yy:{}};for(var Be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Be)&&(dt.yy[Be]=this.yy[Be]);x.setInput(d,dt.yy),dt.yy.lexer=x,dt.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Ie=x.yylloc;l.push(Ie);var Gs=x.options&&x.options.ranges;typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ai(W){g.length=g.length-2*W,N.length=N.length-W,l.length=l.length-W}for(var Ks=function(){var W;return W=x.lex()||Dr,typeof W!="number"&&(W=k.symbols_[W]||W),W},O,Re,gt,M,Li,qe,At={},he,Z,_r,pe;;){if(gt=g[g.length-1],this.defaultActions[gt]?M=this.defaultActions[gt]:((O===null||typeof O>"u")&&(O=Ks()),M=xt[gt]&&xt[gt][O]),typeof M>"u"||!M.length||!M[0]){var Ve="";pe=[];for(he in xt[gt])this.terminals_[he]&&he>zs&&pe.push("'"+this.terminals_[he]+"'");x.showPosition?Ve="Parse error on line "+(at+1)+`: +`+x.showPosition()+` +Expecting `+pe.join(", ")+", got '"+(this.terminals_[O]||O)+"'":Ve="Parse error on line "+(at+1)+": Unexpected "+(O==Dr?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(Ve,{text:x.match,token:this.terminals_[O]||O,line:x.yylineno,loc:Ie,expected:pe})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gt+", token: "+O);switch(M[0]){case 1:g.push(O),N.push(x.yytext),l.push(x.yylloc),g.push(M[1]),O=null,Re?(O=Re,Re=null):(Yt=x.yyleng,u=x.yytext,at=x.yylineno,Ie=x.yylloc,Lr>0&&Lr--);break;case 2:if(Z=this.productions_[M[1]][1],At.$=N[N.length-Z],At._$={first_line:l[l.length-(Z||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(Z||1)].first_column,last_column:l[l.length-1].last_column},Gs&&(At._$.range=[l[l.length-(Z||1)].range[0],l[l.length-1].range[1]]),qe=this.performAction.apply(At,[u,Yt,at,dt.yy,M[1],N,l].concat(Ys)),typeof qe<"u")return qe;Z&&(g=g.slice(0,-1*Z*2),N=N.slice(0,-1*Z),l=l.slice(0,-1*Z)),g.push(this.productions_[M[1]][0]),N.push(At.$),l.push(At._$),_r=xt[g[g.length-2]][g[g.length-1]],g.push(_r);break;case 3:return!0}}return!0}},Ms=function(){var it={EOF:1,parseError:function(k,g){if(this.yy.parser)this.yy.parser.parseError(k,g);else throw new Error(k)},setInput:function(d,k){return this.yy=k||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var k=d.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},unput:function(d){var k=d.length,g=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var N=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===b.length?this.yylloc.first_column:0)+b[b.length-g.length].length-g[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[N[0],N[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(d){this.unput(this.match.slice(d))},pastInput:function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var d=this.pastInput(),k=new Array(d.length+1).join("-");return d+this.upcomingInput()+` +`+k+"^"},test_match:function(d,k){var g,b,N;if(this.options.backtrack_lexer&&(N={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(N.yylloc.range=this.yylloc.range.slice(0))),b=d[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],g=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var l in N)this[l]=N[l];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,k,g,b;this._more||(this.yytext="",this.match="");for(var N=this._currentRules(),l=0;lk[0].length)){if(k=g,b=l,this.options.backtrack_lexer){if(d=this.test_match(g,N[l]),d!==!1)return d;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(d=this.test_match(k,N[b]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var k=this.next();return k||this.lex()},begin:function(k){this.conditionStack.push(k)},popState:function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},pushState:function(k){this.begin(k)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(k,g,b,N){function l(u,at){return g.yytext=g.yytext.substring(u,g.yyleng-at+u)}var xt=N;switch(b){case 0:if(g.yytext.slice(-2)==="\\\\"?(l(0,1),this.begin("mu")):g.yytext.slice(-1)==="\\"?(l(0,1),this.begin("emu")):this.begin("mu"),g.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(l(5,9),18);case 5:return 15;case 6:return this.popState(),14;break;case 7:return 64;case 8:return 67;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 56;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 52;case 20:return 48;case 21:this.unput(g.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 72;case 25:return 71;case 26:return 71;case 27:return 86;case 28:break;case 29:return this.popState(),55;break;case 30:return this.popState(),33;break;case 31:return g.yytext=l(1,2).replace(/\\"/g,'"'),79;break;case 32:return g.yytext=l(1,2).replace(/\\'/g,"'"),79;break;case 33:return 84;case 34:return 81;case 35:return 81;case 36:return 82;case 37:return 83;case 38:return 80;case 39:return 74;case 40:return 76;case 41:return 71;case 42:return g.yytext=g.yytext.replace(/\\([\\\]])/g,"$1"),71;break;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return it}();_e.lexer=Ms;function Oe(){this.yy={}}return Oe.prototype=_e,_e.Parser=Oe,new Oe}(),Se=zn;var rr=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function sr(e,t){var r=t&&t.loc,s,n,i,a;r&&(s=r.start.line,n=r.end.line,i=r.start.column,a=r.end.column,e+=" - "+s+":"+i);for(var o=Error.prototype.constructor.call(this,e),c=0;cor,id:()=>Yn,prepareBlock:()=>Jn,prepareMustache:()=>jn,preparePartialBlock:()=>Xn,preparePath:()=>Wn,prepareProgram:()=>$n,prepareRawBlock:()=>Qn,stripComment:()=>Kn,stripFlags:()=>Gn});function ar(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new ot(e.path.original+" doesn't match "+t,r)}}function or(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}function Yn(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function Gn(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function Kn(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function Wn(e,t,r){r=this.locInfo(r);for(var s=e?"@":"",n=[],i=0,a=0,o=t.length;a0)throw new ot("Invalid path: "+s,{loc:r});c===".."&&i++}else n.push(c)}return{type:"PathExpression",data:e,depth:i,parts:n,original:s,loc:r}}function jn(e,t,r,s,n,i){var a=s.charAt(3)||s.charAt(2),o=a!=="{"&&a!=="&",c=/\*/.test(s);return{type:c?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:o,strip:n,loc:this.locInfo(i)}}function Qn(e,t,r,s){ar(e,r),s=this.locInfo(s);var n={type:"Program",body:t,strip:{},loc:s};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}}function Jn(e,t,r,s,n,i){s&&s.path&&ar(e,s);var a=/\*/.test(e.open);t.blockParams=e.blockParams;var o,c;if(r){if(a)throw new ot("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=s.strip),c=r.strip,o=r.program}return n&&(n=o,o=t,t=n),{type:a?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:o,openStrip:e.strip,inverseStrip:c,closeStrip:s&&s.strip,loc:this.locInfo(i)}}function $n(e,t){if(!t&&e.length){var r=e[0].loc,s=e[e.length-1].loc;r&&s&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}function Xn(e,t,r,s){return ar(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(s)}}var Ss={};for(we in ne)Object.prototype.hasOwnProperty.call(ne,we)&&(Ss[we]=ne[we]);var we;function Te(e,t){if(e.type==="Program")return e;Se.yy=Ss,Se.yy.locInfo=function(s){return new or(t&&t.srcName,s)};var r=Se.parse(e);return r}function lr(e,t){var r=Te(e,t),s=new ks(t);return s.accept(r)}var Es={Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",amp:"&",AMP:"&",andand:"\u2A55",And:"\u2A53",and:"\u2227",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angmsd:"\u2221",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",apacir:"\u2A6F",ap:"\u2248",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsolb:"\u29C5",bsol:"\\",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",cap:"\u2229",Cap:"\u22D2",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25CB",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cup:"\u222A",Cup:"\u22D3",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21A1",dArr:"\u21D3",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21CA",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21D3",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21BD",DownRightTeeVector:"\u295F",DownRightVectorBar:"\u2957",DownRightVector:"\u21C1",DownTeeArrow:"\u21A7",DownTee:"\u22A4",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",Ecirc:"\xCA",ecirc:"\xEA",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",gescc:"\u2AA9",ges:"\u2A7E",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2AA5",gl:"\u2277",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gtcc:"\u2AA7",gtcir:"\u2A7A",gt:">",GT:">",Gt:"\u226B",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",harrcir:"\u2948",harr:"\u2194",hArr:"\u21D4",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",incare:"\u2105",in:"\u2208",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",intcal:"\u22BA",int:"\u222B",Int:"\u222C",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larrb:"\u21E4",larrbfs:"\u291F",larr:"\u2190",Larr:"\u219E",lArr:"\u21D0",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",latail:"\u2919",lAtail:"\u291B",lat:"\u2AAB",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",LeftArrowBar:"\u21E4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21D0",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21C3",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTeeArrow:"\u21A4",LeftTee:"\u22A3",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangleBar:"\u29CF",LeftTriangle:"\u22B2",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21BF",LeftVectorBar:"\u2952",LeftVector:"\u21BC",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",lescc:"\u2AA8",les:"\u2A7D",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21C7",ll:"\u226A",Ll:"\u22D8",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoustache:"\u23B0",lmoust:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftrightarrow:"\u27F7",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longmapsto:"\u27FC",longrightarrow:"\u27F6",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2AA6",ltcir:"\u2A79",lt:"<",LT:"<",Lt:"\u226A",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",midast:"*",midcir:"\u2AF0",mid:"\u2223",middot:"\xB7",minusb:"\u229F",minus:"\u2212",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266E",naturals:"\u2115",natur:"\u266E",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` +`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangle:"\u22EB",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",nprec:"\u2280",npreceq:"\u2AAF\u0338",npre:"\u2AAF\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",Ocirc:"\xD4",ocirc:"\xF4",ocir:"\u229A",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",orarr:"\u21BB",Or:"\u2A54",or:"\u2228",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",otimesas:"\u2A36",Otimes:"\u2A37",otimes:"\u2297",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",para:"\xB6",parallel:"\u2225",par:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plus:"+",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",prap:"\u2AB7",Pr:"\u2ABB",pr:"\u227A",prcue:"\u227C",precapprox:"\u2AB7",prec:"\u227A",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",pre:"\u2AAF",prE:"\u2AB3",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportional:"\u221D",Proportion:"\u2237",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21A0",rArr:"\u21D2",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",Re:"\u211C",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrowBar:"\u21E5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21D2",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVectorBar:"\u2955",RightDownVector:"\u21C2",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTeeArrow:"\u21A6",RightTee:"\u22A2",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangleBar:"\u29D0",RightTriangle:"\u22B3",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVectorBar:"\u2954",RightUpVector:"\u21BE",RightVectorBar:"\u2953",RightVector:"\u21C0",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoustache:"\u23B1",rmoust:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2ABC",sc:"\u227B",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdotb:"\u22A1",sdot:"\u22C5",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",solbar:"\u233F",solb:"\u29C4",sol:"/",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squ:"\u25A1",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succapprox:"\u2AB8",succ:"\u227B",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",Sup:"\u22D1",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2A31",timesb:"\u22A0",times:"\xD7",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",topbot:"\u2336",topcir:"\u2AF1",top:"\u22A4",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",uarr:"\u2191",Uarr:"\u219F",uArr:"\u21D1",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21D1",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21D5",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTeeArrow:"\u21A5",UpTee:"\u22A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",veebar:"\u22BB",vee:"\u2228",Vee:"\u22C1",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xharr:"\u27F7",xhArr:"\u27FA",Xi:"\u039E",xi:"\u03BE",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",yuml:"\xFF",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",zfr:"\u{1D537}",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"},Zn=/^#[xX]([A-Fa-f0-9]+)$/,ti=/^#([0-9]+)$/,ei=/^([A-Za-z0-9]+)$/,cr=function(){function e(t){this.named=t}return e.prototype.parse=function(t){if(t){var r=t.match(Zn);if(r)return String.fromCharCode(parseInt(r[1],16));if(r=t.match(ti),r)return String.fromCharCode(parseInt(r[1],10));if(r=t.match(ei),r)return this.named[r[1]]}},e}(),ri=/[\t\n\f ]/,si=/[A-Za-z]/,ni=/\r\n?/g;function _(e){return ri.test(e)}function vs(e){return si.test(e)}function ii(e){return e.replace(ni,` +`)}var ur=function(){function e(t,r,s){s===void 0&&(s="precompile"),this.delegate=t,this.entityParser=r,this.mode=s,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var n=this.peek();if(n==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&n===` +`){var i=this.tagNameBuffer.toLowerCase();(i==="pre"||i==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var n=this.peek(),i=this.tagNameBuffer;n==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):n==="&"&&i!=="script"&&i!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(n))},tagOpen:function(){var n=this.consume();n==="!"?this.transitionTo("markupDeclarationOpen"):n==="/"?this.transitionTo("endTagOpen"):(n==="@"||n===":"||vs(n))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(n))},markupDeclarationOpen:function(){var n=this.consume();if(n==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var i=n.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();i==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var n=this.consume();_(n)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var n=this.consume();_(n)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase()))},doctypeName:function(){var n=this.consume();_(n)?this.transitionTo("afterDoctypeName"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase())},afterDoctypeName:function(){var n=this.consume();if(!_(n))if(n===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var i=n.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),a=i.toUpperCase()==="PUBLIC",o=i.toUpperCase()==="SYSTEM";(a||o)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),a?this.transitionTo("afterDoctypePublicKeyword"):o&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var n=this.peek();_(n)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):n==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):n==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):n===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},doctypePublicIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},afterDoctypePublicIdentifier:function(){var n=this.consume();_(n)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var n=this.consume();_(n)||(n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(n)},doctypeSystemIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(n)},afterDoctypeSystemIdentifier:function(){var n=this.consume();_(n)||n===">"&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var n=this.consume();n==="-"?this.transitionTo("commentStartDash"):n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(n),this.transitionTo("comment"))},commentStartDash:function(){var n=this.consume();n==="-"?this.transitionTo("commentEnd"):n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var n=this.consume();n==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(n)},commentEndDash:function(){var n=this.consume();n==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+n),this.transitionTo("comment"))},commentEnd:function(){var n=this.consume();n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+n),this.transitionTo("comment"))},tagName:function(){var n=this.consume();_(n)?this.transitionTo("beforeAttributeName"):n==="/"?this.transitionTo("selfClosingStartTag"):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(n)},endTagName:function(){var n=this.consume();_(n)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):n==="/"?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(n)},beforeAttributeName:function(){var n=this.peek();if(_(n)){this.consume();return}else n==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):n===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):n==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(n)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var n=this.peek();_(n)?(this.transitionTo("afterAttributeName"),this.consume()):n==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):n==='"'||n==="'"||n==="<"?(this.delegate.reportSyntaxError(n+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(n)):(this.consume(),this.delegate.appendToAttributeName(n))},afterAttributeName:function(){var n=this.peek();if(_(n)){this.consume();return}else n==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(n))},beforeAttributeValue:function(){var n=this.peek();_(n)?this.consume():n==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):n==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(n))},attributeValueDoubleQuoted:function(){var n=this.consume();n==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):n==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(n)},attributeValueSingleQuoted:function(){var n=this.consume();n==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):n==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(n)},attributeValueUnquoted:function(){var n=this.peek();_(n)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):n==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):n===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(n))},afterAttributeValueQuoted:function(){var n=this.peek();_(n)?(this.consume(),this.transitionTo("beforeAttributeName")):n==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):n===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){var n=this.peek();n===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var n=this.consume();(n==="@"||n===":"||vs(n))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(n))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(t){this.state=t},e.prototype.tokenize=function(t){this.reset(),this.tokenizePart(t),this.tokenizeEOF()},e.prototype.tokenizePart=function(t){for(this.input+=ii(t);this.index"||t==="style"&&this.input.substring(this.index,this.index+8)!==""||t==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},e}(),ao=function(){function e(t,r){r===void 0&&(r={}),this.options=r,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new ur(this,t,r.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(t){return this.tokens=[],this.tokenizer.tokenize(t),this.tokens},e.prototype.tokenizePart=function(t){return this.tokens=[],this.tokenizer.tokenizePart(t),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var t=this.token;if(t===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return t;for(var r=0;r\xa0]/u,So=new RegExp(oi.source,"gu");var gr=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function li(e){var t;return gr.has(e.toLowerCase())&&((t=e[0])==null?void 0:t.toLowerCase())===e[0]}function ce(e){return!!e&&e.length>0}function Cr(e){return e.length===0?void 0:e[e.length-1]}function ci(e){return e.length===0?void 0:e[0]}var pt=Object.freeze({line:1,column:0}),ui=Object.freeze({source:"(synthetic)",start:pt,end:pt}),br=Object.freeze({source:"(nonexistent)",start:pt,end:pt}),ht=Object.freeze({source:"(broken)",start:pt,end:pt}),yr=class{constructor(t){this._whens=t}first(t){for(let r of this._whens){let s=r.match(t);if(ce(s))return s[0]}return null}},xe=class{get(t,r){let s=this._map.get(t);return s||(s=r(),this._map.set(t,s),s)}add(t,r){this._map.set(t,r)}match(t){let r=function(a){switch(a){case"Broken":case"InternalsSynthetic":case"NonExistent":return"IS_INVISIBLE";default:return a}}(t),s=[],n=this._map.get(r),i=this._map.get("MATCH_ANY");return n&&s.push(n),i&&s.push(i),s}constructor(){this._map=new Map}};function _s(e){return e(new kr).validate()}var kr=class{validate(){return(t,r)=>this.matchFor(t.kind,r.kind)(t,r)}matchFor(t,r){let s=this._whens.match(t);return ce(),new yr(s).first(r)}when(t,r,s){return this._whens.get(t,()=>new xe).add(r,s),this}constructor(){this._whens=new xe}},Sr=class e{static synthetic(t){let r=D.synthetic(t);return new e({loc:r,chars:t})}static load(t,r){return new e({loc:D.load(t,r[1]),chars:r[0]})}constructor(t){this.loc=t.loc,this.chars=t.chars}getString(){return this.chars}serialize(){return[this.chars,this.loc.serialize()]}},D=class e{static get NON_EXISTENT(){return new et("NonExistent",br).wrap()}static load(t,r){return typeof r=="number"?e.forCharPositions(t,r,r):typeof r=="string"?e.synthetic(r):Array.isArray(r)?e.forCharPositions(t,r[0],r[1]):r==="NonExistent"?e.NON_EXISTENT:r==="Broken"?e.broken(ht):void ds(r)}static forHbsLoc(t,r){let s=new mt(t,r.start),n=new mt(t,r.end);return new oe(t,{start:s,end:n},r).wrap()}static forCharPositions(t,r,s){let n=new Tt(t,r),i=new Tt(t,s);return new ae(t,{start:n,end:i}).wrap()}static synthetic(t){return new et("InternalsSynthetic",br,t).wrap()}static broken(t=ht){return new et("Broken",t).wrap()}constructor(t){var r;this.data=t,this.isInvisible=(r=t.kind)!=="CharPosition"&&r!=="HbsPosition"}getStart(){return this.data.getStart().wrap()}getEnd(){return this.data.getEnd().wrap()}get loc(){let t=this.data.toHbsSpan();return t===null?ht:t.toHbsLoc()}get module(){return this.data.getModule()}get startPosition(){return this.loc.start}get endPosition(){return this.loc.end}toJSON(){return this.loc}withStart(t){return J(t.data,this.data.getEnd())}withEnd(t){return J(this.data.getStart(),t.data)}asString(){return this.data.asString()}toSlice(t){let r=this.data.asString();return Ds&&t!==void 0&&r!==t&&console.warn(`unexpectedly found ${JSON.stringify(r)} when slicing source, but expected ${JSON.stringify(t)}`),new Sr({loc:this,chars:t||r})}get start(){return this.loc.start}set start(t){this.data.locDidUpdate({start:t})}get end(){return this.loc.end}set end(t){this.data.locDidUpdate({end:t})}get source(){return this.module}collapse(t){switch(t){case"start":return this.getStart().collapsed();case"end":return this.getEnd().collapsed()}}extend(t){return J(this.data.getStart(),t.data.getEnd())}serialize(){return this.data.serialize()}slice({skipStart:t=0,skipEnd:r=0}){return J(this.getStart().move(t).data,this.getEnd().move(-r).data)}sliceStartChars({skipStart:t=0,chars:r}){return J(this.getStart().move(t).data,this.getStart().move(t+r).data)}sliceEndChars({skipEnd:t=0,chars:r}){return J(this.getEnd().move(t-r).data,this.getStart().move(-t).data)}},Ut,ae=class{constructor(t,r){Lt(this,Ut);this.source=t,this.charPositions=r,this.kind="CharPosition",Y(this,Ut,null)}wrap(){return new D(this)}asString(){return this.source.slice(this.charPositions.start.charPos,this.charPositions.end.charPos)}getModule(){return this.source.module}getStart(){return this.charPositions.start}getEnd(){return this.charPositions.end}locDidUpdate(){}toHbsSpan(){let t=I(this,Ut);if(t===null){let r=this.charPositions.start.toHbsPos(),s=this.charPositions.end.toHbsPos();t=Y(this,Ut,r===null||s===null?ft:new oe(this.source,{start:r,end:s}))}return t===ft?null:t}serialize(){let{start:{charPos:t},end:{charPos:r}}=this.charPositions;return t===r?t:[t,r]}toCharPosSpan(){return this}};Ut=new WeakMap;var ut,Et,oe=class{constructor(t,r,s=null){Lt(this,ut);Lt(this,Et);this.source=t,this.hbsPositions=r,this.kind="HbsPosition",Y(this,ut,null),Y(this,Et,s)}serialize(){let t=this.toCharPosSpan();return t===null?"Broken":t.wrap().serialize()}wrap(){return new D(this)}updateProvided(t,r){I(this,Et)&&(I(this,Et)[r]=t),Y(this,ut,null),Y(this,Et,{start:t,end:t})}locDidUpdate({start:t,end:r}){t!==void 0&&(this.updateProvided(t,"start"),this.hbsPositions.start=new mt(this.source,t,null)),r!==void 0&&(this.updateProvided(r,"end"),this.hbsPositions.end=new mt(this.source,r,null))}asString(){let t=this.toCharPosSpan();return t===null?"":t.asString()}getModule(){return this.source.module}getStart(){return this.hbsPositions.start}getEnd(){return this.hbsPositions.end}toHbsLoc(){return{start:this.hbsPositions.start.hbsPos,end:this.hbsPositions.end.hbsPos}}toHbsSpan(){return this}toCharPosSpan(){let t=I(this,ut);if(t===null){let r=this.hbsPositions.start.toCharPos(),s=this.hbsPositions.end.toCharPos();if(!r||!s)return t=Y(this,ut,ft),null;t=Y(this,ut,new ae(this.source,{start:r,end:s}))}return t===ft?null:t}};ut=new WeakMap,Et=new WeakMap;var et=class{constructor(t,r,s=null){this.kind=t,this.loc=r,this.string=s}serialize(){switch(this.kind){case"Broken":case"NonExistent":return this.kind;case"InternalsSynthetic":return this.string||""}}wrap(){return new D(this)}asString(){return this.string||""}locDidUpdate({start:t,end:r}){t!==void 0&&(this.loc.start=t),r!==void 0&&(this.loc.end=r)}getModule(){return"an unknown module"}getStart(){return new le(this.kind,this.loc.start)}getEnd(){return new le(this.kind,this.loc.end)}toCharPosSpan(){return this}toHbsSpan(){return null}toHbsLoc(){return ht}},J=_s(e=>e.when("HbsPosition","HbsPosition",(t,r)=>new oe(t.source,{start:t,end:r}).wrap()).when("CharPosition","CharPosition",(t,r)=>new ae(t.source,{start:t,end:r}).wrap()).when("CharPosition","HbsPosition",(t,r)=>{let s=r.toCharPos();return s===null?new et("Broken",ht).wrap():J(t,s)}).when("HbsPosition","CharPosition",(t,r)=>{let s=t.toCharPos();return s===null?new et("Broken",ht).wrap():J(s,r)}).when("IS_INVISIBLE","MATCH_ANY",t=>new et(t.kind,ht).wrap()).when("MATCH_ANY","IS_INVISIBLE",(t,r)=>new et(r.kind,ht).wrap())),ft="BROKEN",Mt=class e{static forHbsPos(t,r){return new mt(t,r,null).wrap()}static broken(t=pt){return new le("Broken",t).wrap()}constructor(t){this.data=t}get offset(){let t=this.data.toCharPos();return t===null?null:t.offset}eql(t){return hi(this.data,t.data)}until(t){return J(this.data,t.data)}move(t){let r=this.data.toCharPos();if(r===null)return e.broken();{let s=r.offset+t;return r.source.validate(s)?new Tt(r.source,s).wrap():e.broken()}}collapsed(){return J(this.data,this.data)}toJSON(){return this.data.toJSON()}},Tt=class{constructor(t,r){this.source=t,this.charPos=r,this.kind="CharPosition",this._locPos=null}toCharPos(){return this}toJSON(){let t=this.toHbsPos();return t===null?pt:t.toJSON()}wrap(){return new Mt(this)}get offset(){return this.charPos}toHbsPos(){let t=this._locPos;if(t===null){let r=this.source.hbsPosFor(this.charPos);this._locPos=t=r===null?ft:new mt(this.source,r,this.charPos)}return t===ft?null:t}},mt=class{constructor(t,r,s=null){this.source=t,this.hbsPos=r,this.kind="HbsPosition",this._charPos=s===null?null:new Tt(t,s)}toCharPos(){let t=this._charPos;if(t===null){let r=this.source.charPosFor(this.hbsPos);this._charPos=t=r===null?ft:new Tt(this.source,r)}return t===ft?null:t}toJSON(){return this.hbsPos}wrap(){return new Mt(this)}toHbsPos(){return this}},le=class{constructor(t,r){this.kind=t,this.pos=r}toCharPos(){return null}toJSON(){return this.pos}wrap(){return new Mt(this)}get offset(){return null}},hi=_s(e=>e.when("HbsPosition","HbsPosition",({hbsPos:t},{hbsPos:r})=>t.column===r.column&&t.line===r.line).when("CharPosition","CharPosition",({charPos:t},{charPos:r})=>t===r).when("CharPosition","HbsPosition",({offset:t},r)=>{var s;return t===((s=r.toCharPos())==null?void 0:s.offset)}).when("HbsPosition","CharPosition",(t,{offset:r})=>{var s;return((s=t.toCharPos())==null?void 0:s.offset)===r}).when("MATCH_ANY","MATCH_ANY",()=>!1)),wt=class e{static from(t,r={}){var s;return new e(t,(s=r.meta)==null?void 0:s.moduleName)}constructor(t,r="an unknown module"){this.source=t,this.module=r}validate(t){return t>=0&&t<=this.source.length}slice(t,r){return this.source.slice(t,r)}offsetFor(t,r){return Mt.forHbsPos(this,{line:t,column:r})}spanFor({start:t,end:r}){return D.forHbsLoc(this,{start:{line:t.line,column:t.column},end:{line:r.line,column:r.column}})}hbsPosFor(t){let r=0,s=0;if(t>this.source.length)return null;for(;;){let n=this.source.indexOf(` +`,s);if(t<=n||n===-1)return{line:r+1,column:t-s};r+=1,s=n+1}}charPosFor(t){let{line:r,column:s}=t,n=this.source.length,i=0,a=0;for(;ao)return o;if(Ds){let c=this.hbsPosFor(a+s);c.line,c.column}return a+s}if(o===-1)return 0;i+=1,a=o+1}return n}};function v(e,t){let{module:r,loc:s}=t,{line:n,column:i}=s.start,a=t.asString(),o=a?` + +| +| ${a.split(` +`).join(` +| `)} +| + +`:"",c=new Error(`${e}: ${o}(error occurred in '${r}' @ line ${n} : column ${i})`);return c.name="SyntaxError",c.location=t,c.code=a,c}var pi={Template:["body"],Block:["body"],MustacheStatement:["path","params","hash"],BlockStatement:["path","params","hash","program","inverse"],ElementModifierStatement:["path","params","hash"],CommentStatement:[],MustacheCommentStatement:[],ElementNode:["attributes","modifiers","children","comments"],AttrNode:["value"],TextNode:[],ConcatStatement:["parts"],SubExpression:["path","params","hash"],PathExpression:[],StringLiteral:[],BooleanLiteral:[],NumberLiteral:[],NullLiteral:[],UndefinedLiteral:[],Hash:["pairs"],HashPair:["value"]},Pr=function(){function e(t,r,s,n){let i=Error.call(this,t);this.key=n,this.message=t,this.node=r,this.parent=s,i.stack&&(this.stack=i.stack)}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}();function Ts(e,t,r){return new Pr("Cannot remove a node unless it is part of an array",e,t,r)}function fi(e,t,r){return new Pr("Cannot replace a node with multiple nodes unless it is part of an array",e,t,r)}function Ns(e,t){return new Pr("Replacing and removing in key handlers is not yet supported.",e,null,t)}var zt=class{constructor(t,r=null,s=null){this.node=t,this.parent=r,this.parentKey=s}get parentNode(){return this.parent?this.parent.node:null}parents(){return{[Symbol.iterator]:()=>new vr(this)}}},vr=class{constructor(t){this.path=t}next(){return this.path.parent?(this.path=this.path.parent,{done:!1,value:this.path}):{done:!0,value:null}}};function Os(e){return typeof e=="function"?e:e.enter}function Bs(e){return typeof e=="function"?void 0:e.exit}function Ae(e,t){let r,s,n,{node:i,parent:a,parentKey:o}=t,c=function(h,p){if(h.Program&&(p==="Template"&&!h.Template||p==="Block"&&!h.Block))return h.Program;let m=h[p];return m!==void 0?m:h.All}(e,i.type);if(c!==void 0&&(r=Os(c),s=Bs(c)),r!==void 0&&(n=r(i,t)),n!=null){if(JSON.stringify(i)!==JSON.stringify(n))return Array.isArray(n)?(Is(e,n,a,o),n):Ae(e,new zt(n,a,o))||n;n=void 0}if(n===void 0){let h=pi[i.type];for(let p=0;ptypeof t=="string"?f.var({name:t,loc:D.synthetic(t)}):t)}function xs(e=[],t=[],r=!1,s){return f.blockItself({body:e,params:qs(t),chained:r,loc:T(s||null)})}function As(e=[],t=[],r){return f.template({body:e,blockParams:t,loc:T(r||null)})}function T(...e){if(e.length===1){let t=e[0];return t&&typeof t=="object"?D.forHbsLoc(pr(),t):D.forHbsLoc(pr(),ui)}{let[t,r,s,n,i]=e,a=i?new wt("",i):pr();return D.forHbsLoc(a,{start:{line:t,column:r},end:{line:s||t,column:n||r}})}}var bi={mustache:function(e,t=[],r=ie([]),s=!1,n,i){return f.mustache({path:ct(e),params:t,hash:r,trusting:s,strip:i,loc:T(n||null)})},block:function(e,t,r,s,n=null,i,a,o,c){let h,p=null;return h=s.type==="Template"?f.blockItself({params:qs(s.blockParams),body:s.body,loc:s.loc}):s,(n==null?void 0:n.type)==="Template"?(n.blockParams.length,p=f.blockItself({params:[],body:n.body,loc:n.loc})):p=n,f.block({path:ct(e),params:t||[],hash:r||ie([]),defaultBlock:h,elseBlock:p,loc:T(i||null),openStrip:a,inverseStrip:o,closeStrip:c})},comment:function(e,t){return f.comment({value:e,loc:T(t||null)})},mustacheComment:function(e,t){return f.mustacheComment({value:e,loc:T(t||null)})},element:function(e,t={}){let r,s,{attrs:n,blockParams:i,modifiers:a,comments:o,children:c,openTag:h,closeTag:p,loc:m}=t;typeof e=="string"?e.endsWith("/")?(r=ct(e.slice(0,-1)),s=!0):r=ct(e):"type"in e?(e.type,e.type,r=e):"path"in e?(e.path.type,e.path.type,r=e.path,s=e.selfClosing):(r=ct(e.name),s=e.selfClosing);let S=i==null?void 0:i.map(E=>typeof E=="string"?Ps(E):E),y=null;return p?y=T(p):p===void 0&&(y=s||li(r.original)?null:T(null)),f.element({path:r,selfClosing:s||!1,attributes:n||[],params:S||[],modifiers:a||[],comments:o||[],children:c||[],openTag:T(h||null),closeTag:y,loc:T(m||null)})},elementModifier:function(e,t,r,s){return f.elementModifier({path:ct(e),params:t||[],hash:r||ie([]),loc:T(s||null)})},attr:function(e,t,r){return f.attr({name:e,value:t,loc:T(r||null)})},text:function(e="",t){return f.text({chars:e,loc:T(t||null)})},sexpr:function(e,t=[],r=ie([]),s){return f.sexpr({path:ct(e),params:t,hash:r,loc:T(s||null)})},concat:function(e,t){if(!ce(e))throw new Error("b.concat requires at least one part");return f.concat({parts:e,loc:T(t||null)})},hash:ie,pair:function(e,t,r){return f.pair({key:e,value:t,loc:T(r||null)})},literal:Pe,program:function(e,t,r){return t&&t.length?xs(e,t,!1,r):As(e,[],r)},blockItself:xs,template:As,loc:T,pos:function(e,t){return f.pos({line:e,column:t})},path:ct,fullPath:function(e,t=[],r){return f.path({head:e,tail:t,loc:T(r||null)})},head:function(e,t){return f.head({original:e,loc:T(t||null)})},at:function(e,t){return f.atName({name:e,loc:T(t||null)})},var:Ps,this:function(e){return f.this({loc:T(e||null)})},string:fr("StringLiteral"),boolean:fr("BooleanLiteral"),number:fr("NumberLiteral"),undefined:()=>Pe("UndefinedLiteral",void 0),null:()=>Pe("NullLiteral",null)};function fr(e){return function(t,r){return Pe(e,t,r)}}var Ce={close:!1,open:!1},f=new class{pos({line:e,column:t}){return{line:e,column:t}}blockItself({body:e,params:t,chained:r=!1,loc:s}){return{type:"Block",body:e,params:t,get blockParams(){return this.params.map(n=>n.name)},set blockParams(n){this.params=n.map(i=>f.var({name:i,loc:D.synthetic(i)}))},chained:r,loc:s}}template({body:e,blockParams:t,loc:r}){return{type:"Template",body:e,blockParams:t,loc:r}}mustache({path:e,params:t,hash:r,trusting:s,loc:n,strip:i=Ce}){return function({path:a,params:o,hash:c,trusting:h,strip:p,loc:m}){let S={type:"MustacheStatement",path:a,params:o,hash:c,trusting:h,strip:p,loc:m};return Object.defineProperty(S,"escaped",{enumerable:!1,get(){return!this.trusting},set(y){this.trusting=!y}}),S}({path:e,params:t,hash:r,trusting:s,strip:i,loc:n})}block({path:e,params:t,hash:r,defaultBlock:s,elseBlock:n=null,loc:i,openStrip:a=Ce,inverseStrip:o=Ce,closeStrip:c=Ce}){return{type:"BlockStatement",path:e,params:t,hash:r,program:s,inverse:n,loc:i,openStrip:a,inverseStrip:o,closeStrip:c}}comment({value:e,loc:t}){return{type:"CommentStatement",value:e,loc:t}}mustacheComment({value:e,loc:t}){return{type:"MustacheCommentStatement",value:e,loc:t}}concat({parts:e,loc:t}){return{type:"ConcatStatement",parts:e,loc:t}}element({path:e,selfClosing:t,attributes:r,modifiers:s,params:n,comments:i,children:a,openTag:o,closeTag:c,loc:h}){let p=t;return{type:"ElementNode",path:e,attributes:r,modifiers:s,params:n,comments:i,children:a,openTag:o,closeTag:c,loc:h,get tag(){return this.path.original},set tag(m){this.path.original=m},get blockParams(){return this.params.map(m=>m.name)},set blockParams(m){this.params=m.map(S=>f.var({name:S,loc:D.synthetic(S)}))},get selfClosing(){return p},set selfClosing(m){p=m,this.closeTag=m?null:D.synthetic(``)}}}elementModifier({path:e,params:t,hash:r,loc:s}){return{type:"ElementModifierStatement",path:e,params:t,hash:r,loc:s}}attr({name:e,value:t,loc:r}){return{type:"AttrNode",name:e,value:t,loc:r}}text({chars:e,loc:t}){return{type:"TextNode",chars:e,loc:t}}sexpr({path:e,params:t,hash:r,loc:s}){return{type:"SubExpression",path:e,params:t,hash:r,loc:s}}path({head:e,tail:t,loc:r}){return function({head:s,tail:n,loc:i}){let a={type:"PathExpression",head:s,tail:n,get original(){return[this.head.original,...this.tail].join(".")},set original(o){let[c,...h]=o.split(".");this.head=bi.head(c,this.head.loc),this.tail=h},loc:i};return Object.defineProperty(a,"parts",{enumerable:!1,get(){let o=this.original.split(".");return o[0]==="this"?o.shift():o[0].startsWith("@")&&(o[0]=o[0].slice(1)),Object.freeze(o)},set(o){var h;let c=[...o];c[0]==="this"||(h=c[0])!=null&&h.startsWith("@")||(this.head.type==="ThisHead"?c.unshift("this"):this.head.type==="AtHead"&&(c[0]=`@${c[0]}`)),this.original=c.join(".")}}),Object.defineProperty(a,"this",{enumerable:!1,get(){return this.head.type==="ThisHead"}}),Object.defineProperty(a,"data",{enumerable:!1,get(){return this.head.type==="AtHead"}}),a}({head:e,tail:t,loc:r})}head({original:e,loc:t}){return e==="this"?this.this({loc:t}):e[0]==="@"?this.atName({name:e,loc:t}):this.var({name:e,loc:t})}this({loc:e}){return{type:"ThisHead",get original(){return"this"},loc:e}}atName({name:e,loc:t}){let r="",s={type:"AtHead",get name(){return r},set name(n){n[0],n.indexOf("."),r=n},get original(){return this.name},set original(n){this.name=n},loc:t};return s.name=e,s}var({name:e,loc:t}){let r="",s={type:"VarHead",get name(){return r},set name(n){n[0],n.indexOf("."),r=n},get original(){return this.name},set original(n){this.name=n},loc:t};return s.name=e,s}hash({pairs:e,loc:t}){return{type:"Hash",pairs:e,loc:t}}pair({key:e,value:t,loc:r}){return{type:"HashPair",key:e,value:t,loc:r}}literal({type:e,value:t,loc:r}){return function({type:s,value:n,loc:i}){let a={type:s,value:n,loc:i};return Object.defineProperty(a,"original",{enumerable:!1,get(){return this.value},set(o){this.value=o}}),a}({type:e,value:t,loc:r})}},Er=class{constructor(t,r=new cr(Es),s="precompile"){this.elementStack=[],this.currentAttribute=null,this.currentNode=null,this.source=t,this.lines=t.source.split(/\r\n?|\n/u),this.tokenizer=new ur(this,r,s)}offset(){let{line:t,column:r}=this.tokenizer;return this.source.offsetFor(t,r)}pos({line:t,column:r}){return this.source.offsetFor(t,r)}finish(t){return er({},t,{loc:t.start.until(this.offset())})}get currentAttr(){return this.currentAttribute}get currentTag(){let t=this.currentNode;return t&&(t.type==="StartTag"||t.type),t}get currentStartTag(){let t=this.currentNode;return t&&t.type,t}get currentEndTag(){let t=this.currentNode;return t&&t.type,t}get currentComment(){let t=this.currentNode;return t&&t.type,t}get currentData(){let t=this.currentNode;return t&&t.type,t}acceptNode(t){return this[t.type](t)}currentElement(){return Cr(this.elementStack)}sourceForNode(t,r){let s,n,i,a=t.loc.start.line-1,o=a-1,c=t.loc.start.column,h=[];for(r?(n=r.loc.end.line-1,i=r.loc.end.column):(n=t.loc.end.line-1,i=t.loc.end.column);o=C?-1:y.indexOf(P,E),w===-1||w+P.length>C?(E=C,U=this.source.spanFor(br)):(E=w,U=S.sliceStartChars({skipStart:E,chars:P.length}),E+=P.length),o.push(f.var({name:P,loc:U}))}}else a=Ls(this.source,t,i);let c=this.Program(a.program,o),h=a.inverse?this.Program(a.inverse,[]):null,p=f.block({path:r,params:s,hash:n,defaultBlock:c,elseBlock:h,loc:this.source.spanFor(t.loc),openStrip:t.openStrip,inverseStrip:t.inverseStrip,closeStrip:t.closeStrip});Ht(this.currentElement(),p)}MustacheStatement(t){var o;(o=this.pendingError)==null||o.mustache(this.source.spanFor(t.loc));let{tokenizer:r}=this;if(r.state==="comment")return void this.appendToCommentData(this.sourceForNode(t));let s,{escaped:n,loc:i,strip:a}=t;if("original"in t.path&&t.path.original==="...attributes")throw v("Illegal use of ...attributes",this.source.spanFor(t.loc));if(Rs(t.path))s=f.mustache({path:this.acceptNode(t.path),params:[],hash:f.hash({pairs:[],loc:this.source.spanFor(t.path.loc).collapse("end")}),trusting:!n,loc:this.source.spanFor(i),strip:a});else{let{path:c,params:h,hash:p}=mr(this,t);s=f.mustache({path:c,params:h,hash:p,trusting:!n,loc:this.source.spanFor(i),strip:a})}switch(r.state){case"tagOpen":case"tagName":throw v("Cannot use mustaches in an elements tagname",s.loc);case"beforeAttributeName":dr(this.currentStartTag,s);break;case"attributeName":case"afterAttributeName":this.beginAttributeValue(!1),this.finishAttributeValue(),dr(this.currentStartTag,s),r.transitionTo("beforeAttributeName");break;case"afterAttributeValueQuoted":dr(this.currentStartTag,s),r.transitionTo("beforeAttributeName");break;case"beforeAttributeValue":this.beginAttributeValue(!1),this.appendDynamicAttributeValuePart(s),r.transitionTo("attributeValueUnquoted");break;case"attributeValueDoubleQuoted":case"attributeValueSingleQuoted":case"attributeValueUnquoted":this.appendDynamicAttributeValuePart(s);break;default:Ht(this.currentElement(),s)}return s}appendDynamicAttributeValuePart(t){this.finalizeTextPart();let r=this.currentAttr;r.isDynamic=!0,r.parts.push(t)}finalizeTextPart(){let t=this.currentAttr.currentPart;t!==null&&(this.currentAttr.parts.push(t),this.startTextPart())}startTextPart(){this.currentAttr.currentPart=null}ContentStatement(t){(function(r,s){let n=s.loc.start.line,i=s.loc.start.column,a=function(o,c){if(c==="")return{lines:o.split(` +`).length-1,columns:0};let[h]=o.split(c),p=h.split(/\n/u),m=p.length-1;return{lines:m,columns:p[m].length}}(s.original,s.value);n+=a.lines,a.lines?i=a.columns:i+=a.columns,r.line=n,r.column=i})(this.tokenizer,t),this.tokenizer.tokenizePart(t.value),this.tokenizer.flushData()}CommentStatement(t){let{tokenizer:r}=this;if(r.state==="comment")return this.appendToCommentData(this.sourceForNode(t)),null;let{value:s,loc:n}=t,i=f.mustacheComment({value:s,loc:this.source.spanFor(n)});switch(r.state){case"beforeAttributeName":case"afterAttributeName":this.currentStartTag.comments.push(i);break;case"beforeData":case"data":Ht(this.currentElement(),i);break;default:throw v(`Using a Handlebars comment when in the \`${r.state}\` state is not supported`,this.source.spanFor(t.loc))}return i}PartialStatement(t){throw v("Handlebars partials are not supported",this.source.spanFor(t.loc))}PartialBlockStatement(t){throw v("Handlebars partial blocks are not supported",this.source.spanFor(t.loc))}Decorator(t){throw v("Handlebars decorators are not supported",this.source.spanFor(t.loc))}DecoratorBlock(t){throw v("Handlebars decorator blocks are not supported",this.source.spanFor(t.loc))}SubExpression(t){let{path:r,params:s,hash:n}=mr(this,t);return f.sexpr({path:r,params:s,hash:n,loc:this.source.spanFor(t.loc)})}PathExpression(t){let{original:r}=t,s;if(r.indexOf("/")!==-1){if(r.slice(0,2)==="./")throw v('Using "./" is not supported in Glimmer and unnecessary',this.source.spanFor(t.loc));if(r.slice(0,3)==="../")throw v('Changing context using "../" is not supported in Glimmer',this.source.spanFor(t.loc));if(r.indexOf(".")!==-1)throw v("Mixing '.' and '/' in paths is not supported in Glimmer; use only '.' to separate property paths",this.source.spanFor(t.loc));s=[t.parts.join("/")]}else{if(r===".")throw v("'.' is not a supported path in Glimmer; check for a path with a trailing '.'",this.source.spanFor(t.loc));s=t.parts}let n,i=!1;if(/^this(?:\..+)?$/u.test(r)&&(i=!0),i)n=f.this({loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+4}})});else if(t.data){let a=s.shift();if(a===void 0)throw v("Attempted to parse a path expression, but it was not valid. Paths beginning with @ must start with a-z.",this.source.spanFor(t.loc));n=f.atName({name:`@${a}`,loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+a.length+1}})})}else{let a=s.shift();if(a===void 0)throw v("Attempted to parse a path expression, but it was not valid. Paths must start with a-z or A-Z.",this.source.spanFor(t.loc));n=f.var({name:a,loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+a.length}})})}return f.path({head:n,tail:s,loc:this.source.spanFor(t.loc)})}Hash(t){let r=t.pairs.map(s=>f.pair({key:s.key,value:this.acceptNode(s.value),loc:this.source.spanFor(s.loc)}));return f.hash({pairs:r,loc:this.source.spanFor(t.loc)})}StringLiteral(t){return f.literal({type:"StringLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}BooleanLiteral(t){return f.literal({type:"BooleanLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}NumberLiteral(t){return f.literal({type:"NumberLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}UndefinedLiteral(t){return f.literal({type:"UndefinedLiteral",value:void 0,loc:this.source.spanFor(t.loc)})}NullLiteral(t){return f.literal({type:"NullLiteral",value:null,loc:this.source.spanFor(t.loc)})}constructor(...t){super(...t),this.pendingError=null}};function mr(e,t){let r;switch(t.path.type){case"PathExpression":r=e.PathExpression(t.path);break;case"SubExpression":r=e.SubExpression(t.path);break;case"StringLiteral":case"UndefinedLiteral":case"NullLiteral":case"NumberLiteral":case"BooleanLiteral":{let i;throw i=t.path.type==="BooleanLiteral"?t.path.original.toString():t.path.type==="StringLiteral"?`"${t.path.original}"`:t.path.type==="NullLiteral"?"null":t.path.type==="NumberLiteral"?t.path.value.toString():"undefined",v(`${t.path.type} "${t.path.type==="StringLiteral"?t.path.original:i}" cannot be called as a sub-expression, replace (${i}) with ${i}`,e.source.spanFor(t.path.loc))}}let s=t.params.map(i=>e.acceptNode(i)),n=ce(s)?Cr(s).loc:r.loc;return{path:r,params:s,hash:t.hash?e.Hash(t.hash):f.hash({pairs:[],loc:e.source.spanFor(n).collapse("end")})}}function dr(e,t){let{path:r,params:s,hash:n,loc:i}=t;if(Rs(r)){let o=`{{${function(c){return c.type==="UndefinedLiteral"?"undefined":JSON.stringify(c.value)}(r)}}}`;throw v(`In <${e.name} ... ${o} ..., ${o} is not a valid modifier`,t.loc)}let a=f.elementModifier({path:r,params:s,hash:n,loc:i});e.modifiers.push(a)}function Ls(e,t,r){if(!t.program.loc){let n=G(!1,t.program.body,0),i=G(!1,t.program.body,-1);if(n&&i)t.program.loc={...n.loc,end:i.loc.end};else{let a=e.spanFor(t.loc);t.program.loc=r.withEnd(a.getEnd())}}let s=e.spanFor(t.program.loc).getEnd();return t.inverse&&!t.inverse.loc&&(t.inverse.loc=s.collapsed()),t}function Ft(e){return/[\t\n\f ]/u.test(e)}var Tr=class extends wr{reset(){this.currentNode=null}beginComment(){this.currentNode={type:"CommentStatement",value:"",start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}appendToCommentData(t){this.currentComment.value+=t}finishComment(){Ht(this.currentElement(),f.comment(this.finish(this.currentComment)))}beginData(){this.currentNode={type:"TextNode",chars:"",start:this.offset()}}appendToData(t){this.currentData.chars+=t}finishData(){Ht(this.currentElement(),f.text(this.finish(this.currentData)))}tagOpen(){this.tagOpenLine=this.tokenizer.line,this.tagOpenColumn=this.tokenizer.column}beginStartTag(){this.currentNode={type:"StartTag",name:"",nameStart:null,nameEnd:null,attributes:[],modifiers:[],comments:[],params:[],selfClosing:!1,start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}beginEndTag(){this.currentNode={type:"EndTag",name:"",start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}finishTag(){let t=this.finish(this.currentTag);if(t.type==="StartTag"){if(this.finishStartTag(),t.name===":")throw v("Invalid named block named detected, you may have created a named block without a name, or you may have began your name with a number. Named blocks must have names that are at least one character long, and begin with a lower case letter",this.source.spanFor({start:this.currentTag.start.toJSON(),end:this.offset().toJSON()}));(gr.has(t.name)||t.selfClosing)&&this.finishEndTag(!0)}else t.type,t.type,this.finishEndTag(!1)}finishStartTag(){let{name:t,nameStart:r,nameEnd:s}=this.currentStartTag,n=r.until(s),[i,...a]=t.split("."),o=f.path({head:f.head({original:i,loc:n.sliceStartChars({chars:i.length})}),tail:a,loc:n}),{attributes:c,modifiers:h,comments:p,params:m,selfClosing:S,loc:y}=this.finish(this.currentStartTag),E=f.element({path:o,selfClosing:S,attributes:c,modifiers:h,comments:p,params:m,children:[],openTag:y,closeTag:S?null:D.broken(),loc:y});this.elementStack.push(E)}finishEndTag(t){let{start:r}=this.currentTag,s=this.finish(this.currentTag),n=this.elementStack.pop();this.validateEndTag(s,n,t);let i=this.currentElement();t?n.closeTag=null:n.selfClosing?n.closeTag:n.closeTag=r.until(this.offset()),n.loc=n.loc.withEnd(this.offset()),Ht(i,f.element(n))}markTagAsSelfClosing(){let t=this.currentTag;if(t.type!=="StartTag")throw v("Invalid end tag: closing tag must not be self-closing",this.source.spanFor({start:t.start.toJSON(),end:this.offset().toJSON()}));t.selfClosing=!0}appendToTagName(t){let r=this.currentTag;if(r.name+=t,r.type==="StartTag"){let s=this.offset();r.nameStart===null&&(r.nameEnd,r.nameStart=s.move(-1)),r.nameEnd=s}}beginAttribute(){let t=this.offset();this.currentAttribute={name:"",parts:[],currentPart:null,isQuoted:!1,isDynamic:!1,start:t,valueSpan:t.collapsed()}}appendToAttributeName(t){this.currentAttr.name+=t,this.currentAttr.name==="as"&&this.parsePossibleBlockParams()}beginAttributeValue(t){this.currentAttr.isQuoted=t,this.startTextPart(),this.currentAttr.valueSpan=this.offset().collapsed()}appendToAttributeValue(t){let r=this.currentAttr.parts,s=r[r.length-1],n=this.currentAttr.currentPart;if(n)n.chars+=t,n.loc=n.loc.withEnd(this.offset());else{let i=this.offset();i=t===` +`?s?s.loc.getEnd():this.currentAttr.valueSpan.getStart():i.move(-1),this.currentAttr.currentPart=f.text({chars:t,loc:i.collapsed()})}}finishAttributeValue(){this.finalizeTextPart();let t=this.currentTag,r=this.offset();if(t.type==="EndTag")throw v("Invalid end tag: closing tag must not have attributes",this.source.spanFor({start:t.start.toJSON(),end:r.toJSON()}));let{name:s,parts:n,start:i,isQuoted:a,isDynamic:o,valueSpan:c}=this.currentAttr;if(s.startsWith("|")&&n.length===0&&!a&&!o)throw v("Invalid block parameters syntax: block parameters must be preceded by the `as` keyword",i.until(i.move(s.length)));let h=this.assembleAttributeValue(n,a,o,i.until(r));h.loc=c.withEnd(r);let p=f.attr({name:s,value:h,loc:i.until(r)});this.currentStartTag.attributes.push(p)}parsePossibleBlockParams(){let t=/[!"#%&'()*+./;<=>@[\\\]^`{|}~]/u;this.tokenizer.state;let r=this.currentStartTag,s=this.currentAttr,n={state:"PossibleAs"},i={PossibleAs:o=>{if(n.state,Ft(o))n={state:"BeforeStartPipe"},this.tokenizer.transitionTo("afterAttributeName"),this.tokenizer.consume();else{if(o==="|")throw v('Invalid block parameters syntax: expecting at least one space character between "as" and "|"',s.start.until(this.offset().move(1)));n={state:"Done"}}},BeforeStartPipe:o=>{n.state,Ft(o)?this.tokenizer.consume():o==="|"?(n={state:"BeforeBlockParamName"},this.tokenizer.transitionTo("beforeAttributeName"),this.tokenizer.consume()):n={state:"Done"}},BeforeBlockParamName:o=>{if(n.state,Ft(o))this.tokenizer.consume();else if(o==="")n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: mustaches cannot be used inside parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}};else if(o==="|"){if(r.params.length===0)throw v("Invalid block parameters syntax: empty parameters list, expecting at least one identifier",s.start.until(this.offset().move(1)));n={state:"AfterEndPipe"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw v('Invalid block parameters syntax: incomplete parameters list, expecting "|" but the tag was closed prematurely',s.start.until(this.offset().move(1)));n={state:"BlockParamName",name:o,start:this.offset()},this.tokenizer.consume()}},BlockParamName:o=>{if(n.state,o==="")n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: mustaches cannot be used inside parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}};else if(o==="|"||Ft(o)){let c=n.start.until(this.offset());if(n.name==="this"||t.test(n.name))throw v(`Invalid block parameters syntax: invalid identifier name \`${n.name}\``,c);r.params.push(f.var({name:n.name,loc:c})),n=o==="|"?{state:"AfterEndPipe"}:{state:"BeforeBlockParamName"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw v('Invalid block parameters syntax: expecting "|" but the tag was closed prematurely',s.start.until(this.offset().move(1)));n.name+=o,this.tokenizer.consume()}},AfterEndPipe:o=>{n.state,Ft(o)?this.tokenizer.consume():o===""?(n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: modifiers cannot follow parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}}):o===">"||o==="/"?n={state:"Done"}:(n={state:"Error",message:'Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',start:this.offset()},this.tokenizer.consume())},Error:o=>{if(n.state,o===""||o==="/"||o===">"||Ft(o))throw v(n.message,n.start.until(this.offset()));this.tokenizer.consume()},Done:()=>{}},a;do a=this.tokenizer.peek(),i[n.state](a);while(n.state!=="Done"&&a!=="");n.state}reportSyntaxError(t){throw v(t,this.offset().collapsed())}assembleConcatenatedValue(t){let r=ci(t),s=Cr(t);return f.concat({parts:t,loc:this.source.spanFor(r.loc).extend(this.source.spanFor(s.loc))})}validateEndTag(t,r,s){if(gr.has(t.name)&&!s)throw v(`<${t.name}> elements do not need end tags. You should remove it`,t.loc);if(r.type!=="ElementNode")throw v(`Closing tag without an open tag`,t.loc);if(r.tag!==t.name)throw v(`Closing tag did not match last open tag <${r.tag}> (on line ${r.loc.startPosition.line})`,t.loc)}assembleAttributeValue(t,r,s,n){if(s){if(r)return this.assembleConcatenatedValue(t);{let[i,a]=t;if(a===void 0||a.type==="TextNode"&&a.chars==="/")return i;throw v("An unquoted attribute value must be a string or a mustache, preceded by whitespace or a '=' character, and followed by whitespace, a '>' character, or '/>'",n)}}return ce(t)?t[0]:f.text({chars:"",loc:n})}constructor(...t){super(...t),this.tagOpenLine=0,this.tagOpenColumn=0}},yi={},Nr=class extends cr{constructor(){super({})}parse(){}};function Vs(e,t={}){var c,h,p;let r,s,n,i=t.mode||"precompile";typeof e=="string"?(r=new wt(e,(c=t.meta)==null?void 0:c.moduleName),s=i==="codemod"?Te(e,t.parseOptions):lr(e,t.parseOptions)):e instanceof wt?(r=e,s=i==="codemod"?Te(e.source,t.parseOptions):lr(e.source,t.parseOptions)):(r=new wt("",(h=t.meta)==null?void 0:h.moduleName),s=e),i==="codemod"&&(n=new Nr);let a=D.forCharPositions(r,0,r.source.length);s.loc={source:"(program)",start:a.startPosition,end:a.endPosition};let o=new Tr(r,n,i).parse(s,t.locals??[]);if((p=t.plugins)!=null&&p.ast)for(let m of t.plugins.ast)gi(o,m(er({},t,{syntax:yi},{plugins:void 0})).visitor);return o}var ki={resolution:()=>Ne.GetStrictKeyword,serialize:()=>"Strict",isAngleBracket:!1},vo={...ki,isAngleBracket:!0};var Le=` +`,Fs="\r",Hs=function(){function e(t){this.length=t.length;for(var r=[0],s=0;sthis.length)return null;for(var r=0,s=this.offsets;s[r+1]<=t;)r++;var n=t-s[r];return{line:r,column:n}},e.prototype.indexForLocation=function(t){var r=t.line,s=t.column;return r<0||r>=this.offsets.length||s<0||s>this.lengthOfLine(r)?null:this.offsets[r]+s},e.prototype.lengthOfLine=function(t){var r=this.offsets[t],s=t===this.offsets.length-1?this.length:this.offsets[t+1];return s-r},e}();function Si(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var Us=Si;function vi(e){let t=e.children??e.body;if(t)for(let r=0;rt.indexForLocation({line:n-1,column:i}),s=n=>{let{start:i,end:a}=n.loc;i.offset=r(i),a.offset=r(a)};return()=>({name:"prettierParsePlugin",visitor:{All(n){s(n),vi(n)}}})}function wi(e){let t;try{t=Vs(e,{mode:"codemod",plugins:{ast:[Ei(e)]}})}catch(r){let s=Ni(r);if(s){let n=Ti(r);throw Us(n,{loc:s,cause:r})}throw r}return t}function Ti(e){let{message:t}=e,r=t.split(` +`);return r.length>=4&&/^Parse error on line \d+:$/u.test(r[0])&&/^-*\^$/u.test(G(!1,r,-2))?G(!1,r,-1):r.length>=4&&/:\s?$/u.test(r[0])&&/^\(error occurred in '.*?' @ line \d+ : column \d+\)$/u.test(G(!1,r,-1))&&r[1]===""&&G(!1,r,-2)===""&&r.slice(2,-2).every(s=>s.startsWith("|"))?r[0].trim().slice(0,-1):t}function Ni(e){let{location:t,hash:r}=e;if(t){let{start:s,end:n}=t;return typeof n.line!="number"?{start:s}:t}if(r){let{loc:{last_line:s,last_column:n}}=r;return{start:{line:s,column:n+1}}}}var Ci={parse:wi,astFormat:"glimmer",locStart:St,locEnd:re};var Pi={glimmer:hs};return $s(xi);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/glimmer.mjs b/node_modules/prettier/plugins/glimmer.mjs new file mode 100644 index 0000000..74c91b2 --- /dev/null +++ b/node_modules/prettier/plugins/glimmer.mjs @@ -0,0 +1,30 @@ +var Ws=Object.defineProperty;var Or=e=>{throw TypeError(e)};var Fe=(e,t)=>{for(var r in t)Ws(e,r,{get:t[r],enumerable:!0})};var Br=(e,t,r)=>t.has(e)||Or("Cannot "+r);var I=(e,t,r)=>(Br(e,t,"read from private field"),r?r.call(e):t.get(e)),Lt=(e,t,r)=>t.has(e)?Or("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,s)=>(Br(e,t,"write to private field"),s?s.call(e,r):t.set(e,r),r);var Pr={};Fe(Pr,{languages:()=>ps,parsers:()=>xr,printers:()=>wi});var js=(e,t,r,s)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,s):r.global?t.replace(r,s):t.split(r).join(s)},He=js;var Dt="string",Gt="array",Kt="cursor",_t="indent",Ot="align",Wt="trim",Bt="group",It="fill",bt="if-break",jt="indent-if-break",Qt="line-suffix",Jt="line-suffix-boundary",j="line",$t="label",Rt="break-parent",fe=new Set([Kt,_t,Ot,Wt,Bt,It,bt,jt,Qt,Jt,j,$t,Rt]);var Qs=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},G=Qs;function Js(e){if(typeof e=="string")return Dt;if(Array.isArray(e))return Gt;if(!e)return;let{type:t}=e;if(fe.has(t))return t}var qt=Js;var $s=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Xs(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', +Expected it to be 'string' or 'object'.`;if(qt(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let s=$s([...fe].map(n=>`'${n}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${s}.`}var Ue=class extends Error{name="InvalidDocError";constructor(t){super(Xs(t)),this.doc=t}},Me=Ue;function tn(e,t){if(typeof e=="string")return t(e);let r=new Map;return s(e);function s(i){if(r.has(i))return r.get(i);let a=n(i);return r.set(i,a),a}function n(i){switch(qt(i)){case Gt:return t(i.map(s));case It:return t({...i,parts:i.parts.map(s)});case bt:return t({...i,breakContents:s(i.breakContents),flatContents:s(i.flatContents)});case Bt:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(s),o=a[0]):o=s(o),t({...i,contents:o,expandedStates:a})}case Ot:case _t:case jt:case $t:case Qt:return t({...i,contents:s(i.contents)});case Dt:case Kt:case Wt:case Jt:case j:case Rt:return t(i);default:throw new Me(i)}}}function Ir(e,t=Rr){return tn(e,r=>typeof r=="string"?yt(t,r.split(` +`)):r)}var ze=()=>{},kt=ze,Ye=ze,qr=ze;function B(e){return kt(e),{type:_t,contents:e}}function en(e,t){return kt(t),{type:Ot,contents:t,n:e}}function R(e,t={}){return kt(e),Ye(t.expandedStates,!0),{type:Bt,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Xt(e){return en(-1,e)}function Ge(e){return qr(e),{type:It,parts:e}}function Ke(e,t="",r={}){return kt(e),t!==""&&kt(t),{type:bt,breakContents:e,flatContents:t,groupId:r.groupId}}var Vr={type:Rt};var rn={type:j,hard:!0},sn={type:j,hard:!0,literal:!0},L={type:j},H={type:j,soft:!0},tt=[rn,Vr],Rr=[sn,Vr];function yt(e,t){kt(e),Ye(t);let r=[];for(let s=0;si?s:r}var de=nn;function We(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var z,je=class{constructor(t){Lt(this,z);Y(this,z,new Set(t))}getLeadingWhitespaceCount(t){let r=I(this,z),s=0;for(let n=0;n=0&&r.has(t.charAt(n));n--)s++;return s}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return I(this,z).has(t.charAt(0))}hasTrailingWhitespace(t){return I(this,z).has(G(!1,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let s=`[${We([...I(this,z)].join(""))}]+`,n=new RegExp(r?`(${s})`:s,"u");return t.split(n)}hasWhitespaceCharacter(t){let r=I(this,z);return Array.prototype.some.call(t,s=>r.has(s))}hasNonWhitespaceCharacter(t){let r=I(this,z);return Array.prototype.some.call(t,s=>!r.has(s))}isWhitespaceOnly(t){let r=I(this,z);return Array.prototype.every.call(t,s=>r.has(s))}};z=new WeakMap;var Hr=je;var an=[" ",` +`,"\f","\r"," "],on=new Hr(an),K=on;function ln(e){return Array.isArray(e)&&e.length>0}var Zt=ln;var Qe=class extends Error{name="UnexpectedNodeError";constructor(t,r,s="type"){super(`Unexpected ${r} node ${s}: ${JSON.stringify(t[s])}.`),this.node=t}},Ur=Qe;function Mr(e,t,r){if(e.type==="TextNode"){let s=e.chars.trim();if(!s)return null;r.tag==="style"&&r.children.length===1&&r.children[0]===e?t.chars="":t.chars=K.split(s).join(" ")}e.type==="ElementNode"&&(delete t.startTag,delete t.openTag,delete t.parts,delete t.endTag,delete t.closeTag,delete t.nameNode,delete t.body,delete t.blockParamNodes,delete t.params,delete t.path),e.type==="Block"&&(delete t.blockParamNodes,delete t.params),e.type==="AttrNode"&&e.name.toLowerCase()==="class"&&delete t.value,e.type==="PathExpression"&&(t.head=e.head.original)}Mr.ignoredProperties=new Set(["loc","selfClosing"]);var zr=Mr;function cn(e){let{node:t}=e;if(t.type!=="TextNode")return;let{parent:r}=e;if(!(r.type==="ElementNode"&&r.tag==="style"&&r.children.length===1&&r.children[0]===t))return;let s=r.attributes.find(n=>n.type==="AttrNode"&&n.name==="lang");if(!(s&&!(s.value.type==="TextNode"&&(s.value.chars===""||s.value.chars==="css"))))return async n=>{let i=await n(t.chars,{parser:"css"});return i?[tt,i,Xt(H)]:[]}}var Yr=cn;var te=null;function ee(e){if(te!==null&&typeof te.property){let t=te;return te=ee.prototype=null,t}return te=ee.prototype=e??Object.create(null),new ee}var un=10;for(let e=0;e<=un;e++)ee();function Je(e){return ee(e)}function hn(e,t="type"){Je(e);function r(s){let n=s[t],i=e[n];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:s});return i}return r}var Gr=hn;var Kr={Template:["body"],Block:["body"],MustacheStatement:["path","params","hash"],BlockStatement:["path","params","hash","program","inverse"],ElementModifierStatement:["path","params","hash"],CommentStatement:[],MustacheCommentStatement:[],ElementNode:["attributes","modifiers","children","comments"],AttrNode:["value"],TextNode:[],ConcatStatement:["parts"],SubExpression:["path","params","hash"],PathExpression:[],StringLiteral:[],BooleanLiteral:[],NumberLiteral:[],NullLiteral:[],UndefinedLiteral:[],Hash:["pairs"],HashPair:["value"]};var pn=Gr(Kr),Wr=pn;function St(e){return e.loc.start.offset}function re(e){return e.loc.end.offset}var jr=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Jr(e){return e.toUpperCase()===e}function fn(e){return e.type==="ElementNode"&&typeof e.tag=="string"&&!e.tag.startsWith(":")&&(Jr(e.tag[0])||e.tag.includes("."))}function mn(e){return jr.has(e.toLowerCase())&&!Jr(e[0])}function $e(e){return e.selfClosing===!0||mn(e.tag)||fn(e)&&e.children.every(t=>ge(t))}function ge(e){return e.type==="TextNode"&&!/\S/u.test(e.chars)}function Qr(e){return(e==null?void 0:e.type)==="MustacheCommentStatement"&&typeof e.value=="string"&&e.value.trim()==="prettier-ignore"}function $r(e){return Qr(e.node)||e.isInArray&&(e.key==="children"||e.key==="body"||e.key==="parts")&&Qr(e.siblings[e.index-2])}var is=2;function dn(e,t,r){var n,i,a,o,c,h,p,m,S;let{node:s}=e;switch(s.type){case"Block":case"Program":case"Template":return R(e.map(r,"body"));case"ElementNode":{let y=R(bn(e,r)),E=t.htmlWhitespaceSensitivity==="ignore"&&((n=e.next)==null?void 0:n.type)==="ElementNode"?H:"";if($e(s))return[y,E];let C=[""];return s.children.length===0?[y,B(C),E]:t.htmlWhitespaceSensitivity==="ignore"?[y,B(Xr(e,t,r)),tt,B(C),E]:[y,B(R(Xr(e,t,r))),B(C),E]}case"BlockStatement":return wn(e)?[Tn(e,r),es(e,r,t),rs(e,r,t)]:[vn(e,r),R([es(e,r,t),rs(e,r,t),Nn(e,r,t)])];case"ElementModifierStatement":return R(["{{",ns(e,r),"}}"]);case"MustacheStatement":return R([be(s),ns(e,r),ye(s)]);case"SubExpression":return R(["(",_n(e,r),H,")"]);case"AttrNode":{let{name:y,value:E}=s,C=E.type==="TextNode";if(C&&E.chars===""&&St(E)===re(E))return y;let w=C?de(E.chars,t.singleQuote):E.type==="ConcatStatement"?de(E.parts.map(q=>q.type==="TextNode"?q.chars:"").join(""),t.singleQuote):"",U=r("value");return[y,"=",w,y==="class"&&w?R(B(U)):U,w]}case"ConcatStatement":return e.map(r,"parts");case"Hash":return yt(L,e.map(r,"pairs"));case"HashPair":return[s.key,"=",r("value")];case"TextNode":{if(e.parent.tag==="pre"||e.parent.tag==="style")return s.chars;let y=He(!1,s.chars,"{{",String.raw`\{{`),E=xn(e);if(E){if(E==="class"){let X=y.trim().split(/\s+/u).join(" "),rt=!1,V=!1;return e.parent.type==="ConcatStatement"&&(((i=e.previous)==null?void 0:i.type)==="MustacheStatement"&&/^\s/u.test(y)&&(rt=!0),((a=e.next)==null?void 0:a.type)==="MustacheStatement"&&/\s$/u.test(y)&&X!==""&&(V=!0)),[rt?L:"",X,V?L:""]}return Ir(y)}let C=K.isWhitespaceOnly(y),{isFirst:x,isLast:w}=e;if(t.htmlWhitespaceSensitivity!=="ignore"){let X=w&&e.parent.type==="Template",rt=x&&e.parent.type==="Template";if(C){if(rt||X)return"";let A=[L],nt=Vt(y);return nt&&(A=se(nt)),w&&(A=A.map(ue=>Xt(ue))),A}let V=K.getLeadingWhitespace(y),xt=[];if(V){xt=[L];let A=Vt(V);A&&(xt=se(A)),y=y.slice(V.length)}let F=K.getTrailingWhitespace(y),st=[];if(F){if(!X){st=[L];let A=Vt(F);A&&(st=se(A)),w&&(st=st.map(nt=>Xt(nt)))}y=y.slice(0,-F.length)}return[...xt,Ge(ss(y)),...st]}let U=Vt(y),q=Pn(y),$=An(y);if((x||w)&&C&&(e.parent.type==="Block"||e.parent.type==="ElementNode"||e.parent.type==="Template"))return"";C&&U?(q=Math.min(U,is),$=0):((((o=e.next)==null?void 0:o.type)==="BlockStatement"||((c=e.next)==null?void 0:c.type)==="ElementNode")&&($=Math.max($,1)),(((h=e.previous)==null?void 0:h.type)==="BlockStatement"||((p=e.previous)==null?void 0:p.type)==="ElementNode")&&(q=Math.max(q,1)));let Nt="",Ct="";return $===0&&((m=e.next)==null?void 0:m.type)==="MustacheStatement"&&(Ct=" "),q===0&&((S=e.previous)==null?void 0:S.type)==="MustacheStatement"&&(Nt=" "),x&&(q=0,Nt=""),w&&($=0,Ct=""),K.hasLeadingWhitespace(y)&&(y=Nt+K.trimStart(y)),K.hasTrailingWhitespace(y)&&(y=K.trimEnd(y)+Ct),[...se(q),Ge(ss(y)),...se($)]}case"MustacheCommentStatement":{let y=St(s),E=re(s),C=t.originalText.charAt(y+2)==="~",x=t.originalText.charAt(E-3)==="~",w=s.value.includes("}}")?"--":"";return["{{",C?"~":"","!",w,s.value,w,x?"~":"","}}"]}case"PathExpression":return Rn(s);case"BooleanLiteral":return String(s.value);case"CommentStatement":return[""];case"StringLiteral":return Ln(e,t);case"NumberLiteral":return String(s.value);case"UndefinedLiteral":return"undefined";case"NullLiteral":return"null";case"AtHead":case"VarHead":case"ThisHead":default:throw new Ur(s,"Handlebars")}}function gn(e,t){return St(e)-St(t)}function bn(e,t){let{node:r}=e,s=["attributes","modifiers","comments"].filter(i=>Zt(r[i])),n=s.flatMap(i=>r[i]).sort(gn);for(let i of s)e.each(({node:a})=>{let o=n.indexOf(a);n.splice(o,1,[L,t()])},i);return Zt(r.blockParams)&&n.push(L,Ze(r)),["<",r.tag,B(n),yn(r)]}function Xr(e,t,r){let{node:s}=e,n=s.children.every(i=>ge(i));return t.htmlWhitespaceSensitivity==="ignore"&&n?"":e.map(({isFirst:i})=>{let a=r();return i&&t.htmlWhitespaceSensitivity==="ignore"?[H,a]:a},"children")}function yn(e){return $e(e)?Ke([H,"/>"],[" />",H]):Ke([H,">"],">")}function be(e){var s;let t=e.trusting?"{{{":"{{",r=(s=e.strip)!=null&&s.open?"~":"";return[t,r]}function ye(e){var s;let t=e.trusting?"}}}":"}}";return[(s=e.strip)!=null&&s.close?"~":"",t]}function kn(e){let t=be(e),r=e.openStrip.open?"~":"";return[t,r,"#"]}function Sn(e){let t=ye(e);return[e.openStrip.close?"~":"",t]}function Zr(e){let t=be(e),r=e.closeStrip.open?"~":"";return[t,r,"/"]}function ts(e){let t=ye(e);return[e.closeStrip.close?"~":"",t]}function as(e){let t=be(e),r=e.inverseStrip.open?"~":"";return[t,r]}function os(e){let t=ye(e);return[e.inverseStrip.close?"~":"",t]}function vn(e,t){let{node:r}=e,s=[],n=ke(e,t);return n&&s.push(R(n)),Zt(r.program.blockParams)&&s.push(Ze(r.program)),R([kn(r),Xe(e,t),s.length>0?B([L,yt(L,s)]):"",H,Sn(r)])}function En(e,t){return[t.htmlWhitespaceSensitivity==="ignore"?tt:"",as(e),"else",os(e)]}var ls=(e,t)=>e.head.type==="VarHead"&&t.head.type==="VarHead"&&e.head.name===t.head.name;function wn(e){var s;let{grandparent:t,node:r}=e;return((s=t==null?void 0:t.inverse)==null?void 0:s.body.length)===1&&t.inverse.body[0]===r&&ls(t.inverse.body[0].path,t.path)}function Tn(e,t){let{node:r,grandparent:s}=e;return R([as(s),["else"," ",s.inverse.body[0].path.head.name],B([L,R(ke(e,t)),...Zt(r.program.blockParams)?[L,Ze(r.program)]:[]]),H,os(s)])}function Nn(e,t,r){let{node:s}=e;return r.htmlWhitespaceSensitivity==="ignore"?[cs(s)?H:tt,Zr(s),t("path"),ts(s)]:[Zr(s),t("path"),ts(s)]}function cs(e){return e.type==="BlockStatement"&&e.program.body.every(t=>ge(t))}function Cn(e){return us(e)&&e.inverse.body.length===1&&e.inverse.body[0].type==="BlockStatement"&&ls(e.inverse.body[0].path,e.path)}function us(e){return e.type==="BlockStatement"&&e.inverse}function es(e,t,r){let{node:s}=e;if(cs(s))return"";let n=t("program");return r.htmlWhitespaceSensitivity==="ignore"?B([tt,n]):B(n)}function rs(e,t,r){let{node:s}=e,n=t("inverse"),i=r.htmlWhitespaceSensitivity==="ignore"?[tt,n]:n;return Cn(s)?i:us(s)?[En(s,r),B(i)]:""}function ss(e){return yt(L,K.split(e))}function xn(e){for(let t=0;t<2;t++){let r=e.getParentNode(t);if((r==null?void 0:r.type)==="AttrNode")return r.name.toLowerCase()}}function Vt(e){return e=typeof e=="string"?e:"",e.split(` +`).length-1}function Pn(e){e=typeof e=="string"?e:"";let t=(e.match(/^([^\S\n\r]*[\n\r])+/gu)||[])[0]||"";return Vt(t)}function An(e){e=typeof e=="string"?e:"";let t=(e.match(/([\n\r][^\S\n\r]*)+$/gu)||[])[0]||"";return Vt(t)}function se(e=0){return Array.from({length:Math.min(e,is)}).fill(tt)}function Ln(e,t){let{node:{value:r}}=e,s=de(r,Dn(e)?!t.singleQuote:t.singleQuote);return[s,He(!1,r,s,`\\${s}`),s]}function Dn(e){let{ancestors:t}=e,r=t.findIndex(s=>s.type!=="SubExpression");return r!==-1&&t[r+1].type==="ConcatStatement"&&t[r+2].type==="AttrNode"}function _n(e,t){let r=Xe(e,t),s=ke(e,t);return s?B([r,L,R(s)]):r}function ns(e,t){let r=Xe(e,t),s=ke(e,t);return s?[B([r,L,s]),H]:r}function Xe(e,t){return t("path")}function ke(e,t){var n;let{node:r}=e,s=[];return r.params.length>0&&s.push(...e.map(t,"params")),((n=r.hash)==null?void 0:n.pairs.length)>0&&s.push(t("hash")),s.length===0?"":yt(L,s)}function Ze(e){return["as |",e.blockParams.join(" "),"|"]}var On=new Set("!\"#%&'()*+,./;<=>@[\\]^`{|}~"),Bn=new Set(["true","false","null","undefined"]),In=(e,t)=>t===0&&e.startsWith("@")?!1:t!==0&&Bn.has(e)||/\s/u.test(e)||/^\d/u.test(e)||Array.prototype.some.call(e,r=>On.has(r));function Rn(e){return e.tail.length===0&&e.original.includes("/")?e.original:[e.head.original,...e.tail].map((r,s)=>In(r,s)?`[${r}]`:r).join(".")}var qn={print:dn,massageAstNode:zr,hasPrettierIgnore:$r,getVisitorKeys:Wr,embed:Yr},hs=qn;var ps=[{linguistLanguageId:155,name:"Handlebars",type:"markup",color:"#f7931e",aliases:["hbs","htmlbars"],extensions:[".handlebars",".hbs"],tmScope:"text.html.handlebars",aceMode:"handlebars",parsers:["glimmer"],vscodeLanguageIds:["handlebars"]}];var xr={};Fe(xr,{glimmer:()=>Ei});var Vn=Object.freeze([]);function ms(){return Vn}var Ma=ms(),za=ms();var tr=Object.assign;var fs=console;function ds(e,t="unexpected unreachable branch"){throw fs.log("unreachable",e),fs.log(`${t} :: ${JSON.stringify(e)} (${e})`),new Error("code reached unreachable")}var Fn=function(){var e=function(it,d,k,g){for(k=k||{},g=it.length;g--;k[it[g]]=d);return k},t=[2,44],r=[1,20],s=[5,14,15,19,29,34,39,44,47,48,52,56,60],n=[1,35],i=[1,38],a=[1,30],o=[1,31],c=[1,32],h=[1,33],p=[1,34],m=[1,37],S=[14,15,19,29,34,39,44,47,48,52,56,60],y=[14,15,19,29,34,44,47,48,52,56,60],E=[15,18],C=[14,15,19,29,34,47,48,52,56,60],x=[33,64,71,79,80,81,82,83,84],w=[23,33,55,64,67,71,74,79,80,81,82,83,84],U=[1,51],q=[23,33,55,64,67,71,74,79,80,81,82,83,84,86],$=[2,43],Nt=[55,64,71,79,80,81,82,83,84],Ct=[1,58],X=[1,59],rt=[1,66],V=[33,64,71,74,79,80,81,82,83,84],xt=[23,64,71,79,80,81,82,83,84],F=[1,76],st=[64,67,71,79,80,81,82,83,84],A=[33,74],nt=[23,33,55,67,71,74],ue=[1,106],De=[1,118],Ar=[71,76],_e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,expr:49,mustache_repetition0:50,mustache_option0:51,OPEN_UNESCAPED:52,mustache_repetition1:53,mustache_option1:54,CLOSE_UNESCAPED:55,OPEN_PARTIAL:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,sexpr:63,OPEN_SEXPR:64,sexpr_repetition0:65,sexpr_option0:66,CLOSE_SEXPR:67,hash:68,hash_repetition_plus0:69,hashSegment:70,ID:71,EQUALS:72,blockParams:73,OPEN_BLOCK_PARAMS:74,blockParams_repetition_plus0:75,CLOSE_BLOCK_PARAMS:76,path:77,dataName:78,STRING:79,NUMBER:80,BOOLEAN:81,UNDEFINED:82,NULL:83,DATA:84,pathSegments:85,SEP:86,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",52:"OPEN_UNESCAPED",55:"CLOSE_UNESCAPED",56:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",64:"OPEN_SEXPR",67:"CLOSE_SEXPR",71:"ID",72:"EQUALS",74:"OPEN_BLOCK_PARAMS",76:"CLOSE_BLOCK_PARAMS",79:"STRING",80:"NUMBER",81:"BOOLEAN",82:"UNDEFINED",83:"NULL",84:"DATA",86:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[49,1],[49,1],[63,5],[68,1],[70,3],[73,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[78,2],[77,1],[85,3],[85,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[50,0],[50,2],[51,0],[51,1],[53,0],[53,2],[54,0],[54,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[65,0],[65,2],[66,0],[66,1],[69,1],[69,2],[75,1],[75,2]],performAction:function(d,k,g,b,N,l,Pt){var u=l.length-1;switch(N){case 1:return l[u-1];case 2:this.$=b.prepareProgram(l[u]);break;case 3:case 4:case 5:case 6:case 7:case 8:case 20:case 27:case 28:case 33:case 34:this.$=l[u];break;case 9:this.$={type:"CommentStatement",value:b.stripComment(l[u]),strip:b.stripFlags(l[u],l[u]),loc:b.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:l[u],value:l[u],loc:b.locInfo(this._$)};break;case 11:this.$=b.prepareRawBlock(l[u-2],l[u-1],l[u],this._$);break;case 12:this.$={path:l[u-3],params:l[u-2],hash:l[u-1]};break;case 13:this.$=b.prepareBlock(l[u-3],l[u-2],l[u-1],l[u],!1,this._$);break;case 14:this.$=b.prepareBlock(l[u-3],l[u-2],l[u-1],l[u],!0,this._$);break;case 15:this.$={open:l[u-5],path:l[u-4],params:l[u-3],hash:l[u-2],blockParams:l[u-1],strip:b.stripFlags(l[u-5],l[u])};break;case 16:case 17:this.$={path:l[u-4],params:l[u-3],hash:l[u-2],blockParams:l[u-1],strip:b.stripFlags(l[u-5],l[u])};break;case 18:this.$={strip:b.stripFlags(l[u-1],l[u-1]),program:l[u]};break;case 19:var at=b.prepareBlock(l[u-2],l[u-1],l[u],l[u],!1,this._$),Yt=b.prepareProgram([at],l[u-1].loc);Yt.chained=!0,this.$={strip:l[u-2].strip,program:Yt,chain:!0};break;case 21:this.$={path:l[u-1],strip:b.stripFlags(l[u-2],l[u])};break;case 22:case 23:this.$=b.prepareMustache(l[u-3],l[u-2],l[u-1],l[u-4],b.stripFlags(l[u-4],l[u]),this._$);break;case 24:this.$={type:"PartialStatement",name:l[u-3],params:l[u-2],hash:l[u-1],indent:"",strip:b.stripFlags(l[u-4],l[u]),loc:b.locInfo(this._$)};break;case 25:this.$=b.preparePartialBlock(l[u-2],l[u-1],l[u],this._$);break;case 26:this.$={path:l[u-3],params:l[u-2],hash:l[u-1],strip:b.stripFlags(l[u-4],l[u])};break;case 29:this.$={type:"SubExpression",path:l[u-3],params:l[u-2],hash:l[u-1],loc:b.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:l[u],loc:b.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:b.id(l[u-2]),value:l[u],loc:b.locInfo(this._$)};break;case 32:this.$=b.id(l[u-1]);break;case 35:this.$={type:"StringLiteral",value:l[u],original:l[u],loc:b.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(l[u]),original:Number(l[u]),loc:b.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:l[u]==="true",original:l[u]==="true",loc:b.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:b.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:b.locInfo(this._$)};break;case 40:this.$=b.preparePath(!0,l[u],this._$);break;case 41:this.$=b.preparePath(!1,l[u],this._$);break;case 42:l[u-2].push({part:b.id(l[u]),original:l[u],separator:l[u-1]}),this.$=l[u-2];break;case 43:this.$=[{part:b.id(l[u]),original:l[u]}];break;case 44:case 46:case 48:case 56:case 62:case 68:case 76:case 80:case 84:case 88:case 92:this.$=[];break;case 45:case 47:case 49:case 57:case 63:case 69:case 77:case 81:case 85:case 89:case 93:case 97:case 99:l[u-1].push(l[u]);break;case 96:case 98:this.$=[l[u]];break}},table:[e([5,14,15,19,29,34,48,52,56,60],t,{3:1,4:2,6:3}),{1:[3]},{5:[1,4]},e([5,39,44,47],[2,2],{7:5,8:6,9:7,10:8,11:9,12:10,13:11,24:15,27:16,16:17,59:19,14:[1,12],15:r,19:[1,23],29:[1,21],34:[1,22],48:[1,13],52:[1,14],56:[1,18],60:[1,24]}),{1:[2,1]},e(s,[2,45]),e(s,[2,3]),e(s,[2,4]),e(s,[2,5]),e(s,[2,6]),e(s,[2,7]),e(s,[2,8]),e(s,[2,9]),{20:26,49:25,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:26,49:39,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(S,t,{6:3,4:40}),e(y,t,{6:3,4:41}),e(E,[2,46],{17:42}),{20:26,49:43,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(C,t,{6:3,4:44}),e([5,14,15,18,19,29,34,39,44,47,48,52,56,60],[2,10]),{20:45,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:46,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:47,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:26,49:48,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(x,[2,76],{50:49}),e(w,[2,27]),e(w,[2,28]),e(w,[2,33]),e(w,[2,34]),e(w,[2,35]),e(w,[2,36]),e(w,[2,37]),e(w,[2,38]),e(w,[2,39]),{20:26,49:50,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(w,[2,41],{86:U}),{71:i,85:52},e(q,$),e(Nt,[2,80],{53:53}),{25:54,38:56,39:Ct,43:57,44:X,45:55,47:[2,52]},{28:60,43:61,44:X,47:[2,54]},{13:63,15:r,18:[1,62]},e(x,[2,84],{57:64}),{26:65,47:rt},e(V,[2,56],{30:67}),e(V,[2,62],{35:68}),e(xt,[2,48],{21:69}),e(x,[2,88],{61:70}),{20:26,33:[2,78],49:72,51:71,63:27,64:n,68:73,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(st,[2,92],{65:77}),{71:[1,78]},e(w,[2,40],{86:U}),{20:26,49:80,54:79,55:[2,82],63:27,64:n,68:81,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{26:82,47:rt},{47:[2,53]},e(S,t,{6:3,4:83}),{47:[2,20]},{20:84,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(C,t,{6:3,4:85}),{26:86,47:rt},{47:[2,55]},e(s,[2,11]),e(E,[2,47]),{20:26,33:[2,86],49:88,58:87,63:27,64:n,68:89,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(s,[2,25]),{20:90,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(A,[2,58],{20:26,63:27,77:28,78:29,85:36,69:74,70:75,31:91,49:92,68:93,64:n,71:F,79:a,80:o,81:c,82:h,83:p,84:m}),e(A,[2,64],{20:26,63:27,77:28,78:29,85:36,69:74,70:75,36:94,49:95,68:96,64:n,71:F,79:a,80:o,81:c,82:h,83:p,84:m}),{20:26,22:97,23:[2,50],49:98,63:27,64:n,68:99,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{20:26,33:[2,90],49:101,62:100,63:27,64:n,68:102,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{33:[1,103]},e(x,[2,77]),{33:[2,79]},e([23,33,55,67,74],[2,30],{70:104,71:[1,105]}),e(nt,[2,96]),e(q,$,{72:ue}),{20:26,49:108,63:27,64:n,66:107,67:[2,94],68:109,69:74,70:75,71:F,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},e(q,[2,42]),{55:[1,110]},e(Nt,[2,81]),{55:[2,83]},e(s,[2,13]),{38:56,39:Ct,43:57,44:X,45:112,46:111,47:[2,74]},e(V,[2,68],{40:113}),{47:[2,18]},e(s,[2,14]),{33:[1,114]},e(x,[2,85]),{33:[2,87]},{33:[1,115]},{32:116,33:[2,60],73:117,74:De},e(V,[2,57]),e(A,[2,59]),{33:[2,66],37:119,73:120,74:De},e(V,[2,63]),e(A,[2,65]),{23:[1,121]},e(xt,[2,49]),{23:[2,51]},{33:[1,122]},e(x,[2,89]),{33:[2,91]},e(s,[2,22]),e(nt,[2,97]),{72:ue},{20:26,49:123,63:27,64:n,71:i,77:28,78:29,79:a,80:o,81:c,82:h,83:p,84:m,85:36},{67:[1,124]},e(st,[2,93]),{67:[2,95]},e(s,[2,23]),{47:[2,19]},{47:[2,75]},e(A,[2,70],{20:26,63:27,77:28,78:29,85:36,69:74,70:75,41:125,49:126,68:127,64:n,71:F,79:a,80:o,81:c,82:h,83:p,84:m}),e(s,[2,24]),e(s,[2,21]),{33:[1,128]},{33:[2,61]},{71:[1,130],75:129},{33:[1,131]},{33:[2,67]},e(E,[2,12]),e(C,[2,26]),e(nt,[2,31]),e(w,[2,29]),{33:[2,72],42:132,73:133,74:De},e(V,[2,69]),e(A,[2,71]),e(S,[2,15]),{71:[1,135],76:[1,134]},e(Ar,[2,98]),e(y,[2,16]),{33:[1,136]},{33:[2,73]},{33:[2,32]},e(Ar,[2,99]),e(S,[2,17])],defaultActions:{4:[2,1],55:[2,53],57:[2,20],61:[2,55],73:[2,79],81:[2,83],85:[2,18],89:[2,87],99:[2,51],102:[2,91],109:[2,95],111:[2,19],112:[2,75],117:[2,61],120:[2,67],133:[2,73],134:[2,32]},parseError:function(d,k){if(k.recoverable)this.trace(d);else{var g=new Error(d);throw g.hash=k,g}},parse:function(d){var k=this,g=[0],b=[],N=[null],l=[],Pt=this.table,u="",at=0,Yt=0,Lr=0,zs=2,Dr=1,Ys=l.slice.call(arguments,1),P=Object.create(this.lexer),dt={yy:{}};for(var Be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Be)&&(dt.yy[Be]=this.yy[Be]);P.setInput(d,dt.yy),dt.yy.lexer=P,dt.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var Ie=P.yylloc;l.push(Ie);var Gs=P.options&&P.options.ranges;typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ti(W){g.length=g.length-2*W,N.length=N.length-W,l.length=l.length-W}for(var Ks=function(){var W;return W=P.lex()||Dr,typeof W!="number"&&(W=k.symbols_[W]||W),W},O,Re,gt,M,Ni,qe,At={},he,Z,_r,pe;;){if(gt=g[g.length-1],this.defaultActions[gt]?M=this.defaultActions[gt]:((O===null||typeof O>"u")&&(O=Ks()),M=Pt[gt]&&Pt[gt][O]),typeof M>"u"||!M.length||!M[0]){var Ve="";pe=[];for(he in Pt[gt])this.terminals_[he]&&he>zs&&pe.push("'"+this.terminals_[he]+"'");P.showPosition?Ve="Parse error on line "+(at+1)+`: +`+P.showPosition()+` +Expecting `+pe.join(", ")+", got '"+(this.terminals_[O]||O)+"'":Ve="Parse error on line "+(at+1)+": Unexpected "+(O==Dr?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(Ve,{text:P.match,token:this.terminals_[O]||O,line:P.yylineno,loc:Ie,expected:pe})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gt+", token: "+O);switch(M[0]){case 1:g.push(O),N.push(P.yytext),l.push(P.yylloc),g.push(M[1]),O=null,Re?(O=Re,Re=null):(Yt=P.yyleng,u=P.yytext,at=P.yylineno,Ie=P.yylloc,Lr>0&&Lr--);break;case 2:if(Z=this.productions_[M[1]][1],At.$=N[N.length-Z],At._$={first_line:l[l.length-(Z||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(Z||1)].first_column,last_column:l[l.length-1].last_column},Gs&&(At._$.range=[l[l.length-(Z||1)].range[0],l[l.length-1].range[1]]),qe=this.performAction.apply(At,[u,Yt,at,dt.yy,M[1],N,l].concat(Ys)),typeof qe<"u")return qe;Z&&(g=g.slice(0,-1*Z*2),N=N.slice(0,-1*Z),l=l.slice(0,-1*Z)),g.push(this.productions_[M[1]][0]),N.push(At.$),l.push(At._$),_r=Pt[g[g.length-2]][g[g.length-1]],g.push(_r);break;case 3:return!0}}return!0}},Ms=function(){var it={EOF:1,parseError:function(k,g){if(this.yy.parser)this.yy.parser.parseError(k,g);else throw new Error(k)},setInput:function(d,k){return this.yy=k||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var k=d.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},unput:function(d){var k=d.length,g=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var N=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===b.length?this.yylloc.first_column:0)+b[b.length-g.length].length-g[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[N[0],N[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(d){this.unput(this.match.slice(d))},pastInput:function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var d=this.pastInput(),k=new Array(d.length+1).join("-");return d+this.upcomingInput()+` +`+k+"^"},test_match:function(d,k){var g,b,N;if(this.options.backtrack_lexer&&(N={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(N.yylloc.range=this.yylloc.range.slice(0))),b=d[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],g=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var l in N)this[l]=N[l];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,k,g,b;this._more||(this.yytext="",this.match="");for(var N=this._currentRules(),l=0;lk[0].length)){if(k=g,b=l,this.options.backtrack_lexer){if(d=this.test_match(g,N[l]),d!==!1)return d;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(d=this.test_match(k,N[b]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var k=this.next();return k||this.lex()},begin:function(k){this.conditionStack.push(k)},popState:function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},pushState:function(k){this.begin(k)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(k,g,b,N){function l(u,at){return g.yytext=g.yytext.substring(u,g.yyleng-at+u)}var Pt=N;switch(b){case 0:if(g.yytext.slice(-2)==="\\\\"?(l(0,1),this.begin("mu")):g.yytext.slice(-1)==="\\"?(l(0,1),this.begin("emu")):this.begin("mu"),g.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(l(5,9),18);case 5:return 15;case 6:return this.popState(),14;break;case 7:return 64;case 8:return 67;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 56;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 52;case 20:return 48;case 21:this.unput(g.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 72;case 25:return 71;case 26:return 71;case 27:return 86;case 28:break;case 29:return this.popState(),55;break;case 30:return this.popState(),33;break;case 31:return g.yytext=l(1,2).replace(/\\"/g,'"'),79;break;case 32:return g.yytext=l(1,2).replace(/\\'/g,"'"),79;break;case 33:return 84;case 34:return 81;case 35:return 81;case 36:return 82;case 37:return 83;case 38:return 80;case 39:return 74;case 40:return 76;case 41:return 71;case 42:return g.yytext=g.yytext.replace(/\\([\\\]])/g,"$1"),71;break;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return it}();_e.lexer=Ms;function Oe(){this.yy={}}return Oe.prototype=_e,_e.Parser=Oe,new Oe}(),Se=Fn;var er=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function rr(e,t){var r=t&&t.loc,s,n,i,a;r&&(s=r.start.line,n=r.end.line,i=r.start.column,a=r.end.column,e+=" - "+s+":"+i);for(var o=Error.prototype.constructor.call(this,e),c=0;car,id:()=>Hn,prepareBlock:()=>Kn,prepareMustache:()=>Yn,preparePartialBlock:()=>jn,preparePath:()=>zn,prepareProgram:()=>Wn,prepareRawBlock:()=>Gn,stripComment:()=>Mn,stripFlags:()=>Un});function ir(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new ot(e.path.original+" doesn't match "+t,r)}}function ar(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}function Hn(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function Un(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function Mn(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function zn(e,t,r){r=this.locInfo(r);for(var s=e?"@":"",n=[],i=0,a=0,o=t.length;a0)throw new ot("Invalid path: "+s,{loc:r});c===".."&&i++}else n.push(c)}return{type:"PathExpression",data:e,depth:i,parts:n,original:s,loc:r}}function Yn(e,t,r,s,n,i){var a=s.charAt(3)||s.charAt(2),o=a!=="{"&&a!=="&",c=/\*/.test(s);return{type:c?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:o,strip:n,loc:this.locInfo(i)}}function Gn(e,t,r,s){ir(e,r),s=this.locInfo(s);var n={type:"Program",body:t,strip:{},loc:s};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}}function Kn(e,t,r,s,n,i){s&&s.path&&ir(e,s);var a=/\*/.test(e.open);t.blockParams=e.blockParams;var o,c;if(r){if(a)throw new ot("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=s.strip),c=r.strip,o=r.program}return n&&(n=o,o=t,t=n),{type:a?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:o,openStrip:e.strip,inverseStrip:c,closeStrip:s&&s.strip,loc:this.locInfo(i)}}function Wn(e,t){if(!t&&e.length){var r=e[0].loc,s=e[e.length-1].loc;r&&s&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}function jn(e,t,r,s){return ir(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(s)}}var Ss={};for(we in ne)Object.prototype.hasOwnProperty.call(ne,we)&&(Ss[we]=ne[we]);var we;function Te(e,t){if(e.type==="Program")return e;Se.yy=Ss,Se.yy.locInfo=function(s){return new ar(t&&t.srcName,s)};var r=Se.parse(e);return r}function or(e,t){var r=Te(e,t),s=new ks(t);return s.accept(r)}var Es={Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",amp:"&",AMP:"&",andand:"\u2A55",And:"\u2A53",and:"\u2227",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angmsd:"\u2221",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",apacir:"\u2A6F",ap:"\u2248",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsolb:"\u29C5",bsol:"\\",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",cap:"\u2229",Cap:"\u22D2",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25CB",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cup:"\u222A",Cup:"\u22D3",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21A1",dArr:"\u21D3",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21CA",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21D3",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21BD",DownRightTeeVector:"\u295F",DownRightVectorBar:"\u2957",DownRightVector:"\u21C1",DownTeeArrow:"\u21A7",DownTee:"\u22A4",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",Ecirc:"\xCA",ecirc:"\xEA",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",gescc:"\u2AA9",ges:"\u2A7E",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2AA5",gl:"\u2277",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gtcc:"\u2AA7",gtcir:"\u2A7A",gt:">",GT:">",Gt:"\u226B",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",harrcir:"\u2948",harr:"\u2194",hArr:"\u21D4",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",incare:"\u2105",in:"\u2208",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",intcal:"\u22BA",int:"\u222B",Int:"\u222C",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larrb:"\u21E4",larrbfs:"\u291F",larr:"\u2190",Larr:"\u219E",lArr:"\u21D0",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",latail:"\u2919",lAtail:"\u291B",lat:"\u2AAB",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",LeftArrowBar:"\u21E4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21D0",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21C3",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTeeArrow:"\u21A4",LeftTee:"\u22A3",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangleBar:"\u29CF",LeftTriangle:"\u22B2",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21BF",LeftVectorBar:"\u2952",LeftVector:"\u21BC",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",lescc:"\u2AA8",les:"\u2A7D",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21C7",ll:"\u226A",Ll:"\u22D8",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoustache:"\u23B0",lmoust:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftrightarrow:"\u27F7",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longmapsto:"\u27FC",longrightarrow:"\u27F6",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2AA6",ltcir:"\u2A79",lt:"<",LT:"<",Lt:"\u226A",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",midast:"*",midcir:"\u2AF0",mid:"\u2223",middot:"\xB7",minusb:"\u229F",minus:"\u2212",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266E",naturals:"\u2115",natur:"\u266E",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` +`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangle:"\u22EB",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",nprec:"\u2280",npreceq:"\u2AAF\u0338",npre:"\u2AAF\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",Ocirc:"\xD4",ocirc:"\xF4",ocir:"\u229A",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",orarr:"\u21BB",Or:"\u2A54",or:"\u2228",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",otimesas:"\u2A36",Otimes:"\u2A37",otimes:"\u2297",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",para:"\xB6",parallel:"\u2225",par:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plus:"+",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",prap:"\u2AB7",Pr:"\u2ABB",pr:"\u227A",prcue:"\u227C",precapprox:"\u2AB7",prec:"\u227A",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",pre:"\u2AAF",prE:"\u2AB3",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportional:"\u221D",Proportion:"\u2237",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21A0",rArr:"\u21D2",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",Re:"\u211C",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrowBar:"\u21E5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21D2",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVectorBar:"\u2955",RightDownVector:"\u21C2",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTeeArrow:"\u21A6",RightTee:"\u22A2",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangleBar:"\u29D0",RightTriangle:"\u22B3",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVectorBar:"\u2954",RightUpVector:"\u21BE",RightVectorBar:"\u2953",RightVector:"\u21C0",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoustache:"\u23B1",rmoust:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2ABC",sc:"\u227B",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdotb:"\u22A1",sdot:"\u22C5",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",solbar:"\u233F",solb:"\u29C4",sol:"/",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squ:"\u25A1",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succapprox:"\u2AB8",succ:"\u227B",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",Sup:"\u22D1",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2A31",timesb:"\u22A0",times:"\xD7",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",topbot:"\u2336",topcir:"\u2AF1",top:"\u22A4",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",uarr:"\u2191",Uarr:"\u219F",uArr:"\u21D1",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21D1",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21D5",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTeeArrow:"\u21A5",UpTee:"\u22A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",veebar:"\u22BB",vee:"\u2228",Vee:"\u22C1",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xharr:"\u27F7",xhArr:"\u27FA",Xi:"\u039E",xi:"\u03BE",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",yuml:"\xFF",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",zfr:"\u{1D537}",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"},Qn=/^#[xX]([A-Fa-f0-9]+)$/,Jn=/^#([0-9]+)$/,$n=/^([A-Za-z0-9]+)$/,lr=function(){function e(t){this.named=t}return e.prototype.parse=function(t){if(t){var r=t.match(Qn);if(r)return String.fromCharCode(parseInt(r[1],16));if(r=t.match(Jn),r)return String.fromCharCode(parseInt(r[1],10));if(r=t.match($n),r)return this.named[r[1]]}},e}(),Xn=/[\t\n\f ]/,Zn=/[A-Za-z]/,ti=/\r\n?/g;function _(e){return Xn.test(e)}function vs(e){return Zn.test(e)}function ei(e){return e.replace(ti,` +`)}var cr=function(){function e(t,r,s){s===void 0&&(s="precompile"),this.delegate=t,this.entityParser=r,this.mode=s,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var n=this.peek();if(n==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&n===` +`){var i=this.tagNameBuffer.toLowerCase();(i==="pre"||i==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var n=this.peek(),i=this.tagNameBuffer;n==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):n==="&"&&i!=="script"&&i!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(n))},tagOpen:function(){var n=this.consume();n==="!"?this.transitionTo("markupDeclarationOpen"):n==="/"?this.transitionTo("endTagOpen"):(n==="@"||n===":"||vs(n))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(n))},markupDeclarationOpen:function(){var n=this.consume();if(n==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var i=n.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();i==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var n=this.consume();_(n)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var n=this.consume();_(n)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase()))},doctypeName:function(){var n=this.consume();_(n)?this.transitionTo("afterDoctypeName"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase())},afterDoctypeName:function(){var n=this.consume();if(!_(n))if(n===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var i=n.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),a=i.toUpperCase()==="PUBLIC",o=i.toUpperCase()==="SYSTEM";(a||o)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),a?this.transitionTo("afterDoctypePublicKeyword"):o&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var n=this.peek();_(n)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):n==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):n==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):n===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},doctypePublicIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},afterDoctypePublicIdentifier:function(){var n=this.consume();_(n)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var n=this.consume();_(n)||(n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(n)},doctypeSystemIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(n)},afterDoctypeSystemIdentifier:function(){var n=this.consume();_(n)||n===">"&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var n=this.consume();n==="-"?this.transitionTo("commentStartDash"):n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(n),this.transitionTo("comment"))},commentStartDash:function(){var n=this.consume();n==="-"?this.transitionTo("commentEnd"):n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var n=this.consume();n==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(n)},commentEndDash:function(){var n=this.consume();n==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+n),this.transitionTo("comment"))},commentEnd:function(){var n=this.consume();n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+n),this.transitionTo("comment"))},tagName:function(){var n=this.consume();_(n)?this.transitionTo("beforeAttributeName"):n==="/"?this.transitionTo("selfClosingStartTag"):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(n)},endTagName:function(){var n=this.consume();_(n)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):n==="/"?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(n)},beforeAttributeName:function(){var n=this.peek();if(_(n)){this.consume();return}else n==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):n===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):n==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(n)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var n=this.peek();_(n)?(this.transitionTo("afterAttributeName"),this.consume()):n==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):n==='"'||n==="'"||n==="<"?(this.delegate.reportSyntaxError(n+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(n)):(this.consume(),this.delegate.appendToAttributeName(n))},afterAttributeName:function(){var n=this.peek();if(_(n)){this.consume();return}else n==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(n))},beforeAttributeValue:function(){var n=this.peek();_(n)?this.consume():n==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):n==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(n))},attributeValueDoubleQuoted:function(){var n=this.consume();n==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):n==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(n)},attributeValueSingleQuoted:function(){var n=this.consume();n==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):n==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(n)},attributeValueUnquoted:function(){var n=this.peek();_(n)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):n==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):n===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(n))},afterAttributeValueQuoted:function(){var n=this.peek();_(n)?(this.consume(),this.transitionTo("beforeAttributeName")):n==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):n===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){var n=this.peek();n===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var n=this.consume();(n==="@"||n===":"||vs(n))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(n))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(t){this.state=t},e.prototype.tokenize=function(t){this.reset(),this.tokenizePart(t),this.tokenizeEOF()},e.prototype.tokenizePart=function(t){for(this.input+=ei(t);this.index"||t==="style"&&this.input.substring(this.index,this.index+8)!==""||t==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},e}(),eo=function(){function e(t,r){r===void 0&&(r={}),this.options=r,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new cr(this,t,r.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(t){return this.tokens=[],this.tokenizer.tokenize(t),this.tokens},e.prototype.tokenizePart=function(t){return this.tokens=[],this.tokenizer.tokenizePart(t),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var t=this.token;if(t===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return t;for(var r=0;r\xa0]/u,mo=new RegExp(si.source,"gu");var dr=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function ni(e){var t;return dr.has(e.toLowerCase())&&((t=e[0])==null?void 0:t.toLowerCase())===e[0]}function ce(e){return!!e&&e.length>0}function Nr(e){return e.length===0?void 0:e[e.length-1]}function ii(e){return e.length===0?void 0:e[0]}var pt=Object.freeze({line:1,column:0}),ai=Object.freeze({source:"(synthetic)",start:pt,end:pt}),gr=Object.freeze({source:"(nonexistent)",start:pt,end:pt}),ht=Object.freeze({source:"(broken)",start:pt,end:pt}),br=class{constructor(t){this._whens=t}first(t){for(let r of this._whens){let s=r.match(t);if(ce(s))return s[0]}return null}},Pe=class{get(t,r){let s=this._map.get(t);return s||(s=r(),this._map.set(t,s),s)}add(t,r){this._map.set(t,r)}match(t){let r=function(a){switch(a){case"Broken":case"InternalsSynthetic":case"NonExistent":return"IS_INVISIBLE";default:return a}}(t),s=[],n=this._map.get(r),i=this._map.get("MATCH_ANY");return n&&s.push(n),i&&s.push(i),s}constructor(){this._map=new Map}};function _s(e){return e(new yr).validate()}var yr=class{validate(){return(t,r)=>this.matchFor(t.kind,r.kind)(t,r)}matchFor(t,r){let s=this._whens.match(t);return ce(),new br(s).first(r)}when(t,r,s){return this._whens.get(t,()=>new Pe).add(r,s),this}constructor(){this._whens=new Pe}},kr=class e{static synthetic(t){let r=D.synthetic(t);return new e({loc:r,chars:t})}static load(t,r){return new e({loc:D.load(t,r[1]),chars:r[0]})}constructor(t){this.loc=t.loc,this.chars=t.chars}getString(){return this.chars}serialize(){return[this.chars,this.loc.serialize()]}},D=class e{static get NON_EXISTENT(){return new et("NonExistent",gr).wrap()}static load(t,r){return typeof r=="number"?e.forCharPositions(t,r,r):typeof r=="string"?e.synthetic(r):Array.isArray(r)?e.forCharPositions(t,r[0],r[1]):r==="NonExistent"?e.NON_EXISTENT:r==="Broken"?e.broken(ht):void ds(r)}static forHbsLoc(t,r){let s=new mt(t,r.start),n=new mt(t,r.end);return new oe(t,{start:s,end:n},r).wrap()}static forCharPositions(t,r,s){let n=new Tt(t,r),i=new Tt(t,s);return new ae(t,{start:n,end:i}).wrap()}static synthetic(t){return new et("InternalsSynthetic",gr,t).wrap()}static broken(t=ht){return new et("Broken",t).wrap()}constructor(t){var r;this.data=t,this.isInvisible=(r=t.kind)!=="CharPosition"&&r!=="HbsPosition"}getStart(){return this.data.getStart().wrap()}getEnd(){return this.data.getEnd().wrap()}get loc(){let t=this.data.toHbsSpan();return t===null?ht:t.toHbsLoc()}get module(){return this.data.getModule()}get startPosition(){return this.loc.start}get endPosition(){return this.loc.end}toJSON(){return this.loc}withStart(t){return J(t.data,this.data.getEnd())}withEnd(t){return J(this.data.getStart(),t.data)}asString(){return this.data.asString()}toSlice(t){let r=this.data.asString();return Ds&&t!==void 0&&r!==t&&console.warn(`unexpectedly found ${JSON.stringify(r)} when slicing source, but expected ${JSON.stringify(t)}`),new kr({loc:this,chars:t||r})}get start(){return this.loc.start}set start(t){this.data.locDidUpdate({start:t})}get end(){return this.loc.end}set end(t){this.data.locDidUpdate({end:t})}get source(){return this.module}collapse(t){switch(t){case"start":return this.getStart().collapsed();case"end":return this.getEnd().collapsed()}}extend(t){return J(this.data.getStart(),t.data.getEnd())}serialize(){return this.data.serialize()}slice({skipStart:t=0,skipEnd:r=0}){return J(this.getStart().move(t).data,this.getEnd().move(-r).data)}sliceStartChars({skipStart:t=0,chars:r}){return J(this.getStart().move(t).data,this.getStart().move(t+r).data)}sliceEndChars({skipEnd:t=0,chars:r}){return J(this.getEnd().move(t-r).data,this.getStart().move(-t).data)}},Ut,ae=class{constructor(t,r){Lt(this,Ut);this.source=t,this.charPositions=r,this.kind="CharPosition",Y(this,Ut,null)}wrap(){return new D(this)}asString(){return this.source.slice(this.charPositions.start.charPos,this.charPositions.end.charPos)}getModule(){return this.source.module}getStart(){return this.charPositions.start}getEnd(){return this.charPositions.end}locDidUpdate(){}toHbsSpan(){let t=I(this,Ut);if(t===null){let r=this.charPositions.start.toHbsPos(),s=this.charPositions.end.toHbsPos();t=Y(this,Ut,r===null||s===null?ft:new oe(this.source,{start:r,end:s}))}return t===ft?null:t}serialize(){let{start:{charPos:t},end:{charPos:r}}=this.charPositions;return t===r?t:[t,r]}toCharPosSpan(){return this}};Ut=new WeakMap;var ut,Et,oe=class{constructor(t,r,s=null){Lt(this,ut);Lt(this,Et);this.source=t,this.hbsPositions=r,this.kind="HbsPosition",Y(this,ut,null),Y(this,Et,s)}serialize(){let t=this.toCharPosSpan();return t===null?"Broken":t.wrap().serialize()}wrap(){return new D(this)}updateProvided(t,r){I(this,Et)&&(I(this,Et)[r]=t),Y(this,ut,null),Y(this,Et,{start:t,end:t})}locDidUpdate({start:t,end:r}){t!==void 0&&(this.updateProvided(t,"start"),this.hbsPositions.start=new mt(this.source,t,null)),r!==void 0&&(this.updateProvided(r,"end"),this.hbsPositions.end=new mt(this.source,r,null))}asString(){let t=this.toCharPosSpan();return t===null?"":t.asString()}getModule(){return this.source.module}getStart(){return this.hbsPositions.start}getEnd(){return this.hbsPositions.end}toHbsLoc(){return{start:this.hbsPositions.start.hbsPos,end:this.hbsPositions.end.hbsPos}}toHbsSpan(){return this}toCharPosSpan(){let t=I(this,ut);if(t===null){let r=this.hbsPositions.start.toCharPos(),s=this.hbsPositions.end.toCharPos();if(!r||!s)return t=Y(this,ut,ft),null;t=Y(this,ut,new ae(this.source,{start:r,end:s}))}return t===ft?null:t}};ut=new WeakMap,Et=new WeakMap;var et=class{constructor(t,r,s=null){this.kind=t,this.loc=r,this.string=s}serialize(){switch(this.kind){case"Broken":case"NonExistent":return this.kind;case"InternalsSynthetic":return this.string||""}}wrap(){return new D(this)}asString(){return this.string||""}locDidUpdate({start:t,end:r}){t!==void 0&&(this.loc.start=t),r!==void 0&&(this.loc.end=r)}getModule(){return"an unknown module"}getStart(){return new le(this.kind,this.loc.start)}getEnd(){return new le(this.kind,this.loc.end)}toCharPosSpan(){return this}toHbsSpan(){return null}toHbsLoc(){return ht}},J=_s(e=>e.when("HbsPosition","HbsPosition",(t,r)=>new oe(t.source,{start:t,end:r}).wrap()).when("CharPosition","CharPosition",(t,r)=>new ae(t.source,{start:t,end:r}).wrap()).when("CharPosition","HbsPosition",(t,r)=>{let s=r.toCharPos();return s===null?new et("Broken",ht).wrap():J(t,s)}).when("HbsPosition","CharPosition",(t,r)=>{let s=t.toCharPos();return s===null?new et("Broken",ht).wrap():J(s,r)}).when("IS_INVISIBLE","MATCH_ANY",t=>new et(t.kind,ht).wrap()).when("MATCH_ANY","IS_INVISIBLE",(t,r)=>new et(r.kind,ht).wrap())),ft="BROKEN",Mt=class e{static forHbsPos(t,r){return new mt(t,r,null).wrap()}static broken(t=pt){return new le("Broken",t).wrap()}constructor(t){this.data=t}get offset(){let t=this.data.toCharPos();return t===null?null:t.offset}eql(t){return oi(this.data,t.data)}until(t){return J(this.data,t.data)}move(t){let r=this.data.toCharPos();if(r===null)return e.broken();{let s=r.offset+t;return r.source.validate(s)?new Tt(r.source,s).wrap():e.broken()}}collapsed(){return J(this.data,this.data)}toJSON(){return this.data.toJSON()}},Tt=class{constructor(t,r){this.source=t,this.charPos=r,this.kind="CharPosition",this._locPos=null}toCharPos(){return this}toJSON(){let t=this.toHbsPos();return t===null?pt:t.toJSON()}wrap(){return new Mt(this)}get offset(){return this.charPos}toHbsPos(){let t=this._locPos;if(t===null){let r=this.source.hbsPosFor(this.charPos);this._locPos=t=r===null?ft:new mt(this.source,r,this.charPos)}return t===ft?null:t}},mt=class{constructor(t,r,s=null){this.source=t,this.hbsPos=r,this.kind="HbsPosition",this._charPos=s===null?null:new Tt(t,s)}toCharPos(){let t=this._charPos;if(t===null){let r=this.source.charPosFor(this.hbsPos);this._charPos=t=r===null?ft:new Tt(this.source,r)}return t===ft?null:t}toJSON(){return this.hbsPos}wrap(){return new Mt(this)}toHbsPos(){return this}},le=class{constructor(t,r){this.kind=t,this.pos=r}toCharPos(){return null}toJSON(){return this.pos}wrap(){return new Mt(this)}get offset(){return null}},oi=_s(e=>e.when("HbsPosition","HbsPosition",({hbsPos:t},{hbsPos:r})=>t.column===r.column&&t.line===r.line).when("CharPosition","CharPosition",({charPos:t},{charPos:r})=>t===r).when("CharPosition","HbsPosition",({offset:t},r)=>{var s;return t===((s=r.toCharPos())==null?void 0:s.offset)}).when("HbsPosition","CharPosition",(t,{offset:r})=>{var s;return((s=t.toCharPos())==null?void 0:s.offset)===r}).when("MATCH_ANY","MATCH_ANY",()=>!1)),wt=class e{static from(t,r={}){var s;return new e(t,(s=r.meta)==null?void 0:s.moduleName)}constructor(t,r="an unknown module"){this.source=t,this.module=r}validate(t){return t>=0&&t<=this.source.length}slice(t,r){return this.source.slice(t,r)}offsetFor(t,r){return Mt.forHbsPos(this,{line:t,column:r})}spanFor({start:t,end:r}){return D.forHbsLoc(this,{start:{line:t.line,column:t.column},end:{line:r.line,column:r.column}})}hbsPosFor(t){let r=0,s=0;if(t>this.source.length)return null;for(;;){let n=this.source.indexOf(` +`,s);if(t<=n||n===-1)return{line:r+1,column:t-s};r+=1,s=n+1}}charPosFor(t){let{line:r,column:s}=t,n=this.source.length,i=0,a=0;for(;ao)return o;if(Ds){let c=this.hbsPosFor(a+s);c.line,c.column}return a+s}if(o===-1)return 0;i+=1,a=o+1}return n}};function v(e,t){let{module:r,loc:s}=t,{line:n,column:i}=s.start,a=t.asString(),o=a?` + +| +| ${a.split(` +`).join(` +| `)} +| + +`:"",c=new Error(`${e}: ${o}(error occurred in '${r}' @ line ${n} : column ${i})`);return c.name="SyntaxError",c.location=t,c.code=a,c}var li={Template:["body"],Block:["body"],MustacheStatement:["path","params","hash"],BlockStatement:["path","params","hash","program","inverse"],ElementModifierStatement:["path","params","hash"],CommentStatement:[],MustacheCommentStatement:[],ElementNode:["attributes","modifiers","children","comments"],AttrNode:["value"],TextNode:[],ConcatStatement:["parts"],SubExpression:["path","params","hash"],PathExpression:[],StringLiteral:[],BooleanLiteral:[],NumberLiteral:[],NullLiteral:[],UndefinedLiteral:[],Hash:["pairs"],HashPair:["value"]},Cr=function(){function e(t,r,s,n){let i=Error.call(this,t);this.key=n,this.message=t,this.node=r,this.parent=s,i.stack&&(this.stack=i.stack)}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}();function Ts(e,t,r){return new Cr("Cannot remove a node unless it is part of an array",e,t,r)}function ci(e,t,r){return new Cr("Cannot replace a node with multiple nodes unless it is part of an array",e,t,r)}function Ns(e,t){return new Cr("Replacing and removing in key handlers is not yet supported.",e,null,t)}var zt=class{constructor(t,r=null,s=null){this.node=t,this.parent=r,this.parentKey=s}get parentNode(){return this.parent?this.parent.node:null}parents(){return{[Symbol.iterator]:()=>new Sr(this)}}},Sr=class{constructor(t){this.path=t}next(){return this.path.parent?(this.path=this.path.parent,{done:!1,value:this.path}):{done:!0,value:null}}};function Os(e){return typeof e=="function"?e:e.enter}function Bs(e){return typeof e=="function"?void 0:e.exit}function Ae(e,t){let r,s,n,{node:i,parent:a,parentKey:o}=t,c=function(h,p){if(h.Program&&(p==="Template"&&!h.Template||p==="Block"&&!h.Block))return h.Program;let m=h[p];return m!==void 0?m:h.All}(e,i.type);if(c!==void 0&&(r=Os(c),s=Bs(c)),r!==void 0&&(n=r(i,t)),n!=null){if(JSON.stringify(i)!==JSON.stringify(n))return Array.isArray(n)?(Is(e,n,a,o),n):Ae(e,new zt(n,a,o))||n;n=void 0}if(n===void 0){let h=li[i.type];for(let p=0;ptypeof t=="string"?f.var({name:t,loc:D.synthetic(t)}):t)}function Ps(e=[],t=[],r=!1,s){return f.blockItself({body:e,params:qs(t),chained:r,loc:T(s||null)})}function As(e=[],t=[],r){return f.template({body:e,blockParams:t,loc:T(r||null)})}function T(...e){if(e.length===1){let t=e[0];return t&&typeof t=="object"?D.forHbsLoc(hr(),t):D.forHbsLoc(hr(),ai)}{let[t,r,s,n,i]=e,a=i?new wt("",i):hr();return D.forHbsLoc(a,{start:{line:t,column:r},end:{line:s||t,column:n||r}})}}var fi={mustache:function(e,t=[],r=ie([]),s=!1,n,i){return f.mustache({path:ct(e),params:t,hash:r,trusting:s,strip:i,loc:T(n||null)})},block:function(e,t,r,s,n=null,i,a,o,c){let h,p=null;return h=s.type==="Template"?f.blockItself({params:qs(s.blockParams),body:s.body,loc:s.loc}):s,(n==null?void 0:n.type)==="Template"?(n.blockParams.length,p=f.blockItself({params:[],body:n.body,loc:n.loc})):p=n,f.block({path:ct(e),params:t||[],hash:r||ie([]),defaultBlock:h,elseBlock:p,loc:T(i||null),openStrip:a,inverseStrip:o,closeStrip:c})},comment:function(e,t){return f.comment({value:e,loc:T(t||null)})},mustacheComment:function(e,t){return f.mustacheComment({value:e,loc:T(t||null)})},element:function(e,t={}){let r,s,{attrs:n,blockParams:i,modifiers:a,comments:o,children:c,openTag:h,closeTag:p,loc:m}=t;typeof e=="string"?e.endsWith("/")?(r=ct(e.slice(0,-1)),s=!0):r=ct(e):"type"in e?(e.type,e.type,r=e):"path"in e?(e.path.type,e.path.type,r=e.path,s=e.selfClosing):(r=ct(e.name),s=e.selfClosing);let S=i==null?void 0:i.map(E=>typeof E=="string"?xs(E):E),y=null;return p?y=T(p):p===void 0&&(y=s||ni(r.original)?null:T(null)),f.element({path:r,selfClosing:s||!1,attributes:n||[],params:S||[],modifiers:a||[],comments:o||[],children:c||[],openTag:T(h||null),closeTag:y,loc:T(m||null)})},elementModifier:function(e,t,r,s){return f.elementModifier({path:ct(e),params:t||[],hash:r||ie([]),loc:T(s||null)})},attr:function(e,t,r){return f.attr({name:e,value:t,loc:T(r||null)})},text:function(e="",t){return f.text({chars:e,loc:T(t||null)})},sexpr:function(e,t=[],r=ie([]),s){return f.sexpr({path:ct(e),params:t,hash:r,loc:T(s||null)})},concat:function(e,t){if(!ce(e))throw new Error("b.concat requires at least one part");return f.concat({parts:e,loc:T(t||null)})},hash:ie,pair:function(e,t,r){return f.pair({key:e,value:t,loc:T(r||null)})},literal:xe,program:function(e,t,r){return t&&t.length?Ps(e,t,!1,r):As(e,[],r)},blockItself:Ps,template:As,loc:T,pos:function(e,t){return f.pos({line:e,column:t})},path:ct,fullPath:function(e,t=[],r){return f.path({head:e,tail:t,loc:T(r||null)})},head:function(e,t){return f.head({original:e,loc:T(t||null)})},at:function(e,t){return f.atName({name:e,loc:T(t||null)})},var:xs,this:function(e){return f.this({loc:T(e||null)})},string:pr("StringLiteral"),boolean:pr("BooleanLiteral"),number:pr("NumberLiteral"),undefined:()=>xe("UndefinedLiteral",void 0),null:()=>xe("NullLiteral",null)};function pr(e){return function(t,r){return xe(e,t,r)}}var Ce={close:!1,open:!1},f=new class{pos({line:e,column:t}){return{line:e,column:t}}blockItself({body:e,params:t,chained:r=!1,loc:s}){return{type:"Block",body:e,params:t,get blockParams(){return this.params.map(n=>n.name)},set blockParams(n){this.params=n.map(i=>f.var({name:i,loc:D.synthetic(i)}))},chained:r,loc:s}}template({body:e,blockParams:t,loc:r}){return{type:"Template",body:e,blockParams:t,loc:r}}mustache({path:e,params:t,hash:r,trusting:s,loc:n,strip:i=Ce}){return function({path:a,params:o,hash:c,trusting:h,strip:p,loc:m}){let S={type:"MustacheStatement",path:a,params:o,hash:c,trusting:h,strip:p,loc:m};return Object.defineProperty(S,"escaped",{enumerable:!1,get(){return!this.trusting},set(y){this.trusting=!y}}),S}({path:e,params:t,hash:r,trusting:s,strip:i,loc:n})}block({path:e,params:t,hash:r,defaultBlock:s,elseBlock:n=null,loc:i,openStrip:a=Ce,inverseStrip:o=Ce,closeStrip:c=Ce}){return{type:"BlockStatement",path:e,params:t,hash:r,program:s,inverse:n,loc:i,openStrip:a,inverseStrip:o,closeStrip:c}}comment({value:e,loc:t}){return{type:"CommentStatement",value:e,loc:t}}mustacheComment({value:e,loc:t}){return{type:"MustacheCommentStatement",value:e,loc:t}}concat({parts:e,loc:t}){return{type:"ConcatStatement",parts:e,loc:t}}element({path:e,selfClosing:t,attributes:r,modifiers:s,params:n,comments:i,children:a,openTag:o,closeTag:c,loc:h}){let p=t;return{type:"ElementNode",path:e,attributes:r,modifiers:s,params:n,comments:i,children:a,openTag:o,closeTag:c,loc:h,get tag(){return this.path.original},set tag(m){this.path.original=m},get blockParams(){return this.params.map(m=>m.name)},set blockParams(m){this.params=m.map(S=>f.var({name:S,loc:D.synthetic(S)}))},get selfClosing(){return p},set selfClosing(m){p=m,this.closeTag=m?null:D.synthetic(``)}}}elementModifier({path:e,params:t,hash:r,loc:s}){return{type:"ElementModifierStatement",path:e,params:t,hash:r,loc:s}}attr({name:e,value:t,loc:r}){return{type:"AttrNode",name:e,value:t,loc:r}}text({chars:e,loc:t}){return{type:"TextNode",chars:e,loc:t}}sexpr({path:e,params:t,hash:r,loc:s}){return{type:"SubExpression",path:e,params:t,hash:r,loc:s}}path({head:e,tail:t,loc:r}){return function({head:s,tail:n,loc:i}){let a={type:"PathExpression",head:s,tail:n,get original(){return[this.head.original,...this.tail].join(".")},set original(o){let[c,...h]=o.split(".");this.head=fi.head(c,this.head.loc),this.tail=h},loc:i};return Object.defineProperty(a,"parts",{enumerable:!1,get(){let o=this.original.split(".");return o[0]==="this"?o.shift():o[0].startsWith("@")&&(o[0]=o[0].slice(1)),Object.freeze(o)},set(o){var h;let c=[...o];c[0]==="this"||(h=c[0])!=null&&h.startsWith("@")||(this.head.type==="ThisHead"?c.unshift("this"):this.head.type==="AtHead"&&(c[0]=`@${c[0]}`)),this.original=c.join(".")}}),Object.defineProperty(a,"this",{enumerable:!1,get(){return this.head.type==="ThisHead"}}),Object.defineProperty(a,"data",{enumerable:!1,get(){return this.head.type==="AtHead"}}),a}({head:e,tail:t,loc:r})}head({original:e,loc:t}){return e==="this"?this.this({loc:t}):e[0]==="@"?this.atName({name:e,loc:t}):this.var({name:e,loc:t})}this({loc:e}){return{type:"ThisHead",get original(){return"this"},loc:e}}atName({name:e,loc:t}){let r="",s={type:"AtHead",get name(){return r},set name(n){n[0],n.indexOf("."),r=n},get original(){return this.name},set original(n){this.name=n},loc:t};return s.name=e,s}var({name:e,loc:t}){let r="",s={type:"VarHead",get name(){return r},set name(n){n[0],n.indexOf("."),r=n},get original(){return this.name},set original(n){this.name=n},loc:t};return s.name=e,s}hash({pairs:e,loc:t}){return{type:"Hash",pairs:e,loc:t}}pair({key:e,value:t,loc:r}){return{type:"HashPair",key:e,value:t,loc:r}}literal({type:e,value:t,loc:r}){return function({type:s,value:n,loc:i}){let a={type:s,value:n,loc:i};return Object.defineProperty(a,"original",{enumerable:!1,get(){return this.value},set(o){this.value=o}}),a}({type:e,value:t,loc:r})}},vr=class{constructor(t,r=new lr(Es),s="precompile"){this.elementStack=[],this.currentAttribute=null,this.currentNode=null,this.source=t,this.lines=t.source.split(/\r\n?|\n/u),this.tokenizer=new cr(this,r,s)}offset(){let{line:t,column:r}=this.tokenizer;return this.source.offsetFor(t,r)}pos({line:t,column:r}){return this.source.offsetFor(t,r)}finish(t){return tr({},t,{loc:t.start.until(this.offset())})}get currentAttr(){return this.currentAttribute}get currentTag(){let t=this.currentNode;return t&&(t.type==="StartTag"||t.type),t}get currentStartTag(){let t=this.currentNode;return t&&t.type,t}get currentEndTag(){let t=this.currentNode;return t&&t.type,t}get currentComment(){let t=this.currentNode;return t&&t.type,t}get currentData(){let t=this.currentNode;return t&&t.type,t}acceptNode(t){return this[t.type](t)}currentElement(){return Nr(this.elementStack)}sourceForNode(t,r){let s,n,i,a=t.loc.start.line-1,o=a-1,c=t.loc.start.column,h=[];for(r?(n=r.loc.end.line-1,i=r.loc.end.column):(n=t.loc.end.line-1,i=t.loc.end.column);o=C?-1:y.indexOf(x,E),w===-1||w+x.length>C?(E=C,U=this.source.spanFor(gr)):(E=w,U=S.sliceStartChars({skipStart:E,chars:x.length}),E+=x.length),o.push(f.var({name:x,loc:U}))}}else a=Ls(this.source,t,i);let c=this.Program(a.program,o),h=a.inverse?this.Program(a.inverse,[]):null,p=f.block({path:r,params:s,hash:n,defaultBlock:c,elseBlock:h,loc:this.source.spanFor(t.loc),openStrip:t.openStrip,inverseStrip:t.inverseStrip,closeStrip:t.closeStrip});Ht(this.currentElement(),p)}MustacheStatement(t){var o;(o=this.pendingError)==null||o.mustache(this.source.spanFor(t.loc));let{tokenizer:r}=this;if(r.state==="comment")return void this.appendToCommentData(this.sourceForNode(t));let s,{escaped:n,loc:i,strip:a}=t;if("original"in t.path&&t.path.original==="...attributes")throw v("Illegal use of ...attributes",this.source.spanFor(t.loc));if(Rs(t.path))s=f.mustache({path:this.acceptNode(t.path),params:[],hash:f.hash({pairs:[],loc:this.source.spanFor(t.path.loc).collapse("end")}),trusting:!n,loc:this.source.spanFor(i),strip:a});else{let{path:c,params:h,hash:p}=fr(this,t);s=f.mustache({path:c,params:h,hash:p,trusting:!n,loc:this.source.spanFor(i),strip:a})}switch(r.state){case"tagOpen":case"tagName":throw v("Cannot use mustaches in an elements tagname",s.loc);case"beforeAttributeName":mr(this.currentStartTag,s);break;case"attributeName":case"afterAttributeName":this.beginAttributeValue(!1),this.finishAttributeValue(),mr(this.currentStartTag,s),r.transitionTo("beforeAttributeName");break;case"afterAttributeValueQuoted":mr(this.currentStartTag,s),r.transitionTo("beforeAttributeName");break;case"beforeAttributeValue":this.beginAttributeValue(!1),this.appendDynamicAttributeValuePart(s),r.transitionTo("attributeValueUnquoted");break;case"attributeValueDoubleQuoted":case"attributeValueSingleQuoted":case"attributeValueUnquoted":this.appendDynamicAttributeValuePart(s);break;default:Ht(this.currentElement(),s)}return s}appendDynamicAttributeValuePart(t){this.finalizeTextPart();let r=this.currentAttr;r.isDynamic=!0,r.parts.push(t)}finalizeTextPart(){let t=this.currentAttr.currentPart;t!==null&&(this.currentAttr.parts.push(t),this.startTextPart())}startTextPart(){this.currentAttr.currentPart=null}ContentStatement(t){(function(r,s){let n=s.loc.start.line,i=s.loc.start.column,a=function(o,c){if(c==="")return{lines:o.split(` +`).length-1,columns:0};let[h]=o.split(c),p=h.split(/\n/u),m=p.length-1;return{lines:m,columns:p[m].length}}(s.original,s.value);n+=a.lines,a.lines?i=a.columns:i+=a.columns,r.line=n,r.column=i})(this.tokenizer,t),this.tokenizer.tokenizePart(t.value),this.tokenizer.flushData()}CommentStatement(t){let{tokenizer:r}=this;if(r.state==="comment")return this.appendToCommentData(this.sourceForNode(t)),null;let{value:s,loc:n}=t,i=f.mustacheComment({value:s,loc:this.source.spanFor(n)});switch(r.state){case"beforeAttributeName":case"afterAttributeName":this.currentStartTag.comments.push(i);break;case"beforeData":case"data":Ht(this.currentElement(),i);break;default:throw v(`Using a Handlebars comment when in the \`${r.state}\` state is not supported`,this.source.spanFor(t.loc))}return i}PartialStatement(t){throw v("Handlebars partials are not supported",this.source.spanFor(t.loc))}PartialBlockStatement(t){throw v("Handlebars partial blocks are not supported",this.source.spanFor(t.loc))}Decorator(t){throw v("Handlebars decorators are not supported",this.source.spanFor(t.loc))}DecoratorBlock(t){throw v("Handlebars decorator blocks are not supported",this.source.spanFor(t.loc))}SubExpression(t){let{path:r,params:s,hash:n}=fr(this,t);return f.sexpr({path:r,params:s,hash:n,loc:this.source.spanFor(t.loc)})}PathExpression(t){let{original:r}=t,s;if(r.indexOf("/")!==-1){if(r.slice(0,2)==="./")throw v('Using "./" is not supported in Glimmer and unnecessary',this.source.spanFor(t.loc));if(r.slice(0,3)==="../")throw v('Changing context using "../" is not supported in Glimmer',this.source.spanFor(t.loc));if(r.indexOf(".")!==-1)throw v("Mixing '.' and '/' in paths is not supported in Glimmer; use only '.' to separate property paths",this.source.spanFor(t.loc));s=[t.parts.join("/")]}else{if(r===".")throw v("'.' is not a supported path in Glimmer; check for a path with a trailing '.'",this.source.spanFor(t.loc));s=t.parts}let n,i=!1;if(/^this(?:\..+)?$/u.test(r)&&(i=!0),i)n=f.this({loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+4}})});else if(t.data){let a=s.shift();if(a===void 0)throw v("Attempted to parse a path expression, but it was not valid. Paths beginning with @ must start with a-z.",this.source.spanFor(t.loc));n=f.atName({name:`@${a}`,loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+a.length+1}})})}else{let a=s.shift();if(a===void 0)throw v("Attempted to parse a path expression, but it was not valid. Paths must start with a-z or A-Z.",this.source.spanFor(t.loc));n=f.var({name:a,loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+a.length}})})}return f.path({head:n,tail:s,loc:this.source.spanFor(t.loc)})}Hash(t){let r=t.pairs.map(s=>f.pair({key:s.key,value:this.acceptNode(s.value),loc:this.source.spanFor(s.loc)}));return f.hash({pairs:r,loc:this.source.spanFor(t.loc)})}StringLiteral(t){return f.literal({type:"StringLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}BooleanLiteral(t){return f.literal({type:"BooleanLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}NumberLiteral(t){return f.literal({type:"NumberLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}UndefinedLiteral(t){return f.literal({type:"UndefinedLiteral",value:void 0,loc:this.source.spanFor(t.loc)})}NullLiteral(t){return f.literal({type:"NullLiteral",value:null,loc:this.source.spanFor(t.loc)})}constructor(...t){super(...t),this.pendingError=null}};function fr(e,t){let r;switch(t.path.type){case"PathExpression":r=e.PathExpression(t.path);break;case"SubExpression":r=e.SubExpression(t.path);break;case"StringLiteral":case"UndefinedLiteral":case"NullLiteral":case"NumberLiteral":case"BooleanLiteral":{let i;throw i=t.path.type==="BooleanLiteral"?t.path.original.toString():t.path.type==="StringLiteral"?`"${t.path.original}"`:t.path.type==="NullLiteral"?"null":t.path.type==="NumberLiteral"?t.path.value.toString():"undefined",v(`${t.path.type} "${t.path.type==="StringLiteral"?t.path.original:i}" cannot be called as a sub-expression, replace (${i}) with ${i}`,e.source.spanFor(t.path.loc))}}let s=t.params.map(i=>e.acceptNode(i)),n=ce(s)?Nr(s).loc:r.loc;return{path:r,params:s,hash:t.hash?e.Hash(t.hash):f.hash({pairs:[],loc:e.source.spanFor(n).collapse("end")})}}function mr(e,t){let{path:r,params:s,hash:n,loc:i}=t;if(Rs(r)){let o=`{{${function(c){return c.type==="UndefinedLiteral"?"undefined":JSON.stringify(c.value)}(r)}}}`;throw v(`In <${e.name} ... ${o} ..., ${o} is not a valid modifier`,t.loc)}let a=f.elementModifier({path:r,params:s,hash:n,loc:i});e.modifiers.push(a)}function Ls(e,t,r){if(!t.program.loc){let n=G(!1,t.program.body,0),i=G(!1,t.program.body,-1);if(n&&i)t.program.loc={...n.loc,end:i.loc.end};else{let a=e.spanFor(t.loc);t.program.loc=r.withEnd(a.getEnd())}}let s=e.spanFor(t.program.loc).getEnd();return t.inverse&&!t.inverse.loc&&(t.inverse.loc=s.collapsed()),t}function Ft(e){return/[\t\n\f ]/u.test(e)}var wr=class extends Er{reset(){this.currentNode=null}beginComment(){this.currentNode={type:"CommentStatement",value:"",start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}appendToCommentData(t){this.currentComment.value+=t}finishComment(){Ht(this.currentElement(),f.comment(this.finish(this.currentComment)))}beginData(){this.currentNode={type:"TextNode",chars:"",start:this.offset()}}appendToData(t){this.currentData.chars+=t}finishData(){Ht(this.currentElement(),f.text(this.finish(this.currentData)))}tagOpen(){this.tagOpenLine=this.tokenizer.line,this.tagOpenColumn=this.tokenizer.column}beginStartTag(){this.currentNode={type:"StartTag",name:"",nameStart:null,nameEnd:null,attributes:[],modifiers:[],comments:[],params:[],selfClosing:!1,start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}beginEndTag(){this.currentNode={type:"EndTag",name:"",start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}finishTag(){let t=this.finish(this.currentTag);if(t.type==="StartTag"){if(this.finishStartTag(),t.name===":")throw v("Invalid named block named detected, you may have created a named block without a name, or you may have began your name with a number. Named blocks must have names that are at least one character long, and begin with a lower case letter",this.source.spanFor({start:this.currentTag.start.toJSON(),end:this.offset().toJSON()}));(dr.has(t.name)||t.selfClosing)&&this.finishEndTag(!0)}else t.type,t.type,this.finishEndTag(!1)}finishStartTag(){let{name:t,nameStart:r,nameEnd:s}=this.currentStartTag,n=r.until(s),[i,...a]=t.split("."),o=f.path({head:f.head({original:i,loc:n.sliceStartChars({chars:i.length})}),tail:a,loc:n}),{attributes:c,modifiers:h,comments:p,params:m,selfClosing:S,loc:y}=this.finish(this.currentStartTag),E=f.element({path:o,selfClosing:S,attributes:c,modifiers:h,comments:p,params:m,children:[],openTag:y,closeTag:S?null:D.broken(),loc:y});this.elementStack.push(E)}finishEndTag(t){let{start:r}=this.currentTag,s=this.finish(this.currentTag),n=this.elementStack.pop();this.validateEndTag(s,n,t);let i=this.currentElement();t?n.closeTag=null:n.selfClosing?n.closeTag:n.closeTag=r.until(this.offset()),n.loc=n.loc.withEnd(this.offset()),Ht(i,f.element(n))}markTagAsSelfClosing(){let t=this.currentTag;if(t.type!=="StartTag")throw v("Invalid end tag: closing tag must not be self-closing",this.source.spanFor({start:t.start.toJSON(),end:this.offset().toJSON()}));t.selfClosing=!0}appendToTagName(t){let r=this.currentTag;if(r.name+=t,r.type==="StartTag"){let s=this.offset();r.nameStart===null&&(r.nameEnd,r.nameStart=s.move(-1)),r.nameEnd=s}}beginAttribute(){let t=this.offset();this.currentAttribute={name:"",parts:[],currentPart:null,isQuoted:!1,isDynamic:!1,start:t,valueSpan:t.collapsed()}}appendToAttributeName(t){this.currentAttr.name+=t,this.currentAttr.name==="as"&&this.parsePossibleBlockParams()}beginAttributeValue(t){this.currentAttr.isQuoted=t,this.startTextPart(),this.currentAttr.valueSpan=this.offset().collapsed()}appendToAttributeValue(t){let r=this.currentAttr.parts,s=r[r.length-1],n=this.currentAttr.currentPart;if(n)n.chars+=t,n.loc=n.loc.withEnd(this.offset());else{let i=this.offset();i=t===` +`?s?s.loc.getEnd():this.currentAttr.valueSpan.getStart():i.move(-1),this.currentAttr.currentPart=f.text({chars:t,loc:i.collapsed()})}}finishAttributeValue(){this.finalizeTextPart();let t=this.currentTag,r=this.offset();if(t.type==="EndTag")throw v("Invalid end tag: closing tag must not have attributes",this.source.spanFor({start:t.start.toJSON(),end:r.toJSON()}));let{name:s,parts:n,start:i,isQuoted:a,isDynamic:o,valueSpan:c}=this.currentAttr;if(s.startsWith("|")&&n.length===0&&!a&&!o)throw v("Invalid block parameters syntax: block parameters must be preceded by the `as` keyword",i.until(i.move(s.length)));let h=this.assembleAttributeValue(n,a,o,i.until(r));h.loc=c.withEnd(r);let p=f.attr({name:s,value:h,loc:i.until(r)});this.currentStartTag.attributes.push(p)}parsePossibleBlockParams(){let t=/[!"#%&'()*+./;<=>@[\\\]^`{|}~]/u;this.tokenizer.state;let r=this.currentStartTag,s=this.currentAttr,n={state:"PossibleAs"},i={PossibleAs:o=>{if(n.state,Ft(o))n={state:"BeforeStartPipe"},this.tokenizer.transitionTo("afterAttributeName"),this.tokenizer.consume();else{if(o==="|")throw v('Invalid block parameters syntax: expecting at least one space character between "as" and "|"',s.start.until(this.offset().move(1)));n={state:"Done"}}},BeforeStartPipe:o=>{n.state,Ft(o)?this.tokenizer.consume():o==="|"?(n={state:"BeforeBlockParamName"},this.tokenizer.transitionTo("beforeAttributeName"),this.tokenizer.consume()):n={state:"Done"}},BeforeBlockParamName:o=>{if(n.state,Ft(o))this.tokenizer.consume();else if(o==="")n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: mustaches cannot be used inside parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}};else if(o==="|"){if(r.params.length===0)throw v("Invalid block parameters syntax: empty parameters list, expecting at least one identifier",s.start.until(this.offset().move(1)));n={state:"AfterEndPipe"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw v('Invalid block parameters syntax: incomplete parameters list, expecting "|" but the tag was closed prematurely',s.start.until(this.offset().move(1)));n={state:"BlockParamName",name:o,start:this.offset()},this.tokenizer.consume()}},BlockParamName:o=>{if(n.state,o==="")n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: mustaches cannot be used inside parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}};else if(o==="|"||Ft(o)){let c=n.start.until(this.offset());if(n.name==="this"||t.test(n.name))throw v(`Invalid block parameters syntax: invalid identifier name \`${n.name}\``,c);r.params.push(f.var({name:n.name,loc:c})),n=o==="|"?{state:"AfterEndPipe"}:{state:"BeforeBlockParamName"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw v('Invalid block parameters syntax: expecting "|" but the tag was closed prematurely',s.start.until(this.offset().move(1)));n.name+=o,this.tokenizer.consume()}},AfterEndPipe:o=>{n.state,Ft(o)?this.tokenizer.consume():o===""?(n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: modifiers cannot follow parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}}):o===">"||o==="/"?n={state:"Done"}:(n={state:"Error",message:'Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',start:this.offset()},this.tokenizer.consume())},Error:o=>{if(n.state,o===""||o==="/"||o===">"||Ft(o))throw v(n.message,n.start.until(this.offset()));this.tokenizer.consume()},Done:()=>{}},a;do a=this.tokenizer.peek(),i[n.state](a);while(n.state!=="Done"&&a!=="");n.state}reportSyntaxError(t){throw v(t,this.offset().collapsed())}assembleConcatenatedValue(t){let r=ii(t),s=Nr(t);return f.concat({parts:t,loc:this.source.spanFor(r.loc).extend(this.source.spanFor(s.loc))})}validateEndTag(t,r,s){if(dr.has(t.name)&&!s)throw v(`<${t.name}> elements do not need end tags. You should remove it`,t.loc);if(r.type!=="ElementNode")throw v(`Closing tag without an open tag`,t.loc);if(r.tag!==t.name)throw v(`Closing tag did not match last open tag <${r.tag}> (on line ${r.loc.startPosition.line})`,t.loc)}assembleAttributeValue(t,r,s,n){if(s){if(r)return this.assembleConcatenatedValue(t);{let[i,a]=t;if(a===void 0||a.type==="TextNode"&&a.chars==="/")return i;throw v("An unquoted attribute value must be a string or a mustache, preceded by whitespace or a '=' character, and followed by whitespace, a '>' character, or '/>'",n)}}return ce(t)?t[0]:f.text({chars:"",loc:n})}constructor(...t){super(...t),this.tagOpenLine=0,this.tagOpenColumn=0}},mi={},Tr=class extends lr{constructor(){super({})}parse(){}};function Vs(e,t={}){var c,h,p;let r,s,n,i=t.mode||"precompile";typeof e=="string"?(r=new wt(e,(c=t.meta)==null?void 0:c.moduleName),s=i==="codemod"?Te(e,t.parseOptions):or(e,t.parseOptions)):e instanceof wt?(r=e,s=i==="codemod"?Te(e.source,t.parseOptions):or(e.source,t.parseOptions)):(r=new wt("",(h=t.meta)==null?void 0:h.moduleName),s=e),i==="codemod"&&(n=new Tr);let a=D.forCharPositions(r,0,r.source.length);s.loc={source:"(program)",start:a.startPosition,end:a.endPosition};let o=new wr(r,n,i).parse(s,t.locals??[]);if((p=t.plugins)!=null&&p.ast)for(let m of t.plugins.ast)pi(o,m(tr({},t,{syntax:mi},{plugins:void 0})).visitor);return o}var di={resolution:()=>Ne.GetStrictKeyword,serialize:()=>"Strict",isAngleBracket:!1},go={...di,isAngleBracket:!0};var Le=` +`,Fs="\r",Hs=function(){function e(t){this.length=t.length;for(var r=[0],s=0;sthis.length)return null;for(var r=0,s=this.offsets;s[r+1]<=t;)r++;var n=t-s[r];return{line:r,column:n}},e.prototype.indexForLocation=function(t){var r=t.line,s=t.column;return r<0||r>=this.offsets.length||s<0||s>this.lengthOfLine(r)?null:this.offsets[r]+s},e.prototype.lengthOfLine=function(t){var r=this.offsets[t],s=t===this.offsets.length-1?this.length:this.offsets[t+1];return s-r},e}();function gi(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var Us=gi;function bi(e){let t=e.children??e.body;if(t)for(let r=0;rt.indexForLocation({line:n-1,column:i}),s=n=>{let{start:i,end:a}=n.loc;i.offset=r(i),a.offset=r(a)};return()=>({name:"prettierParsePlugin",visitor:{All(n){s(n),bi(n)}}})}function ki(e){let t;try{t=Vs(e,{mode:"codemod",plugins:{ast:[yi(e)]}})}catch(r){let s=vi(r);if(s){let n=Si(r);throw Us(n,{loc:s,cause:r})}throw r}return t}function Si(e){let{message:t}=e,r=t.split(` +`);return r.length>=4&&/^Parse error on line \d+:$/u.test(r[0])&&/^-*\^$/u.test(G(!1,r,-2))?G(!1,r,-1):r.length>=4&&/:\s?$/u.test(r[0])&&/^\(error occurred in '.*?' @ line \d+ : column \d+\)$/u.test(G(!1,r,-1))&&r[1]===""&&G(!1,r,-2)===""&&r.slice(2,-2).every(s=>s.startsWith("|"))?r[0].trim().slice(0,-1):t}function vi(e){let{location:t,hash:r}=e;if(t){let{start:s,end:n}=t;return typeof n.line!="number"?{start:s}:t}if(r){let{loc:{last_line:s,last_column:n}}=r;return{start:{line:s,column:n+1}}}}var Ei={parse:ki,astFormat:"glimmer",locStart:St,locEnd:re};var wi={glimmer:hs};var Do=Pr;export{Do as default,ps as languages,xr as parsers,wi as printers}; diff --git a/node_modules/prettier/plugins/graphql.js b/node_modules/prettier/plugins/graphql.js new file mode 100644 index 0000000..009841b --- /dev/null +++ b/node_modules/prettier/plugins/graphql.js @@ -0,0 +1,29 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.graphql=e()}})(function(){"use strict";var ce=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var dt=Object.prototype.hasOwnProperty;var ye=(e,t)=>{for(var n in t)ce(e,n,{get:t[n],enumerable:!0})},mt=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ht(t))!dt.call(e,r)&&r!==n&&ce(e,r,{get:()=>t[r],enumerable:!(i=ft(t,r))||i.enumerable});return e};var Et=e=>mt(ce({},"__esModule",{value:!0}),e);var fn={};ye(fn,{languages:()=>Je,options:()=>qe,parsers:()=>_e,printers:()=>pn});var Tt=(e,t,n,i)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,i):n.global?t.replace(n,i):t.split(n).join(i)},j=Tt;var G="indent";var $="group";var F="if-break";var C="line";var J="break-parent";var ve=()=>{},L=ve,pe=ve;function _(e){return L(e),{type:G,contents:e}}function x(e,t={}){return L(e),pe(t.expandedStates,!0),{type:$,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function I(e,t="",n={}){return L(e),t!==""&&L(t),{type:F,breakContents:e,flatContents:t,groupId:n.groupId}}var xt={type:J};var Ot={type:C,hard:!0};var k={type:C},p={type:C,soft:!0},f=[Ot,xt];function E(e,t){L(e),pe(t);let n=[];for(let i=0;i{let r=!!(i!=null&&i.backwards);if(n===!1)return!1;let{length:s}=t,a=n;for(;a>=0&&a0}var fe=Ct;var he=class extends Error{name="UnexpectedNodeError";constructor(t,n,i="type"){super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`),this.node=t}},Be=he;var w=null;function B(e){if(w!==null&&typeof w.property){let t=w;return w=B.prototype=null,t}return w=B.prototype=e??Object.create(null),new B}var St=10;for(let e=0;e<=St;e++)B();function de(e){return B(e)}function vt(e,t="type"){de(e);function n(i){let r=i[t],s=e[r];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:i});return s}return n}var Ue=vt;var H=class{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},U=class{constructor(t,n,i,r,s,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},W={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},hr=new Set(Object.keys(W));var S;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(S||(S={}));var bt=Ue(W,"kind"),Ve=bt;function K(e){return e.loc.start}function z(e){return e.loc.end}function Ye(e){return/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u.test(e)}function Me(e){return`# @format + +`+e}function Lt(e,t,n){let{node:i}=e;if(!i.description)return"";let r=[n("description")];return i.kind==="InputValueDefinition"&&!i.description.block?r.push(k):r.push(f),r}var g=Lt;function Rt(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...E(f,A(e,t,n,"definitions")),f];case"OperationDefinition":{let r=t.originalText[K(i)]!=="{",s=!!i.name;return[r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&fe(i.variableDefinitions)?" ":"",je(e,n),y(e,n,i),!r&&!s?"":" ",n("selectionSet")]}case"FragmentDefinition":return["fragment ",n("name"),je(e,n)," on ",n("typeCondition"),y(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",_([f,E(f,A(e,t,n,"selections"))]),f,"}"];case"Field":return x([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?x(["(",_([p,E([I("",", "),p],A(e,t,n,"arguments"))]),p,")"]):"",y(e,n,i),i.selectionSet?" ":"",n("selectionSet")]);case"Name":return i.value;case"StringValue":if(i.block){let r=j(!1,i.value,'"""',String.raw`\"""`).split(` +`);return r.length===1&&(r[0]=r[0].trim()),r.every(s=>s==="")&&(r.length=0),E(f,['"""',...r,'"""'])}return['"',j(!1,j(!1,i.value,/["\\]/gu,String.raw`\$&`),` +`,String.raw`\n`),'"'];case"IntValue":case"FloatValue":case"EnumValue":return i.value;case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return x(["[",_([p,E([I("",", "),p],e.map(n,"values"))]),p,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return x(["{",r,_([p,E([I("",", "),p],e.map(n,"fields"))]),p,I("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?x(["(",_([p,E([I("",", "),p],A(e,t,n,"arguments"))]),p,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",y(e,n,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=i,s=[];return r.endsWith("TypeDefinition")?s.push(g(e,t,n)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!r.startsWith("InputObjectType")&&i.interfaces.length>0&&s.push(" implements ",...wt(e,t,n)),s.push(y(e,n,i)),i.fields.length>0&&s.push([" {",_([f,E(f,A(e,t,n,"fields"))]),f,"}"]),s}case"FieldDefinition":return[g(e,t,n),n("name"),i.arguments.length>0?x(["(",_([p,E([I("",", "),p],A(e,t,n,"arguments"))]),p,")"]):"",": ",n("type"),y(e,n,i)];case"DirectiveDefinition":return[g(e,t,n),"directive ","@",n("name"),i.arguments.length>0?x(["(",_([p,E([I("",", "),p],A(e,t,n,"arguments"))]),p,")"]):"",i.repeatable?" repeatable":""," on ",...E(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[g(e,t,n),i.kind==="EnumTypeExtension"?"extend ":"","enum ",n("name"),y(e,n,i),i.values.length>0?[" {",_([f,E(f,A(e,t,n,"values"))]),f,"}"]:""];case"EnumValueDefinition":return[g(e,t,n),n("name"),y(e,n,i)];case"InputValueDefinition":return[g(e,t,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",y(e,n,i)];case"SchemaExtension":return["extend schema",y(e,n,i),...i.operationTypes.length>0?[" {",_([f,E(f,A(e,t,n,"operationTypes"))]),f,"}"]:[]];case"SchemaDefinition":return[g(e,t,n),"schema",y(e,n,i)," {",i.operationTypes.length>0?_([f,E(f,A(e,t,n,"operationTypes"))]):"",f,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),y(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",y(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return x([g(e,t,n),x([i.kind==="UnionTypeExtension"?"extend ":"","union ",n("name"),y(e,n,i),i.types.length>0?[" =",I(""," "),_([I([k,"| "]),E([k,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[g(e,t,n),i.kind==="ScalarTypeExtension"?"extend ":"","scalar ",n("name"),y(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new Be(i,"Graphql","kind")}}function y(e,t,n){if(n.directives.length===0)return"";let i=E(k,e.map(t,"directives"));return n.kind==="FragmentDefinition"||n.kind==="OperationDefinition"?x([k,i]):[" ",x(_([p,i]))]}function A(e,t,n,i){return e.map(({isLast:r,node:s})=>{let a=n();return!r&&we(t.originalText,z(s))?[a,f]:a},i)}function Pt(e){return e.kind!=="Comment"}function Ft(e){let t=e.node;if(t.kind==="Comment")return"#"+t.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(t))}function wt(e,t,n){let{node:i}=e,r=[],{interfaces:s}=i,a=e.map(n,"interfaces");for(let u=0;ui.value.trim()==="prettier-ignore")}var Ut={print:Rt,massageAstNode:Ge,hasPrettierIgnore:Bt,insertPragma:Me,printComment:Ft,canAttachComment:Pt,getVisitorKeys:Ve},$e=Ut;var Je=[{linguistLanguageId:139,name:"GraphQL",type:"data",color:"#e10098",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",aceMode:"text",parsers:["graphql"],vscodeLanguageIds:["graphql"]}];var Xe={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var Vt={bracketSpacing:Xe.bracketSpacing},qe=Vt;var _e={};ye(_e,{graphql:()=>ln});function Qe(e){return typeof e=="object"&&e!==null}function He(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}var Yt=/\r\n|[\n\r]/g;function V(e,t){let n=0,i=1;for(let r of e.body.matchAll(Yt)){if(typeof r.index=="number"||He(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Ke(e){return me(e.source,V(e.source,e.start))}function me(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,u=t.line===1?n:0,l=t.column+u,T=`${e.name}:${a}:${l} +`,h=i.split(/\r\n|[\n\r]/g),D=h[r];if(D.length>120){let O=Math.floor(l/80),ae=l%80,N=[];for(let b=0;b["|",b]),["|","^".padStart(ae)],["|",N[O+1]]])}return T+We([[`${a-1} |`,h[r-1]],[`${a} |`,D],["|","^".padStart(l)],[`${a+1} |`,h[r+1]]])}function We(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(` +`)}function Mt(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var Z=class e extends Error{constructor(t,...n){var i,r,s;let{nodes:a,source:u,positions:l,path:T,originalError:h,extensions:D}=Mt(n);super(t),this.name="GraphQLError",this.path=T??void 0,this.originalError=h??void 0,this.nodes=ze(Array.isArray(a)?a:a?[a]:void 0);let O=ze((i=this.nodes)===null||i===void 0?void 0:i.map(N=>N.loc).filter(N=>N!=null));this.source=u??(O==null||(r=O[0])===null||r===void 0?void 0:r.source),this.positions=l??(O==null?void 0:O.map(N=>N.start)),this.locations=l&&u?l.map(N=>V(u,N)):O==null?void 0:O.map(N=>V(N.source,N.start));let ae=Qe(h==null?void 0:h.extensions)?h==null?void 0:h.extensions:void 0;this.extensions=(s=D??ae)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),h!=null&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` + +`+Ke(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` + +`+me(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function ze(e){return e===void 0||e.length===0?void 0:e}function d(e,t,n){return new Z(`Syntax Error: ${n}`,{source:e,positions:[t]})}var ee;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(ee||(ee={}));var c;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(c||(c={}));function Ze(e){return e===9||e===32}function R(e){return e>=48&&e<=57}function et(e){return e>=97&&e<=122||e>=65&&e<=90}function Ee(e){return et(e)||e===95}function tt(e){return et(e)||R(e)||e===95}function nt(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;au===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function jt(e){let t=0;for(;t=0&&e<=55295||e>=57344&&e<=1114111}function ne(e,t){return st(e.charCodeAt(t))&&ot(e.charCodeAt(t+1))}function st(e){return e>=55296&&e<=56319}function ot(e){return e>=56320&&e<=57343}function v(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return o.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function m(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new U(t,n,i,s,a,r)}function Gt(e,t){let n=e.source.body,i=n.length,r=t;for(;r=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Ht(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw d(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Wt(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,a=s,u="",l=[];for(;s2?"["+nn(e)+"]":"{ "+n.map(([r,s])=>r+": "+se(s,t)).join(", ")+" }"}function tn(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let s=0;s1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function nn(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var rn=globalThis.process&&!0,at=rn?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){let a=ie(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`)}}return!1};var M=class{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||re(!1,`Body must be a string. Received: ${ie(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||re(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||re(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ct(e){return at(e,M)}function ut(e,t){let n=new Ne(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}var Ne=class{constructor(t,n={}){let i=ct(t)?t:new M(t);this._lexer=new te(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(o.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(o.SOF,this.parseDefinition,o.EOF)})}parseDefinition(){if(this.peek(o.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===o.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw d(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(o.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:S.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(o.NAME)&&(i=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(o.NAME);switch(t.value){case"query":return S.QUERY;case"mutation":return S.MUTATION;case"subscription":return S.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(o.PAREN_L,this.parseVariableDefinition,o.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(o.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(o.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(o.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(o.BRACE_L,this.parseSelection,o.BRACE_R)})}parseSelection(){return this.peek(o.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(o.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:c.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(o.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(o.PAREN_L,n,o.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(o.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(o.NAME)?this.node(t,{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:c.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case o.BRACKET_L:return this.parseList(t);case o.BRACE_L:return this.parseObject(t);case o.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case o.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case o.STRING:case o.BLOCK_STRING:return this.parseStringLiteral();case o.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:c.BOOLEAN,value:!0});case"false":return this.node(n,{kind:c.BOOLEAN,value:!1});case"null":return this.node(n,{kind:c.NULL});default:return this.node(n,{kind:c.ENUM,value:n.value})}case o.DOLLAR:if(t)if(this.expectToken(o.DOLLAR),this._lexer.token.kind===o.NAME){let i=this._lexer.token.value;throw d(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===o.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(o.BRACKET_L,n,o.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(o.BRACE_L,n,o.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(o.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(o.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(o.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(o.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(o.BANG)?this.node(t,{kind:c.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:c.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(o.STRING)||this.peek(o.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(o.BRACE_L,this.parseOperationTypeDefinition,o.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(o.COLON);let i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(o.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseFieldDefinition,o.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(o.COLON);let s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(o.PAREN_L,this.parseInputValueDef,o.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(o.COLON);let r=this.parseTypeReference(),s;this.expectOptionalToken(o.EQUALS)&&(s=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(o.EQUALS)?this.delimitedMany(o.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(o.BRACE_L,this.parseEnumValueDefinition,o.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw d(this._lexer.source,this._lexer.token.start,`${oe(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseInputValueDef,o.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===o.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(o.BRACE_L,this.parseOperationTypeDefinition,o.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(o.AT);let i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(o.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(ee,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new H(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw d(this._lexer.source,n.start,`Expected ${lt(t)}, found ${oe(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===o.NAME&&n.value===t)this.advanceLexer();else throw d(this._lexer.source,n.start,`Expected "${t}", found ${oe(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===o.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return d(this._lexer.source,n.start,`Unexpected ${oe(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==o.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw d(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function oe(e){let t=e.value;return lt(e.kind)+(t!=null?` "${t}"`:"")}function lt(e){return it(e)?`"${e}"`:e}function sn(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}var pt=sn;function on(e){let t=[],{startToken:n,endToken:i}=e.loc;for(let r=n;r!==i;r=r.next)r.kind==="Comment"&&t.push({...r,loc:{start:r.start,end:r.end}});return t}var an={allowLegacyFragmentVariables:!0};function cn(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[n]}=e;return pt(t,{loc:{start:n},cause:e})}return e}function un(e){let t;try{t=ut(e,an)}catch(n){throw cn(n)}return t.comments=on(t),t}var ln={parse:un,astFormat:"graphql",hasPragma:Ye,locStart:K,locEnd:z};var pn={graphql:$e};return Et(fn);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/graphql.mjs b/node_modules/prettier/plugins/graphql.mjs new file mode 100644 index 0000000..de7c936 --- /dev/null +++ b/node_modules/prettier/plugins/graphql.mjs @@ -0,0 +1,29 @@ +var ft=Object.defineProperty;var ye=(e,t)=>{for(var n in t)ft(e,n,{get:t[n],enumerable:!0})};var _e={};ye(_e,{languages:()=>Je,options:()=>qe,parsers:()=>Ne,printers:()=>an});var ht=(e,t,n,i)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,i):n.global?t.replace(n,i):t.split(n).join(i)},j=ht;var G="indent";var $="group";var F="if-break";var C="line";var J="break-parent";var ve=()=>{},L=ve,le=ve;function _(e){return L(e),{type:G,contents:e}}function x(e,t={}){return L(e),le(t.expandedStates,!0),{type:$,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function I(e,t="",n={}){return L(e),t!==""&&L(t),{type:F,breakContents:e,flatContents:t,groupId:n.groupId}}var Tt={type:J};var Nt={type:C,hard:!0};var k={type:C},p={type:C,soft:!0},f=[Nt,Tt];function E(e,t){L(e),le(t);let n=[];for(let i=0;i{let r=!!(i!=null&&i.backwards);if(n===!1)return!1;let{length:s}=t,a=n;for(;a>=0&&a0}var pe=Dt;var fe=class extends Error{name="UnexpectedNodeError";constructor(t,n,i="type"){super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`),this.node=t}},Be=fe;var w=null;function B(e){if(w!==null&&typeof w.property){let t=w;return w=B.prototype=null,t}return w=B.prototype=e??Object.create(null),new B}var gt=10;for(let e=0;e<=gt;e++)B();function he(e){return B(e)}function At(e,t="type"){he(e);function n(i){let r=i[t],s=e[r];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:i});return s}return n}var Ue=At;var H=class{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},U=class{constructor(t,n,i,r,s,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},W={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},cr=new Set(Object.keys(W));var S;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(S||(S={}));var kt=Ue(W,"kind"),Ve=kt;function K(e){return e.loc.start}function z(e){return e.loc.end}function Ye(e){return/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u.test(e)}function Me(e){return`# @format + +`+e}function Ct(e,t,n){let{node:i}=e;if(!i.description)return"";let r=[n("description")];return i.kind==="InputValueDefinition"&&!i.description.block?r.push(k):r.push(f),r}var g=Ct;function St(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...E(f,A(e,t,n,"definitions")),f];case"OperationDefinition":{let r=t.originalText[K(i)]!=="{",s=!!i.name;return[r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&pe(i.variableDefinitions)?" ":"",je(e,n),y(e,n,i),!r&&!s?"":" ",n("selectionSet")]}case"FragmentDefinition":return["fragment ",n("name"),je(e,n)," on ",n("typeCondition"),y(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",_([f,E(f,A(e,t,n,"selections"))]),f,"}"];case"Field":return x([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?x(["(",_([p,E([I("",", "),p],A(e,t,n,"arguments"))]),p,")"]):"",y(e,n,i),i.selectionSet?" ":"",n("selectionSet")]);case"Name":return i.value;case"StringValue":if(i.block){let r=j(!1,i.value,'"""',String.raw`\"""`).split(` +`);return r.length===1&&(r[0]=r[0].trim()),r.every(s=>s==="")&&(r.length=0),E(f,['"""',...r,'"""'])}return['"',j(!1,j(!1,i.value,/["\\]/gu,String.raw`\$&`),` +`,String.raw`\n`),'"'];case"IntValue":case"FloatValue":case"EnumValue":return i.value;case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return x(["[",_([p,E([I("",", "),p],e.map(n,"values"))]),p,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return x(["{",r,_([p,E([I("",", "),p],e.map(n,"fields"))]),p,I("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?x(["(",_([p,E([I("",", "),p],A(e,t,n,"arguments"))]),p,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",y(e,n,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=i,s=[];return r.endsWith("TypeDefinition")?s.push(g(e,t,n)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!r.startsWith("InputObjectType")&&i.interfaces.length>0&&s.push(" implements ",...Lt(e,t,n)),s.push(y(e,n,i)),i.fields.length>0&&s.push([" {",_([f,E(f,A(e,t,n,"fields"))]),f,"}"]),s}case"FieldDefinition":return[g(e,t,n),n("name"),i.arguments.length>0?x(["(",_([p,E([I("",", "),p],A(e,t,n,"arguments"))]),p,")"]):"",": ",n("type"),y(e,n,i)];case"DirectiveDefinition":return[g(e,t,n),"directive ","@",n("name"),i.arguments.length>0?x(["(",_([p,E([I("",", "),p],A(e,t,n,"arguments"))]),p,")"]):"",i.repeatable?" repeatable":""," on ",...E(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[g(e,t,n),i.kind==="EnumTypeExtension"?"extend ":"","enum ",n("name"),y(e,n,i),i.values.length>0?[" {",_([f,E(f,A(e,t,n,"values"))]),f,"}"]:""];case"EnumValueDefinition":return[g(e,t,n),n("name"),y(e,n,i)];case"InputValueDefinition":return[g(e,t,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",y(e,n,i)];case"SchemaExtension":return["extend schema",y(e,n,i),...i.operationTypes.length>0?[" {",_([f,E(f,A(e,t,n,"operationTypes"))]),f,"}"]:[]];case"SchemaDefinition":return[g(e,t,n),"schema",y(e,n,i)," {",i.operationTypes.length>0?_([f,E(f,A(e,t,n,"operationTypes"))]):"",f,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),y(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",y(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return x([g(e,t,n),x([i.kind==="UnionTypeExtension"?"extend ":"","union ",n("name"),y(e,n,i),i.types.length>0?[" =",I(""," "),_([I([k,"| "]),E([k,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[g(e,t,n),i.kind==="ScalarTypeExtension"?"extend ":"","scalar ",n("name"),y(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new Be(i,"Graphql","kind")}}function y(e,t,n){if(n.directives.length===0)return"";let i=E(k,e.map(t,"directives"));return n.kind==="FragmentDefinition"||n.kind==="OperationDefinition"?x([k,i]):[" ",x(_([p,i]))]}function A(e,t,n,i){return e.map(({isLast:r,node:s})=>{let a=n();return!r&&we(t.originalText,z(s))?[a,f]:a},i)}function vt(e){return e.kind!=="Comment"}function bt(e){let t=e.node;if(t.kind==="Comment")return"#"+t.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(t))}function Lt(e,t,n){let{node:i}=e,r=[],{interfaces:s}=i,a=e.map(n,"interfaces");for(let u=0;ui.value.trim()==="prettier-ignore")}var Pt={print:St,massageAstNode:Ge,hasPrettierIgnore:Rt,insertPragma:Me,printComment:bt,canAttachComment:vt,getVisitorKeys:Ve},$e=Pt;var Je=[{linguistLanguageId:139,name:"GraphQL",type:"data",color:"#e10098",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",aceMode:"text",parsers:["graphql"],vscodeLanguageIds:["graphql"]}];var Xe={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var Ft={bracketSpacing:Xe.bracketSpacing},qe=Ft;var Ne={};ye(Ne,{graphql:()=>on});function Qe(e){return typeof e=="object"&&e!==null}function He(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}var wt=/\r\n|[\n\r]/g;function V(e,t){let n=0,i=1;for(let r of e.body.matchAll(wt)){if(typeof r.index=="number"||He(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Ke(e){return de(e.source,V(e.source,e.start))}function de(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,u=t.line===1?n:0,l=t.column+u,T=`${e.name}:${a}:${l} +`,h=i.split(/\r\n|[\n\r]/g),D=h[r];if(D.length>120){let O=Math.floor(l/80),ae=l%80,N=[];for(let b=0;b["|",b]),["|","^".padStart(ae)],["|",N[O+1]]])}return T+We([[`${a-1} |`,h[r-1]],[`${a} |`,D],["|","^".padStart(l)],[`${a+1} |`,h[r+1]]])}function We(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(` +`)}function Bt(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var Z=class e extends Error{constructor(t,...n){var i,r,s;let{nodes:a,source:u,positions:l,path:T,originalError:h,extensions:D}=Bt(n);super(t),this.name="GraphQLError",this.path=T??void 0,this.originalError=h??void 0,this.nodes=ze(Array.isArray(a)?a:a?[a]:void 0);let O=ze((i=this.nodes)===null||i===void 0?void 0:i.map(N=>N.loc).filter(N=>N!=null));this.source=u??(O==null||(r=O[0])===null||r===void 0?void 0:r.source),this.positions=l??(O==null?void 0:O.map(N=>N.start)),this.locations=l&&u?l.map(N=>V(u,N)):O==null?void 0:O.map(N=>V(N.source,N.start));let ae=Qe(h==null?void 0:h.extensions)?h==null?void 0:h.extensions:void 0;this.extensions=(s=D??ae)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),h!=null&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` + +`+Ke(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` + +`+de(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function ze(e){return e===void 0||e.length===0?void 0:e}function d(e,t,n){return new Z(`Syntax Error: ${n}`,{source:e,positions:[t]})}var ee;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(ee||(ee={}));var c;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(c||(c={}));function Ze(e){return e===9||e===32}function R(e){return e>=48&&e<=57}function et(e){return e>=97&&e<=122||e>=65&&e<=90}function me(e){return et(e)||e===95}function tt(e){return et(e)||R(e)||e===95}function nt(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;au===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function Ut(e){let t=0;for(;t=0&&e<=55295||e>=57344&&e<=1114111}function ne(e,t){return st(e.charCodeAt(t))&&ot(e.charCodeAt(t+1))}function st(e){return e>=55296&&e<=56319}function ot(e){return e>=56320&&e<=57343}function v(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return o.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function m(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new U(t,n,i,s,a,r)}function Vt(e,t){let n=e.source.body,i=n.length,r=t;for(;r=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Jt(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw d(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Xt(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,a=s,u="",l=[];for(;s2?"["+zt(e)+"]":"{ "+n.map(([r,s])=>r+": "+se(s,t)).join(", ")+" }"}function Kt(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let s=0;s1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function zt(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var Zt=globalThis.process&&!0,at=Zt?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){let a=ie(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`)}}return!1};var M=class{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||re(!1,`Body must be a string. Received: ${ie(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||re(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||re(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ct(e){return at(e,M)}function ut(e,t){let n=new Te(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}var Te=class{constructor(t,n={}){let i=ct(t)?t:new M(t);this._lexer=new te(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(o.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(o.SOF,this.parseDefinition,o.EOF)})}parseDefinition(){if(this.peek(o.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===o.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw d(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(o.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:S.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(o.NAME)&&(i=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(o.NAME);switch(t.value){case"query":return S.QUERY;case"mutation":return S.MUTATION;case"subscription":return S.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(o.PAREN_L,this.parseVariableDefinition,o.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(o.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(o.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(o.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(o.BRACE_L,this.parseSelection,o.BRACE_R)})}parseSelection(){return this.peek(o.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(o.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:c.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(o.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(o.PAREN_L,n,o.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(o.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(o.NAME)?this.node(t,{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:c.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case o.BRACKET_L:return this.parseList(t);case o.BRACE_L:return this.parseObject(t);case o.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case o.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case o.STRING:case o.BLOCK_STRING:return this.parseStringLiteral();case o.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:c.BOOLEAN,value:!0});case"false":return this.node(n,{kind:c.BOOLEAN,value:!1});case"null":return this.node(n,{kind:c.NULL});default:return this.node(n,{kind:c.ENUM,value:n.value})}case o.DOLLAR:if(t)if(this.expectToken(o.DOLLAR),this._lexer.token.kind===o.NAME){let i=this._lexer.token.value;throw d(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===o.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(o.BRACKET_L,n,o.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(o.BRACE_L,n,o.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(o.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(o.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(o.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(o.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(o.BANG)?this.node(t,{kind:c.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:c.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(o.STRING)||this.peek(o.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(o.BRACE_L,this.parseOperationTypeDefinition,o.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(o.COLON);let i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(o.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseFieldDefinition,o.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(o.COLON);let s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(o.PAREN_L,this.parseInputValueDef,o.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(o.COLON);let r=this.parseTypeReference(),s;this.expectOptionalToken(o.EQUALS)&&(s=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(o.EQUALS)?this.delimitedMany(o.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(o.BRACE_L,this.parseEnumValueDefinition,o.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw d(this._lexer.source,this._lexer.token.start,`${oe(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseInputValueDef,o.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===o.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(o.BRACE_L,this.parseOperationTypeDefinition,o.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(o.AT);let i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(o.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(ee,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new H(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw d(this._lexer.source,n.start,`Expected ${lt(t)}, found ${oe(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===o.NAME&&n.value===t)this.advanceLexer();else throw d(this._lexer.source,n.start,`Expected "${t}", found ${oe(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===o.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return d(this._lexer.source,n.start,`Unexpected ${oe(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==o.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw d(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function oe(e){let t=e.value;return lt(e.kind)+(t!=null?` "${t}"`:"")}function lt(e){return it(e)?`"${e}"`:e}function en(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}var pt=en;function tn(e){let t=[],{startToken:n,endToken:i}=e.loc;for(let r=n;r!==i;r=r.next)r.kind==="Comment"&&t.push({...r,loc:{start:r.start,end:r.end}});return t}var nn={allowLegacyFragmentVariables:!0};function rn(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[n]}=e;return pt(t,{loc:{start:n},cause:e})}return e}function sn(e){let t;try{t=ut(e,nn)}catch(n){throw rn(n)}return t.comments=tn(t),t}var on={parse:sn,astFormat:"graphql",hasPragma:Ye,locStart:K,locEnd:z};var an={graphql:$e};var Si=_e;export{Si as default,Je as languages,qe as options,Ne as parsers,an as printers}; diff --git a/node_modules/prettier/plugins/html.js b/node_modules/prettier/plugins/html.js new file mode 100644 index 0000000..8ad95f3 --- /dev/null +++ b/node_modules/prettier/plugins/html.js @@ -0,0 +1,22 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.html=e()}})(function(){"use strict";var Et=Object.defineProperty;var ui=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var ci=Object.prototype.hasOwnProperty;var sn=t=>{throw TypeError(t)};var pi=(t,e,r)=>e in t?Et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var an=(t,e)=>{for(var r in e)Et(t,r,{get:e[r],enumerable:!0})},hi=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of li(e))!ci.call(t,s)&&s!==r&&Et(t,s,{get:()=>e[s],enumerable:!(n=ui(e,s))||n.enumerable});return t};var fi=t=>hi(Et({},"__esModule",{value:!0}),t);var cr=(t,e,r)=>pi(t,typeof e!="symbol"?e+"":e,r),on=(t,e,r)=>e.has(t)||sn("Cannot "+r);var R=(t,e,r)=>(on(t,e,"read from private field"),r?r.call(t):e.get(t)),At=(t,e,r)=>e.has(t)?sn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),un=(t,e,r,n)=>(on(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var jo={};an(jo,{languages:()=>Ts,options:()=>ks,parsers:()=>en,printers:()=>Yo});var mi=(t,e,r,n)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},w=mi;var ye="string",Ge="array",Ye="cursor",we="indent",be="align",je="trim",Te="group",xe="fill",ce="if-break",ke="indent-if-break",Ke="line-suffix",Qe="line-suffix-boundary",j="line",Xe="label",Be="break-parent",Dt=new Set([Ye,we,be,je,Te,xe,ce,ke,Ke,Qe,j,Xe,Be]);var di=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},K=di;function gi(t){if(typeof t=="string")return ye;if(Array.isArray(t))return Ge;if(!t)return;let{type:e}=t;if(Dt.has(e))return e}var Le=gi;var Ci=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Si(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', +Expected it to be 'string' or 'object'.`;if(Le(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Ci([...Dt].map(s=>`'${s}'`));return`Unexpected doc.type '${t.type}'. +Expected it to be ${n}.`}var pr=class extends Error{name="InvalidDocError";constructor(e){super(Si(e)),this.doc=e}},hr=pr;function fr(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(i){if(r.has(i))return r.get(i);let a=s(i);return r.set(i,a),a}function s(i){switch(Le(i)){case Ge:return e(i.map(n));case xe:return e({...i,parts:i.parts.map(n)});case ce:return e({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case Te:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(n),o=a[0]):o=n(o),e({...i,contents:o,expandedStates:a})}case be:case we:case ke:case Xe:case Ke:return e({...i,contents:n(i.contents)});case ye:case Ye:case je:case Qe:case j:case Be:return e(i);default:throw new hr(i)}}}function B(t,e=ln){return fr(t,r=>typeof r=="string"?H(e,r.split(` +`)):r)}var mr=()=>{},ne=mr,dr=mr,cn=mr;function k(t){return ne(t),{type:we,contents:t}}function pn(t,e){return ne(e),{type:be,contents:e,n:t}}function E(t,e={}){return ne(t),dr(e.expandedStates,!0),{type:Te,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function hn(t){return pn(Number.NEGATIVE_INFINITY,t)}function fn(t){return pn({type:"root"},t)}function vt(t){return cn(t),{type:xe,parts:t}}function pe(t,e="",r={}){return ne(t),e!==""&&ne(e),{type:ce,breakContents:t,flatContents:e,groupId:r.groupId}}function mn(t,e){return ne(t),{type:ke,contents:t,groupId:e.groupId,negate:e.negate}}var se={type:Be};var Ei={type:j,hard:!0},Ai={type:j,hard:!0,literal:!0},_={type:j},v={type:j,soft:!0},S=[Ei,se],ln=[Ai,se];function H(t,e){ne(t),dr(e);let r=[];for(let n=0;ni?n:r}var gn=Di;function gr(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var V,Cr=class{constructor(e){At(this,V);un(this,V,new Set(e))}getLeadingWhitespaceCount(e){let r=R(this,V),n=0;for(let s=0;s=0&&r.has(e.charAt(s));s--)n++;return n}getLeadingWhitespace(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(0,r)}getTrailingWhitespace(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(e.length-r)}hasLeadingWhitespace(e){return R(this,V).has(e.charAt(0))}hasTrailingWhitespace(e){return R(this,V).has(K(!1,e,-1))}trimStart(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(r)}trimEnd(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-r)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,r=!1){let n=`[${gr([...R(this,V)].join(""))}]+`,s=new RegExp(r?`(${n})`:n,"u");return e.split(s)}hasWhitespaceCharacter(e){let r=R(this,V);return Array.prototype.some.call(e,n=>r.has(n))}hasNonWhitespaceCharacter(e){let r=R(this,V);return Array.prototype.some.call(e,n=>!r.has(n))}isWhitespaceOnly(e){let r=R(this,V);return Array.prototype.every.call(e,n=>r.has(n))}};V=new WeakMap;var Cn=Cr;var vi=[" ",` +`,"\f","\r"," "],yi=new Cn(vi),O=yi;var Sr=class extends Error{name="UnexpectedNodeError";constructor(e,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},Sn=Sr;function wi(t){return(t==null?void 0:t.type)==="front-matter"}var Fe=wi;var bi=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens","switchValueSourceSpan","expSourceSpan","valueSourceSpan"]),Ti=new Set(["if","else if","for","switch","case"]);function _n(t,e){var r;if(t.type==="text"||t.type==="comment"||Fe(t)||t.type==="yaml"||t.type==="toml")return null;if(t.type==="attribute"&&delete e.value,t.type==="docType"&&delete e.value,t.type==="angularControlFlowBlock"&&((r=t.parameters)!=null&&r.children))for(let n of e.parameters.children)Ti.has(t.name)?delete n.expression:n.expression=n.expression.trim();t.type==="angularIcuExpression"&&(e.switchValue=t.switchValue.trim()),t.type==="angularLetDeclarationInitializer"&&delete e.value}_n.ignoredProperties=bi;var En=_n;async function xi(t,e){if(t.language==="yaml"){let r=t.value.trim(),n=r?await e(r,{parser:"yaml"}):"";return fn([t.startDelimiter,t.explicitLanguage,S,n,n?S:"",t.endDelimiter])}}var An=xi;function he(t,e=!0){return[k([v,t]),e?v:""]}function Q(t,e){let r=t.type==="NGRoot"?t.node.type==="NGMicrosyntax"&&t.node.body.length===1&&t.node.body[0].type==="NGMicrosyntaxExpression"?t.node.body[0].expression:t.node:t.type==="JsExpressionRoot"?t.node:t;return r&&(r.type==="ObjectExpression"||r.type==="ArrayExpression"||(e.parser==="__vue_expression"||e.parser==="__vue_ts_expression")&&(r.type==="TemplateLiteral"||r.type==="StringLiteral"))}async function T(t,e,r,n){r={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...r};let s=!0;n&&(r.__onHtmlBindingRoot=(a,o)=>{s=n(a,o)});let i=await e(t,r,e);return s?E(i):he(i)}function ki(t,e,r,n){let{node:s}=r,i=n.originalText.slice(s.sourceSpan.start.offset,s.sourceSpan.end.offset);return/^\s*$/u.test(i)?"":T(i,t,{parser:"__ng_directive",__isInHtmlAttribute:!1},Q)}var Dn=ki;var Bi=t=>String(t).split(/[/\\]/u).pop();function vn(t,e){if(!e)return;let r=Bi(e).toLowerCase();return t.find(({filenames:n})=>n==null?void 0:n.some(s=>s.toLowerCase()===r))??t.find(({extensions:n})=>n==null?void 0:n.some(s=>r.endsWith(s)))}function Li(t,e){if(e)return t.find(({name:r})=>r.toLowerCase()===e)??t.find(({aliases:r})=>r==null?void 0:r.includes(e))??t.find(({extensions:r})=>r==null?void 0:r.includes(`.${e}`))}function Fi(t,e){let r=t.plugins.flatMap(s=>s.languages??[]),n=Li(r,e.language)??vn(r,e.physicalFile)??vn(r,e.file)??(e.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var Ne=Fi;var yn="inline",wn={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",search:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",menu:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",input:"inline-block",button:"inline-block",fieldset:"block",details:"block",summary:"block",marquee:"inline-block",source:"block",track:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",select:"inline-block",option:"block",optgroup:"block"},bn="normal",Tn={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function Ni(t){return t.type==="element"&&!t.hasExplicitNamespace&&!["html","svg"].includes(t.namespace)}var fe=Ni;var Pi=t=>w(!1,t,/^[\t\f\r ]*\n/gu,""),_r=t=>Pi(O.trimEnd(t)),xn=t=>{let e=t,r=O.getLeadingWhitespace(e);r&&(e=e.slice(r.length));let n=O.getTrailingWhitespace(e);return n&&(e=e.slice(0,-n.length)),{leadingWhitespace:r,trailingWhitespace:n,text:e}};function wt(t,e){return!!(t.type==="ieConditionalComment"&&t.lastChild&&!t.lastChild.isSelfClosing&&!t.lastChild.endSourceSpan||t.type==="ieConditionalComment"&&!t.complete||me(t)&&t.children.some(r=>r.type!=="text"&&r.type!=="interpolation")||xt(t,e)&&!W(t)&&t.type!=="interpolation")}function de(t){return t.type==="attribute"||!t.parent||!t.prev?!1:Ii(t.prev)}function Ii(t){return t.type==="comment"&&t.value.trim()==="prettier-ignore"}function $(t){return t.type==="text"||t.type==="comment"}function W(t){return t.type==="element"&&(t.fullName==="script"||t.fullName==="style"||t.fullName==="svg:style"||t.fullName==="svg:script"||fe(t)&&(t.name==="script"||t.name==="style"))}function kn(t){return t.children&&!W(t)}function Bn(t){return W(t)||t.type==="interpolation"||Er(t)}function Er(t){return Hn(t).startsWith("pre")}function Ln(t,e){var s,i;let r=n();if(r&&!t.prev&&((i=(s=t.parent)==null?void 0:s.tagDefinition)!=null&&i.ignoreFirstLf))return t.type==="interpolation";return r;function n(){return Fe(t)||t.type==="angularControlFlowBlock"?!1:(t.type==="text"||t.type==="interpolation")&&t.prev&&(t.prev.type==="text"||t.prev.type==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:me(t.parent)?!0:!(!t.prev&&(t.parent.type==="root"||me(t)&&t.parent||W(t.parent)||et(t.parent,e)||!Hi(t.parent.cssDisplay))||t.prev&&!Wi(t.prev.cssDisplay))}}function Fn(t,e){return Fe(t)||t.type==="angularControlFlowBlock"?!1:(t.type==="text"||t.type==="interpolation")&&t.next&&(t.next.type==="text"||t.next.type==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:me(t.parent)?!0:!(!t.next&&(t.parent.type==="root"||me(t)&&t.parent||W(t.parent)||et(t.parent,e)||!Vi(t.parent.cssDisplay))||t.next&&!Ui(t.next.cssDisplay))}function Nn(t){return zi(t.cssDisplay)&&!W(t)}function Je(t){return Fe(t)||t.next&&t.sourceSpan.end&&t.sourceSpan.end.line+10&&(["body","script","style"].includes(t.name)||t.children.some(e=>$i(e)))||t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.type!=="text"&&Rn(t.firstChild)&&(!t.lastChild.isTrailingSpaceSensitive||$n(t.lastChild))}function Ar(t){return t.type==="element"&&t.children.length>0&&(["html","head","ul","ol","select"].includes(t.name)||t.cssDisplay.startsWith("table")&&t.cssDisplay!=="table-cell")}function bt(t){return On(t)||t.prev&&Ri(t.prev)||In(t)}function Ri(t){return On(t)||t.type==="element"&&t.fullName==="br"||In(t)}function In(t){return Rn(t)&&$n(t)}function Rn(t){return t.hasLeadingSpaces&&(t.prev?t.prev.sourceSpan.end.linet.sourceSpan.end.line:t.parent.type==="root"||t.parent.endSourceSpan&&t.parent.endSourceSpan.start.line>t.sourceSpan.end.line)}function On(t){switch(t.type){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return["script","select"].includes(t.name)}return!1}function Tt(t){return t.lastChild?Tt(t.lastChild):t}function $i(t){var e;return(e=t.children)==null?void 0:e.some(r=>r.type!=="text")}function Mn(t){if(t)switch(t){case"module":case"text/javascript":case"text/babel":case"application/javascript":return"babel";case"application/x-typescript":return"typescript";case"text/markdown":return"markdown";case"text/html":return"html";case"text/x-handlebars-template":return"glimmer";default:if(t.endsWith("json")||t.endsWith("importmap")||t==="speculationrules")return"json"}}function Oi(t,e){let{name:r,attrMap:n}=t;if(r!=="script"||Object.prototype.hasOwnProperty.call(n,"src"))return;let{type:s,lang:i}=t.attrMap;return!i&&!s?"babel":Ne(e,{language:i})??Mn(s)}function Mi(t,e){if(!xt(t,e))return;let{attrMap:r}=t;if(Object.prototype.hasOwnProperty.call(r,"src"))return;let{type:n,lang:s}=r;return Ne(e,{language:s})??Mn(n)}function qi(t,e){if(t.name!=="style")return;let{lang:r}=t.attrMap;return r?Ne(e,{language:r}):"css"}function Dr(t,e){return Oi(t,e)??qi(t,e)??Mi(t,e)}function Ze(t){return t==="block"||t==="list-item"||t.startsWith("table")}function Hi(t){return!Ze(t)&&t!=="inline-block"}function Vi(t){return!Ze(t)&&t!=="inline-block"}function Ui(t){return!Ze(t)}function Wi(t){return!Ze(t)}function zi(t){return!Ze(t)&&t!=="inline-block"}function me(t){return Hn(t).startsWith("pre")}function Gi(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.parent}return!1}function qn(t,e){var n;if(ge(t,e))return"block";if(((n=t.prev)==null?void 0:n.type)==="comment"){let s=t.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/u);if(s)return s[1]}let r=!1;if(t.type==="element"&&t.namespace==="svg")if(Gi(t,s=>s.fullName==="svg:foreignObject"))r=!0;else return t.name==="svg"?"inline-block":"block";switch(e.htmlWhitespaceSensitivity){case"strict":return"inline";case"ignore":return"block";default:return t.type==="element"&&(!t.namespace||r||fe(t))&&wn[t.name]||yn}}function Hn(t){return t.type==="element"&&(!t.namespace||fe(t))&&Tn[t.name]||bn}function Yi(t){let e=Number.POSITIVE_INFINITY;for(let r of t.split(` +`)){if(r.length===0)continue;let n=O.getLeadingWhitespaceCount(r);if(n===0)return 0;r.length!==n&&nr.slice(e)).join(` +`)}function yr(t){return w(!1,w(!1,t,"'","'"),""",'"')}function N(t){return yr(t.value)}var ji=new Set(["template","style","script"]);function et(t,e){return ge(t,e)&&!ji.has(t.fullName)}function ge(t,e){return e.parser==="vue"&&t.type==="element"&&t.parent.type==="root"&&t.fullName.toLowerCase()!=="html"}function xt(t,e){return ge(t,e)&&(et(t,e)||t.attrMap.lang&&t.attrMap.lang!=="html")}function Vn(t){let e=t.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function Un(t,e){let r=t.parent;if(!ge(r,e))return!1;let n=r.fullName,s=t.fullName;return n==="script"&&s==="setup"||n==="style"&&s==="vars"}function kt(t,e=t.value){return t.parent.isWhitespaceSensitive?t.parent.isIndentationSensitive?B(e):B(vr(_r(e)),S):H(_,O.split(e))}function Bt(t,e){return ge(t,e)&&t.name==="script"}var wr=/\{\{(.+?)\}\}/su;async function Wn(t,e){let r=[];for(let[n,s]of t.split(wr).entries())if(n%2===0)r.push(B(s));else try{r.push(E(["{{",k([_,await T(s,e,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),_,"}}"]))}catch{r.push("{{",B(s),"}}")}return r}function br({parser:t}){return(e,r,n)=>T(N(n.node),e,{parser:t},Q)}var Ki=br({parser:"__ng_action"}),Qi=br({parser:"__ng_binding"}),Xi=br({parser:"__ng_directive"});function Ji(t,e){if(e.parser!=="angular")return;let{node:r}=t,n=r.fullName;if(n.startsWith("(")&&n.endsWith(")")||n.startsWith("on-"))return Ki;if(n.startsWith("[")&&n.endsWith("]")||/^bind(?:on)?-/u.test(n)||/^ng-(?:if|show|hide|class|style)$/u.test(n))return Qi;if(n.startsWith("*"))return Xi;let s=N(r);if(/^i18n(?:-.+)?$/u.test(n))return()=>he(vt(kt(r,s.trim())),!s.includes("@@"));if(wr.test(s))return i=>Wn(s,i)}var zn=Ji;function Zi(t,e){let{node:r}=t,n=N(r);if(r.fullName==="class"&&!e.parentParser&&!n.includes("{{"))return()=>n.trim().split(/\s+/u).join(" ")}var Gn=Zi;function Yn(t){return t===" "||t===` +`||t==="\f"||t==="\r"||t===" "}var ea=/^[ \t\n\r\u000c]+/,ta=/^[, \t\n\r\u000c]+/,ra=/^[^ \t\n\r\u000c]+/,na=/[,]+$/,jn=/^\d+$/,sa=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ia(t){let e=t.length,r,n,s,i,a,o=0,u;function p(C){let A,D=C.exec(t.substring(o));if(D)return[A]=D,o+=A.length,A}let l=[];for(;;){if(p(ta),o>=e){if(l.length===0)throw new Error("Must contain one or more image candidate strings.");return l}u=o,r=p(ra),n=[],r.slice(-1)===","?(r=r.replace(na,""),d()):f()}function f(){for(p(ea),s="",i="in descriptor";;){if(a=t.charAt(o),i==="in descriptor")if(Yn(a))s&&(n.push(s),s="",i="after descriptor");else if(a===","){o+=1,s&&n.push(s),d();return}else if(a==="(")s+=a,i="in parens";else if(a===""){s&&n.push(s),d();return}else s+=a;else if(i==="in parens")if(a===")")s+=a,i="in descriptor";else if(a===""){n.push(s),d();return}else s+=a;else if(i==="after descriptor"&&!Yn(a))if(a===""){d();return}else i="in descriptor",o-=1;o+=1}}function d(){let C=!1,A,D,I,F,c={},g,y,q,x,U;for(F=0;Fua(N(t.node))}var Qn={width:"w",height:"h",density:"x"},oa=Object.keys(Qn);function ua(t){let e=Kn(t),r=oa.filter(l=>e.some(f=>Object.prototype.hasOwnProperty.call(f,l)));if(r.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[n]=r,s=Qn[n],i=e.map(l=>l.source.value),a=Math.max(...i.map(l=>l.length)),o=e.map(l=>l[n]?String(l[n].value):""),u=o.map(l=>{let f=l.indexOf(".");return f===-1?l.length:f}),p=Math.max(...u);return he(H([",",_],i.map((l,f)=>{let d=[l],C=o[f];if(C){let A=a-l.length+1,D=p-u[f],I=" ".repeat(A+D);d.push(pe(I," "),C+s)}return d})))}var Xn=aa;function Jn(t,e){let{node:r}=t,n=N(t.node).trim();if(r.fullName==="style"&&!e.parentParser&&!n.includes("{{"))return async s=>he(await s(n,{parser:"css",__isHTMLStyleAttribute:!0}))}var Tr=new WeakMap;function la(t,e){let{root:r}=t;return Tr.has(r)||Tr.set(r,r.children.some(n=>Bt(n,e)&&["ts","typescript"].includes(n.attrMap.lang))),Tr.get(r)}var Pe=la;function Zn(t,e,r){let{node:n}=r,s=N(n);return T(`type T<${s}> = any`,t,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},Q)}function es(t,e,{parseWithTs:r}){return T(`function _(${t}) {}`,e,{parser:r?"babel-ts":"babel",__isVueBindings:!0})}async function ts(t,e,r,n){let s=N(r.node),{left:i,operator:a,right:o}=ca(s),u=Pe(r,n);return[E(await T(`function _(${i}) {}`,t,{parser:u?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await T(o,t,{parser:u?"__ts_expression":"__js_expression"})]}function ca(t){let e=/(.*?)\s+(in|of)\s+(.*)/su,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,n=/^\(|\)$/gu,s=t.match(e);if(!s)return;let i={};if(i.for=s[3].trim(),!i.for)return;let a=w(!1,s[1].trim(),n,""),o=a.match(r);o?(i.alias=a.replace(r,""),i.iterator1=o[1].trim(),o[2]&&(i.iterator2=o[2].trim())):i.alias=a;let u=[i.alias,i.iterator1,i.iterator2];if(!u.some((p,l)=>!p&&(l===0||u.slice(l+1).some(Boolean))))return{left:u.filter(Boolean).join(","),operator:s[2],right:i.for}}function pa(t,e){if(e.parser!=="vue")return;let{node:r}=t,n=r.fullName;if(n==="v-for")return ts;if(n==="generic"&&Bt(r.parent,e))return Zn;let s=N(r),i=Pe(t,e);if(Vn(r)||Un(r,e))return a=>es(s,a,{parseWithTs:i});if(n.startsWith("@")||n.startsWith("v-on:"))return a=>ha(s,a,{parseWithTs:i});if(n.startsWith(":")||n.startsWith(".")||n.startsWith("v-bind:"))return a=>fa(s,a,{parseWithTs:i});if(n.startsWith("v-"))return a=>rs(s,a,{parseWithTs:i})}async function ha(t,e,{parseWithTs:r}){var n;try{return await rs(t,e,{parseWithTs:r})}catch(s){if(((n=s.cause)==null?void 0:n.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw s}return T(t,e,{parser:r?"__vue_ts_event_binding":"__vue_event_binding"},Q)}function fa(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__vue_ts_expression":"__vue_expression"},Q)}function rs(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__ts_expression":"__js_expression"},Q)}var ns=pa;function ma(t,e){let{node:r}=t;if(r.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(e.originalText.slice(r.valueSpan.start.offset,r.valueSpan.end.offset))||e.parser==="lwc"&&r.value.startsWith("{")&&r.value.endsWith("}"))return[r.rawName,"=",r.value];for(let n of[Xn,Jn,Gn,ns,zn]){let s=n(t,e);if(s)return da(s)}}}function da(t){return async(e,r,n,s)=>{let i=await t(e,r,n,s);if(i)return i=fr(i,a=>typeof a=="string"?w(!1,a,'"',"""):a),[n.node.rawName,'="',E(i),'"']}}var ss=ma;var is=new Proxy(()=>{},{get:()=>is}),xr=is;function ga(t){return Array.isArray(t)&&t.length>0}var Ie=ga;function J(t){return t.sourceSpan.start.offset}function Z(t){return t.sourceSpan.end.offset}function tt(t,e){return[t.isSelfClosing?"":Ca(t,e),Ce(t,e)]}function Ca(t,e){return t.lastChild&&Ee(t.lastChild)?"":[Sa(t,e),Lt(t,e)]}function Ce(t,e){return(t.next?X(t.next):_e(t.parent))?"":[Se(t,e),z(t,e)]}function Sa(t,e){return _e(t)?Se(t.lastChild,e):""}function z(t,e){return Ee(t)?Lt(t.parent,e):rt(t)?Ft(t.next,e):""}function Lt(t,e){if(xr.ok(!t.isSelfClosing),os(t,e))return"";switch(t.type){case"ieConditionalComment":return"";case"ieConditionalStartComment":return"]>";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function os(t,e){return!t.isSelfClosing&&!t.endSourceSpan&&(de(t)||wt(t.parent,e))}function X(t){return t.prev&&t.prev.type!=="docType"&&t.type!=="angularControlFlowBlock"&&!$(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function _e(t){var e;return((e=t.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!$(Tt(t.lastChild))&&!me(t)}function Ee(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&$(Tt(t))}function rt(t){return t.next&&!$(t.next)&&$(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function _a(t){let e=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return e?e[1]?e[1].split(/\s+/u):!0:!1}function nt(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function Ea(t,e,r){var f;let{node:n}=t;if(!Ie(n.attrs))return n.isSelfClosing?" ":"";let s=((f=n.prev)==null?void 0:f.type)==="comment"&&_a(n.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?d=>s.includes(d.rawName):()=>!1,a=t.map(({node:d})=>i(d)?B(e.originalText.slice(J(d),Z(d))):r(),"attrs"),o=n.type==="element"&&n.fullName==="script"&&n.attrs.length===1&&n.attrs[0].fullName==="src"&&n.children.length===0,p=e.singleAttributePerLine&&n.attrs.length>1&&!ge(n,e)?S:_,l=[k([o?" ":_,H(p,a)])];return n.firstChild&&nt(n.firstChild)||n.isSelfClosing&&_e(n.parent)||o?l.push(n.isSelfClosing?" ":""):l.push(e.bracketSameLine?n.isSelfClosing?" ":"":n.isSelfClosing?_:v),l}function Aa(t){return t.firstChild&&nt(t.firstChild)?"":Nt(t)}function st(t,e,r){let{node:n}=t;return[Ae(n,e),Ea(t,e,r),n.isSelfClosing?"":Aa(n)]}function Ae(t,e){return t.prev&&rt(t.prev)?"":[G(t,e),Ft(t,e)]}function G(t,e){return nt(t)?Nt(t.parent):X(t)?Se(t.prev,e):""}var as="<${t.rawName}`;default:return`<${t.rawName}`}}function Nt(t){switch(xr.ok(!t.isSelfClosing),t.type){case"ieConditionalComment":return"]>";case"element":if(t.condition)return">";default:return">"}}function Da(t,e){if(!t.endSourceSpan)return"";let r=t.startSourceSpan.end.offset;t.firstChild&&nt(t.firstChild)&&(r-=Nt(t).length);let n=t.endSourceSpan.start.offset;return t.lastChild&&Ee(t.lastChild)?n+=Lt(t,e).length:_e(t)&&(n-=Se(t.lastChild,e).length),e.originalText.slice(r,n)}var Pt=Da;var va=new Set(["if","else if","for","switch","case"]);function ya(t,e){let{node:r}=t;switch(r.type){case"element":if(W(r)||r.type==="interpolation")return;if(!r.isSelfClosing&&xt(r,e)){let n=Dr(r,e);return n?async(s,i)=>{let a=Pt(r,e),o=/^\s*$/u.test(a),u="";return o||(u=await s(_r(a),{parser:n,__embeddedInHtml:!0}),o=u===""),[G(r,e),E(st(t,e,i)),o?"":S,u,o?"":S,tt(r,e),z(r,e)]}:void 0}break;case"text":if(W(r.parent)){let n=Dr(r.parent,e);if(n)return async s=>{let i=n==="markdown"?vr(r.value.replace(/^[^\S\n]*\n/u,"")):r.value,a={parser:n,__embeddedInHtml:!0};if(e.parser==="html"&&n==="babel"){let o="script",{attrMap:u}=r.parent;u&&(u.type==="module"||u.type==="text/babel"&&u["data-type"]==="module")&&(o="module"),a.__babelSourceType=o}return[se,G(r,e),await s(i,a),z(r,e)]}}else if(r.parent.type==="interpolation")return async n=>{let s={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return e.parser==="angular"?s.parser="__ng_interpolation":e.parser==="vue"?s.parser=Pe(t,e)?"__vue_ts_expression":"__vue_expression":s.parser="__js_expression",[k([_,await n(r.value,s)]),r.parent.next&&X(r.parent.next)?" ":_]};break;case"attribute":return ss(t,e);case"front-matter":return n=>An(r,n);case"angularControlFlowBlockParameters":return va.has(t.parent.name)?Dn:void 0;case"angularLetDeclarationInitializer":return n=>T(r.value,n,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var us=ya;var it=null;function at(t){if(it!==null&&typeof it.property){let e=it;return it=at.prototype=null,e}return it=at.prototype=t??Object.create(null),new at}var wa=10;for(let t=0;t<=wa;t++)at();function kr(t){return at(t)}function ba(t,e="type"){kr(t);function r(n){let s=n[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return i}return r}var ls=ba;var Ta={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},cs=Ta;var xa=ls(cs),ps=xa;function hs(t){return/^\s*/u.test(t)}function fs(t){return` + +`+t}var ms=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function ds(t){let e=Z(t);return t.type==="element"&&!t.endSourceSpan&&Ie(t.children)?Math.max(e,ds(K(!1,t.children,-1))):e}function ot(t,e,r){let n=t.node;if(de(n)){let s=ds(n);return[G(n,e),B(O.trimEnd(e.originalText.slice(J(n)+(n.prev&&rt(n.prev)?Ft(n).length:0),s-(n.next&&X(n.next)?Se(n,e).length:0)))),z(n,e)]}return r()}function It(t,e){return $(t)&&$(e)?t.isTrailingSpaceSensitive?t.hasTrailingSpaces?bt(e)?S:_:"":bt(e)?S:v:rt(t)&&(de(e)||e.firstChild||e.isSelfClosing||e.type==="element"&&e.attrs.length>0)||t.type==="element"&&t.isSelfClosing&&X(e)?"":!e.isLeadingSpaceSensitive||bt(e)||X(e)&&t.lastChild&&Ee(t.lastChild)&&t.lastChild.lastChild&&Ee(t.lastChild.lastChild)?S:e.hasLeadingSpaces?_:v}function Re(t,e,r){let{node:n}=t;if(Ar(n))return[se,...t.map(i=>{let a=i.node,o=a.prev?It(a.prev,a):"";return[o?[o,Je(a.prev)?S:""]:"",ot(i,e,r)]},"children")];let s=n.children.map(()=>Symbol(""));return t.map((i,a)=>{let o=i.node;if($(o)){if(o.prev&&$(o.prev)){let A=It(o.prev,o);if(A)return Je(o.prev)?[S,S,ot(i,e,r)]:[A,ot(i,e,r)]}return ot(i,e,r)}let u=[],p=[],l=[],f=[],d=o.prev?It(o.prev,o):"",C=o.next?It(o,o.next):"";return d&&(Je(o.prev)?u.push(S,S):d===S?u.push(S):$(o.prev)?p.push(d):p.push(pe("",v,{groupId:s[a-1]}))),C&&(Je(o)?$(o.next)&&f.push(S,S):C===S?$(o.next)&&f.push(S):l.push(C)),[...u,E([...p,E([ot(i,e,r),...l],{id:s[a]})]),...f]},"children")}function gs(t,e,r){let{node:n}=t,s=[];ka(t)&&s.push("} "),s.push("@",n.name),n.parameters&&s.push(" (",E(r("parameters")),")"),s.push(" {");let i=Cs(n);return n.children.length>0?(n.firstChild.hasLeadingSpaces=!0,n.lastChild.hasTrailingSpaces=!0,s.push(k([S,Re(t,e,r)])),i&&s.push(S,"}")):i&&s.push("}"),E(s,{shouldBreak:!0})}function Cs(t){var e,r;return!(((e=t.next)==null?void 0:e.type)==="angularControlFlowBlock"&&((r=ms.get(t.name))!=null&&r.has(t.next.name)))}function ka(t){let{previous:e}=t;return(e==null?void 0:e.type)==="angularControlFlowBlock"&&!de(e)&&!Cs(e)}function Ss(t,e,r){return[k([v,H([";",_],t.map(r,"children"))]),v]}function _s(t,e,r){let{node:n}=t;return[Ae(n,e),E([n.switchValue.trim(),", ",n.clause,n.cases.length>0?[",",k([_,H(_,t.map(r,"cases"))])]:"",v]),Ce(n,e)]}function Es(t,e,r){let{node:n}=t;return[n.value," {",E([k([v,t.map(({node:s,isLast:i})=>{let a=[r()];return s.type==="text"&&(s.hasLeadingSpaces&&a.unshift(_),s.hasTrailingSpaces&&!i&&a.push(_)),a},"expression")]),v]),"}"]}function As(t,e,r){let{node:n}=t;if(wt(n,e))return[G(n,e),E(st(t,e,r)),B(Pt(n,e)),...tt(n,e),z(n,e)];let s=n.children.length===1&&(n.firstChild.type==="interpolation"||n.firstChild.type==="angularIcuExpression")&&n.firstChild.isLeadingSpaceSensitive&&!n.firstChild.hasLeadingSpaces&&n.lastChild.isTrailingSpaceSensitive&&!n.lastChild.hasTrailingSpaces,i=Symbol("element-attr-group-id"),a=l=>E([E(st(t,e,r),{id:i}),l,tt(n,e)]),o=l=>s?mn(l,{groupId:i}):(W(n)||et(n,e))&&n.parent.type==="root"&&e.parser==="vue"&&!e.vueIndentScriptAndStyle?l:k(l),u=()=>s?pe(v,"",{groupId:i}):n.firstChild.hasLeadingSpaces&&n.firstChild.isLeadingSpaceSensitive?_:n.firstChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive?hn(v):v,p=()=>(n.next?X(n.next):_e(n.parent))?n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?" ":"":s?pe(v,"",{groupId:i}):n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?_:(n.lastChild.type==="comment"||n.lastChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${e.tabWidth*(t.ancestors.length-1)}}$`,"u").test(n.lastChild.value)?"":v;return n.children.length===0?a(n.hasDanglingSpaces&&n.isDanglingSpaceSensitive?_:""):a([Pn(n)?se:"",o([u(),Re(t,e,r)]),p()])}function ut(t){return t>=9&&t<=32||t==160}function Rt(t){return 48<=t&&t<=57}function lt(t){return t>=97&&t<=122||t>=65&&t<=90}function Ds(t){return t>=97&&t<=102||t>=65&&t<=70||Rt(t)}function $t(t){return t===10||t===13}function Br(t){return 48<=t&&t<=55}function Ot(t){return t===39||t===34||t===96}var Ba=/-+([a-z0-9])/g;function ys(t){return t.replace(Ba,(...e)=>e[1].toUpperCase())}var ie=class t{constructor(e,r,n,s){this.file=e,this.offset=r,this.line=n,this.col=s}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let r=this.file.content,n=r.length,s=this.offset,i=this.line,a=this.col;for(;s>0&&e<0;)if(s--,e++,r.charCodeAt(s)==10){i--;let u=r.substring(0,s-1).lastIndexOf(String.fromCharCode(10));a=u>0?s-u:s}else a--;for(;s0;){let o=r.charCodeAt(s);s++,e--,o==10?(i++,a=0):a++}return new t(this.file,s,i,a)}getContext(e,r){let n=this.file.content,s=this.offset;if(s!=null){s>n.length-1&&(s=n.length-1);let i=s,a=0,o=0;for(;a0&&(s--,a++,!(n[s]==` +`&&++o==r)););for(a=0,o=0;a]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var La=[Na,Pa,Ra,Oa,Ma,Va,qa,Ha,Ua,$a];function Fa(t,e){for(let r of La)r(t,e);return t}function Na(t){t.walk(e=>{if(e.type==="element"&&e.tagDefinition.ignoreFirstLf&&e.children.length>0&&e.children[0].type==="text"&&e.children[0].value[0]===` +`){let r=e.children[0];r.value.length===1?e.removeChild(r):r.value=r.value.slice(1)}})}function Pa(t){let e=r=>{var n,s;return r.type==="element"&&((n=r.prev)==null?void 0:n.type)==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&((s=r.firstChild)==null?void 0:s.type)==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset};t.walk(r=>{if(r.children)for(let n=0;n{if(n.children)for(let s=0;se.type==="cdata",e=>``)}function $a(t){let e=r=>{var n,s;return r.type==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.type==="text"&&!O.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&((n=r.prev)==null?void 0:n.type)==="text"&&((s=r.next)==null?void 0:s.type)==="text"};t.walk(r=>{if(r.children)for(let n=0;n`+s.firstChild.value+``+a.value,i.sourceSpan=new h(i.sourceSpan.start,a.sourceSpan.end),i.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,i.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(s),n--,r.removeChild(a)}})}function Oa(t,e){if(e.parser==="html")return;let r=/\{\{(.+?)\}\}/su;t.walk(n=>{if(kn(n))for(let s of n.children){if(s.type!=="text")continue;let i=s.sourceSpan.start,a=null,o=s.value.split(r);for(let u=0;u0&&n.insertChildBefore(s,{type:"text",value:p,sourceSpan:new h(i,a)});continue}a=i.moveBy(p.length+4),n.insertChildBefore(s,{type:"interpolation",sourceSpan:new h(i,a),children:p.length===0?[]:[{type:"text",value:p,sourceSpan:new h(i.moveBy(2),a.moveBy(-2))}]})}n.removeChild(s)}})}function Ma(t){t.walk(e=>{let r=e.$children;if(!r)return;if(r.length===0||r.length===1&&r[0].type==="text"&&O.trim(r[0].value).length===0){e.hasDanglingSpaces=r.length>0,e.$children=[];return}let n=Bn(e),s=Er(e);if(!n)for(let i=0;i{e.isSelfClosing=!e.children||e.type==="element"&&(e.tagDefinition.isVoid||e.endSourceSpan&&e.startSourceSpan.start===e.endSourceSpan.start&&e.startSourceSpan.end===e.endSourceSpan.end)})}function Ha(t,e){t.walk(r=>{r.type==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/u.test(e.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function Va(t,e){t.walk(r=>{r.cssDisplay=qn(r,e)})}function Ua(t,e){t.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=Nn(r);return}for(let s of n)s.isLeadingSpaceSensitive=Ln(s,e),s.isTrailingSpaceSensitive=Fn(s,e);for(let s=0;s of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var xs="HTML",Ga={bracketSameLine:Lr.bracketSameLine,htmlWhitespaceSensitivity:{category:xs,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:Lr.singleAttributePerLine,vueIndentScriptAndStyle:{category:xs,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},ks=Ga;var en={};an(en,{angular:()=>Wo,html:()=>Uo,lwc:()=>Go,vue:()=>zo});var Np=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var Bs;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom"})(Bs||(Bs={}));var Ls;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default"})(Ls||(Ls={}));var Fs;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(Fs||(Fs={}));var Fr={name:"custom-elements"},Nr={name:"no-errors-schema"};var ee;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL"})(ee||(ee={}));var Ns;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(Ns||(Ns={}));var P;(function(t){t[t.RAW_TEXT=0]="RAW_TEXT",t[t.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",t[t.PARSABLE_DATA=2]="PARSABLE_DATA"})(P||(P={}));function ct(t,e=!0){if(t[0]!=":")return[null,t];let r=t.indexOf(":",1);if(r===-1){if(e)throw new Error(`Unsupported format "${t}" expecting ":namespace:name"`);return[null,t]}return[t.slice(1,r),t.slice(r+1)]}function Pr(t){return ct(t)[1]==="ng-container"}function Ir(t){return ct(t)[1]==="ng-content"}function Me(t){return t===null?null:ct(t)[0]}function qe(t,e){return t?`:${t}:${e}`:e}var Ht;function Rr(){return Ht||(Ht={},qt(ee.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),qt(ee.STYLE,["*|style"]),qt(ee.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]),qt(ee.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])),Ht}function qt(t,e){for(let r of e)Ht[r.toLowerCase()]=t}var Vt=class{};var Ya="boolean",ja="number",Ka="string",Qa="object",Xa=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"],Ps=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),Ja=Array.from(Ps).reduce((t,[e,r])=>(t.set(e,r),t),new Map),Ut=class extends Vt{constructor(){super(),this._schema=new Map,this._eventSchema=new Map,Xa.forEach(e=>{let r=new Map,n=new Set,[s,i]=e.split("|"),a=i.split(","),[o,u]=s.split("^");o.split(",").forEach(l=>{this._schema.set(l.toLowerCase(),r),this._eventSchema.set(l.toLowerCase(),n)});let p=u&&this._schema.get(u.toLowerCase());if(p){for(let[l,f]of p)r.set(l,f);for(let l of this._eventSchema.get(u.toLowerCase()))n.add(l)}a.forEach(l=>{if(l.length>0)switch(l[0]){case"*":n.add(l.substring(1));break;case"!":r.set(l.substring(1),Ya);break;case"#":r.set(l.substring(1),ja);break;case"%":r.set(l.substring(1),Qa);break;default:r.set(l,Ka)}})})}hasProperty(e,r,n){if(n.some(i=>i.name===Nr.name))return!0;if(e.indexOf("-")>-1){if(Pr(e)||Ir(e))return!1;if(n.some(i=>i.name===Fr.name))return!0}return(this._schema.get(e.toLowerCase())||this._schema.get("unknown")).has(r)}hasElement(e,r){return r.some(n=>n.name===Nr.name)||e.indexOf("-")>-1&&(Pr(e)||Ir(e)||r.some(n=>n.name===Fr.name))?!0:this._schema.has(e.toLowerCase())}securityContext(e,r,n){n&&(r=this.getMappedPropName(r)),e=e.toLowerCase(),r=r.toLowerCase();let s=Rr()[e+"|"+r];return s||(s=Rr()["*|"+r],s||ee.NONE)}getMappedPropName(e){return Ps.get(e)??e}getDefaultComponentElementName(){return"ng-component"}validateProperty(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${e}' is disallowed for security reasons, please use (${e.slice(2)})=... +If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){let r=this._schema.get(e.toLowerCase())||this._schema.get("unknown");return Array.from(r.keys()).map(n=>Ja.get(n)??n)}allKnownEventsOfElement(e){return Array.from(this._eventSchema.get(e.toLowerCase())??[])}normalizeAnimationStyleProperty(e){return ys(e)}normalizeAnimationStyleValue(e,r,n){let s="",i=n.toString().trim(),a=null;if(Za(e)&&n!==0&&n!=="0")if(typeof n=="number")s="px";else{let o=n.match(/^[+-]?[\d\.]+([a-z]*)$/);o&&o[1].length==0&&(a=`Please provide a CSS unit value for ${r}:${n}`)}return{error:a,value:i+s}}};function Za(t){switch(t){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var m=class{constructor({closedByChildren:e,implicitNamespacePrefix:r,contentType:n=P.PARSABLE_DATA,closedByParent:s=!1,isVoid:i=!1,ignoreFirstLf:a=!1,preventNamespaceInheritance:o=!1,canSelfClose:u=!1}={}){this.closedByChildren={},this.closedByParent=!1,e&&e.length>0&&e.forEach(p=>this.closedByChildren[p]=!0),this.isVoid=i,this.closedByParent=s||i,this.implicitNamespacePrefix=r||null,this.contentType=n,this.ignoreFirstLf=a,this.preventNamespaceInheritance=o,this.canSelfClose=u??i}isClosedByChild(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}getContentType(e){return typeof this.contentType=="object"?(e===void 0?void 0:this.contentType[e])??this.contentType.default:this.contentType}},Is,pt;function He(t){return pt||(Is=new m({canSelfClose:!0}),pt=Object.assign(Object.create(null),{base:new m({isVoid:!0}),meta:new m({isVoid:!0}),area:new m({isVoid:!0}),embed:new m({isVoid:!0}),link:new m({isVoid:!0}),img:new m({isVoid:!0}),input:new m({isVoid:!0}),param:new m({isVoid:!0}),hr:new m({isVoid:!0}),br:new m({isVoid:!0}),source:new m({isVoid:!0}),track:new m({isVoid:!0}),wbr:new m({isVoid:!0}),p:new m({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new m({closedByChildren:["tbody","tfoot"]}),tbody:new m({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new m({closedByChildren:["tbody"],closedByParent:!0}),tr:new m({closedByChildren:["tr"],closedByParent:!0}),td:new m({closedByChildren:["td","th"],closedByParent:!0}),th:new m({closedByChildren:["td","th"],closedByParent:!0}),col:new m({isVoid:!0}),svg:new m({implicitNamespacePrefix:"svg"}),foreignObject:new m({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new m({implicitNamespacePrefix:"math"}),li:new m({closedByChildren:["li"],closedByParent:!0}),dt:new m({closedByChildren:["dt","dd"]}),dd:new m({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new m({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new m({closedByChildren:["optgroup"],closedByParent:!0}),option:new m({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new m({ignoreFirstLf:!0}),listing:new m({ignoreFirstLf:!0}),style:new m({contentType:P.RAW_TEXT}),script:new m({contentType:P.RAW_TEXT}),title:new m({contentType:{default:P.ESCAPABLE_RAW_TEXT,svg:P.PARSABLE_DATA}}),textarea:new m({contentType:P.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new Ut().allKnownElementNames().forEach(e=>{!pt[e]&&Me(e)===null&&(pt[e]=new m({canSelfClose:!1}))})),pt[t]??Is}var ae=class{constructor(e,r){this.sourceSpan=e,this.i18n=r}},Wt=class extends ae{constructor(e,r,n,s){super(r,s),this.value=e,this.tokens=n,this.type="text"}visit(e,r){return e.visitText(this,r)}},zt=class extends ae{constructor(e,r,n,s){super(r,s),this.value=e,this.tokens=n,this.type="cdata"}visit(e,r){return e.visitCdata(this,r)}},Gt=class extends ae{constructor(e,r,n,s,i,a){super(s,a),this.switchValue=e,this.type=r,this.cases=n,this.switchValueSourceSpan=i}visit(e,r){return e.visitExpansion(this,r)}},Yt=class{constructor(e,r,n,s,i){this.value=e,this.expression=r,this.sourceSpan=n,this.valueSourceSpan=s,this.expSourceSpan=i,this.type="expansionCase"}visit(e,r){return e.visitExpansionCase(this,r)}},jt=class extends ae{constructor(e,r,n,s,i,a,o){super(n,o),this.name=e,this.value=r,this.keySpan=s,this.valueSpan=i,this.valueTokens=a,this.type="attribute"}visit(e,r){return e.visitAttribute(this,r)}get nameSpan(){return this.keySpan}},Y=class extends ae{constructor(e,r,n,s,i,a=null,o=null,u){super(s,u),this.name=e,this.attrs=r,this.children=n,this.startSourceSpan=i,this.endSourceSpan=a,this.nameSpan=o,this.type="element"}visit(e,r){return e.visitElement(this,r)}},Kt=class{constructor(e,r){this.value=e,this.sourceSpan=r,this.type="comment"}visit(e,r){return e.visitComment(this,r)}},Qt=class{constructor(e,r){this.value=e,this.sourceSpan=r,this.type="docType"}visit(e,r){return e.visitDocType(this,r)}},te=class extends ae{constructor(e,r,n,s,i,a,o=null,u){super(s,u),this.name=e,this.parameters=r,this.children=n,this.nameSpan=i,this.startSourceSpan=a,this.endSourceSpan=o,this.type="block"}visit(e,r){return e.visitBlock(this,r)}},ht=class{constructor(e,r){this.expression=e,this.sourceSpan=r,this.type="blockParameter",this.startSourceSpan=null,this.endSourceSpan=null}visit(e,r){return e.visitBlockParameter(this,r)}},ft=class{constructor(e,r,n,s,i){this.name=e,this.value=r,this.sourceSpan=n,this.nameSpan=s,this.valueSpan=i,this.type="letDeclaration",this.startSourceSpan=null,this.endSourceSpan=null}visit(e,r){return e.visitLetDeclaration(this,r)}};function Xt(t,e,r=null){let n=[],s=t.visit?i=>t.visit(i,r)||i.visit(t,r):i=>i.visit(t,r);return e.forEach(i=>{let a=s(i);a&&n.push(a)}),n}var mt=class{constructor(){}visitElement(e,r){this.visitChildren(r,n=>{n(e.attrs),n(e.children)})}visitAttribute(e,r){}visitText(e,r){}visitCdata(e,r){}visitComment(e,r){}visitDocType(e,r){}visitExpansion(e,r){return this.visitChildren(r,n=>{n(e.cases)})}visitExpansionCase(e,r){}visitBlock(e,r){this.visitChildren(r,n=>{n(e.parameters),n(e.children)})}visitBlockParameter(e,r){}visitLetDeclaration(e,r){}visitChildren(e,r){let n=[],s=this;function i(a){a&&n.push(Xt(s,a,e))}return r(i),Array.prototype.concat.apply([],n)}};var Ve={AElig:"\xC6",AMP:"&",amp:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",af:"\u2061",Aring:"\xC5",angst:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",colone:"\u2254",coloneq:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",setminus:"\u2216",setmn:"\u2216",smallsetminus:"\u2216",ssetmn:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",doublebarwedge:"\u2306",Bcy:"\u0411",Because:"\u2235",becaus:"\u2235",because:"\u2235",Bernoullis:"\u212C",Bscr:"\u212C",bernou:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",breve:"\u02D8",Bumpeq:"\u224E",HumpDownHump:"\u224E",bump:"\u224E",CHcy:"\u0427",COPY:"\xA9",copy:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",DD:"\u2145",Cayleys:"\u212D",Cfr:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",cedil:"\xB8",CenterDot:"\xB7",centerdot:"\xB7",middot:"\xB7",Chi:"\u03A7",CircleDot:"\u2299",odot:"\u2299",CircleMinus:"\u2296",ominus:"\u2296",CirclePlus:"\u2295",oplus:"\u2295",CircleTimes:"\u2297",otimes:"\u2297",ClockwiseContourIntegral:"\u2232",cwconint:"\u2232",CloseCurlyDoubleQuote:"\u201D",rdquo:"\u201D",rdquor:"\u201D",CloseCurlyQuote:"\u2019",rsquo:"\u2019",rsquor:"\u2019",Colon:"\u2237",Proportion:"\u2237",Colone:"\u2A74",Congruent:"\u2261",equiv:"\u2261",Conint:"\u222F",DoubleContourIntegral:"\u222F",ContourIntegral:"\u222E",conint:"\u222E",oint:"\u222E",Copf:"\u2102",complexes:"\u2102",Coproduct:"\u2210",coprod:"\u2210",CounterClockwiseContourIntegral:"\u2233",awconint:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",asympeq:"\u224D",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",ddagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",DoubleLeftTee:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",nabla:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",acute:"\xB4",DiacriticalDot:"\u02D9",dot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",dblac:"\u02DD",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"\u02DC",tilde:"\u02DC",Diamond:"\u22C4",diam:"\u22C4",diamond:"\u22C4",DifferentialD:"\u2146",dd:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DoubleDot:"\xA8",die:"\xA8",uml:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",doteq:"\u2250",esdot:"\u2250",DoubleDownArrow:"\u21D3",Downarrow:"\u21D3",dArr:"\u21D3",DoubleLeftArrow:"\u21D0",Leftarrow:"\u21D0",lArr:"\u21D0",DoubleLeftRightArrow:"\u21D4",Leftrightarrow:"\u21D4",hArr:"\u21D4",iff:"\u21D4",DoubleLongLeftArrow:"\u27F8",Longleftarrow:"\u27F8",xlArr:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",Longleftrightarrow:"\u27FA",xhArr:"\u27FA",DoubleLongRightArrow:"\u27F9",Longrightarrow:"\u27F9",xrArr:"\u27F9",DoubleRightArrow:"\u21D2",Implies:"\u21D2",Rightarrow:"\u21D2",rArr:"\u21D2",DoubleRightTee:"\u22A8",vDash:"\u22A8",DoubleUpArrow:"\u21D1",Uparrow:"\u21D1",uArr:"\u21D1",DoubleUpDownArrow:"\u21D5",Updownarrow:"\u21D5",vArr:"\u21D5",DoubleVerticalBar:"\u2225",par:"\u2225",parallel:"\u2225",shortparallel:"\u2225",spar:"\u2225",DownArrow:"\u2193",ShortDownArrow:"\u2193",darr:"\u2193",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",duarr:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",leftharpoondown:"\u21BD",lhard:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",rhard:"\u21C1",rightharpoondown:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",top:"\u22A4",DownTeeArrow:"\u21A7",mapstodown:"\u21A7",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",in:"\u2208",isin:"\u2208",isinv:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",eqsim:"\u2242",esim:"\u2242",Equilibrium:"\u21CC",rightleftharpoons:"\u21CC",rlhar:"\u21CC",Escr:"\u2130",expectation:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",exist:"\u2203",ExponentialE:"\u2147",ee:"\u2147",exponentiale:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",blacksquare:"\u25AA",squarf:"\u25AA",squf:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",forall:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",gt:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",ggg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",ge:"\u2265",geq:"\u2265",GreaterEqualLess:"\u22DB",gel:"\u22DB",gtreqless:"\u22DB",GreaterFullEqual:"\u2267",gE:"\u2267",geqq:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",gl:"\u2277",gtrless:"\u2277",GreaterSlantEqual:"\u2A7E",geqslant:"\u2A7E",ges:"\u2A7E",GreaterTilde:"\u2273",gsim:"\u2273",gtrsim:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",NestedGreaterGreater:"\u226B",gg:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",caron:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",Poincareplane:"\u210C",HilbertSpace:"\u210B",Hscr:"\u210B",hamilt:"\u210B",Hopf:"\u210D",quaternions:"\u210D",HorizontalLine:"\u2500",boxh:"\u2500",Hstrok:"\u0126",HumpEqual:"\u224F",bumpe:"\u224F",bumpeq:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Im:"\u2111",image:"\u2111",imagpart:"\u2111",Igrave:"\xCC",Imacr:"\u012A",ImaginaryI:"\u2148",ii:"\u2148",Int:"\u222C",Integral:"\u222B",int:"\u222B",Intersection:"\u22C2",bigcap:"\u22C2",xcap:"\u22C2",InvisibleComma:"\u2063",ic:"\u2063",InvisibleTimes:"\u2062",it:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",imagline:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",lt:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Lscr:"\u2112",lagran:"\u2112",Larr:"\u219E",twoheadleftarrow:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",lang:"\u27E8",langle:"\u27E8",LeftArrow:"\u2190",ShortLeftArrow:"\u2190",larr:"\u2190",leftarrow:"\u2190",slarr:"\u2190",LeftArrowBar:"\u21E4",larrb:"\u21E4",LeftArrowRightArrow:"\u21C6",leftrightarrows:"\u21C6",lrarr:"\u21C6",LeftCeiling:"\u2308",lceil:"\u2308",LeftDoubleBracket:"\u27E6",lobrk:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",dharl:"\u21C3",downharpoonleft:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",lfloor:"\u230A",LeftRightArrow:"\u2194",harr:"\u2194",leftrightarrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",dashv:"\u22A3",LeftTeeArrow:"\u21A4",mapstoleft:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",vartriangleleft:"\u22B2",vltri:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",ltrie:"\u22B4",trianglelefteq:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",uharl:"\u21BF",upharpoonleft:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",leftharpoonup:"\u21BC",lharu:"\u21BC",LeftVectorBar:"\u2952",LessEqualGreater:"\u22DA",leg:"\u22DA",lesseqgtr:"\u22DA",LessFullEqual:"\u2266",lE:"\u2266",leqq:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",lg:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",leqslant:"\u2A7D",les:"\u2A7D",LessTilde:"\u2272",lesssim:"\u2272",lsim:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",lAarr:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",longleftarrow:"\u27F5",xlarr:"\u27F5",LongLeftRightArrow:"\u27F7",longleftrightarrow:"\u27F7",xharr:"\u27F7",LongRightArrow:"\u27F6",longrightarrow:"\u27F6",xrarr:"\u27F6",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",swarr:"\u2199",swarrow:"\u2199",LowerRightArrow:"\u2198",searr:"\u2198",searrow:"\u2198",Lsh:"\u21B0",lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",NestedLessLess:"\u226A",ll:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mscr:"\u2133",phmmat:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",mnplus:"\u2213",mp:"\u2213",Mopf:"\u{1D544}",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",ZeroWidthSpace:"\u200B",NewLine:` +`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nbsp:"\xA0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",npar:"\u2226",nparallel:"\u2226",nshortparallel:"\u2226",nspar:"\u2226",NotElement:"\u2209",notin:"\u2209",notinva:"\u2209",NotEqual:"\u2260",ne:"\u2260",NotEqualTilde:"\u2242\u0338",nesim:"\u2242\u0338",NotExists:"\u2204",nexist:"\u2204",nexists:"\u2204",NotGreater:"\u226F",ngt:"\u226F",ngtr:"\u226F",NotGreaterEqual:"\u2271",nge:"\u2271",ngeq:"\u2271",NotGreaterFullEqual:"\u2267\u0338",ngE:"\u2267\u0338",ngeqq:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",nGtv:"\u226B\u0338",NotGreaterLess:"\u2279",ntgl:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",NotGreaterTilde:"\u2275",ngsim:"\u2275",NotHumpDownHump:"\u224E\u0338",nbump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",nbumpe:"\u224F\u0338",NotLeftTriangle:"\u22EA",nltri:"\u22EA",ntriangleleft:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",nltrie:"\u22EC",ntrianglelefteq:"\u22EC",NotLess:"\u226E",nless:"\u226E",nlt:"\u226E",NotLessEqual:"\u2270",nle:"\u2270",nleq:"\u2270",NotLessGreater:"\u2278",ntlg:"\u2278",NotLessLess:"\u226A\u0338",nLtv:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",NotLessTilde:"\u2274",nlsim:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",npr:"\u2280",nprec:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",npre:"\u2AAF\u0338",npreceq:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",nprcue:"\u22E0",NotReverseElement:"\u220C",notni:"\u220C",notniva:"\u220C",NotRightTriangle:"\u22EB",nrtri:"\u22EB",ntriangleright:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",nrtrie:"\u22ED",ntrianglerighteq:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",nsqsube:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",nsqsupe:"\u22E3",NotSubset:"\u2282\u20D2",nsubset:"\u2282\u20D2",vnsub:"\u2282\u20D2",NotSubsetEqual:"\u2288",nsube:"\u2288",nsubseteq:"\u2288",NotSucceeds:"\u2281",nsc:"\u2281",nsucc:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",nsce:"\u2AB0\u0338",nsucceq:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",nsccue:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",nsupset:"\u2283\u20D2",vnsup:"\u2283\u20D2",NotSupersetEqual:"\u2289",nsupe:"\u2289",nsupseteq:"\u2289",NotTilde:"\u2241",nsim:"\u2241",NotTildeEqual:"\u2244",nsime:"\u2244",nsimeq:"\u2244",NotTildeFullEqual:"\u2247",ncong:"\u2247",NotTildeTilde:"\u2249",nap:"\u2249",napprox:"\u2249",NotVerticalBar:"\u2224",nmid:"\u2224",nshortmid:"\u2224",nsmid:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",ohm:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",ldquo:"\u201C",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",oline:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",tbrk:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",part:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",plusmn:"\xB1",pm:"\xB1",Popf:"\u2119",primes:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",pr:"\u227A",prec:"\u227A",PrecedesEqual:"\u2AAF",pre:"\u2AAF",preceq:"\u2AAF",PrecedesSlantEqual:"\u227C",prcue:"\u227C",preccurlyeq:"\u227C",PrecedesTilde:"\u227E",precsim:"\u227E",prsim:"\u227E",Prime:"\u2033",Product:"\u220F",prod:"\u220F",Proportional:"\u221D",prop:"\u221D",propto:"\u221D",varpropto:"\u221D",vprop:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',quot:'"',Qfr:"\u{1D514}",Qopf:"\u211A",rationals:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",drbkarow:"\u2910",REG:"\xAE",circledR:"\xAE",reg:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",twoheadrightarrow:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",Rfr:"\u211C",real:"\u211C",realpart:"\u211C",ReverseElement:"\u220B",SuchThat:"\u220B",ni:"\u220B",niv:"\u220B",ReverseEquilibrium:"\u21CB",leftrightharpoons:"\u21CB",lrhar:"\u21CB",ReverseUpEquilibrium:"\u296F",duhar:"\u296F",Rho:"\u03A1",RightAngleBracket:"\u27E9",rang:"\u27E9",rangle:"\u27E9",RightArrow:"\u2192",ShortRightArrow:"\u2192",rarr:"\u2192",rightarrow:"\u2192",srarr:"\u2192",RightArrowBar:"\u21E5",rarrb:"\u21E5",RightArrowLeftArrow:"\u21C4",rightleftarrows:"\u21C4",rlarr:"\u21C4",RightCeiling:"\u2309",rceil:"\u2309",RightDoubleBracket:"\u27E7",robrk:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",dharr:"\u21C2",downharpoonright:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rfloor:"\u230B",RightTee:"\u22A2",vdash:"\u22A2",RightTeeArrow:"\u21A6",map:"\u21A6",mapsto:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",vartriangleright:"\u22B3",vrtri:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",rtrie:"\u22B5",trianglerighteq:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",uharr:"\u21BE",upharpoonright:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",rharu:"\u21C0",rightharpoonup:"\u21C0",RightVectorBar:"\u2953",Ropf:"\u211D",reals:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",rAarr:"\u21DB",Rscr:"\u211B",realine:"\u211B",Rsh:"\u21B1",rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortUpArrow:"\u2191",UpArrow:"\u2191",uarr:"\u2191",uparrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",compfn:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",radic:"\u221A",Square:"\u25A1",squ:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",sqcap:"\u2293",SquareSubset:"\u228F",sqsub:"\u228F",sqsubset:"\u228F",SquareSubsetEqual:"\u2291",sqsube:"\u2291",sqsubseteq:"\u2291",SquareSuperset:"\u2290",sqsup:"\u2290",sqsupset:"\u2290",SquareSupersetEqual:"\u2292",sqsupe:"\u2292",sqsupseteq:"\u2292",SquareUnion:"\u2294",sqcup:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",sstarf:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",sube:"\u2286",subseteq:"\u2286",Succeeds:"\u227B",sc:"\u227B",succ:"\u227B",SucceedsEqual:"\u2AB0",sce:"\u2AB0",succeq:"\u2AB0",SucceedsSlantEqual:"\u227D",sccue:"\u227D",succcurlyeq:"\u227D",SucceedsTilde:"\u227F",scsim:"\u227F",succsim:"\u227F",Sum:"\u2211",sum:"\u2211",Sup:"\u22D1",Supset:"\u22D1",Superset:"\u2283",sup:"\u2283",supset:"\u2283",SupersetEqual:"\u2287",supe:"\u2287",supseteq:"\u2287",THORN:"\xDE",TRADE:"\u2122",trade:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",there4:"\u2234",therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",thinsp:"\u2009",Tilde:"\u223C",sim:"\u223C",thicksim:"\u223C",thksim:"\u223C",TildeEqual:"\u2243",sime:"\u2243",simeq:"\u2243",TildeFullEqual:"\u2245",cong:"\u2245",TildeTilde:"\u2248",ap:"\u2248",approx:"\u2248",asymp:"\u2248",thickapprox:"\u2248",thkap:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",tdot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",lowbar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",bbrk:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",bigcup:"\u22C3",xcup:"\u22C3",UnionPlus:"\u228E",uplus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",udarr:"\u21C5",UpDownArrow:"\u2195",updownarrow:"\u2195",varr:"\u2195",UpEquilibrium:"\u296E",udhar:"\u296E",UpTee:"\u22A5",bot:"\u22A5",bottom:"\u22A5",perp:"\u22A5",UpTeeArrow:"\u21A5",mapstoup:"\u21A5",UpperLeftArrow:"\u2196",nwarr:"\u2196",nwarrow:"\u2196",UpperRightArrow:"\u2197",nearr:"\u2197",nearrow:"\u2197",Upsi:"\u03D2",upsih:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",bigvee:"\u22C1",xvee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",mid:"\u2223",shortmid:"\u2223",smid:"\u2223",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",wr:"\u2240",wreath:"\u2240",VeryThinSpace:"\u200A",hairsp:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",bigwedge:"\u22C0",xwedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",Zeta:"\u0396",Zfr:"\u2128",zeetrf:"\u2128",Zopf:"\u2124",integers:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",mstpos:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acy:"\u0430",aelig:"\xE6",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",and:"\u2227",wedge:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",angle:"\u2220",ange:"\u29A4",angmsd:"\u2221",measuredangle:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",approxeq:"\u224A",apid:"\u224B",apos:"'",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",midast:"*",atilde:"\xE3",auml:"\xE4",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",bcong:"\u224C",backepsilon:"\u03F6",bepsi:"\u03F6",backprime:"\u2035",bprime:"\u2035",backsim:"\u223D",bsim:"\u223D",backsimeq:"\u22CD",bsime:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrktbrk:"\u23B6",bcy:"\u0431",bdquo:"\u201E",ldquor:"\u201E",bemptyv:"\u29B0",beta:"\u03B2",beth:"\u2136",between:"\u226C",twixt:"\u226C",bfr:"\u{1D51F}",bigcirc:"\u25EF",xcirc:"\u25EF",bigodot:"\u2A00",xodot:"\u2A00",bigoplus:"\u2A01",xoplus:"\u2A01",bigotimes:"\u2A02",xotime:"\u2A02",bigsqcup:"\u2A06",xsqcup:"\u2A06",bigstar:"\u2605",starf:"\u2605",bigtriangledown:"\u25BD",xdtri:"\u25BD",bigtriangleup:"\u25B3",xutri:"\u25B3",biguplus:"\u2A04",xuplus:"\u2A04",bkarow:"\u290D",rbarr:"\u290D",blacklozenge:"\u29EB",lozf:"\u29EB",blacktriangle:"\u25B4",utrif:"\u25B4",blacktriangledown:"\u25BE",dtrif:"\u25BE",blacktriangleleft:"\u25C2",ltrif:"\u25C2",blacktriangleright:"\u25B8",rtrif:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",minusb:"\u229F",boxplus:"\u229E",plusb:"\u229E",boxtimes:"\u22A0",timesb:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bumpE:"\u2AAE",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cemptyv:"\u29B2",cent:"\xA2",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",cire:"\u2257",circlearrowleft:"\u21BA",olarr:"\u21BA",circlearrowright:"\u21BB",orarr:"\u21BB",circledS:"\u24C8",oS:"\u24C8",circledast:"\u229B",oast:"\u229B",circledcirc:"\u229A",ocir:"\u229A",circleddash:"\u229D",odash:"\u229D",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",comma:",",commat:"@",comp:"\u2201",complement:"\u2201",congdot:"\u2A6D",copf:"\u{1D554}",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",curlyeqprec:"\u22DE",cuesc:"\u22DF",curlyeqsucc:"\u22DF",cularr:"\u21B6",curvearrowleft:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curvearrowright:"\u21B7",curarrm:"\u293C",curlyvee:"\u22CE",cuvee:"\u22CE",curlywedge:"\u22CF",cuwed:"\u22CF",curren:"\xA4",cwint:"\u2231",cylcty:"\u232D",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",dash:"\u2010",hyphen:"\u2010",dbkarow:"\u290F",rBarr:"\u290F",dcaron:"\u010F",dcy:"\u0434",ddarr:"\u21CA",downdownarrows:"\u21CA",ddotseq:"\u2A77",eDDot:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",diamondsuit:"\u2666",diams:"\u2666",digamma:"\u03DD",gammad:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",llcorner:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",doteqdot:"\u2251",eDot:"\u2251",dotminus:"\u2238",minusd:"\u2238",dotplus:"\u2214",plusdo:"\u2214",dotsquare:"\u22A1",sdotb:"\u22A1",drcorn:"\u231F",lrcorner:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",triangledown:"\u25BF",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",eqcirc:"\u2256",ecirc:"\xEA",ecolon:"\u2255",eqcolon:"\u2255",ecy:"\u044D",edot:"\u0117",efDot:"\u2252",fallingdotseq:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",eqslantgtr:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",eqslantless:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",varnothing:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",straightepsilon:"\u03F5",varepsilon:"\u03F5",equals:"=",equest:"\u225F",questeq:"\u225F",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",risingdotseq:"\u2253",erarr:"\u2971",escr:"\u212F",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",fork:"\u22D4",pitchfork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",half:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",sfrown:"\u2322",fscr:"\u{1D4BB}",gEl:"\u2A8C",gtreqqless:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gap:"\u2A86",gtrapprox:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gimel:"\u2137",gjcy:"\u0453",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gneqq:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gnsim:"\u22E7",gopf:"\u{1D558}",gscr:"\u210A",gsime:"\u2A8E",gsiml:"\u2A90",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtrdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrarr:"\u2978",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hardcy:"\u044A",harrcir:"\u2948",harrw:"\u21AD",leftrightsquigarrow:"\u21AD",hbar:"\u210F",hslash:"\u210F",planck:"\u210F",plankv:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",mldr:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",searhk:"\u2925",hkswarow:"\u2926",swarhk:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",larrhk:"\u21A9",hookrightarrow:"\u21AA",rarrhk:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hstrok:"\u0127",hybull:"\u2043",iacute:"\xED",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",ifr:"\u{1D526}",igrave:"\xEC",iiiint:"\u2A0C",qint:"\u2A0C",iiint:"\u222D",tint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",imath:"\u0131",inodot:"\u0131",imof:"\u22B7",imped:"\u01B5",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",intcal:"\u22BA",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iquest:"\xBF",iscr:"\u{1D4BE}",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",varkappa:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAtail:"\u291B",lBarr:"\u290E",lEg:"\u2A8B",lesseqqgtr:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lambda:"\u03BB",langd:"\u2991",lap:"\u2A85",lessapprox:"\u2A85",laquo:"\xAB",larrbfs:"\u291F",larrfs:"\u291D",larrlp:"\u21AB",looparrowleft:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",leftarrowtail:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lcy:"\u043B",ldca:"\u2936",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leq:"\u2264",leftleftarrows:"\u21C7",llarr:"\u21C7",leftthreetimes:"\u22CB",lthree:"\u22CB",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessdot:"\u22D6",ltdot:"\u22D6",lfisht:"\u297C",lfr:"\u{1D529}",lgE:"\u2A91",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lneqq:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",longmapsto:"\u27FC",xmap:"\u27FC",looparrowright:"\u21AC",rarrlp:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",loz:"\u25CA",lozenge:"\u25CA",lpar:"(",lparlt:"\u2993",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsime:"\u2A8D",lsimg:"\u2A8F",lsquor:"\u201A",sbquo:"\u201A",lstrok:"\u0142",ltcc:"\u2AA6",ltcir:"\u2A79",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",triangleleft:"\u25C3",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",strns:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",midcir:"\u2AF0",minus:"\u2212",minusdu:"\u2A2A",mlcp:"\u2ADB",models:"\u22A7",mopf:"\u{1D55E}",mscr:"\u{1D4C2}",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nLeftarrow:"\u21CD",nlArr:"\u21CD",nLeftrightarrow:"\u21CE",nhArr:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nRightarrow:"\u21CF",nrArr:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nacute:"\u0144",nang:"\u2220\u20D2",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",natur:"\u266E",natural:"\u266E",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",neArr:"\u21D7",nearhk:"\u2924",nedot:"\u2250\u0338",nesear:"\u2928",toea:"\u2928",nfr:"\u{1D52B}",nharr:"\u21AE",nleftrightarrow:"\u21AE",nhpar:"\u2AF2",nis:"\u22FC",nisd:"\u22FA",njcy:"\u045A",nlE:"\u2266\u0338",nleqq:"\u2266\u0338",nlarr:"\u219A",nleftarrow:"\u219A",nldr:"\u2025",nopf:"\u{1D55F}",not:"\xAC",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinvb:"\u22F7",notinvc:"\u22F6",notnivb:"\u22FE",notnivc:"\u22FD",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",nrarr:"\u219B",nrightarrow:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nscr:"\u{1D4C3}",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsubseteqq:"\u2AC5\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupseteqq:"\u2AC6\u0338",ntilde:"\xF1",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwnear:"\u2927",oacute:"\xF3",ocirc:"\xF4",ocy:"\u043E",odblac:"\u0151",odiv:"\u2A38",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",olcir:"\u29BE",olcross:"\u29BB",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",or:"\u2228",vee:"\u2228",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",oscr:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",para:"\xB6",parsim:"\u2AF3",parsl:"\u2AFD",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",straightphi:"\u03D5",varphi:"\u03D5",phone:"\u260E",pi:"\u03C0",piv:"\u03D6",varpi:"\u03D6",planckh:"\u210E",plus:"+",plusacir:"\u2A23",pluscir:"\u2A22",plusdu:"\u2A25",pluse:"\u2A72",plussim:"\u2A26",plustwo:"\u2A27",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",prE:"\u2AB3",prap:"\u2AB7",precapprox:"\u2AB7",precnapprox:"\u2AB9",prnap:"\u2AB9",precneqq:"\u2AB5",prnE:"\u2AB5",precnsim:"\u22E8",prnsim:"\u22E8",prime:"\u2032",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quatint:"\u2A16",quest:"?",rAtail:"\u291C",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",raemptyv:"\u29B3",rangd:"\u2992",range:"\u29A5",raquo:"\xBB",rarrap:"\u2975",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rightarrowtail:"\u21A3",rarrw:"\u219D",rightsquigarrow:"\u219D",ratail:"\u291A",ratio:"\u2236",rbbrk:"\u2773",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdsh:"\u21B3",rect:"\u25AD",rfisht:"\u297D",rfr:"\u{1D52F}",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",varrho:"\u03F1",rightrightarrows:"\u21C9",rrarr:"\u21C9",rightthreetimes:"\u22CC",rthree:"\u22CC",ring:"\u02DA",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rsaquo:"\u203A",rscr:"\u{1D4C7}",rtimes:"\u22CA",rtri:"\u25B9",triangleright:"\u25B9",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",scE:"\u2AB4",scap:"\u2AB8",succapprox:"\u2AB8",scaron:"\u0161",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",succneqq:"\u2AB6",scnap:"\u2ABA",succnapprox:"\u2ABA",scnsim:"\u22E9",succnsim:"\u22E9",scpolint:"\u2A13",scy:"\u0441",sdot:"\u22C5",sdote:"\u2A66",seArr:"\u21D8",sect:"\xA7",semi:";",seswar:"\u2929",tosa:"\u2929",sext:"\u2736",sfr:"\u{1D530}",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",varsigma:"\u03C2",simdot:"\u2A6A",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",smashp:"\u2A33",smeparsl:"\u29E4",smile:"\u2323",ssmile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",sqcaps:"\u2293\uFE00",sqcups:"\u2294\uFE00",sscr:"\u{1D4C8}",star:"\u2606",sub:"\u2282",subset:"\u2282",subE:"\u2AC5",subseteqq:"\u2AC5",subdot:"\u2ABD",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subsetneqq:"\u2ACB",subne:"\u228A",subsetneq:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supE:"\u2AC6",supseteqq:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supsetneqq:"\u2ACC",supne:"\u228B",supsetneq:"\u228B",supplus:"\u2AC0",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",telrec:"\u2315",tfr:"\u{1D531}",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",vartheta:"\u03D1",thorn:"\xFE",times:"\xD7",timesbar:"\u2A31",timesd:"\u2A30",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tprime:"\u2034",triangle:"\u25B5",utri:"\u25B5",triangleq:"\u225C",trie:"\u225C",tridot:"\u25EC",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",uHar:"\u2963",uacute:"\xFA",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udblac:"\u0171",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uogon:"\u0173",uopf:"\u{1D566}",upsi:"\u03C5",upsilon:"\u03C5",upuparrows:"\u21C8",uuarr:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",uuml:"\xFC",uwangle:"\u29A7",vBar:"\u2AE8",vBarv:"\u2AE9",vangrt:"\u299C",varsubsetneq:"\u228A\uFE00",vsubne:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",vsubnE:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",vsupne:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vsupnE:"\u2ACC\uFE00",vcy:"\u0432",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",vfr:"\u{1D533}",vopf:"\u{1D567}",vscr:"\u{1D4CB}",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedgeq:"\u2259",weierp:"\u2118",wp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wscr:"\u{1D4CC}",xfr:"\u{1D535}",xi:"\u03BE",xnis:"\u22FB",xopf:"\u{1D569}",xscr:"\u{1D4CD}",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"},to="\uE500";Ve.ngsp=to;var ro=[/@/,/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function Rs(t,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${t}' to be an array, [start, end].`);if(e!=null){let r=e[0],n=e[1];ro.forEach(s=>{if(s.test(r)||s.test(n))throw new Error(`['${r}', '${n}'] contains unusable interpolation symbol.`)})}}var $r=class t{static fromArray(e){return e?(Rs("interpolation",e),new t(e[0],e[1])):Or}constructor(e,r){this.start=e,this.end=r}},Or=new $r("{{","}}");var gt=class extends Oe{constructor(e,r,n){super(n,e),this.tokenType=r}},Ur=class{constructor(e,r,n){this.tokens=e,this.errors=r,this.nonNormalizedIcuExpressions=n}};function Ks(t,e,r,n={}){let s=new Wr(new De(t,e),r,n);return s.tokenize(),new Ur(ko(s.tokens),s.errors,s.nonNormalizedIcuExpressions)}var Do=/\r\n?/g;function Ue(t){return`Unexpected character "${t===0?"EOF":String.fromCharCode(t)}"`}function Hs(t){return`Unknown entity "${t}" - use the "&#;" or "&#x;" syntax`}function vo(t,e){return`Unable to parse entity "${e}" - ${t} character reference entities must end with ";"`}var rr;(function(t){t.HEX="hexadecimal",t.DEC="decimal"})(rr||(rr={}));var Ct=class{constructor(e){this.error=e}},Wr=class{constructor(e,r,n){this._getTagContentType=r,this._currentTokenStart=null,this._currentTokenType=null,this._expansionCaseStack=[],this._inInterpolation=!1,this._fullNameStack=[],this.tokens=[],this.errors=[],this.nonNormalizedIcuExpressions=[],this._tokenizeIcu=n.tokenizeExpansionForms||!1,this._interpolationConfig=n.interpolationConfig||Or,this._leadingTriviaCodePoints=n.leadingTriviaChars&&n.leadingTriviaChars.map(i=>i.codePointAt(0)||0),this._canSelfClose=n.canSelfClose||!1,this._allowHtmComponentClosingTags=n.allowHtmComponentClosingTags||!1;let s=n.range||{endPos:e.content.length,startPos:0,startLine:0,startCol:0};this._cursor=n.escapedString?new zr(e,s):new nr(e,s),this._preserveLineEndings=n.preserveLineEndings||!1,this._i18nNormalizeLineEndingsInICUs=n.i18nNormalizeLineEndingsInICUs||!1,this._tokenizeBlocks=n.tokenizeBlocks??!0,this._tokenizeLet=n.tokenizeLet??!0;try{this._cursor.init()}catch(i){this.handleError(i)}}_processCarriageReturns(e){return this._preserveLineEndings?e:e.replace(Do,` +`)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(47))this._consumeTagClose(e);else{let r=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=r,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._attemptStr("@let")?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._attemptCharCode(64)?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(r){this.handleError(r)}}this._beginToken(34),this._endToken([])}_getBlockName(){let e=!1,r=this._cursor.clone();return this._attemptCharCodeUntilFn(n=>ut(n)?!e:Ws(n)?(e=!0,!1):!0),this._cursor.getChars(r).trim()}_consumeBlockStart(e){this._beginToken(25,e);let r=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(b),this._attemptCharCode(41))this._attemptCharCodeUntilFn(b);else{r.type=29;return}this._attemptCharCode(123)?(this._beginToken(26),this._endToken([])):r.type=29}_consumeBlockEnd(e){this._beginToken(27,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(zs);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(28);let e=this._cursor.clone(),r=null,n=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||r!==null;){let s=this._cursor.peek();if(s===92)this._cursor.advance();else if(s===r)r=null;else if(r===null&&Ot(s))r=s;else if(s===40&&r===null)n++;else if(s===41&&r===null){if(n===0)break;n>0&&n--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(zs)}}_consumeLetDeclaration(e){if(this._beginToken(30,e),ut(this._cursor.peek()))this._attemptCharCodeUntilFn(b);else{let s=this._endToken([this._cursor.getChars(e)]);s.type=33;return}let r=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(b),!this._attemptCharCode(61)){r.type=33;return}this._attemptCharCodeUntilFn(s=>b(s)&&!$t(s)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(32),this._endToken([]),this._cursor.advance()):(r.type=33,r.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),r=!1;return this._attemptCharCodeUntilFn(n=>lt(n)||n===36||n===95||r&&Rt(n)?(r=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();for(this._beginToken(31,e);this._cursor.peek()!==0;){let r=this._cursor.peek();if(r===59)break;Ot(r)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(n=>n===92?(this._cursor.advance(),!1):n===r)),this._cursor.advance()}this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(To(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,r=this._cursor.clone()){this._currentTokenStart=r,this._currentTokenType=e}_endToken(e,r){if(this._currentTokenStart===null)throw new gt("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(r));if(this._currentTokenType===null)throw new gt("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let n={type:this._currentTokenType,parts:e,sourceSpan:(r??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(n),this._currentTokenStart=null,this._currentTokenType=null,n}_createError(e,r){this._isInExpansionForm()&&(e+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let n=new gt(e,this._currentTokenType,r);return this._currentTokenStart=null,this._currentTokenType=null,new Ct(n)}handleError(e){if(e instanceof St&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof Ct)this.errors.push(e.error);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return xo(this._cursor.peek(),e)?(this._cursor.advance(),!0):!1}_requireCharCode(e){let r=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(Ue(this._cursor.peek()),this._cursor.getSpan(r))}_attemptStr(e){let r=e.length;if(this._cursor.charsLeft()this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(e){this._beginToken(10,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(11),this._cursor.advance(),this._endToken([])}_consumeCdata(e){this._beginToken(12,e),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(e){this._beginToken(18,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(19),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(){let e=this._cursor.clone(),r="";for(;this._cursor.peek()!==58&&!yo(this._cursor.peek());)this._cursor.advance();let n;this._cursor.peek()===58?(r=this._cursor.getChars(e),this._cursor.advance(),n=this._cursor.clone()):n=e,this._requireCharCodeUntilFn(Vs,r===""?0:1);let s=this._cursor.getChars(n);return[r,s]}_consumeTagOpen(e){let r,n,s,i=[];try{if(!lt(this._cursor.peek()))throw this._createError(Ue(this._cursor.peek()),this._cursor.getSpan(e));for(s=this._consumeTagOpenStart(e),n=s.parts[0],r=s.parts[1],this._attemptCharCodeUntilFn(b);this._cursor.peek()!==47&&this._cursor.peek()!==62&&this._cursor.peek()!==60&&this._cursor.peek()!==0;){let[o,u]=this._consumeAttributeName();if(this._attemptCharCodeUntilFn(b),this._attemptCharCode(61)){this._attemptCharCodeUntilFn(b);let p=this._consumeAttributeValue();i.push({prefix:o,name:u,value:p})}else i.push({prefix:o,name:u});this._attemptCharCodeUntilFn(b)}this._consumeTagOpenEnd()}catch(o){if(o instanceof Ct){s?s.type=4:(this._beginToken(5,e),this._endToken(["<"]));return}throw o}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===2)return;let a=this._getTagContentType(r,n,this._fullNameStack.length>0,i);this._handleFullNameStackForTagOpen(n,r),a===P.RAW_TEXT?this._consumeRawTextWithTagClose(n,r,!1):a===P.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(n,r,!0)}_consumeRawTextWithTagClose(e,r,n){this._consumeRawText(n,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(b),!this._attemptStrCaseInsensitive(e?`${e}:${r}`:r))?!1:(this._attemptCharCodeUntilFn(b),this._attemptCharCode(62))),this._beginToken(3),this._requireCharCodeUntilFn(s=>s===62,3),this._cursor.advance(),this._endToken([e,r]),this._handleFullNameStackForTagClose(e,r)}_consumeTagOpenStart(e){this._beginToken(0,e);let r=this._consumePrefixAndName();return this._endToken(r)}_consumeAttributeName(){let e=this._cursor.peek();if(e===39||e===34)throw this._createError(Ue(e),this._cursor.getSpan());this._beginToken(14);let r=this._consumePrefixAndName();return this._endToken(r),r}_consumeAttributeValue(){let e;if(this._cursor.peek()===39||this._cursor.peek()===34){let r=this._cursor.peek();this._consumeQuote(r);let n=()=>this._cursor.peek()===r;e=this._consumeWithInterpolation(16,17,n,n),this._consumeQuote(r)}else{let r=()=>Vs(this._cursor.peek());e=this._consumeWithInterpolation(16,17,r,r)}return e}_consumeQuote(e){this._beginToken(15),this._requireCharCode(e),this._endToken([String.fromCodePoint(e)])}_consumeTagOpenEnd(){let e=this._attemptCharCode(47)?2:1;this._beginToken(e),this._requireCharCode(62),this._endToken([])}_consumeTagClose(e){if(this._beginToken(3,e),this._attemptCharCodeUntilFn(b),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(b),this._requireCharCode(62),this._endToken([]);else{let[r,n]=this._consumePrefixAndName();this._attemptCharCodeUntilFn(b),this._requireCharCode(62),this._endToken([r,n]),this._handleFullNameStackForTagClose(r,n)}}_consumeExpansionFormStart(){this._beginToken(20),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(20),this._beginToken(7);let e=this._readUntil(44),r=this._processCarriageReturns(e);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([r]);else{let s=this._endToken([e]);r!==e&&this.nonNormalizedIcuExpressions.push(s)}this._requireCharCode(44),this._attemptCharCodeUntilFn(b),this._beginToken(7);let n=this._readUntil(44);this._endToken([n]),this._requireCharCode(44),this._attemptCharCodeUntilFn(b)}_consumeExpansionCaseStart(){this._beginToken(21);let e=this._readUntil(123).trim();this._endToken([e]),this._attemptCharCodeUntilFn(b),this._beginToken(22),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(b),this._expansionCaseStack.push(22)}_consumeExpansionCaseEnd(){this._beginToken(23),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(b),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(24),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(e,r,n,s){this._beginToken(e);let i=[];for(;!n();){let o=this._cursor.clone();this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(this._endToken([this._processCarriageReturns(i.join(""))],o),i.length=0,this._consumeInterpolation(r,o,s),this._beginToken(e)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(i.join(""))]),i.length=0,this._consumeEntity(e),this._beginToken(e)):i.push(this._readChar())}this._inInterpolation=!1;let a=this._processCarriageReturns(i.join(""));return this._endToken([a]),a}_consumeInterpolation(e,r,n){let s=[];this._beginToken(e,r),s.push(this._interpolationConfig.start);let i=this._cursor.clone(),a=null,o=!1;for(;this._cursor.peek()!==0&&(n===null||!n());){let u=this._cursor.clone();if(this._isTagStart()){this._cursor=u,s.push(this._getProcessedChars(i,u)),this._endToken(s);return}if(a===null)if(this._attemptStr(this._interpolationConfig.end)){s.push(this._getProcessedChars(i,u)),s.push(this._interpolationConfig.end),this._endToken(s);return}else this._attemptStr("//")&&(o=!0);let p=this._cursor.peek();this._cursor.advance(),p===92?this._cursor.advance():p===a?a=null:!o&&a===null&&Ot(p)&&(a=p)}s.push(this._getProcessedChars(i,this._cursor)),this._endToken(s)}_getProcessedChars(e,r){return this._processCarriageReturns(r.getChars(e))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._cursor.peek()===64||this._cursor.peek()===125))}_isTagStart(){if(this._cursor.peek()===60){let e=this._cursor.clone();e.advance();let r=e.peek();if(97<=r&&r<=122||65<=r&&r<=90||r===47||r===33)return!0}return!1}_isBlockStart(){if(this._tokenizeBlocks&&this._cursor.peek()===64){let e=this._cursor.clone();if(e.advance(),Ws(e.peek()))return!0}return!1}_readUntil(e){let r=this._cursor.clone();return this._attemptUntilChar(e),this._cursor.getChars(r)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===22}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===20}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;if(this._interpolationConfig){let e=this._cursor.clone(),r=this._attemptStr(this._interpolationConfig.start);return this._cursor=e,!r}return!0}_handleFullNameStackForTagOpen(e,r){let n=qe(e,r);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===n)&&this._fullNameStack.push(n)}_handleFullNameStackForTagClose(e,r){let n=qe(e,r);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===n&&this._fullNameStack.pop()}};function b(t){return!ut(t)||t===0}function Vs(t){return ut(t)||t===62||t===60||t===47||t===39||t===34||t===61||t===0}function yo(t){return(t<97||12257)}function wo(t){return t===59||t===0||!Ds(t)}function bo(t){return t===59||t===0||!lt(t)}function To(t){return t!==125}function xo(t,e){return Us(t)===Us(e)}function Us(t){return t>=97&&t<=122?t-97+65:t}function Ws(t){return lt(t)||Rt(t)||t===95}function zs(t){return t!==59&&b(t)}function ko(t){let e=[],r;for(let n=0;n0&&r.indexOf(e.peek())!==-1;)n===e&&(e=e.clone()),e.advance();let s=this.locationFromCursor(e),i=this.locationFromCursor(this),a=n!==e?this.locationFromCursor(n):s;return new h(s,i,a)}getChars(e){return this.input.substring(e.state.offset,this.state.offset)}charAt(e){return this.input.charCodeAt(e)}advanceState(e){if(e.offset>=this.end)throw this.state=e,new St('Unexpected character "EOF"',this);let r=this.charAt(e.offset);r===10?(e.line++,e.column=0):$t(r)||e.column++,e.offset++,this.updatePeek(e)}updatePeek(e){e.peek=e.offset>=this.end?0:this.charAt(e.offset)}locationFromCursor(e){return new ie(e.file,e.state.offset,e.state.line,e.state.column)}},zr=class t extends nr{constructor(e,r){e instanceof t?(super(e),this.internalState={...e.internalState}):(super(e,r),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new t(this)}getChars(e){let r=e.clone(),n="";for(;r.internalState.offsetthis.internalState.peek;if(e()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),e()===110)this.state.peek=10;else if(e()===114)this.state.peek=13;else if(e()===118)this.state.peek=11;else if(e()===116)this.state.peek=9;else if(e()===98)this.state.peek=8;else if(e()===102)this.state.peek=12;else if(e()===117)if(this.advanceState(this.internalState),e()===123){this.advanceState(this.internalState);let r=this.clone(),n=0;for(;e()!==125;)this.advanceState(this.internalState),n++;this.state.peek=this.decodeHexDigits(r,n)}else{let r=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,4)}else if(e()===120){this.advanceState(this.internalState);let r=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,2)}else if(Br(e())){let r="",n=0,s=this.clone();for(;Br(e())&&n<3;)s=this.clone(),r+=String.fromCodePoint(e()),this.advanceState(this.internalState),n++;this.state.peek=parseInt(r,8),this.internalState=s.internalState}else $t(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(e,r){let n=this.input.slice(e.internalState.offset,e.internalState.offset+r),s=parseInt(n,16);if(isNaN(s))throw e.state=e.internalState,new St("Invalid hexadecimal escape sequence",e);return s}},St=class{constructor(e,r){this.msg=e,this.cursor=r}};var L=class t extends Oe{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){super(r,n),this.elementName=e}},jr=class{constructor(e,r){this.rootNodes=e,this.errors=r}},sr=class{constructor(e){this.getTagDefinition=e}parse(e,r,n,s=!1,i){let a=D=>(I,...F)=>D(I.toLowerCase(),...F),o=s?this.getTagDefinition:a(this.getTagDefinition),u=D=>o(D).getContentType(),p=s?i:a(i),f=Ks(e,r,i?(D,I,F,c)=>{let g=p(D,I,F,c);return g!==void 0?g:u(D)}:u,n),d=n&&n.canSelfClose||!1,C=n&&n.allowHtmComponentClosingTags||!1,A=new Kr(f.tokens,o,d,C,s);return A.build(),new jr(A.rootNodes,f.errors.concat(A.errors))}},Kr=class t{constructor(e,r,n,s,i){this.tokens=e,this.getTagDefinition=r,this.canSelfClose=n,this.allowHtmComponentClosingTags=s,this.isTagNameCaseSensitive=i,this._index=-1,this._containerStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==34;)this._peek.type===0||this._peek.type===4?this._consumeStartTag(this._advance()):this._peek.type===3?(this._closeVoidElement(),this._consumeEndTag(this._advance())):this._peek.type===12?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===10?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===5||this._peek.type===7||this._peek.type===6?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===20?this._consumeExpansion(this._advance()):this._peek.type===25?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===27?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===29?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===30?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===18?this._consumeDocType(this._advance()):this._peek.type===33?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._advance();for(let e of this._containerStack)e instanceof te&&this.errors.push(L.create(e.name,e.sourceSpan,`Unclosed block "${e.name}"`))}_advance(){let e=this._peek;return this._index0)return this.errors=this.errors.concat(i.errors),null;let a=new h(e.sourceSpan.start,s.sourceSpan.end,e.sourceSpan.fullStart),o=new h(r.sourceSpan.start,s.sourceSpan.end,r.sourceSpan.fullStart);return new Yt(e.parts[0],i.rootNodes,a,e.sourceSpan,o)}_collectExpansionExpTokens(e){let r=[],n=[22];for(;;){if((this._peek.type===20||this._peek.type===22)&&n.push(this._peek.type),this._peek.type===23)if(Qs(n,22)){if(n.pop(),n.length===0)return r}else return this.errors.push(L.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===24)if(Qs(n,20))n.pop();else return this.errors.push(L.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===34)return this.errors.push(L.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;r.push(this._advance())}}_getText(e){let r=e.parts[0];if(r.length>0&&r[0]==` +`){let n=this._getClosestParentElement();n!=null&&n.children.length==0&&this.getTagDefinition(n.name).ignoreFirstLf&&(r=r.substring(1))}return r}_consumeText(e){let r=[e],n=e.sourceSpan,s=e.parts[0];if(s.length>0&&s[0]===` +`){let i=this._getContainer();i!=null&&i.children.length===0&&this.getTagDefinition(i.name).ignoreFirstLf&&(s=s.substring(1),r[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[s]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)e=this._advance(),r.push(e),e.type===8?s+=e.parts.join("").replace(/&([^;]+);/g,Xs):e.type===9?s+=e.parts[0]:s+=e.parts.join("");if(s.length>0){let i=e.sourceSpan;this._addToParent(new Wt(s,new h(n.start,i.end,n.fullStart,n.details),r))}}_closeVoidElement(){let e=this._getContainer();e instanceof Y&&this.getTagDefinition(e.name).isVoid&&this._containerStack.pop()}_consumeStartTag(e){let[r,n]=e.parts,s=[];for(;this._peek.type===14;)s.push(this._consumeAttr(this._advance()));let i=this._getElementFullName(r,n,this._getClosestParentElement()),a=!1;if(this._peek.type===2){this._advance(),a=!0;let C=this.getTagDefinition(i);this.canSelfClose||C.canSelfClose||Me(i)!==null||C.isVoid||this.errors.push(L.create(i,e.sourceSpan,`Only void, custom and foreign elements can be self closed "${e.parts[1]}"`))}else this._peek.type===1&&(this._advance(),a=!1);let o=this._peek.sourceSpan.fullStart,u=new h(e.sourceSpan.start,o,e.sourceSpan.fullStart),p=new h(e.sourceSpan.start,o,e.sourceSpan.fullStart),l=new h(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),f=new Y(i,s,[],u,p,void 0,l),d=this._getContainer();this._pushContainer(f,d instanceof Y&&this.getTagDefinition(d.name).isClosedByChild(f.name)),a?this._popContainer(i,Y,u):e.type===4&&(this._popContainer(i,Y,null),this.errors.push(L.create(i,u,`Opening tag "${i}" not terminated.`)))}_pushContainer(e,r){r&&this._containerStack.pop(),this._addToParent(e),this._containerStack.push(e)}_consumeEndTag(e){let r=this.allowHtmComponentClosingTags&&e.parts.length===0?null:this._getElementFullName(e.parts[0],e.parts[1],this._getClosestParentElement());if(r&&this.getTagDefinition(r).isVoid)this.errors.push(L.create(r,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popContainer(r,Y,e.sourceSpan)){let n=`Unexpected closing tag "${r}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(L.create(r,e.sourceSpan,n))}}_popContainer(e,r,n){let s=!1;for(let i=this._containerStack.length-1;i>=0;i--){let a=this._containerStack[i];if(Me(a.name)?a.name===e:(e==null||a.name.toLowerCase()===e.toLowerCase())&&a instanceof r)return a.endSourceSpan=n,a.sourceSpan.end=n!==null?n.end:a.sourceSpan.end,this._containerStack.splice(i,this._containerStack.length-i),!s;(a instanceof te||a instanceof Y&&!this.getTagDefinition(a.name).closedByParent)&&(s=!0)}return!1}_consumeAttr(e){let r=qe(e.parts[0],e.parts[1]),n=e.sourceSpan.end,s;this._peek.type===15&&(s=this._advance());let i="",a=[],o,u;if(this._peek.type===16)for(o=this._peek.sourceSpan,u=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let f=this._advance();a.push(f),f.type===17?i+=f.parts.join("").replace(/&([^;]+);/g,Xs):f.type===9?i+=f.parts[0]:i+=f.parts.join(""),u=n=f.sourceSpan.end}this._peek.type===15&&(u=n=this._advance().sourceSpan.end);let l=o&&u&&new h((s==null?void 0:s.sourceSpan.start)??o.start,u,(s==null?void 0:s.sourceSpan.fullStart)??o.fullStart);return new jt(r,i,new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),e.sourceSpan,l,a.length>0?a:void 0,void 0)}_consumeBlockOpen(e){let r=[];for(;this._peek.type===28;){let o=this._advance();r.push(new ht(o.parts[0],o.sourceSpan))}this._peek.type===26&&this._advance();let n=this._peek.sourceSpan.fullStart,s=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),i=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),a=new te(e.parts[0],r,[],s,e.sourceSpan,i);this._pushContainer(a,!1)}_consumeBlockClose(e){this._popContainer(null,te,e.sourceSpan)||this.errors.push(L.create(null,e.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(e){let r=[];for(;this._peek.type===28;){let o=this._advance();r.push(new ht(o.parts[0],o.sourceSpan))}let n=this._peek.sourceSpan.fullStart,s=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),i=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),a=new te(e.parts[0],r,[],s,e.sourceSpan,i);this._pushContainer(a,!1),this._popContainer(null,te,null),this.errors.push(L.create(e.parts[0],s,`Incomplete block "${e.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(e){let r=e.parts[0],n,s;if(this._peek.type!==31){this.errors.push(L.create(e.parts[0],e.sourceSpan,`Invalid @let declaration "${r}". Declaration must have a value.`));return}else n=this._advance();if(this._peek.type!==32){this.errors.push(L.create(e.parts[0],e.sourceSpan,`Unterminated @let declaration "${r}". Declaration must be terminated with a semicolon.`));return}else s=this._advance();let i=s.sourceSpan.fullStart,a=new h(e.sourceSpan.start,i,e.sourceSpan.fullStart),o=e.sourceSpan.toString().lastIndexOf(r),u=e.sourceSpan.start.moveBy(o),p=new h(u,e.sourceSpan.end),l=new ft(r,n.parts[0],a,p,n.sourceSpan);this._addToParent(l)}_consumeIncompleteLet(e){let r=e.parts[0]??"",n=r?` "${r}"`:"";if(r.length>0){let s=e.sourceSpan.toString().lastIndexOf(r),i=e.sourceSpan.start.moveBy(s),a=new h(i,e.sourceSpan.end),o=new h(e.sourceSpan.start,e.sourceSpan.start.moveBy(0)),u=new ft(r,"",e.sourceSpan,a,o);this._addToParent(u)}this.errors.push(L.create(e.parts[0],e.sourceSpan,`Incomplete @let declaration${n}. @let declarations must be written as \`@let = ;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let e=this._containerStack.length-1;e>-1;e--)if(this._containerStack[e]instanceof Y)return this._containerStack[e];return null}_addToParent(e){let r=this._getContainer();r===null?this.rootNodes.push(e):r.children.push(e)}_getElementFullName(e,r,n){if(e===""&&(e=this.getTagDefinition(r).implicitNamespacePrefix||"",e===""&&n!=null)){let s=ct(n.name)[1];this.getTagDefinition(s).preventNamespaceInheritance||(e=Me(n.name))}return qe(e,r)}};function Qs(t,e){return t.length>0&&t[t.length-1]===e}function Xs(t,e){return Ve[e]!==void 0?Ve[e]||t:/^#x[a-f0-9]+$/i.test(e)?String.fromCodePoint(parseInt(e.slice(2),16)):/^#\d+$/.test(e)?String.fromCodePoint(parseInt(e.slice(1),10)):t}var ir=class extends sr{constructor(){super(He)}parse(e,r,n,s=!1,i){return super.parse(e,r,n,s,i)}};var Qr=null,Bo=()=>(Qr||(Qr=new ir),Qr);function Xr(t,e={}){let{canSelfClose:r=!1,allowHtmComponentClosingTags:n=!1,isTagNameCaseSensitive:s=!1,getTagContentType:i,tokenizeAngularBlocks:a=!1,tokenizeAngularLetDeclaration:o=!1}=e;return Bo().parse(t,"angular-html-parser",{tokenizeExpansionForms:a,interpolationConfig:void 0,canSelfClose:r,allowHtmComponentClosingTags:n,tokenizeBlocks:a,tokenizeLet:o},s,i)}function Lo(t,e){let r=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(r,e)}var Js=Lo;var _t=3;function Fo(t){let e=t.slice(0,_t);if(e!=="---"&&e!=="+++")return;let r=t.indexOf(` +`,_t);if(r===-1)return;let n=t.slice(_t,r).trim(),s=t.indexOf(` +${e}`,r),i=n;if(i||(i=e==="+++"?"toml":"yaml"),s===-1&&e==="---"&&i==="yaml"&&(s=t.indexOf(` +...`,r)),s===-1)return;let a=s+1+_t,o=t.charAt(a+1);if(!/\s?/u.test(o))return;let u=t.slice(0,a);return{type:"front-matter",language:i,explicitLanguage:n,value:t.slice(r+1,s),startDelimiter:e,endDelimiter:u.slice(-_t),raw:u}}function No(t){let e=Fo(t);if(!e)return{content:t};let{raw:r}=e;return{frontMatter:e,content:w(!1,r,/[^\n]/gu," ")+t.slice(r.length)}}var Zs=No;var ar={attrs:!0,children:!0,cases:!0,expression:!0},ei=new Set(["parent"]),le,Jr,Zr,ze=class ze{constructor(e={}){At(this,le);cr(this,"type");cr(this,"parent");for(let r of new Set([...ei,...Object.keys(e)]))this.setProperty(r,e[r])}setProperty(e,r){if(this[e]!==r){if(e in ar&&(r=r.map(n=>this.createChild(n))),!ei.has(e)){this[e]=r;return}Object.defineProperty(this,e,{value:r,enumerable:!1,configurable:!0})}}map(e){let r;for(let n in ar){let s=this[n];if(s){let i=Po(s,a=>a.map(e));r!==s&&(r||(r=new ze({parent:this.parent})),r.setProperty(n,i))}}if(r)for(let n in this)n in ar||(r[n]=this[n]);return e(r||this)}walk(e){for(let r in ar){let n=this[r];if(n)for(let s=0;s[e.fullName,e.value]))}};le=new WeakSet,Jr=function(){return this.type==="angularIcuCase"?"expression":this.type==="angularIcuExpression"?"cases":"children"},Zr=function(){var e;return((e=this.parent)==null?void 0:e.$children)??[]};var or=ze;function Po(t,e){let r=t.map(e);return r.some((n,s)=>n!==t[s])?r:t}var Io=[{regex:/^(\[if([^\]]*)\]>)(.*?){try{return[!0,e(i,o).children]}catch{return[!1,[{type:"text",value:i,sourceSpan:new h(o,u)}]]}})();return{type:"ieConditionalComment",complete:p,children:l,condition:w(!1,s.trim(),/\s+/gu," "),sourceSpan:t.sourceSpan,startSourceSpan:new h(t.sourceSpan.start,o),endSourceSpan:new h(u,t.sourceSpan.end)}}function $o(t,e,r){let[,n]=r;return{type:"ieConditionalStartComment",condition:w(!1,n.trim(),/\s+/gu," "),sourceSpan:t.sourceSpan}}function Oo(t){return{type:"ieConditionalEndComment",sourceSpan:t.sourceSpan}}var ur=new Map([["*",new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alt","autocomplete","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]);var ri=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);function Mo(t){if(t.type==="block"){if(t.name=w(!1,t.name.toLowerCase(),/\s+/gu," ").trim(),t.type="angularControlFlowBlock",!Ie(t.parameters)){delete t.parameters;return}for(let e of t.parameters)e.type="angularControlFlowBlockParameter";t.parameters={type:"angularControlFlowBlockParameters",children:t.parameters,sourceSpan:new h(t.parameters[0].sourceSpan.start,K(!1,t.parameters,-1).sourceSpan.end)}}}function qo(t){t.type==="letDeclaration"&&(t.type="angularLetDeclaration",t.id=t.name,t.init={type:"angularLetDeclarationInitializer",sourceSpan:new h(t.valueSpan.start,t.valueSpan.end),value:t.value},delete t.name,delete t.value)}function Ho(t){(t.type==="plural"||t.type==="select")&&(t.clause=t.type,t.type="angularIcuExpression"),t.type==="expansionCase"&&(t.type="angularIcuCase")}function si(t,e,r){let{name:n,canSelfClose:s=!0,normalizeTagName:i=!1,normalizeAttributeName:a=!1,allowHtmComponentClosingTags:o=!1,isTagNameCaseSensitive:u=!1,shouldParseAsRawText:p}=e,{rootNodes:l,errors:f}=Xr(t,{canSelfClose:s,allowHtmComponentClosingTags:o,isTagNameCaseSensitive:u,getTagContentType:p?(...c)=>p(...c)?P.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:n==="angular"?!0:void 0,tokenizeAngularLetDeclaration:n==="angular"?!0:void 0});if(n==="vue"){if(l.some(x=>x.type==="docType"&&x.value==="html"||x.type==="element"&&x.name.toLowerCase()==="html"))return si(t,ai,r);let g,y=()=>g??(g=Xr(t,{canSelfClose:s,allowHtmComponentClosingTags:o,isTagNameCaseSensitive:u})),q=x=>y().rootNodes.find(({startSourceSpan:U})=>U&&U.start.offset===x.startSourceSpan.start.offset)??x;for(let[x,U]of l.entries()){let{endSourceSpan:tn,startSourceSpan:oi}=U;if(tn===null)f=y().errors,l[x]=q(U);else if(Vo(U,r)){let rn=y().errors.find(nn=>nn.span.start.offset>oi.start.offset&&nn.span.start.offset0&&ni(f[0]);let d=c=>{let g=c.name.startsWith(":")?c.name.slice(1).split(":")[0]:null,y=c.nameSpan.toString(),q=g!==null&&y.startsWith(`${g}:`),x=q?y.slice(g.length+1):y;c.name=x,c.namespace=g,c.hasExplicitNamespace=q},C=c=>{switch(c.type){case"element":d(c);for(let g of c.attrs)d(g),g.valueSpan?(g.value=g.valueSpan.toString(),/["']/u.test(g.value[0])&&(g.value=g.value.slice(1,-1))):g.value=null;break;case"comment":c.value=c.sourceSpan.toString().slice(4,-3);break;case"text":c.value=c.sourceSpan.toString();break}},A=(c,g)=>{let y=c.toLowerCase();return g(y)?y:c},D=c=>{if(c.type==="element"&&(i&&(!c.namespace||c.namespace===c.tagDefinition.implicitNamespacePrefix||fe(c))&&(c.name=A(c.name,g=>ri.has(g))),a))for(let g of c.attrs)g.namespace||(g.name=A(g.name,y=>ur.has(c.name)&&(ur.get("*").has(y)||ur.get(c.name).has(y))))},I=c=>{c.sourceSpan&&c.endSourceSpan&&(c.sourceSpan=new h(c.sourceSpan.start,c.endSourceSpan.end))},F=c=>{if(c.type==="element"){let g=He(u?c.name:c.name.toLowerCase());!c.namespace||c.namespace===g.implicitNamespacePrefix||fe(c)?c.tagDefinition=g:c.tagDefinition=He("")}};return Xt(new class extends mt{visitExpansionCase(c,g){n==="angular"&&this.visitChildren(g,y=>{y(c.expression)})}visit(c){C(c),F(c),D(c),I(c)}},l),l}function Vo(t,e){var n;if(t.type!=="element"||t.name!=="template")return!1;let r=(n=t.attrs.find(s=>s.name==="lang"))==null?void 0:n.value;return!r||Ne(e,{language:r})==="html"}function ni(t){let{msg:e,span:{start:r,end:n}}=t;throw Js(e,{loc:{start:{line:r.line+1,column:r.col+1},end:{line:n.line+1,column:n.col+1}},cause:t})}function ii(t,e,r={},n=!0){let{frontMatter:s,content:i}=n?Zs(t):{frontMatter:null,content:t},a=new De(t,r.filepath),o=new ie(a,0,0,0),u=o.moveBy(t.length),p={type:"root",sourceSpan:new h(o,u),children:si(i,e,r)};if(s){let d=new ie(a,0,0,0),C=d.moveBy(s.raw.length);s.sourceSpan=new h(d,C),p.children.unshift(s)}let l=new or(p),f=(d,C)=>{let{offset:A}=C,D=w(!1,t.slice(0,A),/[^\n\r]/gu," "),F=ii(D+d,e,r,!1);F.sourceSpan=new h(C,K(!1,F.children,-1).sourceSpan.end);let c=F.children[0];return c.length===A?F.children.shift():(c.sourceSpan=new h(c.sourceSpan.start.moveBy(A),c.sourceSpan.end),c.value=c.value.slice(A)),F};return l.walk(d=>{if(d.type==="comment"){let C=ti(d,f);C&&d.parent.replaceChild(d,C)}Mo(d),qo(d),Ho(d)}),l}function lr(t){return{parse:(e,r)=>ii(e,t,r),hasPragma:hs,astFormat:"html",locStart:J,locEnd:Z}}var ai={name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0},Uo=lr(ai),Wo=lr({name:"angular"}),zo=lr({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(t,e,r,n){return t.toLowerCase()!=="html"&&!r&&(t!=="template"||n.some(({name:s,value:i})=>s==="lang"&&i!=="html"&&i!==""&&i!==void 0))}}),Go=lr({name:"lwc",canSelfClose:!1});var Yo={html:bs};return fi(jo);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/html.mjs b/node_modules/prettier/plugins/html.mjs new file mode 100644 index 0000000..06f84c8 --- /dev/null +++ b/node_modules/prettier/plugins/html.mjs @@ -0,0 +1,22 @@ +var sn=Object.defineProperty;var an=t=>{throw TypeError(t)};var li=(t,e,r)=>e in t?sn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var on=(t,e)=>{for(var r in e)sn(t,r,{get:e[r],enumerable:!0})};var lr=(t,e,r)=>li(t,typeof e!="symbol"?e+"":e,r),un=(t,e,r)=>e.has(t)||an("Cannot "+r);var R=(t,e,r)=>(un(t,e,"read from private field"),r?r.call(t):e.get(t)),Et=(t,e,r)=>e.has(t)?an("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ln=(t,e,r,n)=>(un(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var en={};on(en,{languages:()=>xs,options:()=>Bs,parsers:()=>Zr,printers:()=>Uo});var ci=(t,e,r,n)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},w=ci;var ye="string",Ge="array",Ye="cursor",we="indent",be="align",je="trim",Te="group",xe="fill",ce="if-break",ke="indent-if-break",Ke="line-suffix",Qe="line-suffix-boundary",j="line",Xe="label",Be="break-parent",At=new Set([Ye,we,be,je,Te,xe,ce,ke,Ke,Qe,j,Xe,Be]);var pi=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},K=pi;function hi(t){if(typeof t=="string")return ye;if(Array.isArray(t))return Ge;if(!t)return;let{type:e}=t;if(At.has(e))return e}var Le=hi;var fi=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function mi(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', +Expected it to be 'string' or 'object'.`;if(Le(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=fi([...At].map(s=>`'${s}'`));return`Unexpected doc.type '${t.type}'. +Expected it to be ${n}.`}var cr=class extends Error{name="InvalidDocError";constructor(e){super(mi(e)),this.doc=e}},pr=cr;function hr(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(i){if(r.has(i))return r.get(i);let a=s(i);return r.set(i,a),a}function s(i){switch(Le(i)){case Ge:return e(i.map(n));case xe:return e({...i,parts:i.parts.map(n)});case ce:return e({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case Te:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(n),o=a[0]):o=n(o),e({...i,contents:o,expandedStates:a})}case be:case we:case ke:case Xe:case Ke:return e({...i,contents:n(i.contents)});case ye:case Ye:case je:case Qe:case j:case Be:return e(i);default:throw new pr(i)}}}function B(t,e=cn){return hr(t,r=>typeof r=="string"?H(e,r.split(` +`)):r)}var fr=()=>{},ne=fr,mr=fr,pn=fr;function k(t){return ne(t),{type:we,contents:t}}function hn(t,e){return ne(e),{type:be,contents:e,n:t}}function E(t,e={}){return ne(t),mr(e.expandedStates,!0),{type:Te,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function fn(t){return hn(Number.NEGATIVE_INFINITY,t)}function mn(t){return hn({type:"root"},t)}function Dt(t){return pn(t),{type:xe,parts:t}}function pe(t,e="",r={}){return ne(t),e!==""&&ne(e),{type:ce,breakContents:t,flatContents:e,groupId:r.groupId}}function dn(t,e){return ne(t),{type:ke,contents:t,groupId:e.groupId,negate:e.negate}}var se={type:Be};var gi={type:j,hard:!0},Ci={type:j,hard:!0,literal:!0},_={type:j},v={type:j,soft:!0},S=[gi,se],cn=[Ci,se];function H(t,e){ne(t),mr(e);let r=[];for(let n=0;ni?n:r}var Cn=Si;function dr(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var V,gr=class{constructor(e){Et(this,V);ln(this,V,new Set(e))}getLeadingWhitespaceCount(e){let r=R(this,V),n=0;for(let s=0;s=0&&r.has(e.charAt(s));s--)n++;return n}getLeadingWhitespace(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(0,r)}getTrailingWhitespace(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(e.length-r)}hasLeadingWhitespace(e){return R(this,V).has(e.charAt(0))}hasTrailingWhitespace(e){return R(this,V).has(K(!1,e,-1))}trimStart(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(r)}trimEnd(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-r)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,r=!1){let n=`[${dr([...R(this,V)].join(""))}]+`,s=new RegExp(r?`(${n})`:n,"u");return e.split(s)}hasWhitespaceCharacter(e){let r=R(this,V);return Array.prototype.some.call(e,n=>r.has(n))}hasNonWhitespaceCharacter(e){let r=R(this,V);return Array.prototype.some.call(e,n=>!r.has(n))}isWhitespaceOnly(e){let r=R(this,V);return Array.prototype.every.call(e,n=>r.has(n))}};V=new WeakMap;var Sn=gr;var _i=[" ",` +`,"\f","\r"," "],Ei=new Sn(_i),O=Ei;var Cr=class extends Error{name="UnexpectedNodeError";constructor(e,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},_n=Cr;function Ai(t){return(t==null?void 0:t.type)==="front-matter"}var Fe=Ai;var Di=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens","switchValueSourceSpan","expSourceSpan","valueSourceSpan"]),vi=new Set(["if","else if","for","switch","case"]);function En(t,e){var r;if(t.type==="text"||t.type==="comment"||Fe(t)||t.type==="yaml"||t.type==="toml")return null;if(t.type==="attribute"&&delete e.value,t.type==="docType"&&delete e.value,t.type==="angularControlFlowBlock"&&((r=t.parameters)!=null&&r.children))for(let n of e.parameters.children)vi.has(t.name)?delete n.expression:n.expression=n.expression.trim();t.type==="angularIcuExpression"&&(e.switchValue=t.switchValue.trim()),t.type==="angularLetDeclarationInitializer"&&delete e.value}En.ignoredProperties=Di;var An=En;async function yi(t,e){if(t.language==="yaml"){let r=t.value.trim(),n=r?await e(r,{parser:"yaml"}):"";return mn([t.startDelimiter,t.explicitLanguage,S,n,n?S:"",t.endDelimiter])}}var Dn=yi;function he(t,e=!0){return[k([v,t]),e?v:""]}function Q(t,e){let r=t.type==="NGRoot"?t.node.type==="NGMicrosyntax"&&t.node.body.length===1&&t.node.body[0].type==="NGMicrosyntaxExpression"?t.node.body[0].expression:t.node:t.type==="JsExpressionRoot"?t.node:t;return r&&(r.type==="ObjectExpression"||r.type==="ArrayExpression"||(e.parser==="__vue_expression"||e.parser==="__vue_ts_expression")&&(r.type==="TemplateLiteral"||r.type==="StringLiteral"))}async function T(t,e,r,n){r={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...r};let s=!0;n&&(r.__onHtmlBindingRoot=(a,o)=>{s=n(a,o)});let i=await e(t,r,e);return s?E(i):he(i)}function wi(t,e,r,n){let{node:s}=r,i=n.originalText.slice(s.sourceSpan.start.offset,s.sourceSpan.end.offset);return/^\s*$/u.test(i)?"":T(i,t,{parser:"__ng_directive",__isInHtmlAttribute:!1},Q)}var vn=wi;var bi=t=>String(t).split(/[/\\]/u).pop();function yn(t,e){if(!e)return;let r=bi(e).toLowerCase();return t.find(({filenames:n})=>n==null?void 0:n.some(s=>s.toLowerCase()===r))??t.find(({extensions:n})=>n==null?void 0:n.some(s=>r.endsWith(s)))}function Ti(t,e){if(e)return t.find(({name:r})=>r.toLowerCase()===e)??t.find(({aliases:r})=>r==null?void 0:r.includes(e))??t.find(({extensions:r})=>r==null?void 0:r.includes(`.${e}`))}function xi(t,e){let r=t.plugins.flatMap(s=>s.languages??[]),n=Ti(r,e.language)??yn(r,e.physicalFile)??yn(r,e.file)??(e.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var Ne=xi;var wn="inline",bn={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",search:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",menu:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",input:"inline-block",button:"inline-block",fieldset:"block",details:"block",summary:"block",marquee:"inline-block",source:"block",track:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",select:"inline-block",option:"block",optgroup:"block"},Tn="normal",xn={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function ki(t){return t.type==="element"&&!t.hasExplicitNamespace&&!["html","svg"].includes(t.namespace)}var fe=ki;var Bi=t=>w(!1,t,/^[\t\f\r ]*\n/gu,""),Sr=t=>Bi(O.trimEnd(t)),kn=t=>{let e=t,r=O.getLeadingWhitespace(e);r&&(e=e.slice(r.length));let n=O.getTrailingWhitespace(e);return n&&(e=e.slice(0,-n.length)),{leadingWhitespace:r,trailingWhitespace:n,text:e}};function yt(t,e){return!!(t.type==="ieConditionalComment"&&t.lastChild&&!t.lastChild.isSelfClosing&&!t.lastChild.endSourceSpan||t.type==="ieConditionalComment"&&!t.complete||me(t)&&t.children.some(r=>r.type!=="text"&&r.type!=="interpolation")||Tt(t,e)&&!W(t)&&t.type!=="interpolation")}function de(t){return t.type==="attribute"||!t.parent||!t.prev?!1:Li(t.prev)}function Li(t){return t.type==="comment"&&t.value.trim()==="prettier-ignore"}function $(t){return t.type==="text"||t.type==="comment"}function W(t){return t.type==="element"&&(t.fullName==="script"||t.fullName==="style"||t.fullName==="svg:style"||t.fullName==="svg:script"||fe(t)&&(t.name==="script"||t.name==="style"))}function Bn(t){return t.children&&!W(t)}function Ln(t){return W(t)||t.type==="interpolation"||_r(t)}function _r(t){return Vn(t).startsWith("pre")}function Fn(t,e){var s,i;let r=n();if(r&&!t.prev&&((i=(s=t.parent)==null?void 0:s.tagDefinition)!=null&&i.ignoreFirstLf))return t.type==="interpolation";return r;function n(){return Fe(t)||t.type==="angularControlFlowBlock"?!1:(t.type==="text"||t.type==="interpolation")&&t.prev&&(t.prev.type==="text"||t.prev.type==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:me(t.parent)?!0:!(!t.prev&&(t.parent.type==="root"||me(t)&&t.parent||W(t.parent)||et(t.parent,e)||!$i(t.parent.cssDisplay))||t.prev&&!qi(t.prev.cssDisplay))}}function Nn(t,e){return Fe(t)||t.type==="angularControlFlowBlock"?!1:(t.type==="text"||t.type==="interpolation")&&t.next&&(t.next.type==="text"||t.next.type==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:me(t.parent)?!0:!(!t.next&&(t.parent.type==="root"||me(t)&&t.parent||W(t.parent)||et(t.parent,e)||!Oi(t.parent.cssDisplay))||t.next&&!Mi(t.next.cssDisplay))}function Pn(t){return Hi(t.cssDisplay)&&!W(t)}function Je(t){return Fe(t)||t.next&&t.sourceSpan.end&&t.sourceSpan.end.line+10&&(["body","script","style"].includes(t.name)||t.children.some(e=>Ni(e)))||t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.type!=="text"&&$n(t.firstChild)&&(!t.lastChild.isTrailingSpaceSensitive||On(t.lastChild))}function Er(t){return t.type==="element"&&t.children.length>0&&(["html","head","ul","ol","select"].includes(t.name)||t.cssDisplay.startsWith("table")&&t.cssDisplay!=="table-cell")}function wt(t){return Mn(t)||t.prev&&Fi(t.prev)||Rn(t)}function Fi(t){return Mn(t)||t.type==="element"&&t.fullName==="br"||Rn(t)}function Rn(t){return $n(t)&&On(t)}function $n(t){return t.hasLeadingSpaces&&(t.prev?t.prev.sourceSpan.end.linet.sourceSpan.end.line:t.parent.type==="root"||t.parent.endSourceSpan&&t.parent.endSourceSpan.start.line>t.sourceSpan.end.line)}function Mn(t){switch(t.type){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return["script","select"].includes(t.name)}return!1}function bt(t){return t.lastChild?bt(t.lastChild):t}function Ni(t){var e;return(e=t.children)==null?void 0:e.some(r=>r.type!=="text")}function qn(t){if(t)switch(t){case"module":case"text/javascript":case"text/babel":case"application/javascript":return"babel";case"application/x-typescript":return"typescript";case"text/markdown":return"markdown";case"text/html":return"html";case"text/x-handlebars-template":return"glimmer";default:if(t.endsWith("json")||t.endsWith("importmap")||t==="speculationrules")return"json"}}function Pi(t,e){let{name:r,attrMap:n}=t;if(r!=="script"||Object.prototype.hasOwnProperty.call(n,"src"))return;let{type:s,lang:i}=t.attrMap;return!i&&!s?"babel":Ne(e,{language:i})??qn(s)}function Ii(t,e){if(!Tt(t,e))return;let{attrMap:r}=t;if(Object.prototype.hasOwnProperty.call(r,"src"))return;let{type:n,lang:s}=r;return Ne(e,{language:s})??qn(n)}function Ri(t,e){if(t.name!=="style")return;let{lang:r}=t.attrMap;return r?Ne(e,{language:r}):"css"}function Ar(t,e){return Pi(t,e)??Ri(t,e)??Ii(t,e)}function Ze(t){return t==="block"||t==="list-item"||t.startsWith("table")}function $i(t){return!Ze(t)&&t!=="inline-block"}function Oi(t){return!Ze(t)&&t!=="inline-block"}function Mi(t){return!Ze(t)}function qi(t){return!Ze(t)}function Hi(t){return!Ze(t)&&t!=="inline-block"}function me(t){return Vn(t).startsWith("pre")}function Vi(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.parent}return!1}function Hn(t,e){var n;if(ge(t,e))return"block";if(((n=t.prev)==null?void 0:n.type)==="comment"){let s=t.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/u);if(s)return s[1]}let r=!1;if(t.type==="element"&&t.namespace==="svg")if(Vi(t,s=>s.fullName==="svg:foreignObject"))r=!0;else return t.name==="svg"?"inline-block":"block";switch(e.htmlWhitespaceSensitivity){case"strict":return"inline";case"ignore":return"block";default:return t.type==="element"&&(!t.namespace||r||fe(t))&&bn[t.name]||wn}}function Vn(t){return t.type==="element"&&(!t.namespace||fe(t))&&xn[t.name]||Tn}function Ui(t){let e=Number.POSITIVE_INFINITY;for(let r of t.split(` +`)){if(r.length===0)continue;let n=O.getLeadingWhitespaceCount(r);if(n===0)return 0;r.length!==n&&nr.slice(e)).join(` +`)}function vr(t){return w(!1,w(!1,t,"'","'"),""",'"')}function N(t){return vr(t.value)}var Wi=new Set(["template","style","script"]);function et(t,e){return ge(t,e)&&!Wi.has(t.fullName)}function ge(t,e){return e.parser==="vue"&&t.type==="element"&&t.parent.type==="root"&&t.fullName.toLowerCase()!=="html"}function Tt(t,e){return ge(t,e)&&(et(t,e)||t.attrMap.lang&&t.attrMap.lang!=="html")}function Un(t){let e=t.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function Wn(t,e){let r=t.parent;if(!ge(r,e))return!1;let n=r.fullName,s=t.fullName;return n==="script"&&s==="setup"||n==="style"&&s==="vars"}function xt(t,e=t.value){return t.parent.isWhitespaceSensitive?t.parent.isIndentationSensitive?B(e):B(Dr(Sr(e)),S):H(_,O.split(e))}function kt(t,e){return ge(t,e)&&t.name==="script"}var yr=/\{\{(.+?)\}\}/su;async function zn(t,e){let r=[];for(let[n,s]of t.split(yr).entries())if(n%2===0)r.push(B(s));else try{r.push(E(["{{",k([_,await T(s,e,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),_,"}}"]))}catch{r.push("{{",B(s),"}}")}return r}function wr({parser:t}){return(e,r,n)=>T(N(n.node),e,{parser:t},Q)}var zi=wr({parser:"__ng_action"}),Gi=wr({parser:"__ng_binding"}),Yi=wr({parser:"__ng_directive"});function ji(t,e){if(e.parser!=="angular")return;let{node:r}=t,n=r.fullName;if(n.startsWith("(")&&n.endsWith(")")||n.startsWith("on-"))return zi;if(n.startsWith("[")&&n.endsWith("]")||/^bind(?:on)?-/u.test(n)||/^ng-(?:if|show|hide|class|style)$/u.test(n))return Gi;if(n.startsWith("*"))return Yi;let s=N(r);if(/^i18n(?:-.+)?$/u.test(n))return()=>he(Dt(xt(r,s.trim())),!s.includes("@@"));if(yr.test(s))return i=>zn(s,i)}var Gn=ji;function Ki(t,e){let{node:r}=t,n=N(r);if(r.fullName==="class"&&!e.parentParser&&!n.includes("{{"))return()=>n.trim().split(/\s+/u).join(" ")}var Yn=Ki;function jn(t){return t===" "||t===` +`||t==="\f"||t==="\r"||t===" "}var Qi=/^[ \t\n\r\u000c]+/,Xi=/^[, \t\n\r\u000c]+/,Ji=/^[^ \t\n\r\u000c]+/,Zi=/[,]+$/,Kn=/^\d+$/,ea=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ta(t){let e=t.length,r,n,s,i,a,o=0,u;function p(C){let A,D=C.exec(t.substring(o));if(D)return[A]=D,o+=A.length,A}let l=[];for(;;){if(p(Xi),o>=e){if(l.length===0)throw new Error("Must contain one or more image candidate strings.");return l}u=o,r=p(Ji),n=[],r.slice(-1)===","?(r=r.replace(Zi,""),d()):f()}function f(){for(p(Qi),s="",i="in descriptor";;){if(a=t.charAt(o),i==="in descriptor")if(jn(a))s&&(n.push(s),s="",i="after descriptor");else if(a===","){o+=1,s&&n.push(s),d();return}else if(a==="(")s+=a,i="in parens";else if(a===""){s&&n.push(s),d();return}else s+=a;else if(i==="in parens")if(a===")")s+=a,i="in descriptor";else if(a===""){n.push(s),d();return}else s+=a;else if(i==="after descriptor"&&!jn(a))if(a===""){d();return}else i="in descriptor",o-=1;o+=1}}function d(){let C=!1,A,D,I,F,c={},g,y,q,x,U;for(F=0;Fsa(N(t.node))}var Xn={width:"w",height:"h",density:"x"},na=Object.keys(Xn);function sa(t){let e=Qn(t),r=na.filter(l=>e.some(f=>Object.prototype.hasOwnProperty.call(f,l)));if(r.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[n]=r,s=Xn[n],i=e.map(l=>l.source.value),a=Math.max(...i.map(l=>l.length)),o=e.map(l=>l[n]?String(l[n].value):""),u=o.map(l=>{let f=l.indexOf(".");return f===-1?l.length:f}),p=Math.max(...u);return he(H([",",_],i.map((l,f)=>{let d=[l],C=o[f];if(C){let A=a-l.length+1,D=p-u[f],I=" ".repeat(A+D);d.push(pe(I," "),C+s)}return d})))}var Jn=ra;function Zn(t,e){let{node:r}=t,n=N(t.node).trim();if(r.fullName==="style"&&!e.parentParser&&!n.includes("{{"))return async s=>he(await s(n,{parser:"css",__isHTMLStyleAttribute:!0}))}var br=new WeakMap;function ia(t,e){let{root:r}=t;return br.has(r)||br.set(r,r.children.some(n=>kt(n,e)&&["ts","typescript"].includes(n.attrMap.lang))),br.get(r)}var Pe=ia;function es(t,e,r){let{node:n}=r,s=N(n);return T(`type T<${s}> = any`,t,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},Q)}function ts(t,e,{parseWithTs:r}){return T(`function _(${t}) {}`,e,{parser:r?"babel-ts":"babel",__isVueBindings:!0})}async function rs(t,e,r,n){let s=N(r.node),{left:i,operator:a,right:o}=aa(s),u=Pe(r,n);return[E(await T(`function _(${i}) {}`,t,{parser:u?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await T(o,t,{parser:u?"__ts_expression":"__js_expression"})]}function aa(t){let e=/(.*?)\s+(in|of)\s+(.*)/su,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,n=/^\(|\)$/gu,s=t.match(e);if(!s)return;let i={};if(i.for=s[3].trim(),!i.for)return;let a=w(!1,s[1].trim(),n,""),o=a.match(r);o?(i.alias=a.replace(r,""),i.iterator1=o[1].trim(),o[2]&&(i.iterator2=o[2].trim())):i.alias=a;let u=[i.alias,i.iterator1,i.iterator2];if(!u.some((p,l)=>!p&&(l===0||u.slice(l+1).some(Boolean))))return{left:u.filter(Boolean).join(","),operator:s[2],right:i.for}}function oa(t,e){if(e.parser!=="vue")return;let{node:r}=t,n=r.fullName;if(n==="v-for")return rs;if(n==="generic"&&kt(r.parent,e))return es;let s=N(r),i=Pe(t,e);if(Un(r)||Wn(r,e))return a=>ts(s,a,{parseWithTs:i});if(n.startsWith("@")||n.startsWith("v-on:"))return a=>ua(s,a,{parseWithTs:i});if(n.startsWith(":")||n.startsWith(".")||n.startsWith("v-bind:"))return a=>la(s,a,{parseWithTs:i});if(n.startsWith("v-"))return a=>ns(s,a,{parseWithTs:i})}async function ua(t,e,{parseWithTs:r}){var n;try{return await ns(t,e,{parseWithTs:r})}catch(s){if(((n=s.cause)==null?void 0:n.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw s}return T(t,e,{parser:r?"__vue_ts_event_binding":"__vue_event_binding"},Q)}function la(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__vue_ts_expression":"__vue_expression"},Q)}function ns(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__ts_expression":"__js_expression"},Q)}var ss=oa;function ca(t,e){let{node:r}=t;if(r.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(e.originalText.slice(r.valueSpan.start.offset,r.valueSpan.end.offset))||e.parser==="lwc"&&r.value.startsWith("{")&&r.value.endsWith("}"))return[r.rawName,"=",r.value];for(let n of[Jn,Zn,Yn,ss,Gn]){let s=n(t,e);if(s)return pa(s)}}}function pa(t){return async(e,r,n,s)=>{let i=await t(e,r,n,s);if(i)return i=hr(i,a=>typeof a=="string"?w(!1,a,'"',"""):a),[n.node.rawName,'="',E(i),'"']}}var is=ca;var as=new Proxy(()=>{},{get:()=>as}),Tr=as;function ha(t){return Array.isArray(t)&&t.length>0}var Ie=ha;function J(t){return t.sourceSpan.start.offset}function Z(t){return t.sourceSpan.end.offset}function tt(t,e){return[t.isSelfClosing?"":fa(t,e),Ce(t,e)]}function fa(t,e){return t.lastChild&&Ee(t.lastChild)?"":[ma(t,e),Bt(t,e)]}function Ce(t,e){return(t.next?X(t.next):_e(t.parent))?"":[Se(t,e),z(t,e)]}function ma(t,e){return _e(t)?Se(t.lastChild,e):""}function z(t,e){return Ee(t)?Bt(t.parent,e):rt(t)?Lt(t.next,e):""}function Bt(t,e){if(Tr.ok(!t.isSelfClosing),us(t,e))return"";switch(t.type){case"ieConditionalComment":return"";case"ieConditionalStartComment":return"]>";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function us(t,e){return!t.isSelfClosing&&!t.endSourceSpan&&(de(t)||yt(t.parent,e))}function X(t){return t.prev&&t.prev.type!=="docType"&&t.type!=="angularControlFlowBlock"&&!$(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function _e(t){var e;return((e=t.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!$(bt(t.lastChild))&&!me(t)}function Ee(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&$(bt(t))}function rt(t){return t.next&&!$(t.next)&&$(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function da(t){let e=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return e?e[1]?e[1].split(/\s+/u):!0:!1}function nt(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function ga(t,e,r){var f;let{node:n}=t;if(!Ie(n.attrs))return n.isSelfClosing?" ":"";let s=((f=n.prev)==null?void 0:f.type)==="comment"&&da(n.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?d=>s.includes(d.rawName):()=>!1,a=t.map(({node:d})=>i(d)?B(e.originalText.slice(J(d),Z(d))):r(),"attrs"),o=n.type==="element"&&n.fullName==="script"&&n.attrs.length===1&&n.attrs[0].fullName==="src"&&n.children.length===0,p=e.singleAttributePerLine&&n.attrs.length>1&&!ge(n,e)?S:_,l=[k([o?" ":_,H(p,a)])];return n.firstChild&&nt(n.firstChild)||n.isSelfClosing&&_e(n.parent)||o?l.push(n.isSelfClosing?" ":""):l.push(e.bracketSameLine?n.isSelfClosing?" ":"":n.isSelfClosing?_:v),l}function Ca(t){return t.firstChild&&nt(t.firstChild)?"":Ft(t)}function st(t,e,r){let{node:n}=t;return[Ae(n,e),ga(t,e,r),n.isSelfClosing?"":Ca(n)]}function Ae(t,e){return t.prev&&rt(t.prev)?"":[G(t,e),Lt(t,e)]}function G(t,e){return nt(t)?Ft(t.parent):X(t)?Se(t.prev,e):""}var os="<${t.rawName}`;default:return`<${t.rawName}`}}function Ft(t){switch(Tr.ok(!t.isSelfClosing),t.type){case"ieConditionalComment":return"]>";case"element":if(t.condition)return">";default:return">"}}function Sa(t,e){if(!t.endSourceSpan)return"";let r=t.startSourceSpan.end.offset;t.firstChild&&nt(t.firstChild)&&(r-=Ft(t).length);let n=t.endSourceSpan.start.offset;return t.lastChild&&Ee(t.lastChild)?n+=Bt(t,e).length:_e(t)&&(n-=Se(t.lastChild,e).length),e.originalText.slice(r,n)}var Nt=Sa;var _a=new Set(["if","else if","for","switch","case"]);function Ea(t,e){let{node:r}=t;switch(r.type){case"element":if(W(r)||r.type==="interpolation")return;if(!r.isSelfClosing&&Tt(r,e)){let n=Ar(r,e);return n?async(s,i)=>{let a=Nt(r,e),o=/^\s*$/u.test(a),u="";return o||(u=await s(Sr(a),{parser:n,__embeddedInHtml:!0}),o=u===""),[G(r,e),E(st(t,e,i)),o?"":S,u,o?"":S,tt(r,e),z(r,e)]}:void 0}break;case"text":if(W(r.parent)){let n=Ar(r.parent,e);if(n)return async s=>{let i=n==="markdown"?Dr(r.value.replace(/^[^\S\n]*\n/u,"")):r.value,a={parser:n,__embeddedInHtml:!0};if(e.parser==="html"&&n==="babel"){let o="script",{attrMap:u}=r.parent;u&&(u.type==="module"||u.type==="text/babel"&&u["data-type"]==="module")&&(o="module"),a.__babelSourceType=o}return[se,G(r,e),await s(i,a),z(r,e)]}}else if(r.parent.type==="interpolation")return async n=>{let s={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return e.parser==="angular"?s.parser="__ng_interpolation":e.parser==="vue"?s.parser=Pe(t,e)?"__vue_ts_expression":"__vue_expression":s.parser="__js_expression",[k([_,await n(r.value,s)]),r.parent.next&&X(r.parent.next)?" ":_]};break;case"attribute":return is(t,e);case"front-matter":return n=>Dn(r,n);case"angularControlFlowBlockParameters":return _a.has(t.parent.name)?vn:void 0;case"angularLetDeclarationInitializer":return n=>T(r.value,n,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var ls=Ea;var it=null;function at(t){if(it!==null&&typeof it.property){let e=it;return it=at.prototype=null,e}return it=at.prototype=t??Object.create(null),new at}var Aa=10;for(let t=0;t<=Aa;t++)at();function xr(t){return at(t)}function Da(t,e="type"){xr(t);function r(n){let s=n[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return i}return r}var cs=Da;var va={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},ps=va;var ya=cs(ps),hs=ya;function fs(t){return/^\s*/u.test(t)}function ms(t){return` + +`+t}var ds=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function gs(t){let e=Z(t);return t.type==="element"&&!t.endSourceSpan&&Ie(t.children)?Math.max(e,gs(K(!1,t.children,-1))):e}function ot(t,e,r){let n=t.node;if(de(n)){let s=gs(n);return[G(n,e),B(O.trimEnd(e.originalText.slice(J(n)+(n.prev&&rt(n.prev)?Lt(n).length:0),s-(n.next&&X(n.next)?Se(n,e).length:0)))),z(n,e)]}return r()}function Pt(t,e){return $(t)&&$(e)?t.isTrailingSpaceSensitive?t.hasTrailingSpaces?wt(e)?S:_:"":wt(e)?S:v:rt(t)&&(de(e)||e.firstChild||e.isSelfClosing||e.type==="element"&&e.attrs.length>0)||t.type==="element"&&t.isSelfClosing&&X(e)?"":!e.isLeadingSpaceSensitive||wt(e)||X(e)&&t.lastChild&&Ee(t.lastChild)&&t.lastChild.lastChild&&Ee(t.lastChild.lastChild)?S:e.hasLeadingSpaces?_:v}function Re(t,e,r){let{node:n}=t;if(Er(n))return[se,...t.map(i=>{let a=i.node,o=a.prev?Pt(a.prev,a):"";return[o?[o,Je(a.prev)?S:""]:"",ot(i,e,r)]},"children")];let s=n.children.map(()=>Symbol(""));return t.map((i,a)=>{let o=i.node;if($(o)){if(o.prev&&$(o.prev)){let A=Pt(o.prev,o);if(A)return Je(o.prev)?[S,S,ot(i,e,r)]:[A,ot(i,e,r)]}return ot(i,e,r)}let u=[],p=[],l=[],f=[],d=o.prev?Pt(o.prev,o):"",C=o.next?Pt(o,o.next):"";return d&&(Je(o.prev)?u.push(S,S):d===S?u.push(S):$(o.prev)?p.push(d):p.push(pe("",v,{groupId:s[a-1]}))),C&&(Je(o)?$(o.next)&&f.push(S,S):C===S?$(o.next)&&f.push(S):l.push(C)),[...u,E([...p,E([ot(i,e,r),...l],{id:s[a]})]),...f]},"children")}function Cs(t,e,r){let{node:n}=t,s=[];wa(t)&&s.push("} "),s.push("@",n.name),n.parameters&&s.push(" (",E(r("parameters")),")"),s.push(" {");let i=Ss(n);return n.children.length>0?(n.firstChild.hasLeadingSpaces=!0,n.lastChild.hasTrailingSpaces=!0,s.push(k([S,Re(t,e,r)])),i&&s.push(S,"}")):i&&s.push("}"),E(s,{shouldBreak:!0})}function Ss(t){var e,r;return!(((e=t.next)==null?void 0:e.type)==="angularControlFlowBlock"&&((r=ds.get(t.name))!=null&&r.has(t.next.name)))}function wa(t){let{previous:e}=t;return(e==null?void 0:e.type)==="angularControlFlowBlock"&&!de(e)&&!Ss(e)}function _s(t,e,r){return[k([v,H([";",_],t.map(r,"children"))]),v]}function Es(t,e,r){let{node:n}=t;return[Ae(n,e),E([n.switchValue.trim(),", ",n.clause,n.cases.length>0?[",",k([_,H(_,t.map(r,"cases"))])]:"",v]),Ce(n,e)]}function As(t,e,r){let{node:n}=t;return[n.value," {",E([k([v,t.map(({node:s,isLast:i})=>{let a=[r()];return s.type==="text"&&(s.hasLeadingSpaces&&a.unshift(_),s.hasTrailingSpaces&&!i&&a.push(_)),a},"expression")]),v]),"}"]}function Ds(t,e,r){let{node:n}=t;if(yt(n,e))return[G(n,e),E(st(t,e,r)),B(Nt(n,e)),...tt(n,e),z(n,e)];let s=n.children.length===1&&(n.firstChild.type==="interpolation"||n.firstChild.type==="angularIcuExpression")&&n.firstChild.isLeadingSpaceSensitive&&!n.firstChild.hasLeadingSpaces&&n.lastChild.isTrailingSpaceSensitive&&!n.lastChild.hasTrailingSpaces,i=Symbol("element-attr-group-id"),a=l=>E([E(st(t,e,r),{id:i}),l,tt(n,e)]),o=l=>s?dn(l,{groupId:i}):(W(n)||et(n,e))&&n.parent.type==="root"&&e.parser==="vue"&&!e.vueIndentScriptAndStyle?l:k(l),u=()=>s?pe(v,"",{groupId:i}):n.firstChild.hasLeadingSpaces&&n.firstChild.isLeadingSpaceSensitive?_:n.firstChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive?fn(v):v,p=()=>(n.next?X(n.next):_e(n.parent))?n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?" ":"":s?pe(v,"",{groupId:i}):n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?_:(n.lastChild.type==="comment"||n.lastChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${e.tabWidth*(t.ancestors.length-1)}}$`,"u").test(n.lastChild.value)?"":v;return n.children.length===0?a(n.hasDanglingSpaces&&n.isDanglingSpaceSensitive?_:""):a([In(n)?se:"",o([u(),Re(t,e,r)]),p()])}function ut(t){return t>=9&&t<=32||t==160}function It(t){return 48<=t&&t<=57}function lt(t){return t>=97&&t<=122||t>=65&&t<=90}function vs(t){return t>=97&&t<=102||t>=65&&t<=70||It(t)}function Rt(t){return t===10||t===13}function kr(t){return 48<=t&&t<=55}function $t(t){return t===39||t===34||t===96}var ba=/-+([a-z0-9])/g;function ws(t){return t.replace(ba,(...e)=>e[1].toUpperCase())}var ie=class t{constructor(e,r,n,s){this.file=e,this.offset=r,this.line=n,this.col=s}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let r=this.file.content,n=r.length,s=this.offset,i=this.line,a=this.col;for(;s>0&&e<0;)if(s--,e++,r.charCodeAt(s)==10){i--;let u=r.substring(0,s-1).lastIndexOf(String.fromCharCode(10));a=u>0?s-u:s}else a--;for(;s0;){let o=r.charCodeAt(s);s++,e--,o==10?(i++,a=0):a++}return new t(this.file,s,i,a)}getContext(e,r){let n=this.file.content,s=this.offset;if(s!=null){s>n.length-1&&(s=n.length-1);let i=s,a=0,o=0;for(;a0&&(s--,a++,!(n[s]==` +`&&++o==r)););for(a=0,o=0;a]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var Ta=[ka,Ba,Fa,Pa,Ia,Oa,Ra,$a,Ma,Na];function xa(t,e){for(let r of Ta)r(t,e);return t}function ka(t){t.walk(e=>{if(e.type==="element"&&e.tagDefinition.ignoreFirstLf&&e.children.length>0&&e.children[0].type==="text"&&e.children[0].value[0]===` +`){let r=e.children[0];r.value.length===1?e.removeChild(r):r.value=r.value.slice(1)}})}function Ba(t){let e=r=>{var n,s;return r.type==="element"&&((n=r.prev)==null?void 0:n.type)==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&((s=r.firstChild)==null?void 0:s.type)==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset};t.walk(r=>{if(r.children)for(let n=0;n{if(n.children)for(let s=0;se.type==="cdata",e=>``)}function Na(t){let e=r=>{var n,s;return r.type==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.type==="text"&&!O.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&((n=r.prev)==null?void 0:n.type)==="text"&&((s=r.next)==null?void 0:s.type)==="text"};t.walk(r=>{if(r.children)for(let n=0;n`+s.firstChild.value+``+a.value,i.sourceSpan=new h(i.sourceSpan.start,a.sourceSpan.end),i.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,i.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(s),n--,r.removeChild(a)}})}function Pa(t,e){if(e.parser==="html")return;let r=/\{\{(.+?)\}\}/su;t.walk(n=>{if(Bn(n))for(let s of n.children){if(s.type!=="text")continue;let i=s.sourceSpan.start,a=null,o=s.value.split(r);for(let u=0;u0&&n.insertChildBefore(s,{type:"text",value:p,sourceSpan:new h(i,a)});continue}a=i.moveBy(p.length+4),n.insertChildBefore(s,{type:"interpolation",sourceSpan:new h(i,a),children:p.length===0?[]:[{type:"text",value:p,sourceSpan:new h(i.moveBy(2),a.moveBy(-2))}]})}n.removeChild(s)}})}function Ia(t){t.walk(e=>{let r=e.$children;if(!r)return;if(r.length===0||r.length===1&&r[0].type==="text"&&O.trim(r[0].value).length===0){e.hasDanglingSpaces=r.length>0,e.$children=[];return}let n=Ln(e),s=_r(e);if(!n)for(let i=0;i{e.isSelfClosing=!e.children||e.type==="element"&&(e.tagDefinition.isVoid||e.endSourceSpan&&e.startSourceSpan.start===e.endSourceSpan.start&&e.startSourceSpan.end===e.endSourceSpan.end)})}function $a(t,e){t.walk(r=>{r.type==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/u.test(e.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function Oa(t,e){t.walk(r=>{r.cssDisplay=Hn(r,e)})}function Ma(t,e){t.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=Pn(r);return}for(let s of n)s.isLeadingSpaceSensitive=Fn(s,e),s.isTrailingSpaceSensitive=Nn(s,e);for(let s=0;s of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var ks="HTML",Va={bracketSameLine:Br.bracketSameLine,htmlWhitespaceSensitivity:{category:ks,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:Br.singleAttributePerLine,vueIndentScriptAndStyle:{category:ks,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},Bs=Va;var Zr={};on(Zr,{angular:()=>qo,html:()=>Mo,lwc:()=>Vo,vue:()=>Ho});var xp=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var Ls;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom"})(Ls||(Ls={}));var Fs;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default"})(Fs||(Fs={}));var Ns;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(Ns||(Ns={}));var Lr={name:"custom-elements"},Fr={name:"no-errors-schema"};var ee;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL"})(ee||(ee={}));var Ps;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(Ps||(Ps={}));var P;(function(t){t[t.RAW_TEXT=0]="RAW_TEXT",t[t.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",t[t.PARSABLE_DATA=2]="PARSABLE_DATA"})(P||(P={}));function ct(t,e=!0){if(t[0]!=":")return[null,t];let r=t.indexOf(":",1);if(r===-1){if(e)throw new Error(`Unsupported format "${t}" expecting ":namespace:name"`);return[null,t]}return[t.slice(1,r),t.slice(r+1)]}function Nr(t){return ct(t)[1]==="ng-container"}function Pr(t){return ct(t)[1]==="ng-content"}function Me(t){return t===null?null:ct(t)[0]}function qe(t,e){return t?`:${t}:${e}`:e}var qt;function Ir(){return qt||(qt={},Mt(ee.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),Mt(ee.STYLE,["*|style"]),Mt(ee.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]),Mt(ee.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])),qt}function Mt(t,e){for(let r of e)qt[r.toLowerCase()]=t}var Ht=class{};var Ua="boolean",Wa="number",za="string",Ga="object",Ya=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"],Is=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),ja=Array.from(Is).reduce((t,[e,r])=>(t.set(e,r),t),new Map),Vt=class extends Ht{constructor(){super(),this._schema=new Map,this._eventSchema=new Map,Ya.forEach(e=>{let r=new Map,n=new Set,[s,i]=e.split("|"),a=i.split(","),[o,u]=s.split("^");o.split(",").forEach(l=>{this._schema.set(l.toLowerCase(),r),this._eventSchema.set(l.toLowerCase(),n)});let p=u&&this._schema.get(u.toLowerCase());if(p){for(let[l,f]of p)r.set(l,f);for(let l of this._eventSchema.get(u.toLowerCase()))n.add(l)}a.forEach(l=>{if(l.length>0)switch(l[0]){case"*":n.add(l.substring(1));break;case"!":r.set(l.substring(1),Ua);break;case"#":r.set(l.substring(1),Wa);break;case"%":r.set(l.substring(1),Ga);break;default:r.set(l,za)}})})}hasProperty(e,r,n){if(n.some(i=>i.name===Fr.name))return!0;if(e.indexOf("-")>-1){if(Nr(e)||Pr(e))return!1;if(n.some(i=>i.name===Lr.name))return!0}return(this._schema.get(e.toLowerCase())||this._schema.get("unknown")).has(r)}hasElement(e,r){return r.some(n=>n.name===Fr.name)||e.indexOf("-")>-1&&(Nr(e)||Pr(e)||r.some(n=>n.name===Lr.name))?!0:this._schema.has(e.toLowerCase())}securityContext(e,r,n){n&&(r=this.getMappedPropName(r)),e=e.toLowerCase(),r=r.toLowerCase();let s=Ir()[e+"|"+r];return s||(s=Ir()["*|"+r],s||ee.NONE)}getMappedPropName(e){return Is.get(e)??e}getDefaultComponentElementName(){return"ng-component"}validateProperty(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${e}' is disallowed for security reasons, please use (${e.slice(2)})=... +If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){let r=this._schema.get(e.toLowerCase())||this._schema.get("unknown");return Array.from(r.keys()).map(n=>ja.get(n)??n)}allKnownEventsOfElement(e){return Array.from(this._eventSchema.get(e.toLowerCase())??[])}normalizeAnimationStyleProperty(e){return ws(e)}normalizeAnimationStyleValue(e,r,n){let s="",i=n.toString().trim(),a=null;if(Ka(e)&&n!==0&&n!=="0")if(typeof n=="number")s="px";else{let o=n.match(/^[+-]?[\d\.]+([a-z]*)$/);o&&o[1].length==0&&(a=`Please provide a CSS unit value for ${r}:${n}`)}return{error:a,value:i+s}}};function Ka(t){switch(t){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var m=class{constructor({closedByChildren:e,implicitNamespacePrefix:r,contentType:n=P.PARSABLE_DATA,closedByParent:s=!1,isVoid:i=!1,ignoreFirstLf:a=!1,preventNamespaceInheritance:o=!1,canSelfClose:u=!1}={}){this.closedByChildren={},this.closedByParent=!1,e&&e.length>0&&e.forEach(p=>this.closedByChildren[p]=!0),this.isVoid=i,this.closedByParent=s||i,this.implicitNamespacePrefix=r||null,this.contentType=n,this.ignoreFirstLf=a,this.preventNamespaceInheritance=o,this.canSelfClose=u??i}isClosedByChild(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}getContentType(e){return typeof this.contentType=="object"?(e===void 0?void 0:this.contentType[e])??this.contentType.default:this.contentType}},Rs,pt;function He(t){return pt||(Rs=new m({canSelfClose:!0}),pt=Object.assign(Object.create(null),{base:new m({isVoid:!0}),meta:new m({isVoid:!0}),area:new m({isVoid:!0}),embed:new m({isVoid:!0}),link:new m({isVoid:!0}),img:new m({isVoid:!0}),input:new m({isVoid:!0}),param:new m({isVoid:!0}),hr:new m({isVoid:!0}),br:new m({isVoid:!0}),source:new m({isVoid:!0}),track:new m({isVoid:!0}),wbr:new m({isVoid:!0}),p:new m({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new m({closedByChildren:["tbody","tfoot"]}),tbody:new m({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new m({closedByChildren:["tbody"],closedByParent:!0}),tr:new m({closedByChildren:["tr"],closedByParent:!0}),td:new m({closedByChildren:["td","th"],closedByParent:!0}),th:new m({closedByChildren:["td","th"],closedByParent:!0}),col:new m({isVoid:!0}),svg:new m({implicitNamespacePrefix:"svg"}),foreignObject:new m({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new m({implicitNamespacePrefix:"math"}),li:new m({closedByChildren:["li"],closedByParent:!0}),dt:new m({closedByChildren:["dt","dd"]}),dd:new m({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new m({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new m({closedByChildren:["optgroup"],closedByParent:!0}),option:new m({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new m({ignoreFirstLf:!0}),listing:new m({ignoreFirstLf:!0}),style:new m({contentType:P.RAW_TEXT}),script:new m({contentType:P.RAW_TEXT}),title:new m({contentType:{default:P.ESCAPABLE_RAW_TEXT,svg:P.PARSABLE_DATA}}),textarea:new m({contentType:P.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new Vt().allKnownElementNames().forEach(e=>{!pt[e]&&Me(e)===null&&(pt[e]=new m({canSelfClose:!1}))})),pt[t]??Rs}var ae=class{constructor(e,r){this.sourceSpan=e,this.i18n=r}},Ut=class extends ae{constructor(e,r,n,s){super(r,s),this.value=e,this.tokens=n,this.type="text"}visit(e,r){return e.visitText(this,r)}},Wt=class extends ae{constructor(e,r,n,s){super(r,s),this.value=e,this.tokens=n,this.type="cdata"}visit(e,r){return e.visitCdata(this,r)}},zt=class extends ae{constructor(e,r,n,s,i,a){super(s,a),this.switchValue=e,this.type=r,this.cases=n,this.switchValueSourceSpan=i}visit(e,r){return e.visitExpansion(this,r)}},Gt=class{constructor(e,r,n,s,i){this.value=e,this.expression=r,this.sourceSpan=n,this.valueSourceSpan=s,this.expSourceSpan=i,this.type="expansionCase"}visit(e,r){return e.visitExpansionCase(this,r)}},Yt=class extends ae{constructor(e,r,n,s,i,a,o){super(n,o),this.name=e,this.value=r,this.keySpan=s,this.valueSpan=i,this.valueTokens=a,this.type="attribute"}visit(e,r){return e.visitAttribute(this,r)}get nameSpan(){return this.keySpan}},Y=class extends ae{constructor(e,r,n,s,i,a=null,o=null,u){super(s,u),this.name=e,this.attrs=r,this.children=n,this.startSourceSpan=i,this.endSourceSpan=a,this.nameSpan=o,this.type="element"}visit(e,r){return e.visitElement(this,r)}},jt=class{constructor(e,r){this.value=e,this.sourceSpan=r,this.type="comment"}visit(e,r){return e.visitComment(this,r)}},Kt=class{constructor(e,r){this.value=e,this.sourceSpan=r,this.type="docType"}visit(e,r){return e.visitDocType(this,r)}},te=class extends ae{constructor(e,r,n,s,i,a,o=null,u){super(s,u),this.name=e,this.parameters=r,this.children=n,this.nameSpan=i,this.startSourceSpan=a,this.endSourceSpan=o,this.type="block"}visit(e,r){return e.visitBlock(this,r)}},ht=class{constructor(e,r){this.expression=e,this.sourceSpan=r,this.type="blockParameter",this.startSourceSpan=null,this.endSourceSpan=null}visit(e,r){return e.visitBlockParameter(this,r)}},ft=class{constructor(e,r,n,s,i){this.name=e,this.value=r,this.sourceSpan=n,this.nameSpan=s,this.valueSpan=i,this.type="letDeclaration",this.startSourceSpan=null,this.endSourceSpan=null}visit(e,r){return e.visitLetDeclaration(this,r)}};function Qt(t,e,r=null){let n=[],s=t.visit?i=>t.visit(i,r)||i.visit(t,r):i=>i.visit(t,r);return e.forEach(i=>{let a=s(i);a&&n.push(a)}),n}var mt=class{constructor(){}visitElement(e,r){this.visitChildren(r,n=>{n(e.attrs),n(e.children)})}visitAttribute(e,r){}visitText(e,r){}visitCdata(e,r){}visitComment(e,r){}visitDocType(e,r){}visitExpansion(e,r){return this.visitChildren(r,n=>{n(e.cases)})}visitExpansionCase(e,r){}visitBlock(e,r){this.visitChildren(r,n=>{n(e.parameters),n(e.children)})}visitBlockParameter(e,r){}visitLetDeclaration(e,r){}visitChildren(e,r){let n=[],s=this;function i(a){a&&n.push(Qt(s,a,e))}return r(i),Array.prototype.concat.apply([],n)}};var Ve={AElig:"\xC6",AMP:"&",amp:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",af:"\u2061",Aring:"\xC5",angst:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",colone:"\u2254",coloneq:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",setminus:"\u2216",setmn:"\u2216",smallsetminus:"\u2216",ssetmn:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",doublebarwedge:"\u2306",Bcy:"\u0411",Because:"\u2235",becaus:"\u2235",because:"\u2235",Bernoullis:"\u212C",Bscr:"\u212C",bernou:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",breve:"\u02D8",Bumpeq:"\u224E",HumpDownHump:"\u224E",bump:"\u224E",CHcy:"\u0427",COPY:"\xA9",copy:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",DD:"\u2145",Cayleys:"\u212D",Cfr:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",cedil:"\xB8",CenterDot:"\xB7",centerdot:"\xB7",middot:"\xB7",Chi:"\u03A7",CircleDot:"\u2299",odot:"\u2299",CircleMinus:"\u2296",ominus:"\u2296",CirclePlus:"\u2295",oplus:"\u2295",CircleTimes:"\u2297",otimes:"\u2297",ClockwiseContourIntegral:"\u2232",cwconint:"\u2232",CloseCurlyDoubleQuote:"\u201D",rdquo:"\u201D",rdquor:"\u201D",CloseCurlyQuote:"\u2019",rsquo:"\u2019",rsquor:"\u2019",Colon:"\u2237",Proportion:"\u2237",Colone:"\u2A74",Congruent:"\u2261",equiv:"\u2261",Conint:"\u222F",DoubleContourIntegral:"\u222F",ContourIntegral:"\u222E",conint:"\u222E",oint:"\u222E",Copf:"\u2102",complexes:"\u2102",Coproduct:"\u2210",coprod:"\u2210",CounterClockwiseContourIntegral:"\u2233",awconint:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",asympeq:"\u224D",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",ddagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",DoubleLeftTee:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",nabla:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",acute:"\xB4",DiacriticalDot:"\u02D9",dot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",dblac:"\u02DD",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"\u02DC",tilde:"\u02DC",Diamond:"\u22C4",diam:"\u22C4",diamond:"\u22C4",DifferentialD:"\u2146",dd:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DoubleDot:"\xA8",die:"\xA8",uml:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",doteq:"\u2250",esdot:"\u2250",DoubleDownArrow:"\u21D3",Downarrow:"\u21D3",dArr:"\u21D3",DoubleLeftArrow:"\u21D0",Leftarrow:"\u21D0",lArr:"\u21D0",DoubleLeftRightArrow:"\u21D4",Leftrightarrow:"\u21D4",hArr:"\u21D4",iff:"\u21D4",DoubleLongLeftArrow:"\u27F8",Longleftarrow:"\u27F8",xlArr:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",Longleftrightarrow:"\u27FA",xhArr:"\u27FA",DoubleLongRightArrow:"\u27F9",Longrightarrow:"\u27F9",xrArr:"\u27F9",DoubleRightArrow:"\u21D2",Implies:"\u21D2",Rightarrow:"\u21D2",rArr:"\u21D2",DoubleRightTee:"\u22A8",vDash:"\u22A8",DoubleUpArrow:"\u21D1",Uparrow:"\u21D1",uArr:"\u21D1",DoubleUpDownArrow:"\u21D5",Updownarrow:"\u21D5",vArr:"\u21D5",DoubleVerticalBar:"\u2225",par:"\u2225",parallel:"\u2225",shortparallel:"\u2225",spar:"\u2225",DownArrow:"\u2193",ShortDownArrow:"\u2193",darr:"\u2193",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",duarr:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",leftharpoondown:"\u21BD",lhard:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",rhard:"\u21C1",rightharpoondown:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",top:"\u22A4",DownTeeArrow:"\u21A7",mapstodown:"\u21A7",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",in:"\u2208",isin:"\u2208",isinv:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",eqsim:"\u2242",esim:"\u2242",Equilibrium:"\u21CC",rightleftharpoons:"\u21CC",rlhar:"\u21CC",Escr:"\u2130",expectation:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",exist:"\u2203",ExponentialE:"\u2147",ee:"\u2147",exponentiale:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",blacksquare:"\u25AA",squarf:"\u25AA",squf:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",forall:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",gt:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",ggg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",ge:"\u2265",geq:"\u2265",GreaterEqualLess:"\u22DB",gel:"\u22DB",gtreqless:"\u22DB",GreaterFullEqual:"\u2267",gE:"\u2267",geqq:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",gl:"\u2277",gtrless:"\u2277",GreaterSlantEqual:"\u2A7E",geqslant:"\u2A7E",ges:"\u2A7E",GreaterTilde:"\u2273",gsim:"\u2273",gtrsim:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",NestedGreaterGreater:"\u226B",gg:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",caron:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",Poincareplane:"\u210C",HilbertSpace:"\u210B",Hscr:"\u210B",hamilt:"\u210B",Hopf:"\u210D",quaternions:"\u210D",HorizontalLine:"\u2500",boxh:"\u2500",Hstrok:"\u0126",HumpEqual:"\u224F",bumpe:"\u224F",bumpeq:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Im:"\u2111",image:"\u2111",imagpart:"\u2111",Igrave:"\xCC",Imacr:"\u012A",ImaginaryI:"\u2148",ii:"\u2148",Int:"\u222C",Integral:"\u222B",int:"\u222B",Intersection:"\u22C2",bigcap:"\u22C2",xcap:"\u22C2",InvisibleComma:"\u2063",ic:"\u2063",InvisibleTimes:"\u2062",it:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",imagline:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",lt:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Lscr:"\u2112",lagran:"\u2112",Larr:"\u219E",twoheadleftarrow:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",lang:"\u27E8",langle:"\u27E8",LeftArrow:"\u2190",ShortLeftArrow:"\u2190",larr:"\u2190",leftarrow:"\u2190",slarr:"\u2190",LeftArrowBar:"\u21E4",larrb:"\u21E4",LeftArrowRightArrow:"\u21C6",leftrightarrows:"\u21C6",lrarr:"\u21C6",LeftCeiling:"\u2308",lceil:"\u2308",LeftDoubleBracket:"\u27E6",lobrk:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",dharl:"\u21C3",downharpoonleft:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",lfloor:"\u230A",LeftRightArrow:"\u2194",harr:"\u2194",leftrightarrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",dashv:"\u22A3",LeftTeeArrow:"\u21A4",mapstoleft:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",vartriangleleft:"\u22B2",vltri:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",ltrie:"\u22B4",trianglelefteq:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",uharl:"\u21BF",upharpoonleft:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",leftharpoonup:"\u21BC",lharu:"\u21BC",LeftVectorBar:"\u2952",LessEqualGreater:"\u22DA",leg:"\u22DA",lesseqgtr:"\u22DA",LessFullEqual:"\u2266",lE:"\u2266",leqq:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",lg:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",leqslant:"\u2A7D",les:"\u2A7D",LessTilde:"\u2272",lesssim:"\u2272",lsim:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",lAarr:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",longleftarrow:"\u27F5",xlarr:"\u27F5",LongLeftRightArrow:"\u27F7",longleftrightarrow:"\u27F7",xharr:"\u27F7",LongRightArrow:"\u27F6",longrightarrow:"\u27F6",xrarr:"\u27F6",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",swarr:"\u2199",swarrow:"\u2199",LowerRightArrow:"\u2198",searr:"\u2198",searrow:"\u2198",Lsh:"\u21B0",lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",NestedLessLess:"\u226A",ll:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mscr:"\u2133",phmmat:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",mnplus:"\u2213",mp:"\u2213",Mopf:"\u{1D544}",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",ZeroWidthSpace:"\u200B",NewLine:` +`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nbsp:"\xA0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",npar:"\u2226",nparallel:"\u2226",nshortparallel:"\u2226",nspar:"\u2226",NotElement:"\u2209",notin:"\u2209",notinva:"\u2209",NotEqual:"\u2260",ne:"\u2260",NotEqualTilde:"\u2242\u0338",nesim:"\u2242\u0338",NotExists:"\u2204",nexist:"\u2204",nexists:"\u2204",NotGreater:"\u226F",ngt:"\u226F",ngtr:"\u226F",NotGreaterEqual:"\u2271",nge:"\u2271",ngeq:"\u2271",NotGreaterFullEqual:"\u2267\u0338",ngE:"\u2267\u0338",ngeqq:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",nGtv:"\u226B\u0338",NotGreaterLess:"\u2279",ntgl:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",NotGreaterTilde:"\u2275",ngsim:"\u2275",NotHumpDownHump:"\u224E\u0338",nbump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",nbumpe:"\u224F\u0338",NotLeftTriangle:"\u22EA",nltri:"\u22EA",ntriangleleft:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",nltrie:"\u22EC",ntrianglelefteq:"\u22EC",NotLess:"\u226E",nless:"\u226E",nlt:"\u226E",NotLessEqual:"\u2270",nle:"\u2270",nleq:"\u2270",NotLessGreater:"\u2278",ntlg:"\u2278",NotLessLess:"\u226A\u0338",nLtv:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",NotLessTilde:"\u2274",nlsim:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",npr:"\u2280",nprec:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",npre:"\u2AAF\u0338",npreceq:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",nprcue:"\u22E0",NotReverseElement:"\u220C",notni:"\u220C",notniva:"\u220C",NotRightTriangle:"\u22EB",nrtri:"\u22EB",ntriangleright:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",nrtrie:"\u22ED",ntrianglerighteq:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",nsqsube:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",nsqsupe:"\u22E3",NotSubset:"\u2282\u20D2",nsubset:"\u2282\u20D2",vnsub:"\u2282\u20D2",NotSubsetEqual:"\u2288",nsube:"\u2288",nsubseteq:"\u2288",NotSucceeds:"\u2281",nsc:"\u2281",nsucc:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",nsce:"\u2AB0\u0338",nsucceq:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",nsccue:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",nsupset:"\u2283\u20D2",vnsup:"\u2283\u20D2",NotSupersetEqual:"\u2289",nsupe:"\u2289",nsupseteq:"\u2289",NotTilde:"\u2241",nsim:"\u2241",NotTildeEqual:"\u2244",nsime:"\u2244",nsimeq:"\u2244",NotTildeFullEqual:"\u2247",ncong:"\u2247",NotTildeTilde:"\u2249",nap:"\u2249",napprox:"\u2249",NotVerticalBar:"\u2224",nmid:"\u2224",nshortmid:"\u2224",nsmid:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",ohm:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",ldquo:"\u201C",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",oline:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",tbrk:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",part:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",plusmn:"\xB1",pm:"\xB1",Popf:"\u2119",primes:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",pr:"\u227A",prec:"\u227A",PrecedesEqual:"\u2AAF",pre:"\u2AAF",preceq:"\u2AAF",PrecedesSlantEqual:"\u227C",prcue:"\u227C",preccurlyeq:"\u227C",PrecedesTilde:"\u227E",precsim:"\u227E",prsim:"\u227E",Prime:"\u2033",Product:"\u220F",prod:"\u220F",Proportional:"\u221D",prop:"\u221D",propto:"\u221D",varpropto:"\u221D",vprop:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',quot:'"',Qfr:"\u{1D514}",Qopf:"\u211A",rationals:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",drbkarow:"\u2910",REG:"\xAE",circledR:"\xAE",reg:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",twoheadrightarrow:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",Rfr:"\u211C",real:"\u211C",realpart:"\u211C",ReverseElement:"\u220B",SuchThat:"\u220B",ni:"\u220B",niv:"\u220B",ReverseEquilibrium:"\u21CB",leftrightharpoons:"\u21CB",lrhar:"\u21CB",ReverseUpEquilibrium:"\u296F",duhar:"\u296F",Rho:"\u03A1",RightAngleBracket:"\u27E9",rang:"\u27E9",rangle:"\u27E9",RightArrow:"\u2192",ShortRightArrow:"\u2192",rarr:"\u2192",rightarrow:"\u2192",srarr:"\u2192",RightArrowBar:"\u21E5",rarrb:"\u21E5",RightArrowLeftArrow:"\u21C4",rightleftarrows:"\u21C4",rlarr:"\u21C4",RightCeiling:"\u2309",rceil:"\u2309",RightDoubleBracket:"\u27E7",robrk:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",dharr:"\u21C2",downharpoonright:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rfloor:"\u230B",RightTee:"\u22A2",vdash:"\u22A2",RightTeeArrow:"\u21A6",map:"\u21A6",mapsto:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",vartriangleright:"\u22B3",vrtri:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",rtrie:"\u22B5",trianglerighteq:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",uharr:"\u21BE",upharpoonright:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",rharu:"\u21C0",rightharpoonup:"\u21C0",RightVectorBar:"\u2953",Ropf:"\u211D",reals:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",rAarr:"\u21DB",Rscr:"\u211B",realine:"\u211B",Rsh:"\u21B1",rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortUpArrow:"\u2191",UpArrow:"\u2191",uarr:"\u2191",uparrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",compfn:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",radic:"\u221A",Square:"\u25A1",squ:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",sqcap:"\u2293",SquareSubset:"\u228F",sqsub:"\u228F",sqsubset:"\u228F",SquareSubsetEqual:"\u2291",sqsube:"\u2291",sqsubseteq:"\u2291",SquareSuperset:"\u2290",sqsup:"\u2290",sqsupset:"\u2290",SquareSupersetEqual:"\u2292",sqsupe:"\u2292",sqsupseteq:"\u2292",SquareUnion:"\u2294",sqcup:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",sstarf:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",sube:"\u2286",subseteq:"\u2286",Succeeds:"\u227B",sc:"\u227B",succ:"\u227B",SucceedsEqual:"\u2AB0",sce:"\u2AB0",succeq:"\u2AB0",SucceedsSlantEqual:"\u227D",sccue:"\u227D",succcurlyeq:"\u227D",SucceedsTilde:"\u227F",scsim:"\u227F",succsim:"\u227F",Sum:"\u2211",sum:"\u2211",Sup:"\u22D1",Supset:"\u22D1",Superset:"\u2283",sup:"\u2283",supset:"\u2283",SupersetEqual:"\u2287",supe:"\u2287",supseteq:"\u2287",THORN:"\xDE",TRADE:"\u2122",trade:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",there4:"\u2234",therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",thinsp:"\u2009",Tilde:"\u223C",sim:"\u223C",thicksim:"\u223C",thksim:"\u223C",TildeEqual:"\u2243",sime:"\u2243",simeq:"\u2243",TildeFullEqual:"\u2245",cong:"\u2245",TildeTilde:"\u2248",ap:"\u2248",approx:"\u2248",asymp:"\u2248",thickapprox:"\u2248",thkap:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",tdot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",lowbar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",bbrk:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",bigcup:"\u22C3",xcup:"\u22C3",UnionPlus:"\u228E",uplus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",udarr:"\u21C5",UpDownArrow:"\u2195",updownarrow:"\u2195",varr:"\u2195",UpEquilibrium:"\u296E",udhar:"\u296E",UpTee:"\u22A5",bot:"\u22A5",bottom:"\u22A5",perp:"\u22A5",UpTeeArrow:"\u21A5",mapstoup:"\u21A5",UpperLeftArrow:"\u2196",nwarr:"\u2196",nwarrow:"\u2196",UpperRightArrow:"\u2197",nearr:"\u2197",nearrow:"\u2197",Upsi:"\u03D2",upsih:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",bigvee:"\u22C1",xvee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",mid:"\u2223",shortmid:"\u2223",smid:"\u2223",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",wr:"\u2240",wreath:"\u2240",VeryThinSpace:"\u200A",hairsp:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",bigwedge:"\u22C0",xwedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",Zeta:"\u0396",Zfr:"\u2128",zeetrf:"\u2128",Zopf:"\u2124",integers:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",mstpos:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acy:"\u0430",aelig:"\xE6",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",and:"\u2227",wedge:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",angle:"\u2220",ange:"\u29A4",angmsd:"\u2221",measuredangle:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",approxeq:"\u224A",apid:"\u224B",apos:"'",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",midast:"*",atilde:"\xE3",auml:"\xE4",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",bcong:"\u224C",backepsilon:"\u03F6",bepsi:"\u03F6",backprime:"\u2035",bprime:"\u2035",backsim:"\u223D",bsim:"\u223D",backsimeq:"\u22CD",bsime:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrktbrk:"\u23B6",bcy:"\u0431",bdquo:"\u201E",ldquor:"\u201E",bemptyv:"\u29B0",beta:"\u03B2",beth:"\u2136",between:"\u226C",twixt:"\u226C",bfr:"\u{1D51F}",bigcirc:"\u25EF",xcirc:"\u25EF",bigodot:"\u2A00",xodot:"\u2A00",bigoplus:"\u2A01",xoplus:"\u2A01",bigotimes:"\u2A02",xotime:"\u2A02",bigsqcup:"\u2A06",xsqcup:"\u2A06",bigstar:"\u2605",starf:"\u2605",bigtriangledown:"\u25BD",xdtri:"\u25BD",bigtriangleup:"\u25B3",xutri:"\u25B3",biguplus:"\u2A04",xuplus:"\u2A04",bkarow:"\u290D",rbarr:"\u290D",blacklozenge:"\u29EB",lozf:"\u29EB",blacktriangle:"\u25B4",utrif:"\u25B4",blacktriangledown:"\u25BE",dtrif:"\u25BE",blacktriangleleft:"\u25C2",ltrif:"\u25C2",blacktriangleright:"\u25B8",rtrif:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",minusb:"\u229F",boxplus:"\u229E",plusb:"\u229E",boxtimes:"\u22A0",timesb:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bumpE:"\u2AAE",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cemptyv:"\u29B2",cent:"\xA2",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",cire:"\u2257",circlearrowleft:"\u21BA",olarr:"\u21BA",circlearrowright:"\u21BB",orarr:"\u21BB",circledS:"\u24C8",oS:"\u24C8",circledast:"\u229B",oast:"\u229B",circledcirc:"\u229A",ocir:"\u229A",circleddash:"\u229D",odash:"\u229D",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",comma:",",commat:"@",comp:"\u2201",complement:"\u2201",congdot:"\u2A6D",copf:"\u{1D554}",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",curlyeqprec:"\u22DE",cuesc:"\u22DF",curlyeqsucc:"\u22DF",cularr:"\u21B6",curvearrowleft:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curvearrowright:"\u21B7",curarrm:"\u293C",curlyvee:"\u22CE",cuvee:"\u22CE",curlywedge:"\u22CF",cuwed:"\u22CF",curren:"\xA4",cwint:"\u2231",cylcty:"\u232D",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",dash:"\u2010",hyphen:"\u2010",dbkarow:"\u290F",rBarr:"\u290F",dcaron:"\u010F",dcy:"\u0434",ddarr:"\u21CA",downdownarrows:"\u21CA",ddotseq:"\u2A77",eDDot:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",diamondsuit:"\u2666",diams:"\u2666",digamma:"\u03DD",gammad:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",llcorner:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",doteqdot:"\u2251",eDot:"\u2251",dotminus:"\u2238",minusd:"\u2238",dotplus:"\u2214",plusdo:"\u2214",dotsquare:"\u22A1",sdotb:"\u22A1",drcorn:"\u231F",lrcorner:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",triangledown:"\u25BF",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",eqcirc:"\u2256",ecirc:"\xEA",ecolon:"\u2255",eqcolon:"\u2255",ecy:"\u044D",edot:"\u0117",efDot:"\u2252",fallingdotseq:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",eqslantgtr:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",eqslantless:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",varnothing:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",straightepsilon:"\u03F5",varepsilon:"\u03F5",equals:"=",equest:"\u225F",questeq:"\u225F",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",risingdotseq:"\u2253",erarr:"\u2971",escr:"\u212F",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",fork:"\u22D4",pitchfork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",half:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",sfrown:"\u2322",fscr:"\u{1D4BB}",gEl:"\u2A8C",gtreqqless:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gap:"\u2A86",gtrapprox:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gimel:"\u2137",gjcy:"\u0453",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gneqq:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gnsim:"\u22E7",gopf:"\u{1D558}",gscr:"\u210A",gsime:"\u2A8E",gsiml:"\u2A90",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtrdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrarr:"\u2978",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hardcy:"\u044A",harrcir:"\u2948",harrw:"\u21AD",leftrightsquigarrow:"\u21AD",hbar:"\u210F",hslash:"\u210F",planck:"\u210F",plankv:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",mldr:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",searhk:"\u2925",hkswarow:"\u2926",swarhk:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",larrhk:"\u21A9",hookrightarrow:"\u21AA",rarrhk:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hstrok:"\u0127",hybull:"\u2043",iacute:"\xED",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",ifr:"\u{1D526}",igrave:"\xEC",iiiint:"\u2A0C",qint:"\u2A0C",iiint:"\u222D",tint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",imath:"\u0131",inodot:"\u0131",imof:"\u22B7",imped:"\u01B5",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",intcal:"\u22BA",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iquest:"\xBF",iscr:"\u{1D4BE}",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",varkappa:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAtail:"\u291B",lBarr:"\u290E",lEg:"\u2A8B",lesseqqgtr:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lambda:"\u03BB",langd:"\u2991",lap:"\u2A85",lessapprox:"\u2A85",laquo:"\xAB",larrbfs:"\u291F",larrfs:"\u291D",larrlp:"\u21AB",looparrowleft:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",leftarrowtail:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lcy:"\u043B",ldca:"\u2936",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leq:"\u2264",leftleftarrows:"\u21C7",llarr:"\u21C7",leftthreetimes:"\u22CB",lthree:"\u22CB",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessdot:"\u22D6",ltdot:"\u22D6",lfisht:"\u297C",lfr:"\u{1D529}",lgE:"\u2A91",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lneqq:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",longmapsto:"\u27FC",xmap:"\u27FC",looparrowright:"\u21AC",rarrlp:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",loz:"\u25CA",lozenge:"\u25CA",lpar:"(",lparlt:"\u2993",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsime:"\u2A8D",lsimg:"\u2A8F",lsquor:"\u201A",sbquo:"\u201A",lstrok:"\u0142",ltcc:"\u2AA6",ltcir:"\u2A79",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",triangleleft:"\u25C3",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",strns:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",midcir:"\u2AF0",minus:"\u2212",minusdu:"\u2A2A",mlcp:"\u2ADB",models:"\u22A7",mopf:"\u{1D55E}",mscr:"\u{1D4C2}",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nLeftarrow:"\u21CD",nlArr:"\u21CD",nLeftrightarrow:"\u21CE",nhArr:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nRightarrow:"\u21CF",nrArr:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nacute:"\u0144",nang:"\u2220\u20D2",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",natur:"\u266E",natural:"\u266E",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",neArr:"\u21D7",nearhk:"\u2924",nedot:"\u2250\u0338",nesear:"\u2928",toea:"\u2928",nfr:"\u{1D52B}",nharr:"\u21AE",nleftrightarrow:"\u21AE",nhpar:"\u2AF2",nis:"\u22FC",nisd:"\u22FA",njcy:"\u045A",nlE:"\u2266\u0338",nleqq:"\u2266\u0338",nlarr:"\u219A",nleftarrow:"\u219A",nldr:"\u2025",nopf:"\u{1D55F}",not:"\xAC",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinvb:"\u22F7",notinvc:"\u22F6",notnivb:"\u22FE",notnivc:"\u22FD",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",nrarr:"\u219B",nrightarrow:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nscr:"\u{1D4C3}",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsubseteqq:"\u2AC5\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupseteqq:"\u2AC6\u0338",ntilde:"\xF1",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwnear:"\u2927",oacute:"\xF3",ocirc:"\xF4",ocy:"\u043E",odblac:"\u0151",odiv:"\u2A38",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",olcir:"\u29BE",olcross:"\u29BB",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",or:"\u2228",vee:"\u2228",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",oscr:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",para:"\xB6",parsim:"\u2AF3",parsl:"\u2AFD",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",straightphi:"\u03D5",varphi:"\u03D5",phone:"\u260E",pi:"\u03C0",piv:"\u03D6",varpi:"\u03D6",planckh:"\u210E",plus:"+",plusacir:"\u2A23",pluscir:"\u2A22",plusdu:"\u2A25",pluse:"\u2A72",plussim:"\u2A26",plustwo:"\u2A27",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",prE:"\u2AB3",prap:"\u2AB7",precapprox:"\u2AB7",precnapprox:"\u2AB9",prnap:"\u2AB9",precneqq:"\u2AB5",prnE:"\u2AB5",precnsim:"\u22E8",prnsim:"\u22E8",prime:"\u2032",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quatint:"\u2A16",quest:"?",rAtail:"\u291C",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",raemptyv:"\u29B3",rangd:"\u2992",range:"\u29A5",raquo:"\xBB",rarrap:"\u2975",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rightarrowtail:"\u21A3",rarrw:"\u219D",rightsquigarrow:"\u219D",ratail:"\u291A",ratio:"\u2236",rbbrk:"\u2773",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdsh:"\u21B3",rect:"\u25AD",rfisht:"\u297D",rfr:"\u{1D52F}",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",varrho:"\u03F1",rightrightarrows:"\u21C9",rrarr:"\u21C9",rightthreetimes:"\u22CC",rthree:"\u22CC",ring:"\u02DA",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rsaquo:"\u203A",rscr:"\u{1D4C7}",rtimes:"\u22CA",rtri:"\u25B9",triangleright:"\u25B9",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",scE:"\u2AB4",scap:"\u2AB8",succapprox:"\u2AB8",scaron:"\u0161",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",succneqq:"\u2AB6",scnap:"\u2ABA",succnapprox:"\u2ABA",scnsim:"\u22E9",succnsim:"\u22E9",scpolint:"\u2A13",scy:"\u0441",sdot:"\u22C5",sdote:"\u2A66",seArr:"\u21D8",sect:"\xA7",semi:";",seswar:"\u2929",tosa:"\u2929",sext:"\u2736",sfr:"\u{1D530}",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",varsigma:"\u03C2",simdot:"\u2A6A",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",smashp:"\u2A33",smeparsl:"\u29E4",smile:"\u2323",ssmile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",sqcaps:"\u2293\uFE00",sqcups:"\u2294\uFE00",sscr:"\u{1D4C8}",star:"\u2606",sub:"\u2282",subset:"\u2282",subE:"\u2AC5",subseteqq:"\u2AC5",subdot:"\u2ABD",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subsetneqq:"\u2ACB",subne:"\u228A",subsetneq:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supE:"\u2AC6",supseteqq:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supsetneqq:"\u2ACC",supne:"\u228B",supsetneq:"\u228B",supplus:"\u2AC0",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",telrec:"\u2315",tfr:"\u{1D531}",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",vartheta:"\u03D1",thorn:"\xFE",times:"\xD7",timesbar:"\u2A31",timesd:"\u2A30",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tprime:"\u2034",triangle:"\u25B5",utri:"\u25B5",triangleq:"\u225C",trie:"\u225C",tridot:"\u25EC",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",uHar:"\u2963",uacute:"\xFA",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udblac:"\u0171",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uogon:"\u0173",uopf:"\u{1D566}",upsi:"\u03C5",upsilon:"\u03C5",upuparrows:"\u21C8",uuarr:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",uuml:"\xFC",uwangle:"\u29A7",vBar:"\u2AE8",vBarv:"\u2AE9",vangrt:"\u299C",varsubsetneq:"\u228A\uFE00",vsubne:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",vsubnE:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",vsupne:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vsupnE:"\u2ACC\uFE00",vcy:"\u0432",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",vfr:"\u{1D533}",vopf:"\u{1D567}",vscr:"\u{1D4CB}",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedgeq:"\u2259",weierp:"\u2118",wp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wscr:"\u{1D4CC}",xfr:"\u{1D535}",xi:"\u03BE",xnis:"\u22FB",xopf:"\u{1D569}",xscr:"\u{1D4CD}",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"},Xa="\uE500";Ve.ngsp=Xa;var Ja=[/@/,/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function $s(t,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${t}' to be an array, [start, end].`);if(e!=null){let r=e[0],n=e[1];Ja.forEach(s=>{if(s.test(r)||s.test(n))throw new Error(`['${r}', '${n}'] contains unusable interpolation symbol.`)})}}var Rr=class t{static fromArray(e){return e?($s("interpolation",e),new t(e[0],e[1])):$r}constructor(e,r){this.start=e,this.end=r}},$r=new Rr("{{","}}");var gt=class extends Oe{constructor(e,r,n){super(n,e),this.tokenType=r}},Vr=class{constructor(e,r,n){this.tokens=e,this.errors=r,this.nonNormalizedIcuExpressions=n}};function Qs(t,e,r,n={}){let s=new Ur(new De(t,e),r,n);return s.tokenize(),new Vr(wo(s.tokens),s.errors,s.nonNormalizedIcuExpressions)}var So=/\r\n?/g;function Ue(t){return`Unexpected character "${t===0?"EOF":String.fromCharCode(t)}"`}function Vs(t){return`Unknown entity "${t}" - use the "&#;" or "&#x;" syntax`}function _o(t,e){return`Unable to parse entity "${e}" - ${t} character reference entities must end with ";"`}var tr;(function(t){t.HEX="hexadecimal",t.DEC="decimal"})(tr||(tr={}));var Ct=class{constructor(e){this.error=e}},Ur=class{constructor(e,r,n){this._getTagContentType=r,this._currentTokenStart=null,this._currentTokenType=null,this._expansionCaseStack=[],this._inInterpolation=!1,this._fullNameStack=[],this.tokens=[],this.errors=[],this.nonNormalizedIcuExpressions=[],this._tokenizeIcu=n.tokenizeExpansionForms||!1,this._interpolationConfig=n.interpolationConfig||$r,this._leadingTriviaCodePoints=n.leadingTriviaChars&&n.leadingTriviaChars.map(i=>i.codePointAt(0)||0),this._canSelfClose=n.canSelfClose||!1,this._allowHtmComponentClosingTags=n.allowHtmComponentClosingTags||!1;let s=n.range||{endPos:e.content.length,startPos:0,startLine:0,startCol:0};this._cursor=n.escapedString?new Wr(e,s):new rr(e,s),this._preserveLineEndings=n.preserveLineEndings||!1,this._i18nNormalizeLineEndingsInICUs=n.i18nNormalizeLineEndingsInICUs||!1,this._tokenizeBlocks=n.tokenizeBlocks??!0,this._tokenizeLet=n.tokenizeLet??!0;try{this._cursor.init()}catch(i){this.handleError(i)}}_processCarriageReturns(e){return this._preserveLineEndings?e:e.replace(So,` +`)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(47))this._consumeTagClose(e);else{let r=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=r,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._attemptStr("@let")?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._attemptCharCode(64)?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(r){this.handleError(r)}}this._beginToken(34),this._endToken([])}_getBlockName(){let e=!1,r=this._cursor.clone();return this._attemptCharCodeUntilFn(n=>ut(n)?!e:zs(n)?(e=!0,!1):!0),this._cursor.getChars(r).trim()}_consumeBlockStart(e){this._beginToken(25,e);let r=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(b),this._attemptCharCode(41))this._attemptCharCodeUntilFn(b);else{r.type=29;return}this._attemptCharCode(123)?(this._beginToken(26),this._endToken([])):r.type=29}_consumeBlockEnd(e){this._beginToken(27,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(Gs);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(28);let e=this._cursor.clone(),r=null,n=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||r!==null;){let s=this._cursor.peek();if(s===92)this._cursor.advance();else if(s===r)r=null;else if(r===null&&$t(s))r=s;else if(s===40&&r===null)n++;else if(s===41&&r===null){if(n===0)break;n>0&&n--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(Gs)}}_consumeLetDeclaration(e){if(this._beginToken(30,e),ut(this._cursor.peek()))this._attemptCharCodeUntilFn(b);else{let s=this._endToken([this._cursor.getChars(e)]);s.type=33;return}let r=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(b),!this._attemptCharCode(61)){r.type=33;return}this._attemptCharCodeUntilFn(s=>b(s)&&!Rt(s)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(32),this._endToken([]),this._cursor.advance()):(r.type=33,r.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),r=!1;return this._attemptCharCodeUntilFn(n=>lt(n)||n===36||n===95||r&&It(n)?(r=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();for(this._beginToken(31,e);this._cursor.peek()!==0;){let r=this._cursor.peek();if(r===59)break;$t(r)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(n=>n===92?(this._cursor.advance(),!1):n===r)),this._cursor.advance()}this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(vo(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,r=this._cursor.clone()){this._currentTokenStart=r,this._currentTokenType=e}_endToken(e,r){if(this._currentTokenStart===null)throw new gt("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(r));if(this._currentTokenType===null)throw new gt("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let n={type:this._currentTokenType,parts:e,sourceSpan:(r??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(n),this._currentTokenStart=null,this._currentTokenType=null,n}_createError(e,r){this._isInExpansionForm()&&(e+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let n=new gt(e,this._currentTokenType,r);return this._currentTokenStart=null,this._currentTokenType=null,new Ct(n)}handleError(e){if(e instanceof St&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof Ct)this.errors.push(e.error);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return yo(this._cursor.peek(),e)?(this._cursor.advance(),!0):!1}_requireCharCode(e){let r=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(Ue(this._cursor.peek()),this._cursor.getSpan(r))}_attemptStr(e){let r=e.length;if(this._cursor.charsLeft()this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(e){this._beginToken(10,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(11),this._cursor.advance(),this._endToken([])}_consumeCdata(e){this._beginToken(12,e),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(e){this._beginToken(18,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(19),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(){let e=this._cursor.clone(),r="";for(;this._cursor.peek()!==58&&!Eo(this._cursor.peek());)this._cursor.advance();let n;this._cursor.peek()===58?(r=this._cursor.getChars(e),this._cursor.advance(),n=this._cursor.clone()):n=e,this._requireCharCodeUntilFn(Us,r===""?0:1);let s=this._cursor.getChars(n);return[r,s]}_consumeTagOpen(e){let r,n,s,i=[];try{if(!lt(this._cursor.peek()))throw this._createError(Ue(this._cursor.peek()),this._cursor.getSpan(e));for(s=this._consumeTagOpenStart(e),n=s.parts[0],r=s.parts[1],this._attemptCharCodeUntilFn(b);this._cursor.peek()!==47&&this._cursor.peek()!==62&&this._cursor.peek()!==60&&this._cursor.peek()!==0;){let[o,u]=this._consumeAttributeName();if(this._attemptCharCodeUntilFn(b),this._attemptCharCode(61)){this._attemptCharCodeUntilFn(b);let p=this._consumeAttributeValue();i.push({prefix:o,name:u,value:p})}else i.push({prefix:o,name:u});this._attemptCharCodeUntilFn(b)}this._consumeTagOpenEnd()}catch(o){if(o instanceof Ct){s?s.type=4:(this._beginToken(5,e),this._endToken(["<"]));return}throw o}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===2)return;let a=this._getTagContentType(r,n,this._fullNameStack.length>0,i);this._handleFullNameStackForTagOpen(n,r),a===P.RAW_TEXT?this._consumeRawTextWithTagClose(n,r,!1):a===P.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(n,r,!0)}_consumeRawTextWithTagClose(e,r,n){this._consumeRawText(n,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(b),!this._attemptStrCaseInsensitive(e?`${e}:${r}`:r))?!1:(this._attemptCharCodeUntilFn(b),this._attemptCharCode(62))),this._beginToken(3),this._requireCharCodeUntilFn(s=>s===62,3),this._cursor.advance(),this._endToken([e,r]),this._handleFullNameStackForTagClose(e,r)}_consumeTagOpenStart(e){this._beginToken(0,e);let r=this._consumePrefixAndName();return this._endToken(r)}_consumeAttributeName(){let e=this._cursor.peek();if(e===39||e===34)throw this._createError(Ue(e),this._cursor.getSpan());this._beginToken(14);let r=this._consumePrefixAndName();return this._endToken(r),r}_consumeAttributeValue(){let e;if(this._cursor.peek()===39||this._cursor.peek()===34){let r=this._cursor.peek();this._consumeQuote(r);let n=()=>this._cursor.peek()===r;e=this._consumeWithInterpolation(16,17,n,n),this._consumeQuote(r)}else{let r=()=>Us(this._cursor.peek());e=this._consumeWithInterpolation(16,17,r,r)}return e}_consumeQuote(e){this._beginToken(15),this._requireCharCode(e),this._endToken([String.fromCodePoint(e)])}_consumeTagOpenEnd(){let e=this._attemptCharCode(47)?2:1;this._beginToken(e),this._requireCharCode(62),this._endToken([])}_consumeTagClose(e){if(this._beginToken(3,e),this._attemptCharCodeUntilFn(b),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(b),this._requireCharCode(62),this._endToken([]);else{let[r,n]=this._consumePrefixAndName();this._attemptCharCodeUntilFn(b),this._requireCharCode(62),this._endToken([r,n]),this._handleFullNameStackForTagClose(r,n)}}_consumeExpansionFormStart(){this._beginToken(20),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(20),this._beginToken(7);let e=this._readUntil(44),r=this._processCarriageReturns(e);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([r]);else{let s=this._endToken([e]);r!==e&&this.nonNormalizedIcuExpressions.push(s)}this._requireCharCode(44),this._attemptCharCodeUntilFn(b),this._beginToken(7);let n=this._readUntil(44);this._endToken([n]),this._requireCharCode(44),this._attemptCharCodeUntilFn(b)}_consumeExpansionCaseStart(){this._beginToken(21);let e=this._readUntil(123).trim();this._endToken([e]),this._attemptCharCodeUntilFn(b),this._beginToken(22),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(b),this._expansionCaseStack.push(22)}_consumeExpansionCaseEnd(){this._beginToken(23),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(b),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(24),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(e,r,n,s){this._beginToken(e);let i=[];for(;!n();){let o=this._cursor.clone();this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(this._endToken([this._processCarriageReturns(i.join(""))],o),i.length=0,this._consumeInterpolation(r,o,s),this._beginToken(e)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(i.join(""))]),i.length=0,this._consumeEntity(e),this._beginToken(e)):i.push(this._readChar())}this._inInterpolation=!1;let a=this._processCarriageReturns(i.join(""));return this._endToken([a]),a}_consumeInterpolation(e,r,n){let s=[];this._beginToken(e,r),s.push(this._interpolationConfig.start);let i=this._cursor.clone(),a=null,o=!1;for(;this._cursor.peek()!==0&&(n===null||!n());){let u=this._cursor.clone();if(this._isTagStart()){this._cursor=u,s.push(this._getProcessedChars(i,u)),this._endToken(s);return}if(a===null)if(this._attemptStr(this._interpolationConfig.end)){s.push(this._getProcessedChars(i,u)),s.push(this._interpolationConfig.end),this._endToken(s);return}else this._attemptStr("//")&&(o=!0);let p=this._cursor.peek();this._cursor.advance(),p===92?this._cursor.advance():p===a?a=null:!o&&a===null&&$t(p)&&(a=p)}s.push(this._getProcessedChars(i,this._cursor)),this._endToken(s)}_getProcessedChars(e,r){return this._processCarriageReturns(r.getChars(e))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._cursor.peek()===64||this._cursor.peek()===125))}_isTagStart(){if(this._cursor.peek()===60){let e=this._cursor.clone();e.advance();let r=e.peek();if(97<=r&&r<=122||65<=r&&r<=90||r===47||r===33)return!0}return!1}_isBlockStart(){if(this._tokenizeBlocks&&this._cursor.peek()===64){let e=this._cursor.clone();if(e.advance(),zs(e.peek()))return!0}return!1}_readUntil(e){let r=this._cursor.clone();return this._attemptUntilChar(e),this._cursor.getChars(r)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===22}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===20}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;if(this._interpolationConfig){let e=this._cursor.clone(),r=this._attemptStr(this._interpolationConfig.start);return this._cursor=e,!r}return!0}_handleFullNameStackForTagOpen(e,r){let n=qe(e,r);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===n)&&this._fullNameStack.push(n)}_handleFullNameStackForTagClose(e,r){let n=qe(e,r);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===n&&this._fullNameStack.pop()}};function b(t){return!ut(t)||t===0}function Us(t){return ut(t)||t===62||t===60||t===47||t===39||t===34||t===61||t===0}function Eo(t){return(t<97||12257)}function Ao(t){return t===59||t===0||!vs(t)}function Do(t){return t===59||t===0||!lt(t)}function vo(t){return t!==125}function yo(t,e){return Ws(t)===Ws(e)}function Ws(t){return t>=97&&t<=122?t-97+65:t}function zs(t){return lt(t)||It(t)||t===95}function Gs(t){return t!==59&&b(t)}function wo(t){let e=[],r;for(let n=0;n0&&r.indexOf(e.peek())!==-1;)n===e&&(e=e.clone()),e.advance();let s=this.locationFromCursor(e),i=this.locationFromCursor(this),a=n!==e?this.locationFromCursor(n):s;return new h(s,i,a)}getChars(e){return this.input.substring(e.state.offset,this.state.offset)}charAt(e){return this.input.charCodeAt(e)}advanceState(e){if(e.offset>=this.end)throw this.state=e,new St('Unexpected character "EOF"',this);let r=this.charAt(e.offset);r===10?(e.line++,e.column=0):Rt(r)||e.column++,e.offset++,this.updatePeek(e)}updatePeek(e){e.peek=e.offset>=this.end?0:this.charAt(e.offset)}locationFromCursor(e){return new ie(e.file,e.state.offset,e.state.line,e.state.column)}},Wr=class t extends rr{constructor(e,r){e instanceof t?(super(e),this.internalState={...e.internalState}):(super(e,r),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new t(this)}getChars(e){let r=e.clone(),n="";for(;r.internalState.offsetthis.internalState.peek;if(e()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),e()===110)this.state.peek=10;else if(e()===114)this.state.peek=13;else if(e()===118)this.state.peek=11;else if(e()===116)this.state.peek=9;else if(e()===98)this.state.peek=8;else if(e()===102)this.state.peek=12;else if(e()===117)if(this.advanceState(this.internalState),e()===123){this.advanceState(this.internalState);let r=this.clone(),n=0;for(;e()!==125;)this.advanceState(this.internalState),n++;this.state.peek=this.decodeHexDigits(r,n)}else{let r=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,4)}else if(e()===120){this.advanceState(this.internalState);let r=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,2)}else if(kr(e())){let r="",n=0,s=this.clone();for(;kr(e())&&n<3;)s=this.clone(),r+=String.fromCodePoint(e()),this.advanceState(this.internalState),n++;this.state.peek=parseInt(r,8),this.internalState=s.internalState}else Rt(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(e,r){let n=this.input.slice(e.internalState.offset,e.internalState.offset+r),s=parseInt(n,16);if(isNaN(s))throw e.state=e.internalState,new St("Invalid hexadecimal escape sequence",e);return s}},St=class{constructor(e,r){this.msg=e,this.cursor=r}};var L=class t extends Oe{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){super(r,n),this.elementName=e}},Yr=class{constructor(e,r){this.rootNodes=e,this.errors=r}},nr=class{constructor(e){this.getTagDefinition=e}parse(e,r,n,s=!1,i){let a=D=>(I,...F)=>D(I.toLowerCase(),...F),o=s?this.getTagDefinition:a(this.getTagDefinition),u=D=>o(D).getContentType(),p=s?i:a(i),f=Qs(e,r,i?(D,I,F,c)=>{let g=p(D,I,F,c);return g!==void 0?g:u(D)}:u,n),d=n&&n.canSelfClose||!1,C=n&&n.allowHtmComponentClosingTags||!1,A=new jr(f.tokens,o,d,C,s);return A.build(),new Yr(A.rootNodes,f.errors.concat(A.errors))}},jr=class t{constructor(e,r,n,s,i){this.tokens=e,this.getTagDefinition=r,this.canSelfClose=n,this.allowHtmComponentClosingTags=s,this.isTagNameCaseSensitive=i,this._index=-1,this._containerStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==34;)this._peek.type===0||this._peek.type===4?this._consumeStartTag(this._advance()):this._peek.type===3?(this._closeVoidElement(),this._consumeEndTag(this._advance())):this._peek.type===12?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===10?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===5||this._peek.type===7||this._peek.type===6?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===20?this._consumeExpansion(this._advance()):this._peek.type===25?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===27?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===29?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===30?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===18?this._consumeDocType(this._advance()):this._peek.type===33?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._advance();for(let e of this._containerStack)e instanceof te&&this.errors.push(L.create(e.name,e.sourceSpan,`Unclosed block "${e.name}"`))}_advance(){let e=this._peek;return this._index0)return this.errors=this.errors.concat(i.errors),null;let a=new h(e.sourceSpan.start,s.sourceSpan.end,e.sourceSpan.fullStart),o=new h(r.sourceSpan.start,s.sourceSpan.end,r.sourceSpan.fullStart);return new Gt(e.parts[0],i.rootNodes,a,e.sourceSpan,o)}_collectExpansionExpTokens(e){let r=[],n=[22];for(;;){if((this._peek.type===20||this._peek.type===22)&&n.push(this._peek.type),this._peek.type===23)if(Xs(n,22)){if(n.pop(),n.length===0)return r}else return this.errors.push(L.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===24)if(Xs(n,20))n.pop();else return this.errors.push(L.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===34)return this.errors.push(L.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;r.push(this._advance())}}_getText(e){let r=e.parts[0];if(r.length>0&&r[0]==` +`){let n=this._getClosestParentElement();n!=null&&n.children.length==0&&this.getTagDefinition(n.name).ignoreFirstLf&&(r=r.substring(1))}return r}_consumeText(e){let r=[e],n=e.sourceSpan,s=e.parts[0];if(s.length>0&&s[0]===` +`){let i=this._getContainer();i!=null&&i.children.length===0&&this.getTagDefinition(i.name).ignoreFirstLf&&(s=s.substring(1),r[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[s]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)e=this._advance(),r.push(e),e.type===8?s+=e.parts.join("").replace(/&([^;]+);/g,Js):e.type===9?s+=e.parts[0]:s+=e.parts.join("");if(s.length>0){let i=e.sourceSpan;this._addToParent(new Ut(s,new h(n.start,i.end,n.fullStart,n.details),r))}}_closeVoidElement(){let e=this._getContainer();e instanceof Y&&this.getTagDefinition(e.name).isVoid&&this._containerStack.pop()}_consumeStartTag(e){let[r,n]=e.parts,s=[];for(;this._peek.type===14;)s.push(this._consumeAttr(this._advance()));let i=this._getElementFullName(r,n,this._getClosestParentElement()),a=!1;if(this._peek.type===2){this._advance(),a=!0;let C=this.getTagDefinition(i);this.canSelfClose||C.canSelfClose||Me(i)!==null||C.isVoid||this.errors.push(L.create(i,e.sourceSpan,`Only void, custom and foreign elements can be self closed "${e.parts[1]}"`))}else this._peek.type===1&&(this._advance(),a=!1);let o=this._peek.sourceSpan.fullStart,u=new h(e.sourceSpan.start,o,e.sourceSpan.fullStart),p=new h(e.sourceSpan.start,o,e.sourceSpan.fullStart),l=new h(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),f=new Y(i,s,[],u,p,void 0,l),d=this._getContainer();this._pushContainer(f,d instanceof Y&&this.getTagDefinition(d.name).isClosedByChild(f.name)),a?this._popContainer(i,Y,u):e.type===4&&(this._popContainer(i,Y,null),this.errors.push(L.create(i,u,`Opening tag "${i}" not terminated.`)))}_pushContainer(e,r){r&&this._containerStack.pop(),this._addToParent(e),this._containerStack.push(e)}_consumeEndTag(e){let r=this.allowHtmComponentClosingTags&&e.parts.length===0?null:this._getElementFullName(e.parts[0],e.parts[1],this._getClosestParentElement());if(r&&this.getTagDefinition(r).isVoid)this.errors.push(L.create(r,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popContainer(r,Y,e.sourceSpan)){let n=`Unexpected closing tag "${r}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(L.create(r,e.sourceSpan,n))}}_popContainer(e,r,n){let s=!1;for(let i=this._containerStack.length-1;i>=0;i--){let a=this._containerStack[i];if(Me(a.name)?a.name===e:(e==null||a.name.toLowerCase()===e.toLowerCase())&&a instanceof r)return a.endSourceSpan=n,a.sourceSpan.end=n!==null?n.end:a.sourceSpan.end,this._containerStack.splice(i,this._containerStack.length-i),!s;(a instanceof te||a instanceof Y&&!this.getTagDefinition(a.name).closedByParent)&&(s=!0)}return!1}_consumeAttr(e){let r=qe(e.parts[0],e.parts[1]),n=e.sourceSpan.end,s;this._peek.type===15&&(s=this._advance());let i="",a=[],o,u;if(this._peek.type===16)for(o=this._peek.sourceSpan,u=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let f=this._advance();a.push(f),f.type===17?i+=f.parts.join("").replace(/&([^;]+);/g,Js):f.type===9?i+=f.parts[0]:i+=f.parts.join(""),u=n=f.sourceSpan.end}this._peek.type===15&&(u=n=this._advance().sourceSpan.end);let l=o&&u&&new h((s==null?void 0:s.sourceSpan.start)??o.start,u,(s==null?void 0:s.sourceSpan.fullStart)??o.fullStart);return new Yt(r,i,new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),e.sourceSpan,l,a.length>0?a:void 0,void 0)}_consumeBlockOpen(e){let r=[];for(;this._peek.type===28;){let o=this._advance();r.push(new ht(o.parts[0],o.sourceSpan))}this._peek.type===26&&this._advance();let n=this._peek.sourceSpan.fullStart,s=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),i=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),a=new te(e.parts[0],r,[],s,e.sourceSpan,i);this._pushContainer(a,!1)}_consumeBlockClose(e){this._popContainer(null,te,e.sourceSpan)||this.errors.push(L.create(null,e.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(e){let r=[];for(;this._peek.type===28;){let o=this._advance();r.push(new ht(o.parts[0],o.sourceSpan))}let n=this._peek.sourceSpan.fullStart,s=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),i=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),a=new te(e.parts[0],r,[],s,e.sourceSpan,i);this._pushContainer(a,!1),this._popContainer(null,te,null),this.errors.push(L.create(e.parts[0],s,`Incomplete block "${e.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(e){let r=e.parts[0],n,s;if(this._peek.type!==31){this.errors.push(L.create(e.parts[0],e.sourceSpan,`Invalid @let declaration "${r}". Declaration must have a value.`));return}else n=this._advance();if(this._peek.type!==32){this.errors.push(L.create(e.parts[0],e.sourceSpan,`Unterminated @let declaration "${r}". Declaration must be terminated with a semicolon.`));return}else s=this._advance();let i=s.sourceSpan.fullStart,a=new h(e.sourceSpan.start,i,e.sourceSpan.fullStart),o=e.sourceSpan.toString().lastIndexOf(r),u=e.sourceSpan.start.moveBy(o),p=new h(u,e.sourceSpan.end),l=new ft(r,n.parts[0],a,p,n.sourceSpan);this._addToParent(l)}_consumeIncompleteLet(e){let r=e.parts[0]??"",n=r?` "${r}"`:"";if(r.length>0){let s=e.sourceSpan.toString().lastIndexOf(r),i=e.sourceSpan.start.moveBy(s),a=new h(i,e.sourceSpan.end),o=new h(e.sourceSpan.start,e.sourceSpan.start.moveBy(0)),u=new ft(r,"",e.sourceSpan,a,o);this._addToParent(u)}this.errors.push(L.create(e.parts[0],e.sourceSpan,`Incomplete @let declaration${n}. @let declarations must be written as \`@let = ;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let e=this._containerStack.length-1;e>-1;e--)if(this._containerStack[e]instanceof Y)return this._containerStack[e];return null}_addToParent(e){let r=this._getContainer();r===null?this.rootNodes.push(e):r.children.push(e)}_getElementFullName(e,r,n){if(e===""&&(e=this.getTagDefinition(r).implicitNamespacePrefix||"",e===""&&n!=null)){let s=ct(n.name)[1];this.getTagDefinition(s).preventNamespaceInheritance||(e=Me(n.name))}return qe(e,r)}};function Xs(t,e){return t.length>0&&t[t.length-1]===e}function Js(t,e){return Ve[e]!==void 0?Ve[e]||t:/^#x[a-f0-9]+$/i.test(e)?String.fromCodePoint(parseInt(e.slice(2),16)):/^#\d+$/.test(e)?String.fromCodePoint(parseInt(e.slice(1),10)):t}var sr=class extends nr{constructor(){super(He)}parse(e,r,n,s=!1,i){return super.parse(e,r,n,s,i)}};var Kr=null,bo=()=>(Kr||(Kr=new sr),Kr);function Qr(t,e={}){let{canSelfClose:r=!1,allowHtmComponentClosingTags:n=!1,isTagNameCaseSensitive:s=!1,getTagContentType:i,tokenizeAngularBlocks:a=!1,tokenizeAngularLetDeclaration:o=!1}=e;return bo().parse(t,"angular-html-parser",{tokenizeExpansionForms:a,interpolationConfig:void 0,canSelfClose:r,allowHtmComponentClosingTags:n,tokenizeBlocks:a,tokenizeLet:o},s,i)}function To(t,e){let r=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(r,e)}var Zs=To;var _t=3;function xo(t){let e=t.slice(0,_t);if(e!=="---"&&e!=="+++")return;let r=t.indexOf(` +`,_t);if(r===-1)return;let n=t.slice(_t,r).trim(),s=t.indexOf(` +${e}`,r),i=n;if(i||(i=e==="+++"?"toml":"yaml"),s===-1&&e==="---"&&i==="yaml"&&(s=t.indexOf(` +...`,r)),s===-1)return;let a=s+1+_t,o=t.charAt(a+1);if(!/\s?/u.test(o))return;let u=t.slice(0,a);return{type:"front-matter",language:i,explicitLanguage:n,value:t.slice(r+1,s),startDelimiter:e,endDelimiter:u.slice(-_t),raw:u}}function ko(t){let e=xo(t);if(!e)return{content:t};let{raw:r}=e;return{frontMatter:e,content:w(!1,r,/[^\n]/gu," ")+t.slice(r.length)}}var ei=ko;var ir={attrs:!0,children:!0,cases:!0,expression:!0},ti=new Set(["parent"]),le,Xr,Jr,ze=class ze{constructor(e={}){Et(this,le);lr(this,"type");lr(this,"parent");for(let r of new Set([...ti,...Object.keys(e)]))this.setProperty(r,e[r])}setProperty(e,r){if(this[e]!==r){if(e in ir&&(r=r.map(n=>this.createChild(n))),!ti.has(e)){this[e]=r;return}Object.defineProperty(this,e,{value:r,enumerable:!1,configurable:!0})}}map(e){let r;for(let n in ir){let s=this[n];if(s){let i=Bo(s,a=>a.map(e));r!==s&&(r||(r=new ze({parent:this.parent})),r.setProperty(n,i))}}if(r)for(let n in this)n in ir||(r[n]=this[n]);return e(r||this)}walk(e){for(let r in ir){let n=this[r];if(n)for(let s=0;s[e.fullName,e.value]))}};le=new WeakSet,Xr=function(){return this.type==="angularIcuCase"?"expression":this.type==="angularIcuExpression"?"cases":"children"},Jr=function(){var e;return((e=this.parent)==null?void 0:e.$children)??[]};var ar=ze;function Bo(t,e){let r=t.map(e);return r.some((n,s)=>n!==t[s])?r:t}var Lo=[{regex:/^(\[if([^\]]*)\]>)(.*?){try{return[!0,e(i,o).children]}catch{return[!1,[{type:"text",value:i,sourceSpan:new h(o,u)}]]}})();return{type:"ieConditionalComment",complete:p,children:l,condition:w(!1,s.trim(),/\s+/gu," "),sourceSpan:t.sourceSpan,startSourceSpan:new h(t.sourceSpan.start,o),endSourceSpan:new h(u,t.sourceSpan.end)}}function No(t,e,r){let[,n]=r;return{type:"ieConditionalStartComment",condition:w(!1,n.trim(),/\s+/gu," "),sourceSpan:t.sourceSpan}}function Po(t){return{type:"ieConditionalEndComment",sourceSpan:t.sourceSpan}}var or=new Map([["*",new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alt","autocomplete","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]);var ni=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);function Io(t){if(t.type==="block"){if(t.name=w(!1,t.name.toLowerCase(),/\s+/gu," ").trim(),t.type="angularControlFlowBlock",!Ie(t.parameters)){delete t.parameters;return}for(let e of t.parameters)e.type="angularControlFlowBlockParameter";t.parameters={type:"angularControlFlowBlockParameters",children:t.parameters,sourceSpan:new h(t.parameters[0].sourceSpan.start,K(!1,t.parameters,-1).sourceSpan.end)}}}function Ro(t){t.type==="letDeclaration"&&(t.type="angularLetDeclaration",t.id=t.name,t.init={type:"angularLetDeclarationInitializer",sourceSpan:new h(t.valueSpan.start,t.valueSpan.end),value:t.value},delete t.name,delete t.value)}function $o(t){(t.type==="plural"||t.type==="select")&&(t.clause=t.type,t.type="angularIcuExpression"),t.type==="expansionCase"&&(t.type="angularIcuCase")}function ii(t,e,r){let{name:n,canSelfClose:s=!0,normalizeTagName:i=!1,normalizeAttributeName:a=!1,allowHtmComponentClosingTags:o=!1,isTagNameCaseSensitive:u=!1,shouldParseAsRawText:p}=e,{rootNodes:l,errors:f}=Qr(t,{canSelfClose:s,allowHtmComponentClosingTags:o,isTagNameCaseSensitive:u,getTagContentType:p?(...c)=>p(...c)?P.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:n==="angular"?!0:void 0,tokenizeAngularLetDeclaration:n==="angular"?!0:void 0});if(n==="vue"){if(l.some(x=>x.type==="docType"&&x.value==="html"||x.type==="element"&&x.name.toLowerCase()==="html"))return ii(t,oi,r);let g,y=()=>g??(g=Qr(t,{canSelfClose:s,allowHtmComponentClosingTags:o,isTagNameCaseSensitive:u})),q=x=>y().rootNodes.find(({startSourceSpan:U})=>U&&U.start.offset===x.startSourceSpan.start.offset)??x;for(let[x,U]of l.entries()){let{endSourceSpan:tn,startSourceSpan:ui}=U;if(tn===null)f=y().errors,l[x]=q(U);else if(Oo(U,r)){let rn=y().errors.find(nn=>nn.span.start.offset>ui.start.offset&&nn.span.start.offset0&&si(f[0]);let d=c=>{let g=c.name.startsWith(":")?c.name.slice(1).split(":")[0]:null,y=c.nameSpan.toString(),q=g!==null&&y.startsWith(`${g}:`),x=q?y.slice(g.length+1):y;c.name=x,c.namespace=g,c.hasExplicitNamespace=q},C=c=>{switch(c.type){case"element":d(c);for(let g of c.attrs)d(g),g.valueSpan?(g.value=g.valueSpan.toString(),/["']/u.test(g.value[0])&&(g.value=g.value.slice(1,-1))):g.value=null;break;case"comment":c.value=c.sourceSpan.toString().slice(4,-3);break;case"text":c.value=c.sourceSpan.toString();break}},A=(c,g)=>{let y=c.toLowerCase();return g(y)?y:c},D=c=>{if(c.type==="element"&&(i&&(!c.namespace||c.namespace===c.tagDefinition.implicitNamespacePrefix||fe(c))&&(c.name=A(c.name,g=>ni.has(g))),a))for(let g of c.attrs)g.namespace||(g.name=A(g.name,y=>or.has(c.name)&&(or.get("*").has(y)||or.get(c.name).has(y))))},I=c=>{c.sourceSpan&&c.endSourceSpan&&(c.sourceSpan=new h(c.sourceSpan.start,c.endSourceSpan.end))},F=c=>{if(c.type==="element"){let g=He(u?c.name:c.name.toLowerCase());!c.namespace||c.namespace===g.implicitNamespacePrefix||fe(c)?c.tagDefinition=g:c.tagDefinition=He("")}};return Qt(new class extends mt{visitExpansionCase(c,g){n==="angular"&&this.visitChildren(g,y=>{y(c.expression)})}visit(c){C(c),F(c),D(c),I(c)}},l),l}function Oo(t,e){var n;if(t.type!=="element"||t.name!=="template")return!1;let r=(n=t.attrs.find(s=>s.name==="lang"))==null?void 0:n.value;return!r||Ne(e,{language:r})==="html"}function si(t){let{msg:e,span:{start:r,end:n}}=t;throw Zs(e,{loc:{start:{line:r.line+1,column:r.col+1},end:{line:n.line+1,column:n.col+1}},cause:t})}function ai(t,e,r={},n=!0){let{frontMatter:s,content:i}=n?ei(t):{frontMatter:null,content:t},a=new De(t,r.filepath),o=new ie(a,0,0,0),u=o.moveBy(t.length),p={type:"root",sourceSpan:new h(o,u),children:ii(i,e,r)};if(s){let d=new ie(a,0,0,0),C=d.moveBy(s.raw.length);s.sourceSpan=new h(d,C),p.children.unshift(s)}let l=new ar(p),f=(d,C)=>{let{offset:A}=C,D=w(!1,t.slice(0,A),/[^\n\r]/gu," "),F=ai(D+d,e,r,!1);F.sourceSpan=new h(C,K(!1,F.children,-1).sourceSpan.end);let c=F.children[0];return c.length===A?F.children.shift():(c.sourceSpan=new h(c.sourceSpan.start.moveBy(A),c.sourceSpan.end),c.value=c.value.slice(A)),F};return l.walk(d=>{if(d.type==="comment"){let C=ri(d,f);C&&d.parent.replaceChild(d,C)}Io(d),Ro(d),$o(d)}),l}function ur(t){return{parse:(e,r)=>ai(e,t,r),hasPragma:fs,astFormat:"html",locStart:J,locEnd:Z}}var oi={name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0},Mo=ur(oi),qo=ur({name:"angular"}),Ho=ur({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(t,e,r,n){return t.toLowerCase()!=="html"&&!r&&(t!=="template"||n.some(({name:s,value:i})=>s==="lang"&&i!=="html"&&i!==""&&i!==void 0))}}),Vo=ur({name:"lwc",canSelfClose:!1});var Uo={html:Ts};var Gh=en;export{Gh as default,xs as languages,Bs as options,Zr as parsers,Uo as printers}; diff --git a/node_modules/prettier/plugins/markdown.js b/node_modules/prettier/plugins/markdown.js new file mode 100644 index 0000000..924b89b --- /dev/null +++ b/node_modules/prettier/plugins/markdown.js @@ -0,0 +1,63 @@ +(function(n){function e(){var i=n();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.markdown=e()}})(function(){"use strict";var ll=Object.create;var kr=Object.defineProperty;var fl=Object.getOwnPropertyDescriptor;var Dl=Object.getOwnPropertyNames;var pl=Object.getPrototypeOf,hl=Object.prototype.hasOwnProperty;var zn=e=>{throw TypeError(e)};var C=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Yn=(e,r)=>{for(var t in r)kr(e,t,{get:r[t],enumerable:!0})},Gn=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Dl(r))!hl.call(e,a)&&a!==t&&kr(e,a,{get:()=>r[a],enumerable:!(n=fl(r,a))||n.enumerable});return e};var Ue=(e,r,t)=>(t=e!=null?ll(pl(e)):{},Gn(r||!e||!e.__esModule?kr(t,"default",{value:e,enumerable:!0}):t,e)),dl=e=>Gn(kr({},"__esModule",{value:!0}),e);var Vn=(e,r,t)=>r.has(e)||zn("Cannot "+t);var ce=(e,r,t)=>(Vn(e,r,"read from private field"),t?t.call(e):r.get(e)),jn=(e,r,t)=>r.has(e)?zn("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,t),$n=(e,r,t,n)=>(Vn(e,r,"write to private field"),n?n.call(e,t):r.set(e,t),t);var Br=C((Vm,Wn)=>{"use strict";Wn.exports=gl;function gl(e){return String(e).replace(/\s+/g," ")}});var Vi=C((Tv,Gi)=>{"use strict";Gi.exports=xf;var Dr=9,Mr=10,je=32,bf=33,yf=58,$e=91,Af=92,St=93,pr=94,zr=96,Yr=4,wf=1024;function xf(e){var r=this.Parser,t=this.Compiler;kf(r)&&Tf(r,e),Bf(t)&&qf(t)}function kf(e){return!!(e&&e.prototype&&e.prototype.blockTokenizers)}function Bf(e){return!!(e&&e.prototype&&e.prototype.visitors)}function Tf(e,r){for(var t=r||{},n=e.prototype,a=n.blockTokenizers,u=n.inlineTokenizers,i=n.blockMethods,o=n.inlineMethods,s=a.definition,l=u.reference,c=[],f=-1,p=i.length,d;++fYr&&(Z=void 0,ve=T);else{if(Z0&&(M=Ee[k-1],M.contentStart===M.contentEnd);)k--;for(Be=b(g.slice(0,M.contentEnd));++T{Lt.isRemarkParser=Sf;Lt.isRemarkCompiler=Of;function Sf(e){return!!(e&&e.prototype&&e.prototype.blockTokenizers)}function Of(e){return!!(e&&e.prototype&&e.prototype.visitors)}});var Xi=C((_v,Ji)=>{var ji=Pt();Ji.exports=Nf;var $i=9,Wi=32,Gr=36,Lf=48,Pf=57,Hi=92,If=["math","math-inline"],Ki="math-display";function Nf(e){let r=this.Parser,t=this.Compiler;ji.isRemarkParser(r)&&Rf(r,e),ji.isRemarkCompiler(t)&&Uf(t,e)}function Rf(e,r){let t=e.prototype,n=t.inlineMethods;u.locator=a,t.inlineTokenizers.math=u,n.splice(n.indexOf("text"),0,"math");function a(i,o){return i.indexOf("$",o)}function u(i,o,s){let l=o.length,c=!1,f=!1,p=0,d,D,h,m,F,y,E;if(o.charCodeAt(p)===Hi&&(f=!0,p++),o.charCodeAt(p)===Gr){if(p++,f)return s?!0:i(o.slice(0,p))({type:"text",value:"$"});if(o.charCodeAt(p)===Gr&&(c=!0,p++),h=o.charCodeAt(p),!(h===Wi||h===$i)){for(m=p;pPf)&&(!c||h===Gr)){F=p-1,p++,c&&p++,y=p;break}}else D===Hi&&(p++,h=o.charCodeAt(p+1));p++}if(y!==void 0)return s?!0:(E=o.slice(m,F+1),i(o.slice(0,y))({type:"inlineMath",value:E,data:{hName:"span",hProperties:{className:If.concat(c&&r.inlineMathDouble?[Ki]:[])},hChildren:[{type:"text",value:E}]}}))}}}}function Uf(e){let r=e.prototype;r.visitors.inlineMath=t;function t(n){let a="$";return(n.data&&n.data.hProperties&&n.data.hProperties.className||[]).includes(Ki)&&(a="$$"),a+n.value+a}}});var tu=C((Sv,ru)=>{var Qi=Pt();ru.exports=Gf;var Zi=10,hr=32,It=36,eu=` +`,Mf="$",zf=2,Yf=["math","math-display"];function Gf(){let e=this.Parser,r=this.Compiler;Qi.isRemarkParser(e)&&Vf(e),Qi.isRemarkCompiler(r)&&jf(r)}function Vf(e){let r=e.prototype,t=r.blockMethods,n=r.interruptParagraph,a=r.interruptList,u=r.interruptBlockquote;r.blockTokenizers.math=i,t.splice(t.indexOf("fencedCode")+1,0,"math"),n.splice(n.indexOf("fencedCode")+1,0,["math"]),a.splice(a.indexOf("fencedCode")+1,0,["math"]),u.splice(u.indexOf("fencedCode")+1,0,["math"]);function i(o,s,l){var c=s.length,f=0;let p,d,D,h,m,F,y,E,B,b,g;for(;fb&&s.charCodeAt(h-1)===hr;)h--;for(;h>b&&s.charCodeAt(h-1)===It;)B++,h--;for(F<=B&&s.indexOf(Mf,b)===h&&(E=!0,g=h);b<=g&&b-fb&&s.charCodeAt(g-1)===hr;)g--;if((!E||b!==g)&&d.push(s.slice(b,g)),E)break;f=D+1,D=s.indexOf(eu,f+1),D=D===-1?c:D}return d=d.join(` +`),o(s.slice(0,D))({type:"math",value:d,data:{hName:"div",hProperties:{className:Yf.concat()},hChildren:[{type:"text",value:d}]}})}}}}function jf(e){let r=e.prototype;r.visitors.math=t;function t(n){return`$$ +`+n.value+` +$$`}}});var iu=C((Ov,nu)=>{var $f=Xi(),Wf=tu();nu.exports=Hf;function Hf(e){var r=e||{};Wf.call(this,r),$f.call(this,r)}});var Ie=C((Lv,uu)=>{uu.exports=Jf;var Kf=Object.prototype.hasOwnProperty;function Jf(){for(var e={},r=0;r{typeof Object.create=="function"?Nt.exports=function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:Nt.exports=function(r,t){if(t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r}}});var cu=C((Iv,su)=>{"use strict";var Xf=Ie(),ou=au();su.exports=Qf;function Qf(e){var r,t,n;ou(u,e),ou(a,u),r=u.prototype;for(t in r)n=r[t],n&&typeof n=="object"&&(r[t]="concat"in n?n.concat():Xf(n));return u;function a(i){return e.apply(this,i)}function u(){return this instanceof u?e.apply(this,arguments):new a(arguments)}}});var fu=C((Nv,lu)=>{"use strict";lu.exports=Zf;function Zf(e,r,t){return n;function n(){var a=t||this,u=a[e];return a[e]=!r,i;function i(){a[e]=u}}}});var pu=C((Rv,Du)=>{"use strict";Du.exports=eD;function eD(e){for(var r=String(e),t=[],n=/\r?\n|\r/g;n.exec(r);)t.push(n.lastIndex);return t.push(r.length+1),{toPoint:a,toPosition:a,toOffset:u};function a(i){var o=-1;if(i>-1&&ii)return{line:o+1,column:i-(t[o-1]||0)+1,offset:i}}return{}}function u(i){var o=i&&i.line,s=i&&i.column,l;return!isNaN(o)&&!isNaN(s)&&o-1 in t&&(l=(t[o-2]||0)+s-1||0),l>-1&&l{"use strict";hu.exports=rD;var Rt="\\";function rD(e,r){return t;function t(n){for(var a=0,u=n.indexOf(Rt),i=e[r],o=[],s;u!==-1;)o.push(n.slice(a,u)),a=u+1,s=n.charAt(a),(!s||i.indexOf(s)===-1)&&o.push(Rt),u=n.indexOf(Rt,a+1);return o.push(n.slice(a)),o.join("")}}});var mu=C((Mv,tD)=>{tD.exports={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Acirc:"\xC2",Agrave:"\xC0",Aring:"\xC5",Atilde:"\xC3",Auml:"\xC4",COPY:"\xA9",Ccedil:"\xC7",ETH:"\xD0",Eacute:"\xC9",Ecirc:"\xCA",Egrave:"\xC8",Euml:"\xCB",GT:">",Iacute:"\xCD",Icirc:"\xCE",Igrave:"\xCC",Iuml:"\xCF",LT:"<",Ntilde:"\xD1",Oacute:"\xD3",Ocirc:"\xD4",Ograve:"\xD2",Oslash:"\xD8",Otilde:"\xD5",Ouml:"\xD6",QUOT:'"',REG:"\xAE",THORN:"\xDE",Uacute:"\xDA",Ucirc:"\xDB",Ugrave:"\xD9",Uuml:"\xDC",Yacute:"\xDD",aacute:"\xE1",acirc:"\xE2",acute:"\xB4",aelig:"\xE6",agrave:"\xE0",amp:"&",aring:"\xE5",atilde:"\xE3",auml:"\xE4",brvbar:"\xA6",ccedil:"\xE7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",ecirc:"\xEA",egrave:"\xE8",eth:"\xF0",euml:"\xEB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",iacute:"\xED",icirc:"\xEE",iexcl:"\xA1",igrave:"\xEC",iquest:"\xBF",iuml:"\xEF",laquo:"\xAB",lt:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",oacute:"\xF3",ocirc:"\xF4",ograve:"\xF2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",otilde:"\xF5",ouml:"\xF6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',raquo:"\xBB",reg:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",times:"\xD7",uacute:"\xFA",ucirc:"\xFB",ugrave:"\xF9",uml:"\xA8",uuml:"\xFC",yacute:"\xFD",yen:"\xA5",yuml:"\xFF"}});var Fu=C((zv,nD)=>{nD.exports={"0":"\uFFFD","128":"\u20AC","130":"\u201A","131":"\u0192","132":"\u201E","133":"\u2026","134":"\u2020","135":"\u2021","136":"\u02C6","137":"\u2030","138":"\u0160","139":"\u2039","140":"\u0152","142":"\u017D","145":"\u2018","146":"\u2019","147":"\u201C","148":"\u201D","149":"\u2022","150":"\u2013","151":"\u2014","152":"\u02DC","153":"\u2122","154":"\u0161","155":"\u203A","156":"\u0153","158":"\u017E","159":"\u0178"}});var Ne=C((Yv,gu)=>{"use strict";gu.exports=iD;function iD(e){var r=typeof e=="string"?e.charCodeAt(0):e;return r>=48&&r<=57}});var Eu=C((Gv,vu)=>{"use strict";vu.exports=uD;function uD(e){var r=typeof e=="string"?e.charCodeAt(0):e;return r>=97&&r<=102||r>=65&&r<=70||r>=48&&r<=57}});var We=C((Vv,Cu)=>{"use strict";Cu.exports=aD;function aD(e){var r=typeof e=="string"?e.charCodeAt(0):e;return r>=97&&r<=122||r>=65&&r<=90}});var yu=C((jv,bu)=>{"use strict";var oD=We(),sD=Ne();bu.exports=cD;function cD(e){return oD(e)||sD(e)}});var Au=C(($v,lD)=>{lD.exports={AEli:"\xC6",AElig:"\xC6",AM:"&",AMP:"&",Aacut:"\xC1",Aacute:"\xC1",Abreve:"\u0102",Acir:"\xC2",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrav:"\xC0",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Arin:"\xC5",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atild:"\xC3",Atilde:"\xC3",Aum:"\xC4",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COP:"\xA9",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedi:"\xC7",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ET:"\xD0",ETH:"\xD0",Eacut:"\xC9",Eacute:"\xC9",Ecaron:"\u011A",Ecir:"\xCA",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrav:"\xC8",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Eum:"\xCB",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",G:">",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacut:"\xCD",Iacute:"\xCD",Icir:"\xCE",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrav:"\xCC",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Ium:"\xCF",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",L:"<",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` +`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntild:"\xD1",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacut:"\xD3",Oacute:"\xD3",Ocir:"\xD4",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograv:"\xD2",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslas:"\xD8",Oslash:"\xD8",Otild:"\xD5",Otilde:"\xD5",Otimes:"\u2A37",Oum:"\xD6",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUO:'"',QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",RE:"\xAE",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THOR:"\xDE",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacut:"\xDA",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucir:"\xDB",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrav:"\xD9",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uum:"\xDC",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacut:"\xDD",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacut:"\xE1",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acir:"\xE2",acirc:"\xE2",acut:"\xB4",acute:"\xB4",acy:"\u0430",aeli:"\xE6",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrav:"\xE0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",am:"&",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",arin:"\xE5",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atild:"\xE3",atilde:"\xE3",aum:"\xE4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvba:"\xA6",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedi:"\xE7",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedi:"\xB8",cedil:"\xB8",cemptyv:"\u29B2",cen:"\xA2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",cop:"\xA9",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curre:"\xA4",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",de:"\xB0",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divid:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacut:"\xE9",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\xEA",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrav:"\xE8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",et:"\xF0",eth:"\xF0",eum:"\xEB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac1:"\xBC",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac3:"\xBE",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",g:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacut:"\xED",iacute:"\xED",ic:"\u2063",icir:"\xEE",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexc:"\xA1",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrav:"\xEC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iques:"\xBF",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",ium:"\xEF",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laqu:"\xAB",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",l:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",mac:"\xAF",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micr:"\xB5",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middo:"\xB7",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbs:"\xA0",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",no:"\xAC",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntild:"\xF1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacut:"\xF3",oacute:"\xF3",oast:"\u229B",ocir:"\xF4",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograv:"\xF2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\xBA",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslas:"\xF8",oslash:"\xF8",osol:"\u2298",otild:"\xF5",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",oum:"\xF6",ouml:"\xF6",ovbar:"\u233D",par:"\xB6",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusm:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",poun:"\xA3",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quo:'"',quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raqu:"\xBB",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",re:"\xAE",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sec:"\xA7",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",sh:"\xAD",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szli:"\xDF",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thor:"\xFE",thorn:"\xFE",tilde:"\u02DC",time:"\xD7",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacut:"\xFA",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucir:"\xFB",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrav:"\xF9",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",um:"\xA8",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uum:"\xFC",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacut:"\xFD",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",ye:"\xA5",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yum:"\xFF",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});var ku=C((Wv,xu)=>{"use strict";var wu=Au();xu.exports=DD;var fD={}.hasOwnProperty;function DD(e){return fD.call(wu,e)?wu[e]:!1}});var dr=C((Hv,Mu)=>{"use strict";var Bu=mu(),Tu=Fu(),pD=Ne(),hD=Eu(),Ou=yu(),dD=ku();Mu.exports=BD;var mD={}.hasOwnProperty,He=String.fromCharCode,FD=Function.prototype,qu={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},gD=9,_u=10,vD=12,ED=32,Su=38,CD=59,bD=60,yD=61,AD=35,wD=88,xD=120,kD=65533,Ke="named",Mt="hexadecimal",zt="decimal",Yt={};Yt[Mt]=16;Yt[zt]=10;var Vr={};Vr[Ke]=Ou;Vr[zt]=pD;Vr[Mt]=hD;var Lu=1,Pu=2,Iu=3,Nu=4,Ru=5,Ut=6,Uu=7,we={};we[Lu]="Named character references must be terminated by a semicolon";we[Pu]="Numeric character references must be terminated by a semicolon";we[Iu]="Named character references cannot be empty";we[Nu]="Numeric character references cannot be empty";we[Ru]="Named character references must be known";we[Ut]="Numeric character references cannot be disallowed";we[Uu]="Numeric character references cannot be outside the permissible Unicode range";function BD(e,r){var t={},n,a;r||(r={});for(a in qu)n=r[a],t[a]=n??qu[a];return(t.position.indent||t.position.start)&&(t.indent=t.position.indent||[],t.position=t.position.start),TD(e,t)}function TD(e,r){var t=r.additional,n=r.nonTerminated,a=r.text,u=r.reference,i=r.warning,o=r.textContext,s=r.referenceContext,l=r.warningContext,c=r.position,f=r.indent||[],p=e.length,d=0,D=-1,h=c.column||1,m=c.line||1,F="",y=[],E,B,b,g,A,w,v,x,k,T,q,R,O,S,_,L,Be,W,I;for(typeof t=="string"&&(t=t.charCodeAt(0)),L=ee(),x=i?Z:FD,d--,p++;++d65535&&(w-=65536,T+=He(w>>>10|55296),w=56320|w&1023),w=T+He(w))):S!==Ke&&x(Nu,W)),w?(ve(),L=ee(),d=I-1,h+=I-O+1,y.push(w),Be=ee(),Be.offset++,u&&u.call(s,w,{start:L,end:Be},e.slice(O-1,I)),L=Be):(g=e.slice(O-1,I),F+=g,h+=g.length,d=I-1)}else A===10&&(m++,D++,h=0),A===A?(F+=He(A),h++):ve();return y.join("");function ee(){return{line:m,column:h,offset:d+(c.offset||0)}}function Z(Ee,M){var Dt=ee();Dt.column+=M,Dt.offset+=M,i.call(l,we[Ee],Dt,Ee)}function ve(){F&&(y.push(F),a&&a.call(o,F,{start:L,end:ee()}),F="")}}function qD(e){return e>=55296&&e<=57343||e>1114111}function _D(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}});var Gu=C((Kv,Yu)=>{"use strict";var SD=Ie(),zu=dr();Yu.exports=OD;function OD(e){return t.raw=n,t;function r(u){for(var i=e.offset,o=u.line,s=[];++o&&o in i;)s.push((i[o]||0)+1);return{start:u,indent:s}}function t(u,i,o){zu(u,{position:r(i),warning:a,text:o,reference:o,textContext:e,referenceContext:e})}function n(u,i,o){return zu(u,SD(o,{position:r(i),warning:a}))}function a(u,i,o){o!==3&&e.file.message(u,i)}}});var $u=C((Jv,ju)=>{"use strict";ju.exports=LD;function LD(e){return r;function r(t,n){var a=this,u=a.offset,i=[],o=a[e+"Methods"],s=a[e+"Tokenizers"],l=n.line,c=n.column,f,p,d,D,h,m;if(!t)return i;for(w.now=E,w.file=a.file,F("");t;){for(f=-1,p=o.length,h=!1;++f{"use strict";Hu.exports=jr;var Gt=["\\","`","*","{","}","[","]","(",")","#","+","-",".","!","_",">"],Vt=Gt.concat(["~","|"]),Wu=Vt.concat([` +`,'"',"$","%","&","'",",","/",":",";","<","=","?","@","^"]);jr.default=Gt;jr.gfm=Vt;jr.commonmark=Wu;function jr(e){var r=e||{};return r.commonmark?Wu:r.gfm?Vt:Gt}});var Xu=C((Qv,Ju)=>{"use strict";Ju.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","pre","section","source","title","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]});var jt=C((Zv,Qu)=>{"use strict";Qu.exports={position:!0,gfm:!0,commonmark:!1,pedantic:!1,blocks:Xu()}});var ea=C((eE,Zu)=>{"use strict";var ND=Ie(),RD=Ku(),UD=jt();Zu.exports=MD;function MD(e){var r=this,t=r.options,n,a;if(e==null)e={};else if(typeof e=="object")e=ND(e);else throw new Error("Invalid value `"+e+"` for setting `options`");for(n in UD){if(a=e[n],a==null&&(a=t[n]),n!=="blocks"&&typeof a!="boolean"||n==="blocks"&&typeof a!="object")throw new Error("Invalid value `"+a+"` for setting `options."+n+"`");e[n]=a}return r.options=e,r.escape=RD(e),r}});var na=C((rE,ta)=>{"use strict";ta.exports=ra;function ra(e){if(e==null)return VD;if(typeof e=="string")return GD(e);if(typeof e=="object")return"length"in e?YD(e):zD(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function zD(e){return r;function r(t){var n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function YD(e){for(var r=[],t=-1;++t{ia.exports=jD;function jD(e){return e}});var ca=C((nE,sa)=>{"use strict";sa.exports=$r;var $D=na(),WD=ua(),aa=!0,oa="skip",$t=!1;$r.CONTINUE=aa;$r.SKIP=oa;$r.EXIT=$t;function $r(e,r,t,n){var a,u;typeof r=="function"&&typeof t!="function"&&(n=t,t=r,r=null),u=$D(r),a=n?-1:1,i(e,null,[])();function i(o,s,l){var c=typeof o=="object"&&o!==null?o:{},f;return typeof c.type=="string"&&(f=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0,p.displayName="node ("+WD(c.type+(f?"<"+f+">":""))+")"),p;function p(){var d=l.concat(o),D=[],h,m;if((!r||u(o,s,l[l.length-1]||null))&&(D=HD(t(o,l)),D[0]===$t))return D;if(o.children&&D[0]!==oa)for(m=(n?o.children.length:-1)+a;m>-1&&m{"use strict";la.exports=Hr;var Wr=ca(),KD=Wr.CONTINUE,JD=Wr.SKIP,XD=Wr.EXIT;Hr.CONTINUE=KD;Hr.SKIP=JD;Hr.EXIT=XD;function Hr(e,r,t,n){typeof r=="function"&&typeof t!="function"&&(n=t,t=r,r=null),Wr(e,r,a,n);function a(u,i){var o=i[i.length-1],s=o?o.children.indexOf(u):null;return t(u,s,o)}}});var pa=C((uE,Da)=>{"use strict";var QD=fa();Da.exports=ZD;function ZD(e,r){return QD(e,r?ep:rp),e}function ep(e){delete e.position}function rp(e){e.position=void 0}});var ma=C((aE,da)=>{"use strict";var ha=Ie(),tp=pa();da.exports=up;var np=` +`,ip=/\r\n|\r/g;function up(){var e=this,r=String(e.file),t={line:1,column:1,offset:0},n=ha(t),a;return r=r.replace(ip,np),r.charCodeAt(0)===65279&&(r=r.slice(1),n.column++,n.offset++),a={type:"root",children:e.tokenizeBlock(r,n),position:{start:t,end:e.eof||ha(t)}},e.options.position||tp(a,!0),a}});var ga=C((oE,Fa)=>{"use strict";var ap=/^[ \t]*(\n|$)/;Fa.exports=op;function op(e,r,t){for(var n,a="",u=0,i=r.length;u{"use strict";var me="",Wt;va.exports=sp;function sp(e,r){if(typeof e!="string")throw new TypeError("expected a string");if(r===1)return e;if(r===2)return e+e;var t=e.length*r;if(Wt!==e||typeof Wt>"u")Wt=e,me="";else if(me.length>=t)return me.substr(0,t);for(;t>me.length&&r>1;)r&1&&(me+=e),r>>=1,e+=e;return me+=e,me=me.substr(0,t),me}});var Ht=C((cE,Ea)=>{"use strict";Ea.exports=cp;function cp(e){return String(e).replace(/\n+$/,"")}});var ya=C((lE,ba)=>{"use strict";var lp=Kr(),fp=Ht();ba.exports=hp;var Kt=` +`,Ca=" ",Jt=" ",Dp=4,pp=lp(Jt,Dp);function hp(e,r,t){for(var n=-1,a=r.length,u="",i="",o="",s="",l,c,f;++n{"use strict";wa.exports=gp;var Jr=` +`,mr=" ",Je=" ",dp="~",Aa="`",mp=3,Fp=4;function gp(e,r,t){var n=this,a=n.options.gfm,u=r.length+1,i=0,o="",s,l,c,f,p,d,D,h,m,F,y,E,B;if(a){for(;i=Fp)){for(D="";i{Xe=ka.exports=vp;function vp(e){return e.trim?e.trim():Xe.right(Xe.left(e))}Xe.left=function(e){return e.trimLeft?e.trimLeft():e.replace(/^\s\s*/,"")};Xe.right=function(e){if(e.trimRight)return e.trimRight();for(var r=/\s/,t=e.length;r.test(e.charAt(--t)););return e.slice(0,t+1)}});var Xr=C((DE,Ba)=>{"use strict";Ba.exports=Ep;function Ep(e,r,t,n){for(var a=e.length,u=-1,i,o;++u{"use strict";var Cp=Re(),bp=Xr();_a.exports=yp;var Xt=` +`,Ta=" ",Qt=" ",qa=">";function yp(e,r,t){for(var n=this,a=n.offset,u=n.blockTokenizers,i=n.interruptBlockquote,o=e.now(),s=o.line,l=r.length,c=[],f=[],p=[],d,D=0,h,m,F,y,E,B,b,g;D{"use strict";La.exports=wp;var Oa=` +`,Fr=" ",gr=" ",vr="#",Ap=6;function wp(e,r,t){for(var n=this,a=n.options.pedantic,u=r.length+1,i=-1,o=e.now(),s="",l="",c,f,p;++iAp)&&!(!p||!a&&r.charAt(i+1)===vr)){for(u=r.length+1,f="";++i{"use strict";Na.exports=Sp;var xp=" ",kp=` +`,Ia=" ",Bp="*",Tp="-",qp="_",_p=3;function Sp(e,r,t){for(var n=-1,a=r.length+1,u="",i,o,s,l;++n=_p&&(!i||i===kp)?(u+=l,t?!0:e(u)({type:"thematicBreak"})):void 0}});var Zt=C((mE,Ma)=>{"use strict";Ma.exports=Ip;var Ua=" ",Op=" ",Lp=1,Pp=4;function Ip(e){for(var r=0,t=0,n=e.charAt(r),a={},u,i=0;n===Ua||n===Op;){for(u=n===Ua?Pp:Lp,t+=u,u>1&&(t=Math.floor(t/u)*u);i{"use strict";var Np=Re(),Rp=Kr(),Up=Zt();Ya.exports=Yp;var za=` +`,Mp=" ",zp="!";function Yp(e,r){var t=e.split(za),n=t.length+1,a=1/0,u=[],i,o,s;for(t.unshift(Rp(Mp,r)+zp);n--;)if(o=Up(t[n]),u[n]=o.stops,Np(t[n]).length!==0)if(o.indent)o.indent>0&&o.indent{"use strict";var Gp=Re(),Vp=Kr(),Va=Ne(),jp=Zt(),$p=Ga(),Wp=Xr();Ha.exports=rh;var en="*",Hp="_",ja="+",rn="-",$a=".",Fe=" ",ae=` +`,Qr=" ",Wa=")",Kp="x",xe=4,Jp=/\n\n(?!\s*$)/,Xp=/^\[([ X\tx])][ \t]/,Qp=/^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/,Zp=/^([ \t]*)([*+-]|\d+[.)])([ \t]+)/,eh=/^( {1,4}|\t)?/gm;function rh(e,r,t){for(var n=this,a=n.options.commonmark,u=n.options.pedantic,i=n.blockTokenizers,o=n.interruptList,s=0,l=r.length,c=null,f,p,d,D,h,m,F,y,E,B,b,g,A,w,v,x,k,T,q,R=!1,O,S,_,L;s=k.indent&&(L=!0),D=r.charAt(s),E=null,!L){if(D===en||D===ja||D===rn)E=D,s++,f++;else{for(p="";s=k.indent||f>xe),y=!1,s=F;if(b=r.slice(F,m),B=F===s?b:r.slice(s,m),(E===en||E===Hp||E===rn)&&i.thematicBreak.call(n,e,b,!0))break;if(g=A,A=!y&&!Gp(B).length,L&&k)k.value=k.value.concat(x,b),v=v.concat(x,b),x=[];else if(y)x.length!==0&&(R=!0,k.value.push(""),k.trail=x.concat()),k={value:[b],indent:f,trail:[]},w.push(k),v=v.concat(x,b),x=[];else if(A){if(g&&!a)break;x.push(b)}else{if(g||Wp(o,i,n,[e,b,!0]))break;k.value=k.value.concat(x,b),v=v.concat(x,b),x=[]}s=m+1}for(O=e(v.join(ae)).reset({type:"list",ordered:d,start:c,spread:R,children:[]}),T=n.enterList(),q=n.enterBlock(),s=-1,l=w.length;++s{"use strict";Qa.exports=lh;var tn=` +`,uh=" ",Ja=" ",Xa="=",ah="-",oh=3,sh=1,ch=2;function lh(e,r,t){for(var n=this,a=e.now(),u=r.length,i=-1,o="",s,l,c,f,p;++i=oh){i--;break}o+=c}for(s="",l="";++i{"use strict";var fh="[a-zA-Z_:][a-zA-Z0-9:._-]*",Dh="[^\"'=<>`\\u0000-\\u0020]+",ph="'[^']*'",hh='"[^"]*"',dh="(?:"+Dh+"|"+ph+"|"+hh+")",mh="(?:\\s+"+fh+"(?:\\s*=\\s*"+dh+")?)",eo="<[A-Za-z][A-Za-z0-9\\-]*"+mh+"*\\s*\\/?>",ro="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Fh="|",gh="<[?].*?[?]>",vh="]*>",Eh="";nn.openCloseTag=new RegExp("^(?:"+eo+"|"+ro+")");nn.tag=new RegExp("^(?:"+eo+"|"+ro+"|"+Fh+"|"+gh+"|"+vh+"|"+Eh+")")});var uo=C((CE,io)=>{"use strict";var Ch=un().openCloseTag;io.exports=Ih;var bh=" ",yh=" ",to=` +`,Ah="<",wh=/^<(script|pre|style)(?=(\s|>|$))/i,xh=/<\/(script|pre|style)>/i,kh=/^/,Th=/^<\?/,qh=/\?>/,_h=/^/,Oh=/^/,no=/^$/,Ph=new RegExp(Ch.source+"\\s*$");function Ih(e,r,t){for(var n=this,a=n.options.blocks.join("|"),u=new RegExp("^|$))","i"),i=r.length,o=0,s,l,c,f,p,d,D,h=[[wh,xh,!0],[kh,Bh,!0],[Th,qh,!0],[_h,Sh,!0],[Oh,Lh,!0],[u,no,!0],[Ph,no,!1]];o{"use strict";ao.exports=Uh;var Nh=String.fromCharCode,Rh=/\s/;function Uh(e){return Rh.test(typeof e=="number"?Nh(e):e.charAt(0))}});var an=C((yE,oo)=>{"use strict";var Mh=Br();oo.exports=zh;function zh(e){return Mh(e).toLowerCase()}});var ho=C((AE,po)=>{"use strict";var Yh=oe(),Gh=an();po.exports=Wh;var so='"',co="'",Vh="\\",Qe=` +`,Zr=" ",et=" ",sn="[",Er="]",jh="(",$h=")",lo=":",fo="<",Do=">";function Wh(e,r,t){for(var n=this,a=n.options.commonmark,u=0,i=r.length,o="",s,l,c,f,p,d,D,h;u{"use strict";var Kh=oe();Fo.exports=ud;var Jh=" ",rt=` +`,Xh=" ",Qh="-",Zh=":",ed="\\",cn="|",rd=1,td=2,mo="left",nd="center",id="right";function ud(e,r,t){var n=this,a,u,i,o,s,l,c,f,p,d,D,h,m,F,y,E,B,b,g,A,w,v;if(n.options.gfm){for(a=0,E=0,l=r.length+1,c=[];aA){if(E1&&(p?(o+=f.slice(0,-1),f=f.charAt(f.length-1)):(o+=f,f="")),F=e.now(),e(o)({type:"tableCell",children:n.tokenizeInline(h,F)},s)),e(f+p),f="",h=""):(f&&(h+=f,f=""),h+=p,p===ed&&a!==l-2&&(h+=B.charAt(a+1),a++)),m=!1,a++}y||e(rt+u)}return g}}}});var Co=C((xE,Eo)=>{"use strict";var ad=Re(),od=Ht(),sd=Xr();Eo.exports=fd;var cd=" ",Cr=` +`,ld=" ",vo=4;function fd(e,r,t){for(var n=this,a=n.options,u=a.commonmark,i=n.blockTokenizers,o=n.interruptParagraph,s=r.indexOf(Cr),l=r.length,c,f,p,d,D;s=vo&&p!==Cr){s=r.indexOf(Cr,s+1);continue}}if(f=r.slice(s+1),sd(o,i,n,[e,f,!0]))break;if(c=s,s=r.indexOf(Cr,s+1),s!==-1&&ad(r.slice(c,s))===""){s=c;break}}return f=r.slice(0,s),t?!0:(D=e.now(),f=od(f),e(f)({type:"paragraph",children:n.tokenizeInline(f,D)}))}});var yo=C((kE,bo)=>{"use strict";bo.exports=Dd;function Dd(e,r){return e.indexOf("\\",r)}});var ko=C((BE,xo)=>{"use strict";var pd=yo();xo.exports=wo;wo.locator=pd;var hd=` +`,Ao="\\";function wo(e,r,t){var n=this,a,u;if(r.charAt(0)===Ao&&(a=r.charAt(1),n.escape.indexOf(a)!==-1))return t?!0:(a===hd?u={type:"break"}:u={type:"text",value:a},e(Ao+a)(u))}});var ln=C((TE,Bo)=>{"use strict";Bo.exports=dd;function dd(e,r){return e.indexOf("<",r)}});var Oo=C((qE,So)=>{"use strict";var To=oe(),md=dr(),Fd=ln();So.exports=hn;hn.locator=Fd;hn.notInLink=!0;var qo="<",fn=">",_o="@",Dn="/",pn="mailto:",tt=pn.length;function hn(e,r,t){var n=this,a="",u=r.length,i=0,o="",s=!1,l="",c,f,p,d,D;if(r.charAt(0)===qo){for(i++,a=qo;i{"use strict";Lo.exports=gd;function gd(e,r){var t=String(e),n=0,a;if(typeof r!="string")throw new Error("Expected character");for(a=t.indexOf(r);a!==-1;)n++,a=t.indexOf(r,a+r.length);return n}});var Ro=C((SE,No)=>{"use strict";No.exports=vd;var Io=["www.","http://","https://"];function vd(e,r){var t=-1,n,a,u;if(!this.options.gfm)return t;for(a=Io.length,n=-1;++n{"use strict";var Uo=Po(),Ed=dr(),Cd=Ne(),dn=We(),bd=oe(),yd=Ro();Yo.exports=Fn;Fn.locator=yd;Fn.notInLink=!0;var Ad=33,wd=38,xd=41,kd=42,Bd=44,Td=45,mn=46,qd=58,_d=59,Sd=63,Od=60,Mo=95,Ld=126,Pd="(",zo=")";function Fn(e,r,t){var n=this,a=n.options.gfm,u=n.inlineTokenizers,i=r.length,o=-1,s=!1,l,c,f,p,d,D,h,m,F,y,E,B,b,g;if(a){if(r.slice(0,4)==="www.")s=!0,p=4;else if(r.slice(0,7).toLowerCase()==="http://")p=7;else if(r.slice(0,8).toLowerCase()==="https://")p=8;else return;for(o=p-1,f=p,l=[];pF;)p=d+D.lastIndexOf(zo),D=r.slice(d,p),y--;if(r.charCodeAt(p-1)===_d&&(p--,dn(r.charCodeAt(p-1)))){for(m=p-2;dn(r.charCodeAt(m));)m--;r.charCodeAt(m)===wd&&(p=m)}return E=r.slice(0,p),b=Ed(E,{nonTerminated:!1}),s&&(b="http://"+b),g=n.enterLink(),n.inlineTokenizers={text:u.text},B=n.tokenizeInline(E,e.now()),n.inlineTokenizers=u,g(),e(E)({type:"link",title:null,url:b,children:B})}}}});var Wo=C((LE,$o)=>{"use strict";var Id=Ne(),Nd=We(),Rd=43,Ud=45,Md=46,zd=95;$o.exports=jo;function jo(e,r){var t=this,n,a;if(!this.options.gfm||(n=e.indexOf("@",r),n===-1))return-1;if(a=n,a===r||!Vo(e.charCodeAt(a-1)))return jo.call(t,e,n+1);for(;a>r&&Vo(e.charCodeAt(a-1));)a--;return a}function Vo(e){return Id(e)||Nd(e)||e===Rd||e===Ud||e===Md||e===zd}});var Xo=C((PE,Jo)=>{"use strict";var Yd=dr(),Ho=Ne(),Ko=We(),Gd=Wo();Jo.exports=En;En.locator=Gd;En.notInLink=!0;var Vd=43,gn=45,nt=46,jd=64,vn=95;function En(e,r,t){var n=this,a=n.options.gfm,u=n.inlineTokenizers,i=0,o=r.length,s=-1,l,c,f,p;if(a){for(l=r.charCodeAt(i);Ho(l)||Ko(l)||l===Vd||l===gn||l===nt||l===vn;)l=r.charCodeAt(++i);if(i!==0&&l===jd){for(i++;i{"use strict";var $d=We(),Wd=ln(),Hd=un().tag;Zo.exports=Qo;Qo.locator=Wd;var Kd="<",Jd="?",Xd="!",Qd="/",Zd=/^/i;function Qo(e,r,t){var n=this,a=r.length,u,i;if(!(r.charAt(0)!==Kd||a<3)&&(u=r.charAt(1),!(!$d(u)&&u!==Jd&&u!==Xd&&u!==Qd)&&(i=r.match(Hd),!!i)))return t?!0:(i=i[0],!n.inLink&&Zd.test(i)?n.inLink=!0:n.inLink&&e0.test(i)&&(n.inLink=!1),e(i)({type:"html",value:i}))}});var Cn=C((NE,rs)=>{"use strict";rs.exports=r0;function r0(e,r){var t=e.indexOf("[",r),n=e.indexOf("![",r);return n===-1||t{"use strict";var br=oe(),t0=Cn();os.exports=as;as.locator=t0;var n0=` +`,i0="!",ts='"',ns="'",Ze="(",yr=")",bn="<",yn=">",is="[",Ar="\\",u0="]",us="`";function as(e,r,t){var n=this,a="",u=0,i=r.charAt(0),o=n.options.pedantic,s=n.options.commonmark,l=n.options.gfm,c,f,p,d,D,h,m,F,y,E,B,b,g,A,w,v,x,k;if(i===i0&&(F=!0,a=i,i=r.charAt(++u)),i===is&&!(!F&&n.inLink)){for(a+=i,A="",u++,B=r.length,v=e.now(),g=0,v.column+=u,v.offset+=u;u=p&&(p=0):p=f}else if(i===Ar)u++,h+=r.charAt(u);else if((!p||l)&&i===is)g++;else if((!p||l)&&i===u0)if(g)g--;else{if(r.charAt(u+1)!==Ze)return;h+=Ze,c=!0,u++;break}A+=h,h="",u++}if(c){for(y=A,a+=A+h,u++;u{"use strict";var a0=oe(),o0=Cn(),s0=an();ls.exports=cs;cs.locator=o0;var An="link",c0="image",l0="shortcut",f0="collapsed",wn="full",D0="!",it="[",ut="\\",at="]";function cs(e,r,t){var n=this,a=n.options.commonmark,u=r.charAt(0),i=0,o=r.length,s="",l="",c=An,f=l0,p,d,D,h,m,F,y,E;if(u===D0&&(c=c0,l=u,u=r.charAt(++i)),u===it){for(i++,l+=u,F="",E=0;i{"use strict";Ds.exports=p0;function p0(e,r){var t=e.indexOf("**",r),n=e.indexOf("__",r);return n===-1?t:t===-1||n{"use strict";var h0=Re(),hs=oe(),d0=ps();ms.exports=ds;ds.locator=d0;var m0="\\",F0="*",g0="_";function ds(e,r,t){var n=this,a=0,u=r.charAt(a),i,o,s,l,c,f,p;if(!(u!==F0&&u!==g0||r.charAt(++a)!==u)&&(o=n.options.pedantic,s=u,c=s+s,f=r.length,a++,l="",u="",!(o&&hs(r.charAt(a)))))for(;a{"use strict";gs.exports=C0;var v0=String.fromCharCode,E0=/\w/;function C0(e){return E0.test(typeof e=="number"?v0(e):e.charAt(0))}});var Cs=C((GE,Es)=>{"use strict";Es.exports=b0;function b0(e,r){var t=e.indexOf("*",r),n=e.indexOf("_",r);return n===-1?t:t===-1||n{"use strict";var y0=Re(),A0=vs(),bs=oe(),w0=Cs();ws.exports=As;As.locator=w0;var x0="*",ys="_",k0="\\";function As(e,r,t){var n=this,a=0,u=r.charAt(a),i,o,s,l,c,f,p;if(!(u!==x0&&u!==ys)&&(o=n.options.pedantic,c=u,s=u,f=r.length,a++,l="",u="",!(o&&bs(r.charAt(a)))))for(;a{"use strict";ks.exports=B0;function B0(e,r){return e.indexOf("~~",r)}});var Os=C(($E,Ss)=>{"use strict";var Ts=oe(),T0=Bs();Ss.exports=_s;_s.locator=T0;var ot="~",qs="~~";function _s(e,r,t){var n=this,a="",u="",i="",o="",s,l,c;if(!(!n.options.gfm||r.charAt(0)!==ot||r.charAt(1)!==ot||Ts(r.charAt(2))))for(s=1,l=r.length,c=e.now(),c.column+=2,c.offset+=2;++s{"use strict";Ls.exports=q0;function q0(e,r){return e.indexOf("`",r)}});var Rs=C((HE,Ns)=>{"use strict";var _0=Ps();Ns.exports=Is;Is.locator=_0;var xn=10,kn=32,Bn=96;function Is(e,r,t){for(var n=r.length,a=0,u,i,o,s,l,c;a2&&(s===kn||s===xn)&&(l===kn||l===xn)){for(a++,n--;a{"use strict";Us.exports=S0;function S0(e,r){for(var t=e.indexOf(` +`,r);t>r&&e.charAt(t-1)===" ";)t--;return t}});var Gs=C((JE,Ys)=>{"use strict";var O0=Ms();Ys.exports=zs;zs.locator=O0;var L0=" ",P0=` +`,I0=2;function zs(e,r,t){for(var n=r.length,a=-1,u="",i;++a{"use strict";Vs.exports=N0;function N0(e,r,t){var n=this,a,u,i,o,s,l,c,f,p,d;if(t)return!0;for(a=n.inlineMethods,o=a.length,u=n.inlineTokenizers,i=-1,p=r.length;++i{"use strict";var R0=Ie(),st=fu(),U0=pu(),M0=du(),z0=Gu(),Tn=$u();Hs.exports=$s;function $s(e,r){this.file=r,this.offset={},this.options=R0(this.options),this.setOptions({}),this.inList=!1,this.inBlock=!1,this.inLink=!1,this.atStart=!0,this.toOffset=U0(r).toOffset,this.unescape=M0(this,"escape"),this.decode=z0(this)}var U=$s.prototype;U.setOptions=ea();U.parse=ma();U.options=jt();U.exitStart=st("atStart",!0);U.enterList=st("inList",!1);U.enterLink=st("inLink",!1);U.enterBlock=st("inBlock",!1);U.interruptParagraph=[["thematicBreak"],["list"],["atxHeading"],["fencedCode"],["blockquote"],["html"],["setextHeading",{commonmark:!1}],["definition",{commonmark:!1}]];U.interruptList=[["atxHeading",{pedantic:!1}],["fencedCode",{pedantic:!1}],["thematicBreak",{pedantic:!1}],["definition",{commonmark:!1}]];U.interruptBlockquote=[["indentedCode",{commonmark:!0}],["fencedCode",{commonmark:!0}],["atxHeading",{commonmark:!0}],["setextHeading",{commonmark:!0}],["thematicBreak",{commonmark:!0}],["html",{commonmark:!0}],["list",{commonmark:!0}],["definition",{commonmark:!1}]];U.blockTokenizers={blankLine:ga(),indentedCode:ya(),fencedCode:xa(),blockquote:Sa(),atxHeading:Pa(),thematicBreak:Ra(),list:Ka(),setextHeading:Za(),html:uo(),definition:ho(),table:go(),paragraph:Co()};U.inlineTokenizers={escape:ko(),autoLink:Oo(),url:Go(),email:Xo(),html:es(),link:ss(),reference:fs(),strong:Fs(),emphasis:xs(),deletion:Os(),code:Rs(),break:Gs(),text:js()};U.blockMethods=Ws(U.blockTokenizers);U.inlineMethods=Ws(U.inlineTokenizers);U.tokenizeBlock=Tn("block");U.tokenizeInline=Tn("inline");U.tokenizeFactory=Tn;function Ws(e){var r=[],t;for(t in e)r.push(t);return r}});var Zs=C((ZE,Qs)=>{"use strict";var Y0=cu(),G0=Ie(),Js=Ks();Qs.exports=Xs;Xs.Parser=Js;function Xs(e){var r=this.data("settings"),t=Y0(Js);t.prototype.options=G0(t.prototype.options,r,e),this.Parser=t}});var rc=C((eC,ec)=>{"use strict";ec.exports=V0;function V0(e){if(e)throw e}});var qn=C((rC,tc)=>{tc.exports=function(r){return r!=null&&r.constructor!=null&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}});var fc=C((tC,lc)=>{"use strict";var ct=Object.prototype.hasOwnProperty,cc=Object.prototype.toString,nc=Object.defineProperty,ic=Object.getOwnPropertyDescriptor,uc=function(r){return typeof Array.isArray=="function"?Array.isArray(r):cc.call(r)==="[object Array]"},ac=function(r){if(!r||cc.call(r)!=="[object Object]")return!1;var t=ct.call(r,"constructor"),n=r.constructor&&r.constructor.prototype&&ct.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!t&&!n)return!1;var a;for(a in r);return typeof a>"u"||ct.call(r,a)},oc=function(r,t){nc&&t.name==="__proto__"?nc(r,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):r[t.name]=t.newValue},sc=function(r,t){if(t==="__proto__")if(ct.call(r,t)){if(ic)return ic(r,t).value}else return;return r[t]};lc.exports=function e(){var r,t,n,a,u,i,o=arguments[0],s=1,l=arguments.length,c=!1;for(typeof o=="boolean"&&(c=o,o=arguments[1]||{},s=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});s{"use strict";Dc.exports=e=>{if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}});var dc=C((iC,hc)=>{"use strict";var j0=[].slice;hc.exports=$0;function $0(e,r){var t;return n;function n(){var i=j0.call(arguments,0),o=e.length>i.length,s;o&&i.push(a);try{s=e.apply(null,i)}catch(l){if(o&&t)throw l;return a(l)}o||(s&&typeof s.then=="function"?s.then(u,a):s instanceof Error?a(s):u(s))}function a(){t||(t=!0,r.apply(null,arguments))}function u(i){a(null,i)}}});var Ec=C((uC,vc)=>{"use strict";var Fc=dc();vc.exports=gc;gc.wrap=Fc;var mc=[].slice;function gc(){var e=[],r={};return r.run=t,r.use=n,r;function t(){var a=-1,u=mc.call(arguments,0,-1),i=arguments[arguments.length-1];if(typeof i!="function")throw new Error("Expected function as last argument, not "+i);o.apply(null,[null].concat(u));function o(s){var l=e[++a],c=mc.call(arguments,0),f=c.slice(1),p=u.length,d=-1;if(s){i(s);return}for(;++d{"use strict";var er={}.hasOwnProperty;yc.exports=W0;function W0(e){return!e||typeof e!="object"?"":er.call(e,"position")||er.call(e,"type")?Cc(e.position):er.call(e,"start")||er.call(e,"end")?Cc(e):er.call(e,"line")||er.call(e,"column")?_n(e):""}function _n(e){return(!e||typeof e!="object")&&(e={}),bc(e.line)+":"+bc(e.column)}function Cc(e){return(!e||typeof e!="object")&&(e={}),_n(e.start)+"-"+_n(e.end)}function bc(e){return e&&typeof e=="number"?e:1}});var kc=C((oC,xc)=>{"use strict";var H0=Ac();xc.exports=Sn;function wc(){}wc.prototype=Error.prototype;Sn.prototype=new wc;var ke=Sn.prototype;ke.file="";ke.name="";ke.reason="";ke.message="";ke.stack="";ke.fatal=null;ke.column=null;ke.line=null;function Sn(e,r,t){var n,a,u;typeof r=="string"&&(t=r,r=null),n=K0(t),a=H0(r)||"1:1",u={start:{line:null,column:null},end:{line:null,column:null}},r&&r.position&&(r=r.position),r&&(r.start?(u=r,r=r.start):u.start=r),e.stack&&(this.stack=e.stack,e=e.message),this.message=e,this.name=a,this.reason=e,this.line=r?r.line:null,this.column=r?r.column:null,this.location=u,this.source=n[0],this.ruleId=n[1]}function K0(e){var r=[null,null],t;return typeof e=="string"&&(t=e.indexOf(":"),t===-1?r[1]=e:(r[0]=e.slice(0,t),r[1]=e.slice(t+1))),r}});var Bc=C(rr=>{"use strict";rr.basename=J0;rr.dirname=X0;rr.extname=Q0;rr.join=Z0;rr.sep="/";function J0(e,r){var t=0,n=-1,a,u,i,o;if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');if(wr(e),a=e.length,r===void 0||!r.length||r.length>e.length){for(;a--;)if(e.charCodeAt(a)===47){if(i){t=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":e.slice(t,n)}if(r===e)return"";for(u=-1,o=r.length-1;a--;)if(e.charCodeAt(a)===47){if(i){t=a+1;break}}else u<0&&(i=!0,u=a+1),o>-1&&(e.charCodeAt(a)===r.charCodeAt(o--)?o<0&&(n=a):(o=-1,n=u));return t===n?n=u:n<0&&(n=e.length),e.slice(t,n)}function X0(e){var r,t,n;if(wr(e),!e.length)return".";for(r=-1,n=e.length;--n;)if(e.charCodeAt(n)===47){if(t){r=n;break}}else t||(t=!0);return r<0?e.charCodeAt(0)===47?"/":".":r===1&&e.charCodeAt(0)===47?"//":e.slice(0,r)}function Q0(e){var r=-1,t=0,n=-1,a=0,u,i,o;for(wr(e),o=e.length;o--;){if(i=e.charCodeAt(o),i===47){if(u){t=o+1;break}continue}n<0&&(u=!0,n=o+1),i===46?r<0?r=o:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||n<0||a===0||a===1&&r===n-1&&r===t+1?"":e.slice(r,n)}function Z0(){for(var e=-1,r;++e2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",n=0):(t=t.slice(0,s),n=t.length-1-t.lastIndexOf("/")),a=i,u=0;continue}}else if(t.length){t="",n=0,a=i,u=0;continue}}r&&(t=t.length?t+"/..":"..",n=2)}else t.length?t+="/"+e.slice(a+1,i):t=e.slice(a+1,i),n=i-a-1;a=i,u=0}else o===46&&u>-1?u++:u=-1}return t}function wr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}});var qc=C(Tc=>{"use strict";Tc.cwd=tm;function tm(){return"/"}});var Oc=C((lC,Sc)=>{"use strict";var se=Bc(),nm=qc(),im=qn();Sc.exports=ge;var um={}.hasOwnProperty,On=["history","path","basename","stem","extname","dirname"];ge.prototype.toString=mm;Object.defineProperty(ge.prototype,"path",{get:am,set:om});Object.defineProperty(ge.prototype,"dirname",{get:sm,set:cm});Object.defineProperty(ge.prototype,"basename",{get:lm,set:fm});Object.defineProperty(ge.prototype,"extname",{get:Dm,set:pm});Object.defineProperty(ge.prototype,"stem",{get:hm,set:dm});function ge(e){var r,t;if(!e)e={};else if(typeof e=="string"||im(e))e={contents:e};else if("message"in e&&"messages"in e)return e;if(!(this instanceof ge))return new ge(e);for(this.data={},this.messages=[],this.history=[],this.cwd=nm.cwd(),t=-1;++t-1)throw new Error("`extname` cannot contain multiple dots")}this.path=se.join(this.dirname,this.stem+(e||""))}function hm(){return typeof this.path=="string"?se.basename(this.path,this.extname):void 0}function dm(e){Pn(e,"stem"),Ln(e,"stem"),this.path=se.join(this.dirname||"",e+(this.extname||""))}function mm(e){return(this.contents||"").toString(e)}function Ln(e,r){if(e&&e.indexOf(se.sep)>-1)throw new Error("`"+r+"` cannot be a path: did not expect `"+se.sep+"`")}function Pn(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function _c(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}});var Pc=C((fC,Lc)=>{"use strict";var Fm=kc(),lt=Oc();Lc.exports=lt;lt.prototype.message=gm;lt.prototype.info=Em;lt.prototype.fail=vm;function gm(e,r,t){var n=new Fm(e,r,t);return this.path&&(n.name=this.path+":"+n.name,n.file=this.path),n.fatal=!1,this.messages.push(n),n}function vm(){var e=this.message.apply(this,arguments);throw e.fatal=!0,e}function Em(){var e=this.message.apply(this,arguments);return e.fatal=null,e}});var Nc=C((DC,Ic)=>{"use strict";Ic.exports=Pc()});var $c=C((pC,jc)=>{"use strict";var Rc=rc(),Cm=qn(),ft=fc(),Uc=pc(),Gc=Ec(),xr=Nc();jc.exports=Vc().freeze();var bm=[].slice,ym={}.hasOwnProperty,Am=Gc().use(wm).use(xm).use(km);function wm(e,r){r.tree=e.parse(r.file)}function xm(e,r,t){e.run(r.tree,r.file,n);function n(a,u,i){a?t(a):(r.tree=u,r.file=i,t())}}function km(e,r){var t=e.stringify(r.tree,r.file);t==null||(typeof t=="string"||Cm(t)?("value"in r.file&&(r.file.value=t),r.file.contents=t):r.file.result=t)}function Vc(){var e=[],r=Gc(),t={},n=-1,a;return u.data=o,u.freeze=i,u.attachers=e,u.use=s,u.parse=c,u.stringify=d,u.run=f,u.runSync=p,u.process=D,u.processSync=h,u;function u(){for(var m=Vc(),F=-1;++Fzi,options:()=>Yi,parsers:()=>Mn,printers:()=>Um});var ml=(e,r,t,n)=>{if(!(e&&r==null))return r.replaceAll?r.replaceAll(t,n):t.global?r.replace(t,n):r.split(t).join(n)},N=ml;var Fl=(e,r,t)=>{if(!(e&&r==null))return Array.isArray(r)||typeof r=="string"?r[t<0?r.length+t:t]:r.at(t)},z=Fl;var Ui=Ue(Br(),1);function le(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var G="string",H="array",Ce="cursor",re="indent",te="align",fe="trim",J="group",X="fill",K="if-break",De="indent-if-break",pe="line-suffix",he="line-suffix-boundary",V="line",de="label",ne="break-parent",Tr=new Set([Ce,re,te,fe,J,X,K,De,pe,he,V,de,ne]);function vl(e){if(typeof e=="string")return G;if(Array.isArray(e))return H;if(!e)return;let{type:r}=e;if(Tr.has(r))return r}var Y=vl;var El=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Cl(e){let r=e===null?"null":typeof e;if(r!=="string"&&r!=="object")return`Unexpected doc '${r}', +Expected it to be 'string' or 'object'.`;if(Y(e))throw new Error("doc is valid.");let t=Object.prototype.toString.call(e);if(t!=="[object Object]")return`Unexpected doc '${t}'.`;let n=El([...Tr].map(a=>`'${a}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${n}.`}var pt=class extends Error{name="InvalidDocError";constructor(r){super(Cl(r)),this.doc=r}},Te=pt;var Hn={};function bl(e,r,t,n){let a=[e];for(;a.length>0;){let u=a.pop();if(u===Hn){t(a.pop());continue}t&&a.push(u,Hn);let i=Y(u);if(!i)throw new Te(u);if((r==null?void 0:r(u))!==!1)switch(i){case H:case X:{let o=i===H?u:u.parts;for(let s=o.length,l=s-1;l>=0;--l)a.push(o[l]);break}case K:a.push(u.flatContents,u.breakContents);break;case J:if(n&&u.expandedStates)for(let o=u.expandedStates.length,s=o-1;s>=0;--s)a.push(u.expandedStates[s]);else a.push(u.contents);break;case te:case re:case De:case de:case pe:a.push(u.contents);break;case G:case Ce:case fe:case he:case V:case ne:break;default:throw new Te(u)}}}var ht=bl;function yl(e,r){if(typeof e=="string")return r(e);let t=new Map;return n(e);function n(u){if(t.has(u))return t.get(u);let i=a(u);return t.set(u,i),i}function a(u){switch(Y(u)){case H:return r(u.map(n));case X:return r({...u,parts:u.parts.map(n)});case K:return r({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case J:{let{expandedStates:i,contents:o}=u;return i?(i=i.map(n),o=i[0]):o=n(o),r({...u,contents:o,expandedStates:i})}case te:case re:case De:case de:case pe:return r({...u,contents:n(u.contents)});case G:case Ce:case fe:case he:case V:case ne:return r(u);default:throw new Te(u)}}}function Kn(e){if(e.length>0){let r=z(!1,e,-1);!r.expandedStates&&!r.break&&(r.break="propagated")}return null}function Jn(e){let r=new Set,t=[];function n(u){if(u.type===ne&&Kn(t),u.type===J){if(t.push(u),r.has(u))return!1;r.add(u)}}function a(u){u.type===J&&t.pop().break&&Kn(t)}ht(e,n,a,!0)}function be(e,r=tr){return yl(e,t=>typeof t=="string"?qr(r,t.split(` +`)):t)}var dt=()=>{},qe=dt,mt=dt,Xn=dt;function nr(e){return qe(e),{type:re,contents:e}}function ye(e,r){return qe(r),{type:te,contents:r,n:e}}function Me(e,r={}){return qe(e),mt(r.expandedStates,!0),{type:J,id:r.id,contents:e,break:!!r.shouldBreak,expandedStates:r.expandedStates}}function _e(e){return ye({type:"root"},e)}function ze(e){return Xn(e),{type:X,parts:e}}function Qn(e,r="",t={}){return qe(e),r!==""&&qe(r),{type:K,breakContents:e,flatContents:r,groupId:t.groupId}}var ir={type:ne};var ur={type:V,hard:!0},Al={type:V,hard:!0,literal:!0},_r={type:V},Sr={type:V,soft:!0},P=[ur,ir],tr=[Al,ir];function qr(e,r){qe(e),mt(r);let t=[];for(let n=0;nMath.max(n,a.length/r.length),0)}var Or=wl;function xl(e,r){let t=e.match(new RegExp(`(${le(r)})+`,"gu"));if(t===null)return 0;let n=new Map,a=0;for(let u of t){let i=u.length/r.length;n.set(i,!0),i>a&&(a=i)}for(let u=1;uu?n:t}var ri=kl;var Ft=class extends Error{name="UnexpectedNodeError";constructor(r,t,n="type"){super(`Unexpected ${t} node ${n}: ${JSON.stringify(r[n])}.`),this.node=r}},ti=Ft;var oi=Ue(Br(),1);function Bl(e){return(e==null?void 0:e.type)==="front-matter"}var ni=Bl;var ar=3;function Tl(e){let r=e.slice(0,ar);if(r!=="---"&&r!=="+++")return;let t=e.indexOf(` +`,ar);if(t===-1)return;let n=e.slice(ar,t).trim(),a=e.indexOf(` +${r}`,t),u=n;if(u||(u=r==="+++"?"toml":"yaml"),a===-1&&r==="---"&&u==="yaml"&&(a=e.indexOf(` +...`,t)),a===-1)return;let i=a+1+ar,o=e.charAt(i+1);if(!/\s?/u.test(o))return;let s=e.slice(0,i);return{type:"front-matter",language:u,explicitLanguage:n,value:e.slice(t+1,a),startDelimiter:r,endDelimiter:s.slice(-ar),raw:s}}function ql(e){let r=Tl(e);if(!r)return{content:e};let{raw:t}=r;return{frontMatter:r,content:N(!1,t,/[^\n]/gu," ")+e.slice(t.length)}}var or=ql;var ii=["format","prettier"];function gt(e){let r=`@(${ii.join("|")})`,t=new RegExp([``,`\\{\\s*\\/\\*\\s*${r}\\s*\\*\\/\\s*\\}`,``].join("|"),"mu"),n=e.match(t);return(n==null?void 0:n.index)===0}var ui=e=>gt(or(e).content.trimStart()),ai=e=>{let r=or(e),t=``;return r.frontMatter?`${r.frontMatter.raw} + +${t} + +${r.content}`:`${t} + +${r.content}`};var _l=new Set(["position","raw"]);function si(e,r,t){if((e.type==="front-matter"||e.type==="code"||e.type==="yaml"||e.type==="import"||e.type==="export"||e.type==="jsx")&&delete r.value,e.type==="list"&&delete r.isAligned,(e.type==="list"||e.type==="listItem")&&delete r.spread,e.type==="text")return null;if(e.type==="inlineCode"&&(r.value=N(!1,e.value,` +`," ")),e.type==="wikiLink"&&(r.value=N(!1,e.value.trim(),/[\t\n]+/gu," ")),(e.type==="definition"||e.type==="linkReference"||e.type==="imageReference")&&(r.label=(0,oi.default)(e.label)),(e.type==="link"||e.type==="image")&&e.url&&e.url.includes("("))for(let n of"<>")r.url=N(!1,e.url,n,encodeURIComponent(n));if((e.type==="definition"||e.type==="link"||e.type==="image")&&e.title&&(r.title=N(!1,e.title,/\\(?=["')])/gu,"")),(t==null?void 0:t.type)==="root"&&t.children.length>0&&(t.children[0]===e||ni(t.children[0])&&t.children[1]===e)&&e.type==="html"&>(e.value))return null}si.ignoredProperties=_l;var ci=si;var li=/(?:[\u{2ea}-\u{2eb}\u{1100}-\u{11ff}\u{2e80}-\u{2e99}\u{2e9b}-\u{2ef3}\u{2f00}-\u{2fd5}\u{2ff0}-\u{303f}\u{3041}-\u{3096}\u{3099}-\u{30ff}\u{3105}-\u{312f}\u{3131}-\u{318e}\u{3190}-\u{4dbf}\u{4e00}-\u{9fff}\u{a700}-\u{a707}\u{a960}-\u{a97c}\u{ac00}-\u{d7a3}\u{d7b0}-\u{d7c6}\u{d7cb}-\u{d7fb}\u{f900}-\u{fa6d}\u{fa70}-\u{fad9}\u{fe10}-\u{fe1f}\u{fe30}-\u{fe6f}\u{ff00}-\u{ffef}\u{16fe3}\u{1aff0}-\u{1aff3}\u{1aff5}-\u{1affb}\u{1affd}-\u{1affe}\u{1b000}-\u{1b122}\u{1b132}\u{1b150}-\u{1b152}\u{1b155}\u{1b164}-\u{1b167}\u{1f200}\u{1f250}-\u{1f251}\u{20000}-\u{2a6df}\u{2a700}-\u{2b739}\u{2b740}-\u{2b81d}\u{2b820}-\u{2cea1}\u{2ceb0}-\u{2ebe0}\u{2f800}-\u{2fa1d}\u{30000}-\u{3134a}\u{31350}-\u{323af}])(?:[\u{fe00}-\u{fe0f}\u{e0100}-\u{e01ef}])?/u,Se=/(?:[\u{21}-\u{2f}\u{3a}-\u{40}\u{5b}-\u{60}\u{7b}-\u{7e}]|\p{General_Category=Connector_Punctuation}|\p{General_Category=Dash_Punctuation}|\p{General_Category=Close_Punctuation}|\p{General_Category=Final_Punctuation}|\p{General_Category=Initial_Punctuation}|\p{General_Category=Other_Punctuation}|\p{General_Category=Open_Punctuation})/u;async function Sl(e,r){if(e.language==="yaml"){let t=e.value.trim(),n=t?await r(t,{parser:"yaml"}):"";return _e([e.startDelimiter,e.explicitLanguage,P,n,n?P:"",e.endDelimiter])}}var fi=Sl;var Ol=e=>String(e).split(/[/\\]/u).pop();function Di(e,r){if(!r)return;let t=Ol(r).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(a=>a.toLowerCase()===t))??e.find(({extensions:n})=>n==null?void 0:n.some(a=>t.endsWith(a)))}function Ll(e,r){if(r)return e.find(({name:t})=>t.toLowerCase()===r)??e.find(({aliases:t})=>t==null?void 0:t.includes(r))??e.find(({extensions:t})=>t==null?void 0:t.includes(`.${r}`))}function Pl(e,r){let t=e.plugins.flatMap(a=>a.languages??[]),n=Ll(t,r.language)??Di(t,r.physicalFile)??Di(t,r.file)??(r.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var pi=Pl;var Il=new Proxy(()=>{},{get:()=>Il});function Oe(e){return e.position.start.offset}function Le(e){return e.position.end.offset}var vt=new Set(["liquidNode","inlineCode","emphasis","esComment","strong","delete","wikiLink","link","linkReference","image","imageReference","footnote","footnoteReference","sentence","whitespace","word","break","inlineMath"]),Pr=new Set([...vt,"tableCell","paragraph","heading"]),Ge="non-cjk",ie="cj-letter",Pe="k-letter",sr="cjk-punctuation",Nl=/\p{Script_Extensions=Hangul}/u;function Ir(e){let r=[],t=e.split(/([\t\n ]+)/u);for(let[a,u]of t.entries()){if(a%2===1){r.push({type:"whitespace",value:/\n/u.test(u)?` +`:" "});continue}if((a===0||a===t.length-1)&&u==="")continue;let i=u.split(new RegExp(`(${li.source})`,"u"));for(let[o,s]of i.entries())if(!((o===0||o===i.length-1)&&s==="")){if(o%2===0){s!==""&&n({type:"word",value:s,kind:Ge,isCJ:!1,hasLeadingPunctuation:Se.test(s[0]),hasTrailingPunctuation:Se.test(z(!1,s,-1))});continue}if(Se.test(s)){n({type:"word",value:s,kind:sr,isCJ:!0,hasLeadingPunctuation:!0,hasTrailingPunctuation:!0});continue}if(Nl.test(s)){n({type:"word",value:s,kind:Pe,isCJ:!1,hasLeadingPunctuation:!1,hasTrailingPunctuation:!1});continue}n({type:"word",value:s,kind:ie,isCJ:!0,hasLeadingPunctuation:!1,hasTrailingPunctuation:!1})}}return r;function n(a){let u=z(!1,r,-1);(u==null?void 0:u.type)==="word"&&!i(Ge,sr)&&![u.value,a.value].some(o=>/\u3000/u.test(o))&&r.push({type:"whitespace",value:""}),r.push(a);function i(o,s){return u.kind===o&&a.kind===s||u.kind===s&&a.kind===o}}}function Ye(e,r){let t=r.originalText.slice(e.position.start.offset,e.position.end.offset),{numberText:n,leadingSpaces:a}=t.match(/^\s*(?\d+)(\.|\))(?\s*)/u).groups;return{number:Number(n),leadingSpaces:a}}function hi(e,r){return!e.ordered||e.children.length<2||Ye(e.children[1],r).number!==1?!1:Ye(e.children[0],r).number!==0?!0:e.children.length>2&&Ye(e.children[2],r).number===1}function Nr(e,r){let{value:t}=e;return e.position.end.offset===r.length&&t.endsWith(` +`)&&r.endsWith(` +`)?t.slice(0,-1):t}function Ae(e,r){return function t(n,a,u){let i={...r(n,a,u)};return i.children&&(i.children=i.children.map((o,s)=>t(o,s,[i,...u]))),i}(e,null,[])}function Et(e){if((e==null?void 0:e.type)!=="link"||e.children.length!==1)return!1;let[r]=e.children;return Oe(e)===Oe(r)&&Le(e)===Le(r)}function Rl(e,r){let{node:t}=e;if(t.type==="code"&&t.lang!==null){let n=pi(r,{language:t.lang});if(n)return async a=>{let u=r.__inJsTemplate?"~":"`",i=u.repeat(Math.max(3,Or(t.value,u)+1)),o={parser:n};t.lang==="ts"||t.lang==="typescript"?o.filepath="dummy.ts":t.lang==="tsx"&&(o.filepath="dummy.tsx");let s=await a(Nr(t,r.originalText),o);return _e([i,t.lang,t.meta?" "+t.meta:"",P,be(s),P,i])}}switch(t.type){case"front-matter":return n=>fi(t,n);case"import":case"export":return n=>n(t.value,{parser:"babel"});case"jsx":return n=>n(`<$>${t.value}`,{parser:"__js_expression",rootMarker:"mdx"})}return null}var di=Rl;var cr=null;function lr(e){if(cr!==null&&typeof cr.property){let r=cr;return cr=lr.prototype=null,r}return cr=lr.prototype=e??Object.create(null),new lr}var Ul=10;for(let e=0;e<=Ul;e++)lr();function Ct(e){return lr(e)}function Ml(e,r="type"){Ct(e);function t(n){let a=n[r],u=e[a];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${a}'.`),{node:n});return u}return t}var mi=Ml;var zl={"front-matter":[],root:["children"],paragraph:["children"],sentence:["children"],word:[],whitespace:[],emphasis:["children"],strong:["children"],delete:["children"],inlineCode:[],wikiLink:[],link:["children"],image:[],blockquote:["children"],heading:["children"],code:[],html:[],list:["children"],thematicBreak:[],linkReference:["children"],imageReference:[],definition:[],footnote:["children"],footnoteReference:[],footnoteDefinition:["children"],table:["children"],tableCell:["children"],break:[],liquidNode:[],import:[],export:[],esComment:[],jsx:[],math:[],inlineMath:[],tableRow:["children"],listItem:["children"],text:[]},Fi=zl;var Yl=mi(Fi),gi=Yl;function vi(e){switch(e){case"cr":return"\r";case"crlf":return`\r +`;default:return` +`}}var Ei=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Ci(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function bi(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var yi=e=>!(Ci(e)||bi(e));var Gl=/[^\x20-\x7F]/u;function Vl(e){if(!e)return 0;if(!Gl.test(e))return e.length;e=e.replace(Ei()," ");let r=0;for(let t of e){let n=t.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(r+=yi(n)?1:2)}return r}var fr=Vl;var j=Symbol("MODE_BREAK"),ue=Symbol("MODE_FLAT"),Ve=Symbol("cursor"),bt=Symbol("DOC_FILL_PRINTED_LENGTH");function Ai(){return{value:"",length:0,queue:[]}}function jl(e,r){return yt(e,{type:"indent"},r)}function $l(e,r,t){return r===Number.NEGATIVE_INFINITY?e.root||Ai():r<0?yt(e,{type:"dedent"},t):r?r.type==="root"?{...e,root:e}:yt(e,{type:typeof r=="string"?"stringAlign":"numberAlign",n:r},t):e}function yt(e,r,t){let n=r.type==="dedent"?e.queue.slice(0,-1):[...e.queue,r],a="",u=0,i=0,o=0;for(let D of n)switch(D.type){case"indent":c(),t.useTabs?s(1):l(t.tabWidth);break;case"stringAlign":c(),a+=D.n,u+=D.n.length;break;case"numberAlign":i+=1,o+=D.n;break;default:throw new Error(`Unexpected type '${D.type}'`)}return p(),{...e,value:a,length:u,queue:n};function s(D){a+=" ".repeat(D),u+=t.tabWidth*D}function l(D){a+=" ".repeat(D),u+=D}function c(){t.useTabs?f():p()}function f(){i>0&&s(i),d()}function p(){o>0&&l(o),d()}function d(){i=0,o=0}}function At(e){let r=0,t=0,n=e.length;e:for(;n--;){let a=e[n];if(a===Ve){t++;continue}for(let u=a.length-1;u>=0;u--){let i=a[u];if(i===" "||i===" ")r++;else{e[n]=a.slice(0,u+1);break e}}}if(r>0||t>0)for(e.length=n+1;t-- >0;)e.push(Ve);return r}function Rr(e,r,t,n,a,u){if(t===Number.POSITIVE_INFINITY)return!0;let i=r.length,o=[e],s=[];for(;t>=0;){if(o.length===0){if(i===0)return!0;o.push(r[--i]);continue}let{mode:l,doc:c}=o.pop(),f=Y(c);switch(f){case G:s.push(c),t-=fr(c);break;case H:case X:{let p=f===H?c:c.parts,d=c[bt]??0;for(let D=p.length-1;D>=d;D--)o.push({mode:l,doc:p[D]});break}case re:case te:case De:case de:o.push({mode:l,doc:c.contents});break;case fe:t+=At(s);break;case J:{if(u&&c.break)return!1;let p=c.break?j:l,d=c.expandedStates&&p===j?z(!1,c.expandedStates,-1):c.contents;o.push({mode:p,doc:d});break}case K:{let d=(c.groupId?a[c.groupId]||ue:l)===j?c.breakContents:c.flatContents;d&&o.push({mode:l,doc:d});break}case V:if(l===j||c.hard)return!0;c.soft||(s.push(" "),t--);break;case pe:n=!0;break;case he:if(n)return!1;break}}return!1}function wi(e,r){let t={},n=r.printWidth,a=vi(r.endOfLine),u=0,i=[{ind:Ai(),mode:j,doc:e}],o=[],s=!1,l=[],c=0;for(Jn(e);i.length>0;){let{ind:p,mode:d,doc:D}=i.pop();switch(Y(D)){case G:{let h=a!==` +`?N(!1,D,` +`,a):D;o.push(h),i.length>0&&(u+=fr(h));break}case H:for(let h=D.length-1;h>=0;h--)i.push({ind:p,mode:d,doc:D[h]});break;case Ce:if(c>=2)throw new Error("There are too many 'cursor' in doc.");o.push(Ve),c++;break;case re:i.push({ind:jl(p,r),mode:d,doc:D.contents});break;case te:i.push({ind:$l(p,D.n,r),mode:d,doc:D.contents});break;case fe:u-=At(o);break;case J:switch(d){case ue:if(!s){i.push({ind:p,mode:D.break?j:ue,doc:D.contents});break}case j:{s=!1;let h={ind:p,mode:ue,doc:D.contents},m=n-u,F=l.length>0;if(!D.break&&Rr(h,i,m,F,t))i.push(h);else if(D.expandedStates){let y=z(!1,D.expandedStates,-1);if(D.break){i.push({ind:p,mode:j,doc:y});break}else for(let E=1;E=D.expandedStates.length){i.push({ind:p,mode:j,doc:y});break}else{let B=D.expandedStates[E],b={ind:p,mode:ue,doc:B};if(Rr(b,i,m,F,t)){i.push(b);break}}}else i.push({ind:p,mode:j,doc:D.contents});break}}D.id&&(t[D.id]=z(!1,i,-1).mode);break;case X:{let h=n-u,m=D[bt]??0,{parts:F}=D,y=F.length-m;if(y===0)break;let E=F[m+0],B=F[m+1],b={ind:p,mode:ue,doc:E},g={ind:p,mode:j,doc:E},A=Rr(b,[],h,l.length>0,t,!0);if(y===1){A?i.push(b):i.push(g);break}let w={ind:p,mode:ue,doc:B},v={ind:p,mode:j,doc:B};if(y===2){A?i.push(w,b):i.push(v,g);break}let x=F[m+2],k={ind:p,mode:d,doc:{...D,[bt]:m+2}};Rr({ind:p,mode:ue,doc:[E,B,x]},[],h,l.length>0,t,!0)?i.push(k,w,b):A?i.push(k,v,b):i.push(k,v,g);break}case K:case De:{let h=D.groupId?t[D.groupId]:d;if(h===j){let m=D.type===K?D.breakContents:D.negate?D.contents:nr(D.contents);m&&i.push({ind:p,mode:d,doc:m})}if(h===ue){let m=D.type===K?D.flatContents:D.negate?nr(D.contents):D.contents;m&&i.push({ind:p,mode:d,doc:m})}break}case pe:l.push({ind:p,mode:d,doc:D.contents});break;case he:l.length>0&&i.push({ind:p,mode:d,doc:ur});break;case V:switch(d){case ue:if(D.hard)s=!0;else{D.soft||(o.push(" "),u+=1);break}case j:if(l.length>0){i.push({ind:p,mode:d,doc:D},...l.reverse()),l.length=0;break}D.literal?p.root?(o.push(a,p.root.value),u=p.root.length):(o.push(a),u=0):(u-=At(o),o.push(a+p.value),u=p.length);break}break;case de:i.push({ind:p,mode:d,doc:D.contents});break;case ne:break;default:throw new Te(D)}i.length===0&&l.length>0&&(i.push(...l.reverse()),l.length=0)}let f=o.indexOf(Ve);if(f!==-1){let p=o.indexOf(Ve,f+1);if(p===-1)return{formatted:o.filter(m=>m!==Ve).join("")};let d=o.slice(0,f).join(""),D=o.slice(f+1,p).join(""),h=o.slice(p+1).join("");return{formatted:d+D+h,cursorNodeStart:d.length,cursorNodeText:D}}return{formatted:o.join("")}}function xi(e,r,t){let{node:n}=e,a=[],u=e.map(()=>e.map(({index:f})=>{let p=wi(t(),r).formatted,d=fr(p);return a[f]=Math.max(a[f]??3,d),{text:p,width:d}},"children"),"children"),i=s(!1);if(r.proseWrap!=="never")return[ir,i];let o=s(!0);return[ir,Me(Qn(o,i))];function s(f){return qr(ur,[c(u[0],f),l(f),...u.slice(1).map(p=>c(p,f))].map(p=>`| ${p.join(" | ")} |`))}function l(f){return a.map((p,d)=>{let D=n.align[d],h=D==="center"||D==="left"?":":"-",m=D==="center"||D==="right"?":":"-",F=f?"-":"-".repeat(p-2);return`${h}${F}${m}`})}function c(f,p){return f.map(({text:d,width:D},h)=>{if(p)return d;let m=a[h]-D,F=n.align[h],y=0;F==="right"?y=m:F==="center"&&(y=Math.floor(m/2));let E=m-y;return`${" ".repeat(y)}${d}${" ".repeat(E)}`})}}function ki(e,r,t){let n=e.map(t,"children");return Wl(n)}function Wl(e){let r=[""];return function t(n){for(let a of n){let u=Y(a);if(u===H){t(a);continue}let i=a,o=[];u===X&&([i,...o]=a.parts),r.push([r.pop(),i],...o)}}(e),ze(r)}var Q,wt=class{constructor(r){jn(this,Q);$n(this,Q,new Set(r))}getLeadingWhitespaceCount(r){let t=ce(this,Q),n=0;for(let a=0;a=0&&t.has(r.charAt(a));a--)n++;return n}getLeadingWhitespace(r){let t=this.getLeadingWhitespaceCount(r);return r.slice(0,t)}getTrailingWhitespace(r){let t=this.getTrailingWhitespaceCount(r);return r.slice(r.length-t)}hasLeadingWhitespace(r){return ce(this,Q).has(r.charAt(0))}hasTrailingWhitespace(r){return ce(this,Q).has(z(!1,r,-1))}trimStart(r){let t=this.getLeadingWhitespaceCount(r);return r.slice(t)}trimEnd(r){let t=this.getTrailingWhitespaceCount(r);return r.slice(0,r.length-t)}trim(r){return this.trimEnd(this.trimStart(r))}split(r,t=!1){let n=`[${le([...ce(this,Q)].join(""))}]+`,a=new RegExp(t?`(${n})`:n,"u");return r.split(a)}hasWhitespaceCharacter(r){let t=ce(this,Q);return Array.prototype.some.call(r,n=>t.has(n))}hasNonWhitespaceCharacter(r){let t=ce(this,Q);return Array.prototype.some.call(r,n=>!t.has(n))}isWhitespaceOnly(r){let t=ce(this,Q);return Array.prototype.every.call(r,n=>t.has(n))}};Q=new WeakMap;var Bi=wt;var Hl=[" ",` +`,"\f","\r"," "],Kl=new Bi(Hl),xt=Kl;var Jl=/^.$/su;function Xl(e,r){return e=Ql(e,r),e=ef(e),e=tf(e,r),e=nf(e,r),e=rf(e),e}function Ql(e,r){return Ae(e,t=>t.type!=="text"||t.value==="*"||t.value==="_"||!Jl.test(t.value)||t.position.end.offset-t.position.start.offset===t.value.length?t:{...t,value:r.originalText.slice(t.position.start.offset,t.position.end.offset)})}function Zl(e,r,t){return Ae(e,n=>{if(!n.children)return n;let a=n.children.reduce((u,i)=>{let o=z(!1,u,-1);return o&&r(o,i)?u.splice(-1,1,t(o,i)):u.push(i),u},[]);return{...n,children:a}})}function ef(e){return Zl(e,(r,t)=>r.type==="text"&&t.type==="text",(r,t)=>({type:"text",value:r.value+t.value,position:{start:r.position.start,end:t.position.end}}))}function rf(e){return Ae(e,(r,t,[n])=>{if(r.type!=="text")return r;let{value:a}=r;return n.type==="paragraph"&&(t===0&&(a=xt.trimStart(a)),t===n.children.length-1&&(a=xt.trimEnd(a))),{type:"sentence",position:r.position,children:Ir(a)}})}function tf(e,r){return Ae(e,(t,n,a)=>{if(t.type==="code"){let u=/^\n?(?: {4,}|\t)/u.test(r.originalText.slice(t.position.start.offset,t.position.end.offset));if(t.isIndented=u,u)for(let i=0;i{if(a.type==="list"&&a.children.length>0){for(let o=0;o1)return!0;let s=t(u);if(s===-1)return!1;if(a.children.length===1)return s%r.tabWidth===0;let l=t(i);return s!==l?!1:s%r.tabWidth===0?!0:Ye(i,r).leadingSpaces.length>1}}var Ti=Xl;function qi(e,r){let t=[""];return e.each(()=>{let{node:n}=e,a=r();switch(n.type){case"whitespace":if(Y(a)!==G){t.push(a,"");break}default:t.push([t.pop(),a])}},"children"),ze(t)}var uf=new Set(["heading","tableCell","link","wikiLink"]),_i=new Set("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~");function af({parent:e}){if(e.usesCJSpaces===void 0){let r={" ":0,"":0},{children:t}=e;for(let n=1;nr[""]}return e.usesCJSpaces}function of(e,r){if(r)return!0;let{previous:t,next:n}=e;if(!t||!n)return!0;let a=t.kind,u=n.kind;return Si(a)&&Si(u)||a===Pe&&u===ie||u===Pe&&a===ie?!0:a===sr||u===sr||a===ie&&u===ie?!1:_i.has(n.value[0])||_i.has(z(!1,t.value,-1))?!0:t.hasTrailingPunctuation||n.hasLeadingPunctuation?!1:af(e)}function Si(e){return e===Ge||e===Pe}function sf(e,r,t,n){if(t!=="always"||e.hasAncestor(i=>uf.has(i.type)))return!1;if(n)return r!=="";let{previous:a,next:u}=e;return!a||!u?!0:r===""?!1:a.kind===Pe&&u.kind===ie||u.kind===Pe&&a.kind===ie?!0:!(a.isCJ||u.isCJ)}function kt(e,r,t,n){if(t==="preserve"&&r===` +`)return P;let a=r===" "||r===` +`&&of(e,n);return sf(e,r,t,n)?a?_r:Sr:a?" ":""}var cf=new Set(["listItem","definition"]);function lf(e,r,t){var a,u;let{node:n}=e;if(mf(e)){let i=[""],o=Ir(r.originalText.slice(n.position.start.offset,n.position.end.offset));for(let s of o){if(s.type==="word"){i.push([i.pop(),s.value]);continue}let l=kt(e,s.value,r.proseWrap,!0);if(Y(l)===G){i.push([i.pop(),l]);continue}i.push(l,"")}return ze(i)}switch(n.type){case"front-matter":return r.originalText.slice(n.position.start.offset,n.position.end.offset);case"root":return n.children.length===0?"":[pf(e,r,t),P];case"paragraph":return ki(e,r,t);case"sentence":return qi(e,t);case"word":{let i=N(!1,N(!1,n.value,"*",String.raw`\*`),new RegExp([`(^|${Se.source})(_+)`,`(_+)(${Se.source}|$)`].join("|"),"gu"),(l,c,f,p,d)=>N(!1,f?`${c}${f}`:`${p}${d}`,"_",String.raw`\_`)),o=(l,c,f)=>l.type==="sentence"&&f===0,s=(l,c,f)=>Et(l.children[f-1]);return i!==n.value&&(e.match(void 0,o,s)||e.match(void 0,o,(l,c,f)=>l.type==="emphasis"&&f===0,s))&&(i=i.replace(/^(\\?[*_])+/u,l=>N(!1,l,"\\",""))),i}case"whitespace":{let{next:i}=e,o=i&&/^>|^(?:[*+-]|#{1,6}|\d+[).])$/u.test(i.value)?"never":r.proseWrap;return kt(e,n.value,o)}case"emphasis":{let i;if(Et(n.children[0]))i=r.originalText[n.position.start.offset];else{let{previous:o,next:s}=e;i=(o==null?void 0:o.type)==="sentence"&&((a=z(!1,o.children,-1))==null?void 0:a.type)==="word"&&!z(!1,o.children,-1).hasTrailingPunctuation||(s==null?void 0:s.type)==="sentence"&&((u=s.children[0])==null?void 0:u.type)==="word"&&!s.children[0].hasLeadingPunctuation||e.hasAncestor(c=>c.type==="emphasis")?"*":"_"}return[i,$(e,r,t),i]}case"strong":return["**",$(e,r,t),"**"];case"delete":return["~~",$(e,r,t),"~~"];case"inlineCode":{let i=r.proseWrap==="preserve"?n.value:N(!1,n.value,` +`," "),o=Zn(i,"`"),s="`".repeat(o||1),l=i.startsWith("`")||i.endsWith("`")||/^[\n ]/u.test(i)&&/[\n ]$/u.test(i)&&/[^\n ]/u.test(i)?" ":"";return[s,l,i,l,s]}case"wikiLink":{let i="";return r.proseWrap==="preserve"?i=n.value:i=N(!1,n.value,/[\t\n]+/gu," "),["[[",i,"]]"]}case"link":switch(r.originalText[n.position.start.offset]){case"<":{let i="mailto:";return["<",n.url.startsWith(i)&&r.originalText.slice(n.position.start.offset+1,n.position.start.offset+1+i.length)!==i?n.url.slice(i.length):n.url,">"]}case"[":return["[",$(e,r,t),"](",Bt(n.url,")"),Ur(n.title,r),")"];default:return r.originalText.slice(n.position.start.offset,n.position.end.offset)}case"image":return["![",n.alt||"","](",Bt(n.url,")"),Ur(n.title,r),")"];case"blockquote":return["> ",ye("> ",$(e,r,t))];case"heading":return["#".repeat(n.depth)+" ",$(e,r,t)];case"code":{if(n.isIndented){let s=" ".repeat(4);return ye(s,[s,be(n.value,P)])}let i=r.__inJsTemplate?"~":"`",o=i.repeat(Math.max(3,Or(n.value,i)+1));return[o,n.lang||"",n.meta?" "+n.meta:"",P,be(Nr(n,r.originalText),P),P,o]}case"html":{let{parent:i,isLast:o}=e,s=i.type==="root"&&o?n.value.trimEnd():n.value,l=/^$/su.test(s);return be(s,l?P:_e(tr))}case"list":{let i=Li(n,e.parent),o=hi(n,r);return $(e,r,t,{processor(s){let l=f(),c=s.node;if(c.children.length===2&&c.children[1].type==="html"&&c.children[0].position.start.column!==c.children[1].position.start.column)return[l,Oi(s,r,t,l)];return[l,ye(" ".repeat(l.length),Oi(s,r,t,l))];function f(){let p=n.ordered?(s.isFirst?n.start:o?1:n.start+s.index)+(i%2===0?". ":") "):i%2===0?"- ":"* ";return(n.isAligned||n.hasIndentedCodeblock)&&n.ordered?ff(p,r):p}}})}case"thematicBreak":{let{ancestors:i}=e,o=i.findIndex(l=>l.type==="list");return o===-1?"---":Li(i[o],i[o+1])%2===0?"***":"---"}case"linkReference":return["[",$(e,r,t),"]",n.referenceType==="full"?Tt(n):n.referenceType==="collapsed"?"[]":""];case"imageReference":switch(n.referenceType){case"full":return["![",n.alt||"","]",Tt(n)];default:return["![",n.alt,"]",n.referenceType==="collapsed"?"[]":""]}case"definition":{let i=r.proseWrap==="always"?_r:" ";return Me([Tt(n),":",nr([i,Bt(n.url),n.title===null?"":[i,Ur(n.title,r,!1)]])])}case"footnote":return["[^",$(e,r,t),"]"];case"footnoteReference":return Ri(n);case"footnoteDefinition":{let i=n.children.length===1&&n.children[0].type==="paragraph"&&(r.proseWrap==="never"||r.proseWrap==="preserve"&&n.children[0].position.start.line===n.children[0].position.end.line);return[Ri(n),": ",i?$(e,r,t):Me([ye(" ".repeat(4),$(e,r,t,{processor:({isFirst:o})=>o?Me([Sr,t()]):t()}))])]}case"table":return xi(e,r,t);case"tableCell":return $(e,r,t);case"break":return/\s/u.test(r.originalText[n.position.start.offset])?[" ",_e(tr)]:["\\",P];case"liquidNode":return be(n.value,P);case"import":case"export":case"jsx":return n.value;case"esComment":return["{/* ",n.value," */}"];case"math":return["$$",P,n.value?[be(n.value,P),P]:"","$$"];case"inlineMath":return r.originalText.slice(Oe(n),Le(n));case"tableRow":case"listItem":case"text":default:throw new ti(n,"Markdown")}}function Oi(e,r,t,n){let{node:a}=e,u=a.checked===null?"":a.checked?"[x] ":"[ ] ";return[u,$(e,r,t,{processor({node:i,isFirst:o}){if(o&&i.type!=="list")return ye(" ".repeat(u.length),t());let s=" ".repeat(gf(r.tabWidth-n.length,0,3));return[s,ye(s,t())]}})]}function ff(e,r){let t=n();return e+" ".repeat(t>=4?0:t);function n(){let a=e.length%r.tabWidth;return a===0?0:r.tabWidth-a}}function Li(e,r){return Df(e,r,t=>t.ordered===e.ordered)}function Df(e,r,t){let n=-1;for(let a of r.children)if(a.type===e.type&&t(a)?n++:n=-1,a===e)return n}function pf(e,r,t){let n=[],a=null,{children:u}=e.node;for(let[i,o]of u.entries())switch(qt(o)){case"start":a===null&&(a={index:i,offset:o.position.end.offset});break;case"end":a!==null&&(n.push({start:a,end:{index:i,offset:o.position.start.offset}}),a=null);break;default:break}return $(e,r,t,{processor({index:i}){if(n.length>0){let o=n[0];if(i===o.start.index)return[Pi(u[o.start.index]),r.originalText.slice(o.start.offset,o.end.offset),Pi(u[o.end.index])];if(o.start.index{let i=a(e);i!==!1&&(u.length>0&&hf(e)&&(u.push(P),(df(e,r)||Ni(e))&&u.push(P),Ni(e)&&u.push(P)),u.push(i))},"children"),u}function Pi(e){if(e.type==="html")return e.value;if(e.type==="paragraph"&&Array.isArray(e.children)&&e.children.length===1&&e.children[0].type==="esComment")return["{/* ",e.children[0].value," */}"]}function qt(e){let r;if(e.type==="html")r=e.value.match(/^$/u);else{let t;e.type==="esComment"?t=e:e.type==="paragraph"&&e.children.length===1&&e.children[0].type==="esComment"&&(t=e.children[0]),t&&(r=t.value.match(/^prettier-ignore(?:-(start|end))?$/u))}return r?r[1]||"next":!1}function hf({node:e,parent:r}){let t=vt.has(e.type),n=e.type==="html"&&Pr.has(r.type);return!t&&!n}function Ii(e,r){return e.type==="listItem"&&(e.spread||r.originalText.charAt(e.position.end.offset-1)===` +`)}function df({node:e,previous:r,parent:t},n){if(Ii(r,n))return!0;let i=r.type===e.type&&cf.has(e.type),o=t.type==="listItem"&&!Ii(t,n),s=qt(r)==="next",l=e.type==="html"&&r.type==="html"&&r.position.end.line+1===e.position.start.line,c=e.type==="html"&&t.type==="listItem"&&r.type==="paragraph"&&r.position.end.line+1===e.position.start.line;return!(i||o||s||l||c)}function Ni({node:e,previous:r}){let t=r.type==="list",n=e.type==="code"&&e.isIndented;return t&&n}function mf(e){let r=e.findAncestor(t=>t.type==="linkReference"||t.type==="imageReference");return r&&(r.type!=="linkReference"||r.referenceType!=="full")}var Ff=(e,r)=>{for(let t of r)e=N(!1,e,t,encodeURIComponent(t));return e};function Bt(e,r=[]){let t=[" ",...Array.isArray(r)?r:[r]];return new RegExp(t.map(n=>le(n)).join("|"),"u").test(e)?`<${Ff(e,"<>")}>`:e}function Ur(e,r,t=!0){if(!e)return"";if(t)return" "+Ur(e,r,!1);if(e=N(!1,e,/\\(?=["')])/gu,""),e.includes('"')&&e.includes("'")&&!e.includes(")"))return`(${e})`;let n=ri(e,r.singleQuote);return e=N(!1,e,"\\","\\\\"),e=N(!1,e,n,`\\${n}`),`${n}${e}${n}`}function gf(e,r,t){return Math.max(r,Math.min(e,t))}function vf(e){return e.index>0&&qt(e.previous)==="next"}function Tt(e){return`[${(0,Ui.default)(e.label)}]`}function Ri(e){return`[^${e.label}]`}var Ef={preprocess:Ti,print:lf,embed:di,massageAstNode:ci,hasPrettierIgnore:vf,insertPragma:ai,getVisitorKeys:gi},Mi=Ef;var zi=[{linguistLanguageId:222,name:"Markdown",type:"prose",color:"#083fa1",aliases:["md","pandoc"],aceMode:"markdown",codemirrorMode:"gfm",codemirrorMimeType:"text/x-gfm",wrap:!0,extensions:[".md",".livemd",".markdown",".mdown",".mdwn",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr","README"],tmScope:"text.md",parsers:["markdown"],vscodeLanguageIds:["markdown"]},{linguistLanguageId:222,name:"MDX",type:"prose",color:"#083fa1",aliases:["md","pandoc"],aceMode:"markdown",codemirrorMode:"gfm",codemirrorMimeType:"text/x-gfm",wrap:!0,extensions:[".mdx"],filenames:[],tmScope:"text.md",parsers:["mdx"],vscodeLanguageIds:["mdx"]}];var _t={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var Cf={proseWrap:_t.proseWrap,singleQuote:_t.singleQuote},Yi=Cf;var Mn={};Yn(Mn,{markdown:()=>Nm,mdx:()=>Rm,remark:()=>Nm});var il=Ue(Vi(),1),ul=Ue(iu(),1),al=Ue(Zs(),1),ol=Ue($c(),1);var Tm=/^import\s/u,qm=/^export\s/u,Wc=String.raw`[a-z][a-z0-9]*(\.[a-z][a-z0-9]*)*|`,Hc=/|/u,_m=/^\{\s*\/\*(.*)\*\/\s*\}/u,Sm=` + +`,Kc=e=>Tm.test(e),Un=e=>qm.test(e),Jc=(e,r)=>{let t=r.indexOf(Sm),n=r.slice(0,t);if(Un(n)||Kc(n))return e(n)({type:Un(n)?"export":"import",value:n})},Xc=(e,r)=>{let t=_m.exec(r);if(t)return e(t[0])({type:"esComment",value:t[1].trim()})};Jc.locator=e=>Un(e)||Kc(e)?-1:1;Xc.locator=(e,r)=>e.indexOf("{",r);var Qc=function(){let{Parser:e}=this,{blockTokenizers:r,blockMethods:t,inlineTokenizers:n,inlineMethods:a}=e.prototype;r.esSyntax=Jc,n.esComment=Xc,t.splice(t.indexOf("paragraph"),0,"esSyntax"),a.splice(a.indexOf("text"),0,"esComment")};var Om=function(){let e=this.Parser.prototype;e.blockMethods=["frontMatter",...e.blockMethods],e.blockTokenizers.frontMatter=r;function r(t,n){let a=or(n);if(a.frontMatter)return t(a.frontMatter.raw)(a.frontMatter)}r.onlyAtStart=!0},Zc=Om;function Lm(){return e=>Ae(e,(r,t,[n])=>r.type!=="html"||Hc.test(r.value)||Pr.has(n.type)?r:{...r,type:"jsx"})}var el=Lm;var Pm=function(){let e=this.Parser.prototype,r=e.inlineMethods;r.splice(r.indexOf("text"),0,"liquid"),e.inlineTokenizers.liquid=t;function t(n,a){let u=a.match(/^(\{%.*?%\}|\{\{.*?\}\})/su);if(u)return n(u[0])({type:"liquidNode",value:u[0]})}t.locator=function(n,a){return n.indexOf("{",a)}},rl=Pm;var Im=function(){let e="wikiLink",r=/^\[\[(?.+?)\]\]/su,t=this.Parser.prototype,n=t.inlineMethods;n.splice(n.indexOf("link"),0,e),t.inlineTokenizers.wikiLink=a;function a(u,i){let o=r.exec(i);if(o){let s=o.groups.linkContents.trim();return u(o[0])({type:e,value:s})}}a.locator=function(u,i){return u.indexOf("[",i)}},tl=Im;function sl({isMDX:e}){return r=>{let t=(0,ol.default)().use(al.default,{commonmark:!0,...e&&{blocks:[Wc]}}).use(il.default).use(Zc).use(ul.default).use(e?Qc:nl).use(rl).use(e?el:nl).use(tl);return t.run(t.parse(r))}}function nl(){}var cl={astFormat:"mdast",hasPragma:ui,locStart:Oe,locEnd:Le},Nm={...cl,parse:sl({isMDX:!1})},Rm={...cl,parse:sl({isMDX:!0})};var Um={mdast:Mi};return dl(Mm);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/markdown.mjs b/node_modules/prettier/plugins/markdown.mjs new file mode 100644 index 0000000..17e0707 --- /dev/null +++ b/node_modules/prettier/plugins/markdown.mjs @@ -0,0 +1,63 @@ +var ll=Object.create;var Dt=Object.defineProperty;var fl=Object.getOwnPropertyDescriptor;var Dl=Object.getOwnPropertyNames;var pl=Object.getPrototypeOf,hl=Object.prototype.hasOwnProperty;var Yn=e=>{throw TypeError(e)};var C=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Gn=(e,r)=>{for(var t in r)Dt(e,t,{get:r[t],enumerable:!0})},dl=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Dl(r))!hl.call(e,a)&&a!==t&&Dt(e,a,{get:()=>r[a],enumerable:!(n=fl(r,a))||n.enumerable});return e};var Ue=(e,r,t)=>(t=e!=null?ll(pl(e)):{},dl(r||!e||!e.__esModule?Dt(t,"default",{value:e,enumerable:!0}):t,e));var Vn=(e,r,t)=>r.has(e)||Yn("Cannot "+t);var ce=(e,r,t)=>(Vn(e,r,"read from private field"),t?t.call(e):r.get(e)),jn=(e,r,t)=>r.has(e)?Yn("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,t),$n=(e,r,t,n)=>(Vn(e,r,"write to private field"),n?n.call(e,t):r.set(e,t),t);var kr=C((Gm,Wn)=>{"use strict";Wn.exports=gl;function gl(e){return String(e).replace(/\s+/g," ")}});var Vi=C((Bv,Gi)=>{"use strict";Gi.exports=xf;var Dr=9,Ur=10,je=32,bf=33,yf=58,$e=91,Af=92,St=93,pr=94,Mr=96,zr=4,wf=1024;function xf(e){var r=this.Parser,t=this.Compiler;kf(r)&&Tf(r,e),Bf(t)&&qf(t)}function kf(e){return!!(e&&e.prototype&&e.prototype.blockTokenizers)}function Bf(e){return!!(e&&e.prototype&&e.prototype.visitors)}function Tf(e,r){for(var t=r||{},n=e.prototype,a=n.blockTokenizers,u=n.inlineTokenizers,i=n.blockMethods,o=n.inlineMethods,s=a.definition,l=u.reference,c=[],f=-1,p=i.length,d;++fzr&&(Z=void 0,ve=T);else{if(Z0&&(M=Ee[k-1],M.contentStart===M.contentEnd);)k--;for(Be=b(g.slice(0,M.contentEnd));++T{Lt.isRemarkParser=Sf;Lt.isRemarkCompiler=Of;function Sf(e){return!!(e&&e.prototype&&e.prototype.blockTokenizers)}function Of(e){return!!(e&&e.prototype&&e.prototype.visitors)}});var Xi=C((qv,Ji)=>{var ji=Pt();Ji.exports=Nf;var $i=9,Wi=32,Yr=36,Lf=48,Pf=57,Hi=92,If=["math","math-inline"],Ki="math-display";function Nf(e){let r=this.Parser,t=this.Compiler;ji.isRemarkParser(r)&&Rf(r,e),ji.isRemarkCompiler(t)&&Uf(t,e)}function Rf(e,r){let t=e.prototype,n=t.inlineMethods;u.locator=a,t.inlineTokenizers.math=u,n.splice(n.indexOf("text"),0,"math");function a(i,o){return i.indexOf("$",o)}function u(i,o,s){let l=o.length,c=!1,f=!1,p=0,d,D,h,m,F,y,E;if(o.charCodeAt(p)===Hi&&(f=!0,p++),o.charCodeAt(p)===Yr){if(p++,f)return s?!0:i(o.slice(0,p))({type:"text",value:"$"});if(o.charCodeAt(p)===Yr&&(c=!0,p++),h=o.charCodeAt(p),!(h===Wi||h===$i)){for(m=p;pPf)&&(!c||h===Yr)){F=p-1,p++,c&&p++,y=p;break}}else D===Hi&&(p++,h=o.charCodeAt(p+1));p++}if(y!==void 0)return s?!0:(E=o.slice(m,F+1),i(o.slice(0,y))({type:"inlineMath",value:E,data:{hName:"span",hProperties:{className:If.concat(c&&r.inlineMathDouble?[Ki]:[])},hChildren:[{type:"text",value:E}]}}))}}}}function Uf(e){let r=e.prototype;r.visitors.inlineMath=t;function t(n){let a="$";return(n.data&&n.data.hProperties&&n.data.hProperties.className||[]).includes(Ki)&&(a="$$"),a+n.value+a}}});var tu=C((_v,ru)=>{var Qi=Pt();ru.exports=Gf;var Zi=10,hr=32,It=36,eu=` +`,Mf="$",zf=2,Yf=["math","math-display"];function Gf(){let e=this.Parser,r=this.Compiler;Qi.isRemarkParser(e)&&Vf(e),Qi.isRemarkCompiler(r)&&jf(r)}function Vf(e){let r=e.prototype,t=r.blockMethods,n=r.interruptParagraph,a=r.interruptList,u=r.interruptBlockquote;r.blockTokenizers.math=i,t.splice(t.indexOf("fencedCode")+1,0,"math"),n.splice(n.indexOf("fencedCode")+1,0,["math"]),a.splice(a.indexOf("fencedCode")+1,0,["math"]),u.splice(u.indexOf("fencedCode")+1,0,["math"]);function i(o,s,l){var c=s.length,f=0;let p,d,D,h,m,F,y,E,B,b,g;for(;fb&&s.charCodeAt(h-1)===hr;)h--;for(;h>b&&s.charCodeAt(h-1)===It;)B++,h--;for(F<=B&&s.indexOf(Mf,b)===h&&(E=!0,g=h);b<=g&&b-fb&&s.charCodeAt(g-1)===hr;)g--;if((!E||b!==g)&&d.push(s.slice(b,g)),E)break;f=D+1,D=s.indexOf(eu,f+1),D=D===-1?c:D}return d=d.join(` +`),o(s.slice(0,D))({type:"math",value:d,data:{hName:"div",hProperties:{className:Yf.concat()},hChildren:[{type:"text",value:d}]}})}}}}function jf(e){let r=e.prototype;r.visitors.math=t;function t(n){return`$$ +`+n.value+` +$$`}}});var iu=C((Sv,nu)=>{var $f=Xi(),Wf=tu();nu.exports=Hf;function Hf(e){var r=e||{};Wf.call(this,r),$f.call(this,r)}});var Ie=C((Ov,uu)=>{uu.exports=Jf;var Kf=Object.prototype.hasOwnProperty;function Jf(){for(var e={},r=0;r{typeof Object.create=="function"?Nt.exports=function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:Nt.exports=function(r,t){if(t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r}}});var cu=C((Pv,su)=>{"use strict";var Xf=Ie(),ou=au();su.exports=Qf;function Qf(e){var r,t,n;ou(u,e),ou(a,u),r=u.prototype;for(t in r)n=r[t],n&&typeof n=="object"&&(r[t]="concat"in n?n.concat():Xf(n));return u;function a(i){return e.apply(this,i)}function u(){return this instanceof u?e.apply(this,arguments):new a(arguments)}}});var fu=C((Iv,lu)=>{"use strict";lu.exports=Zf;function Zf(e,r,t){return n;function n(){var a=t||this,u=a[e];return a[e]=!r,i;function i(){a[e]=u}}}});var pu=C((Nv,Du)=>{"use strict";Du.exports=eD;function eD(e){for(var r=String(e),t=[],n=/\r?\n|\r/g;n.exec(r);)t.push(n.lastIndex);return t.push(r.length+1),{toPoint:a,toPosition:a,toOffset:u};function a(i){var o=-1;if(i>-1&&ii)return{line:o+1,column:i-(t[o-1]||0)+1,offset:i}}return{}}function u(i){var o=i&&i.line,s=i&&i.column,l;return!isNaN(o)&&!isNaN(s)&&o-1 in t&&(l=(t[o-2]||0)+s-1||0),l>-1&&l{"use strict";hu.exports=rD;var Rt="\\";function rD(e,r){return t;function t(n){for(var a=0,u=n.indexOf(Rt),i=e[r],o=[],s;u!==-1;)o.push(n.slice(a,u)),a=u+1,s=n.charAt(a),(!s||i.indexOf(s)===-1)&&o.push(Rt),u=n.indexOf(Rt,a+1);return o.push(n.slice(a)),o.join("")}}});var mu=C((Uv,tD)=>{tD.exports={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Acirc:"\xC2",Agrave:"\xC0",Aring:"\xC5",Atilde:"\xC3",Auml:"\xC4",COPY:"\xA9",Ccedil:"\xC7",ETH:"\xD0",Eacute:"\xC9",Ecirc:"\xCA",Egrave:"\xC8",Euml:"\xCB",GT:">",Iacute:"\xCD",Icirc:"\xCE",Igrave:"\xCC",Iuml:"\xCF",LT:"<",Ntilde:"\xD1",Oacute:"\xD3",Ocirc:"\xD4",Ograve:"\xD2",Oslash:"\xD8",Otilde:"\xD5",Ouml:"\xD6",QUOT:'"',REG:"\xAE",THORN:"\xDE",Uacute:"\xDA",Ucirc:"\xDB",Ugrave:"\xD9",Uuml:"\xDC",Yacute:"\xDD",aacute:"\xE1",acirc:"\xE2",acute:"\xB4",aelig:"\xE6",agrave:"\xE0",amp:"&",aring:"\xE5",atilde:"\xE3",auml:"\xE4",brvbar:"\xA6",ccedil:"\xE7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",ecirc:"\xEA",egrave:"\xE8",eth:"\xF0",euml:"\xEB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",iacute:"\xED",icirc:"\xEE",iexcl:"\xA1",igrave:"\xEC",iquest:"\xBF",iuml:"\xEF",laquo:"\xAB",lt:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",oacute:"\xF3",ocirc:"\xF4",ograve:"\xF2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",otilde:"\xF5",ouml:"\xF6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',raquo:"\xBB",reg:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",times:"\xD7",uacute:"\xFA",ucirc:"\xFB",ugrave:"\xF9",uml:"\xA8",uuml:"\xFC",yacute:"\xFD",yen:"\xA5",yuml:"\xFF"}});var Fu=C((Mv,nD)=>{nD.exports={"0":"\uFFFD","128":"\u20AC","130":"\u201A","131":"\u0192","132":"\u201E","133":"\u2026","134":"\u2020","135":"\u2021","136":"\u02C6","137":"\u2030","138":"\u0160","139":"\u2039","140":"\u0152","142":"\u017D","145":"\u2018","146":"\u2019","147":"\u201C","148":"\u201D","149":"\u2022","150":"\u2013","151":"\u2014","152":"\u02DC","153":"\u2122","154":"\u0161","155":"\u203A","156":"\u0153","158":"\u017E","159":"\u0178"}});var Ne=C((zv,gu)=>{"use strict";gu.exports=iD;function iD(e){var r=typeof e=="string"?e.charCodeAt(0):e;return r>=48&&r<=57}});var Eu=C((Yv,vu)=>{"use strict";vu.exports=uD;function uD(e){var r=typeof e=="string"?e.charCodeAt(0):e;return r>=97&&r<=102||r>=65&&r<=70||r>=48&&r<=57}});var We=C((Gv,Cu)=>{"use strict";Cu.exports=aD;function aD(e){var r=typeof e=="string"?e.charCodeAt(0):e;return r>=97&&r<=122||r>=65&&r<=90}});var yu=C((Vv,bu)=>{"use strict";var oD=We(),sD=Ne();bu.exports=cD;function cD(e){return oD(e)||sD(e)}});var Au=C((jv,lD)=>{lD.exports={AEli:"\xC6",AElig:"\xC6",AM:"&",AMP:"&",Aacut:"\xC1",Aacute:"\xC1",Abreve:"\u0102",Acir:"\xC2",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrav:"\xC0",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Arin:"\xC5",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atild:"\xC3",Atilde:"\xC3",Aum:"\xC4",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COP:"\xA9",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedi:"\xC7",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ET:"\xD0",ETH:"\xD0",Eacut:"\xC9",Eacute:"\xC9",Ecaron:"\u011A",Ecir:"\xCA",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrav:"\xC8",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Eum:"\xCB",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",G:">",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacut:"\xCD",Iacute:"\xCD",Icir:"\xCE",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrav:"\xCC",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Ium:"\xCF",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",L:"<",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` +`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntild:"\xD1",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacut:"\xD3",Oacute:"\xD3",Ocir:"\xD4",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograv:"\xD2",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslas:"\xD8",Oslash:"\xD8",Otild:"\xD5",Otilde:"\xD5",Otimes:"\u2A37",Oum:"\xD6",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUO:'"',QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",RE:"\xAE",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THOR:"\xDE",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacut:"\xDA",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucir:"\xDB",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrav:"\xD9",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uum:"\xDC",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacut:"\xDD",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacut:"\xE1",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acir:"\xE2",acirc:"\xE2",acut:"\xB4",acute:"\xB4",acy:"\u0430",aeli:"\xE6",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrav:"\xE0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",am:"&",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",arin:"\xE5",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atild:"\xE3",atilde:"\xE3",aum:"\xE4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvba:"\xA6",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedi:"\xE7",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedi:"\xB8",cedil:"\xB8",cemptyv:"\u29B2",cen:"\xA2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",cop:"\xA9",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curre:"\xA4",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",de:"\xB0",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divid:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacut:"\xE9",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\xEA",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrav:"\xE8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",et:"\xF0",eth:"\xF0",eum:"\xEB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac1:"\xBC",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac3:"\xBE",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",g:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacut:"\xED",iacute:"\xED",ic:"\u2063",icir:"\xEE",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexc:"\xA1",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrav:"\xEC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iques:"\xBF",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",ium:"\xEF",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laqu:"\xAB",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",l:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",mac:"\xAF",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micr:"\xB5",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middo:"\xB7",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbs:"\xA0",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",no:"\xAC",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntild:"\xF1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacut:"\xF3",oacute:"\xF3",oast:"\u229B",ocir:"\xF4",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograv:"\xF2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\xBA",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslas:"\xF8",oslash:"\xF8",osol:"\u2298",otild:"\xF5",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",oum:"\xF6",ouml:"\xF6",ovbar:"\u233D",par:"\xB6",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusm:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",poun:"\xA3",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quo:'"',quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raqu:"\xBB",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",re:"\xAE",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sec:"\xA7",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",sh:"\xAD",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szli:"\xDF",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thor:"\xFE",thorn:"\xFE",tilde:"\u02DC",time:"\xD7",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacut:"\xFA",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucir:"\xFB",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrav:"\xF9",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",um:"\xA8",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uum:"\xFC",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacut:"\xFD",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",ye:"\xA5",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yum:"\xFF",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});var ku=C(($v,xu)=>{"use strict";var wu=Au();xu.exports=DD;var fD={}.hasOwnProperty;function DD(e){return fD.call(wu,e)?wu[e]:!1}});var dr=C((Wv,Mu)=>{"use strict";var Bu=mu(),Tu=Fu(),pD=Ne(),hD=Eu(),Ou=yu(),dD=ku();Mu.exports=BD;var mD={}.hasOwnProperty,He=String.fromCharCode,FD=Function.prototype,qu={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},gD=9,_u=10,vD=12,ED=32,Su=38,CD=59,bD=60,yD=61,AD=35,wD=88,xD=120,kD=65533,Ke="named",Mt="hexadecimal",zt="decimal",Yt={};Yt[Mt]=16;Yt[zt]=10;var Gr={};Gr[Ke]=Ou;Gr[zt]=pD;Gr[Mt]=hD;var Lu=1,Pu=2,Iu=3,Nu=4,Ru=5,Ut=6,Uu=7,we={};we[Lu]="Named character references must be terminated by a semicolon";we[Pu]="Numeric character references must be terminated by a semicolon";we[Iu]="Named character references cannot be empty";we[Nu]="Numeric character references cannot be empty";we[Ru]="Named character references must be known";we[Ut]="Numeric character references cannot be disallowed";we[Uu]="Numeric character references cannot be outside the permissible Unicode range";function BD(e,r){var t={},n,a;r||(r={});for(a in qu)n=r[a],t[a]=n??qu[a];return(t.position.indent||t.position.start)&&(t.indent=t.position.indent||[],t.position=t.position.start),TD(e,t)}function TD(e,r){var t=r.additional,n=r.nonTerminated,a=r.text,u=r.reference,i=r.warning,o=r.textContext,s=r.referenceContext,l=r.warningContext,c=r.position,f=r.indent||[],p=e.length,d=0,D=-1,h=c.column||1,m=c.line||1,F="",y=[],E,B,b,g,A,w,v,x,k,T,q,R,O,S,_,L,Be,W,I;for(typeof t=="string"&&(t=t.charCodeAt(0)),L=ee(),x=i?Z:FD,d--,p++;++d65535&&(w-=65536,T+=He(w>>>10|55296),w=56320|w&1023),w=T+He(w))):S!==Ke&&x(Nu,W)),w?(ve(),L=ee(),d=I-1,h+=I-O+1,y.push(w),Be=ee(),Be.offset++,u&&u.call(s,w,{start:L,end:Be},e.slice(O-1,I)),L=Be):(g=e.slice(O-1,I),F+=g,h+=g.length,d=I-1)}else A===10&&(m++,D++,h=0),A===A?(F+=He(A),h++):ve();return y.join("");function ee(){return{line:m,column:h,offset:d+(c.offset||0)}}function Z(Ee,M){var ft=ee();ft.column+=M,ft.offset+=M,i.call(l,we[Ee],ft,Ee)}function ve(){F&&(y.push(F),a&&a.call(o,F,{start:L,end:ee()}),F="")}}function qD(e){return e>=55296&&e<=57343||e>1114111}function _D(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}});var Gu=C((Hv,Yu)=>{"use strict";var SD=Ie(),zu=dr();Yu.exports=OD;function OD(e){return t.raw=n,t;function r(u){for(var i=e.offset,o=u.line,s=[];++o&&o in i;)s.push((i[o]||0)+1);return{start:u,indent:s}}function t(u,i,o){zu(u,{position:r(i),warning:a,text:o,reference:o,textContext:e,referenceContext:e})}function n(u,i,o){return zu(u,SD(o,{position:r(i),warning:a}))}function a(u,i,o){o!==3&&e.file.message(u,i)}}});var $u=C((Kv,ju)=>{"use strict";ju.exports=LD;function LD(e){return r;function r(t,n){var a=this,u=a.offset,i=[],o=a[e+"Methods"],s=a[e+"Tokenizers"],l=n.line,c=n.column,f,p,d,D,h,m;if(!t)return i;for(w.now=E,w.file=a.file,F("");t;){for(f=-1,p=o.length,h=!1;++f{"use strict";Hu.exports=Vr;var Gt=["\\","`","*","{","}","[","]","(",")","#","+","-",".","!","_",">"],Vt=Gt.concat(["~","|"]),Wu=Vt.concat([` +`,'"',"$","%","&","'",",","/",":",";","<","=","?","@","^"]);Vr.default=Gt;Vr.gfm=Vt;Vr.commonmark=Wu;function Vr(e){var r=e||{};return r.commonmark?Wu:r.gfm?Vt:Gt}});var Xu=C((Xv,Ju)=>{"use strict";Ju.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","pre","section","source","title","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]});var jt=C((Qv,Qu)=>{"use strict";Qu.exports={position:!0,gfm:!0,commonmark:!1,pedantic:!1,blocks:Xu()}});var ea=C((Zv,Zu)=>{"use strict";var ND=Ie(),RD=Ku(),UD=jt();Zu.exports=MD;function MD(e){var r=this,t=r.options,n,a;if(e==null)e={};else if(typeof e=="object")e=ND(e);else throw new Error("Invalid value `"+e+"` for setting `options`");for(n in UD){if(a=e[n],a==null&&(a=t[n]),n!=="blocks"&&typeof a!="boolean"||n==="blocks"&&typeof a!="object")throw new Error("Invalid value `"+a+"` for setting `options."+n+"`");e[n]=a}return r.options=e,r.escape=RD(e),r}});var na=C((eE,ta)=>{"use strict";ta.exports=ra;function ra(e){if(e==null)return VD;if(typeof e=="string")return GD(e);if(typeof e=="object")return"length"in e?YD(e):zD(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function zD(e){return r;function r(t){var n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function YD(e){for(var r=[],t=-1;++t{ia.exports=jD;function jD(e){return e}});var ca=C((tE,sa)=>{"use strict";sa.exports=jr;var $D=na(),WD=ua(),aa=!0,oa="skip",$t=!1;jr.CONTINUE=aa;jr.SKIP=oa;jr.EXIT=$t;function jr(e,r,t,n){var a,u;typeof r=="function"&&typeof t!="function"&&(n=t,t=r,r=null),u=$D(r),a=n?-1:1,i(e,null,[])();function i(o,s,l){var c=typeof o=="object"&&o!==null?o:{},f;return typeof c.type=="string"&&(f=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0,p.displayName="node ("+WD(c.type+(f?"<"+f+">":""))+")"),p;function p(){var d=l.concat(o),D=[],h,m;if((!r||u(o,s,l[l.length-1]||null))&&(D=HD(t(o,l)),D[0]===$t))return D;if(o.children&&D[0]!==oa)for(m=(n?o.children.length:-1)+a;m>-1&&m{"use strict";la.exports=Wr;var $r=ca(),KD=$r.CONTINUE,JD=$r.SKIP,XD=$r.EXIT;Wr.CONTINUE=KD;Wr.SKIP=JD;Wr.EXIT=XD;function Wr(e,r,t,n){typeof r=="function"&&typeof t!="function"&&(n=t,t=r,r=null),$r(e,r,a,n);function a(u,i){var o=i[i.length-1],s=o?o.children.indexOf(u):null;return t(u,s,o)}}});var pa=C((iE,Da)=>{"use strict";var QD=fa();Da.exports=ZD;function ZD(e,r){return QD(e,r?ep:rp),e}function ep(e){delete e.position}function rp(e){e.position=void 0}});var ma=C((uE,da)=>{"use strict";var ha=Ie(),tp=pa();da.exports=up;var np=` +`,ip=/\r\n|\r/g;function up(){var e=this,r=String(e.file),t={line:1,column:1,offset:0},n=ha(t),a;return r=r.replace(ip,np),r.charCodeAt(0)===65279&&(r=r.slice(1),n.column++,n.offset++),a={type:"root",children:e.tokenizeBlock(r,n),position:{start:t,end:e.eof||ha(t)}},e.options.position||tp(a,!0),a}});var ga=C((aE,Fa)=>{"use strict";var ap=/^[ \t]*(\n|$)/;Fa.exports=op;function op(e,r,t){for(var n,a="",u=0,i=r.length;u{"use strict";var me="",Wt;va.exports=sp;function sp(e,r){if(typeof e!="string")throw new TypeError("expected a string");if(r===1)return e;if(r===2)return e+e;var t=e.length*r;if(Wt!==e||typeof Wt>"u")Wt=e,me="";else if(me.length>=t)return me.substr(0,t);for(;t>me.length&&r>1;)r&1&&(me+=e),r>>=1,e+=e;return me+=e,me=me.substr(0,t),me}});var Ht=C((sE,Ea)=>{"use strict";Ea.exports=cp;function cp(e){return String(e).replace(/\n+$/,"")}});var ya=C((cE,ba)=>{"use strict";var lp=Hr(),fp=Ht();ba.exports=hp;var Kt=` +`,Ca=" ",Jt=" ",Dp=4,pp=lp(Jt,Dp);function hp(e,r,t){for(var n=-1,a=r.length,u="",i="",o="",s="",l,c,f;++n{"use strict";wa.exports=gp;var Kr=` +`,mr=" ",Je=" ",dp="~",Aa="`",mp=3,Fp=4;function gp(e,r,t){var n=this,a=n.options.gfm,u=r.length+1,i=0,o="",s,l,c,f,p,d,D,h,m,F,y,E,B;if(a){for(;i=Fp)){for(D="";i{Xe=ka.exports=vp;function vp(e){return e.trim?e.trim():Xe.right(Xe.left(e))}Xe.left=function(e){return e.trimLeft?e.trimLeft():e.replace(/^\s\s*/,"")};Xe.right=function(e){if(e.trimRight)return e.trimRight();for(var r=/\s/,t=e.length;r.test(e.charAt(--t)););return e.slice(0,t+1)}});var Jr=C((fE,Ba)=>{"use strict";Ba.exports=Ep;function Ep(e,r,t,n){for(var a=e.length,u=-1,i,o;++u{"use strict";var Cp=Re(),bp=Jr();_a.exports=yp;var Xt=` +`,Ta=" ",Qt=" ",qa=">";function yp(e,r,t){for(var n=this,a=n.offset,u=n.blockTokenizers,i=n.interruptBlockquote,o=e.now(),s=o.line,l=r.length,c=[],f=[],p=[],d,D=0,h,m,F,y,E,B,b,g;D{"use strict";La.exports=wp;var Oa=` +`,Fr=" ",gr=" ",vr="#",Ap=6;function wp(e,r,t){for(var n=this,a=n.options.pedantic,u=r.length+1,i=-1,o=e.now(),s="",l="",c,f,p;++iAp)&&!(!p||!a&&r.charAt(i+1)===vr)){for(u=r.length+1,f="";++i{"use strict";Na.exports=Sp;var xp=" ",kp=` +`,Ia=" ",Bp="*",Tp="-",qp="_",_p=3;function Sp(e,r,t){for(var n=-1,a=r.length+1,u="",i,o,s,l;++n=_p&&(!i||i===kp)?(u+=l,t?!0:e(u)({type:"thematicBreak"})):void 0}});var Zt=C((dE,Ma)=>{"use strict";Ma.exports=Ip;var Ua=" ",Op=" ",Lp=1,Pp=4;function Ip(e){for(var r=0,t=0,n=e.charAt(r),a={},u,i=0;n===Ua||n===Op;){for(u=n===Ua?Pp:Lp,t+=u,u>1&&(t=Math.floor(t/u)*u);i{"use strict";var Np=Re(),Rp=Hr(),Up=Zt();Ya.exports=Yp;var za=` +`,Mp=" ",zp="!";function Yp(e,r){var t=e.split(za),n=t.length+1,a=1/0,u=[],i,o,s;for(t.unshift(Rp(Mp,r)+zp);n--;)if(o=Up(t[n]),u[n]=o.stops,Np(t[n]).length!==0)if(o.indent)o.indent>0&&o.indent{"use strict";var Gp=Re(),Vp=Hr(),Va=Ne(),jp=Zt(),$p=Ga(),Wp=Jr();Ha.exports=rh;var en="*",Hp="_",ja="+",rn="-",$a=".",Fe=" ",ae=` +`,Xr=" ",Wa=")",Kp="x",xe=4,Jp=/\n\n(?!\s*$)/,Xp=/^\[([ X\tx])][ \t]/,Qp=/^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/,Zp=/^([ \t]*)([*+-]|\d+[.)])([ \t]+)/,eh=/^( {1,4}|\t)?/gm;function rh(e,r,t){for(var n=this,a=n.options.commonmark,u=n.options.pedantic,i=n.blockTokenizers,o=n.interruptList,s=0,l=r.length,c=null,f,p,d,D,h,m,F,y,E,B,b,g,A,w,v,x,k,T,q,R=!1,O,S,_,L;s=k.indent&&(L=!0),D=r.charAt(s),E=null,!L){if(D===en||D===ja||D===rn)E=D,s++,f++;else{for(p="";s=k.indent||f>xe),y=!1,s=F;if(b=r.slice(F,m),B=F===s?b:r.slice(s,m),(E===en||E===Hp||E===rn)&&i.thematicBreak.call(n,e,b,!0))break;if(g=A,A=!y&&!Gp(B).length,L&&k)k.value=k.value.concat(x,b),v=v.concat(x,b),x=[];else if(y)x.length!==0&&(R=!0,k.value.push(""),k.trail=x.concat()),k={value:[b],indent:f,trail:[]},w.push(k),v=v.concat(x,b),x=[];else if(A){if(g&&!a)break;x.push(b)}else{if(g||Wp(o,i,n,[e,b,!0]))break;k.value=k.value.concat(x,b),v=v.concat(x,b),x=[]}s=m+1}for(O=e(v.join(ae)).reset({type:"list",ordered:d,start:c,spread:R,children:[]}),T=n.enterList(),q=n.enterBlock(),s=-1,l=w.length;++s{"use strict";Qa.exports=lh;var tn=` +`,uh=" ",Ja=" ",Xa="=",ah="-",oh=3,sh=1,ch=2;function lh(e,r,t){for(var n=this,a=e.now(),u=r.length,i=-1,o="",s,l,c,f,p;++i=oh){i--;break}o+=c}for(s="",l="";++i{"use strict";var fh="[a-zA-Z_:][a-zA-Z0-9:._-]*",Dh="[^\"'=<>`\\u0000-\\u0020]+",ph="'[^']*'",hh='"[^"]*"',dh="(?:"+Dh+"|"+ph+"|"+hh+")",mh="(?:\\s+"+fh+"(?:\\s*=\\s*"+dh+")?)",eo="<[A-Za-z][A-Za-z0-9\\-]*"+mh+"*\\s*\\/?>",ro="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Fh="|",gh="<[?].*?[?]>",vh="]*>",Eh="";nn.openCloseTag=new RegExp("^(?:"+eo+"|"+ro+")");nn.tag=new RegExp("^(?:"+eo+"|"+ro+"|"+Fh+"|"+gh+"|"+vh+"|"+Eh+")")});var uo=C((EE,io)=>{"use strict";var Ch=un().openCloseTag;io.exports=Ih;var bh=" ",yh=" ",to=` +`,Ah="<",wh=/^<(script|pre|style)(?=(\s|>|$))/i,xh=/<\/(script|pre|style)>/i,kh=/^/,Th=/^<\?/,qh=/\?>/,_h=/^/,Oh=/^/,no=/^$/,Ph=new RegExp(Ch.source+"\\s*$");function Ih(e,r,t){for(var n=this,a=n.options.blocks.join("|"),u=new RegExp("^|$))","i"),i=r.length,o=0,s,l,c,f,p,d,D,h=[[wh,xh,!0],[kh,Bh,!0],[Th,qh,!0],[_h,Sh,!0],[Oh,Lh,!0],[u,no,!0],[Ph,no,!1]];o{"use strict";ao.exports=Uh;var Nh=String.fromCharCode,Rh=/\s/;function Uh(e){return Rh.test(typeof e=="number"?Nh(e):e.charAt(0))}});var an=C((bE,oo)=>{"use strict";var Mh=kr();oo.exports=zh;function zh(e){return Mh(e).toLowerCase()}});var ho=C((yE,po)=>{"use strict";var Yh=oe(),Gh=an();po.exports=Wh;var so='"',co="'",Vh="\\",Qe=` +`,Qr=" ",Zr=" ",sn="[",Er="]",jh="(",$h=")",lo=":",fo="<",Do=">";function Wh(e,r,t){for(var n=this,a=n.options.commonmark,u=0,i=r.length,o="",s,l,c,f,p,d,D,h;u{"use strict";var Kh=oe();Fo.exports=ud;var Jh=" ",et=` +`,Xh=" ",Qh="-",Zh=":",ed="\\",cn="|",rd=1,td=2,mo="left",nd="center",id="right";function ud(e,r,t){var n=this,a,u,i,o,s,l,c,f,p,d,D,h,m,F,y,E,B,b,g,A,w,v;if(n.options.gfm){for(a=0,E=0,l=r.length+1,c=[];aA){if(E1&&(p?(o+=f.slice(0,-1),f=f.charAt(f.length-1)):(o+=f,f="")),F=e.now(),e(o)({type:"tableCell",children:n.tokenizeInline(h,F)},s)),e(f+p),f="",h=""):(f&&(h+=f,f=""),h+=p,p===ed&&a!==l-2&&(h+=B.charAt(a+1),a++)),m=!1,a++}y||e(et+u)}return g}}}});var Co=C((wE,Eo)=>{"use strict";var ad=Re(),od=Ht(),sd=Jr();Eo.exports=fd;var cd=" ",Cr=` +`,ld=" ",vo=4;function fd(e,r,t){for(var n=this,a=n.options,u=a.commonmark,i=n.blockTokenizers,o=n.interruptParagraph,s=r.indexOf(Cr),l=r.length,c,f,p,d,D;s=vo&&p!==Cr){s=r.indexOf(Cr,s+1);continue}}if(f=r.slice(s+1),sd(o,i,n,[e,f,!0]))break;if(c=s,s=r.indexOf(Cr,s+1),s!==-1&&ad(r.slice(c,s))===""){s=c;break}}return f=r.slice(0,s),t?!0:(D=e.now(),f=od(f),e(f)({type:"paragraph",children:n.tokenizeInline(f,D)}))}});var yo=C((xE,bo)=>{"use strict";bo.exports=Dd;function Dd(e,r){return e.indexOf("\\",r)}});var ko=C((kE,xo)=>{"use strict";var pd=yo();xo.exports=wo;wo.locator=pd;var hd=` +`,Ao="\\";function wo(e,r,t){var n=this,a,u;if(r.charAt(0)===Ao&&(a=r.charAt(1),n.escape.indexOf(a)!==-1))return t?!0:(a===hd?u={type:"break"}:u={type:"text",value:a},e(Ao+a)(u))}});var ln=C((BE,Bo)=>{"use strict";Bo.exports=dd;function dd(e,r){return e.indexOf("<",r)}});var Oo=C((TE,So)=>{"use strict";var To=oe(),md=dr(),Fd=ln();So.exports=hn;hn.locator=Fd;hn.notInLink=!0;var qo="<",fn=">",_o="@",Dn="/",pn="mailto:",rt=pn.length;function hn(e,r,t){var n=this,a="",u=r.length,i=0,o="",s=!1,l="",c,f,p,d,D;if(r.charAt(0)===qo){for(i++,a=qo;i{"use strict";Lo.exports=gd;function gd(e,r){var t=String(e),n=0,a;if(typeof r!="string")throw new Error("Expected character");for(a=t.indexOf(r);a!==-1;)n++,a=t.indexOf(r,a+r.length);return n}});var Ro=C((_E,No)=>{"use strict";No.exports=vd;var Io=["www.","http://","https://"];function vd(e,r){var t=-1,n,a,u;if(!this.options.gfm)return t;for(a=Io.length,n=-1;++n{"use strict";var Uo=Po(),Ed=dr(),Cd=Ne(),dn=We(),bd=oe(),yd=Ro();Yo.exports=Fn;Fn.locator=yd;Fn.notInLink=!0;var Ad=33,wd=38,xd=41,kd=42,Bd=44,Td=45,mn=46,qd=58,_d=59,Sd=63,Od=60,Mo=95,Ld=126,Pd="(",zo=")";function Fn(e,r,t){var n=this,a=n.options.gfm,u=n.inlineTokenizers,i=r.length,o=-1,s=!1,l,c,f,p,d,D,h,m,F,y,E,B,b,g;if(a){if(r.slice(0,4)==="www.")s=!0,p=4;else if(r.slice(0,7).toLowerCase()==="http://")p=7;else if(r.slice(0,8).toLowerCase()==="https://")p=8;else return;for(o=p-1,f=p,l=[];pF;)p=d+D.lastIndexOf(zo),D=r.slice(d,p),y--;if(r.charCodeAt(p-1)===_d&&(p--,dn(r.charCodeAt(p-1)))){for(m=p-2;dn(r.charCodeAt(m));)m--;r.charCodeAt(m)===wd&&(p=m)}return E=r.slice(0,p),b=Ed(E,{nonTerminated:!1}),s&&(b="http://"+b),g=n.enterLink(),n.inlineTokenizers={text:u.text},B=n.tokenizeInline(E,e.now()),n.inlineTokenizers=u,g(),e(E)({type:"link",title:null,url:b,children:B})}}}});var Wo=C((OE,$o)=>{"use strict";var Id=Ne(),Nd=We(),Rd=43,Ud=45,Md=46,zd=95;$o.exports=jo;function jo(e,r){var t=this,n,a;if(!this.options.gfm||(n=e.indexOf("@",r),n===-1))return-1;if(a=n,a===r||!Vo(e.charCodeAt(a-1)))return jo.call(t,e,n+1);for(;a>r&&Vo(e.charCodeAt(a-1));)a--;return a}function Vo(e){return Id(e)||Nd(e)||e===Rd||e===Ud||e===Md||e===zd}});var Xo=C((LE,Jo)=>{"use strict";var Yd=dr(),Ho=Ne(),Ko=We(),Gd=Wo();Jo.exports=En;En.locator=Gd;En.notInLink=!0;var Vd=43,gn=45,tt=46,jd=64,vn=95;function En(e,r,t){var n=this,a=n.options.gfm,u=n.inlineTokenizers,i=0,o=r.length,s=-1,l,c,f,p;if(a){for(l=r.charCodeAt(i);Ho(l)||Ko(l)||l===Vd||l===gn||l===tt||l===vn;)l=r.charCodeAt(++i);if(i!==0&&l===jd){for(i++;i{"use strict";var $d=We(),Wd=ln(),Hd=un().tag;Zo.exports=Qo;Qo.locator=Wd;var Kd="<",Jd="?",Xd="!",Qd="/",Zd=/^/i;function Qo(e,r,t){var n=this,a=r.length,u,i;if(!(r.charAt(0)!==Kd||a<3)&&(u=r.charAt(1),!(!$d(u)&&u!==Jd&&u!==Xd&&u!==Qd)&&(i=r.match(Hd),!!i)))return t?!0:(i=i[0],!n.inLink&&Zd.test(i)?n.inLink=!0:n.inLink&&e0.test(i)&&(n.inLink=!1),e(i)({type:"html",value:i}))}});var Cn=C((IE,rs)=>{"use strict";rs.exports=r0;function r0(e,r){var t=e.indexOf("[",r),n=e.indexOf("![",r);return n===-1||t{"use strict";var br=oe(),t0=Cn();os.exports=as;as.locator=t0;var n0=` +`,i0="!",ts='"',ns="'",Ze="(",yr=")",bn="<",yn=">",is="[",Ar="\\",u0="]",us="`";function as(e,r,t){var n=this,a="",u=0,i=r.charAt(0),o=n.options.pedantic,s=n.options.commonmark,l=n.options.gfm,c,f,p,d,D,h,m,F,y,E,B,b,g,A,w,v,x,k;if(i===i0&&(F=!0,a=i,i=r.charAt(++u)),i===is&&!(!F&&n.inLink)){for(a+=i,A="",u++,B=r.length,v=e.now(),g=0,v.column+=u,v.offset+=u;u=p&&(p=0):p=f}else if(i===Ar)u++,h+=r.charAt(u);else if((!p||l)&&i===is)g++;else if((!p||l)&&i===u0)if(g)g--;else{if(r.charAt(u+1)!==Ze)return;h+=Ze,c=!0,u++;break}A+=h,h="",u++}if(c){for(y=A,a+=A+h,u++;u{"use strict";var a0=oe(),o0=Cn(),s0=an();ls.exports=cs;cs.locator=o0;var An="link",c0="image",l0="shortcut",f0="collapsed",wn="full",D0="!",nt="[",it="\\",ut="]";function cs(e,r,t){var n=this,a=n.options.commonmark,u=r.charAt(0),i=0,o=r.length,s="",l="",c=An,f=l0,p,d,D,h,m,F,y,E;if(u===D0&&(c=c0,l=u,u=r.charAt(++i)),u===nt){for(i++,l+=u,F="",E=0;i{"use strict";Ds.exports=p0;function p0(e,r){var t=e.indexOf("**",r),n=e.indexOf("__",r);return n===-1?t:t===-1||n{"use strict";var h0=Re(),hs=oe(),d0=ps();ms.exports=ds;ds.locator=d0;var m0="\\",F0="*",g0="_";function ds(e,r,t){var n=this,a=0,u=r.charAt(a),i,o,s,l,c,f,p;if(!(u!==F0&&u!==g0||r.charAt(++a)!==u)&&(o=n.options.pedantic,s=u,c=s+s,f=r.length,a++,l="",u="",!(o&&hs(r.charAt(a)))))for(;a{"use strict";gs.exports=C0;var v0=String.fromCharCode,E0=/\w/;function C0(e){return E0.test(typeof e=="number"?v0(e):e.charAt(0))}});var Cs=C((YE,Es)=>{"use strict";Es.exports=b0;function b0(e,r){var t=e.indexOf("*",r),n=e.indexOf("_",r);return n===-1?t:t===-1||n{"use strict";var y0=Re(),A0=vs(),bs=oe(),w0=Cs();ws.exports=As;As.locator=w0;var x0="*",ys="_",k0="\\";function As(e,r,t){var n=this,a=0,u=r.charAt(a),i,o,s,l,c,f,p;if(!(u!==x0&&u!==ys)&&(o=n.options.pedantic,c=u,s=u,f=r.length,a++,l="",u="",!(o&&bs(r.charAt(a)))))for(;a{"use strict";ks.exports=B0;function B0(e,r){return e.indexOf("~~",r)}});var Os=C((jE,Ss)=>{"use strict";var Ts=oe(),T0=Bs();Ss.exports=_s;_s.locator=T0;var at="~",qs="~~";function _s(e,r,t){var n=this,a="",u="",i="",o="",s,l,c;if(!(!n.options.gfm||r.charAt(0)!==at||r.charAt(1)!==at||Ts(r.charAt(2))))for(s=1,l=r.length,c=e.now(),c.column+=2,c.offset+=2;++s{"use strict";Ls.exports=q0;function q0(e,r){return e.indexOf("`",r)}});var Rs=C((WE,Ns)=>{"use strict";var _0=Ps();Ns.exports=Is;Is.locator=_0;var xn=10,kn=32,Bn=96;function Is(e,r,t){for(var n=r.length,a=0,u,i,o,s,l,c;a2&&(s===kn||s===xn)&&(l===kn||l===xn)){for(a++,n--;a{"use strict";Us.exports=S0;function S0(e,r){for(var t=e.indexOf(` +`,r);t>r&&e.charAt(t-1)===" ";)t--;return t}});var Gs=C((KE,Ys)=>{"use strict";var O0=Ms();Ys.exports=zs;zs.locator=O0;var L0=" ",P0=` +`,I0=2;function zs(e,r,t){for(var n=r.length,a=-1,u="",i;++a{"use strict";Vs.exports=N0;function N0(e,r,t){var n=this,a,u,i,o,s,l,c,f,p,d;if(t)return!0;for(a=n.inlineMethods,o=a.length,u=n.inlineTokenizers,i=-1,p=r.length;++i{"use strict";var R0=Ie(),ot=fu(),U0=pu(),M0=du(),z0=Gu(),Tn=$u();Hs.exports=$s;function $s(e,r){this.file=r,this.offset={},this.options=R0(this.options),this.setOptions({}),this.inList=!1,this.inBlock=!1,this.inLink=!1,this.atStart=!0,this.toOffset=U0(r).toOffset,this.unescape=M0(this,"escape"),this.decode=z0(this)}var U=$s.prototype;U.setOptions=ea();U.parse=ma();U.options=jt();U.exitStart=ot("atStart",!0);U.enterList=ot("inList",!1);U.enterLink=ot("inLink",!1);U.enterBlock=ot("inBlock",!1);U.interruptParagraph=[["thematicBreak"],["list"],["atxHeading"],["fencedCode"],["blockquote"],["html"],["setextHeading",{commonmark:!1}],["definition",{commonmark:!1}]];U.interruptList=[["atxHeading",{pedantic:!1}],["fencedCode",{pedantic:!1}],["thematicBreak",{pedantic:!1}],["definition",{commonmark:!1}]];U.interruptBlockquote=[["indentedCode",{commonmark:!0}],["fencedCode",{commonmark:!0}],["atxHeading",{commonmark:!0}],["setextHeading",{commonmark:!0}],["thematicBreak",{commonmark:!0}],["html",{commonmark:!0}],["list",{commonmark:!0}],["definition",{commonmark:!1}]];U.blockTokenizers={blankLine:ga(),indentedCode:ya(),fencedCode:xa(),blockquote:Sa(),atxHeading:Pa(),thematicBreak:Ra(),list:Ka(),setextHeading:Za(),html:uo(),definition:ho(),table:go(),paragraph:Co()};U.inlineTokenizers={escape:ko(),autoLink:Oo(),url:Go(),email:Xo(),html:es(),link:ss(),reference:fs(),strong:Fs(),emphasis:xs(),deletion:Os(),code:Rs(),break:Gs(),text:js()};U.blockMethods=Ws(U.blockTokenizers);U.inlineMethods=Ws(U.inlineTokenizers);U.tokenizeBlock=Tn("block");U.tokenizeInline=Tn("inline");U.tokenizeFactory=Tn;function Ws(e){var r=[],t;for(t in e)r.push(t);return r}});var Zs=C((QE,Qs)=>{"use strict";var Y0=cu(),G0=Ie(),Js=Ks();Qs.exports=Xs;Xs.Parser=Js;function Xs(e){var r=this.data("settings"),t=Y0(Js);t.prototype.options=G0(t.prototype.options,r,e),this.Parser=t}});var rc=C((ZE,ec)=>{"use strict";ec.exports=V0;function V0(e){if(e)throw e}});var qn=C((eC,tc)=>{tc.exports=function(r){return r!=null&&r.constructor!=null&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}});var fc=C((rC,lc)=>{"use strict";var st=Object.prototype.hasOwnProperty,cc=Object.prototype.toString,nc=Object.defineProperty,ic=Object.getOwnPropertyDescriptor,uc=function(r){return typeof Array.isArray=="function"?Array.isArray(r):cc.call(r)==="[object Array]"},ac=function(r){if(!r||cc.call(r)!=="[object Object]")return!1;var t=st.call(r,"constructor"),n=r.constructor&&r.constructor.prototype&&st.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!t&&!n)return!1;var a;for(a in r);return typeof a>"u"||st.call(r,a)},oc=function(r,t){nc&&t.name==="__proto__"?nc(r,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):r[t.name]=t.newValue},sc=function(r,t){if(t==="__proto__")if(st.call(r,t)){if(ic)return ic(r,t).value}else return;return r[t]};lc.exports=function e(){var r,t,n,a,u,i,o=arguments[0],s=1,l=arguments.length,c=!1;for(typeof o=="boolean"&&(c=o,o=arguments[1]||{},s=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});s{"use strict";Dc.exports=e=>{if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}});var dc=C((nC,hc)=>{"use strict";var j0=[].slice;hc.exports=$0;function $0(e,r){var t;return n;function n(){var i=j0.call(arguments,0),o=e.length>i.length,s;o&&i.push(a);try{s=e.apply(null,i)}catch(l){if(o&&t)throw l;return a(l)}o||(s&&typeof s.then=="function"?s.then(u,a):s instanceof Error?a(s):u(s))}function a(){t||(t=!0,r.apply(null,arguments))}function u(i){a(null,i)}}});var Ec=C((iC,vc)=>{"use strict";var Fc=dc();vc.exports=gc;gc.wrap=Fc;var mc=[].slice;function gc(){var e=[],r={};return r.run=t,r.use=n,r;function t(){var a=-1,u=mc.call(arguments,0,-1),i=arguments[arguments.length-1];if(typeof i!="function")throw new Error("Expected function as last argument, not "+i);o.apply(null,[null].concat(u));function o(s){var l=e[++a],c=mc.call(arguments,0),f=c.slice(1),p=u.length,d=-1;if(s){i(s);return}for(;++d{"use strict";var er={}.hasOwnProperty;yc.exports=W0;function W0(e){return!e||typeof e!="object"?"":er.call(e,"position")||er.call(e,"type")?Cc(e.position):er.call(e,"start")||er.call(e,"end")?Cc(e):er.call(e,"line")||er.call(e,"column")?_n(e):""}function _n(e){return(!e||typeof e!="object")&&(e={}),bc(e.line)+":"+bc(e.column)}function Cc(e){return(!e||typeof e!="object")&&(e={}),_n(e.start)+"-"+_n(e.end)}function bc(e){return e&&typeof e=="number"?e:1}});var kc=C((aC,xc)=>{"use strict";var H0=Ac();xc.exports=Sn;function wc(){}wc.prototype=Error.prototype;Sn.prototype=new wc;var ke=Sn.prototype;ke.file="";ke.name="";ke.reason="";ke.message="";ke.stack="";ke.fatal=null;ke.column=null;ke.line=null;function Sn(e,r,t){var n,a,u;typeof r=="string"&&(t=r,r=null),n=K0(t),a=H0(r)||"1:1",u={start:{line:null,column:null},end:{line:null,column:null}},r&&r.position&&(r=r.position),r&&(r.start?(u=r,r=r.start):u.start=r),e.stack&&(this.stack=e.stack,e=e.message),this.message=e,this.name=a,this.reason=e,this.line=r?r.line:null,this.column=r?r.column:null,this.location=u,this.source=n[0],this.ruleId=n[1]}function K0(e){var r=[null,null],t;return typeof e=="string"&&(t=e.indexOf(":"),t===-1?r[1]=e:(r[0]=e.slice(0,t),r[1]=e.slice(t+1))),r}});var Bc=C(rr=>{"use strict";rr.basename=J0;rr.dirname=X0;rr.extname=Q0;rr.join=Z0;rr.sep="/";function J0(e,r){var t=0,n=-1,a,u,i,o;if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');if(wr(e),a=e.length,r===void 0||!r.length||r.length>e.length){for(;a--;)if(e.charCodeAt(a)===47){if(i){t=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":e.slice(t,n)}if(r===e)return"";for(u=-1,o=r.length-1;a--;)if(e.charCodeAt(a)===47){if(i){t=a+1;break}}else u<0&&(i=!0,u=a+1),o>-1&&(e.charCodeAt(a)===r.charCodeAt(o--)?o<0&&(n=a):(o=-1,n=u));return t===n?n=u:n<0&&(n=e.length),e.slice(t,n)}function X0(e){var r,t,n;if(wr(e),!e.length)return".";for(r=-1,n=e.length;--n;)if(e.charCodeAt(n)===47){if(t){r=n;break}}else t||(t=!0);return r<0?e.charCodeAt(0)===47?"/":".":r===1&&e.charCodeAt(0)===47?"//":e.slice(0,r)}function Q0(e){var r=-1,t=0,n=-1,a=0,u,i,o;for(wr(e),o=e.length;o--;){if(i=e.charCodeAt(o),i===47){if(u){t=o+1;break}continue}n<0&&(u=!0,n=o+1),i===46?r<0?r=o:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||n<0||a===0||a===1&&r===n-1&&r===t+1?"":e.slice(r,n)}function Z0(){for(var e=-1,r;++e2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",n=0):(t=t.slice(0,s),n=t.length-1-t.lastIndexOf("/")),a=i,u=0;continue}}else if(t.length){t="",n=0,a=i,u=0;continue}}r&&(t=t.length?t+"/..":"..",n=2)}else t.length?t+="/"+e.slice(a+1,i):t=e.slice(a+1,i),n=i-a-1;a=i,u=0}else o===46&&u>-1?u++:u=-1}return t}function wr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}});var qc=C(Tc=>{"use strict";Tc.cwd=tm;function tm(){return"/"}});var Oc=C((cC,Sc)=>{"use strict";var se=Bc(),nm=qc(),im=qn();Sc.exports=ge;var um={}.hasOwnProperty,On=["history","path","basename","stem","extname","dirname"];ge.prototype.toString=mm;Object.defineProperty(ge.prototype,"path",{get:am,set:om});Object.defineProperty(ge.prototype,"dirname",{get:sm,set:cm});Object.defineProperty(ge.prototype,"basename",{get:lm,set:fm});Object.defineProperty(ge.prototype,"extname",{get:Dm,set:pm});Object.defineProperty(ge.prototype,"stem",{get:hm,set:dm});function ge(e){var r,t;if(!e)e={};else if(typeof e=="string"||im(e))e={contents:e};else if("message"in e&&"messages"in e)return e;if(!(this instanceof ge))return new ge(e);for(this.data={},this.messages=[],this.history=[],this.cwd=nm.cwd(),t=-1;++t-1)throw new Error("`extname` cannot contain multiple dots")}this.path=se.join(this.dirname,this.stem+(e||""))}function hm(){return typeof this.path=="string"?se.basename(this.path,this.extname):void 0}function dm(e){Pn(e,"stem"),Ln(e,"stem"),this.path=se.join(this.dirname||"",e+(this.extname||""))}function mm(e){return(this.contents||"").toString(e)}function Ln(e,r){if(e&&e.indexOf(se.sep)>-1)throw new Error("`"+r+"` cannot be a path: did not expect `"+se.sep+"`")}function Pn(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function _c(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}});var Pc=C((lC,Lc)=>{"use strict";var Fm=kc(),ct=Oc();Lc.exports=ct;ct.prototype.message=gm;ct.prototype.info=Em;ct.prototype.fail=vm;function gm(e,r,t){var n=new Fm(e,r,t);return this.path&&(n.name=this.path+":"+n.name,n.file=this.path),n.fatal=!1,this.messages.push(n),n}function vm(){var e=this.message.apply(this,arguments);throw e.fatal=!0,e}function Em(){var e=this.message.apply(this,arguments);return e.fatal=null,e}});var Nc=C((fC,Ic)=>{"use strict";Ic.exports=Pc()});var $c=C((DC,jc)=>{"use strict";var Rc=rc(),Cm=qn(),lt=fc(),Uc=pc(),Gc=Ec(),xr=Nc();jc.exports=Vc().freeze();var bm=[].slice,ym={}.hasOwnProperty,Am=Gc().use(wm).use(xm).use(km);function wm(e,r){r.tree=e.parse(r.file)}function xm(e,r,t){e.run(r.tree,r.file,n);function n(a,u,i){a?t(a):(r.tree=u,r.file=i,t())}}function km(e,r){var t=e.stringify(r.tree,r.file);t==null||(typeof t=="string"||Cm(t)?("value"in r.file&&(r.file.value=t),r.file.contents=t):r.file.result=t)}function Vc(){var e=[],r=Gc(),t={},n=-1,a;return u.data=o,u.freeze=i,u.attachers=e,u.use=s,u.parse=c,u.stringify=d,u.run=f,u.runSync=p,u.process=D,u.processSync=h,u;function u(){for(var m=Vc(),F=-1;++Fzi,options:()=>Yi,parsers:()=>Mn,printers:()=>Um});var ml=(e,r,t,n)=>{if(!(e&&r==null))return r.replaceAll?r.replaceAll(t,n):t.global?r.replace(t,n):r.split(t).join(n)},N=ml;var Fl=(e,r,t)=>{if(!(e&&r==null))return Array.isArray(r)||typeof r=="string"?r[t<0?r.length+t:t]:r.at(t)},z=Fl;var Ui=Ue(kr(),1);function le(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var G="string",H="array",Ce="cursor",re="indent",te="align",fe="trim",J="group",X="fill",K="if-break",De="indent-if-break",pe="line-suffix",he="line-suffix-boundary",V="line",de="label",ne="break-parent",Br=new Set([Ce,re,te,fe,J,X,K,De,pe,he,V,de,ne]);function vl(e){if(typeof e=="string")return G;if(Array.isArray(e))return H;if(!e)return;let{type:r}=e;if(Br.has(r))return r}var Y=vl;var El=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Cl(e){let r=e===null?"null":typeof e;if(r!=="string"&&r!=="object")return`Unexpected doc '${r}', +Expected it to be 'string' or 'object'.`;if(Y(e))throw new Error("doc is valid.");let t=Object.prototype.toString.call(e);if(t!=="[object Object]")return`Unexpected doc '${t}'.`;let n=El([...Br].map(a=>`'${a}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${n}.`}var pt=class extends Error{name="InvalidDocError";constructor(r){super(Cl(r)),this.doc=r}},Te=pt;var Hn={};function bl(e,r,t,n){let a=[e];for(;a.length>0;){let u=a.pop();if(u===Hn){t(a.pop());continue}t&&a.push(u,Hn);let i=Y(u);if(!i)throw new Te(u);if((r==null?void 0:r(u))!==!1)switch(i){case H:case X:{let o=i===H?u:u.parts;for(let s=o.length,l=s-1;l>=0;--l)a.push(o[l]);break}case K:a.push(u.flatContents,u.breakContents);break;case J:if(n&&u.expandedStates)for(let o=u.expandedStates.length,s=o-1;s>=0;--s)a.push(u.expandedStates[s]);else a.push(u.contents);break;case te:case re:case De:case de:case pe:a.push(u.contents);break;case G:case Ce:case fe:case he:case V:case ne:break;default:throw new Te(u)}}}var ht=bl;function yl(e,r){if(typeof e=="string")return r(e);let t=new Map;return n(e);function n(u){if(t.has(u))return t.get(u);let i=a(u);return t.set(u,i),i}function a(u){switch(Y(u)){case H:return r(u.map(n));case X:return r({...u,parts:u.parts.map(n)});case K:return r({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case J:{let{expandedStates:i,contents:o}=u;return i?(i=i.map(n),o=i[0]):o=n(o),r({...u,contents:o,expandedStates:i})}case te:case re:case De:case de:case pe:return r({...u,contents:n(u.contents)});case G:case Ce:case fe:case he:case V:case ne:return r(u);default:throw new Te(u)}}}function Kn(e){if(e.length>0){let r=z(!1,e,-1);!r.expandedStates&&!r.break&&(r.break="propagated")}return null}function Jn(e){let r=new Set,t=[];function n(u){if(u.type===ne&&Kn(t),u.type===J){if(t.push(u),r.has(u))return!1;r.add(u)}}function a(u){u.type===J&&t.pop().break&&Kn(t)}ht(e,n,a,!0)}function be(e,r=tr){return yl(e,t=>typeof t=="string"?Tr(r,t.split(` +`)):t)}var dt=()=>{},qe=dt,mt=dt,Xn=dt;function nr(e){return qe(e),{type:re,contents:e}}function ye(e,r){return qe(r),{type:te,contents:r,n:e}}function Me(e,r={}){return qe(e),mt(r.expandedStates,!0),{type:J,id:r.id,contents:e,break:!!r.shouldBreak,expandedStates:r.expandedStates}}function _e(e){return ye({type:"root"},e)}function ze(e){return Xn(e),{type:X,parts:e}}function Qn(e,r="",t={}){return qe(e),r!==""&&qe(r),{type:K,breakContents:e,flatContents:r,groupId:t.groupId}}var ir={type:ne};var ur={type:V,hard:!0},Al={type:V,hard:!0,literal:!0},qr={type:V},_r={type:V,soft:!0},P=[ur,ir],tr=[Al,ir];function Tr(e,r){qe(e),mt(r);let t=[];for(let n=0;nMath.max(n,a.length/r.length),0)}var Sr=wl;function xl(e,r){let t=e.match(new RegExp(`(${le(r)})+`,"gu"));if(t===null)return 0;let n=new Map,a=0;for(let u of t){let i=u.length/r.length;n.set(i,!0),i>a&&(a=i)}for(let u=1;uu?n:t}var ri=kl;var Ft=class extends Error{name="UnexpectedNodeError";constructor(r,t,n="type"){super(`Unexpected ${t} node ${n}: ${JSON.stringify(r[n])}.`),this.node=r}},ti=Ft;var oi=Ue(kr(),1);function Bl(e){return(e==null?void 0:e.type)==="front-matter"}var ni=Bl;var ar=3;function Tl(e){let r=e.slice(0,ar);if(r!=="---"&&r!=="+++")return;let t=e.indexOf(` +`,ar);if(t===-1)return;let n=e.slice(ar,t).trim(),a=e.indexOf(` +${r}`,t),u=n;if(u||(u=r==="+++"?"toml":"yaml"),a===-1&&r==="---"&&u==="yaml"&&(a=e.indexOf(` +...`,t)),a===-1)return;let i=a+1+ar,o=e.charAt(i+1);if(!/\s?/u.test(o))return;let s=e.slice(0,i);return{type:"front-matter",language:u,explicitLanguage:n,value:e.slice(t+1,a),startDelimiter:r,endDelimiter:s.slice(-ar),raw:s}}function ql(e){let r=Tl(e);if(!r)return{content:e};let{raw:t}=r;return{frontMatter:r,content:N(!1,t,/[^\n]/gu," ")+e.slice(t.length)}}var or=ql;var ii=["format","prettier"];function gt(e){let r=`@(${ii.join("|")})`,t=new RegExp([``,`\\{\\s*\\/\\*\\s*${r}\\s*\\*\\/\\s*\\}`,``].join("|"),"mu"),n=e.match(t);return(n==null?void 0:n.index)===0}var ui=e=>gt(or(e).content.trimStart()),ai=e=>{let r=or(e),t=``;return r.frontMatter?`${r.frontMatter.raw} + +${t} + +${r.content}`:`${t} + +${r.content}`};var _l=new Set(["position","raw"]);function si(e,r,t){if((e.type==="front-matter"||e.type==="code"||e.type==="yaml"||e.type==="import"||e.type==="export"||e.type==="jsx")&&delete r.value,e.type==="list"&&delete r.isAligned,(e.type==="list"||e.type==="listItem")&&delete r.spread,e.type==="text")return null;if(e.type==="inlineCode"&&(r.value=N(!1,e.value,` +`," ")),e.type==="wikiLink"&&(r.value=N(!1,e.value.trim(),/[\t\n]+/gu," ")),(e.type==="definition"||e.type==="linkReference"||e.type==="imageReference")&&(r.label=(0,oi.default)(e.label)),(e.type==="link"||e.type==="image")&&e.url&&e.url.includes("("))for(let n of"<>")r.url=N(!1,e.url,n,encodeURIComponent(n));if((e.type==="definition"||e.type==="link"||e.type==="image")&&e.title&&(r.title=N(!1,e.title,/\\(?=["')])/gu,"")),(t==null?void 0:t.type)==="root"&&t.children.length>0&&(t.children[0]===e||ni(t.children[0])&&t.children[1]===e)&&e.type==="html"&>(e.value))return null}si.ignoredProperties=_l;var ci=si;var li=/(?:[\u{2ea}-\u{2eb}\u{1100}-\u{11ff}\u{2e80}-\u{2e99}\u{2e9b}-\u{2ef3}\u{2f00}-\u{2fd5}\u{2ff0}-\u{303f}\u{3041}-\u{3096}\u{3099}-\u{30ff}\u{3105}-\u{312f}\u{3131}-\u{318e}\u{3190}-\u{4dbf}\u{4e00}-\u{9fff}\u{a700}-\u{a707}\u{a960}-\u{a97c}\u{ac00}-\u{d7a3}\u{d7b0}-\u{d7c6}\u{d7cb}-\u{d7fb}\u{f900}-\u{fa6d}\u{fa70}-\u{fad9}\u{fe10}-\u{fe1f}\u{fe30}-\u{fe6f}\u{ff00}-\u{ffef}\u{16fe3}\u{1aff0}-\u{1aff3}\u{1aff5}-\u{1affb}\u{1affd}-\u{1affe}\u{1b000}-\u{1b122}\u{1b132}\u{1b150}-\u{1b152}\u{1b155}\u{1b164}-\u{1b167}\u{1f200}\u{1f250}-\u{1f251}\u{20000}-\u{2a6df}\u{2a700}-\u{2b739}\u{2b740}-\u{2b81d}\u{2b820}-\u{2cea1}\u{2ceb0}-\u{2ebe0}\u{2f800}-\u{2fa1d}\u{30000}-\u{3134a}\u{31350}-\u{323af}])(?:[\u{fe00}-\u{fe0f}\u{e0100}-\u{e01ef}])?/u,Se=/(?:[\u{21}-\u{2f}\u{3a}-\u{40}\u{5b}-\u{60}\u{7b}-\u{7e}]|\p{General_Category=Connector_Punctuation}|\p{General_Category=Dash_Punctuation}|\p{General_Category=Close_Punctuation}|\p{General_Category=Final_Punctuation}|\p{General_Category=Initial_Punctuation}|\p{General_Category=Other_Punctuation}|\p{General_Category=Open_Punctuation})/u;async function Sl(e,r){if(e.language==="yaml"){let t=e.value.trim(),n=t?await r(t,{parser:"yaml"}):"";return _e([e.startDelimiter,e.explicitLanguage,P,n,n?P:"",e.endDelimiter])}}var fi=Sl;var Ol=e=>String(e).split(/[/\\]/u).pop();function Di(e,r){if(!r)return;let t=Ol(r).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(a=>a.toLowerCase()===t))??e.find(({extensions:n})=>n==null?void 0:n.some(a=>t.endsWith(a)))}function Ll(e,r){if(r)return e.find(({name:t})=>t.toLowerCase()===r)??e.find(({aliases:t})=>t==null?void 0:t.includes(r))??e.find(({extensions:t})=>t==null?void 0:t.includes(`.${r}`))}function Pl(e,r){let t=e.plugins.flatMap(a=>a.languages??[]),n=Ll(t,r.language)??Di(t,r.physicalFile)??Di(t,r.file)??(r.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var pi=Pl;var Il=new Proxy(()=>{},{get:()=>Il});function Oe(e){return e.position.start.offset}function Le(e){return e.position.end.offset}var vt=new Set(["liquidNode","inlineCode","emphasis","esComment","strong","delete","wikiLink","link","linkReference","image","imageReference","footnote","footnoteReference","sentence","whitespace","word","break","inlineMath"]),Lr=new Set([...vt,"tableCell","paragraph","heading"]),Ge="non-cjk",ie="cj-letter",Pe="k-letter",sr="cjk-punctuation",Nl=/\p{Script_Extensions=Hangul}/u;function Pr(e){let r=[],t=e.split(/([\t\n ]+)/u);for(let[a,u]of t.entries()){if(a%2===1){r.push({type:"whitespace",value:/\n/u.test(u)?` +`:" "});continue}if((a===0||a===t.length-1)&&u==="")continue;let i=u.split(new RegExp(`(${li.source})`,"u"));for(let[o,s]of i.entries())if(!((o===0||o===i.length-1)&&s==="")){if(o%2===0){s!==""&&n({type:"word",value:s,kind:Ge,isCJ:!1,hasLeadingPunctuation:Se.test(s[0]),hasTrailingPunctuation:Se.test(z(!1,s,-1))});continue}if(Se.test(s)){n({type:"word",value:s,kind:sr,isCJ:!0,hasLeadingPunctuation:!0,hasTrailingPunctuation:!0});continue}if(Nl.test(s)){n({type:"word",value:s,kind:Pe,isCJ:!1,hasLeadingPunctuation:!1,hasTrailingPunctuation:!1});continue}n({type:"word",value:s,kind:ie,isCJ:!0,hasLeadingPunctuation:!1,hasTrailingPunctuation:!1})}}return r;function n(a){let u=z(!1,r,-1);(u==null?void 0:u.type)==="word"&&!i(Ge,sr)&&![u.value,a.value].some(o=>/\u3000/u.test(o))&&r.push({type:"whitespace",value:""}),r.push(a);function i(o,s){return u.kind===o&&a.kind===s||u.kind===s&&a.kind===o}}}function Ye(e,r){let t=r.originalText.slice(e.position.start.offset,e.position.end.offset),{numberText:n,leadingSpaces:a}=t.match(/^\s*(?\d+)(\.|\))(?\s*)/u).groups;return{number:Number(n),leadingSpaces:a}}function hi(e,r){return!e.ordered||e.children.length<2||Ye(e.children[1],r).number!==1?!1:Ye(e.children[0],r).number!==0?!0:e.children.length>2&&Ye(e.children[2],r).number===1}function Ir(e,r){let{value:t}=e;return e.position.end.offset===r.length&&t.endsWith(` +`)&&r.endsWith(` +`)?t.slice(0,-1):t}function Ae(e,r){return function t(n,a,u){let i={...r(n,a,u)};return i.children&&(i.children=i.children.map((o,s)=>t(o,s,[i,...u]))),i}(e,null,[])}function Et(e){if((e==null?void 0:e.type)!=="link"||e.children.length!==1)return!1;let[r]=e.children;return Oe(e)===Oe(r)&&Le(e)===Le(r)}function Rl(e,r){let{node:t}=e;if(t.type==="code"&&t.lang!==null){let n=pi(r,{language:t.lang});if(n)return async a=>{let u=r.__inJsTemplate?"~":"`",i=u.repeat(Math.max(3,Sr(t.value,u)+1)),o={parser:n};t.lang==="ts"||t.lang==="typescript"?o.filepath="dummy.ts":t.lang==="tsx"&&(o.filepath="dummy.tsx");let s=await a(Ir(t,r.originalText),o);return _e([i,t.lang,t.meta?" "+t.meta:"",P,be(s),P,i])}}switch(t.type){case"front-matter":return n=>fi(t,n);case"import":case"export":return n=>n(t.value,{parser:"babel"});case"jsx":return n=>n(`<$>${t.value}`,{parser:"__js_expression",rootMarker:"mdx"})}return null}var di=Rl;var cr=null;function lr(e){if(cr!==null&&typeof cr.property){let r=cr;return cr=lr.prototype=null,r}return cr=lr.prototype=e??Object.create(null),new lr}var Ul=10;for(let e=0;e<=Ul;e++)lr();function Ct(e){return lr(e)}function Ml(e,r="type"){Ct(e);function t(n){let a=n[r],u=e[a];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${a}'.`),{node:n});return u}return t}var mi=Ml;var zl={"front-matter":[],root:["children"],paragraph:["children"],sentence:["children"],word:[],whitespace:[],emphasis:["children"],strong:["children"],delete:["children"],inlineCode:[],wikiLink:[],link:["children"],image:[],blockquote:["children"],heading:["children"],code:[],html:[],list:["children"],thematicBreak:[],linkReference:["children"],imageReference:[],definition:[],footnote:["children"],footnoteReference:[],footnoteDefinition:["children"],table:["children"],tableCell:["children"],break:[],liquidNode:[],import:[],export:[],esComment:[],jsx:[],math:[],inlineMath:[],tableRow:["children"],listItem:["children"],text:[]},Fi=zl;var Yl=mi(Fi),gi=Yl;function vi(e){switch(e){case"cr":return"\r";case"crlf":return`\r +`;default:return` +`}}var Ei=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Ci(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function bi(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var yi=e=>!(Ci(e)||bi(e));var Gl=/[^\x20-\x7F]/u;function Vl(e){if(!e)return 0;if(!Gl.test(e))return e.length;e=e.replace(Ei()," ");let r=0;for(let t of e){let n=t.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(r+=yi(n)?1:2)}return r}var fr=Vl;var j=Symbol("MODE_BREAK"),ue=Symbol("MODE_FLAT"),Ve=Symbol("cursor"),bt=Symbol("DOC_FILL_PRINTED_LENGTH");function Ai(){return{value:"",length:0,queue:[]}}function jl(e,r){return yt(e,{type:"indent"},r)}function $l(e,r,t){return r===Number.NEGATIVE_INFINITY?e.root||Ai():r<0?yt(e,{type:"dedent"},t):r?r.type==="root"?{...e,root:e}:yt(e,{type:typeof r=="string"?"stringAlign":"numberAlign",n:r},t):e}function yt(e,r,t){let n=r.type==="dedent"?e.queue.slice(0,-1):[...e.queue,r],a="",u=0,i=0,o=0;for(let D of n)switch(D.type){case"indent":c(),t.useTabs?s(1):l(t.tabWidth);break;case"stringAlign":c(),a+=D.n,u+=D.n.length;break;case"numberAlign":i+=1,o+=D.n;break;default:throw new Error(`Unexpected type '${D.type}'`)}return p(),{...e,value:a,length:u,queue:n};function s(D){a+=" ".repeat(D),u+=t.tabWidth*D}function l(D){a+=" ".repeat(D),u+=D}function c(){t.useTabs?f():p()}function f(){i>0&&s(i),d()}function p(){o>0&&l(o),d()}function d(){i=0,o=0}}function At(e){let r=0,t=0,n=e.length;e:for(;n--;){let a=e[n];if(a===Ve){t++;continue}for(let u=a.length-1;u>=0;u--){let i=a[u];if(i===" "||i===" ")r++;else{e[n]=a.slice(0,u+1);break e}}}if(r>0||t>0)for(e.length=n+1;t-- >0;)e.push(Ve);return r}function Nr(e,r,t,n,a,u){if(t===Number.POSITIVE_INFINITY)return!0;let i=r.length,o=[e],s=[];for(;t>=0;){if(o.length===0){if(i===0)return!0;o.push(r[--i]);continue}let{mode:l,doc:c}=o.pop(),f=Y(c);switch(f){case G:s.push(c),t-=fr(c);break;case H:case X:{let p=f===H?c:c.parts,d=c[bt]??0;for(let D=p.length-1;D>=d;D--)o.push({mode:l,doc:p[D]});break}case re:case te:case De:case de:o.push({mode:l,doc:c.contents});break;case fe:t+=At(s);break;case J:{if(u&&c.break)return!1;let p=c.break?j:l,d=c.expandedStates&&p===j?z(!1,c.expandedStates,-1):c.contents;o.push({mode:p,doc:d});break}case K:{let d=(c.groupId?a[c.groupId]||ue:l)===j?c.breakContents:c.flatContents;d&&o.push({mode:l,doc:d});break}case V:if(l===j||c.hard)return!0;c.soft||(s.push(" "),t--);break;case pe:n=!0;break;case he:if(n)return!1;break}}return!1}function wi(e,r){let t={},n=r.printWidth,a=vi(r.endOfLine),u=0,i=[{ind:Ai(),mode:j,doc:e}],o=[],s=!1,l=[],c=0;for(Jn(e);i.length>0;){let{ind:p,mode:d,doc:D}=i.pop();switch(Y(D)){case G:{let h=a!==` +`?N(!1,D,` +`,a):D;o.push(h),i.length>0&&(u+=fr(h));break}case H:for(let h=D.length-1;h>=0;h--)i.push({ind:p,mode:d,doc:D[h]});break;case Ce:if(c>=2)throw new Error("There are too many 'cursor' in doc.");o.push(Ve),c++;break;case re:i.push({ind:jl(p,r),mode:d,doc:D.contents});break;case te:i.push({ind:$l(p,D.n,r),mode:d,doc:D.contents});break;case fe:u-=At(o);break;case J:switch(d){case ue:if(!s){i.push({ind:p,mode:D.break?j:ue,doc:D.contents});break}case j:{s=!1;let h={ind:p,mode:ue,doc:D.contents},m=n-u,F=l.length>0;if(!D.break&&Nr(h,i,m,F,t))i.push(h);else if(D.expandedStates){let y=z(!1,D.expandedStates,-1);if(D.break){i.push({ind:p,mode:j,doc:y});break}else for(let E=1;E=D.expandedStates.length){i.push({ind:p,mode:j,doc:y});break}else{let B=D.expandedStates[E],b={ind:p,mode:ue,doc:B};if(Nr(b,i,m,F,t)){i.push(b);break}}}else i.push({ind:p,mode:j,doc:D.contents});break}}D.id&&(t[D.id]=z(!1,i,-1).mode);break;case X:{let h=n-u,m=D[bt]??0,{parts:F}=D,y=F.length-m;if(y===0)break;let E=F[m+0],B=F[m+1],b={ind:p,mode:ue,doc:E},g={ind:p,mode:j,doc:E},A=Nr(b,[],h,l.length>0,t,!0);if(y===1){A?i.push(b):i.push(g);break}let w={ind:p,mode:ue,doc:B},v={ind:p,mode:j,doc:B};if(y===2){A?i.push(w,b):i.push(v,g);break}let x=F[m+2],k={ind:p,mode:d,doc:{...D,[bt]:m+2}};Nr({ind:p,mode:ue,doc:[E,B,x]},[],h,l.length>0,t,!0)?i.push(k,w,b):A?i.push(k,v,b):i.push(k,v,g);break}case K:case De:{let h=D.groupId?t[D.groupId]:d;if(h===j){let m=D.type===K?D.breakContents:D.negate?D.contents:nr(D.contents);m&&i.push({ind:p,mode:d,doc:m})}if(h===ue){let m=D.type===K?D.flatContents:D.negate?nr(D.contents):D.contents;m&&i.push({ind:p,mode:d,doc:m})}break}case pe:l.push({ind:p,mode:d,doc:D.contents});break;case he:l.length>0&&i.push({ind:p,mode:d,doc:ur});break;case V:switch(d){case ue:if(D.hard)s=!0;else{D.soft||(o.push(" "),u+=1);break}case j:if(l.length>0){i.push({ind:p,mode:d,doc:D},...l.reverse()),l.length=0;break}D.literal?p.root?(o.push(a,p.root.value),u=p.root.length):(o.push(a),u=0):(u-=At(o),o.push(a+p.value),u=p.length);break}break;case de:i.push({ind:p,mode:d,doc:D.contents});break;case ne:break;default:throw new Te(D)}i.length===0&&l.length>0&&(i.push(...l.reverse()),l.length=0)}let f=o.indexOf(Ve);if(f!==-1){let p=o.indexOf(Ve,f+1);if(p===-1)return{formatted:o.filter(m=>m!==Ve).join("")};let d=o.slice(0,f).join(""),D=o.slice(f+1,p).join(""),h=o.slice(p+1).join("");return{formatted:d+D+h,cursorNodeStart:d.length,cursorNodeText:D}}return{formatted:o.join("")}}function xi(e,r,t){let{node:n}=e,a=[],u=e.map(()=>e.map(({index:f})=>{let p=wi(t(),r).formatted,d=fr(p);return a[f]=Math.max(a[f]??3,d),{text:p,width:d}},"children"),"children"),i=s(!1);if(r.proseWrap!=="never")return[ir,i];let o=s(!0);return[ir,Me(Qn(o,i))];function s(f){return Tr(ur,[c(u[0],f),l(f),...u.slice(1).map(p=>c(p,f))].map(p=>`| ${p.join(" | ")} |`))}function l(f){return a.map((p,d)=>{let D=n.align[d],h=D==="center"||D==="left"?":":"-",m=D==="center"||D==="right"?":":"-",F=f?"-":"-".repeat(p-2);return`${h}${F}${m}`})}function c(f,p){return f.map(({text:d,width:D},h)=>{if(p)return d;let m=a[h]-D,F=n.align[h],y=0;F==="right"?y=m:F==="center"&&(y=Math.floor(m/2));let E=m-y;return`${" ".repeat(y)}${d}${" ".repeat(E)}`})}}function ki(e,r,t){let n=e.map(t,"children");return Wl(n)}function Wl(e){let r=[""];return function t(n){for(let a of n){let u=Y(a);if(u===H){t(a);continue}let i=a,o=[];u===X&&([i,...o]=a.parts),r.push([r.pop(),i],...o)}}(e),ze(r)}var Q,wt=class{constructor(r){jn(this,Q);$n(this,Q,new Set(r))}getLeadingWhitespaceCount(r){let t=ce(this,Q),n=0;for(let a=0;a=0&&t.has(r.charAt(a));a--)n++;return n}getLeadingWhitespace(r){let t=this.getLeadingWhitespaceCount(r);return r.slice(0,t)}getTrailingWhitespace(r){let t=this.getTrailingWhitespaceCount(r);return r.slice(r.length-t)}hasLeadingWhitespace(r){return ce(this,Q).has(r.charAt(0))}hasTrailingWhitespace(r){return ce(this,Q).has(z(!1,r,-1))}trimStart(r){let t=this.getLeadingWhitespaceCount(r);return r.slice(t)}trimEnd(r){let t=this.getTrailingWhitespaceCount(r);return r.slice(0,r.length-t)}trim(r){return this.trimEnd(this.trimStart(r))}split(r,t=!1){let n=`[${le([...ce(this,Q)].join(""))}]+`,a=new RegExp(t?`(${n})`:n,"u");return r.split(a)}hasWhitespaceCharacter(r){let t=ce(this,Q);return Array.prototype.some.call(r,n=>t.has(n))}hasNonWhitespaceCharacter(r){let t=ce(this,Q);return Array.prototype.some.call(r,n=>!t.has(n))}isWhitespaceOnly(r){let t=ce(this,Q);return Array.prototype.every.call(r,n=>t.has(n))}};Q=new WeakMap;var Bi=wt;var Hl=[" ",` +`,"\f","\r"," "],Kl=new Bi(Hl),xt=Kl;var Jl=/^.$/su;function Xl(e,r){return e=Ql(e,r),e=ef(e),e=tf(e,r),e=nf(e,r),e=rf(e),e}function Ql(e,r){return Ae(e,t=>t.type!=="text"||t.value==="*"||t.value==="_"||!Jl.test(t.value)||t.position.end.offset-t.position.start.offset===t.value.length?t:{...t,value:r.originalText.slice(t.position.start.offset,t.position.end.offset)})}function Zl(e,r,t){return Ae(e,n=>{if(!n.children)return n;let a=n.children.reduce((u,i)=>{let o=z(!1,u,-1);return o&&r(o,i)?u.splice(-1,1,t(o,i)):u.push(i),u},[]);return{...n,children:a}})}function ef(e){return Zl(e,(r,t)=>r.type==="text"&&t.type==="text",(r,t)=>({type:"text",value:r.value+t.value,position:{start:r.position.start,end:t.position.end}}))}function rf(e){return Ae(e,(r,t,[n])=>{if(r.type!=="text")return r;let{value:a}=r;return n.type==="paragraph"&&(t===0&&(a=xt.trimStart(a)),t===n.children.length-1&&(a=xt.trimEnd(a))),{type:"sentence",position:r.position,children:Pr(a)}})}function tf(e,r){return Ae(e,(t,n,a)=>{if(t.type==="code"){let u=/^\n?(?: {4,}|\t)/u.test(r.originalText.slice(t.position.start.offset,t.position.end.offset));if(t.isIndented=u,u)for(let i=0;i{if(a.type==="list"&&a.children.length>0){for(let o=0;o1)return!0;let s=t(u);if(s===-1)return!1;if(a.children.length===1)return s%r.tabWidth===0;let l=t(i);return s!==l?!1:s%r.tabWidth===0?!0:Ye(i,r).leadingSpaces.length>1}}var Ti=Xl;function qi(e,r){let t=[""];return e.each(()=>{let{node:n}=e,a=r();switch(n.type){case"whitespace":if(Y(a)!==G){t.push(a,"");break}default:t.push([t.pop(),a])}},"children"),ze(t)}var uf=new Set(["heading","tableCell","link","wikiLink"]),_i=new Set("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~");function af({parent:e}){if(e.usesCJSpaces===void 0){let r={" ":0,"":0},{children:t}=e;for(let n=1;nr[""]}return e.usesCJSpaces}function of(e,r){if(r)return!0;let{previous:t,next:n}=e;if(!t||!n)return!0;let a=t.kind,u=n.kind;return Si(a)&&Si(u)||a===Pe&&u===ie||u===Pe&&a===ie?!0:a===sr||u===sr||a===ie&&u===ie?!1:_i.has(n.value[0])||_i.has(z(!1,t.value,-1))?!0:t.hasTrailingPunctuation||n.hasLeadingPunctuation?!1:af(e)}function Si(e){return e===Ge||e===Pe}function sf(e,r,t,n){if(t!=="always"||e.hasAncestor(i=>uf.has(i.type)))return!1;if(n)return r!=="";let{previous:a,next:u}=e;return!a||!u?!0:r===""?!1:a.kind===Pe&&u.kind===ie||u.kind===Pe&&a.kind===ie?!0:!(a.isCJ||u.isCJ)}function kt(e,r,t,n){if(t==="preserve"&&r===` +`)return P;let a=r===" "||r===` +`&&of(e,n);return sf(e,r,t,n)?a?qr:_r:a?" ":""}var cf=new Set(["listItem","definition"]);function lf(e,r,t){var a,u;let{node:n}=e;if(mf(e)){let i=[""],o=Pr(r.originalText.slice(n.position.start.offset,n.position.end.offset));for(let s of o){if(s.type==="word"){i.push([i.pop(),s.value]);continue}let l=kt(e,s.value,r.proseWrap,!0);if(Y(l)===G){i.push([i.pop(),l]);continue}i.push(l,"")}return ze(i)}switch(n.type){case"front-matter":return r.originalText.slice(n.position.start.offset,n.position.end.offset);case"root":return n.children.length===0?"":[pf(e,r,t),P];case"paragraph":return ki(e,r,t);case"sentence":return qi(e,t);case"word":{let i=N(!1,N(!1,n.value,"*",String.raw`\*`),new RegExp([`(^|${Se.source})(_+)`,`(_+)(${Se.source}|$)`].join("|"),"gu"),(l,c,f,p,d)=>N(!1,f?`${c}${f}`:`${p}${d}`,"_",String.raw`\_`)),o=(l,c,f)=>l.type==="sentence"&&f===0,s=(l,c,f)=>Et(l.children[f-1]);return i!==n.value&&(e.match(void 0,o,s)||e.match(void 0,o,(l,c,f)=>l.type==="emphasis"&&f===0,s))&&(i=i.replace(/^(\\?[*_])+/u,l=>N(!1,l,"\\",""))),i}case"whitespace":{let{next:i}=e,o=i&&/^>|^(?:[*+-]|#{1,6}|\d+[).])$/u.test(i.value)?"never":r.proseWrap;return kt(e,n.value,o)}case"emphasis":{let i;if(Et(n.children[0]))i=r.originalText[n.position.start.offset];else{let{previous:o,next:s}=e;i=(o==null?void 0:o.type)==="sentence"&&((a=z(!1,o.children,-1))==null?void 0:a.type)==="word"&&!z(!1,o.children,-1).hasTrailingPunctuation||(s==null?void 0:s.type)==="sentence"&&((u=s.children[0])==null?void 0:u.type)==="word"&&!s.children[0].hasLeadingPunctuation||e.hasAncestor(c=>c.type==="emphasis")?"*":"_"}return[i,$(e,r,t),i]}case"strong":return["**",$(e,r,t),"**"];case"delete":return["~~",$(e,r,t),"~~"];case"inlineCode":{let i=r.proseWrap==="preserve"?n.value:N(!1,n.value,` +`," "),o=Zn(i,"`"),s="`".repeat(o||1),l=i.startsWith("`")||i.endsWith("`")||/^[\n ]/u.test(i)&&/[\n ]$/u.test(i)&&/[^\n ]/u.test(i)?" ":"";return[s,l,i,l,s]}case"wikiLink":{let i="";return r.proseWrap==="preserve"?i=n.value:i=N(!1,n.value,/[\t\n]+/gu," "),["[[",i,"]]"]}case"link":switch(r.originalText[n.position.start.offset]){case"<":{let i="mailto:";return["<",n.url.startsWith(i)&&r.originalText.slice(n.position.start.offset+1,n.position.start.offset+1+i.length)!==i?n.url.slice(i.length):n.url,">"]}case"[":return["[",$(e,r,t),"](",Bt(n.url,")"),Rr(n.title,r),")"];default:return r.originalText.slice(n.position.start.offset,n.position.end.offset)}case"image":return["![",n.alt||"","](",Bt(n.url,")"),Rr(n.title,r),")"];case"blockquote":return["> ",ye("> ",$(e,r,t))];case"heading":return["#".repeat(n.depth)+" ",$(e,r,t)];case"code":{if(n.isIndented){let s=" ".repeat(4);return ye(s,[s,be(n.value,P)])}let i=r.__inJsTemplate?"~":"`",o=i.repeat(Math.max(3,Sr(n.value,i)+1));return[o,n.lang||"",n.meta?" "+n.meta:"",P,be(Ir(n,r.originalText),P),P,o]}case"html":{let{parent:i,isLast:o}=e,s=i.type==="root"&&o?n.value.trimEnd():n.value,l=/^$/su.test(s);return be(s,l?P:_e(tr))}case"list":{let i=Li(n,e.parent),o=hi(n,r);return $(e,r,t,{processor(s){let l=f(),c=s.node;if(c.children.length===2&&c.children[1].type==="html"&&c.children[0].position.start.column!==c.children[1].position.start.column)return[l,Oi(s,r,t,l)];return[l,ye(" ".repeat(l.length),Oi(s,r,t,l))];function f(){let p=n.ordered?(s.isFirst?n.start:o?1:n.start+s.index)+(i%2===0?". ":") "):i%2===0?"- ":"* ";return(n.isAligned||n.hasIndentedCodeblock)&&n.ordered?ff(p,r):p}}})}case"thematicBreak":{let{ancestors:i}=e,o=i.findIndex(l=>l.type==="list");return o===-1?"---":Li(i[o],i[o+1])%2===0?"***":"---"}case"linkReference":return["[",$(e,r,t),"]",n.referenceType==="full"?Tt(n):n.referenceType==="collapsed"?"[]":""];case"imageReference":switch(n.referenceType){case"full":return["![",n.alt||"","]",Tt(n)];default:return["![",n.alt,"]",n.referenceType==="collapsed"?"[]":""]}case"definition":{let i=r.proseWrap==="always"?qr:" ";return Me([Tt(n),":",nr([i,Bt(n.url),n.title===null?"":[i,Rr(n.title,r,!1)]])])}case"footnote":return["[^",$(e,r,t),"]"];case"footnoteReference":return Ri(n);case"footnoteDefinition":{let i=n.children.length===1&&n.children[0].type==="paragraph"&&(r.proseWrap==="never"||r.proseWrap==="preserve"&&n.children[0].position.start.line===n.children[0].position.end.line);return[Ri(n),": ",i?$(e,r,t):Me([ye(" ".repeat(4),$(e,r,t,{processor:({isFirst:o})=>o?Me([_r,t()]):t()}))])]}case"table":return xi(e,r,t);case"tableCell":return $(e,r,t);case"break":return/\s/u.test(r.originalText[n.position.start.offset])?[" ",_e(tr)]:["\\",P];case"liquidNode":return be(n.value,P);case"import":case"export":case"jsx":return n.value;case"esComment":return["{/* ",n.value," */}"];case"math":return["$$",P,n.value?[be(n.value,P),P]:"","$$"];case"inlineMath":return r.originalText.slice(Oe(n),Le(n));case"tableRow":case"listItem":case"text":default:throw new ti(n,"Markdown")}}function Oi(e,r,t,n){let{node:a}=e,u=a.checked===null?"":a.checked?"[x] ":"[ ] ";return[u,$(e,r,t,{processor({node:i,isFirst:o}){if(o&&i.type!=="list")return ye(" ".repeat(u.length),t());let s=" ".repeat(gf(r.tabWidth-n.length,0,3));return[s,ye(s,t())]}})]}function ff(e,r){let t=n();return e+" ".repeat(t>=4?0:t);function n(){let a=e.length%r.tabWidth;return a===0?0:r.tabWidth-a}}function Li(e,r){return Df(e,r,t=>t.ordered===e.ordered)}function Df(e,r,t){let n=-1;for(let a of r.children)if(a.type===e.type&&t(a)?n++:n=-1,a===e)return n}function pf(e,r,t){let n=[],a=null,{children:u}=e.node;for(let[i,o]of u.entries())switch(qt(o)){case"start":a===null&&(a={index:i,offset:o.position.end.offset});break;case"end":a!==null&&(n.push({start:a,end:{index:i,offset:o.position.start.offset}}),a=null);break;default:break}return $(e,r,t,{processor({index:i}){if(n.length>0){let o=n[0];if(i===o.start.index)return[Pi(u[o.start.index]),r.originalText.slice(o.start.offset,o.end.offset),Pi(u[o.end.index])];if(o.start.index{let i=a(e);i!==!1&&(u.length>0&&hf(e)&&(u.push(P),(df(e,r)||Ni(e))&&u.push(P),Ni(e)&&u.push(P)),u.push(i))},"children"),u}function Pi(e){if(e.type==="html")return e.value;if(e.type==="paragraph"&&Array.isArray(e.children)&&e.children.length===1&&e.children[0].type==="esComment")return["{/* ",e.children[0].value," */}"]}function qt(e){let r;if(e.type==="html")r=e.value.match(/^$/u);else{let t;e.type==="esComment"?t=e:e.type==="paragraph"&&e.children.length===1&&e.children[0].type==="esComment"&&(t=e.children[0]),t&&(r=t.value.match(/^prettier-ignore(?:-(start|end))?$/u))}return r?r[1]||"next":!1}function hf({node:e,parent:r}){let t=vt.has(e.type),n=e.type==="html"&&Lr.has(r.type);return!t&&!n}function Ii(e,r){return e.type==="listItem"&&(e.spread||r.originalText.charAt(e.position.end.offset-1)===` +`)}function df({node:e,previous:r,parent:t},n){if(Ii(r,n))return!0;let i=r.type===e.type&&cf.has(e.type),o=t.type==="listItem"&&!Ii(t,n),s=qt(r)==="next",l=e.type==="html"&&r.type==="html"&&r.position.end.line+1===e.position.start.line,c=e.type==="html"&&t.type==="listItem"&&r.type==="paragraph"&&r.position.end.line+1===e.position.start.line;return!(i||o||s||l||c)}function Ni({node:e,previous:r}){let t=r.type==="list",n=e.type==="code"&&e.isIndented;return t&&n}function mf(e){let r=e.findAncestor(t=>t.type==="linkReference"||t.type==="imageReference");return r&&(r.type!=="linkReference"||r.referenceType!=="full")}var Ff=(e,r)=>{for(let t of r)e=N(!1,e,t,encodeURIComponent(t));return e};function Bt(e,r=[]){let t=[" ",...Array.isArray(r)?r:[r]];return new RegExp(t.map(n=>le(n)).join("|"),"u").test(e)?`<${Ff(e,"<>")}>`:e}function Rr(e,r,t=!0){if(!e)return"";if(t)return" "+Rr(e,r,!1);if(e=N(!1,e,/\\(?=["')])/gu,""),e.includes('"')&&e.includes("'")&&!e.includes(")"))return`(${e})`;let n=ri(e,r.singleQuote);return e=N(!1,e,"\\","\\\\"),e=N(!1,e,n,`\\${n}`),`${n}${e}${n}`}function gf(e,r,t){return Math.max(r,Math.min(e,t))}function vf(e){return e.index>0&&qt(e.previous)==="next"}function Tt(e){return`[${(0,Ui.default)(e.label)}]`}function Ri(e){return`[^${e.label}]`}var Ef={preprocess:Ti,print:lf,embed:di,massageAstNode:ci,hasPrettierIgnore:vf,insertPragma:ai,getVisitorKeys:gi},Mi=Ef;var zi=[{linguistLanguageId:222,name:"Markdown",type:"prose",color:"#083fa1",aliases:["md","pandoc"],aceMode:"markdown",codemirrorMode:"gfm",codemirrorMimeType:"text/x-gfm",wrap:!0,extensions:[".md",".livemd",".markdown",".mdown",".mdwn",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr","README"],tmScope:"text.md",parsers:["markdown"],vscodeLanguageIds:["markdown"]},{linguistLanguageId:222,name:"MDX",type:"prose",color:"#083fa1",aliases:["md","pandoc"],aceMode:"markdown",codemirrorMode:"gfm",codemirrorMimeType:"text/x-gfm",wrap:!0,extensions:[".mdx"],filenames:[],tmScope:"text.md",parsers:["mdx"],vscodeLanguageIds:["mdx"]}];var _t={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var Cf={proseWrap:_t.proseWrap,singleQuote:_t.singleQuote},Yi=Cf;var Mn={};Gn(Mn,{markdown:()=>Nm,mdx:()=>Rm,remark:()=>Nm});var il=Ue(Vi(),1),ul=Ue(iu(),1),al=Ue(Zs(),1),ol=Ue($c(),1);var Tm=/^import\s/u,qm=/^export\s/u,Wc=String.raw`[a-z][a-z0-9]*(\.[a-z][a-z0-9]*)*|`,Hc=/|/u,_m=/^\{\s*\/\*(.*)\*\/\s*\}/u,Sm=` + +`,Kc=e=>Tm.test(e),Un=e=>qm.test(e),Jc=(e,r)=>{let t=r.indexOf(Sm),n=r.slice(0,t);if(Un(n)||Kc(n))return e(n)({type:Un(n)?"export":"import",value:n})},Xc=(e,r)=>{let t=_m.exec(r);if(t)return e(t[0])({type:"esComment",value:t[1].trim()})};Jc.locator=e=>Un(e)||Kc(e)?-1:1;Xc.locator=(e,r)=>e.indexOf("{",r);var Qc=function(){let{Parser:e}=this,{blockTokenizers:r,blockMethods:t,inlineTokenizers:n,inlineMethods:a}=e.prototype;r.esSyntax=Jc,n.esComment=Xc,t.splice(t.indexOf("paragraph"),0,"esSyntax"),a.splice(a.indexOf("text"),0,"esComment")};var Om=function(){let e=this.Parser.prototype;e.blockMethods=["frontMatter",...e.blockMethods],e.blockTokenizers.frontMatter=r;function r(t,n){let a=or(n);if(a.frontMatter)return t(a.frontMatter.raw)(a.frontMatter)}r.onlyAtStart=!0},Zc=Om;function Lm(){return e=>Ae(e,(r,t,[n])=>r.type!=="html"||Hc.test(r.value)||Lr.has(n.type)?r:{...r,type:"jsx"})}var el=Lm;var Pm=function(){let e=this.Parser.prototype,r=e.inlineMethods;r.splice(r.indexOf("text"),0,"liquid"),e.inlineTokenizers.liquid=t;function t(n,a){let u=a.match(/^(\{%.*?%\}|\{\{.*?\}\})/su);if(u)return n(u[0])({type:"liquidNode",value:u[0]})}t.locator=function(n,a){return n.indexOf("{",a)}},rl=Pm;var Im=function(){let e="wikiLink",r=/^\[\[(?.+?)\]\]/su,t=this.Parser.prototype,n=t.inlineMethods;n.splice(n.indexOf("link"),0,e),t.inlineTokenizers.wikiLink=a;function a(u,i){let o=r.exec(i);if(o){let s=o.groups.linkContents.trim();return u(o[0])({type:e,value:s})}}a.locator=function(u,i){return u.indexOf("[",i)}},tl=Im;function sl({isMDX:e}){return r=>{let t=(0,ol.default)().use(al.default,{commonmark:!0,...e&&{blocks:[Wc]}}).use(il.default).use(Zc).use(ul.default).use(e?Qc:nl).use(rl).use(e?el:nl).use(tl);return t.run(t.parse(r))}}function nl(){}var cl={astFormat:"mdast",hasPragma:ui,locStart:Oe,locEnd:Le},Nm={...cl,parse:sl({isMDX:!1})},Rm={...cl,parse:sl({isMDX:!0})};var Um={mdast:Mi};var OC=zn;export{OC as default,zi as languages,Yi as options,Mn as parsers,Um as printers}; diff --git a/node_modules/prettier/plugins/meriyah.js b/node_modules/prettier/plugins/meriyah.js new file mode 100644 index 0000000..203a56a --- /dev/null +++ b/node_modules/prettier/plugins/meriyah.js @@ -0,0 +1,4 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.meriyah=e()}})(function(){"use strict";var x2=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Oe=Object.prototype.hasOwnProperty;var In=(n,e)=>{for(var u in e)x2(n,u,{get:e[u],enumerable:!0})},Re=(n,e,u,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ve(e))!Oe.call(n,o)&&o!==u&&x2(n,o,{get:()=>e[o],enumerable:!(t=Ne(e,o))||t.enumerable});return n};var Ue=n=>Re(x2({},"__esModule",{value:!0}),n);var Q1={};In(Q1,{parsers:()=>Bn});var Bn={};In(Bn,{meriyah:()=>Y1});var Me=(n,e,u,t)=>{if(!(n&&e==null))return e.replaceAll?e.replaceAll(u,t):u.global?e.replace(u,t):e.split(u).join(t)},i2=Me;var Je={0:"Unexpected token",30:"Unexpected token: '%0'",1:"Octal escape sequences are not allowed in strict mode",2:"Octal escape sequences are not allowed in template strings",3:"\\8 and \\9 are not allowed in template strings",4:"Private identifier #%0 is not defined",5:"Illegal Unicode escape sequence",6:"Invalid code point %0",7:"Invalid hexadecimal escape sequence",9:"Octal literals are not allowed in strict mode",8:"Decimal integer literals with a leading zero are forbidden in strict mode",10:"Expected number in radix %0",151:"Invalid left-hand side assignment to a destructible right-hand side",11:"Non-number found after exponent indicator",12:"Invalid BigIntLiteral",13:"No identifiers allowed directly after numeric literal",14:"Escapes \\8 or \\9 are not syntactically valid escapes",15:"Escapes \\8 or \\9 are not allowed in strict mode",16:"Unterminated string literal",17:"Unterminated template literal",18:"Multiline comment was not closed properly",19:"The identifier contained dynamic unicode escape that was not closed",20:"Illegal character '%0'",21:"Missing hexadecimal digits",22:"Invalid implicit octal",23:"Invalid line break in string literal",24:"Only unicode escapes are legal in identifier names",25:"Expected '%0'",26:"Invalid left-hand side in assignment",27:"Invalid left-hand side in async arrow",28:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',29:"Member access on super must be in a method",31:"Await expression not allowed in formal parameter",32:"Yield expression not allowed in formal parameter",95:"Unexpected token: 'escaped keyword'",33:"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses",123:"Async functions can only be declared at the top level or inside a block",34:"Unterminated regular expression",35:"Unexpected regular expression flag",36:"Duplicate regular expression flag '%0'",37:"%0 functions must have exactly %1 argument%2",38:"Setter function argument must not be a rest parameter",39:"%0 declaration must have a name in this context",40:"Function name may not contain any reserved words or be eval or arguments in strict mode",41:"The rest operator is missing an argument",42:"A getter cannot be a generator",43:"A setter cannot be a generator",44:"A computed property name must be followed by a colon or paren",134:"Object literal keys that are strings or numbers must be a method or have a colon",46:"Found `* async x(){}` but this should be `async * x(){}`",45:"Getters and setters can not be generators",47:"'%0' can not be generator method",48:"No line break is allowed after '=>'",49:"The left-hand side of the arrow can only be destructed through assignment",50:"The binding declaration is not destructible",51:"Async arrow can not be followed by new expression",52:"Classes may not have a static property named 'prototype'",53:"Class constructor may not be a %0",54:"Duplicate constructor method in class",55:"Invalid increment/decrement operand",56:"Invalid use of `new` keyword on an increment/decrement expression",57:"`=>` is an invalid assignment target",58:"Rest element may not have a trailing comma",59:"Missing initializer in %0 declaration",60:"'for-%0' loop head declarations can not have an initializer",61:"Invalid left-hand side in for-%0 loop: Must have a single binding",62:"Invalid shorthand property initializer",63:"Property name __proto__ appears more than once in object literal",64:"Let is disallowed as a lexically bound name",65:"Invalid use of '%0' inside new expression",66:"Illegal 'use strict' directive in function with non-simple parameter list",67:'Identifier "let" disallowed as left-hand side expression in strict mode',68:"Illegal continue statement",69:"Illegal break statement",70:"Cannot have `let[...]` as a var name in strict mode",71:"Invalid destructuring assignment target",72:"Rest parameter may not have a default initializer",73:"The rest argument must the be last parameter",74:"Invalid rest argument",76:"In strict mode code, functions can only be declared at top level or inside a block",77:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement",78:"Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement",79:"Class declaration can't appear in single-statement context",80:"Invalid left-hand side in for-%0",81:"Invalid assignment in for-%0",82:"for await (... of ...) is only valid in async functions and async generators",83:"The first token after the template expression should be a continuation of the template",85:"`let` declaration not allowed here and `let` cannot be a regular var name in strict mode",84:"`let \n [` is a restricted production at the start of a statement",86:"Catch clause requires exactly one parameter, not more (and no trailing comma)",87:"Catch clause parameter does not support default values",88:"Missing catch or finally after try",89:"More than one default clause in switch statement",90:"Illegal newline after throw",91:"Strict mode code may not include a with statement",92:"Illegal return statement",93:"The left hand side of the for-header binding declaration is not destructible",94:"new.target only allowed within functions or static blocks",96:"'#' not followed by identifier",102:"Invalid keyword",101:"Can not use 'let' as a class name",100:"'A lexical declaration can't define a 'let' binding",99:"Can not use `let` as variable name in strict mode",97:"'%0' may not be used as an identifier in this context",98:"Await is only valid in async functions",103:"The %0 keyword can only be used with the module goal",104:"Unicode codepoint must not be greater than 0x10FFFF",105:"%0 source must be string",106:"Only a identifier or string can be used to indicate alias",107:"Only '*' or '{...}' can be imported after default",108:"Trailing decorator may be followed by method",109:"Decorators can't be used with a constructor",110:"Can not use `await` as identifier in module or async func",111:"Can not use `await` as identifier in module",112:"HTML comments are only allowed with web compatibility (Annex B)",113:"The identifier 'let' must not be in expression position in strict mode",114:"Cannot assign to `eval` and `arguments` in strict mode",115:"The left-hand side of a for-of loop may not start with 'let'",116:"Block body arrows can not be immediately invoked without a group",117:"Block body arrows can not be immediately accessed without a group",118:"Unexpected strict mode reserved word",119:"Unexpected eval or arguments in strict mode",120:"Decorators must not be followed by a semicolon",121:"Calling delete on expression not allowed in strict mode",122:"Pattern can not have a tail",124:"Can not have a `yield` expression on the left side of a ternary",125:"An arrow function can not have a postfix update operator",126:"Invalid object literal key character after generator star",127:"Private fields can not be deleted",129:"Classes may not have a field called constructor",128:"Classes may not have a private element named constructor",130:"A class field initializer or static block may not contain arguments",131:"Generators can only be declared at the top level or inside a block",132:"Async methods are a restricted production and cannot have a newline following it",133:"Unexpected character after object literal property name",135:"Invalid key token",136:"Label '%0' has already been declared",137:"continue statement must be nested within an iteration statement",138:"Undefined label '%0'",139:"Trailing comma is disallowed inside import(...) arguments",140:"Invalid binding in JSON import",141:"import() requires exactly one argument",142:"Cannot use new with import(...)",143:"... is not allowed in import()",144:"Expected '=>'",145:"Duplicate binding '%0'",146:"Duplicate private identifier #%0",147:"Cannot export a duplicate name '%0'",150:"Duplicate %0 for-binding",148:"Exported binding '%0' needs to refer to a top-level declared variable",149:"Unexpected private field",153:"Numeric separators are not allowed at the end of numeric literals",152:"Only one underscore is allowed as numeric separator",154:"JSX value should be either an expression or a quoted JSX text",155:"Expected corresponding JSX closing tag for %0",156:"Adjacent JSX elements must be wrapped in an enclosing tag",157:"JSX attributes must only be assigned a non-empty 'expression'",158:"'%0' has already been declared",159:"'%0' shadowed a catch clause binding",160:"Dot property must be an identifier",161:"Encountered invalid input after spread/rest argument",162:"Catch without try",163:"Finally without try",164:"Expected corresponding closing tag for JSX fragment",165:"Coalescing and logical operators used together in the same expression must be disambiguated with parentheses",166:"Invalid tagged template on optional chain",167:"Invalid optional chain from super property",168:"Invalid optional chain from new expression",169:'Cannot use "import.meta" outside a module',170:"Leading decorators must be attached to a class declaration",171:"An export name cannot include a lone surrogate, found %0",172:"A string literal cannot be used as an exported binding without `from`",173:"Private fields can't be accessed on super",174:"The only valid meta property for import is 'import.meta'",175:"'import.meta' must not contain escaped characters",176:'cannot use "await" as identifier inside an async function',177:'cannot use "await" in static blocks'},m2=class extends SyntaxError{constructor(e,u,t,o,i,l,f,...d){let g="["+u+":"+t+"-"+i+":"+l+"]: "+Je[f].replace(/%(\d+)/g,(m,y)=>d[y]);super(`${g}`),this.start=e,this.end=o,this.range=[e,o],this.loc={start:{line:u,column:t},end:{line:i,column:l}},this.description=g}};function c(n,e,...u){throw new m2(n.tokenIndex,n.tokenLine,n.tokenColumn,n.index,n.line,n.column,e,...u)}function z2(n){throw new m2(n.tokenIndex,n.tokenLine,n.tokenColumn,n.index,n.line,n.column,n.type,...n.params)}function $(n,e,u,t,o,i,l,...f){throw new m2(n,e,u,t,o,i,l,...f)}function h2(n,e,u,t,o,i,l){throw new m2(n,e,u,t,o,i,l)}function je(n){return(On[(n>>>5)+0]>>>n&31&1)!==0}function Vn(n){return(On[(n>>>5)+34816]>>>n&31&1)!==0}var On=((n,e)=>{let u=new Uint32Array(104448),t=0,o=0;for(;t<3822;){let i=n[t++];if(i<0)o-=i;else{let l=n[t++];i&2&&(l=e[l]),i&1?u.fill(l,o,o+=n[t++]):u[o++]=l}}return u})([-1,2,26,2,27,2,5,-1,0,77595648,3,44,2,3,0,14,2,63,2,64,3,0,3,0,3168796671,0,4294956992,2,1,2,0,2,41,3,0,4,0,4294966523,3,0,4,2,16,2,65,2,0,0,4294836735,0,3221225471,0,4294901942,2,66,0,134152192,3,0,2,0,4294951935,3,0,2,0,2683305983,0,2684354047,2,18,2,0,0,4294961151,3,0,2,2,19,2,0,0,608174079,2,0,2,60,2,7,2,6,0,4286611199,3,0,2,2,1,3,0,3,0,4294901711,2,40,0,4089839103,0,2961209759,0,1342439375,0,4294543342,0,3547201023,0,1577204103,0,4194240,0,4294688750,2,2,0,80831,0,4261478351,0,4294549486,2,2,0,2967484831,0,196559,0,3594373100,0,3288319768,0,8469959,2,203,2,3,0,4093640191,0,660618719,0,65487,0,4294828015,0,4092591615,0,1616920031,0,982991,2,3,2,0,0,2163244511,0,4227923919,0,4236247022,2,71,0,4284449919,0,851904,2,4,2,12,0,67076095,-1,2,72,0,1073741743,0,4093607775,-1,0,50331649,0,3265266687,2,33,0,4294844415,0,4278190047,2,20,2,137,-1,3,0,2,2,23,2,0,2,10,2,0,2,15,2,22,3,0,10,2,74,2,0,2,75,2,76,2,77,2,0,2,78,2,0,2,11,0,261632,2,25,3,0,2,2,13,2,4,3,0,18,2,79,2,5,3,0,2,2,80,0,2151677951,2,29,2,9,0,909311,3,0,2,0,814743551,2,49,0,67090432,3,0,2,2,42,2,0,2,6,2,0,2,30,2,8,0,268374015,2,110,2,51,2,0,2,81,0,134153215,-1,2,7,2,0,2,8,0,2684354559,0,67044351,0,3221160064,2,17,-1,3,0,2,2,53,0,1046528,3,0,3,2,9,2,0,2,54,0,4294960127,2,10,2,6,2,11,0,4294377472,2,12,3,0,16,2,13,2,0,2,82,2,10,2,0,2,83,2,84,2,85,2,210,2,55,0,1048577,2,86,2,14,-1,2,14,0,131042,2,87,2,88,2,89,2,0,2,34,-83,3,0,7,0,1046559,2,0,2,15,2,0,0,2147516671,2,21,3,90,2,2,0,-16,2,91,0,524222462,2,4,2,0,0,4269801471,2,4,3,0,2,2,28,2,16,3,0,2,2,17,2,0,-1,2,18,-16,3,0,206,-2,3,0,692,2,73,-1,2,18,2,10,3,0,8,2,93,2,133,2,0,0,3220242431,3,0,3,2,19,2,94,2,95,3,0,2,2,96,2,0,2,97,2,46,2,0,0,4351,2,0,2,9,3,0,2,0,67043391,0,3909091327,2,0,2,24,2,9,2,20,3,0,2,0,67076097,2,8,2,0,2,21,0,67059711,0,4236247039,3,0,2,0,939524103,0,8191999,2,101,2,102,2,22,2,23,3,0,3,0,67057663,3,0,349,2,103,2,104,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,3774349439,2,105,2,106,3,0,2,2,19,2,107,3,0,10,2,10,2,18,2,0,2,47,2,0,2,31,2,108,2,25,0,1638399,2,183,2,109,3,0,3,2,20,2,26,2,27,2,5,2,28,2,0,2,8,2,111,-1,2,112,2,113,2,114,-1,3,0,3,2,12,-2,2,0,2,29,-3,2,163,-4,2,20,2,0,2,36,0,1,2,0,2,67,2,6,2,12,2,10,2,0,2,115,-1,3,0,4,2,10,2,23,2,116,2,7,2,0,2,117,2,0,2,118,2,119,2,120,2,0,2,9,3,0,9,2,21,2,30,2,31,2,121,2,122,-2,2,123,2,124,2,30,2,21,2,8,-2,2,125,2,30,2,32,-2,2,0,2,39,-2,0,4277137519,0,2269118463,-1,3,20,2,-1,2,33,2,38,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,48,2,0,0,4294950463,2,37,-7,2,0,0,203775,2,57,2,167,2,20,2,43,2,36,2,18,2,37,2,18,2,126,2,21,3,0,2,2,38,0,2151677888,2,0,2,12,0,4294901764,2,144,2,0,2,58,2,56,0,5242879,3,0,2,0,402644511,-1,2,128,2,39,0,3,-1,2,129,2,130,2,0,0,67045375,2,40,0,4226678271,0,3766565279,0,2039759,2,132,2,41,0,1046437,0,6,3,0,2,0,3288270847,0,3,3,0,2,0,67043519,-5,2,0,0,4282384383,0,1056964609,-1,3,0,2,0,67043345,-1,2,0,2,42,2,23,2,50,2,11,2,61,2,38,-5,2,0,2,12,-3,3,0,2,0,2147484671,2,134,0,4190109695,2,52,-2,2,135,0,4244635647,0,27,2,0,2,8,2,43,2,0,2,68,2,18,2,0,2,42,-6,2,0,2,45,2,59,2,44,2,45,2,46,2,47,0,8388351,-2,2,136,0,3028287487,2,48,2,138,0,33259519,2,49,-9,2,21,0,4294836223,0,3355443199,0,134152199,-2,2,69,-2,3,0,28,2,32,-3,3,0,3,2,17,3,0,6,2,50,-81,2,18,3,0,2,2,36,3,0,33,2,25,2,30,3,0,124,2,12,3,0,18,2,38,-213,2,0,2,32,-54,3,0,17,2,42,2,8,2,23,2,0,2,8,2,23,2,51,2,0,2,21,2,52,2,139,2,25,-13,2,0,2,53,-6,3,0,2,-4,3,0,2,0,4294936575,2,0,0,4294934783,-2,0,196635,3,0,191,2,54,3,0,38,2,30,2,55,2,34,-278,2,140,3,0,9,2,141,2,142,2,56,3,0,11,2,7,-72,3,0,3,2,143,0,1677656575,-130,2,26,-16,2,0,2,24,2,38,-16,0,4161266656,0,4071,2,205,-4,2,57,-13,3,0,2,2,58,2,0,2,145,2,146,2,62,2,0,2,147,2,148,2,149,3,0,10,2,150,2,151,2,22,3,58,2,3,152,2,3,59,2,0,4294954999,2,0,-16,2,0,2,92,2,0,0,2105343,0,4160749584,2,177,-34,2,8,2,154,-6,0,4194303871,0,4294903771,2,0,2,60,2,100,-3,2,0,0,1073684479,0,17407,-9,2,18,2,17,2,0,2,32,-14,2,18,2,32,-6,2,18,2,12,-15,2,155,3,0,6,0,8323103,-1,3,0,2,2,61,-37,2,62,2,156,2,157,2,158,2,159,2,160,-105,2,26,-32,3,0,1335,-1,3,0,129,2,32,3,0,6,2,10,3,0,180,2,161,3,0,233,2,162,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,130,2,25,-22250,3,0,7,2,25,-6130,3,5,2,-1,0,69207040,3,44,2,3,0,14,2,63,2,64,-3,0,3168731136,0,4294956864,2,1,2,0,2,41,3,0,4,0,4294966275,3,0,4,2,16,2,65,2,0,2,34,-1,2,18,2,66,-1,2,0,0,2047,0,4294885376,3,0,2,0,3145727,0,2617294944,0,4294770688,2,25,2,67,3,0,2,0,131135,2,98,0,70256639,0,71303167,0,272,2,42,2,6,0,32511,2,0,2,49,-1,2,99,2,68,0,4278255616,0,4294836227,0,4294549473,0,600178175,0,2952806400,0,268632067,0,4294543328,0,57540095,0,1577058304,0,1835008,0,4294688736,2,70,2,69,0,33554435,2,131,2,70,2,164,0,131075,0,3594373096,0,67094296,2,69,-1,0,4294828e3,0,603979263,0,654311424,0,3,0,4294828001,0,602930687,2,171,0,393219,0,4294828016,0,671088639,0,2154840064,0,4227858435,0,4236247008,2,71,2,38,-1,2,4,0,917503,2,38,-1,2,72,0,537788335,0,4026531935,-1,0,1,-1,2,33,2,73,0,7936,-3,2,0,0,2147485695,0,1010761728,0,4292984930,0,16387,2,0,2,15,2,22,3,0,10,2,74,2,0,2,75,2,76,2,77,2,0,2,78,2,0,2,12,-1,2,25,3,0,2,2,13,2,4,3,0,18,2,79,2,5,3,0,2,2,80,0,2147745791,3,19,2,0,122879,2,0,2,9,0,276824064,-2,3,0,2,2,42,2,0,0,4294903295,2,0,2,30,2,8,-1,2,18,2,51,2,0,2,81,2,49,-1,2,21,2,0,2,29,-2,0,128,-2,2,28,2,9,0,8160,-1,2,127,0,4227907585,2,0,2,37,2,0,2,50,2,184,2,10,2,6,2,11,-1,0,74440192,3,0,6,-2,3,0,8,2,13,2,0,2,82,2,10,2,0,2,83,2,84,2,85,-3,2,86,2,14,-3,2,87,2,88,2,89,2,0,2,34,-83,3,0,7,0,817183,2,0,2,15,2,0,0,33023,2,21,3,90,2,-17,2,91,0,524157950,2,4,2,0,2,92,2,4,2,0,2,22,2,28,2,16,3,0,2,2,17,2,0,-1,2,18,-16,3,0,206,-2,3,0,692,2,73,-1,2,18,2,10,3,0,8,2,93,0,3072,2,0,0,2147516415,2,10,3,0,2,2,25,2,94,2,95,3,0,2,2,96,2,0,2,97,2,46,0,4294965179,0,7,2,0,2,9,2,95,2,9,-1,0,1761345536,2,98,0,4294901823,2,38,2,20,2,99,2,35,2,100,0,2080440287,2,0,2,34,2,153,0,3296722943,2,0,0,1046675455,0,939524101,0,1837055,2,101,2,102,2,22,2,23,3,0,3,0,7,3,0,349,2,103,2,104,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,2700607615,2,105,2,106,3,0,2,2,19,2,107,3,0,10,2,10,2,18,2,0,2,47,2,0,2,31,2,108,-3,2,109,3,0,3,2,20,-1,3,5,2,2,110,2,0,2,8,2,111,-1,2,112,2,113,2,114,-1,3,0,3,2,12,-2,2,0,2,29,-8,2,20,2,0,2,36,-1,2,0,2,67,2,6,2,30,2,10,2,0,2,115,-1,3,0,4,2,10,2,18,2,116,2,7,2,0,2,117,2,0,2,118,2,119,2,120,2,0,2,9,3,0,9,2,21,2,30,2,31,2,121,2,122,-2,2,123,2,124,2,30,2,21,2,8,-2,2,125,2,30,2,32,-2,2,0,2,39,-2,0,4277075969,2,30,-1,3,20,2,-1,2,33,2,126,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,50,2,98,0,4294934591,2,37,-7,2,0,0,197631,2,57,-1,2,20,2,43,2,37,2,18,0,3,2,18,2,126,2,21,2,127,2,54,-1,0,2490368,2,127,2,25,2,18,2,34,2,127,2,38,0,4294901904,0,4718591,2,127,2,35,0,335544350,-1,2,128,0,2147487743,0,1,-1,2,129,2,130,2,8,-1,2,131,2,70,0,3758161920,0,3,2,132,0,12582911,0,655360,-1,2,0,2,29,0,2147485568,0,3,2,0,2,25,0,176,-5,2,0,2,17,2,192,-1,2,0,2,25,2,209,-1,2,0,0,16779263,-2,2,12,-1,2,38,-5,2,0,2,133,-3,3,0,2,2,55,2,134,0,2147549183,0,2,-2,2,135,2,36,0,10,0,4294965249,0,67633151,0,4026597376,2,0,0,536871935,2,18,2,0,2,42,-6,2,0,0,1,2,59,2,17,0,1,2,46,2,25,-3,2,136,2,36,2,137,2,138,0,16778239,-10,2,35,0,4294836212,2,9,-3,2,69,-2,3,0,28,2,32,-3,3,0,3,2,17,3,0,6,2,50,-81,2,18,3,0,2,2,36,3,0,33,2,25,0,126,3,0,124,2,12,3,0,18,2,38,-213,2,10,-55,3,0,17,2,42,2,8,2,18,2,0,2,8,2,18,2,60,2,0,2,25,2,50,2,139,2,25,-13,2,0,2,73,-6,3,0,2,-4,3,0,2,0,67583,-1,2,107,-2,0,11,3,0,191,2,54,3,0,38,2,30,2,55,2,34,-278,2,140,3,0,9,2,141,2,142,2,56,3,0,11,2,7,-72,3,0,3,2,143,2,144,-187,3,0,2,2,58,2,0,2,145,2,146,2,62,2,0,2,147,2,148,2,149,3,0,10,2,150,2,151,2,22,3,58,2,3,152,2,3,59,2,2,153,-57,2,8,2,154,-7,2,18,2,0,2,60,-4,2,0,0,1065361407,0,16384,-9,2,18,2,60,2,0,2,133,-14,2,18,2,133,-6,2,18,0,81919,-15,2,155,3,0,6,2,126,-1,3,0,2,0,2063,-37,2,62,2,156,2,157,2,158,2,159,2,160,-138,3,0,1335,-1,3,0,129,2,32,3,0,6,2,10,3,0,180,2,161,3,0,233,2,162,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,130,2,25,-28386,2,0,0,1,-1,2,55,2,0,0,8193,-21,2,201,0,10255,0,4,-11,2,69,2,182,-1,0,71680,-1,2,174,0,4292900864,0,268435519,-5,2,163,-1,2,173,-1,0,6144,-2,2,46,-1,2,168,-1,0,2147532800,2,164,2,170,0,8355840,-2,0,4,-4,2,198,0,205128192,0,1333757536,0,2147483696,0,423953,0,747766272,0,2717763192,0,4286578751,0,278545,2,165,0,4294886464,0,33292336,0,417809,2,165,0,1327482464,0,4278190128,0,700594195,0,1006647527,0,4286497336,0,4160749631,2,166,0,201327104,0,3634348576,0,8323120,2,166,0,202375680,0,2678047264,0,4293984304,2,166,-1,0,983584,0,48,0,58720273,0,3489923072,0,10517376,0,4293066815,0,1,2,213,2,167,2,0,0,2089,0,3221225552,0,201359520,2,0,-2,0,256,0,122880,0,16777216,2,163,0,4160757760,2,0,-6,2,179,-11,0,3263218176,-1,0,49664,0,2160197632,0,8388802,-1,0,12713984,-1,2,168,2,186,2,187,-2,2,175,-20,0,3758096385,-2,2,169,2,195,2,94,2,180,0,4294057984,-2,2,176,2,172,0,4227874816,-2,2,169,-1,2,170,-1,2,181,2,55,0,4026593280,0,14,0,4292919296,-1,2,178,0,939588608,-1,0,805306368,-1,2,55,2,171,2,172,2,173,2,211,2,0,-2,0,8192,-4,0,267386880,-1,0,117440512,0,7168,-1,2,170,2,168,2,174,2,188,-16,2,175,-1,0,1426112704,2,176,-1,2,196,0,271581216,0,2149777408,2,25,2,174,2,55,0,851967,2,189,-1,2,177,2,190,-4,2,178,-20,2,98,2,208,-56,0,3145728,2,191,-10,0,32505856,-1,2,179,-1,0,2147385088,2,94,1,2155905152,2,-3,2,176,2,0,0,67108864,-2,2,180,-6,2,181,2,25,0,1,-1,0,1,-1,2,182,-3,2,126,2,69,-2,2,100,-2,0,32704,2,55,-915,2,183,-1,2,207,-10,2,194,-5,2,185,-6,0,3759456256,2,19,-1,2,184,-1,2,185,-2,0,4227874752,-3,0,2146435072,2,186,-2,0,1006649344,2,55,-1,2,94,0,201375744,-3,0,134217720,2,94,0,4286677377,0,32896,-1,2,178,-3,0,4227907584,-349,0,65520,0,1920,2,167,3,0,264,-11,2,173,-2,2,187,2,0,0,520617856,0,2692743168,0,36,-3,0,524280,-13,2,193,-1,0,4294934272,2,25,2,187,-1,2,215,0,2158720,-3,2,186,0,1,-4,2,55,0,3808625411,0,3489628288,0,4096,0,1207959680,0,3221274624,2,0,-3,2,188,0,120,0,7340032,-2,2,189,2,4,2,25,2,176,3,0,4,2,186,-1,2,190,2,167,-1,0,8176,2,170,2,188,0,1073741824,-1,0,4290773232,2,0,-4,2,176,2,197,0,15728640,2,167,-1,2,174,-1,0,134250480,0,4720640,0,3825467396,-1,2,180,-9,2,94,2,181,0,4294967040,2,137,0,4160880640,3,0,2,0,704,0,1849688064,2,191,-1,2,55,0,4294901887,2,0,0,130547712,0,1879048192,2,212,3,0,2,-1,2,192,2,193,-1,0,17829776,0,2025848832,0,4261477888,-2,2,0,-1,0,4286580608,-1,0,29360128,2,200,0,16252928,0,3791388672,2,130,3,0,2,-2,2,206,2,0,-1,2,107,-1,0,66584576,-1,2,199,-1,0,448,0,4294918080,3,0,6,2,55,-1,0,4294755328,0,4294967267,2,7,-1,2,174,2,187,2,25,2,98,2,25,2,194,2,94,-2,0,245760,2,195,-1,2,163,2,202,0,4227923456,-1,2,196,2,174,2,94,-3,0,4292870145,0,262144,-1,2,95,2,0,0,1073758848,2,197,-1,0,4227921920,2,198,0,68289024,0,528402016,0,4292927536,0,46080,2,191,0,4265609306,0,4294967289,-2,0,268435456,2,95,-2,2,199,3,0,5,-1,2,200,2,176,2,0,-2,0,4227923936,2,67,-1,2,187,2,197,2,99,2,168,2,178,2,204,3,0,5,-1,2,167,3,0,3,-2,0,2146959360,0,9440640,0,104857600,0,4227923840,3,0,2,0,768,2,201,2,28,-2,2,174,-2,2,202,-1,2,169,2,98,3,0,5,-1,0,4227923964,0,512,0,8388608,2,203,2,183,2,193,0,4286578944,3,0,2,0,1152,0,1266679808,2,199,0,576,0,4261707776,2,98,3,0,9,2,169,0,131072,0,939524096,2,188,3,0,2,2,16,-1,0,2147221504,-28,2,187,3,0,3,-3,0,4292902912,-6,2,99,3,0,81,2,25,-2,2,107,-33,2,18,2,181,-124,2,188,-18,2,204,3,0,213,-1,2,187,3,0,54,-17,2,169,2,55,2,205,-1,2,55,2,197,0,4290822144,-2,0,67174336,0,520093700,2,18,3,0,13,-1,2,187,3,0,6,-2,2,188,3,0,3,-2,0,30720,-1,0,32512,3,0,2,0,4294770656,-191,2,185,-38,2,181,2,8,2,206,3,0,278,0,2417033215,-9,0,4294705144,0,4292411391,0,65295,-11,2,167,3,0,72,-3,0,3758159872,0,201391616,3,0,123,-7,2,187,-13,2,180,3,0,2,-1,2,173,2,207,-3,2,99,2,0,-7,2,181,-1,0,384,-1,0,133693440,-3,2,208,-2,2,110,3,0,3,3,180,2,-2,2,94,2,169,3,0,4,-2,2,196,-1,2,163,0,335552923,2,209,-1,0,538974272,0,2214592512,0,132e3,-10,0,192,-8,2,210,-21,0,134213632,2,162,3,0,34,2,55,0,4294965279,3,0,6,0,100663424,0,63524,-1,2,214,2,152,3,0,3,-1,0,3221282816,0,4294917120,3,0,9,2,25,2,211,-1,2,212,3,0,14,2,25,2,187,3,0,6,2,25,2,213,3,0,15,0,2147520640,-6,0,4286578784,2,0,-2,0,1006694400,3,0,24,2,36,-1,0,4292870144,3,0,2,0,1,2,176,3,0,6,2,209,0,4110942569,0,1432950139,0,2701658217,0,4026532864,0,4026532881,2,0,2,47,3,0,8,-1,2,178,-2,2,180,0,98304,0,65537,2,181,-5,2,214,2,0,2,37,2,202,2,167,0,4294770176,2,110,3,0,4,-30,2,192,0,3758153728,-3,0,125829120,-2,2,187,0,4294897664,2,178,-1,2,199,-1,2,174,0,4026580992,2,95,2,0,-10,2,180,0,3758145536,0,31744,-1,0,1610628992,0,4261477376,-4,2,215,-2,2,187,3,0,32,-1335,2,0,-129,2,187,-6,2,176,-180,0,65532,-233,2,177,-18,2,176,3,0,77,-16,2,176,3,0,47,-154,2,170,-130,2,18,3,0,22250,-7,2,18,3,0,6128],[4294967295,4294967291,4092460543,4294828031,4294967294,134217726,4294903807,268435455,2147483647,1048575,1073741823,3892314111,134217727,1061158911,536805376,4294910143,4294901759,32767,4294901760,262143,536870911,8388607,4160749567,4294902783,4294918143,65535,67043328,2281701374,4294967264,2097151,4194303,255,67108863,4294967039,511,524287,131071,63,127,3238002687,4294549487,4290772991,33554431,4294901888,4286578687,67043329,4294705152,4294770687,67043583,1023,15,2047999,67043343,67051519,16777215,2147483648,4294902e3,28,4292870143,4294966783,16383,67047423,4294967279,262083,20511,41943039,493567,4294959104,603979775,65536,602799615,805044223,4294965206,8191,1031749119,4294917631,2134769663,4286578493,4282253311,4294942719,33540095,4294905855,2868854591,1608515583,265232348,534519807,2147614720,1060109444,4093640016,17376,2139062143,224,4169138175,4294909951,4286578688,4294967292,4294965759,535511039,4294966272,4294967280,32768,8289918,4294934399,4294901775,4294965375,1602223615,4294967259,4294443008,268369920,4292804608,4294967232,486341884,4294963199,3087007615,1073692671,4128527,4279238655,4294902015,4160684047,4290246655,469499899,4294967231,134086655,4294966591,2445279231,3670015,31,4294967288,4294705151,3221208447,4294902271,4294549472,4294921215,4095,4285526655,4294966527,4294966143,64,4294966719,3774873592,1877934080,262151,2555904,536807423,67043839,3758096383,3959414372,3755993023,2080374783,4294835295,4294967103,4160749565,4294934527,4087,2016,2147446655,184024726,2862017156,1593309078,268434431,268434414,4294901763,4294901761,536870912,2952790016,202506752,139264,4026531840,402653184,4261412864,63488,1610612736,4227922944,49152,65280,3233808384,3221225472,65534,61440,57152,4293918720,4290772992,25165824,57344,4227915776,4278190080,3758096384,4227858432,4160749568,3758129152,4294836224,4194304,251658240,196608,4294963200,2143289344,2097152,64512,417808,4227923712,12582912,50331648,65528,65472,4294967168,15360,4294966784,65408,4294965248,16,12288,4294934528,2080374784,2013265920,4294950912,524288]);function A(n){return n.column++,n.currentChar=n.source.charCodeAt(++n.index)}function tn(n){let e=n.currentChar;if((e&64512)!==55296)return 0;let u=n.source.charCodeAt(n.index+1);return(u&64512)!==56320?0:65536+((e&1023)<<10)+(u&1023)}function on(n,e){n.currentChar=n.source.charCodeAt(++n.index),n.flags|=1,(e&4)===0&&(n.column=0,n.line++)}function k2(n){n.flags|=1,n.currentChar=n.source.charCodeAt(++n.index),n.column=0,n.line++}function Xe(n){return n===160||n===65279||n===133||n===5760||n>=8192&&n<=8203||n===8239||n===8287||n===12288||n===8201||n===65519}function W(n){return n<65?n-48:n-65+10&15}function He(n){switch(n){case 134283266:return"NumericLiteral";case 134283267:return"StringLiteral";case 86021:case 86022:return"BooleanLiteral";case 86023:return"NullLiteral";case 65540:return"RegularExpression";case 67174408:case 67174409:case 131:return"TemplateLiteral";default:return(n&143360)===143360?"Identifier":(n&4096)===4096?"Keyword":"Punctuator"}}var N=[0,0,0,0,0,0,0,0,0,0,1032,0,0,2056,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8192,0,3,0,0,8192,0,0,0,256,0,33024,0,0,242,242,114,114,114,114,114,114,594,594,0,0,16384,0,0,0,0,67,67,67,67,67,67,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,1,0,0,4099,0,71,71,71,71,71,71,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,16384,0,0,0,0],ze=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],Rn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function M2(n){return n<=127?ze[n]>0:Vn(n)}function V2(n){return n<=127?Rn[n]>0:je(n)||n===8204||n===8205}var Un=["SingleLine","MultiLine","HTMLOpen","HTMLClose","HashbangComment"];function Ke(n){let{source:e}=n;n.currentChar===35&&e.charCodeAt(n.index+1)===33&&(A(n),A(n),ln(n,e,0,4,n.tokenIndex,n.tokenLine,n.tokenColumn))}function Ln(n,e,u,t,o,i,l,f){return t&512&&c(n,0),ln(n,e,u,o,i,l,f)}function ln(n,e,u,t,o,i,l){let{index:f}=n;for(n.tokenIndex=n.index,n.tokenLine=n.line,n.tokenColumn=n.column;n.index=n.source.length)return c(n,34)}let o=n.index-1,i=X.Empty,l=n.currentChar,{index:f}=n;for(;V2(l);){switch(l){case 103:i&X.Global&&c(n,36,"g"),i|=X.Global;break;case 105:i&X.IgnoreCase&&c(n,36,"i"),i|=X.IgnoreCase;break;case 109:i&X.Multiline&&c(n,36,"m"),i|=X.Multiline;break;case 117:i&X.Unicode&&c(n,36,"u"),i&X.UnicodeSets&&c(n,36,"vu"),i|=X.Unicode;break;case 118:i&X.Unicode&&c(n,36,"uv"),i&X.UnicodeSets&&c(n,36,"v"),i|=X.UnicodeSets;break;case 121:i&X.Sticky&&c(n,36,"y"),i|=X.Sticky;break;case 115:i&X.DotAll&&c(n,36,"s"),i|=X.DotAll;break;case 100:i&X.Indices&&c(n,36,"d"),i|=X.Indices;break;default:c(n,35)}l=A(n)}let d=n.source.slice(f,n.index),g=n.source.slice(u,o);return n.tokenRegExp={pattern:g,flags:d},e&128&&(n.tokenRaw=n.source.slice(n.tokenIndex,n.index)),n.tokenValue=_e(n,g,d),65540}function _e(n,e,u){try{return new RegExp(e,u)}catch{try{return new RegExp(e,u),null}catch{c(n,34)}}}function Ye(n,e,u){let{index:t}=n,o="",i=A(n),l=n.index;for(;(N[i]&8)===0;){if(i===u)return o+=n.source.slice(l,n.index),A(n),e&128&&(n.tokenRaw=n.source.slice(t,n.index)),n.tokenValue=o,134283267;if((i&8)===8&&i===92){if(o+=n.source.slice(l,n.index),i=A(n),i<127||i===8232||i===8233){let f=Mn(n,e,i);f>=0?o+=String.fromCodePoint(f):Jn(n,f,0)}else o+=String.fromCodePoint(i);l=n.index+1}n.index>=n.end&&c(n,16),i=A(n)}c(n,16)}function Mn(n,e,u,t=0){switch(u){case 98:return 8;case 102:return 12;case 114:return 13;case 110:return 10;case 116:return 9;case 118:return 11;case 13:if(n.index1114111)return-5;return n.currentChar<1||n.currentChar!==125?-4:i}else{if((N[o]&64)===0)return-4;let i=n.source.charCodeAt(n.index+1);if((N[i]&64)===0)return-4;let l=n.source.charCodeAt(n.index+2);if((N[l]&64)===0)return-4;let f=n.source.charCodeAt(n.index+3);return(N[f]&64)===0?-4:(n.index+=3,n.column+=3,n.currentChar=n.source.charCodeAt(n.index),W(o)<<12|W(i)<<8|W(l)<<4|W(f))}}case 56:case 57:if(t||(e&64)===0||e&256)return-3;n.flags|=4096;default:return u}}function Jn(n,e,u){switch(e){case-1:return;case-2:c(n,u?2:1);case-3:c(n,u?3:14);case-4:c(n,7);case-5:c(n,104)}}function jn(n,e){let{index:u}=n,t=67174409,o="",i=A(n);for(;i!==96;){if(i===36&&n.source.charCodeAt(n.index+1)===123){A(n),t=67174408;break}else if(i===92)if(i=A(n),i>126)o+=String.fromCodePoint(i);else{let{index:l,line:f,column:d}=n,g=Mn(n,e|256,i,1);if(g>=0)o+=String.fromCodePoint(g);else if(g!==-1&&e&16384){n.index=l,n.line=f,n.column=d,o=null,i=Qe(n,i),i<0&&(t=67174408);break}else Jn(n,g,1)}else n.index=n.end&&c(n,17),i=A(n)}return A(n),n.tokenValue=o,n.tokenRaw=n.source.slice(u+1,n.index-(t===67174409?1:2)),t}function Qe(n,e){for(;e!==96;){switch(e){case 36:{let u=n.index+1;if(u=n.end&&c(n,17),e=A(n)}return e}function Ze(n,e){return n.index>=n.end&&c(n,0),n.index--,n.column--,jn(n,e)}function Fn(n,e,u){let t=n.currentChar,o=0,i=9,l=u&64?0:1,f=0,d=0;if(u&64)o="."+v2(n,t),t=n.currentChar,t===110&&c(n,12);else{if(t===48)if(t=A(n),(t|32)===120){for(u=136,t=A(n);N[t]&4160;){if(t===95){d||c(n,152),d=0,t=A(n);continue}d=1,o=o*16+W(t),f++,t=A(n)}(f===0||!d)&&c(n,f===0?21:153)}else if((t|32)===111){for(u=132,t=A(n);N[t]&4128;){if(t===95){d||c(n,152),d=0,t=A(n);continue}d=1,o=o*8+(t-48),f++,t=A(n)}(f===0||!d)&&c(n,f===0?0:153)}else if((t|32)===98){for(u=130,t=A(n);N[t]&4224;){if(t===95){d||c(n,152),d=0,t=A(n);continue}d=1,o=o*2+(t-48),f++,t=A(n)}(f===0||!d)&&c(n,f===0?0:153)}else if(N[t]&32)for(e&256&&c(n,1),u=1;N[t]&16;){if(N[t]&512){u=32,l=0;break}o=o*8+(t-48),t=A(n)}else N[t]&512?(e&256&&c(n,1),n.flags|=64,u=32):t===95&&c(n,0);if(u&48){if(l){for(;i>=0&&N[t]&4112;){if(t===95){t=A(n),(t===95||u&32)&&h2(n.index,n.line,n.column,n.index+1,n.line,n.column,152),d=1;continue}d=0,o=10*o+(t-48),t=A(n),--i}if(d&&h2(n.index,n.line,n.column,n.index+1,n.line,n.column,153),i>=0&&!M2(t)&&t!==46)return n.tokenValue=o,e&128&&(n.tokenRaw=n.source.slice(n.tokenIndex,n.index)),134283266}o+=v2(n,t),t=n.currentChar,t===46&&(A(n)===95&&c(n,0),u=64,o+="."+v2(n,n.currentChar),t=n.currentChar)}}let g=n.index,m=0;if(t===110&&u&128)m=1,t=A(n);else if((t|32)===101){t=A(n),N[t]&256&&(t=A(n));let{index:y}=n;(N[t]&16)===0&&c(n,11),o+=n.source.substring(g,y)+v2(n,t),t=n.currentChar}return(n.index","(","{",".","...","}",")",";",",","[","]",":","?","'",'"',"++","--","=","<<=",">>=",">>>=","**=","+=","-=","*=","/=","%=","^=","|=","&=","||=","&&=","??=","typeof","delete","void","!","~","+","-","in","instanceof","*","%","/","**","&&","||","===","!==","==","!=","<=",">=","<",">","<<",">>",">>>","&","|","^","var","let","const","break","case","catch","class","continue","debugger","default","do","else","export","extends","finally","for","function","if","import","new","return","super","switch","this","throw","try","while","with","implements","interface","package","private","protected","public","static","yield","as","async","await","constructor","get","set","accessor","from","of","enum","eval","arguments","escaped keyword","escaped future reserved keyword","reserved if strict","#","BigIntLiteral","??","?.","WhiteSpace","Illegal","LineTerminator","PrivateField","Template","@","target","meta","LineFeed","Escaped","JSXText"],Xn=Object.create(null,{this:{value:86111},function:{value:86104},if:{value:20569},return:{value:20572},var:{value:86088},else:{value:20563},for:{value:20567},new:{value:86107},in:{value:8673330},typeof:{value:16863275},while:{value:20578},case:{value:20556},break:{value:20555},try:{value:20577},catch:{value:20557},delete:{value:16863276},throw:{value:86112},switch:{value:86110},continue:{value:20559},default:{value:20561},instanceof:{value:8411187},do:{value:20562},void:{value:16863277},finally:{value:20566},async:{value:209005},await:{value:209006},class:{value:86094},const:{value:86090},constructor:{value:12399},debugger:{value:20560},export:{value:20564},extends:{value:20565},false:{value:86021},from:{value:12403},get:{value:12400},implements:{value:36964},import:{value:86106},interface:{value:36965},let:{value:241737},null:{value:86023},of:{value:274548},package:{value:36966},private:{value:36967},protected:{value:36968},public:{value:36969},set:{value:12401},static:{value:36970},super:{value:86109},true:{value:86022},with:{value:20579},yield:{value:241771},enum:{value:86133},eval:{value:537079926},as:{value:77932},arguments:{value:537079927},target:{value:209029},meta:{value:209030},accessor:{value:12402}});function qn(n,e,u){for(;Rn[A(n)];);return n.tokenValue=n.source.slice(n.tokenIndex,n.index),n.currentChar!==92&&n.currentChar<=126?Xn[n.tokenValue]||208897:fn(n,e,0,u)}function Ge(n,e){let u=Hn(n);return M2(u)||c(n,5),n.tokenValue=String.fromCodePoint(u),fn(n,e,1,N[u]&4)}function fn(n,e,u,t){let o=n.index;for(;n.index0)V2(l)||c(n,20,String.fromCodePoint(l)),n.currentChar=l,n.index++,n.column++;else if(!V2(n.currentChar))break;A(n)}n.index<=n.end&&(n.tokenValue+=n.source.slice(o,n.index));let{length:i}=n.tokenValue;if(t&&i>=2&&i<=11){let l=Xn[n.tokenValue];return l===void 0?208897|(u?-2147483648:0):u?l===209006?(e&524800)===0?l|-2147483648:-2147483528:e&256?l===36970||(l&36864)===36864?-2147483527:(l&20480)===20480?e&67108864&&(e&2048)===0?l|-2147483648:-2147483528:-2147274630:e&67108864&&(e&2048)===0&&(l&20480)===20480?l|-2147483648:l===241771?e&67108864?-2147274630:e&262144?-2147483528:l|-2147483648:l===209005?-2147274630:(l&36864)===36864?l|12288|-2147483648:-2147483528:l}return 208897|(u?-2147483648:0)}function xe(n){let e=A(n);if(e===92)return 130;let u=tn(n);return u&&(e=u),M2(e)||c(n,96),130}function Hn(n){return n.source.charCodeAt(n.index+1)!==117&&c(n,5),n.currentChar=n.source.charCodeAt(n.index+=2),re(n)}function re(n){let e=0,u=n.currentChar;if(u===123){let l=n.index-2;for(;N[A(n)]&64;)e=e<<4|W(n.currentChar),e>1114111&&h2(l,n.line,n.column,n.index,n.line,n.column,104);return n.currentChar!==125&&h2(l,n.line,n.column,n.index,n.line,n.column,7),A(n),e}(N[u]&64)===0&&c(n,7);let t=n.source.charCodeAt(n.index+1);(N[t]&64)===0&&c(n,7);let o=n.source.charCodeAt(n.index+2);(N[o]&64)===0&&c(n,7);let i=n.source.charCodeAt(n.index+3);return(N[i]&64)===0&&c(n,7),e=W(u)<<12|W(t)<<8|W(o)<<4|W(i),n.currentChar=n.source.charCodeAt(n.index+=4),e}var pe=[128,128,128,128,128,128,128,128,128,127,135,127,127,129,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,127,16842798,134283267,130,208897,8391477,8390213,134283267,67174411,16,8391476,25233968,18,25233969,67108877,8457014,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,21,1074790417,8456256,1077936155,8390721,22,132,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,69271571,136,20,8389959,208897,131,4096,4096,4096,4096,4096,4096,4096,208897,4096,208897,208897,4096,208897,4096,208897,4096,208897,4096,4096,4096,208897,4096,4096,208897,4096,4096,2162700,8389702,1074790415,16842799,128];function b(n,e){n.flags=(n.flags|1)^1,n.startIndex=n.index,n.startColumn=n.column,n.startLine=n.line,n.setToken(zn(n,e,0))}function zn(n,e,u){let t=n.index===0,{source:o}=n,i=n.index,l=n.line,f=n.column;for(;n.index=n.end)return 8391476;let m=n.currentChar;return m===61?(A(n),4194338):m!==42?8391476:A(n)!==61?8391735:(A(n),4194335)}case 8389959:return A(n)!==61?8389959:(A(n),4194341);case 25233968:{A(n);let m=n.currentChar;return m===43?(A(n),33619993):m===61?(A(n),4194336):25233968}case 25233969:{A(n);let m=n.currentChar;if(m===45){if(A(n),(u&1||t)&&n.currentChar===62){(e&64)===0&&c(n,112),A(n),u=Ln(n,o,u,e,3,i,l,f),i=n.tokenIndex,l=n.tokenLine,f=n.tokenColumn;continue}return 33619994}return m===61?(A(n),4194337):25233969}case 8457014:{if(A(n),n.index=48&&m<=57)return Fn(n,e,80);if(m===46){let y=n.index+1;if(y=48&&m<=57)))return A(n),67108990}return 22}}}else{if((d^8232)<=1){u=u&-5|1,k2(n);continue}let g=tn(n);if(g>0&&(d=g),Vn(d))return n.tokenValue="",fn(n,e,0,0);if(Xe(d)){A(n);continue}c(n,20,String.fromCodePoint(d))}}return 1048576}function nu(n,e){return n.startIndex=n.tokenIndex=n.index,n.startColumn=n.tokenColumn=n.column,n.startLine=n.tokenLine=n.line,n.setToken(N[n.currentChar]&8192?eu(n,e):zn(n,e,0)),n.getToken()}function eu(n,e){let u=n.currentChar,t=A(n),o=n.index;for(;t!==u;)n.index>=n.end&&c(n,16),t=A(n);return t!==u&&c(n,16),n.tokenValue=n.source.slice(o,n.index),A(n),e&128&&(n.tokenRaw=n.source.slice(n.tokenIndex,n.index)),134283267}function w2(n,e){if(n.startIndex=n.tokenIndex=n.index,n.startColumn=n.tokenColumn=n.column,n.startLine=n.tokenLine=n.line,n.index>=n.end){n.setToken(1048576);return}if(n.currentChar===60){A(n),n.setToken(8456256);return}if(n.currentChar===123){A(n),n.setToken(2162700);return}let u=0;for(;n.index1&&i&32&&n.getToken()&262144&&c(n,61,V[n.getToken()&255]),f}function Pn(n,e,u,t,o,i){let{tokenIndex:l,tokenLine:f,tokenColumn:d}=n,g=n.getToken(),m=null,y=ge(n,e,u,t,o,i,l,f,d);return n.getToken()===1077936155?(b(n,e|8192),m=M(n,e,t,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn),(i&32||(g&2097152)===0)&&(n.getToken()===274548||n.getToken()===8673330&&(g&2097152||(o&4)===0||e&256))&&$(l,f,d,n.index,n.line,n.column,60,n.getToken()===274548?"of":"in")):(o&16||(g&2097152)>0)&&(n.getToken()&262144)!==262144&&c(n,59,o&16?"const":"destructuring"),s(n,e,l,f,d,{type:"VariableDeclarator",id:y,init:m})}function Nu(n,e,u,t,o,i,l,f){b(n,e);let d=((e&524288)>0||(e&512)>0&&(e&2048)>0)&&P(n,e,209006);C(n,e|8192,67174411),u&&(u=j(u,1));let g=null,m=null,y=0,a=null,k=n.getToken()===86088||n.getToken()===241737||n.getToken()===86090,h,{tokenIndex:T,tokenLine:E,tokenColumn:w}=n,I=n.getToken();if(k?I===241737?(a=R(n,e),n.getToken()&2240512?(n.getToken()===8673330?e&256&&c(n,67):a=s(n,e,T,E,w,{type:"VariableDeclaration",kind:"let",declarations:s2(n,e|33554432,u,t,8,32)}),n.assignable=1):e&256?c(n,67):(k=!1,n.assignable=1,a=O(n,e,t,a,0,0,T,E,w),n.getToken()===274548&&c(n,115))):(b(n,e),a=s(n,e,T,E,w,I===86088?{type:"VariableDeclaration",kind:"var",declarations:s2(n,e|33554432,u,t,4,32)}:{type:"VariableDeclaration",kind:"const",declarations:s2(n,e|33554432,u,t,16,32)}),n.assignable=1):I===1074790417?d&&c(n,82):(I&2097152)===2097152?(a=I===2162700?Z(n,e,void 0,t,1,0,0,2,32,T,E,w):Q(n,e,void 0,t,1,0,0,2,32,T,E,w),y=n.destructible,y&64&&c(n,63),n.assignable=y&16?2:1,a=O(n,e|33554432,t,a,0,0,n.tokenIndex,n.tokenLine,n.tokenColumn)):a=Y(n,e|33554432,t,1,0,1,T,E,w),(n.getToken()&262144)===262144){if(n.getToken()===274548){n.assignable&2&&c(n,80,d?"await":"of"),r(n,a),b(n,e|8192),h=M(n,e,t,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn),C(n,e|8192,16);let F=C2(n,e,u,t,o);return s(n,e,i,l,f,{type:"ForOfStatement",left:a,right:h,body:F,await:d})}n.assignable&2&&c(n,80,"in"),r(n,a),b(n,e|8192),d&&c(n,82),h=z(n,e,t,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn),C(n,e|8192,16);let q=C2(n,e,u,t,o);return s(n,e,i,l,f,{type:"ForInStatement",body:q,left:a,right:h})}d&&c(n,82),k||(y&8&&n.getToken()!==1077936155&&c(n,80,"loop"),a=J(n,e|33554432,t,0,0,T,E,w,a)),n.getToken()===18&&(a=e2(n,e,t,0,n.tokenIndex,n.tokenLine,n.tokenColumn,a)),C(n,e|8192,1074790417),n.getToken()!==1074790417&&(g=z(n,e,t,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn)),C(n,e|8192,1074790417),n.getToken()!==16&&(m=z(n,e,t,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn)),C(n,e|8192,16);let v=C2(n,e,u,t,o);return s(n,e,i,l,f,{type:"ForStatement",init:a,test:g,update:m,body:v})}function xn(n,e,u){return B2(e,n.getToken())||c(n,118),(n.getToken()&537079808)===537079808&&c(n,119),u&&d2(n,e,u,n.tokenValue,8,0),R(n,e)}function Vu(n,e,u){let t=n.tokenIndex,o=n.tokenLine,i=n.tokenColumn;b(n,e);let l=null,{tokenIndex:f,tokenLine:d,tokenColumn:g}=n,m=[];if(n.getToken()===134283267)l=H(n,e);else{if(n.getToken()&143360){let a=xn(n,e,u);if(m=[s(n,e,f,d,g,{type:"ImportDefaultSpecifier",local:a})],P(n,e,18))switch(n.getToken()){case 8391476:m.push(vn(n,e,u));break;case 2162700:Nn(n,e,u,m);break;default:c(n,107)}}else switch(n.getToken()){case 8391476:m=[vn(n,e,u)];break;case 2162700:Nn(n,e,u,m);break;case 67174411:return pn(n,e,void 0,t,o,i);case 67108877:return rn(n,e,t,o,i);default:c(n,30,V[n.getToken()&255])}l=Ou(n,e)}let y={type:"ImportDeclaration",specifiers:m,source:l};return e&1&&(y.attributes=en(n,e,m)),K(n,e|8192),s(n,e,t,o,i,y)}function vn(n,e,u){let{tokenIndex:t,tokenLine:o,tokenColumn:i}=n;return b(n,e),C(n,e,77932),(n.getToken()&134217728)===134217728&&$(t,o,i,n.index,n.line,n.column,30,V[n.getToken()&255]),s(n,e,t,o,i,{type:"ImportNamespaceSpecifier",local:xn(n,e,u)})}function Ou(n,e){return C(n,e,12403),n.getToken()!==134283267&&c(n,105,"Import"),H(n,e)}function Nn(n,e,u,t){for(b(n,e);n.getToken()&143360||n.getToken()===134283267;){let{tokenValue:o,tokenIndex:i,tokenLine:l,tokenColumn:f}=n,d=n.getToken(),g=O2(n,e),m;P(n,e,77932)?((n.getToken()&134217728)===134217728||n.getToken()===18?c(n,106):J2(n,e,16,n.getToken(),0),o=n.tokenValue,m=R(n,e)):g.type==="Identifier"?(J2(n,e,16,d,0),m=g):c(n,25,V[108]),u&&d2(n,e,u,o,8,0),t.push(s(n,e,i,l,f,{type:"ImportSpecifier",local:m,imported:g})),n.getToken()!==1074790415&&C(n,e,18)}return C(n,e,1074790415),t}function rn(n,e,u,t,o){let i=ne(n,e,s(n,e,u,t,o,{type:"Identifier",name:"import"}),u,t,o);return i=O(n,e,void 0,i,0,0,u,t,o),i=J(n,e,void 0,0,0,u,t,o,i),n.getToken()===18&&(i=e2(n,e,void 0,0,u,t,o,i)),A2(n,e,i,u,t,o)}function pn(n,e,u,t,o,i){let l=ee(n,e,u,0,t,o,i);return l=O(n,e,u,l,0,0,t,o,i),n.getToken()===18&&(l=e2(n,e,u,0,t,o,i,l)),A2(n,e,l,t,o,i)}function Ru(n,e,u){let t=n.tokenIndex,o=n.tokenLine,i=n.tokenColumn;b(n,e|8192);let l=[],f=null,d=null,g=null;if(P(n,e|8192,20561)){switch(n.getToken()){case 86104:{f=f2(n,e,u,void 0,4,1,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);break}case 132:case 86094:f=un(n,e,u,void 0,1,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 209005:{let{tokenIndex:y,tokenLine:a,tokenColumn:k}=n;f=R(n,e);let{flags:h}=n;(h&1)===0&&(n.getToken()===86104?f=f2(n,e,u,void 0,4,1,1,1,y,a,k):n.getToken()===67174411?(f=hn(n,e,void 0,f,1,1,0,h,y,a,k),f=O(n,e,void 0,f,0,0,y,a,k),f=J(n,e,void 0,0,0,y,a,k,f)):n.getToken()&143360&&(u&&(u=K2(n,e,n.tokenValue)),f=R(n,e),f=F2(n,e,u,void 0,[f],1,y,a,k)));break}default:f=M(n,e,void 0,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn),K(n,e|8192)}return u&&g2(n,"default"),s(n,e,t,o,i,{type:"ExportDefaultDeclaration",declaration:f})}switch(n.getToken()){case 8391476:{b(n,e);let y=null;P(n,e,77932)&&(u&&g2(n,n.tokenValue),y=O2(n,e)),C(n,e,12403),n.getToken()!==134283267&&c(n,105,"Export"),d=H(n,e);let k={type:"ExportAllDeclaration",source:d,exported:y};return e&1&&(k.attributes=en(n,e)),K(n,e|8192),s(n,e,t,o,i,k)}case 2162700:{b(n,e);let y=[],a=[],k=0;for(;n.getToken()&143360||n.getToken()===134283267;){let{tokenIndex:h,tokenValue:T,tokenLine:E,tokenColumn:w}=n,I=O2(n,e);I.type==="Literal"&&(k=1);let v;n.getToken()===77932?(b(n,e),(n.getToken()&143360)===0&&n.getToken()!==134283267&&c(n,106),u&&(y.push(n.tokenValue),a.push(T)),v=O2(n,e)):(u&&(y.push(n.tokenValue),a.push(n.tokenValue)),v=I),l.push(s(n,e,h,E,w,{type:"ExportSpecifier",local:I,exported:v})),n.getToken()!==1074790415&&C(n,e,18)}C(n,e,1074790415),P(n,e,12403)?(n.getToken()!==134283267&&c(n,105,"Export"),d=H(n,e),e&1&&(g=en(n,e,l)),u&&y.forEach(h=>g2(n,h))):(k&&c(n,172),u&&(y.forEach(h=>g2(n,h)),a.forEach(h=>du(n,h)))),K(n,e|8192);break}case 86094:f=un(n,e,u,void 0,2,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 86104:f=f2(n,e,u,void 0,4,1,2,0,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 241737:f=nn(n,e,u,void 0,8,64,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 86090:f=nn(n,e,u,void 0,16,64,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 86088:f=Gn(n,e,u,void 0,64,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 209005:{let{tokenIndex:y,tokenLine:a,tokenColumn:k}=n;if(b(n,e),(n.flags&1)===0&&n.getToken()===86104){f=f2(n,e,u,void 0,4,1,2,1,y,a,k);break}}default:c(n,30,V[n.getToken()&255])}let m={type:"ExportNamedDeclaration",declaration:f,specifiers:l,source:d};return g&&(m.attributes=g),s(n,e,t,o,i,m)}function M(n,e,u,t,o,i,l,f){let d=_(n,e,u,2,0,t,o,1,i,l,f);return d=O(n,e,u,d,o,0,i,l,f),J(n,e,u,o,0,i,l,f,d)}function e2(n,e,u,t,o,i,l,f){let d=[f];for(;P(n,e|8192,18);)d.push(M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn));return s(n,e,o,i,l,{type:"SequenceExpression",expressions:d})}function z(n,e,u,t,o,i,l,f){let d=M(n,e,u,o,t,i,l,f);return n.getToken()===18?e2(n,e,u,t,i,l,f,d):d}function J(n,e,u,t,o,i,l,f,d){let g=n.getToken();if((g&4194304)===4194304){n.assignable&2&&c(n,26),(!o&&g===1077936155&&d.type==="ArrayExpression"||d.type==="ObjectExpression")&&r(n,d),b(n,e|8192);let m=M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.assignable=2,s(n,e,i,l,f,o?{type:"AssignmentPattern",left:d,right:m}:{type:"AssignmentExpression",left:d,operator:V[g&255],right:m})}return(g&8388608)===8388608&&(d=l2(n,e,u,t,i,l,f,4,g,d)),P(n,e|8192,22)&&(d=c2(n,e,u,d,i,l,f)),d}function N2(n,e,u,t,o,i,l,f,d){let g=n.getToken();b(n,e|8192);let m=M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn);return d=s(n,e,i,l,f,o?{type:"AssignmentPattern",left:d,right:m}:{type:"AssignmentExpression",left:d,operator:V[g&255],right:m}),n.assignable=2,d}function c2(n,e,u,t,o,i,l){let f=M(n,(e|33554432)^33554432,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);C(n,e|8192,21),n.assignable=1;let d=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.assignable=2,s(n,e,o,i,l,{type:"ConditionalExpression",test:t,consequent:f,alternate:d})}function l2(n,e,u,t,o,i,l,f,d,g){let m=-((e&33554432)>0)&8673330,y,a;for(n.assignable=2;n.getToken()&8388608&&(y=n.getToken(),a=y&3840,(y&524288&&d&268435456||d&524288&&y&268435456)&&c(n,165),!(a+((y===8391735)<<8)-((m===y)<<12)<=f));)b(n,e|8192),g=s(n,e,o,i,l,{type:y&524288||y&268435456?"LogicalExpression":"BinaryExpression",left:g,right:l2(n,e,u,t,n.tokenIndex,n.tokenLine,n.tokenColumn,a,y,Y(n,e,u,0,t,1,n.tokenIndex,n.tokenLine,n.tokenColumn)),operator:V[y&255]});return n.getToken()===1077936155&&c(n,26),g}function Uu(n,e,u,t,o,i,l,f){t||c(n,0);let d=n.getToken();b(n,e|8192);let g=Y(n,e,u,0,f,1,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.getToken()===8391735&&c(n,33),e&256&&d===16863276&&(g.type==="Identifier"?c(n,121):uu(g)&&c(n,127)),n.assignable=2,s(n,e,o,i,l,{type:"UnaryExpression",operator:V[d&255],argument:g,prefix:!0})}function Mu(n,e,u,t,o,i,l,f,d,g){let m=n.getToken(),y=R(n,e),{flags:a}=n;if((a&1)===0){if(n.getToken()===86104)return te(n,e,u,1,t,f,d,g);if(B2(e,n.getToken()))return o||c(n,0),(n.getToken()&36864)===36864&&(n.flags|=256),le(n,e,u,i,f,d,g)}return!l&&n.getToken()===67174411?hn(n,e,u,y,i,1,0,a,f,d,g):n.getToken()===10?($2(n,e,m),l&&c(n,51),(m&36864)===36864&&(n.flags|=256),_2(n,e,u,n.tokenValue,y,l,i,0,f,d,g)):(n.assignable=1,y)}function Ju(n,e,u,t,o,i,l,f){if(t&&(n.destructible|=256),e&262144){b(n,e|8192),e&2097152&&c(n,32),o||c(n,26),n.getToken()===22&&c(n,124);let d=null,g=!1;return(n.flags&1)===0?(g=P(n,e|8192,8391476),(n.getToken()&77824||g)&&(d=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn))):n.getToken()===8391476&&c(n,30,V[n.getToken()&255]),n.assignable=2,s(n,e,i,l,f,{type:"YieldExpression",argument:d,delegate:g})}return e&256&&c(n,97,"yield"),sn(n,e,u,i,l,f)}function ju(n,e,u,t,o,i,l,f){o&&(n.destructible|=128),e&268435456&&c(n,177);let d=sn(n,e,u,i,l,f);if(d.type==="ArrowFunctionExpression"||(n.getToken()&65536)===0)return e&524288&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,176),e&512&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,110),e&2097152&&e&524288&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,110),d;if(e&2097152&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,31),e&524288||e&512&&e&2048){t&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,0);let m=Y(n,e,u,0,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.getToken()===8391735&&c(n,33),n.assignable=2,s(n,e,i,l,f,{type:"AwaitExpression",argument:m})}return e&512&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,98),d}function W2(n,e,u,t,o,i,l){let{tokenIndex:f,tokenLine:d,tokenColumn:g}=n;C(n,e|8192,2162700);let m=[];if(n.getToken()!==1074790415){for(;n.getToken()===134283267;){let{index:y,tokenIndex:a,tokenValue:k}=n,h=n.getToken(),T=H(n,e);Kn(n,y,a,k)&&(e|=256,n.flags&128&&$(a,d,g,n.index,n.line,n.column,66),n.flags&64&&$(a,d,g,n.index,n.line,n.column,9),n.flags&4096&&$(a,d,g,n.index,n.line,n.column,15),l&&z2(l)),m.push(cn(n,e,T,h,a,n.tokenLine,n.tokenColumn))}e&256&&(i&&((i&537079808)===537079808&&c(n,119),(i&36864)===36864&&c(n,40)),n.flags&512&&c(n,119),n.flags&256&&c(n,118))}for(n.flags=(n.flags|512|256|64|4096)^4928,n.destructible=(n.destructible|256)^256;n.getToken()!==1074790415;)m.push(I2(n,e,u,t,4,{}));return C(n,o&24?e|8192:e,1074790415),n.flags&=-4289,n.getToken()===1077936155&&c(n,26),s(n,e,f,d,g,{type:"BlockStatement",body:m})}function Xu(n,e,u,t,o){switch(b(n,e),n.getToken()){case 67108990:c(n,167);case 67174411:{(e&131072)===0&&c(n,28),n.assignable=2;break}case 69271571:case 67108877:{(e&65536)===0&&c(n,29),n.assignable=1;break}default:c(n,30,"super")}return s(n,e,u,t,o,{type:"Super"})}function Y(n,e,u,t,o,i,l,f,d){let g=_(n,e,u,2,0,t,o,i,l,f,d);return O(n,e,u,g,o,0,l,f,d)}function Hu(n,e,u,t,o,i){n.assignable&2&&c(n,55);let l=n.getToken();return b(n,e),n.assignable=2,s(n,e,t,o,i,{type:"UpdateExpression",argument:u,operator:V[l&255],prefix:!1})}function O(n,e,u,t,o,i,l,f,d){if((n.getToken()&33619968)===33619968&&(n.flags&1)===0)t=Hu(n,e,t,l,f,d);else if((n.getToken()&67108864)===67108864){switch(e=(e|33554432)^33554432,n.getToken()){case 67108877:{b(n,(e|67108864|2048)^2048),e&4096&&n.getToken()===130&&n.tokenValue==="super"&&c(n,173),n.assignable=1;let g=mn(n,e|16384,u);t=s(n,e,l,f,d,{type:"MemberExpression",object:t,computed:!1,property:g});break}case 69271571:{let g=!1;(n.flags&2048)===2048&&(g=!0,n.flags=(n.flags|2048)^2048),b(n,e|8192);let{tokenIndex:m,tokenLine:y,tokenColumn:a}=n,k=z(n,e,u,o,1,m,y,a);C(n,e,20),n.assignable=1,t=s(n,e,l,f,d,{type:"MemberExpression",object:t,computed:!0,property:k}),g&&(n.flags|=2048);break}case 67174411:{if((n.flags&1024)===1024)return n.flags=(n.flags|1024)^1024,t;let g=!1;(n.flags&2048)===2048&&(g=!0,n.flags=(n.flags|2048)^2048);let m=yn(n,e,u,o);n.assignable=2,t=s(n,e,l,f,d,{type:"CallExpression",callee:t,arguments:m}),g&&(n.flags|=2048);break}case 67108990:{b(n,(e|67108864|2048)^2048),n.flags|=2048,n.assignable=2,t=zu(n,e,u,t,l,f,d);break}default:(n.flags&2048)===2048&&c(n,166),n.assignable=2,t=s(n,e,l,f,d,{type:"TaggedTemplateExpression",tag:t,quasi:n.getToken()===67174408?an(n,e|16384,u):kn(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn)})}t=O(n,e,u,t,0,1,l,f,d)}return i===0&&(n.flags&2048)===2048&&(n.flags=(n.flags|2048)^2048,t=s(n,e,l,f,d,{type:"ChainExpression",expression:t})),t}function zu(n,e,u,t,o,i,l){let f=!1,d;if((n.getToken()===69271571||n.getToken()===67174411)&&(n.flags&2048)===2048&&(f=!0,n.flags=(n.flags|2048)^2048),n.getToken()===69271571){b(n,e|8192);let{tokenIndex:g,tokenLine:m,tokenColumn:y}=n,a=z(n,e,u,0,1,g,m,y);C(n,e,20),n.assignable=2,d=s(n,e,o,i,l,{type:"MemberExpression",object:t,computed:!0,optional:!0,property:a})}else if(n.getToken()===67174411){let g=yn(n,e,u,0);n.assignable=2,d=s(n,e,o,i,l,{type:"CallExpression",callee:t,arguments:g,optional:!0})}else{let g=mn(n,e,u);n.assignable=2,d=s(n,e,o,i,l,{type:"MemberExpression",object:t,computed:!1,optional:!0,property:g})}return f&&(n.flags|=2048),d}function mn(n,e,u){return(n.getToken()&143360)===0&&n.getToken()!==-2147483528&&n.getToken()!==-2147483527&&n.getToken()!==130&&c(n,160),n.getToken()===130?H2(n,e,u,0,n.tokenIndex,n.tokenLine,n.tokenColumn):R(n,e)}function Ku(n,e,u,t,o,i,l,f){t&&c(n,56),o||c(n,0);let d=n.getToken();b(n,e|8192);let g=Y(n,e,u,0,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.assignable&2&&c(n,55),n.assignable=2,s(n,e,i,l,f,{type:"UpdateExpression",argument:g,operator:V[d&255],prefix:!0})}function _(n,e,u,t,o,i,l,f,d,g,m){if((n.getToken()&143360)===143360){switch(n.getToken()){case 209006:return ju(n,e,u,o,l,d,g,m);case 241771:return Ju(n,e,u,l,i,d,g,m);case 209005:return Mu(n,e,u,l,f,i,o,d,g,m)}let{tokenValue:y}=n,a=n.getToken(),k=R(n,e|16384);return n.getToken()===10?(f||c(n,0),$2(n,e,a),(a&36864)===36864&&(n.flags|=256),_2(n,e,u,y,k,o,i,0,d,g,m)):(e&4096&&!(e&8388608)&&!(e&2097152)&&n.tokenValue==="arguments"&&c(n,130),(a&255)===73&&(e&256&&c(n,113),t&24&&c(n,100)),n.assignable=e&256&&(a&537079808)===537079808?2:1,k)}if((n.getToken()&134217728)===134217728)return H(n,e);switch(n.getToken()){case 33619993:case 33619994:return Ku(n,e,u,o,f,d,g,m);case 16863276:case 16842798:case 16842799:case 25233968:case 25233969:case 16863275:case 16863277:return Uu(n,e,u,f,d,g,m,l);case 86104:return te(n,e,u,0,l,d,g,m);case 2162700:return ru(n,e,u,i?0:1,l,d,g,m);case 69271571:return xu(n,e,u,i?0:1,l,d,g,m);case 67174411:return n1(n,e|16384,u,i,1,0,d,g,m);case 86021:case 86022:case 86023:return Zu(n,e,d,g,m);case 86111:return Gu(n,e);case 65540:return t1(n,e,d,g,m);case 132:case 86094:return i1(n,e,u,l,d,g,m);case 86109:return Xu(n,e,d,g,m);case 67174409:return kn(n,e,d,g,m);case 67174408:return an(n,e,u);case 86107:return e1(n,e,u,l,d,g,m);case 134283388:return ue(n,e,d,g,m);case 130:return H2(n,e,u,0,d,g,m);case 86106:return $u(n,e,u,o,l,d,g,m);case 8456256:if(e&8)return Q2(n,e,u,0,d,g,m);default:if(B2(e,n.getToken()))return sn(n,e,u,d,g,m);c(n,30,V[n.getToken()&255])}}function $u(n,e,u,t,o,i,l,f){let d=R(n,e);return n.getToken()===67108877?ne(n,e,d,i,l,f):(t&&c(n,142),d=ee(n,e,u,o,i,l,f),n.assignable=2,O(n,e,u,d,o,0,i,l,f))}function ne(n,e,u,t,o,i){(e&512)===0&&c(n,169),b(n,e);let l=n.getToken();return l!==209030&&n.tokenValue!=="meta"?c(n,174):l&-2147483648&&c(n,175),n.assignable=2,s(n,e,t,o,i,{type:"MetaProperty",meta:u,property:R(n,e)})}function ee(n,e,u,t,o,i,l){C(n,e|8192,67174411),n.getToken()===14&&c(n,143);let d={type:"ImportExpression",source:M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn)};if(e&1){let g=null;if(n.getToken()===18&&(C(n,e,18),n.getToken()!==16)){let m=(e|33554432)^33554432;g=M(n,m,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn)}d.options=g,P(n,e,18)}return C(n,e,16),s(n,e,o,i,l,d)}function en(n,e,u=null){if(!P(n,e,20579))return[];C(n,e,2162700);let t=[],o=new Set;for(;n.getToken()!==1074790415;){let i=n.tokenIndex,l=n.tokenLine,f=n.tokenColumn,d=_u(n,e);C(n,e,21);let g=Wu(n,e),m=d.type==="Literal"?d.value:d.name;m==="type"&&g.value==="json"&&(u===null||u.length===1&&(u[0].type==="ImportDefaultSpecifier"||u[0].type==="ImportNamespaceSpecifier"||u[0].type==="ImportSpecifier"&&u[0].imported.type==="Identifier"&&u[0].imported.name==="default"||u[0].type==="ExportSpecifier"&&u[0].local.type==="Identifier"&&u[0].local.name==="default")||c(n,140)),o.has(m)&&c(n,145,`${m}`),o.add(m),t.push(s(n,e,i,l,f,{type:"ImportAttribute",key:d,value:g})),n.getToken()!==1074790415&&C(n,e,18)}return C(n,e,1074790415),t}function Wu(n,e){if(n.getToken()===134283267)return H(n,e);c(n,30,V[n.getToken()&255])}function _u(n,e){if(n.getToken()===134283267)return H(n,e);if(n.getToken()&143360)return R(n,e);c(n,30,V[n.getToken()&255])}function Yu(n,e){let u=e.length;for(let t=0;t56319||++t>=u||(e.charCodeAt(t)&64512)!==56320)&&c(n,171,JSON.stringify(e.charAt(t--)))}}function O2(n,e){if(n.getToken()===134283267)return Yu(n,n.tokenValue),H(n,e);if(n.getToken()&143360)return R(n,e);c(n,30,V[n.getToken()&255])}function ue(n,e,u,t,o){let{tokenRaw:i,tokenValue:l}=n;return b(n,e),n.assignable=2,s(n,e,u,t,o,e&128?{type:"Literal",value:l,bigint:i.slice(0,-1),raw:i}:{type:"Literal",value:l,bigint:i.slice(0,-1)})}function kn(n,e,u,t,o){n.assignable=2;let{tokenValue:i,tokenRaw:l,tokenIndex:f,tokenLine:d,tokenColumn:g}=n;C(n,e,67174409);let m=[R2(n,e,i,l,f,d,g,!0)];return s(n,e,u,t,o,{type:"TemplateLiteral",expressions:[],quasis:m})}function an(n,e,u){e=(e|33554432)^33554432;let{tokenValue:t,tokenRaw:o,tokenIndex:i,tokenLine:l,tokenColumn:f}=n;C(n,e&-16385|8192,67174408);let d=[R2(n,e,t,o,i,l,f,!1)],g=[z(n,e&-16385,u,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn)];for(n.getToken()!==1074790415&&c(n,83);n.setToken(Ze(n,e),!0)!==67174409;){let{tokenValue:m,tokenRaw:y,tokenIndex:a,tokenLine:k,tokenColumn:h}=n;C(n,e&-16385|8192,67174408),d.push(R2(n,e,m,y,a,k,h,!1)),g.push(z(n,e,u,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn)),n.getToken()!==1074790415&&c(n,83)}{let{tokenValue:m,tokenRaw:y,tokenIndex:a,tokenLine:k,tokenColumn:h}=n;C(n,e,67174409),d.push(R2(n,e,m,y,a,k,h,!0))}return s(n,e,i,l,f,{type:"TemplateLiteral",expressions:g,quasis:d})}function R2(n,e,u,t,o,i,l,f){let d=s(n,e,o,i,l,{type:"TemplateElement",value:{cooked:u,raw:t},tail:f}),g=f?1:2;return e&2&&(d.start+=1,d.range[0]+=1,d.end-=g,d.range[1]-=g),e&4&&(d.loc.start.column+=1,d.loc.end.column-=g),d}function Qu(n,e,u,t,o,i){e=(e|33554432)^33554432,C(n,e|8192,14);let l=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.assignable=1,s(n,e,t,o,i,{type:"SpreadElement",argument:l})}function yn(n,e,u,t){b(n,e|8192);let o=[];if(n.getToken()===16)return b(n,e|16384),o;for(;n.getToken()!==16&&(n.getToken()===14?o.push(Qu(n,e,u,n.tokenIndex,n.tokenLine,n.tokenColumn)):o.push(M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn)),!(n.getToken()!==18||(b(n,e|8192),n.getToken()===16))););return C(n,e|16384,16),o}function R(n,e){let{tokenValue:u,tokenIndex:t,tokenLine:o,tokenColumn:i}=n,l=u==="await"&&(n.getToken()&-2147483648)===0;return b(n,e|(l?8192:0)),s(n,e,t,o,i,{type:"Identifier",name:u})}function H(n,e){let{tokenValue:u,tokenRaw:t,tokenIndex:o,tokenLine:i,tokenColumn:l}=n;return n.getToken()===134283388?ue(n,e,o,i,l):(b(n,e),n.assignable=2,s(n,e,o,i,l,e&128?{type:"Literal",value:u,raw:t}:{type:"Literal",value:u}))}function Zu(n,e,u,t,o){let i=V[n.getToken()&255],l=n.getToken()===86023?null:i==="true";return b(n,e),n.assignable=2,s(n,e,u,t,o,e&128?{type:"Literal",value:l,raw:i}:{type:"Literal",value:l})}function Gu(n,e){let{tokenIndex:u,tokenLine:t,tokenColumn:o}=n;return b(n,e),n.assignable=2,s(n,e,u,t,o,{type:"ThisExpression"})}function f2(n,e,u,t,o,i,l,f,d,g,m){b(n,e|8192);let y=i?dn(n,e,8391476):0,a=null,k,h=u?a2():void 0;if(n.getToken()===67174411)(l&1)===0&&c(n,39,"Function");else{let v=o&4&&((e&2048)===0||(e&512)===0)?4:64|(f?1024:0)|(y?1024:0);$n(n,e,n.getToken()),u&&(v&4?Yn(n,e,u,n.tokenValue,v):d2(n,e,u,n.tokenValue,v,o),h=j(h,256),l&&l&2&&g2(n,n.tokenValue)),k=n.getToken(),n.getToken()&143360?a=R(n,e):c(n,30,V[n.getToken()&255])}let T=7274496;e=(e|T)^T|16777216|(f?524288:0)|(y?262144:0)|(y?0:67108864),u&&(h=j(h,512));let E=oe(n,(e|2097152)&-268435457,h,t,0,1),w=268471296,I=W2(n,(e|w)^w|8388608|1048576,u?j(h,128):h,t,8,k,h==null?void 0:h.scopeError);return s(n,e,d,g,m,{type:"FunctionDeclaration",id:a,params:E,body:I,async:f===1,generator:y===1})}function te(n,e,u,t,o,i,l,f){b(n,e|8192);let d=dn(n,e,8391476),g=(t?524288:0)|(d?262144:0),m=null,y,a=e&16?a2():void 0,k=275709952;n.getToken()&143360&&($n(n,(e|k)^k|g,n.getToken()),a&&(a=j(a,256)),y=n.getToken(),m=R(n,e)),e=(e|k)^k|16777216|g|(d?0:67108864),a&&(a=j(a,512));let h=oe(n,(e|2097152)&-268435457,a,u,o,1),T=W2(n,e&-33594369|8388608|1048576,a&&j(a,128),u,0,y,a==null?void 0:a.scopeError);return n.assignable=2,s(n,e,i,l,f,{type:"FunctionExpression",id:m,params:h,body:T,async:t===1,generator:d===1})}function xu(n,e,u,t,o,i,l,f){let d=Q(n,e,void 0,u,t,o,0,2,0,i,l,f);return n.destructible&64&&c(n,63),n.destructible&8&&c(n,62),d}function Q(n,e,u,t,o,i,l,f,d,g,m,y){b(n,e|8192);let a=[],k=0;for(e=(e|33554432)^33554432;n.getToken()!==20;)if(P(n,e|8192,18))a.push(null);else{let T,{tokenIndex:E,tokenLine:w,tokenColumn:I,tokenValue:v}=n,q=n.getToken();if(q&143360)if(T=_(n,e,t,f,0,1,i,1,E,w,I),n.getToken()===1077936155){n.assignable&2&&c(n,26),b(n,e|8192),u&&n2(n,e,u,v,f,d);let F=M(n,e,t,1,i,n.tokenIndex,n.tokenLine,n.tokenColumn);T=s(n,e,E,w,I,l?{type:"AssignmentPattern",left:T,right:F}:{type:"AssignmentExpression",operator:"=",left:T,right:F}),k|=n.destructible&256?256:0|n.destructible&128?128:0}else n.getToken()===18||n.getToken()===20?(n.assignable&2?k|=16:u&&n2(n,e,u,v,f,d),k|=n.destructible&256?256:0|n.destructible&128?128:0):(k|=f&1?32:(f&2)===0?16:0,T=O(n,e,t,T,i,0,E,w,I),n.getToken()!==18&&n.getToken()!==20?(n.getToken()!==1077936155&&(k|=16),T=J(n,e,t,i,l,E,w,I,T)):n.getToken()!==1077936155&&(k|=n.assignable&2?16:32));else q&2097152?(T=n.getToken()===2162700?Z(n,e,u,t,0,i,l,f,d,E,w,I):Q(n,e,u,t,0,i,l,f,d,E,w,I),k|=n.destructible,n.assignable=n.destructible&16?2:1,n.getToken()===18||n.getToken()===20?n.assignable&2&&(k|=16):n.destructible&8?c(n,71):(T=O(n,e,t,T,i,0,E,w,I),k=n.assignable&2?16:0,n.getToken()!==18&&n.getToken()!==20?T=J(n,e,t,i,l,E,w,I,T):n.getToken()!==1077936155&&(k|=n.assignable&2?16:32))):q===14?(T=b2(n,e,u,t,20,f,d,0,i,l,E,w,I),k|=n.destructible,n.getToken()!==18&&n.getToken()!==20&&c(n,30,V[n.getToken()&255])):(T=Y(n,e,t,1,0,1,E,w,I),n.getToken()!==18&&n.getToken()!==20?(T=J(n,e,t,i,l,E,w,I,T),(f&3)===0&&q===67174411&&(k|=16)):n.assignable&2?k|=16:q===67174411&&(k|=n.assignable&1&&f&3?32:16));if(a.push(T),P(n,e|8192,18)){if(n.getToken()===20)break}else break}C(n,e,20);let h=s(n,e,g,m,y,{type:l?"ArrayPattern":"ArrayExpression",elements:a});return!o&&n.getToken()&4194304?ie(n,e,t,k,i,l,g,m,y,h):(n.destructible=k,h)}function ie(n,e,u,t,o,i,l,f,d,g){n.getToken()!==1077936155&&c(n,26),b(n,e|8192),t&16&&c(n,26),i||r(n,g);let{tokenIndex:m,tokenLine:y,tokenColumn:a}=n,k=M(n,e,u,1,o,m,y,a);return n.destructible=(t|64|8)^72|(n.destructible&128?128:0)|(n.destructible&256?256:0),s(n,e,l,f,d,i?{type:"AssignmentPattern",left:g,right:k}:{type:"AssignmentExpression",left:g,operator:"=",right:k})}function b2(n,e,u,t,o,i,l,f,d,g,m,y,a){b(n,e|8192);let k=null,h=0,{tokenValue:T,tokenIndex:E,tokenLine:w,tokenColumn:I}=n,v=n.getToken();if(v&143360)n.assignable=1,k=_(n,e,t,i,0,1,d,1,E,w,I),v=n.getToken(),k=O(n,e,t,k,d,0,E,w,I),n.getToken()!==18&&n.getToken()!==o&&(n.assignable&2&&n.getToken()===1077936155&&c(n,71),h|=16,k=J(n,e,t,d,g,E,w,I,k)),n.assignable&2?h|=16:v===o||v===18?u&&n2(n,e,u,T,i,l):h|=32,h|=n.destructible&128?128:0;else if(v===o)c(n,41);else if(v&2097152)k=n.getToken()===2162700?Z(n,e,u,t,1,d,g,i,l,E,w,I):Q(n,e,u,t,1,d,g,i,l,E,w,I),v=n.getToken(),v!==1077936155&&v!==o&&v!==18?(n.destructible&8&&c(n,71),k=O(n,e,t,k,d,0,E,w,I),h|=n.assignable&2?16:0,(n.getToken()&4194304)===4194304?(n.getToken()!==1077936155&&(h|=16),k=J(n,e,t,d,g,E,w,I,k)):((n.getToken()&8388608)===8388608&&(k=l2(n,e,t,1,E,w,I,4,v,k)),P(n,e|8192,22)&&(k=c2(n,e,t,k,E,w,I)),h|=n.assignable&2?16:32)):h|=o===1074790415&&v!==1077936155?16:n.destructible;else{h|=32,k=Y(n,e,t,1,d,1,n.tokenIndex,n.tokenLine,n.tokenColumn);let{tokenIndex:q,tokenLine:F,tokenColumn:U}=n,D=n.getToken();return D===1077936155?(n.assignable&2&&c(n,26),k=J(n,e,t,d,g,q,F,U,k),h|=16):(D===18?h|=16:D!==o&&(k=J(n,e,t,d,g,q,F,U,k)),h|=n.assignable&1?32:16),n.destructible=h,n.getToken()!==o&&n.getToken()!==18&&c(n,161),s(n,e,m,y,a,{type:g?"RestElement":"SpreadElement",argument:k})}if(n.getToken()!==o)if(i&1&&(h|=f?16:32),P(n,e|8192,1077936155)){h&16&&c(n,26),r(n,k);let q=M(n,e,t,1,d,n.tokenIndex,n.tokenLine,n.tokenColumn);k=s(n,e,E,w,I,g?{type:"AssignmentPattern",left:k,right:q}:{type:"AssignmentExpression",left:k,operator:"=",right:q}),h=16}else h|=16;return n.destructible=h,s(n,e,m,y,a,{type:g?"RestElement":"SpreadElement",argument:k})}function x(n,e,u,t,o,i,l,f){var a;let d=2883584|((t&64)===0?4325376:0);e=(e|d)^d|(t&8?262144:0)|(t&16?524288:0)|(t&64?4194304:0)|65536|8388608|16777216;let g=e&16?j(a2(),512):void 0,m=pu(n,(e|2097152)&-268435457,g,u,t,1,o);g&&(g=j(g,128));let y=W2(n,e&-301992961|8388608|1048576,g,u,0,void 0,(a=g==null?void 0:g.parent)==null?void 0:a.scopeError);return s(n,e,i,l,f,{type:"FunctionExpression",params:m,body:y,async:(t&16)>0,generator:(t&8)>0,id:null})}function ru(n,e,u,t,o,i,l,f){let d=Z(n,e,void 0,u,t,o,0,2,0,i,l,f);return n.destructible&64&&c(n,63),n.destructible&8&&c(n,62),d}function Z(n,e,u,t,o,i,l,f,d,g,m,y){b(n,e);let a=[],k=0,h=0;for(e=(e|33554432)^33554432;n.getToken()!==1074790415;){let{tokenValue:E,tokenLine:w,tokenColumn:I,tokenIndex:v}=n,q=n.getToken();if(q===14)a.push(b2(n,e,u,t,1074790415,f,d,0,i,l,v,w,I));else{let F=0,U=null,D;if(n.getToken()&143360||n.getToken()===-2147483528||n.getToken()===-2147483527)if(n.getToken()===-2147483527&&(k|=16),U=R(n,e),n.getToken()===18||n.getToken()===1074790415||n.getToken()===1077936155)if(F|=4,e&256&&(q&537079808)===537079808?k|=16:J2(n,e,f,q,0),u&&n2(n,e,u,E,f,d),P(n,e|8192,1077936155)){k|=8;let B=M(n,e,t,1,i,n.tokenIndex,n.tokenLine,n.tokenColumn);k|=n.destructible&256?256:0|n.destructible&128?128:0,D=s(n,e,v,w,I,{type:"AssignmentPattern",left:e&134217728?Object.assign({},U):U,right:B})}else k|=(q===209006?128:0)|(q===-2147483528?16:0),D=e&134217728?Object.assign({},U):U;else if(P(n,e|8192,21)){let{tokenIndex:B,tokenLine:L,tokenColumn:S}=n;if(E==="__proto__"&&h++,n.getToken()&143360){let D2=n.getToken(),t2=n.tokenValue;D=_(n,e,t,f,0,1,i,1,B,L,S);let p=n.getToken();D=O(n,e,t,D,i,0,B,L,S),n.getToken()===18||n.getToken()===1074790415?p===1077936155||p===1074790415||p===18?(k|=n.destructible&128?128:0,n.assignable&2?k|=16:u&&(D2&143360)===143360&&n2(n,e,u,t2,f,d)):k|=n.assignable&1?32:16:(n.getToken()&4194304)===4194304?(n.assignable&2?k|=16:p!==1077936155?k|=32:u&&n2(n,e,u,t2,f,d),D=J(n,e,t,i,l,B,L,S,D)):(k|=16,(n.getToken()&8388608)===8388608&&(D=l2(n,e,t,1,B,L,S,4,p,D)),P(n,e|8192,22)&&(D=c2(n,e,t,D,B,L,S)))}else(n.getToken()&2097152)===2097152?(D=n.getToken()===69271571?Q(n,e,u,t,0,i,l,f,d,B,L,S):Z(n,e,u,t,0,i,l,f,d,B,L,S),k=n.destructible,n.assignable=k&16?2:1,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):n.destructible&8?c(n,71):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&2?16:0,(n.getToken()&4194304)===4194304?D=N2(n,e,t,i,l,B,L,S,D):((n.getToken()&8388608)===8388608&&(D=l2(n,e,t,1,B,L,S,4,q,D)),P(n,e|8192,22)&&(D=c2(n,e,t,D,B,L,S)),k|=n.assignable&2?16:32))):(D=Y(n,e,t,1,i,1,B,L,S),k|=n.assignable&1?32:16,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&2?16:0,n.getToken()!==18&&q!==1074790415&&(n.getToken()!==1077936155&&(k|=16),D=J(n,e,t,i,l,B,L,S,D))))}else n.getToken()===69271571?(k|=16,q===209005&&(F|=16),F|=(q===12400?256:q===12401?512:1)|2,U=y2(n,e,t,i),k|=n.assignable,D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):n.getToken()&143360?(k|=16,q===-2147483528&&c(n,95),q===209005?(n.flags&1&&c(n,132),F|=17):q===12400?F|=256:q===12401?F|=512:c(n,0),U=R(n,e),D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):n.getToken()===67174411?(k|=16,F|=1,D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):n.getToken()===8391476?(k|=16,q===12400?c(n,42):q===12401?c(n,43):q!==209005&&c(n,30,V[52]),b(n,e),F|=9|(q===209005?16:0),n.getToken()&143360?U=R(n,e):(n.getToken()&134217728)===134217728?U=H(n,e):n.getToken()===69271571?(F|=2,U=y2(n,e,t,i),k|=n.assignable):c(n,30,V[n.getToken()&255]),D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):(n.getToken()&134217728)===134217728?(q===209005&&(F|=16),F|=q===12400?256:q===12401?512:1,k|=16,U=H(n,e),D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):c(n,133);else if((n.getToken()&134217728)===134217728)if(U=H(n,e),n.getToken()===21){C(n,e|8192,21);let{tokenIndex:B,tokenLine:L,tokenColumn:S}=n;if(E==="__proto__"&&h++,n.getToken()&143360){D=_(n,e,t,f,0,1,i,1,B,L,S);let{tokenValue:D2}=n,t2=n.getToken();D=O(n,e,t,D,i,0,B,L,S),n.getToken()===18||n.getToken()===1074790415?t2===1077936155||t2===1074790415||t2===18?n.assignable&2?k|=16:u&&n2(n,e,u,D2,f,d):k|=n.assignable&1?32:16:n.getToken()===1077936155?(n.assignable&2&&(k|=16),D=J(n,e,t,i,l,B,L,S,D)):(k|=16,D=J(n,e,t,i,l,B,L,S,D))}else(n.getToken()&2097152)===2097152?(D=n.getToken()===69271571?Q(n,e,u,t,0,i,l,f,d,B,L,S):Z(n,e,u,t,0,i,l,f,d,B,L,S),k=n.destructible,n.assignable=k&16?2:1,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):(n.destructible&8)!==8&&(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&2?16:0,(n.getToken()&4194304)===4194304?D=N2(n,e,t,i,l,B,L,S,D):((n.getToken()&8388608)===8388608&&(D=l2(n,e,t,1,B,L,S,4,q,D)),P(n,e|8192,22)&&(D=c2(n,e,t,D,B,L,S)),k|=n.assignable&2?16:32))):(D=Y(n,e,t,1,0,1,B,L,S),k|=n.assignable&1?32:16,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&1?0:16,n.getToken()!==18&&n.getToken()!==1074790415&&(n.getToken()!==1077936155&&(k|=16),D=J(n,e,t,i,l,B,L,S,D))))}else n.getToken()===67174411?(F|=1,D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn),k=n.assignable|16):c(n,134);else if(n.getToken()===69271571)if(U=y2(n,e,t,i),k|=n.destructible&256?256:0,F|=2,n.getToken()===21){b(n,e|8192);let{tokenIndex:B,tokenLine:L,tokenColumn:S,tokenValue:D2}=n,t2=n.getToken();if(n.getToken()&143360){D=_(n,e,t,f,0,1,i,1,B,L,S);let p=n.getToken();D=O(n,e,t,D,i,0,B,L,S),(n.getToken()&4194304)===4194304?(k|=n.assignable&2?16:p===1077936155?0:32,D=N2(n,e,t,i,l,B,L,S,D)):n.getToken()===18||n.getToken()===1074790415?p===1077936155||p===1074790415||p===18?n.assignable&2?k|=16:u&&(t2&143360)===143360&&n2(n,e,u,D2,f,d):k|=n.assignable&1?32:16:(k|=16,D=J(n,e,t,i,l,B,L,S,D))}else(n.getToken()&2097152)===2097152?(D=n.getToken()===69271571?Q(n,e,u,t,0,i,l,f,d,B,L,S):Z(n,e,u,t,0,i,l,f,d,B,L,S),k=n.destructible,n.assignable=k&16?2:1,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):k&8?c(n,62):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&2?k|16:0,(n.getToken()&4194304)===4194304?(n.getToken()!==1077936155&&(k|=16),D=N2(n,e,t,i,l,B,L,S,D)):((n.getToken()&8388608)===8388608&&(D=l2(n,e,t,1,B,L,S,4,q,D)),P(n,e|8192,22)&&(D=c2(n,e,t,D,B,L,S)),k|=n.assignable&2?16:32))):(D=Y(n,e,t,1,0,1,B,L,S),k|=n.assignable&1?32:16,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&1?0:16,n.getToken()!==18&&n.getToken()!==1074790415&&(n.getToken()!==1077936155&&(k|=16),D=J(n,e,t,i,l,B,L,S,D))))}else n.getToken()===67174411?(F|=1,D=x(n,e,t,F,i,n.tokenIndex,w,I),k=16):c(n,44);else if(q===8391476)if(C(n,e|8192,8391476),F|=8,n.getToken()&143360){let B=n.getToken();U=R(n,e),F|=1,n.getToken()===67174411?(k|=16,D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):$(n.tokenIndex,n.tokenLine,n.tokenColumn,n.index,n.line,n.column,B===209005?46:B===12400||n.getToken()===12401?45:47,V[B&255])}else(n.getToken()&134217728)===134217728?(k|=16,U=H(n,e),F|=1,D=x(n,e,t,F,i,v,w,I)):n.getToken()===69271571?(k|=16,F|=3,U=y2(n,e,t,i),D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):c(n,126);else c(n,30,V[q&255]);k|=n.destructible&128?128:0,n.destructible=k,a.push(s(n,e,v,w,I,{type:"Property",key:U,value:D,kind:F&768?F&512?"set":"get":"init",computed:(F&2)>0,method:(F&1)>0,shorthand:(F&4)>0}))}if(k|=n.destructible,n.getToken()!==18)break;b(n,e)}C(n,e,1074790415),h>1&&(k|=64);let T=s(n,e,g,m,y,{type:l?"ObjectPattern":"ObjectExpression",properties:a});return!o&&n.getToken()&4194304?ie(n,e,t,k,i,l,g,m,y,T):(n.destructible=k,T)}function pu(n,e,u,t,o,i,l){C(n,e,67174411);let f=[];if(n.flags=(n.flags|128)^128,n.getToken()===16)return o&512&&c(n,37,"Setter","one",""),b(n,e),f;o&256&&c(n,37,"Getter","no","s"),o&512&&n.getToken()===14&&c(n,38),e=(e|33554432)^33554432;let d=0,g=0;for(;n.getToken()!==18;){let m=null,{tokenIndex:y,tokenLine:a,tokenColumn:k}=n;if(n.getToken()&143360?((e&256)===0&&((n.getToken()&36864)===36864&&(n.flags|=256),(n.getToken()&537079808)===537079808&&(n.flags|=512)),m=An(n,e,u,o|1,0,y,a,k)):(n.getToken()===2162700?m=Z(n,e,u,t,1,l,1,i,0,y,a,k):n.getToken()===69271571?m=Q(n,e,u,t,1,l,1,i,0,y,a,k):n.getToken()===14&&(m=b2(n,e,u,t,16,i,0,0,l,1,y,a,k)),g=1,n.destructible&48&&c(n,50)),n.getToken()===1077936155){b(n,e|8192),g=1;let h=M(n,e,t,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);m=s(n,e,y,a,k,{type:"AssignmentPattern",left:m,right:h})}if(d++,f.push(m),!P(n,e,18)||n.getToken()===16)break}return o&512&&d!==1&&c(n,37,"Setter","one",""),u&&u.scopeError&&z2(u.scopeError),g&&(n.flags|=128),C(n,e,16),f}function y2(n,e,u,t){b(n,e|8192);let o=M(n,(e|33554432)^33554432,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn);return C(n,e,20),o}function n1(n,e,u,t,o,i,l,f,d){n.flags=(n.flags|128)^128;let{tokenIndex:g,tokenLine:m,tokenColumn:y}=n;b(n,e|8192|67108864);let a=e&16?j(a2(),1024):void 0;if(e=(e|33554432)^33554432,P(n,e,16))return X2(n,e,a,u,[],t,0,l,f,d);let k=0;n.destructible&=-385;let h,T=[],E=0,w=0,I=0,{tokenIndex:v,tokenLine:q,tokenColumn:F}=n;for(n.assignable=1;n.getToken()!==16;){let{tokenIndex:U,tokenLine:D,tokenColumn:B}=n,L=n.getToken();if(L&143360)a&&d2(n,e,a,n.tokenValue,1,0),(L&537079808)===537079808?w=1:(L&36864)===36864&&(I=1),h=_(n,e,u,o,0,1,1,1,U,D,B),n.getToken()===16||n.getToken()===18?n.assignable&2&&(k|=16,w=1):(n.getToken()===1077936155?w=1:k|=16,h=O(n,e,u,h,1,0,U,D,B),n.getToken()!==16&&n.getToken()!==18&&(h=J(n,e,u,1,0,U,D,B,h)));else if((L&2097152)===2097152)h=L===2162700?Z(n,e|67108864,a,u,0,1,0,o,i,U,D,B):Q(n,e|67108864,a,u,0,1,0,o,i,U,D,B),k|=n.destructible,w=1,n.assignable=2,n.getToken()!==16&&n.getToken()!==18&&(k&8&&c(n,122),h=O(n,e,u,h,0,0,U,D,B),k|=16,n.getToken()!==16&&n.getToken()!==18&&(h=J(n,e,u,0,0,U,D,B,h)));else if(L===14){h=b2(n,e,a,u,16,o,i,0,1,0,U,D,B),n.destructible&16&&c(n,74),w=1,E&&(n.getToken()===16||n.getToken()===18)&&T.push(h),k|=8;break}else{if(k|=16,h=M(n,e,u,1,1,U,D,B),E&&(n.getToken()===16||n.getToken()===18)&&T.push(h),n.getToken()===18&&(E||(E=1,T=[h])),E){for(;P(n,e|8192,18);)T.push(M(n,e,u,1,1,n.tokenIndex,n.tokenLine,n.tokenColumn));n.assignable=2,h=s(n,e,v,q,F,{type:"SequenceExpression",expressions:T})}return C(n,e,16),n.destructible=k,h}if(E&&(n.getToken()===16||n.getToken()===18)&&T.push(h),!P(n,e|8192,18))break;if(E||(E=1,T=[h]),n.getToken()===16){k|=8;break}}return E&&(n.assignable=2,h=s(n,e,v,q,F,{type:"SequenceExpression",expressions:T})),C(n,e,16),k&16&&k&8&&c(n,151),k|=n.destructible&256?256:0|n.destructible&128?128:0,n.getToken()===10?(k&48&&c(n,49),e&524800&&k&128&&c(n,31),e&262400&&k&256&&c(n,32),w&&(n.flags|=128),I&&(n.flags|=256),X2(n,e,a,u,E?T:[h],t,0,l,f,d)):(k&64&&c(n,63),k&8&&c(n,144),n.destructible=(n.destructible|256)^256|k,e&32?s(n,e,g,m,y,{type:"ParenthesizedExpression",expression:h}):h)}function sn(n,e,u,t,o,i){let{tokenValue:l}=n,f=0,d=0;(n.getToken()&537079808)===537079808?f=1:(n.getToken()&36864)===36864&&(d=1);let g=R(n,e);if(n.assignable=1,n.getToken()===10){let m;return e&16&&(m=K2(n,e,l)),f&&(n.flags|=128),d&&(n.flags|=256),F2(n,e,m,u,[g],0,t,o,i)}return g}function _2(n,e,u,t,o,i,l,f,d,g,m){l||c(n,57),i&&c(n,51),n.flags&=-129;let y=e&16?K2(n,e,t):void 0;return F2(n,e,y,u,[o],f,d,g,m)}function X2(n,e,u,t,o,i,l,f,d,g){i||c(n,57);for(let m=0;m0&&n.tokenValue==="constructor"&&c(n,109),n.getToken()===1074790415&&c(n,108),P(n,e,1074790417)){E>0&&c(n,120);continue}h.push(de(n,e,t,y,u,i,T,0,f,n.tokenIndex,n.tokenLine,n.tokenColumn))}return C(n,l&8?e|8192:e,1074790415),y&&fu(y),n.flags=n.flags&-33|k,s(n,e,d,g,m,{type:"ClassBody",body:h})}function de(n,e,u,t,o,i,l,f,d,g,m,y){let a=f?32:0,k=null,{tokenIndex:h,tokenLine:T,tokenColumn:E}=n,w=n.getToken();if(w&176128||w===-2147483528)switch(k=R(n,e),w){case 36970:if(!f&&n.getToken()!==67174411&&(n.getToken()&1048576)!==1048576&&n.getToken()!==1077936155)return de(n,e,u,t,o,i,l,1,d,g,m,y);break;case 209005:if(n.getToken()!==67174411&&(n.flags&1)===0){if((n.getToken()&1073741824)===1073741824)return T2(n,e,t,k,a,l,h,T,E);a|=16|(dn(n,e,8391476)?8:0)}break;case 12400:if(n.getToken()!==67174411){if((n.getToken()&1073741824)===1073741824)return T2(n,e,t,k,a,l,h,T,E);a|=256}break;case 12401:if(n.getToken()!==67174411){if((n.getToken()&1073741824)===1073741824)return T2(n,e,t,k,a,l,h,T,E);a|=512}break;case 12402:if(n.getToken()!==67174411&&(n.flags&1)===0){if((n.getToken()&1073741824)===1073741824)return T2(n,e,t,k,a,l,h,T,E);e&1&&(a|=1024)}break}else if(w===69271571)a|=2,k=y2(n,o,t,d);else if((w&134217728)===134217728)k=H(n,e);else if(w===8391476)a|=8,b(n,e);else if(n.getToken()===130)a|=8192,k=H2(n,e|4096,t,768,h,T,E);else if((n.getToken()&1073741824)===1073741824)a|=128;else{if(f&&w===2162700)return Su(n,e|4096,u,t,h,T,E);w===-2147483527?(k=R(n,e),n.getToken()!==67174411&&c(n,30,V[n.getToken()&255])):c(n,30,V[n.getToken()&255])}if(a&1816&&(n.getToken()&143360||n.getToken()===-2147483528||n.getToken()===-2147483527?k=R(n,e):(n.getToken()&134217728)===134217728?k=H(n,e):n.getToken()===69271571?(a|=2,k=y2(n,e,t,0)):n.getToken()===130?(a|=8192,k=H2(n,e,t,a,h,T,E)):c(n,135)),(a&2)===0&&(n.tokenValue==="constructor"?((n.getToken()&1073741824)===1073741824?c(n,129):(a&32)===0&&n.getToken()===67174411&&(a&920?c(n,53,"accessor"):(e&131072)===0&&(n.flags&32?c(n,54):n.flags|=32)),a|=64):(a&8192)===0&&a&32&&n.tokenValue==="prototype"&&c(n,52)),a&1024||n.getToken()!==67174411&&(a&768)===0)return T2(n,e,t,k,a,l,h,T,E);let I=x(n,e|4096,t,a,d,n.tokenIndex,n.tokenLine,n.tokenColumn);return s(n,e,g,m,y,{type:"MethodDefinition",kind:(a&32)===0&&a&64?"constructor":a&256?"get":a&512?"set":"method",static:(a&32)>0,computed:(a&2)>0,key:k,value:I,...e&1?{decorators:l}:null})}function H2(n,e,u,t,o,i,l){b(n,e);let{tokenValue:f}=n;return f==="constructor"&&c(n,128),e&16&&(u||c(n,4,f),t?ou(n,u,f,t):lu(n,u,f)),b(n,e),s(n,e,o,i,l,{type:"PrivateIdentifier",name:f})}function T2(n,e,u,t,o,i,l,f,d){let g=null;if(o&8&&c(n,0),n.getToken()===1077936155){b(n,e|8192);let{tokenIndex:m,tokenLine:y,tokenColumn:a}=n;n.getToken()===537079927&&c(n,119);let k=2883584|((o&64)===0?4325376:0);e=(e|k)^k|(o&8?262144:0)|(o&16?524288:0)|(o&64?4194304:0)|65536|16777216,g=_(n,e|4096,u,2,0,1,0,1,m,y,a),((n.getToken()&1073741824)!==1073741824||(n.getToken()&4194304)===4194304)&&(g=O(n,e|4096,u,g,0,0,m,y,a),g=J(n,e|4096,u,0,0,m,y,a,g))}return K(n,e),s(n,e,l,f,d,{type:o&1024?"AccessorProperty":"PropertyDefinition",key:t,value:g,static:(o&32)>0,computed:(o&2)>0,...e&1?{decorators:i}:null})}function ge(n,e,u,t,o,i,l,f,d){if(n.getToken()&143360||(e&256)===0&&n.getToken()===-2147483527)return An(n,e,u,o,i,l,f,d);(n.getToken()&2097152)!==2097152&&c(n,30,V[n.getToken()&255]);let g=n.getToken()===69271571?Q(n,e,u,t,1,0,1,o,i,l,f,d):Z(n,e,u,t,1,0,1,o,i,l,f,d);return n.destructible&16&&c(n,50),n.destructible&32&&c(n,50),g}function An(n,e,u,t,o,i,l,f){let{tokenValue:d}=n,g=n.getToken();return e&256&&((g&537079808)===537079808?c(n,119):((g&36864)===36864||g===-2147483527)&&c(n,118)),(g&20480)===20480&&c(n,102),g===241771&&(e&262144&&c(n,32),e&512&&c(n,111)),(g&255)===73&&t&24&&c(n,100),g===209006&&(e&524288&&c(n,176),e&512&&c(n,110)),b(n,e),u&&n2(n,e,u,d,t,o),s(n,e,i,l,f,{type:"Identifier",name:d})}function Q2(n,e,u,t,o,i,l){if(t||C(n,e,8456256),n.getToken()===8390721){let m=l1(n,e,o,i,l),[y,a]=c1(n,e,u,t);return s(n,e,o,i,l,{type:"JSXFragment",openingFragment:m,children:y,closingFragment:a})}n.getToken()===8457014&&c(n,30,V[n.getToken()&255]);let f=null,d=[],g=a1(n,e,u,t,o,i,l);if(!g.selfClosing){[d,f]=g1(n,e,u,t);let m=j2(f.name);j2(g.name)!==m&&c(n,155,m)}return s(n,e,o,i,l,{type:"JSXElement",children:d,openingElement:g,closingElement:f})}function l1(n,e,u,t,o){return w2(n,e),s(n,e,u,t,o,{type:"JSXOpeningFragment"})}function f1(n,e,u,t,o,i){C(n,e,8457014);let l=me(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.getToken()!==8390721&&c(n,25,V[65]),u?w2(n,e):b(n,e),s(n,e,t,o,i,{type:"JSXClosingElement",name:l})}function d1(n,e,u,t,o,i){return C(n,e,8457014),n.getToken()!==8390721&&c(n,25,V[65]),u?w2(n,e):b(n,e),s(n,e,t,o,i,{type:"JSXClosingFragment"})}function g1(n,e,u,t){let o=[];for(;;){let i=m1(n,e,u,t,n.tokenIndex,n.tokenLine,n.tokenColumn);if(i.type==="JSXClosingElement")return[o,i];o.push(i)}}function c1(n,e,u,t){let o=[];for(;;){let i=k1(n,e,u,t,n.tokenIndex,n.tokenLine,n.tokenColumn);if(i.type==="JSXClosingFragment")return[o,i];o.push(i)}}function m1(n,e,u,t,o,i,l){if(n.getToken()===137)return ce(n,e,o,i,l);if(n.getToken()===2162700)return bn(n,e,u,1,0,o,i,l);if(n.getToken()===8456256)return b(n,e),n.getToken()===8457014?f1(n,e,t,o,i,l):Q2(n,e,u,1,o,i,l);c(n,0)}function k1(n,e,u,t,o,i,l){if(n.getToken()===137)return ce(n,e,o,i,l);if(n.getToken()===2162700)return bn(n,e,u,1,0,o,i,l);if(n.getToken()===8456256)return b(n,e),n.getToken()===8457014?d1(n,e,t,o,i,l):Q2(n,e,u,1,o,i,l);c(n,0)}function ce(n,e,u,t,o){b(n,e);let i={type:"JSXText",value:n.tokenValue};return e&128&&(i.raw=n.tokenRaw),s(n,e,u,t,o,i)}function a1(n,e,u,t,o,i,l){(n.getToken()&143360)!==143360&&(n.getToken()&4096)!==4096&&c(n,0);let f=me(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn),d=s1(n,e,u),g=n.getToken()===8457014;return g&&C(n,e,8457014),n.getToken()!==8390721&&c(n,25,V[65]),t||!g?w2(n,e):b(n,e),s(n,e,o,i,l,{type:"JSXOpeningElement",name:f,attributes:d,selfClosing:g})}function me(n,e,u,t,o){r2(n);let i=Z2(n,e,u,t,o);if(n.getToken()===21)return ke(n,e,i,u,t,o);for(;P(n,e,67108877);)r2(n),i=y1(n,e,i,u,t,o);return i}function y1(n,e,u,t,o,i){let l=Z2(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn);return s(n,e,t,o,i,{type:"JSXMemberExpression",object:u,property:l})}function s1(n,e,u){let t=[];for(;n.getToken()!==8457014&&n.getToken()!==8390721&&n.getToken()!==1048576;)t.push(A1(n,e,u,n.tokenIndex,n.tokenLine,n.tokenColumn));return t}function h1(n,e,u,t,o,i){b(n,e),C(n,e,14);let l=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);return C(n,e,1074790415),s(n,e,t,o,i,{type:"JSXSpreadAttribute",argument:l})}function A1(n,e,u,t,o,i){if(n.getToken()===2162700)return h1(n,e,u,t,o,i);r2(n);let l=null,f=Z2(n,e,t,o,i);if(n.getToken()===21&&(f=ke(n,e,f,t,o,i)),n.getToken()===1077936155){let d=nu(n,e),{tokenIndex:g,tokenLine:m,tokenColumn:y}=n;switch(d){case 134283267:l=H(n,e);break;case 8456256:l=Q2(n,e,u,0,g,m,y);break;case 2162700:l=bn(n,e,u,0,1,g,m,y);break;default:c(n,154)}}return s(n,e,t,o,i,{type:"JSXAttribute",value:l,name:f})}function ke(n,e,u,t,o,i){C(n,e,21);let l=Z2(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn);return s(n,e,t,o,i,{type:"JSXNamespacedName",namespace:u,name:l})}function bn(n,e,u,t,o,i,l,f){b(n,e|8192);let{tokenIndex:d,tokenLine:g,tokenColumn:m}=n;if(n.getToken()===14)return b1(n,e,u,i,l,f);let y=null;return n.getToken()===1074790415?(o&&c(n,157),y=D1(n,e,n.startIndex,n.startLine,n.startColumn)):y=M(n,e,u,1,0,d,g,m),n.getToken()!==1074790415&&c(n,25,V[15]),t?w2(n,e):b(n,e),s(n,e,i,l,f,{type:"JSXExpressionContainer",expression:y})}function b1(n,e,u,t,o,i){C(n,e,14);let l=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);return C(n,e,1074790415),s(n,e,t,o,i,{type:"JSXSpreadChild",expression:l})}function D1(n,e,u,t,o){return n.startIndex=n.tokenIndex,n.startLine=n.tokenLine,n.startColumn=n.tokenColumn,s(n,e,u,t,o,{type:"JSXEmptyExpression"})}function Z2(n,e,u,t,o){n.getToken()&143360||c(n,30,V[n.getToken()&255]);let{tokenValue:i}=n;return b(n,e),s(n,e,u,t,o,{type:"JSXIdentifier",name:i})}function ae(n,e){return ku(n,e,0)}function T1(n,e){let u=new SyntaxError(n+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(u,e)}var ye=T1;function C1(n){let e=[];for(let u of n)try{return u()}catch(t){e.push(t)}throw Object.assign(new Error("All combinations failed"),{errors:e})}var se=C1;var E1=(n,e,u)=>{if(!(n&&e==null))return Array.isArray(e)||typeof e=="string"?e[u<0?e.length+u:u]:e.at(u)},Dn=E1;function w1(n){return Array.isArray(n)&&n.length>0}var he=w1;function G(n){var t,o,i;let e=((t=n.range)==null?void 0:t[0])??n.start,u=(i=((o=n.declaration)==null?void 0:o.decorators)??n.decorators)==null?void 0:i[0];return u?Math.min(G(u),e):e}function u2(n){var e;return((e=n.range)==null?void 0:e[1])??n.end}function B1(n){let e=new Set(n);return u=>e.has(u==null?void 0:u.type)}var Ae=B1;var I1=Ae(["Block","CommentBlock","MultiLine"]),q2=I1;function L1(n){let e=`*${n.value}*`.split(` +`);return e.length>1&&e.every(u=>u.trimStart()[0]==="*")}var Tn=L1;function F1(n){return q2(n)&&n.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(n.value)}var be=F1;var S2=null;function P2(n){if(S2!==null&&typeof S2.property){let e=S2;return S2=P2.prototype=null,e}return S2=P2.prototype=n??Object.create(null),new P2}var q1=10;for(let n=0;n<=q1;n++)P2();function Cn(n){return P2(n)}function S1(n,e="type"){Cn(n);function u(t){let o=t[e],i=n[o];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${o}'.`),{node:t});return i}return u}var De=S1;var Te={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var P1=De(Te),Ce=P1;function En(n,e){if(!(n!==null&&typeof n=="object"))return n;if(Array.isArray(n)){for(let t=0;t{var l;(l=i.leadingComments)!=null&&l.some(be)&&o.add(G(i))}),n=G2(n,i=>{if(i.type==="ParenthesizedExpression"){let{expression:l}=i;if(l.type==="TypeCastExpression")return l.range=[...i.range],l;let f=G(i);if(!o.has(f))return l.extra={...l.extra,parenthesized:!0},l}})}if(n=G2(n,o=>{switch(o.type){case"LogicalExpression":if(Ee(o))return wn(o);break;case"VariableDeclaration":{let i=Dn(!1,o.declarations,-1);i!=null&&i.init&&t[u2(i)]!==";"&&(o.range=[G(o),u2(i)]);break}case"TSParenthesizedType":return o.typeAnnotation;case"TSTypeParameter":if(typeof o.name=="string"){let i=G(o);o.name={type:"Identifier",name:o.name,range:[i,i+o.name.length]}}break;case"TopicReference":n.extra={...n.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(o.types.length===1)return o.types[0];break}}),he(n.comments)){let o=Dn(!1,n.comments,-1);for(let i=n.comments.length-2;i>=0;i--){let l=n.comments[i];u2(l)===G(o)&&q2(l)&&q2(o)&&Tn(l)&&Tn(o)&&(n.comments.splice(i+1,1),l.value+="*//*"+o.value,l.range=[G(l),u2(o)]),o=l}}return n.type==="Program"&&(n.range=[0,t.length]),n}function Ee(n){return n.type==="LogicalExpression"&&n.right.type==="LogicalExpression"&&n.operator===n.right.operator}function wn(n){return Ee(n)?wn({type:"LogicalExpression",operator:n.operator,left:wn({type:"LogicalExpression",operator:n.operator,left:n.left,right:n.right.left,range:[G(n.left),u2(n.right.left)]}),right:n.right.right,range:[G(n),u2(n)]}):n}var we=v1;var N1=/\*\/$/,V1=/^\/\*\*?/,O1=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,R1=/(^|\s+)\/\/([^\n\r]*)/g,Be=/^(\r?\n)+/,U1=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,Ie=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,M1=/(\r?\n|^) *\* ?/g,J1=[];function Le(n){let e=n.match(O1);return e?e[0].trimStart():""}function Fe(n){let e=` +`;n=i2(!1,n.replace(V1,"").replace(N1,""),M1,"$1");let u="";for(;u!==n;)u=n,n=i2(!1,n,U1,`${e}$1 $2${e}`);n=n.replace(Be,"").trimEnd();let t=Object.create(null),o=i2(!1,n,Ie,"").replace(Be,"").trimEnd(),i;for(;i=Ie.exec(n);){let l=i2(!1,i[2],R1,"");if(typeof t[i[1]]=="string"||Array.isArray(t[i[1]])){let f=t[i[1]];t[i[1]]=[...J1,...Array.isArray(f)?f:[f],l]}else t[i[1]]=l}return{comments:o,pragmas:t}}function j1(n){if(!n.startsWith("#!"))return"";let e=n.indexOf(` +`);return e===-1?n:n.slice(0,e)}var qe=j1;function X1(n){let e=qe(n);e&&(n=n.slice(e.length+1));let u=Le(n),{pragmas:t,comments:o}=Fe(u);return{shebang:e,text:n,pragmas:t,comments:o}}function Se(n){let{pragmas:e}=X1(n);return Object.prototype.hasOwnProperty.call(e,"prettier")||Object.prototype.hasOwnProperty.call(e,"format")}function H1(n){return n=typeof n=="function"?{parse:n}:n,{astFormat:"estree",hasPragma:Se,locStart:G,locEnd:u2,...n}}var Pe=H1;function z1(n){let{filepath:e}=n;if(e){if(e=e.toLowerCase(),e.endsWith(".cjs")||e.endsWith(".cts"))return"script";if(e.endsWith(".mjs")||e.endsWith(".mts"))return"module"}}var ve=z1;var K1={next:!0,ranges:!0,webcompat:!0,loc:!0,raw:!0,directives:!0,globalReturn:!0,impliedStrict:!1,preserveParens:!1,lexical:!1,jsx:!0,uniqueKeyInPattern:!1};function $1(n,e){let u=[],t=[],o=ae(n,{...K1,module:e==="module",onComment:u,onToken:t});return o.comments=u,o.tokens=t,o}function W1(n){let{message:e,loc:u}=n;if(!u)return n;let t=`[${[u.start,u.end].map(({line:o,column:i})=>[o,i].join(":")).join("-")}]: `;return e.startsWith(t)&&(e=e.slice(t.length)),ye(e,{loc:{start:{line:u.start.line,column:u.start.column+1},end:{line:u.end.line,column:u.end.column+1}},cause:n})}function _1(n,e={}){let u=ve(e),t=(u?[u]:["module","script"]).map(i=>()=>$1(n,i)),o;try{o=se(t)}catch({errors:[i]}){throw W1(i)}return we(o,{parser:"meriyah",text:n})}var Y1=Pe(_1);return Ue(Q1);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/meriyah.mjs b/node_modules/prettier/plugins/meriyah.mjs new file mode 100644 index 0000000..bf1e175 --- /dev/null +++ b/node_modules/prettier/plugins/meriyah.mjs @@ -0,0 +1,4 @@ +var Ne=Object.defineProperty;var In=(n,e)=>{for(var u in e)Ne(n,u,{get:e[u],enumerable:!0})};var Bn={};In(Bn,{parsers:()=>wn});var wn={};In(wn,{meriyah:()=>K1});var Ve=(n,e,u,t)=>{if(!(n&&e==null))return e.replaceAll?e.replaceAll(u,t):u.global?e.replace(u,t):e.split(u).join(t)},i2=Ve;var Oe={0:"Unexpected token",30:"Unexpected token: '%0'",1:"Octal escape sequences are not allowed in strict mode",2:"Octal escape sequences are not allowed in template strings",3:"\\8 and \\9 are not allowed in template strings",4:"Private identifier #%0 is not defined",5:"Illegal Unicode escape sequence",6:"Invalid code point %0",7:"Invalid hexadecimal escape sequence",9:"Octal literals are not allowed in strict mode",8:"Decimal integer literals with a leading zero are forbidden in strict mode",10:"Expected number in radix %0",151:"Invalid left-hand side assignment to a destructible right-hand side",11:"Non-number found after exponent indicator",12:"Invalid BigIntLiteral",13:"No identifiers allowed directly after numeric literal",14:"Escapes \\8 or \\9 are not syntactically valid escapes",15:"Escapes \\8 or \\9 are not allowed in strict mode",16:"Unterminated string literal",17:"Unterminated template literal",18:"Multiline comment was not closed properly",19:"The identifier contained dynamic unicode escape that was not closed",20:"Illegal character '%0'",21:"Missing hexadecimal digits",22:"Invalid implicit octal",23:"Invalid line break in string literal",24:"Only unicode escapes are legal in identifier names",25:"Expected '%0'",26:"Invalid left-hand side in assignment",27:"Invalid left-hand side in async arrow",28:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',29:"Member access on super must be in a method",31:"Await expression not allowed in formal parameter",32:"Yield expression not allowed in formal parameter",95:"Unexpected token: 'escaped keyword'",33:"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses",123:"Async functions can only be declared at the top level or inside a block",34:"Unterminated regular expression",35:"Unexpected regular expression flag",36:"Duplicate regular expression flag '%0'",37:"%0 functions must have exactly %1 argument%2",38:"Setter function argument must not be a rest parameter",39:"%0 declaration must have a name in this context",40:"Function name may not contain any reserved words or be eval or arguments in strict mode",41:"The rest operator is missing an argument",42:"A getter cannot be a generator",43:"A setter cannot be a generator",44:"A computed property name must be followed by a colon or paren",134:"Object literal keys that are strings or numbers must be a method or have a colon",46:"Found `* async x(){}` but this should be `async * x(){}`",45:"Getters and setters can not be generators",47:"'%0' can not be generator method",48:"No line break is allowed after '=>'",49:"The left-hand side of the arrow can only be destructed through assignment",50:"The binding declaration is not destructible",51:"Async arrow can not be followed by new expression",52:"Classes may not have a static property named 'prototype'",53:"Class constructor may not be a %0",54:"Duplicate constructor method in class",55:"Invalid increment/decrement operand",56:"Invalid use of `new` keyword on an increment/decrement expression",57:"`=>` is an invalid assignment target",58:"Rest element may not have a trailing comma",59:"Missing initializer in %0 declaration",60:"'for-%0' loop head declarations can not have an initializer",61:"Invalid left-hand side in for-%0 loop: Must have a single binding",62:"Invalid shorthand property initializer",63:"Property name __proto__ appears more than once in object literal",64:"Let is disallowed as a lexically bound name",65:"Invalid use of '%0' inside new expression",66:"Illegal 'use strict' directive in function with non-simple parameter list",67:'Identifier "let" disallowed as left-hand side expression in strict mode',68:"Illegal continue statement",69:"Illegal break statement",70:"Cannot have `let[...]` as a var name in strict mode",71:"Invalid destructuring assignment target",72:"Rest parameter may not have a default initializer",73:"The rest argument must the be last parameter",74:"Invalid rest argument",76:"In strict mode code, functions can only be declared at top level or inside a block",77:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement",78:"Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement",79:"Class declaration can't appear in single-statement context",80:"Invalid left-hand side in for-%0",81:"Invalid assignment in for-%0",82:"for await (... of ...) is only valid in async functions and async generators",83:"The first token after the template expression should be a continuation of the template",85:"`let` declaration not allowed here and `let` cannot be a regular var name in strict mode",84:"`let \n [` is a restricted production at the start of a statement",86:"Catch clause requires exactly one parameter, not more (and no trailing comma)",87:"Catch clause parameter does not support default values",88:"Missing catch or finally after try",89:"More than one default clause in switch statement",90:"Illegal newline after throw",91:"Strict mode code may not include a with statement",92:"Illegal return statement",93:"The left hand side of the for-header binding declaration is not destructible",94:"new.target only allowed within functions or static blocks",96:"'#' not followed by identifier",102:"Invalid keyword",101:"Can not use 'let' as a class name",100:"'A lexical declaration can't define a 'let' binding",99:"Can not use `let` as variable name in strict mode",97:"'%0' may not be used as an identifier in this context",98:"Await is only valid in async functions",103:"The %0 keyword can only be used with the module goal",104:"Unicode codepoint must not be greater than 0x10FFFF",105:"%0 source must be string",106:"Only a identifier or string can be used to indicate alias",107:"Only '*' or '{...}' can be imported after default",108:"Trailing decorator may be followed by method",109:"Decorators can't be used with a constructor",110:"Can not use `await` as identifier in module or async func",111:"Can not use `await` as identifier in module",112:"HTML comments are only allowed with web compatibility (Annex B)",113:"The identifier 'let' must not be in expression position in strict mode",114:"Cannot assign to `eval` and `arguments` in strict mode",115:"The left-hand side of a for-of loop may not start with 'let'",116:"Block body arrows can not be immediately invoked without a group",117:"Block body arrows can not be immediately accessed without a group",118:"Unexpected strict mode reserved word",119:"Unexpected eval or arguments in strict mode",120:"Decorators must not be followed by a semicolon",121:"Calling delete on expression not allowed in strict mode",122:"Pattern can not have a tail",124:"Can not have a `yield` expression on the left side of a ternary",125:"An arrow function can not have a postfix update operator",126:"Invalid object literal key character after generator star",127:"Private fields can not be deleted",129:"Classes may not have a field called constructor",128:"Classes may not have a private element named constructor",130:"A class field initializer or static block may not contain arguments",131:"Generators can only be declared at the top level or inside a block",132:"Async methods are a restricted production and cannot have a newline following it",133:"Unexpected character after object literal property name",135:"Invalid key token",136:"Label '%0' has already been declared",137:"continue statement must be nested within an iteration statement",138:"Undefined label '%0'",139:"Trailing comma is disallowed inside import(...) arguments",140:"Invalid binding in JSON import",141:"import() requires exactly one argument",142:"Cannot use new with import(...)",143:"... is not allowed in import()",144:"Expected '=>'",145:"Duplicate binding '%0'",146:"Duplicate private identifier #%0",147:"Cannot export a duplicate name '%0'",150:"Duplicate %0 for-binding",148:"Exported binding '%0' needs to refer to a top-level declared variable",149:"Unexpected private field",153:"Numeric separators are not allowed at the end of numeric literals",152:"Only one underscore is allowed as numeric separator",154:"JSX value should be either an expression or a quoted JSX text",155:"Expected corresponding JSX closing tag for %0",156:"Adjacent JSX elements must be wrapped in an enclosing tag",157:"JSX attributes must only be assigned a non-empty 'expression'",158:"'%0' has already been declared",159:"'%0' shadowed a catch clause binding",160:"Dot property must be an identifier",161:"Encountered invalid input after spread/rest argument",162:"Catch without try",163:"Finally without try",164:"Expected corresponding closing tag for JSX fragment",165:"Coalescing and logical operators used together in the same expression must be disambiguated with parentheses",166:"Invalid tagged template on optional chain",167:"Invalid optional chain from super property",168:"Invalid optional chain from new expression",169:'Cannot use "import.meta" outside a module',170:"Leading decorators must be attached to a class declaration",171:"An export name cannot include a lone surrogate, found %0",172:"A string literal cannot be used as an exported binding without `from`",173:"Private fields can't be accessed on super",174:"The only valid meta property for import is 'import.meta'",175:"'import.meta' must not contain escaped characters",176:'cannot use "await" as identifier inside an async function',177:'cannot use "await" in static blocks'},m2=class extends SyntaxError{constructor(e,u,t,o,i,l,f,...d){let g="["+u+":"+t+"-"+i+":"+l+"]: "+Oe[f].replace(/%(\d+)/g,(m,y)=>d[y]);super(`${g}`),this.start=e,this.end=o,this.range=[e,o],this.loc={start:{line:u,column:t},end:{line:i,column:l}},this.description=g}};function c(n,e,...u){throw new m2(n.tokenIndex,n.tokenLine,n.tokenColumn,n.index,n.line,n.column,e,...u)}function z2(n){throw new m2(n.tokenIndex,n.tokenLine,n.tokenColumn,n.index,n.line,n.column,n.type,...n.params)}function $(n,e,u,t,o,i,l,...f){throw new m2(n,e,u,t,o,i,l,...f)}function h2(n,e,u,t,o,i,l){throw new m2(n,e,u,t,o,i,l)}function Re(n){return(On[(n>>>5)+0]>>>n&31&1)!==0}function Vn(n){return(On[(n>>>5)+34816]>>>n&31&1)!==0}var On=((n,e)=>{let u=new Uint32Array(104448),t=0,o=0;for(;t<3822;){let i=n[t++];if(i<0)o-=i;else{let l=n[t++];i&2&&(l=e[l]),i&1?u.fill(l,o,o+=n[t++]):u[o++]=l}}return u})([-1,2,26,2,27,2,5,-1,0,77595648,3,44,2,3,0,14,2,63,2,64,3,0,3,0,3168796671,0,4294956992,2,1,2,0,2,41,3,0,4,0,4294966523,3,0,4,2,16,2,65,2,0,0,4294836735,0,3221225471,0,4294901942,2,66,0,134152192,3,0,2,0,4294951935,3,0,2,0,2683305983,0,2684354047,2,18,2,0,0,4294961151,3,0,2,2,19,2,0,0,608174079,2,0,2,60,2,7,2,6,0,4286611199,3,0,2,2,1,3,0,3,0,4294901711,2,40,0,4089839103,0,2961209759,0,1342439375,0,4294543342,0,3547201023,0,1577204103,0,4194240,0,4294688750,2,2,0,80831,0,4261478351,0,4294549486,2,2,0,2967484831,0,196559,0,3594373100,0,3288319768,0,8469959,2,203,2,3,0,4093640191,0,660618719,0,65487,0,4294828015,0,4092591615,0,1616920031,0,982991,2,3,2,0,0,2163244511,0,4227923919,0,4236247022,2,71,0,4284449919,0,851904,2,4,2,12,0,67076095,-1,2,72,0,1073741743,0,4093607775,-1,0,50331649,0,3265266687,2,33,0,4294844415,0,4278190047,2,20,2,137,-1,3,0,2,2,23,2,0,2,10,2,0,2,15,2,22,3,0,10,2,74,2,0,2,75,2,76,2,77,2,0,2,78,2,0,2,11,0,261632,2,25,3,0,2,2,13,2,4,3,0,18,2,79,2,5,3,0,2,2,80,0,2151677951,2,29,2,9,0,909311,3,0,2,0,814743551,2,49,0,67090432,3,0,2,2,42,2,0,2,6,2,0,2,30,2,8,0,268374015,2,110,2,51,2,0,2,81,0,134153215,-1,2,7,2,0,2,8,0,2684354559,0,67044351,0,3221160064,2,17,-1,3,0,2,2,53,0,1046528,3,0,3,2,9,2,0,2,54,0,4294960127,2,10,2,6,2,11,0,4294377472,2,12,3,0,16,2,13,2,0,2,82,2,10,2,0,2,83,2,84,2,85,2,210,2,55,0,1048577,2,86,2,14,-1,2,14,0,131042,2,87,2,88,2,89,2,0,2,34,-83,3,0,7,0,1046559,2,0,2,15,2,0,0,2147516671,2,21,3,90,2,2,0,-16,2,91,0,524222462,2,4,2,0,0,4269801471,2,4,3,0,2,2,28,2,16,3,0,2,2,17,2,0,-1,2,18,-16,3,0,206,-2,3,0,692,2,73,-1,2,18,2,10,3,0,8,2,93,2,133,2,0,0,3220242431,3,0,3,2,19,2,94,2,95,3,0,2,2,96,2,0,2,97,2,46,2,0,0,4351,2,0,2,9,3,0,2,0,67043391,0,3909091327,2,0,2,24,2,9,2,20,3,0,2,0,67076097,2,8,2,0,2,21,0,67059711,0,4236247039,3,0,2,0,939524103,0,8191999,2,101,2,102,2,22,2,23,3,0,3,0,67057663,3,0,349,2,103,2,104,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,3774349439,2,105,2,106,3,0,2,2,19,2,107,3,0,10,2,10,2,18,2,0,2,47,2,0,2,31,2,108,2,25,0,1638399,2,183,2,109,3,0,3,2,20,2,26,2,27,2,5,2,28,2,0,2,8,2,111,-1,2,112,2,113,2,114,-1,3,0,3,2,12,-2,2,0,2,29,-3,2,163,-4,2,20,2,0,2,36,0,1,2,0,2,67,2,6,2,12,2,10,2,0,2,115,-1,3,0,4,2,10,2,23,2,116,2,7,2,0,2,117,2,0,2,118,2,119,2,120,2,0,2,9,3,0,9,2,21,2,30,2,31,2,121,2,122,-2,2,123,2,124,2,30,2,21,2,8,-2,2,125,2,30,2,32,-2,2,0,2,39,-2,0,4277137519,0,2269118463,-1,3,20,2,-1,2,33,2,38,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,48,2,0,0,4294950463,2,37,-7,2,0,0,203775,2,57,2,167,2,20,2,43,2,36,2,18,2,37,2,18,2,126,2,21,3,0,2,2,38,0,2151677888,2,0,2,12,0,4294901764,2,144,2,0,2,58,2,56,0,5242879,3,0,2,0,402644511,-1,2,128,2,39,0,3,-1,2,129,2,130,2,0,0,67045375,2,40,0,4226678271,0,3766565279,0,2039759,2,132,2,41,0,1046437,0,6,3,0,2,0,3288270847,0,3,3,0,2,0,67043519,-5,2,0,0,4282384383,0,1056964609,-1,3,0,2,0,67043345,-1,2,0,2,42,2,23,2,50,2,11,2,61,2,38,-5,2,0,2,12,-3,3,0,2,0,2147484671,2,134,0,4190109695,2,52,-2,2,135,0,4244635647,0,27,2,0,2,8,2,43,2,0,2,68,2,18,2,0,2,42,-6,2,0,2,45,2,59,2,44,2,45,2,46,2,47,0,8388351,-2,2,136,0,3028287487,2,48,2,138,0,33259519,2,49,-9,2,21,0,4294836223,0,3355443199,0,134152199,-2,2,69,-2,3,0,28,2,32,-3,3,0,3,2,17,3,0,6,2,50,-81,2,18,3,0,2,2,36,3,0,33,2,25,2,30,3,0,124,2,12,3,0,18,2,38,-213,2,0,2,32,-54,3,0,17,2,42,2,8,2,23,2,0,2,8,2,23,2,51,2,0,2,21,2,52,2,139,2,25,-13,2,0,2,53,-6,3,0,2,-4,3,0,2,0,4294936575,2,0,0,4294934783,-2,0,196635,3,0,191,2,54,3,0,38,2,30,2,55,2,34,-278,2,140,3,0,9,2,141,2,142,2,56,3,0,11,2,7,-72,3,0,3,2,143,0,1677656575,-130,2,26,-16,2,0,2,24,2,38,-16,0,4161266656,0,4071,2,205,-4,2,57,-13,3,0,2,2,58,2,0,2,145,2,146,2,62,2,0,2,147,2,148,2,149,3,0,10,2,150,2,151,2,22,3,58,2,3,152,2,3,59,2,0,4294954999,2,0,-16,2,0,2,92,2,0,0,2105343,0,4160749584,2,177,-34,2,8,2,154,-6,0,4194303871,0,4294903771,2,0,2,60,2,100,-3,2,0,0,1073684479,0,17407,-9,2,18,2,17,2,0,2,32,-14,2,18,2,32,-6,2,18,2,12,-15,2,155,3,0,6,0,8323103,-1,3,0,2,2,61,-37,2,62,2,156,2,157,2,158,2,159,2,160,-105,2,26,-32,3,0,1335,-1,3,0,129,2,32,3,0,6,2,10,3,0,180,2,161,3,0,233,2,162,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,130,2,25,-22250,3,0,7,2,25,-6130,3,5,2,-1,0,69207040,3,44,2,3,0,14,2,63,2,64,-3,0,3168731136,0,4294956864,2,1,2,0,2,41,3,0,4,0,4294966275,3,0,4,2,16,2,65,2,0,2,34,-1,2,18,2,66,-1,2,0,0,2047,0,4294885376,3,0,2,0,3145727,0,2617294944,0,4294770688,2,25,2,67,3,0,2,0,131135,2,98,0,70256639,0,71303167,0,272,2,42,2,6,0,32511,2,0,2,49,-1,2,99,2,68,0,4278255616,0,4294836227,0,4294549473,0,600178175,0,2952806400,0,268632067,0,4294543328,0,57540095,0,1577058304,0,1835008,0,4294688736,2,70,2,69,0,33554435,2,131,2,70,2,164,0,131075,0,3594373096,0,67094296,2,69,-1,0,4294828e3,0,603979263,0,654311424,0,3,0,4294828001,0,602930687,2,171,0,393219,0,4294828016,0,671088639,0,2154840064,0,4227858435,0,4236247008,2,71,2,38,-1,2,4,0,917503,2,38,-1,2,72,0,537788335,0,4026531935,-1,0,1,-1,2,33,2,73,0,7936,-3,2,0,0,2147485695,0,1010761728,0,4292984930,0,16387,2,0,2,15,2,22,3,0,10,2,74,2,0,2,75,2,76,2,77,2,0,2,78,2,0,2,12,-1,2,25,3,0,2,2,13,2,4,3,0,18,2,79,2,5,3,0,2,2,80,0,2147745791,3,19,2,0,122879,2,0,2,9,0,276824064,-2,3,0,2,2,42,2,0,0,4294903295,2,0,2,30,2,8,-1,2,18,2,51,2,0,2,81,2,49,-1,2,21,2,0,2,29,-2,0,128,-2,2,28,2,9,0,8160,-1,2,127,0,4227907585,2,0,2,37,2,0,2,50,2,184,2,10,2,6,2,11,-1,0,74440192,3,0,6,-2,3,0,8,2,13,2,0,2,82,2,10,2,0,2,83,2,84,2,85,-3,2,86,2,14,-3,2,87,2,88,2,89,2,0,2,34,-83,3,0,7,0,817183,2,0,2,15,2,0,0,33023,2,21,3,90,2,-17,2,91,0,524157950,2,4,2,0,2,92,2,4,2,0,2,22,2,28,2,16,3,0,2,2,17,2,0,-1,2,18,-16,3,0,206,-2,3,0,692,2,73,-1,2,18,2,10,3,0,8,2,93,0,3072,2,0,0,2147516415,2,10,3,0,2,2,25,2,94,2,95,3,0,2,2,96,2,0,2,97,2,46,0,4294965179,0,7,2,0,2,9,2,95,2,9,-1,0,1761345536,2,98,0,4294901823,2,38,2,20,2,99,2,35,2,100,0,2080440287,2,0,2,34,2,153,0,3296722943,2,0,0,1046675455,0,939524101,0,1837055,2,101,2,102,2,22,2,23,3,0,3,0,7,3,0,349,2,103,2,104,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,2700607615,2,105,2,106,3,0,2,2,19,2,107,3,0,10,2,10,2,18,2,0,2,47,2,0,2,31,2,108,-3,2,109,3,0,3,2,20,-1,3,5,2,2,110,2,0,2,8,2,111,-1,2,112,2,113,2,114,-1,3,0,3,2,12,-2,2,0,2,29,-8,2,20,2,0,2,36,-1,2,0,2,67,2,6,2,30,2,10,2,0,2,115,-1,3,0,4,2,10,2,18,2,116,2,7,2,0,2,117,2,0,2,118,2,119,2,120,2,0,2,9,3,0,9,2,21,2,30,2,31,2,121,2,122,-2,2,123,2,124,2,30,2,21,2,8,-2,2,125,2,30,2,32,-2,2,0,2,39,-2,0,4277075969,2,30,-1,3,20,2,-1,2,33,2,126,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,50,2,98,0,4294934591,2,37,-7,2,0,0,197631,2,57,-1,2,20,2,43,2,37,2,18,0,3,2,18,2,126,2,21,2,127,2,54,-1,0,2490368,2,127,2,25,2,18,2,34,2,127,2,38,0,4294901904,0,4718591,2,127,2,35,0,335544350,-1,2,128,0,2147487743,0,1,-1,2,129,2,130,2,8,-1,2,131,2,70,0,3758161920,0,3,2,132,0,12582911,0,655360,-1,2,0,2,29,0,2147485568,0,3,2,0,2,25,0,176,-5,2,0,2,17,2,192,-1,2,0,2,25,2,209,-1,2,0,0,16779263,-2,2,12,-1,2,38,-5,2,0,2,133,-3,3,0,2,2,55,2,134,0,2147549183,0,2,-2,2,135,2,36,0,10,0,4294965249,0,67633151,0,4026597376,2,0,0,536871935,2,18,2,0,2,42,-6,2,0,0,1,2,59,2,17,0,1,2,46,2,25,-3,2,136,2,36,2,137,2,138,0,16778239,-10,2,35,0,4294836212,2,9,-3,2,69,-2,3,0,28,2,32,-3,3,0,3,2,17,3,0,6,2,50,-81,2,18,3,0,2,2,36,3,0,33,2,25,0,126,3,0,124,2,12,3,0,18,2,38,-213,2,10,-55,3,0,17,2,42,2,8,2,18,2,0,2,8,2,18,2,60,2,0,2,25,2,50,2,139,2,25,-13,2,0,2,73,-6,3,0,2,-4,3,0,2,0,67583,-1,2,107,-2,0,11,3,0,191,2,54,3,0,38,2,30,2,55,2,34,-278,2,140,3,0,9,2,141,2,142,2,56,3,0,11,2,7,-72,3,0,3,2,143,2,144,-187,3,0,2,2,58,2,0,2,145,2,146,2,62,2,0,2,147,2,148,2,149,3,0,10,2,150,2,151,2,22,3,58,2,3,152,2,3,59,2,2,153,-57,2,8,2,154,-7,2,18,2,0,2,60,-4,2,0,0,1065361407,0,16384,-9,2,18,2,60,2,0,2,133,-14,2,18,2,133,-6,2,18,0,81919,-15,2,155,3,0,6,2,126,-1,3,0,2,0,2063,-37,2,62,2,156,2,157,2,158,2,159,2,160,-138,3,0,1335,-1,3,0,129,2,32,3,0,6,2,10,3,0,180,2,161,3,0,233,2,162,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,130,2,25,-28386,2,0,0,1,-1,2,55,2,0,0,8193,-21,2,201,0,10255,0,4,-11,2,69,2,182,-1,0,71680,-1,2,174,0,4292900864,0,268435519,-5,2,163,-1,2,173,-1,0,6144,-2,2,46,-1,2,168,-1,0,2147532800,2,164,2,170,0,8355840,-2,0,4,-4,2,198,0,205128192,0,1333757536,0,2147483696,0,423953,0,747766272,0,2717763192,0,4286578751,0,278545,2,165,0,4294886464,0,33292336,0,417809,2,165,0,1327482464,0,4278190128,0,700594195,0,1006647527,0,4286497336,0,4160749631,2,166,0,201327104,0,3634348576,0,8323120,2,166,0,202375680,0,2678047264,0,4293984304,2,166,-1,0,983584,0,48,0,58720273,0,3489923072,0,10517376,0,4293066815,0,1,2,213,2,167,2,0,0,2089,0,3221225552,0,201359520,2,0,-2,0,256,0,122880,0,16777216,2,163,0,4160757760,2,0,-6,2,179,-11,0,3263218176,-1,0,49664,0,2160197632,0,8388802,-1,0,12713984,-1,2,168,2,186,2,187,-2,2,175,-20,0,3758096385,-2,2,169,2,195,2,94,2,180,0,4294057984,-2,2,176,2,172,0,4227874816,-2,2,169,-1,2,170,-1,2,181,2,55,0,4026593280,0,14,0,4292919296,-1,2,178,0,939588608,-1,0,805306368,-1,2,55,2,171,2,172,2,173,2,211,2,0,-2,0,8192,-4,0,267386880,-1,0,117440512,0,7168,-1,2,170,2,168,2,174,2,188,-16,2,175,-1,0,1426112704,2,176,-1,2,196,0,271581216,0,2149777408,2,25,2,174,2,55,0,851967,2,189,-1,2,177,2,190,-4,2,178,-20,2,98,2,208,-56,0,3145728,2,191,-10,0,32505856,-1,2,179,-1,0,2147385088,2,94,1,2155905152,2,-3,2,176,2,0,0,67108864,-2,2,180,-6,2,181,2,25,0,1,-1,0,1,-1,2,182,-3,2,126,2,69,-2,2,100,-2,0,32704,2,55,-915,2,183,-1,2,207,-10,2,194,-5,2,185,-6,0,3759456256,2,19,-1,2,184,-1,2,185,-2,0,4227874752,-3,0,2146435072,2,186,-2,0,1006649344,2,55,-1,2,94,0,201375744,-3,0,134217720,2,94,0,4286677377,0,32896,-1,2,178,-3,0,4227907584,-349,0,65520,0,1920,2,167,3,0,264,-11,2,173,-2,2,187,2,0,0,520617856,0,2692743168,0,36,-3,0,524280,-13,2,193,-1,0,4294934272,2,25,2,187,-1,2,215,0,2158720,-3,2,186,0,1,-4,2,55,0,3808625411,0,3489628288,0,4096,0,1207959680,0,3221274624,2,0,-3,2,188,0,120,0,7340032,-2,2,189,2,4,2,25,2,176,3,0,4,2,186,-1,2,190,2,167,-1,0,8176,2,170,2,188,0,1073741824,-1,0,4290773232,2,0,-4,2,176,2,197,0,15728640,2,167,-1,2,174,-1,0,134250480,0,4720640,0,3825467396,-1,2,180,-9,2,94,2,181,0,4294967040,2,137,0,4160880640,3,0,2,0,704,0,1849688064,2,191,-1,2,55,0,4294901887,2,0,0,130547712,0,1879048192,2,212,3,0,2,-1,2,192,2,193,-1,0,17829776,0,2025848832,0,4261477888,-2,2,0,-1,0,4286580608,-1,0,29360128,2,200,0,16252928,0,3791388672,2,130,3,0,2,-2,2,206,2,0,-1,2,107,-1,0,66584576,-1,2,199,-1,0,448,0,4294918080,3,0,6,2,55,-1,0,4294755328,0,4294967267,2,7,-1,2,174,2,187,2,25,2,98,2,25,2,194,2,94,-2,0,245760,2,195,-1,2,163,2,202,0,4227923456,-1,2,196,2,174,2,94,-3,0,4292870145,0,262144,-1,2,95,2,0,0,1073758848,2,197,-1,0,4227921920,2,198,0,68289024,0,528402016,0,4292927536,0,46080,2,191,0,4265609306,0,4294967289,-2,0,268435456,2,95,-2,2,199,3,0,5,-1,2,200,2,176,2,0,-2,0,4227923936,2,67,-1,2,187,2,197,2,99,2,168,2,178,2,204,3,0,5,-1,2,167,3,0,3,-2,0,2146959360,0,9440640,0,104857600,0,4227923840,3,0,2,0,768,2,201,2,28,-2,2,174,-2,2,202,-1,2,169,2,98,3,0,5,-1,0,4227923964,0,512,0,8388608,2,203,2,183,2,193,0,4286578944,3,0,2,0,1152,0,1266679808,2,199,0,576,0,4261707776,2,98,3,0,9,2,169,0,131072,0,939524096,2,188,3,0,2,2,16,-1,0,2147221504,-28,2,187,3,0,3,-3,0,4292902912,-6,2,99,3,0,81,2,25,-2,2,107,-33,2,18,2,181,-124,2,188,-18,2,204,3,0,213,-1,2,187,3,0,54,-17,2,169,2,55,2,205,-1,2,55,2,197,0,4290822144,-2,0,67174336,0,520093700,2,18,3,0,13,-1,2,187,3,0,6,-2,2,188,3,0,3,-2,0,30720,-1,0,32512,3,0,2,0,4294770656,-191,2,185,-38,2,181,2,8,2,206,3,0,278,0,2417033215,-9,0,4294705144,0,4292411391,0,65295,-11,2,167,3,0,72,-3,0,3758159872,0,201391616,3,0,123,-7,2,187,-13,2,180,3,0,2,-1,2,173,2,207,-3,2,99,2,0,-7,2,181,-1,0,384,-1,0,133693440,-3,2,208,-2,2,110,3,0,3,3,180,2,-2,2,94,2,169,3,0,4,-2,2,196,-1,2,163,0,335552923,2,209,-1,0,538974272,0,2214592512,0,132e3,-10,0,192,-8,2,210,-21,0,134213632,2,162,3,0,34,2,55,0,4294965279,3,0,6,0,100663424,0,63524,-1,2,214,2,152,3,0,3,-1,0,3221282816,0,4294917120,3,0,9,2,25,2,211,-1,2,212,3,0,14,2,25,2,187,3,0,6,2,25,2,213,3,0,15,0,2147520640,-6,0,4286578784,2,0,-2,0,1006694400,3,0,24,2,36,-1,0,4292870144,3,0,2,0,1,2,176,3,0,6,2,209,0,4110942569,0,1432950139,0,2701658217,0,4026532864,0,4026532881,2,0,2,47,3,0,8,-1,2,178,-2,2,180,0,98304,0,65537,2,181,-5,2,214,2,0,2,37,2,202,2,167,0,4294770176,2,110,3,0,4,-30,2,192,0,3758153728,-3,0,125829120,-2,2,187,0,4294897664,2,178,-1,2,199,-1,2,174,0,4026580992,2,95,2,0,-10,2,180,0,3758145536,0,31744,-1,0,1610628992,0,4261477376,-4,2,215,-2,2,187,3,0,32,-1335,2,0,-129,2,187,-6,2,176,-180,0,65532,-233,2,177,-18,2,176,3,0,77,-16,2,176,3,0,47,-154,2,170,-130,2,18,3,0,22250,-7,2,18,3,0,6128],[4294967295,4294967291,4092460543,4294828031,4294967294,134217726,4294903807,268435455,2147483647,1048575,1073741823,3892314111,134217727,1061158911,536805376,4294910143,4294901759,32767,4294901760,262143,536870911,8388607,4160749567,4294902783,4294918143,65535,67043328,2281701374,4294967264,2097151,4194303,255,67108863,4294967039,511,524287,131071,63,127,3238002687,4294549487,4290772991,33554431,4294901888,4286578687,67043329,4294705152,4294770687,67043583,1023,15,2047999,67043343,67051519,16777215,2147483648,4294902e3,28,4292870143,4294966783,16383,67047423,4294967279,262083,20511,41943039,493567,4294959104,603979775,65536,602799615,805044223,4294965206,8191,1031749119,4294917631,2134769663,4286578493,4282253311,4294942719,33540095,4294905855,2868854591,1608515583,265232348,534519807,2147614720,1060109444,4093640016,17376,2139062143,224,4169138175,4294909951,4286578688,4294967292,4294965759,535511039,4294966272,4294967280,32768,8289918,4294934399,4294901775,4294965375,1602223615,4294967259,4294443008,268369920,4292804608,4294967232,486341884,4294963199,3087007615,1073692671,4128527,4279238655,4294902015,4160684047,4290246655,469499899,4294967231,134086655,4294966591,2445279231,3670015,31,4294967288,4294705151,3221208447,4294902271,4294549472,4294921215,4095,4285526655,4294966527,4294966143,64,4294966719,3774873592,1877934080,262151,2555904,536807423,67043839,3758096383,3959414372,3755993023,2080374783,4294835295,4294967103,4160749565,4294934527,4087,2016,2147446655,184024726,2862017156,1593309078,268434431,268434414,4294901763,4294901761,536870912,2952790016,202506752,139264,4026531840,402653184,4261412864,63488,1610612736,4227922944,49152,65280,3233808384,3221225472,65534,61440,57152,4293918720,4290772992,25165824,57344,4227915776,4278190080,3758096384,4227858432,4160749568,3758129152,4294836224,4194304,251658240,196608,4294963200,2143289344,2097152,64512,417808,4227923712,12582912,50331648,65528,65472,4294967168,15360,4294966784,65408,4294965248,16,12288,4294934528,2080374784,2013265920,4294950912,524288]);function A(n){return n.column++,n.currentChar=n.source.charCodeAt(++n.index)}function un(n){let e=n.currentChar;if((e&64512)!==55296)return 0;let u=n.source.charCodeAt(n.index+1);return(u&64512)!==56320?0:65536+((e&1023)<<10)+(u&1023)}function tn(n,e){n.currentChar=n.source.charCodeAt(++n.index),n.flags|=1,(e&4)===0&&(n.column=0,n.line++)}function k2(n){n.flags|=1,n.currentChar=n.source.charCodeAt(++n.index),n.column=0,n.line++}function Ue(n){return n===160||n===65279||n===133||n===5760||n>=8192&&n<=8203||n===8239||n===8287||n===12288||n===8201||n===65519}function W(n){return n<65?n-48:n-65+10&15}function Me(n){switch(n){case 134283266:return"NumericLiteral";case 134283267:return"StringLiteral";case 86021:case 86022:return"BooleanLiteral";case 86023:return"NullLiteral";case 65540:return"RegularExpression";case 67174408:case 67174409:case 131:return"TemplateLiteral";default:return(n&143360)===143360?"Identifier":(n&4096)===4096?"Keyword":"Punctuator"}}var N=[0,0,0,0,0,0,0,0,0,0,1032,0,0,2056,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8192,0,3,0,0,8192,0,0,0,256,0,33024,0,0,242,242,114,114,114,114,114,114,594,594,0,0,16384,0,0,0,0,67,67,67,67,67,67,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,1,0,0,4099,0,71,71,71,71,71,71,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,16384,0,0,0,0],Je=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],Rn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function M2(n){return n<=127?Je[n]>0:Vn(n)}function V2(n){return n<=127?Rn[n]>0:Re(n)||n===8204||n===8205}var Un=["SingleLine","MultiLine","HTMLOpen","HTMLClose","HashbangComment"];function je(n){let{source:e}=n;n.currentChar===35&&e.charCodeAt(n.index+1)===33&&(A(n),A(n),on(n,e,0,4,n.tokenIndex,n.tokenLine,n.tokenColumn))}function Ln(n,e,u,t,o,i,l,f){return t&512&&c(n,0),on(n,e,u,o,i,l,f)}function on(n,e,u,t,o,i,l){let{index:f}=n;for(n.tokenIndex=n.index,n.tokenLine=n.line,n.tokenColumn=n.column;n.index=n.source.length)return c(n,34)}let o=n.index-1,i=X.Empty,l=n.currentChar,{index:f}=n;for(;V2(l);){switch(l){case 103:i&X.Global&&c(n,36,"g"),i|=X.Global;break;case 105:i&X.IgnoreCase&&c(n,36,"i"),i|=X.IgnoreCase;break;case 109:i&X.Multiline&&c(n,36,"m"),i|=X.Multiline;break;case 117:i&X.Unicode&&c(n,36,"u"),i&X.UnicodeSets&&c(n,36,"vu"),i|=X.Unicode;break;case 118:i&X.Unicode&&c(n,36,"uv"),i&X.UnicodeSets&&c(n,36,"v"),i|=X.UnicodeSets;break;case 121:i&X.Sticky&&c(n,36,"y"),i|=X.Sticky;break;case 115:i&X.DotAll&&c(n,36,"s"),i|=X.DotAll;break;case 100:i&X.Indices&&c(n,36,"d"),i|=X.Indices;break;default:c(n,35)}l=A(n)}let d=n.source.slice(f,n.index),g=n.source.slice(u,o);return n.tokenRegExp={pattern:g,flags:d},e&128&&(n.tokenRaw=n.source.slice(n.tokenIndex,n.index)),n.tokenValue=ze(n,g,d),65540}function ze(n,e,u){try{return new RegExp(e,u)}catch{try{return new RegExp(e,u),null}catch{c(n,34)}}}function Ke(n,e,u){let{index:t}=n,o="",i=A(n),l=n.index;for(;(N[i]&8)===0;){if(i===u)return o+=n.source.slice(l,n.index),A(n),e&128&&(n.tokenRaw=n.source.slice(t,n.index)),n.tokenValue=o,134283267;if((i&8)===8&&i===92){if(o+=n.source.slice(l,n.index),i=A(n),i<127||i===8232||i===8233){let f=Mn(n,e,i);f>=0?o+=String.fromCodePoint(f):Jn(n,f,0)}else o+=String.fromCodePoint(i);l=n.index+1}n.index>=n.end&&c(n,16),i=A(n)}c(n,16)}function Mn(n,e,u,t=0){switch(u){case 98:return 8;case 102:return 12;case 114:return 13;case 110:return 10;case 116:return 9;case 118:return 11;case 13:if(n.index1114111)return-5;return n.currentChar<1||n.currentChar!==125?-4:i}else{if((N[o]&64)===0)return-4;let i=n.source.charCodeAt(n.index+1);if((N[i]&64)===0)return-4;let l=n.source.charCodeAt(n.index+2);if((N[l]&64)===0)return-4;let f=n.source.charCodeAt(n.index+3);return(N[f]&64)===0?-4:(n.index+=3,n.column+=3,n.currentChar=n.source.charCodeAt(n.index),W(o)<<12|W(i)<<8|W(l)<<4|W(f))}}case 56:case 57:if(t||(e&64)===0||e&256)return-3;n.flags|=4096;default:return u}}function Jn(n,e,u){switch(e){case-1:return;case-2:c(n,u?2:1);case-3:c(n,u?3:14);case-4:c(n,7);case-5:c(n,104)}}function jn(n,e){let{index:u}=n,t=67174409,o="",i=A(n);for(;i!==96;){if(i===36&&n.source.charCodeAt(n.index+1)===123){A(n),t=67174408;break}else if(i===92)if(i=A(n),i>126)o+=String.fromCodePoint(i);else{let{index:l,line:f,column:d}=n,g=Mn(n,e|256,i,1);if(g>=0)o+=String.fromCodePoint(g);else if(g!==-1&&e&16384){n.index=l,n.line=f,n.column=d,o=null,i=$e(n,i),i<0&&(t=67174408);break}else Jn(n,g,1)}else n.index=n.end&&c(n,17),i=A(n)}return A(n),n.tokenValue=o,n.tokenRaw=n.source.slice(u+1,n.index-(t===67174409?1:2)),t}function $e(n,e){for(;e!==96;){switch(e){case 36:{let u=n.index+1;if(u=n.end&&c(n,17),e=A(n)}return e}function We(n,e){return n.index>=n.end&&c(n,0),n.index--,n.column--,jn(n,e)}function Fn(n,e,u){let t=n.currentChar,o=0,i=9,l=u&64?0:1,f=0,d=0;if(u&64)o="."+v2(n,t),t=n.currentChar,t===110&&c(n,12);else{if(t===48)if(t=A(n),(t|32)===120){for(u=136,t=A(n);N[t]&4160;){if(t===95){d||c(n,152),d=0,t=A(n);continue}d=1,o=o*16+W(t),f++,t=A(n)}(f===0||!d)&&c(n,f===0?21:153)}else if((t|32)===111){for(u=132,t=A(n);N[t]&4128;){if(t===95){d||c(n,152),d=0,t=A(n);continue}d=1,o=o*8+(t-48),f++,t=A(n)}(f===0||!d)&&c(n,f===0?0:153)}else if((t|32)===98){for(u=130,t=A(n);N[t]&4224;){if(t===95){d||c(n,152),d=0,t=A(n);continue}d=1,o=o*2+(t-48),f++,t=A(n)}(f===0||!d)&&c(n,f===0?0:153)}else if(N[t]&32)for(e&256&&c(n,1),u=1;N[t]&16;){if(N[t]&512){u=32,l=0;break}o=o*8+(t-48),t=A(n)}else N[t]&512?(e&256&&c(n,1),n.flags|=64,u=32):t===95&&c(n,0);if(u&48){if(l){for(;i>=0&&N[t]&4112;){if(t===95){t=A(n),(t===95||u&32)&&h2(n.index,n.line,n.column,n.index+1,n.line,n.column,152),d=1;continue}d=0,o=10*o+(t-48),t=A(n),--i}if(d&&h2(n.index,n.line,n.column,n.index+1,n.line,n.column,153),i>=0&&!M2(t)&&t!==46)return n.tokenValue=o,e&128&&(n.tokenRaw=n.source.slice(n.tokenIndex,n.index)),134283266}o+=v2(n,t),t=n.currentChar,t===46&&(A(n)===95&&c(n,0),u=64,o+="."+v2(n,n.currentChar),t=n.currentChar)}}let g=n.index,m=0;if(t===110&&u&128)m=1,t=A(n);else if((t|32)===101){t=A(n),N[t]&256&&(t=A(n));let{index:y}=n;(N[t]&16)===0&&c(n,11),o+=n.source.substring(g,y)+v2(n,t),t=n.currentChar}return(n.index","(","{",".","...","}",")",";",",","[","]",":","?","'",'"',"++","--","=","<<=",">>=",">>>=","**=","+=","-=","*=","/=","%=","^=","|=","&=","||=","&&=","??=","typeof","delete","void","!","~","+","-","in","instanceof","*","%","/","**","&&","||","===","!==","==","!=","<=",">=","<",">","<<",">>",">>>","&","|","^","var","let","const","break","case","catch","class","continue","debugger","default","do","else","export","extends","finally","for","function","if","import","new","return","super","switch","this","throw","try","while","with","implements","interface","package","private","protected","public","static","yield","as","async","await","constructor","get","set","accessor","from","of","enum","eval","arguments","escaped keyword","escaped future reserved keyword","reserved if strict","#","BigIntLiteral","??","?.","WhiteSpace","Illegal","LineTerminator","PrivateField","Template","@","target","meta","LineFeed","Escaped","JSXText"],Xn=Object.create(null,{this:{value:86111},function:{value:86104},if:{value:20569},return:{value:20572},var:{value:86088},else:{value:20563},for:{value:20567},new:{value:86107},in:{value:8673330},typeof:{value:16863275},while:{value:20578},case:{value:20556},break:{value:20555},try:{value:20577},catch:{value:20557},delete:{value:16863276},throw:{value:86112},switch:{value:86110},continue:{value:20559},default:{value:20561},instanceof:{value:8411187},do:{value:20562},void:{value:16863277},finally:{value:20566},async:{value:209005},await:{value:209006},class:{value:86094},const:{value:86090},constructor:{value:12399},debugger:{value:20560},export:{value:20564},extends:{value:20565},false:{value:86021},from:{value:12403},get:{value:12400},implements:{value:36964},import:{value:86106},interface:{value:36965},let:{value:241737},null:{value:86023},of:{value:274548},package:{value:36966},private:{value:36967},protected:{value:36968},public:{value:36969},set:{value:12401},static:{value:36970},super:{value:86109},true:{value:86022},with:{value:20579},yield:{value:241771},enum:{value:86133},eval:{value:537079926},as:{value:77932},arguments:{value:537079927},target:{value:209029},meta:{value:209030},accessor:{value:12402}});function qn(n,e,u){for(;Rn[A(n)];);return n.tokenValue=n.source.slice(n.tokenIndex,n.index),n.currentChar!==92&&n.currentChar<=126?Xn[n.tokenValue]||208897:ln(n,e,0,u)}function _e(n,e){let u=Hn(n);return M2(u)||c(n,5),n.tokenValue=String.fromCodePoint(u),ln(n,e,1,N[u]&4)}function ln(n,e,u,t){let o=n.index;for(;n.index0)V2(l)||c(n,20,String.fromCodePoint(l)),n.currentChar=l,n.index++,n.column++;else if(!V2(n.currentChar))break;A(n)}n.index<=n.end&&(n.tokenValue+=n.source.slice(o,n.index));let{length:i}=n.tokenValue;if(t&&i>=2&&i<=11){let l=Xn[n.tokenValue];return l===void 0?208897|(u?-2147483648:0):u?l===209006?(e&524800)===0?l|-2147483648:-2147483528:e&256?l===36970||(l&36864)===36864?-2147483527:(l&20480)===20480?e&67108864&&(e&2048)===0?l|-2147483648:-2147483528:-2147274630:e&67108864&&(e&2048)===0&&(l&20480)===20480?l|-2147483648:l===241771?e&67108864?-2147274630:e&262144?-2147483528:l|-2147483648:l===209005?-2147274630:(l&36864)===36864?l|12288|-2147483648:-2147483528:l}return 208897|(u?-2147483648:0)}function Ye(n){let e=A(n);if(e===92)return 130;let u=un(n);return u&&(e=u),M2(e)||c(n,96),130}function Hn(n){return n.source.charCodeAt(n.index+1)!==117&&c(n,5),n.currentChar=n.source.charCodeAt(n.index+=2),Qe(n)}function Qe(n){let e=0,u=n.currentChar;if(u===123){let l=n.index-2;for(;N[A(n)]&64;)e=e<<4|W(n.currentChar),e>1114111&&h2(l,n.line,n.column,n.index,n.line,n.column,104);return n.currentChar!==125&&h2(l,n.line,n.column,n.index,n.line,n.column,7),A(n),e}(N[u]&64)===0&&c(n,7);let t=n.source.charCodeAt(n.index+1);(N[t]&64)===0&&c(n,7);let o=n.source.charCodeAt(n.index+2);(N[o]&64)===0&&c(n,7);let i=n.source.charCodeAt(n.index+3);return(N[i]&64)===0&&c(n,7),e=W(u)<<12|W(t)<<8|W(o)<<4|W(i),n.currentChar=n.source.charCodeAt(n.index+=4),e}var Ze=[128,128,128,128,128,128,128,128,128,127,135,127,127,129,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,127,16842798,134283267,130,208897,8391477,8390213,134283267,67174411,16,8391476,25233968,18,25233969,67108877,8457014,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,21,1074790417,8456256,1077936155,8390721,22,132,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,69271571,136,20,8389959,208897,131,4096,4096,4096,4096,4096,4096,4096,208897,4096,208897,208897,4096,208897,4096,208897,4096,208897,4096,4096,4096,208897,4096,4096,208897,4096,4096,2162700,8389702,1074790415,16842799,128];function b(n,e){n.flags=(n.flags|1)^1,n.startIndex=n.index,n.startColumn=n.column,n.startLine=n.line,n.setToken(zn(n,e,0))}function zn(n,e,u){let t=n.index===0,{source:o}=n,i=n.index,l=n.line,f=n.column;for(;n.index=n.end)return 8391476;let m=n.currentChar;return m===61?(A(n),4194338):m!==42?8391476:A(n)!==61?8391735:(A(n),4194335)}case 8389959:return A(n)!==61?8389959:(A(n),4194341);case 25233968:{A(n);let m=n.currentChar;return m===43?(A(n),33619993):m===61?(A(n),4194336):25233968}case 25233969:{A(n);let m=n.currentChar;if(m===45){if(A(n),(u&1||t)&&n.currentChar===62){(e&64)===0&&c(n,112),A(n),u=Ln(n,o,u,e,3,i,l,f),i=n.tokenIndex,l=n.tokenLine,f=n.tokenColumn;continue}return 33619994}return m===61?(A(n),4194337):25233969}case 8457014:{if(A(n),n.index=48&&m<=57)return Fn(n,e,80);if(m===46){let y=n.index+1;if(y=48&&m<=57)))return A(n),67108990}return 22}}}else{if((d^8232)<=1){u=u&-5|1,k2(n);continue}let g=un(n);if(g>0&&(d=g),Vn(d))return n.tokenValue="",ln(n,e,0,0);if(Ue(d)){A(n);continue}c(n,20,String.fromCodePoint(d))}}return 1048576}function Ge(n,e){return n.startIndex=n.tokenIndex=n.index,n.startColumn=n.tokenColumn=n.column,n.startLine=n.tokenLine=n.line,n.setToken(N[n.currentChar]&8192?xe(n,e):zn(n,e,0)),n.getToken()}function xe(n,e){let u=n.currentChar,t=A(n),o=n.index;for(;t!==u;)n.index>=n.end&&c(n,16),t=A(n);return t!==u&&c(n,16),n.tokenValue=n.source.slice(o,n.index),A(n),e&128&&(n.tokenRaw=n.source.slice(n.tokenIndex,n.index)),134283267}function w2(n,e){if(n.startIndex=n.tokenIndex=n.index,n.startColumn=n.tokenColumn=n.column,n.startLine=n.tokenLine=n.line,n.index>=n.end){n.setToken(1048576);return}if(n.currentChar===60){A(n),n.setToken(8456256);return}if(n.currentChar===123){A(n),n.setToken(2162700);return}let u=0;for(;n.index1&&i&32&&n.getToken()&262144&&c(n,61,V[n.getToken()&255]),f}function Pn(n,e,u,t,o,i){let{tokenIndex:l,tokenLine:f,tokenColumn:d}=n,g=n.getToken(),m=null,y=ge(n,e,u,t,o,i,l,f,d);return n.getToken()===1077936155?(b(n,e|8192),m=M(n,e,t,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn),(i&32||(g&2097152)===0)&&(n.getToken()===274548||n.getToken()===8673330&&(g&2097152||(o&4)===0||e&256))&&$(l,f,d,n.index,n.line,n.column,60,n.getToken()===274548?"of":"in")):(o&16||(g&2097152)>0)&&(n.getToken()&262144)!==262144&&c(n,59,o&16?"const":"destructuring"),s(n,e,l,f,d,{type:"VariableDeclarator",id:y,init:m})}function qu(n,e,u,t,o,i,l,f){b(n,e);let d=((e&524288)>0||(e&512)>0&&(e&2048)>0)&&P(n,e,209006);C(n,e|8192,67174411),u&&(u=j(u,1));let g=null,m=null,y=0,a=null,k=n.getToken()===86088||n.getToken()===241737||n.getToken()===86090,h,{tokenIndex:T,tokenLine:E,tokenColumn:w}=n,I=n.getToken();if(k?I===241737?(a=R(n,e),n.getToken()&2240512?(n.getToken()===8673330?e&256&&c(n,67):a=s(n,e,T,E,w,{type:"VariableDeclaration",kind:"let",declarations:s2(n,e|33554432,u,t,8,32)}),n.assignable=1):e&256?c(n,67):(k=!1,n.assignable=1,a=O(n,e,t,a,0,0,T,E,w),n.getToken()===274548&&c(n,115))):(b(n,e),a=s(n,e,T,E,w,I===86088?{type:"VariableDeclaration",kind:"var",declarations:s2(n,e|33554432,u,t,4,32)}:{type:"VariableDeclaration",kind:"const",declarations:s2(n,e|33554432,u,t,16,32)}),n.assignable=1):I===1074790417?d&&c(n,82):(I&2097152)===2097152?(a=I===2162700?Z(n,e,void 0,t,1,0,0,2,32,T,E,w):Q(n,e,void 0,t,1,0,0,2,32,T,E,w),y=n.destructible,y&64&&c(n,63),n.assignable=y&16?2:1,a=O(n,e|33554432,t,a,0,0,n.tokenIndex,n.tokenLine,n.tokenColumn)):a=Y(n,e|33554432,t,1,0,1,T,E,w),(n.getToken()&262144)===262144){if(n.getToken()===274548){n.assignable&2&&c(n,80,d?"await":"of"),r(n,a),b(n,e|8192),h=M(n,e,t,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn),C(n,e|8192,16);let F=C2(n,e,u,t,o);return s(n,e,i,l,f,{type:"ForOfStatement",left:a,right:h,body:F,await:d})}n.assignable&2&&c(n,80,"in"),r(n,a),b(n,e|8192),d&&c(n,82),h=z(n,e,t,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn),C(n,e|8192,16);let q=C2(n,e,u,t,o);return s(n,e,i,l,f,{type:"ForInStatement",body:q,left:a,right:h})}d&&c(n,82),k||(y&8&&n.getToken()!==1077936155&&c(n,80,"loop"),a=J(n,e|33554432,t,0,0,T,E,w,a)),n.getToken()===18&&(a=e2(n,e,t,0,n.tokenIndex,n.tokenLine,n.tokenColumn,a)),C(n,e|8192,1074790417),n.getToken()!==1074790417&&(g=z(n,e,t,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn)),C(n,e|8192,1074790417),n.getToken()!==16&&(m=z(n,e,t,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn)),C(n,e|8192,16);let v=C2(n,e,u,t,o);return s(n,e,i,l,f,{type:"ForStatement",init:a,test:g,update:m,body:v})}function xn(n,e,u){return B2(e,n.getToken())||c(n,118),(n.getToken()&537079808)===537079808&&c(n,119),u&&d2(n,e,u,n.tokenValue,8,0),R(n,e)}function Su(n,e,u){let t=n.tokenIndex,o=n.tokenLine,i=n.tokenColumn;b(n,e);let l=null,{tokenIndex:f,tokenLine:d,tokenColumn:g}=n,m=[];if(n.getToken()===134283267)l=H(n,e);else{if(n.getToken()&143360){let a=xn(n,e,u);if(m=[s(n,e,f,d,g,{type:"ImportDefaultSpecifier",local:a})],P(n,e,18))switch(n.getToken()){case 8391476:m.push(vn(n,e,u));break;case 2162700:Nn(n,e,u,m);break;default:c(n,107)}}else switch(n.getToken()){case 8391476:m=[vn(n,e,u)];break;case 2162700:Nn(n,e,u,m);break;case 67174411:return pn(n,e,void 0,t,o,i);case 67108877:return rn(n,e,t,o,i);default:c(n,30,V[n.getToken()&255])}l=Pu(n,e)}let y={type:"ImportDeclaration",specifiers:m,source:l};return e&1&&(y.attributes=nn(n,e,m)),K(n,e|8192),s(n,e,t,o,i,y)}function vn(n,e,u){let{tokenIndex:t,tokenLine:o,tokenColumn:i}=n;return b(n,e),C(n,e,77932),(n.getToken()&134217728)===134217728&&$(t,o,i,n.index,n.line,n.column,30,V[n.getToken()&255]),s(n,e,t,o,i,{type:"ImportNamespaceSpecifier",local:xn(n,e,u)})}function Pu(n,e){return C(n,e,12403),n.getToken()!==134283267&&c(n,105,"Import"),H(n,e)}function Nn(n,e,u,t){for(b(n,e);n.getToken()&143360||n.getToken()===134283267;){let{tokenValue:o,tokenIndex:i,tokenLine:l,tokenColumn:f}=n,d=n.getToken(),g=O2(n,e),m;P(n,e,77932)?((n.getToken()&134217728)===134217728||n.getToken()===18?c(n,106):J2(n,e,16,n.getToken(),0),o=n.tokenValue,m=R(n,e)):g.type==="Identifier"?(J2(n,e,16,d,0),m=g):c(n,25,V[108]),u&&d2(n,e,u,o,8,0),t.push(s(n,e,i,l,f,{type:"ImportSpecifier",local:m,imported:g})),n.getToken()!==1074790415&&C(n,e,18)}return C(n,e,1074790415),t}function rn(n,e,u,t,o){let i=ne(n,e,s(n,e,u,t,o,{type:"Identifier",name:"import"}),u,t,o);return i=O(n,e,void 0,i,0,0,u,t,o),i=J(n,e,void 0,0,0,u,t,o,i),n.getToken()===18&&(i=e2(n,e,void 0,0,u,t,o,i)),A2(n,e,i,u,t,o)}function pn(n,e,u,t,o,i){let l=ee(n,e,u,0,t,o,i);return l=O(n,e,u,l,0,0,t,o,i),n.getToken()===18&&(l=e2(n,e,u,0,t,o,i,l)),A2(n,e,l,t,o,i)}function vu(n,e,u){let t=n.tokenIndex,o=n.tokenLine,i=n.tokenColumn;b(n,e|8192);let l=[],f=null,d=null,g=null;if(P(n,e|8192,20561)){switch(n.getToken()){case 86104:{f=f2(n,e,u,void 0,4,1,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);break}case 132:case 86094:f=en(n,e,u,void 0,1,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 209005:{let{tokenIndex:y,tokenLine:a,tokenColumn:k}=n;f=R(n,e);let{flags:h}=n;(h&1)===0&&(n.getToken()===86104?f=f2(n,e,u,void 0,4,1,1,1,y,a,k):n.getToken()===67174411?(f=sn(n,e,void 0,f,1,1,0,h,y,a,k),f=O(n,e,void 0,f,0,0,y,a,k),f=J(n,e,void 0,0,0,y,a,k,f)):n.getToken()&143360&&(u&&(u=K2(n,e,n.tokenValue)),f=R(n,e),f=F2(n,e,u,void 0,[f],1,y,a,k)));break}default:f=M(n,e,void 0,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn),K(n,e|8192)}return u&&g2(n,"default"),s(n,e,t,o,i,{type:"ExportDefaultDeclaration",declaration:f})}switch(n.getToken()){case 8391476:{b(n,e);let y=null;P(n,e,77932)&&(u&&g2(n,n.tokenValue),y=O2(n,e)),C(n,e,12403),n.getToken()!==134283267&&c(n,105,"Export"),d=H(n,e);let k={type:"ExportAllDeclaration",source:d,exported:y};return e&1&&(k.attributes=nn(n,e)),K(n,e|8192),s(n,e,t,o,i,k)}case 2162700:{b(n,e);let y=[],a=[],k=0;for(;n.getToken()&143360||n.getToken()===134283267;){let{tokenIndex:h,tokenValue:T,tokenLine:E,tokenColumn:w}=n,I=O2(n,e);I.type==="Literal"&&(k=1);let v;n.getToken()===77932?(b(n,e),(n.getToken()&143360)===0&&n.getToken()!==134283267&&c(n,106),u&&(y.push(n.tokenValue),a.push(T)),v=O2(n,e)):(u&&(y.push(n.tokenValue),a.push(n.tokenValue)),v=I),l.push(s(n,e,h,E,w,{type:"ExportSpecifier",local:I,exported:v})),n.getToken()!==1074790415&&C(n,e,18)}C(n,e,1074790415),P(n,e,12403)?(n.getToken()!==134283267&&c(n,105,"Export"),d=H(n,e),e&1&&(g=nn(n,e,l)),u&&y.forEach(h=>g2(n,h))):(k&&c(n,172),u&&(y.forEach(h=>g2(n,h)),a.forEach(h=>iu(n,h)))),K(n,e|8192);break}case 86094:f=en(n,e,u,void 0,2,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 86104:f=f2(n,e,u,void 0,4,1,2,0,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 241737:f=p2(n,e,u,void 0,8,64,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 86090:f=p2(n,e,u,void 0,16,64,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 86088:f=Gn(n,e,u,void 0,64,n.tokenIndex,n.tokenLine,n.tokenColumn);break;case 209005:{let{tokenIndex:y,tokenLine:a,tokenColumn:k}=n;if(b(n,e),(n.flags&1)===0&&n.getToken()===86104){f=f2(n,e,u,void 0,4,1,2,1,y,a,k);break}}default:c(n,30,V[n.getToken()&255])}let m={type:"ExportNamedDeclaration",declaration:f,specifiers:l,source:d};return g&&(m.attributes=g),s(n,e,t,o,i,m)}function M(n,e,u,t,o,i,l,f){let d=_(n,e,u,2,0,t,o,1,i,l,f);return d=O(n,e,u,d,o,0,i,l,f),J(n,e,u,o,0,i,l,f,d)}function e2(n,e,u,t,o,i,l,f){let d=[f];for(;P(n,e|8192,18);)d.push(M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn));return s(n,e,o,i,l,{type:"SequenceExpression",expressions:d})}function z(n,e,u,t,o,i,l,f){let d=M(n,e,u,o,t,i,l,f);return n.getToken()===18?e2(n,e,u,t,i,l,f,d):d}function J(n,e,u,t,o,i,l,f,d){let g=n.getToken();if((g&4194304)===4194304){n.assignable&2&&c(n,26),(!o&&g===1077936155&&d.type==="ArrayExpression"||d.type==="ObjectExpression")&&r(n,d),b(n,e|8192);let m=M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.assignable=2,s(n,e,i,l,f,o?{type:"AssignmentPattern",left:d,right:m}:{type:"AssignmentExpression",left:d,operator:V[g&255],right:m})}return(g&8388608)===8388608&&(d=l2(n,e,u,t,i,l,f,4,g,d)),P(n,e|8192,22)&&(d=c2(n,e,u,d,i,l,f)),d}function N2(n,e,u,t,o,i,l,f,d){let g=n.getToken();b(n,e|8192);let m=M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn);return d=s(n,e,i,l,f,o?{type:"AssignmentPattern",left:d,right:m}:{type:"AssignmentExpression",left:d,operator:V[g&255],right:m}),n.assignable=2,d}function c2(n,e,u,t,o,i,l){let f=M(n,(e|33554432)^33554432,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);C(n,e|8192,21),n.assignable=1;let d=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.assignable=2,s(n,e,o,i,l,{type:"ConditionalExpression",test:t,consequent:f,alternate:d})}function l2(n,e,u,t,o,i,l,f,d,g){let m=-((e&33554432)>0)&8673330,y,a;for(n.assignable=2;n.getToken()&8388608&&(y=n.getToken(),a=y&3840,(y&524288&&d&268435456||d&524288&&y&268435456)&&c(n,165),!(a+((y===8391735)<<8)-((m===y)<<12)<=f));)b(n,e|8192),g=s(n,e,o,i,l,{type:y&524288||y&268435456?"LogicalExpression":"BinaryExpression",left:g,right:l2(n,e,u,t,n.tokenIndex,n.tokenLine,n.tokenColumn,a,y,Y(n,e,u,0,t,1,n.tokenIndex,n.tokenLine,n.tokenColumn)),operator:V[y&255]});return n.getToken()===1077936155&&c(n,26),g}function Nu(n,e,u,t,o,i,l,f){t||c(n,0);let d=n.getToken();b(n,e|8192);let g=Y(n,e,u,0,f,1,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.getToken()===8391735&&c(n,33),e&256&&d===16863276&&(g.type==="Identifier"?c(n,121):re(g)&&c(n,127)),n.assignable=2,s(n,e,o,i,l,{type:"UnaryExpression",operator:V[d&255],argument:g,prefix:!0})}function Vu(n,e,u,t,o,i,l,f,d,g){let m=n.getToken(),y=R(n,e),{flags:a}=n;if((a&1)===0){if(n.getToken()===86104)return te(n,e,u,1,t,f,d,g);if(B2(e,n.getToken()))return o||c(n,0),(n.getToken()&36864)===36864&&(n.flags|=256),le(n,e,u,i,f,d,g)}return!l&&n.getToken()===67174411?sn(n,e,u,y,i,1,0,a,f,d,g):n.getToken()===10?($2(n,e,m),l&&c(n,51),(m&36864)===36864&&(n.flags|=256),_2(n,e,u,n.tokenValue,y,l,i,0,f,d,g)):(n.assignable=1,y)}function Ou(n,e,u,t,o,i,l,f){if(t&&(n.destructible|=256),e&262144){b(n,e|8192),e&2097152&&c(n,32),o||c(n,26),n.getToken()===22&&c(n,124);let d=null,g=!1;return(n.flags&1)===0?(g=P(n,e|8192,8391476),(n.getToken()&77824||g)&&(d=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn))):n.getToken()===8391476&&c(n,30,V[n.getToken()&255]),n.assignable=2,s(n,e,i,l,f,{type:"YieldExpression",argument:d,delegate:g})}return e&256&&c(n,97,"yield"),yn(n,e,u,i,l,f)}function Ru(n,e,u,t,o,i,l,f){o&&(n.destructible|=128),e&268435456&&c(n,177);let d=yn(n,e,u,i,l,f);if(d.type==="ArrowFunctionExpression"||(n.getToken()&65536)===0)return e&524288&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,176),e&512&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,110),e&2097152&&e&524288&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,110),d;if(e&2097152&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,31),e&524288||e&512&&e&2048){t&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,0);let m=Y(n,e,u,0,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.getToken()===8391735&&c(n,33),n.assignable=2,s(n,e,i,l,f,{type:"AwaitExpression",argument:m})}return e&512&&$(i,l,f,n.startIndex,n.startLine,n.startColumn,98),d}function W2(n,e,u,t,o,i,l){let{tokenIndex:f,tokenLine:d,tokenColumn:g}=n;C(n,e|8192,2162700);let m=[];if(n.getToken()!==1074790415){for(;n.getToken()===134283267;){let{index:y,tokenIndex:a,tokenValue:k}=n,h=n.getToken(),T=H(n,e);Kn(n,y,a,k)&&(e|=256,n.flags&128&&$(a,d,g,n.index,n.line,n.column,66),n.flags&64&&$(a,d,g,n.index,n.line,n.column,9),n.flags&4096&&$(a,d,g,n.index,n.line,n.column,15),l&&z2(l)),m.push(gn(n,e,T,h,a,n.tokenLine,n.tokenColumn))}e&256&&(i&&((i&537079808)===537079808&&c(n,119),(i&36864)===36864&&c(n,40)),n.flags&512&&c(n,119),n.flags&256&&c(n,118))}for(n.flags=(n.flags|512|256|64|4096)^4928,n.destructible=(n.destructible|256)^256;n.getToken()!==1074790415;)m.push(I2(n,e,u,t,4,{}));return C(n,o&24?e|8192:e,1074790415),n.flags&=-4289,n.getToken()===1077936155&&c(n,26),s(n,e,f,d,g,{type:"BlockStatement",body:m})}function Uu(n,e,u,t,o){switch(b(n,e),n.getToken()){case 67108990:c(n,167);case 67174411:{(e&131072)===0&&c(n,28),n.assignable=2;break}case 69271571:case 67108877:{(e&65536)===0&&c(n,29),n.assignable=1;break}default:c(n,30,"super")}return s(n,e,u,t,o,{type:"Super"})}function Y(n,e,u,t,o,i,l,f,d){let g=_(n,e,u,2,0,t,o,i,l,f,d);return O(n,e,u,g,o,0,l,f,d)}function Mu(n,e,u,t,o,i){n.assignable&2&&c(n,55);let l=n.getToken();return b(n,e),n.assignable=2,s(n,e,t,o,i,{type:"UpdateExpression",argument:u,operator:V[l&255],prefix:!1})}function O(n,e,u,t,o,i,l,f,d){if((n.getToken()&33619968)===33619968&&(n.flags&1)===0)t=Mu(n,e,t,l,f,d);else if((n.getToken()&67108864)===67108864){switch(e=(e|33554432)^33554432,n.getToken()){case 67108877:{b(n,(e|67108864|2048)^2048),e&4096&&n.getToken()===130&&n.tokenValue==="super"&&c(n,173),n.assignable=1;let g=cn(n,e|16384,u);t=s(n,e,l,f,d,{type:"MemberExpression",object:t,computed:!1,property:g});break}case 69271571:{let g=!1;(n.flags&2048)===2048&&(g=!0,n.flags=(n.flags|2048)^2048),b(n,e|8192);let{tokenIndex:m,tokenLine:y,tokenColumn:a}=n,k=z(n,e,u,o,1,m,y,a);C(n,e,20),n.assignable=1,t=s(n,e,l,f,d,{type:"MemberExpression",object:t,computed:!0,property:k}),g&&(n.flags|=2048);break}case 67174411:{if((n.flags&1024)===1024)return n.flags=(n.flags|1024)^1024,t;let g=!1;(n.flags&2048)===2048&&(g=!0,n.flags=(n.flags|2048)^2048);let m=an(n,e,u,o);n.assignable=2,t=s(n,e,l,f,d,{type:"CallExpression",callee:t,arguments:m}),g&&(n.flags|=2048);break}case 67108990:{b(n,(e|67108864|2048)^2048),n.flags|=2048,n.assignable=2,t=Ju(n,e,u,t,l,f,d);break}default:(n.flags&2048)===2048&&c(n,166),n.assignable=2,t=s(n,e,l,f,d,{type:"TaggedTemplateExpression",tag:t,quasi:n.getToken()===67174408?kn(n,e|16384,u):mn(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn)})}t=O(n,e,u,t,0,1,l,f,d)}return i===0&&(n.flags&2048)===2048&&(n.flags=(n.flags|2048)^2048,t=s(n,e,l,f,d,{type:"ChainExpression",expression:t})),t}function Ju(n,e,u,t,o,i,l){let f=!1,d;if((n.getToken()===69271571||n.getToken()===67174411)&&(n.flags&2048)===2048&&(f=!0,n.flags=(n.flags|2048)^2048),n.getToken()===69271571){b(n,e|8192);let{tokenIndex:g,tokenLine:m,tokenColumn:y}=n,a=z(n,e,u,0,1,g,m,y);C(n,e,20),n.assignable=2,d=s(n,e,o,i,l,{type:"MemberExpression",object:t,computed:!0,optional:!0,property:a})}else if(n.getToken()===67174411){let g=an(n,e,u,0);n.assignable=2,d=s(n,e,o,i,l,{type:"CallExpression",callee:t,arguments:g,optional:!0})}else{let g=cn(n,e,u);n.assignable=2,d=s(n,e,o,i,l,{type:"MemberExpression",object:t,computed:!1,optional:!0,property:g})}return f&&(n.flags|=2048),d}function cn(n,e,u){return(n.getToken()&143360)===0&&n.getToken()!==-2147483528&&n.getToken()!==-2147483527&&n.getToken()!==130&&c(n,160),n.getToken()===130?H2(n,e,u,0,n.tokenIndex,n.tokenLine,n.tokenColumn):R(n,e)}function ju(n,e,u,t,o,i,l,f){t&&c(n,56),o||c(n,0);let d=n.getToken();b(n,e|8192);let g=Y(n,e,u,0,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.assignable&2&&c(n,55),n.assignable=2,s(n,e,i,l,f,{type:"UpdateExpression",argument:g,operator:V[d&255],prefix:!0})}function _(n,e,u,t,o,i,l,f,d,g,m){if((n.getToken()&143360)===143360){switch(n.getToken()){case 209006:return Ru(n,e,u,o,l,d,g,m);case 241771:return Ou(n,e,u,l,i,d,g,m);case 209005:return Vu(n,e,u,l,f,i,o,d,g,m)}let{tokenValue:y}=n,a=n.getToken(),k=R(n,e|16384);return n.getToken()===10?(f||c(n,0),$2(n,e,a),(a&36864)===36864&&(n.flags|=256),_2(n,e,u,y,k,o,i,0,d,g,m)):(e&4096&&!(e&8388608)&&!(e&2097152)&&n.tokenValue==="arguments"&&c(n,130),(a&255)===73&&(e&256&&c(n,113),t&24&&c(n,100)),n.assignable=e&256&&(a&537079808)===537079808?2:1,k)}if((n.getToken()&134217728)===134217728)return H(n,e);switch(n.getToken()){case 33619993:case 33619994:return ju(n,e,u,o,f,d,g,m);case 16863276:case 16842798:case 16842799:case 25233968:case 25233969:case 16863275:case 16863277:return Nu(n,e,u,f,d,g,m,l);case 86104:return te(n,e,u,0,l,d,g,m);case 2162700:return Qu(n,e,u,i?0:1,l,d,g,m);case 69271571:return Yu(n,e,u,i?0:1,l,d,g,m);case 67174411:return Gu(n,e|16384,u,i,1,0,d,g,m);case 86021:case 86022:case 86023:return Wu(n,e,d,g,m);case 86111:return _u(n,e);case 65540:return pu(n,e,d,g,m);case 132:case 86094:return n1(n,e,u,l,d,g,m);case 86109:return Uu(n,e,d,g,m);case 67174409:return mn(n,e,d,g,m);case 67174408:return kn(n,e,u);case 86107:return xu(n,e,u,l,d,g,m);case 134283388:return ue(n,e,d,g,m);case 130:return H2(n,e,u,0,d,g,m);case 86106:return Xu(n,e,u,o,l,d,g,m);case 8456256:if(e&8)return Q2(n,e,u,0,d,g,m);default:if(B2(e,n.getToken()))return yn(n,e,u,d,g,m);c(n,30,V[n.getToken()&255])}}function Xu(n,e,u,t,o,i,l,f){let d=R(n,e);return n.getToken()===67108877?ne(n,e,d,i,l,f):(t&&c(n,142),d=ee(n,e,u,o,i,l,f),n.assignable=2,O(n,e,u,d,o,0,i,l,f))}function ne(n,e,u,t,o,i){(e&512)===0&&c(n,169),b(n,e);let l=n.getToken();return l!==209030&&n.tokenValue!=="meta"?c(n,174):l&-2147483648&&c(n,175),n.assignable=2,s(n,e,t,o,i,{type:"MetaProperty",meta:u,property:R(n,e)})}function ee(n,e,u,t,o,i,l){C(n,e|8192,67174411),n.getToken()===14&&c(n,143);let d={type:"ImportExpression",source:M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn)};if(e&1){let g=null;if(n.getToken()===18&&(C(n,e,18),n.getToken()!==16)){let m=(e|33554432)^33554432;g=M(n,m,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn)}d.options=g,P(n,e,18)}return C(n,e,16),s(n,e,o,i,l,d)}function nn(n,e,u=null){if(!P(n,e,20579))return[];C(n,e,2162700);let t=[],o=new Set;for(;n.getToken()!==1074790415;){let i=n.tokenIndex,l=n.tokenLine,f=n.tokenColumn,d=zu(n,e);C(n,e,21);let g=Hu(n,e),m=d.type==="Literal"?d.value:d.name;m==="type"&&g.value==="json"&&(u===null||u.length===1&&(u[0].type==="ImportDefaultSpecifier"||u[0].type==="ImportNamespaceSpecifier"||u[0].type==="ImportSpecifier"&&u[0].imported.type==="Identifier"&&u[0].imported.name==="default"||u[0].type==="ExportSpecifier"&&u[0].local.type==="Identifier"&&u[0].local.name==="default")||c(n,140)),o.has(m)&&c(n,145,`${m}`),o.add(m),t.push(s(n,e,i,l,f,{type:"ImportAttribute",key:d,value:g})),n.getToken()!==1074790415&&C(n,e,18)}return C(n,e,1074790415),t}function Hu(n,e){if(n.getToken()===134283267)return H(n,e);c(n,30,V[n.getToken()&255])}function zu(n,e){if(n.getToken()===134283267)return H(n,e);if(n.getToken()&143360)return R(n,e);c(n,30,V[n.getToken()&255])}function Ku(n,e){let u=e.length;for(let t=0;t56319||++t>=u||(e.charCodeAt(t)&64512)!==56320)&&c(n,171,JSON.stringify(e.charAt(t--)))}}function O2(n,e){if(n.getToken()===134283267)return Ku(n,n.tokenValue),H(n,e);if(n.getToken()&143360)return R(n,e);c(n,30,V[n.getToken()&255])}function ue(n,e,u,t,o){let{tokenRaw:i,tokenValue:l}=n;return b(n,e),n.assignable=2,s(n,e,u,t,o,e&128?{type:"Literal",value:l,bigint:i.slice(0,-1),raw:i}:{type:"Literal",value:l,bigint:i.slice(0,-1)})}function mn(n,e,u,t,o){n.assignable=2;let{tokenValue:i,tokenRaw:l,tokenIndex:f,tokenLine:d,tokenColumn:g}=n;C(n,e,67174409);let m=[R2(n,e,i,l,f,d,g,!0)];return s(n,e,u,t,o,{type:"TemplateLiteral",expressions:[],quasis:m})}function kn(n,e,u){e=(e|33554432)^33554432;let{tokenValue:t,tokenRaw:o,tokenIndex:i,tokenLine:l,tokenColumn:f}=n;C(n,e&-16385|8192,67174408);let d=[R2(n,e,t,o,i,l,f,!1)],g=[z(n,e&-16385,u,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn)];for(n.getToken()!==1074790415&&c(n,83);n.setToken(We(n,e),!0)!==67174409;){let{tokenValue:m,tokenRaw:y,tokenIndex:a,tokenLine:k,tokenColumn:h}=n;C(n,e&-16385|8192,67174408),d.push(R2(n,e,m,y,a,k,h,!1)),g.push(z(n,e,u,0,1,n.tokenIndex,n.tokenLine,n.tokenColumn)),n.getToken()!==1074790415&&c(n,83)}{let{tokenValue:m,tokenRaw:y,tokenIndex:a,tokenLine:k,tokenColumn:h}=n;C(n,e,67174409),d.push(R2(n,e,m,y,a,k,h,!0))}return s(n,e,i,l,f,{type:"TemplateLiteral",expressions:g,quasis:d})}function R2(n,e,u,t,o,i,l,f){let d=s(n,e,o,i,l,{type:"TemplateElement",value:{cooked:u,raw:t},tail:f}),g=f?1:2;return e&2&&(d.start+=1,d.range[0]+=1,d.end-=g,d.range[1]-=g),e&4&&(d.loc.start.column+=1,d.loc.end.column-=g),d}function $u(n,e,u,t,o,i){e=(e|33554432)^33554432,C(n,e|8192,14);let l=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.assignable=1,s(n,e,t,o,i,{type:"SpreadElement",argument:l})}function an(n,e,u,t){b(n,e|8192);let o=[];if(n.getToken()===16)return b(n,e|16384),o;for(;n.getToken()!==16&&(n.getToken()===14?o.push($u(n,e,u,n.tokenIndex,n.tokenLine,n.tokenColumn)):o.push(M(n,e,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn)),!(n.getToken()!==18||(b(n,e|8192),n.getToken()===16))););return C(n,e|16384,16),o}function R(n,e){let{tokenValue:u,tokenIndex:t,tokenLine:o,tokenColumn:i}=n,l=u==="await"&&(n.getToken()&-2147483648)===0;return b(n,e|(l?8192:0)),s(n,e,t,o,i,{type:"Identifier",name:u})}function H(n,e){let{tokenValue:u,tokenRaw:t,tokenIndex:o,tokenLine:i,tokenColumn:l}=n;return n.getToken()===134283388?ue(n,e,o,i,l):(b(n,e),n.assignable=2,s(n,e,o,i,l,e&128?{type:"Literal",value:u,raw:t}:{type:"Literal",value:u}))}function Wu(n,e,u,t,o){let i=V[n.getToken()&255],l=n.getToken()===86023?null:i==="true";return b(n,e),n.assignable=2,s(n,e,u,t,o,e&128?{type:"Literal",value:l,raw:i}:{type:"Literal",value:l})}function _u(n,e){let{tokenIndex:u,tokenLine:t,tokenColumn:o}=n;return b(n,e),n.assignable=2,s(n,e,u,t,o,{type:"ThisExpression"})}function f2(n,e,u,t,o,i,l,f,d,g,m){b(n,e|8192);let y=i?fn(n,e,8391476):0,a=null,k,h=u?a2():void 0;if(n.getToken()===67174411)(l&1)===0&&c(n,39,"Function");else{let v=o&4&&((e&2048)===0||(e&512)===0)?4:64|(f?1024:0)|(y?1024:0);$n(n,e,n.getToken()),u&&(v&4?Yn(n,e,u,n.tokenValue,v):d2(n,e,u,n.tokenValue,v,o),h=j(h,256),l&&l&2&&g2(n,n.tokenValue)),k=n.getToken(),n.getToken()&143360?a=R(n,e):c(n,30,V[n.getToken()&255])}let T=7274496;e=(e|T)^T|16777216|(f?524288:0)|(y?262144:0)|(y?0:67108864),u&&(h=j(h,512));let E=oe(n,(e|2097152)&-268435457,h,t,0,1),w=268471296,I=W2(n,(e|w)^w|8388608|1048576,u?j(h,128):h,t,8,k,h==null?void 0:h.scopeError);return s(n,e,d,g,m,{type:"FunctionDeclaration",id:a,params:E,body:I,async:f===1,generator:y===1})}function te(n,e,u,t,o,i,l,f){b(n,e|8192);let d=fn(n,e,8391476),g=(t?524288:0)|(d?262144:0),m=null,y,a=e&16?a2():void 0,k=275709952;n.getToken()&143360&&($n(n,(e|k)^k|g,n.getToken()),a&&(a=j(a,256)),y=n.getToken(),m=R(n,e)),e=(e|k)^k|16777216|g|(d?0:67108864),a&&(a=j(a,512));let h=oe(n,(e|2097152)&-268435457,a,u,o,1),T=W2(n,e&-33594369|8388608|1048576,a&&j(a,128),u,0,y,a==null?void 0:a.scopeError);return n.assignable=2,s(n,e,i,l,f,{type:"FunctionExpression",id:m,params:h,body:T,async:t===1,generator:d===1})}function Yu(n,e,u,t,o,i,l,f){let d=Q(n,e,void 0,u,t,o,0,2,0,i,l,f);return n.destructible&64&&c(n,63),n.destructible&8&&c(n,62),d}function Q(n,e,u,t,o,i,l,f,d,g,m,y){b(n,e|8192);let a=[],k=0;for(e=(e|33554432)^33554432;n.getToken()!==20;)if(P(n,e|8192,18))a.push(null);else{let T,{tokenIndex:E,tokenLine:w,tokenColumn:I,tokenValue:v}=n,q=n.getToken();if(q&143360)if(T=_(n,e,t,f,0,1,i,1,E,w,I),n.getToken()===1077936155){n.assignable&2&&c(n,26),b(n,e|8192),u&&n2(n,e,u,v,f,d);let F=M(n,e,t,1,i,n.tokenIndex,n.tokenLine,n.tokenColumn);T=s(n,e,E,w,I,l?{type:"AssignmentPattern",left:T,right:F}:{type:"AssignmentExpression",operator:"=",left:T,right:F}),k|=n.destructible&256?256:0|n.destructible&128?128:0}else n.getToken()===18||n.getToken()===20?(n.assignable&2?k|=16:u&&n2(n,e,u,v,f,d),k|=n.destructible&256?256:0|n.destructible&128?128:0):(k|=f&1?32:(f&2)===0?16:0,T=O(n,e,t,T,i,0,E,w,I),n.getToken()!==18&&n.getToken()!==20?(n.getToken()!==1077936155&&(k|=16),T=J(n,e,t,i,l,E,w,I,T)):n.getToken()!==1077936155&&(k|=n.assignable&2?16:32));else q&2097152?(T=n.getToken()===2162700?Z(n,e,u,t,0,i,l,f,d,E,w,I):Q(n,e,u,t,0,i,l,f,d,E,w,I),k|=n.destructible,n.assignable=n.destructible&16?2:1,n.getToken()===18||n.getToken()===20?n.assignable&2&&(k|=16):n.destructible&8?c(n,71):(T=O(n,e,t,T,i,0,E,w,I),k=n.assignable&2?16:0,n.getToken()!==18&&n.getToken()!==20?T=J(n,e,t,i,l,E,w,I,T):n.getToken()!==1077936155&&(k|=n.assignable&2?16:32))):q===14?(T=b2(n,e,u,t,20,f,d,0,i,l,E,w,I),k|=n.destructible,n.getToken()!==18&&n.getToken()!==20&&c(n,30,V[n.getToken()&255])):(T=Y(n,e,t,1,0,1,E,w,I),n.getToken()!==18&&n.getToken()!==20?(T=J(n,e,t,i,l,E,w,I,T),(f&3)===0&&q===67174411&&(k|=16)):n.assignable&2?k|=16:q===67174411&&(k|=n.assignable&1&&f&3?32:16));if(a.push(T),P(n,e|8192,18)){if(n.getToken()===20)break}else break}C(n,e,20);let h=s(n,e,g,m,y,{type:l?"ArrayPattern":"ArrayExpression",elements:a});return!o&&n.getToken()&4194304?ie(n,e,t,k,i,l,g,m,y,h):(n.destructible=k,h)}function ie(n,e,u,t,o,i,l,f,d,g){n.getToken()!==1077936155&&c(n,26),b(n,e|8192),t&16&&c(n,26),i||r(n,g);let{tokenIndex:m,tokenLine:y,tokenColumn:a}=n,k=M(n,e,u,1,o,m,y,a);return n.destructible=(t|64|8)^72|(n.destructible&128?128:0)|(n.destructible&256?256:0),s(n,e,l,f,d,i?{type:"AssignmentPattern",left:g,right:k}:{type:"AssignmentExpression",left:g,operator:"=",right:k})}function b2(n,e,u,t,o,i,l,f,d,g,m,y,a){b(n,e|8192);let k=null,h=0,{tokenValue:T,tokenIndex:E,tokenLine:w,tokenColumn:I}=n,v=n.getToken();if(v&143360)n.assignable=1,k=_(n,e,t,i,0,1,d,1,E,w,I),v=n.getToken(),k=O(n,e,t,k,d,0,E,w,I),n.getToken()!==18&&n.getToken()!==o&&(n.assignable&2&&n.getToken()===1077936155&&c(n,71),h|=16,k=J(n,e,t,d,g,E,w,I,k)),n.assignable&2?h|=16:v===o||v===18?u&&n2(n,e,u,T,i,l):h|=32,h|=n.destructible&128?128:0;else if(v===o)c(n,41);else if(v&2097152)k=n.getToken()===2162700?Z(n,e,u,t,1,d,g,i,l,E,w,I):Q(n,e,u,t,1,d,g,i,l,E,w,I),v=n.getToken(),v!==1077936155&&v!==o&&v!==18?(n.destructible&8&&c(n,71),k=O(n,e,t,k,d,0,E,w,I),h|=n.assignable&2?16:0,(n.getToken()&4194304)===4194304?(n.getToken()!==1077936155&&(h|=16),k=J(n,e,t,d,g,E,w,I,k)):((n.getToken()&8388608)===8388608&&(k=l2(n,e,t,1,E,w,I,4,v,k)),P(n,e|8192,22)&&(k=c2(n,e,t,k,E,w,I)),h|=n.assignable&2?16:32)):h|=o===1074790415&&v!==1077936155?16:n.destructible;else{h|=32,k=Y(n,e,t,1,d,1,n.tokenIndex,n.tokenLine,n.tokenColumn);let{tokenIndex:q,tokenLine:F,tokenColumn:U}=n,D=n.getToken();return D===1077936155?(n.assignable&2&&c(n,26),k=J(n,e,t,d,g,q,F,U,k),h|=16):(D===18?h|=16:D!==o&&(k=J(n,e,t,d,g,q,F,U,k)),h|=n.assignable&1?32:16),n.destructible=h,n.getToken()!==o&&n.getToken()!==18&&c(n,161),s(n,e,m,y,a,{type:g?"RestElement":"SpreadElement",argument:k})}if(n.getToken()!==o)if(i&1&&(h|=f?16:32),P(n,e|8192,1077936155)){h&16&&c(n,26),r(n,k);let q=M(n,e,t,1,d,n.tokenIndex,n.tokenLine,n.tokenColumn);k=s(n,e,E,w,I,g?{type:"AssignmentPattern",left:k,right:q}:{type:"AssignmentExpression",left:k,operator:"=",right:q}),h=16}else h|=16;return n.destructible=h,s(n,e,m,y,a,{type:g?"RestElement":"SpreadElement",argument:k})}function x(n,e,u,t,o,i,l,f){var a;let d=2883584|((t&64)===0?4325376:0);e=(e|d)^d|(t&8?262144:0)|(t&16?524288:0)|(t&64?4194304:0)|65536|8388608|16777216;let g=e&16?j(a2(),512):void 0,m=Zu(n,(e|2097152)&-268435457,g,u,t,1,o);g&&(g=j(g,128));let y=W2(n,e&-301992961|8388608|1048576,g,u,0,void 0,(a=g==null?void 0:g.parent)==null?void 0:a.scopeError);return s(n,e,i,l,f,{type:"FunctionExpression",params:m,body:y,async:(t&16)>0,generator:(t&8)>0,id:null})}function Qu(n,e,u,t,o,i,l,f){let d=Z(n,e,void 0,u,t,o,0,2,0,i,l,f);return n.destructible&64&&c(n,63),n.destructible&8&&c(n,62),d}function Z(n,e,u,t,o,i,l,f,d,g,m,y){b(n,e);let a=[],k=0,h=0;for(e=(e|33554432)^33554432;n.getToken()!==1074790415;){let{tokenValue:E,tokenLine:w,tokenColumn:I,tokenIndex:v}=n,q=n.getToken();if(q===14)a.push(b2(n,e,u,t,1074790415,f,d,0,i,l,v,w,I));else{let F=0,U=null,D;if(n.getToken()&143360||n.getToken()===-2147483528||n.getToken()===-2147483527)if(n.getToken()===-2147483527&&(k|=16),U=R(n,e),n.getToken()===18||n.getToken()===1074790415||n.getToken()===1077936155)if(F|=4,e&256&&(q&537079808)===537079808?k|=16:J2(n,e,f,q,0),u&&n2(n,e,u,E,f,d),P(n,e|8192,1077936155)){k|=8;let B=M(n,e,t,1,i,n.tokenIndex,n.tokenLine,n.tokenColumn);k|=n.destructible&256?256:0|n.destructible&128?128:0,D=s(n,e,v,w,I,{type:"AssignmentPattern",left:e&134217728?Object.assign({},U):U,right:B})}else k|=(q===209006?128:0)|(q===-2147483528?16:0),D=e&134217728?Object.assign({},U):U;else if(P(n,e|8192,21)){let{tokenIndex:B,tokenLine:L,tokenColumn:S}=n;if(E==="__proto__"&&h++,n.getToken()&143360){let D2=n.getToken(),t2=n.tokenValue;D=_(n,e,t,f,0,1,i,1,B,L,S);let p=n.getToken();D=O(n,e,t,D,i,0,B,L,S),n.getToken()===18||n.getToken()===1074790415?p===1077936155||p===1074790415||p===18?(k|=n.destructible&128?128:0,n.assignable&2?k|=16:u&&(D2&143360)===143360&&n2(n,e,u,t2,f,d)):k|=n.assignable&1?32:16:(n.getToken()&4194304)===4194304?(n.assignable&2?k|=16:p!==1077936155?k|=32:u&&n2(n,e,u,t2,f,d),D=J(n,e,t,i,l,B,L,S,D)):(k|=16,(n.getToken()&8388608)===8388608&&(D=l2(n,e,t,1,B,L,S,4,p,D)),P(n,e|8192,22)&&(D=c2(n,e,t,D,B,L,S)))}else(n.getToken()&2097152)===2097152?(D=n.getToken()===69271571?Q(n,e,u,t,0,i,l,f,d,B,L,S):Z(n,e,u,t,0,i,l,f,d,B,L,S),k=n.destructible,n.assignable=k&16?2:1,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):n.destructible&8?c(n,71):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&2?16:0,(n.getToken()&4194304)===4194304?D=N2(n,e,t,i,l,B,L,S,D):((n.getToken()&8388608)===8388608&&(D=l2(n,e,t,1,B,L,S,4,q,D)),P(n,e|8192,22)&&(D=c2(n,e,t,D,B,L,S)),k|=n.assignable&2?16:32))):(D=Y(n,e,t,1,i,1,B,L,S),k|=n.assignable&1?32:16,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&2?16:0,n.getToken()!==18&&q!==1074790415&&(n.getToken()!==1077936155&&(k|=16),D=J(n,e,t,i,l,B,L,S,D))))}else n.getToken()===69271571?(k|=16,q===209005&&(F|=16),F|=(q===12400?256:q===12401?512:1)|2,U=y2(n,e,t,i),k|=n.assignable,D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):n.getToken()&143360?(k|=16,q===-2147483528&&c(n,95),q===209005?(n.flags&1&&c(n,132),F|=17):q===12400?F|=256:q===12401?F|=512:c(n,0),U=R(n,e),D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):n.getToken()===67174411?(k|=16,F|=1,D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):n.getToken()===8391476?(k|=16,q===12400?c(n,42):q===12401?c(n,43):q!==209005&&c(n,30,V[52]),b(n,e),F|=9|(q===209005?16:0),n.getToken()&143360?U=R(n,e):(n.getToken()&134217728)===134217728?U=H(n,e):n.getToken()===69271571?(F|=2,U=y2(n,e,t,i),k|=n.assignable):c(n,30,V[n.getToken()&255]),D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):(n.getToken()&134217728)===134217728?(q===209005&&(F|=16),F|=q===12400?256:q===12401?512:1,k|=16,U=H(n,e),D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):c(n,133);else if((n.getToken()&134217728)===134217728)if(U=H(n,e),n.getToken()===21){C(n,e|8192,21);let{tokenIndex:B,tokenLine:L,tokenColumn:S}=n;if(E==="__proto__"&&h++,n.getToken()&143360){D=_(n,e,t,f,0,1,i,1,B,L,S);let{tokenValue:D2}=n,t2=n.getToken();D=O(n,e,t,D,i,0,B,L,S),n.getToken()===18||n.getToken()===1074790415?t2===1077936155||t2===1074790415||t2===18?n.assignable&2?k|=16:u&&n2(n,e,u,D2,f,d):k|=n.assignable&1?32:16:n.getToken()===1077936155?(n.assignable&2&&(k|=16),D=J(n,e,t,i,l,B,L,S,D)):(k|=16,D=J(n,e,t,i,l,B,L,S,D))}else(n.getToken()&2097152)===2097152?(D=n.getToken()===69271571?Q(n,e,u,t,0,i,l,f,d,B,L,S):Z(n,e,u,t,0,i,l,f,d,B,L,S),k=n.destructible,n.assignable=k&16?2:1,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):(n.destructible&8)!==8&&(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&2?16:0,(n.getToken()&4194304)===4194304?D=N2(n,e,t,i,l,B,L,S,D):((n.getToken()&8388608)===8388608&&(D=l2(n,e,t,1,B,L,S,4,q,D)),P(n,e|8192,22)&&(D=c2(n,e,t,D,B,L,S)),k|=n.assignable&2?16:32))):(D=Y(n,e,t,1,0,1,B,L,S),k|=n.assignable&1?32:16,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&1?0:16,n.getToken()!==18&&n.getToken()!==1074790415&&(n.getToken()!==1077936155&&(k|=16),D=J(n,e,t,i,l,B,L,S,D))))}else n.getToken()===67174411?(F|=1,D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn),k=n.assignable|16):c(n,134);else if(n.getToken()===69271571)if(U=y2(n,e,t,i),k|=n.destructible&256?256:0,F|=2,n.getToken()===21){b(n,e|8192);let{tokenIndex:B,tokenLine:L,tokenColumn:S,tokenValue:D2}=n,t2=n.getToken();if(n.getToken()&143360){D=_(n,e,t,f,0,1,i,1,B,L,S);let p=n.getToken();D=O(n,e,t,D,i,0,B,L,S),(n.getToken()&4194304)===4194304?(k|=n.assignable&2?16:p===1077936155?0:32,D=N2(n,e,t,i,l,B,L,S,D)):n.getToken()===18||n.getToken()===1074790415?p===1077936155||p===1074790415||p===18?n.assignable&2?k|=16:u&&(t2&143360)===143360&&n2(n,e,u,D2,f,d):k|=n.assignable&1?32:16:(k|=16,D=J(n,e,t,i,l,B,L,S,D))}else(n.getToken()&2097152)===2097152?(D=n.getToken()===69271571?Q(n,e,u,t,0,i,l,f,d,B,L,S):Z(n,e,u,t,0,i,l,f,d,B,L,S),k=n.destructible,n.assignable=k&16?2:1,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):k&8?c(n,62):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&2?k|16:0,(n.getToken()&4194304)===4194304?(n.getToken()!==1077936155&&(k|=16),D=N2(n,e,t,i,l,B,L,S,D)):((n.getToken()&8388608)===8388608&&(D=l2(n,e,t,1,B,L,S,4,q,D)),P(n,e|8192,22)&&(D=c2(n,e,t,D,B,L,S)),k|=n.assignable&2?16:32))):(D=Y(n,e,t,1,0,1,B,L,S),k|=n.assignable&1?32:16,n.getToken()===18||n.getToken()===1074790415?n.assignable&2&&(k|=16):(D=O(n,e,t,D,i,0,B,L,S),k=n.assignable&1?0:16,n.getToken()!==18&&n.getToken()!==1074790415&&(n.getToken()!==1077936155&&(k|=16),D=J(n,e,t,i,l,B,L,S,D))))}else n.getToken()===67174411?(F|=1,D=x(n,e,t,F,i,n.tokenIndex,w,I),k=16):c(n,44);else if(q===8391476)if(C(n,e|8192,8391476),F|=8,n.getToken()&143360){let B=n.getToken();U=R(n,e),F|=1,n.getToken()===67174411?(k|=16,D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):$(n.tokenIndex,n.tokenLine,n.tokenColumn,n.index,n.line,n.column,B===209005?46:B===12400||n.getToken()===12401?45:47,V[B&255])}else(n.getToken()&134217728)===134217728?(k|=16,U=H(n,e),F|=1,D=x(n,e,t,F,i,v,w,I)):n.getToken()===69271571?(k|=16,F|=3,U=y2(n,e,t,i),D=x(n,e,t,F,i,n.tokenIndex,n.tokenLine,n.tokenColumn)):c(n,126);else c(n,30,V[q&255]);k|=n.destructible&128?128:0,n.destructible=k,a.push(s(n,e,v,w,I,{type:"Property",key:U,value:D,kind:F&768?F&512?"set":"get":"init",computed:(F&2)>0,method:(F&1)>0,shorthand:(F&4)>0}))}if(k|=n.destructible,n.getToken()!==18)break;b(n,e)}C(n,e,1074790415),h>1&&(k|=64);let T=s(n,e,g,m,y,{type:l?"ObjectPattern":"ObjectExpression",properties:a});return!o&&n.getToken()&4194304?ie(n,e,t,k,i,l,g,m,y,T):(n.destructible=k,T)}function Zu(n,e,u,t,o,i,l){C(n,e,67174411);let f=[];if(n.flags=(n.flags|128)^128,n.getToken()===16)return o&512&&c(n,37,"Setter","one",""),b(n,e),f;o&256&&c(n,37,"Getter","no","s"),o&512&&n.getToken()===14&&c(n,38),e=(e|33554432)^33554432;let d=0,g=0;for(;n.getToken()!==18;){let m=null,{tokenIndex:y,tokenLine:a,tokenColumn:k}=n;if(n.getToken()&143360?((e&256)===0&&((n.getToken()&36864)===36864&&(n.flags|=256),(n.getToken()&537079808)===537079808&&(n.flags|=512)),m=hn(n,e,u,o|1,0,y,a,k)):(n.getToken()===2162700?m=Z(n,e,u,t,1,l,1,i,0,y,a,k):n.getToken()===69271571?m=Q(n,e,u,t,1,l,1,i,0,y,a,k):n.getToken()===14&&(m=b2(n,e,u,t,16,i,0,0,l,1,y,a,k)),g=1,n.destructible&48&&c(n,50)),n.getToken()===1077936155){b(n,e|8192),g=1;let h=M(n,e,t,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);m=s(n,e,y,a,k,{type:"AssignmentPattern",left:m,right:h})}if(d++,f.push(m),!P(n,e,18)||n.getToken()===16)break}return o&512&&d!==1&&c(n,37,"Setter","one",""),u&&u.scopeError&&z2(u.scopeError),g&&(n.flags|=128),C(n,e,16),f}function y2(n,e,u,t){b(n,e|8192);let o=M(n,(e|33554432)^33554432,u,1,t,n.tokenIndex,n.tokenLine,n.tokenColumn);return C(n,e,20),o}function Gu(n,e,u,t,o,i,l,f,d){n.flags=(n.flags|128)^128;let{tokenIndex:g,tokenLine:m,tokenColumn:y}=n;b(n,e|8192|67108864);let a=e&16?j(a2(),1024):void 0;if(e=(e|33554432)^33554432,P(n,e,16))return X2(n,e,a,u,[],t,0,l,f,d);let k=0;n.destructible&=-385;let h,T=[],E=0,w=0,I=0,{tokenIndex:v,tokenLine:q,tokenColumn:F}=n;for(n.assignable=1;n.getToken()!==16;){let{tokenIndex:U,tokenLine:D,tokenColumn:B}=n,L=n.getToken();if(L&143360)a&&d2(n,e,a,n.tokenValue,1,0),(L&537079808)===537079808?w=1:(L&36864)===36864&&(I=1),h=_(n,e,u,o,0,1,1,1,U,D,B),n.getToken()===16||n.getToken()===18?n.assignable&2&&(k|=16,w=1):(n.getToken()===1077936155?w=1:k|=16,h=O(n,e,u,h,1,0,U,D,B),n.getToken()!==16&&n.getToken()!==18&&(h=J(n,e,u,1,0,U,D,B,h)));else if((L&2097152)===2097152)h=L===2162700?Z(n,e|67108864,a,u,0,1,0,o,i,U,D,B):Q(n,e|67108864,a,u,0,1,0,o,i,U,D,B),k|=n.destructible,w=1,n.assignable=2,n.getToken()!==16&&n.getToken()!==18&&(k&8&&c(n,122),h=O(n,e,u,h,0,0,U,D,B),k|=16,n.getToken()!==16&&n.getToken()!==18&&(h=J(n,e,u,0,0,U,D,B,h)));else if(L===14){h=b2(n,e,a,u,16,o,i,0,1,0,U,D,B),n.destructible&16&&c(n,74),w=1,E&&(n.getToken()===16||n.getToken()===18)&&T.push(h),k|=8;break}else{if(k|=16,h=M(n,e,u,1,1,U,D,B),E&&(n.getToken()===16||n.getToken()===18)&&T.push(h),n.getToken()===18&&(E||(E=1,T=[h])),E){for(;P(n,e|8192,18);)T.push(M(n,e,u,1,1,n.tokenIndex,n.tokenLine,n.tokenColumn));n.assignable=2,h=s(n,e,v,q,F,{type:"SequenceExpression",expressions:T})}return C(n,e,16),n.destructible=k,h}if(E&&(n.getToken()===16||n.getToken()===18)&&T.push(h),!P(n,e|8192,18))break;if(E||(E=1,T=[h]),n.getToken()===16){k|=8;break}}return E&&(n.assignable=2,h=s(n,e,v,q,F,{type:"SequenceExpression",expressions:T})),C(n,e,16),k&16&&k&8&&c(n,151),k|=n.destructible&256?256:0|n.destructible&128?128:0,n.getToken()===10?(k&48&&c(n,49),e&524800&&k&128&&c(n,31),e&262400&&k&256&&c(n,32),w&&(n.flags|=128),I&&(n.flags|=256),X2(n,e,a,u,E?T:[h],t,0,l,f,d)):(k&64&&c(n,63),k&8&&c(n,144),n.destructible=(n.destructible|256)^256|k,e&32?s(n,e,g,m,y,{type:"ParenthesizedExpression",expression:h}):h)}function yn(n,e,u,t,o,i){let{tokenValue:l}=n,f=0,d=0;(n.getToken()&537079808)===537079808?f=1:(n.getToken()&36864)===36864&&(d=1);let g=R(n,e);if(n.assignable=1,n.getToken()===10){let m;return e&16&&(m=K2(n,e,l)),f&&(n.flags|=128),d&&(n.flags|=256),F2(n,e,m,u,[g],0,t,o,i)}return g}function _2(n,e,u,t,o,i,l,f,d,g,m){l||c(n,57),i&&c(n,51),n.flags&=-129;let y=e&16?K2(n,e,t):void 0;return F2(n,e,y,u,[o],f,d,g,m)}function X2(n,e,u,t,o,i,l,f,d,g){i||c(n,57);for(let m=0;m0&&n.tokenValue==="constructor"&&c(n,109),n.getToken()===1074790415&&c(n,108),P(n,e,1074790417)){E>0&&c(n,120);continue}h.push(de(n,e,t,y,u,i,T,0,f,n.tokenIndex,n.tokenLine,n.tokenColumn))}return C(n,l&8?e|8192:e,1074790415),y&&tu(y),n.flags=n.flags&-33|k,s(n,e,d,g,m,{type:"ClassBody",body:h})}function de(n,e,u,t,o,i,l,f,d,g,m,y){let a=f?32:0,k=null,{tokenIndex:h,tokenLine:T,tokenColumn:E}=n,w=n.getToken();if(w&176128||w===-2147483528)switch(k=R(n,e),w){case 36970:if(!f&&n.getToken()!==67174411&&(n.getToken()&1048576)!==1048576&&n.getToken()!==1077936155)return de(n,e,u,t,o,i,l,1,d,g,m,y);break;case 209005:if(n.getToken()!==67174411&&(n.flags&1)===0){if((n.getToken()&1073741824)===1073741824)return T2(n,e,t,k,a,l,h,T,E);a|=16|(fn(n,e,8391476)?8:0)}break;case 12400:if(n.getToken()!==67174411){if((n.getToken()&1073741824)===1073741824)return T2(n,e,t,k,a,l,h,T,E);a|=256}break;case 12401:if(n.getToken()!==67174411){if((n.getToken()&1073741824)===1073741824)return T2(n,e,t,k,a,l,h,T,E);a|=512}break;case 12402:if(n.getToken()!==67174411&&(n.flags&1)===0){if((n.getToken()&1073741824)===1073741824)return T2(n,e,t,k,a,l,h,T,E);e&1&&(a|=1024)}break}else if(w===69271571)a|=2,k=y2(n,o,t,d);else if((w&134217728)===134217728)k=H(n,e);else if(w===8391476)a|=8,b(n,e);else if(n.getToken()===130)a|=8192,k=H2(n,e|4096,t,768,h,T,E);else if((n.getToken()&1073741824)===1073741824)a|=128;else{if(f&&w===2162700)return Iu(n,e|4096,u,t,h,T,E);w===-2147483527?(k=R(n,e),n.getToken()!==67174411&&c(n,30,V[n.getToken()&255])):c(n,30,V[n.getToken()&255])}if(a&1816&&(n.getToken()&143360||n.getToken()===-2147483528||n.getToken()===-2147483527?k=R(n,e):(n.getToken()&134217728)===134217728?k=H(n,e):n.getToken()===69271571?(a|=2,k=y2(n,e,t,0)):n.getToken()===130?(a|=8192,k=H2(n,e,t,a,h,T,E)):c(n,135)),(a&2)===0&&(n.tokenValue==="constructor"?((n.getToken()&1073741824)===1073741824?c(n,129):(a&32)===0&&n.getToken()===67174411&&(a&920?c(n,53,"accessor"):(e&131072)===0&&(n.flags&32?c(n,54):n.flags|=32)),a|=64):(a&8192)===0&&a&32&&n.tokenValue==="prototype"&&c(n,52)),a&1024||n.getToken()!==67174411&&(a&768)===0)return T2(n,e,t,k,a,l,h,T,E);let I=x(n,e|4096,t,a,d,n.tokenIndex,n.tokenLine,n.tokenColumn);return s(n,e,g,m,y,{type:"MethodDefinition",kind:(a&32)===0&&a&64?"constructor":a&256?"get":a&512?"set":"method",static:(a&32)>0,computed:(a&2)>0,key:k,value:I,...e&1?{decorators:l}:null})}function H2(n,e,u,t,o,i,l){b(n,e);let{tokenValue:f}=n;return f==="constructor"&&c(n,128),e&16&&(u||c(n,4,f),t?eu(n,u,f,t):uu(n,u,f)),b(n,e),s(n,e,o,i,l,{type:"PrivateIdentifier",name:f})}function T2(n,e,u,t,o,i,l,f,d){let g=null;if(o&8&&c(n,0),n.getToken()===1077936155){b(n,e|8192);let{tokenIndex:m,tokenLine:y,tokenColumn:a}=n;n.getToken()===537079927&&c(n,119);let k=2883584|((o&64)===0?4325376:0);e=(e|k)^k|(o&8?262144:0)|(o&16?524288:0)|(o&64?4194304:0)|65536|16777216,g=_(n,e|4096,u,2,0,1,0,1,m,y,a),((n.getToken()&1073741824)!==1073741824||(n.getToken()&4194304)===4194304)&&(g=O(n,e|4096,u,g,0,0,m,y,a),g=J(n,e|4096,u,0,0,m,y,a,g))}return K(n,e),s(n,e,l,f,d,{type:o&1024?"AccessorProperty":"PropertyDefinition",key:t,value:g,static:(o&32)>0,computed:(o&2)>0,...e&1?{decorators:i}:null})}function ge(n,e,u,t,o,i,l,f,d){if(n.getToken()&143360||(e&256)===0&&n.getToken()===-2147483527)return hn(n,e,u,o,i,l,f,d);(n.getToken()&2097152)!==2097152&&c(n,30,V[n.getToken()&255]);let g=n.getToken()===69271571?Q(n,e,u,t,1,0,1,o,i,l,f,d):Z(n,e,u,t,1,0,1,o,i,l,f,d);return n.destructible&16&&c(n,50),n.destructible&32&&c(n,50),g}function hn(n,e,u,t,o,i,l,f){let{tokenValue:d}=n,g=n.getToken();return e&256&&((g&537079808)===537079808?c(n,119):((g&36864)===36864||g===-2147483527)&&c(n,118)),(g&20480)===20480&&c(n,102),g===241771&&(e&262144&&c(n,32),e&512&&c(n,111)),(g&255)===73&&t&24&&c(n,100),g===209006&&(e&524288&&c(n,176),e&512&&c(n,110)),b(n,e),u&&n2(n,e,u,d,t,o),s(n,e,i,l,f,{type:"Identifier",name:d})}function Q2(n,e,u,t,o,i,l){if(t||C(n,e,8456256),n.getToken()===8390721){let m=u1(n,e,o,i,l),[y,a]=l1(n,e,u,t);return s(n,e,o,i,l,{type:"JSXFragment",openingFragment:m,children:y,closingFragment:a})}n.getToken()===8457014&&c(n,30,V[n.getToken()&255]);let f=null,d=[],g=g1(n,e,u,t,o,i,l);if(!g.selfClosing){[d,f]=o1(n,e,u,t);let m=j2(f.name);j2(g.name)!==m&&c(n,155,m)}return s(n,e,o,i,l,{type:"JSXElement",children:d,openingElement:g,closingElement:f})}function u1(n,e,u,t,o){return w2(n,e),s(n,e,u,t,o,{type:"JSXOpeningFragment"})}function t1(n,e,u,t,o,i){C(n,e,8457014);let l=me(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn);return n.getToken()!==8390721&&c(n,25,V[65]),u?w2(n,e):b(n,e),s(n,e,t,o,i,{type:"JSXClosingElement",name:l})}function i1(n,e,u,t,o,i){return C(n,e,8457014),n.getToken()!==8390721&&c(n,25,V[65]),u?w2(n,e):b(n,e),s(n,e,t,o,i,{type:"JSXClosingFragment"})}function o1(n,e,u,t){let o=[];for(;;){let i=f1(n,e,u,t,n.tokenIndex,n.tokenLine,n.tokenColumn);if(i.type==="JSXClosingElement")return[o,i];o.push(i)}}function l1(n,e,u,t){let o=[];for(;;){let i=d1(n,e,u,t,n.tokenIndex,n.tokenLine,n.tokenColumn);if(i.type==="JSXClosingFragment")return[o,i];o.push(i)}}function f1(n,e,u,t,o,i,l){if(n.getToken()===137)return ce(n,e,o,i,l);if(n.getToken()===2162700)return An(n,e,u,1,0,o,i,l);if(n.getToken()===8456256)return b(n,e),n.getToken()===8457014?t1(n,e,t,o,i,l):Q2(n,e,u,1,o,i,l);c(n,0)}function d1(n,e,u,t,o,i,l){if(n.getToken()===137)return ce(n,e,o,i,l);if(n.getToken()===2162700)return An(n,e,u,1,0,o,i,l);if(n.getToken()===8456256)return b(n,e),n.getToken()===8457014?i1(n,e,t,o,i,l):Q2(n,e,u,1,o,i,l);c(n,0)}function ce(n,e,u,t,o){b(n,e);let i={type:"JSXText",value:n.tokenValue};return e&128&&(i.raw=n.tokenRaw),s(n,e,u,t,o,i)}function g1(n,e,u,t,o,i,l){(n.getToken()&143360)!==143360&&(n.getToken()&4096)!==4096&&c(n,0);let f=me(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn),d=m1(n,e,u),g=n.getToken()===8457014;return g&&C(n,e,8457014),n.getToken()!==8390721&&c(n,25,V[65]),t||!g?w2(n,e):b(n,e),s(n,e,o,i,l,{type:"JSXOpeningElement",name:f,attributes:d,selfClosing:g})}function me(n,e,u,t,o){x2(n);let i=Z2(n,e,u,t,o);if(n.getToken()===21)return ke(n,e,i,u,t,o);for(;P(n,e,67108877);)x2(n),i=c1(n,e,i,u,t,o);return i}function c1(n,e,u,t,o,i){let l=Z2(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn);return s(n,e,t,o,i,{type:"JSXMemberExpression",object:u,property:l})}function m1(n,e,u){let t=[];for(;n.getToken()!==8457014&&n.getToken()!==8390721&&n.getToken()!==1048576;)t.push(a1(n,e,u,n.tokenIndex,n.tokenLine,n.tokenColumn));return t}function k1(n,e,u,t,o,i){b(n,e),C(n,e,14);let l=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);return C(n,e,1074790415),s(n,e,t,o,i,{type:"JSXSpreadAttribute",argument:l})}function a1(n,e,u,t,o,i){if(n.getToken()===2162700)return k1(n,e,u,t,o,i);x2(n);let l=null,f=Z2(n,e,t,o,i);if(n.getToken()===21&&(f=ke(n,e,f,t,o,i)),n.getToken()===1077936155){let d=Ge(n,e),{tokenIndex:g,tokenLine:m,tokenColumn:y}=n;switch(d){case 134283267:l=H(n,e);break;case 8456256:l=Q2(n,e,u,0,g,m,y);break;case 2162700:l=An(n,e,u,0,1,g,m,y);break;default:c(n,154)}}return s(n,e,t,o,i,{type:"JSXAttribute",value:l,name:f})}function ke(n,e,u,t,o,i){C(n,e,21);let l=Z2(n,e,n.tokenIndex,n.tokenLine,n.tokenColumn);return s(n,e,t,o,i,{type:"JSXNamespacedName",namespace:u,name:l})}function An(n,e,u,t,o,i,l,f){b(n,e|8192);let{tokenIndex:d,tokenLine:g,tokenColumn:m}=n;if(n.getToken()===14)return y1(n,e,u,i,l,f);let y=null;return n.getToken()===1074790415?(o&&c(n,157),y=s1(n,e,n.startIndex,n.startLine,n.startColumn)):y=M(n,e,u,1,0,d,g,m),n.getToken()!==1074790415&&c(n,25,V[15]),t?w2(n,e):b(n,e),s(n,e,i,l,f,{type:"JSXExpressionContainer",expression:y})}function y1(n,e,u,t,o,i){C(n,e,14);let l=M(n,e,u,1,0,n.tokenIndex,n.tokenLine,n.tokenColumn);return C(n,e,1074790415),s(n,e,t,o,i,{type:"JSXSpreadChild",expression:l})}function s1(n,e,u,t,o){return n.startIndex=n.tokenIndex,n.startLine=n.tokenLine,n.startColumn=n.tokenColumn,s(n,e,u,t,o,{type:"JSXEmptyExpression"})}function Z2(n,e,u,t,o){n.getToken()&143360||c(n,30,V[n.getToken()&255]);let{tokenValue:i}=n;return b(n,e),s(n,e,u,t,o,{type:"JSXIdentifier",name:i})}function ae(n,e){return du(n,e,0)}function h1(n,e){let u=new SyntaxError(n+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(u,e)}var ye=h1;function A1(n){let e=[];for(let u of n)try{return u()}catch(t){e.push(t)}throw Object.assign(new Error("All combinations failed"),{errors:e})}var se=A1;var b1=(n,e,u)=>{if(!(n&&e==null))return Array.isArray(e)||typeof e=="string"?e[u<0?e.length+u:u]:e.at(u)},bn=b1;function D1(n){return Array.isArray(n)&&n.length>0}var he=D1;function G(n){var t,o,i;let e=((t=n.range)==null?void 0:t[0])??n.start,u=(i=((o=n.declaration)==null?void 0:o.decorators)??n.decorators)==null?void 0:i[0];return u?Math.min(G(u),e):e}function u2(n){var e;return((e=n.range)==null?void 0:e[1])??n.end}function T1(n){let e=new Set(n);return u=>e.has(u==null?void 0:u.type)}var Ae=T1;var C1=Ae(["Block","CommentBlock","MultiLine"]),q2=C1;function E1(n){let e=`*${n.value}*`.split(` +`);return e.length>1&&e.every(u=>u.trimStart()[0]==="*")}var Dn=E1;function w1(n){return q2(n)&&n.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(n.value)}var be=w1;var S2=null;function P2(n){if(S2!==null&&typeof S2.property){let e=S2;return S2=P2.prototype=null,e}return S2=P2.prototype=n??Object.create(null),new P2}var B1=10;for(let n=0;n<=B1;n++)P2();function Tn(n){return P2(n)}function I1(n,e="type"){Tn(n);function u(t){let o=t[e],i=n[o];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${o}'.`),{node:t});return i}return u}var De=I1;var Te={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var L1=De(Te),Ce=L1;function Cn(n,e){if(!(n!==null&&typeof n=="object"))return n;if(Array.isArray(n)){for(let t=0;t{var l;(l=i.leadingComments)!=null&&l.some(be)&&o.add(G(i))}),n=G2(n,i=>{if(i.type==="ParenthesizedExpression"){let{expression:l}=i;if(l.type==="TypeCastExpression")return l.range=[...i.range],l;let f=G(i);if(!o.has(f))return l.extra={...l.extra,parenthesized:!0},l}})}if(n=G2(n,o=>{switch(o.type){case"LogicalExpression":if(Ee(o))return En(o);break;case"VariableDeclaration":{let i=bn(!1,o.declarations,-1);i!=null&&i.init&&t[u2(i)]!==";"&&(o.range=[G(o),u2(i)]);break}case"TSParenthesizedType":return o.typeAnnotation;case"TSTypeParameter":if(typeof o.name=="string"){let i=G(o);o.name={type:"Identifier",name:o.name,range:[i,i+o.name.length]}}break;case"TopicReference":n.extra={...n.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(o.types.length===1)return o.types[0];break}}),he(n.comments)){let o=bn(!1,n.comments,-1);for(let i=n.comments.length-2;i>=0;i--){let l=n.comments[i];u2(l)===G(o)&&q2(l)&&q2(o)&&Dn(l)&&Dn(o)&&(n.comments.splice(i+1,1),l.value+="*//*"+o.value,l.range=[G(l),u2(o)]),o=l}}return n.type==="Program"&&(n.range=[0,t.length]),n}function Ee(n){return n.type==="LogicalExpression"&&n.right.type==="LogicalExpression"&&n.operator===n.right.operator}function En(n){return Ee(n)?En({type:"LogicalExpression",operator:n.operator,left:En({type:"LogicalExpression",operator:n.operator,left:n.left,right:n.right.left,range:[G(n.left),u2(n.right.left)]}),right:n.right.right,range:[G(n),u2(n)]}):n}var we=F1;var q1=/\*\/$/,S1=/^\/\*\*?/,P1=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,v1=/(^|\s+)\/\/([^\n\r]*)/g,Be=/^(\r?\n)+/,N1=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,Ie=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,V1=/(\r?\n|^) *\* ?/g,O1=[];function Le(n){let e=n.match(P1);return e?e[0].trimStart():""}function Fe(n){let e=` +`;n=i2(!1,n.replace(S1,"").replace(q1,""),V1,"$1");let u="";for(;u!==n;)u=n,n=i2(!1,n,N1,`${e}$1 $2${e}`);n=n.replace(Be,"").trimEnd();let t=Object.create(null),o=i2(!1,n,Ie,"").replace(Be,"").trimEnd(),i;for(;i=Ie.exec(n);){let l=i2(!1,i[2],v1,"");if(typeof t[i[1]]=="string"||Array.isArray(t[i[1]])){let f=t[i[1]];t[i[1]]=[...O1,...Array.isArray(f)?f:[f],l]}else t[i[1]]=l}return{comments:o,pragmas:t}}function R1(n){if(!n.startsWith("#!"))return"";let e=n.indexOf(` +`);return e===-1?n:n.slice(0,e)}var qe=R1;function U1(n){let e=qe(n);e&&(n=n.slice(e.length+1));let u=Le(n),{pragmas:t,comments:o}=Fe(u);return{shebang:e,text:n,pragmas:t,comments:o}}function Se(n){let{pragmas:e}=U1(n);return Object.prototype.hasOwnProperty.call(e,"prettier")||Object.prototype.hasOwnProperty.call(e,"format")}function M1(n){return n=typeof n=="function"?{parse:n}:n,{astFormat:"estree",hasPragma:Se,locStart:G,locEnd:u2,...n}}var Pe=M1;function J1(n){let{filepath:e}=n;if(e){if(e=e.toLowerCase(),e.endsWith(".cjs")||e.endsWith(".cts"))return"script";if(e.endsWith(".mjs")||e.endsWith(".mts"))return"module"}}var ve=J1;var j1={next:!0,ranges:!0,webcompat:!0,loc:!0,raw:!0,directives:!0,globalReturn:!0,impliedStrict:!1,preserveParens:!1,lexical:!1,jsx:!0,uniqueKeyInPattern:!1};function X1(n,e){let u=[],t=[],o=ae(n,{...j1,module:e==="module",onComment:u,onToken:t});return o.comments=u,o.tokens=t,o}function H1(n){let{message:e,loc:u}=n;if(!u)return n;let t=`[${[u.start,u.end].map(({line:o,column:i})=>[o,i].join(":")).join("-")}]: `;return e.startsWith(t)&&(e=e.slice(t.length)),ye(e,{loc:{start:{line:u.start.line,column:u.start.column+1},end:{line:u.end.line,column:u.end.column+1}},cause:n})}function z1(n,e={}){let u=ve(e),t=(u?[u]:["module","script"]).map(i=>()=>X1(n,i)),o;try{o=se(t)}catch({errors:[i]}){throw H1(i)}return we(o,{parser:"meriyah",text:n})}var K1=Pe(z1);var $0=Bn;export{$0 as default,wn as parsers}; diff --git a/node_modules/prettier/plugins/postcss.js b/node_modules/prettier/plugins/postcss.js new file mode 100644 index 0000000..5f141ad --- /dev/null +++ b/node_modules/prettier/plugins/postcss.js @@ -0,0 +1,54 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.postcss=e()}})(function(){"use strict";var hl=Object.create;var Tt=Object.defineProperty;var dl=Object.getOwnPropertyDescriptor;var ml=Object.getOwnPropertyNames;var yl=Object.getPrototypeOf,gl=Object.prototype.hasOwnProperty;var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zs=(t,e)=>{for(var s in e)Tt(t,s,{get:e[s],enumerable:!0})},en=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ml(e))!gl.call(t,n)&&n!==s&&Tt(t,n,{get:()=>e[n],enumerable:!(r=dl(e,n))||r.enumerable});return t};var xe=(t,e,s)=>(s=t!=null?hl(yl(t)):{},en(e||!t||!t.__esModule?Tt(s,"default",{value:t,enumerable:!0}):s,t)),wl=t=>en(Tt({},"__esModule",{value:!0}),t);var bi=g((bv,ss)=>{var _=String,xi=function(){return{isColorSupported:!1,reset:_,bold:_,dim:_,italic:_,underline:_,inverse:_,hidden:_,strikethrough:_,black:_,red:_,green:_,yellow:_,blue:_,magenta:_,cyan:_,white:_,gray:_,bgBlack:_,bgRed:_,bgGreen:_,bgYellow:_,bgBlue:_,bgMagenta:_,bgCyan:_,bgWhite:_,blackBright:_,redBright:_,greenBright:_,yellowBright:_,blueBright:_,magentaBright:_,cyanBright:_,whiteBright:_,bgBlackBright:_,bgRedBright:_,bgGreenBright:_,bgYellowBright:_,bgBlueBright:_,bgMagentaBright:_,bgCyanBright:_,bgWhiteBright:_}};ss.exports=xi();ss.exports.createColors=xi});var ns=g(()=>{});var Yt=g((kv,ki)=>{"use strict";var _i=bi(),Ei=ns(),ot=class t extends Error{constructor(e,s,r,n,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,t)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=_i.isColorSupported);let r=f=>f,n=f=>f,i=f=>f;if(e){let{bold:f,gray:p,red:l}=_i.createColors(!0);n=y=>f(l(y)),r=y=>p(y),Ei&&(i=y=>Ei(y))}let o=s.split(/\r?\n/),u=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;return o.slice(u,a).map((f,p)=>{let l=u+1+p,y=" "+(" "+l).slice(-c)+" | ";if(l===this.line){if(f.length>160){let h=20,d=Math.max(0,this.column-h),m=Math.max(this.column+h,this.endColumn+h),b=f.slice(d,m),w=r(y.replace(/\d/g," "))+f.slice(0,Math.min(this.column-1,h-1)).replace(/[^\t]/g," ");return n(">")+r(y)+i(b)+` + `+w+n("^")}let x=r(y.replace(/\d/g," "))+f.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(y)+i(f)+` + `+x+n("^")}return" "+r(y)+i(f)}).join(` +`)}toString(){let e=this.showSourceCode();return e&&(e=` + +`+e+` +`),this.name+": "+this.message+e}};ki.exports=ot;ot.default=ot});var Vt=g((Sv,Ti)=>{"use strict";var Si={after:` +`,beforeClose:` +`,beforeComment:` +`,beforeDecl:` +`,beforeOpen:" ",beforeRule:` +`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function wc(t){return t[0].toUpperCase()+t.slice(1)}var at=class{constructor(e){this.builder=e}atrule(e,s){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(s?";":"");this.builder(r+n+i,e)}}beforeAfter(e,s){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):s==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&n.type!=="root";)i+=1,n=n.parent;if(r.includes(` +`)){let o=this.raw(e,null,"indent");if(o.length)for(let u=0;u0&&e.nodes[s].type==="comment";)s-=1;let r=this.raw(e,"semicolon");for(let n=0;n{if(n=a.raws[s],typeof n<"u")return!1})}return typeof n>"u"&&(n=Si[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return s=r.raws.after,s.includes(` +`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawBeforeComment(e,s){let r;return e.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(` +`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(s,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,s){let r;return e.walkDecls(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(` +`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(s,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let s;return e.walk(r=>{if(r.type!=="decl"&&(s=r.raws.between,typeof s<"u"))return!1}),s}rawBeforeRule(e){let s;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return s=r.raws.before,s.includes(` +`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawColon(e){let s;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return s=r.raws.between.replace(/[^\s:]/g,""),!1}),s}rawEmptyBody(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(s=r.raws.after,typeof s<"u"))return!1}),s}rawIndent(e){if(e.raws.indent)return e.raws.indent;let s;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&typeof r.raws.before<"u"){let i=r.raws.before.split(` +`);return s=i[i.length-1],s=s.replace(/\S/g,""),!1}}),s}rawSemicolon(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(s=r.raws.semicolon,typeof s<"u"))return!1}),s}rawValue(e,s){let r=e[s],n=e.raws[s];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,s){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,s)}};Ti.exports=at;at.default=at});var ut=g((Tv,Ci)=>{"use strict";var vc=Vt();function is(t,e){new vc(e).stringify(t)}Ci.exports=is;is.default=is});var zt=g((Cv,os)=>{"use strict";os.exports.isClean=Symbol("isClean");os.exports.my=Symbol("my")});var pt=g((Ov,Oi)=>{"use strict";var xc=Yt(),bc=Vt(),_c=ut(),{isClean:lt,my:Ec}=zt();function as(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let n=t[r],i=typeof n;r==="parent"&&i==="object"?e&&(s[r]=e):r==="source"?s[r]=n:Array.isArray(n)?s[r]=n.map(o=>as(o,s)):(i==="object"&&n!==null&&(n=as(n)),s[r]=n)}return s}function ct(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,n=0;for(let i=0;ie.root().toProxy():e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="prop"||s==="value"||s==="name"||s==="params"||s==="important"||s==="text")&&e.markDirty()),!0}}}markClean(){this[lt]=!0}markDirty(){if(this[lt]){this[lt]=!1;let e=this;for(;e=e.parent;)e[lt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let s=this.source.start;if(e.index)s=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,i=r.slice(ct(r,this.source.start),ct(r,this.source.end)).indexOf(e.word);i!==-1&&(s=this.positionInside(i))}return s}positionInside(e){let s=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,i=ct(n,this.source.start),o=i+e;for(let u=i;utypeof a=="object"&&a.toJSON?a.toJSON(null,s):a);else if(typeof u=="object"&&u.toJSON)r[o]=u.toJSON(null,s);else if(o==="source"){let a=s.get(u.input);a==null&&(a=i,s.set(u.input,i),i++),r[o]={end:u.end,inputId:a,start:u.start}}else r[o]=u}return n&&(r.inputs=[...s.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=_c){e.stringify&&(e=e.stringify);let s="";return e(this,r=>{s+=r}),s}warn(e,s,r){let n={node:this};for(let i in r)n[i]=r[i];return e.warn(s,n)}};Oi.exports=ft;ft.default=ft});var Re=g((Av,Ai)=>{"use strict";var kc=pt(),ht=class extends kc{constructor(e){super(e),this.type="comment"}};Ai.exports=ht;ht.default=ht});var mt=g((Nv,Ni)=>{"use strict";var Sc=pt(),dt=class extends Sc{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};Ni.exports=dt;dt.default=dt});var le=g((Pv,Ui)=>{"use strict";var Pi=Re(),Ri=mt(),Tc=pt(),{isClean:Ii,my:qi}=zt(),us,Li,Di,ls;function Bi(t){return t.map(e=>(e.nodes&&(e.nodes=Bi(e.nodes)),delete e.source,e))}function Mi(t){if(t[Ii]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)Mi(e)}var z=class t extends Tc{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let n of r)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,n;for(;this.indexes[s]e[s](...r.map(n=>typeof n=="function"?(i,o)=>n(i.toProxy(),o):n)):s==="every"||s==="some"?r=>e[s]((n,...i)=>r(n.toProxy(),...i)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),n=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of n)this.proxyOf.nodes.splice(r+1,0,o);let i;for(let o in this.indexes)i=this.indexes[o],r"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ri(e)]}else if(e.selector||e.selectors)e=[new ls(e)];else if(e.name)e=[new us(e)];else if(e.text)e=[new Pi(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[qi]||t.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[Ii]&&Mi(n),n.raws||(n.raws={}),typeof n.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(n.raws.before=s.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(n=>{s.props&&!s.props.includes(n.prop)||s.fast&&!n.value.includes(s.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let n;try{n=e(s,r)}catch(i){throw s.addToError(i)}return n!==!1&&s.walk&&(n=s.walk(e)),n})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return s(r,n)}):(s=e,this.walk((r,n)=>{if(r.type==="atrule")return s(r,n)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return s(r,n)}):(s=e,this.walk((r,n)=>{if(r.type==="decl")return s(r,n)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return s(r,n)}):(s=e,this.walk((r,n)=>{if(r.type==="rule")return s(r,n)}))}};z.registerParse=t=>{Li=t};z.registerRule=t=>{ls=t};z.registerAtRule=t=>{us=t};z.registerRoot=t=>{Di=t};Ui.exports=z;z.default=z;z.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,us.prototype):t.type==="rule"?Object.setPrototypeOf(t,ls.prototype):t.type==="decl"?Object.setPrototypeOf(t,Ri.prototype):t.type==="comment"?Object.setPrototypeOf(t,Pi.prototype):t.type==="root"&&Object.setPrototypeOf(t,Di.prototype),t[qi]=!0,t.nodes&&t.nodes.forEach(e=>{z.rebuild(e)})}});var $i=g((Rv,Fi)=>{var Cc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Oc=(t,e=21)=>(s=e)=>{let r="",n=s|0;for(;n--;)r+=t[Math.random()*t.length|0];return r},Ac=(t=21)=>{let e="",s=t|0;for(;s--;)e+=Cc[Math.random()*64|0];return e};Fi.exports={nanoid:Ac,customAlphabet:Oc}});var Wi=g(()=>{});var cs=g((Lv,Yi)=>{Yi.exports=class{}});var qe=g((Bv,ji)=>{"use strict";var{nanoid:Nc}=$i(),{isAbsolute:hs,resolve:ds}={},{SourceMapConsumer:Pc,SourceMapGenerator:Rc}=Wi(),{fileURLToPath:Vi,pathToFileURL:Gt}={},zi=Yt(),Ic=cs(),fs=ns(),ps=Symbol("fromOffsetCache"),qc=!!(Pc&&Rc),Gi=!!(ds&&hs),Ie=class{get from(){return this.file||this.id}constructor(e,s={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!Gi||/^\w+:\/\//.test(s.from)||hs(s.from)?this.file=s.from:this.file=ds(s.from)),Gi&&qc){let r=new Ic(this.css,s);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id=""),this.map&&(this.map.file=this.from)}error(e,s,r,n={}){let i,o,u;if(s&&typeof s=="object"){let c=s,f=r;if(typeof c.offset=="number"){let p=this.fromOffset(c.offset);s=p.line,r=p.col}else s=c.line,r=c.column;if(typeof f.offset=="number"){let p=this.fromOffset(f.offset);o=p.line,i=p.col}else o=f.line,i=f.column}else if(!r){let c=this.fromOffset(s);s=c.line,r=c.col}let a=this.origin(s,r,o,i);return a?u=new zi(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):u=new zi(e,o===void 0?s:{column:r,line:s},o===void 0?r:{column:i,line:o},this.css,this.file,n.plugin),u.input={column:r,endColumn:i,endLine:o,line:s,source:this.css},this.file&&(Gt&&(u.input.url=Gt(this.file).toString()),u.input.file=this.file),u}fromOffset(e){let s,r;if(this[ps])r=this[ps];else{let i=this.css.split(` +`);r=new Array(i.length);let o=0;for(let u=0,a=i.length;u=s)n=r.length-1;else{let i=r.length-2,o;for(;n>1),e=r[o+1])n=o+1;else{n=o;break}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ds(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,r,n){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:s,line:e});if(!o.source)return!1;let u;typeof r=="number"&&(u=i.originalPositionFor({column:n,line:r}));let a;hs(o.source)?a=Gt(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||Gt(this.map.mapFile));let c={column:o.column,endColumn:u&&u.column,endLine:u&&u.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Vi)c.file=Vi(a);else throw new Error("file: protocol is not available in this PostCSS build");let f=i.sourceContentFor(o.source);return f&&(c.source=f),c}toJSON(){let e={};for(let s of["hasBOM","css","file","id"])this[s]!=null&&(e[s]=this[s]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};ji.exports=Ie;Ie.default=Ie;fs&&fs.registerInput&&fs.registerInput(Ie)});var jt=g((Mv,Ki)=>{"use strict";var Hi=le(),Le=class extends Hi{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};Ki.exports=Le;Le.default=Le;Hi.registerAtRule(Le)});var De=g((Uv,Zi)=>{"use strict";var Qi=le(),Ji,Xi,ce=class extends Qi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,s,r){let n=super.normalize(e);if(s){if(r==="prepend")this.nodes.length>1?s.raws.before=this.nodes[1].raws.before:delete s.raws.before;else if(this.first!==s)for(let i of n)i.raws.before=s.raws.before}return n}removeChild(e,s){let r=this.index(e);return!s&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Ji(new Xi,this,e).stringify()}};ce.registerLazyResult=t=>{Ji=t};ce.registerProcessor=t=>{Xi=t};Zi.exports=ce;ce.default=ce;Qi.registerRoot(ce)});var ms=g((Fv,eo)=>{"use strict";var yt={comma(t){return yt.split(t,[","],!0)},space(t){let e=[" ",` +`," "];return yt.split(t,e)},split(t,e,s){let r=[],n="",i=!1,o=0,u=!1,a="",c=!1;for(let f of t)c?c=!1:f==="\\"?c=!0:u?f===a&&(u=!1):f==='"'||f==="'"?(u=!0,a=f):f==="("?o+=1:f===")"?o>0&&(o-=1):o===0&&e.includes(f)&&(i=!0),i?(n!==""&&r.push(n.trim()),n="",i=!1):n+=f;return(s||n!=="")&&r.push(n.trim()),r}};eo.exports=yt;yt.default=yt});var Ht=g(($v,ro)=>{"use strict";var to=le(),Lc=ms(),Be=class extends to{get selectors(){return Lc.comma(this.selector)}set selectors(e){let s=this.selector?this.selector.match(/,\s*/):null,r=s?s[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};ro.exports=Be;Be.default=Be;to.registerRule(Be)});var Jt=g((Wv,no)=>{"use strict";var Kt=/[\t\n\f\r "#'()/;[\\\]{}]/g,Qt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Dc=/.[\r\n"'(/\\]/,so=/[\da-f]/i;no.exports=function(e,s={}){let r=e.css.valueOf(),n=s.ignoreErrors,i,o,u,a,c,f,p,l,y,x,h=r.length,d=0,m=[],b=[];function w(){return d}function v(W){throw e.error("Unclosed "+W,d)}function N(){return b.length===0&&d>=h}function F(W){if(b.length)return b.pop();if(d>=h)return;let T=W?W.ignoreUnclosed:!1;switch(i=r.charCodeAt(d),i){case 10:case 32:case 9:case 13:case 12:{a=d;do a+=1,i=r.charCodeAt(a);while(i===32||i===10||i===9||i===13||i===12);f=["space",r.slice(d,a)],d=a-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let C=String.fromCharCode(i);f=[C,C,d];break}case 40:{if(x=m.length?m.pop()[1]:"",y=r.charCodeAt(d+1),x==="url"&&y!==39&&y!==34&&y!==32&&y!==10&&y!==9&&y!==12&&y!==13){a=d;do{if(p=!1,a=r.indexOf(")",a+1),a===-1)if(n||T){a=d;break}else v("bracket");for(l=a;r.charCodeAt(l-1)===92;)l-=1,p=!p}while(p);f=["brackets",r.slice(d,a+1),d,a],d=a}else a=r.indexOf(")",d+1),o=r.slice(d,a+1),a===-1||Dc.test(o)?f=["(","(",d]:(f=["brackets",o,d,a],d=a);break}case 39:case 34:{c=i===39?"'":'"',a=d;do{if(p=!1,a=r.indexOf(c,a+1),a===-1)if(n||T){a=d+1;break}else v("string");for(l=a;r.charCodeAt(l-1)===92;)l-=1,p=!p}while(p);f=["string",r.slice(d,a+1),d,a],d=a;break}case 64:{Kt.lastIndex=d+1,Kt.test(r),Kt.lastIndex===0?a=r.length-1:a=Kt.lastIndex-2,f=["at-word",r.slice(d,a+1),d,a],d=a;break}case 92:{for(a=d,u=!0;r.charCodeAt(a+1)===92;)a+=1,u=!u;if(i=r.charCodeAt(a+1),u&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(a+=1,so.test(r.charAt(a)))){for(;so.test(r.charAt(a+1));)a+=1;r.charCodeAt(a+1)===32&&(a+=1)}f=["word",r.slice(d,a+1),d,a],d=a;break}default:{i===47&&r.charCodeAt(d+1)===42?(a=r.indexOf("*/",d+2)+1,a===0&&(n||T?a=r.length:v("comment")),f=["comment",r.slice(d,a+1),d,a],d=a):(Qt.lastIndex=d+1,Qt.test(r),Qt.lastIndex===0?a=r.length-1:a=Qt.lastIndex-2,f=["word",r.slice(d,a+1),d,a],m.push(f),d=a);break}}return d++,f}function Q(W){b.push(W)}return{back:Q,endOfFile:N,nextToken:F,position:w}}});var Xt=g((Yv,ao)=>{"use strict";var Bc=jt(),Mc=Re(),Uc=mt(),Fc=De(),io=Ht(),$c=Jt(),oo={empty:!0,space:!0};function Wc(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}var ys=class{constructor(e){this.input=e,this.root=new Fc,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let s=new Bc;s.name=e[1].slice(1),s.name===""&&this.unnamedAtrule(s,e),this.init(s,e[2]);let r,n,i,o=!1,u=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){u=!0;break}else if(r==="}"){if(a.length>0){for(i=a.length-1,n=a[i];n&&n[0]==="space";)n=a[--i];n&&(s.source.end=this.getPosition(n[3]||n[2]),s.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),u&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let s=this.colon(e);if(s===!1)return;let r=0,n;for(let i=s-1;i>=0&&(n=e[i],!(n[0]!=="space"&&(r+=1,r===2)));i--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let s=0,r,n,i;for(let[o,u]of e.entries()){if(n=u,i=n[0],i==="("&&(s+=1),i===")"&&(s-=1),s===0&&i===":")if(!r)this.doubleColon(n);else{if(r[0]==="word"&&r[1]==="progid")continue;return o}r=n}return!1}comment(e){let s=new Mc;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))s.text="",s.raws.left=r,s.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);s.text=n[2],s.raws.left=n[1],s.raws.right=n[3]}}createTokenizer(){this.tokenizer=$c(this.input)}decl(e,s){let r=new Uc;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||Wc(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let i;for(;e.length;)if(i=e.shift(),i[0]===":"){r.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),r.raws.between+=i[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],u;for(;e.length&&(u=e[0][0],!(u!=="space"&&u!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(i=e[c],i[1].toLowerCase()==="!important"){r.important=!0;let f=this.stringFrom(e,c);f=this.spacesFromEnd(e)+f,f!==" !important"&&(r.raws.important=f);break}else if(i[1].toLowerCase()==="important"){let f=e.slice(0),p="";for(let l=c;l>0;l--){let y=f[l][0];if(p.trim().startsWith("!")&&y!=="space")break;p=f.pop()[1]+p}p.trim().startsWith("!")&&(r.important=!0,r.raws.important=p,e=f)}if(i[0]!=="space"&&i[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(r.raws.between+=o.map(c=>c[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),s),r.value.includes(":")&&!s&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let s=new io;this.init(s,e[2]),s.selector="",s.raws.between="",this.current=s}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let s=this.current.nodes[this.current.nodes.length-1];s&&s.type==="rule"&&!s.raws.ownSemicolon&&(s.raws.ownSemicolon=this.spaces,this.spaces="",s.source.end=this.getPosition(e[2]),s.source.end.offset+=s.raws.ownSemicolon.length)}}getPosition(e){let s=this.input.fromOffset(e);return{column:s.col,line:s.line,offset:e}}init(e,s){this.current.push(e),e.source={input:this.input,start:this.getPosition(s)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let s=!1,r=null,n=!1,i=null,o=[],u=e[1].startsWith("--"),a=[],c=e;for(;c;){if(r=c[0],a.push(c),r==="("||r==="[")i||(i=c),o.push(r==="("?")":"]");else if(u&&n&&r==="{")i||(i=c),o.push("}");else if(o.length===0)if(r===";")if(n){this.decl(a,u);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),s=!0;break}else r===":"&&(n=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(s=!0),o.length>0&&this.unclosedBracket(i),s&&n){if(!u)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,u)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,s,r,n){let i,o,u=r.length,a="",c=!0,f,p;for(let l=0;ly+x[1],"");e.raws[s]={raw:l,value:a}}e[s]=a}rule(e){e.pop();let s=new io;this.init(s,e[0][2]),s.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(s,"selector",e),this.current=s}spacesAndCommentsFromEnd(e){let s,r="";for(;e.length&&(s=e[e.length-1][0],!(s!=="space"&&s!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let s,r="";for(;e.length&&(s=e[0][0],!(s!=="space"&&s!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let s,r="";for(;e.length&&(s=e[e.length-1][0],s==="space");)r=e.pop()[1]+r;return r}stringFrom(e,s){let r="";for(let n=s;n{"use strict";var Yc=le(),Vc=qe(),zc=Xt();function Zt(t,e){let s=new Vc(t,e),r=new zc(s);try{r.parse()}catch(n){throw n}return r.root}uo.exports=Zt;Zt.default=Zt;Yc.registerParse(Zt)});var lo=g((zv,gs)=>{var Gc=Jt(),jc=qe();gs.exports={isInlineComment(t){if(t[0]==="word"&&t[1].slice(0,2)==="//"){let e=t,s=[],r,n;for(;t;){if(/\r?\n/.test(t[1])){if(/['"].*\r?\n/.test(t[1])){s.push(t[1].substring(0,t[1].indexOf(` +`))),n=t[1].substring(t[1].indexOf(` +`));let o=this.input.css.valueOf().substring(this.tokenizer.position());n+=o,r=t[3]+o.length-n.length}else this.tokenizer.back(t);break}s.push(t[1]),r=t[2],t=this.tokenizer.nextToken({ignoreUnclosed:!0})}let i=["comment",s.join(""),e[2],r];return this.inlineComment(i),n&&(this.input=new jc(n),this.tokenizer=Gc(this.input)),!0}else if(t[1]==="/"){let e=this.tokenizer.nextToken({ignoreUnclosed:!0});if(e[0]==="comment"&&/^\/\*/.test(e[1]))return e[0]="word",e[1]=e[1].slice(1),t[1]="//",this.tokenizer.back(e),gs.exports.isInlineComment.bind(this)(t)}return!1}}});var fo=g((Gv,co)=>{co.exports={interpolation(t){let e=[t,this.tokenizer.nextToken()],s=["word","}"];if(e[0][1].length>1||e[1][0]!=="{")return this.tokenizer.back(e[1]),!1;for(t=this.tokenizer.nextToken();t&&s.includes(t[0]);)e.push(t),t=this.tokenizer.nextToken();let r=e.map(u=>u[1]),[n]=e,i=e.pop(),o=["word",r.join(""),n[2],i[2]];return this.tokenizer.back(t),this.tokenizer.back(o),!0}}});var ho=g((jv,po)=>{var Hc=/^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/,Kc=/\.[0-9]/,Qc=t=>{let[,e]=t,[s]=e;return(s==="."||s==="#")&&Hc.test(e)===!1&&Kc.test(e)===!1};po.exports={isMixinToken:Qc}});var yo=g((Hv,mo)=>{var Jc=Jt(),Xc=/^url\((.+)\)/;mo.exports=t=>{let{name:e,params:s=""}=t;if(e==="import"&&s.length){t.import=!0;let r=Jc({css:s});for(t.filename=s.replace(Xc,"$1");!r.endOfFile();){let[n,i]=r.nextToken();if(n==="word"&&i==="url")return;if(n==="brackets"){t.options=i,t.filename=s.replace(i,"").trim();break}}}}});var xo=g((Kv,vo)=>{var go=/:$/,wo=/^:(\s+)?/;vo.exports=t=>{let{name:e,params:s=""}=t;if(t.name.slice(-1)===":"){if(go.test(e)){let[r]=e.match(go);t.name=e.replace(r,""),t.raws.afterName=r+(t.raws.afterName||""),t.variable=!0,t.value=t.params}if(wo.test(s)){let[r]=s.match(wo);t.value=s.replace(r,""),t.raws.afterName=(t.raws.afterName||"")+r,t.variable=!0}}}});var Eo=g((Jv,_o)=>{var Zc=Re(),ef=Xt(),{isInlineComment:tf}=lo(),{interpolation:bo}=fo(),{isMixinToken:rf}=ho(),sf=yo(),nf=xo(),of=/(!\s*important)$/i;_o.exports=class extends ef{constructor(...e){super(...e),this.lastNode=null}atrule(e){bo.bind(this)(e)||(super.atrule(e),sf(this.lastNode),nf(this.lastNode))}decl(...e){super.decl(...e),/extend\(.+\)/i.test(this.lastNode.value)&&(this.lastNode.extend=!0)}each(e){e[0][1]=` ${e[0][1]}`;let s=e.findIndex(u=>u[0]==="("),r=e.reverse().find(u=>u[0]===")"),n=e.reverse().indexOf(r),o=e.splice(s,n).map(u=>u[1]).join("");for(let u of e.reverse())this.tokenizer.back(u);this.atrule(this.tokenizer.nextToken()),this.lastNode.function=!0,this.lastNode.params=o}init(e,s,r){super.init(e,s,r),this.lastNode=e}inlineComment(e){let s=new Zc,r=e[1].slice(2);if(this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.inline=!0,s.raws.begin="//",/^\s*$/.test(r))s.text="",s.raws.left=r,s.raws.right="";else{let n=r.match(/^(\s*)([^]*[^\s])(\s*)$/);[,s.raws.left,s.text,s.raws.right]=n}}mixin(e){let[s]=e,r=s[1].slice(0,1),n=e.findIndex(c=>c[0]==="brackets"),i=e.findIndex(c=>c[0]==="("),o="";if((n<0||n>3)&&i>0){let c=e.reduce((w,v,N)=>v[0]===")"?N:w),p=e.slice(i,c+i).map(w=>w[1]).join(""),[l]=e.slice(i),y=[l[2],l[3]],[x]=e.slice(c,c+1),h=[x[2],x[3]],d=["brackets",p].concat(y,h),m=e.slice(0,i),b=e.slice(c+1);e=m,e.push(d),e=e.concat(b)}let u=[];for(let c of e)if((c[1]==="!"||u.length)&&u.push(c),c[1]==="important")break;if(u.length){let[c]=u,f=e.indexOf(c),p=u[u.length-1],l=[c[2],c[3]],y=[p[4],p[5]],h=["word",u.map(d=>d[1]).join("")].concat(l,y);e.splice(f,u.length,h)}let a=e.findIndex(c=>of.test(c[1]));a>0&&([,o]=e[a],e.splice(a,1));for(let c of e.reverse())this.tokenizer.back(c);this.atrule(this.tokenizer.nextToken()),this.lastNode.mixin=!0,this.lastNode.raws.identifier=r,o&&(this.lastNode.important=!0,this.lastNode.raws.important=o)}other(e){tf.bind(this)(e)||super.other(e)}rule(e){let s=e[e.length-1],r=e[e.length-2];if(r[0]==="at-word"&&s[0]==="{"&&(this.tokenizer.back(s),bo.bind(this)(r))){let i=this.tokenizer.nextToken();e=e.slice(0,e.length-2).concat([i]);for(let o of e.reverse())this.tokenizer.back(o);return}super.rule(e),/:extend\(.+\)/i.test(this.lastNode.selector)&&(this.lastNode.extend=!0)}unknownWord(e){let[s]=e;if(e[0][1]==="each"&&e[1][0]==="("){this.each(e);return}if(rf(s)){this.mixin(e);return}super.unknownWord(e)}}});var So=g((Zv,ko)=>{var af=Vt();ko.exports=class extends af{atrule(e,s){if(!e.mixin&&!e.variable&&!e.function){super.atrule(e,s);return}let n=`${e.function?"":e.raws.identifier||"@"}${e.name}`,i=e.params?this.rawValue(e,"params"):"",o=e.raws.important||"";if(e.variable&&(i=e.value),typeof e.raws.afterName<"u"?n+=e.raws.afterName:i&&(n+=" "),e.nodes)this.block(e,n+i+o);else{let u=(e.raws.between||"")+o+(s?";":"");this.builder(n+i+u,e)}}comment(e){if(e.inline){let s=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder(`//${s}${e.text}${r}`,e)}else super.comment(e)}}});var To=g((ex,ws)=>{var uf=qe(),lf=Eo(),cf=So();ws.exports={parse(t,e){let s=new uf(t,e),r=new lf(s);return r.parse(),r.root.walk(n=>{let i=s.css.lastIndexOf(n.source.input.css);if(i===0)return;if(i+n.source.input.css.length!==s.css.length)throw new Error("Invalid state detected in postcss-less");let o=i+n.source.start.offset,u=s.fromOffset(i+n.source.start.offset);if(n.source.start={offset:o,line:u.line,column:u.col},n.source.end){let a=i+n.source.end.offset,c=s.fromOffset(i+n.source.end.offset);n.source.end={offset:a,line:c.line,column:c.col}}}),r.root},stringify(t,e){new cf(e).stringify(t)},nodeToString(t){let e="";return ws.exports.stringify(t,s=>{e+=s}),e}}});var er=g((tx,Ao)=>{"use strict";var ff=le(),Co,Oo,ye=class extends ff{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Co(new Oo,this,e).stringify()}};ye.registerLazyResult=t=>{Co=t};ye.registerProcessor=t=>{Oo=t};Ao.exports=ye;ye.default=ye});var Po=g((rx,No)=>{"use strict";var pf=jt(),hf=Re(),df=mt(),mf=qe(),yf=cs(),gf=De(),wf=Ht();function wt(t,e){if(Array.isArray(t))return t.map(n=>wt(n));let{inputs:s,...r}=t;if(s){e=[];for(let n of s){let i={...n,__proto__:mf.prototype};i.map&&(i.map={...i.map,__proto__:yf.prototype}),e.push(i)}}if(r.nodes&&(r.nodes=t.nodes.map(n=>wt(n,e))),r.source){let{inputId:n,...i}=r.source;r.source=i,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new gf(r);if(r.type==="decl")return new df(r);if(r.type==="rule")return new wf(r);if(r.type==="comment")return new hf(r);if(r.type==="atrule")return new pf(r);throw new Error("Unknown node type: "+t.type)}No.exports=wt;wt.default=wt});var vs=g((sx,Ro)=>{Ro.exports=class{generate(){}}});var xs=g((ix,Io)=>{"use strict";var vt=class{constructor(e,s={}){if(this.type="warning",this.text=e,s.node&&s.node.source){let r=s.node.rangeBy(s);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in s)this[r]=s[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};Io.exports=vt;vt.default=vt});var tr=g((ox,qo)=>{"use strict";var vf=xs(),xt=class{get content(){return this.css}constructor(e,s,r){this.processor=e,this.messages=[],this.root=s,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let r=new vf(e,s);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}};qo.exports=xt;xt.default=xt});var bs=g((ax,Do)=>{"use strict";var Lo={};Do.exports=function(e){Lo[e]||(Lo[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var ks=g((lx,Fo)=>{"use strict";var xf=le(),bf=er(),_f=vs(),Ef=gt(),Bo=tr(),kf=De(),Sf=ut(),{isClean:K,my:Tf}=zt(),ux=bs(),Cf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Of={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Af={Once:!0,postcssPlugin:!0,prepare:!0},Me=0;function bt(t){return typeof t=="object"&&typeof t.then=="function"}function Uo(t){let e=!1,s=Cf[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,Me,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,Me,s+"Exit"]:[s,s+"Exit"]}function Mo(t){let e;return t.type==="document"?e=["Document",Me,"DocumentExit"]:t.type==="root"?e=["Root",Me,"RootExit"]:e=Uo(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function _s(t){return t[K]=!1,t.nodes&&t.nodes.forEach(e=>_s(e)),t}var Es={},fe=class t{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let n;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))n=_s(s);else if(s instanceof t||s instanceof Bo)n=_s(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let i=Ef;r.syntax&&(i=r.syntax.parse),r.parser&&(i=r.parser),i.parse&&(i=i.parse);try{n=i(s,r)}catch(o){this.processed=!0,this.error=o}n&&!n[Tf]&&xf.rebuild(n)}this.result=new Bo(e,n,r),this.helpers={...Es,postcss:Es,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,s){let r=this.result.lastPlugin;try{s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(s,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,n])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!Of[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Af[r])if(typeof s[r]=="object")for(let n in s[r])n==="*"?e(s,r,s[r][n]):e(s,r+"-"+n.toLowerCase(),s[r][n]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let r=this.visitTick(s);if(bt(r))try{await r}catch(n){let i=s[s.length-1].node;throw this.handleError(n,i)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let n=e.nodes.map(i=>r(i,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return bt(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,s=Sf;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let n=new _f(s,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let s=this.runOnRoot(e);if(bt(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[K];)e[K]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return this.async().then(e,s)}toString(){return this.css}visitSync(e,s){for(let[r,n]of e){this.result.lastPlugin=r;let i;try{i=n(s,this.helpers)}catch(o){throw this.handleError(o,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(bt(i))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:n}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&s.visitorIndex{n[K]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}};fe.registerPostcss=t=>{Es=t};Fo.exports=fe;fe.default=fe;kf.registerLazyResult(fe);bf.registerLazyResult(fe)});var Wo=g((fx,$o)=>{"use strict";var Nf=vs(),Pf=gt(),Rf=tr(),If=ut(),cx=bs(),_t=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,s=Pf;try{e=s(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,s,r){s=s.toString(),this.stringified=!1,this._processor=e,this._css=s,this._opts=r,this._map=void 0;let n,i=If;this.result=new Rf(this._processor,n,this._opts),this.result.css=s;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let u=new Nf(i,n,this._opts,s);if(u.isMap()){let[a,c]=u.generate();a&&(this.result.css=a),c&&(this.result.map=c)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,s){return this.async().then(e,s)}toString(){return this._css}warnings(){return[]}};$o.exports=_t;_t.default=_t});var Vo=g((px,Yo)=>{"use strict";var qf=er(),Lf=ks(),Df=Wo(),Bf=De(),ge=class{constructor(e=[]){this.version="8.5.3",this.plugins=this.normalize(e)}normalize(e){let s=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))s=s.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)s.push(r);else if(typeof r=="function")s.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return s}process(e,s={}){return!this.plugins.length&&!s.parser&&!s.stringifier&&!s.syntax?new Df(this,e,s):new Lf(this,e,s)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};Yo.exports=ge;ge.default=ge;Bf.registerProcessor(ge);qf.registerProcessor(ge)});var rr=g((hx,Jo)=>{"use strict";var zo=jt(),Go=Re(),Mf=le(),Uf=Yt(),jo=mt(),Ho=er(),Ff=Po(),$f=qe(),Wf=ks(),Yf=ms(),Vf=pt(),zf=gt(),Ss=Vo(),Gf=tr(),Ko=De(),Qo=Ht(),jf=ut(),Hf=xs();function k(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Ss(t)}k.plugin=function(e,s){let r=!1;function n(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide: +https://evilmartians.com/chronicles/postcss-8-plugin-migration`));let u=s(...o);return u.postcssPlugin=e,u.postcssVersion=new Ss().version,u}let i;return Object.defineProperty(n,"postcss",{get(){return i||(i=n()),i}}),n.process=function(o,u,a){return k([n(a)]).process(o,u)},n};k.stringify=jf;k.parse=zf;k.fromJSON=Ff;k.list=Yf;k.comment=t=>new Go(t);k.atRule=t=>new zo(t);k.decl=t=>new jo(t);k.rule=t=>new Qo(t);k.root=t=>new Ko(t);k.document=t=>new Ho(t);k.CssSyntaxError=Uf;k.Declaration=jo;k.Container=Mf;k.Processor=Ss;k.Document=Ho;k.Comment=Go;k.Warning=Hf;k.AtRule=zo;k.Result=Gf;k.Input=$f;k.Rule=Qo;k.Root=Ko;k.Node=Vf;Wf.registerPostcss(k);Jo.exports=k;k.default=k});var Zo=g((dx,Xo)=>{var{Container:Kf}=rr(),Ts=class extends Kf{constructor(e){super(e),this.type="decl",this.isNested=!0,this.nodes||(this.nodes=[])}};Xo.exports=Ts});var ra=g((mx,ta)=>{"use strict";var sr=/[\t\n\f\r "#'()/;[\\\]{}]/g,nr=/[,\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Qf=/.[\r\n"'(/\\]/,ea=/[\da-f]/i,ir=/[\n\f\r]/g;ta.exports=function(e,s={}){let r=e.css.valueOf(),n=s.ignoreErrors,i,o,u,a,c,f,p,l,y,x=r.length,h=0,d=[],m=[],b;function w(){return h}function v(T){throw e.error("Unclosed "+T,h)}function N(){return m.length===0&&h>=x}function F(){let T=1,C=!1,O=!1;for(;T>0;)o+=1,r.length<=o&&v("interpolation"),i=r.charCodeAt(o),l=r.charCodeAt(o+1),C?!O&&i===C?(C=!1,O=!1):i===92?O=!O:O&&(O=!1):i===39||i===34?C=i:i===125?T-=1:i===35&&l===123&&(T+=1)}function Q(T){if(m.length)return m.pop();if(h>=x)return;let C=T?T.ignoreUnclosed:!1;switch(i=r.charCodeAt(h),i){case 10:case 32:case 9:case 13:case 12:{o=h;do o+=1,i=r.charCodeAt(o);while(i===32||i===10||i===9||i===13||i===12);y=["space",r.slice(h,o)],h=o-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let O=String.fromCharCode(i);y=[O,O,h];break}case 44:{y=["word",",",h,h+1];break}case 40:{if(p=d.length?d.pop()[1]:"",l=r.charCodeAt(h+1),p==="url"&&l!==39&&l!==34){for(b=1,f=!1,o=h+1;o<=r.length-1;){if(l=r.charCodeAt(o),l===92)f=!f;else if(l===40)b+=1;else if(l===41&&(b-=1,b===0))break;o+=1}a=r.slice(h,o+1),y=["brackets",a,h,o],h=o}else o=r.indexOf(")",h+1),a=r.slice(h,o+1),o===-1||Qf.test(a)?y=["(","(",h]:(y=["brackets",a,h,o],h=o);break}case 39:case 34:{for(u=i,o=h,f=!1;o{var{Comment:Jf}=rr(),Xf=Xt(),Zf=Zo(),ep=ra(),Cs=class extends Xf{atrule(e){let s=e[1],r=e;for(;!this.tokenizer.endOfFile();){let n=this.tokenizer.nextToken();if(n[0]==="word"&&n[2]===r[3]+1)s+=n[1],r=n;else{this.tokenizer.back(n);break}}super.atrule(["at-word",s,e[2],r[3]])}comment(e){if(e[4]==="inline"){let s=new Jf;this.init(s,e[2]),s.raws.inline=!0;let r=this.input.fromOffset(e[3]);s.source.end={column:r.col,line:r.line,offset:e[3]+1};let n=e[1].slice(2);if(/^\s*$/.test(n))s.text="",s.raws.left=n,s.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/),o=i[2].replace(/(\*\/|\/\*)/g,"*//*");s.text=o,s.raws.left=i[1],s.raws.right=i[3],s.raws.text=i[2]}}else super.comment(e)}createTokenizer(){this.tokenizer=ep(this.input)}raw(e,s,r,n){if(super.raw(e,s,r,n),e.raws[s]){let i=e.raws[s].raw;e.raws[s].raw=r.reduce((o,u)=>{if(u[0]==="comment"&&u[4]==="inline"){let a=u[1].slice(2).replace(/(\*\/|\/\*)/g,"*//*");return o+"/*"+a+"*/"}else return o+u[1]},""),i!==e.raws[s].raw&&(e.raws[s].scss=i)}}rule(e){let s=!1,r=0,n="";for(let i of e)if(s)i[0]!=="comment"&&i[0]!=="{"&&(n+=i[1]);else{if(i[0]==="space"&&i[1].includes(` +`))break;i[0]==="("?r+=1:i[0]===")"?r-=1:r===0&&i[0]===":"&&(s=!0)}if(!s||n.trim()===""||/^[#:A-Za-z-]/.test(n))super.rule(e);else{e.pop();let i=new Zf;this.init(i,e[0][2]);let o;for(let a=e.length-1;a>=0;a--)if(e[a][0]!=="space"){o=e[a];break}if(o[3]){let a=this.input.fromOffset(o[3]);i.source.end={column:a.col,line:a.line,offset:o[3]+1}}else{let a=this.input.fromOffset(o[2]);i.source.end={column:a.col,line:a.line,offset:o[2]+1}}for(;e[0][0]!=="word";)i.raws.before+=e.shift()[1];if(e[0][2]){let a=this.input.fromOffset(e[0][2]);i.source.start={column:a.col,line:a.line,offset:e[0][2]}}for(i.prop="";e.length;){let a=e[0][0];if(a===":"||a==="space"||a==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let u;for(;e.length;)if(u=e.shift(),u[0]===":"){i.raws.between+=u[1];break}else i.raws.between+=u[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1)),i.raws.between+=this.spacesAndCommentsFromStart(e),this.precheckMissedSemicolon(e);for(let a=e.length-1;a>0;a--){if(u=e[a],u[1]==="!important"){i.important=!0;let c=this.stringFrom(e,a);c=this.spacesFromEnd(e)+c,c!==" !important"&&(i.raws.important=c);break}else if(u[1]==="important"){let c=e.slice(0),f="";for(let p=a;p>0;p--){let l=c[p][0];if(f.trim().indexOf("!")===0&&l!=="space")break;f=c.pop()[1]+f}f.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=f,e=c)}if(u[0]!=="space"&&u[0]!=="comment")break}this.raw(i,"value",e),i.value.includes(":")&&this.checkMissedSemicolon(e),this.current=i}}};sa.exports=Cs});var oa=g((gx,ia)=>{var{Input:tp}=rr(),rp=na();ia.exports=function(e,s){let r=new tp(e,s),n=new rp(r);return n.parse(),n.root}});var As=g(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});function np(t){this.after=t.after,this.before=t.before,this.type=t.type,this.value=t.value,this.sourceIndex=t.sourceIndex}Os.default=np});var Ps=g(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});var ip=As(),ua=op(ip);function op(t){return t&&t.__esModule?t:{default:t}}function Et(t){var e=this;this.constructor(t),this.nodes=t.nodes,this.after===void 0&&(this.after=this.nodes.length>0?this.nodes[this.nodes.length-1].after:""),this.before===void 0&&(this.before=this.nodes.length>0?this.nodes[0].before:""),this.sourceIndex===void 0&&(this.sourceIndex=this.before.length),this.nodes.forEach(function(s){s.parent=e})}Et.prototype=Object.create(ua.default.prototype);Et.constructor=ua.default;Et.prototype.walk=function(e,s){for(var r=typeof e=="string"||e instanceof RegExp,n=r?s:e,i=typeof e=="string"?new RegExp(e):e,o=0;o{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.parseMediaFeature=fa;kt.parseMediaQuery=Is;kt.parseMediaList=lp;var ap=As(),la=ca(ap),up=Ps(),Rs=ca(up);function ca(t){return t&&t.__esModule?t:{default:t}}function fa(t){var e=arguments.length<=1||arguments[1]===void 0?0:arguments[1],s=[{mode:"normal",character:null}],r=[],n=0,i="",o=null,u=null,a=e,c=t;t[0]==="("&&t[t.length-1]===")"&&(c=t.substring(1,t.length-1),a++);for(var f=0;f0&&(s[c-1].after=i.before),i.type===void 0){if(c>0){if(s[c-1].type==="media-feature-expression"){i.type="keyword";continue}if(s[c-1].value==="not"||s[c-1].value==="only"){i.type="media-type";continue}if(s[c-1].value==="and"){i.type="media-feature-expression";continue}s[c-1].type==="media-type"&&(s[c+1]?i.type=s[c+1].type==="media-feature-expression"?"keyword":"media-feature-expression":i.type="media-feature-expression")}if(c===0){if(!s[c+1]){i.type="media-type";continue}if(s[c+1]&&(s[c+1].type==="media-feature-expression"||s[c+1].type==="keyword")){i.type="media-type";continue}if(s[c+2]){if(s[c+2].type==="media-feature-expression"){i.type="media-type",s[c+1].type="keyword";continue}if(s[c+2].type==="keyword"){i.type="keyword",s[c+1].type="media-type";continue}}if(s[c+3]&&s[c+3].type==="media-feature-expression"){i.type="keyword",s[c+1].type="media-type",s[c+2].type="keyword";continue}}}return s}function lp(t){var e=[],s=0,r=0,n=/^(\s*)url\s*\(/.exec(t);if(n!==null){for(var i=n[0].length,o=1;o>0;){var u=t[i];u==="("&&o++,u===")"&&o--,i++}e.unshift(new la.default({type:"url",value:t.substring(0,i).trim(),sourceIndex:n[1].length,before:n[1],after:/^(\s*)/.exec(t.substring(i))[1]})),s=i}for(var a=s;a{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.default=dp;var cp=Ps(),fp=hp(cp),pp=pa();function hp(t){return t&&t.__esModule?t:{default:t}}function dp(t){return new fp.default({nodes:(0,pp.parseMediaList)(t),type:"media-query-list",value:t.trim()})}});var Ds=g((Tx,ya)=>{ya.exports=function(e,s){if(s=typeof s=="number"?s:1/0,!s)return Array.isArray(e)?e.map(function(n){return n}):e;return r(e,1);function r(n,i){return n.reduce(function(o,u){return Array.isArray(u)&&i{ga.exports=function(t,e){for(var s=-1,r=[];(s=t.indexOf(e,s+1))!==-1;)r.push(s);return r}});var Ms=g((Ox,wa)=>{"use strict";function gp(t,e){for(var s=1,r=t.length,n=t[0],i=t[0],o=1;o{"use strict";or.__esModule=!0;var va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function xp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var bp=function t(e,s){if((typeof e>"u"?"undefined":va(e))!=="object")return e;var r=new e.constructor;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n],o=typeof i>"u"?"undefined":va(i);n==="parent"&&o==="object"?s&&(r[n]=s):i instanceof Array?r[n]=i.map(function(u){return t(u,r)}):r[n]=t(i,r)}return r},_p=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xp(this,t);for(var s in e)this[s]=e[s];var r=e.spaces;r=r===void 0?{}:r;var n=r.before,i=n===void 0?"":n,o=r.after,u=o===void 0?"":o;this.spaces={before:i,after:u}}return t.prototype.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.prototype.replaceWith=function(){if(this.parent){for(var s in arguments)this.parent.insertBefore(this,arguments[s]);this.remove()}return this},t.prototype.next=function(){return this.parent.at(this.parent.index(this)+1)},t.prototype.prev=function(){return this.parent.at(this.parent.index(this)-1)},t.prototype.clone=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=bp(this);for(var n in s)r[n]=s[n];return r},t.prototype.toString=function(){return[this.spaces.before,String(this.value),this.spaces.after].join("")},t}();or.default=_p;xa.exports=or.default});var B=g(M=>{"use strict";M.__esModule=!0;var Ax=M.TAG="tag",Nx=M.STRING="string",Px=M.SELECTOR="selector",Rx=M.ROOT="root",Ix=M.PSEUDO="pseudo",qx=M.NESTING="nesting",Lx=M.ID="id",Dx=M.COMMENT="comment",Bx=M.COMBINATOR="combinator",Mx=M.CLASS="class",Ux=M.ATTRIBUTE="attribute",Fx=M.UNIVERSAL="universal"});var ur=g((ar,ba)=>{"use strict";ar.__esModule=!0;var Ep=function(){function t(e,s){for(var r=0;r=r&&(this.indexes[i]=n-1);return this},e.prototype.removeAll=function(){for(var i=this.nodes,r=Array.isArray(i),n=0,i=r?i:i[Symbol.iterator]();;){var o;if(r){if(n>=i.length)break;o=i[n++]}else{if(n=i.next(),n.done)break;o=n.value}var u=o;u.parent=void 0}return this.nodes=[],this},e.prototype.empty=function(){return this.removeAll()},e.prototype.insertAfter=function(r,n){var i=this.index(r);this.nodes.splice(i+1,0,n);var o=void 0;for(var u in this.indexes)o=this.indexes[u],i<=o&&(this.indexes[u]=o+this.nodes.length);return this},e.prototype.insertBefore=function(r,n){var i=this.index(r);this.nodes.splice(i,0,n);var o=void 0;for(var u in this.indexes)o=this.indexes[u],i<=o&&(this.indexes[u]=o+this.nodes.length);return this},e.prototype.each=function(r){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var n=this.lastEach;if(this.indexes[n]=0,!!this.length){for(var i=void 0,o=void 0;this.indexes[n]{"use strict";lr.__esModule=!0;var Ip=ur(),qp=Dp(Ip),Lp=B();function Dp(t){return t&&t.__esModule?t:{default:t}}function Bp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mp(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Up(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Fp=function(t){Up(e,t);function e(s){Bp(this,e);var r=Mp(this,t.call(this,s));return r.type=Lp.ROOT,r}return e.prototype.toString=function(){var r=this.reduce(function(n,i){var o=String(i);return o?n+o+",":""},"").slice(0,-1);return this.trailingComma?r+",":r},e}(qp.default);lr.default=Fp;_a.exports=lr.default});var Sa=g((cr,ka)=>{"use strict";cr.__esModule=!0;var $p=ur(),Wp=Vp($p),Yp=B();function Vp(t){return t&&t.__esModule?t:{default:t}}function zp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gp(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function jp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Hp=function(t){jp(e,t);function e(s){zp(this,e);var r=Gp(this,t.call(this,s));return r.type=Yp.SELECTOR,r}return e}(Wp.default);cr.default=Hp;ka.exports=cr.default});var Ue=g((fr,Ta)=>{"use strict";fr.__esModule=!0;var Kp=function(){function t(e,s){for(var r=0;r{"use strict";pr.__esModule=!0;var sh=Ue(),nh=oh(sh),ih=B();function oh(t){return t&&t.__esModule?t:{default:t}}function ah(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function lh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ch=function(t){lh(e,t);function e(s){ah(this,e);var r=uh(this,t.call(this,s));return r.type=ih.CLASS,r}return e.prototype.toString=function(){return[this.spaces.before,this.ns,"."+this.value,this.spaces.after].join("")},e}(nh.default);pr.default=ch;Ca.exports=pr.default});var Na=g((hr,Aa)=>{"use strict";hr.__esModule=!0;var fh=we(),ph=dh(fh),hh=B();function dh(t){return t&&t.__esModule?t:{default:t}}function mh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function gh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var wh=function(t){gh(e,t);function e(s){mh(this,e);var r=yh(this,t.call(this,s));return r.type=hh.COMMENT,r}return e}(ph.default);hr.default=wh;Aa.exports=hr.default});var Ra=g((dr,Pa)=>{"use strict";dr.__esModule=!0;var vh=Ue(),xh=_h(vh),bh=B();function _h(t){return t&&t.__esModule?t:{default:t}}function Eh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Sh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Th=function(t){Sh(e,t);function e(s){Eh(this,e);var r=kh(this,t.call(this,s));return r.type=bh.ID,r}return e.prototype.toString=function(){return[this.spaces.before,this.ns,"#"+this.value,this.spaces.after].join("")},e}(xh.default);dr.default=Th;Pa.exports=dr.default});var qa=g((mr,Ia)=>{"use strict";mr.__esModule=!0;var Ch=Ue(),Oh=Nh(Ch),Ah=B();function Nh(t){return t&&t.__esModule?t:{default:t}}function Ph(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Ih(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var qh=function(t){Ih(e,t);function e(s){Ph(this,e);var r=Rh(this,t.call(this,s));return r.type=Ah.TAG,r}return e}(Oh.default);mr.default=qh;Ia.exports=mr.default});var Da=g((yr,La)=>{"use strict";yr.__esModule=!0;var Lh=we(),Dh=Mh(Lh),Bh=B();function Mh(t){return t&&t.__esModule?t:{default:t}}function Uh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function $h(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Wh=function(t){$h(e,t);function e(s){Uh(this,e);var r=Fh(this,t.call(this,s));return r.type=Bh.STRING,r}return e}(Dh.default);yr.default=Wh;La.exports=yr.default});var Ma=g((gr,Ba)=>{"use strict";gr.__esModule=!0;var Yh=ur(),Vh=Gh(Yh),zh=B();function Gh(t){return t&&t.__esModule?t:{default:t}}function jh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Kh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Qh=function(t){Kh(e,t);function e(s){jh(this,e);var r=Hh(this,t.call(this,s));return r.type=zh.PSEUDO,r}return e.prototype.toString=function(){var r=this.length?"("+this.map(String).join(",")+")":"";return[this.spaces.before,String(this.value),r,this.spaces.after].join("")},e}(Vh.default);gr.default=Qh;Ba.exports=gr.default});var Fa=g((wr,Ua)=>{"use strict";wr.__esModule=!0;var Jh=Ue(),Xh=ed(Jh),Zh=B();function ed(t){return t&&t.__esModule?t:{default:t}}function td(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rd(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function sd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var nd=function(t){sd(e,t);function e(s){td(this,e);var r=rd(this,t.call(this,s));return r.type=Zh.ATTRIBUTE,r.raws={},r}return e.prototype.toString=function(){var r=[this.spaces.before,"[",this.ns,this.attribute];return this.operator&&r.push(this.operator),this.value&&r.push(this.value),this.raws.insensitive?r.push(this.raws.insensitive):this.insensitive&&r.push(" i"),r.push("]"),r.concat(this.spaces.after).join("")},e}(Xh.default);wr.default=nd;Ua.exports=wr.default});var Wa=g((vr,$a)=>{"use strict";vr.__esModule=!0;var id=Ue(),od=ud(id),ad=B();function ud(t){return t&&t.__esModule?t:{default:t}}function ld(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cd(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function fd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var pd=function(t){fd(e,t);function e(s){ld(this,e);var r=cd(this,t.call(this,s));return r.type=ad.UNIVERSAL,r.value="*",r}return e}(od.default);vr.default=pd;$a.exports=vr.default});var Va=g((xr,Ya)=>{"use strict";xr.__esModule=!0;var hd=we(),dd=yd(hd),md=B();function yd(t){return t&&t.__esModule?t:{default:t}}function gd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wd(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function vd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var xd=function(t){vd(e,t);function e(s){gd(this,e);var r=wd(this,t.call(this,s));return r.type=md.COMBINATOR,r}return e}(dd.default);xr.default=xd;Ya.exports=xr.default});var Ga=g((br,za)=>{"use strict";br.__esModule=!0;var bd=we(),_d=kd(bd),Ed=B();function kd(t){return t&&t.__esModule?t:{default:t}}function Sd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Td(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Cd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Od=function(t){Cd(e,t);function e(s){Sd(this,e);var r=Td(this,t.call(this,s));return r.type=Ed.NESTING,r.value="&",r}return e}(_d.default);br.default=Od;za.exports=br.default});var Ha=g((_r,ja)=>{"use strict";_r.__esModule=!0;_r.default=Ad;function Ad(t){return t.sort(function(e,s){return e-s})}ja.exports=_r.default});var su=g((Sr,ru)=>{"use strict";Sr.__esModule=!0;Sr.default=Fd;var Ka=39,Nd=34,Us=92,Qa=47,St=10,Fs=32,$s=12,Ws=9,Ys=13,Ja=43,Xa=62,Za=126,eu=124,Pd=44,Rd=40,Id=41,qd=91,Ld=93,Dd=59,tu=42,Bd=58,Md=38,Ud=64,Er=/[ \n\t\r\{\(\)'"\\;/]/g,kr=/[ \n\t\r\(\)\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;function Fd(t){for(var e=[],s=t.css.valueOf(),r=void 0,n=void 0,i=void 0,o=void 0,u=void 0,a=void 0,c=void 0,f=void 0,p=void 0,l=void 0,y=void 0,x=s.length,h=-1,d=1,m=0,b=function(v,N){if(t.safe)s+=N,n=s.length-1;else throw t.error("Unclosed "+v,d,m-h,m)};m0?(f=d+u,p=n-o[u].length):(f=d,p=h),e.push(["comment",a,d,m-h,f,n-p,m]),h=p,d=f,m=n):(kr.lastIndex=m+1,kr.test(s),kr.lastIndex===0?n=s.length-1:n=kr.lastIndex-2,e.push(["word",s.slice(m,n+1),d,m-h,d,n-h,m]),m=n);break}m++}return e}ru.exports=Sr.default});var ou=g((Tr,iu)=>{"use strict";Tr.__esModule=!0;var $d=function(){function t(e,s){for(var r=0;r1?(o[0]===""&&(o[0]=!0),u.attribute=this.parseValue(o[2]),u.namespace=this.parseNamespace(o[0])):u.attribute=this.parseValue(i[0]),r=new lm.default(u),i[2]){var a=i[2].split(/(\s+i\s*?)$/),c=a[0].trim();r.value=this.lossy?c:a[0],a[1]&&(r.insensitive=!0,this.lossy||(r.raws.insensitive=a[1])),r.quoted=c[0]==="'"||c[0]==='"',r.raws.unquoted=r.quoted?c.slice(1,-1):c}this.newNode(r),this.position++},t.prototype.combinator=function(){if(this.currToken[1]==="|")return this.namespace();for(var s=new hm.default({value:"",source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]});this.position1&&s.nextToken&&s.nextToken[0]==="("&&s.error("Misplaced parenthesis.")})}else this.error('Unexpected "'+this.currToken[0]+'" found.')},t.prototype.space=function(){var s=this.currToken;this.position===0||this.prevToken[0]===","||this.prevToken[0]==="("?(this.spaces=this.parseSpace(s[1]),this.position++):this.position===this.tokens.length-1||this.nextToken[0]===","||this.nextToken[0]===")"?(this.current.last.spaces.after=this.parseSpace(s[1]),this.position++):this.combinator()},t.prototype.string=function(){var s=this.currToken;this.newNode(new im.default({value:this.currToken[1],source:{start:{line:s[2],column:s[3]},end:{line:s[4],column:s[5]}},sourceIndex:s[6]})),this.position++},t.prototype.universal=function(s){var r=this.nextToken;if(r&&r[1]==="|")return this.position++,this.namespace();this.newNode(new fm.default({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]}),s),this.position++},t.prototype.splitWord=function(s,r){for(var n=this,i=this.nextToken,o=this.currToken[1];i&&i[0]==="word";){this.position++;var u=this.currToken[1];if(o+=u,u.lastIndexOf("\\")===u.length-1){var a=this.nextToken;a&&a[0]==="space"&&(o+=this.parseSpace(a[1]," "),this.position++)}i=this.nextToken}var c=(0,Vs.default)(o,"."),f=(0,Vs.default)(o,"#"),p=(0,Vs.default)(o,"#{");p.length&&(f=f.filter(function(y){return!~p.indexOf(y)}));var l=(0,gm.default)((0,Gd.default)((0,Yd.default)([[0],c,f])));l.forEach(function(y,x){var h=l[x+1]||o.length,d=o.slice(y,h);if(x===0&&r)return r.call(n,d,l.length);var m=void 0;~c.indexOf(y)?m=new Jd.default({value:d.slice(1),source:{start:{line:n.currToken[2],column:n.currToken[3]+y},end:{line:n.currToken[4],column:n.currToken[3]+(h-1)}},sourceIndex:n.currToken[6]+l[x]}):~f.indexOf(y)?m=new tm.default({value:d.slice(1),source:{start:{line:n.currToken[2],column:n.currToken[3]+y},end:{line:n.currToken[4],column:n.currToken[3]+(h-1)}},sourceIndex:n.currToken[6]+l[x]}):m=new sm.default({value:d,source:{start:{line:n.currToken[2],column:n.currToken[3]+y},end:{line:n.currToken[4],column:n.currToken[3]+(h-1)}},sourceIndex:n.currToken[6]+l[x]}),n.newNode(m,s)}),this.position++},t.prototype.word=function(s){var r=this.nextToken;return r&&r[1]==="|"?(this.position++,this.namespace()):this.splitWord(s)},t.prototype.loop=function(){for(;this.position{"use strict";Cr.__esModule=!0;var km=function(){function t(e,s){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=new Tm.default({css:s,error:function(o){throw new Error(o)},options:r});return this.res=n,this.func(n),this},km(t,[{key:"result",get:function(){return String(this.res)}}]),t}();Cr.default=Am;au.exports=Cr.default});var G=g((zx,cu)=>{"use strict";var Gs=function(t,e){let s=new t.constructor;for(let r in t){if(!t.hasOwnProperty(r))continue;let n=t[r],i=typeof n;r==="parent"&&i==="object"?e&&(s[r]=e):r==="source"?s[r]=n:n instanceof Array?s[r]=n.map(o=>Gs(o,s)):r!=="before"&&r!=="after"&&r!=="between"&&r!=="semicolon"&&(i==="object"&&n!==null&&(n=Gs(n)),s[r]=n)}return s};cu.exports=class{constructor(e){e=e||{},this.raws={before:"",after:""};for(let s in e)this[s]=e[s]}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(){return[this.raws.before,String(this.value),this.raws.after].join("")}clone(e){e=e||{};let s=Gs(this);for(let r in e)s[r]=e[r];return s}cloneBefore(e){e=e||{};let s=this.clone(e);return this.parent.insertBefore(this,s),s}cloneAfter(e){e=e||{};let s=this.clone(e);return this.parent.insertAfter(this,s),s}replaceWith(){let e=Array.prototype.slice.call(arguments);if(this.parent){for(let s of e)this.parent.insertBefore(this,s);this.remove()}return this}moveTo(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.append(this),this}moveBefore(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertBefore(e,this),this}moveAfter(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertAfter(e,this),this}next(){let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){let e=this.parent.index(this);return this.parent.nodes[e-1]}toJSON(){let e={};for(let s in this){if(!this.hasOwnProperty(s)||s==="parent")continue;let r=this[s];r instanceof Array?e[s]=r.map(n=>typeof n=="object"&&n.toJSON?n.toJSON():n):typeof r=="object"&&r.toJSON?e[s]=r.toJSON():e[s]=r}return e}root(){let e=this;for(;e.parent;)e=e.parent;return e}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}positionInside(e){let s=this.toString(),r=this.source.start.column,n=this.source.start.line;for(let i=0;i{"use strict";var Pm=G(),Fe=class extends Pm{constructor(e){super(e),this.nodes||(this.nodes=[])}push(e){return e.parent=this,this.nodes.push(e),this}each(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let s=this.lastEach,r,n;if(this.indexes[s]=0,!!this.nodes){for(;this.indexes[s]{let n=e(s,r);return n!==!1&&s.walk&&(n=s.walk(e)),n})}walkType(e,s){if(!e||!s)throw new Error("Parameters {type} and {callback} are required.");let r=typeof e=="function";return this.walk((n,i)=>{if(r&&n instanceof e||!r&&n.type===e)return s.call(this,n,i)})}append(e){return e.parent=this,this.nodes.push(e),this}prepend(e){return e.parent=this,this.nodes.unshift(e),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}insertAfter(e,s){let r=this.index(e),n;this.nodes.splice(r+1,0,s);for(let i in this.indexes)n=this.indexes[i],r<=n&&(this.indexes[i]=n+this.nodes.length);return this}insertBefore(e,s){let r=this.index(e),n;this.nodes.splice(r,0,s);for(let i in this.indexes)n=this.indexes[i],r<=n&&(this.indexes[i]=n+this.nodes.length);return this}removeChild(e){e=this.index(e),this.nodes[e].parent=void 0,this.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this}removeAll(){for(let e of this.nodes)e.parent=void 0;return this.nodes=[],this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return typeof e=="number"?e:this.nodes.indexOf(e)}get first(){if(this.nodes)return this.nodes[0]}get last(){if(this.nodes)return this.nodes[this.nodes.length-1]}toString(){let e=this.nodes.map(String).join("");return this.value&&(e=this.value+e),this.raws.before&&(e=this.raws.before+e),this.raws.after&&(e+=this.raws.after),e}};Fe.registerWalker=t=>{let e="walk"+t.name;e.lastIndexOf("s")!==e.length-1&&(e+="s"),!Fe.prototype[e]&&(Fe.prototype[e]=function(s){return this.walkType(t,s)})};fu.exports=Fe});var hu=g((Hx,pu)=>{"use strict";var Rm=U();pu.exports=class extends Rm{constructor(e){super(e),this.type="root"}}});var mu=g((Qx,du)=>{"use strict";var Im=U();du.exports=class extends Im{constructor(e){super(e),this.type="value",this.unbalanced=0}}});var wu=g((Jx,gu)=>{"use strict";var yu=U(),Or=class extends yu{constructor(e){super(e),this.type="atword"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,"@",String.prototype.toString.call(this.value),this.raws.after].join("")}};yu.registerWalker(Or);gu.exports=Or});var xu=g((Xx,vu)=>{"use strict";var qm=U(),Lm=G(),Ar=class extends Lm{constructor(e){super(e),this.type="colon"}};qm.registerWalker(Ar);vu.exports=Ar});var _u=g((Zx,bu)=>{"use strict";var Dm=U(),Bm=G(),Nr=class extends Bm{constructor(e){super(e),this.type="comma"}};Dm.registerWalker(Nr);bu.exports=Nr});var ku=g((eb,Eu)=>{"use strict";var Mm=U(),Um=G(),Pr=class extends Um{constructor(e){super(e),this.type="comment",this.inline=Object(e).inline||!1}toString(){return[this.raws.before,this.inline?"//":"/*",String(this.value),this.inline?"":"*/",this.raws.after].join("")}};Mm.registerWalker(Pr);Eu.exports=Pr});var Cu=g((tb,Tu)=>{"use strict";var Su=U(),Rr=class extends Su{constructor(e){super(e),this.type="func",this.unbalanced=-1}};Su.registerWalker(Rr);Tu.exports=Rr});var Au=g((rb,Ou)=>{"use strict";var Fm=U(),$m=G(),Ir=class extends $m{constructor(e){super(e),this.type="number",this.unit=Object(e).unit||""}toString(){return[this.raws.before,String(this.value),this.unit,this.raws.after].join("")}};Fm.registerWalker(Ir);Ou.exports=Ir});var Pu=g((sb,Nu)=>{"use strict";var Wm=U(),Ym=G(),qr=class extends Ym{constructor(e){super(e),this.type="operator"}};Wm.registerWalker(qr);Nu.exports=qr});var Iu=g((nb,Ru)=>{"use strict";var Vm=U(),zm=G(),Lr=class extends zm{constructor(e){super(e),this.type="paren",this.parenType=""}};Vm.registerWalker(Lr);Ru.exports=Lr});var Lu=g((ib,qu)=>{"use strict";var Gm=U(),jm=G(),Dr=class extends jm{constructor(e){super(e),this.type="string"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,e,this.value+"",e,this.raws.after].join("")}};Gm.registerWalker(Dr);qu.exports=Dr});var Bu=g((ob,Du)=>{"use strict";var Hm=U(),Km=G(),Br=class extends Km{constructor(e){super(e),this.type="word"}};Hm.registerWalker(Br);Du.exports=Br});var Uu=g((ab,Mu)=>{"use strict";var Qm=U(),Jm=G(),Mr=class extends Jm{constructor(e){super(e),this.type="unicode-range"}};Qm.registerWalker(Mr);Mu.exports=Mr});var $u=g((ub,Fu)=>{"use strict";var js=class extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e||"An error ocurred while tokzenizing.",typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}};Fu.exports=js});var Vu=g((lb,Yu)=>{"use strict";var Ur=/[ \n\t\r\{\(\)'"\\;,/]/g,Xm=/[ \n\t\r\(\)\{\}\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g,$e=/[ \n\t\r\(\)\{\}\*:;@!&'"\-\+\|~>,\[\]\\]|\//g,Zm=/^[a-z0-9]/i,ey=/^[a-f0-9?\-]/i,Wu=$u();Yu.exports=function(e,s){s=s||{};let r=[],n=e.valueOf(),i=n.length,o=-1,u=1,a=0,c=0,f=null,p,l,y,x,h,d,m,b,w,v,N,F;function Q(T){let C=`Unclosed ${T} at line: ${u}, column: ${a-o}, token: ${a}`;throw new Wu(C)}function W(){let T=`Syntax error at line: ${u}, column: ${a-o}, token: ${a}`;throw new Wu(T)}for(;a0&&r[r.length-1][0]==="word"&&r[r.length-1][1]==="url",r.push(["(","(",u,a-o,u,l-o,a]);break;case 41:c--,f=f&&c>0,r.push([")",")",u,a-o,u,l-o,a]);break;case 39:case 34:y=p===39?"'":'"',l=a;do for(v=!1,l=n.indexOf(y,l+1),l===-1&&Q("quote",y),N=l;n.charCodeAt(N-1)===92;)N-=1,v=!v;while(v);r.push(["string",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l;break;case 64:Ur.lastIndex=a+1,Ur.test(n),Ur.lastIndex===0?l=n.length-1:l=Ur.lastIndex-2,r.push(["atword",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l;break;case 92:l=a,p=n.charCodeAt(l+1),m&&p!==47&&p!==32&&p!==10&&p!==9&&p!==13&&p!==12&&(l+=1),r.push(["word",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l;break;case 43:case 45:case 42:l=a+1,F=n.slice(a+1,l+1);let T=n.slice(a-1,a);if(p===45&&F.charCodeAt(0)===45){l++,r.push(["word",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1;break}r.push(["operator",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1;break;default:if(p===47&&(n.charCodeAt(a+1)===42||s.loose&&!f&&n.charCodeAt(a+1)===47)){if(n.charCodeAt(a+1)===42)l=n.indexOf("*/",a+2)+1,l===0&&Q("comment","*/");else{let O=n.indexOf(` +`,a+2);l=O!==-1?O-1:i}d=n.slice(a,l+1),x=d.split(` +`),h=x.length-1,h>0?(b=u+h,w=l-x[h].length):(b=u,w=o),r.push(["comment",d,u,a-o,b,l-w,a]),o=w,u=b,a=l}else if(p===35&&!Zm.test(n.slice(a+1,a+2)))l=a+1,r.push(["#",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1;else if((p===117||p===85)&&n.charCodeAt(a+1)===43){l=a+2;do l+=1,p=n.charCodeAt(l);while(l=48&&p<=57&&(C=$e),C.lastIndex=a+1,C.test(n),C.lastIndex===0?l=n.length-1:l=C.lastIndex-2,C===$e||p===46){let O=n.charCodeAt(l),ve=n.charCodeAt(l+1),Xs=n.charCodeAt(l+2);(O===101||O===69)&&(ve===45||ve===43)&&Xs>=48&&Xs<=57&&($e.lastIndex=l+2,$e.test(n),$e.lastIndex===0?l=n.length-1:l=$e.lastIndex-2)}r.push(["word",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l}break}a++}return r}});var Gu=g((cb,zu)=>{"use strict";var Hs=class extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e||"An error ocurred while parsing.",typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}};zu.exports=Hs});var Qu=g((pb,Ku)=>{"use strict";var ty=hu(),ry=mu(),sy=wu(),ny=xu(),iy=_u(),oy=ku(),ay=Cu(),uy=Au(),ly=Pu(),ju=Iu(),cy=Lu(),Hu=Bu(),fy=Uu(),py=Vu(),hy=Ds(),dy=Bs(),my=Ms(),yy=Gu();function gy(t){return t.sort((e,s)=>e-s)}Ku.exports=class{constructor(e,s){let r={loose:!1};this.cache=[],this.input=e,this.options=Object.assign({},r,s),this.position=0,this.unbalanced=0,this.root=new ty;let n=new ry;this.root.append(n),this.current=n,this.tokens=py(e,this.options)}parse(){return this.loop()}colon(){let e=this.currToken;this.newNode(new ny({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comma(){let e=this.currToken;this.newNode(new iy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comment(){let e=!1,s=this.currToken[1].replace(/\/\*|\*\//g,""),r;this.options.loose&&s.startsWith("//")&&(s=s.substring(2),e=!0),r=new oy({value:s,inline:e,source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]}),this.newNode(r),this.position++}error(e,s){throw new yy(e+` at line: ${s[2]}, column ${s[3]}`)}loop(){for(;this.position0&&(this.current.type==="func"&&this.current.value==="calc"?this.prevToken[0]!=="space"&&this.prevToken[0]!=="("?this.error("Syntax Error",this.currToken):this.nextToken[0]!=="space"&&this.nextToken[0]!=="word"?this.error("Syntax Error",this.currToken):this.nextToken[0]==="word"&&this.current.last.type!=="operator"&&this.current.last.value!=="("&&this.error("Syntax Error",this.currToken):(this.nextToken[0]==="space"||this.nextToken[0]==="operator"||this.prevToken[0]==="operator")&&this.error("Syntax Error",this.currToken)),this.options.loose){if((!this.current.nodes.length||this.current.last&&this.current.last.type==="operator")&&this.nextToken[0]==="word")return this.word()}else if(this.nextToken[0]==="word")return this.word()}return s=new ly({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]}),this.position++,this.newNode(s)}parseTokens(){switch(this.currToken[0]){case"space":this.space();break;case"colon":this.colon();break;case"comma":this.comma();break;case"comment":this.comment();break;case"(":this.parenOpen();break;case")":this.parenClose();break;case"atword":case"word":this.word();break;case"operator":this.operator();break;case"string":this.string();break;case"unicoderange":this.unicodeRange();break;default:this.word();break}}parenOpen(){let e=1,s=this.position+1,r=this.currToken,n;for(;s=this.tokens.length-1&&!this.current.unbalanced)&&(this.current.unbalanced--,this.current.unbalanced<0&&this.error("Expected opening parenthesis",e),!this.current.unbalanced&&this.cache.length&&(this.current=this.cache.pop()))}space(){let e=this.currToken;this.position===this.tokens.length-1||this.nextToken[0]===","||this.nextToken[0]===")"?(this.current.last.raws.after+=e[1],this.position++):(this.spaces=e[1],this.position++)}unicodeRange(){let e=this.currToken;this.newNode(new fy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}splitWord(){let e=this.nextToken,s=this.currToken[1],r=/^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/,n=/^(?!\#([a-z0-9]+))[\#\{\}]/gi,i,o;if(!n.test(s))for(;e&&e[0]==="word";){this.position++;let u=this.currToken[1];s+=u,e=this.nextToken}i=dy(s,"@"),o=gy(my(hy([[0],i]))),o.forEach((u,a)=>{let c=o[a+1]||s.length,f=s.slice(u,c),p;if(~i.indexOf(u))p=new sy({value:f.slice(1),source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(c-1)}},sourceIndex:this.currToken[6]+o[a]});else if(r.test(this.currToken[1])){let l=f.replace(r,"");p=new uy({value:f.replace(l,""),source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(c-1)}},sourceIndex:this.currToken[6]+o[a],unit:l})}else p=new(e&&e[0]==="("?ay:Hu)({value:f,source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(c-1)}},sourceIndex:this.currToken[6]+o[a]}),p.type==="word"?(p.isHex=/^#(.+)/.test(f),p.isColor=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(f)):this.cache.push(this.current);this.newNode(p)}),this.position++}string(){let e=this.currToken,s=this.currToken[1],r=/^(\"|\')/,n=r.test(s),i="",o;n&&(i=s.match(r)[0],s=s.slice(1,s.length-1)),o=new cy({value:s,source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6],quoted:n}),o.raws.quote=i,this.newNode(o),this.position++}word(){return this.splitWord()}newNode(e){return this.spaces&&(e.raws.before+=this.spaces,this.spaces=""),this.current.append(e)}get currToken(){return this.tokens[this.position]}get nextToken(){return this.tokens[this.position+1]}get prevToken(){return this.tokens[this.position-1]}}});var qy={};Zs(qy,{languages:()=>gi,options:()=>vi,parsers:()=>Js,printers:()=>Iy});var vl=(t,e,s,r)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(s,r):s.global?e.replace(s,r):e.split(s).join(r)},E=vl;var be="string",We="array",Ye="cursor",te="indent",_e="align",Ve="trim",re="group",se="fill",ne="if-break",ze="indent-if-break",Ee="line-suffix",Ge="line-suffix-boundary",j="line",je="label",ke="break-parent",Ct=new Set([Ye,te,_e,Ve,re,se,ne,ze,Ee,Ge,j,je,ke]);var xl=(t,e,s)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[s<0?e.length+s:s]:e.at(s)},$=xl;function bl(t){if(typeof t=="string")return be;if(Array.isArray(t))return We;if(!t)return;let{type:e}=t;if(Ct.has(e))return e}var H=bl;var _l=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function El(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', +Expected it to be 'string' or 'object'.`;if(H(t))throw new Error("doc is valid.");let s=Object.prototype.toString.call(t);if(s!=="[object Object]")return`Unexpected doc '${s}'.`;let r=_l([...Ct].map(n=>`'${n}'`));return`Unexpected doc.type '${t.type}'. +Expected it to be ${r}.`}var Wr=class extends Error{name="InvalidDocError";constructor(e){super(El(e)),this.doc=e}},Yr=Wr;function Sl(t,e){if(typeof t=="string")return e(t);let s=new Map;return r(t);function r(i){if(s.has(i))return s.get(i);let o=n(i);return s.set(i,o),o}function n(i){switch(H(i)){case We:return e(i.map(r));case se:return e({...i,parts:i.parts.map(r)});case ne:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case re:{let{expandedStates:o,contents:u}=i;return o?(o=o.map(r),u=o[0]):u=r(u),e({...i,contents:u,expandedStates:o})}case _e:case te:case ze:case je:case Ee:return e({...i,contents:r(i.contents)});case be:case Ye:case Ve:case Ge:case j:case ke:return e(i);default:throw new Yr(i)}}}function Tl(t){return t.type===j&&!t.hard?t.soft?"":" ":t.type===ne?t.flatContents:t}function tn(t){return Sl(t,Tl)}var Vr=()=>{},ie=Vr,He=Vr,rn=Vr;function q(t){return ie(t),{type:te,contents:t}}function sn(t,e){return ie(e),{type:_e,contents:e,n:t}}function L(t,e={}){return ie(t),He(e.expandedStates,!0),{type:re,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function nn(t){return sn({type:"root"},t)}function oe(t){return sn(-1,t)}function Se(t){return rn(t),{type:se,parts:t}}function Ot(t,e="",s={}){return ie(t),e!==""&&ie(e),{type:ne,breakContents:t,flatContents:e,groupId:s.groupId}}function on(t){return ie(t),{type:Ee,contents:t}}var Ke={type:ke};var Cl={type:j,hard:!0};var A={type:j},D={type:j,soft:!0},S=[Cl,Ke];function Y(t,e){ie(t),He(e);let s=[];for(let r=0;r0}var ae=Ol;var an=new Proxy(()=>{},{get:()=>an}),un=an;var At="'",ln='"';function Al(t,e){let s=e===!0||e===At?At:ln,r=s===At?ln:At,n=0,i=0;for(let o of t)o===s?n++:o===r&&i++;return n>i?r:s}var cn=Al;function Nl(t,e,s){let r=e==='"'?"'":'"',i=E(!1,t,/\\(.)|(["'])/gsu,(o,u,a)=>u===r?u:a===e?"\\"+a:a||(s&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(u)?u:"\\"+u));return e+i+e}var fn=Nl;function Pl(t,e){un.ok(/^(?["']).*\k$/su.test(t));let s=t.slice(1,-1),r=e.parser==="json"||e.parser==="jsonc"||e.parser==="json5"&&e.quoteProps==="preserve"&&!e.singleQuote?'"':e.__isInHtmlAttribute?"'":cn(s,e.singleQuote);return t.charAt(0)===r?t:fn(s,r,!1)}var Nt=Pl;var zr=class extends Error{name="UnexpectedNodeError";constructor(e,s,r="type"){super(`Unexpected ${s} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}},pn=zr;function Rl(t){return(t==null?void 0:t.type)==="front-matter"}var Te=Rl;var Il=new Set(["raw","raws","sourceIndex","source","before","after","trailingComma","spaces"]);function hn(t,e,s){if(Te(t)&&t.language==="yaml"&&delete e.value,t.type==="css-comment"&&s.type==="css-root"&&s.nodes.length>0&&((s.nodes[0]===t||Te(s.nodes[0])&&s.nodes[1]===t)&&(delete e.text,/^\*\s*@(?:format|prettier)\s*$/u.test(t.text))||s.type==="css-root"&&$(!1,s.nodes,-1)===t))return null;if(t.type==="value-root"&&delete e.text,(t.type==="media-query"||t.type==="media-query-list"||t.type==="media-feature-expression")&&delete e.value,t.type==="css-rule"&&delete e.params,(t.type==="media-feature"||t.type==="media-keyword"||t.type==="media-type"||t.type==="media-unknown"||t.type==="media-url"||t.type==="media-value"||t.type==="selector-attribute"||t.type==="selector-string"||t.type==="selector-class"||t.type==="selector-combinator"||t.type==="value-string")&&t.value&&(e.value=ql(t.value)),t.type==="selector-combinator"&&(e.value=E(!1,e.value,/\s+/gu," ")),t.type==="media-feature"&&(e.value=E(!1,e.value," ","")),(t.type==="value-word"&&(t.isColor&&t.isHex||["initial","inherit","unset","revert"].includes(t.value.toLowerCase()))||t.type==="media-feature"||t.type==="selector-root-invalid"||t.type==="selector-pseudo")&&(e.value=e.value.toLowerCase()),t.type==="css-decl"&&(e.prop=t.prop.toLowerCase()),(t.type==="css-atrule"||t.type==="css-import")&&(e.name=t.name.toLowerCase()),t.type==="value-number"&&(e.unit=t.unit.toLowerCase()),t.type==="value-unknown"&&(e.value=E(!1,e.value,/;$/gu,"")),t.type==="selector-attribute"&&(e.attribute=t.attribute.trim(),t.namespace&&typeof t.namespace=="string"&&(e.namespace=t.namespace.trim()||!0),t.value&&(e.value=E(!1,e.value.trim(),/^["']|["']$/gu,""),delete e.quoted)),(t.type==="media-value"||t.type==="media-type"||t.type==="value-number"||t.type==="selector-root-invalid"||t.type==="selector-class"||t.type==="selector-combinator"||t.type==="selector-tag")&&t.value&&(e.value=E(!1,e.value,/([\d+.e-]+)([a-z]*)/giu,(r,n,i)=>{let o=Number(n);return Number.isNaN(o)?r:o+i.toLowerCase()})),t.type==="selector-tag"){let r=e.value.toLowerCase();["from","to"].includes(r)&&(e.value=r)}if(t.type==="css-atrule"&&t.name.toLowerCase()==="supports"&&delete e.value,t.type==="selector-unknown"&&delete e.value,t.type==="value-comma_group"){let r=t.groups.findIndex(n=>n.type==="value-number"&&n.unit==="...");r!==-1&&(e.groups[r].unit="",e.groups.splice(r+1,0,{type:"value-word",value:"...",isColor:!1,isHex:!1}))}if(t.type==="value-comma_group"&&t.groups.some(r=>r.type==="value-atword"&&r.value.endsWith("[")||r.type==="value-word"&&r.value.startsWith("]")))return{type:"value-atword",value:t.groups.map(r=>r.value).join(""),group:{open:null,close:null,groups:[],type:"value-paren_group"}}}hn.ignoredProperties=Il;function ql(t){return E(!1,E(!1,t,"'",'"'),/\\([^\da-f])/giu,"$1")}var dn=hn;async function Ll(t,e){if(t.language==="yaml"){let s=t.value.trim(),r=s?await e(s,{parser:"yaml"}):"";return nn([t.startDelimiter,t.explicitLanguage,S,r,r?S:"",t.endDelimiter])}}var mn=Ll;function yn(t){let{node:e}=t;if(e.type==="front-matter")return async s=>{let r=await mn(e,s);return r?[r,S]:void 0}}yn.getVisitorKeys=t=>t.type==="css-root"?["frontMatter"]:[];var gn=yn;var Qe=null;function Je(t){if(Qe!==null&&typeof Qe.property){let e=Qe;return Qe=Je.prototype=null,e}return Qe=Je.prototype=t??Object.create(null),new Je}var Dl=10;for(let t=0;t<=Dl;t++)Je();function Gr(t){return Je(t)}function Bl(t,e="type"){Gr(t);function s(r){let n=r[e],i=t[n];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:r});return i}return s}var wn=Bl;var Ml={"front-matter":[],"css-root":["frontMatter","nodes"],"css-comment":[],"css-rule":["selector","nodes"],"css-decl":["value","selector","nodes"],"css-atrule":["selector","params","value","nodes"],"media-query-list":["nodes"],"media-query":["nodes"],"media-type":[],"media-feature-expression":["nodes"],"media-feature":[],"media-colon":[],"media-value":[],"media-keyword":[],"media-url":[],"media-unknown":[],"selector-root":["nodes"],"selector-selector":["nodes"],"selector-comment":[],"selector-string":[],"selector-tag":[],"selector-id":[],"selector-class":[],"selector-attribute":[],"selector-combinator":["nodes"],"selector-universal":[],"selector-pseudo":["nodes"],"selector-nesting":[],"selector-unknown":[],"value-value":["group"],"value-root":["group"],"value-comment":[],"value-comma_group":["groups"],"value-paren_group":["open","groups","close"],"value-func":["group"],"value-paren":[],"value-number":[],"value-operator":[],"value-word":[],"value-colon":[],"value-comma":[],"value-string":[],"value-atword":[],"value-unicode-range":[],"value-unknown":[]},vn=Ml;var Ul=wn(vn),xn=Ul;function Fl(t,e){let s=0;for(let r=0;r{let n=!!(r!=null&&r.backwards);if(s===!1)return!1;let{length:i}=e,o=s;for(;o>=0&&oCn(c,e[c])).map(c=>`${n} ${c}${s}`).join("");if(!t){if(o.length===0)return"";if(o.length===1&&!Array.isArray(e[o[0]])){let c=e[o[0]];return`${r} ${Cn(o[0],c)[0]}${i}`}}let a=t.split(s).map(c=>`${n} ${c}`).join(s)+s;return r+s+(t?a:"")+(t&&o.length>0?n+s:"")+u+i}function Cn(t,e){return[...An,...Array.isArray(e)?e:[e]].map(s=>`@${t} ${s}`.trim())}function jl(t){if(!t.startsWith("#!"))return"";let e=t.indexOf(` +`);return e===-1?t:t.slice(0,e)}var qn=jl;function Ln(t){let e=qn(t);e&&(t=t.slice(e.length+1));let s=Nn(t),{pragmas:r,comments:n}=Rn(s);return{shebang:e,text:t,pragmas:r,comments:n}}function Dn(t){let{pragmas:e}=Ln(t);return Object.prototype.hasOwnProperty.call(e,"prettier")||Object.prototype.hasOwnProperty.call(e,"format")}function Bn(t){let{shebang:e,text:s,pragmas:r,comments:n}=Ln(t),i=Pn(s),o=In({pragmas:{format:"",...r},comments:n.trimStart()});return(e?`${e} +`:"")+o+(i.startsWith(` +`)?` +`:` + +`)+i}var Xe=3;function Hl(t){let e=t.slice(0,Xe);if(e!=="---"&&e!=="+++")return;let s=t.indexOf(` +`,Xe);if(s===-1)return;let r=t.slice(Xe,s).trim(),n=t.indexOf(` +${e}`,s),i=r;if(i||(i=e==="+++"?"toml":"yaml"),n===-1&&e==="---"&&i==="yaml"&&(n=t.indexOf(` +...`,s)),n===-1)return;let o=n+1+Xe,u=t.charAt(o+1);if(!/\s?/u.test(u))return;let a=t.slice(0,o);return{type:"front-matter",language:i,explicitLanguage:r,value:t.slice(s+1,n),startDelimiter:e,endDelimiter:a.slice(-Xe),raw:a}}function Kl(t){let e=Hl(t);if(!e)return{content:t};let{raw:s}=e;return{frontMatter:e,content:E(!1,s,/[^\n]/gu," ")+t.slice(s.length)}}var Ze=Kl;function Mn(t){return Dn(Ze(t).content)}function Un(t){let{frontMatter:e,content:s}=Ze(t);return(e?e.raw+` + +`:"")+Bn(s)}var Ql=new Set(["red","green","blue","alpha","a","rgb","hue","h","saturation","s","lightness","l","whiteness","w","blackness","b","tint","shade","blend","blenda","contrast","hsl","hsla","hwb","hwba"]);function Fn(t){var e,s;return(s=(e=t.findAncestor(r=>r.type==="css-decl"))==null?void 0:e.prop)==null?void 0:s.toLowerCase()}var Jl=new Set(["initial","inherit","unset","revert"]);function $n(t){return Jl.has(t.toLowerCase())}function Wn(t,e){var r;let s=t.findAncestor(n=>n.type==="css-atrule");return((r=s==null?void 0:s.name)==null?void 0:r.toLowerCase().endsWith("keyframes"))&&["from","to"].includes(e.toLowerCase())}function ue(t){return t.includes("$")||t.includes("@")||t.includes("#")||t.startsWith("%")||t.startsWith("--")||t.startsWith(":--")||t.includes("(")&&t.includes(")")?t:t.toLowerCase()}function Ce(t,e){var r;let s=t.findAncestor(n=>n.type==="value-func");return((r=s==null?void 0:s.value)==null?void 0:r.toLowerCase())===e}function Yn(t){var r;let e=t.findAncestor(n=>n.type==="css-rule"),s=(r=e==null?void 0:e.raws)==null?void 0:r.selector;return s&&(s.startsWith(":import")||s.startsWith(":export"))}function Oe(t,e){let s=Array.isArray(e)?e:[e],r=t.findAncestor(n=>n.type==="css-atrule");return r&&s.includes(r.name.toLowerCase())}function Vn(t){var s;let{node:e}=t;return e.groups[0].value==="url"&&e.groups.length===2&&((s=t.findAncestor(r=>r.type==="css-atrule"))==null?void 0:s.name)==="import"}function zn(t){return t.type==="value-func"&&t.value.toLowerCase()==="url"}function Gn(t){return t.type==="value-func"&&t.value.toLowerCase()==="var"}function jn(t){let{selector:e}=t;return e?typeof e=="string"&&/^@.+:.*$/u.test(e)||e.value&&/^@.+:.*$/u.test(e.value):!1}function Hn(t){return t.type==="value-word"&&["from","through","end"].includes(t.value)}function Kn(t){return t.type==="value-word"&&["and","or","not"].includes(t.value)}function Qn(t){return t.type==="value-word"&&t.value==="in"}function qt(t){return t.type==="value-operator"&&t.value==="*"}function et(t){return t.type==="value-operator"&&t.value==="/"}function J(t){return t.type==="value-operator"&&t.value==="+"}function he(t){return t.type==="value-operator"&&t.value==="-"}function Xl(t){return t.type==="value-operator"&&t.value==="%"}function Lt(t){return qt(t)||et(t)||J(t)||he(t)||Xl(t)}function Jn(t){return t.type==="value-word"&&["==","!="].includes(t.value)}function Xn(t){return t.type==="value-word"&&["<",">","<=",">="].includes(t.value)}function tt(t,e){return e.parser==="scss"&&t.type==="css-atrule"&&["if","else","for","each","while"].includes(t.name)}function Jr(t){var e;return((e=t.raws)==null?void 0:e.params)&&/^\(\s*\)$/u.test(t.raws.params)}function Dt(t){return t.name.startsWith("prettier-placeholder")}function Zn(t){return t.prop.startsWith("@prettier-placeholder")}function ei(t,e){return t.value==="$$"&&t.type==="value-func"&&(e==null?void 0:e.type)==="value-word"&&!e.raws.before}function ti(t){var e,s;return((e=t.value)==null?void 0:e.type)==="value-root"&&((s=t.value.group)==null?void 0:s.type)==="value-value"&&t.prop.toLowerCase()==="composes"}function ri(t){var e,s,r;return((r=(s=(e=t.value)==null?void 0:e.group)==null?void 0:s.group)==null?void 0:r.type)==="value-paren_group"&&t.value.group.group.open!==null&&t.value.group.group.close!==null}function de(t){var e;return((e=t.raws)==null?void 0:e.before)===""}function Bt(t){var e,s;return t.type==="value-comma_group"&&((s=(e=t.groups)==null?void 0:e[1])==null?void 0:s.type)==="value-colon"}function Qr(t){var e;return t.type==="value-paren_group"&&((e=t.groups)==null?void 0:e[0])&&Bt(t.groups[0])}function Xr(t,e){var i;if(e.parser!=="scss")return!1;let{node:s}=t;if(s.groups.length===0)return!1;let r=t.grandparent;if(!Qr(s)&&!(r&&Qr(r)))return!1;let n=t.findAncestor(o=>o.type==="css-decl");return!!((i=n==null?void 0:n.prop)!=null&&i.startsWith("$")||Qr(r)||r.type==="value-func")}function Ae(t){return t.type==="value-comment"&&t.inline}function Mt(t){return t.type==="value-word"&&t.value==="#"}function Zr(t){return t.type==="value-word"&&t.value==="{"}function Ut(t){return t.type==="value-word"&&t.value==="}"}function rt(t){return["value-word","value-atword"].includes(t.type)}function st(t){return(t==null?void 0:t.type)==="value-colon"}function si(t,e){if(!Bt(e))return!1;let{groups:s}=e,r=s.indexOf(t);return r===-1?!1:st(s[r+1])}function ni(t){return t.value&&["not","and","or"].includes(t.value.toLowerCase())}function ii(t){return t.type!=="value-func"?!1:Ql.has(t.value.toLowerCase())}function Ne(t){return/\/\//u.test(t.split(/[\n\r]/u).pop())}function nt(t){return(t==null?void 0:t.type)==="value-atword"&&t.value.startsWith("prettier-placeholder-")}function oi(t,e){var s,r;if(((s=t.open)==null?void 0:s.value)!=="("||((r=t.close)==null?void 0:r.value)!==")"||t.groups.some(n=>n.type!=="value-comma_group"))return!1;if(e.type==="value-comma_group"){let n=e.groups.indexOf(t)-1,i=e.groups[n];if((i==null?void 0:i.type)==="value-word"&&i.value==="with")return!0}return!1}function it(t){var e,s;return t.type==="value-paren_group"&&((e=t.open)==null?void 0:e.value)==="("&&((s=t.close)==null?void 0:s.value)===")"}function Zl(t,e,s){var d;let{node:r}=t,n=t.parent,i=t.grandparent,o=Fn(t),u=o&&n.type==="value-value"&&(o==="grid"||o.startsWith("grid-template")),a=t.findAncestor(m=>m.type==="css-atrule"),c=a&&tt(a,e),f=r.groups.some(m=>Ae(m)),p=t.map(s,"groups"),l=[""],y=Ce(t,"url"),x=!1,h=!1;for(let m=0;m2&&r.groups.slice(0,m).every(O=>O.type==="value-comment")&&!Ae(b)&&(l[l.length-2]=oe($(!1,l,-2))),Oe(t,"forward")&&w.type==="value-word"&&w.value&&b!==void 0&&b.type==="value-word"&&b.value==="as"&&v.type==="value-operator"&&v.value==="*"||!v||w.type==="value-word"&&w.value.endsWith("-")&&nt(v))continue;if(w.type==="value-string"&&w.quoted){let O=w.value.lastIndexOf("#{"),ve=w.value.lastIndexOf("}");O!==-1&&ve!==-1?x=O>ve:O!==-1?x=!0:ve!==-1&&(x=!1)}if(x||st(w)||st(v)||w.type==="value-atword"&&(w.value===""||w.value.endsWith("["))||v.type==="value-word"&&v.value.startsWith("]")||w.value==="~"||w.type!=="value-string"&&w.value&&w.value.includes("\\")&&v&&v.type!=="value-comment"||b!=null&&b.value&&b.value.indexOf("\\")===b.value.length-1&&w.type==="value-operator"&&w.value==="/"||w.value==="\\"||ei(w,v)||Mt(w)||Zr(w)||Ut(v)||Zr(v)&&de(v)||Ut(w)&&de(v)||w.value==="--"&&Mt(v))continue;let F=Lt(w),Q=Lt(v);if((F&&Mt(v)||Q&&Ut(w))&&de(v)||!b&&et(w)||Ce(t,"calc")&&(J(w)||J(v)||he(w)||he(v))&&de(v))continue;let W=(J(w)||he(w))&&m===0&&(v.type==="value-number"||v.isHex)&&i&&ii(i)&&!de(v),T=(N==null?void 0:N.type)==="value-func"||N&&rt(N)||w.type==="value-func"||rt(w),C=v.type==="value-func"||rt(v)||(b==null?void 0:b.type)==="value-func"||b&&rt(b);if(e.parser==="scss"&&F&&w.value==="-"&&v.type==="value-func"&&R(w)!==P(v)){l.push([l.pop()," "]);continue}if(!(!(qt(v)||qt(w))&&!Ce(t,"calc")&&!W&&(et(v)&&!T||et(w)&&!C||J(v)&&!T||J(w)&&!C||he(v)||he(w))&&(de(v)||F&&(!b||b&&Lt(b))))&&!((e.parser==="scss"||e.parser==="less")&&F&&w.value==="-"&&it(v)&&R(w)===P(v.open)&&v.open.value==="(")){if(Ae(w)){if(n.type==="value-paren_group"){l.push(oe(S),"");continue}l.push(S,"");continue}if(c&&(Jn(v)||Xn(v)||Kn(v)||Qn(w)||Hn(w))){l.push([l.pop()," "]);continue}if(a&&a.name.toLowerCase()==="namespace"){l.push([l.pop()," "]);continue}if(u){w.source&&v.source&&w.source.start.line!==v.source.start.line?(l.push(S,""),h=!0):l.push([l.pop()," "]);continue}if(Q){l.push([l.pop()," "]);continue}if((v==null?void 0:v.value)!=="..."&&!(nt(w)&&nt(v)&&R(w)===P(v))){if(nt(w)&&it(v)&&R(w)===P(v.open)){l.push(D,"");continue}if(w.value==="with"&&it(v)){l=[[Se(l)," "]];continue}(d=w.value)!=null&&d.endsWith("#")&&v.value==="{"&&it(v.group)||Ae(v)&&!N||l.push(A,"")}}}return f&&l.push([l.pop(),Ke]),h&&l.unshift("",S),c?L(q(l)):Vn(t)?L(Se(l)):L(q(Se(l)))}var ai=Zl;function ec(t){return t.length===1?t:t.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")}var ui=ec;var es=new Map([["em","em"],["rem","rem"],["ex","ex"],["rex","rex"],["cap","cap"],["rcap","rcap"],["ch","ch"],["rch","rch"],["ic","ic"],["ric","ric"],["lh","lh"],["rlh","rlh"],["vw","vw"],["svw","svw"],["lvw","lvw"],["dvw","dvw"],["vh","vh"],["svh","svh"],["lvh","lvh"],["dvh","dvh"],["vi","vi"],["svi","svi"],["lvi","lvi"],["dvi","dvi"],["vb","vb"],["svb","svb"],["lvb","lvb"],["dvb","dvb"],["vmin","vmin"],["svmin","svmin"],["lvmin","lvmin"],["dvmin","dvmin"],["vmax","vmax"],["svmax","svmax"],["lvmax","lvmax"],["dvmax","dvmax"],["cm","cm"],["mm","mm"],["q","Q"],["in","in"],["pt","pt"],["pc","pc"],["px","px"],["deg","deg"],["grad","grad"],["rad","rad"],["turn","turn"],["s","s"],["ms","ms"],["hz","Hz"],["khz","kHz"],["dpi","dpi"],["dpcm","dpcm"],["dppx","dppx"],["x","x"],["cqw","cqw"],["cqh","cqh"],["cqi","cqi"],["cqb","cqb"],["cqmin","cqmin"],["cqmax","cqmax"],["fr","fr"]]);function li(t){let e=t.toLowerCase();return es.has(e)?es.get(e):t}var ci=/(["'])(?:(?!\1)[^\\]|\\.)*\1/gsu,tc=/(?:\d*\.\d+|\d+\.?)(?:e[+-]?\d+)?/giu,rc=/[a-z]+/giu,sc=/[$@]?[_a-z\u0080-\uFFFF][\w\u0080-\uFFFF-]*/giu,nc=new RegExp(ci.source+`|(${sc.source})?(${tc.source})(${rc.source})?`,"giu");function V(t,e){return E(!1,t,ci,s=>Nt(s,e))}function fi(t,e){let s=e.singleQuote?"'":'"';return t.includes('"')||t.includes("'")?t:s+t+s}function me(t){return E(!1,t,nc,(e,s,r,n,i)=>!r&&n?ts(n)+ue(i||""):e)}function ts(t){return ui(t).replace(/\.0(?=$|e)/u,"")}function pi(t){return t.trailingComma==="es5"||t.trailingComma==="all"}function ic(t,e,s){let r=!!(s!=null&&s.backwards);if(e===!1)return!1;let n=t.charAt(e);if(r){if(t.charAt(e-1)==="\r"&&n===` +`)return e-2;if(n===` +`||n==="\r"||n==="\u2028"||n==="\u2029")return e-1}else{if(n==="\r"&&t.charAt(e+1)===` +`)return e+2;if(n===` +`||n==="\r"||n==="\u2028"||n==="\u2029")return e+1}return e}var Ft=ic;function oc(t,e,s={}){let r=Rt(t,s.backwards?e-1:e,s),n=Ft(t,r,s);return r!==n}var $t=oc;function ac(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let s=e+2;ss.type==="value-comment"))&&pi(e)&&t.callParent(()=>Xr(t,e))?Ot(","):""}function mi(t,e,s){let{node:r,parent:n}=t,i=t.map(({node:y})=>typeof y=="string"?y:s(),"groups");if(n&&zn(n)&&(r.groups.length===1||r.groups.length>0&&r.groups[0].type==="value-comma_group"&&r.groups[0].groups.length>0&&r.groups[0].groups[0].type==="value-word"&&r.groups[0].groups[0].value.startsWith("data:")))return[r.open?s("open"):"",Y(",",i),r.close?s("close"):""];if(!r.open){let y=rs(t);He(i);let x=hc(Y(",",i),2),h=Y(y?S:A,x);return q(y?[S,h]:L([pc(t)?D:"",Se(h)]))}let o=t.map(({node:y,isLast:x,index:h})=>{var b;let d=i[h];Bt(y)&&y.type==="value-comma_group"&&y.groups&&y.groups[0].type!=="value-paren_group"&&((b=y.groups[2])==null?void 0:b.type)==="value-paren_group"&&H(d)===re&&H(d.contents)===te&&H(d.contents.contents)===se&&(d=L(oe(d)));let m=[d,x?fc(t,e):","];if(!x&&y.type==="value-comma_group"&&ae(y.groups)){let w=$(!1,y.groups,-1);!w.source&&w.close&&(w=w.close),w.source&&Wt(e.originalText,R(w))&&m.push(S)}return m},"groups"),u=si(r,n),a=oi(r,n),c=Xr(t,e),f=a||c&&!u,p=a||u,l=L([r.open?s("open"):"",q([D,Y(A,o)]),D,r.close?s("close"):""],{shouldBreak:f});return p?oe(l):l}function rs(t){return t.match(e=>e.type==="value-paren_group"&&!e.open&&e.groups.some(s=>s.type==="value-comma_group"),(e,s)=>s==="group"&&e.type==="value-value",(e,s)=>s==="group"&&e.type==="value-root",(e,s)=>s==="value"&&(e.type==="css-decl"&&!e.prop.startsWith("--")||e.type==="css-atrule"&&e.variable))}function pc(t){return t.match(e=>e.type==="value-paren_group"&&!e.open,(e,s)=>s==="group"&&e.type==="value-value",(e,s)=>s==="group"&&e.type==="value-root",(e,s)=>s==="value"&&e.type==="css-decl")}function hc(t,e){let s=[];for(let r=0;r{let{node:n,previous:i}=t;if((i==null?void 0:i.type)==="css-comment"&&i.text.trim()==="prettier-ignore"?r.push(e.originalText.slice(P(n),R(n))):r.push(s()),t.isLast)return;let{next:o}=t;o.type==="css-comment"&&!$t(e.originalText,P(o),{backwards:!0})&&!Te(n)||o.type==="css-atrule"&&o.name==="else"&&n.type!=="css-comment"?r.push(" "):(r.push(e.__isHTMLStyleAttribute?A:S),Wt(e.originalText,R(n))&&!Te(n)&&r.push(S))},"nodes"),r}var Pe=dc;function mc(t,e,s){var n,i,o,u,a,c;let{node:r}=t;switch(r.type){case"front-matter":return[r.raw,S];case"css-root":{let f=Pe(t,e,s),p=r.raws.after.trim();return p.startsWith(";")&&(p=p.slice(1).trim()),[r.frontMatter?[s("frontMatter"),S]:"",f,p?` ${p}`:"",r.nodes.length>0?S:""]}case"css-comment":{let f=r.inline||r.raws.inline,p=e.originalText.slice(P(r),R(r));return f?p.trimEnd():p}case"css-rule":return[s("selector"),r.important?" !important":"",r.nodes?[((n=r.selector)==null?void 0:n.type)==="selector-unknown"&&Ne(r.selector.value)?A:r.selector?" ":"","{",r.nodes.length>0?q([S,Pe(t,e,s)]):"",S,"}",jn(r)?";":""]:";"];case"css-decl":{let f=t.parent,{between:p}=r.raws,l=p.trim(),y=l===":",x=typeof r.value=="string"&&/^ *$/u.test(r.value),h=typeof r.value=="string"?r.value:s("value");return h=ti(r)?tn(h):h,!y&&Ne(l)&&!((o=(i=r.value)==null?void 0:i.group)!=null&&o.group&&t.call(()=>rs(t),"value","group","group"))&&(h=q([S,oe(h)])),[E(!1,r.raws.before,/[\s;]/gu,""),f.type==="css-atrule"&&f.variable||Yn(t)?r.prop:ue(r.prop),l.startsWith("//")?" ":"",l,r.extend||x?"":" ",e.parser==="less"&&r.extend&&r.selector?["extend(",s("selector"),")"]:"",h,r.raws.important?r.raws.important.replace(/\s*!\s*important/iu," !important"):r.important?" !important":"",r.raws.scssDefault?r.raws.scssDefault.replace(/\s*!default/iu," !default"):r.scssDefault?" !default":"",r.raws.scssGlobal?r.raws.scssGlobal.replace(/\s*!global/iu," !global"):r.scssGlobal?" !global":"",r.nodes?[" {",q([D,Pe(t,e,s)]),D,"}"]:Zn(r)&&!f.raws.semicolon&&e.originalText[R(r)-1]!==";"?"":e.__isHTMLStyleAttribute&&t.isLast?Ot(";"):";"]}case"css-atrule":{let f=t.parent,p=Dt(r)&&!f.raws.semicolon&&e.originalText[R(r)-1]!==";";if(e.parser==="less"){if(r.mixin)return[s("selector"),r.important?" !important":"",p?"":";"];if(r.function)return[r.name,typeof r.params=="string"?r.params:s("params"),p?"":";"];if(r.variable)return["@",r.name,": ",r.value?s("value"):"",r.raws.between.trim()?r.raws.between.trim()+" ":"",r.nodes?["{",q([r.nodes.length>0?D:"",Pe(t,e,s)]),D,"}"]:"",p?"":";"]}let l=r.name==="import"&&((u=r.params)==null?void 0:u.type)==="value-unknown"&&r.params.value.endsWith(";");return["@",Jr(r)||r.name.endsWith(":")||Dt(r)?r.name:ue(r.name),r.params?[Jr(r)?"":Dt(r)?r.raws.afterName===""?"":r.name.endsWith(":")?" ":/^\s*\n\s*\n/u.test(r.raws.afterName)?[S,S]:/^\s*\n/u.test(r.raws.afterName)?S:" ":" ",typeof r.params=="string"?r.params:s("params")]:"",r.selector?q([" ",s("selector")]):"",r.value?L([" ",s("value"),tt(r,e)?ri(r)?" ":A:""]):r.name==="else"?" ":"",r.nodes?[tt(r,e)?"":r.selector&&!r.selector.nodes&&typeof r.selector.value=="string"&&Ne(r.selector.value)||!r.selector&&typeof r.params=="string"&&Ne(r.params)?A:" ","{",q([r.nodes.length>0?D:"",Pe(t,e,s)]),D,"}"]:p||l?"":";"]}case"media-query-list":{let f=[];return t.each(({node:p})=>{p.type==="media-query"&&p.value===""||f.push(s())},"nodes"),L(q(Y(A,f)))}case"media-query":return[Y(" ",t.map(s,"nodes")),t.isLast?"":","];case"media-type":return me(V(r.value,e));case"media-feature-expression":return r.nodes?["(",...t.map(s,"nodes"),")"]:r.value;case"media-feature":return ue(V(E(!1,r.value,/ +/gu," "),e));case"media-colon":return[r.value," "];case"media-value":return me(V(r.value,e));case"media-keyword":return V(r.value,e);case"media-url":return V(E(!1,E(!1,r.value,/^url\(\s+/giu,"url("),/\s+\)$/gu,")"),e);case"media-unknown":return r.value;case"selector-root":return L([Oe(t,"custom-selector")?[t.findAncestor(f=>f.type==="css-atrule").customSelector,A]:"",Y([",",Oe(t,["extend","custom-selector","nest"])?A:S],t.map(s,"nodes"))]);case"selector-selector":{let f=r.nodes.length>1;return L((f?q:p=>p)(t.map(s,"nodes")))}case"selector-comment":return r.value;case"selector-string":return V(r.value,e);case"selector-tag":return[r.namespace?[r.namespace===!0?"":r.namespace.trim(),"|"]:"",((a=t.previous)==null?void 0:a.type)==="selector-nesting"?r.value:me(Wn(t,r.value)?r.value.toLowerCase():r.value)];case"selector-id":return["#",r.value];case"selector-class":return[".",me(V(r.value,e))];case"selector-attribute":return["[",r.namespace?[r.namespace===!0?"":r.namespace.trim(),"|"]:"",r.attribute.trim(),r.operator??"",r.value?fi(V(r.value.trim(),e),e):"",r.insensitive?" i":"","]"];case"selector-combinator":{if(r.value==="+"||r.value===">"||r.value==="~"||r.value===">>>"){let l=t.parent;return[l.type==="selector-selector"&&l.nodes[0]===r?"":A,r.value,t.isLast?"":" "]}let f=r.value.trim().startsWith("(")?A:"",p=me(V(r.value.trim(),e))||A;return[f,p]}case"selector-universal":return[r.namespace?[r.namespace===!0?"":r.namespace.trim(),"|"]:"",r.value];case"selector-pseudo":return[ue(r.value),ae(r.nodes)?L(["(",q([D,Y([",",A],t.map(s,"nodes"))]),D,")"]):""];case"selector-nesting":return r.value;case"selector-unknown":{let f=t.findAncestor(y=>y.type==="css-rule");if(f!=null&&f.isSCSSNesterProperty)return me(V(ue(r.value),e));let p=t.parent;if((c=p.raws)!=null&&c.selector){let y=P(p),x=y+p.raws.selector.length;return e.originalText.slice(y,x).trim()}let l=t.grandparent;if(p.type==="value-paren_group"&&(l==null?void 0:l.type)==="value-func"&&l.value==="selector"){let y=R(p.open)+1,x=P(p.close),h=e.originalText.slice(y,x).trim();return Ne(h)?[Ke,h]:h}return r.value}case"value-value":case"value-root":return s("group");case"value-comment":return e.originalText.slice(P(r),R(r));case"value-comma_group":return ai(t,e,s);case"value-paren_group":return mi(t,e,s);case"value-func":return[r.value,Oe(t,"supports")&&ni(r)?" ":"",s("group")];case"value-paren":return r.value;case"value-number":return[ts(r.value),li(r.unit)];case"value-operator":return r.value;case"value-word":return r.isColor&&r.isHex||$n(r.value)?r.value.toLowerCase():r.value;case"value-colon":{let{previous:f}=t;return L([r.value,typeof(f==null?void 0:f.value)=="string"&&f.value.endsWith("\\")||Ce(t,"url")?"":A])}case"value-string":return Nt(r.raws.quote+r.value+r.raws.quote,e);case"value-atword":return["@",r.value];case"value-unicode-range":return r.value;case"value-unknown":return r.value;case"value-comma":default:throw new pn(r,"PostCSS")}}var yc={print:mc,embed:gn,insertPragma:Un,massageAstNode:dn,getVisitorKeys:xn},yi=yc;var gi=[{linguistLanguageId:50,name:"CSS",type:"markup",tmScope:"source.css",aceMode:"css",codemirrorMode:"css",codemirrorMimeType:"text/css",color:"#563d7c",extensions:[".css",".wxss"],parsers:["css"],vscodeLanguageIds:["css"]},{linguistLanguageId:262764437,name:"PostCSS",type:"markup",color:"#dc3a0c",tmScope:"source.postcss",group:"CSS",extensions:[".pcss",".postcss"],aceMode:"text",parsers:["css"],vscodeLanguageIds:["postcss"]},{linguistLanguageId:198,name:"Less",type:"markup",color:"#1d365d",aliases:["less-css"],extensions:[".less"],tmScope:"source.css.less",aceMode:"less",codemirrorMode:"css",codemirrorMimeType:"text/css",parsers:["less"],vscodeLanguageIds:["less"]},{linguistLanguageId:329,name:"SCSS",type:"markup",color:"#c6538c",tmScope:"source.css.scss",aceMode:"scss",codemirrorMode:"css",codemirrorMimeType:"text/x-scss",extensions:[".scss"],parsers:["scss"],vscodeLanguageIds:["scss"]}];var wi={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var gc={singleQuote:wi.singleQuote},vi=gc;var Js={};Zs(Js,{css:()=>Ny,less:()=>Py,scss:()=>Ry});var ol=xe(gt(),1),al=xe(To(),1),ul=xe(oa(),1);function sp(t,e){let s=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(s,e)}var aa=sp;var da=xe(ha(),1);function X(t,e,s){if(t&&typeof t=="object"){delete t.parent;for(let r in t)X(t[r],e,s),r==="type"&&typeof t[r]=="string"&&!t[r].startsWith(e)&&(!s||!s.test(t[r]))&&(t[r]=e+t[r])}return t}function Ls(t){if(t&&typeof t=="object"){delete t.parent;for(let e in t)Ls(t[e]);!Array.isArray(t)&&t.value&&!t.type&&(t.type="unknown")}return t}var mp=da.default.default;function yp(t){let e;try{e=mp(t)}catch{return{type:"selector-unknown",value:t}}return X(Ls(e),"media-")}var ma=yp;var lu=xe(uu(),1);function Nm(t){if(/\/\/|\/\*/u.test(t))return{type:"selector-unknown",value:t.trim()};let e;try{new lu.default(s=>{e=s}).process(t)}catch{return{type:"selector-unknown",value:t}}return X(e,"selector-")}var ee=Nm;var rl=xe(Qu(),1);var wy=t=>{for(;t.parent;)t=t.parent;return t},Fr=wy;function vy(t){return Fr(t).text.slice(t.group.open.sourceIndex+1,t.group.close.sourceIndex).trim()}var Ju=vy;function xy(t){if(ae(t)){for(let e=t.length-1;e>0;e--)if(t[e].type==="word"&&t[e].value==="{"&&t[e-1].type==="word"&&t[e-1].value.endsWith("#"))return!0}return!1}var Xu=xy;function by(t){return t.some(e=>e.type==="string"||e.type==="func"&&!e.value.endsWith("\\"))}var Zu=by;function _y(t,e){return!!(e.parser==="scss"&&(t==null?void 0:t.type)==="word"&&t.value.startsWith("$"))}var el=_y;var tl=t=>t.type==="paren"&&t.value===")";function Ey(t,e){var a;let{nodes:s}=t,r={open:null,close:null,groups:[],type:"paren_group"},n=[r],i=r,o={groups:[],type:"comma_group"},u=[o];for(let c=0;c0&&r.groups.push(o),r.close=f,u.length===1)throw new Error("Unbalanced parenthesis");u.pop(),o=$(!1,u,-1),o.groups.push(r),n.pop(),r=$(!1,n,-1)}else if(f.type==="comma"){if(c===s.length-3&&s[c+1].type==="comment"&&tl(s[c+2]))continue;r.groups.push(o),o={groups:[],type:"comma_group"},u[u.length-1]=o}else o.groups.push(f)}return o.groups.length>0&&r.groups.push(o),i}function $r(t){return t.type==="paren_group"&&!t.open&&!t.close&&t.groups.length===1||t.type==="comma_group"&&t.groups.length===1?$r(t.groups[0]):t.type==="paren_group"||t.type==="comma_group"?{...t,groups:t.groups.map($r)}:t}function sl(t,e){if(t&&typeof t=="object")for(let s in t)s!=="parent"&&(sl(t[s],e),s==="nodes"&&(t.group=$r(Ey(t,e)),delete t[s]));return t}function ky(t,e){if(e.parser==="less"&&t.startsWith("~`"))return{type:"value-unknown",value:t};let s=null;try{s=new rl.default(t,{loose:!0}).parse()}catch{return{type:"value-unknown",value:t}}s.text=t;let r=sl(s,e);return X(r,"value-",/^selector-/u)}var pe=ky;var Sy=new Set(["import","use","forward"]);function Ty(t){return Sy.has(t)}var nl=Ty;function Cy(t,e){return e.parser!=="scss"||!t.selector?!1:t.selector.replace(/\/\*.*?\*\//u,"").replace(/\/\/.*\n/u,"").trim().endsWith(":")}var il=Cy;var Oy=/(\s*)(!default).*$/u,Ay=/(\s*)(!global).*$/u;function ll(t,e){var s,r;if(t&&typeof t=="object"){delete t.parent;for(let u in t)ll(t[u],e);if(!t.type)return t;if(t.raws??(t.raws={}),t.type==="css-decl"&&typeof t.prop=="string"&&t.prop.startsWith("--")&&typeof t.value=="string"&&t.value.startsWith("{")){let u;if(t.value.trimEnd().endsWith("}")){let a=e.originalText.slice(0,t.source.start.offset),c="a".repeat(t.prop.length)+e.originalText.slice(t.source.start.offset+t.prop.length,t.source.end.offset),f=E(!1,a,/[^\n]/gu," ")+c,p;e.parser==="scss"?p=pl:e.parser==="less"?p=fl:p=cl;let l;try{l=p(f,{...e})}catch{}((s=l==null?void 0:l.nodes)==null?void 0:s.length)===1&&l.nodes[0].type==="css-rule"&&(u=l.nodes[0].nodes)}return u?t.value={type:"css-rule",nodes:u}:t.value={type:"value-unknown",value:t.raws.value.raw},t}let n="";typeof t.selector=="string"&&(n=t.raws.selector?t.raws.selector.scss??t.raws.selector.raw:t.selector,t.raws.between&&t.raws.between.trim().length>0&&(n+=t.raws.between),t.raws.selector=n);let i="";typeof t.value=="string"&&(i=t.raws.value?t.raws.value.scss??t.raws.value.raw:t.value,t.raws.value=i.trim());let o="";if(typeof t.params=="string"&&(o=t.raws.params?t.raws.params.scss??t.raws.params.raw:t.params,t.raws.afterName&&t.raws.afterName.trim().length>0&&(o=t.raws.afterName+o),t.raws.between&&t.raws.between.trim().length>0&&(o=o+t.raws.between),o=o.trim(),t.raws.params=o),n.trim().length>0)return n.startsWith("@")&&n.endsWith(":")?t:t.mixin?(t.selector=pe(n,e),t):(il(t,e)&&(t.isSCSSNesterProperty=!0),t.selector=ee(n),t);if(i.trim().length>0){let u=i.match(Oy);u&&(i=i.slice(0,u.index),t.scssDefault=!0,u[0].trim()!=="!default"&&(t.raws.scssDefault=u[0]));let a=i.match(Ay);if(a&&(i=i.slice(0,a.index),t.scssGlobal=!0,a[0].trim()!=="!global"&&(t.raws.scssGlobal=a[0])),i.startsWith("progid:"))return{type:"value-unknown",value:i};t.value=pe(i,e)}if(e.parser==="less"&&t.type==="css-decl"&&i.startsWith("extend(")&&(t.extend||(t.extend=t.raws.between===":"),t.extend&&!t.selector&&(delete t.value,t.selector=ee(i.slice(7,-1)))),t.type==="css-atrule"){if(e.parser==="less"){if(t.mixin){let u=t.raws.identifier+t.name+t.raws.afterName+t.raws.params;return t.selector=ee(u),delete t.params,t}if(t.function)return t}if(e.parser==="css"&&t.name==="custom-selector"){let u=t.params.match(/:--\S+\s+/u)[0].trim();return t.customSelector=u,t.selector=ee(t.params.slice(u.length).trim()),delete t.params,t}if(e.parser==="less"){if(t.name.includes(":")&&!t.params){t.variable=!0;let u=t.name.split(":");t.name=u[0],t.value=pe(u.slice(1).join(":"),e)}if(!["page","nest","keyframes"].includes(t.name)&&((r=t.params)==null?void 0:r[0])===":"){t.variable=!0;let u=t.params.slice(1);u&&(t.value=pe(u,e)),t.raws.afterName+=":"}if(t.variable)return delete t.params,t.value||delete t.value,t}}if(t.type==="css-atrule"&&o.length>0){let{name:u}=t,a=t.name.toLowerCase();return u==="warn"||u==="error"?(t.params={type:"media-unknown",value:o},t):u==="extend"||u==="nest"?(t.selector=ee(o),delete t.params,t):u==="at-root"?(/^\(\s*(?:without|with)\s*:.+\)$/su.test(o)?t.params=pe(o,e):(t.selector=ee(o),delete t.params),t):nl(a)?(t.import=!0,delete t.filename,t.params=pe(o,e),t):["namespace","supports","if","else","for","each","while","debug","mixin","include","function","return","define-mixin","add-mixin"].includes(u)?(o=o.replace(/(\$\S+?)(\s+)?\.{3}/u,"$1...$2"),o=o.replace(/^(?!if)(\S+)(\s+)\(/u,"$1($2"),t.value=pe(o,e),delete t.params,t):["media","custom-media"].includes(a)?o.includes("#{")?{type:"media-unknown",value:o}:(t.params=ma(o),t):(t.params=o,t)}}return t}function Ks(t,e,s){let r=Ze(e),{frontMatter:n}=r;e=r.content;let i;try{i=t(e,{map:!1})}catch(o){let{name:u,reason:a,line:c,column:f}=o;throw typeof c!="number"?o:aa(`${u}: ${a}`,{loc:{start:{line:c,column:f}},cause:o})}return s.originalText=e,i=ll(X(i,"css-"),s),Kr(i,e),n&&(n.source={startOffset:0,endOffset:n.raw.length},i.frontMatter=n),i}function cl(t,e={}){return Ks(ol.default.default,t,e)}function fl(t,e={}){return Ks(s=>al.default.parse(kn(s)),t,e)}function pl(t,e={}){return Ks(ul.default,t,e)}var Qs={astFormat:"postcss",hasPragma:Mn,locStart:P,locEnd:R},Ny={...Qs,parse:cl},Py={...Qs,parse:fl},Ry={...Qs,parse:pl};var Iy={postcss:yi};return wl(qy);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/postcss.mjs b/node_modules/prettier/plugins/postcss.mjs new file mode 100644 index 0000000..c056287 --- /dev/null +++ b/node_modules/prettier/plugins/postcss.mjs @@ -0,0 +1,54 @@ +var hl=Object.create;var $r=Object.defineProperty;var dl=Object.getOwnPropertyDescriptor;var ml=Object.getOwnPropertyNames;var yl=Object.getPrototypeOf,gl=Object.prototype.hasOwnProperty;var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),en=(t,e)=>{for(var s in e)$r(t,s,{get:e[s],enumerable:!0})},wl=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ml(e))!gl.call(t,n)&&n!==s&&$r(t,n,{get:()=>e[n],enumerable:!(r=dl(e,n))||r.enumerable});return t};var xe=(t,e,s)=>(s=t!=null?hl(yl(t)):{},wl(e||!t||!t.__esModule?$r(s,"default",{value:t,enumerable:!0}):s,t));var bi=g((xv,ss)=>{var _=String,xi=function(){return{isColorSupported:!1,reset:_,bold:_,dim:_,italic:_,underline:_,inverse:_,hidden:_,strikethrough:_,black:_,red:_,green:_,yellow:_,blue:_,magenta:_,cyan:_,white:_,gray:_,bgBlack:_,bgRed:_,bgGreen:_,bgYellow:_,bgBlue:_,bgMagenta:_,bgCyan:_,bgWhite:_,blackBright:_,redBright:_,greenBright:_,yellowBright:_,blueBright:_,magentaBright:_,cyanBright:_,whiteBright:_,bgBlackBright:_,bgRedBright:_,bgGreenBright:_,bgYellowBright:_,bgBlueBright:_,bgMagentaBright:_,bgCyanBright:_,bgWhiteBright:_}};ss.exports=xi();ss.exports.createColors=xi});var ns=g(()=>{});var Wt=g((Ev,ki)=>{"use strict";var _i=bi(),Ei=ns(),ot=class t extends Error{constructor(e,s,r,n,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,t)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=_i.isColorSupported);let r=f=>f,n=f=>f,i=f=>f;if(e){let{bold:f,gray:p,red:l}=_i.createColors(!0);n=y=>f(l(y)),r=y=>p(y),Ei&&(i=y=>Ei(y))}let o=s.split(/\r?\n/),u=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;return o.slice(u,a).map((f,p)=>{let l=u+1+p,y=" "+(" "+l).slice(-c)+" | ";if(l===this.line){if(f.length>160){let h=20,d=Math.max(0,this.column-h),m=Math.max(this.column+h,this.endColumn+h),b=f.slice(d,m),w=r(y.replace(/\d/g," "))+f.slice(0,Math.min(this.column-1,h-1)).replace(/[^\t]/g," ");return n(">")+r(y)+i(b)+` + `+w+n("^")}let x=r(y.replace(/\d/g," "))+f.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(y)+i(f)+` + `+x+n("^")}return" "+r(y)+i(f)}).join(` +`)}toString(){let e=this.showSourceCode();return e&&(e=` + +`+e+` +`),this.name+": "+this.message+e}};ki.exports=ot;ot.default=ot});var Yt=g((kv,Ti)=>{"use strict";var Si={after:` +`,beforeClose:` +`,beforeComment:` +`,beforeDecl:` +`,beforeOpen:" ",beforeRule:` +`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function wc(t){return t[0].toUpperCase()+t.slice(1)}var at=class{constructor(e){this.builder=e}atrule(e,s){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(s?";":"");this.builder(r+n+i,e)}}beforeAfter(e,s){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):s==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&n.type!=="root";)i+=1,n=n.parent;if(r.includes(` +`)){let o=this.raw(e,null,"indent");if(o.length)for(let u=0;u0&&e.nodes[s].type==="comment";)s-=1;let r=this.raw(e,"semicolon");for(let n=0;n{if(n=a.raws[s],typeof n<"u")return!1})}return typeof n>"u"&&(n=Si[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return s=r.raws.after,s.includes(` +`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawBeforeComment(e,s){let r;return e.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(` +`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(s,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,s){let r;return e.walkDecls(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(` +`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(s,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let s;return e.walk(r=>{if(r.type!=="decl"&&(s=r.raws.between,typeof s<"u"))return!1}),s}rawBeforeRule(e){let s;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return s=r.raws.before,s.includes(` +`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawColon(e){let s;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return s=r.raws.between.replace(/[^\s:]/g,""),!1}),s}rawEmptyBody(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(s=r.raws.after,typeof s<"u"))return!1}),s}rawIndent(e){if(e.raws.indent)return e.raws.indent;let s;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&typeof r.raws.before<"u"){let i=r.raws.before.split(` +`);return s=i[i.length-1],s=s.replace(/\S/g,""),!1}}),s}rawSemicolon(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(s=r.raws.semicolon,typeof s<"u"))return!1}),s}rawValue(e,s){let r=e[s],n=e.raws[s];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,s){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,s)}};Ti.exports=at;at.default=at});var ut=g((Sv,Ci)=>{"use strict";var vc=Yt();function is(t,e){new vc(e).stringify(t)}Ci.exports=is;is.default=is});var Vt=g((Tv,os)=>{"use strict";os.exports.isClean=Symbol("isClean");os.exports.my=Symbol("my")});var pt=g((Cv,Oi)=>{"use strict";var xc=Wt(),bc=Yt(),_c=ut(),{isClean:lt,my:Ec}=Vt();function as(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let n=t[r],i=typeof n;r==="parent"&&i==="object"?e&&(s[r]=e):r==="source"?s[r]=n:Array.isArray(n)?s[r]=n.map(o=>as(o,s)):(i==="object"&&n!==null&&(n=as(n)),s[r]=n)}return s}function ct(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,n=0;for(let i=0;ie.root().toProxy():e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="prop"||s==="value"||s==="name"||s==="params"||s==="important"||s==="text")&&e.markDirty()),!0}}}markClean(){this[lt]=!0}markDirty(){if(this[lt]){this[lt]=!1;let e=this;for(;e=e.parent;)e[lt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let s=this.source.start;if(e.index)s=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,i=r.slice(ct(r,this.source.start),ct(r,this.source.end)).indexOf(e.word);i!==-1&&(s=this.positionInside(i))}return s}positionInside(e){let s=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,i=ct(n,this.source.start),o=i+e;for(let u=i;utypeof a=="object"&&a.toJSON?a.toJSON(null,s):a);else if(typeof u=="object"&&u.toJSON)r[o]=u.toJSON(null,s);else if(o==="source"){let a=s.get(u.input);a==null&&(a=i,s.set(u.input,i),i++),r[o]={end:u.end,inputId:a,start:u.start}}else r[o]=u}return n&&(r.inputs=[...s.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=_c){e.stringify&&(e=e.stringify);let s="";return e(this,r=>{s+=r}),s}warn(e,s,r){let n={node:this};for(let i in r)n[i]=r[i];return e.warn(s,n)}};Oi.exports=ft;ft.default=ft});var Re=g((Ov,Ai)=>{"use strict";var kc=pt(),ht=class extends kc{constructor(e){super(e),this.type="comment"}};Ai.exports=ht;ht.default=ht});var mt=g((Av,Ni)=>{"use strict";var Sc=pt(),dt=class extends Sc{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};Ni.exports=dt;dt.default=dt});var le=g((Nv,Ui)=>{"use strict";var Pi=Re(),Ri=mt(),Tc=pt(),{isClean:Ii,my:qi}=Vt(),us,Li,Di,ls;function Bi(t){return t.map(e=>(e.nodes&&(e.nodes=Bi(e.nodes)),delete e.source,e))}function Mi(t){if(t[Ii]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)Mi(e)}var z=class t extends Tc{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let n of r)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,n;for(;this.indexes[s]e[s](...r.map(n=>typeof n=="function"?(i,o)=>n(i.toProxy(),o):n)):s==="every"||s==="some"?r=>e[s]((n,...i)=>r(n.toProxy(),...i)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),n=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of n)this.proxyOf.nodes.splice(r+1,0,o);let i;for(let o in this.indexes)i=this.indexes[o],r"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ri(e)]}else if(e.selector||e.selectors)e=[new ls(e)];else if(e.name)e=[new us(e)];else if(e.text)e=[new Pi(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[qi]||t.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[Ii]&&Mi(n),n.raws||(n.raws={}),typeof n.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(n.raws.before=s.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(n=>{s.props&&!s.props.includes(n.prop)||s.fast&&!n.value.includes(s.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let n;try{n=e(s,r)}catch(i){throw s.addToError(i)}return n!==!1&&s.walk&&(n=s.walk(e)),n})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return s(r,n)}):(s=e,this.walk((r,n)=>{if(r.type==="atrule")return s(r,n)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return s(r,n)}):(s=e,this.walk((r,n)=>{if(r.type==="decl")return s(r,n)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return s(r,n)}):(s=e,this.walk((r,n)=>{if(r.type==="rule")return s(r,n)}))}};z.registerParse=t=>{Li=t};z.registerRule=t=>{ls=t};z.registerAtRule=t=>{us=t};z.registerRoot=t=>{Di=t};Ui.exports=z;z.default=z;z.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,us.prototype):t.type==="rule"?Object.setPrototypeOf(t,ls.prototype):t.type==="decl"?Object.setPrototypeOf(t,Ri.prototype):t.type==="comment"?Object.setPrototypeOf(t,Pi.prototype):t.type==="root"&&Object.setPrototypeOf(t,Di.prototype),t[qi]=!0,t.nodes&&t.nodes.forEach(e=>{z.rebuild(e)})}});var $i=g((Pv,Fi)=>{var Cc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Oc=(t,e=21)=>(s=e)=>{let r="",n=s|0;for(;n--;)r+=t[Math.random()*t.length|0];return r},Ac=(t=21)=>{let e="",s=t|0;for(;s--;)e+=Cc[Math.random()*64|0];return e};Fi.exports={nanoid:Ac,customAlphabet:Oc}});var Wi=g(()=>{});var cs=g((qv,Yi)=>{Yi.exports=class{}});var qe=g((Dv,ji)=>{"use strict";var{nanoid:Nc}=$i(),{isAbsolute:hs,resolve:ds}={},{SourceMapConsumer:Pc,SourceMapGenerator:Rc}=Wi(),{fileURLToPath:Vi,pathToFileURL:zt}={},zi=Wt(),Ic=cs(),fs=ns(),ps=Symbol("fromOffsetCache"),qc=!!(Pc&&Rc),Gi=!!(ds&&hs),Ie=class{get from(){return this.file||this.id}constructor(e,s={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!Gi||/^\w+:\/\//.test(s.from)||hs(s.from)?this.file=s.from:this.file=ds(s.from)),Gi&&qc){let r=new Ic(this.css,s);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id=""),this.map&&(this.map.file=this.from)}error(e,s,r,n={}){let i,o,u;if(s&&typeof s=="object"){let c=s,f=r;if(typeof c.offset=="number"){let p=this.fromOffset(c.offset);s=p.line,r=p.col}else s=c.line,r=c.column;if(typeof f.offset=="number"){let p=this.fromOffset(f.offset);o=p.line,i=p.col}else o=f.line,i=f.column}else if(!r){let c=this.fromOffset(s);s=c.line,r=c.col}let a=this.origin(s,r,o,i);return a?u=new zi(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):u=new zi(e,o===void 0?s:{column:r,line:s},o===void 0?r:{column:i,line:o},this.css,this.file,n.plugin),u.input={column:r,endColumn:i,endLine:o,line:s,source:this.css},this.file&&(zt&&(u.input.url=zt(this.file).toString()),u.input.file=this.file),u}fromOffset(e){let s,r;if(this[ps])r=this[ps];else{let i=this.css.split(` +`);r=new Array(i.length);let o=0;for(let u=0,a=i.length;u=s)n=r.length-1;else{let i=r.length-2,o;for(;n>1),e=r[o+1])n=o+1;else{n=o;break}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ds(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,r,n){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:s,line:e});if(!o.source)return!1;let u;typeof r=="number"&&(u=i.originalPositionFor({column:n,line:r}));let a;hs(o.source)?a=zt(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||zt(this.map.mapFile));let c={column:o.column,endColumn:u&&u.column,endLine:u&&u.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Vi)c.file=Vi(a);else throw new Error("file: protocol is not available in this PostCSS build");let f=i.sourceContentFor(o.source);return f&&(c.source=f),c}toJSON(){let e={};for(let s of["hasBOM","css","file","id"])this[s]!=null&&(e[s]=this[s]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};ji.exports=Ie;Ie.default=Ie;fs&&fs.registerInput&&fs.registerInput(Ie)});var Gt=g((Bv,Ki)=>{"use strict";var Hi=le(),Le=class extends Hi{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};Ki.exports=Le;Le.default=Le;Hi.registerAtRule(Le)});var De=g((Mv,Zi)=>{"use strict";var Qi=le(),Ji,Xi,ce=class extends Qi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,s,r){let n=super.normalize(e);if(s){if(r==="prepend")this.nodes.length>1?s.raws.before=this.nodes[1].raws.before:delete s.raws.before;else if(this.first!==s)for(let i of n)i.raws.before=s.raws.before}return n}removeChild(e,s){let r=this.index(e);return!s&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Ji(new Xi,this,e).stringify()}};ce.registerLazyResult=t=>{Ji=t};ce.registerProcessor=t=>{Xi=t};Zi.exports=ce;ce.default=ce;Qi.registerRoot(ce)});var ms=g((Uv,eo)=>{"use strict";var yt={comma(t){return yt.split(t,[","],!0)},space(t){let e=[" ",` +`," "];return yt.split(t,e)},split(t,e,s){let r=[],n="",i=!1,o=0,u=!1,a="",c=!1;for(let f of t)c?c=!1:f==="\\"?c=!0:u?f===a&&(u=!1):f==='"'||f==="'"?(u=!0,a=f):f==="("?o+=1:f===")"?o>0&&(o-=1):o===0&&e.includes(f)&&(i=!0),i?(n!==""&&r.push(n.trim()),n="",i=!1):n+=f;return(s||n!=="")&&r.push(n.trim()),r}};eo.exports=yt;yt.default=yt});var jt=g((Fv,ro)=>{"use strict";var to=le(),Lc=ms(),Be=class extends to{get selectors(){return Lc.comma(this.selector)}set selectors(e){let s=this.selector?this.selector.match(/,\s*/):null,r=s?s[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};ro.exports=Be;Be.default=Be;to.registerRule(Be)});var Qt=g(($v,no)=>{"use strict";var Ht=/[\t\n\f\r "#'()/;[\\\]{}]/g,Kt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Dc=/.[\r\n"'(/\\]/,so=/[\da-f]/i;no.exports=function(e,s={}){let r=e.css.valueOf(),n=s.ignoreErrors,i,o,u,a,c,f,p,l,y,x,h=r.length,d=0,m=[],b=[];function w(){return d}function v(W){throw e.error("Unclosed "+W,d)}function N(){return b.length===0&&d>=h}function F(W){if(b.length)return b.pop();if(d>=h)return;let T=W?W.ignoreUnclosed:!1;switch(i=r.charCodeAt(d),i){case 10:case 32:case 9:case 13:case 12:{a=d;do a+=1,i=r.charCodeAt(a);while(i===32||i===10||i===9||i===13||i===12);f=["space",r.slice(d,a)],d=a-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let C=String.fromCharCode(i);f=[C,C,d];break}case 40:{if(x=m.length?m.pop()[1]:"",y=r.charCodeAt(d+1),x==="url"&&y!==39&&y!==34&&y!==32&&y!==10&&y!==9&&y!==12&&y!==13){a=d;do{if(p=!1,a=r.indexOf(")",a+1),a===-1)if(n||T){a=d;break}else v("bracket");for(l=a;r.charCodeAt(l-1)===92;)l-=1,p=!p}while(p);f=["brackets",r.slice(d,a+1),d,a],d=a}else a=r.indexOf(")",d+1),o=r.slice(d,a+1),a===-1||Dc.test(o)?f=["(","(",d]:(f=["brackets",o,d,a],d=a);break}case 39:case 34:{c=i===39?"'":'"',a=d;do{if(p=!1,a=r.indexOf(c,a+1),a===-1)if(n||T){a=d+1;break}else v("string");for(l=a;r.charCodeAt(l-1)===92;)l-=1,p=!p}while(p);f=["string",r.slice(d,a+1),d,a],d=a;break}case 64:{Ht.lastIndex=d+1,Ht.test(r),Ht.lastIndex===0?a=r.length-1:a=Ht.lastIndex-2,f=["at-word",r.slice(d,a+1),d,a],d=a;break}case 92:{for(a=d,u=!0;r.charCodeAt(a+1)===92;)a+=1,u=!u;if(i=r.charCodeAt(a+1),u&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(a+=1,so.test(r.charAt(a)))){for(;so.test(r.charAt(a+1));)a+=1;r.charCodeAt(a+1)===32&&(a+=1)}f=["word",r.slice(d,a+1),d,a],d=a;break}default:{i===47&&r.charCodeAt(d+1)===42?(a=r.indexOf("*/",d+2)+1,a===0&&(n||T?a=r.length:v("comment")),f=["comment",r.slice(d,a+1),d,a],d=a):(Kt.lastIndex=d+1,Kt.test(r),Kt.lastIndex===0?a=r.length-1:a=Kt.lastIndex-2,f=["word",r.slice(d,a+1),d,a],m.push(f),d=a);break}}return d++,f}function Q(W){b.push(W)}return{back:Q,endOfFile:N,nextToken:F,position:w}}});var Jt=g((Wv,ao)=>{"use strict";var Bc=Gt(),Mc=Re(),Uc=mt(),Fc=De(),io=jt(),$c=Qt(),oo={empty:!0,space:!0};function Wc(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}var ys=class{constructor(e){this.input=e,this.root=new Fc,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let s=new Bc;s.name=e[1].slice(1),s.name===""&&this.unnamedAtrule(s,e),this.init(s,e[2]);let r,n,i,o=!1,u=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){u=!0;break}else if(r==="}"){if(a.length>0){for(i=a.length-1,n=a[i];n&&n[0]==="space";)n=a[--i];n&&(s.source.end=this.getPosition(n[3]||n[2]),s.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),u&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let s=this.colon(e);if(s===!1)return;let r=0,n;for(let i=s-1;i>=0&&(n=e[i],!(n[0]!=="space"&&(r+=1,r===2)));i--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let s=0,r,n,i;for(let[o,u]of e.entries()){if(n=u,i=n[0],i==="("&&(s+=1),i===")"&&(s-=1),s===0&&i===":")if(!r)this.doubleColon(n);else{if(r[0]==="word"&&r[1]==="progid")continue;return o}r=n}return!1}comment(e){let s=new Mc;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))s.text="",s.raws.left=r,s.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);s.text=n[2],s.raws.left=n[1],s.raws.right=n[3]}}createTokenizer(){this.tokenizer=$c(this.input)}decl(e,s){let r=new Uc;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||Wc(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let i;for(;e.length;)if(i=e.shift(),i[0]===":"){r.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),r.raws.between+=i[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],u;for(;e.length&&(u=e[0][0],!(u!=="space"&&u!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(i=e[c],i[1].toLowerCase()==="!important"){r.important=!0;let f=this.stringFrom(e,c);f=this.spacesFromEnd(e)+f,f!==" !important"&&(r.raws.important=f);break}else if(i[1].toLowerCase()==="important"){let f=e.slice(0),p="";for(let l=c;l>0;l--){let y=f[l][0];if(p.trim().startsWith("!")&&y!=="space")break;p=f.pop()[1]+p}p.trim().startsWith("!")&&(r.important=!0,r.raws.important=p,e=f)}if(i[0]!=="space"&&i[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(r.raws.between+=o.map(c=>c[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),s),r.value.includes(":")&&!s&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let s=new io;this.init(s,e[2]),s.selector="",s.raws.between="",this.current=s}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let s=this.current.nodes[this.current.nodes.length-1];s&&s.type==="rule"&&!s.raws.ownSemicolon&&(s.raws.ownSemicolon=this.spaces,this.spaces="",s.source.end=this.getPosition(e[2]),s.source.end.offset+=s.raws.ownSemicolon.length)}}getPosition(e){let s=this.input.fromOffset(e);return{column:s.col,line:s.line,offset:e}}init(e,s){this.current.push(e),e.source={input:this.input,start:this.getPosition(s)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let s=!1,r=null,n=!1,i=null,o=[],u=e[1].startsWith("--"),a=[],c=e;for(;c;){if(r=c[0],a.push(c),r==="("||r==="[")i||(i=c),o.push(r==="("?")":"]");else if(u&&n&&r==="{")i||(i=c),o.push("}");else if(o.length===0)if(r===";")if(n){this.decl(a,u);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),s=!0;break}else r===":"&&(n=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(s=!0),o.length>0&&this.unclosedBracket(i),s&&n){if(!u)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,u)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,s,r,n){let i,o,u=r.length,a="",c=!0,f,p;for(let l=0;ly+x[1],"");e.raws[s]={raw:l,value:a}}e[s]=a}rule(e){e.pop();let s=new io;this.init(s,e[0][2]),s.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(s,"selector",e),this.current=s}spacesAndCommentsFromEnd(e){let s,r="";for(;e.length&&(s=e[e.length-1][0],!(s!=="space"&&s!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let s,r="";for(;e.length&&(s=e[0][0],!(s!=="space"&&s!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let s,r="";for(;e.length&&(s=e[e.length-1][0],s==="space");)r=e.pop()[1]+r;return r}stringFrom(e,s){let r="";for(let n=s;n{"use strict";var Yc=le(),Vc=qe(),zc=Jt();function Xt(t,e){let s=new Vc(t,e),r=new zc(s);try{r.parse()}catch(n){throw n}return r.root}uo.exports=Xt;Xt.default=Xt;Yc.registerParse(Xt)});var lo=g((Vv,gs)=>{var Gc=Qt(),jc=qe();gs.exports={isInlineComment(t){if(t[0]==="word"&&t[1].slice(0,2)==="//"){let e=t,s=[],r,n;for(;t;){if(/\r?\n/.test(t[1])){if(/['"].*\r?\n/.test(t[1])){s.push(t[1].substring(0,t[1].indexOf(` +`))),n=t[1].substring(t[1].indexOf(` +`));let o=this.input.css.valueOf().substring(this.tokenizer.position());n+=o,r=t[3]+o.length-n.length}else this.tokenizer.back(t);break}s.push(t[1]),r=t[2],t=this.tokenizer.nextToken({ignoreUnclosed:!0})}let i=["comment",s.join(""),e[2],r];return this.inlineComment(i),n&&(this.input=new jc(n),this.tokenizer=Gc(this.input)),!0}else if(t[1]==="/"){let e=this.tokenizer.nextToken({ignoreUnclosed:!0});if(e[0]==="comment"&&/^\/\*/.test(e[1]))return e[0]="word",e[1]=e[1].slice(1),t[1]="//",this.tokenizer.back(e),gs.exports.isInlineComment.bind(this)(t)}return!1}}});var fo=g((zv,co)=>{co.exports={interpolation(t){let e=[t,this.tokenizer.nextToken()],s=["word","}"];if(e[0][1].length>1||e[1][0]!=="{")return this.tokenizer.back(e[1]),!1;for(t=this.tokenizer.nextToken();t&&s.includes(t[0]);)e.push(t),t=this.tokenizer.nextToken();let r=e.map(u=>u[1]),[n]=e,i=e.pop(),o=["word",r.join(""),n[2],i[2]];return this.tokenizer.back(t),this.tokenizer.back(o),!0}}});var ho=g((Gv,po)=>{var Hc=/^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/,Kc=/\.[0-9]/,Qc=t=>{let[,e]=t,[s]=e;return(s==="."||s==="#")&&Hc.test(e)===!1&&Kc.test(e)===!1};po.exports={isMixinToken:Qc}});var yo=g((jv,mo)=>{var Jc=Qt(),Xc=/^url\((.+)\)/;mo.exports=t=>{let{name:e,params:s=""}=t;if(e==="import"&&s.length){t.import=!0;let r=Jc({css:s});for(t.filename=s.replace(Xc,"$1");!r.endOfFile();){let[n,i]=r.nextToken();if(n==="word"&&i==="url")return;if(n==="brackets"){t.options=i,t.filename=s.replace(i,"").trim();break}}}}});var xo=g((Hv,vo)=>{var go=/:$/,wo=/^:(\s+)?/;vo.exports=t=>{let{name:e,params:s=""}=t;if(t.name.slice(-1)===":"){if(go.test(e)){let[r]=e.match(go);t.name=e.replace(r,""),t.raws.afterName=r+(t.raws.afterName||""),t.variable=!0,t.value=t.params}if(wo.test(s)){let[r]=s.match(wo);t.value=s.replace(r,""),t.raws.afterName=(t.raws.afterName||"")+r,t.variable=!0}}}});var Eo=g((Qv,_o)=>{var Zc=Re(),ef=Jt(),{isInlineComment:tf}=lo(),{interpolation:bo}=fo(),{isMixinToken:rf}=ho(),sf=yo(),nf=xo(),of=/(!\s*important)$/i;_o.exports=class extends ef{constructor(...e){super(...e),this.lastNode=null}atrule(e){bo.bind(this)(e)||(super.atrule(e),sf(this.lastNode),nf(this.lastNode))}decl(...e){super.decl(...e),/extend\(.+\)/i.test(this.lastNode.value)&&(this.lastNode.extend=!0)}each(e){e[0][1]=` ${e[0][1]}`;let s=e.findIndex(u=>u[0]==="("),r=e.reverse().find(u=>u[0]===")"),n=e.reverse().indexOf(r),o=e.splice(s,n).map(u=>u[1]).join("");for(let u of e.reverse())this.tokenizer.back(u);this.atrule(this.tokenizer.nextToken()),this.lastNode.function=!0,this.lastNode.params=o}init(e,s,r){super.init(e,s,r),this.lastNode=e}inlineComment(e){let s=new Zc,r=e[1].slice(2);if(this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.inline=!0,s.raws.begin="//",/^\s*$/.test(r))s.text="",s.raws.left=r,s.raws.right="";else{let n=r.match(/^(\s*)([^]*[^\s])(\s*)$/);[,s.raws.left,s.text,s.raws.right]=n}}mixin(e){let[s]=e,r=s[1].slice(0,1),n=e.findIndex(c=>c[0]==="brackets"),i=e.findIndex(c=>c[0]==="("),o="";if((n<0||n>3)&&i>0){let c=e.reduce((w,v,N)=>v[0]===")"?N:w),p=e.slice(i,c+i).map(w=>w[1]).join(""),[l]=e.slice(i),y=[l[2],l[3]],[x]=e.slice(c,c+1),h=[x[2],x[3]],d=["brackets",p].concat(y,h),m=e.slice(0,i),b=e.slice(c+1);e=m,e.push(d),e=e.concat(b)}let u=[];for(let c of e)if((c[1]==="!"||u.length)&&u.push(c),c[1]==="important")break;if(u.length){let[c]=u,f=e.indexOf(c),p=u[u.length-1],l=[c[2],c[3]],y=[p[4],p[5]],h=["word",u.map(d=>d[1]).join("")].concat(l,y);e.splice(f,u.length,h)}let a=e.findIndex(c=>of.test(c[1]));a>0&&([,o]=e[a],e.splice(a,1));for(let c of e.reverse())this.tokenizer.back(c);this.atrule(this.tokenizer.nextToken()),this.lastNode.mixin=!0,this.lastNode.raws.identifier=r,o&&(this.lastNode.important=!0,this.lastNode.raws.important=o)}other(e){tf.bind(this)(e)||super.other(e)}rule(e){let s=e[e.length-1],r=e[e.length-2];if(r[0]==="at-word"&&s[0]==="{"&&(this.tokenizer.back(s),bo.bind(this)(r))){let i=this.tokenizer.nextToken();e=e.slice(0,e.length-2).concat([i]);for(let o of e.reverse())this.tokenizer.back(o);return}super.rule(e),/:extend\(.+\)/i.test(this.lastNode.selector)&&(this.lastNode.extend=!0)}unknownWord(e){let[s]=e;if(e[0][1]==="each"&&e[1][0]==="("){this.each(e);return}if(rf(s)){this.mixin(e);return}super.unknownWord(e)}}});var So=g((Xv,ko)=>{var af=Yt();ko.exports=class extends af{atrule(e,s){if(!e.mixin&&!e.variable&&!e.function){super.atrule(e,s);return}let n=`${e.function?"":e.raws.identifier||"@"}${e.name}`,i=e.params?this.rawValue(e,"params"):"",o=e.raws.important||"";if(e.variable&&(i=e.value),typeof e.raws.afterName<"u"?n+=e.raws.afterName:i&&(n+=" "),e.nodes)this.block(e,n+i+o);else{let u=(e.raws.between||"")+o+(s?";":"");this.builder(n+i+u,e)}}comment(e){if(e.inline){let s=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder(`//${s}${e.text}${r}`,e)}else super.comment(e)}}});var To=g((Zv,ws)=>{var uf=qe(),lf=Eo(),cf=So();ws.exports={parse(t,e){let s=new uf(t,e),r=new lf(s);return r.parse(),r.root.walk(n=>{let i=s.css.lastIndexOf(n.source.input.css);if(i===0)return;if(i+n.source.input.css.length!==s.css.length)throw new Error("Invalid state detected in postcss-less");let o=i+n.source.start.offset,u=s.fromOffset(i+n.source.start.offset);if(n.source.start={offset:o,line:u.line,column:u.col},n.source.end){let a=i+n.source.end.offset,c=s.fromOffset(i+n.source.end.offset);n.source.end={offset:a,line:c.line,column:c.col}}}),r.root},stringify(t,e){new cf(e).stringify(t)},nodeToString(t){let e="";return ws.exports.stringify(t,s=>{e+=s}),e}}});var Zt=g((ex,Ao)=>{"use strict";var ff=le(),Co,Oo,ye=class extends ff{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Co(new Oo,this,e).stringify()}};ye.registerLazyResult=t=>{Co=t};ye.registerProcessor=t=>{Oo=t};Ao.exports=ye;ye.default=ye});var Po=g((tx,No)=>{"use strict";var pf=Gt(),hf=Re(),df=mt(),mf=qe(),yf=cs(),gf=De(),wf=jt();function wt(t,e){if(Array.isArray(t))return t.map(n=>wt(n));let{inputs:s,...r}=t;if(s){e=[];for(let n of s){let i={...n,__proto__:mf.prototype};i.map&&(i.map={...i.map,__proto__:yf.prototype}),e.push(i)}}if(r.nodes&&(r.nodes=t.nodes.map(n=>wt(n,e))),r.source){let{inputId:n,...i}=r.source;r.source=i,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new gf(r);if(r.type==="decl")return new df(r);if(r.type==="rule")return new wf(r);if(r.type==="comment")return new hf(r);if(r.type==="atrule")return new pf(r);throw new Error("Unknown node type: "+t.type)}No.exports=wt;wt.default=wt});var vs=g((rx,Ro)=>{Ro.exports=class{generate(){}}});var xs=g((nx,Io)=>{"use strict";var vt=class{constructor(e,s={}){if(this.type="warning",this.text=e,s.node&&s.node.source){let r=s.node.rangeBy(s);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in s)this[r]=s[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};Io.exports=vt;vt.default=vt});var er=g((ix,qo)=>{"use strict";var vf=xs(),xt=class{get content(){return this.css}constructor(e,s,r){this.processor=e,this.messages=[],this.root=s,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let r=new vf(e,s);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}};qo.exports=xt;xt.default=xt});var bs=g((ox,Do)=>{"use strict";var Lo={};Do.exports=function(e){Lo[e]||(Lo[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var ks=g((ux,Fo)=>{"use strict";var xf=le(),bf=Zt(),_f=vs(),Ef=gt(),Bo=er(),kf=De(),Sf=ut(),{isClean:K,my:Tf}=Vt(),ax=bs(),Cf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Of={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Af={Once:!0,postcssPlugin:!0,prepare:!0},Me=0;function bt(t){return typeof t=="object"&&typeof t.then=="function"}function Uo(t){let e=!1,s=Cf[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,Me,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,Me,s+"Exit"]:[s,s+"Exit"]}function Mo(t){let e;return t.type==="document"?e=["Document",Me,"DocumentExit"]:t.type==="root"?e=["Root",Me,"RootExit"]:e=Uo(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function _s(t){return t[K]=!1,t.nodes&&t.nodes.forEach(e=>_s(e)),t}var Es={},fe=class t{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let n;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))n=_s(s);else if(s instanceof t||s instanceof Bo)n=_s(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let i=Ef;r.syntax&&(i=r.syntax.parse),r.parser&&(i=r.parser),i.parse&&(i=i.parse);try{n=i(s,r)}catch(o){this.processed=!0,this.error=o}n&&!n[Tf]&&xf.rebuild(n)}this.result=new Bo(e,n,r),this.helpers={...Es,postcss:Es,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,s){let r=this.result.lastPlugin;try{s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(s,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,n])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!Of[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Af[r])if(typeof s[r]=="object")for(let n in s[r])n==="*"?e(s,r,s[r][n]):e(s,r+"-"+n.toLowerCase(),s[r][n]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let r=this.visitTick(s);if(bt(r))try{await r}catch(n){let i=s[s.length-1].node;throw this.handleError(n,i)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let n=e.nodes.map(i=>r(i,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return bt(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,s=Sf;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let n=new _f(s,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let s=this.runOnRoot(e);if(bt(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[K];)e[K]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return this.async().then(e,s)}toString(){return this.css}visitSync(e,s){for(let[r,n]of e){this.result.lastPlugin=r;let i;try{i=n(s,this.helpers)}catch(o){throw this.handleError(o,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(bt(i))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:n}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&s.visitorIndex{n[K]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}};fe.registerPostcss=t=>{Es=t};Fo.exports=fe;fe.default=fe;kf.registerLazyResult(fe);bf.registerLazyResult(fe)});var Wo=g((cx,$o)=>{"use strict";var Nf=vs(),Pf=gt(),Rf=er(),If=ut(),lx=bs(),_t=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,s=Pf;try{e=s(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,s,r){s=s.toString(),this.stringified=!1,this._processor=e,this._css=s,this._opts=r,this._map=void 0;let n,i=If;this.result=new Rf(this._processor,n,this._opts),this.result.css=s;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let u=new Nf(i,n,this._opts,s);if(u.isMap()){let[a,c]=u.generate();a&&(this.result.css=a),c&&(this.result.map=c)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,s){return this.async().then(e,s)}toString(){return this._css}warnings(){return[]}};$o.exports=_t;_t.default=_t});var Vo=g((fx,Yo)=>{"use strict";var qf=Zt(),Lf=ks(),Df=Wo(),Bf=De(),ge=class{constructor(e=[]){this.version="8.5.3",this.plugins=this.normalize(e)}normalize(e){let s=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))s=s.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)s.push(r);else if(typeof r=="function")s.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return s}process(e,s={}){return!this.plugins.length&&!s.parser&&!s.stringifier&&!s.syntax?new Df(this,e,s):new Lf(this,e,s)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};Yo.exports=ge;ge.default=ge;Bf.registerProcessor(ge);qf.registerProcessor(ge)});var tr=g((px,Jo)=>{"use strict";var zo=Gt(),Go=Re(),Mf=le(),Uf=Wt(),jo=mt(),Ho=Zt(),Ff=Po(),$f=qe(),Wf=ks(),Yf=ms(),Vf=pt(),zf=gt(),Ss=Vo(),Gf=er(),Ko=De(),Qo=jt(),jf=ut(),Hf=xs();function k(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Ss(t)}k.plugin=function(e,s){let r=!1;function n(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide: +https://evilmartians.com/chronicles/postcss-8-plugin-migration`));let u=s(...o);return u.postcssPlugin=e,u.postcssVersion=new Ss().version,u}let i;return Object.defineProperty(n,"postcss",{get(){return i||(i=n()),i}}),n.process=function(o,u,a){return k([n(a)]).process(o,u)},n};k.stringify=jf;k.parse=zf;k.fromJSON=Ff;k.list=Yf;k.comment=t=>new Go(t);k.atRule=t=>new zo(t);k.decl=t=>new jo(t);k.rule=t=>new Qo(t);k.root=t=>new Ko(t);k.document=t=>new Ho(t);k.CssSyntaxError=Uf;k.Declaration=jo;k.Container=Mf;k.Processor=Ss;k.Document=Ho;k.Comment=Go;k.Warning=Hf;k.AtRule=zo;k.Result=Gf;k.Input=$f;k.Rule=Qo;k.Root=Ko;k.Node=Vf;Wf.registerPostcss(k);Jo.exports=k;k.default=k});var Zo=g((hx,Xo)=>{var{Container:Kf}=tr(),Ts=class extends Kf{constructor(e){super(e),this.type="decl",this.isNested=!0,this.nodes||(this.nodes=[])}};Xo.exports=Ts});var ra=g((dx,ta)=>{"use strict";var rr=/[\t\n\f\r "#'()/;[\\\]{}]/g,sr=/[,\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Qf=/.[\r\n"'(/\\]/,ea=/[\da-f]/i,nr=/[\n\f\r]/g;ta.exports=function(e,s={}){let r=e.css.valueOf(),n=s.ignoreErrors,i,o,u,a,c,f,p,l,y,x=r.length,h=0,d=[],m=[],b;function w(){return h}function v(T){throw e.error("Unclosed "+T,h)}function N(){return m.length===0&&h>=x}function F(){let T=1,C=!1,O=!1;for(;T>0;)o+=1,r.length<=o&&v("interpolation"),i=r.charCodeAt(o),l=r.charCodeAt(o+1),C?!O&&i===C?(C=!1,O=!1):i===92?O=!O:O&&(O=!1):i===39||i===34?C=i:i===125?T-=1:i===35&&l===123&&(T+=1)}function Q(T){if(m.length)return m.pop();if(h>=x)return;let C=T?T.ignoreUnclosed:!1;switch(i=r.charCodeAt(h),i){case 10:case 32:case 9:case 13:case 12:{o=h;do o+=1,i=r.charCodeAt(o);while(i===32||i===10||i===9||i===13||i===12);y=["space",r.slice(h,o)],h=o-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let O=String.fromCharCode(i);y=[O,O,h];break}case 44:{y=["word",",",h,h+1];break}case 40:{if(p=d.length?d.pop()[1]:"",l=r.charCodeAt(h+1),p==="url"&&l!==39&&l!==34){for(b=1,f=!1,o=h+1;o<=r.length-1;){if(l=r.charCodeAt(o),l===92)f=!f;else if(l===40)b+=1;else if(l===41&&(b-=1,b===0))break;o+=1}a=r.slice(h,o+1),y=["brackets",a,h,o],h=o}else o=r.indexOf(")",h+1),a=r.slice(h,o+1),o===-1||Qf.test(a)?y=["(","(",h]:(y=["brackets",a,h,o],h=o);break}case 39:case 34:{for(u=i,o=h,f=!1;o{var{Comment:Jf}=tr(),Xf=Jt(),Zf=Zo(),ep=ra(),Cs=class extends Xf{atrule(e){let s=e[1],r=e;for(;!this.tokenizer.endOfFile();){let n=this.tokenizer.nextToken();if(n[0]==="word"&&n[2]===r[3]+1)s+=n[1],r=n;else{this.tokenizer.back(n);break}}super.atrule(["at-word",s,e[2],r[3]])}comment(e){if(e[4]==="inline"){let s=new Jf;this.init(s,e[2]),s.raws.inline=!0;let r=this.input.fromOffset(e[3]);s.source.end={column:r.col,line:r.line,offset:e[3]+1};let n=e[1].slice(2);if(/^\s*$/.test(n))s.text="",s.raws.left=n,s.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/),o=i[2].replace(/(\*\/|\/\*)/g,"*//*");s.text=o,s.raws.left=i[1],s.raws.right=i[3],s.raws.text=i[2]}}else super.comment(e)}createTokenizer(){this.tokenizer=ep(this.input)}raw(e,s,r,n){if(super.raw(e,s,r,n),e.raws[s]){let i=e.raws[s].raw;e.raws[s].raw=r.reduce((o,u)=>{if(u[0]==="comment"&&u[4]==="inline"){let a=u[1].slice(2).replace(/(\*\/|\/\*)/g,"*//*");return o+"/*"+a+"*/"}else return o+u[1]},""),i!==e.raws[s].raw&&(e.raws[s].scss=i)}}rule(e){let s=!1,r=0,n="";for(let i of e)if(s)i[0]!=="comment"&&i[0]!=="{"&&(n+=i[1]);else{if(i[0]==="space"&&i[1].includes(` +`))break;i[0]==="("?r+=1:i[0]===")"?r-=1:r===0&&i[0]===":"&&(s=!0)}if(!s||n.trim()===""||/^[#:A-Za-z-]/.test(n))super.rule(e);else{e.pop();let i=new Zf;this.init(i,e[0][2]);let o;for(let a=e.length-1;a>=0;a--)if(e[a][0]!=="space"){o=e[a];break}if(o[3]){let a=this.input.fromOffset(o[3]);i.source.end={column:a.col,line:a.line,offset:o[3]+1}}else{let a=this.input.fromOffset(o[2]);i.source.end={column:a.col,line:a.line,offset:o[2]+1}}for(;e[0][0]!=="word";)i.raws.before+=e.shift()[1];if(e[0][2]){let a=this.input.fromOffset(e[0][2]);i.source.start={column:a.col,line:a.line,offset:e[0][2]}}for(i.prop="";e.length;){let a=e[0][0];if(a===":"||a==="space"||a==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let u;for(;e.length;)if(u=e.shift(),u[0]===":"){i.raws.between+=u[1];break}else i.raws.between+=u[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1)),i.raws.between+=this.spacesAndCommentsFromStart(e),this.precheckMissedSemicolon(e);for(let a=e.length-1;a>0;a--){if(u=e[a],u[1]==="!important"){i.important=!0;let c=this.stringFrom(e,a);c=this.spacesFromEnd(e)+c,c!==" !important"&&(i.raws.important=c);break}else if(u[1]==="important"){let c=e.slice(0),f="";for(let p=a;p>0;p--){let l=c[p][0];if(f.trim().indexOf("!")===0&&l!=="space")break;f=c.pop()[1]+f}f.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=f,e=c)}if(u[0]!=="space"&&u[0]!=="comment")break}this.raw(i,"value",e),i.value.includes(":")&&this.checkMissedSemicolon(e),this.current=i}}};sa.exports=Cs});var oa=g((yx,ia)=>{var{Input:tp}=tr(),rp=na();ia.exports=function(e,s){let r=new tp(e,s),n=new rp(r);return n.parse(),n.root}});var As=g(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});function np(t){this.after=t.after,this.before=t.before,this.type=t.type,this.value=t.value,this.sourceIndex=t.sourceIndex}Os.default=np});var Ps=g(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});var ip=As(),ua=op(ip);function op(t){return t&&t.__esModule?t:{default:t}}function Et(t){var e=this;this.constructor(t),this.nodes=t.nodes,this.after===void 0&&(this.after=this.nodes.length>0?this.nodes[this.nodes.length-1].after:""),this.before===void 0&&(this.before=this.nodes.length>0?this.nodes[0].before:""),this.sourceIndex===void 0&&(this.sourceIndex=this.before.length),this.nodes.forEach(function(s){s.parent=e})}Et.prototype=Object.create(ua.default.prototype);Et.constructor=ua.default;Et.prototype.walk=function(e,s){for(var r=typeof e=="string"||e instanceof RegExp,n=r?s:e,i=typeof e=="string"?new RegExp(e):e,o=0;o{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.parseMediaFeature=fa;kt.parseMediaQuery=Is;kt.parseMediaList=lp;var ap=As(),la=ca(ap),up=Ps(),Rs=ca(up);function ca(t){return t&&t.__esModule?t:{default:t}}function fa(t){var e=arguments.length<=1||arguments[1]===void 0?0:arguments[1],s=[{mode:"normal",character:null}],r=[],n=0,i="",o=null,u=null,a=e,c=t;t[0]==="("&&t[t.length-1]===")"&&(c=t.substring(1,t.length-1),a++);for(var f=0;f0&&(s[c-1].after=i.before),i.type===void 0){if(c>0){if(s[c-1].type==="media-feature-expression"){i.type="keyword";continue}if(s[c-1].value==="not"||s[c-1].value==="only"){i.type="media-type";continue}if(s[c-1].value==="and"){i.type="media-feature-expression";continue}s[c-1].type==="media-type"&&(s[c+1]?i.type=s[c+1].type==="media-feature-expression"?"keyword":"media-feature-expression":i.type="media-feature-expression")}if(c===0){if(!s[c+1]){i.type="media-type";continue}if(s[c+1]&&(s[c+1].type==="media-feature-expression"||s[c+1].type==="keyword")){i.type="media-type";continue}if(s[c+2]){if(s[c+2].type==="media-feature-expression"){i.type="media-type",s[c+1].type="keyword";continue}if(s[c+2].type==="keyword"){i.type="keyword",s[c+1].type="media-type";continue}}if(s[c+3]&&s[c+3].type==="media-feature-expression"){i.type="keyword",s[c+1].type="media-type",s[c+2].type="keyword";continue}}}return s}function lp(t){var e=[],s=0,r=0,n=/^(\s*)url\s*\(/.exec(t);if(n!==null){for(var i=n[0].length,o=1;o>0;){var u=t[i];u==="("&&o++,u===")"&&o--,i++}e.unshift(new la.default({type:"url",value:t.substring(0,i).trim(),sourceIndex:n[1].length,before:n[1],after:/^(\s*)/.exec(t.substring(i))[1]})),s=i}for(var a=s;a{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.default=dp;var cp=Ps(),fp=hp(cp),pp=pa();function hp(t){return t&&t.__esModule?t:{default:t}}function dp(t){return new fp.default({nodes:(0,pp.parseMediaList)(t),type:"media-query-list",value:t.trim()})}});var Ds=g((Sx,ya)=>{ya.exports=function(e,s){if(s=typeof s=="number"?s:1/0,!s)return Array.isArray(e)?e.map(function(n){return n}):e;return r(e,1);function r(n,i){return n.reduce(function(o,u){return Array.isArray(u)&&i{ga.exports=function(t,e){for(var s=-1,r=[];(s=t.indexOf(e,s+1))!==-1;)r.push(s);return r}});var Ms=g((Cx,wa)=>{"use strict";function gp(t,e){for(var s=1,r=t.length,n=t[0],i=t[0],o=1;o{"use strict";ir.__esModule=!0;var va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function xp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var bp=function t(e,s){if((typeof e>"u"?"undefined":va(e))!=="object")return e;var r=new e.constructor;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n],o=typeof i>"u"?"undefined":va(i);n==="parent"&&o==="object"?s&&(r[n]=s):i instanceof Array?r[n]=i.map(function(u){return t(u,r)}):r[n]=t(i,r)}return r},_p=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xp(this,t);for(var s in e)this[s]=e[s];var r=e.spaces;r=r===void 0?{}:r;var n=r.before,i=n===void 0?"":n,o=r.after,u=o===void 0?"":o;this.spaces={before:i,after:u}}return t.prototype.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.prototype.replaceWith=function(){if(this.parent){for(var s in arguments)this.parent.insertBefore(this,arguments[s]);this.remove()}return this},t.prototype.next=function(){return this.parent.at(this.parent.index(this)+1)},t.prototype.prev=function(){return this.parent.at(this.parent.index(this)-1)},t.prototype.clone=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=bp(this);for(var n in s)r[n]=s[n];return r},t.prototype.toString=function(){return[this.spaces.before,String(this.value),this.spaces.after].join("")},t}();ir.default=_p;xa.exports=ir.default});var B=g(M=>{"use strict";M.__esModule=!0;var Ox=M.TAG="tag",Ax=M.STRING="string",Nx=M.SELECTOR="selector",Px=M.ROOT="root",Rx=M.PSEUDO="pseudo",Ix=M.NESTING="nesting",qx=M.ID="id",Lx=M.COMMENT="comment",Dx=M.COMBINATOR="combinator",Bx=M.CLASS="class",Mx=M.ATTRIBUTE="attribute",Ux=M.UNIVERSAL="universal"});var ar=g((or,ba)=>{"use strict";or.__esModule=!0;var Ep=function(){function t(e,s){for(var r=0;r=r&&(this.indexes[i]=n-1);return this},e.prototype.removeAll=function(){for(var i=this.nodes,r=Array.isArray(i),n=0,i=r?i:i[Symbol.iterator]();;){var o;if(r){if(n>=i.length)break;o=i[n++]}else{if(n=i.next(),n.done)break;o=n.value}var u=o;u.parent=void 0}return this.nodes=[],this},e.prototype.empty=function(){return this.removeAll()},e.prototype.insertAfter=function(r,n){var i=this.index(r);this.nodes.splice(i+1,0,n);var o=void 0;for(var u in this.indexes)o=this.indexes[u],i<=o&&(this.indexes[u]=o+this.nodes.length);return this},e.prototype.insertBefore=function(r,n){var i=this.index(r);this.nodes.splice(i,0,n);var o=void 0;for(var u in this.indexes)o=this.indexes[u],i<=o&&(this.indexes[u]=o+this.nodes.length);return this},e.prototype.each=function(r){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var n=this.lastEach;if(this.indexes[n]=0,!!this.length){for(var i=void 0,o=void 0;this.indexes[n]{"use strict";ur.__esModule=!0;var Ip=ar(),qp=Dp(Ip),Lp=B();function Dp(t){return t&&t.__esModule?t:{default:t}}function Bp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mp(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Up(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Fp=function(t){Up(e,t);function e(s){Bp(this,e);var r=Mp(this,t.call(this,s));return r.type=Lp.ROOT,r}return e.prototype.toString=function(){var r=this.reduce(function(n,i){var o=String(i);return o?n+o+",":""},"").slice(0,-1);return this.trailingComma?r+",":r},e}(qp.default);ur.default=Fp;_a.exports=ur.default});var Sa=g((lr,ka)=>{"use strict";lr.__esModule=!0;var $p=ar(),Wp=Vp($p),Yp=B();function Vp(t){return t&&t.__esModule?t:{default:t}}function zp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gp(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function jp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Hp=function(t){jp(e,t);function e(s){zp(this,e);var r=Gp(this,t.call(this,s));return r.type=Yp.SELECTOR,r}return e}(Wp.default);lr.default=Hp;ka.exports=lr.default});var Ue=g((cr,Ta)=>{"use strict";cr.__esModule=!0;var Kp=function(){function t(e,s){for(var r=0;r{"use strict";fr.__esModule=!0;var sh=Ue(),nh=oh(sh),ih=B();function oh(t){return t&&t.__esModule?t:{default:t}}function ah(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function lh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ch=function(t){lh(e,t);function e(s){ah(this,e);var r=uh(this,t.call(this,s));return r.type=ih.CLASS,r}return e.prototype.toString=function(){return[this.spaces.before,this.ns,"."+this.value,this.spaces.after].join("")},e}(nh.default);fr.default=ch;Ca.exports=fr.default});var Na=g((pr,Aa)=>{"use strict";pr.__esModule=!0;var fh=we(),ph=dh(fh),hh=B();function dh(t){return t&&t.__esModule?t:{default:t}}function mh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function gh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var wh=function(t){gh(e,t);function e(s){mh(this,e);var r=yh(this,t.call(this,s));return r.type=hh.COMMENT,r}return e}(ph.default);pr.default=wh;Aa.exports=pr.default});var Ra=g((hr,Pa)=>{"use strict";hr.__esModule=!0;var vh=Ue(),xh=_h(vh),bh=B();function _h(t){return t&&t.__esModule?t:{default:t}}function Eh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Sh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Th=function(t){Sh(e,t);function e(s){Eh(this,e);var r=kh(this,t.call(this,s));return r.type=bh.ID,r}return e.prototype.toString=function(){return[this.spaces.before,this.ns,"#"+this.value,this.spaces.after].join("")},e}(xh.default);hr.default=Th;Pa.exports=hr.default});var qa=g((dr,Ia)=>{"use strict";dr.__esModule=!0;var Ch=Ue(),Oh=Nh(Ch),Ah=B();function Nh(t){return t&&t.__esModule?t:{default:t}}function Ph(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Ih(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var qh=function(t){Ih(e,t);function e(s){Ph(this,e);var r=Rh(this,t.call(this,s));return r.type=Ah.TAG,r}return e}(Oh.default);dr.default=qh;Ia.exports=dr.default});var Da=g((mr,La)=>{"use strict";mr.__esModule=!0;var Lh=we(),Dh=Mh(Lh),Bh=B();function Mh(t){return t&&t.__esModule?t:{default:t}}function Uh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function $h(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Wh=function(t){$h(e,t);function e(s){Uh(this,e);var r=Fh(this,t.call(this,s));return r.type=Bh.STRING,r}return e}(Dh.default);mr.default=Wh;La.exports=mr.default});var Ma=g((yr,Ba)=>{"use strict";yr.__esModule=!0;var Yh=ar(),Vh=Gh(Yh),zh=B();function Gh(t){return t&&t.__esModule?t:{default:t}}function jh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Kh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Qh=function(t){Kh(e,t);function e(s){jh(this,e);var r=Hh(this,t.call(this,s));return r.type=zh.PSEUDO,r}return e.prototype.toString=function(){var r=this.length?"("+this.map(String).join(",")+")":"";return[this.spaces.before,String(this.value),r,this.spaces.after].join("")},e}(Vh.default);yr.default=Qh;Ba.exports=yr.default});var Fa=g((gr,Ua)=>{"use strict";gr.__esModule=!0;var Jh=Ue(),Xh=ed(Jh),Zh=B();function ed(t){return t&&t.__esModule?t:{default:t}}function td(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rd(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function sd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var nd=function(t){sd(e,t);function e(s){td(this,e);var r=rd(this,t.call(this,s));return r.type=Zh.ATTRIBUTE,r.raws={},r}return e.prototype.toString=function(){var r=[this.spaces.before,"[",this.ns,this.attribute];return this.operator&&r.push(this.operator),this.value&&r.push(this.value),this.raws.insensitive?r.push(this.raws.insensitive):this.insensitive&&r.push(" i"),r.push("]"),r.concat(this.spaces.after).join("")},e}(Xh.default);gr.default=nd;Ua.exports=gr.default});var Wa=g((wr,$a)=>{"use strict";wr.__esModule=!0;var id=Ue(),od=ud(id),ad=B();function ud(t){return t&&t.__esModule?t:{default:t}}function ld(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cd(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function fd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var pd=function(t){fd(e,t);function e(s){ld(this,e);var r=cd(this,t.call(this,s));return r.type=ad.UNIVERSAL,r.value="*",r}return e}(od.default);wr.default=pd;$a.exports=wr.default});var Va=g((vr,Ya)=>{"use strict";vr.__esModule=!0;var hd=we(),dd=yd(hd),md=B();function yd(t){return t&&t.__esModule?t:{default:t}}function gd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wd(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function vd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var xd=function(t){vd(e,t);function e(s){gd(this,e);var r=wd(this,t.call(this,s));return r.type=md.COMBINATOR,r}return e}(dd.default);vr.default=xd;Ya.exports=vr.default});var Ga=g((xr,za)=>{"use strict";xr.__esModule=!0;var bd=we(),_d=kd(bd),Ed=B();function kd(t){return t&&t.__esModule?t:{default:t}}function Sd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Td(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Cd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Od=function(t){Cd(e,t);function e(s){Sd(this,e);var r=Td(this,t.call(this,s));return r.type=Ed.NESTING,r.value="&",r}return e}(_d.default);xr.default=Od;za.exports=xr.default});var Ha=g((br,ja)=>{"use strict";br.__esModule=!0;br.default=Ad;function Ad(t){return t.sort(function(e,s){return e-s})}ja.exports=br.default});var su=g((kr,ru)=>{"use strict";kr.__esModule=!0;kr.default=Fd;var Ka=39,Nd=34,Us=92,Qa=47,St=10,Fs=32,$s=12,Ws=9,Ys=13,Ja=43,Xa=62,Za=126,eu=124,Pd=44,Rd=40,Id=41,qd=91,Ld=93,Dd=59,tu=42,Bd=58,Md=38,Ud=64,_r=/[ \n\t\r\{\(\)'"\\;/]/g,Er=/[ \n\t\r\(\)\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;function Fd(t){for(var e=[],s=t.css.valueOf(),r=void 0,n=void 0,i=void 0,o=void 0,u=void 0,a=void 0,c=void 0,f=void 0,p=void 0,l=void 0,y=void 0,x=s.length,h=-1,d=1,m=0,b=function(v,N){if(t.safe)s+=N,n=s.length-1;else throw t.error("Unclosed "+v,d,m-h,m)};m0?(f=d+u,p=n-o[u].length):(f=d,p=h),e.push(["comment",a,d,m-h,f,n-p,m]),h=p,d=f,m=n):(Er.lastIndex=m+1,Er.test(s),Er.lastIndex===0?n=s.length-1:n=Er.lastIndex-2,e.push(["word",s.slice(m,n+1),d,m-h,d,n-h,m]),m=n);break}m++}return e}ru.exports=kr.default});var ou=g((Sr,iu)=>{"use strict";Sr.__esModule=!0;var $d=function(){function t(e,s){for(var r=0;r1?(o[0]===""&&(o[0]=!0),u.attribute=this.parseValue(o[2]),u.namespace=this.parseNamespace(o[0])):u.attribute=this.parseValue(i[0]),r=new lm.default(u),i[2]){var a=i[2].split(/(\s+i\s*?)$/),c=a[0].trim();r.value=this.lossy?c:a[0],a[1]&&(r.insensitive=!0,this.lossy||(r.raws.insensitive=a[1])),r.quoted=c[0]==="'"||c[0]==='"',r.raws.unquoted=r.quoted?c.slice(1,-1):c}this.newNode(r),this.position++},t.prototype.combinator=function(){if(this.currToken[1]==="|")return this.namespace();for(var s=new hm.default({value:"",source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]});this.position1&&s.nextToken&&s.nextToken[0]==="("&&s.error("Misplaced parenthesis.")})}else this.error('Unexpected "'+this.currToken[0]+'" found.')},t.prototype.space=function(){var s=this.currToken;this.position===0||this.prevToken[0]===","||this.prevToken[0]==="("?(this.spaces=this.parseSpace(s[1]),this.position++):this.position===this.tokens.length-1||this.nextToken[0]===","||this.nextToken[0]===")"?(this.current.last.spaces.after=this.parseSpace(s[1]),this.position++):this.combinator()},t.prototype.string=function(){var s=this.currToken;this.newNode(new im.default({value:this.currToken[1],source:{start:{line:s[2],column:s[3]},end:{line:s[4],column:s[5]}},sourceIndex:s[6]})),this.position++},t.prototype.universal=function(s){var r=this.nextToken;if(r&&r[1]==="|")return this.position++,this.namespace();this.newNode(new fm.default({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]}),s),this.position++},t.prototype.splitWord=function(s,r){for(var n=this,i=this.nextToken,o=this.currToken[1];i&&i[0]==="word";){this.position++;var u=this.currToken[1];if(o+=u,u.lastIndexOf("\\")===u.length-1){var a=this.nextToken;a&&a[0]==="space"&&(o+=this.parseSpace(a[1]," "),this.position++)}i=this.nextToken}var c=(0,Vs.default)(o,"."),f=(0,Vs.default)(o,"#"),p=(0,Vs.default)(o,"#{");p.length&&(f=f.filter(function(y){return!~p.indexOf(y)}));var l=(0,gm.default)((0,Gd.default)((0,Yd.default)([[0],c,f])));l.forEach(function(y,x){var h=l[x+1]||o.length,d=o.slice(y,h);if(x===0&&r)return r.call(n,d,l.length);var m=void 0;~c.indexOf(y)?m=new Jd.default({value:d.slice(1),source:{start:{line:n.currToken[2],column:n.currToken[3]+y},end:{line:n.currToken[4],column:n.currToken[3]+(h-1)}},sourceIndex:n.currToken[6]+l[x]}):~f.indexOf(y)?m=new tm.default({value:d.slice(1),source:{start:{line:n.currToken[2],column:n.currToken[3]+y},end:{line:n.currToken[4],column:n.currToken[3]+(h-1)}},sourceIndex:n.currToken[6]+l[x]}):m=new sm.default({value:d,source:{start:{line:n.currToken[2],column:n.currToken[3]+y},end:{line:n.currToken[4],column:n.currToken[3]+(h-1)}},sourceIndex:n.currToken[6]+l[x]}),n.newNode(m,s)}),this.position++},t.prototype.word=function(s){var r=this.nextToken;return r&&r[1]==="|"?(this.position++,this.namespace()):this.splitWord(s)},t.prototype.loop=function(){for(;this.position{"use strict";Tr.__esModule=!0;var km=function(){function t(e,s){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=new Tm.default({css:s,error:function(o){throw new Error(o)},options:r});return this.res=n,this.func(n),this},km(t,[{key:"result",get:function(){return String(this.res)}}]),t}();Tr.default=Am;au.exports=Tr.default});var G=g((Vx,cu)=>{"use strict";var Gs=function(t,e){let s=new t.constructor;for(let r in t){if(!t.hasOwnProperty(r))continue;let n=t[r],i=typeof n;r==="parent"&&i==="object"?e&&(s[r]=e):r==="source"?s[r]=n:n instanceof Array?s[r]=n.map(o=>Gs(o,s)):r!=="before"&&r!=="after"&&r!=="between"&&r!=="semicolon"&&(i==="object"&&n!==null&&(n=Gs(n)),s[r]=n)}return s};cu.exports=class{constructor(e){e=e||{},this.raws={before:"",after:""};for(let s in e)this[s]=e[s]}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(){return[this.raws.before,String(this.value),this.raws.after].join("")}clone(e){e=e||{};let s=Gs(this);for(let r in e)s[r]=e[r];return s}cloneBefore(e){e=e||{};let s=this.clone(e);return this.parent.insertBefore(this,s),s}cloneAfter(e){e=e||{};let s=this.clone(e);return this.parent.insertAfter(this,s),s}replaceWith(){let e=Array.prototype.slice.call(arguments);if(this.parent){for(let s of e)this.parent.insertBefore(this,s);this.remove()}return this}moveTo(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.append(this),this}moveBefore(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertBefore(e,this),this}moveAfter(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertAfter(e,this),this}next(){let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){let e=this.parent.index(this);return this.parent.nodes[e-1]}toJSON(){let e={};for(let s in this){if(!this.hasOwnProperty(s)||s==="parent")continue;let r=this[s];r instanceof Array?e[s]=r.map(n=>typeof n=="object"&&n.toJSON?n.toJSON():n):typeof r=="object"&&r.toJSON?e[s]=r.toJSON():e[s]=r}return e}root(){let e=this;for(;e.parent;)e=e.parent;return e}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}positionInside(e){let s=this.toString(),r=this.source.start.column,n=this.source.start.line;for(let i=0;i{"use strict";var Pm=G(),Fe=class extends Pm{constructor(e){super(e),this.nodes||(this.nodes=[])}push(e){return e.parent=this,this.nodes.push(e),this}each(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let s=this.lastEach,r,n;if(this.indexes[s]=0,!!this.nodes){for(;this.indexes[s]{let n=e(s,r);return n!==!1&&s.walk&&(n=s.walk(e)),n})}walkType(e,s){if(!e||!s)throw new Error("Parameters {type} and {callback} are required.");let r=typeof e=="function";return this.walk((n,i)=>{if(r&&n instanceof e||!r&&n.type===e)return s.call(this,n,i)})}append(e){return e.parent=this,this.nodes.push(e),this}prepend(e){return e.parent=this,this.nodes.unshift(e),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}insertAfter(e,s){let r=this.index(e),n;this.nodes.splice(r+1,0,s);for(let i in this.indexes)n=this.indexes[i],r<=n&&(this.indexes[i]=n+this.nodes.length);return this}insertBefore(e,s){let r=this.index(e),n;this.nodes.splice(r,0,s);for(let i in this.indexes)n=this.indexes[i],r<=n&&(this.indexes[i]=n+this.nodes.length);return this}removeChild(e){e=this.index(e),this.nodes[e].parent=void 0,this.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this}removeAll(){for(let e of this.nodes)e.parent=void 0;return this.nodes=[],this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return typeof e=="number"?e:this.nodes.indexOf(e)}get first(){if(this.nodes)return this.nodes[0]}get last(){if(this.nodes)return this.nodes[this.nodes.length-1]}toString(){let e=this.nodes.map(String).join("");return this.value&&(e=this.value+e),this.raws.before&&(e=this.raws.before+e),this.raws.after&&(e+=this.raws.after),e}};Fe.registerWalker=t=>{let e="walk"+t.name;e.lastIndexOf("s")!==e.length-1&&(e+="s"),!Fe.prototype[e]&&(Fe.prototype[e]=function(s){return this.walkType(t,s)})};fu.exports=Fe});var hu=g((jx,pu)=>{"use strict";var Rm=U();pu.exports=class extends Rm{constructor(e){super(e),this.type="root"}}});var mu=g((Kx,du)=>{"use strict";var Im=U();du.exports=class extends Im{constructor(e){super(e),this.type="value",this.unbalanced=0}}});var wu=g((Qx,gu)=>{"use strict";var yu=U(),Cr=class extends yu{constructor(e){super(e),this.type="atword"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,"@",String.prototype.toString.call(this.value),this.raws.after].join("")}};yu.registerWalker(Cr);gu.exports=Cr});var xu=g((Jx,vu)=>{"use strict";var qm=U(),Lm=G(),Or=class extends Lm{constructor(e){super(e),this.type="colon"}};qm.registerWalker(Or);vu.exports=Or});var _u=g((Xx,bu)=>{"use strict";var Dm=U(),Bm=G(),Ar=class extends Bm{constructor(e){super(e),this.type="comma"}};Dm.registerWalker(Ar);bu.exports=Ar});var ku=g((Zx,Eu)=>{"use strict";var Mm=U(),Um=G(),Nr=class extends Um{constructor(e){super(e),this.type="comment",this.inline=Object(e).inline||!1}toString(){return[this.raws.before,this.inline?"//":"/*",String(this.value),this.inline?"":"*/",this.raws.after].join("")}};Mm.registerWalker(Nr);Eu.exports=Nr});var Cu=g((eb,Tu)=>{"use strict";var Su=U(),Pr=class extends Su{constructor(e){super(e),this.type="func",this.unbalanced=-1}};Su.registerWalker(Pr);Tu.exports=Pr});var Au=g((tb,Ou)=>{"use strict";var Fm=U(),$m=G(),Rr=class extends $m{constructor(e){super(e),this.type="number",this.unit=Object(e).unit||""}toString(){return[this.raws.before,String(this.value),this.unit,this.raws.after].join("")}};Fm.registerWalker(Rr);Ou.exports=Rr});var Pu=g((rb,Nu)=>{"use strict";var Wm=U(),Ym=G(),Ir=class extends Ym{constructor(e){super(e),this.type="operator"}};Wm.registerWalker(Ir);Nu.exports=Ir});var Iu=g((sb,Ru)=>{"use strict";var Vm=U(),zm=G(),qr=class extends zm{constructor(e){super(e),this.type="paren",this.parenType=""}};Vm.registerWalker(qr);Ru.exports=qr});var Lu=g((nb,qu)=>{"use strict";var Gm=U(),jm=G(),Lr=class extends jm{constructor(e){super(e),this.type="string"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,e,this.value+"",e,this.raws.after].join("")}};Gm.registerWalker(Lr);qu.exports=Lr});var Bu=g((ib,Du)=>{"use strict";var Hm=U(),Km=G(),Dr=class extends Km{constructor(e){super(e),this.type="word"}};Hm.registerWalker(Dr);Du.exports=Dr});var Uu=g((ob,Mu)=>{"use strict";var Qm=U(),Jm=G(),Br=class extends Jm{constructor(e){super(e),this.type="unicode-range"}};Qm.registerWalker(Br);Mu.exports=Br});var $u=g((ab,Fu)=>{"use strict";var js=class extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e||"An error ocurred while tokzenizing.",typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}};Fu.exports=js});var Vu=g((ub,Yu)=>{"use strict";var Mr=/[ \n\t\r\{\(\)'"\\;,/]/g,Xm=/[ \n\t\r\(\)\{\}\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g,$e=/[ \n\t\r\(\)\{\}\*:;@!&'"\-\+\|~>,\[\]\\]|\//g,Zm=/^[a-z0-9]/i,ey=/^[a-f0-9?\-]/i,Wu=$u();Yu.exports=function(e,s){s=s||{};let r=[],n=e.valueOf(),i=n.length,o=-1,u=1,a=0,c=0,f=null,p,l,y,x,h,d,m,b,w,v,N,F;function Q(T){let C=`Unclosed ${T} at line: ${u}, column: ${a-o}, token: ${a}`;throw new Wu(C)}function W(){let T=`Syntax error at line: ${u}, column: ${a-o}, token: ${a}`;throw new Wu(T)}for(;a0&&r[r.length-1][0]==="word"&&r[r.length-1][1]==="url",r.push(["(","(",u,a-o,u,l-o,a]);break;case 41:c--,f=f&&c>0,r.push([")",")",u,a-o,u,l-o,a]);break;case 39:case 34:y=p===39?"'":'"',l=a;do for(v=!1,l=n.indexOf(y,l+1),l===-1&&Q("quote",y),N=l;n.charCodeAt(N-1)===92;)N-=1,v=!v;while(v);r.push(["string",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l;break;case 64:Mr.lastIndex=a+1,Mr.test(n),Mr.lastIndex===0?l=n.length-1:l=Mr.lastIndex-2,r.push(["atword",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l;break;case 92:l=a,p=n.charCodeAt(l+1),m&&p!==47&&p!==32&&p!==10&&p!==9&&p!==13&&p!==12&&(l+=1),r.push(["word",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l;break;case 43:case 45:case 42:l=a+1,F=n.slice(a+1,l+1);let T=n.slice(a-1,a);if(p===45&&F.charCodeAt(0)===45){l++,r.push(["word",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1;break}r.push(["operator",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1;break;default:if(p===47&&(n.charCodeAt(a+1)===42||s.loose&&!f&&n.charCodeAt(a+1)===47)){if(n.charCodeAt(a+1)===42)l=n.indexOf("*/",a+2)+1,l===0&&Q("comment","*/");else{let O=n.indexOf(` +`,a+2);l=O!==-1?O-1:i}d=n.slice(a,l+1),x=d.split(` +`),h=x.length-1,h>0?(b=u+h,w=l-x[h].length):(b=u,w=o),r.push(["comment",d,u,a-o,b,l-w,a]),o=w,u=b,a=l}else if(p===35&&!Zm.test(n.slice(a+1,a+2)))l=a+1,r.push(["#",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1;else if((p===117||p===85)&&n.charCodeAt(a+1)===43){l=a+2;do l+=1,p=n.charCodeAt(l);while(l=48&&p<=57&&(C=$e),C.lastIndex=a+1,C.test(n),C.lastIndex===0?l=n.length-1:l=C.lastIndex-2,C===$e||p===46){let O=n.charCodeAt(l),ve=n.charCodeAt(l+1),Zs=n.charCodeAt(l+2);(O===101||O===69)&&(ve===45||ve===43)&&Zs>=48&&Zs<=57&&($e.lastIndex=l+2,$e.test(n),$e.lastIndex===0?l=n.length-1:l=$e.lastIndex-2)}r.push(["word",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l}break}a++}return r}});var Gu=g((lb,zu)=>{"use strict";var Hs=class extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e||"An error ocurred while parsing.",typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}};zu.exports=Hs});var Qu=g((fb,Ku)=>{"use strict";var ty=hu(),ry=mu(),sy=wu(),ny=xu(),iy=_u(),oy=ku(),ay=Cu(),uy=Au(),ly=Pu(),ju=Iu(),cy=Lu(),Hu=Bu(),fy=Uu(),py=Vu(),hy=Ds(),dy=Bs(),my=Ms(),yy=Gu();function gy(t){return t.sort((e,s)=>e-s)}Ku.exports=class{constructor(e,s){let r={loose:!1};this.cache=[],this.input=e,this.options=Object.assign({},r,s),this.position=0,this.unbalanced=0,this.root=new ty;let n=new ry;this.root.append(n),this.current=n,this.tokens=py(e,this.options)}parse(){return this.loop()}colon(){let e=this.currToken;this.newNode(new ny({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comma(){let e=this.currToken;this.newNode(new iy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comment(){let e=!1,s=this.currToken[1].replace(/\/\*|\*\//g,""),r;this.options.loose&&s.startsWith("//")&&(s=s.substring(2),e=!0),r=new oy({value:s,inline:e,source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]}),this.newNode(r),this.position++}error(e,s){throw new yy(e+` at line: ${s[2]}, column ${s[3]}`)}loop(){for(;this.position0&&(this.current.type==="func"&&this.current.value==="calc"?this.prevToken[0]!=="space"&&this.prevToken[0]!=="("?this.error("Syntax Error",this.currToken):this.nextToken[0]!=="space"&&this.nextToken[0]!=="word"?this.error("Syntax Error",this.currToken):this.nextToken[0]==="word"&&this.current.last.type!=="operator"&&this.current.last.value!=="("&&this.error("Syntax Error",this.currToken):(this.nextToken[0]==="space"||this.nextToken[0]==="operator"||this.prevToken[0]==="operator")&&this.error("Syntax Error",this.currToken)),this.options.loose){if((!this.current.nodes.length||this.current.last&&this.current.last.type==="operator")&&this.nextToken[0]==="word")return this.word()}else if(this.nextToken[0]==="word")return this.word()}return s=new ly({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]}),this.position++,this.newNode(s)}parseTokens(){switch(this.currToken[0]){case"space":this.space();break;case"colon":this.colon();break;case"comma":this.comma();break;case"comment":this.comment();break;case"(":this.parenOpen();break;case")":this.parenClose();break;case"atword":case"word":this.word();break;case"operator":this.operator();break;case"string":this.string();break;case"unicoderange":this.unicodeRange();break;default:this.word();break}}parenOpen(){let e=1,s=this.position+1,r=this.currToken,n;for(;s=this.tokens.length-1&&!this.current.unbalanced)&&(this.current.unbalanced--,this.current.unbalanced<0&&this.error("Expected opening parenthesis",e),!this.current.unbalanced&&this.cache.length&&(this.current=this.cache.pop()))}space(){let e=this.currToken;this.position===this.tokens.length-1||this.nextToken[0]===","||this.nextToken[0]===")"?(this.current.last.raws.after+=e[1],this.position++):(this.spaces=e[1],this.position++)}unicodeRange(){let e=this.currToken;this.newNode(new fy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}splitWord(){let e=this.nextToken,s=this.currToken[1],r=/^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/,n=/^(?!\#([a-z0-9]+))[\#\{\}]/gi,i,o;if(!n.test(s))for(;e&&e[0]==="word";){this.position++;let u=this.currToken[1];s+=u,e=this.nextToken}i=dy(s,"@"),o=gy(my(hy([[0],i]))),o.forEach((u,a)=>{let c=o[a+1]||s.length,f=s.slice(u,c),p;if(~i.indexOf(u))p=new sy({value:f.slice(1),source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(c-1)}},sourceIndex:this.currToken[6]+o[a]});else if(r.test(this.currToken[1])){let l=f.replace(r,"");p=new uy({value:f.replace(l,""),source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(c-1)}},sourceIndex:this.currToken[6]+o[a],unit:l})}else p=new(e&&e[0]==="("?ay:Hu)({value:f,source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(c-1)}},sourceIndex:this.currToken[6]+o[a]}),p.type==="word"?(p.isHex=/^#(.+)/.test(f),p.isColor=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(f)):this.cache.push(this.current);this.newNode(p)}),this.position++}string(){let e=this.currToken,s=this.currToken[1],r=/^(\"|\')/,n=r.test(s),i="",o;n&&(i=s.match(r)[0],s=s.slice(1,s.length-1)),o=new cy({value:s,source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6],quoted:n}),o.raws.quote=i,this.newNode(o),this.position++}word(){return this.splitWord()}newNode(e){return this.spaces&&(e.raws.before+=this.spaces,this.spaces=""),this.current.append(e)}get currToken(){return this.tokens[this.position]}get nextToken(){return this.tokens[this.position+1]}get prevToken(){return this.tokens[this.position-1]}}});var Xs={};en(Xs,{languages:()=>gi,options:()=>vi,parsers:()=>Js,printers:()=>Iy});var vl=(t,e,s,r)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(s,r):s.global?e.replace(s,r):e.split(s).join(r)},E=vl;var be="string",We="array",Ye="cursor",te="indent",_e="align",Ve="trim",re="group",se="fill",ne="if-break",ze="indent-if-break",Ee="line-suffix",Ge="line-suffix-boundary",j="line",je="label",ke="break-parent",Tt=new Set([Ye,te,_e,Ve,re,se,ne,ze,Ee,Ge,j,je,ke]);var xl=(t,e,s)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[s<0?e.length+s:s]:e.at(s)},$=xl;function bl(t){if(typeof t=="string")return be;if(Array.isArray(t))return We;if(!t)return;let{type:e}=t;if(Tt.has(e))return e}var H=bl;var _l=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function El(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', +Expected it to be 'string' or 'object'.`;if(H(t))throw new Error("doc is valid.");let s=Object.prototype.toString.call(t);if(s!=="[object Object]")return`Unexpected doc '${s}'.`;let r=_l([...Tt].map(n=>`'${n}'`));return`Unexpected doc.type '${t.type}'. +Expected it to be ${r}.`}var Wr=class extends Error{name="InvalidDocError";constructor(e){super(El(e)),this.doc=e}},Yr=Wr;function Sl(t,e){if(typeof t=="string")return e(t);let s=new Map;return r(t);function r(i){if(s.has(i))return s.get(i);let o=n(i);return s.set(i,o),o}function n(i){switch(H(i)){case We:return e(i.map(r));case se:return e({...i,parts:i.parts.map(r)});case ne:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case re:{let{expandedStates:o,contents:u}=i;return o?(o=o.map(r),u=o[0]):u=r(u),e({...i,contents:u,expandedStates:o})}case _e:case te:case ze:case je:case Ee:return e({...i,contents:r(i.contents)});case be:case Ye:case Ve:case Ge:case j:case ke:return e(i);default:throw new Yr(i)}}}function Tl(t){return t.type===j&&!t.hard?t.soft?"":" ":t.type===ne?t.flatContents:t}function tn(t){return Sl(t,Tl)}var Vr=()=>{},ie=Vr,He=Vr,rn=Vr;function q(t){return ie(t),{type:te,contents:t}}function sn(t,e){return ie(e),{type:_e,contents:e,n:t}}function L(t,e={}){return ie(t),He(e.expandedStates,!0),{type:re,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function nn(t){return sn({type:"root"},t)}function oe(t){return sn(-1,t)}function Se(t){return rn(t),{type:se,parts:t}}function Ct(t,e="",s={}){return ie(t),e!==""&&ie(e),{type:ne,breakContents:t,flatContents:e,groupId:s.groupId}}function on(t){return ie(t),{type:Ee,contents:t}}var Ke={type:ke};var Cl={type:j,hard:!0};var A={type:j},D={type:j,soft:!0},S=[Cl,Ke];function Y(t,e){ie(t),He(e);let s=[];for(let r=0;r0}var ae=Ol;var an=new Proxy(()=>{},{get:()=>an}),un=an;var Ot="'",ln='"';function Al(t,e){let s=e===!0||e===Ot?Ot:ln,r=s===Ot?ln:Ot,n=0,i=0;for(let o of t)o===s?n++:o===r&&i++;return n>i?r:s}var cn=Al;function Nl(t,e,s){let r=e==='"'?"'":'"',i=E(!1,t,/\\(.)|(["'])/gsu,(o,u,a)=>u===r?u:a===e?"\\"+a:a||(s&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(u)?u:"\\"+u));return e+i+e}var fn=Nl;function Pl(t,e){un.ok(/^(?["']).*\k$/su.test(t));let s=t.slice(1,-1),r=e.parser==="json"||e.parser==="jsonc"||e.parser==="json5"&&e.quoteProps==="preserve"&&!e.singleQuote?'"':e.__isInHtmlAttribute?"'":cn(s,e.singleQuote);return t.charAt(0)===r?t:fn(s,r,!1)}var At=Pl;var zr=class extends Error{name="UnexpectedNodeError";constructor(e,s,r="type"){super(`Unexpected ${s} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}},pn=zr;function Rl(t){return(t==null?void 0:t.type)==="front-matter"}var Te=Rl;var Il=new Set(["raw","raws","sourceIndex","source","before","after","trailingComma","spaces"]);function hn(t,e,s){if(Te(t)&&t.language==="yaml"&&delete e.value,t.type==="css-comment"&&s.type==="css-root"&&s.nodes.length>0&&((s.nodes[0]===t||Te(s.nodes[0])&&s.nodes[1]===t)&&(delete e.text,/^\*\s*@(?:format|prettier)\s*$/u.test(t.text))||s.type==="css-root"&&$(!1,s.nodes,-1)===t))return null;if(t.type==="value-root"&&delete e.text,(t.type==="media-query"||t.type==="media-query-list"||t.type==="media-feature-expression")&&delete e.value,t.type==="css-rule"&&delete e.params,(t.type==="media-feature"||t.type==="media-keyword"||t.type==="media-type"||t.type==="media-unknown"||t.type==="media-url"||t.type==="media-value"||t.type==="selector-attribute"||t.type==="selector-string"||t.type==="selector-class"||t.type==="selector-combinator"||t.type==="value-string")&&t.value&&(e.value=ql(t.value)),t.type==="selector-combinator"&&(e.value=E(!1,e.value,/\s+/gu," ")),t.type==="media-feature"&&(e.value=E(!1,e.value," ","")),(t.type==="value-word"&&(t.isColor&&t.isHex||["initial","inherit","unset","revert"].includes(t.value.toLowerCase()))||t.type==="media-feature"||t.type==="selector-root-invalid"||t.type==="selector-pseudo")&&(e.value=e.value.toLowerCase()),t.type==="css-decl"&&(e.prop=t.prop.toLowerCase()),(t.type==="css-atrule"||t.type==="css-import")&&(e.name=t.name.toLowerCase()),t.type==="value-number"&&(e.unit=t.unit.toLowerCase()),t.type==="value-unknown"&&(e.value=E(!1,e.value,/;$/gu,"")),t.type==="selector-attribute"&&(e.attribute=t.attribute.trim(),t.namespace&&typeof t.namespace=="string"&&(e.namespace=t.namespace.trim()||!0),t.value&&(e.value=E(!1,e.value.trim(),/^["']|["']$/gu,""),delete e.quoted)),(t.type==="media-value"||t.type==="media-type"||t.type==="value-number"||t.type==="selector-root-invalid"||t.type==="selector-class"||t.type==="selector-combinator"||t.type==="selector-tag")&&t.value&&(e.value=E(!1,e.value,/([\d+.e-]+)([a-z]*)/giu,(r,n,i)=>{let o=Number(n);return Number.isNaN(o)?r:o+i.toLowerCase()})),t.type==="selector-tag"){let r=e.value.toLowerCase();["from","to"].includes(r)&&(e.value=r)}if(t.type==="css-atrule"&&t.name.toLowerCase()==="supports"&&delete e.value,t.type==="selector-unknown"&&delete e.value,t.type==="value-comma_group"){let r=t.groups.findIndex(n=>n.type==="value-number"&&n.unit==="...");r!==-1&&(e.groups[r].unit="",e.groups.splice(r+1,0,{type:"value-word",value:"...",isColor:!1,isHex:!1}))}if(t.type==="value-comma_group"&&t.groups.some(r=>r.type==="value-atword"&&r.value.endsWith("[")||r.type==="value-word"&&r.value.startsWith("]")))return{type:"value-atword",value:t.groups.map(r=>r.value).join(""),group:{open:null,close:null,groups:[],type:"value-paren_group"}}}hn.ignoredProperties=Il;function ql(t){return E(!1,E(!1,t,"'",'"'),/\\([^\da-f])/giu,"$1")}var dn=hn;async function Ll(t,e){if(t.language==="yaml"){let s=t.value.trim(),r=s?await e(s,{parser:"yaml"}):"";return nn([t.startDelimiter,t.explicitLanguage,S,r,r?S:"",t.endDelimiter])}}var mn=Ll;function yn(t){let{node:e}=t;if(e.type==="front-matter")return async s=>{let r=await mn(e,s);return r?[r,S]:void 0}}yn.getVisitorKeys=t=>t.type==="css-root"?["frontMatter"]:[];var gn=yn;var Qe=null;function Je(t){if(Qe!==null&&typeof Qe.property){let e=Qe;return Qe=Je.prototype=null,e}return Qe=Je.prototype=t??Object.create(null),new Je}var Dl=10;for(let t=0;t<=Dl;t++)Je();function Gr(t){return Je(t)}function Bl(t,e="type"){Gr(t);function s(r){let n=r[e],i=t[n];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:r});return i}return s}var wn=Bl;var Ml={"front-matter":[],"css-root":["frontMatter","nodes"],"css-comment":[],"css-rule":["selector","nodes"],"css-decl":["value","selector","nodes"],"css-atrule":["selector","params","value","nodes"],"media-query-list":["nodes"],"media-query":["nodes"],"media-type":[],"media-feature-expression":["nodes"],"media-feature":[],"media-colon":[],"media-value":[],"media-keyword":[],"media-url":[],"media-unknown":[],"selector-root":["nodes"],"selector-selector":["nodes"],"selector-comment":[],"selector-string":[],"selector-tag":[],"selector-id":[],"selector-class":[],"selector-attribute":[],"selector-combinator":["nodes"],"selector-universal":[],"selector-pseudo":["nodes"],"selector-nesting":[],"selector-unknown":[],"value-value":["group"],"value-root":["group"],"value-comment":[],"value-comma_group":["groups"],"value-paren_group":["open","groups","close"],"value-func":["group"],"value-paren":[],"value-number":[],"value-operator":[],"value-word":[],"value-colon":[],"value-comma":[],"value-string":[],"value-atword":[],"value-unicode-range":[],"value-unknown":[]},vn=Ml;var Ul=wn(vn),xn=Ul;function Fl(t,e){let s=0;for(let r=0;r{let n=!!(r!=null&&r.backwards);if(s===!1)return!1;let{length:i}=e,o=s;for(;o>=0&&oCn(c,e[c])).map(c=>`${n} ${c}${s}`).join("");if(!t){if(o.length===0)return"";if(o.length===1&&!Array.isArray(e[o[0]])){let c=e[o[0]];return`${r} ${Cn(o[0],c)[0]}${i}`}}let a=t.split(s).map(c=>`${n} ${c}`).join(s)+s;return r+s+(t?a:"")+(t&&o.length>0?n+s:"")+u+i}function Cn(t,e){return[...An,...Array.isArray(e)?e:[e]].map(s=>`@${t} ${s}`.trim())}function jl(t){if(!t.startsWith("#!"))return"";let e=t.indexOf(` +`);return e===-1?t:t.slice(0,e)}var qn=jl;function Ln(t){let e=qn(t);e&&(t=t.slice(e.length+1));let s=Nn(t),{pragmas:r,comments:n}=Rn(s);return{shebang:e,text:t,pragmas:r,comments:n}}function Dn(t){let{pragmas:e}=Ln(t);return Object.prototype.hasOwnProperty.call(e,"prettier")||Object.prototype.hasOwnProperty.call(e,"format")}function Bn(t){let{shebang:e,text:s,pragmas:r,comments:n}=Ln(t),i=Pn(s),o=In({pragmas:{format:"",...r},comments:n.trimStart()});return(e?`${e} +`:"")+o+(i.startsWith(` +`)?` +`:` + +`)+i}var Xe=3;function Hl(t){let e=t.slice(0,Xe);if(e!=="---"&&e!=="+++")return;let s=t.indexOf(` +`,Xe);if(s===-1)return;let r=t.slice(Xe,s).trim(),n=t.indexOf(` +${e}`,s),i=r;if(i||(i=e==="+++"?"toml":"yaml"),n===-1&&e==="---"&&i==="yaml"&&(n=t.indexOf(` +...`,s)),n===-1)return;let o=n+1+Xe,u=t.charAt(o+1);if(!/\s?/u.test(u))return;let a=t.slice(0,o);return{type:"front-matter",language:i,explicitLanguage:r,value:t.slice(s+1,n),startDelimiter:e,endDelimiter:a.slice(-Xe),raw:a}}function Kl(t){let e=Hl(t);if(!e)return{content:t};let{raw:s}=e;return{frontMatter:e,content:E(!1,s,/[^\n]/gu," ")+t.slice(s.length)}}var Ze=Kl;function Mn(t){return Dn(Ze(t).content)}function Un(t){let{frontMatter:e,content:s}=Ze(t);return(e?e.raw+` + +`:"")+Bn(s)}var Ql=new Set(["red","green","blue","alpha","a","rgb","hue","h","saturation","s","lightness","l","whiteness","w","blackness","b","tint","shade","blend","blenda","contrast","hsl","hsla","hwb","hwba"]);function Fn(t){var e,s;return(s=(e=t.findAncestor(r=>r.type==="css-decl"))==null?void 0:e.prop)==null?void 0:s.toLowerCase()}var Jl=new Set(["initial","inherit","unset","revert"]);function $n(t){return Jl.has(t.toLowerCase())}function Wn(t,e){var r;let s=t.findAncestor(n=>n.type==="css-atrule");return((r=s==null?void 0:s.name)==null?void 0:r.toLowerCase().endsWith("keyframes"))&&["from","to"].includes(e.toLowerCase())}function ue(t){return t.includes("$")||t.includes("@")||t.includes("#")||t.startsWith("%")||t.startsWith("--")||t.startsWith(":--")||t.includes("(")&&t.includes(")")?t:t.toLowerCase()}function Ce(t,e){var r;let s=t.findAncestor(n=>n.type==="value-func");return((r=s==null?void 0:s.value)==null?void 0:r.toLowerCase())===e}function Yn(t){var r;let e=t.findAncestor(n=>n.type==="css-rule"),s=(r=e==null?void 0:e.raws)==null?void 0:r.selector;return s&&(s.startsWith(":import")||s.startsWith(":export"))}function Oe(t,e){let s=Array.isArray(e)?e:[e],r=t.findAncestor(n=>n.type==="css-atrule");return r&&s.includes(r.name.toLowerCase())}function Vn(t){var s;let{node:e}=t;return e.groups[0].value==="url"&&e.groups.length===2&&((s=t.findAncestor(r=>r.type==="css-atrule"))==null?void 0:s.name)==="import"}function zn(t){return t.type==="value-func"&&t.value.toLowerCase()==="url"}function Gn(t){return t.type==="value-func"&&t.value.toLowerCase()==="var"}function jn(t){let{selector:e}=t;return e?typeof e=="string"&&/^@.+:.*$/u.test(e)||e.value&&/^@.+:.*$/u.test(e.value):!1}function Hn(t){return t.type==="value-word"&&["from","through","end"].includes(t.value)}function Kn(t){return t.type==="value-word"&&["and","or","not"].includes(t.value)}function Qn(t){return t.type==="value-word"&&t.value==="in"}function It(t){return t.type==="value-operator"&&t.value==="*"}function et(t){return t.type==="value-operator"&&t.value==="/"}function J(t){return t.type==="value-operator"&&t.value==="+"}function he(t){return t.type==="value-operator"&&t.value==="-"}function Xl(t){return t.type==="value-operator"&&t.value==="%"}function qt(t){return It(t)||et(t)||J(t)||he(t)||Xl(t)}function Jn(t){return t.type==="value-word"&&["==","!="].includes(t.value)}function Xn(t){return t.type==="value-word"&&["<",">","<=",">="].includes(t.value)}function tt(t,e){return e.parser==="scss"&&t.type==="css-atrule"&&["if","else","for","each","while"].includes(t.name)}function Jr(t){var e;return((e=t.raws)==null?void 0:e.params)&&/^\(\s*\)$/u.test(t.raws.params)}function Lt(t){return t.name.startsWith("prettier-placeholder")}function Zn(t){return t.prop.startsWith("@prettier-placeholder")}function ei(t,e){return t.value==="$$"&&t.type==="value-func"&&(e==null?void 0:e.type)==="value-word"&&!e.raws.before}function ti(t){var e,s;return((e=t.value)==null?void 0:e.type)==="value-root"&&((s=t.value.group)==null?void 0:s.type)==="value-value"&&t.prop.toLowerCase()==="composes"}function ri(t){var e,s,r;return((r=(s=(e=t.value)==null?void 0:e.group)==null?void 0:s.group)==null?void 0:r.type)==="value-paren_group"&&t.value.group.group.open!==null&&t.value.group.group.close!==null}function de(t){var e;return((e=t.raws)==null?void 0:e.before)===""}function Dt(t){var e,s;return t.type==="value-comma_group"&&((s=(e=t.groups)==null?void 0:e[1])==null?void 0:s.type)==="value-colon"}function Qr(t){var e;return t.type==="value-paren_group"&&((e=t.groups)==null?void 0:e[0])&&Dt(t.groups[0])}function Xr(t,e){var i;if(e.parser!=="scss")return!1;let{node:s}=t;if(s.groups.length===0)return!1;let r=t.grandparent;if(!Qr(s)&&!(r&&Qr(r)))return!1;let n=t.findAncestor(o=>o.type==="css-decl");return!!((i=n==null?void 0:n.prop)!=null&&i.startsWith("$")||Qr(r)||r.type==="value-func")}function Ae(t){return t.type==="value-comment"&&t.inline}function Bt(t){return t.type==="value-word"&&t.value==="#"}function Zr(t){return t.type==="value-word"&&t.value==="{"}function Mt(t){return t.type==="value-word"&&t.value==="}"}function rt(t){return["value-word","value-atword"].includes(t.type)}function st(t){return(t==null?void 0:t.type)==="value-colon"}function si(t,e){if(!Dt(e))return!1;let{groups:s}=e,r=s.indexOf(t);return r===-1?!1:st(s[r+1])}function ni(t){return t.value&&["not","and","or"].includes(t.value.toLowerCase())}function ii(t){return t.type!=="value-func"?!1:Ql.has(t.value.toLowerCase())}function Ne(t){return/\/\//u.test(t.split(/[\n\r]/u).pop())}function nt(t){return(t==null?void 0:t.type)==="value-atword"&&t.value.startsWith("prettier-placeholder-")}function oi(t,e){var s,r;if(((s=t.open)==null?void 0:s.value)!=="("||((r=t.close)==null?void 0:r.value)!==")"||t.groups.some(n=>n.type!=="value-comma_group"))return!1;if(e.type==="value-comma_group"){let n=e.groups.indexOf(t)-1,i=e.groups[n];if((i==null?void 0:i.type)==="value-word"&&i.value==="with")return!0}return!1}function it(t){var e,s;return t.type==="value-paren_group"&&((e=t.open)==null?void 0:e.value)==="("&&((s=t.close)==null?void 0:s.value)===")"}function Zl(t,e,s){var d;let{node:r}=t,n=t.parent,i=t.grandparent,o=Fn(t),u=o&&n.type==="value-value"&&(o==="grid"||o.startsWith("grid-template")),a=t.findAncestor(m=>m.type==="css-atrule"),c=a&&tt(a,e),f=r.groups.some(m=>Ae(m)),p=t.map(s,"groups"),l=[""],y=Ce(t,"url"),x=!1,h=!1;for(let m=0;m2&&r.groups.slice(0,m).every(O=>O.type==="value-comment")&&!Ae(b)&&(l[l.length-2]=oe($(!1,l,-2))),Oe(t,"forward")&&w.type==="value-word"&&w.value&&b!==void 0&&b.type==="value-word"&&b.value==="as"&&v.type==="value-operator"&&v.value==="*"||!v||w.type==="value-word"&&w.value.endsWith("-")&&nt(v))continue;if(w.type==="value-string"&&w.quoted){let O=w.value.lastIndexOf("#{"),ve=w.value.lastIndexOf("}");O!==-1&&ve!==-1?x=O>ve:O!==-1?x=!0:ve!==-1&&(x=!1)}if(x||st(w)||st(v)||w.type==="value-atword"&&(w.value===""||w.value.endsWith("["))||v.type==="value-word"&&v.value.startsWith("]")||w.value==="~"||w.type!=="value-string"&&w.value&&w.value.includes("\\")&&v&&v.type!=="value-comment"||b!=null&&b.value&&b.value.indexOf("\\")===b.value.length-1&&w.type==="value-operator"&&w.value==="/"||w.value==="\\"||ei(w,v)||Bt(w)||Zr(w)||Mt(v)||Zr(v)&&de(v)||Mt(w)&&de(v)||w.value==="--"&&Bt(v))continue;let F=qt(w),Q=qt(v);if((F&&Bt(v)||Q&&Mt(w))&&de(v)||!b&&et(w)||Ce(t,"calc")&&(J(w)||J(v)||he(w)||he(v))&&de(v))continue;let W=(J(w)||he(w))&&m===0&&(v.type==="value-number"||v.isHex)&&i&&ii(i)&&!de(v),T=(N==null?void 0:N.type)==="value-func"||N&&rt(N)||w.type==="value-func"||rt(w),C=v.type==="value-func"||rt(v)||(b==null?void 0:b.type)==="value-func"||b&&rt(b);if(e.parser==="scss"&&F&&w.value==="-"&&v.type==="value-func"&&R(w)!==P(v)){l.push([l.pop()," "]);continue}if(!(!(It(v)||It(w))&&!Ce(t,"calc")&&!W&&(et(v)&&!T||et(w)&&!C||J(v)&&!T||J(w)&&!C||he(v)||he(w))&&(de(v)||F&&(!b||b&&qt(b))))&&!((e.parser==="scss"||e.parser==="less")&&F&&w.value==="-"&&it(v)&&R(w)===P(v.open)&&v.open.value==="(")){if(Ae(w)){if(n.type==="value-paren_group"){l.push(oe(S),"");continue}l.push(S,"");continue}if(c&&(Jn(v)||Xn(v)||Kn(v)||Qn(w)||Hn(w))){l.push([l.pop()," "]);continue}if(a&&a.name.toLowerCase()==="namespace"){l.push([l.pop()," "]);continue}if(u){w.source&&v.source&&w.source.start.line!==v.source.start.line?(l.push(S,""),h=!0):l.push([l.pop()," "]);continue}if(Q){l.push([l.pop()," "]);continue}if((v==null?void 0:v.value)!=="..."&&!(nt(w)&&nt(v)&&R(w)===P(v))){if(nt(w)&&it(v)&&R(w)===P(v.open)){l.push(D,"");continue}if(w.value==="with"&&it(v)){l=[[Se(l)," "]];continue}(d=w.value)!=null&&d.endsWith("#")&&v.value==="{"&&it(v.group)||Ae(v)&&!N||l.push(A,"")}}}return f&&l.push([l.pop(),Ke]),h&&l.unshift("",S),c?L(q(l)):Vn(t)?L(Se(l)):L(q(Se(l)))}var ai=Zl;function ec(t){return t.length===1?t:t.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")}var ui=ec;var es=new Map([["em","em"],["rem","rem"],["ex","ex"],["rex","rex"],["cap","cap"],["rcap","rcap"],["ch","ch"],["rch","rch"],["ic","ic"],["ric","ric"],["lh","lh"],["rlh","rlh"],["vw","vw"],["svw","svw"],["lvw","lvw"],["dvw","dvw"],["vh","vh"],["svh","svh"],["lvh","lvh"],["dvh","dvh"],["vi","vi"],["svi","svi"],["lvi","lvi"],["dvi","dvi"],["vb","vb"],["svb","svb"],["lvb","lvb"],["dvb","dvb"],["vmin","vmin"],["svmin","svmin"],["lvmin","lvmin"],["dvmin","dvmin"],["vmax","vmax"],["svmax","svmax"],["lvmax","lvmax"],["dvmax","dvmax"],["cm","cm"],["mm","mm"],["q","Q"],["in","in"],["pt","pt"],["pc","pc"],["px","px"],["deg","deg"],["grad","grad"],["rad","rad"],["turn","turn"],["s","s"],["ms","ms"],["hz","Hz"],["khz","kHz"],["dpi","dpi"],["dpcm","dpcm"],["dppx","dppx"],["x","x"],["cqw","cqw"],["cqh","cqh"],["cqi","cqi"],["cqb","cqb"],["cqmin","cqmin"],["cqmax","cqmax"],["fr","fr"]]);function li(t){let e=t.toLowerCase();return es.has(e)?es.get(e):t}var ci=/(["'])(?:(?!\1)[^\\]|\\.)*\1/gsu,tc=/(?:\d*\.\d+|\d+\.?)(?:e[+-]?\d+)?/giu,rc=/[a-z]+/giu,sc=/[$@]?[_a-z\u0080-\uFFFF][\w\u0080-\uFFFF-]*/giu,nc=new RegExp(ci.source+`|(${sc.source})?(${tc.source})(${rc.source})?`,"giu");function V(t,e){return E(!1,t,ci,s=>At(s,e))}function fi(t,e){let s=e.singleQuote?"'":'"';return t.includes('"')||t.includes("'")?t:s+t+s}function me(t){return E(!1,t,nc,(e,s,r,n,i)=>!r&&n?ts(n)+ue(i||""):e)}function ts(t){return ui(t).replace(/\.0(?=$|e)/u,"")}function pi(t){return t.trailingComma==="es5"||t.trailingComma==="all"}function ic(t,e,s){let r=!!(s!=null&&s.backwards);if(e===!1)return!1;let n=t.charAt(e);if(r){if(t.charAt(e-1)==="\r"&&n===` +`)return e-2;if(n===` +`||n==="\r"||n==="\u2028"||n==="\u2029")return e-1}else{if(n==="\r"&&t.charAt(e+1)===` +`)return e+2;if(n===` +`||n==="\r"||n==="\u2028"||n==="\u2029")return e+1}return e}var Ut=ic;function oc(t,e,s={}){let r=Pt(t,s.backwards?e-1:e,s),n=Ut(t,r,s);return r!==n}var Ft=oc;function ac(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let s=e+2;ss.type==="value-comment"))&&pi(e)&&t.callParent(()=>Xr(t,e))?Ct(","):""}function mi(t,e,s){let{node:r,parent:n}=t,i=t.map(({node:y})=>typeof y=="string"?y:s(),"groups");if(n&&zn(n)&&(r.groups.length===1||r.groups.length>0&&r.groups[0].type==="value-comma_group"&&r.groups[0].groups.length>0&&r.groups[0].groups[0].type==="value-word"&&r.groups[0].groups[0].value.startsWith("data:")))return[r.open?s("open"):"",Y(",",i),r.close?s("close"):""];if(!r.open){let y=rs(t);He(i);let x=hc(Y(",",i),2),h=Y(y?S:A,x);return q(y?[S,h]:L([pc(t)?D:"",Se(h)]))}let o=t.map(({node:y,isLast:x,index:h})=>{var b;let d=i[h];Dt(y)&&y.type==="value-comma_group"&&y.groups&&y.groups[0].type!=="value-paren_group"&&((b=y.groups[2])==null?void 0:b.type)==="value-paren_group"&&H(d)===re&&H(d.contents)===te&&H(d.contents.contents)===se&&(d=L(oe(d)));let m=[d,x?fc(t,e):","];if(!x&&y.type==="value-comma_group"&&ae(y.groups)){let w=$(!1,y.groups,-1);!w.source&&w.close&&(w=w.close),w.source&&$t(e.originalText,R(w))&&m.push(S)}return m},"groups"),u=si(r,n),a=oi(r,n),c=Xr(t,e),f=a||c&&!u,p=a||u,l=L([r.open?s("open"):"",q([D,Y(A,o)]),D,r.close?s("close"):""],{shouldBreak:f});return p?oe(l):l}function rs(t){return t.match(e=>e.type==="value-paren_group"&&!e.open&&e.groups.some(s=>s.type==="value-comma_group"),(e,s)=>s==="group"&&e.type==="value-value",(e,s)=>s==="group"&&e.type==="value-root",(e,s)=>s==="value"&&(e.type==="css-decl"&&!e.prop.startsWith("--")||e.type==="css-atrule"&&e.variable))}function pc(t){return t.match(e=>e.type==="value-paren_group"&&!e.open,(e,s)=>s==="group"&&e.type==="value-value",(e,s)=>s==="group"&&e.type==="value-root",(e,s)=>s==="value"&&e.type==="css-decl")}function hc(t,e){let s=[];for(let r=0;r{let{node:n,previous:i}=t;if((i==null?void 0:i.type)==="css-comment"&&i.text.trim()==="prettier-ignore"?r.push(e.originalText.slice(P(n),R(n))):r.push(s()),t.isLast)return;let{next:o}=t;o.type==="css-comment"&&!Ft(e.originalText,P(o),{backwards:!0})&&!Te(n)||o.type==="css-atrule"&&o.name==="else"&&n.type!=="css-comment"?r.push(" "):(r.push(e.__isHTMLStyleAttribute?A:S),$t(e.originalText,R(n))&&!Te(n)&&r.push(S))},"nodes"),r}var Pe=dc;function mc(t,e,s){var n,i,o,u,a,c;let{node:r}=t;switch(r.type){case"front-matter":return[r.raw,S];case"css-root":{let f=Pe(t,e,s),p=r.raws.after.trim();return p.startsWith(";")&&(p=p.slice(1).trim()),[r.frontMatter?[s("frontMatter"),S]:"",f,p?` ${p}`:"",r.nodes.length>0?S:""]}case"css-comment":{let f=r.inline||r.raws.inline,p=e.originalText.slice(P(r),R(r));return f?p.trimEnd():p}case"css-rule":return[s("selector"),r.important?" !important":"",r.nodes?[((n=r.selector)==null?void 0:n.type)==="selector-unknown"&&Ne(r.selector.value)?A:r.selector?" ":"","{",r.nodes.length>0?q([S,Pe(t,e,s)]):"",S,"}",jn(r)?";":""]:";"];case"css-decl":{let f=t.parent,{between:p}=r.raws,l=p.trim(),y=l===":",x=typeof r.value=="string"&&/^ *$/u.test(r.value),h=typeof r.value=="string"?r.value:s("value");return h=ti(r)?tn(h):h,!y&&Ne(l)&&!((o=(i=r.value)==null?void 0:i.group)!=null&&o.group&&t.call(()=>rs(t),"value","group","group"))&&(h=q([S,oe(h)])),[E(!1,r.raws.before,/[\s;]/gu,""),f.type==="css-atrule"&&f.variable||Yn(t)?r.prop:ue(r.prop),l.startsWith("//")?" ":"",l,r.extend||x?"":" ",e.parser==="less"&&r.extend&&r.selector?["extend(",s("selector"),")"]:"",h,r.raws.important?r.raws.important.replace(/\s*!\s*important/iu," !important"):r.important?" !important":"",r.raws.scssDefault?r.raws.scssDefault.replace(/\s*!default/iu," !default"):r.scssDefault?" !default":"",r.raws.scssGlobal?r.raws.scssGlobal.replace(/\s*!global/iu," !global"):r.scssGlobal?" !global":"",r.nodes?[" {",q([D,Pe(t,e,s)]),D,"}"]:Zn(r)&&!f.raws.semicolon&&e.originalText[R(r)-1]!==";"?"":e.__isHTMLStyleAttribute&&t.isLast?Ct(";"):";"]}case"css-atrule":{let f=t.parent,p=Lt(r)&&!f.raws.semicolon&&e.originalText[R(r)-1]!==";";if(e.parser==="less"){if(r.mixin)return[s("selector"),r.important?" !important":"",p?"":";"];if(r.function)return[r.name,typeof r.params=="string"?r.params:s("params"),p?"":";"];if(r.variable)return["@",r.name,": ",r.value?s("value"):"",r.raws.between.trim()?r.raws.between.trim()+" ":"",r.nodes?["{",q([r.nodes.length>0?D:"",Pe(t,e,s)]),D,"}"]:"",p?"":";"]}let l=r.name==="import"&&((u=r.params)==null?void 0:u.type)==="value-unknown"&&r.params.value.endsWith(";");return["@",Jr(r)||r.name.endsWith(":")||Lt(r)?r.name:ue(r.name),r.params?[Jr(r)?"":Lt(r)?r.raws.afterName===""?"":r.name.endsWith(":")?" ":/^\s*\n\s*\n/u.test(r.raws.afterName)?[S,S]:/^\s*\n/u.test(r.raws.afterName)?S:" ":" ",typeof r.params=="string"?r.params:s("params")]:"",r.selector?q([" ",s("selector")]):"",r.value?L([" ",s("value"),tt(r,e)?ri(r)?" ":A:""]):r.name==="else"?" ":"",r.nodes?[tt(r,e)?"":r.selector&&!r.selector.nodes&&typeof r.selector.value=="string"&&Ne(r.selector.value)||!r.selector&&typeof r.params=="string"&&Ne(r.params)?A:" ","{",q([r.nodes.length>0?D:"",Pe(t,e,s)]),D,"}"]:p||l?"":";"]}case"media-query-list":{let f=[];return t.each(({node:p})=>{p.type==="media-query"&&p.value===""||f.push(s())},"nodes"),L(q(Y(A,f)))}case"media-query":return[Y(" ",t.map(s,"nodes")),t.isLast?"":","];case"media-type":return me(V(r.value,e));case"media-feature-expression":return r.nodes?["(",...t.map(s,"nodes"),")"]:r.value;case"media-feature":return ue(V(E(!1,r.value,/ +/gu," "),e));case"media-colon":return[r.value," "];case"media-value":return me(V(r.value,e));case"media-keyword":return V(r.value,e);case"media-url":return V(E(!1,E(!1,r.value,/^url\(\s+/giu,"url("),/\s+\)$/gu,")"),e);case"media-unknown":return r.value;case"selector-root":return L([Oe(t,"custom-selector")?[t.findAncestor(f=>f.type==="css-atrule").customSelector,A]:"",Y([",",Oe(t,["extend","custom-selector","nest"])?A:S],t.map(s,"nodes"))]);case"selector-selector":{let f=r.nodes.length>1;return L((f?q:p=>p)(t.map(s,"nodes")))}case"selector-comment":return r.value;case"selector-string":return V(r.value,e);case"selector-tag":return[r.namespace?[r.namespace===!0?"":r.namespace.trim(),"|"]:"",((a=t.previous)==null?void 0:a.type)==="selector-nesting"?r.value:me(Wn(t,r.value)?r.value.toLowerCase():r.value)];case"selector-id":return["#",r.value];case"selector-class":return[".",me(V(r.value,e))];case"selector-attribute":return["[",r.namespace?[r.namespace===!0?"":r.namespace.trim(),"|"]:"",r.attribute.trim(),r.operator??"",r.value?fi(V(r.value.trim(),e),e):"",r.insensitive?" i":"","]"];case"selector-combinator":{if(r.value==="+"||r.value===">"||r.value==="~"||r.value===">>>"){let l=t.parent;return[l.type==="selector-selector"&&l.nodes[0]===r?"":A,r.value,t.isLast?"":" "]}let f=r.value.trim().startsWith("(")?A:"",p=me(V(r.value.trim(),e))||A;return[f,p]}case"selector-universal":return[r.namespace?[r.namespace===!0?"":r.namespace.trim(),"|"]:"",r.value];case"selector-pseudo":return[ue(r.value),ae(r.nodes)?L(["(",q([D,Y([",",A],t.map(s,"nodes"))]),D,")"]):""];case"selector-nesting":return r.value;case"selector-unknown":{let f=t.findAncestor(y=>y.type==="css-rule");if(f!=null&&f.isSCSSNesterProperty)return me(V(ue(r.value),e));let p=t.parent;if((c=p.raws)!=null&&c.selector){let y=P(p),x=y+p.raws.selector.length;return e.originalText.slice(y,x).trim()}let l=t.grandparent;if(p.type==="value-paren_group"&&(l==null?void 0:l.type)==="value-func"&&l.value==="selector"){let y=R(p.open)+1,x=P(p.close),h=e.originalText.slice(y,x).trim();return Ne(h)?[Ke,h]:h}return r.value}case"value-value":case"value-root":return s("group");case"value-comment":return e.originalText.slice(P(r),R(r));case"value-comma_group":return ai(t,e,s);case"value-paren_group":return mi(t,e,s);case"value-func":return[r.value,Oe(t,"supports")&&ni(r)?" ":"",s("group")];case"value-paren":return r.value;case"value-number":return[ts(r.value),li(r.unit)];case"value-operator":return r.value;case"value-word":return r.isColor&&r.isHex||$n(r.value)?r.value.toLowerCase():r.value;case"value-colon":{let{previous:f}=t;return L([r.value,typeof(f==null?void 0:f.value)=="string"&&f.value.endsWith("\\")||Ce(t,"url")?"":A])}case"value-string":return At(r.raws.quote+r.value+r.raws.quote,e);case"value-atword":return["@",r.value];case"value-unicode-range":return r.value;case"value-unknown":return r.value;case"value-comma":default:throw new pn(r,"PostCSS")}}var yc={print:mc,embed:gn,insertPragma:Un,massageAstNode:dn,getVisitorKeys:xn},yi=yc;var gi=[{linguistLanguageId:50,name:"CSS",type:"markup",tmScope:"source.css",aceMode:"css",codemirrorMode:"css",codemirrorMimeType:"text/css",color:"#563d7c",extensions:[".css",".wxss"],parsers:["css"],vscodeLanguageIds:["css"]},{linguistLanguageId:262764437,name:"PostCSS",type:"markup",color:"#dc3a0c",tmScope:"source.postcss",group:"CSS",extensions:[".pcss",".postcss"],aceMode:"text",parsers:["css"],vscodeLanguageIds:["postcss"]},{linguistLanguageId:198,name:"Less",type:"markup",color:"#1d365d",aliases:["less-css"],extensions:[".less"],tmScope:"source.css.less",aceMode:"less",codemirrorMode:"css",codemirrorMimeType:"text/css",parsers:["less"],vscodeLanguageIds:["less"]},{linguistLanguageId:329,name:"SCSS",type:"markup",color:"#c6538c",tmScope:"source.css.scss",aceMode:"scss",codemirrorMode:"css",codemirrorMimeType:"text/x-scss",extensions:[".scss"],parsers:["scss"],vscodeLanguageIds:["scss"]}];var wi={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var gc={singleQuote:wi.singleQuote},vi=gc;var Js={};en(Js,{css:()=>Ny,less:()=>Py,scss:()=>Ry});var ol=xe(gt(),1),al=xe(To(),1),ul=xe(oa(),1);function sp(t,e){let s=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(s,e)}var aa=sp;var da=xe(ha(),1);function X(t,e,s){if(t&&typeof t=="object"){delete t.parent;for(let r in t)X(t[r],e,s),r==="type"&&typeof t[r]=="string"&&!t[r].startsWith(e)&&(!s||!s.test(t[r]))&&(t[r]=e+t[r])}return t}function Ls(t){if(t&&typeof t=="object"){delete t.parent;for(let e in t)Ls(t[e]);!Array.isArray(t)&&t.value&&!t.type&&(t.type="unknown")}return t}var mp=da.default.default;function yp(t){let e;try{e=mp(t)}catch{return{type:"selector-unknown",value:t}}return X(Ls(e),"media-")}var ma=yp;var lu=xe(uu(),1);function Nm(t){if(/\/\/|\/\*/u.test(t))return{type:"selector-unknown",value:t.trim()};let e;try{new lu.default(s=>{e=s}).process(t)}catch{return{type:"selector-unknown",value:t}}return X(e,"selector-")}var ee=Nm;var rl=xe(Qu(),1);var wy=t=>{for(;t.parent;)t=t.parent;return t},Ur=wy;function vy(t){return Ur(t).text.slice(t.group.open.sourceIndex+1,t.group.close.sourceIndex).trim()}var Ju=vy;function xy(t){if(ae(t)){for(let e=t.length-1;e>0;e--)if(t[e].type==="word"&&t[e].value==="{"&&t[e-1].type==="word"&&t[e-1].value.endsWith("#"))return!0}return!1}var Xu=xy;function by(t){return t.some(e=>e.type==="string"||e.type==="func"&&!e.value.endsWith("\\"))}var Zu=by;function _y(t,e){return!!(e.parser==="scss"&&(t==null?void 0:t.type)==="word"&&t.value.startsWith("$"))}var el=_y;var tl=t=>t.type==="paren"&&t.value===")";function Ey(t,e){var a;let{nodes:s}=t,r={open:null,close:null,groups:[],type:"paren_group"},n=[r],i=r,o={groups:[],type:"comma_group"},u=[o];for(let c=0;c0&&r.groups.push(o),r.close=f,u.length===1)throw new Error("Unbalanced parenthesis");u.pop(),o=$(!1,u,-1),o.groups.push(r),n.pop(),r=$(!1,n,-1)}else if(f.type==="comma"){if(c===s.length-3&&s[c+1].type==="comment"&&tl(s[c+2]))continue;r.groups.push(o),o={groups:[],type:"comma_group"},u[u.length-1]=o}else o.groups.push(f)}return o.groups.length>0&&r.groups.push(o),i}function Fr(t){return t.type==="paren_group"&&!t.open&&!t.close&&t.groups.length===1||t.type==="comma_group"&&t.groups.length===1?Fr(t.groups[0]):t.type==="paren_group"||t.type==="comma_group"?{...t,groups:t.groups.map(Fr)}:t}function sl(t,e){if(t&&typeof t=="object")for(let s in t)s!=="parent"&&(sl(t[s],e),s==="nodes"&&(t.group=Fr(Ey(t,e)),delete t[s]));return t}function ky(t,e){if(e.parser==="less"&&t.startsWith("~`"))return{type:"value-unknown",value:t};let s=null;try{s=new rl.default(t,{loose:!0}).parse()}catch{return{type:"value-unknown",value:t}}s.text=t;let r=sl(s,e);return X(r,"value-",/^selector-/u)}var pe=ky;var Sy=new Set(["import","use","forward"]);function Ty(t){return Sy.has(t)}var nl=Ty;function Cy(t,e){return e.parser!=="scss"||!t.selector?!1:t.selector.replace(/\/\*.*?\*\//u,"").replace(/\/\/.*\n/u,"").trim().endsWith(":")}var il=Cy;var Oy=/(\s*)(!default).*$/u,Ay=/(\s*)(!global).*$/u;function ll(t,e){var s,r;if(t&&typeof t=="object"){delete t.parent;for(let u in t)ll(t[u],e);if(!t.type)return t;if(t.raws??(t.raws={}),t.type==="css-decl"&&typeof t.prop=="string"&&t.prop.startsWith("--")&&typeof t.value=="string"&&t.value.startsWith("{")){let u;if(t.value.trimEnd().endsWith("}")){let a=e.originalText.slice(0,t.source.start.offset),c="a".repeat(t.prop.length)+e.originalText.slice(t.source.start.offset+t.prop.length,t.source.end.offset),f=E(!1,a,/[^\n]/gu," ")+c,p;e.parser==="scss"?p=pl:e.parser==="less"?p=fl:p=cl;let l;try{l=p(f,{...e})}catch{}((s=l==null?void 0:l.nodes)==null?void 0:s.length)===1&&l.nodes[0].type==="css-rule"&&(u=l.nodes[0].nodes)}return u?t.value={type:"css-rule",nodes:u}:t.value={type:"value-unknown",value:t.raws.value.raw},t}let n="";typeof t.selector=="string"&&(n=t.raws.selector?t.raws.selector.scss??t.raws.selector.raw:t.selector,t.raws.between&&t.raws.between.trim().length>0&&(n+=t.raws.between),t.raws.selector=n);let i="";typeof t.value=="string"&&(i=t.raws.value?t.raws.value.scss??t.raws.value.raw:t.value,t.raws.value=i.trim());let o="";if(typeof t.params=="string"&&(o=t.raws.params?t.raws.params.scss??t.raws.params.raw:t.params,t.raws.afterName&&t.raws.afterName.trim().length>0&&(o=t.raws.afterName+o),t.raws.between&&t.raws.between.trim().length>0&&(o=o+t.raws.between),o=o.trim(),t.raws.params=o),n.trim().length>0)return n.startsWith("@")&&n.endsWith(":")?t:t.mixin?(t.selector=pe(n,e),t):(il(t,e)&&(t.isSCSSNesterProperty=!0),t.selector=ee(n),t);if(i.trim().length>0){let u=i.match(Oy);u&&(i=i.slice(0,u.index),t.scssDefault=!0,u[0].trim()!=="!default"&&(t.raws.scssDefault=u[0]));let a=i.match(Ay);if(a&&(i=i.slice(0,a.index),t.scssGlobal=!0,a[0].trim()!=="!global"&&(t.raws.scssGlobal=a[0])),i.startsWith("progid:"))return{type:"value-unknown",value:i};t.value=pe(i,e)}if(e.parser==="less"&&t.type==="css-decl"&&i.startsWith("extend(")&&(t.extend||(t.extend=t.raws.between===":"),t.extend&&!t.selector&&(delete t.value,t.selector=ee(i.slice(7,-1)))),t.type==="css-atrule"){if(e.parser==="less"){if(t.mixin){let u=t.raws.identifier+t.name+t.raws.afterName+t.raws.params;return t.selector=ee(u),delete t.params,t}if(t.function)return t}if(e.parser==="css"&&t.name==="custom-selector"){let u=t.params.match(/:--\S+\s+/u)[0].trim();return t.customSelector=u,t.selector=ee(t.params.slice(u.length).trim()),delete t.params,t}if(e.parser==="less"){if(t.name.includes(":")&&!t.params){t.variable=!0;let u=t.name.split(":");t.name=u[0],t.value=pe(u.slice(1).join(":"),e)}if(!["page","nest","keyframes"].includes(t.name)&&((r=t.params)==null?void 0:r[0])===":"){t.variable=!0;let u=t.params.slice(1);u&&(t.value=pe(u,e)),t.raws.afterName+=":"}if(t.variable)return delete t.params,t.value||delete t.value,t}}if(t.type==="css-atrule"&&o.length>0){let{name:u}=t,a=t.name.toLowerCase();return u==="warn"||u==="error"?(t.params={type:"media-unknown",value:o},t):u==="extend"||u==="nest"?(t.selector=ee(o),delete t.params,t):u==="at-root"?(/^\(\s*(?:without|with)\s*:.+\)$/su.test(o)?t.params=pe(o,e):(t.selector=ee(o),delete t.params),t):nl(a)?(t.import=!0,delete t.filename,t.params=pe(o,e),t):["namespace","supports","if","else","for","each","while","debug","mixin","include","function","return","define-mixin","add-mixin"].includes(u)?(o=o.replace(/(\$\S+?)(\s+)?\.{3}/u,"$1...$2"),o=o.replace(/^(?!if)(\S+)(\s+)\(/u,"$1($2"),t.value=pe(o,e),delete t.params,t):["media","custom-media"].includes(a)?o.includes("#{")?{type:"media-unknown",value:o}:(t.params=ma(o),t):(t.params=o,t)}}return t}function Ks(t,e,s){let r=Ze(e),{frontMatter:n}=r;e=r.content;let i;try{i=t(e,{map:!1})}catch(o){let{name:u,reason:a,line:c,column:f}=o;throw typeof c!="number"?o:aa(`${u}: ${a}`,{loc:{start:{line:c,column:f}},cause:o})}return s.originalText=e,i=ll(X(i,"css-"),s),Kr(i,e),n&&(n.source={startOffset:0,endOffset:n.raw.length},i.frontMatter=n),i}function cl(t,e={}){return Ks(ol.default.default,t,e)}function fl(t,e={}){return Ks(s=>al.default.parse(kn(s)),t,e)}function pl(t,e={}){return Ks(ul.default,t,e)}var Qs={astFormat:"postcss",hasPragma:Mn,locStart:P,locEnd:R},Ny={...Qs,parse:cl},Py={...Qs,parse:fl},Ry={...Qs,parse:pl};var Iy={postcss:yi};var Gb=Xs;export{Gb as default,gi as languages,vi as options,Js as parsers,Iy as printers}; diff --git a/node_modules/prettier/plugins/typescript.js b/node_modules/prettier/plugins/typescript.js new file mode 100644 index 0000000..ee062e8 --- /dev/null +++ b/node_modules/prettier/plugins/typescript.js @@ -0,0 +1,20 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.typescript=e()}})(function(){"use strict";var Zc=Object.defineProperty;var $0=Object.getOwnPropertyDescriptor;var Q0=Object.getOwnPropertyNames;var K0=Object.prototype.hasOwnProperty;var vd=e=>{throw TypeError(e)};var Z0=(e,t,a)=>t in e?Zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var Td=(e,t)=>{for(var a in t)Zc(e,a,{get:t[a],enumerable:!0})},ey=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of Q0(t))!K0.call(e,m)&&m!==a&&Zc(e,m,{get:()=>t[m],enumerable:!(o=$0(t,m))||o.enumerable});return e};var ty=e=>ey(Zc({},"__esModule",{value:!0}),e);var qi=(e,t,a)=>Z0(e,typeof t!="symbol"?t+"":t,a),ny=(e,t,a)=>t.has(e)||vd("Cannot "+a);var gp=(e,t,a)=>t.has(e)?vd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a);var ge=(e,t,a)=>(ny(e,t,"access private method"),a);var q4={};Td(q4,{parsers:()=>dd});var dd={};Td(dd,{typescript:()=>B4});var ry=()=>()=>{},Ia=ry;var iy=(e,t,a,o)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(a,o):a.global?t.replace(a,o):t.split(a).join(o)},Sr=iy;var Sm="5.7";var bt=[],ay=new Map;function ts(e){return e!==void 0?e.length:0}function Un(e,t){if(e!==void 0)for(let a=0;a0;return!1}function Xp(e,t){return t===void 0||t.length===0?e:e===void 0||e.length===0?t:[...e,...t]}function ly(e,t,a=$p){if(e===void 0||t===void 0)return e===t;if(e.length!==t.length)return!1;for(let o=0;oe==null?void 0:e.at(t):(e,t)=>{if(e!==void 0&&(t=Ip(e,t),t>1),l=a(e[P],P);switch(o(l,t)){case-1:v=P+1;break;case 0:return P;case 1:A=P-1;break}}return~v}function gy(e,t,a,o,m){if(e&&e.length>0){let v=e.length;if(v>0){let A=o===void 0||o<0?0:o,P=m===void 0||A+m>v-1?v-1:A+m,l;for(arguments.length<=2?(l=e[A],A++):l=a;A<=P;)l=t(l,e[A],A),A++;return l}}return a}var Am=Object.prototype.hasOwnProperty;function Cr(e,t){return Am.call(e,t)}function by(e){let t=[];for(let a in e)Am.call(e,a)&&t.push(a);return t}function vy(){let e=new Map;return e.add=Ty,e.remove=xy,e}function Ty(e,t){let a=this.get(e);return a!==void 0?a.push(t):this.set(e,a=[t]),a}function xy(e,t){let a=this.get(e);a!==void 0&&(Ny(a,t),a.length||this.delete(e))}function Yr(e){return Array.isArray(e)}function vp(e){return Yr(e)?e:[e]}function Sy(e,t){return e!==void 0&&t(e)?e:void 0}function kr(e,t){return e!==void 0&&t(e)?e:B.fail(`Invalid cast. The supplied value ${e} did not pass the test '${B.getFunctionName(t)}'.`)}function Fa(e){}function wy(){return!0}function gt(e){return e}function Sd(e){let t;return()=>(e&&(t=e(),e=void 0),t)}function Kn(e){let t=new Map;return a=>{let o=`${typeof a}:${a}`,m=t.get(o);return m===void 0&&!t.has(o)&&(m=e(a),t.set(o,m)),m}}function $p(e,t){return e===t}function Qp(e,t){return e===t||e!==void 0&&t!==void 0&&e.toUpperCase()===t.toUpperCase()}function ky(e,t){return $p(e,t)}function Ey(e,t){return e===t?0:e===void 0?-1:t===void 0?1:ea?P-a:1),h=Math.floor(t.length>a+P?a+P:t.length);m[0]=P;let y=P;for(let x=1;xa)return;let g=o;o=m,m=g}let A=o[t.length];return A>a?void 0:A}function Dy(e,t,a){let o=e.length-t.length;return o>=0&&(a?Qp(e.slice(o),t):e.indexOf(t,o)===o)}function Py(e,t){e[t]=e[e.length-1],e.pop()}function Ny(e,t){return Iy(e,a=>a===t)}function Iy(e,t){for(let a=0;a{let t=0;e.currentLogLevel=2,e.isDebugging=!1;function a(L){return e.currentLogLevel<=L}e.shouldLog=a;function o(L,se){e.loggingHost&&a(L)&&e.loggingHost.log(L,se)}function m(L){o(3,L)}e.log=m,(L=>{function se(Ke){o(1,Ke)}L.error=se;function fe(Ke){o(2,Ke)}L.warn=fe;function Te(Ke){o(3,Ke)}L.log=Te;function He(Ke){o(4,Ke)}L.trace=He})(m=e.log||(e.log={}));let v={};function A(){return t}e.getAssertionLevel=A;function P(L){let se=t;if(t=L,L>se)for(let fe of by(v)){let Te=v[fe];Te!==void 0&&e[fe]!==Te.assertion&&L>=Te.level&&(e[fe]=Te,v[fe]=void 0)}}e.setAssertionLevel=P;function l(L){return t>=L}e.shouldAssert=l;function Q(L,se){return l(L)?!0:(v[se]={level:L,assertion:e[se]},e[se]=Fa,!1)}function h(L,se){debugger;let fe=new Error(L?`Debug Failure. ${L}`:"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(fe,se||h),fe}e.fail=h;function y(L,se,fe){return h(`${se||"Unexpected node."}\r +Node ${Ot(L.kind)} was unexpected.`,fe||y)}e.failBadSyntaxKind=y;function g(L,se,fe,Te){L||(se=se?`False expression: ${se}`:"False expression.",fe&&(se+=`\r +Verbose Debug Information: `+(typeof fe=="string"?fe:fe())),h(se,Te||g))}e.assert=g;function x(L,se,fe,Te,He){if(L!==se){let Ke=fe?Te?`${fe} ${Te}`:fe:"";h(`Expected ${L} === ${se}. ${Ke}`,He||x)}}e.assertEqual=x;function I(L,se,fe,Te){L>=se&&h(`Expected ${L} < ${se}. ${fe||""}`,Te||I)}e.assertLessThan=I;function re(L,se,fe){L>se&&h(`Expected ${L} <= ${se}`,fe||re)}e.assertLessThanOrEqual=re;function he(L,se,fe){L= ${se}`,fe||he)}e.assertGreaterThanOrEqual=he;function ye(L,se,fe){L==null&&h(se,fe||ye)}e.assertIsDefined=ye;function de(L,se,fe){return ye(L,se,fe||de),L}e.checkDefined=de;function M(L,se,fe){for(let Te of L)ye(Te,se,fe||M)}e.assertEachIsDefined=M;function ae(L,se,fe){return M(L,se,fe||ae),L}e.checkEachDefined=ae;function Oe(L,se="Illegal value:",fe){let Te=typeof L=="object"&&Cr(L,"kind")&&Cr(L,"pos")?"SyntaxKind: "+Ot(L.kind):JSON.stringify(L);return h(`${se} ${Te}`,fe||Oe)}e.assertNever=Oe;function V(L,se,fe,Te){Q(1,"assertEachNode")&&g(se===void 0||Yp(L,se),fe||"Unexpected node.",()=>`Node array did not pass test '${bn(se)}'.`,Te||V)}e.assertEachNode=V;function oe(L,se,fe,Te){Q(1,"assertNode")&&g(L!==void 0&&(se===void 0||se(L)),fe||"Unexpected node.",()=>`Node ${Ot(L==null?void 0:L.kind)} did not pass test '${bn(se)}'.`,Te||oe)}e.assertNode=oe;function W(L,se,fe,Te){Q(1,"assertNotNode")&&g(L===void 0||se===void 0||!se(L),fe||"Unexpected node.",()=>`Node ${Ot(L.kind)} should not have passed test '${bn(se)}'.`,Te||W)}e.assertNotNode=W;function dt(L,se,fe,Te){Q(1,"assertOptionalNode")&&g(se===void 0||L===void 0||se(L),fe||"Unexpected node.",()=>`Node ${Ot(L==null?void 0:L.kind)} did not pass test '${bn(se)}'.`,Te||dt)}e.assertOptionalNode=dt;function nr(L,se,fe,Te){Q(1,"assertOptionalToken")&&g(se===void 0||L===void 0||L.kind===se,fe||"Unexpected node.",()=>`Node ${Ot(L==null?void 0:L.kind)} was not a '${Ot(se)}' token.`,Te||nr)}e.assertOptionalToken=nr;function gn(L,se,fe){Q(1,"assertMissingNode")&&g(L===void 0,se||"Unexpected node.",()=>`Node ${Ot(L.kind)} was unexpected'.`,fe||gn)}e.assertMissingNode=gn;function rr(L){}e.type=rr;function bn(L){if(typeof L!="function")return"";if(Cr(L,"name"))return L.name;{let se=Function.prototype.toString.call(L),fe=/^function\s+([\w$]+)\s*\(/.exec(se);return fe?fe[1]:""}}e.getFunctionName=bn;function In(L){return`{ name: ${cs(L.escapedName)}; flags: ${ct(L.flags)}; declarations: ${Np(L.declarations,se=>Ot(se.kind))} }`}e.formatSymbol=In;function Ge(L=0,se,fe){let Te=Pr(se);if(L===0)return Te.length>0&&Te[0][0]===0?Te[0][1]:"0";if(fe){let He=[],Ke=L;for(let[st,Dt]of Te){if(st>L)break;st!==0&&st&L&&(He.push(Dt),Ke&=~st)}if(Ke===0)return He.join("|")}else for(let[He,Ke]of Te)if(He===L)return Ke;return L.toString()}e.formatEnum=Ge;let ir=new Map;function Pr(L){let se=ir.get(L);if(se)return se;let fe=[];for(let He in L){let Ke=L[He];typeof Ke=="number"&&fe.push([Ke,He])}let Te=fy(fe,(He,Ke)=>Cm(He[0],Ke[0]));return ir.set(L,Te),Te}function Ot(L){return Ge(L,Ie,!1)}e.formatSyntaxKind=Ot;function Bn(L){return Ge(L,Om,!1)}e.formatSnippetKind=Bn;function On(L){return Ge(L,Dr,!1)}e.formatScriptKind=On;function Mt(L){return Ge(L,on,!0)}e.formatNodeFlags=Mt;function vt(L){return Ge(L,Pm,!0)}e.formatNodeCheckFlags=vt;function Qe(L){return Ge(L,Kp,!0)}e.formatModifierFlags=Qe;function qn(L){return Ge(L,Im,!0)}e.formatTransformFlags=qn;function $t(L){return Ge(L,Mm,!0)}e.formatEmitFlags=$t;function ct(L){return Ge(L,Zp,!0)}e.formatSymbolFlags=ct;function _t(L){return Ge(L,nn,!0)}e.formatTypeFlags=_t;function Ut(L){return Ge(L,Nm,!0)}e.formatSignatureFlags=Ut;function Jt(L){return Ge(L,ef,!0)}e.formatObjectFlags=Jt;function lt(L){return Ge(L,Mp,!0)}e.formatFlowFlags=lt;function ar(L){return Ge(L,Dm,!0)}e.formatRelationComparisonResult=ar;function mt(L){return Ge(L,CheckMode,!0)}e.formatCheckMode=mt;function vn(L){return Ge(L,SignatureCheckMode,!0)}e.formatSignatureCheckMode=vn;function yt(L){return Ge(L,TypeFacts,!0)}e.formatTypeFacts=yt;let cn=!1,nt;function Bt(L){"__debugFlowFlags"in L||Object.defineProperties(L,{__tsDebuggerDisplay:{value(){let se=this.flags&2?"FlowStart":this.flags&4?"FlowBranchLabel":this.flags&8?"FlowLoopLabel":this.flags&16?"FlowAssignment":this.flags&32?"FlowTrueCondition":this.flags&64?"FlowFalseCondition":this.flags&128?"FlowSwitchClause":this.flags&256?"FlowArrayMutation":this.flags&512?"FlowCall":this.flags&1024?"FlowReduceLabel":this.flags&1?"FlowUnreachable":"UnknownFlow",fe=this.flags&-2048;return`${se}${fe?` (${lt(fe)})`:""}`}},__debugFlowFlags:{get(){return Ge(this.flags,Mp,!0)}},__debugToString:{value(){return mr(this)}}})}function rn(L){return cn&&(typeof Object.setPrototypeOf=="function"?(nt||(nt=Object.create(Object.prototype),Bt(nt)),Object.setPrototypeOf(L,nt)):Bt(L)),L}e.attachFlowNodeDebugInfo=rn;let _r;function fr(L){"__tsDebuggerDisplay"in L||Object.defineProperties(L,{__tsDebuggerDisplay:{value(se){return se=String(se).replace(/(?:,[\s\w]+:[^,]+)+\]$/,"]"),`NodeArray ${se}`}}})}function dr(L){cn&&(typeof Object.setPrototypeOf=="function"?(_r||(_r=Object.create(Array.prototype),fr(_r)),Object.setPrototypeOf(L,_r)):fr(L))}e.attachNodeArrayDebugInfo=dr;function zn(){if(cn)return;let L=new WeakMap,se=new WeakMap;Object.defineProperties(At.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value(){let Te=this.flags&33554432?"TransientSymbol":"Symbol",He=this.flags&-33554433;return`${Te} '${jp(this)}'${He?` (${ct(He)})`:""}`}},__debugFlags:{get(){return ct(this.flags)}}}),Object.defineProperties(At.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value(){let Te=this.flags&67359327?`IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName?` (${this.debugIntrinsicName})`:""}`:this.flags&98304?"NullableType":this.flags&384?`LiteralType ${JSON.stringify(this.value)}`:this.flags&2048?`LiteralType ${this.value.negative?"-":""}${this.value.base10Value}n`:this.flags&8192?"UniqueESSymbolType":this.flags&32?"EnumType":this.flags&1048576?"UnionType":this.flags&2097152?"IntersectionType":this.flags&4194304?"IndexType":this.flags&8388608?"IndexedAccessType":this.flags&16777216?"ConditionalType":this.flags&33554432?"SubstitutionType":this.flags&262144?"TypeParameter":this.flags&524288?this.objectFlags&3?"InterfaceType":this.objectFlags&4?"TypeReference":this.objectFlags&8?"TupleType":this.objectFlags&16?"AnonymousType":this.objectFlags&32?"MappedType":this.objectFlags&1024?"ReverseMappedType":this.objectFlags&256?"EvolvingArrayType":"ObjectType":"Type",He=this.flags&524288?this.objectFlags&-1344:0;return`${Te}${this.symbol?` '${jp(this.symbol)}'`:""}${He?` (${Jt(He)})`:""}`}},__debugFlags:{get(){return _t(this.flags)}},__debugObjectFlags:{get(){return this.flags&524288?Jt(this.objectFlags):""}},__debugTypeToString:{value(){let Te=L.get(this);return Te===void 0&&(Te=this.checker.typeToString(this),L.set(this,Te)),Te}}}),Object.defineProperties(At.getSignatureConstructor().prototype,{__debugFlags:{get(){return Ut(this.flags)}},__debugSignatureToString:{value(){var Te;return(Te=this.checker)==null?void 0:Te.signatureToString(this)}}});let fe=[At.getNodeConstructor(),At.getIdentifierConstructor(),At.getTokenConstructor(),At.getSourceFileConstructor()];for(let Te of fe)Cr(Te.prototype,"__debugKind")||Object.defineProperties(Te.prototype,{__tsDebuggerDisplay:{value(){return`${Ua(this)?"GeneratedIdentifier":tt(this)?`Identifier '${Pn(this)}'`:gi(this)?`PrivateIdentifier '${Pn(this)}'`:Ya(this)?`StringLiteral ${JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")}`:ta(this)?`NumericLiteral ${this.text}`:C1(this)?`BigIntLiteral ${this.text}n`:Af(this)?"TypeParameterDeclaration":ds(this)?"ParameterDeclaration":Cf(this)?"ConstructorDeclaration":bl(this)?"GetAccessorDeclaration":hs(this)?"SetAccessorDeclaration":O1(this)?"CallSignatureDeclaration":M1(this)?"ConstructSignatureDeclaration":Df(this)?"IndexSignatureDeclaration":J1(this)?"TypePredicateNode":Pf(this)?"TypeReferenceNode":Nf(this)?"FunctionTypeNode":If(this)?"ConstructorTypeNode":Vb(this)?"TypeQueryNode":L1(this)?"TypeLiteralNode":Wb(this)?"ArrayTypeNode":Gb(this)?"TupleTypeNode":Yb(this)?"OptionalTypeNode":Xb(this)?"RestTypeNode":R1(this)?"UnionTypeNode":U1(this)?"IntersectionTypeNode":Hb(this)?"ConditionalTypeNode":$b(this)?"InferTypeNode":B1(this)?"ParenthesizedTypeNode":Qb(this)?"ThisTypeNode":q1(this)?"TypeOperatorNode":Kb(this)?"IndexedAccessTypeNode":z1(this)?"MappedTypeNode":Zb(this)?"LiteralTypeNode":j1(this)?"NamedTupleMember":e6(this)?"ImportTypeNode":Ot(this.kind)}${this.flags?` (${Mt(this.flags)})`:""}`}},__debugKind:{get(){return Ot(this.kind)}},__debugNodeFlags:{get(){return Mt(this.flags)}},__debugModifierFlags:{get(){return Qe(Q2(this))}},__debugTransformFlags:{get(){return qn(this.transformFlags)}},__debugIsParseTreeNode:{get(){return hl(this)}},__debugEmitFlags:{get(){return $t(za(this))}},__debugGetText:{value(He){if(La(this))return"";let Ke=se.get(this);if(Ke===void 0){let st=gg(this),Dt=st&&hi(st);Ke=Dt?Rd(Dt,st,He):"",se.set(this,Ke)}return Ke}}});cn=!0}e.enableDebugInfo=zn;function Fn(L){let se=L&7,fe=se===0?"in out":se===3?"[bivariant]":se===2?"in":se===1?"out":se===4?"[independent]":"";return L&8?fe+=" (unmeasurable)":L&16&&(fe+=" (unreliable)"),fe}e.formatVariance=Fn;class Nr{__debugToString(){var se;switch(this.kind){case 3:return((se=this.debugInfo)==null?void 0:se.call(this))||"(function mapper)";case 0:return`${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`;case 1:return xd(this.sources,this.targets||Np(this.sources,()=>"any"),(fe,Te)=>`${fe.__debugTypeToString()} -> ${typeof Te=="string"?Te:Te.__debugTypeToString()}`).join(", ");case 2:return xd(this.sources,this.targets,(fe,Te)=>`${fe.__debugTypeToString()} -> ${Te().__debugTypeToString()}`).join(", ");case 5:case 4:return`m1: ${this.mapper1.__debugToString().split(` +`).join(` + `)} +m2: ${this.mapper2.__debugToString().split(` +`).join(` + `)}`;default:return Oe(this)}}}e.DebugTypeMapper=Nr;function Vn(L){return e.isDebugging?Object.setPrototypeOf(L,Nr.prototype):L}e.attachDebugPrototypeIfDebug=Vn;function Ce(L){return console.log(mr(L))}e.printControlFlowGraph=Ce;function mr(L){let se=-1;function fe(u){return u.id||(u.id=se,se--),u.id}let Te;(u=>{u.lr="\u2500",u.ud="\u2502",u.dr="\u256D",u.dl="\u256E",u.ul="\u256F",u.ur="\u2570",u.udr="\u251C",u.udl="\u2524",u.dlr="\u252C",u.ulr="\u2534",u.udlr="\u256B"})(Te||(Te={}));let He;(u=>{u[u.None=0]="None",u[u.Up=1]="Up",u[u.Down=2]="Down",u[u.Left=4]="Left",u[u.Right=8]="Right",u[u.UpDown=3]="UpDown",u[u.LeftRight=12]="LeftRight",u[u.UpLeft=5]="UpLeft",u[u.UpRight=9]="UpRight",u[u.DownLeft=6]="DownLeft",u[u.DownRight=10]="DownRight",u[u.UpDownLeft=7]="UpDownLeft",u[u.UpDownRight=11]="UpDownRight",u[u.UpLeftRight=13]="UpLeftRight",u[u.DownLeftRight=14]="DownLeftRight",u[u.UpDownLeftRight=15]="UpDownLeftRight",u[u.NoChildren=16]="NoChildren"})(He||(He={}));let Ke=2032,st=882,Dt=Object.create(null),Tt=[],ut=[],Ir=Se(L,new Set);for(let u of Tt)u.text=rt(u.flowNode,u.circular),be(u);let hr=We(Ir),Mn=Ze(hr);return Ye(Ir,0),ln();function Wn(u){return!!(u.flags&128)}function Si(u){return!!(u.flags&12)&&!!u.antecedent}function R(u){return!!(u.flags&Ke)}function $(u){return!!(u.flags&st)}function K(u){let Ne=[];for(let Me of u.edges)Me.source===u&&Ne.push(Me.target);return Ne}function xe(u){let Ne=[];for(let Me of u.edges)Me.target===u&&Ne.push(Me.source);return Ne}function Se(u,Ne){let Me=fe(u),U=Dt[Me];if(U&&Ne.has(u))return U.circular=!0,U={id:-1,flowNode:u,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:"circularity"},Tt.push(U),U;if(Ne.add(u),!U)if(Dt[Me]=U={id:Me,flowNode:u,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:!1},Tt.push(U),Si(u))for(let ze of u.antecedent)we(U,ze,Ne);else R(u)&&we(U,u.antecedent,Ne);return Ne.delete(u),U}function we(u,Ne,Me){let U=Se(Ne,Me),ze={source:u,target:U};ut.push(ze),u.edges.push(ze),U.edges.push(ze)}function be(u){if(u.level!==-1)return u.level;let Ne=0;for(let Me of xe(u))Ne=Math.max(Ne,be(Me)+1);return u.level=Ne}function We(u){let Ne=0;for(let Me of K(u))Ne=Math.max(Ne,We(Me));return Ne+1}function Ze(u){let Ne=J(Array(u),0);for(let Me of Tt)Ne[Me.level]=Math.max(Ne[Me.level],Me.text.length);return Ne}function Ye(u,Ne){if(u.lane===-1){u.lane=Ne,u.endLane=Ne;let Me=K(u);for(let U=0;U0&&Ne++;let ze=Me[U];Ye(ze,Ne),ze.endLane>u.endLane&&(Ne=ze.endLane)}u.endLane=Ne}}function Ee(u){if(u&2)return"Start";if(u&4)return"Branch";if(u&8)return"Loop";if(u&16)return"Assignment";if(u&32)return"True";if(u&64)return"False";if(u&128)return"SwitchClause";if(u&256)return"ArrayMutation";if(u&512)return"Call";if(u&1024)return"ReduceLabel";if(u&1)return"Unreachable";throw new Error}function Tn(u){let Ne=hi(u);return Rd(Ne,u,!1)}function rt(u,Ne){let Me=Ee(u.flags);if(Ne&&(Me=`${Me}#${fe(u)}`),Wn(u)){let U=[],{switchStatement:ze,clauseStart:an,clauseEnd:Ve}=u.node;for(let $e=an;$eVe.lane)+1,Me=J(Array(Ne),""),U=Mn.map(()=>Array(Ne)),ze=Mn.map(()=>J(Array(Ne),0));for(let Ve of Tt){U[Ve.level][Ve.lane]=Ve;let $e=K(Ve);for(let kt=0;kt<$e.length;kt++){let Nt=$e[kt],qt=8;Nt.lane===Ve.lane&&(qt|=4),kt>0&&(qt|=1),kt<$e.length-1&&(qt|=2),ze[Ve.level][Nt.lane]|=qt}$e.length===0&&(ze[Ve.level][Ve.lane]|=16);let Pt=xe(Ve);for(let kt=0;kt0&&(qt|=1),kt0?ze[Ve-1][$e]:0,kt=$e>0?ze[Ve][$e-1]:0,Nt=ze[Ve][$e];Nt||(Pt&8&&(Nt|=12),kt&2&&(Nt|=3),ze[Ve][$e]=Nt)}for(let Ve=0;Ve0?u.repeat(Ne):"";let Me="";for(;Me.length{},Oy=()=>{},sl,Ie=(e=>(e[e.Unknown=0]="Unknown",e[e.EndOfFileToken=1]="EndOfFileToken",e[e.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",e[e.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",e[e.NewLineTrivia=4]="NewLineTrivia",e[e.WhitespaceTrivia=5]="WhitespaceTrivia",e[e.ShebangTrivia=6]="ShebangTrivia",e[e.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",e[e.NonTextFileMarkerTrivia=8]="NonTextFileMarkerTrivia",e[e.NumericLiteral=9]="NumericLiteral",e[e.BigIntLiteral=10]="BigIntLiteral",e[e.StringLiteral=11]="StringLiteral",e[e.JsxText=12]="JsxText",e[e.JsxTextAllWhiteSpaces=13]="JsxTextAllWhiteSpaces",e[e.RegularExpressionLiteral=14]="RegularExpressionLiteral",e[e.NoSubstitutionTemplateLiteral=15]="NoSubstitutionTemplateLiteral",e[e.TemplateHead=16]="TemplateHead",e[e.TemplateMiddle=17]="TemplateMiddle",e[e.TemplateTail=18]="TemplateTail",e[e.OpenBraceToken=19]="OpenBraceToken",e[e.CloseBraceToken=20]="CloseBraceToken",e[e.OpenParenToken=21]="OpenParenToken",e[e.CloseParenToken=22]="CloseParenToken",e[e.OpenBracketToken=23]="OpenBracketToken",e[e.CloseBracketToken=24]="CloseBracketToken",e[e.DotToken=25]="DotToken",e[e.DotDotDotToken=26]="DotDotDotToken",e[e.SemicolonToken=27]="SemicolonToken",e[e.CommaToken=28]="CommaToken",e[e.QuestionDotToken=29]="QuestionDotToken",e[e.LessThanToken=30]="LessThanToken",e[e.LessThanSlashToken=31]="LessThanSlashToken",e[e.GreaterThanToken=32]="GreaterThanToken",e[e.LessThanEqualsToken=33]="LessThanEqualsToken",e[e.GreaterThanEqualsToken=34]="GreaterThanEqualsToken",e[e.EqualsEqualsToken=35]="EqualsEqualsToken",e[e.ExclamationEqualsToken=36]="ExclamationEqualsToken",e[e.EqualsEqualsEqualsToken=37]="EqualsEqualsEqualsToken",e[e.ExclamationEqualsEqualsToken=38]="ExclamationEqualsEqualsToken",e[e.EqualsGreaterThanToken=39]="EqualsGreaterThanToken",e[e.PlusToken=40]="PlusToken",e[e.MinusToken=41]="MinusToken",e[e.AsteriskToken=42]="AsteriskToken",e[e.AsteriskAsteriskToken=43]="AsteriskAsteriskToken",e[e.SlashToken=44]="SlashToken",e[e.PercentToken=45]="PercentToken",e[e.PlusPlusToken=46]="PlusPlusToken",e[e.MinusMinusToken=47]="MinusMinusToken",e[e.LessThanLessThanToken=48]="LessThanLessThanToken",e[e.GreaterThanGreaterThanToken=49]="GreaterThanGreaterThanToken",e[e.GreaterThanGreaterThanGreaterThanToken=50]="GreaterThanGreaterThanGreaterThanToken",e[e.AmpersandToken=51]="AmpersandToken",e[e.BarToken=52]="BarToken",e[e.CaretToken=53]="CaretToken",e[e.ExclamationToken=54]="ExclamationToken",e[e.TildeToken=55]="TildeToken",e[e.AmpersandAmpersandToken=56]="AmpersandAmpersandToken",e[e.BarBarToken=57]="BarBarToken",e[e.QuestionToken=58]="QuestionToken",e[e.ColonToken=59]="ColonToken",e[e.AtToken=60]="AtToken",e[e.QuestionQuestionToken=61]="QuestionQuestionToken",e[e.BacktickToken=62]="BacktickToken",e[e.HashToken=63]="HashToken",e[e.EqualsToken=64]="EqualsToken",e[e.PlusEqualsToken=65]="PlusEqualsToken",e[e.MinusEqualsToken=66]="MinusEqualsToken",e[e.AsteriskEqualsToken=67]="AsteriskEqualsToken",e[e.AsteriskAsteriskEqualsToken=68]="AsteriskAsteriskEqualsToken",e[e.SlashEqualsToken=69]="SlashEqualsToken",e[e.PercentEqualsToken=70]="PercentEqualsToken",e[e.LessThanLessThanEqualsToken=71]="LessThanLessThanEqualsToken",e[e.GreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanEqualsToken",e[e.GreaterThanGreaterThanGreaterThanEqualsToken=73]="GreaterThanGreaterThanGreaterThanEqualsToken",e[e.AmpersandEqualsToken=74]="AmpersandEqualsToken",e[e.BarEqualsToken=75]="BarEqualsToken",e[e.BarBarEqualsToken=76]="BarBarEqualsToken",e[e.AmpersandAmpersandEqualsToken=77]="AmpersandAmpersandEqualsToken",e[e.QuestionQuestionEqualsToken=78]="QuestionQuestionEqualsToken",e[e.CaretEqualsToken=79]="CaretEqualsToken",e[e.Identifier=80]="Identifier",e[e.PrivateIdentifier=81]="PrivateIdentifier",e[e.JSDocCommentTextToken=82]="JSDocCommentTextToken",e[e.BreakKeyword=83]="BreakKeyword",e[e.CaseKeyword=84]="CaseKeyword",e[e.CatchKeyword=85]="CatchKeyword",e[e.ClassKeyword=86]="ClassKeyword",e[e.ConstKeyword=87]="ConstKeyword",e[e.ContinueKeyword=88]="ContinueKeyword",e[e.DebuggerKeyword=89]="DebuggerKeyword",e[e.DefaultKeyword=90]="DefaultKeyword",e[e.DeleteKeyword=91]="DeleteKeyword",e[e.DoKeyword=92]="DoKeyword",e[e.ElseKeyword=93]="ElseKeyword",e[e.EnumKeyword=94]="EnumKeyword",e[e.ExportKeyword=95]="ExportKeyword",e[e.ExtendsKeyword=96]="ExtendsKeyword",e[e.FalseKeyword=97]="FalseKeyword",e[e.FinallyKeyword=98]="FinallyKeyword",e[e.ForKeyword=99]="ForKeyword",e[e.FunctionKeyword=100]="FunctionKeyword",e[e.IfKeyword=101]="IfKeyword",e[e.ImportKeyword=102]="ImportKeyword",e[e.InKeyword=103]="InKeyword",e[e.InstanceOfKeyword=104]="InstanceOfKeyword",e[e.NewKeyword=105]="NewKeyword",e[e.NullKeyword=106]="NullKeyword",e[e.ReturnKeyword=107]="ReturnKeyword",e[e.SuperKeyword=108]="SuperKeyword",e[e.SwitchKeyword=109]="SwitchKeyword",e[e.ThisKeyword=110]="ThisKeyword",e[e.ThrowKeyword=111]="ThrowKeyword",e[e.TrueKeyword=112]="TrueKeyword",e[e.TryKeyword=113]="TryKeyword",e[e.TypeOfKeyword=114]="TypeOfKeyword",e[e.VarKeyword=115]="VarKeyword",e[e.VoidKeyword=116]="VoidKeyword",e[e.WhileKeyword=117]="WhileKeyword",e[e.WithKeyword=118]="WithKeyword",e[e.ImplementsKeyword=119]="ImplementsKeyword",e[e.InterfaceKeyword=120]="InterfaceKeyword",e[e.LetKeyword=121]="LetKeyword",e[e.PackageKeyword=122]="PackageKeyword",e[e.PrivateKeyword=123]="PrivateKeyword",e[e.ProtectedKeyword=124]="ProtectedKeyword",e[e.PublicKeyword=125]="PublicKeyword",e[e.StaticKeyword=126]="StaticKeyword",e[e.YieldKeyword=127]="YieldKeyword",e[e.AbstractKeyword=128]="AbstractKeyword",e[e.AccessorKeyword=129]="AccessorKeyword",e[e.AsKeyword=130]="AsKeyword",e[e.AssertsKeyword=131]="AssertsKeyword",e[e.AssertKeyword=132]="AssertKeyword",e[e.AnyKeyword=133]="AnyKeyword",e[e.AsyncKeyword=134]="AsyncKeyword",e[e.AwaitKeyword=135]="AwaitKeyword",e[e.BooleanKeyword=136]="BooleanKeyword",e[e.ConstructorKeyword=137]="ConstructorKeyword",e[e.DeclareKeyword=138]="DeclareKeyword",e[e.GetKeyword=139]="GetKeyword",e[e.InferKeyword=140]="InferKeyword",e[e.IntrinsicKeyword=141]="IntrinsicKeyword",e[e.IsKeyword=142]="IsKeyword",e[e.KeyOfKeyword=143]="KeyOfKeyword",e[e.ModuleKeyword=144]="ModuleKeyword",e[e.NamespaceKeyword=145]="NamespaceKeyword",e[e.NeverKeyword=146]="NeverKeyword",e[e.OutKeyword=147]="OutKeyword",e[e.ReadonlyKeyword=148]="ReadonlyKeyword",e[e.RequireKeyword=149]="RequireKeyword",e[e.NumberKeyword=150]="NumberKeyword",e[e.ObjectKeyword=151]="ObjectKeyword",e[e.SatisfiesKeyword=152]="SatisfiesKeyword",e[e.SetKeyword=153]="SetKeyword",e[e.StringKeyword=154]="StringKeyword",e[e.SymbolKeyword=155]="SymbolKeyword",e[e.TypeKeyword=156]="TypeKeyword",e[e.UndefinedKeyword=157]="UndefinedKeyword",e[e.UniqueKeyword=158]="UniqueKeyword",e[e.UnknownKeyword=159]="UnknownKeyword",e[e.UsingKeyword=160]="UsingKeyword",e[e.FromKeyword=161]="FromKeyword",e[e.GlobalKeyword=162]="GlobalKeyword",e[e.BigIntKeyword=163]="BigIntKeyword",e[e.OverrideKeyword=164]="OverrideKeyword",e[e.OfKeyword=165]="OfKeyword",e[e.QualifiedName=166]="QualifiedName",e[e.ComputedPropertyName=167]="ComputedPropertyName",e[e.TypeParameter=168]="TypeParameter",e[e.Parameter=169]="Parameter",e[e.Decorator=170]="Decorator",e[e.PropertySignature=171]="PropertySignature",e[e.PropertyDeclaration=172]="PropertyDeclaration",e[e.MethodSignature=173]="MethodSignature",e[e.MethodDeclaration=174]="MethodDeclaration",e[e.ClassStaticBlockDeclaration=175]="ClassStaticBlockDeclaration",e[e.Constructor=176]="Constructor",e[e.GetAccessor=177]="GetAccessor",e[e.SetAccessor=178]="SetAccessor",e[e.CallSignature=179]="CallSignature",e[e.ConstructSignature=180]="ConstructSignature",e[e.IndexSignature=181]="IndexSignature",e[e.TypePredicate=182]="TypePredicate",e[e.TypeReference=183]="TypeReference",e[e.FunctionType=184]="FunctionType",e[e.ConstructorType=185]="ConstructorType",e[e.TypeQuery=186]="TypeQuery",e[e.TypeLiteral=187]="TypeLiteral",e[e.ArrayType=188]="ArrayType",e[e.TupleType=189]="TupleType",e[e.OptionalType=190]="OptionalType",e[e.RestType=191]="RestType",e[e.UnionType=192]="UnionType",e[e.IntersectionType=193]="IntersectionType",e[e.ConditionalType=194]="ConditionalType",e[e.InferType=195]="InferType",e[e.ParenthesizedType=196]="ParenthesizedType",e[e.ThisType=197]="ThisType",e[e.TypeOperator=198]="TypeOperator",e[e.IndexedAccessType=199]="IndexedAccessType",e[e.MappedType=200]="MappedType",e[e.LiteralType=201]="LiteralType",e[e.NamedTupleMember=202]="NamedTupleMember",e[e.TemplateLiteralType=203]="TemplateLiteralType",e[e.TemplateLiteralTypeSpan=204]="TemplateLiteralTypeSpan",e[e.ImportType=205]="ImportType",e[e.ObjectBindingPattern=206]="ObjectBindingPattern",e[e.ArrayBindingPattern=207]="ArrayBindingPattern",e[e.BindingElement=208]="BindingElement",e[e.ArrayLiteralExpression=209]="ArrayLiteralExpression",e[e.ObjectLiteralExpression=210]="ObjectLiteralExpression",e[e.PropertyAccessExpression=211]="PropertyAccessExpression",e[e.ElementAccessExpression=212]="ElementAccessExpression",e[e.CallExpression=213]="CallExpression",e[e.NewExpression=214]="NewExpression",e[e.TaggedTemplateExpression=215]="TaggedTemplateExpression",e[e.TypeAssertionExpression=216]="TypeAssertionExpression",e[e.ParenthesizedExpression=217]="ParenthesizedExpression",e[e.FunctionExpression=218]="FunctionExpression",e[e.ArrowFunction=219]="ArrowFunction",e[e.DeleteExpression=220]="DeleteExpression",e[e.TypeOfExpression=221]="TypeOfExpression",e[e.VoidExpression=222]="VoidExpression",e[e.AwaitExpression=223]="AwaitExpression",e[e.PrefixUnaryExpression=224]="PrefixUnaryExpression",e[e.PostfixUnaryExpression=225]="PostfixUnaryExpression",e[e.BinaryExpression=226]="BinaryExpression",e[e.ConditionalExpression=227]="ConditionalExpression",e[e.TemplateExpression=228]="TemplateExpression",e[e.YieldExpression=229]="YieldExpression",e[e.SpreadElement=230]="SpreadElement",e[e.ClassExpression=231]="ClassExpression",e[e.OmittedExpression=232]="OmittedExpression",e[e.ExpressionWithTypeArguments=233]="ExpressionWithTypeArguments",e[e.AsExpression=234]="AsExpression",e[e.NonNullExpression=235]="NonNullExpression",e[e.MetaProperty=236]="MetaProperty",e[e.SyntheticExpression=237]="SyntheticExpression",e[e.SatisfiesExpression=238]="SatisfiesExpression",e[e.TemplateSpan=239]="TemplateSpan",e[e.SemicolonClassElement=240]="SemicolonClassElement",e[e.Block=241]="Block",e[e.EmptyStatement=242]="EmptyStatement",e[e.VariableStatement=243]="VariableStatement",e[e.ExpressionStatement=244]="ExpressionStatement",e[e.IfStatement=245]="IfStatement",e[e.DoStatement=246]="DoStatement",e[e.WhileStatement=247]="WhileStatement",e[e.ForStatement=248]="ForStatement",e[e.ForInStatement=249]="ForInStatement",e[e.ForOfStatement=250]="ForOfStatement",e[e.ContinueStatement=251]="ContinueStatement",e[e.BreakStatement=252]="BreakStatement",e[e.ReturnStatement=253]="ReturnStatement",e[e.WithStatement=254]="WithStatement",e[e.SwitchStatement=255]="SwitchStatement",e[e.LabeledStatement=256]="LabeledStatement",e[e.ThrowStatement=257]="ThrowStatement",e[e.TryStatement=258]="TryStatement",e[e.DebuggerStatement=259]="DebuggerStatement",e[e.VariableDeclaration=260]="VariableDeclaration",e[e.VariableDeclarationList=261]="VariableDeclarationList",e[e.FunctionDeclaration=262]="FunctionDeclaration",e[e.ClassDeclaration=263]="ClassDeclaration",e[e.InterfaceDeclaration=264]="InterfaceDeclaration",e[e.TypeAliasDeclaration=265]="TypeAliasDeclaration",e[e.EnumDeclaration=266]="EnumDeclaration",e[e.ModuleDeclaration=267]="ModuleDeclaration",e[e.ModuleBlock=268]="ModuleBlock",e[e.CaseBlock=269]="CaseBlock",e[e.NamespaceExportDeclaration=270]="NamespaceExportDeclaration",e[e.ImportEqualsDeclaration=271]="ImportEqualsDeclaration",e[e.ImportDeclaration=272]="ImportDeclaration",e[e.ImportClause=273]="ImportClause",e[e.NamespaceImport=274]="NamespaceImport",e[e.NamedImports=275]="NamedImports",e[e.ImportSpecifier=276]="ImportSpecifier",e[e.ExportAssignment=277]="ExportAssignment",e[e.ExportDeclaration=278]="ExportDeclaration",e[e.NamedExports=279]="NamedExports",e[e.NamespaceExport=280]="NamespaceExport",e[e.ExportSpecifier=281]="ExportSpecifier",e[e.MissingDeclaration=282]="MissingDeclaration",e[e.ExternalModuleReference=283]="ExternalModuleReference",e[e.JsxElement=284]="JsxElement",e[e.JsxSelfClosingElement=285]="JsxSelfClosingElement",e[e.JsxOpeningElement=286]="JsxOpeningElement",e[e.JsxClosingElement=287]="JsxClosingElement",e[e.JsxFragment=288]="JsxFragment",e[e.JsxOpeningFragment=289]="JsxOpeningFragment",e[e.JsxClosingFragment=290]="JsxClosingFragment",e[e.JsxAttribute=291]="JsxAttribute",e[e.JsxAttributes=292]="JsxAttributes",e[e.JsxSpreadAttribute=293]="JsxSpreadAttribute",e[e.JsxExpression=294]="JsxExpression",e[e.JsxNamespacedName=295]="JsxNamespacedName",e[e.CaseClause=296]="CaseClause",e[e.DefaultClause=297]="DefaultClause",e[e.HeritageClause=298]="HeritageClause",e[e.CatchClause=299]="CatchClause",e[e.ImportAttributes=300]="ImportAttributes",e[e.ImportAttribute=301]="ImportAttribute",e[e.AssertClause=300]="AssertClause",e[e.AssertEntry=301]="AssertEntry",e[e.ImportTypeAssertionContainer=302]="ImportTypeAssertionContainer",e[e.PropertyAssignment=303]="PropertyAssignment",e[e.ShorthandPropertyAssignment=304]="ShorthandPropertyAssignment",e[e.SpreadAssignment=305]="SpreadAssignment",e[e.EnumMember=306]="EnumMember",e[e.SourceFile=307]="SourceFile",e[e.Bundle=308]="Bundle",e[e.JSDocTypeExpression=309]="JSDocTypeExpression",e[e.JSDocNameReference=310]="JSDocNameReference",e[e.JSDocMemberName=311]="JSDocMemberName",e[e.JSDocAllType=312]="JSDocAllType",e[e.JSDocUnknownType=313]="JSDocUnknownType",e[e.JSDocNullableType=314]="JSDocNullableType",e[e.JSDocNonNullableType=315]="JSDocNonNullableType",e[e.JSDocOptionalType=316]="JSDocOptionalType",e[e.JSDocFunctionType=317]="JSDocFunctionType",e[e.JSDocVariadicType=318]="JSDocVariadicType",e[e.JSDocNamepathType=319]="JSDocNamepathType",e[e.JSDoc=320]="JSDoc",e[e.JSDocComment=320]="JSDocComment",e[e.JSDocText=321]="JSDocText",e[e.JSDocTypeLiteral=322]="JSDocTypeLiteral",e[e.JSDocSignature=323]="JSDocSignature",e[e.JSDocLink=324]="JSDocLink",e[e.JSDocLinkCode=325]="JSDocLinkCode",e[e.JSDocLinkPlain=326]="JSDocLinkPlain",e[e.JSDocTag=327]="JSDocTag",e[e.JSDocAugmentsTag=328]="JSDocAugmentsTag",e[e.JSDocImplementsTag=329]="JSDocImplementsTag",e[e.JSDocAuthorTag=330]="JSDocAuthorTag",e[e.JSDocDeprecatedTag=331]="JSDocDeprecatedTag",e[e.JSDocClassTag=332]="JSDocClassTag",e[e.JSDocPublicTag=333]="JSDocPublicTag",e[e.JSDocPrivateTag=334]="JSDocPrivateTag",e[e.JSDocProtectedTag=335]="JSDocProtectedTag",e[e.JSDocReadonlyTag=336]="JSDocReadonlyTag",e[e.JSDocOverrideTag=337]="JSDocOverrideTag",e[e.JSDocCallbackTag=338]="JSDocCallbackTag",e[e.JSDocOverloadTag=339]="JSDocOverloadTag",e[e.JSDocEnumTag=340]="JSDocEnumTag",e[e.JSDocParameterTag=341]="JSDocParameterTag",e[e.JSDocReturnTag=342]="JSDocReturnTag",e[e.JSDocThisTag=343]="JSDocThisTag",e[e.JSDocTypeTag=344]="JSDocTypeTag",e[e.JSDocTemplateTag=345]="JSDocTemplateTag",e[e.JSDocTypedefTag=346]="JSDocTypedefTag",e[e.JSDocSeeTag=347]="JSDocSeeTag",e[e.JSDocPropertyTag=348]="JSDocPropertyTag",e[e.JSDocThrowsTag=349]="JSDocThrowsTag",e[e.JSDocSatisfiesTag=350]="JSDocSatisfiesTag",e[e.JSDocImportTag=351]="JSDocImportTag",e[e.SyntaxList=352]="SyntaxList",e[e.NotEmittedStatement=353]="NotEmittedStatement",e[e.NotEmittedTypeElement=354]="NotEmittedTypeElement",e[e.PartiallyEmittedExpression=355]="PartiallyEmittedExpression",e[e.CommaListExpression=356]="CommaListExpression",e[e.SyntheticReferenceExpression=357]="SyntheticReferenceExpression",e[e.Count=358]="Count",e[e.FirstAssignment=64]="FirstAssignment",e[e.LastAssignment=79]="LastAssignment",e[e.FirstCompoundAssignment=65]="FirstCompoundAssignment",e[e.LastCompoundAssignment=79]="LastCompoundAssignment",e[e.FirstReservedWord=83]="FirstReservedWord",e[e.LastReservedWord=118]="LastReservedWord",e[e.FirstKeyword=83]="FirstKeyword",e[e.LastKeyword=165]="LastKeyword",e[e.FirstFutureReservedWord=119]="FirstFutureReservedWord",e[e.LastFutureReservedWord=127]="LastFutureReservedWord",e[e.FirstTypeNode=182]="FirstTypeNode",e[e.LastTypeNode=205]="LastTypeNode",e[e.FirstPunctuation=19]="FirstPunctuation",e[e.LastPunctuation=79]="LastPunctuation",e[e.FirstToken=0]="FirstToken",e[e.LastToken=165]="LastToken",e[e.FirstTriviaToken=2]="FirstTriviaToken",e[e.LastTriviaToken=7]="LastTriviaToken",e[e.FirstLiteralToken=9]="FirstLiteralToken",e[e.LastLiteralToken=15]="LastLiteralToken",e[e.FirstTemplateToken=15]="FirstTemplateToken",e[e.LastTemplateToken=18]="LastTemplateToken",e[e.FirstBinaryOperator=30]="FirstBinaryOperator",e[e.LastBinaryOperator=79]="LastBinaryOperator",e[e.FirstStatement=243]="FirstStatement",e[e.LastStatement=259]="LastStatement",e[e.FirstNode=166]="FirstNode",e[e.FirstJSDocNode=309]="FirstJSDocNode",e[e.LastJSDocNode=351]="LastJSDocNode",e[e.FirstJSDocTagNode=327]="FirstJSDocTagNode",e[e.LastJSDocTagNode=351]="LastJSDocTagNode",e[e.FirstContextualKeyword=128]="FirstContextualKeyword",e[e.LastContextualKeyword=165]="LastContextualKeyword",e))(Ie||{}),on=(e=>(e[e.None=0]="None",e[e.Let=1]="Let",e[e.Const=2]="Const",e[e.Using=4]="Using",e[e.AwaitUsing=6]="AwaitUsing",e[e.NestedNamespace=8]="NestedNamespace",e[e.Synthesized=16]="Synthesized",e[e.Namespace=32]="Namespace",e[e.OptionalChain=64]="OptionalChain",e[e.ExportContext=128]="ExportContext",e[e.ContainsThis=256]="ContainsThis",e[e.HasImplicitReturn=512]="HasImplicitReturn",e[e.HasExplicitReturn=1024]="HasExplicitReturn",e[e.GlobalAugmentation=2048]="GlobalAugmentation",e[e.HasAsyncFunctions=4096]="HasAsyncFunctions",e[e.DisallowInContext=8192]="DisallowInContext",e[e.YieldContext=16384]="YieldContext",e[e.DecoratorContext=32768]="DecoratorContext",e[e.AwaitContext=65536]="AwaitContext",e[e.DisallowConditionalTypesContext=131072]="DisallowConditionalTypesContext",e[e.ThisNodeHasError=262144]="ThisNodeHasError",e[e.JavaScriptFile=524288]="JavaScriptFile",e[e.ThisNodeOrAnySubNodesHasError=1048576]="ThisNodeOrAnySubNodesHasError",e[e.HasAggregatedChildData=2097152]="HasAggregatedChildData",e[e.PossiblyContainsDynamicImport=4194304]="PossiblyContainsDynamicImport",e[e.PossiblyContainsImportMeta=8388608]="PossiblyContainsImportMeta",e[e.JSDoc=16777216]="JSDoc",e[e.Ambient=33554432]="Ambient",e[e.InWithStatement=67108864]="InWithStatement",e[e.JsonFile=134217728]="JsonFile",e[e.TypeCached=268435456]="TypeCached",e[e.Deprecated=536870912]="Deprecated",e[e.BlockScoped=7]="BlockScoped",e[e.Constant=6]="Constant",e[e.ReachabilityCheckFlags=1536]="ReachabilityCheckFlags",e[e.ReachabilityAndEmitFlags=5632]="ReachabilityAndEmitFlags",e[e.ContextFlags=101441536]="ContextFlags",e[e.TypeExcludesFlags=81920]="TypeExcludesFlags",e[e.PermanentlySetIncrementalFlags=12582912]="PermanentlySetIncrementalFlags",e[e.IdentifierHasExtendedUnicodeEscape=256]="IdentifierHasExtendedUnicodeEscape",e[e.IdentifierIsInJSDocNamespace=4096]="IdentifierIsInJSDocNamespace",e))(on||{}),Kp=(e=>(e[e.None=0]="None",e[e.Public=1]="Public",e[e.Private=2]="Private",e[e.Protected=4]="Protected",e[e.Readonly=8]="Readonly",e[e.Override=16]="Override",e[e.Export=32]="Export",e[e.Abstract=64]="Abstract",e[e.Ambient=128]="Ambient",e[e.Static=256]="Static",e[e.Accessor=512]="Accessor",e[e.Async=1024]="Async",e[e.Default=2048]="Default",e[e.Const=4096]="Const",e[e.In=8192]="In",e[e.Out=16384]="Out",e[e.Decorator=32768]="Decorator",e[e.Deprecated=65536]="Deprecated",e[e.JSDocPublic=8388608]="JSDocPublic",e[e.JSDocPrivate=16777216]="JSDocPrivate",e[e.JSDocProtected=33554432]="JSDocProtected",e[e.JSDocReadonly=67108864]="JSDocReadonly",e[e.JSDocOverride=134217728]="JSDocOverride",e[e.SyntacticOrJSDocModifiers=31]="SyntacticOrJSDocModifiers",e[e.SyntacticOnlyModifiers=65504]="SyntacticOnlyModifiers",e[e.SyntacticModifiers=65535]="SyntacticModifiers",e[e.JSDocCacheOnlyModifiers=260046848]="JSDocCacheOnlyModifiers",e[e.JSDocOnlyModifiers=65536]="JSDocOnlyModifiers",e[e.NonCacheOnlyModifiers=131071]="NonCacheOnlyModifiers",e[e.HasComputedJSDocModifiers=268435456]="HasComputedJSDocModifiers",e[e.HasComputedFlags=536870912]="HasComputedFlags",e[e.AccessibilityModifier=7]="AccessibilityModifier",e[e.ParameterPropertyModifier=31]="ParameterPropertyModifier",e[e.NonPublicAccessibilityModifier=6]="NonPublicAccessibilityModifier",e[e.TypeScriptModifier=28895]="TypeScriptModifier",e[e.ExportDefault=2080]="ExportDefault",e[e.All=131071]="All",e[e.Modifier=98303]="Modifier",e))(Kp||{});var Dm=(e=>(e[e.None=0]="None",e[e.Succeeded=1]="Succeeded",e[e.Failed=2]="Failed",e[e.ReportsUnmeasurable=8]="ReportsUnmeasurable",e[e.ReportsUnreliable=16]="ReportsUnreliable",e[e.ReportsMask=24]="ReportsMask",e[e.ComplexityOverflow=32]="ComplexityOverflow",e[e.StackDepthOverflow=64]="StackDepthOverflow",e[e.Overflow=96]="Overflow",e))(Dm||{});var Mp=(e=>(e[e.Unreachable=1]="Unreachable",e[e.Start=2]="Start",e[e.BranchLabel=4]="BranchLabel",e[e.LoopLabel=8]="LoopLabel",e[e.Assignment=16]="Assignment",e[e.TrueCondition=32]="TrueCondition",e[e.FalseCondition=64]="FalseCondition",e[e.SwitchClause=128]="SwitchClause",e[e.ArrayMutation=256]="ArrayMutation",e[e.Call=512]="Call",e[e.ReduceLabel=1024]="ReduceLabel",e[e.Referenced=2048]="Referenced",e[e.Shared=4096]="Shared",e[e.Label=12]="Label",e[e.Condition=96]="Condition",e))(Mp||{});var Zp=(e=>(e[e.None=0]="None",e[e.FunctionScopedVariable=1]="FunctionScopedVariable",e[e.BlockScopedVariable=2]="BlockScopedVariable",e[e.Property=4]="Property",e[e.EnumMember=8]="EnumMember",e[e.Function=16]="Function",e[e.Class=32]="Class",e[e.Interface=64]="Interface",e[e.ConstEnum=128]="ConstEnum",e[e.RegularEnum=256]="RegularEnum",e[e.ValueModule=512]="ValueModule",e[e.NamespaceModule=1024]="NamespaceModule",e[e.TypeLiteral=2048]="TypeLiteral",e[e.ObjectLiteral=4096]="ObjectLiteral",e[e.Method=8192]="Method",e[e.Constructor=16384]="Constructor",e[e.GetAccessor=32768]="GetAccessor",e[e.SetAccessor=65536]="SetAccessor",e[e.Signature=131072]="Signature",e[e.TypeParameter=262144]="TypeParameter",e[e.TypeAlias=524288]="TypeAlias",e[e.ExportValue=1048576]="ExportValue",e[e.Alias=2097152]="Alias",e[e.Prototype=4194304]="Prototype",e[e.ExportStar=8388608]="ExportStar",e[e.Optional=16777216]="Optional",e[e.Transient=33554432]="Transient",e[e.Assignment=67108864]="Assignment",e[e.ModuleExports=134217728]="ModuleExports",e[e.All=-1]="All",e[e.Enum=384]="Enum",e[e.Variable=3]="Variable",e[e.Value=111551]="Value",e[e.Type=788968]="Type",e[e.Namespace=1920]="Namespace",e[e.Module=1536]="Module",e[e.Accessor=98304]="Accessor",e[e.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",e[e.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",e[e.ParameterExcludes=111551]="ParameterExcludes",e[e.PropertyExcludes=0]="PropertyExcludes",e[e.EnumMemberExcludes=900095]="EnumMemberExcludes",e[e.FunctionExcludes=110991]="FunctionExcludes",e[e.ClassExcludes=899503]="ClassExcludes",e[e.InterfaceExcludes=788872]="InterfaceExcludes",e[e.RegularEnumExcludes=899327]="RegularEnumExcludes",e[e.ConstEnumExcludes=899967]="ConstEnumExcludes",e[e.ValueModuleExcludes=110735]="ValueModuleExcludes",e[e.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",e[e.MethodExcludes=103359]="MethodExcludes",e[e.GetAccessorExcludes=46015]="GetAccessorExcludes",e[e.SetAccessorExcludes=78783]="SetAccessorExcludes",e[e.AccessorExcludes=13247]="AccessorExcludes",e[e.TypeParameterExcludes=526824]="TypeParameterExcludes",e[e.TypeAliasExcludes=788968]="TypeAliasExcludes",e[e.AliasExcludes=2097152]="AliasExcludes",e[e.ModuleMember=2623475]="ModuleMember",e[e.ExportHasLocal=944]="ExportHasLocal",e[e.BlockScoped=418]="BlockScoped",e[e.PropertyOrAccessor=98308]="PropertyOrAccessor",e[e.ClassMember=106500]="ClassMember",e[e.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",e[e.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",e[e.Classifiable=2885600]="Classifiable",e[e.LateBindingContainer=6256]="LateBindingContainer",e))(Zp||{});var Pm=(e=>(e[e.None=0]="None",e[e.TypeChecked=1]="TypeChecked",e[e.LexicalThis=2]="LexicalThis",e[e.CaptureThis=4]="CaptureThis",e[e.CaptureNewTarget=8]="CaptureNewTarget",e[e.SuperInstance=16]="SuperInstance",e[e.SuperStatic=32]="SuperStatic",e[e.ContextChecked=64]="ContextChecked",e[e.MethodWithSuperPropertyAccessInAsync=128]="MethodWithSuperPropertyAccessInAsync",e[e.MethodWithSuperPropertyAssignmentInAsync=256]="MethodWithSuperPropertyAssignmentInAsync",e[e.CaptureArguments=512]="CaptureArguments",e[e.EnumValuesComputed=1024]="EnumValuesComputed",e[e.LexicalModuleMergesWithClass=2048]="LexicalModuleMergesWithClass",e[e.LoopWithCapturedBlockScopedBinding=4096]="LoopWithCapturedBlockScopedBinding",e[e.ContainsCapturedBlockScopeBinding=8192]="ContainsCapturedBlockScopeBinding",e[e.CapturedBlockScopedBinding=16384]="CapturedBlockScopedBinding",e[e.BlockScopedBindingInLoop=32768]="BlockScopedBindingInLoop",e[e.NeedsLoopOutParameter=65536]="NeedsLoopOutParameter",e[e.AssignmentsMarked=131072]="AssignmentsMarked",e[e.ContainsConstructorReference=262144]="ContainsConstructorReference",e[e.ConstructorReference=536870912]="ConstructorReference",e[e.ContainsClassWithPrivateIdentifiers=1048576]="ContainsClassWithPrivateIdentifiers",e[e.ContainsSuperPropertyInStaticInitializer=2097152]="ContainsSuperPropertyInStaticInitializer",e[e.InCheckIdentifier=4194304]="InCheckIdentifier",e[e.PartiallyTypeChecked=8388608]="PartiallyTypeChecked",e[e.LazyFlags=539358128]="LazyFlags",e))(Pm||{}),nn=(e=>(e[e.Any=1]="Any",e[e.Unknown=2]="Unknown",e[e.String=4]="String",e[e.Number=8]="Number",e[e.Boolean=16]="Boolean",e[e.Enum=32]="Enum",e[e.BigInt=64]="BigInt",e[e.StringLiteral=128]="StringLiteral",e[e.NumberLiteral=256]="NumberLiteral",e[e.BooleanLiteral=512]="BooleanLiteral",e[e.EnumLiteral=1024]="EnumLiteral",e[e.BigIntLiteral=2048]="BigIntLiteral",e[e.ESSymbol=4096]="ESSymbol",e[e.UniqueESSymbol=8192]="UniqueESSymbol",e[e.Void=16384]="Void",e[e.Undefined=32768]="Undefined",e[e.Null=65536]="Null",e[e.Never=131072]="Never",e[e.TypeParameter=262144]="TypeParameter",e[e.Object=524288]="Object",e[e.Union=1048576]="Union",e[e.Intersection=2097152]="Intersection",e[e.Index=4194304]="Index",e[e.IndexedAccess=8388608]="IndexedAccess",e[e.Conditional=16777216]="Conditional",e[e.Substitution=33554432]="Substitution",e[e.NonPrimitive=67108864]="NonPrimitive",e[e.TemplateLiteral=134217728]="TemplateLiteral",e[e.StringMapping=268435456]="StringMapping",e[e.Reserved1=536870912]="Reserved1",e[e.Reserved2=1073741824]="Reserved2",e[e.AnyOrUnknown=3]="AnyOrUnknown",e[e.Nullable=98304]="Nullable",e[e.Literal=2944]="Literal",e[e.Unit=109472]="Unit",e[e.Freshable=2976]="Freshable",e[e.StringOrNumberLiteral=384]="StringOrNumberLiteral",e[e.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",e[e.DefinitelyFalsy=117632]="DefinitelyFalsy",e[e.PossiblyFalsy=117724]="PossiblyFalsy",e[e.Intrinsic=67359327]="Intrinsic",e[e.StringLike=402653316]="StringLike",e[e.NumberLike=296]="NumberLike",e[e.BigIntLike=2112]="BigIntLike",e[e.BooleanLike=528]="BooleanLike",e[e.EnumLike=1056]="EnumLike",e[e.ESSymbolLike=12288]="ESSymbolLike",e[e.VoidLike=49152]="VoidLike",e[e.Primitive=402784252]="Primitive",e[e.DefinitelyNonNullable=470302716]="DefinitelyNonNullable",e[e.DisjointDomains=469892092]="DisjointDomains",e[e.UnionOrIntersection=3145728]="UnionOrIntersection",e[e.StructuredType=3670016]="StructuredType",e[e.TypeVariable=8650752]="TypeVariable",e[e.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",e[e.InstantiablePrimitive=406847488]="InstantiablePrimitive",e[e.Instantiable=465829888]="Instantiable",e[e.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",e[e.ObjectFlagsType=3899393]="ObjectFlagsType",e[e.Simplifiable=25165824]="Simplifiable",e[e.Singleton=67358815]="Singleton",e[e.Narrowable=536624127]="Narrowable",e[e.IncludesMask=473694207]="IncludesMask",e[e.IncludesMissingType=262144]="IncludesMissingType",e[e.IncludesNonWideningType=4194304]="IncludesNonWideningType",e[e.IncludesWildcard=8388608]="IncludesWildcard",e[e.IncludesEmptyObject=16777216]="IncludesEmptyObject",e[e.IncludesInstantiable=33554432]="IncludesInstantiable",e[e.IncludesConstrainedTypeVariable=536870912]="IncludesConstrainedTypeVariable",e[e.IncludesError=1073741824]="IncludesError",e[e.NotPrimitiveUnion=36323331]="NotPrimitiveUnion",e))(nn||{}),ef=(e=>(e[e.None=0]="None",e[e.Class=1]="Class",e[e.Interface=2]="Interface",e[e.Reference=4]="Reference",e[e.Tuple=8]="Tuple",e[e.Anonymous=16]="Anonymous",e[e.Mapped=32]="Mapped",e[e.Instantiated=64]="Instantiated",e[e.ObjectLiteral=128]="ObjectLiteral",e[e.EvolvingArray=256]="EvolvingArray",e[e.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",e[e.ReverseMapped=1024]="ReverseMapped",e[e.JsxAttributes=2048]="JsxAttributes",e[e.JSLiteral=4096]="JSLiteral",e[e.FreshLiteral=8192]="FreshLiteral",e[e.ArrayLiteral=16384]="ArrayLiteral",e[e.PrimitiveUnion=32768]="PrimitiveUnion",e[e.ContainsWideningType=65536]="ContainsWideningType",e[e.ContainsObjectOrArrayLiteral=131072]="ContainsObjectOrArrayLiteral",e[e.NonInferrableType=262144]="NonInferrableType",e[e.CouldContainTypeVariablesComputed=524288]="CouldContainTypeVariablesComputed",e[e.CouldContainTypeVariables=1048576]="CouldContainTypeVariables",e[e.ClassOrInterface=3]="ClassOrInterface",e[e.RequiresWidening=196608]="RequiresWidening",e[e.PropagatingFlags=458752]="PropagatingFlags",e[e.InstantiatedMapped=96]="InstantiatedMapped",e[e.ObjectTypeKindMask=1343]="ObjectTypeKindMask",e[e.ContainsSpread=2097152]="ContainsSpread",e[e.ObjectRestType=4194304]="ObjectRestType",e[e.InstantiationExpressionType=8388608]="InstantiationExpressionType",e[e.SingleSignatureType=134217728]="SingleSignatureType",e[e.IsClassInstanceClone=16777216]="IsClassInstanceClone",e[e.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",e[e.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",e[e.IsGenericTypeComputed=2097152]="IsGenericTypeComputed",e[e.IsGenericObjectType=4194304]="IsGenericObjectType",e[e.IsGenericIndexType=8388608]="IsGenericIndexType",e[e.IsGenericType=12582912]="IsGenericType",e[e.ContainsIntersections=16777216]="ContainsIntersections",e[e.IsUnknownLikeUnionComputed=33554432]="IsUnknownLikeUnionComputed",e[e.IsUnknownLikeUnion=67108864]="IsUnknownLikeUnion",e[e.IsNeverIntersectionComputed=16777216]="IsNeverIntersectionComputed",e[e.IsNeverIntersection=33554432]="IsNeverIntersection",e[e.IsConstrainedTypeVariable=67108864]="IsConstrainedTypeVariable",e))(ef||{});var Nm=(e=>(e[e.None=0]="None",e[e.HasRestParameter=1]="HasRestParameter",e[e.HasLiteralTypes=2]="HasLiteralTypes",e[e.Abstract=4]="Abstract",e[e.IsInnerCallChain=8]="IsInnerCallChain",e[e.IsOuterCallChain=16]="IsOuterCallChain",e[e.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",e[e.IsNonInferrable=64]="IsNonInferrable",e[e.IsSignatureCandidateForOverloadFailure=128]="IsSignatureCandidateForOverloadFailure",e[e.PropagatingFlags=167]="PropagatingFlags",e[e.CallChainFlags=24]="CallChainFlags",e))(Nm||{});var Dr=(e=>(e[e.Unknown=0]="Unknown",e[e.JS=1]="JS",e[e.JSX=2]="JSX",e[e.TS=3]="TS",e[e.TSX=4]="TSX",e[e.External=5]="External",e[e.JSON=6]="JSON",e[e.Deferred=7]="Deferred",e))(Dr||{}),ys=(e=>(e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES2015=2]="ES2015",e[e.ES2016=3]="ES2016",e[e.ES2017=4]="ES2017",e[e.ES2018=5]="ES2018",e[e.ES2019=6]="ES2019",e[e.ES2020=7]="ES2020",e[e.ES2021=8]="ES2021",e[e.ES2022=9]="ES2022",e[e.ES2023=10]="ES2023",e[e.ES2024=11]="ES2024",e[e.ESNext=99]="ESNext",e[e.JSON=100]="JSON",e[e.Latest=99]="Latest",e))(ys||{}),xl=(e=>(e[e.Standard=0]="Standard",e[e.JSX=1]="JSX",e))(xl||{});var Nn=(e=>(e.Ts=".ts",e.Tsx=".tsx",e.Dts=".d.ts",e.Js=".js",e.Jsx=".jsx",e.Json=".json",e.TsBuildInfo=".tsbuildinfo",e.Mjs=".mjs",e.Mts=".mts",e.Dmts=".d.mts",e.Cjs=".cjs",e.Cts=".cts",e.Dcts=".d.cts",e))(Nn||{}),Im=(e=>(e[e.None=0]="None",e[e.ContainsTypeScript=1]="ContainsTypeScript",e[e.ContainsJsx=2]="ContainsJsx",e[e.ContainsESNext=4]="ContainsESNext",e[e.ContainsES2022=8]="ContainsES2022",e[e.ContainsES2021=16]="ContainsES2021",e[e.ContainsES2020=32]="ContainsES2020",e[e.ContainsES2019=64]="ContainsES2019",e[e.ContainsES2018=128]="ContainsES2018",e[e.ContainsES2017=256]="ContainsES2017",e[e.ContainsES2016=512]="ContainsES2016",e[e.ContainsES2015=1024]="ContainsES2015",e[e.ContainsGenerator=2048]="ContainsGenerator",e[e.ContainsDestructuringAssignment=4096]="ContainsDestructuringAssignment",e[e.ContainsTypeScriptClassSyntax=8192]="ContainsTypeScriptClassSyntax",e[e.ContainsLexicalThis=16384]="ContainsLexicalThis",e[e.ContainsRestOrSpread=32768]="ContainsRestOrSpread",e[e.ContainsObjectRestOrSpread=65536]="ContainsObjectRestOrSpread",e[e.ContainsComputedPropertyName=131072]="ContainsComputedPropertyName",e[e.ContainsBlockScopedBinding=262144]="ContainsBlockScopedBinding",e[e.ContainsBindingPattern=524288]="ContainsBindingPattern",e[e.ContainsYield=1048576]="ContainsYield",e[e.ContainsAwait=2097152]="ContainsAwait",e[e.ContainsHoistedDeclarationOrCompletion=4194304]="ContainsHoistedDeclarationOrCompletion",e[e.ContainsDynamicImport=8388608]="ContainsDynamicImport",e[e.ContainsClassFields=16777216]="ContainsClassFields",e[e.ContainsDecorators=33554432]="ContainsDecorators",e[e.ContainsPossibleTopLevelAwait=67108864]="ContainsPossibleTopLevelAwait",e[e.ContainsLexicalSuper=134217728]="ContainsLexicalSuper",e[e.ContainsUpdateExpressionForIdentifier=268435456]="ContainsUpdateExpressionForIdentifier",e[e.ContainsPrivateIdentifierInExpression=536870912]="ContainsPrivateIdentifierInExpression",e[e.HasComputedFlags=-2147483648]="HasComputedFlags",e[e.AssertTypeScript=1]="AssertTypeScript",e[e.AssertJsx=2]="AssertJsx",e[e.AssertESNext=4]="AssertESNext",e[e.AssertES2022=8]="AssertES2022",e[e.AssertES2021=16]="AssertES2021",e[e.AssertES2020=32]="AssertES2020",e[e.AssertES2019=64]="AssertES2019",e[e.AssertES2018=128]="AssertES2018",e[e.AssertES2017=256]="AssertES2017",e[e.AssertES2016=512]="AssertES2016",e[e.AssertES2015=1024]="AssertES2015",e[e.AssertGenerator=2048]="AssertGenerator",e[e.AssertDestructuringAssignment=4096]="AssertDestructuringAssignment",e[e.OuterExpressionExcludes=-2147483648]="OuterExpressionExcludes",e[e.PropertyAccessExcludes=-2147483648]="PropertyAccessExcludes",e[e.NodeExcludes=-2147483648]="NodeExcludes",e[e.ArrowFunctionExcludes=-2072174592]="ArrowFunctionExcludes",e[e.FunctionExcludes=-1937940480]="FunctionExcludes",e[e.ConstructorExcludes=-1937948672]="ConstructorExcludes",e[e.MethodOrAccessorExcludes=-2005057536]="MethodOrAccessorExcludes",e[e.PropertyExcludes=-2013249536]="PropertyExcludes",e[e.ClassExcludes=-2147344384]="ClassExcludes",e[e.ModuleExcludes=-1941676032]="ModuleExcludes",e[e.TypeExcludes=-2]="TypeExcludes",e[e.ObjectLiteralExcludes=-2147278848]="ObjectLiteralExcludes",e[e.ArrayLiteralOrCallOrNewExcludes=-2147450880]="ArrayLiteralOrCallOrNewExcludes",e[e.VariableDeclarationListExcludes=-2146893824]="VariableDeclarationListExcludes",e[e.ParameterExcludes=-2147483648]="ParameterExcludes",e[e.CatchClauseExcludes=-2147418112]="CatchClauseExcludes",e[e.BindingPatternExcludes=-2147450880]="BindingPatternExcludes",e[e.ContainsLexicalThisOrSuper=134234112]="ContainsLexicalThisOrSuper",e[e.PropertyNamePropagatingFlags=134234112]="PropertyNamePropagatingFlags",e))(Im||{}),Om=(e=>(e[e.TabStop=0]="TabStop",e[e.Placeholder=1]="Placeholder",e[e.Choice=2]="Choice",e[e.Variable=3]="Variable",e))(Om||{}),Mm=(e=>(e[e.None=0]="None",e[e.SingleLine=1]="SingleLine",e[e.MultiLine=2]="MultiLine",e[e.AdviseOnEmitNode=4]="AdviseOnEmitNode",e[e.NoSubstitution=8]="NoSubstitution",e[e.CapturesThis=16]="CapturesThis",e[e.NoLeadingSourceMap=32]="NoLeadingSourceMap",e[e.NoTrailingSourceMap=64]="NoTrailingSourceMap",e[e.NoSourceMap=96]="NoSourceMap",e[e.NoNestedSourceMaps=128]="NoNestedSourceMaps",e[e.NoTokenLeadingSourceMaps=256]="NoTokenLeadingSourceMaps",e[e.NoTokenTrailingSourceMaps=512]="NoTokenTrailingSourceMaps",e[e.NoTokenSourceMaps=768]="NoTokenSourceMaps",e[e.NoLeadingComments=1024]="NoLeadingComments",e[e.NoTrailingComments=2048]="NoTrailingComments",e[e.NoComments=3072]="NoComments",e[e.NoNestedComments=4096]="NoNestedComments",e[e.HelperName=8192]="HelperName",e[e.ExportName=16384]="ExportName",e[e.LocalName=32768]="LocalName",e[e.InternalName=65536]="InternalName",e[e.Indented=131072]="Indented",e[e.NoIndentation=262144]="NoIndentation",e[e.AsyncFunctionBody=524288]="AsyncFunctionBody",e[e.ReuseTempVariableScope=1048576]="ReuseTempVariableScope",e[e.CustomPrologue=2097152]="CustomPrologue",e[e.NoHoisting=4194304]="NoHoisting",e[e.Iterator=8388608]="Iterator",e[e.NoAsciiEscaping=16777216]="NoAsciiEscaping",e))(Mm||{});var Q_={Classes:2,ForOf:2,Generators:2,Iteration:2,SpreadElements:2,RestElements:2,TaggedTemplates:2,DestructuringAssignment:2,BindingPatterns:2,ArrowFunctions:2,BlockScopedVariables:2,ObjectAssign:2,RegularExpressionFlagsUnicode:2,RegularExpressionFlagsSticky:2,Exponentiation:3,AsyncFunctions:4,ForAwaitOf:5,AsyncGenerators:5,AsyncIteration:5,ObjectSpreadRest:5,RegularExpressionFlagsDotAll:5,BindinglessCatch:6,BigInt:7,NullishCoalesce:7,OptionalChaining:7,LogicalAssignment:8,TopLevelAwait:9,ClassFields:9,PrivateNamesAndClassStaticBlocks:9,RegularExpressionFlagsHasIndices:9,ShebangComments:10,RegularExpressionFlagsUnicodeSets:11,UsingAndAwaitUsing:99,ClassAndClassElementDecorators:99};var Jm={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0},{name:"resolution-mode",optional:!0},{name:"preserve",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}},Ga=(e=>(e[e.ParseAll=0]="ParseAll",e[e.ParseNone=1]="ParseNone",e[e.ParseForTypeErrors=2]="ParseForTypeErrors",e[e.ParseForTypeInfo=3]="ParseForTypeInfo",e))(Ga||{});var Ki="/",My="\\",kd="://",Jy=/\\/g;function Ly(e){return e===47||e===92}function jy(e,t){return e.length>t.length&&Dy(e,t)}function tf(e){return e.length>0&&Ly(e.charCodeAt(e.length-1))}function Ed(e){return e>=97&&e<=122||e>=65&&e<=90}function Ry(e,t){let a=e.charCodeAt(t);if(a===58)return t+1;if(a===37&&e.charCodeAt(t+1)===51){let o=e.charCodeAt(t+2);if(o===97||o===65)return t+3}return-1}function Uy(e){if(!e)return 0;let t=e.charCodeAt(0);if(t===47||t===92){if(e.charCodeAt(1)!==t)return 1;let o=e.indexOf(t===47?Ki:My,2);return o<0?e.length:o+1}if(Ed(t)&&e.charCodeAt(1)===58){let o=e.charCodeAt(2);if(o===47||o===92)return 3;if(e.length===2)return 2}let a=e.indexOf(kd);if(a!==-1){let o=a+kd.length,m=e.indexOf(Ki,o);if(m!==-1){let v=e.slice(0,a),A=e.slice(o,m);if(v==="file"&&(A===""||A==="localhost")&&Ed(e.charCodeAt(m+1))){let P=Ry(e,m+2);if(P!==-1){if(e.charCodeAt(P)===47)return~(P+1);if(P===e.length)return~P}}return~(m+1)}return~e.length}return 0}function fl(e){let t=Uy(e);return t<0?~t:t}function Lm(e,t,a){if(e=dl(e),fl(e)===e.length)return"";e=Rm(e);let m=e.slice(Math.max(fl(e),e.lastIndexOf(Ki)+1)),v=t!==void 0&&a!==void 0?jm(m,t,a):void 0;return v?m.slice(0,m.length-v.length):m}function Ad(e,t,a){if(pl(t,".")||(t="."+t),e.length>=t.length&&e.charCodeAt(e.length-t.length)===46){let o=e.slice(e.length-t.length);if(a(o,t))return o}}function By(e,t,a){if(typeof t=="string")return Ad(e,t,a)||"";for(let o of t){let m=Ad(e,o,a);if(m)return m}return""}function jm(e,t,a){if(t)return By(Rm(e),t,a?Qp:ky);let o=Lm(e),m=o.lastIndexOf(".");return m>=0?o.substring(m):""}function qy(e,t){let a=e.substring(0,t),o=e.substring(t).split(Ki);return o.length&&!Yi(o)&&o.pop(),[a,...o]}function zy(e,t=""){return e=Wy(t,e),qy(e,fl(e))}function Fy(e,t){return e.length===0?"":(e[0]&&nf(e[0]))+e.slice(1,t).join(Ki)}function dl(e){return e.includes("\\")?e.replace(Jy,Ki):e}function Vy(e){if(!Xt(e))return[];let t=[e[0]];for(let a=1;a1){if(t[t.length-1]!==".."){t.pop();continue}}else if(t[0])continue}t.push(o)}}return t}function Wy(e,...t){e&&(e=dl(e));for(let a of t)a&&(a=dl(a),!e||fl(a)!==0?e=a:e=nf(e)+a);return e}function Gy(e){if(e=dl(e),!Cd.test(e))return e;let t=e.replace(/\/\.\//g,"/").replace(/^\.\//,"");if(t!==e&&(e=t,!Cd.test(e)))return e;let a=Fy(Vy(zy(e)));return a&&tf(e)?nf(a):a}function Rm(e){return tf(e)?e.substr(0,e.length-1):e}function nf(e){return tf(e)?e:e+Ki}var Cd=/\/\/|(?:^|\/)\.\.?(?:$|\/)/;function r(e,t,a,o,m,v,A){return{code:e,category:t,key:a,message:o,reportsUnnecessary:m,elidedInCompatabilityPyramid:v,reportsDeprecated:A}}var E={Unterminated_string_literal:r(1002,1,"Unterminated_string_literal_1002","Unterminated string literal."),Identifier_expected:r(1003,1,"Identifier_expected_1003","Identifier expected."),_0_expected:r(1005,1,"_0_expected_1005","'{0}' expected."),A_file_cannot_have_a_reference_to_itself:r(1006,1,"A_file_cannot_have_a_reference_to_itself_1006","A file cannot have a reference to itself."),The_parser_expected_to_find_a_1_to_match_the_0_token_here:r(1007,1,"The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007","The parser expected to find a '{1}' to match the '{0}' token here."),Trailing_comma_not_allowed:r(1009,1,"Trailing_comma_not_allowed_1009","Trailing comma not allowed."),Asterisk_Slash_expected:r(1010,1,"Asterisk_Slash_expected_1010","'*/' expected."),An_element_access_expression_should_take_an_argument:r(1011,1,"An_element_access_expression_should_take_an_argument_1011","An element access expression should take an argument."),Unexpected_token:r(1012,1,"Unexpected_token_1012","Unexpected token."),A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma:r(1013,1,"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013","A rest parameter or binding pattern may not have a trailing comma."),A_rest_parameter_must_be_last_in_a_parameter_list:r(1014,1,"A_rest_parameter_must_be_last_in_a_parameter_list_1014","A rest parameter must be last in a parameter list."),Parameter_cannot_have_question_mark_and_initializer:r(1015,1,"Parameter_cannot_have_question_mark_and_initializer_1015","Parameter cannot have question mark and initializer."),A_required_parameter_cannot_follow_an_optional_parameter:r(1016,1,"A_required_parameter_cannot_follow_an_optional_parameter_1016","A required parameter cannot follow an optional parameter."),An_index_signature_cannot_have_a_rest_parameter:r(1017,1,"An_index_signature_cannot_have_a_rest_parameter_1017","An index signature cannot have a rest parameter."),An_index_signature_parameter_cannot_have_an_accessibility_modifier:r(1018,1,"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018","An index signature parameter cannot have an accessibility modifier."),An_index_signature_parameter_cannot_have_a_question_mark:r(1019,1,"An_index_signature_parameter_cannot_have_a_question_mark_1019","An index signature parameter cannot have a question mark."),An_index_signature_parameter_cannot_have_an_initializer:r(1020,1,"An_index_signature_parameter_cannot_have_an_initializer_1020","An index signature parameter cannot have an initializer."),An_index_signature_must_have_a_type_annotation:r(1021,1,"An_index_signature_must_have_a_type_annotation_1021","An index signature must have a type annotation."),An_index_signature_parameter_must_have_a_type_annotation:r(1022,1,"An_index_signature_parameter_must_have_a_type_annotation_1022","An index signature parameter must have a type annotation."),readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature:r(1024,1,"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024","'readonly' modifier can only appear on a property declaration or index signature."),An_index_signature_cannot_have_a_trailing_comma:r(1025,1,"An_index_signature_cannot_have_a_trailing_comma_1025","An index signature cannot have a trailing comma."),Accessibility_modifier_already_seen:r(1028,1,"Accessibility_modifier_already_seen_1028","Accessibility modifier already seen."),_0_modifier_must_precede_1_modifier:r(1029,1,"_0_modifier_must_precede_1_modifier_1029","'{0}' modifier must precede '{1}' modifier."),_0_modifier_already_seen:r(1030,1,"_0_modifier_already_seen_1030","'{0}' modifier already seen."),_0_modifier_cannot_appear_on_class_elements_of_this_kind:r(1031,1,"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031","'{0}' modifier cannot appear on class elements of this kind."),super_must_be_followed_by_an_argument_list_or_member_access:r(1034,1,"super_must_be_followed_by_an_argument_list_or_member_access_1034","'super' must be followed by an argument list or member access."),Only_ambient_modules_can_use_quoted_names:r(1035,1,"Only_ambient_modules_can_use_quoted_names_1035","Only ambient modules can use quoted names."),Statements_are_not_allowed_in_ambient_contexts:r(1036,1,"Statements_are_not_allowed_in_ambient_contexts_1036","Statements are not allowed in ambient contexts."),A_declare_modifier_cannot_be_used_in_an_already_ambient_context:r(1038,1,"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038","A 'declare' modifier cannot be used in an already ambient context."),Initializers_are_not_allowed_in_ambient_contexts:r(1039,1,"Initializers_are_not_allowed_in_ambient_contexts_1039","Initializers are not allowed in ambient contexts."),_0_modifier_cannot_be_used_in_an_ambient_context:r(1040,1,"_0_modifier_cannot_be_used_in_an_ambient_context_1040","'{0}' modifier cannot be used in an ambient context."),_0_modifier_cannot_be_used_here:r(1042,1,"_0_modifier_cannot_be_used_here_1042","'{0}' modifier cannot be used here."),_0_modifier_cannot_appear_on_a_module_or_namespace_element:r(1044,1,"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044","'{0}' modifier cannot appear on a module or namespace element."),Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier:r(1046,1,"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046","Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),A_rest_parameter_cannot_be_optional:r(1047,1,"A_rest_parameter_cannot_be_optional_1047","A rest parameter cannot be optional."),A_rest_parameter_cannot_have_an_initializer:r(1048,1,"A_rest_parameter_cannot_have_an_initializer_1048","A rest parameter cannot have an initializer."),A_set_accessor_must_have_exactly_one_parameter:r(1049,1,"A_set_accessor_must_have_exactly_one_parameter_1049","A 'set' accessor must have exactly one parameter."),A_set_accessor_cannot_have_an_optional_parameter:r(1051,1,"A_set_accessor_cannot_have_an_optional_parameter_1051","A 'set' accessor cannot have an optional parameter."),A_set_accessor_parameter_cannot_have_an_initializer:r(1052,1,"A_set_accessor_parameter_cannot_have_an_initializer_1052","A 'set' accessor parameter cannot have an initializer."),A_set_accessor_cannot_have_rest_parameter:r(1053,1,"A_set_accessor_cannot_have_rest_parameter_1053","A 'set' accessor cannot have rest parameter."),A_get_accessor_cannot_have_parameters:r(1054,1,"A_get_accessor_cannot_have_parameters_1054","A 'get' accessor cannot have parameters."),Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value:r(1055,1,"Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compa_1055","Type '{0}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value."),Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher:r(1056,1,"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056","Accessors are only available when targeting ECMAScript 5 and higher."),The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:r(1058,1,"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058","The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),A_promise_must_have_a_then_method:r(1059,1,"A_promise_must_have_a_then_method_1059","A promise must have a 'then' method."),The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback:r(1060,1,"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060","The first parameter of the 'then' method of a promise must be a callback."),Enum_member_must_have_initializer:r(1061,1,"Enum_member_must_have_initializer_1061","Enum member must have initializer."),Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method:r(1062,1,"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062","Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),An_export_assignment_cannot_be_used_in_a_namespace:r(1063,1,"An_export_assignment_cannot_be_used_in_a_namespace_1063","An export assignment cannot be used in a namespace."),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0:r(1064,1,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064","The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise<{0}>'?"),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type:r(1065,1,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065","The return type of an async function or method must be the global Promise type."),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:r(1066,1,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:r(1068,1,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:r(1069,1,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:r(1070,1,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:r(1071,1,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:r(1079,1,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:r(1084,1,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),_0_modifier_cannot_appear_on_a_constructor_declaration:r(1089,1,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:r(1090,1,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:r(1091,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:r(1092,1,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:r(1093,1,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:r(1094,1,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:r(1095,1,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:r(1096,1,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:r(1097,1,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:r(1098,1,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:r(1099,1,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:r(1100,1,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:r(1101,1,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:r(1102,1,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:r(1103,1,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:r(1104,1,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:r(1105,1,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:r(1106,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:r(1107,1,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:r(1108,1,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:r(1109,1,"Expression_expected_1109","Expression expected."),Type_expected:r(1110,1,"Type_expected_1110","Type expected."),Private_field_0_must_be_declared_in_an_enclosing_class:r(1111,1,"Private_field_0_must_be_declared_in_an_enclosing_class_1111","Private field '{0}' must be declared in an enclosing class."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:r(1113,1,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:r(1114,1,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:r(1115,1,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:r(1116,1,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name:r(1117,1,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117","An object literal cannot have multiple properties with the same name."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:r(1118,1,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:r(1119,1,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:r(1120,1,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_Use_the_syntax_0:r(1121,1,"Octal_literals_are_not_allowed_Use_the_syntax_0_1121","Octal literals are not allowed. Use the syntax '{0}'."),Variable_declaration_list_cannot_be_empty:r(1123,1,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:r(1124,1,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:r(1125,1,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:r(1126,1,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:r(1127,1,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:r(1128,1,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:r(1129,1,"Statement_expected_1129","Statement expected."),case_or_default_expected:r(1130,1,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:r(1131,1,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:r(1132,1,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:r(1134,1,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:r(1135,1,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:r(1136,1,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:r(1137,1,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:r(1138,1,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:r(1139,1,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:r(1140,1,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:r(1141,1,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:r(1142,1,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:r(1144,1,"or_expected_1144","'{' or ';' expected."),or_JSX_element_expected:r(1145,1,"or_JSX_element_expected_1145","'{' or JSX element expected."),Declaration_expected:r(1146,1,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:r(1147,1,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:r(1148,1,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:r(1149,1,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),_0_declarations_must_be_initialized:r(1155,1,"_0_declarations_must_be_initialized_1155","'{0}' declarations must be initialized."),_0_declarations_can_only_be_declared_inside_a_block:r(1156,1,"_0_declarations_can_only_be_declared_inside_a_block_1156","'{0}' declarations can only be declared inside a block."),Unterminated_template_literal:r(1160,1,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:r(1161,1,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:r(1162,1,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:r(1163,1,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:r(1164,1,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:r(1165,1,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:r(1166,1,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:r(1168,1,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:r(1169,1,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:r(1170,1,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:r(1171,1,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:r(1172,1,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:r(1173,1,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:r(1174,1,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:r(1175,1,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:r(1176,1,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:r(1177,1,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:r(1178,1,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:r(1179,1,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:r(1180,1,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:r(1181,1,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:r(1182,1,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:r(1183,1,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:r(1184,1,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:r(1185,1,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:r(1186,1,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:r(1187,1,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:r(1188,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:r(1189,1,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:r(1190,1,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:r(1191,1,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:r(1192,1,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:r(1193,1,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:r(1194,1,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:r(1195,1,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:r(1196,1,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:r(1197,1,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:r(1198,1,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:r(1199,1,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:r(1200,1,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:r(1202,1,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202",`Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:r(1203,1,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_0_is_enabled_requires_using_export_type:r(1205,1,"Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205","Re-exporting a type when '{0}' is enabled requires using 'export type'."),Decorators_are_not_valid_here:r(1206,1,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:r(1207,1,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0:r(1209,1,"Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209","Invalid optional chain from new expression. Did you mean to call '{0}()'?"),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:r(1210,1,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:r(1211,1,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:r(1212,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:r(1213,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:r(1214,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:r(1215,1,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:r(1216,1,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:r(1218,1,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Generators_are_not_allowed_in_an_ambient_context:r(1221,1,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:r(1222,1,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:r(1223,1,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:r(1224,1,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:r(1225,1,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:r(1226,1,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:r(1227,1,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:r(1228,1,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:r(1229,1,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:r(1230,1,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:r(1231,1,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:r(1232,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232","An import declaration can only be used at the top level of a namespace or module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:r(1233,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233","An export declaration can only be used at the top level of a namespace or module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:r(1234,1,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module:r(1235,1,"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235","A namespace declaration is only allowed at the top level of a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:r(1236,1,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:r(1237,1,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:r(1238,1,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:r(1239,1,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:r(1240,1,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:r(1241,1,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:r(1242,1,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:r(1243,1,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:r(1244,1,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:r(1245,1,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:r(1246,1,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:r(1247,1,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:r(1248,1,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:r(1249,1,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5:r(1250,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode:r(1251,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definiti_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode:r(1252,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_au_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode."),Abstract_properties_can_only_appear_within_an_abstract_class:r(1253,1,"Abstract_properties_can_only_appear_within_an_abstract_class_1253","Abstract properties can only appear within an abstract class."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:r(1254,1,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:r(1255,1,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:r(1257,1,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:r(1258,1,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:r(1259,1,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:r(1260,1,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:r(1261,1,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:r(1262,1,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:r(1263,1,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:r(1264,1,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:r(1265,1,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:r(1266,1,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:r(1267,1,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:r(1268,1,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled:r(1269,1,"Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269","Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."),Decorator_function_return_type_0_is_not_assignable_to_type_1:r(1270,1,"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270","Decorator function return type '{0}' is not assignable to type '{1}'."),Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any:r(1271,1,"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271","Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled:r(1272,1,"A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272","A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),_0_modifier_cannot_appear_on_a_type_parameter:r(1273,1,"_0_modifier_cannot_appear_on_a_type_parameter_1273","'{0}' modifier cannot appear on a type parameter"),_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias:r(1274,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274","'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),accessor_modifier_can_only_appear_on_a_property_declaration:r(1275,1,"accessor_modifier_can_only_appear_on_a_property_declaration_1275","'accessor' modifier can only appear on a property declaration."),An_accessor_property_cannot_be_declared_optional:r(1276,1,"An_accessor_property_cannot_be_declared_optional_1276","An 'accessor' property cannot be declared optional."),_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class:r(1277,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277","'{0}' modifier can only appear on a type parameter of a function, method or class"),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0:r(1278,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278","The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0:r(1279,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279","The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."),Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement:r(1280,1,"Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280","Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."),Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead:r(1281,1,"Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281","Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."),An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:r(1282,1,"An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282","An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:r(1283,1,"An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283","An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:r(1284,1,"An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284","An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:r(1285,1,"An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285","An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:r(1286,1,"ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286","ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:r(1287,1,"A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287","A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled:r(1288,1,"An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288","An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported:r(1289,1,"_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289","'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default:r(1290,1,"_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290","'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported:r(1291,1,"_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291","'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default:r(1292,1,"_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292","'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve:r(1293,1,"ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293","ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),with_statements_are_not_allowed_in_an_async_function_block:r(1300,1,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:r(1308,1,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level:r(1309,1,"The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309","The current file is a CommonJS module and cannot use 'await' at the top level."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:r(1312,1,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:r(1313,1,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:r(1314,1,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:r(1315,1,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:r(1316,1,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:r(1317,1,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:r(1318,1,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:r(1319,1,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:r(1320,1,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:r(1321,1,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:r(1322,1,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext:r(1323,1,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodenext_or_preserve:r(1324,1,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodene_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'nodenext', or 'preserve'."),Argument_of_dynamic_import_cannot_be_spread_element:r(1325,1,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments:r(1326,1,"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326","This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),String_literal_with_double_quotes_expected:r(1327,1,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:r(1328,1,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:r(1329,1,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:r(1330,1,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:r(1331,1,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:r(1332,1,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:r(1333,1,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:r(1334,1,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:r(1335,1,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:r(1337,1,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:r(1338,1,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:r(1339,1,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:r(1340,1,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Class_constructor_may_not_be_an_accessor:r(1341,1,"Class_constructor_may_not_be_an_accessor_1341","Class constructor may not be an accessor."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext:r(1343,1,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),A_label_is_not_allowed_here:r(1344,1,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:r(1345,1,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:r(1346,1,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:r(1347,1,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:r(1348,1,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:r(1349,1,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:r(1350,3,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:r(1351,1,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:r(1352,1,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:r(1353,1,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:r(1354,1,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:r(1355,1,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:r(1356,1,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:r(1357,1,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:r(1358,1,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:r(1359,1,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),Type_0_does_not_satisfy_the_expected_type_1:r(1360,1,"Type_0_does_not_satisfy_the_expected_type_1_1360","Type '{0}' does not satisfy the expected type '{1}'."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:r(1361,1,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:r(1362,1,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:r(1363,1,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:r(1364,3,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:r(1365,3,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:r(1366,3,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:r(1367,3,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Class_constructor_may_not_be_a_generator:r(1368,1,"Class_constructor_may_not_be_a_generator_1368","Class constructor may not be a generator."),Did_you_mean_0:r(1369,3,"Did_you_mean_0_1369","Did you mean '{0}'?"),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:r(1375,1,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:r(1376,3,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:r(1377,3,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:r(1378,1,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:r(1379,1,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:r(1380,1,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:r(1381,1,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `}`?"),Unexpected_token_Did_you_mean_or_gt:r(1382,1,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `>`?"),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:r(1385,1,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:r(1386,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:r(1387,1,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:r(1388,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:r(1389,1,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:r(1390,1,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:r(1392,1,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:r(1393,3,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:r(1394,3,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:r(1395,3,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:r(1396,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:r(1397,3,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:r(1398,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:r(1399,3,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:r(1400,3,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:r(1401,3,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:r(1402,3,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:r(1403,3,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:r(1404,3,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:r(1405,3,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:r(1406,3,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:r(1407,3,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:r(1408,3,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:r(1409,3,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:r(1410,3,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:r(1411,3,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:r(1412,3,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:r(1413,3,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:r(1414,3,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:r(1415,3,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:r(1416,3,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:r(1417,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:r(1418,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:r(1419,3,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:r(1420,3,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:r(1421,3,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:r(1422,3,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:r(1423,3,"File_is_library_specified_here_1423","File is library specified here."),Default_library:r(1424,3,"Default_library_1424","Default library"),Default_library_for_target_0:r(1425,3,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:r(1426,3,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:r(1427,3,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:r(1428,3,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:r(1429,3,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:r(1430,3,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:r(1431,1,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:r(1432,1,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters:r(1433,1,"Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433","Neither decorators nor modifiers may be applied to 'this' parameters."),Unexpected_keyword_or_identifier:r(1434,1,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:r(1435,1,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:r(1436,1,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:r(1437,1,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:r(1438,1,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:r(1439,1,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:r(1440,1,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:r(1441,1,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:r(1442,1,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:r(1443,1,"Module_declaration_names_may_only_use_or_quoted_strings_1443",`Module declaration names may only use ' or " quoted strings.`),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled:r(1448,1,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:r(1449,3,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments:r(1450,3,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:r(1451,1,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),resolution_mode_should_be_either_require_or_import:r(1453,1,"resolution_mode_should_be_either_require_or_import_1453","`resolution-mode` should be either `require` or `import`."),resolution_mode_can_only_be_set_for_type_only_imports:r(1454,1,"resolution_mode_can_only_be_set_for_type_only_imports_1454","`resolution-mode` can only be set for type-only imports."),resolution_mode_is_the_only_valid_key_for_type_import_assertions:r(1455,1,"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455","`resolution-mode` is the only valid key for type import assertions."),Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:r(1456,1,"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456","Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:r(1457,3,"Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457","Matched by default include pattern '**/*'"),File_is_ECMAScript_module_because_0_has_field_type_with_value_module:r(1458,3,"File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458",`File is ECMAScript module because '{0}' has field "type" with value "module"`),File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:r(1459,3,"File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459",`File is CommonJS module because '{0}' has field "type" whose value is not "module"`),File_is_CommonJS_module_because_0_does_not_have_field_type:r(1460,3,"File_is_CommonJS_module_because_0_does_not_have_field_type_1460",`File is CommonJS module because '{0}' does not have field "type"`),File_is_CommonJS_module_because_package_json_was_not_found:r(1461,3,"File_is_CommonJS_module_because_package_json_was_not_found_1461","File is CommonJS module because 'package.json' was not found"),resolution_mode_is_the_only_valid_key_for_type_import_attributes:r(1463,1,"resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463","'resolution-mode' is the only valid key for type import attributes."),Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:r(1464,1,"Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464","Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:r(1470,1,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead:r(1471,1,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),catch_or_finally_expected:r(1472,1,"catch_or_finally_expected_1472","'catch' or 'finally' expected."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:r(1473,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473","An import declaration can only be used at the top level of a module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:r(1474,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474","An export declaration can only be used at the top level of a module."),Control_what_method_is_used_to_detect_module_format_JS_files:r(1475,3,"Control_what_method_is_used_to_detect_module_format_JS_files_1475","Control what method is used to detect module-format JS files."),auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules:r(1476,3,"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476",'"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),An_instantiation_expression_cannot_be_followed_by_a_property_access:r(1477,1,"An_instantiation_expression_cannot_be_followed_by_a_property_access_1477","An instantiation expression cannot be followed by a property access."),Identifier_or_string_literal_expected:r(1478,1,"Identifier_or_string_literal_expected_1478","Identifier or string literal expected."),The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead:r(1479,1,"The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479",`The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.`),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module:r(1480,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480",'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1:r(1481,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481",`To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`),To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0:r(1482,3,"To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482",'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'),To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module:r(1483,3,"To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483",'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:r(1484,1,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484","'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:r(1485,1,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),Decorator_used_before_export_here:r(1486,1,"Decorator_used_before_export_here_1486","Decorator used before 'export' here."),Octal_escape_sequences_are_not_allowed_Use_the_syntax_0:r(1487,1,"Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487","Octal escape sequences are not allowed. Use the syntax '{0}'."),Escape_sequence_0_is_not_allowed:r(1488,1,"Escape_sequence_0_is_not_allowed_1488","Escape sequence '{0}' is not allowed."),Decimals_with_leading_zeros_are_not_allowed:r(1489,1,"Decimals_with_leading_zeros_are_not_allowed_1489","Decimals with leading zeros are not allowed."),File_appears_to_be_binary:r(1490,1,"File_appears_to_be_binary_1490","File appears to be binary."),_0_modifier_cannot_appear_on_a_using_declaration:r(1491,1,"_0_modifier_cannot_appear_on_a_using_declaration_1491","'{0}' modifier cannot appear on a 'using' declaration."),_0_declarations_may_not_have_binding_patterns:r(1492,1,"_0_declarations_may_not_have_binding_patterns_1492","'{0}' declarations may not have binding patterns."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration:r(1493,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493","The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration:r(1494,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494","The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),_0_modifier_cannot_appear_on_an_await_using_declaration:r(1495,1,"_0_modifier_cannot_appear_on_an_await_using_declaration_1495","'{0}' modifier cannot appear on an 'await using' declaration."),Identifier_string_literal_or_number_literal_expected:r(1496,1,"Identifier_string_literal_or_number_literal_expected_1496","Identifier, string literal, or number literal expected."),Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator:r(1497,1,"Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator_1497","Expression must be enclosed in parentheses to be used as a decorator."),Invalid_syntax_in_decorator:r(1498,1,"Invalid_syntax_in_decorator_1498","Invalid syntax in decorator."),Unknown_regular_expression_flag:r(1499,1,"Unknown_regular_expression_flag_1499","Unknown regular expression flag."),Duplicate_regular_expression_flag:r(1500,1,"Duplicate_regular_expression_flag_1500","Duplicate regular expression flag."),This_regular_expression_flag_is_only_available_when_targeting_0_or_later:r(1501,1,"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501","This regular expression flag is only available when targeting '{0}' or later."),The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously:r(1502,1,"The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1502","The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."),Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later:r(1503,1,"Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1503","Named capturing groups are only available when targeting 'ES2018' or later."),Subpattern_flags_must_be_present_when_there_is_a_minus_sign:r(1504,1,"Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1504","Subpattern flags must be present when there is a minus sign."),Incomplete_quantifier_Digit_expected:r(1505,1,"Incomplete_quantifier_Digit_expected_1505","Incomplete quantifier. Digit expected."),Numbers_out_of_order_in_quantifier:r(1506,1,"Numbers_out_of_order_in_quantifier_1506","Numbers out of order in quantifier."),There_is_nothing_available_for_repetition:r(1507,1,"There_is_nothing_available_for_repetition_1507","There is nothing available for repetition."),Unexpected_0_Did_you_mean_to_escape_it_with_backslash:r(1508,1,"Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1508","Unexpected '{0}'. Did you mean to escape it with backslash?"),This_regular_expression_flag_cannot_be_toggled_within_a_subpattern:r(1509,1,"This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1509","This regular expression flag cannot be toggled within a subpattern."),k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets:r(1510,1,"k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510","'\\k' must be followed by a capturing group name enclosed in angle brackets."),q_is_only_available_inside_character_class:r(1511,1,"q_is_only_available_inside_character_class_1511","'\\q' is only available inside character class."),c_must_be_followed_by_an_ASCII_letter:r(1512,1,"c_must_be_followed_by_an_ASCII_letter_1512","'\\c' must be followed by an ASCII letter."),Undetermined_character_escape:r(1513,1,"Undetermined_character_escape_1513","Undetermined character escape."),Expected_a_capturing_group_name:r(1514,1,"Expected_a_capturing_group_name_1514","Expected a capturing group name."),Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other:r(1515,1,"Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1515","Named capturing groups with the same name must be mutually exclusive to each other."),A_character_class_range_must_not_be_bounded_by_another_character_class:r(1516,1,"A_character_class_range_must_not_be_bounded_by_another_character_class_1516","A character class range must not be bounded by another character class."),Range_out_of_order_in_character_class:r(1517,1,"Range_out_of_order_in_character_class_1517","Range out of order in character class."),Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class:r(1518,1,"Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1518","Anything that would possibly match more than a single character is invalid inside a negated character class."),Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead:r(1519,1,"Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1519","Operators must not be mixed within a character class. Wrap it in a nested class instead."),Expected_a_class_set_operand:r(1520,1,"Expected_a_class_set_operand_1520","Expected a class set operand."),q_must_be_followed_by_string_alternatives_enclosed_in_braces:r(1521,1,"q_must_be_followed_by_string_alternatives_enclosed_in_braces_1521","'\\q' must be followed by string alternatives enclosed in braces."),A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash:r(1522,1,"A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1522","A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"),Expected_a_Unicode_property_name:r(1523,1,"Expected_a_Unicode_property_name_1523","Expected a Unicode property name."),Unknown_Unicode_property_name:r(1524,1,"Unknown_Unicode_property_name_1524","Unknown Unicode property name."),Expected_a_Unicode_property_value:r(1525,1,"Expected_a_Unicode_property_value_1525","Expected a Unicode property value."),Unknown_Unicode_property_value:r(1526,1,"Unknown_Unicode_property_value_1526","Unknown Unicode property value."),Expected_a_Unicode_property_name_or_value:r(1527,1,"Expected_a_Unicode_property_name_or_value_1527","Expected a Unicode property name or value."),Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set:r(1528,1,"Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1528","Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."),Unknown_Unicode_property_name_or_value:r(1529,1,"Unknown_Unicode_property_name_or_value_1529","Unknown Unicode property name or value."),Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set:r(1530,1,"Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1530","Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces:r(1531,1,"_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1531","'\\{0}' must be followed by a Unicode property value expression enclosed in braces."),There_is_no_capturing_group_named_0_in_this_regular_expression:r(1532,1,"There_is_no_capturing_group_named_0_in_this_regular_expression_1532","There is no capturing group named '{0}' in this regular expression."),This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression:r(1533,1,"This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_r_1533","This backreference refers to a group that does not exist. There are only {0} capturing groups in this regular expression."),This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression:r(1534,1,"This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regul_1534","This backreference refers to a group that does not exist. There are no capturing groups in this regular expression."),This_character_cannot_be_escaped_in_a_regular_expression:r(1535,1,"This_character_cannot_be_escaped_in_a_regular_expression_1535","This character cannot be escaped in a regular expression."),Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead:r(1536,1,"Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended__1536","Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '{0}' instead."),Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class:r(1537,1,"Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537","Decimal escape sequences and backreferences are not allowed in a character class."),Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set:r(1538,1,"Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538","Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),A_bigint_literal_cannot_be_used_as_a_property_name:r(1539,1,"A_bigint_literal_cannot_be_used_as_a_property_name_1539","A 'bigint' literal cannot be used as a property name."),A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead:r(1540,2,"A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540","A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",void 0,void 0,!0),Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:r(1541,1,"Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribut_1541","Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:r(1542,1,"Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542","Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0:r(1543,1,"Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543",`Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to '{0}'.`),Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0:r(1544,1,"Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544","Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."),The_types_of_0_are_incompatible_between_these_types:r(2200,1,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:r(2201,1,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:r(2202,1,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:r(2203,1,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:r(2204,1,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:r(2205,1,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:r(2206,1,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:r(2207,1,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),This_type_parameter_might_need_an_extends_0_constraint:r(2208,1,"This_type_parameter_might_need_an_extends_0_constraint_2208","This type parameter might need an `extends {0}` constraint."),The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:r(2209,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209","The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:r(2210,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210","The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),Add_extends_constraint:r(2211,3,"Add_extends_constraint_2211","Add `extends` constraint."),Add_extends_constraint_to_all_type_parameters:r(2212,3,"Add_extends_constraint_to_all_type_parameters_2212","Add `extends` constraint to all type parameters"),Duplicate_identifier_0:r(2300,1,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:r(2301,1,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:r(2302,1,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:r(2303,1,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:r(2304,1,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:r(2305,1,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:r(2306,1,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:r(2307,1,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:r(2308,1,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:r(2309,1,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:r(2310,1,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function:r(2311,1,"Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311","Cannot find name '{0}'. Did you mean to write this in an async function?"),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:r(2312,1,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:r(2313,1,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:r(2314,1,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:r(2315,1,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:r(2316,1,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:r(2317,1,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:r(2318,1,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:r(2319,1,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:r(2320,1,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:r(2321,1,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:r(2322,1,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:r(2323,1,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:r(2324,1,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:r(2325,1,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:r(2326,1,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:r(2327,1,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:r(2328,1,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:r(2329,1,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:r(2330,1,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:r(2331,1,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:r(2332,1,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_a_static_property_initializer:r(2334,1,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:r(2335,1,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:r(2336,1,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:r(2337,1,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:r(2338,1,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:r(2339,1,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:r(2340,1,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:r(2341,1,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:r(2343,1,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:r(2344,1,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:r(2345,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Untyped_function_calls_may_not_accept_type_arguments:r(2347,1,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:r(2348,1,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:r(2349,1,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:r(2350,1,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:r(2351,1,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:r(2352,1,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:r(2353,1,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:r(2354,1,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value:r(2355,1,"A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:r(2356,1,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:r(2357,1,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:r(2358,1,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method:r(2359,1,"The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359","The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:r(2362,1,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:r(2363,1,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:r(2364,1,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:r(2365,1,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:r(2366,1,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap:r(2367,1,"This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367","This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."),Type_parameter_name_cannot_be_0:r(2368,1,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:r(2369,1,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:r(2370,1,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:r(2371,1,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:r(2372,1,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:r(2373,1,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:r(2374,1,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:r(2375,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers:r(2376,1,"A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376","A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:r(2377,1,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:r(2378,1,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:r(2379,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),Overload_signatures_must_all_be_exported_or_non_exported:r(2383,1,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:r(2384,1,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:r(2385,1,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:r(2386,1,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:r(2387,1,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:r(2388,1,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:r(2389,1,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:r(2390,1,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:r(2391,1,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:r(2392,1,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:r(2393,1,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:r(2394,1,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:r(2395,1,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:r(2396,1,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:r(2397,1,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:r(2398,1,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:r(2399,1,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:r(2400,1,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers:r(2401,1,"A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401","A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:r(2402,1,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:r(2403,1,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:r(2404,1,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:r(2405,1,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:r(2406,1,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:r(2407,1,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:r(2408,1,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:r(2409,1,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:r(2410,1,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:r(2412,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:r(2411,1,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:r(2413,1,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:r(2414,1,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:r(2415,1,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:r(2416,1,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:r(2417,1,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:r(2418,1,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:r(2419,1,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:r(2420,1,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:r(2422,1,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:r(2423,1,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:r(2425,1,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:r(2426,1,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:r(2427,1,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:r(2428,1,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:r(2430,1,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:r(2431,1,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:r(2432,1,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:r(2433,1,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:r(2434,1,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:r(2435,1,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:r(2436,1,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:r(2437,1,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:r(2438,1,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:r(2439,1,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:r(2440,1,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:r(2441,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:r(2442,1,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:r(2443,1,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:r(2444,1,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:r(2445,1,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:r(2446,1,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:r(2447,1,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:r(2448,1,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:r(2449,1,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:r(2450,1,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:r(2451,1,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:r(2452,1,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:r(2454,1,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:r(2456,1,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:r(2457,1,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:r(2458,1,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:r(2459,1,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:r(2460,1,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:r(2461,1,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:r(2462,1,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:r(2463,1,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:r(2464,1,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:r(2465,1,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:r(2466,1,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:r(2467,1,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:r(2468,1,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:r(2469,1,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:r(2472,1,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:r(2473,1,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_must_be_constant_expressions:r(2474,1,"const_enum_member_initializers_must_be_constant_expressions_2474","const enum member initializers must be constant expressions."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:r(2475,1,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:r(2476,1,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:r(2477,1,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:r(2478,1,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:r(2480,1,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:r(2481,1,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:r(2483,1,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:r(2484,1,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:r(2487,1,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:r(2488,1,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:r(2489,1,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:r(2490,1,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:r(2491,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:r(2492,1,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:r(2493,1,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:r(2494,1,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:r(2495,1,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression:r(2496,1,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_func_2496","The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:r(2497,1,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:r(2498,1,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:r(2499,1,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:r(2500,1,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:r(2501,1,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:r(2502,1,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:r(2503,1,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:r(2504,1,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:r(2505,1,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:r(2506,1,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:r(2507,1,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:r(2508,1,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:r(2509,1,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:r(2510,1,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:r(2511,1,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:r(2512,1,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:r(2513,1,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),A_tuple_type_cannot_be_indexed_with_a_negative_value:r(2514,1,"A_tuple_type_cannot_be_indexed_with_a_negative_value_2514","A tuple type cannot be indexed with a negative value."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:r(2515,1,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:r(2516,1,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:r(2517,1,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:r(2518,1,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:r(2519,1,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:r(2520,1,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method:r(2522,1,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_sta_2522","The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:r(2523,1,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:r(2524,1,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:r(2526,1,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:r(2527,1,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:r(2528,1,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:r(2529,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:r(2530,1,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:r(2531,1,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:r(2532,1,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:r(2533,1,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:r(2534,1,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Type_0_cannot_be_used_to_index_type_1:r(2536,1,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:r(2537,1,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:r(2538,1,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:r(2539,1,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:r(2540,1,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:r(2542,1,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:r(2543,1,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:r(2544,1,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:r(2545,1,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:r(2547,1,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:r(2548,1,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:r(2549,1,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:r(2550,1,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:r(2551,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:r(2552,1,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:r(2553,1,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:r(2554,1,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:r(2555,1,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:r(2556,1,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:r(2558,1,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:r(2559,1,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:r(2560,1,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:r(2561,1,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:r(2562,1,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:r(2563,1,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:r(2564,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:r(2565,1,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:r(2566,1,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:r(2567,1,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:r(2568,1,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Could_not_find_name_0_Did_you_mean_1:r(2570,1,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:r(2571,1,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:r(2574,1,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:r(2575,1,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:r(2576,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:r(2577,1,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:r(2578,1,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:r(2580,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:r(2581,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:r(2582,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:r(2583,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:r(2584,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:r(2585,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:r(2588,1,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:r(2589,1,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:r(2590,1,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:r(2591,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:r(2592,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:r(2593,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:r(2594,1,"This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594","This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:r(2595,1,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:r(2596,1,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:r(2597,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:r(2598,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:r(2602,1,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:r(2603,1,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:r(2604,1,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:r(2606,1,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:r(2607,1,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:r(2608,1,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:r(2609,1,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:r(2610,1,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:r(2611,1,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:r(2612,1,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:r(2613,1,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:r(2614,1,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:r(2615,1,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:r(2616,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:r(2617,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:r(2618,1,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:r(2619,1,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:r(2620,1,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:r(2621,1,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:r(2623,1,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:r(2624,1,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:r(2625,1,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:r(2626,1,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:r(2627,1,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:r(2628,1,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:r(2629,1,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:r(2630,1,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:r(2631,1,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:r(2632,1,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:r(2633,1,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:r(2634,1,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable:r(2635,1,"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635","Type '{0}' has no signatures for which the type argument list is applicable."),Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation:r(2636,1,"Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636","Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types:r(2637,1,"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637","Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator:r(2638,1,"Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638","Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),React_components_cannot_include_JSX_namespace_names:r(2639,1,"React_components_cannot_include_JSX_namespace_names_2639","React components cannot include JSX namespace names"),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:r(2649,1,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more:r(2650,1,"Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650","Non-abstract class expression is missing implementations for the following members of '{0}': {1} and {2} more."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:r(2651,1,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:r(2652,1,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:r(2653,1,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2:r(2654,1,"Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654","Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2}."),Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more:r(2655,1,"Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655","Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2} and {3} more."),Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1:r(2656,1,"Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656","Non-abstract class expression is missing implementations for the following members of '{0}': {1}."),JSX_expressions_must_have_one_parent_element:r(2657,1,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:r(2658,1,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:r(2659,1,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:r(2660,1,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:r(2661,1,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:r(2662,1,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:r(2663,1,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:r(2664,1,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:r(2665,1,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:r(2666,1,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:r(2667,1,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:r(2668,1,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:r(2669,1,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:r(2670,1,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:r(2671,1,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:r(2672,1,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:r(2673,1,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:r(2674,1,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:r(2675,1,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:r(2676,1,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:r(2677,1,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:r(2678,1,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:r(2679,1,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:r(2680,1,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:r(2681,1,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:r(2683,1,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:r(2684,1,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:r(2685,1,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:r(2686,1,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:r(2687,1,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:r(2688,1,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:r(2689,1,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:r(2690,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:r(2692,1,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:r(2693,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:r(2694,1,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:r(2695,1,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:r(2696,1,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:r(2697,1,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:r(2698,1,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:r(2699,1,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:r(2700,1,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:r(2701,1,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:r(2702,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:r(2703,1,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:r(2704,1,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:r(2705,1,"An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_2705","An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:r(2706,1,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:r(2707,1,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:r(2708,1,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:r(2709,1,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:r(2710,1,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:r(2711,1,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:r(2712,1,"A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_t_2712","A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:r(2713,1,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713",`Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}["{1}"]'?`),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:r(2714,1,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:r(2715,1,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:r(2716,1,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:r(2717,1,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:r(2718,1,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:r(2719,1,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:r(2720,1,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:r(2721,1,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:r(2722,1,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:r(2723,1,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:r(2724,1,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:r(2725,1,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:r(2726,1,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:r(2727,1,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:r(2728,3,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:r(2729,1,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:r(2730,1,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:r(2731,1,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:r(2732,1,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:r(2733,1,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:r(2734,1,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:r(2735,1,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:r(2736,1,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:r(2737,1,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:r(2738,3,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:r(2739,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:r(2740,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:r(2741,1,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:r(2742,1,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:r(2743,1,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:r(2744,1,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:r(2745,1,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:r(2746,1,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:r(2747,1,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_0_is_enabled:r(2748,1,"Cannot_access_ambient_const_enums_when_0_is_enabled_2748","Cannot access ambient const enums when '{0}' is enabled."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:r(2749,1,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:r(2750,1,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:r(2751,1,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:r(2752,1,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:r(2753,1,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:r(2754,1,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:r(2755,1,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:r(2756,1,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:r(2757,1,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:r(2758,1,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:r(2759,1,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:r(2760,1,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:r(2761,1,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:r(2762,1,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:r(2763,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:r(2764,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:r(2765,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:r(2766,1,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:r(2767,1,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:r(2768,1,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:r(2769,1,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:r(2770,1,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:r(2771,1,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:r(2772,1,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:r(2773,1,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:r(2774,1,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:r(2775,1,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:r(2776,1,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:r(2777,1,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:r(2778,1,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:r(2779,1,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:r(2780,1,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:r(2781,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:r(2782,3,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:r(2783,1,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:r(2784,1,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:r(2785,1,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:r(2786,1,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:r(2787,1,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:r(2788,1,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:r(2789,1,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:r(2790,1,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:r(2791,1,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:r(2792,1,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:r(2793,1,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:r(2794,1,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:r(2795,1,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:r(2796,1,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:r(2797,1,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:r(2798,1,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:r(2799,1,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:r(2800,1,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:r(2801,1,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:r(2802,1,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:r(2803,1,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:r(2804,1,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Private_accessor_was_defined_without_a_getter:r(2806,1,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:r(2807,1,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:r(2808,1,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses:r(2809,1,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments:r(2810,1,"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810","Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),Initializer_for_property_0:r(2811,1,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:r(2812,1,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:r(2813,1,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:r(2814,1,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:r(2815,1,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:r(2816,1,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:r(2817,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:r(2818,1,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:r(2819,1,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:r(2820,1,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve:r(2821,1,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2821","Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:r(2822,1,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve:r(2823,1,"Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2823","Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),Cannot_find_namespace_0_Did_you_mean_1:r(2833,1,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path:r(2834,1,"Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0:r(2835,1,"Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:r(2836,1,"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836","Import assertions are not allowed on statements that compile to CommonJS 'require' calls."),Import_assertion_values_must_be_string_literal_expressions:r(2837,1,"Import_assertion_values_must_be_string_literal_expressions_2837","Import assertion values must be string literal expressions."),All_declarations_of_0_must_have_identical_constraints:r(2838,1,"All_declarations_of_0_must_have_identical_constraints_2838","All declarations of '{0}' must have identical constraints."),This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value:r(2839,1,"This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839","This condition will always return '{0}' since JavaScript compares objects by reference, not value."),An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types:r(2840,1,"An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840","An interface cannot extend a primitive type like '{0}'. It can only extend other named object types."),_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation:r(2842,1,"_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842","'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here:r(2843,1,"We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843","We can only write a type for '{0}' by adding a type for the entire parameter here."),Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:r(2844,1,"Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844","Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),This_condition_will_always_return_0:r(2845,1,"This_condition_will_always_return_0_2845","This condition will always return '{0}'."),A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead:r(2846,1,"A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846","A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"),The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression:r(2848,1,"The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848","The right-hand side of an 'instanceof' expression must not be an instantiation expression."),Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1:r(2849,1,"Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849","Target signature provides too few arguments. Expected {0} or more, but got {1}."),The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined:r(2850,1,"The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_n_2850","The initializer of a 'using' declaration must be either an object with a '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined:r(2851,1,"The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851","The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:r(2852,1,"await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852","'await using' statements are only allowed within async functions and at the top levels of modules."),await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:r(2853,1,"await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853","'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:r(2854,1,"Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854","Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super:r(2855,1,"Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855","Class field '{0}' defined by the parent class is not accessible in the child class via super."),Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:r(2856,1,"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856","Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),Import_attributes_cannot_be_used_with_type_only_imports_or_exports:r(2857,1,"Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857","Import attributes cannot be used with type-only imports or exports."),Import_attribute_values_must_be_string_literal_expressions:r(2858,1,"Import_attribute_values_must_be_string_literal_expressions_2858","Import attribute values must be string literal expressions."),Excessive_complexity_comparing_types_0_and_1:r(2859,1,"Excessive_complexity_comparing_types_0_and_1_2859","Excessive complexity comparing types '{0}' and '{1}'."),The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method:r(2860,1,"The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860","The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression:r(2861,1,"An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861","An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),Type_0_is_generic_and_can_only_be_indexed_for_reading:r(2862,1,"Type_0_is_generic_and_can_only_be_indexed_for_reading_2862","Type '{0}' is generic and can only be indexed for reading."),A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values:r(2863,1,"A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863","A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types:r(2864,1,"A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864","A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled:r(2865,1,"Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865","Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled:r(2866,1,"Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866","Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun:r(2867,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867","Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig:r(2868,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868","Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish:r(2869,1,"Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish_2869","Right operand of ?? is unreachable because the left operand is never nullish."),This_binary_expression_is_never_nullish_Are_you_missing_parentheses:r(2870,1,"This_binary_expression_is_never_nullish_Are_you_missing_parentheses_2870","This binary expression is never nullish. Are you missing parentheses?"),This_expression_is_always_nullish:r(2871,1,"This_expression_is_always_nullish_2871","This expression is always nullish."),This_kind_of_expression_is_always_truthy:r(2872,1,"This_kind_of_expression_is_always_truthy_2872","This kind of expression is always truthy."),This_kind_of_expression_is_always_falsy:r(2873,1,"This_kind_of_expression_is_always_falsy_2873","This kind of expression is always falsy."),This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found:r(2874,1,"This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found_2874","This JSX tag requires '{0}' to be in scope, but it could not be found."),This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed:r(2875,1,"This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_fo_2875","This JSX tag requires the module path '{0}' to exist, but none could be found. Make sure you have types for the appropriate package installed."),This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0:r(2876,1,"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876",'This relative import path is unsafe to rewrite because it looks like a file name, but actually resolves to "{0}".'),This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path:r(2877,1,"This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877","This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files:r(2878,1,"This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878","This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found:r(2879,1,"Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879","Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),Import_declaration_0_is_using_private_name_1:r(4e3,1,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:r(4002,1,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:r(4004,1,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:r(4006,1,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:r(4008,1,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:r(4010,1,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r(4012,1,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:r(4014,1,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:r(4016,1,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:r(4019,1,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:r(4020,1,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:r(4021,1,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:r(4022,1,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4023,1,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:r(4024,1,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:r(4025,1,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4026,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:r(4027,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:r(4028,1,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4029,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:r(4030,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:r(4031,1,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4032,1,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:r(4033,1,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4034,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:r(4035,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4036,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:r(4037,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4038,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4039,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:r(4040,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4041,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4042,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:r(4043,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:r(4044,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:r(4045,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:r(4046,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:r(4047,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:r(4048,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:r(4049,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:r(4050,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:r(4051,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:r(4052,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:r(4053,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:r(4054,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:r(4055,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:r(4056,1,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:r(4057,1,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:r(4058,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:r(4059,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:r(4060,1,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4061,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4062,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:r(4063,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4064,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:r(4065,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4066,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:r(4067,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4068,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4069,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:r(4070,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4071,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4072,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r(4073,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4074,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:r(4075,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4076,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:r(4077,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:r(4078,1,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:r(4081,1,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:r(4082,1,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:r(4083,1,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:r(4084,1,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1:r(4085,1,"Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085","Extends clause for inferred type '{0}' has or is using private name '{1}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4091,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:r(4092,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected:r(4094,1,"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","Property '{0}' of exported anonymous class type may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4095,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:r(4096,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:r(4097,1,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4098,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:r(4099,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:r(4100,1,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4101,1,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:r(4102,1,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:r(4103,1,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:r(4104,1,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:r(4105,1,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:r(4106,1,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:r(4107,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4108,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:r(4109,1,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:r(4110,1,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:r(4111,1,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:r(4112,1,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:r(4113,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:r(4114,1,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:r(4115,1,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:r(4116,1,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:r(4117,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:r(4118,1,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:r(4119,1,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:r(4120,1,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:r(4121,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:r(4122,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:r(4123,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:r(4124,1,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given:r(4125,1,"Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125","Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value:r(4126,1,"One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126","One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),The_current_host_does_not_support_the_0_option:r(5001,1,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:r(5009,1,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:r(5010,1,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:r(5012,1,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Unknown_compiler_option_0:r(5023,1,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:r(5024,1,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:r(5025,1,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:r(5033,1,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:r(5042,1,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:r(5047,1,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:r(5051,1,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:r(5052,1,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:r(5053,1,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:r(5054,1,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:r(5055,1,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:r(5056,1,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:r(5057,1,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:r(5058,1,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:r(5059,1,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:r(5061,1,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:r(5062,1,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:r(5063,1,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:r(5064,1,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:r(5065,1,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:r(5066,1,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:r(5067,1,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:r(5068,1,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:r(5069,1,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic:r(5070,1,"Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070","Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd:r(5071,1,"Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd_5071","Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'."),Unknown_build_option_0:r(5072,1,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:r(5073,1,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:r(5074,1,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:r(5075,1,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:r(5076,1,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:r(5077,1,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:r(5078,1,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:r(5079,1,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:r(5080,1,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:r(5081,1,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:r(5082,1,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:r(5083,1,"Cannot_read_file_0_5083","Cannot read file '{0}'."),A_tuple_member_cannot_be_both_optional_and_rest:r(5085,1,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:r(5086,1,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:r(5087,1,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:r(5088,1,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:r(5089,1,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:r(5090,1,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled:r(5091,1,"Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."),The_root_value_of_a_0_file_must_be_an_object:r(5092,1,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:r(5093,1,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:r(5094,1,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later:r(5095,1,"Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095","Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."),Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set:r(5096,1,"Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096","Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled:r(5097,1,"An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097","An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler:r(5098,1,"Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098","Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error:r(5101,1,"Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101",`Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),Option_0_has_been_removed_Please_remove_it_from_your_configuration:r(5102,1,"Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102","Option '{0}' has been removed. Please remove it from your configuration."),Invalid_value_for_ignoreDeprecations:r(5103,1,"Invalid_value_for_ignoreDeprecations_5103","Invalid value for '--ignoreDeprecations'."),Option_0_is_redundant_and_cannot_be_specified_with_option_1:r(5104,1,"Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104","Option '{0}' is redundant and cannot be specified with option '{1}'."),Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System:r(5105,1,"Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105","Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),Use_0_instead:r(5106,3,"Use_0_instead_5106","Use '{0}' instead."),Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error:r(5107,1,"Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107",`Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`),Option_0_1_has_been_removed_Please_remove_it_from_your_configuration:r(5108,1,"Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108","Option '{0}={1}' has been removed. Please remove it from your configuration."),Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1:r(5109,1,"Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109","Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."),Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1:r(5110,1,"Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110","Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:r(6e3,3,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:r(6001,3,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:r(6002,3,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:r(6004,3,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:r(6005,3,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:r(6006,3,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:r(6007,3,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:r(6008,3,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:r(6009,3,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:r(6010,3,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:r(6011,3,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:r(6012,3,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:r(6013,3,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:r(6014,3,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:r(6015,3,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:r(6016,3,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:r(6017,3,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:r(6019,3,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:r(6020,3,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:r(6023,3,"Syntax_Colon_0_6023","Syntax: {0}"),options:r(6024,3,"options_6024","options"),file:r(6025,3,"file_6025","file"),Examples_Colon_0:r(6026,3,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:r(6027,3,"Options_Colon_6027","Options:"),Version_0:r(6029,3,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:r(6030,3,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:r(6031,3,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:r(6032,3,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:r(6034,3,"KIND_6034","KIND"),FILE:r(6035,3,"FILE_6035","FILE"),VERSION:r(6036,3,"VERSION_6036","VERSION"),LOCATION:r(6037,3,"LOCATION_6037","LOCATION"),DIRECTORY:r(6038,3,"DIRECTORY_6038","DIRECTORY"),STRATEGY:r(6039,3,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:r(6040,3,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Errors_Files:r(6041,3,"Errors_Files_6041","Errors Files"),Generates_corresponding_map_file:r(6043,3,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:r(6044,1,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:r(6045,1,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:r(6046,1,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:r(6048,1,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form or -. For example '{0}' or '{1}'."),Unable_to_open_file_0:r(6050,1,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:r(6051,1,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:r(6052,3,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:r(6053,1,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:r(6054,1,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:r(6055,3,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:r(6056,3,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:r(6058,3,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:r(6059,1,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:r(6060,3,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:r(6061,3,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:r(6064,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:r(6065,3,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:r(6066,3,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:r(6070,3,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:r(6071,3,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:r(6072,3,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:r(6073,3,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:r(6074,3,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:r(6075,3,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:r(6076,3,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:r(6077,3,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:r(6078,3,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:r(6079,3,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:r(6080,3,"Specify_JSX_code_generation_6080","Specify JSX code generation."),Only_amd_and_system_modules_are_supported_alongside_0:r(6082,1,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:r(6083,3,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:r(6084,3,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:r(6085,3,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:r(6086,3,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:r(6087,3,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:r(6088,3,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:r(6089,3,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:r(6090,3,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:r(6091,3,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:r(6092,3,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:r(6093,3,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:r(6094,3,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1:r(6095,3,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095","Loading module as file / folder, candidate module location '{0}', target file types: {1}."),File_0_does_not_exist:r(6096,3,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exists_use_it_as_a_name_resolution_result:r(6097,3,"File_0_exists_use_it_as_a_name_resolution_result_6097","File '{0}' exists - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_types_Colon_1:r(6098,3,"Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098","Loading module '{0}' from 'node_modules' folder, target file types: {1}."),Found_package_json_at_0:r(6099,3,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:r(6100,3,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:r(6101,3,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:r(6102,3,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:r(6104,3,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:r(6105,3,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:r(6106,3,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:r(6107,3,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:r(6108,3,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:r(6109,3,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:r(6110,3,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:r(6111,3,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:r(6112,3,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:r(6113,3,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:r(6114,1,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:r(6115,3,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:r(6116,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:r(6119,3,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:r(6120,3,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:r(6121,3,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:r(6122,3,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:r(6123,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:r(6124,3,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:r(6125,3,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:r(6126,3,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:r(6127,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:r(6128,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:r(6130,3,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:r(6131,1,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:r(6132,3,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:r(6133,1,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:r(6134,3,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:r(6135,3,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:r(6136,3,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:r(6137,1,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:r(6138,1,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:r(6139,3,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:r(6140,1,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:r(6141,3,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:r(6142,1,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:r(6144,3,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:r(6146,3,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:r(6147,3,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:r(6148,3,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:r(6149,3,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:r(6150,3,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:r(6151,3,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:r(6152,3,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:r(6153,3,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:r(6154,3,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:r(6155,3,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:r(6156,3,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:r(6157,3,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:r(6158,3,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:r(6159,3,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:r(6160,3,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:r(6161,3,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:r(6162,3,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:r(6163,3,"The_character_set_of_the_input_files_6163","The character set of the input files."),Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1:r(6164,3,"Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164","Skipping module '{0}' that looks like an absolute URI, target file types: {1}."),Do_not_truncate_error_messages:r(6165,3,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:r(6166,3,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:r(6167,3,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:r(6168,3,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:r(6169,3,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:r(6170,3,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:r(6171,3,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5:r(6179,3,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5'."),Enable_all_strict_type_checking_options:r(6180,3,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),Scoped_package_detected_looking_in_0:r(6182,3,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:r(6183,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:r(6184,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:r(6186,3,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:r(6187,3,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:r(6188,1,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:r(6189,1,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:r(6191,3,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:r(6192,1,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:r(6193,3,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:r(6194,3,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:r(6195,3,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:r(6196,1,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:r(6197,3,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:r(6198,1,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:r(6199,1,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:r(6200,1,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:r(6201,3,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:r(6202,1,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:r(6203,3,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:r(6204,3,"and_here_6204","and here."),All_type_parameters_are_unused:r(6205,1,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:r(6206,3,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:r(6207,3,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:r(6208,3,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:r(6209,3,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:r(6210,3,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:r(6211,3,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:r(6212,3,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:r(6213,3,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:r(6214,3,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:r(6215,3,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:r(6216,3,"Found_1_error_6216","Found 1 error."),Found_0_errors:r(6217,3,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:r(6218,3,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:r(6219,3,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:r(6220,3,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:r(6221,3,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:r(6222,3,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:r(6223,3,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:r(6224,3,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:r(6225,3,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:r(6226,3,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:r(6227,3,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:r(6229,1,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:r(6230,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:r(6231,1,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:r(6232,1,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:r(6233,1,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:r(6234,1,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:r(6235,3,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:r(6236,1,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:r(6237,3,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:r(6238,1,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:r(6239,3,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:r(6240,3,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:r(6241,3,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:r(6242,3,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:r(6243,3,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:r(6244,3,"Modules_6244","Modules"),File_Management:r(6245,3,"File_Management_6245","File Management"),Emit:r(6246,3,"Emit_6246","Emit"),JavaScript_Support:r(6247,3,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:r(6248,3,"Type_Checking_6248","Type Checking"),Editor_Support:r(6249,3,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:r(6250,3,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:r(6251,3,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:r(6252,3,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:r(6253,3,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:r(6254,3,"Language_and_Environment_6254","Language and Environment"),Projects:r(6255,3,"Projects_6255","Projects"),Output_Formatting:r(6256,3,"Output_Formatting_6256","Output Formatting"),Completeness:r(6257,3,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:r(6258,1,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Found_1_error_in_0:r(6259,3,"Found_1_error_in_0_6259","Found 1 error in {0}"),Found_0_errors_in_the_same_file_starting_at_Colon_1:r(6260,3,"Found_0_errors_in_the_same_file_starting_at_Colon_1_6260","Found {0} errors in the same file, starting at: {1}"),Found_0_errors_in_1_files:r(6261,3,"Found_0_errors_in_1_files_6261","Found {0} errors in {1} files."),File_name_0_has_a_1_extension_looking_up_2_instead:r(6262,3,"File_name_0_has_a_1_extension_looking_up_2_instead_6262","File name '{0}' has a '{1}' extension - looking up '{2}' instead."),Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set:r(6263,1,"Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263","Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."),Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present:r(6264,3,"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264","Enable importing files with any extension, provided a declaration file is present."),Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder:r(6265,3,"Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265","Resolving type reference directive for program that specifies custom typeRoots, skipping lookup in 'node_modules' folder."),Option_0_can_only_be_specified_on_command_line:r(6266,1,"Option_0_can_only_be_specified_on_command_line_6266","Option '{0}' can only be specified on command line."),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:r(6270,3,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:r(6271,3,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:r(6272,3,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:r(6273,3,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:r(6274,3,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:r(6275,3,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:r(6276,3,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update:r(6277,3,"Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277","Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings:r(6278,3,"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278",`There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update:r(6279,3,"Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279","Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler:r(6280,3,"There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280","There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),package_json_has_a_peerDependencies_field:r(6281,3,"package_json_has_a_peerDependencies_field_6281","'package.json' has a 'peerDependencies' field."),Found_peerDependency_0_with_1_version:r(6282,3,"Found_peerDependency_0_with_1_version_6282","Found peerDependency '{0}' with '{1}' version."),Failed_to_find_peerDependency_0:r(6283,3,"Failed_to_find_peerDependency_0_6283","Failed to find peerDependency '{0}'."),Enable_project_compilation:r(6302,3,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:r(6304,1,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:r(6305,1,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:r(6306,1,"Referenced_project_0_must_have_setting_composite_Colon_true_6306",`Referenced project '{0}' must have setting "composite": true.`),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:r(6307,1,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Referenced_project_0_may_not_disable_emit:r(6310,1,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_output_1_is_older_than_input_2:r(6350,3,"Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350","Project '{0}' is out of date because output '{1}' is older than input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2:r(6351,3,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:r(6352,3,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:r(6353,3,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:r(6354,3,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:r(6355,3,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:r(6356,3,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:r(6357,3,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:r(6358,3,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:r(6359,3,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:r(6361,3,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:r(6362,3,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:r(6363,3,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:r(6364,3,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:r(6365,3,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects."),Show_what_would_be_built_or_deleted_if_specified_with_clean:r(6367,3,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:r(6369,1,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:r(6370,1,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:r(6371,3,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:r(6374,3,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:r(6377,1,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Composite_projects_may_not_disable_incremental_compilation:r(6379,1,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:r(6380,3,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:r(6381,3,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:r(6382,3,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:r(6383,3,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:r(6384,3,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:r(6385,2,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:r(6386,3,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:r(6387,2,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:r(6388,3,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:r(6389,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:r(6390,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:r(6391,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:r(6392,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:r(6393,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:r(6394,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:r(6395,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:r(6396,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:r(6397,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:r(6398,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted:r(6399,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399","Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files:r(6400,3,"Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400","Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),Project_0_is_out_of_date_because_there_was_error_reading_file_1:r(6401,3,"Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401","Project '{0}' is out of date because there was error reading file '{1}'"),Resolving_in_0_mode_with_conditions_1:r(6402,3,"Resolving_in_0_mode_with_conditions_1_6402","Resolving in {0} mode with conditions {1}."),Matched_0_condition_1:r(6403,3,"Matched_0_condition_1_6403","Matched '{0}' condition '{1}'."),Using_0_subpath_1_with_target_2:r(6404,3,"Using_0_subpath_1_with_target_2_6404","Using '{0}' subpath '{1}' with target '{2}'."),Saw_non_matching_condition_0:r(6405,3,"Saw_non_matching_condition_0_6405","Saw non-matching condition '{0}'."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions:r(6406,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406","Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"),Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set:r(6407,3,"Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407","Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."),Use_the_package_json_exports_field_when_resolving_package_imports:r(6408,3,"Use_the_package_json_exports_field_when_resolving_package_imports_6408","Use the package.json 'exports' field when resolving package imports."),Use_the_package_json_imports_field_when_resolving_imports:r(6409,3,"Use_the_package_json_imports_field_when_resolving_imports_6409","Use the package.json 'imports' field when resolving imports."),Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports:r(6410,3,"Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410","Conditions to set in addition to the resolver-specific defaults when resolving imports."),true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false:r(6411,3,"true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411","`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more:r(6412,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412","Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."),Entering_conditional_exports:r(6413,3,"Entering_conditional_exports_6413","Entering conditional exports."),Resolved_under_condition_0:r(6414,3,"Resolved_under_condition_0_6414","Resolved under condition '{0}'."),Failed_to_resolve_under_condition_0:r(6415,3,"Failed_to_resolve_under_condition_0_6415","Failed to resolve under condition '{0}'."),Exiting_conditional_exports:r(6416,3,"Exiting_conditional_exports_6416","Exiting conditional exports."),Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0:r(6417,3,"Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417","Searching all ancestor node_modules directories for preferred extensions: {0}."),Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0:r(6418,3,"Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418","Searching all ancestor node_modules directories for fallback extensions: {0}."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors:r(6419,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419","Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),Project_0_is_out_of_date_because_1:r(6420,3,"Project_0_is_out_of_date_because_1_6420","Project '{0}' is out of date because {1}."),Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files:r(6421,3,"Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421","Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:r(6500,3,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:r(6501,3,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:r(6502,3,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:r(6503,3,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:r(6504,1,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:r(6505,3,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:r(6506,3,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:r(6600,3,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:r(6601,3,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:r(6602,3,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:r(6603,3,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:r(6604,3,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:r(6605,3,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:r(6606,3,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:r(6607,3,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:r(6608,3,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:r(6609,3,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:r(6611,3,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:r(6612,3,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:r(6613,3,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:r(6614,3,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:r(6615,3,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:r(6616,3,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:r(6617,3,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:r(6618,3,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:r(6619,3,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:r(6620,3,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects."),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:r(6621,3,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:r(6622,3,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:r(6623,3,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:r(6624,3,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:r(6625,3,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:r(6626,3,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),Filters_results_from_the_include_option:r(6627,3,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:r(6628,3,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:r(6629,3,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_legacy_experimental_decorators:r(6630,3,"Enable_experimental_support_for_legacy_experimental_decorators_6630","Enable experimental support for legacy experimental decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:r(6631,3,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:r(6632,3,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:r(6633,3,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:r(6634,3,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:r(6635,3,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:r(6636,3,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date."),Ensure_that_casing_is_correct_in_imports:r(6637,3,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:r(6638,3,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:r(6639,3,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Skip_building_downstream_projects_on_error_in_upstream_project:r(6640,3,"Skip_building_downstream_projects_on_error_in_upstream_project_6640","Skip building downstream projects on error in upstream project."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:r(6641,3,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:r(6642,3,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:r(6643,3,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:r(6644,3,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:r(6645,3,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:r(6646,3,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:r(6647,3,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:r(6648,3,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:r(6649,3,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:r(6650,3,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:r(6651,3,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:r(6652,3,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:r(6653,3,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:r(6654,3,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:r(6655,3,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:r(6656,3,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),Specify_what_module_code_is_generated:r(6657,3,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:r(6658,3,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:r(6659,3,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:r(6660,3,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:r(6661,3,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like '__extends' in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:r(6662,3,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:r(6663,3,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:r(6664,3,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:r(6665,3,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied 'any' type."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:r(6666,3,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:r(6667,3,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:r(6668,3,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when 'this' is given the type 'any'."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:r(6669,3,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:r(6670,3,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:r(6671,3,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type."),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:r(6672,3,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:r(6673,3,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:r(6674,3,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add 'undefined' to a type when accessed using an index."),Enable_error_reporting_when_local_variables_aren_t_read:r(6675,3,"Enable_error_reporting_when_local_variables_aren_t_read_6675","Enable error reporting when local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:r(6676,3,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read."),Deprecated_setting_Use_outFile_instead:r(6677,3,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use 'outFile' instead."),Specify_an_output_folder_for_all_emitted_files:r(6678,3,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:r(6679,3,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:r(6680,3,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:r(6681,3,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:r(6682,3,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing 'const enum' declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:r(6683,3,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:r(6684,3,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode."),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:r(6685,3,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read."),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:r(6686,3,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:r(6687,3,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:r(6688,3,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:r(6689,3,"Enable_importing_json_files_6689","Enable importing .json files."),Specify_the_root_folder_within_your_source_files:r(6690,3,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:r(6691,3,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:r(6692,3,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:r(6693,3,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:r(6694,3,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:r(6695,3,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:r(6697,3,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:r(6698,3,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:r(6699,3,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account 'null' and 'undefined'."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:r(6700,3,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:r(6701,3,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have '@internal' in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:r(6702,3,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:r(6703,3,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:r(6704,3,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:r(6705,3,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:r(6706,3,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the 'moduleResolution' process."),Specify_the_path_to_tsbuildinfo_incremental_compilation_file:r(6707,3,"Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707","Specify the path to .tsbuildinfo incremental compilation file."),Specify_options_for_automatic_acquisition_of_declaration_files:r(6709,3,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:r(6710,3,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like './node_modules/@types'."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:r(6711,3,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:r(6712,3,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:r(6713,3,"Enable_verbose_logging_6713","Enable verbose logging."),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:r(6714,3,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:r(6715,3,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:r(6717,3,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:r(6718,3,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types."),Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files:r(6719,3,"Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719","Require sufficient annotation on exports so other tools can trivially generate declaration files."),Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any:r(6720,3,"Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720","Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),Default_catch_clause_variables_as_unknown_instead_of_any:r(6803,3,"Default_catch_clause_variables_as_unknown_instead_of_any_6803","Default catch clause variables as 'unknown' instead of 'any'."),Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting:r(6804,3,"Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804","Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported:r(6805,3,"Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805","Disable full type checking (only critical parse and emit errors will be reported)."),Check_side_effect_imports:r(6806,3,"Check_side_effect_imports_6806","Check side effect imports."),This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2:r(6807,1,"This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807","This operation can be simplified. This shift is identical to `{0} {1} {2}`."),one_of_Colon:r(6900,3,"one_of_Colon_6900","one of:"),one_or_more_Colon:r(6901,3,"one_or_more_Colon_6901","one or more:"),type_Colon:r(6902,3,"type_Colon_6902","type:"),default_Colon:r(6903,3,"default_Colon_6903","default:"),module_system_or_esModuleInterop:r(6904,3,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:r(6905,3,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:r(6906,3,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:r(6907,3,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:r(6908,3,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:r(6909,3,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:r(69010,3,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:r(6911,3,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:r(6912,3,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:r(6913,3,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:r(6914,3,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:r(6915,3,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:r(6916,3,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:r(6917,3,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:r(6918,3,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:r(6919,3,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:r(6920,3,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:r(6921,3,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:r(6922,3,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:r(6923,3,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:r(6924,3,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:r(6925,3,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:r(6926,3,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:r(6927,3,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:r(6928,3,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:r(6929,3,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:r(6930,3,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),List_of_file_name_suffixes_to_search_when_resolving_a_module:r(6931,1,"List_of_file_name_suffixes_to_search_when_resolving_a_module_6931","List of file name suffixes to search when resolving a module."),Variable_0_implicitly_has_an_1_type:r(7005,1,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:r(7006,1,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:r(7008,1,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:r(7009,1,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:r(7010,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:r(7011,1,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation:r(7012,1,"This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012","This overload implicitly returns the type '{0}' because it lacks a return type annotation."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:r(7013,1,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:r(7014,1,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:r(7015,1,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:r(7016,1,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:r(7017,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:r(7018,1,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:r(7019,1,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:r(7020,1,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:r(7022,1,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:r(7023,1,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:r(7024,1,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation:r(7025,1,"Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation_7025","Generator implicitly has yield type '{0}'. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:r(7026,1,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:r(7027,1,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:r(7028,1,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:r(7029,1,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:r(7030,1,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:r(7031,1,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:r(7032,1,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:r(7033,1,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:r(7034,1,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:r(7035,1,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:r(7036,1,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:r(7037,3,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:r(7038,3,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:r(7039,1,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:r(7040,1,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:r(7041,1,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:r(7042,1,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:r(7043,2,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:r(7044,2,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:r(7045,2,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:r(7046,2,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:r(7047,2,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:r(7048,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:r(7049,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:r(7050,2,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:r(7051,1,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:r(7052,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:r(7053,1,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:r(7054,1,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:r(7055,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:r(7056,1,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:r(7057,1,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:r(7058,1,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:r(7059,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:r(7060,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:r(7061,1,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),You_cannot_rename_this_element:r(8e3,1,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:r(8001,1,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:r(8002,1,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:r(8003,1,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:r(8004,1,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:r(8005,1,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:r(8006,1,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:r(8008,1,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:r(8009,1,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:r(8010,1,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:r(8011,1,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:r(8012,1,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:r(8013,1,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:r(8016,1,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Signature_declarations_can_only_be_used_in_TypeScript_files:r(8017,1,"Signature_declarations_can_only_be_used_in_TypeScript_files_8017","Signature declarations can only be used in TypeScript files."),Report_errors_in_js_files:r(8019,3,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:r(8020,1,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:r(8021,1,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:r(8022,1,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:r(8023,1,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:r(8024,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:r(8025,1,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:r(8026,1,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:r(8027,1,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:r(8028,1,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:r(8029,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:r(8030,1,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:r(8031,1,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:r(8032,1,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:r(8033,1,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:r(8034,1,"The_tag_was_first_specified_here_8034","The tag was first specified here."),You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:r(8035,1,"You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035","You cannot rename elements that are defined in a 'node_modules' folder."),You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder:r(8036,1,"You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036","You cannot rename elements that are defined in another 'node_modules' folder."),Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files:r(8037,1,"Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037","Type satisfaction expressions can only be used in TypeScript files."),Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export:r(8038,1,"Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038","Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag:r(8039,1,"A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039","A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:r(9005,1,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:r(9006,1,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations:r(9007,1,"Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9007","Function must have an explicit return type annotation with --isolatedDeclarations."),Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations:r(9008,1,"Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9008","Method must have an explicit return type annotation with --isolatedDeclarations."),At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations:r(9009,1,"At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9009","At least one accessor must have an explicit type annotation with --isolatedDeclarations."),Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations:r(9010,1,"Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9010","Variable must have an explicit type annotation with --isolatedDeclarations."),Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations:r(9011,1,"Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9011","Parameter must have an explicit type annotation with --isolatedDeclarations."),Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations:r(9012,1,"Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9012","Property must have an explicit type annotation with --isolatedDeclarations."),Expression_type_can_t_be_inferred_with_isolatedDeclarations:r(9013,1,"Expression_type_can_t_be_inferred_with_isolatedDeclarations_9013","Expression type can't be inferred with --isolatedDeclarations."),Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations:r(9014,1,"Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedD_9014","Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations."),Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations:r(9015,1,"Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations_9015","Objects that contain spread assignments can't be inferred with --isolatedDeclarations."),Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations:r(9016,1,"Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations_9016","Objects that contain shorthand properties can't be inferred with --isolatedDeclarations."),Only_const_arrays_can_be_inferred_with_isolatedDeclarations:r(9017,1,"Only_const_arrays_can_be_inferred_with_isolatedDeclarations_9017","Only const arrays can be inferred with --isolatedDeclarations."),Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations:r(9018,1,"Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations_9018","Arrays with spread elements can't inferred with --isolatedDeclarations."),Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations:r(9019,1,"Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations_9019","Binding elements can't be exported directly with --isolatedDeclarations."),Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations:r(9020,1,"Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDecl_9020","Enum member initializers must be computable without references to external symbols with --isolatedDeclarations."),Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations:r(9021,1,"Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations_9021","Extends clause can't contain an expression with --isolatedDeclarations."),Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations:r(9022,1,"Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations_9022","Inference from class expressions is not supported with --isolatedDeclarations."),Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function:r(9023,1,"Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations__9023","Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function."),Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations:r(9025,1,"Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_sup_9025","Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations."),Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations:r(9026,1,"Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_support_9026","Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations."),Add_a_type_annotation_to_the_variable_0:r(9027,1,"Add_a_type_annotation_to_the_variable_0_9027","Add a type annotation to the variable {0}."),Add_a_type_annotation_to_the_parameter_0:r(9028,1,"Add_a_type_annotation_to_the_parameter_0_9028","Add a type annotation to the parameter {0}."),Add_a_type_annotation_to_the_property_0:r(9029,1,"Add_a_type_annotation_to_the_property_0_9029","Add a type annotation to the property {0}."),Add_a_return_type_to_the_function_expression:r(9030,1,"Add_a_return_type_to_the_function_expression_9030","Add a return type to the function expression."),Add_a_return_type_to_the_function_declaration:r(9031,1,"Add_a_return_type_to_the_function_declaration_9031","Add a return type to the function declaration."),Add_a_return_type_to_the_get_accessor_declaration:r(9032,1,"Add_a_return_type_to_the_get_accessor_declaration_9032","Add a return type to the get accessor declaration."),Add_a_type_to_parameter_of_the_set_accessor_declaration:r(9033,1,"Add_a_type_to_parameter_of_the_set_accessor_declaration_9033","Add a type to parameter of the set accessor declaration."),Add_a_return_type_to_the_method:r(9034,1,"Add_a_return_type_to_the_method_9034","Add a return type to the method"),Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit:r(9035,1,"Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035","Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit."),Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it:r(9036,1,"Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036","Move the expression in default export to a variable and add a type annotation to it."),Default_exports_can_t_be_inferred_with_isolatedDeclarations:r(9037,1,"Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037","Default exports can't be inferred with --isolatedDeclarations."),Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations:r(9038,1,"Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038","Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."),Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations:r(9039,1,"Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039","Type containing private name '{0}' can't be used with --isolatedDeclarations."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:r(17e3,1,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:r(17001,1,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:r(17002,1,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:r(17004,1,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:r(17005,1,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:r(17006,1,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:r(17007,1,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:r(17008,1,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:r(17009,1,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:r(17010,1,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:r(17011,1,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:r(17012,1,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:r(17013,1,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:r(17014,1,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:r(17015,1,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:r(17016,1,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:r(17017,1,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:r(17018,1,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:r(17019,1,"_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17019","'{0}' at the end of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:r(17020,1,"_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17020","'{0}' at the start of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),Unicode_escape_sequence_cannot_appear_here:r(17021,1,"Unicode_escape_sequence_cannot_appear_here_17021","Unicode escape sequence cannot appear here."),Circularity_detected_while_resolving_configuration_Colon_0:r(18e3,1,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:r(18002,1,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:r(18003,1,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:r(80001,2,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:r(80002,2,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:r(80003,2,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:r(80004,2,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:r(80005,2,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:r(80006,2,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:r(80007,2,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:r(80008,2,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),JSDoc_typedef_may_be_converted_to_TypeScript_type:r(80009,2,"JSDoc_typedef_may_be_converted_to_TypeScript_type_80009","JSDoc typedef may be converted to TypeScript type."),JSDoc_typedefs_may_be_converted_to_TypeScript_types:r(80010,2,"JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010","JSDoc typedefs may be converted to TypeScript types."),Add_missing_super_call:r(90001,3,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:r(90002,3,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:r(90003,3,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:r(90004,3,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:r(90005,3,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:r(90006,3,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:r(90007,3,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:r(90008,3,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:r(90010,3,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:r(90011,3,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:r(90012,3,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_1:r(90013,3,"Import_0_from_1_90013",`Import '{0}' from "{1}"`),Change_0_to_1:r(90014,3,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Declare_property_0:r(90016,3,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:r(90017,3,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:r(90018,3,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:r(90019,3,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:r(90020,3,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:r(90021,3,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:r(90022,3,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:r(90023,3,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:r(90024,3,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:r(90025,3,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:r(90026,3,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:r(90027,3,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:r(90028,3,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:r(90029,3,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:r(90030,3,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:r(90031,3,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Add_parameter_name:r(90034,3,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:r(90035,3,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:r(90036,3,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:r(90037,3,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:r(90038,3,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:r(90039,3,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:r(90041,3,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:r(90053,3,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:r(90054,3,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Remove_type_from_import_declaration_from_0:r(90055,3,"Remove_type_from_import_declaration_from_0_90055",`Remove 'type' from import declaration from "{0}"`),Remove_type_from_import_of_0_from_1:r(90056,3,"Remove_type_from_import_of_0_from_1_90056",`Remove 'type' from import of '{0}' from "{1}"`),Add_import_from_0:r(90057,3,"Add_import_from_0_90057",'Add import from "{0}"'),Update_import_from_0:r(90058,3,"Update_import_from_0_90058",'Update import from "{0}"'),Export_0_from_module_1:r(90059,3,"Export_0_from_module_1_90059","Export '{0}' from module '{1}'"),Export_all_referenced_locals:r(90060,3,"Export_all_referenced_locals_90060","Export all referenced locals"),Update_modifiers_of_0:r(90061,3,"Update_modifiers_of_0_90061","Update modifiers of '{0}'"),Add_annotation_of_type_0:r(90062,3,"Add_annotation_of_type_0_90062","Add annotation of type '{0}'"),Add_return_type_0:r(90063,3,"Add_return_type_0_90063","Add return type '{0}'"),Extract_base_class_to_variable:r(90064,3,"Extract_base_class_to_variable_90064","Extract base class to variable"),Extract_default_export_to_variable:r(90065,3,"Extract_default_export_to_variable_90065","Extract default export to variable"),Extract_binding_expressions_to_variable:r(90066,3,"Extract_binding_expressions_to_variable_90066","Extract binding expressions to variable"),Add_all_missing_type_annotations:r(90067,3,"Add_all_missing_type_annotations_90067","Add all missing type annotations"),Add_satisfies_and_an_inline_type_assertion_with_0:r(90068,3,"Add_satisfies_and_an_inline_type_assertion_with_0_90068","Add satisfies and an inline type assertion with '{0}'"),Extract_to_variable_and_replace_with_0_as_typeof_0:r(90069,3,"Extract_to_variable_and_replace_with_0_as_typeof_0_90069","Extract to variable and replace with '{0} as typeof {0}'"),Mark_array_literal_as_const:r(90070,3,"Mark_array_literal_as_const_90070","Mark array literal as const"),Annotate_types_of_properties_expando_function_in_a_namespace:r(90071,3,"Annotate_types_of_properties_expando_function_in_a_namespace_90071","Annotate types of properties expando function in a namespace"),Convert_function_to_an_ES2015_class:r(95001,3,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:r(95003,3,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:r(95004,3,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:r(95005,3,"Extract_function_95005","Extract function"),Extract_constant:r(95006,3,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:r(95007,3,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:r(95008,3,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:r(95009,3,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:r(95011,3,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:r(95012,3,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:r(95013,3,"Convert_to_default_import_95013","Convert to default import"),Install_0:r(95014,3,"Install_0_95014","Install '{0}'"),Replace_import_with_0:r(95015,3,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:r(95016,3,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:r(95017,3,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:r(95018,3,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:r(95019,3,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:r(95020,3,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:r(95021,3,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:r(95022,3,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:r(95023,3,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:r(95024,3,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:r(95025,3,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:r(95026,3,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:r(95027,3,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:r(95028,3,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:r(95029,3,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:r(95030,3,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:r(95031,3,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:r(95032,3,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:r(95033,3,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:r(95034,3,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:r(95035,3,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:r(95036,3,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:r(95037,3,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:r(95038,3,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:r(95039,3,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:r(95040,3,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:r(95041,3,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:r(95042,3,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:r(95043,3,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:r(95044,3,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:r(95045,3,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:r(95046,3,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:r(95047,3,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:r(95048,3,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:r(95049,3,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:r(95050,3,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:r(95051,3,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:r(95052,3,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:r(95053,3,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:r(95054,3,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:r(95055,3,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:r(95056,3,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:r(95057,3,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:r(95058,3,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:r(95059,3,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:r(95060,3,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:r(95061,3,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:r(95062,3,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:r(95063,3,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:r(95064,3,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:r(95065,3,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:r(95066,3,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:r(95067,3,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:r(95068,3,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:r(95069,3,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:r(95070,3,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:r(95071,3,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:r(95072,3,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:r(95073,3,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:r(95074,3,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:r(95075,3,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:r(95077,3,"Extract_type_95077","Extract type"),Extract_to_type_alias:r(95078,3,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:r(95079,3,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:r(95080,3,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:r(95081,3,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:r(95082,3,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:r(95083,3,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:r(95084,3,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:r(95085,3,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:r(95086,3,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:r(95087,3,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:r(95088,3,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:r(95089,3,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:r(95090,3,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:r(95091,3,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:r(95092,3,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:r(95093,3,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:r(95094,3,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:r(95095,3,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:r(95096,3,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:r(95097,3,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:r(95098,3,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:r(95099,3,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:r(95100,3,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:r(95101,3,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_all_const_to_let:r(95102,3,"Convert_all_const_to_let_95102","Convert all 'const' to 'let'"),Convert_function_expression_0_to_arrow_function:r(95105,3,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:r(95106,3,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:r(95107,3,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:r(95108,3,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:r(95109,3,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file:r(95110,3,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig to read more about this file"),Add_a_return_statement:r(95111,3,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:r(95112,3,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:r(95113,3,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:r(95114,3,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:r(95115,3,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:r(95116,3,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:r(95117,3,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:r(95118,3,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:r(95119,3,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:r(95120,3,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:r(95121,3,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:r(95122,3,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:r(95123,3,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:r(95124,3,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:r(95125,3,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:r(95126,3,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:r(95127,3,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:r(95128,3,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:r(95129,3,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:r(95130,3,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:r(95131,3,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:r(95132,3,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:r(95133,3,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:r(95134,3,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:r(95135,3,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:r(95136,3,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:r(95137,3,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:r(95138,3,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:r(95139,3,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:r(95140,3,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:r(95141,3,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:r(95142,3,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:r(95143,3,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:r(95144,3,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:r(95145,3,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:r(95146,3,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:r(95147,3,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:r(95148,3,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:r(95149,3,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:r(95150,3,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:r(95151,3,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:r(95152,3,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:r(95153,3,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenations_and_string_literals:r(95154,3,"Can_only_convert_string_concatenations_and_string_literals_95154","Can only convert string concatenations and string literals"),Selection_is_not_a_valid_statement_or_statements:r(95155,3,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:r(95156,3,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:r(95157,3,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:r(95158,3,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:r(95159,3,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:r(95160,3,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:r(95161,3,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:r(95162,3,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:r(95163,3,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:r(95164,3,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:r(95165,3,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:r(95166,3,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:r(95167,3,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:r(95168,3,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:r(95169,3,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),Convert_named_imports_to_default_import:r(95170,3,"Convert_named_imports_to_default_import_95170","Convert named imports to default import"),Delete_unused_param_tag_0:r(95171,3,"Delete_unused_param_tag_0_95171","Delete unused '@param' tag '{0}'"),Delete_all_unused_param_tags:r(95172,3,"Delete_all_unused_param_tags_95172","Delete all unused '@param' tags"),Rename_param_tag_name_0_to_1:r(95173,3,"Rename_param_tag_name_0_to_1_95173","Rename '@param' tag name '{0}' to '{1}'"),Use_0:r(95174,3,"Use_0_95174","Use `{0}`."),Use_Number_isNaN_in_all_conditions:r(95175,3,"Use_Number_isNaN_in_all_conditions_95175","Use `Number.isNaN` in all conditions."),Convert_typedef_to_TypeScript_type:r(95176,3,"Convert_typedef_to_TypeScript_type_95176","Convert typedef to TypeScript type."),Convert_all_typedef_to_TypeScript_types:r(95177,3,"Convert_all_typedef_to_TypeScript_types_95177","Convert all typedef to TypeScript types."),Move_to_file:r(95178,3,"Move_to_file_95178","Move to file"),Cannot_move_to_file_selected_file_is_invalid:r(95179,3,"Cannot_move_to_file_selected_file_is_invalid_95179","Cannot move to file, selected file is invalid"),Use_import_type:r(95180,3,"Use_import_type_95180","Use 'import type'"),Use_type_0:r(95181,3,"Use_type_0_95181","Use 'type {0}'"),Fix_all_with_type_only_imports:r(95182,3,"Fix_all_with_type_only_imports_95182","Fix all with type-only imports"),Cannot_move_statements_to_the_selected_file:r(95183,3,"Cannot_move_statements_to_the_selected_file_95183","Cannot move statements to the selected file"),Inline_variable:r(95184,3,"Inline_variable_95184","Inline variable"),Could_not_find_variable_to_inline:r(95185,3,"Could_not_find_variable_to_inline_95185","Could not find variable to inline."),Variables_with_multiple_declarations_cannot_be_inlined:r(95186,3,"Variables_with_multiple_declarations_cannot_be_inlined_95186","Variables with multiple declarations cannot be inlined."),Add_missing_comma_for_object_member_completion_0:r(95187,3,"Add_missing_comma_for_object_member_completion_0_95187","Add missing comma for object member completion '{0}'."),Add_missing_parameter_to_0:r(95188,3,"Add_missing_parameter_to_0_95188","Add missing parameter to '{0}'"),Add_missing_parameters_to_0:r(95189,3,"Add_missing_parameters_to_0_95189","Add missing parameters to '{0}'"),Add_all_missing_parameters:r(95190,3,"Add_all_missing_parameters_95190","Add all missing parameters"),Add_optional_parameter_to_0:r(95191,3,"Add_optional_parameter_to_0_95191","Add optional parameter to '{0}'"),Add_optional_parameters_to_0:r(95192,3,"Add_optional_parameters_to_0_95192","Add optional parameters to '{0}'"),Add_all_optional_parameters:r(95193,3,"Add_all_optional_parameters_95193","Add all optional parameters"),Wrap_in_parentheses:r(95194,3,"Wrap_in_parentheses_95194","Wrap in parentheses"),Wrap_all_invalid_decorator_expressions_in_parentheses:r(95195,3,"Wrap_all_invalid_decorator_expressions_in_parentheses_95195","Wrap all invalid decorator expressions in parentheses"),Add_resolution_mode_import_attribute:r(95196,3,"Add_resolution_mode_import_attribute_95196","Add 'resolution-mode' import attribute"),Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it:r(95197,3,"Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it_95197","Add 'resolution-mode' import attribute to all type-only imports that need it"),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:r(18004,1,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:r(18006,1,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:r(18007,1,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:r(18009,1,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:r(18010,1,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:r(18011,1,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:r(18012,1,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:r(18013,1,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:r(18014,1,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:r(18015,1,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:r(18016,1,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:r(18017,1,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:r(18018,1,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:r(18019,1,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:r(18024,1,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:r(18026,1,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:r(18027,1,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:r(18028,1,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:r(18029,1,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:r(18030,1,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:r(18031,1,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:r(18032,1,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values:r(18033,1,"Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033","Type '{0}' is not assignable to type '{1}' as required for computed enum member values."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:r(18034,3,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:r(18035,1,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:r(18036,1,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),await_expression_cannot_be_used_inside_a_class_static_block:r(18037,1,"await_expression_cannot_be_used_inside_a_class_static_block_18037","'await' expression cannot be used inside a class static block."),for_await_loops_cannot_be_used_inside_a_class_static_block:r(18038,1,"for_await_loops_cannot_be_used_inside_a_class_static_block_18038","'for await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:r(18039,1,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:r(18041,1,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block."),_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation:r(18042,1,"_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042","'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."),Types_cannot_appear_in_export_declarations_in_JavaScript_files:r(18043,1,"Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043","Types cannot appear in export declarations in JavaScript files."),_0_is_automatically_exported_here:r(18044,3,"_0_is_automatically_exported_here_18044","'{0}' is automatically exported here."),Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher:r(18045,1,"Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045","Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."),_0_is_of_type_unknown:r(18046,1,"_0_is_of_type_unknown_18046","'{0}' is of type 'unknown'."),_0_is_possibly_null:r(18047,1,"_0_is_possibly_null_18047","'{0}' is possibly 'null'."),_0_is_possibly_undefined:r(18048,1,"_0_is_possibly_undefined_18048","'{0}' is possibly 'undefined'."),_0_is_possibly_null_or_undefined:r(18049,1,"_0_is_possibly_null_or_undefined_18049","'{0}' is possibly 'null' or 'undefined'."),The_value_0_cannot_be_used_here:r(18050,1,"The_value_0_cannot_be_used_here_18050","The value '{0}' cannot be used here."),Compiler_option_0_cannot_be_given_an_empty_string:r(18051,1,"Compiler_option_0_cannot_be_given_an_empty_string_18051","Compiler option '{0}' cannot be given an empty string."),Its_type_0_is_not_a_valid_JSX_element_type:r(18053,1,"Its_type_0_is_not_a_valid_JSX_element_type_18053","Its type '{0}' is not a valid JSX element type."),await_using_statements_cannot_be_used_inside_a_class_static_block:r(18054,1,"await_using_statements_cannot_be_used_inside_a_class_static_block_18054","'await using' statements cannot be used inside a class static block."),_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled:r(18055,1,"_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055","'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."),Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled:r(18056,1,"Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056","Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."),String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020:r(18057,1,"String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057","String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'.")};function wt(e){return e>=80}function Yy(e){return e===32||wt(e)}var rf={abstract:128,accessor:129,any:133,as:130,asserts:131,assert:132,bigint:163,boolean:136,break:83,case:84,catch:85,class:86,continue:88,const:87,constructor:137,debugger:89,declare:138,default:90,delete:91,do:92,else:93,enum:94,export:95,extends:96,false:97,finally:98,for:99,from:161,function:100,get:139,if:101,implements:119,import:102,in:103,infer:140,instanceof:104,interface:120,intrinsic:141,is:142,keyof:143,let:121,module:144,namespace:145,never:146,new:105,null:106,number:150,object:151,package:122,private:123,protected:124,public:125,override:164,out:147,readonly:148,require:149,global:162,return:107,satisfies:152,set:153,static:126,string:154,super:108,switch:109,symbol:155,this:110,throw:111,true:112,try:113,type:156,typeof:114,undefined:157,unique:158,unknown:159,using:160,var:115,void:116,while:117,with:118,yield:127,async:134,await:135,of:165},Xy=new Map(Object.entries(rf)),Um=new Map(Object.entries({...rf,"{":19,"}":20,"(":21,")":22,"[":23,"]":24,".":25,"...":26,";":27,",":28,"<":30,">":32,"<=":33,">=":34,"==":35,"!=":36,"===":37,"!==":38,"=>":39,"+":40,"-":41,"**":43,"*":42,"/":44,"%":45,"++":46,"--":47,"<<":48,">":49,">>>":50,"&":51,"|":52,"^":53,"!":54,"~":55,"&&":56,"||":57,"?":58,"??":61,"?.":29,":":59,"=":64,"+=":65,"-=":66,"*=":67,"**=":68,"/=":69,"%=":70,"<<=":71,">>=":72,">>>=":73,"&=":74,"|=":75,"^=":79,"||=":76,"&&=":77,"??=":78,"@":60,"#":63,"`":62})),Bm=new Map([[100,1],[103,2],[105,4],[109,8],[115,16],[117,32],[118,64],[121,128]]),Hy=new Map([[1,Q_.RegularExpressionFlagsHasIndices],[16,Q_.RegularExpressionFlagsDotAll],[32,Q_.RegularExpressionFlagsUnicode],[64,Q_.RegularExpressionFlagsUnicodeSets],[128,Q_.RegularExpressionFlagsSticky]]),$y=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],Qy=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],Ky=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2160,2183,2185,2190,2208,2249,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3165,3165,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3293,3294,3296,3297,3313,3314,3332,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5905,5919,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6988,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42954,42960,42961,42963,42963,42965,42969,42994,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69248,69289,69296,69297,69376,69404,69415,69415,69424,69445,69488,69505,69552,69572,69600,69622,69635,69687,69745,69746,69749,69749,69763,69807,69840,69864,69891,69926,69956,69956,69959,69959,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70207,70208,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70753,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71488,71494,71680,71723,71840,71903,71935,71942,71945,71945,71948,71955,71957,71958,71960,71983,71999,71999,72001,72001,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72368,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73474,73474,73476,73488,73490,73523,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78913,78918,82944,83526,92160,92728,92736,92766,92784,92862,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101589,101632,101640,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,122624,122654,122661,122666,122928,122989,123136,123180,123191,123197,123214,123214,123536,123565,123584,123627,124112,124139,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173791,173824,177977,177984,178205,178208,183969,183984,191456,191472,192093,194560,195101,196608,201546,201552,205743],Zy=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2160,2183,2185,2190,2200,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2901,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3132,3140,3142,3144,3146,3149,3157,3158,3160,3162,3165,3165,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3293,3294,3296,3299,3302,3311,3313,3315,3328,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3457,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3790,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5909,5919,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6159,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6847,6862,6912,6988,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42954,42960,42961,42963,42963,42965,42969,42994,43047,43052,43052,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69248,69289,69291,69292,69296,69297,69373,69404,69415,69415,69424,69456,69488,69509,69552,69572,69600,69622,69632,69702,69734,69749,69759,69818,69826,69826,69840,69864,69872,69881,69888,69940,69942,69951,69956,69959,69968,70003,70006,70006,70016,70084,70089,70092,70094,70106,70108,70108,70144,70161,70163,70199,70206,70209,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70753,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71488,71494,71680,71738,71840,71913,71935,71942,71945,71945,71948,71955,71957,71958,71960,71989,71991,71992,71995,72003,72016,72025,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72368,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73472,73488,73490,73530,73534,73538,73552,73561,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78912,78933,82944,83526,92160,92728,92736,92766,92768,92777,92784,92862,92864,92873,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94180,94192,94193,94208,100343,100352,101589,101632,101640,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,118528,118573,118576,118598,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122624,122654,122661,122666,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,122928,122989,123023,123023,123136,123180,123184,123197,123200,123209,123214,123214,123536,123566,123584,123641,124112,124153,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,130032,130041,131072,173791,173824,177977,177984,178205,178208,183969,183984,191456,191472,192093,194560,195101,196608,201546,201552,205743,917760,917999],eg=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,tg=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/,ng=/@(?:see|link)/i;function ml(e,t){if(e=2?ml(e,Ky):ml(e,$y)}function ig(e,t){return t>=2?ml(e,Zy):ml(e,Qy)}function qm(e){let t=[];return e.forEach((a,o)=>{t[a]=o}),t}var ag=qm(Um);function it(e){return ag[e]}function zm(e){return Um.get(e)}var Y4=qm(Bm);function Dd(e){return Bm.get(e)}function Fm(e){let t=[],a=0,o=0;for(;a127&&Cn(m)&&(t.push(o),o=a);break}}return t.push(o),t}function _g(e,t,a,o,m){(t<0||t>=e.length)&&(m?t=t<0?0:t>=e.length?e.length-1:t:B.fail(`Bad line number. Line: ${t}, lineStarts.length: ${e.length} , line map is correct? ${o!==void 0?ly(e,Fm(o)):"unknown"}`));let v=e[t]+a;return m?v>e[t+1]?e[t+1]:typeof o=="string"&&v>o.length?o.length:v:(t=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function Cn(e){return e===10||e===13||e===8232||e===8233}function fi(e){return e>=48&&e<=57}function Tp(e){return fi(e)||e>=65&&e<=70||e>=97&&e<=102}function af(e){return e>=65&&e<=90||e>=97&&e<=122}function Wm(e){return af(e)||fi(e)||e===95}function xp(e){return e>=48&&e<=55}function Ar(e,t,a,o,m){if(fs(t))return t;let v=!1;for(;;){let A=e.charCodeAt(t);switch(A){case 13:e.charCodeAt(t+1)===10&&t++;case 10:if(t++,a)return t;v=!!m;continue;case 9:case 11:case 12:case 32:t++;continue;case 47:if(o)break;if(e.charCodeAt(t+1)===47){for(t+=2;t127&&Ba(A)){t++;continue}break}return t}}var ol=7;function Wi(e,t){if(B.assert(t>=0),t===0||Cn(e.charCodeAt(t-1))){let a=e.charCodeAt(t);if(t+ol=0&&a127&&Ba(I)){y&&Cn(I)&&(h=!0),a++;continue}break e}}return y&&(x=m(P,l,Q,h,v,x)),x}function Xm(e,t,a,o){return Sl(!1,e,t,!1,a,o)}function Hm(e,t,a,o){return Sl(!1,e,t,!0,a,o)}function cg(e,t,a,o,m){return Sl(!0,e,t,!1,a,o,m)}function lg(e,t,a,o,m){return Sl(!0,e,t,!0,a,o,m)}function $m(e,t,a,o,m,v=[]){return v.push({kind:a,pos:e,end:t,hasTrailingNewLine:o}),v}function Lp(e,t){return cg(e,t,$m,void 0,void 0)}function ug(e,t){return lg(e,t,$m,void 0,void 0)}function sf(e){let t=_f.exec(e);if(t)return t[0]}function Zn(e,t){return af(e)||e===36||e===95||e>127&&rg(e,t)}function Er(e,t,a){return Wm(e)||e===36||(a===1?e===45||e===58:!1)||e>127&&ig(e,t)}function pg(e,t,a){let o=Gi(e,0);if(!Zn(o,t))return!1;for(let m=Ft(o);mh,getStartPos:()=>h,getTokenEnd:()=>l,getTextPos:()=>l,getToken:()=>g,getTokenStart:()=>y,getTokenPos:()=>y,getTokenText:()=>P.substring(y,l),getTokenValue:()=>x,hasUnicodeEscape:()=>(I&1024)!==0,hasExtendedUnicodeEscape:()=>(I&8)!==0,hasPrecedingLineBreak:()=>(I&1)!==0,hasPrecedingJSDocComment:()=>(I&2)!==0,hasPrecedingJSDocLeadingAsterisks:()=>(I&32768)!==0,isIdentifier:()=>g===80||g>118,isReservedWord:()=>g>=83&&g<=118,isUnterminated:()=>(I&4)!==0,getCommentDirectives:()=>re,getNumericLiteralFlags:()=>I&25584,getTokenFlags:()=>I,reScanGreaterToken:lt,reScanAsteriskEqualsToken:ar,reScanSlashToken:mt,reScanTemplateToken:Bt,reScanTemplateHeadOrNoSubstitutionTemplate:rn,scanJsxIdentifier:Nr,scanJsxAttributeValue:Vn,reScanJsxAttributeValue:Ce,reScanJsxToken:_r,reScanLessThanToken:fr,reScanHashToken:dr,reScanQuestionToken:zn,reScanInvalidIdentifier:Ut,scanJsxToken:Fn,scanJsDocToken:L,scanJSDocCommentTextToken:mr,scan:ct,getText:Ke,clearCommentDirectives:st,setText:Dt,setScriptTarget:ut,setLanguageVariant:Ir,setScriptKind:hr,setJSDocParsingMode:Mn,setOnError:Tt,resetTokenState:Wn,setTextPos:Wn,setSkipJsDocLeadingAsterisks:Si,tryScan:He,lookAhead:Te,scanRange:fe};return B.isDebugging&&Object.defineProperty(M,"__debugShowCurrentPositionInText",{get:()=>{let R=M.getText();return R.slice(0,M.getTokenFullStart())+"\u2551"+R.slice(M.getTokenFullStart())}}),M;function ae(R){return Gi(P,R)}function Oe(R){return R>=0&&R=0&&R=65&&be<=70)be+=32;else if(!(be>=48&&be<=57||be>=97&&be<=102))break;xe.push(be),l++,we=!1}return xe.length=Q){K+=P.substring(xe,l),I|=4,W(E.Unterminated_string_literal);break}let Se=V(l);if(Se===$){K+=P.substring(xe,l),l++;break}if(Se===92&&!R){K+=P.substring(xe,l),K+=Ot(3),xe=l;continue}if((Se===10||Se===13)&&!R){K+=P.substring(xe,l),I|=4,W(E.Unterminated_string_literal);break}l++}return K}function Pr(R){let $=V(l)===96;l++;let K=l,xe="",Se;for(;;){if(l>=Q){xe+=P.substring(K,l),I|=4,W(E.Unterminated_template_literal),Se=$?15:18;break}let we=V(l);if(we===96){xe+=P.substring(K,l),l++,Se=$?15:18;break}if(we===36&&l+1=Q)return W(E.Unexpected_end_of_text),"";let K=V(l);switch(l++,K){case 48:if(l>=Q||!fi(V(l)))return"\0";case 49:case 50:case 51:l=55296&&xe<=56319&&l+6=56320&&We<=57343)return l=be,Se+String.fromCharCode(We)}return Se;case 120:for(;l<$+4;l++)if(!(l1114111&&(R&&W(E.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,K,l-K),we=!0),l>=Q?(R&&W(E.Unexpected_end_of_text),we=!0):V(l)===125?l++:(R&&W(E.Unterminated_Unicode_escape_sequence),we=!0),we?(I|=2048,P.substring($,l)):(I|=8,Pd(Se))}function On(){if(l+5=0&&Er(K,e)){R+=Bn(!0),$=l;continue}if(K=On(),!(K>=0&&Er(K,e)))break;I|=1024,R+=P.substring($,l),R+=Pd(K),l+=6,$=l}else break}return R+=P.substring($,l),R}function Qe(){let R=x.length;if(R>=2&&R<=12){let $=x.charCodeAt(0);if($>=97&&$<=122){let K=Xy.get(x);if(K!==void 0)return g=K}}return g=80}function qn(R){let $="",K=!1,xe=!1;for(;;){let Se=V(l);if(Se===95){I|=512,K?(K=!1,xe=!0):W(xe?E.Multiple_consecutive_numeric_separators_are_not_permitted:E.Numeric_separators_are_not_allowed_here,l,1),l++;continue}if(K=!0,!fi(Se)||Se-48>=R)break;$+=P[l],l++,xe=!1}return V(l-1)===95&&W(E.Numeric_separators_are_not_allowed_here,l-1,1),$}function $t(){return V(l)===110?(x+="n",I&384&&(x=Sb(x)+"n"),l++,10):(x=""+(I&128?parseInt(x.slice(2),2):I&256?parseInt(x.slice(2),8):+x),9)}function ct(){for(h=l,I=0;;){if(y=l,l>=Q)return g=1;let R=ae(l);if(l===0&&R===35&&Gm(P,l)){if(l=Ym(P,l),t)continue;return g=6}switch(R){case 10:case 13:if(I|=1,t){l++;continue}else return R===13&&l+1=0&&Zn($,e))return x=Bn(!0)+vt(),g=Qe();let K=On();return K>=0&&Zn(K,e)?(l+=6,I|=1024,x=String.fromCharCode(K)+vt(),g=Qe()):(W(E.Invalid_character),l++,g=0);case 35:if(l!==0&&P[l+1]==="!")return W(E.can_only_be_used_at_the_start_of_a_file,l,2),l++,g=0;let xe=ae(l+1);if(xe===92){l++;let be=Mt();if(be>=0&&Zn(be,e))return x="#"+Bn(!0)+vt(),g=81;let We=On();if(We>=0&&Zn(We,e))return l+=6,I|=1024,x="#"+String.fromCharCode(We)+vt(),g=81;l--}return Zn(xe,e)?(l++,Jt(xe,e)):(x="#",W(E.Invalid_character,l++,Ft(R))),g=81;case 65533:return W(E.File_appears_to_be_binary,0,0),l=Q,g=8;default:let Se=Jt(R,e);if(Se)return g=Se;if(rs(R)){l+=Ft(R);continue}else if(Cn(R)){I|=1,l+=Ft(R);continue}let we=Ft(R);return W(E.Invalid_character,l,we),l+=we,g=0}}}function _t(){switch(de){case 0:return!0;case 1:return!1}return ye!==3&&ye!==4?!0:de===3?!1:ng.test(P.slice(h,l))}function Ut(){B.assert(g===0,"'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."),l=y=h,I=0;let R=ae(l),$=Jt(R,99);return $?g=$:(l+=Ft(R),g)}function Jt(R,$){let K=R;if(Zn(K,$)){for(l+=Ft(K);l=Q)return g=1;let $=V(l);if($===60)return V(l+1)===47?(l+=2,g=31):(l++,g=30);if($===123)return l++,g=19;let K=0;for(;l0)break;Ba($)||(K=l)}l++}return x=P.substring(h,l),K===-1?13:12}function Nr(){if(wt(g)){for(;l=Q)return g=1;for(let $=V(l);l=0&&rs(V(l-1))&&!(l+1=Q)return g=1;let R=ae(l);switch(l+=Ft(R),R){case 9:case 11:case 12:case 32:for(;l=0&&Zn($,e))return x=Bn(!0)+vt(),g=Qe();let K=On();return K>=0&&Zn(K,e)?(l+=6,I|=1024,x=String.fromCharCode(K)+vt(),g=Qe()):(l++,g=0)}if(Zn(R,e)){let $=R;for(;l=0),l=R,h=R,y=R,g=0,x=void 0,I=0}function Si(R){he+=R?1:-1}}function Gi(e,t){return e.codePointAt(t)}function Ft(e){return e>=65536?2:e===-1?0:1}function fg(e){if(B.assert(0<=e&&e<=1114111),e<=65535)return String.fromCharCode(e);let t=Math.floor((e-65536)/1024)+55296,a=(e-65536)%1024+56320;return String.fromCharCode(t,a)}var dg=String.fromCodePoint?e=>String.fromCodePoint(e):fg;function Pd(e){return dg(e)}var Nd=new Map(Object.entries({General_Category:"General_Category",gc:"General_Category",Script:"Script",sc:"Script",Script_Extensions:"Script_Extensions",scx:"Script_Extensions"})),Id=new Set(["ASCII","ASCII_Hex_Digit","AHex","Alphabetic","Alpha","Any","Assigned","Bidi_Control","Bidi_C","Bidi_Mirrored","Bidi_M","Case_Ignorable","CI","Cased","Changes_When_Casefolded","CWCF","Changes_When_Casemapped","CWCM","Changes_When_Lowercased","CWL","Changes_When_NFKC_Casefolded","CWKCF","Changes_When_Titlecased","CWT","Changes_When_Uppercased","CWU","Dash","Default_Ignorable_Code_Point","DI","Deprecated","Dep","Diacritic","Dia","Emoji","Emoji_Component","EComp","Emoji_Modifier","EMod","Emoji_Modifier_Base","EBase","Emoji_Presentation","EPres","Extended_Pictographic","ExtPict","Extender","Ext","Grapheme_Base","Gr_Base","Grapheme_Extend","Gr_Ext","Hex_Digit","Hex","IDS_Binary_Operator","IDSB","IDS_Trinary_Operator","IDST","ID_Continue","IDC","ID_Start","IDS","Ideographic","Ideo","Join_Control","Join_C","Logical_Order_Exception","LOE","Lowercase","Lower","Math","Noncharacter_Code_Point","NChar","Pattern_Syntax","Pat_Syn","Pattern_White_Space","Pat_WS","Quotation_Mark","QMark","Radical","Regional_Indicator","RI","Sentence_Terminal","STerm","Soft_Dotted","SD","Terminal_Punctuation","Term","Unified_Ideograph","UIdeo","Uppercase","Upper","Variation_Selector","VS","White_Space","space","XID_Continue","XIDC","XID_Start","XIDS"]),Od=new Set(["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Flag_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence","RGI_Emoji"]),Ra={General_Category:new Set(["C","Other","Cc","Control","cntrl","Cf","Format","Cn","Unassigned","Co","Private_Use","Cs","Surrogate","L","Letter","LC","Cased_Letter","Ll","Lowercase_Letter","Lm","Modifier_Letter","Lo","Other_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter","M","Mark","Combining_Mark","Mc","Spacing_Mark","Me","Enclosing_Mark","Mn","Nonspacing_Mark","N","Number","Nd","Decimal_Number","digit","Nl","Letter_Number","No","Other_Number","P","Punctuation","punct","Pc","Connector_Punctuation","Pd","Dash_Punctuation","Pe","Close_Punctuation","Pf","Final_Punctuation","Pi","Initial_Punctuation","Po","Other_Punctuation","Ps","Open_Punctuation","S","Symbol","Sc","Currency_Symbol","Sk","Modifier_Symbol","Sm","Math_Symbol","So","Other_Symbol","Z","Separator","Zl","Line_Separator","Zp","Paragraph_Separator","Zs","Space_Separator"]),Script:new Set(["Adlm","Adlam","Aghb","Caucasian_Albanian","Ahom","Arab","Arabic","Armi","Imperial_Aramaic","Armn","Armenian","Avst","Avestan","Bali","Balinese","Bamu","Bamum","Bass","Bassa_Vah","Batk","Batak","Beng","Bengali","Bhks","Bhaiksuki","Bopo","Bopomofo","Brah","Brahmi","Brai","Braille","Bugi","Buginese","Buhd","Buhid","Cakm","Chakma","Cans","Canadian_Aboriginal","Cari","Carian","Cham","Cher","Cherokee","Chrs","Chorasmian","Copt","Coptic","Qaac","Cpmn","Cypro_Minoan","Cprt","Cypriot","Cyrl","Cyrillic","Deva","Devanagari","Diak","Dives_Akuru","Dogr","Dogra","Dsrt","Deseret","Dupl","Duployan","Egyp","Egyptian_Hieroglyphs","Elba","Elbasan","Elym","Elymaic","Ethi","Ethiopic","Geor","Georgian","Glag","Glagolitic","Gong","Gunjala_Gondi","Gonm","Masaram_Gondi","Goth","Gothic","Gran","Grantha","Grek","Greek","Gujr","Gujarati","Guru","Gurmukhi","Hang","Hangul","Hani","Han","Hano","Hanunoo","Hatr","Hatran","Hebr","Hebrew","Hira","Hiragana","Hluw","Anatolian_Hieroglyphs","Hmng","Pahawh_Hmong","Hmnp","Nyiakeng_Puachue_Hmong","Hrkt","Katakana_Or_Hiragana","Hung","Old_Hungarian","Ital","Old_Italic","Java","Javanese","Kali","Kayah_Li","Kana","Katakana","Kawi","Khar","Kharoshthi","Khmr","Khmer","Khoj","Khojki","Kits","Khitan_Small_Script","Knda","Kannada","Kthi","Kaithi","Lana","Tai_Tham","Laoo","Lao","Latn","Latin","Lepc","Lepcha","Limb","Limbu","Lina","Linear_A","Linb","Linear_B","Lisu","Lyci","Lycian","Lydi","Lydian","Mahj","Mahajani","Maka","Makasar","Mand","Mandaic","Mani","Manichaean","Marc","Marchen","Medf","Medefaidrin","Mend","Mende_Kikakui","Merc","Meroitic_Cursive","Mero","Meroitic_Hieroglyphs","Mlym","Malayalam","Modi","Mong","Mongolian","Mroo","Mro","Mtei","Meetei_Mayek","Mult","Multani","Mymr","Myanmar","Nagm","Nag_Mundari","Nand","Nandinagari","Narb","Old_North_Arabian","Nbat","Nabataean","Newa","Nkoo","Nko","Nshu","Nushu","Ogam","Ogham","Olck","Ol_Chiki","Orkh","Old_Turkic","Orya","Oriya","Osge","Osage","Osma","Osmanya","Ougr","Old_Uyghur","Palm","Palmyrene","Pauc","Pau_Cin_Hau","Perm","Old_Permic","Phag","Phags_Pa","Phli","Inscriptional_Pahlavi","Phlp","Psalter_Pahlavi","Phnx","Phoenician","Plrd","Miao","Prti","Inscriptional_Parthian","Rjng","Rejang","Rohg","Hanifi_Rohingya","Runr","Runic","Samr","Samaritan","Sarb","Old_South_Arabian","Saur","Saurashtra","Sgnw","SignWriting","Shaw","Shavian","Shrd","Sharada","Sidd","Siddham","Sind","Khudawadi","Sinh","Sinhala","Sogd","Sogdian","Sogo","Old_Sogdian","Sora","Sora_Sompeng","Soyo","Soyombo","Sund","Sundanese","Sylo","Syloti_Nagri","Syrc","Syriac","Tagb","Tagbanwa","Takr","Takri","Tale","Tai_Le","Talu","New_Tai_Lue","Taml","Tamil","Tang","Tangut","Tavt","Tai_Viet","Telu","Telugu","Tfng","Tifinagh","Tglg","Tagalog","Thaa","Thaana","Thai","Tibt","Tibetan","Tirh","Tirhuta","Tnsa","Tangsa","Toto","Ugar","Ugaritic","Vaii","Vai","Vith","Vithkuqi","Wara","Warang_Citi","Wcho","Wancho","Xpeo","Old_Persian","Xsux","Cuneiform","Yezi","Yezidi","Yiii","Yi","Zanb","Zanabazar_Square","Zinh","Inherited","Qaai","Zyyy","Common","Zzzz","Unknown"]),Script_Extensions:void 0};Ra.Script_Extensions=Ra.Script;function wr(e){return e.start+e.length}function mg(e){return e.length===0}function cf(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return{start:e,length:t}}function hg(e,t){return cf(e,t-e)}function K_(e){return cf(e.span.start,e.newLength)}function yg(e){return mg(e.span)&&e.newLength===0}function Qm(e,t){if(t<0)throw new Error("newLength < 0");return{span:e,newLength:t}}var X4=Qm(cf(0,0),0);function lf(e,t){for(;e;){let a=t(e);if(a==="quit")return;if(a)return e;e=e.parent}}function hl(e){return(e.flags&16)===0}function gg(e,t){if(e===void 0||hl(e))return e;for(e=e.original;e;){if(hl(e))return!t||t(e)?e:void 0;e=e.original}}function Ja(e){return e.length>=2&&e.charCodeAt(0)===95&&e.charCodeAt(1)===95?"_"+e:e}function cs(e){let t=e;return t.length>=3&&t.charCodeAt(0)===95&&t.charCodeAt(1)===95&&t.charCodeAt(2)===95?t.substr(1):t}function Pn(e){return cs(e.escapedText)}function wl(e){let t=zm(e.escapedText);return t?Sy(t,di):void 0}function jp(e){return e.valueDeclaration&&Bg(e.valueDeclaration)?Pn(e.valueDeclaration.name):cs(e.escapedName)}function Km(e){let t=e.parent.parent;if(t){if(Ld(t))return el(t);switch(t.kind){case 243:if(t.declarationList&&t.declarationList.declarations[0])return el(t.declarationList.declarations[0]);break;case 244:let a=t.expression;switch(a.kind===226&&a.operatorToken.kind===64&&(a=a.left),a.kind){case 211:return a.name;case 212:let o=a.argumentExpression;if(tt(o))return o}break;case 217:return el(t.expression);case 256:{if(Ld(t.statement)||l1(t.statement))return el(t.statement);break}}}}function el(e){let t=Zm(e);return t&&tt(t)?t:void 0}function bg(e){return e.name||Km(e)}function vg(e){return!!e.name}function uf(e){switch(e.kind){case 80:return e;case 348:case 341:{let{name:a}=e;if(a.kind===166)return a.right;break}case 213:case 226:{let a=e;switch(gf(a)){case 1:case 4:case 5:case 3:return bf(a.left);case 7:case 8:case 9:return a.arguments[1];default:return}}case 346:return bg(e);case 340:return Km(e);case 277:{let{expression:a}=e;return tt(a)?a:void 0}case 212:let t=e;if(y1(t))return t.argumentExpression}return e.name}function Zm(e){if(e!==void 0)return uf(e)||(Jf(e)||Lf(e)||vl(e)?Tg(e):void 0)}function Tg(e){if(e.parent){if(th(e.parent)||F1(e.parent))return e.parent.name;if(Zi(e.parent)&&e===e.parent.right){if(tt(e.parent.left))return e.parent.left;if(S1(e.parent.left))return bf(e.parent.left)}else if(jf(e.parent)&&tt(e.parent.name))return e.parent.name}else return}function pf(e){if(W2(e))return Gr(e.modifiers,Al)}function e1(e){if(bs(e,98303))return Gr(e.modifiers,Fg)}function t1(e,t){if(e.name)if(tt(e.name)){let a=e.name.escapedText;return ls(e.parent,t).filter(o=>Vp(o)&&tt(o.name)&&o.name.escapedText===a)}else{let a=e.parent.parameters.indexOf(e);B.assert(a>-1,"Parameters should always be in their parents' parameter list");let o=ls(e.parent,t).filter(Vp);if(ash(o)&&o.typeParameters.some(m=>m.name.escapedText===a))}function wg(e){return n1(e,!1)}function kg(e){return n1(e,!0)}function Eg(e){return bi(e,o6)}function Ag(e){return Jg(e,y6)}function Cg(e){return bi(e,c6,!0)}function Dg(e){return bi(e,l6,!0)}function Pg(e){return bi(e,u6,!0)}function Ng(e){return bi(e,p6,!0)}function Ig(e){return bi(e,f6,!0)}function Og(e){return bi(e,m6,!0)}function Mg(e){let t=bi(e,Vf);if(t&&t.typeExpression&&t.typeExpression.type)return t}function ls(e,t){var a;if(!vf(e))return bt;let o=(a=e.jsDoc)==null?void 0:a.jsDocCache;if(o===void 0||t){let m=D2(e,t);B.assert(m.length<2||m[0]!==m[1]),o=Em(m,v=>_h(v)?v.tags:v),t||(e.jsDoc??(e.jsDoc=[]),e.jsDoc.jsDocCache=o)}return o}function r1(e){return ls(e,!1)}function bi(e,t,a){return wm(ls(e,a),t)}function Jg(e,t){return r1(e).filter(t)}function Rp(e){return e.kind===80||e.kind===81}function Lg(e){return Xr(e)&&!!(e.flags&64)}function jg(e){return Xa(e)&&!!(e.flags&64)}function Md(e){return Mf(e)&&!!(e.flags&64)}function ff(e){return Wf(e,8)}function Rg(e){return ll(e)&&!!(e.flags&64)}function df(e){return e>=166}function mf(e){return e>=0&&e<=165}function i1(e){return mf(e.kind)}function mi(e){return Cr(e,"pos")&&Cr(e,"end")}function Ug(e){return 9<=e&&e<=15}function Jd(e){return 15<=e&&e<=18}function Ua(e){var t;return tt(e)&&((t=e.emitNode)==null?void 0:t.autoGenerate)!==void 0}function a1(e){var t;return gi(e)&&((t=e.emitNode)==null?void 0:t.autoGenerate)!==void 0}function Bg(e){return(Va(e)||Gg(e))&&gi(e.name)}function Wr(e){switch(e){case 128:case 129:case 134:case 87:case 138:case 90:case 95:case 103:case 125:case 123:case 124:case 148:case 126:case 147:case 164:return!0}return!1}function qg(e){return!!(T1(e)&31)}function zg(e){return qg(e)||e===126||e===164||e===129}function Fg(e){return Wr(e.kind)}function _1(e){let t=e.kind;return t===80||t===81||t===11||t===9||t===167}function hf(e){return!!e&&Wg(e.kind)}function Vg(e){switch(e){case 262:case 174:case 176:case 177:case 178:case 218:case 219:return!0;default:return!1}}function Wg(e){switch(e){case 173:case 179:case 323:case 180:case 181:case 184:case 317:case 185:return!0;default:return Vg(e)}}function vi(e){return e&&(e.kind===263||e.kind===231)}function Gg(e){switch(e.kind){case 174:case 177:case 178:return!0;default:return!1}}function Yg(e){let t=e.kind;return t===303||t===304||t===305||t===174||t===177||t===178}function s1(e){return nb(e.kind)}function Xg(e){if(e){let t=e.kind;return t===207||t===206}return!1}function Hg(e){let t=e.kind;return t===209||t===210}function $g(e){switch(e.kind){case 260:case 169:case 208:return!0}return!1}function qa(e){return o1(ff(e).kind)}function o1(e){switch(e){case 211:case 212:case 214:case 213:case 284:case 285:case 288:case 215:case 209:case 217:case 210:case 231:case 218:case 80:case 81:case 14:case 9:case 10:case 11:case 15:case 228:case 97:case 106:case 110:case 112:case 108:case 235:case 233:case 236:case 102:case 282:return!0;default:return!1}}function Qg(e){return c1(ff(e).kind)}function c1(e){switch(e){case 224:case 225:case 220:case 221:case 222:case 223:case 216:return!0;default:return o1(e)}}function l1(e){return Kg(ff(e).kind)}function Kg(e){switch(e){case 227:case 229:case 219:case 226:case 230:case 234:case 232:case 356:case 355:case 238:return!0;default:return c1(e)}}function Zg(e){return e===219||e===208||e===263||e===231||e===175||e===176||e===266||e===306||e===281||e===262||e===218||e===177||e===273||e===271||e===276||e===264||e===291||e===174||e===173||e===267||e===270||e===274||e===280||e===169||e===303||e===172||e===171||e===178||e===304||e===265||e===168||e===260||e===346||e===338||e===348||e===202}function u1(e){return e===262||e===282||e===263||e===264||e===265||e===266||e===267||e===272||e===271||e===278||e===277||e===270}function p1(e){return e===252||e===251||e===259||e===246||e===244||e===242||e===249||e===250||e===248||e===245||e===256||e===253||e===255||e===257||e===258||e===243||e===247||e===254||e===353}function Ld(e){return e.kind===168?e.parent&&e.parent.kind!==345||ea(e):Zg(e.kind)}function e2(e){let t=e.kind;return p1(t)||u1(t)||t2(e)}function t2(e){return e.kind!==241||e.parent!==void 0&&(e.parent.kind===258||e.parent.kind===299)?!1:!h2(e)}function n2(e){let t=e.kind;return p1(t)||u1(t)||t===241}function f1(e){return e.kind>=309&&e.kind<=351}function r2(e){return e.kind===320||e.kind===319||e.kind===321||_2(e)||i2(e)||s6(e)||Nl(e)}function i2(e){return e.kind>=327&&e.kind<=351}function tl(e){return e.kind===178}function nl(e){return e.kind===177}function Xi(e){if(!vf(e))return!1;let{jsDoc:t}=e;return!!t&&t.length>0}function a2(e){return!!e.initializer}function kl(e){return e.kind===11||e.kind===15}function _2(e){return e.kind===324||e.kind===325||e.kind===326}function jd(e){return(e.flags&33554432)!==0}var H4=s2();function s2(){var e="";let t=a=>e+=a;return{getText:()=>e,write:t,rawWrite:t,writeKeyword:t,writeOperator:t,writePunctuation:t,writeSpace:t,writeStringLiteral:t,writeLiteral:t,writeParameter:t,writeProperty:t,writeSymbol:(a,o)=>t(a),writeTrailingSemicolon:t,writeComment:t,getTextPos:()=>e.length,getLine:()=>0,getColumn:()=>0,getIndent:()=>0,isAtStartOfLine:()=>!1,hasTrailingComment:()=>!1,hasTrailingWhitespace:()=>!!e.length&&Ba(e.charCodeAt(e.length-1)),writeLine:()=>e+=" ",increaseIndent:Fa,decreaseIndent:Fa,clear:()=>e=""}}function o2(e,t){let a=e.entries();for(let[o,m]of a){let v=t(m,o);if(v)return v}}function c2(e){return e.end-e.pos}function d1(e){return l2(e),(e.flags&1048576)!==0}function l2(e){e.flags&2097152||(((e.flags&262144)!==0||Ht(e,d1))&&(e.flags|=1048576),e.flags|=2097152)}function hi(e){for(;e&&e.kind!==307;)e=e.parent;return e}function Hi(e){return e===void 0?!0:e.pos===e.end&&e.pos>=0&&e.kind!==1}function Up(e){return!Hi(e)}function yl(e,t,a){if(Hi(e))return e.pos;if(f1(e)||e.kind===12)return Ar((t??hi(e)).text,e.pos,!1,!0);if(a&&Xi(e))return yl(e.jsDoc[0],t);if(e.kind===352){t??(t=hi(e));let o=Hp(oh(e,t));if(o)return yl(o,t,a)}return Ar((t??hi(e)).text,e.pos,!1,!1,y2(e))}function Rd(e,t,a=!1){return is(e.text,t,a)}function u2(e){return!!lf(e,rh)}function is(e,t,a=!1){if(Hi(t))return"";let o=e.substring(a?t.pos:Ar(e,t.pos),t.end);return u2(t)&&(o=o.split(/\r\n|\n|\r/).map(m=>m.replace(/^\s*\*/,"").trimStart()).join(` +`)),o}function za(e){let t=e.emitNode;return t&&t.flags||0}function p2(e,t,a){B.assertGreaterThanOrEqual(t,0),B.assertGreaterThanOrEqual(a,0),B.assertLessThanOrEqual(t,e.length),B.assertLessThanOrEqual(t+a,e.length)}function cl(e){return e.kind===244&&e.expression.kind===11}function yf(e){return!!(za(e)&2097152)}function Ud(e){return yf(e)&&Rf(e)}function f2(e){return tt(e.name)&&!e.initializer}function Bd(e){return yf(e)&&Ha(e)&&Yp(e.declarationList.declarations,f2)}function d2(e,t){let a=e.kind===169||e.kind===168||e.kind===218||e.kind===219||e.kind===217||e.kind===260||e.kind===281?Xp(ug(t,e.pos),Lp(t,e.pos)):Lp(t,e.pos);return Gr(a,o=>o.end<=e.end&&t.charCodeAt(o.pos+1)===42&&t.charCodeAt(o.pos+2)===42&&t.charCodeAt(o.pos+3)!==47)}function m2(e){if(e)switch(e.kind){case 208:case 306:case 169:case 303:case 172:case 171:case 304:case 260:return!0}return!1}function h2(e){return e&&e.kind===241&&hf(e.parent)}function qd(e){let t=e.kind;return(t===211||t===212)&&e.expression.kind===108}function ea(e){return!!e&&!!(e.flags&524288)}function y2(e){return!!e&&!!(e.flags&16777216)}function g2(e){for(;gl(e,!0);)e=e.right;return e}function b2(e){return tt(e)&&e.escapedText==="exports"}function v2(e){return tt(e)&&e.escapedText==="module"}function m1(e){return(Xr(e)||h1(e))&&v2(e.expression)&&ps(e)==="exports"}function gf(e){let t=x2(e);return t===5||ea(e)?t:0}function T2(e){return ts(e.arguments)===3&&Xr(e.expression)&&tt(e.expression.expression)&&Pn(e.expression.expression)==="Object"&&Pn(e.expression.name)==="defineProperty"&&El(e.arguments[1])&&us(e.arguments[0],!0)}function h1(e){return Xa(e)&&El(e.argumentExpression)}function gs(e,t){return Xr(e)&&(!t&&e.expression.kind===110||tt(e.name)&&us(e.expression,!0))||y1(e,t)}function y1(e,t){return h1(e)&&(!t&&e.expression.kind===110||Sf(e.expression)||gs(e.expression,!0))}function us(e,t){return Sf(e)||gs(e,t)}function x2(e){if(Mf(e)){if(!T2(e))return 0;let t=e.arguments[0];return b2(t)||m1(t)?8:gs(t)&&ps(t)==="prototype"?9:7}return e.operatorToken.kind!==64||!S1(e.left)||S2(g2(e))?0:us(e.left.expression,!0)&&ps(e.left)==="prototype"&&Of(k2(e))?6:w2(e.left)}function S2(e){return t6(e)&&ta(e.expression)&&e.expression.text==="0"}function bf(e){if(Xr(e))return e.name;let t=Tf(e.argumentExpression);return ta(t)||kl(t)?t:e}function ps(e){let t=bf(e);if(t){if(tt(t))return t.escapedText;if(kl(t)||ta(t))return Ja(t.text)}}function w2(e){if(e.expression.kind===110)return 4;if(m1(e))return 2;if(us(e.expression,!0)){if(eb(e.expression))return 3;let t=e;for(;!tt(t.expression);)t=t.expression;let a=t.expression;if((a.escapedText==="exports"||a.escapedText==="module"&&ps(t)==="exports")&&gs(e))return 1;if(us(e,!0)||Xa(e)&&U2(e))return 5}return 0}function k2(e){for(;Zi(e.right);)e=e.right;return e.right}function E2(e){return Dl(e)&&Zi(e.expression)&&gf(e.expression)!==0&&Zi(e.expression.right)&&(e.expression.right.operatorToken.kind===57||e.expression.right.operatorToken.kind===61)?e.expression.right.right:void 0}function A2(e){switch(e.kind){case 243:let t=Bp(e);return t&&t.initializer;case 172:return e.initializer;case 303:return e.initializer}}function Bp(e){return Ha(e)?Hp(e.declarationList.declarations):void 0}function C2(e){return Ti(e)&&e.body&&e.body.kind===267?e.body:void 0}function vf(e){switch(e.kind){case 219:case 226:case 241:case 252:case 179:case 296:case 263:case 231:case 175:case 176:case 185:case 180:case 251:case 259:case 246:case 212:case 242:case 1:case 266:case 306:case 277:case 278:case 281:case 244:case 249:case 250:case 248:case 262:case 218:case 184:case 177:case 80:case 245:case 272:case 271:case 181:case 264:case 317:case 323:case 256:case 174:case 173:case 267:case 202:case 270:case 210:case 169:case 217:case 211:case 303:case 172:case 171:case 253:case 240:case 178:case 304:case 305:case 255:case 257:case 258:case 265:case 168:case 260:case 243:case 247:case 254:return!0;default:return!1}}function D2(e,t){let a;m2(e)&&a2(e)&&Xi(e.initializer)&&(a=Dn(a,zd(e,e.initializer.jsDoc)));let o=e;for(;o&&o.parent;){if(Xi(o)&&(a=Dn(a,zd(e,o.jsDoc))),o.kind===169){a=Dn(a,(t?Sg:xg)(o));break}if(o.kind===168){a=Dn(a,(t?kg:wg)(o));break}o=N2(o)}return a||bt}function zd(e,t){let a=dy(t);return Em(t,o=>{if(o===a){let m=Gr(o.tags,v=>P2(e,v));return o.tags===m?[o]:m}else return Gr(o.tags,d6)})}function P2(e,t){return!(Vf(t)||g6(t))||!t.parent||!_h(t.parent)||!Cl(t.parent.parent)||t.parent.parent===e}function N2(e){let t=e.parent;if(t.kind===303||t.kind===277||t.kind===172||t.kind===244&&e.kind===211||t.kind===253||C2(t)||gl(e))return t;if(t.parent&&(Bp(t.parent)===e||gl(t)))return t.parent;if(t.parent&&t.parent.parent&&(Bp(t.parent.parent)||A2(t.parent.parent)===e||E2(t.parent.parent)))return t.parent.parent}function Tf(e,t){return Wf(e,t?-2147483647:1)}function I2(e){let t=O2(e);if(t&&ea(e)){let a=Eg(e);if(a)return a.class}return t}function O2(e){let t=xf(e.heritageClauses,96);return t&&t.types.length>0?t.types[0]:void 0}function M2(e){if(ea(e))return Ag(e).map(t=>t.class);{let t=xf(e.heritageClauses,119);return t==null?void 0:t.types}}function J2(e){return vs(e)?L2(e)||bt:vi(e)&&Xp(Op(I2(e)),M2(e))||bt}function L2(e){let t=xf(e.heritageClauses,96);return t?t.types:void 0}function xf(e,t){if(e){for(let a of e)if(a.token===t)return a}}function di(e){return 83<=e&&e<=165}function j2(e){return 19<=e&&e<=79}function Sp(e){return di(e)||j2(e)}function El(e){return kl(e)||ta(e)}function R2(e){return G1(e)&&(e.operator===40||e.operator===41)&&ta(e.operand)}function U2(e){if(!(e.kind===167||e.kind===212))return!1;let t=Xa(e)?Tf(e.argumentExpression):e.expression;return!El(t)&&!R2(t)}function B2(e){return Rp(e)?Pn(e):eh(e)?Db(e):e.text}function La(e){return fs(e.pos)||fs(e.end)}function wp(e){switch(e){case 61:return 4;case 57:return 5;case 56:return 6;case 52:return 7;case 53:return 8;case 51:return 9;case 35:case 36:case 37:case 38:return 10;case 30:case 32:case 33:case 34:case 104:case 103:case 130:case 152:return 11;case 48:case 49:case 50:return 12;case 40:case 41:return 13;case 42:case 44:case 45:return 14;case 43:return 15}return-1}function kp(e){return!!((e.templateFlags||0)&2048)}function q2(e){return e&&!!(D1(e)?kp(e):kp(e.head)||Xt(e.templateSpans,t=>kp(t.literal)))}var $4=new Map(Object.entries({" ":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","\x85":"\\u0085","\r\n":"\\r\\n"}));var Q4=new Map(Object.entries({'"':""","'":"'"}));function z2(e){return!!e&&e.kind===80&&F2(e)}function F2(e){return e.escapedText==="this"}function bs(e,t){return!!G2(e,t)}function V2(e){return bs(e,256)}function W2(e){return bs(e,32768)}function G2(e,t){return X2(e)&t}function Y2(e,t,a){return e.kind>=0&&e.kind<=165?0:(e.modifierFlagsCache&536870912||(e.modifierFlagsCache=v1(e)|536870912),a||t&&ea(e)?(!(e.modifierFlagsCache&268435456)&&e.parent&&(e.modifierFlagsCache|=g1(e)|268435456),b1(e.modifierFlagsCache)):H2(e.modifierFlagsCache))}function X2(e){return Y2(e,!1)}function g1(e){let t=0;return e.parent&&!ds(e)&&(ea(e)&&(Cg(e)&&(t|=8388608),Dg(e)&&(t|=16777216),Pg(e)&&(t|=33554432),Ng(e)&&(t|=67108864),Ig(e)&&(t|=134217728)),Og(e)&&(t|=65536)),t}function H2(e){return e&65535}function b1(e){return e&131071|(e&260046848)>>>23}function $2(e){return b1(g1(e))}function Q2(e){return v1(e)|$2(e)}function v1(e){let t=Il(e)?Rn(e.modifiers):0;return(e.flags&8||e.kind===80&&e.flags&4096)&&(t|=32),t}function Rn(e){let t=0;if(e)for(let a of e)t|=T1(a.kind);return t}function T1(e){switch(e){case 126:return 256;case 125:return 1;case 124:return 4;case 123:return 2;case 128:return 64;case 129:return 512;case 95:return 32;case 138:return 128;case 87:return 4096;case 90:return 2048;case 134:return 1024;case 148:return 8;case 164:return 16;case 103:return 8192;case 147:return 16384;case 170:return 32768}return 0}function K2(e){return e===76||e===77||e===78}function x1(e){return e>=64&&e<=79}function gl(e,t){return Zi(e)&&(t?e.operatorToken.kind===64:x1(e.operatorToken.kind))&&qa(e.left)}function Sf(e){return e.kind===80||Z2(e)}function Z2(e){return Xr(e)&&tt(e.name)&&Sf(e.expression)}function eb(e){return gs(e)&&ps(e)==="prototype"}function Ep(e){return e.flags&3899393?e.objectFlags:0}function tb(e){let t;return Ht(e,a=>{Up(a)&&(t=a)},a=>{for(let o=a.length-1;o>=0;o--)if(Up(a[o])){t=a[o];break}}),t}function nb(e){return e>=182&&e<=205||e===133||e===159||e===150||e===163||e===151||e===136||e===154||e===155||e===116||e===157||e===146||e===141||e===233||e===312||e===313||e===314||e===315||e===316||e===317||e===318}function S1(e){return e.kind===211||e.kind===212}function rb(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=0,this.mergeId=0,this.parent=void 0,this.members=void 0,this.exports=void 0,this.exportSymbol=void 0,this.constEnumOnlyModule=void 0,this.isReferenced=void 0,this.lastAssignmentPos=void 0,this.links=void 0}function ib(e,t){this.flags=t,(B.isDebugging||sl)&&(this.checker=e)}function ab(e,t){this.flags=t,B.isDebugging&&(this.checker=e)}function Ap(e,t,a){this.pos=t,this.end=a,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}function _b(e,t,a){this.pos=t,this.end=a,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.emitNode=void 0}function sb(e,t,a){this.pos=t,this.end=a,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}function ob(e,t,a){this.fileName=e,this.text=t,this.skipTrivia=a||(o=>o)}var At={getNodeConstructor:()=>Ap,getTokenConstructor:()=>_b,getIdentifierConstructor:()=>sb,getPrivateIdentifierConstructor:()=>Ap,getSourceFileConstructor:()=>Ap,getSymbolConstructor:()=>rb,getTypeConstructor:()=>ib,getSignatureConstructor:()=>ab,getSourceMapSourceConstructor:()=>ob},cb=[];function lb(e){Object.assign(At,e),Un(cb,t=>t(At))}function ub(e,t){return e.replace(/\{(\d+)\}/g,(a,o)=>""+B.checkDefined(t[+o]))}var Fd;function pb(e){return Fd&&Fd[e.key]||e.message}function Oa(e,t,a,o,m,...v){a+o>t.length&&(o=t.length-a),p2(t,a,o);let A=pb(m);return Xt(v)&&(A=ub(A,v)),{file:void 0,start:a,length:o,messageText:A,category:m.category,code:m.code,reportsUnnecessary:m.reportsUnnecessary,fileName:e}}function fb(e){return e.file===void 0&&e.start!==void 0&&e.length!==void 0&&typeof e.fileName=="string"}function w1(e,t){let a=t.fileName||"",o=t.text.length;B.assertEqual(e.fileName,a),B.assertLessThanOrEqual(e.start,o),B.assertLessThanOrEqual(e.start+e.length,o);let m={file:t,start:e.start,length:e.length,messageText:e.messageText,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary};if(e.relatedInformation){m.relatedInformation=[];for(let v of e.relatedInformation)fb(v)&&v.fileName===a?(B.assertLessThanOrEqual(v.start,o),B.assertLessThanOrEqual(v.start+v.length,o),m.relatedInformation.push(w1(v,t))):m.relatedInformation.push(v)}return m}function zi(e,t){let a=[];for(let o of e)a.push(w1(o,t));return a}function Vd(e){return e===4||e===2||e===1||e===6?1:0}var at={allowImportingTsExtensions:{dependencies:["rewriteRelativeImportExtensions"],computeValue:e=>!!(e.allowImportingTsExtensions||e.rewriteRelativeImportExtensions)},target:{dependencies:["module"],computeValue:e=>(e.target===0?void 0:e.target)??(e.module===100&&9||e.module===199&&99||1)},module:{dependencies:["target"],computeValue:e=>typeof e.module=="number"?e.module:at.target.computeValue(e)>=2?5:1},moduleResolution:{dependencies:["module","target"],computeValue:e=>{let t=e.moduleResolution;if(t===void 0)switch(at.module.computeValue(e)){case 1:t=2;break;case 100:t=3;break;case 199:t=99;break;case 200:t=100;break;default:t=1;break}return t}},moduleDetection:{dependencies:["module","target"],computeValue:e=>e.moduleDetection||(at.module.computeValue(e)===100||at.module.computeValue(e)===199?3:2)},isolatedModules:{dependencies:["verbatimModuleSyntax"],computeValue:e=>!!(e.isolatedModules||e.verbatimModuleSyntax)},esModuleInterop:{dependencies:["module","target"],computeValue:e=>{if(e.esModuleInterop!==void 0)return e.esModuleInterop;switch(at.module.computeValue(e)){case 100:case 199:case 200:return!0}return!1}},allowSyntheticDefaultImports:{dependencies:["module","target","moduleResolution"],computeValue:e=>e.allowSyntheticDefaultImports!==void 0?e.allowSyntheticDefaultImports:at.esModuleInterop.computeValue(e)||at.module.computeValue(e)===4||at.moduleResolution.computeValue(e)===100},resolvePackageJsonExports:{dependencies:["moduleResolution"],computeValue:e=>{let t=at.moduleResolution.computeValue(e);if(!Wd(t))return!1;if(e.resolvePackageJsonExports!==void 0)return e.resolvePackageJsonExports;switch(t){case 3:case 99:case 100:return!0}return!1}},resolvePackageJsonImports:{dependencies:["moduleResolution","resolvePackageJsonExports"],computeValue:e=>{let t=at.moduleResolution.computeValue(e);if(!Wd(t))return!1;if(e.resolvePackageJsonExports!==void 0)return e.resolvePackageJsonExports;switch(t){case 3:case 99:case 100:return!0}return!1}},resolveJsonModule:{dependencies:["moduleResolution","module","target"],computeValue:e=>e.resolveJsonModule!==void 0?e.resolveJsonModule:at.moduleResolution.computeValue(e)===100},declaration:{dependencies:["composite"],computeValue:e=>!!(e.declaration||e.composite)},preserveConstEnums:{dependencies:["isolatedModules","verbatimModuleSyntax"],computeValue:e=>!!(e.preserveConstEnums||at.isolatedModules.computeValue(e))},incremental:{dependencies:["composite"],computeValue:e=>!!(e.incremental||e.composite)},declarationMap:{dependencies:["declaration","composite"],computeValue:e=>!!(e.declarationMap&&at.declaration.computeValue(e))},allowJs:{dependencies:["checkJs"],computeValue:e=>e.allowJs===void 0?!!e.checkJs:e.allowJs},useDefineForClassFields:{dependencies:["target","module"],computeValue:e=>e.useDefineForClassFields===void 0?at.target.computeValue(e)>=9:e.useDefineForClassFields},noImplicitAny:{dependencies:["strict"],computeValue:e=>Vr(e,"noImplicitAny")},noImplicitThis:{dependencies:["strict"],computeValue:e=>Vr(e,"noImplicitThis")},strictNullChecks:{dependencies:["strict"],computeValue:e=>Vr(e,"strictNullChecks")},strictFunctionTypes:{dependencies:["strict"],computeValue:e=>Vr(e,"strictFunctionTypes")},strictBindCallApply:{dependencies:["strict"],computeValue:e=>Vr(e,"strictBindCallApply")},strictPropertyInitialization:{dependencies:["strict"],computeValue:e=>Vr(e,"strictPropertyInitialization")},strictBuiltinIteratorReturn:{dependencies:["strict"],computeValue:e=>Vr(e,"strictBuiltinIteratorReturn")},alwaysStrict:{dependencies:["strict"],computeValue:e=>Vr(e,"alwaysStrict")},useUnknownInCatchVariables:{dependencies:["strict"],computeValue:e=>Vr(e,"useUnknownInCatchVariables")}};var K4=at.allowImportingTsExtensions.computeValue,Z4=at.target.computeValue,e3=at.module.computeValue,t3=at.moduleResolution.computeValue,n3=at.moduleDetection.computeValue,r3=at.isolatedModules.computeValue,i3=at.esModuleInterop.computeValue,a3=at.allowSyntheticDefaultImports.computeValue,_3=at.resolvePackageJsonExports.computeValue,s3=at.resolvePackageJsonImports.computeValue,o3=at.resolveJsonModule.computeValue,c3=at.declaration.computeValue,l3=at.preserveConstEnums.computeValue,u3=at.incremental.computeValue,p3=at.declarationMap.computeValue,f3=at.allowJs.computeValue,d3=at.useDefineForClassFields.computeValue;function Wd(e){return e>=3&&e<=99||e===100}function Vr(e,t){return e[t]===void 0?!!e.strict:!!e[t]}function db(e){return o2(targetOptionDeclaration.type,(t,a)=>t===e?a:void 0)}var mb=["node_modules","bower_components","jspm_packages"],k1=`(?!(${mb.join("|")})(/|$))`,hb={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:`(/${k1}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>E1(e,hb.singleAsteriskRegexFragment)},yb={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:`(/${k1}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>E1(e,yb.singleAsteriskRegexFragment)};function E1(e,t){return e==="*"?t:e==="?"?"[^/]":"\\"+e}function gb(e,t){return t||bb(e)||3}function bb(e){switch(e.substr(e.lastIndexOf(".")).toLowerCase()){case".js":case".cjs":case".mjs":return 1;case".jsx":return 2;case".ts":case".cts":case".mts":return 3;case".tsx":return 4;case".json":return 6;default:return 0}}var A1=[[".ts",".tsx",".d.ts"],[".cts",".d.cts"],[".mts",".d.mts"]],m3=km(A1),h3=[...A1,[".json"]];var vb=[[".js",".jsx"],[".mjs"],[".cjs"]],y3=km(vb),Tb=[[".ts",".tsx",".d.ts",".js",".jsx"],[".cts",".d.cts",".cjs"],[".mts",".d.mts",".mjs"]],g3=[...Tb,[".json"]],xb=[".d.ts",".d.cts",".d.mts"];function fs(e){return!(e>=0)}function rl(e,...t){return t.length&&(e.relatedInformation||(e.relatedInformation=[]),B.assert(e.relatedInformation!==bt,"Diagnostic had empty array singleton for related info, but is still being constructed!"),e.relatedInformation.push(...t)),e}function Sb(e){let t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:let Q=e.length-1,h=0;for(;e.charCodeAt(h)===48;)h++;return e.slice(h,Q)||"0"}let a=2,o=e.length-1,m=(o-a)*t,v=new Uint16Array((m>>>4)+(m&15?1:0));for(let Q=o-1,h=0;Q>=a;Q--,h+=t){let y=h>>>4,g=e.charCodeAt(Q),I=(g<=57?g-48:10+g-(g<=70?65:97))<<(h&15);v[y]|=I;let re=I>>>16;re&&(v[y+1]|=re)}let A="",P=v.length-1,l=!0;for(;l;){let Q=0;l=!1;for(let h=P;h>=0;h--){let y=Q<<16|v[h],g=y/10|0;v[h]=g,Q=y-g*10,g&&!l&&(P=h,l=!0)}A=Q+A}return A}function wb({negative:e,base10Value:t}){return(e&&t!=="0"?"-":"")+t}function qp(e,t){return e.pos=t,e}function kb(e,t){return e.end=t,e}function yi(e,t,a){return kb(qp(e,t),a)}function Gd(e,t,a){return yi(e,t,t+a)}function wf(e,t){return e&&t&&(e.parent=t),e}function Eb(e,t){if(!e)return e;return bm(e,f1(e)?a:m),e;function a(v,A){if(t&&v.parent===A)return"skip";wf(v,A)}function o(v){if(Xi(v))for(let A of v.jsDoc)a(A,v),bm(A,a)}function m(v,A){return a(v,A)||o(v)}}function Ab(e){return!!(e.flags&262144&&e.isThisType)}function Cb(e){var t;return((t=getSnippetElement(e))==null?void 0:t.kind)===0}function Db(e){return`${Pn(e.namespace)}:${Pn(e.name)}`}var b3=String.prototype.replace;var zp=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","test/mock_loader","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"],v3=new Set(zp),Pb=new Set(["node:sea","node:sqlite","node:test","node:test/reporters"]),T3=new Set([...zp,...zp.map(e=>`node:${e}`),...Pb]);function Nb(){let e,t,a,o,m;return{createBaseSourceFileNode:v,createBaseIdentifierNode:A,createBasePrivateIdentifierNode:P,createBaseTokenNode:l,createBaseNode:Q};function v(h){return new(m||(m=At.getSourceFileConstructor()))(h,-1,-1)}function A(h){return new(a||(a=At.getIdentifierConstructor()))(h,-1,-1)}function P(h){return new(o||(o=At.getPrivateIdentifierConstructor()))(h,-1,-1)}function l(h){return new(t||(t=At.getTokenConstructor()))(h,-1,-1)}function Q(h){return new(e||(e=At.getNodeConstructor()))(h,-1,-1)}}var Ib={getParenthesizeLeftSideOfBinaryForOperator:e=>gt,getParenthesizeRightSideOfBinaryForOperator:e=>gt,parenthesizeLeftSideOfBinary:(e,t)=>t,parenthesizeRightSideOfBinary:(e,t,a)=>a,parenthesizeExpressionOfComputedPropertyName:gt,parenthesizeConditionOfConditionalExpression:gt,parenthesizeBranchOfConditionalExpression:gt,parenthesizeExpressionOfExportDefault:gt,parenthesizeExpressionOfNew:e=>kr(e,qa),parenthesizeLeftSideOfAccess:e=>kr(e,qa),parenthesizeOperandOfPostfixUnary:e=>kr(e,qa),parenthesizeOperandOfPrefixUnary:e=>kr(e,Qg),parenthesizeExpressionsOfCommaDelimitedList:e=>kr(e,mi),parenthesizeExpressionForDisallowedComma:gt,parenthesizeExpressionOfExpressionStatement:gt,parenthesizeConciseBodyOfArrowFunction:gt,parenthesizeCheckTypeOfConditionalType:gt,parenthesizeExtendsTypeOfConditionalType:gt,parenthesizeConstituentTypesOfUnionType:e=>kr(e,mi),parenthesizeConstituentTypeOfUnionType:gt,parenthesizeConstituentTypesOfIntersectionType:e=>kr(e,mi),parenthesizeConstituentTypeOfIntersectionType:gt,parenthesizeOperandOfTypeOperator:gt,parenthesizeOperandOfReadonlyTypeOperator:gt,parenthesizeNonArrayTypeOfPostfixType:gt,parenthesizeElementTypesOfTupleType:e=>kr(e,mi),parenthesizeElementTypeOfTupleType:gt,parenthesizeTypeOfOptionalType:gt,parenthesizeTypeArguments:e=>e&&kr(e,mi),parenthesizeLeadingTypeArgument:gt},il=0;var Ob=[];function kf(e,t){let a=e&8?gt:Rb,o=Sd(()=>e&1?Ib:createParenthesizerRules(ye)),m=Sd(()=>e&2?nullNodeConverters:createNodeConverters(ye)),v=Kn(n=>(i,_)=>ua(i,n,_)),A=Kn(n=>i=>jr(n,i)),P=Kn(n=>i=>ni(i,n)),l=Kn(n=>()=>Ho(n)),Q=Kn(n=>i=>C_(n,i)),h=Kn(n=>(i,_)=>Su(n,i,_)),y=Kn(n=>(i,_)=>$o(n,i,_)),g=Kn(n=>(i,_)=>xu(n,i,_)),x=Kn(n=>(i,_)=>dc(n,i,_)),I=Kn(n=>(i,_,c)=>Mu(n,i,_,c)),re=Kn(n=>(i,_,c)=>mc(n,i,_,c)),he=Kn(n=>(i,_,c,f)=>Ju(n,i,_,c,f)),ye={get parenthesizer(){return o()},get converters(){return m()},baseFactory:t,flags:e,createNodeArray:de,createNumericLiteral:V,createBigIntLiteral:oe,createStringLiteral:dt,createStringLiteralFromNode:nr,createRegularExpressionLiteral:gn,createLiteralLikeNode:rr,createIdentifier:Ge,createTempVariable:ir,createLoopVariable:Pr,createUniqueName:Ot,getGeneratedNameForNode:Bn,createPrivateIdentifier:Mt,createUniquePrivateName:Qe,getGeneratedPrivateNameForNode:qn,createToken:ct,createSuper:_t,createThis:Ut,createNull:Jt,createTrue:lt,createFalse:ar,createModifier:mt,createModifiersFromModifierFlags:vn,createQualifiedName:yt,updateQualifiedName:cn,createComputedPropertyName:nt,updateComputedPropertyName:Bt,createTypeParameterDeclaration:rn,updateTypeParameterDeclaration:_r,createParameterDeclaration:fr,updateParameterDeclaration:dr,createDecorator:zn,updateDecorator:Fn,createPropertySignature:Nr,updatePropertySignature:Vn,createPropertyDeclaration:mr,updatePropertyDeclaration:L,createMethodSignature:se,updateMethodSignature:fe,createMethodDeclaration:Te,updateMethodDeclaration:He,createConstructorDeclaration:ut,updateConstructorDeclaration:Ir,createGetAccessorDeclaration:Mn,updateGetAccessorDeclaration:Wn,createSetAccessorDeclaration:R,updateSetAccessorDeclaration:$,createCallSignature:xe,updateCallSignature:Se,createConstructSignature:we,updateConstructSignature:be,createIndexSignature:We,updateIndexSignature:Ze,createClassStaticBlockDeclaration:st,updateClassStaticBlockDeclaration:Dt,createTemplateLiteralTypeSpan:Ye,updateTemplateLiteralTypeSpan:Ee,createKeywordTypeNode:Tn,createTypePredicateNode:rt,updateTypePredicateNode:ln,createTypeReferenceNode:Zr,updateTypeReferenceNode:J,createFunctionTypeNode:qe,updateFunctionTypeNode:u,createConstructorTypeNode:Me,updateConstructorTypeNode:an,createTypeQueryNode:Pt,updateTypeQueryNode:kt,createTypeLiteralNode:Nt,updateTypeLiteralNode:qt,createArrayTypeNode:Gn,updateArrayTypeNode:wi,createTupleTypeNode:un,updateTupleTypeNode:G,createNamedTupleMember:le,updateNamedTupleMember:Fe,createOptionalTypeNode:ve,updateOptionalTypeNode:j,createRestTypeNode:ht,updateRestTypeNode:xt,createUnionTypeNode:Bl,updateUnionTypeNode:Es,createIntersectionTypeNode:Or,updateIntersectionTypeNode:Je,createConditionalTypeNode:ft,updateConditionalTypeNode:ql,createInferTypeNode:Yn,updateInferTypeNode:zl,createImportTypeNode:sr,updateImportTypeNode:aa,createParenthesizedType:Qt,updateParenthesizedType:Ct,createThisTypeNode:D,createTypeOperatorNode:Gt,updateTypeOperatorNode:Mr,createIndexedAccessTypeNode:or,updateIndexedAccessTypeNode:Ka,createMappedTypeNode:St,updateMappedTypeNode:jt,createLiteralTypeNode:ei,updateLiteralTypeNode:yr,createTemplateLiteralType:Wt,updateTemplateLiteralType:Fl,createObjectBindingPattern:As,updateObjectBindingPattern:Vl,createArrayBindingPattern:Jr,updateArrayBindingPattern:Wl,createBindingElement:_a,updateBindingElement:ti,createArrayLiteralExpression:Za,updateArrayLiteralExpression:Cs,createObjectLiteralExpression:ki,updateObjectLiteralExpression:Gl,createPropertyAccessExpression:e&4?(n,i)=>setEmitFlags(cr(n,i),262144):cr,updatePropertyAccessExpression:Yl,createPropertyAccessChain:e&4?(n,i,_)=>setEmitFlags(Ei(n,i,_),262144):Ei,updatePropertyAccessChain:sa,createElementAccessExpression:Ai,updateElementAccessExpression:Xl,createElementAccessChain:Ns,updateElementAccessChain:e_,createCallExpression:Ci,updateCallExpression:oa,createCallChain:t_,updateCallChain:Os,createNewExpression:xn,updateNewExpression:n_,createTaggedTemplateExpression:ca,updateTaggedTemplateExpression:Ms,createTypeAssertion:Js,updateTypeAssertion:Ls,createParenthesizedExpression:r_,updateParenthesizedExpression:js,createFunctionExpression:i_,updateFunctionExpression:Rs,createArrowFunction:a_,updateArrowFunction:Us,createDeleteExpression:Bs,updateDeleteExpression:qs,createTypeOfExpression:la,updateTypeOfExpression:fn,createVoidExpression:__,updateVoidExpression:lr,createAwaitExpression:zs,updateAwaitExpression:Lr,createPrefixUnaryExpression:jr,updatePrefixUnaryExpression:Hl,createPostfixUnaryExpression:ni,updatePostfixUnaryExpression:$l,createBinaryExpression:ua,updateBinaryExpression:Ql,createConditionalExpression:Vs,updateConditionalExpression:Ws,createTemplateExpression:Gs,updateTemplateExpression:Xn,createTemplateHead:Xs,createTemplateMiddle:pa,createTemplateTail:s_,createNoSubstitutionTemplateLiteral:Zl,createTemplateLiteralLikeNode:ii,createYieldExpression:o_,updateYieldExpression:eu,createSpreadElement:Hs,updateSpreadElement:tu,createClassExpression:$s,updateClassExpression:c_,createOmittedExpression:l_,createExpressionWithTypeArguments:Qs,updateExpressionWithTypeArguments:Ks,createAsExpression:dn,updateAsExpression:fa,createNonNullExpression:Zs,updateNonNullExpression:eo,createSatisfiesExpression:u_,updateSatisfiesExpression:to,createNonNullChain:p_,updateNonNullChain:Jn,createMetaProperty:no,updateMetaProperty:f_,createTemplateSpan:Hn,updateTemplateSpan:da,createSemicolonClassElement:ro,createBlock:Rr,updateBlock:nu,createVariableStatement:d_,updateVariableStatement:io,createEmptyStatement:ao,createExpressionStatement:Pi,updateExpressionStatement:_o,createIfStatement:so,updateIfStatement:oo,createDoStatement:co,updateDoStatement:lo,createWhileStatement:uo,updateWhileStatement:ru,createForStatement:po,updateForStatement:fo,createForInStatement:m_,updateForInStatement:iu,createForOfStatement:mo,updateForOfStatement:au,createContinueStatement:ho,updateContinueStatement:_u,createBreakStatement:h_,updateBreakStatement:yo,createReturnStatement:y_,updateReturnStatement:su,createWithStatement:g_,updateWithStatement:go,createSwitchStatement:b_,updateSwitchStatement:ai,createLabeledStatement:bo,updateLabeledStatement:vo,createThrowStatement:To,updateThrowStatement:ou,createTryStatement:xo,updateTryStatement:cu,createDebuggerStatement:So,createVariableDeclaration:ma,updateVariableDeclaration:wo,createVariableDeclarationList:v_,updateVariableDeclarationList:lu,createFunctionDeclaration:ko,updateFunctionDeclaration:T_,createClassDeclaration:Eo,updateClassDeclaration:ha,createInterfaceDeclaration:Ao,updateInterfaceDeclaration:Co,createTypeAliasDeclaration:ot,updateTypeAliasDeclaration:gr,createEnumDeclaration:x_,updateEnumDeclaration:br,createModuleDeclaration:Do,updateModuleDeclaration:Et,createModuleBlock:vr,updateModuleBlock:zt,createCaseBlock:Po,updateCaseBlock:pu,createNamespaceExportDeclaration:No,updateNamespaceExportDeclaration:Io,createImportEqualsDeclaration:Oo,updateImportEqualsDeclaration:Mo,createImportDeclaration:Jo,updateImportDeclaration:Lo,createImportClause:jo,updateImportClause:Ro,createAssertClause:S_,updateAssertClause:du,createAssertEntry:Ni,updateAssertEntry:Uo,createImportTypeAssertionContainer:w_,updateImportTypeAssertionContainer:Bo,createImportAttributes:qo,updateImportAttributes:k_,createImportAttribute:zo,updateImportAttribute:Fo,createNamespaceImport:Vo,updateNamespaceImport:mu,createNamespaceExport:Wo,updateNamespaceExport:hu,createNamedImports:Go,updateNamedImports:Yo,createImportSpecifier:Tr,updateImportSpecifier:yu,createExportAssignment:ya,updateExportAssignment:Ii,createExportDeclaration:ga,updateExportDeclaration:Xo,createNamedExports:E_,updateNamedExports:gu,createExportSpecifier:ba,updateExportSpecifier:bu,createMissingDeclaration:vu,createExternalModuleReference:A_,updateExternalModuleReference:Tu,get createJSDocAllType(){return l(312)},get createJSDocUnknownType(){return l(313)},get createJSDocNonNullableType(){return y(315)},get updateJSDocNonNullableType(){return g(315)},get createJSDocNullableType(){return y(314)},get updateJSDocNullableType(){return g(314)},get createJSDocOptionalType(){return Q(316)},get updateJSDocOptionalType(){return h(316)},get createJSDocVariadicType(){return Q(318)},get updateJSDocVariadicType(){return h(318)},get createJSDocNamepathType(){return Q(319)},get updateJSDocNamepathType(){return h(319)},createJSDocFunctionType:Qo,updateJSDocFunctionType:wu,createJSDocTypeLiteral:Ko,updateJSDocTypeLiteral:ku,createJSDocTypeExpression:Zo,updateJSDocTypeExpression:D_,createJSDocSignature:ec,updateJSDocSignature:Eu,createJSDocTemplateTag:P_,updateJSDocTemplateTag:tc,createJSDocTypedefTag:va,updateJSDocTypedefTag:Au,createJSDocParameterTag:N_,updateJSDocParameterTag:Cu,createJSDocPropertyTag:nc,updateJSDocPropertyTag:rc,createJSDocCallbackTag:ic,updateJSDocCallbackTag:ac,createJSDocOverloadTag:_c,updateJSDocOverloadTag:I_,createJSDocAugmentsTag:O_,updateJSDocAugmentsTag:Mi,createJSDocImplementsTag:sc,updateJSDocImplementsTag:Ou,createJSDocSeeTag:Br,updateJSDocSeeTag:Ta,createJSDocImportTag:gc,updateJSDocImportTag:bc,createJSDocNameReference:oc,updateJSDocNameReference:Du,createJSDocMemberName:cc,updateJSDocMemberName:Pu,createJSDocLink:lc,updateJSDocLink:uc,createJSDocLinkCode:pc,updateJSDocLinkCode:Nu,createJSDocLinkPlain:fc,updateJSDocLinkPlain:Iu,get createJSDocTypeTag(){return re(344)},get updateJSDocTypeTag(){return he(344)},get createJSDocReturnTag(){return re(342)},get updateJSDocReturnTag(){return he(342)},get createJSDocThisTag(){return re(343)},get updateJSDocThisTag(){return he(343)},get createJSDocAuthorTag(){return x(330)},get updateJSDocAuthorTag(){return I(330)},get createJSDocClassTag(){return x(332)},get updateJSDocClassTag(){return I(332)},get createJSDocPublicTag(){return x(333)},get updateJSDocPublicTag(){return I(333)},get createJSDocPrivateTag(){return x(334)},get updateJSDocPrivateTag(){return I(334)},get createJSDocProtectedTag(){return x(335)},get updateJSDocProtectedTag(){return I(335)},get createJSDocReadonlyTag(){return x(336)},get updateJSDocReadonlyTag(){return I(336)},get createJSDocOverrideTag(){return x(337)},get updateJSDocOverrideTag(){return I(337)},get createJSDocDeprecatedTag(){return x(331)},get updateJSDocDeprecatedTag(){return I(331)},get createJSDocThrowsTag(){return re(349)},get updateJSDocThrowsTag(){return he(349)},get createJSDocSatisfiesTag(){return re(350)},get updateJSDocSatisfiesTag(){return he(350)},createJSDocEnumTag:yc,updateJSDocEnumTag:M_,createJSDocUnknownTag:hc,updateJSDocUnknownTag:Lu,createJSDocText:J_,updateJSDocText:ju,createJSDocComment:Ji,updateJSDocComment:vc,createJsxElement:Tc,updateJsxElement:Ru,createJsxSelfClosingElement:xc,updateJsxSelfClosingElement:L_,createJsxOpeningElement:j_,updateJsxOpeningElement:Sc,createJsxClosingElement:xa,updateJsxClosingElement:Kt,createJsxFragment:R_,createJsxText:Sa,updateJsxText:kc,createJsxOpeningFragment:Uu,createJsxJsxClosingFragment:Bu,updateJsxFragment:wc,createJsxAttribute:Ec,updateJsxAttribute:wa,createJsxAttributes:Ac,updateJsxAttributes:qu,createJsxSpreadAttribute:Cc,updateJsxSpreadAttribute:zu,createJsxExpression:ka,updateJsxExpression:Li,createJsxNamespacedName:Dc,updateJsxNamespacedName:U_,createCaseClause:B_,updateCaseClause:Fu,createDefaultClause:_i,updateDefaultClause:Pc,createHeritageClause:Nc,updateHeritageClause:Vu,createCatchClause:q_,updateCatchClause:Ic,createPropertyAssignment:Ea,updatePropertyAssignment:qr,createShorthandPropertyAssignment:Oc,updateShorthandPropertyAssignment:Gu,createSpreadAssignment:z_,updateSpreadAssignment:Mc,createEnumMember:wn,updateEnumMember:Jc,createSourceFile:Xu,updateSourceFile:Qu,createRedirectedSourceFile:Lc,createBundle:F_,updateBundle:Ku,createSyntheticExpression:Zu,createSyntaxList:Ca,createNotEmittedStatement:Rc,createNotEmittedTypeElement:ep,createPartiallyEmittedExpression:Uc,updatePartiallyEmittedExpression:Bc,createCommaListExpression:V_,updateCommaListExpression:qc,createSyntheticReferenceExpression:W_,updateSyntheticReferenceExpression:zc,cloneNode:G_,get createComma(){return v(28)},get createAssignment(){return v(64)},get createLogicalOr(){return v(57)},get createLogicalAnd(){return v(56)},get createBitwiseOr(){return v(52)},get createBitwiseXor(){return v(53)},get createBitwiseAnd(){return v(51)},get createStrictEquality(){return v(37)},get createStrictInequality(){return v(38)},get createEquality(){return v(35)},get createInequality(){return v(36)},get createLessThan(){return v(30)},get createLessThanEquals(){return v(33)},get createGreaterThan(){return v(32)},get createGreaterThanEquals(){return v(34)},get createLeftShift(){return v(48)},get createRightShift(){return v(49)},get createUnsignedRightShift(){return v(50)},get createAdd(){return v(40)},get createSubtract(){return v(41)},get createMultiply(){return v(42)},get createDivide(){return v(44)},get createModulo(){return v(45)},get createExponent(){return v(43)},get createPrefixPlus(){return A(40)},get createPrefixMinus(){return A(41)},get createPrefixIncrement(){return A(46)},get createPrefixDecrement(){return A(47)},get createBitwiseNot(){return A(55)},get createLogicalNot(){return A(54)},get createPostfixIncrement(){return P(46)},get createPostfixDecrement(){return P(47)},createImmediatelyInvokedFunctionExpression:ip,createImmediatelyInvokedArrowFunction:ap,createVoidZero:si,createExportDefault:Wc,createExternalModuleExport:_p,createTypeCheck:Y_,createIsNotTypeCheck:sp,createMethodCall:zr,createGlobalMethodCall:ji,createFunctionBindCall:op,createFunctionCallCall:cp,createFunctionApplyCall:lp,createArraySliceCall:Ri,createArrayConcatCall:up,createObjectDefinePropertyCall:X_,createObjectGetOwnPropertyDescriptorCall:oi,createReflectGetCall:Gc,createReflectSetCall:pp,createPropertyDescriptor:Yc,createCallBinding:Hc,createAssignmentTargetWrapper:s,inlineExpressions:p,getInternalName:b,getLocalName:S,getExportName:N,getDeclarationName:H,getNamespaceMemberName:_e,getExternalModuleOrNamespaceExportName:Z,restoreOuterExpressions:Xc,restoreEnclosingLabel:H_,createUseStrictPrologue:Le,copyPrologue:ee,copyStandardPrologue:je,copyCustomPrologue:Ae,ensureUseStrict:Yt,liftToBlock:mn,mergeLexicalEnvironment:ur,replaceModifiers:Ln,replaceDecoratorsAndModifiers:Fr,replacePropertyName:mp};return Un(Ob,n=>n(ye)),ye;function de(n,i){if(n===void 0||n===bt)n=[];else if(mi(n)){if(i===void 0||n.hasTrailingComma===i)return n.transformFlags===void 0&&Xd(n),B.attachNodeArrayDebugInfo(n),n;let f=n.slice();return f.pos=n.pos,f.end=n.end,f.hasTrailingComma=i,f.transformFlags=n.transformFlags,B.attachNodeArrayDebugInfo(f),f}let _=n.length,c=_>=1&&_<=4?n.slice():n;return c.pos=-1,c.end=-1,c.hasTrailingComma=!!i,c.transformFlags=0,Xd(c),B.attachNodeArrayDebugInfo(c),c}function M(n){return t.createBaseNode(n)}function ae(n){let i=M(n);return i.symbol=void 0,i.localSymbol=void 0,i}function Oe(n,i){return n!==i&&(n.typeArguments=i.typeArguments),q(n,i)}function V(n,i=0){let _=typeof n=="number"?n+"":n;B.assert(_.charCodeAt(0)!==45,"Negative numbers should be created in combination with createPrefixUnaryExpression");let c=ae(9);return c.text=_,c.numericLiteralFlags=i,i&384&&(c.transformFlags|=1024),c}function oe(n){let i=$t(10);return i.text=typeof n=="string"?n:wb(n)+"n",i.transformFlags|=32,i}function W(n,i){let _=ae(11);return _.text=n,_.singleQuote=i,_}function dt(n,i,_){let c=W(n,i);return c.hasExtendedUnicodeEscape=_,_&&(c.transformFlags|=1024),c}function nr(n){let i=W(B2(n),void 0);return i.textSourceNode=n,i}function gn(n){let i=$t(14);return i.text=n,i}function rr(n,i){switch(n){case 9:return V(i,0);case 10:return oe(i);case 11:return dt(i,void 0);case 12:return Sa(i,!1);case 13:return Sa(i,!0);case 14:return gn(i);case 15:return ii(n,i,void 0,0)}}function bn(n){let i=t.createBaseIdentifierNode(80);return i.escapedText=n,i.jsDoc=void 0,i.flowNode=void 0,i.symbol=void 0,i}function In(n,i,_,c){let f=bn(Ja(n));return setIdentifierAutoGenerate(f,{flags:i,id:il,prefix:_,suffix:c}),il++,f}function Ge(n,i,_){i===void 0&&n&&(i=zm(n)),i===80&&(i=void 0);let c=bn(Ja(n));return _&&(c.flags|=256),c.escapedText==="await"&&(c.transformFlags|=67108864),c.flags&256&&(c.transformFlags|=1024),c}function ir(n,i,_,c){let f=1;i&&(f|=8);let w=In("",f,_,c);return n&&n(w),w}function Pr(n){let i=2;return n&&(i|=8),In("",i,void 0,void 0)}function Ot(n,i=0,_,c){return B.assert(!(i&7),"Argument out of range: flags"),B.assert((i&48)!==32,"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),In(n,3|i,_,c)}function Bn(n,i=0,_,c){B.assert(!(i&7),"Argument out of range: flags");let f=n?Rp(n)?Wp(!1,_,n,c,Pn):`generated@${getNodeId(n)}`:"";(_||c)&&(i|=16);let w=In(f,4|i,_,c);return w.original=n,w}function On(n){let i=t.createBasePrivateIdentifierNode(81);return i.escapedText=n,i.transformFlags|=16777216,i}function Mt(n){return pl(n,"#")||B.fail("First character of private identifier must be #: "+n),On(Ja(n))}function vt(n,i,_,c){let f=On(Ja(n));return setIdentifierAutoGenerate(f,{flags:i,id:il,prefix:_,suffix:c}),il++,f}function Qe(n,i,_){n&&!pl(n,"#")&&B.fail("First character of private identifier must be #: "+n);let c=8|(n?3:1);return vt(n??"",c,i,_)}function qn(n,i,_){let c=Rp(n)?Wp(!0,i,n,_,Pn):`#generated@${getNodeId(n)}`,w=vt(c,4|(i||_?16:0),i,_);return w.original=n,w}function $t(n){return t.createBaseTokenNode(n)}function ct(n){B.assert(n>=0&&n<=165,"Invalid token"),B.assert(n<=15||n>=18,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),B.assert(n<=9||n>=15,"Invalid token. Use 'createLiteralLikeNode' to create literals."),B.assert(n!==80,"Invalid token. Use 'createIdentifier' to create identifiers");let i=$t(n),_=0;switch(n){case 134:_=384;break;case 160:_=4;break;case 125:case 123:case 124:case 148:case 128:case 138:case 87:case 133:case 150:case 163:case 146:case 151:case 103:case 147:case 164:case 154:case 136:case 155:case 116:case 159:case 157:_=1;break;case 108:_=134218752,i.flowNode=void 0;break;case 126:_=1024;break;case 129:_=16777216;break;case 110:_=16384,i.flowNode=void 0;break}return _&&(i.transformFlags|=_),i}function _t(){return ct(108)}function Ut(){return ct(110)}function Jt(){return ct(106)}function lt(){return ct(112)}function ar(){return ct(97)}function mt(n){return ct(n)}function vn(n){let i=[];return n&32&&i.push(mt(95)),n&128&&i.push(mt(138)),n&2048&&i.push(mt(90)),n&4096&&i.push(mt(87)),n&1&&i.push(mt(125)),n&2&&i.push(mt(123)),n&4&&i.push(mt(124)),n&64&&i.push(mt(128)),n&256&&i.push(mt(126)),n&16&&i.push(mt(164)),n&8&&i.push(mt(148)),n&512&&i.push(mt(129)),n&1024&&i.push(mt(134)),n&8192&&i.push(mt(103)),n&16384&&i.push(mt(147)),i.length?i:void 0}function yt(n,i){let _=M(166);return _.left=n,_.right=et(i),_.transformFlags|=z(_.left)|ja(_.right),_.flowNode=void 0,_}function cn(n,i,_){return n.left!==i||n.right!==_?q(yt(i,_),n):n}function nt(n){let i=M(167);return i.expression=o().parenthesizeExpressionOfComputedPropertyName(n),i.transformFlags|=z(i.expression)|1024|131072,i}function Bt(n,i){return n.expression!==i?q(nt(i),n):n}function rn(n,i,_,c){let f=ae(168);return f.modifiers=De(n),f.name=et(i),f.constraint=_,f.default=c,f.transformFlags=1,f.expression=void 0,f.jsDoc=void 0,f}function _r(n,i,_,c,f){return n.modifiers!==i||n.name!==_||n.constraint!==c||n.default!==f?q(rn(i,_,c,f),n):n}function fr(n,i,_,c,f,w){let F=ae(169);return F.modifiers=De(n),F.dotDotDotToken=i,F.name=et(_),F.questionToken=c,F.type=f,F.initializer=Da(w),z2(F.name)?F.transformFlags=1:F.transformFlags=ke(F.modifiers)|z(F.dotDotDotToken)|jn(F.name)|z(F.questionToken)|z(F.initializer)|(F.questionToken??F.type?1:0)|(F.dotDotDotToken??F.initializer?1024:0)|(Rn(F.modifiers)&31?8192:0),F.jsDoc=void 0,F}function dr(n,i,_,c,f,w,F){return n.modifiers!==i||n.dotDotDotToken!==_||n.name!==c||n.questionToken!==f||n.type!==w||n.initializer!==F?q(fr(i,_,c,f,w,F),n):n}function zn(n){let i=M(170);return i.expression=o().parenthesizeLeftSideOfAccess(n,!1),i.transformFlags|=z(i.expression)|1|8192|33554432,i}function Fn(n,i){return n.expression!==i?q(zn(i),n):n}function Nr(n,i,_,c){let f=ae(171);return f.modifiers=De(n),f.name=et(i),f.type=c,f.questionToken=_,f.transformFlags=1,f.initializer=void 0,f.jsDoc=void 0,f}function Vn(n,i,_,c,f){return n.modifiers!==i||n.name!==_||n.questionToken!==c||n.type!==f?Ce(Nr(i,_,c,f),n):n}function Ce(n,i){return n!==i&&(n.initializer=i.initializer),q(n,i)}function mr(n,i,_,c,f){let w=ae(172);w.modifiers=De(n),w.name=et(i),w.questionToken=_&&$d(_)?_:void 0,w.exclamationToken=_&&Hd(_)?_:void 0,w.type=c,w.initializer=Da(f);let F=w.flags&33554432||Rn(w.modifiers)&128;return w.transformFlags=ke(w.modifiers)|jn(w.name)|z(w.initializer)|(F||w.questionToken||w.exclamationToken||w.type?1:0)|(Ef(w.name)||Rn(w.modifiers)&256&&w.initializer?8192:0)|16777216,w.jsDoc=void 0,w}function L(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.questionToken!==(c!==void 0&&$d(c)?c:void 0)||n.exclamationToken!==(c!==void 0&&Hd(c)?c:void 0)||n.type!==f||n.initializer!==w?q(mr(i,_,c,f,w),n):n}function se(n,i,_,c,f,w){let F=ae(173);return F.modifiers=De(n),F.name=et(i),F.questionToken=_,F.typeParameters=De(c),F.parameters=De(f),F.type=w,F.transformFlags=1,F.jsDoc=void 0,F.locals=void 0,F.nextContainer=void 0,F.typeArguments=void 0,F}function fe(n,i,_,c,f,w,F){return n.modifiers!==i||n.name!==_||n.questionToken!==c||n.typeParameters!==f||n.parameters!==w||n.type!==F?Oe(se(i,_,c,f,w,F),n):n}function Te(n,i,_,c,f,w,F,pe){let Re=ae(174);if(Re.modifiers=De(n),Re.asteriskToken=i,Re.name=et(_),Re.questionToken=c,Re.exclamationToken=void 0,Re.typeParameters=De(f),Re.parameters=de(w),Re.type=F,Re.body=pe,!Re.body)Re.transformFlags=1;else{let en=Rn(Re.modifiers)&1024,kn=!!Re.asteriskToken,$n=en&&kn;Re.transformFlags=ke(Re.modifiers)|z(Re.asteriskToken)|jn(Re.name)|z(Re.questionToken)|ke(Re.typeParameters)|ke(Re.parameters)|z(Re.type)|z(Re.body)&-67108865|($n?128:en?256:kn?2048:0)|(Re.questionToken||Re.typeParameters||Re.type?1:0)|1024}return Re.typeArguments=void 0,Re.jsDoc=void 0,Re.locals=void 0,Re.nextContainer=void 0,Re.flowNode=void 0,Re.endFlowNode=void 0,Re.returnFlowNode=void 0,Re}function He(n,i,_,c,f,w,F,pe,Re){return n.modifiers!==i||n.asteriskToken!==_||n.name!==c||n.questionToken!==f||n.typeParameters!==w||n.parameters!==F||n.type!==pe||n.body!==Re?Ke(Te(i,_,c,f,w,F,pe,Re),n):n}function Ke(n,i){return n!==i&&(n.exclamationToken=i.exclamationToken),q(n,i)}function st(n){let i=ae(175);return i.body=n,i.transformFlags=z(n)|16777216,i.modifiers=void 0,i.jsDoc=void 0,i.locals=void 0,i.nextContainer=void 0,i.endFlowNode=void 0,i.returnFlowNode=void 0,i}function Dt(n,i){return n.body!==i?Tt(st(i),n):n}function Tt(n,i){return n!==i&&(n.modifiers=i.modifiers),q(n,i)}function ut(n,i,_){let c=ae(176);return c.modifiers=De(n),c.parameters=de(i),c.body=_,c.body?c.transformFlags=ke(c.modifiers)|ke(c.parameters)|z(c.body)&-67108865|1024:c.transformFlags=1,c.typeParameters=void 0,c.type=void 0,c.typeArguments=void 0,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.endFlowNode=void 0,c.returnFlowNode=void 0,c}function Ir(n,i,_,c){return n.modifiers!==i||n.parameters!==_||n.body!==c?hr(ut(i,_,c),n):n}function hr(n,i){return n!==i&&(n.typeParameters=i.typeParameters,n.type=i.type),Oe(n,i)}function Mn(n,i,_,c,f){let w=ae(177);return w.modifiers=De(n),w.name=et(i),w.parameters=de(_),w.type=c,w.body=f,w.body?w.transformFlags=ke(w.modifiers)|jn(w.name)|ke(w.parameters)|z(w.type)|z(w.body)&-67108865|(w.type?1:0):w.transformFlags=1,w.typeArguments=void 0,w.typeParameters=void 0,w.jsDoc=void 0,w.locals=void 0,w.nextContainer=void 0,w.flowNode=void 0,w.endFlowNode=void 0,w.returnFlowNode=void 0,w}function Wn(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.parameters!==c||n.type!==f||n.body!==w?Si(Mn(i,_,c,f,w),n):n}function Si(n,i){return n!==i&&(n.typeParameters=i.typeParameters),Oe(n,i)}function R(n,i,_,c){let f=ae(178);return f.modifiers=De(n),f.name=et(i),f.parameters=de(_),f.body=c,f.body?f.transformFlags=ke(f.modifiers)|jn(f.name)|ke(f.parameters)|z(f.body)&-67108865|(f.type?1:0):f.transformFlags=1,f.typeArguments=void 0,f.typeParameters=void 0,f.type=void 0,f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f.flowNode=void 0,f.endFlowNode=void 0,f.returnFlowNode=void 0,f}function $(n,i,_,c,f){return n.modifiers!==i||n.name!==_||n.parameters!==c||n.body!==f?K(R(i,_,c,f),n):n}function K(n,i){return n!==i&&(n.typeParameters=i.typeParameters,n.type=i.type),Oe(n,i)}function xe(n,i,_){let c=ae(179);return c.typeParameters=De(n),c.parameters=De(i),c.type=_,c.transformFlags=1,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.typeArguments=void 0,c}function Se(n,i,_,c){return n.typeParameters!==i||n.parameters!==_||n.type!==c?Oe(xe(i,_,c),n):n}function we(n,i,_){let c=ae(180);return c.typeParameters=De(n),c.parameters=De(i),c.type=_,c.transformFlags=1,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.typeArguments=void 0,c}function be(n,i,_,c){return n.typeParameters!==i||n.parameters!==_||n.type!==c?Oe(we(i,_,c),n):n}function We(n,i,_){let c=ae(181);return c.modifiers=De(n),c.parameters=De(i),c.type=_,c.transformFlags=1,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.typeArguments=void 0,c}function Ze(n,i,_,c){return n.parameters!==_||n.type!==c||n.modifiers!==i?Oe(We(i,_,c),n):n}function Ye(n,i){let _=M(204);return _.type=n,_.literal=i,_.transformFlags=1,_}function Ee(n,i,_){return n.type!==i||n.literal!==_?q(Ye(i,_),n):n}function Tn(n){return ct(n)}function rt(n,i,_){let c=M(182);return c.assertsModifier=n,c.parameterName=et(i),c.type=_,c.transformFlags=1,c}function ln(n,i,_,c){return n.assertsModifier!==i||n.parameterName!==_||n.type!==c?q(rt(i,_,c),n):n}function Zr(n,i){let _=M(183);return _.typeName=et(n),_.typeArguments=i&&o().parenthesizeTypeArguments(de(i)),_.transformFlags=1,_}function J(n,i,_){return n.typeName!==i||n.typeArguments!==_?q(Zr(i,_),n):n}function qe(n,i,_){let c=ae(184);return c.typeParameters=De(n),c.parameters=De(i),c.type=_,c.transformFlags=1,c.modifiers=void 0,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.typeArguments=void 0,c}function u(n,i,_,c){return n.typeParameters!==i||n.parameters!==_||n.type!==c?Ne(qe(i,_,c),n):n}function Ne(n,i){return n!==i&&(n.modifiers=i.modifiers),Oe(n,i)}function Me(...n){return n.length===4?U(...n):n.length===3?ze(...n):B.fail("Incorrect number of arguments specified.")}function U(n,i,_,c){let f=ae(185);return f.modifiers=De(n),f.typeParameters=De(i),f.parameters=De(_),f.type=c,f.transformFlags=1,f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f.typeArguments=void 0,f}function ze(n,i,_){return U(void 0,n,i,_)}function an(...n){return n.length===5?Ve(...n):n.length===4?$e(...n):B.fail("Incorrect number of arguments specified.")}function Ve(n,i,_,c,f){return n.modifiers!==i||n.typeParameters!==_||n.parameters!==c||n.type!==f?Oe(Me(i,_,c,f),n):n}function $e(n,i,_,c){return Ve(n,n.modifiers,i,_,c)}function Pt(n,i){let _=M(186);return _.exprName=n,_.typeArguments=i&&o().parenthesizeTypeArguments(i),_.transformFlags=1,_}function kt(n,i,_){return n.exprName!==i||n.typeArguments!==_?q(Pt(i,_),n):n}function Nt(n){let i=ae(187);return i.members=de(n),i.transformFlags=1,i}function qt(n,i){return n.members!==i?q(Nt(i),n):n}function Gn(n){let i=M(188);return i.elementType=o().parenthesizeNonArrayTypeOfPostfixType(n),i.transformFlags=1,i}function wi(n,i){return n.elementType!==i?q(Gn(i),n):n}function un(n){let i=M(189);return i.elements=de(o().parenthesizeElementTypesOfTupleType(n)),i.transformFlags=1,i}function G(n,i){return n.elements!==i?q(un(i),n):n}function le(n,i,_,c){let f=ae(202);return f.dotDotDotToken=n,f.name=i,f.questionToken=_,f.type=c,f.transformFlags=1,f.jsDoc=void 0,f}function Fe(n,i,_,c,f){return n.dotDotDotToken!==i||n.name!==_||n.questionToken!==c||n.type!==f?q(le(i,_,c,f),n):n}function ve(n){let i=M(190);return i.type=o().parenthesizeTypeOfOptionalType(n),i.transformFlags=1,i}function j(n,i){return n.type!==i?q(ve(i),n):n}function ht(n){let i=M(191);return i.type=n,i.transformFlags=1,i}function xt(n,i){return n.type!==i?q(ht(i),n):n}function Lt(n,i,_){let c=M(n);return c.types=ye.createNodeArray(_(i)),c.transformFlags=1,c}function pn(n,i,_){return n.types!==i?q(Lt(n.kind,i,_),n):n}function Bl(n){return Lt(192,n,o().parenthesizeConstituentTypesOfUnionType)}function Es(n,i){return pn(n,i,o().parenthesizeConstituentTypesOfUnionType)}function Or(n){return Lt(193,n,o().parenthesizeConstituentTypesOfIntersectionType)}function Je(n,i){return pn(n,i,o().parenthesizeConstituentTypesOfIntersectionType)}function ft(n,i,_,c){let f=M(194);return f.checkType=o().parenthesizeCheckTypeOfConditionalType(n),f.extendsType=o().parenthesizeExtendsTypeOfConditionalType(i),f.trueType=_,f.falseType=c,f.transformFlags=1,f.locals=void 0,f.nextContainer=void 0,f}function ql(n,i,_,c,f){return n.checkType!==i||n.extendsType!==_||n.trueType!==c||n.falseType!==f?q(ft(i,_,c,f),n):n}function Yn(n){let i=M(195);return i.typeParameter=n,i.transformFlags=1,i}function zl(n,i){return n.typeParameter!==i?q(Yn(i),n):n}function Wt(n,i){let _=M(203);return _.head=n,_.templateSpans=de(i),_.transformFlags=1,_}function Fl(n,i,_){return n.head!==i||n.templateSpans!==_?q(Wt(i,_),n):n}function sr(n,i,_,c,f=!1){let w=M(205);return w.argument=n,w.attributes=i,w.assertions&&w.assertions.assertClause&&w.attributes&&(w.assertions.assertClause=w.attributes),w.qualifier=_,w.typeArguments=c&&o().parenthesizeTypeArguments(c),w.isTypeOf=f,w.transformFlags=1,w}function aa(n,i,_,c,f,w=n.isTypeOf){return n.argument!==i||n.attributes!==_||n.qualifier!==c||n.typeArguments!==f||n.isTypeOf!==w?q(sr(i,_,c,f,w),n):n}function Qt(n){let i=M(196);return i.type=n,i.transformFlags=1,i}function Ct(n,i){return n.type!==i?q(Qt(i),n):n}function D(){let n=M(197);return n.transformFlags=1,n}function Gt(n,i){let _=M(198);return _.operator=n,_.type=n===148?o().parenthesizeOperandOfReadonlyTypeOperator(i):o().parenthesizeOperandOfTypeOperator(i),_.transformFlags=1,_}function Mr(n,i){return n.type!==i?q(Gt(n.operator,i),n):n}function or(n,i){let _=M(199);return _.objectType=o().parenthesizeNonArrayTypeOfPostfixType(n),_.indexType=i,_.transformFlags=1,_}function Ka(n,i,_){return n.objectType!==i||n.indexType!==_?q(or(i,_),n):n}function St(n,i,_,c,f,w){let F=ae(200);return F.readonlyToken=n,F.typeParameter=i,F.nameType=_,F.questionToken=c,F.type=f,F.members=w&&de(w),F.transformFlags=1,F.locals=void 0,F.nextContainer=void 0,F}function jt(n,i,_,c,f,w,F){return n.readonlyToken!==i||n.typeParameter!==_||n.nameType!==c||n.questionToken!==f||n.type!==w||n.members!==F?q(St(i,_,c,f,w,F),n):n}function ei(n){let i=M(201);return i.literal=n,i.transformFlags=1,i}function yr(n,i){return n.literal!==i?q(ei(i),n):n}function As(n){let i=M(206);return i.elements=de(n),i.transformFlags|=ke(i.elements)|1024|524288,i.transformFlags&32768&&(i.transformFlags|=65664),i}function Vl(n,i){return n.elements!==i?q(As(i),n):n}function Jr(n){let i=M(207);return i.elements=de(n),i.transformFlags|=ke(i.elements)|1024|524288,i}function Wl(n,i){return n.elements!==i?q(Jr(i),n):n}function _a(n,i,_,c){let f=ae(208);return f.dotDotDotToken=n,f.propertyName=et(i),f.name=et(_),f.initializer=Da(c),f.transformFlags|=z(f.dotDotDotToken)|jn(f.propertyName)|jn(f.name)|z(f.initializer)|(f.dotDotDotToken?32768:0)|1024,f.flowNode=void 0,f}function ti(n,i,_,c,f){return n.propertyName!==_||n.dotDotDotToken!==i||n.name!==c||n.initializer!==f?q(_a(i,_,c,f),n):n}function Za(n,i){let _=M(209),c=n&&Yi(n),f=de(n,c&&X1(c)?!0:void 0);return _.elements=o().parenthesizeExpressionsOfCommaDelimitedList(f),_.multiLine=i,_.transformFlags|=ke(_.elements),_}function Cs(n,i){return n.elements!==i?q(Za(i,n.multiLine),n):n}function ki(n,i){let _=ae(210);return _.properties=de(n),_.multiLine=i,_.transformFlags|=ke(_.properties),_.jsDoc=void 0,_}function Gl(n,i){return n.properties!==i?q(ki(i,n.multiLine),n):n}function Ds(n,i,_){let c=ae(211);return c.expression=n,c.questionDotToken=i,c.name=_,c.transformFlags=z(c.expression)|z(c.questionDotToken)|(tt(c.name)?ja(c.name):z(c.name)|536870912),c.jsDoc=void 0,c.flowNode=void 0,c}function cr(n,i){let _=Ds(o().parenthesizeLeftSideOfAccess(n,!1),void 0,et(i));return Cp(n)&&(_.transformFlags|=384),_}function Yl(n,i,_){return Lg(n)?sa(n,i,n.questionDotToken,kr(_,tt)):n.expression!==i||n.name!==_?q(cr(i,_),n):n}function Ei(n,i,_){let c=Ds(o().parenthesizeLeftSideOfAccess(n,!0),i,et(_));return c.flags|=64,c.transformFlags|=32,c}function sa(n,i,_,c){return B.assert(!!(n.flags&64),"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."),n.expression!==i||n.questionDotToken!==_||n.name!==c?q(Ei(i,_,c),n):n}function Ps(n,i,_){let c=ae(212);return c.expression=n,c.questionDotToken=i,c.argumentExpression=_,c.transformFlags|=z(c.expression)|z(c.questionDotToken)|z(c.argumentExpression),c.jsDoc=void 0,c.flowNode=void 0,c}function Ai(n,i){let _=Ps(o().parenthesizeLeftSideOfAccess(n,!1),void 0,pr(i));return Cp(n)&&(_.transformFlags|=384),_}function Xl(n,i,_){return jg(n)?e_(n,i,n.questionDotToken,_):n.expression!==i||n.argumentExpression!==_?q(Ai(i,_),n):n}function Ns(n,i,_){let c=Ps(o().parenthesizeLeftSideOfAccess(n,!0),i,pr(_));return c.flags|=64,c.transformFlags|=32,c}function e_(n,i,_,c){return B.assert(!!(n.flags&64),"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."),n.expression!==i||n.questionDotToken!==_||n.argumentExpression!==c?q(Ns(i,_,c),n):n}function Is(n,i,_,c){let f=ae(213);return f.expression=n,f.questionDotToken=i,f.typeArguments=_,f.arguments=c,f.transformFlags|=z(f.expression)|z(f.questionDotToken)|ke(f.typeArguments)|ke(f.arguments),f.typeArguments&&(f.transformFlags|=1),qd(f.expression)&&(f.transformFlags|=16384),f}function Ci(n,i,_){let c=Is(o().parenthesizeLeftSideOfAccess(n,!1),void 0,De(i),o().parenthesizeExpressionsOfCommaDelimitedList(de(_)));return Fb(c.expression)&&(c.transformFlags|=8388608),c}function oa(n,i,_,c){return Md(n)?Os(n,i,n.questionDotToken,_,c):n.expression!==i||n.typeArguments!==_||n.arguments!==c?q(Ci(i,_,c),n):n}function t_(n,i,_,c){let f=Is(o().parenthesizeLeftSideOfAccess(n,!0),i,De(_),o().parenthesizeExpressionsOfCommaDelimitedList(de(c)));return f.flags|=64,f.transformFlags|=32,f}function Os(n,i,_,c,f){return B.assert(!!(n.flags&64),"Cannot update a CallExpression using updateCallChain. Use updateCall instead."),n.expression!==i||n.questionDotToken!==_||n.typeArguments!==c||n.arguments!==f?q(t_(i,_,c,f),n):n}function xn(n,i,_){let c=ae(214);return c.expression=o().parenthesizeExpressionOfNew(n),c.typeArguments=De(i),c.arguments=_?o().parenthesizeExpressionsOfCommaDelimitedList(_):void 0,c.transformFlags|=z(c.expression)|ke(c.typeArguments)|ke(c.arguments)|32,c.typeArguments&&(c.transformFlags|=1),c}function n_(n,i,_,c){return n.expression!==i||n.typeArguments!==_||n.arguments!==c?q(xn(i,_,c),n):n}function ca(n,i,_){let c=M(215);return c.tag=o().parenthesizeLeftSideOfAccess(n,!1),c.typeArguments=De(i),c.template=_,c.transformFlags|=z(c.tag)|ke(c.typeArguments)|z(c.template)|1024,c.typeArguments&&(c.transformFlags|=1),q2(c.template)&&(c.transformFlags|=128),c}function Ms(n,i,_,c){return n.tag!==i||n.typeArguments!==_||n.template!==c?q(ca(i,_,c),n):n}function Js(n,i){let _=M(216);return _.expression=o().parenthesizeOperandOfPrefixUnary(i),_.type=n,_.transformFlags|=z(_.expression)|z(_.type)|1,_}function Ls(n,i,_){return n.type!==i||n.expression!==_?q(Js(i,_),n):n}function r_(n){let i=M(217);return i.expression=n,i.transformFlags=z(i.expression),i.jsDoc=void 0,i}function js(n,i){return n.expression!==i?q(r_(i),n):n}function i_(n,i,_,c,f,w,F){let pe=ae(218);pe.modifiers=De(n),pe.asteriskToken=i,pe.name=et(_),pe.typeParameters=De(c),pe.parameters=de(f),pe.type=w,pe.body=F;let Re=Rn(pe.modifiers)&1024,en=!!pe.asteriskToken,kn=Re&&en;return pe.transformFlags=ke(pe.modifiers)|z(pe.asteriskToken)|jn(pe.name)|ke(pe.typeParameters)|ke(pe.parameters)|z(pe.type)|z(pe.body)&-67108865|(kn?128:Re?256:en?2048:0)|(pe.typeParameters||pe.type?1:0)|4194304,pe.typeArguments=void 0,pe.jsDoc=void 0,pe.locals=void 0,pe.nextContainer=void 0,pe.flowNode=void 0,pe.endFlowNode=void 0,pe.returnFlowNode=void 0,pe}function Rs(n,i,_,c,f,w,F,pe){return n.name!==c||n.modifiers!==i||n.asteriskToken!==_||n.typeParameters!==f||n.parameters!==w||n.type!==F||n.body!==pe?Oe(i_(i,_,c,f,w,F,pe),n):n}function a_(n,i,_,c,f,w){let F=ae(219);F.modifiers=De(n),F.typeParameters=De(i),F.parameters=de(_),F.type=c,F.equalsGreaterThanToken=f??ct(39),F.body=o().parenthesizeConciseBodyOfArrowFunction(w);let pe=Rn(F.modifiers)&1024;return F.transformFlags=ke(F.modifiers)|ke(F.typeParameters)|ke(F.parameters)|z(F.type)|z(F.equalsGreaterThanToken)|z(F.body)&-67108865|(F.typeParameters||F.type?1:0)|(pe?16640:0)|1024,F.typeArguments=void 0,F.jsDoc=void 0,F.locals=void 0,F.nextContainer=void 0,F.flowNode=void 0,F.endFlowNode=void 0,F.returnFlowNode=void 0,F}function Us(n,i,_,c,f,w,F){return n.modifiers!==i||n.typeParameters!==_||n.parameters!==c||n.type!==f||n.equalsGreaterThanToken!==w||n.body!==F?Oe(a_(i,_,c,f,w,F),n):n}function Bs(n){let i=M(220);return i.expression=o().parenthesizeOperandOfPrefixUnary(n),i.transformFlags|=z(i.expression),i}function qs(n,i){return n.expression!==i?q(Bs(i),n):n}function la(n){let i=M(221);return i.expression=o().parenthesizeOperandOfPrefixUnary(n),i.transformFlags|=z(i.expression),i}function fn(n,i){return n.expression!==i?q(la(i),n):n}function __(n){let i=M(222);return i.expression=o().parenthesizeOperandOfPrefixUnary(n),i.transformFlags|=z(i.expression),i}function lr(n,i){return n.expression!==i?q(__(i),n):n}function zs(n){let i=M(223);return i.expression=o().parenthesizeOperandOfPrefixUnary(n),i.transformFlags|=z(i.expression)|256|128|2097152,i}function Lr(n,i){return n.expression!==i?q(zs(i),n):n}function jr(n,i){let _=M(224);return _.operator=n,_.operand=o().parenthesizeOperandOfPrefixUnary(i),_.transformFlags|=z(_.operand),(n===46||n===47)&&tt(_.operand)&&!Ua(_.operand)&&!Kd(_.operand)&&(_.transformFlags|=268435456),_}function Hl(n,i){return n.operand!==i?q(jr(n.operator,i),n):n}function ni(n,i){let _=M(225);return _.operator=i,_.operand=o().parenthesizeOperandOfPostfixUnary(n),_.transformFlags|=z(_.operand),tt(_.operand)&&!Ua(_.operand)&&!Kd(_.operand)&&(_.transformFlags|=268435456),_}function $l(n,i){return n.operand!==i?q(ni(i,n.operator),n):n}function ua(n,i,_){let c=ae(226),f=$c(i),w=f.kind;return c.left=o().parenthesizeLeftSideOfBinary(w,n),c.operatorToken=f,c.right=o().parenthesizeRightSideOfBinary(w,c.left,_),c.transformFlags|=z(c.left)|z(c.operatorToken)|z(c.right),w===61?c.transformFlags|=32:w===64?Of(c.left)?c.transformFlags|=5248|Fs(c.left):V1(c.left)&&(c.transformFlags|=5120|Fs(c.left)):w===43||w===68?c.transformFlags|=512:K2(w)&&(c.transformFlags|=16),w===103&&gi(c.left)&&(c.transformFlags|=536870912),c.jsDoc=void 0,c}function Fs(n){return lh(n)?65536:0}function Ql(n,i,_,c){return n.left!==i||n.operatorToken!==_||n.right!==c?q(ua(i,_,c),n):n}function Vs(n,i,_,c,f){let w=M(227);return w.condition=o().parenthesizeConditionOfConditionalExpression(n),w.questionToken=i??ct(58),w.whenTrue=o().parenthesizeBranchOfConditionalExpression(_),w.colonToken=c??ct(59),w.whenFalse=o().parenthesizeBranchOfConditionalExpression(f),w.transformFlags|=z(w.condition)|z(w.questionToken)|z(w.whenTrue)|z(w.colonToken)|z(w.whenFalse),w}function Ws(n,i,_,c,f,w){return n.condition!==i||n.questionToken!==_||n.whenTrue!==c||n.colonToken!==f||n.whenFalse!==w?q(Vs(i,_,c,f,w),n):n}function Gs(n,i){let _=M(228);return _.head=n,_.templateSpans=de(i),_.transformFlags|=z(_.head)|ke(_.templateSpans)|1024,_}function Xn(n,i,_){return n.head!==i||n.templateSpans!==_?q(Gs(i,_),n):n}function Di(n,i,_,c=0){B.assert(!(c&-7177),"Unsupported template flags.");let f;if(_!==void 0&&_!==i&&(f=Mb(n,_),typeof f=="object"))return B.fail("Invalid raw text");if(i===void 0){if(f===void 0)return B.fail("Arguments 'text' and 'rawText' may not both be undefined.");i=f}else f!==void 0&&B.assert(i===f,"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");return i}function Ys(n){let i=1024;return n&&(i|=128),i}function Kl(n,i,_,c){let f=$t(n);return f.text=i,f.rawText=_,f.templateFlags=c&7176,f.transformFlags=Ys(f.templateFlags),f}function ri(n,i,_,c){let f=ae(n);return f.text=i,f.rawText=_,f.templateFlags=c&7176,f.transformFlags=Ys(f.templateFlags),f}function ii(n,i,_,c){return n===15?ri(n,i,_,c):Kl(n,i,_,c)}function Xs(n,i,_){return n=Di(16,n,i,_),ii(16,n,i,_)}function pa(n,i,_){return n=Di(16,n,i,_),ii(17,n,i,_)}function s_(n,i,_){return n=Di(16,n,i,_),ii(18,n,i,_)}function Zl(n,i,_){return n=Di(16,n,i,_),ri(15,n,i,_)}function o_(n,i){B.assert(!n||!!i,"A `YieldExpression` with an asteriskToken must have an expression.");let _=M(229);return _.expression=i&&o().parenthesizeExpressionForDisallowedComma(i),_.asteriskToken=n,_.transformFlags|=z(_.expression)|z(_.asteriskToken)|1024|128|1048576,_}function eu(n,i,_){return n.expression!==_||n.asteriskToken!==i?q(o_(i,_),n):n}function Hs(n){let i=M(230);return i.expression=o().parenthesizeExpressionForDisallowedComma(n),i.transformFlags|=z(i.expression)|1024|32768,i}function tu(n,i){return n.expression!==i?q(Hs(i),n):n}function $s(n,i,_,c,f){let w=ae(231);return w.modifiers=De(n),w.name=et(i),w.typeParameters=De(_),w.heritageClauses=De(c),w.members=de(f),w.transformFlags|=ke(w.modifiers)|jn(w.name)|ke(w.typeParameters)|ke(w.heritageClauses)|ke(w.members)|(w.typeParameters?1:0)|1024,w.jsDoc=void 0,w}function c_(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.typeParameters!==c||n.heritageClauses!==f||n.members!==w?q($s(i,_,c,f,w),n):n}function l_(){return M(232)}function Qs(n,i){let _=M(233);return _.expression=o().parenthesizeLeftSideOfAccess(n,!1),_.typeArguments=i&&o().parenthesizeTypeArguments(i),_.transformFlags|=z(_.expression)|ke(_.typeArguments)|1024,_}function Ks(n,i,_){return n.expression!==i||n.typeArguments!==_?q(Qs(i,_),n):n}function dn(n,i){let _=M(234);return _.expression=n,_.type=i,_.transformFlags|=z(_.expression)|z(_.type)|1,_}function fa(n,i,_){return n.expression!==i||n.type!==_?q(dn(i,_),n):n}function Zs(n){let i=M(235);return i.expression=o().parenthesizeLeftSideOfAccess(n,!1),i.transformFlags|=z(i.expression)|1,i}function eo(n,i){return Rg(n)?Jn(n,i):n.expression!==i?q(Zs(i),n):n}function u_(n,i){let _=M(238);return _.expression=n,_.type=i,_.transformFlags|=z(_.expression)|z(_.type)|1,_}function to(n,i,_){return n.expression!==i||n.type!==_?q(u_(i,_),n):n}function p_(n){let i=M(235);return i.flags|=64,i.expression=o().parenthesizeLeftSideOfAccess(n,!0),i.transformFlags|=z(i.expression)|1,i}function Jn(n,i){return B.assert(!!(n.flags&64),"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."),n.expression!==i?q(p_(i),n):n}function no(n,i){let _=M(236);switch(_.keywordToken=n,_.name=i,_.transformFlags|=z(_.name),n){case 105:_.transformFlags|=1024;break;case 102:_.transformFlags|=32;break;default:return B.assertNever(n)}return _.flowNode=void 0,_}function f_(n,i){return n.name!==i?q(no(n.keywordToken,i),n):n}function Hn(n,i){let _=M(239);return _.expression=n,_.literal=i,_.transformFlags|=z(_.expression)|z(_.literal)|1024,_}function da(n,i,_){return n.expression!==i||n.literal!==_?q(Hn(i,_),n):n}function ro(){let n=M(240);return n.transformFlags|=1024,n}function Rr(n,i){let _=M(241);return _.statements=de(n),_.multiLine=i,_.transformFlags|=ke(_.statements),_.jsDoc=void 0,_.locals=void 0,_.nextContainer=void 0,_}function nu(n,i){return n.statements!==i?q(Rr(i,n.multiLine),n):n}function d_(n,i){let _=M(243);return _.modifiers=De(n),_.declarationList=Yr(i)?v_(i):i,_.transformFlags|=ke(_.modifiers)|z(_.declarationList),Rn(_.modifiers)&128&&(_.transformFlags=1),_.jsDoc=void 0,_.flowNode=void 0,_}function io(n,i,_){return n.modifiers!==i||n.declarationList!==_?q(d_(i,_),n):n}function ao(){let n=M(242);return n.jsDoc=void 0,n}function Pi(n){let i=M(244);return i.expression=o().parenthesizeExpressionOfExpressionStatement(n),i.transformFlags|=z(i.expression),i.jsDoc=void 0,i.flowNode=void 0,i}function _o(n,i){return n.expression!==i?q(Pi(i),n):n}function so(n,i,_){let c=M(245);return c.expression=n,c.thenStatement=It(i),c.elseStatement=It(_),c.transformFlags|=z(c.expression)|z(c.thenStatement)|z(c.elseStatement),c.jsDoc=void 0,c.flowNode=void 0,c}function oo(n,i,_,c){return n.expression!==i||n.thenStatement!==_||n.elseStatement!==c?q(so(i,_,c),n):n}function co(n,i){let _=M(246);return _.statement=It(n),_.expression=i,_.transformFlags|=z(_.statement)|z(_.expression),_.jsDoc=void 0,_.flowNode=void 0,_}function lo(n,i,_){return n.statement!==i||n.expression!==_?q(co(i,_),n):n}function uo(n,i){let _=M(247);return _.expression=n,_.statement=It(i),_.transformFlags|=z(_.expression)|z(_.statement),_.jsDoc=void 0,_.flowNode=void 0,_}function ru(n,i,_){return n.expression!==i||n.statement!==_?q(uo(i,_),n):n}function po(n,i,_,c){let f=M(248);return f.initializer=n,f.condition=i,f.incrementor=_,f.statement=It(c),f.transformFlags|=z(f.initializer)|z(f.condition)|z(f.incrementor)|z(f.statement),f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f.flowNode=void 0,f}function fo(n,i,_,c,f){return n.initializer!==i||n.condition!==_||n.incrementor!==c||n.statement!==f?q(po(i,_,c,f),n):n}function m_(n,i,_){let c=M(249);return c.initializer=n,c.expression=i,c.statement=It(_),c.transformFlags|=z(c.initializer)|z(c.expression)|z(c.statement),c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.flowNode=void 0,c}function iu(n,i,_,c){return n.initializer!==i||n.expression!==_||n.statement!==c?q(m_(i,_,c),n):n}function mo(n,i,_,c){let f=M(250);return f.awaitModifier=n,f.initializer=i,f.expression=o().parenthesizeExpressionForDisallowedComma(_),f.statement=It(c),f.transformFlags|=z(f.awaitModifier)|z(f.initializer)|z(f.expression)|z(f.statement)|1024,n&&(f.transformFlags|=128),f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f.flowNode=void 0,f}function au(n,i,_,c,f){return n.awaitModifier!==i||n.initializer!==_||n.expression!==c||n.statement!==f?q(mo(i,_,c,f),n):n}function ho(n){let i=M(251);return i.label=et(n),i.transformFlags|=z(i.label)|4194304,i.jsDoc=void 0,i.flowNode=void 0,i}function _u(n,i){return n.label!==i?q(ho(i),n):n}function h_(n){let i=M(252);return i.label=et(n),i.transformFlags|=z(i.label)|4194304,i.jsDoc=void 0,i.flowNode=void 0,i}function yo(n,i){return n.label!==i?q(h_(i),n):n}function y_(n){let i=M(253);return i.expression=n,i.transformFlags|=z(i.expression)|128|4194304,i.jsDoc=void 0,i.flowNode=void 0,i}function su(n,i){return n.expression!==i?q(y_(i),n):n}function g_(n,i){let _=M(254);return _.expression=n,_.statement=It(i),_.transformFlags|=z(_.expression)|z(_.statement),_.jsDoc=void 0,_.flowNode=void 0,_}function go(n,i,_){return n.expression!==i||n.statement!==_?q(g_(i,_),n):n}function b_(n,i){let _=M(255);return _.expression=o().parenthesizeExpressionForDisallowedComma(n),_.caseBlock=i,_.transformFlags|=z(_.expression)|z(_.caseBlock),_.jsDoc=void 0,_.flowNode=void 0,_.possiblyExhaustive=!1,_}function ai(n,i,_){return n.expression!==i||n.caseBlock!==_?q(b_(i,_),n):n}function bo(n,i){let _=M(256);return _.label=et(n),_.statement=It(i),_.transformFlags|=z(_.label)|z(_.statement),_.jsDoc=void 0,_.flowNode=void 0,_}function vo(n,i,_){return n.label!==i||n.statement!==_?q(bo(i,_),n):n}function To(n){let i=M(257);return i.expression=n,i.transformFlags|=z(i.expression),i.jsDoc=void 0,i.flowNode=void 0,i}function ou(n,i){return n.expression!==i?q(To(i),n):n}function xo(n,i,_){let c=M(258);return c.tryBlock=n,c.catchClause=i,c.finallyBlock=_,c.transformFlags|=z(c.tryBlock)|z(c.catchClause)|z(c.finallyBlock),c.jsDoc=void 0,c.flowNode=void 0,c}function cu(n,i,_,c){return n.tryBlock!==i||n.catchClause!==_||n.finallyBlock!==c?q(xo(i,_,c),n):n}function So(){let n=M(259);return n.jsDoc=void 0,n.flowNode=void 0,n}function ma(n,i,_,c){let f=ae(260);return f.name=et(n),f.exclamationToken=i,f.type=_,f.initializer=Da(c),f.transformFlags|=jn(f.name)|z(f.initializer)|(f.exclamationToken??f.type?1:0),f.jsDoc=void 0,f}function wo(n,i,_,c,f){return n.name!==i||n.type!==c||n.exclamationToken!==_||n.initializer!==f?q(ma(i,_,c,f),n):n}function v_(n,i=0){let _=M(261);return _.flags|=i&7,_.declarations=de(n),_.transformFlags|=ke(_.declarations)|4194304,i&7&&(_.transformFlags|=263168),i&4&&(_.transformFlags|=4),_}function lu(n,i){return n.declarations!==i?q(v_(i,n.flags),n):n}function ko(n,i,_,c,f,w,F){let pe=ae(262);if(pe.modifiers=De(n),pe.asteriskToken=i,pe.name=et(_),pe.typeParameters=De(c),pe.parameters=de(f),pe.type=w,pe.body=F,!pe.body||Rn(pe.modifiers)&128)pe.transformFlags=1;else{let Re=Rn(pe.modifiers)&1024,en=!!pe.asteriskToken,kn=Re&&en;pe.transformFlags=ke(pe.modifiers)|z(pe.asteriskToken)|jn(pe.name)|ke(pe.typeParameters)|ke(pe.parameters)|z(pe.type)|z(pe.body)&-67108865|(kn?128:Re?256:en?2048:0)|(pe.typeParameters||pe.type?1:0)|4194304}return pe.typeArguments=void 0,pe.jsDoc=void 0,pe.locals=void 0,pe.nextContainer=void 0,pe.endFlowNode=void 0,pe.returnFlowNode=void 0,pe}function T_(n,i,_,c,f,w,F,pe){return n.modifiers!==i||n.asteriskToken!==_||n.name!==c||n.typeParameters!==f||n.parameters!==w||n.type!==F||n.body!==pe?uu(ko(i,_,c,f,w,F,pe),n):n}function uu(n,i){return n!==i&&n.modifiers===i.modifiers&&(n.modifiers=i.modifiers),Oe(n,i)}function Eo(n,i,_,c,f){let w=ae(263);return w.modifiers=De(n),w.name=et(i),w.typeParameters=De(_),w.heritageClauses=De(c),w.members=de(f),Rn(w.modifiers)&128?w.transformFlags=1:(w.transformFlags|=ke(w.modifiers)|jn(w.name)|ke(w.typeParameters)|ke(w.heritageClauses)|ke(w.members)|(w.typeParameters?1:0)|1024,w.transformFlags&8192&&(w.transformFlags|=1)),w.jsDoc=void 0,w}function ha(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.typeParameters!==c||n.heritageClauses!==f||n.members!==w?q(Eo(i,_,c,f,w),n):n}function Ao(n,i,_,c,f){let w=ae(264);return w.modifiers=De(n),w.name=et(i),w.typeParameters=De(_),w.heritageClauses=De(c),w.members=de(f),w.transformFlags=1,w.jsDoc=void 0,w}function Co(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.typeParameters!==c||n.heritageClauses!==f||n.members!==w?q(Ao(i,_,c,f,w),n):n}function ot(n,i,_,c){let f=ae(265);return f.modifiers=De(n),f.name=et(i),f.typeParameters=De(_),f.type=c,f.transformFlags=1,f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f}function gr(n,i,_,c,f){return n.modifiers!==i||n.name!==_||n.typeParameters!==c||n.type!==f?q(ot(i,_,c,f),n):n}function x_(n,i,_){let c=ae(266);return c.modifiers=De(n),c.name=et(i),c.members=de(_),c.transformFlags|=ke(c.modifiers)|z(c.name)|ke(c.members)|1,c.transformFlags&=-67108865,c.jsDoc=void 0,c}function br(n,i,_,c){return n.modifiers!==i||n.name!==_||n.members!==c?q(x_(i,_,c),n):n}function Do(n,i,_,c=0){let f=ae(267);return f.modifiers=De(n),f.flags|=c&2088,f.name=i,f.body=_,Rn(f.modifiers)&128?f.transformFlags=1:f.transformFlags|=ke(f.modifiers)|z(f.name)|z(f.body)|1,f.transformFlags&=-67108865,f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f}function Et(n,i,_,c){return n.modifiers!==i||n.name!==_||n.body!==c?q(Do(i,_,c,n.flags),n):n}function vr(n){let i=M(268);return i.statements=de(n),i.transformFlags|=ke(i.statements),i.jsDoc=void 0,i}function zt(n,i){return n.statements!==i?q(vr(i),n):n}function Po(n){let i=M(269);return i.clauses=de(n),i.transformFlags|=ke(i.clauses),i.locals=void 0,i.nextContainer=void 0,i}function pu(n,i){return n.clauses!==i?q(Po(i),n):n}function No(n){let i=ae(270);return i.name=et(n),i.transformFlags|=ja(i.name)|1,i.modifiers=void 0,i.jsDoc=void 0,i}function Io(n,i){return n.name!==i?fu(No(i),n):n}function fu(n,i){return n!==i&&(n.modifiers=i.modifiers),q(n,i)}function Oo(n,i,_,c){let f=ae(271);return f.modifiers=De(n),f.name=et(_),f.isTypeOnly=i,f.moduleReference=c,f.transformFlags|=ke(f.modifiers)|ja(f.name)|z(f.moduleReference),Ff(f.moduleReference)||(f.transformFlags|=1),f.transformFlags&=-67108865,f.jsDoc=void 0,f}function Mo(n,i,_,c,f){return n.modifiers!==i||n.isTypeOnly!==_||n.name!==c||n.moduleReference!==f?q(Oo(i,_,c,f),n):n}function Jo(n,i,_,c){let f=M(272);return f.modifiers=De(n),f.importClause=i,f.moduleSpecifier=_,f.attributes=f.assertClause=c,f.transformFlags|=z(f.importClause)|z(f.moduleSpecifier),f.transformFlags&=-67108865,f.jsDoc=void 0,f}function Lo(n,i,_,c,f){return n.modifiers!==i||n.importClause!==_||n.moduleSpecifier!==c||n.attributes!==f?q(Jo(i,_,c,f),n):n}function jo(n,i,_){let c=ae(273);return c.isTypeOnly=n,c.name=i,c.namedBindings=_,c.transformFlags|=z(c.name)|z(c.namedBindings),n&&(c.transformFlags|=1),c.transformFlags&=-67108865,c}function Ro(n,i,_,c){return n.isTypeOnly!==i||n.name!==_||n.namedBindings!==c?q(jo(i,_,c),n):n}function S_(n,i){let _=M(300);return _.elements=de(n),_.multiLine=i,_.token=132,_.transformFlags|=4,_}function du(n,i,_){return n.elements!==i||n.multiLine!==_?q(S_(i,_),n):n}function Ni(n,i){let _=M(301);return _.name=n,_.value=i,_.transformFlags|=4,_}function Uo(n,i,_){return n.name!==i||n.value!==_?q(Ni(i,_),n):n}function w_(n,i){let _=M(302);return _.assertClause=n,_.multiLine=i,_}function Bo(n,i,_){return n.assertClause!==i||n.multiLine!==_?q(w_(i,_),n):n}function qo(n,i,_){let c=M(300);return c.token=_??118,c.elements=de(n),c.multiLine=i,c.transformFlags|=4,c}function k_(n,i,_){return n.elements!==i||n.multiLine!==_?q(qo(i,_,n.token),n):n}function zo(n,i){let _=M(301);return _.name=n,_.value=i,_.transformFlags|=4,_}function Fo(n,i,_){return n.name!==i||n.value!==_?q(zo(i,_),n):n}function Vo(n){let i=ae(274);return i.name=n,i.transformFlags|=z(i.name),i.transformFlags&=-67108865,i}function mu(n,i){return n.name!==i?q(Vo(i),n):n}function Wo(n){let i=ae(280);return i.name=n,i.transformFlags|=z(i.name)|32,i.transformFlags&=-67108865,i}function hu(n,i){return n.name!==i?q(Wo(i),n):n}function Go(n){let i=M(275);return i.elements=de(n),i.transformFlags|=ke(i.elements),i.transformFlags&=-67108865,i}function Yo(n,i){return n.elements!==i?q(Go(i),n):n}function Tr(n,i,_){let c=ae(276);return c.isTypeOnly=n,c.propertyName=i,c.name=_,c.transformFlags|=z(c.propertyName)|z(c.name),c.transformFlags&=-67108865,c}function yu(n,i,_,c){return n.isTypeOnly!==i||n.propertyName!==_||n.name!==c?q(Tr(i,_,c),n):n}function ya(n,i,_){let c=ae(277);return c.modifiers=De(n),c.isExportEquals=i,c.expression=i?o().parenthesizeRightSideOfBinary(64,void 0,_):o().parenthesizeExpressionOfExportDefault(_),c.transformFlags|=ke(c.modifiers)|z(c.expression),c.transformFlags&=-67108865,c.jsDoc=void 0,c}function Ii(n,i,_){return n.modifiers!==i||n.expression!==_?q(ya(i,n.isExportEquals,_),n):n}function ga(n,i,_,c,f){let w=ae(278);return w.modifiers=De(n),w.isTypeOnly=i,w.exportClause=_,w.moduleSpecifier=c,w.attributes=w.assertClause=f,w.transformFlags|=ke(w.modifiers)|z(w.exportClause)|z(w.moduleSpecifier),w.transformFlags&=-67108865,w.jsDoc=void 0,w}function Xo(n,i,_,c,f,w){return n.modifiers!==i||n.isTypeOnly!==_||n.exportClause!==c||n.moduleSpecifier!==f||n.attributes!==w?Oi(ga(i,_,c,f,w),n):n}function Oi(n,i){return n!==i&&n.modifiers===i.modifiers&&(n.modifiers=i.modifiers),q(n,i)}function E_(n){let i=M(279);return i.elements=de(n),i.transformFlags|=ke(i.elements),i.transformFlags&=-67108865,i}function gu(n,i){return n.elements!==i?q(E_(i),n):n}function ba(n,i,_){let c=M(281);return c.isTypeOnly=n,c.propertyName=et(i),c.name=et(_),c.transformFlags|=z(c.propertyName)|z(c.name),c.transformFlags&=-67108865,c.jsDoc=void 0,c}function bu(n,i,_,c){return n.isTypeOnly!==i||n.propertyName!==_||n.name!==c?q(ba(i,_,c),n):n}function vu(){let n=ae(282);return n.jsDoc=void 0,n}function A_(n){let i=M(283);return i.expression=n,i.transformFlags|=z(i.expression),i.transformFlags&=-67108865,i}function Tu(n,i){return n.expression!==i?q(A_(i),n):n}function Ho(n){return M(n)}function $o(n,i,_=!1){let c=C_(n,_?i&&o().parenthesizeNonArrayTypeOfPostfixType(i):i);return c.postfix=_,c}function C_(n,i){let _=M(n);return _.type=i,_}function xu(n,i,_){return i.type!==_?q($o(n,_,i.postfix),i):i}function Su(n,i,_){return i.type!==_?q(C_(n,_),i):i}function Qo(n,i){let _=ae(317);return _.parameters=De(n),_.type=i,_.transformFlags=ke(_.parameters)|(_.type?1:0),_.jsDoc=void 0,_.locals=void 0,_.nextContainer=void 0,_.typeArguments=void 0,_}function wu(n,i,_){return n.parameters!==i||n.type!==_?q(Qo(i,_),n):n}function Ko(n,i=!1){let _=ae(322);return _.jsDocPropertyTags=De(n),_.isArrayType=i,_}function ku(n,i,_){return n.jsDocPropertyTags!==i||n.isArrayType!==_?q(Ko(i,_),n):n}function Zo(n){let i=M(309);return i.type=n,i}function D_(n,i){return n.type!==i?q(Zo(i),n):n}function ec(n,i,_){let c=ae(323);return c.typeParameters=De(n),c.parameters=de(i),c.type=_,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c}function Eu(n,i,_,c){return n.typeParameters!==i||n.parameters!==_||n.type!==c?q(ec(i,_,c),n):n}function _n(n){let i=al(n.kind);return n.tagName.escapedText===Ja(i)?n.tagName:Ge(i)}function Sn(n,i,_){let c=M(n);return c.tagName=i,c.comment=_,c}function Ur(n,i,_){let c=ae(n);return c.tagName=i,c.comment=_,c}function P_(n,i,_,c){let f=Sn(345,n??Ge("template"),c);return f.constraint=i,f.typeParameters=de(_),f}function tc(n,i=_n(n),_,c,f){return n.tagName!==i||n.constraint!==_||n.typeParameters!==c||n.comment!==f?q(P_(i,_,c,f),n):n}function va(n,i,_,c){let f=Ur(346,n??Ge("typedef"),c);return f.typeExpression=i,f.fullName=_,f.name=Zd(_),f.locals=void 0,f.nextContainer=void 0,f}function Au(n,i=_n(n),_,c,f){return n.tagName!==i||n.typeExpression!==_||n.fullName!==c||n.comment!==f?q(va(i,_,c,f),n):n}function N_(n,i,_,c,f,w){let F=Ur(341,n??Ge("param"),w);return F.typeExpression=c,F.name=i,F.isNameFirst=!!f,F.isBracketed=_,F}function Cu(n,i=_n(n),_,c,f,w,F){return n.tagName!==i||n.name!==_||n.isBracketed!==c||n.typeExpression!==f||n.isNameFirst!==w||n.comment!==F?q(N_(i,_,c,f,w,F),n):n}function nc(n,i,_,c,f,w){let F=Ur(348,n??Ge("prop"),w);return F.typeExpression=c,F.name=i,F.isNameFirst=!!f,F.isBracketed=_,F}function rc(n,i=_n(n),_,c,f,w,F){return n.tagName!==i||n.name!==_||n.isBracketed!==c||n.typeExpression!==f||n.isNameFirst!==w||n.comment!==F?q(nc(i,_,c,f,w,F),n):n}function ic(n,i,_,c){let f=Ur(338,n??Ge("callback"),c);return f.typeExpression=i,f.fullName=_,f.name=Zd(_),f.locals=void 0,f.nextContainer=void 0,f}function ac(n,i=_n(n),_,c,f){return n.tagName!==i||n.typeExpression!==_||n.fullName!==c||n.comment!==f?q(ic(i,_,c,f),n):n}function _c(n,i,_){let c=Sn(339,n??Ge("overload"),_);return c.typeExpression=i,c}function I_(n,i=_n(n),_,c){return n.tagName!==i||n.typeExpression!==_||n.comment!==c?q(_c(i,_,c),n):n}function O_(n,i,_){let c=Sn(328,n??Ge("augments"),_);return c.class=i,c}function Mi(n,i=_n(n),_,c){return n.tagName!==i||n.class!==_||n.comment!==c?q(O_(i,_,c),n):n}function sc(n,i,_){let c=Sn(329,n??Ge("implements"),_);return c.class=i,c}function Br(n,i,_){let c=Sn(347,n??Ge("see"),_);return c.name=i,c}function Ta(n,i,_,c){return n.tagName!==i||n.name!==_||n.comment!==c?q(Br(i,_,c),n):n}function oc(n){let i=M(310);return i.name=n,i}function Du(n,i){return n.name!==i?q(oc(i),n):n}function cc(n,i){let _=M(311);return _.left=n,_.right=i,_.transformFlags|=z(_.left)|z(_.right),_}function Pu(n,i,_){return n.left!==i||n.right!==_?q(cc(i,_),n):n}function lc(n,i){let _=M(324);return _.name=n,_.text=i,_}function uc(n,i,_){return n.name!==i?q(lc(i,_),n):n}function pc(n,i){let _=M(325);return _.name=n,_.text=i,_}function Nu(n,i,_){return n.name!==i?q(pc(i,_),n):n}function fc(n,i){let _=M(326);return _.name=n,_.text=i,_}function Iu(n,i,_){return n.name!==i?q(fc(i,_),n):n}function Ou(n,i=_n(n),_,c){return n.tagName!==i||n.class!==_||n.comment!==c?q(sc(i,_,c),n):n}function dc(n,i,_){return Sn(n,i??Ge(al(n)),_)}function Mu(n,i,_=_n(i),c){return i.tagName!==_||i.comment!==c?q(dc(n,_,c),i):i}function mc(n,i,_,c){let f=Sn(n,i??Ge(al(n)),c);return f.typeExpression=_,f}function Ju(n,i,_=_n(i),c,f){return i.tagName!==_||i.typeExpression!==c||i.comment!==f?q(mc(n,_,c,f),i):i}function hc(n,i){return Sn(327,n,i)}function Lu(n,i,_){return n.tagName!==i||n.comment!==_?q(hc(i,_),n):n}function yc(n,i,_){let c=Ur(340,n??Ge(al(340)),_);return c.typeExpression=i,c.locals=void 0,c.nextContainer=void 0,c}function M_(n,i=_n(n),_,c){return n.tagName!==i||n.typeExpression!==_||n.comment!==c?q(yc(i,_,c),n):n}function gc(n,i,_,c,f){let w=Sn(351,n??Ge("import"),f);return w.importClause=i,w.moduleSpecifier=_,w.attributes=c,w.comment=f,w}function bc(n,i,_,c,f,w){return n.tagName!==i||n.comment!==w||n.importClause!==_||n.moduleSpecifier!==c||n.attributes!==f?q(gc(i,_,c,f,w),n):n}function J_(n){let i=M(321);return i.text=n,i}function ju(n,i){return n.text!==i?q(J_(i),n):n}function Ji(n,i){let _=M(320);return _.comment=n,_.tags=De(i),_}function vc(n,i,_){return n.comment!==i||n.tags!==_?q(Ji(i,_),n):n}function Tc(n,i,_){let c=M(284);return c.openingElement=n,c.children=de(i),c.closingElement=_,c.transformFlags|=z(c.openingElement)|ke(c.children)|z(c.closingElement)|2,c}function Ru(n,i,_,c){return n.openingElement!==i||n.children!==_||n.closingElement!==c?q(Tc(i,_,c),n):n}function xc(n,i,_){let c=M(285);return c.tagName=n,c.typeArguments=De(i),c.attributes=_,c.transformFlags|=z(c.tagName)|ke(c.typeArguments)|z(c.attributes)|2,c.typeArguments&&(c.transformFlags|=1),c}function L_(n,i,_,c){return n.tagName!==i||n.typeArguments!==_||n.attributes!==c?q(xc(i,_,c),n):n}function j_(n,i,_){let c=M(286);return c.tagName=n,c.typeArguments=De(i),c.attributes=_,c.transformFlags|=z(c.tagName)|ke(c.typeArguments)|z(c.attributes)|2,i&&(c.transformFlags|=1),c}function Sc(n,i,_,c){return n.tagName!==i||n.typeArguments!==_||n.attributes!==c?q(j_(i,_,c),n):n}function xa(n){let i=M(287);return i.tagName=n,i.transformFlags|=z(i.tagName)|2,i}function Kt(n,i){return n.tagName!==i?q(xa(i),n):n}function R_(n,i,_){let c=M(288);return c.openingFragment=n,c.children=de(i),c.closingFragment=_,c.transformFlags|=z(c.openingFragment)|ke(c.children)|z(c.closingFragment)|2,c}function wc(n,i,_,c){return n.openingFragment!==i||n.children!==_||n.closingFragment!==c?q(R_(i,_,c),n):n}function Sa(n,i){let _=M(12);return _.text=n,_.containsOnlyTriviaWhiteSpaces=!!i,_.transformFlags|=2,_}function kc(n,i,_){return n.text!==i||n.containsOnlyTriviaWhiteSpaces!==_?q(Sa(i,_),n):n}function Uu(){let n=M(289);return n.transformFlags|=2,n}function Bu(){let n=M(290);return n.transformFlags|=2,n}function Ec(n,i){let _=ae(291);return _.name=n,_.initializer=i,_.transformFlags|=z(_.name)|z(_.initializer)|2,_}function wa(n,i,_){return n.name!==i||n.initializer!==_?q(Ec(i,_),n):n}function Ac(n){let i=ae(292);return i.properties=de(n),i.transformFlags|=ke(i.properties)|2,i}function qu(n,i){return n.properties!==i?q(Ac(i),n):n}function Cc(n){let i=M(293);return i.expression=n,i.transformFlags|=z(i.expression)|2,i}function zu(n,i){return n.expression!==i?q(Cc(i),n):n}function ka(n,i){let _=M(294);return _.dotDotDotToken=n,_.expression=i,_.transformFlags|=z(_.dotDotDotToken)|z(_.expression)|2,_}function Li(n,i){return n.expression!==i?q(ka(n.dotDotDotToken,i),n):n}function Dc(n,i){let _=M(295);return _.namespace=n,_.name=i,_.transformFlags|=z(_.namespace)|z(_.name)|2,_}function U_(n,i,_){return n.namespace!==i||n.name!==_?q(Dc(i,_),n):n}function B_(n,i){let _=M(296);return _.expression=o().parenthesizeExpressionForDisallowedComma(n),_.statements=de(i),_.transformFlags|=z(_.expression)|ke(_.statements),_.jsDoc=void 0,_}function Fu(n,i,_){return n.expression!==i||n.statements!==_?q(B_(i,_),n):n}function _i(n){let i=M(297);return i.statements=de(n),i.transformFlags=ke(i.statements),i}function Pc(n,i){return n.statements!==i?q(_i(i),n):n}function Nc(n,i){let _=M(298);switch(_.token=n,_.types=de(i),_.transformFlags|=ke(_.types),n){case 96:_.transformFlags|=1024;break;case 119:_.transformFlags|=1;break;default:return B.assertNever(n)}return _}function Vu(n,i){return n.types!==i?q(Nc(n.token,i),n):n}function q_(n,i){let _=M(299);return _.variableDeclaration=xr(n),_.block=i,_.transformFlags|=z(_.variableDeclaration)|z(_.block)|(n?0:64),_.locals=void 0,_.nextContainer=void 0,_}function Ic(n,i,_){return n.variableDeclaration!==i||n.block!==_?q(q_(i,_),n):n}function Ea(n,i){let _=ae(303);return _.name=et(n),_.initializer=o().parenthesizeExpressionForDisallowedComma(i),_.transformFlags|=jn(_.name)|z(_.initializer),_.modifiers=void 0,_.questionToken=void 0,_.exclamationToken=void 0,_.jsDoc=void 0,_}function qr(n,i,_){return n.name!==i||n.initializer!==_?Wu(Ea(i,_),n):n}function Wu(n,i){return n!==i&&(n.modifiers=i.modifiers,n.questionToken=i.questionToken,n.exclamationToken=i.exclamationToken),q(n,i)}function Oc(n,i){let _=ae(304);return _.name=et(n),_.objectAssignmentInitializer=i&&o().parenthesizeExpressionForDisallowedComma(i),_.transformFlags|=ja(_.name)|z(_.objectAssignmentInitializer)|1024,_.equalsToken=void 0,_.modifiers=void 0,_.questionToken=void 0,_.exclamationToken=void 0,_.jsDoc=void 0,_}function Gu(n,i,_){return n.name!==i||n.objectAssignmentInitializer!==_?Yu(Oc(i,_),n):n}function Yu(n,i){return n!==i&&(n.modifiers=i.modifiers,n.questionToken=i.questionToken,n.exclamationToken=i.exclamationToken,n.equalsToken=i.equalsToken),q(n,i)}function z_(n){let i=ae(305);return i.expression=o().parenthesizeExpressionForDisallowedComma(n),i.transformFlags|=z(i.expression)|128|65536,i.jsDoc=void 0,i}function Mc(n,i){return n.expression!==i?q(z_(i),n):n}function wn(n,i){let _=ae(306);return _.name=et(n),_.initializer=i&&o().parenthesizeExpressionForDisallowedComma(i),_.transformFlags|=z(_.name)|z(_.initializer)|1,_.jsDoc=void 0,_}function Jc(n,i,_){return n.name!==i||n.initializer!==_?q(wn(i,_),n):n}function Xu(n,i,_){let c=t.createBaseSourceFileNode(307);return c.statements=de(n),c.endOfFileToken=i,c.flags|=_,c.text="",c.fileName="",c.path="",c.resolvedPath="",c.originalFileName="",c.languageVersion=1,c.languageVariant=0,c.scriptKind=0,c.isDeclarationFile=!1,c.hasNoDefaultLib=!1,c.transformFlags|=ke(c.statements)|z(c.endOfFileToken),c.locals=void 0,c.nextContainer=void 0,c.endFlowNode=void 0,c.nodeCount=0,c.identifierCount=0,c.symbolCount=0,c.parseDiagnostics=void 0,c.bindDiagnostics=void 0,c.bindSuggestionDiagnostics=void 0,c.lineMap=void 0,c.externalModuleIndicator=void 0,c.setExternalModuleIndicator=void 0,c.pragmas=void 0,c.checkJsDirective=void 0,c.referencedFiles=void 0,c.typeReferenceDirectives=void 0,c.libReferenceDirectives=void 0,c.amdDependencies=void 0,c.commentDirectives=void 0,c.identifiers=void 0,c.packageJsonLocations=void 0,c.packageJsonScope=void 0,c.imports=void 0,c.moduleAugmentations=void 0,c.ambientModuleNames=void 0,c.classifiableNames=void 0,c.impliedNodeFormat=void 0,c}function Lc(n){let i=Object.create(n.redirectTarget);return Object.defineProperties(i,{id:{get(){return this.redirectInfo.redirectTarget.id},set(_){this.redirectInfo.redirectTarget.id=_}},symbol:{get(){return this.redirectInfo.redirectTarget.symbol},set(_){this.redirectInfo.redirectTarget.symbol=_}}}),i.redirectInfo=n,i}function Hu(n){let i=Lc(n.redirectInfo);return i.flags|=n.flags&-17,i.fileName=n.fileName,i.path=n.path,i.resolvedPath=n.resolvedPath,i.originalFileName=n.originalFileName,i.packageJsonLocations=n.packageJsonLocations,i.packageJsonScope=n.packageJsonScope,i.emitNode=void 0,i}function jc(n){let i=t.createBaseSourceFileNode(307);i.flags|=n.flags&-17;for(let _ in n)if(!(Cr(i,_)||!Cr(n,_))){if(_==="emitNode"){i.emitNode=void 0;continue}i[_]=n[_]}return i}function Aa(n){let i=n.redirectInfo?Hu(n):jc(n);return a(i,n),i}function $u(n,i,_,c,f,w,F){let pe=Aa(n);return pe.statements=de(i),pe.isDeclarationFile=_,pe.referencedFiles=c,pe.typeReferenceDirectives=f,pe.hasNoDefaultLib=w,pe.libReferenceDirectives=F,pe.transformFlags=ke(pe.statements)|z(pe.endOfFileToken),pe}function Qu(n,i,_=n.isDeclarationFile,c=n.referencedFiles,f=n.typeReferenceDirectives,w=n.hasNoDefaultLib,F=n.libReferenceDirectives){return n.statements!==i||n.isDeclarationFile!==_||n.referencedFiles!==c||n.typeReferenceDirectives!==f||n.hasNoDefaultLib!==w||n.libReferenceDirectives!==F?q($u(n,i,_,c,f,w,F),n):n}function F_(n){let i=M(308);return i.sourceFiles=n,i.syntheticFileReferences=void 0,i.syntheticTypeReferences=void 0,i.syntheticLibReferences=void 0,i.hasNoDefaultLib=void 0,i}function Ku(n,i){return n.sourceFiles!==i?q(F_(i),n):n}function Zu(n,i=!1,_){let c=M(237);return c.type=n,c.isSpread=i,c.tupleNameSource=_,c}function Ca(n){let i=M(352);return i._children=n,i}function Rc(n){let i=M(353);return i.original=n,yn(i,n),i}function Uc(n,i){let _=M(355);return _.expression=n,_.original=i,_.transformFlags|=z(_.expression)|1,yn(_,i),_}function Bc(n,i){return n.expression!==i?q(Uc(i,n.original),n):n}function ep(){return M(354)}function tp(n){if(La(n)&&!hl(n)&&!n.original&&!n.emitNode&&!n.id){if(r6(n))return n.elements;if(Zi(n)&&qb(n.operatorToken))return[n.left,n.right]}return n}function V_(n){let i=M(356);return i.elements=de(oy(n,tp)),i.transformFlags|=ke(i.elements),i}function qc(n,i){return n.elements!==i?q(V_(i),n):n}function W_(n,i){let _=M(357);return _.expression=n,_.thisArg=i,_.transformFlags|=z(_.expression)|z(_.thisArg),_}function zc(n,i,_){return n.expression!==i||n.thisArg!==_?q(W_(i,_),n):n}function np(n){let i=bn(n.escapedText);return i.flags|=n.flags&-17,i.transformFlags=n.transformFlags,a(i,n),setIdentifierAutoGenerate(i,{...n.emitNode.autoGenerate}),i}function rp(n){let i=bn(n.escapedText);i.flags|=n.flags&-17,i.jsDoc=n.jsDoc,i.flowNode=n.flowNode,i.symbol=n.symbol,i.transformFlags=n.transformFlags,a(i,n);let _=getIdentifierTypeArguments(n);return _&&setIdentifierTypeArguments(i,_),i}function Fc(n){let i=On(n.escapedText);return i.flags|=n.flags&-17,i.transformFlags=n.transformFlags,a(i,n),setIdentifierAutoGenerate(i,{...n.emitNode.autoGenerate}),i}function Vc(n){let i=On(n.escapedText);return i.flags|=n.flags&-17,i.transformFlags=n.transformFlags,a(i,n),i}function G_(n){if(n===void 0)return n;if(nh(n))return Aa(n);if(Ua(n))return np(n);if(tt(n))return rp(n);if(a1(n))return Fc(n);if(gi(n))return Vc(n);let i=df(n.kind)?t.createBaseNode(n.kind):t.createBaseTokenNode(n.kind);i.flags|=n.flags&-17,i.transformFlags=n.transformFlags,a(i,n);for(let _ in n)Cr(i,_)||!Cr(n,_)||(i[_]=n[_]);return i}function ip(n,i,_){return Ci(i_(void 0,void 0,void 0,void 0,i?[i]:[],void 0,Rr(n,!0)),void 0,_?[_]:[])}function ap(n,i,_){return Ci(a_(void 0,void 0,i?[i]:[],void 0,void 0,Rr(n,!0)),void 0,_?[_]:[])}function si(){return __(V("0"))}function Wc(n){return ya(void 0,!1,n)}function _p(n){return ga(void 0,!1,E_([ba(!1,void 0,n)]))}function Y_(n,i){return i==="null"?ye.createStrictEquality(n,Jt()):i==="undefined"?ye.createStrictEquality(n,si()):ye.createStrictEquality(la(n),dt(i))}function sp(n,i){return i==="null"?ye.createStrictInequality(n,Jt()):i==="undefined"?ye.createStrictInequality(n,si()):ye.createStrictInequality(la(n),dt(i))}function zr(n,i,_){return Md(n)?t_(Ei(n,void 0,i),void 0,void 0,_):Ci(cr(n,i),void 0,_)}function op(n,i,_){return zr(n,"bind",[i,..._])}function cp(n,i,_){return zr(n,"call",[i,..._])}function lp(n,i,_){return zr(n,"apply",[i,_])}function ji(n,i,_){return zr(Ge(n),i,_)}function Ri(n,i){return zr(n,"slice",i===void 0?[]:[pr(i)])}function up(n,i){return zr(n,"concat",i)}function X_(n,i,_){return ji("Object","defineProperty",[n,pr(i),_])}function oi(n,i){return ji("Object","getOwnPropertyDescriptor",[n,pr(i)])}function Gc(n,i,_){return ji("Reflect","get",_?[n,i,_]:[n,i])}function pp(n,i,_,c){return ji("Reflect","set",c?[n,i,_,c]:[n,i,_])}function ci(n,i,_){return _?(n.push(Ea(i,_)),!0):!1}function Yc(n,i){let _=[];ci(_,"enumerable",pr(n.enumerable)),ci(_,"configurable",pr(n.configurable));let c=ci(_,"writable",pr(n.writable));c=ci(_,"value",n.value)||c;let f=ci(_,"get",n.get);return f=ci(_,"set",n.set)||f,B.assert(!(c&&f),"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."),ki(_,!i)}function fp(n,i){switch(n.kind){case 217:return js(n,i);case 216:return Ls(n,n.type,i);case 234:return fa(n,i,n.type);case 238:return to(n,i,n.type);case 235:return eo(n,i);case 233:return Ks(n,i,n.typeArguments);case 355:return Bc(n,i)}}function dp(n){return Cl(n)&&La(n)&&La(getSourceMapRange(n))&&La(getCommentRange(n))&&!Xt(getSyntheticLeadingComments(n))&&!Xt(getSyntheticTrailingComments(n))}function Xc(n,i,_=31){return n&&ch(n,_)&&!dp(n)?fp(n,Xc(n.expression,i)):i}function H_(n,i,_){if(!i)return n;let c=vo(i,i.label,$1(i.statement)?H_(n,i.statement):n);return _&&_(i),c}function $_(n,i){let _=Tf(n);switch(_.kind){case 80:return i;case 110:case 9:case 10:case 11:return!1;case 209:return _.elements.length!==0;case 210:return _.properties.length>0;default:return!0}}function Hc(n,i,_,c=!1){let f=Wf(n,31),w,F;return qd(f)?(w=Ut(),F=f):Cp(f)?(w=Ut(),F=_!==void 0&&_<2?yn(Ge("_super"),f):f):za(f)&8192?(w=si(),F=o().parenthesizeLeftSideOfAccess(f,!1)):Xr(f)?$_(f.expression,c)?(w=ir(i),F=cr(yn(ye.createAssignment(w,f.expression),f.expression),f.name),yn(F,f)):(w=f.expression,F=f):Xa(f)?$_(f.expression,c)?(w=ir(i),F=Ai(yn(ye.createAssignment(w,f.expression),f.expression),f.argumentExpression),yn(F,f)):(w=f.expression,F=f):(w=si(),F=o().parenthesizeLeftSideOfAccess(n,!1)),{target:F,thisArg:w}}function s(n,i){return cr(r_(ki([R(void 0,"value",[fr(void 0,void 0,n,void 0,void 0,void 0)],Rr([Pi(i)]))])),"value")}function p(n){return n.length>10?V_(n):gy(n,ye.createComma)}function d(n,i,_,c=0,f){let w=f?n&&uf(n):Zm(n);if(w&&tt(w)&&!Ua(w)){let F=wf(yn(G_(w),w),w.parent);return c|=za(w),_||(c|=96),i||(c|=3072),c&&setEmitFlags(F,c),F}return Bn(n)}function b(n,i,_){return d(n,i,_,98304)}function S(n,i,_,c){return d(n,i,_,32768,c)}function N(n,i,_){return d(n,i,_,16384)}function H(n,i,_){return d(n,i,_)}function _e(n,i,_,c){let f=cr(n,La(i)?i:G_(i));yn(f,i);let w=0;return c||(w|=96),_||(w|=3072),w&&setEmitFlags(f,w),f}function Z(n,i,_,c){return n&&bs(i,32)?_e(n,d(i),_,c):N(i,_,c)}function ee(n,i,_,c){let f=je(n,i,0,_);return Ae(n,i,f,c)}function ce(n){return Ya(n.expression)&&n.expression.text==="use strict"}function Le(){return w6(Pi(dt("use strict")))}function je(n,i,_=0,c){B.assert(i.length===0,"Prologue directives should be at the first statement in the target statements array");let f=!1,w=n.length;for(;_pe&&en.splice(f,0,...i.slice(pe,Re)),pe>F&&en.splice(c,0,...i.slice(F,pe)),F>w&&en.splice(_,0,...i.slice(w,F)),w>0)if(_===0)en.splice(0,0,...i.slice(0,w));else{let kn=new Map;for(let $n=0;$n<_;$n++){let Pa=n[$n];kn.set(Pa.expression.text,!0)}for(let $n=w-1;$n>=0;$n--){let Pa=i[$n];kn.has(Pa.expression.text)||en.unshift(Pa)}}return mi(n)?yn(de(en,n.hasTrailingComma),n):n}function Ln(n,i){let _;return typeof i=="number"?_=vn(i):_=i,Af(n)?_r(n,_,n.name,n.constraint,n.default):ds(n)?dr(n,_,n.dotDotDotToken,n.name,n.questionToken,n.type,n.initializer):If(n)?Ve(n,_,n.typeParameters,n.parameters,n.type):N1(n)?Vn(n,_,n.name,n.questionToken,n.type):Va(n)?L(n,_,n.name,n.questionToken??n.exclamationToken,n.type,n.initializer):I1(n)?fe(n,_,n.name,n.questionToken,n.typeParameters,n.parameters,n.type):ms(n)?He(n,_,n.asteriskToken,n.name,n.questionToken,n.typeParameters,n.parameters,n.type,n.body):Cf(n)?Ir(n,_,n.parameters,n.body):bl(n)?Wn(n,_,n.name,n.parameters,n.type,n.body):hs(n)?$(n,_,n.name,n.parameters,n.body):Df(n)?Ze(n,_,n.parameters,n.type):Jf(n)?Rs(n,_,n.asteriskToken,n.name,n.typeParameters,n.parameters,n.type,n.body):Lf(n)?Us(n,_,n.typeParameters,n.parameters,n.type,n.equalsGreaterThanToken,n.body):vl(n)?c_(n,_,n.name,n.typeParameters,n.heritageClauses,n.members):Ha(n)?io(n,_,n.declarationList):Rf(n)?T_(n,_,n.asteriskToken,n.name,n.typeParameters,n.parameters,n.type,n.body):Wa(n)?ha(n,_,n.name,n.typeParameters,n.heritageClauses,n.members):vs(n)?Co(n,_,n.name,n.typeParameters,n.heritageClauses,n.members):Pl(n)?gr(n,_,n.name,n.typeParameters,n.type):K1(n)?br(n,_,n.name,n.members):Ti(n)?Et(n,_,n.name,n.body):Uf(n)?Mo(n,_,n.isTypeOnly,n.name,n.moduleReference):Bf(n)?Lo(n,_,n.importClause,n.moduleSpecifier,n.attributes):qf(n)?Ii(n,_,n.expression):zf(n)?Xo(n,_,n.isTypeOnly,n.exportClause,n.moduleSpecifier,n.attributes):B.assertNever(n)}function Fr(n,i){return ds(n)?dr(n,i,n.dotDotDotToken,n.name,n.questionToken,n.type,n.initializer):Va(n)?L(n,i,n.name,n.questionToken??n.exclamationToken,n.type,n.initializer):ms(n)?He(n,i,n.asteriskToken,n.name,n.questionToken,n.typeParameters,n.parameters,n.type,n.body):bl(n)?Wn(n,i,n.name,n.parameters,n.type,n.body):hs(n)?$(n,i,n.name,n.parameters,n.body):vl(n)?c_(n,i,n.name,n.typeParameters,n.heritageClauses,n.members):Wa(n)?ha(n,i,n.name,n.typeParameters,n.heritageClauses,n.members):B.assertNever(n)}function mp(n,i){switch(n.kind){case 177:return Wn(n,n.modifiers,i,n.parameters,n.type,n.body);case 178:return $(n,n.modifiers,i,n.parameters,n.body);case 174:return He(n,n.modifiers,n.asteriskToken,i,n.questionToken,n.typeParameters,n.parameters,n.type,n.body);case 173:return fe(n,n.modifiers,i,n.questionToken,n.typeParameters,n.parameters,n.type);case 172:return L(n,n.modifiers,i,n.questionToken??n.exclamationToken,n.type,n.initializer);case 171:return Vn(n,n.modifiers,i,n.questionToken,n.type);case 303:return qr(n,i,n.initializer)}}function De(n){return n?de(n):void 0}function et(n){return typeof n=="string"?Ge(n):n}function pr(n){return typeof n=="string"?dt(n):typeof n=="number"?V(n):typeof n=="boolean"?n?lt():ar():n}function Da(n){return n&&o().parenthesizeExpressionForDisallowedComma(n)}function $c(n){return typeof n=="number"?ct(n):n}function It(n){return n&&i6(n)?yn(a(ao(),n),n):n}function xr(n){return typeof n=="string"||n&&!jf(n)?ma(n,void 0,void 0,void 0):n}function q(n,i){return n!==i&&(a(n,i),yn(n,i)),n}}function al(e){switch(e){case 344:return"type";case 342:return"returns";case 343:return"this";case 340:return"enum";case 330:return"author";case 332:return"class";case 333:return"public";case 334:return"private";case 335:return"protected";case 336:return"readonly";case 337:return"override";case 345:return"template";case 346:return"typedef";case 341:return"param";case 348:return"prop";case 338:return"callback";case 339:return"overload";case 328:return"augments";case 329:return"implements";case 351:return"import";default:return B.fail(`Unsupported kind: ${B.formatSyntaxKind(e)}`)}}var En,Yd={};function Mb(e,t){switch(En||(En=of(99,!1,0)),e){case 15:En.setText("`"+t+"`");break;case 16:En.setText("`"+t+"${");break;case 17:En.setText("}"+t+"${");break;case 18:En.setText("}"+t+"`");break}let a=En.scan();if(a===20&&(a=En.reScanTemplateToken(!1)),En.isUnterminated())return En.setText(void 0),Yd;let o;switch(a){case 15:case 16:case 17:case 18:o=En.getTokenValue();break}return o===void 0||En.scan()!==1?(En.setText(void 0),Yd):(En.setText(void 0),o)}function jn(e){return e&&tt(e)?ja(e):z(e)}function ja(e){return z(e)&-67108865}function Jb(e,t){return t|e.transformFlags&134234112}function z(e){if(!e)return 0;let t=e.transformFlags&~Lb(e.kind);return vg(e)&&_1(e.name)?Jb(e.name,t):t}function ke(e){return e?e.transformFlags:0}function Xd(e){let t=0;for(let a of e)t|=z(a);e.transformFlags=t}function Lb(e){if(e>=182&&e<=205)return-2;switch(e){case 213:case 214:case 209:return-2147450880;case 267:return-1941676032;case 169:return-2147483648;case 219:return-2072174592;case 218:case 262:return-1937940480;case 261:return-2146893824;case 263:case 231:return-2147344384;case 176:return-1937948672;case 172:return-2013249536;case 174:case 177:case 178:return-2005057536;case 133:case 150:case 163:case 146:case 154:case 151:case 136:case 155:case 116:case 168:case 171:case 173:case 179:case 180:case 181:case 264:case 265:return-2;case 210:return-2147278848;case 299:return-2147418112;case 206:case 207:return-2147450880;case 216:case 238:case 234:case 355:case 217:case 108:return-2147483648;case 211:case 212:return-2147483648;default:return-2147483648}}var Z_=Nb();function es(e){return e.flags|=16,e}var jb={createBaseSourceFileNode:e=>es(Z_.createBaseSourceFileNode(e)),createBaseIdentifierNode:e=>es(Z_.createBaseIdentifierNode(e)),createBasePrivateIdentifierNode:e=>es(Z_.createBasePrivateIdentifierNode(e)),createBaseTokenNode:e=>es(Z_.createBaseTokenNode(e)),createBaseNode:e=>es(Z_.createBaseNode(e))},x3=kf(4,jb);function Rb(e,t){if(e.original!==t&&(e.original=t,t)){let a=t.emitNode;a&&(e.emitNode=Ub(a,e.emitNode))}return e}function Ub(e,t){let{flags:a,internalFlags:o,leadingComments:m,trailingComments:v,commentRange:A,sourceMapRange:P,tokenSourceMapRanges:l,constantValue:Q,helpers:h,startsOnNewLine:y,snippetElement:g,classThis:x,assignedName:I}=e;if(t||(t={}),a&&(t.flags=a),o&&(t.internalFlags=o&-9),m&&(t.leadingComments=Dn(m.slice(),t.leadingComments)),v&&(t.trailingComments=Dn(v.slice(),t.trailingComments)),A&&(t.commentRange=A),P&&(t.sourceMapRange=P),l&&(t.tokenSourceMapRanges=Bb(l,t.tokenSourceMapRanges)),Q!==void 0&&(t.constantValue=Q),h)for(let re of h)t.helpers=py(t.helpers,re);return y!==void 0&&(t.startsOnNewLine=y),g!==void 0&&(t.snippetElement=g),x&&(t.classThis=x),I&&(t.assignedName=I),t}function Bb(e,t){t||(t=[]);for(let a in e)t[a]=e[a];return t}function ta(e){return e.kind===9}function C1(e){return e.kind===10}function Ya(e){return e.kind===11}function D1(e){return e.kind===15}function qb(e){return e.kind===28}function Hd(e){return e.kind===54}function $d(e){return e.kind===58}function tt(e){return e.kind===80}function gi(e){return e.kind===81}function zb(e){return e.kind===95}function _l(e){return e.kind===134}function Cp(e){return e.kind===108}function Fb(e){return e.kind===102}function P1(e){return e.kind===166}function Ef(e){return e.kind===167}function Af(e){return e.kind===168}function ds(e){return e.kind===169}function Al(e){return e.kind===170}function N1(e){return e.kind===171}function Va(e){return e.kind===172}function I1(e){return e.kind===173}function ms(e){return e.kind===174}function Cf(e){return e.kind===176}function bl(e){return e.kind===177}function hs(e){return e.kind===178}function O1(e){return e.kind===179}function M1(e){return e.kind===180}function Df(e){return e.kind===181}function J1(e){return e.kind===182}function Pf(e){return e.kind===183}function Nf(e){return e.kind===184}function If(e){return e.kind===185}function Vb(e){return e.kind===186}function L1(e){return e.kind===187}function Wb(e){return e.kind===188}function Gb(e){return e.kind===189}function j1(e){return e.kind===202}function Yb(e){return e.kind===190}function Xb(e){return e.kind===191}function R1(e){return e.kind===192}function U1(e){return e.kind===193}function Hb(e){return e.kind===194}function $b(e){return e.kind===195}function B1(e){return e.kind===196}function Qb(e){return e.kind===197}function q1(e){return e.kind===198}function Kb(e){return e.kind===199}function z1(e){return e.kind===200}function Zb(e){return e.kind===201}function e6(e){return e.kind===205}function F1(e){return e.kind===208}function V1(e){return e.kind===209}function Of(e){return e.kind===210}function Xr(e){return e.kind===211}function Xa(e){return e.kind===212}function Mf(e){return e.kind===213}function W1(e){return e.kind===215}function Cl(e){return e.kind===217}function Jf(e){return e.kind===218}function Lf(e){return e.kind===219}function t6(e){return e.kind===222}function G1(e){return e.kind===224}function Zi(e){return e.kind===226}function Y1(e){return e.kind===230}function vl(e){return e.kind===231}function X1(e){return e.kind===232}function H1(e){return e.kind===233}function ll(e){return e.kind===235}function n6(e){return e.kind===236}function r6(e){return e.kind===356}function Ha(e){return e.kind===243}function Dl(e){return e.kind===244}function $1(e){return e.kind===256}function jf(e){return e.kind===260}function Q1(e){return e.kind===261}function Rf(e){return e.kind===262}function Wa(e){return e.kind===263}function vs(e){return e.kind===264}function Pl(e){return e.kind===265}function K1(e){return e.kind===266}function Ti(e){return e.kind===267}function Uf(e){return e.kind===271}function Bf(e){return e.kind===272}function qf(e){return e.kind===277}function zf(e){return e.kind===278}function Z1(e){return e.kind===279}function i6(e){return e.kind===353}function Ff(e){return e.kind===283}function Fp(e){return e.kind===286}function a6(e){return e.kind===289}function eh(e){return e.kind===295}function _6(e){return e.kind===297}function th(e){return e.kind===303}function nh(e){return e.kind===307}function rh(e){return e.kind===309}function ih(e){return e.kind===314}function ah(e){return e.kind===317}function _h(e){return e.kind===320}function s6(e){return e.kind===322}function Nl(e){return e.kind===323}function o6(e){return e.kind===328}function c6(e){return e.kind===333}function l6(e){return e.kind===334}function u6(e){return e.kind===335}function p6(e){return e.kind===336}function f6(e){return e.kind===337}function d6(e){return e.kind===339}function m6(e){return e.kind===331}function Vp(e){return e.kind===341}function h6(e){return e.kind===342}function Vf(e){return e.kind===344}function sh(e){return e.kind===345}function y6(e){return e.kind===329}function g6(e){return e.kind===350}var $i=new WeakMap;function oh(e,t){var a;let o=e.kind;return df(o)?o===352?e._children:(a=$i.get(t))==null?void 0:a.get(e):bt}function b6(e,t,a){e.kind===352&&B.fail("Should not need to re-set the children of a SyntaxList.");let o=$i.get(t);return o===void 0&&(o=new WeakMap,$i.set(t,o)),o.set(e,a),a}function Qd(e,t){var a;e.kind===352&&B.fail("Did not expect to unset the children of a SyntaxList."),(a=$i.get(t))==null||a.delete(e)}function v6(e,t){let a=$i.get(e);a!==void 0&&($i.delete(e),$i.set(t,a))}function Kd(e){return(za(e)&32768)!==0}function T6(e){return Ya(e.expression)&&e.expression.text==="use strict"}function x6(e){for(let t of e)if(cl(t)){if(T6(t))return t}else break}function S6(e){return Cl(e)&&ea(e)&&!!Mg(e)}function ch(e,t=31){switch(e.kind){case 217:return t&-2147483648&&S6(e)?!1:(t&1)!==0;case 216:case 234:case 238:return(t&2)!==0;case 233:return(t&16)!==0;case 235:return(t&4)!==0;case 355:return(t&8)!==0}return!1}function Wf(e,t=31){for(;ch(e,t);)e=e.expression;return e}function w6(e){return setStartsOnNewLine(e,!0)}function as(e){if($g(e))return e.name;if(Yg(e)){switch(e.kind){case 303:return as(e.initializer);case 304:return e.name;case 305:return as(e.expression)}return}return gl(e,!0)?as(e.left):Y1(e)?as(e.expression):e}function k6(e){switch(e.kind){case 206:case 207:case 209:return e.elements;case 210:return e.properties}}function Zd(e){if(e){let t=e;for(;;){if(tt(t)||!t.body)return tt(t)?t:t.name;t=t.body}}}var em;(e=>{function t(h,y,g,x,I,re,he){let ye=y>0?I[y-1]:void 0;return B.assertEqual(g[y],t),I[y]=h.onEnter(x[y],ye,he),g[y]=P(h,t),y}e.enter=t;function a(h,y,g,x,I,re,he){B.assertEqual(g[y],a),B.assertIsDefined(h.onLeft),g[y]=P(h,a);let ye=h.onLeft(x[y].left,I[y],x[y]);return ye?(Q(y,x,ye),l(y,g,x,I,ye)):y}e.left=a;function o(h,y,g,x,I,re,he){return B.assertEqual(g[y],o),B.assertIsDefined(h.onOperator),g[y]=P(h,o),h.onOperator(x[y].operatorToken,I[y],x[y]),y}e.operator=o;function m(h,y,g,x,I,re,he){B.assertEqual(g[y],m),B.assertIsDefined(h.onRight),g[y]=P(h,m);let ye=h.onRight(x[y].right,I[y],x[y]);return ye?(Q(y,x,ye),l(y,g,x,I,ye)):y}e.right=m;function v(h,y,g,x,I,re,he){B.assertEqual(g[y],v),g[y]=P(h,v);let ye=h.onExit(x[y],I[y]);if(y>0){if(y--,h.foldState){let de=g[y]===v?"right":"left";I[y]=h.foldState(I[y],ye,de)}}else re.value=ye;return y}e.exit=v;function A(h,y,g,x,I,re,he){return B.assertEqual(g[y],A),y}e.done=A;function P(h,y){switch(y){case t:if(h.onLeft)return a;case a:if(h.onOperator)return o;case o:if(h.onRight)return m;case m:return v;case v:return A;case A:return A;default:B.fail("Invalid state")}}e.nextState=P;function l(h,y,g,x,I){return h++,y[h]=t,g[h]=I,x[h]=void 0,h}function Q(h,y,g){if(B.shouldAssert(2))for(;h>=0;)B.assert(y[h]!==g,"Circular traversal detected."),h--}})(em||(em={}));function tm(e,t){return typeof e=="object"?Wp(!1,e.prefix,e.node,e.suffix,t):typeof e=="string"?e.length>0&&e.charCodeAt(0)===35?e.slice(1):e:""}function E6(e,t){return typeof e=="string"?e:A6(e,B.checkDefined(t))}function A6(e,t){return a1(e)?t(e).slice(1):Ua(e)?t(e):gi(e)?e.escapedText.slice(1):Pn(e)}function Wp(e,t,a,o,m){return t=tm(t,m),o=tm(o,m),a=E6(a,m),`${e?"#":""}${t}${a}${o}`}function lh(e){if(e.transformFlags&65536)return!0;if(e.transformFlags&128)for(let t of k6(e)){let a=as(t);if(a&&Hg(a)&&(a.transformFlags&65536||a.transformFlags&128&&lh(a)))return!0}return!1}function yn(e,t){return t?yi(e,t.pos,t.end):e}function Il(e){let t=e.kind;return t===168||t===169||t===171||t===172||t===173||t===174||t===176||t===177||t===178||t===181||t===185||t===218||t===219||t===231||t===243||t===262||t===263||t===264||t===265||t===266||t===267||t===271||t===272||t===277||t===278}function Gf(e){let t=e.kind;return t===169||t===172||t===174||t===177||t===178||t===231||t===263}var nm,rm,im,am,_m,C6={createBaseSourceFileNode:e=>new(_m||(_m=At.getSourceFileConstructor()))(e,-1,-1),createBaseIdentifierNode:e=>new(im||(im=At.getIdentifierConstructor()))(e,-1,-1),createBasePrivateIdentifierNode:e=>new(am||(am=At.getPrivateIdentifierConstructor()))(e,-1,-1),createBaseTokenNode:e=>new(rm||(rm=At.getTokenConstructor()))(e,-1,-1),createBaseNode:e=>new(nm||(nm=At.getNodeConstructor()))(e,-1,-1)},S3=kf(1,C6);function k(e,t){return t&&e(t)}function ie(e,t,a){if(a){if(t)return t(a);for(let o of a){let m=e(o);if(m)return m}}}function D6(e,t){return e.charCodeAt(t+1)===42&&e.charCodeAt(t+2)===42&&e.charCodeAt(t+3)!==47}function P6(e){return Un(e.statements,N6)||I6(e)}function N6(e){return Il(e)&&O6(e,95)||Uf(e)&&Ff(e.moduleReference)||Bf(e)||qf(e)||zf(e)?e:void 0}function I6(e){return e.flags&8388608?uh(e):void 0}function uh(e){return M6(e)?e:Ht(e,uh)}function O6(e,t){return Xt(e.modifiers,a=>a.kind===t)}function M6(e){return n6(e)&&e.keywordToken===102&&e.name.escapedText==="meta"}var J6={166:function(t,a,o){return k(a,t.left)||k(a,t.right)},168:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.constraint)||k(a,t.default)||k(a,t.expression)},304:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||k(a,t.exclamationToken)||k(a,t.equalsToken)||k(a,t.objectAssignmentInitializer)},305:function(t,a,o){return k(a,t.expression)},169:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.dotDotDotToken)||k(a,t.name)||k(a,t.questionToken)||k(a,t.type)||k(a,t.initializer)},172:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||k(a,t.exclamationToken)||k(a,t.type)||k(a,t.initializer)},171:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||k(a,t.type)||k(a,t.initializer)},303:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||k(a,t.exclamationToken)||k(a,t.initializer)},260:function(t,a,o){return k(a,t.name)||k(a,t.exclamationToken)||k(a,t.type)||k(a,t.initializer)},208:function(t,a,o){return k(a,t.dotDotDotToken)||k(a,t.propertyName)||k(a,t.name)||k(a,t.initializer)},181:function(t,a,o){return ie(a,o,t.modifiers)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)},185:function(t,a,o){return ie(a,o,t.modifiers)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)},184:function(t,a,o){return ie(a,o,t.modifiers)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)},179:sm,180:sm,174:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.asteriskToken)||k(a,t.name)||k(a,t.questionToken)||k(a,t.exclamationToken)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},173:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)},176:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},177:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},178:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},262:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.asteriskToken)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},218:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.asteriskToken)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},219:function(t,a,o){return ie(a,o,t.modifiers)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.equalsGreaterThanToken)||k(a,t.body)},175:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.body)},183:function(t,a,o){return k(a,t.typeName)||ie(a,o,t.typeArguments)},182:function(t,a,o){return k(a,t.assertsModifier)||k(a,t.parameterName)||k(a,t.type)},186:function(t,a,o){return k(a,t.exprName)||ie(a,o,t.typeArguments)},187:function(t,a,o){return ie(a,o,t.members)},188:function(t,a,o){return k(a,t.elementType)},189:function(t,a,o){return ie(a,o,t.elements)},192:om,193:om,194:function(t,a,o){return k(a,t.checkType)||k(a,t.extendsType)||k(a,t.trueType)||k(a,t.falseType)},195:function(t,a,o){return k(a,t.typeParameter)},205:function(t,a,o){return k(a,t.argument)||k(a,t.attributes)||k(a,t.qualifier)||ie(a,o,t.typeArguments)},302:function(t,a,o){return k(a,t.assertClause)},196:cm,198:cm,199:function(t,a,o){return k(a,t.objectType)||k(a,t.indexType)},200:function(t,a,o){return k(a,t.readonlyToken)||k(a,t.typeParameter)||k(a,t.nameType)||k(a,t.questionToken)||k(a,t.type)||ie(a,o,t.members)},201:function(t,a,o){return k(a,t.literal)},202:function(t,a,o){return k(a,t.dotDotDotToken)||k(a,t.name)||k(a,t.questionToken)||k(a,t.type)},206:lm,207:lm,209:function(t,a,o){return ie(a,o,t.elements)},210:function(t,a,o){return ie(a,o,t.properties)},211:function(t,a,o){return k(a,t.expression)||k(a,t.questionDotToken)||k(a,t.name)},212:function(t,a,o){return k(a,t.expression)||k(a,t.questionDotToken)||k(a,t.argumentExpression)},213:um,214:um,215:function(t,a,o){return k(a,t.tag)||k(a,t.questionDotToken)||ie(a,o,t.typeArguments)||k(a,t.template)},216:function(t,a,o){return k(a,t.type)||k(a,t.expression)},217:function(t,a,o){return k(a,t.expression)},220:function(t,a,o){return k(a,t.expression)},221:function(t,a,o){return k(a,t.expression)},222:function(t,a,o){return k(a,t.expression)},224:function(t,a,o){return k(a,t.operand)},229:function(t,a,o){return k(a,t.asteriskToken)||k(a,t.expression)},223:function(t,a,o){return k(a,t.expression)},225:function(t,a,o){return k(a,t.operand)},226:function(t,a,o){return k(a,t.left)||k(a,t.operatorToken)||k(a,t.right)},234:function(t,a,o){return k(a,t.expression)||k(a,t.type)},235:function(t,a,o){return k(a,t.expression)},238:function(t,a,o){return k(a,t.expression)||k(a,t.type)},236:function(t,a,o){return k(a,t.name)},227:function(t,a,o){return k(a,t.condition)||k(a,t.questionToken)||k(a,t.whenTrue)||k(a,t.colonToken)||k(a,t.whenFalse)},230:function(t,a,o){return k(a,t.expression)},241:pm,268:pm,307:function(t,a,o){return ie(a,o,t.statements)||k(a,t.endOfFileToken)},243:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.declarationList)},261:function(t,a,o){return ie(a,o,t.declarations)},244:function(t,a,o){return k(a,t.expression)},245:function(t,a,o){return k(a,t.expression)||k(a,t.thenStatement)||k(a,t.elseStatement)},246:function(t,a,o){return k(a,t.statement)||k(a,t.expression)},247:function(t,a,o){return k(a,t.expression)||k(a,t.statement)},248:function(t,a,o){return k(a,t.initializer)||k(a,t.condition)||k(a,t.incrementor)||k(a,t.statement)},249:function(t,a,o){return k(a,t.initializer)||k(a,t.expression)||k(a,t.statement)},250:function(t,a,o){return k(a,t.awaitModifier)||k(a,t.initializer)||k(a,t.expression)||k(a,t.statement)},251:fm,252:fm,253:function(t,a,o){return k(a,t.expression)},254:function(t,a,o){return k(a,t.expression)||k(a,t.statement)},255:function(t,a,o){return k(a,t.expression)||k(a,t.caseBlock)},269:function(t,a,o){return ie(a,o,t.clauses)},296:function(t,a,o){return k(a,t.expression)||ie(a,o,t.statements)},297:function(t,a,o){return ie(a,o,t.statements)},256:function(t,a,o){return k(a,t.label)||k(a,t.statement)},257:function(t,a,o){return k(a,t.expression)},258:function(t,a,o){return k(a,t.tryBlock)||k(a,t.catchClause)||k(a,t.finallyBlock)},299:function(t,a,o){return k(a,t.variableDeclaration)||k(a,t.block)},170:function(t,a,o){return k(a,t.expression)},263:dm,231:dm,264:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.heritageClauses)||ie(a,o,t.members)},265:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||k(a,t.type)},266:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.members)},306:function(t,a,o){return k(a,t.name)||k(a,t.initializer)},267:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.body)},271:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.moduleReference)},272:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.importClause)||k(a,t.moduleSpecifier)||k(a,t.attributes)},273:function(t,a,o){return k(a,t.name)||k(a,t.namedBindings)},300:function(t,a,o){return ie(a,o,t.elements)},301:function(t,a,o){return k(a,t.name)||k(a,t.value)},270:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)},274:function(t,a,o){return k(a,t.name)},280:function(t,a,o){return k(a,t.name)},275:mm,279:mm,278:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.exportClause)||k(a,t.moduleSpecifier)||k(a,t.attributes)},276:hm,281:hm,277:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.expression)},228:function(t,a,o){return k(a,t.head)||ie(a,o,t.templateSpans)},239:function(t,a,o){return k(a,t.expression)||k(a,t.literal)},203:function(t,a,o){return k(a,t.head)||ie(a,o,t.templateSpans)},204:function(t,a,o){return k(a,t.type)||k(a,t.literal)},167:function(t,a,o){return k(a,t.expression)},298:function(t,a,o){return ie(a,o,t.types)},233:function(t,a,o){return k(a,t.expression)||ie(a,o,t.typeArguments)},283:function(t,a,o){return k(a,t.expression)},282:function(t,a,o){return ie(a,o,t.modifiers)},356:function(t,a,o){return ie(a,o,t.elements)},284:function(t,a,o){return k(a,t.openingElement)||ie(a,o,t.children)||k(a,t.closingElement)},288:function(t,a,o){return k(a,t.openingFragment)||ie(a,o,t.children)||k(a,t.closingFragment)},285:ym,286:ym,292:function(t,a,o){return ie(a,o,t.properties)},291:function(t,a,o){return k(a,t.name)||k(a,t.initializer)},293:function(t,a,o){return k(a,t.expression)},294:function(t,a,o){return k(a,t.dotDotDotToken)||k(a,t.expression)},287:function(t,a,o){return k(a,t.tagName)},295:function(t,a,o){return k(a,t.namespace)||k(a,t.name)},190:Fi,191:Fi,309:Fi,315:Fi,314:Fi,316:Fi,318:Fi,317:function(t,a,o){return ie(a,o,t.parameters)||k(a,t.type)},320:function(t,a,o){return(typeof t.comment=="string"?void 0:ie(a,o,t.comment))||ie(a,o,t.tags)},347:function(t,a,o){return k(a,t.tagName)||k(a,t.name)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},310:function(t,a,o){return k(a,t.name)},311:function(t,a,o){return k(a,t.left)||k(a,t.right)},341:gm,348:gm,330:function(t,a,o){return k(a,t.tagName)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},329:function(t,a,o){return k(a,t.tagName)||k(a,t.class)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},328:function(t,a,o){return k(a,t.tagName)||k(a,t.class)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},345:function(t,a,o){return k(a,t.tagName)||k(a,t.constraint)||ie(a,o,t.typeParameters)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},346:function(t,a,o){return k(a,t.tagName)||(t.typeExpression&&t.typeExpression.kind===309?k(a,t.typeExpression)||k(a,t.fullName)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment)):k(a,t.fullName)||k(a,t.typeExpression)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment)))},338:function(t,a,o){return k(a,t.tagName)||k(a,t.fullName)||k(a,t.typeExpression)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},342:Vi,344:Vi,343:Vi,340:Vi,350:Vi,349:Vi,339:Vi,323:function(t,a,o){return Un(t.typeParameters,a)||Un(t.parameters,a)||k(a,t.type)},324:Dp,325:Dp,326:Dp,322:function(t,a,o){return Un(t.jsDocPropertyTags,a)},327:ui,332:ui,333:ui,334:ui,335:ui,336:ui,331:ui,337:ui,351:L6,355:j6};function sm(e,t,a){return ie(t,a,e.typeParameters)||ie(t,a,e.parameters)||k(t,e.type)}function om(e,t,a){return ie(t,a,e.types)}function cm(e,t,a){return k(t,e.type)}function lm(e,t,a){return ie(t,a,e.elements)}function um(e,t,a){return k(t,e.expression)||k(t,e.questionDotToken)||ie(t,a,e.typeArguments)||ie(t,a,e.arguments)}function pm(e,t,a){return ie(t,a,e.statements)}function fm(e,t,a){return k(t,e.label)}function dm(e,t,a){return ie(t,a,e.modifiers)||k(t,e.name)||ie(t,a,e.typeParameters)||ie(t,a,e.heritageClauses)||ie(t,a,e.members)}function mm(e,t,a){return ie(t,a,e.elements)}function hm(e,t,a){return k(t,e.propertyName)||k(t,e.name)}function ym(e,t,a){return k(t,e.tagName)||ie(t,a,e.typeArguments)||k(t,e.attributes)}function Fi(e,t,a){return k(t,e.type)}function gm(e,t,a){return k(t,e.tagName)||(e.isNameFirst?k(t,e.name)||k(t,e.typeExpression):k(t,e.typeExpression)||k(t,e.name))||(typeof e.comment=="string"?void 0:ie(t,a,e.comment))}function Vi(e,t,a){return k(t,e.tagName)||k(t,e.typeExpression)||(typeof e.comment=="string"?void 0:ie(t,a,e.comment))}function Dp(e,t,a){return k(t,e.name)}function ui(e,t,a){return k(t,e.tagName)||(typeof e.comment=="string"?void 0:ie(t,a,e.comment))}function L6(e,t,a){return k(t,e.tagName)||k(t,e.importClause)||k(t,e.moduleSpecifier)||k(t,e.attributes)||(typeof e.comment=="string"?void 0:ie(t,a,e.comment))}function j6(e,t,a){return k(t,e.expression)}function Ht(e,t,a){if(e===void 0||e.kind<=165)return;let o=J6[e.kind];return o===void 0?void 0:o(e,t,a)}function bm(e,t,a){let o=vm(e),m=[];for(;m.length=0;--P)o.push(v[P]),m.push(A)}else{let P=t(v,A);if(P){if(P==="skip")continue;return P}if(v.kind>=166)for(let l of vm(v))o.push(l),m.push(v)}}}function vm(e){let t=[];return Ht(e,a,a),t;function a(o){t.unshift(o)}}function ph(e){e.externalModuleIndicator=P6(e)}function fh(e,t,a,o=!1,m){var v,A;(v=sl)==null||v.push(sl.Phase.Parse,"createSourceFile",{path:e},!0),wd("beforeParse");let P,{languageVersion:l,setExternalModuleIndicator:Q,impliedNodeFormat:h,jsDocParsingMode:y}=typeof a=="object"?a:{languageVersion:a};if(l===100)P=Qi.parseSourceFile(e,t,l,void 0,o,6,Fa,y);else{let g=h===void 0?Q:x=>(x.impliedNodeFormat=h,(Q||ph)(x));P=Qi.parseSourceFile(e,t,l,void 0,o,m,g,y)}return wd("afterParse"),Oy("Parse","beforeParse","afterParse"),(A=sl)==null||A.pop(),P}function dh(e){return e.externalModuleIndicator!==void 0}function R6(e,t,a,o=!1){let m=Tl.updateSourceFile(e,t,a,o);return m.flags|=e.flags&12582912,m}var Qi;(e=>{var t=of(99,!0),a=40960,o,m,v,A,P;function l(s){return ar++,s}var Q={createBaseSourceFileNode:s=>l(new P(s,0,0)),createBaseIdentifierNode:s=>l(new v(s,0,0)),createBasePrivateIdentifierNode:s=>l(new A(s,0,0)),createBaseTokenNode:s=>l(new m(s,0,0)),createBaseNode:s=>l(new o(s,0,0))},h=kf(11,Q),{createNodeArray:y,createNumericLiteral:g,createStringLiteral:x,createLiteralLikeNode:I,createIdentifier:re,createPrivateIdentifier:he,createToken:ye,createArrayLiteralExpression:de,createObjectLiteralExpression:M,createPropertyAccessExpression:ae,createPropertyAccessChain:Oe,createElementAccessExpression:V,createElementAccessChain:oe,createCallExpression:W,createCallChain:dt,createNewExpression:nr,createParenthesizedExpression:gn,createBlock:rr,createVariableStatement:bn,createExpressionStatement:In,createIfStatement:Ge,createWhileStatement:ir,createForStatement:Pr,createForOfStatement:Ot,createVariableDeclaration:Bn,createVariableDeclarationList:On}=h,Mt,vt,Qe,qn,$t,ct,_t,Ut,Jt,lt,ar,mt,vn,yt,cn,nt,Bt=!0,rn=!1;function _r(s,p,d,b,S=!1,N,H,_e=0){var Z;if(N=gb(s,N),N===6){let ce=dr(s,p,d,b,S);return convertToJson(ce,(Z=ce.statements[0])==null?void 0:Z.expression,ce.parseDiagnostics,!1,void 0),ce.referencedFiles=bt,ce.typeReferenceDirectives=bt,ce.libReferenceDirectives=bt,ce.amdDependencies=bt,ce.hasNoDefaultLib=!1,ce.pragmas=ay,ce}zn(s,p,d,b,N,_e);let ee=Nr(d,S,N,H||ph,_e);return Fn(),ee}e.parseSourceFile=_r;function fr(s,p){zn("",s,p,void 0,1,0),U();let d=jr(!0),b=u()===1&&!_t.length;return Fn(),b?d:void 0}e.parseIsolatedEntityName=fr;function dr(s,p,d=2,b,S=!1){zn(s,p,d,b,6,0),vt=nt,U();let N=J(),H,_e;if(u()===1)H=Ct([],N,N),_e=Wt();else{let ce;for(;u()!==1;){let Ae;switch(u()){case 23:Ae=ac();break;case 112:case 97:case 106:Ae=Wt();break;case 41:G(()=>U()===9&&U()!==59)?Ae=Fo():Ae=I_();break;case 9:case 11:if(G(()=>U()!==59)){Ae=Xn();break}default:Ae=I_();break}ce&&Yr(ce)?ce.push(Ae):ce?ce=[ce,Ae]:(ce=Ae,u()!==1&&Ee(E.Unexpected_token))}let Le=Yr(ce)?D(de(ce),N):B.checkDefined(ce),je=In(Le);D(je,N),H=Ct([je],N),_e=Yn(1,E.Unexpected_token)}let Z=se(s,2,6,!1,H,_e,vt,Fa);S&&L(Z),Z.nodeCount=ar,Z.identifierCount=vn,Z.identifiers=mt,Z.parseDiagnostics=zi(_t,Z),Ut&&(Z.jsDocDiagnostics=zi(Ut,Z));let ee=Z;return Fn(),ee}e.parseJsonText=dr;function zn(s,p,d,b,S,N){switch(o=At.getNodeConstructor(),m=At.getTokenConstructor(),v=At.getIdentifierConstructor(),A=At.getPrivateIdentifierConstructor(),P=At.getSourceFileConstructor(),Mt=Gy(s),Qe=p,qn=d,Jt=b,$t=S,ct=Vd(S),_t=[],yt=0,mt=new Map,vn=0,ar=0,vt=0,Bt=!0,$t){case 1:case 2:nt=524288;break;case 6:nt=134742016;break;default:nt=0;break}rn=!1,t.setText(Qe),t.setOnError(Zr),t.setScriptTarget(qn),t.setLanguageVariant(ct),t.setScriptKind($t),t.setJSDocParsingMode(N)}function Fn(){t.clearCommentDirectives(),t.setText(""),t.setOnError(void 0),t.setScriptKind(0),t.setJSDocParsingMode(0),Qe=void 0,qn=void 0,Jt=void 0,$t=void 0,ct=void 0,vt=0,_t=void 0,Ut=void 0,yt=0,mt=void 0,cn=void 0,Bt=!0}function Nr(s,p,d,b,S){let N=q6(Mt);N&&(nt|=33554432),vt=nt,U();let H=xn(0,Kt);B.assert(u()===1);let _e=qe(),Z=Ce(Wt(),_e),ee=se(Mt,s,d,N,H,Z,vt,b);return V6(ee,Qe),W6(ee,ce),ee.commentDirectives=t.getCommentDirectives(),ee.nodeCount=ar,ee.identifierCount=vn,ee.identifiers=mt,ee.parseDiagnostics=zi(_t,ee),ee.jsDocParsingMode=S,Ut&&(ee.jsDocDiagnostics=zi(Ut,ee)),p&&L(ee),ee;function ce(Le,je,Ae){_t.push(Oa(Mt,Qe,Le,je,Ae))}}let Vn=!1;function Ce(s,p){if(!p)return s;B.assert(!s.jsDoc);let d=cy(d2(s,Qe),b=>Hc.parseJSDocComment(s,b.pos,b.end-b.pos));return d.length&&(s.jsDoc=d),Vn&&(Vn=!1,s.flags|=536870912),s}function mr(s){let p=Jt,d=Tl.createSyntaxCursor(s);Jt={currentNode:ce};let b=[],S=_t;_t=[];let N=0,H=Z(s.statements,0);for(;H!==-1;){let Le=s.statements[N],je=s.statements[H];Dn(b,s.statements,N,H),N=ee(s.statements,H);let Ae=bp(S,mn=>mn.start>=Le.pos),Yt=Ae>=0?bp(S,mn=>mn.start>=je.pos,Ae):-1;Ae>=0&&Dn(_t,S,Ae,Yt>=0?Yt:void 0),un(()=>{let mn=nt;for(nt|=65536,t.resetTokenState(je.pos),U();u()!==1;){let Zt=t.getTokenFullStart(),ur=n_(0,Kt);if(b.push(ur),Zt===t.getTokenFullStart()&&U(),N>=0){let Ln=s.statements[N];if(ur.end===Ln.pos)break;ur.end>Ln.pos&&(N=ee(s.statements,N+1))}}nt=mn},2),H=N>=0?Z(s.statements,N):-1}if(N>=0){let Le=s.statements[N];Dn(b,s.statements,N);let je=bp(S,Ae=>Ae.start>=Le.pos);je>=0&&Dn(_t,S,je)}return Jt=p,h.updateSourceFile(s,yn(y(b),s.statements));function _e(Le){return!(Le.flags&65536)&&!!(Le.transformFlags&67108864)}function Z(Le,je){for(let Ae=je;Ae118}function ve(){return u()===80?!0:u()===127&&we()||u()===135&&Ye()?!1:u()>118}function j(s,p,d=!0){return u()===s?(d&&U(),!0):(p?Ee(p):Ee(E._0_expected,it(s)),!1)}let ht=Object.keys(rf).filter(s=>s.length>2);function xt(s){if(W1(s)){rt(Ar(Qe,s.template.pos),s.template.end,E.Module_declaration_names_may_only_use_or_quoted_strings);return}let p=tt(s)?Pn(s):void 0;if(!p||!pg(p,qn)){Ee(E._0_expected,it(27));return}let d=Ar(Qe,s.pos);switch(p){case"const":case"let":case"var":rt(d,s.end,E.Variable_declaration_not_allowed_at_this_location);return;case"declare":return;case"interface":Lt(E.Interface_name_cannot_be_0,E.Interface_must_be_given_a_name,19);return;case"is":rt(d,t.getTokenStart(),E.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);return;case"module":case"namespace":Lt(E.Namespace_name_cannot_be_0,E.Namespace_must_be_given_a_name,19);return;case"type":Lt(E.Type_alias_name_cannot_be_0,E.Type_alias_must_be_given_a_name,64);return}let b=ns(p,ht,gt)??pn(p);if(b){rt(d,s.end,E.Unknown_keyword_or_identifier_Did_you_mean_0,b);return}u()!==0&&rt(d,s.end,E.Unexpected_keyword_or_identifier)}function Lt(s,p,d){u()===d?Ee(p):Ee(s,t.getTokenValue())}function pn(s){for(let p of ht)if(s.length>p.length+2&&pl(s,p))return`${p} ${s.slice(p.length)}`}function Bl(s,p,d){if(u()===60&&!t.hasPrecedingLineBreak()){Ee(E.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);return}if(u()===21){Ee(E.Cannot_start_a_function_call_in_a_type_annotation),U();return}if(p&&!sr()){d?Ee(E._0_expected,it(27)):Ee(E.Expected_for_property_initializer);return}if(!aa()){if(d){Ee(E._0_expected,it(27));return}xt(s)}}function Es(s){return u()===s?(ze(),!0):(B.assert(Sp(s)),Ee(E._0_expected,it(s)),!1)}function Or(s,p,d,b){if(u()===p){U();return}let S=Ee(E._0_expected,it(p));d&&S&&rl(S,Oa(Mt,Qe,b,1,E.The_parser_expected_to_find_a_1_to_match_the_0_token_here,it(s),it(p)))}function Je(s){return u()===s?(U(),!0):!1}function ft(s){if(u()===s)return Wt()}function ql(s){if(u()===s)return Fl()}function Yn(s,p,d){return ft(s)||Gt(s,!1,p||E._0_expected,d||it(s))}function zl(s){let p=ql(s);return p||(B.assert(Sp(s)),Gt(s,!1,E._0_expected,it(s)))}function Wt(){let s=J(),p=u();return U(),D(ye(p),s)}function Fl(){let s=J(),p=u();return ze(),D(ye(p),s)}function sr(){return u()===27?!0:u()===20||u()===1||t.hasPrecedingLineBreak()}function aa(){return sr()?(u()===27&&U(),!0):!1}function Qt(){return aa()||j(27)}function Ct(s,p,d,b){let S=y(s,b);return yi(S,p,d??t.getTokenFullStart()),S}function D(s,p,d){return yi(s,p,d??t.getTokenFullStart()),nt&&(s.flags|=nt),rn&&(rn=!1,s.flags|=262144),s}function Gt(s,p,d,...b){p?Tn(t.getTokenFullStart(),0,d,...b):d&&Ee(d,...b);let S=J(),N=s===80?re("",void 0):Jd(s)?h.createTemplateLiteralLikeNode(s,"","",void 0):s===9?g("",void 0):s===11?x("",void 0):s===282?h.createMissingDeclaration():ye(s);return D(N,S)}function Mr(s){let p=mt.get(s);return p===void 0&&mt.set(s,p=s),p}function or(s,p,d){if(s){vn++;let _e=t.hasPrecedingJSDocLeadingAsterisks()?t.getTokenStart():J(),Z=u(),ee=Mr(t.getTokenValue()),ce=t.hasExtendedUnicodeEscape();return Ne(),D(re(ee,Z,ce),_e)}if(u()===81)return Ee(d||E.Private_identifiers_are_not_allowed_outside_class_bodies),or(!0);if(u()===0&&t.tryScan(()=>t.reScanInvalidIdentifier()===80))return or(!0);vn++;let b=u()===1,S=t.isReservedWord(),N=t.getTokenText(),H=S?E.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:E.Identifier_expected;return Gt(80,b,p||H,N)}function Ka(s){return or(Fe(),void 0,s)}function St(s,p){return or(ve(),s,p)}function jt(s){return or(wt(u()),s)}function ei(){return(t.hasUnicodeEscape()||t.hasExtendedUnicodeEscape())&&Ee(E.Unicode_escape_sequence_cannot_appear_here),or(wt(u()))}function yr(){return wt(u())||u()===11||u()===9||u()===10}function As(){return wt(u())||u()===11}function Vl(s){if(u()===11||u()===9||u()===10){let p=Xn();return p.text=Mr(p.text),p}return s&&u()===23?Wl():u()===81?_a():jt()}function Jr(){return Vl(!0)}function Wl(){let s=J();j(23);let p=ut(Et);return j(24),D(h.createComputedPropertyName(p),s)}function _a(){let s=J(),p=he(Mr(t.getTokenValue()));return U(),D(p,s)}function ti(s){return u()===s&&le(Cs)}function Za(){return U(),t.hasPrecedingLineBreak()?!1:cr()}function Cs(){switch(u()){case 87:return U()===94;case 95:return U(),u()===90?G(Ei):u()===156?G(Gl):ki();case 90:return Ei();case 126:return U(),cr();case 139:case 153:return U(),Yl();default:return Za()}}function ki(){return u()===60||u()!==42&&u()!==130&&u()!==19&&cr()}function Gl(){return U(),ki()}function Ds(){return Wr(u())&&le(Cs)}function cr(){return u()===23||u()===19||u()===42||u()===26||yr()}function Yl(){return u()===23||yr()}function Ei(){return U(),u()===86||u()===100||u()===120||u()===60||u()===128&&G(gc)||u()===134&&G(bc)}function sa(s,p){if(ca(s))return!0;switch(s){case 0:case 1:case 3:return!(u()===27&&p)&&vc();case 2:return u()===84||u()===90;case 4:return G(ao);case 5:return G(Wu)||u()===27&&!p;case 6:return u()===23||yr();case 12:switch(u()){case 23:case 42:case 26:case 25:return!0;default:return yr()}case 18:return yr();case 9:return u()===23||u()===26||yr();case 24:return As();case 7:return u()===19?G(Ps):p?ve()&&!e_():x_()&&!e_();case 8:return ka();case 10:return u()===28||u()===26||ka();case 19:return u()===103||u()===87||ve();case 15:switch(u()){case 28:case 25:return!0}case 11:return u()===26||br();case 16:return fa(!1);case 17:return fa(!0);case 20:case 21:return u()===28||ai();case 22:return Rc();case 23:return u()===161&&G(Uu)?!1:u()===11?!0:wt(u());case 13:return wt(u())||u()===19;case 14:return!0;case 25:return!0;case 26:return B.fail("ParsingContext.Count used as a context");default:B.assertNever(s,"Non-exhaustive case in 'isListElement'.")}}function Ps(){if(B.assert(u()===19),U()===20){let s=U();return s===28||s===19||s===96||s===119}return!0}function Ai(){return U(),ve()}function Xl(){return U(),wt(u())}function Ns(){return U(),Yy(u())}function e_(){return u()===119||u()===96?G(Is):!1}function Is(){return U(),br()}function Ci(){return U(),ai()}function oa(s){if(u()===1)return!0;switch(s){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return u()===20;case 3:return u()===20||u()===84||u()===90;case 7:return u()===19||u()===96||u()===119;case 8:return t_();case 19:return u()===32||u()===21||u()===19||u()===96||u()===119;case 11:return u()===22||u()===27;case 15:case 21:case 10:return u()===24;case 17:case 16:case 18:return u()===22||u()===24;case 20:return u()!==28;case 22:return u()===19||u()===20;case 13:return u()===32||u()===44;case 14:return u()===30&&G(G_);default:return!1}}function t_(){return!!(sr()||Uo(u())||u()===39)}function Os(){B.assert(yt,"Missing parsing context");for(let s=0;s<26;s++)if(yt&1<=0)}function __(s){return s===6?E.An_enum_member_name_must_be_followed_by_a_or:void 0}function lr(){let s=Ct([],J());return s.isMissingList=!0,s}function zs(s){return!!s.isMissingList}function Lr(s,p,d,b){if(j(d)){let S=fn(s,p);return j(b),S}return lr()}function jr(s,p){let d=J(),b=s?jt(p):St(p);for(;Je(25)&&u()!==30;)b=D(h.createQualifiedName(b,ni(s,!1,!0)),d);return b}function Hl(s,p){return D(h.createQualifiedName(s,p),s.pos)}function ni(s,p,d){if(t.hasPrecedingLineBreak()&&wt(u())&&G(M_))return Gt(80,!0,E.Identifier_expected);if(u()===81){let b=_a();return p?b:Gt(80,!0,E.Identifier_expected)}return s?d?jt():ei():St()}function $l(s){let p=J(),d=[],b;do b=Gs(s),d.push(b);while(b.literal.kind===17);return Ct(d,p)}function ua(s){let p=J();return D(h.createTemplateExpression(Di(s),$l(s)),p)}function Fs(){let s=J();return D(h.createTemplateLiteralType(Di(!1),Ql()),s)}function Ql(){let s=J(),p=[],d;do d=Vs(),p.push(d);while(d.literal.kind===17);return Ct(p,s)}function Vs(){let s=J();return D(h.createTemplateLiteralTypeSpan(ot(),Ws(!1)),s)}function Ws(s){return u()===20?(Pt(s),Ys()):Yn(18,E._0_expected,it(20))}function Gs(s){let p=J();return D(h.createTemplateSpan(ut(Et),Ws(s)),p)}function Xn(){return ri(u())}function Di(s){!s&&t.getTokenFlags()&26656&&Pt(!1);let p=ri(u());return B.assert(p.kind===16,"Template head has wrong token kind"),p}function Ys(){let s=ri(u());return B.assert(s.kind===17||s.kind===18,"Template fragment has wrong token kind"),s}function Kl(s){let p=s===15||s===18,d=t.getTokenText();return d.substring(1,d.length-(t.isUnterminated()?0:p?1:2))}function ri(s){let p=J(),d=Jd(s)?h.createTemplateLiteralLikeNode(s,t.getTokenValue(),Kl(s),t.getTokenFlags()&7176):s===9?g(t.getTokenValue(),t.getNumericLiteralFlags()):s===11?x(t.getTokenValue(),void 0,t.hasExtendedUnicodeEscape()):Ug(s)?I(s,t.getTokenValue()):B.fail();return t.hasExtendedUnicodeEscape()&&(d.hasExtendedUnicodeEscape=!0),t.isUnterminated()&&(d.isUnterminated=!0),U(),D(d,p)}function ii(){return jr(!0,E.Type_expected)}function Xs(){if(!t.hasPrecedingLineBreak()&&kt()===30)return Lr(20,ot,30,32)}function pa(){let s=J();return D(h.createTypeReferenceNode(ii(),Xs()),s)}function s_(s){switch(s.kind){case 183:return Hi(s.typeName);case 184:case 185:{let{parameters:p,type:d}=s;return zs(p)||s_(d)}case 196:return s_(s.type);default:return!1}}function Zl(s){return U(),D(h.createTypePredicateNode(void 0,s,ot()),s.pos)}function o_(){let s=J();return U(),D(h.createThisTypeNode(),s)}function eu(){let s=J();return U(),D(h.createJSDocAllType(),s)}function Hs(){let s=J();return U(),D(h.createJSDocNonNullableType(b_(),!1),s)}function tu(){let s=J();return U(),u()===28||u()===20||u()===22||u()===32||u()===64||u()===52?D(h.createJSDocUnknownType(),s):D(h.createJSDocNullableType(ot(),!1),s)}function $s(){let s=J(),p=qe();if(le(Fc)){let d=Hn(36),b=Jn(59,!1);return Ce(D(h.createJSDocFunctionType(d,b),s),p)}return D(h.createTypeReferenceNode(jt(),void 0),s)}function c_(){let s=J(),p;return(u()===110||u()===105)&&(p=jt(),j(59)),D(h.createParameterDeclaration(void 0,void 0,p,void 0,l_(),void 0),s)}function l_(){t.setSkipJsDocLeadingAsterisks(!0);let s=J();if(Je(144)){let b=h.createJSDocNamepathType(void 0);e:for(;;)switch(u()){case 20:case 1:case 28:case 5:break e;default:ze()}return t.setSkipJsDocLeadingAsterisks(!1),D(b,s)}let p=Je(26),d=ha();return t.setSkipJsDocLeadingAsterisks(!1),p&&(d=D(h.createJSDocVariadicType(d),s)),u()===64?(U(),D(h.createJSDocOptionalType(d),s)):d}function Qs(){let s=J();j(114);let p=jr(!0),d=t.hasPrecedingLineBreak()?void 0:Ca();return D(h.createTypeQueryNode(p,d),s)}function Ks(){let s=J(),p=wn(!1,!0),d=St(),b,S;Je(96)&&(ai()||!br()?b=ot():S=Yo());let N=Je(64)?ot():void 0,H=h.createTypeParameterDeclaration(p,d,b,N);return H.expression=S,D(H,s)}function dn(){if(u()===30)return Lr(19,Ks,30,32)}function fa(s){return u()===26||ka()||Wr(u())||u()===60||ai(!s)}function Zs(s){let p=Li(E.Private_identifiers_cannot_be_used_as_parameters);return c2(p)===0&&!Xt(s)&&Wr(u())&&U(),p}function eo(){return Fe()||u()===23||u()===19}function u_(s){return p_(s)}function to(s){return p_(s,!1)}function p_(s,p=!0){let d=J(),b=qe(),S=s?R(()=>wn(!0)):$(()=>wn(!0));if(u()===110){let Z=h.createParameterDeclaration(S,void 0,or(!0),void 0,gr(),void 0),ee=Hp(S);return ee&&ln(ee,E.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters),Ce(D(Z,d),b)}let N=Bt;Bt=!1;let H=ft(26);if(!p&&!eo())return;let _e=Ce(D(h.createParameterDeclaration(S,H,Zs(S),ft(58),gr(),vr()),d),b);return Bt=N,_e}function Jn(s,p){if(no(s,p))return hr(ha)}function no(s,p){return s===39?(j(s),!0):Je(59)?!0:p&&u()===39?(Ee(E._0_expected,it(59)),U(),!0):!1}function f_(s,p){let d=we(),b=Ye();He(!!(s&1)),st(!!(s&2));let S=s&32?fn(17,c_):fn(16,()=>p?u_(b):to(b));return He(d),st(b),S}function Hn(s){if(!j(21))return lr();let p=f_(s,!0);return j(22),p}function da(){Je(28)||Qt()}function ro(s){let p=J(),d=qe();s===180&&j(105);let b=dn(),S=Hn(4),N=Jn(59,!0);da();let H=s===179?h.createCallSignature(b,S,N):h.createConstructSignature(b,S,N);return Ce(D(H,p),d)}function Rr(){return u()===23&&G(nu)}function nu(){if(U(),u()===26||u()===24)return!0;if(Wr(u())){if(U(),ve())return!0}else if(ve())U();else return!1;return u()===59||u()===28?!0:u()!==58?!1:(U(),u()===59||u()===28||u()===24)}function d_(s,p,d){let b=Lr(16,()=>u_(!1),23,24),S=gr();da();let N=h.createIndexSignature(d,b,S);return Ce(D(N,s),p)}function io(s,p,d){let b=Jr(),S=ft(58),N;if(u()===21||u()===30){let H=dn(),_e=Hn(4),Z=Jn(59,!0);N=h.createMethodSignature(d,b,S,H,_e,Z)}else{let H=gr();N=h.createPropertySignature(d,b,S,H),u()===64&&(N.initializer=vr())}return da(),Ce(D(N,s),p)}function ao(){if(u()===21||u()===30||u()===139||u()===153)return!0;let s=!1;for(;Wr(u());)s=!0,U();return u()===23?!0:(yr()&&(s=!0,U()),s?u()===21||u()===30||u()===58||u()===59||u()===28||sr():!1)}function Pi(){if(u()===21||u()===30)return ro(179);if(u()===105&&G(_o))return ro(180);let s=J(),p=qe(),d=wn(!1);return ti(139)?qr(s,p,d,177,4):ti(153)?qr(s,p,d,178,4):Rr()?d_(s,p,d):io(s,p,d)}function _o(){return U(),u()===21||u()===30}function so(){return U()===25}function oo(){switch(U()){case 21:case 30:case 25:return!0}return!1}function co(){let s=J();return D(h.createTypeLiteralNode(lo()),s)}function lo(){let s;return j(19)?(s=xn(4,Pi),j(20)):s=lr(),s}function uo(){return U(),u()===40||u()===41?U()===148:(u()===148&&U(),u()===23&&Ai()&&U()===103)}function ru(){let s=J(),p=jt();j(103);let d=ot();return D(h.createTypeParameterDeclaration(void 0,p,d,void 0),s)}function po(){let s=J();j(19);let p;(u()===148||u()===40||u()===41)&&(p=Wt(),p.kind!==148&&j(148)),j(23);let d=ru(),b=Je(130)?ot():void 0;j(24);let S;(u()===58||u()===40||u()===41)&&(S=Wt(),S.kind!==58&&j(58));let N=gr();Qt();let H=xn(4,Pi);return j(20),D(h.createMappedTypeNode(p,d,b,S,N,H),s)}function fo(){let s=J();if(Je(26))return D(h.createRestTypeNode(ot()),s);let p=ot();if(ih(p)&&p.pos===p.type.pos){let d=h.createOptionalTypeNode(p.type);return yn(d,p),d.flags=p.flags,d}return p}function m_(){return U()===59||u()===58&&U()===59}function iu(){return u()===26?wt(U())&&m_():wt(u())&&m_()}function mo(){if(G(iu)){let s=J(),p=qe(),d=ft(26),b=jt(),S=ft(58);j(59);let N=fo(),H=h.createNamedTupleMember(d,b,S,N);return Ce(D(H,s),p)}return fo()}function au(){let s=J();return D(h.createTupleTypeNode(Lr(21,mo,23,24)),s)}function ho(){let s=J();j(21);let p=ot();return j(22),D(h.createParenthesizedType(p),s)}function _u(){let s;if(u()===128){let p=J();U();let d=D(ye(128),p);s=Ct([d],p)}return s}function h_(){let s=J(),p=qe(),d=_u(),b=Je(105);B.assert(!d||b,"Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");let S=dn(),N=Hn(4),H=Jn(39,!1),_e=b?h.createConstructorTypeNode(d,S,N,H):h.createFunctionTypeNode(S,N,H);return Ce(D(_e,s),p)}function yo(){let s=Wt();return u()===25?void 0:s}function y_(s){let p=J();s&&U();let d=u()===112||u()===97||u()===106?Wt():ri(u());return s&&(d=D(h.createPrefixUnaryExpression(41,d),p)),D(h.createLiteralTypeNode(d),p)}function su(){return U(),u()===102}function g_(){vt|=4194304;let s=J(),p=Je(114);j(102),j(21);let d=ot(),b;if(Je(28)){let H=t.getTokenStart();j(19);let _e=u();if(_e===118||_e===132?U():Ee(E._0_expected,it(118)),j(59),b=Y_(_e,!0),!j(20)){let Z=Yi(_t);Z&&Z.code===E._0_expected.code&&rl(Z,Oa(Mt,Qe,H,1,E.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}}j(22);let S=Je(25)?ii():void 0,N=Xs();return D(h.createImportTypeNode(d,b,S,N,p),s)}function go(){return U(),u()===9||u()===10}function b_(){switch(u()){case 133:case 159:case 154:case 150:case 163:case 155:case 136:case 157:case 146:case 151:return le(yo)||pa();case 67:t.reScanAsteriskEqualsToken();case 42:return eu();case 61:t.reScanQuestionToken();case 58:return tu();case 100:return $s();case 54:return Hs();case 15:case 11:case 9:case 10:case 112:case 97:case 106:return y_();case 41:return G(go)?y_(!0):pa();case 116:return Wt();case 110:{let s=o_();return u()===142&&!t.hasPrecedingLineBreak()?Zl(s):s}case 114:return G(su)?g_():Qs();case 19:return G(uo)?po():co();case 23:return au();case 21:return ho();case 102:return g_();case 131:return G(M_)?Co():pa();case 16:return Fs();default:return pa()}}function ai(s){switch(u()){case 133:case 159:case 154:case 150:case 163:case 136:case 148:case 155:case 158:case 116:case 157:case 106:case 110:case 114:case 146:case 19:case 23:case 30:case 52:case 51:case 105:case 11:case 9:case 10:case 112:case 97:case 151:case 42:case 58:case 54:case 26:case 140:case 102:case 131:case 15:case 16:return!0;case 100:return!s;case 41:return!s&&G(go);case 21:return!s&&G(bo);default:return ve()}}function bo(){return U(),u()===22||fa(!1)||ai()}function vo(){let s=J(),p=b_();for(;!t.hasPrecedingLineBreak();)switch(u()){case 54:U(),p=D(h.createJSDocNonNullableType(p,!0),s);break;case 58:if(G(Ci))return p;U(),p=D(h.createJSDocNullableType(p,!0),s);break;case 23:if(j(23),ai()){let d=ot();j(24),p=D(h.createIndexedAccessTypeNode(p,d),s)}else j(24),p=D(h.createArrayTypeNode(p),s);break;default:return p}return p}function To(s){let p=J();return j(s),D(h.createTypeOperatorNode(s,So()),p)}function ou(){if(Je(96)){let s=Mn(ot);if(We()||u()!==58)return s}}function xo(){let s=J(),p=St(),d=le(ou),b=h.createTypeParameterDeclaration(void 0,p,d);return D(b,s)}function cu(){let s=J();return j(140),D(h.createInferTypeNode(xo()),s)}function So(){let s=u();switch(s){case 143:case 158:case 148:return To(s);case 140:return cu()}return hr(vo)}function ma(s){if(T_()){let p=h_(),d;return Nf(p)?d=s?E.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:E.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:d=s?E.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:E.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type,ln(p,d),p}}function wo(s,p,d){let b=J(),S=s===52,N=Je(s),H=N&&ma(S)||p();if(u()===s||N){let _e=[H];for(;Je(s);)_e.push(ma(S)||p());H=D(d(Ct(_e,b)),b)}return H}function v_(){return wo(51,So,h.createIntersectionTypeNode)}function lu(){return wo(52,v_,h.createUnionTypeNode)}function ko(){return U(),u()===105}function T_(){return u()===30||u()===21&&G(Eo)?!0:u()===105||u()===128&&G(ko)}function uu(){if(Wr(u())&&wn(!1),ve()||u()===110)return U(),!0;if(u()===23||u()===19){let s=_t.length;return Li(),s===_t.length}return!1}function Eo(){return U(),!!(u()===22||u()===26||uu()&&(u()===59||u()===28||u()===58||u()===64||u()===22&&(U(),u()===39)))}function ha(){let s=J(),p=ve()&&le(Ao),d=ot();return p?D(h.createTypePredicateNode(void 0,p,d),s):d}function Ao(){let s=St();if(u()===142&&!t.hasPrecedingLineBreak())return U(),s}function Co(){let s=J(),p=Yn(131),d=u()===110?o_():St(),b=Je(142)?ot():void 0;return D(h.createTypePredicateNode(p,d,b),s)}function ot(){if(nt&81920)return Dt(81920,ot);if(T_())return h_();let s=J(),p=lu();if(!We()&&!t.hasPrecedingLineBreak()&&Je(96)){let d=Mn(ot);j(58);let b=hr(ot);j(59);let S=hr(ot);return D(h.createConditionalTypeNode(p,d,b,S),s)}return p}function gr(){return Je(59)?ot():void 0}function x_(){switch(u()){case 110:case 108:case 106:case 112:case 97:case 9:case 10:case 11:case 15:case 16:case 21:case 23:case 19:case 100:case 86:case 105:case 44:case 69:case 80:return!0;case 102:return G(oo);default:return ve()}}function br(){if(x_())return!0;switch(u()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 46:case 47:case 30:case 135:case 127:case 81:case 60:return!0;default:return Bo()?!0:ve()}}function Do(){return u()!==19&&u()!==100&&u()!==86&&u()!==60&&br()}function Et(){let s=Ze();s&&Ke(!1);let p=J(),d=zt(!0),b;for(;b=ft(28);)d=k_(d,b,zt(!0),p);return s&&Ke(!0),d}function vr(){return Je(64)?zt(!0):void 0}function zt(s){if(Po())return No();let p=fu(s)||Lo(s);if(p)return p;let d=J(),b=qe(),S=Ni(0);return S.kind===80&&u()===39?Io(d,S,s,b,void 0):qa(S)&&x1(Ve())?k_(S,Wt(),zt(s),d):du(S,d,s)}function Po(){return u()===127?we()?!0:G(J_):!1}function pu(){return U(),!t.hasPrecedingLineBreak()&&ve()}function No(){let s=J();return U(),!t.hasPrecedingLineBreak()&&(u()===42||br())?D(h.createYieldExpression(ft(42),zt(!0)),s):D(h.createYieldExpression(void 0,void 0),s)}function Io(s,p,d,b,S){B.assert(u()===39,"parseSimpleArrowFunctionExpression should only have been called if we had a =>");let N=h.createParameterDeclaration(void 0,void 0,p,void 0,void 0,void 0);D(N,p.pos);let H=Ct([N],N.pos,N.end),_e=Yn(39),Z=S_(!!S,d),ee=h.createArrowFunction(S,void 0,H,void 0,_e,Z);return Ce(D(ee,s),b)}function fu(s){let p=Oo();if(p!==0)return p===1?Ro(!0,!0):le(()=>Jo(s))}function Oo(){return u()===21||u()===30||u()===134?G(Mo):u()===39?1:0}function Mo(){if(u()===134&&(U(),t.hasPrecedingLineBreak()||u()!==21&&u()!==30))return 0;let s=u(),p=U();if(s===21){if(p===22)switch(U()){case 39:case 59:case 19:return 1;default:return 0}if(p===23||p===19)return 2;if(p===26)return 1;if(Wr(p)&&p!==134&&G(Ai))return U()===130?0:1;if(!ve()&&p!==110)return 0;switch(U()){case 59:return 1;case 58:return U(),u()===59||u()===28||u()===64||u()===22?1:0;case 28:case 64:case 22:return 2}return 0}else return B.assert(s===30),!ve()&&u()!==87?0:ct===1?G(()=>{Je(87);let b=U();if(b===96)switch(U()){case 64:case 32:case 44:return!1;default:return!0}else if(b===28||b===64)return!0;return!1})?1:0:2}function Jo(s){let p=t.getTokenStart();if(cn!=null&&cn.has(p))return;let d=Ro(!1,s);return d||(cn||(cn=new Set)).add(p),d}function Lo(s){if(u()===134&&G(jo)===1){let p=J(),d=qe(),b=Jc(),S=Ni(0);return Io(p,S,s,d,b)}}function jo(){if(u()===134){if(U(),t.hasPrecedingLineBreak()||u()===39)return 0;let s=Ni(0);if(!t.hasPrecedingLineBreak()&&s.kind===80&&u()===39)return 1}return 0}function Ro(s,p){let d=J(),b=qe(),S=Jc(),N=Xt(S,_l)?2:0,H=dn(),_e;if(j(21)){if(s)_e=f_(N,s);else{let Zt=f_(N,s);if(!Zt)return;_e=Zt}if(!j(22)&&!s)return}else{if(!s)return;_e=lr()}let Z=u()===59,ee=Jn(59,!1);if(ee&&!s&&s_(ee))return;let ce=ee;for(;(ce==null?void 0:ce.kind)===196;)ce=ce.type;let Le=ce&&ah(ce);if(!s&&u()!==39&&(Le||u()!==19))return;let je=u(),Ae=Yn(39),Yt=je===39||je===19?S_(Xt(S,_l),p):St();if(!p&&Z&&u()!==59)return;let mn=h.createArrowFunction(S,H,_e,ee,Ae,Yt);return Ce(D(mn,d),b)}function S_(s,p){if(u()===19)return Ta(s?2:0);if(u()!==27&&u()!==100&&u()!==86&&vc()&&!Do())return Ta(16|(s?2:0));let d=Bt;Bt=!1;let b=s?R(()=>zt(p)):$(()=>zt(p));return Bt=d,b}function du(s,p,d){let b=ft(58);if(!b)return s;let S;return D(h.createConditionalExpression(s,b,Dt(a,()=>zt(!1)),S=Yn(59),Up(S)?zt(d):Gt(80,!1,E._0_expected,it(59))),p)}function Ni(s){let p=J(),d=Yo();return w_(s,d,p)}function Uo(s){return s===103||s===165}function w_(s,p,d){for(;;){Ve();let b=wp(u());if(!(u()===43?b>=s:b>s)||u()===103&&be())break;if(u()===130||u()===152){if(t.hasPrecedingLineBreak())break;{let N=u();U(),p=N===152?qo(p,ot()):zo(p,ot())}}else p=k_(p,Wt(),Ni(b),d)}return p}function Bo(){return be()&&u()===103?!1:wp(u())>0}function qo(s,p){return D(h.createSatisfiesExpression(s,p),s.pos)}function k_(s,p,d,b){return D(h.createBinaryExpression(s,p,d),b)}function zo(s,p){return D(h.createAsExpression(s,p),s.pos)}function Fo(){let s=J();return D(h.createPrefixUnaryExpression(u(),Me(Tr)),s)}function Vo(){let s=J();return D(h.createDeleteExpression(Me(Tr)),s)}function mu(){let s=J();return D(h.createTypeOfExpression(Me(Tr)),s)}function Wo(){let s=J();return D(h.createVoidExpression(Me(Tr)),s)}function hu(){return u()===135?Ye()?!0:G(J_):!1}function Go(){let s=J();return D(h.createAwaitExpression(Me(Tr)),s)}function Yo(){if(yu()){let d=J(),b=ya();return u()===43?w_(wp(u()),b,d):b}let s=u(),p=Tr();if(u()===43){let d=Ar(Qe,p.pos),{end:b}=p;p.kind===216?rt(d,b,E.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):(B.assert(Sp(s)),rt(d,b,E.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,it(s)))}return p}function Tr(){switch(u()){case 40:case 41:case 55:case 54:return Fo();case 91:return Vo();case 114:return mu();case 116:return Wo();case 30:return ct===1?Oi(!0,void 0,void 0,!0):Ko();case 135:if(hu())return Go();default:return ya()}}function yu(){switch(u()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 135:return!1;case 30:if(ct!==1)return!1;default:return!0}}function ya(){if(u()===46||u()===47){let p=J();return D(h.createPrefixUnaryExpression(u(),Me(Ii)),p)}else if(ct===1&&u()===30&&G(Ns))return Oi(!0);let s=Ii();if(B.assert(qa(s)),(u()===46||u()===47)&&!t.hasPrecedingLineBreak()){let p=u();return U(),D(h.createPostfixUnaryExpression(s,p),s.pos)}return s}function Ii(){let s=J(),p;return u()===102?G(_o)?(vt|=4194304,p=Wt()):G(so)?(U(),U(),p=D(h.createMetaProperty(102,jt()),s),vt|=8388608):p=ga():p=u()===108?Xo():ga(),P_(s,p)}function ga(){let s=J(),p=N_();return _n(s,p,!0)}function Xo(){let s=J(),p=Wt();if(u()===30){let d=J(),b=le(va);b!==void 0&&(rt(d,J(),E.super_may_not_use_type_arguments),Sn()||(p=h.createExpressionWithTypeArguments(p,b)))}return u()===21||u()===25||u()===23?p:(Yn(25,E.super_must_be_followed_by_an_argument_list_or_member_access),D(ae(p,ni(!0,!0,!0)),s))}function Oi(s,p,d,b=!1){let S=J(),N=vu(s),H;if(N.kind===286){let _e=ba(N),Z,ee=_e[_e.length-1];if((ee==null?void 0:ee.kind)===284&&!pi(ee.openingElement.tagName,ee.closingElement.tagName)&&pi(N.tagName,ee.closingElement.tagName)){let ce=ee.children.end,Le=D(h.createJsxElement(ee.openingElement,ee.children,D(h.createJsxClosingElement(D(re(""),ce,ce)),ce,ce)),ee.openingElement.pos,ce);_e=Ct([..._e.slice(0,_e.length-1),Le],_e.pos,ce),Z=ee.closingElement}else Z=Qo(N,s),pi(N.tagName,Z.tagName)||(d&&Fp(d)&&pi(Z.tagName,d.tagName)?ln(N.tagName,E.JSX_element_0_has_no_corresponding_closing_tag,is(Qe,N.tagName)):ln(Z.tagName,E.Expected_corresponding_JSX_closing_tag_for_0,is(Qe,N.tagName)));H=D(h.createJsxElement(N,_e,Z),S)}else N.kind===289?H=D(h.createJsxFragment(N,ba(N),wu(s)),S):(B.assert(N.kind===285),H=N);if(!b&&s&&u()===30){let _e=typeof p>"u"?H.pos:p,Z=le(()=>Oi(!0,_e));if(Z){let ee=Gt(28,!1);return Gd(ee,Z.pos,0),rt(Ar(Qe,_e),Z.end,E.JSX_expressions_must_have_one_parent_element),D(h.createBinaryExpression(H,ee,Z),S)}}return H}function E_(){let s=J(),p=h.createJsxText(t.getTokenValue(),lt===13);return lt=t.scanJsxToken(),D(p,s)}function gu(s,p){switch(p){case 1:if(a6(s))ln(s,E.JSX_fragment_has_no_corresponding_closing_tag);else{let d=s.tagName,b=Math.min(Ar(Qe,d.pos),d.end);rt(b,d.end,E.JSX_element_0_has_no_corresponding_closing_tag,is(Qe,s.tagName))}return;case 31:case 7:return;case 12:case 13:return E_();case 19:return Ho(!1);case 30:return Oi(!1,void 0,s);default:return B.assertNever(p)}}function ba(s){let p=[],d=J(),b=yt;for(yt|=16384;;){let S=gu(s,lt=t.reScanJsxToken());if(!S||(p.push(S),Fp(s)&&(S==null?void 0:S.kind)===284&&!pi(S.openingElement.tagName,S.closingElement.tagName)&&pi(s.tagName,S.closingElement.tagName)))break}return yt=b,Ct(p,d)}function bu(){let s=J();return D(h.createJsxAttributes(xn(13,$o)),s)}function vu(s){let p=J();if(j(30),u()===32)return Gn(),D(h.createJsxOpeningFragment(),p);let d=A_(),b=(nt&524288)===0?Ca():void 0,S=bu(),N;return u()===32?(Gn(),N=h.createJsxOpeningElement(d,b,S)):(j(44),j(32,void 0,!1)&&(s?U():Gn()),N=h.createJsxSelfClosingElement(d,b,S)),D(N,p)}function A_(){let s=J(),p=Tu();if(eh(p))return p;let d=p;for(;Je(25);)d=D(ae(d,ni(!0,!1,!1)),s);return d}function Tu(){let s=J();qt();let p=u()===110,d=ei();return Je(59)?(qt(),D(h.createJsxNamespacedName(d,ei()),s)):p?D(h.createToken(110),s):d}function Ho(s){let p=J();if(!j(19))return;let d,b;return u()!==20&&(s||(d=ft(26)),b=Et()),s?j(20):j(20,void 0,!1)&&Gn(),D(h.createJsxExpression(d,b),p)}function $o(){if(u()===19)return Su();let s=J();return D(h.createJsxAttribute(xu(),C_()),s)}function C_(){if(u()===64){if(wi()===11)return Xn();if(u()===19)return Ho(!0);if(u()===30)return Oi(!0);Ee(E.or_JSX_element_expected)}}function xu(){let s=J();qt();let p=ei();return Je(59)?(qt(),D(h.createJsxNamespacedName(p,ei()),s)):p}function Su(){let s=J();j(19),j(26);let p=Et();return j(20),D(h.createJsxSpreadAttribute(p),s)}function Qo(s,p){let d=J();j(31);let b=A_();return j(32,void 0,!1)&&(p||!pi(s.tagName,b)?U():Gn()),D(h.createJsxClosingElement(b),d)}function wu(s){let p=J();return j(31),j(32,E.Expected_corresponding_closing_tag_for_JSX_fragment,!1)&&(s?U():Gn()),D(h.createJsxJsxClosingFragment(),p)}function Ko(){B.assert(ct!==1,"Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments.");let s=J();j(30);let p=ot();j(32);let d=Tr();return D(h.createTypeAssertion(p,d),s)}function ku(){return U(),wt(u())||u()===23||Sn()}function Zo(){return u()===29&&G(ku)}function D_(s){if(s.flags&64)return!0;if(ll(s)){let p=s.expression;for(;ll(p)&&!(p.flags&64);)p=p.expression;if(p.flags&64){for(;ll(s);)s.flags|=64,s=s.expression;return!0}}return!1}function ec(s,p,d){let b=ni(!0,!0,!0),S=d||D_(p),N=S?Oe(p,d,b):ae(p,b);if(S&&gi(N.name)&&ln(N.name,E.An_optional_chain_cannot_contain_private_identifiers),H1(p)&&p.typeArguments){let H=p.typeArguments.pos-1,_e=Ar(Qe,p.typeArguments.end)+1;rt(H,_e,E.An_instantiation_expression_cannot_be_followed_by_a_property_access)}return D(N,s)}function Eu(s,p,d){let b;if(u()===24)b=Gt(80,!0,E.An_element_access_expression_should_take_an_argument);else{let N=ut(Et);El(N)&&(N.text=Mr(N.text)),b=N}j(24);let S=d||D_(p)?oe(p,d,b):V(p,b);return D(S,s)}function _n(s,p,d){for(;;){let b,S=!1;if(d&&Zo()?(b=Yn(29),S=wt(u())):S=Je(25),S){p=ec(s,p,b);continue}if((b||!Ze())&&Je(23)){p=Eu(s,p,b);continue}if(Sn()){p=!b&&p.kind===233?Ur(s,p.expression,b,p.typeArguments):Ur(s,p,b,void 0);continue}if(!b){if(u()===54&&!t.hasPrecedingLineBreak()){U(),p=D(h.createNonNullExpression(p),s);continue}let N=le(va);if(N){p=D(h.createExpressionWithTypeArguments(p,N),s);continue}}return p}}function Sn(){return u()===15||u()===16}function Ur(s,p,d,b){let S=h.createTaggedTemplateExpression(p,b,u()===15?(Pt(!0),Xn()):ua(!0));return(d||p.flags&64)&&(S.flags|=64),S.questionDotToken=d,D(S,s)}function P_(s,p){for(;;){p=_n(s,p,!0);let d,b=ft(29);if(b&&(d=le(va),Sn())){p=Ur(s,p,b,d);continue}if(d||u()===21){!b&&p.kind===233&&(d=p.typeArguments,p=p.expression);let S=tc(),N=b||D_(p)?dt(p,b,d,S):W(p,d,S);p=D(N,s);continue}if(b){let S=Gt(80,!1,E.Identifier_expected);p=D(Oe(p,b,S),s)}break}return p}function tc(){j(21);let s=fn(11,ic);return j(22),s}function va(){if((nt&524288)!==0||kt()!==30)return;U();let s=fn(20,ot);if(Ve()===32)return U(),s&&Au()?s:void 0}function Au(){switch(u()){case 21:case 15:case 16:return!0;case 30:case 32:case 40:case 41:return!1}return t.hasPrecedingLineBreak()||Bo()||!br()}function N_(){switch(u()){case 15:t.getTokenFlags()&26656&&Pt(!1);case 9:case 10:case 11:return Xn();case 110:case 108:case 106:case 112:case 97:return Wt();case 21:return Cu();case 23:return ac();case 19:return I_();case 134:if(!G(bc))break;return O_();case 60:return Lc();case 86:return Hu();case 100:return O_();case 105:return sc();case 44:case 69:if($e()===14)return Xn();break;case 16:return ua(!1);case 81:return _a()}return St(E.Expression_expected)}function Cu(){let s=J(),p=qe();j(21);let d=ut(Et);return j(22),Ce(D(gn(d),s),p)}function nc(){let s=J();j(26);let p=zt(!0);return D(h.createSpreadElement(p),s)}function rc(){return u()===26?nc():u()===28?D(h.createOmittedExpression(),J()):zt(!0)}function ic(){return Dt(a,rc)}function ac(){let s=J(),p=t.getTokenStart(),d=j(23),b=t.hasPrecedingLineBreak(),S=fn(15,rc);return Or(23,24,d,p),D(de(S,b),s)}function _c(){let s=J(),p=qe();if(ft(26)){let ce=zt(!0);return Ce(D(h.createSpreadAssignment(ce),s),p)}let d=wn(!0);if(ti(139))return qr(s,p,d,177,0);if(ti(153))return qr(s,p,d,178,0);let b=ft(42),S=ve(),N=Jr(),H=ft(58),_e=ft(54);if(b||u()===21||u()===30)return q_(s,p,d,b,N,H,_e);let Z;if(S&&u()!==59){let ce=ft(64),Le=ce?ut(()=>zt(!0)):void 0;Z=h.createShorthandPropertyAssignment(N,Le),Z.equalsToken=ce}else{j(59);let ce=ut(()=>zt(!0));Z=h.createPropertyAssignment(N,ce)}return Z.modifiers=d,Z.questionToken=H,Z.exclamationToken=_e,Ce(D(Z,s),p)}function I_(){let s=J(),p=t.getTokenStart(),d=j(19),b=t.hasPrecedingLineBreak(),S=fn(12,_c,!0);return Or(19,20,d,p),D(M(S,b),s)}function O_(){let s=Ze();Ke(!1);let p=J(),d=qe(),b=wn(!1);j(100);let S=ft(42),N=S?1:0,H=Xt(b,_l)?2:0,_e=N&&H?K(Mi):N?Wn(Mi):H?R(Mi):Mi(),Z=dn(),ee=Hn(N|H),ce=Jn(59,!1),Le=Ta(N|H);Ke(s);let je=h.createFunctionExpression(b,S,_e,Z,ee,ce,Le);return Ce(D(je,p),d)}function Mi(){return Fe()?Ka():void 0}function sc(){let s=J();if(j(105),Je(25)){let N=jt();return D(h.createMetaProperty(105,N),s)}let p=J(),d=_n(p,N_(),!1),b;d.kind===233&&(b=d.typeArguments,d=d.expression),u()===29&&Ee(E.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0,is(Qe,d));let S=u()===21?tc():void 0;return D(nr(d,b,S),s)}function Br(s,p){let d=J(),b=qe(),S=t.getTokenStart(),N=j(19,p);if(N||s){let H=t.hasPrecedingLineBreak(),_e=xn(1,Kt);Or(19,20,N,S);let Z=Ce(D(rr(_e,H),d),b);return u()===64&&(Ee(E.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses),U()),Z}else{let H=lr();return Ce(D(rr(H,void 0),d),b)}}function Ta(s,p){let d=we();He(!!(s&1));let b=Ye();st(!!(s&2));let S=Bt;Bt=!1;let N=Ze();N&&Ke(!1);let H=Br(!!(s&16),p);return N&&Ke(!0),Bt=S,He(d),st(b),H}function oc(){let s=J(),p=qe();return j(27),Ce(D(h.createEmptyStatement(),s),p)}function Du(){let s=J(),p=qe();j(101);let d=t.getTokenStart(),b=j(21),S=ut(Et);Or(21,22,b,d);let N=Kt(),H=Je(93)?Kt():void 0;return Ce(D(Ge(S,N,H),s),p)}function cc(){let s=J(),p=qe();j(92);let d=Kt();j(117);let b=t.getTokenStart(),S=j(21),N=ut(Et);return Or(21,22,S,b),Je(27),Ce(D(h.createDoStatement(d,N),s),p)}function Pu(){let s=J(),p=qe();j(117);let d=t.getTokenStart(),b=j(21),S=ut(Et);Or(21,22,b,d);let N=Kt();return Ce(D(ir(S,N),s),p)}function lc(){let s=J(),p=qe();j(99);let d=ft(135);j(21);let b;u()!==27&&(u()===115||u()===121||u()===87||u()===160&&G(xc)||u()===135&&G(Sc)?b=B_(!0):b=Ir(Et));let S;if(d?j(165):Je(165)){let N=ut(()=>zt(!0));j(22),S=Ot(d,b,N,Kt())}else if(Je(103)){let N=ut(Et);j(22),S=h.createForInStatement(b,N,Kt())}else{j(27);let N=u()!==27&&u()!==22?ut(Et):void 0;j(27);let H=u()!==22?ut(Et):void 0;j(22),S=Pr(b,N,H,Kt())}return Ce(D(S,s),p)}function uc(s){let p=J(),d=qe();j(s===252?83:88);let b=sr()?void 0:St();Qt();let S=s===252?h.createBreakStatement(b):h.createContinueStatement(b);return Ce(D(S,p),d)}function pc(){let s=J(),p=qe();j(107);let d=sr()?void 0:ut(Et);return Qt(),Ce(D(h.createReturnStatement(d),s),p)}function Nu(){let s=J(),p=qe();j(118);let d=t.getTokenStart(),b=j(21),S=ut(Et);Or(21,22,b,d);let N=Tt(67108864,Kt);return Ce(D(h.createWithStatement(S,N),s),p)}function fc(){let s=J(),p=qe();j(84);let d=ut(Et);j(59);let b=xn(3,Kt);return Ce(D(h.createCaseClause(d,b),s),p)}function Iu(){let s=J();j(90),j(59);let p=xn(3,Kt);return D(h.createDefaultClause(p),s)}function Ou(){return u()===84?fc():Iu()}function dc(){let s=J();j(19);let p=xn(2,Ou);return j(20),D(h.createCaseBlock(p),s)}function Mu(){let s=J(),p=qe();j(109),j(21);let d=ut(Et);j(22);let b=dc();return Ce(D(h.createSwitchStatement(d,b),s),p)}function mc(){let s=J(),p=qe();j(111);let d=t.hasPrecedingLineBreak()?void 0:ut(Et);return d===void 0&&(vn++,d=D(re(""),J())),aa()||xt(d),Ce(D(h.createThrowStatement(d),s),p)}function Ju(){let s=J(),p=qe();j(113);let d=Br(!1),b=u()===85?hc():void 0,S;return(!b||u()===98)&&(j(98,E.catch_or_finally_expected),S=Br(!1)),Ce(D(h.createTryStatement(d,b,S),s),p)}function hc(){let s=J();j(85);let p;Je(21)?(p=U_(),j(22)):p=void 0;let d=Br(!1);return D(h.createCatchClause(p,d),s)}function Lu(){let s=J(),p=qe();return j(89),Qt(),Ce(D(h.createDebuggerStatement(),s),p)}function yc(){let s=J(),p=qe(),d,b=u()===21,S=ut(Et);return tt(S)&&Je(59)?d=h.createLabeledStatement(S,Kt()):(aa()||xt(S),d=In(S),b&&(p=!1)),Ce(D(d,s),p)}function M_(){return U(),wt(u())&&!t.hasPrecedingLineBreak()}function gc(){return U(),u()===86&&!t.hasPrecedingLineBreak()}function bc(){return U(),u()===100&&!t.hasPrecedingLineBreak()}function J_(){return U(),(wt(u())||u()===9||u()===10||u()===11)&&!t.hasPrecedingLineBreak()}function ju(){for(;;)switch(u()){case 115:case 121:case 87:case 100:case 86:case 94:return!0;case 160:return j_();case 135:return xa();case 120:case 156:return pu();case 144:case 145:return Ec();case 128:case 129:case 134:case 138:case 123:case 124:case 125:case 148:let s=u();if(U(),t.hasPrecedingLineBreak())return!1;if(s===138&&u()===156)return!0;continue;case 162:return U(),u()===19||u()===80||u()===95;case 102:return U(),u()===11||u()===42||u()===19||wt(u());case 95:let p=U();if(p===156&&(p=G(U)),p===64||p===42||p===19||p===90||p===130||p===60)return!0;continue;case 126:U();continue;default:return!1}}function Ji(){return G(ju)}function vc(){switch(u()){case 60:case 27:case 19:case 115:case 121:case 160:case 100:case 86:case 94:case 101:case 92:case 117:case 99:case 88:case 83:case 107:case 118:case 109:case 111:case 113:case 89:case 85:case 98:return!0;case 102:return Ji()||G(oo);case 87:case 95:return Ji();case 134:case 138:case 120:case 144:case 145:case 156:case 162:return!0;case 129:case 125:case 123:case 124:case 126:case 148:return Ji()||!G(M_);default:return br()}}function Tc(){return U(),Fe()||u()===19||u()===23}function Ru(){return G(Tc)}function xc(){return L_(!0)}function L_(s){return U(),s&&u()===165?!1:(Fe()||u()===19)&&!t.hasPrecedingLineBreak()}function j_(){return G(L_)}function Sc(s){return U()===160?L_(s):!1}function xa(){return G(Sc)}function Kt(){switch(u()){case 27:return oc();case 19:return Br(!1);case 115:return _i(J(),qe(),void 0);case 121:if(Ru())return _i(J(),qe(),void 0);break;case 135:if(xa())return _i(J(),qe(),void 0);break;case 160:if(j_())return _i(J(),qe(),void 0);break;case 100:return Pc(J(),qe(),void 0);case 86:return jc(J(),qe(),void 0);case 101:return Du();case 92:return cc();case 117:return Pu();case 99:return lc();case 88:return uc(251);case 83:return uc(252);case 107:return pc();case 118:return Nu();case 109:return Mu();case 111:return mc();case 113:case 85:case 98:return Ju();case 89:return Lu();case 60:return wc();case 134:case 120:case 156:case 144:case 145:case 138:case 87:case 94:case 95:case 102:case 123:case 124:case 125:case 128:case 129:case 126:case 148:case 162:if(Ji())return wc();break}return yc()}function R_(s){return s.kind===138}function wc(){let s=J(),p=qe(),d=wn(!0);if(Xt(d,R_)){let S=Sa(s);if(S)return S;for(let N of d)N.flags|=33554432;return Tt(33554432,()=>kc(s,p,d))}else return kc(s,p,d)}function Sa(s){return Tt(33554432,()=>{let p=ca(yt,s);if(p)return Ms(p)})}function kc(s,p,d){switch(u()){case 115:case 121:case 87:case 160:case 135:return _i(s,p,d);case 100:return Pc(s,p,d);case 86:return jc(s,p,d);case 120:return Bc(s,p,d);case 156:return ep(s,p,d);case 94:return V_(s,p,d);case 162:case 144:case 145:return np(s,p,d);case 102:return ap(s,p,d);case 95:switch(U(),u()){case 90:case 64:return Xc(s,p,d);case 130:return ip(s,p,d);default:return dp(s,p,d)}default:if(d){let b=Gt(282,!0,E.Declaration_expected);return qp(b,s),b.modifiers=d,b}return}}function Uu(){return U()===11}function Bu(){return U(),u()===161||u()===64}function Ec(){return U(),!t.hasPrecedingLineBreak()&&(ve()||u()===11)}function wa(s,p){if(u()!==19){if(s&4){da();return}if(sr()){Qt();return}}return Ta(s,p)}function Ac(){let s=J();if(u()===28)return D(h.createOmittedExpression(),s);let p=ft(26),d=Li(),b=vr();return D(h.createBindingElement(p,void 0,d,b),s)}function qu(){let s=J(),p=ft(26),d=Fe(),b=Jr(),S;d&&u()!==59?(S=b,b=void 0):(j(59),S=Li());let N=vr();return D(h.createBindingElement(p,b,S,N),s)}function Cc(){let s=J();j(19);let p=ut(()=>fn(9,qu));return j(20),D(h.createObjectBindingPattern(p),s)}function zu(){let s=J();j(23);let p=ut(()=>fn(10,Ac));return j(24),D(h.createArrayBindingPattern(p),s)}function ka(){return u()===19||u()===23||u()===81||Fe()}function Li(s){return u()===23?zu():u()===19?Cc():Ka(s)}function Dc(){return U_(!0)}function U_(s){let p=J(),d=qe(),b=Li(E.Private_identifiers_are_not_allowed_in_variable_declarations),S;s&&b.kind===80&&u()===54&&!t.hasPrecedingLineBreak()&&(S=Wt());let N=gr(),H=Uo(u())?void 0:vr(),_e=Bn(b,S,N,H);return Ce(D(_e,p),d)}function B_(s){let p=J(),d=0;switch(u()){case 115:break;case 121:d|=1;break;case 87:d|=2;break;case 160:d|=4;break;case 135:B.assert(xa()),d|=6,U();break;default:B.fail()}U();let b;if(u()===165&&G(Fu))b=lr();else{let S=be();Te(s),b=fn(8,s?U_:Dc),Te(S)}return D(On(b,d),p)}function Fu(){return Ai()&&U()===22}function _i(s,p,d){let b=B_(!1);Qt();let S=bn(d,b);return Ce(D(S,s),p)}function Pc(s,p,d){let b=Ye(),S=Rn(d);j(100);let N=ft(42),H=S&2048?Mi():Ka(),_e=N?1:0,Z=S&1024?2:0,ee=dn();S&32&&st(!0);let ce=Hn(_e|Z),Le=Jn(59,!1),je=wa(_e|Z,E.or_expected);st(b);let Ae=h.createFunctionDeclaration(d,N,H,ee,ce,Le,je);return Ce(D(Ae,s),p)}function Nc(){if(u()===137)return j(137);if(u()===11&&G(U)===21)return le(()=>{let s=Xn();return s.text==="constructor"?s:void 0})}function Vu(s,p,d){return le(()=>{if(Nc()){let b=dn(),S=Hn(0),N=Jn(59,!1),H=wa(0,E.or_expected),_e=h.createConstructorDeclaration(d,S,H);return _e.typeParameters=b,_e.type=N,Ce(D(_e,s),p)}})}function q_(s,p,d,b,S,N,H,_e){let Z=b?1:0,ee=Xt(d,_l)?2:0,ce=dn(),Le=Hn(Z|ee),je=Jn(59,!1),Ae=wa(Z|ee,_e),Yt=h.createMethodDeclaration(d,b,S,N,ce,Le,je,Ae);return Yt.exclamationToken=H,Ce(D(Yt,s),p)}function Ic(s,p,d,b,S){let N=!S&&!t.hasPrecedingLineBreak()?ft(54):void 0,H=gr(),_e=Dt(90112,vr);Bl(b,H,_e);let Z=h.createPropertyDeclaration(d,b,S||N,H,_e);return Ce(D(Z,s),p)}function Ea(s,p,d){let b=ft(42),S=Jr(),N=ft(58);return b||u()===21||u()===30?q_(s,p,d,b,S,N,void 0,E.or_expected):Ic(s,p,d,S,N)}function qr(s,p,d,b,S){let N=Jr(),H=dn(),_e=Hn(0),Z=Jn(59,!1),ee=wa(S),ce=b===177?h.createGetAccessorDeclaration(d,N,_e,Z,ee):h.createSetAccessorDeclaration(d,N,_e,ee);return ce.typeParameters=H,hs(ce)&&(ce.type=Z),Ce(D(ce,s),p)}function Wu(){let s;if(u()===60)return!0;for(;Wr(u());){if(s=u(),zg(s))return!0;U()}if(u()===42||(yr()&&(s=u(),U()),u()===23))return!0;if(s!==void 0){if(!di(s)||s===153||s===139)return!0;switch(u()){case 21:case 30:case 54:case 59:case 64:case 58:return!0;default:return sr()}}return!1}function Oc(s,p,d){Yn(126);let b=Gu(),S=Ce(D(h.createClassStaticBlockDeclaration(b),s),p);return S.modifiers=d,S}function Gu(){let s=we(),p=Ye();He(!1),st(!0);let d=Br(!1);return He(s),st(p),d}function Yu(){if(Ye()&&u()===135){let s=J(),p=St(E.Expression_expected);U();let d=_n(s,p,!0);return P_(s,d)}return Ii()}function z_(){let s=J();if(!Je(60))return;let p=Si(Yu);return D(h.createDecorator(p),s)}function Mc(s,p,d){let b=J(),S=u();if(u()===87&&p){if(!le(Za))return}else{if(d&&u()===126&&G(Vc))return;if(s&&u()===126)return;if(!Ds())return}return D(ye(S),b)}function wn(s,p,d){let b=J(),S,N,H,_e=!1,Z=!1,ee=!1;if(s&&u()===60)for(;N=z_();)S=An(S,N);for(;H=Mc(_e,p,d);)H.kind===126&&(_e=!0),S=An(S,H),Z=!0;if(Z&&s&&u()===60)for(;N=z_();)S=An(S,N),ee=!0;if(ee)for(;H=Mc(_e,p,d);)H.kind===126&&(_e=!0),S=An(S,H);return S&&Ct(S,b)}function Jc(){let s;if(u()===134){let p=J();U();let d=D(ye(134),p);s=Ct([d],p)}return s}function Xu(){let s=J(),p=qe();if(u()===27)return U(),Ce(D(h.createSemicolonClassElement(),s),p);let d=wn(!0,!0,!0);if(u()===126&&G(Vc))return Oc(s,p,d);if(ti(139))return qr(s,p,d,177,0);if(ti(153))return qr(s,p,d,178,0);if(u()===137||u()===11){let b=Vu(s,p,d);if(b)return b}if(Rr())return d_(s,p,d);if(wt(u())||u()===11||u()===9||u()===10||u()===42||u()===23)if(Xt(d,R_)){for(let S of d)S.flags|=33554432;return Tt(33554432,()=>Ea(s,p,d))}else return Ea(s,p,d);if(d){let b=Gt(80,!0,E.Declaration_expected);return Ic(s,p,d,b,void 0)}return B.fail("Should not have attempted to parse class member declaration.")}function Lc(){let s=J(),p=qe(),d=wn(!0);if(u()===86)return Aa(s,p,d,231);let b=Gt(282,!0,E.Expression_expected);return qp(b,s),b.modifiers=d,b}function Hu(){return Aa(J(),qe(),void 0,231)}function jc(s,p,d){return Aa(s,p,d,263)}function Aa(s,p,d,b){let S=Ye();j(86);let N=$u(),H=dn();Xt(d,zb)&&st(!0);let _e=F_(),Z;j(19)?(Z=Uc(),j(20)):Z=lr(),st(S);let ee=b===263?h.createClassDeclaration(d,N,H,_e,Z):h.createClassExpression(d,N,H,_e,Z);return Ce(D(ee,s),p)}function $u(){return Fe()&&!Qu()?or(Fe()):void 0}function Qu(){return u()===119&&G(Xl)}function F_(){if(Rc())return xn(22,Ku)}function Ku(){let s=J(),p=u();B.assert(p===96||p===119),U();let d=fn(7,Zu);return D(h.createHeritageClause(p,d),s)}function Zu(){let s=J(),p=Ii();if(p.kind===233)return p;let d=Ca();return D(h.createExpressionWithTypeArguments(p,d),s)}function Ca(){return u()===30?Lr(20,ot,30,32):void 0}function Rc(){return u()===96||u()===119}function Uc(){return xn(5,Xu)}function Bc(s,p,d){j(120);let b=St(),S=dn(),N=F_(),H=lo(),_e=h.createInterfaceDeclaration(d,b,S,N,H);return Ce(D(_e,s),p)}function ep(s,p,d){j(156),t.hasPrecedingLineBreak()&&Ee(E.Line_break_not_permitted_here);let b=St(),S=dn();j(64);let N=u()===141&&le(yo)||ot();Qt();let H=h.createTypeAliasDeclaration(d,b,S,N);return Ce(D(H,s),p)}function tp(){let s=J(),p=qe(),d=Jr(),b=ut(vr);return Ce(D(h.createEnumMember(d,b),s),p)}function V_(s,p,d){j(94);let b=St(),S;j(19)?(S=xe(()=>fn(6,tp)),j(20)):S=lr();let N=h.createEnumDeclaration(d,b,S);return Ce(D(N,s),p)}function qc(){let s=J(),p;return j(19)?(p=xn(1,Kt),j(20)):p=lr(),D(h.createModuleBlock(p),s)}function W_(s,p,d,b){let S=b&32,N=b&8?jt():St(),H=Je(25)?W_(J(),!1,void 0,8|S):qc(),_e=h.createModuleDeclaration(d,N,H,b);return Ce(D(_e,s),p)}function zc(s,p,d){let b=0,S;u()===162?(S=St(),b|=2048):(S=Xn(),S.text=Mr(S.text));let N;u()===19?N=qc():Qt();let H=h.createModuleDeclaration(d,S,N,b);return Ce(D(H,s),p)}function np(s,p,d){let b=0;if(u()===162)return zc(s,p,d);if(Je(145))b|=32;else if(j(144),u()===11)return zc(s,p,d);return W_(s,p,d,b)}function rp(){return u()===149&&G(Fc)}function Fc(){return U()===21}function Vc(){return U()===19}function G_(){return U()===44}function ip(s,p,d){j(130),j(145);let b=St();Qt();let S=h.createNamespaceExportDeclaration(b);return S.modifiers=d,Ce(D(S,s),p)}function ap(s,p,d){j(102);let b=t.getTokenFullStart(),S;ve()&&(S=St());let N=!1;if((S==null?void 0:S.escapedText)==="type"&&(u()!==161||ve()&&G(Bu))&&(ve()||sp())&&(N=!0,S=ve()?St():void 0),S&&!zr())return op(s,p,d,S,N);let H=si(S,b,N),_e=Ri(),Z=Wc();Qt();let ee=h.createImportDeclaration(d,H,_e,Z);return Ce(D(ee,s),p)}function si(s,p,d,b=!1){let S;return(s||u()===42||u()===19)&&(S=cp(s,p,d,b),j(161)),S}function Wc(){let s=u();if((s===118||s===132)&&!t.hasPrecedingLineBreak())return Y_(s)}function _p(){let s=J(),p=wt(u())?jt():ri(11);j(59);let d=zt(!0);return D(h.createImportAttribute(p,d),s)}function Y_(s,p){let d=J();p||j(s);let b=t.getTokenStart();if(j(19)){let S=t.hasPrecedingLineBreak(),N=fn(24,_p,!0);if(!j(20)){let H=Yi(_t);H&&H.code===E._0_expected.code&&rl(H,Oa(Mt,Qe,b,1,E.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}return D(h.createImportAttributes(N,S,s),d)}else{let S=Ct([],J(),void 0,!1);return D(h.createImportAttributes(S,!1,s),d)}}function sp(){return u()===42||u()===19}function zr(){return u()===28||u()===161}function op(s,p,d,b,S){j(64);let N=lp();Qt();let H=h.createImportEqualsDeclaration(d,S,b,N);return Ce(D(H,s),p)}function cp(s,p,d,b){let S;return(!s||Je(28))&&(b&&t.setSkipJsDocLeadingAsterisks(!0),S=u()===42?up():Gc(275),b&&t.setSkipJsDocLeadingAsterisks(!1)),D(h.createImportClause(d,s,S),p)}function lp(){return rp()?ji():jr(!1)}function ji(){let s=J();j(149),j(21);let p=Ri();return j(22),D(h.createExternalModuleReference(p),s)}function Ri(){if(u()===11){let s=Xn();return s.text=Mr(s.text),s}else return Et()}function up(){let s=J();j(42),j(130);let p=St();return D(h.createNamespaceImport(p),s)}function X_(){return wt(u())||u()===11}function oi(s){return u()===11?Xn():s()}function Gc(s){let p=J(),d=s===275?h.createNamedImports(Lr(23,ci,19,20)):h.createNamedExports(Lr(23,pp,19,20));return D(d,p)}function pp(){let s=qe();return Ce(Yc(281),s)}function ci(){return Yc(276)}function Yc(s){let p=J(),d=di(u())&&!ve(),b=t.getTokenStart(),S=t.getTokenEnd(),N=!1,H,_e=!0,Z=oi(jt);if(Z.kind===80&&Z.escapedText==="type")if(u()===130){let Le=jt();if(u()===130){let je=jt();X_()?(N=!0,H=Le,Z=oi(ce),_e=!1):(H=Z,Z=je,_e=!1)}else X_()?(H=Z,_e=!1,Z=oi(ce)):(N=!0,Z=Le)}else X_()&&(N=!0,Z=oi(ce));_e&&u()===130&&(H=Z,j(130),Z=oi(ce)),s===276&&(Z.kind!==80?(rt(Ar(Qe,Z.pos),Z.end,E.Identifier_expected),Z=yi(Gt(80,!1),Z.pos,Z.pos)):d&&rt(b,S,E.Identifier_expected));let ee=s===276?h.createImportSpecifier(N,H,Z):h.createExportSpecifier(N,H,Z);return D(ee,p);function ce(){return d=di(u())&&!ve(),b=t.getTokenStart(),S=t.getTokenEnd(),jt()}}function fp(s){return D(h.createNamespaceExport(oi(jt)),s)}function dp(s,p,d){let b=Ye();st(!0);let S,N,H,_e=Je(156),Z=J();Je(42)?(Je(130)&&(S=fp(Z)),j(161),N=Ri()):(S=Gc(279),(u()===161||u()===11&&!t.hasPrecedingLineBreak())&&(j(161),N=Ri()));let ee=u();N&&(ee===118||ee===132)&&!t.hasPrecedingLineBreak()&&(H=Y_(ee)),Qt(),st(b);let ce=h.createExportDeclaration(d,_e,S,N,H);return Ce(D(ce,s),p)}function Xc(s,p,d){let b=Ye();st(!0);let S;Je(64)?S=!0:j(90);let N=zt(!0);Qt(),st(b);let H=h.createExportAssignment(d,S,N);return Ce(D(H,s),p)}let H_;(s=>{s[s.SourceElements=0]="SourceElements",s[s.BlockStatements=1]="BlockStatements",s[s.SwitchClauses=2]="SwitchClauses",s[s.SwitchClauseStatements=3]="SwitchClauseStatements",s[s.TypeMembers=4]="TypeMembers",s[s.ClassMembers=5]="ClassMembers",s[s.EnumMembers=6]="EnumMembers",s[s.HeritageClauseElement=7]="HeritageClauseElement",s[s.VariableDeclarations=8]="VariableDeclarations",s[s.ObjectBindingElements=9]="ObjectBindingElements",s[s.ArrayBindingElements=10]="ArrayBindingElements",s[s.ArgumentExpressions=11]="ArgumentExpressions",s[s.ObjectLiteralMembers=12]="ObjectLiteralMembers",s[s.JsxAttributes=13]="JsxAttributes",s[s.JsxChildren=14]="JsxChildren",s[s.ArrayLiteralMembers=15]="ArrayLiteralMembers",s[s.Parameters=16]="Parameters",s[s.JSDocParameters=17]="JSDocParameters",s[s.RestProperties=18]="RestProperties",s[s.TypeParameters=19]="TypeParameters",s[s.TypeArguments=20]="TypeArguments",s[s.TupleElementTypes=21]="TupleElementTypes",s[s.HeritageClauses=22]="HeritageClauses",s[s.ImportOrExportSpecifiers=23]="ImportOrExportSpecifiers",s[s.ImportAttributes=24]="ImportAttributes",s[s.JSDocComment=25]="JSDocComment",s[s.Count=26]="Count"})(H_||(H_={}));let $_;(s=>{s[s.False=0]="False",s[s.True=1]="True",s[s.Unknown=2]="Unknown"})($_||($_={}));let Hc;(s=>{function p(ee,ce,Le){zn("file.js",ee,99,void 0,1,0),t.setText(ee,ce,Le),lt=t.scan();let je=d(),Ae=se("file.js",99,1,!1,[],ye(1),0,Fa),Yt=zi(_t,Ae);return Ut&&(Ae.jsDocDiagnostics=zi(Ut,Ae)),Fn(),je?{jsDocTypeExpression:je,diagnostics:Yt}:void 0}s.parseJSDocTypeExpressionForTests=p;function d(ee){let ce=J(),Le=(ee?Je:j)(19),je=Tt(16777216,l_);(!ee||Le)&&Es(20);let Ae=h.createJSDocTypeExpression(je);return L(Ae),D(Ae,ce)}s.parseJSDocTypeExpression=d;function b(){let ee=J(),ce=Je(19),Le=J(),je=jr(!1);for(;u()===81;)Nt(),ze(),je=D(h.createJSDocMemberName(je,St()),Le);ce&&Es(20);let Ae=h.createJSDocNameReference(je);return L(Ae),D(Ae,ee)}s.parseJSDocNameReference=b;function S(ee,ce,Le){zn("",ee,99,void 0,1,0);let je=Tt(16777216,()=>Z(ce,Le)),Yt=zi(_t,{languageVariant:0,text:ee});return Fn(),je?{jsDoc:je,diagnostics:Yt}:void 0}s.parseIsolatedJSDocComment=S;function N(ee,ce,Le){let je=lt,Ae=_t.length,Yt=rn,mn=Tt(16777216,()=>Z(ce,Le));return wf(mn,ee),nt&524288&&(Ut||(Ut=[]),Dn(Ut,_t,Ae)),lt=je,_t.length=Ae,rn=Yt,mn}s.parseJSDocComment=N;let H;(ee=>{ee[ee.BeginningOfLine=0]="BeginningOfLine",ee[ee.SawAsterisk=1]="SawAsterisk",ee[ee.SavingComments=2]="SavingComments",ee[ee.SavingBackticks=3]="SavingBackticks"})(H||(H={}));let _e;(ee=>{ee[ee.Property=1]="Property",ee[ee.Parameter=2]="Parameter",ee[ee.CallbackParameter=4]="CallbackParameter"})(_e||(_e={}));function Z(ee=0,ce){let Le=Qe,je=ce===void 0?Le.length:ee+ce;if(ce=je-ee,B.assert(ee>=0),B.assert(ee<=je),B.assert(je<=Le.length),!D6(Le,ee))return;let Ae,Yt,mn,Zt,ur,Ln=[],Fr=[],mp=yt;yt|=1<<25;let De=t.scanRange(ee+3,ce-5,et);return yt=mp,De;function et(){let O=1,Y,X=ee-(Le.lastIndexOf(` +`,ee)+1)+4;function te(Ue){Y||(Y=X),Ln.push(Ue),X+=Ue.length}for(ze();Bi(5););Bi(4)&&(O=0,X=0);e:for(;;){switch(u()){case 60:Da(Ln),ur||(ur=J()),pe(q(X)),O=0,Y=void 0;break;case 4:Ln.push(t.getTokenText()),O=0,X=0;break;case 42:let Ue=t.getTokenText();O===1?(O=2,te(Ue)):(B.assert(O===0),O=1,X+=Ue.length);break;case 5:B.assert(O!==2,"whitespace shouldn't come from the scanner while saving top-level comment text");let pt=t.getTokenText();Y!==void 0&&X+pt.length>Y&&Ln.push(pt.slice(Y-X)),X+=pt.length;break;case 1:break e;case 82:O=2,te(t.getTokenValue());break;case 19:O=2;let hn=t.getTokenFullStart(),sn=t.getTokenEnd()-1,tn=_(sn);if(tn){Zt||pr(Ln),Fr.push(D(h.createJSDocText(Ln.join("")),Zt??ee,hn)),Fr.push(tn),Ln=[],Zt=t.getTokenEnd();break}default:O=2,te(t.getTokenText());break}O===2?an(!1):ze()}let ne=Ln.join("").trimEnd();Fr.length&&ne.length&&Fr.push(D(h.createJSDocText(ne),Zt??ee,ur)),Fr.length&&Ae&&B.assertIsDefined(ur,"having parsed tags implies that the end of the comment span should be set");let Pe=Ae&&Ct(Ae,Yt,mn);return D(h.createJSDocComment(Fr.length?Ct(Fr,ee,ur):ne.length?ne:void 0,Pe),ee,je)}function pr(O){for(;O.length&&(O[0]===` +`||O[0]==="\r");)O.shift()}function Da(O){for(;O.length;){let Y=O[O.length-1].trimEnd();if(Y==="")O.pop();else if(Y.lengthpt&&(te.push(Qn.slice(pt-O)),Ue=2),O+=Qn.length;break;case 19:Ue=2;let Qc=t.getTokenFullStart(),Na=t.getTokenEnd()-1,Kc=_(Na);Kc?(ne.push(D(h.createJSDocText(te.join("")),Pe??X,Qc)),ne.push(Kc),te=[],Pe=t.getTokenEnd()):hn(t.getTokenText());break;case 62:Ue===3?Ue=2:Ue=3,hn(t.getTokenText());break;case 82:Ue!==3&&(Ue=2),hn(t.getTokenValue());break;case 42:if(Ue===0){Ue=1,O+=1;break}default:Ue!==3&&(Ue=2),hn(t.getTokenText());break}Ue===2||Ue===3?sn=an(Ue===3):sn=ze()}pr(te);let tn=te.join("").trimEnd();if(ne.length)return tn.length&&ne.push(D(h.createJSDocText(tn),Pe??X)),Ct(ne,X,t.getTokenEnd());if(tn.length)return tn}function _(O){let Y=le(f);if(!Y)return;ze(),It();let X=c(),te=[];for(;u()!==20&&u()!==4&&u()!==1;)te.push(t.getTokenText()),ze();let ne=Y==="link"?h.createJSDocLink:Y==="linkcode"?h.createJSDocLinkCode:h.createJSDocLinkPlain;return D(ne(X,te.join("")),O,t.getTokenEnd())}function c(){if(wt(u())){let O=J(),Y=jt();for(;Je(25);)Y=D(h.createQualifiedName(Y,u()===81?Gt(80,!1):jt()),O);for(;u()===81;)Nt(),ze(),Y=D(h.createJSDocMemberName(Y,St()),O);return Y}}function f(){if(xr(),u()===19&&ze()===60&&wt(ze())){let O=t.getTokenValue();if(w(O))return O}}function w(O){return O==="link"||O==="linkcode"||O==="linkplain"}function F(O,Y,X,te){return D(h.createJSDocUnknownTag(Y,n(O,J(),X,te)),O)}function pe(O){O&&(Ae?Ae.push(O):(Ae=[O],Yt=O.pos),mn=O.end)}function Re(){return xr(),u()===19?d():void 0}function en(){let O=Bi(23);O&&It();let Y=Bi(62),X=H0();return Y&&zl(62),O&&(It(),ft(64)&&Et(),j(24)),{name:X,isBracketed:O}}function kn(O){switch(O.kind){case 151:return!0;case 188:return kn(O.elementType);default:return Pf(O)&&tt(O.typeName)&&O.typeName.escapedText==="Object"&&!O.typeArguments}}function $n(O,Y,X,te){let ne=Re(),Pe=!ne;xr();let{name:Ue,isBracketed:pt}=en(),hn=xr();Pe&&!G(f)&&(ne=Re());let sn=n(O,J(),te,hn),tn=Pa(ne,Ue,X,te);tn&&(ne=tn,Pe=!0);let Qn=X===1?h.createJSDocPropertyTag(Y,Ue,pt,ne,Pe,sn):h.createJSDocParameterTag(Y,Ue,pt,ne,Pe,sn);return D(Qn,O)}function Pa(O,Y,X,te){if(O&&kn(O.type)){let ne=J(),Pe,Ue;for(;Pe=le(()=>yp(X,te,Y));)Pe.kind===341||Pe.kind===348?Ue=An(Ue,Pe):Pe.kind===345&&ln(Pe.tagName,E.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);if(Ue){let pt=D(h.createJSDocTypeLiteral(Ue,O.type.kind===188),ne);return D(h.createJSDocTypeExpression(pt),ne)}}}function D0(O,Y,X,te){Xt(Ae,h6)&&rt(Y.pos,t.getTokenStart(),E._0_tag_already_specified,cs(Y.escapedText));let ne=Re();return D(h.createJSDocReturnTag(Y,ne,n(O,J(),X,te)),O)}function md(O,Y,X,te){Xt(Ae,Vf)&&rt(Y.pos,t.getTokenStart(),E._0_tag_already_specified,cs(Y.escapedText));let ne=d(!0),Pe=X!==void 0&&te!==void 0?n(O,J(),X,te):void 0;return D(h.createJSDocTypeTag(Y,ne,Pe),O)}function P0(O,Y,X,te){let Pe=u()===23||G(()=>ze()===60&&wt(ze())&&w(t.getTokenValue()))?void 0:b(),Ue=X!==void 0&&te!==void 0?n(O,J(),X,te):void 0;return D(h.createJSDocSeeTag(Y,Pe,Ue),O)}function N0(O,Y,X,te){let ne=Re(),Pe=n(O,J(),X,te);return D(h.createJSDocThrowsTag(Y,ne,Pe),O)}function I0(O,Y,X,te){let ne=J(),Pe=O0(),Ue=t.getTokenFullStart(),pt=n(O,Ue,X,te);pt||(Ue=t.getTokenFullStart());let hn=typeof pt!="string"?Ct(Xp([D(Pe,ne,Ue)],pt),ne):Pe.text+pt;return D(h.createJSDocAuthorTag(Y,hn),O)}function O0(){let O=[],Y=!1,X=t.getToken();for(;X!==1&&X!==4;){if(X===30)Y=!0;else{if(X===60&&!Y)break;if(X===32&&Y){O.push(t.getTokenText()),t.resetTokenState(t.getTokenEnd());break}}O.push(t.getTokenText()),X=ze()}return h.createJSDocText(O.join(""))}function M0(O,Y,X,te){let ne=hd();return D(h.createJSDocImplementsTag(Y,ne,n(O,J(),X,te)),O)}function J0(O,Y,X,te){let ne=hd();return D(h.createJSDocAugmentsTag(Y,ne,n(O,J(),X,te)),O)}function L0(O,Y,X,te){let ne=d(!1),Pe=X!==void 0&&te!==void 0?n(O,J(),X,te):void 0;return D(h.createJSDocSatisfiesTag(Y,ne,Pe),O)}function j0(O,Y,X,te){let ne=t.getTokenFullStart(),Pe;ve()&&(Pe=St());let Ue=si(Pe,ne,!0,!0),pt=Ri(),hn=Wc(),sn=X!==void 0&&te!==void 0?n(O,J(),X,te):void 0;return D(h.createJSDocImportTag(Y,Ue,pt,hn,sn),O)}function hd(){let O=Je(19),Y=J(),X=R0();t.setSkipJsDocLeadingAsterisks(!0);let te=Ca();t.setSkipJsDocLeadingAsterisks(!1);let ne=h.createExpressionWithTypeArguments(X,te),Pe=D(ne,Y);return O&&j(20),Pe}function R0(){let O=J(),Y=li();for(;Je(25);){let X=li();Y=D(ae(Y,X),O)}return Y}function Ui(O,Y,X,te,ne){return D(Y(X,n(O,J(),te,ne)),O)}function yd(O,Y,X,te){let ne=d(!0);return It(),D(h.createJSDocThisTag(Y,ne,n(O,J(),X,te)),O)}function U0(O,Y,X,te){let ne=d(!0);return It(),D(h.createJSDocEnumTag(Y,ne,n(O,J(),X,te)),O)}function B0(O,Y,X,te){let ne=Re();xr();let Pe=hp();It();let Ue=i(X),pt;if(!ne||kn(ne.type)){let sn,tn,Qn,Qc=!1;for(;(sn=le(()=>W0(X)))&&sn.kind!==345;)if(Qc=!0,sn.kind===344)if(tn){let Na=Ee(E.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);Na&&rl(Na,Oa(Mt,Qe,0,0,E.The_tag_was_first_specified_here));break}else tn=sn;else Qn=An(Qn,sn);if(Qc){let Na=ne&&ne.type.kind===188,Kc=h.createJSDocTypeLiteral(Qn,Na);ne=tn&&tn.typeExpression&&!kn(tn.typeExpression.type)?tn.typeExpression:D(Kc,O),pt=ne.end}}pt=pt||Ue!==void 0?J():(Pe??ne??Y).end,Ue||(Ue=n(O,pt,X,te));let hn=h.createJSDocTypedefTag(Y,ne,Pe,Ue);return D(hn,O,pt)}function hp(O){let Y=t.getTokenStart();if(!wt(u()))return;let X=li();if(Je(25)){let te=hp(!0),ne=h.createModuleDeclaration(void 0,X,te,O?8:void 0);return D(ne,Y)}return O&&(X.flags|=4096),X}function q0(O){let Y=J(),X,te;for(;X=le(()=>yp(4,O));){if(X.kind===345){ln(X.tagName,E.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);break}te=An(te,X)}return Ct(te||[],Y)}function gd(O,Y){let X=q0(Y),te=le(()=>{if(Bi(60)){let ne=q(Y);if(ne&&ne.kind===342)return ne}});return D(h.createJSDocSignature(void 0,X,te),O)}function z0(O,Y,X,te){let ne=hp();It();let Pe=i(X),Ue=gd(O,X);Pe||(Pe=n(O,J(),X,te));let pt=Pe!==void 0?J():Ue.end;return D(h.createJSDocCallbackTag(Y,Ue,ne,Pe),O,pt)}function F0(O,Y,X,te){It();let ne=i(X),Pe=gd(O,X);ne||(ne=n(O,J(),X,te));let Ue=ne!==void 0?J():Pe.end;return D(h.createJSDocOverloadTag(Y,Pe,ne),O,Ue)}function V0(O,Y){for(;!tt(O)||!tt(Y);)if(!tt(O)&&!tt(Y)&&O.right.escapedText===Y.right.escapedText)O=O.left,Y=Y.left;else return!1;return O.escapedText===Y.escapedText}function W0(O){return yp(1,O)}function yp(O,Y,X){let te=!0,ne=!1;for(;;)switch(ze()){case 60:if(te){let Pe=G0(O,Y);return Pe&&(Pe.kind===341||Pe.kind===348)&&X&&(tt(Pe.name)||!V0(X,Pe.name.left))?!1:Pe}ne=!1;break;case 4:te=!0,ne=!1;break;case 42:ne&&(te=!1),ne=!0;break;case 80:te=!1;break;case 1:return!1}}function G0(O,Y){B.assert(u()===60);let X=t.getTokenFullStart();ze();let te=li(),ne=xr(),Pe;switch(te.escapedText){case"type":return O===1&&md(X,te);case"prop":case"property":Pe=1;break;case"arg":case"argument":case"param":Pe=6;break;case"template":return bd(X,te,Y,ne);case"this":return yd(X,te,Y,ne);default:return!1}return O&Pe?$n(X,te,O,Y):!1}function Y0(){let O=J(),Y=Bi(23);Y&&It();let X=wn(!1,!0),te=li(E.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces),ne;if(Y&&(It(),j(64),ne=Tt(16777216,l_),j(24)),!Hi(te))return D(h.createTypeParameterDeclaration(X,te,void 0,ne),O)}function X0(){let O=J(),Y=[];do{It();let X=Y0();X!==void 0&&Y.push(X),xr()}while(Bi(28));return Ct(Y,O)}function bd(O,Y,X,te){let ne=u()===19?d():void 0,Pe=X0();return D(h.createJSDocTemplateTag(Y,ne,Pe,n(O,J(),X,te)),O)}function Bi(O){return u()===O?(ze(),!0):!1}function H0(){let O=li();for(Je(23)&&j(24);Je(25);){let Y=li();Je(23)&&j(24),O=Hl(O,Y)}return O}function li(O){if(!wt(u()))return Gt(80,!O,O||E.Identifier_expected);vn++;let Y=t.getTokenStart(),X=t.getTokenEnd(),te=u(),ne=Mr(t.getTokenValue()),Pe=D(re(ne,te),Y,X);return ze(),Pe}}})(Hc=e.JSDocParser||(e.JSDocParser={}))})(Qi||(Qi={}));var Tm=new WeakSet;function U6(e){Tm.has(e)&&B.fail("Source file has already been incrementally parsed"),Tm.add(e)}var mh=new WeakSet;function B6(e){return mh.has(e)}function Gp(e){mh.add(e)}var Tl;(e=>{function t(x,I,re,he){if(he=he||B.shouldAssert(2),h(x,I,re,he),yg(re))return x;if(x.statements.length===0)return Qi.parseSourceFile(x.fileName,I,x.languageVersion,void 0,!0,x.scriptKind,x.setExternalModuleIndicator,x.jsDocParsingMode);U6(x),Qi.fixupParentReferences(x);let ye=x.text,de=y(x),M=l(x,re);h(x,I,M,he),B.assert(M.span.start<=re.span.start),B.assert(wr(M.span)===wr(re.span)),B.assert(wr(K_(M))===wr(K_(re)));let ae=K_(M).length-M.span.length;P(x,M.span.start,wr(M.span),wr(K_(M)),ae,ye,I,he);let Oe=Qi.parseSourceFile(x.fileName,I,x.languageVersion,de,!0,x.scriptKind,x.setExternalModuleIndicator,x.jsDocParsingMode);return Oe.commentDirectives=a(x.commentDirectives,Oe.commentDirectives,M.span.start,wr(M.span),ae,ye,I,he),Oe.impliedNodeFormat=x.impliedNodeFormat,v6(x,Oe),Oe}e.updateSourceFile=t;function a(x,I,re,he,ye,de,M,ae){if(!x)return I;let Oe,V=!1;for(let W of x){let{range:dt,type:nr}=W;if(dt.endhe){oe();let gn={range:{pos:dt.pos+ye,end:dt.end+ye},type:nr};Oe=An(Oe,gn),ae&&B.assert(de.substring(dt.pos,dt.end)===M.substring(gn.range.pos,gn.range.end))}}return oe(),Oe;function oe(){V||(V=!0,Oe?I&&Oe.push(...I):Oe=I)}}function o(x,I,re,he,ye,de,M){re?Oe(x):ae(x);return;function ae(V){let oe="";if(M&&m(V)&&(oe=ye.substring(V.pos,V.end)),Qd(V,I),yi(V,V.pos+he,V.end+he),M&&m(V)&&B.assert(oe===de.substring(V.pos,V.end)),Ht(V,ae,Oe),Xi(V))for(let W of V.jsDoc)ae(W);A(V,M)}function Oe(V){yi(V,V.pos+he,V.end+he);for(let oe of V)ae(oe)}}function m(x){switch(x.kind){case 11:case 9:case 80:return!0}return!1}function v(x,I,re,he,ye){B.assert(x.end>=I,"Adjusting an element that was entirely before the change range"),B.assert(x.pos<=re,"Adjusting an element that was entirely after the change range"),B.assert(x.pos<=x.end);let de=Math.min(x.pos,he),M=x.end>=re?x.end+ye:Math.min(x.end,he);if(B.assert(de<=M),x.parent){let ae=x.parent;B.assertGreaterThanOrEqual(de,ae.pos),B.assertLessThanOrEqual(M,ae.end)}yi(x,de,M)}function A(x,I){if(I){let re=x.pos,he=ye=>{B.assert(ye.pos>=re),re=ye.end};if(Xi(x))for(let ye of x.jsDoc)he(ye);Ht(x,he),B.assert(re<=x.end)}}function P(x,I,re,he,ye,de,M,ae){Oe(x);return;function Oe(oe){if(B.assert(oe.pos<=oe.end),oe.pos>re){o(oe,x,!1,ye,de,M,ae);return}let W=oe.end;if(W>=I){if(Gp(oe),Qd(oe,x),v(oe,I,re,he,ye),Ht(oe,Oe,V),Xi(oe))for(let dt of oe.jsDoc)Oe(dt);A(oe,ae);return}B.assert(Wre){o(oe,x,!0,ye,de,M,ae);return}let W=oe.end;if(W>=I){Gp(oe),v(oe,I,re,he,ye);for(let dt of oe)Oe(dt);return}B.assert(W0&&M<=1;M++){let ae=Q(x,he);B.assert(ae.pos<=he);let Oe=ae.pos;he=Math.max(0,Oe-1)}let ye=hg(he,wr(I.span)),de=I.newLength+(I.span.start-he);return Qm(ye,de)}function Q(x,I){let re=x,he;if(Ht(x,de),he){let M=ye(he);M.pos>re.pos&&(re=M)}return re;function ye(M){for(;;){let ae=tb(M);if(ae)M=ae;else return M}}function de(M){if(!Hi(M))if(M.pos<=I){if(M.pos>=re.pos&&(re=M),II),!0}}function h(x,I,re,he){let ye=x.text;if(re&&(B.assert(ye.length-re.span.length+re.newLength===I.length),he||B.shouldAssert(3))){let de=ye.substr(0,re.span.start),M=I.substr(0,re.span.start);B.assert(de===M);let ae=ye.substring(wr(re.span),ye.length),Oe=I.substring(wr(K_(re)),I.length);B.assert(ae===Oe)}}function y(x){let I=x.statements,re=0;B.assert(re=V.pos&&M=V.pos&&M{x[x.Value=-1]="Value"})(g||(g={}))})(Tl||(Tl={}));function q6(e){return z6(e)!==void 0}function z6(e){let t=jm(e,xb,!1);if(t)return t;if(jy(e,".ts")){let a=Lm(e),o=a.lastIndexOf(".d.");if(o>=0)return a.substring(o)}}function F6(e,t,a,o){if(e){if(e==="import")return 99;if(e==="require")return 1;o(t,a-t,E.resolution_mode_should_be_either_require_or_import)}}function V6(e,t){let a=[];for(let o of Lp(t,0)||bt){let m=t.substring(o.pos,o.end);H6(a,o,m)}e.pragmas=new Map;for(let o of a){if(e.pragmas.has(o.name)){let m=e.pragmas.get(o.name);m instanceof Array?m.push(o.args):e.pragmas.set(o.name,[m,o.args]);continue}e.pragmas.set(o.name,o.args)}}function W6(e,t){e.checkJsDirective=void 0,e.referencedFiles=[],e.typeReferenceDirectives=[],e.libReferenceDirectives=[],e.amdDependencies=[],e.hasNoDefaultLib=!1,e.pragmas.forEach((a,o)=>{switch(o){case"reference":{let m=e.referencedFiles,v=e.typeReferenceDirectives,A=e.libReferenceDirectives;Un(vp(a),P=>{let{types:l,lib:Q,path:h,["resolution-mode"]:y,preserve:g}=P.arguments,x=g==="true"?!0:void 0;if(P.arguments["no-default-lib"]==="true")e.hasNoDefaultLib=!0;else if(l){let I=F6(y,l.pos,l.end,t);v.push({pos:l.pos,end:l.end,fileName:l.value,...I?{resolutionMode:I}:{},...x?{preserve:x}:{}})}else Q?A.push({pos:Q.pos,end:Q.end,fileName:Q.value,...x?{preserve:x}:{}}):h?m.push({pos:h.pos,end:h.end,fileName:h.value,...x?{preserve:x}:{}}):t(P.range.pos,P.range.end-P.range.pos,E.Invalid_reference_directive_syntax)});break}case"amd-dependency":{e.amdDependencies=Np(vp(a),m=>({name:m.arguments.name,path:m.arguments.path}));break}case"amd-module":{if(a instanceof Array)for(let m of a)e.moduleName&&t(m.range.pos,m.range.end-m.range.pos,E.An_AMD_module_cannot_have_multiple_name_assignments),e.moduleName=m.arguments.name;else e.moduleName=a.arguments.name;break}case"ts-nocheck":case"ts-check":{Un(vp(a),m=>{(!e.checkJsDirective||m.range.pos>e.checkJsDirective.pos)&&(e.checkJsDirective={enabled:o==="ts-check",end:m.range.end,pos:m.range.pos})});break}case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:B.fail("Unhandled pragma kind")}})}var Pp=new Map;function G6(e){if(Pp.has(e))return Pp.get(e);let t=new RegExp(`(\\s${e}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`,"im");return Pp.set(e,t),t}var Y6=/^\/\/\/\s*<(\S+)\s.*?\/>/m,X6=/^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m;function H6(e,t,a){let o=t.kind===2&&Y6.exec(a);if(o){let v=o[1].toLowerCase(),A=Jm[v];if(!A||!(A.kind&1))return;if(A.args){let P={};for(let l of A.args){let h=G6(l.name).exec(a);if(!h&&!l.optional)return;if(h){let y=h[2]||h[3];if(l.captureSpan){let g=t.pos+h.index+h[1].length+1;P[l.name]={value:y,pos:g,end:g+y.length}}else P[l.name]=y}}e.push({name:v,args:{arguments:P,range:t}})}else e.push({name:v,args:{arguments:{},range:t}});return}let m=t.kind===2&&X6.exec(a);if(m)return xm(e,t,2,m);if(t.kind===3){let v=/@(\S+)(\s+(?:\S.*)?)?$/gm,A;for(;A=v.exec(a);)xm(e,t,4,A)}}function xm(e,t,a,o){if(!o)return;let m=o[1].toLowerCase(),v=Jm[m];if(!v||!(v.kind&a))return;let A=o[2],P=$6(v,A);P!=="fail"&&e.push({name:m,args:{arguments:P,range:t}})}function $6(e,t){if(!t)return{};if(!e.args)return{};let a=t.trim().split(/\s+/),o={};for(let m=0;mo.kind<309||o.kind>351);return a.kind<166?a:a.getFirstToken(e)}getLastToken(e){this.assertHasRealPosition();let t=this.getChildren(e),a=Yi(t);if(a)return a.kind<166?a:a.getLastToken(e)}forEachChild(e,t){return Ht(this,e,t)}};function Q6(e,t){let a=[];if(r2(e))return e.forEachChild(A=>{a.push(A)}),a;ss.setText((t||e.getSourceFile()).text);let o=e.pos,m=A=>{os(a,o,A.pos,e),a.push(A),o=A.end},v=A=>{os(a,o,A.pos,e),a.push(K6(A,e)),o=A.end};return Un(e.jsDoc,m),o=e.pos,e.forEachChild(m,v),os(a,o,e.end,e),ss.setText(void 0),a}function os(e,t,a,o){for(ss.resetTokenState(t);tt.tagName.text==="inheritDoc"||t.tagName.text==="inheritdoc")}function ul(e,t){if(!e)return bt;let a=ts_JsDoc_exports.getJsDocTagsFromDeclarations(e,t);if(t&&(a.length===0||e.some(vh))){let o=new Set;for(let m of e){let v=Th(t,m,A=>{var P;if(!o.has(A))return o.add(A),m.kind===177||m.kind===178?A.getContextualJsDocTags(m,t):((P=A.declarations)==null?void 0:P.length)===1?A.getJsDocTags(t):void 0});v&&(a=[...v,...a])}}return a}function _s(e,t){if(!e)return bt;let a=ts_JsDoc_exports.getJsDocCommentsFromDeclarations(e,t);if(t&&(a.length===0||e.some(vh))){let o=new Set;for(let m of e){let v=Th(t,m,A=>{if(!o.has(A))return o.add(A),m.kind===177||m.kind===178?A.getContextualDocumentationComment(m,t):A.getDocumentationComment(t)});v&&(a=a.length===0?v.slice():v.concat(lineBreakPart(),a))}}return a}function Th(e,t,a){var o;let m=((o=t.parent)==null?void 0:o.kind)===176?t.parent.parent:t.parent;if(!m)return;let v=V2(t);return _y(J2(m),A=>{let P=e.getTypeAtLocation(A),l=v&&P.symbol?e.getTypeOfSymbol(P.symbol):P,Q=e.getPropertyOfType(l,t.symbol.name);return Q?a(Q):void 0})}var nv=class extends Yf{constructor(e,t,a){super(e,t,a)}update(e,t){return R6(this,e,t)}getLineAndCharacterOfPosition(e){return Vm(this,e)}getLineStarts(){return Jp(this)}getPositionOfLineAndCharacter(e,t,a){return _g(Jp(this),e,t,this.text,a)}getLineEndOfPosition(e){let{line:t}=this.getLineAndCharacterOfPosition(e),a=this.getLineStarts(),o;t+1>=a.length&&(o=this.getEnd()),o||(o=a[t+1]-1);let m=this.getFullText();return m[o]===` +`&&m[o-1]==="\r"?o-1:o}getNamedDeclarations(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations}computeNamedDeclarations(){let e=vy();return this.forEachChild(m),e;function t(v){let A=o(v);A&&e.add(A,v)}function a(v){let A=e.get(v);return A||e.set(v,A=[]),A}function o(v){let A=uf(v);return A&&(Ef(A)&&Xr(A.expression)?A.expression.name.text:_1(A)?getNameFromPropertyName(A):void 0)}function m(v){switch(v.kind){case 262:case 218:case 174:case 173:let A=v,P=o(A);if(P){let h=a(P),y=Yi(h);y&&A.parent===y.parent&&A.symbol===y.symbol?A.body&&!y.body&&(h[h.length-1]=A):h.push(A)}Ht(v,m);break;case 263:case 231:case 264:case 265:case 266:case 267:case 271:case 281:case 276:case 273:case 274:case 177:case 178:case 187:t(v),Ht(v,m);break;case 169:if(!bs(v,31))break;case 260:case 208:{let h=v;if(Xg(h.name)){Ht(h.name,m);break}h.initializer&&m(h.initializer)}case 306:case 172:case 171:t(v);break;case 278:let l=v;l.exportClause&&(Z1(l.exportClause)?Un(l.exportClause.elements,m):m(l.exportClause.name));break;case 272:let Q=v.importClause;Q&&(Q.name&&t(Q.name),Q.namedBindings&&(Q.namedBindings.kind===274?t(Q.namedBindings):Un(Q.namedBindings.elements,m)));break;case 226:gf(v)!==0&&t(v);default:Ht(v,m)}}}},rv=class{constructor(e,t,a){this.fileName=e,this.text=t,this.skipTrivia=a||(o=>o)}getLineAndCharacterOfPosition(e){return Vm(this,e)}};function iv(){return{getNodeConstructor:()=>Yf,getTokenConstructor:()=>yh,getIdentifierConstructor:()=>gh,getPrivateIdentifierConstructor:()=>bh,getSourceFileConstructor:()=>nv,getSymbolConstructor:()=>Z6,getTypeConstructor:()=>ev,getSignatureConstructor:()=>tv,getSourceMapSourceConstructor:()=>rv}}var av=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes","getPasteEdits"],w3=[...av,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors","preparePasteEditsForFile"];lb(iv());var Ol=new Proxy({},{get:()=>!0});var Sh=Ol["4.8"];function er(e,t=!1){var a;if(e!=null){if(Sh){if(t||Il(e)){let o=e1(e);return o?[...o]:void 0}return}return(a=e.modifiers)==null?void 0:a.filter(o=>!Al(o))}}function na(e,t=!1){var a;if(e!=null){if(Sh){if(t||Gf(e)){let o=pf(e);return o?[...o]:void 0}return}return(a=e.decorators)==null?void 0:a.filter(Al)}}var kh={};var Ml=new Proxy({},{get:(e,t)=>t});var Eh=Ml,Ah=Ml;var C=Eh,Rt=Ah;var Ch=Ol["5.0"],ue=Ie,ov=new Set([ue.AmpersandAmpersandToken,ue.BarBarToken,ue.QuestionQuestionToken]),cv=new Set([Ie.AmpersandAmpersandEqualsToken,Ie.AmpersandEqualsToken,Ie.AsteriskAsteriskEqualsToken,Ie.AsteriskEqualsToken,Ie.BarBarEqualsToken,Ie.BarEqualsToken,Ie.CaretEqualsToken,Ie.EqualsToken,Ie.GreaterThanGreaterThanEqualsToken,Ie.GreaterThanGreaterThanGreaterThanEqualsToken,Ie.LessThanLessThanEqualsToken,Ie.MinusEqualsToken,Ie.PercentEqualsToken,Ie.PlusEqualsToken,Ie.QuestionQuestionEqualsToken,Ie.SlashEqualsToken]),lv=new Set([ue.AmpersandAmpersandToken,ue.AmpersandToken,ue.AsteriskAsteriskToken,ue.AsteriskToken,ue.BarBarToken,ue.BarToken,ue.CaretToken,ue.EqualsEqualsEqualsToken,ue.EqualsEqualsToken,ue.ExclamationEqualsEqualsToken,ue.ExclamationEqualsToken,ue.GreaterThanEqualsToken,ue.GreaterThanGreaterThanGreaterThanToken,ue.GreaterThanGreaterThanToken,ue.GreaterThanToken,ue.InKeyword,ue.InstanceOfKeyword,ue.LessThanEqualsToken,ue.LessThanLessThanToken,ue.LessThanToken,ue.MinusToken,ue.PercentToken,ue.PlusToken,ue.SlashToken]);function uv(e){return cv.has(e.kind)}function pv(e){return ov.has(e.kind)}function fv(e){return lv.has(e.kind)}function $r(e){return it(e)}function Dh(e){return e.kind!==ue.SemicolonClassElement}function Xe(e,t){let a=er(t);return(a==null?void 0:a.some(o=>o.kind===e))===!0}function Ph(e){let t=er(e);return t==null?null:t[t.length-1]??null}function Nh(e){return e.kind===ue.CommaToken}function dv(e){return e.kind===ue.SingleLineCommentTrivia||e.kind===ue.MultiLineCommentTrivia}function mv(e){return e.kind===ue.JSDocComment}function Ih(e){if(uv(e))return{type:C.AssignmentExpression,operator:$r(e.kind)};if(pv(e))return{type:C.LogicalExpression,operator:$r(e.kind)};if(fv(e))return{type:C.BinaryExpression,operator:$r(e.kind)};throw new Error(`Unexpected binary operator ${it(e.kind)}`)}function Ts(e,t){let a=t.getLineAndCharacterOfPosition(e);return{column:a.character,line:a.line+1}}function Qr(e,t){let[a,o]=e.map(m=>Ts(m,t));return{end:o,start:a}}function Oh(e){if(e.kind===Ie.Block)switch(e.parent.kind){case Ie.Constructor:case Ie.GetAccessor:case Ie.SetAccessor:case Ie.ArrowFunction:case Ie.FunctionExpression:case Ie.FunctionDeclaration:case Ie.MethodDeclaration:return!0;default:return!1}return!0}function $a(e,t){return[e.getStart(t),e.getEnd()]}function hv(e){return e.kind>=ue.FirstToken&&e.kind<=ue.LastToken}function Mh(e){return e.kind>=ue.JsxElement&&e.kind<=ue.JsxAttribute}function Jl(e){return e.flags&on.Let?"let":(e.flags&on.AwaitUsing)===on.AwaitUsing?"await using":e.flags&on.Const?"const":e.flags&on.Using?"using":"var"}function xi(e){let t=er(e);if(t!=null)for(let a of t)switch(a.kind){case ue.PublicKeyword:return"public";case ue.ProtectedKeyword:return"protected";case ue.PrivateKeyword:return"private";default:break}}function ra(e,t,a){return o(t);function o(m){return i1(m)&&m.pos===e.end?m:xv(m.getChildren(a),v=>(v.pos<=e.pos&&v.end>e.end||v.pos===e.end)&&Tv(v,a)?o(v):void 0)}}function yv(e,t){let a=e;for(;a;){if(t(a))return a;a=a.parent}}function gv(e){return!!yv(e,Mh)}function Kf(e){return Sr(!1,e,/&(?:#\d+|#x[\da-fA-F]+|[0-9a-zA-Z]+);/g,t=>{let a=t.slice(1,-1);if(a[0]==="#"){let o=a[1]==="x"?parseInt(a.slice(2),16):parseInt(a.slice(1),10);return o>1114111?t:String.fromCodePoint(o)}return kh[a]||t})}function ia(e){return e.kind===ue.ComputedPropertyName}function Zf(e){return!!e.questionToken}function ed(e){return e.type===C.ChainExpression}function Jh(e,t){return ed(t)&&e.expression.kind!==Ie.ParenthesizedExpression}function bv(e){let t;if(Ch&&e.kind===ue.Identifier?t=wl(e):"originalKeywordKind"in e&&(t=e.originalKeywordKind),t)return t===ue.NullKeyword?Rt.Null:t>=ue.FirstFutureReservedWord&&t<=ue.LastKeyword?Rt.Identifier:Rt.Keyword;if(e.kind>=ue.FirstKeyword&&e.kind<=ue.LastFutureReservedWord)return e.kind===ue.FalseKeyword||e.kind===ue.TrueKeyword?Rt.Boolean:Rt.Keyword;if(e.kind>=ue.FirstPunctuation&&e.kind<=ue.LastPunctuation)return Rt.Punctuator;if(e.kind>=ue.NoSubstitutionTemplateLiteral&&e.kind<=ue.TemplateTail)return Rt.Template;switch(e.kind){case ue.NumericLiteral:return Rt.Numeric;case ue.JsxText:return Rt.JSXText;case ue.StringLiteral:return e.parent.kind===ue.JsxAttribute||e.parent.kind===ue.JsxElement?Rt.JSXText:Rt.String;case ue.RegularExpressionLiteral:return Rt.RegularExpression;case ue.Identifier:case ue.ConstructorKeyword:case ue.GetKeyword:case ue.SetKeyword:default:}if(e.kind===ue.Identifier){if(Mh(e.parent))return Rt.JSXIdentifier;if(e.parent.kind===ue.PropertyAccessExpression&&gv(e))return Rt.JSXIdentifier}return Rt.Identifier}function vv(e,t){let a=e.kind===ue.JsxText?e.getFullStart():e.getStart(t),o=e.getEnd(),m=t.text.slice(a,o),v=bv(e),A=[a,o],P=Qr(A,t);return v===Rt.RegularExpression?{type:v,loc:P,range:A,regex:{flags:m.slice(m.lastIndexOf("/")+1),pattern:m.slice(1,m.lastIndexOf("/"))},value:m}:{type:v,loc:P,range:A,value:m}}function Lh(e){let t=[];function a(o){dv(o)||mv(o)||(hv(o)&&o.kind!==ue.EndOfFileToken?t.push(vv(o,e)):o.getChildren(e).forEach(a))}return a(e),t}var Qf=class extends Error{fileName;location;constructor(t,a,o){super(t),this.fileName=a,this.location=o,Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:new.target.name})}get index(){return this.location.start.offset}get lineNumber(){return this.location.start.line}get column(){return this.location.start.column}};function td(e,t,a,o=a){let[m,v]=[a,o].map(A=>{let{character:P,line:l}=t.getLineAndCharacterOfPosition(A);return{column:P,line:l+1,offset:A}});return new Qf(e,t.fileName,{end:v,start:m})}function jh(e){var t;return!!("illegalDecorators"in e&&((t=e.illegalDecorators)!=null&&t.length))}function Tv(e,t){return e.kind===ue.EndOfFileToken?!!e.jsDoc:e.getWidth(t)!==0}function xv(e,t){if(e!==void 0)for(let a=0;a=0&&e.kind!==ue.EndOfFileToken}function nd(e){return!wv(e)}function Bh(e){return lf(e.parent,hf)}function kv(e){return Xe(ue.AbstractKeyword,e)}function Ev(e){if(e.parameters.length&&!Nl(e)){let t=e.parameters[0];if(Av(t))return t}return null}function Av(e){return Rh(e.name)}function qh(e){switch(e.kind){case ue.ClassDeclaration:return!0;case ue.ClassExpression:return!0;case ue.PropertyDeclaration:{let{parent:t}=e;return!!(Wa(t)||vi(t)&&!kv(e))}case ue.GetAccessor:case ue.SetAccessor:case ue.MethodDeclaration:{let{parent:t}=e;return!!e.body&&(Wa(t)||vi(t))}case ue.Parameter:{let{parent:t}=e,a=t.parent;return!!t&&"body"in t&&!!t.body&&(t.kind===ue.Constructor||t.kind===ue.MethodDeclaration||t.kind===ue.SetAccessor)&&Ev(t)!==e&&!!a&&a.kind===ue.ClassDeclaration}}return!1}function Ll(e){switch(e.kind){case ue.Identifier:return!0;case ue.PropertyAccessExpression:case ue.ElementAccessExpression:return!(e.flags&on.OptionalChain);case ue.ParenthesizedExpression:case ue.TypeAssertionExpression:case ue.AsExpression:case ue.SatisfiesExpression:case ue.ExpressionWithTypeArguments:case ue.NonNullExpression:return Ll(e.expression);default:return!1}}function zh(e){let t=er(e),a=e;for(;(!t||t.length===0)&&Ti(a.parent);){let o=er(a.parent);o!=null&&o.length&&(t=o),a=a.parent}return t}var T=Ie;function _d(e){return td("message"in e&&e.message||e.messageText,e.file,e.start)}var me,id,Fh,Be,Vt,Qa,ad,jl=class{constructor(t,a){gp(this,me);qi(this,"allowPattern",!1);qi(this,"ast");qi(this,"esTreeNodeToTSNodeMap",new WeakMap);qi(this,"options");qi(this,"tsNodeToESTreeNodeMap",new WeakMap);this.ast=t,this.options={...a}}assertModuleSpecifier(t,a){var o;!a&&t.moduleSpecifier==null&&ge(this,me,Vt).call(this,t,"Module specifier must be a string literal."),t.moduleSpecifier&&((o=t.moduleSpecifier)==null?void 0:o.kind)!==T.StringLiteral&&ge(this,me,Vt).call(this,t.moduleSpecifier,"Module specifier must be a string literal.")}convertBindingNameWithTypeAnnotation(t,a,o){let m=this.convertPattern(t);return a&&(m.typeAnnotation=this.convertTypeAnnotation(a,o),this.fixParentLocation(m,m.typeAnnotation.range)),m}convertBodyExpressions(t,a){let o=Oh(a);return t.map(m=>{let v=this.convertChild(m);if(o){if(v!=null&&v.expression&&Dl(m)&&Ya(m.expression)){let A=v.expression.raw;return v.directive=A.slice(1,-1),v}o=!1}return v}).filter(m=>m)}convertChainExpression(t,a){let{child:o,isOptional:m}=t.type===C.MemberExpression?{child:t.object,isOptional:t.optional}:t.type===C.CallExpression?{child:t.callee,isOptional:t.optional}:{child:t.expression,isOptional:!1},v=Jh(a,o);if(!v&&!m)return t;if(v&&ed(o)){let A=o.expression;t.type===C.MemberExpression?t.object=A:t.type===C.CallExpression?t.callee=A:t.expression=A}return this.createNode(a,{type:C.ChainExpression,expression:t})}convertChild(t,a){return this.converter(t,a,!1)}convertPattern(t,a){return this.converter(t,a,!0)}convertTypeAnnotation(t,a){let o=(a==null?void 0:a.kind)===T.FunctionType||(a==null?void 0:a.kind)===T.ConstructorType?2:1,v=[t.getFullStart()-o,t.end],A=Qr(v,this.ast);return{type:C.TSTypeAnnotation,loc:A,range:v,typeAnnotation:this.convertChild(t)}}convertTypeArgumentsToTypeParameterInstantiation(t,a){let o=ra(t,this.ast,this.ast);return this.createNode(a,{type:C.TSTypeParameterInstantiation,range:[t.pos-1,o.end],params:t.map(m=>this.convertChild(m))})}convertTSTypeParametersToTypeParametersDeclaration(t){let a=ra(t,this.ast,this.ast),o=[t.pos-1,a.end];return{type:C.TSTypeParameterDeclaration,loc:Qr(o,this.ast),range:o,params:t.map(m=>this.convertChild(m))}}convertParameters(t){return t!=null&&t.length?t.map(a=>{var m;let o=this.convertChild(a);return o.decorators=((m=na(a))==null?void 0:m.map(v=>this.convertChild(v)))??[],o}):[]}converter(t,a,o){if(!t)return null;ge(this,me,Fh).call(this,t);let m=this.allowPattern;o!=null&&(this.allowPattern=o);let v=this.convertNode(t,a??t.parent);return this.registerTSNodeInNodeMap(t,v),this.allowPattern=m,v}convertImportAttributes(t){return t==null?[]:t.elements.map(a=>this.convertChild(a))}convertJSXIdentifier(t){let a=this.createNode(t,{type:C.JSXIdentifier,name:t.getText()});return this.registerTSNodeInNodeMap(t,a),a}convertJSXNamespaceOrIdentifier(t){if(t.kind===Ie.JsxNamespacedName){let m=this.createNode(t,{type:C.JSXNamespacedName,name:this.createNode(t.name,{type:C.JSXIdentifier,name:t.name.text}),namespace:this.createNode(t.namespace,{type:C.JSXIdentifier,name:t.namespace.text})});return this.registerTSNodeInNodeMap(t,m),m}let a=t.getText(),o=a.indexOf(":");if(o>0){let m=$a(t,this.ast),v=this.createNode(t,{type:C.JSXNamespacedName,range:m,name:this.createNode(t,{type:C.JSXIdentifier,range:[m[0]+o+1,m[1]],name:a.slice(o+1)}),namespace:this.createNode(t,{type:C.JSXIdentifier,range:[m[0],m[0]+o],name:a.slice(0,o)})});return this.registerTSNodeInNodeMap(t,v),v}return this.convertJSXIdentifier(t)}convertJSXTagName(t,a){let o;switch(t.kind){case T.PropertyAccessExpression:t.name.kind===T.PrivateIdentifier&&ge(this,me,Be).call(this,t.name,"Non-private identifier expected."),o=this.createNode(t,{type:C.JSXMemberExpression,object:this.convertJSXTagName(t.expression,a),property:this.convertJSXIdentifier(t.name)});break;case T.ThisKeyword:case T.Identifier:default:return this.convertJSXNamespaceOrIdentifier(t)}return this.registerTSNodeInNodeMap(t,o),o}convertMethodSignature(t){return this.createNode(t,{type:C.TSMethodSignature,accessibility:xi(t),computed:ia(t.name),key:this.convertChild(t.name),kind:(()=>{switch(t.kind){case T.GetAccessor:return"get";case T.SetAccessor:return"set";case T.MethodSignature:return"method"}})(),optional:Zf(t),params:this.convertParameters(t.parameters),readonly:Xe(T.ReadonlyKeyword,t),returnType:t.type&&this.convertTypeAnnotation(t.type,t),static:Xe(T.StaticKeyword,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)})}fixParentLocation(t,a){a[0]t.range[1]&&(t.range[1]=a[1],t.loc.end=Ts(t.range[1],this.ast))}convertNode(t,a){var o,m,v,A,P,l,Q,h;switch(t.kind){case T.SourceFile:return this.createNode(t,{type:C.Program,range:[t.getStart(this.ast),t.endOfFileToken.end],body:this.convertBodyExpressions(t.statements,t),comments:void 0,sourceType:t.externalModuleIndicator?"module":"script",tokens:void 0});case T.Block:return this.createNode(t,{type:C.BlockStatement,body:this.convertBodyExpressions(t.statements,t)});case T.Identifier:return Uh(t)?this.createNode(t,{type:C.ThisExpression}):this.createNode(t,{type:C.Identifier,decorators:[],name:t.text,optional:!1,typeAnnotation:void 0});case T.PrivateIdentifier:return this.createNode(t,{type:C.PrivateIdentifier,name:t.text.slice(1)});case T.WithStatement:return this.createNode(t,{type:C.WithStatement,body:this.convertChild(t.statement),object:this.convertChild(t.expression)});case T.ReturnStatement:return this.createNode(t,{type:C.ReturnStatement,argument:this.convertChild(t.expression)});case T.LabeledStatement:return this.createNode(t,{type:C.LabeledStatement,body:this.convertChild(t.statement),label:this.convertChild(t.label)});case T.ContinueStatement:return this.createNode(t,{type:C.ContinueStatement,label:this.convertChild(t.label)});case T.BreakStatement:return this.createNode(t,{type:C.BreakStatement,label:this.convertChild(t.label)});case T.IfStatement:return this.createNode(t,{type:C.IfStatement,alternate:this.convertChild(t.elseStatement),consequent:this.convertChild(t.thenStatement),test:this.convertChild(t.expression)});case T.SwitchStatement:return t.caseBlock.clauses.filter(y=>y.kind===T.DefaultClause).length>1&&ge(this,me,Be).call(this,t,"A 'default' clause cannot appear more than once in a 'switch' statement."),this.createNode(t,{type:C.SwitchStatement,cases:t.caseBlock.clauses.map(y=>this.convertChild(y)),discriminant:this.convertChild(t.expression)});case T.CaseClause:case T.DefaultClause:return this.createNode(t,{type:C.SwitchCase,consequent:t.statements.map(y=>this.convertChild(y)),test:t.kind===T.CaseClause?this.convertChild(t.expression):null});case T.ThrowStatement:return t.expression.end===t.expression.pos&&ge(this,me,Vt).call(this,t,"A throw statement must throw an expression."),this.createNode(t,{type:C.ThrowStatement,argument:this.convertChild(t.expression)});case T.TryStatement:return this.createNode(t,{type:C.TryStatement,block:this.convertChild(t.tryBlock),finalizer:this.convertChild(t.finallyBlock),handler:this.convertChild(t.catchClause)});case T.CatchClause:return(o=t.variableDeclaration)!=null&&o.initializer&&ge(this,me,Be).call(this,t.variableDeclaration.initializer,"Catch clause variable cannot have an initializer."),this.createNode(t,{type:C.CatchClause,body:this.convertChild(t.block),param:t.variableDeclaration?this.convertBindingNameWithTypeAnnotation(t.variableDeclaration.name,t.variableDeclaration.type):null});case T.WhileStatement:return this.createNode(t,{type:C.WhileStatement,body:this.convertChild(t.statement),test:this.convertChild(t.expression)});case T.DoStatement:return this.createNode(t,{type:C.DoWhileStatement,body:this.convertChild(t.statement),test:this.convertChild(t.expression)});case T.ForStatement:return this.createNode(t,{type:C.ForStatement,body:this.convertChild(t.statement),init:this.convertChild(t.initializer),test:this.convertChild(t.condition),update:this.convertChild(t.incrementor)});case T.ForInStatement:return ge(this,me,id).call(this,t.initializer,t.kind),this.createNode(t,{type:C.ForInStatement,body:this.convertChild(t.statement),left:this.convertPattern(t.initializer),right:this.convertChild(t.expression)});case T.ForOfStatement:return ge(this,me,id).call(this,t.initializer,t.kind),this.createNode(t,{type:C.ForOfStatement,await:!!(t.awaitModifier&&t.awaitModifier.kind===T.AwaitKeyword),body:this.convertChild(t.statement),left:this.convertPattern(t.initializer),right:this.convertChild(t.expression)});case T.FunctionDeclaration:{let y=Xe(T.DeclareKeyword,t),g=Xe(T.AsyncKeyword,t),x=!!t.asteriskToken;y?t.body?ge(this,me,Be).call(this,t,"An implementation cannot be declared in ambient contexts."):g?ge(this,me,Be).call(this,t,"'async' modifier cannot be used in an ambient context."):x&&ge(this,me,Be).call(this,t,"Generators are not allowed in an ambient context."):!t.body&&x&&ge(this,me,Be).call(this,t,"A function signature cannot be declared as a generator.");let I=this.createNode(t,{type:t.body?C.FunctionDeclaration:C.TSDeclareFunction,async:g,body:this.convertChild(t.body)||void 0,declare:y,expression:!1,generator:x,id:this.convertChild(t.name),params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});return this.fixExports(t,I)}case T.VariableDeclaration:{let y=!!t.exclamationToken,g=this.convertChild(t.initializer),x=this.convertBindingNameWithTypeAnnotation(t.name,t.type,t);return y&&(g?ge(this,me,Be).call(this,t,"Declarations with initializers cannot also have definite assignment assertions."):(x.type!==C.Identifier||!x.typeAnnotation)&&ge(this,me,Be).call(this,t,"Declarations with definite assignment assertions must also have type annotations.")),this.createNode(t,{type:C.VariableDeclarator,definite:y,id:x,init:g})}case T.VariableStatement:{let y=this.createNode(t,{type:C.VariableDeclaration,declarations:t.declarationList.declarations.map(g=>this.convertChild(g)),declare:Xe(T.DeclareKeyword,t),kind:Jl(t.declarationList)});return y.declarations.length||ge(this,me,Vt).call(this,t,"A variable declaration list must have at least one variable declarator."),(y.kind==="using"||y.kind==="await using")&&t.declarationList.declarations.forEach((g,x)=>{y.declarations[x].init==null&&ge(this,me,Be).call(this,g,`'${y.kind}' declarations must be initialized.`),y.declarations[x].id.type!==C.Identifier&&ge(this,me,Be).call(this,g.name,`'${y.kind}' declarations may not have binding patterns.`)}),(y.declare||["await using","const","using"].includes(y.kind))&&t.declarationList.declarations.forEach((g,x)=>{y.declarations[x].definite&&ge(this,me,Be).call(this,g,"A definite assignment assertion '!' is not permitted in this context.")}),y.declare&&t.declarationList.declarations.forEach((g,x)=>{y.declarations[x].init&&(["let","var"].includes(y.kind)||y.declarations[x].id.typeAnnotation)&&ge(this,me,Be).call(this,g,"Initializers are not permitted in ambient contexts.")}),this.fixExports(t,y)}case T.VariableDeclarationList:{let y=this.createNode(t,{type:C.VariableDeclaration,declarations:t.declarations.map(g=>this.convertChild(g)),declare:!1,kind:Jl(t)});return(y.kind==="using"||y.kind==="await using")&&t.declarations.forEach((g,x)=>{y.declarations[x].init!=null&&ge(this,me,Be).call(this,g,`'${y.kind}' declarations may not be initialized in for statement.`),y.declarations[x].id.type!==C.Identifier&&ge(this,me,Be).call(this,g.name,`'${y.kind}' declarations may not have binding patterns.`)}),y}case T.ExpressionStatement:return this.createNode(t,{type:C.ExpressionStatement,directive:void 0,expression:this.convertChild(t.expression)});case T.ThisKeyword:return this.createNode(t,{type:C.ThisExpression});case T.ArrayLiteralExpression:return this.allowPattern?this.createNode(t,{type:C.ArrayPattern,decorators:[],elements:t.elements.map(y=>this.convertPattern(y)),optional:!1,typeAnnotation:void 0}):this.createNode(t,{type:C.ArrayExpression,elements:t.elements.map(y=>this.convertChild(y))});case T.ObjectLiteralExpression:{if(this.allowPattern)return this.createNode(t,{type:C.ObjectPattern,decorators:[],optional:!1,properties:t.properties.map(g=>this.convertPattern(g)),typeAnnotation:void 0});let y=[];for(let g of t.properties)(g.kind===T.GetAccessor||g.kind===T.SetAccessor||g.kind===T.MethodDeclaration)&&!g.body&&ge(this,me,Vt).call(this,g.end-1,"'{' expected."),y.push(this.convertChild(g));return this.createNode(t,{type:C.ObjectExpression,properties:y})}case T.PropertyAssignment:{let{exclamationToken:y,questionToken:g}=t;return g&&ge(this,me,Be).call(this,g,"A property assignment cannot have a question token."),y&&ge(this,me,Be).call(this,y,"A property assignment cannot have an exclamation token."),this.createNode(t,{type:C.Property,computed:ia(t.name),key:this.convertChild(t.name),kind:"init",method:!1,optional:!1,shorthand:!1,value:this.converter(t.initializer,t,this.allowPattern)})}case T.ShorthandPropertyAssignment:{let{exclamationToken:y,modifiers:g,questionToken:x}=t;return g&&ge(this,me,Be).call(this,g[0],"A shorthand property assignment cannot have modifiers."),x&&ge(this,me,Be).call(this,x,"A shorthand property assignment cannot have a question token."),y&&ge(this,me,Be).call(this,y,"A shorthand property assignment cannot have an exclamation token."),t.objectAssignmentInitializer?this.createNode(t,{type:C.Property,computed:!1,key:this.convertChild(t.name),kind:"init",method:!1,optional:!1,shorthand:!0,value:this.createNode(t,{type:C.AssignmentPattern,decorators:[],left:this.convertPattern(t.name),optional:!1,right:this.convertChild(t.objectAssignmentInitializer),typeAnnotation:void 0})}):this.createNode(t,{type:C.Property,computed:!1,key:this.convertChild(t.name),kind:"init",method:!1,optional:!1,shorthand:!0,value:this.convertChild(t.name)})}case T.ComputedPropertyName:return this.convertChild(t.expression);case T.PropertyDeclaration:{let y=Xe(T.AbstractKeyword,t);y&&t.initializer&&ge(this,me,Be).call(this,t.initializer,"Abstract property cannot have an initializer.");let g=Xe(T.AccessorKeyword,t),x=g?y?C.TSAbstractAccessorProperty:C.AccessorProperty:y?C.TSAbstractPropertyDefinition:C.PropertyDefinition,I=this.convertChild(t.name);return this.createNode(t,{type:x,accessibility:xi(t),computed:ia(t.name),declare:Xe(T.DeclareKeyword,t),decorators:((m=na(t))==null?void 0:m.map(re=>this.convertChild(re)))??[],definite:!!t.exclamationToken,key:I,optional:(I.type===C.Literal||t.name.kind===T.Identifier||t.name.kind===T.ComputedPropertyName||t.name.kind===T.PrivateIdentifier)&&!!t.questionToken,override:Xe(T.OverrideKeyword,t),readonly:Xe(T.ReadonlyKeyword,t),static:Xe(T.StaticKeyword,t),typeAnnotation:t.type&&this.convertTypeAnnotation(t.type,t),value:y?null:this.convertChild(t.initializer)})}case T.GetAccessor:case T.SetAccessor:if(t.parent.kind===T.InterfaceDeclaration||t.parent.kind===T.TypeLiteral)return this.convertMethodSignature(t);case T.MethodDeclaration:{let y=this.createNode(t,{type:t.body?C.FunctionExpression:C.TSEmptyBodyFunctionExpression,range:[t.parameters.pos-1,t.end],async:Xe(T.AsyncKeyword,t),body:this.convertChild(t.body),declare:!1,expression:!1,generator:!!t.asteriskToken,id:null,params:[],returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});y.typeParameters&&this.fixParentLocation(y,y.typeParameters.range);let g;if(a.kind===T.ObjectLiteralExpression)y.params=t.parameters.map(x=>this.convertChild(x)),g=this.createNode(t,{type:C.Property,computed:ia(t.name),key:this.convertChild(t.name),kind:"init",method:t.kind===T.MethodDeclaration,optional:!!t.questionToken,shorthand:!1,value:y});else{y.params=this.convertParameters(t.parameters);let x=Xe(T.AbstractKeyword,t)?C.TSAbstractMethodDefinition:C.MethodDefinition;g=this.createNode(t,{type:x,accessibility:xi(t),computed:ia(t.name),decorators:((v=na(t))==null?void 0:v.map(I=>this.convertChild(I)))??[],key:this.convertChild(t.name),kind:"method",optional:!!t.questionToken,override:Xe(T.OverrideKeyword,t),static:Xe(T.StaticKeyword,t),value:y})}return t.kind===T.GetAccessor?g.kind="get":t.kind===T.SetAccessor?g.kind="set":!g.static&&t.name.kind===T.StringLiteral&&t.name.text==="constructor"&&g.type!==C.Property&&(g.kind="constructor"),g}case T.Constructor:{let y=Ph(t),g=(y&&ra(y,t,this.ast))??t.getFirstToken(),x=this.createNode(t,{type:t.body?C.FunctionExpression:C.TSEmptyBodyFunctionExpression,range:[t.parameters.pos-1,t.end],async:!1,body:this.convertChild(t.body),declare:!1,expression:!1,generator:!1,id:null,params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});x.typeParameters&&this.fixParentLocation(x,x.typeParameters.range);let I=this.createNode(t,{type:C.Identifier,range:[g.getStart(this.ast),g.end],decorators:[],name:"constructor",optional:!1,typeAnnotation:void 0}),re=Xe(T.StaticKeyword,t);return this.createNode(t,{type:Xe(T.AbstractKeyword,t)?C.TSAbstractMethodDefinition:C.MethodDefinition,accessibility:xi(t),computed:!1,decorators:[],key:I,kind:re?"method":"constructor",optional:!1,override:!1,static:re,value:x})}case T.FunctionExpression:return this.createNode(t,{type:C.FunctionExpression,async:Xe(T.AsyncKeyword,t),body:this.convertChild(t.body),declare:!1,expression:!1,generator:!!t.asteriskToken,id:this.convertChild(t.name),params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});case T.SuperKeyword:return this.createNode(t,{type:C.Super});case T.ArrayBindingPattern:return this.createNode(t,{type:C.ArrayPattern,decorators:[],elements:t.elements.map(y=>this.convertPattern(y)),optional:!1,typeAnnotation:void 0});case T.OmittedExpression:return null;case T.ObjectBindingPattern:return this.createNode(t,{type:C.ObjectPattern,decorators:[],optional:!1,properties:t.elements.map(y=>this.convertPattern(y)),typeAnnotation:void 0});case T.BindingElement:{if(a.kind===T.ArrayBindingPattern){let g=this.convertChild(t.name,a);return t.initializer?this.createNode(t,{type:C.AssignmentPattern,decorators:[],left:g,optional:!1,right:this.convertChild(t.initializer),typeAnnotation:void 0}):t.dotDotDotToken?this.createNode(t,{type:C.RestElement,argument:g,decorators:[],optional:!1,typeAnnotation:void 0,value:void 0}):g}let y;return t.dotDotDotToken?y=this.createNode(t,{type:C.RestElement,argument:this.convertChild(t.propertyName??t.name),decorators:[],optional:!1,typeAnnotation:void 0,value:void 0}):y=this.createNode(t,{type:C.Property,computed:!!(t.propertyName&&t.propertyName.kind===T.ComputedPropertyName),key:this.convertChild(t.propertyName??t.name),kind:"init",method:!1,optional:!1,shorthand:!t.propertyName,value:this.convertChild(t.name)}),t.initializer&&(y.value=this.createNode(t,{type:C.AssignmentPattern,range:[t.name.getStart(this.ast),t.initializer.end],decorators:[],left:this.convertChild(t.name),optional:!1,right:this.convertChild(t.initializer),typeAnnotation:void 0})),y}case T.ArrowFunction:return this.createNode(t,{type:C.ArrowFunctionExpression,async:Xe(T.AsyncKeyword,t),body:this.convertChild(t.body),expression:t.body.kind!==T.Block,generator:!1,id:null,params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});case T.YieldExpression:return this.createNode(t,{type:C.YieldExpression,argument:this.convertChild(t.expression),delegate:!!t.asteriskToken});case T.AwaitExpression:return this.createNode(t,{type:C.AwaitExpression,argument:this.convertChild(t.expression)});case T.NoSubstitutionTemplateLiteral:return this.createNode(t,{type:C.TemplateLiteral,expressions:[],quasis:[this.createNode(t,{type:C.TemplateElement,tail:!0,value:{cooked:t.text,raw:this.ast.text.slice(t.getStart(this.ast)+1,t.end-1)}})]});case T.TemplateExpression:{let y=this.createNode(t,{type:C.TemplateLiteral,expressions:[],quasis:[this.convertChild(t.head)]});return t.templateSpans.forEach(g=>{y.expressions.push(this.convertChild(g.expression)),y.quasis.push(this.convertChild(g.literal))}),y}case T.TaggedTemplateExpression:return this.createNode(t,{type:C.TaggedTemplateExpression,quasi:this.convertChild(t.template),tag:this.convertChild(t.tag),typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t)});case T.TemplateHead:case T.TemplateMiddle:case T.TemplateTail:{let y=t.kind===T.TemplateTail;return this.createNode(t,{type:C.TemplateElement,tail:y,value:{cooked:t.text,raw:this.ast.text.slice(t.getStart(this.ast)+1,t.end-(y?1:2))}})}case T.SpreadAssignment:case T.SpreadElement:return this.allowPattern?this.createNode(t,{type:C.RestElement,argument:this.convertPattern(t.expression),decorators:[],optional:!1,typeAnnotation:void 0,value:void 0}):this.createNode(t,{type:C.SpreadElement,argument:this.convertChild(t.expression)});case T.Parameter:{let y,g;return t.dotDotDotToken?y=g=this.createNode(t,{type:C.RestElement,argument:this.convertChild(t.name),decorators:[],optional:!1,typeAnnotation:void 0,value:void 0}):t.initializer?(y=this.convertChild(t.name),g=this.createNode(t,{type:C.AssignmentPattern,decorators:[],left:y,optional:!1,right:this.convertChild(t.initializer),typeAnnotation:void 0}),er(t)&&(g.range[0]=y.range[0],g.loc=Qr(g.range,this.ast))):y=g=this.convertChild(t.name,a),t.type&&(y.typeAnnotation=this.convertTypeAnnotation(t.type,t),this.fixParentLocation(y,y.typeAnnotation.range)),t.questionToken&&(t.questionToken.end>y.range[1]&&(y.range[1]=t.questionToken.end,y.loc.end=Ts(y.range[1],this.ast)),y.optional=!0),er(t)?this.createNode(t,{type:C.TSParameterProperty,accessibility:xi(t),decorators:[],override:Xe(T.OverrideKeyword,t),parameter:g,readonly:Xe(T.ReadonlyKeyword,t),static:Xe(T.StaticKeyword,t)}):g}case T.ClassDeclaration:!t.name&&(!Xe(Ie.ExportKeyword,t)||!Xe(Ie.DefaultKeyword,t))&&ge(this,me,Vt).call(this,t,"A class declaration without the 'default' modifier must have a name.");case T.ClassExpression:{let y=t.heritageClauses??[],g=t.kind===T.ClassDeclaration?C.ClassDeclaration:C.ClassExpression,x,I;for(let he of y){let{token:ye,types:de}=he;de.length===0&&ge(this,me,Vt).call(this,he,`'${it(ye)}' list cannot be empty.`),ye===T.ExtendsKeyword?(x&&ge(this,me,Vt).call(this,he,"'extends' clause already seen."),I&&ge(this,me,Vt).call(this,he,"'extends' clause must precede 'implements' clause."),de.length>1&&ge(this,me,Vt).call(this,de[1],"Classes can only extend a single class."),x??(x=he)):ye===T.ImplementsKeyword&&(I&&ge(this,me,Vt).call(this,he,"'implements' clause already seen."),I??(I=he))}let re=this.createNode(t,{type:g,abstract:Xe(T.AbstractKeyword,t),body:this.createNode(t,{type:C.ClassBody,range:[t.members.pos-1,t.end],body:t.members.filter(Dh).map(he=>this.convertChild(he))}),declare:Xe(T.DeclareKeyword,t),decorators:((A=na(t))==null?void 0:A.map(he=>this.convertChild(he)))??[],id:this.convertChild(t.name),implements:(I==null?void 0:I.types.map(he=>this.convertChild(he)))??[],superClass:x!=null&&x.types[0]?this.convertChild(x.types[0].expression):null,superTypeArguments:void 0,typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});return(P=x==null?void 0:x.types[0])!=null&&P.typeArguments&&(re.superTypeArguments=this.convertTypeArgumentsToTypeParameterInstantiation(x.types[0].typeArguments,x.types[0])),this.fixExports(t,re)}case T.ModuleBlock:return this.createNode(t,{type:C.TSModuleBlock,body:this.convertBodyExpressions(t.statements,t)});case T.ImportDeclaration:{this.assertModuleSpecifier(t,!1);let y=this.createNode(t,ge(this,me,Qa).call(this,{type:C.ImportDeclaration,attributes:this.convertImportAttributes(t.attributes??t.assertClause),importKind:"value",source:this.convertChild(t.moduleSpecifier),specifiers:[]},"assertions","attributes",!0));if(t.importClause&&(t.importClause.isTypeOnly&&(y.importKind="type"),t.importClause.name&&y.specifiers.push(this.convertChild(t.importClause)),t.importClause.namedBindings))switch(t.importClause.namedBindings.kind){case T.NamespaceImport:y.specifiers.push(this.convertChild(t.importClause.namedBindings));break;case T.NamedImports:y.specifiers.push(...t.importClause.namedBindings.elements.map(g=>this.convertChild(g)));break}return y}case T.NamespaceImport:return this.createNode(t,{type:C.ImportNamespaceSpecifier,local:this.convertChild(t.name)});case T.ImportSpecifier:return this.createNode(t,{type:C.ImportSpecifier,imported:this.convertChild(t.propertyName??t.name),importKind:t.isTypeOnly?"type":"value",local:this.convertChild(t.name)});case T.ImportClause:{let y=this.convertChild(t.name);return this.createNode(t,{type:C.ImportDefaultSpecifier,range:y.range,local:y})}case T.ExportDeclaration:return((l=t.exportClause)==null?void 0:l.kind)===T.NamedExports?(this.assertModuleSpecifier(t,!0),this.createNode(t,ge(this,me,Qa).call(this,{type:C.ExportNamedDeclaration,attributes:this.convertImportAttributes(t.attributes??t.assertClause),declaration:null,exportKind:t.isTypeOnly?"type":"value",source:this.convertChild(t.moduleSpecifier),specifiers:t.exportClause.elements.map(y=>this.convertChild(y,t))},"assertions","attributes",!0))):(this.assertModuleSpecifier(t,!1),this.createNode(t,ge(this,me,Qa).call(this,{type:C.ExportAllDeclaration,attributes:this.convertImportAttributes(t.attributes??t.assertClause),exported:((Q=t.exportClause)==null?void 0:Q.kind)===T.NamespaceExport?this.convertChild(t.exportClause.name):null,exportKind:t.isTypeOnly?"type":"value",source:this.convertChild(t.moduleSpecifier)},"assertions","attributes",!0)));case T.ExportSpecifier:{let y=t.propertyName??t.name;return y.kind===T.StringLiteral&&a.kind===T.ExportDeclaration&&((h=a.moduleSpecifier)==null?void 0:h.kind)!==T.StringLiteral&&ge(this,me,Be).call(this,y,"A string literal cannot be used as a local exported binding without `from`."),this.createNode(t,{type:C.ExportSpecifier,exported:this.convertChild(t.name),exportKind:t.isTypeOnly?"type":"value",local:this.convertChild(y)})}case T.ExportAssignment:return t.isExportEquals?this.createNode(t,{type:C.TSExportAssignment,expression:this.convertChild(t.expression)}):this.createNode(t,{type:C.ExportDefaultDeclaration,declaration:this.convertChild(t.expression),exportKind:"value"});case T.PrefixUnaryExpression:case T.PostfixUnaryExpression:{let y=$r(t.operator);return y==="++"||y==="--"?(Ll(t.operand)||ge(this,me,Vt).call(this,t.operand,"Invalid left-hand side expression in unary operation"),this.createNode(t,{type:C.UpdateExpression,argument:this.convertChild(t.operand),operator:y,prefix:t.kind===T.PrefixUnaryExpression})):this.createNode(t,{type:C.UnaryExpression,argument:this.convertChild(t.operand),operator:y,prefix:t.kind===T.PrefixUnaryExpression})}case T.DeleteExpression:return this.createNode(t,{type:C.UnaryExpression,argument:this.convertChild(t.expression),operator:"delete",prefix:!0});case T.VoidExpression:return this.createNode(t,{type:C.UnaryExpression,argument:this.convertChild(t.expression),operator:"void",prefix:!0});case T.TypeOfExpression:return this.createNode(t,{type:C.UnaryExpression,argument:this.convertChild(t.expression),operator:"typeof",prefix:!0});case T.TypeOperator:return this.createNode(t,{type:C.TSTypeOperator,operator:$r(t.operator),typeAnnotation:this.convertChild(t.type)});case T.BinaryExpression:{if(Nh(t.operatorToken)){let g=this.createNode(t,{type:C.SequenceExpression,expressions:[]}),x=this.convertChild(t.left);return x.type===C.SequenceExpression&&t.left.kind!==T.ParenthesizedExpression?g.expressions.push(...x.expressions):g.expressions.push(x),g.expressions.push(this.convertChild(t.right)),g}let y=Ih(t.operatorToken);return this.allowPattern&&y.type===C.AssignmentExpression?this.createNode(t,{type:C.AssignmentPattern,decorators:[],left:this.convertPattern(t.left,t),optional:!1,right:this.convertChild(t.right),typeAnnotation:void 0}):this.createNode(t,{...y,left:this.converter(t.left,t,y.type===C.AssignmentExpression),right:this.convertChild(t.right)})}case T.PropertyAccessExpression:{let y=this.convertChild(t.expression),g=this.convertChild(t.name),I=this.createNode(t,{type:C.MemberExpression,computed:!1,object:y,optional:t.questionDotToken!=null,property:g});return this.convertChainExpression(I,t)}case T.ElementAccessExpression:{let y=this.convertChild(t.expression),g=this.convertChild(t.argumentExpression),I=this.createNode(t,{type:C.MemberExpression,computed:!0,object:y,optional:t.questionDotToken!=null,property:g});return this.convertChainExpression(I,t)}case T.CallExpression:{if(t.expression.kind===T.ImportKeyword)return t.arguments.length!==1&&t.arguments.length!==2&&ge(this,me,Vt).call(this,t.arguments[2]??t,"Dynamic import requires exactly one or two arguments."),this.createNode(t,ge(this,me,Qa).call(this,{type:C.ImportExpression,options:t.arguments[1]?this.convertChild(t.arguments[1]):null,source:this.convertChild(t.arguments[0])},"attributes","options",!0));let y=this.convertChild(t.expression),g=t.arguments.map(re=>this.convertChild(re)),x=t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t),I=this.createNode(t,{type:C.CallExpression,arguments:g,callee:y,optional:t.questionDotToken!=null,typeArguments:x});return this.convertChainExpression(I,t)}case T.NewExpression:{let y=t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t);return this.createNode(t,{type:C.NewExpression,arguments:t.arguments?t.arguments.map(g=>this.convertChild(g)):[],callee:this.convertChild(t.expression),typeArguments:y})}case T.ConditionalExpression:return this.createNode(t,{type:C.ConditionalExpression,alternate:this.convertChild(t.whenFalse),consequent:this.convertChild(t.whenTrue),test:this.convertChild(t.condition)});case T.MetaProperty:return this.createNode(t,{type:C.MetaProperty,meta:this.createNode(t.getFirstToken(),{type:C.Identifier,decorators:[],name:$r(t.keywordToken),optional:!1,typeAnnotation:void 0}),property:this.convertChild(t.name)});case T.Decorator:return this.createNode(t,{type:C.Decorator,expression:this.convertChild(t.expression)});case T.StringLiteral:return this.createNode(t,{type:C.Literal,raw:t.getText(),value:a.kind===T.JsxAttribute?Kf(t.text):t.text});case T.NumericLiteral:return this.createNode(t,{type:C.Literal,raw:t.getText(),value:Number(t.text)});case T.BigIntLiteral:{let y=$a(t,this.ast),g=this.ast.text.slice(y[0],y[1]),x=Sr(!1,g.slice(0,-1),"_",""),I=typeof BigInt<"u"?BigInt(x):null;return this.createNode(t,{type:C.Literal,range:y,bigint:I==null?x:String(I),raw:g,value:I})}case T.RegularExpressionLiteral:{let y=t.text.slice(1,t.text.lastIndexOf("/")),g=t.text.slice(t.text.lastIndexOf("/")+1),x=null;try{x=new RegExp(y,g)}catch{}return this.createNode(t,{type:C.Literal,raw:t.text,regex:{flags:g,pattern:y},value:x})}case T.TrueKeyword:return this.createNode(t,{type:C.Literal,raw:"true",value:!0});case T.FalseKeyword:return this.createNode(t,{type:C.Literal,raw:"false",value:!1});case T.NullKeyword:return this.createNode(t,{type:C.Literal,raw:"null",value:null});case T.EmptyStatement:return this.createNode(t,{type:C.EmptyStatement});case T.DebuggerStatement:return this.createNode(t,{type:C.DebuggerStatement});case T.JsxElement:return this.createNode(t,{type:C.JSXElement,children:t.children.map(y=>this.convertChild(y)),closingElement:this.convertChild(t.closingElement),openingElement:this.convertChild(t.openingElement)});case T.JsxFragment:return this.createNode(t,{type:C.JSXFragment,children:t.children.map(y=>this.convertChild(y)),closingFragment:this.convertChild(t.closingFragment),openingFragment:this.convertChild(t.openingFragment)});case T.JsxSelfClosingElement:return this.createNode(t,{type:C.JSXElement,children:[],closingElement:null,openingElement:this.createNode(t,{type:C.JSXOpeningElement,range:$a(t,this.ast),attributes:t.attributes.properties.map(y=>this.convertChild(y)),name:this.convertJSXTagName(t.tagName,t),selfClosing:!0,typeArguments:t.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t):void 0})});case T.JsxOpeningElement:return this.createNode(t,{type:C.JSXOpeningElement,attributes:t.attributes.properties.map(y=>this.convertChild(y)),name:this.convertJSXTagName(t.tagName,t),selfClosing:!1,typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t)});case T.JsxClosingElement:return this.createNode(t,{type:C.JSXClosingElement,name:this.convertJSXTagName(t.tagName,t)});case T.JsxOpeningFragment:return this.createNode(t,{type:C.JSXOpeningFragment});case T.JsxClosingFragment:return this.createNode(t,{type:C.JSXClosingFragment});case T.JsxExpression:{let y=t.expression?this.convertChild(t.expression):this.createNode(t,{type:C.JSXEmptyExpression,range:[t.getStart(this.ast)+1,t.getEnd()-1]});return t.dotDotDotToken?this.createNode(t,{type:C.JSXSpreadChild,expression:y}):this.createNode(t,{type:C.JSXExpressionContainer,expression:y})}case T.JsxAttribute:return this.createNode(t,{type:C.JSXAttribute,name:this.convertJSXNamespaceOrIdentifier(t.name),value:this.convertChild(t.initializer)});case T.JsxText:{let y=t.getFullStart(),g=t.getEnd(),x=this.ast.text.slice(y,g);return this.createNode(t,{type:C.JSXText,range:[y,g],raw:x,value:Kf(x)})}case T.JsxSpreadAttribute:return this.createNode(t,{type:C.JSXSpreadAttribute,argument:this.convertChild(t.expression)});case T.QualifiedName:return this.createNode(t,{type:C.TSQualifiedName,left:this.convertChild(t.left),right:this.convertChild(t.right)});case T.TypeReference:return this.createNode(t,{type:C.TSTypeReference,typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t),typeName:this.convertChild(t.typeName)});case T.TypeParameter:return this.createNode(t,{type:C.TSTypeParameter,const:Xe(T.ConstKeyword,t),constraint:t.constraint&&this.convertChild(t.constraint),default:t.default?this.convertChild(t.default):void 0,in:Xe(T.InKeyword,t),name:this.convertChild(t.name),out:Xe(T.OutKeyword,t)});case T.ThisType:return this.createNode(t,{type:C.TSThisType});case T.AnyKeyword:case T.BigIntKeyword:case T.BooleanKeyword:case T.NeverKeyword:case T.NumberKeyword:case T.ObjectKeyword:case T.StringKeyword:case T.SymbolKeyword:case T.UnknownKeyword:case T.VoidKeyword:case T.UndefinedKeyword:case T.IntrinsicKeyword:return this.createNode(t,{type:C[`TS${T[t.kind]}`]});case T.NonNullExpression:{let y=this.createNode(t,{type:C.TSNonNullExpression,expression:this.convertChild(t.expression)});return this.convertChainExpression(y,t)}case T.TypeLiteral:return this.createNode(t,{type:C.TSTypeLiteral,members:t.members.map(y=>this.convertChild(y))});case T.ArrayType:return this.createNode(t,{type:C.TSArrayType,elementType:this.convertChild(t.elementType)});case T.IndexedAccessType:return this.createNode(t,{type:C.TSIndexedAccessType,indexType:this.convertChild(t.indexType),objectType:this.convertChild(t.objectType)});case T.ConditionalType:return this.createNode(t,{type:C.TSConditionalType,checkType:this.convertChild(t.checkType),extendsType:this.convertChild(t.extendsType),falseType:this.convertChild(t.falseType),trueType:this.convertChild(t.trueType)});case T.TypeQuery:return this.createNode(t,{type:C.TSTypeQuery,exprName:this.convertChild(t.exprName),typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t)});case T.MappedType:return t.members&&t.members.length>0&&ge(this,me,Vt).call(this,t.members[0],"A mapped type may not declare properties or methods."),this.createNode(t,ge(this,me,ad).call(this,{type:C.TSMappedType,constraint:this.convertChild(t.typeParameter.constraint),key:this.convertChild(t.typeParameter.name),nameType:this.convertChild(t.nameType)??null,optional:t.questionToken&&(t.questionToken.kind===T.QuestionToken||$r(t.questionToken.kind)),readonly:t.readonlyToken&&(t.readonlyToken.kind===T.ReadonlyKeyword||$r(t.readonlyToken.kind)),typeAnnotation:t.type&&this.convertChild(t.type)},"typeParameter","'constraint' and 'key'",this.convertChild(t.typeParameter)));case T.ParenthesizedExpression:return this.convertChild(t.expression,a);case T.TypeAliasDeclaration:{let y=this.createNode(t,{type:C.TSTypeAliasDeclaration,declare:Xe(T.DeclareKeyword,t),id:this.convertChild(t.name),typeAnnotation:this.convertChild(t.type),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});return this.fixExports(t,y)}case T.MethodSignature:return this.convertMethodSignature(t);case T.PropertySignature:{let{initializer:y}=t;return y&&ge(this,me,Be).call(this,y,"A property signature cannot have an initializer."),this.createNode(t,{type:C.TSPropertySignature,accessibility:xi(t),computed:ia(t.name),key:this.convertChild(t.name),optional:Zf(t),readonly:Xe(T.ReadonlyKeyword,t),static:Xe(T.StaticKeyword,t),typeAnnotation:t.type&&this.convertTypeAnnotation(t.type,t)})}case T.IndexSignature:return this.createNode(t,{type:C.TSIndexSignature,accessibility:xi(t),parameters:t.parameters.map(y=>this.convertChild(y)),readonly:Xe(T.ReadonlyKeyword,t),static:Xe(T.StaticKeyword,t),typeAnnotation:t.type&&this.convertTypeAnnotation(t.type,t)});case T.ConstructorType:return this.createNode(t,{type:C.TSConstructorType,abstract:Xe(T.AbstractKeyword,t),params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});case T.FunctionType:{let{modifiers:y}=t;y&&ge(this,me,Be).call(this,y[0],"A function type cannot have modifiers.")}case T.ConstructSignature:case T.CallSignature:{let y=t.kind===T.ConstructSignature?C.TSConstructSignatureDeclaration:t.kind===T.CallSignature?C.TSCallSignatureDeclaration:C.TSFunctionType;return this.createNode(t,{type:y,params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)})}case T.ExpressionWithTypeArguments:{let y=a.kind,g=y===T.InterfaceDeclaration?C.TSInterfaceHeritage:y===T.HeritageClause?C.TSClassImplements:C.TSInstantiationExpression;return this.createNode(t,{type:g,expression:this.convertChild(t.expression),typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t)})}case T.InterfaceDeclaration:{let y=t.heritageClauses??[],g=[];for(let I of y){I.token!==T.ExtendsKeyword&&ge(this,me,Be).call(this,I,I.token===T.ImplementsKeyword?"Interface declaration cannot have 'implements' clause.":"Unexpected token.");for(let re of I.types)g.push(this.convertChild(re,t))}let x=this.createNode(t,{type:C.TSInterfaceDeclaration,body:this.createNode(t,{type:C.TSInterfaceBody,range:[t.members.pos-1,t.end],body:t.members.map(I=>this.convertChild(I))}),declare:Xe(T.DeclareKeyword,t),extends:g,id:this.convertChild(t.name),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});return this.fixExports(t,x)}case T.TypePredicate:{let y=this.createNode(t,{type:C.TSTypePredicate,asserts:t.assertsModifier!=null,parameterName:this.convertChild(t.parameterName),typeAnnotation:null});return t.type&&(y.typeAnnotation=this.convertTypeAnnotation(t.type,t),y.typeAnnotation.loc=y.typeAnnotation.typeAnnotation.loc,y.typeAnnotation.range=y.typeAnnotation.typeAnnotation.range),y}case T.ImportType:{let y=$a(t,this.ast);if(t.isTypeOf){let x=ra(t.getFirstToken(),t,this.ast);y[0]=x.getStart(this.ast)}let g=this.createNode(t,{type:C.TSImportType,range:y,argument:this.convertChild(t.argument),attributes:this.convertImportAttributes(t.attributes),qualifier:this.convertChild(t.qualifier),typeArguments:t.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t):null});return t.isTypeOf?this.createNode(t,{type:C.TSTypeQuery,exprName:g,typeArguments:void 0}):g}case T.EnumDeclaration:{let y=t.members.map(x=>this.convertChild(x)),g=this.createNode(t,ge(this,me,ad).call(this,{type:C.TSEnumDeclaration,body:this.createNode(t,{type:C.TSEnumBody,range:[t.members.pos-1,t.end],members:y}),const:Xe(T.ConstKeyword,t),declare:Xe(T.DeclareKeyword,t),id:this.convertChild(t.name)},"members","'body.members'",t.members.map(x=>this.convertChild(x))));return this.fixExports(t,g)}case T.EnumMember:return this.createNode(t,{type:C.TSEnumMember,computed:t.name.kind===Ie.ComputedPropertyName,id:this.convertChild(t.name),initializer:t.initializer&&this.convertChild(t.initializer)});case T.ModuleDeclaration:{let y=Xe(T.DeclareKeyword,t),g=this.createNode(t,{type:C.TSModuleDeclaration,...(()=>{if(t.flags&on.GlobalAugmentation){let I=this.convertChild(t.name),re=this.convertChild(t.body);return(re==null||re.type===C.TSModuleDeclaration)&&ge(this,me,Vt).call(this,t.body??t,"Expected a valid module body"),I.type!==C.Identifier&&ge(this,me,Vt).call(this,t.name,"global module augmentation must have an Identifier id"),{body:re,declare:!1,global:!1,id:I,kind:"global"}}if(!(t.flags&on.Namespace)){let I=this.convertChild(t.body);return{kind:"module",...I!=null?{body:I}:{},declare:!1,global:!1,id:this.convertChild(t.name)}}t.body==null&&ge(this,me,Vt).call(this,t,"Expected a module body"),t.name.kind!==Ie.Identifier&&ge(this,me,Vt).call(this,t.name,"`namespace`s must have an Identifier id");let x=this.createNode(t.name,{type:C.Identifier,range:[t.name.getStart(this.ast),t.name.getEnd()],decorators:[],name:t.name.text,optional:!1,typeAnnotation:void 0});for(;t.body&&Ti(t.body)&&t.body.name;){t=t.body,y||(y=Xe(T.DeclareKeyword,t));let I=t.name,re=this.createNode(I,{type:C.Identifier,range:[I.getStart(this.ast),I.getEnd()],decorators:[],name:I.text,optional:!1,typeAnnotation:void 0});x=this.createNode(I,{type:C.TSQualifiedName,range:[x.range[0],re.range[1]],left:x,right:re})}return{body:this.convertChild(t.body),declare:!1,global:!1,id:x,kind:"namespace"}})()});return g.declare=y,t.flags&on.GlobalAugmentation&&(g.global=!0),this.fixExports(t,g)}case T.ParenthesizedType:return this.convertChild(t.type);case T.UnionType:return this.createNode(t,{type:C.TSUnionType,types:t.types.map(y=>this.convertChild(y))});case T.IntersectionType:return this.createNode(t,{type:C.TSIntersectionType,types:t.types.map(y=>this.convertChild(y))});case T.AsExpression:return this.createNode(t,{type:C.TSAsExpression,expression:this.convertChild(t.expression),typeAnnotation:this.convertChild(t.type)});case T.InferType:return this.createNode(t,{type:C.TSInferType,typeParameter:this.convertChild(t.typeParameter)});case T.LiteralType:return t.literal.kind===T.NullKeyword?this.createNode(t.literal,{type:C.TSNullKeyword}):this.createNode(t,{type:C.TSLiteralType,literal:this.convertChild(t.literal)});case T.TypeAssertionExpression:return this.createNode(t,{type:C.TSTypeAssertion,expression:this.convertChild(t.expression),typeAnnotation:this.convertChild(t.type)});case T.ImportEqualsDeclaration:return this.fixExports(t,this.createNode(t,{type:C.TSImportEqualsDeclaration,id:this.convertChild(t.name),importKind:t.isTypeOnly?"type":"value",moduleReference:this.convertChild(t.moduleReference)}));case T.ExternalModuleReference:return t.expression.kind!==T.StringLiteral&&ge(this,me,Be).call(this,t.expression,"String literal expected."),this.createNode(t,{type:C.TSExternalModuleReference,expression:this.convertChild(t.expression)});case T.NamespaceExportDeclaration:return this.createNode(t,{type:C.TSNamespaceExportDeclaration,id:this.convertChild(t.name)});case T.AbstractKeyword:return this.createNode(t,{type:C.TSAbstractKeyword});case T.TupleType:{let y=t.elements.map(g=>this.convertChild(g));return this.createNode(t,{type:C.TSTupleType,elementTypes:y})}case T.NamedTupleMember:{let y=this.createNode(t,{type:C.TSNamedTupleMember,elementType:this.convertChild(t.type,t),label:this.convertChild(t.name,t),optional:t.questionToken!=null});return t.dotDotDotToken?(y.range[0]=y.label.range[0],y.loc.start=y.label.loc.start,this.createNode(t,{type:C.TSRestType,typeAnnotation:y})):y}case T.OptionalType:return this.createNode(t,{type:C.TSOptionalType,typeAnnotation:this.convertChild(t.type)});case T.RestType:return this.createNode(t,{type:C.TSRestType,typeAnnotation:this.convertChild(t.type)});case T.TemplateLiteralType:{let y=this.createNode(t,{type:C.TSTemplateLiteralType,quasis:[this.convertChild(t.head)],types:[]});return t.templateSpans.forEach(g=>{y.types.push(this.convertChild(g.type)),y.quasis.push(this.convertChild(g.literal))}),y}case T.ClassStaticBlockDeclaration:return this.createNode(t,{type:C.StaticBlock,body:this.convertBodyExpressions(t.body.statements,t)});case T.AssertEntry:case T.ImportAttribute:return this.createNode(t,{type:C.ImportAttribute,key:this.convertChild(t.name),value:this.convertChild(t.value)});case T.SatisfiesExpression:return this.createNode(t,{type:C.TSSatisfiesExpression,expression:this.convertChild(t.expression),typeAnnotation:this.convertChild(t.type)});default:return this.deeplyCopy(t)}}createNode(t,a){let o=a;return o.range??(o.range=$a(t,this.ast)),o.loc??(o.loc=Qr(o.range,this.ast)),o&&this.options.shouldPreserveNodeMaps&&this.esTreeNodeToTSNodeMap.set(o,t),o}convertProgram(){return this.converter(this.ast)}deeplyCopy(t){t.kind===Ie.JSDocFunctionType&&ge(this,me,Be).call(this,t,"JSDoc types can only be used inside documentation comments.");let a=`TS${T[t.kind]}`;if(this.options.errorOnUnknownASTType&&!C[a])throw new Error(`Unknown AST_NODE_TYPE: "${a}"`);let o=this.createNode(t,{type:a});"type"in t&&(o.typeAnnotation=t.type&&"kind"in t.type&&s1(t.type)?this.convertTypeAnnotation(t.type,t):null),"typeArguments"in t&&(o.typeArguments=t.typeArguments&&"pos"in t.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t):null),"typeParameters"in t&&(o.typeParameters=t.typeParameters&&"pos"in t.typeParameters?this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters):null);let m=na(t);m!=null&&m.length&&(o.decorators=m.map(A=>this.convertChild(A)));let v=new Set(["_children","decorators","end","flags","heritageClauses","illegalDecorators","jsDoc","kind","locals","localSymbol","modifierFlagsCache","modifiers","nextContainer","parent","pos","symbol","transformFlags","type","typeArguments","typeParameters"]);return Object.entries(t).filter(([A])=>!v.has(A)).forEach(([A,P])=>{Array.isArray(P)?o[A]=P.map(l=>this.convertChild(l)):P&&typeof P=="object"&&P.kind?o[A]=this.convertChild(P):o[A]=P}),o}fixExports(t,a){let m=Ti(t)&&!!(t.flags&on.Namespace)?zh(t):er(t);if((m==null?void 0:m[0].kind)===T.ExportKeyword){this.registerTSNodeInNodeMap(t,a);let v=m[0],A=m[1],P=(A==null?void 0:A.kind)===T.DefaultKeyword,l=P?ra(A,this.ast,this.ast):ra(v,this.ast,this.ast);if(a.range[0]=l.getStart(this.ast),a.loc=Qr(a.range,this.ast),P)return this.createNode(t,{type:C.ExportDefaultDeclaration,range:[v.getStart(this.ast),a.range[1]],declaration:a,exportKind:"value"});let Q=a.type===C.TSInterfaceDeclaration||a.type===C.TSTypeAliasDeclaration,h="declare"in a&&a.declare;return this.createNode(t,ge(this,me,Qa).call(this,{type:C.ExportNamedDeclaration,range:[v.getStart(this.ast),a.range[1]],attributes:[],declaration:a,exportKind:Q||h?"type":"value",source:null,specifiers:[]},"assertions","attributes",!0))}return a}getASTMaps(){return{esTreeNodeToTSNodeMap:this.esTreeNodeToTSNodeMap,tsNodeToESTreeNodeMap:this.tsNodeToESTreeNodeMap}}registerTSNodeInNodeMap(t,a){a&&this.options.shouldPreserveNodeMaps&&!this.tsNodeToESTreeNodeMap.has(t)&&this.tsNodeToESTreeNodeMap.set(t,a)}};me=new WeakSet,id=function(t,a){let o=a===Ie.ForInStatement?"for...in":"for...of";if(Q1(t)){t.declarations.length!==1&&ge(this,me,Be).call(this,t,`Only a single variable declaration is allowed in a '${o}' statement.`);let m=t.declarations[0];m.initializer?ge(this,me,Be).call(this,m,`The variable declaration of a '${o}' statement cannot have an initializer.`):m.type&&ge(this,me,Be).call(this,m,`The variable declaration of a '${o}' statement cannot have a type annotation.`),a===Ie.ForInStatement&&t.flags&on.Using&&ge(this,me,Be).call(this,t,"The left-hand side of a 'for...in' statement cannot be a 'using' declaration.")}else!Ll(t)&&t.kind!==Ie.ObjectLiteralExpression&&t.kind!==Ie.ArrayLiteralExpression&&ge(this,me,Be).call(this,t,`The left-hand side of a '${o}' statement must be a variable or a property access.`)},Fh=function(t){if(!this.options.allowInvalidAST){jh(t)&&ge(this,me,Be).call(this,t.illegalDecorators[0],"Decorators are not valid here.");for(let a of na(t,!0)??[])qh(t)||(ms(t)&&!nd(t.body)?ge(this,me,Be).call(this,a,"A decorator can only decorate a method implementation, not an overload."):ge(this,me,Be).call(this,a,"Decorators are not valid here."));for(let a of er(t,!0)??[]){if(a.kind!==T.ReadonlyKeyword&&((t.kind===T.PropertySignature||t.kind===T.MethodSignature)&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on a type member`),t.kind===T.IndexSignature&&(a.kind!==T.StaticKeyword||!vi(t.parent))&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on an index signature`)),a.kind!==T.InKeyword&&a.kind!==T.OutKeyword&&a.kind!==T.ConstKeyword&&t.kind===T.TypeParameter&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on a type parameter`),(a.kind===T.InKeyword||a.kind===T.OutKeyword)&&(t.kind!==T.TypeParameter||!(vs(t.parent)||vi(t.parent)||Pl(t.parent)))&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier can only appear on a type parameter of a class, interface or type alias`),a.kind===T.ReadonlyKeyword&&t.kind!==T.PropertyDeclaration&&t.kind!==T.PropertySignature&&t.kind!==T.IndexSignature&&t.kind!==T.Parameter&&ge(this,me,Be).call(this,a,"'readonly' modifier can only appear on a property declaration or index signature."),a.kind===T.DeclareKeyword&&vi(t.parent)&&!Va(t)&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on class elements of this kind.`),a.kind===T.DeclareKeyword&&Ha(t)){let o=Jl(t.declarationList);(o==="using"||o==="await using")&&ge(this,me,Be).call(this,a,`'declare' modifier cannot appear on a '${o}' declaration.`)}if(a.kind===T.AbstractKeyword&&t.kind!==T.ClassDeclaration&&t.kind!==T.ConstructorType&&t.kind!==T.MethodDeclaration&&t.kind!==T.PropertyDeclaration&&t.kind!==T.GetAccessor&&t.kind!==T.SetAccessor&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier can only appear on a class, method, or property declaration.`),(a.kind===T.StaticKeyword||a.kind===T.PublicKeyword||a.kind===T.ProtectedKeyword||a.kind===T.PrivateKeyword)&&(t.parent.kind===T.ModuleBlock||t.parent.kind===T.SourceFile)&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on a module or namespace element.`),a.kind===T.AccessorKeyword&&t.kind!==T.PropertyDeclaration&&ge(this,me,Be).call(this,a,"'accessor' modifier can only appear on a property declaration."),a.kind===T.AsyncKeyword&&t.kind!==T.MethodDeclaration&&t.kind!==T.FunctionDeclaration&&t.kind!==T.FunctionExpression&&t.kind!==T.ArrowFunction&&ge(this,me,Be).call(this,a,"'async' modifier cannot be used here."),t.kind===T.Parameter&&(a.kind===T.StaticKeyword||a.kind===T.ExportKeyword||a.kind===T.DeclareKeyword||a.kind===T.AsyncKeyword)&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on a parameter.`),a.kind===T.PublicKeyword||a.kind===T.ProtectedKeyword||a.kind===T.PrivateKeyword)for(let o of er(t)??[])o!==a&&(o.kind===T.PublicKeyword||o.kind===T.ProtectedKeyword||o.kind===T.PrivateKeyword)&&ge(this,me,Be).call(this,o,"Accessibility modifier already seen.");if(t.kind===T.Parameter&&(a.kind===T.PublicKeyword||a.kind===T.PrivateKeyword||a.kind===T.ProtectedKeyword||a.kind===T.ReadonlyKeyword||a.kind===T.OverrideKeyword)){let o=Bh(t);o.kind===T.Constructor&&nd(o.body)||ge(this,me,Be).call(this,a,"A parameter property is only allowed in a constructor implementation.")}}}},Be=function(t,a){let o,m;throw typeof t=="number"?o=m=t:(o=t.getStart(this.ast),m=t.getEnd()),td(a,this.ast,o,m)},Vt=function(t,a){this.options.allowInvalidAST||ge(this,me,Be).call(this,t,a)},Qa=function(t,a,o,m=!1){let v=m;return Object.defineProperty(t,a,{configurable:!0,get:this.options.suppressDeprecatedPropertyWarnings?()=>t[o]:()=>(v||((void 0)(`The '${a}' property is deprecated on ${t.type} nodes. Use '${o}' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,"DeprecationWarning"),v=!0),t[o]),set(A){Object.defineProperty(t,a,{enumerable:!0,value:A,writable:!0})}}),t},ad=function(t,a,o,m){let v=!1;return Object.defineProperty(t,a,{configurable:!0,get:this.options.suppressDeprecatedPropertyWarnings?()=>m:()=>(v||((void 0)(`The '${a}' property is deprecated on ${t.type} nodes. Use ${o} instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,"DeprecationWarning"),v=!0),m),set(A){Object.defineProperty(t,a,{enumerable:!0,value:A,writable:!0})}}),t};function Cv(e,t,a=e.getSourceFile()){let o=[];for(;;){if(mf(e.kind))t(e);else{let m=e.getChildren(a);if(m.length===1){e=m[0];continue}for(let v=m.length-1;v>=0;--v)o.push(m[v])}if(o.length===0)break;e=o.pop()}}function Wh(e,t,a=e.getSourceFile()){let o=a.text,m=a.languageVariant!==xl.JSX;return Cv(e,A=>{if(A.pos!==A.end&&(A.kind!==Ie.JsxText&&Xm(o,A.pos===0?(sf(o)??"").length:A.pos,v),m||Dv(A)))return Hm(o,A.end,v)},a);function v(A,P,l){t(o,{end:P,kind:l,pos:A})}}function Dv(e){switch(e.kind){case Ie.CloseBraceToken:return e.parent.kind!==Ie.JsxExpression||!sd(e.parent.parent);case Ie.GreaterThanToken:switch(e.parent.kind){case Ie.JsxClosingElement:case Ie.JsxClosingFragment:return!sd(e.parent.parent.parent);case Ie.JsxOpeningElement:return e.end!==e.parent.end;case Ie.JsxOpeningFragment:return!1;case Ie.JsxSelfClosingElement:return e.end!==e.parent.end||!sd(e.parent.parent)}}return!0}function sd(e){return e.kind===Ie.JsxElement||e.kind===Ie.JsxFragment}var[KT,ZT]=Sm.split(".").map(e=>Number.parseInt(e,10));var ex=nn.Intrinsic??nn.Any|nn.Unknown|nn.String|nn.Number|nn.BigInt|nn.Boolean|nn.BooleanLiteral|nn.ESSymbol|nn.Void|nn.Undefined|nn.Null|nn.Never|nn.NonPrimitive;function Gh(e,t){let a=[];return Wh(e,(o,m)=>{let v=m.kind===Ie.SingleLineCommentTrivia?Rt.Line:Rt.Block,A=[m.pos,m.end],P=Qr(A,e),l=A[0]+2,Q=m.kind===Ie.SingleLineCommentTrivia?A[1]-l:A[1]-l-2;a.push({type:v,loc:P,range:A,value:t.slice(l,l+Q)})},e),a}var Yh=()=>{};function Xh(e,t,a){let{parseDiagnostics:o}=e;if(o.length)throw _d(o[0]);let m=new jl(e,{allowInvalidAST:t.allowInvalidAST,errorOnUnknownASTType:t.errorOnUnknownASTType,shouldPreserveNodeMaps:a,suppressDeprecatedPropertyWarnings:t.suppressDeprecatedPropertyWarnings}),v=m.convertProgram();return(!t.range||!t.loc)&&Yh(v,{enter:P=>{t.range||delete P.range,t.loc||delete P.loc}}),t.tokens&&(v.tokens=Lh(e)),t.comment&&(v.comments=Gh(e,t.codeFullText)),{astMaps:m.getASTMaps(),estree:v}}function Rl(e){if(typeof e!="object"||e==null)return!1;let t=e;return t.kind===Ie.SourceFile&&typeof t.getFullText=="function"}var Lv=function(e){return e&&e.__esModule?e:{default:e}};var jv=Lv({extname:e=>"."+e.split(".").pop()});function $h(e,t){switch(jv.default.extname(e).toLowerCase()){case Nn.Cjs:case Nn.Js:case Nn.Mjs:return Dr.JS;case Nn.Cts:case Nn.Mts:case Nn.Ts:return Dr.TS;case Nn.Json:return Dr.JSON;case Nn.Jsx:return Dr.JSX;case Nn.Tsx:return Dr.TSX;default:return t?Dr.TSX:Dr.TS}}var Uv={default:Ia},Bv=(0,Uv.default)("typescript-eslint:typescript-estree:create-program:createSourceFile");function Qh(e){return Bv("Getting AST without type information in %s mode for: %s",e.jsx?"TSX":"TS",e.filePath),Rl(e.code)?e.code:fh(e.filePath,e.codeFullText,{jsDocParsingMode:e.jsDocParsingMode,languageVersion:ys.Latest,setExternalModuleIndicator:e.setExternalModuleIndicator},!0,$h(e.filePath,e.jsx))}var Kh=()=>{};var Zh=e=>e;var e0=class{};var n0=()=>!1;var r0=()=>{};var Kv=function(e){return e&&e.__esModule?e:{default:e}};var od={default:Ia},Zv=Kv({extname:e=>"."+e.split(".").pop()}),e4=(0,od.default)("typescript-eslint:typescript-estree:parseSettings:createParseSettings"),t4,n4=null,i0,a0,_0,s0,xs={ParseAll:(i0=Ga)==null?void 0:i0.ParseAll,ParseForTypeErrors:(a0=Ga)==null?void 0:a0.ParseForTypeErrors,ParseForTypeInfo:(_0=Ga)==null?void 0:_0.ParseForTypeInfo,ParseNone:(s0=Ga)==null?void 0:s0.ParseNone};function o0(e,t={}){var h;let a=r4(e),o=n0(t),m=typeof t.tsconfigRootDir=="string"?t.tsconfigRootDir:"/prettier-security-dirname-placeholder",v=typeof t.loggerFn=="function",A=Zh(typeof t.filePath=="string"&&t.filePath!==""?t.filePath:i4(t.jsx),m),P=Zv.default.extname(A).toLowerCase(),l=(()=>{switch(t.jsDocParsingMode){case"all":return xs.ParseAll;case"none":return xs.ParseNone;case"type-info":return xs.ParseForTypeInfo;default:return xs.ParseAll}})(),Q={loc:t.loc===!0,range:t.range===!0,allowInvalidAST:t.allowInvalidAST===!0,code:e,codeFullText:a,comment:t.comment===!0,comments:[],debugLevel:t.debugLevel===!0?new Set(["typescript-eslint"]):Array.isArray(t.debugLevel)?new Set(t.debugLevel):new Set,errorOnTypeScriptSyntacticAndSemanticIssues:!1,errorOnUnknownASTType:t.errorOnUnknownASTType===!0,extraFileExtensions:Array.isArray(t.extraFileExtensions)&&t.extraFileExtensions.every(y=>typeof y=="string")?t.extraFileExtensions:[],filePath:A,jsDocParsingMode:l,jsx:t.jsx===!0,log:typeof t.loggerFn=="function"?t.loggerFn:t.loggerFn===!1?()=>{}:console.log,preserveNodeMaps:t.preserveNodeMaps!==!1,programs:Array.isArray(t.programs)?t.programs:null,projects:new Map,projectService:t.projectService||t.project&&t.projectService!==!1&&(void 0).env.TYPESCRIPT_ESLINT_PROJECT_SERVICE==="true"?n4??(n4=Kh(t.projectService,l,m)):void 0,setExternalModuleIndicator:t.sourceType==="module"||t.sourceType==null&&P===Nn.Mjs||t.sourceType==null&&P===Nn.Mts?y=>{y.externalModuleIndicator=!0}:void 0,singleRun:o,suppressDeprecatedPropertyWarnings:t.suppressDeprecatedPropertyWarnings??!0,tokens:t.tokens===!0?[]:null,tsconfigMatchCache:t4??(t4=new e0(o?"Infinity":((h=t.cacheLifetime)==null?void 0:h.glob)??void 0)),tsconfigRootDir:m};if(Q.debugLevel.size>0){let y=[];Q.debugLevel.has("typescript-eslint")&&y.push("typescript-eslint:*"),(Q.debugLevel.has("eslint")||od.default.enabled("eslint:*,-eslint:code-path"))&&y.push("eslint:*,-eslint:code-path"),od.default.enable(y.join(","))}if(Array.isArray(t.programs)){if(!t.programs.length)throw new Error("You have set parserOptions.programs to an empty array. This will cause all files to not be found in existing programs. Either provide one or more existing TypeScript Program instances in the array, or remove the parserOptions.programs setting.");e4("parserOptions.programs was provided, so parserOptions.project will be ignored.")}return!Q.programs&&!Q.projectService&&(Q.projects=new Map),t.jsDocParsingMode==null&&Q.projects.size===0&&Q.programs==null&&Q.projectService==null&&(Q.jsDocParsingMode=xs.ParseNone),r0(Q,v),Q}function r4(e){return Rl(e)?e.getFullText(e):typeof e=="string"?e:String(e)}function i4(e){return e?"estree.tsx":"estree.ts"}var o4={default:Ia},hx=(0,o4.default)("typescript-eslint:typescript-estree:parser");function c0(e,t){let{ast:a}=c4(e,t,!1);return a}function c4(e,t,a){let o=o0(e,t);if(t!=null&&t.errorOnTypeScriptSyntacticAndSemanticIssues)throw new Error('"errorOnTypeScriptSyntacticAndSemanticIssues" is only supported for parseAndGenerateServices()');let m=Qh(o),{astMaps:v,estree:A}=Xh(m,o,a);return{ast:A,esTreeNodeToTSNodeMap:v.esTreeNodeToTSNodeMap,tsNodeToESTreeNodeMap:v.tsNodeToESTreeNodeMap}}function l4(e,t){let a=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(a,t)}var l0=l4;function u4(e){let t=[];for(let a of e)try{return a()}catch(o){t.push(o)}throw Object.assign(new Error("All combinations failed"),{errors:t})}var u0=u4;var p4=(e,t,a)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[a<0?t.length+a:a]:t.at(a)},cd=p4;function f4(e){return Array.isArray(e)&&e.length>0}var p0=f4;function tr(e){var o,m,v;let t=((o=e.range)==null?void 0:o[0])??e.start,a=(v=((m=e.declaration)==null?void 0:m.decorators)??e.decorators)==null?void 0:v[0];return a?Math.min(tr(a),t):t}function Kr(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function d4(e){let t=new Set(e);return a=>t.has(a==null?void 0:a.type)}var f0=d4;var m4=f0(["Block","CommentBlock","MultiLine"]),Ss=m4;function h4(e){let t=`*${e.value}*`.split(` +`);return t.length>1&&t.every(a=>a.trimStart()[0]==="*")}var ld=h4;function y4(e){return Ss(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(e.value)}var d0=y4;var ws=null;function ks(e){if(ws!==null&&typeof ws.property){let t=ws;return ws=ks.prototype=null,t}return ws=ks.prototype=e??Object.create(null),new ks}var g4=10;for(let e=0;e<=g4;e++)ks();function ud(e){return ks(e)}function b4(e,t="type"){ud(e);function a(o){let m=o[t],v=e[m];if(!Array.isArray(v))throw Object.assign(new Error(`Missing visitor keys for '${m}'.`),{node:o});return v}return a}var m0=b4;var h0={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var v4=m0(h0),y0=v4;function pd(e,t){if(!(e!==null&&typeof e=="object"))return e;if(Array.isArray(e)){for(let o=0;o{var A;(A=v.leadingComments)!=null&&A.some(d0)&&m.add(tr(v))}),e=Ul(e,v=>{if(v.type==="ParenthesizedExpression"){let{expression:A}=v;if(A.type==="TypeCastExpression")return A.range=[...v.range],A;let P=tr(v);if(!m.has(P))return A.extra={...A.extra,parenthesized:!0},A}})}if(e=Ul(e,m=>{switch(m.type){case"LogicalExpression":if(g0(m))return fd(m);break;case"VariableDeclaration":{let v=cd(!1,m.declarations,-1);v!=null&&v.init&&o[Kr(v)]!==";"&&(m.range=[tr(m),Kr(v)]);break}case"TSParenthesizedType":return m.typeAnnotation;case"TSTypeParameter":if(typeof m.name=="string"){let v=tr(m);m.name={type:"Identifier",name:m.name,range:[v,v+m.name.length]}}break;case"TopicReference":e.extra={...e.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(m.types.length===1)return m.types[0];break}}),p0(e.comments)){let m=cd(!1,e.comments,-1);for(let v=e.comments.length-2;v>=0;v--){let A=e.comments[v];Kr(A)===tr(m)&&Ss(A)&&Ss(m)&&ld(A)&&ld(m)&&(e.comments.splice(v+1,1),A.value+="*//*"+m.value,A.range=[tr(A),Kr(m)]),m=A}}return e.type==="Program"&&(e.range=[0,o.length]),e}function g0(e){return e.type==="LogicalExpression"&&e.right.type==="LogicalExpression"&&e.operator===e.right.operator}function fd(e){return g0(e)?fd({type:"LogicalExpression",operator:e.operator,left:fd({type:"LogicalExpression",operator:e.operator,left:e.left,right:e.right.left,range:[tr(e.left),Kr(e.right.left)]}),right:e.right.right,range:[tr(e),Kr(e)]}):e}var b0=T4;var x4=/\*\/$/,S4=/^\/\*\*?/,w4=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,k4=/(^|\s+)\/\/([^\n\r]*)/g,v0=/^(\r?\n)+/,E4=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,T0=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,A4=/(\r?\n|^) *\* ?/g,C4=[];function x0(e){let t=e.match(w4);return t?t[0].trimStart():""}function S0(e){let t=` +`;e=Sr(!1,e.replace(S4,"").replace(x4,""),A4,"$1");let a="";for(;a!==e;)a=e,e=Sr(!1,e,E4,`${t}$1 $2${t}`);e=e.replace(v0,"").trimEnd();let o=Object.create(null),m=Sr(!1,e,T0,"").replace(v0,"").trimEnd(),v;for(;v=T0.exec(e);){let A=Sr(!1,v[2],k4,"");if(typeof o[v[1]]=="string"||Array.isArray(o[v[1]])){let P=o[v[1]];o[v[1]]=[...C4,...Array.isArray(P)?P:[P],A]}else o[v[1]]=A}return{comments:m,pragmas:o}}function D4(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` +`);return t===-1?e:e.slice(0,t)}var w0=D4;function P4(e){let t=w0(e);t&&(e=e.slice(t.length+1));let a=x0(e),{pragmas:o,comments:m}=S0(a);return{shebang:t,text:e,pragmas:o,comments:m}}function k0(e){let{pragmas:t}=P4(e);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function N4(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:k0,locStart:tr,locEnd:Kr,...e}}var E0=N4;function I4(e){let{filepath:t}=e;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs")||t.endsWith(".cts"))return"script";if(t.endsWith(".mjs")||t.endsWith(".mts"))return"module"}}var A0=I4;function O4(e){return e.charAt(0)==="#"&&e.charAt(1)==="!"?"//"+e.slice(2):e}var C0=O4;var M4={loc:!0,range:!0,comment:!0,tokens:!0,loggerFn:!1,project:!1,jsDocParsingMode:"none",suppressDeprecatedPropertyWarnings:!0};function J4(e){if(!(e!=null&&e.location))return e;let{message:t,location:{start:a,end:o}}=e;return l0(t,{loc:{start:{line:a.line,column:a.column+1},end:{line:o.line,column:o.column+1}},cause:e})}var L4=e=>/\.(?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$/iu.test(e);function j4(e,t){let a=t==null?void 0:t.filepath,o=[{...M4,filePath:a}],m=A0(t);if(m?o=o.map(A=>({...A,sourceType:m})):o=["module","script"].flatMap(P=>o.map(l=>({...l,sourceType:P}))),a&&L4(a))return o;let v=U4(e);return[v,!v].flatMap(A=>o.map(P=>({...P,jsx:A})))}function R4(e,t={}){let a=C0(e),o=j4(e,t),m;try{m=u0(o.map(v=>()=>c0(a,v)))}catch({errors:[v]}){throw J4(v)}return b0(m,{text:e})}function U4(e){return new RegExp(["(?:^[^\"'`]*)"].join(""),"mu").test(e)}var B4=E0(R4);return ty(q4);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/typescript.mjs b/node_modules/prettier/plugins/typescript.mjs new file mode 100644 index 0000000..bbc8b6c --- /dev/null +++ b/node_modules/prettier/plugins/typescript.mjs @@ -0,0 +1,20 @@ +var vd=Object.defineProperty;var Td=e=>{throw TypeError(e)};var Q0=(e,t,a)=>t in e?vd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var xd=(e,t)=>{for(var a in t)vd(e,a,{get:t[a],enumerable:!0})};var qi=(e,t,a)=>Q0(e,typeof t!="symbol"?t+"":t,a),K0=(e,t,a)=>t.has(e)||Td("Cannot "+a);var yp=(e,t,a)=>t.has(e)?Td("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a);var ge=(e,t,a)=>(K0(e,t,"access private method"),a);var dd={};xd(dd,{parsers:()=>fd});var fd={};xd(fd,{typescript:()=>L4});var Z0=()=>()=>{},Ia=Z0;var ey=(e,t,a,o)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(a,o):a.global?t.replace(a,o):t.split(a).join(o)},Sr=ey;var wm="5.7";var bt=[],ty=new Map;function ts(e){return e!==void 0?e.length:0}function Un(e,t){if(e!==void 0)for(let a=0;a0;return!1}function Yp(e,t){return t===void 0||t.length===0?e:e===void 0||e.length===0?t:[...e,...t]}function _y(e,t,a=Hp){if(e===void 0||t===void 0)return e===t;if(e.length!==t.length)return!1;for(let o=0;oe==null?void 0:e.at(t):(e,t)=>{if(e!==void 0&&(t=Np(e,t),t>1),l=a(e[P],P);switch(o(l,t)){case-1:v=P+1;break;case 0:return P;case 1:A=P-1;break}}return~v}function dy(e,t,a,o,m){if(e&&e.length>0){let v=e.length;if(v>0){let A=o===void 0||o<0?0:o,P=m===void 0||A+m>v-1?v-1:A+m,l;for(arguments.length<=2?(l=e[A],A++):l=a;A<=P;)l=t(l,e[A],A),A++;return l}}return a}var Cm=Object.prototype.hasOwnProperty;function Cr(e,t){return Cm.call(e,t)}function my(e){let t=[];for(let a in e)Cm.call(e,a)&&t.push(a);return t}function hy(){let e=new Map;return e.add=yy,e.remove=gy,e}function yy(e,t){let a=this.get(e);return a!==void 0?a.push(t):this.set(e,a=[t]),a}function gy(e,t){let a=this.get(e);a!==void 0&&(Ay(a,t),a.length||this.delete(e))}function Yr(e){return Array.isArray(e)}function bp(e){return Yr(e)?e:[e]}function by(e,t){return e!==void 0&&t(e)?e:void 0}function kr(e,t){return e!==void 0&&t(e)?e:B.fail(`Invalid cast. The supplied value ${e} did not pass the test '${B.getFunctionName(t)}'.`)}function Fa(e){}function vy(){return!0}function gt(e){return e}function wd(e){let t;return()=>(e&&(t=e(),e=void 0),t)}function Kn(e){let t=new Map;return a=>{let o=`${typeof a}:${a}`,m=t.get(o);return m===void 0&&!t.has(o)&&(m=e(a),t.set(o,m)),m}}function Hp(e,t){return e===t}function $p(e,t){return e===t||e!==void 0&&t!==void 0&&e.toUpperCase()===t.toUpperCase()}function Ty(e,t){return Hp(e,t)}function xy(e,t){return e===t?0:e===void 0?-1:t===void 0?1:ea?P-a:1),h=Math.floor(t.length>a+P?a+P:t.length);m[0]=P;let y=P;for(let x=1;xa)return;let g=o;o=m,m=g}let A=o[t.length];return A>a?void 0:A}function ky(e,t,a){let o=e.length-t.length;return o>=0&&(a?$p(e.slice(o),t):e.indexOf(t,o)===o)}function Ey(e,t){e[t]=e[e.length-1],e.pop()}function Ay(e,t){return Cy(e,a=>a===t)}function Cy(e,t){for(let a=0;a{let t=0;e.currentLogLevel=2,e.isDebugging=!1;function a(L){return e.currentLogLevel<=L}e.shouldLog=a;function o(L,se){e.loggingHost&&a(L)&&e.loggingHost.log(L,se)}function m(L){o(3,L)}e.log=m,(L=>{function se(Ke){o(1,Ke)}L.error=se;function fe(Ke){o(2,Ke)}L.warn=fe;function Te(Ke){o(3,Ke)}L.log=Te;function He(Ke){o(4,Ke)}L.trace=He})(m=e.log||(e.log={}));let v={};function A(){return t}e.getAssertionLevel=A;function P(L){let se=t;if(t=L,L>se)for(let fe of my(v)){let Te=v[fe];Te!==void 0&&e[fe]!==Te.assertion&&L>=Te.level&&(e[fe]=Te,v[fe]=void 0)}}e.setAssertionLevel=P;function l(L){return t>=L}e.shouldAssert=l;function Q(L,se){return l(L)?!0:(v[se]={level:L,assertion:e[se]},e[se]=Fa,!1)}function h(L,se){debugger;let fe=new Error(L?`Debug Failure. ${L}`:"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(fe,se||h),fe}e.fail=h;function y(L,se,fe){return h(`${se||"Unexpected node."}\r +Node ${Ot(L.kind)} was unexpected.`,fe||y)}e.failBadSyntaxKind=y;function g(L,se,fe,Te){L||(se=se?`False expression: ${se}`:"False expression.",fe&&(se+=`\r +Verbose Debug Information: `+(typeof fe=="string"?fe:fe())),h(se,Te||g))}e.assert=g;function x(L,se,fe,Te,He){if(L!==se){let Ke=fe?Te?`${fe} ${Te}`:fe:"";h(`Expected ${L} === ${se}. ${Ke}`,He||x)}}e.assertEqual=x;function I(L,se,fe,Te){L>=se&&h(`Expected ${L} < ${se}. ${fe||""}`,Te||I)}e.assertLessThan=I;function re(L,se,fe){L>se&&h(`Expected ${L} <= ${se}`,fe||re)}e.assertLessThanOrEqual=re;function he(L,se,fe){L= ${se}`,fe||he)}e.assertGreaterThanOrEqual=he;function ye(L,se,fe){L==null&&h(se,fe||ye)}e.assertIsDefined=ye;function de(L,se,fe){return ye(L,se,fe||de),L}e.checkDefined=de;function M(L,se,fe){for(let Te of L)ye(Te,se,fe||M)}e.assertEachIsDefined=M;function ae(L,se,fe){return M(L,se,fe||ae),L}e.checkEachDefined=ae;function Oe(L,se="Illegal value:",fe){let Te=typeof L=="object"&&Cr(L,"kind")&&Cr(L,"pos")?"SyntaxKind: "+Ot(L.kind):JSON.stringify(L);return h(`${se} ${Te}`,fe||Oe)}e.assertNever=Oe;function V(L,se,fe,Te){Q(1,"assertEachNode")&&g(se===void 0||Gp(L,se),fe||"Unexpected node.",()=>`Node array did not pass test '${bn(se)}'.`,Te||V)}e.assertEachNode=V;function oe(L,se,fe,Te){Q(1,"assertNode")&&g(L!==void 0&&(se===void 0||se(L)),fe||"Unexpected node.",()=>`Node ${Ot(L==null?void 0:L.kind)} did not pass test '${bn(se)}'.`,Te||oe)}e.assertNode=oe;function W(L,se,fe,Te){Q(1,"assertNotNode")&&g(L===void 0||se===void 0||!se(L),fe||"Unexpected node.",()=>`Node ${Ot(L.kind)} should not have passed test '${bn(se)}'.`,Te||W)}e.assertNotNode=W;function dt(L,se,fe,Te){Q(1,"assertOptionalNode")&&g(se===void 0||L===void 0||se(L),fe||"Unexpected node.",()=>`Node ${Ot(L==null?void 0:L.kind)} did not pass test '${bn(se)}'.`,Te||dt)}e.assertOptionalNode=dt;function nr(L,se,fe,Te){Q(1,"assertOptionalToken")&&g(se===void 0||L===void 0||L.kind===se,fe||"Unexpected node.",()=>`Node ${Ot(L==null?void 0:L.kind)} was not a '${Ot(se)}' token.`,Te||nr)}e.assertOptionalToken=nr;function gn(L,se,fe){Q(1,"assertMissingNode")&&g(L===void 0,se||"Unexpected node.",()=>`Node ${Ot(L.kind)} was unexpected'.`,fe||gn)}e.assertMissingNode=gn;function rr(L){}e.type=rr;function bn(L){if(typeof L!="function")return"";if(Cr(L,"name"))return L.name;{let se=Function.prototype.toString.call(L),fe=/^function\s+([\w$]+)\s*\(/.exec(se);return fe?fe[1]:""}}e.getFunctionName=bn;function In(L){return`{ name: ${cs(L.escapedName)}; flags: ${ct(L.flags)}; declarations: ${Pp(L.declarations,se=>Ot(se.kind))} }`}e.formatSymbol=In;function Ge(L=0,se,fe){let Te=Pr(se);if(L===0)return Te.length>0&&Te[0][0]===0?Te[0][1]:"0";if(fe){let He=[],Ke=L;for(let[st,Dt]of Te){if(st>L)break;st!==0&&st&L&&(He.push(Dt),Ke&=~st)}if(Ke===0)return He.join("|")}else for(let[He,Ke]of Te)if(He===L)return Ke;return L.toString()}e.formatEnum=Ge;let ir=new Map;function Pr(L){let se=ir.get(L);if(se)return se;let fe=[];for(let He in L){let Ke=L[He];typeof Ke=="number"&&fe.push([Ke,He])}let Te=cy(fe,(He,Ke)=>Dm(He[0],Ke[0]));return ir.set(L,Te),Te}function Ot(L){return Ge(L,Ie,!1)}e.formatSyntaxKind=Ot;function Bn(L){return Ge(L,Mm,!1)}e.formatSnippetKind=Bn;function On(L){return Ge(L,Dr,!1)}e.formatScriptKind=On;function Mt(L){return Ge(L,on,!0)}e.formatNodeFlags=Mt;function vt(L){return Ge(L,Nm,!0)}e.formatNodeCheckFlags=vt;function Qe(L){return Ge(L,Qp,!0)}e.formatModifierFlags=Qe;function qn(L){return Ge(L,Om,!0)}e.formatTransformFlags=qn;function $t(L){return Ge(L,Jm,!0)}e.formatEmitFlags=$t;function ct(L){return Ge(L,Kp,!0)}e.formatSymbolFlags=ct;function _t(L){return Ge(L,nn,!0)}e.formatTypeFlags=_t;function Ut(L){return Ge(L,Im,!0)}e.formatSignatureFlags=Ut;function Jt(L){return Ge(L,Zp,!0)}e.formatObjectFlags=Jt;function lt(L){return Ge(L,Op,!0)}e.formatFlowFlags=lt;function ar(L){return Ge(L,Pm,!0)}e.formatRelationComparisonResult=ar;function mt(L){return Ge(L,CheckMode,!0)}e.formatCheckMode=mt;function vn(L){return Ge(L,SignatureCheckMode,!0)}e.formatSignatureCheckMode=vn;function yt(L){return Ge(L,TypeFacts,!0)}e.formatTypeFacts=yt;let cn=!1,nt;function Bt(L){"__debugFlowFlags"in L||Object.defineProperties(L,{__tsDebuggerDisplay:{value(){let se=this.flags&2?"FlowStart":this.flags&4?"FlowBranchLabel":this.flags&8?"FlowLoopLabel":this.flags&16?"FlowAssignment":this.flags&32?"FlowTrueCondition":this.flags&64?"FlowFalseCondition":this.flags&128?"FlowSwitchClause":this.flags&256?"FlowArrayMutation":this.flags&512?"FlowCall":this.flags&1024?"FlowReduceLabel":this.flags&1?"FlowUnreachable":"UnknownFlow",fe=this.flags&-2048;return`${se}${fe?` (${lt(fe)})`:""}`}},__debugFlowFlags:{get(){return Ge(this.flags,Op,!0)}},__debugToString:{value(){return mr(this)}}})}function rn(L){return cn&&(typeof Object.setPrototypeOf=="function"?(nt||(nt=Object.create(Object.prototype),Bt(nt)),Object.setPrototypeOf(L,nt)):Bt(L)),L}e.attachFlowNodeDebugInfo=rn;let _r;function fr(L){"__tsDebuggerDisplay"in L||Object.defineProperties(L,{__tsDebuggerDisplay:{value(se){return se=String(se).replace(/(?:,[\s\w]+:[^,]+)+\]$/,"]"),`NodeArray ${se}`}}})}function dr(L){cn&&(typeof Object.setPrototypeOf=="function"?(_r||(_r=Object.create(Array.prototype),fr(_r)),Object.setPrototypeOf(L,_r)):fr(L))}e.attachNodeArrayDebugInfo=dr;function zn(){if(cn)return;let L=new WeakMap,se=new WeakMap;Object.defineProperties(At.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value(){let Te=this.flags&33554432?"TransientSymbol":"Symbol",He=this.flags&-33554433;return`${Te} '${Lp(this)}'${He?` (${ct(He)})`:""}`}},__debugFlags:{get(){return ct(this.flags)}}}),Object.defineProperties(At.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value(){let Te=this.flags&67359327?`IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName?` (${this.debugIntrinsicName})`:""}`:this.flags&98304?"NullableType":this.flags&384?`LiteralType ${JSON.stringify(this.value)}`:this.flags&2048?`LiteralType ${this.value.negative?"-":""}${this.value.base10Value}n`:this.flags&8192?"UniqueESSymbolType":this.flags&32?"EnumType":this.flags&1048576?"UnionType":this.flags&2097152?"IntersectionType":this.flags&4194304?"IndexType":this.flags&8388608?"IndexedAccessType":this.flags&16777216?"ConditionalType":this.flags&33554432?"SubstitutionType":this.flags&262144?"TypeParameter":this.flags&524288?this.objectFlags&3?"InterfaceType":this.objectFlags&4?"TypeReference":this.objectFlags&8?"TupleType":this.objectFlags&16?"AnonymousType":this.objectFlags&32?"MappedType":this.objectFlags&1024?"ReverseMappedType":this.objectFlags&256?"EvolvingArrayType":"ObjectType":"Type",He=this.flags&524288?this.objectFlags&-1344:0;return`${Te}${this.symbol?` '${Lp(this.symbol)}'`:""}${He?` (${Jt(He)})`:""}`}},__debugFlags:{get(){return _t(this.flags)}},__debugObjectFlags:{get(){return this.flags&524288?Jt(this.objectFlags):""}},__debugTypeToString:{value(){let Te=L.get(this);return Te===void 0&&(Te=this.checker.typeToString(this),L.set(this,Te)),Te}}}),Object.defineProperties(At.getSignatureConstructor().prototype,{__debugFlags:{get(){return Ut(this.flags)}},__debugSignatureToString:{value(){var Te;return(Te=this.checker)==null?void 0:Te.signatureToString(this)}}});let fe=[At.getNodeConstructor(),At.getIdentifierConstructor(),At.getTokenConstructor(),At.getSourceFileConstructor()];for(let Te of fe)Cr(Te.prototype,"__debugKind")||Object.defineProperties(Te.prototype,{__tsDebuggerDisplay:{value(){return`${Ua(this)?"GeneratedIdentifier":tt(this)?`Identifier '${Pn(this)}'`:gi(this)?`PrivateIdentifier '${Pn(this)}'`:Ya(this)?`StringLiteral ${JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")}`:ta(this)?`NumericLiteral ${this.text}`:D1(this)?`BigIntLiteral ${this.text}n`:Ef(this)?"TypeParameterDeclaration":ds(this)?"ParameterDeclaration":Af(this)?"ConstructorDeclaration":gl(this)?"GetAccessorDeclaration":hs(this)?"SetAccessorDeclaration":M1(this)?"CallSignatureDeclaration":J1(this)?"ConstructSignatureDeclaration":Cf(this)?"IndexSignatureDeclaration":L1(this)?"TypePredicateNode":Df(this)?"TypeReferenceNode":Pf(this)?"FunctionTypeNode":Nf(this)?"ConstructorTypeNode":Bb(this)?"TypeQueryNode":j1(this)?"TypeLiteralNode":qb(this)?"ArrayTypeNode":zb(this)?"TupleTypeNode":Fb(this)?"OptionalTypeNode":Vb(this)?"RestTypeNode":U1(this)?"UnionTypeNode":B1(this)?"IntersectionTypeNode":Wb(this)?"ConditionalTypeNode":Gb(this)?"InferTypeNode":q1(this)?"ParenthesizedTypeNode":Yb(this)?"ThisTypeNode":z1(this)?"TypeOperatorNode":Xb(this)?"IndexedAccessTypeNode":F1(this)?"MappedTypeNode":Hb(this)?"LiteralTypeNode":R1(this)?"NamedTupleMember":$b(this)?"ImportTypeNode":Ot(this.kind)}${this.flags?` (${Mt(this.flags)})`:""}`}},__debugKind:{get(){return Ot(this.kind)}},__debugNodeFlags:{get(){return Mt(this.flags)}},__debugModifierFlags:{get(){return Qe(Y2(this))}},__debugTransformFlags:{get(){return qn(this.transformFlags)}},__debugIsParseTreeNode:{get(){return ml(this)}},__debugEmitFlags:{get(){return $t(za(this))}},__debugGetText:{value(He){if(La(this))return"";let Ke=se.get(this);if(Ke===void 0){let st=dg(this),Dt=st&&hi(st);Ke=Dt?Ud(Dt,st,He):"",se.set(this,Ke)}return Ke}}});cn=!0}e.enableDebugInfo=zn;function Fn(L){let se=L&7,fe=se===0?"in out":se===3?"[bivariant]":se===2?"in":se===1?"out":se===4?"[independent]":"";return L&8?fe+=" (unmeasurable)":L&16&&(fe+=" (unreliable)"),fe}e.formatVariance=Fn;class Nr{__debugToString(){var se;switch(this.kind){case 3:return((se=this.debugInfo)==null?void 0:se.call(this))||"(function mapper)";case 0:return`${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`;case 1:return Sd(this.sources,this.targets||Pp(this.sources,()=>"any"),(fe,Te)=>`${fe.__debugTypeToString()} -> ${typeof Te=="string"?Te:Te.__debugTypeToString()}`).join(", ");case 2:return Sd(this.sources,this.targets,(fe,Te)=>`${fe.__debugTypeToString()} -> ${Te().__debugTypeToString()}`).join(", ");case 5:case 4:return`m1: ${this.mapper1.__debugToString().split(` +`).join(` + `)} +m2: ${this.mapper2.__debugToString().split(` +`).join(` + `)}`;default:return Oe(this)}}}e.DebugTypeMapper=Nr;function Vn(L){return e.isDebugging?Object.setPrototypeOf(L,Nr.prototype):L}e.attachDebugPrototypeIfDebug=Vn;function Ce(L){return console.log(mr(L))}e.printControlFlowGraph=Ce;function mr(L){let se=-1;function fe(u){return u.id||(u.id=se,se--),u.id}let Te;(u=>{u.lr="\u2500",u.ud="\u2502",u.dr="\u256D",u.dl="\u256E",u.ul="\u256F",u.ur="\u2570",u.udr="\u251C",u.udl="\u2524",u.dlr="\u252C",u.ulr="\u2534",u.udlr="\u256B"})(Te||(Te={}));let He;(u=>{u[u.None=0]="None",u[u.Up=1]="Up",u[u.Down=2]="Down",u[u.Left=4]="Left",u[u.Right=8]="Right",u[u.UpDown=3]="UpDown",u[u.LeftRight=12]="LeftRight",u[u.UpLeft=5]="UpLeft",u[u.UpRight=9]="UpRight",u[u.DownLeft=6]="DownLeft",u[u.DownRight=10]="DownRight",u[u.UpDownLeft=7]="UpDownLeft",u[u.UpDownRight=11]="UpDownRight",u[u.UpLeftRight=13]="UpLeftRight",u[u.DownLeftRight=14]="DownLeftRight",u[u.UpDownLeftRight=15]="UpDownLeftRight",u[u.NoChildren=16]="NoChildren"})(He||(He={}));let Ke=2032,st=882,Dt=Object.create(null),Tt=[],ut=[],Ir=Se(L,new Set);for(let u of Tt)u.text=rt(u.flowNode,u.circular),be(u);let hr=We(Ir),Mn=Ze(hr);return Ye(Ir,0),ln();function Wn(u){return!!(u.flags&128)}function Si(u){return!!(u.flags&12)&&!!u.antecedent}function R(u){return!!(u.flags&Ke)}function $(u){return!!(u.flags&st)}function K(u){let Ne=[];for(let Me of u.edges)Me.source===u&&Ne.push(Me.target);return Ne}function xe(u){let Ne=[];for(let Me of u.edges)Me.target===u&&Ne.push(Me.source);return Ne}function Se(u,Ne){let Me=fe(u),U=Dt[Me];if(U&&Ne.has(u))return U.circular=!0,U={id:-1,flowNode:u,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:"circularity"},Tt.push(U),U;if(Ne.add(u),!U)if(Dt[Me]=U={id:Me,flowNode:u,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:!1},Tt.push(U),Si(u))for(let ze of u.antecedent)we(U,ze,Ne);else R(u)&&we(U,u.antecedent,Ne);return Ne.delete(u),U}function we(u,Ne,Me){let U=Se(Ne,Me),ze={source:u,target:U};ut.push(ze),u.edges.push(ze),U.edges.push(ze)}function be(u){if(u.level!==-1)return u.level;let Ne=0;for(let Me of xe(u))Ne=Math.max(Ne,be(Me)+1);return u.level=Ne}function We(u){let Ne=0;for(let Me of K(u))Ne=Math.max(Ne,We(Me));return Ne+1}function Ze(u){let Ne=J(Array(u),0);for(let Me of Tt)Ne[Me.level]=Math.max(Ne[Me.level],Me.text.length);return Ne}function Ye(u,Ne){if(u.lane===-1){u.lane=Ne,u.endLane=Ne;let Me=K(u);for(let U=0;U0&&Ne++;let ze=Me[U];Ye(ze,Ne),ze.endLane>u.endLane&&(Ne=ze.endLane)}u.endLane=Ne}}function Ee(u){if(u&2)return"Start";if(u&4)return"Branch";if(u&8)return"Loop";if(u&16)return"Assignment";if(u&32)return"True";if(u&64)return"False";if(u&128)return"SwitchClause";if(u&256)return"ArrayMutation";if(u&512)return"Call";if(u&1024)return"ReduceLabel";if(u&1)return"Unreachable";throw new Error}function Tn(u){let Ne=hi(u);return Ud(Ne,u,!1)}function rt(u,Ne){let Me=Ee(u.flags);if(Ne&&(Me=`${Me}#${fe(u)}`),Wn(u)){let U=[],{switchStatement:ze,clauseStart:an,clauseEnd:Ve}=u.node;for(let $e=an;$eVe.lane)+1,Me=J(Array(Ne),""),U=Mn.map(()=>Array(Ne)),ze=Mn.map(()=>J(Array(Ne),0));for(let Ve of Tt){U[Ve.level][Ve.lane]=Ve;let $e=K(Ve);for(let kt=0;kt<$e.length;kt++){let Nt=$e[kt],qt=8;Nt.lane===Ve.lane&&(qt|=4),kt>0&&(qt|=1),kt<$e.length-1&&(qt|=2),ze[Ve.level][Nt.lane]|=qt}$e.length===0&&(ze[Ve.level][Ve.lane]|=16);let Pt=xe(Ve);for(let kt=0;kt0&&(qt|=1),kt0?ze[Ve-1][$e]:0,kt=$e>0?ze[Ve][$e-1]:0,Nt=ze[Ve][$e];Nt||(Pt&8&&(Nt|=12),kt&2&&(Nt|=3),ze[Ve][$e]=Nt)}for(let Ve=0;Ve0?u.repeat(Ne):"";let Me="";for(;Me.length{},Dy=()=>{},_l,Ie=(e=>(e[e.Unknown=0]="Unknown",e[e.EndOfFileToken=1]="EndOfFileToken",e[e.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",e[e.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",e[e.NewLineTrivia=4]="NewLineTrivia",e[e.WhitespaceTrivia=5]="WhitespaceTrivia",e[e.ShebangTrivia=6]="ShebangTrivia",e[e.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",e[e.NonTextFileMarkerTrivia=8]="NonTextFileMarkerTrivia",e[e.NumericLiteral=9]="NumericLiteral",e[e.BigIntLiteral=10]="BigIntLiteral",e[e.StringLiteral=11]="StringLiteral",e[e.JsxText=12]="JsxText",e[e.JsxTextAllWhiteSpaces=13]="JsxTextAllWhiteSpaces",e[e.RegularExpressionLiteral=14]="RegularExpressionLiteral",e[e.NoSubstitutionTemplateLiteral=15]="NoSubstitutionTemplateLiteral",e[e.TemplateHead=16]="TemplateHead",e[e.TemplateMiddle=17]="TemplateMiddle",e[e.TemplateTail=18]="TemplateTail",e[e.OpenBraceToken=19]="OpenBraceToken",e[e.CloseBraceToken=20]="CloseBraceToken",e[e.OpenParenToken=21]="OpenParenToken",e[e.CloseParenToken=22]="CloseParenToken",e[e.OpenBracketToken=23]="OpenBracketToken",e[e.CloseBracketToken=24]="CloseBracketToken",e[e.DotToken=25]="DotToken",e[e.DotDotDotToken=26]="DotDotDotToken",e[e.SemicolonToken=27]="SemicolonToken",e[e.CommaToken=28]="CommaToken",e[e.QuestionDotToken=29]="QuestionDotToken",e[e.LessThanToken=30]="LessThanToken",e[e.LessThanSlashToken=31]="LessThanSlashToken",e[e.GreaterThanToken=32]="GreaterThanToken",e[e.LessThanEqualsToken=33]="LessThanEqualsToken",e[e.GreaterThanEqualsToken=34]="GreaterThanEqualsToken",e[e.EqualsEqualsToken=35]="EqualsEqualsToken",e[e.ExclamationEqualsToken=36]="ExclamationEqualsToken",e[e.EqualsEqualsEqualsToken=37]="EqualsEqualsEqualsToken",e[e.ExclamationEqualsEqualsToken=38]="ExclamationEqualsEqualsToken",e[e.EqualsGreaterThanToken=39]="EqualsGreaterThanToken",e[e.PlusToken=40]="PlusToken",e[e.MinusToken=41]="MinusToken",e[e.AsteriskToken=42]="AsteriskToken",e[e.AsteriskAsteriskToken=43]="AsteriskAsteriskToken",e[e.SlashToken=44]="SlashToken",e[e.PercentToken=45]="PercentToken",e[e.PlusPlusToken=46]="PlusPlusToken",e[e.MinusMinusToken=47]="MinusMinusToken",e[e.LessThanLessThanToken=48]="LessThanLessThanToken",e[e.GreaterThanGreaterThanToken=49]="GreaterThanGreaterThanToken",e[e.GreaterThanGreaterThanGreaterThanToken=50]="GreaterThanGreaterThanGreaterThanToken",e[e.AmpersandToken=51]="AmpersandToken",e[e.BarToken=52]="BarToken",e[e.CaretToken=53]="CaretToken",e[e.ExclamationToken=54]="ExclamationToken",e[e.TildeToken=55]="TildeToken",e[e.AmpersandAmpersandToken=56]="AmpersandAmpersandToken",e[e.BarBarToken=57]="BarBarToken",e[e.QuestionToken=58]="QuestionToken",e[e.ColonToken=59]="ColonToken",e[e.AtToken=60]="AtToken",e[e.QuestionQuestionToken=61]="QuestionQuestionToken",e[e.BacktickToken=62]="BacktickToken",e[e.HashToken=63]="HashToken",e[e.EqualsToken=64]="EqualsToken",e[e.PlusEqualsToken=65]="PlusEqualsToken",e[e.MinusEqualsToken=66]="MinusEqualsToken",e[e.AsteriskEqualsToken=67]="AsteriskEqualsToken",e[e.AsteriskAsteriskEqualsToken=68]="AsteriskAsteriskEqualsToken",e[e.SlashEqualsToken=69]="SlashEqualsToken",e[e.PercentEqualsToken=70]="PercentEqualsToken",e[e.LessThanLessThanEqualsToken=71]="LessThanLessThanEqualsToken",e[e.GreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanEqualsToken",e[e.GreaterThanGreaterThanGreaterThanEqualsToken=73]="GreaterThanGreaterThanGreaterThanEqualsToken",e[e.AmpersandEqualsToken=74]="AmpersandEqualsToken",e[e.BarEqualsToken=75]="BarEqualsToken",e[e.BarBarEqualsToken=76]="BarBarEqualsToken",e[e.AmpersandAmpersandEqualsToken=77]="AmpersandAmpersandEqualsToken",e[e.QuestionQuestionEqualsToken=78]="QuestionQuestionEqualsToken",e[e.CaretEqualsToken=79]="CaretEqualsToken",e[e.Identifier=80]="Identifier",e[e.PrivateIdentifier=81]="PrivateIdentifier",e[e.JSDocCommentTextToken=82]="JSDocCommentTextToken",e[e.BreakKeyword=83]="BreakKeyword",e[e.CaseKeyword=84]="CaseKeyword",e[e.CatchKeyword=85]="CatchKeyword",e[e.ClassKeyword=86]="ClassKeyword",e[e.ConstKeyword=87]="ConstKeyword",e[e.ContinueKeyword=88]="ContinueKeyword",e[e.DebuggerKeyword=89]="DebuggerKeyword",e[e.DefaultKeyword=90]="DefaultKeyword",e[e.DeleteKeyword=91]="DeleteKeyword",e[e.DoKeyword=92]="DoKeyword",e[e.ElseKeyword=93]="ElseKeyword",e[e.EnumKeyword=94]="EnumKeyword",e[e.ExportKeyword=95]="ExportKeyword",e[e.ExtendsKeyword=96]="ExtendsKeyword",e[e.FalseKeyword=97]="FalseKeyword",e[e.FinallyKeyword=98]="FinallyKeyword",e[e.ForKeyword=99]="ForKeyword",e[e.FunctionKeyword=100]="FunctionKeyword",e[e.IfKeyword=101]="IfKeyword",e[e.ImportKeyword=102]="ImportKeyword",e[e.InKeyword=103]="InKeyword",e[e.InstanceOfKeyword=104]="InstanceOfKeyword",e[e.NewKeyword=105]="NewKeyword",e[e.NullKeyword=106]="NullKeyword",e[e.ReturnKeyword=107]="ReturnKeyword",e[e.SuperKeyword=108]="SuperKeyword",e[e.SwitchKeyword=109]="SwitchKeyword",e[e.ThisKeyword=110]="ThisKeyword",e[e.ThrowKeyword=111]="ThrowKeyword",e[e.TrueKeyword=112]="TrueKeyword",e[e.TryKeyword=113]="TryKeyword",e[e.TypeOfKeyword=114]="TypeOfKeyword",e[e.VarKeyword=115]="VarKeyword",e[e.VoidKeyword=116]="VoidKeyword",e[e.WhileKeyword=117]="WhileKeyword",e[e.WithKeyword=118]="WithKeyword",e[e.ImplementsKeyword=119]="ImplementsKeyword",e[e.InterfaceKeyword=120]="InterfaceKeyword",e[e.LetKeyword=121]="LetKeyword",e[e.PackageKeyword=122]="PackageKeyword",e[e.PrivateKeyword=123]="PrivateKeyword",e[e.ProtectedKeyword=124]="ProtectedKeyword",e[e.PublicKeyword=125]="PublicKeyword",e[e.StaticKeyword=126]="StaticKeyword",e[e.YieldKeyword=127]="YieldKeyword",e[e.AbstractKeyword=128]="AbstractKeyword",e[e.AccessorKeyword=129]="AccessorKeyword",e[e.AsKeyword=130]="AsKeyword",e[e.AssertsKeyword=131]="AssertsKeyword",e[e.AssertKeyword=132]="AssertKeyword",e[e.AnyKeyword=133]="AnyKeyword",e[e.AsyncKeyword=134]="AsyncKeyword",e[e.AwaitKeyword=135]="AwaitKeyword",e[e.BooleanKeyword=136]="BooleanKeyword",e[e.ConstructorKeyword=137]="ConstructorKeyword",e[e.DeclareKeyword=138]="DeclareKeyword",e[e.GetKeyword=139]="GetKeyword",e[e.InferKeyword=140]="InferKeyword",e[e.IntrinsicKeyword=141]="IntrinsicKeyword",e[e.IsKeyword=142]="IsKeyword",e[e.KeyOfKeyword=143]="KeyOfKeyword",e[e.ModuleKeyword=144]="ModuleKeyword",e[e.NamespaceKeyword=145]="NamespaceKeyword",e[e.NeverKeyword=146]="NeverKeyword",e[e.OutKeyword=147]="OutKeyword",e[e.ReadonlyKeyword=148]="ReadonlyKeyword",e[e.RequireKeyword=149]="RequireKeyword",e[e.NumberKeyword=150]="NumberKeyword",e[e.ObjectKeyword=151]="ObjectKeyword",e[e.SatisfiesKeyword=152]="SatisfiesKeyword",e[e.SetKeyword=153]="SetKeyword",e[e.StringKeyword=154]="StringKeyword",e[e.SymbolKeyword=155]="SymbolKeyword",e[e.TypeKeyword=156]="TypeKeyword",e[e.UndefinedKeyword=157]="UndefinedKeyword",e[e.UniqueKeyword=158]="UniqueKeyword",e[e.UnknownKeyword=159]="UnknownKeyword",e[e.UsingKeyword=160]="UsingKeyword",e[e.FromKeyword=161]="FromKeyword",e[e.GlobalKeyword=162]="GlobalKeyword",e[e.BigIntKeyword=163]="BigIntKeyword",e[e.OverrideKeyword=164]="OverrideKeyword",e[e.OfKeyword=165]="OfKeyword",e[e.QualifiedName=166]="QualifiedName",e[e.ComputedPropertyName=167]="ComputedPropertyName",e[e.TypeParameter=168]="TypeParameter",e[e.Parameter=169]="Parameter",e[e.Decorator=170]="Decorator",e[e.PropertySignature=171]="PropertySignature",e[e.PropertyDeclaration=172]="PropertyDeclaration",e[e.MethodSignature=173]="MethodSignature",e[e.MethodDeclaration=174]="MethodDeclaration",e[e.ClassStaticBlockDeclaration=175]="ClassStaticBlockDeclaration",e[e.Constructor=176]="Constructor",e[e.GetAccessor=177]="GetAccessor",e[e.SetAccessor=178]="SetAccessor",e[e.CallSignature=179]="CallSignature",e[e.ConstructSignature=180]="ConstructSignature",e[e.IndexSignature=181]="IndexSignature",e[e.TypePredicate=182]="TypePredicate",e[e.TypeReference=183]="TypeReference",e[e.FunctionType=184]="FunctionType",e[e.ConstructorType=185]="ConstructorType",e[e.TypeQuery=186]="TypeQuery",e[e.TypeLiteral=187]="TypeLiteral",e[e.ArrayType=188]="ArrayType",e[e.TupleType=189]="TupleType",e[e.OptionalType=190]="OptionalType",e[e.RestType=191]="RestType",e[e.UnionType=192]="UnionType",e[e.IntersectionType=193]="IntersectionType",e[e.ConditionalType=194]="ConditionalType",e[e.InferType=195]="InferType",e[e.ParenthesizedType=196]="ParenthesizedType",e[e.ThisType=197]="ThisType",e[e.TypeOperator=198]="TypeOperator",e[e.IndexedAccessType=199]="IndexedAccessType",e[e.MappedType=200]="MappedType",e[e.LiteralType=201]="LiteralType",e[e.NamedTupleMember=202]="NamedTupleMember",e[e.TemplateLiteralType=203]="TemplateLiteralType",e[e.TemplateLiteralTypeSpan=204]="TemplateLiteralTypeSpan",e[e.ImportType=205]="ImportType",e[e.ObjectBindingPattern=206]="ObjectBindingPattern",e[e.ArrayBindingPattern=207]="ArrayBindingPattern",e[e.BindingElement=208]="BindingElement",e[e.ArrayLiteralExpression=209]="ArrayLiteralExpression",e[e.ObjectLiteralExpression=210]="ObjectLiteralExpression",e[e.PropertyAccessExpression=211]="PropertyAccessExpression",e[e.ElementAccessExpression=212]="ElementAccessExpression",e[e.CallExpression=213]="CallExpression",e[e.NewExpression=214]="NewExpression",e[e.TaggedTemplateExpression=215]="TaggedTemplateExpression",e[e.TypeAssertionExpression=216]="TypeAssertionExpression",e[e.ParenthesizedExpression=217]="ParenthesizedExpression",e[e.FunctionExpression=218]="FunctionExpression",e[e.ArrowFunction=219]="ArrowFunction",e[e.DeleteExpression=220]="DeleteExpression",e[e.TypeOfExpression=221]="TypeOfExpression",e[e.VoidExpression=222]="VoidExpression",e[e.AwaitExpression=223]="AwaitExpression",e[e.PrefixUnaryExpression=224]="PrefixUnaryExpression",e[e.PostfixUnaryExpression=225]="PostfixUnaryExpression",e[e.BinaryExpression=226]="BinaryExpression",e[e.ConditionalExpression=227]="ConditionalExpression",e[e.TemplateExpression=228]="TemplateExpression",e[e.YieldExpression=229]="YieldExpression",e[e.SpreadElement=230]="SpreadElement",e[e.ClassExpression=231]="ClassExpression",e[e.OmittedExpression=232]="OmittedExpression",e[e.ExpressionWithTypeArguments=233]="ExpressionWithTypeArguments",e[e.AsExpression=234]="AsExpression",e[e.NonNullExpression=235]="NonNullExpression",e[e.MetaProperty=236]="MetaProperty",e[e.SyntheticExpression=237]="SyntheticExpression",e[e.SatisfiesExpression=238]="SatisfiesExpression",e[e.TemplateSpan=239]="TemplateSpan",e[e.SemicolonClassElement=240]="SemicolonClassElement",e[e.Block=241]="Block",e[e.EmptyStatement=242]="EmptyStatement",e[e.VariableStatement=243]="VariableStatement",e[e.ExpressionStatement=244]="ExpressionStatement",e[e.IfStatement=245]="IfStatement",e[e.DoStatement=246]="DoStatement",e[e.WhileStatement=247]="WhileStatement",e[e.ForStatement=248]="ForStatement",e[e.ForInStatement=249]="ForInStatement",e[e.ForOfStatement=250]="ForOfStatement",e[e.ContinueStatement=251]="ContinueStatement",e[e.BreakStatement=252]="BreakStatement",e[e.ReturnStatement=253]="ReturnStatement",e[e.WithStatement=254]="WithStatement",e[e.SwitchStatement=255]="SwitchStatement",e[e.LabeledStatement=256]="LabeledStatement",e[e.ThrowStatement=257]="ThrowStatement",e[e.TryStatement=258]="TryStatement",e[e.DebuggerStatement=259]="DebuggerStatement",e[e.VariableDeclaration=260]="VariableDeclaration",e[e.VariableDeclarationList=261]="VariableDeclarationList",e[e.FunctionDeclaration=262]="FunctionDeclaration",e[e.ClassDeclaration=263]="ClassDeclaration",e[e.InterfaceDeclaration=264]="InterfaceDeclaration",e[e.TypeAliasDeclaration=265]="TypeAliasDeclaration",e[e.EnumDeclaration=266]="EnumDeclaration",e[e.ModuleDeclaration=267]="ModuleDeclaration",e[e.ModuleBlock=268]="ModuleBlock",e[e.CaseBlock=269]="CaseBlock",e[e.NamespaceExportDeclaration=270]="NamespaceExportDeclaration",e[e.ImportEqualsDeclaration=271]="ImportEqualsDeclaration",e[e.ImportDeclaration=272]="ImportDeclaration",e[e.ImportClause=273]="ImportClause",e[e.NamespaceImport=274]="NamespaceImport",e[e.NamedImports=275]="NamedImports",e[e.ImportSpecifier=276]="ImportSpecifier",e[e.ExportAssignment=277]="ExportAssignment",e[e.ExportDeclaration=278]="ExportDeclaration",e[e.NamedExports=279]="NamedExports",e[e.NamespaceExport=280]="NamespaceExport",e[e.ExportSpecifier=281]="ExportSpecifier",e[e.MissingDeclaration=282]="MissingDeclaration",e[e.ExternalModuleReference=283]="ExternalModuleReference",e[e.JsxElement=284]="JsxElement",e[e.JsxSelfClosingElement=285]="JsxSelfClosingElement",e[e.JsxOpeningElement=286]="JsxOpeningElement",e[e.JsxClosingElement=287]="JsxClosingElement",e[e.JsxFragment=288]="JsxFragment",e[e.JsxOpeningFragment=289]="JsxOpeningFragment",e[e.JsxClosingFragment=290]="JsxClosingFragment",e[e.JsxAttribute=291]="JsxAttribute",e[e.JsxAttributes=292]="JsxAttributes",e[e.JsxSpreadAttribute=293]="JsxSpreadAttribute",e[e.JsxExpression=294]="JsxExpression",e[e.JsxNamespacedName=295]="JsxNamespacedName",e[e.CaseClause=296]="CaseClause",e[e.DefaultClause=297]="DefaultClause",e[e.HeritageClause=298]="HeritageClause",e[e.CatchClause=299]="CatchClause",e[e.ImportAttributes=300]="ImportAttributes",e[e.ImportAttribute=301]="ImportAttribute",e[e.AssertClause=300]="AssertClause",e[e.AssertEntry=301]="AssertEntry",e[e.ImportTypeAssertionContainer=302]="ImportTypeAssertionContainer",e[e.PropertyAssignment=303]="PropertyAssignment",e[e.ShorthandPropertyAssignment=304]="ShorthandPropertyAssignment",e[e.SpreadAssignment=305]="SpreadAssignment",e[e.EnumMember=306]="EnumMember",e[e.SourceFile=307]="SourceFile",e[e.Bundle=308]="Bundle",e[e.JSDocTypeExpression=309]="JSDocTypeExpression",e[e.JSDocNameReference=310]="JSDocNameReference",e[e.JSDocMemberName=311]="JSDocMemberName",e[e.JSDocAllType=312]="JSDocAllType",e[e.JSDocUnknownType=313]="JSDocUnknownType",e[e.JSDocNullableType=314]="JSDocNullableType",e[e.JSDocNonNullableType=315]="JSDocNonNullableType",e[e.JSDocOptionalType=316]="JSDocOptionalType",e[e.JSDocFunctionType=317]="JSDocFunctionType",e[e.JSDocVariadicType=318]="JSDocVariadicType",e[e.JSDocNamepathType=319]="JSDocNamepathType",e[e.JSDoc=320]="JSDoc",e[e.JSDocComment=320]="JSDocComment",e[e.JSDocText=321]="JSDocText",e[e.JSDocTypeLiteral=322]="JSDocTypeLiteral",e[e.JSDocSignature=323]="JSDocSignature",e[e.JSDocLink=324]="JSDocLink",e[e.JSDocLinkCode=325]="JSDocLinkCode",e[e.JSDocLinkPlain=326]="JSDocLinkPlain",e[e.JSDocTag=327]="JSDocTag",e[e.JSDocAugmentsTag=328]="JSDocAugmentsTag",e[e.JSDocImplementsTag=329]="JSDocImplementsTag",e[e.JSDocAuthorTag=330]="JSDocAuthorTag",e[e.JSDocDeprecatedTag=331]="JSDocDeprecatedTag",e[e.JSDocClassTag=332]="JSDocClassTag",e[e.JSDocPublicTag=333]="JSDocPublicTag",e[e.JSDocPrivateTag=334]="JSDocPrivateTag",e[e.JSDocProtectedTag=335]="JSDocProtectedTag",e[e.JSDocReadonlyTag=336]="JSDocReadonlyTag",e[e.JSDocOverrideTag=337]="JSDocOverrideTag",e[e.JSDocCallbackTag=338]="JSDocCallbackTag",e[e.JSDocOverloadTag=339]="JSDocOverloadTag",e[e.JSDocEnumTag=340]="JSDocEnumTag",e[e.JSDocParameterTag=341]="JSDocParameterTag",e[e.JSDocReturnTag=342]="JSDocReturnTag",e[e.JSDocThisTag=343]="JSDocThisTag",e[e.JSDocTypeTag=344]="JSDocTypeTag",e[e.JSDocTemplateTag=345]="JSDocTemplateTag",e[e.JSDocTypedefTag=346]="JSDocTypedefTag",e[e.JSDocSeeTag=347]="JSDocSeeTag",e[e.JSDocPropertyTag=348]="JSDocPropertyTag",e[e.JSDocThrowsTag=349]="JSDocThrowsTag",e[e.JSDocSatisfiesTag=350]="JSDocSatisfiesTag",e[e.JSDocImportTag=351]="JSDocImportTag",e[e.SyntaxList=352]="SyntaxList",e[e.NotEmittedStatement=353]="NotEmittedStatement",e[e.NotEmittedTypeElement=354]="NotEmittedTypeElement",e[e.PartiallyEmittedExpression=355]="PartiallyEmittedExpression",e[e.CommaListExpression=356]="CommaListExpression",e[e.SyntheticReferenceExpression=357]="SyntheticReferenceExpression",e[e.Count=358]="Count",e[e.FirstAssignment=64]="FirstAssignment",e[e.LastAssignment=79]="LastAssignment",e[e.FirstCompoundAssignment=65]="FirstCompoundAssignment",e[e.LastCompoundAssignment=79]="LastCompoundAssignment",e[e.FirstReservedWord=83]="FirstReservedWord",e[e.LastReservedWord=118]="LastReservedWord",e[e.FirstKeyword=83]="FirstKeyword",e[e.LastKeyword=165]="LastKeyword",e[e.FirstFutureReservedWord=119]="FirstFutureReservedWord",e[e.LastFutureReservedWord=127]="LastFutureReservedWord",e[e.FirstTypeNode=182]="FirstTypeNode",e[e.LastTypeNode=205]="LastTypeNode",e[e.FirstPunctuation=19]="FirstPunctuation",e[e.LastPunctuation=79]="LastPunctuation",e[e.FirstToken=0]="FirstToken",e[e.LastToken=165]="LastToken",e[e.FirstTriviaToken=2]="FirstTriviaToken",e[e.LastTriviaToken=7]="LastTriviaToken",e[e.FirstLiteralToken=9]="FirstLiteralToken",e[e.LastLiteralToken=15]="LastLiteralToken",e[e.FirstTemplateToken=15]="FirstTemplateToken",e[e.LastTemplateToken=18]="LastTemplateToken",e[e.FirstBinaryOperator=30]="FirstBinaryOperator",e[e.LastBinaryOperator=79]="LastBinaryOperator",e[e.FirstStatement=243]="FirstStatement",e[e.LastStatement=259]="LastStatement",e[e.FirstNode=166]="FirstNode",e[e.FirstJSDocNode=309]="FirstJSDocNode",e[e.LastJSDocNode=351]="LastJSDocNode",e[e.FirstJSDocTagNode=327]="FirstJSDocTagNode",e[e.LastJSDocTagNode=351]="LastJSDocTagNode",e[e.FirstContextualKeyword=128]="FirstContextualKeyword",e[e.LastContextualKeyword=165]="LastContextualKeyword",e))(Ie||{}),on=(e=>(e[e.None=0]="None",e[e.Let=1]="Let",e[e.Const=2]="Const",e[e.Using=4]="Using",e[e.AwaitUsing=6]="AwaitUsing",e[e.NestedNamespace=8]="NestedNamespace",e[e.Synthesized=16]="Synthesized",e[e.Namespace=32]="Namespace",e[e.OptionalChain=64]="OptionalChain",e[e.ExportContext=128]="ExportContext",e[e.ContainsThis=256]="ContainsThis",e[e.HasImplicitReturn=512]="HasImplicitReturn",e[e.HasExplicitReturn=1024]="HasExplicitReturn",e[e.GlobalAugmentation=2048]="GlobalAugmentation",e[e.HasAsyncFunctions=4096]="HasAsyncFunctions",e[e.DisallowInContext=8192]="DisallowInContext",e[e.YieldContext=16384]="YieldContext",e[e.DecoratorContext=32768]="DecoratorContext",e[e.AwaitContext=65536]="AwaitContext",e[e.DisallowConditionalTypesContext=131072]="DisallowConditionalTypesContext",e[e.ThisNodeHasError=262144]="ThisNodeHasError",e[e.JavaScriptFile=524288]="JavaScriptFile",e[e.ThisNodeOrAnySubNodesHasError=1048576]="ThisNodeOrAnySubNodesHasError",e[e.HasAggregatedChildData=2097152]="HasAggregatedChildData",e[e.PossiblyContainsDynamicImport=4194304]="PossiblyContainsDynamicImport",e[e.PossiblyContainsImportMeta=8388608]="PossiblyContainsImportMeta",e[e.JSDoc=16777216]="JSDoc",e[e.Ambient=33554432]="Ambient",e[e.InWithStatement=67108864]="InWithStatement",e[e.JsonFile=134217728]="JsonFile",e[e.TypeCached=268435456]="TypeCached",e[e.Deprecated=536870912]="Deprecated",e[e.BlockScoped=7]="BlockScoped",e[e.Constant=6]="Constant",e[e.ReachabilityCheckFlags=1536]="ReachabilityCheckFlags",e[e.ReachabilityAndEmitFlags=5632]="ReachabilityAndEmitFlags",e[e.ContextFlags=101441536]="ContextFlags",e[e.TypeExcludesFlags=81920]="TypeExcludesFlags",e[e.PermanentlySetIncrementalFlags=12582912]="PermanentlySetIncrementalFlags",e[e.IdentifierHasExtendedUnicodeEscape=256]="IdentifierHasExtendedUnicodeEscape",e[e.IdentifierIsInJSDocNamespace=4096]="IdentifierIsInJSDocNamespace",e))(on||{}),Qp=(e=>(e[e.None=0]="None",e[e.Public=1]="Public",e[e.Private=2]="Private",e[e.Protected=4]="Protected",e[e.Readonly=8]="Readonly",e[e.Override=16]="Override",e[e.Export=32]="Export",e[e.Abstract=64]="Abstract",e[e.Ambient=128]="Ambient",e[e.Static=256]="Static",e[e.Accessor=512]="Accessor",e[e.Async=1024]="Async",e[e.Default=2048]="Default",e[e.Const=4096]="Const",e[e.In=8192]="In",e[e.Out=16384]="Out",e[e.Decorator=32768]="Decorator",e[e.Deprecated=65536]="Deprecated",e[e.JSDocPublic=8388608]="JSDocPublic",e[e.JSDocPrivate=16777216]="JSDocPrivate",e[e.JSDocProtected=33554432]="JSDocProtected",e[e.JSDocReadonly=67108864]="JSDocReadonly",e[e.JSDocOverride=134217728]="JSDocOverride",e[e.SyntacticOrJSDocModifiers=31]="SyntacticOrJSDocModifiers",e[e.SyntacticOnlyModifiers=65504]="SyntacticOnlyModifiers",e[e.SyntacticModifiers=65535]="SyntacticModifiers",e[e.JSDocCacheOnlyModifiers=260046848]="JSDocCacheOnlyModifiers",e[e.JSDocOnlyModifiers=65536]="JSDocOnlyModifiers",e[e.NonCacheOnlyModifiers=131071]="NonCacheOnlyModifiers",e[e.HasComputedJSDocModifiers=268435456]="HasComputedJSDocModifiers",e[e.HasComputedFlags=536870912]="HasComputedFlags",e[e.AccessibilityModifier=7]="AccessibilityModifier",e[e.ParameterPropertyModifier=31]="ParameterPropertyModifier",e[e.NonPublicAccessibilityModifier=6]="NonPublicAccessibilityModifier",e[e.TypeScriptModifier=28895]="TypeScriptModifier",e[e.ExportDefault=2080]="ExportDefault",e[e.All=131071]="All",e[e.Modifier=98303]="Modifier",e))(Qp||{});var Pm=(e=>(e[e.None=0]="None",e[e.Succeeded=1]="Succeeded",e[e.Failed=2]="Failed",e[e.ReportsUnmeasurable=8]="ReportsUnmeasurable",e[e.ReportsUnreliable=16]="ReportsUnreliable",e[e.ReportsMask=24]="ReportsMask",e[e.ComplexityOverflow=32]="ComplexityOverflow",e[e.StackDepthOverflow=64]="StackDepthOverflow",e[e.Overflow=96]="Overflow",e))(Pm||{});var Op=(e=>(e[e.Unreachable=1]="Unreachable",e[e.Start=2]="Start",e[e.BranchLabel=4]="BranchLabel",e[e.LoopLabel=8]="LoopLabel",e[e.Assignment=16]="Assignment",e[e.TrueCondition=32]="TrueCondition",e[e.FalseCondition=64]="FalseCondition",e[e.SwitchClause=128]="SwitchClause",e[e.ArrayMutation=256]="ArrayMutation",e[e.Call=512]="Call",e[e.ReduceLabel=1024]="ReduceLabel",e[e.Referenced=2048]="Referenced",e[e.Shared=4096]="Shared",e[e.Label=12]="Label",e[e.Condition=96]="Condition",e))(Op||{});var Kp=(e=>(e[e.None=0]="None",e[e.FunctionScopedVariable=1]="FunctionScopedVariable",e[e.BlockScopedVariable=2]="BlockScopedVariable",e[e.Property=4]="Property",e[e.EnumMember=8]="EnumMember",e[e.Function=16]="Function",e[e.Class=32]="Class",e[e.Interface=64]="Interface",e[e.ConstEnum=128]="ConstEnum",e[e.RegularEnum=256]="RegularEnum",e[e.ValueModule=512]="ValueModule",e[e.NamespaceModule=1024]="NamespaceModule",e[e.TypeLiteral=2048]="TypeLiteral",e[e.ObjectLiteral=4096]="ObjectLiteral",e[e.Method=8192]="Method",e[e.Constructor=16384]="Constructor",e[e.GetAccessor=32768]="GetAccessor",e[e.SetAccessor=65536]="SetAccessor",e[e.Signature=131072]="Signature",e[e.TypeParameter=262144]="TypeParameter",e[e.TypeAlias=524288]="TypeAlias",e[e.ExportValue=1048576]="ExportValue",e[e.Alias=2097152]="Alias",e[e.Prototype=4194304]="Prototype",e[e.ExportStar=8388608]="ExportStar",e[e.Optional=16777216]="Optional",e[e.Transient=33554432]="Transient",e[e.Assignment=67108864]="Assignment",e[e.ModuleExports=134217728]="ModuleExports",e[e.All=-1]="All",e[e.Enum=384]="Enum",e[e.Variable=3]="Variable",e[e.Value=111551]="Value",e[e.Type=788968]="Type",e[e.Namespace=1920]="Namespace",e[e.Module=1536]="Module",e[e.Accessor=98304]="Accessor",e[e.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",e[e.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",e[e.ParameterExcludes=111551]="ParameterExcludes",e[e.PropertyExcludes=0]="PropertyExcludes",e[e.EnumMemberExcludes=900095]="EnumMemberExcludes",e[e.FunctionExcludes=110991]="FunctionExcludes",e[e.ClassExcludes=899503]="ClassExcludes",e[e.InterfaceExcludes=788872]="InterfaceExcludes",e[e.RegularEnumExcludes=899327]="RegularEnumExcludes",e[e.ConstEnumExcludes=899967]="ConstEnumExcludes",e[e.ValueModuleExcludes=110735]="ValueModuleExcludes",e[e.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",e[e.MethodExcludes=103359]="MethodExcludes",e[e.GetAccessorExcludes=46015]="GetAccessorExcludes",e[e.SetAccessorExcludes=78783]="SetAccessorExcludes",e[e.AccessorExcludes=13247]="AccessorExcludes",e[e.TypeParameterExcludes=526824]="TypeParameterExcludes",e[e.TypeAliasExcludes=788968]="TypeAliasExcludes",e[e.AliasExcludes=2097152]="AliasExcludes",e[e.ModuleMember=2623475]="ModuleMember",e[e.ExportHasLocal=944]="ExportHasLocal",e[e.BlockScoped=418]="BlockScoped",e[e.PropertyOrAccessor=98308]="PropertyOrAccessor",e[e.ClassMember=106500]="ClassMember",e[e.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",e[e.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",e[e.Classifiable=2885600]="Classifiable",e[e.LateBindingContainer=6256]="LateBindingContainer",e))(Kp||{});var Nm=(e=>(e[e.None=0]="None",e[e.TypeChecked=1]="TypeChecked",e[e.LexicalThis=2]="LexicalThis",e[e.CaptureThis=4]="CaptureThis",e[e.CaptureNewTarget=8]="CaptureNewTarget",e[e.SuperInstance=16]="SuperInstance",e[e.SuperStatic=32]="SuperStatic",e[e.ContextChecked=64]="ContextChecked",e[e.MethodWithSuperPropertyAccessInAsync=128]="MethodWithSuperPropertyAccessInAsync",e[e.MethodWithSuperPropertyAssignmentInAsync=256]="MethodWithSuperPropertyAssignmentInAsync",e[e.CaptureArguments=512]="CaptureArguments",e[e.EnumValuesComputed=1024]="EnumValuesComputed",e[e.LexicalModuleMergesWithClass=2048]="LexicalModuleMergesWithClass",e[e.LoopWithCapturedBlockScopedBinding=4096]="LoopWithCapturedBlockScopedBinding",e[e.ContainsCapturedBlockScopeBinding=8192]="ContainsCapturedBlockScopeBinding",e[e.CapturedBlockScopedBinding=16384]="CapturedBlockScopedBinding",e[e.BlockScopedBindingInLoop=32768]="BlockScopedBindingInLoop",e[e.NeedsLoopOutParameter=65536]="NeedsLoopOutParameter",e[e.AssignmentsMarked=131072]="AssignmentsMarked",e[e.ContainsConstructorReference=262144]="ContainsConstructorReference",e[e.ConstructorReference=536870912]="ConstructorReference",e[e.ContainsClassWithPrivateIdentifiers=1048576]="ContainsClassWithPrivateIdentifiers",e[e.ContainsSuperPropertyInStaticInitializer=2097152]="ContainsSuperPropertyInStaticInitializer",e[e.InCheckIdentifier=4194304]="InCheckIdentifier",e[e.PartiallyTypeChecked=8388608]="PartiallyTypeChecked",e[e.LazyFlags=539358128]="LazyFlags",e))(Nm||{}),nn=(e=>(e[e.Any=1]="Any",e[e.Unknown=2]="Unknown",e[e.String=4]="String",e[e.Number=8]="Number",e[e.Boolean=16]="Boolean",e[e.Enum=32]="Enum",e[e.BigInt=64]="BigInt",e[e.StringLiteral=128]="StringLiteral",e[e.NumberLiteral=256]="NumberLiteral",e[e.BooleanLiteral=512]="BooleanLiteral",e[e.EnumLiteral=1024]="EnumLiteral",e[e.BigIntLiteral=2048]="BigIntLiteral",e[e.ESSymbol=4096]="ESSymbol",e[e.UniqueESSymbol=8192]="UniqueESSymbol",e[e.Void=16384]="Void",e[e.Undefined=32768]="Undefined",e[e.Null=65536]="Null",e[e.Never=131072]="Never",e[e.TypeParameter=262144]="TypeParameter",e[e.Object=524288]="Object",e[e.Union=1048576]="Union",e[e.Intersection=2097152]="Intersection",e[e.Index=4194304]="Index",e[e.IndexedAccess=8388608]="IndexedAccess",e[e.Conditional=16777216]="Conditional",e[e.Substitution=33554432]="Substitution",e[e.NonPrimitive=67108864]="NonPrimitive",e[e.TemplateLiteral=134217728]="TemplateLiteral",e[e.StringMapping=268435456]="StringMapping",e[e.Reserved1=536870912]="Reserved1",e[e.Reserved2=1073741824]="Reserved2",e[e.AnyOrUnknown=3]="AnyOrUnknown",e[e.Nullable=98304]="Nullable",e[e.Literal=2944]="Literal",e[e.Unit=109472]="Unit",e[e.Freshable=2976]="Freshable",e[e.StringOrNumberLiteral=384]="StringOrNumberLiteral",e[e.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",e[e.DefinitelyFalsy=117632]="DefinitelyFalsy",e[e.PossiblyFalsy=117724]="PossiblyFalsy",e[e.Intrinsic=67359327]="Intrinsic",e[e.StringLike=402653316]="StringLike",e[e.NumberLike=296]="NumberLike",e[e.BigIntLike=2112]="BigIntLike",e[e.BooleanLike=528]="BooleanLike",e[e.EnumLike=1056]="EnumLike",e[e.ESSymbolLike=12288]="ESSymbolLike",e[e.VoidLike=49152]="VoidLike",e[e.Primitive=402784252]="Primitive",e[e.DefinitelyNonNullable=470302716]="DefinitelyNonNullable",e[e.DisjointDomains=469892092]="DisjointDomains",e[e.UnionOrIntersection=3145728]="UnionOrIntersection",e[e.StructuredType=3670016]="StructuredType",e[e.TypeVariable=8650752]="TypeVariable",e[e.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",e[e.InstantiablePrimitive=406847488]="InstantiablePrimitive",e[e.Instantiable=465829888]="Instantiable",e[e.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",e[e.ObjectFlagsType=3899393]="ObjectFlagsType",e[e.Simplifiable=25165824]="Simplifiable",e[e.Singleton=67358815]="Singleton",e[e.Narrowable=536624127]="Narrowable",e[e.IncludesMask=473694207]="IncludesMask",e[e.IncludesMissingType=262144]="IncludesMissingType",e[e.IncludesNonWideningType=4194304]="IncludesNonWideningType",e[e.IncludesWildcard=8388608]="IncludesWildcard",e[e.IncludesEmptyObject=16777216]="IncludesEmptyObject",e[e.IncludesInstantiable=33554432]="IncludesInstantiable",e[e.IncludesConstrainedTypeVariable=536870912]="IncludesConstrainedTypeVariable",e[e.IncludesError=1073741824]="IncludesError",e[e.NotPrimitiveUnion=36323331]="NotPrimitiveUnion",e))(nn||{}),Zp=(e=>(e[e.None=0]="None",e[e.Class=1]="Class",e[e.Interface=2]="Interface",e[e.Reference=4]="Reference",e[e.Tuple=8]="Tuple",e[e.Anonymous=16]="Anonymous",e[e.Mapped=32]="Mapped",e[e.Instantiated=64]="Instantiated",e[e.ObjectLiteral=128]="ObjectLiteral",e[e.EvolvingArray=256]="EvolvingArray",e[e.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",e[e.ReverseMapped=1024]="ReverseMapped",e[e.JsxAttributes=2048]="JsxAttributes",e[e.JSLiteral=4096]="JSLiteral",e[e.FreshLiteral=8192]="FreshLiteral",e[e.ArrayLiteral=16384]="ArrayLiteral",e[e.PrimitiveUnion=32768]="PrimitiveUnion",e[e.ContainsWideningType=65536]="ContainsWideningType",e[e.ContainsObjectOrArrayLiteral=131072]="ContainsObjectOrArrayLiteral",e[e.NonInferrableType=262144]="NonInferrableType",e[e.CouldContainTypeVariablesComputed=524288]="CouldContainTypeVariablesComputed",e[e.CouldContainTypeVariables=1048576]="CouldContainTypeVariables",e[e.ClassOrInterface=3]="ClassOrInterface",e[e.RequiresWidening=196608]="RequiresWidening",e[e.PropagatingFlags=458752]="PropagatingFlags",e[e.InstantiatedMapped=96]="InstantiatedMapped",e[e.ObjectTypeKindMask=1343]="ObjectTypeKindMask",e[e.ContainsSpread=2097152]="ContainsSpread",e[e.ObjectRestType=4194304]="ObjectRestType",e[e.InstantiationExpressionType=8388608]="InstantiationExpressionType",e[e.SingleSignatureType=134217728]="SingleSignatureType",e[e.IsClassInstanceClone=16777216]="IsClassInstanceClone",e[e.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",e[e.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",e[e.IsGenericTypeComputed=2097152]="IsGenericTypeComputed",e[e.IsGenericObjectType=4194304]="IsGenericObjectType",e[e.IsGenericIndexType=8388608]="IsGenericIndexType",e[e.IsGenericType=12582912]="IsGenericType",e[e.ContainsIntersections=16777216]="ContainsIntersections",e[e.IsUnknownLikeUnionComputed=33554432]="IsUnknownLikeUnionComputed",e[e.IsUnknownLikeUnion=67108864]="IsUnknownLikeUnion",e[e.IsNeverIntersectionComputed=16777216]="IsNeverIntersectionComputed",e[e.IsNeverIntersection=33554432]="IsNeverIntersection",e[e.IsConstrainedTypeVariable=67108864]="IsConstrainedTypeVariable",e))(Zp||{});var Im=(e=>(e[e.None=0]="None",e[e.HasRestParameter=1]="HasRestParameter",e[e.HasLiteralTypes=2]="HasLiteralTypes",e[e.Abstract=4]="Abstract",e[e.IsInnerCallChain=8]="IsInnerCallChain",e[e.IsOuterCallChain=16]="IsOuterCallChain",e[e.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",e[e.IsNonInferrable=64]="IsNonInferrable",e[e.IsSignatureCandidateForOverloadFailure=128]="IsSignatureCandidateForOverloadFailure",e[e.PropagatingFlags=167]="PropagatingFlags",e[e.CallChainFlags=24]="CallChainFlags",e))(Im||{});var Dr=(e=>(e[e.Unknown=0]="Unknown",e[e.JS=1]="JS",e[e.JSX=2]="JSX",e[e.TS=3]="TS",e[e.TSX=4]="TSX",e[e.External=5]="External",e[e.JSON=6]="JSON",e[e.Deferred=7]="Deferred",e))(Dr||{}),ys=(e=>(e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES2015=2]="ES2015",e[e.ES2016=3]="ES2016",e[e.ES2017=4]="ES2017",e[e.ES2018=5]="ES2018",e[e.ES2019=6]="ES2019",e[e.ES2020=7]="ES2020",e[e.ES2021=8]="ES2021",e[e.ES2022=9]="ES2022",e[e.ES2023=10]="ES2023",e[e.ES2024=11]="ES2024",e[e.ESNext=99]="ESNext",e[e.JSON=100]="JSON",e[e.Latest=99]="Latest",e))(ys||{}),Tl=(e=>(e[e.Standard=0]="Standard",e[e.JSX=1]="JSX",e))(Tl||{});var Nn=(e=>(e.Ts=".ts",e.Tsx=".tsx",e.Dts=".d.ts",e.Js=".js",e.Jsx=".jsx",e.Json=".json",e.TsBuildInfo=".tsbuildinfo",e.Mjs=".mjs",e.Mts=".mts",e.Dmts=".d.mts",e.Cjs=".cjs",e.Cts=".cts",e.Dcts=".d.cts",e))(Nn||{}),Om=(e=>(e[e.None=0]="None",e[e.ContainsTypeScript=1]="ContainsTypeScript",e[e.ContainsJsx=2]="ContainsJsx",e[e.ContainsESNext=4]="ContainsESNext",e[e.ContainsES2022=8]="ContainsES2022",e[e.ContainsES2021=16]="ContainsES2021",e[e.ContainsES2020=32]="ContainsES2020",e[e.ContainsES2019=64]="ContainsES2019",e[e.ContainsES2018=128]="ContainsES2018",e[e.ContainsES2017=256]="ContainsES2017",e[e.ContainsES2016=512]="ContainsES2016",e[e.ContainsES2015=1024]="ContainsES2015",e[e.ContainsGenerator=2048]="ContainsGenerator",e[e.ContainsDestructuringAssignment=4096]="ContainsDestructuringAssignment",e[e.ContainsTypeScriptClassSyntax=8192]="ContainsTypeScriptClassSyntax",e[e.ContainsLexicalThis=16384]="ContainsLexicalThis",e[e.ContainsRestOrSpread=32768]="ContainsRestOrSpread",e[e.ContainsObjectRestOrSpread=65536]="ContainsObjectRestOrSpread",e[e.ContainsComputedPropertyName=131072]="ContainsComputedPropertyName",e[e.ContainsBlockScopedBinding=262144]="ContainsBlockScopedBinding",e[e.ContainsBindingPattern=524288]="ContainsBindingPattern",e[e.ContainsYield=1048576]="ContainsYield",e[e.ContainsAwait=2097152]="ContainsAwait",e[e.ContainsHoistedDeclarationOrCompletion=4194304]="ContainsHoistedDeclarationOrCompletion",e[e.ContainsDynamicImport=8388608]="ContainsDynamicImport",e[e.ContainsClassFields=16777216]="ContainsClassFields",e[e.ContainsDecorators=33554432]="ContainsDecorators",e[e.ContainsPossibleTopLevelAwait=67108864]="ContainsPossibleTopLevelAwait",e[e.ContainsLexicalSuper=134217728]="ContainsLexicalSuper",e[e.ContainsUpdateExpressionForIdentifier=268435456]="ContainsUpdateExpressionForIdentifier",e[e.ContainsPrivateIdentifierInExpression=536870912]="ContainsPrivateIdentifierInExpression",e[e.HasComputedFlags=-2147483648]="HasComputedFlags",e[e.AssertTypeScript=1]="AssertTypeScript",e[e.AssertJsx=2]="AssertJsx",e[e.AssertESNext=4]="AssertESNext",e[e.AssertES2022=8]="AssertES2022",e[e.AssertES2021=16]="AssertES2021",e[e.AssertES2020=32]="AssertES2020",e[e.AssertES2019=64]="AssertES2019",e[e.AssertES2018=128]="AssertES2018",e[e.AssertES2017=256]="AssertES2017",e[e.AssertES2016=512]="AssertES2016",e[e.AssertES2015=1024]="AssertES2015",e[e.AssertGenerator=2048]="AssertGenerator",e[e.AssertDestructuringAssignment=4096]="AssertDestructuringAssignment",e[e.OuterExpressionExcludes=-2147483648]="OuterExpressionExcludes",e[e.PropertyAccessExcludes=-2147483648]="PropertyAccessExcludes",e[e.NodeExcludes=-2147483648]="NodeExcludes",e[e.ArrowFunctionExcludes=-2072174592]="ArrowFunctionExcludes",e[e.FunctionExcludes=-1937940480]="FunctionExcludes",e[e.ConstructorExcludes=-1937948672]="ConstructorExcludes",e[e.MethodOrAccessorExcludes=-2005057536]="MethodOrAccessorExcludes",e[e.PropertyExcludes=-2013249536]="PropertyExcludes",e[e.ClassExcludes=-2147344384]="ClassExcludes",e[e.ModuleExcludes=-1941676032]="ModuleExcludes",e[e.TypeExcludes=-2]="TypeExcludes",e[e.ObjectLiteralExcludes=-2147278848]="ObjectLiteralExcludes",e[e.ArrayLiteralOrCallOrNewExcludes=-2147450880]="ArrayLiteralOrCallOrNewExcludes",e[e.VariableDeclarationListExcludes=-2146893824]="VariableDeclarationListExcludes",e[e.ParameterExcludes=-2147483648]="ParameterExcludes",e[e.CatchClauseExcludes=-2147418112]="CatchClauseExcludes",e[e.BindingPatternExcludes=-2147450880]="BindingPatternExcludes",e[e.ContainsLexicalThisOrSuper=134234112]="ContainsLexicalThisOrSuper",e[e.PropertyNamePropagatingFlags=134234112]="PropertyNamePropagatingFlags",e))(Om||{}),Mm=(e=>(e[e.TabStop=0]="TabStop",e[e.Placeholder=1]="Placeholder",e[e.Choice=2]="Choice",e[e.Variable=3]="Variable",e))(Mm||{}),Jm=(e=>(e[e.None=0]="None",e[e.SingleLine=1]="SingleLine",e[e.MultiLine=2]="MultiLine",e[e.AdviseOnEmitNode=4]="AdviseOnEmitNode",e[e.NoSubstitution=8]="NoSubstitution",e[e.CapturesThis=16]="CapturesThis",e[e.NoLeadingSourceMap=32]="NoLeadingSourceMap",e[e.NoTrailingSourceMap=64]="NoTrailingSourceMap",e[e.NoSourceMap=96]="NoSourceMap",e[e.NoNestedSourceMaps=128]="NoNestedSourceMaps",e[e.NoTokenLeadingSourceMaps=256]="NoTokenLeadingSourceMaps",e[e.NoTokenTrailingSourceMaps=512]="NoTokenTrailingSourceMaps",e[e.NoTokenSourceMaps=768]="NoTokenSourceMaps",e[e.NoLeadingComments=1024]="NoLeadingComments",e[e.NoTrailingComments=2048]="NoTrailingComments",e[e.NoComments=3072]="NoComments",e[e.NoNestedComments=4096]="NoNestedComments",e[e.HelperName=8192]="HelperName",e[e.ExportName=16384]="ExportName",e[e.LocalName=32768]="LocalName",e[e.InternalName=65536]="InternalName",e[e.Indented=131072]="Indented",e[e.NoIndentation=262144]="NoIndentation",e[e.AsyncFunctionBody=524288]="AsyncFunctionBody",e[e.ReuseTempVariableScope=1048576]="ReuseTempVariableScope",e[e.CustomPrologue=2097152]="CustomPrologue",e[e.NoHoisting=4194304]="NoHoisting",e[e.Iterator=8388608]="Iterator",e[e.NoAsciiEscaping=16777216]="NoAsciiEscaping",e))(Jm||{});var Q_={Classes:2,ForOf:2,Generators:2,Iteration:2,SpreadElements:2,RestElements:2,TaggedTemplates:2,DestructuringAssignment:2,BindingPatterns:2,ArrowFunctions:2,BlockScopedVariables:2,ObjectAssign:2,RegularExpressionFlagsUnicode:2,RegularExpressionFlagsSticky:2,Exponentiation:3,AsyncFunctions:4,ForAwaitOf:5,AsyncGenerators:5,AsyncIteration:5,ObjectSpreadRest:5,RegularExpressionFlagsDotAll:5,BindinglessCatch:6,BigInt:7,NullishCoalesce:7,OptionalChaining:7,LogicalAssignment:8,TopLevelAwait:9,ClassFields:9,PrivateNamesAndClassStaticBlocks:9,RegularExpressionFlagsHasIndices:9,ShebangComments:10,RegularExpressionFlagsUnicodeSets:11,UsingAndAwaitUsing:99,ClassAndClassElementDecorators:99};var Lm={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0},{name:"resolution-mode",optional:!0},{name:"preserve",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}},Ga=(e=>(e[e.ParseAll=0]="ParseAll",e[e.ParseNone=1]="ParseNone",e[e.ParseForTypeErrors=2]="ParseForTypeErrors",e[e.ParseForTypeInfo=3]="ParseForTypeInfo",e))(Ga||{});var Ki="/",Py="\\",Ed="://",Ny=/\\/g;function Iy(e){return e===47||e===92}function Oy(e,t){return e.length>t.length&&ky(e,t)}function ef(e){return e.length>0&&Iy(e.charCodeAt(e.length-1))}function Ad(e){return e>=97&&e<=122||e>=65&&e<=90}function My(e,t){let a=e.charCodeAt(t);if(a===58)return t+1;if(a===37&&e.charCodeAt(t+1)===51){let o=e.charCodeAt(t+2);if(o===97||o===65)return t+3}return-1}function Jy(e){if(!e)return 0;let t=e.charCodeAt(0);if(t===47||t===92){if(e.charCodeAt(1)!==t)return 1;let o=e.indexOf(t===47?Ki:Py,2);return o<0?e.length:o+1}if(Ad(t)&&e.charCodeAt(1)===58){let o=e.charCodeAt(2);if(o===47||o===92)return 3;if(e.length===2)return 2}let a=e.indexOf(Ed);if(a!==-1){let o=a+Ed.length,m=e.indexOf(Ki,o);if(m!==-1){let v=e.slice(0,a),A=e.slice(o,m);if(v==="file"&&(A===""||A==="localhost")&&Ad(e.charCodeAt(m+1))){let P=My(e,m+2);if(P!==-1){if(e.charCodeAt(P)===47)return~(P+1);if(P===e.length)return~P}}return~(m+1)}return~e.length}return 0}function pl(e){let t=Jy(e);return t<0?~t:t}function jm(e,t,a){if(e=fl(e),pl(e)===e.length)return"";e=Um(e);let m=e.slice(Math.max(pl(e),e.lastIndexOf(Ki)+1)),v=t!==void 0&&a!==void 0?Rm(m,t,a):void 0;return v?m.slice(0,m.length-v.length):m}function Cd(e,t,a){if(ul(t,".")||(t="."+t),e.length>=t.length&&e.charCodeAt(e.length-t.length)===46){let o=e.slice(e.length-t.length);if(a(o,t))return o}}function Ly(e,t,a){if(typeof t=="string")return Cd(e,t,a)||"";for(let o of t){let m=Cd(e,o,a);if(m)return m}return""}function Rm(e,t,a){if(t)return Ly(Um(e),t,a?$p:Ty);let o=jm(e),m=o.lastIndexOf(".");return m>=0?o.substring(m):""}function jy(e,t){let a=e.substring(0,t),o=e.substring(t).split(Ki);return o.length&&!Yi(o)&&o.pop(),[a,...o]}function Ry(e,t=""){return e=qy(t,e),jy(e,pl(e))}function Uy(e,t){return e.length===0?"":(e[0]&&tf(e[0]))+e.slice(1,t).join(Ki)}function fl(e){return e.includes("\\")?e.replace(Ny,Ki):e}function By(e){if(!Xt(e))return[];let t=[e[0]];for(let a=1;a1){if(t[t.length-1]!==".."){t.pop();continue}}else if(t[0])continue}t.push(o)}}return t}function qy(e,...t){e&&(e=fl(e));for(let a of t)a&&(a=fl(a),!e||pl(a)!==0?e=a:e=tf(e)+a);return e}function zy(e){if(e=fl(e),!Dd.test(e))return e;let t=e.replace(/\/\.\//g,"/").replace(/^\.\//,"");if(t!==e&&(e=t,!Dd.test(e)))return e;let a=Uy(By(Ry(e)));return a&&ef(e)?tf(a):a}function Um(e){return ef(e)?e.substr(0,e.length-1):e}function tf(e){return ef(e)?e:e+Ki}var Dd=/\/\/|(?:^|\/)\.\.?(?:$|\/)/;function r(e,t,a,o,m,v,A){return{code:e,category:t,key:a,message:o,reportsUnnecessary:m,elidedInCompatabilityPyramid:v,reportsDeprecated:A}}var E={Unterminated_string_literal:r(1002,1,"Unterminated_string_literal_1002","Unterminated string literal."),Identifier_expected:r(1003,1,"Identifier_expected_1003","Identifier expected."),_0_expected:r(1005,1,"_0_expected_1005","'{0}' expected."),A_file_cannot_have_a_reference_to_itself:r(1006,1,"A_file_cannot_have_a_reference_to_itself_1006","A file cannot have a reference to itself."),The_parser_expected_to_find_a_1_to_match_the_0_token_here:r(1007,1,"The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007","The parser expected to find a '{1}' to match the '{0}' token here."),Trailing_comma_not_allowed:r(1009,1,"Trailing_comma_not_allowed_1009","Trailing comma not allowed."),Asterisk_Slash_expected:r(1010,1,"Asterisk_Slash_expected_1010","'*/' expected."),An_element_access_expression_should_take_an_argument:r(1011,1,"An_element_access_expression_should_take_an_argument_1011","An element access expression should take an argument."),Unexpected_token:r(1012,1,"Unexpected_token_1012","Unexpected token."),A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma:r(1013,1,"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013","A rest parameter or binding pattern may not have a trailing comma."),A_rest_parameter_must_be_last_in_a_parameter_list:r(1014,1,"A_rest_parameter_must_be_last_in_a_parameter_list_1014","A rest parameter must be last in a parameter list."),Parameter_cannot_have_question_mark_and_initializer:r(1015,1,"Parameter_cannot_have_question_mark_and_initializer_1015","Parameter cannot have question mark and initializer."),A_required_parameter_cannot_follow_an_optional_parameter:r(1016,1,"A_required_parameter_cannot_follow_an_optional_parameter_1016","A required parameter cannot follow an optional parameter."),An_index_signature_cannot_have_a_rest_parameter:r(1017,1,"An_index_signature_cannot_have_a_rest_parameter_1017","An index signature cannot have a rest parameter."),An_index_signature_parameter_cannot_have_an_accessibility_modifier:r(1018,1,"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018","An index signature parameter cannot have an accessibility modifier."),An_index_signature_parameter_cannot_have_a_question_mark:r(1019,1,"An_index_signature_parameter_cannot_have_a_question_mark_1019","An index signature parameter cannot have a question mark."),An_index_signature_parameter_cannot_have_an_initializer:r(1020,1,"An_index_signature_parameter_cannot_have_an_initializer_1020","An index signature parameter cannot have an initializer."),An_index_signature_must_have_a_type_annotation:r(1021,1,"An_index_signature_must_have_a_type_annotation_1021","An index signature must have a type annotation."),An_index_signature_parameter_must_have_a_type_annotation:r(1022,1,"An_index_signature_parameter_must_have_a_type_annotation_1022","An index signature parameter must have a type annotation."),readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature:r(1024,1,"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024","'readonly' modifier can only appear on a property declaration or index signature."),An_index_signature_cannot_have_a_trailing_comma:r(1025,1,"An_index_signature_cannot_have_a_trailing_comma_1025","An index signature cannot have a trailing comma."),Accessibility_modifier_already_seen:r(1028,1,"Accessibility_modifier_already_seen_1028","Accessibility modifier already seen."),_0_modifier_must_precede_1_modifier:r(1029,1,"_0_modifier_must_precede_1_modifier_1029","'{0}' modifier must precede '{1}' modifier."),_0_modifier_already_seen:r(1030,1,"_0_modifier_already_seen_1030","'{0}' modifier already seen."),_0_modifier_cannot_appear_on_class_elements_of_this_kind:r(1031,1,"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031","'{0}' modifier cannot appear on class elements of this kind."),super_must_be_followed_by_an_argument_list_or_member_access:r(1034,1,"super_must_be_followed_by_an_argument_list_or_member_access_1034","'super' must be followed by an argument list or member access."),Only_ambient_modules_can_use_quoted_names:r(1035,1,"Only_ambient_modules_can_use_quoted_names_1035","Only ambient modules can use quoted names."),Statements_are_not_allowed_in_ambient_contexts:r(1036,1,"Statements_are_not_allowed_in_ambient_contexts_1036","Statements are not allowed in ambient contexts."),A_declare_modifier_cannot_be_used_in_an_already_ambient_context:r(1038,1,"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038","A 'declare' modifier cannot be used in an already ambient context."),Initializers_are_not_allowed_in_ambient_contexts:r(1039,1,"Initializers_are_not_allowed_in_ambient_contexts_1039","Initializers are not allowed in ambient contexts."),_0_modifier_cannot_be_used_in_an_ambient_context:r(1040,1,"_0_modifier_cannot_be_used_in_an_ambient_context_1040","'{0}' modifier cannot be used in an ambient context."),_0_modifier_cannot_be_used_here:r(1042,1,"_0_modifier_cannot_be_used_here_1042","'{0}' modifier cannot be used here."),_0_modifier_cannot_appear_on_a_module_or_namespace_element:r(1044,1,"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044","'{0}' modifier cannot appear on a module or namespace element."),Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier:r(1046,1,"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046","Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),A_rest_parameter_cannot_be_optional:r(1047,1,"A_rest_parameter_cannot_be_optional_1047","A rest parameter cannot be optional."),A_rest_parameter_cannot_have_an_initializer:r(1048,1,"A_rest_parameter_cannot_have_an_initializer_1048","A rest parameter cannot have an initializer."),A_set_accessor_must_have_exactly_one_parameter:r(1049,1,"A_set_accessor_must_have_exactly_one_parameter_1049","A 'set' accessor must have exactly one parameter."),A_set_accessor_cannot_have_an_optional_parameter:r(1051,1,"A_set_accessor_cannot_have_an_optional_parameter_1051","A 'set' accessor cannot have an optional parameter."),A_set_accessor_parameter_cannot_have_an_initializer:r(1052,1,"A_set_accessor_parameter_cannot_have_an_initializer_1052","A 'set' accessor parameter cannot have an initializer."),A_set_accessor_cannot_have_rest_parameter:r(1053,1,"A_set_accessor_cannot_have_rest_parameter_1053","A 'set' accessor cannot have rest parameter."),A_get_accessor_cannot_have_parameters:r(1054,1,"A_get_accessor_cannot_have_parameters_1054","A 'get' accessor cannot have parameters."),Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value:r(1055,1,"Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compa_1055","Type '{0}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value."),Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher:r(1056,1,"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056","Accessors are only available when targeting ECMAScript 5 and higher."),The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:r(1058,1,"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058","The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),A_promise_must_have_a_then_method:r(1059,1,"A_promise_must_have_a_then_method_1059","A promise must have a 'then' method."),The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback:r(1060,1,"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060","The first parameter of the 'then' method of a promise must be a callback."),Enum_member_must_have_initializer:r(1061,1,"Enum_member_must_have_initializer_1061","Enum member must have initializer."),Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method:r(1062,1,"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062","Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),An_export_assignment_cannot_be_used_in_a_namespace:r(1063,1,"An_export_assignment_cannot_be_used_in_a_namespace_1063","An export assignment cannot be used in a namespace."),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0:r(1064,1,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064","The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise<{0}>'?"),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type:r(1065,1,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065","The return type of an async function or method must be the global Promise type."),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:r(1066,1,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:r(1068,1,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:r(1069,1,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:r(1070,1,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:r(1071,1,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:r(1079,1,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:r(1084,1,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),_0_modifier_cannot_appear_on_a_constructor_declaration:r(1089,1,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:r(1090,1,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:r(1091,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:r(1092,1,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:r(1093,1,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:r(1094,1,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:r(1095,1,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:r(1096,1,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:r(1097,1,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:r(1098,1,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:r(1099,1,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:r(1100,1,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:r(1101,1,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:r(1102,1,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:r(1103,1,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:r(1104,1,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:r(1105,1,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:r(1106,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:r(1107,1,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:r(1108,1,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:r(1109,1,"Expression_expected_1109","Expression expected."),Type_expected:r(1110,1,"Type_expected_1110","Type expected."),Private_field_0_must_be_declared_in_an_enclosing_class:r(1111,1,"Private_field_0_must_be_declared_in_an_enclosing_class_1111","Private field '{0}' must be declared in an enclosing class."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:r(1113,1,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:r(1114,1,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:r(1115,1,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:r(1116,1,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name:r(1117,1,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117","An object literal cannot have multiple properties with the same name."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:r(1118,1,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:r(1119,1,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:r(1120,1,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_Use_the_syntax_0:r(1121,1,"Octal_literals_are_not_allowed_Use_the_syntax_0_1121","Octal literals are not allowed. Use the syntax '{0}'."),Variable_declaration_list_cannot_be_empty:r(1123,1,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:r(1124,1,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:r(1125,1,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:r(1126,1,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:r(1127,1,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:r(1128,1,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:r(1129,1,"Statement_expected_1129","Statement expected."),case_or_default_expected:r(1130,1,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:r(1131,1,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:r(1132,1,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:r(1134,1,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:r(1135,1,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:r(1136,1,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:r(1137,1,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:r(1138,1,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:r(1139,1,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:r(1140,1,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:r(1141,1,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:r(1142,1,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:r(1144,1,"or_expected_1144","'{' or ';' expected."),or_JSX_element_expected:r(1145,1,"or_JSX_element_expected_1145","'{' or JSX element expected."),Declaration_expected:r(1146,1,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:r(1147,1,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:r(1148,1,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:r(1149,1,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),_0_declarations_must_be_initialized:r(1155,1,"_0_declarations_must_be_initialized_1155","'{0}' declarations must be initialized."),_0_declarations_can_only_be_declared_inside_a_block:r(1156,1,"_0_declarations_can_only_be_declared_inside_a_block_1156","'{0}' declarations can only be declared inside a block."),Unterminated_template_literal:r(1160,1,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:r(1161,1,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:r(1162,1,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:r(1163,1,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:r(1164,1,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:r(1165,1,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:r(1166,1,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:r(1168,1,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:r(1169,1,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:r(1170,1,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:r(1171,1,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:r(1172,1,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:r(1173,1,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:r(1174,1,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:r(1175,1,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:r(1176,1,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:r(1177,1,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:r(1178,1,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:r(1179,1,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:r(1180,1,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:r(1181,1,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:r(1182,1,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:r(1183,1,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:r(1184,1,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:r(1185,1,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:r(1186,1,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:r(1187,1,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:r(1188,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:r(1189,1,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:r(1190,1,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:r(1191,1,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:r(1192,1,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:r(1193,1,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:r(1194,1,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:r(1195,1,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:r(1196,1,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:r(1197,1,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:r(1198,1,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:r(1199,1,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:r(1200,1,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:r(1202,1,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202",`Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:r(1203,1,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_0_is_enabled_requires_using_export_type:r(1205,1,"Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205","Re-exporting a type when '{0}' is enabled requires using 'export type'."),Decorators_are_not_valid_here:r(1206,1,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:r(1207,1,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0:r(1209,1,"Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209","Invalid optional chain from new expression. Did you mean to call '{0}()'?"),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:r(1210,1,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:r(1211,1,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:r(1212,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:r(1213,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:r(1214,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:r(1215,1,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:r(1216,1,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:r(1218,1,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Generators_are_not_allowed_in_an_ambient_context:r(1221,1,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:r(1222,1,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:r(1223,1,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:r(1224,1,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:r(1225,1,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:r(1226,1,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:r(1227,1,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:r(1228,1,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:r(1229,1,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:r(1230,1,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:r(1231,1,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:r(1232,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232","An import declaration can only be used at the top level of a namespace or module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:r(1233,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233","An export declaration can only be used at the top level of a namespace or module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:r(1234,1,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module:r(1235,1,"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235","A namespace declaration is only allowed at the top level of a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:r(1236,1,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:r(1237,1,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:r(1238,1,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:r(1239,1,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:r(1240,1,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:r(1241,1,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:r(1242,1,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:r(1243,1,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:r(1244,1,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:r(1245,1,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:r(1246,1,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:r(1247,1,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:r(1248,1,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:r(1249,1,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5:r(1250,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode:r(1251,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definiti_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode:r(1252,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_au_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode."),Abstract_properties_can_only_appear_within_an_abstract_class:r(1253,1,"Abstract_properties_can_only_appear_within_an_abstract_class_1253","Abstract properties can only appear within an abstract class."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:r(1254,1,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:r(1255,1,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:r(1257,1,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:r(1258,1,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:r(1259,1,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:r(1260,1,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:r(1261,1,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:r(1262,1,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:r(1263,1,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:r(1264,1,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:r(1265,1,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:r(1266,1,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:r(1267,1,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:r(1268,1,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled:r(1269,1,"Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269","Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."),Decorator_function_return_type_0_is_not_assignable_to_type_1:r(1270,1,"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270","Decorator function return type '{0}' is not assignable to type '{1}'."),Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any:r(1271,1,"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271","Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled:r(1272,1,"A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272","A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),_0_modifier_cannot_appear_on_a_type_parameter:r(1273,1,"_0_modifier_cannot_appear_on_a_type_parameter_1273","'{0}' modifier cannot appear on a type parameter"),_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias:r(1274,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274","'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),accessor_modifier_can_only_appear_on_a_property_declaration:r(1275,1,"accessor_modifier_can_only_appear_on_a_property_declaration_1275","'accessor' modifier can only appear on a property declaration."),An_accessor_property_cannot_be_declared_optional:r(1276,1,"An_accessor_property_cannot_be_declared_optional_1276","An 'accessor' property cannot be declared optional."),_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class:r(1277,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277","'{0}' modifier can only appear on a type parameter of a function, method or class"),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0:r(1278,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278","The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0:r(1279,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279","The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."),Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement:r(1280,1,"Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280","Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."),Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead:r(1281,1,"Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281","Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."),An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:r(1282,1,"An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282","An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:r(1283,1,"An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283","An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:r(1284,1,"An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284","An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:r(1285,1,"An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285","An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:r(1286,1,"ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286","ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:r(1287,1,"A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287","A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled:r(1288,1,"An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288","An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported:r(1289,1,"_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289","'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default:r(1290,1,"_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290","'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported:r(1291,1,"_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291","'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default:r(1292,1,"_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292","'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve:r(1293,1,"ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293","ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),with_statements_are_not_allowed_in_an_async_function_block:r(1300,1,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:r(1308,1,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level:r(1309,1,"The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309","The current file is a CommonJS module and cannot use 'await' at the top level."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:r(1312,1,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:r(1313,1,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:r(1314,1,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:r(1315,1,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:r(1316,1,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:r(1317,1,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:r(1318,1,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:r(1319,1,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:r(1320,1,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:r(1321,1,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:r(1322,1,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext:r(1323,1,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodenext_or_preserve:r(1324,1,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodene_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'nodenext', or 'preserve'."),Argument_of_dynamic_import_cannot_be_spread_element:r(1325,1,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments:r(1326,1,"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326","This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),String_literal_with_double_quotes_expected:r(1327,1,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:r(1328,1,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:r(1329,1,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:r(1330,1,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:r(1331,1,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:r(1332,1,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:r(1333,1,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:r(1334,1,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:r(1335,1,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:r(1337,1,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:r(1338,1,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:r(1339,1,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:r(1340,1,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Class_constructor_may_not_be_an_accessor:r(1341,1,"Class_constructor_may_not_be_an_accessor_1341","Class constructor may not be an accessor."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext:r(1343,1,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),A_label_is_not_allowed_here:r(1344,1,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:r(1345,1,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:r(1346,1,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:r(1347,1,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:r(1348,1,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:r(1349,1,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:r(1350,3,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:r(1351,1,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:r(1352,1,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:r(1353,1,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:r(1354,1,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:r(1355,1,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:r(1356,1,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:r(1357,1,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:r(1358,1,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:r(1359,1,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),Type_0_does_not_satisfy_the_expected_type_1:r(1360,1,"Type_0_does_not_satisfy_the_expected_type_1_1360","Type '{0}' does not satisfy the expected type '{1}'."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:r(1361,1,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:r(1362,1,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:r(1363,1,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:r(1364,3,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:r(1365,3,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:r(1366,3,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:r(1367,3,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Class_constructor_may_not_be_a_generator:r(1368,1,"Class_constructor_may_not_be_a_generator_1368","Class constructor may not be a generator."),Did_you_mean_0:r(1369,3,"Did_you_mean_0_1369","Did you mean '{0}'?"),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:r(1375,1,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:r(1376,3,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:r(1377,3,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:r(1378,1,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:r(1379,1,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:r(1380,1,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:r(1381,1,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `}`?"),Unexpected_token_Did_you_mean_or_gt:r(1382,1,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `>`?"),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:r(1385,1,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:r(1386,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:r(1387,1,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:r(1388,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:r(1389,1,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:r(1390,1,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:r(1392,1,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:r(1393,3,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:r(1394,3,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:r(1395,3,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:r(1396,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:r(1397,3,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:r(1398,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:r(1399,3,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:r(1400,3,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:r(1401,3,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:r(1402,3,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:r(1403,3,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:r(1404,3,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:r(1405,3,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:r(1406,3,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:r(1407,3,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:r(1408,3,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:r(1409,3,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:r(1410,3,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:r(1411,3,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:r(1412,3,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:r(1413,3,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:r(1414,3,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:r(1415,3,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:r(1416,3,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:r(1417,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:r(1418,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:r(1419,3,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:r(1420,3,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:r(1421,3,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:r(1422,3,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:r(1423,3,"File_is_library_specified_here_1423","File is library specified here."),Default_library:r(1424,3,"Default_library_1424","Default library"),Default_library_for_target_0:r(1425,3,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:r(1426,3,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:r(1427,3,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:r(1428,3,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:r(1429,3,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:r(1430,3,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:r(1431,1,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:r(1432,1,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters:r(1433,1,"Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433","Neither decorators nor modifiers may be applied to 'this' parameters."),Unexpected_keyword_or_identifier:r(1434,1,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:r(1435,1,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:r(1436,1,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:r(1437,1,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:r(1438,1,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:r(1439,1,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:r(1440,1,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:r(1441,1,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:r(1442,1,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:r(1443,1,"Module_declaration_names_may_only_use_or_quoted_strings_1443",`Module declaration names may only use ' or " quoted strings.`),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled:r(1448,1,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:r(1449,3,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments:r(1450,3,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:r(1451,1,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),resolution_mode_should_be_either_require_or_import:r(1453,1,"resolution_mode_should_be_either_require_or_import_1453","`resolution-mode` should be either `require` or `import`."),resolution_mode_can_only_be_set_for_type_only_imports:r(1454,1,"resolution_mode_can_only_be_set_for_type_only_imports_1454","`resolution-mode` can only be set for type-only imports."),resolution_mode_is_the_only_valid_key_for_type_import_assertions:r(1455,1,"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455","`resolution-mode` is the only valid key for type import assertions."),Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:r(1456,1,"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456","Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:r(1457,3,"Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457","Matched by default include pattern '**/*'"),File_is_ECMAScript_module_because_0_has_field_type_with_value_module:r(1458,3,"File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458",`File is ECMAScript module because '{0}' has field "type" with value "module"`),File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:r(1459,3,"File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459",`File is CommonJS module because '{0}' has field "type" whose value is not "module"`),File_is_CommonJS_module_because_0_does_not_have_field_type:r(1460,3,"File_is_CommonJS_module_because_0_does_not_have_field_type_1460",`File is CommonJS module because '{0}' does not have field "type"`),File_is_CommonJS_module_because_package_json_was_not_found:r(1461,3,"File_is_CommonJS_module_because_package_json_was_not_found_1461","File is CommonJS module because 'package.json' was not found"),resolution_mode_is_the_only_valid_key_for_type_import_attributes:r(1463,1,"resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463","'resolution-mode' is the only valid key for type import attributes."),Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:r(1464,1,"Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464","Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:r(1470,1,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead:r(1471,1,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),catch_or_finally_expected:r(1472,1,"catch_or_finally_expected_1472","'catch' or 'finally' expected."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:r(1473,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473","An import declaration can only be used at the top level of a module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:r(1474,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474","An export declaration can only be used at the top level of a module."),Control_what_method_is_used_to_detect_module_format_JS_files:r(1475,3,"Control_what_method_is_used_to_detect_module_format_JS_files_1475","Control what method is used to detect module-format JS files."),auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules:r(1476,3,"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476",'"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),An_instantiation_expression_cannot_be_followed_by_a_property_access:r(1477,1,"An_instantiation_expression_cannot_be_followed_by_a_property_access_1477","An instantiation expression cannot be followed by a property access."),Identifier_or_string_literal_expected:r(1478,1,"Identifier_or_string_literal_expected_1478","Identifier or string literal expected."),The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead:r(1479,1,"The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479",`The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.`),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module:r(1480,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480",'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1:r(1481,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481",`To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`),To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0:r(1482,3,"To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482",'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'),To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module:r(1483,3,"To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483",'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:r(1484,1,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484","'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:r(1485,1,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),Decorator_used_before_export_here:r(1486,1,"Decorator_used_before_export_here_1486","Decorator used before 'export' here."),Octal_escape_sequences_are_not_allowed_Use_the_syntax_0:r(1487,1,"Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487","Octal escape sequences are not allowed. Use the syntax '{0}'."),Escape_sequence_0_is_not_allowed:r(1488,1,"Escape_sequence_0_is_not_allowed_1488","Escape sequence '{0}' is not allowed."),Decimals_with_leading_zeros_are_not_allowed:r(1489,1,"Decimals_with_leading_zeros_are_not_allowed_1489","Decimals with leading zeros are not allowed."),File_appears_to_be_binary:r(1490,1,"File_appears_to_be_binary_1490","File appears to be binary."),_0_modifier_cannot_appear_on_a_using_declaration:r(1491,1,"_0_modifier_cannot_appear_on_a_using_declaration_1491","'{0}' modifier cannot appear on a 'using' declaration."),_0_declarations_may_not_have_binding_patterns:r(1492,1,"_0_declarations_may_not_have_binding_patterns_1492","'{0}' declarations may not have binding patterns."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration:r(1493,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493","The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration:r(1494,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494","The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),_0_modifier_cannot_appear_on_an_await_using_declaration:r(1495,1,"_0_modifier_cannot_appear_on_an_await_using_declaration_1495","'{0}' modifier cannot appear on an 'await using' declaration."),Identifier_string_literal_or_number_literal_expected:r(1496,1,"Identifier_string_literal_or_number_literal_expected_1496","Identifier, string literal, or number literal expected."),Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator:r(1497,1,"Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator_1497","Expression must be enclosed in parentheses to be used as a decorator."),Invalid_syntax_in_decorator:r(1498,1,"Invalid_syntax_in_decorator_1498","Invalid syntax in decorator."),Unknown_regular_expression_flag:r(1499,1,"Unknown_regular_expression_flag_1499","Unknown regular expression flag."),Duplicate_regular_expression_flag:r(1500,1,"Duplicate_regular_expression_flag_1500","Duplicate regular expression flag."),This_regular_expression_flag_is_only_available_when_targeting_0_or_later:r(1501,1,"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501","This regular expression flag is only available when targeting '{0}' or later."),The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously:r(1502,1,"The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1502","The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."),Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later:r(1503,1,"Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1503","Named capturing groups are only available when targeting 'ES2018' or later."),Subpattern_flags_must_be_present_when_there_is_a_minus_sign:r(1504,1,"Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1504","Subpattern flags must be present when there is a minus sign."),Incomplete_quantifier_Digit_expected:r(1505,1,"Incomplete_quantifier_Digit_expected_1505","Incomplete quantifier. Digit expected."),Numbers_out_of_order_in_quantifier:r(1506,1,"Numbers_out_of_order_in_quantifier_1506","Numbers out of order in quantifier."),There_is_nothing_available_for_repetition:r(1507,1,"There_is_nothing_available_for_repetition_1507","There is nothing available for repetition."),Unexpected_0_Did_you_mean_to_escape_it_with_backslash:r(1508,1,"Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1508","Unexpected '{0}'. Did you mean to escape it with backslash?"),This_regular_expression_flag_cannot_be_toggled_within_a_subpattern:r(1509,1,"This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1509","This regular expression flag cannot be toggled within a subpattern."),k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets:r(1510,1,"k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510","'\\k' must be followed by a capturing group name enclosed in angle brackets."),q_is_only_available_inside_character_class:r(1511,1,"q_is_only_available_inside_character_class_1511","'\\q' is only available inside character class."),c_must_be_followed_by_an_ASCII_letter:r(1512,1,"c_must_be_followed_by_an_ASCII_letter_1512","'\\c' must be followed by an ASCII letter."),Undetermined_character_escape:r(1513,1,"Undetermined_character_escape_1513","Undetermined character escape."),Expected_a_capturing_group_name:r(1514,1,"Expected_a_capturing_group_name_1514","Expected a capturing group name."),Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other:r(1515,1,"Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1515","Named capturing groups with the same name must be mutually exclusive to each other."),A_character_class_range_must_not_be_bounded_by_another_character_class:r(1516,1,"A_character_class_range_must_not_be_bounded_by_another_character_class_1516","A character class range must not be bounded by another character class."),Range_out_of_order_in_character_class:r(1517,1,"Range_out_of_order_in_character_class_1517","Range out of order in character class."),Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class:r(1518,1,"Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1518","Anything that would possibly match more than a single character is invalid inside a negated character class."),Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead:r(1519,1,"Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1519","Operators must not be mixed within a character class. Wrap it in a nested class instead."),Expected_a_class_set_operand:r(1520,1,"Expected_a_class_set_operand_1520","Expected a class set operand."),q_must_be_followed_by_string_alternatives_enclosed_in_braces:r(1521,1,"q_must_be_followed_by_string_alternatives_enclosed_in_braces_1521","'\\q' must be followed by string alternatives enclosed in braces."),A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash:r(1522,1,"A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1522","A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"),Expected_a_Unicode_property_name:r(1523,1,"Expected_a_Unicode_property_name_1523","Expected a Unicode property name."),Unknown_Unicode_property_name:r(1524,1,"Unknown_Unicode_property_name_1524","Unknown Unicode property name."),Expected_a_Unicode_property_value:r(1525,1,"Expected_a_Unicode_property_value_1525","Expected a Unicode property value."),Unknown_Unicode_property_value:r(1526,1,"Unknown_Unicode_property_value_1526","Unknown Unicode property value."),Expected_a_Unicode_property_name_or_value:r(1527,1,"Expected_a_Unicode_property_name_or_value_1527","Expected a Unicode property name or value."),Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set:r(1528,1,"Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1528","Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."),Unknown_Unicode_property_name_or_value:r(1529,1,"Unknown_Unicode_property_name_or_value_1529","Unknown Unicode property name or value."),Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set:r(1530,1,"Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1530","Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces:r(1531,1,"_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1531","'\\{0}' must be followed by a Unicode property value expression enclosed in braces."),There_is_no_capturing_group_named_0_in_this_regular_expression:r(1532,1,"There_is_no_capturing_group_named_0_in_this_regular_expression_1532","There is no capturing group named '{0}' in this regular expression."),This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression:r(1533,1,"This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_r_1533","This backreference refers to a group that does not exist. There are only {0} capturing groups in this regular expression."),This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression:r(1534,1,"This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regul_1534","This backreference refers to a group that does not exist. There are no capturing groups in this regular expression."),This_character_cannot_be_escaped_in_a_regular_expression:r(1535,1,"This_character_cannot_be_escaped_in_a_regular_expression_1535","This character cannot be escaped in a regular expression."),Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead:r(1536,1,"Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended__1536","Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '{0}' instead."),Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class:r(1537,1,"Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537","Decimal escape sequences and backreferences are not allowed in a character class."),Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set:r(1538,1,"Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538","Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),A_bigint_literal_cannot_be_used_as_a_property_name:r(1539,1,"A_bigint_literal_cannot_be_used_as_a_property_name_1539","A 'bigint' literal cannot be used as a property name."),A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead:r(1540,2,"A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540","A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",void 0,void 0,!0),Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:r(1541,1,"Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribut_1541","Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:r(1542,1,"Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542","Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0:r(1543,1,"Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543",`Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to '{0}'.`),Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0:r(1544,1,"Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544","Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."),The_types_of_0_are_incompatible_between_these_types:r(2200,1,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:r(2201,1,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:r(2202,1,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:r(2203,1,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:r(2204,1,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:r(2205,1,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:r(2206,1,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:r(2207,1,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),This_type_parameter_might_need_an_extends_0_constraint:r(2208,1,"This_type_parameter_might_need_an_extends_0_constraint_2208","This type parameter might need an `extends {0}` constraint."),The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:r(2209,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209","The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:r(2210,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210","The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),Add_extends_constraint:r(2211,3,"Add_extends_constraint_2211","Add `extends` constraint."),Add_extends_constraint_to_all_type_parameters:r(2212,3,"Add_extends_constraint_to_all_type_parameters_2212","Add `extends` constraint to all type parameters"),Duplicate_identifier_0:r(2300,1,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:r(2301,1,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:r(2302,1,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:r(2303,1,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:r(2304,1,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:r(2305,1,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:r(2306,1,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:r(2307,1,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:r(2308,1,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:r(2309,1,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:r(2310,1,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function:r(2311,1,"Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311","Cannot find name '{0}'. Did you mean to write this in an async function?"),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:r(2312,1,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:r(2313,1,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:r(2314,1,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:r(2315,1,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:r(2316,1,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:r(2317,1,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:r(2318,1,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:r(2319,1,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:r(2320,1,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:r(2321,1,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:r(2322,1,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:r(2323,1,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:r(2324,1,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:r(2325,1,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:r(2326,1,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:r(2327,1,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:r(2328,1,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:r(2329,1,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:r(2330,1,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:r(2331,1,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:r(2332,1,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_a_static_property_initializer:r(2334,1,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:r(2335,1,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:r(2336,1,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:r(2337,1,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:r(2338,1,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:r(2339,1,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:r(2340,1,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:r(2341,1,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:r(2343,1,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:r(2344,1,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:r(2345,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Untyped_function_calls_may_not_accept_type_arguments:r(2347,1,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:r(2348,1,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:r(2349,1,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:r(2350,1,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:r(2351,1,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:r(2352,1,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:r(2353,1,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:r(2354,1,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value:r(2355,1,"A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:r(2356,1,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:r(2357,1,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:r(2358,1,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method:r(2359,1,"The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359","The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:r(2362,1,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:r(2363,1,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:r(2364,1,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:r(2365,1,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:r(2366,1,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap:r(2367,1,"This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367","This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."),Type_parameter_name_cannot_be_0:r(2368,1,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:r(2369,1,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:r(2370,1,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:r(2371,1,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:r(2372,1,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:r(2373,1,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:r(2374,1,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:r(2375,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers:r(2376,1,"A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376","A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:r(2377,1,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:r(2378,1,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:r(2379,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),Overload_signatures_must_all_be_exported_or_non_exported:r(2383,1,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:r(2384,1,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:r(2385,1,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:r(2386,1,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:r(2387,1,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:r(2388,1,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:r(2389,1,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:r(2390,1,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:r(2391,1,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:r(2392,1,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:r(2393,1,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:r(2394,1,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:r(2395,1,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:r(2396,1,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:r(2397,1,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:r(2398,1,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:r(2399,1,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:r(2400,1,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers:r(2401,1,"A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401","A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:r(2402,1,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:r(2403,1,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:r(2404,1,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:r(2405,1,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:r(2406,1,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:r(2407,1,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:r(2408,1,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:r(2409,1,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:r(2410,1,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:r(2412,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:r(2411,1,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:r(2413,1,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:r(2414,1,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:r(2415,1,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:r(2416,1,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:r(2417,1,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:r(2418,1,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:r(2419,1,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:r(2420,1,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:r(2422,1,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:r(2423,1,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:r(2425,1,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:r(2426,1,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:r(2427,1,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:r(2428,1,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:r(2430,1,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:r(2431,1,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:r(2432,1,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:r(2433,1,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:r(2434,1,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:r(2435,1,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:r(2436,1,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:r(2437,1,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:r(2438,1,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:r(2439,1,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:r(2440,1,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:r(2441,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:r(2442,1,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:r(2443,1,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:r(2444,1,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:r(2445,1,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:r(2446,1,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:r(2447,1,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:r(2448,1,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:r(2449,1,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:r(2450,1,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:r(2451,1,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:r(2452,1,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:r(2454,1,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:r(2456,1,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:r(2457,1,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:r(2458,1,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:r(2459,1,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:r(2460,1,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:r(2461,1,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:r(2462,1,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:r(2463,1,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:r(2464,1,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:r(2465,1,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:r(2466,1,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:r(2467,1,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:r(2468,1,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:r(2469,1,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:r(2472,1,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:r(2473,1,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_must_be_constant_expressions:r(2474,1,"const_enum_member_initializers_must_be_constant_expressions_2474","const enum member initializers must be constant expressions."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:r(2475,1,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:r(2476,1,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:r(2477,1,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:r(2478,1,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:r(2480,1,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:r(2481,1,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:r(2483,1,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:r(2484,1,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:r(2487,1,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:r(2488,1,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:r(2489,1,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:r(2490,1,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:r(2491,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:r(2492,1,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:r(2493,1,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:r(2494,1,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:r(2495,1,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression:r(2496,1,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_func_2496","The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:r(2497,1,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:r(2498,1,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:r(2499,1,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:r(2500,1,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:r(2501,1,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:r(2502,1,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:r(2503,1,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:r(2504,1,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:r(2505,1,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:r(2506,1,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:r(2507,1,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:r(2508,1,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:r(2509,1,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:r(2510,1,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:r(2511,1,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:r(2512,1,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:r(2513,1,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),A_tuple_type_cannot_be_indexed_with_a_negative_value:r(2514,1,"A_tuple_type_cannot_be_indexed_with_a_negative_value_2514","A tuple type cannot be indexed with a negative value."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:r(2515,1,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:r(2516,1,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:r(2517,1,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:r(2518,1,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:r(2519,1,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:r(2520,1,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method:r(2522,1,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_sta_2522","The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:r(2523,1,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:r(2524,1,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:r(2526,1,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:r(2527,1,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:r(2528,1,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:r(2529,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:r(2530,1,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:r(2531,1,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:r(2532,1,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:r(2533,1,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:r(2534,1,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Type_0_cannot_be_used_to_index_type_1:r(2536,1,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:r(2537,1,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:r(2538,1,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:r(2539,1,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:r(2540,1,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:r(2542,1,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:r(2543,1,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:r(2544,1,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:r(2545,1,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:r(2547,1,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:r(2548,1,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:r(2549,1,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:r(2550,1,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:r(2551,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:r(2552,1,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:r(2553,1,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:r(2554,1,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:r(2555,1,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:r(2556,1,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:r(2558,1,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:r(2559,1,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:r(2560,1,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:r(2561,1,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:r(2562,1,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:r(2563,1,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:r(2564,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:r(2565,1,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:r(2566,1,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:r(2567,1,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:r(2568,1,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Could_not_find_name_0_Did_you_mean_1:r(2570,1,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:r(2571,1,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:r(2574,1,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:r(2575,1,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:r(2576,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:r(2577,1,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:r(2578,1,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:r(2580,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:r(2581,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:r(2582,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:r(2583,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:r(2584,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:r(2585,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:r(2588,1,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:r(2589,1,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:r(2590,1,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:r(2591,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:r(2592,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:r(2593,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:r(2594,1,"This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594","This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:r(2595,1,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:r(2596,1,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:r(2597,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:r(2598,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:r(2602,1,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:r(2603,1,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:r(2604,1,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:r(2606,1,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:r(2607,1,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:r(2608,1,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:r(2609,1,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:r(2610,1,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:r(2611,1,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:r(2612,1,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:r(2613,1,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:r(2614,1,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:r(2615,1,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:r(2616,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:r(2617,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:r(2618,1,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:r(2619,1,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:r(2620,1,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:r(2621,1,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:r(2623,1,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:r(2624,1,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:r(2625,1,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:r(2626,1,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:r(2627,1,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:r(2628,1,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:r(2629,1,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:r(2630,1,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:r(2631,1,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:r(2632,1,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:r(2633,1,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:r(2634,1,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable:r(2635,1,"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635","Type '{0}' has no signatures for which the type argument list is applicable."),Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation:r(2636,1,"Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636","Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types:r(2637,1,"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637","Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator:r(2638,1,"Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638","Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),React_components_cannot_include_JSX_namespace_names:r(2639,1,"React_components_cannot_include_JSX_namespace_names_2639","React components cannot include JSX namespace names"),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:r(2649,1,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more:r(2650,1,"Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650","Non-abstract class expression is missing implementations for the following members of '{0}': {1} and {2} more."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:r(2651,1,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:r(2652,1,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:r(2653,1,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2:r(2654,1,"Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654","Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2}."),Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more:r(2655,1,"Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655","Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2} and {3} more."),Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1:r(2656,1,"Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656","Non-abstract class expression is missing implementations for the following members of '{0}': {1}."),JSX_expressions_must_have_one_parent_element:r(2657,1,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:r(2658,1,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:r(2659,1,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:r(2660,1,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:r(2661,1,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:r(2662,1,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:r(2663,1,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:r(2664,1,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:r(2665,1,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:r(2666,1,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:r(2667,1,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:r(2668,1,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:r(2669,1,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:r(2670,1,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:r(2671,1,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:r(2672,1,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:r(2673,1,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:r(2674,1,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:r(2675,1,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:r(2676,1,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:r(2677,1,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:r(2678,1,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:r(2679,1,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:r(2680,1,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:r(2681,1,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:r(2683,1,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:r(2684,1,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:r(2685,1,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:r(2686,1,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:r(2687,1,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:r(2688,1,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:r(2689,1,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:r(2690,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:r(2692,1,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:r(2693,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:r(2694,1,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:r(2695,1,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:r(2696,1,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:r(2697,1,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:r(2698,1,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:r(2699,1,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:r(2700,1,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:r(2701,1,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:r(2702,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:r(2703,1,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:r(2704,1,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:r(2705,1,"An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_2705","An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:r(2706,1,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:r(2707,1,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:r(2708,1,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:r(2709,1,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:r(2710,1,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:r(2711,1,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:r(2712,1,"A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_t_2712","A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:r(2713,1,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713",`Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}["{1}"]'?`),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:r(2714,1,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:r(2715,1,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:r(2716,1,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:r(2717,1,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:r(2718,1,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:r(2719,1,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:r(2720,1,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:r(2721,1,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:r(2722,1,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:r(2723,1,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:r(2724,1,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:r(2725,1,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:r(2726,1,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:r(2727,1,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:r(2728,3,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:r(2729,1,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:r(2730,1,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:r(2731,1,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:r(2732,1,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:r(2733,1,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:r(2734,1,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:r(2735,1,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:r(2736,1,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:r(2737,1,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:r(2738,3,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:r(2739,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:r(2740,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:r(2741,1,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:r(2742,1,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:r(2743,1,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:r(2744,1,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:r(2745,1,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:r(2746,1,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:r(2747,1,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_0_is_enabled:r(2748,1,"Cannot_access_ambient_const_enums_when_0_is_enabled_2748","Cannot access ambient const enums when '{0}' is enabled."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:r(2749,1,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:r(2750,1,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:r(2751,1,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:r(2752,1,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:r(2753,1,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:r(2754,1,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:r(2755,1,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:r(2756,1,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:r(2757,1,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:r(2758,1,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:r(2759,1,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:r(2760,1,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:r(2761,1,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:r(2762,1,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:r(2763,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:r(2764,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:r(2765,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:r(2766,1,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:r(2767,1,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:r(2768,1,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:r(2769,1,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:r(2770,1,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:r(2771,1,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:r(2772,1,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:r(2773,1,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:r(2774,1,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:r(2775,1,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:r(2776,1,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:r(2777,1,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:r(2778,1,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:r(2779,1,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:r(2780,1,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:r(2781,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:r(2782,3,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:r(2783,1,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:r(2784,1,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:r(2785,1,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:r(2786,1,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:r(2787,1,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:r(2788,1,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:r(2789,1,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:r(2790,1,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:r(2791,1,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:r(2792,1,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:r(2793,1,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:r(2794,1,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:r(2795,1,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:r(2796,1,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:r(2797,1,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:r(2798,1,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:r(2799,1,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:r(2800,1,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:r(2801,1,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:r(2802,1,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:r(2803,1,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:r(2804,1,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Private_accessor_was_defined_without_a_getter:r(2806,1,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:r(2807,1,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:r(2808,1,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses:r(2809,1,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments:r(2810,1,"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810","Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),Initializer_for_property_0:r(2811,1,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:r(2812,1,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:r(2813,1,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:r(2814,1,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:r(2815,1,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:r(2816,1,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:r(2817,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:r(2818,1,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:r(2819,1,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:r(2820,1,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve:r(2821,1,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2821","Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:r(2822,1,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve:r(2823,1,"Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2823","Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),Cannot_find_namespace_0_Did_you_mean_1:r(2833,1,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path:r(2834,1,"Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0:r(2835,1,"Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:r(2836,1,"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836","Import assertions are not allowed on statements that compile to CommonJS 'require' calls."),Import_assertion_values_must_be_string_literal_expressions:r(2837,1,"Import_assertion_values_must_be_string_literal_expressions_2837","Import assertion values must be string literal expressions."),All_declarations_of_0_must_have_identical_constraints:r(2838,1,"All_declarations_of_0_must_have_identical_constraints_2838","All declarations of '{0}' must have identical constraints."),This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value:r(2839,1,"This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839","This condition will always return '{0}' since JavaScript compares objects by reference, not value."),An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types:r(2840,1,"An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840","An interface cannot extend a primitive type like '{0}'. It can only extend other named object types."),_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation:r(2842,1,"_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842","'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here:r(2843,1,"We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843","We can only write a type for '{0}' by adding a type for the entire parameter here."),Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:r(2844,1,"Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844","Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),This_condition_will_always_return_0:r(2845,1,"This_condition_will_always_return_0_2845","This condition will always return '{0}'."),A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead:r(2846,1,"A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846","A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"),The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression:r(2848,1,"The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848","The right-hand side of an 'instanceof' expression must not be an instantiation expression."),Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1:r(2849,1,"Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849","Target signature provides too few arguments. Expected {0} or more, but got {1}."),The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined:r(2850,1,"The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_n_2850","The initializer of a 'using' declaration must be either an object with a '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined:r(2851,1,"The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851","The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:r(2852,1,"await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852","'await using' statements are only allowed within async functions and at the top levels of modules."),await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:r(2853,1,"await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853","'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:r(2854,1,"Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854","Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super:r(2855,1,"Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855","Class field '{0}' defined by the parent class is not accessible in the child class via super."),Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:r(2856,1,"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856","Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),Import_attributes_cannot_be_used_with_type_only_imports_or_exports:r(2857,1,"Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857","Import attributes cannot be used with type-only imports or exports."),Import_attribute_values_must_be_string_literal_expressions:r(2858,1,"Import_attribute_values_must_be_string_literal_expressions_2858","Import attribute values must be string literal expressions."),Excessive_complexity_comparing_types_0_and_1:r(2859,1,"Excessive_complexity_comparing_types_0_and_1_2859","Excessive complexity comparing types '{0}' and '{1}'."),The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method:r(2860,1,"The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860","The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression:r(2861,1,"An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861","An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),Type_0_is_generic_and_can_only_be_indexed_for_reading:r(2862,1,"Type_0_is_generic_and_can_only_be_indexed_for_reading_2862","Type '{0}' is generic and can only be indexed for reading."),A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values:r(2863,1,"A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863","A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types:r(2864,1,"A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864","A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled:r(2865,1,"Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865","Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled:r(2866,1,"Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866","Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun:r(2867,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867","Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig:r(2868,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868","Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish:r(2869,1,"Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish_2869","Right operand of ?? is unreachable because the left operand is never nullish."),This_binary_expression_is_never_nullish_Are_you_missing_parentheses:r(2870,1,"This_binary_expression_is_never_nullish_Are_you_missing_parentheses_2870","This binary expression is never nullish. Are you missing parentheses?"),This_expression_is_always_nullish:r(2871,1,"This_expression_is_always_nullish_2871","This expression is always nullish."),This_kind_of_expression_is_always_truthy:r(2872,1,"This_kind_of_expression_is_always_truthy_2872","This kind of expression is always truthy."),This_kind_of_expression_is_always_falsy:r(2873,1,"This_kind_of_expression_is_always_falsy_2873","This kind of expression is always falsy."),This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found:r(2874,1,"This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found_2874","This JSX tag requires '{0}' to be in scope, but it could not be found."),This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed:r(2875,1,"This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_fo_2875","This JSX tag requires the module path '{0}' to exist, but none could be found. Make sure you have types for the appropriate package installed."),This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0:r(2876,1,"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876",'This relative import path is unsafe to rewrite because it looks like a file name, but actually resolves to "{0}".'),This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path:r(2877,1,"This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877","This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files:r(2878,1,"This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878","This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found:r(2879,1,"Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879","Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),Import_declaration_0_is_using_private_name_1:r(4e3,1,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:r(4002,1,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:r(4004,1,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:r(4006,1,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:r(4008,1,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:r(4010,1,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r(4012,1,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:r(4014,1,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:r(4016,1,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:r(4019,1,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:r(4020,1,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:r(4021,1,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:r(4022,1,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4023,1,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:r(4024,1,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:r(4025,1,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4026,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:r(4027,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:r(4028,1,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4029,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:r(4030,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:r(4031,1,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4032,1,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:r(4033,1,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4034,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:r(4035,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4036,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:r(4037,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4038,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4039,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:r(4040,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4041,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4042,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:r(4043,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:r(4044,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:r(4045,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:r(4046,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:r(4047,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:r(4048,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:r(4049,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:r(4050,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:r(4051,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:r(4052,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:r(4053,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:r(4054,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:r(4055,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:r(4056,1,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:r(4057,1,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:r(4058,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:r(4059,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:r(4060,1,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4061,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4062,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:r(4063,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4064,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:r(4065,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4066,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:r(4067,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4068,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4069,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:r(4070,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4071,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:r(4072,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r(4073,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4074,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:r(4075,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4076,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:r(4077,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:r(4078,1,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:r(4081,1,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:r(4082,1,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:r(4083,1,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:r(4084,1,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1:r(4085,1,"Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085","Extends clause for inferred type '{0}' has or is using private name '{1}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4091,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:r(4092,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected:r(4094,1,"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","Property '{0}' of exported anonymous class type may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4095,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:r(4096,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:r(4097,1,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4098,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:r(4099,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:r(4100,1,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:r(4101,1,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:r(4102,1,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:r(4103,1,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:r(4104,1,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:r(4105,1,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:r(4106,1,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:r(4107,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:r(4108,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:r(4109,1,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:r(4110,1,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:r(4111,1,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:r(4112,1,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:r(4113,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:r(4114,1,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:r(4115,1,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:r(4116,1,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:r(4117,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:r(4118,1,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:r(4119,1,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:r(4120,1,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:r(4121,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:r(4122,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:r(4123,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:r(4124,1,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given:r(4125,1,"Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125","Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value:r(4126,1,"One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126","One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),The_current_host_does_not_support_the_0_option:r(5001,1,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:r(5009,1,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:r(5010,1,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:r(5012,1,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Unknown_compiler_option_0:r(5023,1,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:r(5024,1,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:r(5025,1,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:r(5033,1,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:r(5042,1,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:r(5047,1,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:r(5051,1,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:r(5052,1,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:r(5053,1,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:r(5054,1,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:r(5055,1,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:r(5056,1,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:r(5057,1,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:r(5058,1,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:r(5059,1,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:r(5061,1,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:r(5062,1,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:r(5063,1,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:r(5064,1,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:r(5065,1,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:r(5066,1,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:r(5067,1,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:r(5068,1,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:r(5069,1,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic:r(5070,1,"Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070","Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd:r(5071,1,"Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd_5071","Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'."),Unknown_build_option_0:r(5072,1,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:r(5073,1,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:r(5074,1,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:r(5075,1,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:r(5076,1,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:r(5077,1,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:r(5078,1,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:r(5079,1,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:r(5080,1,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:r(5081,1,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:r(5082,1,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:r(5083,1,"Cannot_read_file_0_5083","Cannot read file '{0}'."),A_tuple_member_cannot_be_both_optional_and_rest:r(5085,1,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:r(5086,1,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:r(5087,1,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:r(5088,1,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:r(5089,1,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:r(5090,1,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled:r(5091,1,"Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."),The_root_value_of_a_0_file_must_be_an_object:r(5092,1,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:r(5093,1,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:r(5094,1,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later:r(5095,1,"Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095","Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."),Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set:r(5096,1,"Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096","Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled:r(5097,1,"An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097","An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler:r(5098,1,"Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098","Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error:r(5101,1,"Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101",`Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),Option_0_has_been_removed_Please_remove_it_from_your_configuration:r(5102,1,"Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102","Option '{0}' has been removed. Please remove it from your configuration."),Invalid_value_for_ignoreDeprecations:r(5103,1,"Invalid_value_for_ignoreDeprecations_5103","Invalid value for '--ignoreDeprecations'."),Option_0_is_redundant_and_cannot_be_specified_with_option_1:r(5104,1,"Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104","Option '{0}' is redundant and cannot be specified with option '{1}'."),Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System:r(5105,1,"Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105","Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),Use_0_instead:r(5106,3,"Use_0_instead_5106","Use '{0}' instead."),Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error:r(5107,1,"Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107",`Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`),Option_0_1_has_been_removed_Please_remove_it_from_your_configuration:r(5108,1,"Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108","Option '{0}={1}' has been removed. Please remove it from your configuration."),Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1:r(5109,1,"Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109","Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."),Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1:r(5110,1,"Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110","Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:r(6e3,3,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:r(6001,3,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:r(6002,3,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:r(6004,3,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:r(6005,3,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:r(6006,3,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:r(6007,3,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:r(6008,3,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:r(6009,3,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:r(6010,3,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:r(6011,3,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:r(6012,3,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:r(6013,3,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:r(6014,3,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:r(6015,3,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:r(6016,3,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:r(6017,3,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:r(6019,3,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:r(6020,3,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:r(6023,3,"Syntax_Colon_0_6023","Syntax: {0}"),options:r(6024,3,"options_6024","options"),file:r(6025,3,"file_6025","file"),Examples_Colon_0:r(6026,3,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:r(6027,3,"Options_Colon_6027","Options:"),Version_0:r(6029,3,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:r(6030,3,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:r(6031,3,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:r(6032,3,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:r(6034,3,"KIND_6034","KIND"),FILE:r(6035,3,"FILE_6035","FILE"),VERSION:r(6036,3,"VERSION_6036","VERSION"),LOCATION:r(6037,3,"LOCATION_6037","LOCATION"),DIRECTORY:r(6038,3,"DIRECTORY_6038","DIRECTORY"),STRATEGY:r(6039,3,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:r(6040,3,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Errors_Files:r(6041,3,"Errors_Files_6041","Errors Files"),Generates_corresponding_map_file:r(6043,3,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:r(6044,1,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:r(6045,1,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:r(6046,1,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:r(6048,1,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form or -. For example '{0}' or '{1}'."),Unable_to_open_file_0:r(6050,1,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:r(6051,1,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:r(6052,3,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:r(6053,1,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:r(6054,1,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:r(6055,3,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:r(6056,3,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:r(6058,3,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:r(6059,1,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:r(6060,3,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:r(6061,3,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:r(6064,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:r(6065,3,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:r(6066,3,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:r(6070,3,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:r(6071,3,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:r(6072,3,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:r(6073,3,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:r(6074,3,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:r(6075,3,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:r(6076,3,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:r(6077,3,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:r(6078,3,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:r(6079,3,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:r(6080,3,"Specify_JSX_code_generation_6080","Specify JSX code generation."),Only_amd_and_system_modules_are_supported_alongside_0:r(6082,1,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:r(6083,3,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:r(6084,3,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:r(6085,3,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:r(6086,3,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:r(6087,3,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:r(6088,3,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:r(6089,3,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:r(6090,3,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:r(6091,3,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:r(6092,3,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:r(6093,3,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:r(6094,3,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1:r(6095,3,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095","Loading module as file / folder, candidate module location '{0}', target file types: {1}."),File_0_does_not_exist:r(6096,3,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exists_use_it_as_a_name_resolution_result:r(6097,3,"File_0_exists_use_it_as_a_name_resolution_result_6097","File '{0}' exists - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_types_Colon_1:r(6098,3,"Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098","Loading module '{0}' from 'node_modules' folder, target file types: {1}."),Found_package_json_at_0:r(6099,3,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:r(6100,3,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:r(6101,3,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:r(6102,3,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:r(6104,3,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:r(6105,3,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:r(6106,3,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:r(6107,3,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:r(6108,3,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:r(6109,3,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:r(6110,3,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:r(6111,3,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:r(6112,3,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:r(6113,3,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:r(6114,1,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:r(6115,3,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:r(6116,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:r(6119,3,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:r(6120,3,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:r(6121,3,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:r(6122,3,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:r(6123,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:r(6124,3,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:r(6125,3,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:r(6126,3,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:r(6127,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:r(6128,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:r(6130,3,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:r(6131,1,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:r(6132,3,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:r(6133,1,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:r(6134,3,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:r(6135,3,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:r(6136,3,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:r(6137,1,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:r(6138,1,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:r(6139,3,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:r(6140,1,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:r(6141,3,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:r(6142,1,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:r(6144,3,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:r(6146,3,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:r(6147,3,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:r(6148,3,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:r(6149,3,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:r(6150,3,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:r(6151,3,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:r(6152,3,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:r(6153,3,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:r(6154,3,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:r(6155,3,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:r(6156,3,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:r(6157,3,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:r(6158,3,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:r(6159,3,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:r(6160,3,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:r(6161,3,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:r(6162,3,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:r(6163,3,"The_character_set_of_the_input_files_6163","The character set of the input files."),Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1:r(6164,3,"Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164","Skipping module '{0}' that looks like an absolute URI, target file types: {1}."),Do_not_truncate_error_messages:r(6165,3,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:r(6166,3,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:r(6167,3,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:r(6168,3,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:r(6169,3,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:r(6170,3,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:r(6171,3,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5:r(6179,3,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5'."),Enable_all_strict_type_checking_options:r(6180,3,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),Scoped_package_detected_looking_in_0:r(6182,3,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:r(6183,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:r(6184,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:r(6186,3,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:r(6187,3,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:r(6188,1,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:r(6189,1,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:r(6191,3,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:r(6192,1,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:r(6193,3,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:r(6194,3,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:r(6195,3,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:r(6196,1,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:r(6197,3,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:r(6198,1,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:r(6199,1,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:r(6200,1,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:r(6201,3,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:r(6202,1,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:r(6203,3,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:r(6204,3,"and_here_6204","and here."),All_type_parameters_are_unused:r(6205,1,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:r(6206,3,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:r(6207,3,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:r(6208,3,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:r(6209,3,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:r(6210,3,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:r(6211,3,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:r(6212,3,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:r(6213,3,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:r(6214,3,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:r(6215,3,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:r(6216,3,"Found_1_error_6216","Found 1 error."),Found_0_errors:r(6217,3,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:r(6218,3,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:r(6219,3,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:r(6220,3,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:r(6221,3,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:r(6222,3,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:r(6223,3,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:r(6224,3,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:r(6225,3,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:r(6226,3,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:r(6227,3,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:r(6229,1,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:r(6230,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:r(6231,1,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:r(6232,1,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:r(6233,1,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:r(6234,1,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:r(6235,3,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:r(6236,1,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:r(6237,3,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:r(6238,1,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:r(6239,3,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:r(6240,3,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:r(6241,3,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:r(6242,3,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:r(6243,3,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:r(6244,3,"Modules_6244","Modules"),File_Management:r(6245,3,"File_Management_6245","File Management"),Emit:r(6246,3,"Emit_6246","Emit"),JavaScript_Support:r(6247,3,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:r(6248,3,"Type_Checking_6248","Type Checking"),Editor_Support:r(6249,3,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:r(6250,3,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:r(6251,3,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:r(6252,3,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:r(6253,3,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:r(6254,3,"Language_and_Environment_6254","Language and Environment"),Projects:r(6255,3,"Projects_6255","Projects"),Output_Formatting:r(6256,3,"Output_Formatting_6256","Output Formatting"),Completeness:r(6257,3,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:r(6258,1,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Found_1_error_in_0:r(6259,3,"Found_1_error_in_0_6259","Found 1 error in {0}"),Found_0_errors_in_the_same_file_starting_at_Colon_1:r(6260,3,"Found_0_errors_in_the_same_file_starting_at_Colon_1_6260","Found {0} errors in the same file, starting at: {1}"),Found_0_errors_in_1_files:r(6261,3,"Found_0_errors_in_1_files_6261","Found {0} errors in {1} files."),File_name_0_has_a_1_extension_looking_up_2_instead:r(6262,3,"File_name_0_has_a_1_extension_looking_up_2_instead_6262","File name '{0}' has a '{1}' extension - looking up '{2}' instead."),Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set:r(6263,1,"Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263","Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."),Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present:r(6264,3,"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264","Enable importing files with any extension, provided a declaration file is present."),Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder:r(6265,3,"Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265","Resolving type reference directive for program that specifies custom typeRoots, skipping lookup in 'node_modules' folder."),Option_0_can_only_be_specified_on_command_line:r(6266,1,"Option_0_can_only_be_specified_on_command_line_6266","Option '{0}' can only be specified on command line."),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:r(6270,3,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:r(6271,3,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:r(6272,3,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:r(6273,3,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:r(6274,3,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:r(6275,3,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:r(6276,3,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update:r(6277,3,"Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277","Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings:r(6278,3,"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278",`There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update:r(6279,3,"Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279","Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler:r(6280,3,"There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280","There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),package_json_has_a_peerDependencies_field:r(6281,3,"package_json_has_a_peerDependencies_field_6281","'package.json' has a 'peerDependencies' field."),Found_peerDependency_0_with_1_version:r(6282,3,"Found_peerDependency_0_with_1_version_6282","Found peerDependency '{0}' with '{1}' version."),Failed_to_find_peerDependency_0:r(6283,3,"Failed_to_find_peerDependency_0_6283","Failed to find peerDependency '{0}'."),Enable_project_compilation:r(6302,3,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:r(6304,1,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:r(6305,1,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:r(6306,1,"Referenced_project_0_must_have_setting_composite_Colon_true_6306",`Referenced project '{0}' must have setting "composite": true.`),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:r(6307,1,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Referenced_project_0_may_not_disable_emit:r(6310,1,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_output_1_is_older_than_input_2:r(6350,3,"Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350","Project '{0}' is out of date because output '{1}' is older than input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2:r(6351,3,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:r(6352,3,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:r(6353,3,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:r(6354,3,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:r(6355,3,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:r(6356,3,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:r(6357,3,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:r(6358,3,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:r(6359,3,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:r(6361,3,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:r(6362,3,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:r(6363,3,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:r(6364,3,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:r(6365,3,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects."),Show_what_would_be_built_or_deleted_if_specified_with_clean:r(6367,3,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:r(6369,1,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:r(6370,1,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:r(6371,3,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:r(6374,3,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:r(6377,1,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Composite_projects_may_not_disable_incremental_compilation:r(6379,1,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:r(6380,3,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:r(6381,3,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:r(6382,3,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:r(6383,3,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:r(6384,3,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:r(6385,2,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:r(6386,3,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:r(6387,2,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:r(6388,3,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:r(6389,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:r(6390,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:r(6391,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:r(6392,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:r(6393,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:r(6394,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:r(6395,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:r(6396,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:r(6397,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:r(6398,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted:r(6399,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399","Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files:r(6400,3,"Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400","Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),Project_0_is_out_of_date_because_there_was_error_reading_file_1:r(6401,3,"Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401","Project '{0}' is out of date because there was error reading file '{1}'"),Resolving_in_0_mode_with_conditions_1:r(6402,3,"Resolving_in_0_mode_with_conditions_1_6402","Resolving in {0} mode with conditions {1}."),Matched_0_condition_1:r(6403,3,"Matched_0_condition_1_6403","Matched '{0}' condition '{1}'."),Using_0_subpath_1_with_target_2:r(6404,3,"Using_0_subpath_1_with_target_2_6404","Using '{0}' subpath '{1}' with target '{2}'."),Saw_non_matching_condition_0:r(6405,3,"Saw_non_matching_condition_0_6405","Saw non-matching condition '{0}'."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions:r(6406,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406","Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"),Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set:r(6407,3,"Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407","Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."),Use_the_package_json_exports_field_when_resolving_package_imports:r(6408,3,"Use_the_package_json_exports_field_when_resolving_package_imports_6408","Use the package.json 'exports' field when resolving package imports."),Use_the_package_json_imports_field_when_resolving_imports:r(6409,3,"Use_the_package_json_imports_field_when_resolving_imports_6409","Use the package.json 'imports' field when resolving imports."),Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports:r(6410,3,"Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410","Conditions to set in addition to the resolver-specific defaults when resolving imports."),true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false:r(6411,3,"true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411","`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more:r(6412,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412","Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."),Entering_conditional_exports:r(6413,3,"Entering_conditional_exports_6413","Entering conditional exports."),Resolved_under_condition_0:r(6414,3,"Resolved_under_condition_0_6414","Resolved under condition '{0}'."),Failed_to_resolve_under_condition_0:r(6415,3,"Failed_to_resolve_under_condition_0_6415","Failed to resolve under condition '{0}'."),Exiting_conditional_exports:r(6416,3,"Exiting_conditional_exports_6416","Exiting conditional exports."),Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0:r(6417,3,"Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417","Searching all ancestor node_modules directories for preferred extensions: {0}."),Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0:r(6418,3,"Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418","Searching all ancestor node_modules directories for fallback extensions: {0}."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors:r(6419,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419","Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),Project_0_is_out_of_date_because_1:r(6420,3,"Project_0_is_out_of_date_because_1_6420","Project '{0}' is out of date because {1}."),Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files:r(6421,3,"Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421","Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:r(6500,3,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:r(6501,3,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:r(6502,3,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:r(6503,3,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:r(6504,1,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:r(6505,3,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:r(6506,3,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:r(6600,3,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:r(6601,3,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:r(6602,3,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:r(6603,3,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:r(6604,3,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:r(6605,3,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:r(6606,3,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:r(6607,3,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:r(6608,3,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:r(6609,3,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:r(6611,3,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:r(6612,3,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:r(6613,3,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:r(6614,3,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:r(6615,3,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:r(6616,3,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:r(6617,3,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:r(6618,3,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:r(6619,3,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:r(6620,3,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects."),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:r(6621,3,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:r(6622,3,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:r(6623,3,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:r(6624,3,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:r(6625,3,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:r(6626,3,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),Filters_results_from_the_include_option:r(6627,3,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:r(6628,3,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:r(6629,3,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_legacy_experimental_decorators:r(6630,3,"Enable_experimental_support_for_legacy_experimental_decorators_6630","Enable experimental support for legacy experimental decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:r(6631,3,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:r(6632,3,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:r(6633,3,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:r(6634,3,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:r(6635,3,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:r(6636,3,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date."),Ensure_that_casing_is_correct_in_imports:r(6637,3,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:r(6638,3,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:r(6639,3,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Skip_building_downstream_projects_on_error_in_upstream_project:r(6640,3,"Skip_building_downstream_projects_on_error_in_upstream_project_6640","Skip building downstream projects on error in upstream project."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:r(6641,3,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:r(6642,3,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:r(6643,3,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:r(6644,3,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:r(6645,3,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:r(6646,3,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:r(6647,3,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:r(6648,3,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:r(6649,3,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:r(6650,3,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:r(6651,3,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:r(6652,3,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:r(6653,3,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:r(6654,3,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:r(6655,3,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:r(6656,3,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),Specify_what_module_code_is_generated:r(6657,3,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:r(6658,3,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:r(6659,3,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:r(6660,3,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:r(6661,3,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like '__extends' in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:r(6662,3,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:r(6663,3,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:r(6664,3,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:r(6665,3,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied 'any' type."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:r(6666,3,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:r(6667,3,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:r(6668,3,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when 'this' is given the type 'any'."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:r(6669,3,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:r(6670,3,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:r(6671,3,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type."),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:r(6672,3,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:r(6673,3,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:r(6674,3,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add 'undefined' to a type when accessed using an index."),Enable_error_reporting_when_local_variables_aren_t_read:r(6675,3,"Enable_error_reporting_when_local_variables_aren_t_read_6675","Enable error reporting when local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:r(6676,3,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read."),Deprecated_setting_Use_outFile_instead:r(6677,3,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use 'outFile' instead."),Specify_an_output_folder_for_all_emitted_files:r(6678,3,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:r(6679,3,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:r(6680,3,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:r(6681,3,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:r(6682,3,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing 'const enum' declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:r(6683,3,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:r(6684,3,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode."),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:r(6685,3,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read."),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:r(6686,3,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:r(6687,3,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:r(6688,3,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:r(6689,3,"Enable_importing_json_files_6689","Enable importing .json files."),Specify_the_root_folder_within_your_source_files:r(6690,3,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:r(6691,3,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:r(6692,3,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:r(6693,3,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:r(6694,3,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:r(6695,3,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:r(6697,3,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:r(6698,3,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:r(6699,3,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account 'null' and 'undefined'."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:r(6700,3,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:r(6701,3,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have '@internal' in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:r(6702,3,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:r(6703,3,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:r(6704,3,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:r(6705,3,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:r(6706,3,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the 'moduleResolution' process."),Specify_the_path_to_tsbuildinfo_incremental_compilation_file:r(6707,3,"Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707","Specify the path to .tsbuildinfo incremental compilation file."),Specify_options_for_automatic_acquisition_of_declaration_files:r(6709,3,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:r(6710,3,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like './node_modules/@types'."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:r(6711,3,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:r(6712,3,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:r(6713,3,"Enable_verbose_logging_6713","Enable verbose logging."),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:r(6714,3,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:r(6715,3,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:r(6717,3,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:r(6718,3,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types."),Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files:r(6719,3,"Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719","Require sufficient annotation on exports so other tools can trivially generate declaration files."),Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any:r(6720,3,"Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720","Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),Default_catch_clause_variables_as_unknown_instead_of_any:r(6803,3,"Default_catch_clause_variables_as_unknown_instead_of_any_6803","Default catch clause variables as 'unknown' instead of 'any'."),Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting:r(6804,3,"Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804","Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported:r(6805,3,"Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805","Disable full type checking (only critical parse and emit errors will be reported)."),Check_side_effect_imports:r(6806,3,"Check_side_effect_imports_6806","Check side effect imports."),This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2:r(6807,1,"This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807","This operation can be simplified. This shift is identical to `{0} {1} {2}`."),one_of_Colon:r(6900,3,"one_of_Colon_6900","one of:"),one_or_more_Colon:r(6901,3,"one_or_more_Colon_6901","one or more:"),type_Colon:r(6902,3,"type_Colon_6902","type:"),default_Colon:r(6903,3,"default_Colon_6903","default:"),module_system_or_esModuleInterop:r(6904,3,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:r(6905,3,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:r(6906,3,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:r(6907,3,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:r(6908,3,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:r(6909,3,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:r(69010,3,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:r(6911,3,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:r(6912,3,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:r(6913,3,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:r(6914,3,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:r(6915,3,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:r(6916,3,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:r(6917,3,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:r(6918,3,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:r(6919,3,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:r(6920,3,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:r(6921,3,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:r(6922,3,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:r(6923,3,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:r(6924,3,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:r(6925,3,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:r(6926,3,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:r(6927,3,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:r(6928,3,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:r(6929,3,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:r(6930,3,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),List_of_file_name_suffixes_to_search_when_resolving_a_module:r(6931,1,"List_of_file_name_suffixes_to_search_when_resolving_a_module_6931","List of file name suffixes to search when resolving a module."),Variable_0_implicitly_has_an_1_type:r(7005,1,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:r(7006,1,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:r(7008,1,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:r(7009,1,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:r(7010,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:r(7011,1,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation:r(7012,1,"This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012","This overload implicitly returns the type '{0}' because it lacks a return type annotation."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:r(7013,1,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:r(7014,1,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:r(7015,1,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:r(7016,1,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:r(7017,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:r(7018,1,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:r(7019,1,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:r(7020,1,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:r(7022,1,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:r(7023,1,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:r(7024,1,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation:r(7025,1,"Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation_7025","Generator implicitly has yield type '{0}'. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:r(7026,1,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:r(7027,1,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:r(7028,1,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:r(7029,1,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:r(7030,1,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:r(7031,1,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:r(7032,1,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:r(7033,1,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:r(7034,1,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:r(7035,1,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:r(7036,1,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:r(7037,3,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:r(7038,3,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:r(7039,1,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:r(7040,1,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:r(7041,1,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:r(7042,1,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:r(7043,2,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:r(7044,2,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:r(7045,2,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:r(7046,2,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:r(7047,2,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:r(7048,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:r(7049,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:r(7050,2,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:r(7051,1,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:r(7052,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:r(7053,1,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:r(7054,1,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:r(7055,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:r(7056,1,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:r(7057,1,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:r(7058,1,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:r(7059,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:r(7060,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:r(7061,1,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),You_cannot_rename_this_element:r(8e3,1,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:r(8001,1,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:r(8002,1,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:r(8003,1,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:r(8004,1,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:r(8005,1,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:r(8006,1,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:r(8008,1,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:r(8009,1,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:r(8010,1,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:r(8011,1,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:r(8012,1,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:r(8013,1,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:r(8016,1,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Signature_declarations_can_only_be_used_in_TypeScript_files:r(8017,1,"Signature_declarations_can_only_be_used_in_TypeScript_files_8017","Signature declarations can only be used in TypeScript files."),Report_errors_in_js_files:r(8019,3,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:r(8020,1,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:r(8021,1,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:r(8022,1,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:r(8023,1,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:r(8024,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:r(8025,1,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:r(8026,1,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:r(8027,1,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:r(8028,1,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:r(8029,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:r(8030,1,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:r(8031,1,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:r(8032,1,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:r(8033,1,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:r(8034,1,"The_tag_was_first_specified_here_8034","The tag was first specified here."),You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:r(8035,1,"You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035","You cannot rename elements that are defined in a 'node_modules' folder."),You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder:r(8036,1,"You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036","You cannot rename elements that are defined in another 'node_modules' folder."),Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files:r(8037,1,"Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037","Type satisfaction expressions can only be used in TypeScript files."),Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export:r(8038,1,"Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038","Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag:r(8039,1,"A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039","A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:r(9005,1,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:r(9006,1,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations:r(9007,1,"Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9007","Function must have an explicit return type annotation with --isolatedDeclarations."),Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations:r(9008,1,"Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9008","Method must have an explicit return type annotation with --isolatedDeclarations."),At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations:r(9009,1,"At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9009","At least one accessor must have an explicit type annotation with --isolatedDeclarations."),Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations:r(9010,1,"Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9010","Variable must have an explicit type annotation with --isolatedDeclarations."),Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations:r(9011,1,"Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9011","Parameter must have an explicit type annotation with --isolatedDeclarations."),Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations:r(9012,1,"Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9012","Property must have an explicit type annotation with --isolatedDeclarations."),Expression_type_can_t_be_inferred_with_isolatedDeclarations:r(9013,1,"Expression_type_can_t_be_inferred_with_isolatedDeclarations_9013","Expression type can't be inferred with --isolatedDeclarations."),Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations:r(9014,1,"Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedD_9014","Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations."),Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations:r(9015,1,"Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations_9015","Objects that contain spread assignments can't be inferred with --isolatedDeclarations."),Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations:r(9016,1,"Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations_9016","Objects that contain shorthand properties can't be inferred with --isolatedDeclarations."),Only_const_arrays_can_be_inferred_with_isolatedDeclarations:r(9017,1,"Only_const_arrays_can_be_inferred_with_isolatedDeclarations_9017","Only const arrays can be inferred with --isolatedDeclarations."),Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations:r(9018,1,"Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations_9018","Arrays with spread elements can't inferred with --isolatedDeclarations."),Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations:r(9019,1,"Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations_9019","Binding elements can't be exported directly with --isolatedDeclarations."),Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations:r(9020,1,"Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDecl_9020","Enum member initializers must be computable without references to external symbols with --isolatedDeclarations."),Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations:r(9021,1,"Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations_9021","Extends clause can't contain an expression with --isolatedDeclarations."),Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations:r(9022,1,"Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations_9022","Inference from class expressions is not supported with --isolatedDeclarations."),Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function:r(9023,1,"Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations__9023","Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function."),Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations:r(9025,1,"Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_sup_9025","Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations."),Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations:r(9026,1,"Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_support_9026","Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations."),Add_a_type_annotation_to_the_variable_0:r(9027,1,"Add_a_type_annotation_to_the_variable_0_9027","Add a type annotation to the variable {0}."),Add_a_type_annotation_to_the_parameter_0:r(9028,1,"Add_a_type_annotation_to_the_parameter_0_9028","Add a type annotation to the parameter {0}."),Add_a_type_annotation_to_the_property_0:r(9029,1,"Add_a_type_annotation_to_the_property_0_9029","Add a type annotation to the property {0}."),Add_a_return_type_to_the_function_expression:r(9030,1,"Add_a_return_type_to_the_function_expression_9030","Add a return type to the function expression."),Add_a_return_type_to_the_function_declaration:r(9031,1,"Add_a_return_type_to_the_function_declaration_9031","Add a return type to the function declaration."),Add_a_return_type_to_the_get_accessor_declaration:r(9032,1,"Add_a_return_type_to_the_get_accessor_declaration_9032","Add a return type to the get accessor declaration."),Add_a_type_to_parameter_of_the_set_accessor_declaration:r(9033,1,"Add_a_type_to_parameter_of_the_set_accessor_declaration_9033","Add a type to parameter of the set accessor declaration."),Add_a_return_type_to_the_method:r(9034,1,"Add_a_return_type_to_the_method_9034","Add a return type to the method"),Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit:r(9035,1,"Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035","Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit."),Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it:r(9036,1,"Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036","Move the expression in default export to a variable and add a type annotation to it."),Default_exports_can_t_be_inferred_with_isolatedDeclarations:r(9037,1,"Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037","Default exports can't be inferred with --isolatedDeclarations."),Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations:r(9038,1,"Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038","Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."),Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations:r(9039,1,"Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039","Type containing private name '{0}' can't be used with --isolatedDeclarations."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:r(17e3,1,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:r(17001,1,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:r(17002,1,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:r(17004,1,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:r(17005,1,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:r(17006,1,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:r(17007,1,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:r(17008,1,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:r(17009,1,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:r(17010,1,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:r(17011,1,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:r(17012,1,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:r(17013,1,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:r(17014,1,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:r(17015,1,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:r(17016,1,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:r(17017,1,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:r(17018,1,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:r(17019,1,"_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17019","'{0}' at the end of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:r(17020,1,"_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17020","'{0}' at the start of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),Unicode_escape_sequence_cannot_appear_here:r(17021,1,"Unicode_escape_sequence_cannot_appear_here_17021","Unicode escape sequence cannot appear here."),Circularity_detected_while_resolving_configuration_Colon_0:r(18e3,1,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:r(18002,1,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:r(18003,1,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:r(80001,2,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:r(80002,2,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:r(80003,2,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:r(80004,2,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:r(80005,2,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:r(80006,2,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:r(80007,2,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:r(80008,2,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),JSDoc_typedef_may_be_converted_to_TypeScript_type:r(80009,2,"JSDoc_typedef_may_be_converted_to_TypeScript_type_80009","JSDoc typedef may be converted to TypeScript type."),JSDoc_typedefs_may_be_converted_to_TypeScript_types:r(80010,2,"JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010","JSDoc typedefs may be converted to TypeScript types."),Add_missing_super_call:r(90001,3,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:r(90002,3,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:r(90003,3,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:r(90004,3,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:r(90005,3,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:r(90006,3,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:r(90007,3,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:r(90008,3,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:r(90010,3,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:r(90011,3,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:r(90012,3,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_1:r(90013,3,"Import_0_from_1_90013",`Import '{0}' from "{1}"`),Change_0_to_1:r(90014,3,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Declare_property_0:r(90016,3,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:r(90017,3,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:r(90018,3,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:r(90019,3,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:r(90020,3,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:r(90021,3,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:r(90022,3,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:r(90023,3,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:r(90024,3,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:r(90025,3,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:r(90026,3,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:r(90027,3,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:r(90028,3,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:r(90029,3,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:r(90030,3,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:r(90031,3,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Add_parameter_name:r(90034,3,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:r(90035,3,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:r(90036,3,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:r(90037,3,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:r(90038,3,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:r(90039,3,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:r(90041,3,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:r(90053,3,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:r(90054,3,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Remove_type_from_import_declaration_from_0:r(90055,3,"Remove_type_from_import_declaration_from_0_90055",`Remove 'type' from import declaration from "{0}"`),Remove_type_from_import_of_0_from_1:r(90056,3,"Remove_type_from_import_of_0_from_1_90056",`Remove 'type' from import of '{0}' from "{1}"`),Add_import_from_0:r(90057,3,"Add_import_from_0_90057",'Add import from "{0}"'),Update_import_from_0:r(90058,3,"Update_import_from_0_90058",'Update import from "{0}"'),Export_0_from_module_1:r(90059,3,"Export_0_from_module_1_90059","Export '{0}' from module '{1}'"),Export_all_referenced_locals:r(90060,3,"Export_all_referenced_locals_90060","Export all referenced locals"),Update_modifiers_of_0:r(90061,3,"Update_modifiers_of_0_90061","Update modifiers of '{0}'"),Add_annotation_of_type_0:r(90062,3,"Add_annotation_of_type_0_90062","Add annotation of type '{0}'"),Add_return_type_0:r(90063,3,"Add_return_type_0_90063","Add return type '{0}'"),Extract_base_class_to_variable:r(90064,3,"Extract_base_class_to_variable_90064","Extract base class to variable"),Extract_default_export_to_variable:r(90065,3,"Extract_default_export_to_variable_90065","Extract default export to variable"),Extract_binding_expressions_to_variable:r(90066,3,"Extract_binding_expressions_to_variable_90066","Extract binding expressions to variable"),Add_all_missing_type_annotations:r(90067,3,"Add_all_missing_type_annotations_90067","Add all missing type annotations"),Add_satisfies_and_an_inline_type_assertion_with_0:r(90068,3,"Add_satisfies_and_an_inline_type_assertion_with_0_90068","Add satisfies and an inline type assertion with '{0}'"),Extract_to_variable_and_replace_with_0_as_typeof_0:r(90069,3,"Extract_to_variable_and_replace_with_0_as_typeof_0_90069","Extract to variable and replace with '{0} as typeof {0}'"),Mark_array_literal_as_const:r(90070,3,"Mark_array_literal_as_const_90070","Mark array literal as const"),Annotate_types_of_properties_expando_function_in_a_namespace:r(90071,3,"Annotate_types_of_properties_expando_function_in_a_namespace_90071","Annotate types of properties expando function in a namespace"),Convert_function_to_an_ES2015_class:r(95001,3,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:r(95003,3,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:r(95004,3,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:r(95005,3,"Extract_function_95005","Extract function"),Extract_constant:r(95006,3,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:r(95007,3,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:r(95008,3,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:r(95009,3,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:r(95011,3,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:r(95012,3,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:r(95013,3,"Convert_to_default_import_95013","Convert to default import"),Install_0:r(95014,3,"Install_0_95014","Install '{0}'"),Replace_import_with_0:r(95015,3,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:r(95016,3,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:r(95017,3,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:r(95018,3,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:r(95019,3,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:r(95020,3,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:r(95021,3,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:r(95022,3,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:r(95023,3,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:r(95024,3,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:r(95025,3,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:r(95026,3,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:r(95027,3,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:r(95028,3,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:r(95029,3,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:r(95030,3,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:r(95031,3,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:r(95032,3,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:r(95033,3,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:r(95034,3,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:r(95035,3,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:r(95036,3,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:r(95037,3,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:r(95038,3,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:r(95039,3,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:r(95040,3,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:r(95041,3,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:r(95042,3,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:r(95043,3,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:r(95044,3,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:r(95045,3,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:r(95046,3,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:r(95047,3,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:r(95048,3,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:r(95049,3,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:r(95050,3,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:r(95051,3,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:r(95052,3,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:r(95053,3,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:r(95054,3,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:r(95055,3,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:r(95056,3,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:r(95057,3,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:r(95058,3,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:r(95059,3,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:r(95060,3,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:r(95061,3,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:r(95062,3,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:r(95063,3,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:r(95064,3,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:r(95065,3,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:r(95066,3,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:r(95067,3,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:r(95068,3,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:r(95069,3,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:r(95070,3,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:r(95071,3,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:r(95072,3,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:r(95073,3,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:r(95074,3,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:r(95075,3,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:r(95077,3,"Extract_type_95077","Extract type"),Extract_to_type_alias:r(95078,3,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:r(95079,3,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:r(95080,3,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:r(95081,3,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:r(95082,3,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:r(95083,3,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:r(95084,3,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:r(95085,3,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:r(95086,3,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:r(95087,3,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:r(95088,3,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:r(95089,3,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:r(95090,3,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:r(95091,3,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:r(95092,3,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:r(95093,3,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:r(95094,3,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:r(95095,3,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:r(95096,3,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:r(95097,3,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:r(95098,3,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:r(95099,3,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:r(95100,3,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:r(95101,3,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_all_const_to_let:r(95102,3,"Convert_all_const_to_let_95102","Convert all 'const' to 'let'"),Convert_function_expression_0_to_arrow_function:r(95105,3,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:r(95106,3,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:r(95107,3,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:r(95108,3,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:r(95109,3,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file:r(95110,3,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig to read more about this file"),Add_a_return_statement:r(95111,3,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:r(95112,3,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:r(95113,3,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:r(95114,3,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:r(95115,3,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:r(95116,3,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:r(95117,3,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:r(95118,3,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:r(95119,3,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:r(95120,3,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:r(95121,3,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:r(95122,3,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:r(95123,3,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:r(95124,3,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:r(95125,3,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:r(95126,3,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:r(95127,3,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:r(95128,3,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:r(95129,3,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:r(95130,3,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:r(95131,3,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:r(95132,3,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:r(95133,3,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:r(95134,3,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:r(95135,3,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:r(95136,3,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:r(95137,3,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:r(95138,3,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:r(95139,3,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:r(95140,3,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:r(95141,3,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:r(95142,3,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:r(95143,3,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:r(95144,3,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:r(95145,3,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:r(95146,3,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:r(95147,3,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:r(95148,3,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:r(95149,3,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:r(95150,3,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:r(95151,3,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:r(95152,3,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:r(95153,3,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenations_and_string_literals:r(95154,3,"Can_only_convert_string_concatenations_and_string_literals_95154","Can only convert string concatenations and string literals"),Selection_is_not_a_valid_statement_or_statements:r(95155,3,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:r(95156,3,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:r(95157,3,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:r(95158,3,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:r(95159,3,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:r(95160,3,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:r(95161,3,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:r(95162,3,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:r(95163,3,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:r(95164,3,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:r(95165,3,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:r(95166,3,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:r(95167,3,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:r(95168,3,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:r(95169,3,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),Convert_named_imports_to_default_import:r(95170,3,"Convert_named_imports_to_default_import_95170","Convert named imports to default import"),Delete_unused_param_tag_0:r(95171,3,"Delete_unused_param_tag_0_95171","Delete unused '@param' tag '{0}'"),Delete_all_unused_param_tags:r(95172,3,"Delete_all_unused_param_tags_95172","Delete all unused '@param' tags"),Rename_param_tag_name_0_to_1:r(95173,3,"Rename_param_tag_name_0_to_1_95173","Rename '@param' tag name '{0}' to '{1}'"),Use_0:r(95174,3,"Use_0_95174","Use `{0}`."),Use_Number_isNaN_in_all_conditions:r(95175,3,"Use_Number_isNaN_in_all_conditions_95175","Use `Number.isNaN` in all conditions."),Convert_typedef_to_TypeScript_type:r(95176,3,"Convert_typedef_to_TypeScript_type_95176","Convert typedef to TypeScript type."),Convert_all_typedef_to_TypeScript_types:r(95177,3,"Convert_all_typedef_to_TypeScript_types_95177","Convert all typedef to TypeScript types."),Move_to_file:r(95178,3,"Move_to_file_95178","Move to file"),Cannot_move_to_file_selected_file_is_invalid:r(95179,3,"Cannot_move_to_file_selected_file_is_invalid_95179","Cannot move to file, selected file is invalid"),Use_import_type:r(95180,3,"Use_import_type_95180","Use 'import type'"),Use_type_0:r(95181,3,"Use_type_0_95181","Use 'type {0}'"),Fix_all_with_type_only_imports:r(95182,3,"Fix_all_with_type_only_imports_95182","Fix all with type-only imports"),Cannot_move_statements_to_the_selected_file:r(95183,3,"Cannot_move_statements_to_the_selected_file_95183","Cannot move statements to the selected file"),Inline_variable:r(95184,3,"Inline_variable_95184","Inline variable"),Could_not_find_variable_to_inline:r(95185,3,"Could_not_find_variable_to_inline_95185","Could not find variable to inline."),Variables_with_multiple_declarations_cannot_be_inlined:r(95186,3,"Variables_with_multiple_declarations_cannot_be_inlined_95186","Variables with multiple declarations cannot be inlined."),Add_missing_comma_for_object_member_completion_0:r(95187,3,"Add_missing_comma_for_object_member_completion_0_95187","Add missing comma for object member completion '{0}'."),Add_missing_parameter_to_0:r(95188,3,"Add_missing_parameter_to_0_95188","Add missing parameter to '{0}'"),Add_missing_parameters_to_0:r(95189,3,"Add_missing_parameters_to_0_95189","Add missing parameters to '{0}'"),Add_all_missing_parameters:r(95190,3,"Add_all_missing_parameters_95190","Add all missing parameters"),Add_optional_parameter_to_0:r(95191,3,"Add_optional_parameter_to_0_95191","Add optional parameter to '{0}'"),Add_optional_parameters_to_0:r(95192,3,"Add_optional_parameters_to_0_95192","Add optional parameters to '{0}'"),Add_all_optional_parameters:r(95193,3,"Add_all_optional_parameters_95193","Add all optional parameters"),Wrap_in_parentheses:r(95194,3,"Wrap_in_parentheses_95194","Wrap in parentheses"),Wrap_all_invalid_decorator_expressions_in_parentheses:r(95195,3,"Wrap_all_invalid_decorator_expressions_in_parentheses_95195","Wrap all invalid decorator expressions in parentheses"),Add_resolution_mode_import_attribute:r(95196,3,"Add_resolution_mode_import_attribute_95196","Add 'resolution-mode' import attribute"),Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it:r(95197,3,"Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it_95197","Add 'resolution-mode' import attribute to all type-only imports that need it"),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:r(18004,1,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:r(18006,1,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:r(18007,1,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:r(18009,1,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:r(18010,1,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:r(18011,1,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:r(18012,1,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:r(18013,1,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:r(18014,1,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:r(18015,1,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:r(18016,1,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:r(18017,1,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:r(18018,1,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:r(18019,1,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:r(18024,1,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:r(18026,1,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:r(18027,1,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:r(18028,1,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:r(18029,1,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:r(18030,1,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:r(18031,1,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:r(18032,1,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values:r(18033,1,"Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033","Type '{0}' is not assignable to type '{1}' as required for computed enum member values."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:r(18034,3,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:r(18035,1,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:r(18036,1,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),await_expression_cannot_be_used_inside_a_class_static_block:r(18037,1,"await_expression_cannot_be_used_inside_a_class_static_block_18037","'await' expression cannot be used inside a class static block."),for_await_loops_cannot_be_used_inside_a_class_static_block:r(18038,1,"for_await_loops_cannot_be_used_inside_a_class_static_block_18038","'for await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:r(18039,1,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:r(18041,1,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block."),_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation:r(18042,1,"_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042","'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."),Types_cannot_appear_in_export_declarations_in_JavaScript_files:r(18043,1,"Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043","Types cannot appear in export declarations in JavaScript files."),_0_is_automatically_exported_here:r(18044,3,"_0_is_automatically_exported_here_18044","'{0}' is automatically exported here."),Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher:r(18045,1,"Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045","Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."),_0_is_of_type_unknown:r(18046,1,"_0_is_of_type_unknown_18046","'{0}' is of type 'unknown'."),_0_is_possibly_null:r(18047,1,"_0_is_possibly_null_18047","'{0}' is possibly 'null'."),_0_is_possibly_undefined:r(18048,1,"_0_is_possibly_undefined_18048","'{0}' is possibly 'undefined'."),_0_is_possibly_null_or_undefined:r(18049,1,"_0_is_possibly_null_or_undefined_18049","'{0}' is possibly 'null' or 'undefined'."),The_value_0_cannot_be_used_here:r(18050,1,"The_value_0_cannot_be_used_here_18050","The value '{0}' cannot be used here."),Compiler_option_0_cannot_be_given_an_empty_string:r(18051,1,"Compiler_option_0_cannot_be_given_an_empty_string_18051","Compiler option '{0}' cannot be given an empty string."),Its_type_0_is_not_a_valid_JSX_element_type:r(18053,1,"Its_type_0_is_not_a_valid_JSX_element_type_18053","Its type '{0}' is not a valid JSX element type."),await_using_statements_cannot_be_used_inside_a_class_static_block:r(18054,1,"await_using_statements_cannot_be_used_inside_a_class_static_block_18054","'await using' statements cannot be used inside a class static block."),_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled:r(18055,1,"_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055","'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."),Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled:r(18056,1,"Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056","Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."),String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020:r(18057,1,"String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057","String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'.")};function wt(e){return e>=80}function Fy(e){return e===32||wt(e)}var nf={abstract:128,accessor:129,any:133,as:130,asserts:131,assert:132,bigint:163,boolean:136,break:83,case:84,catch:85,class:86,continue:88,const:87,constructor:137,debugger:89,declare:138,default:90,delete:91,do:92,else:93,enum:94,export:95,extends:96,false:97,finally:98,for:99,from:161,function:100,get:139,if:101,implements:119,import:102,in:103,infer:140,instanceof:104,interface:120,intrinsic:141,is:142,keyof:143,let:121,module:144,namespace:145,never:146,new:105,null:106,number:150,object:151,package:122,private:123,protected:124,public:125,override:164,out:147,readonly:148,require:149,global:162,return:107,satisfies:152,set:153,static:126,string:154,super:108,switch:109,symbol:155,this:110,throw:111,true:112,try:113,type:156,typeof:114,undefined:157,unique:158,unknown:159,using:160,var:115,void:116,while:117,with:118,yield:127,async:134,await:135,of:165},Vy=new Map(Object.entries(nf)),Bm=new Map(Object.entries({...nf,"{":19,"}":20,"(":21,")":22,"[":23,"]":24,".":25,"...":26,";":27,",":28,"<":30,">":32,"<=":33,">=":34,"==":35,"!=":36,"===":37,"!==":38,"=>":39,"+":40,"-":41,"**":43,"*":42,"/":44,"%":45,"++":46,"--":47,"<<":48,">":49,">>>":50,"&":51,"|":52,"^":53,"!":54,"~":55,"&&":56,"||":57,"?":58,"??":61,"?.":29,":":59,"=":64,"+=":65,"-=":66,"*=":67,"**=":68,"/=":69,"%=":70,"<<=":71,">>=":72,">>>=":73,"&=":74,"|=":75,"^=":79,"||=":76,"&&=":77,"??=":78,"@":60,"#":63,"`":62})),qm=new Map([[100,1],[103,2],[105,4],[109,8],[115,16],[117,32],[118,64],[121,128]]),Wy=new Map([[1,Q_.RegularExpressionFlagsHasIndices],[16,Q_.RegularExpressionFlagsDotAll],[32,Q_.RegularExpressionFlagsUnicode],[64,Q_.RegularExpressionFlagsUnicodeSets],[128,Q_.RegularExpressionFlagsSticky]]),Gy=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],Yy=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],Xy=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2160,2183,2185,2190,2208,2249,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3165,3165,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3293,3294,3296,3297,3313,3314,3332,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5905,5919,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6988,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42954,42960,42961,42963,42963,42965,42969,42994,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69248,69289,69296,69297,69376,69404,69415,69415,69424,69445,69488,69505,69552,69572,69600,69622,69635,69687,69745,69746,69749,69749,69763,69807,69840,69864,69891,69926,69956,69956,69959,69959,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70207,70208,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70753,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71488,71494,71680,71723,71840,71903,71935,71942,71945,71945,71948,71955,71957,71958,71960,71983,71999,71999,72001,72001,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72368,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73474,73474,73476,73488,73490,73523,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78913,78918,82944,83526,92160,92728,92736,92766,92784,92862,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101589,101632,101640,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,122624,122654,122661,122666,122928,122989,123136,123180,123191,123197,123214,123214,123536,123565,123584,123627,124112,124139,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173791,173824,177977,177984,178205,178208,183969,183984,191456,191472,192093,194560,195101,196608,201546,201552,205743],Hy=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2160,2183,2185,2190,2200,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2901,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3132,3140,3142,3144,3146,3149,3157,3158,3160,3162,3165,3165,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3293,3294,3296,3299,3302,3311,3313,3315,3328,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3457,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3790,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5909,5919,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6159,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6847,6862,6912,6988,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42954,42960,42961,42963,42963,42965,42969,42994,43047,43052,43052,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69248,69289,69291,69292,69296,69297,69373,69404,69415,69415,69424,69456,69488,69509,69552,69572,69600,69622,69632,69702,69734,69749,69759,69818,69826,69826,69840,69864,69872,69881,69888,69940,69942,69951,69956,69959,69968,70003,70006,70006,70016,70084,70089,70092,70094,70106,70108,70108,70144,70161,70163,70199,70206,70209,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70753,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71488,71494,71680,71738,71840,71913,71935,71942,71945,71945,71948,71955,71957,71958,71960,71989,71991,71992,71995,72003,72016,72025,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72368,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73472,73488,73490,73530,73534,73538,73552,73561,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78912,78933,82944,83526,92160,92728,92736,92766,92768,92777,92784,92862,92864,92873,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94180,94192,94193,94208,100343,100352,101589,101632,101640,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,118528,118573,118576,118598,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122624,122654,122661,122666,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,122928,122989,123023,123023,123136,123180,123184,123197,123200,123209,123214,123214,123536,123566,123584,123641,124112,124153,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,130032,130041,131072,173791,173824,177977,177984,178205,178208,183969,183984,191456,191472,192093,194560,195101,196608,201546,201552,205743,917760,917999],$y=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,Qy=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/,Ky=/@(?:see|link)/i;function dl(e,t){if(e=2?dl(e,Xy):dl(e,Gy)}function eg(e,t){return t>=2?dl(e,Hy):dl(e,Yy)}function zm(e){let t=[];return e.forEach((a,o)=>{t[a]=o}),t}var tg=zm(Bm);function it(e){return tg[e]}function Fm(e){return Bm.get(e)}var z4=zm(qm);function Pd(e){return qm.get(e)}function Vm(e){let t=[],a=0,o=0;for(;a127&&Cn(m)&&(t.push(o),o=a);break}}return t.push(o),t}function ng(e,t,a,o,m){(t<0||t>=e.length)&&(m?t=t<0?0:t>=e.length?e.length-1:t:B.fail(`Bad line number. Line: ${t}, lineStarts.length: ${e.length} , line map is correct? ${o!==void 0?_y(e,Vm(o)):"unknown"}`));let v=e[t]+a;return m?v>e[t+1]?e[t+1]:typeof o=="string"&&v>o.length?o.length:v:(t=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function Cn(e){return e===10||e===13||e===8232||e===8233}function fi(e){return e>=48&&e<=57}function vp(e){return fi(e)||e>=65&&e<=70||e>=97&&e<=102}function rf(e){return e>=65&&e<=90||e>=97&&e<=122}function Gm(e){return rf(e)||fi(e)||e===95}function Tp(e){return e>=48&&e<=55}function Ar(e,t,a,o,m){if(fs(t))return t;let v=!1;for(;;){let A=e.charCodeAt(t);switch(A){case 13:e.charCodeAt(t+1)===10&&t++;case 10:if(t++,a)return t;v=!!m;continue;case 9:case 11:case 12:case 32:t++;continue;case 47:if(o)break;if(e.charCodeAt(t+1)===47){for(t+=2;t127&&Ba(A)){t++;continue}break}return t}}var sl=7;function Wi(e,t){if(B.assert(t>=0),t===0||Cn(e.charCodeAt(t-1))){let a=e.charCodeAt(t);if(t+sl=0&&a127&&Ba(I)){y&&Cn(I)&&(h=!0),a++;continue}break e}}return y&&(x=m(P,l,Q,h,v,x)),x}function Hm(e,t,a,o){return xl(!1,e,t,!1,a,o)}function $m(e,t,a,o){return xl(!1,e,t,!0,a,o)}function ag(e,t,a,o,m){return xl(!0,e,t,!1,a,o,m)}function _g(e,t,a,o,m){return xl(!0,e,t,!0,a,o,m)}function Qm(e,t,a,o,m,v=[]){return v.push({kind:a,pos:e,end:t,hasTrailingNewLine:o}),v}function Jp(e,t){return ag(e,t,Qm,void 0,void 0)}function sg(e,t){return _g(e,t,Qm,void 0,void 0)}function _f(e){let t=af.exec(e);if(t)return t[0]}function Zn(e,t){return rf(e)||e===36||e===95||e>127&&Zy(e,t)}function Er(e,t,a){return Gm(e)||e===36||(a===1?e===45||e===58:!1)||e>127&&eg(e,t)}function og(e,t,a){let o=Gi(e,0);if(!Zn(o,t))return!1;for(let m=Ft(o);mh,getStartPos:()=>h,getTokenEnd:()=>l,getTextPos:()=>l,getToken:()=>g,getTokenStart:()=>y,getTokenPos:()=>y,getTokenText:()=>P.substring(y,l),getTokenValue:()=>x,hasUnicodeEscape:()=>(I&1024)!==0,hasExtendedUnicodeEscape:()=>(I&8)!==0,hasPrecedingLineBreak:()=>(I&1)!==0,hasPrecedingJSDocComment:()=>(I&2)!==0,hasPrecedingJSDocLeadingAsterisks:()=>(I&32768)!==0,isIdentifier:()=>g===80||g>118,isReservedWord:()=>g>=83&&g<=118,isUnterminated:()=>(I&4)!==0,getCommentDirectives:()=>re,getNumericLiteralFlags:()=>I&25584,getTokenFlags:()=>I,reScanGreaterToken:lt,reScanAsteriskEqualsToken:ar,reScanSlashToken:mt,reScanTemplateToken:Bt,reScanTemplateHeadOrNoSubstitutionTemplate:rn,scanJsxIdentifier:Nr,scanJsxAttributeValue:Vn,reScanJsxAttributeValue:Ce,reScanJsxToken:_r,reScanLessThanToken:fr,reScanHashToken:dr,reScanQuestionToken:zn,reScanInvalidIdentifier:Ut,scanJsxToken:Fn,scanJsDocToken:L,scanJSDocCommentTextToken:mr,scan:ct,getText:Ke,clearCommentDirectives:st,setText:Dt,setScriptTarget:ut,setLanguageVariant:Ir,setScriptKind:hr,setJSDocParsingMode:Mn,setOnError:Tt,resetTokenState:Wn,setTextPos:Wn,setSkipJsDocLeadingAsterisks:Si,tryScan:He,lookAhead:Te,scanRange:fe};return B.isDebugging&&Object.defineProperty(M,"__debugShowCurrentPositionInText",{get:()=>{let R=M.getText();return R.slice(0,M.getTokenFullStart())+"\u2551"+R.slice(M.getTokenFullStart())}}),M;function ae(R){return Gi(P,R)}function Oe(R){return R>=0&&R=0&&R=65&&be<=70)be+=32;else if(!(be>=48&&be<=57||be>=97&&be<=102))break;xe.push(be),l++,we=!1}return xe.length=Q){K+=P.substring(xe,l),I|=4,W(E.Unterminated_string_literal);break}let Se=V(l);if(Se===$){K+=P.substring(xe,l),l++;break}if(Se===92&&!R){K+=P.substring(xe,l),K+=Ot(3),xe=l;continue}if((Se===10||Se===13)&&!R){K+=P.substring(xe,l),I|=4,W(E.Unterminated_string_literal);break}l++}return K}function Pr(R){let $=V(l)===96;l++;let K=l,xe="",Se;for(;;){if(l>=Q){xe+=P.substring(K,l),I|=4,W(E.Unterminated_template_literal),Se=$?15:18;break}let we=V(l);if(we===96){xe+=P.substring(K,l),l++,Se=$?15:18;break}if(we===36&&l+1=Q)return W(E.Unexpected_end_of_text),"";let K=V(l);switch(l++,K){case 48:if(l>=Q||!fi(V(l)))return"\0";case 49:case 50:case 51:l=55296&&xe<=56319&&l+6=56320&&We<=57343)return l=be,Se+String.fromCharCode(We)}return Se;case 120:for(;l<$+4;l++)if(!(l1114111&&(R&&W(E.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,K,l-K),we=!0),l>=Q?(R&&W(E.Unexpected_end_of_text),we=!0):V(l)===125?l++:(R&&W(E.Unterminated_Unicode_escape_sequence),we=!0),we?(I|=2048,P.substring($,l)):(I|=8,Nd(Se))}function On(){if(l+5=0&&Er(K,e)){R+=Bn(!0),$=l;continue}if(K=On(),!(K>=0&&Er(K,e)))break;I|=1024,R+=P.substring($,l),R+=Nd(K),l+=6,$=l}else break}return R+=P.substring($,l),R}function Qe(){let R=x.length;if(R>=2&&R<=12){let $=x.charCodeAt(0);if($>=97&&$<=122){let K=Vy.get(x);if(K!==void 0)return g=K}}return g=80}function qn(R){let $="",K=!1,xe=!1;for(;;){let Se=V(l);if(Se===95){I|=512,K?(K=!1,xe=!0):W(xe?E.Multiple_consecutive_numeric_separators_are_not_permitted:E.Numeric_separators_are_not_allowed_here,l,1),l++;continue}if(K=!0,!fi(Se)||Se-48>=R)break;$+=P[l],l++,xe=!1}return V(l-1)===95&&W(E.Numeric_separators_are_not_allowed_here,l-1,1),$}function $t(){return V(l)===110?(x+="n",I&384&&(x=bb(x)+"n"),l++,10):(x=""+(I&128?parseInt(x.slice(2),2):I&256?parseInt(x.slice(2),8):+x),9)}function ct(){for(h=l,I=0;;){if(y=l,l>=Q)return g=1;let R=ae(l);if(l===0&&R===35&&Ym(P,l)){if(l=Xm(P,l),t)continue;return g=6}switch(R){case 10:case 13:if(I|=1,t){l++;continue}else return R===13&&l+1=0&&Zn($,e))return x=Bn(!0)+vt(),g=Qe();let K=On();return K>=0&&Zn(K,e)?(l+=6,I|=1024,x=String.fromCharCode(K)+vt(),g=Qe()):(W(E.Invalid_character),l++,g=0);case 35:if(l!==0&&P[l+1]==="!")return W(E.can_only_be_used_at_the_start_of_a_file,l,2),l++,g=0;let xe=ae(l+1);if(xe===92){l++;let be=Mt();if(be>=0&&Zn(be,e))return x="#"+Bn(!0)+vt(),g=81;let We=On();if(We>=0&&Zn(We,e))return l+=6,I|=1024,x="#"+String.fromCharCode(We)+vt(),g=81;l--}return Zn(xe,e)?(l++,Jt(xe,e)):(x="#",W(E.Invalid_character,l++,Ft(R))),g=81;case 65533:return W(E.File_appears_to_be_binary,0,0),l=Q,g=8;default:let Se=Jt(R,e);if(Se)return g=Se;if(rs(R)){l+=Ft(R);continue}else if(Cn(R)){I|=1,l+=Ft(R);continue}let we=Ft(R);return W(E.Invalid_character,l,we),l+=we,g=0}}}function _t(){switch(de){case 0:return!0;case 1:return!1}return ye!==3&&ye!==4?!0:de===3?!1:Ky.test(P.slice(h,l))}function Ut(){B.assert(g===0,"'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."),l=y=h,I=0;let R=ae(l),$=Jt(R,99);return $?g=$:(l+=Ft(R),g)}function Jt(R,$){let K=R;if(Zn(K,$)){for(l+=Ft(K);l=Q)return g=1;let $=V(l);if($===60)return V(l+1)===47?(l+=2,g=31):(l++,g=30);if($===123)return l++,g=19;let K=0;for(;l0)break;Ba($)||(K=l)}l++}return x=P.substring(h,l),K===-1?13:12}function Nr(){if(wt(g)){for(;l=Q)return g=1;for(let $=V(l);l=0&&rs(V(l-1))&&!(l+1=Q)return g=1;let R=ae(l);switch(l+=Ft(R),R){case 9:case 11:case 12:case 32:for(;l=0&&Zn($,e))return x=Bn(!0)+vt(),g=Qe();let K=On();return K>=0&&Zn(K,e)?(l+=6,I|=1024,x=String.fromCharCode(K)+vt(),g=Qe()):(l++,g=0)}if(Zn(R,e)){let $=R;for(;l=0),l=R,h=R,y=R,g=0,x=void 0,I=0}function Si(R){he+=R?1:-1}}function Gi(e,t){return e.codePointAt(t)}function Ft(e){return e>=65536?2:e===-1?0:1}function cg(e){if(B.assert(0<=e&&e<=1114111),e<=65535)return String.fromCharCode(e);let t=Math.floor((e-65536)/1024)+55296,a=(e-65536)%1024+56320;return String.fromCharCode(t,a)}var lg=String.fromCodePoint?e=>String.fromCodePoint(e):cg;function Nd(e){return lg(e)}var Id=new Map(Object.entries({General_Category:"General_Category",gc:"General_Category",Script:"Script",sc:"Script",Script_Extensions:"Script_Extensions",scx:"Script_Extensions"})),Od=new Set(["ASCII","ASCII_Hex_Digit","AHex","Alphabetic","Alpha","Any","Assigned","Bidi_Control","Bidi_C","Bidi_Mirrored","Bidi_M","Case_Ignorable","CI","Cased","Changes_When_Casefolded","CWCF","Changes_When_Casemapped","CWCM","Changes_When_Lowercased","CWL","Changes_When_NFKC_Casefolded","CWKCF","Changes_When_Titlecased","CWT","Changes_When_Uppercased","CWU","Dash","Default_Ignorable_Code_Point","DI","Deprecated","Dep","Diacritic","Dia","Emoji","Emoji_Component","EComp","Emoji_Modifier","EMod","Emoji_Modifier_Base","EBase","Emoji_Presentation","EPres","Extended_Pictographic","ExtPict","Extender","Ext","Grapheme_Base","Gr_Base","Grapheme_Extend","Gr_Ext","Hex_Digit","Hex","IDS_Binary_Operator","IDSB","IDS_Trinary_Operator","IDST","ID_Continue","IDC","ID_Start","IDS","Ideographic","Ideo","Join_Control","Join_C","Logical_Order_Exception","LOE","Lowercase","Lower","Math","Noncharacter_Code_Point","NChar","Pattern_Syntax","Pat_Syn","Pattern_White_Space","Pat_WS","Quotation_Mark","QMark","Radical","Regional_Indicator","RI","Sentence_Terminal","STerm","Soft_Dotted","SD","Terminal_Punctuation","Term","Unified_Ideograph","UIdeo","Uppercase","Upper","Variation_Selector","VS","White_Space","space","XID_Continue","XIDC","XID_Start","XIDS"]),Md=new Set(["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Flag_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence","RGI_Emoji"]),Ra={General_Category:new Set(["C","Other","Cc","Control","cntrl","Cf","Format","Cn","Unassigned","Co","Private_Use","Cs","Surrogate","L","Letter","LC","Cased_Letter","Ll","Lowercase_Letter","Lm","Modifier_Letter","Lo","Other_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter","M","Mark","Combining_Mark","Mc","Spacing_Mark","Me","Enclosing_Mark","Mn","Nonspacing_Mark","N","Number","Nd","Decimal_Number","digit","Nl","Letter_Number","No","Other_Number","P","Punctuation","punct","Pc","Connector_Punctuation","Pd","Dash_Punctuation","Pe","Close_Punctuation","Pf","Final_Punctuation","Pi","Initial_Punctuation","Po","Other_Punctuation","Ps","Open_Punctuation","S","Symbol","Sc","Currency_Symbol","Sk","Modifier_Symbol","Sm","Math_Symbol","So","Other_Symbol","Z","Separator","Zl","Line_Separator","Zp","Paragraph_Separator","Zs","Space_Separator"]),Script:new Set(["Adlm","Adlam","Aghb","Caucasian_Albanian","Ahom","Arab","Arabic","Armi","Imperial_Aramaic","Armn","Armenian","Avst","Avestan","Bali","Balinese","Bamu","Bamum","Bass","Bassa_Vah","Batk","Batak","Beng","Bengali","Bhks","Bhaiksuki","Bopo","Bopomofo","Brah","Brahmi","Brai","Braille","Bugi","Buginese","Buhd","Buhid","Cakm","Chakma","Cans","Canadian_Aboriginal","Cari","Carian","Cham","Cher","Cherokee","Chrs","Chorasmian","Copt","Coptic","Qaac","Cpmn","Cypro_Minoan","Cprt","Cypriot","Cyrl","Cyrillic","Deva","Devanagari","Diak","Dives_Akuru","Dogr","Dogra","Dsrt","Deseret","Dupl","Duployan","Egyp","Egyptian_Hieroglyphs","Elba","Elbasan","Elym","Elymaic","Ethi","Ethiopic","Geor","Georgian","Glag","Glagolitic","Gong","Gunjala_Gondi","Gonm","Masaram_Gondi","Goth","Gothic","Gran","Grantha","Grek","Greek","Gujr","Gujarati","Guru","Gurmukhi","Hang","Hangul","Hani","Han","Hano","Hanunoo","Hatr","Hatran","Hebr","Hebrew","Hira","Hiragana","Hluw","Anatolian_Hieroglyphs","Hmng","Pahawh_Hmong","Hmnp","Nyiakeng_Puachue_Hmong","Hrkt","Katakana_Or_Hiragana","Hung","Old_Hungarian","Ital","Old_Italic","Java","Javanese","Kali","Kayah_Li","Kana","Katakana","Kawi","Khar","Kharoshthi","Khmr","Khmer","Khoj","Khojki","Kits","Khitan_Small_Script","Knda","Kannada","Kthi","Kaithi","Lana","Tai_Tham","Laoo","Lao","Latn","Latin","Lepc","Lepcha","Limb","Limbu","Lina","Linear_A","Linb","Linear_B","Lisu","Lyci","Lycian","Lydi","Lydian","Mahj","Mahajani","Maka","Makasar","Mand","Mandaic","Mani","Manichaean","Marc","Marchen","Medf","Medefaidrin","Mend","Mende_Kikakui","Merc","Meroitic_Cursive","Mero","Meroitic_Hieroglyphs","Mlym","Malayalam","Modi","Mong","Mongolian","Mroo","Mro","Mtei","Meetei_Mayek","Mult","Multani","Mymr","Myanmar","Nagm","Nag_Mundari","Nand","Nandinagari","Narb","Old_North_Arabian","Nbat","Nabataean","Newa","Nkoo","Nko","Nshu","Nushu","Ogam","Ogham","Olck","Ol_Chiki","Orkh","Old_Turkic","Orya","Oriya","Osge","Osage","Osma","Osmanya","Ougr","Old_Uyghur","Palm","Palmyrene","Pauc","Pau_Cin_Hau","Perm","Old_Permic","Phag","Phags_Pa","Phli","Inscriptional_Pahlavi","Phlp","Psalter_Pahlavi","Phnx","Phoenician","Plrd","Miao","Prti","Inscriptional_Parthian","Rjng","Rejang","Rohg","Hanifi_Rohingya","Runr","Runic","Samr","Samaritan","Sarb","Old_South_Arabian","Saur","Saurashtra","Sgnw","SignWriting","Shaw","Shavian","Shrd","Sharada","Sidd","Siddham","Sind","Khudawadi","Sinh","Sinhala","Sogd","Sogdian","Sogo","Old_Sogdian","Sora","Sora_Sompeng","Soyo","Soyombo","Sund","Sundanese","Sylo","Syloti_Nagri","Syrc","Syriac","Tagb","Tagbanwa","Takr","Takri","Tale","Tai_Le","Talu","New_Tai_Lue","Taml","Tamil","Tang","Tangut","Tavt","Tai_Viet","Telu","Telugu","Tfng","Tifinagh","Tglg","Tagalog","Thaa","Thaana","Thai","Tibt","Tibetan","Tirh","Tirhuta","Tnsa","Tangsa","Toto","Ugar","Ugaritic","Vaii","Vai","Vith","Vithkuqi","Wara","Warang_Citi","Wcho","Wancho","Xpeo","Old_Persian","Xsux","Cuneiform","Yezi","Yezidi","Yiii","Yi","Zanb","Zanabazar_Square","Zinh","Inherited","Qaai","Zyyy","Common","Zzzz","Unknown"]),Script_Extensions:void 0};Ra.Script_Extensions=Ra.Script;function wr(e){return e.start+e.length}function ug(e){return e.length===0}function of(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return{start:e,length:t}}function pg(e,t){return of(e,t-e)}function K_(e){return of(e.span.start,e.newLength)}function fg(e){return ug(e.span)&&e.newLength===0}function Km(e,t){if(t<0)throw new Error("newLength < 0");return{span:e,newLength:t}}var F4=Km(of(0,0),0);function cf(e,t){for(;e;){let a=t(e);if(a==="quit")return;if(a)return e;e=e.parent}}function ml(e){return(e.flags&16)===0}function dg(e,t){if(e===void 0||ml(e))return e;for(e=e.original;e;){if(ml(e))return!t||t(e)?e:void 0;e=e.original}}function Ja(e){return e.length>=2&&e.charCodeAt(0)===95&&e.charCodeAt(1)===95?"_"+e:e}function cs(e){let t=e;return t.length>=3&&t.charCodeAt(0)===95&&t.charCodeAt(1)===95&&t.charCodeAt(2)===95?t.substr(1):t}function Pn(e){return cs(e.escapedText)}function Sl(e){let t=Fm(e.escapedText);return t?by(t,di):void 0}function Lp(e){return e.valueDeclaration&&Lg(e.valueDeclaration)?Pn(e.valueDeclaration.name):cs(e.escapedName)}function Zm(e){let t=e.parent.parent;if(t){if(jd(t))return Zc(t);switch(t.kind){case 243:if(t.declarationList&&t.declarationList.declarations[0])return Zc(t.declarationList.declarations[0]);break;case 244:let a=t.expression;switch(a.kind===226&&a.operatorToken.kind===64&&(a=a.left),a.kind){case 211:return a.name;case 212:let o=a.argumentExpression;if(tt(o))return o}break;case 217:return Zc(t.expression);case 256:{if(jd(t.statement)||u1(t.statement))return Zc(t.statement);break}}}}function Zc(e){let t=e1(e);return t&&tt(t)?t:void 0}function mg(e){return e.name||Zm(e)}function hg(e){return!!e.name}function lf(e){switch(e.kind){case 80:return e;case 348:case 341:{let{name:a}=e;if(a.kind===166)return a.right;break}case 213:case 226:{let a=e;switch(yf(a)){case 1:case 4:case 5:case 3:return gf(a.left);case 7:case 8:case 9:return a.arguments[1];default:return}}case 346:return mg(e);case 340:return Zm(e);case 277:{let{expression:a}=e;return tt(a)?a:void 0}case 212:let t=e;if(g1(t))return t.argumentExpression}return e.name}function e1(e){if(e!==void 0)return lf(e)||(Mf(e)||Jf(e)||bl(e)?yg(e):void 0)}function yg(e){if(e.parent){if(nh(e.parent)||V1(e.parent))return e.parent.name;if(Zi(e.parent)&&e===e.parent.right){if(tt(e.parent.left))return e.parent.left;if(w1(e.parent.left))return gf(e.parent.left)}else if(Lf(e.parent)&&tt(e.parent.name))return e.parent.name}else return}function uf(e){if(q2(e))return Gr(e.modifiers,El)}function t1(e){if(bs(e,98303))return Gr(e.modifiers,Ug)}function n1(e,t){if(e.name)if(tt(e.name)){let a=e.name.escapedText;return ls(e.parent,t).filter(o=>Fp(o)&&tt(o.name)&&o.name.escapedText===a)}else{let a=e.parent.parameters.indexOf(e);B.assert(a>-1,"Parameters should always be in their parents' parameter list");let o=ls(e.parent,t).filter(Fp);if(aoh(o)&&o.typeParameters.some(m=>m.name.escapedText===a))}function vg(e){return r1(e,!1)}function Tg(e){return r1(e,!0)}function xg(e){return bi(e,i6)}function Sg(e){return Ng(e,f6)}function wg(e){return bi(e,a6,!0)}function kg(e){return bi(e,_6,!0)}function Eg(e){return bi(e,s6,!0)}function Ag(e){return bi(e,o6,!0)}function Cg(e){return bi(e,c6,!0)}function Dg(e){return bi(e,u6,!0)}function Pg(e){let t=bi(e,Ff);if(t&&t.typeExpression&&t.typeExpression.type)return t}function ls(e,t){var a;if(!bf(e))return bt;let o=(a=e.jsDoc)==null?void 0:a.jsDocCache;if(o===void 0||t){let m=k2(e,t);B.assert(m.length<2||m[0]!==m[1]),o=Am(m,v=>sh(v)?v.tags:v),t||(e.jsDoc??(e.jsDoc=[]),e.jsDoc.jsDocCache=o)}return o}function i1(e){return ls(e,!1)}function bi(e,t,a){return km(ls(e,a),t)}function Ng(e,t){return i1(e).filter(t)}function jp(e){return e.kind===80||e.kind===81}function Ig(e){return Xr(e)&&!!(e.flags&64)}function Og(e){return Xa(e)&&!!(e.flags&64)}function Jd(e){return Of(e)&&!!(e.flags&64)}function pf(e){return Vf(e,8)}function Mg(e){return cl(e)&&!!(e.flags&64)}function ff(e){return e>=166}function df(e){return e>=0&&e<=165}function a1(e){return df(e.kind)}function mi(e){return Cr(e,"pos")&&Cr(e,"end")}function Jg(e){return 9<=e&&e<=15}function Ld(e){return 15<=e&&e<=18}function Ua(e){var t;return tt(e)&&((t=e.emitNode)==null?void 0:t.autoGenerate)!==void 0}function _1(e){var t;return gi(e)&&((t=e.emitNode)==null?void 0:t.autoGenerate)!==void 0}function Lg(e){return(Va(e)||zg(e))&&gi(e.name)}function Wr(e){switch(e){case 128:case 129:case 134:case 87:case 138:case 90:case 95:case 103:case 125:case 123:case 124:case 148:case 126:case 147:case 164:return!0}return!1}function jg(e){return!!(x1(e)&31)}function Rg(e){return jg(e)||e===126||e===164||e===129}function Ug(e){return Wr(e.kind)}function s1(e){let t=e.kind;return t===80||t===81||t===11||t===9||t===167}function mf(e){return!!e&&qg(e.kind)}function Bg(e){switch(e){case 262:case 174:case 176:case 177:case 178:case 218:case 219:return!0;default:return!1}}function qg(e){switch(e){case 173:case 179:case 323:case 180:case 181:case 184:case 317:case 185:return!0;default:return Bg(e)}}function vi(e){return e&&(e.kind===263||e.kind===231)}function zg(e){switch(e.kind){case 174:case 177:case 178:return!0;default:return!1}}function Fg(e){let t=e.kind;return t===303||t===304||t===305||t===174||t===177||t===178}function o1(e){return K2(e.kind)}function Vg(e){if(e){let t=e.kind;return t===207||t===206}return!1}function Wg(e){let t=e.kind;return t===209||t===210}function Gg(e){switch(e.kind){case 260:case 169:case 208:return!0}return!1}function qa(e){return c1(pf(e).kind)}function c1(e){switch(e){case 211:case 212:case 214:case 213:case 284:case 285:case 288:case 215:case 209:case 217:case 210:case 231:case 218:case 80:case 81:case 14:case 9:case 10:case 11:case 15:case 228:case 97:case 106:case 110:case 112:case 108:case 235:case 233:case 236:case 102:case 282:return!0;default:return!1}}function Yg(e){return l1(pf(e).kind)}function l1(e){switch(e){case 224:case 225:case 220:case 221:case 222:case 223:case 216:return!0;default:return c1(e)}}function u1(e){return Xg(pf(e).kind)}function Xg(e){switch(e){case 227:case 229:case 219:case 226:case 230:case 234:case 232:case 356:case 355:case 238:return!0;default:return l1(e)}}function Hg(e){return e===219||e===208||e===263||e===231||e===175||e===176||e===266||e===306||e===281||e===262||e===218||e===177||e===273||e===271||e===276||e===264||e===291||e===174||e===173||e===267||e===270||e===274||e===280||e===169||e===303||e===172||e===171||e===178||e===304||e===265||e===168||e===260||e===346||e===338||e===348||e===202}function p1(e){return e===262||e===282||e===263||e===264||e===265||e===266||e===267||e===272||e===271||e===278||e===277||e===270}function f1(e){return e===252||e===251||e===259||e===246||e===244||e===242||e===249||e===250||e===248||e===245||e===256||e===253||e===255||e===257||e===258||e===243||e===247||e===254||e===353}function jd(e){return e.kind===168?e.parent&&e.parent.kind!==345||ea(e):Hg(e.kind)}function $g(e){let t=e.kind;return f1(t)||p1(t)||Qg(e)}function Qg(e){return e.kind!==241||e.parent!==void 0&&(e.parent.kind===258||e.parent.kind===299)?!1:!p2(e)}function Kg(e){let t=e.kind;return f1(t)||p1(t)||t===241}function d1(e){return e.kind>=309&&e.kind<=351}function Zg(e){return e.kind===320||e.kind===319||e.kind===321||n2(e)||e2(e)||r6(e)||Pl(e)}function e2(e){return e.kind>=327&&e.kind<=351}function el(e){return e.kind===178}function tl(e){return e.kind===177}function Xi(e){if(!bf(e))return!1;let{jsDoc:t}=e;return!!t&&t.length>0}function t2(e){return!!e.initializer}function wl(e){return e.kind===11||e.kind===15}function n2(e){return e.kind===324||e.kind===325||e.kind===326}function Rd(e){return(e.flags&33554432)!==0}var V4=r2();function r2(){var e="";let t=a=>e+=a;return{getText:()=>e,write:t,rawWrite:t,writeKeyword:t,writeOperator:t,writePunctuation:t,writeSpace:t,writeStringLiteral:t,writeLiteral:t,writeParameter:t,writeProperty:t,writeSymbol:(a,o)=>t(a),writeTrailingSemicolon:t,writeComment:t,getTextPos:()=>e.length,getLine:()=>0,getColumn:()=>0,getIndent:()=>0,isAtStartOfLine:()=>!1,hasTrailingComment:()=>!1,hasTrailingWhitespace:()=>!!e.length&&Ba(e.charCodeAt(e.length-1)),writeLine:()=>e+=" ",increaseIndent:Fa,decreaseIndent:Fa,clear:()=>e=""}}function i2(e,t){let a=e.entries();for(let[o,m]of a){let v=t(m,o);if(v)return v}}function a2(e){return e.end-e.pos}function m1(e){return _2(e),(e.flags&1048576)!==0}function _2(e){e.flags&2097152||(((e.flags&262144)!==0||Ht(e,m1))&&(e.flags|=1048576),e.flags|=2097152)}function hi(e){for(;e&&e.kind!==307;)e=e.parent;return e}function Hi(e){return e===void 0?!0:e.pos===e.end&&e.pos>=0&&e.kind!==1}function Rp(e){return!Hi(e)}function hl(e,t,a){if(Hi(e))return e.pos;if(d1(e)||e.kind===12)return Ar((t??hi(e)).text,e.pos,!1,!0);if(a&&Xi(e))return hl(e.jsDoc[0],t);if(e.kind===352){t??(t=hi(e));let o=Xp(ch(e,t));if(o)return hl(o,t,a)}return Ar((t??hi(e)).text,e.pos,!1,!1,f2(e))}function Ud(e,t,a=!1){return is(e.text,t,a)}function s2(e){return!!cf(e,ih)}function is(e,t,a=!1){if(Hi(t))return"";let o=e.substring(a?t.pos:Ar(e,t.pos),t.end);return s2(t)&&(o=o.split(/\r\n|\n|\r/).map(m=>m.replace(/^\s*\*/,"").trimStart()).join(` +`)),o}function za(e){let t=e.emitNode;return t&&t.flags||0}function o2(e,t,a){B.assertGreaterThanOrEqual(t,0),B.assertGreaterThanOrEqual(a,0),B.assertLessThanOrEqual(t,e.length),B.assertLessThanOrEqual(t+a,e.length)}function ol(e){return e.kind===244&&e.expression.kind===11}function hf(e){return!!(za(e)&2097152)}function Bd(e){return hf(e)&&jf(e)}function c2(e){return tt(e.name)&&!e.initializer}function qd(e){return hf(e)&&Ha(e)&&Gp(e.declarationList.declarations,c2)}function l2(e,t){let a=e.kind===169||e.kind===168||e.kind===218||e.kind===219||e.kind===217||e.kind===260||e.kind===281?Yp(sg(t,e.pos),Jp(t,e.pos)):Jp(t,e.pos);return Gr(a,o=>o.end<=e.end&&t.charCodeAt(o.pos+1)===42&&t.charCodeAt(o.pos+2)===42&&t.charCodeAt(o.pos+3)!==47)}function u2(e){if(e)switch(e.kind){case 208:case 306:case 169:case 303:case 172:case 171:case 304:case 260:return!0}return!1}function p2(e){return e&&e.kind===241&&mf(e.parent)}function zd(e){let t=e.kind;return(t===211||t===212)&&e.expression.kind===108}function ea(e){return!!e&&!!(e.flags&524288)}function f2(e){return!!e&&!!(e.flags&16777216)}function d2(e){for(;yl(e,!0);)e=e.right;return e}function m2(e){return tt(e)&&e.escapedText==="exports"}function h2(e){return tt(e)&&e.escapedText==="module"}function h1(e){return(Xr(e)||y1(e))&&h2(e.expression)&&ps(e)==="exports"}function yf(e){let t=g2(e);return t===5||ea(e)?t:0}function y2(e){return ts(e.arguments)===3&&Xr(e.expression)&&tt(e.expression.expression)&&Pn(e.expression.expression)==="Object"&&Pn(e.expression.name)==="defineProperty"&&kl(e.arguments[1])&&us(e.arguments[0],!0)}function y1(e){return Xa(e)&&kl(e.argumentExpression)}function gs(e,t){return Xr(e)&&(!t&&e.expression.kind===110||tt(e.name)&&us(e.expression,!0))||g1(e,t)}function g1(e,t){return y1(e)&&(!t&&e.expression.kind===110||xf(e.expression)||gs(e.expression,!0))}function us(e,t){return xf(e)||gs(e,t)}function g2(e){if(Of(e)){if(!y2(e))return 0;let t=e.arguments[0];return m2(t)||h1(t)?8:gs(t)&&ps(t)==="prototype"?9:7}return e.operatorToken.kind!==64||!w1(e.left)||b2(d2(e))?0:us(e.left.expression,!0)&&ps(e.left)==="prototype"&&If(T2(e))?6:v2(e.left)}function b2(e){return Qb(e)&&ta(e.expression)&&e.expression.text==="0"}function gf(e){if(Xr(e))return e.name;let t=vf(e.argumentExpression);return ta(t)||wl(t)?t:e}function ps(e){let t=gf(e);if(t){if(tt(t))return t.escapedText;if(wl(t)||ta(t))return Ja(t.text)}}function v2(e){if(e.expression.kind===110)return 4;if(h1(e))return 2;if(us(e.expression,!0)){if($2(e.expression))return 3;let t=e;for(;!tt(t.expression);)t=t.expression;let a=t.expression;if((a.escapedText==="exports"||a.escapedText==="module"&&ps(t)==="exports")&&gs(e))return 1;if(us(e,!0)||Xa(e)&&J2(e))return 5}return 0}function T2(e){for(;Zi(e.right);)e=e.right;return e.right}function x2(e){return Cl(e)&&Zi(e.expression)&&yf(e.expression)!==0&&Zi(e.expression.right)&&(e.expression.right.operatorToken.kind===57||e.expression.right.operatorToken.kind===61)?e.expression.right.right:void 0}function S2(e){switch(e.kind){case 243:let t=Up(e);return t&&t.initializer;case 172:return e.initializer;case 303:return e.initializer}}function Up(e){return Ha(e)?Xp(e.declarationList.declarations):void 0}function w2(e){return Ti(e)&&e.body&&e.body.kind===267?e.body:void 0}function bf(e){switch(e.kind){case 219:case 226:case 241:case 252:case 179:case 296:case 263:case 231:case 175:case 176:case 185:case 180:case 251:case 259:case 246:case 212:case 242:case 1:case 266:case 306:case 277:case 278:case 281:case 244:case 249:case 250:case 248:case 262:case 218:case 184:case 177:case 80:case 245:case 272:case 271:case 181:case 264:case 317:case 323:case 256:case 174:case 173:case 267:case 202:case 270:case 210:case 169:case 217:case 211:case 303:case 172:case 171:case 253:case 240:case 178:case 304:case 305:case 255:case 257:case 258:case 265:case 168:case 260:case 243:case 247:case 254:return!0;default:return!1}}function k2(e,t){let a;u2(e)&&t2(e)&&Xi(e.initializer)&&(a=Dn(a,Fd(e,e.initializer.jsDoc)));let o=e;for(;o&&o.parent;){if(Xi(o)&&(a=Dn(a,Fd(e,o.jsDoc))),o.kind===169){a=Dn(a,(t?bg:gg)(o));break}if(o.kind===168){a=Dn(a,(t?Tg:vg)(o));break}o=A2(o)}return a||bt}function Fd(e,t){let a=ly(t);return Am(t,o=>{if(o===a){let m=Gr(o.tags,v=>E2(e,v));return o.tags===m?[o]:m}else return Gr(o.tags,l6)})}function E2(e,t){return!(Ff(t)||d6(t))||!t.parent||!sh(t.parent)||!Al(t.parent.parent)||t.parent.parent===e}function A2(e){let t=e.parent;if(t.kind===303||t.kind===277||t.kind===172||t.kind===244&&e.kind===211||t.kind===253||w2(t)||yl(e))return t;if(t.parent&&(Up(t.parent)===e||yl(t)))return t.parent;if(t.parent&&t.parent.parent&&(Up(t.parent.parent)||S2(t.parent.parent)===e||x2(t.parent.parent)))return t.parent.parent}function vf(e,t){return Vf(e,t?-2147483647:1)}function C2(e){let t=D2(e);if(t&&ea(e)){let a=xg(e);if(a)return a.class}return t}function D2(e){let t=Tf(e.heritageClauses,96);return t&&t.types.length>0?t.types[0]:void 0}function P2(e){if(ea(e))return Sg(e).map(t=>t.class);{let t=Tf(e.heritageClauses,119);return t==null?void 0:t.types}}function N2(e){return vs(e)?I2(e)||bt:vi(e)&&Yp(Ip(C2(e)),P2(e))||bt}function I2(e){let t=Tf(e.heritageClauses,96);return t?t.types:void 0}function Tf(e,t){if(e){for(let a of e)if(a.token===t)return a}}function di(e){return 83<=e&&e<=165}function O2(e){return 19<=e&&e<=79}function xp(e){return di(e)||O2(e)}function kl(e){return wl(e)||ta(e)}function M2(e){return Y1(e)&&(e.operator===40||e.operator===41)&&ta(e.operand)}function J2(e){if(!(e.kind===167||e.kind===212))return!1;let t=Xa(e)?vf(e.argumentExpression):e.expression;return!kl(t)&&!M2(t)}function L2(e){return jp(e)?Pn(e):th(e)?kb(e):e.text}function La(e){return fs(e.pos)||fs(e.end)}function Sp(e){switch(e){case 61:return 4;case 57:return 5;case 56:return 6;case 52:return 7;case 53:return 8;case 51:return 9;case 35:case 36:case 37:case 38:return 10;case 30:case 32:case 33:case 34:case 104:case 103:case 130:case 152:return 11;case 48:case 49:case 50:return 12;case 40:case 41:return 13;case 42:case 44:case 45:return 14;case 43:return 15}return-1}function wp(e){return!!((e.templateFlags||0)&2048)}function j2(e){return e&&!!(P1(e)?wp(e):wp(e.head)||Xt(e.templateSpans,t=>wp(t.literal)))}var W4=new Map(Object.entries({" ":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","\x85":"\\u0085","\r\n":"\\r\\n"}));var G4=new Map(Object.entries({'"':""","'":"'"}));function R2(e){return!!e&&e.kind===80&&U2(e)}function U2(e){return e.escapedText==="this"}function bs(e,t){return!!z2(e,t)}function B2(e){return bs(e,256)}function q2(e){return bs(e,32768)}function z2(e,t){return V2(e)&t}function F2(e,t,a){return e.kind>=0&&e.kind<=165?0:(e.modifierFlagsCache&536870912||(e.modifierFlagsCache=T1(e)|536870912),a||t&&ea(e)?(!(e.modifierFlagsCache&268435456)&&e.parent&&(e.modifierFlagsCache|=b1(e)|268435456),v1(e.modifierFlagsCache)):W2(e.modifierFlagsCache))}function V2(e){return F2(e,!1)}function b1(e){let t=0;return e.parent&&!ds(e)&&(ea(e)&&(wg(e)&&(t|=8388608),kg(e)&&(t|=16777216),Eg(e)&&(t|=33554432),Ag(e)&&(t|=67108864),Cg(e)&&(t|=134217728)),Dg(e)&&(t|=65536)),t}function W2(e){return e&65535}function v1(e){return e&131071|(e&260046848)>>>23}function G2(e){return v1(b1(e))}function Y2(e){return T1(e)|G2(e)}function T1(e){let t=Nl(e)?Rn(e.modifiers):0;return(e.flags&8||e.kind===80&&e.flags&4096)&&(t|=32),t}function Rn(e){let t=0;if(e)for(let a of e)t|=x1(a.kind);return t}function x1(e){switch(e){case 126:return 256;case 125:return 1;case 124:return 4;case 123:return 2;case 128:return 64;case 129:return 512;case 95:return 32;case 138:return 128;case 87:return 4096;case 90:return 2048;case 134:return 1024;case 148:return 8;case 164:return 16;case 103:return 8192;case 147:return 16384;case 170:return 32768}return 0}function X2(e){return e===76||e===77||e===78}function S1(e){return e>=64&&e<=79}function yl(e,t){return Zi(e)&&(t?e.operatorToken.kind===64:S1(e.operatorToken.kind))&&qa(e.left)}function xf(e){return e.kind===80||H2(e)}function H2(e){return Xr(e)&&tt(e.name)&&xf(e.expression)}function $2(e){return gs(e)&&ps(e)==="prototype"}function kp(e){return e.flags&3899393?e.objectFlags:0}function Q2(e){let t;return Ht(e,a=>{Rp(a)&&(t=a)},a=>{for(let o=a.length-1;o>=0;o--)if(Rp(a[o])){t=a[o];break}}),t}function K2(e){return e>=182&&e<=205||e===133||e===159||e===150||e===163||e===151||e===136||e===154||e===155||e===116||e===157||e===146||e===141||e===233||e===312||e===313||e===314||e===315||e===316||e===317||e===318}function w1(e){return e.kind===211||e.kind===212}function Z2(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=0,this.mergeId=0,this.parent=void 0,this.members=void 0,this.exports=void 0,this.exportSymbol=void 0,this.constEnumOnlyModule=void 0,this.isReferenced=void 0,this.lastAssignmentPos=void 0,this.links=void 0}function eb(e,t){this.flags=t,(B.isDebugging||_l)&&(this.checker=e)}function tb(e,t){this.flags=t,B.isDebugging&&(this.checker=e)}function Ep(e,t,a){this.pos=t,this.end=a,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}function nb(e,t,a){this.pos=t,this.end=a,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.emitNode=void 0}function rb(e,t,a){this.pos=t,this.end=a,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}function ib(e,t,a){this.fileName=e,this.text=t,this.skipTrivia=a||(o=>o)}var At={getNodeConstructor:()=>Ep,getTokenConstructor:()=>nb,getIdentifierConstructor:()=>rb,getPrivateIdentifierConstructor:()=>Ep,getSourceFileConstructor:()=>Ep,getSymbolConstructor:()=>Z2,getTypeConstructor:()=>eb,getSignatureConstructor:()=>tb,getSourceMapSourceConstructor:()=>ib},ab=[];function _b(e){Object.assign(At,e),Un(ab,t=>t(At))}function sb(e,t){return e.replace(/\{(\d+)\}/g,(a,o)=>""+B.checkDefined(t[+o]))}var Vd;function ob(e){return Vd&&Vd[e.key]||e.message}function Oa(e,t,a,o,m,...v){a+o>t.length&&(o=t.length-a),o2(t,a,o);let A=ob(m);return Xt(v)&&(A=sb(A,v)),{file:void 0,start:a,length:o,messageText:A,category:m.category,code:m.code,reportsUnnecessary:m.reportsUnnecessary,fileName:e}}function cb(e){return e.file===void 0&&e.start!==void 0&&e.length!==void 0&&typeof e.fileName=="string"}function k1(e,t){let a=t.fileName||"",o=t.text.length;B.assertEqual(e.fileName,a),B.assertLessThanOrEqual(e.start,o),B.assertLessThanOrEqual(e.start+e.length,o);let m={file:t,start:e.start,length:e.length,messageText:e.messageText,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary};if(e.relatedInformation){m.relatedInformation=[];for(let v of e.relatedInformation)cb(v)&&v.fileName===a?(B.assertLessThanOrEqual(v.start,o),B.assertLessThanOrEqual(v.start+v.length,o),m.relatedInformation.push(k1(v,t))):m.relatedInformation.push(v)}return m}function zi(e,t){let a=[];for(let o of e)a.push(k1(o,t));return a}function Wd(e){return e===4||e===2||e===1||e===6?1:0}var at={allowImportingTsExtensions:{dependencies:["rewriteRelativeImportExtensions"],computeValue:e=>!!(e.allowImportingTsExtensions||e.rewriteRelativeImportExtensions)},target:{dependencies:["module"],computeValue:e=>(e.target===0?void 0:e.target)??(e.module===100&&9||e.module===199&&99||1)},module:{dependencies:["target"],computeValue:e=>typeof e.module=="number"?e.module:at.target.computeValue(e)>=2?5:1},moduleResolution:{dependencies:["module","target"],computeValue:e=>{let t=e.moduleResolution;if(t===void 0)switch(at.module.computeValue(e)){case 1:t=2;break;case 100:t=3;break;case 199:t=99;break;case 200:t=100;break;default:t=1;break}return t}},moduleDetection:{dependencies:["module","target"],computeValue:e=>e.moduleDetection||(at.module.computeValue(e)===100||at.module.computeValue(e)===199?3:2)},isolatedModules:{dependencies:["verbatimModuleSyntax"],computeValue:e=>!!(e.isolatedModules||e.verbatimModuleSyntax)},esModuleInterop:{dependencies:["module","target"],computeValue:e=>{if(e.esModuleInterop!==void 0)return e.esModuleInterop;switch(at.module.computeValue(e)){case 100:case 199:case 200:return!0}return!1}},allowSyntheticDefaultImports:{dependencies:["module","target","moduleResolution"],computeValue:e=>e.allowSyntheticDefaultImports!==void 0?e.allowSyntheticDefaultImports:at.esModuleInterop.computeValue(e)||at.module.computeValue(e)===4||at.moduleResolution.computeValue(e)===100},resolvePackageJsonExports:{dependencies:["moduleResolution"],computeValue:e=>{let t=at.moduleResolution.computeValue(e);if(!Gd(t))return!1;if(e.resolvePackageJsonExports!==void 0)return e.resolvePackageJsonExports;switch(t){case 3:case 99:case 100:return!0}return!1}},resolvePackageJsonImports:{dependencies:["moduleResolution","resolvePackageJsonExports"],computeValue:e=>{let t=at.moduleResolution.computeValue(e);if(!Gd(t))return!1;if(e.resolvePackageJsonExports!==void 0)return e.resolvePackageJsonExports;switch(t){case 3:case 99:case 100:return!0}return!1}},resolveJsonModule:{dependencies:["moduleResolution","module","target"],computeValue:e=>e.resolveJsonModule!==void 0?e.resolveJsonModule:at.moduleResolution.computeValue(e)===100},declaration:{dependencies:["composite"],computeValue:e=>!!(e.declaration||e.composite)},preserveConstEnums:{dependencies:["isolatedModules","verbatimModuleSyntax"],computeValue:e=>!!(e.preserveConstEnums||at.isolatedModules.computeValue(e))},incremental:{dependencies:["composite"],computeValue:e=>!!(e.incremental||e.composite)},declarationMap:{dependencies:["declaration","composite"],computeValue:e=>!!(e.declarationMap&&at.declaration.computeValue(e))},allowJs:{dependencies:["checkJs"],computeValue:e=>e.allowJs===void 0?!!e.checkJs:e.allowJs},useDefineForClassFields:{dependencies:["target","module"],computeValue:e=>e.useDefineForClassFields===void 0?at.target.computeValue(e)>=9:e.useDefineForClassFields},noImplicitAny:{dependencies:["strict"],computeValue:e=>Vr(e,"noImplicitAny")},noImplicitThis:{dependencies:["strict"],computeValue:e=>Vr(e,"noImplicitThis")},strictNullChecks:{dependencies:["strict"],computeValue:e=>Vr(e,"strictNullChecks")},strictFunctionTypes:{dependencies:["strict"],computeValue:e=>Vr(e,"strictFunctionTypes")},strictBindCallApply:{dependencies:["strict"],computeValue:e=>Vr(e,"strictBindCallApply")},strictPropertyInitialization:{dependencies:["strict"],computeValue:e=>Vr(e,"strictPropertyInitialization")},strictBuiltinIteratorReturn:{dependencies:["strict"],computeValue:e=>Vr(e,"strictBuiltinIteratorReturn")},alwaysStrict:{dependencies:["strict"],computeValue:e=>Vr(e,"alwaysStrict")},useUnknownInCatchVariables:{dependencies:["strict"],computeValue:e=>Vr(e,"useUnknownInCatchVariables")}};var Y4=at.allowImportingTsExtensions.computeValue,X4=at.target.computeValue,H4=at.module.computeValue,$4=at.moduleResolution.computeValue,Q4=at.moduleDetection.computeValue,K4=at.isolatedModules.computeValue,Z4=at.esModuleInterop.computeValue,e3=at.allowSyntheticDefaultImports.computeValue,t3=at.resolvePackageJsonExports.computeValue,n3=at.resolvePackageJsonImports.computeValue,r3=at.resolveJsonModule.computeValue,i3=at.declaration.computeValue,a3=at.preserveConstEnums.computeValue,_3=at.incremental.computeValue,s3=at.declarationMap.computeValue,o3=at.allowJs.computeValue,c3=at.useDefineForClassFields.computeValue;function Gd(e){return e>=3&&e<=99||e===100}function Vr(e,t){return e[t]===void 0?!!e.strict:!!e[t]}function lb(e){return i2(targetOptionDeclaration.type,(t,a)=>t===e?a:void 0)}var ub=["node_modules","bower_components","jspm_packages"],E1=`(?!(${ub.join("|")})(/|$))`,pb={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:`(/${E1}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>A1(e,pb.singleAsteriskRegexFragment)},fb={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:`(/${E1}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>A1(e,fb.singleAsteriskRegexFragment)};function A1(e,t){return e==="*"?t:e==="?"?"[^/]":"\\"+e}function db(e,t){return t||mb(e)||3}function mb(e){switch(e.substr(e.lastIndexOf(".")).toLowerCase()){case".js":case".cjs":case".mjs":return 1;case".jsx":return 2;case".ts":case".cts":case".mts":return 3;case".tsx":return 4;case".json":return 6;default:return 0}}var C1=[[".ts",".tsx",".d.ts"],[".cts",".d.cts"],[".mts",".d.mts"]],l3=Em(C1),u3=[...C1,[".json"]];var hb=[[".js",".jsx"],[".mjs"],[".cjs"]],p3=Em(hb),yb=[[".ts",".tsx",".d.ts",".js",".jsx"],[".cts",".d.cts",".cjs"],[".mts",".d.mts",".mjs"]],f3=[...yb,[".json"]],gb=[".d.ts",".d.cts",".d.mts"];function fs(e){return!(e>=0)}function nl(e,...t){return t.length&&(e.relatedInformation||(e.relatedInformation=[]),B.assert(e.relatedInformation!==bt,"Diagnostic had empty array singleton for related info, but is still being constructed!"),e.relatedInformation.push(...t)),e}function bb(e){let t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:let Q=e.length-1,h=0;for(;e.charCodeAt(h)===48;)h++;return e.slice(h,Q)||"0"}let a=2,o=e.length-1,m=(o-a)*t,v=new Uint16Array((m>>>4)+(m&15?1:0));for(let Q=o-1,h=0;Q>=a;Q--,h+=t){let y=h>>>4,g=e.charCodeAt(Q),I=(g<=57?g-48:10+g-(g<=70?65:97))<<(h&15);v[y]|=I;let re=I>>>16;re&&(v[y+1]|=re)}let A="",P=v.length-1,l=!0;for(;l;){let Q=0;l=!1;for(let h=P;h>=0;h--){let y=Q<<16|v[h],g=y/10|0;v[h]=g,Q=y-g*10,g&&!l&&(P=h,l=!0)}A=Q+A}return A}function vb({negative:e,base10Value:t}){return(e&&t!=="0"?"-":"")+t}function Bp(e,t){return e.pos=t,e}function Tb(e,t){return e.end=t,e}function yi(e,t,a){return Tb(Bp(e,t),a)}function Yd(e,t,a){return yi(e,t,t+a)}function Sf(e,t){return e&&t&&(e.parent=t),e}function xb(e,t){if(!e)return e;return vm(e,d1(e)?a:m),e;function a(v,A){if(t&&v.parent===A)return"skip";Sf(v,A)}function o(v){if(Xi(v))for(let A of v.jsDoc)a(A,v),vm(A,a)}function m(v,A){return a(v,A)||o(v)}}function Sb(e){return!!(e.flags&262144&&e.isThisType)}function wb(e){var t;return((t=getSnippetElement(e))==null?void 0:t.kind)===0}function kb(e){return`${Pn(e.namespace)}:${Pn(e.name)}`}var d3=String.prototype.replace;var qp=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","test/mock_loader","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"],m3=new Set(qp),Eb=new Set(["node:sea","node:sqlite","node:test","node:test/reporters"]),h3=new Set([...qp,...qp.map(e=>`node:${e}`),...Eb]);function Ab(){let e,t,a,o,m;return{createBaseSourceFileNode:v,createBaseIdentifierNode:A,createBasePrivateIdentifierNode:P,createBaseTokenNode:l,createBaseNode:Q};function v(h){return new(m||(m=At.getSourceFileConstructor()))(h,-1,-1)}function A(h){return new(a||(a=At.getIdentifierConstructor()))(h,-1,-1)}function P(h){return new(o||(o=At.getPrivateIdentifierConstructor()))(h,-1,-1)}function l(h){return new(t||(t=At.getTokenConstructor()))(h,-1,-1)}function Q(h){return new(e||(e=At.getNodeConstructor()))(h,-1,-1)}}var Cb={getParenthesizeLeftSideOfBinaryForOperator:e=>gt,getParenthesizeRightSideOfBinaryForOperator:e=>gt,parenthesizeLeftSideOfBinary:(e,t)=>t,parenthesizeRightSideOfBinary:(e,t,a)=>a,parenthesizeExpressionOfComputedPropertyName:gt,parenthesizeConditionOfConditionalExpression:gt,parenthesizeBranchOfConditionalExpression:gt,parenthesizeExpressionOfExportDefault:gt,parenthesizeExpressionOfNew:e=>kr(e,qa),parenthesizeLeftSideOfAccess:e=>kr(e,qa),parenthesizeOperandOfPostfixUnary:e=>kr(e,qa),parenthesizeOperandOfPrefixUnary:e=>kr(e,Yg),parenthesizeExpressionsOfCommaDelimitedList:e=>kr(e,mi),parenthesizeExpressionForDisallowedComma:gt,parenthesizeExpressionOfExpressionStatement:gt,parenthesizeConciseBodyOfArrowFunction:gt,parenthesizeCheckTypeOfConditionalType:gt,parenthesizeExtendsTypeOfConditionalType:gt,parenthesizeConstituentTypesOfUnionType:e=>kr(e,mi),parenthesizeConstituentTypeOfUnionType:gt,parenthesizeConstituentTypesOfIntersectionType:e=>kr(e,mi),parenthesizeConstituentTypeOfIntersectionType:gt,parenthesizeOperandOfTypeOperator:gt,parenthesizeOperandOfReadonlyTypeOperator:gt,parenthesizeNonArrayTypeOfPostfixType:gt,parenthesizeElementTypesOfTupleType:e=>kr(e,mi),parenthesizeElementTypeOfTupleType:gt,parenthesizeTypeOfOptionalType:gt,parenthesizeTypeArguments:e=>e&&kr(e,mi),parenthesizeLeadingTypeArgument:gt},rl=0;var Db=[];function wf(e,t){let a=e&8?gt:Mb,o=wd(()=>e&1?Cb:createParenthesizerRules(ye)),m=wd(()=>e&2?nullNodeConverters:createNodeConverters(ye)),v=Kn(n=>(i,_)=>ua(i,n,_)),A=Kn(n=>i=>jr(n,i)),P=Kn(n=>i=>ni(i,n)),l=Kn(n=>()=>Ho(n)),Q=Kn(n=>i=>C_(n,i)),h=Kn(n=>(i,_)=>xu(n,i,_)),y=Kn(n=>(i,_)=>$o(n,i,_)),g=Kn(n=>(i,_)=>Tu(n,i,_)),x=Kn(n=>(i,_)=>dc(n,i,_)),I=Kn(n=>(i,_,c)=>Ou(n,i,_,c)),re=Kn(n=>(i,_,c)=>mc(n,i,_,c)),he=Kn(n=>(i,_,c,f)=>Mu(n,i,_,c,f)),ye={get parenthesizer(){return o()},get converters(){return m()},baseFactory:t,flags:e,createNodeArray:de,createNumericLiteral:V,createBigIntLiteral:oe,createStringLiteral:dt,createStringLiteralFromNode:nr,createRegularExpressionLiteral:gn,createLiteralLikeNode:rr,createIdentifier:Ge,createTempVariable:ir,createLoopVariable:Pr,createUniqueName:Ot,getGeneratedNameForNode:Bn,createPrivateIdentifier:Mt,createUniquePrivateName:Qe,getGeneratedPrivateNameForNode:qn,createToken:ct,createSuper:_t,createThis:Ut,createNull:Jt,createTrue:lt,createFalse:ar,createModifier:mt,createModifiersFromModifierFlags:vn,createQualifiedName:yt,updateQualifiedName:cn,createComputedPropertyName:nt,updateComputedPropertyName:Bt,createTypeParameterDeclaration:rn,updateTypeParameterDeclaration:_r,createParameterDeclaration:fr,updateParameterDeclaration:dr,createDecorator:zn,updateDecorator:Fn,createPropertySignature:Nr,updatePropertySignature:Vn,createPropertyDeclaration:mr,updatePropertyDeclaration:L,createMethodSignature:se,updateMethodSignature:fe,createMethodDeclaration:Te,updateMethodDeclaration:He,createConstructorDeclaration:ut,updateConstructorDeclaration:Ir,createGetAccessorDeclaration:Mn,updateGetAccessorDeclaration:Wn,createSetAccessorDeclaration:R,updateSetAccessorDeclaration:$,createCallSignature:xe,updateCallSignature:Se,createConstructSignature:we,updateConstructSignature:be,createIndexSignature:We,updateIndexSignature:Ze,createClassStaticBlockDeclaration:st,updateClassStaticBlockDeclaration:Dt,createTemplateLiteralTypeSpan:Ye,updateTemplateLiteralTypeSpan:Ee,createKeywordTypeNode:Tn,createTypePredicateNode:rt,updateTypePredicateNode:ln,createTypeReferenceNode:Zr,updateTypeReferenceNode:J,createFunctionTypeNode:qe,updateFunctionTypeNode:u,createConstructorTypeNode:Me,updateConstructorTypeNode:an,createTypeQueryNode:Pt,updateTypeQueryNode:kt,createTypeLiteralNode:Nt,updateTypeLiteralNode:qt,createArrayTypeNode:Gn,updateArrayTypeNode:wi,createTupleTypeNode:un,updateTupleTypeNode:G,createNamedTupleMember:le,updateNamedTupleMember:Fe,createOptionalTypeNode:ve,updateOptionalTypeNode:j,createRestTypeNode:ht,updateRestTypeNode:xt,createUnionTypeNode:Ul,updateUnionTypeNode:Es,createIntersectionTypeNode:Or,updateIntersectionTypeNode:Je,createConditionalTypeNode:ft,updateConditionalTypeNode:Bl,createInferTypeNode:Yn,updateInferTypeNode:ql,createImportTypeNode:sr,updateImportTypeNode:aa,createParenthesizedType:Qt,updateParenthesizedType:Ct,createThisTypeNode:D,createTypeOperatorNode:Gt,updateTypeOperatorNode:Mr,createIndexedAccessTypeNode:or,updateIndexedAccessTypeNode:Ka,createMappedTypeNode:St,updateMappedTypeNode:jt,createLiteralTypeNode:ei,updateLiteralTypeNode:yr,createTemplateLiteralType:Wt,updateTemplateLiteralType:zl,createObjectBindingPattern:As,updateObjectBindingPattern:Fl,createArrayBindingPattern:Jr,updateArrayBindingPattern:Vl,createBindingElement:_a,updateBindingElement:ti,createArrayLiteralExpression:Za,updateArrayLiteralExpression:Cs,createObjectLiteralExpression:ki,updateObjectLiteralExpression:Wl,createPropertyAccessExpression:e&4?(n,i)=>setEmitFlags(cr(n,i),262144):cr,updatePropertyAccessExpression:Gl,createPropertyAccessChain:e&4?(n,i,_)=>setEmitFlags(Ei(n,i,_),262144):Ei,updatePropertyAccessChain:sa,createElementAccessExpression:Ai,updateElementAccessExpression:Yl,createElementAccessChain:Ns,updateElementAccessChain:e_,createCallExpression:Ci,updateCallExpression:oa,createCallChain:t_,updateCallChain:Os,createNewExpression:xn,updateNewExpression:n_,createTaggedTemplateExpression:ca,updateTaggedTemplateExpression:Ms,createTypeAssertion:Js,updateTypeAssertion:Ls,createParenthesizedExpression:r_,updateParenthesizedExpression:js,createFunctionExpression:i_,updateFunctionExpression:Rs,createArrowFunction:a_,updateArrowFunction:Us,createDeleteExpression:Bs,updateDeleteExpression:qs,createTypeOfExpression:la,updateTypeOfExpression:fn,createVoidExpression:__,updateVoidExpression:lr,createAwaitExpression:zs,updateAwaitExpression:Lr,createPrefixUnaryExpression:jr,updatePrefixUnaryExpression:Xl,createPostfixUnaryExpression:ni,updatePostfixUnaryExpression:Hl,createBinaryExpression:ua,updateBinaryExpression:$l,createConditionalExpression:Vs,updateConditionalExpression:Ws,createTemplateExpression:Gs,updateTemplateExpression:Xn,createTemplateHead:Xs,createTemplateMiddle:pa,createTemplateTail:s_,createNoSubstitutionTemplateLiteral:Kl,createTemplateLiteralLikeNode:ii,createYieldExpression:o_,updateYieldExpression:Zl,createSpreadElement:Hs,updateSpreadElement:eu,createClassExpression:$s,updateClassExpression:c_,createOmittedExpression:l_,createExpressionWithTypeArguments:Qs,updateExpressionWithTypeArguments:Ks,createAsExpression:dn,updateAsExpression:fa,createNonNullExpression:Zs,updateNonNullExpression:eo,createSatisfiesExpression:u_,updateSatisfiesExpression:to,createNonNullChain:p_,updateNonNullChain:Jn,createMetaProperty:no,updateMetaProperty:f_,createTemplateSpan:Hn,updateTemplateSpan:da,createSemicolonClassElement:ro,createBlock:Rr,updateBlock:tu,createVariableStatement:d_,updateVariableStatement:io,createEmptyStatement:ao,createExpressionStatement:Pi,updateExpressionStatement:_o,createIfStatement:so,updateIfStatement:oo,createDoStatement:co,updateDoStatement:lo,createWhileStatement:uo,updateWhileStatement:nu,createForStatement:po,updateForStatement:fo,createForInStatement:m_,updateForInStatement:ru,createForOfStatement:mo,updateForOfStatement:iu,createContinueStatement:ho,updateContinueStatement:au,createBreakStatement:h_,updateBreakStatement:yo,createReturnStatement:y_,updateReturnStatement:_u,createWithStatement:g_,updateWithStatement:go,createSwitchStatement:b_,updateSwitchStatement:ai,createLabeledStatement:bo,updateLabeledStatement:vo,createThrowStatement:To,updateThrowStatement:su,createTryStatement:xo,updateTryStatement:ou,createDebuggerStatement:So,createVariableDeclaration:ma,updateVariableDeclaration:wo,createVariableDeclarationList:v_,updateVariableDeclarationList:cu,createFunctionDeclaration:ko,updateFunctionDeclaration:T_,createClassDeclaration:Eo,updateClassDeclaration:ha,createInterfaceDeclaration:Ao,updateInterfaceDeclaration:Co,createTypeAliasDeclaration:ot,updateTypeAliasDeclaration:gr,createEnumDeclaration:x_,updateEnumDeclaration:br,createModuleDeclaration:Do,updateModuleDeclaration:Et,createModuleBlock:vr,updateModuleBlock:zt,createCaseBlock:Po,updateCaseBlock:uu,createNamespaceExportDeclaration:No,updateNamespaceExportDeclaration:Io,createImportEqualsDeclaration:Oo,updateImportEqualsDeclaration:Mo,createImportDeclaration:Jo,updateImportDeclaration:Lo,createImportClause:jo,updateImportClause:Ro,createAssertClause:S_,updateAssertClause:fu,createAssertEntry:Ni,updateAssertEntry:Uo,createImportTypeAssertionContainer:w_,updateImportTypeAssertionContainer:Bo,createImportAttributes:qo,updateImportAttributes:k_,createImportAttribute:zo,updateImportAttribute:Fo,createNamespaceImport:Vo,updateNamespaceImport:du,createNamespaceExport:Wo,updateNamespaceExport:mu,createNamedImports:Go,updateNamedImports:Yo,createImportSpecifier:Tr,updateImportSpecifier:hu,createExportAssignment:ya,updateExportAssignment:Ii,createExportDeclaration:ga,updateExportDeclaration:Xo,createNamedExports:E_,updateNamedExports:yu,createExportSpecifier:ba,updateExportSpecifier:gu,createMissingDeclaration:bu,createExternalModuleReference:A_,updateExternalModuleReference:vu,get createJSDocAllType(){return l(312)},get createJSDocUnknownType(){return l(313)},get createJSDocNonNullableType(){return y(315)},get updateJSDocNonNullableType(){return g(315)},get createJSDocNullableType(){return y(314)},get updateJSDocNullableType(){return g(314)},get createJSDocOptionalType(){return Q(316)},get updateJSDocOptionalType(){return h(316)},get createJSDocVariadicType(){return Q(318)},get updateJSDocVariadicType(){return h(318)},get createJSDocNamepathType(){return Q(319)},get updateJSDocNamepathType(){return h(319)},createJSDocFunctionType:Qo,updateJSDocFunctionType:Su,createJSDocTypeLiteral:Ko,updateJSDocTypeLiteral:wu,createJSDocTypeExpression:Zo,updateJSDocTypeExpression:D_,createJSDocSignature:ec,updateJSDocSignature:ku,createJSDocTemplateTag:P_,updateJSDocTemplateTag:tc,createJSDocTypedefTag:va,updateJSDocTypedefTag:Eu,createJSDocParameterTag:N_,updateJSDocParameterTag:Au,createJSDocPropertyTag:nc,updateJSDocPropertyTag:rc,createJSDocCallbackTag:ic,updateJSDocCallbackTag:ac,createJSDocOverloadTag:_c,updateJSDocOverloadTag:I_,createJSDocAugmentsTag:O_,updateJSDocAugmentsTag:Mi,createJSDocImplementsTag:sc,updateJSDocImplementsTag:Iu,createJSDocSeeTag:Br,updateJSDocSeeTag:Ta,createJSDocImportTag:gc,updateJSDocImportTag:bc,createJSDocNameReference:oc,updateJSDocNameReference:Cu,createJSDocMemberName:cc,updateJSDocMemberName:Du,createJSDocLink:lc,updateJSDocLink:uc,createJSDocLinkCode:pc,updateJSDocLinkCode:Pu,createJSDocLinkPlain:fc,updateJSDocLinkPlain:Nu,get createJSDocTypeTag(){return re(344)},get updateJSDocTypeTag(){return he(344)},get createJSDocReturnTag(){return re(342)},get updateJSDocReturnTag(){return he(342)},get createJSDocThisTag(){return re(343)},get updateJSDocThisTag(){return he(343)},get createJSDocAuthorTag(){return x(330)},get updateJSDocAuthorTag(){return I(330)},get createJSDocClassTag(){return x(332)},get updateJSDocClassTag(){return I(332)},get createJSDocPublicTag(){return x(333)},get updateJSDocPublicTag(){return I(333)},get createJSDocPrivateTag(){return x(334)},get updateJSDocPrivateTag(){return I(334)},get createJSDocProtectedTag(){return x(335)},get updateJSDocProtectedTag(){return I(335)},get createJSDocReadonlyTag(){return x(336)},get updateJSDocReadonlyTag(){return I(336)},get createJSDocOverrideTag(){return x(337)},get updateJSDocOverrideTag(){return I(337)},get createJSDocDeprecatedTag(){return x(331)},get updateJSDocDeprecatedTag(){return I(331)},get createJSDocThrowsTag(){return re(349)},get updateJSDocThrowsTag(){return he(349)},get createJSDocSatisfiesTag(){return re(350)},get updateJSDocSatisfiesTag(){return he(350)},createJSDocEnumTag:yc,updateJSDocEnumTag:M_,createJSDocUnknownTag:hc,updateJSDocUnknownTag:Ju,createJSDocText:J_,updateJSDocText:Lu,createJSDocComment:Ji,updateJSDocComment:vc,createJsxElement:Tc,updateJsxElement:ju,createJsxSelfClosingElement:xc,updateJsxSelfClosingElement:L_,createJsxOpeningElement:j_,updateJsxOpeningElement:Sc,createJsxClosingElement:xa,updateJsxClosingElement:Kt,createJsxFragment:R_,createJsxText:Sa,updateJsxText:kc,createJsxOpeningFragment:Ru,createJsxJsxClosingFragment:Uu,updateJsxFragment:wc,createJsxAttribute:Ec,updateJsxAttribute:wa,createJsxAttributes:Ac,updateJsxAttributes:Bu,createJsxSpreadAttribute:Cc,updateJsxSpreadAttribute:qu,createJsxExpression:ka,updateJsxExpression:Li,createJsxNamespacedName:Dc,updateJsxNamespacedName:U_,createCaseClause:B_,updateCaseClause:zu,createDefaultClause:_i,updateDefaultClause:Pc,createHeritageClause:Nc,updateHeritageClause:Fu,createCatchClause:q_,updateCatchClause:Ic,createPropertyAssignment:Ea,updatePropertyAssignment:qr,createShorthandPropertyAssignment:Oc,updateShorthandPropertyAssignment:Wu,createSpreadAssignment:z_,updateSpreadAssignment:Mc,createEnumMember:wn,updateEnumMember:Jc,createSourceFile:Yu,updateSourceFile:$u,createRedirectedSourceFile:Lc,createBundle:F_,updateBundle:Qu,createSyntheticExpression:Ku,createSyntaxList:Ca,createNotEmittedStatement:Rc,createNotEmittedTypeElement:Zu,createPartiallyEmittedExpression:Uc,updatePartiallyEmittedExpression:Bc,createCommaListExpression:V_,updateCommaListExpression:qc,createSyntheticReferenceExpression:W_,updateSyntheticReferenceExpression:zc,cloneNode:G_,get createComma(){return v(28)},get createAssignment(){return v(64)},get createLogicalOr(){return v(57)},get createLogicalAnd(){return v(56)},get createBitwiseOr(){return v(52)},get createBitwiseXor(){return v(53)},get createBitwiseAnd(){return v(51)},get createStrictEquality(){return v(37)},get createStrictInequality(){return v(38)},get createEquality(){return v(35)},get createInequality(){return v(36)},get createLessThan(){return v(30)},get createLessThanEquals(){return v(33)},get createGreaterThan(){return v(32)},get createGreaterThanEquals(){return v(34)},get createLeftShift(){return v(48)},get createRightShift(){return v(49)},get createUnsignedRightShift(){return v(50)},get createAdd(){return v(40)},get createSubtract(){return v(41)},get createMultiply(){return v(42)},get createDivide(){return v(44)},get createModulo(){return v(45)},get createExponent(){return v(43)},get createPrefixPlus(){return A(40)},get createPrefixMinus(){return A(41)},get createPrefixIncrement(){return A(46)},get createPrefixDecrement(){return A(47)},get createBitwiseNot(){return A(55)},get createLogicalNot(){return A(54)},get createPostfixIncrement(){return P(46)},get createPostfixDecrement(){return P(47)},createImmediatelyInvokedFunctionExpression:rp,createImmediatelyInvokedArrowFunction:ip,createVoidZero:si,createExportDefault:Wc,createExternalModuleExport:ap,createTypeCheck:Y_,createIsNotTypeCheck:_p,createMethodCall:zr,createGlobalMethodCall:ji,createFunctionBindCall:sp,createFunctionCallCall:op,createFunctionApplyCall:cp,createArraySliceCall:Ri,createArrayConcatCall:lp,createObjectDefinePropertyCall:X_,createObjectGetOwnPropertyDescriptorCall:oi,createReflectGetCall:Gc,createReflectSetCall:up,createPropertyDescriptor:Yc,createCallBinding:Hc,createAssignmentTargetWrapper:s,inlineExpressions:p,getInternalName:b,getLocalName:S,getExportName:N,getDeclarationName:H,getNamespaceMemberName:_e,getExternalModuleOrNamespaceExportName:Z,restoreOuterExpressions:Xc,restoreEnclosingLabel:H_,createUseStrictPrologue:Le,copyPrologue:ee,copyStandardPrologue:je,copyCustomPrologue:Ae,ensureUseStrict:Yt,liftToBlock:mn,mergeLexicalEnvironment:ur,replaceModifiers:Ln,replaceDecoratorsAndModifiers:Fr,replacePropertyName:dp};return Un(Db,n=>n(ye)),ye;function de(n,i){if(n===void 0||n===bt)n=[];else if(mi(n)){if(i===void 0||n.hasTrailingComma===i)return n.transformFlags===void 0&&Hd(n),B.attachNodeArrayDebugInfo(n),n;let f=n.slice();return f.pos=n.pos,f.end=n.end,f.hasTrailingComma=i,f.transformFlags=n.transformFlags,B.attachNodeArrayDebugInfo(f),f}let _=n.length,c=_>=1&&_<=4?n.slice():n;return c.pos=-1,c.end=-1,c.hasTrailingComma=!!i,c.transformFlags=0,Hd(c),B.attachNodeArrayDebugInfo(c),c}function M(n){return t.createBaseNode(n)}function ae(n){let i=M(n);return i.symbol=void 0,i.localSymbol=void 0,i}function Oe(n,i){return n!==i&&(n.typeArguments=i.typeArguments),q(n,i)}function V(n,i=0){let _=typeof n=="number"?n+"":n;B.assert(_.charCodeAt(0)!==45,"Negative numbers should be created in combination with createPrefixUnaryExpression");let c=ae(9);return c.text=_,c.numericLiteralFlags=i,i&384&&(c.transformFlags|=1024),c}function oe(n){let i=$t(10);return i.text=typeof n=="string"?n:vb(n)+"n",i.transformFlags|=32,i}function W(n,i){let _=ae(11);return _.text=n,_.singleQuote=i,_}function dt(n,i,_){let c=W(n,i);return c.hasExtendedUnicodeEscape=_,_&&(c.transformFlags|=1024),c}function nr(n){let i=W(L2(n),void 0);return i.textSourceNode=n,i}function gn(n){let i=$t(14);return i.text=n,i}function rr(n,i){switch(n){case 9:return V(i,0);case 10:return oe(i);case 11:return dt(i,void 0);case 12:return Sa(i,!1);case 13:return Sa(i,!0);case 14:return gn(i);case 15:return ii(n,i,void 0,0)}}function bn(n){let i=t.createBaseIdentifierNode(80);return i.escapedText=n,i.jsDoc=void 0,i.flowNode=void 0,i.symbol=void 0,i}function In(n,i,_,c){let f=bn(Ja(n));return setIdentifierAutoGenerate(f,{flags:i,id:rl,prefix:_,suffix:c}),rl++,f}function Ge(n,i,_){i===void 0&&n&&(i=Fm(n)),i===80&&(i=void 0);let c=bn(Ja(n));return _&&(c.flags|=256),c.escapedText==="await"&&(c.transformFlags|=67108864),c.flags&256&&(c.transformFlags|=1024),c}function ir(n,i,_,c){let f=1;i&&(f|=8);let w=In("",f,_,c);return n&&n(w),w}function Pr(n){let i=2;return n&&(i|=8),In("",i,void 0,void 0)}function Ot(n,i=0,_,c){return B.assert(!(i&7),"Argument out of range: flags"),B.assert((i&48)!==32,"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),In(n,3|i,_,c)}function Bn(n,i=0,_,c){B.assert(!(i&7),"Argument out of range: flags");let f=n?jp(n)?Vp(!1,_,n,c,Pn):`generated@${getNodeId(n)}`:"";(_||c)&&(i|=16);let w=In(f,4|i,_,c);return w.original=n,w}function On(n){let i=t.createBasePrivateIdentifierNode(81);return i.escapedText=n,i.transformFlags|=16777216,i}function Mt(n){return ul(n,"#")||B.fail("First character of private identifier must be #: "+n),On(Ja(n))}function vt(n,i,_,c){let f=On(Ja(n));return setIdentifierAutoGenerate(f,{flags:i,id:rl,prefix:_,suffix:c}),rl++,f}function Qe(n,i,_){n&&!ul(n,"#")&&B.fail("First character of private identifier must be #: "+n);let c=8|(n?3:1);return vt(n??"",c,i,_)}function qn(n,i,_){let c=jp(n)?Vp(!0,i,n,_,Pn):`#generated@${getNodeId(n)}`,w=vt(c,4|(i||_?16:0),i,_);return w.original=n,w}function $t(n){return t.createBaseTokenNode(n)}function ct(n){B.assert(n>=0&&n<=165,"Invalid token"),B.assert(n<=15||n>=18,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),B.assert(n<=9||n>=15,"Invalid token. Use 'createLiteralLikeNode' to create literals."),B.assert(n!==80,"Invalid token. Use 'createIdentifier' to create identifiers");let i=$t(n),_=0;switch(n){case 134:_=384;break;case 160:_=4;break;case 125:case 123:case 124:case 148:case 128:case 138:case 87:case 133:case 150:case 163:case 146:case 151:case 103:case 147:case 164:case 154:case 136:case 155:case 116:case 159:case 157:_=1;break;case 108:_=134218752,i.flowNode=void 0;break;case 126:_=1024;break;case 129:_=16777216;break;case 110:_=16384,i.flowNode=void 0;break}return _&&(i.transformFlags|=_),i}function _t(){return ct(108)}function Ut(){return ct(110)}function Jt(){return ct(106)}function lt(){return ct(112)}function ar(){return ct(97)}function mt(n){return ct(n)}function vn(n){let i=[];return n&32&&i.push(mt(95)),n&128&&i.push(mt(138)),n&2048&&i.push(mt(90)),n&4096&&i.push(mt(87)),n&1&&i.push(mt(125)),n&2&&i.push(mt(123)),n&4&&i.push(mt(124)),n&64&&i.push(mt(128)),n&256&&i.push(mt(126)),n&16&&i.push(mt(164)),n&8&&i.push(mt(148)),n&512&&i.push(mt(129)),n&1024&&i.push(mt(134)),n&8192&&i.push(mt(103)),n&16384&&i.push(mt(147)),i.length?i:void 0}function yt(n,i){let _=M(166);return _.left=n,_.right=et(i),_.transformFlags|=z(_.left)|ja(_.right),_.flowNode=void 0,_}function cn(n,i,_){return n.left!==i||n.right!==_?q(yt(i,_),n):n}function nt(n){let i=M(167);return i.expression=o().parenthesizeExpressionOfComputedPropertyName(n),i.transformFlags|=z(i.expression)|1024|131072,i}function Bt(n,i){return n.expression!==i?q(nt(i),n):n}function rn(n,i,_,c){let f=ae(168);return f.modifiers=De(n),f.name=et(i),f.constraint=_,f.default=c,f.transformFlags=1,f.expression=void 0,f.jsDoc=void 0,f}function _r(n,i,_,c,f){return n.modifiers!==i||n.name!==_||n.constraint!==c||n.default!==f?q(rn(i,_,c,f),n):n}function fr(n,i,_,c,f,w){let F=ae(169);return F.modifiers=De(n),F.dotDotDotToken=i,F.name=et(_),F.questionToken=c,F.type=f,F.initializer=Da(w),R2(F.name)?F.transformFlags=1:F.transformFlags=ke(F.modifiers)|z(F.dotDotDotToken)|jn(F.name)|z(F.questionToken)|z(F.initializer)|(F.questionToken??F.type?1:0)|(F.dotDotDotToken??F.initializer?1024:0)|(Rn(F.modifiers)&31?8192:0),F.jsDoc=void 0,F}function dr(n,i,_,c,f,w,F){return n.modifiers!==i||n.dotDotDotToken!==_||n.name!==c||n.questionToken!==f||n.type!==w||n.initializer!==F?q(fr(i,_,c,f,w,F),n):n}function zn(n){let i=M(170);return i.expression=o().parenthesizeLeftSideOfAccess(n,!1),i.transformFlags|=z(i.expression)|1|8192|33554432,i}function Fn(n,i){return n.expression!==i?q(zn(i),n):n}function Nr(n,i,_,c){let f=ae(171);return f.modifiers=De(n),f.name=et(i),f.type=c,f.questionToken=_,f.transformFlags=1,f.initializer=void 0,f.jsDoc=void 0,f}function Vn(n,i,_,c,f){return n.modifiers!==i||n.name!==_||n.questionToken!==c||n.type!==f?Ce(Nr(i,_,c,f),n):n}function Ce(n,i){return n!==i&&(n.initializer=i.initializer),q(n,i)}function mr(n,i,_,c,f){let w=ae(172);w.modifiers=De(n),w.name=et(i),w.questionToken=_&&Qd(_)?_:void 0,w.exclamationToken=_&&$d(_)?_:void 0,w.type=c,w.initializer=Da(f);let F=w.flags&33554432||Rn(w.modifiers)&128;return w.transformFlags=ke(w.modifiers)|jn(w.name)|z(w.initializer)|(F||w.questionToken||w.exclamationToken||w.type?1:0)|(kf(w.name)||Rn(w.modifiers)&256&&w.initializer?8192:0)|16777216,w.jsDoc=void 0,w}function L(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.questionToken!==(c!==void 0&&Qd(c)?c:void 0)||n.exclamationToken!==(c!==void 0&&$d(c)?c:void 0)||n.type!==f||n.initializer!==w?q(mr(i,_,c,f,w),n):n}function se(n,i,_,c,f,w){let F=ae(173);return F.modifiers=De(n),F.name=et(i),F.questionToken=_,F.typeParameters=De(c),F.parameters=De(f),F.type=w,F.transformFlags=1,F.jsDoc=void 0,F.locals=void 0,F.nextContainer=void 0,F.typeArguments=void 0,F}function fe(n,i,_,c,f,w,F){return n.modifiers!==i||n.name!==_||n.questionToken!==c||n.typeParameters!==f||n.parameters!==w||n.type!==F?Oe(se(i,_,c,f,w,F),n):n}function Te(n,i,_,c,f,w,F,pe){let Re=ae(174);if(Re.modifiers=De(n),Re.asteriskToken=i,Re.name=et(_),Re.questionToken=c,Re.exclamationToken=void 0,Re.typeParameters=De(f),Re.parameters=de(w),Re.type=F,Re.body=pe,!Re.body)Re.transformFlags=1;else{let en=Rn(Re.modifiers)&1024,kn=!!Re.asteriskToken,$n=en&&kn;Re.transformFlags=ke(Re.modifiers)|z(Re.asteriskToken)|jn(Re.name)|z(Re.questionToken)|ke(Re.typeParameters)|ke(Re.parameters)|z(Re.type)|z(Re.body)&-67108865|($n?128:en?256:kn?2048:0)|(Re.questionToken||Re.typeParameters||Re.type?1:0)|1024}return Re.typeArguments=void 0,Re.jsDoc=void 0,Re.locals=void 0,Re.nextContainer=void 0,Re.flowNode=void 0,Re.endFlowNode=void 0,Re.returnFlowNode=void 0,Re}function He(n,i,_,c,f,w,F,pe,Re){return n.modifiers!==i||n.asteriskToken!==_||n.name!==c||n.questionToken!==f||n.typeParameters!==w||n.parameters!==F||n.type!==pe||n.body!==Re?Ke(Te(i,_,c,f,w,F,pe,Re),n):n}function Ke(n,i){return n!==i&&(n.exclamationToken=i.exclamationToken),q(n,i)}function st(n){let i=ae(175);return i.body=n,i.transformFlags=z(n)|16777216,i.modifiers=void 0,i.jsDoc=void 0,i.locals=void 0,i.nextContainer=void 0,i.endFlowNode=void 0,i.returnFlowNode=void 0,i}function Dt(n,i){return n.body!==i?Tt(st(i),n):n}function Tt(n,i){return n!==i&&(n.modifiers=i.modifiers),q(n,i)}function ut(n,i,_){let c=ae(176);return c.modifiers=De(n),c.parameters=de(i),c.body=_,c.body?c.transformFlags=ke(c.modifiers)|ke(c.parameters)|z(c.body)&-67108865|1024:c.transformFlags=1,c.typeParameters=void 0,c.type=void 0,c.typeArguments=void 0,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.endFlowNode=void 0,c.returnFlowNode=void 0,c}function Ir(n,i,_,c){return n.modifiers!==i||n.parameters!==_||n.body!==c?hr(ut(i,_,c),n):n}function hr(n,i){return n!==i&&(n.typeParameters=i.typeParameters,n.type=i.type),Oe(n,i)}function Mn(n,i,_,c,f){let w=ae(177);return w.modifiers=De(n),w.name=et(i),w.parameters=de(_),w.type=c,w.body=f,w.body?w.transformFlags=ke(w.modifiers)|jn(w.name)|ke(w.parameters)|z(w.type)|z(w.body)&-67108865|(w.type?1:0):w.transformFlags=1,w.typeArguments=void 0,w.typeParameters=void 0,w.jsDoc=void 0,w.locals=void 0,w.nextContainer=void 0,w.flowNode=void 0,w.endFlowNode=void 0,w.returnFlowNode=void 0,w}function Wn(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.parameters!==c||n.type!==f||n.body!==w?Si(Mn(i,_,c,f,w),n):n}function Si(n,i){return n!==i&&(n.typeParameters=i.typeParameters),Oe(n,i)}function R(n,i,_,c){let f=ae(178);return f.modifiers=De(n),f.name=et(i),f.parameters=de(_),f.body=c,f.body?f.transformFlags=ke(f.modifiers)|jn(f.name)|ke(f.parameters)|z(f.body)&-67108865|(f.type?1:0):f.transformFlags=1,f.typeArguments=void 0,f.typeParameters=void 0,f.type=void 0,f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f.flowNode=void 0,f.endFlowNode=void 0,f.returnFlowNode=void 0,f}function $(n,i,_,c,f){return n.modifiers!==i||n.name!==_||n.parameters!==c||n.body!==f?K(R(i,_,c,f),n):n}function K(n,i){return n!==i&&(n.typeParameters=i.typeParameters,n.type=i.type),Oe(n,i)}function xe(n,i,_){let c=ae(179);return c.typeParameters=De(n),c.parameters=De(i),c.type=_,c.transformFlags=1,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.typeArguments=void 0,c}function Se(n,i,_,c){return n.typeParameters!==i||n.parameters!==_||n.type!==c?Oe(xe(i,_,c),n):n}function we(n,i,_){let c=ae(180);return c.typeParameters=De(n),c.parameters=De(i),c.type=_,c.transformFlags=1,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.typeArguments=void 0,c}function be(n,i,_,c){return n.typeParameters!==i||n.parameters!==_||n.type!==c?Oe(we(i,_,c),n):n}function We(n,i,_){let c=ae(181);return c.modifiers=De(n),c.parameters=De(i),c.type=_,c.transformFlags=1,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.typeArguments=void 0,c}function Ze(n,i,_,c){return n.parameters!==_||n.type!==c||n.modifiers!==i?Oe(We(i,_,c),n):n}function Ye(n,i){let _=M(204);return _.type=n,_.literal=i,_.transformFlags=1,_}function Ee(n,i,_){return n.type!==i||n.literal!==_?q(Ye(i,_),n):n}function Tn(n){return ct(n)}function rt(n,i,_){let c=M(182);return c.assertsModifier=n,c.parameterName=et(i),c.type=_,c.transformFlags=1,c}function ln(n,i,_,c){return n.assertsModifier!==i||n.parameterName!==_||n.type!==c?q(rt(i,_,c),n):n}function Zr(n,i){let _=M(183);return _.typeName=et(n),_.typeArguments=i&&o().parenthesizeTypeArguments(de(i)),_.transformFlags=1,_}function J(n,i,_){return n.typeName!==i||n.typeArguments!==_?q(Zr(i,_),n):n}function qe(n,i,_){let c=ae(184);return c.typeParameters=De(n),c.parameters=De(i),c.type=_,c.transformFlags=1,c.modifiers=void 0,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.typeArguments=void 0,c}function u(n,i,_,c){return n.typeParameters!==i||n.parameters!==_||n.type!==c?Ne(qe(i,_,c),n):n}function Ne(n,i){return n!==i&&(n.modifiers=i.modifiers),Oe(n,i)}function Me(...n){return n.length===4?U(...n):n.length===3?ze(...n):B.fail("Incorrect number of arguments specified.")}function U(n,i,_,c){let f=ae(185);return f.modifiers=De(n),f.typeParameters=De(i),f.parameters=De(_),f.type=c,f.transformFlags=1,f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f.typeArguments=void 0,f}function ze(n,i,_){return U(void 0,n,i,_)}function an(...n){return n.length===5?Ve(...n):n.length===4?$e(...n):B.fail("Incorrect number of arguments specified.")}function Ve(n,i,_,c,f){return n.modifiers!==i||n.typeParameters!==_||n.parameters!==c||n.type!==f?Oe(Me(i,_,c,f),n):n}function $e(n,i,_,c){return Ve(n,n.modifiers,i,_,c)}function Pt(n,i){let _=M(186);return _.exprName=n,_.typeArguments=i&&o().parenthesizeTypeArguments(i),_.transformFlags=1,_}function kt(n,i,_){return n.exprName!==i||n.typeArguments!==_?q(Pt(i,_),n):n}function Nt(n){let i=ae(187);return i.members=de(n),i.transformFlags=1,i}function qt(n,i){return n.members!==i?q(Nt(i),n):n}function Gn(n){let i=M(188);return i.elementType=o().parenthesizeNonArrayTypeOfPostfixType(n),i.transformFlags=1,i}function wi(n,i){return n.elementType!==i?q(Gn(i),n):n}function un(n){let i=M(189);return i.elements=de(o().parenthesizeElementTypesOfTupleType(n)),i.transformFlags=1,i}function G(n,i){return n.elements!==i?q(un(i),n):n}function le(n,i,_,c){let f=ae(202);return f.dotDotDotToken=n,f.name=i,f.questionToken=_,f.type=c,f.transformFlags=1,f.jsDoc=void 0,f}function Fe(n,i,_,c,f){return n.dotDotDotToken!==i||n.name!==_||n.questionToken!==c||n.type!==f?q(le(i,_,c,f),n):n}function ve(n){let i=M(190);return i.type=o().parenthesizeTypeOfOptionalType(n),i.transformFlags=1,i}function j(n,i){return n.type!==i?q(ve(i),n):n}function ht(n){let i=M(191);return i.type=n,i.transformFlags=1,i}function xt(n,i){return n.type!==i?q(ht(i),n):n}function Lt(n,i,_){let c=M(n);return c.types=ye.createNodeArray(_(i)),c.transformFlags=1,c}function pn(n,i,_){return n.types!==i?q(Lt(n.kind,i,_),n):n}function Ul(n){return Lt(192,n,o().parenthesizeConstituentTypesOfUnionType)}function Es(n,i){return pn(n,i,o().parenthesizeConstituentTypesOfUnionType)}function Or(n){return Lt(193,n,o().parenthesizeConstituentTypesOfIntersectionType)}function Je(n,i){return pn(n,i,o().parenthesizeConstituentTypesOfIntersectionType)}function ft(n,i,_,c){let f=M(194);return f.checkType=o().parenthesizeCheckTypeOfConditionalType(n),f.extendsType=o().parenthesizeExtendsTypeOfConditionalType(i),f.trueType=_,f.falseType=c,f.transformFlags=1,f.locals=void 0,f.nextContainer=void 0,f}function Bl(n,i,_,c,f){return n.checkType!==i||n.extendsType!==_||n.trueType!==c||n.falseType!==f?q(ft(i,_,c,f),n):n}function Yn(n){let i=M(195);return i.typeParameter=n,i.transformFlags=1,i}function ql(n,i){return n.typeParameter!==i?q(Yn(i),n):n}function Wt(n,i){let _=M(203);return _.head=n,_.templateSpans=de(i),_.transformFlags=1,_}function zl(n,i,_){return n.head!==i||n.templateSpans!==_?q(Wt(i,_),n):n}function sr(n,i,_,c,f=!1){let w=M(205);return w.argument=n,w.attributes=i,w.assertions&&w.assertions.assertClause&&w.attributes&&(w.assertions.assertClause=w.attributes),w.qualifier=_,w.typeArguments=c&&o().parenthesizeTypeArguments(c),w.isTypeOf=f,w.transformFlags=1,w}function aa(n,i,_,c,f,w=n.isTypeOf){return n.argument!==i||n.attributes!==_||n.qualifier!==c||n.typeArguments!==f||n.isTypeOf!==w?q(sr(i,_,c,f,w),n):n}function Qt(n){let i=M(196);return i.type=n,i.transformFlags=1,i}function Ct(n,i){return n.type!==i?q(Qt(i),n):n}function D(){let n=M(197);return n.transformFlags=1,n}function Gt(n,i){let _=M(198);return _.operator=n,_.type=n===148?o().parenthesizeOperandOfReadonlyTypeOperator(i):o().parenthesizeOperandOfTypeOperator(i),_.transformFlags=1,_}function Mr(n,i){return n.type!==i?q(Gt(n.operator,i),n):n}function or(n,i){let _=M(199);return _.objectType=o().parenthesizeNonArrayTypeOfPostfixType(n),_.indexType=i,_.transformFlags=1,_}function Ka(n,i,_){return n.objectType!==i||n.indexType!==_?q(or(i,_),n):n}function St(n,i,_,c,f,w){let F=ae(200);return F.readonlyToken=n,F.typeParameter=i,F.nameType=_,F.questionToken=c,F.type=f,F.members=w&&de(w),F.transformFlags=1,F.locals=void 0,F.nextContainer=void 0,F}function jt(n,i,_,c,f,w,F){return n.readonlyToken!==i||n.typeParameter!==_||n.nameType!==c||n.questionToken!==f||n.type!==w||n.members!==F?q(St(i,_,c,f,w,F),n):n}function ei(n){let i=M(201);return i.literal=n,i.transformFlags=1,i}function yr(n,i){return n.literal!==i?q(ei(i),n):n}function As(n){let i=M(206);return i.elements=de(n),i.transformFlags|=ke(i.elements)|1024|524288,i.transformFlags&32768&&(i.transformFlags|=65664),i}function Fl(n,i){return n.elements!==i?q(As(i),n):n}function Jr(n){let i=M(207);return i.elements=de(n),i.transformFlags|=ke(i.elements)|1024|524288,i}function Vl(n,i){return n.elements!==i?q(Jr(i),n):n}function _a(n,i,_,c){let f=ae(208);return f.dotDotDotToken=n,f.propertyName=et(i),f.name=et(_),f.initializer=Da(c),f.transformFlags|=z(f.dotDotDotToken)|jn(f.propertyName)|jn(f.name)|z(f.initializer)|(f.dotDotDotToken?32768:0)|1024,f.flowNode=void 0,f}function ti(n,i,_,c,f){return n.propertyName!==_||n.dotDotDotToken!==i||n.name!==c||n.initializer!==f?q(_a(i,_,c,f),n):n}function Za(n,i){let _=M(209),c=n&&Yi(n),f=de(n,c&&H1(c)?!0:void 0);return _.elements=o().parenthesizeExpressionsOfCommaDelimitedList(f),_.multiLine=i,_.transformFlags|=ke(_.elements),_}function Cs(n,i){return n.elements!==i?q(Za(i,n.multiLine),n):n}function ki(n,i){let _=ae(210);return _.properties=de(n),_.multiLine=i,_.transformFlags|=ke(_.properties),_.jsDoc=void 0,_}function Wl(n,i){return n.properties!==i?q(ki(i,n.multiLine),n):n}function Ds(n,i,_){let c=ae(211);return c.expression=n,c.questionDotToken=i,c.name=_,c.transformFlags=z(c.expression)|z(c.questionDotToken)|(tt(c.name)?ja(c.name):z(c.name)|536870912),c.jsDoc=void 0,c.flowNode=void 0,c}function cr(n,i){let _=Ds(o().parenthesizeLeftSideOfAccess(n,!1),void 0,et(i));return Ap(n)&&(_.transformFlags|=384),_}function Gl(n,i,_){return Ig(n)?sa(n,i,n.questionDotToken,kr(_,tt)):n.expression!==i||n.name!==_?q(cr(i,_),n):n}function Ei(n,i,_){let c=Ds(o().parenthesizeLeftSideOfAccess(n,!0),i,et(_));return c.flags|=64,c.transformFlags|=32,c}function sa(n,i,_,c){return B.assert(!!(n.flags&64),"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."),n.expression!==i||n.questionDotToken!==_||n.name!==c?q(Ei(i,_,c),n):n}function Ps(n,i,_){let c=ae(212);return c.expression=n,c.questionDotToken=i,c.argumentExpression=_,c.transformFlags|=z(c.expression)|z(c.questionDotToken)|z(c.argumentExpression),c.jsDoc=void 0,c.flowNode=void 0,c}function Ai(n,i){let _=Ps(o().parenthesizeLeftSideOfAccess(n,!1),void 0,pr(i));return Ap(n)&&(_.transformFlags|=384),_}function Yl(n,i,_){return Og(n)?e_(n,i,n.questionDotToken,_):n.expression!==i||n.argumentExpression!==_?q(Ai(i,_),n):n}function Ns(n,i,_){let c=Ps(o().parenthesizeLeftSideOfAccess(n,!0),i,pr(_));return c.flags|=64,c.transformFlags|=32,c}function e_(n,i,_,c){return B.assert(!!(n.flags&64),"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."),n.expression!==i||n.questionDotToken!==_||n.argumentExpression!==c?q(Ns(i,_,c),n):n}function Is(n,i,_,c){let f=ae(213);return f.expression=n,f.questionDotToken=i,f.typeArguments=_,f.arguments=c,f.transformFlags|=z(f.expression)|z(f.questionDotToken)|ke(f.typeArguments)|ke(f.arguments),f.typeArguments&&(f.transformFlags|=1),zd(f.expression)&&(f.transformFlags|=16384),f}function Ci(n,i,_){let c=Is(o().parenthesizeLeftSideOfAccess(n,!1),void 0,De(i),o().parenthesizeExpressionsOfCommaDelimitedList(de(_)));return Ub(c.expression)&&(c.transformFlags|=8388608),c}function oa(n,i,_,c){return Jd(n)?Os(n,i,n.questionDotToken,_,c):n.expression!==i||n.typeArguments!==_||n.arguments!==c?q(Ci(i,_,c),n):n}function t_(n,i,_,c){let f=Is(o().parenthesizeLeftSideOfAccess(n,!0),i,De(_),o().parenthesizeExpressionsOfCommaDelimitedList(de(c)));return f.flags|=64,f.transformFlags|=32,f}function Os(n,i,_,c,f){return B.assert(!!(n.flags&64),"Cannot update a CallExpression using updateCallChain. Use updateCall instead."),n.expression!==i||n.questionDotToken!==_||n.typeArguments!==c||n.arguments!==f?q(t_(i,_,c,f),n):n}function xn(n,i,_){let c=ae(214);return c.expression=o().parenthesizeExpressionOfNew(n),c.typeArguments=De(i),c.arguments=_?o().parenthesizeExpressionsOfCommaDelimitedList(_):void 0,c.transformFlags|=z(c.expression)|ke(c.typeArguments)|ke(c.arguments)|32,c.typeArguments&&(c.transformFlags|=1),c}function n_(n,i,_,c){return n.expression!==i||n.typeArguments!==_||n.arguments!==c?q(xn(i,_,c),n):n}function ca(n,i,_){let c=M(215);return c.tag=o().parenthesizeLeftSideOfAccess(n,!1),c.typeArguments=De(i),c.template=_,c.transformFlags|=z(c.tag)|ke(c.typeArguments)|z(c.template)|1024,c.typeArguments&&(c.transformFlags|=1),j2(c.template)&&(c.transformFlags|=128),c}function Ms(n,i,_,c){return n.tag!==i||n.typeArguments!==_||n.template!==c?q(ca(i,_,c),n):n}function Js(n,i){let _=M(216);return _.expression=o().parenthesizeOperandOfPrefixUnary(i),_.type=n,_.transformFlags|=z(_.expression)|z(_.type)|1,_}function Ls(n,i,_){return n.type!==i||n.expression!==_?q(Js(i,_),n):n}function r_(n){let i=M(217);return i.expression=n,i.transformFlags=z(i.expression),i.jsDoc=void 0,i}function js(n,i){return n.expression!==i?q(r_(i),n):n}function i_(n,i,_,c,f,w,F){let pe=ae(218);pe.modifiers=De(n),pe.asteriskToken=i,pe.name=et(_),pe.typeParameters=De(c),pe.parameters=de(f),pe.type=w,pe.body=F;let Re=Rn(pe.modifiers)&1024,en=!!pe.asteriskToken,kn=Re&&en;return pe.transformFlags=ke(pe.modifiers)|z(pe.asteriskToken)|jn(pe.name)|ke(pe.typeParameters)|ke(pe.parameters)|z(pe.type)|z(pe.body)&-67108865|(kn?128:Re?256:en?2048:0)|(pe.typeParameters||pe.type?1:0)|4194304,pe.typeArguments=void 0,pe.jsDoc=void 0,pe.locals=void 0,pe.nextContainer=void 0,pe.flowNode=void 0,pe.endFlowNode=void 0,pe.returnFlowNode=void 0,pe}function Rs(n,i,_,c,f,w,F,pe){return n.name!==c||n.modifiers!==i||n.asteriskToken!==_||n.typeParameters!==f||n.parameters!==w||n.type!==F||n.body!==pe?Oe(i_(i,_,c,f,w,F,pe),n):n}function a_(n,i,_,c,f,w){let F=ae(219);F.modifiers=De(n),F.typeParameters=De(i),F.parameters=de(_),F.type=c,F.equalsGreaterThanToken=f??ct(39),F.body=o().parenthesizeConciseBodyOfArrowFunction(w);let pe=Rn(F.modifiers)&1024;return F.transformFlags=ke(F.modifiers)|ke(F.typeParameters)|ke(F.parameters)|z(F.type)|z(F.equalsGreaterThanToken)|z(F.body)&-67108865|(F.typeParameters||F.type?1:0)|(pe?16640:0)|1024,F.typeArguments=void 0,F.jsDoc=void 0,F.locals=void 0,F.nextContainer=void 0,F.flowNode=void 0,F.endFlowNode=void 0,F.returnFlowNode=void 0,F}function Us(n,i,_,c,f,w,F){return n.modifiers!==i||n.typeParameters!==_||n.parameters!==c||n.type!==f||n.equalsGreaterThanToken!==w||n.body!==F?Oe(a_(i,_,c,f,w,F),n):n}function Bs(n){let i=M(220);return i.expression=o().parenthesizeOperandOfPrefixUnary(n),i.transformFlags|=z(i.expression),i}function qs(n,i){return n.expression!==i?q(Bs(i),n):n}function la(n){let i=M(221);return i.expression=o().parenthesizeOperandOfPrefixUnary(n),i.transformFlags|=z(i.expression),i}function fn(n,i){return n.expression!==i?q(la(i),n):n}function __(n){let i=M(222);return i.expression=o().parenthesizeOperandOfPrefixUnary(n),i.transformFlags|=z(i.expression),i}function lr(n,i){return n.expression!==i?q(__(i),n):n}function zs(n){let i=M(223);return i.expression=o().parenthesizeOperandOfPrefixUnary(n),i.transformFlags|=z(i.expression)|256|128|2097152,i}function Lr(n,i){return n.expression!==i?q(zs(i),n):n}function jr(n,i){let _=M(224);return _.operator=n,_.operand=o().parenthesizeOperandOfPrefixUnary(i),_.transformFlags|=z(_.operand),(n===46||n===47)&&tt(_.operand)&&!Ua(_.operand)&&!Zd(_.operand)&&(_.transformFlags|=268435456),_}function Xl(n,i){return n.operand!==i?q(jr(n.operator,i),n):n}function ni(n,i){let _=M(225);return _.operator=i,_.operand=o().parenthesizeOperandOfPostfixUnary(n),_.transformFlags|=z(_.operand),tt(_.operand)&&!Ua(_.operand)&&!Zd(_.operand)&&(_.transformFlags|=268435456),_}function Hl(n,i){return n.operand!==i?q(ni(i,n.operator),n):n}function ua(n,i,_){let c=ae(226),f=$c(i),w=f.kind;return c.left=o().parenthesizeLeftSideOfBinary(w,n),c.operatorToken=f,c.right=o().parenthesizeRightSideOfBinary(w,c.left,_),c.transformFlags|=z(c.left)|z(c.operatorToken)|z(c.right),w===61?c.transformFlags|=32:w===64?If(c.left)?c.transformFlags|=5248|Fs(c.left):W1(c.left)&&(c.transformFlags|=5120|Fs(c.left)):w===43||w===68?c.transformFlags|=512:X2(w)&&(c.transformFlags|=16),w===103&&gi(c.left)&&(c.transformFlags|=536870912),c.jsDoc=void 0,c}function Fs(n){return uh(n)?65536:0}function $l(n,i,_,c){return n.left!==i||n.operatorToken!==_||n.right!==c?q(ua(i,_,c),n):n}function Vs(n,i,_,c,f){let w=M(227);return w.condition=o().parenthesizeConditionOfConditionalExpression(n),w.questionToken=i??ct(58),w.whenTrue=o().parenthesizeBranchOfConditionalExpression(_),w.colonToken=c??ct(59),w.whenFalse=o().parenthesizeBranchOfConditionalExpression(f),w.transformFlags|=z(w.condition)|z(w.questionToken)|z(w.whenTrue)|z(w.colonToken)|z(w.whenFalse),w}function Ws(n,i,_,c,f,w){return n.condition!==i||n.questionToken!==_||n.whenTrue!==c||n.colonToken!==f||n.whenFalse!==w?q(Vs(i,_,c,f,w),n):n}function Gs(n,i){let _=M(228);return _.head=n,_.templateSpans=de(i),_.transformFlags|=z(_.head)|ke(_.templateSpans)|1024,_}function Xn(n,i,_){return n.head!==i||n.templateSpans!==_?q(Gs(i,_),n):n}function Di(n,i,_,c=0){B.assert(!(c&-7177),"Unsupported template flags.");let f;if(_!==void 0&&_!==i&&(f=Pb(n,_),typeof f=="object"))return B.fail("Invalid raw text");if(i===void 0){if(f===void 0)return B.fail("Arguments 'text' and 'rawText' may not both be undefined.");i=f}else f!==void 0&&B.assert(i===f,"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");return i}function Ys(n){let i=1024;return n&&(i|=128),i}function Ql(n,i,_,c){let f=$t(n);return f.text=i,f.rawText=_,f.templateFlags=c&7176,f.transformFlags=Ys(f.templateFlags),f}function ri(n,i,_,c){let f=ae(n);return f.text=i,f.rawText=_,f.templateFlags=c&7176,f.transformFlags=Ys(f.templateFlags),f}function ii(n,i,_,c){return n===15?ri(n,i,_,c):Ql(n,i,_,c)}function Xs(n,i,_){return n=Di(16,n,i,_),ii(16,n,i,_)}function pa(n,i,_){return n=Di(16,n,i,_),ii(17,n,i,_)}function s_(n,i,_){return n=Di(16,n,i,_),ii(18,n,i,_)}function Kl(n,i,_){return n=Di(16,n,i,_),ri(15,n,i,_)}function o_(n,i){B.assert(!n||!!i,"A `YieldExpression` with an asteriskToken must have an expression.");let _=M(229);return _.expression=i&&o().parenthesizeExpressionForDisallowedComma(i),_.asteriskToken=n,_.transformFlags|=z(_.expression)|z(_.asteriskToken)|1024|128|1048576,_}function Zl(n,i,_){return n.expression!==_||n.asteriskToken!==i?q(o_(i,_),n):n}function Hs(n){let i=M(230);return i.expression=o().parenthesizeExpressionForDisallowedComma(n),i.transformFlags|=z(i.expression)|1024|32768,i}function eu(n,i){return n.expression!==i?q(Hs(i),n):n}function $s(n,i,_,c,f){let w=ae(231);return w.modifiers=De(n),w.name=et(i),w.typeParameters=De(_),w.heritageClauses=De(c),w.members=de(f),w.transformFlags|=ke(w.modifiers)|jn(w.name)|ke(w.typeParameters)|ke(w.heritageClauses)|ke(w.members)|(w.typeParameters?1:0)|1024,w.jsDoc=void 0,w}function c_(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.typeParameters!==c||n.heritageClauses!==f||n.members!==w?q($s(i,_,c,f,w),n):n}function l_(){return M(232)}function Qs(n,i){let _=M(233);return _.expression=o().parenthesizeLeftSideOfAccess(n,!1),_.typeArguments=i&&o().parenthesizeTypeArguments(i),_.transformFlags|=z(_.expression)|ke(_.typeArguments)|1024,_}function Ks(n,i,_){return n.expression!==i||n.typeArguments!==_?q(Qs(i,_),n):n}function dn(n,i){let _=M(234);return _.expression=n,_.type=i,_.transformFlags|=z(_.expression)|z(_.type)|1,_}function fa(n,i,_){return n.expression!==i||n.type!==_?q(dn(i,_),n):n}function Zs(n){let i=M(235);return i.expression=o().parenthesizeLeftSideOfAccess(n,!1),i.transformFlags|=z(i.expression)|1,i}function eo(n,i){return Mg(n)?Jn(n,i):n.expression!==i?q(Zs(i),n):n}function u_(n,i){let _=M(238);return _.expression=n,_.type=i,_.transformFlags|=z(_.expression)|z(_.type)|1,_}function to(n,i,_){return n.expression!==i||n.type!==_?q(u_(i,_),n):n}function p_(n){let i=M(235);return i.flags|=64,i.expression=o().parenthesizeLeftSideOfAccess(n,!0),i.transformFlags|=z(i.expression)|1,i}function Jn(n,i){return B.assert(!!(n.flags&64),"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."),n.expression!==i?q(p_(i),n):n}function no(n,i){let _=M(236);switch(_.keywordToken=n,_.name=i,_.transformFlags|=z(_.name),n){case 105:_.transformFlags|=1024;break;case 102:_.transformFlags|=32;break;default:return B.assertNever(n)}return _.flowNode=void 0,_}function f_(n,i){return n.name!==i?q(no(n.keywordToken,i),n):n}function Hn(n,i){let _=M(239);return _.expression=n,_.literal=i,_.transformFlags|=z(_.expression)|z(_.literal)|1024,_}function da(n,i,_){return n.expression!==i||n.literal!==_?q(Hn(i,_),n):n}function ro(){let n=M(240);return n.transformFlags|=1024,n}function Rr(n,i){let _=M(241);return _.statements=de(n),_.multiLine=i,_.transformFlags|=ke(_.statements),_.jsDoc=void 0,_.locals=void 0,_.nextContainer=void 0,_}function tu(n,i){return n.statements!==i?q(Rr(i,n.multiLine),n):n}function d_(n,i){let _=M(243);return _.modifiers=De(n),_.declarationList=Yr(i)?v_(i):i,_.transformFlags|=ke(_.modifiers)|z(_.declarationList),Rn(_.modifiers)&128&&(_.transformFlags=1),_.jsDoc=void 0,_.flowNode=void 0,_}function io(n,i,_){return n.modifiers!==i||n.declarationList!==_?q(d_(i,_),n):n}function ao(){let n=M(242);return n.jsDoc=void 0,n}function Pi(n){let i=M(244);return i.expression=o().parenthesizeExpressionOfExpressionStatement(n),i.transformFlags|=z(i.expression),i.jsDoc=void 0,i.flowNode=void 0,i}function _o(n,i){return n.expression!==i?q(Pi(i),n):n}function so(n,i,_){let c=M(245);return c.expression=n,c.thenStatement=It(i),c.elseStatement=It(_),c.transformFlags|=z(c.expression)|z(c.thenStatement)|z(c.elseStatement),c.jsDoc=void 0,c.flowNode=void 0,c}function oo(n,i,_,c){return n.expression!==i||n.thenStatement!==_||n.elseStatement!==c?q(so(i,_,c),n):n}function co(n,i){let _=M(246);return _.statement=It(n),_.expression=i,_.transformFlags|=z(_.statement)|z(_.expression),_.jsDoc=void 0,_.flowNode=void 0,_}function lo(n,i,_){return n.statement!==i||n.expression!==_?q(co(i,_),n):n}function uo(n,i){let _=M(247);return _.expression=n,_.statement=It(i),_.transformFlags|=z(_.expression)|z(_.statement),_.jsDoc=void 0,_.flowNode=void 0,_}function nu(n,i,_){return n.expression!==i||n.statement!==_?q(uo(i,_),n):n}function po(n,i,_,c){let f=M(248);return f.initializer=n,f.condition=i,f.incrementor=_,f.statement=It(c),f.transformFlags|=z(f.initializer)|z(f.condition)|z(f.incrementor)|z(f.statement),f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f.flowNode=void 0,f}function fo(n,i,_,c,f){return n.initializer!==i||n.condition!==_||n.incrementor!==c||n.statement!==f?q(po(i,_,c,f),n):n}function m_(n,i,_){let c=M(249);return c.initializer=n,c.expression=i,c.statement=It(_),c.transformFlags|=z(c.initializer)|z(c.expression)|z(c.statement),c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.flowNode=void 0,c}function ru(n,i,_,c){return n.initializer!==i||n.expression!==_||n.statement!==c?q(m_(i,_,c),n):n}function mo(n,i,_,c){let f=M(250);return f.awaitModifier=n,f.initializer=i,f.expression=o().parenthesizeExpressionForDisallowedComma(_),f.statement=It(c),f.transformFlags|=z(f.awaitModifier)|z(f.initializer)|z(f.expression)|z(f.statement)|1024,n&&(f.transformFlags|=128),f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f.flowNode=void 0,f}function iu(n,i,_,c,f){return n.awaitModifier!==i||n.initializer!==_||n.expression!==c||n.statement!==f?q(mo(i,_,c,f),n):n}function ho(n){let i=M(251);return i.label=et(n),i.transformFlags|=z(i.label)|4194304,i.jsDoc=void 0,i.flowNode=void 0,i}function au(n,i){return n.label!==i?q(ho(i),n):n}function h_(n){let i=M(252);return i.label=et(n),i.transformFlags|=z(i.label)|4194304,i.jsDoc=void 0,i.flowNode=void 0,i}function yo(n,i){return n.label!==i?q(h_(i),n):n}function y_(n){let i=M(253);return i.expression=n,i.transformFlags|=z(i.expression)|128|4194304,i.jsDoc=void 0,i.flowNode=void 0,i}function _u(n,i){return n.expression!==i?q(y_(i),n):n}function g_(n,i){let _=M(254);return _.expression=n,_.statement=It(i),_.transformFlags|=z(_.expression)|z(_.statement),_.jsDoc=void 0,_.flowNode=void 0,_}function go(n,i,_){return n.expression!==i||n.statement!==_?q(g_(i,_),n):n}function b_(n,i){let _=M(255);return _.expression=o().parenthesizeExpressionForDisallowedComma(n),_.caseBlock=i,_.transformFlags|=z(_.expression)|z(_.caseBlock),_.jsDoc=void 0,_.flowNode=void 0,_.possiblyExhaustive=!1,_}function ai(n,i,_){return n.expression!==i||n.caseBlock!==_?q(b_(i,_),n):n}function bo(n,i){let _=M(256);return _.label=et(n),_.statement=It(i),_.transformFlags|=z(_.label)|z(_.statement),_.jsDoc=void 0,_.flowNode=void 0,_}function vo(n,i,_){return n.label!==i||n.statement!==_?q(bo(i,_),n):n}function To(n){let i=M(257);return i.expression=n,i.transformFlags|=z(i.expression),i.jsDoc=void 0,i.flowNode=void 0,i}function su(n,i){return n.expression!==i?q(To(i),n):n}function xo(n,i,_){let c=M(258);return c.tryBlock=n,c.catchClause=i,c.finallyBlock=_,c.transformFlags|=z(c.tryBlock)|z(c.catchClause)|z(c.finallyBlock),c.jsDoc=void 0,c.flowNode=void 0,c}function ou(n,i,_,c){return n.tryBlock!==i||n.catchClause!==_||n.finallyBlock!==c?q(xo(i,_,c),n):n}function So(){let n=M(259);return n.jsDoc=void 0,n.flowNode=void 0,n}function ma(n,i,_,c){let f=ae(260);return f.name=et(n),f.exclamationToken=i,f.type=_,f.initializer=Da(c),f.transformFlags|=jn(f.name)|z(f.initializer)|(f.exclamationToken??f.type?1:0),f.jsDoc=void 0,f}function wo(n,i,_,c,f){return n.name!==i||n.type!==c||n.exclamationToken!==_||n.initializer!==f?q(ma(i,_,c,f),n):n}function v_(n,i=0){let _=M(261);return _.flags|=i&7,_.declarations=de(n),_.transformFlags|=ke(_.declarations)|4194304,i&7&&(_.transformFlags|=263168),i&4&&(_.transformFlags|=4),_}function cu(n,i){return n.declarations!==i?q(v_(i,n.flags),n):n}function ko(n,i,_,c,f,w,F){let pe=ae(262);if(pe.modifiers=De(n),pe.asteriskToken=i,pe.name=et(_),pe.typeParameters=De(c),pe.parameters=de(f),pe.type=w,pe.body=F,!pe.body||Rn(pe.modifiers)&128)pe.transformFlags=1;else{let Re=Rn(pe.modifiers)&1024,en=!!pe.asteriskToken,kn=Re&&en;pe.transformFlags=ke(pe.modifiers)|z(pe.asteriskToken)|jn(pe.name)|ke(pe.typeParameters)|ke(pe.parameters)|z(pe.type)|z(pe.body)&-67108865|(kn?128:Re?256:en?2048:0)|(pe.typeParameters||pe.type?1:0)|4194304}return pe.typeArguments=void 0,pe.jsDoc=void 0,pe.locals=void 0,pe.nextContainer=void 0,pe.endFlowNode=void 0,pe.returnFlowNode=void 0,pe}function T_(n,i,_,c,f,w,F,pe){return n.modifiers!==i||n.asteriskToken!==_||n.name!==c||n.typeParameters!==f||n.parameters!==w||n.type!==F||n.body!==pe?lu(ko(i,_,c,f,w,F,pe),n):n}function lu(n,i){return n!==i&&n.modifiers===i.modifiers&&(n.modifiers=i.modifiers),Oe(n,i)}function Eo(n,i,_,c,f){let w=ae(263);return w.modifiers=De(n),w.name=et(i),w.typeParameters=De(_),w.heritageClauses=De(c),w.members=de(f),Rn(w.modifiers)&128?w.transformFlags=1:(w.transformFlags|=ke(w.modifiers)|jn(w.name)|ke(w.typeParameters)|ke(w.heritageClauses)|ke(w.members)|(w.typeParameters?1:0)|1024,w.transformFlags&8192&&(w.transformFlags|=1)),w.jsDoc=void 0,w}function ha(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.typeParameters!==c||n.heritageClauses!==f||n.members!==w?q(Eo(i,_,c,f,w),n):n}function Ao(n,i,_,c,f){let w=ae(264);return w.modifiers=De(n),w.name=et(i),w.typeParameters=De(_),w.heritageClauses=De(c),w.members=de(f),w.transformFlags=1,w.jsDoc=void 0,w}function Co(n,i,_,c,f,w){return n.modifiers!==i||n.name!==_||n.typeParameters!==c||n.heritageClauses!==f||n.members!==w?q(Ao(i,_,c,f,w),n):n}function ot(n,i,_,c){let f=ae(265);return f.modifiers=De(n),f.name=et(i),f.typeParameters=De(_),f.type=c,f.transformFlags=1,f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f}function gr(n,i,_,c,f){return n.modifiers!==i||n.name!==_||n.typeParameters!==c||n.type!==f?q(ot(i,_,c,f),n):n}function x_(n,i,_){let c=ae(266);return c.modifiers=De(n),c.name=et(i),c.members=de(_),c.transformFlags|=ke(c.modifiers)|z(c.name)|ke(c.members)|1,c.transformFlags&=-67108865,c.jsDoc=void 0,c}function br(n,i,_,c){return n.modifiers!==i||n.name!==_||n.members!==c?q(x_(i,_,c),n):n}function Do(n,i,_,c=0){let f=ae(267);return f.modifiers=De(n),f.flags|=c&2088,f.name=i,f.body=_,Rn(f.modifiers)&128?f.transformFlags=1:f.transformFlags|=ke(f.modifiers)|z(f.name)|z(f.body)|1,f.transformFlags&=-67108865,f.jsDoc=void 0,f.locals=void 0,f.nextContainer=void 0,f}function Et(n,i,_,c){return n.modifiers!==i||n.name!==_||n.body!==c?q(Do(i,_,c,n.flags),n):n}function vr(n){let i=M(268);return i.statements=de(n),i.transformFlags|=ke(i.statements),i.jsDoc=void 0,i}function zt(n,i){return n.statements!==i?q(vr(i),n):n}function Po(n){let i=M(269);return i.clauses=de(n),i.transformFlags|=ke(i.clauses),i.locals=void 0,i.nextContainer=void 0,i}function uu(n,i){return n.clauses!==i?q(Po(i),n):n}function No(n){let i=ae(270);return i.name=et(n),i.transformFlags|=ja(i.name)|1,i.modifiers=void 0,i.jsDoc=void 0,i}function Io(n,i){return n.name!==i?pu(No(i),n):n}function pu(n,i){return n!==i&&(n.modifiers=i.modifiers),q(n,i)}function Oo(n,i,_,c){let f=ae(271);return f.modifiers=De(n),f.name=et(_),f.isTypeOnly=i,f.moduleReference=c,f.transformFlags|=ke(f.modifiers)|ja(f.name)|z(f.moduleReference),zf(f.moduleReference)||(f.transformFlags|=1),f.transformFlags&=-67108865,f.jsDoc=void 0,f}function Mo(n,i,_,c,f){return n.modifiers!==i||n.isTypeOnly!==_||n.name!==c||n.moduleReference!==f?q(Oo(i,_,c,f),n):n}function Jo(n,i,_,c){let f=M(272);return f.modifiers=De(n),f.importClause=i,f.moduleSpecifier=_,f.attributes=f.assertClause=c,f.transformFlags|=z(f.importClause)|z(f.moduleSpecifier),f.transformFlags&=-67108865,f.jsDoc=void 0,f}function Lo(n,i,_,c,f){return n.modifiers!==i||n.importClause!==_||n.moduleSpecifier!==c||n.attributes!==f?q(Jo(i,_,c,f),n):n}function jo(n,i,_){let c=ae(273);return c.isTypeOnly=n,c.name=i,c.namedBindings=_,c.transformFlags|=z(c.name)|z(c.namedBindings),n&&(c.transformFlags|=1),c.transformFlags&=-67108865,c}function Ro(n,i,_,c){return n.isTypeOnly!==i||n.name!==_||n.namedBindings!==c?q(jo(i,_,c),n):n}function S_(n,i){let _=M(300);return _.elements=de(n),_.multiLine=i,_.token=132,_.transformFlags|=4,_}function fu(n,i,_){return n.elements!==i||n.multiLine!==_?q(S_(i,_),n):n}function Ni(n,i){let _=M(301);return _.name=n,_.value=i,_.transformFlags|=4,_}function Uo(n,i,_){return n.name!==i||n.value!==_?q(Ni(i,_),n):n}function w_(n,i){let _=M(302);return _.assertClause=n,_.multiLine=i,_}function Bo(n,i,_){return n.assertClause!==i||n.multiLine!==_?q(w_(i,_),n):n}function qo(n,i,_){let c=M(300);return c.token=_??118,c.elements=de(n),c.multiLine=i,c.transformFlags|=4,c}function k_(n,i,_){return n.elements!==i||n.multiLine!==_?q(qo(i,_,n.token),n):n}function zo(n,i){let _=M(301);return _.name=n,_.value=i,_.transformFlags|=4,_}function Fo(n,i,_){return n.name!==i||n.value!==_?q(zo(i,_),n):n}function Vo(n){let i=ae(274);return i.name=n,i.transformFlags|=z(i.name),i.transformFlags&=-67108865,i}function du(n,i){return n.name!==i?q(Vo(i),n):n}function Wo(n){let i=ae(280);return i.name=n,i.transformFlags|=z(i.name)|32,i.transformFlags&=-67108865,i}function mu(n,i){return n.name!==i?q(Wo(i),n):n}function Go(n){let i=M(275);return i.elements=de(n),i.transformFlags|=ke(i.elements),i.transformFlags&=-67108865,i}function Yo(n,i){return n.elements!==i?q(Go(i),n):n}function Tr(n,i,_){let c=ae(276);return c.isTypeOnly=n,c.propertyName=i,c.name=_,c.transformFlags|=z(c.propertyName)|z(c.name),c.transformFlags&=-67108865,c}function hu(n,i,_,c){return n.isTypeOnly!==i||n.propertyName!==_||n.name!==c?q(Tr(i,_,c),n):n}function ya(n,i,_){let c=ae(277);return c.modifiers=De(n),c.isExportEquals=i,c.expression=i?o().parenthesizeRightSideOfBinary(64,void 0,_):o().parenthesizeExpressionOfExportDefault(_),c.transformFlags|=ke(c.modifiers)|z(c.expression),c.transformFlags&=-67108865,c.jsDoc=void 0,c}function Ii(n,i,_){return n.modifiers!==i||n.expression!==_?q(ya(i,n.isExportEquals,_),n):n}function ga(n,i,_,c,f){let w=ae(278);return w.modifiers=De(n),w.isTypeOnly=i,w.exportClause=_,w.moduleSpecifier=c,w.attributes=w.assertClause=f,w.transformFlags|=ke(w.modifiers)|z(w.exportClause)|z(w.moduleSpecifier),w.transformFlags&=-67108865,w.jsDoc=void 0,w}function Xo(n,i,_,c,f,w){return n.modifiers!==i||n.isTypeOnly!==_||n.exportClause!==c||n.moduleSpecifier!==f||n.attributes!==w?Oi(ga(i,_,c,f,w),n):n}function Oi(n,i){return n!==i&&n.modifiers===i.modifiers&&(n.modifiers=i.modifiers),q(n,i)}function E_(n){let i=M(279);return i.elements=de(n),i.transformFlags|=ke(i.elements),i.transformFlags&=-67108865,i}function yu(n,i){return n.elements!==i?q(E_(i),n):n}function ba(n,i,_){let c=M(281);return c.isTypeOnly=n,c.propertyName=et(i),c.name=et(_),c.transformFlags|=z(c.propertyName)|z(c.name),c.transformFlags&=-67108865,c.jsDoc=void 0,c}function gu(n,i,_,c){return n.isTypeOnly!==i||n.propertyName!==_||n.name!==c?q(ba(i,_,c),n):n}function bu(){let n=ae(282);return n.jsDoc=void 0,n}function A_(n){let i=M(283);return i.expression=n,i.transformFlags|=z(i.expression),i.transformFlags&=-67108865,i}function vu(n,i){return n.expression!==i?q(A_(i),n):n}function Ho(n){return M(n)}function $o(n,i,_=!1){let c=C_(n,_?i&&o().parenthesizeNonArrayTypeOfPostfixType(i):i);return c.postfix=_,c}function C_(n,i){let _=M(n);return _.type=i,_}function Tu(n,i,_){return i.type!==_?q($o(n,_,i.postfix),i):i}function xu(n,i,_){return i.type!==_?q(C_(n,_),i):i}function Qo(n,i){let _=ae(317);return _.parameters=De(n),_.type=i,_.transformFlags=ke(_.parameters)|(_.type?1:0),_.jsDoc=void 0,_.locals=void 0,_.nextContainer=void 0,_.typeArguments=void 0,_}function Su(n,i,_){return n.parameters!==i||n.type!==_?q(Qo(i,_),n):n}function Ko(n,i=!1){let _=ae(322);return _.jsDocPropertyTags=De(n),_.isArrayType=i,_}function wu(n,i,_){return n.jsDocPropertyTags!==i||n.isArrayType!==_?q(Ko(i,_),n):n}function Zo(n){let i=M(309);return i.type=n,i}function D_(n,i){return n.type!==i?q(Zo(i),n):n}function ec(n,i,_){let c=ae(323);return c.typeParameters=De(n),c.parameters=de(i),c.type=_,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c}function ku(n,i,_,c){return n.typeParameters!==i||n.parameters!==_||n.type!==c?q(ec(i,_,c),n):n}function _n(n){let i=il(n.kind);return n.tagName.escapedText===Ja(i)?n.tagName:Ge(i)}function Sn(n,i,_){let c=M(n);return c.tagName=i,c.comment=_,c}function Ur(n,i,_){let c=ae(n);return c.tagName=i,c.comment=_,c}function P_(n,i,_,c){let f=Sn(345,n??Ge("template"),c);return f.constraint=i,f.typeParameters=de(_),f}function tc(n,i=_n(n),_,c,f){return n.tagName!==i||n.constraint!==_||n.typeParameters!==c||n.comment!==f?q(P_(i,_,c,f),n):n}function va(n,i,_,c){let f=Ur(346,n??Ge("typedef"),c);return f.typeExpression=i,f.fullName=_,f.name=em(_),f.locals=void 0,f.nextContainer=void 0,f}function Eu(n,i=_n(n),_,c,f){return n.tagName!==i||n.typeExpression!==_||n.fullName!==c||n.comment!==f?q(va(i,_,c,f),n):n}function N_(n,i,_,c,f,w){let F=Ur(341,n??Ge("param"),w);return F.typeExpression=c,F.name=i,F.isNameFirst=!!f,F.isBracketed=_,F}function Au(n,i=_n(n),_,c,f,w,F){return n.tagName!==i||n.name!==_||n.isBracketed!==c||n.typeExpression!==f||n.isNameFirst!==w||n.comment!==F?q(N_(i,_,c,f,w,F),n):n}function nc(n,i,_,c,f,w){let F=Ur(348,n??Ge("prop"),w);return F.typeExpression=c,F.name=i,F.isNameFirst=!!f,F.isBracketed=_,F}function rc(n,i=_n(n),_,c,f,w,F){return n.tagName!==i||n.name!==_||n.isBracketed!==c||n.typeExpression!==f||n.isNameFirst!==w||n.comment!==F?q(nc(i,_,c,f,w,F),n):n}function ic(n,i,_,c){let f=Ur(338,n??Ge("callback"),c);return f.typeExpression=i,f.fullName=_,f.name=em(_),f.locals=void 0,f.nextContainer=void 0,f}function ac(n,i=_n(n),_,c,f){return n.tagName!==i||n.typeExpression!==_||n.fullName!==c||n.comment!==f?q(ic(i,_,c,f),n):n}function _c(n,i,_){let c=Sn(339,n??Ge("overload"),_);return c.typeExpression=i,c}function I_(n,i=_n(n),_,c){return n.tagName!==i||n.typeExpression!==_||n.comment!==c?q(_c(i,_,c),n):n}function O_(n,i,_){let c=Sn(328,n??Ge("augments"),_);return c.class=i,c}function Mi(n,i=_n(n),_,c){return n.tagName!==i||n.class!==_||n.comment!==c?q(O_(i,_,c),n):n}function sc(n,i,_){let c=Sn(329,n??Ge("implements"),_);return c.class=i,c}function Br(n,i,_){let c=Sn(347,n??Ge("see"),_);return c.name=i,c}function Ta(n,i,_,c){return n.tagName!==i||n.name!==_||n.comment!==c?q(Br(i,_,c),n):n}function oc(n){let i=M(310);return i.name=n,i}function Cu(n,i){return n.name!==i?q(oc(i),n):n}function cc(n,i){let _=M(311);return _.left=n,_.right=i,_.transformFlags|=z(_.left)|z(_.right),_}function Du(n,i,_){return n.left!==i||n.right!==_?q(cc(i,_),n):n}function lc(n,i){let _=M(324);return _.name=n,_.text=i,_}function uc(n,i,_){return n.name!==i?q(lc(i,_),n):n}function pc(n,i){let _=M(325);return _.name=n,_.text=i,_}function Pu(n,i,_){return n.name!==i?q(pc(i,_),n):n}function fc(n,i){let _=M(326);return _.name=n,_.text=i,_}function Nu(n,i,_){return n.name!==i?q(fc(i,_),n):n}function Iu(n,i=_n(n),_,c){return n.tagName!==i||n.class!==_||n.comment!==c?q(sc(i,_,c),n):n}function dc(n,i,_){return Sn(n,i??Ge(il(n)),_)}function Ou(n,i,_=_n(i),c){return i.tagName!==_||i.comment!==c?q(dc(n,_,c),i):i}function mc(n,i,_,c){let f=Sn(n,i??Ge(il(n)),c);return f.typeExpression=_,f}function Mu(n,i,_=_n(i),c,f){return i.tagName!==_||i.typeExpression!==c||i.comment!==f?q(mc(n,_,c,f),i):i}function hc(n,i){return Sn(327,n,i)}function Ju(n,i,_){return n.tagName!==i||n.comment!==_?q(hc(i,_),n):n}function yc(n,i,_){let c=Ur(340,n??Ge(il(340)),_);return c.typeExpression=i,c.locals=void 0,c.nextContainer=void 0,c}function M_(n,i=_n(n),_,c){return n.tagName!==i||n.typeExpression!==_||n.comment!==c?q(yc(i,_,c),n):n}function gc(n,i,_,c,f){let w=Sn(351,n??Ge("import"),f);return w.importClause=i,w.moduleSpecifier=_,w.attributes=c,w.comment=f,w}function bc(n,i,_,c,f,w){return n.tagName!==i||n.comment!==w||n.importClause!==_||n.moduleSpecifier!==c||n.attributes!==f?q(gc(i,_,c,f,w),n):n}function J_(n){let i=M(321);return i.text=n,i}function Lu(n,i){return n.text!==i?q(J_(i),n):n}function Ji(n,i){let _=M(320);return _.comment=n,_.tags=De(i),_}function vc(n,i,_){return n.comment!==i||n.tags!==_?q(Ji(i,_),n):n}function Tc(n,i,_){let c=M(284);return c.openingElement=n,c.children=de(i),c.closingElement=_,c.transformFlags|=z(c.openingElement)|ke(c.children)|z(c.closingElement)|2,c}function ju(n,i,_,c){return n.openingElement!==i||n.children!==_||n.closingElement!==c?q(Tc(i,_,c),n):n}function xc(n,i,_){let c=M(285);return c.tagName=n,c.typeArguments=De(i),c.attributes=_,c.transformFlags|=z(c.tagName)|ke(c.typeArguments)|z(c.attributes)|2,c.typeArguments&&(c.transformFlags|=1),c}function L_(n,i,_,c){return n.tagName!==i||n.typeArguments!==_||n.attributes!==c?q(xc(i,_,c),n):n}function j_(n,i,_){let c=M(286);return c.tagName=n,c.typeArguments=De(i),c.attributes=_,c.transformFlags|=z(c.tagName)|ke(c.typeArguments)|z(c.attributes)|2,i&&(c.transformFlags|=1),c}function Sc(n,i,_,c){return n.tagName!==i||n.typeArguments!==_||n.attributes!==c?q(j_(i,_,c),n):n}function xa(n){let i=M(287);return i.tagName=n,i.transformFlags|=z(i.tagName)|2,i}function Kt(n,i){return n.tagName!==i?q(xa(i),n):n}function R_(n,i,_){let c=M(288);return c.openingFragment=n,c.children=de(i),c.closingFragment=_,c.transformFlags|=z(c.openingFragment)|ke(c.children)|z(c.closingFragment)|2,c}function wc(n,i,_,c){return n.openingFragment!==i||n.children!==_||n.closingFragment!==c?q(R_(i,_,c),n):n}function Sa(n,i){let _=M(12);return _.text=n,_.containsOnlyTriviaWhiteSpaces=!!i,_.transformFlags|=2,_}function kc(n,i,_){return n.text!==i||n.containsOnlyTriviaWhiteSpaces!==_?q(Sa(i,_),n):n}function Ru(){let n=M(289);return n.transformFlags|=2,n}function Uu(){let n=M(290);return n.transformFlags|=2,n}function Ec(n,i){let _=ae(291);return _.name=n,_.initializer=i,_.transformFlags|=z(_.name)|z(_.initializer)|2,_}function wa(n,i,_){return n.name!==i||n.initializer!==_?q(Ec(i,_),n):n}function Ac(n){let i=ae(292);return i.properties=de(n),i.transformFlags|=ke(i.properties)|2,i}function Bu(n,i){return n.properties!==i?q(Ac(i),n):n}function Cc(n){let i=M(293);return i.expression=n,i.transformFlags|=z(i.expression)|2,i}function qu(n,i){return n.expression!==i?q(Cc(i),n):n}function ka(n,i){let _=M(294);return _.dotDotDotToken=n,_.expression=i,_.transformFlags|=z(_.dotDotDotToken)|z(_.expression)|2,_}function Li(n,i){return n.expression!==i?q(ka(n.dotDotDotToken,i),n):n}function Dc(n,i){let _=M(295);return _.namespace=n,_.name=i,_.transformFlags|=z(_.namespace)|z(_.name)|2,_}function U_(n,i,_){return n.namespace!==i||n.name!==_?q(Dc(i,_),n):n}function B_(n,i){let _=M(296);return _.expression=o().parenthesizeExpressionForDisallowedComma(n),_.statements=de(i),_.transformFlags|=z(_.expression)|ke(_.statements),_.jsDoc=void 0,_}function zu(n,i,_){return n.expression!==i||n.statements!==_?q(B_(i,_),n):n}function _i(n){let i=M(297);return i.statements=de(n),i.transformFlags=ke(i.statements),i}function Pc(n,i){return n.statements!==i?q(_i(i),n):n}function Nc(n,i){let _=M(298);switch(_.token=n,_.types=de(i),_.transformFlags|=ke(_.types),n){case 96:_.transformFlags|=1024;break;case 119:_.transformFlags|=1;break;default:return B.assertNever(n)}return _}function Fu(n,i){return n.types!==i?q(Nc(n.token,i),n):n}function q_(n,i){let _=M(299);return _.variableDeclaration=xr(n),_.block=i,_.transformFlags|=z(_.variableDeclaration)|z(_.block)|(n?0:64),_.locals=void 0,_.nextContainer=void 0,_}function Ic(n,i,_){return n.variableDeclaration!==i||n.block!==_?q(q_(i,_),n):n}function Ea(n,i){let _=ae(303);return _.name=et(n),_.initializer=o().parenthesizeExpressionForDisallowedComma(i),_.transformFlags|=jn(_.name)|z(_.initializer),_.modifiers=void 0,_.questionToken=void 0,_.exclamationToken=void 0,_.jsDoc=void 0,_}function qr(n,i,_){return n.name!==i||n.initializer!==_?Vu(Ea(i,_),n):n}function Vu(n,i){return n!==i&&(n.modifiers=i.modifiers,n.questionToken=i.questionToken,n.exclamationToken=i.exclamationToken),q(n,i)}function Oc(n,i){let _=ae(304);return _.name=et(n),_.objectAssignmentInitializer=i&&o().parenthesizeExpressionForDisallowedComma(i),_.transformFlags|=ja(_.name)|z(_.objectAssignmentInitializer)|1024,_.equalsToken=void 0,_.modifiers=void 0,_.questionToken=void 0,_.exclamationToken=void 0,_.jsDoc=void 0,_}function Wu(n,i,_){return n.name!==i||n.objectAssignmentInitializer!==_?Gu(Oc(i,_),n):n}function Gu(n,i){return n!==i&&(n.modifiers=i.modifiers,n.questionToken=i.questionToken,n.exclamationToken=i.exclamationToken,n.equalsToken=i.equalsToken),q(n,i)}function z_(n){let i=ae(305);return i.expression=o().parenthesizeExpressionForDisallowedComma(n),i.transformFlags|=z(i.expression)|128|65536,i.jsDoc=void 0,i}function Mc(n,i){return n.expression!==i?q(z_(i),n):n}function wn(n,i){let _=ae(306);return _.name=et(n),_.initializer=i&&o().parenthesizeExpressionForDisallowedComma(i),_.transformFlags|=z(_.name)|z(_.initializer)|1,_.jsDoc=void 0,_}function Jc(n,i,_){return n.name!==i||n.initializer!==_?q(wn(i,_),n):n}function Yu(n,i,_){let c=t.createBaseSourceFileNode(307);return c.statements=de(n),c.endOfFileToken=i,c.flags|=_,c.text="",c.fileName="",c.path="",c.resolvedPath="",c.originalFileName="",c.languageVersion=1,c.languageVariant=0,c.scriptKind=0,c.isDeclarationFile=!1,c.hasNoDefaultLib=!1,c.transformFlags|=ke(c.statements)|z(c.endOfFileToken),c.locals=void 0,c.nextContainer=void 0,c.endFlowNode=void 0,c.nodeCount=0,c.identifierCount=0,c.symbolCount=0,c.parseDiagnostics=void 0,c.bindDiagnostics=void 0,c.bindSuggestionDiagnostics=void 0,c.lineMap=void 0,c.externalModuleIndicator=void 0,c.setExternalModuleIndicator=void 0,c.pragmas=void 0,c.checkJsDirective=void 0,c.referencedFiles=void 0,c.typeReferenceDirectives=void 0,c.libReferenceDirectives=void 0,c.amdDependencies=void 0,c.commentDirectives=void 0,c.identifiers=void 0,c.packageJsonLocations=void 0,c.packageJsonScope=void 0,c.imports=void 0,c.moduleAugmentations=void 0,c.ambientModuleNames=void 0,c.classifiableNames=void 0,c.impliedNodeFormat=void 0,c}function Lc(n){let i=Object.create(n.redirectTarget);return Object.defineProperties(i,{id:{get(){return this.redirectInfo.redirectTarget.id},set(_){this.redirectInfo.redirectTarget.id=_}},symbol:{get(){return this.redirectInfo.redirectTarget.symbol},set(_){this.redirectInfo.redirectTarget.symbol=_}}}),i.redirectInfo=n,i}function Xu(n){let i=Lc(n.redirectInfo);return i.flags|=n.flags&-17,i.fileName=n.fileName,i.path=n.path,i.resolvedPath=n.resolvedPath,i.originalFileName=n.originalFileName,i.packageJsonLocations=n.packageJsonLocations,i.packageJsonScope=n.packageJsonScope,i.emitNode=void 0,i}function jc(n){let i=t.createBaseSourceFileNode(307);i.flags|=n.flags&-17;for(let _ in n)if(!(Cr(i,_)||!Cr(n,_))){if(_==="emitNode"){i.emitNode=void 0;continue}i[_]=n[_]}return i}function Aa(n){let i=n.redirectInfo?Xu(n):jc(n);return a(i,n),i}function Hu(n,i,_,c,f,w,F){let pe=Aa(n);return pe.statements=de(i),pe.isDeclarationFile=_,pe.referencedFiles=c,pe.typeReferenceDirectives=f,pe.hasNoDefaultLib=w,pe.libReferenceDirectives=F,pe.transformFlags=ke(pe.statements)|z(pe.endOfFileToken),pe}function $u(n,i,_=n.isDeclarationFile,c=n.referencedFiles,f=n.typeReferenceDirectives,w=n.hasNoDefaultLib,F=n.libReferenceDirectives){return n.statements!==i||n.isDeclarationFile!==_||n.referencedFiles!==c||n.typeReferenceDirectives!==f||n.hasNoDefaultLib!==w||n.libReferenceDirectives!==F?q(Hu(n,i,_,c,f,w,F),n):n}function F_(n){let i=M(308);return i.sourceFiles=n,i.syntheticFileReferences=void 0,i.syntheticTypeReferences=void 0,i.syntheticLibReferences=void 0,i.hasNoDefaultLib=void 0,i}function Qu(n,i){return n.sourceFiles!==i?q(F_(i),n):n}function Ku(n,i=!1,_){let c=M(237);return c.type=n,c.isSpread=i,c.tupleNameSource=_,c}function Ca(n){let i=M(352);return i._children=n,i}function Rc(n){let i=M(353);return i.original=n,yn(i,n),i}function Uc(n,i){let _=M(355);return _.expression=n,_.original=i,_.transformFlags|=z(_.expression)|1,yn(_,i),_}function Bc(n,i){return n.expression!==i?q(Uc(i,n.original),n):n}function Zu(){return M(354)}function ep(n){if(La(n)&&!ml(n)&&!n.original&&!n.emitNode&&!n.id){if(Zb(n))return n.elements;if(Zi(n)&&jb(n.operatorToken))return[n.left,n.right]}return n}function V_(n){let i=M(356);return i.elements=de(iy(n,ep)),i.transformFlags|=ke(i.elements),i}function qc(n,i){return n.elements!==i?q(V_(i),n):n}function W_(n,i){let _=M(357);return _.expression=n,_.thisArg=i,_.transformFlags|=z(_.expression)|z(_.thisArg),_}function zc(n,i,_){return n.expression!==i||n.thisArg!==_?q(W_(i,_),n):n}function tp(n){let i=bn(n.escapedText);return i.flags|=n.flags&-17,i.transformFlags=n.transformFlags,a(i,n),setIdentifierAutoGenerate(i,{...n.emitNode.autoGenerate}),i}function np(n){let i=bn(n.escapedText);i.flags|=n.flags&-17,i.jsDoc=n.jsDoc,i.flowNode=n.flowNode,i.symbol=n.symbol,i.transformFlags=n.transformFlags,a(i,n);let _=getIdentifierTypeArguments(n);return _&&setIdentifierTypeArguments(i,_),i}function Fc(n){let i=On(n.escapedText);return i.flags|=n.flags&-17,i.transformFlags=n.transformFlags,a(i,n),setIdentifierAutoGenerate(i,{...n.emitNode.autoGenerate}),i}function Vc(n){let i=On(n.escapedText);return i.flags|=n.flags&-17,i.transformFlags=n.transformFlags,a(i,n),i}function G_(n){if(n===void 0)return n;if(rh(n))return Aa(n);if(Ua(n))return tp(n);if(tt(n))return np(n);if(_1(n))return Fc(n);if(gi(n))return Vc(n);let i=ff(n.kind)?t.createBaseNode(n.kind):t.createBaseTokenNode(n.kind);i.flags|=n.flags&-17,i.transformFlags=n.transformFlags,a(i,n);for(let _ in n)Cr(i,_)||!Cr(n,_)||(i[_]=n[_]);return i}function rp(n,i,_){return Ci(i_(void 0,void 0,void 0,void 0,i?[i]:[],void 0,Rr(n,!0)),void 0,_?[_]:[])}function ip(n,i,_){return Ci(a_(void 0,void 0,i?[i]:[],void 0,void 0,Rr(n,!0)),void 0,_?[_]:[])}function si(){return __(V("0"))}function Wc(n){return ya(void 0,!1,n)}function ap(n){return ga(void 0,!1,E_([ba(!1,void 0,n)]))}function Y_(n,i){return i==="null"?ye.createStrictEquality(n,Jt()):i==="undefined"?ye.createStrictEquality(n,si()):ye.createStrictEquality(la(n),dt(i))}function _p(n,i){return i==="null"?ye.createStrictInequality(n,Jt()):i==="undefined"?ye.createStrictInequality(n,si()):ye.createStrictInequality(la(n),dt(i))}function zr(n,i,_){return Jd(n)?t_(Ei(n,void 0,i),void 0,void 0,_):Ci(cr(n,i),void 0,_)}function sp(n,i,_){return zr(n,"bind",[i,..._])}function op(n,i,_){return zr(n,"call",[i,..._])}function cp(n,i,_){return zr(n,"apply",[i,_])}function ji(n,i,_){return zr(Ge(n),i,_)}function Ri(n,i){return zr(n,"slice",i===void 0?[]:[pr(i)])}function lp(n,i){return zr(n,"concat",i)}function X_(n,i,_){return ji("Object","defineProperty",[n,pr(i),_])}function oi(n,i){return ji("Object","getOwnPropertyDescriptor",[n,pr(i)])}function Gc(n,i,_){return ji("Reflect","get",_?[n,i,_]:[n,i])}function up(n,i,_,c){return ji("Reflect","set",c?[n,i,_,c]:[n,i,_])}function ci(n,i,_){return _?(n.push(Ea(i,_)),!0):!1}function Yc(n,i){let _=[];ci(_,"enumerable",pr(n.enumerable)),ci(_,"configurable",pr(n.configurable));let c=ci(_,"writable",pr(n.writable));c=ci(_,"value",n.value)||c;let f=ci(_,"get",n.get);return f=ci(_,"set",n.set)||f,B.assert(!(c&&f),"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."),ki(_,!i)}function pp(n,i){switch(n.kind){case 217:return js(n,i);case 216:return Ls(n,n.type,i);case 234:return fa(n,i,n.type);case 238:return to(n,i,n.type);case 235:return eo(n,i);case 233:return Ks(n,i,n.typeArguments);case 355:return Bc(n,i)}}function fp(n){return Al(n)&&La(n)&&La(getSourceMapRange(n))&&La(getCommentRange(n))&&!Xt(getSyntheticLeadingComments(n))&&!Xt(getSyntheticTrailingComments(n))}function Xc(n,i,_=31){return n&&lh(n,_)&&!fp(n)?pp(n,Xc(n.expression,i)):i}function H_(n,i,_){if(!i)return n;let c=vo(i,i.label,Q1(i.statement)?H_(n,i.statement):n);return _&&_(i),c}function $_(n,i){let _=vf(n);switch(_.kind){case 80:return i;case 110:case 9:case 10:case 11:return!1;case 209:return _.elements.length!==0;case 210:return _.properties.length>0;default:return!0}}function Hc(n,i,_,c=!1){let f=Vf(n,31),w,F;return zd(f)?(w=Ut(),F=f):Ap(f)?(w=Ut(),F=_!==void 0&&_<2?yn(Ge("_super"),f):f):za(f)&8192?(w=si(),F=o().parenthesizeLeftSideOfAccess(f,!1)):Xr(f)?$_(f.expression,c)?(w=ir(i),F=cr(yn(ye.createAssignment(w,f.expression),f.expression),f.name),yn(F,f)):(w=f.expression,F=f):Xa(f)?$_(f.expression,c)?(w=ir(i),F=Ai(yn(ye.createAssignment(w,f.expression),f.expression),f.argumentExpression),yn(F,f)):(w=f.expression,F=f):(w=si(),F=o().parenthesizeLeftSideOfAccess(n,!1)),{target:F,thisArg:w}}function s(n,i){return cr(r_(ki([R(void 0,"value",[fr(void 0,void 0,n,void 0,void 0,void 0)],Rr([Pi(i)]))])),"value")}function p(n){return n.length>10?V_(n):dy(n,ye.createComma)}function d(n,i,_,c=0,f){let w=f?n&&lf(n):e1(n);if(w&&tt(w)&&!Ua(w)){let F=Sf(yn(G_(w),w),w.parent);return c|=za(w),_||(c|=96),i||(c|=3072),c&&setEmitFlags(F,c),F}return Bn(n)}function b(n,i,_){return d(n,i,_,98304)}function S(n,i,_,c){return d(n,i,_,32768,c)}function N(n,i,_){return d(n,i,_,16384)}function H(n,i,_){return d(n,i,_)}function _e(n,i,_,c){let f=cr(n,La(i)?i:G_(i));yn(f,i);let w=0;return c||(w|=96),_||(w|=3072),w&&setEmitFlags(f,w),f}function Z(n,i,_,c){return n&&bs(i,32)?_e(n,d(i),_,c):N(i,_,c)}function ee(n,i,_,c){let f=je(n,i,0,_);return Ae(n,i,f,c)}function ce(n){return Ya(n.expression)&&n.expression.text==="use strict"}function Le(){return v6(Pi(dt("use strict")))}function je(n,i,_=0,c){B.assert(i.length===0,"Prologue directives should be at the first statement in the target statements array");let f=!1,w=n.length;for(;_pe&&en.splice(f,0,...i.slice(pe,Re)),pe>F&&en.splice(c,0,...i.slice(F,pe)),F>w&&en.splice(_,0,...i.slice(w,F)),w>0)if(_===0)en.splice(0,0,...i.slice(0,w));else{let kn=new Map;for(let $n=0;$n<_;$n++){let Pa=n[$n];kn.set(Pa.expression.text,!0)}for(let $n=w-1;$n>=0;$n--){let Pa=i[$n];kn.has(Pa.expression.text)||en.unshift(Pa)}}return mi(n)?yn(de(en,n.hasTrailingComma),n):n}function Ln(n,i){let _;return typeof i=="number"?_=vn(i):_=i,Ef(n)?_r(n,_,n.name,n.constraint,n.default):ds(n)?dr(n,_,n.dotDotDotToken,n.name,n.questionToken,n.type,n.initializer):Nf(n)?Ve(n,_,n.typeParameters,n.parameters,n.type):I1(n)?Vn(n,_,n.name,n.questionToken,n.type):Va(n)?L(n,_,n.name,n.questionToken??n.exclamationToken,n.type,n.initializer):O1(n)?fe(n,_,n.name,n.questionToken,n.typeParameters,n.parameters,n.type):ms(n)?He(n,_,n.asteriskToken,n.name,n.questionToken,n.typeParameters,n.parameters,n.type,n.body):Af(n)?Ir(n,_,n.parameters,n.body):gl(n)?Wn(n,_,n.name,n.parameters,n.type,n.body):hs(n)?$(n,_,n.name,n.parameters,n.body):Cf(n)?Ze(n,_,n.parameters,n.type):Mf(n)?Rs(n,_,n.asteriskToken,n.name,n.typeParameters,n.parameters,n.type,n.body):Jf(n)?Us(n,_,n.typeParameters,n.parameters,n.type,n.equalsGreaterThanToken,n.body):bl(n)?c_(n,_,n.name,n.typeParameters,n.heritageClauses,n.members):Ha(n)?io(n,_,n.declarationList):jf(n)?T_(n,_,n.asteriskToken,n.name,n.typeParameters,n.parameters,n.type,n.body):Wa(n)?ha(n,_,n.name,n.typeParameters,n.heritageClauses,n.members):vs(n)?Co(n,_,n.name,n.typeParameters,n.heritageClauses,n.members):Dl(n)?gr(n,_,n.name,n.typeParameters,n.type):Z1(n)?br(n,_,n.name,n.members):Ti(n)?Et(n,_,n.name,n.body):Rf(n)?Mo(n,_,n.isTypeOnly,n.name,n.moduleReference):Uf(n)?Lo(n,_,n.importClause,n.moduleSpecifier,n.attributes):Bf(n)?Ii(n,_,n.expression):qf(n)?Xo(n,_,n.isTypeOnly,n.exportClause,n.moduleSpecifier,n.attributes):B.assertNever(n)}function Fr(n,i){return ds(n)?dr(n,i,n.dotDotDotToken,n.name,n.questionToken,n.type,n.initializer):Va(n)?L(n,i,n.name,n.questionToken??n.exclamationToken,n.type,n.initializer):ms(n)?He(n,i,n.asteriskToken,n.name,n.questionToken,n.typeParameters,n.parameters,n.type,n.body):gl(n)?Wn(n,i,n.name,n.parameters,n.type,n.body):hs(n)?$(n,i,n.name,n.parameters,n.body):bl(n)?c_(n,i,n.name,n.typeParameters,n.heritageClauses,n.members):Wa(n)?ha(n,i,n.name,n.typeParameters,n.heritageClauses,n.members):B.assertNever(n)}function dp(n,i){switch(n.kind){case 177:return Wn(n,n.modifiers,i,n.parameters,n.type,n.body);case 178:return $(n,n.modifiers,i,n.parameters,n.body);case 174:return He(n,n.modifiers,n.asteriskToken,i,n.questionToken,n.typeParameters,n.parameters,n.type,n.body);case 173:return fe(n,n.modifiers,i,n.questionToken,n.typeParameters,n.parameters,n.type);case 172:return L(n,n.modifiers,i,n.questionToken??n.exclamationToken,n.type,n.initializer);case 171:return Vn(n,n.modifiers,i,n.questionToken,n.type);case 303:return qr(n,i,n.initializer)}}function De(n){return n?de(n):void 0}function et(n){return typeof n=="string"?Ge(n):n}function pr(n){return typeof n=="string"?dt(n):typeof n=="number"?V(n):typeof n=="boolean"?n?lt():ar():n}function Da(n){return n&&o().parenthesizeExpressionForDisallowedComma(n)}function $c(n){return typeof n=="number"?ct(n):n}function It(n){return n&&e6(n)?yn(a(ao(),n),n):n}function xr(n){return typeof n=="string"||n&&!Lf(n)?ma(n,void 0,void 0,void 0):n}function q(n,i){return n!==i&&(a(n,i),yn(n,i)),n}}function il(e){switch(e){case 344:return"type";case 342:return"returns";case 343:return"this";case 340:return"enum";case 330:return"author";case 332:return"class";case 333:return"public";case 334:return"private";case 335:return"protected";case 336:return"readonly";case 337:return"override";case 345:return"template";case 346:return"typedef";case 341:return"param";case 348:return"prop";case 338:return"callback";case 339:return"overload";case 328:return"augments";case 329:return"implements";case 351:return"import";default:return B.fail(`Unsupported kind: ${B.formatSyntaxKind(e)}`)}}var En,Xd={};function Pb(e,t){switch(En||(En=sf(99,!1,0)),e){case 15:En.setText("`"+t+"`");break;case 16:En.setText("`"+t+"${");break;case 17:En.setText("}"+t+"${");break;case 18:En.setText("}"+t+"`");break}let a=En.scan();if(a===20&&(a=En.reScanTemplateToken(!1)),En.isUnterminated())return En.setText(void 0),Xd;let o;switch(a){case 15:case 16:case 17:case 18:o=En.getTokenValue();break}return o===void 0||En.scan()!==1?(En.setText(void 0),Xd):(En.setText(void 0),o)}function jn(e){return e&&tt(e)?ja(e):z(e)}function ja(e){return z(e)&-67108865}function Nb(e,t){return t|e.transformFlags&134234112}function z(e){if(!e)return 0;let t=e.transformFlags&~Ib(e.kind);return hg(e)&&s1(e.name)?Nb(e.name,t):t}function ke(e){return e?e.transformFlags:0}function Hd(e){let t=0;for(let a of e)t|=z(a);e.transformFlags=t}function Ib(e){if(e>=182&&e<=205)return-2;switch(e){case 213:case 214:case 209:return-2147450880;case 267:return-1941676032;case 169:return-2147483648;case 219:return-2072174592;case 218:case 262:return-1937940480;case 261:return-2146893824;case 263:case 231:return-2147344384;case 176:return-1937948672;case 172:return-2013249536;case 174:case 177:case 178:return-2005057536;case 133:case 150:case 163:case 146:case 154:case 151:case 136:case 155:case 116:case 168:case 171:case 173:case 179:case 180:case 181:case 264:case 265:return-2;case 210:return-2147278848;case 299:return-2147418112;case 206:case 207:return-2147450880;case 216:case 238:case 234:case 355:case 217:case 108:return-2147483648;case 211:case 212:return-2147483648;default:return-2147483648}}var Z_=Ab();function es(e){return e.flags|=16,e}var Ob={createBaseSourceFileNode:e=>es(Z_.createBaseSourceFileNode(e)),createBaseIdentifierNode:e=>es(Z_.createBaseIdentifierNode(e)),createBasePrivateIdentifierNode:e=>es(Z_.createBasePrivateIdentifierNode(e)),createBaseTokenNode:e=>es(Z_.createBaseTokenNode(e)),createBaseNode:e=>es(Z_.createBaseNode(e))},y3=wf(4,Ob);function Mb(e,t){if(e.original!==t&&(e.original=t,t)){let a=t.emitNode;a&&(e.emitNode=Jb(a,e.emitNode))}return e}function Jb(e,t){let{flags:a,internalFlags:o,leadingComments:m,trailingComments:v,commentRange:A,sourceMapRange:P,tokenSourceMapRanges:l,constantValue:Q,helpers:h,startsOnNewLine:y,snippetElement:g,classThis:x,assignedName:I}=e;if(t||(t={}),a&&(t.flags=a),o&&(t.internalFlags=o&-9),m&&(t.leadingComments=Dn(m.slice(),t.leadingComments)),v&&(t.trailingComments=Dn(v.slice(),t.trailingComments)),A&&(t.commentRange=A),P&&(t.sourceMapRange=P),l&&(t.tokenSourceMapRanges=Lb(l,t.tokenSourceMapRanges)),Q!==void 0&&(t.constantValue=Q),h)for(let re of h)t.helpers=oy(t.helpers,re);return y!==void 0&&(t.startsOnNewLine=y),g!==void 0&&(t.snippetElement=g),x&&(t.classThis=x),I&&(t.assignedName=I),t}function Lb(e,t){t||(t=[]);for(let a in e)t[a]=e[a];return t}function ta(e){return e.kind===9}function D1(e){return e.kind===10}function Ya(e){return e.kind===11}function P1(e){return e.kind===15}function jb(e){return e.kind===28}function $d(e){return e.kind===54}function Qd(e){return e.kind===58}function tt(e){return e.kind===80}function gi(e){return e.kind===81}function Rb(e){return e.kind===95}function al(e){return e.kind===134}function Ap(e){return e.kind===108}function Ub(e){return e.kind===102}function N1(e){return e.kind===166}function kf(e){return e.kind===167}function Ef(e){return e.kind===168}function ds(e){return e.kind===169}function El(e){return e.kind===170}function I1(e){return e.kind===171}function Va(e){return e.kind===172}function O1(e){return e.kind===173}function ms(e){return e.kind===174}function Af(e){return e.kind===176}function gl(e){return e.kind===177}function hs(e){return e.kind===178}function M1(e){return e.kind===179}function J1(e){return e.kind===180}function Cf(e){return e.kind===181}function L1(e){return e.kind===182}function Df(e){return e.kind===183}function Pf(e){return e.kind===184}function Nf(e){return e.kind===185}function Bb(e){return e.kind===186}function j1(e){return e.kind===187}function qb(e){return e.kind===188}function zb(e){return e.kind===189}function R1(e){return e.kind===202}function Fb(e){return e.kind===190}function Vb(e){return e.kind===191}function U1(e){return e.kind===192}function B1(e){return e.kind===193}function Wb(e){return e.kind===194}function Gb(e){return e.kind===195}function q1(e){return e.kind===196}function Yb(e){return e.kind===197}function z1(e){return e.kind===198}function Xb(e){return e.kind===199}function F1(e){return e.kind===200}function Hb(e){return e.kind===201}function $b(e){return e.kind===205}function V1(e){return e.kind===208}function W1(e){return e.kind===209}function If(e){return e.kind===210}function Xr(e){return e.kind===211}function Xa(e){return e.kind===212}function Of(e){return e.kind===213}function G1(e){return e.kind===215}function Al(e){return e.kind===217}function Mf(e){return e.kind===218}function Jf(e){return e.kind===219}function Qb(e){return e.kind===222}function Y1(e){return e.kind===224}function Zi(e){return e.kind===226}function X1(e){return e.kind===230}function bl(e){return e.kind===231}function H1(e){return e.kind===232}function $1(e){return e.kind===233}function cl(e){return e.kind===235}function Kb(e){return e.kind===236}function Zb(e){return e.kind===356}function Ha(e){return e.kind===243}function Cl(e){return e.kind===244}function Q1(e){return e.kind===256}function Lf(e){return e.kind===260}function K1(e){return e.kind===261}function jf(e){return e.kind===262}function Wa(e){return e.kind===263}function vs(e){return e.kind===264}function Dl(e){return e.kind===265}function Z1(e){return e.kind===266}function Ti(e){return e.kind===267}function Rf(e){return e.kind===271}function Uf(e){return e.kind===272}function Bf(e){return e.kind===277}function qf(e){return e.kind===278}function eh(e){return e.kind===279}function e6(e){return e.kind===353}function zf(e){return e.kind===283}function zp(e){return e.kind===286}function t6(e){return e.kind===289}function th(e){return e.kind===295}function n6(e){return e.kind===297}function nh(e){return e.kind===303}function rh(e){return e.kind===307}function ih(e){return e.kind===309}function ah(e){return e.kind===314}function _h(e){return e.kind===317}function sh(e){return e.kind===320}function r6(e){return e.kind===322}function Pl(e){return e.kind===323}function i6(e){return e.kind===328}function a6(e){return e.kind===333}function _6(e){return e.kind===334}function s6(e){return e.kind===335}function o6(e){return e.kind===336}function c6(e){return e.kind===337}function l6(e){return e.kind===339}function u6(e){return e.kind===331}function Fp(e){return e.kind===341}function p6(e){return e.kind===342}function Ff(e){return e.kind===344}function oh(e){return e.kind===345}function f6(e){return e.kind===329}function d6(e){return e.kind===350}var $i=new WeakMap;function ch(e,t){var a;let o=e.kind;return ff(o)?o===352?e._children:(a=$i.get(t))==null?void 0:a.get(e):bt}function m6(e,t,a){e.kind===352&&B.fail("Should not need to re-set the children of a SyntaxList.");let o=$i.get(t);return o===void 0&&(o=new WeakMap,$i.set(t,o)),o.set(e,a),a}function Kd(e,t){var a;e.kind===352&&B.fail("Did not expect to unset the children of a SyntaxList."),(a=$i.get(t))==null||a.delete(e)}function h6(e,t){let a=$i.get(e);a!==void 0&&($i.delete(e),$i.set(t,a))}function Zd(e){return(za(e)&32768)!==0}function y6(e){return Ya(e.expression)&&e.expression.text==="use strict"}function g6(e){for(let t of e)if(ol(t)){if(y6(t))return t}else break}function b6(e){return Al(e)&&ea(e)&&!!Pg(e)}function lh(e,t=31){switch(e.kind){case 217:return t&-2147483648&&b6(e)?!1:(t&1)!==0;case 216:case 234:case 238:return(t&2)!==0;case 233:return(t&16)!==0;case 235:return(t&4)!==0;case 355:return(t&8)!==0}return!1}function Vf(e,t=31){for(;lh(e,t);)e=e.expression;return e}function v6(e){return setStartsOnNewLine(e,!0)}function as(e){if(Gg(e))return e.name;if(Fg(e)){switch(e.kind){case 303:return as(e.initializer);case 304:return e.name;case 305:return as(e.expression)}return}return yl(e,!0)?as(e.left):X1(e)?as(e.expression):e}function T6(e){switch(e.kind){case 206:case 207:case 209:return e.elements;case 210:return e.properties}}function em(e){if(e){let t=e;for(;;){if(tt(t)||!t.body)return tt(t)?t:t.name;t=t.body}}}var tm;(e=>{function t(h,y,g,x,I,re,he){let ye=y>0?I[y-1]:void 0;return B.assertEqual(g[y],t),I[y]=h.onEnter(x[y],ye,he),g[y]=P(h,t),y}e.enter=t;function a(h,y,g,x,I,re,he){B.assertEqual(g[y],a),B.assertIsDefined(h.onLeft),g[y]=P(h,a);let ye=h.onLeft(x[y].left,I[y],x[y]);return ye?(Q(y,x,ye),l(y,g,x,I,ye)):y}e.left=a;function o(h,y,g,x,I,re,he){return B.assertEqual(g[y],o),B.assertIsDefined(h.onOperator),g[y]=P(h,o),h.onOperator(x[y].operatorToken,I[y],x[y]),y}e.operator=o;function m(h,y,g,x,I,re,he){B.assertEqual(g[y],m),B.assertIsDefined(h.onRight),g[y]=P(h,m);let ye=h.onRight(x[y].right,I[y],x[y]);return ye?(Q(y,x,ye),l(y,g,x,I,ye)):y}e.right=m;function v(h,y,g,x,I,re,he){B.assertEqual(g[y],v),g[y]=P(h,v);let ye=h.onExit(x[y],I[y]);if(y>0){if(y--,h.foldState){let de=g[y]===v?"right":"left";I[y]=h.foldState(I[y],ye,de)}}else re.value=ye;return y}e.exit=v;function A(h,y,g,x,I,re,he){return B.assertEqual(g[y],A),y}e.done=A;function P(h,y){switch(y){case t:if(h.onLeft)return a;case a:if(h.onOperator)return o;case o:if(h.onRight)return m;case m:return v;case v:return A;case A:return A;default:B.fail("Invalid state")}}e.nextState=P;function l(h,y,g,x,I){return h++,y[h]=t,g[h]=I,x[h]=void 0,h}function Q(h,y,g){if(B.shouldAssert(2))for(;h>=0;)B.assert(y[h]!==g,"Circular traversal detected."),h--}})(tm||(tm={}));function nm(e,t){return typeof e=="object"?Vp(!1,e.prefix,e.node,e.suffix,t):typeof e=="string"?e.length>0&&e.charCodeAt(0)===35?e.slice(1):e:""}function x6(e,t){return typeof e=="string"?e:S6(e,B.checkDefined(t))}function S6(e,t){return _1(e)?t(e).slice(1):Ua(e)?t(e):gi(e)?e.escapedText.slice(1):Pn(e)}function Vp(e,t,a,o,m){return t=nm(t,m),o=nm(o,m),a=x6(a,m),`${e?"#":""}${t}${a}${o}`}function uh(e){if(e.transformFlags&65536)return!0;if(e.transformFlags&128)for(let t of T6(e)){let a=as(t);if(a&&Wg(a)&&(a.transformFlags&65536||a.transformFlags&128&&uh(a)))return!0}return!1}function yn(e,t){return t?yi(e,t.pos,t.end):e}function Nl(e){let t=e.kind;return t===168||t===169||t===171||t===172||t===173||t===174||t===176||t===177||t===178||t===181||t===185||t===218||t===219||t===231||t===243||t===262||t===263||t===264||t===265||t===266||t===267||t===271||t===272||t===277||t===278}function Wf(e){let t=e.kind;return t===169||t===172||t===174||t===177||t===178||t===231||t===263}var rm,im,am,_m,sm,w6={createBaseSourceFileNode:e=>new(sm||(sm=At.getSourceFileConstructor()))(e,-1,-1),createBaseIdentifierNode:e=>new(am||(am=At.getIdentifierConstructor()))(e,-1,-1),createBasePrivateIdentifierNode:e=>new(_m||(_m=At.getPrivateIdentifierConstructor()))(e,-1,-1),createBaseTokenNode:e=>new(im||(im=At.getTokenConstructor()))(e,-1,-1),createBaseNode:e=>new(rm||(rm=At.getNodeConstructor()))(e,-1,-1)},g3=wf(1,w6);function k(e,t){return t&&e(t)}function ie(e,t,a){if(a){if(t)return t(a);for(let o of a){let m=e(o);if(m)return m}}}function k6(e,t){return e.charCodeAt(t+1)===42&&e.charCodeAt(t+2)===42&&e.charCodeAt(t+3)!==47}function E6(e){return Un(e.statements,A6)||C6(e)}function A6(e){return Nl(e)&&D6(e,95)||Rf(e)&&zf(e.moduleReference)||Uf(e)||Bf(e)||qf(e)?e:void 0}function C6(e){return e.flags&8388608?ph(e):void 0}function ph(e){return P6(e)?e:Ht(e,ph)}function D6(e,t){return Xt(e.modifiers,a=>a.kind===t)}function P6(e){return Kb(e)&&e.keywordToken===102&&e.name.escapedText==="meta"}var N6={166:function(t,a,o){return k(a,t.left)||k(a,t.right)},168:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.constraint)||k(a,t.default)||k(a,t.expression)},304:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||k(a,t.exclamationToken)||k(a,t.equalsToken)||k(a,t.objectAssignmentInitializer)},305:function(t,a,o){return k(a,t.expression)},169:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.dotDotDotToken)||k(a,t.name)||k(a,t.questionToken)||k(a,t.type)||k(a,t.initializer)},172:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||k(a,t.exclamationToken)||k(a,t.type)||k(a,t.initializer)},171:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||k(a,t.type)||k(a,t.initializer)},303:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||k(a,t.exclamationToken)||k(a,t.initializer)},260:function(t,a,o){return k(a,t.name)||k(a,t.exclamationToken)||k(a,t.type)||k(a,t.initializer)},208:function(t,a,o){return k(a,t.dotDotDotToken)||k(a,t.propertyName)||k(a,t.name)||k(a,t.initializer)},181:function(t,a,o){return ie(a,o,t.modifiers)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)},185:function(t,a,o){return ie(a,o,t.modifiers)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)},184:function(t,a,o){return ie(a,o,t.modifiers)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)},179:om,180:om,174:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.asteriskToken)||k(a,t.name)||k(a,t.questionToken)||k(a,t.exclamationToken)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},173:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.questionToken)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)},176:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},177:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},178:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},262:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.asteriskToken)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},218:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.asteriskToken)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.body)},219:function(t,a,o){return ie(a,o,t.modifiers)||ie(a,o,t.typeParameters)||ie(a,o,t.parameters)||k(a,t.type)||k(a,t.equalsGreaterThanToken)||k(a,t.body)},175:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.body)},183:function(t,a,o){return k(a,t.typeName)||ie(a,o,t.typeArguments)},182:function(t,a,o){return k(a,t.assertsModifier)||k(a,t.parameterName)||k(a,t.type)},186:function(t,a,o){return k(a,t.exprName)||ie(a,o,t.typeArguments)},187:function(t,a,o){return ie(a,o,t.members)},188:function(t,a,o){return k(a,t.elementType)},189:function(t,a,o){return ie(a,o,t.elements)},192:cm,193:cm,194:function(t,a,o){return k(a,t.checkType)||k(a,t.extendsType)||k(a,t.trueType)||k(a,t.falseType)},195:function(t,a,o){return k(a,t.typeParameter)},205:function(t,a,o){return k(a,t.argument)||k(a,t.attributes)||k(a,t.qualifier)||ie(a,o,t.typeArguments)},302:function(t,a,o){return k(a,t.assertClause)},196:lm,198:lm,199:function(t,a,o){return k(a,t.objectType)||k(a,t.indexType)},200:function(t,a,o){return k(a,t.readonlyToken)||k(a,t.typeParameter)||k(a,t.nameType)||k(a,t.questionToken)||k(a,t.type)||ie(a,o,t.members)},201:function(t,a,o){return k(a,t.literal)},202:function(t,a,o){return k(a,t.dotDotDotToken)||k(a,t.name)||k(a,t.questionToken)||k(a,t.type)},206:um,207:um,209:function(t,a,o){return ie(a,o,t.elements)},210:function(t,a,o){return ie(a,o,t.properties)},211:function(t,a,o){return k(a,t.expression)||k(a,t.questionDotToken)||k(a,t.name)},212:function(t,a,o){return k(a,t.expression)||k(a,t.questionDotToken)||k(a,t.argumentExpression)},213:pm,214:pm,215:function(t,a,o){return k(a,t.tag)||k(a,t.questionDotToken)||ie(a,o,t.typeArguments)||k(a,t.template)},216:function(t,a,o){return k(a,t.type)||k(a,t.expression)},217:function(t,a,o){return k(a,t.expression)},220:function(t,a,o){return k(a,t.expression)},221:function(t,a,o){return k(a,t.expression)},222:function(t,a,o){return k(a,t.expression)},224:function(t,a,o){return k(a,t.operand)},229:function(t,a,o){return k(a,t.asteriskToken)||k(a,t.expression)},223:function(t,a,o){return k(a,t.expression)},225:function(t,a,o){return k(a,t.operand)},226:function(t,a,o){return k(a,t.left)||k(a,t.operatorToken)||k(a,t.right)},234:function(t,a,o){return k(a,t.expression)||k(a,t.type)},235:function(t,a,o){return k(a,t.expression)},238:function(t,a,o){return k(a,t.expression)||k(a,t.type)},236:function(t,a,o){return k(a,t.name)},227:function(t,a,o){return k(a,t.condition)||k(a,t.questionToken)||k(a,t.whenTrue)||k(a,t.colonToken)||k(a,t.whenFalse)},230:function(t,a,o){return k(a,t.expression)},241:fm,268:fm,307:function(t,a,o){return ie(a,o,t.statements)||k(a,t.endOfFileToken)},243:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.declarationList)},261:function(t,a,o){return ie(a,o,t.declarations)},244:function(t,a,o){return k(a,t.expression)},245:function(t,a,o){return k(a,t.expression)||k(a,t.thenStatement)||k(a,t.elseStatement)},246:function(t,a,o){return k(a,t.statement)||k(a,t.expression)},247:function(t,a,o){return k(a,t.expression)||k(a,t.statement)},248:function(t,a,o){return k(a,t.initializer)||k(a,t.condition)||k(a,t.incrementor)||k(a,t.statement)},249:function(t,a,o){return k(a,t.initializer)||k(a,t.expression)||k(a,t.statement)},250:function(t,a,o){return k(a,t.awaitModifier)||k(a,t.initializer)||k(a,t.expression)||k(a,t.statement)},251:dm,252:dm,253:function(t,a,o){return k(a,t.expression)},254:function(t,a,o){return k(a,t.expression)||k(a,t.statement)},255:function(t,a,o){return k(a,t.expression)||k(a,t.caseBlock)},269:function(t,a,o){return ie(a,o,t.clauses)},296:function(t,a,o){return k(a,t.expression)||ie(a,o,t.statements)},297:function(t,a,o){return ie(a,o,t.statements)},256:function(t,a,o){return k(a,t.label)||k(a,t.statement)},257:function(t,a,o){return k(a,t.expression)},258:function(t,a,o){return k(a,t.tryBlock)||k(a,t.catchClause)||k(a,t.finallyBlock)},299:function(t,a,o){return k(a,t.variableDeclaration)||k(a,t.block)},170:function(t,a,o){return k(a,t.expression)},263:mm,231:mm,264:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||ie(a,o,t.heritageClauses)||ie(a,o,t.members)},265:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.typeParameters)||k(a,t.type)},266:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||ie(a,o,t.members)},306:function(t,a,o){return k(a,t.name)||k(a,t.initializer)},267:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.body)},271:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)||k(a,t.moduleReference)},272:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.importClause)||k(a,t.moduleSpecifier)||k(a,t.attributes)},273:function(t,a,o){return k(a,t.name)||k(a,t.namedBindings)},300:function(t,a,o){return ie(a,o,t.elements)},301:function(t,a,o){return k(a,t.name)||k(a,t.value)},270:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.name)},274:function(t,a,o){return k(a,t.name)},280:function(t,a,o){return k(a,t.name)},275:hm,279:hm,278:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.exportClause)||k(a,t.moduleSpecifier)||k(a,t.attributes)},276:ym,281:ym,277:function(t,a,o){return ie(a,o,t.modifiers)||k(a,t.expression)},228:function(t,a,o){return k(a,t.head)||ie(a,o,t.templateSpans)},239:function(t,a,o){return k(a,t.expression)||k(a,t.literal)},203:function(t,a,o){return k(a,t.head)||ie(a,o,t.templateSpans)},204:function(t,a,o){return k(a,t.type)||k(a,t.literal)},167:function(t,a,o){return k(a,t.expression)},298:function(t,a,o){return ie(a,o,t.types)},233:function(t,a,o){return k(a,t.expression)||ie(a,o,t.typeArguments)},283:function(t,a,o){return k(a,t.expression)},282:function(t,a,o){return ie(a,o,t.modifiers)},356:function(t,a,o){return ie(a,o,t.elements)},284:function(t,a,o){return k(a,t.openingElement)||ie(a,o,t.children)||k(a,t.closingElement)},288:function(t,a,o){return k(a,t.openingFragment)||ie(a,o,t.children)||k(a,t.closingFragment)},285:gm,286:gm,292:function(t,a,o){return ie(a,o,t.properties)},291:function(t,a,o){return k(a,t.name)||k(a,t.initializer)},293:function(t,a,o){return k(a,t.expression)},294:function(t,a,o){return k(a,t.dotDotDotToken)||k(a,t.expression)},287:function(t,a,o){return k(a,t.tagName)},295:function(t,a,o){return k(a,t.namespace)||k(a,t.name)},190:Fi,191:Fi,309:Fi,315:Fi,314:Fi,316:Fi,318:Fi,317:function(t,a,o){return ie(a,o,t.parameters)||k(a,t.type)},320:function(t,a,o){return(typeof t.comment=="string"?void 0:ie(a,o,t.comment))||ie(a,o,t.tags)},347:function(t,a,o){return k(a,t.tagName)||k(a,t.name)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},310:function(t,a,o){return k(a,t.name)},311:function(t,a,o){return k(a,t.left)||k(a,t.right)},341:bm,348:bm,330:function(t,a,o){return k(a,t.tagName)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},329:function(t,a,o){return k(a,t.tagName)||k(a,t.class)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},328:function(t,a,o){return k(a,t.tagName)||k(a,t.class)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},345:function(t,a,o){return k(a,t.tagName)||k(a,t.constraint)||ie(a,o,t.typeParameters)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},346:function(t,a,o){return k(a,t.tagName)||(t.typeExpression&&t.typeExpression.kind===309?k(a,t.typeExpression)||k(a,t.fullName)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment)):k(a,t.fullName)||k(a,t.typeExpression)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment)))},338:function(t,a,o){return k(a,t.tagName)||k(a,t.fullName)||k(a,t.typeExpression)||(typeof t.comment=="string"?void 0:ie(a,o,t.comment))},342:Vi,344:Vi,343:Vi,340:Vi,350:Vi,349:Vi,339:Vi,323:function(t,a,o){return Un(t.typeParameters,a)||Un(t.parameters,a)||k(a,t.type)},324:Cp,325:Cp,326:Cp,322:function(t,a,o){return Un(t.jsDocPropertyTags,a)},327:ui,332:ui,333:ui,334:ui,335:ui,336:ui,331:ui,337:ui,351:I6,355:O6};function om(e,t,a){return ie(t,a,e.typeParameters)||ie(t,a,e.parameters)||k(t,e.type)}function cm(e,t,a){return ie(t,a,e.types)}function lm(e,t,a){return k(t,e.type)}function um(e,t,a){return ie(t,a,e.elements)}function pm(e,t,a){return k(t,e.expression)||k(t,e.questionDotToken)||ie(t,a,e.typeArguments)||ie(t,a,e.arguments)}function fm(e,t,a){return ie(t,a,e.statements)}function dm(e,t,a){return k(t,e.label)}function mm(e,t,a){return ie(t,a,e.modifiers)||k(t,e.name)||ie(t,a,e.typeParameters)||ie(t,a,e.heritageClauses)||ie(t,a,e.members)}function hm(e,t,a){return ie(t,a,e.elements)}function ym(e,t,a){return k(t,e.propertyName)||k(t,e.name)}function gm(e,t,a){return k(t,e.tagName)||ie(t,a,e.typeArguments)||k(t,e.attributes)}function Fi(e,t,a){return k(t,e.type)}function bm(e,t,a){return k(t,e.tagName)||(e.isNameFirst?k(t,e.name)||k(t,e.typeExpression):k(t,e.typeExpression)||k(t,e.name))||(typeof e.comment=="string"?void 0:ie(t,a,e.comment))}function Vi(e,t,a){return k(t,e.tagName)||k(t,e.typeExpression)||(typeof e.comment=="string"?void 0:ie(t,a,e.comment))}function Cp(e,t,a){return k(t,e.name)}function ui(e,t,a){return k(t,e.tagName)||(typeof e.comment=="string"?void 0:ie(t,a,e.comment))}function I6(e,t,a){return k(t,e.tagName)||k(t,e.importClause)||k(t,e.moduleSpecifier)||k(t,e.attributes)||(typeof e.comment=="string"?void 0:ie(t,a,e.comment))}function O6(e,t,a){return k(t,e.expression)}function Ht(e,t,a){if(e===void 0||e.kind<=165)return;let o=N6[e.kind];return o===void 0?void 0:o(e,t,a)}function vm(e,t,a){let o=Tm(e),m=[];for(;m.length=0;--P)o.push(v[P]),m.push(A)}else{let P=t(v,A);if(P){if(P==="skip")continue;return P}if(v.kind>=166)for(let l of Tm(v))o.push(l),m.push(v)}}}function Tm(e){let t=[];return Ht(e,a,a),t;function a(o){t.unshift(o)}}function fh(e){e.externalModuleIndicator=E6(e)}function dh(e,t,a,o=!1,m){var v,A;(v=_l)==null||v.push(_l.Phase.Parse,"createSourceFile",{path:e},!0),kd("beforeParse");let P,{languageVersion:l,setExternalModuleIndicator:Q,impliedNodeFormat:h,jsDocParsingMode:y}=typeof a=="object"?a:{languageVersion:a};if(l===100)P=Qi.parseSourceFile(e,t,l,void 0,o,6,Fa,y);else{let g=h===void 0?Q:x=>(x.impliedNodeFormat=h,(Q||fh)(x));P=Qi.parseSourceFile(e,t,l,void 0,o,m,g,y)}return kd("afterParse"),Dy("Parse","beforeParse","afterParse"),(A=_l)==null||A.pop(),P}function mh(e){return e.externalModuleIndicator!==void 0}function M6(e,t,a,o=!1){let m=vl.updateSourceFile(e,t,a,o);return m.flags|=e.flags&12582912,m}var Qi;(e=>{var t=sf(99,!0),a=40960,o,m,v,A,P;function l(s){return ar++,s}var Q={createBaseSourceFileNode:s=>l(new P(s,0,0)),createBaseIdentifierNode:s=>l(new v(s,0,0)),createBasePrivateIdentifierNode:s=>l(new A(s,0,0)),createBaseTokenNode:s=>l(new m(s,0,0)),createBaseNode:s=>l(new o(s,0,0))},h=wf(11,Q),{createNodeArray:y,createNumericLiteral:g,createStringLiteral:x,createLiteralLikeNode:I,createIdentifier:re,createPrivateIdentifier:he,createToken:ye,createArrayLiteralExpression:de,createObjectLiteralExpression:M,createPropertyAccessExpression:ae,createPropertyAccessChain:Oe,createElementAccessExpression:V,createElementAccessChain:oe,createCallExpression:W,createCallChain:dt,createNewExpression:nr,createParenthesizedExpression:gn,createBlock:rr,createVariableStatement:bn,createExpressionStatement:In,createIfStatement:Ge,createWhileStatement:ir,createForStatement:Pr,createForOfStatement:Ot,createVariableDeclaration:Bn,createVariableDeclarationList:On}=h,Mt,vt,Qe,qn,$t,ct,_t,Ut,Jt,lt,ar,mt,vn,yt,cn,nt,Bt=!0,rn=!1;function _r(s,p,d,b,S=!1,N,H,_e=0){var Z;if(N=db(s,N),N===6){let ce=dr(s,p,d,b,S);return convertToJson(ce,(Z=ce.statements[0])==null?void 0:Z.expression,ce.parseDiagnostics,!1,void 0),ce.referencedFiles=bt,ce.typeReferenceDirectives=bt,ce.libReferenceDirectives=bt,ce.amdDependencies=bt,ce.hasNoDefaultLib=!1,ce.pragmas=ty,ce}zn(s,p,d,b,N,_e);let ee=Nr(d,S,N,H||fh,_e);return Fn(),ee}e.parseSourceFile=_r;function fr(s,p){zn("",s,p,void 0,1,0),U();let d=jr(!0),b=u()===1&&!_t.length;return Fn(),b?d:void 0}e.parseIsolatedEntityName=fr;function dr(s,p,d=2,b,S=!1){zn(s,p,d,b,6,0),vt=nt,U();let N=J(),H,_e;if(u()===1)H=Ct([],N,N),_e=Wt();else{let ce;for(;u()!==1;){let Ae;switch(u()){case 23:Ae=ac();break;case 112:case 97:case 106:Ae=Wt();break;case 41:G(()=>U()===9&&U()!==59)?Ae=Fo():Ae=I_();break;case 9:case 11:if(G(()=>U()!==59)){Ae=Xn();break}default:Ae=I_();break}ce&&Yr(ce)?ce.push(Ae):ce?ce=[ce,Ae]:(ce=Ae,u()!==1&&Ee(E.Unexpected_token))}let Le=Yr(ce)?D(de(ce),N):B.checkDefined(ce),je=In(Le);D(je,N),H=Ct([je],N),_e=Yn(1,E.Unexpected_token)}let Z=se(s,2,6,!1,H,_e,vt,Fa);S&&L(Z),Z.nodeCount=ar,Z.identifierCount=vn,Z.identifiers=mt,Z.parseDiagnostics=zi(_t,Z),Ut&&(Z.jsDocDiagnostics=zi(Ut,Z));let ee=Z;return Fn(),ee}e.parseJsonText=dr;function zn(s,p,d,b,S,N){switch(o=At.getNodeConstructor(),m=At.getTokenConstructor(),v=At.getIdentifierConstructor(),A=At.getPrivateIdentifierConstructor(),P=At.getSourceFileConstructor(),Mt=zy(s),Qe=p,qn=d,Jt=b,$t=S,ct=Wd(S),_t=[],yt=0,mt=new Map,vn=0,ar=0,vt=0,Bt=!0,$t){case 1:case 2:nt=524288;break;case 6:nt=134742016;break;default:nt=0;break}rn=!1,t.setText(Qe),t.setOnError(Zr),t.setScriptTarget(qn),t.setLanguageVariant(ct),t.setScriptKind($t),t.setJSDocParsingMode(N)}function Fn(){t.clearCommentDirectives(),t.setText(""),t.setOnError(void 0),t.setScriptKind(0),t.setJSDocParsingMode(0),Qe=void 0,qn=void 0,Jt=void 0,$t=void 0,ct=void 0,vt=0,_t=void 0,Ut=void 0,yt=0,mt=void 0,cn=void 0,Bt=!0}function Nr(s,p,d,b,S){let N=j6(Mt);N&&(nt|=33554432),vt=nt,U();let H=xn(0,Kt);B.assert(u()===1);let _e=qe(),Z=Ce(Wt(),_e),ee=se(Mt,s,d,N,H,Z,vt,b);return B6(ee,Qe),q6(ee,ce),ee.commentDirectives=t.getCommentDirectives(),ee.nodeCount=ar,ee.identifierCount=vn,ee.identifiers=mt,ee.parseDiagnostics=zi(_t,ee),ee.jsDocParsingMode=S,Ut&&(ee.jsDocDiagnostics=zi(Ut,ee)),p&&L(ee),ee;function ce(Le,je,Ae){_t.push(Oa(Mt,Qe,Le,je,Ae))}}let Vn=!1;function Ce(s,p){if(!p)return s;B.assert(!s.jsDoc);let d=ay(l2(s,Qe),b=>Hc.parseJSDocComment(s,b.pos,b.end-b.pos));return d.length&&(s.jsDoc=d),Vn&&(Vn=!1,s.flags|=536870912),s}function mr(s){let p=Jt,d=vl.createSyntaxCursor(s);Jt={currentNode:ce};let b=[],S=_t;_t=[];let N=0,H=Z(s.statements,0);for(;H!==-1;){let Le=s.statements[N],je=s.statements[H];Dn(b,s.statements,N,H),N=ee(s.statements,H);let Ae=gp(S,mn=>mn.start>=Le.pos),Yt=Ae>=0?gp(S,mn=>mn.start>=je.pos,Ae):-1;Ae>=0&&Dn(_t,S,Ae,Yt>=0?Yt:void 0),un(()=>{let mn=nt;for(nt|=65536,t.resetTokenState(je.pos),U();u()!==1;){let Zt=t.getTokenFullStart(),ur=n_(0,Kt);if(b.push(ur),Zt===t.getTokenFullStart()&&U(),N>=0){let Ln=s.statements[N];if(ur.end===Ln.pos)break;ur.end>Ln.pos&&(N=ee(s.statements,N+1))}}nt=mn},2),H=N>=0?Z(s.statements,N):-1}if(N>=0){let Le=s.statements[N];Dn(b,s.statements,N);let je=gp(S,Ae=>Ae.start>=Le.pos);je>=0&&Dn(_t,S,je)}return Jt=p,h.updateSourceFile(s,yn(y(b),s.statements));function _e(Le){return!(Le.flags&65536)&&!!(Le.transformFlags&67108864)}function Z(Le,je){for(let Ae=je;Ae118}function ve(){return u()===80?!0:u()===127&&we()||u()===135&&Ye()?!1:u()>118}function j(s,p,d=!0){return u()===s?(d&&U(),!0):(p?Ee(p):Ee(E._0_expected,it(s)),!1)}let ht=Object.keys(nf).filter(s=>s.length>2);function xt(s){if(G1(s)){rt(Ar(Qe,s.template.pos),s.template.end,E.Module_declaration_names_may_only_use_or_quoted_strings);return}let p=tt(s)?Pn(s):void 0;if(!p||!og(p,qn)){Ee(E._0_expected,it(27));return}let d=Ar(Qe,s.pos);switch(p){case"const":case"let":case"var":rt(d,s.end,E.Variable_declaration_not_allowed_at_this_location);return;case"declare":return;case"interface":Lt(E.Interface_name_cannot_be_0,E.Interface_must_be_given_a_name,19);return;case"is":rt(d,t.getTokenStart(),E.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);return;case"module":case"namespace":Lt(E.Namespace_name_cannot_be_0,E.Namespace_must_be_given_a_name,19);return;case"type":Lt(E.Type_alias_name_cannot_be_0,E.Type_alias_must_be_given_a_name,64);return}let b=ns(p,ht,gt)??pn(p);if(b){rt(d,s.end,E.Unknown_keyword_or_identifier_Did_you_mean_0,b);return}u()!==0&&rt(d,s.end,E.Unexpected_keyword_or_identifier)}function Lt(s,p,d){u()===d?Ee(p):Ee(s,t.getTokenValue())}function pn(s){for(let p of ht)if(s.length>p.length+2&&ul(s,p))return`${p} ${s.slice(p.length)}`}function Ul(s,p,d){if(u()===60&&!t.hasPrecedingLineBreak()){Ee(E.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);return}if(u()===21){Ee(E.Cannot_start_a_function_call_in_a_type_annotation),U();return}if(p&&!sr()){d?Ee(E._0_expected,it(27)):Ee(E.Expected_for_property_initializer);return}if(!aa()){if(d){Ee(E._0_expected,it(27));return}xt(s)}}function Es(s){return u()===s?(ze(),!0):(B.assert(xp(s)),Ee(E._0_expected,it(s)),!1)}function Or(s,p,d,b){if(u()===p){U();return}let S=Ee(E._0_expected,it(p));d&&S&&nl(S,Oa(Mt,Qe,b,1,E.The_parser_expected_to_find_a_1_to_match_the_0_token_here,it(s),it(p)))}function Je(s){return u()===s?(U(),!0):!1}function ft(s){if(u()===s)return Wt()}function Bl(s){if(u()===s)return zl()}function Yn(s,p,d){return ft(s)||Gt(s,!1,p||E._0_expected,d||it(s))}function ql(s){let p=Bl(s);return p||(B.assert(xp(s)),Gt(s,!1,E._0_expected,it(s)))}function Wt(){let s=J(),p=u();return U(),D(ye(p),s)}function zl(){let s=J(),p=u();return ze(),D(ye(p),s)}function sr(){return u()===27?!0:u()===20||u()===1||t.hasPrecedingLineBreak()}function aa(){return sr()?(u()===27&&U(),!0):!1}function Qt(){return aa()||j(27)}function Ct(s,p,d,b){let S=y(s,b);return yi(S,p,d??t.getTokenFullStart()),S}function D(s,p,d){return yi(s,p,d??t.getTokenFullStart()),nt&&(s.flags|=nt),rn&&(rn=!1,s.flags|=262144),s}function Gt(s,p,d,...b){p?Tn(t.getTokenFullStart(),0,d,...b):d&&Ee(d,...b);let S=J(),N=s===80?re("",void 0):Ld(s)?h.createTemplateLiteralLikeNode(s,"","",void 0):s===9?g("",void 0):s===11?x("",void 0):s===282?h.createMissingDeclaration():ye(s);return D(N,S)}function Mr(s){let p=mt.get(s);return p===void 0&&mt.set(s,p=s),p}function or(s,p,d){if(s){vn++;let _e=t.hasPrecedingJSDocLeadingAsterisks()?t.getTokenStart():J(),Z=u(),ee=Mr(t.getTokenValue()),ce=t.hasExtendedUnicodeEscape();return Ne(),D(re(ee,Z,ce),_e)}if(u()===81)return Ee(d||E.Private_identifiers_are_not_allowed_outside_class_bodies),or(!0);if(u()===0&&t.tryScan(()=>t.reScanInvalidIdentifier()===80))return or(!0);vn++;let b=u()===1,S=t.isReservedWord(),N=t.getTokenText(),H=S?E.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:E.Identifier_expected;return Gt(80,b,p||H,N)}function Ka(s){return or(Fe(),void 0,s)}function St(s,p){return or(ve(),s,p)}function jt(s){return or(wt(u()),s)}function ei(){return(t.hasUnicodeEscape()||t.hasExtendedUnicodeEscape())&&Ee(E.Unicode_escape_sequence_cannot_appear_here),or(wt(u()))}function yr(){return wt(u())||u()===11||u()===9||u()===10}function As(){return wt(u())||u()===11}function Fl(s){if(u()===11||u()===9||u()===10){let p=Xn();return p.text=Mr(p.text),p}return s&&u()===23?Vl():u()===81?_a():jt()}function Jr(){return Fl(!0)}function Vl(){let s=J();j(23);let p=ut(Et);return j(24),D(h.createComputedPropertyName(p),s)}function _a(){let s=J(),p=he(Mr(t.getTokenValue()));return U(),D(p,s)}function ti(s){return u()===s&&le(Cs)}function Za(){return U(),t.hasPrecedingLineBreak()?!1:cr()}function Cs(){switch(u()){case 87:return U()===94;case 95:return U(),u()===90?G(Ei):u()===156?G(Wl):ki();case 90:return Ei();case 126:return U(),cr();case 139:case 153:return U(),Gl();default:return Za()}}function ki(){return u()===60||u()!==42&&u()!==130&&u()!==19&&cr()}function Wl(){return U(),ki()}function Ds(){return Wr(u())&&le(Cs)}function cr(){return u()===23||u()===19||u()===42||u()===26||yr()}function Gl(){return u()===23||yr()}function Ei(){return U(),u()===86||u()===100||u()===120||u()===60||u()===128&&G(gc)||u()===134&&G(bc)}function sa(s,p){if(ca(s))return!0;switch(s){case 0:case 1:case 3:return!(u()===27&&p)&&vc();case 2:return u()===84||u()===90;case 4:return G(ao);case 5:return G(Vu)||u()===27&&!p;case 6:return u()===23||yr();case 12:switch(u()){case 23:case 42:case 26:case 25:return!0;default:return yr()}case 18:return yr();case 9:return u()===23||u()===26||yr();case 24:return As();case 7:return u()===19?G(Ps):p?ve()&&!e_():x_()&&!e_();case 8:return ka();case 10:return u()===28||u()===26||ka();case 19:return u()===103||u()===87||ve();case 15:switch(u()){case 28:case 25:return!0}case 11:return u()===26||br();case 16:return fa(!1);case 17:return fa(!0);case 20:case 21:return u()===28||ai();case 22:return Rc();case 23:return u()===161&&G(Ru)?!1:u()===11?!0:wt(u());case 13:return wt(u())||u()===19;case 14:return!0;case 25:return!0;case 26:return B.fail("ParsingContext.Count used as a context");default:B.assertNever(s,"Non-exhaustive case in 'isListElement'.")}}function Ps(){if(B.assert(u()===19),U()===20){let s=U();return s===28||s===19||s===96||s===119}return!0}function Ai(){return U(),ve()}function Yl(){return U(),wt(u())}function Ns(){return U(),Fy(u())}function e_(){return u()===119||u()===96?G(Is):!1}function Is(){return U(),br()}function Ci(){return U(),ai()}function oa(s){if(u()===1)return!0;switch(s){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return u()===20;case 3:return u()===20||u()===84||u()===90;case 7:return u()===19||u()===96||u()===119;case 8:return t_();case 19:return u()===32||u()===21||u()===19||u()===96||u()===119;case 11:return u()===22||u()===27;case 15:case 21:case 10:return u()===24;case 17:case 16:case 18:return u()===22||u()===24;case 20:return u()!==28;case 22:return u()===19||u()===20;case 13:return u()===32||u()===44;case 14:return u()===30&&G(G_);default:return!1}}function t_(){return!!(sr()||Uo(u())||u()===39)}function Os(){B.assert(yt,"Missing parsing context");for(let s=0;s<26;s++)if(yt&1<=0)}function __(s){return s===6?E.An_enum_member_name_must_be_followed_by_a_or:void 0}function lr(){let s=Ct([],J());return s.isMissingList=!0,s}function zs(s){return!!s.isMissingList}function Lr(s,p,d,b){if(j(d)){let S=fn(s,p);return j(b),S}return lr()}function jr(s,p){let d=J(),b=s?jt(p):St(p);for(;Je(25)&&u()!==30;)b=D(h.createQualifiedName(b,ni(s,!1,!0)),d);return b}function Xl(s,p){return D(h.createQualifiedName(s,p),s.pos)}function ni(s,p,d){if(t.hasPrecedingLineBreak()&&wt(u())&&G(M_))return Gt(80,!0,E.Identifier_expected);if(u()===81){let b=_a();return p?b:Gt(80,!0,E.Identifier_expected)}return s?d?jt():ei():St()}function Hl(s){let p=J(),d=[],b;do b=Gs(s),d.push(b);while(b.literal.kind===17);return Ct(d,p)}function ua(s){let p=J();return D(h.createTemplateExpression(Di(s),Hl(s)),p)}function Fs(){let s=J();return D(h.createTemplateLiteralType(Di(!1),$l()),s)}function $l(){let s=J(),p=[],d;do d=Vs(),p.push(d);while(d.literal.kind===17);return Ct(p,s)}function Vs(){let s=J();return D(h.createTemplateLiteralTypeSpan(ot(),Ws(!1)),s)}function Ws(s){return u()===20?(Pt(s),Ys()):Yn(18,E._0_expected,it(20))}function Gs(s){let p=J();return D(h.createTemplateSpan(ut(Et),Ws(s)),p)}function Xn(){return ri(u())}function Di(s){!s&&t.getTokenFlags()&26656&&Pt(!1);let p=ri(u());return B.assert(p.kind===16,"Template head has wrong token kind"),p}function Ys(){let s=ri(u());return B.assert(s.kind===17||s.kind===18,"Template fragment has wrong token kind"),s}function Ql(s){let p=s===15||s===18,d=t.getTokenText();return d.substring(1,d.length-(t.isUnterminated()?0:p?1:2))}function ri(s){let p=J(),d=Ld(s)?h.createTemplateLiteralLikeNode(s,t.getTokenValue(),Ql(s),t.getTokenFlags()&7176):s===9?g(t.getTokenValue(),t.getNumericLiteralFlags()):s===11?x(t.getTokenValue(),void 0,t.hasExtendedUnicodeEscape()):Jg(s)?I(s,t.getTokenValue()):B.fail();return t.hasExtendedUnicodeEscape()&&(d.hasExtendedUnicodeEscape=!0),t.isUnterminated()&&(d.isUnterminated=!0),U(),D(d,p)}function ii(){return jr(!0,E.Type_expected)}function Xs(){if(!t.hasPrecedingLineBreak()&&kt()===30)return Lr(20,ot,30,32)}function pa(){let s=J();return D(h.createTypeReferenceNode(ii(),Xs()),s)}function s_(s){switch(s.kind){case 183:return Hi(s.typeName);case 184:case 185:{let{parameters:p,type:d}=s;return zs(p)||s_(d)}case 196:return s_(s.type);default:return!1}}function Kl(s){return U(),D(h.createTypePredicateNode(void 0,s,ot()),s.pos)}function o_(){let s=J();return U(),D(h.createThisTypeNode(),s)}function Zl(){let s=J();return U(),D(h.createJSDocAllType(),s)}function Hs(){let s=J();return U(),D(h.createJSDocNonNullableType(b_(),!1),s)}function eu(){let s=J();return U(),u()===28||u()===20||u()===22||u()===32||u()===64||u()===52?D(h.createJSDocUnknownType(),s):D(h.createJSDocNullableType(ot(),!1),s)}function $s(){let s=J(),p=qe();if(le(Fc)){let d=Hn(36),b=Jn(59,!1);return Ce(D(h.createJSDocFunctionType(d,b),s),p)}return D(h.createTypeReferenceNode(jt(),void 0),s)}function c_(){let s=J(),p;return(u()===110||u()===105)&&(p=jt(),j(59)),D(h.createParameterDeclaration(void 0,void 0,p,void 0,l_(),void 0),s)}function l_(){t.setSkipJsDocLeadingAsterisks(!0);let s=J();if(Je(144)){let b=h.createJSDocNamepathType(void 0);e:for(;;)switch(u()){case 20:case 1:case 28:case 5:break e;default:ze()}return t.setSkipJsDocLeadingAsterisks(!1),D(b,s)}let p=Je(26),d=ha();return t.setSkipJsDocLeadingAsterisks(!1),p&&(d=D(h.createJSDocVariadicType(d),s)),u()===64?(U(),D(h.createJSDocOptionalType(d),s)):d}function Qs(){let s=J();j(114);let p=jr(!0),d=t.hasPrecedingLineBreak()?void 0:Ca();return D(h.createTypeQueryNode(p,d),s)}function Ks(){let s=J(),p=wn(!1,!0),d=St(),b,S;Je(96)&&(ai()||!br()?b=ot():S=Yo());let N=Je(64)?ot():void 0,H=h.createTypeParameterDeclaration(p,d,b,N);return H.expression=S,D(H,s)}function dn(){if(u()===30)return Lr(19,Ks,30,32)}function fa(s){return u()===26||ka()||Wr(u())||u()===60||ai(!s)}function Zs(s){let p=Li(E.Private_identifiers_cannot_be_used_as_parameters);return a2(p)===0&&!Xt(s)&&Wr(u())&&U(),p}function eo(){return Fe()||u()===23||u()===19}function u_(s){return p_(s)}function to(s){return p_(s,!1)}function p_(s,p=!0){let d=J(),b=qe(),S=s?R(()=>wn(!0)):$(()=>wn(!0));if(u()===110){let Z=h.createParameterDeclaration(S,void 0,or(!0),void 0,gr(),void 0),ee=Xp(S);return ee&&ln(ee,E.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters),Ce(D(Z,d),b)}let N=Bt;Bt=!1;let H=ft(26);if(!p&&!eo())return;let _e=Ce(D(h.createParameterDeclaration(S,H,Zs(S),ft(58),gr(),vr()),d),b);return Bt=N,_e}function Jn(s,p){if(no(s,p))return hr(ha)}function no(s,p){return s===39?(j(s),!0):Je(59)?!0:p&&u()===39?(Ee(E._0_expected,it(59)),U(),!0):!1}function f_(s,p){let d=we(),b=Ye();He(!!(s&1)),st(!!(s&2));let S=s&32?fn(17,c_):fn(16,()=>p?u_(b):to(b));return He(d),st(b),S}function Hn(s){if(!j(21))return lr();let p=f_(s,!0);return j(22),p}function da(){Je(28)||Qt()}function ro(s){let p=J(),d=qe();s===180&&j(105);let b=dn(),S=Hn(4),N=Jn(59,!0);da();let H=s===179?h.createCallSignature(b,S,N):h.createConstructSignature(b,S,N);return Ce(D(H,p),d)}function Rr(){return u()===23&&G(tu)}function tu(){if(U(),u()===26||u()===24)return!0;if(Wr(u())){if(U(),ve())return!0}else if(ve())U();else return!1;return u()===59||u()===28?!0:u()!==58?!1:(U(),u()===59||u()===28||u()===24)}function d_(s,p,d){let b=Lr(16,()=>u_(!1),23,24),S=gr();da();let N=h.createIndexSignature(d,b,S);return Ce(D(N,s),p)}function io(s,p,d){let b=Jr(),S=ft(58),N;if(u()===21||u()===30){let H=dn(),_e=Hn(4),Z=Jn(59,!0);N=h.createMethodSignature(d,b,S,H,_e,Z)}else{let H=gr();N=h.createPropertySignature(d,b,S,H),u()===64&&(N.initializer=vr())}return da(),Ce(D(N,s),p)}function ao(){if(u()===21||u()===30||u()===139||u()===153)return!0;let s=!1;for(;Wr(u());)s=!0,U();return u()===23?!0:(yr()&&(s=!0,U()),s?u()===21||u()===30||u()===58||u()===59||u()===28||sr():!1)}function Pi(){if(u()===21||u()===30)return ro(179);if(u()===105&&G(_o))return ro(180);let s=J(),p=qe(),d=wn(!1);return ti(139)?qr(s,p,d,177,4):ti(153)?qr(s,p,d,178,4):Rr()?d_(s,p,d):io(s,p,d)}function _o(){return U(),u()===21||u()===30}function so(){return U()===25}function oo(){switch(U()){case 21:case 30:case 25:return!0}return!1}function co(){let s=J();return D(h.createTypeLiteralNode(lo()),s)}function lo(){let s;return j(19)?(s=xn(4,Pi),j(20)):s=lr(),s}function uo(){return U(),u()===40||u()===41?U()===148:(u()===148&&U(),u()===23&&Ai()&&U()===103)}function nu(){let s=J(),p=jt();j(103);let d=ot();return D(h.createTypeParameterDeclaration(void 0,p,d,void 0),s)}function po(){let s=J();j(19);let p;(u()===148||u()===40||u()===41)&&(p=Wt(),p.kind!==148&&j(148)),j(23);let d=nu(),b=Je(130)?ot():void 0;j(24);let S;(u()===58||u()===40||u()===41)&&(S=Wt(),S.kind!==58&&j(58));let N=gr();Qt();let H=xn(4,Pi);return j(20),D(h.createMappedTypeNode(p,d,b,S,N,H),s)}function fo(){let s=J();if(Je(26))return D(h.createRestTypeNode(ot()),s);let p=ot();if(ah(p)&&p.pos===p.type.pos){let d=h.createOptionalTypeNode(p.type);return yn(d,p),d.flags=p.flags,d}return p}function m_(){return U()===59||u()===58&&U()===59}function ru(){return u()===26?wt(U())&&m_():wt(u())&&m_()}function mo(){if(G(ru)){let s=J(),p=qe(),d=ft(26),b=jt(),S=ft(58);j(59);let N=fo(),H=h.createNamedTupleMember(d,b,S,N);return Ce(D(H,s),p)}return fo()}function iu(){let s=J();return D(h.createTupleTypeNode(Lr(21,mo,23,24)),s)}function ho(){let s=J();j(21);let p=ot();return j(22),D(h.createParenthesizedType(p),s)}function au(){let s;if(u()===128){let p=J();U();let d=D(ye(128),p);s=Ct([d],p)}return s}function h_(){let s=J(),p=qe(),d=au(),b=Je(105);B.assert(!d||b,"Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");let S=dn(),N=Hn(4),H=Jn(39,!1),_e=b?h.createConstructorTypeNode(d,S,N,H):h.createFunctionTypeNode(S,N,H);return Ce(D(_e,s),p)}function yo(){let s=Wt();return u()===25?void 0:s}function y_(s){let p=J();s&&U();let d=u()===112||u()===97||u()===106?Wt():ri(u());return s&&(d=D(h.createPrefixUnaryExpression(41,d),p)),D(h.createLiteralTypeNode(d),p)}function _u(){return U(),u()===102}function g_(){vt|=4194304;let s=J(),p=Je(114);j(102),j(21);let d=ot(),b;if(Je(28)){let H=t.getTokenStart();j(19);let _e=u();if(_e===118||_e===132?U():Ee(E._0_expected,it(118)),j(59),b=Y_(_e,!0),!j(20)){let Z=Yi(_t);Z&&Z.code===E._0_expected.code&&nl(Z,Oa(Mt,Qe,H,1,E.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}}j(22);let S=Je(25)?ii():void 0,N=Xs();return D(h.createImportTypeNode(d,b,S,N,p),s)}function go(){return U(),u()===9||u()===10}function b_(){switch(u()){case 133:case 159:case 154:case 150:case 163:case 155:case 136:case 157:case 146:case 151:return le(yo)||pa();case 67:t.reScanAsteriskEqualsToken();case 42:return Zl();case 61:t.reScanQuestionToken();case 58:return eu();case 100:return $s();case 54:return Hs();case 15:case 11:case 9:case 10:case 112:case 97:case 106:return y_();case 41:return G(go)?y_(!0):pa();case 116:return Wt();case 110:{let s=o_();return u()===142&&!t.hasPrecedingLineBreak()?Kl(s):s}case 114:return G(_u)?g_():Qs();case 19:return G(uo)?po():co();case 23:return iu();case 21:return ho();case 102:return g_();case 131:return G(M_)?Co():pa();case 16:return Fs();default:return pa()}}function ai(s){switch(u()){case 133:case 159:case 154:case 150:case 163:case 136:case 148:case 155:case 158:case 116:case 157:case 106:case 110:case 114:case 146:case 19:case 23:case 30:case 52:case 51:case 105:case 11:case 9:case 10:case 112:case 97:case 151:case 42:case 58:case 54:case 26:case 140:case 102:case 131:case 15:case 16:return!0;case 100:return!s;case 41:return!s&&G(go);case 21:return!s&&G(bo);default:return ve()}}function bo(){return U(),u()===22||fa(!1)||ai()}function vo(){let s=J(),p=b_();for(;!t.hasPrecedingLineBreak();)switch(u()){case 54:U(),p=D(h.createJSDocNonNullableType(p,!0),s);break;case 58:if(G(Ci))return p;U(),p=D(h.createJSDocNullableType(p,!0),s);break;case 23:if(j(23),ai()){let d=ot();j(24),p=D(h.createIndexedAccessTypeNode(p,d),s)}else j(24),p=D(h.createArrayTypeNode(p),s);break;default:return p}return p}function To(s){let p=J();return j(s),D(h.createTypeOperatorNode(s,So()),p)}function su(){if(Je(96)){let s=Mn(ot);if(We()||u()!==58)return s}}function xo(){let s=J(),p=St(),d=le(su),b=h.createTypeParameterDeclaration(void 0,p,d);return D(b,s)}function ou(){let s=J();return j(140),D(h.createInferTypeNode(xo()),s)}function So(){let s=u();switch(s){case 143:case 158:case 148:return To(s);case 140:return ou()}return hr(vo)}function ma(s){if(T_()){let p=h_(),d;return Pf(p)?d=s?E.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:E.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:d=s?E.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:E.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type,ln(p,d),p}}function wo(s,p,d){let b=J(),S=s===52,N=Je(s),H=N&&ma(S)||p();if(u()===s||N){let _e=[H];for(;Je(s);)_e.push(ma(S)||p());H=D(d(Ct(_e,b)),b)}return H}function v_(){return wo(51,So,h.createIntersectionTypeNode)}function cu(){return wo(52,v_,h.createUnionTypeNode)}function ko(){return U(),u()===105}function T_(){return u()===30||u()===21&&G(Eo)?!0:u()===105||u()===128&&G(ko)}function lu(){if(Wr(u())&&wn(!1),ve()||u()===110)return U(),!0;if(u()===23||u()===19){let s=_t.length;return Li(),s===_t.length}return!1}function Eo(){return U(),!!(u()===22||u()===26||lu()&&(u()===59||u()===28||u()===58||u()===64||u()===22&&(U(),u()===39)))}function ha(){let s=J(),p=ve()&&le(Ao),d=ot();return p?D(h.createTypePredicateNode(void 0,p,d),s):d}function Ao(){let s=St();if(u()===142&&!t.hasPrecedingLineBreak())return U(),s}function Co(){let s=J(),p=Yn(131),d=u()===110?o_():St(),b=Je(142)?ot():void 0;return D(h.createTypePredicateNode(p,d,b),s)}function ot(){if(nt&81920)return Dt(81920,ot);if(T_())return h_();let s=J(),p=cu();if(!We()&&!t.hasPrecedingLineBreak()&&Je(96)){let d=Mn(ot);j(58);let b=hr(ot);j(59);let S=hr(ot);return D(h.createConditionalTypeNode(p,d,b,S),s)}return p}function gr(){return Je(59)?ot():void 0}function x_(){switch(u()){case 110:case 108:case 106:case 112:case 97:case 9:case 10:case 11:case 15:case 16:case 21:case 23:case 19:case 100:case 86:case 105:case 44:case 69:case 80:return!0;case 102:return G(oo);default:return ve()}}function br(){if(x_())return!0;switch(u()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 46:case 47:case 30:case 135:case 127:case 81:case 60:return!0;default:return Bo()?!0:ve()}}function Do(){return u()!==19&&u()!==100&&u()!==86&&u()!==60&&br()}function Et(){let s=Ze();s&&Ke(!1);let p=J(),d=zt(!0),b;for(;b=ft(28);)d=k_(d,b,zt(!0),p);return s&&Ke(!0),d}function vr(){return Je(64)?zt(!0):void 0}function zt(s){if(Po())return No();let p=pu(s)||Lo(s);if(p)return p;let d=J(),b=qe(),S=Ni(0);return S.kind===80&&u()===39?Io(d,S,s,b,void 0):qa(S)&&S1(Ve())?k_(S,Wt(),zt(s),d):fu(S,d,s)}function Po(){return u()===127?we()?!0:G(J_):!1}function uu(){return U(),!t.hasPrecedingLineBreak()&&ve()}function No(){let s=J();return U(),!t.hasPrecedingLineBreak()&&(u()===42||br())?D(h.createYieldExpression(ft(42),zt(!0)),s):D(h.createYieldExpression(void 0,void 0),s)}function Io(s,p,d,b,S){B.assert(u()===39,"parseSimpleArrowFunctionExpression should only have been called if we had a =>");let N=h.createParameterDeclaration(void 0,void 0,p,void 0,void 0,void 0);D(N,p.pos);let H=Ct([N],N.pos,N.end),_e=Yn(39),Z=S_(!!S,d),ee=h.createArrowFunction(S,void 0,H,void 0,_e,Z);return Ce(D(ee,s),b)}function pu(s){let p=Oo();if(p!==0)return p===1?Ro(!0,!0):le(()=>Jo(s))}function Oo(){return u()===21||u()===30||u()===134?G(Mo):u()===39?1:0}function Mo(){if(u()===134&&(U(),t.hasPrecedingLineBreak()||u()!==21&&u()!==30))return 0;let s=u(),p=U();if(s===21){if(p===22)switch(U()){case 39:case 59:case 19:return 1;default:return 0}if(p===23||p===19)return 2;if(p===26)return 1;if(Wr(p)&&p!==134&&G(Ai))return U()===130?0:1;if(!ve()&&p!==110)return 0;switch(U()){case 59:return 1;case 58:return U(),u()===59||u()===28||u()===64||u()===22?1:0;case 28:case 64:case 22:return 2}return 0}else return B.assert(s===30),!ve()&&u()!==87?0:ct===1?G(()=>{Je(87);let b=U();if(b===96)switch(U()){case 64:case 32:case 44:return!1;default:return!0}else if(b===28||b===64)return!0;return!1})?1:0:2}function Jo(s){let p=t.getTokenStart();if(cn!=null&&cn.has(p))return;let d=Ro(!1,s);return d||(cn||(cn=new Set)).add(p),d}function Lo(s){if(u()===134&&G(jo)===1){let p=J(),d=qe(),b=Jc(),S=Ni(0);return Io(p,S,s,d,b)}}function jo(){if(u()===134){if(U(),t.hasPrecedingLineBreak()||u()===39)return 0;let s=Ni(0);if(!t.hasPrecedingLineBreak()&&s.kind===80&&u()===39)return 1}return 0}function Ro(s,p){let d=J(),b=qe(),S=Jc(),N=Xt(S,al)?2:0,H=dn(),_e;if(j(21)){if(s)_e=f_(N,s);else{let Zt=f_(N,s);if(!Zt)return;_e=Zt}if(!j(22)&&!s)return}else{if(!s)return;_e=lr()}let Z=u()===59,ee=Jn(59,!1);if(ee&&!s&&s_(ee))return;let ce=ee;for(;(ce==null?void 0:ce.kind)===196;)ce=ce.type;let Le=ce&&_h(ce);if(!s&&u()!==39&&(Le||u()!==19))return;let je=u(),Ae=Yn(39),Yt=je===39||je===19?S_(Xt(S,al),p):St();if(!p&&Z&&u()!==59)return;let mn=h.createArrowFunction(S,H,_e,ee,Ae,Yt);return Ce(D(mn,d),b)}function S_(s,p){if(u()===19)return Ta(s?2:0);if(u()!==27&&u()!==100&&u()!==86&&vc()&&!Do())return Ta(16|(s?2:0));let d=Bt;Bt=!1;let b=s?R(()=>zt(p)):$(()=>zt(p));return Bt=d,b}function fu(s,p,d){let b=ft(58);if(!b)return s;let S;return D(h.createConditionalExpression(s,b,Dt(a,()=>zt(!1)),S=Yn(59),Rp(S)?zt(d):Gt(80,!1,E._0_expected,it(59))),p)}function Ni(s){let p=J(),d=Yo();return w_(s,d,p)}function Uo(s){return s===103||s===165}function w_(s,p,d){for(;;){Ve();let b=Sp(u());if(!(u()===43?b>=s:b>s)||u()===103&&be())break;if(u()===130||u()===152){if(t.hasPrecedingLineBreak())break;{let N=u();U(),p=N===152?qo(p,ot()):zo(p,ot())}}else p=k_(p,Wt(),Ni(b),d)}return p}function Bo(){return be()&&u()===103?!1:Sp(u())>0}function qo(s,p){return D(h.createSatisfiesExpression(s,p),s.pos)}function k_(s,p,d,b){return D(h.createBinaryExpression(s,p,d),b)}function zo(s,p){return D(h.createAsExpression(s,p),s.pos)}function Fo(){let s=J();return D(h.createPrefixUnaryExpression(u(),Me(Tr)),s)}function Vo(){let s=J();return D(h.createDeleteExpression(Me(Tr)),s)}function du(){let s=J();return D(h.createTypeOfExpression(Me(Tr)),s)}function Wo(){let s=J();return D(h.createVoidExpression(Me(Tr)),s)}function mu(){return u()===135?Ye()?!0:G(J_):!1}function Go(){let s=J();return D(h.createAwaitExpression(Me(Tr)),s)}function Yo(){if(hu()){let d=J(),b=ya();return u()===43?w_(Sp(u()),b,d):b}let s=u(),p=Tr();if(u()===43){let d=Ar(Qe,p.pos),{end:b}=p;p.kind===216?rt(d,b,E.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):(B.assert(xp(s)),rt(d,b,E.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,it(s)))}return p}function Tr(){switch(u()){case 40:case 41:case 55:case 54:return Fo();case 91:return Vo();case 114:return du();case 116:return Wo();case 30:return ct===1?Oi(!0,void 0,void 0,!0):Ko();case 135:if(mu())return Go();default:return ya()}}function hu(){switch(u()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 135:return!1;case 30:if(ct!==1)return!1;default:return!0}}function ya(){if(u()===46||u()===47){let p=J();return D(h.createPrefixUnaryExpression(u(),Me(Ii)),p)}else if(ct===1&&u()===30&&G(Ns))return Oi(!0);let s=Ii();if(B.assert(qa(s)),(u()===46||u()===47)&&!t.hasPrecedingLineBreak()){let p=u();return U(),D(h.createPostfixUnaryExpression(s,p),s.pos)}return s}function Ii(){let s=J(),p;return u()===102?G(_o)?(vt|=4194304,p=Wt()):G(so)?(U(),U(),p=D(h.createMetaProperty(102,jt()),s),vt|=8388608):p=ga():p=u()===108?Xo():ga(),P_(s,p)}function ga(){let s=J(),p=N_();return _n(s,p,!0)}function Xo(){let s=J(),p=Wt();if(u()===30){let d=J(),b=le(va);b!==void 0&&(rt(d,J(),E.super_may_not_use_type_arguments),Sn()||(p=h.createExpressionWithTypeArguments(p,b)))}return u()===21||u()===25||u()===23?p:(Yn(25,E.super_must_be_followed_by_an_argument_list_or_member_access),D(ae(p,ni(!0,!0,!0)),s))}function Oi(s,p,d,b=!1){let S=J(),N=bu(s),H;if(N.kind===286){let _e=ba(N),Z,ee=_e[_e.length-1];if((ee==null?void 0:ee.kind)===284&&!pi(ee.openingElement.tagName,ee.closingElement.tagName)&&pi(N.tagName,ee.closingElement.tagName)){let ce=ee.children.end,Le=D(h.createJsxElement(ee.openingElement,ee.children,D(h.createJsxClosingElement(D(re(""),ce,ce)),ce,ce)),ee.openingElement.pos,ce);_e=Ct([..._e.slice(0,_e.length-1),Le],_e.pos,ce),Z=ee.closingElement}else Z=Qo(N,s),pi(N.tagName,Z.tagName)||(d&&zp(d)&&pi(Z.tagName,d.tagName)?ln(N.tagName,E.JSX_element_0_has_no_corresponding_closing_tag,is(Qe,N.tagName)):ln(Z.tagName,E.Expected_corresponding_JSX_closing_tag_for_0,is(Qe,N.tagName)));H=D(h.createJsxElement(N,_e,Z),S)}else N.kind===289?H=D(h.createJsxFragment(N,ba(N),Su(s)),S):(B.assert(N.kind===285),H=N);if(!b&&s&&u()===30){let _e=typeof p>"u"?H.pos:p,Z=le(()=>Oi(!0,_e));if(Z){let ee=Gt(28,!1);return Yd(ee,Z.pos,0),rt(Ar(Qe,_e),Z.end,E.JSX_expressions_must_have_one_parent_element),D(h.createBinaryExpression(H,ee,Z),S)}}return H}function E_(){let s=J(),p=h.createJsxText(t.getTokenValue(),lt===13);return lt=t.scanJsxToken(),D(p,s)}function yu(s,p){switch(p){case 1:if(t6(s))ln(s,E.JSX_fragment_has_no_corresponding_closing_tag);else{let d=s.tagName,b=Math.min(Ar(Qe,d.pos),d.end);rt(b,d.end,E.JSX_element_0_has_no_corresponding_closing_tag,is(Qe,s.tagName))}return;case 31:case 7:return;case 12:case 13:return E_();case 19:return Ho(!1);case 30:return Oi(!1,void 0,s);default:return B.assertNever(p)}}function ba(s){let p=[],d=J(),b=yt;for(yt|=16384;;){let S=yu(s,lt=t.reScanJsxToken());if(!S||(p.push(S),zp(s)&&(S==null?void 0:S.kind)===284&&!pi(S.openingElement.tagName,S.closingElement.tagName)&&pi(s.tagName,S.closingElement.tagName)))break}return yt=b,Ct(p,d)}function gu(){let s=J();return D(h.createJsxAttributes(xn(13,$o)),s)}function bu(s){let p=J();if(j(30),u()===32)return Gn(),D(h.createJsxOpeningFragment(),p);let d=A_(),b=(nt&524288)===0?Ca():void 0,S=gu(),N;return u()===32?(Gn(),N=h.createJsxOpeningElement(d,b,S)):(j(44),j(32,void 0,!1)&&(s?U():Gn()),N=h.createJsxSelfClosingElement(d,b,S)),D(N,p)}function A_(){let s=J(),p=vu();if(th(p))return p;let d=p;for(;Je(25);)d=D(ae(d,ni(!0,!1,!1)),s);return d}function vu(){let s=J();qt();let p=u()===110,d=ei();return Je(59)?(qt(),D(h.createJsxNamespacedName(d,ei()),s)):p?D(h.createToken(110),s):d}function Ho(s){let p=J();if(!j(19))return;let d,b;return u()!==20&&(s||(d=ft(26)),b=Et()),s?j(20):j(20,void 0,!1)&&Gn(),D(h.createJsxExpression(d,b),p)}function $o(){if(u()===19)return xu();let s=J();return D(h.createJsxAttribute(Tu(),C_()),s)}function C_(){if(u()===64){if(wi()===11)return Xn();if(u()===19)return Ho(!0);if(u()===30)return Oi(!0);Ee(E.or_JSX_element_expected)}}function Tu(){let s=J();qt();let p=ei();return Je(59)?(qt(),D(h.createJsxNamespacedName(p,ei()),s)):p}function xu(){let s=J();j(19),j(26);let p=Et();return j(20),D(h.createJsxSpreadAttribute(p),s)}function Qo(s,p){let d=J();j(31);let b=A_();return j(32,void 0,!1)&&(p||!pi(s.tagName,b)?U():Gn()),D(h.createJsxClosingElement(b),d)}function Su(s){let p=J();return j(31),j(32,E.Expected_corresponding_closing_tag_for_JSX_fragment,!1)&&(s?U():Gn()),D(h.createJsxJsxClosingFragment(),p)}function Ko(){B.assert(ct!==1,"Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments.");let s=J();j(30);let p=ot();j(32);let d=Tr();return D(h.createTypeAssertion(p,d),s)}function wu(){return U(),wt(u())||u()===23||Sn()}function Zo(){return u()===29&&G(wu)}function D_(s){if(s.flags&64)return!0;if(cl(s)){let p=s.expression;for(;cl(p)&&!(p.flags&64);)p=p.expression;if(p.flags&64){for(;cl(s);)s.flags|=64,s=s.expression;return!0}}return!1}function ec(s,p,d){let b=ni(!0,!0,!0),S=d||D_(p),N=S?Oe(p,d,b):ae(p,b);if(S&&gi(N.name)&&ln(N.name,E.An_optional_chain_cannot_contain_private_identifiers),$1(p)&&p.typeArguments){let H=p.typeArguments.pos-1,_e=Ar(Qe,p.typeArguments.end)+1;rt(H,_e,E.An_instantiation_expression_cannot_be_followed_by_a_property_access)}return D(N,s)}function ku(s,p,d){let b;if(u()===24)b=Gt(80,!0,E.An_element_access_expression_should_take_an_argument);else{let N=ut(Et);kl(N)&&(N.text=Mr(N.text)),b=N}j(24);let S=d||D_(p)?oe(p,d,b):V(p,b);return D(S,s)}function _n(s,p,d){for(;;){let b,S=!1;if(d&&Zo()?(b=Yn(29),S=wt(u())):S=Je(25),S){p=ec(s,p,b);continue}if((b||!Ze())&&Je(23)){p=ku(s,p,b);continue}if(Sn()){p=!b&&p.kind===233?Ur(s,p.expression,b,p.typeArguments):Ur(s,p,b,void 0);continue}if(!b){if(u()===54&&!t.hasPrecedingLineBreak()){U(),p=D(h.createNonNullExpression(p),s);continue}let N=le(va);if(N){p=D(h.createExpressionWithTypeArguments(p,N),s);continue}}return p}}function Sn(){return u()===15||u()===16}function Ur(s,p,d,b){let S=h.createTaggedTemplateExpression(p,b,u()===15?(Pt(!0),Xn()):ua(!0));return(d||p.flags&64)&&(S.flags|=64),S.questionDotToken=d,D(S,s)}function P_(s,p){for(;;){p=_n(s,p,!0);let d,b=ft(29);if(b&&(d=le(va),Sn())){p=Ur(s,p,b,d);continue}if(d||u()===21){!b&&p.kind===233&&(d=p.typeArguments,p=p.expression);let S=tc(),N=b||D_(p)?dt(p,b,d,S):W(p,d,S);p=D(N,s);continue}if(b){let S=Gt(80,!1,E.Identifier_expected);p=D(Oe(p,b,S),s)}break}return p}function tc(){j(21);let s=fn(11,ic);return j(22),s}function va(){if((nt&524288)!==0||kt()!==30)return;U();let s=fn(20,ot);if(Ve()===32)return U(),s&&Eu()?s:void 0}function Eu(){switch(u()){case 21:case 15:case 16:return!0;case 30:case 32:case 40:case 41:return!1}return t.hasPrecedingLineBreak()||Bo()||!br()}function N_(){switch(u()){case 15:t.getTokenFlags()&26656&&Pt(!1);case 9:case 10:case 11:return Xn();case 110:case 108:case 106:case 112:case 97:return Wt();case 21:return Au();case 23:return ac();case 19:return I_();case 134:if(!G(bc))break;return O_();case 60:return Lc();case 86:return Xu();case 100:return O_();case 105:return sc();case 44:case 69:if($e()===14)return Xn();break;case 16:return ua(!1);case 81:return _a()}return St(E.Expression_expected)}function Au(){let s=J(),p=qe();j(21);let d=ut(Et);return j(22),Ce(D(gn(d),s),p)}function nc(){let s=J();j(26);let p=zt(!0);return D(h.createSpreadElement(p),s)}function rc(){return u()===26?nc():u()===28?D(h.createOmittedExpression(),J()):zt(!0)}function ic(){return Dt(a,rc)}function ac(){let s=J(),p=t.getTokenStart(),d=j(23),b=t.hasPrecedingLineBreak(),S=fn(15,rc);return Or(23,24,d,p),D(de(S,b),s)}function _c(){let s=J(),p=qe();if(ft(26)){let ce=zt(!0);return Ce(D(h.createSpreadAssignment(ce),s),p)}let d=wn(!0);if(ti(139))return qr(s,p,d,177,0);if(ti(153))return qr(s,p,d,178,0);let b=ft(42),S=ve(),N=Jr(),H=ft(58),_e=ft(54);if(b||u()===21||u()===30)return q_(s,p,d,b,N,H,_e);let Z;if(S&&u()!==59){let ce=ft(64),Le=ce?ut(()=>zt(!0)):void 0;Z=h.createShorthandPropertyAssignment(N,Le),Z.equalsToken=ce}else{j(59);let ce=ut(()=>zt(!0));Z=h.createPropertyAssignment(N,ce)}return Z.modifiers=d,Z.questionToken=H,Z.exclamationToken=_e,Ce(D(Z,s),p)}function I_(){let s=J(),p=t.getTokenStart(),d=j(19),b=t.hasPrecedingLineBreak(),S=fn(12,_c,!0);return Or(19,20,d,p),D(M(S,b),s)}function O_(){let s=Ze();Ke(!1);let p=J(),d=qe(),b=wn(!1);j(100);let S=ft(42),N=S?1:0,H=Xt(b,al)?2:0,_e=N&&H?K(Mi):N?Wn(Mi):H?R(Mi):Mi(),Z=dn(),ee=Hn(N|H),ce=Jn(59,!1),Le=Ta(N|H);Ke(s);let je=h.createFunctionExpression(b,S,_e,Z,ee,ce,Le);return Ce(D(je,p),d)}function Mi(){return Fe()?Ka():void 0}function sc(){let s=J();if(j(105),Je(25)){let N=jt();return D(h.createMetaProperty(105,N),s)}let p=J(),d=_n(p,N_(),!1),b;d.kind===233&&(b=d.typeArguments,d=d.expression),u()===29&&Ee(E.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0,is(Qe,d));let S=u()===21?tc():void 0;return D(nr(d,b,S),s)}function Br(s,p){let d=J(),b=qe(),S=t.getTokenStart(),N=j(19,p);if(N||s){let H=t.hasPrecedingLineBreak(),_e=xn(1,Kt);Or(19,20,N,S);let Z=Ce(D(rr(_e,H),d),b);return u()===64&&(Ee(E.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses),U()),Z}else{let H=lr();return Ce(D(rr(H,void 0),d),b)}}function Ta(s,p){let d=we();He(!!(s&1));let b=Ye();st(!!(s&2));let S=Bt;Bt=!1;let N=Ze();N&&Ke(!1);let H=Br(!!(s&16),p);return N&&Ke(!0),Bt=S,He(d),st(b),H}function oc(){let s=J(),p=qe();return j(27),Ce(D(h.createEmptyStatement(),s),p)}function Cu(){let s=J(),p=qe();j(101);let d=t.getTokenStart(),b=j(21),S=ut(Et);Or(21,22,b,d);let N=Kt(),H=Je(93)?Kt():void 0;return Ce(D(Ge(S,N,H),s),p)}function cc(){let s=J(),p=qe();j(92);let d=Kt();j(117);let b=t.getTokenStart(),S=j(21),N=ut(Et);return Or(21,22,S,b),Je(27),Ce(D(h.createDoStatement(d,N),s),p)}function Du(){let s=J(),p=qe();j(117);let d=t.getTokenStart(),b=j(21),S=ut(Et);Or(21,22,b,d);let N=Kt();return Ce(D(ir(S,N),s),p)}function lc(){let s=J(),p=qe();j(99);let d=ft(135);j(21);let b;u()!==27&&(u()===115||u()===121||u()===87||u()===160&&G(xc)||u()===135&&G(Sc)?b=B_(!0):b=Ir(Et));let S;if(d?j(165):Je(165)){let N=ut(()=>zt(!0));j(22),S=Ot(d,b,N,Kt())}else if(Je(103)){let N=ut(Et);j(22),S=h.createForInStatement(b,N,Kt())}else{j(27);let N=u()!==27&&u()!==22?ut(Et):void 0;j(27);let H=u()!==22?ut(Et):void 0;j(22),S=Pr(b,N,H,Kt())}return Ce(D(S,s),p)}function uc(s){let p=J(),d=qe();j(s===252?83:88);let b=sr()?void 0:St();Qt();let S=s===252?h.createBreakStatement(b):h.createContinueStatement(b);return Ce(D(S,p),d)}function pc(){let s=J(),p=qe();j(107);let d=sr()?void 0:ut(Et);return Qt(),Ce(D(h.createReturnStatement(d),s),p)}function Pu(){let s=J(),p=qe();j(118);let d=t.getTokenStart(),b=j(21),S=ut(Et);Or(21,22,b,d);let N=Tt(67108864,Kt);return Ce(D(h.createWithStatement(S,N),s),p)}function fc(){let s=J(),p=qe();j(84);let d=ut(Et);j(59);let b=xn(3,Kt);return Ce(D(h.createCaseClause(d,b),s),p)}function Nu(){let s=J();j(90),j(59);let p=xn(3,Kt);return D(h.createDefaultClause(p),s)}function Iu(){return u()===84?fc():Nu()}function dc(){let s=J();j(19);let p=xn(2,Iu);return j(20),D(h.createCaseBlock(p),s)}function Ou(){let s=J(),p=qe();j(109),j(21);let d=ut(Et);j(22);let b=dc();return Ce(D(h.createSwitchStatement(d,b),s),p)}function mc(){let s=J(),p=qe();j(111);let d=t.hasPrecedingLineBreak()?void 0:ut(Et);return d===void 0&&(vn++,d=D(re(""),J())),aa()||xt(d),Ce(D(h.createThrowStatement(d),s),p)}function Mu(){let s=J(),p=qe();j(113);let d=Br(!1),b=u()===85?hc():void 0,S;return(!b||u()===98)&&(j(98,E.catch_or_finally_expected),S=Br(!1)),Ce(D(h.createTryStatement(d,b,S),s),p)}function hc(){let s=J();j(85);let p;Je(21)?(p=U_(),j(22)):p=void 0;let d=Br(!1);return D(h.createCatchClause(p,d),s)}function Ju(){let s=J(),p=qe();return j(89),Qt(),Ce(D(h.createDebuggerStatement(),s),p)}function yc(){let s=J(),p=qe(),d,b=u()===21,S=ut(Et);return tt(S)&&Je(59)?d=h.createLabeledStatement(S,Kt()):(aa()||xt(S),d=In(S),b&&(p=!1)),Ce(D(d,s),p)}function M_(){return U(),wt(u())&&!t.hasPrecedingLineBreak()}function gc(){return U(),u()===86&&!t.hasPrecedingLineBreak()}function bc(){return U(),u()===100&&!t.hasPrecedingLineBreak()}function J_(){return U(),(wt(u())||u()===9||u()===10||u()===11)&&!t.hasPrecedingLineBreak()}function Lu(){for(;;)switch(u()){case 115:case 121:case 87:case 100:case 86:case 94:return!0;case 160:return j_();case 135:return xa();case 120:case 156:return uu();case 144:case 145:return Ec();case 128:case 129:case 134:case 138:case 123:case 124:case 125:case 148:let s=u();if(U(),t.hasPrecedingLineBreak())return!1;if(s===138&&u()===156)return!0;continue;case 162:return U(),u()===19||u()===80||u()===95;case 102:return U(),u()===11||u()===42||u()===19||wt(u());case 95:let p=U();if(p===156&&(p=G(U)),p===64||p===42||p===19||p===90||p===130||p===60)return!0;continue;case 126:U();continue;default:return!1}}function Ji(){return G(Lu)}function vc(){switch(u()){case 60:case 27:case 19:case 115:case 121:case 160:case 100:case 86:case 94:case 101:case 92:case 117:case 99:case 88:case 83:case 107:case 118:case 109:case 111:case 113:case 89:case 85:case 98:return!0;case 102:return Ji()||G(oo);case 87:case 95:return Ji();case 134:case 138:case 120:case 144:case 145:case 156:case 162:return!0;case 129:case 125:case 123:case 124:case 126:case 148:return Ji()||!G(M_);default:return br()}}function Tc(){return U(),Fe()||u()===19||u()===23}function ju(){return G(Tc)}function xc(){return L_(!0)}function L_(s){return U(),s&&u()===165?!1:(Fe()||u()===19)&&!t.hasPrecedingLineBreak()}function j_(){return G(L_)}function Sc(s){return U()===160?L_(s):!1}function xa(){return G(Sc)}function Kt(){switch(u()){case 27:return oc();case 19:return Br(!1);case 115:return _i(J(),qe(),void 0);case 121:if(ju())return _i(J(),qe(),void 0);break;case 135:if(xa())return _i(J(),qe(),void 0);break;case 160:if(j_())return _i(J(),qe(),void 0);break;case 100:return Pc(J(),qe(),void 0);case 86:return jc(J(),qe(),void 0);case 101:return Cu();case 92:return cc();case 117:return Du();case 99:return lc();case 88:return uc(251);case 83:return uc(252);case 107:return pc();case 118:return Pu();case 109:return Ou();case 111:return mc();case 113:case 85:case 98:return Mu();case 89:return Ju();case 60:return wc();case 134:case 120:case 156:case 144:case 145:case 138:case 87:case 94:case 95:case 102:case 123:case 124:case 125:case 128:case 129:case 126:case 148:case 162:if(Ji())return wc();break}return yc()}function R_(s){return s.kind===138}function wc(){let s=J(),p=qe(),d=wn(!0);if(Xt(d,R_)){let S=Sa(s);if(S)return S;for(let N of d)N.flags|=33554432;return Tt(33554432,()=>kc(s,p,d))}else return kc(s,p,d)}function Sa(s){return Tt(33554432,()=>{let p=ca(yt,s);if(p)return Ms(p)})}function kc(s,p,d){switch(u()){case 115:case 121:case 87:case 160:case 135:return _i(s,p,d);case 100:return Pc(s,p,d);case 86:return jc(s,p,d);case 120:return Bc(s,p,d);case 156:return Zu(s,p,d);case 94:return V_(s,p,d);case 162:case 144:case 145:return tp(s,p,d);case 102:return ip(s,p,d);case 95:switch(U(),u()){case 90:case 64:return Xc(s,p,d);case 130:return rp(s,p,d);default:return fp(s,p,d)}default:if(d){let b=Gt(282,!0,E.Declaration_expected);return Bp(b,s),b.modifiers=d,b}return}}function Ru(){return U()===11}function Uu(){return U(),u()===161||u()===64}function Ec(){return U(),!t.hasPrecedingLineBreak()&&(ve()||u()===11)}function wa(s,p){if(u()!==19){if(s&4){da();return}if(sr()){Qt();return}}return Ta(s,p)}function Ac(){let s=J();if(u()===28)return D(h.createOmittedExpression(),s);let p=ft(26),d=Li(),b=vr();return D(h.createBindingElement(p,void 0,d,b),s)}function Bu(){let s=J(),p=ft(26),d=Fe(),b=Jr(),S;d&&u()!==59?(S=b,b=void 0):(j(59),S=Li());let N=vr();return D(h.createBindingElement(p,b,S,N),s)}function Cc(){let s=J();j(19);let p=ut(()=>fn(9,Bu));return j(20),D(h.createObjectBindingPattern(p),s)}function qu(){let s=J();j(23);let p=ut(()=>fn(10,Ac));return j(24),D(h.createArrayBindingPattern(p),s)}function ka(){return u()===19||u()===23||u()===81||Fe()}function Li(s){return u()===23?qu():u()===19?Cc():Ka(s)}function Dc(){return U_(!0)}function U_(s){let p=J(),d=qe(),b=Li(E.Private_identifiers_are_not_allowed_in_variable_declarations),S;s&&b.kind===80&&u()===54&&!t.hasPrecedingLineBreak()&&(S=Wt());let N=gr(),H=Uo(u())?void 0:vr(),_e=Bn(b,S,N,H);return Ce(D(_e,p),d)}function B_(s){let p=J(),d=0;switch(u()){case 115:break;case 121:d|=1;break;case 87:d|=2;break;case 160:d|=4;break;case 135:B.assert(xa()),d|=6,U();break;default:B.fail()}U();let b;if(u()===165&&G(zu))b=lr();else{let S=be();Te(s),b=fn(8,s?U_:Dc),Te(S)}return D(On(b,d),p)}function zu(){return Ai()&&U()===22}function _i(s,p,d){let b=B_(!1);Qt();let S=bn(d,b);return Ce(D(S,s),p)}function Pc(s,p,d){let b=Ye(),S=Rn(d);j(100);let N=ft(42),H=S&2048?Mi():Ka(),_e=N?1:0,Z=S&1024?2:0,ee=dn();S&32&&st(!0);let ce=Hn(_e|Z),Le=Jn(59,!1),je=wa(_e|Z,E.or_expected);st(b);let Ae=h.createFunctionDeclaration(d,N,H,ee,ce,Le,je);return Ce(D(Ae,s),p)}function Nc(){if(u()===137)return j(137);if(u()===11&&G(U)===21)return le(()=>{let s=Xn();return s.text==="constructor"?s:void 0})}function Fu(s,p,d){return le(()=>{if(Nc()){let b=dn(),S=Hn(0),N=Jn(59,!1),H=wa(0,E.or_expected),_e=h.createConstructorDeclaration(d,S,H);return _e.typeParameters=b,_e.type=N,Ce(D(_e,s),p)}})}function q_(s,p,d,b,S,N,H,_e){let Z=b?1:0,ee=Xt(d,al)?2:0,ce=dn(),Le=Hn(Z|ee),je=Jn(59,!1),Ae=wa(Z|ee,_e),Yt=h.createMethodDeclaration(d,b,S,N,ce,Le,je,Ae);return Yt.exclamationToken=H,Ce(D(Yt,s),p)}function Ic(s,p,d,b,S){let N=!S&&!t.hasPrecedingLineBreak()?ft(54):void 0,H=gr(),_e=Dt(90112,vr);Ul(b,H,_e);let Z=h.createPropertyDeclaration(d,b,S||N,H,_e);return Ce(D(Z,s),p)}function Ea(s,p,d){let b=ft(42),S=Jr(),N=ft(58);return b||u()===21||u()===30?q_(s,p,d,b,S,N,void 0,E.or_expected):Ic(s,p,d,S,N)}function qr(s,p,d,b,S){let N=Jr(),H=dn(),_e=Hn(0),Z=Jn(59,!1),ee=wa(S),ce=b===177?h.createGetAccessorDeclaration(d,N,_e,Z,ee):h.createSetAccessorDeclaration(d,N,_e,ee);return ce.typeParameters=H,hs(ce)&&(ce.type=Z),Ce(D(ce,s),p)}function Vu(){let s;if(u()===60)return!0;for(;Wr(u());){if(s=u(),Rg(s))return!0;U()}if(u()===42||(yr()&&(s=u(),U()),u()===23))return!0;if(s!==void 0){if(!di(s)||s===153||s===139)return!0;switch(u()){case 21:case 30:case 54:case 59:case 64:case 58:return!0;default:return sr()}}return!1}function Oc(s,p,d){Yn(126);let b=Wu(),S=Ce(D(h.createClassStaticBlockDeclaration(b),s),p);return S.modifiers=d,S}function Wu(){let s=we(),p=Ye();He(!1),st(!0);let d=Br(!1);return He(s),st(p),d}function Gu(){if(Ye()&&u()===135){let s=J(),p=St(E.Expression_expected);U();let d=_n(s,p,!0);return P_(s,d)}return Ii()}function z_(){let s=J();if(!Je(60))return;let p=Si(Gu);return D(h.createDecorator(p),s)}function Mc(s,p,d){let b=J(),S=u();if(u()===87&&p){if(!le(Za))return}else{if(d&&u()===126&&G(Vc))return;if(s&&u()===126)return;if(!Ds())return}return D(ye(S),b)}function wn(s,p,d){let b=J(),S,N,H,_e=!1,Z=!1,ee=!1;if(s&&u()===60)for(;N=z_();)S=An(S,N);for(;H=Mc(_e,p,d);)H.kind===126&&(_e=!0),S=An(S,H),Z=!0;if(Z&&s&&u()===60)for(;N=z_();)S=An(S,N),ee=!0;if(ee)for(;H=Mc(_e,p,d);)H.kind===126&&(_e=!0),S=An(S,H);return S&&Ct(S,b)}function Jc(){let s;if(u()===134){let p=J();U();let d=D(ye(134),p);s=Ct([d],p)}return s}function Yu(){let s=J(),p=qe();if(u()===27)return U(),Ce(D(h.createSemicolonClassElement(),s),p);let d=wn(!0,!0,!0);if(u()===126&&G(Vc))return Oc(s,p,d);if(ti(139))return qr(s,p,d,177,0);if(ti(153))return qr(s,p,d,178,0);if(u()===137||u()===11){let b=Fu(s,p,d);if(b)return b}if(Rr())return d_(s,p,d);if(wt(u())||u()===11||u()===9||u()===10||u()===42||u()===23)if(Xt(d,R_)){for(let S of d)S.flags|=33554432;return Tt(33554432,()=>Ea(s,p,d))}else return Ea(s,p,d);if(d){let b=Gt(80,!0,E.Declaration_expected);return Ic(s,p,d,b,void 0)}return B.fail("Should not have attempted to parse class member declaration.")}function Lc(){let s=J(),p=qe(),d=wn(!0);if(u()===86)return Aa(s,p,d,231);let b=Gt(282,!0,E.Expression_expected);return Bp(b,s),b.modifiers=d,b}function Xu(){return Aa(J(),qe(),void 0,231)}function jc(s,p,d){return Aa(s,p,d,263)}function Aa(s,p,d,b){let S=Ye();j(86);let N=Hu(),H=dn();Xt(d,Rb)&&st(!0);let _e=F_(),Z;j(19)?(Z=Uc(),j(20)):Z=lr(),st(S);let ee=b===263?h.createClassDeclaration(d,N,H,_e,Z):h.createClassExpression(d,N,H,_e,Z);return Ce(D(ee,s),p)}function Hu(){return Fe()&&!$u()?or(Fe()):void 0}function $u(){return u()===119&&G(Yl)}function F_(){if(Rc())return xn(22,Qu)}function Qu(){let s=J(),p=u();B.assert(p===96||p===119),U();let d=fn(7,Ku);return D(h.createHeritageClause(p,d),s)}function Ku(){let s=J(),p=Ii();if(p.kind===233)return p;let d=Ca();return D(h.createExpressionWithTypeArguments(p,d),s)}function Ca(){return u()===30?Lr(20,ot,30,32):void 0}function Rc(){return u()===96||u()===119}function Uc(){return xn(5,Yu)}function Bc(s,p,d){j(120);let b=St(),S=dn(),N=F_(),H=lo(),_e=h.createInterfaceDeclaration(d,b,S,N,H);return Ce(D(_e,s),p)}function Zu(s,p,d){j(156),t.hasPrecedingLineBreak()&&Ee(E.Line_break_not_permitted_here);let b=St(),S=dn();j(64);let N=u()===141&&le(yo)||ot();Qt();let H=h.createTypeAliasDeclaration(d,b,S,N);return Ce(D(H,s),p)}function ep(){let s=J(),p=qe(),d=Jr(),b=ut(vr);return Ce(D(h.createEnumMember(d,b),s),p)}function V_(s,p,d){j(94);let b=St(),S;j(19)?(S=xe(()=>fn(6,ep)),j(20)):S=lr();let N=h.createEnumDeclaration(d,b,S);return Ce(D(N,s),p)}function qc(){let s=J(),p;return j(19)?(p=xn(1,Kt),j(20)):p=lr(),D(h.createModuleBlock(p),s)}function W_(s,p,d,b){let S=b&32,N=b&8?jt():St(),H=Je(25)?W_(J(),!1,void 0,8|S):qc(),_e=h.createModuleDeclaration(d,N,H,b);return Ce(D(_e,s),p)}function zc(s,p,d){let b=0,S;u()===162?(S=St(),b|=2048):(S=Xn(),S.text=Mr(S.text));let N;u()===19?N=qc():Qt();let H=h.createModuleDeclaration(d,S,N,b);return Ce(D(H,s),p)}function tp(s,p,d){let b=0;if(u()===162)return zc(s,p,d);if(Je(145))b|=32;else if(j(144),u()===11)return zc(s,p,d);return W_(s,p,d,b)}function np(){return u()===149&&G(Fc)}function Fc(){return U()===21}function Vc(){return U()===19}function G_(){return U()===44}function rp(s,p,d){j(130),j(145);let b=St();Qt();let S=h.createNamespaceExportDeclaration(b);return S.modifiers=d,Ce(D(S,s),p)}function ip(s,p,d){j(102);let b=t.getTokenFullStart(),S;ve()&&(S=St());let N=!1;if((S==null?void 0:S.escapedText)==="type"&&(u()!==161||ve()&&G(Uu))&&(ve()||_p())&&(N=!0,S=ve()?St():void 0),S&&!zr())return sp(s,p,d,S,N);let H=si(S,b,N),_e=Ri(),Z=Wc();Qt();let ee=h.createImportDeclaration(d,H,_e,Z);return Ce(D(ee,s),p)}function si(s,p,d,b=!1){let S;return(s||u()===42||u()===19)&&(S=op(s,p,d,b),j(161)),S}function Wc(){let s=u();if((s===118||s===132)&&!t.hasPrecedingLineBreak())return Y_(s)}function ap(){let s=J(),p=wt(u())?jt():ri(11);j(59);let d=zt(!0);return D(h.createImportAttribute(p,d),s)}function Y_(s,p){let d=J();p||j(s);let b=t.getTokenStart();if(j(19)){let S=t.hasPrecedingLineBreak(),N=fn(24,ap,!0);if(!j(20)){let H=Yi(_t);H&&H.code===E._0_expected.code&&nl(H,Oa(Mt,Qe,b,1,E.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}return D(h.createImportAttributes(N,S,s),d)}else{let S=Ct([],J(),void 0,!1);return D(h.createImportAttributes(S,!1,s),d)}}function _p(){return u()===42||u()===19}function zr(){return u()===28||u()===161}function sp(s,p,d,b,S){j(64);let N=cp();Qt();let H=h.createImportEqualsDeclaration(d,S,b,N);return Ce(D(H,s),p)}function op(s,p,d,b){let S;return(!s||Je(28))&&(b&&t.setSkipJsDocLeadingAsterisks(!0),S=u()===42?lp():Gc(275),b&&t.setSkipJsDocLeadingAsterisks(!1)),D(h.createImportClause(d,s,S),p)}function cp(){return np()?ji():jr(!1)}function ji(){let s=J();j(149),j(21);let p=Ri();return j(22),D(h.createExternalModuleReference(p),s)}function Ri(){if(u()===11){let s=Xn();return s.text=Mr(s.text),s}else return Et()}function lp(){let s=J();j(42),j(130);let p=St();return D(h.createNamespaceImport(p),s)}function X_(){return wt(u())||u()===11}function oi(s){return u()===11?Xn():s()}function Gc(s){let p=J(),d=s===275?h.createNamedImports(Lr(23,ci,19,20)):h.createNamedExports(Lr(23,up,19,20));return D(d,p)}function up(){let s=qe();return Ce(Yc(281),s)}function ci(){return Yc(276)}function Yc(s){let p=J(),d=di(u())&&!ve(),b=t.getTokenStart(),S=t.getTokenEnd(),N=!1,H,_e=!0,Z=oi(jt);if(Z.kind===80&&Z.escapedText==="type")if(u()===130){let Le=jt();if(u()===130){let je=jt();X_()?(N=!0,H=Le,Z=oi(ce),_e=!1):(H=Z,Z=je,_e=!1)}else X_()?(H=Z,_e=!1,Z=oi(ce)):(N=!0,Z=Le)}else X_()&&(N=!0,Z=oi(ce));_e&&u()===130&&(H=Z,j(130),Z=oi(ce)),s===276&&(Z.kind!==80?(rt(Ar(Qe,Z.pos),Z.end,E.Identifier_expected),Z=yi(Gt(80,!1),Z.pos,Z.pos)):d&&rt(b,S,E.Identifier_expected));let ee=s===276?h.createImportSpecifier(N,H,Z):h.createExportSpecifier(N,H,Z);return D(ee,p);function ce(){return d=di(u())&&!ve(),b=t.getTokenStart(),S=t.getTokenEnd(),jt()}}function pp(s){return D(h.createNamespaceExport(oi(jt)),s)}function fp(s,p,d){let b=Ye();st(!0);let S,N,H,_e=Je(156),Z=J();Je(42)?(Je(130)&&(S=pp(Z)),j(161),N=Ri()):(S=Gc(279),(u()===161||u()===11&&!t.hasPrecedingLineBreak())&&(j(161),N=Ri()));let ee=u();N&&(ee===118||ee===132)&&!t.hasPrecedingLineBreak()&&(H=Y_(ee)),Qt(),st(b);let ce=h.createExportDeclaration(d,_e,S,N,H);return Ce(D(ce,s),p)}function Xc(s,p,d){let b=Ye();st(!0);let S;Je(64)?S=!0:j(90);let N=zt(!0);Qt(),st(b);let H=h.createExportAssignment(d,S,N);return Ce(D(H,s),p)}let H_;(s=>{s[s.SourceElements=0]="SourceElements",s[s.BlockStatements=1]="BlockStatements",s[s.SwitchClauses=2]="SwitchClauses",s[s.SwitchClauseStatements=3]="SwitchClauseStatements",s[s.TypeMembers=4]="TypeMembers",s[s.ClassMembers=5]="ClassMembers",s[s.EnumMembers=6]="EnumMembers",s[s.HeritageClauseElement=7]="HeritageClauseElement",s[s.VariableDeclarations=8]="VariableDeclarations",s[s.ObjectBindingElements=9]="ObjectBindingElements",s[s.ArrayBindingElements=10]="ArrayBindingElements",s[s.ArgumentExpressions=11]="ArgumentExpressions",s[s.ObjectLiteralMembers=12]="ObjectLiteralMembers",s[s.JsxAttributes=13]="JsxAttributes",s[s.JsxChildren=14]="JsxChildren",s[s.ArrayLiteralMembers=15]="ArrayLiteralMembers",s[s.Parameters=16]="Parameters",s[s.JSDocParameters=17]="JSDocParameters",s[s.RestProperties=18]="RestProperties",s[s.TypeParameters=19]="TypeParameters",s[s.TypeArguments=20]="TypeArguments",s[s.TupleElementTypes=21]="TupleElementTypes",s[s.HeritageClauses=22]="HeritageClauses",s[s.ImportOrExportSpecifiers=23]="ImportOrExportSpecifiers",s[s.ImportAttributes=24]="ImportAttributes",s[s.JSDocComment=25]="JSDocComment",s[s.Count=26]="Count"})(H_||(H_={}));let $_;(s=>{s[s.False=0]="False",s[s.True=1]="True",s[s.Unknown=2]="Unknown"})($_||($_={}));let Hc;(s=>{function p(ee,ce,Le){zn("file.js",ee,99,void 0,1,0),t.setText(ee,ce,Le),lt=t.scan();let je=d(),Ae=se("file.js",99,1,!1,[],ye(1),0,Fa),Yt=zi(_t,Ae);return Ut&&(Ae.jsDocDiagnostics=zi(Ut,Ae)),Fn(),je?{jsDocTypeExpression:je,diagnostics:Yt}:void 0}s.parseJSDocTypeExpressionForTests=p;function d(ee){let ce=J(),Le=(ee?Je:j)(19),je=Tt(16777216,l_);(!ee||Le)&&Es(20);let Ae=h.createJSDocTypeExpression(je);return L(Ae),D(Ae,ce)}s.parseJSDocTypeExpression=d;function b(){let ee=J(),ce=Je(19),Le=J(),je=jr(!1);for(;u()===81;)Nt(),ze(),je=D(h.createJSDocMemberName(je,St()),Le);ce&&Es(20);let Ae=h.createJSDocNameReference(je);return L(Ae),D(Ae,ee)}s.parseJSDocNameReference=b;function S(ee,ce,Le){zn("",ee,99,void 0,1,0);let je=Tt(16777216,()=>Z(ce,Le)),Yt=zi(_t,{languageVariant:0,text:ee});return Fn(),je?{jsDoc:je,diagnostics:Yt}:void 0}s.parseIsolatedJSDocComment=S;function N(ee,ce,Le){let je=lt,Ae=_t.length,Yt=rn,mn=Tt(16777216,()=>Z(ce,Le));return Sf(mn,ee),nt&524288&&(Ut||(Ut=[]),Dn(Ut,_t,Ae)),lt=je,_t.length=Ae,rn=Yt,mn}s.parseJSDocComment=N;let H;(ee=>{ee[ee.BeginningOfLine=0]="BeginningOfLine",ee[ee.SawAsterisk=1]="SawAsterisk",ee[ee.SavingComments=2]="SavingComments",ee[ee.SavingBackticks=3]="SavingBackticks"})(H||(H={}));let _e;(ee=>{ee[ee.Property=1]="Property",ee[ee.Parameter=2]="Parameter",ee[ee.CallbackParameter=4]="CallbackParameter"})(_e||(_e={}));function Z(ee=0,ce){let Le=Qe,je=ce===void 0?Le.length:ee+ce;if(ce=je-ee,B.assert(ee>=0),B.assert(ee<=je),B.assert(je<=Le.length),!k6(Le,ee))return;let Ae,Yt,mn,Zt,ur,Ln=[],Fr=[],dp=yt;yt|=1<<25;let De=t.scanRange(ee+3,ce-5,et);return yt=dp,De;function et(){let O=1,Y,X=ee-(Le.lastIndexOf(` +`,ee)+1)+4;function te(Ue){Y||(Y=X),Ln.push(Ue),X+=Ue.length}for(ze();Bi(5););Bi(4)&&(O=0,X=0);e:for(;;){switch(u()){case 60:Da(Ln),ur||(ur=J()),pe(q(X)),O=0,Y=void 0;break;case 4:Ln.push(t.getTokenText()),O=0,X=0;break;case 42:let Ue=t.getTokenText();O===1?(O=2,te(Ue)):(B.assert(O===0),O=1,X+=Ue.length);break;case 5:B.assert(O!==2,"whitespace shouldn't come from the scanner while saving top-level comment text");let pt=t.getTokenText();Y!==void 0&&X+pt.length>Y&&Ln.push(pt.slice(Y-X)),X+=pt.length;break;case 1:break e;case 82:O=2,te(t.getTokenValue());break;case 19:O=2;let hn=t.getTokenFullStart(),sn=t.getTokenEnd()-1,tn=_(sn);if(tn){Zt||pr(Ln),Fr.push(D(h.createJSDocText(Ln.join("")),Zt??ee,hn)),Fr.push(tn),Ln=[],Zt=t.getTokenEnd();break}default:O=2,te(t.getTokenText());break}O===2?an(!1):ze()}let ne=Ln.join("").trimEnd();Fr.length&&ne.length&&Fr.push(D(h.createJSDocText(ne),Zt??ee,ur)),Fr.length&&Ae&&B.assertIsDefined(ur,"having parsed tags implies that the end of the comment span should be set");let Pe=Ae&&Ct(Ae,Yt,mn);return D(h.createJSDocComment(Fr.length?Ct(Fr,ee,ur):ne.length?ne:void 0,Pe),ee,je)}function pr(O){for(;O.length&&(O[0]===` +`||O[0]==="\r");)O.shift()}function Da(O){for(;O.length;){let Y=O[O.length-1].trimEnd();if(Y==="")O.pop();else if(Y.lengthpt&&(te.push(Qn.slice(pt-O)),Ue=2),O+=Qn.length;break;case 19:Ue=2;let Qc=t.getTokenFullStart(),Na=t.getTokenEnd()-1,Kc=_(Na);Kc?(ne.push(D(h.createJSDocText(te.join("")),Pe??X,Qc)),ne.push(Kc),te=[],Pe=t.getTokenEnd()):hn(t.getTokenText());break;case 62:Ue===3?Ue=2:Ue=3,hn(t.getTokenText());break;case 82:Ue!==3&&(Ue=2),hn(t.getTokenValue());break;case 42:if(Ue===0){Ue=1,O+=1;break}default:Ue!==3&&(Ue=2),hn(t.getTokenText());break}Ue===2||Ue===3?sn=an(Ue===3):sn=ze()}pr(te);let tn=te.join("").trimEnd();if(ne.length)return tn.length&&ne.push(D(h.createJSDocText(tn),Pe??X)),Ct(ne,X,t.getTokenEnd());if(tn.length)return tn}function _(O){let Y=le(f);if(!Y)return;ze(),It();let X=c(),te=[];for(;u()!==20&&u()!==4&&u()!==1;)te.push(t.getTokenText()),ze();let ne=Y==="link"?h.createJSDocLink:Y==="linkcode"?h.createJSDocLinkCode:h.createJSDocLinkPlain;return D(ne(X,te.join("")),O,t.getTokenEnd())}function c(){if(wt(u())){let O=J(),Y=jt();for(;Je(25);)Y=D(h.createQualifiedName(Y,u()===81?Gt(80,!1):jt()),O);for(;u()===81;)Nt(),ze(),Y=D(h.createJSDocMemberName(Y,St()),O);return Y}}function f(){if(xr(),u()===19&&ze()===60&&wt(ze())){let O=t.getTokenValue();if(w(O))return O}}function w(O){return O==="link"||O==="linkcode"||O==="linkplain"}function F(O,Y,X,te){return D(h.createJSDocUnknownTag(Y,n(O,J(),X,te)),O)}function pe(O){O&&(Ae?Ae.push(O):(Ae=[O],Yt=O.pos),mn=O.end)}function Re(){return xr(),u()===19?d():void 0}function en(){let O=Bi(23);O&&It();let Y=Bi(62),X=$0();return Y&&ql(62),O&&(It(),ft(64)&&Et(),j(24)),{name:X,isBracketed:O}}function kn(O){switch(O.kind){case 151:return!0;case 188:return kn(O.elementType);default:return Df(O)&&tt(O.typeName)&&O.typeName.escapedText==="Object"&&!O.typeArguments}}function $n(O,Y,X,te){let ne=Re(),Pe=!ne;xr();let{name:Ue,isBracketed:pt}=en(),hn=xr();Pe&&!G(f)&&(ne=Re());let sn=n(O,J(),te,hn),tn=Pa(ne,Ue,X,te);tn&&(ne=tn,Pe=!0);let Qn=X===1?h.createJSDocPropertyTag(Y,Ue,pt,ne,Pe,sn):h.createJSDocParameterTag(Y,Ue,pt,ne,Pe,sn);return D(Qn,O)}function Pa(O,Y,X,te){if(O&&kn(O.type)){let ne=J(),Pe,Ue;for(;Pe=le(()=>hp(X,te,Y));)Pe.kind===341||Pe.kind===348?Ue=An(Ue,Pe):Pe.kind===345&&ln(Pe.tagName,E.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);if(Ue){let pt=D(h.createJSDocTypeLiteral(Ue,O.type.kind===188),ne);return D(h.createJSDocTypeExpression(pt),ne)}}}function P0(O,Y,X,te){Xt(Ae,p6)&&rt(Y.pos,t.getTokenStart(),E._0_tag_already_specified,cs(Y.escapedText));let ne=Re();return D(h.createJSDocReturnTag(Y,ne,n(O,J(),X,te)),O)}function md(O,Y,X,te){Xt(Ae,Ff)&&rt(Y.pos,t.getTokenStart(),E._0_tag_already_specified,cs(Y.escapedText));let ne=d(!0),Pe=X!==void 0&&te!==void 0?n(O,J(),X,te):void 0;return D(h.createJSDocTypeTag(Y,ne,Pe),O)}function N0(O,Y,X,te){let Pe=u()===23||G(()=>ze()===60&&wt(ze())&&w(t.getTokenValue()))?void 0:b(),Ue=X!==void 0&&te!==void 0?n(O,J(),X,te):void 0;return D(h.createJSDocSeeTag(Y,Pe,Ue),O)}function I0(O,Y,X,te){let ne=Re(),Pe=n(O,J(),X,te);return D(h.createJSDocThrowsTag(Y,ne,Pe),O)}function O0(O,Y,X,te){let ne=J(),Pe=M0(),Ue=t.getTokenFullStart(),pt=n(O,Ue,X,te);pt||(Ue=t.getTokenFullStart());let hn=typeof pt!="string"?Ct(Yp([D(Pe,ne,Ue)],pt),ne):Pe.text+pt;return D(h.createJSDocAuthorTag(Y,hn),O)}function M0(){let O=[],Y=!1,X=t.getToken();for(;X!==1&&X!==4;){if(X===30)Y=!0;else{if(X===60&&!Y)break;if(X===32&&Y){O.push(t.getTokenText()),t.resetTokenState(t.getTokenEnd());break}}O.push(t.getTokenText()),X=ze()}return h.createJSDocText(O.join(""))}function J0(O,Y,X,te){let ne=hd();return D(h.createJSDocImplementsTag(Y,ne,n(O,J(),X,te)),O)}function L0(O,Y,X,te){let ne=hd();return D(h.createJSDocAugmentsTag(Y,ne,n(O,J(),X,te)),O)}function j0(O,Y,X,te){let ne=d(!1),Pe=X!==void 0&&te!==void 0?n(O,J(),X,te):void 0;return D(h.createJSDocSatisfiesTag(Y,ne,Pe),O)}function R0(O,Y,X,te){let ne=t.getTokenFullStart(),Pe;ve()&&(Pe=St());let Ue=si(Pe,ne,!0,!0),pt=Ri(),hn=Wc(),sn=X!==void 0&&te!==void 0?n(O,J(),X,te):void 0;return D(h.createJSDocImportTag(Y,Ue,pt,hn,sn),O)}function hd(){let O=Je(19),Y=J(),X=U0();t.setSkipJsDocLeadingAsterisks(!0);let te=Ca();t.setSkipJsDocLeadingAsterisks(!1);let ne=h.createExpressionWithTypeArguments(X,te),Pe=D(ne,Y);return O&&j(20),Pe}function U0(){let O=J(),Y=li();for(;Je(25);){let X=li();Y=D(ae(Y,X),O)}return Y}function Ui(O,Y,X,te,ne){return D(Y(X,n(O,J(),te,ne)),O)}function yd(O,Y,X,te){let ne=d(!0);return It(),D(h.createJSDocThisTag(Y,ne,n(O,J(),X,te)),O)}function B0(O,Y,X,te){let ne=d(!0);return It(),D(h.createJSDocEnumTag(Y,ne,n(O,J(),X,te)),O)}function q0(O,Y,X,te){let ne=Re();xr();let Pe=mp();It();let Ue=i(X),pt;if(!ne||kn(ne.type)){let sn,tn,Qn,Qc=!1;for(;(sn=le(()=>G0(X)))&&sn.kind!==345;)if(Qc=!0,sn.kind===344)if(tn){let Na=Ee(E.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);Na&&nl(Na,Oa(Mt,Qe,0,0,E.The_tag_was_first_specified_here));break}else tn=sn;else Qn=An(Qn,sn);if(Qc){let Na=ne&&ne.type.kind===188,Kc=h.createJSDocTypeLiteral(Qn,Na);ne=tn&&tn.typeExpression&&!kn(tn.typeExpression.type)?tn.typeExpression:D(Kc,O),pt=ne.end}}pt=pt||Ue!==void 0?J():(Pe??ne??Y).end,Ue||(Ue=n(O,pt,X,te));let hn=h.createJSDocTypedefTag(Y,ne,Pe,Ue);return D(hn,O,pt)}function mp(O){let Y=t.getTokenStart();if(!wt(u()))return;let X=li();if(Je(25)){let te=mp(!0),ne=h.createModuleDeclaration(void 0,X,te,O?8:void 0);return D(ne,Y)}return O&&(X.flags|=4096),X}function z0(O){let Y=J(),X,te;for(;X=le(()=>hp(4,O));){if(X.kind===345){ln(X.tagName,E.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);break}te=An(te,X)}return Ct(te||[],Y)}function gd(O,Y){let X=z0(Y),te=le(()=>{if(Bi(60)){let ne=q(Y);if(ne&&ne.kind===342)return ne}});return D(h.createJSDocSignature(void 0,X,te),O)}function F0(O,Y,X,te){let ne=mp();It();let Pe=i(X),Ue=gd(O,X);Pe||(Pe=n(O,J(),X,te));let pt=Pe!==void 0?J():Ue.end;return D(h.createJSDocCallbackTag(Y,Ue,ne,Pe),O,pt)}function V0(O,Y,X,te){It();let ne=i(X),Pe=gd(O,X);ne||(ne=n(O,J(),X,te));let Ue=ne!==void 0?J():Pe.end;return D(h.createJSDocOverloadTag(Y,Pe,ne),O,Ue)}function W0(O,Y){for(;!tt(O)||!tt(Y);)if(!tt(O)&&!tt(Y)&&O.right.escapedText===Y.right.escapedText)O=O.left,Y=Y.left;else return!1;return O.escapedText===Y.escapedText}function G0(O){return hp(1,O)}function hp(O,Y,X){let te=!0,ne=!1;for(;;)switch(ze()){case 60:if(te){let Pe=Y0(O,Y);return Pe&&(Pe.kind===341||Pe.kind===348)&&X&&(tt(Pe.name)||!W0(X,Pe.name.left))?!1:Pe}ne=!1;break;case 4:te=!0,ne=!1;break;case 42:ne&&(te=!1),ne=!0;break;case 80:te=!1;break;case 1:return!1}}function Y0(O,Y){B.assert(u()===60);let X=t.getTokenFullStart();ze();let te=li(),ne=xr(),Pe;switch(te.escapedText){case"type":return O===1&&md(X,te);case"prop":case"property":Pe=1;break;case"arg":case"argument":case"param":Pe=6;break;case"template":return bd(X,te,Y,ne);case"this":return yd(X,te,Y,ne);default:return!1}return O&Pe?$n(X,te,O,Y):!1}function X0(){let O=J(),Y=Bi(23);Y&&It();let X=wn(!1,!0),te=li(E.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces),ne;if(Y&&(It(),j(64),ne=Tt(16777216,l_),j(24)),!Hi(te))return D(h.createTypeParameterDeclaration(X,te,void 0,ne),O)}function H0(){let O=J(),Y=[];do{It();let X=X0();X!==void 0&&Y.push(X),xr()}while(Bi(28));return Ct(Y,O)}function bd(O,Y,X,te){let ne=u()===19?d():void 0,Pe=H0();return D(h.createJSDocTemplateTag(Y,ne,Pe,n(O,J(),X,te)),O)}function Bi(O){return u()===O?(ze(),!0):!1}function $0(){let O=li();for(Je(23)&&j(24);Je(25);){let Y=li();Je(23)&&j(24),O=Xl(O,Y)}return O}function li(O){if(!wt(u()))return Gt(80,!O,O||E.Identifier_expected);vn++;let Y=t.getTokenStart(),X=t.getTokenEnd(),te=u(),ne=Mr(t.getTokenValue()),Pe=D(re(ne,te),Y,X);return ze(),Pe}}})(Hc=e.JSDocParser||(e.JSDocParser={}))})(Qi||(Qi={}));var xm=new WeakSet;function J6(e){xm.has(e)&&B.fail("Source file has already been incrementally parsed"),xm.add(e)}var hh=new WeakSet;function L6(e){return hh.has(e)}function Wp(e){hh.add(e)}var vl;(e=>{function t(x,I,re,he){if(he=he||B.shouldAssert(2),h(x,I,re,he),fg(re))return x;if(x.statements.length===0)return Qi.parseSourceFile(x.fileName,I,x.languageVersion,void 0,!0,x.scriptKind,x.setExternalModuleIndicator,x.jsDocParsingMode);J6(x),Qi.fixupParentReferences(x);let ye=x.text,de=y(x),M=l(x,re);h(x,I,M,he),B.assert(M.span.start<=re.span.start),B.assert(wr(M.span)===wr(re.span)),B.assert(wr(K_(M))===wr(K_(re)));let ae=K_(M).length-M.span.length;P(x,M.span.start,wr(M.span),wr(K_(M)),ae,ye,I,he);let Oe=Qi.parseSourceFile(x.fileName,I,x.languageVersion,de,!0,x.scriptKind,x.setExternalModuleIndicator,x.jsDocParsingMode);return Oe.commentDirectives=a(x.commentDirectives,Oe.commentDirectives,M.span.start,wr(M.span),ae,ye,I,he),Oe.impliedNodeFormat=x.impliedNodeFormat,h6(x,Oe),Oe}e.updateSourceFile=t;function a(x,I,re,he,ye,de,M,ae){if(!x)return I;let Oe,V=!1;for(let W of x){let{range:dt,type:nr}=W;if(dt.endhe){oe();let gn={range:{pos:dt.pos+ye,end:dt.end+ye},type:nr};Oe=An(Oe,gn),ae&&B.assert(de.substring(dt.pos,dt.end)===M.substring(gn.range.pos,gn.range.end))}}return oe(),Oe;function oe(){V||(V=!0,Oe?I&&Oe.push(...I):Oe=I)}}function o(x,I,re,he,ye,de,M){re?Oe(x):ae(x);return;function ae(V){let oe="";if(M&&m(V)&&(oe=ye.substring(V.pos,V.end)),Kd(V,I),yi(V,V.pos+he,V.end+he),M&&m(V)&&B.assert(oe===de.substring(V.pos,V.end)),Ht(V,ae,Oe),Xi(V))for(let W of V.jsDoc)ae(W);A(V,M)}function Oe(V){yi(V,V.pos+he,V.end+he);for(let oe of V)ae(oe)}}function m(x){switch(x.kind){case 11:case 9:case 80:return!0}return!1}function v(x,I,re,he,ye){B.assert(x.end>=I,"Adjusting an element that was entirely before the change range"),B.assert(x.pos<=re,"Adjusting an element that was entirely after the change range"),B.assert(x.pos<=x.end);let de=Math.min(x.pos,he),M=x.end>=re?x.end+ye:Math.min(x.end,he);if(B.assert(de<=M),x.parent){let ae=x.parent;B.assertGreaterThanOrEqual(de,ae.pos),B.assertLessThanOrEqual(M,ae.end)}yi(x,de,M)}function A(x,I){if(I){let re=x.pos,he=ye=>{B.assert(ye.pos>=re),re=ye.end};if(Xi(x))for(let ye of x.jsDoc)he(ye);Ht(x,he),B.assert(re<=x.end)}}function P(x,I,re,he,ye,de,M,ae){Oe(x);return;function Oe(oe){if(B.assert(oe.pos<=oe.end),oe.pos>re){o(oe,x,!1,ye,de,M,ae);return}let W=oe.end;if(W>=I){if(Wp(oe),Kd(oe,x),v(oe,I,re,he,ye),Ht(oe,Oe,V),Xi(oe))for(let dt of oe.jsDoc)Oe(dt);A(oe,ae);return}B.assert(Wre){o(oe,x,!0,ye,de,M,ae);return}let W=oe.end;if(W>=I){Wp(oe),v(oe,I,re,he,ye);for(let dt of oe)Oe(dt);return}B.assert(W0&&M<=1;M++){let ae=Q(x,he);B.assert(ae.pos<=he);let Oe=ae.pos;he=Math.max(0,Oe-1)}let ye=pg(he,wr(I.span)),de=I.newLength+(I.span.start-he);return Km(ye,de)}function Q(x,I){let re=x,he;if(Ht(x,de),he){let M=ye(he);M.pos>re.pos&&(re=M)}return re;function ye(M){for(;;){let ae=Q2(M);if(ae)M=ae;else return M}}function de(M){if(!Hi(M))if(M.pos<=I){if(M.pos>=re.pos&&(re=M),II),!0}}function h(x,I,re,he){let ye=x.text;if(re&&(B.assert(ye.length-re.span.length+re.newLength===I.length),he||B.shouldAssert(3))){let de=ye.substr(0,re.span.start),M=I.substr(0,re.span.start);B.assert(de===M);let ae=ye.substring(wr(re.span),ye.length),Oe=I.substring(wr(K_(re)),I.length);B.assert(ae===Oe)}}function y(x){let I=x.statements,re=0;B.assert(re=V.pos&&M=V.pos&&M{x[x.Value=-1]="Value"})(g||(g={}))})(vl||(vl={}));function j6(e){return R6(e)!==void 0}function R6(e){let t=Rm(e,gb,!1);if(t)return t;if(Oy(e,".ts")){let a=jm(e),o=a.lastIndexOf(".d.");if(o>=0)return a.substring(o)}}function U6(e,t,a,o){if(e){if(e==="import")return 99;if(e==="require")return 1;o(t,a-t,E.resolution_mode_should_be_either_require_or_import)}}function B6(e,t){let a=[];for(let o of Jp(t,0)||bt){let m=t.substring(o.pos,o.end);W6(a,o,m)}e.pragmas=new Map;for(let o of a){if(e.pragmas.has(o.name)){let m=e.pragmas.get(o.name);m instanceof Array?m.push(o.args):e.pragmas.set(o.name,[m,o.args]);continue}e.pragmas.set(o.name,o.args)}}function q6(e,t){e.checkJsDirective=void 0,e.referencedFiles=[],e.typeReferenceDirectives=[],e.libReferenceDirectives=[],e.amdDependencies=[],e.hasNoDefaultLib=!1,e.pragmas.forEach((a,o)=>{switch(o){case"reference":{let m=e.referencedFiles,v=e.typeReferenceDirectives,A=e.libReferenceDirectives;Un(bp(a),P=>{let{types:l,lib:Q,path:h,["resolution-mode"]:y,preserve:g}=P.arguments,x=g==="true"?!0:void 0;if(P.arguments["no-default-lib"]==="true")e.hasNoDefaultLib=!0;else if(l){let I=U6(y,l.pos,l.end,t);v.push({pos:l.pos,end:l.end,fileName:l.value,...I?{resolutionMode:I}:{},...x?{preserve:x}:{}})}else Q?A.push({pos:Q.pos,end:Q.end,fileName:Q.value,...x?{preserve:x}:{}}):h?m.push({pos:h.pos,end:h.end,fileName:h.value,...x?{preserve:x}:{}}):t(P.range.pos,P.range.end-P.range.pos,E.Invalid_reference_directive_syntax)});break}case"amd-dependency":{e.amdDependencies=Pp(bp(a),m=>({name:m.arguments.name,path:m.arguments.path}));break}case"amd-module":{if(a instanceof Array)for(let m of a)e.moduleName&&t(m.range.pos,m.range.end-m.range.pos,E.An_AMD_module_cannot_have_multiple_name_assignments),e.moduleName=m.arguments.name;else e.moduleName=a.arguments.name;break}case"ts-nocheck":case"ts-check":{Un(bp(a),m=>{(!e.checkJsDirective||m.range.pos>e.checkJsDirective.pos)&&(e.checkJsDirective={enabled:o==="ts-check",end:m.range.end,pos:m.range.pos})});break}case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:B.fail("Unhandled pragma kind")}})}var Dp=new Map;function z6(e){if(Dp.has(e))return Dp.get(e);let t=new RegExp(`(\\s${e}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`,"im");return Dp.set(e,t),t}var F6=/^\/\/\/\s*<(\S+)\s.*?\/>/m,V6=/^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m;function W6(e,t,a){let o=t.kind===2&&F6.exec(a);if(o){let v=o[1].toLowerCase(),A=Lm[v];if(!A||!(A.kind&1))return;if(A.args){let P={};for(let l of A.args){let h=z6(l.name).exec(a);if(!h&&!l.optional)return;if(h){let y=h[2]||h[3];if(l.captureSpan){let g=t.pos+h.index+h[1].length+1;P[l.name]={value:y,pos:g,end:g+y.length}}else P[l.name]=y}}e.push({name:v,args:{arguments:P,range:t}})}else e.push({name:v,args:{arguments:{},range:t}});return}let m=t.kind===2&&V6.exec(a);if(m)return Sm(e,t,2,m);if(t.kind===3){let v=/@(\S+)(\s+(?:\S.*)?)?$/gm,A;for(;A=v.exec(a);)Sm(e,t,4,A)}}function Sm(e,t,a,o){if(!o)return;let m=o[1].toLowerCase(),v=Lm[m];if(!v||!(v.kind&a))return;let A=o[2],P=G6(v,A);P!=="fail"&&e.push({name:m,args:{arguments:P,range:t}})}function G6(e,t){if(!t)return{};if(!e.args)return{};let a=t.trim().split(/\s+/),o={};for(let m=0;mo.kind<309||o.kind>351);return a.kind<166?a:a.getFirstToken(e)}getLastToken(e){this.assertHasRealPosition();let t=this.getChildren(e),a=Yi(t);if(a)return a.kind<166?a:a.getLastToken(e)}forEachChild(e,t){return Ht(this,e,t)}};function Y6(e,t){let a=[];if(Zg(e))return e.forEachChild(A=>{a.push(A)}),a;ss.setText((t||e.getSourceFile()).text);let o=e.pos,m=A=>{os(a,o,A.pos,e),a.push(A),o=A.end},v=A=>{os(a,o,A.pos,e),a.push(X6(A,e)),o=A.end};return Un(e.jsDoc,m),o=e.pos,e.forEachChild(m,v),os(a,o,e.end,e),ss.setText(void 0),a}function os(e,t,a,o){for(ss.resetTokenState(t);tt.tagName.text==="inheritDoc"||t.tagName.text==="inheritdoc")}function ll(e,t){if(!e)return bt;let a=ts_JsDoc_exports.getJsDocTagsFromDeclarations(e,t);if(t&&(a.length===0||e.some(Th))){let o=new Set;for(let m of e){let v=xh(t,m,A=>{var P;if(!o.has(A))return o.add(A),m.kind===177||m.kind===178?A.getContextualJsDocTags(m,t):((P=A.declarations)==null?void 0:P.length)===1?A.getJsDocTags(t):void 0});v&&(a=[...v,...a])}}return a}function _s(e,t){if(!e)return bt;let a=ts_JsDoc_exports.getJsDocCommentsFromDeclarations(e,t);if(t&&(a.length===0||e.some(Th))){let o=new Set;for(let m of e){let v=xh(t,m,A=>{if(!o.has(A))return o.add(A),m.kind===177||m.kind===178?A.getContextualDocumentationComment(m,t):A.getDocumentationComment(t)});v&&(a=a.length===0?v.slice():v.concat(lineBreakPart(),a))}}return a}function xh(e,t,a){var o;let m=((o=t.parent)==null?void 0:o.kind)===176?t.parent.parent:t.parent;if(!m)return;let v=B2(t);return ny(N2(m),A=>{let P=e.getTypeAtLocation(A),l=v&&P.symbol?e.getTypeOfSymbol(P.symbol):P,Q=e.getPropertyOfType(l,t.symbol.name);return Q?a(Q):void 0})}var K6=class extends Gf{constructor(e,t,a){super(e,t,a)}update(e,t){return M6(this,e,t)}getLineAndCharacterOfPosition(e){return Wm(this,e)}getLineStarts(){return Mp(this)}getPositionOfLineAndCharacter(e,t,a){return ng(Mp(this),e,t,this.text,a)}getLineEndOfPosition(e){let{line:t}=this.getLineAndCharacterOfPosition(e),a=this.getLineStarts(),o;t+1>=a.length&&(o=this.getEnd()),o||(o=a[t+1]-1);let m=this.getFullText();return m[o]===` +`&&m[o-1]==="\r"?o-1:o}getNamedDeclarations(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations}computeNamedDeclarations(){let e=hy();return this.forEachChild(m),e;function t(v){let A=o(v);A&&e.add(A,v)}function a(v){let A=e.get(v);return A||e.set(v,A=[]),A}function o(v){let A=lf(v);return A&&(kf(A)&&Xr(A.expression)?A.expression.name.text:s1(A)?getNameFromPropertyName(A):void 0)}function m(v){switch(v.kind){case 262:case 218:case 174:case 173:let A=v,P=o(A);if(P){let h=a(P),y=Yi(h);y&&A.parent===y.parent&&A.symbol===y.symbol?A.body&&!y.body&&(h[h.length-1]=A):h.push(A)}Ht(v,m);break;case 263:case 231:case 264:case 265:case 266:case 267:case 271:case 281:case 276:case 273:case 274:case 177:case 178:case 187:t(v),Ht(v,m);break;case 169:if(!bs(v,31))break;case 260:case 208:{let h=v;if(Vg(h.name)){Ht(h.name,m);break}h.initializer&&m(h.initializer)}case 306:case 172:case 171:t(v);break;case 278:let l=v;l.exportClause&&(eh(l.exportClause)?Un(l.exportClause.elements,m):m(l.exportClause.name));break;case 272:let Q=v.importClause;Q&&(Q.name&&t(Q.name),Q.namedBindings&&(Q.namedBindings.kind===274?t(Q.namedBindings):Un(Q.namedBindings.elements,m)));break;case 226:yf(v)!==0&&t(v);default:Ht(v,m)}}}},Z6=class{constructor(e,t,a){this.fileName=e,this.text=t,this.skipTrivia=a||(o=>o)}getLineAndCharacterOfPosition(e){return Wm(this,e)}};function ev(){return{getNodeConstructor:()=>Gf,getTokenConstructor:()=>gh,getIdentifierConstructor:()=>bh,getPrivateIdentifierConstructor:()=>vh,getSourceFileConstructor:()=>K6,getSymbolConstructor:()=>H6,getTypeConstructor:()=>$6,getSignatureConstructor:()=>Q6,getSourceMapSourceConstructor:()=>Z6}}var tv=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes","getPasteEdits"],b3=[...tv,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors","preparePasteEditsForFile"];_b(ev());var Il=new Proxy({},{get:()=>!0});var wh=Il["4.8"];function er(e,t=!1){var a;if(e!=null){if(wh){if(t||Nl(e)){let o=t1(e);return o?[...o]:void 0}return}return(a=e.modifiers)==null?void 0:a.filter(o=>!El(o))}}function na(e,t=!1){var a;if(e!=null){if(wh){if(t||Wf(e)){let o=uf(e);return o?[...o]:void 0}return}return(a=e.decorators)==null?void 0:a.filter(El)}}var Eh={};var Ol=new Proxy({},{get:(e,t)=>t});var Ah=Ol,Ch=Ol;var C=Ah,Rt=Ch;var Dh=Il["5.0"],ue=Ie,iv=new Set([ue.AmpersandAmpersandToken,ue.BarBarToken,ue.QuestionQuestionToken]),av=new Set([Ie.AmpersandAmpersandEqualsToken,Ie.AmpersandEqualsToken,Ie.AsteriskAsteriskEqualsToken,Ie.AsteriskEqualsToken,Ie.BarBarEqualsToken,Ie.BarEqualsToken,Ie.CaretEqualsToken,Ie.EqualsToken,Ie.GreaterThanGreaterThanEqualsToken,Ie.GreaterThanGreaterThanGreaterThanEqualsToken,Ie.LessThanLessThanEqualsToken,Ie.MinusEqualsToken,Ie.PercentEqualsToken,Ie.PlusEqualsToken,Ie.QuestionQuestionEqualsToken,Ie.SlashEqualsToken]),_v=new Set([ue.AmpersandAmpersandToken,ue.AmpersandToken,ue.AsteriskAsteriskToken,ue.AsteriskToken,ue.BarBarToken,ue.BarToken,ue.CaretToken,ue.EqualsEqualsEqualsToken,ue.EqualsEqualsToken,ue.ExclamationEqualsEqualsToken,ue.ExclamationEqualsToken,ue.GreaterThanEqualsToken,ue.GreaterThanGreaterThanGreaterThanToken,ue.GreaterThanGreaterThanToken,ue.GreaterThanToken,ue.InKeyword,ue.InstanceOfKeyword,ue.LessThanEqualsToken,ue.LessThanLessThanToken,ue.LessThanToken,ue.MinusToken,ue.PercentToken,ue.PlusToken,ue.SlashToken]);function sv(e){return av.has(e.kind)}function ov(e){return iv.has(e.kind)}function cv(e){return _v.has(e.kind)}function $r(e){return it(e)}function Ph(e){return e.kind!==ue.SemicolonClassElement}function Xe(e,t){let a=er(t);return(a==null?void 0:a.some(o=>o.kind===e))===!0}function Nh(e){let t=er(e);return t==null?null:t[t.length-1]??null}function Ih(e){return e.kind===ue.CommaToken}function lv(e){return e.kind===ue.SingleLineCommentTrivia||e.kind===ue.MultiLineCommentTrivia}function uv(e){return e.kind===ue.JSDocComment}function Oh(e){if(sv(e))return{type:C.AssignmentExpression,operator:$r(e.kind)};if(ov(e))return{type:C.LogicalExpression,operator:$r(e.kind)};if(cv(e))return{type:C.BinaryExpression,operator:$r(e.kind)};throw new Error(`Unexpected binary operator ${it(e.kind)}`)}function Ts(e,t){let a=t.getLineAndCharacterOfPosition(e);return{column:a.character,line:a.line+1}}function Qr(e,t){let[a,o]=e.map(m=>Ts(m,t));return{end:o,start:a}}function Mh(e){if(e.kind===Ie.Block)switch(e.parent.kind){case Ie.Constructor:case Ie.GetAccessor:case Ie.SetAccessor:case Ie.ArrowFunction:case Ie.FunctionExpression:case Ie.FunctionDeclaration:case Ie.MethodDeclaration:return!0;default:return!1}return!0}function $a(e,t){return[e.getStart(t),e.getEnd()]}function pv(e){return e.kind>=ue.FirstToken&&e.kind<=ue.LastToken}function Jh(e){return e.kind>=ue.JsxElement&&e.kind<=ue.JsxAttribute}function Ml(e){return e.flags&on.Let?"let":(e.flags&on.AwaitUsing)===on.AwaitUsing?"await using":e.flags&on.Const?"const":e.flags&on.Using?"using":"var"}function xi(e){let t=er(e);if(t!=null)for(let a of t)switch(a.kind){case ue.PublicKeyword:return"public";case ue.ProtectedKeyword:return"protected";case ue.PrivateKeyword:return"private";default:break}}function ra(e,t,a){return o(t);function o(m){return a1(m)&&m.pos===e.end?m:gv(m.getChildren(a),v=>(v.pos<=e.pos&&v.end>e.end||v.pos===e.end)&&yv(v,a)?o(v):void 0)}}function fv(e,t){let a=e;for(;a;){if(t(a))return a;a=a.parent}}function dv(e){return!!fv(e,Jh)}function Qf(e){return Sr(!1,e,/&(?:#\d+|#x[\da-fA-F]+|[0-9a-zA-Z]+);/g,t=>{let a=t.slice(1,-1);if(a[0]==="#"){let o=a[1]==="x"?parseInt(a.slice(2),16):parseInt(a.slice(1),10);return o>1114111?t:String.fromCodePoint(o)}return Eh[a]||t})}function ia(e){return e.kind===ue.ComputedPropertyName}function Kf(e){return!!e.questionToken}function Zf(e){return e.type===C.ChainExpression}function Lh(e,t){return Zf(t)&&e.expression.kind!==Ie.ParenthesizedExpression}function mv(e){let t;if(Dh&&e.kind===ue.Identifier?t=Sl(e):"originalKeywordKind"in e&&(t=e.originalKeywordKind),t)return t===ue.NullKeyword?Rt.Null:t>=ue.FirstFutureReservedWord&&t<=ue.LastKeyword?Rt.Identifier:Rt.Keyword;if(e.kind>=ue.FirstKeyword&&e.kind<=ue.LastFutureReservedWord)return e.kind===ue.FalseKeyword||e.kind===ue.TrueKeyword?Rt.Boolean:Rt.Keyword;if(e.kind>=ue.FirstPunctuation&&e.kind<=ue.LastPunctuation)return Rt.Punctuator;if(e.kind>=ue.NoSubstitutionTemplateLiteral&&e.kind<=ue.TemplateTail)return Rt.Template;switch(e.kind){case ue.NumericLiteral:return Rt.Numeric;case ue.JsxText:return Rt.JSXText;case ue.StringLiteral:return e.parent.kind===ue.JsxAttribute||e.parent.kind===ue.JsxElement?Rt.JSXText:Rt.String;case ue.RegularExpressionLiteral:return Rt.RegularExpression;case ue.Identifier:case ue.ConstructorKeyword:case ue.GetKeyword:case ue.SetKeyword:default:}if(e.kind===ue.Identifier){if(Jh(e.parent))return Rt.JSXIdentifier;if(e.parent.kind===ue.PropertyAccessExpression&&dv(e))return Rt.JSXIdentifier}return Rt.Identifier}function hv(e,t){let a=e.kind===ue.JsxText?e.getFullStart():e.getStart(t),o=e.getEnd(),m=t.text.slice(a,o),v=mv(e),A=[a,o],P=Qr(A,t);return v===Rt.RegularExpression?{type:v,loc:P,range:A,regex:{flags:m.slice(m.lastIndexOf("/")+1),pattern:m.slice(1,m.lastIndexOf("/"))},value:m}:{type:v,loc:P,range:A,value:m}}function jh(e){let t=[];function a(o){lv(o)||uv(o)||(pv(o)&&o.kind!==ue.EndOfFileToken?t.push(hv(o,e)):o.getChildren(e).forEach(a))}return a(e),t}var $f=class extends Error{fileName;location;constructor(t,a,o){super(t),this.fileName=a,this.location=o,Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:new.target.name})}get index(){return this.location.start.offset}get lineNumber(){return this.location.start.line}get column(){return this.location.start.column}};function ed(e,t,a,o=a){let[m,v]=[a,o].map(A=>{let{character:P,line:l}=t.getLineAndCharacterOfPosition(A);return{column:P,line:l+1,offset:A}});return new $f(e,t.fileName,{end:v,start:m})}function Rh(e){var t;return!!("illegalDecorators"in e&&((t=e.illegalDecorators)!=null&&t.length))}function yv(e,t){return e.kind===ue.EndOfFileToken?!!e.jsDoc:e.getWidth(t)!==0}function gv(e,t){if(e!==void 0)for(let a=0;a=0&&e.kind!==ue.EndOfFileToken}function td(e){return!vv(e)}function qh(e){return cf(e.parent,mf)}function Tv(e){return Xe(ue.AbstractKeyword,e)}function xv(e){if(e.parameters.length&&!Pl(e)){let t=e.parameters[0];if(Sv(t))return t}return null}function Sv(e){return Uh(e.name)}function zh(e){switch(e.kind){case ue.ClassDeclaration:return!0;case ue.ClassExpression:return!0;case ue.PropertyDeclaration:{let{parent:t}=e;return!!(Wa(t)||vi(t)&&!Tv(e))}case ue.GetAccessor:case ue.SetAccessor:case ue.MethodDeclaration:{let{parent:t}=e;return!!e.body&&(Wa(t)||vi(t))}case ue.Parameter:{let{parent:t}=e,a=t.parent;return!!t&&"body"in t&&!!t.body&&(t.kind===ue.Constructor||t.kind===ue.MethodDeclaration||t.kind===ue.SetAccessor)&&xv(t)!==e&&!!a&&a.kind===ue.ClassDeclaration}}return!1}function Jl(e){switch(e.kind){case ue.Identifier:return!0;case ue.PropertyAccessExpression:case ue.ElementAccessExpression:return!(e.flags&on.OptionalChain);case ue.ParenthesizedExpression:case ue.TypeAssertionExpression:case ue.AsExpression:case ue.SatisfiesExpression:case ue.ExpressionWithTypeArguments:case ue.NonNullExpression:return Jl(e.expression);default:return!1}}function Fh(e){let t=er(e),a=e;for(;(!t||t.length===0)&&Ti(a.parent);){let o=er(a.parent);o!=null&&o.length&&(t=o),a=a.parent}return t}var T=Ie;function ad(e){return ed("message"in e&&e.message||e.messageText,e.file,e.start)}var me,rd,Vh,Be,Vt,Qa,id,Ll=class{constructor(t,a){yp(this,me);qi(this,"allowPattern",!1);qi(this,"ast");qi(this,"esTreeNodeToTSNodeMap",new WeakMap);qi(this,"options");qi(this,"tsNodeToESTreeNodeMap",new WeakMap);this.ast=t,this.options={...a}}assertModuleSpecifier(t,a){var o;!a&&t.moduleSpecifier==null&&ge(this,me,Vt).call(this,t,"Module specifier must be a string literal."),t.moduleSpecifier&&((o=t.moduleSpecifier)==null?void 0:o.kind)!==T.StringLiteral&&ge(this,me,Vt).call(this,t.moduleSpecifier,"Module specifier must be a string literal.")}convertBindingNameWithTypeAnnotation(t,a,o){let m=this.convertPattern(t);return a&&(m.typeAnnotation=this.convertTypeAnnotation(a,o),this.fixParentLocation(m,m.typeAnnotation.range)),m}convertBodyExpressions(t,a){let o=Mh(a);return t.map(m=>{let v=this.convertChild(m);if(o){if(v!=null&&v.expression&&Cl(m)&&Ya(m.expression)){let A=v.expression.raw;return v.directive=A.slice(1,-1),v}o=!1}return v}).filter(m=>m)}convertChainExpression(t,a){let{child:o,isOptional:m}=t.type===C.MemberExpression?{child:t.object,isOptional:t.optional}:t.type===C.CallExpression?{child:t.callee,isOptional:t.optional}:{child:t.expression,isOptional:!1},v=Lh(a,o);if(!v&&!m)return t;if(v&&Zf(o)){let A=o.expression;t.type===C.MemberExpression?t.object=A:t.type===C.CallExpression?t.callee=A:t.expression=A}return this.createNode(a,{type:C.ChainExpression,expression:t})}convertChild(t,a){return this.converter(t,a,!1)}convertPattern(t,a){return this.converter(t,a,!0)}convertTypeAnnotation(t,a){let o=(a==null?void 0:a.kind)===T.FunctionType||(a==null?void 0:a.kind)===T.ConstructorType?2:1,v=[t.getFullStart()-o,t.end],A=Qr(v,this.ast);return{type:C.TSTypeAnnotation,loc:A,range:v,typeAnnotation:this.convertChild(t)}}convertTypeArgumentsToTypeParameterInstantiation(t,a){let o=ra(t,this.ast,this.ast);return this.createNode(a,{type:C.TSTypeParameterInstantiation,range:[t.pos-1,o.end],params:t.map(m=>this.convertChild(m))})}convertTSTypeParametersToTypeParametersDeclaration(t){let a=ra(t,this.ast,this.ast),o=[t.pos-1,a.end];return{type:C.TSTypeParameterDeclaration,loc:Qr(o,this.ast),range:o,params:t.map(m=>this.convertChild(m))}}convertParameters(t){return t!=null&&t.length?t.map(a=>{var m;let o=this.convertChild(a);return o.decorators=((m=na(a))==null?void 0:m.map(v=>this.convertChild(v)))??[],o}):[]}converter(t,a,o){if(!t)return null;ge(this,me,Vh).call(this,t);let m=this.allowPattern;o!=null&&(this.allowPattern=o);let v=this.convertNode(t,a??t.parent);return this.registerTSNodeInNodeMap(t,v),this.allowPattern=m,v}convertImportAttributes(t){return t==null?[]:t.elements.map(a=>this.convertChild(a))}convertJSXIdentifier(t){let a=this.createNode(t,{type:C.JSXIdentifier,name:t.getText()});return this.registerTSNodeInNodeMap(t,a),a}convertJSXNamespaceOrIdentifier(t){if(t.kind===Ie.JsxNamespacedName){let m=this.createNode(t,{type:C.JSXNamespacedName,name:this.createNode(t.name,{type:C.JSXIdentifier,name:t.name.text}),namespace:this.createNode(t.namespace,{type:C.JSXIdentifier,name:t.namespace.text})});return this.registerTSNodeInNodeMap(t,m),m}let a=t.getText(),o=a.indexOf(":");if(o>0){let m=$a(t,this.ast),v=this.createNode(t,{type:C.JSXNamespacedName,range:m,name:this.createNode(t,{type:C.JSXIdentifier,range:[m[0]+o+1,m[1]],name:a.slice(o+1)}),namespace:this.createNode(t,{type:C.JSXIdentifier,range:[m[0],m[0]+o],name:a.slice(0,o)})});return this.registerTSNodeInNodeMap(t,v),v}return this.convertJSXIdentifier(t)}convertJSXTagName(t,a){let o;switch(t.kind){case T.PropertyAccessExpression:t.name.kind===T.PrivateIdentifier&&ge(this,me,Be).call(this,t.name,"Non-private identifier expected."),o=this.createNode(t,{type:C.JSXMemberExpression,object:this.convertJSXTagName(t.expression,a),property:this.convertJSXIdentifier(t.name)});break;case T.ThisKeyword:case T.Identifier:default:return this.convertJSXNamespaceOrIdentifier(t)}return this.registerTSNodeInNodeMap(t,o),o}convertMethodSignature(t){return this.createNode(t,{type:C.TSMethodSignature,accessibility:xi(t),computed:ia(t.name),key:this.convertChild(t.name),kind:(()=>{switch(t.kind){case T.GetAccessor:return"get";case T.SetAccessor:return"set";case T.MethodSignature:return"method"}})(),optional:Kf(t),params:this.convertParameters(t.parameters),readonly:Xe(T.ReadonlyKeyword,t),returnType:t.type&&this.convertTypeAnnotation(t.type,t),static:Xe(T.StaticKeyword,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)})}fixParentLocation(t,a){a[0]t.range[1]&&(t.range[1]=a[1],t.loc.end=Ts(t.range[1],this.ast))}convertNode(t,a){var o,m,v,A,P,l,Q,h;switch(t.kind){case T.SourceFile:return this.createNode(t,{type:C.Program,range:[t.getStart(this.ast),t.endOfFileToken.end],body:this.convertBodyExpressions(t.statements,t),comments:void 0,sourceType:t.externalModuleIndicator?"module":"script",tokens:void 0});case T.Block:return this.createNode(t,{type:C.BlockStatement,body:this.convertBodyExpressions(t.statements,t)});case T.Identifier:return Bh(t)?this.createNode(t,{type:C.ThisExpression}):this.createNode(t,{type:C.Identifier,decorators:[],name:t.text,optional:!1,typeAnnotation:void 0});case T.PrivateIdentifier:return this.createNode(t,{type:C.PrivateIdentifier,name:t.text.slice(1)});case T.WithStatement:return this.createNode(t,{type:C.WithStatement,body:this.convertChild(t.statement),object:this.convertChild(t.expression)});case T.ReturnStatement:return this.createNode(t,{type:C.ReturnStatement,argument:this.convertChild(t.expression)});case T.LabeledStatement:return this.createNode(t,{type:C.LabeledStatement,body:this.convertChild(t.statement),label:this.convertChild(t.label)});case T.ContinueStatement:return this.createNode(t,{type:C.ContinueStatement,label:this.convertChild(t.label)});case T.BreakStatement:return this.createNode(t,{type:C.BreakStatement,label:this.convertChild(t.label)});case T.IfStatement:return this.createNode(t,{type:C.IfStatement,alternate:this.convertChild(t.elseStatement),consequent:this.convertChild(t.thenStatement),test:this.convertChild(t.expression)});case T.SwitchStatement:return t.caseBlock.clauses.filter(y=>y.kind===T.DefaultClause).length>1&&ge(this,me,Be).call(this,t,"A 'default' clause cannot appear more than once in a 'switch' statement."),this.createNode(t,{type:C.SwitchStatement,cases:t.caseBlock.clauses.map(y=>this.convertChild(y)),discriminant:this.convertChild(t.expression)});case T.CaseClause:case T.DefaultClause:return this.createNode(t,{type:C.SwitchCase,consequent:t.statements.map(y=>this.convertChild(y)),test:t.kind===T.CaseClause?this.convertChild(t.expression):null});case T.ThrowStatement:return t.expression.end===t.expression.pos&&ge(this,me,Vt).call(this,t,"A throw statement must throw an expression."),this.createNode(t,{type:C.ThrowStatement,argument:this.convertChild(t.expression)});case T.TryStatement:return this.createNode(t,{type:C.TryStatement,block:this.convertChild(t.tryBlock),finalizer:this.convertChild(t.finallyBlock),handler:this.convertChild(t.catchClause)});case T.CatchClause:return(o=t.variableDeclaration)!=null&&o.initializer&&ge(this,me,Be).call(this,t.variableDeclaration.initializer,"Catch clause variable cannot have an initializer."),this.createNode(t,{type:C.CatchClause,body:this.convertChild(t.block),param:t.variableDeclaration?this.convertBindingNameWithTypeAnnotation(t.variableDeclaration.name,t.variableDeclaration.type):null});case T.WhileStatement:return this.createNode(t,{type:C.WhileStatement,body:this.convertChild(t.statement),test:this.convertChild(t.expression)});case T.DoStatement:return this.createNode(t,{type:C.DoWhileStatement,body:this.convertChild(t.statement),test:this.convertChild(t.expression)});case T.ForStatement:return this.createNode(t,{type:C.ForStatement,body:this.convertChild(t.statement),init:this.convertChild(t.initializer),test:this.convertChild(t.condition),update:this.convertChild(t.incrementor)});case T.ForInStatement:return ge(this,me,rd).call(this,t.initializer,t.kind),this.createNode(t,{type:C.ForInStatement,body:this.convertChild(t.statement),left:this.convertPattern(t.initializer),right:this.convertChild(t.expression)});case T.ForOfStatement:return ge(this,me,rd).call(this,t.initializer,t.kind),this.createNode(t,{type:C.ForOfStatement,await:!!(t.awaitModifier&&t.awaitModifier.kind===T.AwaitKeyword),body:this.convertChild(t.statement),left:this.convertPattern(t.initializer),right:this.convertChild(t.expression)});case T.FunctionDeclaration:{let y=Xe(T.DeclareKeyword,t),g=Xe(T.AsyncKeyword,t),x=!!t.asteriskToken;y?t.body?ge(this,me,Be).call(this,t,"An implementation cannot be declared in ambient contexts."):g?ge(this,me,Be).call(this,t,"'async' modifier cannot be used in an ambient context."):x&&ge(this,me,Be).call(this,t,"Generators are not allowed in an ambient context."):!t.body&&x&&ge(this,me,Be).call(this,t,"A function signature cannot be declared as a generator.");let I=this.createNode(t,{type:t.body?C.FunctionDeclaration:C.TSDeclareFunction,async:g,body:this.convertChild(t.body)||void 0,declare:y,expression:!1,generator:x,id:this.convertChild(t.name),params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});return this.fixExports(t,I)}case T.VariableDeclaration:{let y=!!t.exclamationToken,g=this.convertChild(t.initializer),x=this.convertBindingNameWithTypeAnnotation(t.name,t.type,t);return y&&(g?ge(this,me,Be).call(this,t,"Declarations with initializers cannot also have definite assignment assertions."):(x.type!==C.Identifier||!x.typeAnnotation)&&ge(this,me,Be).call(this,t,"Declarations with definite assignment assertions must also have type annotations.")),this.createNode(t,{type:C.VariableDeclarator,definite:y,id:x,init:g})}case T.VariableStatement:{let y=this.createNode(t,{type:C.VariableDeclaration,declarations:t.declarationList.declarations.map(g=>this.convertChild(g)),declare:Xe(T.DeclareKeyword,t),kind:Ml(t.declarationList)});return y.declarations.length||ge(this,me,Vt).call(this,t,"A variable declaration list must have at least one variable declarator."),(y.kind==="using"||y.kind==="await using")&&t.declarationList.declarations.forEach((g,x)=>{y.declarations[x].init==null&&ge(this,me,Be).call(this,g,`'${y.kind}' declarations must be initialized.`),y.declarations[x].id.type!==C.Identifier&&ge(this,me,Be).call(this,g.name,`'${y.kind}' declarations may not have binding patterns.`)}),(y.declare||["await using","const","using"].includes(y.kind))&&t.declarationList.declarations.forEach((g,x)=>{y.declarations[x].definite&&ge(this,me,Be).call(this,g,"A definite assignment assertion '!' is not permitted in this context.")}),y.declare&&t.declarationList.declarations.forEach((g,x)=>{y.declarations[x].init&&(["let","var"].includes(y.kind)||y.declarations[x].id.typeAnnotation)&&ge(this,me,Be).call(this,g,"Initializers are not permitted in ambient contexts.")}),this.fixExports(t,y)}case T.VariableDeclarationList:{let y=this.createNode(t,{type:C.VariableDeclaration,declarations:t.declarations.map(g=>this.convertChild(g)),declare:!1,kind:Ml(t)});return(y.kind==="using"||y.kind==="await using")&&t.declarations.forEach((g,x)=>{y.declarations[x].init!=null&&ge(this,me,Be).call(this,g,`'${y.kind}' declarations may not be initialized in for statement.`),y.declarations[x].id.type!==C.Identifier&&ge(this,me,Be).call(this,g.name,`'${y.kind}' declarations may not have binding patterns.`)}),y}case T.ExpressionStatement:return this.createNode(t,{type:C.ExpressionStatement,directive:void 0,expression:this.convertChild(t.expression)});case T.ThisKeyword:return this.createNode(t,{type:C.ThisExpression});case T.ArrayLiteralExpression:return this.allowPattern?this.createNode(t,{type:C.ArrayPattern,decorators:[],elements:t.elements.map(y=>this.convertPattern(y)),optional:!1,typeAnnotation:void 0}):this.createNode(t,{type:C.ArrayExpression,elements:t.elements.map(y=>this.convertChild(y))});case T.ObjectLiteralExpression:{if(this.allowPattern)return this.createNode(t,{type:C.ObjectPattern,decorators:[],optional:!1,properties:t.properties.map(g=>this.convertPattern(g)),typeAnnotation:void 0});let y=[];for(let g of t.properties)(g.kind===T.GetAccessor||g.kind===T.SetAccessor||g.kind===T.MethodDeclaration)&&!g.body&&ge(this,me,Vt).call(this,g.end-1,"'{' expected."),y.push(this.convertChild(g));return this.createNode(t,{type:C.ObjectExpression,properties:y})}case T.PropertyAssignment:{let{exclamationToken:y,questionToken:g}=t;return g&&ge(this,me,Be).call(this,g,"A property assignment cannot have a question token."),y&&ge(this,me,Be).call(this,y,"A property assignment cannot have an exclamation token."),this.createNode(t,{type:C.Property,computed:ia(t.name),key:this.convertChild(t.name),kind:"init",method:!1,optional:!1,shorthand:!1,value:this.converter(t.initializer,t,this.allowPattern)})}case T.ShorthandPropertyAssignment:{let{exclamationToken:y,modifiers:g,questionToken:x}=t;return g&&ge(this,me,Be).call(this,g[0],"A shorthand property assignment cannot have modifiers."),x&&ge(this,me,Be).call(this,x,"A shorthand property assignment cannot have a question token."),y&&ge(this,me,Be).call(this,y,"A shorthand property assignment cannot have an exclamation token."),t.objectAssignmentInitializer?this.createNode(t,{type:C.Property,computed:!1,key:this.convertChild(t.name),kind:"init",method:!1,optional:!1,shorthand:!0,value:this.createNode(t,{type:C.AssignmentPattern,decorators:[],left:this.convertPattern(t.name),optional:!1,right:this.convertChild(t.objectAssignmentInitializer),typeAnnotation:void 0})}):this.createNode(t,{type:C.Property,computed:!1,key:this.convertChild(t.name),kind:"init",method:!1,optional:!1,shorthand:!0,value:this.convertChild(t.name)})}case T.ComputedPropertyName:return this.convertChild(t.expression);case T.PropertyDeclaration:{let y=Xe(T.AbstractKeyword,t);y&&t.initializer&&ge(this,me,Be).call(this,t.initializer,"Abstract property cannot have an initializer.");let g=Xe(T.AccessorKeyword,t),x=g?y?C.TSAbstractAccessorProperty:C.AccessorProperty:y?C.TSAbstractPropertyDefinition:C.PropertyDefinition,I=this.convertChild(t.name);return this.createNode(t,{type:x,accessibility:xi(t),computed:ia(t.name),declare:Xe(T.DeclareKeyword,t),decorators:((m=na(t))==null?void 0:m.map(re=>this.convertChild(re)))??[],definite:!!t.exclamationToken,key:I,optional:(I.type===C.Literal||t.name.kind===T.Identifier||t.name.kind===T.ComputedPropertyName||t.name.kind===T.PrivateIdentifier)&&!!t.questionToken,override:Xe(T.OverrideKeyword,t),readonly:Xe(T.ReadonlyKeyword,t),static:Xe(T.StaticKeyword,t),typeAnnotation:t.type&&this.convertTypeAnnotation(t.type,t),value:y?null:this.convertChild(t.initializer)})}case T.GetAccessor:case T.SetAccessor:if(t.parent.kind===T.InterfaceDeclaration||t.parent.kind===T.TypeLiteral)return this.convertMethodSignature(t);case T.MethodDeclaration:{let y=this.createNode(t,{type:t.body?C.FunctionExpression:C.TSEmptyBodyFunctionExpression,range:[t.parameters.pos-1,t.end],async:Xe(T.AsyncKeyword,t),body:this.convertChild(t.body),declare:!1,expression:!1,generator:!!t.asteriskToken,id:null,params:[],returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});y.typeParameters&&this.fixParentLocation(y,y.typeParameters.range);let g;if(a.kind===T.ObjectLiteralExpression)y.params=t.parameters.map(x=>this.convertChild(x)),g=this.createNode(t,{type:C.Property,computed:ia(t.name),key:this.convertChild(t.name),kind:"init",method:t.kind===T.MethodDeclaration,optional:!!t.questionToken,shorthand:!1,value:y});else{y.params=this.convertParameters(t.parameters);let x=Xe(T.AbstractKeyword,t)?C.TSAbstractMethodDefinition:C.MethodDefinition;g=this.createNode(t,{type:x,accessibility:xi(t),computed:ia(t.name),decorators:((v=na(t))==null?void 0:v.map(I=>this.convertChild(I)))??[],key:this.convertChild(t.name),kind:"method",optional:!!t.questionToken,override:Xe(T.OverrideKeyword,t),static:Xe(T.StaticKeyword,t),value:y})}return t.kind===T.GetAccessor?g.kind="get":t.kind===T.SetAccessor?g.kind="set":!g.static&&t.name.kind===T.StringLiteral&&t.name.text==="constructor"&&g.type!==C.Property&&(g.kind="constructor"),g}case T.Constructor:{let y=Nh(t),g=(y&&ra(y,t,this.ast))??t.getFirstToken(),x=this.createNode(t,{type:t.body?C.FunctionExpression:C.TSEmptyBodyFunctionExpression,range:[t.parameters.pos-1,t.end],async:!1,body:this.convertChild(t.body),declare:!1,expression:!1,generator:!1,id:null,params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});x.typeParameters&&this.fixParentLocation(x,x.typeParameters.range);let I=this.createNode(t,{type:C.Identifier,range:[g.getStart(this.ast),g.end],decorators:[],name:"constructor",optional:!1,typeAnnotation:void 0}),re=Xe(T.StaticKeyword,t);return this.createNode(t,{type:Xe(T.AbstractKeyword,t)?C.TSAbstractMethodDefinition:C.MethodDefinition,accessibility:xi(t),computed:!1,decorators:[],key:I,kind:re?"method":"constructor",optional:!1,override:!1,static:re,value:x})}case T.FunctionExpression:return this.createNode(t,{type:C.FunctionExpression,async:Xe(T.AsyncKeyword,t),body:this.convertChild(t.body),declare:!1,expression:!1,generator:!!t.asteriskToken,id:this.convertChild(t.name),params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});case T.SuperKeyword:return this.createNode(t,{type:C.Super});case T.ArrayBindingPattern:return this.createNode(t,{type:C.ArrayPattern,decorators:[],elements:t.elements.map(y=>this.convertPattern(y)),optional:!1,typeAnnotation:void 0});case T.OmittedExpression:return null;case T.ObjectBindingPattern:return this.createNode(t,{type:C.ObjectPattern,decorators:[],optional:!1,properties:t.elements.map(y=>this.convertPattern(y)),typeAnnotation:void 0});case T.BindingElement:{if(a.kind===T.ArrayBindingPattern){let g=this.convertChild(t.name,a);return t.initializer?this.createNode(t,{type:C.AssignmentPattern,decorators:[],left:g,optional:!1,right:this.convertChild(t.initializer),typeAnnotation:void 0}):t.dotDotDotToken?this.createNode(t,{type:C.RestElement,argument:g,decorators:[],optional:!1,typeAnnotation:void 0,value:void 0}):g}let y;return t.dotDotDotToken?y=this.createNode(t,{type:C.RestElement,argument:this.convertChild(t.propertyName??t.name),decorators:[],optional:!1,typeAnnotation:void 0,value:void 0}):y=this.createNode(t,{type:C.Property,computed:!!(t.propertyName&&t.propertyName.kind===T.ComputedPropertyName),key:this.convertChild(t.propertyName??t.name),kind:"init",method:!1,optional:!1,shorthand:!t.propertyName,value:this.convertChild(t.name)}),t.initializer&&(y.value=this.createNode(t,{type:C.AssignmentPattern,range:[t.name.getStart(this.ast),t.initializer.end],decorators:[],left:this.convertChild(t.name),optional:!1,right:this.convertChild(t.initializer),typeAnnotation:void 0})),y}case T.ArrowFunction:return this.createNode(t,{type:C.ArrowFunctionExpression,async:Xe(T.AsyncKeyword,t),body:this.convertChild(t.body),expression:t.body.kind!==T.Block,generator:!1,id:null,params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});case T.YieldExpression:return this.createNode(t,{type:C.YieldExpression,argument:this.convertChild(t.expression),delegate:!!t.asteriskToken});case T.AwaitExpression:return this.createNode(t,{type:C.AwaitExpression,argument:this.convertChild(t.expression)});case T.NoSubstitutionTemplateLiteral:return this.createNode(t,{type:C.TemplateLiteral,expressions:[],quasis:[this.createNode(t,{type:C.TemplateElement,tail:!0,value:{cooked:t.text,raw:this.ast.text.slice(t.getStart(this.ast)+1,t.end-1)}})]});case T.TemplateExpression:{let y=this.createNode(t,{type:C.TemplateLiteral,expressions:[],quasis:[this.convertChild(t.head)]});return t.templateSpans.forEach(g=>{y.expressions.push(this.convertChild(g.expression)),y.quasis.push(this.convertChild(g.literal))}),y}case T.TaggedTemplateExpression:return this.createNode(t,{type:C.TaggedTemplateExpression,quasi:this.convertChild(t.template),tag:this.convertChild(t.tag),typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t)});case T.TemplateHead:case T.TemplateMiddle:case T.TemplateTail:{let y=t.kind===T.TemplateTail;return this.createNode(t,{type:C.TemplateElement,tail:y,value:{cooked:t.text,raw:this.ast.text.slice(t.getStart(this.ast)+1,t.end-(y?1:2))}})}case T.SpreadAssignment:case T.SpreadElement:return this.allowPattern?this.createNode(t,{type:C.RestElement,argument:this.convertPattern(t.expression),decorators:[],optional:!1,typeAnnotation:void 0,value:void 0}):this.createNode(t,{type:C.SpreadElement,argument:this.convertChild(t.expression)});case T.Parameter:{let y,g;return t.dotDotDotToken?y=g=this.createNode(t,{type:C.RestElement,argument:this.convertChild(t.name),decorators:[],optional:!1,typeAnnotation:void 0,value:void 0}):t.initializer?(y=this.convertChild(t.name),g=this.createNode(t,{type:C.AssignmentPattern,decorators:[],left:y,optional:!1,right:this.convertChild(t.initializer),typeAnnotation:void 0}),er(t)&&(g.range[0]=y.range[0],g.loc=Qr(g.range,this.ast))):y=g=this.convertChild(t.name,a),t.type&&(y.typeAnnotation=this.convertTypeAnnotation(t.type,t),this.fixParentLocation(y,y.typeAnnotation.range)),t.questionToken&&(t.questionToken.end>y.range[1]&&(y.range[1]=t.questionToken.end,y.loc.end=Ts(y.range[1],this.ast)),y.optional=!0),er(t)?this.createNode(t,{type:C.TSParameterProperty,accessibility:xi(t),decorators:[],override:Xe(T.OverrideKeyword,t),parameter:g,readonly:Xe(T.ReadonlyKeyword,t),static:Xe(T.StaticKeyword,t)}):g}case T.ClassDeclaration:!t.name&&(!Xe(Ie.ExportKeyword,t)||!Xe(Ie.DefaultKeyword,t))&&ge(this,me,Vt).call(this,t,"A class declaration without the 'default' modifier must have a name.");case T.ClassExpression:{let y=t.heritageClauses??[],g=t.kind===T.ClassDeclaration?C.ClassDeclaration:C.ClassExpression,x,I;for(let he of y){let{token:ye,types:de}=he;de.length===0&&ge(this,me,Vt).call(this,he,`'${it(ye)}' list cannot be empty.`),ye===T.ExtendsKeyword?(x&&ge(this,me,Vt).call(this,he,"'extends' clause already seen."),I&&ge(this,me,Vt).call(this,he,"'extends' clause must precede 'implements' clause."),de.length>1&&ge(this,me,Vt).call(this,de[1],"Classes can only extend a single class."),x??(x=he)):ye===T.ImplementsKeyword&&(I&&ge(this,me,Vt).call(this,he,"'implements' clause already seen."),I??(I=he))}let re=this.createNode(t,{type:g,abstract:Xe(T.AbstractKeyword,t),body:this.createNode(t,{type:C.ClassBody,range:[t.members.pos-1,t.end],body:t.members.filter(Ph).map(he=>this.convertChild(he))}),declare:Xe(T.DeclareKeyword,t),decorators:((A=na(t))==null?void 0:A.map(he=>this.convertChild(he)))??[],id:this.convertChild(t.name),implements:(I==null?void 0:I.types.map(he=>this.convertChild(he)))??[],superClass:x!=null&&x.types[0]?this.convertChild(x.types[0].expression):null,superTypeArguments:void 0,typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});return(P=x==null?void 0:x.types[0])!=null&&P.typeArguments&&(re.superTypeArguments=this.convertTypeArgumentsToTypeParameterInstantiation(x.types[0].typeArguments,x.types[0])),this.fixExports(t,re)}case T.ModuleBlock:return this.createNode(t,{type:C.TSModuleBlock,body:this.convertBodyExpressions(t.statements,t)});case T.ImportDeclaration:{this.assertModuleSpecifier(t,!1);let y=this.createNode(t,ge(this,me,Qa).call(this,{type:C.ImportDeclaration,attributes:this.convertImportAttributes(t.attributes??t.assertClause),importKind:"value",source:this.convertChild(t.moduleSpecifier),specifiers:[]},"assertions","attributes",!0));if(t.importClause&&(t.importClause.isTypeOnly&&(y.importKind="type"),t.importClause.name&&y.specifiers.push(this.convertChild(t.importClause)),t.importClause.namedBindings))switch(t.importClause.namedBindings.kind){case T.NamespaceImport:y.specifiers.push(this.convertChild(t.importClause.namedBindings));break;case T.NamedImports:y.specifiers.push(...t.importClause.namedBindings.elements.map(g=>this.convertChild(g)));break}return y}case T.NamespaceImport:return this.createNode(t,{type:C.ImportNamespaceSpecifier,local:this.convertChild(t.name)});case T.ImportSpecifier:return this.createNode(t,{type:C.ImportSpecifier,imported:this.convertChild(t.propertyName??t.name),importKind:t.isTypeOnly?"type":"value",local:this.convertChild(t.name)});case T.ImportClause:{let y=this.convertChild(t.name);return this.createNode(t,{type:C.ImportDefaultSpecifier,range:y.range,local:y})}case T.ExportDeclaration:return((l=t.exportClause)==null?void 0:l.kind)===T.NamedExports?(this.assertModuleSpecifier(t,!0),this.createNode(t,ge(this,me,Qa).call(this,{type:C.ExportNamedDeclaration,attributes:this.convertImportAttributes(t.attributes??t.assertClause),declaration:null,exportKind:t.isTypeOnly?"type":"value",source:this.convertChild(t.moduleSpecifier),specifiers:t.exportClause.elements.map(y=>this.convertChild(y,t))},"assertions","attributes",!0))):(this.assertModuleSpecifier(t,!1),this.createNode(t,ge(this,me,Qa).call(this,{type:C.ExportAllDeclaration,attributes:this.convertImportAttributes(t.attributes??t.assertClause),exported:((Q=t.exportClause)==null?void 0:Q.kind)===T.NamespaceExport?this.convertChild(t.exportClause.name):null,exportKind:t.isTypeOnly?"type":"value",source:this.convertChild(t.moduleSpecifier)},"assertions","attributes",!0)));case T.ExportSpecifier:{let y=t.propertyName??t.name;return y.kind===T.StringLiteral&&a.kind===T.ExportDeclaration&&((h=a.moduleSpecifier)==null?void 0:h.kind)!==T.StringLiteral&&ge(this,me,Be).call(this,y,"A string literal cannot be used as a local exported binding without `from`."),this.createNode(t,{type:C.ExportSpecifier,exported:this.convertChild(t.name),exportKind:t.isTypeOnly?"type":"value",local:this.convertChild(y)})}case T.ExportAssignment:return t.isExportEquals?this.createNode(t,{type:C.TSExportAssignment,expression:this.convertChild(t.expression)}):this.createNode(t,{type:C.ExportDefaultDeclaration,declaration:this.convertChild(t.expression),exportKind:"value"});case T.PrefixUnaryExpression:case T.PostfixUnaryExpression:{let y=$r(t.operator);return y==="++"||y==="--"?(Jl(t.operand)||ge(this,me,Vt).call(this,t.operand,"Invalid left-hand side expression in unary operation"),this.createNode(t,{type:C.UpdateExpression,argument:this.convertChild(t.operand),operator:y,prefix:t.kind===T.PrefixUnaryExpression})):this.createNode(t,{type:C.UnaryExpression,argument:this.convertChild(t.operand),operator:y,prefix:t.kind===T.PrefixUnaryExpression})}case T.DeleteExpression:return this.createNode(t,{type:C.UnaryExpression,argument:this.convertChild(t.expression),operator:"delete",prefix:!0});case T.VoidExpression:return this.createNode(t,{type:C.UnaryExpression,argument:this.convertChild(t.expression),operator:"void",prefix:!0});case T.TypeOfExpression:return this.createNode(t,{type:C.UnaryExpression,argument:this.convertChild(t.expression),operator:"typeof",prefix:!0});case T.TypeOperator:return this.createNode(t,{type:C.TSTypeOperator,operator:$r(t.operator),typeAnnotation:this.convertChild(t.type)});case T.BinaryExpression:{if(Ih(t.operatorToken)){let g=this.createNode(t,{type:C.SequenceExpression,expressions:[]}),x=this.convertChild(t.left);return x.type===C.SequenceExpression&&t.left.kind!==T.ParenthesizedExpression?g.expressions.push(...x.expressions):g.expressions.push(x),g.expressions.push(this.convertChild(t.right)),g}let y=Oh(t.operatorToken);return this.allowPattern&&y.type===C.AssignmentExpression?this.createNode(t,{type:C.AssignmentPattern,decorators:[],left:this.convertPattern(t.left,t),optional:!1,right:this.convertChild(t.right),typeAnnotation:void 0}):this.createNode(t,{...y,left:this.converter(t.left,t,y.type===C.AssignmentExpression),right:this.convertChild(t.right)})}case T.PropertyAccessExpression:{let y=this.convertChild(t.expression),g=this.convertChild(t.name),I=this.createNode(t,{type:C.MemberExpression,computed:!1,object:y,optional:t.questionDotToken!=null,property:g});return this.convertChainExpression(I,t)}case T.ElementAccessExpression:{let y=this.convertChild(t.expression),g=this.convertChild(t.argumentExpression),I=this.createNode(t,{type:C.MemberExpression,computed:!0,object:y,optional:t.questionDotToken!=null,property:g});return this.convertChainExpression(I,t)}case T.CallExpression:{if(t.expression.kind===T.ImportKeyword)return t.arguments.length!==1&&t.arguments.length!==2&&ge(this,me,Vt).call(this,t.arguments[2]??t,"Dynamic import requires exactly one or two arguments."),this.createNode(t,ge(this,me,Qa).call(this,{type:C.ImportExpression,options:t.arguments[1]?this.convertChild(t.arguments[1]):null,source:this.convertChild(t.arguments[0])},"attributes","options",!0));let y=this.convertChild(t.expression),g=t.arguments.map(re=>this.convertChild(re)),x=t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t),I=this.createNode(t,{type:C.CallExpression,arguments:g,callee:y,optional:t.questionDotToken!=null,typeArguments:x});return this.convertChainExpression(I,t)}case T.NewExpression:{let y=t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t);return this.createNode(t,{type:C.NewExpression,arguments:t.arguments?t.arguments.map(g=>this.convertChild(g)):[],callee:this.convertChild(t.expression),typeArguments:y})}case T.ConditionalExpression:return this.createNode(t,{type:C.ConditionalExpression,alternate:this.convertChild(t.whenFalse),consequent:this.convertChild(t.whenTrue),test:this.convertChild(t.condition)});case T.MetaProperty:return this.createNode(t,{type:C.MetaProperty,meta:this.createNode(t.getFirstToken(),{type:C.Identifier,decorators:[],name:$r(t.keywordToken),optional:!1,typeAnnotation:void 0}),property:this.convertChild(t.name)});case T.Decorator:return this.createNode(t,{type:C.Decorator,expression:this.convertChild(t.expression)});case T.StringLiteral:return this.createNode(t,{type:C.Literal,raw:t.getText(),value:a.kind===T.JsxAttribute?Qf(t.text):t.text});case T.NumericLiteral:return this.createNode(t,{type:C.Literal,raw:t.getText(),value:Number(t.text)});case T.BigIntLiteral:{let y=$a(t,this.ast),g=this.ast.text.slice(y[0],y[1]),x=Sr(!1,g.slice(0,-1),"_",""),I=typeof BigInt<"u"?BigInt(x):null;return this.createNode(t,{type:C.Literal,range:y,bigint:I==null?x:String(I),raw:g,value:I})}case T.RegularExpressionLiteral:{let y=t.text.slice(1,t.text.lastIndexOf("/")),g=t.text.slice(t.text.lastIndexOf("/")+1),x=null;try{x=new RegExp(y,g)}catch{}return this.createNode(t,{type:C.Literal,raw:t.text,regex:{flags:g,pattern:y},value:x})}case T.TrueKeyword:return this.createNode(t,{type:C.Literal,raw:"true",value:!0});case T.FalseKeyword:return this.createNode(t,{type:C.Literal,raw:"false",value:!1});case T.NullKeyword:return this.createNode(t,{type:C.Literal,raw:"null",value:null});case T.EmptyStatement:return this.createNode(t,{type:C.EmptyStatement});case T.DebuggerStatement:return this.createNode(t,{type:C.DebuggerStatement});case T.JsxElement:return this.createNode(t,{type:C.JSXElement,children:t.children.map(y=>this.convertChild(y)),closingElement:this.convertChild(t.closingElement),openingElement:this.convertChild(t.openingElement)});case T.JsxFragment:return this.createNode(t,{type:C.JSXFragment,children:t.children.map(y=>this.convertChild(y)),closingFragment:this.convertChild(t.closingFragment),openingFragment:this.convertChild(t.openingFragment)});case T.JsxSelfClosingElement:return this.createNode(t,{type:C.JSXElement,children:[],closingElement:null,openingElement:this.createNode(t,{type:C.JSXOpeningElement,range:$a(t,this.ast),attributes:t.attributes.properties.map(y=>this.convertChild(y)),name:this.convertJSXTagName(t.tagName,t),selfClosing:!0,typeArguments:t.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t):void 0})});case T.JsxOpeningElement:return this.createNode(t,{type:C.JSXOpeningElement,attributes:t.attributes.properties.map(y=>this.convertChild(y)),name:this.convertJSXTagName(t.tagName,t),selfClosing:!1,typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t)});case T.JsxClosingElement:return this.createNode(t,{type:C.JSXClosingElement,name:this.convertJSXTagName(t.tagName,t)});case T.JsxOpeningFragment:return this.createNode(t,{type:C.JSXOpeningFragment});case T.JsxClosingFragment:return this.createNode(t,{type:C.JSXClosingFragment});case T.JsxExpression:{let y=t.expression?this.convertChild(t.expression):this.createNode(t,{type:C.JSXEmptyExpression,range:[t.getStart(this.ast)+1,t.getEnd()-1]});return t.dotDotDotToken?this.createNode(t,{type:C.JSXSpreadChild,expression:y}):this.createNode(t,{type:C.JSXExpressionContainer,expression:y})}case T.JsxAttribute:return this.createNode(t,{type:C.JSXAttribute,name:this.convertJSXNamespaceOrIdentifier(t.name),value:this.convertChild(t.initializer)});case T.JsxText:{let y=t.getFullStart(),g=t.getEnd(),x=this.ast.text.slice(y,g);return this.createNode(t,{type:C.JSXText,range:[y,g],raw:x,value:Qf(x)})}case T.JsxSpreadAttribute:return this.createNode(t,{type:C.JSXSpreadAttribute,argument:this.convertChild(t.expression)});case T.QualifiedName:return this.createNode(t,{type:C.TSQualifiedName,left:this.convertChild(t.left),right:this.convertChild(t.right)});case T.TypeReference:return this.createNode(t,{type:C.TSTypeReference,typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t),typeName:this.convertChild(t.typeName)});case T.TypeParameter:return this.createNode(t,{type:C.TSTypeParameter,const:Xe(T.ConstKeyword,t),constraint:t.constraint&&this.convertChild(t.constraint),default:t.default?this.convertChild(t.default):void 0,in:Xe(T.InKeyword,t),name:this.convertChild(t.name),out:Xe(T.OutKeyword,t)});case T.ThisType:return this.createNode(t,{type:C.TSThisType});case T.AnyKeyword:case T.BigIntKeyword:case T.BooleanKeyword:case T.NeverKeyword:case T.NumberKeyword:case T.ObjectKeyword:case T.StringKeyword:case T.SymbolKeyword:case T.UnknownKeyword:case T.VoidKeyword:case T.UndefinedKeyword:case T.IntrinsicKeyword:return this.createNode(t,{type:C[`TS${T[t.kind]}`]});case T.NonNullExpression:{let y=this.createNode(t,{type:C.TSNonNullExpression,expression:this.convertChild(t.expression)});return this.convertChainExpression(y,t)}case T.TypeLiteral:return this.createNode(t,{type:C.TSTypeLiteral,members:t.members.map(y=>this.convertChild(y))});case T.ArrayType:return this.createNode(t,{type:C.TSArrayType,elementType:this.convertChild(t.elementType)});case T.IndexedAccessType:return this.createNode(t,{type:C.TSIndexedAccessType,indexType:this.convertChild(t.indexType),objectType:this.convertChild(t.objectType)});case T.ConditionalType:return this.createNode(t,{type:C.TSConditionalType,checkType:this.convertChild(t.checkType),extendsType:this.convertChild(t.extendsType),falseType:this.convertChild(t.falseType),trueType:this.convertChild(t.trueType)});case T.TypeQuery:return this.createNode(t,{type:C.TSTypeQuery,exprName:this.convertChild(t.exprName),typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t)});case T.MappedType:return t.members&&t.members.length>0&&ge(this,me,Vt).call(this,t.members[0],"A mapped type may not declare properties or methods."),this.createNode(t,ge(this,me,id).call(this,{type:C.TSMappedType,constraint:this.convertChild(t.typeParameter.constraint),key:this.convertChild(t.typeParameter.name),nameType:this.convertChild(t.nameType)??null,optional:t.questionToken&&(t.questionToken.kind===T.QuestionToken||$r(t.questionToken.kind)),readonly:t.readonlyToken&&(t.readonlyToken.kind===T.ReadonlyKeyword||$r(t.readonlyToken.kind)),typeAnnotation:t.type&&this.convertChild(t.type)},"typeParameter","'constraint' and 'key'",this.convertChild(t.typeParameter)));case T.ParenthesizedExpression:return this.convertChild(t.expression,a);case T.TypeAliasDeclaration:{let y=this.createNode(t,{type:C.TSTypeAliasDeclaration,declare:Xe(T.DeclareKeyword,t),id:this.convertChild(t.name),typeAnnotation:this.convertChild(t.type),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});return this.fixExports(t,y)}case T.MethodSignature:return this.convertMethodSignature(t);case T.PropertySignature:{let{initializer:y}=t;return y&&ge(this,me,Be).call(this,y,"A property signature cannot have an initializer."),this.createNode(t,{type:C.TSPropertySignature,accessibility:xi(t),computed:ia(t.name),key:this.convertChild(t.name),optional:Kf(t),readonly:Xe(T.ReadonlyKeyword,t),static:Xe(T.StaticKeyword,t),typeAnnotation:t.type&&this.convertTypeAnnotation(t.type,t)})}case T.IndexSignature:return this.createNode(t,{type:C.TSIndexSignature,accessibility:xi(t),parameters:t.parameters.map(y=>this.convertChild(y)),readonly:Xe(T.ReadonlyKeyword,t),static:Xe(T.StaticKeyword,t),typeAnnotation:t.type&&this.convertTypeAnnotation(t.type,t)});case T.ConstructorType:return this.createNode(t,{type:C.TSConstructorType,abstract:Xe(T.AbstractKeyword,t),params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});case T.FunctionType:{let{modifiers:y}=t;y&&ge(this,me,Be).call(this,y[0],"A function type cannot have modifiers.")}case T.ConstructSignature:case T.CallSignature:{let y=t.kind===T.ConstructSignature?C.TSConstructSignatureDeclaration:t.kind===T.CallSignature?C.TSCallSignatureDeclaration:C.TSFunctionType;return this.createNode(t,{type:y,params:this.convertParameters(t.parameters),returnType:t.type&&this.convertTypeAnnotation(t.type,t),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)})}case T.ExpressionWithTypeArguments:{let y=a.kind,g=y===T.InterfaceDeclaration?C.TSInterfaceHeritage:y===T.HeritageClause?C.TSClassImplements:C.TSInstantiationExpression;return this.createNode(t,{type:g,expression:this.convertChild(t.expression),typeArguments:t.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t)})}case T.InterfaceDeclaration:{let y=t.heritageClauses??[],g=[];for(let I of y){I.token!==T.ExtendsKeyword&&ge(this,me,Be).call(this,I,I.token===T.ImplementsKeyword?"Interface declaration cannot have 'implements' clause.":"Unexpected token.");for(let re of I.types)g.push(this.convertChild(re,t))}let x=this.createNode(t,{type:C.TSInterfaceDeclaration,body:this.createNode(t,{type:C.TSInterfaceBody,range:[t.members.pos-1,t.end],body:t.members.map(I=>this.convertChild(I))}),declare:Xe(T.DeclareKeyword,t),extends:g,id:this.convertChild(t.name),typeParameters:t.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters)});return this.fixExports(t,x)}case T.TypePredicate:{let y=this.createNode(t,{type:C.TSTypePredicate,asserts:t.assertsModifier!=null,parameterName:this.convertChild(t.parameterName),typeAnnotation:null});return t.type&&(y.typeAnnotation=this.convertTypeAnnotation(t.type,t),y.typeAnnotation.loc=y.typeAnnotation.typeAnnotation.loc,y.typeAnnotation.range=y.typeAnnotation.typeAnnotation.range),y}case T.ImportType:{let y=$a(t,this.ast);if(t.isTypeOf){let x=ra(t.getFirstToken(),t,this.ast);y[0]=x.getStart(this.ast)}let g=this.createNode(t,{type:C.TSImportType,range:y,argument:this.convertChild(t.argument),attributes:this.convertImportAttributes(t.attributes),qualifier:this.convertChild(t.qualifier),typeArguments:t.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t):null});return t.isTypeOf?this.createNode(t,{type:C.TSTypeQuery,exprName:g,typeArguments:void 0}):g}case T.EnumDeclaration:{let y=t.members.map(x=>this.convertChild(x)),g=this.createNode(t,ge(this,me,id).call(this,{type:C.TSEnumDeclaration,body:this.createNode(t,{type:C.TSEnumBody,range:[t.members.pos-1,t.end],members:y}),const:Xe(T.ConstKeyword,t),declare:Xe(T.DeclareKeyword,t),id:this.convertChild(t.name)},"members","'body.members'",t.members.map(x=>this.convertChild(x))));return this.fixExports(t,g)}case T.EnumMember:return this.createNode(t,{type:C.TSEnumMember,computed:t.name.kind===Ie.ComputedPropertyName,id:this.convertChild(t.name),initializer:t.initializer&&this.convertChild(t.initializer)});case T.ModuleDeclaration:{let y=Xe(T.DeclareKeyword,t),g=this.createNode(t,{type:C.TSModuleDeclaration,...(()=>{if(t.flags&on.GlobalAugmentation){let I=this.convertChild(t.name),re=this.convertChild(t.body);return(re==null||re.type===C.TSModuleDeclaration)&&ge(this,me,Vt).call(this,t.body??t,"Expected a valid module body"),I.type!==C.Identifier&&ge(this,me,Vt).call(this,t.name,"global module augmentation must have an Identifier id"),{body:re,declare:!1,global:!1,id:I,kind:"global"}}if(!(t.flags&on.Namespace)){let I=this.convertChild(t.body);return{kind:"module",...I!=null?{body:I}:{},declare:!1,global:!1,id:this.convertChild(t.name)}}t.body==null&&ge(this,me,Vt).call(this,t,"Expected a module body"),t.name.kind!==Ie.Identifier&&ge(this,me,Vt).call(this,t.name,"`namespace`s must have an Identifier id");let x=this.createNode(t.name,{type:C.Identifier,range:[t.name.getStart(this.ast),t.name.getEnd()],decorators:[],name:t.name.text,optional:!1,typeAnnotation:void 0});for(;t.body&&Ti(t.body)&&t.body.name;){t=t.body,y||(y=Xe(T.DeclareKeyword,t));let I=t.name,re=this.createNode(I,{type:C.Identifier,range:[I.getStart(this.ast),I.getEnd()],decorators:[],name:I.text,optional:!1,typeAnnotation:void 0});x=this.createNode(I,{type:C.TSQualifiedName,range:[x.range[0],re.range[1]],left:x,right:re})}return{body:this.convertChild(t.body),declare:!1,global:!1,id:x,kind:"namespace"}})()});return g.declare=y,t.flags&on.GlobalAugmentation&&(g.global=!0),this.fixExports(t,g)}case T.ParenthesizedType:return this.convertChild(t.type);case T.UnionType:return this.createNode(t,{type:C.TSUnionType,types:t.types.map(y=>this.convertChild(y))});case T.IntersectionType:return this.createNode(t,{type:C.TSIntersectionType,types:t.types.map(y=>this.convertChild(y))});case T.AsExpression:return this.createNode(t,{type:C.TSAsExpression,expression:this.convertChild(t.expression),typeAnnotation:this.convertChild(t.type)});case T.InferType:return this.createNode(t,{type:C.TSInferType,typeParameter:this.convertChild(t.typeParameter)});case T.LiteralType:return t.literal.kind===T.NullKeyword?this.createNode(t.literal,{type:C.TSNullKeyword}):this.createNode(t,{type:C.TSLiteralType,literal:this.convertChild(t.literal)});case T.TypeAssertionExpression:return this.createNode(t,{type:C.TSTypeAssertion,expression:this.convertChild(t.expression),typeAnnotation:this.convertChild(t.type)});case T.ImportEqualsDeclaration:return this.fixExports(t,this.createNode(t,{type:C.TSImportEqualsDeclaration,id:this.convertChild(t.name),importKind:t.isTypeOnly?"type":"value",moduleReference:this.convertChild(t.moduleReference)}));case T.ExternalModuleReference:return t.expression.kind!==T.StringLiteral&&ge(this,me,Be).call(this,t.expression,"String literal expected."),this.createNode(t,{type:C.TSExternalModuleReference,expression:this.convertChild(t.expression)});case T.NamespaceExportDeclaration:return this.createNode(t,{type:C.TSNamespaceExportDeclaration,id:this.convertChild(t.name)});case T.AbstractKeyword:return this.createNode(t,{type:C.TSAbstractKeyword});case T.TupleType:{let y=t.elements.map(g=>this.convertChild(g));return this.createNode(t,{type:C.TSTupleType,elementTypes:y})}case T.NamedTupleMember:{let y=this.createNode(t,{type:C.TSNamedTupleMember,elementType:this.convertChild(t.type,t),label:this.convertChild(t.name,t),optional:t.questionToken!=null});return t.dotDotDotToken?(y.range[0]=y.label.range[0],y.loc.start=y.label.loc.start,this.createNode(t,{type:C.TSRestType,typeAnnotation:y})):y}case T.OptionalType:return this.createNode(t,{type:C.TSOptionalType,typeAnnotation:this.convertChild(t.type)});case T.RestType:return this.createNode(t,{type:C.TSRestType,typeAnnotation:this.convertChild(t.type)});case T.TemplateLiteralType:{let y=this.createNode(t,{type:C.TSTemplateLiteralType,quasis:[this.convertChild(t.head)],types:[]});return t.templateSpans.forEach(g=>{y.types.push(this.convertChild(g.type)),y.quasis.push(this.convertChild(g.literal))}),y}case T.ClassStaticBlockDeclaration:return this.createNode(t,{type:C.StaticBlock,body:this.convertBodyExpressions(t.body.statements,t)});case T.AssertEntry:case T.ImportAttribute:return this.createNode(t,{type:C.ImportAttribute,key:this.convertChild(t.name),value:this.convertChild(t.value)});case T.SatisfiesExpression:return this.createNode(t,{type:C.TSSatisfiesExpression,expression:this.convertChild(t.expression),typeAnnotation:this.convertChild(t.type)});default:return this.deeplyCopy(t)}}createNode(t,a){let o=a;return o.range??(o.range=$a(t,this.ast)),o.loc??(o.loc=Qr(o.range,this.ast)),o&&this.options.shouldPreserveNodeMaps&&this.esTreeNodeToTSNodeMap.set(o,t),o}convertProgram(){return this.converter(this.ast)}deeplyCopy(t){t.kind===Ie.JSDocFunctionType&&ge(this,me,Be).call(this,t,"JSDoc types can only be used inside documentation comments.");let a=`TS${T[t.kind]}`;if(this.options.errorOnUnknownASTType&&!C[a])throw new Error(`Unknown AST_NODE_TYPE: "${a}"`);let o=this.createNode(t,{type:a});"type"in t&&(o.typeAnnotation=t.type&&"kind"in t.type&&o1(t.type)?this.convertTypeAnnotation(t.type,t):null),"typeArguments"in t&&(o.typeArguments=t.typeArguments&&"pos"in t.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(t.typeArguments,t):null),"typeParameters"in t&&(o.typeParameters=t.typeParameters&&"pos"in t.typeParameters?this.convertTSTypeParametersToTypeParametersDeclaration(t.typeParameters):null);let m=na(t);m!=null&&m.length&&(o.decorators=m.map(A=>this.convertChild(A)));let v=new Set(["_children","decorators","end","flags","heritageClauses","illegalDecorators","jsDoc","kind","locals","localSymbol","modifierFlagsCache","modifiers","nextContainer","parent","pos","symbol","transformFlags","type","typeArguments","typeParameters"]);return Object.entries(t).filter(([A])=>!v.has(A)).forEach(([A,P])=>{Array.isArray(P)?o[A]=P.map(l=>this.convertChild(l)):P&&typeof P=="object"&&P.kind?o[A]=this.convertChild(P):o[A]=P}),o}fixExports(t,a){let m=Ti(t)&&!!(t.flags&on.Namespace)?Fh(t):er(t);if((m==null?void 0:m[0].kind)===T.ExportKeyword){this.registerTSNodeInNodeMap(t,a);let v=m[0],A=m[1],P=(A==null?void 0:A.kind)===T.DefaultKeyword,l=P?ra(A,this.ast,this.ast):ra(v,this.ast,this.ast);if(a.range[0]=l.getStart(this.ast),a.loc=Qr(a.range,this.ast),P)return this.createNode(t,{type:C.ExportDefaultDeclaration,range:[v.getStart(this.ast),a.range[1]],declaration:a,exportKind:"value"});let Q=a.type===C.TSInterfaceDeclaration||a.type===C.TSTypeAliasDeclaration,h="declare"in a&&a.declare;return this.createNode(t,ge(this,me,Qa).call(this,{type:C.ExportNamedDeclaration,range:[v.getStart(this.ast),a.range[1]],attributes:[],declaration:a,exportKind:Q||h?"type":"value",source:null,specifiers:[]},"assertions","attributes",!0))}return a}getASTMaps(){return{esTreeNodeToTSNodeMap:this.esTreeNodeToTSNodeMap,tsNodeToESTreeNodeMap:this.tsNodeToESTreeNodeMap}}registerTSNodeInNodeMap(t,a){a&&this.options.shouldPreserveNodeMaps&&!this.tsNodeToESTreeNodeMap.has(t)&&this.tsNodeToESTreeNodeMap.set(t,a)}};me=new WeakSet,rd=function(t,a){let o=a===Ie.ForInStatement?"for...in":"for...of";if(K1(t)){t.declarations.length!==1&&ge(this,me,Be).call(this,t,`Only a single variable declaration is allowed in a '${o}' statement.`);let m=t.declarations[0];m.initializer?ge(this,me,Be).call(this,m,`The variable declaration of a '${o}' statement cannot have an initializer.`):m.type&&ge(this,me,Be).call(this,m,`The variable declaration of a '${o}' statement cannot have a type annotation.`),a===Ie.ForInStatement&&t.flags&on.Using&&ge(this,me,Be).call(this,t,"The left-hand side of a 'for...in' statement cannot be a 'using' declaration.")}else!Jl(t)&&t.kind!==Ie.ObjectLiteralExpression&&t.kind!==Ie.ArrayLiteralExpression&&ge(this,me,Be).call(this,t,`The left-hand side of a '${o}' statement must be a variable or a property access.`)},Vh=function(t){if(!this.options.allowInvalidAST){Rh(t)&&ge(this,me,Be).call(this,t.illegalDecorators[0],"Decorators are not valid here.");for(let a of na(t,!0)??[])zh(t)||(ms(t)&&!td(t.body)?ge(this,me,Be).call(this,a,"A decorator can only decorate a method implementation, not an overload."):ge(this,me,Be).call(this,a,"Decorators are not valid here."));for(let a of er(t,!0)??[]){if(a.kind!==T.ReadonlyKeyword&&((t.kind===T.PropertySignature||t.kind===T.MethodSignature)&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on a type member`),t.kind===T.IndexSignature&&(a.kind!==T.StaticKeyword||!vi(t.parent))&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on an index signature`)),a.kind!==T.InKeyword&&a.kind!==T.OutKeyword&&a.kind!==T.ConstKeyword&&t.kind===T.TypeParameter&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on a type parameter`),(a.kind===T.InKeyword||a.kind===T.OutKeyword)&&(t.kind!==T.TypeParameter||!(vs(t.parent)||vi(t.parent)||Dl(t.parent)))&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier can only appear on a type parameter of a class, interface or type alias`),a.kind===T.ReadonlyKeyword&&t.kind!==T.PropertyDeclaration&&t.kind!==T.PropertySignature&&t.kind!==T.IndexSignature&&t.kind!==T.Parameter&&ge(this,me,Be).call(this,a,"'readonly' modifier can only appear on a property declaration or index signature."),a.kind===T.DeclareKeyword&&vi(t.parent)&&!Va(t)&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on class elements of this kind.`),a.kind===T.DeclareKeyword&&Ha(t)){let o=Ml(t.declarationList);(o==="using"||o==="await using")&&ge(this,me,Be).call(this,a,`'declare' modifier cannot appear on a '${o}' declaration.`)}if(a.kind===T.AbstractKeyword&&t.kind!==T.ClassDeclaration&&t.kind!==T.ConstructorType&&t.kind!==T.MethodDeclaration&&t.kind!==T.PropertyDeclaration&&t.kind!==T.GetAccessor&&t.kind!==T.SetAccessor&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier can only appear on a class, method, or property declaration.`),(a.kind===T.StaticKeyword||a.kind===T.PublicKeyword||a.kind===T.ProtectedKeyword||a.kind===T.PrivateKeyword)&&(t.parent.kind===T.ModuleBlock||t.parent.kind===T.SourceFile)&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on a module or namespace element.`),a.kind===T.AccessorKeyword&&t.kind!==T.PropertyDeclaration&&ge(this,me,Be).call(this,a,"'accessor' modifier can only appear on a property declaration."),a.kind===T.AsyncKeyword&&t.kind!==T.MethodDeclaration&&t.kind!==T.FunctionDeclaration&&t.kind!==T.FunctionExpression&&t.kind!==T.ArrowFunction&&ge(this,me,Be).call(this,a,"'async' modifier cannot be used here."),t.kind===T.Parameter&&(a.kind===T.StaticKeyword||a.kind===T.ExportKeyword||a.kind===T.DeclareKeyword||a.kind===T.AsyncKeyword)&&ge(this,me,Be).call(this,a,`'${it(a.kind)}' modifier cannot appear on a parameter.`),a.kind===T.PublicKeyword||a.kind===T.ProtectedKeyword||a.kind===T.PrivateKeyword)for(let o of er(t)??[])o!==a&&(o.kind===T.PublicKeyword||o.kind===T.ProtectedKeyword||o.kind===T.PrivateKeyword)&&ge(this,me,Be).call(this,o,"Accessibility modifier already seen.");if(t.kind===T.Parameter&&(a.kind===T.PublicKeyword||a.kind===T.PrivateKeyword||a.kind===T.ProtectedKeyword||a.kind===T.ReadonlyKeyword||a.kind===T.OverrideKeyword)){let o=qh(t);o.kind===T.Constructor&&td(o.body)||ge(this,me,Be).call(this,a,"A parameter property is only allowed in a constructor implementation.")}}}},Be=function(t,a){let o,m;throw typeof t=="number"?o=m=t:(o=t.getStart(this.ast),m=t.getEnd()),ed(a,this.ast,o,m)},Vt=function(t,a){this.options.allowInvalidAST||ge(this,me,Be).call(this,t,a)},Qa=function(t,a,o,m=!1){let v=m;return Object.defineProperty(t,a,{configurable:!0,get:this.options.suppressDeprecatedPropertyWarnings?()=>t[o]:()=>(v||((void 0)(`The '${a}' property is deprecated on ${t.type} nodes. Use '${o}' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,"DeprecationWarning"),v=!0),t[o]),set(A){Object.defineProperty(t,a,{enumerable:!0,value:A,writable:!0})}}),t},id=function(t,a,o,m){let v=!1;return Object.defineProperty(t,a,{configurable:!0,get:this.options.suppressDeprecatedPropertyWarnings?()=>m:()=>(v||((void 0)(`The '${a}' property is deprecated on ${t.type} nodes. Use ${o} instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,"DeprecationWarning"),v=!0),m),set(A){Object.defineProperty(t,a,{enumerable:!0,value:A,writable:!0})}}),t};function wv(e,t,a=e.getSourceFile()){let o=[];for(;;){if(df(e.kind))t(e);else{let m=e.getChildren(a);if(m.length===1){e=m[0];continue}for(let v=m.length-1;v>=0;--v)o.push(m[v])}if(o.length===0)break;e=o.pop()}}function Gh(e,t,a=e.getSourceFile()){let o=a.text,m=a.languageVariant!==Tl.JSX;return wv(e,A=>{if(A.pos!==A.end&&(A.kind!==Ie.JsxText&&Hm(o,A.pos===0?(_f(o)??"").length:A.pos,v),m||kv(A)))return $m(o,A.end,v)},a);function v(A,P,l){t(o,{end:P,kind:l,pos:A})}}function kv(e){switch(e.kind){case Ie.CloseBraceToken:return e.parent.kind!==Ie.JsxExpression||!_d(e.parent.parent);case Ie.GreaterThanToken:switch(e.parent.kind){case Ie.JsxClosingElement:case Ie.JsxClosingFragment:return!_d(e.parent.parent.parent);case Ie.JsxOpeningElement:return e.end!==e.parent.end;case Ie.JsxOpeningFragment:return!1;case Ie.JsxSelfClosingElement:return e.end!==e.parent.end||!_d(e.parent.parent)}}return!0}function _d(e){return e.kind===Ie.JsxElement||e.kind===Ie.JsxFragment}var[YT,XT]=wm.split(".").map(e=>Number.parseInt(e,10));var HT=nn.Intrinsic??nn.Any|nn.Unknown|nn.String|nn.Number|nn.BigInt|nn.Boolean|nn.BooleanLiteral|nn.ESSymbol|nn.Void|nn.Undefined|nn.Null|nn.Never|nn.NonPrimitive;function Yh(e,t){let a=[];return Gh(e,(o,m)=>{let v=m.kind===Ie.SingleLineCommentTrivia?Rt.Line:Rt.Block,A=[m.pos,m.end],P=Qr(A,e),l=A[0]+2,Q=m.kind===Ie.SingleLineCommentTrivia?A[1]-l:A[1]-l-2;a.push({type:v,loc:P,range:A,value:t.slice(l,l+Q)})},e),a}var Xh=()=>{};function Hh(e,t,a){let{parseDiagnostics:o}=e;if(o.length)throw ad(o[0]);let m=new Ll(e,{allowInvalidAST:t.allowInvalidAST,errorOnUnknownASTType:t.errorOnUnknownASTType,shouldPreserveNodeMaps:a,suppressDeprecatedPropertyWarnings:t.suppressDeprecatedPropertyWarnings}),v=m.convertProgram();return(!t.range||!t.loc)&&Xh(v,{enter:P=>{t.range||delete P.range,t.loc||delete P.loc}}),t.tokens&&(v.tokens=jh(e)),t.comment&&(v.comments=Yh(e,t.codeFullText)),{astMaps:m.getASTMaps(),estree:v}}function jl(e){if(typeof e!="object"||e==null)return!1;let t=e;return t.kind===Ie.SourceFile&&typeof t.getFullText=="function"}var Iv=function(e){return e&&e.__esModule?e:{default:e}};var Ov=Iv({extname:e=>"."+e.split(".").pop()});function Qh(e,t){switch(Ov.default.extname(e).toLowerCase()){case Nn.Cjs:case Nn.Js:case Nn.Mjs:return Dr.JS;case Nn.Cts:case Nn.Mts:case Nn.Ts:return Dr.TS;case Nn.Json:return Dr.JSON;case Nn.Jsx:return Dr.JSX;case Nn.Tsx:return Dr.TSX;default:return t?Dr.TSX:Dr.TS}}var Jv={default:Ia},Lv=(0,Jv.default)("typescript-eslint:typescript-estree:create-program:createSourceFile");function Kh(e){return Lv("Getting AST without type information in %s mode for: %s",e.jsx?"TSX":"TS",e.filePath),jl(e.code)?e.code:dh(e.filePath,e.codeFullText,{jsDocParsingMode:e.jsDocParsingMode,languageVersion:ys.Latest,setExternalModuleIndicator:e.setExternalModuleIndicator},!0,Qh(e.filePath,e.jsx))}var Zh=()=>{};var e0=e=>e;var t0=class{};var r0=()=>!1;var i0=()=>{};var Xv=function(e){return e&&e.__esModule?e:{default:e}};var sd={default:Ia},Hv=Xv({extname:e=>"."+e.split(".").pop()}),$v=(0,sd.default)("typescript-eslint:typescript-estree:parseSettings:createParseSettings"),Qv,Kv=null,a0,_0,s0,o0,xs={ParseAll:(a0=Ga)==null?void 0:a0.ParseAll,ParseForTypeErrors:(_0=Ga)==null?void 0:_0.ParseForTypeErrors,ParseForTypeInfo:(s0=Ga)==null?void 0:s0.ParseForTypeInfo,ParseNone:(o0=Ga)==null?void 0:o0.ParseNone};function c0(e,t={}){var h;let a=Zv(e),o=r0(t),m=typeof t.tsconfigRootDir=="string"?t.tsconfigRootDir:"/prettier-security-dirname-placeholder",v=typeof t.loggerFn=="function",A=e0(typeof t.filePath=="string"&&t.filePath!==""?t.filePath:e4(t.jsx),m),P=Hv.default.extname(A).toLowerCase(),l=(()=>{switch(t.jsDocParsingMode){case"all":return xs.ParseAll;case"none":return xs.ParseNone;case"type-info":return xs.ParseForTypeInfo;default:return xs.ParseAll}})(),Q={loc:t.loc===!0,range:t.range===!0,allowInvalidAST:t.allowInvalidAST===!0,code:e,codeFullText:a,comment:t.comment===!0,comments:[],debugLevel:t.debugLevel===!0?new Set(["typescript-eslint"]):Array.isArray(t.debugLevel)?new Set(t.debugLevel):new Set,errorOnTypeScriptSyntacticAndSemanticIssues:!1,errorOnUnknownASTType:t.errorOnUnknownASTType===!0,extraFileExtensions:Array.isArray(t.extraFileExtensions)&&t.extraFileExtensions.every(y=>typeof y=="string")?t.extraFileExtensions:[],filePath:A,jsDocParsingMode:l,jsx:t.jsx===!0,log:typeof t.loggerFn=="function"?t.loggerFn:t.loggerFn===!1?()=>{}:console.log,preserveNodeMaps:t.preserveNodeMaps!==!1,programs:Array.isArray(t.programs)?t.programs:null,projects:new Map,projectService:t.projectService||t.project&&t.projectService!==!1&&(void 0).env.TYPESCRIPT_ESLINT_PROJECT_SERVICE==="true"?Kv??(Kv=Zh(t.projectService,l,m)):void 0,setExternalModuleIndicator:t.sourceType==="module"||t.sourceType==null&&P===Nn.Mjs||t.sourceType==null&&P===Nn.Mts?y=>{y.externalModuleIndicator=!0}:void 0,singleRun:o,suppressDeprecatedPropertyWarnings:t.suppressDeprecatedPropertyWarnings??!0,tokens:t.tokens===!0?[]:null,tsconfigMatchCache:Qv??(Qv=new t0(o?"Infinity":((h=t.cacheLifetime)==null?void 0:h.glob)??void 0)),tsconfigRootDir:m};if(Q.debugLevel.size>0){let y=[];Q.debugLevel.has("typescript-eslint")&&y.push("typescript-eslint:*"),(Q.debugLevel.has("eslint")||sd.default.enabled("eslint:*,-eslint:code-path"))&&y.push("eslint:*,-eslint:code-path"),sd.default.enable(y.join(","))}if(Array.isArray(t.programs)){if(!t.programs.length)throw new Error("You have set parserOptions.programs to an empty array. This will cause all files to not be found in existing programs. Either provide one or more existing TypeScript Program instances in the array, or remove the parserOptions.programs setting.");$v("parserOptions.programs was provided, so parserOptions.project will be ignored.")}return!Q.programs&&!Q.projectService&&(Q.projects=new Map),t.jsDocParsingMode==null&&Q.projects.size===0&&Q.programs==null&&Q.projectService==null&&(Q.jsDocParsingMode=xs.ParseNone),i0(Q,v),Q}function Zv(e){return jl(e)?e.getFullText(e):typeof e=="string"?e:String(e)}function e4(e){return e?"estree.tsx":"estree.ts"}var i4={default:Ia},ux=(0,i4.default)("typescript-eslint:typescript-estree:parser");function l0(e,t){let{ast:a}=a4(e,t,!1);return a}function a4(e,t,a){let o=c0(e,t);if(t!=null&&t.errorOnTypeScriptSyntacticAndSemanticIssues)throw new Error('"errorOnTypeScriptSyntacticAndSemanticIssues" is only supported for parseAndGenerateServices()');let m=Kh(o),{astMaps:v,estree:A}=Hh(m,o,a);return{ast:A,esTreeNodeToTSNodeMap:v.esTreeNodeToTSNodeMap,tsNodeToESTreeNodeMap:v.tsNodeToESTreeNodeMap}}function _4(e,t){let a=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(a,t)}var u0=_4;function s4(e){let t=[];for(let a of e)try{return a()}catch(o){t.push(o)}throw Object.assign(new Error("All combinations failed"),{errors:t})}var p0=s4;var o4=(e,t,a)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[a<0?t.length+a:a]:t.at(a)},od=o4;function c4(e){return Array.isArray(e)&&e.length>0}var f0=c4;function tr(e){var o,m,v;let t=((o=e.range)==null?void 0:o[0])??e.start,a=(v=((m=e.declaration)==null?void 0:m.decorators)??e.decorators)==null?void 0:v[0];return a?Math.min(tr(a),t):t}function Kr(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function l4(e){let t=new Set(e);return a=>t.has(a==null?void 0:a.type)}var d0=l4;var u4=d0(["Block","CommentBlock","MultiLine"]),Ss=u4;function p4(e){let t=`*${e.value}*`.split(` +`);return t.length>1&&t.every(a=>a.trimStart()[0]==="*")}var cd=p4;function f4(e){return Ss(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(e.value)}var m0=f4;var ws=null;function ks(e){if(ws!==null&&typeof ws.property){let t=ws;return ws=ks.prototype=null,t}return ws=ks.prototype=e??Object.create(null),new ks}var d4=10;for(let e=0;e<=d4;e++)ks();function ld(e){return ks(e)}function m4(e,t="type"){ld(e);function a(o){let m=o[t],v=e[m];if(!Array.isArray(v))throw Object.assign(new Error(`Missing visitor keys for '${m}'.`),{node:o});return v}return a}var h0=m4;var y0={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var h4=h0(y0),g0=h4;function ud(e,t){if(!(e!==null&&typeof e=="object"))return e;if(Array.isArray(e)){for(let o=0;o{var A;(A=v.leadingComments)!=null&&A.some(m0)&&m.add(tr(v))}),e=Rl(e,v=>{if(v.type==="ParenthesizedExpression"){let{expression:A}=v;if(A.type==="TypeCastExpression")return A.range=[...v.range],A;let P=tr(v);if(!m.has(P))return A.extra={...A.extra,parenthesized:!0},A}})}if(e=Rl(e,m=>{switch(m.type){case"LogicalExpression":if(b0(m))return pd(m);break;case"VariableDeclaration":{let v=od(!1,m.declarations,-1);v!=null&&v.init&&o[Kr(v)]!==";"&&(m.range=[tr(m),Kr(v)]);break}case"TSParenthesizedType":return m.typeAnnotation;case"TSTypeParameter":if(typeof m.name=="string"){let v=tr(m);m.name={type:"Identifier",name:m.name,range:[v,v+m.name.length]}}break;case"TopicReference":e.extra={...e.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(m.types.length===1)return m.types[0];break}}),f0(e.comments)){let m=od(!1,e.comments,-1);for(let v=e.comments.length-2;v>=0;v--){let A=e.comments[v];Kr(A)===tr(m)&&Ss(A)&&Ss(m)&&cd(A)&&cd(m)&&(e.comments.splice(v+1,1),A.value+="*//*"+m.value,A.range=[tr(A),Kr(m)]),m=A}}return e.type==="Program"&&(e.range=[0,o.length]),e}function b0(e){return e.type==="LogicalExpression"&&e.right.type==="LogicalExpression"&&e.operator===e.right.operator}function pd(e){return b0(e)?pd({type:"LogicalExpression",operator:e.operator,left:pd({type:"LogicalExpression",operator:e.operator,left:e.left,right:e.right.left,range:[tr(e.left),Kr(e.right.left)]}),right:e.right.right,range:[tr(e),Kr(e)]}):e}var v0=y4;var g4=/\*\/$/,b4=/^\/\*\*?/,v4=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,T4=/(^|\s+)\/\/([^\n\r]*)/g,T0=/^(\r?\n)+/,x4=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,x0=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,S4=/(\r?\n|^) *\* ?/g,w4=[];function S0(e){let t=e.match(v4);return t?t[0].trimStart():""}function w0(e){let t=` +`;e=Sr(!1,e.replace(b4,"").replace(g4,""),S4,"$1");let a="";for(;a!==e;)a=e,e=Sr(!1,e,x4,`${t}$1 $2${t}`);e=e.replace(T0,"").trimEnd();let o=Object.create(null),m=Sr(!1,e,x0,"").replace(T0,"").trimEnd(),v;for(;v=x0.exec(e);){let A=Sr(!1,v[2],T4,"");if(typeof o[v[1]]=="string"||Array.isArray(o[v[1]])){let P=o[v[1]];o[v[1]]=[...w4,...Array.isArray(P)?P:[P],A]}else o[v[1]]=A}return{comments:m,pragmas:o}}function k4(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` +`);return t===-1?e:e.slice(0,t)}var k0=k4;function E4(e){let t=k0(e);t&&(e=e.slice(t.length+1));let a=S0(e),{pragmas:o,comments:m}=w0(a);return{shebang:t,text:e,pragmas:o,comments:m}}function E0(e){let{pragmas:t}=E4(e);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function A4(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:E0,locStart:tr,locEnd:Kr,...e}}var A0=A4;function C4(e){let{filepath:t}=e;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs")||t.endsWith(".cts"))return"script";if(t.endsWith(".mjs")||t.endsWith(".mts"))return"module"}}var C0=C4;function D4(e){return e.charAt(0)==="#"&&e.charAt(1)==="!"?"//"+e.slice(2):e}var D0=D4;var P4={loc:!0,range:!0,comment:!0,tokens:!0,loggerFn:!1,project:!1,jsDocParsingMode:"none",suppressDeprecatedPropertyWarnings:!0};function N4(e){if(!(e!=null&&e.location))return e;let{message:t,location:{start:a,end:o}}=e;return u0(t,{loc:{start:{line:a.line,column:a.column+1},end:{line:o.line,column:o.column+1}},cause:e})}var I4=e=>/\.(?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$/iu.test(e);function O4(e,t){let a=t==null?void 0:t.filepath,o=[{...P4,filePath:a}],m=C0(t);if(m?o=o.map(A=>({...A,sourceType:m})):o=["module","script"].flatMap(P=>o.map(l=>({...l,sourceType:P}))),a&&I4(a))return o;let v=J4(e);return[v,!v].flatMap(A=>o.map(P=>({...P,jsx:A})))}function M4(e,t={}){let a=D0(e),o=O4(e,t),m;try{m=p0(o.map(v=>()=>l0(a,v)))}catch({errors:[v]}){throw N4(v)}return v0(m,{text:e})}function J4(e){return new RegExp(["(?:^[^\"'`]*)"].join(""),"mu").test(e)}var L4=A0(M4);var uS=dd;export{uS as default,fd as parsers}; diff --git a/node_modules/prettier/plugins/yaml.js b/node_modules/prettier/plugins/yaml.js new file mode 100644 index 0000000..8625774 --- /dev/null +++ b/node_modules/prettier/plugins/yaml.js @@ -0,0 +1,161 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.yaml=e()}})(function(){"use strict";var Ti=Object.create;var yt=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var Mi=Object.getOwnPropertyNames;var ki=Object.getPrototypeOf,vi=Object.prototype.hasOwnProperty;var te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nr=(t,e)=>{for(var n in e)yt(t,n,{get:e[n],enumerable:!0})},rr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Mi(e))!vi.call(t,s)&&s!==n&&yt(t,s,{get:()=>e[s],enumerable:!(r=Ci(e,s))||r.enumerable});return t};var sr=(t,e,n)=>(n=t!=null?Ti(ki(t)):{},rr(e||!t||!t.__esModule?yt(n,"default",{value:t,enumerable:!0}):n,t)),Ii=t=>rr(yt({},"__esModule",{value:!0}),t);var le=te(U=>{"use strict";var re={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},lt={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},Ao="tag:yaml.org,2002:",To={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function Ps(t){let e=[0],n=t.indexOf(` +`);for(;n!==-1;)n+=1,e.push(n),n=t.indexOf(` +`,n);return e}function _s(t){let e,n;return typeof t=="string"?(e=Ps(t),n=t):(Array.isArray(t)&&(t=t[0]),t&&t.context&&(t.lineStarts||(t.lineStarts=Ps(t.context.src)),e=t.lineStarts,n=t.context.src)),{lineStarts:e,src:n}}function Tn(t,e){if(typeof t!="number"||t<0)return null;let{lineStarts:n,src:r}=_s(e);if(!n||!r||t>r.length)return null;for(let i=0;i=1)||t>n.length)return null;let s=n[t-1],i=n[t];for(;i&&i>s&&r[i-1]===` +`;)--i;return r.slice(s,i)}function Mo({start:t,end:e},n,r=80){let s=Co(t.line,n);if(!s)return null;let{col:i}=t;if(s.length>r)if(i<=r-10)s=s.substr(0,r-1)+"\u2026";else{let f=Math.round(r/2);s.length>i+f&&(s=s.substr(0,i+f-1)+"\u2026"),i-=s.length-r,s="\u2026"+s.substr(1-r)}let o=1,a="";e&&(e.line===t.line&&i+(e.col-t.col)<=r+1?o=e.col-t.col:(o=Math.min(s.length+1,r)-i,a="\u2026"));let c=i>1?" ".repeat(i-1):"",l="^".repeat(o);return`${s} +${c}${l}${a}`}var Be=class t{static copy(e){return new t(e.start,e.end)}constructor(e,n){this.start=e,this.end=n||e}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(e,n){let{start:r,end:s}=this;if(e.length===0||s<=e[0])return this.origStart=r,this.origEnd=s,n;let i=n;for(;ir);)++i;this.origStart=r+i;let o=i;for(;i=s);)++i;return this.origEnd=s+i,o}},se=class t{static addStringTerminator(e,n,r){if(r[r.length-1]===` +`)return r;let s=t.endOfWhiteSpace(e,n);return s>=e.length||e[s]===` +`?r+` +`:r}static atDocumentBoundary(e,n,r){let s=e[n];if(!s)return!0;let i=e[n-1];if(i&&i!==` +`)return!1;if(r){if(s!==r)return!1}else if(s!==re.DIRECTIVES_END&&s!==re.DOCUMENT_END)return!1;let o=e[n+1],a=e[n+2];if(o!==s||a!==s)return!1;let c=e[n+3];return!c||c===` +`||c===" "||c===" "}static endOfIdentifier(e,n){let r=e[n],s=r==="<",i=s?[` +`," "," ",">"]:[` +`," "," ","[","]","{","}",","];for(;r&&i.indexOf(r)===-1;)r=e[n+=1];return s&&r===">"&&(n+=1),n}static endOfIndent(e,n){let r=e[n];for(;r===" ";)r=e[n+=1];return n}static endOfLine(e,n){let r=e[n];for(;r&&r!==` +`;)r=e[n+=1];return n}static endOfWhiteSpace(e,n){let r=e[n];for(;r===" "||r===" ";)r=e[n+=1];return n}static startOfLine(e,n){let r=e[n-1];if(r===` +`)return n;for(;r&&r!==` +`;)r=e[n-=1];return n+1}static endOfBlockIndent(e,n,r){let s=t.endOfIndent(e,r);if(s>r+n)return s;{let i=t.endOfWhiteSpace(e,s),o=e[i];if(!o||o===` +`)return i}return null}static atBlank(e,n,r){let s=e[n];return s===` +`||s===" "||s===" "||r&&!s}static nextNodeIsIndented(e,n,r){return!e||n<0?!1:n>0?!0:r&&e==="-"}static normalizeOffset(e,n){let r=e[n];return r?r!==` +`&&e[n-1]===` +`?n-1:t.endOfWhiteSpace(e,n):n}static foldNewline(e,n,r){let s=0,i=!1,o="",a=e[n+1];for(;a===" "||a===" "||a===` +`;){switch(a){case` +`:s=0,n+=1,o+=` +`;break;case" ":s<=r&&(i=!0),n=t.endOfWhiteSpace(e,n+2)-1;break;case" ":s+=1,n+=1;break}a=e[n+1]}return o||(o=" "),a&&s<=r&&(i=!0),{fold:o,offset:n,error:i}}constructor(e,n,r){Object.defineProperty(this,"context",{value:r||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=n||[],this.type=e,this.value=null}getPropValue(e,n,r){if(!this.context)return null;let{src:s}=this.context,i=this.props[e];return i&&s[i.start]===n?s.slice(i.start+(r?1:0),i.end):null}get anchor(){for(let e=0;e0?e.join(` +`):null}commentHasRequiredWhitespace(e){let{src:n}=this.context;if(this.header&&e===this.header.end||!this.valueRange)return!1;let{end:r}=this.valueRange;return e!==r||t.atBlank(n,r-1)}get hasComment(){if(this.context){let{src:e}=this.context;for(let n=0;nr.setOrigRange(e,n)),n}toString(){let{context:{src:e},range:n,value:r}=this;if(r!=null)return r;let s=e.slice(n.start,n.end);return t.addStringTerminator(e,n.end,s)}},ye=class extends Error{constructor(e,n,r){if(!r||!(n instanceof se))throw new Error(`Invalid arguments for new ${e}`);super(),this.name=e,this.message=r,this.source=n}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let e=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new Be(this.offset,this.offset+1);let n=e&&Tn(this.offset,e);if(n){let r={line:n.line,col:n.col+1};this.linePos={start:n,end:r}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:n,col:r}=this.linePos.start;this.message+=` at line ${n}, column ${r}`;let s=e&&Mo(this.linePos,e);s&&(this.message+=`: + +${s} +`)}delete this.source}},Cn=class extends ye{constructor(e,n){super("YAMLReferenceError",e,n)}},ft=class extends ye{constructor(e,n){super("YAMLSemanticError",e,n)}},Mn=class extends ye{constructor(e,n){super("YAMLSyntaxError",e,n)}},kn=class extends ye{constructor(e,n){super("YAMLWarning",e,n)}};function ko(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vn=class t extends se{static endOfLine(e,n,r){let s=e[n],i=n;for(;s&&s!==` +`&&!(r&&(s==="["||s==="]"||s==="{"||s==="}"||s===","));){let o=e[i+1];if(s===":"&&(!o||o===` +`||o===" "||o===" "||r&&o===",")||(s===" "||s===" ")&&o==="#")break;i+=1,s=o}return i}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{src:r}=this.context,s=r[n-1];for(;el?r.slice(l,a+1):c)}else i+=c}let o=r[e];switch(o){case" ":{let a="Plain value cannot start with a tab character";return{errors:[new ft(this,a)],str:i}}case"@":case"`":{let a=`Plain value cannot start with reserved character ${o}`;return{errors:[new ft(this,a)],str:i}}default:return i}}parseBlockValue(e){let{indent:n,inFlow:r,src:s}=this.context,i=e,o=e;for(let a=s[i];a===` +`&&!se.atDocumentBoundary(s,i+1);a=s[i]){let c=se.endOfBlockIndent(s,n,i+1);if(c===null||s[c]==="#")break;s[c]===` +`?i=c:(o=t.endOfLine(s,c,r),i=o)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=o,o}parse(e,n){this.context=e;let{inFlow:r,src:s}=e,i=n,o=s[i];return o&&o!=="#"&&o!==` +`&&(i=t.endOfLine(s,n,r)),this.valueRange=new Be(n,i),i=se.endOfWhiteSpace(s,i),i=this.parseComment(i),(!this.hasComment||this.valueRange.isEmpty())&&(i=this.parseBlockValue(i)),i}};U.Char=re;U.Node=se;U.PlainValue=vn;U.Range=Be;U.Type=lt;U.YAMLError=ye;U.YAMLReferenceError=Cn;U.YAMLSemanticError=ft;U.YAMLSyntaxError=Mn;U.YAMLWarning=kn;U._defineProperty=ko;U.defaultTagPrefix=Ao;U.defaultTags=To});var Rs=te(xs=>{"use strict";var u=le(),Se=class extends u.Node{constructor(){super(u.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,n){return this.context=e,this.range=new u.Range(n,n+1),n+1}},ut=class extends u.Node{constructor(e,n){super(e,n),this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,{atLineStart:i,lineStart:o}=e;!i&&this.type===u.Type.SEQ_ITEM&&(this.error=new u.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));let a=i?n-o:e.indent,c=u.Node.endOfWhiteSpace(s,n+1),l=s[c],f=l==="#",m=[],d=null;for(;l===` +`||l==="#";){if(l==="#"){let h=u.Node.endOfLine(s,c+1);m.push(new u.Range(c,h)),c=h}else{i=!0,o=c+1;let h=u.Node.endOfWhiteSpace(s,o);s[h]===` +`&&m.length===0&&(d=new Se,o=d.parse({src:s},o)),c=u.Node.endOfIndent(s,o)}l=s[c]}if(u.Node.nextNodeIsIndented(l,c-(o+a),this.type!==u.Type.SEQ_ITEM)?this.node=r({atLineStart:i,inCollection:!1,indent:a,lineStart:o,parent:this},c):l&&o>n+1&&(c=o-1),this.node){if(d){let h=e.parent.items||e.parent.contents;h&&h.push(d)}m.length&&Array.prototype.push.apply(this.props,m),c=this.node.range.end}else if(f){let h=m[0];this.props.push(h),c=h.end}else c=u.Node.endOfLine(s,n+1);let y=this.node?this.node.valueRange.end:c;return this.valueRange=new u.Range(n,y),c}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.node?this.node.setOrigRanges(e,n):n}toString(){let{context:{src:e},node:n,range:r,value:s}=this;if(s!=null)return s;let i=n?e.slice(r.start,n.range.start)+String(n):e.slice(r.start,r.end);return u.Node.addStringTerminator(e,r.end,i)}},Ee=class extends u.Node{constructor(){super(u.Type.COMMENT)}parse(e,n){this.context=e;let r=this.parseComment(n);return this.range=new u.Range(n,r),r}};function In(t){let e=t;for(;e instanceof ut;)e=e.node;if(!(e instanceof Bt))return null;let n=e.items.length,r=-1;for(let o=n-1;o>=0;--o){let a=e.items[o];if(a.type===u.Type.COMMENT){let{indent:c,lineStart:l}=a.context;if(c>0&&a.range.start>=l+c)break;r=o}else if(a.type===u.Type.BLANK_LINE)r=o;else break}if(r===-1)return null;let s=e.items.splice(r,n-r),i=s[0].range.start;for(;e.range.end=i,e.valueRange&&e.valueRange.end>i&&(e.valueRange.end=i),e!==t;)e=e.context.parent;return s}var Bt=class t extends u.Node{static nextContentHasIndent(e,n,r){let s=u.Node.endOfLine(e,n)+1;n=u.Node.endOfWhiteSpace(e,s);let i=e[n];return i?n>=s+r?!0:i!=="#"&&i!==` +`?!1:t.nextContentHasIndent(e,n,r):!1}constructor(e){super(e.type===u.Type.SEQ_ITEM?u.Type.SEQ:u.Type.MAP);for(let r=e.props.length-1;r>=0;--r)if(e.props[r].start0}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,i=u.Node.startOfLine(s,n),o=this.items[0];o.context.parent=this,this.valueRange=u.Range.copy(o.valueRange);let a=o.range.start-o.context.lineStart,c=n;c=u.Node.normalizeOffset(s,c);let l=s[c],f=u.Node.endOfWhiteSpace(s,i)===c,m=!1;for(;l;){for(;l===` +`||l==="#";){if(f&&l===` +`&&!m){let h=new Se;if(c=h.parse({src:s},c),this.valueRange.end=c,c>=s.length){l=null;break}this.items.push(h),c-=1}else if(l==="#"){if(c=s.length){l=null;break}}if(i=c+1,c=u.Node.endOfIndent(s,i),u.Node.atBlank(s,c)){let h=u.Node.endOfWhiteSpace(s,c),g=s[h];(!g||g===` +`||g==="#")&&(c=h)}l=s[c],f=!0}if(!l)break;if(c!==i+a&&(f||l!==":")){if(cn&&(c=i);break}else if(!this.error){let h="All collection items must start at the same column";this.error=new u.YAMLSyntaxError(this,h)}}if(o.type===u.Type.SEQ_ITEM){if(l!=="-"){i>n&&(c=i);break}}else if(l==="-"&&!this.error){let h=s[c+1];if(!h||h===` +`||h===" "||h===" "){let g="A collection cannot be both a mapping and a sequence";this.error=new u.YAMLSyntaxError(this,g)}}let d=r({atLineStart:f,inCollection:!0,indent:a,lineStart:i,parent:this},c);if(!d)return c;if(this.items.push(d),this.valueRange.end=d.valueRange.end,c=u.Node.normalizeOffset(s,d.range.end),l=s[c],f=!1,m=d.includesTrailingLines,l){let h=c-1,g=s[h];for(;g===" "||g===" ";)g=s[--h];g===` +`&&(i=h+1,f=!0)}let y=In(d);y&&Array.prototype.push.apply(this.items,y)}return c}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.items.forEach(r=>{n=r.setOrigRanges(e,n)}),n}toString(){let{context:{src:e},items:n,range:r,value:s}=this;if(s!=null)return s;let i=e.slice(r.start,n[0].range.start)+String(n[0]);for(let o=1;o0&&(this.contents=this.directives,this.directives=[]),i}return n[i]?(this.directivesEndMarker=new u.Range(i,i+3),i+3):(s?this.error=new u.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),i)}parseContents(e){let{parseNode:n,src:r}=this.context;this.contents||(this.contents=[]);let s=e;for(;r[s-1]==="-";)s-=1;let i=u.Node.endOfWhiteSpace(r,e),o=s===e;for(this.valueRange=new u.Range(i);!u.Node.atDocumentBoundary(r,i,u.Char.DOCUMENT_END);){switch(r[i]){case` +`:if(o){let a=new Se;i=a.parse({src:r},i),i{n=r.setOrigRanges(e,n)}),this.directivesEndMarker&&(n=this.directivesEndMarker.setOrigRange(e,n)),this.contents.forEach(r=>{n=r.setOrigRanges(e,n)}),this.documentEndMarker&&(n=this.documentEndMarker.setOrigRange(e,n)),n}toString(){let{contents:e,directives:n,value:r}=this;if(r!=null)return r;let s=n.join("");return e.length>0&&((n.length>0||e[0].type===u.Type.COMMENT)&&(s+=`--- +`),s+=e.join("")),s[s.length-1]!==` +`&&(s+=` +`),s}},xn=class extends u.Node{parse(e,n){this.context=e;let{src:r}=e,s=u.Node.endOfIdentifier(r,n+1);return this.valueRange=new u.Range(n+1,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}},fe={CLIP:"CLIP",KEEP:"KEEP",STRIP:"STRIP"},Rn=class extends u.Node{constructor(e,n){super(e,n),this.blockIndent=null,this.chomping=fe.CLIP,this.header=null}get includesTrailingLines(){return this.chomping===fe.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{indent:r,src:s}=this.context;if(this.valueRange.isEmpty())return"";let i=null,o=s[n-1];for(;o===` +`||o===" "||o===" ";){if(n-=1,n<=e){if(this.chomping===fe.KEEP)break;return""}o===` +`&&(i=n),o=s[n-1]}let a=n+1;i&&(this.chomping===fe.KEEP?(a=i,n=this.valueRange.end):n=i);let c=r+this.blockIndent,l=this.type===u.Type.BLOCK_FOLDED,f=!0,m="",d="",y=!1;for(let h=e;ha&&(a=m);r[l]===` +`?i=l:i=o=u.Node.endOfLine(r,l)}return this.chomping!==fe.KEEP&&(i=r[o]?o+1:o),this.valueRange=new u.Range(e+1,i),i}parse(e,n){this.context=e;let{src:r}=e,s=this.parseBlockHeader(n);return s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s=this.parseBlockValue(s),s}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.header?this.header.setOrigRange(e,n):n}},Dn=class extends u.Node{constructor(e,n){super(e,n),this.items=null}prevNodeIsJsonLike(e=this.items.length){let n=this.items[e-1];return!!n&&(n.jsonLike||n.type===u.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,{indent:i,lineStart:o}=e,a=s[n];this.items=[{char:a,offset:n}];let c=u.Node.endOfWhiteSpace(s,n+1);for(a=s[c];a&&a!=="]"&&a!=="}";){switch(a){case` +`:{o=c+1;let l=u.Node.endOfWhiteSpace(s,o);if(s[l]===` +`){let f=new Se;o=f.parse({src:s},o),this.items.push(f)}if(c=u.Node.endOfIndent(s,o),c<=o+i&&(a=s[c],c{if(r instanceof u.Node)n=r.setOrigRanges(e,n);else if(e.length===0)r.origOffset=r.offset;else{let s=n;for(;sr.offset);)++s;r.origOffset=r.offset+s,n=s}}),n}toString(){let{context:{src:e},items:n,range:r,value:s}=this;if(s!=null)return s;let i=n.filter(c=>c instanceof u.Node),o="",a=r.start;return i.forEach(c=>{let l=e.slice(a,c.range.start);a=c.range.end,o+=l+String(c),o[o.length-1]===` +`&&e[a-1]!==` +`&&e[a]===` +`&&(a+=1)}),o+=e.slice(a,r.end),u.Node.addStringTerminator(e,r.end,o)}},Yn=class t extends u.Node{static endOfQuote(e,n){let r=e[n];for(;r&&r!=='"';)n+=r==="\\"?2:1,r=e[n];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:s,src:i}=this.context;i[r-1]!=='"'&&e.push(new u.YAMLSyntaxError(this,'Missing closing "quote'));let o="";for(let a=n+1;al?i.slice(l,a+1):c)}else o+=c}return e.length>0?{errors:e,str:o}:o}parseCharCode(e,n,r){let{src:s}=this.context,i=s.substr(e,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;return isNaN(a)?(r.push(new u.YAMLSyntaxError(this,`Invalid escape sequence ${s.substr(e-2,n+2)}`)),s.substr(e-2,n+2)):String.fromCodePoint(a)}parse(e,n){this.context=e;let{src:r}=e,s=t.endOfQuote(r,n+1);return this.valueRange=new u.Range(n,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}},$n=class t extends u.Node{static endOfQuote(e,n){let r=e[n];for(;r;)if(r==="'"){if(e[n+1]!=="'")break;r=e[n+=2]}else r=e[n+=1];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:s,src:i}=this.context;i[r-1]!=="'"&&e.push(new u.YAMLSyntaxError(this,"Missing closing 'quote"));let o="";for(let a=n+1;al?i.slice(l,a+1):c)}else o+=c}return e.length>0?{errors:e,str:o}:o}parse(e,n){this.context=e;let{src:r}=e,s=t.endOfQuote(r,n+1);return this.valueRange=new u.Range(n,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}};function vo(t,e){switch(t){case u.Type.ALIAS:return new xn(t,e);case u.Type.BLOCK_FOLDED:case u.Type.BLOCK_LITERAL:return new Rn(t,e);case u.Type.FLOW_MAP:case u.Type.FLOW_SEQ:return new Dn(t,e);case u.Type.MAP_KEY:case u.Type.MAP_VALUE:case u.Type.SEQ_ITEM:return new ut(t,e);case u.Type.COMMENT:case u.Type.PLAIN:return new u.PlainValue(t,e);case u.Type.QUOTE_DOUBLE:return new Yn(t,e);case u.Type.QUOTE_SINGLE:return new $n(t,e);default:return null}}var Bn=class t{static parseType(e,n,r){switch(e[n]){case"*":return u.Type.ALIAS;case">":return u.Type.BLOCK_FOLDED;case"|":return u.Type.BLOCK_LITERAL;case"{":return u.Type.FLOW_MAP;case"[":return u.Type.FLOW_SEQ;case"?":return!r&&u.Node.atBlank(e,n+1,!0)?u.Type.MAP_KEY:u.Type.PLAIN;case":":return!r&&u.Node.atBlank(e,n+1,!0)?u.Type.MAP_VALUE:u.Type.PLAIN;case"-":return!r&&u.Node.atBlank(e,n+1,!0)?u.Type.SEQ_ITEM:u.Type.PLAIN;case'"':return u.Type.QUOTE_DOUBLE;case"'":return u.Type.QUOTE_SINGLE;default:return u.Type.PLAIN}}constructor(e={},{atLineStart:n,inCollection:r,inFlow:s,indent:i,lineStart:o,parent:a}={}){u._defineProperty(this,"parseNode",(c,l)=>{if(u.Node.atDocumentBoundary(this.src,l))return null;let f=new t(this,c),{props:m,type:d,valueStart:y}=f.parseProps(l),h=vo(d,m),g=h.parse(f,y);if(h.range=new u.Range(l,g),g<=l&&(h.error=new Error("Node#parse consumed no characters"),h.error.parseEnd=g,h.error.source=h,h.range.end=l+1),f.nodeStartsCollection(h)){!h.error&&!f.atLineStart&&f.parent.type===u.Type.DOCUMENT&&(h.error=new u.YAMLSyntaxError(h,"Block collection must not have preceding content here (e.g. directives-end indicator)"));let w=new Bt(h);return g=w.parse(new t(f),g),w.range=new u.Range(l,g),w}return h}),this.atLineStart=n??(e.atLineStart||!1),this.inCollection=r??(e.inCollection||!1),this.inFlow=s??(e.inFlow||!1),this.indent=i??e.indent,this.lineStart=o??e.lineStart,this.parent=a??(e.parent||{}),this.root=e.root,this.src=e.src}nodeStartsCollection(e){let{inCollection:n,inFlow:r,src:s}=this;if(n||r)return!1;if(e instanceof ut)return!0;let i=e.range.end;return s[i]===` +`||s[i-1]===` +`?!1:(i=u.Node.endOfWhiteSpace(s,i),s[i]===":")}parseProps(e){let{inFlow:n,parent:r,src:s}=this,i=[],o=!1;e=this.atLineStart?u.Node.endOfIndent(s,e):u.Node.endOfWhiteSpace(s,e);let a=s[e];for(;a===u.Char.ANCHOR||a===u.Char.COMMENT||a===u.Char.TAG||a===` +`;){if(a===` +`){let l=e,f;do f=l+1,l=u.Node.endOfIndent(s,f);while(s[l]===` +`);let m=l-(f+this.indent),d=r.type===u.Type.SEQ_ITEM&&r.context.atLineStart;if(s[l]!=="#"&&!u.Node.nextNodeIsIndented(s[l],m,!d))break;this.atLineStart=!0,this.lineStart=f,o=!1,e=l}else if(a===u.Char.COMMENT){let l=u.Node.endOfLine(s,e+1);i.push(new u.Range(e,l)),e=l}else{let l=u.Node.endOfIdentifier(s,e+1);a===u.Char.TAG&&s[l]===","&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(s.slice(e+1,l+13))&&(l=u.Node.endOfIdentifier(s,l+5)),i.push(new u.Range(e,l)),o=!0,e=u.Node.endOfWhiteSpace(s,l)}a=s[e]}o&&a===":"&&u.Node.atBlank(s,e+1,!0)&&(e-=1);let c=t.parseType(s,e,n);return{props:i,type:c,valueStart:e}}};function Io(t){let e=[];t.indexOf("\r")!==-1&&(t=t.replace(/\r\n?/g,(s,i)=>(s.length>1&&e.push(i),` +`)));let n=[],r=0;do{let s=new _n,i=new Bn({src:t});r=s.parse(i,r),n.push(s)}while(r{if(e.length===0)return!1;for(let i=1;in.join(`... +`),n}xs.parse=Io});var qe=te(k=>{"use strict";var p=le();function Po(t,e,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${e}#`)} +${e}${t}`:t}function Fe(t,e,n){return n?n.indexOf(` +`)===-1?`${t} #${n}`:`${t} +`+n.replace(/^/gm,`${e||""}#`):t}var W=class{};function ue(t,e,n){if(Array.isArray(t))return t.map((r,s)=>ue(r,String(s),n));if(t&&typeof t.toJSON=="function"){let r=n&&n.anchors&&n.anchors.get(t);r&&(n.onCreate=i=>{r.res=i,delete n.onCreate});let s=t.toJSON(e,n);return r&&n.onCreate&&n.onCreate(s),s}return(!n||!n.keep)&&typeof t=="bigint"?Number(t):t}var P=class extends W{constructor(e){super(),this.value=e}toJSON(e,n){return n&&n.keep?this.value:ue(this.value,e,n)}toString(){return String(this.value)}};function Ds(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){let i=e[s];if(Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else{let o={};Object.defineProperty(o,i,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=o}}return t.createNode(r,!1)}var Bs=t=>t==null||typeof t=="object"&&t[Symbol.iterator]().next().done,j=class t extends W{constructor(e){super(),p._defineProperty(this,"items",[]),this.schema=e}addIn(e,n){if(Bs(e))this.add(n);else{let[r,...s]=e,i=this.get(r,!0);if(i instanceof t)i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ds(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn([e,...n]){if(n.length===0)return this.delete(e);let r=this.get(e,!0);if(r instanceof t)return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn([e,...n],r){let s=this.get(e,!0);return n.length===0?!r&&s instanceof P?s.value:s:s instanceof t?s.getIn(n,r):void 0}hasAllNullValues(){return this.items.every(e=>{if(!e||e.type!=="PAIR")return!1;let n=e.value;return n==null||n instanceof P&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn([e,...n]){if(n.length===0)return this.has(e);let r=this.get(e,!0);return r instanceof t?r.hasIn(n):!1}setIn([e,...n],r){if(n.length===0)this.set(e,r);else{let s=this.get(e,!0);if(s instanceof t)s.setIn(n,r);else if(s===void 0&&this.schema)this.set(e,Ds(this.schema,n,r));else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}}toJSON(){return null}toString(e,{blockItem:n,flowChars:r,isMap:s,itemIndent:i},o,a){let{indent:c,indentStep:l,stringify:f}=e,m=this.type===p.Type.FLOW_MAP||this.type===p.Type.FLOW_SEQ||e.inFlow;m&&(i+=l);let d=s&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:d,indent:i,inFlow:m,type:null});let y=!1,h=!1,g=this.items.reduce((C,L,M)=>{let A;L&&(!y&&L.spaceBefore&&C.push({type:"comment",str:""}),L.commentBefore&&L.commentBefore.match(/^.*$/gm).forEach(Ai=>{C.push({type:"comment",str:`#${Ai}`})}),L.comment&&(A=L.comment),m&&(!y&&L.spaceBefore||L.commentBefore||L.comment||L.key&&(L.key.commentBefore||L.key.comment)||L.value&&(L.value.commentBefore||L.value.comment))&&(h=!0)),y=!1;let _=f(L,e,()=>A=null,()=>y=!0);return m&&!h&&_.includes(` +`)&&(h=!0),m&&MA.str);if(h||M.reduce((A,_)=>A+_.length+2,2)>t.maxFlowStringSingleLineLength){w=C;for(let A of M)w+=A?` +${l}${c}${A}`:` +`;w+=` +${c}${L}`}else w=`${C} ${M.join(" ")} ${L}`}else{let C=g.map(n);w=C.shift();for(let L of C)w+=L?` +${c}${L}`:` +`}return this.comment?(w+=` +`+this.comment.replace(/^/gm,`${c}#`),o&&o()):y&&a&&a(),w}};p._defineProperty(j,"maxFlowStringSingleLineLength",60);function Ft(t){let e=t instanceof P?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var pe=class extends j{add(e){this.items.push(e)}delete(e){let n=Ft(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Ft(e);if(typeof r!="number")return;let s=this.items[r];return!n&&s instanceof P?s.value:s}has(e){let n=Ft(e);return typeof n=="number"&&ns.type==="comment"?s.str:`- ${s.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},n,r):JSON.stringify(this)}},_o=(t,e,n)=>e===null?"":typeof e!="object"?String(e):t instanceof W&&n&&n.doc?t.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(e),T=class t extends W{constructor(e,n=null){super(),this.key=e,this.value=n,this.type=t.Type.PAIR}get commentBefore(){return this.key instanceof W?this.key.commentBefore:void 0}set commentBefore(e){if(this.key==null&&(this.key=new P(null)),this.key instanceof W)this.key.commentBefore=e;else{let n="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(n)}}addToJSMap(e,n){let r=ue(this.key,"",e);if(n instanceof Map){let s=ue(this.value,r,e);n.set(r,s)}else if(n instanceof Set)n.add(r);else{let s=_o(this.key,r,e),i=ue(this.value,s,e);s in n?Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0}):n[s]=i}return n}toJSON(e,n){let r=n&&n.mapAsMap?new Map:{};return this.addToJSMap(n,r)}toString(e,n,r){if(!e||!e.doc)return JSON.stringify(this);let{indent:s,indentSeq:i,simpleKeys:o}=e.doc.options,{key:a,value:c}=this,l=a instanceof W&&a.comment;if(o){if(l)throw new Error("With simple keys, key nodes cannot have comments");if(a instanceof j){let _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let f=!o&&(!a||l||(a instanceof W?a instanceof j||a.type===p.Type.BLOCK_FOLDED||a.type===p.Type.BLOCK_LITERAL:typeof a=="object")),{doc:m,indent:d,indentStep:y,stringify:h}=e;e=Object.assign({},e,{implicitKey:!f,indent:d+y});let g=!1,w=h(a,e,()=>l=null,()=>g=!0);if(w=Fe(w,e.indent,l),!f&&w.length>1024){if(o)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(e.allNullValues&&!o)return this.comment?(w=Fe(w,e.indent,this.comment),n&&n()):g&&!l&&r&&r(),e.inFlow&&!f?w:`? ${w}`;w=f?`? ${w} +${d}:`:`${w}:`,this.comment&&(w=Fe(w,e.indent,this.comment),n&&n());let C="",L=null;if(c instanceof W){if(c.spaceBefore&&(C=` +`),c.commentBefore){let _=c.commentBefore.replace(/^/gm,`${e.indent}#`);C+=` +${_}`}L=c.comment}else c&&typeof c=="object"&&(c=m.schema.createNode(c,!0));e.implicitKey=!1,!f&&!this.comment&&c instanceof P&&(e.indentAtStart=w.length+1),g=!1,!i&&s>=2&&!e.inFlow&&!f&&c instanceof pe&&c.type!==p.Type.FLOW_SEQ&&!c.tag&&!m.anchors.getName(c)&&(e.indent=e.indent.substr(2));let M=h(c,e,()=>L=null,()=>g=!0),A=" ";return C||this.comment?A=`${C} +${e.indent}`:!f&&c instanceof j?(!(M[0]==="["||M[0]==="{")||M.includes(` +`))&&(A=` +${e.indent}`):M[0]===` +`&&(A=""),g&&!L&&r&&r(),Fe(w+A+M,e.indent,L)}};p._defineProperty(T,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var qt=(t,e)=>{if(t instanceof be){let n=e.get(t.source);return n.count*n.aliasCount}else if(t instanceof j){let n=0;for(let r of t.items){let s=qt(r,e);s>n&&(n=s)}return n}else if(t instanceof T){let n=qt(t.key,e),r=qt(t.value,e);return Math.max(n,r)}return 1},be=class t extends W{static stringify({range:e,source:n},{anchors:r,doc:s,implicitKey:i,inStringifyKey:o}){let a=Object.keys(r).find(l=>r[l]===n);if(!a&&o&&(a=s.anchors.getName(n)||s.anchors.newName()),a)return`*${a}${i?" ":""}`;let c=s.anchors.getName(n)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${c} [${e}]`)}constructor(e){super(),this.source=e,this.type=p.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,n){if(!n)return ue(this.source,e,n);let{anchors:r,maxAliasCount:s}=n,i=r.get(this.source);if(!i||i.res===void 0){let o="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new p.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}if(s>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=qt(this.source,r)),i.count*i.aliasCount>s)){let o="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new p.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}return i.res}toString(e){return t.stringify(this,e)}};p._defineProperty(be,"default",!0);function pt(t,e){let n=e instanceof P?e.value:e;for(let r of t)if(r instanceof T&&(r.key===e||r.key===n||r.key&&r.key.value===n))return r}var mt=class extends j{add(e,n){e?e instanceof T||(e=new T(e.key||e,e.value)):e=new T(e);let r=pt(this.items,e.key),s=this.schema&&this.schema.sortMapEntries;if(r)if(n)r.value=e.value;else throw new Error(`Key ${e.key} already set`);else if(s){let i=this.items.findIndex(o=>s(e,o)<0);i===-1?this.items.push(e):this.items.splice(i,0,e)}else this.items.push(e)}delete(e){let n=pt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=pt(this.items,e),s=r&&r.value;return!n&&s instanceof P?s.value:s}has(e){return!!pt(this.items,e)}set(e,n){this.add(new T(e,n),!0)}toJSON(e,n,r){let s=r?new r:n&&n.mapAsMap?new Map:{};n&&n.onCreate&&n.onCreate(s);for(let i of this.items)i.addToJSMap(n,s);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!(s instanceof T))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return super.toString(e,{blockItem:s=>s.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},n,r)}},Fs="<<",Vt=class extends T{constructor(e){if(e instanceof T){let n=e.value;n instanceof pe||(n=new pe,n.items.push(e.value),n.range=e.value.range),super(e.key,n),this.range=e.range}else super(new P(Fs),new pe);this.type=T.Type.MERGE_PAIR}addToJSMap(e,n){for(let{source:r}of this.value.items){if(!(r instanceof mt))throw new Error("Merge sources must be maps");let s=r.toJSON(null,e,Map);for(let[i,o]of s)n instanceof Map?n.has(i)||n.set(i,o):n instanceof Set?n.add(i):Object.prototype.hasOwnProperty.call(n,i)||Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}return n}toString(e,n){let r=this.value;if(r.items.length>1)return super.toString(e,n);this.value=r.items[0];let s=super.toString(e,n);return this.value=r,s}},xo={defaultType:p.Type.BLOCK_LITERAL,lineWidth:76},Ro={trueStr:"true",falseStr:"false"},Do={asBigInt:!1},Yo={nullStr:"null"},Ne={defaultType:p.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function qn(t,e,n){for(let{format:r,test:s,resolve:i}of e)if(s){let o=t.match(s);if(o){let a=i.apply(null,o);return a instanceof P||(a=new P(a)),r&&(a.format=r),a}}return n&&(t=n(t)),new P(t)}var qs="flow",Fn="block",Ut="quoted",Ys=(t,e)=>{let n=t[e+1];for(;n===" "||n===" ";){do n=t[e+=1];while(n&&n!==` +`);n=t[e+1]}return e};function Wt(t,e,n,{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}){if(!s||s<0)return t;let c=Math.max(1+i,1+s-e.length);if(t.length<=c)return t;let l=[],f={},m=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):m=s-r);let d,y,h=!1,g=-1,w=-1,C=-1;n===Fn&&(g=Ys(t,g),g!==-1&&(m=g+c));for(let M;M=t[g+=1];){if(n===Ut&&M==="\\"){switch(w=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}C=g}if(M===` +`)n===Fn&&(g=Ys(t,g)),m=g+c,d=void 0;else{if(M===" "&&y&&y!==" "&&y!==` +`&&y!==" "){let A=t[g+1];A&&A!==" "&&A!==` +`&&A!==" "&&(d=g)}if(g>=m)if(d)l.push(d),m=d+c,d=void 0;else if(n===Ut){for(;y===" "||y===" ";)y=M,M=t[g+=1],h=!0;let A=g>C+1?g-2:w-1;if(f[A])return t;l.push(A),f[A]=!0,m=A+c,d=void 0}else h=!0}y=M}if(h&&a&&a(),l.length===0)return t;o&&o();let L=t.slice(0,l[0]);for(let M=0;Mt?Object.assign({indentAtStart:t},Ne.fold):Ne.fold,jt=t=>/^(%|---|\.\.\.)/m.test(t);function $o(t,e,n){if(!e||e<0)return!1;let r=e-n,s=t.length;if(s<=r)return!1;for(let i=0,o=0;ir)return!0;if(o=i+1,s-o<=r)return!1}return!0}function we(t,e){let{implicitKey:n}=e,{jsonEncoding:r,minMultiLineLength:s}=Ne.doubleQuoted,i=JSON.stringify(t);if(r)return i;let o=e.indent||(jt(t)?" ":""),a="",c=0;for(let l=0,f=i[l];f;f=i[++l])if(f===" "&&i[l+1]==="\\"&&i[l+2]==="n"&&(a+=i.slice(c,l)+"\\ ",l+=1,c=l,f="\\"),f==="\\")switch(i[l+1]){case"u":{a+=i.slice(c,l);let m=i.substr(l+2,4);switch(m){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=i.substr(l,6)}l+=5,c=l+1}break;case"n":if(n||i[l+2]==='"'||i.length";if(!n)return l+` +`;let f="",m="";if(n=n.replace(/[\n\t ]*$/,y=>{let h=y.indexOf(` +`);return h===-1?l+="-":(n===y||h!==y.length-1)&&(l+="+",i&&i()),m=y.replace(/\n$/,""),""}).replace(/^[\n ]*/,y=>{y.indexOf(" ")!==-1&&(l+=a);let h=y.match(/ +$/);return h?(f=y.slice(0,-h[0].length),h[0]):(f=y,"")}),m&&(m=m.replace(/\n+(?!\n|$)/g,`$&${o}`)),f&&(f=f.replace(/\n+/g,`$&${o}`)),t&&(l+=" #"+t.replace(/ ?[\r\n]+/g," "),s&&s()),!n)return`${l}${a} +${o}${m}`;if(c)return n=n.replace(/\n+/g,`$&${o}`),`${l} +${o}${f}${n}${m}`;n=n.replace(/\n+/g,` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${o}`);let d=Wt(`${f}${n}${m}`,o,Fn,Ne.fold);return`${l} +${o}${d}`}function Bo(t,e,n,r){let{comment:s,type:i,value:o}=t,{actualString:a,implicitKey:c,indent:l,inFlow:f}=e;if(c&&/[\n[\]{},]/.test(o)||f&&/[[\]{},]/.test(o))return we(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||f||o.indexOf(` +`)===-1?o.indexOf('"')!==-1&&o.indexOf("'")===-1?Us(o,e):we(o,e):Kt(t,e,n,r);if(!c&&!f&&i!==p.Type.PLAIN&&o.indexOf(` +`)!==-1)return Kt(t,e,n,r);if(l===""&&jt(o))return e.forceBlockIndent=!0,Kt(t,e,n,r);let m=o.replace(/\n+/g,`$& +${l}`);if(a){let{tags:y}=e.doc.schema;if(typeof qn(m,y,y.scalarFallback).value!="string")return we(o,e)}let d=c?m:Wt(m,l,qs,Un(e));return s&&!f&&(d.indexOf(` +`)!==-1||s.indexOf(` +`)!==-1)?(n&&n(),Po(d,l,s)):d}function Fo(t,e,n,r){let{defaultType:s}=Ne,{implicitKey:i,inFlow:o}=e,{type:a,value:c}=t;typeof c!="string"&&(c=String(c),t=Object.assign({},t,{value:c}));let l=m=>{switch(m){case p.Type.BLOCK_FOLDED:case p.Type.BLOCK_LITERAL:return Kt(t,e,n,r);case p.Type.QUOTE_DOUBLE:return we(c,e);case p.Type.QUOTE_SINGLE:return Us(c,e);case p.Type.PLAIN:return Bo(t,e,n,r);default:return null}};(a!==p.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(c)||(i||o)&&(a===p.Type.BLOCK_FOLDED||a===p.Type.BLOCK_LITERAL))&&(a=p.Type.QUOTE_DOUBLE);let f=l(a);if(f===null&&(f=l(s),f===null))throw new Error(`Unsupported default string type ${s}`);return f}function qo({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let i=s.indexOf(".");i<0&&(i=s.length,s+=".");let o=e-(s.length-i-1);for(;o-- >0;)s+="0"}return s}function Ks(t,e){let n,r;switch(e.type){case p.Type.FLOW_MAP:n="}",r="flow map";break;case p.Type.FLOW_SEQ:n="]",r="flow sequence";break;default:t.push(new p.YAMLSemanticError(e,"Not a flow collection!?"));return}let s;for(let i=e.items.length-1;i>=0;--i){let o=e.items[i];if(!o||o.type!==p.Type.COMMENT){s=o;break}}if(s&&s.char!==n){let i=`Expected ${r} to end with ${n}`,o;typeof s.offset=="number"?(o=new p.YAMLSemanticError(e,i),o.offset=s.offset+1):(o=new p.YAMLSemanticError(s,i),s.range&&s.range.end&&(o.offset=s.range.end-s.range.start)),t.push(o)}}function Vs(t,e){let n=e.context.src[e.range.start-1];if(n!==` +`&&n!==" "&&n!==" "){let r="Comments must be separated from other tokens by white space characters";t.push(new p.YAMLSemanticError(e,r))}}function Ws(t,e){let n=String(e),r=n.substr(0,8)+"..."+n.substr(-8);return new p.YAMLSemanticError(t,`The "${r}" key is too long`)}function js(t,e){for(let{afterKey:n,before:r,comment:s}of e){let i=t.items[r];i?(n&&i.value&&(i=i.value),s===void 0?(n||!i.commentBefore)&&(i.spaceBefore=!0):i.commentBefore?i.commentBefore+=` +`+s:i.commentBefore=s):s!==void 0&&(t.comment?t.comment+=` +`+s:t.comment=s)}}function Kn(t,e){let n=e.strValue;return n?typeof n=="string"?n:(n.errors.forEach(r=>{r.source||(r.source=e),t.errors.push(r)}),n.str):""}function Uo(t,e){let{handle:n,suffix:r}=e.tag,s=t.tagPrefixes.find(i=>i.handle===n);if(!s){let i=t.getDefaults().tagPrefixes;if(i&&(s=i.find(o=>o.handle===n)),!s)throw new p.YAMLSemanticError(e,`The ${n} tag handle is non-default and was not declared.`)}if(!r)throw new p.YAMLSemanticError(e,`The ${n} tag has no suffix.`);if(n==="!"&&(t.version||t.options.version)==="1.0"){if(r[0]==="^")return t.warnings.push(new p.YAMLWarning(e,"YAML 1.0 ^ tag expansion is not supported")),r;if(/[:/]/.test(r)){let i=r.match(/^([a-z0-9-]+)\/(.*)/i);return i?`tag:${i[1]}.yaml.org,2002:${i[2]}`:`tag:${r}`}}return s.prefix+decodeURIComponent(r)}function Ko(t,e){let{tag:n,type:r}=e,s=!1;if(n){let{handle:i,suffix:o,verbatim:a}=n;if(a){if(a!=="!"&&a!=="!!")return a;let c=`Verbatim tags aren't resolved, so ${a} is invalid.`;t.errors.push(new p.YAMLSemanticError(e,c))}else if(i==="!"&&!o)s=!0;else try{return Uo(t,e)}catch(c){t.errors.push(c)}}switch(r){case p.Type.BLOCK_FOLDED:case p.Type.BLOCK_LITERAL:case p.Type.QUOTE_DOUBLE:case p.Type.QUOTE_SINGLE:return p.defaultTags.STR;case p.Type.FLOW_MAP:case p.Type.MAP:return p.defaultTags.MAP;case p.Type.FLOW_SEQ:case p.Type.SEQ:return p.defaultTags.SEQ;case p.Type.PLAIN:return s?p.defaultTags.STR:null;default:return null}}function $s(t,e,n){let{tags:r}=t.schema,s=[];for(let o of r)if(o.tag===n)if(o.test)s.push(o);else{let a=o.resolve(t,e);return a instanceof j?a:new P(a)}let i=Kn(t,e);return typeof i=="string"&&s.length>0?qn(i,s,r.scalarFallback):null}function Vo({type:t}){switch(t){case p.Type.FLOW_MAP:case p.Type.MAP:return p.defaultTags.MAP;case p.Type.FLOW_SEQ:case p.Type.SEQ:return p.defaultTags.SEQ;default:return p.defaultTags.STR}}function Wo(t,e,n){try{let r=$s(t,e,n);if(r)return n&&e.tag&&(r.tag=n),r}catch(r){return r.source||(r.source=e),t.errors.push(r),null}try{let r=Vo(e);if(!r)throw new Error(`The tag ${n} is unavailable`);let s=`The tag ${n} is unavailable, falling back to ${r}`;t.warnings.push(new p.YAMLWarning(e,s));let i=$s(t,e,r);return i.tag=n,i}catch(r){let s=new p.YAMLReferenceError(e,r.message);return s.stack=r.stack,t.errors.push(s),null}}var jo=t=>{if(!t)return!1;let{type:e}=t;return e===p.Type.MAP_KEY||e===p.Type.MAP_VALUE||e===p.Type.SEQ_ITEM};function Qo(t,e){let n={before:[],after:[]},r=!1,s=!1,i=jo(e.context.parent)?e.context.parent.props.concat(e.props):e.props;for(let{start:o,end:a}of i)switch(e.context.src[o]){case p.Char.COMMENT:{if(!e.commentHasRequiredWhitespace(o)){let m="Comments must be separated from other tokens by white space characters";t.push(new p.YAMLSemanticError(e,m))}let{header:c,valueRange:l}=e;(l&&(o>l.start||c&&o>c.start)?n.after:n.before).push(e.context.src.slice(o+1,a));break}case p.Char.ANCHOR:if(r){let c="A node can have at most one anchor";t.push(new p.YAMLSemanticError(e,c))}r=!0;break;case p.Char.TAG:if(s){let c="A node can have at most one tag";t.push(new p.YAMLSemanticError(e,c))}s=!0;break}return{comments:n,hasAnchor:r,hasTag:s}}function Jo(t,e){let{anchors:n,errors:r,schema:s}=t;if(e.type===p.Type.ALIAS){let o=e.rawValue,a=n.getNode(o);if(!a){let l=`Aliased anchor not found: ${o}`;return r.push(new p.YAMLReferenceError(e,l)),null}let c=new be(a);return n._cstAliases.push(c),c}let i=Ko(t,e);if(i)return Wo(t,e,i);if(e.type!==p.Type.PLAIN){let o=`Failed to resolve ${e.type} node here`;return r.push(new p.YAMLSyntaxError(e,o)),null}try{let o=Kn(t,e);return qn(o,s.tags,s.tags.scalarFallback)}catch(o){return o.source||(o.source=e),r.push(o),null}}function me(t,e){if(!e)return null;e.error&&t.errors.push(e.error);let{comments:n,hasAnchor:r,hasTag:s}=Qo(t.errors,e);if(r){let{anchors:o}=t,a=e.anchor,c=o.getNode(a);c&&(o.map[o.newName(a)]=c),o.map[a]=e}if(e.type===p.Type.ALIAS&&(r||s)){let o="An alias node must not specify any properties";t.errors.push(new p.YAMLSemanticError(e,o))}let i=Jo(t,e);if(i){i.range=[e.range.start,e.range.end],t.options.keepCstNodes&&(i.cstNode=e),t.options.keepNodeTypes&&(i.type=e.type);let o=n.before.join(` +`);o&&(i.commentBefore=i.commentBefore?`${i.commentBefore} +${o}`:o);let a=n.after.join(` +`);a&&(i.comment=i.comment?`${i.comment} +${a}`:a)}return e.resolved=i}function Go(t,e){if(e.type!==p.Type.MAP&&e.type!==p.Type.FLOW_MAP){let o=`A ${e.type} node cannot be resolved as a mapping`;return t.errors.push(new p.YAMLSyntaxError(e,o)),null}let{comments:n,items:r}=e.type===p.Type.FLOW_MAP?Zo(t,e):zo(t,e),s=new mt;s.items=r,js(s,n);let i=!1;for(let o=0;o{if(f instanceof be){let{type:m}=f.source;return m===p.Type.MAP||m===p.Type.FLOW_MAP?!1:l="Merge nodes aliases can only point to maps"}return l="Merge nodes can only have Alias nodes as values"}),l&&t.errors.push(new p.YAMLSemanticError(e,l))}else for(let c=o+1;c{if(r.length===0)return!1;let{start:s}=r[0];if(e&&s>e.valueRange.start||n[s]!==p.Char.COMMENT)return!1;for(let i=t;i0){c=new p.PlainValue(p.Type.PLAIN,[]),c.context={parent:a,src:a.context.src};let f=a.range.start+1;if(c.range={start:f,end:f},c.valueRange={start:f,end:f},typeof a.range.origStart=="number"){let m=a.range.origStart+1;c.range.origStart=c.range.origEnd=m,c.valueRange.origStart=c.valueRange.origEnd=m}}let l=new T(s,me(t,c));Xo(a,l),r.push(l),s&&typeof i=="number"&&a.range.start>i+1024&&t.errors.push(Ws(e,s)),s=void 0,i=null}break;default:s!==void 0&&r.push(new T(s)),s=me(t,a),i=a.range.start,a.error&&t.errors.push(a.error);e:for(let c=o+1;;++c){let l=e.items[c];switch(l&&l.type){case p.Type.BLANK_LINE:case p.Type.COMMENT:continue e;case p.Type.MAP_VALUE:break e;default:{let f="Implicit map keys need to be followed by map values";t.errors.push(new p.YAMLSemanticError(a,f));break e}}}if(a.valueRangeContainsNewline){let c="Implicit map keys need to be on a single line";t.errors.push(new p.YAMLSemanticError(a,c))}}}return s!==void 0&&r.push(new T(s)),{comments:n,items:r}}function Zo(t,e){let n=[],r=[],s,i=!1,o="{";for(let a=0;ai instanceof T&&i.key instanceof j)){let i="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new p.YAMLWarning(e,i))}return e.resolved=s,s}function ta(t,e){let n=[],r=[];for(let s=0;so+1024&&t.errors.push(Ws(e,i));let{src:h}=c.context;for(let g=o;g{"use strict";var Q=le(),O=qe(),ra={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(t,e)=>{let n=O.resolveString(t,e);if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let r=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(r.length);for(let i=0;i{let o;if(typeof Buffer=="function")o=n instanceof Buffer?n.toString("base64"):Buffer.from(n.buffer).toString("base64");else if(typeof btoa=="function"){let a="";for(let c=0;c1){let o="Each pair must have its own sequence indicator";throw new Q.YAMLSemanticError(e,o)}let i=s.items[0]||new O.Pair;s.commentBefore&&(i.commentBefore=i.commentBefore?`${s.commentBefore} +${i.commentBefore}`:s.commentBefore),s.comment&&(i.comment=i.comment?`${s.comment} +${i.comment}`:s.comment),s=i}n.items[r]=s instanceof O.Pair?s:new O.Pair(s)}}return n}function Gs(t,e,n){let r=new O.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";for(let s of e){let i,o;if(Array.isArray(s))if(s.length===2)i=s[0],o=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)i=c[0],o=s[i];else throw new TypeError(`Expected { key: value } tuple: ${s}`)}else i=s;let a=t.createPair(i,o,n);r.items.push(a)}return r}var sa={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Js,createNode:Gs},Ue=class t extends O.YAMLSeq{constructor(){super(),Q._defineProperty(this,"add",O.YAMLMap.prototype.add.bind(this)),Q._defineProperty(this,"delete",O.YAMLMap.prototype.delete.bind(this)),Q._defineProperty(this,"get",O.YAMLMap.prototype.get.bind(this)),Q._defineProperty(this,"has",O.YAMLMap.prototype.has.bind(this)),Q._defineProperty(this,"set",O.YAMLMap.prototype.set.bind(this)),this.tag=t.tag}toJSON(e,n){let r=new Map;n&&n.onCreate&&n.onCreate(r);for(let s of this.items){let i,o;if(s instanceof O.Pair?(i=O.toJSON(s.key,"",n),o=O.toJSON(s.value,i,n)):i=O.toJSON(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}};Q._defineProperty(Ue,"tag","tag:yaml.org,2002:omap");function ia(t,e){let n=Js(t,e),r=[];for(let{key:s}of n.items)if(s instanceof O.Scalar)if(r.includes(s.value)){let i="Ordered maps must not include duplicate keys";throw new Q.YAMLSemanticError(e,i)}else r.push(s.value);return Object.assign(new Ue,n)}function oa(t,e,n){let r=Gs(t,e,n),s=new Ue;return s.items=r.items,s}var aa={identify:t=>t instanceof Map,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:omap",resolve:ia,createNode:oa},Ke=class t extends O.YAMLMap{constructor(){super(),this.tag=t.tag}add(e){let n=e instanceof O.Pair?e:new O.Pair(e);O.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=O.findPair(this.items,e);return!n&&r instanceof O.Pair?r.key instanceof O.Scalar?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=O.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new O.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,n,r);throw new Error("Set items must all have null values")}};Q._defineProperty(Ke,"tag","tag:yaml.org,2002:set");function ca(t,e){let n=O.resolveMap(t,e);if(!n.hasAllNullValues())throw new Q.YAMLSemanticError(e,"Set items must all have null values");return Object.assign(new Ke,n)}function la(t,e,n){let r=new Ke;for(let s of e)r.items.push(t.createPair(s,null,n));return r}var fa={identify:t=>t instanceof Set,nodeClass:Ke,default:!1,tag:"tag:yaml.org,2002:set",resolve:ca,createNode:la},Vn=(t,e)=>{let n=e.split(":").reduce((r,s)=>r*60+Number(s),0);return t==="-"?-n:n},Hs=({value:t})=>{if(isNaN(t)||!isFinite(t))return O.stringifyNumber(t);let e="";t<0&&(e="-",t=Math.abs(t));let n=[t%60];return t<60?n.unshift(0):(t=Math.round((t-n[0])/60),n.unshift(t%60),t>=60&&(t=Math.round((t-n[0])/60),n.unshift(t))),e+n.map(r=>r<10?"0"+String(r):String(r)).join(":").replace(/000000\d*$/,"")},ua={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(t,e,n)=>Vn(e,n.replace(/_/g,"")),stringify:Hs},pa={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(t,e,n)=>Vn(e,n.replace(/_/g,"")),stringify:Hs},ma={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(t,e,n,r,s,i,o,a,c)=>{a&&(a=(a+"00").substr(1,3));let l=Date.UTC(e,n-1,r,s||0,i||0,o||0,a||0);if(c&&c!=="Z"){let f=Vn(c[0],c.slice(1));Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function Wn(t){let e={};return t?typeof YAML_SILENCE_DEPRECATION_WARNINGS<"u"?!YAML_SILENCE_DEPRECATION_WARNINGS:!e.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS<"u"?!YAML_SILENCE_WARNINGS:!e.YAML_SILENCE_WARNINGS}function jn(t,e){Wn(!1)&&console.warn(e?`${e}: ${t}`:t)}function ha(t){if(Wn(!0)){let e=t.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");jn(`The endpoint 'yaml/${e}' will be removed in a future release.`,"DeprecationWarning")}}var Qs={};function ga(t,e){if(!Qs[t]&&Wn(!0)){Qs[t]=!0;let n=`The option '${t}' will be removed in a future release`;n+=e?`, use '${e}' instead.`:".",jn(n,"DeprecationWarning")}}z.binary=ra;z.floatTime=pa;z.intTime=ua;z.omap=aa;z.pairs=sa;z.set=fa;z.timestamp=ma;z.warn=jn;z.warnFileDeprecation=ha;z.warnOptionDeprecation=ga});var Xn=te(li=>{"use strict";var Gt=le(),E=qe(),D=Qn();function da(t,e,n){let r=new E.YAMLMap(t);if(e instanceof Map)for(let[s,i]of e)r.items.push(t.createPair(s,i,n));else if(e&&typeof e=="object")for(let s of Object.keys(e))r.items.push(t.createPair(s,e[s],n));return typeof t.sortMapEntries=="function"&&r.items.sort(t.sortMapEntries),r}var gt={createNode:da,default:!0,nodeClass:E.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:E.resolveMap};function ya(t,e,n){let r=new E.YAMLSeq(t);if(e&&e[Symbol.iterator])for(let s of e){let i=t.createNode(s,n.wrapScalars,null,n);r.items.push(i)}return r}var Ht={createNode:ya,default:!0,nodeClass:E.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:E.resolveSeq},Ea={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:E.resolveString,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),E.stringifyString(t,e,n,r)},options:E.strOptions},Gn=[gt,Ht,Ea],Xt=t=>typeof t=="bigint"||Number.isInteger(t),Hn=(t,e,n)=>E.intOptions.asBigInt?BigInt(t):parseInt(e,n);function Zs(t,e,n){let{value:r}=t;return Xt(r)&&r>=0?n+r.toString(e):E.stringifyNumber(t)}var ei={identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:E.nullOptions,stringify:()=>E.nullOptions.nullStr},ti={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>t[0]==="t"||t[0]==="T",options:E.boolOptions,stringify:({value:t})=>t?E.boolOptions.trueStr:E.boolOptions.falseStr},ni={identify:t=>Xt(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(t,e)=>Hn(t,e,8),options:E.intOptions,stringify:t=>Zs(t,8,"0o")},ri={identify:Xt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:t=>Hn(t,t,10),options:E.intOptions,stringify:E.stringifyNumber},si={identify:t=>Xt(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(t,e)=>Hn(t,e,16),options:E.intOptions,stringify:t=>Zs(t,16,"0x")},ii={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:E.stringifyNumber},oi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify:({value:t})=>Number(t).toExponential()},ai={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(t,e,n){let r=e||n,s=new E.Scalar(parseFloat(t));return r&&r[r.length-1]==="0"&&(s.minFractionDigits=r.length),s},stringify:E.stringifyNumber},Sa=Gn.concat([ei,ti,ni,ri,si,ii,oi,ai]),Xs=t=>typeof t=="bigint"||Number.isInteger(t),Qt=({value:t})=>JSON.stringify(t),ci=[gt,Ht,{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:E.resolveString,stringify:Qt},{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qt},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:Qt},{identify:Xs,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:t=>E.intOptions.asBigInt?BigInt(t):parseInt(t,10),stringify:({value:t})=>Xs(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Qt}];ci.scalarFallback=t=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`)};var zs=({value:t})=>t?E.boolOptions.trueStr:E.boolOptions.falseStr,ht=t=>typeof t=="bigint"||Number.isInteger(t);function Jt(t,e,n){let r=e.replace(/_/g,"");if(E.intOptions.asBigInt){switch(n){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let i=BigInt(r);return t==="-"?BigInt(-1)*i:i}let s=parseInt(r,n);return t==="-"?-1*s:s}function Jn(t,e,n){let{value:r}=t;if(ht(r)){let s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return E.stringifyNumber(t)}var wa=Gn.concat([{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:E.nullOptions,stringify:()=>E.nullOptions.nullStr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:E.boolOptions,stringify:zs},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:E.boolOptions,stringify:zs},{identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(t,e,n)=>Jt(e,n,2),stringify:t=>Jn(t,2,"0b")},{identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(t,e,n)=>Jt(e,n,8),stringify:t=>Jn(t,8,"0")},{identify:ht,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(t,e,n)=>Jt(e,n,10),stringify:E.stringifyNumber},{identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(t,e,n)=>Jt(e,n,16),stringify:t=>Jn(t,16,"0x")},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:E.stringifyNumber},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify:({value:t})=>Number(t).toExponential()},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(t,e){let n=new E.Scalar(parseFloat(t.replace(/_/g,"")));if(e){let r=e.replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:E.stringifyNumber}],D.binary,D.omap,D.pairs,D.set,D.intTime,D.floatTime,D.timestamp),ba={core:Sa,failsafe:Gn,json:ci,yaml11:wa},Na={binary:D.binary,bool:ti,float:ai,floatExp:oi,floatNaN:ii,floatTime:D.floatTime,int:ri,intHex:si,intOct:ni,intTime:D.intTime,map:gt,null:ei,omap:D.omap,pairs:D.pairs,seq:Ht,set:D.set,timestamp:D.timestamp};function Oa(t,e,n){if(e){let r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)||r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>(r.identify&&r.identify(t)||r.class&&t instanceof r.class)&&!r.format)}function La(t,e,n){if(t instanceof E.Node)return t;let{defaultPrefix:r,onTagObj:s,prevObjects:i,schema:o,wrapScalars:a}=n;e&&e.startsWith("!!")&&(e=r+e.slice(2));let c=Oa(t,e,o.tags);if(!c){if(typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object")return a?new E.Scalar(t):t;c=t instanceof Map?gt:t[Symbol.iterator]?Ht:gt}s&&(s(c),delete n.onTagObj);let l={value:void 0,node:void 0};if(t&&typeof t=="object"&&i){let f=i.get(t);if(f){let m=new E.Alias(f);return n.aliasNodes.push(m),m}l.value=t,i.set(t,l)}return l.node=c.createNode?c.createNode(n.schema,t,n):a?new E.Scalar(t):t,e&&l.node instanceof E.Node&&(l.node.tag=e),l.node}function Aa(t,e,n,r){let s=t[r.replace(/\W/g,"")];if(!s){let i=Object.keys(t).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${i}`)}if(Array.isArray(n))for(let i of n)s=s.concat(i);else typeof n=="function"&&(s=n(s.slice()));for(let i=0;iJSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag "${o}"; use one of ${c}`)}s[i]=a}}return s}var Ta=(t,e)=>t.keye.key?1:0,dt=class t{constructor({customTags:e,merge:n,schema:r,sortMapEntries:s,tags:i}){this.merge=!!n,this.name=r,this.sortMapEntries=s===!0?Ta:s||null,!e&&i&&D.warnOptionDeprecation("tags","customTags"),this.tags=Aa(ba,Na,e||i,r)}createNode(e,n,r,s){let i={defaultPrefix:t.defaultPrefix,schema:this,wrapScalars:n},o=s?Object.assign(s,i):i;return La(e,r,o)}createPair(e,n,r){r||(r={wrapScalars:!0});let s=this.createNode(e,r.wrapScalars,null,r),i=this.createNode(n,r.wrapScalars,null,r);return new E.Pair(s,i)}};Gt._defineProperty(dt,"defaultPrefix",Gt.defaultTagPrefix);Gt._defineProperty(dt,"defaultTags",Gt.defaultTags);li.Schema=dt});var mi=te(tn=>{"use strict";var Y=le(),S=qe(),fi=Xn(),Ca={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},Ma={get binary(){return S.binaryOptions},set binary(t){Object.assign(S.binaryOptions,t)},get bool(){return S.boolOptions},set bool(t){Object.assign(S.boolOptions,t)},get int(){return S.intOptions},set int(t){Object.assign(S.intOptions,t)},get null(){return S.nullOptions},set null(t){Object.assign(S.nullOptions,t)},get str(){return S.strOptions},set str(t){Object.assign(S.strOptions,t)}},pi={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:Y.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Y.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Y.defaultTagPrefix}]}};function ui(t,e){if((t.version||t.options.version)==="1.0"){let s=e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(s)return"!"+s[1];let i=e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return i?`!${i[1]}/${i[2]}`:`!${e.replace(/^tag:/,"")}`}let n=t.tagPrefixes.find(s=>e.indexOf(s.prefix)===0);if(!n){let s=t.getDefaults().tagPrefixes;n=s&&s.find(i=>e.indexOf(i.prefix)===0)}if(!n)return e[0]==="!"?e:`!<${e}>`;let r=e.substr(n.prefix.length).replace(/[!,[\]{}]/g,s=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"})[s]);return n.handle+r}function ka(t,e){if(e instanceof S.Alias)return S.Alias;if(e.tag){let s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)||s[0]}let n,r;if(e instanceof S.Scalar){r=e.value;let s=t.filter(i=>i.identify&&i.identify(r)||i.class&&r instanceof i.class);n=s.find(i=>i.format===e.format)||s.find(i=>!i.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){let s=r&&r.constructor?r.constructor.name:typeof r;throw new Error(`Tag not resolved for ${s} value`)}return n}function va(t,e,{anchors:n,doc:r}){let s=[],i=r.anchors.getName(t);return i&&(n[i]=t,s.push(`&${i}`)),t.tag?s.push(ui(r,t.tag)):e.default||s.push(ui(r,e.tag)),s.join(" ")}function zt(t,e,n,r){let{anchors:s,schema:i}=e.doc,o;if(!(t instanceof S.Node)){let l={aliasNodes:[],onTagObj:f=>o=f,prevObjects:new Map};t=i.createNode(t,!0,null,l);for(let f of l.aliasNodes){f.source=f.source.node;let m=s.getName(f.source);m||(m=s.newName(),s.map[m]=f.source)}}if(t instanceof S.Pair)return t.toString(e,n,r);o||(o=ka(i.tags,t));let a=va(t,o,e);a.length>0&&(e.indentAtStart=(e.indentAtStart||0)+a.length+1);let c=typeof o.stringify=="function"?o.stringify(t,e,n,r):t instanceof S.Scalar?S.stringifyString(t,e,n,r):t.toString(e,n,r);return a?t instanceof S.Scalar||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a} +${e.indent}${c}`:c}var zn=class t{static validAnchorNode(e){return e instanceof S.Scalar||e instanceof S.YAMLSeq||e instanceof S.YAMLMap}constructor(e){Y._defineProperty(this,"map",Object.create(null)),this.prefix=e}createAlias(e,n){return this.setAnchor(e,n),new S.Alias(e)}createMergePair(...e){let n=new S.Merge;return n.value.items=e.map(r=>{if(r instanceof S.Alias){if(r.source instanceof S.YAMLMap)return r}else if(r instanceof S.YAMLMap)return this.createAlias(r);throw new Error("Merge sources must be Map nodes or their Aliases")}),n}getName(e){let{map:n}=this;return Object.keys(n).find(r=>n[r]===e)}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);let n=Object.keys(this.map);for(let r=1;;++r){let s=`${e}${r}`;if(!n.includes(s))return s}}resolveNodes(){let{map:e,_cstAliases:n}=this;Object.keys(e).forEach(r=>{e[r]=e[r].resolved}),n.forEach(r=>{r.source=r.source.resolved}),delete this._cstAliases}setAnchor(e,n){if(e!=null&&!t.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");let{map:r}=this,s=e&&Object.keys(r).find(i=>r[i]===e);if(s)if(n)s!==n&&(delete r[s],r[n]=e);else return s;else{if(!n){if(!e)return null;n=this.newName()}r[n]=e}return n}},Zt=(t,e)=>{if(t&&typeof t=="object"){let{tag:n}=t;t instanceof S.Collection?(n&&(e[n]=!0),t.items.forEach(r=>Zt(r,e))):t instanceof S.Pair?(Zt(t.key,e),Zt(t.value,e)):t instanceof S.Scalar&&n&&(e[n]=!0)}return e},Ia=t=>Object.keys(Zt(t,{}));function Pa(t,e){let n={before:[],after:[]},r,s=!1;for(let i of e)if(i.valueRange){if(r!==void 0){let a="Document contains trailing content not separated by a ... or --- line";t.errors.push(new Y.YAMLSyntaxError(i,a));break}let o=S.resolveNode(t,i);s&&(o.spaceBefore=!0,s=!1),r=o}else i.comment!==null?(r===void 0?n.before:n.after).push(i.comment):i.type===Y.Type.BLANK_LINE&&(s=!0,r===void 0&&n.before.length>0&&!t.commentBefore&&(t.commentBefore=n.before.join(` +`),n.before=[]));if(t.contents=r||null,!r)t.comment=n.before.concat(n.after).join(` +`)||null;else{let i=n.before.join(` +`);if(i){let o=r instanceof S.Collection&&r.items[0]?r.items[0]:r;o.commentBefore=o.commentBefore?`${i} +${o.commentBefore}`:i}t.comment=n.after.join(` +`)||null}}function _a({tagPrefixes:t},e){let[n,r]=e.parameters;if(!n||!r){let s="Insufficient parameters given for %TAG directive";throw new Y.YAMLSemanticError(e,s)}if(t.some(s=>s.handle===n)){let s="The %TAG directive must only be given at most once per handle in the same document.";throw new Y.YAMLSemanticError(e,s)}return{handle:n,prefix:r}}function xa(t,e){let[n]=e.parameters;if(e.name==="YAML:1.0"&&(n="1.0"),!n){let r="Insufficient parameters given for %YAML directive";throw new Y.YAMLSemanticError(e,r)}if(!pi[n]){let s=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${n}`;t.warnings.push(new Y.YAMLWarning(e,s))}return n}function Ra(t,e,n){let r=[],s=!1;for(let i of e){let{comment:o,name:a}=i;switch(a){case"TAG":try{t.tagPrefixes.push(_a(t,i))}catch(c){t.errors.push(c)}s=!0;break;case"YAML":case"YAML:1.0":if(t.version){let c="The %YAML directive must only be given at most once per document.";t.errors.push(new Y.YAMLSemanticError(i,c))}try{t.version=xa(t,i)}catch(c){t.errors.push(c)}s=!0;break;default:if(a){let c=`YAML only supports %TAG and %YAML directives, and not %${a}`;t.warnings.push(new Y.YAMLWarning(i,c))}}o&&r.push(o)}if(n&&!s&&(t.version||n.version||t.options.version)==="1.1"){let i=({handle:o,prefix:a})=>({handle:o,prefix:a});t.tagPrefixes=n.tagPrefixes.map(i),t.version=n.version}t.commentBefore=r.join(` +`)||null}function Ve(t){if(t instanceof S.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}var en=class t{constructor(e){this.anchors=new zn(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return Ve(this.contents),this.contents.add(e)}addIn(e,n){Ve(this.contents),this.contents.addIn(e,n)}delete(e){return Ve(this.contents),this.contents.delete(e)}deleteIn(e){return S.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):(Ve(this.contents),this.contents.deleteIn(e))}getDefaults(){return t.defaults[this.version]||t.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof S.Collection?this.contents.get(e,n):void 0}getIn(e,n){return S.isEmptyPath(e)?!n&&this.contents instanceof S.Scalar?this.contents.value:this.contents:this.contents instanceof S.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof S.Collection?this.contents.has(e):!1}hasIn(e){return S.isEmptyPath(e)?this.contents!==void 0:this.contents instanceof S.Collection?this.contents.hasIn(e):!1}set(e,n){Ve(this.contents),this.contents.set(e,n)}setIn(e,n){S.isEmptyPath(e)?this.contents=n:(Ve(this.contents),this.contents.setIn(e,n))}setSchema(e,n){if(!e&&!n&&this.schema)return;typeof e=="number"&&(e=e.toFixed(1)),e==="1.0"||e==="1.1"||e==="1.2"?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&typeof e=="string"&&(this.options.schema=e),Array.isArray(n)&&(this.options.customTags=n);let r=Object.assign({},this.getDefaults(),this.options);this.schema=new fi.Schema(r)}parse(e,n){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");let{directives:r=[],contents:s=[],directivesEndMarker:i,error:o,valueRange:a}=e;if(o&&(o.source||(o.source=this),this.errors.push(o)),Ra(this,r,n),i&&(this.directivesEndMarker=!0),this.range=a?[a.start,a.end]:null,this.setSchema(),this.anchors._cstAliases=[],Pa(this,s),this.anchors.resolveNodes(),this.options.prettyErrors){for(let c of this.errors)c instanceof Y.YAMLError&&c.makePretty();for(let c of this.warnings)c instanceof Y.YAMLError&&c.makePretty()}return this}listNonDefaultTags(){return Ia(this.contents).filter(e=>e.indexOf(fi.Schema.defaultPrefix)!==0)}setTagPrefix(e,n){if(e[0]!=="!"||e[e.length-1]!=="!")throw new Error("Handle must start and end with !");if(n){let r=this.tagPrefixes.find(s=>s.handle===e);r?r.prefix=n:this.tagPrefixes.push({handle:e,prefix:n})}else this.tagPrefixes=this.tagPrefixes.filter(r=>r.handle!==e)}toJSON(e,n){let{keepBlobsInJSON:r,mapAsMap:s,maxAliasCount:i}=this.options,o=r&&(typeof e!="string"||!(this.contents instanceof S.Scalar)),a={doc:this,indentStep:" ",keep:o,mapAsMap:o&&!!s,maxAliasCount:i,stringify:zt},c=Object.keys(this.anchors.map);c.length>0&&(a.anchors=new Map(c.map(f=>[this.anchors.map[f],{alias:[],aliasCount:0,count:1}])));let l=S.toJSON(this.contents,e,a);if(typeof n=="function"&&a.anchors)for(let{count:f,res:m}of a.anchors.values())n(m,f);return l}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");let e=this.options.indent;if(!Number.isInteger(e)||e<=0){let c=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${c}`)}this.setSchema();let n=[],r=!1;if(this.version){let c="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?c="%YAML:1.0":this.version==="1.1"&&(c="%YAML 1.1")),n.push(c),r=!0}let s=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:c,prefix:l})=>{s.some(f=>f.indexOf(l)===0)&&(n.push(`%TAG ${c} ${l}`),r=!0)}),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&((r||!this.directivesEndMarker)&&n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));let i={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:zt},o=!1,a=null;if(this.contents){this.contents instanceof S.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),i.forceBlockIndent=!!this.comment,a=this.contents.comment);let c=a?null:()=>o=!0,l=zt(this.contents,i,()=>a=null,c);n.push(S.addComment(l,"",a))}else this.contents!==void 0&&n.push(zt(this.contents,i));return this.comment&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join(` +`)+` +`}};Y._defineProperty(en,"defaults",pi);tn.Document=en;tn.defaultOptions=Ca;tn.scalarOptions=Ma});var di=te(gi=>{"use strict";var Zn=Rs(),Oe=mi(),Da=Xn(),Ya=le(),$a=Qn();qe();function Ba(t,e=!0,n){n===void 0&&typeof e=="string"&&(n=e,e=!0);let r=Object.assign({},Oe.Document.defaults[Oe.defaultOptions.version],Oe.defaultOptions);return new Da.Schema(r).createNode(t,e,n)}var We=class extends Oe.Document{constructor(e){super(Object.assign({},Oe.defaultOptions,e))}};function Fa(t,e){let n=[],r;for(let s of Zn.parse(t)){let i=new We(e);i.parse(s,r),n.push(i),r=i}return n}function hi(t,e){let n=Zn.parse(t),r=new We(e).parse(n[0]);if(n.length>1){let s="Source contains multiple documents; please use YAML.parseAllDocuments()";r.errors.unshift(new Ya.YAMLSemanticError(n[1],s))}return r}function qa(t,e){let n=hi(t,e);if(n.warnings.forEach(r=>$a.warn(r)),n.errors.length>0)throw n.errors[0];return n.toJSON()}function Ua(t,e){let n=new We(e);return n.contents=t,String(n)}var Ka={createNode:Ba,defaultOptions:Oe.defaultOptions,Document:We,parse:qa,parseAllDocuments:Fa,parseCST:Zn.parse,parseDocument:hi,scalarOptions:Oe.scalarOptions,stringify:Ua};gi.YAML=Ka});var Ei=te((Um,yi)=>{yi.exports=di().YAML});var Si=te(J=>{"use strict";var je=qe(),Qe=le();J.findPair=je.findPair;J.parseMap=je.resolveMap;J.parseSeq=je.resolveSeq;J.stringifyNumber=je.stringifyNumber;J.stringifyString=je.stringifyString;J.toJSON=je.toJSON;J.Type=Qe.Type;J.YAMLError=Qe.YAMLError;J.YAMLReferenceError=Qe.YAMLReferenceError;J.YAMLSemanticError=Qe.YAMLSemanticError;J.YAMLSyntaxError=Qe.YAMLSyntaxError;J.YAMLWarning=Qe.YAMLWarning});var Xa={};nr(Xa,{languages:()=>_r,options:()=>xr,parsers:()=>tr,printers:()=>Ha});var Pi=(t,e,n,r)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(n,r):n.global?e.replace(n,r):e.split(n).join(r)},Et=Pi;var Le="string",Je="array",Ge="cursor",He="indent",Ae="align",Xe="trim",Te="group",Ce="fill",he="if-break",ze="indent-if-break",Me="line-suffix",Ze="line-suffix-boundary",Z="line",et="label",ke="break-parent",St=new Set([Ge,He,Ae,Xe,Te,Ce,he,ze,Me,Ze,Z,et,ke]);var _i=(t,e,n)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[n<0?e.length+n:n]:e.at(n)},x=_i;function xi(t){if(typeof t=="string")return Le;if(Array.isArray(t))return Je;if(!t)return;let{type:e}=t;if(St.has(e))return e}var ve=xi;var Ri=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Di(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', +Expected it to be 'string' or 'object'.`;if(ve(t))throw new Error("doc is valid.");let n=Object.prototype.toString.call(t);if(n!=="[object Object]")return`Unexpected doc '${n}'.`;let r=Ri([...St].map(s=>`'${s}'`));return`Unexpected doc.type '${t.type}'. +Expected it to be ${r}.`}var nn=class extends Error{name="InvalidDocError";constructor(e){super(Di(e)),this.doc=e}},rn=nn;function $i(t,e){if(typeof t=="string")return e(t);let n=new Map;return r(t);function r(i){if(n.has(i))return n.get(i);let o=s(i);return n.set(i,o),o}function s(i){switch(ve(i)){case Je:return e(i.map(r));case Ce:return e({...i,parts:i.parts.map(r)});case he:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case Te:{let{expandedStates:o,contents:a}=i;return o?(o=o.map(r),a=o[0]):a=r(a),e({...i,contents:a,expandedStates:o})}case Ae:case He:case ze:case et:case Me:return e({...i,contents:r(i.contents)});case Le:case Ge:case Xe:case Ze:case Z:case ke:return e(i);default:throw new rn(i)}}}function ir(t,e=tt){return $i(t,n=>typeof n=="string"?v(e,n.split(` +`)):n)}var sn=()=>{},ge=sn,on=sn,or=sn;function nt(t,e){return ge(e),{type:Ae,contents:e,n:t}}function Ie(t,e={}){return ge(t),on(e.expandedStates,!0),{type:Te,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function an(t){return nt(Number.NEGATIVE_INFINITY,t)}function ar(t){return nt({type:"root"},t)}function cr(t){return nt(-1,t)}function cn(t,e){return Ie(t[0],{...e,expandedStates:t})}function wt(t){return or(t),{type:Ce,parts:t}}function rt(t,e="",n={}){return ge(t),e!==""&&ge(e),{type:he,breakContents:t,flatContents:e,groupId:n.groupId}}function lr(t){return ge(t),{type:Me,contents:t}}var bt={type:ke};var Bi={type:Z,hard:!0},Fi={type:Z,hard:!0,literal:!0},ne={type:Z},Nt={type:Z,soft:!0},N=[Bi,bt],tt=[Fi,bt];function v(t,e){ge(t),on(e);let n=[];for(let r=0;r{let s=!!(r!=null&&r.backwards);if(n===!1)return!1;let{length:i}=e,o=n;for(;o>=0&&o{let s=await r(e.originalText,{parser:"json"});return s?[s,N]:void 0}}pr.getVisitorKeys=()=>[];var mr=pr;var st=null;function it(t){if(st!==null&&typeof st.property){let e=st;return st=it.prototype=null,e}return st=it.prototype=t??Object.create(null),new it}var Ki=10;for(let t=0;t<=Ki;t++)it();function pn(t){return it(t)}function Vi(t,e="type"){pn(t);function n(r){let s=r[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:r});return i}return n}var hr=Vi;var Wi=Object.fromEntries(Object.entries({root:["children"],document:["head","body","children"],documentHead:["children"],documentBody:["children"],directive:[],alias:[],blockLiteral:[],blockFolded:["children"],plain:["children"],quoteSingle:[],quoteDouble:[],mapping:["children"],mappingItem:["key","value","children"],mappingKey:["content","children"],mappingValue:["content","children"],sequence:["children"],sequenceItem:["content","children"],flowMapping:["children"],flowMappingItem:["key","value","children"],flowSequence:["children"],flowSequenceItem:["content","children"],comment:[],tag:[],anchor:[]}).map(([t,e])=>[t,[...e,"anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"]])),gr=Wi;var ji=hr(gr),dr=ji;function Pe(t){return t.position.start.offset}function yr(t){return t.position.end.offset}function Er(t){return/^\s*@(?:prettier|format)\s*$/u.test(t)}function Sr(t){return/^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/u.test(t)}function wr(t){return`# @format + +${t}`}function Qi(t){return Array.isArray(t)&&t.length>0}var _e=Qi;function H(t,e){return typeof(t==null?void 0:t.type)=="string"&&(!e||e.includes(t.type))}function mn(t,e,n){return e("children"in t?{...t,children:t.children.map(r=>mn(r,e,t))}:t,n)}function xe(t,e,n){Object.defineProperty(t,e,{get:n,enumerable:!1})}function Nr(t,e){let n=0,r=e.length;for(let s=t.position.end.offset-1;si===0&&i===o.length-1?s:i!==0&&i!==o.length-1?s.trim():i===0?s.trimEnd():s.trimStart());return n.proseWrap==="preserve"?r.map(s=>s.length===0?[]:[s]):r.map(s=>s.length===0?[]:Lr(s)).reduce((s,i,o)=>o!==0&&r[o-1].length>0&&i.length>0&&!(t==="quoteDouble"&&x(!1,x(!1,s,-1),-1).endsWith("\\"))?[...s.slice(0,-1),[...x(!1,s,-1),...i]]:[...s,i],[]).map(s=>n.proseWrap==="never"?[s.join(" ")]:s)}function Tr(t,{parentIndent:e,isLastDescendant:n,options:r}){let s=t.position.start.line===t.position.end.line?"":r.originalText.slice(t.position.start.offset,t.position.end.offset).match(/^[^\n]*\n(.*)$/su)[1],i;if(t.indent===null){let c=s.match(/^(? *)[^\n\r ]/mu);i=c?c.groups.leadingSpace.length:Number.POSITIVE_INFINITY}else i=t.indent-1+e;let o=s.split(` +`).map(c=>c.slice(i));if(r.proseWrap==="preserve"||t.type==="blockLiteral")return a(o.map(c=>c.length===0?[]:[c]));return a(o.map(c=>c.length===0?[]:Lr(c)).reduce((c,l,f)=>f!==0&&o[f-1].length>0&&l.length>0&&!/^\s/u.test(l[0])&&!/^\s|\s$/u.test(x(!1,c,-1))?[...c.slice(0,-1),[...x(!1,c,-1),...l]]:[...c,l],[]).map(c=>c.reduce((l,f)=>l.length>0&&/\s$/u.test(x(!1,l,-1))?[...l.slice(0,-1),x(!1,l,-1)+" "+f]:[...l,f],[])).map(c=>r.proseWrap==="never"?[c.join(" ")]:c));function a(c){if(t.chomping==="keep")return x(!1,c,-1).length===0?c.slice(0,-1):c;let l=0;for(let f=c.length-1;f>=0&&c[f].length===0;f--)l++;return l===0?c:l>=2&&!n?c.slice(0,-(l-1)):c.slice(0,-l)}}function ot(t){if(!t)return!0;switch(t.type){case"plain":case"quoteDouble":case"quoteSingle":case"alias":case"flowMapping":case"flowSequence":return!0;default:return!1}}var gn=new WeakMap;function Tt(t,e){let{node:n,root:r}=t,s;return gn.has(r)?s=gn.get(r):(s=new Set,gn.set(r,s)),!s.has(n.position.end.line)&&(s.add(n.position.end.line),Nr(n,e)&&!dn(t.parent))?Nt:""}function dn(t){return R(t)&&!H(t,["documentHead","documentBody","flowMapping","flowSequence"])}function I(t,e){return nt(" ".repeat(t),e)}function Gi(t,e,n){let{node:r}=t,s=t.ancestors.filter(l=>l.type==="sequence"||l.type==="mapping").length,i=Lt(t),o=[r.type==="blockFolded"?">":"|"];r.indent!==null&&o.push(r.indent.toString()),r.chomping!=="clip"&&o.push(r.chomping==="keep"?"+":"-"),hn(r)&&o.push(" ",e("indicatorComment"));let a=Tr(r,{parentIndent:s,isLastDescendant:i,options:n}),c=[];for(let[l,f]of a.entries())l===0&&c.push(N),c.push(wt(v(ne,f))),l!==a.length-1?c.push(f.length===0?N:ar(tt)):r.chomping==="keep"&&i&&c.push(an(f.length===0?N:tt));return r.indent===null?o.push(cr(I(n.tabWidth,c))):o.push(an(I(r.indent-1+s,c))),o}var Cr=Gi;function Ct(t,e,n){let{node:r}=t,s=r.type==="flowMapping",i=s?"{":"[",o=s?"}":"]",a=Nt;s&&r.children.length>0&&n.bracketSpacing&&(a=ne);let c=x(!1,r.children,-1),l=(c==null?void 0:c.type)==="flowMappingItem"&&Re(c.key)&&Re(c.value);return[i,I(n.tabWidth,[a,Hi(t,e,n),n.trailingComma==="none"?"":rt(","),R(r)?[N,v(N,t.map(e,"endComments"))]:""]),l?"":a,o]}function Hi(t,e,n){return t.map(({isLast:r,node:s,next:i})=>[e(),r?"":[",",ne,s.position.start.line!==i.position.start.line?Tt(t,n.originalText):""]],"children")}function Xi(t,e,n){var C;let{node:r,parent:s}=t,{key:i,value:o}=r,a=Re(i),c=Re(o);if(a&&c)return": ";let l=e("key"),f=zi(r)?" ":"";if(c)return r.type==="flowMappingItem"&&s.type==="flowMapping"?l:r.type==="mappingItem"&&yn(i.content,n)&&!K(i.content)&&((C=s.tag)==null?void 0:C.value)!=="tag:yaml.org,2002:set"?[l,f,":"]:["? ",I(2,l)];let m=e("value");if(a)return[": ",I(2,m)];if(ee(o)||!ot(i.content))return["? ",I(2,l),N,...t.map(()=>[e(),N],"value","leadingComments"),": ",I(2,m)];if(Zi(i.content)&&!ee(i.content)&&!ie(i.content)&&!K(i.content)&&!R(i)&&!ee(o.content)&&!ie(o.content)&&!R(o)&&yn(o.content,n))return[l,f,": ",m];let d=Symbol("mappingKey"),y=Ie([rt("? "),Ie(I(2,l),{id:d})]),h=[N,": ",I(2,m)],g=[f,":"];ee(o.content)||R(o)&&o.content&&!H(o.content,["mapping","sequence"])||s.type==="mapping"&&K(i.content)&&ot(o.content)||H(o.content,["mapping","sequence"])&&o.content.tag===null&&o.content.anchor===null?g.push(N):o.content?g.push(ne):K(o)&&g.push(" "),g.push(m);let w=I(n.tabWidth,g);return yn(i.content,n)&&!ee(i.content)&&!ie(i.content)&&!R(i)?cn([[l,w]]):cn([[y,rt(h,w,{groupId:d})]])}function yn(t,e){if(!t)return!0;switch(t.type){case"plain":case"quoteSingle":case"quoteDouble":break;case"alias":return!0;default:return!1}if(e.proseWrap==="preserve")return t.position.start.line===t.position.end.line;if(/\\$/mu.test(e.originalText.slice(t.position.start.offset,t.position.end.offset)))return!1;switch(e.proseWrap){case"never":return!t.value.includes(` +`);case"always":return!/[\n ]/u.test(t.value);default:return!1}}function zi(t){var e;return((e=t.key.content)==null?void 0:e.type)==="alias"}function Zi(t){if(!t)return!0;switch(t.type){case"plain":case"quoteDouble":case"quoteSingle":return t.position.start.line===t.position.end.line;case"alias":return!0;default:return!1}}var Mr=Xi;function eo(t){return mn(t,to)}function to(t){switch(t.type){case"document":xe(t,"head",()=>t.children[0]),xe(t,"body",()=>t.children[1]);break;case"documentBody":case"sequenceItem":case"flowSequenceItem":case"mappingKey":case"mappingValue":xe(t,"content",()=>t.children[0]);break;case"mappingItem":case"flowMappingItem":xe(t,"key",()=>t.children[0]),xe(t,"value",()=>t.children[1]);break}return t}var kr=eo;function no(t,e,n){let{node:r}=t,s=[];r.type!=="mappingValue"&&ee(r)&&s.push([v(N,t.map(n,"leadingComments")),N]);let{tag:i,anchor:o}=r;i&&s.push(n("tag")),i&&o&&s.push(" "),o&&s.push(n("anchor"));let a="";return H(r,["mapping","sequence","comment","directive","mappingItem","sequenceItem"])&&!Lt(t)&&(a=Tt(t,e.originalText)),(i||o)&&(H(r,["sequence","mapping"])&&!ie(r)?s.push(N):s.push(" ")),ie(r)&&s.push([r.middleComments.length===1?"":N,v(N,t.map(n,"middleComments")),N]),Or(t)?s.push(ir(e.originalText.slice(r.position.start.offset,r.position.end.offset).trimEnd())):s.push(Ie(ro(t,e,n))),K(r)&&!H(r,["document","documentHead"])&&s.push(lr([r.type==="mappingValue"&&!r.content?"":" ",t.parent.type==="mappingKey"&&t.getParentNode(2).type==="mapping"&&ot(r)?"":bt,n("trailingComment")])),dn(r)&&s.push(I(r.type==="sequenceItem"?2:0,[N,v(N,t.map(({node:c})=>[fr(e.originalText,Pe(c))?N:"",n()],"endComments"))])),s.push(a),s}function ro(t,e,n){let{node:r}=t;switch(r.type){case"root":{let s=[];t.each(({node:o,next:a,isFirst:c})=>{c||s.push(N),s.push(n()),vr(o,a)?(s.push(N,"..."),K(o)&&s.push(" ",n("trailingComment"))):a&&!K(a.head)&&s.push(N,"---")},"children");let i=At(r);return(!H(i,["blockLiteral","blockFolded"])||i.chomping!=="keep")&&s.push(N),s}case"document":{let s=[];return io(t,e)==="head"&&((r.head.children.length>0||r.head.endComments.length>0)&&s.push(n("head")),K(r.head)?s.push(["---"," ",n(["head","trailingComment"])]):s.push("---")),so(r)&&s.push(n("body")),v(N,s)}case"documentHead":return v(N,[...t.map(n,"children"),...t.map(n,"endComments")]);case"documentBody":{let{children:s,endComments:i}=r,o="";if(s.length>0&&i.length>0){let a=At(r);H(a,["blockFolded","blockLiteral"])?a.chomping!=="keep"&&(o=[N,N]):o=N}return[v(N,t.map(n,"children")),o,v(N,t.map(n,"endComments"))]}case"directive":return["%",v(" ",[r.name,...r.parameters])];case"comment":return["#",r.value];case"alias":return["*",r.value];case"tag":return e.originalText.slice(r.position.start.offset,r.position.end.offset);case"anchor":return["&",r.value];case"plain":return at(r.type,e.originalText.slice(r.position.start.offset,r.position.end.offset),e);case"quoteDouble":case"quoteSingle":{let s="'",i='"',o=e.originalText.slice(r.position.start.offset+1,r.position.end.offset-1);if(r.type==="quoteSingle"&&o.includes("\\")||r.type==="quoteDouble"&&/\\[^"]/u.test(o)){let c=r.type==="quoteDouble"?i:s;return[c,at(r.type,o,e),c]}if(o.includes(i))return[s,at(r.type,r.type==="quoteDouble"?Et(!1,Et(!1,o,String.raw`\"`,i),"'",s.repeat(2)):o,e),s];if(o.includes(s))return[i,at(r.type,r.type==="quoteSingle"?Et(!1,o,"''",s):o,e),i];let a=e.singleQuote?s:i;return[a,at(r.type,o,e),a]}case"blockFolded":case"blockLiteral":return Cr(t,n,e);case"mapping":case"sequence":return v(N,t.map(n,"children"));case"sequenceItem":return["- ",I(2,r.content?n("content"):"")];case"mappingKey":case"mappingValue":return r.content?n("content"):"";case"mappingItem":case"flowMappingItem":return Mr(t,n,e);case"flowMapping":return Ct(t,n,e);case"flowSequence":return Ct(t,n,e);case"flowSequenceItem":return n("content");default:throw new ur(r,"YAML")}}function so(t){return t.body.children.length>0||R(t.body)}function vr(t,e){return K(t)||e&&(e.head.children.length>0||R(e.head))}function io(t,e){let n=t.node;if(t.isFirst&&/---(?:\s|$)/u.test(e.originalText.slice(Pe(n),Pe(n)+4))||n.head.children.length>0||R(n.head)||K(n.head))return"head";let r=t.next;return vr(n,r)?!1:r?"root":!1}function at(t,e,n){let r=Ar(t,e,n);return v(N,r.map(s=>wt(v(ne,s))))}function Ir(t,e){if(H(t))switch(t.type){case"comment":if(Er(t.value))return null;break;case"quoteDouble":case"quoteSingle":e.type="quote";break}}Ir.ignoredProperties=new Set(["position"]);var oo={preprocess:kr,embed:mr,print:no,massageAstNode:Ir,insertPragma:wr,getVisitorKeys:dr},Pr=oo;var _r=[{linguistLanguageId:407,name:"YAML",type:"data",color:"#cb171e",tmScope:"source.yaml",aliases:["yml"],extensions:[".yml",".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".gemrc","CITATION.cff","glide.lock",".prettierrc",".stylelintrc",".lintstagedrc"],aceMode:"yaml",codemirrorMode:"yaml",codemirrorMimeType:"text/x-yaml",parsers:["yaml"],vscodeLanguageIds:["yaml","ansible","dockercompose","github-actions-workflow","home-assistant"]}];var Mt={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var ao={bracketSpacing:Mt.bracketSpacing,singleQuote:Mt.singleQuote,proseWrap:Mt.proseWrap},xr=ao;var tr={};nr(tr,{yaml:()=>Ga});var kt=` +`,Rr="\r",Dr=function(){function t(e){this.length=e.length;for(var n=[0],r=0;rthis.length)return null;for(var n=0,r=this.offsets;r[n+1]<=e;)n++;var s=e-r[n];return{line:n,column:s}},t.prototype.indexForLocation=function(e){var n=e.line,r=e.column;return n<0||n>=this.offsets.length||r<0||r>this.lengthOfLine(n)?null:this.offsets[n]+r},t.prototype.lengthOfLine=function(e){var n=this.offsets[e],r=e===this.offsets.length-1?this.length:this.offsets[e+1];return r-n},t}();function $(t,e=null){"children"in t&&t.children.forEach(n=>$(n,t)),"anchor"in t&&t.anchor&&$(t.anchor,t),"tag"in t&&t.tag&&$(t.tag,t),"leadingComments"in t&&t.leadingComments.forEach(n=>$(n,t)),"middleComments"in t&&t.middleComments.forEach(n=>$(n,t)),"indicatorComment"in t&&t.indicatorComment&&$(t.indicatorComment,t),"trailingComment"in t&&t.trailingComment&&$(t.trailingComment,t),"endComments"in t&&t.endComments.forEach(n=>$(n,t)),Object.defineProperty(t,"_parent",{value:e,enumerable:!1})}function de(t){return`${t.line}:${t.column}`}function Yr(t){$(t);let e=co(t),n=t.children.slice();t.comments.sort((r,s)=>r.position.start.offset-s.position.end.offset).filter(r=>!r._parent).forEach(r=>{for(;n.length>1&&r.position.start.line>n[0].position.end.line;)n.shift();lo(r,e,n[0])})}function co(t){let e=Array.from(new Array(t.position.end.line),()=>({}));for(let n of t.comments)e[n.position.start.line-1].comment=n;return $r(e,t),e}function $r(t,e){if(e.position.start.offset!==e.position.end.offset){if("leadingComments"in e){let{start:n}=e.position,{leadingAttachableNode:r}=t[n.line-1];(!r||n.column1&&e.type!=="document"&&e.type!=="documentHead"){let{end:n}=e.position,{trailingAttachableNode:r}=t[n.line-1];(!r||n.column>=r.position.end.column)&&(t[n.line-1].trailingAttachableNode=e)}if(e.type!=="root"&&e.type!=="document"&&e.type!=="documentHead"&&e.type!=="documentBody"){let{start:n,end:r}=e.position,s=[r.line].concat(n.line===r.line?[]:n.line);for(let i of s){let o=t[i-1].trailingNode;(!o||r.column>=o.position.end.column)&&(t[i-1].trailingNode=e)}}"children"in e&&e.children.forEach(n=>{$r(t,n)})}}function lo(t,e,n){let r=t.position.start.line,{trailingAttachableNode:s}=e[r-1];if(s){if(s.trailingComment)throw new Error(`Unexpected multiple trailing comment at ${de(t.position.start)}`);$(t,s),s.trailingComment=t;return}for(let o=r;o>=n.position.start.line;o--){let{trailingNode:a}=e[o-1],c;if(a)c=a;else if(o!==r&&e[o-1].comment)c=e[o-1].comment._parent;else continue;if((c.type==="sequence"||c.type==="mapping")&&(c=c.children[0]),c.type==="mappingItem"){let[l,f]=c.children;c=Br(l)?l:f}for(;;){if(fo(c,t)){$(t,c),c.endComments.push(t);return}if(!c._parent)break;c=c._parent}break}for(let o=r+1;o<=n.position.end.line;o++){let{leadingAttachableNode:a}=e[o-1];if(a){$(t,a),a.leadingComments.push(t);return}}let i=n.children[1];$(t,i),i.endComments.push(t)}function fo(t,e){if(t.position.start.offsete.position.end.offset)switch(t.type){case"flowMapping":case"flowSequence":return t.children.length===0||e.position.start.line>t.children[t.children.length-1].position.end.line}if(e.position.end.offsett.position.start.column;case"mappingKey":case"mappingValue":return e.position.start.column>t._parent.position.start.column&&(t.children.length===0||t.children.length===1&&t.children[0].type!=="blockFolded"&&t.children[0].type!=="blockLiteral")&&(t.type==="mappingValue"||Br(t));default:return!1}}function Br(t){return t.position.start!==t.position.end&&(t.children.length===0||t.position.start.offset!==t.children[0].position.start.offset)}function b(t,e){return{type:t,position:e}}function Fr(t,e,n){return{...b("root",t),children:e,comments:n}}function ct(t){switch(t.type){case"DOCUMENT":for(let e=t.contents.length-1;e>=0;e--)t.contents[e].type==="BLANK_LINE"?t.contents.splice(e,1):ct(t.contents[e]);for(let e=t.directives.length-1;e>=0;e--)t.directives[e].type==="BLANK_LINE"&&t.directives.splice(e,1);break;case"FLOW_MAP":case"FLOW_SEQ":case"MAP":case"SEQ":for(let e=t.items.length-1;e>=0;e--){let n=t.items[e];"char"in n||(n.type==="BLANK_LINE"?t.items.splice(e,1):ct(n))}break;case"MAP_KEY":case"MAP_VALUE":case"SEQ_ITEM":t.node&&ct(t.node);break;case"ALIAS":case"BLANK_LINE":case"BLOCK_FOLDED":case"BLOCK_LITERAL":case"COMMENT":case"DIRECTIVE":case"PLAIN":case"QUOTE_DOUBLE":case"QUOTE_SINGLE":break;default:throw new Error(`Unexpected node type ${JSON.stringify(t.type)}`)}}function X(){return{leadingComments:[]}}function oe(t=null){return{trailingComment:t}}function B(){return{...X(),...oe()}}function qr(t,e,n){return{...b("alias",t),...B(),...e,value:n}}function Ur(t,e){let n=t.cstNode;return qr(e.transformRange({origStart:n.valueRange.origStart-1,origEnd:n.valueRange.origEnd}),e.transformContent(t),n.rawValue)}function Kr(t){return{...t,type:"blockFolded"}}function Vr(t,e,n,r,s,i){return{...b("blockValue",t),...X(),...e,chomping:n,indent:r,value:s,indicatorComment:i}}var ae;(function(t){t.Tag="!",t.Anchor="&",t.Comment="#"})(ae||(ae={}));function Wr(t,e){return{...b("anchor",t),value:e}}function De(t,e){return{...b("comment",t),value:e}}function jr(t,e,n){return{anchor:e,tag:t,middleComments:n}}function Qr(t,e){return{...b("tag",t),value:e}}function vt(t,e,n=()=>!1){let r=t.cstNode,s=[],i=null,o=null,a=null;for(let c of r.props){let l=e.text[c.origStart];switch(l){case ae.Tag:i=i||c,o=Qr(e.transformRange(c),t.tag);break;case ae.Anchor:i=i||c,a=Wr(e.transformRange(c),r.anchor);break;case ae.Comment:{let f=De(e.transformRange(c),e.text.slice(c.origStart+1,c.origEnd));e.comments.push(f),!n(f)&&i&&i.origEnd<=c.origStart&&c.origEnd<=r.valueRange.origStart&&s.push(f);break}default:throw new Error(`Unexpected leading character ${JSON.stringify(l)}`)}}return jr(o,a,s)}var En;(function(t){t.CLIP="clip",t.STRIP="strip",t.KEEP="keep"})(En||(En={}));function It(t,e){let n=t.cstNode,r=1,s=n.chomping==="CLIP"?0:1,o=n.header.origEnd-n.header.origStart-r-s!==0,a=e.transformRange({origStart:n.header.origStart,origEnd:n.valueRange.origEnd}),c=null,l=vt(t,e,f=>{if(!(a.start.offset=0;c--){let l=t.contents[c];if(l.type==="COMMENT"){let f=e.transformNode(l);n&&n.line===f.position.start.line?o.unshift(f):a?r.unshift(f):f.position.start.offset>=t.valueRange.origEnd?i.unshift(f):r.unshift(f)}else a=!0}if(i.length>1)throw new Error(`Unexpected multiple document trailing comments at ${de(i[1].position.start)}`);if(o.length>1)throw new Error(`Unexpected multiple documentHead trailing comments at ${de(o[1].position.start)}`);return{comments:r,endComments:s,documentTrailingComment:q(i)||null,documentHeadTrailingComment:q(o)||null}}function po(t,e,n){let r=Pt(n.text.slice(t.valueRange.origEnd),/^\.\.\./),s=r===-1?t.valueRange.origEnd:Math.max(0,t.valueRange.origEnd-1);n.text[s-1]==="\r"&&s--;let i=n.transformRange({origStart:e!==null?e.position.start.offset:s,origEnd:s}),o=r===-1?i.end:n.transformOffset(t.valueRange.origEnd+3);return{position:i,documentEndPoint:o}}function rs(t,e,n,r){return{...b("documentHead",t),...F(n),...oe(r),children:e}}function ss(t,e){let n=t.cstNode,{directives:r,comments:s,endComments:i}=mo(n,e),{position:o,endMarkerPoint:a}=ho(n,r,e);return e.comments.push(...s,...i),{createDocumentHeadWithTrailingComment:l=>(l&&e.comments.push(l),rs(o,r,i,l)),documentHeadEndMarkerPoint:a}}function mo(t,e){let n=[],r=[],s=[],i=!1;for(let o=t.directives.length-1;o>=0;o--){let a=e.transformNode(t.directives[o]);a.type==="comment"?i?r.unshift(a):s.unshift(a):(i=!0,n.unshift(a))}return{directives:n,comments:r,endComments:s}}function ho(t,e,n){let r=Pt(n.text.slice(0,t.valueRange.origStart),/---\s*$/);r>0&&!/[\r\n]/.test(n.text[r-1])&&(r=-1);let s=r===-1?{origStart:t.valueRange.origStart,origEnd:t.valueRange.origStart}:{origStart:r,origEnd:r+3};return e.length!==0&&(s.origStart=e[0].position.start.offset),{position:n.transformRange(s),endMarkerPoint:r===-1?null:n.transformOffset(r)}}function is(t,e){let{createDocumentHeadWithTrailingComment:n,documentHeadEndMarkerPoint:r}=ss(t,e),{documentBody:s,documentEndPoint:i,documentTrailingComment:o,documentHeadTrailingComment:a}=ns(t,e,r),c=n(a);return o&&e.comments.push(o),es(V(c.position.start,i),c,s,o)}function _t(t,e,n){return{...b("flowCollection",t),...B(),...F(),...e,children:n}}function os(t,e,n){return{..._t(t,e,n),type:"flowMapping"}}function xt(t,e,n){return{...b("flowMappingItem",t),...X(),children:[e,n]}}function ce(t,e){let n=[];for(let r of t)r&&"type"in r&&r.type==="COMMENT"?e.comments.push(e.transformNode(r)):n.push(r);return n}function Rt(t){let[e,n]=["?",":"].map(r=>{let s=t.find(i=>"char"in i&&i.char===r);return s?{origStart:s.origOffset,origEnd:s.origOffset+1}:null});return{additionalKeyRange:e,additionalValueRange:n}}function Dt(t,e){let n=e;return r=>t.slice(n,n=r)}function Yt(t){let e=[],n=Dt(t,1),r=!1;for(let s=1;s{let l=r[c],{additionalKeyRange:f,additionalValueRange:m}=Rt(l);return $e(a,e,xt,f,m)}),i=n[0],o=q(n);return os(e.transformRange({origStart:i.origOffset,origEnd:o.origOffset+1}),e.transformContent(t),s)}function cs(t,e,n){return{..._t(t,e,n),type:"flowSequence"}}function ls(t,e){return{...b("flowSequenceItem",t),children:[e]}}function fs(t,e){let n=ce(t.cstNode.items,e),r=Yt(n),s=t.items.map((a,c)=>{if(a.type!=="PAIR"){let l=e.transformNode(a);return ls(V(l.position.start,l.position.end),l)}else{let l=r[c],{additionalKeyRange:f,additionalValueRange:m}=Rt(l);return $e(a,e,xt,f,m)}}),i=n[0],o=q(n);return cs(e.transformRange({origStart:i.origOffset,origEnd:o.origOffset+1}),e.transformContent(t),s)}function us(t,e,n){return{...b("mapping",t),...X(),...e,children:n}}function ps(t,e,n){return{...b("mappingItem",t),...X(),children:[e,n]}}function ms(t,e){let n=t.cstNode;n.items.filter(o=>o.type==="MAP_KEY"||o.type==="MAP_VALUE").forEach(o=>Ye(o,e));let r=ce(n.items,e),s=go(r),i=t.items.map((o,a)=>{let c=s[a],[l,f]=c[0].type==="MAP_VALUE"?[null,c[0].range]:[c[0].range,c.length===1?null:c[1].range];return $e(o,e,ps,l,f)});return us(V(i[0].position.start,q(i).position.end),e.transformContent(t),i)}function go(t){let e=[],n=Dt(t,0),r=!1;for(let s=0;s=0;r--)if(n.test(t[r]))return r;return-1}function ds(t,e){let n=t.cstNode;return hs(e.transformRange({origStart:n.valueRange.origStart,origEnd:gs(e.text,n.valueRange.origEnd-1,/\S/)+1}),e.transformContent(t),n.strValue)}function ys(t){return{...t,type:"quoteDouble"}}function Es(t,e,n){return{...b("quoteValue",t),...e,...B(),value:n}}function $t(t,e){let n=t.cstNode;return Es(e.transformRange(n.valueRange),e.transformContent(t),n.strValue)}function Ss(t,e){return ys($t(t,e))}function ws(t){return{...t,type:"quoteSingle"}}function bs(t,e){return ws($t(t,e))}function Ns(t,e,n){return{...b("sequence",t),...X(),...F(),...e,children:n}}function Os(t,e){return{...b("sequenceItem",t),...B(),...F(),children:e?[e]:[]}}function Ls(t,e){let r=ce(t.cstNode.items,e).map((s,i)=>{Ye(s,e);let o=e.transformNode(t.items[i]);return Os(V(e.transformOffset(s.valueRange.origStart),o===null?e.transformOffset(s.valueRange.origStart+1):o.position.end),o)});return Ns(V(r[0].position.start,q(r).position.end),e.transformContent(t),r)}function As(t,e){if(t===null||t.type===void 0&&t.value===null)return null;switch(t.type){case"ALIAS":return Ur(t,e);case"BLOCK_FOLDED":return Jr(t,e);case"BLOCK_LITERAL":return Hr(t,e);case"COMMENT":return Xr(t,e);case"DIRECTIVE":return Zr(t,e);case"DOCUMENT":return is(t,e);case"FLOW_MAP":return as(t,e);case"FLOW_SEQ":return fs(t,e);case"MAP":return ms(t,e);case"PLAIN":return ds(t,e);case"QUOTE_DOUBLE":return Ss(t,e);case"QUOTE_SINGLE":return bs(t,e);case"SEQ":return Ls(t,e);default:throw new Error(`Unexpected node type ${t.type}`)}}function Ts(t,e,n){let r=new SyntaxError(t);return r.name="YAMLSyntaxError",r.source=e,r.position=n,r}function Cs(t,e){let n=t.source.range||t.source.valueRange;return Ts(t.message,e.text,e.transformRange(n))}function Ms(t,e,n){return{offset:t,line:e,column:n}}function ks(t,e){t<0?t=0:t>e.text.length&&(t=e.text.length);let n=e.locator.locationForIndex(t);return Ms(t,n.line+1,n.column+1)}function vs(t,e){return V(e.transformOffset(t.origStart),e.transformOffset(t.origEnd))}function Is(t){if(!t.setOrigRanges()){let e=n=>{if(yo(n))return n.origStart=n.start,n.origEnd=n.end,!0;if(Eo(n))return n.origOffset=n.offset,!0};t.forEach(n=>Nn(n,e))}}function Nn(t,e){if(!(!t||typeof t!="object")&&e(t)!==!0)for(let n of Object.keys(t)){if(n==="context"||n==="error")continue;let r=t[n];Array.isArray(r)?r.forEach(s=>Nn(s,e)):Nn(r,e)}}function yo(t){return typeof t.start=="number"}function Eo(t){return typeof t.offset=="number"}function On(t){if("children"in t){if(t.children.length===1){let e=t.children[0];if(e.type==="plain"&&e.tag===null&&e.anchor===null&&e.value==="")return t.children.splice(0,1),t}t.children.forEach(On)}return t}function Ln(t,e,n,r){let s=e(t);return i=>{r(s,i)&&n(t,s=i)}}function An(t){if(t===null||!("children"in t))return;let e=t.children;if(e.forEach(An),t.type==="document"){let[i,o]=t.children;i.position.start.offset===i.position.end.offset?i.position.start=i.position.end=o.position.start:o.position.start.offset===o.position.end.offset&&(o.position.start=o.position.end=i.position.end)}let n=Ln(t.position,So,wo,Oo),r=Ln(t.position,bo,No,Lo);"endComments"in t&&t.endComments.length!==0&&(n(t.endComments[0].position.start),r(q(t.endComments).position.end));let s=e.filter(i=>i!==null);if(s.length!==0){let i=s[0],o=q(s);n(i.position.start),r(o.position.end),"leadingComments"in i&&i.leadingComments.length!==0&&n(i.leadingComments[0].position.start),"tag"in i&&i.tag&&n(i.tag.position.start),"anchor"in i&&i.anchor&&n(i.anchor.position.start),"trailingComment"in o&&o.trailingComment&&r(o.trailingComment.position.end)}}function So(t){return t.start}function wo(t,e){t.start=e}function bo(t){return t.end}function No(t,e){t.end=e}function Oo(t,e){return e.offsett.offset}var wi=sr(Ei(),1);var G=sr(Si(),1),Vm=G.default.findPair,Wm=G.default.toJSON,jm=G.default.parseMap,Qm=G.default.parseSeq,Jm=G.default.stringifyNumber,Gm=G.default.stringifyString,Hm=G.default.Type,Va=G.default.YAMLError,Xm=G.default.YAMLReferenceError,er=G.default.YAMLSemanticError,Wa=G.default.YAMLSyntaxError,zm=G.default.YAMLWarning;var{Document:bi,parseCST:Ni}=wi.default;function Oi(t){let e=Ni(t);Is(e);let n=e.map(a=>new bi({merge:!1,keepCstNodes:!0}).parse(a)),r=new Dr(t),s=[],i={text:t,locator:r,comments:s,transformOffset:a=>ks(a,i),transformRange:a=>vs(a,i),transformNode:a=>As(a,i),transformContent:a=>vt(a,i)};for(let a of n)for(let c of a.errors)if(!(c instanceof er&&c.message==='Map keys must be unique; "<<" is repeated'))throw Cs(c,i);n.forEach(a=>ct(a.cstNode));let o=Fr(i.transformRange({origStart:0,origEnd:i.text.length}),n.map(i.transformNode),s);return Yr(o),An(o),On(o),o}function Qa(t,e){let n=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(n,e)}var Li=Qa;function Ja(t){try{let e=Oi(t);return delete e.comments,e}catch(e){throw e!=null&&e.position?Li(e.message,{loc:e.position,cause:e}):e}}var Ga={astFormat:"yaml",parse:Ja,hasPragma:Sr,locStart:Pe,locEnd:yr};var Ha={yaml:Pr};return Ii(Xa);}); \ No newline at end of file diff --git a/node_modules/prettier/plugins/yaml.mjs b/node_modules/prettier/plugins/yaml.mjs new file mode 100644 index 0000000..b808fd5 --- /dev/null +++ b/node_modules/prettier/plugins/yaml.mjs @@ -0,0 +1,161 @@ +var Ti=Object.create;var tn=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var Mi=Object.getOwnPropertyNames;var ki=Object.getPrototypeOf,vi=Object.prototype.hasOwnProperty;var te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rr=(t,e)=>{for(var n in e)tn(t,n,{get:e[n],enumerable:!0})},Ii=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Mi(e))!vi.call(t,s)&&s!==n&&tn(t,s,{get:()=>e[s],enumerable:!(r=Ci(e,s))||r.enumerable});return t};var sr=(t,e,n)=>(n=t!=null?Ti(ki(t)):{},Ii(e||!t||!t.__esModule?tn(n,"default",{value:t,enumerable:!0}):n,t));var le=te(U=>{"use strict";var re={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},lt={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},Ao="tag:yaml.org,2002:",To={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function Ps(t){let e=[0],n=t.indexOf(` +`);for(;n!==-1;)n+=1,e.push(n),n=t.indexOf(` +`,n);return e}function _s(t){let e,n;return typeof t=="string"?(e=Ps(t),n=t):(Array.isArray(t)&&(t=t[0]),t&&t.context&&(t.lineStarts||(t.lineStarts=Ps(t.context.src)),e=t.lineStarts,n=t.context.src)),{lineStarts:e,src:n}}function Tn(t,e){if(typeof t!="number"||t<0)return null;let{lineStarts:n,src:r}=_s(e);if(!n||!r||t>r.length)return null;for(let i=0;i=1)||t>n.length)return null;let s=n[t-1],i=n[t];for(;i&&i>s&&r[i-1]===` +`;)--i;return r.slice(s,i)}function Mo({start:t,end:e},n,r=80){let s=Co(t.line,n);if(!s)return null;let{col:i}=t;if(s.length>r)if(i<=r-10)s=s.substr(0,r-1)+"\u2026";else{let f=Math.round(r/2);s.length>i+f&&(s=s.substr(0,i+f-1)+"\u2026"),i-=s.length-r,s="\u2026"+s.substr(1-r)}let o=1,a="";e&&(e.line===t.line&&i+(e.col-t.col)<=r+1?o=e.col-t.col:(o=Math.min(s.length+1,r)-i,a="\u2026"));let c=i>1?" ".repeat(i-1):"",l="^".repeat(o);return`${s} +${c}${l}${a}`}var Be=class t{static copy(e){return new t(e.start,e.end)}constructor(e,n){this.start=e,this.end=n||e}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(e,n){let{start:r,end:s}=this;if(e.length===0||s<=e[0])return this.origStart=r,this.origEnd=s,n;let i=n;for(;ir);)++i;this.origStart=r+i;let o=i;for(;i=s);)++i;return this.origEnd=s+i,o}},se=class t{static addStringTerminator(e,n,r){if(r[r.length-1]===` +`)return r;let s=t.endOfWhiteSpace(e,n);return s>=e.length||e[s]===` +`?r+` +`:r}static atDocumentBoundary(e,n,r){let s=e[n];if(!s)return!0;let i=e[n-1];if(i&&i!==` +`)return!1;if(r){if(s!==r)return!1}else if(s!==re.DIRECTIVES_END&&s!==re.DOCUMENT_END)return!1;let o=e[n+1],a=e[n+2];if(o!==s||a!==s)return!1;let c=e[n+3];return!c||c===` +`||c===" "||c===" "}static endOfIdentifier(e,n){let r=e[n],s=r==="<",i=s?[` +`," "," ",">"]:[` +`," "," ","[","]","{","}",","];for(;r&&i.indexOf(r)===-1;)r=e[n+=1];return s&&r===">"&&(n+=1),n}static endOfIndent(e,n){let r=e[n];for(;r===" ";)r=e[n+=1];return n}static endOfLine(e,n){let r=e[n];for(;r&&r!==` +`;)r=e[n+=1];return n}static endOfWhiteSpace(e,n){let r=e[n];for(;r===" "||r===" ";)r=e[n+=1];return n}static startOfLine(e,n){let r=e[n-1];if(r===` +`)return n;for(;r&&r!==` +`;)r=e[n-=1];return n+1}static endOfBlockIndent(e,n,r){let s=t.endOfIndent(e,r);if(s>r+n)return s;{let i=t.endOfWhiteSpace(e,s),o=e[i];if(!o||o===` +`)return i}return null}static atBlank(e,n,r){let s=e[n];return s===` +`||s===" "||s===" "||r&&!s}static nextNodeIsIndented(e,n,r){return!e||n<0?!1:n>0?!0:r&&e==="-"}static normalizeOffset(e,n){let r=e[n];return r?r!==` +`&&e[n-1]===` +`?n-1:t.endOfWhiteSpace(e,n):n}static foldNewline(e,n,r){let s=0,i=!1,o="",a=e[n+1];for(;a===" "||a===" "||a===` +`;){switch(a){case` +`:s=0,n+=1,o+=` +`;break;case" ":s<=r&&(i=!0),n=t.endOfWhiteSpace(e,n+2)-1;break;case" ":s+=1,n+=1;break}a=e[n+1]}return o||(o=" "),a&&s<=r&&(i=!0),{fold:o,offset:n,error:i}}constructor(e,n,r){Object.defineProperty(this,"context",{value:r||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=n||[],this.type=e,this.value=null}getPropValue(e,n,r){if(!this.context)return null;let{src:s}=this.context,i=this.props[e];return i&&s[i.start]===n?s.slice(i.start+(r?1:0),i.end):null}get anchor(){for(let e=0;e0?e.join(` +`):null}commentHasRequiredWhitespace(e){let{src:n}=this.context;if(this.header&&e===this.header.end||!this.valueRange)return!1;let{end:r}=this.valueRange;return e!==r||t.atBlank(n,r-1)}get hasComment(){if(this.context){let{src:e}=this.context;for(let n=0;nr.setOrigRange(e,n)),n}toString(){let{context:{src:e},range:n,value:r}=this;if(r!=null)return r;let s=e.slice(n.start,n.end);return t.addStringTerminator(e,n.end,s)}},ye=class extends Error{constructor(e,n,r){if(!r||!(n instanceof se))throw new Error(`Invalid arguments for new ${e}`);super(),this.name=e,this.message=r,this.source=n}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let e=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new Be(this.offset,this.offset+1);let n=e&&Tn(this.offset,e);if(n){let r={line:n.line,col:n.col+1};this.linePos={start:n,end:r}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:n,col:r}=this.linePos.start;this.message+=` at line ${n}, column ${r}`;let s=e&&Mo(this.linePos,e);s&&(this.message+=`: + +${s} +`)}delete this.source}},Cn=class extends ye{constructor(e,n){super("YAMLReferenceError",e,n)}},ft=class extends ye{constructor(e,n){super("YAMLSemanticError",e,n)}},Mn=class extends ye{constructor(e,n){super("YAMLSyntaxError",e,n)}},kn=class extends ye{constructor(e,n){super("YAMLWarning",e,n)}};function ko(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vn=class t extends se{static endOfLine(e,n,r){let s=e[n],i=n;for(;s&&s!==` +`&&!(r&&(s==="["||s==="]"||s==="{"||s==="}"||s===","));){let o=e[i+1];if(s===":"&&(!o||o===` +`||o===" "||o===" "||r&&o===",")||(s===" "||s===" ")&&o==="#")break;i+=1,s=o}return i}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{src:r}=this.context,s=r[n-1];for(;el?r.slice(l,a+1):c)}else i+=c}let o=r[e];switch(o){case" ":{let a="Plain value cannot start with a tab character";return{errors:[new ft(this,a)],str:i}}case"@":case"`":{let a=`Plain value cannot start with reserved character ${o}`;return{errors:[new ft(this,a)],str:i}}default:return i}}parseBlockValue(e){let{indent:n,inFlow:r,src:s}=this.context,i=e,o=e;for(let a=s[i];a===` +`&&!se.atDocumentBoundary(s,i+1);a=s[i]){let c=se.endOfBlockIndent(s,n,i+1);if(c===null||s[c]==="#")break;s[c]===` +`?i=c:(o=t.endOfLine(s,c,r),i=o)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=o,o}parse(e,n){this.context=e;let{inFlow:r,src:s}=e,i=n,o=s[i];return o&&o!=="#"&&o!==` +`&&(i=t.endOfLine(s,n,r)),this.valueRange=new Be(n,i),i=se.endOfWhiteSpace(s,i),i=this.parseComment(i),(!this.hasComment||this.valueRange.isEmpty())&&(i=this.parseBlockValue(i)),i}};U.Char=re;U.Node=se;U.PlainValue=vn;U.Range=Be;U.Type=lt;U.YAMLError=ye;U.YAMLReferenceError=Cn;U.YAMLSemanticError=ft;U.YAMLSyntaxError=Mn;U.YAMLWarning=kn;U._defineProperty=ko;U.defaultTagPrefix=Ao;U.defaultTags=To});var Rs=te(xs=>{"use strict";var u=le(),Se=class extends u.Node{constructor(){super(u.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,n){return this.context=e,this.range=new u.Range(n,n+1),n+1}},ut=class extends u.Node{constructor(e,n){super(e,n),this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,{atLineStart:i,lineStart:o}=e;!i&&this.type===u.Type.SEQ_ITEM&&(this.error=new u.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));let a=i?n-o:e.indent,c=u.Node.endOfWhiteSpace(s,n+1),l=s[c],f=l==="#",m=[],d=null;for(;l===` +`||l==="#";){if(l==="#"){let h=u.Node.endOfLine(s,c+1);m.push(new u.Range(c,h)),c=h}else{i=!0,o=c+1;let h=u.Node.endOfWhiteSpace(s,o);s[h]===` +`&&m.length===0&&(d=new Se,o=d.parse({src:s},o)),c=u.Node.endOfIndent(s,o)}l=s[c]}if(u.Node.nextNodeIsIndented(l,c-(o+a),this.type!==u.Type.SEQ_ITEM)?this.node=r({atLineStart:i,inCollection:!1,indent:a,lineStart:o,parent:this},c):l&&o>n+1&&(c=o-1),this.node){if(d){let h=e.parent.items||e.parent.contents;h&&h.push(d)}m.length&&Array.prototype.push.apply(this.props,m),c=this.node.range.end}else if(f){let h=m[0];this.props.push(h),c=h.end}else c=u.Node.endOfLine(s,n+1);let y=this.node?this.node.valueRange.end:c;return this.valueRange=new u.Range(n,y),c}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.node?this.node.setOrigRanges(e,n):n}toString(){let{context:{src:e},node:n,range:r,value:s}=this;if(s!=null)return s;let i=n?e.slice(r.start,n.range.start)+String(n):e.slice(r.start,r.end);return u.Node.addStringTerminator(e,r.end,i)}},Ee=class extends u.Node{constructor(){super(u.Type.COMMENT)}parse(e,n){this.context=e;let r=this.parseComment(n);return this.range=new u.Range(n,r),r}};function In(t){let e=t;for(;e instanceof ut;)e=e.node;if(!(e instanceof $t))return null;let n=e.items.length,r=-1;for(let o=n-1;o>=0;--o){let a=e.items[o];if(a.type===u.Type.COMMENT){let{indent:c,lineStart:l}=a.context;if(c>0&&a.range.start>=l+c)break;r=o}else if(a.type===u.Type.BLANK_LINE)r=o;else break}if(r===-1)return null;let s=e.items.splice(r,n-r),i=s[0].range.start;for(;e.range.end=i,e.valueRange&&e.valueRange.end>i&&(e.valueRange.end=i),e!==t;)e=e.context.parent;return s}var $t=class t extends u.Node{static nextContentHasIndent(e,n,r){let s=u.Node.endOfLine(e,n)+1;n=u.Node.endOfWhiteSpace(e,s);let i=e[n];return i?n>=s+r?!0:i!=="#"&&i!==` +`?!1:t.nextContentHasIndent(e,n,r):!1}constructor(e){super(e.type===u.Type.SEQ_ITEM?u.Type.SEQ:u.Type.MAP);for(let r=e.props.length-1;r>=0;--r)if(e.props[r].start0}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,i=u.Node.startOfLine(s,n),o=this.items[0];o.context.parent=this,this.valueRange=u.Range.copy(o.valueRange);let a=o.range.start-o.context.lineStart,c=n;c=u.Node.normalizeOffset(s,c);let l=s[c],f=u.Node.endOfWhiteSpace(s,i)===c,m=!1;for(;l;){for(;l===` +`||l==="#";){if(f&&l===` +`&&!m){let h=new Se;if(c=h.parse({src:s},c),this.valueRange.end=c,c>=s.length){l=null;break}this.items.push(h),c-=1}else if(l==="#"){if(c=s.length){l=null;break}}if(i=c+1,c=u.Node.endOfIndent(s,i),u.Node.atBlank(s,c)){let h=u.Node.endOfWhiteSpace(s,c),g=s[h];(!g||g===` +`||g==="#")&&(c=h)}l=s[c],f=!0}if(!l)break;if(c!==i+a&&(f||l!==":")){if(cn&&(c=i);break}else if(!this.error){let h="All collection items must start at the same column";this.error=new u.YAMLSyntaxError(this,h)}}if(o.type===u.Type.SEQ_ITEM){if(l!=="-"){i>n&&(c=i);break}}else if(l==="-"&&!this.error){let h=s[c+1];if(!h||h===` +`||h===" "||h===" "){let g="A collection cannot be both a mapping and a sequence";this.error=new u.YAMLSyntaxError(this,g)}}let d=r({atLineStart:f,inCollection:!0,indent:a,lineStart:i,parent:this},c);if(!d)return c;if(this.items.push(d),this.valueRange.end=d.valueRange.end,c=u.Node.normalizeOffset(s,d.range.end),l=s[c],f=!1,m=d.includesTrailingLines,l){let h=c-1,g=s[h];for(;g===" "||g===" ";)g=s[--h];g===` +`&&(i=h+1,f=!0)}let y=In(d);y&&Array.prototype.push.apply(this.items,y)}return c}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.items.forEach(r=>{n=r.setOrigRanges(e,n)}),n}toString(){let{context:{src:e},items:n,range:r,value:s}=this;if(s!=null)return s;let i=e.slice(r.start,n[0].range.start)+String(n[0]);for(let o=1;o0&&(this.contents=this.directives,this.directives=[]),i}return n[i]?(this.directivesEndMarker=new u.Range(i,i+3),i+3):(s?this.error=new u.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),i)}parseContents(e){let{parseNode:n,src:r}=this.context;this.contents||(this.contents=[]);let s=e;for(;r[s-1]==="-";)s-=1;let i=u.Node.endOfWhiteSpace(r,e),o=s===e;for(this.valueRange=new u.Range(i);!u.Node.atDocumentBoundary(r,i,u.Char.DOCUMENT_END);){switch(r[i]){case` +`:if(o){let a=new Se;i=a.parse({src:r},i),i{n=r.setOrigRanges(e,n)}),this.directivesEndMarker&&(n=this.directivesEndMarker.setOrigRange(e,n)),this.contents.forEach(r=>{n=r.setOrigRanges(e,n)}),this.documentEndMarker&&(n=this.documentEndMarker.setOrigRange(e,n)),n}toString(){let{contents:e,directives:n,value:r}=this;if(r!=null)return r;let s=n.join("");return e.length>0&&((n.length>0||e[0].type===u.Type.COMMENT)&&(s+=`--- +`),s+=e.join("")),s[s.length-1]!==` +`&&(s+=` +`),s}},xn=class extends u.Node{parse(e,n){this.context=e;let{src:r}=e,s=u.Node.endOfIdentifier(r,n+1);return this.valueRange=new u.Range(n+1,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}},fe={CLIP:"CLIP",KEEP:"KEEP",STRIP:"STRIP"},Rn=class extends u.Node{constructor(e,n){super(e,n),this.blockIndent=null,this.chomping=fe.CLIP,this.header=null}get includesTrailingLines(){return this.chomping===fe.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{indent:r,src:s}=this.context;if(this.valueRange.isEmpty())return"";let i=null,o=s[n-1];for(;o===` +`||o===" "||o===" ";){if(n-=1,n<=e){if(this.chomping===fe.KEEP)break;return""}o===` +`&&(i=n),o=s[n-1]}let a=n+1;i&&(this.chomping===fe.KEEP?(a=i,n=this.valueRange.end):n=i);let c=r+this.blockIndent,l=this.type===u.Type.BLOCK_FOLDED,f=!0,m="",d="",y=!1;for(let h=e;ha&&(a=m);r[l]===` +`?i=l:i=o=u.Node.endOfLine(r,l)}return this.chomping!==fe.KEEP&&(i=r[o]?o+1:o),this.valueRange=new u.Range(e+1,i),i}parse(e,n){this.context=e;let{src:r}=e,s=this.parseBlockHeader(n);return s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s=this.parseBlockValue(s),s}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.header?this.header.setOrigRange(e,n):n}},Dn=class extends u.Node{constructor(e,n){super(e,n),this.items=null}prevNodeIsJsonLike(e=this.items.length){let n=this.items[e-1];return!!n&&(n.jsonLike||n.type===u.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,{indent:i,lineStart:o}=e,a=s[n];this.items=[{char:a,offset:n}];let c=u.Node.endOfWhiteSpace(s,n+1);for(a=s[c];a&&a!=="]"&&a!=="}";){switch(a){case` +`:{o=c+1;let l=u.Node.endOfWhiteSpace(s,o);if(s[l]===` +`){let f=new Se;o=f.parse({src:s},o),this.items.push(f)}if(c=u.Node.endOfIndent(s,o),c<=o+i&&(a=s[c],c{if(r instanceof u.Node)n=r.setOrigRanges(e,n);else if(e.length===0)r.origOffset=r.offset;else{let s=n;for(;sr.offset);)++s;r.origOffset=r.offset+s,n=s}}),n}toString(){let{context:{src:e},items:n,range:r,value:s}=this;if(s!=null)return s;let i=n.filter(c=>c instanceof u.Node),o="",a=r.start;return i.forEach(c=>{let l=e.slice(a,c.range.start);a=c.range.end,o+=l+String(c),o[o.length-1]===` +`&&e[a-1]!==` +`&&e[a]===` +`&&(a+=1)}),o+=e.slice(a,r.end),u.Node.addStringTerminator(e,r.end,o)}},Yn=class t extends u.Node{static endOfQuote(e,n){let r=e[n];for(;r&&r!=='"';)n+=r==="\\"?2:1,r=e[n];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:s,src:i}=this.context;i[r-1]!=='"'&&e.push(new u.YAMLSyntaxError(this,'Missing closing "quote'));let o="";for(let a=n+1;al?i.slice(l,a+1):c)}else o+=c}return e.length>0?{errors:e,str:o}:o}parseCharCode(e,n,r){let{src:s}=this.context,i=s.substr(e,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;return isNaN(a)?(r.push(new u.YAMLSyntaxError(this,`Invalid escape sequence ${s.substr(e-2,n+2)}`)),s.substr(e-2,n+2)):String.fromCodePoint(a)}parse(e,n){this.context=e;let{src:r}=e,s=t.endOfQuote(r,n+1);return this.valueRange=new u.Range(n,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}},$n=class t extends u.Node{static endOfQuote(e,n){let r=e[n];for(;r;)if(r==="'"){if(e[n+1]!=="'")break;r=e[n+=2]}else r=e[n+=1];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:s,src:i}=this.context;i[r-1]!=="'"&&e.push(new u.YAMLSyntaxError(this,"Missing closing 'quote"));let o="";for(let a=n+1;al?i.slice(l,a+1):c)}else o+=c}return e.length>0?{errors:e,str:o}:o}parse(e,n){this.context=e;let{src:r}=e,s=t.endOfQuote(r,n+1);return this.valueRange=new u.Range(n,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}};function vo(t,e){switch(t){case u.Type.ALIAS:return new xn(t,e);case u.Type.BLOCK_FOLDED:case u.Type.BLOCK_LITERAL:return new Rn(t,e);case u.Type.FLOW_MAP:case u.Type.FLOW_SEQ:return new Dn(t,e);case u.Type.MAP_KEY:case u.Type.MAP_VALUE:case u.Type.SEQ_ITEM:return new ut(t,e);case u.Type.COMMENT:case u.Type.PLAIN:return new u.PlainValue(t,e);case u.Type.QUOTE_DOUBLE:return new Yn(t,e);case u.Type.QUOTE_SINGLE:return new $n(t,e);default:return null}}var Bn=class t{static parseType(e,n,r){switch(e[n]){case"*":return u.Type.ALIAS;case">":return u.Type.BLOCK_FOLDED;case"|":return u.Type.BLOCK_LITERAL;case"{":return u.Type.FLOW_MAP;case"[":return u.Type.FLOW_SEQ;case"?":return!r&&u.Node.atBlank(e,n+1,!0)?u.Type.MAP_KEY:u.Type.PLAIN;case":":return!r&&u.Node.atBlank(e,n+1,!0)?u.Type.MAP_VALUE:u.Type.PLAIN;case"-":return!r&&u.Node.atBlank(e,n+1,!0)?u.Type.SEQ_ITEM:u.Type.PLAIN;case'"':return u.Type.QUOTE_DOUBLE;case"'":return u.Type.QUOTE_SINGLE;default:return u.Type.PLAIN}}constructor(e={},{atLineStart:n,inCollection:r,inFlow:s,indent:i,lineStart:o,parent:a}={}){u._defineProperty(this,"parseNode",(c,l)=>{if(u.Node.atDocumentBoundary(this.src,l))return null;let f=new t(this,c),{props:m,type:d,valueStart:y}=f.parseProps(l),h=vo(d,m),g=h.parse(f,y);if(h.range=new u.Range(l,g),g<=l&&(h.error=new Error("Node#parse consumed no characters"),h.error.parseEnd=g,h.error.source=h,h.range.end=l+1),f.nodeStartsCollection(h)){!h.error&&!f.atLineStart&&f.parent.type===u.Type.DOCUMENT&&(h.error=new u.YAMLSyntaxError(h,"Block collection must not have preceding content here (e.g. directives-end indicator)"));let w=new $t(h);return g=w.parse(new t(f),g),w.range=new u.Range(l,g),w}return h}),this.atLineStart=n??(e.atLineStart||!1),this.inCollection=r??(e.inCollection||!1),this.inFlow=s??(e.inFlow||!1),this.indent=i??e.indent,this.lineStart=o??e.lineStart,this.parent=a??(e.parent||{}),this.root=e.root,this.src=e.src}nodeStartsCollection(e){let{inCollection:n,inFlow:r,src:s}=this;if(n||r)return!1;if(e instanceof ut)return!0;let i=e.range.end;return s[i]===` +`||s[i-1]===` +`?!1:(i=u.Node.endOfWhiteSpace(s,i),s[i]===":")}parseProps(e){let{inFlow:n,parent:r,src:s}=this,i=[],o=!1;e=this.atLineStart?u.Node.endOfIndent(s,e):u.Node.endOfWhiteSpace(s,e);let a=s[e];for(;a===u.Char.ANCHOR||a===u.Char.COMMENT||a===u.Char.TAG||a===` +`;){if(a===` +`){let l=e,f;do f=l+1,l=u.Node.endOfIndent(s,f);while(s[l]===` +`);let m=l-(f+this.indent),d=r.type===u.Type.SEQ_ITEM&&r.context.atLineStart;if(s[l]!=="#"&&!u.Node.nextNodeIsIndented(s[l],m,!d))break;this.atLineStart=!0,this.lineStart=f,o=!1,e=l}else if(a===u.Char.COMMENT){let l=u.Node.endOfLine(s,e+1);i.push(new u.Range(e,l)),e=l}else{let l=u.Node.endOfIdentifier(s,e+1);a===u.Char.TAG&&s[l]===","&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(s.slice(e+1,l+13))&&(l=u.Node.endOfIdentifier(s,l+5)),i.push(new u.Range(e,l)),o=!0,e=u.Node.endOfWhiteSpace(s,l)}a=s[e]}o&&a===":"&&u.Node.atBlank(s,e+1,!0)&&(e-=1);let c=t.parseType(s,e,n);return{props:i,type:c,valueStart:e}}};function Io(t){let e=[];t.indexOf("\r")!==-1&&(t=t.replace(/\r\n?/g,(s,i)=>(s.length>1&&e.push(i),` +`)));let n=[],r=0;do{let s=new _n,i=new Bn({src:t});r=s.parse(i,r),n.push(s)}while(r{if(e.length===0)return!1;for(let i=1;in.join(`... +`),n}xs.parse=Io});var qe=te(k=>{"use strict";var p=le();function Po(t,e,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${e}#`)} +${e}${t}`:t}function Fe(t,e,n){return n?n.indexOf(` +`)===-1?`${t} #${n}`:`${t} +`+n.replace(/^/gm,`${e||""}#`):t}var W=class{};function ue(t,e,n){if(Array.isArray(t))return t.map((r,s)=>ue(r,String(s),n));if(t&&typeof t.toJSON=="function"){let r=n&&n.anchors&&n.anchors.get(t);r&&(n.onCreate=i=>{r.res=i,delete n.onCreate});let s=t.toJSON(e,n);return r&&n.onCreate&&n.onCreate(s),s}return(!n||!n.keep)&&typeof t=="bigint"?Number(t):t}var P=class extends W{constructor(e){super(),this.value=e}toJSON(e,n){return n&&n.keep?this.value:ue(this.value,e,n)}toString(){return String(this.value)}};function Ds(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){let i=e[s];if(Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else{let o={};Object.defineProperty(o,i,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=o}}return t.createNode(r,!1)}var Bs=t=>t==null||typeof t=="object"&&t[Symbol.iterator]().next().done,j=class t extends W{constructor(e){super(),p._defineProperty(this,"items",[]),this.schema=e}addIn(e,n){if(Bs(e))this.add(n);else{let[r,...s]=e,i=this.get(r,!0);if(i instanceof t)i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ds(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn([e,...n]){if(n.length===0)return this.delete(e);let r=this.get(e,!0);if(r instanceof t)return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn([e,...n],r){let s=this.get(e,!0);return n.length===0?!r&&s instanceof P?s.value:s:s instanceof t?s.getIn(n,r):void 0}hasAllNullValues(){return this.items.every(e=>{if(!e||e.type!=="PAIR")return!1;let n=e.value;return n==null||n instanceof P&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn([e,...n]){if(n.length===0)return this.has(e);let r=this.get(e,!0);return r instanceof t?r.hasIn(n):!1}setIn([e,...n],r){if(n.length===0)this.set(e,r);else{let s=this.get(e,!0);if(s instanceof t)s.setIn(n,r);else if(s===void 0&&this.schema)this.set(e,Ds(this.schema,n,r));else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}}toJSON(){return null}toString(e,{blockItem:n,flowChars:r,isMap:s,itemIndent:i},o,a){let{indent:c,indentStep:l,stringify:f}=e,m=this.type===p.Type.FLOW_MAP||this.type===p.Type.FLOW_SEQ||e.inFlow;m&&(i+=l);let d=s&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:d,indent:i,inFlow:m,type:null});let y=!1,h=!1,g=this.items.reduce((C,L,M)=>{let A;L&&(!y&&L.spaceBefore&&C.push({type:"comment",str:""}),L.commentBefore&&L.commentBefore.match(/^.*$/gm).forEach(Ai=>{C.push({type:"comment",str:`#${Ai}`})}),L.comment&&(A=L.comment),m&&(!y&&L.spaceBefore||L.commentBefore||L.comment||L.key&&(L.key.commentBefore||L.key.comment)||L.value&&(L.value.commentBefore||L.value.comment))&&(h=!0)),y=!1;let _=f(L,e,()=>A=null,()=>y=!0);return m&&!h&&_.includes(` +`)&&(h=!0),m&&MA.str);if(h||M.reduce((A,_)=>A+_.length+2,2)>t.maxFlowStringSingleLineLength){w=C;for(let A of M)w+=A?` +${l}${c}${A}`:` +`;w+=` +${c}${L}`}else w=`${C} ${M.join(" ")} ${L}`}else{let C=g.map(n);w=C.shift();for(let L of C)w+=L?` +${c}${L}`:` +`}return this.comment?(w+=` +`+this.comment.replace(/^/gm,`${c}#`),o&&o()):y&&a&&a(),w}};p._defineProperty(j,"maxFlowStringSingleLineLength",60);function Bt(t){let e=t instanceof P?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var pe=class extends j{add(e){this.items.push(e)}delete(e){let n=Bt(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Bt(e);if(typeof r!="number")return;let s=this.items[r];return!n&&s instanceof P?s.value:s}has(e){let n=Bt(e);return typeof n=="number"&&ns.type==="comment"?s.str:`- ${s.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},n,r):JSON.stringify(this)}},_o=(t,e,n)=>e===null?"":typeof e!="object"?String(e):t instanceof W&&n&&n.doc?t.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(e),T=class t extends W{constructor(e,n=null){super(),this.key=e,this.value=n,this.type=t.Type.PAIR}get commentBefore(){return this.key instanceof W?this.key.commentBefore:void 0}set commentBefore(e){if(this.key==null&&(this.key=new P(null)),this.key instanceof W)this.key.commentBefore=e;else{let n="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(n)}}addToJSMap(e,n){let r=ue(this.key,"",e);if(n instanceof Map){let s=ue(this.value,r,e);n.set(r,s)}else if(n instanceof Set)n.add(r);else{let s=_o(this.key,r,e),i=ue(this.value,s,e);s in n?Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0}):n[s]=i}return n}toJSON(e,n){let r=n&&n.mapAsMap?new Map:{};return this.addToJSMap(n,r)}toString(e,n,r){if(!e||!e.doc)return JSON.stringify(this);let{indent:s,indentSeq:i,simpleKeys:o}=e.doc.options,{key:a,value:c}=this,l=a instanceof W&&a.comment;if(o){if(l)throw new Error("With simple keys, key nodes cannot have comments");if(a instanceof j){let _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let f=!o&&(!a||l||(a instanceof W?a instanceof j||a.type===p.Type.BLOCK_FOLDED||a.type===p.Type.BLOCK_LITERAL:typeof a=="object")),{doc:m,indent:d,indentStep:y,stringify:h}=e;e=Object.assign({},e,{implicitKey:!f,indent:d+y});let g=!1,w=h(a,e,()=>l=null,()=>g=!0);if(w=Fe(w,e.indent,l),!f&&w.length>1024){if(o)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(e.allNullValues&&!o)return this.comment?(w=Fe(w,e.indent,this.comment),n&&n()):g&&!l&&r&&r(),e.inFlow&&!f?w:`? ${w}`;w=f?`? ${w} +${d}:`:`${w}:`,this.comment&&(w=Fe(w,e.indent,this.comment),n&&n());let C="",L=null;if(c instanceof W){if(c.spaceBefore&&(C=` +`),c.commentBefore){let _=c.commentBefore.replace(/^/gm,`${e.indent}#`);C+=` +${_}`}L=c.comment}else c&&typeof c=="object"&&(c=m.schema.createNode(c,!0));e.implicitKey=!1,!f&&!this.comment&&c instanceof P&&(e.indentAtStart=w.length+1),g=!1,!i&&s>=2&&!e.inFlow&&!f&&c instanceof pe&&c.type!==p.Type.FLOW_SEQ&&!c.tag&&!m.anchors.getName(c)&&(e.indent=e.indent.substr(2));let M=h(c,e,()=>L=null,()=>g=!0),A=" ";return C||this.comment?A=`${C} +${e.indent}`:!f&&c instanceof j?(!(M[0]==="["||M[0]==="{")||M.includes(` +`))&&(A=` +${e.indent}`):M[0]===` +`&&(A=""),g&&!L&&r&&r(),Fe(w+A+M,e.indent,L)}};p._defineProperty(T,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var Ft=(t,e)=>{if(t instanceof be){let n=e.get(t.source);return n.count*n.aliasCount}else if(t instanceof j){let n=0;for(let r of t.items){let s=Ft(r,e);s>n&&(n=s)}return n}else if(t instanceof T){let n=Ft(t.key,e),r=Ft(t.value,e);return Math.max(n,r)}return 1},be=class t extends W{static stringify({range:e,source:n},{anchors:r,doc:s,implicitKey:i,inStringifyKey:o}){let a=Object.keys(r).find(l=>r[l]===n);if(!a&&o&&(a=s.anchors.getName(n)||s.anchors.newName()),a)return`*${a}${i?" ":""}`;let c=s.anchors.getName(n)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${c} [${e}]`)}constructor(e){super(),this.source=e,this.type=p.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,n){if(!n)return ue(this.source,e,n);let{anchors:r,maxAliasCount:s}=n,i=r.get(this.source);if(!i||i.res===void 0){let o="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new p.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}if(s>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=Ft(this.source,r)),i.count*i.aliasCount>s)){let o="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new p.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}return i.res}toString(e){return t.stringify(this,e)}};p._defineProperty(be,"default",!0);function pt(t,e){let n=e instanceof P?e.value:e;for(let r of t)if(r instanceof T&&(r.key===e||r.key===n||r.key&&r.key.value===n))return r}var mt=class extends j{add(e,n){e?e instanceof T||(e=new T(e.key||e,e.value)):e=new T(e);let r=pt(this.items,e.key),s=this.schema&&this.schema.sortMapEntries;if(r)if(n)r.value=e.value;else throw new Error(`Key ${e.key} already set`);else if(s){let i=this.items.findIndex(o=>s(e,o)<0);i===-1?this.items.push(e):this.items.splice(i,0,e)}else this.items.push(e)}delete(e){let n=pt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=pt(this.items,e),s=r&&r.value;return!n&&s instanceof P?s.value:s}has(e){return!!pt(this.items,e)}set(e,n){this.add(new T(e,n),!0)}toJSON(e,n,r){let s=r?new r:n&&n.mapAsMap?new Map:{};n&&n.onCreate&&n.onCreate(s);for(let i of this.items)i.addToJSMap(n,s);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!(s instanceof T))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return super.toString(e,{blockItem:s=>s.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},n,r)}},Fs="<<",Kt=class extends T{constructor(e){if(e instanceof T){let n=e.value;n instanceof pe||(n=new pe,n.items.push(e.value),n.range=e.value.range),super(e.key,n),this.range=e.range}else super(new P(Fs),new pe);this.type=T.Type.MERGE_PAIR}addToJSMap(e,n){for(let{source:r}of this.value.items){if(!(r instanceof mt))throw new Error("Merge sources must be maps");let s=r.toJSON(null,e,Map);for(let[i,o]of s)n instanceof Map?n.has(i)||n.set(i,o):n instanceof Set?n.add(i):Object.prototype.hasOwnProperty.call(n,i)||Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}return n}toString(e,n){let r=this.value;if(r.items.length>1)return super.toString(e,n);this.value=r.items[0];let s=super.toString(e,n);return this.value=r,s}},xo={defaultType:p.Type.BLOCK_LITERAL,lineWidth:76},Ro={trueStr:"true",falseStr:"false"},Do={asBigInt:!1},Yo={nullStr:"null"},Ne={defaultType:p.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function qn(t,e,n){for(let{format:r,test:s,resolve:i}of e)if(s){let o=t.match(s);if(o){let a=i.apply(null,o);return a instanceof P||(a=new P(a)),r&&(a.format=r),a}}return n&&(t=n(t)),new P(t)}var qs="flow",Fn="block",qt="quoted",Ys=(t,e)=>{let n=t[e+1];for(;n===" "||n===" ";){do n=t[e+=1];while(n&&n!==` +`);n=t[e+1]}return e};function Vt(t,e,n,{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}){if(!s||s<0)return t;let c=Math.max(1+i,1+s-e.length);if(t.length<=c)return t;let l=[],f={},m=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):m=s-r);let d,y,h=!1,g=-1,w=-1,C=-1;n===Fn&&(g=Ys(t,g),g!==-1&&(m=g+c));for(let M;M=t[g+=1];){if(n===qt&&M==="\\"){switch(w=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}C=g}if(M===` +`)n===Fn&&(g=Ys(t,g)),m=g+c,d=void 0;else{if(M===" "&&y&&y!==" "&&y!==` +`&&y!==" "){let A=t[g+1];A&&A!==" "&&A!==` +`&&A!==" "&&(d=g)}if(g>=m)if(d)l.push(d),m=d+c,d=void 0;else if(n===qt){for(;y===" "||y===" ";)y=M,M=t[g+=1],h=!0;let A=g>C+1?g-2:w-1;if(f[A])return t;l.push(A),f[A]=!0,m=A+c,d=void 0}else h=!0}y=M}if(h&&a&&a(),l.length===0)return t;o&&o();let L=t.slice(0,l[0]);for(let M=0;Mt?Object.assign({indentAtStart:t},Ne.fold):Ne.fold,Wt=t=>/^(%|---|\.\.\.)/m.test(t);function $o(t,e,n){if(!e||e<0)return!1;let r=e-n,s=t.length;if(s<=r)return!1;for(let i=0,o=0;ir)return!0;if(o=i+1,s-o<=r)return!1}return!0}function we(t,e){let{implicitKey:n}=e,{jsonEncoding:r,minMultiLineLength:s}=Ne.doubleQuoted,i=JSON.stringify(t);if(r)return i;let o=e.indent||(Wt(t)?" ":""),a="",c=0;for(let l=0,f=i[l];f;f=i[++l])if(f===" "&&i[l+1]==="\\"&&i[l+2]==="n"&&(a+=i.slice(c,l)+"\\ ",l+=1,c=l,f="\\"),f==="\\")switch(i[l+1]){case"u":{a+=i.slice(c,l);let m=i.substr(l+2,4);switch(m){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=i.substr(l,6)}l+=5,c=l+1}break;case"n":if(n||i[l+2]==='"'||i.length";if(!n)return l+` +`;let f="",m="";if(n=n.replace(/[\n\t ]*$/,y=>{let h=y.indexOf(` +`);return h===-1?l+="-":(n===y||h!==y.length-1)&&(l+="+",i&&i()),m=y.replace(/\n$/,""),""}).replace(/^[\n ]*/,y=>{y.indexOf(" ")!==-1&&(l+=a);let h=y.match(/ +$/);return h?(f=y.slice(0,-h[0].length),h[0]):(f=y,"")}),m&&(m=m.replace(/\n+(?!\n|$)/g,`$&${o}`)),f&&(f=f.replace(/\n+/g,`$&${o}`)),t&&(l+=" #"+t.replace(/ ?[\r\n]+/g," "),s&&s()),!n)return`${l}${a} +${o}${m}`;if(c)return n=n.replace(/\n+/g,`$&${o}`),`${l} +${o}${f}${n}${m}`;n=n.replace(/\n+/g,` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${o}`);let d=Vt(`${f}${n}${m}`,o,Fn,Ne.fold);return`${l} +${o}${d}`}function Bo(t,e,n,r){let{comment:s,type:i,value:o}=t,{actualString:a,implicitKey:c,indent:l,inFlow:f}=e;if(c&&/[\n[\]{},]/.test(o)||f&&/[[\]{},]/.test(o))return we(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||f||o.indexOf(` +`)===-1?o.indexOf('"')!==-1&&o.indexOf("'")===-1?Us(o,e):we(o,e):Ut(t,e,n,r);if(!c&&!f&&i!==p.Type.PLAIN&&o.indexOf(` +`)!==-1)return Ut(t,e,n,r);if(l===""&&Wt(o))return e.forceBlockIndent=!0,Ut(t,e,n,r);let m=o.replace(/\n+/g,`$& +${l}`);if(a){let{tags:y}=e.doc.schema;if(typeof qn(m,y,y.scalarFallback).value!="string")return we(o,e)}let d=c?m:Vt(m,l,qs,Un(e));return s&&!f&&(d.indexOf(` +`)!==-1||s.indexOf(` +`)!==-1)?(n&&n(),Po(d,l,s)):d}function Fo(t,e,n,r){let{defaultType:s}=Ne,{implicitKey:i,inFlow:o}=e,{type:a,value:c}=t;typeof c!="string"&&(c=String(c),t=Object.assign({},t,{value:c}));let l=m=>{switch(m){case p.Type.BLOCK_FOLDED:case p.Type.BLOCK_LITERAL:return Ut(t,e,n,r);case p.Type.QUOTE_DOUBLE:return we(c,e);case p.Type.QUOTE_SINGLE:return Us(c,e);case p.Type.PLAIN:return Bo(t,e,n,r);default:return null}};(a!==p.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(c)||(i||o)&&(a===p.Type.BLOCK_FOLDED||a===p.Type.BLOCK_LITERAL))&&(a=p.Type.QUOTE_DOUBLE);let f=l(a);if(f===null&&(f=l(s),f===null))throw new Error(`Unsupported default string type ${s}`);return f}function qo({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let i=s.indexOf(".");i<0&&(i=s.length,s+=".");let o=e-(s.length-i-1);for(;o-- >0;)s+="0"}return s}function Ks(t,e){let n,r;switch(e.type){case p.Type.FLOW_MAP:n="}",r="flow map";break;case p.Type.FLOW_SEQ:n="]",r="flow sequence";break;default:t.push(new p.YAMLSemanticError(e,"Not a flow collection!?"));return}let s;for(let i=e.items.length-1;i>=0;--i){let o=e.items[i];if(!o||o.type!==p.Type.COMMENT){s=o;break}}if(s&&s.char!==n){let i=`Expected ${r} to end with ${n}`,o;typeof s.offset=="number"?(o=new p.YAMLSemanticError(e,i),o.offset=s.offset+1):(o=new p.YAMLSemanticError(s,i),s.range&&s.range.end&&(o.offset=s.range.end-s.range.start)),t.push(o)}}function Vs(t,e){let n=e.context.src[e.range.start-1];if(n!==` +`&&n!==" "&&n!==" "){let r="Comments must be separated from other tokens by white space characters";t.push(new p.YAMLSemanticError(e,r))}}function Ws(t,e){let n=String(e),r=n.substr(0,8)+"..."+n.substr(-8);return new p.YAMLSemanticError(t,`The "${r}" key is too long`)}function js(t,e){for(let{afterKey:n,before:r,comment:s}of e){let i=t.items[r];i?(n&&i.value&&(i=i.value),s===void 0?(n||!i.commentBefore)&&(i.spaceBefore=!0):i.commentBefore?i.commentBefore+=` +`+s:i.commentBefore=s):s!==void 0&&(t.comment?t.comment+=` +`+s:t.comment=s)}}function Kn(t,e){let n=e.strValue;return n?typeof n=="string"?n:(n.errors.forEach(r=>{r.source||(r.source=e),t.errors.push(r)}),n.str):""}function Uo(t,e){let{handle:n,suffix:r}=e.tag,s=t.tagPrefixes.find(i=>i.handle===n);if(!s){let i=t.getDefaults().tagPrefixes;if(i&&(s=i.find(o=>o.handle===n)),!s)throw new p.YAMLSemanticError(e,`The ${n} tag handle is non-default and was not declared.`)}if(!r)throw new p.YAMLSemanticError(e,`The ${n} tag has no suffix.`);if(n==="!"&&(t.version||t.options.version)==="1.0"){if(r[0]==="^")return t.warnings.push(new p.YAMLWarning(e,"YAML 1.0 ^ tag expansion is not supported")),r;if(/[:/]/.test(r)){let i=r.match(/^([a-z0-9-]+)\/(.*)/i);return i?`tag:${i[1]}.yaml.org,2002:${i[2]}`:`tag:${r}`}}return s.prefix+decodeURIComponent(r)}function Ko(t,e){let{tag:n,type:r}=e,s=!1;if(n){let{handle:i,suffix:o,verbatim:a}=n;if(a){if(a!=="!"&&a!=="!!")return a;let c=`Verbatim tags aren't resolved, so ${a} is invalid.`;t.errors.push(new p.YAMLSemanticError(e,c))}else if(i==="!"&&!o)s=!0;else try{return Uo(t,e)}catch(c){t.errors.push(c)}}switch(r){case p.Type.BLOCK_FOLDED:case p.Type.BLOCK_LITERAL:case p.Type.QUOTE_DOUBLE:case p.Type.QUOTE_SINGLE:return p.defaultTags.STR;case p.Type.FLOW_MAP:case p.Type.MAP:return p.defaultTags.MAP;case p.Type.FLOW_SEQ:case p.Type.SEQ:return p.defaultTags.SEQ;case p.Type.PLAIN:return s?p.defaultTags.STR:null;default:return null}}function $s(t,e,n){let{tags:r}=t.schema,s=[];for(let o of r)if(o.tag===n)if(o.test)s.push(o);else{let a=o.resolve(t,e);return a instanceof j?a:new P(a)}let i=Kn(t,e);return typeof i=="string"&&s.length>0?qn(i,s,r.scalarFallback):null}function Vo({type:t}){switch(t){case p.Type.FLOW_MAP:case p.Type.MAP:return p.defaultTags.MAP;case p.Type.FLOW_SEQ:case p.Type.SEQ:return p.defaultTags.SEQ;default:return p.defaultTags.STR}}function Wo(t,e,n){try{let r=$s(t,e,n);if(r)return n&&e.tag&&(r.tag=n),r}catch(r){return r.source||(r.source=e),t.errors.push(r),null}try{let r=Vo(e);if(!r)throw new Error(`The tag ${n} is unavailable`);let s=`The tag ${n} is unavailable, falling back to ${r}`;t.warnings.push(new p.YAMLWarning(e,s));let i=$s(t,e,r);return i.tag=n,i}catch(r){let s=new p.YAMLReferenceError(e,r.message);return s.stack=r.stack,t.errors.push(s),null}}var jo=t=>{if(!t)return!1;let{type:e}=t;return e===p.Type.MAP_KEY||e===p.Type.MAP_VALUE||e===p.Type.SEQ_ITEM};function Qo(t,e){let n={before:[],after:[]},r=!1,s=!1,i=jo(e.context.parent)?e.context.parent.props.concat(e.props):e.props;for(let{start:o,end:a}of i)switch(e.context.src[o]){case p.Char.COMMENT:{if(!e.commentHasRequiredWhitespace(o)){let m="Comments must be separated from other tokens by white space characters";t.push(new p.YAMLSemanticError(e,m))}let{header:c,valueRange:l}=e;(l&&(o>l.start||c&&o>c.start)?n.after:n.before).push(e.context.src.slice(o+1,a));break}case p.Char.ANCHOR:if(r){let c="A node can have at most one anchor";t.push(new p.YAMLSemanticError(e,c))}r=!0;break;case p.Char.TAG:if(s){let c="A node can have at most one tag";t.push(new p.YAMLSemanticError(e,c))}s=!0;break}return{comments:n,hasAnchor:r,hasTag:s}}function Jo(t,e){let{anchors:n,errors:r,schema:s}=t;if(e.type===p.Type.ALIAS){let o=e.rawValue,a=n.getNode(o);if(!a){let l=`Aliased anchor not found: ${o}`;return r.push(new p.YAMLReferenceError(e,l)),null}let c=new be(a);return n._cstAliases.push(c),c}let i=Ko(t,e);if(i)return Wo(t,e,i);if(e.type!==p.Type.PLAIN){let o=`Failed to resolve ${e.type} node here`;return r.push(new p.YAMLSyntaxError(e,o)),null}try{let o=Kn(t,e);return qn(o,s.tags,s.tags.scalarFallback)}catch(o){return o.source||(o.source=e),r.push(o),null}}function me(t,e){if(!e)return null;e.error&&t.errors.push(e.error);let{comments:n,hasAnchor:r,hasTag:s}=Qo(t.errors,e);if(r){let{anchors:o}=t,a=e.anchor,c=o.getNode(a);c&&(o.map[o.newName(a)]=c),o.map[a]=e}if(e.type===p.Type.ALIAS&&(r||s)){let o="An alias node must not specify any properties";t.errors.push(new p.YAMLSemanticError(e,o))}let i=Jo(t,e);if(i){i.range=[e.range.start,e.range.end],t.options.keepCstNodes&&(i.cstNode=e),t.options.keepNodeTypes&&(i.type=e.type);let o=n.before.join(` +`);o&&(i.commentBefore=i.commentBefore?`${i.commentBefore} +${o}`:o);let a=n.after.join(` +`);a&&(i.comment=i.comment?`${i.comment} +${a}`:a)}return e.resolved=i}function Go(t,e){if(e.type!==p.Type.MAP&&e.type!==p.Type.FLOW_MAP){let o=`A ${e.type} node cannot be resolved as a mapping`;return t.errors.push(new p.YAMLSyntaxError(e,o)),null}let{comments:n,items:r}=e.type===p.Type.FLOW_MAP?Zo(t,e):zo(t,e),s=new mt;s.items=r,js(s,n);let i=!1;for(let o=0;o{if(f instanceof be){let{type:m}=f.source;return m===p.Type.MAP||m===p.Type.FLOW_MAP?!1:l="Merge nodes aliases can only point to maps"}return l="Merge nodes can only have Alias nodes as values"}),l&&t.errors.push(new p.YAMLSemanticError(e,l))}else for(let c=o+1;c{if(r.length===0)return!1;let{start:s}=r[0];if(e&&s>e.valueRange.start||n[s]!==p.Char.COMMENT)return!1;for(let i=t;i0){c=new p.PlainValue(p.Type.PLAIN,[]),c.context={parent:a,src:a.context.src};let f=a.range.start+1;if(c.range={start:f,end:f},c.valueRange={start:f,end:f},typeof a.range.origStart=="number"){let m=a.range.origStart+1;c.range.origStart=c.range.origEnd=m,c.valueRange.origStart=c.valueRange.origEnd=m}}let l=new T(s,me(t,c));Xo(a,l),r.push(l),s&&typeof i=="number"&&a.range.start>i+1024&&t.errors.push(Ws(e,s)),s=void 0,i=null}break;default:s!==void 0&&r.push(new T(s)),s=me(t,a),i=a.range.start,a.error&&t.errors.push(a.error);e:for(let c=o+1;;++c){let l=e.items[c];switch(l&&l.type){case p.Type.BLANK_LINE:case p.Type.COMMENT:continue e;case p.Type.MAP_VALUE:break e;default:{let f="Implicit map keys need to be followed by map values";t.errors.push(new p.YAMLSemanticError(a,f));break e}}}if(a.valueRangeContainsNewline){let c="Implicit map keys need to be on a single line";t.errors.push(new p.YAMLSemanticError(a,c))}}}return s!==void 0&&r.push(new T(s)),{comments:n,items:r}}function Zo(t,e){let n=[],r=[],s,i=!1,o="{";for(let a=0;ai instanceof T&&i.key instanceof j)){let i="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new p.YAMLWarning(e,i))}return e.resolved=s,s}function ta(t,e){let n=[],r=[];for(let s=0;so+1024&&t.errors.push(Ws(e,i));let{src:h}=c.context;for(let g=o;g{"use strict";var Q=le(),O=qe(),ra={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(t,e)=>{let n=O.resolveString(t,e);if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let r=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(r.length);for(let i=0;i{let o;if(typeof Buffer=="function")o=n instanceof Buffer?n.toString("base64"):Buffer.from(n.buffer).toString("base64");else if(typeof btoa=="function"){let a="";for(let c=0;c1){let o="Each pair must have its own sequence indicator";throw new Q.YAMLSemanticError(e,o)}let i=s.items[0]||new O.Pair;s.commentBefore&&(i.commentBefore=i.commentBefore?`${s.commentBefore} +${i.commentBefore}`:s.commentBefore),s.comment&&(i.comment=i.comment?`${s.comment} +${i.comment}`:s.comment),s=i}n.items[r]=s instanceof O.Pair?s:new O.Pair(s)}}return n}function Gs(t,e,n){let r=new O.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";for(let s of e){let i,o;if(Array.isArray(s))if(s.length===2)i=s[0],o=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)i=c[0],o=s[i];else throw new TypeError(`Expected { key: value } tuple: ${s}`)}else i=s;let a=t.createPair(i,o,n);r.items.push(a)}return r}var sa={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Js,createNode:Gs},Ue=class t extends O.YAMLSeq{constructor(){super(),Q._defineProperty(this,"add",O.YAMLMap.prototype.add.bind(this)),Q._defineProperty(this,"delete",O.YAMLMap.prototype.delete.bind(this)),Q._defineProperty(this,"get",O.YAMLMap.prototype.get.bind(this)),Q._defineProperty(this,"has",O.YAMLMap.prototype.has.bind(this)),Q._defineProperty(this,"set",O.YAMLMap.prototype.set.bind(this)),this.tag=t.tag}toJSON(e,n){let r=new Map;n&&n.onCreate&&n.onCreate(r);for(let s of this.items){let i,o;if(s instanceof O.Pair?(i=O.toJSON(s.key,"",n),o=O.toJSON(s.value,i,n)):i=O.toJSON(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}};Q._defineProperty(Ue,"tag","tag:yaml.org,2002:omap");function ia(t,e){let n=Js(t,e),r=[];for(let{key:s}of n.items)if(s instanceof O.Scalar)if(r.includes(s.value)){let i="Ordered maps must not include duplicate keys";throw new Q.YAMLSemanticError(e,i)}else r.push(s.value);return Object.assign(new Ue,n)}function oa(t,e,n){let r=Gs(t,e,n),s=new Ue;return s.items=r.items,s}var aa={identify:t=>t instanceof Map,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:omap",resolve:ia,createNode:oa},Ke=class t extends O.YAMLMap{constructor(){super(),this.tag=t.tag}add(e){let n=e instanceof O.Pair?e:new O.Pair(e);O.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=O.findPair(this.items,e);return!n&&r instanceof O.Pair?r.key instanceof O.Scalar?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=O.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new O.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,n,r);throw new Error("Set items must all have null values")}};Q._defineProperty(Ke,"tag","tag:yaml.org,2002:set");function ca(t,e){let n=O.resolveMap(t,e);if(!n.hasAllNullValues())throw new Q.YAMLSemanticError(e,"Set items must all have null values");return Object.assign(new Ke,n)}function la(t,e,n){let r=new Ke;for(let s of e)r.items.push(t.createPair(s,null,n));return r}var fa={identify:t=>t instanceof Set,nodeClass:Ke,default:!1,tag:"tag:yaml.org,2002:set",resolve:ca,createNode:la},Vn=(t,e)=>{let n=e.split(":").reduce((r,s)=>r*60+Number(s),0);return t==="-"?-n:n},Hs=({value:t})=>{if(isNaN(t)||!isFinite(t))return O.stringifyNumber(t);let e="";t<0&&(e="-",t=Math.abs(t));let n=[t%60];return t<60?n.unshift(0):(t=Math.round((t-n[0])/60),n.unshift(t%60),t>=60&&(t=Math.round((t-n[0])/60),n.unshift(t))),e+n.map(r=>r<10?"0"+String(r):String(r)).join(":").replace(/000000\d*$/,"")},ua={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(t,e,n)=>Vn(e,n.replace(/_/g,"")),stringify:Hs},pa={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(t,e,n)=>Vn(e,n.replace(/_/g,"")),stringify:Hs},ma={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(t,e,n,r,s,i,o,a,c)=>{a&&(a=(a+"00").substr(1,3));let l=Date.UTC(e,n-1,r,s||0,i||0,o||0,a||0);if(c&&c!=="Z"){let f=Vn(c[0],c.slice(1));Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function Wn(t){let e={};return t?typeof YAML_SILENCE_DEPRECATION_WARNINGS<"u"?!YAML_SILENCE_DEPRECATION_WARNINGS:!e.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS<"u"?!YAML_SILENCE_WARNINGS:!e.YAML_SILENCE_WARNINGS}function jn(t,e){Wn(!1)&&console.warn(e?`${e}: ${t}`:t)}function ha(t){if(Wn(!0)){let e=t.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");jn(`The endpoint 'yaml/${e}' will be removed in a future release.`,"DeprecationWarning")}}var Qs={};function ga(t,e){if(!Qs[t]&&Wn(!0)){Qs[t]=!0;let n=`The option '${t}' will be removed in a future release`;n+=e?`, use '${e}' instead.`:".",jn(n,"DeprecationWarning")}}z.binary=ra;z.floatTime=pa;z.intTime=ua;z.omap=aa;z.pairs=sa;z.set=fa;z.timestamp=ma;z.warn=jn;z.warnFileDeprecation=ha;z.warnOptionDeprecation=ga});var Xn=te(li=>{"use strict";var Jt=le(),E=qe(),D=Qn();function da(t,e,n){let r=new E.YAMLMap(t);if(e instanceof Map)for(let[s,i]of e)r.items.push(t.createPair(s,i,n));else if(e&&typeof e=="object")for(let s of Object.keys(e))r.items.push(t.createPair(s,e[s],n));return typeof t.sortMapEntries=="function"&&r.items.sort(t.sortMapEntries),r}var gt={createNode:da,default:!0,nodeClass:E.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:E.resolveMap};function ya(t,e,n){let r=new E.YAMLSeq(t);if(e&&e[Symbol.iterator])for(let s of e){let i=t.createNode(s,n.wrapScalars,null,n);r.items.push(i)}return r}var Gt={createNode:ya,default:!0,nodeClass:E.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:E.resolveSeq},Ea={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:E.resolveString,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),E.stringifyString(t,e,n,r)},options:E.strOptions},Gn=[gt,Gt,Ea],Ht=t=>typeof t=="bigint"||Number.isInteger(t),Hn=(t,e,n)=>E.intOptions.asBigInt?BigInt(t):parseInt(e,n);function Zs(t,e,n){let{value:r}=t;return Ht(r)&&r>=0?n+r.toString(e):E.stringifyNumber(t)}var ei={identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:E.nullOptions,stringify:()=>E.nullOptions.nullStr},ti={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>t[0]==="t"||t[0]==="T",options:E.boolOptions,stringify:({value:t})=>t?E.boolOptions.trueStr:E.boolOptions.falseStr},ni={identify:t=>Ht(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(t,e)=>Hn(t,e,8),options:E.intOptions,stringify:t=>Zs(t,8,"0o")},ri={identify:Ht,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:t=>Hn(t,t,10),options:E.intOptions,stringify:E.stringifyNumber},si={identify:t=>Ht(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(t,e)=>Hn(t,e,16),options:E.intOptions,stringify:t=>Zs(t,16,"0x")},ii={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:E.stringifyNumber},oi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify:({value:t})=>Number(t).toExponential()},ai={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(t,e,n){let r=e||n,s=new E.Scalar(parseFloat(t));return r&&r[r.length-1]==="0"&&(s.minFractionDigits=r.length),s},stringify:E.stringifyNumber},Sa=Gn.concat([ei,ti,ni,ri,si,ii,oi,ai]),Xs=t=>typeof t=="bigint"||Number.isInteger(t),jt=({value:t})=>JSON.stringify(t),ci=[gt,Gt,{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:E.resolveString,stringify:jt},{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:jt},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:jt},{identify:Xs,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:t=>E.intOptions.asBigInt?BigInt(t):parseInt(t,10),stringify:({value:t})=>Xs(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:jt}];ci.scalarFallback=t=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`)};var zs=({value:t})=>t?E.boolOptions.trueStr:E.boolOptions.falseStr,ht=t=>typeof t=="bigint"||Number.isInteger(t);function Qt(t,e,n){let r=e.replace(/_/g,"");if(E.intOptions.asBigInt){switch(n){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let i=BigInt(r);return t==="-"?BigInt(-1)*i:i}let s=parseInt(r,n);return t==="-"?-1*s:s}function Jn(t,e,n){let{value:r}=t;if(ht(r)){let s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return E.stringifyNumber(t)}var wa=Gn.concat([{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:E.nullOptions,stringify:()=>E.nullOptions.nullStr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:E.boolOptions,stringify:zs},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:E.boolOptions,stringify:zs},{identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(t,e,n)=>Qt(e,n,2),stringify:t=>Jn(t,2,"0b")},{identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(t,e,n)=>Qt(e,n,8),stringify:t=>Jn(t,8,"0")},{identify:ht,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(t,e,n)=>Qt(e,n,10),stringify:E.stringifyNumber},{identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(t,e,n)=>Qt(e,n,16),stringify:t=>Jn(t,16,"0x")},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:E.stringifyNumber},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify:({value:t})=>Number(t).toExponential()},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(t,e){let n=new E.Scalar(parseFloat(t.replace(/_/g,"")));if(e){let r=e.replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:E.stringifyNumber}],D.binary,D.omap,D.pairs,D.set,D.intTime,D.floatTime,D.timestamp),ba={core:Sa,failsafe:Gn,json:ci,yaml11:wa},Na={binary:D.binary,bool:ti,float:ai,floatExp:oi,floatNaN:ii,floatTime:D.floatTime,int:ri,intHex:si,intOct:ni,intTime:D.intTime,map:gt,null:ei,omap:D.omap,pairs:D.pairs,seq:Gt,set:D.set,timestamp:D.timestamp};function Oa(t,e,n){if(e){let r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)||r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>(r.identify&&r.identify(t)||r.class&&t instanceof r.class)&&!r.format)}function La(t,e,n){if(t instanceof E.Node)return t;let{defaultPrefix:r,onTagObj:s,prevObjects:i,schema:o,wrapScalars:a}=n;e&&e.startsWith("!!")&&(e=r+e.slice(2));let c=Oa(t,e,o.tags);if(!c){if(typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object")return a?new E.Scalar(t):t;c=t instanceof Map?gt:t[Symbol.iterator]?Gt:gt}s&&(s(c),delete n.onTagObj);let l={value:void 0,node:void 0};if(t&&typeof t=="object"&&i){let f=i.get(t);if(f){let m=new E.Alias(f);return n.aliasNodes.push(m),m}l.value=t,i.set(t,l)}return l.node=c.createNode?c.createNode(n.schema,t,n):a?new E.Scalar(t):t,e&&l.node instanceof E.Node&&(l.node.tag=e),l.node}function Aa(t,e,n,r){let s=t[r.replace(/\W/g,"")];if(!s){let i=Object.keys(t).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${i}`)}if(Array.isArray(n))for(let i of n)s=s.concat(i);else typeof n=="function"&&(s=n(s.slice()));for(let i=0;iJSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag "${o}"; use one of ${c}`)}s[i]=a}}return s}var Ta=(t,e)=>t.keye.key?1:0,dt=class t{constructor({customTags:e,merge:n,schema:r,sortMapEntries:s,tags:i}){this.merge=!!n,this.name=r,this.sortMapEntries=s===!0?Ta:s||null,!e&&i&&D.warnOptionDeprecation("tags","customTags"),this.tags=Aa(ba,Na,e||i,r)}createNode(e,n,r,s){let i={defaultPrefix:t.defaultPrefix,schema:this,wrapScalars:n},o=s?Object.assign(s,i):i;return La(e,r,o)}createPair(e,n,r){r||(r={wrapScalars:!0});let s=this.createNode(e,r.wrapScalars,null,r),i=this.createNode(n,r.wrapScalars,null,r);return new E.Pair(s,i)}};Jt._defineProperty(dt,"defaultPrefix",Jt.defaultTagPrefix);Jt._defineProperty(dt,"defaultTags",Jt.defaultTags);li.Schema=dt});var mi=te(en=>{"use strict";var Y=le(),S=qe(),fi=Xn(),Ca={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},Ma={get binary(){return S.binaryOptions},set binary(t){Object.assign(S.binaryOptions,t)},get bool(){return S.boolOptions},set bool(t){Object.assign(S.boolOptions,t)},get int(){return S.intOptions},set int(t){Object.assign(S.intOptions,t)},get null(){return S.nullOptions},set null(t){Object.assign(S.nullOptions,t)},get str(){return S.strOptions},set str(t){Object.assign(S.strOptions,t)}},pi={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:Y.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Y.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Y.defaultTagPrefix}]}};function ui(t,e){if((t.version||t.options.version)==="1.0"){let s=e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(s)return"!"+s[1];let i=e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return i?`!${i[1]}/${i[2]}`:`!${e.replace(/^tag:/,"")}`}let n=t.tagPrefixes.find(s=>e.indexOf(s.prefix)===0);if(!n){let s=t.getDefaults().tagPrefixes;n=s&&s.find(i=>e.indexOf(i.prefix)===0)}if(!n)return e[0]==="!"?e:`!<${e}>`;let r=e.substr(n.prefix.length).replace(/[!,[\]{}]/g,s=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"})[s]);return n.handle+r}function ka(t,e){if(e instanceof S.Alias)return S.Alias;if(e.tag){let s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)||s[0]}let n,r;if(e instanceof S.Scalar){r=e.value;let s=t.filter(i=>i.identify&&i.identify(r)||i.class&&r instanceof i.class);n=s.find(i=>i.format===e.format)||s.find(i=>!i.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){let s=r&&r.constructor?r.constructor.name:typeof r;throw new Error(`Tag not resolved for ${s} value`)}return n}function va(t,e,{anchors:n,doc:r}){let s=[],i=r.anchors.getName(t);return i&&(n[i]=t,s.push(`&${i}`)),t.tag?s.push(ui(r,t.tag)):e.default||s.push(ui(r,e.tag)),s.join(" ")}function Xt(t,e,n,r){let{anchors:s,schema:i}=e.doc,o;if(!(t instanceof S.Node)){let l={aliasNodes:[],onTagObj:f=>o=f,prevObjects:new Map};t=i.createNode(t,!0,null,l);for(let f of l.aliasNodes){f.source=f.source.node;let m=s.getName(f.source);m||(m=s.newName(),s.map[m]=f.source)}}if(t instanceof S.Pair)return t.toString(e,n,r);o||(o=ka(i.tags,t));let a=va(t,o,e);a.length>0&&(e.indentAtStart=(e.indentAtStart||0)+a.length+1);let c=typeof o.stringify=="function"?o.stringify(t,e,n,r):t instanceof S.Scalar?S.stringifyString(t,e,n,r):t.toString(e,n,r);return a?t instanceof S.Scalar||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a} +${e.indent}${c}`:c}var zn=class t{static validAnchorNode(e){return e instanceof S.Scalar||e instanceof S.YAMLSeq||e instanceof S.YAMLMap}constructor(e){Y._defineProperty(this,"map",Object.create(null)),this.prefix=e}createAlias(e,n){return this.setAnchor(e,n),new S.Alias(e)}createMergePair(...e){let n=new S.Merge;return n.value.items=e.map(r=>{if(r instanceof S.Alias){if(r.source instanceof S.YAMLMap)return r}else if(r instanceof S.YAMLMap)return this.createAlias(r);throw new Error("Merge sources must be Map nodes or their Aliases")}),n}getName(e){let{map:n}=this;return Object.keys(n).find(r=>n[r]===e)}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);let n=Object.keys(this.map);for(let r=1;;++r){let s=`${e}${r}`;if(!n.includes(s))return s}}resolveNodes(){let{map:e,_cstAliases:n}=this;Object.keys(e).forEach(r=>{e[r]=e[r].resolved}),n.forEach(r=>{r.source=r.source.resolved}),delete this._cstAliases}setAnchor(e,n){if(e!=null&&!t.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");let{map:r}=this,s=e&&Object.keys(r).find(i=>r[i]===e);if(s)if(n)s!==n&&(delete r[s],r[n]=e);else return s;else{if(!n){if(!e)return null;n=this.newName()}r[n]=e}return n}},zt=(t,e)=>{if(t&&typeof t=="object"){let{tag:n}=t;t instanceof S.Collection?(n&&(e[n]=!0),t.items.forEach(r=>zt(r,e))):t instanceof S.Pair?(zt(t.key,e),zt(t.value,e)):t instanceof S.Scalar&&n&&(e[n]=!0)}return e},Ia=t=>Object.keys(zt(t,{}));function Pa(t,e){let n={before:[],after:[]},r,s=!1;for(let i of e)if(i.valueRange){if(r!==void 0){let a="Document contains trailing content not separated by a ... or --- line";t.errors.push(new Y.YAMLSyntaxError(i,a));break}let o=S.resolveNode(t,i);s&&(o.spaceBefore=!0,s=!1),r=o}else i.comment!==null?(r===void 0?n.before:n.after).push(i.comment):i.type===Y.Type.BLANK_LINE&&(s=!0,r===void 0&&n.before.length>0&&!t.commentBefore&&(t.commentBefore=n.before.join(` +`),n.before=[]));if(t.contents=r||null,!r)t.comment=n.before.concat(n.after).join(` +`)||null;else{let i=n.before.join(` +`);if(i){let o=r instanceof S.Collection&&r.items[0]?r.items[0]:r;o.commentBefore=o.commentBefore?`${i} +${o.commentBefore}`:i}t.comment=n.after.join(` +`)||null}}function _a({tagPrefixes:t},e){let[n,r]=e.parameters;if(!n||!r){let s="Insufficient parameters given for %TAG directive";throw new Y.YAMLSemanticError(e,s)}if(t.some(s=>s.handle===n)){let s="The %TAG directive must only be given at most once per handle in the same document.";throw new Y.YAMLSemanticError(e,s)}return{handle:n,prefix:r}}function xa(t,e){let[n]=e.parameters;if(e.name==="YAML:1.0"&&(n="1.0"),!n){let r="Insufficient parameters given for %YAML directive";throw new Y.YAMLSemanticError(e,r)}if(!pi[n]){let s=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${n}`;t.warnings.push(new Y.YAMLWarning(e,s))}return n}function Ra(t,e,n){let r=[],s=!1;for(let i of e){let{comment:o,name:a}=i;switch(a){case"TAG":try{t.tagPrefixes.push(_a(t,i))}catch(c){t.errors.push(c)}s=!0;break;case"YAML":case"YAML:1.0":if(t.version){let c="The %YAML directive must only be given at most once per document.";t.errors.push(new Y.YAMLSemanticError(i,c))}try{t.version=xa(t,i)}catch(c){t.errors.push(c)}s=!0;break;default:if(a){let c=`YAML only supports %TAG and %YAML directives, and not %${a}`;t.warnings.push(new Y.YAMLWarning(i,c))}}o&&r.push(o)}if(n&&!s&&(t.version||n.version||t.options.version)==="1.1"){let i=({handle:o,prefix:a})=>({handle:o,prefix:a});t.tagPrefixes=n.tagPrefixes.map(i),t.version=n.version}t.commentBefore=r.join(` +`)||null}function Ve(t){if(t instanceof S.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}var Zt=class t{constructor(e){this.anchors=new zn(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return Ve(this.contents),this.contents.add(e)}addIn(e,n){Ve(this.contents),this.contents.addIn(e,n)}delete(e){return Ve(this.contents),this.contents.delete(e)}deleteIn(e){return S.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):(Ve(this.contents),this.contents.deleteIn(e))}getDefaults(){return t.defaults[this.version]||t.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof S.Collection?this.contents.get(e,n):void 0}getIn(e,n){return S.isEmptyPath(e)?!n&&this.contents instanceof S.Scalar?this.contents.value:this.contents:this.contents instanceof S.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof S.Collection?this.contents.has(e):!1}hasIn(e){return S.isEmptyPath(e)?this.contents!==void 0:this.contents instanceof S.Collection?this.contents.hasIn(e):!1}set(e,n){Ve(this.contents),this.contents.set(e,n)}setIn(e,n){S.isEmptyPath(e)?this.contents=n:(Ve(this.contents),this.contents.setIn(e,n))}setSchema(e,n){if(!e&&!n&&this.schema)return;typeof e=="number"&&(e=e.toFixed(1)),e==="1.0"||e==="1.1"||e==="1.2"?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&typeof e=="string"&&(this.options.schema=e),Array.isArray(n)&&(this.options.customTags=n);let r=Object.assign({},this.getDefaults(),this.options);this.schema=new fi.Schema(r)}parse(e,n){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");let{directives:r=[],contents:s=[],directivesEndMarker:i,error:o,valueRange:a}=e;if(o&&(o.source||(o.source=this),this.errors.push(o)),Ra(this,r,n),i&&(this.directivesEndMarker=!0),this.range=a?[a.start,a.end]:null,this.setSchema(),this.anchors._cstAliases=[],Pa(this,s),this.anchors.resolveNodes(),this.options.prettyErrors){for(let c of this.errors)c instanceof Y.YAMLError&&c.makePretty();for(let c of this.warnings)c instanceof Y.YAMLError&&c.makePretty()}return this}listNonDefaultTags(){return Ia(this.contents).filter(e=>e.indexOf(fi.Schema.defaultPrefix)!==0)}setTagPrefix(e,n){if(e[0]!=="!"||e[e.length-1]!=="!")throw new Error("Handle must start and end with !");if(n){let r=this.tagPrefixes.find(s=>s.handle===e);r?r.prefix=n:this.tagPrefixes.push({handle:e,prefix:n})}else this.tagPrefixes=this.tagPrefixes.filter(r=>r.handle!==e)}toJSON(e,n){let{keepBlobsInJSON:r,mapAsMap:s,maxAliasCount:i}=this.options,o=r&&(typeof e!="string"||!(this.contents instanceof S.Scalar)),a={doc:this,indentStep:" ",keep:o,mapAsMap:o&&!!s,maxAliasCount:i,stringify:Xt},c=Object.keys(this.anchors.map);c.length>0&&(a.anchors=new Map(c.map(f=>[this.anchors.map[f],{alias:[],aliasCount:0,count:1}])));let l=S.toJSON(this.contents,e,a);if(typeof n=="function"&&a.anchors)for(let{count:f,res:m}of a.anchors.values())n(m,f);return l}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");let e=this.options.indent;if(!Number.isInteger(e)||e<=0){let c=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${c}`)}this.setSchema();let n=[],r=!1;if(this.version){let c="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?c="%YAML:1.0":this.version==="1.1"&&(c="%YAML 1.1")),n.push(c),r=!0}let s=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:c,prefix:l})=>{s.some(f=>f.indexOf(l)===0)&&(n.push(`%TAG ${c} ${l}`),r=!0)}),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&((r||!this.directivesEndMarker)&&n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));let i={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:Xt},o=!1,a=null;if(this.contents){this.contents instanceof S.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),i.forceBlockIndent=!!this.comment,a=this.contents.comment);let c=a?null:()=>o=!0,l=Xt(this.contents,i,()=>a=null,c);n.push(S.addComment(l,"",a))}else this.contents!==void 0&&n.push(Xt(this.contents,i));return this.comment&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join(` +`)+` +`}};Y._defineProperty(Zt,"defaults",pi);en.Document=Zt;en.defaultOptions=Ca;en.scalarOptions=Ma});var di=te(gi=>{"use strict";var Zn=Rs(),Oe=mi(),Da=Xn(),Ya=le(),$a=Qn();qe();function Ba(t,e=!0,n){n===void 0&&typeof e=="string"&&(n=e,e=!0);let r=Object.assign({},Oe.Document.defaults[Oe.defaultOptions.version],Oe.defaultOptions);return new Da.Schema(r).createNode(t,e,n)}var We=class extends Oe.Document{constructor(e){super(Object.assign({},Oe.defaultOptions,e))}};function Fa(t,e){let n=[],r;for(let s of Zn.parse(t)){let i=new We(e);i.parse(s,r),n.push(i),r=i}return n}function hi(t,e){let n=Zn.parse(t),r=new We(e).parse(n[0]);if(n.length>1){let s="Source contains multiple documents; please use YAML.parseAllDocuments()";r.errors.unshift(new Ya.YAMLSemanticError(n[1],s))}return r}function qa(t,e){let n=hi(t,e);if(n.warnings.forEach(r=>$a.warn(r)),n.errors.length>0)throw n.errors[0];return n.toJSON()}function Ua(t,e){let n=new We(e);return n.contents=t,String(n)}var Ka={createNode:Ba,defaultOptions:Oe.defaultOptions,Document:We,parse:qa,parseAllDocuments:Fa,parseCST:Zn.parse,parseDocument:hi,scalarOptions:Oe.scalarOptions,stringify:Ua};gi.YAML=Ka});var Ei=te((qm,yi)=>{yi.exports=di().YAML});var Si=te(J=>{"use strict";var je=qe(),Qe=le();J.findPair=je.findPair;J.parseMap=je.resolveMap;J.parseSeq=je.resolveSeq;J.stringifyNumber=je.stringifyNumber;J.stringifyString=je.stringifyString;J.toJSON=je.toJSON;J.Type=Qe.Type;J.YAMLError=Qe.YAMLError;J.YAMLReferenceError=Qe.YAMLReferenceError;J.YAMLSemanticError=Qe.YAMLSemanticError;J.YAMLSyntaxError=Qe.YAMLSyntaxError;J.YAMLWarning=Qe.YAMLWarning});var nr={};rr(nr,{languages:()=>_r,options:()=>xr,parsers:()=>tr,printers:()=>Ha});var Pi=(t,e,n,r)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(n,r):n.global?e.replace(n,r):e.split(n).join(r)},yt=Pi;var Le="string",Je="array",Ge="cursor",He="indent",Ae="align",Xe="trim",Te="group",Ce="fill",he="if-break",ze="indent-if-break",Me="line-suffix",Ze="line-suffix-boundary",Z="line",et="label",ke="break-parent",Et=new Set([Ge,He,Ae,Xe,Te,Ce,he,ze,Me,Ze,Z,et,ke]);var _i=(t,e,n)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[n<0?e.length+n:n]:e.at(n)},x=_i;function xi(t){if(typeof t=="string")return Le;if(Array.isArray(t))return Je;if(!t)return;let{type:e}=t;if(Et.has(e))return e}var ve=xi;var Ri=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Di(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', +Expected it to be 'string' or 'object'.`;if(ve(t))throw new Error("doc is valid.");let n=Object.prototype.toString.call(t);if(n!=="[object Object]")return`Unexpected doc '${n}'.`;let r=Ri([...Et].map(s=>`'${s}'`));return`Unexpected doc.type '${t.type}'. +Expected it to be ${r}.`}var nn=class extends Error{name="InvalidDocError";constructor(e){super(Di(e)),this.doc=e}},rn=nn;function $i(t,e){if(typeof t=="string")return e(t);let n=new Map;return r(t);function r(i){if(n.has(i))return n.get(i);let o=s(i);return n.set(i,o),o}function s(i){switch(ve(i)){case Je:return e(i.map(r));case Ce:return e({...i,parts:i.parts.map(r)});case he:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case Te:{let{expandedStates:o,contents:a}=i;return o?(o=o.map(r),a=o[0]):a=r(a),e({...i,contents:a,expandedStates:o})}case Ae:case He:case ze:case et:case Me:return e({...i,contents:r(i.contents)});case Le:case Ge:case Xe:case Ze:case Z:case ke:return e(i);default:throw new rn(i)}}}function ir(t,e=tt){return $i(t,n=>typeof n=="string"?v(e,n.split(` +`)):n)}var sn=()=>{},ge=sn,on=sn,or=sn;function nt(t,e){return ge(e),{type:Ae,contents:e,n:t}}function Ie(t,e={}){return ge(t),on(e.expandedStates,!0),{type:Te,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function an(t){return nt(Number.NEGATIVE_INFINITY,t)}function ar(t){return nt({type:"root"},t)}function cr(t){return nt(-1,t)}function cn(t,e){return Ie(t[0],{...e,expandedStates:t})}function St(t){return or(t),{type:Ce,parts:t}}function rt(t,e="",n={}){return ge(t),e!==""&&ge(e),{type:he,breakContents:t,flatContents:e,groupId:n.groupId}}function lr(t){return ge(t),{type:Me,contents:t}}var wt={type:ke};var Bi={type:Z,hard:!0},Fi={type:Z,hard:!0,literal:!0},ne={type:Z},bt={type:Z,soft:!0},N=[Bi,wt],tt=[Fi,wt];function v(t,e){ge(t),on(e);let n=[];for(let r=0;r{let s=!!(r!=null&&r.backwards);if(n===!1)return!1;let{length:i}=e,o=n;for(;o>=0&&o{let s=await r(e.originalText,{parser:"json"});return s?[s,N]:void 0}}pr.getVisitorKeys=()=>[];var mr=pr;var st=null;function it(t){if(st!==null&&typeof st.property){let e=st;return st=it.prototype=null,e}return st=it.prototype=t??Object.create(null),new it}var Ki=10;for(let t=0;t<=Ki;t++)it();function pn(t){return it(t)}function Vi(t,e="type"){pn(t);function n(r){let s=r[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:r});return i}return n}var hr=Vi;var Wi=Object.fromEntries(Object.entries({root:["children"],document:["head","body","children"],documentHead:["children"],documentBody:["children"],directive:[],alias:[],blockLiteral:[],blockFolded:["children"],plain:["children"],quoteSingle:[],quoteDouble:[],mapping:["children"],mappingItem:["key","value","children"],mappingKey:["content","children"],mappingValue:["content","children"],sequence:["children"],sequenceItem:["content","children"],flowMapping:["children"],flowMappingItem:["key","value","children"],flowSequence:["children"],flowSequenceItem:["content","children"],comment:[],tag:[],anchor:[]}).map(([t,e])=>[t,[...e,"anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"]])),gr=Wi;var ji=hr(gr),dr=ji;function Pe(t){return t.position.start.offset}function yr(t){return t.position.end.offset}function Er(t){return/^\s*@(?:prettier|format)\s*$/u.test(t)}function Sr(t){return/^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/u.test(t)}function wr(t){return`# @format + +${t}`}function Qi(t){return Array.isArray(t)&&t.length>0}var _e=Qi;function H(t,e){return typeof(t==null?void 0:t.type)=="string"&&(!e||e.includes(t.type))}function mn(t,e,n){return e("children"in t?{...t,children:t.children.map(r=>mn(r,e,t))}:t,n)}function xe(t,e,n){Object.defineProperty(t,e,{get:n,enumerable:!1})}function Nr(t,e){let n=0,r=e.length;for(let s=t.position.end.offset-1;si===0&&i===o.length-1?s:i!==0&&i!==o.length-1?s.trim():i===0?s.trimEnd():s.trimStart());return n.proseWrap==="preserve"?r.map(s=>s.length===0?[]:[s]):r.map(s=>s.length===0?[]:Lr(s)).reduce((s,i,o)=>o!==0&&r[o-1].length>0&&i.length>0&&!(t==="quoteDouble"&&x(!1,x(!1,s,-1),-1).endsWith("\\"))?[...s.slice(0,-1),[...x(!1,s,-1),...i]]:[...s,i],[]).map(s=>n.proseWrap==="never"?[s.join(" ")]:s)}function Tr(t,{parentIndent:e,isLastDescendant:n,options:r}){let s=t.position.start.line===t.position.end.line?"":r.originalText.slice(t.position.start.offset,t.position.end.offset).match(/^[^\n]*\n(.*)$/su)[1],i;if(t.indent===null){let c=s.match(/^(? *)[^\n\r ]/mu);i=c?c.groups.leadingSpace.length:Number.POSITIVE_INFINITY}else i=t.indent-1+e;let o=s.split(` +`).map(c=>c.slice(i));if(r.proseWrap==="preserve"||t.type==="blockLiteral")return a(o.map(c=>c.length===0?[]:[c]));return a(o.map(c=>c.length===0?[]:Lr(c)).reduce((c,l,f)=>f!==0&&o[f-1].length>0&&l.length>0&&!/^\s/u.test(l[0])&&!/^\s|\s$/u.test(x(!1,c,-1))?[...c.slice(0,-1),[...x(!1,c,-1),...l]]:[...c,l],[]).map(c=>c.reduce((l,f)=>l.length>0&&/\s$/u.test(x(!1,l,-1))?[...l.slice(0,-1),x(!1,l,-1)+" "+f]:[...l,f],[])).map(c=>r.proseWrap==="never"?[c.join(" ")]:c));function a(c){if(t.chomping==="keep")return x(!1,c,-1).length===0?c.slice(0,-1):c;let l=0;for(let f=c.length-1;f>=0&&c[f].length===0;f--)l++;return l===0?c:l>=2&&!n?c.slice(0,-(l-1)):c.slice(0,-l)}}function ot(t){if(!t)return!0;switch(t.type){case"plain":case"quoteDouble":case"quoteSingle":case"alias":case"flowMapping":case"flowSequence":return!0;default:return!1}}var gn=new WeakMap;function At(t,e){let{node:n,root:r}=t,s;return gn.has(r)?s=gn.get(r):(s=new Set,gn.set(r,s)),!s.has(n.position.end.line)&&(s.add(n.position.end.line),Nr(n,e)&&!dn(t.parent))?bt:""}function dn(t){return R(t)&&!H(t,["documentHead","documentBody","flowMapping","flowSequence"])}function I(t,e){return nt(" ".repeat(t),e)}function Gi(t,e,n){let{node:r}=t,s=t.ancestors.filter(l=>l.type==="sequence"||l.type==="mapping").length,i=Ot(t),o=[r.type==="blockFolded"?">":"|"];r.indent!==null&&o.push(r.indent.toString()),r.chomping!=="clip"&&o.push(r.chomping==="keep"?"+":"-"),hn(r)&&o.push(" ",e("indicatorComment"));let a=Tr(r,{parentIndent:s,isLastDescendant:i,options:n}),c=[];for(let[l,f]of a.entries())l===0&&c.push(N),c.push(St(v(ne,f))),l!==a.length-1?c.push(f.length===0?N:ar(tt)):r.chomping==="keep"&&i&&c.push(an(f.length===0?N:tt));return r.indent===null?o.push(cr(I(n.tabWidth,c))):o.push(an(I(r.indent-1+s,c))),o}var Cr=Gi;function Tt(t,e,n){let{node:r}=t,s=r.type==="flowMapping",i=s?"{":"[",o=s?"}":"]",a=bt;s&&r.children.length>0&&n.bracketSpacing&&(a=ne);let c=x(!1,r.children,-1),l=(c==null?void 0:c.type)==="flowMappingItem"&&Re(c.key)&&Re(c.value);return[i,I(n.tabWidth,[a,Hi(t,e,n),n.trailingComma==="none"?"":rt(","),R(r)?[N,v(N,t.map(e,"endComments"))]:""]),l?"":a,o]}function Hi(t,e,n){return t.map(({isLast:r,node:s,next:i})=>[e(),r?"":[",",ne,s.position.start.line!==i.position.start.line?At(t,n.originalText):""]],"children")}function Xi(t,e,n){var C;let{node:r,parent:s}=t,{key:i,value:o}=r,a=Re(i),c=Re(o);if(a&&c)return": ";let l=e("key"),f=zi(r)?" ":"";if(c)return r.type==="flowMappingItem"&&s.type==="flowMapping"?l:r.type==="mappingItem"&&yn(i.content,n)&&!K(i.content)&&((C=s.tag)==null?void 0:C.value)!=="tag:yaml.org,2002:set"?[l,f,":"]:["? ",I(2,l)];let m=e("value");if(a)return[": ",I(2,m)];if(ee(o)||!ot(i.content))return["? ",I(2,l),N,...t.map(()=>[e(),N],"value","leadingComments"),": ",I(2,m)];if(Zi(i.content)&&!ee(i.content)&&!ie(i.content)&&!K(i.content)&&!R(i)&&!ee(o.content)&&!ie(o.content)&&!R(o)&&yn(o.content,n))return[l,f,": ",m];let d=Symbol("mappingKey"),y=Ie([rt("? "),Ie(I(2,l),{id:d})]),h=[N,": ",I(2,m)],g=[f,":"];ee(o.content)||R(o)&&o.content&&!H(o.content,["mapping","sequence"])||s.type==="mapping"&&K(i.content)&&ot(o.content)||H(o.content,["mapping","sequence"])&&o.content.tag===null&&o.content.anchor===null?g.push(N):o.content?g.push(ne):K(o)&&g.push(" "),g.push(m);let w=I(n.tabWidth,g);return yn(i.content,n)&&!ee(i.content)&&!ie(i.content)&&!R(i)?cn([[l,w]]):cn([[y,rt(h,w,{groupId:d})]])}function yn(t,e){if(!t)return!0;switch(t.type){case"plain":case"quoteSingle":case"quoteDouble":break;case"alias":return!0;default:return!1}if(e.proseWrap==="preserve")return t.position.start.line===t.position.end.line;if(/\\$/mu.test(e.originalText.slice(t.position.start.offset,t.position.end.offset)))return!1;switch(e.proseWrap){case"never":return!t.value.includes(` +`);case"always":return!/[\n ]/u.test(t.value);default:return!1}}function zi(t){var e;return((e=t.key.content)==null?void 0:e.type)==="alias"}function Zi(t){if(!t)return!0;switch(t.type){case"plain":case"quoteDouble":case"quoteSingle":return t.position.start.line===t.position.end.line;case"alias":return!0;default:return!1}}var Mr=Xi;function eo(t){return mn(t,to)}function to(t){switch(t.type){case"document":xe(t,"head",()=>t.children[0]),xe(t,"body",()=>t.children[1]);break;case"documentBody":case"sequenceItem":case"flowSequenceItem":case"mappingKey":case"mappingValue":xe(t,"content",()=>t.children[0]);break;case"mappingItem":case"flowMappingItem":xe(t,"key",()=>t.children[0]),xe(t,"value",()=>t.children[1]);break}return t}var kr=eo;function no(t,e,n){let{node:r}=t,s=[];r.type!=="mappingValue"&&ee(r)&&s.push([v(N,t.map(n,"leadingComments")),N]);let{tag:i,anchor:o}=r;i&&s.push(n("tag")),i&&o&&s.push(" "),o&&s.push(n("anchor"));let a="";return H(r,["mapping","sequence","comment","directive","mappingItem","sequenceItem"])&&!Ot(t)&&(a=At(t,e.originalText)),(i||o)&&(H(r,["sequence","mapping"])&&!ie(r)?s.push(N):s.push(" ")),ie(r)&&s.push([r.middleComments.length===1?"":N,v(N,t.map(n,"middleComments")),N]),Or(t)?s.push(ir(e.originalText.slice(r.position.start.offset,r.position.end.offset).trimEnd())):s.push(Ie(ro(t,e,n))),K(r)&&!H(r,["document","documentHead"])&&s.push(lr([r.type==="mappingValue"&&!r.content?"":" ",t.parent.type==="mappingKey"&&t.getParentNode(2).type==="mapping"&&ot(r)?"":wt,n("trailingComment")])),dn(r)&&s.push(I(r.type==="sequenceItem"?2:0,[N,v(N,t.map(({node:c})=>[fr(e.originalText,Pe(c))?N:"",n()],"endComments"))])),s.push(a),s}function ro(t,e,n){let{node:r}=t;switch(r.type){case"root":{let s=[];t.each(({node:o,next:a,isFirst:c})=>{c||s.push(N),s.push(n()),vr(o,a)?(s.push(N,"..."),K(o)&&s.push(" ",n("trailingComment"))):a&&!K(a.head)&&s.push(N,"---")},"children");let i=Lt(r);return(!H(i,["blockLiteral","blockFolded"])||i.chomping!=="keep")&&s.push(N),s}case"document":{let s=[];return io(t,e)==="head"&&((r.head.children.length>0||r.head.endComments.length>0)&&s.push(n("head")),K(r.head)?s.push(["---"," ",n(["head","trailingComment"])]):s.push("---")),so(r)&&s.push(n("body")),v(N,s)}case"documentHead":return v(N,[...t.map(n,"children"),...t.map(n,"endComments")]);case"documentBody":{let{children:s,endComments:i}=r,o="";if(s.length>0&&i.length>0){let a=Lt(r);H(a,["blockFolded","blockLiteral"])?a.chomping!=="keep"&&(o=[N,N]):o=N}return[v(N,t.map(n,"children")),o,v(N,t.map(n,"endComments"))]}case"directive":return["%",v(" ",[r.name,...r.parameters])];case"comment":return["#",r.value];case"alias":return["*",r.value];case"tag":return e.originalText.slice(r.position.start.offset,r.position.end.offset);case"anchor":return["&",r.value];case"plain":return at(r.type,e.originalText.slice(r.position.start.offset,r.position.end.offset),e);case"quoteDouble":case"quoteSingle":{let s="'",i='"',o=e.originalText.slice(r.position.start.offset+1,r.position.end.offset-1);if(r.type==="quoteSingle"&&o.includes("\\")||r.type==="quoteDouble"&&/\\[^"]/u.test(o)){let c=r.type==="quoteDouble"?i:s;return[c,at(r.type,o,e),c]}if(o.includes(i))return[s,at(r.type,r.type==="quoteDouble"?yt(!1,yt(!1,o,String.raw`\"`,i),"'",s.repeat(2)):o,e),s];if(o.includes(s))return[i,at(r.type,r.type==="quoteSingle"?yt(!1,o,"''",s):o,e),i];let a=e.singleQuote?s:i;return[a,at(r.type,o,e),a]}case"blockFolded":case"blockLiteral":return Cr(t,n,e);case"mapping":case"sequence":return v(N,t.map(n,"children"));case"sequenceItem":return["- ",I(2,r.content?n("content"):"")];case"mappingKey":case"mappingValue":return r.content?n("content"):"";case"mappingItem":case"flowMappingItem":return Mr(t,n,e);case"flowMapping":return Tt(t,n,e);case"flowSequence":return Tt(t,n,e);case"flowSequenceItem":return n("content");default:throw new ur(r,"YAML")}}function so(t){return t.body.children.length>0||R(t.body)}function vr(t,e){return K(t)||e&&(e.head.children.length>0||R(e.head))}function io(t,e){let n=t.node;if(t.isFirst&&/---(?:\s|$)/u.test(e.originalText.slice(Pe(n),Pe(n)+4))||n.head.children.length>0||R(n.head)||K(n.head))return"head";let r=t.next;return vr(n,r)?!1:r?"root":!1}function at(t,e,n){let r=Ar(t,e,n);return v(N,r.map(s=>St(v(ne,s))))}function Ir(t,e){if(H(t))switch(t.type){case"comment":if(Er(t.value))return null;break;case"quoteDouble":case"quoteSingle":e.type="quote";break}}Ir.ignoredProperties=new Set(["position"]);var oo={preprocess:kr,embed:mr,print:no,massageAstNode:Ir,insertPragma:wr,getVisitorKeys:dr},Pr=oo;var _r=[{linguistLanguageId:407,name:"YAML",type:"data",color:"#cb171e",tmScope:"source.yaml",aliases:["yml"],extensions:[".yml",".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".gemrc","CITATION.cff","glide.lock",".prettierrc",".stylelintrc",".lintstagedrc"],aceMode:"yaml",codemirrorMode:"yaml",codemirrorMimeType:"text/x-yaml",parsers:["yaml"],vscodeLanguageIds:["yaml","ansible","dockercompose","github-actions-workflow","home-assistant"]}];var Ct={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var ao={bracketSpacing:Ct.bracketSpacing,singleQuote:Ct.singleQuote,proseWrap:Ct.proseWrap},xr=ao;var tr={};rr(tr,{yaml:()=>Ga});var Mt=` +`,Rr="\r",Dr=function(){function t(e){this.length=e.length;for(var n=[0],r=0;rthis.length)return null;for(var n=0,r=this.offsets;r[n+1]<=e;)n++;var s=e-r[n];return{line:n,column:s}},t.prototype.indexForLocation=function(e){var n=e.line,r=e.column;return n<0||n>=this.offsets.length||r<0||r>this.lengthOfLine(n)?null:this.offsets[n]+r},t.prototype.lengthOfLine=function(e){var n=this.offsets[e],r=e===this.offsets.length-1?this.length:this.offsets[e+1];return r-n},t}();function $(t,e=null){"children"in t&&t.children.forEach(n=>$(n,t)),"anchor"in t&&t.anchor&&$(t.anchor,t),"tag"in t&&t.tag&&$(t.tag,t),"leadingComments"in t&&t.leadingComments.forEach(n=>$(n,t)),"middleComments"in t&&t.middleComments.forEach(n=>$(n,t)),"indicatorComment"in t&&t.indicatorComment&&$(t.indicatorComment,t),"trailingComment"in t&&t.trailingComment&&$(t.trailingComment,t),"endComments"in t&&t.endComments.forEach(n=>$(n,t)),Object.defineProperty(t,"_parent",{value:e,enumerable:!1})}function de(t){return`${t.line}:${t.column}`}function Yr(t){$(t);let e=co(t),n=t.children.slice();t.comments.sort((r,s)=>r.position.start.offset-s.position.end.offset).filter(r=>!r._parent).forEach(r=>{for(;n.length>1&&r.position.start.line>n[0].position.end.line;)n.shift();lo(r,e,n[0])})}function co(t){let e=Array.from(new Array(t.position.end.line),()=>({}));for(let n of t.comments)e[n.position.start.line-1].comment=n;return $r(e,t),e}function $r(t,e){if(e.position.start.offset!==e.position.end.offset){if("leadingComments"in e){let{start:n}=e.position,{leadingAttachableNode:r}=t[n.line-1];(!r||n.column1&&e.type!=="document"&&e.type!=="documentHead"){let{end:n}=e.position,{trailingAttachableNode:r}=t[n.line-1];(!r||n.column>=r.position.end.column)&&(t[n.line-1].trailingAttachableNode=e)}if(e.type!=="root"&&e.type!=="document"&&e.type!=="documentHead"&&e.type!=="documentBody"){let{start:n,end:r}=e.position,s=[r.line].concat(n.line===r.line?[]:n.line);for(let i of s){let o=t[i-1].trailingNode;(!o||r.column>=o.position.end.column)&&(t[i-1].trailingNode=e)}}"children"in e&&e.children.forEach(n=>{$r(t,n)})}}function lo(t,e,n){let r=t.position.start.line,{trailingAttachableNode:s}=e[r-1];if(s){if(s.trailingComment)throw new Error(`Unexpected multiple trailing comment at ${de(t.position.start)}`);$(t,s),s.trailingComment=t;return}for(let o=r;o>=n.position.start.line;o--){let{trailingNode:a}=e[o-1],c;if(a)c=a;else if(o!==r&&e[o-1].comment)c=e[o-1].comment._parent;else continue;if((c.type==="sequence"||c.type==="mapping")&&(c=c.children[0]),c.type==="mappingItem"){let[l,f]=c.children;c=Br(l)?l:f}for(;;){if(fo(c,t)){$(t,c),c.endComments.push(t);return}if(!c._parent)break;c=c._parent}break}for(let o=r+1;o<=n.position.end.line;o++){let{leadingAttachableNode:a}=e[o-1];if(a){$(t,a),a.leadingComments.push(t);return}}let i=n.children[1];$(t,i),i.endComments.push(t)}function fo(t,e){if(t.position.start.offsete.position.end.offset)switch(t.type){case"flowMapping":case"flowSequence":return t.children.length===0||e.position.start.line>t.children[t.children.length-1].position.end.line}if(e.position.end.offsett.position.start.column;case"mappingKey":case"mappingValue":return e.position.start.column>t._parent.position.start.column&&(t.children.length===0||t.children.length===1&&t.children[0].type!=="blockFolded"&&t.children[0].type!=="blockLiteral")&&(t.type==="mappingValue"||Br(t));default:return!1}}function Br(t){return t.position.start!==t.position.end&&(t.children.length===0||t.position.start.offset!==t.children[0].position.start.offset)}function b(t,e){return{type:t,position:e}}function Fr(t,e,n){return{...b("root",t),children:e,comments:n}}function ct(t){switch(t.type){case"DOCUMENT":for(let e=t.contents.length-1;e>=0;e--)t.contents[e].type==="BLANK_LINE"?t.contents.splice(e,1):ct(t.contents[e]);for(let e=t.directives.length-1;e>=0;e--)t.directives[e].type==="BLANK_LINE"&&t.directives.splice(e,1);break;case"FLOW_MAP":case"FLOW_SEQ":case"MAP":case"SEQ":for(let e=t.items.length-1;e>=0;e--){let n=t.items[e];"char"in n||(n.type==="BLANK_LINE"?t.items.splice(e,1):ct(n))}break;case"MAP_KEY":case"MAP_VALUE":case"SEQ_ITEM":t.node&&ct(t.node);break;case"ALIAS":case"BLANK_LINE":case"BLOCK_FOLDED":case"BLOCK_LITERAL":case"COMMENT":case"DIRECTIVE":case"PLAIN":case"QUOTE_DOUBLE":case"QUOTE_SINGLE":break;default:throw new Error(`Unexpected node type ${JSON.stringify(t.type)}`)}}function X(){return{leadingComments:[]}}function oe(t=null){return{trailingComment:t}}function B(){return{...X(),...oe()}}function qr(t,e,n){return{...b("alias",t),...B(),...e,value:n}}function Ur(t,e){let n=t.cstNode;return qr(e.transformRange({origStart:n.valueRange.origStart-1,origEnd:n.valueRange.origEnd}),e.transformContent(t),n.rawValue)}function Kr(t){return{...t,type:"blockFolded"}}function Vr(t,e,n,r,s,i){return{...b("blockValue",t),...X(),...e,chomping:n,indent:r,value:s,indicatorComment:i}}var ae;(function(t){t.Tag="!",t.Anchor="&",t.Comment="#"})(ae||(ae={}));function Wr(t,e){return{...b("anchor",t),value:e}}function De(t,e){return{...b("comment",t),value:e}}function jr(t,e,n){return{anchor:e,tag:t,middleComments:n}}function Qr(t,e){return{...b("tag",t),value:e}}function kt(t,e,n=()=>!1){let r=t.cstNode,s=[],i=null,o=null,a=null;for(let c of r.props){let l=e.text[c.origStart];switch(l){case ae.Tag:i=i||c,o=Qr(e.transformRange(c),t.tag);break;case ae.Anchor:i=i||c,a=Wr(e.transformRange(c),r.anchor);break;case ae.Comment:{let f=De(e.transformRange(c),e.text.slice(c.origStart+1,c.origEnd));e.comments.push(f),!n(f)&&i&&i.origEnd<=c.origStart&&c.origEnd<=r.valueRange.origStart&&s.push(f);break}default:throw new Error(`Unexpected leading character ${JSON.stringify(l)}`)}}return jr(o,a,s)}var En;(function(t){t.CLIP="clip",t.STRIP="strip",t.KEEP="keep"})(En||(En={}));function vt(t,e){let n=t.cstNode,r=1,s=n.chomping==="CLIP"?0:1,o=n.header.origEnd-n.header.origStart-r-s!==0,a=e.transformRange({origStart:n.header.origStart,origEnd:n.valueRange.origEnd}),c=null,l=kt(t,e,f=>{if(!(a.start.offset=0;c--){let l=t.contents[c];if(l.type==="COMMENT"){let f=e.transformNode(l);n&&n.line===f.position.start.line?o.unshift(f):a?r.unshift(f):f.position.start.offset>=t.valueRange.origEnd?i.unshift(f):r.unshift(f)}else a=!0}if(i.length>1)throw new Error(`Unexpected multiple document trailing comments at ${de(i[1].position.start)}`);if(o.length>1)throw new Error(`Unexpected multiple documentHead trailing comments at ${de(o[1].position.start)}`);return{comments:r,endComments:s,documentTrailingComment:q(i)||null,documentHeadTrailingComment:q(o)||null}}function po(t,e,n){let r=It(n.text.slice(t.valueRange.origEnd),/^\.\.\./),s=r===-1?t.valueRange.origEnd:Math.max(0,t.valueRange.origEnd-1);n.text[s-1]==="\r"&&s--;let i=n.transformRange({origStart:e!==null?e.position.start.offset:s,origEnd:s}),o=r===-1?i.end:n.transformOffset(t.valueRange.origEnd+3);return{position:i,documentEndPoint:o}}function rs(t,e,n,r){return{...b("documentHead",t),...F(n),...oe(r),children:e}}function ss(t,e){let n=t.cstNode,{directives:r,comments:s,endComments:i}=mo(n,e),{position:o,endMarkerPoint:a}=ho(n,r,e);return e.comments.push(...s,...i),{createDocumentHeadWithTrailingComment:l=>(l&&e.comments.push(l),rs(o,r,i,l)),documentHeadEndMarkerPoint:a}}function mo(t,e){let n=[],r=[],s=[],i=!1;for(let o=t.directives.length-1;o>=0;o--){let a=e.transformNode(t.directives[o]);a.type==="comment"?i?r.unshift(a):s.unshift(a):(i=!0,n.unshift(a))}return{directives:n,comments:r,endComments:s}}function ho(t,e,n){let r=It(n.text.slice(0,t.valueRange.origStart),/---\s*$/);r>0&&!/[\r\n]/.test(n.text[r-1])&&(r=-1);let s=r===-1?{origStart:t.valueRange.origStart,origEnd:t.valueRange.origStart}:{origStart:r,origEnd:r+3};return e.length!==0&&(s.origStart=e[0].position.start.offset),{position:n.transformRange(s),endMarkerPoint:r===-1?null:n.transformOffset(r)}}function is(t,e){let{createDocumentHeadWithTrailingComment:n,documentHeadEndMarkerPoint:r}=ss(t,e),{documentBody:s,documentEndPoint:i,documentTrailingComment:o,documentHeadTrailingComment:a}=ns(t,e,r),c=n(a);return o&&e.comments.push(o),es(V(c.position.start,i),c,s,o)}function Pt(t,e,n){return{...b("flowCollection",t),...B(),...F(),...e,children:n}}function os(t,e,n){return{...Pt(t,e,n),type:"flowMapping"}}function _t(t,e,n){return{...b("flowMappingItem",t),...X(),children:[e,n]}}function ce(t,e){let n=[];for(let r of t)r&&"type"in r&&r.type==="COMMENT"?e.comments.push(e.transformNode(r)):n.push(r);return n}function xt(t){let[e,n]=["?",":"].map(r=>{let s=t.find(i=>"char"in i&&i.char===r);return s?{origStart:s.origOffset,origEnd:s.origOffset+1}:null});return{additionalKeyRange:e,additionalValueRange:n}}function Rt(t,e){let n=e;return r=>t.slice(n,n=r)}function Dt(t){let e=[],n=Rt(t,1),r=!1;for(let s=1;s{let l=r[c],{additionalKeyRange:f,additionalValueRange:m}=xt(l);return $e(a,e,_t,f,m)}),i=n[0],o=q(n);return os(e.transformRange({origStart:i.origOffset,origEnd:o.origOffset+1}),e.transformContent(t),s)}function cs(t,e,n){return{...Pt(t,e,n),type:"flowSequence"}}function ls(t,e){return{...b("flowSequenceItem",t),children:[e]}}function fs(t,e){let n=ce(t.cstNode.items,e),r=Dt(n),s=t.items.map((a,c)=>{if(a.type!=="PAIR"){let l=e.transformNode(a);return ls(V(l.position.start,l.position.end),l)}else{let l=r[c],{additionalKeyRange:f,additionalValueRange:m}=xt(l);return $e(a,e,_t,f,m)}}),i=n[0],o=q(n);return cs(e.transformRange({origStart:i.origOffset,origEnd:o.origOffset+1}),e.transformContent(t),s)}function us(t,e,n){return{...b("mapping",t),...X(),...e,children:n}}function ps(t,e,n){return{...b("mappingItem",t),...X(),children:[e,n]}}function ms(t,e){let n=t.cstNode;n.items.filter(o=>o.type==="MAP_KEY"||o.type==="MAP_VALUE").forEach(o=>Ye(o,e));let r=ce(n.items,e),s=go(r),i=t.items.map((o,a)=>{let c=s[a],[l,f]=c[0].type==="MAP_VALUE"?[null,c[0].range]:[c[0].range,c.length===1?null:c[1].range];return $e(o,e,ps,l,f)});return us(V(i[0].position.start,q(i).position.end),e.transformContent(t),i)}function go(t){let e=[],n=Rt(t,0),r=!1;for(let s=0;s=0;r--)if(n.test(t[r]))return r;return-1}function ds(t,e){let n=t.cstNode;return hs(e.transformRange({origStart:n.valueRange.origStart,origEnd:gs(e.text,n.valueRange.origEnd-1,/\S/)+1}),e.transformContent(t),n.strValue)}function ys(t){return{...t,type:"quoteDouble"}}function Es(t,e,n){return{...b("quoteValue",t),...e,...B(),value:n}}function Yt(t,e){let n=t.cstNode;return Es(e.transformRange(n.valueRange),e.transformContent(t),n.strValue)}function Ss(t,e){return ys(Yt(t,e))}function ws(t){return{...t,type:"quoteSingle"}}function bs(t,e){return ws(Yt(t,e))}function Ns(t,e,n){return{...b("sequence",t),...X(),...F(),...e,children:n}}function Os(t,e){return{...b("sequenceItem",t),...B(),...F(),children:e?[e]:[]}}function Ls(t,e){let r=ce(t.cstNode.items,e).map((s,i)=>{Ye(s,e);let o=e.transformNode(t.items[i]);return Os(V(e.transformOffset(s.valueRange.origStart),o===null?e.transformOffset(s.valueRange.origStart+1):o.position.end),o)});return Ns(V(r[0].position.start,q(r).position.end),e.transformContent(t),r)}function As(t,e){if(t===null||t.type===void 0&&t.value===null)return null;switch(t.type){case"ALIAS":return Ur(t,e);case"BLOCK_FOLDED":return Jr(t,e);case"BLOCK_LITERAL":return Hr(t,e);case"COMMENT":return Xr(t,e);case"DIRECTIVE":return Zr(t,e);case"DOCUMENT":return is(t,e);case"FLOW_MAP":return as(t,e);case"FLOW_SEQ":return fs(t,e);case"MAP":return ms(t,e);case"PLAIN":return ds(t,e);case"QUOTE_DOUBLE":return Ss(t,e);case"QUOTE_SINGLE":return bs(t,e);case"SEQ":return Ls(t,e);default:throw new Error(`Unexpected node type ${t.type}`)}}function Ts(t,e,n){let r=new SyntaxError(t);return r.name="YAMLSyntaxError",r.source=e,r.position=n,r}function Cs(t,e){let n=t.source.range||t.source.valueRange;return Ts(t.message,e.text,e.transformRange(n))}function Ms(t,e,n){return{offset:t,line:e,column:n}}function ks(t,e){t<0?t=0:t>e.text.length&&(t=e.text.length);let n=e.locator.locationForIndex(t);return Ms(t,n.line+1,n.column+1)}function vs(t,e){return V(e.transformOffset(t.origStart),e.transformOffset(t.origEnd))}function Is(t){if(!t.setOrigRanges()){let e=n=>{if(yo(n))return n.origStart=n.start,n.origEnd=n.end,!0;if(Eo(n))return n.origOffset=n.offset,!0};t.forEach(n=>Nn(n,e))}}function Nn(t,e){if(!(!t||typeof t!="object")&&e(t)!==!0)for(let n of Object.keys(t)){if(n==="context"||n==="error")continue;let r=t[n];Array.isArray(r)?r.forEach(s=>Nn(s,e)):Nn(r,e)}}function yo(t){return typeof t.start=="number"}function Eo(t){return typeof t.offset=="number"}function On(t){if("children"in t){if(t.children.length===1){let e=t.children[0];if(e.type==="plain"&&e.tag===null&&e.anchor===null&&e.value==="")return t.children.splice(0,1),t}t.children.forEach(On)}return t}function Ln(t,e,n,r){let s=e(t);return i=>{r(s,i)&&n(t,s=i)}}function An(t){if(t===null||!("children"in t))return;let e=t.children;if(e.forEach(An),t.type==="document"){let[i,o]=t.children;i.position.start.offset===i.position.end.offset?i.position.start=i.position.end=o.position.start:o.position.start.offset===o.position.end.offset&&(o.position.start=o.position.end=i.position.end)}let n=Ln(t.position,So,wo,Oo),r=Ln(t.position,bo,No,Lo);"endComments"in t&&t.endComments.length!==0&&(n(t.endComments[0].position.start),r(q(t.endComments).position.end));let s=e.filter(i=>i!==null);if(s.length!==0){let i=s[0],o=q(s);n(i.position.start),r(o.position.end),"leadingComments"in i&&i.leadingComments.length!==0&&n(i.leadingComments[0].position.start),"tag"in i&&i.tag&&n(i.tag.position.start),"anchor"in i&&i.anchor&&n(i.anchor.position.start),"trailingComment"in o&&o.trailingComment&&r(o.trailingComment.position.end)}}function So(t){return t.start}function wo(t,e){t.start=e}function bo(t){return t.end}function No(t,e){t.end=e}function Oo(t,e){return e.offsett.offset}var wi=sr(Ei(),1);var G=sr(Si(),1),Km=G.default.findPair,Vm=G.default.toJSON,Wm=G.default.parseMap,jm=G.default.parseSeq,Qm=G.default.stringifyNumber,Jm=G.default.stringifyString,Gm=G.default.Type,Va=G.default.YAMLError,Hm=G.default.YAMLReferenceError,er=G.default.YAMLSemanticError,Wa=G.default.YAMLSyntaxError,Xm=G.default.YAMLWarning;var{Document:bi,parseCST:Ni}=wi.default;function Oi(t){let e=Ni(t);Is(e);let n=e.map(a=>new bi({merge:!1,keepCstNodes:!0}).parse(a)),r=new Dr(t),s=[],i={text:t,locator:r,comments:s,transformOffset:a=>ks(a,i),transformRange:a=>vs(a,i),transformNode:a=>As(a,i),transformContent:a=>kt(a,i)};for(let a of n)for(let c of a.errors)if(!(c instanceof er&&c.message==='Map keys must be unique; "<<" is repeated'))throw Cs(c,i);n.forEach(a=>ct(a.cstNode));let o=Fr(i.transformRange({origStart:0,origEnd:i.text.length}),n.map(i.transformNode),s);return Yr(o),An(o),On(o),o}function Qa(t,e){let n=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(n,e)}var Li=Qa;function Ja(t){try{let e=Oi(t);return delete e.comments,e}catch(e){throw e!=null&&e.position?Li(e.message,{loc:e.position,cause:e}):e}}var Ga={astFormat:"yaml",parse:Ja,hasPragma:Sr,locStart:Pe,locEnd:yr};var Ha={yaml:Pr};var Oh=nr;export{Oh as default,_r as languages,xr as options,tr as parsers,Ha as printers}; diff --git a/node_modules/prettier/standalone.js b/node_modules/prettier/standalone.js new file mode 100644 index 0000000..b45e6ae --- /dev/null +++ b/node_modules/prettier/standalone.js @@ -0,0 +1,39 @@ +(function(t){function e(){var o=t();return o.default||o}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var f=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};f.prettier=e()}})(function(){"use strict";var Au=Object.create;var Me=Object.defineProperty;var vu=Object.getOwnPropertyDescriptor;var Bu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty;var fr=e=>{throw TypeError(e)};var dr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)Me(e,r,{get:t[r],enumerable:!0})},pr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Bu(t))!_u.call(e,u)&&u!==r&&Me(e,u,{get:()=>t[u],enumerable:!(n=vu(t,u))||n.enumerable});return e};var Ve=(e,t,r)=>(r=e!=null?Au(wu(e)):{},pr(t||!e||!e.__esModule?Me(r,"default",{value:e,enumerable:!0}):r,e)),xu=e=>pr(Me({},"__esModule",{value:!0}),e);var bu=(e,t,r)=>t.has(e)||fr("Cannot "+r);var Fr=(e,t,r)=>t.has(e)?fr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var pe=(e,t,r)=>(bu(e,t,"access private method"),r);var st=dr((la,mn)=>{"use strict";var Fn=new Proxy(String,{get:()=>Fn});mn.exports=Fn});var $n=dr(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});function wi(){return new Proxy({},{get:()=>e=>e})}var Wn=/\r\n|[\n\r\u2028\u2029]/;function _i(e,t,r){let n=Object.assign({column:0,line:-1},e.start),u=Object.assign({},n,e.end),{linesAbove:i=2,linesBelow:o=3}=r||{},s=n.line,a=n.column,D=u.line,l=u.column,p=Math.max(s-(i+1),0),f=Math.min(t.length,D+o);s===-1&&(p=0),D===-1&&(f=t.length);let d=D-s,c={};if(d)for(let F=0;F<=d;F++){let m=F+s;if(!a)c[m]=!0;else if(F===0){let h=t[m-1].length;c[m]=[a,h-a+1]}else if(F===d)c[m]=[0,l];else{let h=t[m-F].length;c[m]=[0,h]}}else a===l?a?c[s]=[a,0]:c[s]=!0:c[s]=[a,l-a];return{start:p,end:f,markerLines:c}}function xi(e,t,r={}){let u=wi(!1),i=e.split(Wn),{start:o,end:s,markerLines:a}=_i(t,i,r),D=t.start&&typeof t.start.column=="number",l=String(s).length,f=e.split(Wn,s).slice(o,s).map((d,c)=>{let F=o+1+c,h=` ${` ${F}`.slice(-l)} |`,C=a[F],v=!a[F+1];if(C){let E="";if(Array.isArray(C)){let g=d.slice(0,Math.max(C[0]-1,0)).replace(/[^\t]/g," "),j=C[1]||1;E=[` + `,u.gutter(h.replace(/\d/g," "))," ",g,u.marker("^").repeat(j)].join(""),v&&r.message&&(E+=" "+u.message(r.message))}return[u.marker(">"),u.gutter(h),d.length>0?` ${d}`:"",E].join("")}else return` ${u.gutter(h)}${d.length>0?` ${d}`:""}`}).join(` +`);return r.message&&!D&&(f=`${" ".repeat(l+1)}${r.message} +${f}`),f}ur.codeFrameColumns=xi});var co={};vt(co,{__debug:()=>lo,check:()=>ao,doc:()=>Dr,format:()=>yu,formatWithCursor:()=>gu,getSupportInfo:()=>Do,util:()=>cr,version:()=>cu});var Nu=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},ne=Nu;function U(){}U.prototype={diff:function(t,r){var n,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=u.callback;typeof u=="function"&&(i=u,u={});var o=this;function s(E){return E=o.postProcess(E,u),i?(setTimeout(function(){i(E)},0),!0):E}t=this.castInput(t,u),r=this.castInput(r,u),t=this.removeEmpty(this.tokenize(t,u)),r=this.removeEmpty(this.tokenize(r,u));var a=r.length,D=t.length,l=1,p=a+D;u.maxEditLength!=null&&(p=Math.min(p,u.maxEditLength));var f=(n=u.timeout)!==null&&n!==void 0?n:1/0,d=Date.now()+f,c=[{oldPos:-1,lastComponent:void 0}],F=this.extractCommon(c[0],r,t,0,u);if(c[0].oldPos+1>=D&&F+1>=a)return s(mr(o,c[0].lastComponent,r,t,o.useLongestToken));var m=-1/0,h=1/0;function C(){for(var E=Math.max(m,-l);E<=Math.min(h,l);E+=2){var g=void 0,j=c[E-1],b=c[E+1];j&&(c[E-1]=void 0);var X=!1;if(b){var ae=b.oldPos-E;X=b&&0<=ae&&ae=D&&F+1>=a)return s(mr(o,g.lastComponent,r,t,o.useLongestToken));c[E]=g,g.oldPos+1>=D&&(h=Math.min(h,E-1)),F+1>=a&&(m=Math.max(m,E+1))}l++}if(i)(function E(){setTimeout(function(){if(l>p||Date.now()>d)return i();C()||E()},0)})();else for(;l<=p&&Date.now()<=d;){var v=C();if(v)return v}},addToPath:function(t,r,n,u,i){var o=t.lastComponent;return o&&!i.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+u,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+u,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}},extractCommon:function(t,r,n,u,i){for(var o=r.length,s=n.length,a=t.oldPos,D=a-u,l=0;D+1d.length?F:d}),p.value=e.join(f)}else p.value=e.join(r.slice(D,D+p.count));D+=p.count,p.added||(l+=p.count)}}return i}var ho=new U;function hr(e,t){var r;for(r=0;rt.length&&(r=e.length-t.length);var n=t.length;e.length0&&t[o]!=t[i];)i=u[i];t[o]==t[i]&&i++}i=0;for(var s=r;s0&&e[s]!=t[i];)i=u[i];e[s]==t[i]&&i++}return i}var ze="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Su=new RegExp("[".concat(ze,"]+|\\s+|[^").concat(ze,"]"),"ug"),Ke=new U;Ke.equals=function(e,t,r){return r.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()};Ke.tokenize=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r;if(t.intlSegmenter){if(t.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=Array.from(t.intlSegmenter.segment(e),function(i){return i.segment})}else r=e.match(Su)||[];var n=[],u=null;return r.forEach(function(i){/\s/.test(i)?u==null?n.push(i):n.push(n.pop()+i):/\s/.test(u)?n[n.length-1]==u?n.push(n.pop()+i):n.push(u+i):n.push(i),u=i}),n};Ke.join=function(e){return e.map(function(t,r){return r==0?t:t.replace(/^\s+/,"")}).join("")};Ke.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var r=null,n=null,u=null;return e.forEach(function(i){i.added?n=i:i.removed?u=i:((n||u)&&gr(r,u,n,i),r=i,n=null,u=null)}),(n||u)&&gr(r,u,n,null),e};function gr(e,t,r,n){if(t&&r){var u=t.value.match(/^\s*/)[0],i=t.value.match(/\s*$/)[0],o=r.value.match(/^\s*/)[0],s=r.value.match(/\s*$/)[0];if(e){var a=hr(u,o);e.value=wt(e.value,o,a),t.value=_e(t.value,a),r.value=_e(r.value,a)}if(n){var D=Er(i,s);n.value=Bt(n.value,s,D),t.value=Ue(t.value,D),r.value=Ue(r.value,D)}}else if(r)e&&(r.value=r.value.replace(/^\s*/,"")),n&&(n.value=n.value.replace(/^\s*/,""));else if(e&&n){var l=n.value.match(/^\s*/)[0],p=t.value.match(/^\s*/)[0],f=t.value.match(/\s*$/)[0],d=hr(l,p);t.value=_e(t.value,d);var c=Er(_e(l,d),f);t.value=Ue(t.value,c),n.value=Bt(n.value,l,c),e.value=wt(e.value,l,l.slice(0,l.length-c.length))}else if(n){var F=n.value.match(/^\s*/)[0],m=t.value.match(/\s*$/)[0],h=Cr(m,F);t.value=Ue(t.value,h)}else if(e){var C=e.value.match(/\s*$/)[0],v=t.value.match(/^\s*/)[0],E=Cr(C,v);t.value=_e(t.value,E)}}var Tu=new U;Tu.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(ze,"]+|[^\\S\\n\\r]+|[^").concat(ze,"]"),"ug");return e.match(t)||[]};var bt=new U;bt.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` +`));var r=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var u=0;u"u"?r:o}:n;return typeof e=="string"?e:JSON.stringify(xt(e,null,null,u),u," ")};xe.equals=function(e,t,r){return U.prototype.equals.call(xe,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),r)};function xt(e,t,r,n,u){t=t||[],r=r||[],n&&(e=n(u,e));var i;for(i=0;i{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},A=Pu;function Iu(e){if(typeof e=="string")return $;if(Array.isArray(e))return H;if(!e)return;let{type:t}=e;if(Je.has(t))return t}var M=Iu;var Ru=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Yu(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', +Expected it to be 'string' or 'object'.`;if(M(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Ru([...Je].map(u=>`'${u}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${n}.`}var Ot=class extends Error{name="InvalidDocError";constructor(t){super(Yu(t)),this.doc=t}},Q=Ot;var Br={};function ju(e,t,r,n){let u=[e];for(;u.length>0;){let i=u.pop();if(i===Br){r(u.pop());continue}r&&u.push(i,Br);let o=M(i);if(!o)throw new Q(i);if((t==null?void 0:t(i))!==!1)switch(o){case H:case N:{let s=o===H?i:i.parts;for(let a=s.length,D=a-1;D>=0;--D)u.push(s[D]);break}case w:u.push(i.flatContents,i.breakContents);break;case B:if(n&&i.expandedStates)for(let s=i.expandedStates.length,a=s-1;a>=0;--a)u.push(i.expandedStates[a]);else u.push(i.contents);break;case k:case T:case P:case O:case I:u.push(i.contents);break;case $:case z:case L:case R:case y:case _:break;default:throw new Q(i)}}}var Fe=ju;function Oe(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(i){if(r.has(i))return r.get(i);let o=u(i);return r.set(i,o),o}function u(i){switch(M(i)){case H:return t(i.map(n));case N:return t({...i,parts:i.parts.map(n)});case w:return t({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case B:{let{expandedStates:o,contents:s}=i;return o?(o=o.map(n),s=o[0]):s=n(s),t({...i,contents:s,expandedStates:o})}case k:case T:case P:case O:case I:return t({...i,contents:n(i.contents)});case $:case z:case L:case R:case y:case _:return t(i);default:throw new Q(i)}}}function qe(e,t,r){let n=r,u=!1;function i(o){if(u)return!1;let s=t(o);s!==void 0&&(u=!0,n=s)}return Fe(e,i),n}function Hu(e){if(e.type===B&&e.break||e.type===y&&e.hard||e.type===_)return!0}function xr(e){return qe(e,Hu,!1)}function wr(e){if(e.length>0){let t=A(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function br(e){let t=new Set,r=[];function n(i){if(i.type===_&&wr(r),i.type===B){if(r.push(i),t.has(i))return!1;t.add(i)}}function u(i){i.type===B&&r.pop().break&&wr(r)}Fe(e,n,u,!0)}function Wu(e){return e.type===y&&!e.hard?e.soft?"":" ":e.type===w?e.flatContents:e}function Nr(e){return Oe(e,Wu)}function _r(e){for(e=[...e];e.length>=2&&A(!1,e,-2).type===y&&A(!1,e,-1).type===_;)e.length-=2;if(e.length>0){let t=Ne(A(!1,e,-1));e[e.length-1]=t}return e}function Ne(e){switch(M(e)){case T:case P:case B:case I:case O:{let t=Ne(e.contents);return{...e,contents:t}}case w:return{...e,breakContents:Ne(e.breakContents),flatContents:Ne(e.flatContents)};case N:return{...e,parts:_r(e.parts)};case H:return _r(e);case $:return e.replace(/[\n\r]*$/u,"");case k:case z:case L:case R:case y:case _:break;default:throw new Q(e)}return e}function Xe(e){return Ne(Mu(e))}function $u(e){switch(M(e)){case N:if(e.parts.every(t=>t===""))return"";break;case B:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===B&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case k:case T:case P:case I:if(!e.contents)return"";break;case w:if(!e.flatContents&&!e.breakContents)return"";break;case H:{let t=[];for(let r of e){if(!r)continue;let[n,...u]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof A(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...u)}return t.length===0?"":t.length===1?t[0]:t}case $:case z:case L:case R:case y:case O:case _:break;default:throw new Q(e)}return e}function Mu(e){return Oe(e,t=>$u(t))}function Or(e,t=Qe){return Oe(e,r=>typeof r=="string"?Se(t,r.split(` +`)):r)}function Vu(e){if(e.type===y)return!0}function Sr(e){return qe(e,Vu,!1)}function me(e,t){return e.type===O?{...e,contents:t(e.contents)}:t(e)}var St=()=>{},G=St,Tt=St,Tr=St;function le(e){return G(e),{type:T,contents:e}}function De(e,t){return G(t),{type:k,contents:t,n:e}}function kt(e,t={}){return G(e),Tt(t.expandedStates,!0),{type:B,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function kr(e){return De(Number.NEGATIVE_INFINITY,e)}function Lr(e){return De({type:"root"},e)}function Pr(e){return De(-1,e)}function Ir(e,t){return kt(e[0],{...t,expandedStates:e})}function Rr(e){return Tr(e),{type:N,parts:e}}function Yr(e,t="",r={}){return G(e),t!==""&&G(t),{type:w,breakContents:e,flatContents:t,groupId:r.groupId}}function jr(e,t){return G(e),{type:P,contents:e,groupId:t.groupId,negate:t.negate}}function Te(e){return G(e),{type:I,contents:e}}var Hr={type:R},he={type:_},Wr={type:L},ke={type:y,hard:!0},Lt={type:y,hard:!0,literal:!0},Ze={type:y},$r={type:y,soft:!0},K=[ke,he],Qe=[Lt,he],Z={type:z};function Se(e,t){G(e),Tt(t);let r=[];for(let n=0;n0){for(let u=0;u0?`, { ${l.join(", ")} }`:"";return`indentIfBreak(${n(i.contents)}${p})`}if(i.type===B){let l=[];i.break&&i.break!=="propagated"&&l.push("shouldBreak: true"),i.id&&l.push(`id: ${u(i.id)}`);let p=l.length>0?`, { ${l.join(", ")} }`:"";return i.expandedStates?`conditionalGroup([${i.expandedStates.map(f=>n(f)).join(",")}]${p})`:`group(${n(i.contents)}${p})`}if(i.type===N)return`fill([${i.parts.map(l=>n(l)).join(", ")}])`;if(i.type===I)return"lineSuffix("+n(i.contents)+")";if(i.type===R)return"lineSuffixBoundary";if(i.type===O)return`label(${JSON.stringify(i.label)}, ${n(i.contents)})`;throw new Error("Unknown doc type "+i.type)}function u(i){if(typeof i!="symbol")return JSON.stringify(String(i));if(i in t)return t[i];let o=i.description||"symbol";for(let s=0;;s++){let a=o+(s>0?` #${s}`:"");if(!r.has(a))return r.add(a),t[i]=`Symbol.for(${JSON.stringify(a)})`}}}var Ur=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function zr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Gr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Kr=e=>!(zr(e)||Gr(e));var Uu=/[^\x20-\x7F]/u;function zu(e){if(!e)return 0;if(!Uu.test(e))return e.length;e=e.replace(Ur()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=Kr(n)?1:2)}return t}var Le=zu;var Y=Symbol("MODE_BREAK"),J=Symbol("MODE_FLAT"),Ee=Symbol("cursor"),Pt=Symbol("DOC_FILL_PRINTED_LENGTH");function Jr(){return{value:"",length:0,queue:[]}}function Gu(e,t){return It(e,{type:"indent"},t)}function Ku(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Jr():t<0?It(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:It(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function It(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],u="",i=0,o=0,s=0;for(let c of n)switch(c.type){case"indent":l(),r.useTabs?a(1):D(r.tabWidth);break;case"stringAlign":l(),u+=c.n,i+=c.n.length;break;case"numberAlign":o+=1,s+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return f(),{...e,value:u,length:i,queue:n};function a(c){u+=" ".repeat(c),i+=r.tabWidth*c}function D(c){u+=" ".repeat(c),i+=c}function l(){r.useTabs?p():f()}function p(){o>0&&a(o),d()}function f(){s>0&&D(s),d()}function d(){o=0,s=0}}function Rt(e){let t=0,r=0,n=e.length;e:for(;n--;){let u=e[n];if(u===Ee){r++;continue}for(let i=u.length-1;i>=0;i--){let o=u[i];if(o===" "||o===" ")t++;else{e[n]=u.slice(0,i+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Ee);return t}function tt(e,t,r,n,u,i){if(r===Number.POSITIVE_INFINITY)return!0;let o=t.length,s=[e],a=[];for(;r>=0;){if(s.length===0){if(o===0)return!0;s.push(t[--o]);continue}let{mode:D,doc:l}=s.pop(),p=M(l);switch(p){case $:a.push(l),r-=Le(l);break;case H:case N:{let f=p===H?l:l.parts,d=l[Pt]??0;for(let c=f.length-1;c>=d;c--)s.push({mode:D,doc:f[c]});break}case T:case k:case P:case O:s.push({mode:D,doc:l.contents});break;case L:r+=Rt(a);break;case B:{if(i&&l.break)return!1;let f=l.break?Y:D,d=l.expandedStates&&f===Y?A(!1,l.expandedStates,-1):l.contents;s.push({mode:f,doc:d});break}case w:{let d=(l.groupId?u[l.groupId]||J:D)===Y?l.breakContents:l.flatContents;d&&s.push({mode:D,doc:d});break}case y:if(D===Y||l.hard)return!0;l.soft||(a.push(" "),r--);break;case I:n=!0;break;case R:if(n)return!1;break}}return!1}function Ce(e,t){let r={},n=t.printWidth,u=be(t.endOfLine),i=0,o=[{ind:Jr(),mode:Y,doc:e}],s=[],a=!1,D=[],l=0;for(br(e);o.length>0;){let{ind:f,mode:d,doc:c}=o.pop();switch(M(c)){case $:{let F=u!==` +`?ne(!1,c,` +`,u):c;s.push(F),o.length>0&&(i+=Le(F));break}case H:for(let F=c.length-1;F>=0;F--)o.push({ind:f,mode:d,doc:c[F]});break;case z:if(l>=2)throw new Error("There are too many 'cursor' in doc.");s.push(Ee),l++;break;case T:o.push({ind:Gu(f,t),mode:d,doc:c.contents});break;case k:o.push({ind:Ku(f,c.n,t),mode:d,doc:c.contents});break;case L:i-=Rt(s);break;case B:switch(d){case J:if(!a){o.push({ind:f,mode:c.break?Y:J,doc:c.contents});break}case Y:{a=!1;let F={ind:f,mode:J,doc:c.contents},m=n-i,h=D.length>0;if(!c.break&&tt(F,o,m,h,r))o.push(F);else if(c.expandedStates){let C=A(!1,c.expandedStates,-1);if(c.break){o.push({ind:f,mode:Y,doc:C});break}else for(let v=1;v=c.expandedStates.length){o.push({ind:f,mode:Y,doc:C});break}else{let E=c.expandedStates[v],g={ind:f,mode:J,doc:E};if(tt(g,o,m,h,r)){o.push(g);break}}}else o.push({ind:f,mode:Y,doc:c.contents});break}}c.id&&(r[c.id]=A(!1,o,-1).mode);break;case N:{let F=n-i,m=c[Pt]??0,{parts:h}=c,C=h.length-m;if(C===0)break;let v=h[m+0],E=h[m+1],g={ind:f,mode:J,doc:v},j={ind:f,mode:Y,doc:v},b=tt(g,[],F,D.length>0,r,!0);if(C===1){b?o.push(g):o.push(j);break}let X={ind:f,mode:J,doc:E},ae={ind:f,mode:Y,doc:E};if(C===2){b?o.push(X,g):o.push(ae,j);break}let $e=h[m+2],At={ind:f,mode:d,doc:{...c,[Pt]:m+2}};tt({ind:f,mode:J,doc:[v,E,$e]},[],F,D.length>0,r,!0)?o.push(At,X,g):b?o.push(At,ae,g):o.push(At,ae,j);break}case w:case P:{let F=c.groupId?r[c.groupId]:d;if(F===Y){let m=c.type===w?c.breakContents:c.negate?c.contents:le(c.contents);m&&o.push({ind:f,mode:d,doc:m})}if(F===J){let m=c.type===w?c.flatContents:c.negate?le(c.contents):c.contents;m&&o.push({ind:f,mode:d,doc:m})}break}case I:D.push({ind:f,mode:d,doc:c.contents});break;case R:D.length>0&&o.push({ind:f,mode:d,doc:ke});break;case y:switch(d){case J:if(c.hard)a=!0;else{c.soft||(s.push(" "),i+=1);break}case Y:if(D.length>0){o.push({ind:f,mode:d,doc:c},...D.reverse()),D.length=0;break}c.literal?f.root?(s.push(u,f.root.value),i=f.root.length):(s.push(u),i=0):(i-=Rt(s),s.push(u+f.value),i=f.length);break}break;case O:o.push({ind:f,mode:d,doc:c.contents});break;case _:break;default:throw new Q(c)}o.length===0&&D.length>0&&(o.push(...D.reverse()),D.length=0)}let p=s.indexOf(Ee);if(p!==-1){let f=s.indexOf(Ee,p+1);if(f===-1)return{formatted:s.filter(m=>m!==Ee).join("")};let d=s.slice(0,p).join(""),c=s.slice(p+1,f).join(""),F=s.slice(f+1).join("");return{formatted:d+c+F,cursorNodeStart:d.length,cursorNodeText:c}}return{formatted:s.join("")}}function Ju(e,t,r=0){let n=0;for(let u=r;u1?A(!1,t,-2):null}getValue(){return A(!1,this.stack,-1)}getNode(t=0){let r=pe(this,te,jt).call(this,t);return r===-1?null:this.stack[r]}getParentNode(t=0){return this.getNode(t+1)}call(t,...r){let{stack:n}=this,{length:u}=n,i=A(!1,n,-1);for(let o of r)i=i[o],n.push(o,i);try{return t(this)}finally{n.length=u}}callParent(t,r=0){let n=pe(this,te,jt).call(this,r+1),u=this.stack.splice(n+1);try{return t(this)}finally{this.stack.push(...u)}}each(t,...r){let{stack:n}=this,{length:u}=n,i=A(!1,n,-1);for(let o of r)i=i[o],n.push(o,i);try{for(let o=0;o{n[i]=t(u,i,o)},...r),n}match(...t){let r=this.stack.length-1,n=null,u=this.stack[r--];for(let i of t){if(u===void 0)return!1;let o=null;if(typeof n=="number"&&(o=n,n=this.stack[r--],u=this.stack[r--]),i&&!i(u,n,o))return!1;n=this.stack[r--],u=this.stack[r--]}return!0}findAncestor(t){for(let r of pe(this,te,rt).call(this))if(t(r))return r}hasAncestor(t){for(let r of pe(this,te,rt).call(this))if(t(r))return!0;return!1}};te=new WeakSet,jt=function(t){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--t<0)return n;return-1},rt=function*(){let{stack:t}=this;for(let r=t.length-3;r>=0;r-=2){let n=t[r];Array.isArray(n)||(yield n)}};var qr=Yt;var Xr=new Proxy(()=>{},{get:()=>Xr}),Pe=Xr;function qu(e){return e!==null&&typeof e=="object"}var Qr=qu;function*ye(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,u=i=>Qr(i)&&n(i);for(let i of r(e)){let o=e[i];if(Array.isArray(o))for(let s of o)u(s)&&(yield s);else u(o)&&(yield o)}}function*Zr(e,t){let r=[e];for(let n=0;n{let u=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:i}=t,o=r;for(;o>=0&&o0}var Ht=Zu;var rn=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),ei=e=>Object.keys(e).filter(t=>!rn.has(t));function ti(e){return e?t=>e(t,rn):ei}var q=ti;function ri(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Wt(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=ri(e)}function ue(e,t){t.leading=!0,t.trailing=!1,Wt(e,t)}function re(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Wt(e,t)}function ie(e,t){t.leading=!1,t.trailing=!0,Wt(e,t)}var $t=new WeakMap;function it(e,t){if($t.has(e))return $t.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:u},locStart:i,locEnd:o}=t;if(!n)return[];let s=((r==null?void 0:r(e,t))??[...ye(e,{getVisitorKeys:q(u)})]).flatMap(a=>n(a)?[a]:it(a,t));return s.sort((a,D)=>i(a)-i(D)||o(a)-o(D)),$t.set(e,s),s}function un(e,t,r,n){let{locStart:u,locEnd:i}=r,o=u(t),s=i(t),a=it(e,r),D,l,p=0,f=a.length;for(;p>1,c=a[d],F=u(c),m=i(c);if(F<=o&&s<=m)return un(c,t,r,c);if(m<=o){D=c,p=d+1;continue}if(s<=F){l=c,f=d;continue}throw new Error("Comment location overlaps with node location")}if((n==null?void 0:n.type)==="TemplateLiteral"){let{quasis:d}=n,c=Vt(d,t,r);D&&Vt(d,D,r)!==c&&(D=null),l&&Vt(d,l,r)!==c&&(l=null)}return{enclosingNode:n,precedingNode:D,followingNode:l}}var Mt=()=>!1;function on(e,t){let{comments:r}=e;if(delete e.comments,!Ht(r)||!t.printer.canAttachComment)return;let n=[],{locStart:u,locEnd:i,printer:{experimentalFeatures:{avoidAstMutation:o=!1}={},handleComments:s={}},originalText:a}=t,{ownLine:D=Mt,endOfLine:l=Mt,remaining:p=Mt}=s,f=r.map((d,c)=>({...un(e,d,t),comment:d,text:a,options:t,ast:e,isLastComment:r.length-1===c}));for(let[d,c]of f.entries()){let{comment:F,precedingNode:m,enclosingNode:h,followingNode:C,text:v,options:E,ast:g,isLastComment:j}=c;if(E.parser==="json"||E.parser==="json5"||E.parser==="jsonc"||E.parser==="__js_expression"||E.parser==="__ts_expression"||E.parser==="__vue_expression"||E.parser==="__vue_ts_expression"){if(u(F)-u(g)<=0){ue(g,F);continue}if(i(F)-i(g)>=0){ie(g,F);continue}}let b;if(o?b=[c]:(F.enclosingNode=h,F.precedingNode=m,F.followingNode=C,b=[F,v,E,g,j]),ni(v,E,f,d))F.placement="ownLine",D(...b)||(C?ue(C,F):m?ie(m,F):h?re(h,F):re(g,F));else if(ui(v,E,f,d))F.placement="endOfLine",l(...b)||(m?ie(m,F):C?ue(C,F):h?re(h,F):re(g,F));else if(F.placement="remaining",!p(...b))if(m&&C){let X=n.length;X>0&&n[X-1].followingNode!==C&&nn(n,E),n.push(c)}else m?ie(m,F):C?ue(C,F):h?re(h,F):re(g,F)}if(nn(n,t),!o)for(let d of r)delete d.precedingNode,delete d.enclosingNode,delete d.followingNode}var sn=e=>!/[\S\n\u2028\u2029]/u.test(e);function ni(e,t,r,n){let{comment:u,precedingNode:i}=r[n],{locStart:o,locEnd:s}=t,a=o(u);if(i)for(let D=n-1;D>=0;D--){let{comment:l,precedingNode:p}=r[D];if(p!==i||!sn(e.slice(s(l),a)))break;a=o(l)}return V(e,a,{backwards:!0})}function ui(e,t,r,n){let{comment:u,followingNode:i}=r[n],{locStart:o,locEnd:s}=t,a=s(u);if(i)for(let D=n+1;D0;--o){let{comment:D,precedingNode:l,followingNode:p}=e[o-1];Pe.strictEqual(l,n),Pe.strictEqual(p,u);let f=t.originalText.slice(t.locEnd(D),i);if(((a=(s=t.printer).isGap)==null?void 0:a.call(s,f,t))??/^[\s(]*$/u.test(f))i=t.locStart(D);else break}for(let[D,{comment:l}]of e.entries())D1&&D.comments.sort((l,p)=>t.locStart(l)-t.locStart(p));e.length=0}function Vt(e,t,r){let n=r.locStart(t)-1;for(let u=1;u!n.has(a)).length===0)return{leading:"",trailing:""};let i=[],o=[],s;return e.each(()=>{let a=e.node;if(n!=null&&n.has(a))return;let{leading:D,trailing:l}=a;D?i.push(oi(e,t)):l&&(s=si(e,t,s),o.push(s.doc))},"comments"),{leading:i,trailing:o}}function Dn(e,t,r){let{leading:n,trailing:u}=ai(e,r);return!n&&!u?t:me(t,i=>[n,i,u])}function ln(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:r}=e;for(let n of t){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed}}function Di(e){return()=>{}}var cn=Di;var Re=class extends Error{name="ConfigError"},Ye=class extends Error{name="UndefinedParserError"};var fn={cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing +(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive). +The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset. +The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment +in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function ot({plugins:e=[],showDeprecated:t=!1}={}){let r=e.flatMap(u=>u.languages??[]),n=[];for(let u of ci(Object.assign({},...e.map(({options:i})=>i),fn)))!t&&u.deprecated||(Array.isArray(u.choices)&&(t||(u.choices=u.choices.filter(i=>!i.deprecated)),u.name==="parser"&&(u.choices=[...u.choices,...li(u.choices,r,e)])),u.pluginDefaults=Object.fromEntries(e.filter(i=>{var o;return((o=i.defaultOptions)==null?void 0:o[u.name])!==void 0}).map(i=>[i.name,i.defaultOptions[u.name]])),n.push(u));return{languages:r,options:n}}function*li(e,t,r){let n=new Set(e.map(u=>u.value));for(let u of t)if(u.parsers){for(let i of u.parsers)if(!n.has(i)){n.add(i);let o=r.find(a=>a.parsers&&Object.prototype.hasOwnProperty.call(a.parsers,i)),s=u.name;o!=null&&o.name&&(s+=` (plugin: ${o.name})`),yield{value:i,description:s}}}}function ci(e){let t=[];for(let[r,n]of Object.entries(e)){let u={name:r,...n};Array.isArray(u.default)&&(u.default=A(!1,u.default,-1).value),t.push(u)}return t}var fi=e=>String(e).split(/[/\\]/u).pop();function dn(e,t){if(!t)return;let r=fi(t).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(u=>u.toLowerCase()===r))??e.find(({extensions:n})=>n==null?void 0:n.some(u=>r.endsWith(u)))}function di(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r==null?void 0:r.includes(t))??e.find(({extensions:r})=>r==null?void 0:r.includes(`.${t}`))}function pi(e,t){let r=e.plugins.flatMap(u=>u.languages??[]),n=di(r,t.language)??dn(r,t.physicalFile)??dn(r,t.file)??(t.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var pn=pi;var oe={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(r=>oe.value(r)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(r=>`${oe.key(r)}: ${oe.value(e[r])}`).join(", ")} }`},pair:({key:e,value:t})=>oe.value({[e]:t})};var Ut=Ve(st(),1),hn=(e,t,{descriptor:r})=>{let n=[`${Ut.default.yellow(typeof e=="string"?r.key(e):r.pair(e))} is deprecated`];return t&&n.push(`we now treat it as ${Ut.default.blue(typeof t=="string"?r.key(t):r.pair(t))}`),n.join("; ")+"."};var ce=Ve(st(),1);var at=Symbol.for("vnopts.VALUE_NOT_EXIST"),ve=Symbol.for("vnopts.VALUE_UNCHANGED");var En=" ".repeat(2),gn=(e,t,r)=>{let{text:n,list:u}=r.normalizeExpectedResult(r.schemas[e].expected(r)),i=[];return n&&i.push(Cn(e,t,n,r.descriptor)),u&&i.push([Cn(e,t,u.title,r.descriptor)].concat(u.values.map(o=>yn(o,r.loggerPrintWidth))).join(` +`)),An(i,r.loggerPrintWidth)};function Cn(e,t,r,n){return[`Invalid ${ce.default.red(n.key(e))} value.`,`Expected ${ce.default.blue(r)},`,`but received ${t===at?ce.default.gray("nothing"):ce.default.red(n.value(t))}.`].join(" ")}function yn({text:e,list:t},r){let n=[];return e&&n.push(`- ${ce.default.blue(e)}`),t&&n.push([`- ${ce.default.blue(t.title)}:`].concat(t.values.map(u=>yn(u,r-En.length).replace(/^|\n/g,`$&${En}`))).join(` +`)),An(n,r)}function An(e,t){if(e.length===1)return e[0];let[r,n]=e,[u,i]=e.map(o=>o.split(` +`,1)[0].length);return u>t&&u>i?n:r}var Kt=Ve(st(),1);var zt=[],vn=[];function Gt(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,u=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-u);)n--,u--;let i=0;for(;is?D>s?s+1:D:D>a?a+1:D;return s}var Dt=(e,t,{descriptor:r,logger:n,schemas:u})=>{let i=[`Ignored unknown option ${Kt.default.yellow(r.pair({key:e,value:t}))}.`],o=Object.keys(u).sort().find(s=>Gt(e,s)<3);o&&i.push(`Did you mean ${Kt.default.blue(r.key(o))}?`),n.warn(i.join(" "))};var Fi=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function mi(e,t){let r=new e(t),n=Object.create(r);for(let u of Fi)u in t&&(n[u]=hi(t[u],r,x.prototype[u].length));return n}var x=class{static create(t){return mi(this,t)}constructor(t){this.name=t.name}default(t){}expected(t){return"nothing"}validate(t,r){return!1}deprecated(t,r){return!1}forward(t,r){}redirect(t,r){}overlap(t,r,n){return t}preprocess(t,r){return t}postprocess(t,r){return ve}};function hi(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var lt=class extends x{constructor(t){super(t),this._sourceName=t.sourceName}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,r){return r.schemas[this._sourceName].validate(t,r)}redirect(t,r){return this._sourceName}};var ct=class extends x{expected(){return"anything"}validate(){return!0}};var ft=class extends x{constructor({valueSchema:t,name:r=t.name,...n}){super({...n,name:r}),this._valueSchema=t}expected(t){let{text:r,list:n}=t.normalizeExpectedResult(this._valueSchema.expected(t));return{text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t,r){if(!Array.isArray(t))return!1;let n=[];for(let u of t){let i=r.normalizeValidateResult(this._valueSchema.validate(u,r),u);i!==!0&&n.push(i.value)}return n.length===0?!0:{value:n}}deprecated(t,r){let n=[];for(let u of t){let i=r.normalizeDeprecatedResult(this._valueSchema.deprecated(u,r),u);i!==!1&&n.push(...i.map(({value:o})=>({value:[o]})))}return n}forward(t,r){let n=[];for(let u of t){let i=r.normalizeForwardResult(this._valueSchema.forward(u,r),u);n.push(...i.map(Bn))}return n}redirect(t,r){let n=[],u=[];for(let i of t){let o=r.normalizeRedirectResult(this._valueSchema.redirect(i,r),i);"remain"in o&&n.push(o.remain),u.push(...o.redirect.map(Bn))}return n.length===0?{redirect:u}:{redirect:u,remain:n}}overlap(t,r){return t.concat(r)}};function Bn({from:e,to:t}){return{from:[e],to:t}}var dt=class extends x{expected(){return"true or false"}validate(t){return typeof t=="boolean"}};function _n(e,t){let r=Object.create(null);for(let n of e){let u=n[t];if(r[u])throw new Error(`Duplicate ${t} ${JSON.stringify(u)}`);r[u]=n}return r}function xn(e,t){let r=new Map;for(let n of e){let u=n[t];if(r.has(u))throw new Error(`Duplicate ${t} ${JSON.stringify(u)}`);r.set(u,n)}return r}function bn(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?!0:(e[r]=!0,!1)}}function Nn(e,t){let r=[],n=[];for(let u of e)t(u)?r.push(u):n.push(u);return[r,n]}function On(e){return e===Math.floor(e)}function Sn(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,u=["undefined","object","boolean","number","string"];return r!==n?u.indexOf(r)-u.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function Tn(e){return(...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function Jt(e){return e===void 0?{}:e}function qt(e){if(typeof e=="string")return{text:e};let{text:t,list:r}=e;return Ei((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map(qt)}}:{text:t}}function Xt(e,t){return e===!0?!0:e===!1?{value:t}:e}function Qt(e,t,r=!1){return e===!1?!1:e===!0?r?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function wn(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function pt(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>wn(r,t)):[wn(e,t)]}function Zt(e,t){let r=pt(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function Ei(e,t){if(!e)throw new Error(t)}var Ft=class extends x{constructor(t){super(t),this._choices=xn(t.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value")}expected({descriptor:t}){let r=Array.from(this._choices.keys()).map(o=>this._choices.get(o)).filter(({hidden:o})=>!o).map(o=>o.value).sort(Sn).map(t.value),n=r.slice(0,-2),u=r.slice(-2);return{text:n.concat(u.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(t){return this._choices.has(t)}deprecated(t){let r=this._choices.get(t);return r&&r.deprecated?{value:t}:!1}forward(t){let r=this._choices.get(t);return r?r.forward:void 0}redirect(t){let r=this._choices.get(t);return r?r.redirect:void 0}};var mt=class extends x{expected(){return"a number"}validate(t,r){return typeof t=="number"}};var ht=class extends mt{expected(){return"an integer"}validate(t,r){return r.normalizeValidateResult(super.validate(t,r),t)===!0&&On(t)}};var je=class extends x{expected(){return"a string"}validate(t){return typeof t=="string"}};var kn=oe,Ln=Dt,Pn=gn,In=hn;var Et=class{constructor(t,r){let{logger:n=console,loggerPrintWidth:u=80,descriptor:i=kn,unknown:o=Ln,invalid:s=Pn,deprecated:a=In,missing:D=()=>!1,required:l=()=>!1,preprocess:p=d=>d,postprocess:f=()=>ve}=r||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:u,schemas:_n(t,"name"),normalizeDefaultResult:Jt,normalizeExpectedResult:qt,normalizeDeprecatedResult:Qt,normalizeForwardResult:pt,normalizeRedirectResult:Zt,normalizeValidateResult:Xt},this._unknownHandler=o,this._invalidHandler=Tn(s),this._deprecatedHandler=a,this._identifyMissing=(d,c)=>!(d in c)||D(d,c),this._identifyRequired=l,this._preprocess=p,this._postprocess=f,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=bn()}normalize(t){let r={},u=[this._preprocess(t,this._utils)],i=()=>{for(;u.length!==0;){let o=u.shift(),s=this._applyNormalization(o,r);u.push(...s)}};i();for(let o of Object.keys(this._utils.schemas)){let s=this._utils.schemas[o];if(!(o in r)){let a=Jt(s.default(this._utils));"value"in a&&u.push({[o]:a.value})}}i();for(let o of Object.keys(this._utils.schemas)){if(!(o in r))continue;let s=this._utils.schemas[o],a=r[o],D=s.postprocess(a,this._utils);D!==ve&&(this._applyValidation(D,o,s),r[o]=D)}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(t,r){let n=[],{knownKeys:u,unknownKeys:i}=this._partitionOptionKeys(t);for(let o of u){let s=this._utils.schemas[o],a=s.preprocess(t[o],this._utils);this._applyValidation(a,o,s);let D=({from:d,to:c})=>{n.push(typeof c=="string"?{[c]:d}:{[c.key]:c.value})},l=({value:d,redirectTo:c})=>{let F=Qt(s.deprecated(d,this._utils),a,!0);if(F!==!1)if(F===!0)this._hasDeprecationWarned(o)||this._utils.logger.warn(this._deprecatedHandler(o,c,this._utils));else for(let{value:m}of F){let h={key:o,value:m};if(!this._hasDeprecationWarned(h)){let C=typeof c=="string"?{key:c,value:m}:c;this._utils.logger.warn(this._deprecatedHandler(h,C,this._utils))}}};pt(s.forward(a,this._utils),a).forEach(D);let f=Zt(s.redirect(a,this._utils),a);if(f.redirect.forEach(D),"remain"in f){let d=f.remain;r[o]=o in r?s.overlap(r[o],d,this._utils):d,l({value:d})}for(let{from:d,to:c}of f.redirect)l({value:d,redirectTo:c})}for(let o of i){let s=t[o];this._applyUnknownHandler(o,s,r,(a,D)=>{n.push({[a]:D})})}return n}_applyRequiredCheck(t){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,t)&&this._identifyRequired(r))throw this._invalidHandler(r,at,this._utils)}_partitionOptionKeys(t){let[r,n]=Nn(Object.keys(t).filter(u=>!this._identifyMissing(u,t)),u=>u in this._utils.schemas);return{knownKeys:r,unknownKeys:n}}_applyValidation(t,r,n){let u=Xt(n.validate(t,this._utils),t);if(u!==!0)throw this._invalidHandler(r,u.value,this._utils)}_applyUnknownHandler(t,r,n,u){let i=this._unknownHandler(t,r,this._utils);if(i)for(let o of Object.keys(i)){if(this._identifyMissing(o,i))continue;let s=i[o];o in this._utils.schemas?u(o,s):n[o]=s}}_applyPostprocess(t){let r=this._postprocess(t,this._utils);if(r!==ve){if(r.delete)for(let n of r.delete)delete t[n];if(r.override){let{knownKeys:n,unknownKeys:u}=this._partitionOptionKeys(r.override);for(let i of n){let o=r.override[i];this._applyValidation(o,i,this._utils.schemas[i]),t[i]=o}for(let i of u){let o=r.override[i];this._applyUnknownHandler(i,o,t,(s,a)=>{let D=this._utils.schemas[s];this._applyValidation(a,s,D),t[s]=a})}}}}};var er;function gi(e,t,{logger:r=!1,isCLI:n=!1,passThrough:u=!1,FlagSchema:i,descriptor:o}={}){if(n){if(!i)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=oe;let s=u?Array.isArray(u)?(f,d)=>u.includes(f)?{[f]:d}:void 0:(f,d)=>({[f]:d}):(f,d,c)=>{let{_:F,...m}=c.schemas;return Dt(f,d,{...c,schemas:m})},a=yi(t,{isCLI:n,FlagSchema:i}),D=new Et(a,{logger:r,unknown:s,descriptor:o}),l=r!==!1;l&&er&&(D._hasDeprecationWarned=er);let p=D.normalize(e);return l&&(er=D._hasDeprecationWarned),p}function yi(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(ct.create({name:"_"}));for(let u of e)n.push(Ai(u,{isCLI:t,optionInfos:e,FlagSchema:r})),u.alias&&t&&n.push(lt.create({name:u.alias,sourceName:u.name}));return n}function Ai(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:u}=e,i={name:u},o,s={};switch(e.type){case"int":o=ht,t&&(i.preprocess=Number);break;case"string":o=je;break;case"choice":o=Ft,i.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case"boolean":o=dt;break;case"flag":o=n,i.flags=r.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case"path":o=je;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?i.validate=(a,D,l)=>e.exception(a)||D.validate(a,l):i.validate=(a,D,l)=>a===void 0||D.validate(a,l),e.redirect&&(s.redirect=a=>a?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let a=i.preprocess||(D=>D);i.preprocess=(D,l,p)=>l.preprocess(a(Array.isArray(D)?A(!1,D,-1):D),p)}return e.array?ft.create({...t?{preprocess:a=>Array.isArray(a)?a:[a]}:{},...s,valueSchema:o.create(i)}):o.create({...i,...s})}var Rn=gi;var vi=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let u=t[n];if(r(u,n,t))return u}}},tr=vi;function rr(e,t){if(!t)throw new Error("parserName is required.");let r=tr(!1,e,u=>u.parsers&&Object.prototype.hasOwnProperty.call(u.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Re(n)}function Yn(e,t){if(!t)throw new Error("astFormat is required.");let r=tr(!1,e,u=>u.printers&&Object.prototype.hasOwnProperty.call(u.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Re(n)}function Ct({plugins:e,parser:t}){let r=rr(e,t);return nr(r,t)}function nr(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function jn(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var Hn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function Bi(e,t={}){var p;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=pn(r,{physicalFile:r.filepath}),!r.parser)throw new Ye(`No parser could be inferred for file "${r.filepath}".`)}else throw new Ye("No parser and no file path given, couldn't infer a parser.");let n=ot({plugins:e.plugins,showDeprecated:!0}).options,u={...Hn,...Object.fromEntries(n.filter(f=>f.default!==void 0).map(f=>[f.name,f.default]))},i=rr(r.plugins,r.parser),o=await nr(i,r.parser);r.astFormat=o.astFormat,r.locEnd=o.locEnd,r.locStart=o.locStart;let s=(p=i.printers)!=null&&p[o.astFormat]?i:Yn(r.plugins,o.astFormat),a=await jn(s,o.astFormat);r.printer=a;let D=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,f])=>f!==void 0)):{},l={...u,...D};for(let[f,d]of Object.entries(l))(r[f]===null||r[f]===void 0)&&(r[f]=d);return r.parser==="json"&&(r.trailingComma="none"),Rn(r,n,{passThrough:Object.keys(Hn),...t})}var se=Bi;var Mn=Ve($n(),1);async function bi(e,t){let r=await Ct(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let u;try{u=await r.parse(n,t,t)}catch(i){Ni(i,e)}return{text:n,ast:u}}function Ni(e,t){let{loc:r}=e;if(r){let n=(0,Mn.codeFrameColumns)(t,r,{highlightCode:!0});throw e.message+=` +`+n,e.codeFrame=n,e}throw e}var fe=bi;async function Vn(e,t,r,n,u){let{embeddedLanguageFormatting:i,printer:{embed:o,hasPrettierIgnore:s=()=>!1,getVisitorKeys:a}}=r;if(!o||i!=="auto")return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let D=q(o.getVisitorKeys??a),l=[];d();let p=e.stack;for(let{print:c,node:F,pathStack:m}of l)try{e.stack=m;let h=await c(f,t,e,r);h&&u.set(F,h)}catch(h){if(globalThis.PRETTIER_DEBUG)throw h}e.stack=p;function f(c,F){return Oi(c,F,r,n)}function d(){let{node:c}=e;if(c===null||typeof c!="object"||s(e))return;for(let m of D(c))Array.isArray(c[m])?e.each(d,m):e.call(d,m);let F=o(e,r);if(F){if(typeof F=="function"){l.push({print:F,node:c,pathStack:[...e.stack]});return}u.set(c,F)}}}async function Oi(e,t,r,n){let u=await se({...r,...t,parentParser:r.parser,originalText:e},{passThrough:!0}),{ast:i}=await fe(e,u),o=await n(i,u);return Xe(o)}function Si(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:u,locEnd:i,[Symbol.for("printedComments")]:o}=t,{node:s}=e,a=u(s),D=i(s);for(let l of n)u(l)>=a&&i(l)<=D&&o.add(l);return r.slice(a,D)}var Un=Si;async function He(e,t){({ast:e}=await ir(e,t));let r=new Map,n=new qr(e),u=cn(t),i=new Map;await Vn(n,s,t,He,i);let o=await zn(n,t,s,void 0,i);if(ln(t),t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Z,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Z];return o;function s(D,l){return D===void 0||D===n?a(l):Array.isArray(D)?n.call(()=>a(l),...D):n.call(()=>a(l),D)}function a(D){u(n);let l=n.node;if(l==null)return"";let p=l&&typeof l=="object"&&D===void 0;if(p&&r.has(l))return r.get(l);let f=zn(n,t,s,D,i);return p&&r.set(l,f),f}}function zn(e,t,r,n,u){var a;let{node:i}=e,{printer:o}=t,s;switch((a=o.hasPrettierIgnore)!=null&&a.call(o,e)?s=Un(e,t):u.has(i)?s=u.get(i):s=o.print(e,t,r,n),i){case t.cursorNode:s=me(s,D=>[Z,D,Z]);break;case t.nodeBeforeCursor:s=me(s,D=>[D,Z]);break;case t.nodeAfterCursor:s=me(s,D=>[Z,D]);break}return o.printComment&&(!o.willPrintOwnComments||!o.willPrintOwnComments(e,t))&&(s=Dn(e,s,t)),s}async function ir(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("tokens")]=e.tokens??[],t[Symbol.for("printedComments")]=new Set,on(e,t);let{printer:{preprocess:n}}=t;return e=n?await n(e,t):e,{ast:e,comments:r}}function Ti(e,t){let{cursorOffset:r,locStart:n,locEnd:u}=t,i=q(t.printer.getVisitorKeys),o=d=>n(d)<=r&&u(d)>=r,s=e,a=[e];for(let d of Zr(e,{getVisitorKeys:i,filter:o}))a.push(d),s=d;if(en(s,{getVisitorKeys:i}))return{cursorNode:s};let D,l,p=-1,f=Number.POSITIVE_INFINITY;for(;a.length>0&&(D===void 0||l===void 0);){s=a.pop();let d=D!==void 0,c=l!==void 0;for(let F of ye(s,{getVisitorKeys:i})){if(!d){let m=u(F);m<=r&&m>p&&(D=F,p=m)}if(!c){let m=n(F);m>=r&&mo(f,a)).filter(Boolean);let D={},l=new Set(u(s));for(let f in s)!Object.prototype.hasOwnProperty.call(s,f)||i.has(f)||(l.has(f)?D[f]=o(s[f],s):D[f]=s[f]);let p=r(s,D,a);if(p!==null)return p??D}}var Kn=ki;var Li=(e,t,r)=>{if(!(e&&t==null)){if(t.findLastIndex)return t.findLastIndex(r);for(let n=t.length-1;n>=0;n--){let u=t[n];if(r(u,n,t))return n}return-1}},Jn=Li;var Pi=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function Ii(e,t){let r=[e.node,...e.parentNodes],n=new Set([t.node,...t.parentNodes]);return r.find(u=>Qn.has(u.type)&&n.has(u))}function qn(e){let t=Jn(!1,e,r=>r.type!=="Program"&&r.type!=="File");return t===-1?e:e.slice(0,t+1)}function Ri(e,t,{locStart:r,locEnd:n}){let u=e.node,i=t.node;if(u===i)return{startNode:u,endNode:i};let o=r(e.node);for(let a of qn(t.parentNodes))if(r(a)>=o)i=a;else break;let s=n(t.node);for(let a of qn(e.parentNodes)){if(n(a)<=s)u=a;else break;if(u===i)break}return{startNode:u,endNode:i}}function or(e,t,r,n,u=[],i){let{locStart:o,locEnd:s}=r,a=o(e),D=s(e);if(!(t>D||tn);let s=e.slice(n,u).search(/\S/u),a=s===-1;if(!a)for(n+=s;u>n&&!/\S/u.test(e[u-1]);--u);let D=or(r,n,t,(d,c)=>Xn(t,d,c),[],"rangeStart"),l=a?D:or(r,u,t,d=>Xn(t,d),[],"rangeEnd");if(!D||!l)return{rangeStart:0,rangeEnd:0};let p,f;if(Pi(t)){let d=Ii(D,l);p=d,f=d}else({startNode:p,endNode:f}=Ri(D,l,t));return{rangeStart:Math.min(i(p),i(f)),rangeEnd:Math.max(o(p),o(f))}}var nu="\uFEFF",eu=Symbol("cursor");async function uu(e,t,r=0){if(!e||e.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:u}=await fe(e,t);t.cursorOffset>=0&&(t={...t,...Gn(n,t)});let i=await He(n,t,r);r>0&&(i=et([K,i],r,t.tabWidth));let o=Ce(i,t);if(r>0){let a=o.formatted.trim();o.cursorNodeStart!==void 0&&(o.cursorNodeStart-=o.formatted.indexOf(a),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>a.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=a+be(t.endOfLine)}let s=t[Symbol.for("comments")];if(t.cursorOffset>=0){let a,D,l,p;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(l=o.cursorNodeStart,p=o.cursorNodeText,t.cursorNode)a=t.locStart(t.cursorNode),D=u.slice(a,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");a=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let h=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):u.length;D=u.slice(a,h)}else a=0,D=u,l=0,p=o.formatted;let f=t.cursorOffset-a;if(D===p)return{formatted:o.formatted,cursorOffset:l+f,comments:s};let d=D.split("");d.splice(f,0,eu);let c=p.split(""),F=yr(d,c),m=l;for(let h of F)if(h.removed){if(h.value.includes(eu))break}else m+=h.count;return{formatted:o.formatted,cursorOffset:m,comments:s}}return{formatted:o.formatted,cursorOffset:-1,comments:s}}async function Hi(e,t){let{ast:r,text:n}=await fe(e,t),{rangeStart:u,rangeEnd:i}=Zn(n,t,r),o=n.slice(u,i),s=Math.min(u,n.lastIndexOf(` +`,u)+1),a=n.slice(s,u).match(/^\s*/u)[0],D=ge(a,t.tabWidth),l=await uu(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>u&&t.cursorOffset<=i?t.cursorOffset-u:-1,endOfLine:"lf"},D),p=l.formatted.trimEnd(),{cursorOffset:f}=t;f>i?f+=p.length-o.length:l.cursorOffset>=0&&(f=l.cursorOffset+u);let d=n.slice(0,u)+p+n.slice(i);if(t.endOfLine!=="lf"){let c=be(t.endOfLine);f>=0&&c===`\r +`&&(f+=Nt(d.slice(0,f),` +`)),d=ne(!1,d,` +`,c)}return{formatted:d,cursorOffset:f,comments:l.comments}}function sr(e,t,r){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?r:t}function tu(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:u}=t;return r=sr(e,r,-1),n=sr(e,n,0),u=sr(e,u,e.length),{...t,cursorOffset:r,rangeStart:n,rangeEnd:u}}function iu(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:i}=tu(e,t),o=e.charAt(0)===nu;if(o&&(e=e.slice(1),r--,n--,u--),i==="auto"&&(i=Ar(e)),e.includes("\r")){let s=a=>Nt(e.slice(0,Math.max(a,0)),`\r +`);r-=s(r),n-=s(n),u-=s(u),e=vr(e)}return{hasBOM:o,text:e,options:tu(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:i})}}async function ru(e,t){let r=await Ct(t);return!r.hasPragma||r.hasPragma(e)}async function ar(e,t){let{hasBOM:r,text:n,options:u}=iu(e,await se(t));if(u.rangeStart>=u.rangeEnd&&n!==""||u.requirePragma&&!await ru(n,u))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let i;return u.rangeStart>0||u.rangeEnd=0&&i.cursorOffset++),i}async function ou(e,t,r){let{text:n,options:u}=iu(e,await se(t)),i=await fe(n,u);return r&&(r.preprocessForPrint&&(i.ast=await ir(i.ast,u)),r.massage&&(i.ast=Kn(i.ast,u))),i}async function su(e,t){t=await se(t);let r=await He(e,t);return Ce(r,t)}async function au(e,t){let r=Vr(e),{formatted:n}=await ar(r,{...t,parser:"__js_expression"});return n}async function Du(e,t){t=await se(t);let{ast:r}=await fe(e,t);return He(r,t)}async function lu(e,t){return Ce(e,await se(t))}var Dr={};vt(Dr,{builders:()=>$i,printer:()=>Mi,utils:()=>Vi});var $i={join:Se,line:Ze,softline:$r,hardline:K,literalline:Qe,group:kt,conditionalGroup:Ir,fill:Rr,lineSuffix:Te,lineSuffixBoundary:Hr,cursor:Z,breakParent:he,ifBreak:Yr,trim:Wr,indent:le,indentIfBreak:jr,align:De,addAlignmentToDoc:et,markAsRoot:Lr,dedentToRoot:kr,dedent:Pr,hardlineWithoutBreakParent:ke,literallineWithoutBreakParent:Lt,label:Mr,concat:e=>e},Mi={printDocToString:Ce},Vi={willBreak:xr,traverseDoc:Fe,findInDoc:qe,mapDoc:Oe,removeLines:Nr,stripTrailingHardline:Xe,replaceEndOfLine:Or,canBreak:Sr};var cu="3.5.3";var cr={};vt(cr,{addDanglingComment:()=>re,addLeadingComment:()=>ue,addTrailingComment:()=>ie,getAlignmentSize:()=>ge,getIndentSize:()=>fu,getMaxContinuousCount:()=>du,getNextNonSpaceNonCommentCharacter:()=>pu,getNextNonSpaceNonCommentCharacterIndex:()=>no,getPreferredQuote:()=>mu,getStringWidth:()=>Le,hasNewline:()=>V,hasNewlineInRange:()=>hu,hasSpaces:()=>Eu,isNextLineEmpty:()=>so,isNextLineEmptyAfterIndex:()=>gt,isPreviousLineEmpty:()=>io,makeString:()=>Cu,skip:()=>Ae,skipEverythingButNewLine:()=>ut,skipInlineComment:()=>Be,skipNewline:()=>W,skipSpaces:()=>S,skipToLineEnd:()=>nt,skipTrailingComment:()=>we,skipWhitespace:()=>tn});function Ui(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;rMath.max(n,u.length/t.length),0)}var du=qi;function Xi(e,t){let r=We(e,t);return r===!1?"":e.charAt(r)}var pu=Xi;var yt="'",Fu='"';function Qi(e,t){let r=t===!0||t===yt?yt:Fu,n=r===yt?Fu:yt,u=0,i=0;for(let o of e)o===r?u++:o===n&&i++;return u>i?n:r}var mu=Qi;function Zi(e,t,r){for(let n=t;ns===n?s:a===t?"\\"+a:a||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)?s:"\\"+s));return t+i+t}var Cu=to;function ro(e,t,r){return We(e,r(t))}function no(e,t){return arguments.length===2||typeof t=="number"?We(e,t):ro(...arguments)}function uo(e,t,r){return Ie(e,r(t))}function io(e,t){return arguments.length===2||typeof t=="number"?Ie(e,t):uo(...arguments)}function oo(e,t,r){return gt(e,r(t))}function so(e,t){return arguments.length===2||typeof t=="number"?gt(e,t):oo(...arguments)}function de(e,t=1){return async(...r)=>{let n=r[t]??{},u=n.plugins??[];return r[t]={...n,plugins:Array.isArray(u)?u:Object.values(u)},e(...r)}}var gu=de(ar);async function yu(e,t){let{formatted:r}=await gu(e,{...t,cursorOffset:-1});return r}async function ao(e,t){return await yu(e,t)===e}var Do=de(ot,0),lo={parse:de(ou),formatAST:de(su),formatDoc:de(au),printToDoc:de(Du),printDocToString:de(lu)};return xu(co);}); \ No newline at end of file diff --git a/node_modules/prettier/standalone.mjs b/node_modules/prettier/standalone.mjs new file mode 100644 index 0000000..9c938c5 --- /dev/null +++ b/node_modules/prettier/standalone.mjs @@ -0,0 +1,39 @@ +var Au=Object.create;var At=Object.defineProperty;var vu=Object.getOwnPropertyDescriptor;var Bu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty;var dr=e=>{throw TypeError(e)};var pr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)At(e,r,{get:t[r],enumerable:!0})},xu=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Bu(t))!_u.call(e,u)&&u!==r&&At(e,u,{get:()=>t[u],enumerable:!(n=vu(t,u))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?Au(wu(e)):{},xu(t||!e||!e.__esModule?At(r,"default",{value:e,enumerable:!0}):r,e));var bu=(e,t,r)=>t.has(e)||dr("Cannot "+r);var Fr=(e,t,r)=>t.has(e)?dr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var pe=(e,t,r)=>(bu(e,t,"access private method"),r);var ot=pr((Da,mn)=>{"use strict";var Fn=new Proxy(String,{get:()=>Fn});mn.exports=Fn});var $n=pr(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});function wi(){return new Proxy({},{get:()=>e=>e})}var Wn=/\r\n|[\n\r\u2028\u2029]/;function _i(e,t,r){let n=Object.assign({column:0,line:-1},e.start),u=Object.assign({},n,e.end),{linesAbove:i=2,linesBelow:o=3}=r||{},s=n.line,a=n.column,D=u.line,l=u.column,p=Math.max(s-(i+1),0),f=Math.min(t.length,D+o);s===-1&&(p=0),D===-1&&(f=t.length);let d=D-s,c={};if(d)for(let F=0;F<=d;F++){let m=F+s;if(!a)c[m]=!0;else if(F===0){let h=t[m-1].length;c[m]=[a,h-a+1]}else if(F===d)c[m]=[0,l];else{let h=t[m-F].length;c[m]=[0,h]}}else a===l?a?c[s]=[a,0]:c[s]=!0:c[s]=[a,l-a];return{start:p,end:f,markerLines:c}}function xi(e,t,r={}){let u=wi(!1),i=e.split(Wn),{start:o,end:s,markerLines:a}=_i(t,i,r),D=t.start&&typeof t.start.column=="number",l=String(s).length,f=e.split(Wn,s).slice(o,s).map((d,c)=>{let F=o+1+c,h=` ${` ${F}`.slice(-l)} |`,C=a[F],v=!a[F+1];if(C){let E="";if(Array.isArray(C)){let g=d.slice(0,Math.max(C[0]-1,0)).replace(/[^\t]/g," "),j=C[1]||1;E=[` + `,u.gutter(h.replace(/\d/g," "))," ",g,u.marker("^").repeat(j)].join(""),v&&r.message&&(E+=" "+u.message(r.message))}return[u.marker(">"),u.gutter(h),d.length>0?` ${d}`:"",E].join("")}else return` ${u.gutter(h)}${d.length>0?` ${d}`:""}`}).join(` +`);return r.message&&!D&&(f=`${" ".repeat(l+1)}${r.message} +${f}`),f}ur.codeFrameColumns=xi});var fr={};vt(fr,{__debug:()=>lo,check:()=>ao,doc:()=>Dr,format:()=>yu,formatWithCursor:()=>gu,getSupportInfo:()=>Do,util:()=>cr,version:()=>cu});var Nu=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},ne=Nu;function U(){}U.prototype={diff:function(t,r){var n,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=u.callback;typeof u=="function"&&(i=u,u={});var o=this;function s(E){return E=o.postProcess(E,u),i?(setTimeout(function(){i(E)},0),!0):E}t=this.castInput(t,u),r=this.castInput(r,u),t=this.removeEmpty(this.tokenize(t,u)),r=this.removeEmpty(this.tokenize(r,u));var a=r.length,D=t.length,l=1,p=a+D;u.maxEditLength!=null&&(p=Math.min(p,u.maxEditLength));var f=(n=u.timeout)!==null&&n!==void 0?n:1/0,d=Date.now()+f,c=[{oldPos:-1,lastComponent:void 0}],F=this.extractCommon(c[0],r,t,0,u);if(c[0].oldPos+1>=D&&F+1>=a)return s(mr(o,c[0].lastComponent,r,t,o.useLongestToken));var m=-1/0,h=1/0;function C(){for(var E=Math.max(m,-l);E<=Math.min(h,l);E+=2){var g=void 0,j=c[E-1],b=c[E+1];j&&(c[E-1]=void 0);var X=!1;if(b){var ae=b.oldPos-E;X=b&&0<=ae&&ae=D&&F+1>=a)return s(mr(o,g.lastComponent,r,t,o.useLongestToken));c[E]=g,g.oldPos+1>=D&&(h=Math.min(h,E-1)),F+1>=a&&(m=Math.max(m,E+1))}l++}if(i)(function E(){setTimeout(function(){if(l>p||Date.now()>d)return i();C()||E()},0)})();else for(;l<=p&&Date.now()<=d;){var v=C();if(v)return v}},addToPath:function(t,r,n,u,i){var o=t.lastComponent;return o&&!i.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+u,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+u,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}},extractCommon:function(t,r,n,u,i){for(var o=r.length,s=n.length,a=t.oldPos,D=a-u,l=0;D+1d.length?F:d}),p.value=e.join(f)}else p.value=e.join(r.slice(D,D+p.count));D+=p.count,p.added||(l+=p.count)}}return i}var mo=new U;function hr(e,t){var r;for(r=0;rt.length&&(r=e.length-t.length);var n=t.length;e.length0&&t[o]!=t[i];)i=u[i];t[o]==t[i]&&i++}i=0;for(var s=r;s0&&e[s]!=t[i];)i=u[i];e[s]==t[i]&&i++}return i}var Ue="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Su=new RegExp("[".concat(Ue,"]+|\\s+|[^").concat(Ue,"]"),"ug"),Ge=new U;Ge.equals=function(e,t,r){return r.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()};Ge.tokenize=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r;if(t.intlSegmenter){if(t.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=Array.from(t.intlSegmenter.segment(e),function(i){return i.segment})}else r=e.match(Su)||[];var n=[],u=null;return r.forEach(function(i){/\s/.test(i)?u==null?n.push(i):n.push(n.pop()+i):/\s/.test(u)?n[n.length-1]==u?n.push(n.pop()+i):n.push(u+i):n.push(i),u=i}),n};Ge.join=function(e){return e.map(function(t,r){return r==0?t:t.replace(/^\s+/,"")}).join("")};Ge.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var r=null,n=null,u=null;return e.forEach(function(i){i.added?n=i:i.removed?u=i:((n||u)&&gr(r,u,n,i),r=i,n=null,u=null)}),(n||u)&&gr(r,u,n,null),e};function gr(e,t,r,n){if(t&&r){var u=t.value.match(/^\s*/)[0],i=t.value.match(/\s*$/)[0],o=r.value.match(/^\s*/)[0],s=r.value.match(/\s*$/)[0];if(e){var a=hr(u,o);e.value=wt(e.value,o,a),t.value=_e(t.value,a),r.value=_e(r.value,a)}if(n){var D=Er(i,s);n.value=Bt(n.value,s,D),t.value=Ve(t.value,D),r.value=Ve(r.value,D)}}else if(r)e&&(r.value=r.value.replace(/^\s*/,"")),n&&(n.value=n.value.replace(/^\s*/,""));else if(e&&n){var l=n.value.match(/^\s*/)[0],p=t.value.match(/^\s*/)[0],f=t.value.match(/\s*$/)[0],d=hr(l,p);t.value=_e(t.value,d);var c=Er(_e(l,d),f);t.value=Ve(t.value,c),n.value=Bt(n.value,l,c),e.value=wt(e.value,l,l.slice(0,l.length-c.length))}else if(n){var F=n.value.match(/^\s*/)[0],m=t.value.match(/\s*$/)[0],h=Cr(m,F);t.value=Ve(t.value,h)}else if(e){var C=e.value.match(/\s*$/)[0],v=t.value.match(/^\s*/)[0],E=Cr(C,v);t.value=_e(t.value,E)}}var Tu=new U;Tu.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(Ue,"]+|[^\\S\\n\\r]+|[^").concat(Ue,"]"),"ug");return e.match(t)||[]};var bt=new U;bt.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` +`));var r=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var u=0;u"u"?r:o}:n;return typeof e=="string"?e:JSON.stringify(xt(e,null,null,u),u," ")};xe.equals=function(e,t,r){return U.prototype.equals.call(xe,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),r)};function xt(e,t,r,n,u){t=t||[],r=r||[],n&&(e=n(u,e));var i;for(i=0;i{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},A=Pu;function Iu(e){if(typeof e=="string")return $;if(Array.isArray(e))return H;if(!e)return;let{type:t}=e;if(Ke.has(t))return t}var M=Iu;var Ru=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Yu(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', +Expected it to be 'string' or 'object'.`;if(M(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Ru([...Ke].map(u=>`'${u}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${n}.`}var Ot=class extends Error{name="InvalidDocError";constructor(t){super(Yu(t)),this.doc=t}},Q=Ot;var Br={};function ju(e,t,r,n){let u=[e];for(;u.length>0;){let i=u.pop();if(i===Br){r(u.pop());continue}r&&u.push(i,Br);let o=M(i);if(!o)throw new Q(i);if((t==null?void 0:t(i))!==!1)switch(o){case H:case N:{let s=o===H?i:i.parts;for(let a=s.length,D=a-1;D>=0;--D)u.push(s[D]);break}case w:u.push(i.flatContents,i.breakContents);break;case B:if(n&&i.expandedStates)for(let s=i.expandedStates.length,a=s-1;a>=0;--a)u.push(i.expandedStates[a]);else u.push(i.contents);break;case k:case T:case P:case O:case I:u.push(i.contents);break;case $:case z:case L:case R:case y:case _:break;default:throw new Q(i)}}}var Fe=ju;function Oe(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(i){if(r.has(i))return r.get(i);let o=u(i);return r.set(i,o),o}function u(i){switch(M(i)){case H:return t(i.map(n));case N:return t({...i,parts:i.parts.map(n)});case w:return t({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case B:{let{expandedStates:o,contents:s}=i;return o?(o=o.map(n),s=o[0]):s=n(s),t({...i,contents:s,expandedStates:o})}case k:case T:case P:case O:case I:return t({...i,contents:n(i.contents)});case $:case z:case L:case R:case y:case _:return t(i);default:throw new Q(i)}}}function Je(e,t,r){let n=r,u=!1;function i(o){if(u)return!1;let s=t(o);s!==void 0&&(u=!0,n=s)}return Fe(e,i),n}function Hu(e){if(e.type===B&&e.break||e.type===y&&e.hard||e.type===_)return!0}function xr(e){return Je(e,Hu,!1)}function wr(e){if(e.length>0){let t=A(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function br(e){let t=new Set,r=[];function n(i){if(i.type===_&&wr(r),i.type===B){if(r.push(i),t.has(i))return!1;t.add(i)}}function u(i){i.type===B&&r.pop().break&&wr(r)}Fe(e,n,u,!0)}function Wu(e){return e.type===y&&!e.hard?e.soft?"":" ":e.type===w?e.flatContents:e}function Nr(e){return Oe(e,Wu)}function _r(e){for(e=[...e];e.length>=2&&A(!1,e,-2).type===y&&A(!1,e,-1).type===_;)e.length-=2;if(e.length>0){let t=Ne(A(!1,e,-1));e[e.length-1]=t}return e}function Ne(e){switch(M(e)){case T:case P:case B:case I:case O:{let t=Ne(e.contents);return{...e,contents:t}}case w:return{...e,breakContents:Ne(e.breakContents),flatContents:Ne(e.flatContents)};case N:return{...e,parts:_r(e.parts)};case H:return _r(e);case $:return e.replace(/[\n\r]*$/u,"");case k:case z:case L:case R:case y:case _:break;default:throw new Q(e)}return e}function qe(e){return Ne(Mu(e))}function $u(e){switch(M(e)){case N:if(e.parts.every(t=>t===""))return"";break;case B:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===B&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case k:case T:case P:case I:if(!e.contents)return"";break;case w:if(!e.flatContents&&!e.breakContents)return"";break;case H:{let t=[];for(let r of e){if(!r)continue;let[n,...u]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof A(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...u)}return t.length===0?"":t.length===1?t[0]:t}case $:case z:case L:case R:case y:case O:case _:break;default:throw new Q(e)}return e}function Mu(e){return Oe(e,t=>$u(t))}function Or(e,t=Xe){return Oe(e,r=>typeof r=="string"?Se(t,r.split(` +`)):r)}function Vu(e){if(e.type===y)return!0}function Sr(e){return Je(e,Vu,!1)}function me(e,t){return e.type===O?{...e,contents:t(e.contents)}:t(e)}var St=()=>{},G=St,Tt=St,Tr=St;function le(e){return G(e),{type:T,contents:e}}function De(e,t){return G(t),{type:k,contents:t,n:e}}function kt(e,t={}){return G(e),Tt(t.expandedStates,!0),{type:B,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function kr(e){return De(Number.NEGATIVE_INFINITY,e)}function Lr(e){return De({type:"root"},e)}function Pr(e){return De(-1,e)}function Ir(e,t){return kt(e[0],{...t,expandedStates:e})}function Rr(e){return Tr(e),{type:N,parts:e}}function Yr(e,t="",r={}){return G(e),t!==""&&G(t),{type:w,breakContents:e,flatContents:t,groupId:r.groupId}}function jr(e,t){return G(e),{type:P,contents:e,groupId:t.groupId,negate:t.negate}}function Te(e){return G(e),{type:I,contents:e}}var Hr={type:R},he={type:_},Wr={type:L},ke={type:y,hard:!0},Lt={type:y,hard:!0,literal:!0},Qe={type:y},$r={type:y,soft:!0},K=[ke,he],Xe=[Lt,he],Z={type:z};function Se(e,t){G(e),Tt(t);let r=[];for(let n=0;n0){for(let u=0;u0?`, { ${l.join(", ")} }`:"";return`indentIfBreak(${n(i.contents)}${p})`}if(i.type===B){let l=[];i.break&&i.break!=="propagated"&&l.push("shouldBreak: true"),i.id&&l.push(`id: ${u(i.id)}`);let p=l.length>0?`, { ${l.join(", ")} }`:"";return i.expandedStates?`conditionalGroup([${i.expandedStates.map(f=>n(f)).join(",")}]${p})`:`group(${n(i.contents)}${p})`}if(i.type===N)return`fill([${i.parts.map(l=>n(l)).join(", ")}])`;if(i.type===I)return"lineSuffix("+n(i.contents)+")";if(i.type===R)return"lineSuffixBoundary";if(i.type===O)return`label(${JSON.stringify(i.label)}, ${n(i.contents)})`;throw new Error("Unknown doc type "+i.type)}function u(i){if(typeof i!="symbol")return JSON.stringify(String(i));if(i in t)return t[i];let o=i.description||"symbol";for(let s=0;;s++){let a=o+(s>0?` #${s}`:"");if(!r.has(a))return r.add(a),t[i]=`Symbol.for(${JSON.stringify(a)})`}}}var Ur=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function zr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Gr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Kr=e=>!(zr(e)||Gr(e));var Uu=/[^\x20-\x7F]/u;function zu(e){if(!e)return 0;if(!Uu.test(e))return e.length;e=e.replace(Ur()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=Kr(n)?1:2)}return t}var Le=zu;var Y=Symbol("MODE_BREAK"),J=Symbol("MODE_FLAT"),Ee=Symbol("cursor"),Pt=Symbol("DOC_FILL_PRINTED_LENGTH");function Jr(){return{value:"",length:0,queue:[]}}function Gu(e,t){return It(e,{type:"indent"},t)}function Ku(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Jr():t<0?It(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:It(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function It(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],u="",i=0,o=0,s=0;for(let c of n)switch(c.type){case"indent":l(),r.useTabs?a(1):D(r.tabWidth);break;case"stringAlign":l(),u+=c.n,i+=c.n.length;break;case"numberAlign":o+=1,s+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return f(),{...e,value:u,length:i,queue:n};function a(c){u+=" ".repeat(c),i+=r.tabWidth*c}function D(c){u+=" ".repeat(c),i+=c}function l(){r.useTabs?p():f()}function p(){o>0&&a(o),d()}function f(){s>0&&D(s),d()}function d(){o=0,s=0}}function Rt(e){let t=0,r=0,n=e.length;e:for(;n--;){let u=e[n];if(u===Ee){r++;continue}for(let i=u.length-1;i>=0;i--){let o=u[i];if(o===" "||o===" ")t++;else{e[n]=u.slice(0,i+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Ee);return t}function et(e,t,r,n,u,i){if(r===Number.POSITIVE_INFINITY)return!0;let o=t.length,s=[e],a=[];for(;r>=0;){if(s.length===0){if(o===0)return!0;s.push(t[--o]);continue}let{mode:D,doc:l}=s.pop(),p=M(l);switch(p){case $:a.push(l),r-=Le(l);break;case H:case N:{let f=p===H?l:l.parts,d=l[Pt]??0;for(let c=f.length-1;c>=d;c--)s.push({mode:D,doc:f[c]});break}case T:case k:case P:case O:s.push({mode:D,doc:l.contents});break;case L:r+=Rt(a);break;case B:{if(i&&l.break)return!1;let f=l.break?Y:D,d=l.expandedStates&&f===Y?A(!1,l.expandedStates,-1):l.contents;s.push({mode:f,doc:d});break}case w:{let d=(l.groupId?u[l.groupId]||J:D)===Y?l.breakContents:l.flatContents;d&&s.push({mode:D,doc:d});break}case y:if(D===Y||l.hard)return!0;l.soft||(a.push(" "),r--);break;case I:n=!0;break;case R:if(n)return!1;break}}return!1}function Ce(e,t){let r={},n=t.printWidth,u=be(t.endOfLine),i=0,o=[{ind:Jr(),mode:Y,doc:e}],s=[],a=!1,D=[],l=0;for(br(e);o.length>0;){let{ind:f,mode:d,doc:c}=o.pop();switch(M(c)){case $:{let F=u!==` +`?ne(!1,c,` +`,u):c;s.push(F),o.length>0&&(i+=Le(F));break}case H:for(let F=c.length-1;F>=0;F--)o.push({ind:f,mode:d,doc:c[F]});break;case z:if(l>=2)throw new Error("There are too many 'cursor' in doc.");s.push(Ee),l++;break;case T:o.push({ind:Gu(f,t),mode:d,doc:c.contents});break;case k:o.push({ind:Ku(f,c.n,t),mode:d,doc:c.contents});break;case L:i-=Rt(s);break;case B:switch(d){case J:if(!a){o.push({ind:f,mode:c.break?Y:J,doc:c.contents});break}case Y:{a=!1;let F={ind:f,mode:J,doc:c.contents},m=n-i,h=D.length>0;if(!c.break&&et(F,o,m,h,r))o.push(F);else if(c.expandedStates){let C=A(!1,c.expandedStates,-1);if(c.break){o.push({ind:f,mode:Y,doc:C});break}else for(let v=1;v=c.expandedStates.length){o.push({ind:f,mode:Y,doc:C});break}else{let E=c.expandedStates[v],g={ind:f,mode:J,doc:E};if(et(g,o,m,h,r)){o.push(g);break}}}else o.push({ind:f,mode:Y,doc:c.contents});break}}c.id&&(r[c.id]=A(!1,o,-1).mode);break;case N:{let F=n-i,m=c[Pt]??0,{parts:h}=c,C=h.length-m;if(C===0)break;let v=h[m+0],E=h[m+1],g={ind:f,mode:J,doc:v},j={ind:f,mode:Y,doc:v},b=et(g,[],F,D.length>0,r,!0);if(C===1){b?o.push(g):o.push(j);break}let X={ind:f,mode:J,doc:E},ae={ind:f,mode:Y,doc:E};if(C===2){b?o.push(X,g):o.push(ae,j);break}let $e=h[m+2],yt={ind:f,mode:d,doc:{...c,[Pt]:m+2}};et({ind:f,mode:J,doc:[v,E,$e]},[],F,D.length>0,r,!0)?o.push(yt,X,g):b?o.push(yt,ae,g):o.push(yt,ae,j);break}case w:case P:{let F=c.groupId?r[c.groupId]:d;if(F===Y){let m=c.type===w?c.breakContents:c.negate?c.contents:le(c.contents);m&&o.push({ind:f,mode:d,doc:m})}if(F===J){let m=c.type===w?c.flatContents:c.negate?le(c.contents):c.contents;m&&o.push({ind:f,mode:d,doc:m})}break}case I:D.push({ind:f,mode:d,doc:c.contents});break;case R:D.length>0&&o.push({ind:f,mode:d,doc:ke});break;case y:switch(d){case J:if(c.hard)a=!0;else{c.soft||(s.push(" "),i+=1);break}case Y:if(D.length>0){o.push({ind:f,mode:d,doc:c},...D.reverse()),D.length=0;break}c.literal?f.root?(s.push(u,f.root.value),i=f.root.length):(s.push(u),i=0):(i-=Rt(s),s.push(u+f.value),i=f.length);break}break;case O:o.push({ind:f,mode:d,doc:c.contents});break;case _:break;default:throw new Q(c)}o.length===0&&D.length>0&&(o.push(...D.reverse()),D.length=0)}let p=s.indexOf(Ee);if(p!==-1){let f=s.indexOf(Ee,p+1);if(f===-1)return{formatted:s.filter(m=>m!==Ee).join("")};let d=s.slice(0,p).join(""),c=s.slice(p+1,f).join(""),F=s.slice(f+1).join("");return{formatted:d+c+F,cursorNodeStart:d.length,cursorNodeText:c}}return{formatted:s.join("")}}function Ju(e,t,r=0){let n=0;for(let u=r;u1?A(!1,t,-2):null}getValue(){return A(!1,this.stack,-1)}getNode(t=0){let r=pe(this,te,jt).call(this,t);return r===-1?null:this.stack[r]}getParentNode(t=0){return this.getNode(t+1)}call(t,...r){let{stack:n}=this,{length:u}=n,i=A(!1,n,-1);for(let o of r)i=i[o],n.push(o,i);try{return t(this)}finally{n.length=u}}callParent(t,r=0){let n=pe(this,te,jt).call(this,r+1),u=this.stack.splice(n+1);try{return t(this)}finally{this.stack.push(...u)}}each(t,...r){let{stack:n}=this,{length:u}=n,i=A(!1,n,-1);for(let o of r)i=i[o],n.push(o,i);try{for(let o=0;o{n[i]=t(u,i,o)},...r),n}match(...t){let r=this.stack.length-1,n=null,u=this.stack[r--];for(let i of t){if(u===void 0)return!1;let o=null;if(typeof n=="number"&&(o=n,n=this.stack[r--],u=this.stack[r--]),i&&!i(u,n,o))return!1;n=this.stack[r--],u=this.stack[r--]}return!0}findAncestor(t){for(let r of pe(this,te,tt).call(this))if(t(r))return r}hasAncestor(t){for(let r of pe(this,te,tt).call(this))if(t(r))return!0;return!1}};te=new WeakSet,jt=function(t){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--t<0)return n;return-1},tt=function*(){let{stack:t}=this;for(let r=t.length-3;r>=0;r-=2){let n=t[r];Array.isArray(n)||(yield n)}};var qr=Yt;var Xr=new Proxy(()=>{},{get:()=>Xr}),Pe=Xr;function qu(e){return e!==null&&typeof e=="object"}var Qr=qu;function*ye(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,u=i=>Qr(i)&&n(i);for(let i of r(e)){let o=e[i];if(Array.isArray(o))for(let s of o)u(s)&&(yield s);else u(o)&&(yield o)}}function*Zr(e,t){let r=[e];for(let n=0;n{let u=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:i}=t,o=r;for(;o>=0&&o0}var Ht=Zu;var rn=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),ei=e=>Object.keys(e).filter(t=>!rn.has(t));function ti(e){return e?t=>e(t,rn):ei}var q=ti;function ri(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Wt(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=ri(e)}function ue(e,t){t.leading=!0,t.trailing=!1,Wt(e,t)}function re(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Wt(e,t)}function ie(e,t){t.leading=!1,t.trailing=!0,Wt(e,t)}var $t=new WeakMap;function ut(e,t){if($t.has(e))return $t.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:u},locStart:i,locEnd:o}=t;if(!n)return[];let s=((r==null?void 0:r(e,t))??[...ye(e,{getVisitorKeys:q(u)})]).flatMap(a=>n(a)?[a]:ut(a,t));return s.sort((a,D)=>i(a)-i(D)||o(a)-o(D)),$t.set(e,s),s}function un(e,t,r,n){let{locStart:u,locEnd:i}=r,o=u(t),s=i(t),a=ut(e,r),D,l,p=0,f=a.length;for(;p>1,c=a[d],F=u(c),m=i(c);if(F<=o&&s<=m)return un(c,t,r,c);if(m<=o){D=c,p=d+1;continue}if(s<=F){l=c,f=d;continue}throw new Error("Comment location overlaps with node location")}if((n==null?void 0:n.type)==="TemplateLiteral"){let{quasis:d}=n,c=Vt(d,t,r);D&&Vt(d,D,r)!==c&&(D=null),l&&Vt(d,l,r)!==c&&(l=null)}return{enclosingNode:n,precedingNode:D,followingNode:l}}var Mt=()=>!1;function on(e,t){let{comments:r}=e;if(delete e.comments,!Ht(r)||!t.printer.canAttachComment)return;let n=[],{locStart:u,locEnd:i,printer:{experimentalFeatures:{avoidAstMutation:o=!1}={},handleComments:s={}},originalText:a}=t,{ownLine:D=Mt,endOfLine:l=Mt,remaining:p=Mt}=s,f=r.map((d,c)=>({...un(e,d,t),comment:d,text:a,options:t,ast:e,isLastComment:r.length-1===c}));for(let[d,c]of f.entries()){let{comment:F,precedingNode:m,enclosingNode:h,followingNode:C,text:v,options:E,ast:g,isLastComment:j}=c;if(E.parser==="json"||E.parser==="json5"||E.parser==="jsonc"||E.parser==="__js_expression"||E.parser==="__ts_expression"||E.parser==="__vue_expression"||E.parser==="__vue_ts_expression"){if(u(F)-u(g)<=0){ue(g,F);continue}if(i(F)-i(g)>=0){ie(g,F);continue}}let b;if(o?b=[c]:(F.enclosingNode=h,F.precedingNode=m,F.followingNode=C,b=[F,v,E,g,j]),ni(v,E,f,d))F.placement="ownLine",D(...b)||(C?ue(C,F):m?ie(m,F):h?re(h,F):re(g,F));else if(ui(v,E,f,d))F.placement="endOfLine",l(...b)||(m?ie(m,F):C?ue(C,F):h?re(h,F):re(g,F));else if(F.placement="remaining",!p(...b))if(m&&C){let X=n.length;X>0&&n[X-1].followingNode!==C&&nn(n,E),n.push(c)}else m?ie(m,F):C?ue(C,F):h?re(h,F):re(g,F)}if(nn(n,t),!o)for(let d of r)delete d.precedingNode,delete d.enclosingNode,delete d.followingNode}var sn=e=>!/[\S\n\u2028\u2029]/u.test(e);function ni(e,t,r,n){let{comment:u,precedingNode:i}=r[n],{locStart:o,locEnd:s}=t,a=o(u);if(i)for(let D=n-1;D>=0;D--){let{comment:l,precedingNode:p}=r[D];if(p!==i||!sn(e.slice(s(l),a)))break;a=o(l)}return V(e,a,{backwards:!0})}function ui(e,t,r,n){let{comment:u,followingNode:i}=r[n],{locStart:o,locEnd:s}=t,a=s(u);if(i)for(let D=n+1;D0;--o){let{comment:D,precedingNode:l,followingNode:p}=e[o-1];Pe.strictEqual(l,n),Pe.strictEqual(p,u);let f=t.originalText.slice(t.locEnd(D),i);if(((a=(s=t.printer).isGap)==null?void 0:a.call(s,f,t))??/^[\s(]*$/u.test(f))i=t.locStart(D);else break}for(let[D,{comment:l}]of e.entries())D1&&D.comments.sort((l,p)=>t.locStart(l)-t.locStart(p));e.length=0}function Vt(e,t,r){let n=r.locStart(t)-1;for(let u=1;u!n.has(a)).length===0)return{leading:"",trailing:""};let i=[],o=[],s;return e.each(()=>{let a=e.node;if(n!=null&&n.has(a))return;let{leading:D,trailing:l}=a;D?i.push(oi(e,t)):l&&(s=si(e,t,s),o.push(s.doc))},"comments"),{leading:i,trailing:o}}function Dn(e,t,r){let{leading:n,trailing:u}=ai(e,r);return!n&&!u?t:me(t,i=>[n,i,u])}function ln(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:r}=e;for(let n of t){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed}}function Di(e){return()=>{}}var cn=Di;var Re=class extends Error{name="ConfigError"},Ye=class extends Error{name="UndefinedParserError"};var fn={cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing +(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive). +The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset. +The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment +in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function it({plugins:e=[],showDeprecated:t=!1}={}){let r=e.flatMap(u=>u.languages??[]),n=[];for(let u of ci(Object.assign({},...e.map(({options:i})=>i),fn)))!t&&u.deprecated||(Array.isArray(u.choices)&&(t||(u.choices=u.choices.filter(i=>!i.deprecated)),u.name==="parser"&&(u.choices=[...u.choices,...li(u.choices,r,e)])),u.pluginDefaults=Object.fromEntries(e.filter(i=>{var o;return((o=i.defaultOptions)==null?void 0:o[u.name])!==void 0}).map(i=>[i.name,i.defaultOptions[u.name]])),n.push(u));return{languages:r,options:n}}function*li(e,t,r){let n=new Set(e.map(u=>u.value));for(let u of t)if(u.parsers){for(let i of u.parsers)if(!n.has(i)){n.add(i);let o=r.find(a=>a.parsers&&Object.prototype.hasOwnProperty.call(a.parsers,i)),s=u.name;o!=null&&o.name&&(s+=` (plugin: ${o.name})`),yield{value:i,description:s}}}}function ci(e){let t=[];for(let[r,n]of Object.entries(e)){let u={name:r,...n};Array.isArray(u.default)&&(u.default=A(!1,u.default,-1).value),t.push(u)}return t}var fi=e=>String(e).split(/[/\\]/u).pop();function dn(e,t){if(!t)return;let r=fi(t).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(u=>u.toLowerCase()===r))??e.find(({extensions:n})=>n==null?void 0:n.some(u=>r.endsWith(u)))}function di(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r==null?void 0:r.includes(t))??e.find(({extensions:r})=>r==null?void 0:r.includes(`.${t}`))}function pi(e,t){let r=e.plugins.flatMap(u=>u.languages??[]),n=di(r,t.language)??dn(r,t.physicalFile)??dn(r,t.file)??(t.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var pn=pi;var oe={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(r=>oe.value(r)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(r=>`${oe.key(r)}: ${oe.value(e[r])}`).join(", ")} }`},pair:({key:e,value:t})=>oe.value({[e]:t})};var Ut=Me(ot(),1),hn=(e,t,{descriptor:r})=>{let n=[`${Ut.default.yellow(typeof e=="string"?r.key(e):r.pair(e))} is deprecated`];return t&&n.push(`we now treat it as ${Ut.default.blue(typeof t=="string"?r.key(t):r.pair(t))}`),n.join("; ")+"."};var ce=Me(ot(),1);var st=Symbol.for("vnopts.VALUE_NOT_EXIST"),ve=Symbol.for("vnopts.VALUE_UNCHANGED");var En=" ".repeat(2),gn=(e,t,r)=>{let{text:n,list:u}=r.normalizeExpectedResult(r.schemas[e].expected(r)),i=[];return n&&i.push(Cn(e,t,n,r.descriptor)),u&&i.push([Cn(e,t,u.title,r.descriptor)].concat(u.values.map(o=>yn(o,r.loggerPrintWidth))).join(` +`)),An(i,r.loggerPrintWidth)};function Cn(e,t,r,n){return[`Invalid ${ce.default.red(n.key(e))} value.`,`Expected ${ce.default.blue(r)},`,`but received ${t===st?ce.default.gray("nothing"):ce.default.red(n.value(t))}.`].join(" ")}function yn({text:e,list:t},r){let n=[];return e&&n.push(`- ${ce.default.blue(e)}`),t&&n.push([`- ${ce.default.blue(t.title)}:`].concat(t.values.map(u=>yn(u,r-En.length).replace(/^|\n/g,`$&${En}`))).join(` +`)),An(n,r)}function An(e,t){if(e.length===1)return e[0];let[r,n]=e,[u,i]=e.map(o=>o.split(` +`,1)[0].length);return u>t&&u>i?n:r}var Kt=Me(ot(),1);var zt=[],vn=[];function Gt(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,u=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-u);)n--,u--;let i=0;for(;is?D>s?s+1:D:D>a?a+1:D;return s}var at=(e,t,{descriptor:r,logger:n,schemas:u})=>{let i=[`Ignored unknown option ${Kt.default.yellow(r.pair({key:e,value:t}))}.`],o=Object.keys(u).sort().find(s=>Gt(e,s)<3);o&&i.push(`Did you mean ${Kt.default.blue(r.key(o))}?`),n.warn(i.join(" "))};var Fi=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function mi(e,t){let r=new e(t),n=Object.create(r);for(let u of Fi)u in t&&(n[u]=hi(t[u],r,x.prototype[u].length));return n}var x=class{static create(t){return mi(this,t)}constructor(t){this.name=t.name}default(t){}expected(t){return"nothing"}validate(t,r){return!1}deprecated(t,r){return!1}forward(t,r){}redirect(t,r){}overlap(t,r,n){return t}preprocess(t,r){return t}postprocess(t,r){return ve}};function hi(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var Dt=class extends x{constructor(t){super(t),this._sourceName=t.sourceName}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,r){return r.schemas[this._sourceName].validate(t,r)}redirect(t,r){return this._sourceName}};var lt=class extends x{expected(){return"anything"}validate(){return!0}};var ct=class extends x{constructor({valueSchema:t,name:r=t.name,...n}){super({...n,name:r}),this._valueSchema=t}expected(t){let{text:r,list:n}=t.normalizeExpectedResult(this._valueSchema.expected(t));return{text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t,r){if(!Array.isArray(t))return!1;let n=[];for(let u of t){let i=r.normalizeValidateResult(this._valueSchema.validate(u,r),u);i!==!0&&n.push(i.value)}return n.length===0?!0:{value:n}}deprecated(t,r){let n=[];for(let u of t){let i=r.normalizeDeprecatedResult(this._valueSchema.deprecated(u,r),u);i!==!1&&n.push(...i.map(({value:o})=>({value:[o]})))}return n}forward(t,r){let n=[];for(let u of t){let i=r.normalizeForwardResult(this._valueSchema.forward(u,r),u);n.push(...i.map(Bn))}return n}redirect(t,r){let n=[],u=[];for(let i of t){let o=r.normalizeRedirectResult(this._valueSchema.redirect(i,r),i);"remain"in o&&n.push(o.remain),u.push(...o.redirect.map(Bn))}return n.length===0?{redirect:u}:{redirect:u,remain:n}}overlap(t,r){return t.concat(r)}};function Bn({from:e,to:t}){return{from:[e],to:t}}var ft=class extends x{expected(){return"true or false"}validate(t){return typeof t=="boolean"}};function _n(e,t){let r=Object.create(null);for(let n of e){let u=n[t];if(r[u])throw new Error(`Duplicate ${t} ${JSON.stringify(u)}`);r[u]=n}return r}function xn(e,t){let r=new Map;for(let n of e){let u=n[t];if(r.has(u))throw new Error(`Duplicate ${t} ${JSON.stringify(u)}`);r.set(u,n)}return r}function bn(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?!0:(e[r]=!0,!1)}}function Nn(e,t){let r=[],n=[];for(let u of e)t(u)?r.push(u):n.push(u);return[r,n]}function On(e){return e===Math.floor(e)}function Sn(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,u=["undefined","object","boolean","number","string"];return r!==n?u.indexOf(r)-u.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function Tn(e){return(...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function Jt(e){return e===void 0?{}:e}function qt(e){if(typeof e=="string")return{text:e};let{text:t,list:r}=e;return Ei((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map(qt)}}:{text:t}}function Xt(e,t){return e===!0?!0:e===!1?{value:t}:e}function Qt(e,t,r=!1){return e===!1?!1:e===!0?r?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function wn(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function dt(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>wn(r,t)):[wn(e,t)]}function Zt(e,t){let r=dt(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function Ei(e,t){if(!e)throw new Error(t)}var pt=class extends x{constructor(t){super(t),this._choices=xn(t.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value")}expected({descriptor:t}){let r=Array.from(this._choices.keys()).map(o=>this._choices.get(o)).filter(({hidden:o})=>!o).map(o=>o.value).sort(Sn).map(t.value),n=r.slice(0,-2),u=r.slice(-2);return{text:n.concat(u.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(t){return this._choices.has(t)}deprecated(t){let r=this._choices.get(t);return r&&r.deprecated?{value:t}:!1}forward(t){let r=this._choices.get(t);return r?r.forward:void 0}redirect(t){let r=this._choices.get(t);return r?r.redirect:void 0}};var Ft=class extends x{expected(){return"a number"}validate(t,r){return typeof t=="number"}};var mt=class extends Ft{expected(){return"an integer"}validate(t,r){return r.normalizeValidateResult(super.validate(t,r),t)===!0&&On(t)}};var je=class extends x{expected(){return"a string"}validate(t){return typeof t=="string"}};var kn=oe,Ln=at,Pn=gn,In=hn;var ht=class{constructor(t,r){let{logger:n=console,loggerPrintWidth:u=80,descriptor:i=kn,unknown:o=Ln,invalid:s=Pn,deprecated:a=In,missing:D=()=>!1,required:l=()=>!1,preprocess:p=d=>d,postprocess:f=()=>ve}=r||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:u,schemas:_n(t,"name"),normalizeDefaultResult:Jt,normalizeExpectedResult:qt,normalizeDeprecatedResult:Qt,normalizeForwardResult:dt,normalizeRedirectResult:Zt,normalizeValidateResult:Xt},this._unknownHandler=o,this._invalidHandler=Tn(s),this._deprecatedHandler=a,this._identifyMissing=(d,c)=>!(d in c)||D(d,c),this._identifyRequired=l,this._preprocess=p,this._postprocess=f,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=bn()}normalize(t){let r={},u=[this._preprocess(t,this._utils)],i=()=>{for(;u.length!==0;){let o=u.shift(),s=this._applyNormalization(o,r);u.push(...s)}};i();for(let o of Object.keys(this._utils.schemas)){let s=this._utils.schemas[o];if(!(o in r)){let a=Jt(s.default(this._utils));"value"in a&&u.push({[o]:a.value})}}i();for(let o of Object.keys(this._utils.schemas)){if(!(o in r))continue;let s=this._utils.schemas[o],a=r[o],D=s.postprocess(a,this._utils);D!==ve&&(this._applyValidation(D,o,s),r[o]=D)}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(t,r){let n=[],{knownKeys:u,unknownKeys:i}=this._partitionOptionKeys(t);for(let o of u){let s=this._utils.schemas[o],a=s.preprocess(t[o],this._utils);this._applyValidation(a,o,s);let D=({from:d,to:c})=>{n.push(typeof c=="string"?{[c]:d}:{[c.key]:c.value})},l=({value:d,redirectTo:c})=>{let F=Qt(s.deprecated(d,this._utils),a,!0);if(F!==!1)if(F===!0)this._hasDeprecationWarned(o)||this._utils.logger.warn(this._deprecatedHandler(o,c,this._utils));else for(let{value:m}of F){let h={key:o,value:m};if(!this._hasDeprecationWarned(h)){let C=typeof c=="string"?{key:c,value:m}:c;this._utils.logger.warn(this._deprecatedHandler(h,C,this._utils))}}};dt(s.forward(a,this._utils),a).forEach(D);let f=Zt(s.redirect(a,this._utils),a);if(f.redirect.forEach(D),"remain"in f){let d=f.remain;r[o]=o in r?s.overlap(r[o],d,this._utils):d,l({value:d})}for(let{from:d,to:c}of f.redirect)l({value:d,redirectTo:c})}for(let o of i){let s=t[o];this._applyUnknownHandler(o,s,r,(a,D)=>{n.push({[a]:D})})}return n}_applyRequiredCheck(t){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,t)&&this._identifyRequired(r))throw this._invalidHandler(r,st,this._utils)}_partitionOptionKeys(t){let[r,n]=Nn(Object.keys(t).filter(u=>!this._identifyMissing(u,t)),u=>u in this._utils.schemas);return{knownKeys:r,unknownKeys:n}}_applyValidation(t,r,n){let u=Xt(n.validate(t,this._utils),t);if(u!==!0)throw this._invalidHandler(r,u.value,this._utils)}_applyUnknownHandler(t,r,n,u){let i=this._unknownHandler(t,r,this._utils);if(i)for(let o of Object.keys(i)){if(this._identifyMissing(o,i))continue;let s=i[o];o in this._utils.schemas?u(o,s):n[o]=s}}_applyPostprocess(t){let r=this._postprocess(t,this._utils);if(r!==ve){if(r.delete)for(let n of r.delete)delete t[n];if(r.override){let{knownKeys:n,unknownKeys:u}=this._partitionOptionKeys(r.override);for(let i of n){let o=r.override[i];this._applyValidation(o,i,this._utils.schemas[i]),t[i]=o}for(let i of u){let o=r.override[i];this._applyUnknownHandler(i,o,t,(s,a)=>{let D=this._utils.schemas[s];this._applyValidation(a,s,D),t[s]=a})}}}}};var er;function gi(e,t,{logger:r=!1,isCLI:n=!1,passThrough:u=!1,FlagSchema:i,descriptor:o}={}){if(n){if(!i)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=oe;let s=u?Array.isArray(u)?(f,d)=>u.includes(f)?{[f]:d}:void 0:(f,d)=>({[f]:d}):(f,d,c)=>{let{_:F,...m}=c.schemas;return at(f,d,{...c,schemas:m})},a=yi(t,{isCLI:n,FlagSchema:i}),D=new ht(a,{logger:r,unknown:s,descriptor:o}),l=r!==!1;l&&er&&(D._hasDeprecationWarned=er);let p=D.normalize(e);return l&&(er=D._hasDeprecationWarned),p}function yi(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(lt.create({name:"_"}));for(let u of e)n.push(Ai(u,{isCLI:t,optionInfos:e,FlagSchema:r})),u.alias&&t&&n.push(Dt.create({name:u.alias,sourceName:u.name}));return n}function Ai(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:u}=e,i={name:u},o,s={};switch(e.type){case"int":o=mt,t&&(i.preprocess=Number);break;case"string":o=je;break;case"choice":o=pt,i.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case"boolean":o=ft;break;case"flag":o=n,i.flags=r.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case"path":o=je;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?i.validate=(a,D,l)=>e.exception(a)||D.validate(a,l):i.validate=(a,D,l)=>a===void 0||D.validate(a,l),e.redirect&&(s.redirect=a=>a?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let a=i.preprocess||(D=>D);i.preprocess=(D,l,p)=>l.preprocess(a(Array.isArray(D)?A(!1,D,-1):D),p)}return e.array?ct.create({...t?{preprocess:a=>Array.isArray(a)?a:[a]}:{},...s,valueSchema:o.create(i)}):o.create({...i,...s})}var Rn=gi;var vi=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let u=t[n];if(r(u,n,t))return u}}},tr=vi;function rr(e,t){if(!t)throw new Error("parserName is required.");let r=tr(!1,e,u=>u.parsers&&Object.prototype.hasOwnProperty.call(u.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Re(n)}function Yn(e,t){if(!t)throw new Error("astFormat is required.");let r=tr(!1,e,u=>u.printers&&Object.prototype.hasOwnProperty.call(u.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Re(n)}function Et({plugins:e,parser:t}){let r=rr(e,t);return nr(r,t)}function nr(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function jn(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var Hn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function Bi(e,t={}){var p;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=pn(r,{physicalFile:r.filepath}),!r.parser)throw new Ye(`No parser could be inferred for file "${r.filepath}".`)}else throw new Ye("No parser and no file path given, couldn't infer a parser.");let n=it({plugins:e.plugins,showDeprecated:!0}).options,u={...Hn,...Object.fromEntries(n.filter(f=>f.default!==void 0).map(f=>[f.name,f.default]))},i=rr(r.plugins,r.parser),o=await nr(i,r.parser);r.astFormat=o.astFormat,r.locEnd=o.locEnd,r.locStart=o.locStart;let s=(p=i.printers)!=null&&p[o.astFormat]?i:Yn(r.plugins,o.astFormat),a=await jn(s,o.astFormat);r.printer=a;let D=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,f])=>f!==void 0)):{},l={...u,...D};for(let[f,d]of Object.entries(l))(r[f]===null||r[f]===void 0)&&(r[f]=d);return r.parser==="json"&&(r.trailingComma="none"),Rn(r,n,{passThrough:Object.keys(Hn),...t})}var se=Bi;var Mn=Me($n(),1);async function bi(e,t){let r=await Et(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let u;try{u=await r.parse(n,t,t)}catch(i){Ni(i,e)}return{text:n,ast:u}}function Ni(e,t){let{loc:r}=e;if(r){let n=(0,Mn.codeFrameColumns)(t,r,{highlightCode:!0});throw e.message+=` +`+n,e.codeFrame=n,e}throw e}var fe=bi;async function Vn(e,t,r,n,u){let{embeddedLanguageFormatting:i,printer:{embed:o,hasPrettierIgnore:s=()=>!1,getVisitorKeys:a}}=r;if(!o||i!=="auto")return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let D=q(o.getVisitorKeys??a),l=[];d();let p=e.stack;for(let{print:c,node:F,pathStack:m}of l)try{e.stack=m;let h=await c(f,t,e,r);h&&u.set(F,h)}catch(h){if(globalThis.PRETTIER_DEBUG)throw h}e.stack=p;function f(c,F){return Oi(c,F,r,n)}function d(){let{node:c}=e;if(c===null||typeof c!="object"||s(e))return;for(let m of D(c))Array.isArray(c[m])?e.each(d,m):e.call(d,m);let F=o(e,r);if(F){if(typeof F=="function"){l.push({print:F,node:c,pathStack:[...e.stack]});return}u.set(c,F)}}}async function Oi(e,t,r,n){let u=await se({...r,...t,parentParser:r.parser,originalText:e},{passThrough:!0}),{ast:i}=await fe(e,u),o=await n(i,u);return qe(o)}function Si(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:u,locEnd:i,[Symbol.for("printedComments")]:o}=t,{node:s}=e,a=u(s),D=i(s);for(let l of n)u(l)>=a&&i(l)<=D&&o.add(l);return r.slice(a,D)}var Un=Si;async function He(e,t){({ast:e}=await ir(e,t));let r=new Map,n=new qr(e),u=cn(t),i=new Map;await Vn(n,s,t,He,i);let o=await zn(n,t,s,void 0,i);if(ln(t),t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Z,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Z];return o;function s(D,l){return D===void 0||D===n?a(l):Array.isArray(D)?n.call(()=>a(l),...D):n.call(()=>a(l),D)}function a(D){u(n);let l=n.node;if(l==null)return"";let p=l&&typeof l=="object"&&D===void 0;if(p&&r.has(l))return r.get(l);let f=zn(n,t,s,D,i);return p&&r.set(l,f),f}}function zn(e,t,r,n,u){var a;let{node:i}=e,{printer:o}=t,s;switch((a=o.hasPrettierIgnore)!=null&&a.call(o,e)?s=Un(e,t):u.has(i)?s=u.get(i):s=o.print(e,t,r,n),i){case t.cursorNode:s=me(s,D=>[Z,D,Z]);break;case t.nodeBeforeCursor:s=me(s,D=>[D,Z]);break;case t.nodeAfterCursor:s=me(s,D=>[Z,D]);break}return o.printComment&&(!o.willPrintOwnComments||!o.willPrintOwnComments(e,t))&&(s=Dn(e,s,t)),s}async function ir(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("tokens")]=e.tokens??[],t[Symbol.for("printedComments")]=new Set,on(e,t);let{printer:{preprocess:n}}=t;return e=n?await n(e,t):e,{ast:e,comments:r}}function Ti(e,t){let{cursorOffset:r,locStart:n,locEnd:u}=t,i=q(t.printer.getVisitorKeys),o=d=>n(d)<=r&&u(d)>=r,s=e,a=[e];for(let d of Zr(e,{getVisitorKeys:i,filter:o}))a.push(d),s=d;if(en(s,{getVisitorKeys:i}))return{cursorNode:s};let D,l,p=-1,f=Number.POSITIVE_INFINITY;for(;a.length>0&&(D===void 0||l===void 0);){s=a.pop();let d=D!==void 0,c=l!==void 0;for(let F of ye(s,{getVisitorKeys:i})){if(!d){let m=u(F);m<=r&&m>p&&(D=F,p=m)}if(!c){let m=n(F);m>=r&&mo(f,a)).filter(Boolean);let D={},l=new Set(u(s));for(let f in s)!Object.prototype.hasOwnProperty.call(s,f)||i.has(f)||(l.has(f)?D[f]=o(s[f],s):D[f]=s[f]);let p=r(s,D,a);if(p!==null)return p??D}}var Kn=ki;var Li=(e,t,r)=>{if(!(e&&t==null)){if(t.findLastIndex)return t.findLastIndex(r);for(let n=t.length-1;n>=0;n--){let u=t[n];if(r(u,n,t))return n}return-1}},Jn=Li;var Pi=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function Ii(e,t){let r=[e.node,...e.parentNodes],n=new Set([t.node,...t.parentNodes]);return r.find(u=>Qn.has(u.type)&&n.has(u))}function qn(e){let t=Jn(!1,e,r=>r.type!=="Program"&&r.type!=="File");return t===-1?e:e.slice(0,t+1)}function Ri(e,t,{locStart:r,locEnd:n}){let u=e.node,i=t.node;if(u===i)return{startNode:u,endNode:i};let o=r(e.node);for(let a of qn(t.parentNodes))if(r(a)>=o)i=a;else break;let s=n(t.node);for(let a of qn(e.parentNodes)){if(n(a)<=s)u=a;else break;if(u===i)break}return{startNode:u,endNode:i}}function or(e,t,r,n,u=[],i){let{locStart:o,locEnd:s}=r,a=o(e),D=s(e);if(!(t>D||tn);let s=e.slice(n,u).search(/\S/u),a=s===-1;if(!a)for(n+=s;u>n&&!/\S/u.test(e[u-1]);--u);let D=or(r,n,t,(d,c)=>Xn(t,d,c),[],"rangeStart"),l=a?D:or(r,u,t,d=>Xn(t,d),[],"rangeEnd");if(!D||!l)return{rangeStart:0,rangeEnd:0};let p,f;if(Pi(t)){let d=Ii(D,l);p=d,f=d}else({startNode:p,endNode:f}=Ri(D,l,t));return{rangeStart:Math.min(i(p),i(f)),rangeEnd:Math.max(o(p),o(f))}}var nu="\uFEFF",eu=Symbol("cursor");async function uu(e,t,r=0){if(!e||e.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:u}=await fe(e,t);t.cursorOffset>=0&&(t={...t,...Gn(n,t)});let i=await He(n,t,r);r>0&&(i=Ze([K,i],r,t.tabWidth));let o=Ce(i,t);if(r>0){let a=o.formatted.trim();o.cursorNodeStart!==void 0&&(o.cursorNodeStart-=o.formatted.indexOf(a),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>a.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=a+be(t.endOfLine)}let s=t[Symbol.for("comments")];if(t.cursorOffset>=0){let a,D,l,p;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(l=o.cursorNodeStart,p=o.cursorNodeText,t.cursorNode)a=t.locStart(t.cursorNode),D=u.slice(a,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");a=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let h=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):u.length;D=u.slice(a,h)}else a=0,D=u,l=0,p=o.formatted;let f=t.cursorOffset-a;if(D===p)return{formatted:o.formatted,cursorOffset:l+f,comments:s};let d=D.split("");d.splice(f,0,eu);let c=p.split(""),F=yr(d,c),m=l;for(let h of F)if(h.removed){if(h.value.includes(eu))break}else m+=h.count;return{formatted:o.formatted,cursorOffset:m,comments:s}}return{formatted:o.formatted,cursorOffset:-1,comments:s}}async function Hi(e,t){let{ast:r,text:n}=await fe(e,t),{rangeStart:u,rangeEnd:i}=Zn(n,t,r),o=n.slice(u,i),s=Math.min(u,n.lastIndexOf(` +`,u)+1),a=n.slice(s,u).match(/^\s*/u)[0],D=ge(a,t.tabWidth),l=await uu(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>u&&t.cursorOffset<=i?t.cursorOffset-u:-1,endOfLine:"lf"},D),p=l.formatted.trimEnd(),{cursorOffset:f}=t;f>i?f+=p.length-o.length:l.cursorOffset>=0&&(f=l.cursorOffset+u);let d=n.slice(0,u)+p+n.slice(i);if(t.endOfLine!=="lf"){let c=be(t.endOfLine);f>=0&&c===`\r +`&&(f+=Nt(d.slice(0,f),` +`)),d=ne(!1,d,` +`,c)}return{formatted:d,cursorOffset:f,comments:l.comments}}function sr(e,t,r){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?r:t}function tu(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:u}=t;return r=sr(e,r,-1),n=sr(e,n,0),u=sr(e,u,e.length),{...t,cursorOffset:r,rangeStart:n,rangeEnd:u}}function iu(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:i}=tu(e,t),o=e.charAt(0)===nu;if(o&&(e=e.slice(1),r--,n--,u--),i==="auto"&&(i=Ar(e)),e.includes("\r")){let s=a=>Nt(e.slice(0,Math.max(a,0)),`\r +`);r-=s(r),n-=s(n),u-=s(u),e=vr(e)}return{hasBOM:o,text:e,options:tu(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:i})}}async function ru(e,t){let r=await Et(t);return!r.hasPragma||r.hasPragma(e)}async function ar(e,t){let{hasBOM:r,text:n,options:u}=iu(e,await se(t));if(u.rangeStart>=u.rangeEnd&&n!==""||u.requirePragma&&!await ru(n,u))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let i;return u.rangeStart>0||u.rangeEnd=0&&i.cursorOffset++),i}async function ou(e,t,r){let{text:n,options:u}=iu(e,await se(t)),i=await fe(n,u);return r&&(r.preprocessForPrint&&(i.ast=await ir(i.ast,u)),r.massage&&(i.ast=Kn(i.ast,u))),i}async function su(e,t){t=await se(t);let r=await He(e,t);return Ce(r,t)}async function au(e,t){let r=Vr(e),{formatted:n}=await ar(r,{...t,parser:"__js_expression"});return n}async function Du(e,t){t=await se(t);let{ast:r}=await fe(e,t);return He(r,t)}async function lu(e,t){return Ce(e,await se(t))}var Dr={};vt(Dr,{builders:()=>$i,printer:()=>Mi,utils:()=>Vi});var $i={join:Se,line:Qe,softline:$r,hardline:K,literalline:Xe,group:kt,conditionalGroup:Ir,fill:Rr,lineSuffix:Te,lineSuffixBoundary:Hr,cursor:Z,breakParent:he,ifBreak:Yr,trim:Wr,indent:le,indentIfBreak:jr,align:De,addAlignmentToDoc:Ze,markAsRoot:Lr,dedentToRoot:kr,dedent:Pr,hardlineWithoutBreakParent:ke,literallineWithoutBreakParent:Lt,label:Mr,concat:e=>e},Mi={printDocToString:Ce},Vi={willBreak:xr,traverseDoc:Fe,findInDoc:Je,mapDoc:Oe,removeLines:Nr,stripTrailingHardline:qe,replaceEndOfLine:Or,canBreak:Sr};var cu="3.5.3";var cr={};vt(cr,{addDanglingComment:()=>re,addLeadingComment:()=>ue,addTrailingComment:()=>ie,getAlignmentSize:()=>ge,getIndentSize:()=>fu,getMaxContinuousCount:()=>du,getNextNonSpaceNonCommentCharacter:()=>pu,getNextNonSpaceNonCommentCharacterIndex:()=>no,getPreferredQuote:()=>mu,getStringWidth:()=>Le,hasNewline:()=>V,hasNewlineInRange:()=>hu,hasSpaces:()=>Eu,isNextLineEmpty:()=>so,isNextLineEmptyAfterIndex:()=>Ct,isPreviousLineEmpty:()=>io,makeString:()=>Cu,skip:()=>Ae,skipEverythingButNewLine:()=>nt,skipInlineComment:()=>Be,skipNewline:()=>W,skipSpaces:()=>S,skipToLineEnd:()=>rt,skipTrailingComment:()=>we,skipWhitespace:()=>tn});function Ui(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;rMath.max(n,u.length/t.length),0)}var du=qi;function Xi(e,t){let r=We(e,t);return r===!1?"":e.charAt(r)}var pu=Xi;var gt="'",Fu='"';function Qi(e,t){let r=t===!0||t===gt?gt:Fu,n=r===gt?Fu:gt,u=0,i=0;for(let o of e)o===r?u++:o===n&&i++;return u>i?n:r}var mu=Qi;function Zi(e,t,r){for(let n=t;ns===n?s:a===t?"\\"+a:a||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)?s:"\\"+s));return t+i+t}var Cu=to;function ro(e,t,r){return We(e,r(t))}function no(e,t){return arguments.length===2||typeof t=="number"?We(e,t):ro(...arguments)}function uo(e,t,r){return Ie(e,r(t))}function io(e,t){return arguments.length===2||typeof t=="number"?Ie(e,t):uo(...arguments)}function oo(e,t,r){return Ct(e,r(t))}function so(e,t){return arguments.length===2||typeof t=="number"?Ct(e,t):oo(...arguments)}function de(e,t=1){return async(...r)=>{let n=r[t]??{},u=n.plugins??[];return r[t]={...n,plugins:Array.isArray(u)?u:Object.values(u)},e(...r)}}var gu=de(ar);async function yu(e,t){let{formatted:r}=await gu(e,{...t,cursorOffset:-1});return r}async function ao(e,t){return await yu(e,t)===e}var Do=de(it,0),lo={parse:de(ou),formatAST:de(su),formatDoc:de(au),printToDoc:de(Du),printDocToString:de(lu)};var mc=fr;export{lo as __debug,ao as check,mc as default,Dr as doc,yu as format,gu as formatWithCursor,Do as getSupportInfo,cr as util,cu as version}; diff --git a/node_modules/punycode/LICENSE-MIT.txt b/node_modules/punycode/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/punycode/README.md b/node_modules/punycode/README.md new file mode 100644 index 0000000..f611016 --- /dev/null +++ b/node_modules/punycode/README.md @@ -0,0 +1,148 @@ +# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/punycode) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode) + +Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). + +This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1). + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install punycode --save +``` + +In [Node.js](https://nodejs.org/): + +> ⚠️ Note that userland modules don't hide core modules. +> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`. +> Use `require('punycode/')` to import userland modules rather than core modules. + +```js +const punycode = require('punycode/'); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## For maintainers + +### How to publish a new release + +1. On the `main` branch, bump the version number in `package.json`: + + ```sh + npm version patch -m 'Release v%s' + ``` + + Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/). + + Note that this produces a Git commit + tag. + +1. Push the release commit and tag: + + ```sh + git push && git push --tags + ``` + + Our CI then automatically publishes the new release to npm, under both the [`punycode`](https://www.npmjs.com/package/punycode) and [`punycode.js`](https://www.npmjs.com/package/punycode.js) names. + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/punycode/package.json b/node_modules/punycode/package.json new file mode 100644 index 0000000..b8b76fc --- /dev/null +++ b/node_modules/punycode/package.json @@ -0,0 +1,58 @@ +{ + "name": "punycode", + "version": "2.3.1", + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "homepage": "https://mths.be/punycode", + "main": "punycode.js", + "jsnext:main": "punycode.es6.js", + "module": "punycode.es6.js", + "engines": { + "node": ">=6" + }, + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/punycode.js.git" + }, + "bugs": "https://github.com/mathiasbynens/punycode.js/issues", + "files": [ + "LICENSE-MIT.txt", + "punycode.js", + "punycode.es6.js" + ], + "scripts": { + "test": "mocha tests", + "build": "node scripts/prepublish.js" + }, + "devDependencies": { + "codecov": "^3.8.3", + "nyc": "^15.1.0", + "mocha": "^10.2.0" + }, + "jspm": { + "map": { + "./punycode.js": { + "node": "@node/punycode" + } + } + } +} diff --git a/node_modules/punycode/punycode.es6.js b/node_modules/punycode/punycode.es6.js new file mode 100644 index 0000000..dadece2 --- /dev/null +++ b/node_modules/punycode/punycode.es6.js @@ -0,0 +1,444 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.3.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode }; +export default punycode; diff --git a/node_modules/punycode/punycode.js b/node_modules/punycode/punycode.js new file mode 100644 index 0000000..a1ef251 --- /dev/null +++ b/node_modules/punycode/punycode.js @@ -0,0 +1,443 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.3.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +module.exports = punycode; diff --git a/node_modules/queue-microtask/LICENSE b/node_modules/queue-microtask/LICENSE new file mode 100755 index 0000000..c7e6852 --- /dev/null +++ b/node_modules/queue-microtask/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/queue-microtask/README.md b/node_modules/queue-microtask/README.md new file mode 100644 index 0000000..0be05a6 --- /dev/null +++ b/node_modules/queue-microtask/README.md @@ -0,0 +1,90 @@ +# queue-microtask [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[ci-image]: https://img.shields.io/github/workflow/status/feross/queue-microtask/ci/master +[ci-url]: https://github.com/feross/queue-microtask/actions +[npm-image]: https://img.shields.io/npm/v/queue-microtask.svg +[npm-url]: https://npmjs.org/package/queue-microtask +[downloads-image]: https://img.shields.io/npm/dm/queue-microtask.svg +[downloads-url]: https://npmjs.org/package/queue-microtask +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +### fast, tiny [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) shim for modern engines + +- Use [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) in all modern JS engines. +- No dependencies. Less than 10 lines. No shims or complicated fallbacks. +- Optimal performance in all modern environments + - Uses `queueMicrotask` in modern environments + - Fallback to `Promise.resolve().then(fn)` in Node.js 10 and earlier, and old browsers (same performance as `queueMicrotask`) + +## install + +``` +npm install queue-microtask +``` + +## usage + +```js +const queueMicrotask = require('queue-microtask') + +queueMicrotask(() => { /* this will run soon */ }) +``` + +## What is `queueMicrotask` and why would one use it? + +The `queueMicrotask` function is a WHATWG standard. It queues a microtask to be executed prior to control returning to the event loop. + +A microtask is a short function which will run after the current task has completed its work and when there is no other code waiting to be run before control of the execution context is returned to the event loop. + +The code `queueMicrotask(fn)` is equivalent to the code `Promise.resolve().then(fn)`. It is also very similar to [`process.nextTick(fn)`](https://nodejs.org/api/process.html#process_process_nexttick_callback_args) in Node. + +Using microtasks lets code run without interfering with any other, potentially higher priority, code that is pending, but before the JS engine regains control over the execution context. + +See the [spec](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing) or [Node documentation](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback) for more information. + +## Who is this package for? + +This package allows you to use `queueMicrotask` safely in all modern JS engines. Use it if you prioritize small JS bundle size over support for old browsers. + +If you just need to support Node 12 and later, use `queueMicrotask` directly. If you need to support all versions of Node, use this package. + +## Why not use `process.nextTick`? + +In Node, `queueMicrotask` and `process.nextTick` are [essentially equivalent](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback), though there are [subtle differences](https://github.com/YuzuJS/setImmediate#macrotasks-and-microtasks) that don't matter in most situations. + +You can think of `queueMicrotask` as a standardized version of `process.nextTick` that works in the browser. No need to rely on your browser bundler to shim `process` for the browser environment. + +## Why not use `setTimeout(fn, 0)`? + +This approach is the most compatible, but it has problems. Modern browsers throttle timers severely, so `setTimeout(…, 0)` usually takes at least 4ms to run. Furthermore, the throttling gets even worse if the page is backgrounded. If you have many `setTimeout` calls, then this can severely limit the performance of your program. + +## Why not use a microtask library like [`immediate`](https://www.npmjs.com/package/immediate) or [`asap`](https://www.npmjs.com/package/asap)? + +These packages are great! However, if you prioritize small JS bundle size over optimal performance in old browsers then you may want to consider this package. + +This package (`queue-microtask`) is four times smaller than `immediate`, twice as small as `asap`, and twice as small as using `process.nextTick` and letting the browser bundler shim it automatically. + +Note: This package throws an exception in JS environments which lack `Promise` support -- which are usually very old browsers and Node.js versions. + +Since the `queueMicrotask` API is supported in Node.js, Chrome, Firefox, Safari, Opera, and Edge, **the vast majority of users will get optimal performance**. Any JS environment with `Promise`, which is almost all of them, also get optimal performance. If you need support for JS environments which lack `Promise` support, use one of the alternative packages. + +## What is a shim? + +> In computer programming, a shim is a library that transparently intercepts API calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. – [Wikipedia](https://en.wikipedia.org/wiki/Shim_(computing)) + +This package could also be described as a "ponyfill". + +> A ponyfill is almost the same as a polyfill, but not quite. Instead of patching functionality for older browsers, a ponyfill provides that functionality as a standalone module you can use. – [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills) + +## API + +### `queueMicrotask(fn)` + +The `queueMicrotask()` method queues a microtask. + +The `fn` argument is a function to be executed after all pending tasks have completed but before yielding control to the browser's event loop. + +## license + +MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org). diff --git a/node_modules/queue-microtask/index.js b/node_modules/queue-microtask/index.js new file mode 100644 index 0000000..5560534 --- /dev/null +++ b/node_modules/queue-microtask/index.js @@ -0,0 +1,9 @@ +/*! queue-microtask. MIT License. Feross Aboukhadijeh */ +let promise + +module.exports = typeof queueMicrotask === 'function' + ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) + // reuse resolved promise, and allocate it lazily + : cb => (promise || (promise = Promise.resolve())) + .then(cb) + .catch(err => setTimeout(() => { throw err }, 0)) diff --git a/node_modules/queue-microtask/package.json b/node_modules/queue-microtask/package.json new file mode 100644 index 0000000..d29a401 --- /dev/null +++ b/node_modules/queue-microtask/package.json @@ -0,0 +1,55 @@ +{ + "name": "queue-microtask", + "description": "fast, tiny `queueMicrotask` shim for modern engines", + "version": "1.2.3", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/queue-microtask/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.2.2" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "homepage": "https://github.com/feross/queue-microtask", + "keywords": [ + "asap", + "immediate", + "micro task", + "microtask", + "nextTick", + "process.nextTick", + "queue micro task", + "queue microtask", + "queue-microtask", + "queueMicrotask", + "setImmediate", + "task" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/queue-microtask.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/resolve-from/index.js b/node_modules/resolve-from/index.js new file mode 100644 index 0000000..d092447 --- /dev/null +++ b/node_modules/resolve-from/index.js @@ -0,0 +1,47 @@ +'use strict'; +const path = require('path'); +const Module = require('module'); +const fs = require('fs'); + +const resolveFrom = (fromDir, moduleId, silent) => { + if (typeof fromDir !== 'string') { + throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``); + } + + if (typeof moduleId !== 'string') { + throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); + } + + try { + fromDir = fs.realpathSync(fromDir); + } catch (err) { + if (err.code === 'ENOENT') { + fromDir = path.resolve(fromDir); + } else if (silent) { + return null; + } else { + throw err; + } + } + + const fromFile = path.join(fromDir, 'noop.js'); + + const resolveFileName = () => Module._resolveFilename(moduleId, { + id: fromFile, + filename: fromFile, + paths: Module._nodeModulePaths(fromDir) + }); + + if (silent) { + try { + return resolveFileName(); + } catch (err) { + return null; + } + } + + return resolveFileName(); +}; + +module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId); +module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true); diff --git a/node_modules/resolve-from/license b/node_modules/resolve-from/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/resolve-from/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/resolve-from/package.json b/node_modules/resolve-from/package.json new file mode 100644 index 0000000..96bade5 --- /dev/null +++ b/node_modules/resolve-from/package.json @@ -0,0 +1,34 @@ +{ + "name": "resolve-from", + "version": "4.0.0", + "description": "Resolve the path of a module like `require.resolve()` but from a given path", + "license": "MIT", + "repository": "sindresorhus/resolve-from", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "require", + "resolve", + "path", + "module", + "from", + "like", + "import" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/node_modules/resolve-from/readme.md b/node_modules/resolve-from/readme.md new file mode 100644 index 0000000..e539f85 --- /dev/null +++ b/node_modules/resolve-from/readme.md @@ -0,0 +1,72 @@ +# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) + +> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path + + +## Install + +``` +$ npm install resolve-from +``` + + +## Usage + +```js +const resolveFrom = require('resolve-from'); + +// There is a file at `./foo/bar.js` + +resolveFrom('foo', './bar'); +//=> '/Users/sindresorhus/dev/test/foo/bar.js' +``` + + +## API + +### resolveFrom(fromDir, moduleId) + +Like `require()`, throws when the module can't be found. + +### resolveFrom.silent(fromDir, moduleId) + +Returns `null` instead of throwing when the module can't be found. + +#### fromDir + +Type: `string` + +Directory to resolve from. + +#### moduleId + +Type: `string` + +What you would use in `require()`. + + +## Tip + +Create a partial using a bound function if you want to resolve from the same `fromDir` multiple times: + +```js +const resolveFromFoo = resolveFrom.bind(null, 'foo'); + +resolveFromFoo('./bar'); +resolveFromFoo('./baz'); +``` + + +## Related + +- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory +- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path +- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory +- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point +- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily +- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/reusify/LICENSE b/node_modules/reusify/LICENSE new file mode 100644 index 0000000..56d1590 --- /dev/null +++ b/node_modules/reusify/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015-2024 Matteo Collina + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/reusify/README.md b/node_modules/reusify/README.md new file mode 100644 index 0000000..1aaee5d --- /dev/null +++ b/node_modules/reusify/README.md @@ -0,0 +1,139 @@ +# reusify + +[![npm version][npm-badge]][npm-url] + +Reuse your objects and functions for maximum speed. This technique will +make any function run ~10% faster. You call your functions a +lot, and it adds up quickly in hot code paths. + +``` +$ node benchmarks/createNoCodeFunction.js +Total time 53133 +Total iterations 100000000 +Iteration/s 1882069.5236482036 + +$ node benchmarks/reuseNoCodeFunction.js +Total time 50617 +Total iterations 100000000 +Iteration/s 1975620.838848608 +``` + +The above benchmark uses fibonacci to simulate a real high-cpu load. +The actual numbers might differ for your use case, but the difference +should not. + +The benchmark was taken using Node v6.10.0. + +This library was extracted from +[fastparallel](http://npm.im/fastparallel). + +## Example + +```js +var reusify = require('reusify') +var fib = require('reusify/benchmarks/fib') +var instance = reusify(MyObject) + +// get an object from the cache, +// or creates a new one when cache is empty +var obj = instance.get() + +// set the state +obj.num = 100 +obj.func() + +// reset the state. +// if the state contains any external object +// do not use delete operator (it is slow) +// prefer set them to null +obj.num = 0 + +// store an object in the cache +instance.release(obj) + +function MyObject () { + // you need to define this property + // so V8 can compile MyObject into an + // hidden class + this.next = null + this.num = 0 + + var that = this + + // this function is never reallocated, + // so it can be optimized by V8 + this.func = function () { + if (null) { + // do nothing + } else { + // calculates fibonacci + fib(that.num) + } + } +} +``` + +The above example was intended for synchronous code, let's see async: +```js +var reusify = require('reusify') +var instance = reusify(MyObject) + +for (var i = 0; i < 100; i++) { + getData(i, console.log) +} + +function getData (value, cb) { + var obj = instance.get() + + obj.value = value + obj.cb = cb + obj.run() +} + +function MyObject () { + this.next = null + this.value = null + + var that = this + + this.run = function () { + asyncOperation(that.value, that.handle) + } + + this.handle = function (err, result) { + that.cb(err, result) + that.value = null + that.cb = null + instance.release(that) + } +} +``` + +Also note how in the above examples, the code, that consumes an instance of `MyObject`, +reset the state to initial condition, just before storing it in the cache. +That's needed so that every subsequent request for an instance from the cache, +could get a clean instance. + +## Why + +It is faster because V8 doesn't have to collect all the functions you +create. On a short-lived benchmark, it is as fast as creating the +nested function, but on a longer time frame it creates less +pressure on the garbage collector. + +## Other examples +If you want to see some complex example, checkout [middie](https://github.com/fastify/middie) and [steed](https://github.com/mcollina/steed). + +## Acknowledgements + +Thanks to [Trevor Norris](https://github.com/trevnorris) for +getting me down the rabbit hole of performance, and thanks to [Mathias +Buss](http://github.com/mafintosh) for suggesting me to share this +trick. + +## License + +MIT + +[npm-badge]: https://badge.fury.io/js/reusify.svg +[npm-url]: https://badge.fury.io/js/reusify diff --git a/node_modules/reusify/SECURITY.md b/node_modules/reusify/SECURITY.md new file mode 100644 index 0000000..dd9f1d5 --- /dev/null +++ b/node_modules/reusify/SECURITY.md @@ -0,0 +1,15 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 1.x | :white_check_mark: | +| < 1.0 | :x: | + +## Reporting a Vulnerability + +Please report all vulnerabilities at [https://github.com/mcollina/fastq/security](https://github.com/mcollina/fastq/security). diff --git a/node_modules/reusify/benchmarks/createNoCodeFunction.js b/node_modules/reusify/benchmarks/createNoCodeFunction.js new file mode 100644 index 0000000..ce1aac7 --- /dev/null +++ b/node_modules/reusify/benchmarks/createNoCodeFunction.js @@ -0,0 +1,30 @@ +'use strict' + +var fib = require('./fib') +var max = 100000000 +var start = Date.now() + +// create a funcion with the typical error +// pattern, that delegates the heavy load +// to something else +function createNoCodeFunction () { + /* eslint no-constant-condition: "off" */ + var num = 100 + + ;(function () { + if (null) { + // do nothing + } else { + fib(num) + } + })() +} + +for (var i = 0; i < max; i++) { + createNoCodeFunction() +} + +var time = Date.now() - start +console.log('Total time', time) +console.log('Total iterations', max) +console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/benchmarks/fib.js b/node_modules/reusify/benchmarks/fib.js new file mode 100644 index 0000000..e22cc48 --- /dev/null +++ b/node_modules/reusify/benchmarks/fib.js @@ -0,0 +1,13 @@ +'use strict' + +function fib (num) { + var fib = [] + + fib[0] = 0 + fib[1] = 1 + for (var i = 2; i <= num; i++) { + fib[i] = fib[i - 2] + fib[i - 1] + } +} + +module.exports = fib diff --git a/node_modules/reusify/benchmarks/reuseNoCodeFunction.js b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js new file mode 100644 index 0000000..3358d6e --- /dev/null +++ b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js @@ -0,0 +1,38 @@ +'use strict' + +var reusify = require('../') +var fib = require('./fib') +var instance = reusify(MyObject) +var max = 100000000 +var start = Date.now() + +function reuseNoCodeFunction () { + var obj = instance.get() + obj.num = 100 + obj.func() + obj.num = 0 + instance.release(obj) +} + +function MyObject () { + this.next = null + var that = this + this.num = 0 + this.func = function () { + /* eslint no-constant-condition: "off" */ + if (null) { + // do nothing + } else { + fib(that.num) + } + } +} + +for (var i = 0; i < max; i++) { + reuseNoCodeFunction() +} + +var time = Date.now() - start +console.log('Total time', time) +console.log('Total iterations', max) +console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/eslint.config.js b/node_modules/reusify/eslint.config.js new file mode 100644 index 0000000..d0a9af6 --- /dev/null +++ b/node_modules/reusify/eslint.config.js @@ -0,0 +1,14 @@ +'use strict' + +const base = require('neostandard')({}) + +module.exports = [ + ...base, + { + name: 'old-standard', + rules: { + 'no-var': 'off', + 'object-shorthand': 'off', + } + } +] diff --git a/node_modules/reusify/package.json b/node_modules/reusify/package.json new file mode 100644 index 0000000..e47ff11 --- /dev/null +++ b/node_modules/reusify/package.json @@ -0,0 +1,50 @@ +{ + "name": "reusify", + "version": "1.1.0", + "description": "Reuse objects and functions with style", + "main": "reusify.js", + "types": "reusify.d.ts", + "scripts": { + "lint": "eslint", + "test": "tape test.js", + "test:coverage": "c8 --100 tape test.js", + "test:typescript": "tsc" + }, + "pre-commit": [ + "lint", + "test", + "test:typescript" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/reusify.git" + }, + "keywords": [ + "reuse", + "object", + "performance", + "function", + "fast" + ], + "author": "Matteo Collina ", + "license": "MIT", + "bugs": { + "url": "https://github.com/mcollina/reusify/issues" + }, + "homepage": "https://github.com/mcollina/reusify#readme", + "engines": { + "node": ">=0.10.0", + "iojs": ">=1.0.0" + }, + "devDependencies": { + "@types/node": "^22.9.0", + "eslint": "^9.13.0", + "neostandard": "^0.12.0", + "pre-commit": "^1.2.2", + "tape": "^5.0.0", + "c8": "^10.1.2", + "typescript": "^5.2.2" + }, + "dependencies": { + } +} diff --git a/node_modules/reusify/reusify.js b/node_modules/reusify/reusify.js new file mode 100644 index 0000000..e6f36f3 --- /dev/null +++ b/node_modules/reusify/reusify.js @@ -0,0 +1,33 @@ +'use strict' + +function reusify (Constructor) { + var head = new Constructor() + var tail = head + + function get () { + var current = head + + if (current.next) { + head = current.next + } else { + head = new Constructor() + tail = head + } + + current.next = null + + return current + } + + function release (obj) { + tail.next = obj + tail = obj + } + + return { + get: get, + release: release + } +} + +module.exports = reusify diff --git a/node_modules/reusify/test.js b/node_modules/reusify/test.js new file mode 100644 index 0000000..929cfd7 --- /dev/null +++ b/node_modules/reusify/test.js @@ -0,0 +1,66 @@ +'use strict' + +var test = require('tape') +var reusify = require('./') + +test('reuse objects', function (t) { + t.plan(6) + + function MyObject () { + t.pass('constructor called') + this.next = null + } + + var instance = reusify(MyObject) + var obj = instance.get() + + t.notEqual(obj, instance.get(), 'two instance created') + t.notOk(obj.next, 'next must be null') + + instance.release(obj) + + // the internals keeps a hot copy ready for reuse + // putting this one back in the queue + instance.release(instance.get()) + + // comparing the old one with the one we got + // never do this in real code, after release you + // should never reuse that instance + t.equal(obj, instance.get(), 'instance must be reused') +}) + +test('reuse more than 2 objects', function (t) { + function MyObject () { + t.pass('constructor called') + this.next = null + } + + var instance = reusify(MyObject) + var obj = instance.get() + var obj2 = instance.get() + var obj3 = instance.get() + + t.notOk(obj.next, 'next must be null') + t.notOk(obj2.next, 'next must be null') + t.notOk(obj3.next, 'next must be null') + + t.notEqual(obj, obj2) + t.notEqual(obj, obj3) + t.notEqual(obj3, obj2) + + instance.release(obj) + instance.release(obj2) + instance.release(obj3) + + // skip one + instance.get() + + var obj4 = instance.get() + var obj5 = instance.get() + var obj6 = instance.get() + + t.equal(obj4, obj) + t.equal(obj5, obj2) + t.equal(obj6, obj3) + t.end() +}) diff --git a/node_modules/reusify/tsconfig.json b/node_modules/reusify/tsconfig.json new file mode 100644 index 0000000..dbe862b --- /dev/null +++ b/node_modules/reusify/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "noEmit": true, + "strict": true + }, + "files": [ + "./reusify.d.ts" + ] +} diff --git a/node_modules/run-parallel/LICENSE b/node_modules/run-parallel/LICENSE new file mode 100644 index 0000000..c7e6852 --- /dev/null +++ b/node_modules/run-parallel/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/run-parallel/README.md b/node_modules/run-parallel/README.md new file mode 100644 index 0000000..edc3da4 --- /dev/null +++ b/node_modules/run-parallel/README.md @@ -0,0 +1,85 @@ +# run-parallel [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/run-parallel/master.svg +[travis-url]: https://travis-ci.org/feross/run-parallel +[npm-image]: https://img.shields.io/npm/v/run-parallel.svg +[npm-url]: https://npmjs.org/package/run-parallel +[downloads-image]: https://img.shields.io/npm/dm/run-parallel.svg +[downloads-url]: https://npmjs.org/package/run-parallel +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +### Run an array of functions in parallel + +![parallel](https://raw.githubusercontent.com/feross/run-parallel/master/img.png) [![Sauce Test Status](https://saucelabs.com/browser-matrix/run-parallel.svg)](https://saucelabs.com/u/run-parallel) + +### install + +``` +npm install run-parallel +``` + +### usage + +#### parallel(tasks, [callback]) + +Run the `tasks` array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its callback, the main +`callback` is immediately called with the value of the error. Once the `tasks` have +completed, the results are passed to the final `callback` as an array. + +It is also possible to use an object instead of an array. Each property will be run as a +function and the results will be passed to the final `callback` as an object instead of +an array. This can be a more readable way of handling the results. + +##### arguments + +- `tasks` - An array or object containing functions to run. Each function is passed a +`callback(err, result)` which it must call on completion with an error `err` (which can +be `null`) and an optional `result` value. +- `callback(err, results)` - An optional callback to run once all the functions have +completed. This function gets a results array (or object) containing all the result +arguments passed to the task callbacks. + +##### example + +```js +var parallel = require('run-parallel') + +parallel([ + function (callback) { + setTimeout(function () { + callback(null, 'one') + }, 200) + }, + function (callback) { + setTimeout(function () { + callback(null, 'two') + }, 100) + } +], +// optional callback +function (err, results) { + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}) +``` + +This module is basically equavalent to +[`async.parallel`](https://github.com/caolan/async#paralleltasks-callback), but it's +handy to just have the one function you need instead of the kitchen sink. Modularity! +Especially handy if you're serving to the browser and need to reduce your javascript +bundle size. + +Works great in the browser with [browserify](http://browserify.org/)! + +### see also + +- [run-auto](https://github.com/feross/run-auto) +- [run-parallel-limit](https://github.com/feross/run-parallel-limit) +- [run-series](https://github.com/feross/run-series) +- [run-waterfall](https://github.com/feross/run-waterfall) + +### license + +MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/run-parallel/index.js b/node_modules/run-parallel/index.js new file mode 100644 index 0000000..6307141 --- /dev/null +++ b/node_modules/run-parallel/index.js @@ -0,0 +1,51 @@ +/*! run-parallel. MIT License. Feross Aboukhadijeh */ +module.exports = runParallel + +const queueMicrotask = require('queue-microtask') + +function runParallel (tasks, cb) { + let results, pending, keys + let isSync = true + + if (Array.isArray(tasks)) { + results = [] + pending = tasks.length + } else { + keys = Object.keys(tasks) + results = {} + pending = keys.length + } + + function done (err) { + function end () { + if (cb) cb(err, results) + cb = null + } + if (isSync) queueMicrotask(end) + else end() + } + + function each (i, err, result) { + results[i] = result + if (--pending === 0 || err) { + done(err) + } + } + + if (!pending) { + // empty + done(null) + } else if (keys) { + // object + keys.forEach(function (key) { + tasks[key](function (err, result) { each(key, err, result) }) + }) + } else { + // array + tasks.forEach(function (task, i) { + task(function (err, result) { each(i, err, result) }) + }) + } + + isSync = false +} diff --git a/node_modules/run-parallel/package.json b/node_modules/run-parallel/package.json new file mode 100644 index 0000000..1f14757 --- /dev/null +++ b/node_modules/run-parallel/package.json @@ -0,0 +1,58 @@ +{ + "name": "run-parallel", + "description": "Run an array of functions in parallel", + "version": "1.2.0", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/run-parallel/issues" + }, + "dependencies": { + "queue-microtask": "^1.2.2" + }, + "devDependencies": { + "airtap": "^3.0.0", + "standard": "*", + "tape": "^5.0.1" + }, + "homepage": "https://github.com/feross/run-parallel", + "keywords": [ + "parallel", + "async", + "function", + "callback", + "asynchronous", + "run", + "array", + "run parallel" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/run-parallel.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/node_modules/semver/LICENSE b/node_modules/semver/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/semver/README.md b/node_modules/semver/README.md new file mode 100644 index 0000000..e952215 --- /dev/null +++ b/node_modules/semver/README.md @@ -0,0 +1,664 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +You can also just load the module for the function that you care about if +you'd like to minimize your footprint. + +```js +// load the whole API at once in a single object +const semver = require('semver') + +// or just load the bits you need +// all of them listed here, just pick and choose what you want + +// classes +const SemVer = require('semver/classes/semver') +const Comparator = require('semver/classes/comparator') +const Range = require('semver/classes/range') + +// functions for working with versions +const semverParse = require('semver/functions/parse') +const semverValid = require('semver/functions/valid') +const semverClean = require('semver/functions/clean') +const semverInc = require('semver/functions/inc') +const semverDiff = require('semver/functions/diff') +const semverMajor = require('semver/functions/major') +const semverMinor = require('semver/functions/minor') +const semverPatch = require('semver/functions/patch') +const semverPrerelease = require('semver/functions/prerelease') +const semverCompare = require('semver/functions/compare') +const semverRcompare = require('semver/functions/rcompare') +const semverCompareLoose = require('semver/functions/compare-loose') +const semverCompareBuild = require('semver/functions/compare-build') +const semverSort = require('semver/functions/sort') +const semverRsort = require('semver/functions/rsort') + +// low-level comparators between versions +const semverGt = require('semver/functions/gt') +const semverLt = require('semver/functions/lt') +const semverEq = require('semver/functions/eq') +const semverNeq = require('semver/functions/neq') +const semverGte = require('semver/functions/gte') +const semverLte = require('semver/functions/lte') +const semverCmp = require('semver/functions/cmp') +const semverCoerce = require('semver/functions/coerce') + +// working with ranges +const semverSatisfies = require('semver/functions/satisfies') +const semverMaxSatisfying = require('semver/ranges/max-satisfying') +const semverMinSatisfying = require('semver/ranges/min-satisfying') +const semverToComparators = require('semver/ranges/to-comparators') +const semverMinVersion = require('semver/ranges/min-version') +const semverValidRange = require('semver/ranges/valid') +const semverOutside = require('semver/ranges/outside') +const semverGtr = require('semver/ranges/gtr') +const semverLtr = require('semver/ranges/ltr') +const semverIntersects = require('semver/ranges/intersects') +const semverSimplifyRange = require('semver/ranges/simplify') +const semverRangeSubset = require('semver/ranges/subset') +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, prerelease, or release. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-n <0|1> + This is the base to be used for the prerelease identifier. + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. +Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer +specification but should not be used anymore. + +## Ranges + +A `version range` is a set of `comparators` that specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and +would match the versions `2.0.0` and `3.1.0`, but not the versions +`1.0.1` or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. +Version `3.4.5` *would* satisfy the range because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose of this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range-matching +semantics. + +Second, a user who has opted into using a prerelease version has +indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for range-matching) +by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +To get out of the prerelease phase, use the `release` option: + +```bash +$ semver 1.2.4-beta.1 -i release +1.2.4 +``` + +#### Prerelease Identifier Base + +The method `.inc` takes an optional parameter 'identifierBase' string +that will let you let your prerelease number as zero-based or one-based. +Set to `false` to omit the prerelease number altogether. +If you do not specify this parameter, it will default to zero-based. + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', '1') +// '1.2.4-beta.1' +``` + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', false) +// '1.2.4-beta' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n 1 +1.2.4-beta.1 +``` + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n false +1.2.4-beta +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless + `includePrerelease` is specified, in which case any version at all + satisfies) +* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0-0` +* `^0.2.3` := `>=0.2.3 <0.3.0-0` +* `^0.0.3` := `>=0.0.3 <0.0.4-0` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0-0` +* `^0.0.x` := `>=0.0.0 <0.1.0-0` +* `^0.0` := `>=0.0.0 <0.1.0-0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0-0` +* `^0.x` := `>=0.0.0 <1.0.0-0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose`: Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease`: Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, releaseType, options, identifier, identifierBase)`: + Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, `prerelease`, or `release`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, `prerelease` will work the + same as `prepatch`. It increments the patch version and then makes a + prerelease. If the input version is already a prerelease it simply + increments it. + * `release` will remove any prerelease part of the version. + * `identifier` can be used to prefix `premajor`, `preminor`, + `prepatch`, or `prerelease` version increments. `identifierBase` + is the base to be used for the `prerelease` identifier. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of `compare`. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. +* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`. +* `diff(v1, v2)`: Returns the difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Sorting + +* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild` + function. +* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on + the `compareBuild` function in descending order. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid. +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can match + the given range. +* `gtr(version, range)`: Return `true` if the version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if the version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the range comparators intersect. +* `simplifyRange(versions, range)`: Return a "simplified" range that + matches the same items in the `versions` list as the range specified. Note + that it does *not* guarantee that it would match the same versions in all + cases, only for the set of versions provided. This is useful when + generating ranges by joining together multiple versions with `||` + programmatically, to provide the user with something a bit more + ergonomic. If the provided range is shorter in string-length than the + generated range, then that is returned. +* `subset(subRange, superRange)`: Return `true` if the `subRange` range is + entirely contained by the `superRange` range. + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +If the `options.includePrerelease` flag is set, then the `coerce` result will contain +prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2` +will preserve prerelease `rc.1` and build `rev.2` in the result. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided +version is not valid a null will be returned. This does not work for +ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `'2.1.5'` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` + +## Constants + +As a convenience, helper constants are exported to provide information about what `node-semver` supports: + +### `RELEASE_TYPES` + +- major +- premajor +- minor +- preminor +- patch +- prepatch +- prerelease + +``` +const semver = require('semver'); + +if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) { + console.log('This is a valid release type!'); +} else { + console.warn('This is NOT a valid release type!'); +} +``` + +### `SEMVER_SPEC_VERSION` + +2.0.0 + +``` +const semver = require('semver'); + +console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION); +``` + +## Exported Modules + + + +You may pull in just the part of this semver utility that you need if you +are sensitive to packing and tree-shaking concerns. The main +`require('semver')` export uses getter functions to lazily load the parts +of the API that are used. + +The following modules are available: + +* `require('semver')` +* `require('semver/classes')` +* `require('semver/classes/comparator')` +* `require('semver/classes/range')` +* `require('semver/classes/semver')` +* `require('semver/functions/clean')` +* `require('semver/functions/cmp')` +* `require('semver/functions/coerce')` +* `require('semver/functions/compare')` +* `require('semver/functions/compare-build')` +* `require('semver/functions/compare-loose')` +* `require('semver/functions/diff')` +* `require('semver/functions/eq')` +* `require('semver/functions/gt')` +* `require('semver/functions/gte')` +* `require('semver/functions/inc')` +* `require('semver/functions/lt')` +* `require('semver/functions/lte')` +* `require('semver/functions/major')` +* `require('semver/functions/minor')` +* `require('semver/functions/neq')` +* `require('semver/functions/parse')` +* `require('semver/functions/patch')` +* `require('semver/functions/prerelease')` +* `require('semver/functions/rcompare')` +* `require('semver/functions/rsort')` +* `require('semver/functions/satisfies')` +* `require('semver/functions/sort')` +* `require('semver/functions/valid')` +* `require('semver/ranges/gtr')` +* `require('semver/ranges/intersects')` +* `require('semver/ranges/ltr')` +* `require('semver/ranges/max-satisfying')` +* `require('semver/ranges/min-satisfying')` +* `require('semver/ranges/min-version')` +* `require('semver/ranges/outside')` +* `require('semver/ranges/simplify')` +* `require('semver/ranges/subset')` +* `require('semver/ranges/to-comparators')` +* `require('semver/ranges/valid')` + diff --git a/node_modules/semver/classes/comparator.js b/node_modules/semver/classes/comparator.js new file mode 100644 index 0000000..3d39c0e --- /dev/null +++ b/node_modules/semver/classes/comparator.js @@ -0,0 +1,141 @@ +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + options = parseOptions(options) + + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false + } + + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = require('../internal/parse-options') +const { safeRe: re, t } = require('../internal/re') +const cmp = require('../functions/cmp') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const Range = require('./range') diff --git a/node_modules/semver/classes/index.js b/node_modules/semver/classes/index.js new file mode 100644 index 0000000..5e3f5c9 --- /dev/null +++ b/node_modules/semver/classes/index.js @@ -0,0 +1,5 @@ +module.exports = { + SemVer: require('./semver.js'), + Range: require('./range.js'), + Comparator: require('./comparator.js'), +} diff --git a/node_modules/semver/classes/range.js b/node_modules/semver/classes/range.js new file mode 100644 index 0000000..ceee231 --- /dev/null +++ b/node_modules/semver/classes/range.js @@ -0,0 +1,554 @@ +const SPACE_CHARACTERS = /\s+/g + +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.formatted = undefined + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + } + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + + this.formatted = undefined + } + + get range () { + if (this.formatted === undefined) { + this.formatted = '' + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += '||' + } + const comps = this.set[i] + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += ' ' + } + this.formatted += comps[k].toString().trim() + } + } + } + return this.formatted + } + + format () { + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached + } + + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] + } + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') + } + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} + +module.exports = Range + +const LRU = require('../internal/lrucache') +const cache = new LRU() + +const parseOptions = require('../internal/parse-options') +const Comparator = require('./comparator') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = require('../internal/re') +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants') + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') { + pr = '-0' + } + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +// TODO build? +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} diff --git a/node_modules/semver/classes/semver.js b/node_modules/semver/classes/semver.js new file mode 100644 index 0000000..6fbc062 --- /dev/null +++ b/node_modules/semver/classes/semver.js @@ -0,0 +1,318 @@ +const debug = require('../internal/debug') +const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') +const { safeRe: re, safeSrc: src, t } = require('../internal/re') + +const parseOptions = require('../internal/parse-options') +const { compareIdentifiers } = require('../internal/identifiers') +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('build compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + if (release.startsWith('pre')) { + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + // Avoid an invalid semver results + if (identifier) { + const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`) + const match = `-${identifier}`.match(r) + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`) + } + } + } + + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + case 'release': + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`) + } + this.prerelease.length = 0 + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer diff --git a/node_modules/semver/functions/clean.js b/node_modules/semver/functions/clean.js new file mode 100644 index 0000000..811fe6b --- /dev/null +++ b/node_modules/semver/functions/clean.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean diff --git a/node_modules/semver/functions/cmp.js b/node_modules/semver/functions/cmp.js new file mode 100644 index 0000000..4011909 --- /dev/null +++ b/node_modules/semver/functions/cmp.js @@ -0,0 +1,52 @@ +const eq = require('./eq') +const neq = require('./neq') +const gt = require('./gt') +const gte = require('./gte') +const lt = require('./lt') +const lte = require('./lte') + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp diff --git a/node_modules/semver/functions/coerce.js b/node_modules/semver/functions/coerce.js new file mode 100644 index 0000000..b378dce --- /dev/null +++ b/node_modules/semver/functions/coerce.js @@ -0,0 +1,60 @@ +const SemVer = require('../classes/semver') +const parse = require('./parse') +const { safeRe: re, t } = require('../internal/re') + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] + let next + while ((next = coerceRtlRegex.exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + coerceRtlRegex.lastIndex = -1 + } + + if (match === null) { + return null + } + + const major = match[2] + const minor = match[3] || '0' + const patch = match[4] || '0' + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' + const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' + + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) +} +module.exports = coerce diff --git a/node_modules/semver/functions/compare-build.js b/node_modules/semver/functions/compare-build.js new file mode 100644 index 0000000..9eb881b --- /dev/null +++ b/node_modules/semver/functions/compare-build.js @@ -0,0 +1,7 @@ +const SemVer = require('../classes/semver') +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild diff --git a/node_modules/semver/functions/compare-loose.js b/node_modules/semver/functions/compare-loose.js new file mode 100644 index 0000000..4881fbe --- /dev/null +++ b/node_modules/semver/functions/compare-loose.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose diff --git a/node_modules/semver/functions/compare.js b/node_modules/semver/functions/compare.js new file mode 100644 index 0000000..748b7af --- /dev/null +++ b/node_modules/semver/functions/compare.js @@ -0,0 +1,5 @@ +const SemVer = require('../classes/semver') +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare diff --git a/node_modules/semver/functions/diff.js b/node_modules/semver/functions/diff.js new file mode 100644 index 0000000..33171dc --- /dev/null +++ b/node_modules/semver/functions/diff.js @@ -0,0 +1,58 @@ +const parse = require('./parse.js') + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' + } + + // If the main part has no difference + if (lowVersion.compareMain(highVersion) === 0) { + if (lowVersion.minor && !lowVersion.patch) { + return 'minor' + } + return 'patch' + } + } + + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' + + if (v1.major !== v2.major) { + return prefix + 'major' + } + + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } + + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } + + // high and low are preleases + return 'prerelease' +} + +module.exports = diff diff --git a/node_modules/semver/functions/eq.js b/node_modules/semver/functions/eq.js new file mode 100644 index 0000000..271fed9 --- /dev/null +++ b/node_modules/semver/functions/eq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq diff --git a/node_modules/semver/functions/gt.js b/node_modules/semver/functions/gt.js new file mode 100644 index 0000000..d9b2156 --- /dev/null +++ b/node_modules/semver/functions/gt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt diff --git a/node_modules/semver/functions/gte.js b/node_modules/semver/functions/gte.js new file mode 100644 index 0000000..5aeaa63 --- /dev/null +++ b/node_modules/semver/functions/gte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte diff --git a/node_modules/semver/functions/inc.js b/node_modules/semver/functions/inc.js new file mode 100644 index 0000000..7670b1b --- /dev/null +++ b/node_modules/semver/functions/inc.js @@ -0,0 +1,19 @@ +const SemVer = require('../classes/semver') + +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } + + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc diff --git a/node_modules/semver/functions/lt.js b/node_modules/semver/functions/lt.js new file mode 100644 index 0000000..b440ab7 --- /dev/null +++ b/node_modules/semver/functions/lt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt diff --git a/node_modules/semver/functions/lte.js b/node_modules/semver/functions/lte.js new file mode 100644 index 0000000..6dcc956 --- /dev/null +++ b/node_modules/semver/functions/lte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte diff --git a/node_modules/semver/functions/major.js b/node_modules/semver/functions/major.js new file mode 100644 index 0000000..4283165 --- /dev/null +++ b/node_modules/semver/functions/major.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major diff --git a/node_modules/semver/functions/minor.js b/node_modules/semver/functions/minor.js new file mode 100644 index 0000000..57b3455 --- /dev/null +++ b/node_modules/semver/functions/minor.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor diff --git a/node_modules/semver/functions/neq.js b/node_modules/semver/functions/neq.js new file mode 100644 index 0000000..f944c01 --- /dev/null +++ b/node_modules/semver/functions/neq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq diff --git a/node_modules/semver/functions/parse.js b/node_modules/semver/functions/parse.js new file mode 100644 index 0000000..459b3b1 --- /dev/null +++ b/node_modules/semver/functions/parse.js @@ -0,0 +1,16 @@ +const SemVer = require('../classes/semver') +const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version + } + try { + return new SemVer(version, options) + } catch (er) { + if (!throwErrors) { + return null + } + throw er + } +} + +module.exports = parse diff --git a/node_modules/semver/functions/patch.js b/node_modules/semver/functions/patch.js new file mode 100644 index 0000000..63afca2 --- /dev/null +++ b/node_modules/semver/functions/patch.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch diff --git a/node_modules/semver/functions/prerelease.js b/node_modules/semver/functions/prerelease.js new file mode 100644 index 0000000..06aa132 --- /dev/null +++ b/node_modules/semver/functions/prerelease.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease diff --git a/node_modules/semver/functions/rcompare.js b/node_modules/semver/functions/rcompare.js new file mode 100644 index 0000000..0ac509e --- /dev/null +++ b/node_modules/semver/functions/rcompare.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare diff --git a/node_modules/semver/functions/rsort.js b/node_modules/semver/functions/rsort.js new file mode 100644 index 0000000..82404c5 --- /dev/null +++ b/node_modules/semver/functions/rsort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort diff --git a/node_modules/semver/functions/satisfies.js b/node_modules/semver/functions/satisfies.js new file mode 100644 index 0000000..50af1c1 --- /dev/null +++ b/node_modules/semver/functions/satisfies.js @@ -0,0 +1,10 @@ +const Range = require('../classes/range') +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies diff --git a/node_modules/semver/functions/sort.js b/node_modules/semver/functions/sort.js new file mode 100644 index 0000000..4d10917 --- /dev/null +++ b/node_modules/semver/functions/sort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort diff --git a/node_modules/semver/functions/valid.js b/node_modules/semver/functions/valid.js new file mode 100644 index 0000000..f27bae1 --- /dev/null +++ b/node_modules/semver/functions/valid.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid diff --git a/node_modules/semver/index.js b/node_modules/semver/index.js new file mode 100644 index 0000000..86d42ac --- /dev/null +++ b/node_modules/semver/index.js @@ -0,0 +1,89 @@ +// just pre-load all the stuff that index.js lazily exports +const internalRe = require('./internal/re') +const constants = require('./internal/constants') +const SemVer = require('./classes/semver') +const identifiers = require('./internal/identifiers') +const parse = require('./functions/parse') +const valid = require('./functions/valid') +const clean = require('./functions/clean') +const inc = require('./functions/inc') +const diff = require('./functions/diff') +const major = require('./functions/major') +const minor = require('./functions/minor') +const patch = require('./functions/patch') +const prerelease = require('./functions/prerelease') +const compare = require('./functions/compare') +const rcompare = require('./functions/rcompare') +const compareLoose = require('./functions/compare-loose') +const compareBuild = require('./functions/compare-build') +const sort = require('./functions/sort') +const rsort = require('./functions/rsort') +const gt = require('./functions/gt') +const lt = require('./functions/lt') +const eq = require('./functions/eq') +const neq = require('./functions/neq') +const gte = require('./functions/gte') +const lte = require('./functions/lte') +const cmp = require('./functions/cmp') +const coerce = require('./functions/coerce') +const Comparator = require('./classes/comparator') +const Range = require('./classes/range') +const satisfies = require('./functions/satisfies') +const toComparators = require('./ranges/to-comparators') +const maxSatisfying = require('./ranges/max-satisfying') +const minSatisfying = require('./ranges/min-satisfying') +const minVersion = require('./ranges/min-version') +const validRange = require('./ranges/valid') +const outside = require('./ranges/outside') +const gtr = require('./ranges/gtr') +const ltr = require('./ranges/ltr') +const intersects = require('./ranges/intersects') +const simplifyRange = require('./ranges/simplify') +const subset = require('./ranges/subset') +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} diff --git a/node_modules/semver/internal/constants.js b/node_modules/semver/internal/constants.js new file mode 100644 index 0000000..94be1c5 --- /dev/null +++ b/node_modules/semver/internal/constants.js @@ -0,0 +1,35 @@ +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} diff --git a/node_modules/semver/internal/debug.js b/node_modules/semver/internal/debug.js new file mode 100644 index 0000000..1c00e13 --- /dev/null +++ b/node_modules/semver/internal/debug.js @@ -0,0 +1,9 @@ +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug diff --git a/node_modules/semver/internal/identifiers.js b/node_modules/semver/internal/identifiers.js new file mode 100644 index 0000000..e612d0a --- /dev/null +++ b/node_modules/semver/internal/identifiers.js @@ -0,0 +1,23 @@ +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers, +} diff --git a/node_modules/semver/internal/lrucache.js b/node_modules/semver/internal/lrucache.js new file mode 100644 index 0000000..6d89ec9 --- /dev/null +++ b/node_modules/semver/internal/lrucache.js @@ -0,0 +1,40 @@ +class LRUCache { + constructor () { + this.max = 1000 + this.map = new Map() + } + + get (key) { + const value = this.map.get(key) + if (value === undefined) { + return undefined + } else { + // Remove the key from the map and add it to the end + this.map.delete(key) + this.map.set(key, value) + return value + } + } + + delete (key) { + return this.map.delete(key) + } + + set (key, value) { + const deleted = this.delete(key) + + if (!deleted && value !== undefined) { + // If cache is full, delete the least recently used item + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value + this.delete(firstKey) + } + + this.map.set(key, value) + } + + return this + } +} + +module.exports = LRUCache diff --git a/node_modules/semver/internal/parse-options.js b/node_modules/semver/internal/parse-options.js new file mode 100644 index 0000000..10d64ce --- /dev/null +++ b/node_modules/semver/internal/parse-options.js @@ -0,0 +1,15 @@ +// parse out just the options we care about +const looseOption = Object.freeze({ loose: true }) +const emptyOpts = Object.freeze({ }) +const parseOptions = options => { + if (!options) { + return emptyOpts + } + + if (typeof options !== 'object') { + return looseOption + } + + return options +} +module.exports = parseOptions diff --git a/node_modules/semver/internal/re.js b/node_modules/semver/internal/re.js new file mode 100644 index 0000000..2a956ba --- /dev/null +++ b/node_modules/semver/internal/re.js @@ -0,0 +1,219 @@ +const { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH, +} = require('./constants') +const debug = require('./debug') +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const safeRe = exports.safeRe = [] +const src = exports.src = [] +const safeSrc = exports.safeSrc = [] +const t = exports.t = {} +let R = 0 + +const LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +const safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value + .split(`${token}*`).join(`${token}{0,${max}}`) + .split(`${token}+`).join(`${token}{1,${max}}`) + } + return value +} + +const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value) + const index = R++ + debug(name, index, value) + t[name] = index + src[index] = value + safeSrc[index] = safe + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '\\d+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCEPLAIN', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) +createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) +createToken('COERCEFULL', src[t.COERCEPLAIN] + + `(?:${src[t.PRERELEASE]})?` + + `(?:${src[t.BUILD]})?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) +createToken('COERCERTLFULL', src[t.COERCEFULL], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json new file mode 100644 index 0000000..c264454 --- /dev/null +++ b/node_modules/semver/package.json @@ -0,0 +1,78 @@ +{ + "name": "semver", + "version": "7.7.1", + "description": "The semantic version parser used by npm.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.23.4", + "benchmark": "^2.1.4", + "tap": "^16.0.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "bin/semver.js" + }, + "files": [ + "bin/", + "lib/", + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "tap": { + "timeout": 30, + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": ">=10" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.23.4", + "engines": ">=10", + "distPaths": [ + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "allowPaths": [ + "/classes/", + "/functions/", + "/internal/", + "/ranges/", + "/index.js", + "/preload.js", + "/range.bnf", + "/benchmarks" + ], + "publish": "true" + } +} diff --git a/node_modules/semver/preload.js b/node_modules/semver/preload.js new file mode 100644 index 0000000..947cd4f --- /dev/null +++ b/node_modules/semver/preload.js @@ -0,0 +1,2 @@ +// XXX remove in v8 or beyond +module.exports = require('./index.js') diff --git a/node_modules/semver/range.bnf b/node_modules/semver/range.bnf new file mode 100644 index 0000000..d4c6ae0 --- /dev/null +++ b/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/semver/ranges/gtr.js b/node_modules/semver/ranges/gtr.js new file mode 100644 index 0000000..db7e355 --- /dev/null +++ b/node_modules/semver/ranges/gtr.js @@ -0,0 +1,4 @@ +// Determine if version is greater than all the versions possible in the range. +const outside = require('./outside') +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr diff --git a/node_modules/semver/ranges/intersects.js b/node_modules/semver/ranges/intersects.js new file mode 100644 index 0000000..e0e9b7c --- /dev/null +++ b/node_modules/semver/ranges/intersects.js @@ -0,0 +1,7 @@ +const Range = require('../classes/range') +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2, options) +} +module.exports = intersects diff --git a/node_modules/semver/ranges/ltr.js b/node_modules/semver/ranges/ltr.js new file mode 100644 index 0000000..528a885 --- /dev/null +++ b/node_modules/semver/ranges/ltr.js @@ -0,0 +1,4 @@ +const outside = require('./outside') +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr diff --git a/node_modules/semver/ranges/max-satisfying.js b/node_modules/semver/ranges/max-satisfying.js new file mode 100644 index 0000000..6e3d993 --- /dev/null +++ b/node_modules/semver/ranges/max-satisfying.js @@ -0,0 +1,25 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying diff --git a/node_modules/semver/ranges/min-satisfying.js b/node_modules/semver/ranges/min-satisfying.js new file mode 100644 index 0000000..9b60974 --- /dev/null +++ b/node_modules/semver/ranges/min-satisfying.js @@ -0,0 +1,24 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying diff --git a/node_modules/semver/ranges/min-version.js b/node_modules/semver/ranges/min-version.js new file mode 100644 index 0000000..350e1f7 --- /dev/null +++ b/node_modules/semver/ranges/min-version.js @@ -0,0 +1,61 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const gt = require('../functions/gt') + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin + } + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion diff --git a/node_modules/semver/ranges/outside.js b/node_modules/semver/ranges/outside.js new file mode 100644 index 0000000..ae99b10 --- /dev/null +++ b/node_modules/semver/ranges/outside.js @@ -0,0 +1,80 @@ +const SemVer = require('../classes/semver') +const Comparator = require('../classes/comparator') +const { ANY } = Comparator +const Range = require('../classes/range') +const satisfies = require('../functions/satisfies') +const gt = require('../functions/gt') +const lt = require('../functions/lt') +const lte = require('../functions/lte') +const gte = require('../functions/gte') + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside diff --git a/node_modules/semver/ranges/simplify.js b/node_modules/semver/ranges/simplify.js new file mode 100644 index 0000000..618d5b6 --- /dev/null +++ b/node_modules/semver/ranges/simplify.js @@ -0,0 +1,47 @@ +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} diff --git a/node_modules/semver/ranges/subset.js b/node_modules/semver/ranges/subset.js new file mode 100644 index 0000000..1e5c268 --- /dev/null +++ b/node_modules/semver/ranges/subset.js @@ -0,0 +1,247 @@ +const Range = require('../classes/range.js') +const Comparator = require('../classes/comparator.js') +const { ANY } = Comparator +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset diff --git a/node_modules/semver/ranges/to-comparators.js b/node_modules/semver/ranges/to-comparators.js new file mode 100644 index 0000000..6c8bc7e --- /dev/null +++ b/node_modules/semver/ranges/to-comparators.js @@ -0,0 +1,8 @@ +const Range = require('../classes/range') + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators diff --git a/node_modules/semver/ranges/valid.js b/node_modules/semver/ranges/valid.js new file mode 100644 index 0000000..365f356 --- /dev/null +++ b/node_modules/semver/ranges/valid.js @@ -0,0 +1,11 @@ +const Range = require('../classes/range') +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange diff --git a/node_modules/shebang-command/index.js b/node_modules/shebang-command/index.js new file mode 100644 index 0000000..f35db30 --- /dev/null +++ b/node_modules/shebang-command/index.js @@ -0,0 +1,19 @@ +'use strict'; +const shebangRegex = require('shebang-regex'); + +module.exports = (string = '') => { + const match = string.match(shebangRegex); + + if (!match) { + return null; + } + + const [path, argument] = match[0].replace(/#! ?/, '').split(' '); + const binary = path.split('/').pop(); + + if (binary === 'env') { + return argument; + } + + return argument ? `${binary} ${argument}` : binary; +}; diff --git a/node_modules/shebang-command/license b/node_modules/shebang-command/license new file mode 100644 index 0000000..db6bc32 --- /dev/null +++ b/node_modules/shebang-command/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Kevin Mårtensson (github.com/kevva) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-command/package.json b/node_modules/shebang-command/package.json new file mode 100644 index 0000000..18e3c04 --- /dev/null +++ b/node_modules/shebang-command/package.json @@ -0,0 +1,34 @@ +{ + "name": "shebang-command", + "version": "2.0.0", + "description": "Get the command from a shebang", + "license": "MIT", + "repository": "kevva/shebang-command", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "cmd", + "command", + "parse", + "shebang" + ], + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "devDependencies": { + "ava": "^2.3.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/shebang-command/readme.md b/node_modules/shebang-command/readme.md new file mode 100644 index 0000000..84feb44 --- /dev/null +++ b/node_modules/shebang-command/readme.md @@ -0,0 +1,34 @@ +# shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command) + +> Get the command from a shebang + + +## Install + +``` +$ npm install shebang-command +``` + + +## Usage + +```js +const shebangCommand = require('shebang-command'); + +shebangCommand('#!/usr/bin/env node'); +//=> 'node' + +shebangCommand('#!/bin/bash'); +//=> 'bash' +``` + + +## API + +### shebangCommand(string) + +#### string + +Type: `string` + +String containing a shebang. diff --git a/node_modules/shebang-regex/index.js b/node_modules/shebang-regex/index.js new file mode 100644 index 0000000..63fc4a0 --- /dev/null +++ b/node_modules/shebang-regex/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = /^#!(.*)/; diff --git a/node_modules/shebang-regex/license b/node_modules/shebang-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/shebang-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-regex/package.json b/node_modules/shebang-regex/package.json new file mode 100644 index 0000000..00ab30f --- /dev/null +++ b/node_modules/shebang-regex/package.json @@ -0,0 +1,35 @@ +{ + "name": "shebang-regex", + "version": "3.0.0", + "description": "Regular expression for matching a shebang line", + "license": "MIT", + "repository": "sindresorhus/shebang-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "regex", + "regexp", + "shebang", + "match", + "test", + "line" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/shebang-regex/readme.md b/node_modules/shebang-regex/readme.md new file mode 100644 index 0000000..5ecf863 --- /dev/null +++ b/node_modules/shebang-regex/readme.md @@ -0,0 +1,33 @@ +# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) + +> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line + + +## Install + +``` +$ npm install shebang-regex +``` + + +## Usage + +```js +const shebangRegex = require('shebang-regex'); + +const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; + +shebangRegex.test(string); +//=> true + +shebangRegex.exec(string)[0]; +//=> '#!/usr/bin/env node' + +shebangRegex.exec(string)[1]; +//=> '/usr/bin/env node' +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/strip-json-comments/index.js b/node_modules/strip-json-comments/index.js new file mode 100644 index 0000000..bb00b38 --- /dev/null +++ b/node_modules/strip-json-comments/index.js @@ -0,0 +1,77 @@ +'use strict'; +const singleComment = Symbol('singleComment'); +const multiComment = Symbol('multiComment'); +const stripWithoutWhitespace = () => ''; +const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, ' '); + +const isEscaped = (jsonString, quotePosition) => { + let index = quotePosition - 1; + let backslashCount = 0; + + while (jsonString[index] === '\\') { + index -= 1; + backslashCount += 1; + } + + return Boolean(backslashCount % 2); +}; + +module.exports = (jsonString, options = {}) => { + if (typeof jsonString !== 'string') { + throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``); + } + + const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; + + let insideString = false; + let insideComment = false; + let offset = 0; + let result = ''; + + for (let i = 0; i < jsonString.length; i++) { + const currentCharacter = jsonString[i]; + const nextCharacter = jsonString[i + 1]; + + if (!insideComment && currentCharacter === '"') { + const escaped = isEscaped(jsonString, i); + if (!escaped) { + insideString = !insideString; + } + } + + if (insideString) { + continue; + } + + if (!insideComment && currentCharacter + nextCharacter === '//') { + result += jsonString.slice(offset, i); + offset = i; + insideComment = singleComment; + i++; + } else if (insideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { + i++; + insideComment = false; + result += strip(jsonString, offset, i); + offset = i; + continue; + } else if (insideComment === singleComment && currentCharacter === '\n') { + insideComment = false; + result += strip(jsonString, offset, i); + offset = i; + } else if (!insideComment && currentCharacter + nextCharacter === '/*') { + result += jsonString.slice(offset, i); + offset = i; + insideComment = multiComment; + i++; + continue; + } else if (insideComment === multiComment && currentCharacter + nextCharacter === '*/') { + i++; + insideComment = false; + result += strip(jsonString, offset, i + 1); + offset = i + 1; + continue; + } + } + + return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); +}; diff --git a/node_modules/strip-json-comments/license b/node_modules/strip-json-comments/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/strip-json-comments/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-json-comments/package.json b/node_modules/strip-json-comments/package.json new file mode 100644 index 0000000..ce7875a --- /dev/null +++ b/node_modules/strip-json-comments/package.json @@ -0,0 +1,47 @@ +{ + "name": "strip-json-comments", + "version": "3.1.1", + "description": "Strip comments from JSON. Lets you use comments in your JSON files!", + "license": "MIT", + "repository": "sindresorhus/strip-json-comments", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "json", + "strip", + "comments", + "remove", + "delete", + "trim", + "multiline", + "parse", + "config", + "configuration", + "settings", + "util", + "env", + "environment", + "jsonc" + ], + "devDependencies": { + "ava": "^1.4.1", + "matcha": "^0.7.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/strip-json-comments/readme.md b/node_modules/strip-json-comments/readme.md new file mode 100644 index 0000000..cc542e5 --- /dev/null +++ b/node_modules/strip-json-comments/readme.md @@ -0,0 +1,78 @@ +# strip-json-comments [![Build Status](https://travis-ci.com/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.com/github/sindresorhus/strip-json-comments) + +> Strip comments from JSON. Lets you use comments in your JSON files! + +This is now possible: + +```js +{ + // Rainbows + "unicorn": /* ❤ */ "cake" +} +``` + +It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. + +Also available as a [Gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[Grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[Broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin. + +## Install + +``` +$ npm install strip-json-comments +``` + +## Usage + +```js +const json = `{ + // Rainbows + "unicorn": /* ❤ */ "cake" +}`; + +JSON.parse(stripJsonComments(json)); +//=> {unicorn: 'cake'} +``` + +## API + +### stripJsonComments(jsonString, options?) + +#### jsonString + +Type: `string` + +Accepts a string with JSON and returns a string without comments. + +#### options + +Type: `object` + +##### whitespace + +Type: `boolean`\ +Default: `true` + +Replace comments with whitespace instead of stripping them entirely. + +## Benchmark + +``` +$ npm run bench +``` + +## Related + +- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module +- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/supports-color/browser.js b/node_modules/supports-color/browser.js new file mode 100644 index 0000000..62afa3a --- /dev/null +++ b/node_modules/supports-color/browser.js @@ -0,0 +1,5 @@ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js new file mode 100644 index 0000000..6fada39 --- /dev/null +++ b/node_modules/supports-color/index.js @@ -0,0 +1,135 @@ +'use strict'; +const os = require('os'); +const tty = require('tty'); +const hasFlag = require('has-flag'); + +const {env} = process; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false') || + hasFlag('color=never')) { + forceColor = 0; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = 1; +} + +if ('FORCE_COLOR' in env) { + if (env.FORCE_COLOR === 'true') { + forceColor = 1; + } else if (env.FORCE_COLOR === 'false') { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) +}; diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json new file mode 100644 index 0000000..f7182ed --- /dev/null +++ b/node_modules/supports-color/package.json @@ -0,0 +1,53 @@ +{ + "name": "supports-color", + "version": "7.2.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "import-fresh": "^3.0.0", + "xo": "^0.24.0" + }, + "browser": "browser.js" +} diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md new file mode 100644 index 0000000..3654228 --- /dev/null +++ b/node_modules/supports-color/readme.md @@ -0,0 +1,76 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install supports-color +``` + + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- diff --git a/node_modules/to-regex-range/LICENSE b/node_modules/to-regex-range/LICENSE new file mode 100644 index 0000000..7cccaf9 --- /dev/null +++ b/node_modules/to-regex-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/to-regex-range/README.md b/node_modules/to-regex-range/README.md new file mode 100644 index 0000000..38887da --- /dev/null +++ b/node_modules/to-regex-range/README.md @@ -0,0 +1,305 @@ +# to-regex-range [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/to-regex-range.svg?style=flat)](https://www.npmjs.com/package/to-regex-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![NPM total downloads](https://img.shields.io/npm/dt/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![Linux Build Status](https://img.shields.io/travis/micromatch/to-regex-range.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/to-regex-range) + +> Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save to-regex-range +``` + +
+What does this do? + +
+ +This libary generates the `source` string to be passed to `new RegExp()` for matching a range of numbers. + +**Example** + +```js +const toRegexRange = require('to-regex-range'); +const regex = new RegExp(toRegexRange('15', '95')); +``` + +A string is returned so that you can do whatever you need with it before passing it to `new RegExp()` (like adding `^` or `$` boundaries, defining flags, or combining it another string). + +
+ +
+ +
+Why use this library? + +
+ +### Convenience + +Creating regular expressions for matching numbers gets deceptively complicated pretty fast. + +For example, let's say you need a validation regex for matching part of a user-id, postal code, social security number, tax id, etc: + +* regex for matching `1` => `/1/` (easy enough) +* regex for matching `1` through `5` => `/[1-5]/` (not bad...) +* regex for matching `1` or `5` => `/(1|5)/` (still easy...) +* regex for matching `1` through `50` => `/([1-9]|[1-4][0-9]|50)/` (uh-oh...) +* regex for matching `1` through `55` => `/([1-9]|[1-4][0-9]|5[0-5])/` (no prob, I can do this...) +* regex for matching `1` through `555` => `/([1-9]|[1-9][0-9]|[1-4][0-9]{2}|5[0-4][0-9]|55[0-5])/` (maybe not...) +* regex for matching `0001` through `5555` => `/(0{3}[1-9]|0{2}[1-9][0-9]|0[1-9][0-9]{2}|[1-4][0-9]{3}|5[0-4][0-9]{2}|55[0-4][0-9]|555[0-5])/` (okay, I get the point!) + +The numbers are contrived, but they're also really basic. In the real world you might need to generate a regex on-the-fly for validation. + +**Learn more** + +If you're interested in learning more about [character classes](http://www.regular-expressions.info/charclass.html) and other regex features, I personally have always found [regular-expressions.info](http://www.regular-expressions.info/charclass.html) to be pretty useful. + +### Heavily tested + +As of April 07, 2019, this library runs [>1m test assertions](./test/test.js) against generated regex-ranges to provide brute-force verification that results are correct. + +Tests run in ~280ms on my MacBook Pro, 2.5 GHz Intel Core i7. + +### Optimized + +Generated regular expressions are optimized: + +* duplicate sequences and character classes are reduced using quantifiers +* smart enough to use `?` conditionals when number(s) or range(s) can be positive or negative +* uses fragment caching to avoid processing the same exact string more than once + +
+ +
+ +## Usage + +Add this library to your javascript application with the following line of code + +```js +const toRegexRange = require('to-regex-range'); +``` + +The main export is a function that takes two integers: the `min` value and `max` value (formatted as strings or numbers). + +```js +const source = toRegexRange('15', '95'); +//=> 1[5-9]|[2-8][0-9]|9[0-5] + +const regex = new RegExp(`^${source}$`); +console.log(regex.test('14')); //=> false +console.log(regex.test('50')); //=> true +console.log(regex.test('94')); //=> true +console.log(regex.test('96')); //=> false +``` + +## Options + +### options.capture + +**Type**: `boolean` + +**Deafault**: `undefined` + +Wrap the returned value in parentheses when there is more than one regex condition. Useful when you're dynamically generating ranges. + +```js +console.log(toRegexRange('-10', '10')); +//=> -[1-9]|-?10|[0-9] + +console.log(toRegexRange('-10', '10', { capture: true })); +//=> (-[1-9]|-?10|[0-9]) +``` + +### options.shorthand + +**Type**: `boolean` + +**Deafault**: `undefined` + +Use the regex shorthand for `[0-9]`: + +```js +console.log(toRegexRange('0', '999999')); +//=> [0-9]|[1-9][0-9]{1,5} + +console.log(toRegexRange('0', '999999', { shorthand: true })); +//=> \d|[1-9]\d{1,5} +``` + +### options.relaxZeros + +**Type**: `boolean` + +**Default**: `true` + +This option relaxes matching for leading zeros when when ranges are zero-padded. + +```js +const source = toRegexRange('-0010', '0010'); +const regex = new RegExp(`^${source}$`); +console.log(regex.test('-10')); //=> true +console.log(regex.test('-010')); //=> true +console.log(regex.test('-0010')); //=> true +console.log(regex.test('10')); //=> true +console.log(regex.test('010')); //=> true +console.log(regex.test('0010')); //=> true +``` + +When `relaxZeros` is false, matching is strict: + +```js +const source = toRegexRange('-0010', '0010', { relaxZeros: false }); +const regex = new RegExp(`^${source}$`); +console.log(regex.test('-10')); //=> false +console.log(regex.test('-010')); //=> false +console.log(regex.test('-0010')); //=> true +console.log(regex.test('10')); //=> false +console.log(regex.test('010')); //=> false +console.log(regex.test('0010')); //=> true +``` + +## Examples + +| **Range** | **Result** | **Compile time** | +| --- | --- | --- | +| `toRegexRange(-10, 10)` | `-[1-9]\|-?10\|[0-9]` | _132μs_ | +| `toRegexRange(-100, -10)` | `-1[0-9]\|-[2-9][0-9]\|-100` | _50μs_ | +| `toRegexRange(-100, 100)` | `-[1-9]\|-?[1-9][0-9]\|-?100\|[0-9]` | _42μs_ | +| `toRegexRange(001, 100)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|100` | _109μs_ | +| `toRegexRange(001, 555)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _51μs_ | +| `toRegexRange(0010, 1000)` | `0{0,2}1[0-9]\|0{0,2}[2-9][0-9]\|0?[1-9][0-9]{2}\|1000` | _31μs_ | +| `toRegexRange(1, 50)` | `[1-9]\|[1-4][0-9]\|50` | _24μs_ | +| `toRegexRange(1, 55)` | `[1-9]\|[1-4][0-9]\|5[0-5]` | _23μs_ | +| `toRegexRange(1, 555)` | `[1-9]\|[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _30μs_ | +| `toRegexRange(1, 5555)` | `[1-9]\|[1-9][0-9]{1,2}\|[1-4][0-9]{3}\|5[0-4][0-9]{2}\|55[0-4][0-9]\|555[0-5]` | _43μs_ | +| `toRegexRange(111, 555)` | `11[1-9]\|1[2-9][0-9]\|[2-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _38μs_ | +| `toRegexRange(29, 51)` | `29\|[34][0-9]\|5[01]` | _24μs_ | +| `toRegexRange(31, 877)` | `3[1-9]\|[4-9][0-9]\|[1-7][0-9]{2}\|8[0-6][0-9]\|87[0-7]` | _32μs_ | +| `toRegexRange(5, 5)` | `5` | _8μs_ | +| `toRegexRange(5, 6)` | `5\|6` | _11μs_ | +| `toRegexRange(1, 2)` | `1\|2` | _6μs_ | +| `toRegexRange(1, 5)` | `[1-5]` | _15μs_ | +| `toRegexRange(1, 10)` | `[1-9]\|10` | _22μs_ | +| `toRegexRange(1, 100)` | `[1-9]\|[1-9][0-9]\|100` | _25μs_ | +| `toRegexRange(1, 1000)` | `[1-9]\|[1-9][0-9]{1,2}\|1000` | _31μs_ | +| `toRegexRange(1, 10000)` | `[1-9]\|[1-9][0-9]{1,3}\|10000` | _34μs_ | +| `toRegexRange(1, 100000)` | `[1-9]\|[1-9][0-9]{1,4}\|100000` | _36μs_ | +| `toRegexRange(1, 1000000)` | `[1-9]\|[1-9][0-9]{1,5}\|1000000` | _42μs_ | +| `toRegexRange(1, 10000000)` | `[1-9]\|[1-9][0-9]{1,6}\|10000000` | _42μs_ | + +## Heads up! + +**Order of arguments** + +When the `min` is larger than the `max`, values will be flipped to create a valid range: + +```js +toRegexRange('51', '29'); +``` + +Is effectively flipped to: + +```js +toRegexRange('29', '51'); +//=> 29|[3-4][0-9]|5[0-1] +``` + +**Steps / increments** + +This library does not support steps (increments). A pr to add support would be welcome. + +## History + +### v2.0.0 - 2017-04-21 + +**New features** + +Adds support for zero-padding! + +### v1.0.0 + +**Optimizations** + +Repeating ranges are now grouped using quantifiers. rocessing time is roughly the same, but the generated regex is much smaller, which should result in faster matching. + +## Attribution + +Inspired by the python library [range-regex](https://github.com/dimka665/range-regex). + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by micromatch.") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.") +* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 63 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [doowb](https://github.com/doowb) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)! + + + + + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 07, 2019._ \ No newline at end of file diff --git a/node_modules/to-regex-range/index.js b/node_modules/to-regex-range/index.js new file mode 100644 index 0000000..77fbace --- /dev/null +++ b/node_modules/to-regex-range/index.js @@ -0,0 +1,288 @@ +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +const isNumber = require('is-number'); + +const toRegexRange = (min, max, options) => { + if (isNumber(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives, opts); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange.cache[cacheKey] = state; + return state.result; +}; + +function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; + let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; + let intersected = filterPatterns(neg, pos, '-?', true, options) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} + +function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; +} + +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + +function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit, options); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; +} + +function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; +} + +function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; +} + +/** + * Zip strings + */ + +function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; +} + +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} + +function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); +} + +function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); +} + +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} + +function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; +} + +function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; +} + +function hasPadding(str) { + return /^-?(0+)\d/.test(str); +} + +function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } +} + +/** + * Cache + */ + +toRegexRange.cache = {}; +toRegexRange.clearCache = () => (toRegexRange.cache = {}); + +/** + * Expose `toRegexRange` + */ + +module.exports = toRegexRange; diff --git a/node_modules/to-regex-range/package.json b/node_modules/to-regex-range/package.json new file mode 100644 index 0000000..4ef194f --- /dev/null +++ b/node_modules/to-regex-range/package.json @@ -0,0 +1,88 @@ +{ + "name": "to-regex-range", + "description": "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.", + "version": "5.0.1", + "homepage": "https://github.com/micromatch/to-regex-range", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Rouven Weßling (www.rouvenwessling.de)" + ], + "repository": "micromatch/to-regex-range", + "bugs": { + "url": "https://github.com/micromatch/to-regex-range/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=8.0" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "is-number": "^7.0.0" + }, + "devDependencies": { + "fill-range": "^6.0.0", + "gulp-format-md": "^2.0.0", + "mocha": "^6.0.2", + "text-table": "^0.2.0", + "time-diff": "^0.3.1" + }, + "keywords": [ + "bash", + "date", + "expand", + "expansion", + "expression", + "glob", + "match", + "match date", + "match number", + "match numbers", + "match year", + "matches", + "matching", + "number", + "numbers", + "numerical", + "range", + "ranges", + "regex", + "regexp", + "regular", + "regular expression", + "sequence" + ], + "verb": { + "layout": "default", + "toc": false, + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "helpers": { + "examples": { + "displayName": "examples" + } + }, + "related": { + "list": [ + "expand-range", + "fill-range", + "micromatch", + "repeat-element", + "repeat-string" + ] + } + } +} diff --git a/node_modules/ts-api-utils/LICENSE.md b/node_modules/ts-api-utils/LICENSE.md new file mode 100644 index 0000000..08520a1 --- /dev/null +++ b/node_modules/ts-api-utils/LICENSE.md @@ -0,0 +1,20 @@ +# MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ts-api-utils/README.md b/node_modules/ts-api-utils/README.md new file mode 100644 index 0000000..b2c13ef --- /dev/null +++ b/node_modules/ts-api-utils/README.md @@ -0,0 +1,84 @@ +

TypeScript API Utils

+ +

+ Utility functions for working with TypeScript's API. + Successor to the wonderful tsutils. + 🛠️️ +

+ +

+ + +All Contributors: 8 👪 + + + 🤝 Code of Conduct: Kept + 🧪 Coverage + 📚 Documentation Coverage + 📝 License: MIT + 📦 npm version + 💪 TypeScript: Strict +

+ +## Usage + +```shell +npm i ts-api-utils +``` + +```ts +import * as tsutils from "ts-api-utils"; + +tsutils.forEachToken(/* ... */); +``` + +### API + +`ts-api-utils` provides many utility functions. +Check out our API docs for details: + +📝 [ts-api-utils API docs](https://joshuakgoldberg.github.io/ts-api-utils). + +## Development + +See [`.github/CONTRIBUTING.md`](./.github/CONTRIBUTING.md). +Thanks! 💖 + +## Contributors + +Many thanks to [@ajafff](https://github.com/ajafff) for creating the original [`tsutils`](https://github.com/ajafff/tsutils) ([original license: MIT](https://github.com/ajafff/tsutils/blob/26b195358ec36d59f00333115aa3ffd9611ca78b/LICENSE)) that this project was originally based on! 🙏 + + + + + + + + + + + + + + + + + + + + + + +
Dan Vanderkam
Dan Vanderkam

🐛
Johannes Chorzempa
Johannes Chorzempa

📖 💻
Josh Goldberg
Josh Goldberg

🐛 💻 📖 📆 ⚠️ 🔧 🚧 🚇 🤔
Kirill Cherkashin
Kirill Cherkashin

💻
Kirk Waiblinger
Kirk Waiblinger

🐛 💻
Klaus Meinhardt
Klaus Meinhardt

💻 ⚠️
Lars Kappert
Lars Kappert

💻
Rebecca Stevens
Rebecca Stevens

🐛 💻 📖 📆 ⚠️ 🔧 🚇 🚧 🤔
+ + + + + + + + + +> 💙 This package was templated with [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). + +> _"My tools! I have to have my tools!" - Dennis Reynolds_ diff --git a/node_modules/ts-api-utils/lib/index.cjs b/node_modules/ts-api-utils/lib/index.cjs new file mode 100644 index 0000000..4b7427e --- /dev/null +++ b/node_modules/ts-api-utils/lib/index.cjs @@ -0,0 +1,2274 @@ +'use strict'; + +var ts9 = require('typescript'); + +function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } + +var ts9__default = /*#__PURE__*/_interopDefault(ts9); + +// src/comments.ts +function forEachToken(node, callback, sourceFile = node.getSourceFile()) { + const queue = []; + while (true) { + if (ts9__default.default.isTokenKind(node.kind)) { + callback(node); + } else { + const children = node.getChildren(sourceFile); + if (children.length === 1) { + node = children[0]; + continue; + } + for (let i = children.length - 1; i >= 0; --i) { + queue.push(children[i]); + } + } + if (queue.length === 0) { + break; + } + node = queue.pop(); + } +} + +// src/comments.ts +function forEachComment(node, callback, sourceFile = node.getSourceFile()) { + const fullText = sourceFile.text; + const notJsx = sourceFile.languageVariant !== ts9__default.default.LanguageVariant.JSX; + return forEachToken( + node, + (token) => { + if (token.pos === token.end) { + return; + } + if (token.kind !== ts9__default.default.SyntaxKind.JsxText) { + ts9__default.default.forEachLeadingCommentRange( + fullText, + // skip shebang at position 0 + token.pos === 0 ? (ts9__default.default.getShebang(fullText) ?? "").length : token.pos, + commentCallback + ); + } + if (notJsx || canHaveTrailingTrivia(token)) { + return ts9__default.default.forEachTrailingCommentRange( + fullText, + token.end, + commentCallback + ); + } + }, + sourceFile + ); + function commentCallback(pos, end, kind) { + callback(fullText, { end, kind, pos }); + } +} +function canHaveTrailingTrivia(token) { + switch (token.kind) { + case ts9__default.default.SyntaxKind.CloseBraceToken: + return token.parent.kind !== ts9__default.default.SyntaxKind.JsxExpression || !isJsxElementOrFragment(token.parent.parent); + case ts9__default.default.SyntaxKind.GreaterThanToken: + switch (token.parent.kind) { + case ts9__default.default.SyntaxKind.JsxClosingElement: + case ts9__default.default.SyntaxKind.JsxClosingFragment: + return !isJsxElementOrFragment(token.parent.parent.parent); + case ts9__default.default.SyntaxKind.JsxOpeningElement: + return token.end !== token.parent.end; + case ts9__default.default.SyntaxKind.JsxOpeningFragment: + return false; + // would be inside the fragment + case ts9__default.default.SyntaxKind.JsxSelfClosingElement: + return token.end !== token.parent.end || // if end is not equal, this is part of the type arguments list + !isJsxElementOrFragment(token.parent.parent); + } + } + return true; +} +function isJsxElementOrFragment(node) { + return node.kind === ts9__default.default.SyntaxKind.JsxElement || node.kind === ts9__default.default.SyntaxKind.JsxFragment; +} +function isCompilerOptionEnabled(options, option) { + switch (option) { + case "allowJs": + return options.allowJs === undefined ? isCompilerOptionEnabled(options, "checkJs") : options.allowJs; + case "allowSyntheticDefaultImports": + return options.allowSyntheticDefaultImports !== undefined ? options.allowSyntheticDefaultImports : isCompilerOptionEnabled(options, "esModuleInterop") || options.module === ts9__default.default.ModuleKind.System; + case "alwaysStrict": + case "noImplicitAny": + case "noImplicitThis": + case "strictBindCallApply": + case "strictFunctionTypes": + case "strictNullChecks": + case "strictPropertyInitialization": + return isStrictCompilerOptionEnabled( + options, + option + ); + case "declaration": + return options.declaration || isCompilerOptionEnabled(options, "composite"); + case "declarationMap": + case "emitDeclarationOnly": + case "stripInternal": + return options[option] === true && isCompilerOptionEnabled(options, "declaration"); + case "incremental": + return options.incremental === undefined ? isCompilerOptionEnabled(options, "composite") : options.incremental; + case "noUncheckedIndexedAccess": + return options.noUncheckedIndexedAccess === true && isCompilerOptionEnabled(options, "strictNullChecks"); + case "skipDefaultLibCheck": + return options.skipDefaultLibCheck || isCompilerOptionEnabled(options, "skipLibCheck"); + case "suppressImplicitAnyIndexErrors": + return ( + // eslint-disable-next-line @typescript-eslint/no-deprecated + options.suppressImplicitAnyIndexErrors === true && isCompilerOptionEnabled(options, "noImplicitAny") + ); + } + return options[option] === true; +} +function isStrictCompilerOptionEnabled(options, option) { + return (options.strict ? options[option] !== false : options[option] === true) && (option !== "strictPropertyInitialization" || isStrictCompilerOptionEnabled(options, "strictNullChecks")); +} +function isModifierFlagSet(node, flag) { + return isFlagSet(ts9__default.default.getCombinedModifierFlags(node), flag); +} +function isFlagSet(allFlags, flag) { + return (allFlags & flag) !== 0; +} +function isFlagSetOnObject(obj, flag) { + return isFlagSet(obj.flags, flag); +} +var isNodeFlagSet = isFlagSetOnObject; +function isObjectFlagSet(objectType, flag) { + return isFlagSet(objectType.objectFlags, flag); +} +var isSymbolFlagSet = isFlagSetOnObject; +function isTransientSymbolLinksFlagSet(links, flag) { + return isFlagSet(links.checkFlags, flag); +} +var isTypeFlagSet = isFlagSetOnObject; + +// src/modifiers.ts +function includesModifier(modifiers, ...kinds) { + if (modifiers === undefined) { + return false; + } + for (const modifier of modifiers) { + if (kinds.includes(modifier.kind)) { + return true; + } + } + return false; +} +function isAssignmentKind(kind) { + return kind >= ts9__default.default.SyntaxKind.FirstAssignment && kind <= ts9__default.default.SyntaxKind.LastAssignment; +} +function isNumericPropertyName(name) { + return String(+name) === name; +} +function isValidPropertyAccess(text, languageVersion = ts9__default.default.ScriptTarget.Latest) { + if (text.length === 0) { + return false; + } + let ch = text.codePointAt(0); + if (!ts9__default.default.isIdentifierStart(ch, languageVersion)) { + return false; + } + for (let i = charSize(ch); i < text.length; i += charSize(ch)) { + ch = text.codePointAt(i); + if (!ts9__default.default.isIdentifierPart(ch, languageVersion)) { + return false; + } + } + return true; +} +function charSize(ch) { + return ch >= 65536 ? 2 : 1; +} + +// src/nodes/access.ts +var AccessKind = /* @__PURE__ */ ((AccessKind2) => { + AccessKind2[AccessKind2["None"] = 0] = "None"; + AccessKind2[AccessKind2["Read"] = 1] = "Read"; + AccessKind2[AccessKind2["Write"] = 2] = "Write"; + AccessKind2[AccessKind2["Delete"] = 4] = "Delete"; + AccessKind2[AccessKind2["ReadWrite"] = 3] = "ReadWrite"; + return AccessKind2; +})(AccessKind || {}); +function getAccessKind(node) { + const parent = node.parent; + switch (parent.kind) { + case ts9__default.default.SyntaxKind.ArrayLiteralExpression: + case ts9__default.default.SyntaxKind.SpreadAssignment: + case ts9__default.default.SyntaxKind.SpreadElement: + return isInDestructuringAssignment( + parent + ) ? 2 /* Write */ : 1 /* Read */; + case ts9__default.default.SyntaxKind.ArrowFunction: + return parent.body === node ? 1 /* Read */ : 2 /* Write */; + case ts9__default.default.SyntaxKind.AsExpression: + case ts9__default.default.SyntaxKind.NonNullExpression: + case ts9__default.default.SyntaxKind.ParenthesizedExpression: + case ts9__default.default.SyntaxKind.TypeAssertionExpression: + return getAccessKind(parent); + case ts9__default.default.SyntaxKind.AwaitExpression: + case ts9__default.default.SyntaxKind.CallExpression: + case ts9__default.default.SyntaxKind.CaseClause: + case ts9__default.default.SyntaxKind.ComputedPropertyName: + case ts9__default.default.SyntaxKind.ConditionalExpression: + case ts9__default.default.SyntaxKind.Decorator: + case ts9__default.default.SyntaxKind.DoStatement: + case ts9__default.default.SyntaxKind.ElementAccessExpression: + case ts9__default.default.SyntaxKind.ExpressionStatement: + case ts9__default.default.SyntaxKind.ForStatement: + case ts9__default.default.SyntaxKind.IfStatement: + case ts9__default.default.SyntaxKind.JsxElement: + case ts9__default.default.SyntaxKind.JsxExpression: + case ts9__default.default.SyntaxKind.JsxOpeningElement: + case ts9__default.default.SyntaxKind.JsxSelfClosingElement: + case ts9__default.default.SyntaxKind.JsxSpreadAttribute: + case ts9__default.default.SyntaxKind.NewExpression: + case ts9__default.default.SyntaxKind.ReturnStatement: + case ts9__default.default.SyntaxKind.SwitchStatement: + case ts9__default.default.SyntaxKind.TaggedTemplateExpression: + case ts9__default.default.SyntaxKind.TemplateSpan: + case ts9__default.default.SyntaxKind.ThrowStatement: + case ts9__default.default.SyntaxKind.TypeOfExpression: + case ts9__default.default.SyntaxKind.VoidExpression: + case ts9__default.default.SyntaxKind.WhileStatement: + case ts9__default.default.SyntaxKind.WithStatement: + case ts9__default.default.SyntaxKind.YieldExpression: + return 1 /* Read */; + case ts9__default.default.SyntaxKind.BinaryExpression: + return parent.right === node ? 1 /* Read */ : !isAssignmentKind(parent.operatorToken.kind) ? 1 /* Read */ : parent.operatorToken.kind === ts9__default.default.SyntaxKind.EqualsToken ? 2 /* Write */ : 3 /* ReadWrite */; + case ts9__default.default.SyntaxKind.BindingElement: + case ts9__default.default.SyntaxKind.EnumMember: + case ts9__default.default.SyntaxKind.JsxAttribute: + case ts9__default.default.SyntaxKind.Parameter: + case ts9__default.default.SyntaxKind.PropertyDeclaration: + case ts9__default.default.SyntaxKind.VariableDeclaration: + return parent.initializer === node ? 1 /* Read */ : 0 /* None */; + case ts9__default.default.SyntaxKind.DeleteExpression: + return 4 /* Delete */; + case ts9__default.default.SyntaxKind.ExportAssignment: + return parent.isExportEquals ? 1 /* Read */ : 0 /* None */; + case ts9__default.default.SyntaxKind.ExpressionWithTypeArguments: + return parent.parent.token === ts9__default.default.SyntaxKind.ExtendsKeyword && parent.parent.parent.kind !== ts9__default.default.SyntaxKind.InterfaceDeclaration ? 1 /* Read */ : 0 /* None */; + case ts9__default.default.SyntaxKind.ForInStatement: + case ts9__default.default.SyntaxKind.ForOfStatement: + return parent.initializer === node ? 2 /* Write */ : 1 /* Read */; + case ts9__default.default.SyntaxKind.PostfixUnaryExpression: + return 3 /* ReadWrite */; + case ts9__default.default.SyntaxKind.PrefixUnaryExpression: + return parent.operator === ts9__default.default.SyntaxKind.PlusPlusToken || parent.operator === ts9__default.default.SyntaxKind.MinusMinusToken ? 3 /* ReadWrite */ : 1 /* Read */; + case ts9__default.default.SyntaxKind.PropertyAccessExpression: + return parent.expression === node ? 1 /* Read */ : 0 /* None */; + case ts9__default.default.SyntaxKind.PropertyAssignment: + return parent.name === node ? 0 /* None */ : isInDestructuringAssignment(parent) ? 2 /* Write */ : 1 /* Read */; + case ts9__default.default.SyntaxKind.ShorthandPropertyAssignment: + return parent.objectAssignmentInitializer === node ? 1 /* Read */ : isInDestructuringAssignment(parent) ? 2 /* Write */ : 1 /* Read */; + } + return 0 /* None */; +} +function isInDestructuringAssignment(node) { + switch (node.kind) { + case ts9__default.default.SyntaxKind.ShorthandPropertyAssignment: + if (node.objectAssignmentInitializer !== undefined) { + return true; + } + // falls through + case ts9__default.default.SyntaxKind.PropertyAssignment: + case ts9__default.default.SyntaxKind.SpreadAssignment: + node = node.parent; + break; + case ts9__default.default.SyntaxKind.SpreadElement: + if (node.parent.kind !== ts9__default.default.SyntaxKind.ArrayLiteralExpression) { + return false; + } + node = node.parent; + } + while (true) { + switch (node.parent.kind) { + case ts9__default.default.SyntaxKind.ArrayLiteralExpression: + case ts9__default.default.SyntaxKind.ObjectLiteralExpression: + node = node.parent; + break; + case ts9__default.default.SyntaxKind.BinaryExpression: + return node.parent.left === node && node.parent.operatorToken.kind === ts9__default.default.SyntaxKind.EqualsToken; + case ts9__default.default.SyntaxKind.ForOfStatement: + return node.parent.initializer === node; + case ts9__default.default.SyntaxKind.PropertyAssignment: + case ts9__default.default.SyntaxKind.SpreadAssignment: + node = node.parent.parent; + break; + case ts9__default.default.SyntaxKind.SpreadElement: + if (node.parent.parent.kind !== ts9__default.default.SyntaxKind.ArrayLiteralExpression) { + return false; + } + node = node.parent.parent; + break; + default: + return false; + } + } +} +function isAbstractKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.AbstractKeyword; +} +function isAccessorKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.AccessorKeyword; +} +function isAnyKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.AnyKeyword; +} +function isAssertKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.AssertKeyword; +} +function isAssertsKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.AssertsKeyword; +} +function isAsyncKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.AsyncKeyword; +} +function isAwaitKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.AwaitKeyword; +} +function isBigIntKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.BigIntKeyword; +} +function isBooleanKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.BooleanKeyword; +} +function isColonToken(node) { + return node.kind === ts9__default.default.SyntaxKind.ColonToken; +} +function isConstKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.ConstKeyword; +} +function isDeclareKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.DeclareKeyword; +} +function isDefaultKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.DefaultKeyword; +} +function isDotToken(node) { + return node.kind === ts9__default.default.SyntaxKind.DotToken; +} +function isEndOfFileToken(node) { + return node.kind === ts9__default.default.SyntaxKind.EndOfFileToken; +} +function isEqualsGreaterThanToken(node) { + return node.kind === ts9__default.default.SyntaxKind.EqualsGreaterThanToken; +} +function isEqualsToken(node) { + return node.kind === ts9__default.default.SyntaxKind.EqualsToken; +} +function isExclamationToken(node) { + return node.kind === ts9__default.default.SyntaxKind.ExclamationToken; +} +function isExportKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.ExportKeyword; +} +function isFalseKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.FalseKeyword; +} +function isFalseLiteral(node) { + return node.kind === ts9__default.default.SyntaxKind.FalseKeyword; +} +function isImportExpression(node) { + return node.kind === ts9__default.default.SyntaxKind.ImportKeyword; +} +function isImportKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.ImportKeyword; +} +function isInKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.InKeyword; +} +function isJSDocText(node) { + return node.kind === ts9__default.default.SyntaxKind.JSDocText; +} +function isJsonMinusNumericLiteral(node) { + return node.kind === ts9__default.default.SyntaxKind.PrefixUnaryExpression; +} +function isNeverKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.NeverKeyword; +} +function isNullKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.NullKeyword; +} +function isNullLiteral(node) { + return node.kind === ts9__default.default.SyntaxKind.NullKeyword; +} +function isNumberKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.NumberKeyword; +} +function isObjectKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.ObjectKeyword; +} +function isOutKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.OutKeyword; +} +function isOverrideKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.OverrideKeyword; +} +function isPrivateKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.PrivateKeyword; +} +function isProtectedKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.ProtectedKeyword; +} +function isPublicKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.PublicKeyword; +} +function isQuestionDotToken(node) { + return node.kind === ts9__default.default.SyntaxKind.QuestionDotToken; +} +function isQuestionToken(node) { + return node.kind === ts9__default.default.SyntaxKind.QuestionToken; +} +function isReadonlyKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.ReadonlyKeyword; +} +function isStaticKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.StaticKeyword; +} +function isStringKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.StringKeyword; +} +function isSuperExpression(node) { + return node.kind === ts9__default.default.SyntaxKind.SuperKeyword; +} +function isSuperKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.SuperKeyword; +} +function isSymbolKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.SymbolKeyword; +} +function isSyntaxList(node) { + return node.kind === ts9__default.default.SyntaxKind.SyntaxList; +} +function isThisExpression(node) { + return node.kind === ts9__default.default.SyntaxKind.ThisKeyword; +} +function isThisKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.ThisKeyword; +} +function isTrueKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.TrueKeyword; +} +function isTrueLiteral(node) { + return node.kind === ts9__default.default.SyntaxKind.TrueKeyword; +} +function isUndefinedKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.UndefinedKeyword; +} +function isUnknownKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.UnknownKeyword; +} +function isVoidKeyword(node) { + return node.kind === ts9__default.default.SyntaxKind.VoidKeyword; +} +var [tsMajor, tsMinor] = ts9__default.default.versionMajorMinor.split(".").map((raw) => Number.parseInt(raw, 10)); +function isTsVersionAtLeast(major, minor = 0) { + return tsMajor > major || tsMajor === major && tsMinor >= minor; +} + +// src/nodes/typeGuards/union.ts +function hasDecorators(node) { + return ts9__default.default.isParameter(node) || ts9__default.default.isPropertyDeclaration(node) || ts9__default.default.isMethodDeclaration(node) || ts9__default.default.isGetAccessorDeclaration(node) || ts9__default.default.isSetAccessorDeclaration(node) || ts9__default.default.isClassExpression(node) || ts9__default.default.isClassDeclaration(node); +} +function hasExpressionInitializer(node) { + return ts9__default.default.isVariableDeclaration(node) || ts9__default.default.isParameter(node) || ts9__default.default.isBindingElement(node) || ts9__default.default.isPropertyDeclaration(node) || ts9__default.default.isPropertyAssignment(node) || ts9__default.default.isEnumMember(node); +} +function hasInitializer(node) { + return hasExpressionInitializer(node) || ts9__default.default.isForStatement(node) || ts9__default.default.isForInStatement(node) || ts9__default.default.isForOfStatement(node) || ts9__default.default.isJsxAttribute(node); +} +function hasJSDoc(node) { + if ( + // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isAccessorDeclaration(node) || ts9__default.default.isArrowFunction(node) || ts9__default.default.isBlock(node) || ts9__default.default.isBreakStatement(node) || ts9__default.default.isCallSignatureDeclaration(node) || ts9__default.default.isCaseClause(node) || // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isClassLikeDeclaration(node) || ts9__default.default.isConstructorDeclaration(node) || ts9__default.default.isConstructorTypeNode(node) || ts9__default.default.isConstructSignatureDeclaration(node) || ts9__default.default.isContinueStatement(node) || ts9__default.default.isDebuggerStatement(node) || ts9__default.default.isDoStatement(node) || ts9__default.default.isEmptyStatement(node) || isEndOfFileToken(node) || ts9__default.default.isEnumDeclaration(node) || ts9__default.default.isEnumMember(node) || ts9__default.default.isExportAssignment(node) || ts9__default.default.isExportDeclaration(node) || ts9__default.default.isExportSpecifier(node) || ts9__default.default.isExpressionStatement(node) || ts9__default.default.isForInStatement(node) || ts9__default.default.isForOfStatement(node) || ts9__default.default.isForStatement(node) || ts9__default.default.isFunctionDeclaration(node) || ts9__default.default.isFunctionExpression(node) || ts9__default.default.isFunctionTypeNode(node) || ts9__default.default.isIfStatement(node) || ts9__default.default.isImportDeclaration(node) || ts9__default.default.isImportEqualsDeclaration(node) || ts9__default.default.isIndexSignatureDeclaration(node) || ts9__default.default.isInterfaceDeclaration(node) || ts9__default.default.isJSDocFunctionType(node) || ts9__default.default.isLabeledStatement(node) || ts9__default.default.isMethodDeclaration(node) || ts9__default.default.isMethodSignature(node) || ts9__default.default.isModuleDeclaration(node) || ts9__default.default.isNamedTupleMember(node) || ts9__default.default.isNamespaceExportDeclaration(node) || ts9__default.default.isParameter(node) || ts9__default.default.isParenthesizedExpression(node) || ts9__default.default.isPropertyAssignment(node) || ts9__default.default.isPropertyDeclaration(node) || ts9__default.default.isPropertySignature(node) || ts9__default.default.isReturnStatement(node) || ts9__default.default.isShorthandPropertyAssignment(node) || ts9__default.default.isSpreadAssignment(node) || ts9__default.default.isSwitchStatement(node) || ts9__default.default.isThrowStatement(node) || ts9__default.default.isTryStatement(node) || ts9__default.default.isTypeAliasDeclaration(node) || ts9__default.default.isVariableDeclaration(node) || ts9__default.default.isVariableStatement(node) || ts9__default.default.isWhileStatement(node) || ts9__default.default.isWithStatement(node) + ) { + return true; + } + if (isTsVersionAtLeast(4, 4) && ts9__default.default.isClassStaticBlockDeclaration(node)) { + return true; + } + if (isTsVersionAtLeast(5, 0) && (ts9__default.default.isBinaryExpression(node) || ts9__default.default.isElementAccessExpression(node) || ts9__default.default.isIdentifier(node) || ts9__default.default.isJSDocSignature(node) || ts9__default.default.isObjectLiteralExpression(node) || ts9__default.default.isPropertyAccessExpression(node) || ts9__default.default.isTypeParameterDeclaration(node))) { + return true; + } + return false; +} +function hasModifiers(node) { + return ts9__default.default.isTypeParameterDeclaration(node) || ts9__default.default.isParameter(node) || ts9__default.default.isConstructorTypeNode(node) || ts9__default.default.isPropertySignature(node) || ts9__default.default.isPropertyDeclaration(node) || ts9__default.default.isMethodSignature(node) || ts9__default.default.isMethodDeclaration(node) || ts9__default.default.isConstructorDeclaration(node) || ts9__default.default.isGetAccessorDeclaration(node) || ts9__default.default.isSetAccessorDeclaration(node) || ts9__default.default.isIndexSignatureDeclaration(node) || ts9__default.default.isFunctionExpression(node) || ts9__default.default.isArrowFunction(node) || ts9__default.default.isClassExpression(node) || ts9__default.default.isVariableStatement(node) || ts9__default.default.isFunctionDeclaration(node) || ts9__default.default.isClassDeclaration(node) || ts9__default.default.isInterfaceDeclaration(node) || ts9__default.default.isTypeAliasDeclaration(node) || ts9__default.default.isEnumDeclaration(node) || ts9__default.default.isModuleDeclaration(node) || ts9__default.default.isImportEqualsDeclaration(node) || ts9__default.default.isImportDeclaration(node) || ts9__default.default.isExportAssignment(node) || ts9__default.default.isExportDeclaration(node); +} +function hasType(node) { + return isSignatureDeclaration(node) || ts9__default.default.isVariableDeclaration(node) || ts9__default.default.isParameter(node) || ts9__default.default.isPropertySignature(node) || ts9__default.default.isPropertyDeclaration(node) || ts9__default.default.isTypePredicateNode(node) || ts9__default.default.isParenthesizedTypeNode(node) || ts9__default.default.isTypeOperatorNode(node) || ts9__default.default.isMappedTypeNode(node) || ts9__default.default.isAssertionExpression(node) || ts9__default.default.isTypeAliasDeclaration(node) || ts9__default.default.isJSDocTypeExpression(node) || ts9__default.default.isJSDocNonNullableType(node) || ts9__default.default.isJSDocNullableType(node) || ts9__default.default.isJSDocOptionalType(node) || ts9__default.default.isJSDocVariadicType(node); +} +function hasTypeArguments(node) { + return ts9__default.default.isCallExpression(node) || ts9__default.default.isNewExpression(node) || ts9__default.default.isTaggedTemplateExpression(node) || ts9__default.default.isJsxOpeningElement(node) || ts9__default.default.isJsxSelfClosingElement(node); +} +function isAccessExpression(node) { + return ts9__default.default.isPropertyAccessExpression(node) || ts9__default.default.isElementAccessExpression(node); +} +function isAccessibilityModifier(node) { + return isPublicKeyword(node) || isPrivateKeyword(node) || isProtectedKeyword(node); +} +function isAccessorDeclaration(node) { + return ts9__default.default.isGetAccessorDeclaration(node) || ts9__default.default.isSetAccessorDeclaration(node); +} +function isArrayBindingElement(node) { + return ts9__default.default.isBindingElement(node) || ts9__default.default.isOmittedExpression(node); +} +function isArrayBindingOrAssignmentPattern(node) { + return ts9__default.default.isArrayBindingPattern(node) || ts9__default.default.isArrayLiteralExpression(node); +} +function isAssignmentPattern(node) { + return ts9__default.default.isObjectLiteralExpression(node) || ts9__default.default.isArrayLiteralExpression(node); +} +function isBindingOrAssignmentElementRestIndicator(node) { + if (ts9__default.default.isSpreadElement(node) || ts9__default.default.isSpreadAssignment(node)) { + return true; + } + if (isTsVersionAtLeast(4, 4)) { + return ts9__default.default.isDotDotDotToken(node); + } + return false; +} +function isBindingOrAssignmentElementTarget(node) { + return isBindingOrAssignmentPattern(node) || ts9__default.default.isIdentifier(node) || ts9__default.default.isPropertyAccessExpression(node) || ts9__default.default.isElementAccessExpression(node) || ts9__default.default.isOmittedExpression(node); +} +function isBindingOrAssignmentPattern(node) { + return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); +} +function isBindingPattern(node) { + return ts9__default.default.isObjectBindingPattern(node) || ts9__default.default.isArrayBindingPattern(node); +} +function isBlockLike(node) { + return ts9__default.default.isSourceFile(node) || ts9__default.default.isBlock(node) || ts9__default.default.isModuleBlock(node) || ts9__default.default.isCaseOrDefaultClause(node); +} +function isBooleanLiteral(node) { + return isTrueLiteral(node) || isFalseLiteral(node); +} +function isClassLikeDeclaration(node) { + return ts9__default.default.isClassDeclaration(node) || ts9__default.default.isClassExpression(node); +} +function isClassMemberModifier(node) { + return isAccessibilityModifier(node) || isReadonlyKeyword(node) || isStaticKeyword(node) || isAccessorKeyword(node); +} +function isDeclarationName(node) { + return ts9__default.default.isIdentifier(node) || ts9__default.default.isPrivateIdentifier(node) || ts9__default.default.isStringLiteralLike(node) || ts9__default.default.isNumericLiteral(node) || ts9__default.default.isComputedPropertyName(node) || ts9__default.default.isElementAccessExpression(node) || isBindingPattern(node) || isEntityNameExpression(node); +} +function isDeclarationWithTypeParameterChildren(node) { + return isSignatureDeclaration(node) || // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isClassLikeDeclaration(node) || ts9__default.default.isInterfaceDeclaration(node) || ts9__default.default.isTypeAliasDeclaration(node) || ts9__default.default.isJSDocTemplateTag(node); +} +function isDeclarationWithTypeParameters(node) { + return isDeclarationWithTypeParameterChildren(node) || ts9__default.default.isJSDocTypedefTag(node) || ts9__default.default.isJSDocCallbackTag(node) || ts9__default.default.isJSDocSignature(node); +} +function isDestructuringPattern(node) { + return isBindingPattern(node) || ts9__default.default.isObjectLiteralExpression(node) || ts9__default.default.isArrayLiteralExpression(node); +} +function isEntityNameExpression(node) { + return ts9__default.default.isIdentifier(node) || isPropertyAccessEntityNameExpression(node); +} +function isEntityNameOrEntityNameExpression(node) { + return ts9__default.default.isEntityName(node) || isEntityNameExpression(node); +} +function isForInOrOfStatement(node) { + return ts9__default.default.isForInStatement(node) || ts9__default.default.isForOfStatement(node); +} +function isFunctionLikeDeclaration(node) { + return ts9__default.default.isFunctionDeclaration(node) || ts9__default.default.isMethodDeclaration(node) || ts9__default.default.isGetAccessorDeclaration(node) || ts9__default.default.isSetAccessorDeclaration(node) || ts9__default.default.isConstructorDeclaration(node) || ts9__default.default.isFunctionExpression(node) || ts9__default.default.isArrowFunction(node); +} +function isJSDocComment(node) { + if (isJSDocText(node)) { + return true; + } + if (isTsVersionAtLeast(4, 4)) { + return ts9__default.default.isJSDocLink(node) || ts9__default.default.isJSDocLinkCode(node) || ts9__default.default.isJSDocLinkPlain(node); + } + return false; +} +function isJSDocNamespaceBody(node) { + return ts9__default.default.isIdentifier(node) || isJSDocNamespaceDeclaration(node); +} +function isJSDocTypeReferencingNode(node) { + return ts9__default.default.isJSDocVariadicType(node) || ts9__default.default.isJSDocOptionalType(node) || ts9__default.default.isJSDocNullableType(node) || ts9__default.default.isJSDocNonNullableType(node); +} +function isJsonObjectExpression(node) { + return ts9__default.default.isObjectLiteralExpression(node) || ts9__default.default.isArrayLiteralExpression(node) || isJsonMinusNumericLiteral(node) || ts9__default.default.isNumericLiteral(node) || ts9__default.default.isStringLiteral(node) || isBooleanLiteral(node) || isNullLiteral(node); +} +function isJsxAttributeLike(node) { + return ts9__default.default.isJsxAttribute(node) || ts9__default.default.isJsxSpreadAttribute(node); +} +function isJsxAttributeValue(node) { + return ts9__default.default.isStringLiteral(node) || ts9__default.default.isJsxExpression(node) || ts9__default.default.isJsxElement(node) || ts9__default.default.isJsxSelfClosingElement(node) || ts9__default.default.isJsxFragment(node); +} +function isJsxChild(node) { + return ts9__default.default.isJsxText(node) || ts9__default.default.isJsxExpression(node) || ts9__default.default.isJsxElement(node) || ts9__default.default.isJsxSelfClosingElement(node) || ts9__default.default.isJsxFragment(node); +} +function isJsxTagNameExpression(node) { + return ts9__default.default.isIdentifier(node) || isThisExpression(node) || isJsxTagNamePropertyAccess(node); +} +function isLiteralToken(node) { + return ts9__default.default.isNumericLiteral(node) || ts9__default.default.isBigIntLiteral(node) || ts9__default.default.isStringLiteral(node) || ts9__default.default.isJsxText(node) || ts9__default.default.isRegularExpressionLiteral(node) || ts9__default.default.isNoSubstitutionTemplateLiteral(node); +} +function isModuleBody(node) { + return isNamespaceBody(node) || isJSDocNamespaceBody(node); +} +function isModuleName(node) { + return ts9__default.default.isIdentifier(node) || ts9__default.default.isStringLiteral(node); +} +function isModuleReference(node) { + return ts9__default.default.isEntityName(node) || ts9__default.default.isExternalModuleReference(node); +} +function isNamedImportBindings(node) { + return ts9__default.default.isNamespaceImport(node) || ts9__default.default.isNamedImports(node); +} +function isNamedImportsOrExports(node) { + return ts9__default.default.isNamedImports(node) || ts9__default.default.isNamedExports(node); +} +function isNamespaceBody(node) { + return ts9__default.default.isModuleBlock(node) || isNamespaceDeclaration(node); +} +function isObjectBindingOrAssignmentElement(node) { + return ts9__default.default.isBindingElement(node) || ts9__default.default.isPropertyAssignment(node) || ts9__default.default.isShorthandPropertyAssignment(node) || ts9__default.default.isSpreadAssignment(node); +} +function isObjectBindingOrAssignmentPattern(node) { + return ts9__default.default.isObjectBindingPattern(node) || ts9__default.default.isObjectLiteralExpression(node); +} +function isObjectTypeDeclaration(node) { + return ( + // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isClassLikeDeclaration(node) || ts9__default.default.isInterfaceDeclaration(node) || ts9__default.default.isTypeLiteralNode(node) + ); +} +function isParameterPropertyModifier(node) { + return isAccessibilityModifier(node) || isReadonlyKeyword(node); +} +function isPropertyNameLiteral(node) { + return ts9__default.default.isIdentifier(node) || ts9__default.default.isStringLiteralLike(node) || ts9__default.default.isNumericLiteral(node); +} +function isPseudoLiteralToken(node) { + return ts9__default.default.isTemplateHead(node) || ts9__default.default.isTemplateMiddle(node) || ts9__default.default.isTemplateTail(node); +} +function isSignatureDeclaration(node) { + return ts9__default.default.isCallSignatureDeclaration(node) || ts9__default.default.isConstructSignatureDeclaration(node) || ts9__default.default.isMethodSignature(node) || ts9__default.default.isIndexSignatureDeclaration(node) || ts9__default.default.isFunctionTypeNode(node) || ts9__default.default.isConstructorTypeNode(node) || ts9__default.default.isJSDocFunctionType(node) || ts9__default.default.isFunctionDeclaration(node) || ts9__default.default.isMethodDeclaration(node) || ts9__default.default.isConstructorDeclaration(node) || // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isAccessorDeclaration(node) || ts9__default.default.isFunctionExpression(node) || ts9__default.default.isArrowFunction(node); +} +function isSuperProperty(node) { + return isSuperPropertyAccessExpression(node) || isSuperElementAccessExpression(node); +} +function isTypeOnlyCompatibleAliasDeclaration(node) { + if (ts9__default.default.isImportClause(node) || ts9__default.default.isImportEqualsDeclaration(node) || ts9__default.default.isNamespaceImport(node) || ts9__default.default.isImportOrExportSpecifier(node)) { + return true; + } + if (isTsVersionAtLeast(5, 0) && (ts9__default.default.isExportDeclaration(node) || ts9__default.default.isNamespaceExport(node))) { + return true; + } + return false; +} +function isTypeReferenceType(node) { + return ts9__default.default.isTypeReferenceNode(node) || ts9__default.default.isExpressionWithTypeArguments(node); +} +function isUnionOrIntersectionTypeNode(node) { + return ts9__default.default.isUnionTypeNode(node) || ts9__default.default.isIntersectionTypeNode(node); +} +function isVariableLikeDeclaration(node) { + return ts9__default.default.isVariableDeclaration(node) || ts9__default.default.isParameter(node) || ts9__default.default.isBindingElement(node) || ts9__default.default.isPropertyDeclaration(node) || ts9__default.default.isPropertyAssignment(node) || ts9__default.default.isPropertySignature(node) || ts9__default.default.isJsxAttribute(node) || ts9__default.default.isShorthandPropertyAssignment(node) || ts9__default.default.isEnumMember(node) || ts9__default.default.isJSDocPropertyTag(node) || ts9__default.default.isJSDocParameterTag(node); +} + +// src/nodes/typeGuards/compound.ts +function isConstAssertionExpression(node) { + return ts9__default.default.isTypeReferenceNode(node.type) && ts9__default.default.isIdentifier(node.type.typeName) && node.type.typeName.escapedText === "const"; +} +function isIterationStatement(node) { + switch (node.kind) { + case ts9__default.default.SyntaxKind.DoStatement: + case ts9__default.default.SyntaxKind.ForInStatement: + case ts9__default.default.SyntaxKind.ForOfStatement: + case ts9__default.default.SyntaxKind.ForStatement: + case ts9__default.default.SyntaxKind.WhileStatement: + return true; + default: + return false; + } +} +function isJSDocNamespaceDeclaration(node) { + return ts9__default.default.isModuleDeclaration(node) && ts9__default.default.isIdentifier(node.name) && (node.body === undefined || isJSDocNamespaceBody(node.body)); +} +function isJsxTagNamePropertyAccess(node) { + return ts9__default.default.isPropertyAccessExpression(node) && // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts < 5 + isJsxTagNameExpression(node.expression); +} +function isNamedDeclarationWithName(node) { + return "name" in node && node.name !== undefined && node.name !== null && isDeclarationName(node.name); +} +function isNamespaceDeclaration(node) { + return ts9__default.default.isModuleDeclaration(node) && ts9__default.default.isIdentifier(node.name) && node.body !== undefined && isNamespaceBody(node.body); +} +function isNumericOrStringLikeLiteral(node) { + switch (node.kind) { + case ts9__default.default.SyntaxKind.NoSubstitutionTemplateLiteral: + case ts9__default.default.SyntaxKind.NumericLiteral: + case ts9__default.default.SyntaxKind.StringLiteral: + return true; + default: + return false; + } +} +function isPropertyAccessEntityNameExpression(node) { + return ts9__default.default.isPropertyAccessExpression(node) && ts9__default.default.isIdentifier(node.name) && isEntityNameExpression(node.expression); +} +function isSuperElementAccessExpression(node) { + return ts9__default.default.isElementAccessExpression(node) && isSuperExpression(node.expression); +} +function isSuperPropertyAccessExpression(node) { + return ts9__default.default.isPropertyAccessExpression(node) && isSuperExpression(node.expression); +} +function isFunctionScopeBoundary(node) { + switch (node.kind) { + case ts9__default.default.SyntaxKind.ArrowFunction: + case ts9__default.default.SyntaxKind.CallSignature: + case ts9__default.default.SyntaxKind.ClassDeclaration: + case ts9__default.default.SyntaxKind.ClassExpression: + case ts9__default.default.SyntaxKind.Constructor: + case ts9__default.default.SyntaxKind.ConstructorType: + case ts9__default.default.SyntaxKind.ConstructSignature: + case ts9__default.default.SyntaxKind.EnumDeclaration: + case ts9__default.default.SyntaxKind.FunctionDeclaration: + case ts9__default.default.SyntaxKind.FunctionExpression: + case ts9__default.default.SyntaxKind.FunctionType: + case ts9__default.default.SyntaxKind.GetAccessor: + case ts9__default.default.SyntaxKind.MethodDeclaration: + case ts9__default.default.SyntaxKind.MethodSignature: + case ts9__default.default.SyntaxKind.ModuleDeclaration: + case ts9__default.default.SyntaxKind.SetAccessor: + return true; + case ts9__default.default.SyntaxKind.SourceFile: + return ts9__default.default.isExternalModule(node); + default: + return false; + } +} +function isIntrinsicAnyType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Any); +} +function isIntrinsicBigIntType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.BigInt); +} +function isIntrinsicBooleanType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Boolean); +} +function isIntrinsicErrorType(type) { + return isIntrinsicType(type) && type.intrinsicName === "error"; +} +function isIntrinsicESSymbolType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.ESSymbol); +} +var IntrinsicTypeFlags = ts9__default.default.TypeFlags.Intrinsic ?? ts9__default.default.TypeFlags.Any | ts9__default.default.TypeFlags.Unknown | ts9__default.default.TypeFlags.String | ts9__default.default.TypeFlags.Number | ts9__default.default.TypeFlags.BigInt | ts9__default.default.TypeFlags.Boolean | ts9__default.default.TypeFlags.BooleanLiteral | ts9__default.default.TypeFlags.ESSymbol | ts9__default.default.TypeFlags.Void | ts9__default.default.TypeFlags.Undefined | ts9__default.default.TypeFlags.Null | ts9__default.default.TypeFlags.Never | ts9__default.default.TypeFlags.NonPrimitive; +function isIntrinsicNeverType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Never); +} +function isIntrinsicNonPrimitiveType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.NonPrimitive); +} +function isIntrinsicNullType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Null); +} +function isIntrinsicNumberType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Number); +} +function isIntrinsicStringType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.String); +} +function isIntrinsicType(type) { + return isTypeFlagSet(type, IntrinsicTypeFlags); +} +function isIntrinsicUndefinedType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Undefined); +} +function isIntrinsicUnknownType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Unknown); +} +function isIntrinsicVoidType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Void); +} +function isConditionalType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Conditional); +} +function isEnumType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Enum); +} +function isFreshableType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Freshable); +} +function isIndexedAccessType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.IndexedAccess); +} +function isIndexType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Index); +} +function isInstantiableType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Instantiable); +} +function isIntersectionType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Intersection); +} +function isObjectType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Object); +} +function isStringMappingType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.StringMapping); +} +function isSubstitutionType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Substitution); +} +function isTypeParameter(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.TypeParameter); +} +function isTypeVariable(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.TypeVariable); +} +function isUnionOrIntersectionType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.UnionOrIntersection); +} +function isUnionType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Union); +} +function isUniqueESSymbolType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.UniqueESSymbol); +} + +// src/types/typeGuards/objects.ts +function isEvolvingArrayType(type) { + return isObjectType(type) && isObjectFlagSet(type, ts9__default.default.ObjectFlags.EvolvingArray); +} +function isTupleType(type) { + return isObjectType(type) && isObjectFlagSet(type, ts9__default.default.ObjectFlags.Tuple); +} +function isTypeReference(type) { + return isObjectType(type) && isObjectFlagSet(type, ts9__default.default.ObjectFlags.Reference); +} + +// src/types/typeGuards/compound.ts +function isFreshableIntrinsicType(type) { + return isIntrinsicType(type) && isFreshableType(type); +} +function isTupleTypeReference(type) { + return isTypeReference(type) && isTupleType(type.target); +} +function isBigIntLiteralType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.BigIntLiteral); +} +function isBooleanLiteralType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.BooleanLiteral); +} +function isFalseLiteralType(type) { + return isBooleanLiteralType(type) && type.intrinsicName === "false"; +} +function isLiteralType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.Literal); +} +function isNumberLiteralType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.NumberLiteral); +} +function isStringLiteralType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.StringLiteral); +} +function isTemplateLiteralType(type) { + return isTypeFlagSet(type, ts9__default.default.TypeFlags.TemplateLiteral); +} +function isTrueLiteralType(type) { + return isBooleanLiteralType(type) && type.intrinsicName === "true"; +} + +// src/types/getters.ts +function getCallSignaturesOfType(type) { + if (isUnionType(type)) { + const signatures = []; + for (const subType of type.types) { + signatures.push(...getCallSignaturesOfType(subType)); + } + return signatures; + } + if (isIntersectionType(type)) { + let signatures; + for (const subType of type.types) { + const sig = getCallSignaturesOfType(subType); + if (sig.length !== 0) { + if (signatures !== undefined) { + return []; + } + signatures = sig; + } + } + return signatures === undefined ? [] : signatures; + } + return type.getCallSignatures(); +} +function getPropertyOfType(type, name) { + if (!name.startsWith("__")) { + return type.getProperty(name); + } + return type.getProperties().find((s) => s.escapedName === name); +} +function getWellKnownSymbolPropertyOfType(type, wellKnownSymbolName, typeChecker) { + const prefix = "__@" + wellKnownSymbolName; + for (const prop of type.getProperties()) { + if (!prop.name.startsWith(prefix)) { + continue; + } + const declaration = prop.valueDeclaration ?? prop.getDeclarations()?.[0]; + if (!declaration || !isNamedDeclarationWithName(declaration) || declaration.name === undefined || !ts9__default.default.isComputedPropertyName(declaration.name)) { + continue; + } + const globalSymbol = typeChecker.getApparentType( + typeChecker.getTypeAtLocation(declaration.name.expression) + ).symbol; + if (prop.escapedName === getPropertyNameOfWellKnownSymbol( + typeChecker, + globalSymbol, + wellKnownSymbolName + )) { + return prop; + } + } + return undefined; +} +function getPropertyNameOfWellKnownSymbol(typeChecker, symbolConstructor, symbolName) { + const knownSymbol = symbolConstructor && typeChecker.getTypeOfSymbolAtLocation( + symbolConstructor, + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access + symbolConstructor.valueDeclaration + ).getProperty(symbolName); + const knownSymbolType = knownSymbol && typeChecker.getTypeOfSymbolAtLocation( + knownSymbol, + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access + knownSymbol.valueDeclaration + ); + if (knownSymbolType && isUniqueESSymbolType(knownSymbolType)) { + return knownSymbolType.escapedName; + } + return "__@" + symbolName; +} +function isBindableObjectDefinePropertyCall(node) { + return node.arguments.length === 3 && isEntityNameExpression(node.arguments[0]) && isNumericOrStringLikeLiteral(node.arguments[1]) && ts9__default.default.isPropertyAccessExpression(node.expression) && node.expression.name.escapedText === "defineProperty" && ts9__default.default.isIdentifier(node.expression.expression) && node.expression.expression.escapedText === "Object"; +} +function isInConstContext(node, typeChecker) { + let current = node; + while (true) { + const parent = current.parent; + outer: switch (parent.kind) { + case ts9__default.default.SyntaxKind.ArrayLiteralExpression: + case ts9__default.default.SyntaxKind.ObjectLiteralExpression: + case ts9__default.default.SyntaxKind.ParenthesizedExpression: + case ts9__default.default.SyntaxKind.TemplateExpression: + current = parent; + break; + case ts9__default.default.SyntaxKind.AsExpression: + case ts9__default.default.SyntaxKind.TypeAssertionExpression: + return isConstAssertionExpression(parent); + case ts9__default.default.SyntaxKind.CallExpression: { + if (!ts9__default.default.isExpression(current)) { + return false; + } + const functionSignature = typeChecker.getResolvedSignature( + parent + ); + if (functionSignature === undefined) { + return false; + } + const argumentIndex = parent.arguments.indexOf( + current + ); + if (argumentIndex < 0) { + return false; + } + const parameterSymbol = functionSignature.getParameters()[argumentIndex]; + if (parameterSymbol === undefined || !("links" in parameterSymbol)) { + return false; + } + const parameterSymbolLinks = parameterSymbol.links; + const propertySymbol = parameterSymbolLinks.type?.getProperties()?.[argumentIndex]; + if (propertySymbol === undefined || !("links" in propertySymbol)) { + return false; + } + return isTransientSymbolLinksFlagSet( + propertySymbol.links, + ts9__default.default.CheckFlags.Readonly + ); + } + case ts9__default.default.SyntaxKind.PrefixUnaryExpression: + if (current.kind !== ts9__default.default.SyntaxKind.NumericLiteral) { + return false; + } + switch (parent.operator) { + case ts9__default.default.SyntaxKind.MinusToken: + case ts9__default.default.SyntaxKind.PlusToken: + current = parent; + break outer; + default: + return false; + } + case ts9__default.default.SyntaxKind.PropertyAssignment: + if (parent.initializer !== current) { + return false; + } + current = parent.parent; + break; + case ts9__default.default.SyntaxKind.ShorthandPropertyAssignment: + current = parent.parent; + break; + default: + return false; + } + } +} + +// src/types/utilities.ts +function intersectionTypeParts(type) { + return isIntersectionType(type) ? type.types : [type]; +} +function isFalsyType(type) { + if (isTypeFlagSet( + type, + ts9__default.default.TypeFlags.Undefined | ts9__default.default.TypeFlags.Null | ts9__default.default.TypeFlags.Void + )) { + return true; + } + if (typeIsLiteral(type)) { + if (typeof type.value === "object") { + return type.value.base10Value === "0"; + } else { + return !type.value; + } + } + return isFalseLiteralType(type); +} +function isPropertyReadonlyInType(type, name, typeChecker) { + let seenProperty = false; + let seenReadonlySignature = false; + for (const subType of unionTypeParts(type)) { + if (getPropertyOfType(subType, name) === undefined) { + const index = (isNumericPropertyName(name) ? typeChecker.getIndexInfoOfType(subType, ts9__default.default.IndexKind.Number) : undefined) ?? typeChecker.getIndexInfoOfType(subType, ts9__default.default.IndexKind.String); + if (index?.isReadonly) { + if (seenProperty) { + return true; + } + seenReadonlySignature = true; + } + } else if (seenReadonlySignature || isReadonlyPropertyIntersection(subType, name, typeChecker)) { + return true; + } else { + seenProperty = true; + } + } + return false; +} +function isThenableType(typeChecker, node, type = typeChecker.getTypeAtLocation(node)) { + for (const typePart of unionTypeParts(typeChecker.getApparentType(type))) { + const then = typePart.getProperty("then"); + if (then === undefined) { + continue; + } + const thenType = typeChecker.getTypeOfSymbolAtLocation(then, node); + for (const subTypePart of unionTypeParts(thenType)) { + for (const signature of subTypePart.getCallSignatures()) { + if (signature.parameters.length !== 0 && isCallback(typeChecker, signature.parameters[0], node)) { + return true; + } + } + } + } + return false; +} +function symbolHasReadonlyDeclaration(symbol, typeChecker) { + return !!((symbol.flags & ts9__default.default.SymbolFlags.Accessor) === ts9__default.default.SymbolFlags.GetAccessor || symbol.declarations?.some( + (node) => isModifierFlagSet(node, ts9__default.default.ModifierFlags.Readonly) || ts9__default.default.isVariableDeclaration(node) && isNodeFlagSet(node.parent, ts9__default.default.NodeFlags.Const) || ts9__default.default.isCallExpression(node) && isReadonlyAssignmentDeclaration(node, typeChecker) || ts9__default.default.isEnumMember(node) || (ts9__default.default.isPropertyAssignment(node) || ts9__default.default.isShorthandPropertyAssignment(node)) && isInConstContext(node, typeChecker) + )); +} +function typeIsLiteral(type) { + if (isTsVersionAtLeast(5, 0)) { + return type.isLiteral(); + } else { + return isTypeFlagSet( + type, + ts9__default.default.TypeFlags.StringLiteral | ts9__default.default.TypeFlags.NumberLiteral | ts9__default.default.TypeFlags.BigIntLiteral + ); + } +} +function typeParts(type) { + return isIntersectionType(type) || isUnionType(type) ? type.types : [type]; +} +function unionTypeParts(type) { + return isUnionType(type) ? type.types : [type]; +} +function isCallback(typeChecker, param, node) { + let type = typeChecker.getApparentType( + typeChecker.getTypeOfSymbolAtLocation(param, node) + ); + if (param.valueDeclaration.dotDotDotToken) { + type = type.getNumberIndexType(); + if (type === undefined) { + return false; + } + } + for (const subType of unionTypeParts(type)) { + if (subType.getCallSignatures().length !== 0) { + return true; + } + } + return false; +} +function isReadonlyAssignmentDeclaration(node, typeChecker) { + if (!isBindableObjectDefinePropertyCall(node)) { + return false; + } + const descriptorType = typeChecker.getTypeAtLocation(node.arguments[2]); + if (descriptorType.getProperty("value") === undefined) { + return descriptorType.getProperty("set") === undefined; + } + const writableProp = descriptorType.getProperty("writable"); + if (writableProp === undefined) { + return false; + } + const writableType = writableProp.valueDeclaration !== undefined && ts9__default.default.isPropertyAssignment(writableProp.valueDeclaration) ? typeChecker.getTypeAtLocation(writableProp.valueDeclaration.initializer) : typeChecker.getTypeOfSymbolAtLocation(writableProp, node.arguments[2]); + return isFalseLiteralType(writableType); +} +function isReadonlyPropertyFromMappedType(type, name, typeChecker) { + if (!isObjectType(type) || !isObjectFlagSet(type, ts9__default.default.ObjectFlags.Mapped)) { + return; + } + const declaration = type.symbol.declarations[0]; + if (declaration.readonlyToken !== undefined && !/^__@[^@]+$/.test(name)) { + return declaration.readonlyToken.kind !== ts9__default.default.SyntaxKind.MinusToken; + } + const { modifiersType } = type; + return modifiersType && isPropertyReadonlyInType(modifiersType, name, typeChecker); +} +function isReadonlyPropertyIntersection(type, name, typeChecker) { + const typeParts2 = isIntersectionType(type) ? type.types : [type]; + return typeParts2.some((subType) => { + const prop = getPropertyOfType(subType, name); + if (prop === undefined) { + return false; + } + if (prop.flags & ts9__default.default.SymbolFlags.Transient) { + if (/^(?:[1-9]\d*|0)$/.test(name) && isTupleTypeReference(subType)) { + return subType.target.readonly; + } + switch (isReadonlyPropertyFromMappedType(subType, name, typeChecker)) { + case false: + return false; + case true: + return true; + } + } + return !!// members of namespace import + (isSymbolFlagSet(prop, ts9__default.default.SymbolFlags.ValueModule) || // we unwrapped every mapped type, now we can check the actual declarations + symbolHasReadonlyDeclaration(prop, typeChecker)); + }); +} +function identifierToKeywordKind(node) { + return "originalKeywordKind" in node ? node.originalKeywordKind : ts9__default.default.identifierToKeywordKind(node); +} + +// src/usage/declarations.ts +var DeclarationDomain = /* @__PURE__ */ ((DeclarationDomain2) => { + DeclarationDomain2[DeclarationDomain2["Namespace"] = 1] = "Namespace"; + DeclarationDomain2[DeclarationDomain2["Type"] = 2] = "Type"; + DeclarationDomain2[DeclarationDomain2["Value"] = 4] = "Value"; + DeclarationDomain2[DeclarationDomain2["Any"] = 7] = "Any"; + DeclarationDomain2[DeclarationDomain2["Import"] = 8] = "Import"; + return DeclarationDomain2; +})(DeclarationDomain || {}); +function getDeclarationDomain(node) { + switch (node.parent.kind) { + case ts9__default.default.SyntaxKind.ClassDeclaration: + case ts9__default.default.SyntaxKind.ClassExpression: + return 2 /* Type */ | 4 /* Value */; + case ts9__default.default.SyntaxKind.EnumDeclaration: + return 7 /* Any */; + case ts9__default.default.SyntaxKind.FunctionDeclaration: + case ts9__default.default.SyntaxKind.FunctionExpression: + return 4 /* Value */; + case ts9__default.default.SyntaxKind.ImportClause: + case ts9__default.default.SyntaxKind.NamespaceImport: + return 7 /* Any */ | 8 /* Import */; + // TODO handle type-only imports + case ts9__default.default.SyntaxKind.ImportEqualsDeclaration: + case ts9__default.default.SyntaxKind.ImportSpecifier: + return node.parent.name === node ? 7 /* Any */ | 8 /* Import */ : undefined; + case ts9__default.default.SyntaxKind.InterfaceDeclaration: + case ts9__default.default.SyntaxKind.TypeAliasDeclaration: + case ts9__default.default.SyntaxKind.TypeParameter: + return 2 /* Type */; + case ts9__default.default.SyntaxKind.ModuleDeclaration: + return 1 /* Namespace */; + case ts9__default.default.SyntaxKind.Parameter: + if (node.parent.parent.kind === ts9__default.default.SyntaxKind.IndexSignature || identifierToKeywordKind(node) === ts9__default.default.SyntaxKind.ThisKeyword) { + return; + } + // falls through + case ts9__default.default.SyntaxKind.BindingElement: + case ts9__default.default.SyntaxKind.VariableDeclaration: + return node.parent.name === node ? 4 /* Value */ : undefined; + } +} +function getPropertyName(propertyName) { + if (propertyName.kind === ts9__default.default.SyntaxKind.ComputedPropertyName) { + const expression = unwrapParentheses(propertyName.expression); + if (ts9__default.default.isPrefixUnaryExpression(expression)) { + let negate = false; + switch (expression.operator) { + case ts9__default.default.SyntaxKind.MinusToken: + negate = true; + // falls through + case ts9__default.default.SyntaxKind.PlusToken: + return ts9__default.default.isNumericLiteral(expression.operand) ? `${negate ? "-" : ""}${expression.operand.text}` : ts9__default.default.isBigIntLiteral(expression.operand) ? `${negate ? "-" : ""}${expression.operand.text.slice(0, -1)}` : undefined; + default: + return; + } + } + if (ts9__default.default.isBigIntLiteral(expression)) { + return expression.text.slice(0, -1); + } + if (isNumericOrStringLikeLiteral(expression)) { + return expression.text; + } + return; + } + return propertyName.kind === ts9__default.default.SyntaxKind.PrivateIdentifier ? undefined : propertyName.text; +} +function unwrapParentheses(node) { + while (node.kind === ts9__default.default.SyntaxKind.ParenthesizedExpression) { + node = node.expression; + } + return node; +} +var UsageDomain = /* @__PURE__ */ ((UsageDomain2) => { + UsageDomain2[UsageDomain2["Namespace"] = 1] = "Namespace"; + UsageDomain2[UsageDomain2["Type"] = 2] = "Type"; + UsageDomain2[UsageDomain2["Value"] = 4] = "Value"; + UsageDomain2[UsageDomain2["Any"] = 7] = "Any"; + UsageDomain2[UsageDomain2["TypeQuery"] = 8] = "TypeQuery"; + UsageDomain2[UsageDomain2["ValueOrNamespace"] = 5] = "ValueOrNamespace"; + return UsageDomain2; +})(UsageDomain || {}); +function getUsageDomain(node) { + const parent = node.parent; + switch (parent.kind) { + // Value + case ts9__default.default.SyntaxKind.BindingElement: + if (parent.initializer === node) { + return 5 /* ValueOrNamespace */; + } + break; + case ts9__default.default.SyntaxKind.BreakStatement: + case ts9__default.default.SyntaxKind.ClassDeclaration: + case ts9__default.default.SyntaxKind.ClassExpression: + case ts9__default.default.SyntaxKind.ContinueStatement: + case ts9__default.default.SyntaxKind.EnumDeclaration: + case ts9__default.default.SyntaxKind.FunctionDeclaration: + case ts9__default.default.SyntaxKind.FunctionExpression: + case ts9__default.default.SyntaxKind.GetAccessor: + case ts9__default.default.SyntaxKind.ImportClause: + case ts9__default.default.SyntaxKind.ImportSpecifier: + case ts9__default.default.SyntaxKind.InterfaceDeclaration: + case ts9__default.default.SyntaxKind.JsxAttribute: + case ts9__default.default.SyntaxKind.LabeledStatement: + case ts9__default.default.SyntaxKind.MethodDeclaration: + case ts9__default.default.SyntaxKind.MethodSignature: + case ts9__default.default.SyntaxKind.ModuleDeclaration: + case ts9__default.default.SyntaxKind.NamedTupleMember: + case ts9__default.default.SyntaxKind.NamespaceExport: + case ts9__default.default.SyntaxKind.NamespaceExportDeclaration: + case ts9__default.default.SyntaxKind.NamespaceImport: + case ts9__default.default.SyntaxKind.PropertySignature: + case ts9__default.default.SyntaxKind.SetAccessor: + case ts9__default.default.SyntaxKind.TypeAliasDeclaration: + case ts9__default.default.SyntaxKind.TypeParameter: + case ts9__default.default.SyntaxKind.TypePredicate: + break; + case ts9__default.default.SyntaxKind.EnumMember: + case ts9__default.default.SyntaxKind.ImportEqualsDeclaration: + case ts9__default.default.SyntaxKind.Parameter: + case ts9__default.default.SyntaxKind.PropertyAccessExpression: + case ts9__default.default.SyntaxKind.PropertyAssignment: + case ts9__default.default.SyntaxKind.PropertyDeclaration: + case ts9__default.default.SyntaxKind.VariableDeclaration: + if (parent.name !== node) { + return 5 /* ValueOrNamespace */; + } + break; + case ts9__default.default.SyntaxKind.ExportAssignment: + return 7 /* Any */; + case ts9__default.default.SyntaxKind.ExportSpecifier: + if (parent.propertyName === undefined || parent.propertyName === node) { + return 7 /* Any */; + } + break; + case ts9__default.default.SyntaxKind.ExpressionWithTypeArguments: + return parent.parent.token === ts9__default.default.SyntaxKind.ImplementsKeyword || parent.parent.parent.kind === ts9__default.default.SyntaxKind.InterfaceDeclaration ? 2 /* Type */ : 4 /* Value */; + case ts9__default.default.SyntaxKind.QualifiedName: + if (parent.left === node) { + if (getEntityNameParent(parent).kind === ts9__default.default.SyntaxKind.TypeQuery) { + return 1 /* Namespace */ | 8 /* TypeQuery */; + } + return 1 /* Namespace */; + } + break; + case ts9__default.default.SyntaxKind.TypeQuery: + return 5 /* ValueOrNamespace */ | 8 /* TypeQuery */; + case ts9__default.default.SyntaxKind.TypeReference: + return identifierToKeywordKind(node) !== ts9__default.default.SyntaxKind.ConstKeyword ? 2 /* Type */ : undefined; + default: + return 5 /* ValueOrNamespace */; + } +} +function getEntityNameParent(name) { + let parent = name.parent; + while (parent.kind === ts9__default.default.SyntaxKind.QualifiedName) { + parent = parent.parent; + } + return parent; +} +function isBlockScopeBoundary(node) { + switch (node.kind) { + case ts9__default.default.SyntaxKind.Block: { + const parent = node.parent; + return parent.kind !== ts9__default.default.SyntaxKind.CatchClause && // blocks inside SourceFile are block scope boundaries + (parent.kind === ts9__default.default.SyntaxKind.SourceFile || // blocks that are direct children of a function scope boundary are no scope boundary + // for example the FunctionBlock is part of the function scope of the containing function + !isFunctionScopeBoundary(parent)) ? 2 /* Block */ : 0 /* None */; + } + case ts9__default.default.SyntaxKind.CaseBlock: + case ts9__default.default.SyntaxKind.CatchClause: + case ts9__default.default.SyntaxKind.ForInStatement: + case ts9__default.default.SyntaxKind.ForOfStatement: + case ts9__default.default.SyntaxKind.ForStatement: + case ts9__default.default.SyntaxKind.WithStatement: + return 2 /* Block */; + default: + return 0 /* None */; + } +} + +// src/usage/scopes.ts +var AbstractScope = class { + constructor(global) { + this.global = global; + } + namespaceScopes = undefined; + uses = []; + variables = /* @__PURE__ */ new Map(); + #enumScopes = undefined; + addUse(use) { + this.uses.push(use); + } + addVariable(identifier, name, selector, exported, domain) { + const variables = this.getDestinationScope(selector).getVariables(); + const declaration = { + declaration: name, + domain, + exported + }; + const variable = variables.get(identifier); + if (variable === undefined) { + variables.set(identifier, { + declarations: [declaration], + domain, + uses: [] + }); + } else { + variable.domain |= domain; + variable.declarations.push(declaration); + } + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + createOrReuseEnumScope(name, _exported) { + let scope; + if (this.#enumScopes === undefined) { + this.#enumScopes = /* @__PURE__ */ new Map(); + } else { + scope = this.#enumScopes.get(name); + } + if (scope === undefined) { + scope = new EnumScope(this); + this.#enumScopes.set(name, scope); + } + return scope; + } + // only relevant for the root scope + createOrReuseNamespaceScope(name, _exported, ambient, hasExportStatement) { + let scope; + if (this.namespaceScopes === undefined) { + this.namespaceScopes = /* @__PURE__ */ new Map(); + } else { + scope = this.namespaceScopes.get(name); + } + if (scope === undefined) { + scope = new NamespaceScope(ambient, hasExportStatement, this); + this.namespaceScopes.set(name, scope); + } else { + scope.refresh(ambient, hasExportStatement); + } + return scope; + } + end(cb) { + if (this.namespaceScopes !== undefined) { + this.namespaceScopes.forEach((value) => value.finish(cb)); + } + this.namespaceScopes = this.#enumScopes = undefined; + this.applyUses(); + this.variables.forEach((variable) => { + for (const declaration of variable.declarations) { + const result = { + declarations: [], + domain: declaration.domain, + exported: declaration.exported, + inGlobalScope: this.global, + uses: [] + }; + for (const other of variable.declarations) { + if (other.domain & declaration.domain) { + result.declarations.push(other.declaration); + } + } + for (const use of variable.uses) { + if (use.domain & declaration.domain) { + result.uses.push(use); + } + } + cb(result, declaration.declaration, this); + } + }); + } + getFunctionScope() { + return this; + } + getVariables() { + return this.variables; + } + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars + markExported(_name) { + } + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars + addUseToParent(_use) { + } + applyUse(use, variables = this.variables) { + const variable = variables.get(use.location.text); + if (variable === undefined || (variable.domain & use.domain) === 0) { + return false; + } + variable.uses.push(use); + return true; + } + applyUses() { + for (const use of this.uses) { + if (!this.applyUse(use)) { + this.addUseToParent(use); + } + } + this.uses = []; + } +}; +var NonRootScope = class extends AbstractScope { + constructor(parent, boundary) { + super(false); + this.parent = parent; + this.boundary = boundary; + } + getDestinationScope(selector) { + return this.boundary & selector ? this : this.parent.getDestinationScope(selector); + } + addUseToParent(use) { + return this.parent.addUse(use, this); + } +}; +var AbstractNamedExpressionScope = class extends NonRootScope { + #domain; + #name; + constructor(name, domain, parent) { + super(parent, 1 /* Function */); + this.#name = name; + this.#domain = domain; + } + addUse(use, source) { + if (source !== this.innerScope) { + return this.innerScope.addUse(use); + } + if (use.domain & this.#domain && use.location.text === this.#name.text) { + this.uses.push(use); + } else { + return this.parent.addUse(use, this); + } + } + end(cb) { + this.innerScope.end(cb); + return cb( + { + declarations: [this.#name], + domain: this.#domain, + exported: false, + inGlobalScope: false, + uses: this.uses + }, + this.#name, + this + ); + } + getDestinationScope() { + return this.innerScope; + } + getFunctionScope() { + return this.innerScope; + } +}; +var BlockScope = class extends NonRootScope { + #functionScope; + constructor(functionScope, parent) { + super(parent, 2 /* Block */); + this.#functionScope = functionScope; + } + getFunctionScope() { + return this.#functionScope; + } +}; +var ClassExpressionScope = class extends AbstractNamedExpressionScope { + innerScope = new NonRootScope(this, 1 /* Function */); + constructor(name, parent) { + super(name, 4 /* Value */ | 2 /* Type */, parent); + } +}; +var ConditionalTypeScope = class extends NonRootScope { + #state = 0 /* Initial */; + constructor(parent) { + super(parent, 8 /* ConditionalType */); + } + addUse(use) { + if (this.#state === 2 /* TrueType */) { + return void this.uses.push(use); + } + return this.parent.addUse(use, this); + } + updateState(newState) { + this.#state = newState; + } +}; +var EnumScope = class extends NonRootScope { + constructor(parent) { + super(parent, 1 /* Function */); + } + end() { + this.applyUses(); + } +}; +var FunctionScope = class extends NonRootScope { + constructor(parent) { + super(parent, 1 /* Function */); + } + beginBody() { + this.applyUses(); + } +}; +var FunctionExpressionScope = class extends AbstractNamedExpressionScope { + innerScope = new FunctionScope(this); + constructor(name, parent) { + super(name, 4 /* Value */, parent); + } + beginBody() { + return this.innerScope.beginBody(); + } +}; +var NamespaceScope = class extends NonRootScope { + #ambient; + #exports = undefined; + #hasExport; + #innerScope = new NonRootScope(this, 1 /* Function */); + constructor(ambient, hasExport, parent) { + super(parent, 1 /* Function */); + this.#ambient = ambient; + this.#hasExport = hasExport; + } + addUse(use, source) { + if (source !== this.#innerScope) { + return this.#innerScope.addUse(use); + } + this.uses.push(use); + } + createOrReuseEnumScope(name, exported) { + if (!exported && (!this.#ambient || this.#hasExport)) { + return this.#innerScope.createOrReuseEnumScope(name, exported); + } + return super.createOrReuseEnumScope(name, exported); + } + createOrReuseNamespaceScope(name, exported, ambient, hasExportStatement) { + if (!exported && (!this.#ambient || this.#hasExport)) { + return this.#innerScope.createOrReuseNamespaceScope( + name, + exported, + ambient || this.#ambient, + hasExportStatement + ); + } + return super.createOrReuseNamespaceScope( + name, + exported, + ambient || this.#ambient, + hasExportStatement + ); + } + end(cb) { + this.#innerScope.end((variable, key, scope) => { + if (scope !== this.#innerScope || !variable.exported && (!this.#ambient || this.#exports !== undefined && !this.#exports.has(key.text))) { + return cb(variable, key, scope); + } + const namespaceVar = this.variables.get(key.text); + if (namespaceVar === undefined) { + this.variables.set(key.text, { + declarations: variable.declarations.map(mapDeclaration), + domain: variable.domain, + uses: [...variable.uses] + }); + } else { + outer: for (const declaration of variable.declarations) { + for (const existing of namespaceVar.declarations) { + if (existing.declaration === declaration) { + continue outer; + } + namespaceVar.declarations.push(mapDeclaration(declaration)); + } + } + namespaceVar.domain |= variable.domain; + for (const use of variable.uses) { + if (namespaceVar.uses.includes(use)) { + continue; + } + namespaceVar.uses.push(use); + } + } + }); + this.applyUses(); + this.#innerScope = new NonRootScope(this, 1 /* Function */); + } + finish(cb) { + return super.end(cb); + } + getDestinationScope() { + return this.#innerScope; + } + markExported(name) { + if (this.#exports === undefined) { + this.#exports = /* @__PURE__ */ new Set(); + } + this.#exports.add(name.text); + } + refresh(ambient, hasExport) { + this.#ambient = ambient; + this.#hasExport = hasExport; + } +}; +var RootScope = class extends AbstractScope { + #exportAll; + #exports = undefined; + #innerScope = new NonRootScope(this, 1 /* Function */); + constructor(exportAll, global) { + super(global); + this.#exportAll = exportAll; + } + addUse(use, origin) { + if (origin === this.#innerScope) { + return super.addUse(use); + } + return this.#innerScope.addUse(use); + } + addVariable(identifier, name, selector, exported, domain) { + if (domain & 8 /* Import */) { + return super.addVariable(identifier, name, selector, exported, domain); + } + return this.#innerScope.addVariable( + identifier, + name, + selector, + exported, + domain + ); + } + end(cb) { + this.#innerScope.end((value, key) => { + value.exported ||= this.#exportAll || this.#exports !== undefined && this.#exports.includes(key.text); + value.inGlobalScope = this.global; + return cb(value, key, this); + }); + return super.end((value, key, scope) => { + value.exported ||= scope === this && this.#exports !== undefined && this.#exports.includes(key.text); + return cb(value, key, scope); + }); + } + getDestinationScope() { + return this; + } + markExported(id) { + if (this.#exports === undefined) { + this.#exports = [id.text]; + } else { + this.#exports.push(id.text); + } + } +}; +function mapDeclaration(declaration) { + return { + declaration, + domain: getDeclarationDomain(declaration), + exported: true + }; +} + +// src/usage/UsageWalker.ts +var UsageWalker = class { + #result = /* @__PURE__ */ new Map(); + #scope; + getUsage(sourceFile) { + const variableCallback = (variable, key) => { + this.#result.set(key, variable); + }; + const isModule = ts9__default.default.isExternalModule(sourceFile); + this.#scope = new RootScope( + sourceFile.isDeclarationFile && isModule && !containsExportStatement(sourceFile), + !isModule + ); + const cb = (node) => { + if (isBlockScopeBoundary(node)) { + return continueWithScope( + node, + new BlockScope(this.#scope.getFunctionScope(), this.#scope), + handleBlockScope + ); + } + switch (node.kind) { + case ts9__default.default.SyntaxKind.ArrowFunction: + case ts9__default.default.SyntaxKind.CallSignature: + case ts9__default.default.SyntaxKind.Constructor: + case ts9__default.default.SyntaxKind.ConstructorType: + case ts9__default.default.SyntaxKind.ConstructSignature: + case ts9__default.default.SyntaxKind.FunctionDeclaration: + case ts9__default.default.SyntaxKind.FunctionExpression: + case ts9__default.default.SyntaxKind.FunctionType: + case ts9__default.default.SyntaxKind.GetAccessor: + case ts9__default.default.SyntaxKind.MethodDeclaration: + case ts9__default.default.SyntaxKind.MethodSignature: + case ts9__default.default.SyntaxKind.SetAccessor: + return this.#handleFunctionLikeDeclaration( + node, + cb, + variableCallback + ); + case ts9__default.default.SyntaxKind.ClassDeclaration: + this.#handleDeclaration( + node, + true, + 4 /* Value */ | 2 /* Type */ + ); + return continueWithScope( + node, + new NonRootScope(this.#scope, 1 /* Function */) + ); + case ts9__default.default.SyntaxKind.ClassExpression: + return continueWithScope( + node, + node.name !== undefined ? new ClassExpressionScope( + node.name, + this.#scope + ) : new NonRootScope(this.#scope, 1 /* Function */) + ); + case ts9__default.default.SyntaxKind.ConditionalType: + return this.#handleConditionalType( + node, + cb, + variableCallback + ); + case ts9__default.default.SyntaxKind.EnumDeclaration: + this.#handleDeclaration( + node, + true, + 7 /* Any */ + ); + return continueWithScope( + node, + this.#scope.createOrReuseEnumScope( + node.name.text, + includesModifier( + node.modifiers, + ts9__default.default.SyntaxKind.ExportKeyword + ) + ) + ); + case ts9__default.default.SyntaxKind.EnumMember: + this.#scope.addVariable( + getPropertyName(node.name), + node.name, + 1 /* Function */, + true, + 4 /* Value */ + ); + break; + case ts9__default.default.SyntaxKind.ExportAssignment: + if (node.expression.kind === ts9__default.default.SyntaxKind.Identifier) { + return this.#scope.markExported( + node.expression + ); + } + break; + case ts9__default.default.SyntaxKind.ExportSpecifier: + if (node.propertyName !== undefined) { + return this.#scope.markExported( + node.propertyName, + node.name + ); + } + return this.#scope.markExported(node.name); + case ts9__default.default.SyntaxKind.Identifier: { + const domain = getUsageDomain(node); + if (domain !== undefined) { + this.#scope.addUse({ domain, location: node }); + } + return; + } + case ts9__default.default.SyntaxKind.ImportClause: + case ts9__default.default.SyntaxKind.ImportEqualsDeclaration: + case ts9__default.default.SyntaxKind.ImportSpecifier: + case ts9__default.default.SyntaxKind.NamespaceImport: + this.#handleDeclaration( + node, + false, + 7 /* Any */ | 8 /* Import */ + ); + break; + case ts9__default.default.SyntaxKind.InterfaceDeclaration: + case ts9__default.default.SyntaxKind.TypeAliasDeclaration: + this.#handleDeclaration( + node, + true, + 2 /* Type */ + ); + return continueWithScope( + node, + new NonRootScope(this.#scope, 4 /* Type */) + ); + case ts9__default.default.SyntaxKind.MappedType: + return continueWithScope( + node, + new NonRootScope(this.#scope, 4 /* Type */) + ); + case ts9__default.default.SyntaxKind.ModuleDeclaration: + return this.#handleModule( + node, + continueWithScope + ); + case ts9__default.default.SyntaxKind.Parameter: + if (node.parent.kind !== ts9__default.default.SyntaxKind.IndexSignature && (node.name.kind !== ts9__default.default.SyntaxKind.Identifier || identifierToKeywordKind( + node.name + ) !== ts9__default.default.SyntaxKind.ThisKeyword)) { + this.#handleBindingName( + node.name, + false, + false + ); + } + break; + case ts9__default.default.SyntaxKind.TypeParameter: + this.#scope.addVariable( + node.name.text, + node.name, + node.parent.kind === ts9__default.default.SyntaxKind.InferType ? 8 /* InferType */ : 7 /* Type */, + false, + 2 /* Type */ + ); + break; + // End of Scope specific handling + case ts9__default.default.SyntaxKind.VariableDeclarationList: + this.#handleVariableDeclaration(node); + break; + } + return ts9__default.default.forEachChild(node, cb); + }; + const continueWithScope = (node, scope, next = forEachChild) => { + const savedScope = this.#scope; + this.#scope = scope; + next(node); + this.#scope.end(variableCallback); + this.#scope = savedScope; + }; + const handleBlockScope = (node) => { + if (node.kind === ts9__default.default.SyntaxKind.CatchClause && node.variableDeclaration !== undefined) { + this.#handleBindingName( + node.variableDeclaration.name, + true, + false + ); + } + return ts9__default.default.forEachChild(node, cb); + }; + ts9__default.default.forEachChild(sourceFile, cb); + this.#scope.end(variableCallback); + return this.#result; + function forEachChild(node) { + return ts9__default.default.forEachChild(node, cb); + } + } + #handleBindingName(name, blockScoped, exported) { + if (name.kind === ts9__default.default.SyntaxKind.Identifier) { + return this.#scope.addVariable( + name.text, + name, + blockScoped ? 3 /* Block */ : 1 /* Function */, + exported, + 4 /* Value */ + ); + } + forEachDestructuringIdentifier(name, (declaration) => { + this.#scope.addVariable( + declaration.name.text, + declaration.name, + blockScoped ? 3 /* Block */ : 1 /* Function */, + exported, + 4 /* Value */ + ); + }); + } + #handleConditionalType(node, cb, varCb) { + const savedScope = this.#scope; + const scope = this.#scope = new ConditionalTypeScope(savedScope); + cb(node.checkType); + scope.updateState(1 /* Extends */); + cb(node.extendsType); + scope.updateState(2 /* TrueType */); + cb(node.trueType); + scope.updateState(3 /* FalseType */); + cb(node.falseType); + scope.end(varCb); + this.#scope = savedScope; + } + #handleDeclaration(node, blockScoped, domain) { + if (node.name !== undefined) { + this.#scope.addVariable( + node.name.text, + node.name, + blockScoped ? 3 /* Block */ : 1 /* Function */, + includesModifier( + node.modifiers, + ts9__default.default.SyntaxKind.ExportKeyword + ), + domain + ); + } + } + #handleFunctionLikeDeclaration(node, cb, varCb) { + if (ts9__default.default.canHaveDecorators(node)) { + ts9__default.default.getDecorators(node)?.forEach(cb); + } + const savedScope = this.#scope; + if (node.kind === ts9__default.default.SyntaxKind.FunctionDeclaration) { + this.#handleDeclaration(node, false, 4 /* Value */); + } + const scope = this.#scope = node.kind === ts9__default.default.SyntaxKind.FunctionExpression && node.name !== undefined ? new FunctionExpressionScope(node.name, savedScope) : new FunctionScope(savedScope); + if (node.name !== undefined) { + cb(node.name); + } + if (node.typeParameters !== undefined) { + node.typeParameters.forEach(cb); + } + node.parameters.forEach(cb); + if (node.type !== undefined) { + cb(node.type); + } + if (node.body !== undefined) { + scope.beginBody(); + cb(node.body); + } + scope.end(varCb); + this.#scope = savedScope; + } + #handleModule(node, next) { + if (node.flags & ts9__default.default.NodeFlags.GlobalAugmentation) { + return next( + node, + this.#scope.createOrReuseNamespaceScope("-global", false, true, false) + ); + } + if (node.name.kind === ts9__default.default.SyntaxKind.Identifier) { + const exported = isNamespaceExported(node); + this.#scope.addVariable( + node.name.text, + node.name, + 1 /* Function */, + exported, + 1 /* Namespace */ | 4 /* Value */ + ); + const ambient = includesModifier( + node.modifiers, + ts9__default.default.SyntaxKind.DeclareKeyword + ); + return next( + node, + this.#scope.createOrReuseNamespaceScope( + node.name.text, + exported, + ambient, + ambient && namespaceHasExportStatement(node) + ) + ); + } + return next( + node, + this.#scope.createOrReuseNamespaceScope( + `"${node.name.text}"`, + false, + true, + namespaceHasExportStatement(node) + ) + ); + } + #handleVariableDeclaration(declarationList) { + const blockScoped = isBlockScopedVariableDeclarationList(declarationList); + const exported = declarationList.parent.kind === ts9__default.default.SyntaxKind.VariableStatement && includesModifier( + declarationList.parent.modifiers, + ts9__default.default.SyntaxKind.ExportKeyword + ); + for (const declaration of declarationList.declarations) { + this.#handleBindingName(declaration.name, blockScoped, exported); + } + } +}; +function containsExportStatement(block) { + for (const statement of block.statements) { + if (statement.kind === ts9__default.default.SyntaxKind.ExportDeclaration || statement.kind === ts9__default.default.SyntaxKind.ExportAssignment) { + return true; + } + } + return false; +} +function forEachDestructuringIdentifier(pattern, fn) { + for (const element of pattern.elements) { + if (element.kind !== ts9__default.default.SyntaxKind.BindingElement) { + continue; + } + let result; + if (element.name.kind === ts9__default.default.SyntaxKind.Identifier) { + result = fn(element); + } else { + result = forEachDestructuringIdentifier(element.name, fn); + } + if (result) { + return result; + } + } +} +function isBlockScopedVariableDeclarationList(declarationList) { + return (declarationList.flags & ts9__default.default.NodeFlags.BlockScoped) !== 0; +} +function isNamespaceExported(node) { + return node.parent.kind === ts9__default.default.SyntaxKind.ModuleDeclaration || includesModifier(node.modifiers, ts9__default.default.SyntaxKind.ExportKeyword); +} +function namespaceHasExportStatement(ns) { + if (ns.body === undefined || ns.body.kind !== ts9__default.default.SyntaxKind.ModuleBlock) { + return false; + } + return containsExportStatement(ns.body); +} + +// src/usage/collectVariableUsage.ts +function collectVariableUsage(sourceFile) { + return new UsageWalker().getUsage(sourceFile); +} + +exports.AccessKind = AccessKind; +exports.DeclarationDomain = DeclarationDomain; +exports.UsageDomain = UsageDomain; +exports.collectVariableUsage = collectVariableUsage; +exports.forEachComment = forEachComment; +exports.forEachToken = forEachToken; +exports.getAccessKind = getAccessKind; +exports.getCallSignaturesOfType = getCallSignaturesOfType; +exports.getPropertyOfType = getPropertyOfType; +exports.getWellKnownSymbolPropertyOfType = getWellKnownSymbolPropertyOfType; +exports.hasDecorators = hasDecorators; +exports.hasExpressionInitializer = hasExpressionInitializer; +exports.hasInitializer = hasInitializer; +exports.hasJSDoc = hasJSDoc; +exports.hasModifiers = hasModifiers; +exports.hasType = hasType; +exports.hasTypeArguments = hasTypeArguments; +exports.includesModifier = includesModifier; +exports.intersectionTypeParts = intersectionTypeParts; +exports.isAbstractKeyword = isAbstractKeyword; +exports.isAccessExpression = isAccessExpression; +exports.isAccessibilityModifier = isAccessibilityModifier; +exports.isAccessorDeclaration = isAccessorDeclaration; +exports.isAccessorKeyword = isAccessorKeyword; +exports.isAnyKeyword = isAnyKeyword; +exports.isArrayBindingElement = isArrayBindingElement; +exports.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; +exports.isAssertKeyword = isAssertKeyword; +exports.isAssertsKeyword = isAssertsKeyword; +exports.isAssignmentKind = isAssignmentKind; +exports.isAssignmentPattern = isAssignmentPattern; +exports.isAsyncKeyword = isAsyncKeyword; +exports.isAwaitKeyword = isAwaitKeyword; +exports.isBigIntKeyword = isBigIntKeyword; +exports.isBigIntLiteralType = isBigIntLiteralType; +exports.isBindingOrAssignmentElementRestIndicator = isBindingOrAssignmentElementRestIndicator; +exports.isBindingOrAssignmentElementTarget = isBindingOrAssignmentElementTarget; +exports.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; +exports.isBindingPattern = isBindingPattern; +exports.isBlockLike = isBlockLike; +exports.isBooleanKeyword = isBooleanKeyword; +exports.isBooleanLiteral = isBooleanLiteral; +exports.isBooleanLiteralType = isBooleanLiteralType; +exports.isClassLikeDeclaration = isClassLikeDeclaration; +exports.isClassMemberModifier = isClassMemberModifier; +exports.isColonToken = isColonToken; +exports.isCompilerOptionEnabled = isCompilerOptionEnabled; +exports.isConditionalType = isConditionalType; +exports.isConstAssertionExpression = isConstAssertionExpression; +exports.isConstKeyword = isConstKeyword; +exports.isDeclarationName = isDeclarationName; +exports.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; +exports.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; +exports.isDeclareKeyword = isDeclareKeyword; +exports.isDefaultKeyword = isDefaultKeyword; +exports.isDestructuringPattern = isDestructuringPattern; +exports.isDotToken = isDotToken; +exports.isEndOfFileToken = isEndOfFileToken; +exports.isEntityNameExpression = isEntityNameExpression; +exports.isEntityNameOrEntityNameExpression = isEntityNameOrEntityNameExpression; +exports.isEnumType = isEnumType; +exports.isEqualsGreaterThanToken = isEqualsGreaterThanToken; +exports.isEqualsToken = isEqualsToken; +exports.isEvolvingArrayType = isEvolvingArrayType; +exports.isExclamationToken = isExclamationToken; +exports.isExportKeyword = isExportKeyword; +exports.isFalseKeyword = isFalseKeyword; +exports.isFalseLiteral = isFalseLiteral; +exports.isFalseLiteralType = isFalseLiteralType; +exports.isFalsyType = isFalsyType; +exports.isForInOrOfStatement = isForInOrOfStatement; +exports.isFreshableIntrinsicType = isFreshableIntrinsicType; +exports.isFreshableType = isFreshableType; +exports.isFunctionLikeDeclaration = isFunctionLikeDeclaration; +exports.isFunctionScopeBoundary = isFunctionScopeBoundary; +exports.isImportExpression = isImportExpression; +exports.isImportKeyword = isImportKeyword; +exports.isInKeyword = isInKeyword; +exports.isIndexType = isIndexType; +exports.isIndexedAccessType = isIndexedAccessType; +exports.isInstantiableType = isInstantiableType; +exports.isIntersectionType = isIntersectionType; +exports.isIntrinsicAnyType = isIntrinsicAnyType; +exports.isIntrinsicBigIntType = isIntrinsicBigIntType; +exports.isIntrinsicBooleanType = isIntrinsicBooleanType; +exports.isIntrinsicESSymbolType = isIntrinsicESSymbolType; +exports.isIntrinsicErrorType = isIntrinsicErrorType; +exports.isIntrinsicNeverType = isIntrinsicNeverType; +exports.isIntrinsicNonPrimitiveType = isIntrinsicNonPrimitiveType; +exports.isIntrinsicNullType = isIntrinsicNullType; +exports.isIntrinsicNumberType = isIntrinsicNumberType; +exports.isIntrinsicStringType = isIntrinsicStringType; +exports.isIntrinsicType = isIntrinsicType; +exports.isIntrinsicUndefinedType = isIntrinsicUndefinedType; +exports.isIntrinsicUnknownType = isIntrinsicUnknownType; +exports.isIntrinsicVoidType = isIntrinsicVoidType; +exports.isIterationStatement = isIterationStatement; +exports.isJSDocComment = isJSDocComment; +exports.isJSDocNamespaceBody = isJSDocNamespaceBody; +exports.isJSDocNamespaceDeclaration = isJSDocNamespaceDeclaration; +exports.isJSDocText = isJSDocText; +exports.isJSDocTypeReferencingNode = isJSDocTypeReferencingNode; +exports.isJsonMinusNumericLiteral = isJsonMinusNumericLiteral; +exports.isJsonObjectExpression = isJsonObjectExpression; +exports.isJsxAttributeLike = isJsxAttributeLike; +exports.isJsxAttributeValue = isJsxAttributeValue; +exports.isJsxChild = isJsxChild; +exports.isJsxTagNameExpression = isJsxTagNameExpression; +exports.isJsxTagNamePropertyAccess = isJsxTagNamePropertyAccess; +exports.isLiteralToken = isLiteralToken; +exports.isLiteralType = isLiteralType; +exports.isModifierFlagSet = isModifierFlagSet; +exports.isModuleBody = isModuleBody; +exports.isModuleName = isModuleName; +exports.isModuleReference = isModuleReference; +exports.isNamedDeclarationWithName = isNamedDeclarationWithName; +exports.isNamedImportBindings = isNamedImportBindings; +exports.isNamedImportsOrExports = isNamedImportsOrExports; +exports.isNamespaceBody = isNamespaceBody; +exports.isNamespaceDeclaration = isNamespaceDeclaration; +exports.isNeverKeyword = isNeverKeyword; +exports.isNodeFlagSet = isNodeFlagSet; +exports.isNullKeyword = isNullKeyword; +exports.isNullLiteral = isNullLiteral; +exports.isNumberKeyword = isNumberKeyword; +exports.isNumberLiteralType = isNumberLiteralType; +exports.isNumericOrStringLikeLiteral = isNumericOrStringLikeLiteral; +exports.isNumericPropertyName = isNumericPropertyName; +exports.isObjectBindingOrAssignmentElement = isObjectBindingOrAssignmentElement; +exports.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; +exports.isObjectFlagSet = isObjectFlagSet; +exports.isObjectKeyword = isObjectKeyword; +exports.isObjectType = isObjectType; +exports.isObjectTypeDeclaration = isObjectTypeDeclaration; +exports.isOutKeyword = isOutKeyword; +exports.isOverrideKeyword = isOverrideKeyword; +exports.isParameterPropertyModifier = isParameterPropertyModifier; +exports.isPrivateKeyword = isPrivateKeyword; +exports.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; +exports.isPropertyNameLiteral = isPropertyNameLiteral; +exports.isPropertyReadonlyInType = isPropertyReadonlyInType; +exports.isProtectedKeyword = isProtectedKeyword; +exports.isPseudoLiteralToken = isPseudoLiteralToken; +exports.isPublicKeyword = isPublicKeyword; +exports.isQuestionDotToken = isQuestionDotToken; +exports.isQuestionToken = isQuestionToken; +exports.isReadonlyKeyword = isReadonlyKeyword; +exports.isSignatureDeclaration = isSignatureDeclaration; +exports.isStaticKeyword = isStaticKeyword; +exports.isStrictCompilerOptionEnabled = isStrictCompilerOptionEnabled; +exports.isStringKeyword = isStringKeyword; +exports.isStringLiteralType = isStringLiteralType; +exports.isStringMappingType = isStringMappingType; +exports.isSubstitutionType = isSubstitutionType; +exports.isSuperElementAccessExpression = isSuperElementAccessExpression; +exports.isSuperExpression = isSuperExpression; +exports.isSuperKeyword = isSuperKeyword; +exports.isSuperProperty = isSuperProperty; +exports.isSuperPropertyAccessExpression = isSuperPropertyAccessExpression; +exports.isSymbolFlagSet = isSymbolFlagSet; +exports.isSymbolKeyword = isSymbolKeyword; +exports.isSyntaxList = isSyntaxList; +exports.isTemplateLiteralType = isTemplateLiteralType; +exports.isThenableType = isThenableType; +exports.isThisExpression = isThisExpression; +exports.isThisKeyword = isThisKeyword; +exports.isTransientSymbolLinksFlagSet = isTransientSymbolLinksFlagSet; +exports.isTrueKeyword = isTrueKeyword; +exports.isTrueLiteral = isTrueLiteral; +exports.isTrueLiteralType = isTrueLiteralType; +exports.isTupleType = isTupleType; +exports.isTupleTypeReference = isTupleTypeReference; +exports.isTypeFlagSet = isTypeFlagSet; +exports.isTypeOnlyCompatibleAliasDeclaration = isTypeOnlyCompatibleAliasDeclaration; +exports.isTypeParameter = isTypeParameter; +exports.isTypeReference = isTypeReference; +exports.isTypeReferenceType = isTypeReferenceType; +exports.isTypeVariable = isTypeVariable; +exports.isUndefinedKeyword = isUndefinedKeyword; +exports.isUnionOrIntersectionType = isUnionOrIntersectionType; +exports.isUnionOrIntersectionTypeNode = isUnionOrIntersectionTypeNode; +exports.isUnionType = isUnionType; +exports.isUniqueESSymbolType = isUniqueESSymbolType; +exports.isUnknownKeyword = isUnknownKeyword; +exports.isValidPropertyAccess = isValidPropertyAccess; +exports.isVariableLikeDeclaration = isVariableLikeDeclaration; +exports.isVoidKeyword = isVoidKeyword; +exports.symbolHasReadonlyDeclaration = symbolHasReadonlyDeclaration; +exports.typeIsLiteral = typeIsLiteral; +exports.typeParts = typeParts; +exports.unionTypeParts = unionTypeParts; diff --git a/node_modules/ts-api-utils/lib/index.d.cts b/node_modules/ts-api-utils/lib/index.d.cts new file mode 100644 index 0000000..217906e --- /dev/null +++ b/node_modules/ts-api-utils/lib/index.d.cts @@ -0,0 +1,3003 @@ +import ts from 'typescript'; + +/** + * Callback type used for {@link forEachComment}. + * @category Callbacks + * @param fullText Full parsed text of the comment. + * @param comment Text range of the comment in its file. + * @example + * ```ts + * let onComment: ForEachCommentCallback = (fullText, comment) => { + * console.log(`Found comment at position ${comment.pos}: '${fullText}'.`); + * }; + * ``` + */ +type ForEachCommentCallback = (fullText: string, comment: ts.CommentRange) => void; +/** + * Iterates over all comments owned by `node` or its children. + * @category Nodes - Other Utilities + * @example + * ```ts + * declare const node: ts.Node; + * + * forEachComment(node, (fullText, comment) => { + * console.log(`Found comment at position ${comment.pos}: '${fullText}'.`); + * }); + * ``` + */ +declare function forEachComment(node: ts.Node, callback: ForEachCommentCallback, sourceFile?: ts.SourceFile): void; + +/** + * An option that can be tested with {@link isCompilerOptionEnabled}. + * @category Compiler Options + */ +type BooleanCompilerOptions = keyof { + [K in keyof ts.CompilerOptions as NonNullable extends boolean ? K : never]: unknown; +}; +/** + * An option that can be tested with {@link isStrictCompilerOptionEnabled}. + * @category Compiler Options + */ +type StrictCompilerOption = "alwaysStrict" | "noImplicitAny" | "noImplicitThis" | "strictBindCallApply" | "strictFunctionTypes" | "strictNullChecks" | "strictPropertyInitialization"; +/** + * Checks if a given compiler option is enabled. + * It handles dependencies of options, e.g. `declaration` is implicitly enabled by `composite` or `strictNullChecks` is enabled by `strict`. + * However, it does not check dependencies that are already checked and reported as errors, e.g. `checkJs` without `allowJs`. + * This function only handles boolean flags. + * @category Compiler Options + * @example + * ```ts + * const options = { + * allowJs: true, + * }; + * + * isCompilerOptionEnabled(options, "allowJs"); // true + * isCompilerOptionEnabled(options, "allowSyntheticDefaultImports"); // false + * ``` + */ +declare function isCompilerOptionEnabled(options: ts.CompilerOptions, option: BooleanCompilerOptions): boolean; +/** + * Checks if a given compiler option is enabled, accounting for whether all flags + * (except `strictPropertyInitialization`) have been enabled by `strict: true`. + * @category Compiler Options + * @example + * ```ts + * const optionsLenient = { + * noImplicitAny: true, + * }; + * + * isStrictCompilerOptionEnabled(optionsLenient, "noImplicitAny"); // true + * isStrictCompilerOptionEnabled(optionsLenient, "noImplicitThis"); // false + * ``` + * @example + * ```ts + * const optionsStrict = { + * noImplicitThis: false, + * strict: true, + * }; + * + * isStrictCompilerOptionEnabled(optionsStrict, "noImplicitAny"); // true + * isStrictCompilerOptionEnabled(optionsStrict, "noImplicitThis"); // false + * ``` + */ +declare function isStrictCompilerOptionEnabled(options: ts.CompilerOptions, option: StrictCompilerOption): boolean; + +/** + * Test if the given node has the given `ModifierFlags` set. + * @category Nodes - Flag Utilities + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isModifierFlagSet(node, ts.ModifierFlags.Abstract)) { + * // ... + * } + * ``` + */ +declare function isModifierFlagSet(node: ts.Declaration, flag: ts.ModifierFlags): boolean; +/** + * Test if the given node has the given `NodeFlags` set. + * @category Nodes - Flag Utilities + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNodeFlagSet(node, ts.NodeFlags.AwaitContext)) { + * // ... + * } + * ``` + */ +declare const isNodeFlagSet: (node: ts.Node, flag: ts.NodeFlags) => boolean; +/** + * Test if the given node has the given `ObjectFlags` set. + * @category Nodes - Flag Utilities + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isObjectFlagSet(node, ts.ObjectFlags.Anonymous)) { + * // ... + * } + * ``` + */ +declare function isObjectFlagSet(objectType: ts.ObjectType, flag: ts.ObjectFlags): boolean; +/** + * Test if the given node has the given `SymbolFlags` set. + * @category Nodes - Flag Utilities + * @example + * ```ts + * declare const symbol: ts.Symbol; + * + * if (isSymbolFlagSet(symbol, ts.SymbolFlags.Accessor)) { + * // ... + * } + * ``` + */ +declare const isSymbolFlagSet: (symbol: ts.Symbol, flag: ts.SymbolFlags) => boolean; +/** + * Test if the given symbol's links has the given `CheckFlags` set. + * @internal + */ +declare function isTransientSymbolLinksFlagSet(links: ts.TransientSymbolLinks, flag: ts.CheckFlags): boolean; +/** + * Test if the given node has the given `TypeFlags` set. + * @category Nodes - Flag Utilities + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isTypeFlagSet(type, ts.TypeFlags.Any)) { + * // ... + * } + * ``` + */ +declare const isTypeFlagSet: (type: ts.Type, flag: ts.TypeFlags) => boolean; + +/** + * Test if the given iterable includes a modifier of any of the given kinds. + * @category Modifier Utilities + * @example + * ```ts + * declare const modifiers: ts.Modifier[]; + * + * includesModifier(modifiers, ts.SyntaxKind.AbstractKeyword); + * ``` + */ +declare function includesModifier(modifiers: Iterable | undefined, ...kinds: ts.ModifierSyntaxKind[]): boolean; + +/** + * What operations(s), if any, an expression applies. + */ +declare enum AccessKind { + None = 0, + Read = 1, + Write = 2, + Delete = 4, + ReadWrite = 3 +} +/** + * Determines which operation(s), if any, an expression applies. + * @example + * ```ts + * declare const node: ts.Expression; + * + * if (getAccessKind(node).Write & AccessKind.Write) !== 0) { + * // this is a reassignment (write) + * } + * ``` + */ +declare function getAccessKind(node: ts.Expression): AccessKind; + +/** + * An `AssertionExpression` that is declared as const. + * @category Node Types + */ +type ConstAssertionExpression = ts.AssertionExpression & { + type: ts.TypeReferenceNode; + typeName: ConstAssertionIdentifier; +}; +/** + * An `Identifier` with an `escapedText` value of `"const"`. + * @category Node Types + */ +type ConstAssertionIdentifier = ts.Identifier & { + escapedText: "const" & ts.__String; +}; +/** + * a `NamedDeclaration` that definitely has a name. + * @category Node Types + */ +interface NamedDeclarationWithName extends ts.NamedDeclaration { + name: ts.DeclarationName; +} +/** + * A number or string-like literal. + * @category Node Types + */ +type NumericOrStringLikeLiteral = ts.NumericLiteral | ts.StringLiteralLike; +/** + * Test if a node is a {@link ConstAssertionExpression}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isConstAssertionExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link ConstAssertionExpression}. + */ +declare function isConstAssertionExpression(node: ts.AssertionExpression): node is ConstAssertionExpression; +/** + * Test if a node is an `IterationStatement`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isIterationStatement(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `IterationStatement`. + */ +declare function isIterationStatement(node: ts.Node): node is ts.IterationStatement; +/** + * Test if a node is a `JSDocNamespaceDeclaration`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJSDocNamespaceDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JSDocNamespaceDeclaration`. + */ +declare function isJSDocNamespaceDeclaration(node: ts.Node): node is ts.JSDocNamespaceDeclaration; +/** + * Test if a node is a `JsxTagNamePropertyAccess`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJsxTagNamePropertyAccess(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JsxTagNamePropertyAccess`. + */ +declare function isJsxTagNamePropertyAccess(node: ts.Node): node is ts.JsxTagNamePropertyAccess; +/** + * Test if a node is a {@link NamedDeclarationWithName}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNamedDeclarationWithName(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link NamedDeclarationWithName}. + */ +declare function isNamedDeclarationWithName(node: ts.Declaration): node is NamedDeclarationWithName; +/** + * Test if a node is a `NamespaceDeclaration`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNamespaceDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `NamespaceDeclaration`. + */ +declare function isNamespaceDeclaration(node: ts.Node): node is ts.NamespaceDeclaration; +/** + * Test if a node is a {@link NumericOrStringLikeLiteral}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNumericOrStringLikeLiteral(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link NumericOrStringLikeLiteral}. + */ +declare function isNumericOrStringLikeLiteral(node: ts.Node): node is NumericOrStringLikeLiteral; +/** + * Test if a node is a `PropertyAccessEntityNameExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isPropertyAccessEntityNameExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `PropertyAccessEntityNameExpression`. + */ +declare function isPropertyAccessEntityNameExpression(node: ts.Node): node is ts.PropertyAccessEntityNameExpression; +/** + * Test if a node is a `SuperElementAccessExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isSuperElementAccessExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `SuperElementAccessExpression`. + */ +declare function isSuperElementAccessExpression(node: ts.Node): node is ts.SuperElementAccessExpression; +/** + * Test if a node is a `SuperPropertyAccessExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isSuperPropertyAccessExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `SuperPropertyAccessExpression`. + */ +declare function isSuperPropertyAccessExpression(node: ts.Node): node is ts.SuperPropertyAccessExpression; + +/** + * A node that represents the any keyword. + * @category Node Types + */ +type AnyKeyword = ts.KeywordToken; +/** + * A node that represents the bigint keyword. + * @category Node Types + */ +type BigIntKeyword = ts.KeywordToken; +/** + * A node that represents the boolean keyword. + * @category Node Types + */ +type BooleanKeyword = ts.KeywordToken; +/** + * A node that represents the false keyword. + * @category Node Types + */ +type FalseKeyword = ts.KeywordToken; +/** + * A node that represents the import keyword. + * @category Node Types + */ +type ImportKeyword = ts.KeywordToken; +/** + * A node that represents the never keyword. + * @category Node Types + */ +type NeverKeyword = ts.KeywordToken; +/** + * A node that represents the null keyword. + * @category Node Types + */ +type NullKeyword = ts.KeywordToken; +/** + * A node that represents the number keyword. + * @category Node Types + */ +type NumberKeyword = ts.KeywordToken; +/** + * A node that represents the object keyword. + * @category Node Types + */ +type ObjectKeyword = ts.KeywordToken; +/** + * A node that represents the string keyword. + * @category Node Types + */ +type StringKeyword = ts.KeywordToken; +/** + * A node that represents the super keyword. + * @category Node Types + */ +type SuperKeyword = ts.KeywordToken; +/** + * A node that represents the symbol keyword. + * @category Node Types + */ +type SymbolKeyword = ts.KeywordToken; +/** + * A node that represents the this keyword. + * @category Node Types + */ +type ThisKeyword = ts.KeywordToken; +/** + * A node that represents the true keyword. + * @category Node Types + */ +type TrueKeyword = ts.KeywordToken; +/** + * A node that represents the undefined keyword. + * @category Node Types + */ +type UndefinedKeyword = ts.KeywordToken; +/** + * A node that represents the unknown keyword. + * @category Node Types + */ +type UnknownKeyword = ts.KeywordToken; +/** + * A node that represents the void keyword. + * @category Node Types + */ +type VoidKeyword = ts.KeywordToken; +/** + * Test if a node is an `AbstractKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAbstractKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AbstractKeyword`. + */ +declare function isAbstractKeyword(node: ts.Node): node is ts.AbstractKeyword; +/** + * Test if a node is an `AccessorKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAccessorKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AccessorKeyword`. + */ +declare function isAccessorKeyword(node: ts.Node): node is ts.AccessorKeyword; +/** + * Test if a node is an {@link AnyKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAnyKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an {@link AnyKeyword}. + */ +declare function isAnyKeyword(node: ts.Node): node is AnyKeyword; +/** + * Test if a node is an `AssertKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAssertKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AssertKeyword`. + */ +declare function isAssertKeyword(node: ts.Node): node is ts.AssertKeyword; +/** + * Test if a node is an `AssertsKeyword`. + * @deprecated With TypeScript v5, in favor of typescript's `isAssertsKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAssertsKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AssertsKeyword`. + */ +declare function isAssertsKeyword(node: ts.Node): node is ts.AssertsKeyword; +/** + * Test if a node is an `AsyncKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAsyncKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AsyncKeyword`. + */ +declare function isAsyncKeyword(node: ts.Node): node is ts.AsyncKeyword; +/** + * Test if a node is an `AwaitKeyword`. + * @deprecated With TypeScript v5, in favor of typescript's `isAwaitKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAwaitKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AwaitKeyword`. + */ +declare function isAwaitKeyword(node: ts.Node): node is ts.AwaitKeyword; +/** + * Test if a node is a {@link BigIntKeyword}. + * @deprecated With TypeScript v5, in favor of typescript's `isBigIntKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isBigIntKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link BigIntKeyword}. + */ +declare function isBigIntKeyword(node: ts.Node): node is BigIntKeyword; +/** + * Test if a node is a {@link BooleanKeyword}. + * @deprecated With TypeScript v5, in favor of typescript's `isBooleanKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isBooleanKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link BooleanKeyword}. + */ +declare function isBooleanKeyword(node: ts.Node): node is BooleanKeyword; +/** + * Test if a node is a `ColonToken`. + * @deprecated With TypeScript v5, in favor of typescript's `isColonToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isColonToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ColonToken`. + */ +declare function isColonToken(node: ts.Node): node is ts.ColonToken; +/** + * Test if a node is a `ConstKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isConstKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ConstKeyword`. + */ +declare function isConstKeyword(node: ts.Node): node is ts.ConstKeyword; +/** + * Test if a node is a `DeclareKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isDeclareKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `DeclareKeyword`. + */ +declare function isDeclareKeyword(node: ts.Node): node is ts.DeclareKeyword; +/** + * Test if a node is a `DefaultKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isDefaultKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `DefaultKeyword`. + */ +declare function isDefaultKeyword(node: ts.Node): node is ts.DefaultKeyword; +/** + * Test if a node is a `DotToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isDotToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `DotToken`. + */ +declare function isDotToken(node: ts.Node): node is ts.DotToken; +/** + * Test if a node is an `EndOfFileToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isEndOfFileToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `EndOfFileToken`. + */ +declare function isEndOfFileToken(node: ts.Node): node is ts.EndOfFileToken; +/** + * Test if a node is an `EqualsGreaterThanToken`. + * @deprecated With TypeScript v5, in favor of typescript's `isEqualsGreaterThanToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isEqualsGreaterThanToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `EqualsGreaterThanToken`. + */ +declare function isEqualsGreaterThanToken(node: ts.Node): node is ts.EqualsGreaterThanToken; +/** + * Test if a node is an `EqualsToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isEqualsToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `EqualsToken`. + */ +declare function isEqualsToken(node: ts.Node): node is ts.EqualsToken; +/** + * Test if a node is an `ExclamationToken`. + * @deprecated With TypeScript v5, in favor of typescript's `isExclamationToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isExclamationToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `ExclamationToken`. + */ +declare function isExclamationToken(node: ts.Node): node is ts.ExclamationToken; +/** + * Test if a node is an `ExportKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isExportKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `ExportKeyword`. + */ +declare function isExportKeyword(node: ts.Node): node is ts.ExportKeyword; +/** + * Test if a node is a {@link FalseKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isFalseKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link FalseKeyword}. + */ +declare function isFalseKeyword(node: ts.Node): node is FalseKeyword; +/** + * Test if a node is a `FalseLiteral`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isFalseLiteral(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `FalseLiteral`. + */ +declare function isFalseLiteral(node: ts.Node): node is ts.FalseLiteral; +/** + * Test if a node is an `ImportExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isImportExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `ImportExpression`. + */ +declare function isImportExpression(node: ts.Node): node is ts.ImportExpression; +/** + * Test if a node is an {@link ImportKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isImportKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an {@link ImportKeyword}. + */ +declare function isImportKeyword(node: ts.Node): node is ImportKeyword; +/** + * Test if a node is an `InKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isInKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `InKeyword`. + */ +declare function isInKeyword(node: ts.Node): node is ts.InKeyword; +/** + * Test if a node is a `JSDocText`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJSDocText(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JSDocText`. + */ +declare function isJSDocText(node: ts.Node): node is ts.JSDocText; +/** + * Test if a node is a `JsonMinusNumericLiteral`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJsonMinusNumericLiteral(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JsonMinusNumericLiteral`. + */ +declare function isJsonMinusNumericLiteral(node: ts.Node): node is ts.JsonMinusNumericLiteral; +/** + * Test if a node is a {@link NeverKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNeverKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link NeverKeyword}. + */ +declare function isNeverKeyword(node: ts.Node): node is NeverKeyword; +/** + * Test if a node is a {@link NullKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNullKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link NullKeyword}. + */ +declare function isNullKeyword(node: ts.Node): node is NullKeyword; +/** + * Test if a node is a `NullLiteral`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNullLiteral(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `NullLiteral`. + */ +declare function isNullLiteral(node: ts.Node): node is ts.NullLiteral; +/** + * Test if a node is a {@link NumberKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNumberKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link NumberKeyword}. + */ +declare function isNumberKeyword(node: ts.Node): node is NumberKeyword; +/** + * Test if a node is an {@link ObjectKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isObjectKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an {@link ObjectKeyword}. + */ +declare function isObjectKeyword(node: ts.Node): node is ObjectKeyword; +/** + * Test if a node is an `OutKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isOutKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `OutKeyword`. + */ +declare function isOutKeyword(node: ts.Node): node is ts.OutKeyword; +/** + * Test if a node is an `OverrideKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isOverrideKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `OverrideKeyword`. + */ +declare function isOverrideKeyword(node: ts.Node): node is ts.OverrideKeyword; +/** + * Test if a node is a `PrivateKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isPrivateKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `PrivateKeyword`. + */ +declare function isPrivateKeyword(node: ts.Node): node is ts.PrivateKeyword; +/** + * Test if a node is a `ProtectedKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isProtectedKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ProtectedKeyword`. + */ +declare function isProtectedKeyword(node: ts.Node): node is ts.ProtectedKeyword; +/** + * Test if a node is a `PublicKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isPublicKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `PublicKeyword`. + */ +declare function isPublicKeyword(node: ts.Node): node is ts.PublicKeyword; +/** + * Test if a node is a `QuestionDotToken`. + * @deprecated With TypeScript v5, in favor of typescript's `isQuestionDotToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isQuestionDotToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `QuestionDotToken`. + */ +declare function isQuestionDotToken(node: ts.Node): node is ts.QuestionDotToken; +/** + * Test if a node is a `QuestionToken`. + * @deprecated With TypeScript v5, in favor of typescript's `isQuestionToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isQuestionToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `QuestionToken`. + */ +declare function isQuestionToken(node: ts.Node): node is ts.QuestionToken; +/** + * Test if a node is a `ReadonlyKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isReadonlyKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ReadonlyKeyword`. + */ +declare function isReadonlyKeyword(node: ts.Node): node is ts.ReadonlyKeyword; +/** + * Test if a node is a `StaticKeyword`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isStaticKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `StaticKeyword`. + */ +declare function isStaticKeyword(node: ts.Node): node is ts.StaticKeyword; +/** + * Test if a node is a {@link StringKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isStringKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link StringKeyword}. + */ +declare function isStringKeyword(node: ts.Node): node is StringKeyword; +/** + * Test if a node is a `SuperExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isSuperExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `SuperExpression`. + */ +declare function isSuperExpression(node: ts.Node): node is ts.SuperExpression; +/** + * Test if a node is a {@link SuperKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isSuperKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link SuperKeyword}. + */ +declare function isSuperKeyword(node: ts.Node): node is SuperKeyword; +/** + * Test if a node is a {@link SymbolKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isSymbolKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link SymbolKeyword}. + */ +declare function isSymbolKeyword(node: ts.Node): node is SymbolKeyword; +/** + * Test if a node is a `SyntaxList`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isSyntaxList(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `SyntaxList`. + */ +declare function isSyntaxList(node: ts.Node): node is ts.SyntaxList; +/** + * Test if a node is a `ThisExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isThisExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ThisExpression`. + */ +declare function isThisExpression(node: ts.Node): node is ts.ThisExpression; +/** + * Test if a node is a {@link ThisKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isThisKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link ThisKeyword}. + */ +declare function isThisKeyword(node: ts.Node): node is ThisKeyword; +/** + * Test if a node is a {@link TrueKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isTrueKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link TrueKeyword}. + */ +declare function isTrueKeyword(node: ts.Node): node is TrueKeyword; +/** + * Test if a node is a `TrueLiteral`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isTrueLiteral(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `TrueLiteral`. + */ +declare function isTrueLiteral(node: ts.Node): node is ts.TrueLiteral; +/** + * Test if a node is an {@link UndefinedKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isUndefinedKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an {@link UndefinedKeyword}. + */ +declare function isUndefinedKeyword(node: ts.Node): node is UndefinedKeyword; +/** + * Test if a node is an {@link UnknownKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isUnknownKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an {@link UnknownKeyword}. + */ +declare function isUnknownKeyword(node: ts.Node): node is UnknownKeyword; +/** + * Test if a node is a {@link VoidKeyword}. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isVoidKeyword(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a {@link VoidKeyword}. + */ +declare function isVoidKeyword(node: ts.Node): node is VoidKeyword; + +/** + * Test if a node is a `HasDecorators`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (hasDecorators(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `HasDecorators`. + */ +declare function hasDecorators(node: ts.Node): node is ts.HasDecorators; +/** + * Test if a node is a `HasExpressionInitializer`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (hasExpressionInitializer(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `HasExpressionInitializer`. + */ +declare function hasExpressionInitializer(node: ts.Node): node is ts.HasExpressionInitializer; +/** + * Test if a node is a `HasInitializer`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (hasInitializer(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `HasInitializer`. + */ +declare function hasInitializer(node: ts.Node): node is ts.HasInitializer; +/** + * Test if a node is a `HasJSDoc`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (hasJSDoc(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `HasJSDoc`. + */ +declare function hasJSDoc(node: ts.Node): node is ts.HasJSDoc; +/** + * Test if a node is a `HasModifiers`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (hasModifiers(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `HasModifiers`. + */ +declare function hasModifiers(node: ts.Node): node is ts.HasModifiers; +/** + * Test if a node is a `HasType`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (hasType(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `HasType`. + */ +declare function hasType(node: ts.Node): node is ts.HasType; +/** + * Test if a node is a `HasTypeArguments`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (hasTypeArguments(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `HasTypeArguments`. + */ +declare function hasTypeArguments(node: ts.Node): node is ts.HasTypeArguments; +/** + * Test if a node is an `AccessExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAccessExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AccessExpression`. + */ +declare function isAccessExpression(node: ts.Node): node is ts.AccessExpression; +/** + * Test if a node is an `AccessibilityModifier`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAccessibilityModifier(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AccessibilityModifier`. + */ +declare function isAccessibilityModifier(node: ts.Node): node is ts.AccessibilityModifier; +/** + * Test if a node is an `AccessorDeclaration`. + * @deprecated With TypeScript v5, in favor of typescript's `isAccessor`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAccessorDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AccessorDeclaration`. + */ +declare function isAccessorDeclaration(node: ts.Node): node is ts.AccessorDeclaration; +/** + * Test if a node is an `ArrayBindingElement`. + * @deprecated With TypeScript v5, in favor of typescript's `isArrayBindingElement`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isArrayBindingElement(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `ArrayBindingElement`. + */ +declare function isArrayBindingElement(node: ts.Node): node is ts.ArrayBindingElement; +/** + * Test if a node is an `ArrayBindingOrAssignmentPattern`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isArrayBindingOrAssignmentPattern(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `ArrayBindingOrAssignmentPattern`. + */ +declare function isArrayBindingOrAssignmentPattern(node: ts.Node): node is ts.ArrayBindingOrAssignmentPattern; +/** + * Test if a node is an `AssignmentPattern`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isAssignmentPattern(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `AssignmentPattern`. + */ +declare function isAssignmentPattern(node: ts.Node): node is ts.AssignmentPattern; +/** + * Test if a node is a `BindingOrAssignmentElementRestIndicator`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isBindingOrAssignmentElementRestIndicator(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `BindingOrAssignmentElementRestIndicator`. + */ +declare function isBindingOrAssignmentElementRestIndicator(node: ts.Node): node is ts.BindingOrAssignmentElementRestIndicator; +/** + * Test if a node is a `BindingOrAssignmentElementTarget`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isBindingOrAssignmentElementTarget(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `BindingOrAssignmentElementTarget`. + */ +declare function isBindingOrAssignmentElementTarget(node: ts.Node): node is ts.BindingOrAssignmentElementTarget; +/** + * Test if a node is a `BindingOrAssignmentPattern`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isBindingOrAssignmentPattern(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `BindingOrAssignmentPattern`. + */ +declare function isBindingOrAssignmentPattern(node: ts.Node): node is ts.BindingOrAssignmentPattern; +/** + * Test if a node is a `BindingPattern`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isBindingPattern(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `BindingPattern`. + */ +declare function isBindingPattern(node: ts.Node): node is ts.BindingPattern; +/** + * Test if a node is a `BlockLike`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isBlockLike(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `BlockLike`. + */ +declare function isBlockLike(node: ts.Node): node is ts.BlockLike; +/** + * Test if a node is a `BooleanLiteral`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isBooleanLiteral(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `BooleanLiteral`. + */ +declare function isBooleanLiteral(node: ts.Node): node is ts.BooleanLiteral; +/** + * Test if a node is a `ClassLikeDeclaration`. + * @deprecated With TypeScript v5, in favor of typescript's `isClassLike`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isClassLikeDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ClassLikeDeclaration`. + */ +declare function isClassLikeDeclaration(node: ts.Node): node is ts.ClassLikeDeclaration; +/** + * Test if a node is a `ClassMemberModifier`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isClassMemberModifier(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ClassMemberModifier`. + */ +declare function isClassMemberModifier(node: ts.Node): node is ts.ClassMemberModifier; +/** + * Test if a node is a `DeclarationName`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isDeclarationName(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `DeclarationName`. + */ +declare function isDeclarationName(node: ts.Node): node is ts.DeclarationName; +/** + * Test if a node is a `DeclarationWithTypeParameterChildren`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isDeclarationWithTypeParameterChildren(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `DeclarationWithTypeParameterChildren`. + */ +declare function isDeclarationWithTypeParameterChildren(node: ts.Node): node is ts.DeclarationWithTypeParameterChildren; +/** + * Test if a node is a `DeclarationWithTypeParameters`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isDeclarationWithTypeParameters(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `DeclarationWithTypeParameters`. + */ +declare function isDeclarationWithTypeParameters(node: ts.Node): node is ts.DeclarationWithTypeParameters; +/** + * Test if a node is a `DestructuringPattern`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isDestructuringPattern(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `DestructuringPattern`. + */ +declare function isDestructuringPattern(node: ts.Node): node is ts.DestructuringPattern; +/** + * Test if a node is an `EntityNameExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isEntityNameExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `EntityNameExpression`. + */ +declare function isEntityNameExpression(node: ts.Node): node is ts.EntityNameExpression; +/** + * Test if a node is an `EntityNameOrEntityNameExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isEntityNameOrEntityNameExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `EntityNameOrEntityNameExpression`. + */ +declare function isEntityNameOrEntityNameExpression(node: ts.Node): node is ts.EntityNameOrEntityNameExpression; +/** + * Test if a node is a `ForInOrOfStatement`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isForInOrOfStatement(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ForInOrOfStatement`. + */ +declare function isForInOrOfStatement(node: ts.Node): node is ts.ForInOrOfStatement; +/** + * Test if a node is a `FunctionLikeDeclaration`. + * @deprecated With TypeScript v5, in favor of typescript's `isFunctionLike`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isFunctionLikeDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `FunctionLikeDeclaration`. + */ +declare function isFunctionLikeDeclaration(node: ts.Node): node is ts.FunctionLikeDeclaration; +/** + * Test if a node is a `JSDocComment`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJSDocComment(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JSDocComment`. + */ +declare function isJSDocComment(node: ts.Node): node is ts.JSDocComment; +/** + * Test if a node is a `JSDocNamespaceBody`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJSDocNamespaceBody(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JSDocNamespaceBody`. + */ +declare function isJSDocNamespaceBody(node: ts.Node): node is ts.JSDocNamespaceBody; +/** + * Test if a node is a `JSDocTypeReferencingNode`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJSDocTypeReferencingNode(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JSDocTypeReferencingNode`. + */ +declare function isJSDocTypeReferencingNode(node: ts.Node): node is ts.JSDocTypeReferencingNode; +/** + * Test if a node is a `JsonObjectExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJsonObjectExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JsonObjectExpression`. + */ +declare function isJsonObjectExpression(node: ts.Node): node is ts.JsonObjectExpression; +/** + * Test if a node is a `JsxAttributeLike`. + * @deprecated With TypeScript v5, in favor of typescript's `isJsxAttributeLike`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJsxAttributeLike(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JsxAttributeLike`. + */ +declare function isJsxAttributeLike(node: ts.Node): node is ts.JsxAttributeLike; +/** + * Test if a node is a `JsxAttributeValue`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJsxAttributeValue(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JsxAttributeValue`. + */ +declare function isJsxAttributeValue(node: ts.Node): node is ts.JsxAttributeValue; +/** + * Test if a node is a `JsxChild`. + * @deprecated With TypeScript v5, in favor of typescript's `isJsxChild`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJsxChild(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JsxChild`. + */ +declare function isJsxChild(node: ts.Node): node is ts.JsxChild; +/** + * Test if a node is a `JsxTagNameExpression`. + * @deprecated With TypeScript v5, in favor of typescript's `isJsxTagNameExpression`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isJsxTagNameExpression(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `JsxTagNameExpression`. + */ +declare function isJsxTagNameExpression(node: ts.Node): node is ts.JsxTagNameExpression; +/** + * Test if a node is a `LiteralToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isLiteralToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `LiteralToken`. + */ +declare function isLiteralToken(node: ts.Node): node is ts.LiteralToken; +/** + * Test if a node is a `ModuleBody`. + * @deprecated With TypeScript v5, in favor of typescript's `isModuleBody`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isModuleBody(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ModuleBody`. + */ +declare function isModuleBody(node: ts.Node): node is ts.ModuleBody; +/** + * Test if a node is a `ModuleName`. + * @deprecated With TypeScript v5, in favor of typescript's `isModuleName`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isModuleName(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ModuleName`. + */ +declare function isModuleName(node: ts.Node): node is ts.ModuleName; +/** + * Test if a node is a `ModuleReference`. + * @deprecated With TypeScript v5, in favor of typescript's `isModuleReference`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isModuleReference(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ModuleReference`. + */ +declare function isModuleReference(node: ts.Node): node is ts.ModuleReference; +/** + * Test if a node is a `NamedImportBindings`. + * @deprecated With TypeScript v5, in favor of typescript's `isNamedImportBindings`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNamedImportBindings(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `NamedImportBindings`. + */ +declare function isNamedImportBindings(node: ts.Node): node is ts.NamedImportBindings; +/** + * Test if a node is a `NamedImportsOrExports`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNamedImportsOrExports(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `NamedImportsOrExports`. + */ +declare function isNamedImportsOrExports(node: ts.Node): node is ts.NamedImportsOrExports; +/** + * Test if a node is a `NamespaceBody`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isNamespaceBody(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `NamespaceBody`. + */ +declare function isNamespaceBody(node: ts.Node): node is ts.NamespaceBody; +/** + * Test if a node is an `ObjectBindingOrAssignmentElement`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isObjectBindingOrAssignmentElement(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `ObjectBindingOrAssignmentElement`. + */ +declare function isObjectBindingOrAssignmentElement(node: ts.Node): node is ts.ObjectBindingOrAssignmentElement; +/** + * Test if a node is an `ObjectBindingOrAssignmentPattern`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isObjectBindingOrAssignmentPattern(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `ObjectBindingOrAssignmentPattern`. + */ +declare function isObjectBindingOrAssignmentPattern(node: ts.Node): node is ts.ObjectBindingOrAssignmentPattern; +/** + * Test if a node is an `ObjectTypeDeclaration`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isObjectTypeDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `ObjectTypeDeclaration`. + */ +declare function isObjectTypeDeclaration(node: ts.Node): node is ts.ObjectTypeDeclaration; +/** + * Test if a node is a `ParameterPropertyModifier`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isParameterPropertyModifier(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `ParameterPropertyModifier`. + */ +declare function isParameterPropertyModifier(node: ts.Node): node is ts.ParameterPropertyModifier; +/** + * Test if a node is a `PropertyNameLiteral`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isPropertyNameLiteral(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `PropertyNameLiteral`. + */ +declare function isPropertyNameLiteral(node: ts.Node): node is ts.PropertyNameLiteral; +/** + * Test if a node is a `PseudoLiteralToken`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isPseudoLiteralToken(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `PseudoLiteralToken`. + */ +declare function isPseudoLiteralToken(node: ts.Node): node is ts.PseudoLiteralToken; +/** + * Test if a node is a `SignatureDeclaration`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isSignatureDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `SignatureDeclaration`. + */ +declare function isSignatureDeclaration(node: ts.Node): node is ts.SignatureDeclaration; +/** + * Test if a node is a `SuperProperty`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isSuperProperty(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `SuperProperty`. + */ +declare function isSuperProperty(node: ts.Node): node is ts.SuperProperty; +/** + * Test if a node is a `TypeOnlyCompatibleAliasDeclaration`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isTypeOnlyCompatibleAliasDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `TypeOnlyCompatibleAliasDeclaration`. + */ +declare function isTypeOnlyCompatibleAliasDeclaration(node: ts.Node): node is ts.TypeOnlyCompatibleAliasDeclaration; +/** + * Test if a node is a `TypeReferenceType`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isTypeReferenceType(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `TypeReferenceType`. + */ +declare function isTypeReferenceType(node: ts.Node): node is ts.TypeReferenceType; +/** + * Test if a node is an `UnionOrIntersectionTypeNode`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isUnionOrIntersectionTypeNode(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be an `UnionOrIntersectionTypeNode`. + */ +declare function isUnionOrIntersectionTypeNode(node: ts.Node): node is ts.UnionOrIntersectionTypeNode; +/** + * Test if a node is a `VariableLikeDeclaration`. + * @category Nodes - Type Guards + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isVariableLikeDeclaration(node)) { + * // ... + * } + * ``` + * @returns Whether the given node appears to be a `VariableLikeDeclaration`. + */ +declare function isVariableLikeDeclaration(node: ts.Node): node is ts.VariableLikeDeclaration; + +/** + * Is the node a scope boundary, specifically due to it being a function. + * @category Scope Utilities + * @example + * ```ts + * declare const node: ts.Node; + * + * if (isFunctionScopeBoundary(node, ts.ObjectFlags.Anonymous)) { + * // ... + * } + * ``` + */ +declare function isFunctionScopeBoundary(node: ts.Node): boolean; + +/** + * Test of the kind given is for assignment. + * @category Syntax Utilities + * @example + * ```ts + * declare const kind: ts.SyntaxKind; + * + * isAssignmentKind(kind); + * ``` + */ +declare function isAssignmentKind(kind: ts.SyntaxKind): boolean; +/** + * Test if a string is numeric. + * @category Syntax Utilities + * @example + * ```ts + * isNumericPropertyName("abc"); // false + * isNumericPropertyName("123"); // true + * ``` + */ +declare function isNumericPropertyName(name: string | ts.__String): boolean; +/** + * Determines whether the given text can be used to access a property with a `PropertyAccessExpression` while preserving the property's name. + * @category Syntax Utilities + * @example + * ```ts + * isValidPropertyAccess("abc"); // true + * isValidPropertyAccess("123"); // false + * ``` + */ +declare function isValidPropertyAccess(text: string, languageVersion?: ts.ScriptTarget): boolean; + +/** + * Callback type used for {@link forEachToken}. + * @category Callbacks + * @example + * ```ts + * let onToken: ForEachTokenCallback = (token) => { + * console.log(`Found token at position: ${token.pos}.`); + * }; + * ``` + */ +type ForEachTokenCallback = (token: ts.Node) => void; +/** + * Iterates over all tokens of `node` + * @category Nodes - Other Utilities + * @example + * ```ts + * declare const node: ts.Node; + * + * forEachToken(node, (token) => { + * console.log("Found token:", token.getText()); + * }); + * ``` + * @param node The node whose tokens should be visited + * @param callback Is called for every token contained in `node` + */ +declare function forEachToken(node: ts.Node, callback: ForEachTokenCallback, sourceFile?: ts.SourceFile): void; + +/** + * Get the `CallSignatures` of the given type. + * @category Types - Getters + * @example + * ```ts + * declare const type: ts.Type; + * + * getCallSignaturesOfType(type); + * ``` + */ +declare function getCallSignaturesOfType(type: ts.Type): readonly ts.Signature[]; +/** + * Get the property with the given name on the given type (if it exists). + * @category Types - Getters + * @example + * ```ts + * declare const property: ts.Symbol; + * declare const type: ts.Type; + * + * getPropertyOfType(type, property.getEscapedName()); + * ``` + */ +declare function getPropertyOfType(type: ts.Type, name: ts.__String): ts.Symbol | undefined; +/** + * Retrieves a type symbol corresponding to a well-known string name. + * @category Types - Getters + * @example + * ```ts + * declare const type: ts.Type; + * declare const typeChecker: ts.TypeChecker; + * + * getWellKnownSymbolPropertyOfType(type, "asyncIterator", typeChecker); + * ``` + */ +declare function getWellKnownSymbolPropertyOfType(type: ts.Type, wellKnownSymbolName: string, typeChecker: ts.TypeChecker): ts.Symbol | undefined; + +/** + * A "any" intrinsic type. + * @category Type Types + */ +interface IntrinsicAnyType extends IntrinsicType { + intrinsicName: "any"; +} +/** + * A "bigint" intrinsic type. + * @category Type Types + */ +interface IntrinsicBigIntType extends IntrinsicType { + intrinsicName: "bigint"; +} +/** + * A "boolean" intrinsic type. + * @category Type Types + */ +interface IntrinsicBooleanType extends IntrinsicType { + intrinsicName: "boolean"; +} +/** + * An "error" intrinsic type. + * + * This refers to a type generated when TypeScript encounters an error while + * trying to resolve the type. + * @category Type Types + */ +interface IntrinsicErrorType extends IntrinsicType { + intrinsicName: "error"; +} +/** + * A "symbol" intrinsic type. + * @category Type Types + */ +interface IntrinsicESSymbolType extends IntrinsicType { + intrinsicName: "symbol"; +} +/** + * An "intrinsic" (built-in to TypeScript) type. + * @category Type Types + */ +interface IntrinsicType extends ts.Type { + intrinsicName: string; + objectFlags: ts.ObjectFlags; +} +/** + * Determines whether the given type is the "any" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicAnyType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicAnyType(type: ts.Type): type is IntrinsicAnyType; +/** + * Determines whether the given type is the "bigint" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicBigIntType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicBigIntType(type: ts.Type): type is IntrinsicBigIntType; +/** + * Determines whether the given type is the "boolean" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicBooleanType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicBooleanType(type: ts.Type): type is IntrinsicBooleanType; +/** + * Determines whether the given type is the "error" intrinsic type. + * + * The intrinsic error type occurs when TypeScript encounters an error while + * trying to resolve the type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicErrorType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicErrorType(type: ts.Type): type is IntrinsicErrorType; +/** + * Determines whether the given type is the "symbol" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicESSymbolType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicESSymbolType(type: ts.Type): type is IntrinsicESSymbolType; +/** + * A "never" intrinsic type. + * @category Type Types + */ +interface IntrinsicNeverType extends IntrinsicType { + intrinsicName: "never"; +} +/** + * A non-primitive intrinsic type. + * E.g. An "object" intrinsic type. + * @category Type Types + */ +interface IntrinsicNonPrimitiveType extends IntrinsicType { + intrinsicName: ""; +} +/** + * A "null" intrinsic type. + * @category Type Types + */ +interface IntrinsicNullType extends IntrinsicType { + intrinsicName: "null"; +} +/** + * A "number" intrinsic type. + * @category Type Types + */ +interface IntrinsicNumberType extends IntrinsicType { + intrinsicName: "number"; +} +/** + * A "string" intrinsic type. + * @category Type Types + */ +interface IntrinsicStringType extends IntrinsicType { + intrinsicName: "string"; +} +/** + * The built-in `undefined` type. + * @category Type Types + */ +interface IntrinsicUndefinedType extends IntrinsicType { + intrinsicName: "undefined"; +} +/** + * The built-in `unknown` type. + * @category Type Types + */ +interface IntrinsicUnknownType extends IntrinsicType { + intrinsicName: "unknown"; +} +/** + * A "void" intrinsic type. + * @category Type Types + */ +interface IntrinsicVoidType extends IntrinsicType { + intrinsicName: "void"; +} +/** + * Determines whether the given type is the "never" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicNeverType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicNeverType(type: ts.Type): type is IntrinsicNeverType; +/** + * Determines whether the given type is a non-primitive intrinsic type. + * E.g. An "object" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicNonPrimitiveType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicNonPrimitiveType(type: ts.Type): type is IntrinsicNonPrimitiveType; +/** + * Determines whether the given type is the "null" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicNullType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicNullType(type: ts.Type): type is IntrinsicNullType; +/** + * Determines whether the given type is the "number" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicNumberType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicNumberType(type: ts.Type): type is IntrinsicNumberType; +/** + * Determines whether the given type is the "string" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicStringType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicStringType(type: ts.Type): type is IntrinsicStringType; +/** + * Test if a type is an {@link IntrinsicType}. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicType(type: ts.Type): type is IntrinsicType; +/** + * Determines whether the given type is the "undefined" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicUndefinedType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicUndefinedType(type: ts.Type): type is IntrinsicUndefinedType; +/** + * Determines whether the given type is the "unknown" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicUnknownType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicUnknownType(type: ts.Type): type is IntrinsicUnknownType; +/** + * Determines whether the given type is the "void" intrinsic type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntrinsicVoidType(type)) { + * // ... + * } + * ``` + */ +declare function isIntrinsicVoidType(type: ts.Type): type is IntrinsicVoidType; + +/** + * A type that is both an {@link IntrinsicType} and a `FreshableType` + * @category Type Types + */ +interface FreshableIntrinsicType extends ts.FreshableType, IntrinsicType { +} +/** + * Test if a type is a `FreshableIntrinsicType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isFreshableIntrinsicType(type)) { + * // ... + * } + */ +declare function isFreshableIntrinsicType(type: ts.Type): type is FreshableIntrinsicType; +/** + * Test if a type is a `TupleTypeReference`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isTupleTypeReference(type)) { + * // ... + * } + */ +declare function isTupleTypeReference(type: ts.Type): type is ts.TupleTypeReference; + +/** + * A boolean literal. + * i.e. Either a "true" or "false" literal. + * @category Type Types + */ +interface BooleanLiteralType extends FreshableIntrinsicType { + intrinsicName: "false" | "true"; +} +/** + * A "false" literal. + * @category Type Types + */ +interface FalseLiteralType extends BooleanLiteralType { + intrinsicName: "false"; +} +/** + * A "true" literal. + * @category Type Types + */ +interface TrueLiteralType extends BooleanLiteralType { + intrinsicName: "true"; +} +/** + * `LiteralType` from typescript except that it allows for it to work on arbitrary types. + * @deprecated Use {@link FreshableIntrinsicType} instead. + * @category Type Types + */ +interface UnknownLiteralType extends FreshableIntrinsicType { + value?: unknown; +} +/** + * Test if a type is a `BigIntLiteralType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isBigIntLiteralType(type)) { + * // ... + * } + * ``` + */ +declare function isBigIntLiteralType(type: ts.Type): type is ts.BigIntLiteralType; +/** + * Determines whether the given type is a boolean literal type. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isBooleanLiteralType(type)) { + * // ... + * } + * ``` + */ +declare function isBooleanLiteralType(type: ts.Type): type is BooleanLiteralType; +/** + * Determines whether the given type is a boolean literal type for "false". + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isFalseLiteralType(type)) { + * // ... + * } + * ``` + */ +declare function isFalseLiteralType(type: ts.Type): type is FalseLiteralType; +/** + * Test if a type is a `LiteralType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isLiteralType(type)) { + * // ... + * } + * ``` + */ +declare function isLiteralType(type: ts.Type): type is ts.LiteralType; +/** + * Test if a type is a `NumberLiteralType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isNumberLiteralType(type)) { + * // ... + * } + * ``` + */ +declare function isNumberLiteralType(type: ts.Type): type is ts.NumberLiteralType; +/** + * Test if a type is a `StringLiteralType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isStringLiteralType(type)) { + * // ... + * } + * ``` + */ +declare function isStringLiteralType(type: ts.Type): type is ts.StringLiteralType; +/** + * Test if a type is a `TemplateLiteralType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isTemplateLiteralType(type)) { + * // ... + * } + * ``` + */ +declare function isTemplateLiteralType(type: ts.Type): type is ts.TemplateLiteralType; +/** + * Determines whether the given type is a boolean literal type for "true". + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isTrueLiteralType(type)) { + * // ... + * } + * ``` + */ +declare function isTrueLiteralType(type: ts.Type): type is TrueLiteralType; + +/** + * Test if a type is a `EvolvingArrayType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isEvolvingArrayType(type)) { + * // ... + * } + * ``` + */ +declare function isEvolvingArrayType(type: ts.Type): type is ts.EvolvingArrayType; +/** + * Test if a type is a `TupleType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isTupleType(type)) { + * // ... + * } + * ``` + */ +declare function isTupleType(type: ts.Type): type is ts.TupleType; +/** + * Test if a type is a `TypeReference`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isTypeReference(type)) { + * // ... + * } + * ``` + */ +declare function isTypeReference(type: ts.Type): type is ts.TypeReference; + +/** + * Test if a type is a `ConditionalType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isConditionalType(type)) { + * // ... + * } + * ``` + */ +declare function isConditionalType(type: ts.Type): type is ts.ConditionalType; +/** + * Test if a type is a `EnumType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isEnumType(type)) { + * // ... + * } + * ``` + */ +declare function isEnumType(type: ts.Type): type is ts.EnumType; +/** + * Test if a type is a `FreshableType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isFreshableType(type)) { + * // ... + * } + * ``` + */ +declare function isFreshableType(type: ts.Type): type is ts.FreshableType; +/** + * Test if a type is a `IndexedAccessType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIndexedAccessType(type)) { + * // ... + * } + * ``` + */ +declare function isIndexedAccessType(type: ts.Type): type is ts.IndexedAccessType; +/** + * Test if a type is a `IndexType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIndexType(type)) { + * // ... + * } + * ``` + */ +declare function isIndexType(type: ts.Type): type is ts.IndexType; +/** + * Test if a type is a `InstantiableType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isInstantiableType(type)) { + * // ... + * } + * ``` + */ +declare function isInstantiableType(type: ts.Type): type is ts.InstantiableType; +/** + * Test if a type is a `IntersectionType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isIntersectionType(type)) { + * // ... + * } + * ``` + */ +declare function isIntersectionType(type: ts.Type): type is ts.IntersectionType; +/** + * Test if a type is a `ObjectType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isObjectType(type)) { + * // ... + * } + * ``` + */ +declare function isObjectType(type: ts.Type): type is ts.ObjectType; +/** + * Test if a type is a `StringMappingType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isStringMappingType(type)) { + * // ... + * } + * ``` + */ +declare function isStringMappingType(type: ts.Type): type is ts.StringMappingType; +/** + * Test if a type is a `SubstitutionType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isSubstitutionType(type)) { + * // ... + * } + * ``` + */ +declare function isSubstitutionType(type: ts.Type): type is ts.SubstitutionType; +/** + * Test if a type is a `TypeParameter`. + * + * Note: It is intentional that this is not a type guard. + * @see https://github.com/JoshuaKGoldberg/ts-api-utils/issues/382 + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isTypeParameter(type)) { + * // ... + * } + * ``` + */ +declare function isTypeParameter(type: ts.Type): boolean; +/** + * Test if a type is a `TypeVariable`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isTypeVariable(type)) { + * // ... + * } + * ``` + */ +declare function isTypeVariable(type: ts.Type): type is ts.TypeVariable; +/** + * Test if a type is a `UnionOrIntersectionType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isUnionOrIntersectionType(type)) { + * // ... + * } + * ``` + */ +declare function isUnionOrIntersectionType(type: ts.Type): type is ts.UnionOrIntersectionType; +/** + * Test if a type is a `UnionType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isUnionType(type)) { + * // ... + * } + * ``` + */ +declare function isUnionType(type: ts.Type): type is ts.UnionType; +/** + * Test if a type is a `UniqueESSymbolType`. + * @category Types - Type Guards + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isUniqueESSymbolType(type)) { + * // ... + * } + * ``` + */ +declare function isUniqueESSymbolType(type: ts.Type): type is ts.UniqueESSymbolType; + +/** + * Get the intersection type parts of the given type. + * + * If the given type is not a intersection type, an array contain only that type will be returned. + * @category Types - Utilities + * @example + * ```ts + * declare const type: ts.Type; + * + * for (const typePart of intersectionTypeParts(type)) { + * // ... + * } + * ``` + */ +declare function intersectionTypeParts(type: ts.Type): ts.Type[]; +/** + * Determines whether a type is definitely falsy. This function doesn't unwrap union types. + * @category Types - Utilities + * @example + * ```ts + * declare const type: ts.Type; + * + * if (isFalsyType(type)) { + * // ... + * } + * ``` + */ +declare function isFalsyType(type: ts.Type): boolean; +/** + * Determines whether writing to a certain property of a given type is allowed. + * @category Types - Utilities + * @example + * ```ts + * declare const property: ts.Symbol; + * declare const type: ts.Type; + * declare const typeChecker: ts.TypeChecker; + * + * if (isPropertyReadonlyInType(type, property.getEscapedName(), typeChecker)) { + * // ... + * } + * ``` + */ +declare function isPropertyReadonlyInType(type: ts.Type, name: ts.__String, typeChecker: ts.TypeChecker): boolean; +/** + * Determines whether a type is thenable and thus can be used with `await`. + * @category Types - Utilities + * @example + * ```ts + * declare const node: ts.Node; + * declare const type: ts.Type; + * declare const typeChecker: ts.TypeChecker; + * + * if (isThenableType(typeChecker, node, type)) { + * // ... + * } + * ``` + */ +declare function isThenableType(typeChecker: ts.TypeChecker, node: ts.Node, type: ts.Type): boolean; +/** + * Determines whether a type is thenable and thus can be used with `await`. + * @category Types - Utilities + * @example + * ```ts + * declare const expression: ts.Expression; + * declare const typeChecker: ts.TypeChecker; + * + * if (isThenableType(typeChecker, expression)) { + * // ... + * } + * ``` + * @example + * ```ts + * declare const expression: ts.Expression; + * declare const typeChecker: ts.TypeChecker; + * declare const type: ts.Type; + * + * if (isThenableType(typeChecker, expression, type)) { + * // ... + * } + * ``` + */ +declare function isThenableType(typeChecker: ts.TypeChecker, node: ts.Expression, type?: ts.Type): boolean; +/** + * Test if the given symbol has a readonly declaration. + * @category Symbols - Utilities + * @example + * ```ts + * declare const symbol: ts.Symbol; + * declare const typeChecker: ts.TypeChecker; + * + * if (symbolHasReadonlyDeclaration(symbol, typeChecker)) { + * // ... + * } + * ``` + */ +declare function symbolHasReadonlyDeclaration(symbol: ts.Symbol, typeChecker: ts.TypeChecker): boolean; +/** + * TS's `type.isLiteral()` is bugged before TS v5.0 and won't return `true` for + * bigint literals. Use this function instead if you need to check for bigint + * literals in TS versions before v5.0. Otherwise, you should just use + * `type.isLiteral()`. + * @see https://github.com/microsoft/TypeScript/pull/50929 + * @category Types - Utilities + * @example + * ```ts + * declare const type: ts.Type; + * + * if (typeIsLiteral(type)) { + * // ... + * } + * ``` + */ +declare function typeIsLiteral(type: ts.Type): type is ts.LiteralType; +/** + * Get the intersection or union type parts of the given type. + * + * Note that this is a shallow collection: it only returns `type.types` or `[type]`. + * + * If the given type is not an intersection or union type, an array contain only that type will be returned. + * @category Types - Utilities + * @example + * ```ts + * declare const type: ts.Type; + * + * for (const typePart of intersectionTypeParts(type)) { + * // ... + * } + * ``` + */ +declare function typeParts(type: ts.Type): ts.Type[]; +/** + * Get the union type parts of the given type. + * + * If the given type is not a union type, an array contain only that type will be returned. + * @category Types - Utilities + * @example + * ```ts + * declare const type: ts.Type; + * + * for (const typePart of unionTypeParts(type)) { + * // ... + * } + * ``` + */ +declare function unionTypeParts(type: ts.Type): ts.Type[]; + +/** + * Which "domain"(s) (most commonly, type or value space) a declaration is within. + */ +declare enum DeclarationDomain { + Namespace = 1, + Type = 2, + Value = 4, + Any = 7, + Import = 8 +} + +/** + * Which "domain"(s) (most commonly, type or value space) a usage is within. + */ +declare enum UsageDomain { + Namespace = 1, + Type = 2, + Value = 4, + Any = 7, + TypeQuery = 8, + ValueOrNamespace = 5 +} + +/** + * An instance of an item (type or value) being used. + */ +interface Usage { + /** + * Which space(s) the usage is within. + */ + domain: UsageDomain; + location: ts.Identifier; +} +/** + * How an item (type or value) was declared and/or referenced. + */ +interface UsageInfo { + /** + * Locations where the item was declared. + */ + declarations: ts.Identifier[]; + /** + * Which space(s) the item is within. + */ + domain: DeclarationDomain; + /** + * Whether the item was exported from its module or namespace scope. + */ + exported: boolean; + /** + * Whether the item's declaration was in the global scope. + */ + inGlobalScope: boolean; + /** + * Each reference to the item in the file. + */ + uses: Usage[]; +} + +/** + * Creates a mapping of each declared type and value to its type information. + * @category Nodes - Other Utilities + * @example + * ```ts + * declare const sourceFile: ts.SourceFile; + * + * const usage = collectVariableUsage(sourceFile); + * + * for (const [identifier, information] of usage) { + * console.log(`${identifier.getText()} is used ${information.uses.length} time(s).`); + * } + * ``` + */ +declare function collectVariableUsage(sourceFile: ts.SourceFile): Map; + +export { AccessKind, type AnyKeyword, type BigIntKeyword, type BooleanCompilerOptions, type BooleanKeyword, type BooleanLiteralType, type ConstAssertionExpression, type ConstAssertionIdentifier, DeclarationDomain, type FalseKeyword, type FalseLiteralType, type ForEachCommentCallback, type ForEachTokenCallback, type FreshableIntrinsicType, type ImportKeyword, type IntrinsicAnyType, type IntrinsicBigIntType, type IntrinsicBooleanType, type IntrinsicESSymbolType, type IntrinsicErrorType, type IntrinsicNeverType, type IntrinsicNonPrimitiveType, type IntrinsicNullType, type IntrinsicNumberType, type IntrinsicStringType, type IntrinsicType, type IntrinsicUndefinedType, type IntrinsicUnknownType, type IntrinsicVoidType, type NamedDeclarationWithName, type NeverKeyword, type NullKeyword, type NumberKeyword, type NumericOrStringLikeLiteral, type ObjectKeyword, type StrictCompilerOption, type StringKeyword, type SuperKeyword, type SymbolKeyword, type ThisKeyword, type TrueKeyword, type TrueLiteralType, type UndefinedKeyword, type UnknownKeyword, type UnknownLiteralType, UsageDomain, type UsageInfo as VariableInfo, type Usage as VariableUse, type VoidKeyword, collectVariableUsage, forEachComment, forEachToken, getAccessKind, getCallSignaturesOfType, getPropertyOfType, getWellKnownSymbolPropertyOfType, hasDecorators, hasExpressionInitializer, hasInitializer, hasJSDoc, hasModifiers, hasType, hasTypeArguments, includesModifier, intersectionTypeParts, isAbstractKeyword, isAccessExpression, isAccessibilityModifier, isAccessorDeclaration, isAccessorKeyword, isAnyKeyword, isArrayBindingElement, isArrayBindingOrAssignmentPattern, isAssertKeyword, isAssertsKeyword, isAssignmentKind, isAssignmentPattern, isAsyncKeyword, isAwaitKeyword, isBigIntKeyword, isBigIntLiteralType, isBindingOrAssignmentElementRestIndicator, isBindingOrAssignmentElementTarget, isBindingOrAssignmentPattern, isBindingPattern, isBlockLike, isBooleanKeyword, isBooleanLiteral, isBooleanLiteralType, isClassLikeDeclaration, isClassMemberModifier, isColonToken, isCompilerOptionEnabled, isConditionalType, isConstAssertionExpression, isConstKeyword, isDeclarationName, isDeclarationWithTypeParameterChildren, isDeclarationWithTypeParameters, isDeclareKeyword, isDefaultKeyword, isDestructuringPattern, isDotToken, isEndOfFileToken, isEntityNameExpression, isEntityNameOrEntityNameExpression, isEnumType, isEqualsGreaterThanToken, isEqualsToken, isEvolvingArrayType, isExclamationToken, isExportKeyword, isFalseKeyword, isFalseLiteral, isFalseLiteralType, isFalsyType, isForInOrOfStatement, isFreshableIntrinsicType, isFreshableType, isFunctionLikeDeclaration, isFunctionScopeBoundary, isImportExpression, isImportKeyword, isInKeyword, isIndexType, isIndexedAccessType, isInstantiableType, isIntersectionType, isIntrinsicAnyType, isIntrinsicBigIntType, isIntrinsicBooleanType, isIntrinsicESSymbolType, isIntrinsicErrorType, isIntrinsicNeverType, isIntrinsicNonPrimitiveType, isIntrinsicNullType, isIntrinsicNumberType, isIntrinsicStringType, isIntrinsicType, isIntrinsicUndefinedType, isIntrinsicUnknownType, isIntrinsicVoidType, isIterationStatement, isJSDocComment, isJSDocNamespaceBody, isJSDocNamespaceDeclaration, isJSDocText, isJSDocTypeReferencingNode, isJsonMinusNumericLiteral, isJsonObjectExpression, isJsxAttributeLike, isJsxAttributeValue, isJsxChild, isJsxTagNameExpression, isJsxTagNamePropertyAccess, isLiteralToken, isLiteralType, isModifierFlagSet, isModuleBody, isModuleName, isModuleReference, isNamedDeclarationWithName, isNamedImportBindings, isNamedImportsOrExports, isNamespaceBody, isNamespaceDeclaration, isNeverKeyword, isNodeFlagSet, isNullKeyword, isNullLiteral, isNumberKeyword, isNumberLiteralType, isNumericOrStringLikeLiteral, isNumericPropertyName, isObjectBindingOrAssignmentElement, isObjectBindingOrAssignmentPattern, isObjectFlagSet, isObjectKeyword, isObjectType, isObjectTypeDeclaration, isOutKeyword, isOverrideKeyword, isParameterPropertyModifier, isPrivateKeyword, isPropertyAccessEntityNameExpression, isPropertyNameLiteral, isPropertyReadonlyInType, isProtectedKeyword, isPseudoLiteralToken, isPublicKeyword, isQuestionDotToken, isQuestionToken, isReadonlyKeyword, isSignatureDeclaration, isStaticKeyword, isStrictCompilerOptionEnabled, isStringKeyword, isStringLiteralType, isStringMappingType, isSubstitutionType, isSuperElementAccessExpression, isSuperExpression, isSuperKeyword, isSuperProperty, isSuperPropertyAccessExpression, isSymbolFlagSet, isSymbolKeyword, isSyntaxList, isTemplateLiteralType, isThenableType, isThisExpression, isThisKeyword, isTransientSymbolLinksFlagSet, isTrueKeyword, isTrueLiteral, isTrueLiteralType, isTupleType, isTupleTypeReference, isTypeFlagSet, isTypeOnlyCompatibleAliasDeclaration, isTypeParameter, isTypeReference, isTypeReferenceType, isTypeVariable, isUndefinedKeyword, isUnionOrIntersectionType, isUnionOrIntersectionTypeNode, isUnionType, isUniqueESSymbolType, isUnknownKeyword, isValidPropertyAccess, isVariableLikeDeclaration, isVoidKeyword, symbolHasReadonlyDeclaration, typeIsLiteral, typeParts, unionTypeParts }; diff --git a/node_modules/ts-api-utils/lib/index.js b/node_modules/ts-api-utils/lib/index.js new file mode 100644 index 0000000..5db5012 --- /dev/null +++ b/node_modules/ts-api-utils/lib/index.js @@ -0,0 +1,2078 @@ +import ts9 from 'typescript'; + +// src/comments.ts +function forEachToken(node, callback, sourceFile = node.getSourceFile()) { + const queue = []; + while (true) { + if (ts9.isTokenKind(node.kind)) { + callback(node); + } else { + const children = node.getChildren(sourceFile); + if (children.length === 1) { + node = children[0]; + continue; + } + for (let i = children.length - 1; i >= 0; --i) { + queue.push(children[i]); + } + } + if (queue.length === 0) { + break; + } + node = queue.pop(); + } +} + +// src/comments.ts +function forEachComment(node, callback, sourceFile = node.getSourceFile()) { + const fullText = sourceFile.text; + const notJsx = sourceFile.languageVariant !== ts9.LanguageVariant.JSX; + return forEachToken( + node, + (token) => { + if (token.pos === token.end) { + return; + } + if (token.kind !== ts9.SyntaxKind.JsxText) { + ts9.forEachLeadingCommentRange( + fullText, + // skip shebang at position 0 + token.pos === 0 ? (ts9.getShebang(fullText) ?? "").length : token.pos, + commentCallback + ); + } + if (notJsx || canHaveTrailingTrivia(token)) { + return ts9.forEachTrailingCommentRange( + fullText, + token.end, + commentCallback + ); + } + }, + sourceFile + ); + function commentCallback(pos, end, kind) { + callback(fullText, { end, kind, pos }); + } +} +function canHaveTrailingTrivia(token) { + switch (token.kind) { + case ts9.SyntaxKind.CloseBraceToken: + return token.parent.kind !== ts9.SyntaxKind.JsxExpression || !isJsxElementOrFragment(token.parent.parent); + case ts9.SyntaxKind.GreaterThanToken: + switch (token.parent.kind) { + case ts9.SyntaxKind.JsxClosingElement: + case ts9.SyntaxKind.JsxClosingFragment: + return !isJsxElementOrFragment(token.parent.parent.parent); + case ts9.SyntaxKind.JsxOpeningElement: + return token.end !== token.parent.end; + case ts9.SyntaxKind.JsxOpeningFragment: + return false; + // would be inside the fragment + case ts9.SyntaxKind.JsxSelfClosingElement: + return token.end !== token.parent.end || // if end is not equal, this is part of the type arguments list + !isJsxElementOrFragment(token.parent.parent); + } + } + return true; +} +function isJsxElementOrFragment(node) { + return node.kind === ts9.SyntaxKind.JsxElement || node.kind === ts9.SyntaxKind.JsxFragment; +} +function isCompilerOptionEnabled(options, option) { + switch (option) { + case "allowJs": + return options.allowJs === undefined ? isCompilerOptionEnabled(options, "checkJs") : options.allowJs; + case "allowSyntheticDefaultImports": + return options.allowSyntheticDefaultImports !== undefined ? options.allowSyntheticDefaultImports : isCompilerOptionEnabled(options, "esModuleInterop") || options.module === ts9.ModuleKind.System; + case "alwaysStrict": + case "noImplicitAny": + case "noImplicitThis": + case "strictBindCallApply": + case "strictFunctionTypes": + case "strictNullChecks": + case "strictPropertyInitialization": + return isStrictCompilerOptionEnabled( + options, + option + ); + case "declaration": + return options.declaration || isCompilerOptionEnabled(options, "composite"); + case "declarationMap": + case "emitDeclarationOnly": + case "stripInternal": + return options[option] === true && isCompilerOptionEnabled(options, "declaration"); + case "incremental": + return options.incremental === undefined ? isCompilerOptionEnabled(options, "composite") : options.incremental; + case "noUncheckedIndexedAccess": + return options.noUncheckedIndexedAccess === true && isCompilerOptionEnabled(options, "strictNullChecks"); + case "skipDefaultLibCheck": + return options.skipDefaultLibCheck || isCompilerOptionEnabled(options, "skipLibCheck"); + case "suppressImplicitAnyIndexErrors": + return ( + // eslint-disable-next-line @typescript-eslint/no-deprecated + options.suppressImplicitAnyIndexErrors === true && isCompilerOptionEnabled(options, "noImplicitAny") + ); + } + return options[option] === true; +} +function isStrictCompilerOptionEnabled(options, option) { + return (options.strict ? options[option] !== false : options[option] === true) && (option !== "strictPropertyInitialization" || isStrictCompilerOptionEnabled(options, "strictNullChecks")); +} +function isModifierFlagSet(node, flag) { + return isFlagSet(ts9.getCombinedModifierFlags(node), flag); +} +function isFlagSet(allFlags, flag) { + return (allFlags & flag) !== 0; +} +function isFlagSetOnObject(obj, flag) { + return isFlagSet(obj.flags, flag); +} +var isNodeFlagSet = isFlagSetOnObject; +function isObjectFlagSet(objectType, flag) { + return isFlagSet(objectType.objectFlags, flag); +} +var isSymbolFlagSet = isFlagSetOnObject; +function isTransientSymbolLinksFlagSet(links, flag) { + return isFlagSet(links.checkFlags, flag); +} +var isTypeFlagSet = isFlagSetOnObject; + +// src/modifiers.ts +function includesModifier(modifiers, ...kinds) { + if (modifiers === undefined) { + return false; + } + for (const modifier of modifiers) { + if (kinds.includes(modifier.kind)) { + return true; + } + } + return false; +} +function isAssignmentKind(kind) { + return kind >= ts9.SyntaxKind.FirstAssignment && kind <= ts9.SyntaxKind.LastAssignment; +} +function isNumericPropertyName(name) { + return String(+name) === name; +} +function isValidPropertyAccess(text, languageVersion = ts9.ScriptTarget.Latest) { + if (text.length === 0) { + return false; + } + let ch = text.codePointAt(0); + if (!ts9.isIdentifierStart(ch, languageVersion)) { + return false; + } + for (let i = charSize(ch); i < text.length; i += charSize(ch)) { + ch = text.codePointAt(i); + if (!ts9.isIdentifierPart(ch, languageVersion)) { + return false; + } + } + return true; +} +function charSize(ch) { + return ch >= 65536 ? 2 : 1; +} + +// src/nodes/access.ts +var AccessKind = /* @__PURE__ */ ((AccessKind2) => { + AccessKind2[AccessKind2["None"] = 0] = "None"; + AccessKind2[AccessKind2["Read"] = 1] = "Read"; + AccessKind2[AccessKind2["Write"] = 2] = "Write"; + AccessKind2[AccessKind2["Delete"] = 4] = "Delete"; + AccessKind2[AccessKind2["ReadWrite"] = 3] = "ReadWrite"; + return AccessKind2; +})(AccessKind || {}); +function getAccessKind(node) { + const parent = node.parent; + switch (parent.kind) { + case ts9.SyntaxKind.ArrayLiteralExpression: + case ts9.SyntaxKind.SpreadAssignment: + case ts9.SyntaxKind.SpreadElement: + return isInDestructuringAssignment( + parent + ) ? 2 /* Write */ : 1 /* Read */; + case ts9.SyntaxKind.ArrowFunction: + return parent.body === node ? 1 /* Read */ : 2 /* Write */; + case ts9.SyntaxKind.AsExpression: + case ts9.SyntaxKind.NonNullExpression: + case ts9.SyntaxKind.ParenthesizedExpression: + case ts9.SyntaxKind.TypeAssertionExpression: + return getAccessKind(parent); + case ts9.SyntaxKind.AwaitExpression: + case ts9.SyntaxKind.CallExpression: + case ts9.SyntaxKind.CaseClause: + case ts9.SyntaxKind.ComputedPropertyName: + case ts9.SyntaxKind.ConditionalExpression: + case ts9.SyntaxKind.Decorator: + case ts9.SyntaxKind.DoStatement: + case ts9.SyntaxKind.ElementAccessExpression: + case ts9.SyntaxKind.ExpressionStatement: + case ts9.SyntaxKind.ForStatement: + case ts9.SyntaxKind.IfStatement: + case ts9.SyntaxKind.JsxElement: + case ts9.SyntaxKind.JsxExpression: + case ts9.SyntaxKind.JsxOpeningElement: + case ts9.SyntaxKind.JsxSelfClosingElement: + case ts9.SyntaxKind.JsxSpreadAttribute: + case ts9.SyntaxKind.NewExpression: + case ts9.SyntaxKind.ReturnStatement: + case ts9.SyntaxKind.SwitchStatement: + case ts9.SyntaxKind.TaggedTemplateExpression: + case ts9.SyntaxKind.TemplateSpan: + case ts9.SyntaxKind.ThrowStatement: + case ts9.SyntaxKind.TypeOfExpression: + case ts9.SyntaxKind.VoidExpression: + case ts9.SyntaxKind.WhileStatement: + case ts9.SyntaxKind.WithStatement: + case ts9.SyntaxKind.YieldExpression: + return 1 /* Read */; + case ts9.SyntaxKind.BinaryExpression: + return parent.right === node ? 1 /* Read */ : !isAssignmentKind(parent.operatorToken.kind) ? 1 /* Read */ : parent.operatorToken.kind === ts9.SyntaxKind.EqualsToken ? 2 /* Write */ : 3 /* ReadWrite */; + case ts9.SyntaxKind.BindingElement: + case ts9.SyntaxKind.EnumMember: + case ts9.SyntaxKind.JsxAttribute: + case ts9.SyntaxKind.Parameter: + case ts9.SyntaxKind.PropertyDeclaration: + case ts9.SyntaxKind.VariableDeclaration: + return parent.initializer === node ? 1 /* Read */ : 0 /* None */; + case ts9.SyntaxKind.DeleteExpression: + return 4 /* Delete */; + case ts9.SyntaxKind.ExportAssignment: + return parent.isExportEquals ? 1 /* Read */ : 0 /* None */; + case ts9.SyntaxKind.ExpressionWithTypeArguments: + return parent.parent.token === ts9.SyntaxKind.ExtendsKeyword && parent.parent.parent.kind !== ts9.SyntaxKind.InterfaceDeclaration ? 1 /* Read */ : 0 /* None */; + case ts9.SyntaxKind.ForInStatement: + case ts9.SyntaxKind.ForOfStatement: + return parent.initializer === node ? 2 /* Write */ : 1 /* Read */; + case ts9.SyntaxKind.PostfixUnaryExpression: + return 3 /* ReadWrite */; + case ts9.SyntaxKind.PrefixUnaryExpression: + return parent.operator === ts9.SyntaxKind.PlusPlusToken || parent.operator === ts9.SyntaxKind.MinusMinusToken ? 3 /* ReadWrite */ : 1 /* Read */; + case ts9.SyntaxKind.PropertyAccessExpression: + return parent.expression === node ? 1 /* Read */ : 0 /* None */; + case ts9.SyntaxKind.PropertyAssignment: + return parent.name === node ? 0 /* None */ : isInDestructuringAssignment(parent) ? 2 /* Write */ : 1 /* Read */; + case ts9.SyntaxKind.ShorthandPropertyAssignment: + return parent.objectAssignmentInitializer === node ? 1 /* Read */ : isInDestructuringAssignment(parent) ? 2 /* Write */ : 1 /* Read */; + } + return 0 /* None */; +} +function isInDestructuringAssignment(node) { + switch (node.kind) { + case ts9.SyntaxKind.ShorthandPropertyAssignment: + if (node.objectAssignmentInitializer !== undefined) { + return true; + } + // falls through + case ts9.SyntaxKind.PropertyAssignment: + case ts9.SyntaxKind.SpreadAssignment: + node = node.parent; + break; + case ts9.SyntaxKind.SpreadElement: + if (node.parent.kind !== ts9.SyntaxKind.ArrayLiteralExpression) { + return false; + } + node = node.parent; + } + while (true) { + switch (node.parent.kind) { + case ts9.SyntaxKind.ArrayLiteralExpression: + case ts9.SyntaxKind.ObjectLiteralExpression: + node = node.parent; + break; + case ts9.SyntaxKind.BinaryExpression: + return node.parent.left === node && node.parent.operatorToken.kind === ts9.SyntaxKind.EqualsToken; + case ts9.SyntaxKind.ForOfStatement: + return node.parent.initializer === node; + case ts9.SyntaxKind.PropertyAssignment: + case ts9.SyntaxKind.SpreadAssignment: + node = node.parent.parent; + break; + case ts9.SyntaxKind.SpreadElement: + if (node.parent.parent.kind !== ts9.SyntaxKind.ArrayLiteralExpression) { + return false; + } + node = node.parent.parent; + break; + default: + return false; + } + } +} +function isAbstractKeyword(node) { + return node.kind === ts9.SyntaxKind.AbstractKeyword; +} +function isAccessorKeyword(node) { + return node.kind === ts9.SyntaxKind.AccessorKeyword; +} +function isAnyKeyword(node) { + return node.kind === ts9.SyntaxKind.AnyKeyword; +} +function isAssertKeyword(node) { + return node.kind === ts9.SyntaxKind.AssertKeyword; +} +function isAssertsKeyword(node) { + return node.kind === ts9.SyntaxKind.AssertsKeyword; +} +function isAsyncKeyword(node) { + return node.kind === ts9.SyntaxKind.AsyncKeyword; +} +function isAwaitKeyword(node) { + return node.kind === ts9.SyntaxKind.AwaitKeyword; +} +function isBigIntKeyword(node) { + return node.kind === ts9.SyntaxKind.BigIntKeyword; +} +function isBooleanKeyword(node) { + return node.kind === ts9.SyntaxKind.BooleanKeyword; +} +function isColonToken(node) { + return node.kind === ts9.SyntaxKind.ColonToken; +} +function isConstKeyword(node) { + return node.kind === ts9.SyntaxKind.ConstKeyword; +} +function isDeclareKeyword(node) { + return node.kind === ts9.SyntaxKind.DeclareKeyword; +} +function isDefaultKeyword(node) { + return node.kind === ts9.SyntaxKind.DefaultKeyword; +} +function isDotToken(node) { + return node.kind === ts9.SyntaxKind.DotToken; +} +function isEndOfFileToken(node) { + return node.kind === ts9.SyntaxKind.EndOfFileToken; +} +function isEqualsGreaterThanToken(node) { + return node.kind === ts9.SyntaxKind.EqualsGreaterThanToken; +} +function isEqualsToken(node) { + return node.kind === ts9.SyntaxKind.EqualsToken; +} +function isExclamationToken(node) { + return node.kind === ts9.SyntaxKind.ExclamationToken; +} +function isExportKeyword(node) { + return node.kind === ts9.SyntaxKind.ExportKeyword; +} +function isFalseKeyword(node) { + return node.kind === ts9.SyntaxKind.FalseKeyword; +} +function isFalseLiteral(node) { + return node.kind === ts9.SyntaxKind.FalseKeyword; +} +function isImportExpression(node) { + return node.kind === ts9.SyntaxKind.ImportKeyword; +} +function isImportKeyword(node) { + return node.kind === ts9.SyntaxKind.ImportKeyword; +} +function isInKeyword(node) { + return node.kind === ts9.SyntaxKind.InKeyword; +} +function isJSDocText(node) { + return node.kind === ts9.SyntaxKind.JSDocText; +} +function isJsonMinusNumericLiteral(node) { + return node.kind === ts9.SyntaxKind.PrefixUnaryExpression; +} +function isNeverKeyword(node) { + return node.kind === ts9.SyntaxKind.NeverKeyword; +} +function isNullKeyword(node) { + return node.kind === ts9.SyntaxKind.NullKeyword; +} +function isNullLiteral(node) { + return node.kind === ts9.SyntaxKind.NullKeyword; +} +function isNumberKeyword(node) { + return node.kind === ts9.SyntaxKind.NumberKeyword; +} +function isObjectKeyword(node) { + return node.kind === ts9.SyntaxKind.ObjectKeyword; +} +function isOutKeyword(node) { + return node.kind === ts9.SyntaxKind.OutKeyword; +} +function isOverrideKeyword(node) { + return node.kind === ts9.SyntaxKind.OverrideKeyword; +} +function isPrivateKeyword(node) { + return node.kind === ts9.SyntaxKind.PrivateKeyword; +} +function isProtectedKeyword(node) { + return node.kind === ts9.SyntaxKind.ProtectedKeyword; +} +function isPublicKeyword(node) { + return node.kind === ts9.SyntaxKind.PublicKeyword; +} +function isQuestionDotToken(node) { + return node.kind === ts9.SyntaxKind.QuestionDotToken; +} +function isQuestionToken(node) { + return node.kind === ts9.SyntaxKind.QuestionToken; +} +function isReadonlyKeyword(node) { + return node.kind === ts9.SyntaxKind.ReadonlyKeyword; +} +function isStaticKeyword(node) { + return node.kind === ts9.SyntaxKind.StaticKeyword; +} +function isStringKeyword(node) { + return node.kind === ts9.SyntaxKind.StringKeyword; +} +function isSuperExpression(node) { + return node.kind === ts9.SyntaxKind.SuperKeyword; +} +function isSuperKeyword(node) { + return node.kind === ts9.SyntaxKind.SuperKeyword; +} +function isSymbolKeyword(node) { + return node.kind === ts9.SyntaxKind.SymbolKeyword; +} +function isSyntaxList(node) { + return node.kind === ts9.SyntaxKind.SyntaxList; +} +function isThisExpression(node) { + return node.kind === ts9.SyntaxKind.ThisKeyword; +} +function isThisKeyword(node) { + return node.kind === ts9.SyntaxKind.ThisKeyword; +} +function isTrueKeyword(node) { + return node.kind === ts9.SyntaxKind.TrueKeyword; +} +function isTrueLiteral(node) { + return node.kind === ts9.SyntaxKind.TrueKeyword; +} +function isUndefinedKeyword(node) { + return node.kind === ts9.SyntaxKind.UndefinedKeyword; +} +function isUnknownKeyword(node) { + return node.kind === ts9.SyntaxKind.UnknownKeyword; +} +function isVoidKeyword(node) { + return node.kind === ts9.SyntaxKind.VoidKeyword; +} +var [tsMajor, tsMinor] = ts9.versionMajorMinor.split(".").map((raw) => Number.parseInt(raw, 10)); +function isTsVersionAtLeast(major, minor = 0) { + return tsMajor > major || tsMajor === major && tsMinor >= minor; +} + +// src/nodes/typeGuards/union.ts +function hasDecorators(node) { + return ts9.isParameter(node) || ts9.isPropertyDeclaration(node) || ts9.isMethodDeclaration(node) || ts9.isGetAccessorDeclaration(node) || ts9.isSetAccessorDeclaration(node) || ts9.isClassExpression(node) || ts9.isClassDeclaration(node); +} +function hasExpressionInitializer(node) { + return ts9.isVariableDeclaration(node) || ts9.isParameter(node) || ts9.isBindingElement(node) || ts9.isPropertyDeclaration(node) || ts9.isPropertyAssignment(node) || ts9.isEnumMember(node); +} +function hasInitializer(node) { + return hasExpressionInitializer(node) || ts9.isForStatement(node) || ts9.isForInStatement(node) || ts9.isForOfStatement(node) || ts9.isJsxAttribute(node); +} +function hasJSDoc(node) { + if ( + // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isAccessorDeclaration(node) || ts9.isArrowFunction(node) || ts9.isBlock(node) || ts9.isBreakStatement(node) || ts9.isCallSignatureDeclaration(node) || ts9.isCaseClause(node) || // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isClassLikeDeclaration(node) || ts9.isConstructorDeclaration(node) || ts9.isConstructorTypeNode(node) || ts9.isConstructSignatureDeclaration(node) || ts9.isContinueStatement(node) || ts9.isDebuggerStatement(node) || ts9.isDoStatement(node) || ts9.isEmptyStatement(node) || isEndOfFileToken(node) || ts9.isEnumDeclaration(node) || ts9.isEnumMember(node) || ts9.isExportAssignment(node) || ts9.isExportDeclaration(node) || ts9.isExportSpecifier(node) || ts9.isExpressionStatement(node) || ts9.isForInStatement(node) || ts9.isForOfStatement(node) || ts9.isForStatement(node) || ts9.isFunctionDeclaration(node) || ts9.isFunctionExpression(node) || ts9.isFunctionTypeNode(node) || ts9.isIfStatement(node) || ts9.isImportDeclaration(node) || ts9.isImportEqualsDeclaration(node) || ts9.isIndexSignatureDeclaration(node) || ts9.isInterfaceDeclaration(node) || ts9.isJSDocFunctionType(node) || ts9.isLabeledStatement(node) || ts9.isMethodDeclaration(node) || ts9.isMethodSignature(node) || ts9.isModuleDeclaration(node) || ts9.isNamedTupleMember(node) || ts9.isNamespaceExportDeclaration(node) || ts9.isParameter(node) || ts9.isParenthesizedExpression(node) || ts9.isPropertyAssignment(node) || ts9.isPropertyDeclaration(node) || ts9.isPropertySignature(node) || ts9.isReturnStatement(node) || ts9.isShorthandPropertyAssignment(node) || ts9.isSpreadAssignment(node) || ts9.isSwitchStatement(node) || ts9.isThrowStatement(node) || ts9.isTryStatement(node) || ts9.isTypeAliasDeclaration(node) || ts9.isVariableDeclaration(node) || ts9.isVariableStatement(node) || ts9.isWhileStatement(node) || ts9.isWithStatement(node) + ) { + return true; + } + if (isTsVersionAtLeast(4, 4) && ts9.isClassStaticBlockDeclaration(node)) { + return true; + } + if (isTsVersionAtLeast(5, 0) && (ts9.isBinaryExpression(node) || ts9.isElementAccessExpression(node) || ts9.isIdentifier(node) || ts9.isJSDocSignature(node) || ts9.isObjectLiteralExpression(node) || ts9.isPropertyAccessExpression(node) || ts9.isTypeParameterDeclaration(node))) { + return true; + } + return false; +} +function hasModifiers(node) { + return ts9.isTypeParameterDeclaration(node) || ts9.isParameter(node) || ts9.isConstructorTypeNode(node) || ts9.isPropertySignature(node) || ts9.isPropertyDeclaration(node) || ts9.isMethodSignature(node) || ts9.isMethodDeclaration(node) || ts9.isConstructorDeclaration(node) || ts9.isGetAccessorDeclaration(node) || ts9.isSetAccessorDeclaration(node) || ts9.isIndexSignatureDeclaration(node) || ts9.isFunctionExpression(node) || ts9.isArrowFunction(node) || ts9.isClassExpression(node) || ts9.isVariableStatement(node) || ts9.isFunctionDeclaration(node) || ts9.isClassDeclaration(node) || ts9.isInterfaceDeclaration(node) || ts9.isTypeAliasDeclaration(node) || ts9.isEnumDeclaration(node) || ts9.isModuleDeclaration(node) || ts9.isImportEqualsDeclaration(node) || ts9.isImportDeclaration(node) || ts9.isExportAssignment(node) || ts9.isExportDeclaration(node); +} +function hasType(node) { + return isSignatureDeclaration(node) || ts9.isVariableDeclaration(node) || ts9.isParameter(node) || ts9.isPropertySignature(node) || ts9.isPropertyDeclaration(node) || ts9.isTypePredicateNode(node) || ts9.isParenthesizedTypeNode(node) || ts9.isTypeOperatorNode(node) || ts9.isMappedTypeNode(node) || ts9.isAssertionExpression(node) || ts9.isTypeAliasDeclaration(node) || ts9.isJSDocTypeExpression(node) || ts9.isJSDocNonNullableType(node) || ts9.isJSDocNullableType(node) || ts9.isJSDocOptionalType(node) || ts9.isJSDocVariadicType(node); +} +function hasTypeArguments(node) { + return ts9.isCallExpression(node) || ts9.isNewExpression(node) || ts9.isTaggedTemplateExpression(node) || ts9.isJsxOpeningElement(node) || ts9.isJsxSelfClosingElement(node); +} +function isAccessExpression(node) { + return ts9.isPropertyAccessExpression(node) || ts9.isElementAccessExpression(node); +} +function isAccessibilityModifier(node) { + return isPublicKeyword(node) || isPrivateKeyword(node) || isProtectedKeyword(node); +} +function isAccessorDeclaration(node) { + return ts9.isGetAccessorDeclaration(node) || ts9.isSetAccessorDeclaration(node); +} +function isArrayBindingElement(node) { + return ts9.isBindingElement(node) || ts9.isOmittedExpression(node); +} +function isArrayBindingOrAssignmentPattern(node) { + return ts9.isArrayBindingPattern(node) || ts9.isArrayLiteralExpression(node); +} +function isAssignmentPattern(node) { + return ts9.isObjectLiteralExpression(node) || ts9.isArrayLiteralExpression(node); +} +function isBindingOrAssignmentElementRestIndicator(node) { + if (ts9.isSpreadElement(node) || ts9.isSpreadAssignment(node)) { + return true; + } + if (isTsVersionAtLeast(4, 4)) { + return ts9.isDotDotDotToken(node); + } + return false; +} +function isBindingOrAssignmentElementTarget(node) { + return isBindingOrAssignmentPattern(node) || ts9.isIdentifier(node) || ts9.isPropertyAccessExpression(node) || ts9.isElementAccessExpression(node) || ts9.isOmittedExpression(node); +} +function isBindingOrAssignmentPattern(node) { + return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); +} +function isBindingPattern(node) { + return ts9.isObjectBindingPattern(node) || ts9.isArrayBindingPattern(node); +} +function isBlockLike(node) { + return ts9.isSourceFile(node) || ts9.isBlock(node) || ts9.isModuleBlock(node) || ts9.isCaseOrDefaultClause(node); +} +function isBooleanLiteral(node) { + return isTrueLiteral(node) || isFalseLiteral(node); +} +function isClassLikeDeclaration(node) { + return ts9.isClassDeclaration(node) || ts9.isClassExpression(node); +} +function isClassMemberModifier(node) { + return isAccessibilityModifier(node) || isReadonlyKeyword(node) || isStaticKeyword(node) || isAccessorKeyword(node); +} +function isDeclarationName(node) { + return ts9.isIdentifier(node) || ts9.isPrivateIdentifier(node) || ts9.isStringLiteralLike(node) || ts9.isNumericLiteral(node) || ts9.isComputedPropertyName(node) || ts9.isElementAccessExpression(node) || isBindingPattern(node) || isEntityNameExpression(node); +} +function isDeclarationWithTypeParameterChildren(node) { + return isSignatureDeclaration(node) || // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isClassLikeDeclaration(node) || ts9.isInterfaceDeclaration(node) || ts9.isTypeAliasDeclaration(node) || ts9.isJSDocTemplateTag(node); +} +function isDeclarationWithTypeParameters(node) { + return isDeclarationWithTypeParameterChildren(node) || ts9.isJSDocTypedefTag(node) || ts9.isJSDocCallbackTag(node) || ts9.isJSDocSignature(node); +} +function isDestructuringPattern(node) { + return isBindingPattern(node) || ts9.isObjectLiteralExpression(node) || ts9.isArrayLiteralExpression(node); +} +function isEntityNameExpression(node) { + return ts9.isIdentifier(node) || isPropertyAccessEntityNameExpression(node); +} +function isEntityNameOrEntityNameExpression(node) { + return ts9.isEntityName(node) || isEntityNameExpression(node); +} +function isForInOrOfStatement(node) { + return ts9.isForInStatement(node) || ts9.isForOfStatement(node); +} +function isFunctionLikeDeclaration(node) { + return ts9.isFunctionDeclaration(node) || ts9.isMethodDeclaration(node) || ts9.isGetAccessorDeclaration(node) || ts9.isSetAccessorDeclaration(node) || ts9.isConstructorDeclaration(node) || ts9.isFunctionExpression(node) || ts9.isArrowFunction(node); +} +function isJSDocComment(node) { + if (isJSDocText(node)) { + return true; + } + if (isTsVersionAtLeast(4, 4)) { + return ts9.isJSDocLink(node) || ts9.isJSDocLinkCode(node) || ts9.isJSDocLinkPlain(node); + } + return false; +} +function isJSDocNamespaceBody(node) { + return ts9.isIdentifier(node) || isJSDocNamespaceDeclaration(node); +} +function isJSDocTypeReferencingNode(node) { + return ts9.isJSDocVariadicType(node) || ts9.isJSDocOptionalType(node) || ts9.isJSDocNullableType(node) || ts9.isJSDocNonNullableType(node); +} +function isJsonObjectExpression(node) { + return ts9.isObjectLiteralExpression(node) || ts9.isArrayLiteralExpression(node) || isJsonMinusNumericLiteral(node) || ts9.isNumericLiteral(node) || ts9.isStringLiteral(node) || isBooleanLiteral(node) || isNullLiteral(node); +} +function isJsxAttributeLike(node) { + return ts9.isJsxAttribute(node) || ts9.isJsxSpreadAttribute(node); +} +function isJsxAttributeValue(node) { + return ts9.isStringLiteral(node) || ts9.isJsxExpression(node) || ts9.isJsxElement(node) || ts9.isJsxSelfClosingElement(node) || ts9.isJsxFragment(node); +} +function isJsxChild(node) { + return ts9.isJsxText(node) || ts9.isJsxExpression(node) || ts9.isJsxElement(node) || ts9.isJsxSelfClosingElement(node) || ts9.isJsxFragment(node); +} +function isJsxTagNameExpression(node) { + return ts9.isIdentifier(node) || isThisExpression(node) || isJsxTagNamePropertyAccess(node); +} +function isLiteralToken(node) { + return ts9.isNumericLiteral(node) || ts9.isBigIntLiteral(node) || ts9.isStringLiteral(node) || ts9.isJsxText(node) || ts9.isRegularExpressionLiteral(node) || ts9.isNoSubstitutionTemplateLiteral(node); +} +function isModuleBody(node) { + return isNamespaceBody(node) || isJSDocNamespaceBody(node); +} +function isModuleName(node) { + return ts9.isIdentifier(node) || ts9.isStringLiteral(node); +} +function isModuleReference(node) { + return ts9.isEntityName(node) || ts9.isExternalModuleReference(node); +} +function isNamedImportBindings(node) { + return ts9.isNamespaceImport(node) || ts9.isNamedImports(node); +} +function isNamedImportsOrExports(node) { + return ts9.isNamedImports(node) || ts9.isNamedExports(node); +} +function isNamespaceBody(node) { + return ts9.isModuleBlock(node) || isNamespaceDeclaration(node); +} +function isObjectBindingOrAssignmentElement(node) { + return ts9.isBindingElement(node) || ts9.isPropertyAssignment(node) || ts9.isShorthandPropertyAssignment(node) || ts9.isSpreadAssignment(node); +} +function isObjectBindingOrAssignmentPattern(node) { + return ts9.isObjectBindingPattern(node) || ts9.isObjectLiteralExpression(node); +} +function isObjectTypeDeclaration(node) { + return ( + // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isClassLikeDeclaration(node) || ts9.isInterfaceDeclaration(node) || ts9.isTypeLiteralNode(node) + ); +} +function isParameterPropertyModifier(node) { + return isAccessibilityModifier(node) || isReadonlyKeyword(node); +} +function isPropertyNameLiteral(node) { + return ts9.isIdentifier(node) || ts9.isStringLiteralLike(node) || ts9.isNumericLiteral(node); +} +function isPseudoLiteralToken(node) { + return ts9.isTemplateHead(node) || ts9.isTemplateMiddle(node) || ts9.isTemplateTail(node); +} +function isSignatureDeclaration(node) { + return ts9.isCallSignatureDeclaration(node) || ts9.isConstructSignatureDeclaration(node) || ts9.isMethodSignature(node) || ts9.isIndexSignatureDeclaration(node) || ts9.isFunctionTypeNode(node) || ts9.isConstructorTypeNode(node) || ts9.isJSDocFunctionType(node) || ts9.isFunctionDeclaration(node) || ts9.isMethodDeclaration(node) || ts9.isConstructorDeclaration(node) || // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts <5 + isAccessorDeclaration(node) || ts9.isFunctionExpression(node) || ts9.isArrowFunction(node); +} +function isSuperProperty(node) { + return isSuperPropertyAccessExpression(node) || isSuperElementAccessExpression(node); +} +function isTypeOnlyCompatibleAliasDeclaration(node) { + if (ts9.isImportClause(node) || ts9.isImportEqualsDeclaration(node) || ts9.isNamespaceImport(node) || ts9.isImportOrExportSpecifier(node)) { + return true; + } + if (isTsVersionAtLeast(5, 0) && (ts9.isExportDeclaration(node) || ts9.isNamespaceExport(node))) { + return true; + } + return false; +} +function isTypeReferenceType(node) { + return ts9.isTypeReferenceNode(node) || ts9.isExpressionWithTypeArguments(node); +} +function isUnionOrIntersectionTypeNode(node) { + return ts9.isUnionTypeNode(node) || ts9.isIntersectionTypeNode(node); +} +function isVariableLikeDeclaration(node) { + return ts9.isVariableDeclaration(node) || ts9.isParameter(node) || ts9.isBindingElement(node) || ts9.isPropertyDeclaration(node) || ts9.isPropertyAssignment(node) || ts9.isPropertySignature(node) || ts9.isJsxAttribute(node) || ts9.isShorthandPropertyAssignment(node) || ts9.isEnumMember(node) || ts9.isJSDocPropertyTag(node) || ts9.isJSDocParameterTag(node); +} + +// src/nodes/typeGuards/compound.ts +function isConstAssertionExpression(node) { + return ts9.isTypeReferenceNode(node.type) && ts9.isIdentifier(node.type.typeName) && node.type.typeName.escapedText === "const"; +} +function isIterationStatement(node) { + switch (node.kind) { + case ts9.SyntaxKind.DoStatement: + case ts9.SyntaxKind.ForInStatement: + case ts9.SyntaxKind.ForOfStatement: + case ts9.SyntaxKind.ForStatement: + case ts9.SyntaxKind.WhileStatement: + return true; + default: + return false; + } +} +function isJSDocNamespaceDeclaration(node) { + return ts9.isModuleDeclaration(node) && ts9.isIdentifier(node.name) && (node.body === undefined || isJSDocNamespaceBody(node.body)); +} +function isJsxTagNamePropertyAccess(node) { + return ts9.isPropertyAccessExpression(node) && // eslint-disable-next-line @typescript-eslint/no-deprecated -- Keep compatibility with ts < 5 + isJsxTagNameExpression(node.expression); +} +function isNamedDeclarationWithName(node) { + return "name" in node && node.name !== undefined && node.name !== null && isDeclarationName(node.name); +} +function isNamespaceDeclaration(node) { + return ts9.isModuleDeclaration(node) && ts9.isIdentifier(node.name) && node.body !== undefined && isNamespaceBody(node.body); +} +function isNumericOrStringLikeLiteral(node) { + switch (node.kind) { + case ts9.SyntaxKind.NoSubstitutionTemplateLiteral: + case ts9.SyntaxKind.NumericLiteral: + case ts9.SyntaxKind.StringLiteral: + return true; + default: + return false; + } +} +function isPropertyAccessEntityNameExpression(node) { + return ts9.isPropertyAccessExpression(node) && ts9.isIdentifier(node.name) && isEntityNameExpression(node.expression); +} +function isSuperElementAccessExpression(node) { + return ts9.isElementAccessExpression(node) && isSuperExpression(node.expression); +} +function isSuperPropertyAccessExpression(node) { + return ts9.isPropertyAccessExpression(node) && isSuperExpression(node.expression); +} +function isFunctionScopeBoundary(node) { + switch (node.kind) { + case ts9.SyntaxKind.ArrowFunction: + case ts9.SyntaxKind.CallSignature: + case ts9.SyntaxKind.ClassDeclaration: + case ts9.SyntaxKind.ClassExpression: + case ts9.SyntaxKind.Constructor: + case ts9.SyntaxKind.ConstructorType: + case ts9.SyntaxKind.ConstructSignature: + case ts9.SyntaxKind.EnumDeclaration: + case ts9.SyntaxKind.FunctionDeclaration: + case ts9.SyntaxKind.FunctionExpression: + case ts9.SyntaxKind.FunctionType: + case ts9.SyntaxKind.GetAccessor: + case ts9.SyntaxKind.MethodDeclaration: + case ts9.SyntaxKind.MethodSignature: + case ts9.SyntaxKind.ModuleDeclaration: + case ts9.SyntaxKind.SetAccessor: + return true; + case ts9.SyntaxKind.SourceFile: + return ts9.isExternalModule(node); + default: + return false; + } +} +function isIntrinsicAnyType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Any); +} +function isIntrinsicBigIntType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.BigInt); +} +function isIntrinsicBooleanType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Boolean); +} +function isIntrinsicErrorType(type) { + return isIntrinsicType(type) && type.intrinsicName === "error"; +} +function isIntrinsicESSymbolType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.ESSymbol); +} +var IntrinsicTypeFlags = ts9.TypeFlags.Intrinsic ?? ts9.TypeFlags.Any | ts9.TypeFlags.Unknown | ts9.TypeFlags.String | ts9.TypeFlags.Number | ts9.TypeFlags.BigInt | ts9.TypeFlags.Boolean | ts9.TypeFlags.BooleanLiteral | ts9.TypeFlags.ESSymbol | ts9.TypeFlags.Void | ts9.TypeFlags.Undefined | ts9.TypeFlags.Null | ts9.TypeFlags.Never | ts9.TypeFlags.NonPrimitive; +function isIntrinsicNeverType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Never); +} +function isIntrinsicNonPrimitiveType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.NonPrimitive); +} +function isIntrinsicNullType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Null); +} +function isIntrinsicNumberType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Number); +} +function isIntrinsicStringType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.String); +} +function isIntrinsicType(type) { + return isTypeFlagSet(type, IntrinsicTypeFlags); +} +function isIntrinsicUndefinedType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Undefined); +} +function isIntrinsicUnknownType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Unknown); +} +function isIntrinsicVoidType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Void); +} +function isConditionalType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Conditional); +} +function isEnumType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Enum); +} +function isFreshableType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Freshable); +} +function isIndexedAccessType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.IndexedAccess); +} +function isIndexType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Index); +} +function isInstantiableType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Instantiable); +} +function isIntersectionType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Intersection); +} +function isObjectType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Object); +} +function isStringMappingType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.StringMapping); +} +function isSubstitutionType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Substitution); +} +function isTypeParameter(type) { + return isTypeFlagSet(type, ts9.TypeFlags.TypeParameter); +} +function isTypeVariable(type) { + return isTypeFlagSet(type, ts9.TypeFlags.TypeVariable); +} +function isUnionOrIntersectionType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.UnionOrIntersection); +} +function isUnionType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Union); +} +function isUniqueESSymbolType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.UniqueESSymbol); +} + +// src/types/typeGuards/objects.ts +function isEvolvingArrayType(type) { + return isObjectType(type) && isObjectFlagSet(type, ts9.ObjectFlags.EvolvingArray); +} +function isTupleType(type) { + return isObjectType(type) && isObjectFlagSet(type, ts9.ObjectFlags.Tuple); +} +function isTypeReference(type) { + return isObjectType(type) && isObjectFlagSet(type, ts9.ObjectFlags.Reference); +} + +// src/types/typeGuards/compound.ts +function isFreshableIntrinsicType(type) { + return isIntrinsicType(type) && isFreshableType(type); +} +function isTupleTypeReference(type) { + return isTypeReference(type) && isTupleType(type.target); +} +function isBigIntLiteralType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.BigIntLiteral); +} +function isBooleanLiteralType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.BooleanLiteral); +} +function isFalseLiteralType(type) { + return isBooleanLiteralType(type) && type.intrinsicName === "false"; +} +function isLiteralType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.Literal); +} +function isNumberLiteralType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.NumberLiteral); +} +function isStringLiteralType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.StringLiteral); +} +function isTemplateLiteralType(type) { + return isTypeFlagSet(type, ts9.TypeFlags.TemplateLiteral); +} +function isTrueLiteralType(type) { + return isBooleanLiteralType(type) && type.intrinsicName === "true"; +} + +// src/types/getters.ts +function getCallSignaturesOfType(type) { + if (isUnionType(type)) { + const signatures = []; + for (const subType of type.types) { + signatures.push(...getCallSignaturesOfType(subType)); + } + return signatures; + } + if (isIntersectionType(type)) { + let signatures; + for (const subType of type.types) { + const sig = getCallSignaturesOfType(subType); + if (sig.length !== 0) { + if (signatures !== undefined) { + return []; + } + signatures = sig; + } + } + return signatures === undefined ? [] : signatures; + } + return type.getCallSignatures(); +} +function getPropertyOfType(type, name) { + if (!name.startsWith("__")) { + return type.getProperty(name); + } + return type.getProperties().find((s) => s.escapedName === name); +} +function getWellKnownSymbolPropertyOfType(type, wellKnownSymbolName, typeChecker) { + const prefix = "__@" + wellKnownSymbolName; + for (const prop of type.getProperties()) { + if (!prop.name.startsWith(prefix)) { + continue; + } + const declaration = prop.valueDeclaration ?? prop.getDeclarations()?.[0]; + if (!declaration || !isNamedDeclarationWithName(declaration) || declaration.name === undefined || !ts9.isComputedPropertyName(declaration.name)) { + continue; + } + const globalSymbol = typeChecker.getApparentType( + typeChecker.getTypeAtLocation(declaration.name.expression) + ).symbol; + if (prop.escapedName === getPropertyNameOfWellKnownSymbol( + typeChecker, + globalSymbol, + wellKnownSymbolName + )) { + return prop; + } + } + return undefined; +} +function getPropertyNameOfWellKnownSymbol(typeChecker, symbolConstructor, symbolName) { + const knownSymbol = symbolConstructor && typeChecker.getTypeOfSymbolAtLocation( + symbolConstructor, + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access + symbolConstructor.valueDeclaration + ).getProperty(symbolName); + const knownSymbolType = knownSymbol && typeChecker.getTypeOfSymbolAtLocation( + knownSymbol, + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access + knownSymbol.valueDeclaration + ); + if (knownSymbolType && isUniqueESSymbolType(knownSymbolType)) { + return knownSymbolType.escapedName; + } + return "__@" + symbolName; +} +function isBindableObjectDefinePropertyCall(node) { + return node.arguments.length === 3 && isEntityNameExpression(node.arguments[0]) && isNumericOrStringLikeLiteral(node.arguments[1]) && ts9.isPropertyAccessExpression(node.expression) && node.expression.name.escapedText === "defineProperty" && ts9.isIdentifier(node.expression.expression) && node.expression.expression.escapedText === "Object"; +} +function isInConstContext(node, typeChecker) { + let current = node; + while (true) { + const parent = current.parent; + outer: switch (parent.kind) { + case ts9.SyntaxKind.ArrayLiteralExpression: + case ts9.SyntaxKind.ObjectLiteralExpression: + case ts9.SyntaxKind.ParenthesizedExpression: + case ts9.SyntaxKind.TemplateExpression: + current = parent; + break; + case ts9.SyntaxKind.AsExpression: + case ts9.SyntaxKind.TypeAssertionExpression: + return isConstAssertionExpression(parent); + case ts9.SyntaxKind.CallExpression: { + if (!ts9.isExpression(current)) { + return false; + } + const functionSignature = typeChecker.getResolvedSignature( + parent + ); + if (functionSignature === undefined) { + return false; + } + const argumentIndex = parent.arguments.indexOf( + current + ); + if (argumentIndex < 0) { + return false; + } + const parameterSymbol = functionSignature.getParameters()[argumentIndex]; + if (parameterSymbol === undefined || !("links" in parameterSymbol)) { + return false; + } + const parameterSymbolLinks = parameterSymbol.links; + const propertySymbol = parameterSymbolLinks.type?.getProperties()?.[argumentIndex]; + if (propertySymbol === undefined || !("links" in propertySymbol)) { + return false; + } + return isTransientSymbolLinksFlagSet( + propertySymbol.links, + ts9.CheckFlags.Readonly + ); + } + case ts9.SyntaxKind.PrefixUnaryExpression: + if (current.kind !== ts9.SyntaxKind.NumericLiteral) { + return false; + } + switch (parent.operator) { + case ts9.SyntaxKind.MinusToken: + case ts9.SyntaxKind.PlusToken: + current = parent; + break outer; + default: + return false; + } + case ts9.SyntaxKind.PropertyAssignment: + if (parent.initializer !== current) { + return false; + } + current = parent.parent; + break; + case ts9.SyntaxKind.ShorthandPropertyAssignment: + current = parent.parent; + break; + default: + return false; + } + } +} + +// src/types/utilities.ts +function intersectionTypeParts(type) { + return isIntersectionType(type) ? type.types : [type]; +} +function isFalsyType(type) { + if (isTypeFlagSet( + type, + ts9.TypeFlags.Undefined | ts9.TypeFlags.Null | ts9.TypeFlags.Void + )) { + return true; + } + if (typeIsLiteral(type)) { + if (typeof type.value === "object") { + return type.value.base10Value === "0"; + } else { + return !type.value; + } + } + return isFalseLiteralType(type); +} +function isPropertyReadonlyInType(type, name, typeChecker) { + let seenProperty = false; + let seenReadonlySignature = false; + for (const subType of unionTypeParts(type)) { + if (getPropertyOfType(subType, name) === undefined) { + const index = (isNumericPropertyName(name) ? typeChecker.getIndexInfoOfType(subType, ts9.IndexKind.Number) : undefined) ?? typeChecker.getIndexInfoOfType(subType, ts9.IndexKind.String); + if (index?.isReadonly) { + if (seenProperty) { + return true; + } + seenReadonlySignature = true; + } + } else if (seenReadonlySignature || isReadonlyPropertyIntersection(subType, name, typeChecker)) { + return true; + } else { + seenProperty = true; + } + } + return false; +} +function isThenableType(typeChecker, node, type = typeChecker.getTypeAtLocation(node)) { + for (const typePart of unionTypeParts(typeChecker.getApparentType(type))) { + const then = typePart.getProperty("then"); + if (then === undefined) { + continue; + } + const thenType = typeChecker.getTypeOfSymbolAtLocation(then, node); + for (const subTypePart of unionTypeParts(thenType)) { + for (const signature of subTypePart.getCallSignatures()) { + if (signature.parameters.length !== 0 && isCallback(typeChecker, signature.parameters[0], node)) { + return true; + } + } + } + } + return false; +} +function symbolHasReadonlyDeclaration(symbol, typeChecker) { + return !!((symbol.flags & ts9.SymbolFlags.Accessor) === ts9.SymbolFlags.GetAccessor || symbol.declarations?.some( + (node) => isModifierFlagSet(node, ts9.ModifierFlags.Readonly) || ts9.isVariableDeclaration(node) && isNodeFlagSet(node.parent, ts9.NodeFlags.Const) || ts9.isCallExpression(node) && isReadonlyAssignmentDeclaration(node, typeChecker) || ts9.isEnumMember(node) || (ts9.isPropertyAssignment(node) || ts9.isShorthandPropertyAssignment(node)) && isInConstContext(node, typeChecker) + )); +} +function typeIsLiteral(type) { + if (isTsVersionAtLeast(5, 0)) { + return type.isLiteral(); + } else { + return isTypeFlagSet( + type, + ts9.TypeFlags.StringLiteral | ts9.TypeFlags.NumberLiteral | ts9.TypeFlags.BigIntLiteral + ); + } +} +function typeParts(type) { + return isIntersectionType(type) || isUnionType(type) ? type.types : [type]; +} +function unionTypeParts(type) { + return isUnionType(type) ? type.types : [type]; +} +function isCallback(typeChecker, param, node) { + let type = typeChecker.getApparentType( + typeChecker.getTypeOfSymbolAtLocation(param, node) + ); + if (param.valueDeclaration.dotDotDotToken) { + type = type.getNumberIndexType(); + if (type === undefined) { + return false; + } + } + for (const subType of unionTypeParts(type)) { + if (subType.getCallSignatures().length !== 0) { + return true; + } + } + return false; +} +function isReadonlyAssignmentDeclaration(node, typeChecker) { + if (!isBindableObjectDefinePropertyCall(node)) { + return false; + } + const descriptorType = typeChecker.getTypeAtLocation(node.arguments[2]); + if (descriptorType.getProperty("value") === undefined) { + return descriptorType.getProperty("set") === undefined; + } + const writableProp = descriptorType.getProperty("writable"); + if (writableProp === undefined) { + return false; + } + const writableType = writableProp.valueDeclaration !== undefined && ts9.isPropertyAssignment(writableProp.valueDeclaration) ? typeChecker.getTypeAtLocation(writableProp.valueDeclaration.initializer) : typeChecker.getTypeOfSymbolAtLocation(writableProp, node.arguments[2]); + return isFalseLiteralType(writableType); +} +function isReadonlyPropertyFromMappedType(type, name, typeChecker) { + if (!isObjectType(type) || !isObjectFlagSet(type, ts9.ObjectFlags.Mapped)) { + return; + } + const declaration = type.symbol.declarations[0]; + if (declaration.readonlyToken !== undefined && !/^__@[^@]+$/.test(name)) { + return declaration.readonlyToken.kind !== ts9.SyntaxKind.MinusToken; + } + const { modifiersType } = type; + return modifiersType && isPropertyReadonlyInType(modifiersType, name, typeChecker); +} +function isReadonlyPropertyIntersection(type, name, typeChecker) { + const typeParts2 = isIntersectionType(type) ? type.types : [type]; + return typeParts2.some((subType) => { + const prop = getPropertyOfType(subType, name); + if (prop === undefined) { + return false; + } + if (prop.flags & ts9.SymbolFlags.Transient) { + if (/^(?:[1-9]\d*|0)$/.test(name) && isTupleTypeReference(subType)) { + return subType.target.readonly; + } + switch (isReadonlyPropertyFromMappedType(subType, name, typeChecker)) { + case false: + return false; + case true: + return true; + } + } + return !!// members of namespace import + (isSymbolFlagSet(prop, ts9.SymbolFlags.ValueModule) || // we unwrapped every mapped type, now we can check the actual declarations + symbolHasReadonlyDeclaration(prop, typeChecker)); + }); +} +function identifierToKeywordKind(node) { + return "originalKeywordKind" in node ? node.originalKeywordKind : ts9.identifierToKeywordKind(node); +} + +// src/usage/declarations.ts +var DeclarationDomain = /* @__PURE__ */ ((DeclarationDomain2) => { + DeclarationDomain2[DeclarationDomain2["Namespace"] = 1] = "Namespace"; + DeclarationDomain2[DeclarationDomain2["Type"] = 2] = "Type"; + DeclarationDomain2[DeclarationDomain2["Value"] = 4] = "Value"; + DeclarationDomain2[DeclarationDomain2["Any"] = 7] = "Any"; + DeclarationDomain2[DeclarationDomain2["Import"] = 8] = "Import"; + return DeclarationDomain2; +})(DeclarationDomain || {}); +function getDeclarationDomain(node) { + switch (node.parent.kind) { + case ts9.SyntaxKind.ClassDeclaration: + case ts9.SyntaxKind.ClassExpression: + return 2 /* Type */ | 4 /* Value */; + case ts9.SyntaxKind.EnumDeclaration: + return 7 /* Any */; + case ts9.SyntaxKind.FunctionDeclaration: + case ts9.SyntaxKind.FunctionExpression: + return 4 /* Value */; + case ts9.SyntaxKind.ImportClause: + case ts9.SyntaxKind.NamespaceImport: + return 7 /* Any */ | 8 /* Import */; + // TODO handle type-only imports + case ts9.SyntaxKind.ImportEqualsDeclaration: + case ts9.SyntaxKind.ImportSpecifier: + return node.parent.name === node ? 7 /* Any */ | 8 /* Import */ : undefined; + case ts9.SyntaxKind.InterfaceDeclaration: + case ts9.SyntaxKind.TypeAliasDeclaration: + case ts9.SyntaxKind.TypeParameter: + return 2 /* Type */; + case ts9.SyntaxKind.ModuleDeclaration: + return 1 /* Namespace */; + case ts9.SyntaxKind.Parameter: + if (node.parent.parent.kind === ts9.SyntaxKind.IndexSignature || identifierToKeywordKind(node) === ts9.SyntaxKind.ThisKeyword) { + return; + } + // falls through + case ts9.SyntaxKind.BindingElement: + case ts9.SyntaxKind.VariableDeclaration: + return node.parent.name === node ? 4 /* Value */ : undefined; + } +} +function getPropertyName(propertyName) { + if (propertyName.kind === ts9.SyntaxKind.ComputedPropertyName) { + const expression = unwrapParentheses(propertyName.expression); + if (ts9.isPrefixUnaryExpression(expression)) { + let negate = false; + switch (expression.operator) { + case ts9.SyntaxKind.MinusToken: + negate = true; + // falls through + case ts9.SyntaxKind.PlusToken: + return ts9.isNumericLiteral(expression.operand) ? `${negate ? "-" : ""}${expression.operand.text}` : ts9.isBigIntLiteral(expression.operand) ? `${negate ? "-" : ""}${expression.operand.text.slice(0, -1)}` : undefined; + default: + return; + } + } + if (ts9.isBigIntLiteral(expression)) { + return expression.text.slice(0, -1); + } + if (isNumericOrStringLikeLiteral(expression)) { + return expression.text; + } + return; + } + return propertyName.kind === ts9.SyntaxKind.PrivateIdentifier ? undefined : propertyName.text; +} +function unwrapParentheses(node) { + while (node.kind === ts9.SyntaxKind.ParenthesizedExpression) { + node = node.expression; + } + return node; +} +var UsageDomain = /* @__PURE__ */ ((UsageDomain2) => { + UsageDomain2[UsageDomain2["Namespace"] = 1] = "Namespace"; + UsageDomain2[UsageDomain2["Type"] = 2] = "Type"; + UsageDomain2[UsageDomain2["Value"] = 4] = "Value"; + UsageDomain2[UsageDomain2["Any"] = 7] = "Any"; + UsageDomain2[UsageDomain2["TypeQuery"] = 8] = "TypeQuery"; + UsageDomain2[UsageDomain2["ValueOrNamespace"] = 5] = "ValueOrNamespace"; + return UsageDomain2; +})(UsageDomain || {}); +function getUsageDomain(node) { + const parent = node.parent; + switch (parent.kind) { + // Value + case ts9.SyntaxKind.BindingElement: + if (parent.initializer === node) { + return 5 /* ValueOrNamespace */; + } + break; + case ts9.SyntaxKind.BreakStatement: + case ts9.SyntaxKind.ClassDeclaration: + case ts9.SyntaxKind.ClassExpression: + case ts9.SyntaxKind.ContinueStatement: + case ts9.SyntaxKind.EnumDeclaration: + case ts9.SyntaxKind.FunctionDeclaration: + case ts9.SyntaxKind.FunctionExpression: + case ts9.SyntaxKind.GetAccessor: + case ts9.SyntaxKind.ImportClause: + case ts9.SyntaxKind.ImportSpecifier: + case ts9.SyntaxKind.InterfaceDeclaration: + case ts9.SyntaxKind.JsxAttribute: + case ts9.SyntaxKind.LabeledStatement: + case ts9.SyntaxKind.MethodDeclaration: + case ts9.SyntaxKind.MethodSignature: + case ts9.SyntaxKind.ModuleDeclaration: + case ts9.SyntaxKind.NamedTupleMember: + case ts9.SyntaxKind.NamespaceExport: + case ts9.SyntaxKind.NamespaceExportDeclaration: + case ts9.SyntaxKind.NamespaceImport: + case ts9.SyntaxKind.PropertySignature: + case ts9.SyntaxKind.SetAccessor: + case ts9.SyntaxKind.TypeAliasDeclaration: + case ts9.SyntaxKind.TypeParameter: + case ts9.SyntaxKind.TypePredicate: + break; + case ts9.SyntaxKind.EnumMember: + case ts9.SyntaxKind.ImportEqualsDeclaration: + case ts9.SyntaxKind.Parameter: + case ts9.SyntaxKind.PropertyAccessExpression: + case ts9.SyntaxKind.PropertyAssignment: + case ts9.SyntaxKind.PropertyDeclaration: + case ts9.SyntaxKind.VariableDeclaration: + if (parent.name !== node) { + return 5 /* ValueOrNamespace */; + } + break; + case ts9.SyntaxKind.ExportAssignment: + return 7 /* Any */; + case ts9.SyntaxKind.ExportSpecifier: + if (parent.propertyName === undefined || parent.propertyName === node) { + return 7 /* Any */; + } + break; + case ts9.SyntaxKind.ExpressionWithTypeArguments: + return parent.parent.token === ts9.SyntaxKind.ImplementsKeyword || parent.parent.parent.kind === ts9.SyntaxKind.InterfaceDeclaration ? 2 /* Type */ : 4 /* Value */; + case ts9.SyntaxKind.QualifiedName: + if (parent.left === node) { + if (getEntityNameParent(parent).kind === ts9.SyntaxKind.TypeQuery) { + return 1 /* Namespace */ | 8 /* TypeQuery */; + } + return 1 /* Namespace */; + } + break; + case ts9.SyntaxKind.TypeQuery: + return 5 /* ValueOrNamespace */ | 8 /* TypeQuery */; + case ts9.SyntaxKind.TypeReference: + return identifierToKeywordKind(node) !== ts9.SyntaxKind.ConstKeyword ? 2 /* Type */ : undefined; + default: + return 5 /* ValueOrNamespace */; + } +} +function getEntityNameParent(name) { + let parent = name.parent; + while (parent.kind === ts9.SyntaxKind.QualifiedName) { + parent = parent.parent; + } + return parent; +} +function isBlockScopeBoundary(node) { + switch (node.kind) { + case ts9.SyntaxKind.Block: { + const parent = node.parent; + return parent.kind !== ts9.SyntaxKind.CatchClause && // blocks inside SourceFile are block scope boundaries + (parent.kind === ts9.SyntaxKind.SourceFile || // blocks that are direct children of a function scope boundary are no scope boundary + // for example the FunctionBlock is part of the function scope of the containing function + !isFunctionScopeBoundary(parent)) ? 2 /* Block */ : 0 /* None */; + } + case ts9.SyntaxKind.CaseBlock: + case ts9.SyntaxKind.CatchClause: + case ts9.SyntaxKind.ForInStatement: + case ts9.SyntaxKind.ForOfStatement: + case ts9.SyntaxKind.ForStatement: + case ts9.SyntaxKind.WithStatement: + return 2 /* Block */; + default: + return 0 /* None */; + } +} + +// src/usage/scopes.ts +var AbstractScope = class { + constructor(global) { + this.global = global; + } + namespaceScopes = undefined; + uses = []; + variables = /* @__PURE__ */ new Map(); + #enumScopes = undefined; + addUse(use) { + this.uses.push(use); + } + addVariable(identifier, name, selector, exported, domain) { + const variables = this.getDestinationScope(selector).getVariables(); + const declaration = { + declaration: name, + domain, + exported + }; + const variable = variables.get(identifier); + if (variable === undefined) { + variables.set(identifier, { + declarations: [declaration], + domain, + uses: [] + }); + } else { + variable.domain |= domain; + variable.declarations.push(declaration); + } + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + createOrReuseEnumScope(name, _exported) { + let scope; + if (this.#enumScopes === undefined) { + this.#enumScopes = /* @__PURE__ */ new Map(); + } else { + scope = this.#enumScopes.get(name); + } + if (scope === undefined) { + scope = new EnumScope(this); + this.#enumScopes.set(name, scope); + } + return scope; + } + // only relevant for the root scope + createOrReuseNamespaceScope(name, _exported, ambient, hasExportStatement) { + let scope; + if (this.namespaceScopes === undefined) { + this.namespaceScopes = /* @__PURE__ */ new Map(); + } else { + scope = this.namespaceScopes.get(name); + } + if (scope === undefined) { + scope = new NamespaceScope(ambient, hasExportStatement, this); + this.namespaceScopes.set(name, scope); + } else { + scope.refresh(ambient, hasExportStatement); + } + return scope; + } + end(cb) { + if (this.namespaceScopes !== undefined) { + this.namespaceScopes.forEach((value) => value.finish(cb)); + } + this.namespaceScopes = this.#enumScopes = undefined; + this.applyUses(); + this.variables.forEach((variable) => { + for (const declaration of variable.declarations) { + const result = { + declarations: [], + domain: declaration.domain, + exported: declaration.exported, + inGlobalScope: this.global, + uses: [] + }; + for (const other of variable.declarations) { + if (other.domain & declaration.domain) { + result.declarations.push(other.declaration); + } + } + for (const use of variable.uses) { + if (use.domain & declaration.domain) { + result.uses.push(use); + } + } + cb(result, declaration.declaration, this); + } + }); + } + getFunctionScope() { + return this; + } + getVariables() { + return this.variables; + } + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars + markExported(_name) { + } + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars + addUseToParent(_use) { + } + applyUse(use, variables = this.variables) { + const variable = variables.get(use.location.text); + if (variable === undefined || (variable.domain & use.domain) === 0) { + return false; + } + variable.uses.push(use); + return true; + } + applyUses() { + for (const use of this.uses) { + if (!this.applyUse(use)) { + this.addUseToParent(use); + } + } + this.uses = []; + } +}; +var NonRootScope = class extends AbstractScope { + constructor(parent, boundary) { + super(false); + this.parent = parent; + this.boundary = boundary; + } + getDestinationScope(selector) { + return this.boundary & selector ? this : this.parent.getDestinationScope(selector); + } + addUseToParent(use) { + return this.parent.addUse(use, this); + } +}; +var AbstractNamedExpressionScope = class extends NonRootScope { + #domain; + #name; + constructor(name, domain, parent) { + super(parent, 1 /* Function */); + this.#name = name; + this.#domain = domain; + } + addUse(use, source) { + if (source !== this.innerScope) { + return this.innerScope.addUse(use); + } + if (use.domain & this.#domain && use.location.text === this.#name.text) { + this.uses.push(use); + } else { + return this.parent.addUse(use, this); + } + } + end(cb) { + this.innerScope.end(cb); + return cb( + { + declarations: [this.#name], + domain: this.#domain, + exported: false, + inGlobalScope: false, + uses: this.uses + }, + this.#name, + this + ); + } + getDestinationScope() { + return this.innerScope; + } + getFunctionScope() { + return this.innerScope; + } +}; +var BlockScope = class extends NonRootScope { + #functionScope; + constructor(functionScope, parent) { + super(parent, 2 /* Block */); + this.#functionScope = functionScope; + } + getFunctionScope() { + return this.#functionScope; + } +}; +var ClassExpressionScope = class extends AbstractNamedExpressionScope { + innerScope = new NonRootScope(this, 1 /* Function */); + constructor(name, parent) { + super(name, 4 /* Value */ | 2 /* Type */, parent); + } +}; +var ConditionalTypeScope = class extends NonRootScope { + #state = 0 /* Initial */; + constructor(parent) { + super(parent, 8 /* ConditionalType */); + } + addUse(use) { + if (this.#state === 2 /* TrueType */) { + return void this.uses.push(use); + } + return this.parent.addUse(use, this); + } + updateState(newState) { + this.#state = newState; + } +}; +var EnumScope = class extends NonRootScope { + constructor(parent) { + super(parent, 1 /* Function */); + } + end() { + this.applyUses(); + } +}; +var FunctionScope = class extends NonRootScope { + constructor(parent) { + super(parent, 1 /* Function */); + } + beginBody() { + this.applyUses(); + } +}; +var FunctionExpressionScope = class extends AbstractNamedExpressionScope { + innerScope = new FunctionScope(this); + constructor(name, parent) { + super(name, 4 /* Value */, parent); + } + beginBody() { + return this.innerScope.beginBody(); + } +}; +var NamespaceScope = class extends NonRootScope { + #ambient; + #exports = undefined; + #hasExport; + #innerScope = new NonRootScope(this, 1 /* Function */); + constructor(ambient, hasExport, parent) { + super(parent, 1 /* Function */); + this.#ambient = ambient; + this.#hasExport = hasExport; + } + addUse(use, source) { + if (source !== this.#innerScope) { + return this.#innerScope.addUse(use); + } + this.uses.push(use); + } + createOrReuseEnumScope(name, exported) { + if (!exported && (!this.#ambient || this.#hasExport)) { + return this.#innerScope.createOrReuseEnumScope(name, exported); + } + return super.createOrReuseEnumScope(name, exported); + } + createOrReuseNamespaceScope(name, exported, ambient, hasExportStatement) { + if (!exported && (!this.#ambient || this.#hasExport)) { + return this.#innerScope.createOrReuseNamespaceScope( + name, + exported, + ambient || this.#ambient, + hasExportStatement + ); + } + return super.createOrReuseNamespaceScope( + name, + exported, + ambient || this.#ambient, + hasExportStatement + ); + } + end(cb) { + this.#innerScope.end((variable, key, scope) => { + if (scope !== this.#innerScope || !variable.exported && (!this.#ambient || this.#exports !== undefined && !this.#exports.has(key.text))) { + return cb(variable, key, scope); + } + const namespaceVar = this.variables.get(key.text); + if (namespaceVar === undefined) { + this.variables.set(key.text, { + declarations: variable.declarations.map(mapDeclaration), + domain: variable.domain, + uses: [...variable.uses] + }); + } else { + outer: for (const declaration of variable.declarations) { + for (const existing of namespaceVar.declarations) { + if (existing.declaration === declaration) { + continue outer; + } + namespaceVar.declarations.push(mapDeclaration(declaration)); + } + } + namespaceVar.domain |= variable.domain; + for (const use of variable.uses) { + if (namespaceVar.uses.includes(use)) { + continue; + } + namespaceVar.uses.push(use); + } + } + }); + this.applyUses(); + this.#innerScope = new NonRootScope(this, 1 /* Function */); + } + finish(cb) { + return super.end(cb); + } + getDestinationScope() { + return this.#innerScope; + } + markExported(name) { + if (this.#exports === undefined) { + this.#exports = /* @__PURE__ */ new Set(); + } + this.#exports.add(name.text); + } + refresh(ambient, hasExport) { + this.#ambient = ambient; + this.#hasExport = hasExport; + } +}; +var RootScope = class extends AbstractScope { + #exportAll; + #exports = undefined; + #innerScope = new NonRootScope(this, 1 /* Function */); + constructor(exportAll, global) { + super(global); + this.#exportAll = exportAll; + } + addUse(use, origin) { + if (origin === this.#innerScope) { + return super.addUse(use); + } + return this.#innerScope.addUse(use); + } + addVariable(identifier, name, selector, exported, domain) { + if (domain & 8 /* Import */) { + return super.addVariable(identifier, name, selector, exported, domain); + } + return this.#innerScope.addVariable( + identifier, + name, + selector, + exported, + domain + ); + } + end(cb) { + this.#innerScope.end((value, key) => { + value.exported ||= this.#exportAll || this.#exports !== undefined && this.#exports.includes(key.text); + value.inGlobalScope = this.global; + return cb(value, key, this); + }); + return super.end((value, key, scope) => { + value.exported ||= scope === this && this.#exports !== undefined && this.#exports.includes(key.text); + return cb(value, key, scope); + }); + } + getDestinationScope() { + return this; + } + markExported(id) { + if (this.#exports === undefined) { + this.#exports = [id.text]; + } else { + this.#exports.push(id.text); + } + } +}; +function mapDeclaration(declaration) { + return { + declaration, + domain: getDeclarationDomain(declaration), + exported: true + }; +} + +// src/usage/UsageWalker.ts +var UsageWalker = class { + #result = /* @__PURE__ */ new Map(); + #scope; + getUsage(sourceFile) { + const variableCallback = (variable, key) => { + this.#result.set(key, variable); + }; + const isModule = ts9.isExternalModule(sourceFile); + this.#scope = new RootScope( + sourceFile.isDeclarationFile && isModule && !containsExportStatement(sourceFile), + !isModule + ); + const cb = (node) => { + if (isBlockScopeBoundary(node)) { + return continueWithScope( + node, + new BlockScope(this.#scope.getFunctionScope(), this.#scope), + handleBlockScope + ); + } + switch (node.kind) { + case ts9.SyntaxKind.ArrowFunction: + case ts9.SyntaxKind.CallSignature: + case ts9.SyntaxKind.Constructor: + case ts9.SyntaxKind.ConstructorType: + case ts9.SyntaxKind.ConstructSignature: + case ts9.SyntaxKind.FunctionDeclaration: + case ts9.SyntaxKind.FunctionExpression: + case ts9.SyntaxKind.FunctionType: + case ts9.SyntaxKind.GetAccessor: + case ts9.SyntaxKind.MethodDeclaration: + case ts9.SyntaxKind.MethodSignature: + case ts9.SyntaxKind.SetAccessor: + return this.#handleFunctionLikeDeclaration( + node, + cb, + variableCallback + ); + case ts9.SyntaxKind.ClassDeclaration: + this.#handleDeclaration( + node, + true, + 4 /* Value */ | 2 /* Type */ + ); + return continueWithScope( + node, + new NonRootScope(this.#scope, 1 /* Function */) + ); + case ts9.SyntaxKind.ClassExpression: + return continueWithScope( + node, + node.name !== undefined ? new ClassExpressionScope( + node.name, + this.#scope + ) : new NonRootScope(this.#scope, 1 /* Function */) + ); + case ts9.SyntaxKind.ConditionalType: + return this.#handleConditionalType( + node, + cb, + variableCallback + ); + case ts9.SyntaxKind.EnumDeclaration: + this.#handleDeclaration( + node, + true, + 7 /* Any */ + ); + return continueWithScope( + node, + this.#scope.createOrReuseEnumScope( + node.name.text, + includesModifier( + node.modifiers, + ts9.SyntaxKind.ExportKeyword + ) + ) + ); + case ts9.SyntaxKind.EnumMember: + this.#scope.addVariable( + getPropertyName(node.name), + node.name, + 1 /* Function */, + true, + 4 /* Value */ + ); + break; + case ts9.SyntaxKind.ExportAssignment: + if (node.expression.kind === ts9.SyntaxKind.Identifier) { + return this.#scope.markExported( + node.expression + ); + } + break; + case ts9.SyntaxKind.ExportSpecifier: + if (node.propertyName !== undefined) { + return this.#scope.markExported( + node.propertyName, + node.name + ); + } + return this.#scope.markExported(node.name); + case ts9.SyntaxKind.Identifier: { + const domain = getUsageDomain(node); + if (domain !== undefined) { + this.#scope.addUse({ domain, location: node }); + } + return; + } + case ts9.SyntaxKind.ImportClause: + case ts9.SyntaxKind.ImportEqualsDeclaration: + case ts9.SyntaxKind.ImportSpecifier: + case ts9.SyntaxKind.NamespaceImport: + this.#handleDeclaration( + node, + false, + 7 /* Any */ | 8 /* Import */ + ); + break; + case ts9.SyntaxKind.InterfaceDeclaration: + case ts9.SyntaxKind.TypeAliasDeclaration: + this.#handleDeclaration( + node, + true, + 2 /* Type */ + ); + return continueWithScope( + node, + new NonRootScope(this.#scope, 4 /* Type */) + ); + case ts9.SyntaxKind.MappedType: + return continueWithScope( + node, + new NonRootScope(this.#scope, 4 /* Type */) + ); + case ts9.SyntaxKind.ModuleDeclaration: + return this.#handleModule( + node, + continueWithScope + ); + case ts9.SyntaxKind.Parameter: + if (node.parent.kind !== ts9.SyntaxKind.IndexSignature && (node.name.kind !== ts9.SyntaxKind.Identifier || identifierToKeywordKind( + node.name + ) !== ts9.SyntaxKind.ThisKeyword)) { + this.#handleBindingName( + node.name, + false, + false + ); + } + break; + case ts9.SyntaxKind.TypeParameter: + this.#scope.addVariable( + node.name.text, + node.name, + node.parent.kind === ts9.SyntaxKind.InferType ? 8 /* InferType */ : 7 /* Type */, + false, + 2 /* Type */ + ); + break; + // End of Scope specific handling + case ts9.SyntaxKind.VariableDeclarationList: + this.#handleVariableDeclaration(node); + break; + } + return ts9.forEachChild(node, cb); + }; + const continueWithScope = (node, scope, next = forEachChild) => { + const savedScope = this.#scope; + this.#scope = scope; + next(node); + this.#scope.end(variableCallback); + this.#scope = savedScope; + }; + const handleBlockScope = (node) => { + if (node.kind === ts9.SyntaxKind.CatchClause && node.variableDeclaration !== undefined) { + this.#handleBindingName( + node.variableDeclaration.name, + true, + false + ); + } + return ts9.forEachChild(node, cb); + }; + ts9.forEachChild(sourceFile, cb); + this.#scope.end(variableCallback); + return this.#result; + function forEachChild(node) { + return ts9.forEachChild(node, cb); + } + } + #handleBindingName(name, blockScoped, exported) { + if (name.kind === ts9.SyntaxKind.Identifier) { + return this.#scope.addVariable( + name.text, + name, + blockScoped ? 3 /* Block */ : 1 /* Function */, + exported, + 4 /* Value */ + ); + } + forEachDestructuringIdentifier(name, (declaration) => { + this.#scope.addVariable( + declaration.name.text, + declaration.name, + blockScoped ? 3 /* Block */ : 1 /* Function */, + exported, + 4 /* Value */ + ); + }); + } + #handleConditionalType(node, cb, varCb) { + const savedScope = this.#scope; + const scope = this.#scope = new ConditionalTypeScope(savedScope); + cb(node.checkType); + scope.updateState(1 /* Extends */); + cb(node.extendsType); + scope.updateState(2 /* TrueType */); + cb(node.trueType); + scope.updateState(3 /* FalseType */); + cb(node.falseType); + scope.end(varCb); + this.#scope = savedScope; + } + #handleDeclaration(node, blockScoped, domain) { + if (node.name !== undefined) { + this.#scope.addVariable( + node.name.text, + node.name, + blockScoped ? 3 /* Block */ : 1 /* Function */, + includesModifier( + node.modifiers, + ts9.SyntaxKind.ExportKeyword + ), + domain + ); + } + } + #handleFunctionLikeDeclaration(node, cb, varCb) { + if (ts9.canHaveDecorators(node)) { + ts9.getDecorators(node)?.forEach(cb); + } + const savedScope = this.#scope; + if (node.kind === ts9.SyntaxKind.FunctionDeclaration) { + this.#handleDeclaration(node, false, 4 /* Value */); + } + const scope = this.#scope = node.kind === ts9.SyntaxKind.FunctionExpression && node.name !== undefined ? new FunctionExpressionScope(node.name, savedScope) : new FunctionScope(savedScope); + if (node.name !== undefined) { + cb(node.name); + } + if (node.typeParameters !== undefined) { + node.typeParameters.forEach(cb); + } + node.parameters.forEach(cb); + if (node.type !== undefined) { + cb(node.type); + } + if (node.body !== undefined) { + scope.beginBody(); + cb(node.body); + } + scope.end(varCb); + this.#scope = savedScope; + } + #handleModule(node, next) { + if (node.flags & ts9.NodeFlags.GlobalAugmentation) { + return next( + node, + this.#scope.createOrReuseNamespaceScope("-global", false, true, false) + ); + } + if (node.name.kind === ts9.SyntaxKind.Identifier) { + const exported = isNamespaceExported(node); + this.#scope.addVariable( + node.name.text, + node.name, + 1 /* Function */, + exported, + 1 /* Namespace */ | 4 /* Value */ + ); + const ambient = includesModifier( + node.modifiers, + ts9.SyntaxKind.DeclareKeyword + ); + return next( + node, + this.#scope.createOrReuseNamespaceScope( + node.name.text, + exported, + ambient, + ambient && namespaceHasExportStatement(node) + ) + ); + } + return next( + node, + this.#scope.createOrReuseNamespaceScope( + `"${node.name.text}"`, + false, + true, + namespaceHasExportStatement(node) + ) + ); + } + #handleVariableDeclaration(declarationList) { + const blockScoped = isBlockScopedVariableDeclarationList(declarationList); + const exported = declarationList.parent.kind === ts9.SyntaxKind.VariableStatement && includesModifier( + declarationList.parent.modifiers, + ts9.SyntaxKind.ExportKeyword + ); + for (const declaration of declarationList.declarations) { + this.#handleBindingName(declaration.name, blockScoped, exported); + } + } +}; +function containsExportStatement(block) { + for (const statement of block.statements) { + if (statement.kind === ts9.SyntaxKind.ExportDeclaration || statement.kind === ts9.SyntaxKind.ExportAssignment) { + return true; + } + } + return false; +} +function forEachDestructuringIdentifier(pattern, fn) { + for (const element of pattern.elements) { + if (element.kind !== ts9.SyntaxKind.BindingElement) { + continue; + } + let result; + if (element.name.kind === ts9.SyntaxKind.Identifier) { + result = fn(element); + } else { + result = forEachDestructuringIdentifier(element.name, fn); + } + if (result) { + return result; + } + } +} +function isBlockScopedVariableDeclarationList(declarationList) { + return (declarationList.flags & ts9.NodeFlags.BlockScoped) !== 0; +} +function isNamespaceExported(node) { + return node.parent.kind === ts9.SyntaxKind.ModuleDeclaration || includesModifier(node.modifiers, ts9.SyntaxKind.ExportKeyword); +} +function namespaceHasExportStatement(ns) { + if (ns.body === undefined || ns.body.kind !== ts9.SyntaxKind.ModuleBlock) { + return false; + } + return containsExportStatement(ns.body); +} + +// src/usage/collectVariableUsage.ts +function collectVariableUsage(sourceFile) { + return new UsageWalker().getUsage(sourceFile); +} + +export { AccessKind, DeclarationDomain, UsageDomain, collectVariableUsage, forEachComment, forEachToken, getAccessKind, getCallSignaturesOfType, getPropertyOfType, getWellKnownSymbolPropertyOfType, hasDecorators, hasExpressionInitializer, hasInitializer, hasJSDoc, hasModifiers, hasType, hasTypeArguments, includesModifier, intersectionTypeParts, isAbstractKeyword, isAccessExpression, isAccessibilityModifier, isAccessorDeclaration, isAccessorKeyword, isAnyKeyword, isArrayBindingElement, isArrayBindingOrAssignmentPattern, isAssertKeyword, isAssertsKeyword, isAssignmentKind, isAssignmentPattern, isAsyncKeyword, isAwaitKeyword, isBigIntKeyword, isBigIntLiteralType, isBindingOrAssignmentElementRestIndicator, isBindingOrAssignmentElementTarget, isBindingOrAssignmentPattern, isBindingPattern, isBlockLike, isBooleanKeyword, isBooleanLiteral, isBooleanLiteralType, isClassLikeDeclaration, isClassMemberModifier, isColonToken, isCompilerOptionEnabled, isConditionalType, isConstAssertionExpression, isConstKeyword, isDeclarationName, isDeclarationWithTypeParameterChildren, isDeclarationWithTypeParameters, isDeclareKeyword, isDefaultKeyword, isDestructuringPattern, isDotToken, isEndOfFileToken, isEntityNameExpression, isEntityNameOrEntityNameExpression, isEnumType, isEqualsGreaterThanToken, isEqualsToken, isEvolvingArrayType, isExclamationToken, isExportKeyword, isFalseKeyword, isFalseLiteral, isFalseLiteralType, isFalsyType, isForInOrOfStatement, isFreshableIntrinsicType, isFreshableType, isFunctionLikeDeclaration, isFunctionScopeBoundary, isImportExpression, isImportKeyword, isInKeyword, isIndexType, isIndexedAccessType, isInstantiableType, isIntersectionType, isIntrinsicAnyType, isIntrinsicBigIntType, isIntrinsicBooleanType, isIntrinsicESSymbolType, isIntrinsicErrorType, isIntrinsicNeverType, isIntrinsicNonPrimitiveType, isIntrinsicNullType, isIntrinsicNumberType, isIntrinsicStringType, isIntrinsicType, isIntrinsicUndefinedType, isIntrinsicUnknownType, isIntrinsicVoidType, isIterationStatement, isJSDocComment, isJSDocNamespaceBody, isJSDocNamespaceDeclaration, isJSDocText, isJSDocTypeReferencingNode, isJsonMinusNumericLiteral, isJsonObjectExpression, isJsxAttributeLike, isJsxAttributeValue, isJsxChild, isJsxTagNameExpression, isJsxTagNamePropertyAccess, isLiteralToken, isLiteralType, isModifierFlagSet, isModuleBody, isModuleName, isModuleReference, isNamedDeclarationWithName, isNamedImportBindings, isNamedImportsOrExports, isNamespaceBody, isNamespaceDeclaration, isNeverKeyword, isNodeFlagSet, isNullKeyword, isNullLiteral, isNumberKeyword, isNumberLiteralType, isNumericOrStringLikeLiteral, isNumericPropertyName, isObjectBindingOrAssignmentElement, isObjectBindingOrAssignmentPattern, isObjectFlagSet, isObjectKeyword, isObjectType, isObjectTypeDeclaration, isOutKeyword, isOverrideKeyword, isParameterPropertyModifier, isPrivateKeyword, isPropertyAccessEntityNameExpression, isPropertyNameLiteral, isPropertyReadonlyInType, isProtectedKeyword, isPseudoLiteralToken, isPublicKeyword, isQuestionDotToken, isQuestionToken, isReadonlyKeyword, isSignatureDeclaration, isStaticKeyword, isStrictCompilerOptionEnabled, isStringKeyword, isStringLiteralType, isStringMappingType, isSubstitutionType, isSuperElementAccessExpression, isSuperExpression, isSuperKeyword, isSuperProperty, isSuperPropertyAccessExpression, isSymbolFlagSet, isSymbolKeyword, isSyntaxList, isTemplateLiteralType, isThenableType, isThisExpression, isThisKeyword, isTransientSymbolLinksFlagSet, isTrueKeyword, isTrueLiteral, isTrueLiteralType, isTupleType, isTupleTypeReference, isTypeFlagSet, isTypeOnlyCompatibleAliasDeclaration, isTypeParameter, isTypeReference, isTypeReferenceType, isTypeVariable, isUndefinedKeyword, isUnionOrIntersectionType, isUnionOrIntersectionTypeNode, isUnionType, isUniqueESSymbolType, isUnknownKeyword, isValidPropertyAccess, isVariableLikeDeclaration, isVoidKeyword, symbolHasReadonlyDeclaration, typeIsLiteral, typeParts, unionTypeParts }; diff --git a/node_modules/ts-api-utils/package.json b/node_modules/ts-api-utils/package.json new file mode 100644 index 0000000..fd4816e --- /dev/null +++ b/node_modules/ts-api-utils/package.json @@ -0,0 +1,105 @@ +{ + "name": "ts-api-utils", + "version": "2.0.1", + "description": "Utility functions for working with TypeScript's API. Successor to the wonderful tsutils. 🛠️️", + "repository": { + "type": "git", + "url": "https://github.com/JoshuaKGoldberg/ts-api-utils" + }, + "license": "MIT", + "author": { + "name": "JoshuaKGoldberg", + "email": "npm@joshuakgoldberg.com" + }, + "type": "module", + "exports": { + ".": { + "types": { + "import": "./lib/index.d.ts", + "require": "./lib/index.d.cts" + }, + "import": "./lib/index.js", + "require": "./lib/index.cjs" + } + }, + "main": "./lib/index.js", + "files": [ + "lib/", + "package.json", + "LICENSE.md", + "README.md" + ], + "scripts": { + "build": "tsup src/index.ts && cp lib/index.d.ts lib/index.d.cts", + "docs": "typedoc", + "docs:serve": "npx --yes http-server docs/generated", + "format": "prettier \"**/*\" --ignore-unknown", + "lint": "eslint . --max-warnings 0", + "lint:docs": "typedoc --validation --treatValidationWarningsAsErrors", + "lint:knip": "knip", + "lint:knip:production": "knip --production", + "lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line", + "lint:packages": "pnpm dedupe --check", + "lint:spelling": "cspell \"**\" \".github/**/*\"", + "prepare": "husky", + "should-semantic-release": "should-semantic-release --verbose", + "test": "vitest", + "tsc": "tsc" + }, + "lint-staged": { + "*": "prettier --ignore-unknown --write" + }, + "devDependencies": { + "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", + "@eslint/js": "^9.19.0", + "@phenomnomnominal/tsquery": "^6.1.3", + "@release-it/conventional-changelog": "^10.0.0", + "@types/eslint-plugin-markdown": "^2.0.2", + "@types/node": "^18.19.74", + "@typescript/vfs": "^1.6.0", + "@vitest/coverage-v8": "^2.1.8", + "@vitest/eslint-plugin": "^1.1.25", + "console-fail-test": "^0.5.0", + "cspell": "^8.17.3", + "eslint": "^9.19.0", + "eslint-plugin-jsdoc": "^50.6.3", + "eslint-plugin-jsonc": "^2.19.1", + "eslint-plugin-markdown": "^5.1.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-package-json": "^0.19.0", + "eslint-plugin-perfectionist": "^4.7.0", + "eslint-plugin-regexp": "^2.7.0", + "eslint-plugin-yml": "^1.16.0", + "husky": "^9.1.7", + "jsonc-eslint-parser": "^2.4.0", + "knip": "^5.43.6", + "lint-staged": "^15.4.3", + "markdownlint": "^0.37.4", + "markdownlint-cli": "^0.43.0", + "prettier": "^3.4.2", + "prettier-plugin-curly": "^0.3.1", + "prettier-plugin-packagejson": "^2.5.8", + "release-it": "^18.1.2", + "sentences-per-line": "^0.3.0", + "should-semantic-release": "^0.3.0", + "tsup": "^8.3.6", + "typedoc": "^0.27.6", + "typedoc-plugin-coverage": "^3.4.1", + "typedoc-plugin-custom-validation": "^2.0.2", + "typedoc-plugin-konamimojisplosion": "^0.0.2", + "typedoc-plugin-mdn-links": "^4.0.10", + "typescript": "^5.7.3", + "typescript-eslint": "^8.22.0", + "vitest": "^2.1.8" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + }, + "packageManager": "pnpm@9.15.3", + "engines": { + "node": ">=18.12" + }, + "publishConfig": { + "provenance": true + } +} diff --git a/node_modules/tunnel/package.json b/node_modules/tunnel/package.json index 1c2733d..bcd7b95 100644 --- a/node_modules/tunnel/package.json +++ b/node_modules/tunnel/package.json @@ -1,48 +1,7 @@ { - "_from": "tunnel@^0.0.6", - "_id": "tunnel@0.0.6", - "_inBundle": false, - "_integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "_location": "/tunnel", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "tunnel@^0.0.6", - "name": "tunnel", - "escapedName": "tunnel", - "rawSpec": "^0.0.6", - "saveSpec": null, - "fetchSpec": "^0.0.6" - }, - "_requiredBy": [ - "/@actions/http-client" - ], - "_resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "_shasum": "72f1314b34a5b192db012324df2cc587ca47f92c", - "_spec": "tunnel@^0.0.6", - "_where": "/Users/scubbo/Code/commit-report-sync/node_modules/@actions/http-client", - "author": { - "name": "Koichi Kobayashi", - "email": "koichik@improvement.jp" - }, - "bugs": { - "url": "https://github.com/koichik/node-tunnel/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "tunnel", + "version": "0.0.6", "description": "Node HTTP/HTTPS Agents for tunneling proxies", - "devDependencies": { - "mocha": "^5.2.0", - "should": "^13.2.3" - }, - "directories": { - "lib": "./lib" - }, - "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" - }, - "homepage": "https://github.com/koichik/node-tunnel/", "keywords": [ "http", "https", @@ -50,15 +9,26 @@ "proxy", "tunnel" ], + "homepage": "https://github.com/koichik/node-tunnel/", + "bugs": "https://github.com/koichik/node-tunnel/issues", "license": "MIT", + "author": "Koichi Kobayashi ", "main": "./index.js", - "name": "tunnel", + "directories": { + "lib": "./lib" + }, "repository": { "type": "git", - "url": "git+https://github.com/koichik/node-tunnel.git" + "url": "https://github.com/koichik/node-tunnel.git" }, "scripts": { "test": "mocha" }, - "version": "0.0.6" + "devDependencies": { + "mocha": "^5.2.0", + "should": "^13.2.3" + }, + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } } diff --git a/node_modules/type-check/LICENSE b/node_modules/type-check/LICENSE new file mode 100644 index 0000000..525b118 --- /dev/null +++ b/node_modules/type-check/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) George Zahariev + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/type-check/README.md b/node_modules/type-check/README.md new file mode 100644 index 0000000..b170d67 --- /dev/null +++ b/node_modules/type-check/README.md @@ -0,0 +1,210 @@ +# type-check [![Build Status](https://travis-ci.org/gkz/type-check.png?branch=master)](https://travis-ci.org/gkz/type-check) + + + +`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.4.0. Check out the [demo](http://gkz.github.io/type-check/). + +For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev). + + npm install type-check + +## Quick Examples + +```js +// Basic types: +var typeCheck = require('type-check').typeCheck; +typeCheck('Number', 1); // true +typeCheck('Number', 'str'); // false +typeCheck('Error', new Error); // true +typeCheck('Undefined', undefined); // true + +// Comment +typeCheck('count::Number', 1); // true + +// One type OR another type: +typeCheck('Number | String', 2); // true +typeCheck('Number | String', 'str'); // true + +// Wildcard, matches all types: +typeCheck('*', 2) // true + +// Array, all elements of a single type: +typeCheck('[Number]', [1, 2, 3]); // true +typeCheck('[Number]', [1, 'str', 3]); // false + +// Tuples, or fixed length arrays with elements of different types: +typeCheck('(String, Number)', ['str', 2]); // true +typeCheck('(String, Number)', ['str']); // false +typeCheck('(String, Number)', ['str', 2, 5]); // false + +// Object properties: +typeCheck('{x: Number, y: Boolean}', {x: 2, y: false}); // true +typeCheck('{x: Number, y: Boolean}', {x: 2}); // false +typeCheck('{x: Number, y: Maybe Boolean}', {x: 2}); // true +typeCheck('{x: Number, y: Boolean}', {x: 2, y: false, z: 3}); // false +typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3}); // true + +// A particular type AND object properties: +typeCheck('RegExp{source: String, ...}', /re/i); // true +typeCheck('RegExp{source: String, ...}', {source: 're'}); // false + +// Custom types: +var opt = {customTypes: + {Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}}; +typeCheck('Even', 2, opt); // true + +// Nested: +var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}' +typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true +``` + +Check out the [type syntax format](#syntax) and [guide](#guide). + +## Usage + +`require('type-check');` returns an object that exposes four properties. `VERSION` is the current version of the library as a string. `typeCheck`, `parseType`, and `parsedTypeCheck` are functions. + +```js +// typeCheck(type, input, options); +typeCheck('Number', 2); // true + +// parseType(type); +var parsedType = parseType('Number'); // object + +// parsedTypeCheck(parsedType, input, options); +parsedTypeCheck(parsedType, 2); // true +``` + +### typeCheck(type, input, options) + +`typeCheck` checks a JavaScript value `input` against `type` written in the [type format](#type-format) (and taking account the optional `options`) and returns whether the `input` matches the `type`. + +##### arguments +* type - `String` - the type written in the [type format](#type-format) which to check against +* input - `*` - any JavaScript value, which is to be checked against the type +* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) + +##### returns +`Boolean` - whether the input matches the type + +##### example +```js +typeCheck('Number', 2); // true +``` + +### parseType(type) + +`parseType` parses string `type` written in the [type format](#type-format) into an object representing the parsed type. + +##### arguments +* type - `String` - the type written in the [type format](#type-format) which to parse + +##### returns +`Object` - an object in the parsed type format representing the parsed type + +##### example +```js +parseType('Number'); // [{type: 'Number'}] +``` +### parsedTypeCheck(parsedType, input, options) + +`parsedTypeCheck` checks a JavaScript value `input` against parsed `type` in the parsed type format (and taking account the optional `options`) and returns whether the `input` matches the `type`. Use this in conjunction with `parseType` if you are going to use a type more than once. + +##### arguments +* type - `Object` - the type in the parsed type format which to check against +* input - `*` - any JavaScript value, which is to be checked against the type +* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) + +##### returns +`Boolean` - whether the input matches the type + +##### example +```js +parsedTypeCheck([{type: 'Number'}], 2); // true +var parsedType = parseType('String'); +parsedTypeCheck(parsedType, 'str'); // true +``` + + +## Type Format + +### Syntax + +White space is ignored. The root node is a __Types__. + +* __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String` +* __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*` +* __Types__ = optionally a comment (an `Identifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String` +* __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]` +* __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}` +* __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean` +* __Tuple__ = a `(`, followed by one or more `Types` separated by a comma `,` (trailing comma `,` is permitted), followed by a `)` - eg `(Date)`, `(Number, Date)` +* __Array__ = a `[` followed by exactly one `Types` followed by a `]` - eg. `[Boolean]`, `[Boolean | Null]` + +### Guide + +`type-check` uses `Object.toString` to find out the basic type of a value. Specifically, + +```js +{}.toString.call(VALUE).slice(8, -1) +{}.toString.call(true).slice(8, -1) // 'Boolean' +``` +A basic type, eg. `Number`, uses this check. This is much more versatile than using `typeof` - for example, with `document`, `typeof` produces `'object'` which isn't that useful, and our technique produces `'HTMLDocument'`. + +You may check for multiple types by separating types with a `|`. The checker proceeds from left to right, and passes if the value is any of the types - eg. `String | Boolean` first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false. + +Adding a `Maybe` in front of a list of multiple types is the same as also checking for `Null` and `Undefined` - eg. `Maybe String` is equivalent to `Undefined | Null | String`. + +You may add a comment to remind you of what the type is for by following an identifier with a `::` before a type (or multiple types). The comment is simply thrown out. + +The wildcard `*` matches all types. + +There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'. + +If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of `Object` and the properties pass - this allows for duck typing - eg. `{x: Boolean}`. + +To check if the properties pass, and the value is of a certain type, you can specify the type - eg. `Error{message: String}`. + +If you want to make a field optional, you can simply use `Maybe` - eg. `{x: Boolean, y: Maybe String}` will still pass if `y` is undefined (or null). + +If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator `...` - eg. `{x: Boolean, ...}` will match an object with an `x` property that is a boolean, and with zero or more other properties. + +For an array, you must specify one or more types (separated by `|`) - it will pass for something of any length as long as each element passes the types provided - eg. `[Number]`, `[Number | String]`. + +A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. `(String, Number)`. + +An array and tuple structure check that the value is of type `Array` by default, but if another type is specified, they will check for that instead - eg. `Int32Array[Number]`. You can use the wildcard `*` to search for any type at all. + +Check out the [type precedence](https://github.com/zaboco/type-precedence) library for type-check. + +## Options + +Options is an object. It is an optional parameter to the `typeCheck` and `parsedTypeCheck` functions. The only current option is `customTypes`. + + +### Custom Types + +__Example:__ + +```js +var options = { + customTypes: { + Even: { + typeOf: 'Number', + validate: function(x) { + return x % 2 === 0; + } + } + } +}; +typeCheck('Even', 2, options); // true +typeCheck('Even', 3, options); // false +``` + +`customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function. + +The `typeOf` property is the type the value should be (optional - if not set only `validate` will be used), and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking. + +## Technical About + +`type-check` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/type-check/lib/check.js b/node_modules/type-check/lib/check.js new file mode 100644 index 0000000..f78687e --- /dev/null +++ b/node_modules/type-check/lib/check.js @@ -0,0 +1,128 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var ref$, any, all, isItNaN, types, defaultType, toString$ = {}.toString; + ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN; + types = { + Number: { + typeOf: 'Number', + validate: function(it){ + return !isItNaN(it); + } + }, + NaN: { + typeOf: 'Number', + validate: isItNaN + }, + Int: { + typeOf: 'Number', + validate: function(it){ + return !isItNaN(it) && it % 1 === 0; + } + }, + Float: { + typeOf: 'Number', + validate: function(it){ + return !isItNaN(it); + } + }, + Date: { + typeOf: 'Date', + validate: function(it){ + return !isItNaN(it.getTime()); + } + } + }; + defaultType = { + array: 'Array', + tuple: 'Array' + }; + function checkArray(input, type, options){ + return all(function(it){ + return checkMultiple(it, type.of, options); + }, input); + } + function checkTuple(input, type, options){ + var i, i$, ref$, len$, types; + i = 0; + for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { + types = ref$[i$]; + if (!checkMultiple(input[i], types, options)) { + return false; + } + i++; + } + return input.length <= i; + } + function checkFields(input, type, options){ + var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types; + inputKeys = {}; + numInputKeys = 0; + for (k in input) { + inputKeys[k] = true; + numInputKeys++; + } + numOfKeys = 0; + for (key in ref$ = type.of) { + types = ref$[key]; + if (!checkMultiple(input[key], types, options)) { + return false; + } + if (inputKeys[key]) { + numOfKeys++; + } + } + return type.subset || numInputKeys === numOfKeys; + } + function checkStructure(input, type, options){ + if (!(input instanceof Object)) { + return false; + } + switch (type.structure) { + case 'fields': + return checkFields(input, type, options); + case 'array': + return checkArray(input, type, options); + case 'tuple': + return checkTuple(input, type, options); + } + } + function check(input, typeObj, options){ + var type, structure, setting, that; + type = typeObj.type, structure = typeObj.structure; + if (type) { + if (type === '*') { + return true; + } + setting = options.customTypes[type] || types[type]; + if (setting) { + return (setting.typeOf === void 8 || setting.typeOf === toString$.call(input).slice(8, -1)) && setting.validate(input); + } else { + return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj, options)); + } + } else if (structure) { + if (that = defaultType[structure]) { + if (that !== toString$.call(input).slice(8, -1)) { + return false; + } + } + return checkStructure(input, typeObj, options); + } else { + throw new Error("No type defined. Input: " + input + "."); + } + } + function checkMultiple(input, types, options){ + if (toString$.call(types).slice(8, -1) !== 'Array') { + throw new Error("Types must be in an array. Input: " + input + "."); + } + return any(function(it){ + return check(input, it, options); + }, types); + } + module.exports = function(parsedType, input, options){ + options == null && (options = {}); + if (options.customTypes == null) { + options.customTypes = {}; + } + return checkMultiple(input, parsedType, options); + }; +}).call(this); diff --git a/node_modules/type-check/lib/index.js b/node_modules/type-check/lib/index.js new file mode 100644 index 0000000..09db4cb --- /dev/null +++ b/node_modules/type-check/lib/index.js @@ -0,0 +1,16 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var VERSION, parseType, parsedTypeCheck, typeCheck; + VERSION = '0.4.0'; + parseType = require('./parse-type'); + parsedTypeCheck = require('./check'); + typeCheck = function(type, input, options){ + return parsedTypeCheck(parseType(type), input, options); + }; + module.exports = { + VERSION: VERSION, + typeCheck: typeCheck, + parsedTypeCheck: parsedTypeCheck, + parseType: parseType + }; +}).call(this); diff --git a/node_modules/type-check/lib/parse-type.js b/node_modules/type-check/lib/parse-type.js new file mode 100644 index 0000000..c360c97 --- /dev/null +++ b/node_modules/type-check/lib/parse-type.js @@ -0,0 +1,198 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var identifierRegex, tokenRegex; + identifierRegex = /[\$\w]+/; + function peek(tokens){ + var token; + token = tokens[0]; + if (token == null) { + throw new Error('Unexpected end of input.'); + } + return token; + } + function consumeIdent(tokens){ + var token; + token = peek(tokens); + if (!identifierRegex.test(token)) { + throw new Error("Expected text, got '" + token + "' instead."); + } + return tokens.shift(); + } + function consumeOp(tokens, op){ + var token; + token = peek(tokens); + if (token !== op) { + throw new Error("Expected '" + op + "', got '" + token + "' instead."); + } + return tokens.shift(); + } + function maybeConsumeOp(tokens, op){ + var token; + token = tokens[0]; + if (token === op) { + return tokens.shift(); + } else { + return null; + } + } + function consumeArray(tokens){ + var types; + consumeOp(tokens, '['); + if (peek(tokens) === ']') { + throw new Error("Must specify type of Array - eg. [Type], got [] instead."); + } + types = consumeTypes(tokens); + consumeOp(tokens, ']'); + return { + structure: 'array', + of: types + }; + } + function consumeTuple(tokens){ + var components; + components = []; + consumeOp(tokens, '('); + if (peek(tokens) === ')') { + throw new Error("Tuple must be of at least length 1 - eg. (Type), got () instead."); + } + for (;;) { + components.push(consumeTypes(tokens)); + maybeConsumeOp(tokens, ','); + if (')' === peek(tokens)) { + break; + } + } + consumeOp(tokens, ')'); + return { + structure: 'tuple', + of: components + }; + } + function consumeFields(tokens){ + var fields, subset, ref$, key, types; + fields = {}; + consumeOp(tokens, '{'); + subset = false; + for (;;) { + if (maybeConsumeOp(tokens, '...')) { + subset = true; + break; + } + ref$ = consumeField(tokens), key = ref$[0], types = ref$[1]; + fields[key] = types; + maybeConsumeOp(tokens, ','); + if ('}' === peek(tokens)) { + break; + } + } + consumeOp(tokens, '}'); + return { + structure: 'fields', + of: fields, + subset: subset + }; + } + function consumeField(tokens){ + var key, types; + key = consumeIdent(tokens); + consumeOp(tokens, ':'); + types = consumeTypes(tokens); + return [key, types]; + } + function maybeConsumeStructure(tokens){ + switch (tokens[0]) { + case '[': + return consumeArray(tokens); + case '(': + return consumeTuple(tokens); + case '{': + return consumeFields(tokens); + } + } + function consumeType(tokens){ + var token, wildcard, type, structure; + token = peek(tokens); + wildcard = token === '*'; + if (wildcard || identifierRegex.test(token)) { + type = wildcard + ? consumeOp(tokens, '*') + : consumeIdent(tokens); + structure = maybeConsumeStructure(tokens); + if (structure) { + return structure.type = type, structure; + } else { + return { + type: type + }; + } + } else { + structure = maybeConsumeStructure(tokens); + if (!structure) { + throw new Error("Unexpected character: " + token); + } + return structure; + } + } + function consumeTypes(tokens){ + var lookahead, types, typesSoFar, typeObj, type, structure; + if ('::' === peek(tokens)) { + throw new Error("No comment before comment separator '::' found."); + } + lookahead = tokens[1]; + if (lookahead != null && lookahead === '::') { + tokens.shift(); + tokens.shift(); + } + types = []; + typesSoFar = {}; + if ('Maybe' === peek(tokens)) { + tokens.shift(); + types = [ + { + type: 'Undefined' + }, { + type: 'Null' + } + ]; + typesSoFar = { + Undefined: true, + Null: true + }; + } + for (;;) { + typeObj = consumeType(tokens), type = typeObj.type, structure = typeObj.structure; + if (!typesSoFar[type]) { + types.push(typeObj); + } + if (structure == null) { + typesSoFar[type] = true; + } + if (!maybeConsumeOp(tokens, '|')) { + break; + } + } + return types; + } + tokenRegex = RegExp('\\.\\.\\.|::|->|' + identifierRegex.source + '|\\S', 'g'); + module.exports = function(input){ + var tokens, e; + if (!input.length) { + throw new Error('No type specified.'); + } + tokens = input.match(tokenRegex) || []; + if (in$('->', tokens)) { + throw new Error("Function types are not supported.\ To validate that something is a function, you may use 'Function'."); + } + try { + return consumeTypes(tokens); + } catch (e$) { + e = e$; + throw new Error(e.message + " - Remaining tokens: " + JSON.stringify(tokens) + " - Initial input: '" + input + "'"); + } + }; + function in$(x, xs){ + var i = -1, l = xs.length >>> 0; + while (++i < l) if (x === xs[i]) return true; + return false; + } +}).call(this); diff --git a/node_modules/type-check/package.json b/node_modules/type-check/package.json new file mode 100644 index 0000000..2a57ea0 --- /dev/null +++ b/node_modules/type-check/package.json @@ -0,0 +1,39 @@ +{ + "name": "type-check", + "version": "0.4.0", + "author": "George Zahariev ", + "description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.", + "homepage": "https://github.com/gkz/type-check", + "keywords": [ + "type", + "check", + "checking", + "library" + ], + "files": [ + "lib", + "README.md", + "LICENSE" + ], + "main": "./lib/", + "bugs": "https://github.com/gkz/type-check/issues", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + }, + "repository": { + "type": "git", + "url": "git://github.com/gkz/type-check.git" + }, + "scripts": { + "test": "make test" + }, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1", + "browserify": "^16.5.1" + } +} diff --git a/node_modules/typescript-eslint/LICENSE b/node_modules/typescript-eslint/LICENSE new file mode 100644 index 0000000..a116410 --- /dev/null +++ b/node_modules/typescript-eslint/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/typescript-eslint/README.md b/node_modules/typescript-eslint/README.md new file mode 100644 index 0000000..3c078ea --- /dev/null +++ b/node_modules/typescript-eslint/README.md @@ -0,0 +1,12 @@ +# `typescript-eslint` + +> Tooling which enables you to use TypeScript with ESLint + +[![NPM Version](https://img.shields.io/npm/v/typescript-eslint.svg?style=flat-square)](https://www.npmjs.com/package/typescript-eslint) +[![NPM Downloads](https://img.shields.io/npm/dm/typescript-eslint.svg?style=flat-square)](https://www.npmjs.com/package/typescript-eslint) + +👉 See **https://typescript-eslint.io/packages/typescript-eslint** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/node_modules/typescript-eslint/dist/config-helper.d.ts.map b/node_modules/typescript-eslint/dist/config-helper.d.ts.map new file mode 100644 index 0000000..ae33009 --- /dev/null +++ b/node_modules/typescript-eslint/dist/config-helper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"config-helper.d.ts","sourceRoot":"","sources":["../src/config-helper.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,MAAM,8BAA8B,GACtC,iBAAiB,GACjB,8BAA8B,EAAE,CAAC;AAErC,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CAAC,UAAU,CAAC,MAAM;IACnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;CAC5C;AAGD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACpB,GAAG,OAAO,EAAE,8BAA8B,EAAE,GAC3C,WAAW,CAkDb"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/config-helper.js b/node_modules/typescript-eslint/dist/config-helper.js new file mode 100644 index 0000000..207d2a8 --- /dev/null +++ b/node_modules/typescript-eslint/dist/config-helper.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.config = config; +/** + * Utility function to make it easy to strictly type your "Flat" config file + * @example + * ```js + * // @ts-check + * + * import eslint from '@eslint/js'; + * import tseslint from 'typescript-eslint'; + * + * export default tseslint.config( + * eslint.configs.recommended, + * tseslint.configs.recommended, + * { + * rules: { + * '@typescript-eslint/array-type': 'error', + * }, + * }, + * ); + * ``` + */ +function config(...configs) { + const flattened = + // @ts-expect-error -- intentionally an infinite type + configs.flat(Infinity); + return flattened.flatMap((configWithExtends, configIndex) => { + const { extends: extendsArr, ...config } = configWithExtends; + if (extendsArr == null || extendsArr.length === 0) { + return config; + } + const extendsArrFlattened = extendsArr.flat(Infinity); + const undefinedExtensions = extendsArrFlattened.reduce((acc, extension, extensionIndex) => { + const maybeExtension = extension; + if (maybeExtension == null) { + acc.push(extensionIndex); + } + return acc; + }, []); + if (undefinedExtensions.length) { + const configName = configWithExtends.name != null + ? `, named "${configWithExtends.name}",` + : ' (anonymous)'; + const extensionIndices = undefinedExtensions.join(', '); + throw new Error(`Your config at index ${configIndex}${configName} contains undefined` + + ` extensions at the following indices: ${extensionIndices}.`); + } + return [ + ...extendsArrFlattened.map(extension => { + const name = [config.name, extension.name].filter(Boolean).join('__'); + return { + ...extension, + ...(config.files && { files: config.files }), + ...(config.ignores && { ignores: config.ignores }), + ...(name && { name }), + }; + }), + config, + ]; + }); +} diff --git a/node_modules/typescript-eslint/dist/configs/all.d.ts.map b/node_modules/typescript-eslint/dist/configs/all.d.ts.map new file mode 100644 index 0000000..716f6a3 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/all.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../src/configs/all.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBAiKE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/all.js b/node_modules/typescript-eslint/dist/configs/all.js new file mode 100644 index 0000000..55308a2 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/all.js @@ -0,0 +1,175 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured. + * @see {@link https://typescript-eslint.io/users/configs#all} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/all', + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/ban-ts-comment': 'error', + '@typescript-eslint/ban-tslint-comment': 'error', + '@typescript-eslint/class-literal-property-style': 'error', + 'class-methods-use-this': 'off', + '@typescript-eslint/class-methods-use-this': 'error', + '@typescript-eslint/consistent-generic-constructors': 'error', + '@typescript-eslint/consistent-indexed-object-style': 'error', + 'consistent-return': 'off', + '@typescript-eslint/consistent-return': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/consistent-type-exports': 'error', + '@typescript-eslint/consistent-type-imports': 'error', + 'default-param-last': 'off', + '@typescript-eslint/default-param-last': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/explicit-function-return-type': 'error', + '@typescript-eslint/explicit-member-accessibility': 'error', + '@typescript-eslint/explicit-module-boundary-types': 'error', + 'init-declarations': 'off', + '@typescript-eslint/init-declarations': 'error', + 'max-params': 'off', + '@typescript-eslint/max-params': 'error', + '@typescript-eslint/member-ordering': 'error', + '@typescript-eslint/method-signature-style': 'error', + '@typescript-eslint/naming-convention': 'error', + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', + '@typescript-eslint/no-confusing-void-expression': 'error', + '@typescript-eslint/no-deprecated': 'error', + 'no-dupe-class-members': 'off', + '@typescript-eslint/no-dupe-class-members': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-dynamic-delete': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-extraneous-class': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-import-type-side-effects': 'error', + '@typescript-eslint/no-inferrable-types': 'error', + 'no-invalid-this': 'off', + '@typescript-eslint/no-invalid-this': 'error', + '@typescript-eslint/no-invalid-void-type': 'error', + 'no-loop-func': 'off', + '@typescript-eslint/no-loop-func': 'error', + 'no-magic-numbers': 'off', + '@typescript-eslint/no-magic-numbers': 'error', + '@typescript-eslint/no-meaningless-void-operator': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-misused-spread': 'error', + '@typescript-eslint/no-mixed-enums': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'error', + 'no-redeclare': 'off', + '@typescript-eslint/no-redeclare': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-require-imports': 'error', + 'no-restricted-imports': 'off', + '@typescript-eslint/no-restricted-imports': 'error', + '@typescript-eslint/no-restricted-types': 'error', + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-parameter-property-assignment': 'error', + '@typescript-eslint/no-unnecessary-qualifier': 'error', + '@typescript-eslint/no-unnecessary-template-expression': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unnecessary-type-parameters': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-type-assertion': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'error', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/no-useless-empty-export': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + '@typescript-eslint/parameter-properties': 'error', + '@typescript-eslint/prefer-as-const': 'error', + 'prefer-destructuring': 'off', + '@typescript-eslint/prefer-destructuring': 'error', + '@typescript-eslint/prefer-enum-initializers': 'error', + '@typescript-eslint/prefer-find': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/prefer-nullish-coalescing': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + '@typescript-eslint/prefer-readonly': 'error', + '@typescript-eslint/prefer-readonly-parameter-types': 'error', + '@typescript-eslint/prefer-reduce-type-parameter': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-return-this-type': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'error', + '@typescript-eslint/promise-function-async': 'error', + '@typescript-eslint/related-getter-setter-pairs': 'error', + '@typescript-eslint/require-array-sort-compare': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + 'no-return-await': 'off', + '@typescript-eslint/return-await': 'error', + '@typescript-eslint/strict-boolean-expressions': 'error', + '@typescript-eslint/switch-exhaustiveness-check': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/typedef': 'error', + '@typescript-eslint/unbound-method': 'error', + '@typescript-eslint/unified-signatures': 'error', + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/base.d.ts.map b/node_modules/typescript-eslint/dist/configs/base.d.ts.map new file mode 100644 index 0000000..f347a6b --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/base.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAErE;;;;GAIG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,MAAM;AAHpB,wBAYG"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/base.js b/node_modules/typescript-eslint/dist/configs/base.js new file mode 100644 index 0000000..b9e6cbd --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/base.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint. + * We don't recommend using this directly; instead, extend from an earlier recommended rule. + * @see {@link https://typescript-eslint.io/users/configs#base} + */ +exports.default = (plugin, parser) => ({ + name: 'typescript-eslint/base', + languageOptions: { + parser, + sourceType: 'module', + }, + plugins: { + '@typescript-eslint': plugin, + }, +}); diff --git a/node_modules/typescript-eslint/dist/configs/disable-type-checked.d.ts.map b/node_modules/typescript-eslint/dist/configs/disable-type-checked.d.ts.map new file mode 100644 index 0000000..b4c31ad --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/disable-type-checked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"disable-type-checked.d.ts","sourceRoot":"","sources":["../../src/configs/disable-type-checked.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAErE;;;GAGG;yBAED,SAAS,UAAU,CAAC,MAAM,EAC1B,SAAS,UAAU,CAAC,MAAM,KACzB,UAAU,CAAC,MAAM;AAHpB,wBAoEG"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/disable-type-checked.js b/node_modules/typescript-eslint/dist/configs/disable-type-checked.js new file mode 100644 index 0000000..ae7e632 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/disable-type-checked.js @@ -0,0 +1,78 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * A utility ruleset that will disable type-aware linting and all type-aware rules available in our project. + * @see {@link https://typescript-eslint.io/users/configs#disable-type-checked} + */ +exports.default = (_plugin, _parser) => ({ + name: 'typescript-eslint/disable-type-checked', + rules: { + '@typescript-eslint/await-thenable': 'off', + '@typescript-eslint/consistent-return': 'off', + '@typescript-eslint/consistent-type-exports': 'off', + '@typescript-eslint/dot-notation': 'off', + '@typescript-eslint/naming-convention': 'off', + '@typescript-eslint/no-array-delete': 'off', + '@typescript-eslint/no-base-to-string': 'off', + '@typescript-eslint/no-confusing-void-expression': 'off', + '@typescript-eslint/no-deprecated': 'off', + '@typescript-eslint/no-duplicate-type-constituents': 'off', + '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/no-for-in-array': 'off', + '@typescript-eslint/no-implied-eval': 'off', + '@typescript-eslint/no-meaningless-void-operator': 'off', + '@typescript-eslint/no-misused-promises': 'off', + '@typescript-eslint/no-misused-spread': 'off', + '@typescript-eslint/no-mixed-enums': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'off', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', + '@typescript-eslint/no-unnecessary-condition': 'off', + '@typescript-eslint/no-unnecessary-qualifier': 'off', + '@typescript-eslint/no-unnecessary-template-expression': 'off', + '@typescript-eslint/no-unnecessary-type-arguments': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'off', + '@typescript-eslint/no-unnecessary-type-parameters': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-enum-comparison': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-type-assertion': 'off', + '@typescript-eslint/no-unsafe-unary-minus': 'off', + '@typescript-eslint/non-nullable-type-assertion-style': 'off', + '@typescript-eslint/only-throw-error': 'off', + '@typescript-eslint/prefer-destructuring': 'off', + '@typescript-eslint/prefer-find': 'off', + '@typescript-eslint/prefer-includes': 'off', + '@typescript-eslint/prefer-nullish-coalescing': 'off', + '@typescript-eslint/prefer-optional-chain': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-readonly': 'off', + '@typescript-eslint/prefer-readonly-parameter-types': 'off', + '@typescript-eslint/prefer-reduce-type-parameter': 'off', + '@typescript-eslint/prefer-regexp-exec': 'off', + '@typescript-eslint/prefer-return-this-type': 'off', + '@typescript-eslint/prefer-string-starts-ends-with': 'off', + '@typescript-eslint/promise-function-async': 'off', + '@typescript-eslint/related-getter-setter-pairs': 'off', + '@typescript-eslint/require-array-sort-compare': 'off', + '@typescript-eslint/require-await': 'off', + '@typescript-eslint/restrict-plus-operands': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/return-await': 'off', + '@typescript-eslint/strict-boolean-expressions': 'off', + '@typescript-eslint/switch-exhaustiveness-check': 'off', + '@typescript-eslint/unbound-method': 'off', + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'off', + }, + languageOptions: { + parserOptions: { program: null, project: false, projectService: false }, + }, +}); diff --git a/node_modules/typescript-eslint/dist/configs/eslint-recommended.d.ts.map b/node_modules/typescript-eslint/dist/configs/eslint-recommended.d.ts.map new file mode 100644 index 0000000..0cce601 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/eslint-recommended.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eslint-recommended.d.ts","sourceRoot":"","sources":["../../src/configs/eslint-recommended.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAIrE;;;;;GAKG;yBAED,SAAS,UAAU,CAAC,MAAM,EAC1B,SAAS,UAAU,CAAC,MAAM,KACzB,UAAU,CAAC,MAAM;AAHpB,wBAMG"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/eslint-recommended.js b/node_modules/typescript-eslint/dist/configs/eslint-recommended.js new file mode 100644 index 0000000..1605d04 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/eslint-recommended.js @@ -0,0 +1,16 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const eslint_recommended_raw_1 = __importDefault(require("@typescript-eslint/eslint-plugin/use-at-your-own-risk/eslint-recommended-raw")); +/** + * This is a compatibility ruleset that: + * - disables rules from eslint:recommended which are already handled by TypeScript. + * - enables rules that make sense due to TS's typechecking / transpilation. + * @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended} + */ +exports.default = (_plugin, _parser) => ({ + ...(0, eslint_recommended_raw_1.default)('minimatch'), + name: 'typescript-eslint/eslint-recommended', +}); diff --git a/node_modules/typescript-eslint/dist/configs/recommended-type-checked-only.d.ts.map b/node_modules/typescript-eslint/dist/configs/recommended-type-checked-only.d.ts.map new file mode 100644 index 0000000..16e0737 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/recommended-type-checked-only.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recommended-type-checked-only.d.ts","sourceRoot":"","sources":["../../src/configs/recommended-type-checked-only.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBAsCE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/recommended-type-checked-only.js b/node_modules/typescript-eslint/dist/configs/recommended-type-checked-only.js new file mode 100644 index 0000000..4e847b9 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/recommended-type-checked-only.js @@ -0,0 +1,53 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules. + * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked-only} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/recommended-type-checked-only', + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + '@typescript-eslint/unbound-method': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/recommended-type-checked.d.ts.map b/node_modules/typescript-eslint/dist/configs/recommended-type-checked.d.ts.map new file mode 100644 index 0000000..8ca3a38 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/recommended-type-checked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recommended-type-checked.d.ts","sourceRoot":"","sources":["../../src/configs/recommended-type-checked.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBA6DE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/recommended-type-checked.js b/node_modules/typescript-eslint/dist/configs/recommended-type-checked.js new file mode 100644 index 0000000..fee6ff7 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/recommended-type-checked.js @@ -0,0 +1,76 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * Contains all of `recommended` along with additional recommended rules that require type information. + * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/recommended-type-checked', + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/ban-ts-comment': 'error', + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/unbound-method': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/recommended.d.ts.map b/node_modules/typescript-eslint/dist/configs/recommended.d.ts.map new file mode 100644 index 0000000..051a031 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/recommended.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBAkCE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/recommended.js b/node_modules/typescript-eslint/dist/configs/recommended.js new file mode 100644 index 0000000..9977b3e --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/recommended.js @@ -0,0 +1,49 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * Recommended rules for code correctness that you can drop in without additional configuration. + * @see {@link https://typescript-eslint.io/users/configs#recommended} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/recommended', + rules: { + '@typescript-eslint/ban-ts-comment': 'error', + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/strict-type-checked-only.d.ts.map b/node_modules/typescript-eslint/dist/configs/strict-type-checked-only.d.ts.map new file mode 100644 index 0000000..d611262 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/strict-type-checked-only.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strict-type-checked-only.d.ts","sourceRoot":"","sources":["../../src/configs/strict-type-checked-only.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBA4EE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/strict-type-checked-only.js b/node_modules/typescript-eslint/dist/configs/strict-type-checked-only.js new file mode 100644 index 0000000..89e8ff2 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/strict-type-checked-only.js @@ -0,0 +1,91 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules. + * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked-only} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/strict-type-checked-only', + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-confusing-void-expression': 'error', + '@typescript-eslint/no-deprecated': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-meaningless-void-operator': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-misused-spread': 'error', + '@typescript-eslint/no-mixed-enums': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-template-expression': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-parameters': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + '@typescript-eslint/prefer-reduce-type-parameter': 'error', + '@typescript-eslint/prefer-return-this-type': 'error', + '@typescript-eslint/related-getter-setter-pairs': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': [ + 'error', + { + allowAny: false, + allowBoolean: false, + allowNullish: false, + allowNumberAndString: false, + allowRegExp: false, + }, + ], + '@typescript-eslint/restrict-template-expressions': [ + 'error', + { + allowAny: false, + allowBoolean: false, + allowNever: false, + allowNullish: false, + allowNumber: false, + allowRegExp: false, + }, + ], + 'no-return-await': 'off', + '@typescript-eslint/return-await': [ + 'error', + 'error-handling-correctness-only', + ], + '@typescript-eslint/unbound-method': 'error', + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/strict-type-checked.d.ts.map b/node_modules/typescript-eslint/dist/configs/strict-type-checked.d.ts.map new file mode 100644 index 0000000..00c38a3 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/strict-type-checked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strict-type-checked.d.ts","sourceRoot":"","sources":["../../src/configs/strict-type-checked.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBA+GE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/strict-type-checked.js b/node_modules/typescript-eslint/dist/configs/strict-type-checked.js new file mode 100644 index 0000000..fdee6fc --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/strict-type-checked.js @@ -0,0 +1,126 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information. + * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/strict-type-checked', + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/ban-ts-comment': [ + 'error', + { minimumDescriptionLength: 10 }, + ], + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-array-delete': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-confusing-void-expression': 'error', + '@typescript-eslint/no-deprecated': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', + '@typescript-eslint/no-dynamic-delete': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-extraneous-class': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + 'no-implied-eval': 'off', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-invalid-void-type': 'error', + '@typescript-eslint/no-meaningless-void-operator': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-misused-spread': 'error', + '@typescript-eslint/no-mixed-enums': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'error', + '@typescript-eslint/no-redundant-type-constituents': 'error', + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-template-expression': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unnecessary-type-parameters': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', + '@typescript-eslint/prefer-reduce-type-parameter': 'error', + '@typescript-eslint/prefer-return-this-type': 'error', + '@typescript-eslint/related-getter-setter-pairs': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': [ + 'error', + { + allowAny: false, + allowBoolean: false, + allowNullish: false, + allowNumberAndString: false, + allowRegExp: false, + }, + ], + '@typescript-eslint/restrict-template-expressions': [ + 'error', + { + allowAny: false, + allowBoolean: false, + allowNever: false, + allowNullish: false, + allowNumber: false, + allowRegExp: false, + }, + ], + 'no-return-await': 'off', + '@typescript-eslint/return-await': [ + 'error', + 'error-handling-correctness-only', + ], + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/unbound-method': 'error', + '@typescript-eslint/unified-signatures': 'error', + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/strict.d.ts.map b/node_modules/typescript-eslint/dist/configs/strict.d.ts.map new file mode 100644 index 0000000..4d1adc1 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/strict.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strict.d.ts","sourceRoot":"","sources":["../../src/configs/strict.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBA8CE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/strict.js b/node_modules/typescript-eslint/dist/configs/strict.js new file mode 100644 index 0000000..0f6ef3a --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/strict.js @@ -0,0 +1,61 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * Contains all of `recommended`, as well as additional strict rules that can also catch bugs. + * @see {@link https://typescript-eslint.io/users/configs#strict} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/strict', + rules: { + '@typescript-eslint/ban-ts-comment': [ + 'error', + { minimumDescriptionLength: 10 }, + ], + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-duplicate-enum-values': 'error', + '@typescript-eslint/no-dynamic-delete': 'error', + '@typescript-eslint/no-empty-object-type': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-extraneous-class': 'error', + '@typescript-eslint/no-invalid-void-type': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'error', + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-function-type': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/no-wrapper-object-types': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/unified-signatures': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/stylistic-type-checked-only.d.ts.map b/node_modules/typescript-eslint/dist/configs/stylistic-type-checked-only.d.ts.map new file mode 100644 index 0000000..905f695 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/stylistic-type-checked-only.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stylistic-type-checked-only.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic-type-checked-only.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBAoBE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/stylistic-type-checked-only.js b/node_modules/typescript-eslint/dist/configs/stylistic-type-checked-only.js new file mode 100644 index 0000000..a0c9d68 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/stylistic-type-checked-only.js @@ -0,0 +1,35 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * A version of `stylistic` that only contains type-checked rules and disables of any corresponding core ESLint rules. + * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked-only} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/stylistic-type-checked-only', + rules: { + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-find': 'error', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-nullish-coalescing': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/stylistic-type-checked.d.ts.map b/node_modules/typescript-eslint/dist/configs/stylistic-type-checked.d.ts.map new file mode 100644 index 0000000..cae47cc --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/stylistic-type-checked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stylistic-type-checked.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic-type-checked.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBAkCE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/stylistic-type-checked.js b/node_modules/typescript-eslint/dist/configs/stylistic-type-checked.js new file mode 100644 index 0000000..86da57e --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/stylistic-type-checked.js @@ -0,0 +1,49 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * Contains all of `stylistic`, along with additional stylistic rules that require type information. + * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/stylistic-type-checked', + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/ban-tslint-comment': 'error', + '@typescript-eslint/class-literal-property-style': 'error', + '@typescript-eslint/consistent-generic-constructors': 'error', + '@typescript-eslint/consistent-indexed-object-style': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-inferrable-types': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-find': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-nullish-coalescing': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/configs/stylistic.d.ts.map b/node_modules/typescript-eslint/dist/configs/stylistic.d.ts.map new file mode 100644 index 0000000..16b9446 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/stylistic.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stylistic.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAKrE;;;GAGG;yBAED,QAAQ,UAAU,CAAC,MAAM,EACzB,QAAQ,UAAU,CAAC,MAAM,KACxB,UAAU,CAAC,WAAW;AAHzB,wBAyBE"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/configs/stylistic.js b/node_modules/typescript-eslint/dist/configs/stylistic.js new file mode 100644 index 0000000..020fa87 --- /dev/null +++ b/node_modules/typescript-eslint/dist/configs/stylistic.js @@ -0,0 +1,40 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/users/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const base_1 = __importDefault(require("./base")); +const eslint_recommended_1 = __importDefault(require("./eslint-recommended")); +/** + * Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic. + * @see {@link https://typescript-eslint.io/users/configs#stylistic} + */ +exports.default = (plugin, parser) => [ + (0, base_1.default)(plugin, parser), + (0, eslint_recommended_1.default)(plugin, parser), + { + name: 'typescript-eslint/stylistic', + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/ban-tslint-comment': 'error', + '@typescript-eslint/class-literal-property-style': 'error', + '@typescript-eslint/consistent-generic-constructors': 'error', + '@typescript-eslint/consistent-indexed-object-style': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-inferrable-types': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + }, + }, +]; diff --git a/node_modules/typescript-eslint/dist/index.d.ts.map b/node_modules/typescript-eslint/dist/index.d.ts.map new file mode 100644 index 0000000..50bf5b1 --- /dev/null +++ b/node_modules/typescript-eslint/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAezC,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,MAGxC,CAAC;AAyBF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,MAGxC,CAAC;AAEF,eAAO,MAAM,OAAO;IAClB;;;OAGG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;IAGH;;;;;OAKG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;CAEJ,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;;;;QAlFlD;;;WAGG;;QAGH;;;;WAIG;;QAGH;;;WAGG;;QAGH;;;;;WAKG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;;;wDApHI,CAAC;;;;;AAmKV,wBAKE;AAEF,OAAO,EACL,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/typescript-eslint/dist/index.js b/node_modules/typescript-eslint/dist/index.js new file mode 100644 index 0000000..0ce8d1b --- /dev/null +++ b/node_modules/typescript-eslint/dist/index.js @@ -0,0 +1,202 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.config = exports.configs = exports.plugin = exports.parser = void 0; +const eslint_plugin_1 = __importDefault(require("@typescript-eslint/eslint-plugin")); +const parserBase = __importStar(require("@typescript-eslint/parser")); +const config_helper_1 = require("./config-helper"); +const all_1 = __importDefault(require("./configs/all")); +const base_1 = __importDefault(require("./configs/base")); +const disable_type_checked_1 = __importDefault(require("./configs/disable-type-checked")); +const eslint_recommended_1 = __importDefault(require("./configs/eslint-recommended")); +const recommended_1 = __importDefault(require("./configs/recommended")); +const recommended_type_checked_1 = __importDefault(require("./configs/recommended-type-checked")); +const recommended_type_checked_only_1 = __importDefault(require("./configs/recommended-type-checked-only")); +const strict_1 = __importDefault(require("./configs/strict")); +const strict_type_checked_1 = __importDefault(require("./configs/strict-type-checked")); +const strict_type_checked_only_1 = __importDefault(require("./configs/strict-type-checked-only")); +const stylistic_1 = __importDefault(require("./configs/stylistic")); +const stylistic_type_checked_1 = __importDefault(require("./configs/stylistic-type-checked")); +const stylistic_type_checked_only_1 = __importDefault(require("./configs/stylistic-type-checked-only")); +exports.parser = { + meta: parserBase.meta, + parseForESLint: parserBase.parseForESLint, +}; +/* +we could build a plugin object here without the `configs` key - but if we do +that then we create a situation in which +``` +require('typescript-eslint').plugin !== require('@typescript-eslint/eslint-plugin') +``` + +This is bad because it means that 3rd party configs would be required to use +`typescript-eslint` or else they would break a user's config if the user either +used `tseslint.configs.recomended` et al or +``` +{ + plugins: { + '@typescript-eslint': tseslint.plugin, + }, +} +``` + +This might be something we could consider okay (eg 3rd party flat configs must +use our new package); however legacy configs consumed via `@eslint/eslintrc` +would never be able to satisfy this constraint and thus users would be blocked +from using them. +*/ +exports.plugin = eslint_plugin_1.default; +exports.configs = { + /** + * Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured. + * @see {@link https://typescript-eslint.io/users/configs#all} + */ + all: (0, all_1.default)(exports.plugin, exports.parser), + /** + * A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint. + * We don't recommend using this directly; instead, extend from an earlier recommended rule. + * @see {@link https://typescript-eslint.io/users/configs#base} + */ + base: (0, base_1.default)(exports.plugin, exports.parser), + /** + * A utility ruleset that will disable type-aware linting and all type-aware rules available in our project. + * @see {@link https://typescript-eslint.io/users/configs#disable-type-checked} + */ + disableTypeChecked: (0, disable_type_checked_1.default)(exports.plugin, exports.parser), + /** + * This is a compatibility ruleset that: + * - disables rules from eslint:recommended which are already handled by TypeScript. + * - enables rules that make sense due to TS's typechecking / transpilation. + * @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended} + */ + eslintRecommended: (0, eslint_recommended_1.default)(exports.plugin, exports.parser), + /** + * Recommended rules for code correctness that you can drop in without additional configuration. + * @see {@link https://typescript-eslint.io/users/configs#recommended} + */ + recommended: (0, recommended_1.default)(exports.plugin, exports.parser), + /** + * Contains all of `recommended` along with additional recommended rules that require type information. + * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked} + */ + recommendedTypeChecked: (0, recommended_type_checked_1.default)(exports.plugin, exports.parser), + /** + * A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules. + * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked-only} + */ + recommendedTypeCheckedOnly: (0, recommended_type_checked_only_1.default)(exports.plugin, exports.parser), + /** + * Contains all of `recommended`, as well as additional strict rules that can also catch bugs. + * @see {@link https://typescript-eslint.io/users/configs#strict} + */ + strict: (0, strict_1.default)(exports.plugin, exports.parser), + /** + * Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information. + * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked} + */ + strictTypeChecked: (0, strict_type_checked_1.default)(exports.plugin, exports.parser), + /** + * A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules. + * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked-only} + */ + strictTypeCheckedOnly: (0, strict_type_checked_only_1.default)(exports.plugin, exports.parser), + /** + * Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic. + * @see {@link https://typescript-eslint.io/users/configs#stylistic} + */ + stylistic: (0, stylistic_1.default)(exports.plugin, exports.parser), + /** + * Contains all of `stylistic`, along with additional stylistic rules that require type information. + * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked} + */ + stylisticTypeChecked: (0, stylistic_type_checked_1.default)(exports.plugin, exports.parser), + /** + * A version of `stylistic` that only contains type-checked rules and disables of any corresponding core ESLint rules. + * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked-only} + */ + stylisticTypeCheckedOnly: (0, stylistic_type_checked_only_1.default)(exports.plugin, exports.parser), +}; +/* +we do both a default and named exports to allow people to use this package from +both CJS and ESM in very natural ways. + +EG it means that all of the following are valid: + +```ts +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + ...tseslint.configs.recommended, +); +``` +```ts +import { config, parser, plugin } from 'typescript-eslint'; + +export default config( + { + languageOptions: { parser } + plugins: { ts: plugin }, + } +); +``` +```ts +const tseslint = require('typescript-eslint'); + +module.exports = tseslint.config( + ...tseslint.configs.recommended, +); +``` +```ts +const { config, parser, plugin } = require('typescript-eslint'); + +module.exports = config( + { + languageOptions: { parser } + plugins: { ts: plugin }, + } +); +``` +*/ +exports.default = { + config: config_helper_1.config, + configs: exports.configs, + parser: exports.parser, + plugin: exports.plugin, +}; +var config_helper_2 = require("./config-helper"); +Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_helper_2.config; } }); diff --git a/node_modules/typescript-eslint/package.json b/node_modules/typescript-eslint/package.json new file mode 100644 index 0000000..c52c940 --- /dev/null +++ b/node_modules/typescript-eslint/package.json @@ -0,0 +1,83 @@ +{ + "name": "typescript-eslint", + "version": "8.26.0", + "description": "Tooling which enables you to use TypeScript with ESLint", + "files": [ + "dist", + "!*.tsbuildinfo", + "_ts4.3", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "types": "./dist/index.d.ts", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/typescript-eslint" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io/packages/typescript-eslint", + "license": "MIT", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "typescript", + "parser", + "syntax", + "eslint", + "eslintplugin", + "eslint-plugin" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "lint": "nx lint", + "test": "jest --passWithNoTests", + "check-types": "npx nx typecheck" + }, + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.26.0", + "@typescript-eslint/parser": "8.26.0", + "@typescript-eslint/utils": "8.26.0" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + }, + "devDependencies": { + "@jest/types": "29.6.3", + "downlevel-dts": "*", + "jest": "29.7.0", + "prettier": "^3.2.5", + "rimraf": "*", + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/node_modules/typescript/package.json b/node_modules/typescript/package.json index 9515807..2b6f168 100644 --- a/node_modules/typescript/package.json +++ b/node_modules/typescript/package.json @@ -1,147 +1,120 @@ { - "_from": "typescript@^5.0.0", - "_id": "typescript@5.8.2", - "_inBundle": false, - "_integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", - "_location": "/typescript", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "typescript@^5.0.0", "name": "typescript", - "escapedName": "typescript", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "_shasum": "8170b3702f74b79db2e5a96207c15e65807999e4", - "_spec": "typescript@^5.0.0", - "_where": "/Users/scubbo/Code/commit-report-sync", - "author": { - "name": "Microsoft Corp." - }, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "browser": { - "fs": false, - "os": false, - "path": false, - "crypto": false, - "buffer": false, - "source-map-support": false, - "inspector": false, - "perf_hooks": false - }, - "bugs": { - "url": "https://github.com/microsoft/TypeScript/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "TypeScript is a language for application scale JavaScript development", - "devDependencies": { - "@dprint/formatter": "^0.4.1", - "@dprint/typescript": "0.93.3", - "@esfx/canceltoken": "^1.0.0", - "@eslint/js": "^9.17.0", - "@octokit/rest": "^21.0.2", - "@types/chai": "^4.3.20", - "@types/diff": "^5.2.3", - "@types/minimist": "^1.2.5", - "@types/mocha": "^10.0.10", - "@types/ms": "^0.7.34", - "@types/node": "latest", - "@types/source-map-support": "^0.5.10", - "@types/which": "^3.0.4", - "@typescript-eslint/rule-tester": "^8.18.1", - "@typescript-eslint/type-utils": "^8.18.1", - "@typescript-eslint/utils": "^8.18.1", - "azure-devops-node-api": "^14.1.0", - "c8": "^10.1.3", - "chai": "^4.5.0", - "chalk": "^4.1.2", - "chokidar": "^3.6.0", - "diff": "^5.2.0", - "dprint": "^0.47.6", - "esbuild": "^0.24.0", - "eslint": "^9.17.0", - "eslint-formatter-autolinkable-stylish": "^1.4.0", - "eslint-plugin-regexp": "^2.7.0", - "fast-xml-parser": "^4.5.1", - "glob": "^10.4.5", - "globals": "^15.13.0", - "hereby": "^1.10.0", - "jsonc-parser": "^3.3.1", - "knip": "^5.41.0", - "minimist": "^1.2.8", - "mocha": "^10.8.2", - "mocha-fivemat-progress-reporter": "^0.1.0", - "monocart-coverage-reports": "^2.11.4", - "ms": "^2.1.3", - "playwright": "^1.49.1", - "source-map-support": "^0.5.21", - "tslib": "^2.8.1", - "typescript": "^5.7.2", - "typescript-eslint": "^8.18.1", - "which": "^3.0.1" - }, - "engines": { - "node": ">=14.17" - }, - "files": [ - "bin", - "lib", - "!lib/enu", - "LICENSE.txt", - "README.md", - "SECURITY.md", - "ThirdPartyNoticeText.txt", - "!**/.gitattributes" - ], - "gitHead": "beb69e4cdd61b1a0fd9ae21ae58bd4bd409d7217", - "homepage": "https://www.typescriptlang.org/", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript" - ], - "license": "Apache-2.0", - "main": "./lib/typescript.js", - "name": "typescript", - "overrides": { - "typescript@*": "$typescript" - }, - "packageManager": "npm@8.19.4", - "repository": { - "type": "git", - "url": "git+https://github.com/microsoft/TypeScript.git" - }, - "scripts": { - "build": "npm run build:compiler && npm run build:tests", - "build:compiler": "hereby local", - "build:tests": "hereby tests", - "build:tests:notypecheck": "hereby tests --no-typecheck", - "clean": "hereby clean", - "format": "dprint fmt", - "gulp": "hereby", - "knip": "hereby knip", - "lint": "hereby lint", - "setup-hooks": "node scripts/link-hooks.mjs", - "test": "hereby runtests-parallel --light=false", - "test:eslint-rules": "hereby run-eslint-rules-tests" - }, - "typings": "./lib/typescript.d.ts", - "version": "5.8.2", - "volta": { - "node": "20.1.0", - "npm": "8.19.4" - } + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "5.8.2", + "license": "Apache-2.0", + "description": "TypeScript is a language for application scale JavaScript development", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript" + ], + "bugs": { + "url": "https://github.com/microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/microsoft/TypeScript.git" + }, + "main": "./lib/typescript.js", + "typings": "./lib/typescript.d.ts", + "bin": { + "tsc": "./bin/tsc", + "tsserver": "./bin/tsserver" + }, + "engines": { + "node": ">=14.17" + }, + "files": [ + "bin", + "lib", + "!lib/enu", + "LICENSE.txt", + "README.md", + "SECURITY.md", + "ThirdPartyNoticeText.txt", + "!**/.gitattributes" + ], + "devDependencies": { + "@dprint/formatter": "^0.4.1", + "@dprint/typescript": "0.93.3", + "@esfx/canceltoken": "^1.0.0", + "@eslint/js": "^9.17.0", + "@octokit/rest": "^21.0.2", + "@types/chai": "^4.3.20", + "@types/diff": "^5.2.3", + "@types/minimist": "^1.2.5", + "@types/mocha": "^10.0.10", + "@types/ms": "^0.7.34", + "@types/node": "latest", + "@types/source-map-support": "^0.5.10", + "@types/which": "^3.0.4", + "@typescript-eslint/rule-tester": "^8.18.1", + "@typescript-eslint/type-utils": "^8.18.1", + "@typescript-eslint/utils": "^8.18.1", + "azure-devops-node-api": "^14.1.0", + "c8": "^10.1.3", + "chai": "^4.5.0", + "chalk": "^4.1.2", + "chokidar": "^3.6.0", + "diff": "^5.2.0", + "dprint": "^0.47.6", + "esbuild": "^0.24.0", + "eslint": "^9.17.0", + "eslint-formatter-autolinkable-stylish": "^1.4.0", + "eslint-plugin-regexp": "^2.7.0", + "fast-xml-parser": "^4.5.1", + "glob": "^10.4.5", + "globals": "^15.13.0", + "hereby": "^1.10.0", + "jsonc-parser": "^3.3.1", + "knip": "^5.41.0", + "minimist": "^1.2.8", + "mocha": "^10.8.2", + "mocha-fivemat-progress-reporter": "^0.1.0", + "monocart-coverage-reports": "^2.11.4", + "ms": "^2.1.3", + "playwright": "^1.49.1", + "source-map-support": "^0.5.21", + "tslib": "^2.8.1", + "typescript": "^5.7.2", + "typescript-eslint": "^8.18.1", + "which": "^3.0.1" + }, + "overrides": { + "typescript@*": "$typescript" + }, + "scripts": { + "test": "hereby runtests-parallel --light=false", + "test:eslint-rules": "hereby run-eslint-rules-tests", + "build": "npm run build:compiler && npm run build:tests", + "build:compiler": "hereby local", + "build:tests": "hereby tests", + "build:tests:notypecheck": "hereby tests --no-typecheck", + "clean": "hereby clean", + "gulp": "hereby", + "lint": "hereby lint", + "knip": "hereby knip", + "format": "dprint fmt", + "setup-hooks": "node scripts/link-hooks.mjs" + }, + "browser": { + "fs": false, + "os": false, + "path": false, + "crypto": false, + "buffer": false, + "source-map-support": false, + "inspector": false, + "perf_hooks": false + }, + "packageManager": "npm@8.19.4", + "volta": { + "node": "20.1.0", + "npm": "8.19.4" + }, + "gitHead": "beb69e4cdd61b1a0fd9ae21ae58bd4bd409d7217" } diff --git a/node_modules/undici-types/package.json b/node_modules/undici-types/package.json index 3f32bf1..4010eee 100644 --- a/node_modules/undici-types/package.json +++ b/node_modules/undici-types/package.json @@ -1,73 +1,55 @@ { - "_from": "undici-types@~6.19.2", - "_id": "undici-types@6.19.8", - "_inBundle": false, - "_integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "_location": "/undici-types", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "undici-types@~6.19.2", - "name": "undici-types", - "escapedName": "undici-types", - "rawSpec": "~6.19.2", - "saveSpec": null, - "fetchSpec": "~6.19.2" - }, - "_requiredBy": [ - "/@types/node" - ], - "_resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "_shasum": "35111c9d1437ab83a7cdc0abae2f26d88eda0a02", - "_spec": "undici-types@~6.19.2", - "_where": "/Users/scubbo/Code/commit-report-sync/node_modules/@types/node", + "name": "undici-types", + "version": "6.19.8", + "description": "A stand-alone types package for Undici", + "homepage": "https://undici.nodejs.org", "bugs": { "url": "https://github.com/nodejs/undici/issues" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Daniele Belardi", - "url": "https://github.com/dnlup" - }, - { - "name": "Ethan Arrowood", - "url": "https://github.com/ethan-arrowood" - }, - { - "name": "Matteo Collina", - "url": "https://github.com/mcollina" - }, - { - "name": "Matthew Aitken", - "url": "https://github.com/KhafraDev" - }, - { - "name": "Robert Nagy", - "url": "https://github.com/ronag" - }, - { - "name": "Szymon Marczak", - "url": "https://github.com/szmarczak" - }, - { - "name": "Tomas Della Vedova", - "url": "https://github.com/delvedor" - } - ], - "deprecated": false, - "description": "A stand-alone types package for Undici", - "files": [ - "*.d.ts" - ], - "homepage": "https://undici.nodejs.org", - "license": "MIT", - "name": "undici-types", "repository": { "type": "git", "url": "git+https://github.com/nodejs/undici.git" }, + "license": "MIT", "types": "index.d.ts", - "version": "6.19.8" -} + "files": [ + "*.d.ts" + ], + "contributors": [ + { + "name": "Daniele Belardi", + "url": "https://github.com/dnlup", + "author": true + }, + { + "name": "Ethan Arrowood", + "url": "https://github.com/ethan-arrowood", + "author": true + }, + { + "name": "Matteo Collina", + "url": "https://github.com/mcollina", + "author": true + }, + { + "name": "Matthew Aitken", + "url": "https://github.com/KhafraDev", + "author": true + }, + { + "name": "Robert Nagy", + "url": "https://github.com/ronag", + "author": true + }, + { + "name": "Szymon Marczak", + "url": "https://github.com/szmarczak", + "author": true + }, + { + "name": "Tomas Della Vedova", + "url": "https://github.com/delvedor", + "author": true + } + ] +} \ No newline at end of file diff --git a/node_modules/undici/package.json b/node_modules/undici/package.json index 660d0a9..0c6b71e 100644 --- a/node_modules/undici/package.json +++ b/node_modules/undici/package.json @@ -1,66 +1,100 @@ { - "_from": "undici@^5.25.4", - "_id": "undici@5.28.5", - "_inBundle": false, - "_integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", - "_location": "/undici", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "undici@^5.25.4", - "name": "undici", - "escapedName": "undici", - "rawSpec": "^5.25.4", - "saveSpec": null, - "fetchSpec": "^5.25.4" - }, - "_requiredBy": [ - "/@actions/http-client" - ], - "_resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", - "_shasum": "b2b94b6bf8f1d919bc5a6f31f2c01deb02e54d4b", - "_spec": "undici@^5.25.4", - "_where": "/Users/scubbo/Code/commit-report-sync/node_modules/@actions/http-client", + "name": "undici", + "version": "5.28.5", + "description": "An HTTP/1.1 client, written from scratch for Node.js", + "homepage": "https://undici.nodejs.org", "bugs": { "url": "https://github.com/nodejs/undici/issues" }, - "bundleDependencies": false, + "repository": { + "type": "git", + "url": "git+https://github.com/nodejs/undici.git" + }, + "license": "MIT", "contributors": [ { "name": "Daniele Belardi", - "url": "https://github.com/dnlup" + "url": "https://github.com/dnlup", + "author": true }, { "name": "Ethan Arrowood", - "url": "https://github.com/ethan-arrowood" + "url": "https://github.com/ethan-arrowood", + "author": true }, { "name": "Matteo Collina", - "url": "https://github.com/mcollina" + "url": "https://github.com/mcollina", + "author": true }, { "name": "Matthew Aitken", - "url": "https://github.com/KhafraDev" + "url": "https://github.com/KhafraDev", + "author": true }, { "name": "Robert Nagy", - "url": "https://github.com/ronag" + "url": "https://github.com/ronag", + "author": true }, { "name": "Szymon Marczak", - "url": "https://github.com/szmarczak" + "url": "https://github.com/szmarczak", + "author": true }, { "name": "Tomas Della Vedova", - "url": "https://github.com/delvedor" + "url": "https://github.com/delvedor", + "author": true } ], - "dependencies": { - "@fastify/busboy": "^2.0.0" + "keywords": [ + "fetch", + "http", + "https", + "promise", + "request", + "curl", + "wget", + "xhr", + "whatwg" + ], + "main": "index.js", + "types": "index.d.ts", + "files": [ + "*.d.ts", + "index.js", + "index-fetch.js", + "lib", + "types", + "docs" + ], + "scripts": { + "build:node": "npx esbuild@0.19.4 index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names", + "prebuild:wasm": "node build/wasm.js --prebuild", + "build:wasm": "node build/wasm.js --docker", + "lint": "standard | snazzy", + "lint:fix": "standard --fix | snazzy", + "test": "node scripts/generate-pem && npm run test:tap && npm run test:node-fetch && npm run test:fetch && npm run test:cookies && npm run test:wpt && npm run test:websocket && npm run test:jest && npm run test:typescript", + "test:cookies": "node scripts/verifyVersion 16 || tap test/cookie/*.js", + "test:node-fetch": "node scripts/verifyVersion.js 16 || mocha --exit test/node-fetch", + "test:fetch": "node scripts/verifyVersion.js 16 || (npm run build:node && tap --expose-gc test/fetch/*.js && tap test/webidl/*.js)", + "test:jest": "node scripts/verifyVersion.js 14 || jest", + "test:tap": "tap test/*.js test/diagnostics-channel/*.js", + "test:tdd": "tap test/*.js test/diagnostics-channel/*.js -w", + "test:typescript": "node scripts/verifyVersion.js 14 || tsd && tsc --skipLibCheck test/imports/undici-import.ts", + "test:websocket": "node scripts/verifyVersion.js 18 || tap test/websocket/*.js", + "test:wpt": "node scripts/verifyVersion 18 || (node test/wpt/start-fetch.mjs && node test/wpt/start-FileAPI.mjs && node test/wpt/start-mimesniff.mjs && node test/wpt/start-xhr.mjs && node test/wpt/start-websockets.mjs)", + "coverage": "nyc --reporter=text --reporter=html npm run test", + "coverage:ci": "nyc --reporter=lcov npm run test", + "bench": "PORT=3042 concurrently -k -s first npm:bench:server npm:bench:run", + "bench:server": "node benchmarks/server.js", + "prebench:run": "node benchmarks/wait.js", + "bench:run": "CONNECTIONS=1 node benchmarks/benchmark.js; CONNECTIONS=50 node benchmarks/benchmark.js", + "serve:website": "docsify serve .", + "prepare": "husky install", + "fuzz": "jsfuzz test/fuzzing/fuzz.js corpus" }, - "deprecated": false, - "description": "An HTTP/1.1 client, written from scratch for Node.js", "devDependencies": { "@sinonjs/fake-timers": "^11.1.0", "@types/node": "^18.0.3", @@ -103,64 +137,6 @@ "engines": { "node": ">=14.0" }, - "files": [ - "*.d.ts", - "index.js", - "index-fetch.js", - "lib", - "types", - "docs" - ], - "homepage": "https://undici.nodejs.org", - "jest": { - "testMatch": [ - "/test/jest/**" - ] - }, - "keywords": [ - "fetch", - "http", - "https", - "promise", - "request", - "curl", - "wget", - "xhr", - "whatwg" - ], - "license": "MIT", - "main": "index.js", - "name": "undici", - "repository": { - "type": "git", - "url": "git+https://github.com/nodejs/undici.git" - }, - "scripts": { - "bench": "PORT=3042 concurrently -k -s first npm:bench:server npm:bench:run", - "bench:run": "CONNECTIONS=1 node benchmarks/benchmark.js; CONNECTIONS=50 node benchmarks/benchmark.js", - "bench:server": "node benchmarks/server.js", - "build:node": "npx esbuild@0.19.4 index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names", - "build:wasm": "node build/wasm.js --docker", - "coverage": "nyc --reporter=text --reporter=html npm run test", - "coverage:ci": "nyc --reporter=lcov npm run test", - "fuzz": "jsfuzz test/fuzzing/fuzz.js corpus", - "lint": "standard | snazzy", - "lint:fix": "standard --fix | snazzy", - "prebench:run": "node benchmarks/wait.js", - "prebuild:wasm": "node build/wasm.js --prebuild", - "prepare": "husky install", - "serve:website": "docsify serve .", - "test": "node scripts/generate-pem && npm run test:tap && npm run test:node-fetch && npm run test:fetch && npm run test:cookies && npm run test:wpt && npm run test:websocket && npm run test:jest && npm run test:typescript", - "test:cookies": "node scripts/verifyVersion 16 || tap test/cookie/*.js", - "test:fetch": "node scripts/verifyVersion.js 16 || (npm run build:node && tap --expose-gc test/fetch/*.js && tap test/webidl/*.js)", - "test:jest": "node scripts/verifyVersion.js 14 || jest", - "test:node-fetch": "node scripts/verifyVersion.js 16 || mocha --exit test/node-fetch", - "test:tap": "tap test/*.js test/diagnostics-channel/*.js", - "test:tdd": "tap test/*.js test/diagnostics-channel/*.js -w", - "test:typescript": "node scripts/verifyVersion.js 14 || tsd && tsc --skipLibCheck test/imports/undici-import.ts", - "test:websocket": "node scripts/verifyVersion.js 18 || tap test/websocket/*.js", - "test:wpt": "node scripts/verifyVersion 18 || (node test/wpt/start-fetch.mjs && node test/wpt/start-FileAPI.mjs && node test/wpt/start-mimesniff.mjs && node test/wpt/start-xhr.mjs && node test/wpt/start-websockets.mjs)" - }, "standard": { "env": [ "mocha" @@ -180,6 +156,12 @@ ] } }, - "types": "index.d.ts", - "version": "5.28.5" + "jest": { + "testMatch": [ + "/test/jest/**" + ] + }, + "dependencies": { + "@fastify/busboy": "^2.0.0" + } } diff --git a/node_modules/uri-js/LICENSE b/node_modules/uri-js/LICENSE new file mode 100755 index 0000000..9338bde --- /dev/null +++ b/node_modules/uri-js/LICENSE @@ -0,0 +1,11 @@ +Copyright 2011 Gary Court. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY GARY COURT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Gary Court. diff --git a/node_modules/uri-js/README.md b/node_modules/uri-js/README.md new file mode 100755 index 0000000..43e648b --- /dev/null +++ b/node_modules/uri-js/README.md @@ -0,0 +1,203 @@ +# URI.js + +URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc). +It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications. + +URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated). + +## API + +### Parsing + + URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body"); + //returns: + //{ + // scheme : "uri", + // userinfo : "user:pass", + // host : "example.com", + // port : 123, + // path : "/one/two.three", + // query : "q1=a1&q2=a2", + // fragment : "body" + //} + +### Serializing + + URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer" + +### Resolving + + URI.resolve("uri://a/b/c/d?q", "../../g") === "uri://a/g" + +### Normalizing + + URI.normalize("HTTP://ABC.com:80/%7Esmith/home.html") === "http://abc.com/~smith/home.html" + +### Comparison + + URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d") === true + +### IP Support + + //IPv4 normalization + URI.normalize("//192.068.001.000") === "//192.68.1.0" + + //IPv6 normalization + URI.normalize("//[2001:0:0DB8::0:0001]") === "//[2001:0:db8::1]" + + //IPv6 zone identifier support + URI.parse("//[2001:db8::7%25en1]"); + //returns: + //{ + // host : "2001:db8::7%en1" + //} + +### IRI Support + + //convert IRI to URI + URI.serialize(URI.parse("http://examplé.org/rosé")) === "http://xn--exampl-gva.org/ros%C3%A9" + //convert URI to IRI + URI.serialize(URI.parse("http://xn--exampl-gva.org/ros%C3%A9"), {iri:true}) === "http://examplé.org/rosé" + +### Options + +All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties: + +* `scheme` (string) + + Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior. + +* `reference` (string) + + If set to `"suffix"`, it indicates that the URI is in the suffix format, and the validator will use the option's `scheme` property to determine the URI's scheme. + +* `tolerant` (boolean, false) + + If set to `true`, the parser will relax URI resolving rules. + +* `absolutePath` (boolean, false) + + If set to `true`, the serializer will not resolve a relative `path` component. + +* `iri` (boolean, false) + + If set to `true`, the serializer will unescape non-ASCII characters as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). + +* `unicodeSupport` (boolean, false) + + If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). + +* `domainHost` (boolean, false) + + If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt). + +## Scheme Extendable + +URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, URI.js has built in support for the following schemes: + +* http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\] +* https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\] +* ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] +* wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] +* mailto \[[RFC 6068](http://www.ietf.org/rfc/rfc6068.txt)\] +* urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\] +* urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\] + +### HTTP/HTTPS Support + + URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true + URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true + +### WS/WSS Support + + URI.parse("wss://example.com/foo?bar=baz"); + //returns: + //{ + // scheme : "wss", + // host: "example.com", + // resourceName: "/foo?bar=baz", + // secure: true, + //} + + URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true + +### Mailto Support + + URI.parse("mailto:alpha@example.com,bravo@example.com?subject=SUBSCRIBE&body=Sign%20me%20up!"); + //returns: + //{ + // scheme : "mailto", + // to : ["alpha@example.com", "bravo@example.com"], + // subject : "SUBSCRIBE", + // body : "Sign me up!" + //} + + URI.serialize({ + scheme : "mailto", + to : ["alpha@example.com"], + subject : "REMOVE", + body : "Please remove me", + headers : { + cc : "charlie@example.com" + } + }) === "mailto:alpha@example.com?cc=charlie@example.com&subject=REMOVE&body=Please%20remove%20me" + +### URN Support + + URI.parse("urn:example:foo"); + //returns: + //{ + // scheme : "urn", + // nid : "example", + // nss : "foo", + //} + +#### URN UUID Support + + URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); + //returns: + //{ + // scheme : "urn", + // nid : "uuid", + // uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", + //} + +## Usage + +To load in a browser, use the following tag: + + + +To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line: + + npm install uri-js + # OR + yarn add uri-js + +Then, in your code, load it using: + + const URI = require("uri-js"); + +If you are writing your code in ES6+ (ESNEXT) or TypeScript, you would load it using: + + import * as URI from "uri-js"; + +Or you can load just what you need using named exports: + + import { parse, serialize, resolve, resolveComponents, normalize, equal, removeDotSegments, pctEncChar, pctDecChars, escapeComponent, unescapeComponent } from "uri-js"; + +## Breaking changes + +### Breaking changes from 3.x + +URN parsing has been completely changed to better align with the specification. Scheme is now always `urn`, but has two new properties: `nid` which contains the Namspace Identifier, and `nss` which contains the Namespace Specific String. The `nss` property will be removed by higher order scheme handlers, such as the UUID URN scheme handler. + +The UUID of a URN can now be found in the `uuid` property. + +### Breaking changes from 2.x + +URI validation has been removed as it was slow, exposed a vulnerabilty, and was generally not useful. + +### Breaking changes from 1.x + +The `errors` array on parsed components is now an `error` string. diff --git a/node_modules/uri-js/dist/es5/uri.all.js b/node_modules/uri-js/dist/es5/uri.all.js new file mode 100755 index 0000000..0706116 --- /dev/null +++ b/node_modules/uri-js/dist/es5/uri.all.js @@ -0,0 +1,1443 @@ +/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.URI = global.URI || {}))); +}(this, (function (exports) { 'use strict'; + +function merge() { + for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { + sets[_key] = arguments[_key]; + } + + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} + +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); + +var IRI_PROTOCOL = buildExps(true); + +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +/** Highest positive signed 32-bit float value */ + +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' + +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); +}; + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { + + if (index >= inputLength) { + error$1('invalid-input'); + } + + var digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } + + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } + + w *= baseMinusT; + } + + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } + + return String.fromCodePoint.apply(String, output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +var encode = function encode(input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; + + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var basicLength = output.length; + var handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; + + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; + + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + ++delta; + ++n; + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; +} +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} + +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; + + var _matches = slicedToArray(matches, 2), + address = _matches[1]; + + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; + + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; + + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; + + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } +} +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} + +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} + +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} + +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 + + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} + +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; + + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} + +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} + +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} + +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} + +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} + +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} + +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; + +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; + +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; + +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize +}; + +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$4 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; + +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$5 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; + +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$6 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } +}; + +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; + +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=uri.all.js.map diff --git a/node_modules/uri-js/dist/es5/uri.all.js.map b/node_modules/uri-js/dist/es5/uri.all.js.map new file mode 100755 index 0000000..5b30c4e --- /dev/null +++ b/node_modules/uri-js/dist/es5/uri.all.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/wss.ts","../../src/schemes/ws.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","wss","ws","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","wsComponents","fragment","resourceName","secure","port","isSecure","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/es5/uri.all.min.js b/node_modules/uri-js/dist/es5/uri.all.min.js new file mode 100755 index 0000000..fcd8458 --- /dev/null +++ b/node_modules/uri-js/dist/es5/uri.all.min.js @@ -0,0 +1,3 @@ +/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),n=0;n1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n=55296&&o<=56319&&n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function g(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=T(n,2),o=t[1];return o?o.split(".").map(m).join("."):e}function v(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=T(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=T(i,2),s=u[0],f=u[1],c=f?f.split(":").map(m):[],p=s.split(":").map(m),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,v=Array(d),E=0;E1){var A=v.slice(0,y.index),D=v.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=v.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?R:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(K);if(o){W?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=v(g(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=J[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=B.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?R:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(v(g(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(ee))e=e.replace(ee,"/");else if(e.match(re))e=e.replace(re,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(ne);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?R:F,t=[],o=J[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?R.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?R.PCT_ENCODED:F.PCT_ENCODED,d)}function N(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function I(e){var r=d(e);return r.match(he)?r:e}var F=u(!1),R=u(!0),T=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,L=String.fromCharCode,$=function(e){return String.fromCodePoint.apply(String,_(e))},M=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},V=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},k=function(e,r,n){var t=0;for(e=n?z(e/700):e>>1,e+=z(e/r);e>455;t+=36)e=z(e/35);return z(t+36*e/(e+38))},Z=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f=n&&s("invalid-input");var d=M(e.charCodeAt(f++));(d>=36||d>z((P-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(dz(P/m)&&s("overflow"),p*=m}var g=r.length+1;a=k(t-c,g,0==c),z(t/g)>P-o&&s("overflow"),o+=z(t/g),t%=g,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},G=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(L(d))}}catch(U){u=!0,f=U}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,m=l;for(l&&r.push("-");m=t&&Az((P-o)/D)&&s("overflow"),o+=(g-t)*D,t=g;var w=!0,b=!1,x=undefined;try{for(var O,N=e[Symbol.iterator]();!(w=(O=N.next()).done);w=!0){var I=O.value;if(IP&&s("overflow"),I==t){for(var F=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(FA-Z\\x5E-\\x7E]",'[\\"\\\\]'),he=new RegExp(se,"g"),de=new RegExp(ce,"g"),le=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',pe),"g"),me=new RegExp(r("[^]",se,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ge=me,ve={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.js b/node_modules/uri-js/dist/esnext/index.js new file mode 100755 index 0000000..e3531b5 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/index.js @@ -0,0 +1,17 @@ +import { SCHEMES } from "./uri"; +import http from "./schemes/http"; +SCHEMES[http.scheme] = http; +import https from "./schemes/https"; +SCHEMES[https.scheme] = https; +import ws from "./schemes/ws"; +SCHEMES[ws.scheme] = ws; +import wss from "./schemes/wss"; +SCHEMES[wss.scheme] = wss; +import mailto from "./schemes/mailto"; +SCHEMES[mailto.scheme] = mailto; +import urn from "./schemes/urn"; +SCHEMES[urn.scheme] = urn; +import uuid from "./schemes/urn-uuid"; +SCHEMES[uuid.scheme] = uuid; +export * from "./uri"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.js.map b/node_modules/uri-js/dist/esnext/index.js.map new file mode 100755 index 0000000..0971f6e --- /dev/null +++ b/node_modules/uri-js/dist/esnext/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAExB,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js b/node_modules/uri-js/dist/esnext/regexps-iri.js new file mode 100755 index 0000000..34e7de9 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-iri.js @@ -0,0 +1,3 @@ +import { buildExps } from "./regexps-uri"; +export default buildExps(true); +//# sourceMappingURL=regexps-iri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js.map b/node_modules/uri-js/dist/esnext/regexps-iri.js.map new file mode 100755 index 0000000..2269c58 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-iri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexps-iri.js","sourceRoot":"","sources":["../../src/regexps-iri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAe,SAAS,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js b/node_modules/uri-js/dist/esnext/regexps-uri.js new file mode 100755 index 0000000..1cc659f --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-uri.js @@ -0,0 +1,42 @@ +import { merge, subexp } from "./util"; +export function buildExps(isIRI) { + const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive + LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +export default buildExps(false); +//# sourceMappingURL=regexps-uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js.map b/node_modules/uri-js/dist/esnext/regexps-uri.js.map new file mode 100755 index 0000000..cb028b8 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexps-uri.js","sourceRoot":"","sources":["../../src/regexps-uri.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js b/node_modules/uri-js/dist/esnext/schemes/http.js new file mode 100755 index 0000000..6abf0fe --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/http.js @@ -0,0 +1,28 @@ +const handler = { + scheme: "http", + domainHost: true, + parse: function (components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function (components, options) { + const secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; +export default handler; +//# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js.map b/node_modules/uri-js/dist/esnext/schemes/http.js.map new file mode 100755 index 0000000..8211897 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/http.js.map @@ -0,0 +1 @@ +{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js b/node_modules/uri-js/dist/esnext/schemes/https.js new file mode 100755 index 0000000..ec4b6e7 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/https.js @@ -0,0 +1,9 @@ +import http from "./http"; +const handler = { + scheme: "https", + domainHost: http.domainHost, + parse: http.parse, + serialize: http.serialize +}; +export default handler; +//# sourceMappingURL=https.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js.map b/node_modules/uri-js/dist/esnext/schemes/https.js.map new file mode 100755 index 0000000..385b8ef --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/https.js.map @@ -0,0 +1 @@ +{"version":3,"file":"https.js","sourceRoot":"","sources":["../../../src/schemes/https.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,OAAO;IAChB,UAAU,EAAG,IAAI,CAAC,UAAU;IAC5B,KAAK,EAAG,IAAI,CAAC,KAAK;IAClB,SAAS,EAAG,IAAI,CAAC,SAAS;CAC1B,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js b/node_modules/uri-js/dist/esnext/schemes/mailto.js new file mode 100755 index 0000000..2553713 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/mailto.js @@ -0,0 +1,148 @@ +import { pctEncChar, pctDecChars, unescapeComponent } from "../uri"; +import punycode from "punycode"; +import { merge, subexp, toUpperCase, toArray } from "../util"; +const O = {}; +const isIRI = true; +//RFC 3986 +const UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +const HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +const PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +const ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +const QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +const VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +const DOT_ATOM_TEXT$ = subexp(ATEXT$$ + "+" + subexp("\\." + ATEXT$$ + "+") + "*"); +const QUOTED_PAIR$ = subexp("\\\\" + VCHAR$$); +const QCONTENT$ = subexp(QTEXT$$ + "|" + QUOTED_PAIR$); +const QUOTED_STRING$ = subexp('\\"' + QCONTENT$ + "*" + '\\"'); +//RFC 6068 +const DTEXT_NO_OBS$$ = "[\\x21-\\x5A\\x5E-\\x7E]"; //%d33-90 / %d94-126 +const SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +const QCHAR$ = subexp(UNRESERVED$$ + "|" + PCT_ENCODED$ + "|" + SOME_DELIMS$$); +const DOMAIN$ = subexp(DOT_ATOM_TEXT$ + "|" + "\\[" + DTEXT_NO_OBS$$ + "*" + "\\]"); +const LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + "|" + QUOTED_STRING$); +const ADDR_SPEC$ = subexp(LOCAL_PART$ + "\\@" + DOMAIN$); +const TO$ = subexp(ADDR_SPEC$ + subexp("\\," + ADDR_SPEC$) + "*"); +const HFNAME$ = subexp(QCHAR$ + "*"); +const HFVALUE$ = HFNAME$; +const HFIELD$ = subexp(HFNAME$ + "\\=" + HFVALUE$); +const HFIELDS2$ = subexp(HFIELD$ + subexp("\\&" + HFIELD$) + "*"); +const HFIELDS$ = subexp("\\?" + HFIELDS2$); +const MAILTO_URI = new RegExp("^mailto\\:" + TO$ + "?" + HFIELDS$ + "?$"); +const UNRESERVED = new RegExp(UNRESERVED$$, "g"); +const PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +const NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +const NOT_DOMAIN = new RegExp(merge("[^]", ATEXT$$, "[\\.]", "[\\[]", DTEXT_NO_OBS$$, "[\\]]"), "g"); +const NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +const NOT_HFVALUE = NOT_HFNAME; +const TO = new RegExp("^" + TO$ + "$"); +const HFIELDS = new RegExp("^" + HFIELDS2$ + "$"); +function decodeUnreserved(str) { + const decStr = pctDecChars(str); + return (!decStr.match(UNRESERVED) ? str : decStr); +} +const handler = { + scheme: "mailto", + parse: function (components, options) { + const mailtoComponents = components; + const to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(",") : []); + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + let unknownHeaders = false; + const headers = {}; + const hfields = mailtoComponents.query.split("&"); + for (let x = 0, xl = hfields.length; x < xl; ++x) { + const hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + const toAddrs = hfield[1].split(","); + for (let x = 0, xl = toAddrs.length; x < xl; ++x) { + to.push(toAddrs[x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) + mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (let x = 0, xl = to.length; x < xl; ++x) { + const addr = to[x].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } + catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } + else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[x] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function (mailtoComponents, options) { + const components = mailtoComponents; + const to = toArray(mailtoComponents.to); + if (to) { + for (let x = 0, xl = to.length; x < xl; ++x) { + const toAddr = String(to[x]); + const atIdx = toAddr.lastIndexOf("@"); + const localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + let domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain)); + } + catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + const headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) + headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) + headers["body"] = mailtoComponents.body; + const fields = []; + for (const name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + + "=" + + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; +export default handler; +//# sourceMappingURL=mailto.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js.map b/node_modules/uri-js/dist/esnext/schemes/mailto.js.map new file mode 100755 index 0000000..82dba9a --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/mailto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mailto.js","sourceRoot":"","sources":["../../../src/schemes/mailto.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js new file mode 100755 index 0000000..d1fce49 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js @@ -0,0 +1,23 @@ +const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; +//RFC 4122 +const handler = { + scheme: "urn:uuid", + parse: function (urnComponents, options) { + const uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function (uuidComponents, options) { + const urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + }, +}; +export default handler; +//# sourceMappingURL=urn-uuid.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map new file mode 100755 index 0000000..3b7a8b3 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urn-uuid.js","sourceRoot":"","sources":["../../../src/schemes/urn-uuid.ts"],"names":[],"mappings":"AAQA,MAAM,IAAI,GAAG,0DAA0D,CAAC;AACxE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,UAAU;AACV,MAAM,OAAO,GAA+D;IAC3E,MAAM,EAAG,UAAU;IAEnB,KAAK,EAAG,UAAU,aAA2B,EAAE,OAAkB;QAChE,MAAM,cAAc,GAAG,aAA+B,CAAC;QACvD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;QACzC,cAAc,CAAC,GAAG,GAAG,SAAS,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;YACpF,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,oBAAoB,CAAC;SACpE;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,SAAS,EAAG,UAAU,cAA6B,EAAE,OAAkB;QACtE,MAAM,aAAa,GAAG,cAA+B,CAAC;QACtD,gBAAgB;QAChB,aAAa,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js b/node_modules/uri-js/dist/esnext/schemes/urn.js new file mode 100755 index 0000000..5d3f10a --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn.js @@ -0,0 +1,49 @@ +import { SCHEMES } from "../uri"; +const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; +const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; +const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; +const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; +const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); +const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); +const URN_PARSE = /^([^\:]+)\:(.*)/; +const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; +//RFC 2141 +const handler = { + scheme: "urn", + parse: function (components, options) { + const matches = components.path && components.path.match(URN_PARSE); + let urnComponents = components; + if (matches) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = matches[1].toLowerCase(); + const nss = matches[2]; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } + else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function (urnComponents, options) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = urnComponents.nid; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + const uriComponents = urnComponents; + const nss = urnComponents.nss; + uriComponents.path = `${nid || options.nid}:${nss}`; + return uriComponents; + }, +}; +export default handler; +//# sourceMappingURL=urn.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js.map b/node_modules/uri-js/dist/esnext/schemes/urn.js.map new file mode 100755 index 0000000..ea43b0b --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urn.js","sourceRoot":"","sources":["../../../src/schemes/urn.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAC;AAW7C,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,OAAO,GAAG,mEAAmE,CAAC;AACpF,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,OAAO,GAAG,KAAK,CAAC;AAC7D,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACjE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,YAAY,GAAG,iDAAiD,CAAC;AAEvE,UAAU;AACV,MAAM,OAAO,GAA8C;IAC1D,MAAM,EAAG,KAAK;IAEd,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpE,IAAI,aAAa,GAAG,UAA2B,CAAC;QAEhD,IAAI,OAAO,EAAE;YACZ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;YAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;YACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;YAEzC,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;YACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;YACxB,aAAa,CAAC,IAAI,GAAG,SAAS,CAAC;YAE/B,IAAI,aAAa,EAAE;gBAClB,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;aAC7E;SACD;aAAM;YACN,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,IAAI,wBAAwB,CAAC;SACtE;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,SAAS,EAAG,UAAU,aAA2B,EAAE,OAAkB;QACpE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;QAC/D,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAEzC,IAAI,aAAa,EAAE;YAClB,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;SACjF;QAED,MAAM,aAAa,GAAG,aAA8B,CAAC;QACrD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,aAAa,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QAEpD,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js b/node_modules/uri-js/dist/esnext/schemes/ws.js new file mode 100755 index 0000000..9277f03 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/ws.js @@ -0,0 +1,41 @@ +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +const handler = { + scheme: "ws", + domainHost: true, + parse: function (components, options) { + const wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function (wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws'); + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + const [path, query] = wsComponents.resourceName.split('?'); + wsComponents.path = (path && path !== '/' ? path : undefined); + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; +export default handler; +//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js.map b/node_modules/uri-js/dist/esnext/schemes/ws.js.map new file mode 100755 index 0000000..186818c --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/ws.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/schemes/ws.ts"],"names":[],"mappings":"AAOA,kBAAkB,YAAyB;IAC1C,OAAO,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AAC7H,CAAC;AAED,UAAU;AACV,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,IAAI;IAEb,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,YAAY,GAAG,UAA0B,CAAC;QAEhD,oCAAoC;QACpC,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE7C,wBAAwB;QACxB,YAAY,CAAC,YAAY,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9G,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;QAC9B,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;QAE/B,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,SAAS,EAAG,UAAU,YAAyB,EAAE,OAAkB;QAClE,4BAA4B;QAC5B,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,KAAK,EAAE,EAAE;YAC1F,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;SAC9B;QAED,mCAAmC;QACnC,IAAI,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,EAAE;YAC7C,YAAY,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC;SAChC;QAED,qCAAqC;QACrC,IAAI,YAAY,CAAC,YAAY,EAAE;YAC9B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,YAAY,CAAC,YAAY,GAAG,SAAS,CAAC;SACtC;QAED,2BAA2B;QAC3B,YAAY,CAAC,QAAQ,GAAG,SAAS,CAAC;QAElC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js b/node_modules/uri-js/dist/esnext/schemes/wss.js new file mode 100755 index 0000000..d1e22cc --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/wss.js @@ -0,0 +1,9 @@ +import ws from "./ws"; +const handler = { + scheme: "wss", + domainHost: ws.domainHost, + parse: ws.parse, + serialize: ws.serialize +}; +export default handler; +//# sourceMappingURL=wss.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js.map b/node_modules/uri-js/dist/esnext/schemes/wss.js.map new file mode 100755 index 0000000..e19006d --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/wss.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.js b/node_modules/uri-js/dist/esnext/uri.js new file mode 100755 index 0000000..659ce26 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/uri.js @@ -0,0 +1,480 @@ +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +import URI_PROTOCOL from "./regexps-uri"; +import IRI_PROTOCOL from "./regexps-iri"; +import punycode from "punycode"; +import { toUpperCase, typeOf, assign } from "./util"; +export const SCHEMES = {}; +export function pctEncChar(chr) { + const c = chr.charCodeAt(0); + let e; + if (c < 16) + e = "%0" + c.toString(16).toUpperCase(); + else if (c < 128) + e = "%" + c.toString(16).toUpperCase(); + else if (c < 2048) + e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); + else + e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); + return e; +} +export function pctDecChars(str) { + let newStr = ""; + let i = 0; + const il = str.length; + while (i < il) { + const c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } + else if (c >= 194 && c < 224) { + if ((il - i) >= 6) { + const c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + } + else { + newStr += str.substr(i, 6); + } + i += 6; + } + else if (c >= 224) { + if ((il - i) >= 9) { + const c2 = parseInt(str.substr(i + 4, 2), 16); + const c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + } + else { + newStr += str.substr(i, 9); + } + i += 9; + } + else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + const decStr = pctDecChars(str); + return (!decStr.match(protocol.UNRESERVED) ? str : decStr); + } + if (components.scheme) + components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) + components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) + components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) + components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) + components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) + components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} +; +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + const matches = host.match(protocol.IPV4ADDRESS) || []; + const [, address] = matches; + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } + else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + const matches = host.match(protocol.IPV6ADDRESS) || []; + const [, address, zone] = matches; + if (address) { + const [last, first] = address.toLowerCase().split('::').reverse(); + const firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + const lastFields = last.split(":").map(_stripLeadingZeros); + const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + const fieldCount = isLastFieldIPv4Address ? 7 : 8; + const lastFieldsStart = lastFields.length - fieldCount; + const fields = Array(fieldCount); + for (let x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + const allZeroFields = fields.reduce((acc, field, index) => { + if (!field || field === "0") { + const lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } + else { + acc.push({ index, length: 1 }); + } + } + return acc; + }, []); + const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0]; + let newHost; + if (longestZeroFields && longestZeroFields.length > 1) { + const newFirst = fields.slice(0, longestZeroFields.index); + const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } + else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } + else { + return host; + } +} +const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +const NO_MATCH_IS_UNDEFINED = ("").match(/(){0}/)[1] === undefined; +export function parse(uriString, options = {}) { + const components = {}; + const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); + if (options.reference === "suffix") + uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + const matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } + else { //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined); + components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined); + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined); + components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined); + //fix port number + if (isNaN(components.port)) { + components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined); + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } + else if (components.scheme === undefined) { + components.reference = "relative"; + } + else if (components.fragment === undefined) { + components.reference = "absolute"; + } + else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } + catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } + else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } + else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} +; +function _recomposeAuthority(components, options) { + const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); + const uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]")); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} +; +const RDS1 = /^\.\.?\//; +const RDS2 = /^\/\.(\/|$)/; +const RDS3 = /^\/\.\.(\/|$)/; +const RDS4 = /^\.\.?$/; +const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +export function removeDotSegments(input) { + const output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } + else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } + else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } + else if (input === "." || input === "..") { + input = ""; + } + else { + const im = input.match(RDS5); + if (im) { + const s = im[0]; + input = input.slice(s.length); + output.push(s); + } + else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} +; +export function serialize(components, options = {}) { + const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL); + const uriTokens = []; + //find scheme handler + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) + schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) { + //TODO: normalize IPv6 address as per RFC 5952 + } + //if host component is a domain name + else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) { + //convert IDN via punycode + try { + components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host)); + } + catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + const authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + let s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} +; +export function resolveComponents(base, relative, options = {}, skipNormalization) { + const target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } + else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } + else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } + else { + target.query = base.query; + } + } + else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } + else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } + else if (!base.path) { + target.path = relative.path; + } + else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} +; +export function resolve(baseURI, relativeURI, options) { + const schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} +; +export function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } + else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} +; +export function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } + else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } + else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} +; +export function escapeComponent(str, options) { + return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar); +} +; +export function unescapeComponent(str, options) { + return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars); +} +; +//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.js.map b/node_modules/uri-js/dist/esnext/uri.js.map new file mode 100755 index 0000000..2e72ab1 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.js b/node_modules/uri-js/dist/esnext/util.js new file mode 100755 index 0000000..072711e --- /dev/null +++ b/node_modules/uri-js/dist/esnext/util.js @@ -0,0 +1,36 @@ +export function merge(...sets) { + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + const xl = sets.length - 1; + for (let x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } + else { + return sets[0]; + } +} +export function subexp(str) { + return "(?:" + str + ")"; +} +export function typeOf(o) { + return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); +} +export function toUpperCase(str) { + return str.toUpperCase(); +} +export function toArray(obj) { + return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; +} +export function assign(target, source) { + const obj = target; + if (source) { + for (const key in source) { + obj[key] = source[key]; + } + } + return obj; +} +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.js.map b/node_modules/uri-js/dist/esnext/util.js.map new file mode 100755 index 0000000..05d9df0 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,IAAkB;IAC1C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;YAC5B,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC/B;QACD,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACrB;SAAM;QACN,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;KACf;AACF,CAAC;AAED,MAAM,iBAAiB,GAAU;IAChC,OAAO,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC;AAC1B,CAAC;AAED,MAAM,iBAAiB,CAAK;IAC3B,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACpJ,CAAC;AAED,MAAM,sBAAsB,GAAU;IACrC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,kBAAkB,GAAO;IAC9B,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvM,CAAC;AAGD,MAAM,iBAAiB,MAAc,EAAE,MAAW;IACjD,MAAM,GAAG,GAAG,MAAa,CAAC;IAC1B,IAAI,MAAM,EAAE;QACX,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;SACvB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/package.json b/node_modules/uri-js/package.json new file mode 100755 index 0000000..de95d91 --- /dev/null +++ b/node_modules/uri-js/package.json @@ -0,0 +1,77 @@ +{ + "name": "uri-js", + "version": "4.4.1", + "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", + "main": "dist/es5/uri.all.js", + "types": "dist/es5/uri.all.d.ts", + "directories": { + "test": "tests" + }, + "files": [ + "dist", + "package.json", + "yarn.lock", + "README.md", + "CHANGELOG", + "LICENSE" + ], + "scripts": { + "build:esnext": "tsc", + "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", + "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", + "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", + "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", + "clean": "rm -rf dist", + "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/garycourt/uri-js" + }, + "keywords": [ + "URI", + "IRI", + "IDN", + "URN", + "UUID", + "HTTP", + "HTTPS", + "WS", + "WSS", + "MAILTO", + "RFC3986", + "RFC3987", + "RFC5891", + "RFC2616", + "RFC2818", + "RFC2141", + "RFC4122", + "RFC4291", + "RFC5952", + "RFC6068", + "RFC6455", + "RFC6874" + ], + "author": "Gary Court ", + "license": "BSD-2-Clause", + "bugs": { + "url": "https://github.com/garycourt/uri-js/issues" + }, + "homepage": "https://github.com/garycourt/uri-js", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-plugin-external-helpers": "^6.22.0", + "babel-preset-latest": "^6.24.1", + "mocha": "^8.2.1", + "mocha-qunit-ui": "^0.1.3", + "rollup": "^0.41.6", + "rollup-plugin-babel": "^2.7.1", + "rollup-plugin-node-resolve": "^2.0.0", + "sorcery": "^0.10.0", + "typescript": "^2.8.1", + "uglify-js": "^2.8.14" + }, + "dependencies": { + "punycode": "^2.1.0" + } +} diff --git a/node_modules/uri-js/yarn.lock b/node_modules/uri-js/yarn.lock new file mode 100755 index 0000000..3c42ded --- /dev/null +++ b/node_modules/uri-js/yarn.lock @@ -0,0 +1,2558 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +anymatch@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +async-each@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +babel-cli@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" + integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= + dependencies: + babel-core "^6.26.0" + babel-polyfill "^6.26.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + commander "^2.11.0" + convert-source-map "^1.5.0" + fs-readdir-recursive "^1.0.0" + glob "^7.1.2" + lodash "^4.17.4" + output-file-sync "^1.1.2" + path-is-absolute "^1.0.1" + slash "^1.0.0" + source-map "^0.5.6" + v8flags "^2.1.1" + optionalDependencies: + chokidar "^1.6.1" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@6: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + +babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-external-helpers@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + +babel-preset-es2015@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + +babel-preset-es2016@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz#f900bf93e2ebc0d276df9b8ab59724ebfd959f8b" + dependencies: + babel-plugin-transform-exponentiation-operator "^6.24.1" + +babel-preset-es2017@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz#597beadfb9f7f208bcfd8a12e9b2b29b8b2f14d1" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.24.1" + +babel-preset-latest@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.24.1.tgz#677de069154a7485c2d25c577c02f624b85b85e8" + dependencies: + babel-preset-es2015 "^6.24.1" + babel-preset-es2016 "^6.24.1" + babel-preset-es2017 "^6.24.1" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browser-resolve@^1.11.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +buffer-crc32@^0.2.5: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + +builtin-modules@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" + integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" + integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.1.2" + +chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.11.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +convert-source-map@^1.5.0, convert-source-map@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +debug@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" + integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + dependencies: + ms "2.1.2" + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + +diff@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +es6-promise@^3.1.2: + version "3.3.1" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estree-walker@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= + dependencies: + fill-range "^2.1.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-readdir-recursive@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.0.0: + version "1.2.13" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" + integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== + dependencies: + bindings "^1.5.0" + nan "^2.12.1" + +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= + dependencies: + is-glob "^2.0.0" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + +glob@7.1.6, glob@^7.1.2, glob@^7.1.3: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +graceful-fs@^4.1.11, graceful-fs@^4.1.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +graceful-fs@^4.1.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-finite@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= + dependencies: + is-extglob "^1.0.0" + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@3.14.0: + version "3.14.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" + integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.4: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +log-symbols@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" + integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== + dependencies: + chalk "^4.0.0" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +math-random@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" + integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== + +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +mocha-qunit-ui@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/mocha-qunit-ui/-/mocha-qunit-ui-0.1.3.tgz#e3e1ff1dac33222b10cef681efd7f82664141ea9" + +mocha@^8.2.1: + version "8.2.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.2.1.tgz#f2fa68817ed0e53343d989df65ccd358bc3a4b39" + integrity sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.4.3" + debug "4.2.0" + diff "4.0.2" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.6" + growl "1.10.5" + he "1.2.0" + js-yaml "3.14.0" + log-symbols "4.0.0" + minimatch "3.0.4" + ms "2.1.2" + nanoid "3.1.12" + serialize-javascript "5.0.1" + strip-json-comments "3.1.1" + supports-color "7.2.0" + which "2.0.2" + wide-align "1.1.3" + workerpool "6.0.2" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "2.0.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nan@^2.12.1: + version "2.14.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" + integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== + +nanoid@3.1.12: + version "3.1.12" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654" + integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +normalize-path@^2.0.0, normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +output-file-sync@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" + +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= + +private@^0.1.6, private@^0.1.7, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + +randomatic@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readable-stream@^2.0.2: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== + dependencies: + picomatch "^2.2.1" + +regenerate@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" + +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.6: + version "1.6.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" + dependencies: + path-parse "^1.0.5" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@^2.5.2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + dependencies: + glob "^7.1.3" + +rollup-plugin-babel@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" + dependencies: + babel-core "6" + babel-plugin-transform-es2015-classes "^6.9.0" + object-assign "^4.1.0" + rollup-pluginutils "^1.5.0" + +rollup-plugin-node-resolve@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz#cbb783b0d15b02794d58915350b2f0d902b8ddc8" + dependencies: + browser-resolve "^1.11.0" + builtin-modules "^1.1.0" + resolve "^1.1.6" + +rollup-pluginutils@^1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" + dependencies: + estree-walker "^0.2.1" + minimatch "^3.0.2" + +rollup@^0.41.6: + version "0.41.6" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" + dependencies: + source-map-support "^0.4.0" + +safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +sander@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad" + dependencies: + es6-promise "^3.1.2" + graceful-fs "^4.1.3" + mkdirp "^0.5.1" + rimraf "^2.5.2" + +serialize-javascript@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" + integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== + dependencies: + randombytes "^2.1.0" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +sorcery@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7" + dependencies: + buffer-crc32 "^0.2.5" + minimist "^1.2.0" + sander "^0.5.0" + sourcemap-codec "^1.3.0" + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.0, source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +sourcemap-codec@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@7.2.0, supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +typescript@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624" + +uglify-js@^2.8.14: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA= + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +v8flags@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= + dependencies: + user-home "^1.1.1" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wide-align@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +workerpool@6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438" + integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q== + +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" + integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== + +yargs-parser@13.1.2, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@13.3.2: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md new file mode 100644 index 0000000..7fb1f20 --- /dev/null +++ b/node_modules/which/CHANGELOG.md @@ -0,0 +1,166 @@ +# Changes + + +## 2.0.2 + +* Rename bin to `node-which` + +## 2.0.1 + +* generate changelog and publish on version bump +* enforce 100% test coverage +* Promise interface + +## 2.0.0 + +* Parallel tests, modern JavaScript, and drop support for node < 8 + +## 1.3.1 + +* update deps +* update travis + +## v1.3.0 + +* Add nothrow option to which.sync +* update tap + +## v1.2.14 + +* appveyor: drop node 5 and 0.x +* travis-ci: add node 6, drop 0.x + +## v1.2.13 + +* test: Pass missing option to pass on windows +* update tap +* update isexe to 2.0.0 +* neveragain.tech pledge request + +## v1.2.12 + +* Removed unused require + +## v1.2.11 + +* Prevent changelog script from being included in package + +## v1.2.10 + +* Use env.PATH only, not env.Path + +## v1.2.9 + +* fix for paths starting with ../ +* Remove unused `is-absolute` module + +## v1.2.8 + +* bullet items in changelog that contain (but don't start with) # + +## v1.2.7 + +* strip 'update changelog' changelog entries out of changelog + +## v1.2.6 + +* make the changelog bulleted + +## v1.2.5 + +* make a changelog, and keep it up to date +* don't include tests in package +* Properly handle relative-path executables +* appveyor +* Attach error code to Not Found error +* Make tests pass on Windows + +## v1.2.4 + +* Fix typo + +## v1.2.3 + +* update isexe, fix regression in pathExt handling + +## v1.2.2 + +* update deps, use isexe module, test windows + +## v1.2.1 + +* Sometimes windows PATH entries are quoted +* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. +* doc cli + +## v1.2.0 + +* Add support for opt.all and -as cli flags +* test the bin +* update travis +* Allow checking for multiple programs in bin/which +* tap 2 + +## v1.1.2 + +* travis +* Refactored and fixed undefined error on Windows +* Support strict mode + +## v1.1.1 + +* test +g exes against secondary groups, if available +* Use windows exe semantics on cygwin & msys +* cwd should be first in path on win32, not last +* Handle lower-case 'env.Path' on Windows +* Update docs +* use single-quotes + +## v1.1.0 + +* Add tests, depend on is-absolute + +## v1.0.9 + +* which.js: root is allowed to execute files owned by anyone + +## v1.0.8 + +* don't use graceful-fs + +## v1.0.7 + +* add license to package.json + +## v1.0.6 + +* isc license + +## 1.0.5 + +* Awful typo + +## 1.0.4 + +* Test for path absoluteness properly +* win: Allow '' as a pathext if cmd has a . in it + +## 1.0.3 + +* Remove references to execPath +* Make `which.sync()` work on Windows by honoring the PATHEXT variable. +* Make `isExe()` always return true on Windows. +* MIT + +## 1.0.2 + +* Only files can be exes + +## 1.0.1 + +* Respect the PATHEXT env for win32 support +* should 0755 the bin +* binary +* guts +* package +* 1st diff --git a/node_modules/which/LICENSE b/node_modules/which/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/which/README.md b/node_modules/which/README.md new file mode 100644 index 0000000..cd83350 --- /dev/null +++ b/node_modules/which/README.md @@ -0,0 +1,54 @@ +# which + +Like the unix `which` utility. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. + +## USAGE + +```javascript +var which = require('which') + +// async usage +which('node', function (er, resolvedPath) { + // er is returned if no "node" is found on the PATH + // if it is found, then the absolute path to the exec is returned +}) + +// or promise +which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... }) + +// sync usage +// throws if not found +var resolved = which.sync('node') + +// if nothrow option is used, returns null if not found +resolved = which.sync('node', {nothrow: true}) + +// Pass options to override the PATH and PATHEXT environment vars. +which('node', { path: someOtherPath }, function (er, resolved) { + if (er) + throw er + console.log('found at %j', resolved) +}) +``` + +## CLI USAGE + +Same as the BSD `which(1)` binary. + +``` +usage: which [-as] program ... +``` + +## OPTIONS + +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/node_modules/which/package.json b/node_modules/which/package.json new file mode 100644 index 0000000..97ad7fb --- /dev/null +++ b/node_modules/which/package.json @@ -0,0 +1,43 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "2.0.2", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "main": "which.js", + "bin": { + "node-which": "./bin/node-which" + }, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.6.2", + "tap": "^14.6.9" + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublish": "npm run changelog", + "prechangelog": "bash gen-changelog.sh", + "changelog": "git add CHANGELOG.md", + "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", + "postpublish": "git push origin --follow-tags" + }, + "files": [ + "which.js", + "bin/node-which" + ], + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">= 8" + } +} diff --git a/node_modules/which/which.js b/node_modules/which/which.js new file mode 100644 index 0000000..82afffd --- /dev/null +++ b/node_modules/which/which.js @@ -0,0 +1,125 @@ +const isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' + +const path = require('path') +const COLON = isWindows ? ';' : ':' +const isexe = require('isexe') + +const getNotFoundError = (cmd) => + Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) + +const getPathInfo = (cmd, opt) => { + const colon = opt.colon || COLON + + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [''] + : ( + [ + // windows always checks the cwd first + ...(isWindows ? [process.cwd()] : []), + ...(opt.path || process.env.PATH || + /* istanbul ignore next: very unusual */ '').split(colon), + ] + ) + const pathExtExe = isWindows + ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' + : '' + const pathExt = isWindows ? pathExtExe.split(colon) : [''] + + if (isWindows) { + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } + + return { + pathEnv, + pathExt, + pathExtExe, + } +} + +const which = (cmd, opt, cb) => { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + if (!opt) + opt = {} + + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + const step = i => new Promise((resolve, reject) => { + if (i === pathEnv.length) + return opt.all && found.length ? resolve(found) + : reject(getNotFoundError(cmd)) + + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + resolve(subStep(p, i, 0)) + }) + + const subStep = (p, i, ii) => new Promise((resolve, reject) => { + if (ii === pathExt.length) + return resolve(step(i + 1)) + const ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return resolve(p + ext) + } + return resolve(subStep(p, i, ii + 1)) + }) + }) + + return cb ? step(0).then(res => cb(null, res), cb) : step(0) +} + +const whichSync = (cmd, opt) => { + opt = opt || {} + + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + for (let i = 0; i < pathEnv.length; i ++) { + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + for (let j = 0; j < pathExt.length; j ++) { + const cur = p + pathExt[j] + try { + const is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } + } + + if (opt.all && found.length) + return found + + if (opt.nothrow) + return null + + throw getNotFoundError(cmd) +} + +module.exports = which +which.sync = whichSync diff --git a/node_modules/word-wrap/LICENSE b/node_modules/word-wrap/LICENSE new file mode 100644 index 0000000..842218c --- /dev/null +++ b/node_modules/word-wrap/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/word-wrap/README.md b/node_modules/word-wrap/README.md new file mode 100644 index 0000000..3305953 --- /dev/null +++ b/node_modules/word-wrap/README.md @@ -0,0 +1,201 @@ +# word-wrap [![NPM version](https://img.shields.io/npm/v/word-wrap.svg?style=flat)](https://www.npmjs.com/package/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/word-wrap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/word-wrap) + +> Wrap words to a specified length. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save word-wrap +``` + +## Usage + +```js +var wrap = require('word-wrap'); + +wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'); +``` + +Results in: + +``` + Lorem ipsum dolor sit amet, consectetur adipiscing + elit, sed do eiusmod tempor incididunt ut labore + et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. +``` + +## Options + +![image](https://cloud.githubusercontent.com/assets/383994/6543728/7a381c08-c4f6-11e4-8b7d-b6ba197569c9.png) + +### options.width + +Type: `Number` + +Default: `50` + +The width of the text before wrapping to a new line. + +**Example:** + +```js +wrap(str, {width: 60}); +``` + +### options.indent + +Type: `String` + +Default: `` (two spaces) + +The string to use at the beginning of each line. + +**Example:** + +```js +wrap(str, {indent: ' '}); +``` + +### options.newline + +Type: `String` + +Default: `\n` + +The string to use at the end of each line. + +**Example:** + +```js +wrap(str, {newline: '\n\n'}); +``` + +### options.escape + +Type: `function` + +Default: `function(str){return str;}` + +An escape function to run on each line after splitting them. + +**Example:** + +```js +var xmlescape = require('xml-escape'); +wrap(str, { + escape: function(string){ + return xmlescape(string); + } +}); +``` + +### options.trim + +Type: `Boolean` + +Default: `false` + +Trim trailing whitespace from the returned string. This option is included since `.trim()` would also strip the leading indentation from the first line. + +**Example:** + +```js +wrap(str, {trim: true}); +``` + +### options.cut + +Type: `Boolean` + +Default: `false` + +Break a word between any two letters when the word is longer than the specified width. + +**Example:** + +```js +wrap(str, {cut: true}); +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [common-words](https://www.npmjs.com/package/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words) | [homepage](https://github.com/jonschlinkert/common-words "Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.") +* [shuffle-words](https://www.npmjs.com/package/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words) | [homepage](https://github.com/jonschlinkert/shuffle-words "Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.") +* [unique-words](https://www.npmjs.com/package/unique-words): Returns an array of unique words, or the number of occurrences of each word in… [more](https://github.com/jonschlinkert/unique-words) | [homepage](https://github.com/jonschlinkert/unique-words "Returns an array of unique words, or the number of occurrences of each word in a string or list.") +* [wordcount](https://www.npmjs.com/package/wordcount): Count the words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/jonschlinkert/wordcount "Count the words in a string. Support for english, CJK and Cyrillic.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 7 | [OlafConijn](https://github.com/OlafConijn) | +| 3 | [doowb](https://github.com/doowb) | +| 2 | [aashutoshrathi](https://github.com/aashutoshrathi) | +| 2 | [lordvlad](https://github.com/lordvlad) | +| 2 | [hildjj](https://github.com/hildjj) | +| 1 | [danilosampaio](https://github.com/danilosampaio) | +| 1 | [2fd](https://github.com/2fd) | +| 1 | [leonard-thieu](https://github.com/leonard-thieu) | +| 1 | [mohd-akram](https://github.com/mohd-akram) | +| 1 | [toddself](https://github.com/toddself) | +| 1 | [wolfgang42](https://github.com/wolfgang42) | +| 1 | [zachhale](https://github.com/zachhale) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2023, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 22, 2023._ \ No newline at end of file diff --git a/node_modules/word-wrap/index.js b/node_modules/word-wrap/index.js new file mode 100644 index 0000000..08f1e41 --- /dev/null +++ b/node_modules/word-wrap/index.js @@ -0,0 +1,61 @@ +/*! + * word-wrap + * + * Copyright (c) 2014-2023, Jon Schlinkert. + * Released under the MIT License. + */ + +function trimEnd(str) { + let lastCharPos = str.length - 1; + let lastChar = str[lastCharPos]; + while(lastChar === ' ' || lastChar === '\t') { + lastChar = str[--lastCharPos]; + } + return str.substring(0, lastCharPos + 1); +} + +function trimTabAndSpaces(str) { + const lines = str.split('\n'); + const trimmedLines = lines.map((line) => trimEnd(line)); + return trimmedLines.join('\n'); +} + +module.exports = function(str, options) { + options = options || {}; + if (str == null) { + return str; + } + + var width = options.width || 50; + var indent = (typeof options.indent === 'string') + ? options.indent + : ' '; + + var newline = options.newline || '\n' + indent; + var escape = typeof options.escape === 'function' + ? options.escape + : identity; + + var regexString = '.{1,' + width + '}'; + if (options.cut !== true) { + regexString += '([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)'; + } + + var re = new RegExp(regexString, 'g'); + var lines = str.match(re) || []; + var result = indent + lines.map(function(line) { + if (line.slice(-1) === '\n') { + line = line.slice(0, line.length - 1); + } + return escape(line); + }).join(newline); + + if (options.trim === true) { + result = trimTabAndSpaces(result); + } + return result; +}; + +function identity(str) { + return str; +} diff --git a/node_modules/word-wrap/package.json b/node_modules/word-wrap/package.json new file mode 100644 index 0000000..459246d --- /dev/null +++ b/node_modules/word-wrap/package.json @@ -0,0 +1,77 @@ +{ + "name": "word-wrap", + "description": "Wrap words to a specified length.", + "version": "1.2.5", + "homepage": "https://github.com/jonschlinkert/word-wrap", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Danilo Sampaio (localhost:8080)", + "Fede Ramirez (https://2fd.github.io)", + "Joe Hildebrand (https://twitter.com/hildjj)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Todd Kennedy (https://tck.io)", + "Waldemar Reusch (https://github.com/lordvlad)", + "Wolfgang Faust (http://www.linestarve.com)", + "Zach Hale (http://zachhale.com)" + ], + "repository": "jonschlinkert/word-wrap", + "bugs": { + "url": "https://github.com/jonschlinkert/word-wrap/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "index.d.ts" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "keywords": [ + "break", + "carriage", + "line", + "new-line", + "newline", + "return", + "soft", + "text", + "word", + "word-wrap", + "words", + "wrap" + ], + "typings": "index.d.ts", + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "common-words", + "shuffle-words", + "unique-words", + "wordcount" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + } +} diff --git a/node_modules/yocto-queue/index.js b/node_modules/yocto-queue/index.js new file mode 100644 index 0000000..2f3e6dc --- /dev/null +++ b/node_modules/yocto-queue/index.js @@ -0,0 +1,68 @@ +class Node { + /// value; + /// next; + + constructor(value) { + this.value = value; + + // TODO: Remove this when targeting Node.js 12. + this.next = undefined; + } +} + +class Queue { + // TODO: Use private class fields when targeting Node.js 12. + // #_head; + // #_tail; + // #_size; + + constructor() { + this.clear(); + } + + enqueue(value) { + const node = new Node(value); + + if (this._head) { + this._tail.next = node; + this._tail = node; + } else { + this._head = node; + this._tail = node; + } + + this._size++; + } + + dequeue() { + const current = this._head; + if (!current) { + return; + } + + this._head = this._head.next; + this._size--; + return current.value; + } + + clear() { + this._head = undefined; + this._tail = undefined; + this._size = 0; + } + + get size() { + return this._size; + } + + * [Symbol.iterator]() { + let current = this._head; + + while (current) { + yield current.value; + current = current.next; + } + } +} + +module.exports = Queue; diff --git a/node_modules/yocto-queue/license b/node_modules/yocto-queue/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/yocto-queue/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/yocto-queue/package.json b/node_modules/yocto-queue/package.json new file mode 100644 index 0000000..71a9101 --- /dev/null +++ b/node_modules/yocto-queue/package.json @@ -0,0 +1,43 @@ +{ + "name": "yocto-queue", + "version": "0.1.0", + "description": "Tiny queue data structure", + "license": "MIT", + "repository": "sindresorhus/yocto-queue", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "queue", + "data", + "structure", + "algorithm", + "queues", + "queuing", + "list", + "array", + "linkedlist", + "fifo", + "enqueue", + "dequeue", + "data-structure" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.13.1", + "xo": "^0.35.0" + } +} diff --git a/node_modules/yocto-queue/readme.md b/node_modules/yocto-queue/readme.md new file mode 100644 index 0000000..c72fefc --- /dev/null +++ b/node_modules/yocto-queue/readme.md @@ -0,0 +1,64 @@ +# yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue) + +> Tiny queue data structure + +You should use this package instead of an array if you do a lot of `Array#push()` and `Array#shift()` on large arrays, since `Array#shift()` has [linear time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(N)%E2%80%94Linear%20Time) *O(n)* while `Queue#dequeue()` has [constant time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(1)%20%E2%80%94%20Constant%20Time) *O(1)*. That makes a huge difference for large arrays. + +> A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is an ordered list of elements where an element is inserted at the end of the queue and is removed from the front of the queue. A queue works based on the first-in, first-out ([FIFO](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics))) principle. + +## Install + +``` +$ npm install yocto-queue +``` + +## Usage + +```js +const Queue = require('yocto-queue'); + +const queue = new Queue(); + +queue.enqueue('🦄'); +queue.enqueue('🌈'); + +console.log(queue.size); +//=> 2 + +console.log(...queue); +//=> '🦄 🌈' + +console.log(queue.dequeue()); +//=> '🦄' + +console.log(queue.dequeue()); +//=> '🌈' +``` + +## API + +### `queue = new Queue()` + +The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. + +#### `.enqueue(value)` + +Add a value to the queue. + +#### `.dequeue()` + +Remove the next value in the queue. + +Returns the removed value or `undefined` if the queue is empty. + +#### `.clear()` + +Clear the queue. + +#### `.size` + +The size of the queue. + +## Related + +- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple “Least Recently Used” (LRU) cache diff --git a/package-lock.json b/package-lock.json index 4e5969f..9a70578 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,17 @@ "version": "1.0.0", "dependencies": { "@actions/core": "^1.10.1", - "date-fns": "^4.1.0" + "date-fns": "^4.1.0", + "prettier": "^3.5.3" }, "devDependencies": { + "@eslint/js": "^9.21.0", "@types/node": "^20.0.0", "@vercel/ncc": "^0.38.0", - "typescript": "^5.0.0" + "eslint": "^9.21.0", + "globals": "^16.0.0", + "typescript": "^5.0.0", + "typescript-eslint": "^8.26.0" } }, "node_modules/@actions/core": { @@ -48,6 +53,147 @@ "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", + "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.21.0.tgz", + "integrity": "sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", + "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@fastify/busboy": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", @@ -56,6 +202,124 @@ "node": ">=14" } }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "20.17.22", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.22.tgz", @@ -65,6 +329,212 @@ "undici-types": "~6.19.2" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.26.0.tgz", + "integrity": "sha512-cLr1J6pe56zjKYajK6SSSre6nl1Gj6xDp1TY0trpgPzjVbgDwd09v2Ws37LABxzkicmUjhEeg/fAUjPJJB1v5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.26.0", + "@typescript-eslint/type-utils": "8.26.0", + "@typescript-eslint/utils": "8.26.0", + "@typescript-eslint/visitor-keys": "8.26.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.26.0.tgz", + "integrity": "sha512-mNtXP9LTVBy14ZF3o7JG69gRPBK/2QWtQd0j0oH26HcY/foyJJau6pNUez7QrM5UHnSvwlQcJXKsk0I99B9pOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.26.0", + "@typescript-eslint/types": "8.26.0", + "@typescript-eslint/typescript-estree": "8.26.0", + "@typescript-eslint/visitor-keys": "8.26.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.26.0.tgz", + "integrity": "sha512-E0ntLvsfPqnPwng8b8y4OGuzh/iIOm2z8U3S9zic2TeMLW61u5IH2Q1wu0oSTkfrSzwbDJIB/Lm8O3//8BWMPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.26.0", + "@typescript-eslint/visitor-keys": "8.26.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.26.0.tgz", + "integrity": "sha512-ruk0RNChLKz3zKGn2LwXuVoeBcUMh+jaqzN461uMMdxy5H9epZqIBtYj7UiPXRuOpaALXGbmRuZQhmwHhaS04Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.26.0", + "@typescript-eslint/utils": "8.26.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.26.0.tgz", + "integrity": "sha512-89B1eP3tnpr9A8L6PZlSjBvnJhWXtYfZhECqlBl1D9Lme9mHO6iWlsprBtVenQvY1HMhax1mWOjhtL3fh/u+pA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.26.0.tgz", + "integrity": "sha512-tiJ1Hvy/V/oMVRTbEOIeemA2XoylimlDQ03CgPPNaHYZbpsc78Hmngnt+WXZfJX1pjQ711V7g0H7cSJThGYfPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.26.0", + "@typescript-eslint/visitor-keys": "8.26.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.26.0.tgz", + "integrity": "sha512-2L2tU3FVwhvU14LndnQCA2frYC8JnPDVKyQtWFPf8IYFMt/ykEN1bPolNhNbCVgOmdzTlWdusCTKA/9nKrf8Ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.26.0", + "@typescript-eslint/types": "8.26.0", + "@typescript-eslint/typescript-estree": "8.26.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.26.0.tgz", + "integrity": "sha512-2z8JQJWAzPdDd51dRQ/oqIJxe99/hoLIqmf8RMCAJQtYDc535W/Jt2+RTP4bP0aKeBG1F65yjIZuczOXCmbWwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.26.0", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@vercel/ncc": { "version": "0.38.3", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz", @@ -74,6 +544,169 @@ "ncc": "dist/ncc/cli.js" } }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/date-fns": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", @@ -84,6 +717,860 @@ "url": "https://github.com/sponsors/kossnocorp" } }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.21.0.tgz", + "integrity": "sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "9.21.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz", + "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", + "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -92,6 +1579,19 @@ "node": ">=0.6.11 <=0.7.0 || >=0.7.3" } }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/typescript": { "version": "5.8.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", @@ -105,6 +1605,29 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.26.0.tgz", + "integrity": "sha512-PtVz9nAnuNJuAVeUFvwztjuUgSnJInODAUx47VDwWPXzd5vismPOtPtt83tzNXyOjVQbPRp786D6WFW/M2koIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.26.0", + "@typescript-eslint/parser": "8.26.0", + "@typescript-eslint/utils": "8.26.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, "node_modules/undici": { "version": "5.28.5", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", @@ -121,6 +1644,55 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 50aa663..d63c1a1 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,16 @@ }, "dependencies": { "@actions/core": "^1.10.1", - "date-fns": "^4.1.0" + "date-fns": "^4.1.0", + "prettier": "^3.5.3" }, "devDependencies": { + "@eslint/js": "^9.21.0", "@types/node": "^20.0.0", "@vercel/ncc": "^0.38.0", - "typescript": "^5.0.0" + "eslint": "^9.21.0", + "globals": "^16.0.0", + "typescript": "^5.0.0", + "typescript-eslint": "^8.26.0" } } diff --git a/src/index.ts b/src/index.ts index e93e217..0388963 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,4 @@ import * as core from '@actions/core'; -import { Repo, repoString } from './types'; import { main } from './main'; async function run() { diff --git a/src/main.ts b/src/main.ts index 5fb16aa..05eb204 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { Repo, repoString, Commit } from './types'; +import { Repo, repoString, Commit, ExecSyncError } from './types'; import { execSync } from 'child_process'; import { existsSync, mkdirSync } from 'fs'; @@ -66,9 +66,9 @@ export async function main(sourceRepo: Repo, targetRepo: Repo, dryRun: boolean, // than abandoning the target tree after the insertion point and trusting in later operation to rebuild it - because // the target repo's tree will have representations of commits from _other_ (source)repos too, which we cannot // recreate without their context) - var targetCommitHistory = buildTargetCommitHistory(TARGET_DIR, reversedSourceCommitHistory[0].date); + let targetCommitHistory = buildTargetCommitHistory(TARGET_DIR, reversedSourceCommitHistory[0].date); - for (var sourceCommit of reversedSourceCommitHistory) { + for (const sourceCommit of reversedSourceCommitHistory) { // "(Index of) First Target Commit that is earlier than (or equal to) the source commit" const targetCommitIndex = targetCommitHistory.findIndex(c => c.date <= sourceCommit.date); console.log(`DEBUG - targetCommitIndex: ${targetCommitIndex}. targetCommitHistory: ${JSON.stringify(targetCommitHistory)}`); @@ -83,7 +83,7 @@ export async function main(sourceRepo: Repo, targetRepo: Repo, dryRun: boolean, throw new Error(`Target commit ${targetCommit.hash} has the same date as source commit ${sourceCommit.hash}, but they are not representations of one another. This should never happen. This means that two source repos have commits at the exact same time, which is one of the (anti-)pre-requisites of this tool. If you need this feature, let me know.`); } else { console.log(`DEBUG - No match for ${sourceCommit.hash} in ${targetCommit.hash} - inserting.`); - var followOnTargetCommit: Commit | undefined; + let followOnTargetCommit: Commit | undefined; if (targetCommitIndex == 0) { // The targetCommit is the latest (in time; first in the array) in the history - i.e. there is nothing to cherry-pick back on top of it followOnTargetCommit = undefined; @@ -133,6 +133,10 @@ export function buildSourceCommitHistory(path: string, numCommits: number): Comm // If you want to copy this formatting for debugging, it's: // // --pretty=format:'{"hash":"%h","author_name":"%an","author_email":"%ae","date":"%ai","message":"%s"}' + // + // TODO - return to this and figure out if these are _actually_ "useless escapes" or not - got a couple layers + // of string-parsing to consider here, I wouldn't want to bet without testing! + //eslint-disable-next-line no-useless-escape `git log --max-count=${numCommits} --pretty=format:'{\"hash\":\"%h\",\"author_name\":\"%an\",\"author_email\":\"%ae\",\"date\":\"%ai\",\"message\":\"%s\"}'`, { cwd: path } ); @@ -156,7 +160,10 @@ export function buildTargetCommitHistory(path: string, oldestDateInSourceCommitH ); const countedNumber = countingLogOutput.toString().split('\n').length; console.log(`DEBUG - countedNumber (how many commits in target repo since oldest source commit) is: ${countedNumber}`); + // TODO - return to this and figure out if these are _actually_ "useless escapes" or not - got a couple layers + // of string-parsing to consider here, I wouldn't want to bet without testing! const logOutput = execSync( + //eslint-disable-next-line no-useless-escape `git log --max-count=${countedNumber+1} --pretty=format:'{\"hash\":\"%h\",\"author_name\":\"%an\",\"author_email\":\"%ae\",\"date\":\"%ai\",\"message\":\"%s\"}'`, { cwd: path } ); @@ -166,7 +173,7 @@ export function buildTargetCommitHistory(path: string, oldestDateInSourceCommitH output.push(commit); } } catch (e) { - const error = e as Record; + const error = e as ExecSyncError // Now you can safely access properties // No commits in the target repo - return an empty array, which will result in the first representative commit // being made as the first commit. And then we can iterate as normal (recalling that the target history is @@ -254,7 +261,7 @@ function createRepresentativeCommit(sourceRepo: Repo,sourceCommit: Commit) { }) } catch (e) { console.log(e); - const error = e as Record; + const error = e as ExecSyncError; console.log(`DEBUG - error while creating representative commit: ${'' + error.output[2]} ... ${'' + error.output[1]}`); throw e; } diff --git a/src/types.ts b/src/types.ts index 9886cda..210222e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,3 +17,8 @@ export type Commit = { date: Date; message: string; } + +// Is there really no such thing builtin? +export type ExecSyncError = { + output: string[]; +} \ No newline at end of file